   ì¾ è¾ ã¾ {"files":{"node_modules":{"files":{"@electron-toolkit":{"files":{"preload":{"files":{"LICENSE":{"size":1074,"offset":"0","integrity":{"algorithm":"SHA256","hash":"14e3f2932ddf62cc5ee8f65f24a74b223a31f164709ca19a731b39ce60874d32","blockSize":4194304,"blocks":["14e3f2932ddf62cc5ee8f65f24a74b223a31f164709ca19a731b39ce60874d32"]}},"dist":{"files":{"index.cjs":{"size":3178,"offset":"1074","integrity":{"algorithm":"SHA256","hash":"a591a7f58d26674a10f2d404874a7b01d9ebc617419c21b74773a6c77912c067","blockSize":4194304,"blocks":["a591a7f58d26674a10f2d404874a7b01d9ebc617419c21b74773a6c77912c067"]}},"index.mjs":{"size":3010,"offset":"4252","integrity":{"algorithm":"SHA256","hash":"507f0422595d6b1f762094282ae9a88113fef8cc6957401f6d57babcaf56ba44","blockSize":4194304,"blocks":["507f0422595d6b1f762094282ae9a88113fef8cc6957401f6d57babcaf56ba44"]}}}},"package.json":{"size":755,"offset":"7262","integrity":{"algorithm":"SHA256","hash":"efb1ca72e8cffff338d8e3699fed31168f31bb39513a7a764eee8d413516f406","blockSize":4194304,"blocks":["efb1ca72e8cffff338d8e3699fed31168f31bb39513a7a764eee8d413516f406"]}}}},"utils":{"files":{"LICENSE":{"size":1074,"offset":"8017","integrity":{"algorithm":"SHA256","hash":"14e3f2932ddf62cc5ee8f65f24a74b223a31f164709ca19a731b39ce60874d32","blockSize":4194304,"blocks":["14e3f2932ddf62cc5ee8f65f24a74b223a31f164709ca19a731b39ce60874d32"]}},"dist":{"files":{"index.cjs":{"size":3021,"offset":"9091","integrity":{"algorithm":"SHA256","hash":"78da76a5b907949af248fa24acf9bc358a7010a6d800fbee8be1836a7a99bbbb","blockSize":4194304,"blocks":["78da76a5b907949af248fa24acf9bc358a7010a6d800fbee8be1836a7a99bbbb"]}},"index.d.cts":{"size":2373,"offset":"12112","integrity":{"algorithm":"SHA256","hash":"194779039dc8a41af2eefa2ff740594be9cf44333870346c20602031ad73f168","blockSize":4194304,"blocks":["194779039dc8a41af2eefa2ff740594be9cf44333870346c20602031ad73f168"]}},"index.d.mts":{"size":2373,"offset":"14485","integrity":{"algorithm":"SHA256","hash":"194779039dc8a41af2eefa2ff740594be9cf44333870346c20602031ad73f168","blockSize":4194304,"blocks":["194779039dc8a41af2eefa2ff740594be9cf44333870346c20602031ad73f168"]}},"index.mjs":{"size":2907,"offset":"16858","integrity":{"algorithm":"SHA256","hash":"adf3a06d74a13390fce0580af9d00098e76b54fe7b92602203b8996692b06219","blockSize":4194304,"blocks":["adf3a06d74a13390fce0580af9d00098e76b54fe7b92602203b8996692b06219"]}}}},"package.json":{"size":744,"offset":"19765","integrity":{"algorithm":"SHA256","hash":"9c372ef467b830858f446428a3350170a8467d3ca8a4a31f20006c548a17ddf5","blockSize":4194304,"blocks":["9c372ef467b830858f446428a3350170a8467d3ca8a4a31f20006c548a17ddf5"]}}}}}},"argparse":{"files":{"LICENSE":{"size":12775,"offset":"20509","integrity":{"algorithm":"SHA256","hash":"de4d1f2d2ad5ad0cfd1657a106476b31cb5db5ef9d1ff842b237c0c81f0c8a23","blockSize":4194304,"blocks":["de4d1f2d2ad5ad0cfd1657a106476b31cb5db5ef9d1ff842b237c0c81f0c8a23"]}},"argparse.js":{"size":129714,"offset":"33284","integrity":{"algorithm":"SHA256","hash":"2e73e7a3167ba840dbcf41feeafc3544a3e2b39220b5e997133c519861febf16","blockSize":4194304,"blocks":["2e73e7a3167ba840dbcf41feeafc3544a3e2b39220b5e997133c519861febf16"]}},"lib":{"files":{"sub.js":{"size":2252,"offset":"162998","integrity":{"algorithm":"SHA256","hash":"2bc4ef9e87c47f1a4e0cfcb3706d886e0d73edce88149e300d2364066f396ed6","blockSize":4194304,"blocks":["2bc4ef9e87c47f1a4e0cfcb3706d886e0d73edce88149e300d2364066f396ed6"]}},"textwrap.js":{"size":17391,"offset":"165250","integrity":{"algorithm":"SHA256","hash":"2550466c9a0425fa583a70e25bb93e190fe09b61f7de4861ea8ec54b7b899db0","blockSize":4194304,"blocks":["2550466c9a0425fa583a70e25bb93e190fe09b61f7de4861ea8ec54b7b899db0"]}}}},"package.json":{"size":448,"offset":"182641","integrity":{"algorithm":"SHA256","hash":"800e809f5cdb0a7dec1834e1d2c0a165b1b63c2d6d7b2a97034b8c668de24a8f","blockSize":4194304,"blocks":["800e809f5cdb0a7dec1834e1d2c0a165b1b63c2d6d7b2a97034b8c668de24a8f"]}}}},"builder-util-runtime":{"files":{"LICENSE":{"size":1084,"offset":"183089","integrity":{"algorithm":"SHA256","hash":"bed8d0ab3e6031817f775a641ff37313b0f5591bc8ba0ed79b978dafbd4231ce","blockSize":4194304,"blocks":["bed8d0ab3e6031817f775a641ff37313b0f5591bc8ba0ed79b978dafbd4231ce"]}},"out":{"files":{"CancellationToken.js":{"size":3199,"offset":"184173","integrity":{"algorithm":"SHA256","hash":"054512fdee2fe810ef46d5ce7fdc2c39d3582ee8c3d463a4ee6c954bca8ec7d5","blockSize":4194304,"blocks":["054512fdee2fe810ef46d5ce7fdc2c39d3582ee8c3d463a4ee6c954bca8ec7d5"]}},"CancellationToken.js.map":{"size":5648,"offset":"187372","integrity":{"algorithm":"SHA256","hash":"9fdf32eccac29b57c7703a23cd1201ca6a04c1b81b349900177ec1b948317c89","blockSize":4194304,"blocks":["9fdf32eccac29b57c7703a23cd1201ca6a04c1b81b349900177ec1b948317c89"]}},"MemoLazy.js":{"size":1504,"offset":"193020","integrity":{"algorithm":"SHA256","hash":"f92e496315210399d4f58381b25ab4ca17f42991b4a50a0353c7e0acd92836a3","blockSize":4194304,"blocks":["f92e496315210399d4f58381b25ab4ca17f42991b4a50a0353c7e0acd92836a3"]}},"MemoLazy.js.map":{"size":2756,"offset":"194524","integrity":{"algorithm":"SHA256","hash":"1603666315d0de55b5553b7223abfba2fdc113fc765f61c5e74d60ed4c3c7a9b","blockSize":4194304,"blocks":["1603666315d0de55b5553b7223abfba2fdc113fc765f61c5e74d60ed4c3c7a9b"]}},"ProgressCallbackTransform.js":{"size":1949,"offset":"197280","integrity":{"algorithm":"SHA256","hash":"35503895f7e7dd4329b94dd69eb48674ac55d9d6646d0ea42eada5378d433d32","blockSize":4194304,"blocks":["35503895f7e7dd4329b94dd69eb48674ac55d9d6646d0ea42eada5378d433d32"]}},"ProgressCallbackTransform.js.map":{"size":3693,"offset":"199229","integrity":{"algorithm":"SHA256","hash":"7e42abdec49293ecbd388e36213ccf743a0b12a018af5045dd23cd0ed495c7ff","blockSize":4194304,"blocks":["7e42abdec49293ecbd388e36213ccf743a0b12a018af5045dd23cd0ed495c7ff"]}},"blockMapApi.js":{"size":116,"offset":"202922","integrity":{"algorithm":"SHA256","hash":"84e270ead20b81c2c527c7cea8c295819fd015c120f67fd686c29534e036c239","blockSize":4194304,"blocks":["84e270ead20b81c2c527c7cea8c295819fd015c120f67fd686c29534e036c239"]}},"blockMapApi.js.map":{"size":403,"offset":"203038","integrity":{"algorithm":"SHA256","hash":"cbc5bfdd044fd2f70dd6edaf55449890497bdf67a05686e847da71ac96b94a33","blockSize":4194304,"blocks":["cbc5bfdd044fd2f70dd6edaf55449890497bdf67a05686e847da71ac96b94a33"]}},"error.js":{"size":255,"offset":"203441","integrity":{"algorithm":"SHA256","hash":"820464dee13ae1ca3c40d6a0f35bd49cabb154af63f872e9ed3488a0b95cca49","blockSize":4194304,"blocks":["820464dee13ae1ca3c40d6a0f35bd49cabb154af63f872e9ed3488a0b95cca49"]}},"error.js.map":{"size":454,"offset":"203696","integrity":{"algorithm":"SHA256","hash":"64580cca1bb760bd55809c02ee1b3789dd6bd3499bee30e82ed8986e3413ef95","blockSize":4194304,"blocks":["64580cca1bb760bd55809c02ee1b3789dd6bd3499bee30e82ed8986e3413ef95"]}},"httpExecutor.js":{"size":23064,"offset":"204150","integrity":{"algorithm":"SHA256","hash":"13050c5e047556326a2a17bc991dcf1e0f58b20409e0476486a6fd0ed6c577f6","blockSize":4194304,"blocks":["13050c5e047556326a2a17bc991dcf1e0f58b20409e0476486a6fd0ed6c577f6"]}},"httpExecutor.js.map":{"size":42807,"offset":"227214","integrity":{"algorithm":"SHA256","hash":"83ac73f71ec2b611f934a041cfdd60cba331ff30b239bb4053cbe41ea509a95a","blockSize":4194304,"blocks":["83ac73f71ec2b611f934a041cfdd60cba331ff30b239bb4053cbe41ea509a95a"]}},"index.js":{"size":5449,"offset":"270021","integrity":{"algorithm":"SHA256","hash":"140b927a94d361c3298a019ba7cf64f355b8ebf40e04b748be3c5b30ceb1e0c6","blockSize":4194304,"blocks":["140b927a94d361c3298a019ba7cf64f355b8ebf40e04b748be3c5b30ceb1e0c6"]}},"index.js.map":{"size":2599,"offset":"275470","integrity":{"algorithm":"SHA256","hash":"78e8e0fbca47163dd025468648cf299f66ceb4f6521db5e3fac327e759449d88","blockSize":4194304,"blocks":["78e8e0fbca47163dd025468648cf299f66ceb4f6521db5e3fac327e759449d88"]}},"objects.js":{"size":3132,"offset":"278069","integrity":{"algorithm":"SHA256","hash":"48c8df97f69197a400714a0bdbd3674485a511b8606cf3dc84448a576babcd10","blockSize":4194304,"blocks":["48c8df97f69197a400714a0bdbd3674485a511b8606cf3dc84448a576babcd10"]}},"objects.js.map":{"size":6280,"offset":"281201","integrity":{"algorithm":"SHA256","hash":"b3fffdc162c574177d44989c26c033c68836852ba8963e0ceb9059e306a80c8c","blockSize":4194304,"blocks":["b3fffdc162c574177d44989c26c033c68836852ba8963e0ceb9059e306a80c8c"]}},"publishOptions.js":{"size":2505,"offset":"287481","integrity":{"algorithm":"SHA256","hash":"48e9aa4f6e2eab4b7f2e412f26784950c4701b036a72ae451c6cef3d1eb22435","blockSize":4194304,"blocks":["48e9aa4f6e2eab4b7f2e412f26784950c4701b036a72ae451c6cef3d1eb22435"]}},"publishOptions.js.map":{"size":17843,"offset":"289986","integrity":{"algorithm":"SHA256","hash":"7e9e8e9deb02b129e6c15dbe7e85f7f340f24226428b17e34e258f77771544b2","blockSize":4194304,"blocks":["7e9e8e9deb02b129e6c15dbe7e85f7f340f24226428b17e34e258f77771544b2"]}},"retry.js":{"size":941,"offset":"307829","integrity":{"algorithm":"SHA256","hash":"f89a0e871d04334725d54112c101475b423ea93ae4db2878b6cc2404791b5b40","blockSize":4194304,"blocks":["f89a0e871d04334725d54112c101475b423ea93ae4db2878b6cc2404791b5b40"]}},"retry.js.map":{"size":1750,"offset":"308770","integrity":{"algorithm":"SHA256","hash":"94f3f24d0bc8360c9a0d8eccc766713c5d59557eff573cc1ec8bae1a5cf05c29","blockSize":4194304,"blocks":["94f3f24d0bc8360c9a0d8eccc766713c5d59557eff573cc1ec8bae1a5cf05c29"]}},"rfc2253Parser.js":{"size":2264,"offset":"310520","integrity":{"algorithm":"SHA256","hash":"a8a6966c3bc3e6cc0df40128aa591747859257563f46f56b83d76148f8e170c4","blockSize":4194304,"blocks":["a8a6966c3bc3e6cc0df40128aa591747859257563f46f56b83d76148f8e170c4"]}},"rfc2253Parser.js.map":{"size":4168,"offset":"312784","integrity":{"algorithm":"SHA256","hash":"8bcf678951773404906d4b9ceb1e6afead0c6db8a15c73b6f273f1f135b176b6","blockSize":4194304,"blocks":["8bcf678951773404906d4b9ceb1e6afead0c6db8a15c73b6f273f1f135b176b6"]}},"updateInfo.js":{"size":115,"offset":"316952","integrity":{"algorithm":"SHA256","hash":"935693e55dcf8a1e0ad653bbee7d456594835fdee0b99c9f7559befe1387043a","blockSize":4194304,"blocks":["935693e55dcf8a1e0ad653bbee7d456594835fdee0b99c9f7559befe1387043a"]}},"updateInfo.js.map":{"size":2338,"offset":"317067","integrity":{"algorithm":"SHA256","hash":"3069ad55dd2ee1fe12d69db4b43a78da7970c5a1a3886b5e27265c1b4565337a","blockSize":4194304,"blocks":["3069ad55dd2ee1fe12d69db4b43a78da7970c5a1a3886b5e27265c1b4565337a"]}},"uuid.js":{"size":6393,"offset":"319405","integrity":{"algorithm":"SHA256","hash":"5a58134245d8e5ae587e995195d3ca33d9f9e273fc077d700e675f4c4005c029","blockSize":4194304,"blocks":["5a58134245d8e5ae587e995195d3ca33d9f9e273fc077d700e675f4c4005c029"]}},"uuid.js.map":{"size":12236,"offset":"325798","integrity":{"algorithm":"SHA256","hash":"3f8dc910c8f65bcd60d13787829931ec270933c7009ee667c854a0911e84d338","blockSize":4194304,"blocks":["3f8dc910c8f65bcd60d13787829931ec270933c7009ee667c854a0911e84d338"]}},"xml.js":{"size":3549,"offset":"338034","integrity":{"algorithm":"SHA256","hash":"8f637be20077f0634bf36cac8a464973a6e1530e51f4efcfaec0f2c64df6ceb0","blockSize":4194304,"blocks":["8f637be20077f0634bf36cac8a464973a6e1530e51f4efcfaec0f2c64df6ceb0"]}},"xml.js.map":{"size":6987,"offset":"341583","integrity":{"algorithm":"SHA256","hash":"405331ede8c0bfb52033a9829b6ae9ca7f87c36b1c663c220309dad6fc8f0ca1","blockSize":4194304,"blocks":["405331ede8c0bfb52033a9829b6ae9ca7f87c36b1c663c220309dad6fc8f0ca1"]}}}},"package.json":{"size":630,"offset":"348570","integrity":{"algorithm":"SHA256","hash":"a5aefd7643b47da51c78d230068d71035cac7f660cbeaf2af5ab8953bc79b31d","blockSize":4194304,"blocks":["a5aefd7643b47da51c78d230068d71035cac7f660cbeaf2af5ab8953bc79b31d"]}}}},"debug":{"files":{"LICENSE":{"size":1139,"offset":"349200","integrity":{"algorithm":"SHA256","hash":"3a61c6c96caf5c1d9b623fb9b04c822b783dfcb78aa7e49c76a3f643e6ed7f95","blockSize":4194304,"blocks":["3a61c6c96caf5c1d9b623fb9b04c822b783dfcb78aa7e49c76a3f643e6ed7f95"]}},"package.json":{"size":910,"offset":"350339","integrity":{"algorithm":"SHA256","hash":"85f3f142cda5b1a1ed18f4a5181a6c6b31b07a6d35da48dacc507586924c7ccd","blockSize":4194304,"blocks":["85f3f142cda5b1a1ed18f4a5181a6c6b31b07a6d35da48dacc507586924c7ccd"]}},"src":{"files":{"browser.js":{"size":6103,"offset":"351249","integrity":{"algorithm":"SHA256","hash":"19920671f5902f64ad8ea11767fa50ea9d7a71ae0b7dff7ba5693c0075afc763","blockSize":4194304,"blocks":["19920671f5902f64ad8ea11767fa50ea9d7a71ae0b7dff7ba5693c0075afc763"]}},"common.js":{"size":6915,"offset":"357352","integrity":{"algorithm":"SHA256","hash":"dbe83d2bb5837f3c4d7fe537b8004c585987270eceed5b06b8e078deb0ae214a","blockSize":4194304,"blocks":["dbe83d2bb5837f3c4d7fe537b8004c585987270eceed5b06b8e078deb0ae214a"]}},"index.js":{"size":314,"offset":"364267","integrity":{"algorithm":"SHA256","hash":"aa127ff1752b7d9c7415c5c7bb6994d9aa722b81bcbcab4bd48316b013d23bf3","blockSize":4194304,"blocks":["aa127ff1752b7d9c7415c5c7bb6994d9aa722b81bcbcab4bd48316b013d23bf3"]}},"node.js":{"size":4728,"offset":"364581","integrity":{"algorithm":"SHA256","hash":"d7b26d7c92f8ea7794b77ce11f3c11cd18c9084df7c357e3c7025344fa28aac6","blockSize":4194304,"blocks":["d7b26d7c92f8ea7794b77ce11f3c11cd18c9084df7c357e3c7025344fa28aac6"]}}}}}},"electron-updater":{"files":{"LICENSE":{"size":1084,"offset":"369309","integrity":{"algorithm":"SHA256","hash":"bed8d0ab3e6031817f775a641ff37313b0f5591bc8ba0ed79b978dafbd4231ce","blockSize":4194304,"blocks":["bed8d0ab3e6031817f775a641ff37313b0f5591bc8ba0ed79b978dafbd4231ce"]}},"out":{"files":{"AppAdapter.js":{"size":740,"offset":"370393","integrity":{"algorithm":"SHA256","hash":"2fd4359fe091d7a42e2e2df8327e03aa52e202cbf593b11d9bc891cefd09caa8","blockSize":4194304,"blocks":["2fd4359fe091d7a42e2e2df8327e03aa52e202cbf593b11d9bc891cefd09caa8"]}},"AppAdapter.js.map":{"size":1814,"offset":"371133","integrity":{"algorithm":"SHA256","hash":"8e3dbb32bcedad41e5b863d6a21eb2f858d84a82185b5006ac259b3a688c5529","blockSize":4194304,"blocks":["8e3dbb32bcedad41e5b863d6a21eb2f858d84a82185b5006ac259b3a688c5529"]}},"AppImageUpdater.js":{"size":5675,"offset":"372947","integrity":{"algorithm":"SHA256","hash":"59dc2fee82511b18c8cfc1d301e663feb77674932c40808a155ba4db95cc8d61","blockSize":4194304,"blocks":["59dc2fee82511b18c8cfc1d301e663feb77674932c40808a155ba4db95cc8d61"]}},"AppImageUpdater.js.map":{"size":9265,"offset":"378622","integrity":{"algorithm":"SHA256","hash":"fa4be85b2b97e134f62ed07a399eb6830609172ae50399ba2dfd8879cb39f34d","blockSize":4194304,"blocks":["fa4be85b2b97e134f62ed07a399eb6830609172ae50399ba2dfd8879cb39f34d"]}},"AppUpdater.js":{"size":33190,"offset":"387887","integrity":{"algorithm":"SHA256","hash":"99921022d181fbd0637878fdebc74177be167d4d56a92c9a87d828f89ab67344","blockSize":4194304,"blocks":["99921022d181fbd0637878fdebc74177be167d4d56a92c9a87d828f89ab67344"]}},"AppUpdater.js.map":{"size":57020,"offset":"421077","integrity":{"algorithm":"SHA256","hash":"8192aa87b01cbe4b248255f18becc60ac0569819d398a7cf9ee9fd14244d0d6c","blockSize":4194304,"blocks":["8192aa87b01cbe4b248255f18becc60ac0569819d398a7cf9ee9fd14244d0d6c"]}},"BaseUpdater.js":{"size":6035,"offset":"478097","integrity":{"algorithm":"SHA256","hash":"9cff8b894ed709f6d9a5b938614fc377be89e1ea5bd1cc1f4cd6143048d918a3","blockSize":4194304,"blocks":["9cff8b894ed709f6d9a5b938614fc377be89e1ea5bd1cc1f4cd6143048d918a3"]}},"BaseUpdater.js.map":{"size":10539,"offset":"484132","integrity":{"algorithm":"SHA256","hash":"17f78a05184434c5d9c973f173e86c06c8c4d147618740d6720e06dc33aa2d90","blockSize":4194304,"blocks":["17f78a05184434c5d9c973f173e86c06c8c4d147618740d6720e06dc33aa2d90"]}},"DebUpdater.js":{"size":3594,"offset":"494671","integrity":{"algorithm":"SHA256","hash":"5f59636cd9a3b065c454c2ebecfdef268998fe2489c6700905f867fd0e1e63b4","blockSize":4194304,"blocks":["5f59636cd9a3b065c454c2ebecfdef268998fe2489c6700905f867fd0e1e63b4"]}},"DebUpdater.js.map":{"size":6061,"offset":"498265","integrity":{"algorithm":"SHA256","hash":"71d2813cf2d925e8e19e94ce08f709028f3e2ebb2362d14eb2603be87bedc554","blockSize":4194304,"blocks":["71d2813cf2d925e8e19e94ce08f709028f3e2ebb2362d14eb2603be87bedc554"]}},"DownloadedUpdateHelper.js":{"size":6907,"offset":"504326","integrity":{"algorithm":"SHA256","hash":"81d816fdfddf4711218f78c7625e22122b2159ec7c83209613dfb9e71a552e4d","blockSize":4194304,"blocks":["81d816fdfddf4711218f78c7625e22122b2159ec7c83209613dfb9e71a552e4d"]}},"DownloadedUpdateHelper.js.map":{"size":12251,"offset":"511233","integrity":{"algorithm":"SHA256","hash":"cef2750982fd63ef843c4a274938682a1f8e2abd1eac794f1b612fdb496b1d00","blockSize":4194304,"blocks":["cef2750982fd63ef843c4a274938682a1f8e2abd1eac794f1b612fdb496b1d00"]}},"ElectronAppAdapter.js":{"size":1180,"offset":"523484","integrity":{"algorithm":"SHA256","hash":"fa8fbf1de1c69924942aa3926878d391fba95007095836abe5f5b878506d4931","blockSize":4194304,"blocks":["fa8fbf1de1c69924942aa3926878d391fba95007095836abe5f5b878506d4931"]}},"ElectronAppAdapter.js.map":{"size":2289,"offset":"524664","integrity":{"algorithm":"SHA256","hash":"f5b740ccc773315579ac1cc893db314f1bf589d4c499073755c625e8cdfa99a0","blockSize":4194304,"blocks":["f5b740ccc773315579ac1cc893db314f1bf589d4c499073755c625e8cdfa99a0"]}},"LinuxUpdater.js":{"size":5089,"offset":"526953","integrity":{"algorithm":"SHA256","hash":"47a95d960724e5977b1d81d0e7a35b386fcd5a8ee286fa95f5a19a759e1c6558","blockSize":4194304,"blocks":["47a95d960724e5977b1d81d0e7a35b386fcd5a8ee286fa95f5a19a759e1c6558"]}},"LinuxUpdater.js.map":{"size":8236,"offset":"532042","integrity":{"algorithm":"SHA256","hash":"919fc747abe6f00f486f15cde98064d32aa0e076f849fa54bfadbf2c17d22d79","blockSize":4194304,"blocks":["919fc747abe6f00f486f15cde98064d32aa0e076f849fa54bfadbf2c17d22d79"]}},"MacUpdater.js":{"size":12866,"offset":"540278","integrity":{"algorithm":"SHA256","hash":"4824eb5d8c600f61ae69f14221f5252470b46da5be049645fa5ec10a42a5214b","blockSize":4194304,"blocks":["4824eb5d8c600f61ae69f14221f5252470b46da5be049645fa5ec10a42a5214b"]}},"MacUpdater.js.map":{"size":21163,"offset":"553144","integrity":{"algorithm":"SHA256","hash":"ae785369e1dacc09cfaf567352790124b3a3b522c983f6da6e92dee52d5afbda","blockSize":4194304,"blocks":["ae785369e1dacc09cfaf567352790124b3a3b522c983f6da6e92dee52d5afbda"]}},"NsisUpdater.js":{"size":9416,"offset":"574307","integrity":{"algorithm":"SHA256","hash":"31f36b4ef5cadd35a93df91d9454aa70044e41c0e6b4c799783dca4302cd03b6","blockSize":4194304,"blocks":["31f36b4ef5cadd35a93df91d9454aa70044e41c0e6b4c799783dca4302cd03b6"]}},"NsisUpdater.js.map":{"size":15024,"offset":"583723","integrity":{"algorithm":"SHA256","hash":"99eb686f31a06877064a9b6b991898ac63649c9d35d1089f95d6007c4821283e","blockSize":4194304,"blocks":["99eb686f31a06877064a9b6b991898ac63649c9d35d1089f95d6007c4821283e"]}},"PacmanUpdater.js":{"size":2796,"offset":"598747","integrity":{"algorithm":"SHA256","hash":"e4d76d7072d81503b49de126385c10e8592711d3a10c36e9c23fbd125d298320","blockSize":4194304,"blocks":["e4d76d7072d81503b49de126385c10e8592711d3a10c36e9c23fbd125d298320"]}},"PacmanUpdater.js.map":{"size":4838,"offset":"601543","integrity":{"algorithm":"SHA256","hash":"c51dfac79e9c9c0d01ad178ecb5554c4e0555d3d16ccba9d5890ed89df9fb309","blockSize":4194304,"blocks":["c51dfac79e9c9c0d01ad178ecb5554c4e0555d3d16ccba9d5890ed89df9fb309"]}},"RpmUpdater.js":{"size":2891,"offset":"606381","integrity":{"algorithm":"SHA256","hash":"1e05f4be81a4ac304b53d0df1f6d83dd2de7e75aee95896ce67ef8c49cf736e7","blockSize":4194304,"blocks":["1e05f4be81a4ac304b53d0df1f6d83dd2de7e75aee95896ce67ef8c49cf736e7"]}},"RpmUpdater.js.map":{"size":5376,"offset":"609272","integrity":{"algorithm":"SHA256","hash":"e38408e553e3ad88683fd53cdb0172ea9c49eb27a79bd806766dab4df59e1aa0","blockSize":4194304,"blocks":["e38408e553e3ad88683fd53cdb0172ea9c49eb27a79bd806766dab4df59e1aa0"]}},"differentialDownloader":{"files":{"DataSplitter.js":{"size":9396,"offset":"614648","integrity":{"algorithm":"SHA256","hash":"a1d74dc923cc779b1cc8b8bd6bce24879b7266b8d6f659f09f53d5e5275e9ab4","blockSize":4194304,"blocks":["a1d74dc923cc779b1cc8b8bd6bce24879b7266b8d6f659f09f53d5e5275e9ab4"]}},"DataSplitter.js.map":{"size":16649,"offset":"624044","integrity":{"algorithm":"SHA256","hash":"7e082ae113a7187cce9b8b86d02d6c1ab4c352a0e45914ef61a8e6f808798acb","blockSize":4194304,"blocks":["7e082ae113a7187cce9b8b86d02d6c1ab4c352a0e45914ef61a8e6f808798acb"]}},"DifferentialDownloader.js":{"size":12517,"offset":"640693","integrity":{"algorithm":"SHA256","hash":"428ada90afe644da1a7517670ba07aa8cc307f36587e00f2f748f8f6dbc992bd","blockSize":4194304,"blocks":["428ada90afe644da1a7517670ba07aa8cc307f36587e00f2f748f8f6dbc992bd"]}},"DifferentialDownloader.js.map":{"size":21368,"offset":"653210","integrity":{"algorithm":"SHA256","hash":"f64b2d213f3a9822e37b27e9a70604673c80e689f3ae61a15e67861015ab5b67","blockSize":4194304,"blocks":["f64b2d213f3a9822e37b27e9a70604673c80e689f3ae61a15e67861015ab5b67"]}},"FileWithEmbeddedBlockMapDifferentialDownloader.js":{"size":1861,"offset":"674578","integrity":{"algorithm":"SHA256","hash":"8f3c12c0d7e6e0284b9c9af068a0c6caa56f691997c763bb5850b8fa98c19650","blockSize":4194304,"blocks":["8f3c12c0d7e6e0284b9c9af068a0c6caa56f691997c763bb5850b8fa98c19650"]}},"FileWithEmbeddedBlockMapDifferentialDownloader.js.map":{"size":3213,"offset":"676439","integrity":{"algorithm":"SHA256","hash":"f21cdffe96e592998d830c9cf3d62cb1c209cc5aa0697dbff1e5e7b3dc7156f4","blockSize":4194304,"blocks":["f21cdffe96e592998d830c9cf3d62cb1c209cc5aa0697dbff1e5e7b3dc7156f4"]}},"GenericDifferentialDownloader.js":{"size":524,"offset":"679652","integrity":{"algorithm":"SHA256","hash":"62ca9a1d3ca12deca41ad902a24d8fec34ec150cdc194478d5b4fc987a66921b","blockSize":4194304,"blocks":["62ca9a1d3ca12deca41ad902a24d8fec34ec150cdc194478d5b4fc987a66921b"]}},"GenericDifferentialDownloader.js.map":{"size":709,"offset":"680176","integrity":{"algorithm":"SHA256","hash":"37a09dab5af73258527d65396a02363f10df71c1d4c60555b4492ee5c847aada","blockSize":4194304,"blocks":["37a09dab5af73258527d65396a02363f10df71c1d4c60555b4492ee5c847aada"]}},"ProgressDifferentialDownloadCallbackTransform.js":{"size":3824,"offset":"680885","integrity":{"algorithm":"SHA256","hash":"d4b62c2f8eec10bb8edcc0227cde609734ef344bd3e727a48cdb806ea3608ef4","blockSize":4194304,"blocks":["d4b62c2f8eec10bb8edcc0227cde609734ef344bd3e727a48cdb806ea3608ef4"]}},"ProgressDifferentialDownloadCallbackTransform.js.map":{"size":6590,"offset":"684709","integrity":{"algorithm":"SHA256","hash":"c7d2540b01b43b9a8ffde20eecd5a20d0343265d95ce3dc8cb0a32ecfcb6b304","blockSize":4194304,"blocks":["c7d2540b01b43b9a8ffde20eecd5a20d0343265d95ce3dc8cb0a32ecfcb6b304"]}},"downloadPlanBuilder.js":{"size":5517,"offset":"691299","integrity":{"algorithm":"SHA256","hash":"4ee0506c1431e86c6e693a5d118c2909f7638cc27000e3c7569cd43da08bfbf4","blockSize":4194304,"blocks":["4ee0506c1431e86c6e693a5d118c2909f7638cc27000e3c7569cd43da08bfbf4"]}},"downloadPlanBuilder.js.map":{"size":10248,"offset":"696816","integrity":{"algorithm":"SHA256","hash":"f05e73a087686a5d06a1a2ce77f539ee1250653fd192949e3dd466b328fc4898","blockSize":4194304,"blocks":["f05e73a087686a5d06a1a2ce77f539ee1250653fd192949e3dd466b328fc4898"]}},"multipleRangeDownloader.js":{"size":5066,"offset":"707064","integrity":{"algorithm":"SHA256","hash":"acb4cc89c273776d5bfc0409e032f234a4aafd1f02cc442734d6c4a5db4be4cc","blockSize":4194304,"blocks":["acb4cc89c273776d5bfc0409e032f234a4aafd1f02cc442734d6c4a5db4be4cc"]}},"multipleRangeDownloader.js.map":{"size":9247,"offset":"712130","integrity":{"algorithm":"SHA256","hash":"89b02ec3b2e23bc1e378eb73e1c6f9fb4eaa0ae592166486ae3a88f97fa6f23d","blockSize":4194304,"blocks":["89b02ec3b2e23bc1e378eb73e1c6f9fb4eaa0ae592166486ae3a88f97fa6f23d"]}}}},"electronHttpExecutor.js":{"size":3258,"offset":"721377","integrity":{"algorithm":"SHA256","hash":"907bc7f2c71c1f964fe83f71337a520073e753f3f35ea00076f5676aebaa6404","blockSize":4194304,"blocks":["907bc7f2c71c1f964fe83f71337a520073e753f3f35ea00076f5676aebaa6404"]}},"electronHttpExecutor.js.map":{"size":5547,"offset":"724635","integrity":{"algorithm":"SHA256","hash":"3e6eafc704edaa106700ef5ce03e621a33c86a974e5499d3a3551a18e4851e8a","blockSize":4194304,"blocks":["3e6eafc704edaa106700ef5ce03e621a33c86a974e5499d3a3551a18e4851e8a"]}},"main.js":{"size":4494,"offset":"730182","integrity":{"algorithm":"SHA256","hash":"c0f5cc41a2ef973672066222109850ac22fc70bcca1880e5c3cb8311f7ab05e5","blockSize":4194304,"blocks":["c0f5cc41a2ef973672066222109850ac22fc70bcca1880e5c3cb8311f7ab05e5"]}},"main.js.map":{"size":4427,"offset":"734676","integrity":{"algorithm":"SHA256","hash":"3b9ef6f5494138aa2e5f13a6d29cc07d8c9ee5546b7a278d233b0d0f9318c243","blockSize":4194304,"blocks":["3b9ef6f5494138aa2e5f13a6d29cc07d8c9ee5546b7a278d233b0d0f9318c243"]}},"providerFactory.js":{"size":3363,"offset":"739103","integrity":{"algorithm":"SHA256","hash":"b1f323d02b37f9b27439704cd48c06f41159c289cd0b3cd4e4b536231e7d5daa","blockSize":4194304,"blocks":["b1f323d02b37f9b27439704cd48c06f41159c289cd0b3cd4e4b536231e7d5daa"]}},"providerFactory.js.map":{"size":5450,"offset":"742466","integrity":{"algorithm":"SHA256","hash":"1f180fd23f1b1ce6f1b0f56e7ea8d92ecc3e86f2d53ec798ec224151c475cd29","blockSize":4194304,"blocks":["1f180fd23f1b1ce6f1b0f56e7ea8d92ecc3e86f2d53ec798ec224151c475cd29"]}},"providers":{"files":{"BitbucketProvider.js":{"size":1969,"offset":"747916","integrity":{"algorithm":"SHA256","hash":"d918e2d9a98797a36dfa777b380689282187dadf9c881e94b7e2073c8d325416","blockSize":4194304,"blocks":["d918e2d9a98797a36dfa777b380689282187dadf9c881e94b7e2073c8d325416"]}},"BitbucketProvider.js.map":{"size":3454,"offset":"749885","integrity":{"algorithm":"SHA256","hash":"bf4e8f4f4efbf1c89aa4cb4979d10e4b329cffee9726a12795bb1c5cf324703a","blockSize":4194304,"blocks":["bf4e8f4f4efbf1c89aa4cb4979d10e4b329cffee9726a12795bb1c5cf324703a"]}},"GenericProvider.js":{"size":2252,"offset":"753339","integrity":{"algorithm":"SHA256","hash":"c0d1f1aed62d7418e4d292118b3e079f9680914c554fe7604786b73771297d8a","blockSize":4194304,"blocks":["c0d1f1aed62d7418e4d292118b3e079f9680914c554fe7604786b73771297d8a"]}},"GenericProvider.js.map":{"size":3777,"offset":"755591","integrity":{"algorithm":"SHA256","hash":"32687ae2a040a8a153135d9aced2afbffe42d1ad337ce8ca53f2e899a6900640","blockSize":4194304,"blocks":["32687ae2a040a8a153135d9aced2afbffe42d1ad337ce8ca53f2e899a6900640"]}},"GitHubProvider.js":{"size":11423,"offset":"759368","integrity":{"algorithm":"SHA256","hash":"17c0ae98c1fb7943057fe88c0cc951a84acc81988813dba1aca20e911f82f601","blockSize":4194304,"blocks":["17c0ae98c1fb7943057fe88c0cc951a84acc81988813dba1aca20e911f82f601"]}},"GitHubProvider.js.map":{"size":19391,"offset":"770791","integrity":{"algorithm":"SHA256","hash":"fd3e616628b2450be2cb1e3286bf92d96a3fc63f1d50d441836a4598ef3d16b9","blockSize":4194304,"blocks":["fd3e616628b2450be2cb1e3286bf92d96a3fc63f1d50d441836a4598ef3d16b9"]}},"GitLabProvider.js":{"size":13940,"offset":"790182","integrity":{"algorithm":"SHA256","hash":"4adc8262d719fad0569af79d61af13976b6ddd6d0adfd824a156b60c8f8d2f7a","blockSize":4194304,"blocks":["4adc8262d719fad0569af79d61af13976b6ddd6d0adfd824a156b60c8f8d2f7a"]}},"GitLabProvider.js.map":{"size":22832,"offset":"804122","integrity":{"algorithm":"SHA256","hash":"10a79190f4f09ebefa448c71b0830f1089860bc6b8af771b40217dede31516aa","blockSize":4194304,"blocks":["10a79190f4f09ebefa448c71b0830f1089860bc6b8af771b40217dede31516aa"]}},"KeygenProvider.js":{"size":2205,"offset":"826954","integrity":{"algorithm":"SHA256","hash":"361cd9b7c29c6db9b94ac74947a6d4c7b48ac01a74c6b7950d9ff256ec783568","blockSize":4194304,"blocks":["361cd9b7c29c6db9b94ac74947a6d4c7b48ac01a74c6b7950d9ff256ec783568"]}},"KeygenProvider.js.map":{"size":3892,"offset":"829159","integrity":{"algorithm":"SHA256","hash":"a5082b0cd3893d9e77fbbb62cdc8a2ffa3f701c9f65c3b7ab1279eea662b3bb5","blockSize":4194304,"blocks":["a5082b0cd3893d9e77fbbb62cdc8a2ffa3f701c9f65c3b7ab1279eea662b3bb5"]}},"PrivateGitHubProvider.js":{"size":4378,"offset":"833051","integrity":{"algorithm":"SHA256","hash":"2dff56a9875d783cc0883b6a60dfbf5cfc6d4097201b3b968858f1570b6d0d2f","blockSize":4194304,"blocks":["2dff56a9875d783cc0883b6a60dfbf5cfc6d4097201b3b968858f1570b6d0d2f"]}},"PrivateGitHubProvider.js.map":{"size":8136,"offset":"837429","integrity":{"algorithm":"SHA256","hash":"af0b5ab6b329450031a9f19c54013d577183f920c2ea804a0a2dc0794d19a8ae","blockSize":4194304,"blocks":["af0b5ab6b329450031a9f19c54013d577183f920c2ea804a0a2dc0794d19a8ae"]}},"Provider.js":{"size":6002,"offset":"845565","integrity":{"algorithm":"SHA256","hash":"48601c5ceb7aaaeec096b84186a1155964128e64bbe8c009dd2d9cb9afccda37","blockSize":4194304,"blocks":["48601c5ceb7aaaeec096b84186a1155964128e64bbe8c009dd2d9cb9afccda37"]}},"Provider.js.map":{"size":11692,"offset":"851567","integrity":{"algorithm":"SHA256","hash":"a131fb662af5e7164c84b64b71402e3d84e6a3f09404a204d871f973285ea7e8","blockSize":4194304,"blocks":["a131fb662af5e7164c84b64b71402e3d84e6a3f09404a204d871f973285ea7e8"]}}}},"types.js":{"size":1551,"offset":"863259","integrity":{"algorithm":"SHA256","hash":"b92b36b9fd6ad4790a05d8ef0c1e65b875923ff098e5371a59076b20b17f2e3b","blockSize":4194304,"blocks":["b92b36b9fd6ad4790a05d8ef0c1e65b875923ff098e5371a59076b20b17f2e3b"]}},"types.js.map":{"size":3619,"offset":"864810","integrity":{"algorithm":"SHA256","hash":"3f31519e9ef41568d2308ccb5a2a7c08e54bffcd43c7547610727235babd2b3e","blockSize":4194304,"blocks":["3f31519e9ef41568d2308ccb5a2a7c08e54bffcd43c7547610727235babd2b3e"]}},"util.js":{"size":1278,"offset":"868429","integrity":{"algorithm":"SHA256","hash":"104ee9520aecd56ec9311e2ac8980d02f86b07b20010b6b59a280c61478ce1a1","blockSize":4194304,"blocks":["104ee9520aecd56ec9311e2ac8980d02f86b07b20010b6b59a280c61478ce1a1"]}},"util.js.map":{"size":2040,"offset":"869707","integrity":{"algorithm":"SHA256","hash":"1cc2ff8a950733d982b74c7f0f5f0d3a2b8af6c8a8acb255908dd14fa7058cc0","blockSize":4194304,"blocks":["1cc2ff8a950733d982b74c7f0f5f0d3a2b8af6c8a8acb255908dd14fa7058cc0"]}},"windowsExecutableCodeSignatureVerifier.js":{"size":7539,"offset":"871747","integrity":{"algorithm":"SHA256","hash":"4738e446904710a2497fd3408fdf6416c5515d9177c0add0f2427bd725969c21","blockSize":4194304,"blocks":["4738e446904710a2497fd3408fdf6416c5515d9177c0add0f2427bd725969c21"]}},"windowsExecutableCodeSignatureVerifier.js.map":{"size":11364,"offset":"879286","integrity":{"algorithm":"SHA256","hash":"ba0c5ba99b1b429a720b350e7802af84bae782b150beef9c169143758ea9115c","blockSize":4194304,"blocks":["ba0c5ba99b1b429a720b350e7802af84bae782b150beef9c169143758ea9115c"]}}}},"package.json":{"size":1037,"offset":"890650","integrity":{"algorithm":"SHA256","hash":"12cd713a0d940fe32d8b74843aeca32ad4e2674da777e635b72dd0d7252be1fd","blockSize":4194304,"blocks":["12cd713a0d940fe32d8b74843aeca32ad4e2674da777e635b72dd0d7252be1fd"]}}}},"fs-extra":{"files":{"LICENSE":{"size":1084,"offset":"891687","integrity":{"algorithm":"SHA256","hash":"1e76029602ae9b21cc4e612db2496d92febed882ba13ba745f8b3309e85f9d39","blockSize":4194304,"blocks":["1e76029602ae9b21cc4e612db2496d92febed882ba13ba745f8b3309e85f9d39"]}},"lib":{"files":{"copy":{"files":{"copy-sync.js":{"size":5776,"offset":"892771","integrity":{"algorithm":"SHA256","hash":"a50856fe7fab3d1d22e8fbf5f32543d46342257cad5e31df8f2a7409fdf19c97","blockSize":4194304,"blocks":["a50856fe7fab3d1d22e8fbf5f32543d46342257cad5e31df8f2a7409fdf19c97"]}},"copy.js":{"size":7756,"offset":"898547","integrity":{"algorithm":"SHA256","hash":"b1ef00cadd368ea903c9a86927e40636cd832d8fa64344637c96e0e223faf876","blockSize":4194304,"blocks":["b1ef00cadd368ea903c9a86927e40636cd832d8fa64344637c96e0e223faf876"]}},"index.js":{"size":147,"offset":"906303","integrity":{"algorithm":"SHA256","hash":"f94ad0b8c5f5131a682be2d0427189c260e49fa748fb6f6bcc1f78678354e5d2","blockSize":4194304,"blocks":["f94ad0b8c5f5131a682be2d0427189c260e49fa748fb6f6bcc1f78678354e5d2"]}}}},"empty":{"files":{"index.js":{"size":747,"offset":"906450","integrity":{"algorithm":"SHA256","hash":"1096edcb5ec0ed015b36914beff0826f6cd5d7ce2645ee9dee60c0b272e57856","blockSize":4194304,"blocks":["1096edcb5ec0ed015b36914beff0826f6cd5d7ce2645ee9dee60c0b272e57856"]}}}},"ensure":{"files":{"file.js":{"size":1709,"offset":"907197","integrity":{"algorithm":"SHA256","hash":"a104ff42c9aefd0e34556b9df2e4b5c9cd15315b0b0f70b07938901428b3c608","blockSize":4194304,"blocks":["a104ff42c9aefd0e34556b9df2e4b5c9cd15315b0b0f70b07938901428b3c608"]}},"index.js":{"size":542,"offset":"908906","integrity":{"algorithm":"SHA256","hash":"77ccb9b4d1eab607ce7ba8d3d5bed59b0cb9cc4748d02aa896a2413b71dbfe60","blockSize":4194304,"blocks":["77ccb9b4d1eab607ce7ba8d3d5bed59b0cb9cc4748d02aa896a2413b71dbfe60"]}},"link.js":{"size":1652,"offset":"909448","integrity":{"algorithm":"SHA256","hash":"339ce737e858367c65f79c0960bc6d1d617638aae07d396ac8ae5c8670b500c3","blockSize":4194304,"blocks":["339ce737e858367c65f79c0960bc6d1d617638aae07d396ac8ae5c8670b500c3"]}},"symlink-paths.js":{"size":3374,"offset":"911100","integrity":{"algorithm":"SHA256","hash":"5595b764059fb90ce4a13f5cdf43988da97e636521d3c599ce5260681d75bdfc","blockSize":4194304,"blocks":["5595b764059fb90ce4a13f5cdf43988da97e636521d3c599ce5260681d75bdfc"]}},"symlink-type.js":{"size":694,"offset":"914474","integrity":{"algorithm":"SHA256","hash":"17abe9590176305dd04316b2ac5c972dcf54cea32d279f955fbcf25098743dc8","blockSize":4194304,"blocks":["17abe9590176305dd04316b2ac5c972dcf54cea32d279f955fbcf25098743dc8"]}},"symlink.js":{"size":2522,"offset":"915168","integrity":{"algorithm":"SHA256","hash":"8b1fa73e5b5554380b710ccfbb4fe23764e53f0e5ce046689741310a82a19e21","blockSize":4194304,"blocks":["8b1fa73e5b5554380b710ccfbb4fe23764e53f0e5ce046689741310a82a19e21"]}}}},"fs":{"files":{"index.js":{"size":3373,"offset":"917690","integrity":{"algorithm":"SHA256","hash":"620b6e703880fd6718c354c5359a5c37a2379054c037269dbcf7afd2503e4a6f","blockSize":4194304,"blocks":["620b6e703880fd6718c354c5359a5c37a2379054c037269dbcf7afd2503e4a6f"]}}}},"index.js":{"size":358,"offset":"921063","integrity":{"algorithm":"SHA256","hash":"4967e903b3dc290f2b401b81bfcad8b2d94fd68c1bf4563df63ac082af0e1dae","blockSize":4194304,"blocks":["4967e903b3dc290f2b401b81bfcad8b2d94fd68c1bf4563df63ac082af0e1dae"]}},"json":{"files":{"index.js":{"size":508,"offset":"921421","integrity":{"algorithm":"SHA256","hash":"c5ac6a8005308e5bb36619fed225c987872300d356fa95d0d56878029ebbdc45","blockSize":4194304,"blocks":["c5ac6a8005308e5bb36619fed225c987872300d356fa95d0d56878029ebbdc45"]}},"jsonfile.js":{"size":238,"offset":"921929","integrity":{"algorithm":"SHA256","hash":"a986ad3c13166f3bf8f30b18140bfc8ea1754760ab3802aa7c8c3780d54f07ba","blockSize":4194304,"blocks":["a986ad3c13166f3bf8f30b18140bfc8ea1754760ab3802aa7c8c3780d54f07ba"]}},"output-json-sync.js":{"size":276,"offset":"922167","integrity":{"algorithm":"SHA256","hash":"a68fde22ad1a194755de03e90861805248f883342e05bd685258e76a90e7a6ab","blockSize":4194304,"blocks":["a68fde22ad1a194755de03e90861805248f883342e05bd685258e76a90e7a6ab"]}},"output-json.js":{"size":277,"offset":"922443","integrity":{"algorithm":"SHA256","hash":"b738aaf8ff9aae265b0512cb2554e1f8ce8605d21dc6230189a9be6980079fc8","blockSize":4194304,"blocks":["b738aaf8ff9aae265b0512cb2554e1f8ce8605d21dc6230189a9be6980079fc8"]}}}},"mkdirs":{"files":{"index.js":{"size":328,"offset":"922720","integrity":{"algorithm":"SHA256","hash":"adcd576e2e3868b94adb1bad6d1e3cf2312ffdfa71e49a57fe6247e116e75ecf","blockSize":4194304,"blocks":["adcd576e2e3868b94adb1bad6d1e3cf2312ffdfa71e49a57fe6247e116e75ecf"]}},"make-dir.js":{"size":545,"offset":"923048","integrity":{"algorithm":"SHA256","hash":"23c7ce8a3d6b39d1c7cf5d16ba6447c1690a6fdaa8c5f41e6b76526b7afe96f3","blockSize":4194304,"blocks":["23c7ce8a3d6b39d1c7cf5d16ba6447c1690a6fdaa8c5f41e6b76526b7afe96f3"]}},"utils.js":{"size":1655,"offset":"923593","integrity":{"algorithm":"SHA256","hash":"5372a36f4b2c5023788c23dbc6639155cb016a1b111e8fc1d6bf97cbaf11b1f8","blockSize":4194304,"blocks":["5372a36f4b2c5023788c23dbc6639155cb016a1b111e8fc1d6bf97cbaf11b1f8"]}}}},"move":{"files":{"index.js":{"size":147,"offset":"925248","integrity":{"algorithm":"SHA256","hash":"274f9fd31ac65cdc7dd9a6c568fb1163c2b043f6d5fcad30d5177961e9e3e240","blockSize":4194304,"blocks":["274f9fd31ac65cdc7dd9a6c568fb1163c2b043f6d5fcad30d5177961e9e3e240"]}},"move-sync.js":{"size":1485,"offset":"925395","integrity":{"algorithm":"SHA256","hash":"10c9f85215adcbc49661e5629d81ab4a5dbae552dd59032836d28cb2836d1cce","blockSize":4194304,"blocks":["10c9f85215adcbc49661e5629d81ab4a5dbae552dd59032836d28cb2836d1cce"]}},"move.js":{"size":2010,"offset":"926880","integrity":{"algorithm":"SHA256","hash":"5487cd460cb8af3e0b2ed0055d61185e56bea35d08c01972b7f1a87e0433aabe","blockSize":4194304,"blocks":["5487cd460cb8af3e0b2ed0055d61185e56bea35d08c01972b7f1a87e0433aabe"]}}}},"output-file":{"files":{"index.js":{"size":947,"offset":"928890","integrity":{"algorithm":"SHA256","hash":"a27d1a72ed1ecddffc57e70187a4b72467ed0dd34092b7e3d2817b9f4359ab5d","blockSize":4194304,"blocks":["a27d1a72ed1ecddffc57e70187a4b72467ed0dd34092b7e3d2817b9f4359ab5d"]}}}},"path-exists":{"files":{"index.js":{"size":263,"offset":"929837","integrity":{"algorithm":"SHA256","hash":"5ce096c95daec0259817248921b39a9e0df4d342db171138ccb62440cc7a0cbe","blockSize":4194304,"blocks":["5ce096c95daec0259817248921b39a9e0df4d342db171138ccb62440cc7a0cbe"]}}}},"remove":{"files":{"index.js":{"size":489,"offset":"930100","integrity":{"algorithm":"SHA256","hash":"ad79431e3d1cae731565d3e7403f619aee21f3b276d3541fe794ec7fd59ab0da","blockSize":4194304,"blocks":["ad79431e3d1cae731565d3e7403f619aee21f3b276d3541fe794ec7fd59ab0da"]}},"rimraf.js":{"size":7443,"offset":"930589","integrity":{"algorithm":"SHA256","hash":"931cd85d1564a59db583841196cf2773940e7eee30830514b448d2d4919cc534","blockSize":4194304,"blocks":["931cd85d1564a59db583841196cf2773940e7eee30830514b448d2d4919cc534"]}}}},"util":{"files":{"stat.js":{"size":5226,"offset":"938032","integrity":{"algorithm":"SHA256","hash":"fe33d6c739866764c937e8aaeb518bbda7a36b0f3c006855b26c5bdd846081c3","blockSize":4194304,"blocks":["fe33d6c739866764c937e8aaeb518bbda7a36b0f3c006855b26c5bdd846081c3"]}},"utimes.js":{"size":615,"offset":"943258","integrity":{"algorithm":"SHA256","hash":"4a049bcd580984957b8690fb05f7a6bf5c7e59bfc78d6817882945c35f3a44d4","blockSize":4194304,"blocks":["4a049bcd580984957b8690fb05f7a6bf5c7e59bfc78d6817882945c35f3a44d4"]}}}}}},"package.json":{"size":950,"offset":"943873","integrity":{"algorithm":"SHA256","hash":"8625f8d6674f3dacbdd5ed9fc553d9583234a6403ef90b1612f786b8fad17711","blockSize":4194304,"blocks":["8625f8d6674f3dacbdd5ed9fc553d9583234a6403ef90b1612f786b8fad17711"]}}}},"fsevents":{"unpacked":true,"files":{"LICENSE":{"size":1133,"unpacked":true,"integrity":{"algorithm":"SHA256","hash":"2a8a5d6197bb97a018b8a190dd3ed853d750ca87c8e80c17aad41d6c6ff448e1","blockSize":4194304,"blocks":["2a8a5d6197bb97a018b8a190dd3ed853d750ca87c8e80c17aad41d6c6ff448e1"]}},"fsevents.js":{"size":2483,"unpacked":true,"integrity":{"algorithm":"SHA256","hash":"1d75660f48786792f0e98d6dabfd301883c8f2a8f61aa690cbf58fb4386c0f1a","blockSize":4194304,"blocks":["1d75660f48786792f0e98d6dabfd301883c8f2a8f61aa690cbf58fb4386c0f1a"]}},"package.json":{"size":545,"unpacked":true,"integrity":{"algorithm":"SHA256","hash":"3249aa4a7d99d6fb33513f70346778aeeccf4616aac99dac5177d928f7f70779","blockSize":4194304,"blocks":["3249aa4a7d99d6fb33513f70346778aeeccf4616aac99dac5177d928f7f70779"]}},"fsevents.node":{"size":163626,"unpacked":true,"integrity":{"algorithm":"SHA256","hash":"40f2f51199e4f5fc46fa6b985fb3461bb63e6cd86c62bfa9bcee45ed4438d5fb","blockSize":4194304,"blocks":["40f2f51199e4f5fc46fa6b985fb3461bb63e6cd86c62bfa9bcee45ed4438d5fb"]}}}},"graceful-fs":{"files":{"LICENSE":{"size":791,"offset":"944823","integrity":{"algorithm":"SHA256","hash":"f65c5d9f22a317b2a10803bd1868461ce6499c2ed7217bc80c0cc772a748789c","blockSize":4194304,"blocks":["f65c5d9f22a317b2a10803bd1868461ce6499c2ed7217bc80c0cc772a748789c"]}},"clone.js":{"size":496,"offset":"945614","integrity":{"algorithm":"SHA256","hash":"7258eca52e65d69845759503f9fdd66c252f40e5eafb76db5d481172e31ac9ed","blockSize":4194304,"blocks":["7258eca52e65d69845759503f9fdd66c252f40e5eafb76db5d481172e31ac9ed"]}},"graceful-fs.js":{"size":12680,"offset":"946110","integrity":{"algorithm":"SHA256","hash":"7da35669b6b6b0e4aafee31674c033f2cebb0c8f9ae010f709dcc185d3f17786","blockSize":4194304,"blocks":["7da35669b6b6b0e4aafee31674c033f2cebb0c8f9ae010f709dcc185d3f17786"]}},"legacy-streams.js":{"size":2655,"offset":"958790","integrity":{"algorithm":"SHA256","hash":"60a6a7ecf7c3e55a3ffaae13433b6cff388b7205bba6daf393c863f77a949e36","blockSize":4194304,"blocks":["60a6a7ecf7c3e55a3ffaae13433b6cff388b7205bba6daf393c863f77a949e36"]}},"package.json":{"size":600,"offset":"961445","integrity":{"algorithm":"SHA256","hash":"5f558a45ee1f8ea431e950ab3864f842b9de5325e30a31ba1bd68f6f768457ed","blockSize":4194304,"blocks":["5f558a45ee1f8ea431e950ab3864f842b9de5325e30a31ba1bd68f6f768457ed"]}},"polyfills.js":{"size":10141,"offset":"962045","integrity":{"algorithm":"SHA256","hash":"66ea1687ed5edf39d67296d26edccc8da695d9a869303a78d0e580cd770aca27","blockSize":4194304,"blocks":["66ea1687ed5edf39d67296d26edccc8da695d9a869303a78d0e580cd770aca27"]}}}},"js-yaml":{"files":{"LICENSE":{"size":1084,"offset":"972186","integrity":{"algorithm":"SHA256","hash":"a07bc24468b9654ce76a547d47a2db282d07733b715db4c73a98bd63961f9550","blockSize":4194304,"blocks":["a07bc24468b9654ce76a547d47a2db282d07733b715db4c73a98bd63961f9550"]}},"bin":{"files":{"js-yaml.js":{"size":2658,"offset":"973270","integrity":{"algorithm":"SHA256","hash":"b3e6a451bd8bc5cba3a12851396d15fc109faf0a5a018d96b5535fe1fcfedb54","blockSize":4194304,"blocks":["b3e6a451bd8bc5cba3a12851396d15fc109faf0a5a018d96b5535fe1fcfedb54"]},"executable":true}}},"dist":{"files":{"js-yaml.js":{"size":131246,"offset":"975928","integrity":{"algorithm":"SHA256","hash":"5fec03f5a928716cf726240a1ebcebdbb0166cd61a00ab17ab363b31c0c7a44d","blockSize":4194304,"blocks":["5fec03f5a928716cf726240a1ebcebdbb0166cd61a00ab17ab363b31c0c7a44d"]}},"js-yaml.js.map":{"size":190802,"offset":"1107174","integrity":{"algorithm":"SHA256","hash":"569c167450f9469d5d222e9c189fa4bff3c69abebe349e2c8751e4a9a3faae73","blockSize":4194304,"blocks":["569c167450f9469d5d222e9c189fa4bff3c69abebe349e2c8751e4a9a3faae73"]}},"js-yaml.min.js":{"size":43527,"offset":"1297976","integrity":{"algorithm":"SHA256","hash":"666213b4657b022d0e7eb4b48cfbcae5339c5db1892fe30614f22cc65860673d","blockSize":4194304,"blocks":["666213b4657b022d0e7eb4b48cfbcae5339c5db1892fe30614f22cc65860673d"]}},"js-yaml.min.js.map":{"size":179165,"offset":"1341503","integrity":{"algorithm":"SHA256","hash":"5de083912c57672cc159df64ec3b2efe0f860ded55276357654aacd7df056b00","blockSize":4194304,"blocks":["5de083912c57672cc159df64ec3b2efe0f860ded55276357654aacd7df056b00"]}},"js-yaml.mjs":{"size":103854,"offset":"1520668","integrity":{"algorithm":"SHA256","hash":"1928c9ca89e6af32eb3c88e992c37f5b9f3befade4d62209f5bff8c58ae4f963","blockSize":4194304,"blocks":["1928c9ca89e6af32eb3c88e992c37f5b9f3befade4d62209f5bff8c58ae4f963"]}},"js-yaml.mjs.map":{"size":183102,"offset":"1624522","integrity":{"algorithm":"SHA256","hash":"1f6d1e843ebc3ea903ce0884f18ac9dd03211a820907e579bd293792aec5bd63","blockSize":4194304,"blocks":["1f6d1e843ebc3ea903ce0884f18ac9dd03211a820907e579bd293792aec5bd63"]}}}},"index.js":{"size":1585,"offset":"1807624","integrity":{"algorithm":"SHA256","hash":"e85d524fcd45466669dfc37618284e0c53ccaaf3f4bef1e23cd25ec6c43120bc","blockSize":4194304,"blocks":["e85d524fcd45466669dfc37618284e0c53ccaaf3f4bef1e23cd25ec6c43120bc"]}},"lib":{"files":{"common.js":{"size":1094,"offset":"1809209","integrity":{"algorithm":"SHA256","hash":"72216ccee36a52ece3f21f2d58a679c14c1483201ef6cbbfc4a1aa9cb6d34c9c","blockSize":4194304,"blocks":["72216ccee36a52ece3f21f2d58a679c14c1483201ef6cbbfc4a1aa9cb6d34c9c"]}},"dumper.js":{"size":30967,"offset":"1810303","integrity":{"algorithm":"SHA256","hash":"695c80b3c310ef3f6fbd232bbcd3f82464917a008c24f1e05b560f35c20116a0","blockSize":4194304,"blocks":["695c80b3c310ef3f6fbd232bbcd3f82464917a008c24f1e05b560f35c20116a0"]}},"exception.js":{"size":1285,"offset":"1841270","integrity":{"algorithm":"SHA256","hash":"9ef16628112beacc7497c3f3d0ab001c66c2db501f9e21fad4c30e7cd21d1d10","blockSize":4194304,"blocks":["9ef16628112beacc7497c3f3d0ab001c66c2db501f9e21fad4c30e7cd21d1d10"]}},"index_vite_proxy.tmp.mjs":{"size":434,"offset":"1842555","integrity":{"algorithm":"SHA256","hash":"a846cc31e1d31c304edaf94c48624568b699803a79ae2ee88d6e5c66e49552f7","blockSize":4194304,"blocks":["a846cc31e1d31c304edaf94c48624568b699803a79ae2ee88d6e5c66e49552f7"]}},"loader.js":{"size":50665,"offset":"1842989","integrity":{"algorithm":"SHA256","hash":"8b6c0d49b3cf2f3e423242b3edf4187a69aa8e35c44aa8d716af500edc6914e6","blockSize":4194304,"blocks":["8b6c0d49b3cf2f3e423242b3edf4187a69aa8e35c44aa8d716af500edc6914e6"]}},"schema.js":{"size":3257,"offset":"1893654","integrity":{"algorithm":"SHA256","hash":"dd26a9e56d934099eb53e04f242ed1962660e4e64697c300ff5c4bc1a83165da","blockSize":4194304,"blocks":["dd26a9e56d934099eb53e04f242ed1962660e4e64697c300ff5c4bc1a83165da"]}},"schema":{"files":{"core.js":{"size":284,"offset":"1896911","integrity":{"algorithm":"SHA256","hash":"201ffb119aad04c9397df088452e00910becab9a43a3b3a392370878646c06ad","blockSize":4194304,"blocks":["201ffb119aad04c9397df088452e00910becab9a43a3b3a392370878646c06ad"]}},"default.js":{"size":534,"offset":"1897195","integrity":{"algorithm":"SHA256","hash":"1c4c9573b4c05ce47391c6bcba10401385d8d6a4d596c1c0fd1d6ea664f97ea2","blockSize":4194304,"blocks":["1c4c9573b4c05ce47391c6bcba10401385d8d6a4d596c1c0fd1d6ea664f97ea2"]}},"failsafe.js":{"size":274,"offset":"1897729","integrity":{"algorithm":"SHA256","hash":"8e109fccabab5c066b66113f5d68bb74372f48bf589de39e44ed26432a98a27a","blockSize":4194304,"blocks":["8e109fccabab5c066b66113f5d68bb74372f48bf589de39e44ed26432a98a27a"]}},"json.js":{"size":519,"offset":"1898003","integrity":{"algorithm":"SHA256","hash":"b08f46efd2c45c46c6d3eaf9b05489356d80391c5f7d5094fb8ec7713e796281","blockSize":4194304,"blocks":["b08f46efd2c45c46c6d3eaf9b05489356d80391c5f7d5094fb8ec7713e796281"]}}}},"snippet.js":{"size":3063,"offset":"1898522","integrity":{"algorithm":"SHA256","hash":"c9180c66091356e16a750c07cbc21ee477d6d07e7c39b6a8622e5882cf85326d","blockSize":4194304,"blocks":["c9180c66091356e16a750c07cbc21ee477d6d07e7c39b6a8622e5882cf85326d"]}},"type.js":{"size":1736,"offset":"1901585","integrity":{"algorithm":"SHA256","hash":"a595092ee9fb6901769201ff7e5a485ee5f501bd1519d209af93b37dd2314a32","blockSize":4194304,"blocks":["a595092ee9fb6901769201ff7e5a485ee5f501bd1519d209af93b37dd2314a32"]}},"type":{"files":{"binary.js":{"size":2853,"offset":"1903321","integrity":{"algorithm":"SHA256","hash":"9dd6a70eb318a123fdc11a36d613419d79535b6ecf105bd865de3a5cbbb60e7c","blockSize":4194304,"blocks":["9dd6a70eb318a123fdc11a36d613419d79535b6ecf105bd865de3a5cbbb60e7c"]}},"bool.js":{"size":967,"offset":"1906174","integrity":{"algorithm":"SHA256","hash":"cc0d255ac6c55064421c19bbea312dcb9e22aee49fa9f8461723d9fbf7a0f8b3","blockSize":4194304,"blocks":["cc0d255ac6c55064421c19bbea312dcb9e22aee49fa9f8461723d9fbf7a0f8b3"]}},"float.js":{"size":2485,"offset":"1907141","integrity":{"algorithm":"SHA256","hash":"42b4d238e5d00267fe126996b912f34506d273c39725524d662626bb9e2d4e7e","blockSize":4194304,"blocks":["42b4d238e5d00267fe126996b912f34506d273c39725524d662626bb9e2d4e7e"]}},"int.js":{"size":3318,"offset":"1909626","integrity":{"algorithm":"SHA256","hash":"9d428a6e6de891a52b2b5ebd2bf09f9d1f9506514aaf35c6428f0111ecf86fdb","blockSize":4194304,"blocks":["9d428a6e6de891a52b2b5ebd2bf09f9d1f9506514aaf35c6428f0111ecf86fdb"]}},"map.js":{"size":188,"offset":"1912944","integrity":{"algorithm":"SHA256","hash":"6dd30a02cabaccf71c230464537bda5785093da80cd3319ed3a6481206e2ec7d","blockSize":4194304,"blocks":["6dd30a02cabaccf71c230464537bda5785093da80cd3319ed3a6481206e2ec7d"]}},"merge.js":{"size":229,"offset":"1913132","integrity":{"algorithm":"SHA256","hash":"4cd0343e63f3c3d7cea620cf122e3dd8f8d1c4c4105d384e8d82d35ae154d1e2","blockSize":4194304,"blocks":["4cd0343e63f3c3d7cea620cf122e3dd8f8d1c4c4105d384e8d82d35ae154d1e2"]}},"null.js":{"size":791,"offset":"1913361","integrity":{"algorithm":"SHA256","hash":"5eea804da258ba10fa736199ed0cef9d89dbb01eac1c1bd3609a79a132d1885e","blockSize":4194304,"blocks":["5eea804da258ba10fa736199ed0cef9d89dbb01eac1c1bd3609a79a132d1885e"]}},"omap.js":{"size":999,"offset":"1914152","integrity":{"algorithm":"SHA256","hash":"711911528cddf768c4b800c565e15168e72d2433670094c8936b7693c126867f","blockSize":4194304,"blocks":["711911528cddf768c4b800c565e15168e72d2433670094c8936b7693c126867f"]}},"pairs.js":{"size":1031,"offset":"1915151","integrity":{"algorithm":"SHA256","hash":"f9eb5d2dc3cdbf7dd802e0a62b5aa2d09eedeb0509b71a247ebdad223315d6a5","blockSize":4194304,"blocks":["f9eb5d2dc3cdbf7dd802e0a62b5aa2d09eedeb0509b71a247ebdad223315d6a5"]}},"seq.js":{"size":189,"offset":"1916182","integrity":{"algorithm":"SHA256","hash":"3a38b7f3242737c2e21462c42a8da1682325686cb2b30dc3630e515cf9c45522","blockSize":4194304,"blocks":["3a38b7f3242737c2e21462c42a8da1682325686cb2b30dc3630e515cf9c45522"]}},"set.js":{"size":547,"offset":"1916371","integrity":{"algorithm":"SHA256","hash":"fa5b815c6334def52dae5b58193d3798f8e53558f6c7f48a643898e996333dd7","blockSize":4194304,"blocks":["fa5b815c6334def52dae5b58193d3798f8e53558f6c7f48a643898e996333dd7"]}},"str.js":{"size":187,"offset":"1916918","integrity":{"algorithm":"SHA256","hash":"1f8725eac2dc7bed4b91610f21796ed3c057cee44b81a1ae8cc9beb9cd6c63ff","blockSize":4194304,"blocks":["1f8725eac2dc7bed4b91610f21796ed3c057cee44b81a1ae8cc9beb9cd6c63ff"]}},"timestamp.js":{"size":2364,"offset":"1917105","integrity":{"algorithm":"SHA256","hash":"54e2070e0319d7fa3becd426dd5bfdb822b9602bd4a3c366976cbaa2278bdb5c","blockSize":4194304,"blocks":["54e2070e0319d7fa3becd426dd5bfdb822b9602bd4a3c366976cbaa2278bdb5c"]}}}}}},"package.json":{"size":1357,"offset":"1919469","integrity":{"algorithm":"SHA256","hash":"208b17b8b3e81aff5f816933a1ad37c5145ee8cd494dc01fac3c70cb4d884623","blockSize":4194304,"blocks":["208b17b8b3e81aff5f816933a1ad37c5145ee8cd494dc01fac3c70cb4d884623"]}}}},"jsonfile":{"files":{"LICENSE":{"size":1110,"offset":"1920826","integrity":{"algorithm":"SHA256","hash":"a9801fb52ba22ef808682a094da8a7a480584b7ed0dfd0d888ab543616335031","blockSize":4194304,"blocks":["a9801fb52ba22ef808682a094da8a7a480584b7ed0dfd0d888ab543616335031"]}},"index.js":{"size":2014,"offset":"1921936","integrity":{"algorithm":"SHA256","hash":"ec5a9f1f45014486f1df4a8c11a5b078671e9936c0651e035b67cb5e763954e8","blockSize":4194304,"blocks":["ec5a9f1f45014486f1df4a8c11a5b078671e9936c0651e035b67cb5e763954e8"]}},"package.json":{"size":558,"offset":"1923950","integrity":{"algorithm":"SHA256","hash":"19b7f70104b503224fc101fc465fb40765b077aa1f996f2d008463689a4fe4e6","blockSize":4194304,"blocks":["19b7f70104b503224fc101fc465fb40765b077aa1f996f2d008463689a4fe4e6"]}},"utils.js":{"size":613,"offset":"1924508","integrity":{"algorithm":"SHA256","hash":"3a37b4b21c2cd8f75b850f1373f68a39bcaab3ac58d75ab44e62674cdb0d4cad","blockSize":4194304,"blocks":["3a37b4b21c2cd8f75b850f1373f68a39bcaab3ac58d75ab44e62674cdb0d4cad"]}}}},"lazy-val":{"files":{"out":{"files":{"main.js":{"size":605,"offset":"1925121","integrity":{"algorithm":"SHA256","hash":"358fa8cba70c9140edafa85c0b7b25c7261939480186167e6b3440905f5b47da","blockSize":4194304,"blocks":["358fa8cba70c9140edafa85c0b7b25c7261939480186167e6b3440905f5b47da"]}},"main.js.map":{"size":1156,"offset":"1925726","integrity":{"algorithm":"SHA256","hash":"aa3e70f08a0ce115832e5324c4b96aa1475a3b8b36728f50091ebd22aa0f6646","blockSize":4194304,"blocks":["aa3e70f08a0ce115832e5324c4b96aa1475a3b8b36728f50091ebd22aa0f6646"]}}}},"package.json":{"size":330,"offset":"1926882","integrity":{"algorithm":"SHA256","hash":"a6f4140d0187f32d95545835aca38684e18d0fcfbecb51709b0aaa54decd3c0b","blockSize":4194304,"blocks":["a6f4140d0187f32d95545835aca38684e18d0fcfbecb51709b0aaa54decd3c0b"]}}}},"lodash.escaperegexp":{"files":{"LICENSE":{"size":1951,"offset":"1927212","integrity":{"algorithm":"SHA256","hash":"ffd8b33b354585f4ce119f19c53728281e48a97b074491eb6bf6d5c5ff305272","blockSize":4194304,"blocks":["ffd8b33b354585f4ce119f19c53728281e48a97b074491eb6bf6d5c5ff305272"]}},"index.js":{"size":4398,"offset":"1929163","integrity":{"algorithm":"SHA256","hash":"584de6ec78e35344eaef8291338a671f223ec225c4df4220b6f91d8f0c004d8d","blockSize":4194304,"blocks":["584de6ec78e35344eaef8291338a671f223ec225c4df4220b6f91d8f0c004d8d"]}},"package.json":{"size":356,"offset":"1933561","integrity":{"algorithm":"SHA256","hash":"c71b659d3f3f5dfab55d736b6bd17d97f822b13bcf9b1edbce479f8e691e7892","blockSize":4194304,"blocks":["c71b659d3f3f5dfab55d736b6bd17d97f822b13bcf9b1edbce479f8e691e7892"]}}}},"lodash.isequal":{"files":{"LICENSE":{"size":1950,"offset":"1933917","integrity":{"algorithm":"SHA256","hash":"e159c6d48c989185448658f276375bfb2300362ec6d4ae5525a2d49c4bcb947d","blockSize":4194304,"blocks":["e159c6d48c989185448658f276375bfb2300362ec6d4ae5525a2d49c4bcb947d"]}},"index.js":{"size":49598,"offset":"1935867","integrity":{"algorithm":"SHA256","hash":"e552928a511748303101cfd03826a777cfa359eade6a4a60f92c923edbf9184c","blockSize":4194304,"blocks":["e552928a511748303101cfd03826a777cfa359eade6a4a60f92c923edbf9184c"]}},"package.json":{"size":346,"offset":"1985465","integrity":{"algorithm":"SHA256","hash":"6e84ac44b54c17317d096a280e9d0bd72d736e0a0245095cc7c5d72657890406","blockSize":4194304,"blocks":["6e84ac44b54c17317d096a280e9d0bd72d736e0a0245095cc7c5d72657890406"]}}}},"ms":{"files":{"index.js":{"size":3024,"offset":"1985811","integrity":{"algorithm":"SHA256","hash":"e5f0b6a946a9b2b356a28557728410717df54ea2f599edb619f9839df6b7b0e9","blockSize":4194304,"blocks":["e5f0b6a946a9b2b356a28557728410717df54ea2f599edb619f9839df6b7b0e9"]}},"license.md":{"size":1079,"offset":"1988835","integrity":{"algorithm":"SHA256","hash":"1662fae9b5314d11cf51284e2dcd1f006a354f7343f08712a730fcff9a359801","blockSize":4194304,"blocks":["1662fae9b5314d11cf51284e2dcd1f006a354f7343f08712a730fcff9a359801"]}},"package.json":{"size":497,"offset":"1989914","integrity":{"algorithm":"SHA256","hash":"f983ec581f1dd5a47b7f12b58f97c0b44c4e0cce56cbecc40140031aeef99bdf","blockSize":4194304,"blocks":["f983ec581f1dd5a47b7f12b58f97c0b44c4e0cce56cbecc40140031aeef99bdf"]}}}},"playwright":{"files":{"LICENSE":{"size":11601,"offset":"1990411","integrity":{"algorithm":"SHA256","hash":"45873d00a0dd243596deb4aa23b2493b3d1f0671921bf2538ea431d7380220eb","blockSize":4194304,"blocks":["45873d00a0dd243596deb4aa23b2493b3d1f0671921bf2538ea431d7380220eb"]}},"NOTICE":{"size":254,"offset":"2002012","integrity":{"algorithm":"SHA256","hash":"6d602191187b35b9b01d2cffa01c8469c2c8d9de8a96f1bf868e0f264f51c81d","blockSize":4194304,"blocks":["6d602191187b35b9b01d2cffa01c8469c2c8d9de8a96f1bf868e0f264f51c81d"]}},"ThirdPartyNotices.txt":{"size":705,"offset":"2002266","integrity":{"algorithm":"SHA256","hash":"b17ac0bd6f4b8207e440639cc8e0ba1bf1d9eaf9b12236764ab93b346c7abd8e","blockSize":4194304,"blocks":["b17ac0bd6f4b8207e440639cc8e0ba1bf1d9eaf9b12236764ab93b346c7abd8e"]}},"cli.js":{"size":698,"offset":"2002971","integrity":{"algorithm":"SHA256","hash":"5e79302a6aad7d835d92d5ae6b4244c91cf61b28e94d7917279090e6c231f7a1","blockSize":4194304,"blocks":["5e79302a6aad7d835d92d5ae6b4244c91cf61b28e94d7917279090e6c231f7a1"]},"executable":true},"index.js":{"size":648,"offset":"2003669","integrity":{"algorithm":"SHA256","hash":"4e98f65f0a9d9bcab8cffc0c5cfdd87fd3f5b0be74fc494ff166a466b204cd44","blockSize":4194304,"blocks":["4e98f65f0a9d9bcab8cffc0c5cfdd87fd3f5b0be74fc494ff166a466b204cd44"]}},"index.mjs":{"size":704,"offset":"2004317","integrity":{"algorithm":"SHA256","hash":"a0f5715ea22354f922791a9c53dc012d5d5c067ff9cc4cd35ffb7cd272071a9f","blockSize":4194304,"blocks":["a0f5715ea22354f922791a9c53dc012d5d5c067ff9cc4cd35ffb7cd272071a9f"]}},"jsx-runtime.js":{"size":942,"offset":"2005021","integrity":{"algorithm":"SHA256","hash":"2fefb7ec3a42dcf1cea35ca7e3eb107507c4d80821b1d6abf6cfc9bca36498f0","blockSize":4194304,"blocks":["2fefb7ec3a42dcf1cea35ca7e3eb107507c4d80821b1d6abf6cfc9bca36498f0"]}},"jsx-runtime.mjs":{"size":764,"offset":"2005963","integrity":{"algorithm":"SHA256","hash":"a6ae8df3a36f154f433b01fe1592170500f5fbe7798f6dacdfea5b492f31d1a6","blockSize":4194304,"blocks":["a6ae8df3a36f154f433b01fe1592170500f5fbe7798f6dacdfea5b492f31d1a6"]}},"lib":{"files":{"agents":{"files":{"agentParser.js":{"size":3475,"offset":"2006727","integrity":{"algorithm":"SHA256","hash":"a2f630c1c2c9eafa0a3ca9cdbeaa26e74801615bc572e3fce226acb662ceb0eb","blockSize":4194304,"blocks":["a2f630c1c2c9eafa0a3ca9cdbeaa26e74801615bc572e3fce226acb662ceb0eb"]}},"copilot-setup-steps.yml":{"size":646,"offset":"2010202","integrity":{"algorithm":"SHA256","hash":"57f0fa74a9cc9e5abdf46846167d6e7d5a5aa274399cb5896616530db7b85da1","blockSize":4194304,"blocks":["57f0fa74a9cc9e5abdf46846167d6e7d5a5aa274399cb5896616530db7b85da1"]}},"generateAgents.js":{"size":16958,"offset":"2010848","integrity":{"algorithm":"SHA256","hash":"3bae7bde1d05c0fbaaa1a82ce7a39732ff52904de575fe88e69c391a6c41478e","blockSize":4194304,"blocks":["3bae7bde1d05c0fbaaa1a82ce7a39732ff52904de575fe88e69c391a6c41478e"]}},"playwright-test-coverage.prompt.md":{"size":1294,"offset":"2027806","integrity":{"algorithm":"SHA256","hash":"8e8a32e98c7069c8af29a088a91999c81dafbeb09a144b143ebe888b48b94355","blockSize":4194304,"blocks":["8e8a32e98c7069c8af29a088a91999c81dafbeb09a144b143ebe888b48b94355"]}},"playwright-test-generate.prompt.md":{"size":175,"offset":"2029100","integrity":{"algorithm":"SHA256","hash":"6031c3eacf1e55d527a0397066b64d134d9f925fd7286bcc78646e714611da10","blockSize":4194304,"blocks":["6031c3eacf1e55d527a0397066b64d134d9f925fd7286bcc78646e714611da10"]}},"playwright-test-generator.agent.md":{"size":3336,"offset":"2029275","integrity":{"algorithm":"SHA256","hash":"0a61b313ff2573198fc89c7ab5b7e7db1c557193a470104ac90b2d6a0332be80","blockSize":4194304,"blocks":["0a61b313ff2573198fc89c7ab5b7e7db1c557193a470104ac90b2d6a0332be80"]}},"playwright-test-heal.prompt.md":{"size":105,"offset":"2032611","integrity":{"algorithm":"SHA256","hash":"19f2bea9648ddac89b90b40a3f87b50c276d416677f8bb2fbcdac894cdb6946b","blockSize":4194304,"blocks":["19f2bea9648ddac89b90b40a3f87b50c276d416677f8bb2fbcdac894cdb6946b"]}},"playwright-test-healer.agent.md":{"size":2891,"offset":"2032716","integrity":{"algorithm":"SHA256","hash":"b3e1d85219df5ead7e3ef0dc69959b0263cc16e885f71d5b64bafdf97e6f9215","blockSize":4194304,"blocks":["b3e1d85219df5ead7e3ef0dc69959b0263cc16e885f71d5b64bafdf97e6f9215"]}},"playwright-test-plan.prompt.md":{"size":196,"offset":"2035607","integrity":{"algorithm":"SHA256","hash":"6ce2c51b356b4e89ac1e3c2b8b3ff0a390c7b518c1d4d24f019f9eb179cd6669","blockSize":4194304,"blocks":["6ce2c51b356b4e89ac1e3c2b8b3ff0a390c7b518c1d4d24f019f9eb179cd6669"]}},"playwright-test-planner.agent.md":{"size":2808,"offset":"2035803","integrity":{"algorithm":"SHA256","hash":"bf4baa68205aa04c4512a80bcc6a5362d3aaa76ae9165f05a9d5a29e1d34c0fd","blockSize":4194304,"blocks":["bf4baa68205aa04c4512a80bcc6a5362d3aaa76ae9165f05a9d5a29e1d34c0fd"]}}}},"cli":{"files":{"reportActions.js":{"size":3562,"offset":"2038611","integrity":{"algorithm":"SHA256","hash":"1ea9e8660db28045b853a54c24493b08029e148d9a0ee6e88027e409b497e3f1","blockSize":4194304,"blocks":["1ea9e8660db28045b853a54c24493b08029e148d9a0ee6e88027e409b497e3f1"]}},"testActions.js":{"size":9372,"offset":"2042173","integrity":{"algorithm":"SHA256","hash":"44a4770714406134d1135b77d3b4388b557a7decb7f24094e637b6a5d517dd48","blockSize":4194304,"blocks":["44a4770714406134d1135b77d3b4388b557a7decb7f24094e637b6a5d517dd48"]}}}},"common":{"files":{"index.js":{"size":115552,"offset":"2051545","integrity":{"algorithm":"SHA256","hash":"f06ef2600a7ec53a67dc86e3f3ef809b7df3d81a848f5cad35a81675f531a321","blockSize":4194304,"blocks":["f06ef2600a7ec53a67dc86e3f3ef809b7df3d81a848f5cad35a81675f531a321"]}},"index.js.txt":{"size":1430,"offset":"2167097","integrity":{"algorithm":"SHA256","hash":"9f21a01a6e63f1a8f48c9330d8e35d7a973bce2953c02f5103c77e091c1c6c2c","blockSize":4194304,"blocks":["9f21a01a6e63f1a8f48c9330d8e35d7a973bce2953c02f5103c77e091c1c6c2c"]}}}},"errorContext.js":{"size":4619,"offset":"2168527","integrity":{"algorithm":"SHA256","hash":"7fdc8216d80ba10c5edea9617463da2e76ba56d966a14a963176952415d03871","blockSize":4194304,"blocks":["7fdc8216d80ba10c5edea9617463da2e76ba56d966a14a963176952415d03871"]}},"globals.js":{"size":1935,"offset":"2173146","integrity":{"algorithm":"SHA256","hash":"f5922eb1fb6051900157492eb9c218e62d07378eed135bca4b2f173ed1184d1c","blockSize":4194304,"blocks":["f5922eb1fb6051900157492eb9c218e62d07378eed135bca4b2f173ed1184d1c"]}},"index.js":{"size":34528,"offset":"2175081","integrity":{"algorithm":"SHA256","hash":"033484bd04076585fa11954261323575a2f8ec12ca113f0c288dac67009fbf9f","blockSize":4194304,"blocks":["033484bd04076585fa11954261323575a2f8ec12ca113f0c288dac67009fbf9f"]}},"isomorphic.js":{"size":8191,"offset":"2209609","integrity":{"algorithm":"SHA256","hash":"3d61508f951aa9518adb4bf6594d61dfd1099c95a1a4f0af809a58ccebc59025","blockSize":4194304,"blocks":["3d61508f951aa9518adb4bf6594d61dfd1099c95a1a4f0af809a58ccebc59025"]}},"isomorphic.js.txt":{"size":267,"offset":"2217800","integrity":{"algorithm":"SHA256","hash":"36c16ae5721dfe8ac2555e84d26b5895b7ca113e7304bd3735a16d56b5a71b3c","blockSize":4194304,"blocks":["36c16ae5721dfe8ac2555e84d26b5895b7ca113e7304bd3735a16d56b5a71b3c"]}},"loader":{"files":{"loaderProcessEntry.js":{"size":1262,"offset":"2218067","integrity":{"algorithm":"SHA256","hash":"45681332f4178770c204b33e5b8dcbba940baf3bc6fc86506bab24027cb513f3","blockSize":4194304,"blocks":["45681332f4178770c204b33e5b8dcbba940baf3bc6fc86506bab24027cb513f3"]}},"loaderProcessEntry.js.txt":{"size":234,"offset":"2219329","integrity":{"algorithm":"SHA256","hash":"0fc4ad550d17a23e9f1cbc78f646e57461f4feb22253dd5220034ef44091005c","blockSize":4194304,"blocks":["0fc4ad550d17a23e9f1cbc78f646e57461f4feb22253dd5220034ef44091005c"]}}}},"matchers":{"files":{"expect.js":{"size":526213,"offset":"2219563","integrity":{"algorithm":"SHA256","hash":"78fb9c8cb3214b6ff753e8444034f60ad740e5f16225bac879bb7bca3055fb62","blockSize":4194304,"blocks":["78fb9c8cb3214b6ff753e8444034f60ad740e5f16225bac879bb7bca3055fb62"]}},"expect.js.LICENSE":{"size":39215,"offset":"2745776","integrity":{"algorithm":"SHA256","hash":"4de4f5013cf10f5e438eb155af434c36083395e7c2c52d0385b4a7cbab71391e","blockSize":4194304,"blocks":["4de4f5013cf10f5e438eb155af434c36083395e7c2c52d0385b4a7cbab71391e"]}},"expect.js.txt":{"size":3903,"offset":"2784991","integrity":{"algorithm":"SHA256","hash":"161ca3c9bc3edc5e3a549edaad90d499d54531a2cf5f282559da1a0978186165","blockSize":4194304,"blocks":["161ca3c9bc3edc5e3a549edaad90d499d54531a2cf5f282559da1a0978186165"]}}}},"mcp":{"files":{"test":{"files":{"browserBackend.js":{"size":4889,"offset":"2788894","integrity":{"algorithm":"SHA256","hash":"7143473e53c8b76720e42efab95f55227807590d2818104223d5df6ac46b681e","blockSize":4194304,"blocks":["7143473e53c8b76720e42efab95f55227807590d2818104223d5df6ac46b681e"]}},"generatorTools.js":{"size":5427,"offset":"2793783","integrity":{"algorithm":"SHA256","hash":"3c53feaeb9fc2ff728f334cb31f9b7211e65b20c692c7585459c3c97bdd13a12","blockSize":4194304,"blocks":["3c53feaeb9fc2ff728f334cb31f9b7211e65b20c692c7585459c3c97bdd13a12"]}},"plannerTools.js":{"size":6379,"offset":"2799210","integrity":{"algorithm":"SHA256","hash":"715abc888d9ea30b532b75c6f09aa34101ab15c1eeb959c50cf9dedcf3a459ac","blockSize":4194304,"blocks":["715abc888d9ea30b532b75c6f09aa34101ab15c1eeb959c50cf9dedcf3a459ac"]}},"seed.js":{"size":3239,"offset":"2805589","integrity":{"algorithm":"SHA256","hash":"f36f7fb76d4ed33225e80be208cccc9757d363a9d1527cf560736c0f1e5edd31","blockSize":4194304,"blocks":["f36f7fb76d4ed33225e80be208cccc9757d363a9d1527cf560736c0f1e5edd31"]}},"streams.js":{"size":1577,"offset":"2808828","integrity":{"algorithm":"SHA256","hash":"8affc240a6a90ee2dbdedcde9927018efe426ec0d390bcd1ee4f0464e75adc0f","blockSize":4194304,"blocks":["8affc240a6a90ee2dbdedcde9927018efe426ec0d390bcd1ee4f0464e75adc0f"]}},"testBackend.js":{"size":4067,"offset":"2810405","integrity":{"algorithm":"SHA256","hash":"dcd8d09366617f13213ce544efb5fe47df5a87258ae93545d4d0738623f43ad1","blockSize":4194304,"blocks":["dcd8d09366617f13213ce544efb5fe47df5a87258ae93545d4d0738623f43ad1"]}},"testContext.js":{"size":11637,"offset":"2814472","integrity":{"algorithm":"SHA256","hash":"74ff4273ea12e6353d4860c9452387b643d7d8899fbd4951389ba94d18df5e37","blockSize":4194304,"blocks":["74ff4273ea12e6353d4860c9452387b643d7d8899fbd4951389ba94d18df5e37"]}},"testTool.js":{"size":1104,"offset":"2826109","integrity":{"algorithm":"SHA256","hash":"2a8f17d0a61ccb8a4ca9c52a3255d624deca989c0b06281d579629c664f8cc8e","blockSize":4194304,"blocks":["2a8f17d0a61ccb8a4ca9c52a3255d624deca989c0b06281d579629c664f8cc8e"]}},"testTools.js":{"size":3714,"offset":"2827213","integrity":{"algorithm":"SHA256","hash":"14710b5f34246005d974762b83a2a50e5cc17130af841cd3bc447811d69c6af7","blockSize":4194304,"blocks":["14710b5f34246005d974762b83a2a50e5cc17130af841cd3bc447811d69c6af7"]}}}}}},"package.js":{"size":2013,"offset":"2830927","integrity":{"algorithm":"SHA256","hash":"544a18417ea51dd4c8a9f3dbc4e2b47e46c80f452e0cd23d55e9b3680bc6241e","blockSize":4194304,"blocks":["544a18417ea51dd4c8a9f3dbc4e2b47e46c80f452e0cd23d55e9b3680bc6241e"]}},"program.js":{"size":13581,"offset":"2832940","integrity":{"algorithm":"SHA256","hash":"2fcbb3f041bd810ffe66fdb5f1253179c31311e2acbf716a0f254b6f683a5e0d","blockSize":4194304,"blocks":["2fcbb3f041bd810ffe66fdb5f1253179c31311e2acbf716a0f254b6f683a5e0d"]}},"runner":{"files":{"index.js":{"size":297798,"offset":"2846521","integrity":{"algorithm":"SHA256","hash":"42772378ebad5d2387726d02d377721112edbdde99d495c1259855ddb701b08e","blockSize":4194304,"blocks":["42772378ebad5d2387726d02d377721112edbdde99d495c1259855ddb701b08e"]}},"index.js.txt":{"size":2857,"offset":"3144319","integrity":{"algorithm":"SHA256","hash":"045afc17f5bdcfcb0ea6931bf1a7221a247105c86264eb008bbf74f246810c25","blockSize":4194304,"blocks":["045afc17f5bdcfcb0ea6931bf1a7221a247105c86264eb008bbf74f246810c25"]}}}},"transform":{"files":{"babelBundle.js":{"size":2789601,"offset":"3147176","integrity":{"algorithm":"SHA256","hash":"9201df11ae9c9ee1febd587c5013c4f862aa7e9981b92b86ccbbbd37e71f9124","blockSize":4194304,"blocks":["9201df11ae9c9ee1febd587c5013c4f862aa7e9981b92b86ccbbbd37e71f9124"]}},"babelBundle.js.LICENSE":{"size":121614,"offset":"5936777","integrity":{"algorithm":"SHA256","hash":"676fa240edb9d844720e8e42e61be5457a4ced8dae0c6e63efb4b85e95d2d276","blockSize":4194304,"blocks":["676fa240edb9d844720e8e42e61be5457a4ced8dae0c6e63efb4b85e95d2d276"]}},"babelBundle.js.txt":{"size":21706,"offset":"6058391","integrity":{"algorithm":"SHA256","hash":"4f8cd1987142f0cac537e30835b45c6fc18953451d74aa3bd9d82729fd0fdf1d","blockSize":4194304,"blocks":["4f8cd1987142f0cac537e30835b45c6fc18953451d74aa3bd9d82729fd0fdf1d"]}},"esmLoader.js":{"size":255065,"offset":"6080097","integrity":{"algorithm":"SHA256","hash":"184d831ae4ec32d6f4e91c8c7801a28058ecd22c54e0bf3012240b20d6cedd74","blockSize":4194304,"blocks":["184d831ae4ec32d6f4e91c8c7801a28058ecd22c54e0bf3012240b20d6cedd74"]}},"esmLoader.js.LICENSE":{"size":17875,"offset":"6335162","integrity":{"algorithm":"SHA256","hash":"1e61a7d29900da9ab323e85c2b89066e5d899a95b94f33aedc5f11d02d3da31a","blockSize":4194304,"blocks":["1e61a7d29900da9ab323e85c2b89066e5d899a95b94f33aedc5f11d02d3da31a"]}},"esmLoader.js.txt":{"size":2465,"offset":"6353037","integrity":{"algorithm":"SHA256","hash":"31e80fb604166449150c3c0d7559c1fd53f9e1ace1725f2b870300523cb4038d","blockSize":4194304,"blocks":["31e80fb604166449150c3c0d7559c1fd53f9e1ace1725f2b870300523cb4038d"]}}}},"util.js":{"size":15165,"offset":"6355502","integrity":{"algorithm":"SHA256","hash":"6d5e08165ec78f576d4724c0e4693d07cf1e8e2662156daa706e380550d272a5","blockSize":4194304,"blocks":["6d5e08165ec78f576d4724c0e4693d07cf1e8e2662156daa706e380550d272a5"]}},"worker":{"files":{"workerProcessEntry.js":{"size":75892,"offset":"6370667","integrity":{"algorithm":"SHA256","hash":"e8b654850c073df3996816eb09edf845490d9a6e75785477a9ddb69d586cca54","blockSize":4194304,"blocks":["e8b654850c073df3996816eb09edf845490d9a6e75785477a9ddb69d586cca54"]}},"workerProcessEntry.js.txt":{"size":692,"offset":"6446559","integrity":{"algorithm":"SHA256","hash":"9731733268a00b6f3f3ac31174d3b1203848f61d8f516ffafe977420e9803d2a","blockSize":4194304,"blocks":["9731733268a00b6f3f3ac31174d3b1203848f61d8f516ffafe977420e9803d2a"]}}}}}},"package.json":{"size":1559,"offset":"6447251","integrity":{"algorithm":"SHA256","hash":"6b840268612656f0639fb7d68782e8353bdf11518589d30ddf66f283c2670ed5","blockSize":4194304,"blocks":["6b840268612656f0639fb7d68782e8353bdf11518589d30ddf66f283c2670ed5"]}},"test.js":{"size":806,"offset":"6448810","integrity":{"algorithm":"SHA256","hash":"b97fa53a6ab864f51c9c48b5e4647d0acae45ba2948c5d78e38bfeb56755d974","blockSize":4194304,"blocks":["b97fa53a6ab864f51c9c48b5e4647d0acae45ba2948c5d78e38bfeb56755d974"]}},"test.mjs":{"size":1400,"offset":"6449616","integrity":{"algorithm":"SHA256","hash":"1deb265617d0e87b6d05bf8b3d5bf73cd4b788665c249c609a01b94ceff2eea1","blockSize":4194304,"blocks":["1deb265617d0e87b6d05bf8b3d5bf73cd4b788665c249c609a01b94ceff2eea1"]}}}},"playwright-core":{"files":{"LICENSE":{"size":11601,"offset":"6451016","integrity":{"algorithm":"SHA256","hash":"45873d00a0dd243596deb4aa23b2493b3d1f0671921bf2538ea431d7380220eb","blockSize":4194304,"blocks":["45873d00a0dd243596deb4aa23b2493b3d1f0671921bf2538ea431d7380220eb"]}},"NOTICE":{"size":254,"offset":"6462617","integrity":{"algorithm":"SHA256","hash":"6d602191187b35b9b01d2cffa01c8469c2c8d9de8a96f1bf868e0f264f51c81d","blockSize":4194304,"blocks":["6d602191187b35b9b01d2cffa01c8469c2c8d9de8a96f1bf868e0f264f51c81d"]}},"ThirdPartyNotices.txt":{"size":676,"offset":"6462871","integrity":{"algorithm":"SHA256","hash":"a549d329bad8806fe279f0ecae0fc0270dec7e7c2dc8ec10f90e394f7c32b144","blockSize":4194304,"blocks":["a549d329bad8806fe279f0ecae0fc0270dec7e7c2dc8ec10f90e394f7c32b144"]}},"bin":{"files":{"install_media_pack.ps1":{"size":174,"offset":"6463547","integrity":{"algorithm":"SHA256","hash":"bc20f049badf021e3a53bdb4156603caa5ef482c9a9a251f927605e676a44171","blockSize":4194304,"blocks":["bc20f049badf021e3a53bdb4156603caa5ef482c9a9a251f927605e676a44171"]}},"install_webkit_wsl.ps1":{"size":1464,"offset":"6463721","integrity":{"algorithm":"SHA256","hash":"bc61beda37a808eef27d39ce684baa792f6d17737a25a432b1a84d3b591ab815","blockSize":4194304,"blocks":["bc61beda37a808eef27d39ce684baa792f6d17737a25a432b1a84d3b591ab815"]}},"reinstall_chrome_beta_linux.sh":{"size":1217,"offset":"6465185","integrity":{"algorithm":"SHA256","hash":"dc8c22b9dde76583cece2857575b88094299615f3136a3c598149710c45dee3a","blockSize":4194304,"blocks":["dc8c22b9dde76583cece2857575b88094299615f3136a3c598149710c45dee3a"]},"executable":true},"reinstall_chrome_beta_mac.sh":{"size":563,"offset":"6466402","integrity":{"algorithm":"SHA256","hash":"a92eaeb4ebcf5633a4e9c981481e14c80764fc81b6fcbc0565398e50ff319433","blockSize":4194304,"blocks":["a92eaeb4ebcf5633a4e9c981481e14c80764fc81b6fcbc0565398e50ff319433"]},"executable":true},"reinstall_chrome_beta_win.ps1":{"size":957,"offset":"6466965","integrity":{"algorithm":"SHA256","hash":"b6d9e44742feafb98d5edc56fa20042949973cf30d141a1c5b4fb384096967c5","blockSize":4194304,"blocks":["b6d9e44742feafb98d5edc56fa20042949973cf30d141a1c5b4fb384096967c5"]}},"reinstall_chrome_stable_linux.sh":{"size":1212,"offset":"6467922","integrity":{"algorithm":"SHA256","hash":"dc72ab3567a4ce43bd8353d4ecf41f1d9c03e870169367cd3ed9043aabf67dd1","blockSize":4194304,"blocks":["dc72ab3567a4ce43bd8353d4ecf41f1d9c03e870169367cd3ed9043aabf67dd1"]},"executable":true},"reinstall_chrome_stable_mac.sh":{"size":519,"offset":"6469134","integrity":{"algorithm":"SHA256","hash":"bb43a96c192a6cc81524ade0264686fff7809c019a89f7db0a9849635879c3be","blockSize":4194304,"blocks":["bb43a96c192a6cc81524ade0264686fff7809c019a89f7db0a9849635879c3be"]},"executable":true},"reinstall_chrome_stable_win.ps1":{"size":923,"offset":"6469653","integrity":{"algorithm":"SHA256","hash":"3d96c4e2f4ebbb3fad44cf3ba58d9cf90af1c9fb3073e3b27d45a74cf005515b","blockSize":4194304,"blocks":["3d96c4e2f4ebbb3fad44cf3ba58d9cf90af1c9fb3073e3b27d45a74cf005515b"]}},"reinstall_msedge_beta_linux.sh":{"size":1494,"offset":"6470576","integrity":{"algorithm":"SHA256","hash":"10b26f35dbc2000b94edf1172d803a29c5873a4eb8d523afbc687997b642767e","blockSize":4194304,"blocks":["10b26f35dbc2000b94edf1172d803a29c5873a4eb8d523afbc687997b642767e"]},"executable":true},"reinstall_msedge_beta_mac.sh":{"size":377,"offset":"6472070","integrity":{"algorithm":"SHA256","hash":"0036d738bc90d686100d81f328ba0003bf07863f5500b792c8da391d149750fa","blockSize":4194304,"blocks":["0036d738bc90d686100d81f328ba0003bf07863f5500b792c8da391d149750fa"]},"executable":true},"reinstall_msedge_beta_win.ps1":{"size":874,"offset":"6472447","integrity":{"algorithm":"SHA256","hash":"b173c378a59f0cc38033cee702de1f44f09276c9b2270d1a650ebe66ee312433","blockSize":4194304,"blocks":["b173c378a59f0cc38033cee702de1f44f09276c9b2270d1a650ebe66ee312433"]}},"reinstall_msedge_dev_linux.sh":{"size":1489,"offset":"6473321","integrity":{"algorithm":"SHA256","hash":"00e4947e7a4f8339c6db09c87976d808583c07f9179e4aa7694d88614b82fe95","blockSize":4194304,"blocks":["00e4947e7a4f8339c6db09c87976d808583c07f9179e4aa7694d88614b82fe95"]},"executable":true},"reinstall_msedge_dev_mac.sh":{"size":372,"offset":"6474810","integrity":{"algorithm":"SHA256","hash":"6f899e3b311f742c24ca37ff9e32298e8290514ffc14bf588cc51556a29da4c0","blockSize":4194304,"blocks":["6f899e3b311f742c24ca37ff9e32298e8290514ffc14bf588cc51556a29da4c0"]},"executable":true},"reinstall_msedge_dev_win.ps1":{"size":869,"offset":"6475182","integrity":{"algorithm":"SHA256","hash":"46f7f98c81cb0abe687d7f4a5afea9b897a38d2a6dd6f6662fbd847f7a22bd51","blockSize":4194304,"blocks":["46f7f98c81cb0abe687d7f4a5afea9b897a38d2a6dd6f6662fbd847f7a22bd51"]}},"reinstall_msedge_stable_linux.sh":{"size":1507,"offset":"6476051","integrity":{"algorithm":"SHA256","hash":"ec0a31a5f09c565e108473a1850895a4458ab00c713ac1de3aa2001912e4668f","blockSize":4194304,"blocks":["ec0a31a5f09c565e108473a1850895a4458ab00c713ac1de3aa2001912e4668f"]},"executable":true},"reinstall_msedge_stable_mac.sh":{"size":371,"offset":"6477558","integrity":{"algorithm":"SHA256","hash":"3af1e893527ff2257aa2dbc3b259a053b92f45c3eadb13e38eba46e87902655d","blockSize":4194304,"blocks":["3af1e893527ff2257aa2dbc3b259a053b92f45c3eadb13e38eba46e87902655d"]},"executable":true},"reinstall_msedge_stable_win.ps1":{"size":856,"offset":"6477929","integrity":{"algorithm":"SHA256","hash":"40bb5fcbfcebbbe2ce43c6e736e7c5deefc5be03b6e9c6914423c06ec1f591be","blockSize":4194304,"blocks":["40bb5fcbfcebbbe2ce43c6e736e7c5deefc5be03b6e9c6914423c06ec1f591be"]}}}},"browsers.json":{"size":1939,"offset":"6478785","integrity":{"algorithm":"SHA256","hash":"ee39bc924bc3d1bd895626c2910f1292d109bbfeeb5abd113acb45e1951cc942","blockSize":4194304,"blocks":["ee39bc924bc3d1bd895626c2910f1292d109bbfeeb5abd113acb45e1951cc942"]}},"cli.js":{"size":839,"offset":"6480724","integrity":{"algorithm":"SHA256","hash":"f1c4075aef116c766092250d7f37b3249a7cee6465d953207fc38c8f6145becd","blockSize":4194304,"blocks":["f1c4075aef116c766092250d7f37b3249a7cee6465d953207fc38c8f6145becd"]},"executable":true},"index.js":{"size":697,"offset":"6481563","integrity":{"algorithm":"SHA256","hash":"a58fb2cec4293e7dcf73c58a179898a4f3986666451a19da4e731fa3af63265b","blockSize":4194304,"blocks":["a58fb2cec4293e7dcf73c58a179898a4f3986666451a19da4e731fa3af63265b"]}},"index.mjs":{"size":1063,"offset":"6482260","integrity":{"algorithm":"SHA256","hash":"3d36e2132d3c8b62397d23f0bb4177336aaee503203ae2a2c90fbeb5bf3317dd","blockSize":4194304,"blocks":["3d36e2132d3c8b62397d23f0bb4177336aaee503203ae2a2c90fbeb5bf3317dd"]}},"lib":{"files":{"bootstrap.js":{"size":3481,"offset":"6483323","integrity":{"algorithm":"SHA256","hash":"97ffe165e8e45f1b51a713b3f380d383e4e183727135fe9a5e045ec62e9310ab","blockSize":4194304,"blocks":["97ffe165e8e45f1b51a713b3f380d383e4e183727135fe9a5e045ec62e9310ab"]}},"coreBundle.js":{"size":3352341,"offset":"6486804","integrity":{"algorithm":"SHA256","hash":"6be5c2ea035554e9b184b1dbc7aa5e7f1fb428dd1b5c202022858dcfae9bee27","blockSize":4194304,"blocks":["6be5c2ea035554e9b184b1dbc7aa5e7f1fb428dd1b5c202022858dcfae9bee27"]}},"entry":{"files":{"cliDaemon.js":{"size":197,"offset":"9839145","integrity":{"algorithm":"SHA256","hash":"062f256fb29a7bf91793a014b9c3f1f9cf2dc6b12e40a8a2ebba88a630ae16a0","blockSize":4194304,"blocks":["062f256fb29a7bf91793a014b9c3f1f9cf2dc6b12e40a8a2ebba88a630ae16a0"]}},"dashboardApp.js":{"size":108,"offset":"9839342","integrity":{"algorithm":"SHA256","hash":"209962c6eaeef11629f226d6a2ab33ec7a2480754242b6e19590a9e6eb71d126","blockSize":4194304,"blocks":["209962c6eaeef11629f226d6a2ab33ec7a2480754242b6e19590a9e6eb71d126"]}},"mcp.js":{"size":442,"offset":"9839450","integrity":{"algorithm":"SHA256","hash":"cc87dc0020cb41caebbf04f50e42bc7835b033a6d80e9c3f0a3d0b3dbdf341c7","blockSize":4194304,"blocks":["cc87dc0020cb41caebbf04f50e42bc7835b033a6d80e9c3f0a3d0b3dbdf341c7"]}},"oopBrowserDownload.js":{"size":120,"offset":"9839892","integrity":{"algorithm":"SHA256","hash":"87567cdbd67dd2f50bb232d47d3784701ece7c81e39c0287bb7d1b466b68cf06","blockSize":4194304,"blocks":["87567cdbd67dd2f50bb232d47d3784701ece7c81e39c0287bb7d1b466b68cf06"]}}}},"package.js":{"size":2112,"offset":"9840012","integrity":{"algorithm":"SHA256","hash":"9f938e1d44a0dd231b1660ca62f7dae964859b79cbdc370b8542c5d375ca3c05","blockSize":4194304,"blocks":["9f938e1d44a0dd231b1660ca62f7dae964859b79cbdc370b8542c5d375ca3c05"]}},"server":{"files":{"chromium":{"files":{"appIcon.png":{"size":16565,"offset":"9842124","integrity":{"algorithm":"SHA256","hash":"6ba994f05c5cf18e22d9b6bef9898fbdec6ad4d4d77f5187d0609cb42d72d01e","blockSize":4194304,"blocks":["6ba994f05c5cf18e22d9b6bef9898fbdec6ad4d4d77f5187d0609cb42d72d01e"]}}}},"deviceDescriptorsSource.json":{"size":80785,"offset":"9858689","integrity":{"algorithm":"SHA256","hash":"796ff93bfd5e38b84541a1e8745a7abcbccba54d440fb3b7a1acec0655d056cc","blockSize":4194304,"blocks":["796ff93bfd5e38b84541a1e8745a7abcbccba54d440fb3b7a1acec0655d056cc"]}},"electron":{"files":{"loader.js":{"size":4821,"offset":"9939474","integrity":{"algorithm":"SHA256","hash":"8c99c632a9fcef9d691160954d01acdf374ba15566e153bef7fb61b0d3796e6d","blockSize":4194304,"blocks":["8c99c632a9fcef9d691160954d01acdf374ba15566e153bef7fb61b0d3796e6d"]}}}}}},"serverRegistry.js":{"size":247050,"offset":"9944295","integrity":{"algorithm":"SHA256","hash":"85f63dbf8dc73fa651dcf046a732d78a86dbda401084b1d144d5a1ef1a59730d","blockSize":4194304,"blocks":["85f63dbf8dc73fa651dcf046a732d78a86dbda401084b1d144d5a1ef1a59730d"]}},"serverRegistry.js.LICENSE":{"size":18617,"offset":"10191345","integrity":{"algorithm":"SHA256","hash":"5cf540fe55a2ba9bcf0eb76e739b454faa8581e2f1a0f777602ef0855534302e","blockSize":4194304,"blocks":["5cf540fe55a2ba9bcf0eb76e739b454faa8581e2f1a0f777602ef0855534302e"]}},"tools":{"files":{"cli-client":{"files":{"channelSessions.js":{"size":7087,"offset":"10209962","integrity":{"algorithm":"SHA256","hash":"6b9c613e87340f48ad7182addd7495a8ff3fbe55feb1bbd0ce04f59f1552e126","blockSize":4194304,"blocks":["6b9c613e87340f48ad7182addd7495a8ff3fbe55feb1bbd0ce04f59f1552e126"]}},"cli.js":{"size":153,"offset":"10217049","integrity":{"algorithm":"SHA256","hash":"dfde8e9dfde30c4b3914eb25ba1c5a8524ec64651d866171d75cd7b41a827180","blockSize":4194304,"blocks":["dfde8e9dfde30c4b3914eb25ba1c5a8524ec64651d866171d75cd7b41a827180"]}},"help.json":{"size":36596,"offset":"10217202","integrity":{"algorithm":"SHA256","hash":"961a8792b8b4e43f6d28d8d3029f6b3b7fa2e04d04d84fb0590bd0d759d2c456","blockSize":4194304,"blocks":["961a8792b8b4e43f6d28d8d3029f6b3b7fa2e04d04d84fb0590bd0d759d2c456"]}},"minimist.js":{"size":4106,"offset":"10253798","integrity":{"algorithm":"SHA256","hash":"1d200627373a367e0097f1abeaaa4d67cde2c33f2e5efca5cb55222c7667adc3","blockSize":4194304,"blocks":["1d200627373a367e0097f1abeaaa4d67cde2c33f2e5efca5cb55222c7667adc3"]}},"output.js":{"size":11703,"offset":"10257904","integrity":{"algorithm":"SHA256","hash":"2eace914547a487b2aa1dc34af787fe92168f0b7b3dde24f2b127e817cc9b2b4","blockSize":4194304,"blocks":["2eace914547a487b2aa1dc34af787fe92168f0b7b3dde24f2b127e817cc9b2b4"]}},"program.js":{"size":16054,"offset":"10269607","integrity":{"algorithm":"SHA256","hash":"722f00475112d4a3b569af51172e0bd88d1e4627a65ed8a2245031e08e7cc1ec","blockSize":4194304,"blocks":["722f00475112d4a3b569af51172e0bd88d1e4627a65ed8a2245031e08e7cc1ec"]}},"registry.js":{"size":6662,"offset":"10285661","integrity":{"algorithm":"SHA256","hash":"c11d278e05542808ba37bdb032018eccf9dc78377f8025bd74fa906ae009ca30","blockSize":4194304,"blocks":["c11d278e05542808ba37bdb032018eccf9dc78377f8025bd74fa906ae009ca30"]}},"session.js":{"size":9395,"offset":"10292323","integrity":{"algorithm":"SHA256","hash":"c47202e7886ddd17ad2ce3e7f4b893f751e0e074cb1111a8bbc20fd33ecec800","blockSize":4194304,"blocks":["c47202e7886ddd17ad2ce3e7f4b893f751e0e074cb1111a8bbc20fd33ecec800"]}},"skill":{"files":{"SKILL.md":{"size":11869,"offset":"10301718","integrity":{"algorithm":"SHA256","hash":"b4c81c39e39f30e4790607e57b12283878f3751daca9c0e44f301899f2108b13","blockSize":4194304,"blocks":["b4c81c39e39f30e4790607e57b12283878f3751daca9c0e44f301899f2108b13"]}},"references":{"files":{"element-attributes.md":{"size":665,"offset":"10313587","integrity":{"algorithm":"SHA256","hash":"bf19aa4671e0a50a0fefa9c790f39124e803060eefe395042b723c29fcb7faa2","blockSize":4194304,"blocks":["bf19aa4671e0a50a0fefa9c790f39124e803060eefe395042b723c29fcb7faa2"]}},"playwright-tests.md":{"size":1690,"offset":"10314252","integrity":{"algorithm":"SHA256","hash":"c5b0719fef2cfdff50bd744051b2f9afc119775db4b48e9b2882c1cf3886797c","blockSize":4194304,"blocks":["c5b0719fef2cfdff50bd744051b2f9afc119775db4b48e9b2882c1cf3886797c"]}},"request-mocking.md":{"size":2182,"offset":"10315942","integrity":{"algorithm":"SHA256","hash":"54e801c9663fc2b6d68ceb058cb1c360724c2499f42acc7852a68e83e5b5f37c","blockSize":4194304,"blocks":["54e801c9663fc2b6d68ceb058cb1c360724c2499f42acc7852a68e83e5b5f37c"]}},"running-code.md":{"size":5642,"offset":"10318124","integrity":{"algorithm":"SHA256","hash":"d95c539a5990b71d02d8bdf1d9414df16191eb6cff95b0063820518b7a13dcb2","blockSize":4194304,"blocks":["d95c539a5990b71d02d8bdf1d9414df16191eb6cff95b0063820518b7a13dcb2"]}},"session-management.md":{"size":5671,"offset":"10323766","integrity":{"algorithm":"SHA256","hash":"cd3e261b8763bf952f1e371b876cb78d054379afec85482f9250633e1b7e6c44","blockSize":4194304,"blocks":["cd3e261b8763bf952f1e371b876cb78d054379afec85482f9250633e1b7e6c44"]}},"spec-driven-testing.md":{"size":11578,"offset":"10329437","integrity":{"algorithm":"SHA256","hash":"3326b3af65ed6e05180aa394a7fd578f29822e67bde9f22f7c7f94e6c8e3a594","blockSize":4194304,"blocks":["3326b3af65ed6e05180aa394a7fd578f29822e67bde9f22f7c7f94e6c8e3a594"]}},"storage-state.md":{"size":5198,"offset":"10341015","integrity":{"algorithm":"SHA256","hash":"9ac47f9ae4a1aedcd2077f8ac9ab1ba6bee1962cb83ff51adcd36fb6d83b5ec6","blockSize":4194304,"blocks":["9ac47f9ae4a1aedcd2077f8ac9ab1ba6bee1962cb83ff51adcd36fb6d83b5ec6"]}},"test-generation.md":{"size":4585,"offset":"10346213","integrity":{"algorithm":"SHA256","hash":"2a9c4d94effa31b05cf367dfa8bbace8874a3bc9799987ad2b03269af224d299","blockSize":4194304,"blocks":["2a9c4d94effa31b05cf367dfa8bbace8874a3bc9799987ad2b03269af224d299"]}},"tracing.md":{"size":3440,"offset":"10350798","integrity":{"algorithm":"SHA256","hash":"792e0ac7705e56ac48df84c0f5400221ce86107897c671590a64a4ea6a82508e","blockSize":4194304,"blocks":["792e0ac7705e56ac48df84c0f5400221ce86107897c671590a64a4ea6a82508e"]}},"video-recording.md":{"size":5387,"offset":"10354238","integrity":{"algorithm":"SHA256","hash":"8555ab5400df0d90e66318aacc0a8a4418fbf872e7463824d55d5c41615abd83","blockSize":4194304,"blocks":["8555ab5400df0d90e66318aacc0a8a4418fbf872e7463824d55d5c41615abd83"]}}}}}}}},"dashboard":{"files":{"appIcon.png":{"size":18945,"offset":"10359625","integrity":{"algorithm":"SHA256","hash":"38037bcf18c7f9b950da2e1a2d8800d38fb27637ccda293d38368a3704b67f18","blockSize":4194304,"blocks":["38037bcf18c7f9b950da2e1a2d8800d38fb27637ccda293d38368a3704b67f18"]}}}},"trace":{"files":{"SKILL.md":{"size":4712,"offset":"10378570","integrity":{"algorithm":"SHA256","hash":"df85506bfa8a445c961efa1ac244cca733667b717711bcc99c1f93994c29d5dc","blockSize":4194304,"blocks":["df85506bfa8a445c961efa1ac244cca733667b717711bcc99c1f93994c29d5dc"]}}}},"utils":{"files":{"extension.js":{"size":3132,"offset":"10383282","integrity":{"algorithm":"SHA256","hash":"c07d365ccff8c7fab3d65848bc01616c74e422f3be7b1c0e7b587b84ef866ada","blockSize":4194304,"blocks":["c07d365ccff8c7fab3d65848bc01616c74e422f3be7b1c0e7b587b84ef866ada"]}},"socketConnection.js":{"size":3317,"offset":"10386414","integrity":{"algorithm":"SHA256","hash":"973c2bea70a1f1445f4673f99e9fa351e50a2ec9fd93d7381b2c41bb4de764dd","blockSize":4194304,"blocks":["973c2bea70a1f1445f4673f99e9fa351e50a2ec9fd93d7381b2c41bb4de764dd"]}}}}}},"utilsBundle.js":{"size":3143574,"offset":"10389731","integrity":{"algorithm":"SHA256","hash":"1295945f0054d2504c9b751945b15aa3c672530ad5a340f3f9636e5e238f304a","blockSize":4194304,"blocks":["1295945f0054d2504c9b751945b15aa3c672530ad5a340f3f9636e5e238f304a"]}},"utilsBundle.js.LICENSE":{"size":110417,"offset":"13533305","integrity":{"algorithm":"SHA256","hash":"e3f91eea8ba98019d8e65ec61756af34a67e170070005a09d1fc6f49a64b544b","blockSize":4194304,"blocks":["e3f91eea8ba98019d8e65ec61756af34a67e170070005a09d1fc6f49a64b544b"]}},"vite":{"files":{"dashboard":{"files":{"assets":{"files":{"codicon-DCmgc-ay.ttf":{"size":80340,"offset":"13643722","integrity":{"algorithm":"SHA256","hash":"0f1d5219934e96e83b8db162d60b4d8c09b5de1e7d38031cbafe4a3c0f2889c9","blockSize":4194304,"blocks":["0f1d5219934e96e83b8db162d60b4d8c09b5de1e7d38031cbafe4a3c0f2889c9"]}},"firefox-1bWoP6pv.svg":{"size":7488,"offset":"13724062","integrity":{"algorithm":"SHA256","hash":"3f3742d1e78c0db6c2d3531250f70c30675ee5310de32fa89befaf738c54efd0","blockSize":4194304,"blocks":["3f3742d1e78c0db6c2d3531250f70c30675ee5310de32fa89befaf738c54efd0"]}},"firefox-beta-k3eOH_eK.svg":{"size":9280,"offset":"13731550","integrity":{"algorithm":"SHA256","hash":"7eab5ffdc25903ba33a7202f7fffa1999f119c7be45a39e9e703c118904f917a","blockSize":4194304,"blocks":["7eab5ffdc25903ba33a7202f7fffa1999f119c7be45a39e9e703c118904f917a"]}},"firefox-nightly-Cp5nfeDT.svg":{"size":9143,"offset":"13740830","integrity":{"algorithm":"SHA256","hash":"f311c074b0fa999fcd6b73441301fb54ee87a48ff3bf05f318647928110476da","blockSize":4194304,"blocks":["f311c074b0fa999fcd6b73441301fb54ee87a48ff3bf05f318647928110476da"]}},"index-BY2S1tHT.css":{"size":142433,"offset":"13749973","integrity":{"algorithm":"SHA256","hash":"4e741ba6be0fb15305f6dfd907e245e68554f6dbd5282a58dcc1e9d2493eb917","blockSize":4194304,"blocks":["4e741ba6be0fb15305f6dfd907e245e68554f6dbd5282a58dcc1e9d2493eb917"]}},"index-C_5TMfeg.js":{"size":331501,"offset":"13892406","integrity":{"algorithm":"SHA256","hash":"cf991b92763fb3b3759e9c5b9839e3625b351041db4199501a53c3c82bd2e28c","blockSize":4194304,"blocks":["cf991b92763fb3b3759e9c5b9839e3625b351041db4199501a53c3c82bd2e28c"]}},"safari-na3_-uQk.svg":{"size":5254,"offset":"14223907","integrity":{"algorithm":"SHA256","hash":"80fd72ca5eb8545f1981277b31f4f92951d469d4efebd078e4086b676fe517dc","blockSize":4194304,"blocks":["80fd72ca5eb8545f1981277b31f4f92951d469d4efebd078e4086b676fe517dc"]}}}},"index.html":{"size":1078,"offset":"14229161","integrity":{"algorithm":"SHA256","hash":"1025839f364c006a0a3b6f94196a630fdbec355cfe15de3777d975e725c915c7","blockSize":4194304,"blocks":["1025839f364c006a0a3b6f94196a630fdbec355cfe15de3777d975e725c915c7"]}},"playwright-logo.svg":{"size":5645,"offset":"14230239","integrity":{"algorithm":"SHA256","hash":"511524a1c145819303a18fb71870a4307c3e740f9e9722f7686a2b42b0995b6c","blockSize":4194304,"blocks":["511524a1c145819303a18fb71870a4307c3e740f9e9722f7686a2b42b0995b6c"]}}}},"htmlReport":{"files":{"index.html":{"size":464,"offset":"14235884","integrity":{"algorithm":"SHA256","hash":"ce7c098020a0eb9ce10edd416245ea6da50dfeaab18dfd0a2176979d22643be6","blockSize":4194304,"blocks":["ce7c098020a0eb9ce10edd416245ea6da50dfeaab18dfd0a2176979d22643be6"]}},"report.css":{"size":108330,"offset":"14236348","integrity":{"algorithm":"SHA256","hash":"3298f11062d5112516c8b3fa2368c6138b4700aa9fa215bb5fc0a1f0efe94e3f","blockSize":4194304,"blocks":["3298f11062d5112516c8b3fa2368c6138b4700aa9fa215bb5fc0a1f0efe94e3f"]}},"report.js":{"size":416009,"offset":"14344678","integrity":{"algorithm":"SHA256","hash":"9e7baad230ee5aec5af605ac4687687cf0e079f3299423811aa9768543d8947b","blockSize":4194304,"blocks":["9e7baad230ee5aec5af605ac4687687cf0e079f3299423811aa9768543d8947b"]}}}},"recorder":{"files":{"assets":{"files":{"codeMirrorModule-DYBRYzYX.css":{"size":6421,"offset":"14760687","integrity":{"algorithm":"SHA256","hash":"70bf421a13e87857ca684bfa2cc55f06d7c5a50f71253a3ff1d74769b14a957e","blockSize":4194304,"blocks":["70bf421a13e87857ca684bfa2cc55f06d7c5a50f71253a3ff1d74769b14a957e"]}},"codeMirrorModule-DeBYQozu.js":{"size":313009,"offset":"14767108","integrity":{"algorithm":"SHA256","hash":"f4ad79265956fe5186af9d2b8ebcf4c0e40ec8d0405ab623471a6cecb22bc1d7","blockSize":4194304,"blocks":["f4ad79265956fe5186af9d2b8ebcf4c0e40ec8d0405ab623471a6cecb22bc1d7"]}},"codicon-DCmgc-ay.ttf":{"size":80340,"offset":"15080117","integrity":{"algorithm":"SHA256","hash":"0f1d5219934e96e83b8db162d60b4d8c09b5de1e7d38031cbafe4a3c0f2889c9","blockSize":4194304,"blocks":["0f1d5219934e96e83b8db162d60b4d8c09b5de1e7d38031cbafe4a3c0f2889c9"]}},"index-4ZiSSCmn.css":{"size":92234,"offset":"15160457","integrity":{"algorithm":"SHA256","hash":"4278e600a533667369328e9eb52a212693d52e46072ec37228e0ef8621a48ead","blockSize":4194304,"blocks":["4278e600a533667369328e9eb52a212693d52e46072ec37228e0ef8621a48ead"]}},"index-Bq-mQf8S.js":{"size":365888,"offset":"15252691","integrity":{"algorithm":"SHA256","hash":"b9215ab0e84dba105788f7ae82559892b4ebab1e9c7cde479d00a381e8375c40","blockSize":4194304,"blocks":["b9215ab0e84dba105788f7ae82559892b4ebab1e9c7cde479d00a381e8375c40"]}}}},"index.html":{"size":1078,"offset":"15618579","integrity":{"algorithm":"SHA256","hash":"a02e5446589dc2515a986f9944918029df332418db0f706a819d3bf1a0bf7fa3","blockSize":4194304,"blocks":["a02e5446589dc2515a986f9944918029df332418db0f706a819d3bf1a0bf7fa3"]}},"playwright-logo.svg":{"size":5033,"offset":"15619657","integrity":{"algorithm":"SHA256","hash":"6b0a4367bdeab10995bc239278f04c68c10e48adbec15e799e01909a0d66dcb9","blockSize":4194304,"blocks":["6b0a4367bdeab10995bc239278f04c68c10e48adbec15e799e01909a0d66dcb9"]}}}},"traceViewer":{"files":{"assets":{"files":{"codeMirrorModule-LEHpjmcn.js":{"size":313054,"offset":"15624690","integrity":{"algorithm":"SHA256","hash":"e3d682edfb4dd1fa17882466dd15058120278b27ff1101785a57b6df4db7ada5","blockSize":4194304,"blocks":["e3d682edfb4dd1fa17882466dd15058120278b27ff1101785a57b6df4db7ada5"]}},"defaultSettingsView-BNmKHKpQ.js":{"size":658064,"offset":"15937744","integrity":{"algorithm":"SHA256","hash":"f21839cd274944763d12ad24529345b9f8ebf339409f51f4dbe52f9d9baeb09c","blockSize":4194304,"blocks":["f21839cd274944763d12ad24529345b9f8ebf339409f51f4dbe52f9d9baeb09c"]}},"urlMatch-BYQrIQwR.js":{"size":819,"offset":"16595808","integrity":{"algorithm":"SHA256","hash":"168c4dee4815ea8d3c131a504033cd23d4b15aefa0209dd10ad3f643e8f1d8a7","blockSize":4194304,"blocks":["168c4dee4815ea8d3c131a504033cd23d4b15aefa0209dd10ad3f643e8f1d8a7"]}},"xtermModule-CsJ4vdCR.js":{"size":292244,"offset":"16596627","integrity":{"algorithm":"SHA256","hash":"4aa82b0448cef1cf951bbe0ac80bf2d2b7c5d279dd74bcc798a9e563e98e5295","blockSize":4194304,"blocks":["4aa82b0448cef1cf951bbe0ac80bf2d2b7c5d279dd74bcc798a9e563e98e5295"]}}}},"codeMirrorModule.DYBRYzYX.css":{"size":6421,"offset":"16888871","integrity":{"algorithm":"SHA256","hash":"70bf421a13e87857ca684bfa2cc55f06d7c5a50f71253a3ff1d74769b14a957e","blockSize":4194304,"blocks":["70bf421a13e87857ca684bfa2cc55f06d7c5a50f71253a3ff1d74769b14a957e"]}},"codicon.DCmgc-ay.ttf":{"size":80340,"offset":"16895292","integrity":{"algorithm":"SHA256","hash":"0f1d5219934e96e83b8db162d60b4d8c09b5de1e7d38031cbafe4a3c0f2889c9","blockSize":4194304,"blocks":["0f1d5219934e96e83b8db162d60b4d8c09b5de1e7d38031cbafe4a3c0f2889c9"]}},"defaultSettingsView.CjdS-WJx.css":{"size":112258,"offset":"16975632","integrity":{"algorithm":"SHA256","hash":"de9c068d0e8043820fe42f30558e972eb7e2a8a45a34f65c7c8f73fa2dbc9fd0","blockSize":4194304,"blocks":["de9c068d0e8043820fe42f30558e972eb7e2a8a45a34f65c7c8f73fa2dbc9fd0"]}},"index.CzXZzn5A.css":{"size":2111,"offset":"17087890","integrity":{"algorithm":"SHA256","hash":"4ec2a3d49db259ce9025cb4fa48d73b1afd58215e567eef3b4a4cbf76c1674d9","blockSize":4194304,"blocks":["4ec2a3d49db259ce9025cb4fa48d73b1afd58215e567eef3b4a4cbf76c1674d9"]}},"index.DMMX1gXU.js":{"size":6547,"offset":"17090001","integrity":{"algorithm":"SHA256","hash":"f33ceae71f13fde446a244c113548fec5ef890bf7b93ded7b861bebcebaa3e23","blockSize":4194304,"blocks":["f33ceae71f13fde446a244c113548fec5ef890bf7b93ded7b861bebcebaa3e23"]}},"index.html":{"size":2363,"offset":"17096548","integrity":{"algorithm":"SHA256","hash":"5ced36d3feb5bbbc0e8350330be0a293a1b4784ddecb6e58e1851323a93640cc","blockSize":4194304,"blocks":["5ced36d3feb5bbbc0e8350330be0a293a1b4784ddecb6e58e1851323a93640cc"]}},"manifest.webmanifest":{"size":429,"offset":"17098911","integrity":{"algorithm":"SHA256","hash":"d8540500603a32a39fe7e5a0375dc0f9ebafd11118e06a846db7efc608223ab9","blockSize":4194304,"blocks":["d8540500603a32a39fe7e5a0375dc0f9ebafd11118e06a846db7efc608223ab9"]}},"playwright-logo.svg":{"size":5033,"offset":"17099340","integrity":{"algorithm":"SHA256","hash":"6b0a4367bdeab10995bc239278f04c68c10e48adbec15e799e01909a0d66dcb9","blockSize":4194304,"blocks":["6b0a4367bdeab10995bc239278f04c68c10e48adbec15e799e01909a0d66dcb9"]}},"snapshot.html":{"size":389,"offset":"17104373","integrity":{"algorithm":"SHA256","hash":"11c80efe4f4424fa59004bcc71fed77a420d2da5f199790e355c30a5b965d0cd","blockSize":4194304,"blocks":["11c80efe4f4424fa59004bcc71fed77a420d2da5f199790e355c30a5b965d0cd"]}},"snapshot.v8KI4P3m.js":{"size":660,"offset":"17104762","integrity":{"algorithm":"SHA256","hash":"97a3cd6d67aaac66efc838d7d743ac51bbf7d272e1287981c11758fca21a0657","blockSize":4194304,"blocks":["97a3cd6d67aaac66efc838d7d743ac51bbf7d272e1287981c11758fca21a0657"]}},"sw.bundle.js":{"size":95855,"offset":"17105422","integrity":{"algorithm":"SHA256","hash":"5237c6c68ba1f3591caf8cf951be4873192342a72fbcc31e5a667f7a7904c624","blockSize":4194304,"blocks":["5237c6c68ba1f3591caf8cf951be4873192342a72fbcc31e5a667f7a7904c624"]}},"uiMode.BZQ54Kgt.css":{"size":60311,"offset":"17201277","integrity":{"algorithm":"SHA256","hash":"a548cd88f2041433da2d60fd3a33ef23af2fb8ddf2557b7bef79806364498e57","blockSize":4194304,"blocks":["a548cd88f2041433da2d60fd3a33ef23af2fb8ddf2557b7bef79806364498e57"]}},"uiMode.Ut8wwJNp.js":{"size":38514,"offset":"17261588","integrity":{"algorithm":"SHA256","hash":"0ab1e917250833c3f6b3ed3ae3f359158bf68cd2d9951163ee6edff9b8ed1e5b","blockSize":4194304,"blocks":["0ab1e917250833c3f6b3ed3ae3f359158bf68cd2d9951163ee6edff9b8ed1e5b"]}},"uiMode.html":{"size":727,"offset":"17300102","integrity":{"algorithm":"SHA256","hash":"95bf648d76d380b779770aae1c560b58ee456096b2b3b02922e629af29e3d492","blockSize":4194304,"blocks":["95bf648d76d380b779770aae1c560b58ee456096b2b3b02922e629af29e3d492"]}},"xtermModule.DYP7pi_n.css":{"size":4150,"offset":"17300829","integrity":{"algorithm":"SHA256","hash":"7c5a01f382f76539fc9b4db6b18e18a7035741845fd14968c5cdc0a7e373d817","blockSize":4194304,"blocks":["7c5a01f382f76539fc9b4db6b18e18a7035741845fd14968c5cdc0a7e373d817"]}}}}}},"xdg-open":{"size":25778,"offset":"17304979","integrity":{"algorithm":"SHA256","hash":"2e79a4d5171dd384d20a75b023dfe0e9f4330cdb5d441f6c3859a11fce3db51a","blockSize":4194304,"blocks":["2e79a4d5171dd384d20a75b023dfe0e9f4330cdb5d441f6c3859a11fce3db51a"]},"executable":true}}},"package.json":{"size":876,"offset":"17330757","integrity":{"algorithm":"SHA256","hash":"759e376f995bf39edd4810d699b99469bab1d7428b6fbc78d41912f367df7ba9","blockSize":4194304,"blocks":["759e376f995bf39edd4810d699b99469bab1d7428b6fbc78d41912f367df7ba9"]}}}},"sax":{"files":{"LICENSE.md":{"size":1552,"offset":"17331633","integrity":{"algorithm":"SHA256","hash":"8a1af140fdfbf5afd3df27f7e662f989c5b963a300020dfafce42033cae9e004","blockSize":4194304,"blocks":["8a1af140fdfbf5afd3df27f7e662f989c5b963a300020dfafce42033cae9e004"]}},"lib":{"files":{"sax.js":{"size":50146,"offset":"17333185","integrity":{"algorithm":"SHA256","hash":"a3a6780b66c90f3e74810b5968b07e274ae3bbe2a9a1e2333f0d0576c0bbf3c4","blockSize":4194304,"blocks":["a3a6780b66c90f3e74810b5968b07e274ae3bbe2a9a1e2333f0d0576c0bbf3c4"]}}}},"package.json":{"size":565,"offset":"17383331","integrity":{"algorithm":"SHA256","hash":"9b4399b4c25baed0913166f12319491050d51f22a1b47250906b354bd198b19b","blockSize":4194304,"blocks":["9b4399b4c25baed0913166f12319491050d51f22a1b47250906b354bd198b19b"]}}}},"semver":{"files":{"LICENSE":{"size":765,"offset":"17383896","integrity":{"algorithm":"SHA256","hash":"4ec3d4c66cd87f5c8d8ad911b10f99bf27cb00cdfcff82621956e379186b016b","blockSize":4194304,"blocks":["4ec3d4c66cd87f5c8d8ad911b10f99bf27cb00cdfcff82621956e379186b016b"]}},"bin":{"files":{"semver.js":{"size":4748,"offset":"17384661","integrity":{"algorithm":"SHA256","hash":"82c28f9bc9e598d255edd507d1e9b157f37b8dac0f2da25a813b5e7121600be8","blockSize":4194304,"blocks":["82c28f9bc9e598d255edd507d1e9b157f37b8dac0f2da25a813b5e7121600be8"]},"executable":true}}},"classes":{"files":{"comparator.js":{"size":3631,"offset":"17389409","integrity":{"algorithm":"SHA256","hash":"054202956430d63d5ff4599fae09760ce465b489e4f0b5ef5ce7cc7ac21157ac","blockSize":4194304,"blocks":["054202956430d63d5ff4599fae09760ce465b489e4f0b5ef5ce7cc7ac21157ac"]}},"index.js":{"size":143,"offset":"17393040","integrity":{"algorithm":"SHA256","hash":"3bb69280c2a788d0eb16f915bb9df4dbe812075182024c753dca2283bcea1b17","blockSize":4194304,"blocks":["3bb69280c2a788d0eb16f915bb9df4dbe812075182024c753dca2283bcea1b17"]}},"range.js":{"size":14977,"offset":"17393183","integrity":{"algorithm":"SHA256","hash":"cf8f8eb6934663ae2a9d04838d4d71555427a2abd3c8748ee5219507969a6b46","blockSize":4194304,"blocks":["cf8f8eb6934663ae2a9d04838d4d71555427a2abd3c8748ee5219507969a6b46"]}},"semver.js":{"size":9480,"offset":"17408160","integrity":{"algorithm":"SHA256","hash":"d5ba57e5c93f031b1d234fca4bb746746fcd1fe51be7e5ee895601e2c12e2083","blockSize":4194304,"blocks":["d5ba57e5c93f031b1d234fca4bb746746fcd1fe51be7e5ee895601e2c12e2083"]}}}},"functions":{"files":{"clean.js":{"size":205,"offset":"17417640","integrity":{"algorithm":"SHA256","hash":"4eadb0892844cf3ae295121a86163a66c73f89acd1b7f0b114ec115b4539512f","blockSize":4194304,"blocks":["4eadb0892844cf3ae295121a86163a66c73f89acd1b7f0b114ec115b4539512f"]}},"cmp.js":{"size":961,"offset":"17417845","integrity":{"algorithm":"SHA256","hash":"a63d74e87b73788e78e9ce0a4892b5333d6b809c0de88b31e4ed76cbf17f94b3","blockSize":4194304,"blocks":["a63d74e87b73788e78e9ce0a4892b5333d6b809c0de88b31e4ed76cbf17f94b3"]}},"coerce.js":{"size":2004,"offset":"17418806","integrity":{"algorithm":"SHA256","hash":"28a251c5ab210ddf9e97551b9f37a53329fcce91f0c3943dcbc02de1a1de915a","blockSize":4194304,"blocks":["28a251c5ab210ddf9e97551b9f37a53329fcce91f0c3943dcbc02de1a1de915a"]}},"compare-build.js":{"size":281,"offset":"17420810","integrity":{"algorithm":"SHA256","hash":"5ab651d5b40af289bd85c645a92b6d8cfe1a986dc413c797cfcc8d623d7c844c","blockSize":4194304,"blocks":["5ab651d5b40af289bd85c645a92b6d8cfe1a986dc413c797cfcc8d623d7c844c"]}},"compare-loose.js":{"size":132,"offset":"17421091","integrity":{"algorithm":"SHA256","hash":"07b6a3a1db0a5210ceb784c1708bd4679f3a94fc73a9c9eb349349e7070a6f78","blockSize":4194304,"blocks":["07b6a3a1db0a5210ceb784c1708bd4679f3a94fc73a9c9eb349349e7070a6f78"]}},"compare.js":{"size":170,"offset":"17421223","integrity":{"algorithm":"SHA256","hash":"d404b5aa48aaddc8a654c5da8fb7d4443404b7948589b21ac4b045d1cee4e34c","blockSize":4194304,"blocks":["d404b5aa48aaddc8a654c5da8fb7d4443404b7948589b21ac4b045d1cee4e34c"]}},"diff.js":{"size":1423,"offset":"17421393","integrity":{"algorithm":"SHA256","hash":"7a11fd39b987cdf06c65e928cb1aca49bec583feb86fb5c8fe47a6fd61d7de31","blockSize":4194304,"blocks":["7a11fd39b987cdf06c65e928cb1aca49bec583feb86fb5c8fe47a6fd61d7de31"]}},"eq.js":{"size":126,"offset":"17422816","integrity":{"algorithm":"SHA256","hash":"b6e30a7168e52723216fc163d300e2bbabf92ec0251f9ac5438bb6ccf57c8936","blockSize":4194304,"blocks":["b6e30a7168e52723216fc163d300e2bbabf92ec0251f9ac5438bb6ccf57c8936"]}},"gt.js":{"size":124,"offset":"17422942","integrity":{"algorithm":"SHA256","hash":"135523704aa48cd98834dd170ee9f74f0e68043b379f32d021db11e6304c5c93","blockSize":4194304,"blocks":["135523704aa48cd98834dd170ee9f74f0e68043b379f32d021db11e6304c5c93"]}},"gte.js":{"size":127,"offset":"17423066","integrity":{"algorithm":"SHA256","hash":"991c5bbe48ecb210a562646872f05862ad9fc0d42186d85aa60bdc6fa323eb9d","blockSize":4194304,"blocks":["991c5bbe48ecb210a562646872f05862ad9fc0d42186d85aa60bdc6fa323eb9d"]}},"inc.js":{"size":478,"offset":"17423193","integrity":{"algorithm":"SHA256","hash":"952069fc8690b7d3af0fe9d55f7c54fe2ac067b48c5e74f6a54f9ce19a334493","blockSize":4194304,"blocks":["952069fc8690b7d3af0fe9d55f7c54fe2ac067b48c5e74f6a54f9ce19a334493"]}},"lt.js":{"size":124,"offset":"17423671","integrity":{"algorithm":"SHA256","hash":"1c897a9bc849320e2e9dc0f6c09555c01ee3ddf30734515d717b88ad7740ea25","blockSize":4194304,"blocks":["1c897a9bc849320e2e9dc0f6c09555c01ee3ddf30734515d717b88ad7740ea25"]}},"lte.js":{"size":127,"offset":"17423795","integrity":{"algorithm":"SHA256","hash":"3a8d0b1d00423f60cc7cb810b36ab77b61330831ad237dbe73eb5cecfa412800","blockSize":4194304,"blocks":["3a8d0b1d00423f60cc7cb810b36ab77b61330831ad237dbe73eb5cecfa412800"]}},"major.js":{"size":136,"offset":"17423922","integrity":{"algorithm":"SHA256","hash":"5c678480d882f511200fed2c16ec3847dfedb08a1d70328dc2f031d35d825276","blockSize":4194304,"blocks":["5c678480d882f511200fed2c16ec3847dfedb08a1d70328dc2f031d35d825276"]}},"minor.js":{"size":136,"offset":"17424058","integrity":{"algorithm":"SHA256","hash":"1b051794f1713adec2a236517196691687c35f82e0b596ff3316a78b3cc10ae6","blockSize":4194304,"blocks":["1b051794f1713adec2a236517196691687c35f82e0b596ff3316a78b3cc10ae6"]}},"neq.js":{"size":128,"offset":"17424194","integrity":{"algorithm":"SHA256","hash":"a662883751918822c162183b46b9e20d09489132f82686c92ab78bee67f3a127","blockSize":4194304,"blocks":["a662883751918822c162183b46b9e20d09489132f82686c92ab78bee67f3a127"]}},"parse.js":{"size":331,"offset":"17424322","integrity":{"algorithm":"SHA256","hash":"29a69e15b6d02fe381d573f861881a89590e9d0f0f0ca740c5f85eaf0234c4ad","blockSize":4194304,"blocks":["29a69e15b6d02fe381d573f861881a89590e9d0f0f0ca740c5f85eaf0234c4ad"]}},"patch.js":{"size":136,"offset":"17424653","integrity":{"algorithm":"SHA256","hash":"f02d3c1b059fe3d96ce124886f7eef321d381a95638fd3c4a8d5ccd8e76ffadd","blockSize":4194304,"blocks":["f02d3c1b059fe3d96ce124886f7eef321d381a95638fd3c4a8d5ccd8e76ffadd"]}},"prerelease.js":{"size":234,"offset":"17424789","integrity":{"algorithm":"SHA256","hash":"baedbf503d5610ad041bfb56071efa48feb331ca278295c399537d35d3ffb593","blockSize":4194304,"blocks":["baedbf503d5610ad041bfb56071efa48feb331ca278295c399537d35d3ffb593"]}},"rcompare.js":{"size":132,"offset":"17425023","integrity":{"algorithm":"SHA256","hash":"84fa5e88adf08d15c993cac8cdec6d1a65045b7e95a9c55184230a7f807f4dc0","blockSize":4194304,"blocks":["84fa5e88adf08d15c993cac8cdec6d1a65045b7e95a9c55184230a7f807f4dc0"]}},"rsort.js":{"size":163,"offset":"17425155","integrity":{"algorithm":"SHA256","hash":"6ec659ce3b6c2b173c719286caab04409adba046c0917874ec3b5e36ddfbc7e3","blockSize":4194304,"blocks":["6ec659ce3b6c2b173c719286caab04409adba046c0917874ec3b5e36ddfbc7e3"]}},"satisfies.js":{"size":247,"offset":"17425318","integrity":{"algorithm":"SHA256","hash":"8cf5e122b757251671ed6c9d9680904b71cd375845853f05312e608cf2cc2946","blockSize":4194304,"blocks":["8cf5e122b757251671ed6c9d9680904b71cd375845853f05312e608cf2cc2946"]}},"sort.js":{"size":161,"offset":"17425565","integrity":{"algorithm":"SHA256","hash":"c2fe2d3ed0be8a4e9de8f02abdfd5d9c0d3bcc510d88e87af84185592882c4b8","blockSize":4194304,"blocks":["c2fe2d3ed0be8a4e9de8f02abdfd5d9c0d3bcc510d88e87af84185592882c4b8"]}},"valid.js":{"size":176,"offset":"17425726","integrity":{"algorithm":"SHA256","hash":"0de7ea736cb7807179d46dfac09c830a9338e02b6a07db12d7040cde2def6025","blockSize":4194304,"blocks":["0de7ea736cb7807179d46dfac09c830a9338e02b6a07db12d7040cde2def6025"]}}}},"index.js":{"size":2630,"offset":"17425902","integrity":{"algorithm":"SHA256","hash":"646e0b707f56dca7cb90cebc6fe687278bcc1a16fdcc83756dbe23083ff15e06","blockSize":4194304,"blocks":["646e0b707f56dca7cb90cebc6fe687278bcc1a16fdcc83756dbe23083ff15e06"]}},"internal":{"files":{"constants.js":{"size":873,"offset":"17428532","integrity":{"algorithm":"SHA256","hash":"38a112baf27ceca0260082ff26ac2fd7a9861cab1af12dd65e720277f68e6ce9","blockSize":4194304,"blocks":["38a112baf27ceca0260082ff26ac2fd7a9861cab1af12dd65e720277f68e6ce9"]}},"debug.js":{"size":240,"offset":"17429405","integrity":{"algorithm":"SHA256","hash":"8a9f420572260f3cf944463b5090d62a60f0730589dc23a7ec4ca25e2ee41bb3","blockSize":4194304,"blocks":["8a9f420572260f3cf944463b5090d62a60f0730589dc23a7ec4ca25e2ee41bb3"]}},"identifiers.js":{"size":525,"offset":"17429645","integrity":{"algorithm":"SHA256","hash":"b4916b09dc7869ae0eb05e71c855c942a3a7365f7e6e89185d59a9e45a2451d7","blockSize":4194304,"blocks":["b4916b09dc7869ae0eb05e71c855c942a3a7365f7e6e89185d59a9e45a2451d7"]}},"lrucache.js":{"size":802,"offset":"17430170","integrity":{"algorithm":"SHA256","hash":"14d087c87da87b6f5c36fc4cdd7d2d14077874b14a68e20fce5b6138fa2ca34f","blockSize":4194304,"blocks":["14d087c87da87b6f5c36fc4cdd7d2d14077874b14a68e20fce5b6138fa2ca34f"]}},"parse-options.js":{"size":338,"offset":"17430972","integrity":{"algorithm":"SHA256","hash":"fdf51d0de8d5442c35a997ef58cd530d239ce206f961d14c5121354451b01d01","blockSize":4194304,"blocks":["fdf51d0de8d5442c35a997ef58cd530d239ce206f961d14c5121354451b01d01"]}},"re.js":{"size":8138,"offset":"17431310","integrity":{"algorithm":"SHA256","hash":"6a47e73c279fa8c4011f670471f50830a39922b43797b2884e6cc03f65b64d6c","blockSize":4194304,"blocks":["6a47e73c279fa8c4011f670471f50830a39922b43797b2884e6cc03f65b64d6c"]}}}},"package.json":{"size":1350,"offset":"17439448","integrity":{"algorithm":"SHA256","hash":"783e44dd42d6021177385b15de76f71d49d472f79b60ab22ed69f336d5e0f9d9","blockSize":4194304,"blocks":["783e44dd42d6021177385b15de76f71d49d472f79b60ab22ed69f336d5e0f9d9"]}},"preload.js":{"size":83,"offset":"17440798","integrity":{"algorithm":"SHA256","hash":"edb6808911bebcb324b2df57e5c9935149e56984ff083b74c6cfe215f5b710ba","blockSize":4194304,"blocks":["edb6808911bebcb324b2df57e5c9935149e56984ff083b74c6cfe215f5b710ba"]}},"range.bnf":{"size":619,"offset":"17440881","integrity":{"algorithm":"SHA256","hash":"ed628fdaff64be366d07f6cc4559eae4de109826f743ea7f5e1588c370bca49a","blockSize":4194304,"blocks":["ed628fdaff64be366d07f6cc4559eae4de109826f743ea7f5e1588c370bca49a"]}},"ranges":{"files":{"gtr.js":{"size":231,"offset":"17441500","integrity":{"algorithm":"SHA256","hash":"8fadad28e36d28e93d498ac7ac20badba2a407312845eabc18e82e90a0732b19","blockSize":4194304,"blocks":["8fadad28e36d28e93d498ac7ac20badba2a407312845eabc18e82e90a0732b19"]}},"intersects.js":{"size":224,"offset":"17441731","integrity":{"algorithm":"SHA256","hash":"fe87ac5d3020010ad3ec00636dadbf0c669ff07d0f57e0a8165a8264f79a676f","blockSize":4194304,"blocks":["fe87ac5d3020010ad3ec00636dadbf0c669ff07d0f57e0a8165a8264f79a676f"]}},"ltr.js":{"size":227,"offset":"17441955","integrity":{"algorithm":"SHA256","hash":"e5186fcc03018acf9be6d968755d4c49727aeb0d981d179eb568ae5fbe983038","blockSize":4194304,"blocks":["e5186fcc03018acf9be6d968755d4c49727aeb0d981d179eb568ae5fbe983038"]}},"max-satisfying.js":{"size":593,"offset":"17442182","integrity":{"algorithm":"SHA256","hash":"e1a2c0d6144cc772cd20bbc8ecb9e8a3a4074e9172a3d8e794838b591cdeb416","blockSize":4194304,"blocks":["e1a2c0d6144cc772cd20bbc8ecb9e8a3a4074e9172a3d8e794838b591cdeb416"]}},"min-satisfying.js":{"size":591,"offset":"17442775","integrity":{"algorithm":"SHA256","hash":"2681abf54098aa670f12826b76a6ec77a2441186ae4243afde3be8ae4908f7ca","blockSize":4194304,"blocks":["2681abf54098aa670f12826b76a6ec77a2441186ae4243afde3be8ae4908f7ca"]}},"min-version.js":{"size":1514,"offset":"17443366","integrity":{"algorithm":"SHA256","hash":"fefba0a88c2bf74d5cede504b5ae50a8dc3edfd69cf0174a491e2cf3e442614b","blockSize":4194304,"blocks":["fefba0a88c2bf74d5cede504b5ae50a8dc3edfd69cf0174a491e2cf3e442614b"]}},"outside.js":{"size":2204,"offset":"17444880","integrity":{"algorithm":"SHA256","hash":"3a2b0b23593d2f49419c06af2af75450cab103b0c25d665d48fe5bca495a21ca","blockSize":4194304,"blocks":["3a2b0b23593d2f49419c06af2af75450cab103b0c25d665d48fe5bca495a21ca"]}},"simplify.js":{"size":1355,"offset":"17447084","integrity":{"algorithm":"SHA256","hash":"7b78581c13322bc68ece2088685386b2a9b51c15b94d0a2063bdf2546bd41934","blockSize":4194304,"blocks":["7b78581c13322bc68ece2088685386b2a9b51c15b94d0a2063bdf2546bd41934"]}},"subset.js":{"size":7524,"offset":"17448439","integrity":{"algorithm":"SHA256","hash":"87387952fbe154f5874d5f09dd2173e782e894a76fa8370ce23f4120e2ae7eae","blockSize":4194304,"blocks":["87387952fbe154f5874d5f09dd2173e782e894a76fa8370ce23f4120e2ae7eae"]}},"to-comparators.js":{"size":282,"offset":"17455963","integrity":{"algorithm":"SHA256","hash":"6c5e966210cff270fa2850668aaf8460fac7759f8d99f282521ef7a78f4564e9","blockSize":4194304,"blocks":["6c5e966210cff270fa2850668aaf8460fac7759f8d99f282521ef7a78f4564e9"]}},"valid.js":{"size":326,"offset":"17456245","integrity":{"algorithm":"SHA256","hash":"5ef6f995af801868925940cf8df5735d565ebabb090b068695cae65218bcd3ac","blockSize":4194304,"blocks":["5ef6f995af801868925940cf8df5735d565ebabb090b068695cae65218bcd3ac"]}}}}}},"tiny-typed-emitter":{"files":{"LICENSE":{"size":1104,"offset":"17456571","integrity":{"algorithm":"SHA256","hash":"4b3faf884ee71eec3df920b66c98fc6618af28e824cf3a32ef3d8774048cc76d","blockSize":4194304,"blocks":["4b3faf884ee71eec3df920b66c98fc6618af28e824cf3a32ef3d8774048cc76d"]}},"lib":{"files":{"index.js":{"size":132,"offset":"17457675","integrity":{"algorithm":"SHA256","hash":"1401fdda105ed67f365bd775397aedb2f5f9e43ace031288f0f6868f9ab041be","blockSize":4194304,"blocks":["1401fdda105ed67f365bd775397aedb2f5f9e43ace031288f0f6868f9ab041be"]}}}},"package.json":{"size":395,"offset":"17457807","integrity":{"algorithm":"SHA256","hash":"eb7f51a4a5a7f41baf54271c726724a047f60d45762d650dc00439a10c37645b","blockSize":4194304,"blocks":["eb7f51a4a5a7f41baf54271c726724a047f60d45762d650dc00439a10c37645b"]}}}},"universalify":{"files":{"LICENSE":{"size":1100,"offset":"17458202","integrity":{"algorithm":"SHA256","hash":"3fda5977c0904e226190b4e21d64340c1731e2142d6fe5f3dee0090a216b8b63","blockSize":4194304,"blocks":["3fda5977c0904e226190b4e21d64340c1731e2142d6fe5f3dee0090a216b8b63"]}},"index.js":{"size":706,"offset":"17459302","integrity":{"algorithm":"SHA256","hash":"83b02adb3872f6c482db4e57c300fa39b5cad65e317fc2f70b9de7d305c035a1","blockSize":4194304,"blocks":["83b02adb3872f6c482db4e57c300fa39b5cad65e317fc2f70b9de7d305c035a1"]}},"package.json":{"size":618,"offset":"17460008","integrity":{"algorithm":"SHA256","hash":"5b39e9c6305a5ba27c76caf4817244dd1a308b68c7559dfe15471173466cf06e","blockSize":4194304,"blocks":["5b39e9c6305a5ba27c76caf4817244dd1a308b68c7559dfe15471173466cf06e"]}}}}}},"docs":{"files":{"douyin-playwright-research.md":{"size":11258,"offset":"17460626","integrity":{"algorithm":"SHA256","hash":"3c12b5c6ddec455a4d91d11a21f4ed6707abd6773ee56058435f6f64070302d0","blockSize":4194304,"blocks":["3c12b5c6ddec455a4d91d11a21f4ed6707abd6773ee56058435f6f64070302d0"]}}}},"out":{"files":{"main":{"files":{"index.js":{"size":64052,"offset":"17471884","integrity":{"algorithm":"SHA256","hash":"c74eb47f386d604c7ec11d1f2c31b9a052e35eb680bf855d6c1e7bda1428348b","blockSize":4194304,"blocks":["c74eb47f386d604c7ec11d1f2c31b9a052e35eb680bf855d6c1e7bda1428348b"]}}}},"preload":{"files":{"index.js":{"size":1379,"offset":"17535936","integrity":{"algorithm":"SHA256","hash":"787179488b958c493eaef62aa34c702141bbcf8a48aec43e785d4dc60f7f36d8","blockSize":4194304,"blocks":["787179488b958c493eaef62aa34c702141bbcf8a48aec43e785d4dc60f7f36d8"]}}}},"renderer":{"files":{"assets":{"files":{"index-CNO0bO7Y.js":{"size":223490,"offset":"17537315","integrity":{"algorithm":"SHA256","hash":"a8fbe7fff961daa36ef8f61662df433183f25ec50b816cdac89134cfa2698f24","blockSize":4194304,"blocks":["a8fbe7fff961daa36ef8f61662df433183f25ec50b816cdac89134cfa2698f24"]}},"index-CifaCZZf.css":{"size":8206,"offset":"17760805","integrity":{"algorithm":"SHA256","hash":"e61667bc83ccfaab436093a58ec10f8ba39cff43cf6f80cf3900bb973fd462d0","blockSize":4194304,"blocks":["e61667bc83ccfaab436093a58ec10f8ba39cff43cf6f80cf3900bb973fd462d0"]}}}},"index.html":{"size":616,"offset":"17769011","integrity":{"algorithm":"SHA256","hash":"c56db26741019cc476127fccc09fe6be5976f6bc4e62f1bd4962f071597884bf","blockSize":4194304,"blocks":["c56db26741019cc476127fccc09fe6be5976f6bc4e62f1bd4962f071597884bf"]}}}}}},"package.json":{"size":388,"offset":"17769627","integrity":{"algorithm":"SHA256","hash":"2181a8628c3424f926093e0786ed51dd75747a37bea5e5e918646bc8c1f7666a","blockSize":4194304,"blocks":["2181a8628c3424f926093e0786ed51dd75747a37bea5e5e918646bc8c1f7666a"]}},"resources":{"files":{"icon.png":{"size":35949,"unpacked":true,"integrity":{"algorithm":"SHA256","hash":"4363016ccf3541c84ae6a1eee83f507fb2b775aa89b9d6c8163875640267f9e9","blockSize":4194304,"blocks":["4363016ccf3541c84ae6a1eee83f507fb2b775aa89b9d6c8163875640267f9e9"]}}}},"scripts":{"files":{"deploy-test.sh":{"size":1863,"offset":"17770015","integrity":{"algorithm":"SHA256","hash":"7df9b33eb02419e5916be5f3e9bd30573550c25b6b79b2c84dcbc8f6427237c8","blockSize":4194304,"blocks":["7df9b33eb02419e5916be5f3e9bd30573550c25b6b79b2c84dcbc8f6427237c8"]}}}}}} MIT License

Copyright (c) 2022-present, Alex.Wei

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
'use strict';

var electron = require('electron');

const electronAPI = {
    ipcRenderer: {
        send(channel, ...args) {
            electron.ipcRenderer.send(channel, ...args);
        },
        sendTo(webContentsId, channel, ...args) {
            const electronVer = process.versions.electron;
            const electronMajorVer = electronVer ? parseInt(electronVer.split('.')[0]) : 0;
            if (electronMajorVer >= 28) {
                throw new Error('"sendTo" method has been removed since Electron 28.');
            }
            else {
                electron.ipcRenderer.sendTo(webContentsId, channel, ...args);
            }
        },
        sendSync(channel, ...args) {
            return electron.ipcRenderer.sendSync(channel, ...args);
        },
        sendToHost(channel, ...args) {
            electron.ipcRenderer.sendToHost(channel, ...args);
        },
        postMessage(channel, message, transfer) {
            electron.ipcRenderer.postMessage(channel, message, transfer);
        },
        invoke(channel, ...args) {
            return electron.ipcRenderer.invoke(channel, ...args);
        },
        on(channel, listener) {
            electron.ipcRenderer.on(channel, listener);
            return () => {
                electron.ipcRenderer.removeListener(channel, listener);
            };
        },
        once(channel, listener) {
            electron.ipcRenderer.once(channel, listener);
            return () => {
                electron.ipcRenderer.removeListener(channel, listener);
            };
        },
        removeListener(channel, listener) {
            electron.ipcRenderer.removeListener(channel, listener);
            return this;
        },
        removeAllListeners(channel) {
            electron.ipcRenderer.removeAllListeners(channel);
        }
    },
    webFrame: {
        insertCSS(css) {
            return electron.webFrame.insertCSS(css);
        },
        setZoomFactor(factor) {
            if (typeof factor === 'number' && factor > 0) {
                electron.webFrame.setZoomFactor(factor);
            }
        },
        setZoomLevel(level) {
            if (typeof level === 'number') {
                electron.webFrame.setZoomLevel(level);
            }
        }
    },
    webUtils: {
        getPathForFile(file) {
            return electron.webUtils.getPathForFile(file);
        }
    },
    process: {
        get platform() {
            return process.platform;
        },
        get versions() {
            return process.versions;
        },
        get env() {
            return { ...process.env };
        }
    }
};
/**
 * Expose Electron APIs from your preload script, the API
 * will be accessible from the website on `window.electron`.
 */
function exposeElectronAPI() {
    if (process.contextIsolated) {
        try {
            electron.contextBridge.exposeInMainWorld('electron', electronAPI);
        }
        catch (error) {
            console.error(error);
        }
    }
    else {
        // @ts-ignore (need dts)
        window.electron = electronAPI;
    }
}

exports.electronAPI = electronAPI;
exports.exposeElectronAPI = exposeElectronAPI;
import { webUtils, webFrame, ipcRenderer, contextBridge } from 'electron';

const electronAPI = {
    ipcRenderer: {
        send(channel, ...args) {
            ipcRenderer.send(channel, ...args);
        },
        sendTo(webContentsId, channel, ...args) {
            const electronVer = process.versions.electron;
            const electronMajorVer = electronVer ? parseInt(electronVer.split('.')[0]) : 0;
            if (electronMajorVer >= 28) {
                throw new Error('"sendTo" method has been removed since Electron 28.');
            }
            else {
                ipcRenderer.sendTo(webContentsId, channel, ...args);
            }
        },
        sendSync(channel, ...args) {
            return ipcRenderer.sendSync(channel, ...args);
        },
        sendToHost(channel, ...args) {
            ipcRenderer.sendToHost(channel, ...args);
        },
        postMessage(channel, message, transfer) {
            ipcRenderer.postMessage(channel, message, transfer);
        },
        invoke(channel, ...args) {
            return ipcRenderer.invoke(channel, ...args);
        },
        on(channel, listener) {
            ipcRenderer.on(channel, listener);
            return () => {
                ipcRenderer.removeListener(channel, listener);
            };
        },
        once(channel, listener) {
            ipcRenderer.once(channel, listener);
            return () => {
                ipcRenderer.removeListener(channel, listener);
            };
        },
        removeListener(channel, listener) {
            ipcRenderer.removeListener(channel, listener);
            return this;
        },
        removeAllListeners(channel) {
            ipcRenderer.removeAllListeners(channel);
        }
    },
    webFrame: {
        insertCSS(css) {
            return webFrame.insertCSS(css);
        },
        setZoomFactor(factor) {
            if (typeof factor === 'number' && factor > 0) {
                webFrame.setZoomFactor(factor);
            }
        },
        setZoomLevel(level) {
            if (typeof level === 'number') {
                webFrame.setZoomLevel(level);
            }
        }
    },
    webUtils: {
        getPathForFile(file) {
            return webUtils.getPathForFile(file);
        }
    },
    process: {
        get platform() {
            return process.platform;
        },
        get versions() {
            return process.versions;
        },
        get env() {
            return { ...process.env };
        }
    }
};
/**
 * Expose Electron APIs from your preload script, the API
 * will be accessible from the website on `window.electron`.
 */
function exposeElectronAPI() {
    if (process.contextIsolated) {
        try {
            contextBridge.exposeInMainWorld('electron', electronAPI);
        }
        catch (error) {
            console.error(error);
        }
    }
    else {
        // @ts-ignore (need dts)
        window.electron = electronAPI;
    }
}

export { electronAPI, exposeElectronAPI };
{
  "name": "@electron-toolkit/preload",
  "version": "3.0.2",
  "description": "Toolkit for electron preload scripts.",
  "main": "dist/index.cjs",
  "module": "dist/index.mjs",
  "types": "dist/index.d.ts",
  "exports": {
    ".": {
      "types": "./dist/index.d.ts",
      "import": "./dist/index.mjs",
      "require": "./dist/index.cjs"
    }
  },
  "files": [
    "dist"
  ],
  "author": "Alex Wei<https://github.com/alex8088>",
  "license": "MIT",
  "repository": {
    "type": "git",
    "url": "git+https://github.com/alex8088/electron-toolkit.git",
    "directory": "packages/preload"
  },
  "homepage": "https://github.com/alex8088/electron-toolkit/tree/master/packages/preload#readme",
  "peerDependencies": {
    "electron": ">=13.0.0"
  }
}MIT License

Copyright (c) 2022-present, Alex.Wei

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
'use strict';

const electron = require('electron');

const is = {
  dev: !electron.app.isPackaged
};

const platform = {
  isWindows: process.platform === "win32",
  isMacOS: process.platform === "darwin",
  isLinux: process.platform === "linux"
};

const electronApp = {
  setAppUserModelId(id) {
    if (platform.isWindows)
      electron.app.setAppUserModelId(is.dev ? process.execPath : id);
  },
  setAutoLaunch(auto) {
    if (platform.isLinux)
      return false;
    const isOpenAtLogin = () => {
      return electron.app.getLoginItemSettings().openAtLogin;
    };
    if (isOpenAtLogin() !== auto) {
      electron.app.setLoginItemSettings({ openAtLogin: auto });
      return isOpenAtLogin() === auto;
    } else {
      return true;
    }
  },
  skipProxy() {
    return electron.session.defaultSession.setProxy({ mode: "direct" });
  }
};

const optimizer = {
  watchWindowShortcuts(window, shortcutOptions) {
    if (!window)
      return;
    const { webContents } = window;
    const { escToCloseWindow = false, zoom = false } = shortcutOptions || {};
    webContents.on("before-input-event", (event, input) => {
      if (input.type === "keyDown") {
        if (!is.dev) {
          if (input.code === "KeyR" && (input.control || input.meta))
            event.preventDefault();
          if (input.code === "KeyI" && (input.alt && input.meta || input.control && input.shift)) {
            event.preventDefault();
          }
        } else {
          if (input.code === "F12") {
            if (webContents.isDevToolsOpened()) {
              webContents.closeDevTools();
            } else {
              webContents.openDevTools({ mode: "undocked" });
              console.log("Open dev tool...");
            }
          }
        }
        if (escToCloseWindow) {
          if (input.code === "Escape" && input.key !== "Process") {
            window.close();
            event.preventDefault();
          }
        }
        if (!zoom) {
          if (input.code === "Minus" && (input.control || input.meta))
            event.preventDefault();
          if (input.code === "Equal" && input.shift && (input.control || input.meta))
            event.preventDefault();
        }
      }
    });
  },
  registerFramelessWindowIpc() {
    electron.ipcMain.on("win:invoke", (event, action) => {
      const win = electron.BrowserWindow.fromWebContents(event.sender);
      if (win) {
        if (action === "show") {
          win.show();
        } else if (action === "showInactive") {
          win.showInactive();
        } else if (action === "min") {
          win.minimize();
        } else if (action === "max") {
          const isMaximized = win.isMaximized();
          if (isMaximized) {
            win.unmaximize();
          } else {
            win.maximize();
          }
        } else if (action === "close") {
          win.close();
        }
      }
    });
  }
};

exports.electronApp = electronApp;
exports.is = is;
exports.optimizer = optimizer;
exports.platform = platform;
import { BrowserWindow } from 'electron';

interface Is {
    dev: boolean;
}
declare const is: Is;

interface Platform {
    isWindows: boolean;
    isMacOS: boolean;
    isLinux: boolean;
}
declare const platform: Platform;

interface ElectronApp {
    /**
     * Changes the Application User Model ID to id.
     *
     * The `id` is used only when the applcation is packaged. otherwise use the
     * `process.execPath` value as id.
     *
     * see https://www.electronjs.org/docs/latest/tutorial/notifications#windows
     * @platform â€” win32
     */
    setAppUserModelId: (id: string) => void;
    /**
     * Whether the call succeeded.
     *
     * Set the app open at login or not.
     *
     *  **Note:** `false` always on Linux.
     * @platform â€” darwin,win32
     */
    setAutoLaunch: (auto: boolean) => boolean;
    /**
     * Skip proxy for Electron app.
     */
    skipProxy: () => Promise<void>;
}
declare const electronApp: ElectronApp;

type shortcutOptions = {
    /**
     * Use `ESC` key to close window, default `false`.
     */
    escToCloseWindow?: boolean;
    /**
     * Zoom in (`Minus + CommandOrControl`) or zoom out(`Equal + Shift + CommandOrControl`), default `false`.
     */
    zoom?: boolean;
};
interface Optimizer {
    /**
     * Default open or close DevTools by `F12` in development and
     * ignore `CommandOrControl + R` in production.
     *
     * Use `shortcutOptions` to control more shortcuts.
     */
    watchWindowShortcuts: (window: BrowserWindow, shortcutOptions?: shortcutOptions) => void;
    /**
     * If use a frameless window which hide the system's native window controls,
     * we may need to create custom window controls in HTML.
     *
     * The frameless window ipc allow the renderer process to control the
     * browser window.
     *
     * The ipc channel named `win:invoke`.
     *
     * For Example:
     *
     * ```
     * ipcRenderer.send('win:invoke', 'show')
     * ipcRenderer.send('win:invoke', 'showInactive')
     * ipcRenderer.send('win:invoke', 'min')
     * ipcRenderer.send('win:invoke', 'max')
     * ipcRenderer.send('win:invoke', 'close')
     * ```
     */
    registerFramelessWindowIpc: () => void;
}
declare const optimizer: Optimizer;

export { type ElectronApp, type Is, type Optimizer, type Platform, electronApp, is, optimizer, platform, type shortcutOptions };
import { BrowserWindow } from 'electron';

interface Is {
    dev: boolean;
}
declare const is: Is;

interface Platform {
    isWindows: boolean;
    isMacOS: boolean;
    isLinux: boolean;
}
declare const platform: Platform;

interface ElectronApp {
    /**
     * Changes the Application User Model ID to id.
     *
     * The `id` is used only when the applcation is packaged. otherwise use the
     * `process.execPath` value as id.
     *
     * see https://www.electronjs.org/docs/latest/tutorial/notifications#windows
     * @platform â€” win32
     */
    setAppUserModelId: (id: string) => void;
    /**
     * Whether the call succeeded.
     *
     * Set the app open at login or not.
     *
     *  **Note:** `false` always on Linux.
     * @platform â€” darwin,win32
     */
    setAutoLaunch: (auto: boolean) => boolean;
    /**
     * Skip proxy for Electron app.
     */
    skipProxy: () => Promise<void>;
}
declare const electronApp: ElectronApp;

type shortcutOptions = {
    /**
     * Use `ESC` key to close window, default `false`.
     */
    escToCloseWindow?: boolean;
    /**
     * Zoom in (`Minus + CommandOrControl`) or zoom out(`Equal + Shift + CommandOrControl`), default `false`.
     */
    zoom?: boolean;
};
interface Optimizer {
    /**
     * Default open or close DevTools by `F12` in development and
     * ignore `CommandOrControl + R` in production.
     *
     * Use `shortcutOptions` to control more shortcuts.
     */
    watchWindowShortcuts: (window: BrowserWindow, shortcutOptions?: shortcutOptions) => void;
    /**
     * If use a frameless window which hide the system's native window controls,
     * we may need to create custom window controls in HTML.
     *
     * The frameless window ipc allow the renderer process to control the
     * browser window.
     *
     * The ipc channel named `win:invoke`.
     *
     * For Example:
     *
     * ```
     * ipcRenderer.send('win:invoke', 'show')
     * ipcRenderer.send('win:invoke', 'showInactive')
     * ipcRenderer.send('win:invoke', 'min')
     * ipcRenderer.send('win:invoke', 'max')
     * ipcRenderer.send('win:invoke', 'close')
     * ```
     */
    registerFramelessWindowIpc: () => void;
}
declare const optimizer: Optimizer;

export { type ElectronApp, type Is, type Optimizer, type Platform, electronApp, is, optimizer, platform, type shortcutOptions };
import { app, session, ipcMain, BrowserWindow } from 'electron';

const is = {
  dev: !app.isPackaged
};

const platform = {
  isWindows: process.platform === "win32",
  isMacOS: process.platform === "darwin",
  isLinux: process.platform === "linux"
};

const electronApp = {
  setAppUserModelId(id) {
    if (platform.isWindows)
      app.setAppUserModelId(is.dev ? process.execPath : id);
  },
  setAutoLaunch(auto) {
    if (platform.isLinux)
      return false;
    const isOpenAtLogin = () => {
      return app.getLoginItemSettings().openAtLogin;
    };
    if (isOpenAtLogin() !== auto) {
      app.setLoginItemSettings({ openAtLogin: auto });
      return isOpenAtLogin() === auto;
    } else {
      return true;
    }
  },
  skipProxy() {
    return session.defaultSession.setProxy({ mode: "direct" });
  }
};

const optimizer = {
  watchWindowShortcuts(window, shortcutOptions) {
    if (!window)
      return;
    const { webContents } = window;
    const { escToCloseWindow = false, zoom = false } = shortcutOptions || {};
    webContents.on("before-input-event", (event, input) => {
      if (input.type === "keyDown") {
        if (!is.dev) {
          if (input.code === "KeyR" && (input.control || input.meta))
            event.preventDefault();
          if (input.code === "KeyI" && (input.alt && input.meta || input.control && input.shift)) {
            event.preventDefault();
          }
        } else {
          if (input.code === "F12") {
            if (webContents.isDevToolsOpened()) {
              webContents.closeDevTools();
            } else {
              webContents.openDevTools({ mode: "undocked" });
              console.log("Open dev tool...");
            }
          }
        }
        if (escToCloseWindow) {
          if (input.code === "Escape" && input.key !== "Process") {
            window.close();
            event.preventDefault();
          }
        }
        if (!zoom) {
          if (input.code === "Minus" && (input.control || input.meta))
            event.preventDefault();
          if (input.code === "Equal" && input.shift && (input.control || input.meta))
            event.preventDefault();
        }
      }
    });
  },
  registerFramelessWindowIpc() {
    ipcMain.on("win:invoke", (event, action) => {
      const win = BrowserWindow.fromWebContents(event.sender);
      if (win) {
        if (action === "show") {
          win.show();
        } else if (action === "showInactive") {
          win.showInactive();
        } else if (action === "min") {
          win.minimize();
        } else if (action === "max") {
          const isMaximized = win.isMaximized();
          if (isMaximized) {
            win.unmaximize();
          } else {
            win.maximize();
          }
        } else if (action === "close") {
          win.close();
        }
      }
    });
  }
};

export { electronApp, is, optimizer, platform };
{
  "name": "@electron-toolkit/utils",
  "version": "4.0.0",
  "description": "Utils for Electron main process.",
  "main": "dist/index.cjs",
  "module": "dist/index.mjs",
  "types": "dist/index.d.ts",
  "exports": {
    ".": {
      "types": "./dist/index.d.ts",
      "import": "./dist/index.mjs",
      "require": "./dist/index.cjs"
    }
  },
  "files": [
    "dist"
  ],
  "author": "Alex Wei<https://github.com/alex8088>",
  "license": "MIT",
  "repository": {
    "type": "git",
    "url": "git+https://github.com/alex8088/electron-toolkit.git",
    "directory": "packages/utils"
  },
  "homepage": "https://github.com/alex8088/electron-toolkit/tree/master/packages/utils#readme",
  "peerDependencies": {
    "electron": ">=13.0.0"
  }
}A. HISTORY OF THE SOFTWARE
==========================

Python was created in the early 1990s by Guido van Rossum at Stichting
Mathematisch Centrum (CWI, see http://www.cwi.nl) in the Netherlands
as a successor of a language called ABC.  Guido remains Python's
principal author, although it includes many contributions from others.

In 1995, Guido continued his work on Python at the Corporation for
National Research Initiatives (CNRI, see http://www.cnri.reston.va.us)
in Reston, Virginia where he released several versions of the
software.

In May 2000, Guido and the Python core development team moved to
BeOpen.com to form the BeOpen PythonLabs team.  In October of the same
year, the PythonLabs team moved to Digital Creations, which became
Zope Corporation.  In 2001, the Python Software Foundation (PSF, see
https://www.python.org/psf/) was formed, a non-profit organization
created specifically to own Python-related Intellectual Property.
Zope Corporation was a sponsoring member of the PSF.

All Python releases are Open Source (see http://www.opensource.org for
the Open Source Definition).  Historically, most, but not all, Python
releases have also been GPL-compatible; the table below summarizes
the various releases.

    Release         Derived     Year        Owner       GPL-
                    from                                compatible? (1)

    0.9.0 thru 1.2              1991-1995   CWI         yes
    1.3 thru 1.5.2  1.2         1995-1999   CNRI        yes
    1.6             1.5.2       2000        CNRI        no
    2.0             1.6         2000        BeOpen.com  no
    1.6.1           1.6         2001        CNRI        yes (2)
    2.1             2.0+1.6.1   2001        PSF         no
    2.0.1           2.0+1.6.1   2001        PSF         yes
    2.1.1           2.1+2.0.1   2001        PSF         yes
    2.1.2           2.1.1       2002        PSF         yes
    2.1.3           2.1.2       2002        PSF         yes
    2.2 and above   2.1.1       2001-now    PSF         yes

Footnotes:

(1) GPL-compatible doesn't mean that we're distributing Python under
    the GPL.  All Python licenses, unlike the GPL, let you distribute
    a modified version without making your changes open source.  The
    GPL-compatible licenses make it possible to combine Python with
    other software that is released under the GPL; the others don't.

(2) According to Richard Stallman, 1.6.1 is not GPL-compatible,
    because its license has a choice of law clause.  According to
    CNRI, however, Stallman's lawyer has told CNRI's lawyer that 1.6.1
    is "not incompatible" with the GPL.

Thanks to the many outside volunteers who have worked under Guido's
direction to make these releases possible.


B. TERMS AND CONDITIONS FOR ACCESSING OR OTHERWISE USING PYTHON
===============================================================

PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2
--------------------------------------------

1. This LICENSE AGREEMENT is between the Python Software Foundation
("PSF"), and the Individual or Organization ("Licensee") accessing and
otherwise using this software ("Python") in source or binary form and
its associated documentation.

2. Subject to the terms and conditions of this License Agreement, PSF hereby
grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce,
analyze, test, perform and/or display publicly, prepare derivative works,
distribute, and otherwise use Python alone or in any derivative version,
provided, however, that PSF's License Agreement and PSF's notice of copyright,
i.e., "Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Python Software Foundation;
All Rights Reserved" are retained in Python alone or in any derivative version
prepared by Licensee.

3. In the event Licensee prepares a derivative work that is based on
or incorporates Python or any part thereof, and wants to make
the derivative work available to others as provided herein, then
Licensee hereby agrees to include in any such work a brief summary of
the changes made to Python.

4. PSF is making Python available to Licensee on an "AS IS"
basis.  PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
IMPLIED.  BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND
DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON WILL NOT
INFRINGE ANY THIRD PARTY RIGHTS.

5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON
FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS
A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON,
OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.

6. This License Agreement will automatically terminate upon a material
breach of its terms and conditions.

7. Nothing in this License Agreement shall be deemed to create any
relationship of agency, partnership, or joint venture between PSF and
Licensee.  This License Agreement does not grant permission to use PSF
trademarks or trade name in a trademark sense to endorse or promote
products or services of Licensee, or any third party.

8. By copying, installing or otherwise using Python, Licensee
agrees to be bound by the terms and conditions of this License
Agreement.


BEOPEN.COM LICENSE AGREEMENT FOR PYTHON 2.0
-------------------------------------------

BEOPEN PYTHON OPEN SOURCE LICENSE AGREEMENT VERSION 1

1. This LICENSE AGREEMENT is between BeOpen.com ("BeOpen"), having an
office at 160 Saratoga Avenue, Santa Clara, CA 95051, and the
Individual or Organization ("Licensee") accessing and otherwise using
this software in source or binary form and its associated
documentation ("the Software").

2. Subject to the terms and conditions of this BeOpen Python License
Agreement, BeOpen hereby grants Licensee a non-exclusive,
royalty-free, world-wide license to reproduce, analyze, test, perform
and/or display publicly, prepare derivative works, distribute, and
otherwise use the Software alone or in any derivative version,
provided, however, that the BeOpen Python License is retained in the
Software, alone or in any derivative version prepared by Licensee.

3. BeOpen is making the Software available to Licensee on an "AS IS"
basis.  BEOPEN MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
IMPLIED.  BY WAY OF EXAMPLE, BUT NOT LIMITATION, BEOPEN MAKES NO AND
DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE WILL NOT
INFRINGE ANY THIRD PARTY RIGHTS.

4. BEOPEN SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF THE
SOFTWARE FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS
AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THE SOFTWARE, OR ANY
DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.

5. This License Agreement will automatically terminate upon a material
breach of its terms and conditions.

6. This License Agreement shall be governed by and interpreted in all
respects by the law of the State of California, excluding conflict of
law provisions.  Nothing in this License Agreement shall be deemed to
create any relationship of agency, partnership, or joint venture
between BeOpen and Licensee.  This License Agreement does not grant
permission to use BeOpen trademarks or trade names in a trademark
sense to endorse or promote products or services of Licensee, or any
third party.  As an exception, the "BeOpen Python" logos available at
http://www.pythonlabs.com/logos.html may be used according to the
permissions granted on that web page.

7. By copying, installing or otherwise using the software, Licensee
agrees to be bound by the terms and conditions of this License
Agreement.


CNRI LICENSE AGREEMENT FOR PYTHON 1.6.1
---------------------------------------

1. This LICENSE AGREEMENT is between the Corporation for National
Research Initiatives, having an office at 1895 Preston White Drive,
Reston, VA 20191 ("CNRI"), and the Individual or Organization
("Licensee") accessing and otherwise using Python 1.6.1 software in
source or binary form and its associated documentation.

2. Subject to the terms and conditions of this License Agreement, CNRI
hereby grants Licensee a nonexclusive, royalty-free, world-wide
license to reproduce, analyze, test, perform and/or display publicly,
prepare derivative works, distribute, and otherwise use Python 1.6.1
alone or in any derivative version, provided, however, that CNRI's
License Agreement and CNRI's notice of copyright, i.e., "Copyright (c)
1995-2001 Corporation for National Research Initiatives; All Rights
Reserved" are retained in Python 1.6.1 alone or in any derivative
version prepared by Licensee.  Alternately, in lieu of CNRI's License
Agreement, Licensee may substitute the following text (omitting the
quotes): "Python 1.6.1 is made available subject to the terms and
conditions in CNRI's License Agreement.  This Agreement together with
Python 1.6.1 may be located on the Internet using the following
unique, persistent identifier (known as a handle): 1895.22/1013.  This
Agreement may also be obtained from a proxy server on the Internet
using the following URL: http://hdl.handle.net/1895.22/1013".

3. In the event Licensee prepares a derivative work that is based on
or incorporates Python 1.6.1 or any part thereof, and wants to make
the derivative work available to others as provided herein, then
Licensee hereby agrees to include in any such work a brief summary of
the changes made to Python 1.6.1.

4. CNRI is making Python 1.6.1 available to Licensee on an "AS IS"
basis.  CNRI MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
IMPLIED.  BY WAY OF EXAMPLE, BUT NOT LIMITATION, CNRI MAKES NO AND
DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON 1.6.1 WILL NOT
INFRINGE ANY THIRD PARTY RIGHTS.

5. CNRI SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON
1.6.1 FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS
A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON 1.6.1,
OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.

6. This License Agreement will automatically terminate upon a material
breach of its terms and conditions.

7. This License Agreement shall be governed by the federal
intellectual property law of the United States, including without
limitation the federal copyright law, and, to the extent such
U.S. federal law does not apply, by the law of the Commonwealth of
Virginia, excluding Virginia's conflict of law provisions.
Notwithstanding the foregoing, with regard to derivative works based
on Python 1.6.1 that incorporate non-separable material that was
previously distributed under the GNU General Public License (GPL), the
law of the Commonwealth of Virginia shall govern this License
Agreement only as to issues arising under or with respect to
Paragraphs 4, 5, and 7 of this License Agreement.  Nothing in this
License Agreement shall be deemed to create any relationship of
agency, partnership, or joint venture between CNRI and Licensee.  This
License Agreement does not grant permission to use CNRI trademarks or
trade name in a trademark sense to endorse or promote products or
services of Licensee, or any third party.

8. By clicking on the "ACCEPT" button where indicated, or by copying,
installing or otherwise using Python 1.6.1, Licensee agrees to be
bound by the terms and conditions of this License Agreement.

        ACCEPT


CWI LICENSE AGREEMENT FOR PYTHON 0.9.0 THROUGH 1.2
--------------------------------------------------

Copyright (c) 1991 - 1995, Stichting Mathematisch Centrum Amsterdam,
The Netherlands.  All rights reserved.

Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the name of Stichting Mathematisch
Centrum or CWI not be used in advertising or publicity pertaining to
distribution of the software without specific, written prior
permission.

STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO
THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE
FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
// Port of python's argparse module, version 3.9.0:
// https://github.com/python/cpython/blob/v3.9.0rc1/Lib/argparse.py

'use strict'

// Copyright (C) 2010-2020 Python Software Foundation.
// Copyright (C) 2020 argparse.js authors

/*
 * Command-line parsing library
 *
 * This module is an optparse-inspired command-line parsing library that:
 *
 *     - handles both optional and positional arguments
 *     - produces highly informative usage messages
 *     - supports parsers that dispatch to sub-parsers
 *
 * The following is a simple usage example that sums integers from the
 * command-line and writes the result to a file::
 *
 *     parser = argparse.ArgumentParser(
 *         description='sum the integers at the command line')
 *     parser.add_argument(
 *         'integers', metavar='int', nargs='+', type=int,
 *         help='an integer to be summed')
 *     parser.add_argument(
 *         '--log', default=sys.stdout, type=argparse.FileType('w'),
 *         help='the file where the sum should be written')
 *     args = parser.parse_args()
 *     args.log.write('%s' % sum(args.integers))
 *     args.log.close()
 *
 * The module contains the following public classes:
 *
 *     - ArgumentParser -- The main entry point for command-line parsing. As the
 *         example above shows, the add_argument() method is used to populate
 *         the parser with actions for optional and positional arguments. Then
 *         the parse_args() method is invoked to convert the args at the
 *         command-line into an object with attributes.
 *
 *     - ArgumentError -- The exception raised by ArgumentParser objects when
 *         there are errors with the parser's actions. Errors raised while
 *         parsing the command-line are caught by ArgumentParser and emitted
 *         as command-line messages.
 *
 *     - FileType -- A factory for defining types of files to be created. As the
 *         example above shows, instances of FileType are typically passed as
 *         the type= argument of add_argument() calls.
 *
 *     - Action -- The base class for parser actions. Typically actions are
 *         selected by passing strings like 'store_true' or 'append_const' to
 *         the action= argument of add_argument(). However, for greater
 *         customization of ArgumentParser actions, subclasses of Action may
 *         be defined and passed as the action= argument.
 *
 *     - HelpFormatter, RawDescriptionHelpFormatter, RawTextHelpFormatter,
 *         ArgumentDefaultsHelpFormatter -- Formatter classes which
 *         may be passed as the formatter_class= argument to the
 *         ArgumentParser constructor. HelpFormatter is the default,
 *         RawDescriptionHelpFormatter and RawTextHelpFormatter tell the parser
 *         not to change the formatting for help text, and
 *         ArgumentDefaultsHelpFormatter adds information about argument defaults
 *         to the help.
 *
 * All other classes in this module are considered implementation details.
 * (Also note that HelpFormatter and RawDescriptionHelpFormatter are only
 * considered public as object names -- the API of the formatter objects is
 * still considered an implementation detail.)
 */

const SUPPRESS = '==SUPPRESS=='

const OPTIONAL = '?'
const ZERO_OR_MORE = '*'
const ONE_OR_MORE = '+'
const PARSER = 'A...'
const REMAINDER = '...'
const _UNRECOGNIZED_ARGS_ATTR = '_unrecognized_args'


// ==================================
// Utility functions used for porting
// ==================================
const assert = require('assert')
const util = require('util')
const fs = require('fs')
const sub = require('./lib/sub')
const path = require('path')
const repr = util.inspect

function get_argv() {
    // omit first argument (which is assumed to be interpreter - `node`, `coffee`, `ts-node`, etc.)
    return process.argv.slice(1)
}

function get_terminal_size() {
    return {
        columns: +process.env.COLUMNS || process.stdout.columns || 80
    }
}

function hasattr(object, name) {
    return Object.prototype.hasOwnProperty.call(object, name)
}

function getattr(object, name, value) {
    return hasattr(object, name) ? object[name] : value
}

function setattr(object, name, value) {
    object[name] = value
}

function setdefault(object, name, value) {
    if (!hasattr(object, name)) object[name] = value
    return object[name]
}

function delattr(object, name) {
    delete object[name]
}

function range(from, to, step=1) {
    // range(10) is equivalent to range(0, 10)
    if (arguments.length === 1) [ to, from ] = [ from, 0 ]
    if (typeof from !== 'number' || typeof to !== 'number' || typeof step !== 'number') {
        throw new TypeError('argument cannot be interpreted as an integer')
    }
    if (step === 0) throw new TypeError('range() arg 3 must not be zero')

    let result = []
    if (step > 0) {
        for (let i = from; i < to; i += step) result.push(i)
    } else {
        for (let i = from; i > to; i += step) result.push(i)
    }
    return result
}

function splitlines(str, keepends = false) {
    let result
    if (!keepends) {
        result = str.split(/\r\n|[\n\r\v\f\x1c\x1d\x1e\x85\u2028\u2029]/)
    } else {
        result = []
        let parts = str.split(/(\r\n|[\n\r\v\f\x1c\x1d\x1e\x85\u2028\u2029])/)
        for (let i = 0; i < parts.length; i += 2) {
            result.push(parts[i] + (i + 1 < parts.length ? parts[i + 1] : ''))
        }
    }
    if (!result[result.length - 1]) result.pop()
    return result
}

function _string_lstrip(string, prefix_chars) {
    let idx = 0
    while (idx < string.length && prefix_chars.includes(string[idx])) idx++
    return idx ? string.slice(idx) : string
}

function _string_split(string, sep, maxsplit) {
    let result = string.split(sep)
    if (result.length > maxsplit) {
        result = result.slice(0, maxsplit).concat([ result.slice(maxsplit).join(sep) ])
    }
    return result
}

function _array_equal(array1, array2) {
    if (array1.length !== array2.length) return false
    for (let i = 0; i < array1.length; i++) {
        if (array1[i] !== array2[i]) return false
    }
    return true
}

function _array_remove(array, item) {
    let idx = array.indexOf(item)
    if (idx === -1) throw new TypeError(sub('%r not in list', item))
    array.splice(idx, 1)
}

// normalize choices to array;
// this isn't required in python because `in` and `map` operators work with anything,
// but in js dealing with multiple types here is too clunky
function _choices_to_array(choices) {
    if (choices === undefined) {
        return []
    } else if (Array.isArray(choices)) {
        return choices
    } else if (choices !== null && typeof choices[Symbol.iterator] === 'function') {
        return Array.from(choices)
    } else if (typeof choices === 'object' && choices !== null) {
        return Object.keys(choices)
    } else {
        throw new Error(sub('invalid choices value: %r', choices))
    }
}

// decorator that allows a class to be called without new
function _callable(cls) {
    let result = { // object is needed for inferred class name
        [cls.name]: function (...args) {
            let this_class = new.target === result || !new.target
            return Reflect.construct(cls, args, this_class ? cls : new.target)
        }
    }
    result[cls.name].prototype = cls.prototype
    // fix default tag for toString, e.g. [object Action] instead of [object Object]
    cls.prototype[Symbol.toStringTag] = cls.name
    return result[cls.name]
}

function _alias(object, from, to) {
    try {
        let name = object.constructor.name
        Object.defineProperty(object, from, {
            value: util.deprecate(object[to], sub('%s.%s() is renamed to %s.%s()',
                name, from, name, to)),
            enumerable: false
        })
    } catch {}
}

// decorator that allows snake_case class methods to be called with camelCase and vice versa
function _camelcase_alias(_class) {
    for (let name of Object.getOwnPropertyNames(_class.prototype)) {
        let camelcase = name.replace(/\w_[a-z]/g, s => s[0] + s[2].toUpperCase())
        if (camelcase !== name) _alias(_class.prototype, camelcase, name)
    }
    return _class
}

function _to_legacy_name(key) {
    key = key.replace(/\w_[a-z]/g, s => s[0] + s[2].toUpperCase())
    if (key === 'default') key = 'defaultValue'
    if (key === 'const') key = 'constant'
    return key
}

function _to_new_name(key) {
    if (key === 'defaultValue') key = 'default'
    if (key === 'constant') key = 'const'
    key = key.replace(/[A-Z]/g, c => '_' + c.toLowerCase())
    return key
}

// parse options
let no_default = Symbol('no_default_value')
function _parse_opts(args, descriptor) {
    function get_name() {
        let stack = new Error().stack.split('\n')
            .map(x => x.match(/^    at (.*) \(.*\)$/))
            .filter(Boolean)
            .map(m => m[1])
            .map(fn => fn.match(/[^ .]*$/)[0])

        if (stack.length && stack[0] === get_name.name) stack.shift()
        if (stack.length && stack[0] === _parse_opts.name) stack.shift()
        return stack.length ? stack[0] : ''
    }

    args = Array.from(args)
    let kwargs = {}
    let result = []
    let last_opt = args.length && args[args.length - 1]

    if (typeof last_opt === 'object' && last_opt !== null && !Array.isArray(last_opt) &&
        (!last_opt.constructor || last_opt.constructor.name === 'Object')) {
        kwargs = Object.assign({}, args.pop())
    }

    // LEGACY (v1 compatibility): camelcase
    let renames = []
    for (let key of Object.keys(descriptor)) {
        let old_name = _to_legacy_name(key)
        if (old_name !== key && (old_name in kwargs)) {
            if (key in kwargs) {
                // default and defaultValue specified at the same time, happens often in old tests
                //throw new TypeError(sub('%s() got multiple values for argument %r', get_name(), key))
            } else {
                kwargs[key] = kwargs[old_name]
            }
            renames.push([ old_name, key ])
            delete kwargs[old_name]
        }
    }
    if (renames.length) {
        let name = get_name()
        deprecate('camelcase_' + name, sub('%s(): following options are renamed: %s',
            name, renames.map(([ a, b ]) => sub('%r -> %r', a, b))))
    }
    // end

    let missing_positionals = []
    let positional_count = args.length

    for (let [ key, def ] of Object.entries(descriptor)) {
        if (key[0] === '*') {
            if (key.length > 0 && key[1] === '*') {
                // LEGACY (v1 compatibility): camelcase
                let renames = []
                for (let key of Object.keys(kwargs)) {
                    let new_name = _to_new_name(key)
                    if (new_name !== key && (key in kwargs)) {
                        if (new_name in kwargs) {
                            // default and defaultValue specified at the same time, happens often in old tests
                            //throw new TypeError(sub('%s() got multiple values for argument %r', get_name(), new_name))
                        } else {
                            kwargs[new_name] = kwargs[key]
                        }
                        renames.push([ key, new_name ])
                        delete kwargs[key]
                    }
                }
                if (renames.length) {
                    let name = get_name()
                    deprecate('camelcase_' + name, sub('%s(): following options are renamed: %s',
                        name, renames.map(([ a, b ]) => sub('%r -> %r', a, b))))
                }
                // end
                result.push(kwargs)
                kwargs = {}
            } else {
                result.push(args)
                args = []
            }
        } else if (key in kwargs && args.length > 0) {
            throw new TypeError(sub('%s() got multiple values for argument %r', get_name(), key))
        } else if (key in kwargs) {
            result.push(kwargs[key])
            delete kwargs[key]
        } else if (args.length > 0) {
            result.push(args.shift())
        } else if (def !== no_default) {
            result.push(def)
        } else {
            missing_positionals.push(key)
        }
    }

    if (Object.keys(kwargs).length) {
        throw new TypeError(sub('%s() got an unexpected keyword argument %r',
            get_name(), Object.keys(kwargs)[0]))
    }

    if (args.length) {
        let from = Object.entries(descriptor).filter(([ k, v ]) => k[0] !== '*' && v !== no_default).length
        let to = Object.entries(descriptor).filter(([ k ]) => k[0] !== '*').length
        throw new TypeError(sub('%s() takes %s positional argument%s but %s %s given',
            get_name(),
            from === to ? sub('from %s to %s', from, to) : to,
            from === to && to === 1 ? '' : 's',
            positional_count,
            positional_count === 1 ? 'was' : 'were'))
    }

    if (missing_positionals.length) {
        let strs = missing_positionals.map(repr)
        if (strs.length > 1) strs[strs.length - 1] = 'and ' + strs[strs.length - 1]
        let str_joined = strs.join(strs.length === 2 ? '' : ', ')
        throw new TypeError(sub('%s() missing %i required positional argument%s: %s',
            get_name(), strs.length, strs.length === 1 ? '' : 's', str_joined))
    }

    return result
}

let _deprecations = {}
function deprecate(id, string) {
    _deprecations[id] = _deprecations[id] || util.deprecate(() => {}, string)
    _deprecations[id]()
}


// =============================
// Utility functions and classes
// =============================
function _AttributeHolder(cls = Object) {
    /*
     *  Abstract base class that provides __repr__.
     *
     *  The __repr__ method returns a string in the format::
     *      ClassName(attr=name, attr=name, ...)
     *  The attributes are determined either by a class-level attribute,
     *  '_kwarg_names', or by inspecting the instance __dict__.
     */

    return class _AttributeHolder extends cls {
        [util.inspect.custom]() {
            let type_name = this.constructor.name
            let arg_strings = []
            let star_args = {}
            for (let arg of this._get_args()) {
                arg_strings.push(repr(arg))
            }
            for (let [ name, value ] of this._get_kwargs()) {
                if (/^[a-z_][a-z0-9_$]*$/i.test(name)) {
                    arg_strings.push(sub('%s=%r', name, value))
                } else {
                    star_args[name] = value
                }
            }
            if (Object.keys(star_args).length) {
                arg_strings.push(sub('**%s', repr(star_args)))
            }
            return sub('%s(%s)', type_name, arg_strings.join(', '))
        }

        toString() {
            return this[util.inspect.custom]()
        }

        _get_kwargs() {
            return Object.entries(this)
        }

        _get_args() {
            return []
        }
    }
}


function _copy_items(items) {
    if (items === undefined) {
        return []
    }
    return items.slice(0)
}


// ===============
// Formatting Help
// ===============
const HelpFormatter = _camelcase_alias(_callable(class HelpFormatter {
    /*
     *  Formatter for generating usage messages and argument help strings.
     *
     *  Only the name of this class is considered a public API. All the methods
     *  provided by the class are considered an implementation detail.
     */

    constructor() {
        let [
            prog,
            indent_increment,
            max_help_position,
            width
        ] = _parse_opts(arguments, {
            prog: no_default,
            indent_increment: 2,
            max_help_position: 24,
            width: undefined
        })

        // default setting for width
        if (width === undefined) {
            width = get_terminal_size().columns
            width -= 2
        }

        this._prog = prog
        this._indent_increment = indent_increment
        this._max_help_position = Math.min(max_help_position,
                                      Math.max(width - 20, indent_increment * 2))
        this._width = width

        this._current_indent = 0
        this._level = 0
        this._action_max_length = 0

        this._root_section = this._Section(this, undefined)
        this._current_section = this._root_section

        this._whitespace_matcher = /[ \t\n\r\f\v]+/g // equivalent to python /\s+/ with ASCII flag
        this._long_break_matcher = /\n\n\n+/g
    }

    // ===============================
    // Section and indentation methods
    // ===============================
    _indent() {
        this._current_indent += this._indent_increment
        this._level += 1
    }

    _dedent() {
        this._current_indent -= this._indent_increment
        assert(this._current_indent >= 0, 'Indent decreased below 0.')
        this._level -= 1
    }

    _add_item(func, args) {
        this._current_section.items.push([ func, args ])
    }

    // ========================
    // Message building methods
    // ========================
    start_section(heading) {
        this._indent()
        let section = this._Section(this, this._current_section, heading)
        this._add_item(section.format_help.bind(section), [])
        this._current_section = section
    }

    end_section() {
        this._current_section = this._current_section.parent
        this._dedent()
    }

    add_text(text) {
        if (text !== SUPPRESS && text !== undefined) {
            this._add_item(this._format_text.bind(this), [text])
        }
    }

    add_usage(usage, actions, groups, prefix = undefined) {
        if (usage !== SUPPRESS) {
            let args = [ usage, actions, groups, prefix ]
            this._add_item(this._format_usage.bind(this), args)
        }
    }

    add_argument(action) {
        if (action.help !== SUPPRESS) {

            // find all invocations
            let invocations = [this._format_action_invocation(action)]
            for (let subaction of this._iter_indented_subactions(action)) {
                invocations.push(this._format_action_invocation(subaction))
            }

            // update the maximum item length
            let invocation_length = Math.max(...invocations.map(invocation => invocation.length))
            let action_length = invocation_length + this._current_indent
            this._action_max_length = Math.max(this._action_max_length,
                                               action_length)

            // add the item to the list
            this._add_item(this._format_action.bind(this), [action])
        }
    }

    add_arguments(actions) {
        for (let action of actions) {
            this.add_argument(action)
        }
    }

    // =======================
    // Help-formatting methods
    // =======================
    format_help() {
        let help = this._root_section.format_help()
        if (help) {
            help = help.replace(this._long_break_matcher, '\n\n')
            help = help.replace(/^\n+|\n+$/g, '') + '\n'
        }
        return help
    }

    _join_parts(part_strings) {
        return part_strings.filter(part => part && part !== SUPPRESS).join('')
    }

    _format_usage(usage, actions, groups, prefix) {
        if (prefix === undefined) {
            prefix = 'usage: '
        }

        // if usage is specified, use that
        if (usage !== undefined) {
            usage = sub(usage, { prog: this._prog })

        // if no optionals or positionals are available, usage is just prog
        } else if (usage === undefined && !actions.length) {
            usage = sub('%(prog)s', { prog: this._prog })

        // if optionals and positionals are available, calculate usage
        } else if (usage === undefined) {
            let prog = sub('%(prog)s', { prog: this._prog })

            // split optionals from positionals
            let optionals = []
            let positionals = []
            for (let action of actions) {
                if (action.option_strings.length) {
                    optionals.push(action)
                } else {
                    positionals.push(action)
                }
            }

            // build full usage string
            let action_usage = this._format_actions_usage([].concat(optionals).concat(positionals), groups)
            usage = [ prog, action_usage ].map(String).join(' ')

            // wrap the usage parts if it's too long
            let text_width = this._width - this._current_indent
            if (prefix.length + usage.length > text_width) {

                // break usage into wrappable parts
                let part_regexp = /\(.*?\)+(?=\s|$)|\[.*?\]+(?=\s|$)|\S+/g
                let opt_usage = this._format_actions_usage(optionals, groups)
                let pos_usage = this._format_actions_usage(positionals, groups)
                let opt_parts = opt_usage.match(part_regexp) || []
                let pos_parts = pos_usage.match(part_regexp) || []
                assert(opt_parts.join(' ') === opt_usage)
                assert(pos_parts.join(' ') === pos_usage)

                // helper for wrapping lines
                let get_lines = (parts, indent, prefix = undefined) => {
                    let lines = []
                    let line = []
                    let line_len
                    if (prefix !== undefined) {
                        line_len = prefix.length - 1
                    } else {
                        line_len = indent.length - 1
                    }
                    for (let part of parts) {
                        if (line_len + 1 + part.length > text_width && line) {
                            lines.push(indent + line.join(' '))
                            line = []
                            line_len = indent.length - 1
                        }
                        line.push(part)
                        line_len += part.length + 1
                    }
                    if (line.length) {
                        lines.push(indent + line.join(' '))
                    }
                    if (prefix !== undefined) {
                        lines[0] = lines[0].slice(indent.length)
                    }
                    return lines
                }

                let lines

                // if prog is short, follow it with optionals or positionals
                if (prefix.length + prog.length <= 0.75 * text_width) {
                    let indent = ' '.repeat(prefix.length + prog.length + 1)
                    if (opt_parts.length) {
                        lines = get_lines([prog].concat(opt_parts), indent, prefix)
                        lines = lines.concat(get_lines(pos_parts, indent))
                    } else if (pos_parts.length) {
                        lines = get_lines([prog].concat(pos_parts), indent, prefix)
                    } else {
                        lines = [prog]
                    }

                // if prog is long, put it on its own line
                } else {
                    let indent = ' '.repeat(prefix.length)
                    let parts = [].concat(opt_parts).concat(pos_parts)
                    lines = get_lines(parts, indent)
                    if (lines.length > 1) {
                        lines = []
                        lines = lines.concat(get_lines(opt_parts, indent))
                        lines = lines.concat(get_lines(pos_parts, indent))
                    }
                    lines = [prog].concat(lines)
                }

                // join lines into usage
                usage = lines.join('\n')
            }
        }

        // prefix with 'usage:'
        return sub('%s%s\n\n', prefix, usage)
    }

    _format_actions_usage(actions, groups) {
        // find group indices and identify actions in groups
        let group_actions = new Set()
        let inserts = {}
        for (let group of groups) {
            let start = actions.indexOf(group._group_actions[0])
            if (start === -1) {
                continue
            } else {
                let end = start + group._group_actions.length
                if (_array_equal(actions.slice(start, end), group._group_actions)) {
                    for (let action of group._group_actions) {
                        group_actions.add(action)
                    }
                    if (!group.required) {
                        if (start in inserts) {
                            inserts[start] += ' ['
                        } else {
                            inserts[start] = '['
                        }
                        if (end in inserts) {
                            inserts[end] += ']'
                        } else {
                            inserts[end] = ']'
                        }
                    } else {
                        if (start in inserts) {
                            inserts[start] += ' ('
                        } else {
                            inserts[start] = '('
                        }
                        if (end in inserts) {
                            inserts[end] += ')'
                        } else {
                            inserts[end] = ')'
                        }
                    }
                    for (let i of range(start + 1, end)) {
                        inserts[i] = '|'
                    }
                }
            }
        }

        // collect all actions format strings
        let parts = []
        for (let [ i, action ] of Object.entries(actions)) {

            // suppressed arguments are marked with None
            // remove | separators for suppressed arguments
            if (action.help === SUPPRESS) {
                parts.push(undefined)
                if (inserts[+i] === '|') {
                    delete inserts[+i]
                } else if (inserts[+i + 1] === '|') {
                    delete inserts[+i + 1]
                }

            // produce all arg strings
            } else if (!action.option_strings.length) {
                let default_value = this._get_default_metavar_for_positional(action)
                let part = this._format_args(action, default_value)

                // if it's in a group, strip the outer []
                if (group_actions.has(action)) {
                    if (part[0] === '[' && part[part.length - 1] === ']') {
                        part = part.slice(1, -1)
                    }
                }

                // add the action string to the list
                parts.push(part)

            // produce the first way to invoke the option in brackets
            } else {
                let option_string = action.option_strings[0]
                let part

                // if the Optional doesn't take a value, format is:
                //    -s or --long
                if (action.nargs === 0) {
                    part = action.format_usage()

                // if the Optional takes a value, format is:
                //    -s ARGS or --long ARGS
                } else {
                    let default_value = this._get_default_metavar_for_optional(action)
                    let args_string = this._format_args(action, default_value)
                    part = sub('%s %s', option_string, args_string)
                }

                // make it look optional if it's not required or in a group
                if (!action.required && !group_actions.has(action)) {
                    part = sub('[%s]', part)
                }

                // add the action string to the list
                parts.push(part)
            }
        }

        // insert things at the necessary indices
        for (let i of Object.keys(inserts).map(Number).sort((a, b) => b - a)) {
            parts.splice(+i, 0, inserts[+i])
        }

        // join all the action items with spaces
        let text = parts.filter(Boolean).join(' ')

        // clean up separators for mutually exclusive groups
        text = text.replace(/([\[(]) /g, '$1')
        text = text.replace(/ ([\])])/g, '$1')
        text = text.replace(/[\[(] *[\])]/g, '')
        text = text.replace(/\(([^|]*)\)/g, '$1', text)
        text = text.trim()

        // return the text
        return text
    }

    _format_text(text) {
        if (text.includes('%(prog)')) {
            text = sub(text, { prog: this._prog })
        }
        let text_width = Math.max(this._width - this._current_indent, 11)
        let indent = ' '.repeat(this._current_indent)
        return this._fill_text(text, text_width, indent) + '\n\n'
    }

    _format_action(action) {
        // determine the required width and the entry label
        let help_position = Math.min(this._action_max_length + 2,
                                     this._max_help_position)
        let help_width = Math.max(this._width - help_position, 11)
        let action_width = help_position - this._current_indent - 2
        let action_header = this._format_action_invocation(action)
        let indent_first

        // no help; start on same line and add a final newline
        if (!action.help) {
            let tup = [ this._current_indent, '', action_header ]
            action_header = sub('%*s%s\n', ...tup)

        // short action name; start on the same line and pad two spaces
        } else if (action_header.length <= action_width) {
            let tup = [ this._current_indent, '', action_width, action_header ]
            action_header = sub('%*s%-*s  ', ...tup)
            indent_first = 0

        // long action name; start on the next line
        } else {
            let tup = [ this._current_indent, '', action_header ]
            action_header = sub('%*s%s\n', ...tup)
            indent_first = help_position
        }

        // collect the pieces of the action help
        let parts = [action_header]

        // if there was help for the action, add lines of help text
        if (action.help) {
            let help_text = this._expand_help(action)
            let help_lines = this._split_lines(help_text, help_width)
            parts.push(sub('%*s%s\n', indent_first, '', help_lines[0]))
            for (let line of help_lines.slice(1)) {
                parts.push(sub('%*s%s\n', help_position, '', line))
            }

        // or add a newline if the description doesn't end with one
        } else if (!action_header.endsWith('\n')) {
            parts.push('\n')
        }

        // if there are any sub-actions, add their help as well
        for (let subaction of this._iter_indented_subactions(action)) {
            parts.push(this._format_action(subaction))
        }

        // return a single string
        return this._join_parts(parts)
    }

    _format_action_invocation(action) {
        if (!action.option_strings.length) {
            let default_value = this._get_default_metavar_for_positional(action)
            let metavar = this._metavar_formatter(action, default_value)(1)[0]
            return metavar

        } else {
            let parts = []

            // if the Optional doesn't take a value, format is:
            //    -s, --long
            if (action.nargs === 0) {
                parts = parts.concat(action.option_strings)

            // if the Optional takes a value, format is:
            //    -s ARGS, --long ARGS
            } else {
                let default_value = this._get_default_metavar_for_optional(action)
                let args_string = this._format_args(action, default_value)
                for (let option_string of action.option_strings) {
                    parts.push(sub('%s %s', option_string, args_string))
                }
            }

            return parts.join(', ')
        }
    }

    _metavar_formatter(action, default_metavar) {
        let result
        if (action.metavar !== undefined) {
            result = action.metavar
        } else if (action.choices !== undefined) {
            let choice_strs = _choices_to_array(action.choices).map(String)
            result = sub('{%s}', choice_strs.join(','))
        } else {
            result = default_metavar
        }

        function format(tuple_size) {
            if (Array.isArray(result)) {
                return result
            } else {
                return Array(tuple_size).fill(result)
            }
        }
        return format
    }

    _format_args(action, default_metavar) {
        let get_metavar = this._metavar_formatter(action, default_metavar)
        let result
        if (action.nargs === undefined) {
            result = sub('%s', ...get_metavar(1))
        } else if (action.nargs === OPTIONAL) {
            result = sub('[%s]', ...get_metavar(1))
        } else if (action.nargs === ZERO_OR_MORE) {
            let metavar = get_metavar(1)
            if (metavar.length === 2) {
                result = sub('[%s [%s ...]]', ...metavar)
            } else {
                result = sub('[%s ...]', ...metavar)
            }
        } else if (action.nargs === ONE_OR_MORE) {
            result = sub('%s [%s ...]', ...get_metavar(2))
        } else if (action.nargs === REMAINDER) {
            result = '...'
        } else if (action.nargs === PARSER) {
            result = sub('%s ...', ...get_metavar(1))
        } else if (action.nargs === SUPPRESS) {
            result = ''
        } else {
            let formats
            try {
                formats = range(action.nargs).map(() => '%s')
            } catch (err) {
                throw new TypeError('invalid nargs value')
            }
            result = sub(formats.join(' '), ...get_metavar(action.nargs))
        }
        return result
    }

    _expand_help(action) {
        let params = Object.assign({ prog: this._prog }, action)
        for (let name of Object.keys(params)) {
            if (params[name] === SUPPRESS) {
                delete params[name]
            }
        }
        for (let name of Object.keys(params)) {
            if (params[name] && params[name].name) {
                params[name] = params[name].name
            }
        }
        if (params.choices !== undefined) {
            let choices_str = _choices_to_array(params.choices).map(String).join(', ')
            params.choices = choices_str
        }
        // LEGACY (v1 compatibility): camelcase
        for (let key of Object.keys(params)) {
            let old_name = _to_legacy_name(key)
            if (old_name !== key) {
                params[old_name] = params[key]
            }
        }
        // end
        return sub(this._get_help_string(action), params)
    }

    * _iter_indented_subactions(action) {
        if (typeof action._get_subactions === 'function') {
            this._indent()
            yield* action._get_subactions()
            this._dedent()
        }
    }

    _split_lines(text, width) {
        text = text.replace(this._whitespace_matcher, ' ').trim()
        // The textwrap module is used only for formatting help.
        // Delay its import for speeding up the common usage of argparse.
        let textwrap = require('./lib/textwrap')
        return textwrap.wrap(text, { width })
    }

    _fill_text(text, width, indent) {
        text = text.replace(this._whitespace_matcher, ' ').trim()
        let textwrap = require('./lib/textwrap')
        return textwrap.fill(text, { width,
                                     initial_indent: indent,
                                     subsequent_indent: indent })
    }

    _get_help_string(action) {
        return action.help
    }

    _get_default_metavar_for_optional(action) {
        return action.dest.toUpperCase()
    }

    _get_default_metavar_for_positional(action) {
        return action.dest
    }
}))

HelpFormatter.prototype._Section = _callable(class _Section {

    constructor(formatter, parent, heading = undefined) {
        this.formatter = formatter
        this.parent = parent
        this.heading = heading
        this.items = []
    }

    format_help() {
        // format the indented section
        if (this.parent !== undefined) {
            this.formatter._indent()
        }
        let item_help = this.formatter._join_parts(this.items.map(([ func, args ]) => func.apply(null, args)))
        if (this.parent !== undefined) {
            this.formatter._dedent()
        }

        // return nothing if the section was empty
        if (!item_help) {
            return ''
        }

        // add the heading if the section was non-empty
        let heading
        if (this.heading !== SUPPRESS && this.heading !== undefined) {
            let current_indent = this.formatter._current_indent
            heading = sub('%*s%s:\n', current_indent, '', this.heading)
        } else {
            heading = ''
        }

        // join the section-initial newline, the heading and the help
        return this.formatter._join_parts(['\n', heading, item_help, '\n'])
    }
})


const RawDescriptionHelpFormatter = _camelcase_alias(_callable(class RawDescriptionHelpFormatter extends HelpFormatter {
    /*
     *  Help message formatter which retains any formatting in descriptions.
     *
     *  Only the name of this class is considered a public API. All the methods
     *  provided by the class are considered an implementation detail.
     */

    _fill_text(text, width, indent) {
        return splitlines(text, true).map(line => indent + line).join('')
    }
}))


const RawTextHelpFormatter = _camelcase_alias(_callable(class RawTextHelpFormatter extends RawDescriptionHelpFormatter {
    /*
     *  Help message formatter which retains formatting of all help text.
     *
     *  Only the name of this class is considered a public API. All the methods
     *  provided by the class are considered an implementation detail.
     */

    _split_lines(text/*, width*/) {
        return splitlines(text)
    }
}))


const ArgumentDefaultsHelpFormatter = _camelcase_alias(_callable(class ArgumentDefaultsHelpFormatter extends HelpFormatter {
    /*
     *  Help message formatter which adds default values to argument help.
     *
     *  Only the name of this class is considered a public API. All the methods
     *  provided by the class are considered an implementation detail.
     */

    _get_help_string(action) {
        let help = action.help
        // LEGACY (v1 compatibility): additional check for defaultValue needed
        if (!action.help.includes('%(default)') && !action.help.includes('%(defaultValue)')) {
            if (action.default !== SUPPRESS) {
                let defaulting_nargs = [OPTIONAL, ZERO_OR_MORE]
                if (action.option_strings.length || defaulting_nargs.includes(action.nargs)) {
                    help += ' (default: %(default)s)'
                }
            }
        }
        return help
    }
}))


const MetavarTypeHelpFormatter = _camelcase_alias(_callable(class MetavarTypeHelpFormatter extends HelpFormatter {
    /*
     *  Help message formatter which uses the argument 'type' as the default
     *  metavar value (instead of the argument 'dest')
     *
     *  Only the name of this class is considered a public API. All the methods
     *  provided by the class are considered an implementation detail.
     */

    _get_default_metavar_for_optional(action) {
        return typeof action.type === 'function' ? action.type.name : action.type
    }

    _get_default_metavar_for_positional(action) {
        return typeof action.type === 'function' ? action.type.name : action.type
    }
}))


// =====================
// Options and Arguments
// =====================
function _get_action_name(argument) {
    if (argument === undefined) {
        return undefined
    } else if (argument.option_strings.length) {
        return argument.option_strings.join('/')
    } else if (![ undefined, SUPPRESS ].includes(argument.metavar)) {
        return argument.metavar
    } else if (![ undefined, SUPPRESS ].includes(argument.dest)) {
        return argument.dest
    } else {
        return undefined
    }
}


const ArgumentError = _callable(class ArgumentError extends Error {
    /*
     *  An error from creating or using an argument (optional or positional).
     *
     *  The string value of this exception is the message, augmented with
     *  information about the argument that caused it.
     */

    constructor(argument, message) {
        super()
        this.name = 'ArgumentError'
        this._argument_name = _get_action_name(argument)
        this._message = message
        this.message = this.str()
    }

    str() {
        let format
        if (this._argument_name === undefined) {
            format = '%(message)s'
        } else {
            format = 'argument %(argument_name)s: %(message)s'
        }
        return sub(format, { message: this._message,
                             argument_name: this._argument_name })
    }
})


const ArgumentTypeError = _callable(class ArgumentTypeError extends Error {
    /*
     * An error from trying to convert a command line string to a type.
     */

    constructor(message) {
        super(message)
        this.name = 'ArgumentTypeError'
    }
})


// ==============
// Action classes
// ==============
const Action = _camelcase_alias(_callable(class Action extends _AttributeHolder(Function) {
    /*
     *  Information about how to convert command line strings to Python objects.
     *
     *  Action objects are used by an ArgumentParser to represent the information
     *  needed to parse a single argument from one or more strings from the
     *  command line. The keyword arguments to the Action constructor are also
     *  all attributes of Action instances.
     *
     *  Keyword Arguments:
     *
     *      - option_strings -- A list of command-line option strings which
     *          should be associated with this action.
     *
     *      - dest -- The name of the attribute to hold the created object(s)
     *
     *      - nargs -- The number of command-line arguments that should be
     *          consumed. By default, one argument will be consumed and a single
     *          value will be produced.  Other values include:
     *              - N (an integer) consumes N arguments (and produces a list)
     *              - '?' consumes zero or one arguments
     *              - '*' consumes zero or more arguments (and produces a list)
     *              - '+' consumes one or more arguments (and produces a list)
     *          Note that the difference between the default and nargs=1 is that
     *          with the default, a single value will be produced, while with
     *          nargs=1, a list containing a single value will be produced.
     *
     *      - const -- The value to be produced if the option is specified and the
     *          option uses an action that takes no values.
     *
     *      - default -- The value to be produced if the option is not specified.
     *
     *      - type -- A callable that accepts a single string argument, and
     *          returns the converted value.  The standard Python types str, int,
     *          float, and complex are useful examples of such callables.  If None,
     *          str is used.
     *
     *      - choices -- A container of values that should be allowed. If not None,
     *          after a command-line argument has been converted to the appropriate
     *          type, an exception will be raised if it is not a member of this
     *          collection.
     *
     *      - required -- True if the action must always be specified at the
     *          command line. This is only meaningful for optional command-line
     *          arguments.
     *
     *      - help -- The help string describing the argument.
     *
     *      - metavar -- The name to be used for the option's argument with the
     *          help string. If None, the 'dest' value will be used as the name.
     */

    constructor() {
        let [
            option_strings,
            dest,
            nargs,
            const_value,
            default_value,
            type,
            choices,
            required,
            help,
            metavar
        ] = _parse_opts(arguments, {
            option_strings: no_default,
            dest: no_default,
            nargs: undefined,
            const: undefined,
            default: undefined,
            type: undefined,
            choices: undefined,
            required: false,
            help: undefined,
            metavar: undefined
        })

        // when this class is called as a function, redirect it to .call() method of itself
        super('return arguments.callee.call.apply(arguments.callee, arguments)')

        this.option_strings = option_strings
        this.dest = dest
        this.nargs = nargs
        this.const = const_value
        this.default = default_value
        this.type = type
        this.choices = choices
        this.required = required
        this.help = help
        this.metavar = metavar
    }

    _get_kwargs() {
        let names = [
            'option_strings',
            'dest',
            'nargs',
            'const',
            'default',
            'type',
            'choices',
            'help',
            'metavar'
        ]
        return names.map(name => [ name, getattr(this, name) ])
    }

    format_usage() {
        return this.option_strings[0]
    }

    call(/*parser, namespace, values, option_string = undefined*/) {
        throw new Error('.call() not defined')
    }
}))


const BooleanOptionalAction = _camelcase_alias(_callable(class BooleanOptionalAction extends Action {

    constructor() {
        let [
            option_strings,
            dest,
            default_value,
            type,
            choices,
            required,
            help,
            metavar
        ] = _parse_opts(arguments, {
            option_strings: no_default,
            dest: no_default,
            default: undefined,
            type: undefined,
            choices: undefined,
            required: false,
            help: undefined,
            metavar: undefined
        })

        let _option_strings = []
        for (let option_string of option_strings) {
            _option_strings.push(option_string)

            if (option_string.startsWith('--')) {
                option_string = '--no-' + option_string.slice(2)
                _option_strings.push(option_string)
            }
        }

        if (help !== undefined && default_value !== undefined) {
            help += ` (default: ${default_value})`
        }

        super({
            option_strings: _option_strings,
            dest,
            nargs: 0,
            default: default_value,
            type,
            choices,
            required,
            help,
            metavar
        })
    }

    call(parser, namespace, values, option_string = undefined) {
        if (this.option_strings.includes(option_string)) {
            setattr(namespace, this.dest, !option_string.startsWith('--no-'))
        }
    }

    format_usage() {
        return this.option_strings.join(' | ')
    }
}))


const _StoreAction = _callable(class _StoreAction extends Action {

    constructor() {
        let [
            option_strings,
            dest,
            nargs,
            const_value,
            default_value,
            type,
            choices,
            required,
            help,
            metavar
        ] = _parse_opts(arguments, {
            option_strings: no_default,
            dest: no_default,
            nargs: undefined,
            const: undefined,
            default: undefined,
            type: undefined,
            choices: undefined,
            required: false,
            help: undefined,
            metavar: undefined
        })

        if (nargs === 0) {
            throw new TypeError('nargs for store actions must be != 0; if you ' +
                        'have nothing to store, actions such as store ' +
                        'true or store const may be more appropriate')
        }
        if (const_value !== undefined && nargs !== OPTIONAL) {
            throw new TypeError(sub('nargs must be %r to supply const', OPTIONAL))
        }
        super({
            option_strings,
            dest,
            nargs,
            const: const_value,
            default: default_value,
            type,
            choices,
            required,
            help,
            metavar
        })
    }

    call(parser, namespace, values/*, option_string = undefined*/) {
        setattr(namespace, this.dest, values)
    }
})


const _StoreConstAction = _callable(class _StoreConstAction extends Action {

    constructor() {
        let [
            option_strings,
            dest,
            const_value,
            default_value,
            required,
            help
            //, metavar
        ] = _parse_opts(arguments, {
            option_strings: no_default,
            dest: no_default,
            const: no_default,
            default: undefined,
            required: false,
            help: undefined,
            metavar: undefined
        })

        super({
            option_strings,
            dest,
            nargs: 0,
            const: const_value,
            default: default_value,
            required,
            help
        })
    }

    call(parser, namespace/*, values, option_string = undefined*/) {
        setattr(namespace, this.dest, this.const)
    }
})


const _StoreTrueAction = _callable(class _StoreTrueAction extends _StoreConstAction {

    constructor() {
        let [
            option_strings,
            dest,
            default_value,
            required,
            help
        ] = _parse_opts(arguments, {
            option_strings: no_default,
            dest: no_default,
            default: false,
            required: false,
            help: undefined
        })

        super({
            option_strings,
            dest,
            const: true,
            default: default_value,
            required,
            help
        })
    }
})


const _StoreFalseAction = _callable(class _StoreFalseAction extends _StoreConstAction {

    constructor() {
        let [
            option_strings,
            dest,
            default_value,
            required,
            help
        ] = _parse_opts(arguments, {
            option_strings: no_default,
            dest: no_default,
            default: true,
            required: false,
            help: undefined
        })

        super({
            option_strings,
            dest,
            const: false,
            default: default_value,
            required,
            help
        })
    }
})


const _AppendAction = _callable(class _AppendAction extends Action {

    constructor() {
        let [
            option_strings,
            dest,
            nargs,
            const_value,
            default_value,
            type,
            choices,
            required,
            help,
            metavar
        ] = _parse_opts(arguments, {
            option_strings: no_default,
            dest: no_default,
            nargs: undefined,
            const: undefined,
            default: undefined,
            type: undefined,
            choices: undefined,
            required: false,
            help: undefined,
            metavar: undefined
        })

        if (nargs === 0) {
            throw new TypeError('nargs for append actions must be != 0; if arg ' +
                        'strings are not supplying the value to append, ' +
                        'the append const action may be more appropriate')
        }
        if (const_value !== undefined && nargs !== OPTIONAL) {
            throw new TypeError(sub('nargs must be %r to supply const', OPTIONAL))
        }
        super({
            option_strings,
            dest,
            nargs,
            const: const_value,
            default: default_value,
            type,
            choices,
            required,
            help,
            metavar
        })
    }

    call(parser, namespace, values/*, option_string = undefined*/) {
        let items = getattr(namespace, this.dest, undefined)
        items = _copy_items(items)
        items.push(values)
        setattr(namespace, this.dest, items)
    }
})


const _AppendConstAction = _callable(class _AppendConstAction extends Action {

    constructor() {
        let [
            option_strings,
            dest,
            const_value,
            default_value,
            required,
            help,
            metavar
        ] = _parse_opts(arguments, {
            option_strings: no_default,
            dest: no_default,
            const: no_default,
            default: undefined,
            required: false,
            help: undefined,
            metavar: undefined
        })

        super({
            option_strings,
            dest,
            nargs: 0,
            const: const_value,
            default: default_value,
            required,
            help,
            metavar
        })
    }

    call(parser, namespace/*, values, option_string = undefined*/) {
        let items = getattr(namespace, this.dest, undefined)
        items = _copy_items(items)
        items.push(this.const)
        setattr(namespace, this.dest, items)
    }
})


const _CountAction = _callable(class _CountAction extends Action {

    constructor() {
        let [
            option_strings,
            dest,
            default_value,
            required,
            help
        ] = _parse_opts(arguments, {
            option_strings: no_default,
            dest: no_default,
            default: undefined,
            required: false,
            help: undefined
        })

        super({
            option_strings,
            dest,
            nargs: 0,
            default: default_value,
            required,
            help
        })
    }

    call(parser, namespace/*, values, option_string = undefined*/) {
        let count = getattr(namespace, this.dest, undefined)
        if (count === undefined) {
            count = 0
        }
        setattr(namespace, this.dest, count + 1)
    }
})


const _HelpAction = _callable(class _HelpAction extends Action {

    constructor() {
        let [
            option_strings,
            dest,
            default_value,
            help
        ] = _parse_opts(arguments, {
            option_strings: no_default,
            dest: SUPPRESS,
            default: SUPPRESS,
            help: undefined
        })

        super({
            option_strings,
            dest,
            default: default_value,
            nargs: 0,
            help
        })
    }

    call(parser/*, namespace, values, option_string = undefined*/) {
        parser.print_help()
        parser.exit()
    }
})


const _VersionAction = _callable(class _VersionAction extends Action {

    constructor() {
        let [
            option_strings,
            version,
            dest,
            default_value,
            help
        ] = _parse_opts(arguments, {
            option_strings: no_default,
            version: undefined,
            dest: SUPPRESS,
            default: SUPPRESS,
            help: "show program's version number and exit"
        })

        super({
            option_strings,
            dest,
            default: default_value,
            nargs: 0,
            help
        })
        this.version = version
    }

    call(parser/*, namespace, values, option_string = undefined*/) {
        let version = this.version
        if (version === undefined) {
            version = parser.version
        }
        let formatter = parser._get_formatter()
        formatter.add_text(version)
        parser._print_message(formatter.format_help(), process.stdout)
        parser.exit()
    }
})


const _SubParsersAction = _camelcase_alias(_callable(class _SubParsersAction extends Action {

    constructor() {
        let [
            option_strings,
            prog,
            parser_class,
            dest,
            required,
            help,
            metavar
        ] = _parse_opts(arguments, {
            option_strings: no_default,
            prog: no_default,
            parser_class: no_default,
            dest: SUPPRESS,
            required: false,
            help: undefined,
            metavar: undefined
        })

        let name_parser_map = {}

        super({
            option_strings,
            dest,
            nargs: PARSER,
            choices: name_parser_map,
            required,
            help,
            metavar
        })

        this._prog_prefix = prog
        this._parser_class = parser_class
        this._name_parser_map = name_parser_map
        this._choices_actions = []
    }

    add_parser() {
        let [
            name,
            kwargs
        ] = _parse_opts(arguments, {
            name: no_default,
            '**kwargs': no_default
        })

        // set prog from the existing prefix
        if (kwargs.prog === undefined) {
            kwargs.prog = sub('%s %s', this._prog_prefix, name)
        }

        let aliases = getattr(kwargs, 'aliases', [])
        delete kwargs.aliases

        // create a pseudo-action to hold the choice help
        if ('help' in kwargs) {
            let help = kwargs.help
            delete kwargs.help
            let choice_action = this._ChoicesPseudoAction(name, aliases, help)
            this._choices_actions.push(choice_action)
        }

        // create the parser and add it to the map
        let parser = new this._parser_class(kwargs)
        this._name_parser_map[name] = parser

        // make parser available under aliases also
        for (let alias of aliases) {
            this._name_parser_map[alias] = parser
        }

        return parser
    }

    _get_subactions() {
        return this._choices_actions
    }

    call(parser, namespace, values/*, option_string = undefined*/) {
        let parser_name = values[0]
        let arg_strings = values.slice(1)

        // set the parser name if requested
        if (this.dest !== SUPPRESS) {
            setattr(namespace, this.dest, parser_name)
        }

        // select the parser
        if (hasattr(this._name_parser_map, parser_name)) {
            parser = this._name_parser_map[parser_name]
        } else {
            let args = {parser_name,
                        choices: this._name_parser_map.join(', ')}
            let msg = sub('unknown parser %(parser_name)r (choices: %(choices)s)', args)
            throw new ArgumentError(this, msg)
        }

        // parse all the remaining options into the namespace
        // store any unrecognized options on the object, so that the top
        // level parser can decide what to do with them

        // In case this subparser defines new defaults, we parse them
        // in a new namespace object and then update the original
        // namespace for the relevant parts.
        let subnamespace
        [ subnamespace, arg_strings ] = parser.parse_known_args(arg_strings, undefined)
        for (let [ key, value ] of Object.entries(subnamespace)) {
            setattr(namespace, key, value)
        }

        if (arg_strings.length) {
            setdefault(namespace, _UNRECOGNIZED_ARGS_ATTR, [])
            getattr(namespace, _UNRECOGNIZED_ARGS_ATTR).push(...arg_strings)
        }
    }
}))


_SubParsersAction.prototype._ChoicesPseudoAction = _callable(class _ChoicesPseudoAction extends Action {
    constructor(name, aliases, help) {
        let metavar = name, dest = name
        if (aliases.length) {
            metavar += sub(' (%s)', aliases.join(', '))
        }
        super({ option_strings: [], dest, help, metavar })
    }
})


const _ExtendAction = _callable(class _ExtendAction extends _AppendAction {
    call(parser, namespace, values/*, option_string = undefined*/) {
        let items = getattr(namespace, this.dest, undefined)
        items = _copy_items(items)
        items = items.concat(values)
        setattr(namespace, this.dest, items)
    }
})


// ==============
// Type classes
// ==============
const FileType = _callable(class FileType extends Function {
    /*
     *  Factory for creating file object types
     *
     *  Instances of FileType are typically passed as type= arguments to the
     *  ArgumentParser add_argument() method.
     *
     *  Keyword Arguments:
     *      - mode -- A string indicating how the file is to be opened. Accepts the
     *          same values as the builtin open() function.
     *      - bufsize -- The file's desired buffer size. Accepts the same values as
     *          the builtin open() function.
     *      - encoding -- The file's encoding. Accepts the same values as the
     *          builtin open() function.
     *      - errors -- A string indicating how encoding and decoding errors are to
     *          be handled. Accepts the same value as the builtin open() function.
     */

    constructor() {
        let [
            flags,
            encoding,
            mode,
            autoClose,
            emitClose,
            start,
            end,
            highWaterMark,
            fs
        ] = _parse_opts(arguments, {
            flags: 'r',
            encoding: undefined,
            mode: undefined, // 0o666
            autoClose: undefined, // true
            emitClose: undefined, // false
            start: undefined, // 0
            end: undefined, // Infinity
            highWaterMark: undefined, // 64 * 1024
            fs: undefined
        })

        // when this class is called as a function, redirect it to .call() method of itself
        super('return arguments.callee.call.apply(arguments.callee, arguments)')

        Object.defineProperty(this, 'name', {
            get() {
                return sub('FileType(%r)', flags)
            }
        })
        this._flags = flags
        this._options = {}
        if (encoding !== undefined) this._options.encoding = encoding
        if (mode !== undefined) this._options.mode = mode
        if (autoClose !== undefined) this._options.autoClose = autoClose
        if (emitClose !== undefined) this._options.emitClose = emitClose
        if (start !== undefined) this._options.start = start
        if (end !== undefined) this._options.end = end
        if (highWaterMark !== undefined) this._options.highWaterMark = highWaterMark
        if (fs !== undefined) this._options.fs = fs
    }

    call(string) {
        // the special argument "-" means sys.std{in,out}
        if (string === '-') {
            if (this._flags.includes('r')) {
                return process.stdin
            } else if (this._flags.includes('w')) {
                return process.stdout
            } else {
                let msg = sub('argument "-" with mode %r', this._flags)
                throw new TypeError(msg)
            }
        }

        // all other arguments are used as file names
        let fd
        try {
            fd = fs.openSync(string, this._flags, this._options.mode)
        } catch (e) {
            let args = { filename: string, error: e.message }
            let message = "can't open '%(filename)s': %(error)s"
            throw new ArgumentTypeError(sub(message, args))
        }

        let options = Object.assign({ fd, flags: this._flags }, this._options)
        if (this._flags.includes('r')) {
            return fs.createReadStream(undefined, options)
        } else if (this._flags.includes('w')) {
            return fs.createWriteStream(undefined, options)
        } else {
            let msg = sub('argument "%s" with mode %r', string, this._flags)
            throw new TypeError(msg)
        }
    }

    [util.inspect.custom]() {
        let args = [ this._flags ]
        let kwargs = Object.entries(this._options).map(([ k, v ]) => {
            if (k === 'mode') v = { value: v, [util.inspect.custom]() { return '0o' + this.value.toString(8) } }
            return [ k, v ]
        })
        let args_str = []
                .concat(args.filter(arg => arg !== -1).map(repr))
                .concat(kwargs.filter(([/*kw*/, arg]) => arg !== undefined)
                    .map(([kw, arg]) => sub('%s=%r', kw, arg)))
                .join(', ')
        return sub('%s(%s)', this.constructor.name, args_str)
    }

    toString() {
        return this[util.inspect.custom]()
    }
})

// ===========================
// Optional and Positional Parsing
// ===========================
const Namespace = _callable(class Namespace extends _AttributeHolder() {
    /*
     *  Simple object for storing attributes.
     *
     *  Implements equality by attribute names and values, and provides a simple
     *  string representation.
     */

    constructor(options = {}) {
        super()
        Object.assign(this, options)
    }
})

// unset string tag to mimic plain object
Namespace.prototype[Symbol.toStringTag] = undefined


const _ActionsContainer = _camelcase_alias(_callable(class _ActionsContainer {

    constructor() {
        let [
            description,
            prefix_chars,
            argument_default,
            conflict_handler
        ] = _parse_opts(arguments, {
            description: no_default,
            prefix_chars: no_default,
            argument_default: no_default,
            conflict_handler: no_default
        })

        this.description = description
        this.argument_default = argument_default
        this.prefix_chars = prefix_chars
        this.conflict_handler = conflict_handler

        // set up registries
        this._registries = {}

        // register actions
        this.register('action', undefined, _StoreAction)
        this.register('action', 'store', _StoreAction)
        this.register('action', 'store_const', _StoreConstAction)
        this.register('action', 'store_true', _StoreTrueAction)
        this.register('action', 'store_false', _StoreFalseAction)
        this.register('action', 'append', _AppendAction)
        this.register('action', 'append_const', _AppendConstAction)
        this.register('action', 'count', _CountAction)
        this.register('action', 'help', _HelpAction)
        this.register('action', 'version', _VersionAction)
        this.register('action', 'parsers', _SubParsersAction)
        this.register('action', 'extend', _ExtendAction)
        // LEGACY (v1 compatibility): camelcase variants
        ;[ 'storeConst', 'storeTrue', 'storeFalse', 'appendConst' ].forEach(old_name => {
            let new_name = _to_new_name(old_name)
            this.register('action', old_name, util.deprecate(this._registry_get('action', new_name),
                sub('{action: "%s"} is renamed to {action: "%s"}', old_name, new_name)))
        })
        // end

        // raise an exception if the conflict handler is invalid
        this._get_handler()

        // action storage
        this._actions = []
        this._option_string_actions = {}

        // groups
        this._action_groups = []
        this._mutually_exclusive_groups = []

        // defaults storage
        this._defaults = {}

        // determines whether an "option" looks like a negative number
        this._negative_number_matcher = /^-\d+$|^-\d*\.\d+$/

        // whether or not there are any optionals that look like negative
        // numbers -- uses a list so it can be shared and edited
        this._has_negative_number_optionals = []
    }

    // ====================
    // Registration methods
    // ====================
    register(registry_name, value, object) {
        let registry = setdefault(this._registries, registry_name, {})
        registry[value] = object
    }

    _registry_get(registry_name, value, default_value = undefined) {
        return getattr(this._registries[registry_name], value, default_value)
    }

    // ==================================
    // Namespace default accessor methods
    // ==================================
    set_defaults(kwargs) {
        Object.assign(this._defaults, kwargs)

        // if these defaults match any existing arguments, replace
        // the previous default on the object with the new one
        for (let action of this._actions) {
            if (action.dest in kwargs) {
                action.default = kwargs[action.dest]
            }
        }
    }

    get_default(dest) {
        for (let action of this._actions) {
            if (action.dest === dest && action.default !== undefined) {
                return action.default
            }
        }
        return this._defaults[dest]
    }


    // =======================
    // Adding argument actions
    // =======================
    add_argument() {
        /*
         *  add_argument(dest, ..., name=value, ...)
         *  add_argument(option_string, option_string, ..., name=value, ...)
         */
        let [
            args,
            kwargs
        ] = _parse_opts(arguments, {
            '*args': no_default,
            '**kwargs': no_default
        })
        // LEGACY (v1 compatibility), old-style add_argument([ args ], { options })
        if (args.length === 1 && Array.isArray(args[0])) {
            args = args[0]
            deprecate('argument-array',
                sub('use add_argument(%(args)s, {...}) instead of add_argument([ %(args)s ], { ... })', {
                    args: args.map(repr).join(', ')
                }))
        }
        // end

        // if no positional args are supplied or only one is supplied and
        // it doesn't look like an option string, parse a positional
        // argument
        let chars = this.prefix_chars
        if (!args.length || args.length === 1 && !chars.includes(args[0][0])) {
            if (args.length && 'dest' in kwargs) {
                throw new TypeError('dest supplied twice for positional argument')
            }
            kwargs = this._get_positional_kwargs(...args, kwargs)

        // otherwise, we're adding an optional argument
        } else {
            kwargs = this._get_optional_kwargs(...args, kwargs)
        }

        // if no default was supplied, use the parser-level default
        if (!('default' in kwargs)) {
            let dest = kwargs.dest
            if (dest in this._defaults) {
                kwargs.default = this._defaults[dest]
            } else if (this.argument_default !== undefined) {
                kwargs.default = this.argument_default
            }
        }

        // create the action object, and add it to the parser
        let action_class = this._pop_action_class(kwargs)
        if (typeof action_class !== 'function') {
            throw new TypeError(sub('unknown action "%s"', action_class))
        }
        // eslint-disable-next-line new-cap
        let action = new action_class(kwargs)

        // raise an error if the action type is not callable
        let type_func = this._registry_get('type', action.type, action.type)
        if (typeof type_func !== 'function') {
            throw new TypeError(sub('%r is not callable', type_func))
        }

        if (type_func === FileType) {
            throw new TypeError(sub('%r is a FileType class object, instance of it' +
                                    ' must be passed', type_func))
        }

        // raise an error if the metavar does not match the type
        if ('_get_formatter' in this) {
            try {
                this._get_formatter()._format_args(action, undefined)
            } catch (err) {
                // check for 'invalid nargs value' is an artifact of TypeError and ValueError in js being the same
                if (err instanceof TypeError && err.message !== 'invalid nargs value') {
                    throw new TypeError('length of metavar tuple does not match nargs')
                } else {
                    throw err
                }
            }
        }

        return this._add_action(action)
    }

    add_argument_group() {
        let group = _ArgumentGroup(this, ...arguments)
        this._action_groups.push(group)
        return group
    }

    add_mutually_exclusive_group() {
        // eslint-disable-next-line no-use-before-define
        let group = _MutuallyExclusiveGroup(this, ...arguments)
        this._mutually_exclusive_groups.push(group)
        return group
    }

    _add_action(action) {
        // resolve any conflicts
        this._check_conflict(action)

        // add to actions list
        this._actions.push(action)
        action.container = this

        // index the action by any option strings it has
        for (let option_string of action.option_strings) {
            this._option_string_actions[option_string] = action
        }

        // set the flag if any option strings look like negative numbers
        for (let option_string of action.option_strings) {
            if (this._negative_number_matcher.test(option_string)) {
                if (!this._has_negative_number_optionals.length) {
                    this._has_negative_number_optionals.push(true)
                }
            }
        }

        // return the created action
        return action
    }

    _remove_action(action) {
        _array_remove(this._actions, action)
    }

    _add_container_actions(container) {
        // collect groups by titles
        let title_group_map = {}
        for (let group of this._action_groups) {
            if (group.title in title_group_map) {
                let msg = 'cannot merge actions - two groups are named %r'
                throw new TypeError(sub(msg, group.title))
            }
            title_group_map[group.title] = group
        }

        // map each action to its group
        let group_map = new Map()
        for (let group of container._action_groups) {

            // if a group with the title exists, use that, otherwise
            // create a new group matching the container's group
            if (!(group.title in title_group_map)) {
                title_group_map[group.title] = this.add_argument_group({
                    title: group.title,
                    description: group.description,
                    conflict_handler: group.conflict_handler
                })
            }

            // map the actions to their new group
            for (let action of group._group_actions) {
                group_map.set(action, title_group_map[group.title])
            }
        }

        // add container's mutually exclusive groups
        // NOTE: if add_mutually_exclusive_group ever gains title= and
        // description= then this code will need to be expanded as above
        for (let group of container._mutually_exclusive_groups) {
            let mutex_group = this.add_mutually_exclusive_group({
                required: group.required
            })

            // map the actions to their new mutex group
            for (let action of group._group_actions) {
                group_map.set(action, mutex_group)
            }
        }

        // add all actions to this container or their group
        for (let action of container._actions) {
            group_map.get(action)._add_action(action)
        }
    }

    _get_positional_kwargs() {
        let [
            dest,
            kwargs
        ] = _parse_opts(arguments, {
            dest: no_default,
            '**kwargs': no_default
        })

        // make sure required is not specified
        if ('required' in kwargs) {
            let msg = "'required' is an invalid argument for positionals"
            throw new TypeError(msg)
        }

        // mark positional arguments as required if at least one is
        // always required
        if (![OPTIONAL, ZERO_OR_MORE].includes(kwargs.nargs)) {
            kwargs.required = true
        }
        if (kwargs.nargs === ZERO_OR_MORE && !('default' in kwargs)) {
            kwargs.required = true
        }

        // return the keyword arguments with no option strings
        return Object.assign(kwargs, { dest, option_strings: [] })
    }

    _get_optional_kwargs() {
        let [
            args,
            kwargs
        ] = _parse_opts(arguments, {
            '*args': no_default,
            '**kwargs': no_default
        })

        // determine short and long option strings
        let option_strings = []
        let long_option_strings = []
        let option_string
        for (option_string of args) {
            // error on strings that don't start with an appropriate prefix
            if (!this.prefix_chars.includes(option_string[0])) {
                let args = {option: option_string,
                            prefix_chars: this.prefix_chars}
                let msg = 'invalid option string %(option)r: ' +
                          'must start with a character %(prefix_chars)r'
                throw new TypeError(sub(msg, args))
            }

            // strings starting with two prefix characters are long options
            option_strings.push(option_string)
            if (option_string.length > 1 && this.prefix_chars.includes(option_string[1])) {
                long_option_strings.push(option_string)
            }
        }

        // infer destination, '--foo-bar' -> 'foo_bar' and '-x' -> 'x'
        let dest = kwargs.dest
        delete kwargs.dest
        if (dest === undefined) {
            let dest_option_string
            if (long_option_strings.length) {
                dest_option_string = long_option_strings[0]
            } else {
                dest_option_string = option_strings[0]
            }
            dest = _string_lstrip(dest_option_string, this.prefix_chars)
            if (!dest) {
                let msg = 'dest= is required for options like %r'
                throw new TypeError(sub(msg, option_string))
            }
            dest = dest.replace(/-/g, '_')
        }

        // return the updated keyword arguments
        return Object.assign(kwargs, { dest, option_strings })
    }

    _pop_action_class(kwargs, default_value = undefined) {
        let action = getattr(kwargs, 'action', default_value)
        delete kwargs.action
        return this._registry_get('action', action, action)
    }

    _get_handler() {
        // determine function from conflict handler string
        let handler_func_name = sub('_handle_conflict_%s', this.conflict_handler)
        if (typeof this[handler_func_name] === 'function') {
            return this[handler_func_name]
        } else {
            let msg = 'invalid conflict_resolution value: %r'
            throw new TypeError(sub(msg, this.conflict_handler))
        }
    }

    _check_conflict(action) {

        // find all options that conflict with this option
        let confl_optionals = []
        for (let option_string of action.option_strings) {
            if (hasattr(this._option_string_actions, option_string)) {
                let confl_optional = this._option_string_actions[option_string]
                confl_optionals.push([ option_string, confl_optional ])
            }
        }

        // resolve any conflicts
        if (confl_optionals.length) {
            let conflict_handler = this._get_handler()
            conflict_handler.call(this, action, confl_optionals)
        }
    }

    _handle_conflict_error(action, conflicting_actions) {
        let message = conflicting_actions.length === 1 ?
            'conflicting option string: %s' :
            'conflicting option strings: %s'
        let conflict_string = conflicting_actions.map(([ option_string/*, action*/ ]) => option_string).join(', ')
        throw new ArgumentError(action, sub(message, conflict_string))
    }

    _handle_conflict_resolve(action, conflicting_actions) {

        // remove all conflicting options
        for (let [ option_string, action ] of conflicting_actions) {

            // remove the conflicting option
            _array_remove(action.option_strings, option_string)
            delete this._option_string_actions[option_string]

            // if the option now has no option string, remove it from the
            // container holding it
            if (!action.option_strings.length) {
                action.container._remove_action(action)
            }
        }
    }
}))


const _ArgumentGroup = _callable(class _ArgumentGroup extends _ActionsContainer {

    constructor() {
        let [
            container,
            title,
            description,
            kwargs
        ] = _parse_opts(arguments, {
            container: no_default,
            title: undefined,
            description: undefined,
            '**kwargs': no_default
        })

        // add any missing keyword arguments by checking the container
        setdefault(kwargs, 'conflict_handler', container.conflict_handler)
        setdefault(kwargs, 'prefix_chars', container.prefix_chars)
        setdefault(kwargs, 'argument_default', container.argument_default)
        super(Object.assign({ description }, kwargs))

        // group attributes
        this.title = title
        this._group_actions = []

        // share most attributes with the container
        this._registries = container._registries
        this._actions = container._actions
        this._option_string_actions = container._option_string_actions
        this._defaults = container._defaults
        this._has_negative_number_optionals =
            container._has_negative_number_optionals
        this._mutually_exclusive_groups = container._mutually_exclusive_groups
    }

    _add_action(action) {
        action = super._add_action(action)
        this._group_actions.push(action)
        return action
    }

    _remove_action(action) {
        super._remove_action(action)
        _array_remove(this._group_actions, action)
    }
})


const _MutuallyExclusiveGroup = _callable(class _MutuallyExclusiveGroup extends _ArgumentGroup {

    constructor() {
        let [
            container,
            required
        ] = _parse_opts(arguments, {
            container: no_default,
            required: false
        })

        super(container)
        this.required = required
        this._container = container
    }

    _add_action(action) {
        if (action.required) {
            let msg = 'mutually exclusive arguments must be optional'
            throw new TypeError(msg)
        }
        action = this._container._add_action(action)
        this._group_actions.push(action)
        return action
    }

    _remove_action(action) {
        this._container._remove_action(action)
        _array_remove(this._group_actions, action)
    }
})


const ArgumentParser = _camelcase_alias(_callable(class ArgumentParser extends _AttributeHolder(_ActionsContainer) {
    /*
     *  Object for parsing command line strings into Python objects.
     *
     *  Keyword Arguments:
     *      - prog -- The name of the program (default: sys.argv[0])
     *      - usage -- A usage message (default: auto-generated from arguments)
     *      - description -- A description of what the program does
     *      - epilog -- Text following the argument descriptions
     *      - parents -- Parsers whose arguments should be copied into this one
     *      - formatter_class -- HelpFormatter class for printing help messages
     *      - prefix_chars -- Characters that prefix optional arguments
     *      - fromfile_prefix_chars -- Characters that prefix files containing
     *          additional arguments
     *      - argument_default -- The default value for all arguments
     *      - conflict_handler -- String indicating how to handle conflicts
     *      - add_help -- Add a -h/-help option
     *      - allow_abbrev -- Allow long options to be abbreviated unambiguously
     *      - exit_on_error -- Determines whether or not ArgumentParser exits with
     *          error info when an error occurs
     */

    constructor() {
        let [
            prog,
            usage,
            description,
            epilog,
            parents,
            formatter_class,
            prefix_chars,
            fromfile_prefix_chars,
            argument_default,
            conflict_handler,
            add_help,
            allow_abbrev,
            exit_on_error,
            debug, // LEGACY (v1 compatibility), debug mode
            version // LEGACY (v1 compatibility), version
        ] = _parse_opts(arguments, {
            prog: undefined,
            usage: undefined,
            description: undefined,
            epilog: undefined,
            parents: [],
            formatter_class: HelpFormatter,
            prefix_chars: '-',
            fromfile_prefix_chars: undefined,
            argument_default: undefined,
            conflict_handler: 'error',
            add_help: true,
            allow_abbrev: true,
            exit_on_error: true,
            debug: undefined, // LEGACY (v1 compatibility), debug mode
            version: undefined // LEGACY (v1 compatibility), version
        })

        // LEGACY (v1 compatibility)
        if (debug !== undefined) {
            deprecate('debug',
                'The "debug" argument to ArgumentParser is deprecated. Please ' +
                'override ArgumentParser.exit function instead.'
            )
        }

        if (version !== undefined) {
            deprecate('version',
                'The "version" argument to ArgumentParser is deprecated. Please use ' +
                "add_argument(..., { action: 'version', version: 'N', ... }) instead."
            )
        }
        // end

        super({
            description,
            prefix_chars,
            argument_default,
            conflict_handler
        })

        // default setting for prog
        if (prog === undefined) {
            prog = path.basename(get_argv()[0] || '')
        }

        this.prog = prog
        this.usage = usage
        this.epilog = epilog
        this.formatter_class = formatter_class
        this.fromfile_prefix_chars = fromfile_prefix_chars
        this.add_help = add_help
        this.allow_abbrev = allow_abbrev
        this.exit_on_error = exit_on_error
        // LEGACY (v1 compatibility), debug mode
        this.debug = debug
        // end

        this._positionals = this.add_argument_group('positional arguments')
        this._optionals = this.add_argument_group('optional arguments')
        this._subparsers = undefined

        // register types
        function identity(string) {
            return string
        }
        this.register('type', undefined, identity)
        this.register('type', null, identity)
        this.register('type', 'auto', identity)
        this.register('type', 'int', function (x) {
            let result = Number(x)
            if (!Number.isInteger(result)) {
                throw new TypeError(sub('could not convert string to int: %r', x))
            }
            return result
        })
        this.register('type', 'float', function (x) {
            let result = Number(x)
            if (isNaN(result)) {
                throw new TypeError(sub('could not convert string to float: %r', x))
            }
            return result
        })
        this.register('type', 'str', String)
        // LEGACY (v1 compatibility): custom types
        this.register('type', 'string',
            util.deprecate(String, 'use {type:"str"} or {type:String} instead of {type:"string"}'))
        // end

        // add help argument if necessary
        // (using explicit default to override global argument_default)
        let default_prefix = prefix_chars.includes('-') ? '-' : prefix_chars[0]
        if (this.add_help) {
            this.add_argument(
                default_prefix + 'h',
                default_prefix.repeat(2) + 'help',
                {
                    action: 'help',
                    default: SUPPRESS,
                    help: 'show this help message and exit'
                }
            )
        }
        // LEGACY (v1 compatibility), version
        if (version) {
            this.add_argument(
                default_prefix + 'v',
                default_prefix.repeat(2) + 'version',
                {
                    action: 'version',
                    default: SUPPRESS,
                    version: this.version,
                    help: "show program's version number and exit"
                }
            )
        }
        // end

        // add parent arguments and defaults
        for (let parent of parents) {
            this._add_container_actions(parent)
            Object.assign(this._defaults, parent._defaults)
        }
    }

    // =======================
    // Pretty __repr__ methods
    // =======================
    _get_kwargs() {
        let names = [
            'prog',
            'usage',
            'description',
            'formatter_class',
            'conflict_handler',
            'add_help'
        ]
        return names.map(name => [ name, getattr(this, name) ])
    }

    // ==================================
    // Optional/Positional adding methods
    // ==================================
    add_subparsers() {
        let [
            kwargs
        ] = _parse_opts(arguments, {
            '**kwargs': no_default
        })

        if (this._subparsers !== undefined) {
            this.error('cannot have multiple subparser arguments')
        }

        // add the parser class to the arguments if it's not present
        setdefault(kwargs, 'parser_class', this.constructor)

        if ('title' in kwargs || 'description' in kwargs) {
            let title = getattr(kwargs, 'title', 'subcommands')
            let description = getattr(kwargs, 'description', undefined)
            delete kwargs.title
            delete kwargs.description
            this._subparsers = this.add_argument_group(title, description)
        } else {
            this._subparsers = this._positionals
        }

        // prog defaults to the usage message of this parser, skipping
        // optional arguments and with no "usage:" prefix
        if (kwargs.prog === undefined) {
            let formatter = this._get_formatter()
            let positionals = this._get_positional_actions()
            let groups = this._mutually_exclusive_groups
            formatter.add_usage(this.usage, positionals, groups, '')
            kwargs.prog = formatter.format_help().trim()
        }

        // create the parsers action and add it to the positionals list
        let parsers_class = this._pop_action_class(kwargs, 'parsers')
        // eslint-disable-next-line new-cap
        let action = new parsers_class(Object.assign({ option_strings: [] }, kwargs))
        this._subparsers._add_action(action)

        // return the created parsers action
        return action
    }

    _add_action(action) {
        if (action.option_strings.length) {
            this._optionals._add_action(action)
        } else {
            this._positionals._add_action(action)
        }
        return action
    }

    _get_optional_actions() {
        return this._actions.filter(action => action.option_strings.length)
    }

    _get_positional_actions() {
        return this._actions.filter(action => !action.option_strings.length)
    }

    // =====================================
    // Command line argument parsing methods
    // =====================================
    parse_args(args = undefined, namespace = undefined) {
        let argv
        [ args, argv ] = this.parse_known_args(args, namespace)
        if (argv && argv.length > 0) {
            let msg = 'unrecognized arguments: %s'
            this.error(sub(msg, argv.join(' ')))
        }
        return args
    }

    parse_known_args(args = undefined, namespace = undefined) {
        if (args === undefined) {
            args = get_argv().slice(1)
        }

        // default Namespace built from parser defaults
        if (namespace === undefined) {
            namespace = new Namespace()
        }

        // add any action defaults that aren't present
        for (let action of this._actions) {
            if (action.dest !== SUPPRESS) {
                if (!hasattr(namespace, action.dest)) {
                    if (action.default !== SUPPRESS) {
                        setattr(namespace, action.dest, action.default)
                    }
                }
            }
        }

        // add any parser defaults that aren't present
        for (let dest of Object.keys(this._defaults)) {
            if (!hasattr(namespace, dest)) {
                setattr(namespace, dest, this._defaults[dest])
            }
        }

        // parse the arguments and exit if there are any errors
        if (this.exit_on_error) {
            try {
                [ namespace, args ] = this._parse_known_args(args, namespace)
            } catch (err) {
                if (err instanceof ArgumentError) {
                    this.error(err.message)
                } else {
                    throw err
                }
            }
        } else {
            [ namespace, args ] = this._parse_known_args(args, namespace)
        }

        if (hasattr(namespace, _UNRECOGNIZED_ARGS_ATTR)) {
            args = args.concat(getattr(namespace, _UNRECOGNIZED_ARGS_ATTR))
            delattr(namespace, _UNRECOGNIZED_ARGS_ATTR)
        }

        return [ namespace, args ]
    }

    _parse_known_args(arg_strings, namespace) {
        // replace arg strings that are file references
        if (this.fromfile_prefix_chars !== undefined) {
            arg_strings = this._read_args_from_files(arg_strings)
        }

        // map all mutually exclusive arguments to the other arguments
        // they can't occur with
        let action_conflicts = new Map()
        for (let mutex_group of this._mutually_exclusive_groups) {
            let group_actions = mutex_group._group_actions
            for (let [ i, mutex_action ] of Object.entries(mutex_group._group_actions)) {
                let conflicts = action_conflicts.get(mutex_action) || []
                conflicts = conflicts.concat(group_actions.slice(0, +i))
                conflicts = conflicts.concat(group_actions.slice(+i + 1))
                action_conflicts.set(mutex_action, conflicts)
            }
        }

        // find all option indices, and determine the arg_string_pattern
        // which has an 'O' if there is an option at an index,
        // an 'A' if there is an argument, or a '-' if there is a '--'
        let option_string_indices = {}
        let arg_string_pattern_parts = []
        let arg_strings_iter = Object.entries(arg_strings)[Symbol.iterator]()
        for (let [ i, arg_string ] of arg_strings_iter) {

            // all args after -- are non-options
            if (arg_string === '--') {
                arg_string_pattern_parts.push('-')
                for ([ i, arg_string ] of arg_strings_iter) {
                    arg_string_pattern_parts.push('A')
                }

            // otherwise, add the arg to the arg strings
            // and note the index if it was an option
            } else {
                let option_tuple = this._parse_optional(arg_string)
                let pattern
                if (option_tuple === undefined) {
                    pattern = 'A'
                } else {
                    option_string_indices[i] = option_tuple
                    pattern = 'O'
                }
                arg_string_pattern_parts.push(pattern)
            }
        }

        // join the pieces together to form the pattern
        let arg_strings_pattern = arg_string_pattern_parts.join('')

        // converts arg strings to the appropriate and then takes the action
        let seen_actions = new Set()
        let seen_non_default_actions = new Set()
        let extras

        let take_action = (action, argument_strings, option_string = undefined) => {
            seen_actions.add(action)
            let argument_values = this._get_values(action, argument_strings)

            // error if this argument is not allowed with other previously
            // seen arguments, assuming that actions that use the default
            // value don't really count as "present"
            if (argument_values !== action.default) {
                seen_non_default_actions.add(action)
                for (let conflict_action of action_conflicts.get(action) || []) {
                    if (seen_non_default_actions.has(conflict_action)) {
                        let msg = 'not allowed with argument %s'
                        let action_name = _get_action_name(conflict_action)
                        throw new ArgumentError(action, sub(msg, action_name))
                    }
                }
            }

            // take the action if we didn't receive a SUPPRESS value
            // (e.g. from a default)
            if (argument_values !== SUPPRESS) {
                action(this, namespace, argument_values, option_string)
            }
        }

        // function to convert arg_strings into an optional action
        let consume_optional = start_index => {

            // get the optional identified at this index
            let option_tuple = option_string_indices[start_index]
            let [ action, option_string, explicit_arg ] = option_tuple

            // identify additional optionals in the same arg string
            // (e.g. -xyz is the same as -x -y -z if no args are required)
            let action_tuples = []
            let stop
            for (;;) {

                // if we found no optional action, skip it
                if (action === undefined) {
                    extras.push(arg_strings[start_index])
                    return start_index + 1
                }

                // if there is an explicit argument, try to match the
                // optional's string arguments to only this
                if (explicit_arg !== undefined) {
                    let arg_count = this._match_argument(action, 'A')

                    // if the action is a single-dash option and takes no
                    // arguments, try to parse more single-dash options out
                    // of the tail of the option string
                    let chars = this.prefix_chars
                    if (arg_count === 0 && !chars.includes(option_string[1])) {
                        action_tuples.push([ action, [], option_string ])
                        let char = option_string[0]
                        option_string = char + explicit_arg[0]
                        let new_explicit_arg = explicit_arg.slice(1) || undefined
                        let optionals_map = this._option_string_actions
                        if (hasattr(optionals_map, option_string)) {
                            action = optionals_map[option_string]
                            explicit_arg = new_explicit_arg
                        } else {
                            let msg = 'ignored explicit argument %r'
                            throw new ArgumentError(action, sub(msg, explicit_arg))
                        }

                    // if the action expect exactly one argument, we've
                    // successfully matched the option; exit the loop
                    } else if (arg_count === 1) {
                        stop = start_index + 1
                        let args = [ explicit_arg ]
                        action_tuples.push([ action, args, option_string ])
                        break

                    // error if a double-dash option did not use the
                    // explicit argument
                    } else {
                        let msg = 'ignored explicit argument %r'
                        throw new ArgumentError(action, sub(msg, explicit_arg))
                    }

                // if there is no explicit argument, try to match the
                // optional's string arguments with the following strings
                // if successful, exit the loop
                } else {
                    let start = start_index + 1
                    let selected_patterns = arg_strings_pattern.slice(start)
                    let arg_count = this._match_argument(action, selected_patterns)
                    stop = start + arg_count
                    let args = arg_strings.slice(start, stop)
                    action_tuples.push([ action, args, option_string ])
                    break
                }
            }

            // add the Optional to the list and return the index at which
            // the Optional's string args stopped
            assert(action_tuples.length)
            for (let [ action, args, option_string ] of action_tuples) {
                take_action(action, args, option_string)
            }
            return stop
        }

        // the list of Positionals left to be parsed; this is modified
        // by consume_positionals()
        let positionals = this._get_positional_actions()

        // function to convert arg_strings into positional actions
        let consume_positionals = start_index => {
            // match as many Positionals as possible
            let selected_pattern = arg_strings_pattern.slice(start_index)
            let arg_counts = this._match_arguments_partial(positionals, selected_pattern)

            // slice off the appropriate arg strings for each Positional
            // and add the Positional and its args to the list
            for (let i = 0; i < positionals.length && i < arg_counts.length; i++) {
                let action = positionals[i]
                let arg_count = arg_counts[i]
                let args = arg_strings.slice(start_index, start_index + arg_count)
                start_index += arg_count
                take_action(action, args)
            }

            // slice off the Positionals that we just parsed and return the
            // index at which the Positionals' string args stopped
            positionals = positionals.slice(arg_counts.length)
            return start_index
        }

        // consume Positionals and Optionals alternately, until we have
        // passed the last option string
        extras = []
        let start_index = 0
        let max_option_string_index = Math.max(-1, ...Object.keys(option_string_indices).map(Number))
        while (start_index <= max_option_string_index) {

            // consume any Positionals preceding the next option
            let next_option_string_index = Math.min(
                // eslint-disable-next-line no-loop-func
                ...Object.keys(option_string_indices).map(Number).filter(index => index >= start_index)
            )
            if (start_index !== next_option_string_index) {
                let positionals_end_index = consume_positionals(start_index)

                // only try to parse the next optional if we didn't consume
                // the option string during the positionals parsing
                if (positionals_end_index > start_index) {
                    start_index = positionals_end_index
                    continue
                } else {
                    start_index = positionals_end_index
                }
            }

            // if we consumed all the positionals we could and we're not
            // at the index of an option string, there were extra arguments
            if (!(start_index in option_string_indices)) {
                let strings = arg_strings.slice(start_index, next_option_string_index)
                extras = extras.concat(strings)
                start_index = next_option_string_index
            }

            // consume the next optional and any arguments for it
            start_index = consume_optional(start_index)
        }

        // consume any positionals following the last Optional
        let stop_index = consume_positionals(start_index)

        // if we didn't consume all the argument strings, there were extras
        extras = extras.concat(arg_strings.slice(stop_index))

        // make sure all required actions were present and also convert
        // action defaults which were not given as arguments
        let required_actions = []
        for (let action of this._actions) {
            if (!seen_actions.has(action)) {
                if (action.required) {
                    required_actions.push(_get_action_name(action))
                } else {
                    // Convert action default now instead of doing it before
                    // parsing arguments to avoid calling convert functions
                    // twice (which may fail) if the argument was given, but
                    // only if it was defined already in the namespace
                    if (action.default !== undefined &&
                        typeof action.default === 'string' &&
                        hasattr(namespace, action.dest) &&
                        action.default === getattr(namespace, action.dest)) {
                        setattr(namespace, action.dest,
                                this._get_value(action, action.default))
                    }
                }
            }
        }

        if (required_actions.length) {
            this.error(sub('the following arguments are required: %s',
                       required_actions.join(', ')))
        }

        // make sure all required groups had one option present
        for (let group of this._mutually_exclusive_groups) {
            if (group.required) {
                let no_actions_used = true
                for (let action of group._group_actions) {
                    if (seen_non_default_actions.has(action)) {
                        no_actions_used = false
                        break
                    }
                }

                // if no actions were used, report the error
                if (no_actions_used) {
                    let names = group._group_actions
                        .filter(action => action.help !== SUPPRESS)
                        .map(action => _get_action_name(action))
                    let msg = 'one of the arguments %s is required'
                    this.error(sub(msg, names.join(' ')))
                }
            }
        }

        // return the updated namespace and the extra arguments
        return [ namespace, extras ]
    }

    _read_args_from_files(arg_strings) {
        // expand arguments referencing files
        let new_arg_strings = []
        for (let arg_string of arg_strings) {

            // for regular arguments, just add them back into the list
            if (!arg_string || !this.fromfile_prefix_chars.includes(arg_string[0])) {
                new_arg_strings.push(arg_string)

            // replace arguments referencing files with the file content
            } else {
                try {
                    let args_file = fs.readFileSync(arg_string.slice(1), 'utf8')
                    let arg_strings = []
                    for (let arg_line of splitlines(args_file)) {
                        for (let arg of this.convert_arg_line_to_args(arg_line)) {
                            arg_strings.push(arg)
                        }
                    }
                    arg_strings = this._read_args_from_files(arg_strings)
                    new_arg_strings = new_arg_strings.concat(arg_strings)
                } catch (err) {
                    this.error(err.message)
                }
            }
        }

        // return the modified argument list
        return new_arg_strings
    }

    convert_arg_line_to_args(arg_line) {
        return [arg_line]
    }

    _match_argument(action, arg_strings_pattern) {
        // match the pattern for this action to the arg strings
        let nargs_pattern = this._get_nargs_pattern(action)
        let match = arg_strings_pattern.match(new RegExp('^' + nargs_pattern))

        // raise an exception if we weren't able to find a match
        if (match === null) {
            let nargs_errors = {
                undefined: 'expected one argument',
                [OPTIONAL]: 'expected at most one argument',
                [ONE_OR_MORE]: 'expected at least one argument'
            }
            let msg = nargs_errors[action.nargs]
            if (msg === undefined) {
                msg = sub(action.nargs === 1 ? 'expected %s argument' : 'expected %s arguments', action.nargs)
            }
            throw new ArgumentError(action, msg)
        }

        // return the number of arguments matched
        return match[1].length
    }

    _match_arguments_partial(actions, arg_strings_pattern) {
        // progressively shorten the actions list by slicing off the
        // final actions until we find a match
        let result = []
        for (let i of range(actions.length, 0, -1)) {
            let actions_slice = actions.slice(0, i)
            let pattern = actions_slice.map(action => this._get_nargs_pattern(action)).join('')
            let match = arg_strings_pattern.match(new RegExp('^' + pattern))
            if (match !== null) {
                result = result.concat(match.slice(1).map(string => string.length))
                break
            }
        }

        // return the list of arg string counts
        return result
    }

    _parse_optional(arg_string) {
        // if it's an empty string, it was meant to be a positional
        if (!arg_string) {
            return undefined
        }

        // if it doesn't start with a prefix, it was meant to be positional
        if (!this.prefix_chars.includes(arg_string[0])) {
            return undefined
        }

        // if the option string is present in the parser, return the action
        if (arg_string in this._option_string_actions) {
            let action = this._option_string_actions[arg_string]
            return [ action, arg_string, undefined ]
        }

        // if it's just a single character, it was meant to be positional
        if (arg_string.length === 1) {
            return undefined
        }

        // if the option string before the "=" is present, return the action
        if (arg_string.includes('=')) {
            let [ option_string, explicit_arg ] = _string_split(arg_string, '=', 1)
            if (option_string in this._option_string_actions) {
                let action = this._option_string_actions[option_string]
                return [ action, option_string, explicit_arg ]
            }
        }

        // search through all possible prefixes of the option string
        // and all actions in the parser for possible interpretations
        let option_tuples = this._get_option_tuples(arg_string)

        // if multiple actions match, the option string was ambiguous
        if (option_tuples.length > 1) {
            let options = option_tuples.map(([ /*action*/, option_string/*, explicit_arg*/ ]) => option_string).join(', ')
            let args = {option: arg_string, matches: options}
            let msg = 'ambiguous option: %(option)s could match %(matches)s'
            this.error(sub(msg, args))

        // if exactly one action matched, this segmentation is good,
        // so return the parsed action
        } else if (option_tuples.length === 1) {
            let [ option_tuple ] = option_tuples
            return option_tuple
        }

        // if it was not found as an option, but it looks like a negative
        // number, it was meant to be positional
        // unless there are negative-number-like options
        if (this._negative_number_matcher.test(arg_string)) {
            if (!this._has_negative_number_optionals.length) {
                return undefined
            }
        }

        // if it contains a space, it was meant to be a positional
        if (arg_string.includes(' ')) {
            return undefined
        }

        // it was meant to be an optional but there is no such option
        // in this parser (though it might be a valid option in a subparser)
        return [ undefined, arg_string, undefined ]
    }

    _get_option_tuples(option_string) {
        let result = []

        // option strings starting with two prefix characters are only
        // split at the '='
        let chars = this.prefix_chars
        if (chars.includes(option_string[0]) && chars.includes(option_string[1])) {
            if (this.allow_abbrev) {
                let option_prefix, explicit_arg
                if (option_string.includes('=')) {
                    [ option_prefix, explicit_arg ] = _string_split(option_string, '=', 1)
                } else {
                    option_prefix = option_string
                    explicit_arg = undefined
                }
                for (let option_string of Object.keys(this._option_string_actions)) {
                    if (option_string.startsWith(option_prefix)) {
                        let action = this._option_string_actions[option_string]
                        let tup = [ action, option_string, explicit_arg ]
                        result.push(tup)
                    }
                }
            }

        // single character options can be concatenated with their arguments
        // but multiple character options always have to have their argument
        // separate
        } else if (chars.includes(option_string[0]) && !chars.includes(option_string[1])) {
            let option_prefix = option_string
            let explicit_arg = undefined
            let short_option_prefix = option_string.slice(0, 2)
            let short_explicit_arg = option_string.slice(2)

            for (let option_string of Object.keys(this._option_string_actions)) {
                if (option_string === short_option_prefix) {
                    let action = this._option_string_actions[option_string]
                    let tup = [ action, option_string, short_explicit_arg ]
                    result.push(tup)
                } else if (option_string.startsWith(option_prefix)) {
                    let action = this._option_string_actions[option_string]
                    let tup = [ action, option_string, explicit_arg ]
                    result.push(tup)
                }
            }

        // shouldn't ever get here
        } else {
            this.error(sub('unexpected option string: %s', option_string))
        }

        // return the collected option tuples
        return result
    }

    _get_nargs_pattern(action) {
        // in all examples below, we have to allow for '--' args
        // which are represented as '-' in the pattern
        let nargs = action.nargs
        let nargs_pattern

        // the default (None) is assumed to be a single argument
        if (nargs === undefined) {
            nargs_pattern = '(-*A-*)'

        // allow zero or one arguments
        } else if (nargs === OPTIONAL) {
            nargs_pattern = '(-*A?-*)'

        // allow zero or more arguments
        } else if (nargs === ZERO_OR_MORE) {
            nargs_pattern = '(-*[A-]*)'

        // allow one or more arguments
        } else if (nargs === ONE_OR_MORE) {
            nargs_pattern = '(-*A[A-]*)'

        // allow any number of options or arguments
        } else if (nargs === REMAINDER) {
            nargs_pattern = '([-AO]*)'

        // allow one argument followed by any number of options or arguments
        } else if (nargs === PARSER) {
            nargs_pattern = '(-*A[-AO]*)'

        // suppress action, like nargs=0
        } else if (nargs === SUPPRESS) {
            nargs_pattern = '(-*-*)'

        // all others should be integers
        } else {
            nargs_pattern = sub('(-*%s-*)', 'A'.repeat(nargs).split('').join('-*'))
        }

        // if this is an optional action, -- is not allowed
        if (action.option_strings.length) {
            nargs_pattern = nargs_pattern.replace(/-\*/g, '')
            nargs_pattern = nargs_pattern.replace(/-/g, '')
        }

        // return the pattern
        return nargs_pattern
    }

    // ========================
    // Alt command line argument parsing, allowing free intermix
    // ========================

    parse_intermixed_args(args = undefined, namespace = undefined) {
        let argv
        [ args, argv ] = this.parse_known_intermixed_args(args, namespace)
        if (argv.length) {
            let msg = 'unrecognized arguments: %s'
            this.error(sub(msg, argv.join(' ')))
        }
        return args
    }

    parse_known_intermixed_args(args = undefined, namespace = undefined) {
        // returns a namespace and list of extras
        //
        // positional can be freely intermixed with optionals.  optionals are
        // first parsed with all positional arguments deactivated.  The 'extras'
        // are then parsed.  If the parser definition is incompatible with the
        // intermixed assumptions (e.g. use of REMAINDER, subparsers) a
        // TypeError is raised.
        //
        // positionals are 'deactivated' by setting nargs and default to
        // SUPPRESS.  This blocks the addition of that positional to the
        // namespace

        let extras
        let positionals = this._get_positional_actions()
        let a = positionals.filter(action => [ PARSER, REMAINDER ].includes(action.nargs))
        if (a.length) {
            throw new TypeError(sub('parse_intermixed_args: positional arg' +
                                    ' with nargs=%s', a[0].nargs))
        }

        for (let group of this._mutually_exclusive_groups) {
            for (let action of group._group_actions) {
                if (positionals.includes(action)) {
                    throw new TypeError('parse_intermixed_args: positional in' +
                                        ' mutuallyExclusiveGroup')
                }
            }
        }

        let save_usage
        try {
            save_usage = this.usage
            let remaining_args
            try {
                if (this.usage === undefined) {
                    // capture the full usage for use in error messages
                    this.usage = this.format_usage().slice(7)
                }
                for (let action of positionals) {
                    // deactivate positionals
                    action.save_nargs = action.nargs
                    // action.nargs = 0
                    action.nargs = SUPPRESS
                    action.save_default = action.default
                    action.default = SUPPRESS
                }
                [ namespace, remaining_args ] = this.parse_known_args(args,
                                                                      namespace)
                for (let action of positionals) {
                    // remove the empty positional values from namespace
                    let attr = getattr(namespace, action.dest)
                    if (Array.isArray(attr) && attr.length === 0) {
                        // eslint-disable-next-line no-console
                        console.warn(sub('Do not expect %s in %s', action.dest, namespace))
                        delattr(namespace, action.dest)
                    }
                }
            } finally {
                // restore nargs and usage before exiting
                for (let action of positionals) {
                    action.nargs = action.save_nargs
                    action.default = action.save_default
                }
            }
            let optionals = this._get_optional_actions()
            try {
                // parse positionals.  optionals aren't normally required, but
                // they could be, so make sure they aren't.
                for (let action of optionals) {
                    action.save_required = action.required
                    action.required = false
                }
                for (let group of this._mutually_exclusive_groups) {
                    group.save_required = group.required
                    group.required = false
                }
                [ namespace, extras ] = this.parse_known_args(remaining_args,
                                                              namespace)
            } finally {
                // restore parser values before exiting
                for (let action of optionals) {
                    action.required = action.save_required
                }
                for (let group of this._mutually_exclusive_groups) {
                    group.required = group.save_required
                }
            }
        } finally {
            this.usage = save_usage
        }
        return [ namespace, extras ]
    }

    // ========================
    // Value conversion methods
    // ========================
    _get_values(action, arg_strings) {
        // for everything but PARSER, REMAINDER args, strip out first '--'
        if (![PARSER, REMAINDER].includes(action.nargs)) {
            try {
                _array_remove(arg_strings, '--')
            } catch (err) {}
        }

        let value
        // optional argument produces a default when not present
        if (!arg_strings.length && action.nargs === OPTIONAL) {
            if (action.option_strings.length) {
                value = action.const
            } else {
                value = action.default
            }
            if (typeof value === 'string') {
                value = this._get_value(action, value)
                this._check_value(action, value)
            }

        // when nargs='*' on a positional, if there were no command-line
        // args, use the default if it is anything other than None
        } else if (!arg_strings.length && action.nargs === ZERO_OR_MORE &&
              !action.option_strings.length) {
            if (action.default !== undefined) {
                value = action.default
            } else {
                value = arg_strings
            }
            this._check_value(action, value)

        // single argument or optional argument produces a single value
        } else if (arg_strings.length === 1 && [undefined, OPTIONAL].includes(action.nargs)) {
            let arg_string = arg_strings[0]
            value = this._get_value(action, arg_string)
            this._check_value(action, value)

        // REMAINDER arguments convert all values, checking none
        } else if (action.nargs === REMAINDER) {
            value = arg_strings.map(v => this._get_value(action, v))

        // PARSER arguments convert all values, but check only the first
        } else if (action.nargs === PARSER) {
            value = arg_strings.map(v => this._get_value(action, v))
            this._check_value(action, value[0])

        // SUPPRESS argument does not put anything in the namespace
        } else if (action.nargs === SUPPRESS) {
            value = SUPPRESS

        // all other types of nargs produce a list
        } else {
            value = arg_strings.map(v => this._get_value(action, v))
            for (let v of value) {
                this._check_value(action, v)
            }
        }

        // return the converted value
        return value
    }

    _get_value(action, arg_string) {
        let type_func = this._registry_get('type', action.type, action.type)
        if (typeof type_func !== 'function') {
            let msg = '%r is not callable'
            throw new ArgumentError(action, sub(msg, type_func))
        }

        // convert the value to the appropriate type
        let result
        try {
            try {
                result = type_func(arg_string)
            } catch (err) {
                // Dear TC39, why would you ever consider making es6 classes not callable?
                // We had one universal interface, [[Call]], which worked for anything
                // (with familiar this-instanceof guard for classes). Now we have two.
                if (err instanceof TypeError &&
                    /Class constructor .* cannot be invoked without 'new'/.test(err.message)) {
                    // eslint-disable-next-line new-cap
                    result = new type_func(arg_string)
                } else {
                    throw err
                }
            }

        } catch (err) {
            // ArgumentTypeErrors indicate errors
            if (err instanceof ArgumentTypeError) {
                //let name = getattr(action.type, 'name', repr(action.type))
                let msg = err.message
                throw new ArgumentError(action, msg)

            // TypeErrors or ValueErrors also indicate errors
            } else if (err instanceof TypeError) {
                let name = getattr(action.type, 'name', repr(action.type))
                let args = {type: name, value: arg_string}
                let msg = 'invalid %(type)s value: %(value)r'
                throw new ArgumentError(action, sub(msg, args))
            } else {
                throw err
            }
        }

        // return the converted value
        return result
    }

    _check_value(action, value) {
        // converted value must be one of the choices (if specified)
        if (action.choices !== undefined && !_choices_to_array(action.choices).includes(value)) {
            let args = {value,
                        choices: _choices_to_array(action.choices).map(repr).join(', ')}
            let msg = 'invalid choice: %(value)r (choose from %(choices)s)'
            throw new ArgumentError(action, sub(msg, args))
        }
    }

    // =======================
    // Help-formatting methods
    // =======================
    format_usage() {
        let formatter = this._get_formatter()
        formatter.add_usage(this.usage, this._actions,
                            this._mutually_exclusive_groups)
        return formatter.format_help()
    }

    format_help() {
        let formatter = this._get_formatter()

        // usage
        formatter.add_usage(this.usage, this._actions,
                            this._mutually_exclusive_groups)

        // description
        formatter.add_text(this.description)

        // positionals, optionals and user-defined groups
        for (let action_group of this._action_groups) {
            formatter.start_section(action_group.title)
            formatter.add_text(action_group.description)
            formatter.add_arguments(action_group._group_actions)
            formatter.end_section()
        }

        // epilog
        formatter.add_text(this.epilog)

        // determine help from format above
        return formatter.format_help()
    }

    _get_formatter() {
        // eslint-disable-next-line new-cap
        return new this.formatter_class({ prog: this.prog })
    }

    // =====================
    // Help-printing methods
    // =====================
    print_usage(file = undefined) {
        if (file === undefined) file = process.stdout
        this._print_message(this.format_usage(), file)
    }

    print_help(file = undefined) {
        if (file === undefined) file = process.stdout
        this._print_message(this.format_help(), file)
    }

    _print_message(message, file = undefined) {
        if (message) {
            if (file === undefined) file = process.stderr
            file.write(message)
        }
    }

    // ===============
    // Exiting methods
    // ===============
    exit(status = 0, message = undefined) {
        if (message) {
            this._print_message(message, process.stderr)
        }
        process.exit(status)
    }

    error(message) {
        /*
         *  error(message: string)
         *
         *  Prints a usage message incorporating the message to stderr and
         *  exits.
         *
         *  If you override this in a subclass, it should not return -- it
         *  should either exit or raise an exception.
         */

        // LEGACY (v1 compatibility), debug mode
        if (this.debug === true) throw new Error(message)
        // end
        this.print_usage(process.stderr)
        let args = {prog: this.prog, message: message}
        this.exit(2, sub('%(prog)s: error: %(message)s\n', args))
    }
}))


module.exports = {
    ArgumentParser,
    ArgumentError,
    ArgumentTypeError,
    BooleanOptionalAction,
    FileType,
    HelpFormatter,
    ArgumentDefaultsHelpFormatter,
    RawDescriptionHelpFormatter,
    RawTextHelpFormatter,
    MetavarTypeHelpFormatter,
    Namespace,
    Action,
    ONE_OR_MORE,
    OPTIONAL,
    PARSER,
    REMAINDER,
    SUPPRESS,
    ZERO_OR_MORE
}

// LEGACY (v1 compatibility), Const alias
Object.defineProperty(module.exports, 'Const', {
    get() {
        let result = {}
        Object.entries({ ONE_OR_MORE, OPTIONAL, PARSER, REMAINDER, SUPPRESS, ZERO_OR_MORE }).forEach(([ n, v ]) => {
            Object.defineProperty(result, n, {
                get() {
                    deprecate(n, sub('use argparse.%s instead of argparse.Const.%s', n, n))
                    return v
                }
            })
        })
        Object.entries({ _UNRECOGNIZED_ARGS_ATTR }).forEach(([ n, v ]) => {
            Object.defineProperty(result, n, {
                get() {
                    deprecate(n, sub('argparse.Const.%s is an internal symbol and will no longer be available', n))
                    return v
                }
            })
        })
        return result
    },
    enumerable: false
})
// end
// Limited implementation of python % string operator, supports only %s and %r for now
// (other formats are not used here, but may appear in custom templates)

'use strict'

const { inspect } = require('util')


module.exports = function sub(pattern, ...values) {
    let regex = /%(?:(%)|(-)?(\*)?(?:\((\w+)\))?([A-Za-z]))/g

    let result = pattern.replace(regex, function (_, is_literal, is_left_align, is_padded, name, format) {
        if (is_literal) return '%'

        let padded_count = 0
        if (is_padded) {
            if (values.length === 0) throw new TypeError('not enough arguments for format string')
            padded_count = values.shift()
            if (!Number.isInteger(padded_count)) throw new TypeError('* wants int')
        }

        let str
        if (name !== undefined) {
            let dict = values[0]
            if (typeof dict !== 'object' || dict === null) throw new TypeError('format requires a mapping')
            if (!(name in dict)) throw new TypeError(`no such key: '${name}'`)
            str = dict[name]
        } else {
            if (values.length === 0) throw new TypeError('not enough arguments for format string')
            str = values.shift()
        }

        switch (format) {
            case 's':
                str = String(str)
                break
            case 'r':
                str = inspect(str)
                break
            case 'd':
            case 'i':
                if (typeof str !== 'number') {
                    throw new TypeError(`%${format} format: a number is required, not ${typeof str}`)
                }
                str = String(str.toFixed(0))
                break
            default:
                throw new TypeError(`unsupported format character '${format}'`)
        }

        if (padded_count > 0) {
            return is_left_align ? str.padEnd(padded_count) : str.padStart(padded_count)
        } else {
            return str
        }
    })

    if (values.length) {
        if (values.length === 1 && typeof values[0] === 'object' && values[0] !== null) {
            // mapping
        } else {
            throw new TypeError('not all arguments converted during string formatting')
        }
    }

    return result
}
// Partial port of python's argparse module, version 3.9.0 (only wrap and fill functions):
// https://github.com/python/cpython/blob/v3.9.0b4/Lib/textwrap.py

'use strict'

/*
 * Text wrapping and filling.
 */

// Copyright (C) 1999-2001 Gregory P. Ward.
// Copyright (C) 2002, 2003 Python Software Foundation.
// Copyright (C) 2020 argparse.js authors
// Originally written by Greg Ward <gward@python.net>

// Hardcode the recognized whitespace characters to the US-ASCII
// whitespace characters.  The main reason for doing this is that
// some Unicode spaces (like \u00a0) are non-breaking whitespaces.
//
// This less funky little regex just split on recognized spaces. E.g.
//   "Hello there -- you goof-ball, use the -b option!"
// splits into
//   Hello/ /there/ /--/ /you/ /goof-ball,/ /use/ /the/ /-b/ /option!/
const wordsep_simple_re = /([\t\n\x0b\x0c\r ]+)/

class TextWrapper {
    /*
     *  Object for wrapping/filling text.  The public interface consists of
     *  the wrap() and fill() methods; the other methods are just there for
     *  subclasses to override in order to tweak the default behaviour.
     *  If you want to completely replace the main wrapping algorithm,
     *  you'll probably have to override _wrap_chunks().
     *
     *  Several instance attributes control various aspects of wrapping:
     *    width (default: 70)
     *      the maximum width of wrapped lines (unless break_long_words
     *      is false)
     *    initial_indent (default: "")
     *      string that will be prepended to the first line of wrapped
     *      output.  Counts towards the line's width.
     *    subsequent_indent (default: "")
     *      string that will be prepended to all lines save the first
     *      of wrapped output; also counts towards each line's width.
     *    expand_tabs (default: true)
     *      Expand tabs in input text to spaces before further processing.
     *      Each tab will become 0 .. 'tabsize' spaces, depending on its position
     *      in its line.  If false, each tab is treated as a single character.
     *    tabsize (default: 8)
     *      Expand tabs in input text to 0 .. 'tabsize' spaces, unless
     *      'expand_tabs' is false.
     *    replace_whitespace (default: true)
     *      Replace all whitespace characters in the input text by spaces
     *      after tab expansion.  Note that if expand_tabs is false and
     *      replace_whitespace is true, every tab will be converted to a
     *      single space!
     *    fix_sentence_endings (default: false)
     *      Ensure that sentence-ending punctuation is always followed
     *      by two spaces.  Off by default because the algorithm is
     *      (unavoidably) imperfect.
     *    break_long_words (default: true)
     *      Break words longer than 'width'.  If false, those words will not
     *      be broken, and some lines might be longer than 'width'.
     *    break_on_hyphens (default: true)
     *      Allow breaking hyphenated words. If true, wrapping will occur
     *      preferably on whitespaces and right after hyphens part of
     *      compound words.
     *    drop_whitespace (default: true)
     *      Drop leading and trailing whitespace from lines.
     *    max_lines (default: None)
     *      Truncate wrapped lines.
     *    placeholder (default: ' [...]')
     *      Append to the last line of truncated text.
     */

    constructor(options = {}) {
        let {
            width = 70,
            initial_indent = '',
            subsequent_indent = '',
            expand_tabs = true,
            replace_whitespace = true,
            fix_sentence_endings = false,
            break_long_words = true,
            drop_whitespace = true,
            break_on_hyphens = true,
            tabsize = 8,
            max_lines = undefined,
            placeholder=' [...]'
        } = options

        this.width = width
        this.initial_indent = initial_indent
        this.subsequent_indent = subsequent_indent
        this.expand_tabs = expand_tabs
        this.replace_whitespace = replace_whitespace
        this.fix_sentence_endings = fix_sentence_endings
        this.break_long_words = break_long_words
        this.drop_whitespace = drop_whitespace
        this.break_on_hyphens = break_on_hyphens
        this.tabsize = tabsize
        this.max_lines = max_lines
        this.placeholder = placeholder
    }


    // -- Private methods -----------------------------------------------
    // (possibly useful for subclasses to override)

    _munge_whitespace(text) {
        /*
         *  _munge_whitespace(text : string) -> string
         *
         *  Munge whitespace in text: expand tabs and convert all other
         *  whitespace characters to spaces.  Eg. " foo\\tbar\\n\\nbaz"
         *  becomes " foo    bar  baz".
         */
        if (this.expand_tabs) {
            text = text.replace(/\t/g, ' '.repeat(this.tabsize)) // not strictly correct in js
        }
        if (this.replace_whitespace) {
            text = text.replace(/[\t\n\x0b\x0c\r]/g, ' ')
        }
        return text
    }

    _split(text) {
        /*
         *  _split(text : string) -> [string]
         *
         *  Split the text to wrap into indivisible chunks.  Chunks are
         *  not quite the same as words; see _wrap_chunks() for full
         *  details.  As an example, the text
         *    Look, goof-ball -- use the -b option!
         *  breaks into the following chunks:
         *    'Look,', ' ', 'goof-', 'ball', ' ', '--', ' ',
         *    'use', ' ', 'the', ' ', '-b', ' ', 'option!'
         *  if break_on_hyphens is True, or in:
         *    'Look,', ' ', 'goof-ball', ' ', '--', ' ',
         *    'use', ' ', 'the', ' ', '-b', ' ', option!'
         *  otherwise.
         */
        let chunks = text.split(wordsep_simple_re)
        chunks = chunks.filter(Boolean)
        return chunks
    }

    _handle_long_word(reversed_chunks, cur_line, cur_len, width) {
        /*
         *  _handle_long_word(chunks : [string],
         *                    cur_line : [string],
         *                    cur_len : int, width : int)
         *
         *  Handle a chunk of text (most likely a word, not whitespace) that
         *  is too long to fit in any line.
         */
        // Figure out when indent is larger than the specified width, and make
        // sure at least one character is stripped off on every pass
        let space_left
        if (width < 1) {
            space_left = 1
        } else {
            space_left = width - cur_len
        }

        // If we're allowed to break long words, then do so: put as much
        // of the next chunk onto the current line as will fit.
        if (this.break_long_words) {
            cur_line.push(reversed_chunks[reversed_chunks.length - 1].slice(0, space_left))
            reversed_chunks[reversed_chunks.length - 1] = reversed_chunks[reversed_chunks.length - 1].slice(space_left)

        // Otherwise, we have to preserve the long word intact.  Only add
        // it to the current line if there's nothing already there --
        // that minimizes how much we violate the width constraint.
        } else if (!cur_line) {
            cur_line.push(...reversed_chunks.pop())
        }

        // If we're not allowed to break long words, and there's already
        // text on the current line, do nothing.  Next time through the
        // main loop of _wrap_chunks(), we'll wind up here again, but
        // cur_len will be zero, so the next line will be entirely
        // devoted to the long word that we can't handle right now.
    }

    _wrap_chunks(chunks) {
        /*
         *  _wrap_chunks(chunks : [string]) -> [string]
         *
         *  Wrap a sequence of text chunks and return a list of lines of
         *  length 'self.width' or less.  (If 'break_long_words' is false,
         *  some lines may be longer than this.)  Chunks correspond roughly
         *  to words and the whitespace between them: each chunk is
         *  indivisible (modulo 'break_long_words'), but a line break can
         *  come between any two chunks.  Chunks should not have internal
         *  whitespace; ie. a chunk is either all whitespace or a "word".
         *  Whitespace chunks will be removed from the beginning and end of
         *  lines, but apart from that whitespace is preserved.
         */
        let lines = []
        let indent
        if (this.width <= 0) {
            throw Error(`invalid width ${this.width} (must be > 0)`)
        }
        if (this.max_lines !== undefined) {
            if (this.max_lines > 1) {
                indent = this.subsequent_indent
            } else {
                indent = this.initial_indent
            }
            if (indent.length + this.placeholder.trimStart().length > this.width) {
                throw Error('placeholder too large for max width')
            }
        }

        // Arrange in reverse order so items can be efficiently popped
        // from a stack of chucks.
        chunks = chunks.reverse()

        while (chunks.length > 0) {

            // Start the list of chunks that will make up the current line.
            // cur_len is just the length of all the chunks in cur_line.
            let cur_line = []
            let cur_len = 0

            // Figure out which static string will prefix this line.
            let indent
            if (lines) {
                indent = this.subsequent_indent
            } else {
                indent = this.initial_indent
            }

            // Maximum width for this line.
            let width = this.width - indent.length

            // First chunk on line is whitespace -- drop it, unless this
            // is the very beginning of the text (ie. no lines started yet).
            if (this.drop_whitespace && chunks[chunks.length - 1].trim() === '' && lines.length > 0) {
                chunks.pop()
            }

            while (chunks.length > 0) {
                let l = chunks[chunks.length - 1].length

                // Can at least squeeze this chunk onto the current line.
                if (cur_len + l <= width) {
                    cur_line.push(chunks.pop())
                    cur_len += l

                // Nope, this line is full.
                } else {
                    break
                }
            }

            // The current line is full, and the next chunk is too big to
            // fit on *any* line (not just this one).
            if (chunks.length && chunks[chunks.length - 1].length > width) {
                this._handle_long_word(chunks, cur_line, cur_len, width)
                cur_len = cur_line.map(l => l.length).reduce((a, b) => a + b, 0)
            }

            // If the last chunk on this line is all whitespace, drop it.
            if (this.drop_whitespace && cur_line.length > 0 && cur_line[cur_line.length - 1].trim() === '') {
                cur_len -= cur_line[cur_line.length - 1].length
                cur_line.pop()
            }

            if (cur_line) {
                if (this.max_lines === undefined ||
                    lines.length + 1 < this.max_lines ||
                    (chunks.length === 0 ||
                     this.drop_whitespace &&
                     chunks.length === 1 &&
                     !chunks[0].trim()) && cur_len <= width) {
                    // Convert current line back to a string and store it in
                    // list of all lines (return value).
                    lines.push(indent + cur_line.join(''))
                } else {
                    let had_break = false
                    while (cur_line) {
                        if (cur_line[cur_line.length - 1].trim() &&
                            cur_len + this.placeholder.length <= width) {
                            cur_line.push(this.placeholder)
                            lines.push(indent + cur_line.join(''))
                            had_break = true
                            break
                        }
                        cur_len -= cur_line[-1].length
                        cur_line.pop()
                    }
                    if (!had_break) {
                        if (lines) {
                            let prev_line = lines[lines.length - 1].trimEnd()
                            if (prev_line.length + this.placeholder.length <=
                                    this.width) {
                                lines[lines.length - 1] = prev_line + this.placeholder
                                break
                            }
                        }
                        lines.push(indent + this.placeholder.lstrip())
                    }
                    break
                }
            }
        }

        return lines
    }

    _split_chunks(text) {
        text = this._munge_whitespace(text)
        return this._split(text)
    }

    // -- Public interface ----------------------------------------------

    wrap(text) {
        /*
         *  wrap(text : string) -> [string]
         *
         *  Reformat the single paragraph in 'text' so it fits in lines of
         *  no more than 'self.width' columns, and return a list of wrapped
         *  lines.  Tabs in 'text' are expanded with string.expandtabs(),
         *  and all other whitespace characters (including newline) are
         *  converted to space.
         */
        let chunks = this._split_chunks(text)
        // not implemented in js
        //if (this.fix_sentence_endings) {
        //    this._fix_sentence_endings(chunks)
        //}
        return this._wrap_chunks(chunks)
    }

    fill(text) {
        /*
         *  fill(text : string) -> string
         *
         *  Reformat the single paragraph in 'text' to fit in lines of no
         *  more than 'self.width' columns, and return a new string
         *  containing the entire wrapped paragraph.
         */
        return this.wrap(text).join('\n')
    }
}


// -- Convenience interface ---------------------------------------------

function wrap(text, options = {}) {
    /*
     *  Wrap a single paragraph of text, returning a list of wrapped lines.
     *
     *  Reformat the single paragraph in 'text' so it fits in lines of no
     *  more than 'width' columns, and return a list of wrapped lines.  By
     *  default, tabs in 'text' are expanded with string.expandtabs(), and
     *  all other whitespace characters (including newline) are converted to
     *  space.  See TextWrapper class for available keyword args to customize
     *  wrapping behaviour.
     */
    let { width = 70, ...kwargs } = options
    let w = new TextWrapper(Object.assign({ width }, kwargs))
    return w.wrap(text)
}

function fill(text, options = {}) {
    /*
     *  Fill a single paragraph of text, returning a new string.
     *
     *  Reformat the single paragraph in 'text' to fit in lines of no more
     *  than 'width' columns, and return a new string containing the entire
     *  wrapped paragraph.  As with wrap(), tabs are expanded and other
     *  whitespace characters converted to space.  See TextWrapper class for
     *  available keyword args to customize wrapping behaviour.
     */
    let { width = 70, ...kwargs } = options
    let w = new TextWrapper(Object.assign({ width }, kwargs))
    return w.fill(text)
}

// -- Loosely related functionality -------------------------------------

let _whitespace_only_re = /^[ \t]+$/mg
let _leading_whitespace_re = /(^[ \t]*)(?:[^ \t\n])/mg

function dedent(text) {
    /*
     *  Remove any common leading whitespace from every line in `text`.
     *
     *  This can be used to make triple-quoted strings line up with the left
     *  edge of the display, while still presenting them in the source code
     *  in indented form.
     *
     *  Note that tabs and spaces are both treated as whitespace, but they
     *  are not equal: the lines "  hello" and "\\thello" are
     *  considered to have no common leading whitespace.
     *
     *  Entirely blank lines are normalized to a newline character.
     */
    // Look for the longest leading string of spaces and tabs common to
    // all lines.
    let margin = undefined
    text = text.replace(_whitespace_only_re, '')
    let indents = text.match(_leading_whitespace_re) || []
    for (let indent of indents) {
        indent = indent.slice(0, -1)

        if (margin === undefined) {
            margin = indent

        // Current line more deeply indented than previous winner:
        // no change (previous winner is still on top).
        } else if (indent.startsWith(margin)) {
            // pass

        // Current line consistent with and no deeper than previous winner:
        // it's the new winner.
        } else if (margin.startsWith(indent)) {
            margin = indent

        // Find the largest common whitespace between current line and previous
        // winner.
        } else {
            for (let i = 0; i < margin.length && i < indent.length; i++) {
                if (margin[i] !== indent[i]) {
                    margin = margin.slice(0, i)
                    break
                }
            }
        }
    }

    if (margin) {
        text = text.replace(new RegExp('^' + margin, 'mg'), '')
    }
    return text
}

module.exports = { wrap, fill, dedent }
{
  "name": "argparse",
  "description": "CLI arguments parser. Native port of python's argparse.",
  "version": "2.0.1",
  "main": "argparse.js",
  "files": [
    "argparse.js",
    "lib/"
  ],
  "license": "Python-2.0",
  "repository": "nodeca/argparse",
  "devDependencies": {
    "@babel/eslint-parser": "^7.11.0",
    "@babel/plugin-syntax-class-properties": "^7.10.4",
    "eslint": "^7.5.0",
    "mocha": "^8.0.1",
    "nyc": "^15.1.0"
  }
}The MIT License (MIT)

Copyright (c) 2015 Loopline Systems

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CancellationError = exports.CancellationToken = void 0;
const events_1 = require("events");
class CancellationToken extends events_1.EventEmitter {
    get cancelled() {
        return this._cancelled || (this._parent != null && this._parent.cancelled);
    }
    set parent(value) {
        this.removeParentCancelHandler();
        this._parent = value;
        this.parentCancelHandler = () => this.cancel();
        this._parent.onCancel(this.parentCancelHandler);
    }
    // babel cannot compile ... correctly for super calls
    constructor(parent) {
        super();
        this.parentCancelHandler = null;
        this._parent = null;
        this._cancelled = false;
        if (parent != null) {
            this.parent = parent;
        }
    }
    cancel() {
        this._cancelled = true;
        this.emit("cancel");
    }
    onCancel(handler) {
        if (this.cancelled) {
            handler();
        }
        else {
            this.once("cancel", handler);
        }
    }
    createPromise(callback) {
        if (this.cancelled) {
            return Promise.reject(new CancellationError());
        }
        const finallyHandler = () => {
            if (cancelHandler != null) {
                try {
                    this.removeListener("cancel", cancelHandler);
                    cancelHandler = null;
                }
                catch (_ignore) {
                    // ignore
                }
            }
        };
        let cancelHandler = null;
        return new Promise((resolve, reject) => {
            let addedCancelHandler = null;
            cancelHandler = () => {
                try {
                    if (addedCancelHandler != null) {
                        addedCancelHandler();
                        addedCancelHandler = null;
                    }
                }
                finally {
                    reject(new CancellationError());
                }
            };
            if (this.cancelled) {
                cancelHandler();
                return;
            }
            this.onCancel(cancelHandler);
            callback(resolve, reject, (callback) => {
                addedCancelHandler = callback;
            });
        })
            .then(it => {
            finallyHandler();
            return it;
        })
            .catch((e) => {
            finallyHandler();
            throw e;
        });
    }
    removeParentCancelHandler() {
        const parent = this._parent;
        if (parent != null && this.parentCancelHandler != null) {
            parent.removeListener("cancel", this.parentCancelHandler);
            this.parentCancelHandler = null;
        }
    }
    dispose() {
        try {
            this.removeParentCancelHandler();
        }
        finally {
            this.removeAllListeners();
            this._parent = null;
        }
    }
}
exports.CancellationToken = CancellationToken;
class CancellationError extends Error {
    constructor() {
        super("cancelled");
    }
}
exports.CancellationError = CancellationError;
//# sourceMappingURL=CancellationToken.js.map{"version":3,"file":"CancellationToken.js","sourceRoot":"","sources":["../src/CancellationToken.ts"],"names":[],"mappings":";;;AAAA,mCAAqC;AAErC,MAAa,iBAAkB,SAAQ,qBAAY;IAIjD,IAAI,SAAS;QACX,OAAO,IAAI,CAAC,UAAU,IAAI,CAAC,IAAI,CAAC,OAAO,IAAI,IAAI,IAAI,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAA;IAC5E,CAAC;IAGD,IAAI,MAAM,CAAC,KAAwB;QACjC,IAAI,CAAC,yBAAyB,EAAE,CAAA;QAEhC,IAAI,CAAC,OAAO,GAAG,KAAK,CAAA;QACpB,IAAI,CAAC,mBAAmB,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,MAAM,EAAE,CAAA;QAC9C,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAA;IACjD,CAAC;IAED,qDAAqD;IACrD,YAAY,MAA0B;QACpC,KAAK,EAAE,CAAA;QAlBD,wBAAmB,GAAuB,IAAI,CAAA;QAO9C,YAAO,GAA6B,IAAI,CAAA;QAa9C,IAAI,CAAC,UAAU,GAAG,KAAK,CAAA;QACvB,IAAI,MAAM,IAAI,IAAI,EAAE,CAAC;YACnB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QACtB,CAAC;IACH,CAAC;IAED,MAAM;QACJ,IAAI,CAAC,UAAU,GAAG,IAAI,CAAA;QACtB,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;IACrB,CAAC;IAEO,QAAQ,CAAC,OAAkB;QACjC,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YACnB,OAAO,EAAE,CAAA;QACX,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAA;QAC9B,CAAC;IACH,CAAC;IAED,aAAa,CACX,QAAqJ;QAErJ,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YACnB,OAAO,OAAO,CAAC,MAAM,CAAI,IAAI,iBAAiB,EAAE,CAAC,CAAA;QACnD,CAAC;QAED,MAAM,cAAc,GAAG,GAAG,EAAE;YAC1B,IAAI,aAAa,IAAI,IAAI,EAAE,CAAC;gBAC1B,IAAI,CAAC;oBACH,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAA;oBAC5C,aAAa,GAAG,IAAI,CAAA;gBACtB,CAAC;gBAAC,OAAO,OAAO,EAAE,CAAC;oBACjB,SAAS;gBACX,CAAC;YACH,CAAC;QACH,CAAC,CAAA;QAED,IAAI,aAAa,GAAwB,IAAI,CAAA;QAC7C,OAAO,IAAI,OAAO,CAAI,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACxC,IAAI,kBAAkB,GAAwB,IAAI,CAAA;YAElD,aAAa,GAAG,GAAG,EAAE;gBACnB,IAAI,CAAC;oBACH,IAAI,kBAAkB,IAAI,IAAI,EAAE,CAAC;wBAC/B,kBAAkB,EAAE,CAAA;wBACpB,kBAAkB,GAAG,IAAI,CAAA;oBAC3B,CAAC;gBACH,CAAC;wBAAS,CAAC;oBACT,MAAM,CAAC,IAAI,iBAAiB,EAAE,CAAC,CAAA;gBACjC,CAAC;YACH,CAAC,CAAA;YAED,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;gBACnB,aAAa,EAAE,CAAA;gBACf,OAAM;YACR,CAAC;YAED,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAA;YAE5B,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,CAAC,QAAoB,EAAE,EAAE;gBACjD,kBAAkB,GAAG,QAAQ,CAAA;YAC/B,CAAC,CAAC,CAAA;QACJ,CAAC,CAAC;aACC,IAAI,CAAC,EAAE,CAAC,EAAE;YACT,cAAc,EAAE,CAAA;YAChB,OAAO,EAAE,CAAA;QACX,CAAC,CAAC;aACD,KAAK,CAAC,CAAC,CAAM,EAAE,EAAE;YAChB,cAAc,EAAE,CAAA;YAChB,MAAM,CAAC,CAAA;QACT,CAAC,CAAC,CAAA;IACN,CAAC;IAEO,yBAAyB;QAC/B,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAA;QAC3B,IAAI,MAAM,IAAI,IAAI,IAAI,IAAI,CAAC,mBAAmB,IAAI,IAAI,EAAE,CAAC;YACvD,MAAM,CAAC,cAAc,CAAC,QAAQ,EAAE,IAAI,CAAC,mBAAmB,CAAC,CAAA;YACzD,IAAI,CAAC,mBAAmB,GAAG,IAAI,CAAA;QACjC,CAAC;IACH,CAAC;IAED,OAAO;QACL,IAAI,CAAC;YACH,IAAI,CAAC,yBAAyB,EAAE,CAAA;QAClC,CAAC;gBAAS,CAAC;YACT,IAAI,CAAC,kBAAkB,EAAE,CAAA;YACzB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAA;QACrB,CAAC;IACH,CAAC;CACF;AA9GD,8CA8GC;AAED,MAAa,iBAAkB,SAAQ,KAAK;IAC1C;QACE,KAAK,CAAC,WAAW,CAAC,CAAA;IACpB,CAAC;CACF;AAJD,8CAIC","sourcesContent":["import { EventEmitter } from \"events\"\n\nexport class CancellationToken extends EventEmitter {\n  private parentCancelHandler: (() => any) | null = null\n\n  private _cancelled: boolean\n  get cancelled(): boolean {\n    return this._cancelled || (this._parent != null && this._parent.cancelled)\n  }\n\n  private _parent: CancellationToken | null = null\n  set parent(value: CancellationToken) {\n    this.removeParentCancelHandler()\n\n    this._parent = value\n    this.parentCancelHandler = () => this.cancel()\n    this._parent.onCancel(this.parentCancelHandler)\n  }\n\n  // babel cannot compile ... correctly for super calls\n  constructor(parent?: CancellationToken) {\n    super()\n\n    this._cancelled = false\n    if (parent != null) {\n      this.parent = parent\n    }\n  }\n\n  cancel() {\n    this._cancelled = true\n    this.emit(\"cancel\")\n  }\n\n  private onCancel(handler: () => any) {\n    if (this.cancelled) {\n      handler()\n    } else {\n      this.once(\"cancel\", handler)\n    }\n  }\n\n  createPromise<R>(\n    callback: (resolve: (thenableOrResult: R | PromiseLike<R>) => void, reject: (error: Error) => void, onCancel: (callback: () => void) => void) => void\n  ): Promise<R> {\n    if (this.cancelled) {\n      return Promise.reject<R>(new CancellationError())\n    }\n\n    const finallyHandler = () => {\n      if (cancelHandler != null) {\n        try {\n          this.removeListener(\"cancel\", cancelHandler)\n          cancelHandler = null\n        } catch (_ignore) {\n          // ignore\n        }\n      }\n    }\n\n    let cancelHandler: (() => void) | null = null\n    return new Promise<R>((resolve, reject) => {\n      let addedCancelHandler: (() => void) | null = null\n\n      cancelHandler = () => {\n        try {\n          if (addedCancelHandler != null) {\n            addedCancelHandler()\n            addedCancelHandler = null\n          }\n        } finally {\n          reject(new CancellationError())\n        }\n      }\n\n      if (this.cancelled) {\n        cancelHandler()\n        return\n      }\n\n      this.onCancel(cancelHandler)\n\n      callback(resolve, reject, (callback: () => void) => {\n        addedCancelHandler = callback\n      })\n    })\n      .then(it => {\n        finallyHandler()\n        return it\n      })\n      .catch((e: any) => {\n        finallyHandler()\n        throw e\n      })\n  }\n\n  private removeParentCancelHandler() {\n    const parent = this._parent\n    if (parent != null && this.parentCancelHandler != null) {\n      parent.removeListener(\"cancel\", this.parentCancelHandler)\n      this.parentCancelHandler = null\n    }\n  }\n\n  dispose() {\n    try {\n      this.removeParentCancelHandler()\n    } finally {\n      this.removeAllListeners()\n      this._parent = null\n    }\n  }\n}\n\nexport class CancellationError extends Error {\n  constructor() {\n    super(\"cancelled\")\n  }\n}\n"]}"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.MemoLazy = void 0;
class MemoLazy {
    constructor(selector, creator) {
        this.selector = selector;
        this.creator = creator;
        this.selected = undefined;
        this._value = undefined;
    }
    get hasValue() {
        return this._value !== undefined;
    }
    get value() {
        const selected = this.selector();
        if (this._value !== undefined && equals(this.selected, selected)) {
            // value exists and selected hasn't changed, so return the cached value
            return this._value;
        }
        this.selected = selected;
        const result = this.creator(selected);
        this.value = result;
        return result;
    }
    set value(value) {
        this._value = value;
    }
}
exports.MemoLazy = MemoLazy;
function equals(firstValue, secondValue) {
    const isFirstObject = typeof firstValue === "object" && firstValue !== null;
    const isSecondObject = typeof secondValue === "object" && secondValue !== null;
    // do a shallow comparison of objects, arrays etc.
    if (isFirstObject && isSecondObject) {
        const keys1 = Object.keys(firstValue);
        const keys2 = Object.keys(secondValue);
        return keys1.length === keys2.length && keys1.every((key) => equals(firstValue[key], secondValue[key]));
    }
    // otherwise just compare the values directly
    return firstValue === secondValue;
}
//# sourceMappingURL=MemoLazy.js.map{"version":3,"file":"MemoLazy.js","sourceRoot":"","sources":["../src/MemoLazy.ts"],"names":[],"mappings":";;;AAAA,MAAa,QAAQ;IAInB,YACU,QAAiB,EACjB,OAAoC;QADpC,aAAQ,GAAR,QAAQ,CAAS;QACjB,YAAO,GAAP,OAAO,CAA6B;QALtC,aAAQ,GAAkB,SAAS,CAAA;QACnC,WAAM,GAA2B,SAAS,CAAA;IAK/C,CAAC;IAEJ,IAAI,QAAQ;QACV,OAAO,IAAI,CAAC,MAAM,KAAK,SAAS,CAAA;IAClC,CAAC;IAED,IAAI,KAAK;QACP,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAA;QAChC,IAAI,IAAI,CAAC,MAAM,KAAK,SAAS,IAAI,MAAM,CAAC,IAAI,CAAC,QAAQ,EAAE,QAAQ,CAAC,EAAE,CAAC;YACjE,uEAAuE;YACvE,OAAO,IAAI,CAAC,MAAM,CAAA;QACpB,CAAC;QAED,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAA;QACxB,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAA;QACrC,IAAI,CAAC,KAAK,GAAG,MAAM,CAAA;QAEnB,OAAO,MAAM,CAAA;IACf,CAAC;IAED,IAAI,KAAK,CAAC,KAAiB;QACzB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAA;IACrB,CAAC;CACF;AA9BD,4BA8BC;AAED,SAAS,MAAM,CAAC,UAAe,EAAE,WAAgB;IAC/C,MAAM,aAAa,GAAG,OAAO,UAAU,KAAK,QAAQ,IAAI,UAAU,KAAK,IAAI,CAAA;IAC3E,MAAM,cAAc,GAAG,OAAO,WAAW,KAAK,QAAQ,IAAI,WAAW,KAAK,IAAI,CAAA;IAE9E,kDAAkD;IAClD,IAAI,aAAa,IAAI,cAAc,EAAE,CAAC;QACpC,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAA;QACrC,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAA;QAEtC,OAAO,KAAK,CAAC,MAAM,KAAK,KAAK,CAAC,MAAM,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC,GAAQ,EAAE,EAAE,CAAC,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA;IAC9G,CAAC;IAED,6CAA6C;IAC7C,OAAO,UAAU,KAAK,WAAW,CAAA;AACnC,CAAC","sourcesContent":["export class MemoLazy<S, V> {\n  private selected: S | undefined = undefined\n  private _value: Promise<V> | undefined = undefined\n\n  constructor(\n    private selector: () => S,\n    private creator: (selected: S) => Promise<V>\n  ) {}\n\n  get hasValue() {\n    return this._value !== undefined\n  }\n\n  get value(): Promise<V> {\n    const selected = this.selector()\n    if (this._value !== undefined && equals(this.selected, selected)) {\n      // value exists and selected hasn't changed, so return the cached value\n      return this._value\n    }\n\n    this.selected = selected\n    const result = this.creator(selected)\n    this.value = result\n\n    return result\n  }\n\n  set value(value: Promise<V>) {\n    this._value = value\n  }\n}\n\nfunction equals(firstValue: any, secondValue: any): boolean {\n  const isFirstObject = typeof firstValue === \"object\" && firstValue !== null\n  const isSecondObject = typeof secondValue === \"object\" && secondValue !== null\n\n  // do a shallow comparison of objects, arrays etc.\n  if (isFirstObject && isSecondObject) {\n    const keys1 = Object.keys(firstValue)\n    const keys2 = Object.keys(secondValue)\n\n    return keys1.length === keys2.length && keys1.every((key: any) => equals(firstValue[key], secondValue[key]))\n  }\n\n  // otherwise just compare the values directly\n  return firstValue === secondValue\n}\n"]}"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ProgressCallbackTransform = void 0;
const stream_1 = require("stream");
class ProgressCallbackTransform extends stream_1.Transform {
    constructor(total, cancellationToken, onProgress) {
        super();
        this.total = total;
        this.cancellationToken = cancellationToken;
        this.onProgress = onProgress;
        this.start = Date.now();
        this.transferred = 0;
        this.delta = 0;
        this.nextUpdate = this.start + 1000;
    }
    _transform(chunk, encoding, callback) {
        if (this.cancellationToken.cancelled) {
            callback(new Error("cancelled"), null);
            return;
        }
        this.transferred += chunk.length;
        this.delta += chunk.length;
        const now = Date.now();
        if (now >= this.nextUpdate && this.transferred !== this.total /* will be emitted on _flush */) {
            this.nextUpdate = now + 1000;
            this.onProgress({
                total: this.total,
                delta: this.delta,
                transferred: this.transferred,
                percent: (this.transferred / this.total) * 100,
                bytesPerSecond: Math.round(this.transferred / ((now - this.start) / 1000)),
            });
            this.delta = 0;
        }
        callback(null, chunk);
    }
    _flush(callback) {
        if (this.cancellationToken.cancelled) {
            callback(new Error("cancelled"));
            return;
        }
        this.onProgress({
            total: this.total,
            delta: this.delta,
            transferred: this.total,
            percent: 100,
            bytesPerSecond: Math.round(this.transferred / ((Date.now() - this.start) / 1000)),
        });
        this.delta = 0;
        callback(null);
    }
}
exports.ProgressCallbackTransform = ProgressCallbackTransform;
//# sourceMappingURL=ProgressCallbackTransform.js.map{"version":3,"file":"ProgressCallbackTransform.js","sourceRoot":"","sources":["../src/ProgressCallbackTransform.ts"],"names":[],"mappings":";;;AAAA,mCAAkC;AAWlC,MAAa,yBAA0B,SAAQ,kBAAS;IAOtD,YACmB,KAAa,EACb,iBAAoC,EACpC,UAAuC;QAExD,KAAK,EAAE,CAAA;QAJU,UAAK,GAAL,KAAK,CAAQ;QACb,sBAAiB,GAAjB,iBAAiB,CAAmB;QACpC,eAAU,GAAV,UAAU,CAA6B;QATlD,UAAK,GAAG,IAAI,CAAC,GAAG,EAAE,CAAA;QAClB,gBAAW,GAAG,CAAC,CAAA;QACf,UAAK,GAAG,CAAC,CAAA;QAET,eAAU,GAAG,IAAI,CAAC,KAAK,GAAG,IAAI,CAAA;IAQtC,CAAC;IAED,UAAU,CAAC,KAAU,EAAE,QAAgB,EAAE,QAAa;QACpD,IAAI,IAAI,CAAC,iBAAiB,CAAC,SAAS,EAAE,CAAC;YACrC,QAAQ,CAAC,IAAI,KAAK,CAAC,WAAW,CAAC,EAAE,IAAI,CAAC,CAAA;YACtC,OAAM;QACR,CAAC;QAED,IAAI,CAAC,WAAW,IAAI,KAAK,CAAC,MAAM,CAAA;QAChC,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,MAAM,CAAA;QAE1B,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,CAAA;QACtB,IAAI,GAAG,IAAI,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,WAAW,KAAK,IAAI,CAAC,KAAK,CAAC,+BAA+B,EAAE,CAAC;YAC9F,IAAI,CAAC,UAAU,GAAG,GAAG,GAAG,IAAI,CAAA;YAE5B,IAAI,CAAC,UAAU,CAAC;gBACd,KAAK,EAAE,IAAI,CAAC,KAAK;gBACjB,KAAK,EAAE,IAAI,CAAC,KAAK;gBACjB,WAAW,EAAE,IAAI,CAAC,WAAW;gBAC7B,OAAO,EAAE,CAAC,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,GAAG;gBAC9C,cAAc,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,GAAG,CAAC,CAAC,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC;aAC3E,CAAC,CAAA;YACF,IAAI,CAAC,KAAK,GAAG,CAAC,CAAA;QAChB,CAAC;QAED,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;IACvB,CAAC;IAED,MAAM,CAAC,QAAa;QAClB,IAAI,IAAI,CAAC,iBAAiB,CAAC,SAAS,EAAE,CAAC;YACrC,QAAQ,CAAC,IAAI,KAAK,CAAC,WAAW,CAAC,CAAC,CAAA;YAChC,OAAM;QACR,CAAC;QAED,IAAI,CAAC,UAAU,CAAC;YACd,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,WAAW,EAAE,IAAI,CAAC,KAAK;YACvB,OAAO,EAAE,GAAG;YACZ,cAAc,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC;SAClF,CAAC,CAAA;QACF,IAAI,CAAC,KAAK,GAAG,CAAC,CAAA;QAEd,QAAQ,CAAC,IAAI,CAAC,CAAA;IAChB,CAAC;CACF;AA1DD,8DA0DC","sourcesContent":["import { Transform } from \"stream\"\nimport { CancellationToken } from \"./CancellationToken\"\n\nexport interface ProgressInfo {\n  total: number\n  delta: number\n  transferred: number\n  percent: number\n  bytesPerSecond: number\n}\n\nexport class ProgressCallbackTransform extends Transform {\n  private start = Date.now()\n  private transferred = 0\n  private delta = 0\n\n  private nextUpdate = this.start + 1000\n\n  constructor(\n    private readonly total: number,\n    private readonly cancellationToken: CancellationToken,\n    private readonly onProgress: (info: ProgressInfo) => any\n  ) {\n    super()\n  }\n\n  _transform(chunk: any, encoding: string, callback: any) {\n    if (this.cancellationToken.cancelled) {\n      callback(new Error(\"cancelled\"), null)\n      return\n    }\n\n    this.transferred += chunk.length\n    this.delta += chunk.length\n\n    const now = Date.now()\n    if (now >= this.nextUpdate && this.transferred !== this.total /* will be emitted on _flush */) {\n      this.nextUpdate = now + 1000\n\n      this.onProgress({\n        total: this.total,\n        delta: this.delta,\n        transferred: this.transferred,\n        percent: (this.transferred / this.total) * 100,\n        bytesPerSecond: Math.round(this.transferred / ((now - this.start) / 1000)),\n      })\n      this.delta = 0\n    }\n\n    callback(null, chunk)\n  }\n\n  _flush(callback: any): void {\n    if (this.cancellationToken.cancelled) {\n      callback(new Error(\"cancelled\"))\n      return\n    }\n\n    this.onProgress({\n      total: this.total,\n      delta: this.delta,\n      transferred: this.total,\n      percent: 100,\n      bytesPerSecond: Math.round(this.transferred / ((Date.now() - this.start) / 1000)),\n    })\n    this.delta = 0\n\n    callback(null)\n  }\n}\n"]}"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=blockMapApi.js.map{"version":3,"file":"blockMapApi.js","sourceRoot":"","sources":["../src/blockMapApi.ts"],"names":[],"mappings":"","sourcesContent":["export interface FileChunks {\n  checksums: Array<string>\n  sizes: Array<number>\n}\n\nexport interface BlockMap {\n  version: \"1\" | \"2\"\n  files: Array<BlockMapFile>\n}\n\nexport interface BlockMapFile extends FileChunks {\n  name: string\n  offset: number\n}\n"]}"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.newError = newError;
function newError(message, code) {
    const error = new Error(message);
    error.code = code;
    return error;
}
//# sourceMappingURL=error.js.map{"version":3,"file":"error.js","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":";;AAAA,4BAIC;AAJD,SAAgB,QAAQ,CAAC,OAAe,EAAE,IAAY;IACpD,MAAM,KAAK,GAAG,IAAI,KAAK,CAAC,OAAO,CAAC,CAC/B;IAAC,KAA+B,CAAC,IAAI,GAAG,IAAI,CAAA;IAC7C,OAAO,KAAK,CAAA;AACd,CAAC","sourcesContent":["export function newError(message: string, code: string) {\n  const error = new Error(message)\n  ;(error as NodeJS.ErrnoException).code = code\n  return error\n}\n"]}"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.DigestTransform = exports.HttpExecutor = exports.HttpError = void 0;
exports.addSensitiveRedirectHeader = addSensitiveRedirectHeader;
exports.addSensitiveFieldPattern = addSensitiveFieldPattern;
exports.createHttpError = createHttpError;
exports.parseJson = parseJson;
exports.configureRequestOptionsFromUrl = configureRequestOptionsFromUrl;
exports.configureRequestUrl = configureRequestUrl;
exports.safeGetHeader = safeGetHeader;
exports.configureRequestOptions = configureRequestOptions;
exports.isSensitiveFieldName = isSensitiveFieldName;
exports.hashSensitiveValue = hashSensitiveValue;
exports.safeStringifyJson = safeStringifyJson;
const crypto_1 = require("crypto");
const debug_1 = require("debug");
const fs_1 = require("fs");
const stream_1 = require("stream");
const url_1 = require("url");
const CancellationToken_1 = require("./CancellationToken");
const error_1 = require("./error");
const ProgressCallbackTransform_1 = require("./ProgressCallbackTransform");
const debug = (0, debug_1.default)("electron-builder");
// â”€â”€ Sensitive-data registries â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€
// Normalise a header or field name: lowercase + strip all separators (- and _).
// Shared by both registries so lookup is always separator-agnostic.
const normalizeName = (name) => name.toLowerCase().replace(/[-_]/g, "");
// HTTP header names (normalised) stripped on cross-origin redirects.
// Stored normalised; lookup normalises the incoming key with normalizeName().
const SENSITIVE_REDIRECT_HEADERS = new Set(["authorization", "proxyauthorization", "privatetoken", "xapikey", "xauthtoken", "xaccesstoken", "xgitlabtoken", "cookie", "xcsrftoken"]);
// Substrings: a field name containing any of these (after normalization) is redacted.
const SENSITIVE_FIELD_PATTERNS = ["token", "password", "secret", "authorization", "credential", "apikey", "passphrase", "auth"];
// Suffixes: a field name ending with any of these (after normalization) is redacted.
// Intentionally greedy â€” "publicKey" is also stripped; over-stripping debug logs is
// acceptable, under-stripping a credential is not.
const SENSITIVE_FIELD_SUFFIXES = ["key"];
/**
 * Register an additional HTTP header to strip on cross-origin redirects.
 * Intended for custom publishers (e.g. GenericPublisher with a non-standard auth header).
 */
function addSensitiveRedirectHeader(header) {
    SENSITIVE_REDIRECT_HEADERS.add(normalizeName(header));
}
/**
 * Register an additional substring pattern used by {@link safeStringifyJson} to
 * identify sensitive field names. Input is normalized (lowercased, separators stripped).
 * Intended for custom publishers that store credentials under non-standard field names.
 */
function addSensitiveFieldPattern(pattern) {
    SENSITIVE_FIELD_PATTERNS.push(pattern.toLowerCase().replace(/[-_]/g, ""));
}
function createHttpError(response, description = null) {
    return new HttpError(response.statusCode || -1, `${response.statusCode} ${response.statusMessage}` +
        (description == null ? "" : "\n" + JSON.stringify(description, null, "  ")) +
        "\nHeaders: " +
        safeStringifyJson(response.headers), description);
}
const HTTP_STATUS_CODES = new Map([
    [429, "Too many requests"],
    [400, "Bad request"],
    [403, "Forbidden"],
    [404, "Not found"],
    [405, "Method not allowed"],
    [406, "Not acceptable"],
    [408, "Request timeout"],
    [413, "Request entity too large"],
    [500, "Internal server error"],
    [502, "Bad gateway"],
    [503, "Service unavailable"],
    [504, "Gateway timeout"],
    [505, "HTTP version not supported"],
]);
class HttpError extends Error {
    constructor(statusCode, message = `HTTP error: ${HTTP_STATUS_CODES.get(statusCode) || statusCode}`, description = null) {
        super(message);
        this.statusCode = statusCode;
        this.description = description;
        this.name = "HttpError";
        this.code = `HTTP_ERROR_${statusCode}`;
    }
    isServerError() {
        return this.statusCode >= 500 && this.statusCode <= 599;
    }
}
exports.HttpError = HttpError;
function parseJson(result) {
    return result.then(it => (it == null || it.length === 0 ? null : JSON.parse(it)));
}
class HttpExecutor {
    constructor() {
        this.maxRedirects = 10;
    }
    request(options, cancellationToken = new CancellationToken_1.CancellationToken(), data) {
        configureRequestOptions(options);
        const json = data == null ? undefined : JSON.stringify(data);
        const encodedData = json ? Buffer.from(json) : undefined;
        if (encodedData != null) {
            if (debug.enabled) {
                debug(safeStringifyJson(data));
            }
            const { headers, ...opts } = options;
            options = {
                method: "post",
                headers: {
                    "Content-Type": "application/json",
                    "Content-Length": encodedData.length,
                    ...headers,
                },
                ...opts,
            };
        }
        return this.doApiRequest(options, cancellationToken, it => it.end(encodedData));
    }
    doApiRequest(options, cancellationToken, requestProcessor, redirectCount = 0) {
        if (debug.enabled) {
            const { headers: _headers, auth: _auth, ...safeOptions } = options;
            debug(`Request: ${safeStringifyJson(safeOptions)}`);
        }
        return cancellationToken.createPromise((resolve, reject, onCancel) => {
            const request = this.createRequest(options, (response) => {
                try {
                    this.handleResponse(response, options, cancellationToken, resolve, reject, redirectCount, requestProcessor);
                }
                catch (e) {
                    reject(e);
                }
            });
            this.addErrorAndTimeoutHandlers(request, reject, options.timeout);
            this.addRedirectHandlers(request, options, reject, redirectCount, options => {
                this.doApiRequest(options, cancellationToken, requestProcessor, redirectCount).then(resolve).catch(reject);
            });
            requestProcessor(request, reject);
            onCancel(() => request.abort());
        });
    }
    // noinspection JSUnusedLocalSymbols
    // eslint-disable-next-line
    addRedirectHandlers(request, options, reject, redirectCount, handler) {
        // not required for NodeJS
    }
    addErrorAndTimeoutHandlers(request, reject, timeout = 60 * 1000) {
        this.addTimeOutHandler(request, reject, timeout);
        request.on("error", reject);
        request.on("aborted", () => {
            reject(new Error("Request has been aborted by the server"));
        });
    }
    handleResponse(response, options, cancellationToken, resolve, reject, redirectCount, requestProcessor) {
        var _a;
        if (debug.enabled) {
            const { headers: _headers, auth: _auth, ...safeOptions } = options;
            debug(`Response: ${response.statusCode} ${response.statusMessage}, request options: ${safeStringifyJson(safeOptions)}`);
        }
        // we handle any other >= 400 error on request end (read detailed message in the response body)
        if (response.statusCode === 404) {
            // error is clear, we don't need to read detailed error description
            reject(createHttpError(response, `method: ${options.method || "GET"} url: ${options.protocol || "https:"}//${options.hostname}${options.port ? `:${options.port}` : ""}${options.path}

Please double check that your authentication token is correct. Due to security reasons, actual status maybe not reported, but 404.
`));
            return;
        }
        else if (response.statusCode === 204) {
            // on DELETE request
            resolve();
            return;
        }
        const code = (_a = response.statusCode) !== null && _a !== void 0 ? _a : 0;
        const shouldRedirect = code >= 300 && code < 400;
        const redirectUrl = safeGetHeader(response, "location");
        if (shouldRedirect && redirectUrl != null) {
            if (redirectCount > this.maxRedirects) {
                reject(this.createMaxRedirectError());
                return;
            }
            this.doApiRequest(HttpExecutor.prepareRedirectUrlOptions(redirectUrl, options), cancellationToken, requestProcessor, redirectCount).then(resolve).catch(reject);
            return;
        }
        response.setEncoding("utf8");
        let data = "";
        response.on("error", reject);
        response.on("data", (chunk) => (data += chunk));
        response.on("end", () => {
            try {
                if (response.statusCode != null && response.statusCode >= 400) {
                    const contentType = safeGetHeader(response, "content-type");
                    const isJson = contentType != null && (Array.isArray(contentType) ? contentType.find(it => it.includes("json")) != null : contentType.includes("json"));
                    reject(createHttpError(response, `method: ${options.method || "GET"} url: ${options.protocol || "https:"}//${options.hostname}${options.port ? `:${options.port}` : ""}${options.path}

          Data:
          ${isJson ? safeStringifyJson(JSON.parse(data)) : data}
          `));
                }
                else {
                    resolve(data.length === 0 ? null : data);
                }
            }
            catch (e) {
                reject(e);
            }
        });
    }
    async downloadToBuffer(url, options) {
        return await options.cancellationToken.createPromise((resolve, reject, onCancel) => {
            const responseChunks = [];
            const requestOptions = {
                headers: options.headers || undefined,
                // because PrivateGitHubProvider requires HttpExecutor.prepareRedirectUrlOptions logic, so, we need to redirect manually
                redirect: "manual",
            };
            configureRequestUrl(url, requestOptions);
            configureRequestOptions(requestOptions);
            this.doDownload(requestOptions, {
                destination: null,
                options,
                onCancel,
                callback: error => {
                    if (error == null) {
                        resolve(Buffer.concat(responseChunks));
                    }
                    else {
                        reject(error);
                    }
                },
                responseHandler: (response, callback) => {
                    let receivedLength = 0;
                    response.on("data", (chunk) => {
                        receivedLength += chunk.length;
                        if (receivedLength > 524288000) {
                            callback(new Error("Maximum allowed size is 500 MB"));
                            return;
                        }
                        responseChunks.push(chunk);
                    });
                    response.on("end", () => {
                        callback(null);
                    });
                },
            }, 0);
        });
    }
    doDownload(requestOptions, options, redirectCount) {
        const request = this.createRequest(requestOptions, (response) => {
            if (response.statusCode >= 400) {
                options.callback(new Error(`Cannot download "${requestOptions.protocol || "https:"}//${requestOptions.hostname}${requestOptions.path}", status ${response.statusCode}: ${response.statusMessage}`));
                return;
            }
            // It is possible for the response stream to fail, e.g. when a network is lost while
            // response stream is in progress. Stop waiting and reject so consumer can catch the error.
            response.on("error", options.callback);
            // this code not relevant for Electron (redirect event instead handled)
            const redirectUrl = safeGetHeader(response, "location");
            if (redirectUrl != null) {
                if (redirectCount < this.maxRedirects) {
                    this.doDownload(HttpExecutor.prepareRedirectUrlOptions(redirectUrl, requestOptions), options, redirectCount++);
                }
                else {
                    options.callback(this.createMaxRedirectError());
                }
                return;
            }
            if (options.responseHandler == null) {
                configurePipes(options, response);
            }
            else {
                options.responseHandler(response, options.callback);
            }
        });
        this.addErrorAndTimeoutHandlers(request, options.callback, requestOptions.timeout);
        this.addRedirectHandlers(request, requestOptions, options.callback, redirectCount, requestOptions => {
            this.doDownload(requestOptions, options, redirectCount++);
        });
        request.end();
    }
    createMaxRedirectError() {
        return new Error(`Too many redirects (> ${this.maxRedirects})`);
    }
    addTimeOutHandler(request, callback, timeout) {
        request.on("socket", (socket) => {
            socket.setTimeout(timeout, () => {
                request.abort();
                callback(new Error("Request timed out"));
            });
        });
    }
    static prepareRedirectUrlOptions(redirectUrl, options) {
        const newOptions = configureRequestOptionsFromUrl(redirectUrl, { ...options });
        const headers = newOptions.headers;
        if (headers == null) {
            return newOptions;
        }
        const originalUrl = HttpExecutor.reconstructOriginalUrl(options);
        const parsedRedirectUrl = parseUrl(redirectUrl, options);
        if (HttpExecutor.isCrossOriginRedirect(originalUrl, parsedRedirectUrl)) {
            if (debug.enabled) {
                debug(`Cross-origin redirect (${originalUrl.host} â†’ ${parsedRedirectUrl.host}): stripping sensitive headers`);
            }
            for (const key of Object.keys(headers)) {
                if (SENSITIVE_REDIRECT_HEADERS.has(normalizeName(key))) {
                    delete headers[key];
                }
            }
        }
        return newOptions;
    }
    static reconstructOriginalUrl(options) {
        const protocol = options.protocol || "https:";
        if (!options.hostname) {
            throw new Error("Missing hostname in request options");
        }
        const hostname = options.hostname;
        const port = options.port ? `:${options.port}` : "";
        const path = options.path || "/";
        return new url_1.URL(`${protocol}//${hostname}${port}${path}`);
    }
    static isCrossOriginRedirect(originalUrl, redirectUrl) {
        // Case-insensitive hostname comparison
        if (originalUrl.hostname.toLowerCase() !== redirectUrl.hostname.toLowerCase()) {
            return true;
        }
        // Special case: allow http -> https redirect on same host with standard ports
        // This matches the behavior of Python requests library for backward compatibility
        // url.port returns an empty string if the port is omitted
        // or explicitly set to the default port for a given protocol.
        if (originalUrl.protocol === "http:" &&
            // This can be replaced with `!originalUrl.port`, but for the sake of clarity.
            ["80", ""].includes(originalUrl.port) &&
            redirectUrl.protocol === "https:" &&
            // This can be replaced with `!redirectUrl.port`, but for the sake of clarity.
            ["443", ""].includes(redirectUrl.port)) {
            return false;
        }
        // According to RFC 7235, a change in protocol or port constitutes a cross-origin request.
        // Forwarding authentication headers to a different origin can be a security risk.
        // For example, https://example.com:443 and http://example.com:80 are different origins.
        // We only make an exception for HTTP -> HTTPS upgrades on standard ports for backward compatibility.
        // Strip auth on any other protocol change
        if (originalUrl.protocol !== redirectUrl.protocol) {
            return true;
        }
        // Strip auth on port change (accounting for default ports)
        const originalPort = originalUrl.port;
        const redirectPort = redirectUrl.port;
        return originalPort !== redirectPort;
    }
    static async retryOnServerError(task, maxRetries = 3) {
        for (let attemptNumber = 0;; attemptNumber++) {
            try {
                return await task();
            }
            catch (e) {
                if (attemptNumber < maxRetries && ((e instanceof HttpError && e.isServerError()) || e.code === "EPIPE")) {
                    await new Promise(r => setTimeout(r, 1000 * (attemptNumber + 1)));
                    continue;
                }
                throw e;
            }
        }
    }
}
exports.HttpExecutor = HttpExecutor;
function parseUrl(url, options) {
    try {
        // Would throw exception if url is not absolute
        return new url_1.URL(url);
    }
    catch {
        // Relative URL - construct base URL from original options
        const hostname = options.hostname;
        const protocol = options.protocol || "https:";
        const port = options.port ? `:${options.port}` : "";
        const baseUrl = `${protocol}//${hostname}${port}`;
        return new url_1.URL(url, baseUrl);
    }
}
function configureRequestOptionsFromUrl(url, options) {
    const result = configureRequestOptions(options);
    const parsedUrl = parseUrl(url, options);
    configureRequestUrl(parsedUrl, result);
    return result;
}
function configureRequestUrl(url, options) {
    options.protocol = url.protocol;
    options.hostname = url.hostname;
    if (url.port) {
        options.port = url.port;
    }
    else if (options.port) {
        delete options.port;
    }
    options.path = url.pathname + url.search;
}
class DigestTransform extends stream_1.Transform {
    // noinspection JSUnusedGlobalSymbols
    get actual() {
        return this._actual;
    }
    constructor(expected, algorithm = "sha512", encoding = "base64") {
        super();
        this.expected = expected;
        this.algorithm = algorithm;
        this.encoding = encoding;
        this._actual = null;
        this.isValidateOnEnd = true;
        this.digester = (0, crypto_1.createHash)(algorithm);
    }
    // noinspection JSUnusedGlobalSymbols
    _transform(chunk, encoding, callback) {
        this.digester.update(chunk);
        callback(null, chunk);
    }
    // noinspection JSUnusedGlobalSymbols
    _flush(callback) {
        this._actual = this.digester.digest(this.encoding);
        if (this.isValidateOnEnd) {
            try {
                this.validate();
            }
            catch (e) {
                callback(e);
                return;
            }
        }
        callback(null);
    }
    validate() {
        if (this._actual == null) {
            throw (0, error_1.newError)("Not finished yet", "ERR_STREAM_NOT_FINISHED");
        }
        if (this._actual !== this.expected) {
            throw (0, error_1.newError)(`${this.algorithm} checksum mismatch, expected ${this.expected}, got ${this._actual}`, "ERR_CHECKSUM_MISMATCH");
        }
        return null;
    }
}
exports.DigestTransform = DigestTransform;
function checkSha2(sha2Header, sha2, callback) {
    if (sha2Header != null && sha2 != null && sha2Header !== sha2) {
        callback(new Error(`checksum mismatch: expected ${sha2} but got ${sha2Header} (X-Checksum-Sha2 header)`));
        return false;
    }
    return true;
}
function safeGetHeader(response, headerKey) {
    const value = response.headers[headerKey];
    if (value == null) {
        return null;
    }
    else if (Array.isArray(value)) {
        // electron API
        return value.length === 0 ? null : value[value.length - 1];
    }
    else {
        return value;
    }
}
function configurePipes(options, response) {
    if (!checkSha2(safeGetHeader(response, "X-Checksum-Sha2"), options.options.sha2, options.callback)) {
        return;
    }
    const streams = [];
    if (options.options.onProgress != null) {
        const contentLength = safeGetHeader(response, "content-length");
        if (contentLength != null) {
            streams.push(new ProgressCallbackTransform_1.ProgressCallbackTransform(parseInt(contentLength, 10), options.options.cancellationToken, options.options.onProgress));
        }
    }
    const sha512 = options.options.sha512;
    if (sha512 != null) {
        streams.push(new DigestTransform(sha512, "sha512", sha512.length === 128 && !sha512.includes("+") && !sha512.includes("Z") && !sha512.includes("=") ? "hex" : "base64"));
    }
    else if (options.options.sha2 != null) {
        streams.push(new DigestTransform(options.options.sha2, "sha256", "hex"));
    }
    const fileOut = (0, fs_1.createWriteStream)(options.destination);
    streams.push(fileOut);
    let lastStream = response;
    for (const stream of streams) {
        stream.on("error", (error) => {
            fileOut.close();
            if (!options.options.cancellationToken.cancelled) {
                options.callback(error);
            }
        });
        lastStream = lastStream.pipe(stream);
    }
    fileOut.on("finish", () => {
        ;
        fileOut.close(options.callback);
    });
}
function configureRequestOptions(options, token, method) {
    if (method != null) {
        options.method = method;
    }
    options.headers = { ...options.headers };
    const headers = options.headers;
    if (token != null) {
        ;
        headers.authorization = token.startsWith("Basic") || token.startsWith("Bearer") ? token : `token ${token}`;
    }
    if (headers["User-Agent"] == null) {
        headers["User-Agent"] = "electron-builder";
    }
    if (method == null || method === "GET" || headers["Cache-Control"] == null) {
        headers["Cache-Control"] = "no-cache";
    }
    // do not specify for node (in any case we use https module)
    if (options.protocol == null && process.versions.electron != null) {
        options.protocol = "https:";
    }
    return options;
}
function isSensitiveFieldName(name) {
    const normalized = normalizeName(name);
    return SENSITIVE_FIELD_PATTERNS.some(p => normalized.includes(p)) || SENSITIVE_FIELD_SUFFIXES.some(s => normalized.endsWith(s));
}
function hashSensitiveValue(value) {
    return `${(0, crypto_1.createHash)("sha256").update(value).digest("hex")} (sha256 hash)`;
}
function safeStringifyJson(data, skippedNames) {
    return JSON.stringify(data, (name, value) => {
        if (isSensitiveFieldName(name) || (skippedNames != null && skippedNames.has(name))) {
            return typeof value === "string" ? hashSensitiveValue(value) : "<stripped sensitive data>";
        }
        return value;
    }, 2);
}
//# sourceMappingURL=httpExecutor.js.map{"version":3,"file":"httpExecutor.js","sourceRoot":"","sources":["../src/httpExecutor.ts"],"names":[],"mappings":";;;AAoCA,gEAEC;AAOD,4DAEC;AAiBD,0CASC;AAmCD,8BAEC;AAoWD,wEAKC;AAED,kDASC;AAmED,sCAUC;AAyCD,0DAwBC;AAED,oDAGC;AAED,gDAEC;AAED,8CAWC;AAtoBD,mCAA+D;AAC/D,iCAA0B;AAC1B,2BAAsC;AAGtC,mCAAkC;AAClC,6BAAyB;AAEzB,2DAAuD;AACvD,mCAAkC;AAClC,2EAAqF;AAErF,MAAM,KAAK,GAAG,IAAA,eAAM,EAAC,kBAAkB,CAAC,CAAA;AAExC,gFAAgF;AAEhF,gFAAgF;AAChF,oEAAoE;AACpE,MAAM,aAAa,GAAG,CAAC,IAAY,EAAU,EAAE,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAA;AAEvF,qEAAqE;AACrE,8EAA8E;AAC9E,MAAM,0BAA0B,GAAG,IAAI,GAAG,CAAC,CAAC,eAAe,EAAE,oBAAoB,EAAE,cAAc,EAAE,SAAS,EAAE,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,QAAQ,EAAE,YAAY,CAAC,CAAC,CAAA;AAEpL,sFAAsF;AACtF,MAAM,wBAAwB,GAAa,CAAC,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,eAAe,EAAE,YAAY,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,CAAU,CAAA;AAElJ,qFAAqF;AACrF,oFAAoF;AACpF,mDAAmD;AACnD,MAAM,wBAAwB,GAAa,CAAC,KAAK,CAAU,CAAA;AAE3D;;;GAGG;AACH,SAAgB,0BAA0B,CAAC,MAAc;IACvD,0BAA0B,CAAC,GAAG,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,CAAA;AACvD,CAAC;AAED;;;;GAIG;AACH,SAAgB,wBAAwB,CAAC,OAAe;IACtD,wBAAwB,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAA;AAC3E,CAAC;AAiBD,SAAgB,eAAe,CAAC,QAAyB,EAAE,cAA0B,IAAI;IACvF,OAAO,IAAI,SAAS,CAClB,QAAQ,CAAC,UAAU,IAAI,CAAC,CAAC,EACzB,GAAG,QAAQ,CAAC,UAAU,IAAI,QAAQ,CAAC,aAAa,EAAE;QAChD,CAAC,WAAW,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,WAAW,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;QAC3E,aAAa;QACb,iBAAiB,CAAC,QAAQ,CAAC,OAAO,CAAC,EACrC,WAAW,CACZ,CAAA;AACH,CAAC;AAED,MAAM,iBAAiB,GAAG,IAAI,GAAG,CAAiB;IAChD,CAAC,GAAG,EAAE,mBAAmB,CAAC;IAC1B,CAAC,GAAG,EAAE,aAAa,CAAC;IACpB,CAAC,GAAG,EAAE,WAAW,CAAC;IAClB,CAAC,GAAG,EAAE,WAAW,CAAC;IAClB,CAAC,GAAG,EAAE,oBAAoB,CAAC;IAC3B,CAAC,GAAG,EAAE,gBAAgB,CAAC;IACvB,CAAC,GAAG,EAAE,iBAAiB,CAAC;IACxB,CAAC,GAAG,EAAE,0BAA0B,CAAC;IACjC,CAAC,GAAG,EAAE,uBAAuB,CAAC;IAC9B,CAAC,GAAG,EAAE,aAAa,CAAC;IACpB,CAAC,GAAG,EAAE,qBAAqB,CAAC;IAC5B,CAAC,GAAG,EAAE,iBAAiB,CAAC;IACxB,CAAC,GAAG,EAAE,4BAA4B,CAAC;CACpC,CAAC,CAAA;AAEF,MAAa,SAAU,SAAQ,KAAK;IAClC,YACW,UAAkB,EAC3B,OAAO,GAAG,eAAe,iBAAiB,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,UAAU,EAAE,EACjE,cAA0B,IAAI;QAEvC,KAAK,CAAC,OAAO,CAAC,CAAA;QAJL,eAAU,GAAV,UAAU,CAAQ;QAElB,gBAAW,GAAX,WAAW,CAAmB;QAIvC,IAAI,CAAC,IAAI,GAAG,WAAW,CACtB;QAAC,IAA8B,CAAC,IAAI,GAAG,cAAc,UAAU,EAAE,CAAA;IACpE,CAAC;IAED,aAAa;QACX,OAAO,IAAI,CAAC,UAAU,IAAI,GAAG,IAAI,IAAI,CAAC,UAAU,IAAI,GAAG,CAAA;IACzD,CAAC;CACF;AAfD,8BAeC;AAED,SAAgB,SAAS,CAAC,MAA8B;IACtD,OAAO,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,IAAI,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA;AACnF,CAAC;AAMD,MAAsB,YAAY;IAAlC;QACqB,iBAAY,GAAG,EAAE,CAAA;IAmUtC,CAAC;IAjUC,OAAO,CAAC,OAAuB,EAAE,oBAAuC,IAAI,qCAAiB,EAAE,EAAE,IAAqC;QACpI,uBAAuB,CAAC,OAAO,CAAC,CAAA;QAChC,MAAM,IAAI,GAAG,IAAI,IAAI,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAA;QAC5D,MAAM,WAAW,GAAG,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;QACxD,IAAI,WAAW,IAAI,IAAI,EAAE,CAAC;YACxB,IAAI,KAAK,CAAC,OAAO,EAAE,CAAC;gBAClB,KAAK,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAA;YAChC,CAAC;YACD,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,GAAG,OAAO,CAAA;YACpC,OAAO,GAAG;gBACR,MAAM,EAAE,MAAM;gBACd,OAAO,EAAE;oBACP,cAAc,EAAE,kBAAkB;oBAClC,gBAAgB,EAAE,WAAW,CAAC,MAAM;oBACpC,GAAG,OAAO;iBACX;gBACD,GAAG,IAAI;aACR,CAAA;QACH,CAAC;QACD,OAAO,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,iBAAiB,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAA;IACjF,CAAC;IAED,YAAY,CACV,OAAuB,EACvB,iBAAoC,EACpC,gBAAsE,EACtE,aAAa,GAAG,CAAC;QAEjB,IAAI,KAAK,CAAC,OAAO,EAAE,CAAC;YAClB,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,WAAW,EAAE,GAAG,OAAc,CAAA;YACzE,KAAK,CAAC,YAAY,iBAAiB,CAAC,WAAW,CAAC,EAAE,CAAC,CAAA;QACrD,CAAC;QAED,OAAO,iBAAiB,CAAC,aAAa,CAAS,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE;YAC3E,MAAM,OAAO,GAAG,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,CAAC,QAAa,EAAE,EAAE;gBAC5D,IAAI,CAAC;oBACH,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,OAAO,EAAE,iBAAiB,EAAE,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,gBAAgB,CAAC,CAAA;gBAC7G,CAAC;gBAAC,OAAO,CAAM,EAAE,CAAC;oBAChB,MAAM,CAAC,CAAC,CAAC,CAAA;gBACX,CAAC;YACH,CAAC,CAAC,CAAA;YACF,IAAI,CAAC,0BAA0B,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC,CAAA;YACjE,IAAI,CAAC,mBAAmB,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,OAAO,CAAC,EAAE;gBAC1E,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,aAAa,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA;YAC5G,CAAC,CAAC,CAAA;YACF,gBAAgB,CAAC,OAAO,EAAE,MAAM,CAAC,CAAA;YACjC,QAAQ,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC,CAAA;QACjC,CAAC,CAAC,CAAA;IACJ,CAAC;IAED,oCAAoC;IACpC,2BAA2B;IACjB,mBAAmB,CAAC,OAAY,EAAE,OAAuB,EAAE,MAA8B,EAAE,aAAqB,EAAE,OAA0C;QACpK,0BAA0B;IAC5B,CAAC;IAED,0BAA0B,CAAC,OAAY,EAAE,MAA8B,EAAE,OAAO,GAAG,EAAE,GAAG,IAAI;QAC1F,IAAI,CAAC,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,CAAA;QAChD,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,CAAA;QAC3B,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,GAAG,EAAE;YACzB,MAAM,CAAC,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC,CAAA;QAC7D,CAAC,CAAC,CAAA;IACJ,CAAC;IAEO,cAAc,CACpB,QAAyB,EACzB,OAAuB,EACvB,iBAAoC,EACpC,OAA6B,EAC7B,MAA8B,EAC9B,aAAqB,EACrB,gBAAsE;;QAEtE,IAAI,KAAK,CAAC,OAAO,EAAE,CAAC;YAClB,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,WAAW,EAAE,GAAG,OAAc,CAAA;YACzE,KAAK,CAAC,aAAa,QAAQ,CAAC,UAAU,IAAI,QAAQ,CAAC,aAAa,sBAAsB,iBAAiB,CAAC,WAAW,CAAC,EAAE,CAAC,CAAA;QACzH,CAAC;QAED,+FAA+F;QAC/F,IAAI,QAAQ,CAAC,UAAU,KAAK,GAAG,EAAE,CAAC;YAChC,mEAAmE;YACnE,MAAM,CACJ,eAAe,CACb,QAAQ,EACR,WAAW,OAAO,CAAC,MAAM,IAAI,KAAK,SAAS,OAAO,CAAC,QAAQ,IAAI,QAAQ,KAAK,OAAO,CAAC,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,GAAG,OAAO,CAAC,IAAI;;;CAG7J,CACQ,CACF,CAAA;YACD,OAAM;QACR,CAAC;aAAM,IAAI,QAAQ,CAAC,UAAU,KAAK,GAAG,EAAE,CAAC;YACvC,oBAAoB;YACpB,OAAO,EAAE,CAAA;YACT,OAAM;QACR,CAAC;QAED,MAAM,IAAI,GAAG,MAAA,QAAQ,CAAC,UAAU,mCAAI,CAAC,CAAA;QACrC,MAAM,cAAc,GAAG,IAAI,IAAI,GAAG,IAAI,IAAI,GAAG,GAAG,CAAA;QAChD,MAAM,WAAW,GAAG,aAAa,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAA;QACvD,IAAI,cAAc,IAAI,WAAW,IAAI,IAAI,EAAE,CAAC;YAC1C,IAAI,aAAa,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC;gBACtC,MAAM,CAAC,IAAI,CAAC,sBAAsB,EAAE,CAAC,CAAA;gBACrC,OAAM;YACR,CAAC;YAED,IAAI,CAAC,YAAY,CAAC,YAAY,CAAC,yBAAyB,CAAC,WAAW,EAAE,OAAO,CAAC,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,aAAa,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA;YAC/J,OAAM;QACR,CAAC;QAED,QAAQ,CAAC,WAAW,CAAC,MAAM,CAAC,CAAA;QAE5B,IAAI,IAAI,GAAG,EAAE,CAAA;QACb,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,CAAA;QAC5B,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,KAAa,EAAE,EAAE,CAAC,CAAC,IAAI,IAAI,KAAK,CAAC,CAAC,CAAA;QACvD,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE;YACtB,IAAI,CAAC;gBACH,IAAI,QAAQ,CAAC,UAAU,IAAI,IAAI,IAAI,QAAQ,CAAC,UAAU,IAAI,GAAG,EAAE,CAAC;oBAC9D,MAAM,WAAW,GAAG,aAAa,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAA;oBAC3D,MAAM,MAAM,GAAG,WAAW,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,WAAW,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAA;oBACvJ,MAAM,CACJ,eAAe,CACb,QAAQ,EACR,WAAW,OAAO,CAAC,MAAM,IAAI,KAAK,SAAS,OAAO,CAAC,QAAQ,IAAI,QAAQ,KAAK,OAAO,CAAC,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,GAAG,OAAO,CAAC,IAAI;;;YAGtJ,MAAM,CAAC,CAAC,CAAC,iBAAiB,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI;WACpD,CACE,CACF,CAAA;gBACH,CAAC;qBAAM,CAAC;oBACN,OAAO,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAA;gBAC1C,CAAC;YACH,CAAC;YAAC,OAAO,CAAM,EAAE,CAAC;gBAChB,MAAM,CAAC,CAAC,CAAC,CAAA;YACX,CAAC;QACH,CAAC,CAAC,CAAA;IACJ,CAAC;IAKD,KAAK,CAAC,gBAAgB,CAAC,GAAQ,EAAE,OAAwB;QACvD,OAAO,MAAM,OAAO,CAAC,iBAAiB,CAAC,aAAa,CAAS,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE;YACzF,MAAM,cAAc,GAAa,EAAE,CAAA;YACnC,MAAM,cAAc,GAAG;gBACrB,OAAO,EAAE,OAAO,CAAC,OAAO,IAAI,SAAS;gBACrC,wHAAwH;gBACxH,QAAQ,EAAE,QAAQ;aACnB,CAAA;YACD,mBAAmB,CAAC,GAAG,EAAE,cAAc,CAAC,CAAA;YACxC,uBAAuB,CAAC,cAAc,CAAC,CAAA;YACvC,IAAI,CAAC,UAAU,CACb,cAAc,EACd;gBACE,WAAW,EAAE,IAAI;gBACjB,OAAO;gBACP,QAAQ;gBACR,QAAQ,EAAE,KAAK,CAAC,EAAE;oBAChB,IAAI,KAAK,IAAI,IAAI,EAAE,CAAC;wBAClB,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,CAAA;oBACxC,CAAC;yBAAM,CAAC;wBACN,MAAM,CAAC,KAAK,CAAC,CAAA;oBACf,CAAC;gBACH,CAAC;gBACD,eAAe,EAAE,CAAC,QAAQ,EAAE,QAAQ,EAAE,EAAE;oBACtC,IAAI,cAAc,GAAG,CAAC,CAAA;oBACtB,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,KAAa,EAAE,EAAE;wBACpC,cAAc,IAAI,KAAK,CAAC,MAAM,CAAA;wBAC9B,IAAI,cAAc,GAAG,SAAS,EAAE,CAAC;4BAC/B,QAAQ,CAAC,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAC,CAAA;4BACrD,OAAM;wBACR,CAAC;wBACD,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;oBAC5B,CAAC,CAAC,CAAA;oBACF,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE;wBACtB,QAAQ,CAAC,IAAI,CAAC,CAAA;oBAChB,CAAC,CAAC,CAAA;gBACJ,CAAC;aACF,EACD,CAAC,CACF,CAAA;QACH,CAAC,CAAC,CAAA;IACJ,CAAC;IAES,UAAU,CAAC,cAA8B,EAAE,OAA4B,EAAE,aAAqB;QACtG,MAAM,OAAO,GAAG,IAAI,CAAC,aAAa,CAAC,cAAc,EAAE,CAAC,QAAyB,EAAE,EAAE;YAC/E,IAAI,QAAQ,CAAC,UAAW,IAAI,GAAG,EAAE,CAAC;gBAChC,OAAO,CAAC,QAAQ,CACd,IAAI,KAAK,CACP,oBAAoB,cAAc,CAAC,QAAQ,IAAI,QAAQ,KAAK,cAAc,CAAC,QAAQ,GAAG,cAAc,CAAC,IAAI,aAAa,QAAQ,CAAC,UAAU,KAAK,QAAQ,CAAC,aAAa,EAAE,CACvK,CACF,CAAA;gBACD,OAAM;YACR,CAAC;YAED,oFAAoF;YACpF,2FAA2F;YAC3F,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAA;YAEtC,uEAAuE;YACvE,MAAM,WAAW,GAAG,aAAa,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAA;YACvD,IAAI,WAAW,IAAI,IAAI,EAAE,CAAC;gBACxB,IAAI,aAAa,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC;oBACtC,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,yBAAyB,CAAC,WAAW,EAAE,cAAc,CAAC,EAAE,OAAO,EAAE,aAAa,EAAE,CAAC,CAAA;gBAChH,CAAC;qBAAM,CAAC;oBACN,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,sBAAsB,EAAE,CAAC,CAAA;gBACjD,CAAC;gBACD,OAAM;YACR,CAAC;YAED,IAAI,OAAO,CAAC,eAAe,IAAI,IAAI,EAAE,CAAC;gBACpC,cAAc,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAA;YACnC,CAAC;iBAAM,CAAC;gBACN,OAAO,CAAC,eAAe,CAAC,QAAQ,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAA;YACrD,CAAC;QACH,CAAC,CAAC,CAAA;QACF,IAAI,CAAC,0BAA0B,CAAC,OAAO,EAAE,OAAO,CAAC,QAAQ,EAAE,cAAc,CAAC,OAAO,CAAC,CAAA;QAClF,IAAI,CAAC,mBAAmB,CAAC,OAAO,EAAE,cAAc,EAAE,OAAO,CAAC,QAAQ,EAAE,aAAa,EAAE,cAAc,CAAC,EAAE;YAClG,IAAI,CAAC,UAAU,CAAC,cAAc,EAAE,OAAO,EAAE,aAAa,EAAE,CAAC,CAAA;QAC3D,CAAC,CAAC,CAAA;QACF,OAAO,CAAC,GAAG,EAAE,CAAA;IACf,CAAC;IAES,sBAAsB;QAC9B,OAAO,IAAI,KAAK,CAAC,yBAAyB,IAAI,CAAC,YAAY,GAAG,CAAC,CAAA;IACjE,CAAC;IAEO,iBAAiB,CAAC,OAAY,EAAE,QAAgC,EAAE,OAAe;QACvF,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,CAAC,MAAc,EAAE,EAAE;YACtC,MAAM,CAAC,UAAU,CAAC,OAAO,EAAE,GAAG,EAAE;gBAC9B,OAAO,CAAC,KAAK,EAAE,CAAA;gBACf,QAAQ,CAAC,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC,CAAA;YAC1C,CAAC,CAAC,CAAA;QACJ,CAAC,CAAC,CAAA;IACJ,CAAC;IAED,MAAM,CAAC,yBAAyB,CAAC,WAAmB,EAAE,OAAuB;QAC3E,MAAM,UAAU,GAAG,8BAA8B,CAAC,WAAW,EAAE,EAAE,GAAG,OAAO,EAAE,CAAC,CAAA;QAC9E,MAAM,OAAO,GAAG,UAAU,CAAC,OAAO,CAAA;QAClC,IAAI,OAAO,IAAI,IAAI,EAAE,CAAC;YACpB,OAAO,UAAU,CAAA;QACnB,CAAC;QAED,MAAM,WAAW,GAAG,YAAY,CAAC,sBAAsB,CAAC,OAAO,CAAC,CAAA;QAChE,MAAM,iBAAiB,GAAG,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC,CAAA;QAExD,IAAI,YAAY,CAAC,qBAAqB,CAAC,WAAW,EAAE,iBAAiB,CAAC,EAAE,CAAC;YACvE,IAAI,KAAK,CAAC,OAAO,EAAE,CAAC;gBAClB,KAAK,CAAC,0BAA0B,WAAW,CAAC,IAAI,MAAM,iBAAiB,CAAC,IAAI,gCAAgC,CAAC,CAAA;YAC/G,CAAC;YACD,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;gBACvC,IAAI,0BAA0B,CAAC,GAAG,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;oBACvD,OAAQ,OAAmC,CAAC,GAAG,CAAC,CAAA;gBAClD,CAAC;YACH,CAAC;QACH,CAAC;QACD,OAAO,UAAU,CAAA;IACnB,CAAC;IAEO,MAAM,CAAC,sBAAsB,CAAC,OAAuB;QAC3D,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,IAAI,QAAQ,CAAA;QAC7C,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC;YACtB,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAA;QACxD,CAAC;QACD,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAA;QACjC,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAA;QACnD,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,IAAI,GAAG,CAAA;QAChC,OAAO,IAAI,SAAG,CAAC,GAAG,QAAQ,KAAK,QAAQ,GAAG,IAAI,GAAG,IAAI,EAAE,CAAC,CAAA;IAC1D,CAAC;IAEO,MAAM,CAAC,qBAAqB,CAAC,WAAgB,EAAE,WAAgB;QACrE,uCAAuC;QACvC,IAAI,WAAW,CAAC,QAAQ,CAAC,WAAW,EAAE,KAAK,WAAW,CAAC,QAAQ,CAAC,WAAW,EAAE,EAAE,CAAC;YAC9E,OAAO,IAAI,CAAA;QACb,CAAC;QAED,8EAA8E;QAC9E,kFAAkF;QAClF,0DAA0D;QAC1D,8DAA8D;QAC9D,IACE,WAAW,CAAC,QAAQ,KAAK,OAAO;YAChC,8EAA8E;YAC9E,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,CAAC;YACrC,WAAW,CAAC,QAAQ,KAAK,QAAQ;YACjC,8EAA8E;YAC9E,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,CAAC,EACtC,CAAC;YACD,OAAO,KAAK,CAAA;QACd,CAAC;QAED,0FAA0F;QAC1F,kFAAkF;QAClF,wFAAwF;QACxF,qGAAqG;QAErG,0CAA0C;QAC1C,IAAI,WAAW,CAAC,QAAQ,KAAK,WAAW,CAAC,QAAQ,EAAE,CAAC;YAClD,OAAO,IAAI,CAAA;QACb,CAAC;QAED,2DAA2D;QAC3D,MAAM,YAAY,GAAG,WAAW,CAAC,IAAI,CAAA;QACrC,MAAM,YAAY,GAAG,WAAW,CAAC,IAAI,CAAA;QACrC,OAAO,YAAY,KAAK,YAAY,CAAA;IACtC,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,kBAAkB,CAAC,IAAwB,EAAE,UAAU,GAAG,CAAC;QACtE,KAAK,IAAI,aAAa,GAAG,CAAC,GAAI,aAAa,EAAE,EAAE,CAAC;YAC9C,IAAI,CAAC;gBACH,OAAO,MAAM,IAAI,EAAE,CAAA;YACrB,CAAC;YAAC,OAAO,CAAM,EAAE,CAAC;gBAChB,IAAI,aAAa,GAAG,UAAU,IAAI,CAAC,CAAC,CAAC,YAAY,SAAS,IAAI,CAAC,CAAC,aAAa,EAAE,CAAC,IAAI,CAAC,CAAC,IAAI,KAAK,OAAO,CAAC,EAAE,CAAC;oBACxG,MAAM,IAAI,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,EAAE,IAAI,GAAG,CAAC,aAAa,GAAG,CAAC,CAAC,CAAC,CAAC,CAAA;oBACjE,SAAQ;gBACV,CAAC;gBACD,MAAM,CAAC,CAAA;YACT,CAAC;QACH,CAAC;IACH,CAAC;CACF;AApUD,oCAoUC;AAYD,SAAS,QAAQ,CAAC,GAAW,EAAE,OAAuB;IACpD,IAAI,CAAC;QACH,+CAA+C;QAC/C,OAAO,IAAI,SAAG,CAAC,GAAG,CAAC,CAAA;IACrB,CAAC;IAAC,MAAM,CAAC;QACP,0DAA0D;QAC1D,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAA;QACjC,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,IAAI,QAAQ,CAAA;QAC7C,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAA;QACnD,MAAM,OAAO,GAAG,GAAG,QAAQ,KAAK,QAAQ,GAAG,IAAI,EAAE,CAAA;QACjD,OAAO,IAAI,SAAG,CAAC,GAAG,EAAE,OAAO,CAAC,CAAA;IAC9B,CAAC;AACH,CAAC;AAED,SAAgB,8BAA8B,CAAC,GAAW,EAAE,OAAuB;IACjF,MAAM,MAAM,GAAG,uBAAuB,CAAC,OAAO,CAAC,CAAA;IAC/C,MAAM,SAAS,GAAG,QAAQ,CAAC,GAAG,EAAE,OAAO,CAAC,CAAA;IACxC,mBAAmB,CAAC,SAAS,EAAE,MAAM,CAAC,CAAA;IACtC,OAAO,MAAM,CAAA;AACf,CAAC;AAED,SAAgB,mBAAmB,CAAC,GAAQ,EAAE,OAAuB;IACnE,OAAO,CAAC,QAAQ,GAAG,GAAG,CAAC,QAAQ,CAAA;IAC/B,OAAO,CAAC,QAAQ,GAAG,GAAG,CAAC,QAAQ,CAAA;IAC/B,IAAI,GAAG,CAAC,IAAI,EAAE,CAAC;QACb,OAAO,CAAC,IAAI,GAAG,GAAG,CAAC,IAAI,CAAA;IACzB,CAAC;SAAM,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;QACxB,OAAO,OAAO,CAAC,IAAI,CAAA;IACrB,CAAC;IACD,OAAO,CAAC,IAAI,GAAG,GAAG,CAAC,QAAQ,GAAG,GAAG,CAAC,MAAM,CAAA;AAC1C,CAAC;AAED,MAAa,eAAgB,SAAQ,kBAAS;IAK5C,qCAAqC;IACrC,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,OAAO,CAAA;IACrB,CAAC;IAID,YACW,QAAgB,EACR,YAAoB,QAAQ,EAC5B,WAAiC,QAAQ;QAE1D,KAAK,EAAE,CAAA;QAJE,aAAQ,GAAR,QAAQ,CAAQ;QACR,cAAS,GAAT,SAAS,CAAmB;QAC5B,aAAQ,GAAR,QAAQ,CAAiC;QAZpD,YAAO,GAAkB,IAAI,CAAA;QAOrC,oBAAe,GAAG,IAAI,CAAA;QASpB,IAAI,CAAC,QAAQ,GAAG,IAAA,mBAAU,EAAC,SAAS,CAAC,CAAA;IACvC,CAAC;IAED,qCAAqC;IACrC,UAAU,CAAC,KAAa,EAAE,QAAgB,EAAE,QAAa;QACvD,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;QAC3B,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;IACvB,CAAC;IAED,qCAAqC;IACrC,MAAM,CAAC,QAAa;QAClB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;QAElD,IAAI,IAAI,CAAC,eAAe,EAAE,CAAC;YACzB,IAAI,CAAC;gBACH,IAAI,CAAC,QAAQ,EAAE,CAAA;YACjB,CAAC;YAAC,OAAO,CAAM,EAAE,CAAC;gBAChB,QAAQ,CAAC,CAAC,CAAC,CAAA;gBACX,OAAM;YACR,CAAC;QACH,CAAC;QAED,QAAQ,CAAC,IAAI,CAAC,CAAA;IAChB,CAAC;IAED,QAAQ;QACN,IAAI,IAAI,CAAC,OAAO,IAAI,IAAI,EAAE,CAAC;YACzB,MAAM,IAAA,gBAAQ,EAAC,kBAAkB,EAAE,yBAAyB,CAAC,CAAA;QAC/D,CAAC;QAED,IAAI,IAAI,CAAC,OAAO,KAAK,IAAI,CAAC,QAAQ,EAAE,CAAC;YACnC,MAAM,IAAA,gBAAQ,EAAC,GAAG,IAAI,CAAC,SAAS,gCAAgC,IAAI,CAAC,QAAQ,SAAS,IAAI,CAAC,OAAO,EAAE,EAAE,uBAAuB,CAAC,CAAA;QAChI,CAAC;QAED,OAAO,IAAI,CAAA;IACb,CAAC;CACF;AAvDD,0CAuDC;AAED,SAAS,SAAS,CAAC,UAA4B,EAAE,IAAsB,EAAE,QAAuC;IAC9G,IAAI,UAAU,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,UAAU,KAAK,IAAI,EAAE,CAAC;QAC9D,QAAQ,CAAC,IAAI,KAAK,CAAC,+BAA+B,IAAI,YAAY,UAAU,2BAA2B,CAAC,CAAC,CAAA;QACzG,OAAO,KAAK,CAAA;IACd,CAAC;IACD,OAAO,IAAI,CAAA;AACb,CAAC;AAED,SAAgB,aAAa,CAAC,QAAa,EAAE,SAAiB;IAC5D,MAAM,KAAK,GAAG,QAAQ,CAAC,OAAO,CAAC,SAAS,CAAC,CAAA;IACzC,IAAI,KAAK,IAAI,IAAI,EAAE,CAAC;QAClB,OAAO,IAAI,CAAA;IACb,CAAC;SAAM,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QAChC,eAAe;QACf,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAA;IAC5D,CAAC;SAAM,CAAC;QACN,OAAO,KAAK,CAAA;IACd,CAAC;AACH,CAAC;AAED,SAAS,cAAc,CAAC,OAA4B,EAAE,QAAyB;IAC7E,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,QAAQ,EAAE,iBAAiB,CAAC,EAAE,OAAO,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;QACnG,OAAM;IACR,CAAC;IAED,MAAM,OAAO,GAAe,EAAE,CAAA;IAC9B,IAAI,OAAO,CAAC,OAAO,CAAC,UAAU,IAAI,IAAI,EAAE,CAAC;QACvC,MAAM,aAAa,GAAG,aAAa,CAAC,QAAQ,EAAE,gBAAgB,CAAC,CAAA;QAC/D,IAAI,aAAa,IAAI,IAAI,EAAE,CAAC;YAC1B,OAAO,CAAC,IAAI,CAAC,IAAI,qDAAyB,CAAC,QAAQ,CAAC,aAAa,EAAE,EAAE,CAAC,EAAE,OAAO,CAAC,OAAO,CAAC,iBAAiB,EAAE,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAA;QACzI,CAAC;IACH,CAAC;IAED,MAAM,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,CAAA;IACrC,IAAI,MAAM,IAAI,IAAI,EAAE,CAAC;QACnB,OAAO,CAAC,IAAI,CAAC,IAAI,eAAe,CAAC,MAAM,EAAE,QAAQ,EAAE,MAAM,CAAC,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAA;IAC1K,CAAC;SAAM,IAAI,OAAO,CAAC,OAAO,CAAC,IAAI,IAAI,IAAI,EAAE,CAAC;QACxC,OAAO,CAAC,IAAI,CAAC,IAAI,eAAe,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAA;IAC1E,CAAC;IAED,MAAM,OAAO,GAAG,IAAA,sBAAiB,EAAC,OAAO,CAAC,WAAY,CAAC,CAAA;IACvD,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;IAErB,IAAI,UAAU,GAAG,QAAQ,CAAA;IACzB,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;QAC7B,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,KAAY,EAAE,EAAE;YAClC,OAAO,CAAC,KAAK,EAAE,CAAA;YACf,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,iBAAiB,CAAC,SAAS,EAAE,CAAC;gBACjD,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAA;YACzB,CAAC;QACH,CAAC,CAAC,CAAA;QACF,UAAU,GAAG,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;IACtC,CAAC;IAED,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,GAAG,EAAE;QACxB,CAAC;QAAC,OAAO,CAAC,KAAa,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAA;IAC3C,CAAC,CAAC,CAAA;AACJ,CAAC;AAED,SAAgB,uBAAuB,CAAC,OAAuB,EAAE,KAAqB,EAAE,MAA0C;IAChI,IAAI,MAAM,IAAI,IAAI,EAAE,CAAC;QACnB,OAAO,CAAC,MAAM,GAAG,MAAM,CAAA;IACzB,CAAC;IAED,OAAO,CAAC,OAAO,GAAG,EAAE,GAAG,OAAO,CAAC,OAAO,EAAE,CAAA;IACxC,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAA;IAE/B,IAAI,KAAK,IAAI,IAAI,EAAE,CAAC;QAClB,CAAC;QAAC,OAAe,CAAC,aAAa,GAAG,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,KAAK,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,KAAK,EAAE,CAAA;IACtH,CAAC;IACD,IAAI,OAAO,CAAC,YAAY,CAAC,IAAI,IAAI,EAAE,CAAC;QAClC,OAAO,CAAC,YAAY,CAAC,GAAG,kBAAkB,CAAA;IAC5C,CAAC;IAED,IAAI,MAAM,IAAI,IAAI,IAAI,MAAM,KAAK,KAAK,IAAI,OAAO,CAAC,eAAe,CAAC,IAAI,IAAI,EAAE,CAAC;QAC3E,OAAO,CAAC,eAAe,CAAC,GAAG,UAAU,CAAA;IACvC,CAAC;IAED,4DAA4D;IAC5D,IAAI,OAAO,CAAC,QAAQ,IAAI,IAAI,IAAK,OAAO,CAAC,QAAgB,CAAC,QAAQ,IAAI,IAAI,EAAE,CAAC;QAC3E,OAAO,CAAC,QAAQ,GAAG,QAAQ,CAAA;IAC7B,CAAC;IACD,OAAO,OAAO,CAAA;AAChB,CAAC;AAED,SAAgB,oBAAoB,CAAC,IAAY;IAC/C,MAAM,UAAU,GAAG,aAAa,CAAC,IAAI,CAAC,CAAA;IACtC,OAAO,wBAAwB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,wBAAwB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAA;AACjI,CAAC;AAED,SAAgB,kBAAkB,CAAC,KAAa;IAC9C,OAAO,GAAG,IAAA,mBAAU,EAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,gBAAgB,CAAA;AAC5E,CAAC;AAED,SAAgB,iBAAiB,CAAC,IAAS,EAAE,YAA0B;IACrE,OAAO,IAAI,CAAC,SAAS,CACnB,IAAI,EACJ,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;QACd,IAAI,oBAAoB,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,IAAI,IAAI,IAAI,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC;YACnF,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,2BAA2B,CAAA;QAC5F,CAAC;QACD,OAAO,KAAK,CAAA;IACd,CAAC,EACD,CAAC,CACF,CAAA;AACH,CAAC","sourcesContent":["import { BinaryToTextEncoding, createHash, Hash } from \"crypto\"\nimport _debug from \"debug\"\nimport { createWriteStream } from \"fs\"\nimport { IncomingMessage, OutgoingHttpHeader, OutgoingHttpHeaders, RequestOptions } from \"http\"\nimport { Socket } from \"net\"\nimport { Transform } from \"stream\"\nimport { URL } from \"url\"\nimport { Nullish } from \".\"\nimport { CancellationToken } from \"./CancellationToken\"\nimport { newError } from \"./error\"\nimport { ProgressCallbackTransform, ProgressInfo } from \"./ProgressCallbackTransform\"\n\nconst debug = _debug(\"electron-builder\")\n\n// â”€â”€ Sensitive-data registries â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€\n\n// Normalise a header or field name: lowercase + strip all separators (- and _).\n// Shared by both registries so lookup is always separator-agnostic.\nconst normalizeName = (name: string): string => name.toLowerCase().replace(/[-_]/g, \"\")\n\n// HTTP header names (normalised) stripped on cross-origin redirects.\n// Stored normalised; lookup normalises the incoming key with normalizeName().\nconst SENSITIVE_REDIRECT_HEADERS = new Set([\"authorization\", \"proxyauthorization\", \"privatetoken\", \"xapikey\", \"xauthtoken\", \"xaccesstoken\", \"xgitlabtoken\", \"cookie\", \"xcsrftoken\"])\n\n// Substrings: a field name containing any of these (after normalization) is redacted.\nconst SENSITIVE_FIELD_PATTERNS: string[] = [\"token\", \"password\", \"secret\", \"authorization\", \"credential\", \"apikey\", \"passphrase\", \"auth\"] as const\n\n// Suffixes: a field name ending with any of these (after normalization) is redacted.\n// Intentionally greedy â€” \"publicKey\" is also stripped; over-stripping debug logs is\n// acceptable, under-stripping a credential is not.\nconst SENSITIVE_FIELD_SUFFIXES: string[] = [\"key\"] as const\n\n/**\n * Register an additional HTTP header to strip on cross-origin redirects.\n * Intended for custom publishers (e.g. GenericPublisher with a non-standard auth header).\n */\nexport function addSensitiveRedirectHeader(header: string): void {\n  SENSITIVE_REDIRECT_HEADERS.add(normalizeName(header))\n}\n\n/**\n * Register an additional substring pattern used by {@link safeStringifyJson} to\n * identify sensitive field names. Input is normalized (lowercased, separators stripped).\n * Intended for custom publishers that store credentials under non-standard field names.\n */\nexport function addSensitiveFieldPattern(pattern: string): void {\n  SENSITIVE_FIELD_PATTERNS.push(pattern.toLowerCase().replace(/[-_]/g, \"\"))\n}\n\nexport interface RequestHeaders extends OutgoingHttpHeaders {\n  [key: string]: OutgoingHttpHeader | undefined\n}\n\nexport interface DownloadOptions {\n  readonly headers?: OutgoingHttpHeaders | null\n  readonly sha2?: string | null\n  readonly sha512?: string | null\n\n  readonly cancellationToken: CancellationToken\n\n  // noinspection JSUnusedLocalSymbols\n  onProgress?: (progress: ProgressInfo) => void\n}\n\nexport function createHttpError(response: IncomingMessage, description: any | null = null) {\n  return new HttpError(\n    response.statusCode || -1,\n    `${response.statusCode} ${response.statusMessage}` +\n      (description == null ? \"\" : \"\\n\" + JSON.stringify(description, null, \"  \")) +\n      \"\\nHeaders: \" +\n      safeStringifyJson(response.headers),\n    description\n  )\n}\n\nconst HTTP_STATUS_CODES = new Map<number, string>([\n  [429, \"Too many requests\"],\n  [400, \"Bad request\"],\n  [403, \"Forbidden\"],\n  [404, \"Not found\"],\n  [405, \"Method not allowed\"],\n  [406, \"Not acceptable\"],\n  [408, \"Request timeout\"],\n  [413, \"Request entity too large\"],\n  [500, \"Internal server error\"],\n  [502, \"Bad gateway\"],\n  [503, \"Service unavailable\"],\n  [504, \"Gateway timeout\"],\n  [505, \"HTTP version not supported\"],\n])\n\nexport class HttpError extends Error {\n  constructor(\n    readonly statusCode: number,\n    message = `HTTP error: ${HTTP_STATUS_CODES.get(statusCode) || statusCode}`,\n    readonly description: any | null = null\n  ) {\n    super(message)\n\n    this.name = \"HttpError\"\n    ;(this as NodeJS.ErrnoException).code = `HTTP_ERROR_${statusCode}`\n  }\n\n  isServerError() {\n    return this.statusCode >= 500 && this.statusCode <= 599\n  }\n}\n\nexport function parseJson(result: Promise<string | null>) {\n  return result.then(it => (it == null || it.length === 0 ? null : JSON.parse(it)))\n}\n\ninterface Request {\n  abort: () => void\n  end: (data?: Buffer) => void\n}\nexport abstract class HttpExecutor<T extends Request> {\n  protected readonly maxRedirects = 10\n\n  request(options: RequestOptions, cancellationToken: CancellationToken = new CancellationToken(), data?: { [name: string]: any } | null): Promise<string | null> {\n    configureRequestOptions(options)\n    const json = data == null ? undefined : JSON.stringify(data)\n    const encodedData = json ? Buffer.from(json) : undefined\n    if (encodedData != null) {\n      if (debug.enabled) {\n        debug(safeStringifyJson(data))\n      }\n      const { headers, ...opts } = options\n      options = {\n        method: \"post\",\n        headers: {\n          \"Content-Type\": \"application/json\",\n          \"Content-Length\": encodedData.length,\n          ...headers,\n        },\n        ...opts,\n      }\n    }\n    return this.doApiRequest(options, cancellationToken, it => it.end(encodedData))\n  }\n\n  doApiRequest(\n    options: RequestOptions,\n    cancellationToken: CancellationToken,\n    requestProcessor: (request: T, reject: (error: Error) => void) => void,\n    redirectCount = 0\n  ): Promise<string> {\n    if (debug.enabled) {\n      const { headers: _headers, auth: _auth, ...safeOptions } = options as any\n      debug(`Request: ${safeStringifyJson(safeOptions)}`)\n    }\n\n    return cancellationToken.createPromise<string>((resolve, reject, onCancel) => {\n      const request = this.createRequest(options, (response: any) => {\n        try {\n          this.handleResponse(response, options, cancellationToken, resolve, reject, redirectCount, requestProcessor)\n        } catch (e: any) {\n          reject(e)\n        }\n      })\n      this.addErrorAndTimeoutHandlers(request, reject, options.timeout)\n      this.addRedirectHandlers(request, options, reject, redirectCount, options => {\n        this.doApiRequest(options, cancellationToken, requestProcessor, redirectCount).then(resolve).catch(reject)\n      })\n      requestProcessor(request, reject)\n      onCancel(() => request.abort())\n    })\n  }\n\n  // noinspection JSUnusedLocalSymbols\n  // eslint-disable-next-line\n  protected addRedirectHandlers(request: any, options: RequestOptions, reject: (error: Error) => void, redirectCount: number, handler: (options: RequestOptions) => void) {\n    // not required for NodeJS\n  }\n\n  addErrorAndTimeoutHandlers(request: any, reject: (error: Error) => void, timeout = 60 * 1000) {\n    this.addTimeOutHandler(request, reject, timeout)\n    request.on(\"error\", reject)\n    request.on(\"aborted\", () => {\n      reject(new Error(\"Request has been aborted by the server\"))\n    })\n  }\n\n  private handleResponse(\n    response: IncomingMessage,\n    options: RequestOptions,\n    cancellationToken: CancellationToken,\n    resolve: (data?: any) => void,\n    reject: (error: Error) => void,\n    redirectCount: number,\n    requestProcessor: (request: T, reject: (error: Error) => void) => void\n  ) {\n    if (debug.enabled) {\n      const { headers: _headers, auth: _auth, ...safeOptions } = options as any\n      debug(`Response: ${response.statusCode} ${response.statusMessage}, request options: ${safeStringifyJson(safeOptions)}`)\n    }\n\n    // we handle any other >= 400 error on request end (read detailed message in the response body)\n    if (response.statusCode === 404) {\n      // error is clear, we don't need to read detailed error description\n      reject(\n        createHttpError(\n          response,\n          `method: ${options.method || \"GET\"} url: ${options.protocol || \"https:\"}//${options.hostname}${options.port ? `:${options.port}` : \"\"}${options.path}\n\nPlease double check that your authentication token is correct. Due to security reasons, actual status maybe not reported, but 404.\n`\n        )\n      )\n      return\n    } else if (response.statusCode === 204) {\n      // on DELETE request\n      resolve()\n      return\n    }\n\n    const code = response.statusCode ?? 0\n    const shouldRedirect = code >= 300 && code < 400\n    const redirectUrl = safeGetHeader(response, \"location\")\n    if (shouldRedirect && redirectUrl != null) {\n      if (redirectCount > this.maxRedirects) {\n        reject(this.createMaxRedirectError())\n        return\n      }\n\n      this.doApiRequest(HttpExecutor.prepareRedirectUrlOptions(redirectUrl, options), cancellationToken, requestProcessor, redirectCount).then(resolve).catch(reject)\n      return\n    }\n\n    response.setEncoding(\"utf8\")\n\n    let data = \"\"\n    response.on(\"error\", reject)\n    response.on(\"data\", (chunk: string) => (data += chunk))\n    response.on(\"end\", () => {\n      try {\n        if (response.statusCode != null && response.statusCode >= 400) {\n          const contentType = safeGetHeader(response, \"content-type\")\n          const isJson = contentType != null && (Array.isArray(contentType) ? contentType.find(it => it.includes(\"json\")) != null : contentType.includes(\"json\"))\n          reject(\n            createHttpError(\n              response,\n              `method: ${options.method || \"GET\"} url: ${options.protocol || \"https:\"}//${options.hostname}${options.port ? `:${options.port}` : \"\"}${options.path}\n\n          Data:\n          ${isJson ? safeStringifyJson(JSON.parse(data)) : data}\n          `\n            )\n          )\n        } else {\n          resolve(data.length === 0 ? null : data)\n        }\n      } catch (e: any) {\n        reject(e)\n      }\n    })\n  }\n\n  // noinspection JSUnusedLocalSymbols\n  abstract createRequest(options: RequestOptions, callback: (response: any) => void): T\n\n  async downloadToBuffer(url: URL, options: DownloadOptions): Promise<Buffer> {\n    return await options.cancellationToken.createPromise<Buffer>((resolve, reject, onCancel) => {\n      const responseChunks: Buffer[] = []\n      const requestOptions = {\n        headers: options.headers || undefined,\n        // because PrivateGitHubProvider requires HttpExecutor.prepareRedirectUrlOptions logic, so, we need to redirect manually\n        redirect: \"manual\",\n      }\n      configureRequestUrl(url, requestOptions)\n      configureRequestOptions(requestOptions)\n      this.doDownload(\n        requestOptions,\n        {\n          destination: null,\n          options,\n          onCancel,\n          callback: error => {\n            if (error == null) {\n              resolve(Buffer.concat(responseChunks))\n            } else {\n              reject(error)\n            }\n          },\n          responseHandler: (response, callback) => {\n            let receivedLength = 0\n            response.on(\"data\", (chunk: Buffer) => {\n              receivedLength += chunk.length\n              if (receivedLength > 524288000) {\n                callback(new Error(\"Maximum allowed size is 500 MB\"))\n                return\n              }\n              responseChunks.push(chunk)\n            })\n            response.on(\"end\", () => {\n              callback(null)\n            })\n          },\n        },\n        0\n      )\n    })\n  }\n\n  protected doDownload(requestOptions: RequestOptions, options: DownloadCallOptions, redirectCount: number) {\n    const request = this.createRequest(requestOptions, (response: IncomingMessage) => {\n      if (response.statusCode! >= 400) {\n        options.callback(\n          new Error(\n            `Cannot download \"${requestOptions.protocol || \"https:\"}//${requestOptions.hostname}${requestOptions.path}\", status ${response.statusCode}: ${response.statusMessage}`\n          )\n        )\n        return\n      }\n\n      // It is possible for the response stream to fail, e.g. when a network is lost while\n      // response stream is in progress. Stop waiting and reject so consumer can catch the error.\n      response.on(\"error\", options.callback)\n\n      // this code not relevant for Electron (redirect event instead handled)\n      const redirectUrl = safeGetHeader(response, \"location\")\n      if (redirectUrl != null) {\n        if (redirectCount < this.maxRedirects) {\n          this.doDownload(HttpExecutor.prepareRedirectUrlOptions(redirectUrl, requestOptions), options, redirectCount++)\n        } else {\n          options.callback(this.createMaxRedirectError())\n        }\n        return\n      }\n\n      if (options.responseHandler == null) {\n        configurePipes(options, response)\n      } else {\n        options.responseHandler(response, options.callback)\n      }\n    })\n    this.addErrorAndTimeoutHandlers(request, options.callback, requestOptions.timeout)\n    this.addRedirectHandlers(request, requestOptions, options.callback, redirectCount, requestOptions => {\n      this.doDownload(requestOptions, options, redirectCount++)\n    })\n    request.end()\n  }\n\n  protected createMaxRedirectError() {\n    return new Error(`Too many redirects (> ${this.maxRedirects})`)\n  }\n\n  private addTimeOutHandler(request: any, callback: (error: Error) => void, timeout: number) {\n    request.on(\"socket\", (socket: Socket) => {\n      socket.setTimeout(timeout, () => {\n        request.abort()\n        callback(new Error(\"Request timed out\"))\n      })\n    })\n  }\n\n  static prepareRedirectUrlOptions(redirectUrl: string, options: RequestOptions): RequestOptions {\n    const newOptions = configureRequestOptionsFromUrl(redirectUrl, { ...options })\n    const headers = newOptions.headers\n    if (headers == null) {\n      return newOptions\n    }\n\n    const originalUrl = HttpExecutor.reconstructOriginalUrl(options)\n    const parsedRedirectUrl = parseUrl(redirectUrl, options)\n\n    if (HttpExecutor.isCrossOriginRedirect(originalUrl, parsedRedirectUrl)) {\n      if (debug.enabled) {\n        debug(`Cross-origin redirect (${originalUrl.host} â†’ ${parsedRedirectUrl.host}): stripping sensitive headers`)\n      }\n      for (const key of Object.keys(headers)) {\n        if (SENSITIVE_REDIRECT_HEADERS.has(normalizeName(key))) {\n          delete (headers as Record<string, unknown>)[key]\n        }\n      }\n    }\n    return newOptions\n  }\n\n  private static reconstructOriginalUrl(options: RequestOptions): URL {\n    const protocol = options.protocol || \"https:\"\n    if (!options.hostname) {\n      throw new Error(\"Missing hostname in request options\")\n    }\n    const hostname = options.hostname\n    const port = options.port ? `:${options.port}` : \"\"\n    const path = options.path || \"/\"\n    return new URL(`${protocol}//${hostname}${port}${path}`)\n  }\n\n  private static isCrossOriginRedirect(originalUrl: URL, redirectUrl: URL): boolean {\n    // Case-insensitive hostname comparison\n    if (originalUrl.hostname.toLowerCase() !== redirectUrl.hostname.toLowerCase()) {\n      return true\n    }\n\n    // Special case: allow http -> https redirect on same host with standard ports\n    // This matches the behavior of Python requests library for backward compatibility\n    // url.port returns an empty string if the port is omitted\n    // or explicitly set to the default port for a given protocol.\n    if (\n      originalUrl.protocol === \"http:\" &&\n      // This can be replaced with `!originalUrl.port`, but for the sake of clarity.\n      [\"80\", \"\"].includes(originalUrl.port) &&\n      redirectUrl.protocol === \"https:\" &&\n      // This can be replaced with `!redirectUrl.port`, but for the sake of clarity.\n      [\"443\", \"\"].includes(redirectUrl.port)\n    ) {\n      return false\n    }\n\n    // According to RFC 7235, a change in protocol or port constitutes a cross-origin request.\n    // Forwarding authentication headers to a different origin can be a security risk.\n    // For example, https://example.com:443 and http://example.com:80 are different origins.\n    // We only make an exception for HTTP -> HTTPS upgrades on standard ports for backward compatibility.\n\n    // Strip auth on any other protocol change\n    if (originalUrl.protocol !== redirectUrl.protocol) {\n      return true\n    }\n\n    // Strip auth on port change (accounting for default ports)\n    const originalPort = originalUrl.port\n    const redirectPort = redirectUrl.port\n    return originalPort !== redirectPort\n  }\n\n  static async retryOnServerError(task: () => Promise<any>, maxRetries = 3): Promise<any> {\n    for (let attemptNumber = 0; ; attemptNumber++) {\n      try {\n        return await task()\n      } catch (e: any) {\n        if (attemptNumber < maxRetries && ((e instanceof HttpError && e.isServerError()) || e.code === \"EPIPE\")) {\n          await new Promise(r => setTimeout(r, 1000 * (attemptNumber + 1)))\n          continue\n        }\n        throw e\n      }\n    }\n  }\n}\n\nexport interface DownloadCallOptions {\n  responseHandler: ((response: IncomingMessage, callback: (error: Error | null) => void) => void) | null\n  onCancel: (callback: () => void) => void\n  callback: (error: Error | null) => void\n\n  options: DownloadOptions\n\n  destination: string | null\n}\n\nfunction parseUrl(url: string, options: RequestOptions): URL {\n  try {\n    // Would throw exception if url is not absolute\n    return new URL(url)\n  } catch {\n    // Relative URL - construct base URL from original options\n    const hostname = options.hostname\n    const protocol = options.protocol || \"https:\"\n    const port = options.port ? `:${options.port}` : \"\"\n    const baseUrl = `${protocol}//${hostname}${port}`\n    return new URL(url, baseUrl)\n  }\n}\n\nexport function configureRequestOptionsFromUrl(url: string, options: RequestOptions) {\n  const result = configureRequestOptions(options)\n  const parsedUrl = parseUrl(url, options)\n  configureRequestUrl(parsedUrl, result)\n  return result\n}\n\nexport function configureRequestUrl(url: URL, options: RequestOptions): void {\n  options.protocol = url.protocol\n  options.hostname = url.hostname\n  if (url.port) {\n    options.port = url.port\n  } else if (options.port) {\n    delete options.port\n  }\n  options.path = url.pathname + url.search\n}\n\nexport class DigestTransform extends Transform {\n  private readonly digester: Hash\n\n  private _actual: string | null = null\n\n  // noinspection JSUnusedGlobalSymbols\n  get actual() {\n    return this._actual\n  }\n\n  isValidateOnEnd = true\n\n  constructor(\n    readonly expected: string,\n    private readonly algorithm: string = \"sha512\",\n    private readonly encoding: BinaryToTextEncoding = \"base64\"\n  ) {\n    super()\n\n    this.digester = createHash(algorithm)\n  }\n\n  // noinspection JSUnusedGlobalSymbols\n  _transform(chunk: Buffer, encoding: string, callback: any) {\n    this.digester.update(chunk)\n    callback(null, chunk)\n  }\n\n  // noinspection JSUnusedGlobalSymbols\n  _flush(callback: any): void {\n    this._actual = this.digester.digest(this.encoding)\n\n    if (this.isValidateOnEnd) {\n      try {\n        this.validate()\n      } catch (e: any) {\n        callback(e)\n        return\n      }\n    }\n\n    callback(null)\n  }\n\n  validate() {\n    if (this._actual == null) {\n      throw newError(\"Not finished yet\", \"ERR_STREAM_NOT_FINISHED\")\n    }\n\n    if (this._actual !== this.expected) {\n      throw newError(`${this.algorithm} checksum mismatch, expected ${this.expected}, got ${this._actual}`, \"ERR_CHECKSUM_MISMATCH\")\n    }\n\n    return null\n  }\n}\n\nfunction checkSha2(sha2Header: string | Nullish, sha2: string | Nullish, callback: (error: Error | null) => void): boolean {\n  if (sha2Header != null && sha2 != null && sha2Header !== sha2) {\n    callback(new Error(`checksum mismatch: expected ${sha2} but got ${sha2Header} (X-Checksum-Sha2 header)`))\n    return false\n  }\n  return true\n}\n\nexport function safeGetHeader(response: any, headerKey: string) {\n  const value = response.headers[headerKey]\n  if (value == null) {\n    return null\n  } else if (Array.isArray(value)) {\n    // electron API\n    return value.length === 0 ? null : value[value.length - 1]\n  } else {\n    return value\n  }\n}\n\nfunction configurePipes(options: DownloadCallOptions, response: IncomingMessage) {\n  if (!checkSha2(safeGetHeader(response, \"X-Checksum-Sha2\"), options.options.sha2, options.callback)) {\n    return\n  }\n\n  const streams: Array<any> = []\n  if (options.options.onProgress != null) {\n    const contentLength = safeGetHeader(response, \"content-length\")\n    if (contentLength != null) {\n      streams.push(new ProgressCallbackTransform(parseInt(contentLength, 10), options.options.cancellationToken, options.options.onProgress))\n    }\n  }\n\n  const sha512 = options.options.sha512\n  if (sha512 != null) {\n    streams.push(new DigestTransform(sha512, \"sha512\", sha512.length === 128 && !sha512.includes(\"+\") && !sha512.includes(\"Z\") && !sha512.includes(\"=\") ? \"hex\" : \"base64\"))\n  } else if (options.options.sha2 != null) {\n    streams.push(new DigestTransform(options.options.sha2, \"sha256\", \"hex\"))\n  }\n\n  const fileOut = createWriteStream(options.destination!)\n  streams.push(fileOut)\n\n  let lastStream = response\n  for (const stream of streams) {\n    stream.on(\"error\", (error: Error) => {\n      fileOut.close()\n      if (!options.options.cancellationToken.cancelled) {\n        options.callback(error)\n      }\n    })\n    lastStream = lastStream.pipe(stream)\n  }\n\n  fileOut.on(\"finish\", () => {\n    ;(fileOut.close as any)(options.callback)\n  })\n}\n\nexport function configureRequestOptions(options: RequestOptions, token?: string | null, method?: \"GET\" | \"DELETE\" | \"PUT\" | \"POST\"): RequestOptions {\n  if (method != null) {\n    options.method = method\n  }\n\n  options.headers = { ...options.headers }\n  const headers = options.headers\n\n  if (token != null) {\n    ;(headers as any).authorization = token.startsWith(\"Basic\") || token.startsWith(\"Bearer\") ? token : `token ${token}`\n  }\n  if (headers[\"User-Agent\"] == null) {\n    headers[\"User-Agent\"] = \"electron-builder\"\n  }\n\n  if (method == null || method === \"GET\" || headers[\"Cache-Control\"] == null) {\n    headers[\"Cache-Control\"] = \"no-cache\"\n  }\n\n  // do not specify for node (in any case we use https module)\n  if (options.protocol == null && (process.versions as any).electron != null) {\n    options.protocol = \"https:\"\n  }\n  return options\n}\n\nexport function isSensitiveFieldName(name: string): boolean {\n  const normalized = normalizeName(name)\n  return SENSITIVE_FIELD_PATTERNS.some(p => normalized.includes(p)) || SENSITIVE_FIELD_SUFFIXES.some(s => normalized.endsWith(s))\n}\n\nexport function hashSensitiveValue(value: string): string {\n  return `${createHash(\"sha256\").update(value).digest(\"hex\")} (sha256 hash)`\n}\n\nexport function safeStringifyJson(data: any, skippedNames?: Set<string>): string {\n  return JSON.stringify(\n    data,\n    (name, value) => {\n      if (isSensitiveFieldName(name) || (skippedNames != null && skippedNames.has(name))) {\n        return typeof value === \"string\" ? hashSensitiveValue(value) : \"<stripped sensitive data>\"\n      }\n      return value\n    },\n    2\n  )\n}\n"]}"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CURRENT_APP_PACKAGE_FILE_NAME = exports.CURRENT_APP_INSTALLER_FILE_NAME = exports.objectToArgs = exports.deepAssign = exports.asArray = exports.mapToObject = exports.isValidKey = exports.XElement = exports.parseXml = exports.UUID = exports.parseDn = exports.retry = exports.githubTagPrefix = exports.githubUrl = exports.getS3LikeProviderBaseUrl = exports.ProgressCallbackTransform = exports.MemoLazy = exports.safeStringifyJson = exports.safeGetHeader = exports.parseJson = exports.isSensitiveFieldName = exports.HttpExecutor = exports.hashSensitiveValue = exports.HttpError = exports.DigestTransform = exports.createHttpError = exports.configureRequestUrl = exports.configureRequestOptionsFromUrl = exports.configureRequestOptions = exports.newError = exports.CancellationToken = exports.CancellationError = void 0;
var CancellationToken_1 = require("./CancellationToken");
Object.defineProperty(exports, "CancellationError", { enumerable: true, get: function () { return CancellationToken_1.CancellationError; } });
Object.defineProperty(exports, "CancellationToken", { enumerable: true, get: function () { return CancellationToken_1.CancellationToken; } });
var error_1 = require("./error");
Object.defineProperty(exports, "newError", { enumerable: true, get: function () { return error_1.newError; } });
var httpExecutor_1 = require("./httpExecutor");
Object.defineProperty(exports, "configureRequestOptions", { enumerable: true, get: function () { return httpExecutor_1.configureRequestOptions; } });
Object.defineProperty(exports, "configureRequestOptionsFromUrl", { enumerable: true, get: function () { return httpExecutor_1.configureRequestOptionsFromUrl; } });
Object.defineProperty(exports, "configureRequestUrl", { enumerable: true, get: function () { return httpExecutor_1.configureRequestUrl; } });
Object.defineProperty(exports, "createHttpError", { enumerable: true, get: function () { return httpExecutor_1.createHttpError; } });
Object.defineProperty(exports, "DigestTransform", { enumerable: true, get: function () { return httpExecutor_1.DigestTransform; } });
Object.defineProperty(exports, "HttpError", { enumerable: true, get: function () { return httpExecutor_1.HttpError; } });
Object.defineProperty(exports, "hashSensitiveValue", { enumerable: true, get: function () { return httpExecutor_1.hashSensitiveValue; } });
Object.defineProperty(exports, "HttpExecutor", { enumerable: true, get: function () { return httpExecutor_1.HttpExecutor; } });
Object.defineProperty(exports, "isSensitiveFieldName", { enumerable: true, get: function () { return httpExecutor_1.isSensitiveFieldName; } });
Object.defineProperty(exports, "parseJson", { enumerable: true, get: function () { return httpExecutor_1.parseJson; } });
Object.defineProperty(exports, "safeGetHeader", { enumerable: true, get: function () { return httpExecutor_1.safeGetHeader; } });
Object.defineProperty(exports, "safeStringifyJson", { enumerable: true, get: function () { return httpExecutor_1.safeStringifyJson; } });
var MemoLazy_1 = require("./MemoLazy");
Object.defineProperty(exports, "MemoLazy", { enumerable: true, get: function () { return MemoLazy_1.MemoLazy; } });
var ProgressCallbackTransform_1 = require("./ProgressCallbackTransform");
Object.defineProperty(exports, "ProgressCallbackTransform", { enumerable: true, get: function () { return ProgressCallbackTransform_1.ProgressCallbackTransform; } });
var publishOptions_1 = require("./publishOptions");
Object.defineProperty(exports, "getS3LikeProviderBaseUrl", { enumerable: true, get: function () { return publishOptions_1.getS3LikeProviderBaseUrl; } });
Object.defineProperty(exports, "githubUrl", { enumerable: true, get: function () { return publishOptions_1.githubUrl; } });
Object.defineProperty(exports, "githubTagPrefix", { enumerable: true, get: function () { return publishOptions_1.githubTagPrefix; } });
var retry_1 = require("./retry");
Object.defineProperty(exports, "retry", { enumerable: true, get: function () { return retry_1.retry; } });
var rfc2253Parser_1 = require("./rfc2253Parser");
Object.defineProperty(exports, "parseDn", { enumerable: true, get: function () { return rfc2253Parser_1.parseDn; } });
var uuid_1 = require("./uuid");
Object.defineProperty(exports, "UUID", { enumerable: true, get: function () { return uuid_1.UUID; } });
var xml_1 = require("./xml");
Object.defineProperty(exports, "parseXml", { enumerable: true, get: function () { return xml_1.parseXml; } });
Object.defineProperty(exports, "XElement", { enumerable: true, get: function () { return xml_1.XElement; } });
var objects_1 = require("./objects");
Object.defineProperty(exports, "isValidKey", { enumerable: true, get: function () { return objects_1.isValidKey; } });
Object.defineProperty(exports, "mapToObject", { enumerable: true, get: function () { return objects_1.mapToObject; } });
Object.defineProperty(exports, "asArray", { enumerable: true, get: function () { return objects_1.asArray; } });
Object.defineProperty(exports, "deepAssign", { enumerable: true, get: function () { return objects_1.deepAssign; } });
Object.defineProperty(exports, "objectToArgs", { enumerable: true, get: function () { return objects_1.objectToArgs; } });
// nsis
exports.CURRENT_APP_INSTALLER_FILE_NAME = "installer.exe";
// nsis-web
exports.CURRENT_APP_PACKAGE_FILE_NAME = "package.7z";
//# sourceMappingURL=index.js.map{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AACA,yDAA0E;AAAjE,sHAAA,iBAAiB,OAAA;AAAE,sHAAA,iBAAiB,OAAA;AAC7C,iCAAkC;AAAzB,iGAAA,QAAQ,OAAA;AACjB,+CAeuB;AAdrB,uHAAA,uBAAuB,OAAA;AACvB,8HAAA,8BAA8B,OAAA;AAC9B,mHAAA,mBAAmB,OAAA;AACnB,+GAAA,eAAe,OAAA;AACf,+GAAA,eAAe,OAAA;AAEf,yGAAA,SAAS,OAAA;AACT,kHAAA,kBAAkB,OAAA;AAClB,4GAAA,YAAY,OAAA;AACZ,oHAAA,oBAAoB,OAAA;AACpB,yGAAA,SAAS,OAAA;AAET,6GAAA,aAAa,OAAA;AACb,iHAAA,iBAAiB,OAAA;AAEnB,uCAAqC;AAA5B,oGAAA,QAAQ,OAAA;AACjB,yEAAqF;AAA5E,sIAAA,yBAAyB,OAAA;AAClC,mDAmByB;AAbvB,0HAAA,wBAAwB,OAAA;AAExB,2GAAA,SAAS,OAAA;AACT,iHAAA,eAAe,OAAA;AAWjB,iCAA+B;AAAtB,8FAAA,KAAK,OAAA;AACd,iDAAyC;AAAhC,wGAAA,OAAO,OAAA;AAEhB,+BAA6B;AAApB,4FAAA,IAAI,OAAA;AACb,6BAA0C;AAAjC,+FAAA,QAAQ,OAAA;AAAE,+FAAA,QAAQ,OAAA;AAC3B,qCAA+F;AAAtF,qGAAA,UAAU,OAAA;AAAE,sGAAA,WAAW,OAAA;AAAE,kGAAA,OAAO,OAAA;AAAW,qGAAA,UAAU,OAAA;AAAE,uGAAA,YAAY,OAAA;AAE5E,OAAO;AACM,QAAA,+BAA+B,GAAG,eAAe,CAAA;AAC9D,WAAW;AACE,QAAA,6BAA6B,GAAG,YAAY,CAAA","sourcesContent":["export { BlockMap } from \"./blockMapApi\"\nexport { CancellationError, CancellationToken } from \"./CancellationToken\"\nexport { newError } from \"./error\"\nexport {\n  configureRequestOptions,\n  configureRequestOptionsFromUrl,\n  configureRequestUrl,\n  createHttpError,\n  DigestTransform,\n  DownloadOptions,\n  HttpError,\n  hashSensitiveValue,\n  HttpExecutor,\n  isSensitiveFieldName,\n  parseJson,\n  RequestHeaders,\n  safeGetHeader,\n  safeStringifyJson,\n} from \"./httpExecutor\"\nexport { MemoLazy } from \"./MemoLazy\"\nexport { ProgressCallbackTransform, ProgressInfo } from \"./ProgressCallbackTransform\"\nexport {\n  AllPublishOptions,\n  BaseS3Options,\n  BitbucketOptions,\n  CustomPublishOptions,\n  GenericServerOptions,\n  getS3LikeProviderBaseUrl,\n  GithubOptions,\n  githubUrl,\n  githubTagPrefix,\n  GitlabOptions,\n  KeygenOptions,\n  PublishConfiguration,\n  PublishProvider,\n  S3Options,\n  SnapStoreOptions,\n  SpacesOptions,\n  GitlabReleaseInfo,\n  GitlabReleaseAsset,\n} from \"./publishOptions\"\nexport { retry } from \"./retry\"\nexport { parseDn } from \"./rfc2253Parser\"\nexport { BlockMapDataHolder, PackageFileInfo, ReleaseNoteInfo, UpdateFileInfo, UpdateInfo, WindowsUpdateInfo } from \"./updateInfo\"\nexport { UUID } from \"./uuid\"\nexport { parseXml, XElement } from \"./xml\"\nexport { isValidKey, mapToObject, asArray, Nullish, deepAssign, objectToArgs } from \"./objects\"\n\n// nsis\nexport const CURRENT_APP_INSTALLER_FILE_NAME = \"installer.exe\"\n// nsis-web\nexport const CURRENT_APP_PACKAGE_FILE_NAME = \"package.7z\"\n"]}"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.mapToObject = mapToObject;
exports.isValidKey = isValidKey;
exports.asArray = asArray;
exports.deepAssign = deepAssign;
exports.objectToArgs = objectToArgs;
function mapToObject(map) {
    const obj = {};
    for (const [key, value] of map) {
        if (!isValidKey(key)) {
            continue;
        }
        if (value instanceof Map) {
            obj[key] = mapToObject(value);
        }
        else {
            obj[key] = value;
        }
    }
    return obj;
}
function isValidKey(key) {
    const protectedProperties = ["__proto__", "prototype", "constructor"];
    if (protectedProperties.includes(key)) {
        return false;
    }
    return ["string", "number", "symbol", "boolean"].includes(typeof key) || key === null;
}
function asArray(v) {
    if (v == null) {
        return [];
    }
    else if (Array.isArray(v)) {
        return v;
    }
    else {
        return [v];
    }
}
function isObject(x) {
    if (Array.isArray(x)) {
        return false;
    }
    const type = typeof x;
    return type === "object" || type === "function";
}
function assignKey(target, from, key) {
    const value = from[key];
    // https://github.com/electron-userland/electron-builder/pull/562
    if (value === undefined) {
        return;
    }
    const prevValue = target[key];
    if (prevValue == null || value == null || !isObject(prevValue) || !isObject(value)) {
        // Merge arrays.
        if (Array.isArray(prevValue) && Array.isArray(value)) {
            target[key] = Array.from(new Set(prevValue.concat(value)));
        }
        else {
            target[key] = value;
        }
    }
    else {
        target[key] = assign(prevValue, value);
    }
}
function assign(to, from) {
    if (to !== from) {
        for (const key of Object.getOwnPropertyNames(from)) {
            if (isValidKey(key)) {
                assignKey(to, from, key);
            }
        }
    }
    return to;
}
function deepAssign(target, ...objects) {
    for (const o of objects) {
        if (o != null) {
            assign(target, o);
        }
    }
    return target;
}
// Flag names must be letters/digits/hyphens only (e.g. "maintainer", "deb-priority").
// Anything else could inject extra flags into the argument array.
const SAFE_FLAG_NAME_RE = /^[a-zA-Z][a-zA-Z0-9-]*$/;
// Null bytes truncate arguments at the C layer; newlines can split arguments in some parsers.
const UNSAFE_VALUE_RE = /[\0\r\n]/;
function objectToArgs(obj) {
    const args = Object.entries(obj).reduce((args, [name, value]) => {
        if (!isValidKey(name) || value == null) {
            return args;
        }
        if (!SAFE_FLAG_NAME_RE.test(name)) {
            throw new Error(`objectToArgs: unsafe flag name rejected: ${JSON.stringify(name)}`);
        }
        if (UNSAFE_VALUE_RE.test(value)) {
            throw new Error(`objectToArgs: value for --${name} contains a null byte or newline`);
        }
        return args.concat([`--${name}`, value]);
    }, []);
    return Object.freeze(args);
}
//# sourceMappingURL=objects.js.map{"version":3,"file":"objects.js","sourceRoot":"","sources":["../src/objects.ts"],"names":[],"mappings":";;AAIA,kCAaC;AAED,gCAMC;AAED,0BAQC;AA0CD,gCAOC;AASD,oCAcC;AAvGD,SAAgB,WAAW,CAAC,GAAiB;IAC3C,MAAM,GAAG,GAAQ,EAAE,CAAA;IACnB,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,GAAG,EAAE,CAAC;QAC/B,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;YACrB,SAAQ;QACV,CAAC;QACD,IAAI,KAAK,YAAY,GAAG,EAAE,CAAC;YACzB,GAAG,CAAC,GAAG,CAAC,GAAG,WAAW,CAAC,KAAK,CAAC,CAAA;QAC/B,CAAC;aAAM,CAAC;YACN,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAA;QAClB,CAAC;IACH,CAAC;IACD,OAAO,GAAG,CAAA;AACZ,CAAC;AAED,SAAgB,UAAU,CAAC,GAAQ;IACjC,MAAM,mBAAmB,GAAG,CAAC,WAAW,EAAE,WAAW,EAAE,aAAa,CAAC,CAAA;IACrE,IAAI,mBAAmB,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QACtC,OAAO,KAAK,CAAA;IACd,CAAC;IACD,OAAO,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAC,QAAQ,CAAC,OAAO,GAAG,CAAC,IAAI,GAAG,KAAK,IAAI,CAAA;AACvF,CAAC;AAED,SAAgB,OAAO,CAAI,CAAyB;IAClD,IAAI,CAAC,IAAI,IAAI,EAAE,CAAC;QACd,OAAO,EAAE,CAAA;IACX,CAAC;SAAM,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC;QAC5B,OAAO,CAAC,CAAA;IACV,CAAC;SAAM,CAAC;QACN,OAAO,CAAC,CAAC,CAAC,CAAA;IACZ,CAAC;AACH,CAAC;AAED,SAAS,QAAQ,CAAC,CAAM;IACtB,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC;QACrB,OAAO,KAAK,CAAA;IACd,CAAC;IAED,MAAM,IAAI,GAAG,OAAO,CAAC,CAAA;IACrB,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,UAAU,CAAA;AACjD,CAAC;AAED,SAAS,SAAS,CAAC,MAAW,EAAE,IAAS,EAAE,GAAW;IACpD,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAA;IACvB,iEAAiE;IACjE,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,OAAM;IACR,CAAC;IAED,MAAM,SAAS,GAAG,MAAM,CAAC,GAAG,CAAC,CAAA;IAC7B,IAAI,SAAS,IAAI,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;QACnF,gBAAgB;QAChB,IAAI,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;YACrD,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;QAC5D,CAAC;aAAM,CAAC;YACN,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,CAAA;QACrB,CAAC;IACH,CAAC;SAAM,CAAC;QACN,MAAM,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,SAAS,EAAE,KAAK,CAAC,CAAA;IACxC,CAAC;AACH,CAAC;AAED,SAAS,MAAM,CAAC,EAAO,EAAE,IAAS;IAChC,IAAI,EAAE,KAAK,IAAI,EAAE,CAAC;QAChB,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,mBAAmB,CAAC,IAAI,CAAC,EAAE,CAAC;YACnD,IAAI,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;gBACpB,SAAS,CAAC,EAAE,EAAE,IAAI,EAAE,GAAG,CAAC,CAAA;YAC1B,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,EAAE,CAAA;AACX,CAAC;AAED,SAAgB,UAAU,CAAI,MAAS,EAAE,GAAG,OAAmB;IAC7D,KAAK,MAAM,CAAC,IAAI,OAAO,EAAE,CAAC;QACxB,IAAI,CAAC,IAAI,IAAI,EAAE,CAAC;YACd,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAA;QACnB,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAA;AACf,CAAC;AAED,sFAAsF;AACtF,kEAAkE;AAClE,MAAM,iBAAiB,GAAG,yBAAyB,CAAA;AAEnD,8FAA8F;AAC9F,MAAM,eAAe,GAAG,UAAU,CAAA;AAElC,SAAgB,YAAY,CAAC,GAAkC;IAC7D,MAAM,IAAI,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,CAAW,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,EAAE;QACxE,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,KAAK,IAAI,IAAI,EAAE,CAAC;YACvC,OAAO,IAAI,CAAA;QACb,CAAC;QACD,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;YAClC,MAAM,IAAI,KAAK,CAAC,4CAA4C,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;QACrF,CAAC;QACD,IAAI,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;YAChC,MAAM,IAAI,KAAK,CAAC,6BAA6B,IAAI,kCAAkC,CAAC,CAAA;QACtF,CAAC;QACD,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,KAAK,IAAI,EAAE,EAAE,KAAK,CAAC,CAAC,CAAA;IAC1C,CAAC,EAAE,EAAE,CAAC,CAAA;IACN,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;AAC5B,CAAC","sourcesContent":["export type Nullish = null | undefined\n\ntype RecursiveMap = Map<any, RecursiveMap | any>\n\nexport function mapToObject(map: RecursiveMap) {\n  const obj: any = {}\n  for (const [key, value] of map) {\n    if (!isValidKey(key)) {\n      continue\n    }\n    if (value instanceof Map) {\n      obj[key] = mapToObject(value)\n    } else {\n      obj[key] = value\n    }\n  }\n  return obj\n}\n\nexport function isValidKey(key: any) {\n  const protectedProperties = [\"__proto__\", \"prototype\", \"constructor\"]\n  if (protectedProperties.includes(key)) {\n    return false\n  }\n  return [\"string\", \"number\", \"symbol\", \"boolean\"].includes(typeof key) || key === null\n}\n\nexport function asArray<T>(v: Nullish | T | Array<T>): Array<T> {\n  if (v == null) {\n    return []\n  } else if (Array.isArray(v)) {\n    return v\n  } else {\n    return [v]\n  }\n}\n\nfunction isObject(x: any) {\n  if (Array.isArray(x)) {\n    return false\n  }\n\n  const type = typeof x\n  return type === \"object\" || type === \"function\"\n}\n\nfunction assignKey(target: any, from: any, key: string) {\n  const value = from[key]\n  // https://github.com/electron-userland/electron-builder/pull/562\n  if (value === undefined) {\n    return\n  }\n\n  const prevValue = target[key]\n  if (prevValue == null || value == null || !isObject(prevValue) || !isObject(value)) {\n    // Merge arrays.\n    if (Array.isArray(prevValue) && Array.isArray(value)) {\n      target[key] = Array.from(new Set(prevValue.concat(value)))\n    } else {\n      target[key] = value\n    }\n  } else {\n    target[key] = assign(prevValue, value)\n  }\n}\n\nfunction assign(to: any, from: any) {\n  if (to !== from) {\n    for (const key of Object.getOwnPropertyNames(from)) {\n      if (isValidKey(key)) {\n        assignKey(to, from, key)\n      }\n    }\n  }\n  return to\n}\n\nexport function deepAssign<T>(target: T, ...objects: Array<any>): T {\n  for (const o of objects) {\n    if (o != null) {\n      assign(target, o)\n    }\n  }\n  return target\n}\n\n// Flag names must be letters/digits/hyphens only (e.g. \"maintainer\", \"deb-priority\").\n// Anything else could inject extra flags into the argument array.\nconst SAFE_FLAG_NAME_RE = /^[a-zA-Z][a-zA-Z0-9-]*$/\n\n// Null bytes truncate arguments at the C layer; newlines can split arguments in some parsers.\nconst UNSAFE_VALUE_RE = /[\\0\\r\\n]/\n\nexport function objectToArgs(obj: Record<string, string | null>): readonly string[] {\n  const args = Object.entries(obj).reduce<string[]>((args, [name, value]) => {\n    if (!isValidKey(name) || value == null) {\n      return args\n    }\n    if (!SAFE_FLAG_NAME_RE.test(name)) {\n      throw new Error(`objectToArgs: unsafe flag name rejected: ${JSON.stringify(name)}`)\n    }\n    if (UNSAFE_VALUE_RE.test(value)) {\n      throw new Error(`objectToArgs: value for --${name} contains a null byte or newline`)\n    }\n    return args.concat([`--${name}`, value])\n  }, [])\n  return Object.freeze(args)\n}\n"]}"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.githubUrl = githubUrl;
exports.githubTagPrefix = githubTagPrefix;
exports.getS3LikeProviderBaseUrl = getS3LikeProviderBaseUrl;
/** @private */
function githubUrl(options, defaultHost = "github.com") {
    return `${options.protocol || "https"}://${options.host || defaultHost}`;
}
function githubTagPrefix(options) {
    var _a;
    if (options.tagNamePrefix) {
        return options.tagNamePrefix;
    }
    if ((_a = options.vPrefixedTagName) !== null && _a !== void 0 ? _a : true) {
        return "v";
    }
    return "";
}
function getS3LikeProviderBaseUrl(configuration) {
    const provider = configuration.provider;
    if (provider === "s3") {
        return s3Url(configuration);
    }
    if (provider === "spaces") {
        return spacesUrl(configuration);
    }
    throw new Error(`Not supported provider: ${provider}`);
}
function s3Url(options) {
    let url;
    if (options.accelerate == true) {
        url = `https://${options.bucket}.s3-accelerate.amazonaws.com`;
    }
    else if (options.endpoint != null) {
        url = `${options.endpoint}/${options.bucket}`;
    }
    else if (options.bucket.includes(".")) {
        if (options.region == null) {
            throw new Error(`Bucket name "${options.bucket}" includes a dot, but S3 region is missing`);
        }
        // special case, see http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html#access-bucket-intro
        if (options.region === "us-east-1") {
            url = `https://s3.amazonaws.com/${options.bucket}`;
        }
        else {
            url = `https://s3-${options.region}.amazonaws.com/${options.bucket}`;
        }
    }
    else if (options.region === "cn-north-1") {
        url = `https://${options.bucket}.s3.${options.region}.amazonaws.com.cn`;
    }
    else {
        url = `https://${options.bucket}.s3.amazonaws.com`;
    }
    return appendPath(url, options.path);
}
function appendPath(url, p) {
    if (p != null && p.length > 0) {
        if (!p.startsWith("/")) {
            url += "/";
        }
        url += p;
    }
    return url;
}
function spacesUrl(options) {
    if (options.name == null) {
        throw new Error(`name is missing`);
    }
    if (options.region == null) {
        throw new Error(`region is missing`);
    }
    return appendPath(`https://${options.name}.${options.region}.digitaloceanspaces.com`, options.path);
}
//# sourceMappingURL=publishOptions.js.map{"version":3,"file":"publishOptions.js","sourceRoot":"","sources":["../src/publishOptions.ts"],"names":[],"mappings":";;AAqJA,8BAEC;AAED,0CAQC;AAqUD,4DASC;AA3VD,eAAe;AACf,SAAgB,SAAS,CAAC,OAAsB,EAAE,WAAW,GAAG,YAAY;IAC1E,OAAO,GAAG,OAAO,CAAC,QAAQ,IAAI,OAAO,MAAM,OAAO,CAAC,IAAI,IAAI,WAAW,EAAE,CAAA;AAC1E,CAAC;AAED,SAAgB,eAAe,CAAC,OAAsB;;IACpD,IAAI,OAAO,CAAC,aAAa,EAAE,CAAC;QAC1B,OAAO,OAAO,CAAC,aAAa,CAAA;IAC9B,CAAC;IACD,IAAI,MAAA,OAAO,CAAC,gBAAgB,mCAAI,IAAI,EAAE,CAAC;QACrC,OAAO,GAAG,CAAA;IACZ,CAAC;IACD,OAAO,EAAE,CAAA;AACX,CAAC;AAqUD,SAAgB,wBAAwB,CAAC,aAAmC;IAC1E,MAAM,QAAQ,GAAG,aAAa,CAAC,QAAQ,CAAA;IACvC,IAAI,QAAQ,KAAK,IAAI,EAAE,CAAC;QACtB,OAAO,KAAK,CAAC,aAA0B,CAAC,CAAA;IAC1C,CAAC;IACD,IAAI,QAAQ,KAAK,QAAQ,EAAE,CAAC;QAC1B,OAAO,SAAS,CAAC,aAA8B,CAAC,CAAA;IAClD,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,2BAA2B,QAAQ,EAAE,CAAC,CAAA;AACxD,CAAC;AAED,SAAS,KAAK,CAAC,OAAkB;IAC/B,IAAI,GAAW,CAAA;IACf,IAAI,OAAO,CAAC,UAAU,IAAI,IAAI,EAAE,CAAC;QAC/B,GAAG,GAAG,WAAW,OAAO,CAAC,MAAM,8BAA8B,CAAA;IAC/D,CAAC;SAAM,IAAI,OAAO,CAAC,QAAQ,IAAI,IAAI,EAAE,CAAC;QACpC,GAAG,GAAG,GAAG,OAAO,CAAC,QAAQ,IAAI,OAAO,CAAC,MAAM,EAAE,CAAA;IAC/C,CAAC;SAAM,IAAI,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QACxC,IAAI,OAAO,CAAC,MAAM,IAAI,IAAI,EAAE,CAAC;YAC3B,MAAM,IAAI,KAAK,CAAC,gBAAgB,OAAO,CAAC,MAAM,4CAA4C,CAAC,CAAA;QAC7F,CAAC;QAED,wGAAwG;QACxG,IAAI,OAAO,CAAC,MAAM,KAAK,WAAW,EAAE,CAAC;YACnC,GAAG,GAAG,4BAA4B,OAAO,CAAC,MAAM,EAAE,CAAA;QACpD,CAAC;aAAM,CAAC;YACN,GAAG,GAAG,cAAc,OAAO,CAAC,MAAM,kBAAkB,OAAO,CAAC,MAAM,EAAE,CAAA;QACtE,CAAC;IACH,CAAC;SAAM,IAAI,OAAO,CAAC,MAAM,KAAK,YAAY,EAAE,CAAC;QAC3C,GAAG,GAAG,WAAW,OAAO,CAAC,MAAM,OAAO,OAAO,CAAC,MAAM,mBAAmB,CAAA;IACzE,CAAC;SAAM,CAAC;QACN,GAAG,GAAG,WAAW,OAAO,CAAC,MAAM,mBAAmB,CAAA;IACpD,CAAC;IACD,OAAO,UAAU,CAAC,GAAG,EAAE,OAAO,CAAC,IAAI,CAAC,CAAA;AACtC,CAAC;AAED,SAAS,UAAU,CAAC,GAAW,EAAE,CAAmB;IAClD,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC9B,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;YACvB,GAAG,IAAI,GAAG,CAAA;QACZ,CAAC;QACD,GAAG,IAAI,CAAC,CAAA;IACV,CAAC;IACD,OAAO,GAAG,CAAA;AACZ,CAAC;AAED,SAAS,SAAS,CAAC,OAAsB;IACvC,IAAI,OAAO,CAAC,IAAI,IAAI,IAAI,EAAE,CAAC;QACzB,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAA;IACpC,CAAC;IACD,IAAI,OAAO,CAAC,MAAM,IAAI,IAAI,EAAE,CAAC;QAC3B,MAAM,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAA;IACtC,CAAC;IACD,OAAO,UAAU,CAAC,WAAW,OAAO,CAAC,IAAI,IAAI,OAAO,CAAC,MAAM,yBAAyB,EAAE,OAAO,CAAC,IAAI,CAAC,CAAA;AACrG,CAAC","sourcesContent":["import { OutgoingHttpHeaders } from \"http\"\nimport { Nullish } from \".\"\n\nexport type PublishProvider = \"github\" | \"gitlab\" | \"s3\" | \"spaces\" | \"generic\" | \"custom\" | \"snapStore\" | \"keygen\" | \"bitbucket\"\n\n// typescript-json-schema generates only PublishConfiguration if it is specified in the list, so, it is not added here\nexport type AllPublishOptions =\n  | string\n  | GithubOptions\n  | GitlabOptions\n  | S3Options\n  | SpacesOptions\n  | GenericServerOptions\n  | CustomPublishOptions\n  | KeygenOptions\n  | SnapStoreOptions\n  | BitbucketOptions\n\nexport interface PublishConfiguration {\n  /**\n   * The provider.\n   */\n  readonly provider: PublishProvider\n\n  /**\n   * @private\n   * win-only\n   */\n  publisherName?: Array<string> | null\n\n  /**\n   * @private\n   * win-only\n   */\n  readonly updaterCacheDirName?: string | null\n\n  /**\n   * Whether to publish auto update info files.\n   *\n   * Auto update relies only on the first provider in the list (you can specify several publishers).\n   * Thus, probably, there`s no need to upload the metadata files for the other configured providers. But by default will be uploaded.\n   *\n   * @default true\n   */\n  readonly publishAutoUpdate?: boolean\n\n  /**\n   * Any custom request headers\n   */\n  readonly requestHeaders?: OutgoingHttpHeaders\n\n  /**\n   * Request timeout in milliseconds. (Default is 2 minutes; O is ignored)\n   *\n   * @default 120000\n   */\n  readonly timeout?: number | null\n}\n\n// https://github.com/electron-userland/electron-builder/issues/3261\nexport interface CustomPublishOptions extends PublishConfiguration {\n  /**\n   * The provider. Must be `custom`.\n   */\n  readonly provider: \"custom\"\n\n  /**\n   * The Provider to provide UpdateInfo regarding available updates.  Required\n   * to use custom providers with electron-updater.\n   */\n  updateProvider?: new (options: CustomPublishOptions, updater: any, runtimeOptions: any) => any\n\n  [index: string]: any\n}\n\n/**\n * [GitHub](https://help.github.com/articles/about-releases/) options.\n *\n * GitHub [personal access token](https://help.github.com/articles/creating-an-access-token-for-command-line-use/) is required. You can generate by going to [https://github.com/settings/tokens/new](https://github.com/settings/tokens/new). The access token should have the repo scope/permission.\n * Define `GH_TOKEN` environment variable.\n */\nexport interface GithubOptions extends PublishConfiguration {\n  /**\n   * The provider. Must be `github`.\n   */\n  readonly provider: \"github\"\n\n  /**\n   * The repository name. [Detected automatically](#github-repository-and-bintray-package).\n   */\n  readonly repo?: string | null\n\n  /**\n   * The owner.\n   */\n  readonly owner?: string | null\n\n  /**\n   * Whether to use `v`-prefixed tag name.\n   * @default true\n   * @deprecated please use #tagNamePrefix instead.\n   */\n  readonly vPrefixedTagName?: boolean\n\n  /**\n   * If defined, sets the prefix of the tag name that comes before the semver number.\n   * e.g. \"v\" in \"v1.2.3\" or \"test\" of \"test1.2.3\".\n   * Overrides `vPrefixedTagName`\n   */\n  readonly tagNamePrefix?: string\n\n  /**\n   * The host (including the port if need).\n   * @default github.com\n   */\n  readonly host?: string | null\n\n  /**\n   * The protocol. GitHub Publisher supports only `https`.\n   * @default https\n   */\n  readonly protocol?: \"https\" | \"http\" | null\n\n  /**\n   * The access token to support auto-update from private github repositories. Never specify it in the configuration files. Only for [setFeedURL](https://www.electron.build/auto-update#appupdatersetfeedurloptions).\n   */\n  readonly token?: string | null\n\n  /**\n   * Whether to use private github auto-update provider if `GH_TOKEN` environment variable is defined. See [Private GitHub Update Repo](https://www.electron.build/auto-update#private-github-update-repo).\n   */\n  readonly private?: boolean | null\n\n  /**\n   * The channel.\n   * @default latest\n   */\n  readonly channel?: string | null\n\n  /**\n   * The type of release. By default `draft` release will be created.\n   *\n   * Also you can set release type using environment variable. If `EP_DRAFT`is set to `true` â€” `draft`, if `EP_PRE_RELEASE`is set to `true` â€” `prerelease`.\n   * @default draft\n   */\n  releaseType?: \"draft\" | \"prerelease\" | \"release\" | null\n}\n\n/** @private */\nexport function githubUrl(options: GithubOptions, defaultHost = \"github.com\") {\n  return `${options.protocol || \"https\"}://${options.host || defaultHost}`\n}\n\nexport function githubTagPrefix(options: GithubOptions) {\n  if (options.tagNamePrefix) {\n    return options.tagNamePrefix\n  }\n  if (options.vPrefixedTagName ?? true) {\n    return \"v\"\n  }\n  return \"\"\n}\n\n/**\n * [GitLab](https://docs.gitlab.com/ee/user/project/releases/) options.\n *\n * GitLab [personal access token](https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html) is required for private repositories. You can generate one by going to your GitLab profile settings.\n * Define `GITLAB_TOKEN` environment variable.\n */\nexport interface GitlabOptions extends PublishConfiguration {\n  /**\n   * The provider. Must be `gitlab`.\n   */\n  readonly provider: \"gitlab\"\n\n  /**\n   * The GitLab project ID or path (e.g., \"12345678\" or \"namespace/project\").\n   */\n  readonly projectId?: string | number | null\n\n  /**\n   * The GitLab host (including the port if need).\n   * @default gitlab.com\n   */\n  readonly host?: string | null\n\n  /**\n   * The access token to support auto-update from private GitLab repositories. Never specify it in the configuration files.\n   */\n  readonly token?: string | null\n\n  /**\n   * Whether to use `v`-prefixed tag name.\n   * @default true\n   */\n  readonly vPrefixedTagName?: boolean\n\n  /**\n   * The channel.\n   * @default latest\n   */\n  readonly channel?: string | null\n\n  /**\n   * Upload target method. Can be \"project_upload\" for GitLab project uploads or \"generic_package\" for GitLab generic packages.\n   * @default \"project_upload\"\n   */\n  readonly uploadTarget?: \"project_upload\" | \"generic_package\" | null\n}\n\n/**\n * Generic (any HTTP(S) server) options.\n * In all publish options [File Macros](https://www.electron.build/file-patterns#file-macros) are supported.\n */\nexport interface GenericServerOptions extends PublishConfiguration {\n  /**\n   * The provider. Must be `generic`.\n   */\n  readonly provider: \"generic\"\n\n  /**\n   * The base url. e.g. `https://bucket_name.s3.amazonaws.com`.\n   */\n  readonly url: string\n\n  /**\n   * The channel.\n   * @default latest\n   */\n  readonly channel?: string | null\n\n  /**\n   * Whether to use multiple range requests for differential update. Defaults to `true` if `url` doesn't contain `s3.amazonaws.com`.\n   */\n  readonly useMultipleRangeRequest?: boolean\n}\n\n/**\n * Keygen options.\n * https://keygen.sh/\n * Define `KEYGEN_TOKEN` environment variable.\n */\nexport interface KeygenOptions extends PublishConfiguration {\n  /**\n   * The provider. Must be `keygen`.\n   */\n  readonly provider: \"keygen\"\n\n  /**\n   * Keygen host for self-hosted instances\n   * @default \"api.keygen.sh\"\n   */\n  readonly host?: string\n\n  /**\n   * Keygen account's UUID\n   */\n  readonly account: string\n\n  /**\n   * Keygen product's UUID\n   */\n  readonly product: string\n\n  /**\n   * The channel.\n   * @default stable\n   */\n  readonly channel?: \"stable\" | \"rc\" | \"beta\" | \"alpha\" | \"dev\" | null\n\n  /**\n   * The target Platform. Is set programmatically explicitly during publishing.\n   */\n  readonly platform?: string | null\n}\n\n/**\n * Bitbucket options.\n * https://bitbucket.org/\n * Define `BITBUCKET_TOKEN` environment variable.\n *\n * For converting an app password to a usable token, you can utilize this\n```typescript\nconvertAppPassword(owner: string, appPassword: string) {\n  const base64encodedData = Buffer.from(`${owner}:${appPassword.trim()}`).toString(\"base64\")\n  return `Basic ${base64encodedData}`\n}\n```\n */\nexport interface BitbucketOptions extends PublishConfiguration {\n  /**\n   * The provider. Must be `bitbucket`.\n   */\n  readonly provider: \"bitbucket\"\n\n  /**\n   * Repository owner\n   */\n  readonly owner: string\n\n  /**\n   * The [app password](https://bitbucket.org/account/settings/app-passwords) to support auto-update from private bitbucket repositories.\n   */\n  readonly token?: string | null\n\n  /**\n   * The user name to support auto-update from private bitbucket repositories.\n   */\n  readonly username?: string | null\n\n  /**\n   * Repository slug/name\n   */\n  readonly slug: string\n\n  /**\n   * The channel.\n   * @default latest\n   */\n  readonly channel?: string | null\n}\n\n/**\n * [Snap Store](https://snapcraft.io/) options. To publish directly to Snapcraft, see <a href=\"https://snapcraft.io/docs/snapcraft-authentication\">Snapcraft authentication options</a> for local or CI/CD authentication options.\n */\nexport interface SnapStoreOptions extends PublishConfiguration {\n  /**\n   * The provider. Must be `snapStore`.\n   */\n  readonly provider: \"snapStore\"\n\n  /**\n   * snapcraft repo name\n   */\n  readonly repo?: string\n\n  /**\n   * The list of channels the snap would be released.\n   * @default [\"edge\"]\n   */\n  readonly channels?: string | Array<string> | null\n}\n\nexport interface BaseS3Options extends PublishConfiguration {\n  /**\n   * The update channel.\n   * @default latest\n   */\n  channel?: string | null\n\n  /**\n   * The directory path.\n   * @default /\n   */\n  readonly path?: string | null\n\n  /**\n   * The ACL. Set to `null` to not [add](https://github.com/electron-userland/electron-builder/issues/1822).\n   *\n   * @default public-read\n   */\n  readonly acl?: \"private\" | \"public-read\" | null\n}\n\n/**\n * [Amazon S3](https://aws.amazon.com/s3/) options.\n * AWS credentials are required, please see [getting your credentials](http://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/getting-your-credentials.html).\n * To set credentials define `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` [environment variables](http://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/loading-node-credentials-environment.html) directly,\n * or use [~/.aws/credentials](http://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/loading-node-credentials-shared.html) file,\n * or use [~/.aws/config](https://docs.aws.amazon.com/sdkref/latest/guide/file-format.html) file. For the last method to work you will also need to define `AWS_SDK_LOAD_CONFIG=1` environment variable.\n *\n * Example configuration:\n *\n```json\n{\n  \"build\":\n    \"publish\": {\n      \"provider\": \"s3\",\n      \"bucket\": \"bucket-name\"\n    }\n  }\n}\n```\n */\nexport interface S3Options extends BaseS3Options {\n  /**\n   * The provider. Must be `s3`.\n   */\n  readonly provider: \"s3\"\n\n  /**\n   * The bucket name.\n   */\n  readonly bucket: string\n\n  /**\n   * The region. Is determined and set automatically when publishing.\n   */\n  region?: string | null\n\n  /**\n   * The ACL. Set to `null` to not [add](https://github.com/electron-userland/electron-builder/issues/1822).\n   *\n   * Please see [required permissions for the S3 provider](https://github.com/electron-userland/electron-builder/issues/1618#issuecomment-314679128).\n   *\n   * @default public-read\n   */\n  readonly acl?: \"private\" | \"public-read\" | null\n\n  /**\n   * The type of storage to use for the object.\n   * @default STANDARD\n   */\n  readonly storageClass?: \"STANDARD\" | \"REDUCED_REDUNDANCY\" | \"STANDARD_IA\" | null\n\n  /**\n   * Server-side encryption algorithm to use for the object.\n   */\n  readonly encryption?: \"AES256\" | \"aws:kms\" | null\n\n  /**\n   * The endpoint URI to send requests to. The default endpoint is built from the configured region.\n   * The endpoint should be a string like `https://{service}.{region}.amazonaws.com`.\n   */\n  readonly endpoint?: string | null\n\n  /**\n   * If set to true, this will enable the s3 accelerated endpoint\n   * These endpoints have a particular format of:\n   *  ${bucketname}.s3-accelerate.amazonaws.com\n   */\n  readonly accelerate?: boolean\n\n  /**\n   * When true, force a path-style endpoint to be used where the bucket name is part of the path.\n   * [Path-style Access](https://docs.aws.amazon.com/AmazonS3/latest/userguide/VirtualHosting.html#path-style-access)\n   */\n  readonly forcePathStyle?: boolean\n}\n\n/**\n * [DigitalOcean Spaces](https://www.digitalocean.com/community/tutorials/an-introduction-to-digitalocean-spaces) options.\n * Access key is required, define `DO_KEY_ID` and `DO_SECRET_KEY` environment variables.\n */\nexport interface SpacesOptions extends BaseS3Options {\n  /**\n   * The provider. Must be `spaces`.\n   */\n  readonly provider: \"spaces\"\n\n  /**\n   * The space name.\n   */\n  readonly name: string\n\n  /**\n   * The region (e.g. `nyc3`).\n   */\n  readonly region: string\n}\n\nexport interface GitlabReleaseInfo {\n  name: string\n  tag_name: string\n  description: string\n  created_at: string\n  released_at: string\n  upcoming_release: boolean\n  assets: GitlabReleaseAsset\n}\n\nexport interface GitlabReleaseAsset {\n  count: number\n  sources: Array<{\n    format: string\n    url: string\n  }>\n  links: Array<{\n    id: number\n    name: string\n    url: string\n    direct_asset_url: string\n    link_type: string\n  }>\n}\n\nexport function getS3LikeProviderBaseUrl(configuration: PublishConfiguration) {\n  const provider = configuration.provider\n  if (provider === \"s3\") {\n    return s3Url(configuration as S3Options)\n  }\n  if (provider === \"spaces\") {\n    return spacesUrl(configuration as SpacesOptions)\n  }\n  throw new Error(`Not supported provider: ${provider}`)\n}\n\nfunction s3Url(options: S3Options) {\n  let url: string\n  if (options.accelerate == true) {\n    url = `https://${options.bucket}.s3-accelerate.amazonaws.com`\n  } else if (options.endpoint != null) {\n    url = `${options.endpoint}/${options.bucket}`\n  } else if (options.bucket.includes(\".\")) {\n    if (options.region == null) {\n      throw new Error(`Bucket name \"${options.bucket}\" includes a dot, but S3 region is missing`)\n    }\n\n    // special case, see http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html#access-bucket-intro\n    if (options.region === \"us-east-1\") {\n      url = `https://s3.amazonaws.com/${options.bucket}`\n    } else {\n      url = `https://s3-${options.region}.amazonaws.com/${options.bucket}`\n    }\n  } else if (options.region === \"cn-north-1\") {\n    url = `https://${options.bucket}.s3.${options.region}.amazonaws.com.cn`\n  } else {\n    url = `https://${options.bucket}.s3.amazonaws.com`\n  }\n  return appendPath(url, options.path)\n}\n\nfunction appendPath(url: string, p: string | Nullish): string {\n  if (p != null && p.length > 0) {\n    if (!p.startsWith(\"/\")) {\n      url += \"/\"\n    }\n    url += p\n  }\n  return url\n}\n\nfunction spacesUrl(options: SpacesOptions) {\n  if (options.name == null) {\n    throw new Error(`name is missing`)\n  }\n  if (options.region == null) {\n    throw new Error(`region is missing`)\n  }\n  return appendPath(`https://${options.name}.${options.region}.digitaloceanspaces.com`, options.path)\n}\n"]}"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.retry = retry;
const CancellationToken_1 = require("./CancellationToken");
async function retry(task, options) {
    var _a;
    const { retries: retryCount, interval, backoff = 0, attempt = 0, shouldRetry, cancellationToken = new CancellationToken_1.CancellationToken() } = options;
    try {
        return await task();
    }
    catch (error) {
        if ((await Promise.resolve((_a = shouldRetry === null || shouldRetry === void 0 ? void 0 : shouldRetry(error)) !== null && _a !== void 0 ? _a : true)) && retryCount > 0 && !cancellationToken.cancelled) {
            await new Promise(resolve => setTimeout(resolve, interval + backoff * attempt));
            return await retry(task, { ...options, retries: retryCount - 1, attempt: attempt + 1 });
        }
        else {
            throw error;
        }
    }
}
//# sourceMappingURL=retry.js.map{"version":3,"file":"retry.js","sourceRoot":"","sources":["../src/retry.ts"],"names":[],"mappings":";;AAEA,sBAeC;AAjBD,2DAAuD;AAEhD,KAAK,UAAU,KAAK,CACzB,IAAsB,EACtB,OAA+K;;IAE/K,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,GAAG,CAAC,EAAE,OAAO,GAAG,CAAC,EAAE,WAAW,EAAE,iBAAiB,GAAG,IAAI,qCAAiB,EAAE,EAAE,GAAG,OAAO,CAAA;IACrI,IAAI,CAAC;QACH,OAAO,MAAM,IAAI,EAAE,CAAA;IACrB,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QACpB,IAAI,CAAC,MAAM,OAAO,CAAC,OAAO,CAAC,MAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAG,KAAK,CAAC,mCAAI,IAAI,CAAC,CAAC,IAAI,UAAU,GAAG,CAAC,IAAI,CAAC,iBAAiB,CAAC,SAAS,EAAE,CAAC;YAC5G,MAAM,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,GAAG,OAAO,CAAC,CAAC,CAAA;YAC/E,OAAO,MAAM,KAAK,CAAC,IAAI,EAAE,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE,UAAU,GAAG,CAAC,EAAE,OAAO,EAAE,OAAO,GAAG,CAAC,EAAE,CAAC,CAAA;QACzF,CAAC;aAAM,CAAC;YACN,MAAM,KAAK,CAAA;QACb,CAAC;IACH,CAAC;AACH,CAAC","sourcesContent":["import { CancellationToken } from \"./CancellationToken\"\n\nexport async function retry<T>(\n  task: () => Promise<T>,\n  options: { retries: number; interval: number; backoff?: number; attempt?: number; cancellationToken?: CancellationToken; shouldRetry?: (e: any) => boolean | Promise<boolean> }\n): Promise<T> {\n  const { retries: retryCount, interval, backoff = 0, attempt = 0, shouldRetry, cancellationToken = new CancellationToken() } = options\n  try {\n    return await task()\n  } catch (error: any) {\n    if ((await Promise.resolve(shouldRetry?.(error) ?? true)) && retryCount > 0 && !cancellationToken.cancelled) {\n      await new Promise(resolve => setTimeout(resolve, interval + backoff * attempt))\n      return await retry(task, { ...options, retries: retryCount - 1, attempt: attempt + 1 })\n    } else {\n      throw error\n    }\n  }\n}\n"]}"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.parseDn = parseDn;
function parseDn(seq) {
    let quoted = false;
    let key = null;
    let token = "";
    let nextNonSpace = 0;
    seq = seq.trim();
    const result = new Map();
    for (let i = 0; i <= seq.length; i++) {
        if (i === seq.length) {
            if (key !== null) {
                result.set(key, token);
            }
            break;
        }
        const ch = seq[i];
        if (quoted) {
            if (ch === '"') {
                quoted = false;
                continue;
            }
        }
        else {
            if (ch === '"') {
                quoted = true;
                continue;
            }
            if (ch === "\\") {
                i++;
                const ord = parseInt(seq.slice(i, i + 2), 16);
                if (Number.isNaN(ord)) {
                    token += seq[i];
                }
                else {
                    i++;
                    token += String.fromCharCode(ord);
                }
                continue;
            }
            if (key === null && ch === "=") {
                key = token;
                token = "";
                continue;
            }
            if (ch === "," || ch === ";" || ch === "+") {
                if (key !== null) {
                    result.set(key, token);
                }
                key = null;
                token = "";
                continue;
            }
        }
        if (ch === " " && !quoted) {
            if (token.length === 0) {
                continue;
            }
            if (i > nextNonSpace) {
                let j = i;
                while (seq[j] === " ") {
                    j++;
                }
                nextNonSpace = j;
            }
            if (nextNonSpace >= seq.length ||
                seq[nextNonSpace] === "," ||
                seq[nextNonSpace] === ";" ||
                (key === null && seq[nextNonSpace] === "=") ||
                (key !== null && seq[nextNonSpace] === "+")) {
                i = nextNonSpace - 1;
                continue;
            }
        }
        token += ch;
    }
    return result;
}
//# sourceMappingURL=rfc2253Parser.js.map{"version":3,"file":"rfc2253Parser.js","sourceRoot":"","sources":["../src/rfc2253Parser.ts"],"names":[],"mappings":";;AAAA,0BAqFC;AArFD,SAAgB,OAAO,CAAC,GAAW;IACjC,IAAI,MAAM,GAAG,KAAK,CAAA;IAClB,IAAI,GAAG,GAAkB,IAAI,CAAA;IAC7B,IAAI,KAAK,GAAG,EAAE,CAAA;IACd,IAAI,YAAY,GAAG,CAAC,CAAA;IAEpB,GAAG,GAAG,GAAG,CAAC,IAAI,EAAE,CAAA;IAChB,MAAM,MAAM,GAAG,IAAI,GAAG,EAAkB,CAAA;IACxC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,GAAG,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACrC,IAAI,CAAC,KAAK,GAAG,CAAC,MAAM,EAAE,CAAC;YACrB,IAAI,GAAG,KAAK,IAAI,EAAE,CAAC;gBACjB,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAA;YACxB,CAAC;YACD,MAAK;QACP,CAAC;QAED,MAAM,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC,CAAA;QACjB,IAAI,MAAM,EAAE,CAAC;YACX,IAAI,EAAE,KAAK,GAAG,EAAE,CAAC;gBACf,MAAM,GAAG,KAAK,CAAA;gBACd,SAAQ;YACV,CAAC;QACH,CAAC;aAAM,CAAC;YACN,IAAI,EAAE,KAAK,GAAG,EAAE,CAAC;gBACf,MAAM,GAAG,IAAI,CAAA;gBACb,SAAQ;YACV,CAAC;YAED,IAAI,EAAE,KAAK,IAAI,EAAE,CAAC;gBAChB,CAAC,EAAE,CAAA;gBACH,MAAM,GAAG,GAAG,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC,CAAA;gBAC7C,IAAI,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC;oBACtB,KAAK,IAAI,GAAG,CAAC,CAAC,CAAC,CAAA;gBACjB,CAAC;qBAAM,CAAC;oBACN,CAAC,EAAE,CAAA;oBACH,KAAK,IAAI,MAAM,CAAC,YAAY,CAAC,GAAG,CAAC,CAAA;gBACnC,CAAC;gBACD,SAAQ;YACV,CAAC;YAED,IAAI,GAAG,KAAK,IAAI,IAAI,EAAE,KAAK,GAAG,EAAE,CAAC;gBAC/B,GAAG,GAAG,KAAK,CAAA;gBACX,KAAK,GAAG,EAAE,CAAA;gBACV,SAAQ;YACV,CAAC;YAED,IAAI,EAAE,KAAK,GAAG,IAAI,EAAE,KAAK,GAAG,IAAI,EAAE,KAAK,GAAG,EAAE,CAAC;gBAC3C,IAAI,GAAG,KAAK,IAAI,EAAE,CAAC;oBACjB,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAA;gBACxB,CAAC;gBACD,GAAG,GAAG,IAAI,CAAA;gBACV,KAAK,GAAG,EAAE,CAAA;gBACV,SAAQ;YACV,CAAC;QACH,CAAC;QAED,IAAI,EAAE,KAAK,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC;YAC1B,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBACvB,SAAQ;YACV,CAAC;YAED,IAAI,CAAC,GAAG,YAAY,EAAE,CAAC;gBACrB,IAAI,CAAC,GAAG,CAAC,CAAA;gBACT,OAAO,GAAG,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE,CAAC;oBACtB,CAAC,EAAE,CAAA;gBACL,CAAC;gBACD,YAAY,GAAG,CAAC,CAAA;YAClB,CAAC;YAED,IACE,YAAY,IAAI,GAAG,CAAC,MAAM;gBAC1B,GAAG,CAAC,YAAY,CAAC,KAAK,GAAG;gBACzB,GAAG,CAAC,YAAY,CAAC,KAAK,GAAG;gBACzB,CAAC,GAAG,KAAK,IAAI,IAAI,GAAG,CAAC,YAAY,CAAC,KAAK,GAAG,CAAC;gBAC3C,CAAC,GAAG,KAAK,IAAI,IAAI,GAAG,CAAC,YAAY,CAAC,KAAK,GAAG,CAAC,EAC3C,CAAC;gBACD,CAAC,GAAG,YAAY,GAAG,CAAC,CAAA;gBACpB,SAAQ;YACV,CAAC;QACH,CAAC;QAED,KAAK,IAAI,EAAE,CAAA;IACb,CAAC;IAED,OAAO,MAAM,CAAA;AACf,CAAC","sourcesContent":["export function parseDn(seq: string): Map<string, string> {\n  let quoted = false\n  let key: string | null = null\n  let token = \"\"\n  let nextNonSpace = 0\n\n  seq = seq.trim()\n  const result = new Map<string, string>()\n  for (let i = 0; i <= seq.length; i++) {\n    if (i === seq.length) {\n      if (key !== null) {\n        result.set(key, token)\n      }\n      break\n    }\n\n    const ch = seq[i]\n    if (quoted) {\n      if (ch === '\"') {\n        quoted = false\n        continue\n      }\n    } else {\n      if (ch === '\"') {\n        quoted = true\n        continue\n      }\n\n      if (ch === \"\\\\\") {\n        i++\n        const ord = parseInt(seq.slice(i, i + 2), 16)\n        if (Number.isNaN(ord)) {\n          token += seq[i]\n        } else {\n          i++\n          token += String.fromCharCode(ord)\n        }\n        continue\n      }\n\n      if (key === null && ch === \"=\") {\n        key = token\n        token = \"\"\n        continue\n      }\n\n      if (ch === \",\" || ch === \";\" || ch === \"+\") {\n        if (key !== null) {\n          result.set(key, token)\n        }\n        key = null\n        token = \"\"\n        continue\n      }\n    }\n\n    if (ch === \" \" && !quoted) {\n      if (token.length === 0) {\n        continue\n      }\n\n      if (i > nextNonSpace) {\n        let j = i\n        while (seq[j] === \" \") {\n          j++\n        }\n        nextNonSpace = j\n      }\n\n      if (\n        nextNonSpace >= seq.length ||\n        seq[nextNonSpace] === \",\" ||\n        seq[nextNonSpace] === \";\" ||\n        (key === null && seq[nextNonSpace] === \"=\") ||\n        (key !== null && seq[nextNonSpace] === \"+\")\n      ) {\n        i = nextNonSpace - 1\n        continue\n      }\n    }\n\n    token += ch\n  }\n\n  return result\n}\n"]}"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=updateInfo.js.map{"version":3,"file":"updateInfo.js","sourceRoot":"","sources":["../src/updateInfo.ts"],"names":[],"mappings":"","sourcesContent":["export interface ReleaseNoteInfo {\n  /**\n   * The version.\n   */\n  readonly version: string\n\n  /**\n   * The note.\n   */\n  readonly note: string | null\n}\n\nexport interface BlockMapDataHolder {\n  /**\n   * The file size. Used to verify downloaded size (save one HTTP request to get length).\n   * Also used when block map data is embedded into the file (appimage, windows web installer package).\n   */\n  size?: number\n\n  /**\n   * The block map file size. Used when block map data is embedded into the file (appimage, windows web installer package).\n   * This information can be obtained from the file itself, but it requires additional HTTP request,\n   * so, to reduce request count, block map size is specified in the update metadata too.\n   */\n  blockMapSize?: number\n\n  /**\n   * The file checksum.\n   */\n  readonly sha512: string\n\n  readonly isAdminRightsRequired?: boolean\n}\n\nexport interface PackageFileInfo extends BlockMapDataHolder {\n  readonly path: string\n}\n\nexport interface UpdateFileInfo extends BlockMapDataHolder {\n  url: string\n}\n\nexport interface UpdateInfo {\n  /**\n   * The version.\n   */\n  readonly version: string\n\n  readonly files: Array<UpdateFileInfo>\n\n  /** @deprecated */\n  readonly path: string\n\n  /** @deprecated */\n  readonly sha512: string\n\n  /**\n   * The release name.\n   */\n  releaseName?: string | null\n\n  /**\n   * The release notes. List if `updater.fullChangelog` is set to `true`, `string` otherwise.\n   */\n  releaseNotes?: string | Array<ReleaseNoteInfo> | null\n\n  /**\n   * The release date.\n   */\n  releaseDate: string\n\n  /**\n   * The [staged rollout](https://www.electron.build/auto-update#staged-rollouts) percentage, 0-100.\n   */\n  readonly stagingPercentage?: number\n\n  /**\n   * The minimum version of system required for the app to run. Sample value: macOS `23.1.0`, Windows `10.0.22631`.\n   * Same with os.release() value, this is a kernel version.\n   */\n  readonly minimumSystemVersion?: string\n}\n\nexport interface WindowsUpdateInfo extends UpdateInfo {\n  packages?: { [arch: string]: PackageFileInfo } | null\n\n  /**\n   * @deprecated\n   * @private\n   */\n  sha2?: string\n}\n"]}"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.nil = exports.UUID = void 0;
const crypto_1 = require("crypto");
const error_1 = require("./error");
const invalidName = "options.name must be either a string or a Buffer";
// Node ID according to rfc4122#section-4.5
const randomHost = (0, crypto_1.randomBytes)(16);
randomHost[0] = randomHost[0] | 0x01;
// lookup table hex to byte
const hex2byte = {};
// lookup table byte to hex
const byte2hex = [];
// populate lookup tables
for (let i = 0; i < 256; i++) {
    const hex = (i + 0x100).toString(16).substr(1);
    hex2byte[hex] = i;
    byte2hex[i] = hex;
}
// UUID class
class UUID {
    constructor(uuid) {
        this.ascii = null;
        this.binary = null;
        const check = UUID.check(uuid);
        if (!check) {
            throw new Error("not a UUID");
        }
        this.version = check.version;
        if (check.format === "ascii") {
            this.ascii = uuid;
        }
        else {
            this.binary = uuid;
        }
    }
    static v5(name, namespace) {
        return uuidNamed(name, "sha1", 0x50, namespace);
    }
    toString() {
        if (this.ascii == null) {
            this.ascii = stringify(this.binary);
        }
        return this.ascii;
    }
    inspect() {
        return `UUID v${this.version} ${this.toString()}`;
    }
    static check(uuid, offset = 0) {
        if (typeof uuid === "string") {
            uuid = uuid.toLowerCase();
            if (!/^[a-f0-9]{8}(-[a-f0-9]{4}){3}-([a-f0-9]{12})$/.test(uuid)) {
                return false;
            }
            if (uuid === "00000000-0000-0000-0000-000000000000") {
                return { version: undefined, variant: "nil", format: "ascii" };
            }
            return {
                version: (hex2byte[uuid[14] + uuid[15]] & 0xf0) >> 4,
                variant: getVariant((hex2byte[uuid[19] + uuid[20]] & 0xe0) >> 5),
                format: "ascii",
            };
        }
        if (Buffer.isBuffer(uuid)) {
            if (uuid.length < offset + 16) {
                return false;
            }
            let i = 0;
            for (; i < 16; i++) {
                if (uuid[offset + i] !== 0) {
                    break;
                }
            }
            if (i === 16) {
                return { version: undefined, variant: "nil", format: "binary" };
            }
            return {
                version: (uuid[offset + 6] & 0xf0) >> 4,
                variant: getVariant((uuid[offset + 8] & 0xe0) >> 5),
                format: "binary",
            };
        }
        throw (0, error_1.newError)("Unknown type of uuid", "ERR_UNKNOWN_UUID_TYPE");
    }
    // read stringified uuid into a Buffer
    static parse(input) {
        const buffer = Buffer.allocUnsafe(16);
        let j = 0;
        for (let i = 0; i < 16; i++) {
            buffer[i] = hex2byte[input[j++] + input[j++]];
            if (i === 3 || i === 5 || i === 7 || i === 9) {
                j += 1;
            }
        }
        return buffer;
    }
}
exports.UUID = UUID;
// from rfc4122#appendix-C
UUID.OID = UUID.parse("6ba7b812-9dad-11d1-80b4-00c04fd430c8");
// according to rfc4122#section-4.1.1
function getVariant(bits) {
    switch (bits) {
        case 0:
        case 1:
        case 3:
            return "ncs";
        case 4:
        case 5:
            return "rfc4122";
        case 6:
            return "microsoft";
        default:
            return "future";
    }
}
var UuidEncoding;
(function (UuidEncoding) {
    UuidEncoding[UuidEncoding["ASCII"] = 0] = "ASCII";
    UuidEncoding[UuidEncoding["BINARY"] = 1] = "BINARY";
    UuidEncoding[UuidEncoding["OBJECT"] = 2] = "OBJECT";
})(UuidEncoding || (UuidEncoding = {}));
// v3 + v5
function uuidNamed(name, hashMethod, version, namespace, encoding = UuidEncoding.ASCII) {
    const hash = (0, crypto_1.createHash)(hashMethod);
    const nameIsNotAString = typeof name !== "string";
    if (nameIsNotAString && !Buffer.isBuffer(name)) {
        throw (0, error_1.newError)(invalidName, "ERR_INVALID_UUID_NAME");
    }
    hash.update(namespace);
    hash.update(name);
    const buffer = hash.digest();
    let result;
    switch (encoding) {
        case UuidEncoding.BINARY:
            buffer[6] = (buffer[6] & 0x0f) | version;
            buffer[8] = (buffer[8] & 0x3f) | 0x80;
            result = buffer;
            break;
        case UuidEncoding.OBJECT:
            buffer[6] = (buffer[6] & 0x0f) | version;
            buffer[8] = (buffer[8] & 0x3f) | 0x80;
            result = new UUID(buffer);
            break;
        default:
            result =
                byte2hex[buffer[0]] +
                    byte2hex[buffer[1]] +
                    byte2hex[buffer[2]] +
                    byte2hex[buffer[3]] +
                    "-" +
                    byte2hex[buffer[4]] +
                    byte2hex[buffer[5]] +
                    "-" +
                    byte2hex[(buffer[6] & 0x0f) | version] +
                    byte2hex[buffer[7]] +
                    "-" +
                    byte2hex[(buffer[8] & 0x3f) | 0x80] +
                    byte2hex[buffer[9]] +
                    "-" +
                    byte2hex[buffer[10]] +
                    byte2hex[buffer[11]] +
                    byte2hex[buffer[12]] +
                    byte2hex[buffer[13]] +
                    byte2hex[buffer[14]] +
                    byte2hex[buffer[15]];
            break;
    }
    return result;
}
function stringify(buffer) {
    return (byte2hex[buffer[0]] +
        byte2hex[buffer[1]] +
        byte2hex[buffer[2]] +
        byte2hex[buffer[3]] +
        "-" +
        byte2hex[buffer[4]] +
        byte2hex[buffer[5]] +
        "-" +
        byte2hex[buffer[6]] +
        byte2hex[buffer[7]] +
        "-" +
        byte2hex[buffer[8]] +
        byte2hex[buffer[9]] +
        "-" +
        byte2hex[buffer[10]] +
        byte2hex[buffer[11]] +
        byte2hex[buffer[12]] +
        byte2hex[buffer[13]] +
        byte2hex[buffer[14]] +
        byte2hex[buffer[15]]);
}
// according to rfc4122#section-4.1.7
exports.nil = new UUID("00000000-0000-0000-0000-000000000000");
// UUID.v4 = uuidRandom
// UUID.v4fast = uuidRandomFast
// UUID.v3 = function(options, callback) {
//     return uuidNamed("md5", 0x30, options, callback)
// }
//# sourceMappingURL=uuid.js.map{"version":3,"file":"uuid.js","sourceRoot":"","sources":["../src/uuid.ts"],"names":[],"mappings":";;;AAAA,mCAAgD;AAChD,mCAAkC;AAElC,MAAM,WAAW,GAAG,kDAAkD,CAAA;AAEtE,2CAA2C;AAC3C,MAAM,UAAU,GAAG,IAAA,oBAAW,EAAC,EAAE,CAAC,CAAA;AAClC,UAAU,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,GAAG,IAAI,CAAA;AAEpC,2BAA2B;AAC3B,MAAM,QAAQ,GAAQ,EAAE,CAAA;AAExB,2BAA2B;AAC3B,MAAM,QAAQ,GAAkB,EAAE,CAAA;AAClC,yBAAyB;AACzB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC;IAC7B,MAAM,GAAG,GAAG,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;IAC9C,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;IACjB,QAAQ,CAAC,CAAC,CAAC,GAAG,GAAG,CAAA;AACnB,CAAC;AAED,aAAa;AACb,MAAa,IAAI;IAQf,YAAY,IAAqB;QAPzB,UAAK,GAAkB,IAAI,CAAA;QAClB,WAAM,GAAkB,IAAI,CAAA;QAO3C,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;QAC9B,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,MAAM,IAAI,KAAK,CAAC,YAAY,CAAC,CAAA;QAC/B,CAAC;QAED,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC,OAAQ,CAAA;QAE7B,IAAI,KAAK,CAAC,MAAM,KAAK,OAAO,EAAE,CAAC;YAC7B,IAAI,CAAC,KAAK,GAAG,IAAc,CAAA;QAC7B,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,MAAM,GAAG,IAAc,CAAA;QAC9B,CAAC;IACH,CAAC;IAED,MAAM,CAAC,EAAE,CAAC,IAAqB,EAAE,SAAiB;QAChD,OAAO,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,CAAC,CAAA;IACjD,CAAC;IAED,QAAQ;QACN,IAAI,IAAI,CAAC,KAAK,IAAI,IAAI,EAAE,CAAC;YACvB,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC,IAAI,CAAC,MAAO,CAAC,CAAA;QACtC,CAAC;QACD,OAAO,IAAI,CAAC,KAAK,CAAA;IACnB,CAAC;IAED,OAAO;QACL,OAAO,SAAS,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,QAAQ,EAAE,EAAE,CAAA;IACnD,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,IAAqB,EAAE,MAAM,GAAG,CAAC;QAC5C,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;YAC7B,IAAI,GAAG,IAAI,CAAC,WAAW,EAAE,CAAA;YAEzB,IAAI,CAAC,+CAA+C,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;gBAChE,OAAO,KAAK,CAAA;YACd,CAAC;YAED,IAAI,IAAI,KAAK,sCAAsC,EAAE,CAAC;gBACpD,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,CAAA;YAChE,CAAC;YAED,OAAO;gBACL,OAAO,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC;gBACpD,OAAO,EAAE,UAAU,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC;gBAChE,MAAM,EAAE,OAAO;aAChB,CAAA;QACH,CAAC;QAED,IAAI,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;YAC1B,IAAI,IAAI,CAAC,MAAM,GAAG,MAAM,GAAG,EAAE,EAAE,CAAC;gBAC9B,OAAO,KAAK,CAAA;YACd,CAAC;YAED,IAAI,CAAC,GAAG,CAAC,CAAA;YACT,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC;gBACnB,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC;oBAC3B,MAAK;gBACP,CAAC;YACH,CAAC;YACD,IAAI,CAAC,KAAK,EAAE,EAAE,CAAC;gBACb,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAA;YACjE,CAAC;YAED,OAAO;gBACL,OAAO,EAAE,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC;gBACvC,OAAO,EAAE,UAAU,CAAC,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC;gBACnD,MAAM,EAAE,QAAQ;aACjB,CAAA;QACH,CAAC;QAED,MAAM,IAAA,gBAAQ,EAAC,sBAAsB,EAAE,uBAAuB,CAAC,CAAA;IACjE,CAAC;IAED,sCAAsC;IACtC,MAAM,CAAC,KAAK,CAAC,KAAa;QACxB,MAAM,MAAM,GAAG,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC,CAAA;QACrC,IAAI,CAAC,GAAG,CAAC,CAAA;QACT,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC;YAC5B,MAAM,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;YAC7C,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;gBAC7C,CAAC,IAAI,CAAC,CAAA;YACR,CAAC;QACH,CAAC;QACD,OAAO,MAAM,CAAA;IACf,CAAC;;AA7FH,oBA8FC;AAzFC,0BAA0B;AACV,QAAG,GAAW,IAAI,CAAC,KAAK,CAAC,sCAAsC,CAAC,AAA7D,CAA6D;AA0FlF,qCAAqC;AACrC,SAAS,UAAU,CAAC,IAAY;IAC9B,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,CAAC,CAAC;QACP,KAAK,CAAC,CAAC;QACP,KAAK,CAAC;YACJ,OAAO,KAAK,CAAA;QACd,KAAK,CAAC,CAAC;QACP,KAAK,CAAC;YACJ,OAAO,SAAS,CAAA;QAClB,KAAK,CAAC;YACJ,OAAO,WAAW,CAAA;QACpB;YACE,OAAO,QAAQ,CAAA;IACnB,CAAC;AACH,CAAC;AAED,IAAK,YAIJ;AAJD,WAAK,YAAY;IACf,iDAAK,CAAA;IACL,mDAAM,CAAA;IACN,mDAAM,CAAA;AACR,CAAC,EAJI,YAAY,KAAZ,YAAY,QAIhB;AAED,UAAU;AACV,SAAS,SAAS,CAAC,IAAqB,EAAE,UAAkB,EAAE,OAAe,EAAE,SAAiB,EAAE,WAAyB,YAAY,CAAC,KAAK;IAC3I,MAAM,IAAI,GAAG,IAAA,mBAAU,EAAC,UAAU,CAAC,CAAA;IAEnC,MAAM,gBAAgB,GAAG,OAAO,IAAI,KAAK,QAAQ,CAAA;IACjD,IAAI,gBAAgB,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;QAC/C,MAAM,IAAA,gBAAQ,EAAC,WAAW,EAAE,uBAAuB,CAAC,CAAA;IACtD,CAAC;IAED,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAA;IACtB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;IAEjB,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,EAAE,CAAA;IAC5B,IAAI,MAAW,CAAA;IACf,QAAQ,QAAQ,EAAE,CAAC;QACjB,KAAK,YAAY,CAAC,MAAM;YACtB,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,OAAO,CAAA;YACxC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,IAAI,CAAA;YACrC,MAAM,GAAG,MAAM,CAAA;YACf,MAAK;QACP,KAAK,YAAY,CAAC,MAAM;YACtB,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,OAAO,CAAA;YACxC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,IAAI,CAAA;YACrC,MAAM,GAAG,IAAI,IAAI,CAAC,MAAM,CAAC,CAAA;YACzB,MAAK;QACP;YACE,MAAM;gBACJ,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;oBACnB,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;oBACnB,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;oBACnB,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;oBACnB,GAAG;oBACH,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;oBACnB,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;oBACnB,GAAG;oBACH,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,OAAO,CAAC;oBACtC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;oBACnB,GAAG;oBACH,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC;oBACnC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;oBACnB,GAAG;oBACH,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;oBACpB,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;oBACpB,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;oBACpB,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;oBACpB,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;oBACpB,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAA;YACtB,MAAK;IACT,CAAC;IACD,OAAO,MAAM,CAAA;AACf,CAAC;AAED,SAAS,SAAS,CAAC,MAAc;IAC/B,OAAO,CACL,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QACnB,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QACnB,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QACnB,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QACnB,GAAG;QACH,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QACnB,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QACnB,GAAG;QACH,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QACnB,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QACnB,GAAG;QACH,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QACnB,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QACnB,GAAG;QACH,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QACpB,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QACpB,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QACpB,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QACpB,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QACpB,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CACrB,CAAA;AACH,CAAC;AAED,qCAAqC;AACxB,QAAA,GAAG,GAAG,IAAI,IAAI,CAAC,sCAAsC,CAAC,CAAA;AAEnE,uBAAuB;AAEvB,+BAA+B;AAE/B,0CAA0C;AAC1C,uDAAuD;AACvD,IAAI","sourcesContent":["import { createHash, randomBytes } from \"crypto\"\nimport { newError } from \"./error\"\n\nconst invalidName = \"options.name must be either a string or a Buffer\"\n\n// Node ID according to rfc4122#section-4.5\nconst randomHost = randomBytes(16)\nrandomHost[0] = randomHost[0] | 0x01\n\n// lookup table hex to byte\nconst hex2byte: any = {}\n\n// lookup table byte to hex\nconst byte2hex: Array<string> = []\n// populate lookup tables\nfor (let i = 0; i < 256; i++) {\n  const hex = (i + 0x100).toString(16).substr(1)\n  hex2byte[hex] = i\n  byte2hex[i] = hex\n}\n\n// UUID class\nexport class UUID {\n  private ascii: string | null = null\n  private readonly binary: Buffer | null = null\n  private readonly version: number\n\n  // from rfc4122#appendix-C\n  static readonly OID: Buffer = UUID.parse(\"6ba7b812-9dad-11d1-80b4-00c04fd430c8\")\n\n  constructor(uuid: Buffer | string) {\n    const check = UUID.check(uuid)\n    if (!check) {\n      throw new Error(\"not a UUID\")\n    }\n\n    this.version = check.version!\n\n    if (check.format === \"ascii\") {\n      this.ascii = uuid as string\n    } else {\n      this.binary = uuid as Buffer\n    }\n  }\n\n  static v5(name: string | Buffer, namespace: Buffer) {\n    return uuidNamed(name, \"sha1\", 0x50, namespace)\n  }\n\n  toString() {\n    if (this.ascii == null) {\n      this.ascii = stringify(this.binary!)\n    }\n    return this.ascii\n  }\n\n  inspect() {\n    return `UUID v${this.version} ${this.toString()}`\n  }\n\n  static check(uuid: Buffer | string, offset = 0) {\n    if (typeof uuid === \"string\") {\n      uuid = uuid.toLowerCase()\n\n      if (!/^[a-f0-9]{8}(-[a-f0-9]{4}){3}-([a-f0-9]{12})$/.test(uuid)) {\n        return false\n      }\n\n      if (uuid === \"00000000-0000-0000-0000-000000000000\") {\n        return { version: undefined, variant: \"nil\", format: \"ascii\" }\n      }\n\n      return {\n        version: (hex2byte[uuid[14] + uuid[15]] & 0xf0) >> 4,\n        variant: getVariant((hex2byte[uuid[19] + uuid[20]] & 0xe0) >> 5),\n        format: \"ascii\",\n      }\n    }\n\n    if (Buffer.isBuffer(uuid)) {\n      if (uuid.length < offset + 16) {\n        return false\n      }\n\n      let i = 0\n      for (; i < 16; i++) {\n        if (uuid[offset + i] !== 0) {\n          break\n        }\n      }\n      if (i === 16) {\n        return { version: undefined, variant: \"nil\", format: \"binary\" }\n      }\n\n      return {\n        version: (uuid[offset + 6] & 0xf0) >> 4,\n        variant: getVariant((uuid[offset + 8] & 0xe0) >> 5),\n        format: \"binary\",\n      }\n    }\n\n    throw newError(\"Unknown type of uuid\", \"ERR_UNKNOWN_UUID_TYPE\")\n  }\n\n  // read stringified uuid into a Buffer\n  static parse(input: string): Buffer {\n    const buffer = Buffer.allocUnsafe(16)\n    let j = 0\n    for (let i = 0; i < 16; i++) {\n      buffer[i] = hex2byte[input[j++] + input[j++]]\n      if (i === 3 || i === 5 || i === 7 || i === 9) {\n        j += 1\n      }\n    }\n    return buffer\n  }\n}\n\n// according to rfc4122#section-4.1.1\nfunction getVariant(bits: number) {\n  switch (bits) {\n    case 0:\n    case 1:\n    case 3:\n      return \"ncs\"\n    case 4:\n    case 5:\n      return \"rfc4122\"\n    case 6:\n      return \"microsoft\"\n    default:\n      return \"future\"\n  }\n}\n\nenum UuidEncoding {\n  ASCII,\n  BINARY,\n  OBJECT,\n}\n\n// v3 + v5\nfunction uuidNamed(name: string | Buffer, hashMethod: string, version: number, namespace: Buffer, encoding: UuidEncoding = UuidEncoding.ASCII) {\n  const hash = createHash(hashMethod)\n\n  const nameIsNotAString = typeof name !== \"string\"\n  if (nameIsNotAString && !Buffer.isBuffer(name)) {\n    throw newError(invalidName, \"ERR_INVALID_UUID_NAME\")\n  }\n\n  hash.update(namespace)\n  hash.update(name)\n\n  const buffer = hash.digest()\n  let result: any\n  switch (encoding) {\n    case UuidEncoding.BINARY:\n      buffer[6] = (buffer[6] & 0x0f) | version\n      buffer[8] = (buffer[8] & 0x3f) | 0x80\n      result = buffer\n      break\n    case UuidEncoding.OBJECT:\n      buffer[6] = (buffer[6] & 0x0f) | version\n      buffer[8] = (buffer[8] & 0x3f) | 0x80\n      result = new UUID(buffer)\n      break\n    default:\n      result =\n        byte2hex[buffer[0]] +\n        byte2hex[buffer[1]] +\n        byte2hex[buffer[2]] +\n        byte2hex[buffer[3]] +\n        \"-\" +\n        byte2hex[buffer[4]] +\n        byte2hex[buffer[5]] +\n        \"-\" +\n        byte2hex[(buffer[6] & 0x0f) | version] +\n        byte2hex[buffer[7]] +\n        \"-\" +\n        byte2hex[(buffer[8] & 0x3f) | 0x80] +\n        byte2hex[buffer[9]] +\n        \"-\" +\n        byte2hex[buffer[10]] +\n        byte2hex[buffer[11]] +\n        byte2hex[buffer[12]] +\n        byte2hex[buffer[13]] +\n        byte2hex[buffer[14]] +\n        byte2hex[buffer[15]]\n      break\n  }\n  return result\n}\n\nfunction stringify(buffer: Buffer) {\n  return (\n    byte2hex[buffer[0]] +\n    byte2hex[buffer[1]] +\n    byte2hex[buffer[2]] +\n    byte2hex[buffer[3]] +\n    \"-\" +\n    byte2hex[buffer[4]] +\n    byte2hex[buffer[5]] +\n    \"-\" +\n    byte2hex[buffer[6]] +\n    byte2hex[buffer[7]] +\n    \"-\" +\n    byte2hex[buffer[8]] +\n    byte2hex[buffer[9]] +\n    \"-\" +\n    byte2hex[buffer[10]] +\n    byte2hex[buffer[11]] +\n    byte2hex[buffer[12]] +\n    byte2hex[buffer[13]] +\n    byte2hex[buffer[14]] +\n    byte2hex[buffer[15]]\n  )\n}\n\n// according to rfc4122#section-4.1.7\nexport const nil = new UUID(\"00000000-0000-0000-0000-000000000000\")\n\n// UUID.v4 = uuidRandom\n\n// UUID.v4fast = uuidRandomFast\n\n// UUID.v3 = function(options, callback) {\n//     return uuidNamed(\"md5\", 0x30, options, callback)\n// }\n"]}"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.XElement = void 0;
exports.parseXml = parseXml;
const sax = require("sax");
const error_1 = require("./error");
class XElement {
    constructor(name) {
        this.name = name;
        this.value = "";
        this.attributes = null;
        this.isCData = false;
        this.elements = null;
        if (!name) {
            throw (0, error_1.newError)("Element name cannot be empty", "ERR_XML_ELEMENT_NAME_EMPTY");
        }
        if (!isValidName(name)) {
            throw (0, error_1.newError)(`Invalid element name: ${name}`, "ERR_XML_ELEMENT_INVALID_NAME");
        }
    }
    attribute(name) {
        const result = this.attributes === null ? null : this.attributes[name];
        if (result == null) {
            throw (0, error_1.newError)(`No attribute "${name}"`, "ERR_XML_MISSED_ATTRIBUTE");
        }
        return result;
    }
    removeAttribute(name) {
        if (this.attributes !== null) {
            delete this.attributes[name];
        }
    }
    element(name, ignoreCase = false, errorIfMissed = null) {
        const result = this.elementOrNull(name, ignoreCase);
        if (result === null) {
            throw (0, error_1.newError)(errorIfMissed || `No element "${name}"`, "ERR_XML_MISSED_ELEMENT");
        }
        return result;
    }
    elementOrNull(name, ignoreCase = false) {
        if (this.elements === null) {
            return null;
        }
        for (const element of this.elements) {
            if (isNameEquals(element, name, ignoreCase)) {
                return element;
            }
        }
        return null;
    }
    getElements(name, ignoreCase = false) {
        if (this.elements === null) {
            return [];
        }
        return this.elements.filter(it => isNameEquals(it, name, ignoreCase));
    }
    elementValueOrEmpty(name, ignoreCase = false) {
        const element = this.elementOrNull(name, ignoreCase);
        return element === null ? "" : element.value;
    }
}
exports.XElement = XElement;
const NAME_REG_EXP = new RegExp(/^[A-Za-z_][:A-Za-z0-9_-]*$/i);
function isValidName(name) {
    return NAME_REG_EXP.test(name);
}
function isNameEquals(element, name, ignoreCase) {
    const elementName = element.name;
    return elementName === name || (ignoreCase === true && elementName.length === name.length && elementName.toLowerCase() === name.toLowerCase());
}
function parseXml(data) {
    let rootElement = null;
    const parser = sax.parser(true, {});
    const elements = [];
    parser.onopentag = saxElement => {
        const element = new XElement(saxElement.name);
        element.attributes = saxElement.attributes;
        if (rootElement === null) {
            rootElement = element;
        }
        else {
            const parent = elements[elements.length - 1];
            if (parent.elements == null) {
                parent.elements = [];
            }
            parent.elements.push(element);
        }
        elements.push(element);
    };
    parser.onclosetag = () => {
        elements.pop();
    };
    parser.ontext = text => {
        if (elements.length > 0) {
            elements[elements.length - 1].value = text;
        }
    };
    parser.oncdata = cdata => {
        const element = elements[elements.length - 1];
        element.value = cdata;
        element.isCData = true;
    };
    parser.onerror = err => {
        throw err;
    };
    parser.write(data);
    return rootElement;
}
//# sourceMappingURL=xml.js.map{"version":3,"file":"xml.js","sourceRoot":"","sources":["../src/xml.ts"],"names":[],"mappings":";;;AA8EA,4BA2CC;AAzHD,2BAA0B;AAC1B,mCAAkC;AAElC,MAAa,QAAQ;IAMnB,YAAqB,IAAY;QAAZ,SAAI,GAAJ,IAAI,CAAQ;QALjC,UAAK,GAAG,EAAE,CAAA;QACV,eAAU,GAAkC,IAAI,CAAA;QAChD,YAAO,GAAG,KAAK,CAAA;QACf,aAAQ,GAA2B,IAAI,CAAA;QAGrC,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,MAAM,IAAA,gBAAQ,EAAC,8BAA8B,EAAE,4BAA4B,CAAC,CAAA;QAC9E,CAAC;QACD,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC;YACvB,MAAM,IAAA,gBAAQ,EAAC,yBAAyB,IAAI,EAAE,EAAE,8BAA8B,CAAC,CAAA;QACjF,CAAC;IACH,CAAC;IAED,SAAS,CAAC,IAAY;QACpB,MAAM,MAAM,GAAG,IAAI,CAAC,UAAU,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAA;QACtE,IAAI,MAAM,IAAI,IAAI,EAAE,CAAC;YACnB,MAAM,IAAA,gBAAQ,EAAC,iBAAiB,IAAI,GAAG,EAAE,0BAA0B,CAAC,CAAA;QACtE,CAAC;QACD,OAAO,MAAM,CAAA;IACf,CAAC;IAED,eAAe,CAAC,IAAY;QAC1B,IAAI,IAAI,CAAC,UAAU,KAAK,IAAI,EAAE,CAAC;YAC7B,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAA;QAC9B,CAAC;IACH,CAAC;IAED,OAAO,CAAC,IAAY,EAAE,UAAU,GAAG,KAAK,EAAE,gBAA+B,IAAI;QAC3E,MAAM,MAAM,GAAG,IAAI,CAAC,aAAa,CAAC,IAAI,EAAE,UAAU,CAAC,CAAA;QACnD,IAAI,MAAM,KAAK,IAAI,EAAE,CAAC;YACpB,MAAM,IAAA,gBAAQ,EAAC,aAAa,IAAI,eAAe,IAAI,GAAG,EAAE,wBAAwB,CAAC,CAAA;QACnF,CAAC;QACD,OAAO,MAAM,CAAA;IACf,CAAC;IAED,aAAa,CAAC,IAAY,EAAE,UAAU,GAAG,KAAK;QAC5C,IAAI,IAAI,CAAC,QAAQ,KAAK,IAAI,EAAE,CAAC;YAC3B,OAAO,IAAI,CAAA;QACb,CAAC;QAED,KAAK,MAAM,OAAO,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YACpC,IAAI,YAAY,CAAC,OAAO,EAAE,IAAI,EAAE,UAAU,CAAC,EAAE,CAAC;gBAC5C,OAAO,OAAO,CAAA;YAChB,CAAC;QACH,CAAC;QAED,OAAO,IAAI,CAAA;IACb,CAAC;IAED,WAAW,CAAC,IAAY,EAAE,UAAU,GAAG,KAAK;QAC1C,IAAI,IAAI,CAAC,QAAQ,KAAK,IAAI,EAAE,CAAC;YAC3B,OAAO,EAAE,CAAA;QACX,CAAC;QACD,OAAO,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC,YAAY,CAAC,EAAE,EAAE,IAAI,EAAE,UAAU,CAAC,CAAC,CAAA;IACvE,CAAC;IAED,mBAAmB,CAAC,IAAY,EAAE,UAAU,GAAG,KAAK;QAClD,MAAM,OAAO,GAAG,IAAI,CAAC,aAAa,CAAC,IAAI,EAAE,UAAU,CAAC,CAAA;QACpD,OAAO,OAAO,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAA;IAC9C,CAAC;CACF;AA9DD,4BA8DC;AAED,MAAM,YAAY,GAAG,IAAI,MAAM,CAAC,6BAA6B,CAAC,CAAA;AAE9D,SAAS,WAAW,CAAC,IAAY;IAC/B,OAAO,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AAChC,CAAC;AAED,SAAS,YAAY,CAAC,OAAiB,EAAE,IAAY,EAAE,UAAmB;IACxE,MAAM,WAAW,GAAG,OAAO,CAAC,IAAI,CAAA;IAChC,OAAO,WAAW,KAAK,IAAI,IAAI,CAAC,UAAU,KAAK,IAAI,IAAI,WAAW,CAAC,MAAM,KAAK,IAAI,CAAC,MAAM,IAAI,WAAW,CAAC,WAAW,EAAE,KAAK,IAAI,CAAC,WAAW,EAAE,CAAC,CAAA;AAChJ,CAAC;AAED,SAAgB,QAAQ,CAAC,IAAY;IACnC,IAAI,WAAW,GAAoB,IAAI,CAAA;IACvC,MAAM,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC,CAAA;IACnC,MAAM,QAAQ,GAAoB,EAAE,CAAA;IAEpC,MAAM,CAAC,SAAS,GAAG,UAAU,CAAC,EAAE;QAC9B,MAAM,OAAO,GAAG,IAAI,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,CAAA;QAC7C,OAAO,CAAC,UAAU,GAAG,UAAU,CAAC,UAAoC,CAAA;QAEpE,IAAI,WAAW,KAAK,IAAI,EAAE,CAAC;YACzB,WAAW,GAAG,OAAO,CAAA;QACvB,CAAC;aAAM,CAAC;YACN,MAAM,MAAM,GAAG,QAAQ,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAA;YAC5C,IAAI,MAAM,CAAC,QAAQ,IAAI,IAAI,EAAE,CAAC;gBAC5B,MAAM,CAAC,QAAQ,GAAG,EAAE,CAAA;YACtB,CAAC;YACD,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;QAC/B,CAAC;QACD,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;IACxB,CAAC,CAAA;IAED,MAAM,CAAC,UAAU,GAAG,GAAG,EAAE;QACvB,QAAQ,CAAC,GAAG,EAAE,CAAA;IAChB,CAAC,CAAA;IAED,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE;QACrB,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACxB,QAAQ,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,KAAK,GAAG,IAAI,CAAA;QAC5C,CAAC;IACH,CAAC,CAAA;IAED,MAAM,CAAC,OAAO,GAAG,KAAK,CAAC,EAAE;QACvB,MAAM,OAAO,GAAG,QAAQ,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAA;QAC7C,OAAO,CAAC,KAAK,GAAG,KAAK,CAAA;QACrB,OAAO,CAAC,OAAO,GAAG,IAAI,CAAA;IACxB,CAAC,CAAA;IAED,MAAM,CAAC,OAAO,GAAG,GAAG,CAAC,EAAE;QACrB,MAAM,GAAG,CAAA;IACX,CAAC,CAAA;IAED,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;IAClB,OAAO,WAAY,CAAA;AACrB,CAAC","sourcesContent":["import * as sax from \"sax\"\nimport { newError } from \"./error\"\n\nexport class XElement {\n  value = \"\"\n  attributes: Record<string, string> | null = null\n  isCData = false\n  elements: Array<XElement> | null = null\n\n  constructor(readonly name: string) {\n    if (!name) {\n      throw newError(\"Element name cannot be empty\", \"ERR_XML_ELEMENT_NAME_EMPTY\")\n    }\n    if (!isValidName(name)) {\n      throw newError(`Invalid element name: ${name}`, \"ERR_XML_ELEMENT_INVALID_NAME\")\n    }\n  }\n\n  attribute(name: string): string {\n    const result = this.attributes === null ? null : this.attributes[name]\n    if (result == null) {\n      throw newError(`No attribute \"${name}\"`, \"ERR_XML_MISSED_ATTRIBUTE\")\n    }\n    return result\n  }\n\n  removeAttribute(name: string): void {\n    if (this.attributes !== null) {\n      delete this.attributes[name]\n    }\n  }\n\n  element(name: string, ignoreCase = false, errorIfMissed: string | null = null): XElement {\n    const result = this.elementOrNull(name, ignoreCase)\n    if (result === null) {\n      throw newError(errorIfMissed || `No element \"${name}\"`, \"ERR_XML_MISSED_ELEMENT\")\n    }\n    return result\n  }\n\n  elementOrNull(name: string, ignoreCase = false): XElement | null {\n    if (this.elements === null) {\n      return null\n    }\n\n    for (const element of this.elements) {\n      if (isNameEquals(element, name, ignoreCase)) {\n        return element\n      }\n    }\n\n    return null\n  }\n\n  getElements(name: string, ignoreCase = false) {\n    if (this.elements === null) {\n      return []\n    }\n    return this.elements.filter(it => isNameEquals(it, name, ignoreCase))\n  }\n\n  elementValueOrEmpty(name: string, ignoreCase = false): string {\n    const element = this.elementOrNull(name, ignoreCase)\n    return element === null ? \"\" : element.value\n  }\n}\n\nconst NAME_REG_EXP = new RegExp(/^[A-Za-z_][:A-Za-z0-9_-]*$/i)\n\nfunction isValidName(name: string) {\n  return NAME_REG_EXP.test(name)\n}\n\nfunction isNameEquals(element: XElement, name: string, ignoreCase: boolean) {\n  const elementName = element.name\n  return elementName === name || (ignoreCase === true && elementName.length === name.length && elementName.toLowerCase() === name.toLowerCase())\n}\n\nexport function parseXml(data: string): XElement {\n  let rootElement: XElement | null = null\n  const parser = sax.parser(true, {})\n  const elements: Array<XElement> = []\n\n  parser.onopentag = saxElement => {\n    const element = new XElement(saxElement.name)\n    element.attributes = saxElement.attributes as Record<string, string>\n\n    if (rootElement === null) {\n      rootElement = element\n    } else {\n      const parent = elements[elements.length - 1]\n      if (parent.elements == null) {\n        parent.elements = []\n      }\n      parent.elements.push(element)\n    }\n    elements.push(element)\n  }\n\n  parser.onclosetag = () => {\n    elements.pop()\n  }\n\n  parser.ontext = text => {\n    if (elements.length > 0) {\n      elements[elements.length - 1].value = text\n    }\n  }\n\n  parser.oncdata = cdata => {\n    const element = elements[elements.length - 1]\n    element.value = cdata\n    element.isCData = true\n  }\n\n  parser.onerror = err => {\n    throw err\n  }\n\n  parser.write(data)\n  return rootElement!\n}\n"]}{
  "name": "builder-util-runtime",
  "version": "9.7.0",
  "main": "out/index.js",
  "author": "Vladimir Krivosheev",
  "license": "MIT",
  "repository": {
    "type": "git",
    "url": "git+https://github.com/electron-userland/electron-builder.git",
    "directory": "packages/builder-util-runtime"
  },
  "homepage": "https://github.com/electron-userland/electron-builder",
  "files": [
    "out"
  ],
  "engines": {
    "node": ">=12.0.0"
  },
  "dependencies": {
    "debug": "^4.3.4",
    "sax": "^1.2.4"
  },
  "devDependencies": {
    "@types/debug": "4.1.7",
    "@types/sax": "1.2.3"
  },
  "types": "./out/index.d.ts"
}(The MIT License)

Copyright (c) 2014-2017 TJ Holowaychuk <tj@vision-media.ca>
Copyright (c) 2018-2021 Josh Junon

Permission is hereby granted, free of charge, to any person obtaining a copy of this software
and associated documentation files (the 'Software'), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial
portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

{
  "name": "debug",
  "version": "4.4.3",
  "repository": {
    "type": "git",
    "url": "git://github.com/debug-js/debug.git"
  },
  "description": "Lightweight debugging utility for Node.js and the browser",
  "files": [
    "src",
    "LICENSE",
    "README.md"
  ],
  "author": "Josh Junon (https://github.com/qix-)",
  "license": "MIT",
  "dependencies": {
    "ms": "^2.1.3"
  },
  "devDependencies": {
    "brfs": "^2.0.1",
    "browserify": "^16.2.3",
    "coveralls": "^3.0.2",
    "karma": "^3.1.4",
    "karma-browserify": "^6.0.0",
    "karma-chrome-launcher": "^2.2.0",
    "karma-mocha": "^1.3.0",
    "mocha": "^5.2.0",
    "mocha-lcov-reporter": "^1.2.0",
    "sinon": "^14.0.0",
    "xo": "^0.23.0"
  },
  "peerDependenciesMeta": {
    "supports-color": {
      "optional": true
    }
  },
  "main": "./src/index.js",
  "browser": "./src/browser.js",
  "engines": {
    "node": ">=6.0"
  }
}/* eslint-env browser */

/**
 * This is the web browser implementation of `debug()`.
 */

exports.formatArgs = formatArgs;
exports.save = save;
exports.load = load;
exports.useColors = useColors;
exports.storage = localstorage();
exports.destroy = (() => {
	let warned = false;

	return () => {
		if (!warned) {
			warned = true;
			console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
		}
	};
})();

/**
 * Colors.
 */

exports.colors = [
	'#0000CC',
	'#0000FF',
	'#0033CC',
	'#0033FF',
	'#0066CC',
	'#0066FF',
	'#0099CC',
	'#0099FF',
	'#00CC00',
	'#00CC33',
	'#00CC66',
	'#00CC99',
	'#00CCCC',
	'#00CCFF',
	'#3300CC',
	'#3300FF',
	'#3333CC',
	'#3333FF',
	'#3366CC',
	'#3366FF',
	'#3399CC',
	'#3399FF',
	'#33CC00',
	'#33CC33',
	'#33CC66',
	'#33CC99',
	'#33CCCC',
	'#33CCFF',
	'#6600CC',
	'#6600FF',
	'#6633CC',
	'#6633FF',
	'#66CC00',
	'#66CC33',
	'#9900CC',
	'#9900FF',
	'#9933CC',
	'#9933FF',
	'#99CC00',
	'#99CC33',
	'#CC0000',
	'#CC0033',
	'#CC0066',
	'#CC0099',
	'#CC00CC',
	'#CC00FF',
	'#CC3300',
	'#CC3333',
	'#CC3366',
	'#CC3399',
	'#CC33CC',
	'#CC33FF',
	'#CC6600',
	'#CC6633',
	'#CC9900',
	'#CC9933',
	'#CCCC00',
	'#CCCC33',
	'#FF0000',
	'#FF0033',
	'#FF0066',
	'#FF0099',
	'#FF00CC',
	'#FF00FF',
	'#FF3300',
	'#FF3333',
	'#FF3366',
	'#FF3399',
	'#FF33CC',
	'#FF33FF',
	'#FF6600',
	'#FF6633',
	'#FF9900',
	'#FF9933',
	'#FFCC00',
	'#FFCC33'
];

/**
 * Currently only WebKit-based Web Inspectors, Firefox >= v31,
 * and the Firebug extension (any Firefox version) are known
 * to support "%c" CSS customizations.
 *
 * TODO: add a `localStorage` variable to explicitly enable/disable colors
 */

// eslint-disable-next-line complexity
function useColors() {
	// NB: In an Electron preload script, document will be defined but not fully
	// initialized. Since we know we're in Chrome, we'll just detect this case
	// explicitly
	if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {
		return true;
	}

	// Internet Explorer and Edge do not support colors.
	if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
		return false;
	}

	let m;

	// Is webkit? http://stackoverflow.com/a/16459606/376773
	// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
	// eslint-disable-next-line no-return-assign
	return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||
		// Is firebug? http://stackoverflow.com/a/398120/376773
		(typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||
		// Is firefox >= v31?
		// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
		(typeof navigator !== 'undefined' && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(m[1], 10) >= 31) ||
		// Double check webkit in userAgent just in case we are in a worker
		(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/));
}

/**
 * Colorize log arguments if enabled.
 *
 * @api public
 */

function formatArgs(args) {
	args[0] = (this.useColors ? '%c' : '') +
		this.namespace +
		(this.useColors ? ' %c' : ' ') +
		args[0] +
		(this.useColors ? '%c ' : ' ') +
		'+' + module.exports.humanize(this.diff);

	if (!this.useColors) {
		return;
	}

	const c = 'color: ' + this.color;
	args.splice(1, 0, c, 'color: inherit');

	// The final "%c" is somewhat tricky, because there could be other
	// arguments passed either before or after the %c, so we need to
	// figure out the correct index to insert the CSS into
	let index = 0;
	let lastC = 0;
	args[0].replace(/%[a-zA-Z%]/g, match => {
		if (match === '%%') {
			return;
		}
		index++;
		if (match === '%c') {
			// We only are interested in the *last* %c
			// (the user may have provided their own)
			lastC = index;
		}
	});

	args.splice(lastC, 0, c);
}

/**
 * Invokes `console.debug()` when available.
 * No-op when `console.debug` is not a "function".
 * If `console.debug` is not available, falls back
 * to `console.log`.
 *
 * @api public
 */
exports.log = console.debug || console.log || (() => {});

/**
 * Save `namespaces`.
 *
 * @param {String} namespaces
 * @api private
 */
function save(namespaces) {
	try {
		if (namespaces) {
			exports.storage.setItem('debug', namespaces);
		} else {
			exports.storage.removeItem('debug');
		}
	} catch (error) {
		// Swallow
		// XXX (@Qix-) should we be logging these?
	}
}

/**
 * Load `namespaces`.
 *
 * @return {String} returns the previously persisted debug modes
 * @api private
 */
function load() {
	let r;
	try {
		r = exports.storage.getItem('debug') || exports.storage.getItem('DEBUG') ;
	} catch (error) {
		// Swallow
		// XXX (@Qix-) should we be logging these?
	}

	// If debug isn't set in LS, and we're in Electron, try to load $DEBUG
	if (!r && typeof process !== 'undefined' && 'env' in process) {
		r = process.env.DEBUG;
	}

	return r;
}

/**
 * Localstorage attempts to return the localstorage.
 *
 * This is necessary because safari throws
 * when a user disables cookies/localstorage
 * and you attempt to access it.
 *
 * @return {LocalStorage}
 * @api private
 */

function localstorage() {
	try {
		// TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context
		// The Browser also has localStorage in the global context.
		return localStorage;
	} catch (error) {
		// Swallow
		// XXX (@Qix-) should we be logging these?
	}
}

module.exports = require('./common')(exports);

const {formatters} = module.exports;

/**
 * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
 */

formatters.j = function (v) {
	try {
		return JSON.stringify(v);
	} catch (error) {
		return '[UnexpectedJSONParseError]: ' + error.message;
	}
};

/**
 * This is the common logic for both the Node.js and web browser
 * implementations of `debug()`.
 */

function setup(env) {
	createDebug.debug = createDebug;
	createDebug.default = createDebug;
	createDebug.coerce = coerce;
	createDebug.disable = disable;
	createDebug.enable = enable;
	createDebug.enabled = enabled;
	createDebug.humanize = require('ms');
	createDebug.destroy = destroy;

	Object.keys(env).forEach(key => {
		createDebug[key] = env[key];
	});

	/**
	* The currently active debug mode names, and names to skip.
	*/

	createDebug.names = [];
	createDebug.skips = [];

	/**
	* Map of special "%n" handling functions, for the debug "format" argument.
	*
	* Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
	*/
	createDebug.formatters = {};

	/**
	* Selects a color for a debug namespace
	* @param {String} namespace The namespace string for the debug instance to be colored
	* @return {Number|String} An ANSI color code for the given namespace
	* @api private
	*/
	function selectColor(namespace) {
		let hash = 0;

		for (let i = 0; i < namespace.length; i++) {
			hash = ((hash << 5) - hash) + namespace.charCodeAt(i);
			hash |= 0; // Convert to 32bit integer
		}

		return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
	}
	createDebug.selectColor = selectColor;

	/**
	* Create a debugger with the given `namespace`.
	*
	* @param {String} namespace
	* @return {Function}
	* @api public
	*/
	function createDebug(namespace) {
		let prevTime;
		let enableOverride = null;
		let namespacesCache;
		let enabledCache;

		function debug(...args) {
			// Disabled?
			if (!debug.enabled) {
				return;
			}

			const self = debug;

			// Set `diff` timestamp
			const curr = Number(new Date());
			const ms = curr - (prevTime || curr);
			self.diff = ms;
			self.prev = prevTime;
			self.curr = curr;
			prevTime = curr;

			args[0] = createDebug.coerce(args[0]);

			if (typeof args[0] !== 'string') {
				// Anything else let's inspect with %O
				args.unshift('%O');
			}

			// Apply any `formatters` transformations
			let index = 0;
			args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {
				// If we encounter an escaped % then don't increase the array index
				if (match === '%%') {
					return '%';
				}
				index++;
				const formatter = createDebug.formatters[format];
				if (typeof formatter === 'function') {
					const val = args[index];
					match = formatter.call(self, val);

					// Now we need to remove `args[index]` since it's inlined in the `format`
					args.splice(index, 1);
					index--;
				}
				return match;
			});

			// Apply env-specific formatting (colors, etc.)
			createDebug.formatArgs.call(self, args);

			const logFn = self.log || createDebug.log;
			logFn.apply(self, args);
		}

		debug.namespace = namespace;
		debug.useColors = createDebug.useColors();
		debug.color = createDebug.selectColor(namespace);
		debug.extend = extend;
		debug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release.

		Object.defineProperty(debug, 'enabled', {
			enumerable: true,
			configurable: false,
			get: () => {
				if (enableOverride !== null) {
					return enableOverride;
				}
				if (namespacesCache !== createDebug.namespaces) {
					namespacesCache = createDebug.namespaces;
					enabledCache = createDebug.enabled(namespace);
				}

				return enabledCache;
			},
			set: v => {
				enableOverride = v;
			}
		});

		// Env-specific initialization logic for debug instances
		if (typeof createDebug.init === 'function') {
			createDebug.init(debug);
		}

		return debug;
	}

	function extend(namespace, delimiter) {
		const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);
		newDebug.log = this.log;
		return newDebug;
	}

	/**
	* Enables a debug mode by namespaces. This can include modes
	* separated by a colon and wildcards.
	*
	* @param {String} namespaces
	* @api public
	*/
	function enable(namespaces) {
		createDebug.save(namespaces);
		createDebug.namespaces = namespaces;

		createDebug.names = [];
		createDebug.skips = [];

		const split = (typeof namespaces === 'string' ? namespaces : '')
			.trim()
			.replace(/\s+/g, ',')
			.split(',')
			.filter(Boolean);

		for (const ns of split) {
			if (ns[0] === '-') {
				createDebug.skips.push(ns.slice(1));
			} else {
				createDebug.names.push(ns);
			}
		}
	}

	/**
	 * Checks if the given string matches a namespace template, honoring
	 * asterisks as wildcards.
	 *
	 * @param {String} search
	 * @param {String} template
	 * @return {Boolean}
	 */
	function matchesTemplate(search, template) {
		let searchIndex = 0;
		let templateIndex = 0;
		let starIndex = -1;
		let matchIndex = 0;

		while (searchIndex < search.length) {
			if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === '*')) {
				// Match character or proceed with wildcard
				if (template[templateIndex] === '*') {
					starIndex = templateIndex;
					matchIndex = searchIndex;
					templateIndex++; // Skip the '*'
				} else {
					searchIndex++;
					templateIndex++;
				}
			} else if (starIndex !== -1) { // eslint-disable-line no-negated-condition
				// Backtrack to the last '*' and try to match more characters
				templateIndex = starIndex + 1;
				matchIndex++;
				searchIndex = matchIndex;
			} else {
				return false; // No match
			}
		}

		// Handle trailing '*' in template
		while (templateIndex < template.length && template[templateIndex] === '*') {
			templateIndex++;
		}

		return templateIndex === template.length;
	}

	/**
	* Disable debug output.
	*
	* @return {String} namespaces
	* @api public
	*/
	function disable() {
		const namespaces = [
			...createDebug.names,
			...createDebug.skips.map(namespace => '-' + namespace)
		].join(',');
		createDebug.enable('');
		return namespaces;
	}

	/**
	* Returns true if the given mode name is enabled, false otherwise.
	*
	* @param {String} name
	* @return {Boolean}
	* @api public
	*/
	function enabled(name) {
		for (const skip of createDebug.skips) {
			if (matchesTemplate(name, skip)) {
				return false;
			}
		}

		for (const ns of createDebug.names) {
			if (matchesTemplate(name, ns)) {
				return true;
			}
		}

		return false;
	}

	/**
	* Coerce `val`.
	*
	* @param {Mixed} val
	* @return {Mixed}
	* @api private
	*/
	function coerce(val) {
		if (val instanceof Error) {
			return val.stack || val.message;
		}
		return val;
	}

	/**
	* XXX DO NOT USE. This is a temporary stub function.
	* XXX It WILL be removed in the next major release.
	*/
	function destroy() {
		console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
	}

	createDebug.enable(createDebug.load());

	return createDebug;
}

module.exports = setup;
/**
 * Detect Electron renderer / nwjs process, which is node, but we should
 * treat as a browser.
 */

if (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) {
	module.exports = require('./browser.js');
} else {
	module.exports = require('./node.js');
}
/**
 * Module dependencies.
 */

const tty = require('tty');
const util = require('util');

/**
 * This is the Node.js implementation of `debug()`.
 */

exports.init = init;
exports.log = log;
exports.formatArgs = formatArgs;
exports.save = save;
exports.load = load;
exports.useColors = useColors;
exports.destroy = util.deprecate(
	() => {},
	'Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'
);

/**
 * Colors.
 */

exports.colors = [6, 2, 3, 4, 5, 1];

try {
	// Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json)
	// eslint-disable-next-line import/no-extraneous-dependencies
	const supportsColor = require('supports-color');

	if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {
		exports.colors = [
			20,
			21,
			26,
			27,
			32,
			33,
			38,
			39,
			40,
			41,
			42,
			43,
			44,
			45,
			56,
			57,
			62,
			63,
			68,
			69,
			74,
			75,
			76,
			77,
			78,
			79,
			80,
			81,
			92,
			93,
			98,
			99,
			112,
			113,
			128,
			129,
			134,
			135,
			148,
			149,
			160,
			161,
			162,
			163,
			164,
			165,
			166,
			167,
			168,
			169,
			170,
			171,
			172,
			173,
			178,
			179,
			184,
			185,
			196,
			197,
			198,
			199,
			200,
			201,
			202,
			203,
			204,
			205,
			206,
			207,
			208,
			209,
			214,
			215,
			220,
			221
		];
	}
} catch (error) {
	// Swallow - we only care if `supports-color` is available; it doesn't have to be.
}

/**
 * Build up the default `inspectOpts` object from the environment variables.
 *
 *   $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js
 */

exports.inspectOpts = Object.keys(process.env).filter(key => {
	return /^debug_/i.test(key);
}).reduce((obj, key) => {
	// Camel-case
	const prop = key
		.substring(6)
		.toLowerCase()
		.replace(/_([a-z])/g, (_, k) => {
			return k.toUpperCase();
		});

	// Coerce string value into JS value
	let val = process.env[key];
	if (/^(yes|on|true|enabled)$/i.test(val)) {
		val = true;
	} else if (/^(no|off|false|disabled)$/i.test(val)) {
		val = false;
	} else if (val === 'null') {
		val = null;
	} else {
		val = Number(val);
	}

	obj[prop] = val;
	return obj;
}, {});

/**
 * Is stdout a TTY? Colored output is enabled when `true`.
 */

function useColors() {
	return 'colors' in exports.inspectOpts ?
		Boolean(exports.inspectOpts.colors) :
		tty.isatty(process.stderr.fd);
}

/**
 * Adds ANSI color escape codes if enabled.
 *
 * @api public
 */

function formatArgs(args) {
	const {namespace: name, useColors} = this;

	if (useColors) {
		const c = this.color;
		const colorCode = '\u001B[3' + (c < 8 ? c : '8;5;' + c);
		const prefix = `  ${colorCode};1m${name} \u001B[0m`;

		args[0] = prefix + args[0].split('\n').join('\n' + prefix);
		args.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\u001B[0m');
	} else {
		args[0] = getDate() + name + ' ' + args[0];
	}
}

function getDate() {
	if (exports.inspectOpts.hideDate) {
		return '';
	}
	return new Date().toISOString() + ' ';
}

/**
 * Invokes `util.formatWithOptions()` with the specified arguments and writes to stderr.
 */

function log(...args) {
	return process.stderr.write(util.formatWithOptions(exports.inspectOpts, ...args) + '\n');
}

/**
 * Save `namespaces`.
 *
 * @param {String} namespaces
 * @api private
 */
function save(namespaces) {
	if (namespaces) {
		process.env.DEBUG = namespaces;
	} else {
		// If you set a process.env field to null or undefined, it gets cast to the
		// string 'null' or 'undefined'. Just delete instead.
		delete process.env.DEBUG;
	}
}

/**
 * Load `namespaces`.
 *
 * @return {String} returns the previously persisted debug modes
 * @api private
 */

function load() {
	return process.env.DEBUG;
}

/**
 * Init logic for `debug` instances.
 *
 * Create a new `inspectOpts` object in case `useColors` is set
 * differently for a particular `debug` instance.
 */

function init(debug) {
	debug.inspectOpts = {};

	const keys = Object.keys(exports.inspectOpts);
	for (let i = 0; i < keys.length; i++) {
		debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];
	}
}

module.exports = require('./common')(exports);

const {formatters} = module.exports;

/**
 * Map %o to `util.inspect()`, all on a single line.
 */

formatters.o = function (v) {
	this.inspectOpts.colors = this.useColors;
	return util.inspect(v, this.inspectOpts)
		.split('\n')
		.map(str => str.trim())
		.join(' ');
};

/**
 * Map %O to `util.inspect()`, allowing multiple lines if needed.
 */

formatters.O = function (v) {
	this.inspectOpts.colors = this.useColors;
	return util.inspect(v, this.inspectOpts);
};
The MIT License (MIT)

Copyright (c) 2015 Loopline Systems

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getAppCacheDir = getAppCacheDir;
const path = require("path");
const os_1 = require("os");
function getAppCacheDir() {
    const homedir = (0, os_1.homedir)();
    // https://github.com/electron/electron/issues/1404#issuecomment-194391247
    let result;
    if (process.platform === "win32") {
        result = process.env["LOCALAPPDATA"] || path.join(homedir, "AppData", "Local");
    }
    else if (process.platform === "darwin") {
        result = path.join(homedir, "Library", "Caches");
    }
    else {
        result = process.env["XDG_CACHE_HOME"] || path.join(homedir, ".cache");
    }
    return result;
}
//# sourceMappingURL=AppAdapter.js.map{"version":3,"file":"AppAdapter.js","sourceRoot":"","sources":["../src/AppAdapter.ts"],"names":[],"mappings":";;AAiCA,wCAYC;AA7CD,6BAA4B;AAC5B,2BAA0C;AAgC1C,SAAgB,cAAc;IAC5B,MAAM,OAAO,GAAG,IAAA,YAAU,GAAE,CAAA;IAC5B,0EAA0E;IAC1E,IAAI,MAAc,CAAA;IAClB,IAAI,OAAO,CAAC,QAAQ,KAAK,OAAO,EAAE,CAAC;QACjC,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,SAAS,EAAE,OAAO,CAAC,CAAA;IAChF,CAAC;SAAM,IAAI,OAAO,CAAC,QAAQ,KAAK,QAAQ,EAAE,CAAC;QACzC,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAA;IAClD,CAAC;SAAM,CAAC;QACN,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAA;IACxE,CAAC;IACD,OAAO,MAAM,CAAA;AACf,CAAC","sourcesContent":["import * as path from \"path\"\nimport { homedir as getHomedir } from \"os\"\n\nexport interface AppAdapter {\n  readonly version: string\n  readonly name: string\n\n  readonly isPackaged: boolean\n\n  /**\n   * Path to update metadata file.\n   */\n  readonly appUpdateConfigPath: string\n\n  /**\n   * Path to user data directory.\n   */\n  readonly userDataPath: string\n\n  /**\n   * Path to cache directory.\n   */\n  readonly baseCachePath: string\n\n  whenReady(): Promise<void>\n\n  relaunch(): void\n\n  quit(): void\n\n  onQuit(handler: (exitCode: number) => void): void\n}\n\nexport function getAppCacheDir() {\n  const homedir = getHomedir()\n  // https://github.com/electron/electron/issues/1404#issuecomment-194391247\n  let result: string\n  if (process.platform === \"win32\") {\n    result = process.env[\"LOCALAPPDATA\"] || path.join(homedir, \"AppData\", \"Local\")\n  } else if (process.platform === \"darwin\") {\n    result = path.join(homedir, \"Library\", \"Caches\")\n  } else {\n    result = process.env[\"XDG_CACHE_HOME\"] || path.join(homedir, \".cache\")\n  }\n  return result\n}\n"]}"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.AppImageUpdater = void 0;
const builder_util_runtime_1 = require("builder-util-runtime");
const child_process_1 = require("child_process");
const fs_extra_1 = require("fs-extra");
const fs_1 = require("fs");
const path = require("path");
const BaseUpdater_1 = require("./BaseUpdater");
const FileWithEmbeddedBlockMapDifferentialDownloader_1 = require("./differentialDownloader/FileWithEmbeddedBlockMapDifferentialDownloader");
const Provider_1 = require("./providers/Provider");
const types_1 = require("./types");
class AppImageUpdater extends BaseUpdater_1.BaseUpdater {
    constructor(options, app) {
        super(options, app);
    }
    isUpdaterActive() {
        if (process.env["APPIMAGE"] == null && !this.forceDevUpdateConfig) {
            if (process.env["SNAP"] == null) {
                this._logger.warn("APPIMAGE env is not defined, current application is not an AppImage");
            }
            else {
                this._logger.info("SNAP env is defined, updater is disabled");
            }
            return false;
        }
        return super.isUpdaterActive();
    }
    /*** @private */
    doDownloadUpdate(downloadUpdateOptions) {
        const provider = downloadUpdateOptions.updateInfoAndProvider.provider;
        const fileInfo = (0, Provider_1.findFile)(provider.resolveFiles(downloadUpdateOptions.updateInfoAndProvider.info), "AppImage", ["rpm", "deb", "pacman"]);
        return this.executeDownload({
            fileExtension: "AppImage",
            fileInfo,
            downloadUpdateOptions,
            task: async (updateFile, downloadOptions) => {
                const oldFile = process.env["APPIMAGE"];
                if (oldFile == null) {
                    throw (0, builder_util_runtime_1.newError)("APPIMAGE env is not defined", "ERR_UPDATER_OLD_FILE_NOT_FOUND");
                }
                if (downloadUpdateOptions.disableDifferentialDownload || (await this.downloadDifferential(fileInfo, oldFile, updateFile, provider, downloadUpdateOptions))) {
                    await this.httpExecutor.download(fileInfo.url, updateFile, downloadOptions);
                }
                await (0, fs_extra_1.chmod)(updateFile, 0o755);
            },
        });
    }
    async downloadDifferential(fileInfo, oldFile, updateFile, provider, downloadUpdateOptions) {
        try {
            const downloadOptions = {
                newUrl: fileInfo.url,
                oldFile,
                logger: this._logger,
                newFile: updateFile,
                isUseMultipleRangeRequest: provider.isUseMultipleRangeRequest,
                requestHeaders: downloadUpdateOptions.requestHeaders,
                cancellationToken: downloadUpdateOptions.cancellationToken,
            };
            if (this.listenerCount(types_1.DOWNLOAD_PROGRESS) > 0) {
                downloadOptions.onProgress = it => this.emit(types_1.DOWNLOAD_PROGRESS, it);
            }
            await new FileWithEmbeddedBlockMapDifferentialDownloader_1.FileWithEmbeddedBlockMapDifferentialDownloader(fileInfo.info, this.httpExecutor, downloadOptions).download();
            return false;
        }
        catch (e) {
            this._logger.error(`Cannot download differentially, fallback to full download: ${e.stack || e}`);
            // during test (developer machine mac) we must throw error
            return process.platform === "linux";
        }
    }
    doInstall(options) {
        const appImageFile = process.env["APPIMAGE"];
        if (appImageFile == null) {
            throw (0, builder_util_runtime_1.newError)("APPIMAGE env is not defined", "ERR_UPDATER_OLD_FILE_NOT_FOUND");
        }
        if (!path.isAbsolute(appImageFile) || appImageFile.includes("\0")) {
            throw (0, builder_util_runtime_1.newError)(`APPIMAGE env is not a valid absolute path: "${appImageFile}"`, "ERR_UPDATER_OLD_FILE_NOT_FOUND");
        }
        // https://stackoverflow.com/a/1712051/1910191
        (0, fs_1.unlinkSync)(appImageFile);
        let destination;
        const existingBaseName = path.basename(appImageFile);
        const installerPath = this.installerPath;
        if (installerPath == null) {
            this.dispatchError(new Error("No update filepath provided, can't quit and install"));
            return false;
        }
        // https://github.com/electron-userland/electron-builder/issues/2964
        // if no version in existing file name, it means that user wants to preserve current custom name
        if (path.basename(installerPath) === existingBaseName || !/\d+\.\d+\.\d+/.test(existingBaseName)) {
            // no version in the file name, overwrite existing
            destination = appImageFile;
        }
        else {
            destination = path.join(path.dirname(appImageFile), path.basename(installerPath));
        }
        (0, child_process_1.execFileSync)("mv", ["-f", installerPath, destination]);
        if (destination !== appImageFile) {
            this.emit("appimage-filename-updated", destination);
        }
        const env = {
            ...process.env,
            APPIMAGE_SILENT_INSTALL: "true",
        };
        if (options.isForceRunAfter) {
            // eslint-disable-next-line @typescript-eslint/no-floating-promises
            this.spawnLog(destination, [], env);
        }
        else {
            env.APPIMAGE_EXIT_AFTER_INSTALL = "true";
            (0, child_process_1.execFileSync)(destination, [], { env });
        }
        return true;
    }
}
exports.AppImageUpdater = AppImageUpdater;
//# sourceMappingURL=AppImageUpdater.js.map{"version":3,"file":"AppImageUpdater.js","sourceRoot":"","sources":["../src/AppImageUpdater.ts"],"names":[],"mappings":";;;AAAA,+DAAkE;AAClE,iDAA4C;AAC5C,uCAAgC;AAChC,2BAA+B;AAC/B,6BAA4B;AAE5B,+CAA2D;AAE3D,4IAAwI;AACxI,mDAAyD;AACzD,mCAAmE;AAEnE,MAAa,eAAgB,SAAQ,yBAAW;IAC9C,YAAY,OAAkC,EAAE,GAAS;QACvD,KAAK,CAAC,OAAO,EAAE,GAAG,CAAC,CAAA;IACrB,CAAC;IAEM,eAAe;QACpB,IAAI,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,oBAAoB,EAAE,CAAC;YAClE,IAAI,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,IAAI,EAAE,CAAC;gBAChC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,qEAAqE,CAAC,CAAA;YAC1F,CAAC;iBAAM,CAAC;gBACN,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,0CAA0C,CAAC,CAAA;YAC/D,CAAC;YACD,OAAO,KAAK,CAAA;QACd,CAAC;QACD,OAAO,KAAK,CAAC,eAAe,EAAE,CAAA;IAChC,CAAC;IAED,gBAAgB;IACN,gBAAgB,CAAC,qBAA4C;QACrE,MAAM,QAAQ,GAAG,qBAAqB,CAAC,qBAAqB,CAAC,QAAQ,CAAA;QACrE,MAAM,QAAQ,GAAG,IAAA,mBAAQ,EAAC,QAAQ,CAAC,YAAY,CAAC,qBAAqB,CAAC,qBAAqB,CAAC,IAAI,CAAC,EAAE,UAAU,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAE,CAAA;QACzI,OAAO,IAAI,CAAC,eAAe,CAAC;YAC1B,aAAa,EAAE,UAAU;YACzB,QAAQ;YACR,qBAAqB;YACrB,IAAI,EAAE,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,EAAE;gBAC1C,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,UAAU,CAAE,CAAA;gBACxC,IAAI,OAAO,IAAI,IAAI,EAAE,CAAC;oBACpB,MAAM,IAAA,+BAAQ,EAAC,6BAA6B,EAAE,gCAAgC,CAAC,CAAA;gBACjF,CAAC;gBAED,IAAI,qBAAqB,CAAC,2BAA2B,IAAI,CAAC,MAAM,IAAI,CAAC,oBAAoB,CAAC,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,qBAAqB,CAAC,CAAC,EAAE,CAAC;oBAC3J,MAAM,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAAG,EAAE,UAAU,EAAE,eAAe,CAAC,CAAA;gBAC7E,CAAC;gBAED,MAAM,IAAA,gBAAK,EAAC,UAAU,EAAE,KAAK,CAAC,CAAA;YAChC,CAAC;SACF,CAAC,CAAA;IACJ,CAAC;IAEO,KAAK,CAAC,oBAAoB,CAAC,QAAgC,EAAE,OAAe,EAAE,UAAkB,EAAE,QAAuB,EAAE,qBAA4C;QAC7K,IAAI,CAAC;YACH,MAAM,eAAe,GAAkC;gBACrD,MAAM,EAAE,QAAQ,CAAC,GAAG;gBACpB,OAAO;gBACP,MAAM,EAAE,IAAI,CAAC,OAAO;gBACpB,OAAO,EAAE,UAAU;gBACnB,yBAAyB,EAAE,QAAQ,CAAC,yBAAyB;gBAC7D,cAAc,EAAE,qBAAqB,CAAC,cAAc;gBACpD,iBAAiB,EAAE,qBAAqB,CAAC,iBAAiB;aAC3D,CAAA;YAED,IAAI,IAAI,CAAC,aAAa,CAAC,yBAAiB,CAAC,GAAG,CAAC,EAAE,CAAC;gBAC9C,eAAe,CAAC,UAAU,GAAG,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,yBAAiB,EAAE,EAAE,CAAC,CAAA;YACrE,CAAC;YAED,MAAM,IAAI,+FAA8C,CAAC,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,YAAY,EAAE,eAAe,CAAC,CAAC,QAAQ,EAAE,CAAA;YACtH,OAAO,KAAK,CAAA;QACd,CAAC;QAAC,OAAO,CAAM,EAAE,CAAC;YAChB,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,8DAA8D,CAAC,CAAC,KAAK,IAAI,CAAC,EAAE,CAAC,CAAA;YAChG,0DAA0D;YAC1D,OAAO,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAA;QACrC,CAAC;IACH,CAAC;IAES,SAAS,CAAC,OAAuB;QACzC,MAAM,YAAY,GAAG,OAAO,CAAC,GAAG,CAAC,UAAU,CAAE,CAAA;QAC7C,IAAI,YAAY,IAAI,IAAI,EAAE,CAAC;YACzB,MAAM,IAAA,+BAAQ,EAAC,6BAA6B,EAAE,gCAAgC,CAAC,CAAA;QACjF,CAAC;QACD,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,IAAI,YAAY,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;YAClE,MAAM,IAAA,+BAAQ,EAAC,+CAA+C,YAAY,GAAG,EAAE,gCAAgC,CAAC,CAAA;QAClH,CAAC;QAED,8CAA8C;QAC9C,IAAA,eAAU,EAAC,YAAY,CAAC,CAAA;QAExB,IAAI,WAAmB,CAAA;QACvB,MAAM,gBAAgB,GAAG,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAA;QACpD,MAAM,aAAa,GAAG,IAAI,CAAC,aAAa,CAAA;QACxC,IAAI,aAAa,IAAI,IAAI,EAAE,CAAC;YAC1B,IAAI,CAAC,aAAa,CAAC,IAAI,KAAK,CAAC,qDAAqD,CAAC,CAAC,CAAA;YACpF,OAAO,KAAK,CAAA;QACd,CAAC;QACD,oEAAoE;QACpE,gGAAgG;QAChG,IAAI,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,KAAK,gBAAgB,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,gBAAgB,CAAC,EAAE,CAAC;YACjG,kDAAkD;YAClD,WAAW,GAAG,YAAY,CAAA;QAC5B,CAAC;aAAM,CAAC;YACN,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAA;QACnF,CAAC;QAED,IAAA,4BAAY,EAAC,IAAI,EAAE,CAAC,IAAI,EAAE,aAAa,EAAE,WAAW,CAAC,CAAC,CAAA;QACtD,IAAI,WAAW,KAAK,YAAY,EAAE,CAAC;YACjC,IAAI,CAAC,IAAI,CAAC,2BAA2B,EAAE,WAAW,CAAC,CAAA;QACrD,CAAC;QAED,MAAM,GAAG,GAAsB;YAC7B,GAAG,OAAO,CAAC,GAAG;YACd,uBAAuB,EAAE,MAAM;SAChC,CAAA;QAED,IAAI,OAAO,CAAC,eAAe,EAAE,CAAC;YAC5B,mEAAmE;YACnE,IAAI,CAAC,QAAQ,CAAC,WAAW,EAAE,EAAE,EAAE,GAAG,CAAC,CAAA;QACrC,CAAC;aAAM,CAAC;YACN,GAAG,CAAC,2BAA2B,GAAG,MAAM,CAAA;YACxC,IAAA,4BAAY,EAAC,WAAW,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,CAAC,CAAA;QACxC,CAAC;QACD,OAAO,IAAI,CAAA;IACb,CAAC;CACF;AAhHD,0CAgHC","sourcesContent":["import { AllPublishOptions, newError } from \"builder-util-runtime\"\nimport { execFileSync } from \"child_process\"\nimport { chmod } from \"fs-extra\"\nimport { unlinkSync } from \"fs\"\nimport * as path from \"path\"\nimport { DownloadUpdateOptions } from \"./AppUpdater\"\nimport { BaseUpdater, InstallOptions } from \"./BaseUpdater\"\nimport { DifferentialDownloaderOptions } from \"./differentialDownloader/DifferentialDownloader\"\nimport { FileWithEmbeddedBlockMapDifferentialDownloader } from \"./differentialDownloader/FileWithEmbeddedBlockMapDifferentialDownloader\"\nimport { findFile, Provider } from \"./providers/Provider\"\nimport { DOWNLOAD_PROGRESS, ResolvedUpdateFileInfo } from \"./types\"\n\nexport class AppImageUpdater extends BaseUpdater {\n  constructor(options?: AllPublishOptions | null, app?: any) {\n    super(options, app)\n  }\n\n  public isUpdaterActive(): boolean {\n    if (process.env[\"APPIMAGE\"] == null && !this.forceDevUpdateConfig) {\n      if (process.env[\"SNAP\"] == null) {\n        this._logger.warn(\"APPIMAGE env is not defined, current application is not an AppImage\")\n      } else {\n        this._logger.info(\"SNAP env is defined, updater is disabled\")\n      }\n      return false\n    }\n    return super.isUpdaterActive()\n  }\n\n  /*** @private */\n  protected doDownloadUpdate(downloadUpdateOptions: DownloadUpdateOptions): Promise<Array<string>> {\n    const provider = downloadUpdateOptions.updateInfoAndProvider.provider\n    const fileInfo = findFile(provider.resolveFiles(downloadUpdateOptions.updateInfoAndProvider.info), \"AppImage\", [\"rpm\", \"deb\", \"pacman\"])!\n    return this.executeDownload({\n      fileExtension: \"AppImage\",\n      fileInfo,\n      downloadUpdateOptions,\n      task: async (updateFile, downloadOptions) => {\n        const oldFile = process.env[\"APPIMAGE\"]!\n        if (oldFile == null) {\n          throw newError(\"APPIMAGE env is not defined\", \"ERR_UPDATER_OLD_FILE_NOT_FOUND\")\n        }\n\n        if (downloadUpdateOptions.disableDifferentialDownload || (await this.downloadDifferential(fileInfo, oldFile, updateFile, provider, downloadUpdateOptions))) {\n          await this.httpExecutor.download(fileInfo.url, updateFile, downloadOptions)\n        }\n\n        await chmod(updateFile, 0o755)\n      },\n    })\n  }\n\n  private async downloadDifferential(fileInfo: ResolvedUpdateFileInfo, oldFile: string, updateFile: string, provider: Provider<any>, downloadUpdateOptions: DownloadUpdateOptions) {\n    try {\n      const downloadOptions: DifferentialDownloaderOptions = {\n        newUrl: fileInfo.url,\n        oldFile,\n        logger: this._logger,\n        newFile: updateFile,\n        isUseMultipleRangeRequest: provider.isUseMultipleRangeRequest,\n        requestHeaders: downloadUpdateOptions.requestHeaders,\n        cancellationToken: downloadUpdateOptions.cancellationToken,\n      }\n\n      if (this.listenerCount(DOWNLOAD_PROGRESS) > 0) {\n        downloadOptions.onProgress = it => this.emit(DOWNLOAD_PROGRESS, it)\n      }\n\n      await new FileWithEmbeddedBlockMapDifferentialDownloader(fileInfo.info, this.httpExecutor, downloadOptions).download()\n      return false\n    } catch (e: any) {\n      this._logger.error(`Cannot download differentially, fallback to full download: ${e.stack || e}`)\n      // during test (developer machine mac) we must throw error\n      return process.platform === \"linux\"\n    }\n  }\n\n  protected doInstall(options: InstallOptions): boolean {\n    const appImageFile = process.env[\"APPIMAGE\"]!\n    if (appImageFile == null) {\n      throw newError(\"APPIMAGE env is not defined\", \"ERR_UPDATER_OLD_FILE_NOT_FOUND\")\n    }\n    if (!path.isAbsolute(appImageFile) || appImageFile.includes(\"\\0\")) {\n      throw newError(`APPIMAGE env is not a valid absolute path: \"${appImageFile}\"`, \"ERR_UPDATER_OLD_FILE_NOT_FOUND\")\n    }\n\n    // https://stackoverflow.com/a/1712051/1910191\n    unlinkSync(appImageFile)\n\n    let destination: string\n    const existingBaseName = path.basename(appImageFile)\n    const installerPath = this.installerPath\n    if (installerPath == null) {\n      this.dispatchError(new Error(\"No update filepath provided, can't quit and install\"))\n      return false\n    }\n    // https://github.com/electron-userland/electron-builder/issues/2964\n    // if no version in existing file name, it means that user wants to preserve current custom name\n    if (path.basename(installerPath) === existingBaseName || !/\\d+\\.\\d+\\.\\d+/.test(existingBaseName)) {\n      // no version in the file name, overwrite existing\n      destination = appImageFile\n    } else {\n      destination = path.join(path.dirname(appImageFile), path.basename(installerPath))\n    }\n\n    execFileSync(\"mv\", [\"-f\", installerPath, destination])\n    if (destination !== appImageFile) {\n      this.emit(\"appimage-filename-updated\", destination)\n    }\n\n    const env: NodeJS.ProcessEnv = {\n      ...process.env,\n      APPIMAGE_SILENT_INSTALL: \"true\",\n    }\n\n    if (options.isForceRunAfter) {\n      // eslint-disable-next-line @typescript-eslint/no-floating-promises\n      this.spawnLog(destination, [], env)\n    } else {\n      env.APPIMAGE_EXIT_AFTER_INSTALL = \"true\"\n      execFileSync(destination, [], { env })\n    }\n    return true\n  }\n}\n"]}"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.NoOpLogger = exports.AppUpdater = void 0;
const builder_util_runtime_1 = require("builder-util-runtime");
const crypto_1 = require("crypto");
const os_1 = require("os");
const events_1 = require("events");
const fs_extra_1 = require("fs-extra");
const js_yaml_1 = require("js-yaml");
const lazy_val_1 = require("lazy-val");
const path = require("path");
const semver_1 = require("semver");
const DownloadedUpdateHelper_1 = require("./DownloadedUpdateHelper");
const ElectronAppAdapter_1 = require("./ElectronAppAdapter");
const electronHttpExecutor_1 = require("./electronHttpExecutor");
const GenericProvider_1 = require("./providers/GenericProvider");
const providerFactory_1 = require("./providerFactory");
const zlib_1 = require("zlib");
const GenericDifferentialDownloader_1 = require("./differentialDownloader/GenericDifferentialDownloader");
const types_1 = require("./types");
class AppUpdater extends events_1.EventEmitter {
    /**
     * Get the update channel. Doesn't return `channel` from the update configuration, only if was previously set.
     */
    get channel() {
        return this._channel;
    }
    /**
     * Set the update channel. Overrides `channel` in the update configuration.
     *
     * `allowDowngrade` will be automatically set to `true`. If this behavior is not suitable for you, simple set `allowDowngrade` explicitly after.
     */
    set channel(value) {
        if (this._channel != null) {
            // noinspection SuspiciousTypeOfGuard
            if (typeof value !== "string") {
                throw (0, builder_util_runtime_1.newError)(`Channel must be a string, but got: ${value}`, "ERR_UPDATER_INVALID_CHANNEL");
            }
            else if (value.length === 0) {
                throw (0, builder_util_runtime_1.newError)(`Channel must be not an empty string`, "ERR_UPDATER_INVALID_CHANNEL");
            }
        }
        this._channel = value;
        this.allowDowngrade = true;
    }
    /**
     *  Shortcut for explicitly adding auth tokens to request headers
     */
    addAuthHeader(token) {
        this.requestHeaders = Object.assign({}, this.requestHeaders, {
            authorization: token,
        });
    }
    // noinspection JSMethodCanBeStatic,JSUnusedGlobalSymbols
    get netSession() {
        return (0, electronHttpExecutor_1.getNetSession)();
    }
    /**
     * The logger. You can pass [electron-log](https://github.com/megahertz/electron-log), [winston](https://github.com/winstonjs/winston) or another logger with the following interface: `{ info(), warn(), error() }`.
     * Set it to `null` if you would like to disable a logging feature.
     */
    get logger() {
        return this._logger;
    }
    set logger(value) {
        this._logger = value == null ? new NoOpLogger() : value;
    }
    // noinspection JSUnusedGlobalSymbols
    /**
     * test only
     * @private
     */
    set updateConfigPath(value) {
        this.clientPromise = null;
        this._appUpdateConfigPath = value;
        this.configOnDisk = new lazy_val_1.Lazy(() => this.loadUpdateConfig());
    }
    /**
     * Allows developer to override default logic for determining if an update is supported.
     * The default logic compares the `UpdateInfo` minimum system version against the `os.release()` with `semver` package
     */
    get isUpdateSupported() {
        return this._isUpdateSupported;
    }
    set isUpdateSupported(value) {
        if (value) {
            this._isUpdateSupported = value;
        }
    }
    /**
     * Allows developer to override default logic for determining if the user is below the rollout threshold.
     * The default logic compares the staging percentage with numerical representation of user ID.
     * An override can define custom logic, or bypass it if needed.
     */
    get isUserWithinRollout() {
        return this._isUserWithinRollout;
    }
    set isUserWithinRollout(value) {
        if (value) {
            this._isUserWithinRollout = value;
        }
    }
    constructor(options, app) {
        super();
        /**
         * Whether to automatically download an update when it is found.
         * @default true
         */
        this.autoDownload = true;
        /**
         * Whether to automatically install a downloaded update on app quit (if `quitAndInstall` was not called before).
         * @default true
         */
        this.autoInstallOnAppQuit = true;
        /**
         * Whether to run the app after finish install when run the installer is NOT in silent mode.
         * @default true
         */
        this.autoRunAppAfterInstall = true;
        /**
         * *GitHub provider only.* Whether to allow update to pre-release versions. Defaults to `true` if application version contains prerelease components (e.g. `0.12.1-alpha.1`, here `alpha` is a prerelease component), otherwise `false`.
         *
         * If `true`, downgrade will be allowed (`allowDowngrade` will be set to `true`).
         */
        this.allowPrerelease = false;
        /**
         * *GitHub provider only.* Get all release notes (from current version to latest), not just the latest.
         * @default false
         */
        this.fullChangelog = false;
        /**
         * Whether to allow version downgrade (when a user from the beta channel wants to go back to the stable channel).
         *
         * Taken in account only if channel differs (pre-release version component in terms of semantic versioning).
         *
         * @default false
         */
        this.allowDowngrade = false;
        /**
         * Web installer files might not have signature verification, this switch prevents to load them unless it is needed.
         *
         * Currently false to prevent breaking the current API, but it should be changed to default true at some point that
         * breaking changes are allowed.
         *
         * @default false
         */
        this.disableWebInstaller = false;
        /**
         * *NSIS only* Disable differential downloads and always perform full download of installer.
         *
         * @default false
         */
        this.disableDifferentialDownload = false;
        /**
         * Allows developer to force the updater to work in "dev" mode, looking for "dev-app-update.yml" instead of "app-update.yml"
         * Dev: `path.join(this.app.getAppPath(), "dev-app-update.yml")`
         * Prod: `path.join(process.resourcesPath!, "app-update.yml")`
         *
         * @default false
         */
        this.forceDevUpdateConfig = false;
        /**
         * The base URL of the old block map file.
         *
         * When null, the updater will use the base URL of the update file to download the update.
         * When set, the updater will use this string as the base URL of the old block map file.
         * Some servers like github cannot download the old block map file from latest release,
         * so you need to compute the old block map file base URL manually.
         *
         * @default null
         */
        this.previousBlockmapBaseUrlOverride = null;
        this._channel = null;
        this.downloadedUpdateHelper = null;
        /**
         *  The request headers.
         */
        this.requestHeaders = null;
        this._logger = console;
        // noinspection JSUnusedGlobalSymbols
        /**
         * For type safety you can use signals, e.g. `autoUpdater.signals.updateDownloaded(() => {})` instead of `autoUpdater.on('update-available', () => {})`
         */
        this.signals = new types_1.UpdaterSignal(this);
        this._appUpdateConfigPath = null;
        this._isUpdateSupported = updateInfo => this.checkIfUpdateSupported(updateInfo);
        this._isUserWithinRollout = updateInfo => this.isStagingMatch(updateInfo);
        this.clientPromise = null;
        this.stagingUserIdPromise = new lazy_val_1.Lazy(() => this.getOrCreateStagingUserId());
        // public, allow to read old config for anyone
        /** @internal */
        this.configOnDisk = new lazy_val_1.Lazy(() => this.loadUpdateConfig());
        this.checkForUpdatesPromise = null;
        this.downloadPromise = null;
        this.updateInfoAndProvider = null;
        /**
         * @private
         * @internal
         */
        this._testOnlyOptions = null;
        this.on("error", (error) => {
            this._logger.error(`Error: ${error.stack || error.message}`);
        });
        if (app == null) {
            this.app = new ElectronAppAdapter_1.ElectronAppAdapter();
            this.httpExecutor = new electronHttpExecutor_1.ElectronHttpExecutor((authInfo, callback) => this.emit("login", authInfo, callback));
        }
        else {
            this.app = app;
            this.httpExecutor = null;
        }
        const currentVersionString = this.app.version;
        const currentVersion = (0, semver_1.parse)(currentVersionString);
        if (currentVersion == null) {
            throw (0, builder_util_runtime_1.newError)(`App version is not a valid semver version: "${currentVersionString}"`, "ERR_UPDATER_INVALID_VERSION");
        }
        this.currentVersion = currentVersion;
        this.allowPrerelease = hasPrereleaseComponents(currentVersion);
        if (options != null) {
            this.setFeedURL(options);
            if (typeof options !== "string" && options.requestHeaders) {
                this.requestHeaders = options.requestHeaders;
            }
        }
    }
    //noinspection JSMethodCanBeStatic,JSUnusedGlobalSymbols
    getFeedURL() {
        return "Deprecated. Do not use it.";
    }
    /**
     * Configure update provider. If value is `string`, [GenericServerOptions](https://www.electron.build/publish#genericserveroptions) will be set with value as `url`.
     * @param options If you want to override configuration in the `app-update.yml`.
     */
    setFeedURL(options) {
        const runtimeOptions = this.createProviderRuntimeOptions();
        // https://github.com/electron-userland/electron-builder/issues/1105
        let provider;
        if (typeof options === "string") {
            provider = new GenericProvider_1.GenericProvider({ provider: "generic", url: options }, this, {
                ...runtimeOptions,
                isUseMultipleRangeRequest: (0, providerFactory_1.isUrlProbablySupportMultiRangeRequests)(options),
            });
        }
        else {
            provider = (0, providerFactory_1.createClient)(options, this, runtimeOptions);
        }
        this.clientPromise = Promise.resolve(provider);
    }
    /**
     * Asks the server whether there is an update.
     * @returns null if the updater is disabled, otherwise info about the latest version
     */
    checkForUpdates() {
        if (!this.isUpdaterActive()) {
            return Promise.resolve(null);
        }
        let checkForUpdatesPromise = this.checkForUpdatesPromise;
        if (checkForUpdatesPromise != null) {
            this._logger.info("Checking for update (already in progress)");
            return checkForUpdatesPromise;
        }
        const nullizePromise = () => (this.checkForUpdatesPromise = null);
        this._logger.info("Checking for update");
        checkForUpdatesPromise = this.doCheckForUpdates()
            .then(it => {
            nullizePromise();
            return it;
        })
            .catch((e) => {
            nullizePromise();
            this.emit("error", e, `Cannot check for updates: ${(e.stack || e).toString()}`);
            throw e;
        });
        this.checkForUpdatesPromise = checkForUpdatesPromise;
        return checkForUpdatesPromise;
    }
    isUpdaterActive() {
        const isEnabled = this.app.isPackaged || this.forceDevUpdateConfig;
        if (!isEnabled) {
            this._logger.info("Skip checkForUpdates because application is not packed and dev update config is not forced");
            return false;
        }
        return true;
    }
    // noinspection JSUnusedGlobalSymbols
    checkForUpdatesAndNotify(downloadNotification) {
        return this.checkForUpdates().then(it => {
            if (!(it === null || it === void 0 ? void 0 : it.downloadPromise)) {
                if (this._logger.debug != null) {
                    this._logger.debug("checkForUpdatesAndNotify called, downloadPromise is null");
                }
                return it;
            }
            void it.downloadPromise.then(() => {
                const notificationContent = AppUpdater.formatDownloadNotification(it.updateInfo.version, this.app.name, downloadNotification);
                new (require("electron").Notification)(notificationContent).show();
            });
            return it;
        });
    }
    static formatDownloadNotification(version, appName, downloadNotification) {
        if (downloadNotification == null) {
            downloadNotification = {
                title: "A new update is ready to install",
                body: `{appName} version {version} has been downloaded and will be automatically installed on exit`,
            };
        }
        downloadNotification = {
            title: downloadNotification.title.replace("{appName}", appName).replace("{version}", version),
            body: downloadNotification.body.replace("{appName}", appName).replace("{version}", version),
        };
        return downloadNotification;
    }
    async isStagingMatch(updateInfo) {
        const rawStagingPercentage = updateInfo.stagingPercentage;
        let stagingPercentage = rawStagingPercentage;
        if (stagingPercentage == null) {
            return true;
        }
        stagingPercentage = parseInt(stagingPercentage, 10);
        if (isNaN(stagingPercentage)) {
            this._logger.warn(`Staging percentage is NaN: ${rawStagingPercentage}`);
            return true;
        }
        // convert from user 0-100 to internal 0-1
        stagingPercentage = stagingPercentage / 100;
        const stagingUserId = await this.stagingUserIdPromise.value;
        const val = builder_util_runtime_1.UUID.parse(stagingUserId).readUInt32BE(12);
        const percentage = val / 0xffffffff;
        this._logger.info(`Staging percentage: ${stagingPercentage}, percentage: ${percentage}, user id: ${stagingUserId}`);
        return percentage < stagingPercentage;
    }
    computeFinalHeaders(headers) {
        if (this.requestHeaders != null) {
            Object.assign(headers, this.requestHeaders);
        }
        return headers;
    }
    async isUpdateAvailable(updateInfo) {
        const latestVersion = (0, semver_1.parse)(updateInfo.version);
        if (latestVersion == null) {
            throw (0, builder_util_runtime_1.newError)(`This file could not be downloaded, or the latest version (from update server) does not have a valid semver version: "${updateInfo.version}"`, "ERR_UPDATER_INVALID_VERSION");
        }
        const currentVersion = this.currentVersion;
        if ((0, semver_1.eq)(latestVersion, currentVersion)) {
            return false;
        }
        if (!(await Promise.resolve(this.isUpdateSupported(updateInfo)))) {
            return false;
        }
        const isUserWithinRollout = await Promise.resolve(this.isUserWithinRollout(updateInfo));
        if (!isUserWithinRollout) {
            return false;
        }
        // https://github.com/electron-userland/electron-builder/pull/3111#issuecomment-405033227
        // https://github.com/electron-userland/electron-builder/pull/3111#issuecomment-405030797
        const isLatestVersionNewer = (0, semver_1.gt)(latestVersion, currentVersion);
        const isLatestVersionOlder = (0, semver_1.lt)(latestVersion, currentVersion);
        if (isLatestVersionNewer) {
            return true;
        }
        return this.allowDowngrade && isLatestVersionOlder;
    }
    checkIfUpdateSupported(updateInfo) {
        const minimumSystemVersion = updateInfo === null || updateInfo === void 0 ? void 0 : updateInfo.minimumSystemVersion;
        const currentOSVersion = (0, os_1.release)();
        if (minimumSystemVersion) {
            try {
                if ((0, semver_1.lt)(currentOSVersion, minimumSystemVersion)) {
                    this._logger.info(`Current OS version ${currentOSVersion} is less than the minimum OS version required ${minimumSystemVersion} for version ${currentOSVersion}`);
                    return false;
                }
            }
            catch (e) {
                this._logger.warn(`Failed to compare current OS version(${currentOSVersion}) with minimum OS version(${minimumSystemVersion}): ${(e.message || e).toString()}`);
            }
        }
        return true;
    }
    async getUpdateInfoAndProvider() {
        await this.app.whenReady();
        if (this.clientPromise == null) {
            this.clientPromise = this.configOnDisk.value.then(it => (0, providerFactory_1.createClient)(it, this, this.createProviderRuntimeOptions()));
        }
        const client = await this.clientPromise;
        const stagingUserId = await this.stagingUserIdPromise.value;
        client.setRequestHeaders(this.computeFinalHeaders({ "x-user-staging-id": stagingUserId }));
        return {
            info: await client.getLatestVersion(),
            provider: client,
        };
    }
    createProviderRuntimeOptions() {
        return {
            isUseMultipleRangeRequest: true,
            platform: this._testOnlyOptions == null ? process.platform : this._testOnlyOptions.platform,
            executor: this.httpExecutor,
        };
    }
    async doCheckForUpdates() {
        this.emit("checking-for-update");
        const result = await this.getUpdateInfoAndProvider();
        const updateInfo = result.info;
        if (!(await this.isUpdateAvailable(updateInfo))) {
            this._logger.info(`Update for version ${this.currentVersion.format()} is not available (latest version: ${updateInfo.version}, downgrade is ${this.allowDowngrade ? "allowed" : "disallowed"}).`);
            this.emit("update-not-available", updateInfo);
            return {
                isUpdateAvailable: false,
                versionInfo: updateInfo,
                updateInfo,
            };
        }
        this.updateInfoAndProvider = result;
        this.onUpdateAvailable(updateInfo);
        const cancellationToken = new builder_util_runtime_1.CancellationToken();
        //noinspection ES6MissingAwait
        return {
            isUpdateAvailable: true,
            versionInfo: updateInfo,
            updateInfo,
            cancellationToken,
            downloadPromise: this.autoDownload ? this.downloadUpdate(cancellationToken) : null,
        };
    }
    onUpdateAvailable(updateInfo) {
        this._logger.info(`Found version ${updateInfo.version} (url: ${(0, builder_util_runtime_1.asArray)(updateInfo.files)
            .map(it => it.url)
            .join(", ")})`);
        this.emit("update-available", updateInfo);
    }
    /**
     * Start downloading update manually. You can use this method if `autoDownload` option is set to `false`.
     * @returns {Promise<Array<string>>} Paths to downloaded files.
     */
    downloadUpdate(cancellationToken = new builder_util_runtime_1.CancellationToken()) {
        const updateInfoAndProvider = this.updateInfoAndProvider;
        if (updateInfoAndProvider == null) {
            const error = new Error("Please check update first");
            this.dispatchError(error);
            return Promise.reject(error);
        }
        if (this.downloadPromise != null) {
            this._logger.info("Downloading update (already in progress)");
            return this.downloadPromise;
        }
        this._logger.info(`Downloading update from ${(0, builder_util_runtime_1.asArray)(updateInfoAndProvider.info.files)
            .map(it => it.url)
            .join(", ")}`);
        const errorHandler = (e) => {
            // https://github.com/electron-userland/electron-builder/issues/1150#issuecomment-436891159
            if (!(e instanceof builder_util_runtime_1.CancellationError)) {
                try {
                    this.dispatchError(e);
                }
                catch (nestedError) {
                    this._logger.warn(`Cannot dispatch error event: ${nestedError.stack || nestedError}`);
                }
            }
            return e;
        };
        this.downloadPromise = this.doDownloadUpdate({
            updateInfoAndProvider,
            requestHeaders: this.computeRequestHeaders(updateInfoAndProvider.provider),
            cancellationToken,
            disableWebInstaller: this.disableWebInstaller,
            disableDifferentialDownload: this.disableDifferentialDownload,
        })
            .catch((e) => {
            throw errorHandler(e);
        })
            .finally(() => {
            this.downloadPromise = null;
        });
        return this.downloadPromise;
    }
    dispatchError(e) {
        this.emit("error", e, (e.stack || e).toString());
    }
    dispatchUpdateDownloaded(event) {
        this.emit(types_1.UPDATE_DOWNLOADED, event);
    }
    async loadUpdateConfig() {
        if (this._appUpdateConfigPath == null) {
            this._appUpdateConfigPath = this.app.appUpdateConfigPath;
        }
        return (0, js_yaml_1.load)(await (0, fs_extra_1.readFile)(this._appUpdateConfigPath, "utf-8"));
    }
    computeRequestHeaders(provider) {
        const fileExtraDownloadHeaders = provider.fileExtraDownloadHeaders;
        if (fileExtraDownloadHeaders != null) {
            const requestHeaders = this.requestHeaders;
            return requestHeaders == null
                ? fileExtraDownloadHeaders
                : {
                    ...fileExtraDownloadHeaders,
                    ...requestHeaders,
                };
        }
        return this.computeFinalHeaders({ accept: "*/*" });
    }
    async getOrCreateStagingUserId() {
        const file = path.join(this.app.userDataPath, ".updaterId");
        try {
            const id = await (0, fs_extra_1.readFile)(file, "utf-8");
            if (builder_util_runtime_1.UUID.check(id)) {
                return id;
            }
            else {
                this._logger.warn(`Staging user id file exists, but content was invalid: ${id}`);
            }
        }
        catch (e) {
            if (e.code !== "ENOENT") {
                this._logger.warn(`Couldn't read staging user ID, creating a blank one: ${e}`);
            }
        }
        const id = builder_util_runtime_1.UUID.v5((0, crypto_1.randomBytes)(4096), builder_util_runtime_1.UUID.OID);
        this._logger.info(`Generated new staging user ID: ${id}`);
        try {
            await (0, fs_extra_1.outputFile)(file, id);
        }
        catch (e) {
            this._logger.warn(`Couldn't write out staging user ID: ${e}`);
        }
        return id;
    }
    /** @internal */
    get isAddNoCacheQuery() {
        const headers = this.requestHeaders;
        // https://github.com/electron-userland/electron-builder/issues/3021
        if (headers == null) {
            return true;
        }
        for (const headerName of Object.keys(headers)) {
            const s = headerName.toLowerCase();
            if (s === "authorization" || s === "private-token") {
                return false;
            }
        }
        return true;
    }
    async getOrCreateDownloadHelper() {
        let result = this.downloadedUpdateHelper;
        if (result == null) {
            const dirName = (await this.configOnDisk.value).updaterCacheDirName;
            const logger = this._logger;
            if (dirName == null) {
                logger.error("updaterCacheDirName is not specified in app-update.yml Was app build using at least electron-builder 20.34.0?");
            }
            const cacheDir = path.join(this.app.baseCachePath, dirName || this.app.name);
            if (logger.debug != null) {
                logger.debug(`updater cache dir: ${cacheDir}`);
            }
            result = new DownloadedUpdateHelper_1.DownloadedUpdateHelper(cacheDir);
            this.downloadedUpdateHelper = result;
        }
        return result;
    }
    async executeDownload(taskOptions) {
        const fileInfo = taskOptions.fileInfo;
        const downloadOptions = {
            headers: taskOptions.downloadUpdateOptions.requestHeaders,
            cancellationToken: taskOptions.downloadUpdateOptions.cancellationToken,
            sha2: fileInfo.info.sha2,
            sha512: fileInfo.info.sha512,
        };
        if (this.listenerCount(types_1.DOWNLOAD_PROGRESS) > 0) {
            downloadOptions.onProgress = it => this.emit(types_1.DOWNLOAD_PROGRESS, it);
        }
        const updateInfo = taskOptions.downloadUpdateOptions.updateInfoAndProvider.info;
        const version = updateInfo.version;
        const packageInfo = fileInfo.packageInfo;
        function getCacheUpdateFileName() {
            // NodeJS URL doesn't decode automatically
            const urlPath = decodeURIComponent(taskOptions.fileInfo.url.pathname);
            if (urlPath.toLowerCase().endsWith(`.${taskOptions.fileExtension.toLowerCase()}`)) {
                return path.basename(urlPath);
            }
            else {
                // url like /latest â€” use basename so a server-supplied path like "../../etc/evil"
                // cannot escape the cache directory via path.join
                return path.basename(taskOptions.fileInfo.info.url);
            }
        }
        const downloadedUpdateHelper = await this.getOrCreateDownloadHelper();
        const cacheDir = downloadedUpdateHelper.cacheDirForPendingUpdate;
        await (0, fs_extra_1.mkdir)(cacheDir, { recursive: true });
        const updateFileName = getCacheUpdateFileName();
        let updateFile = path.join(cacheDir, updateFileName);
        const packageFile = packageInfo == null ? null : path.join(cacheDir, `package-${version}${path.extname(packageInfo.path) || ".7z"}`);
        const done = async (isSaveCache) => {
            await downloadedUpdateHelper.setDownloadedFile(updateFile, packageFile, updateInfo, fileInfo, updateFileName, isSaveCache);
            await taskOptions.done({
                ...updateInfo,
                downloadedFile: updateFile,
            });
            const currentBlockMapFile = path.join(cacheDir, "current.blockmap");
            if (await (0, fs_extra_1.pathExists)(currentBlockMapFile)) {
                await (0, fs_extra_1.copyFile)(currentBlockMapFile, path.join(downloadedUpdateHelper.cacheDir, "current.blockmap"));
            }
            return packageFile == null ? [updateFile] : [updateFile, packageFile];
        };
        const log = this._logger;
        const cachedUpdateFile = await downloadedUpdateHelper.validateDownloadedPath(updateFile, updateInfo, fileInfo, log);
        if (cachedUpdateFile != null) {
            updateFile = cachedUpdateFile;
            return await done(false);
        }
        const removeFileIfAny = async () => {
            await downloadedUpdateHelper.clear().catch(() => {
                // ignore
            });
            return await (0, fs_extra_1.unlink)(updateFile).catch(() => {
                // ignore
            });
        };
        const tempUpdateFile = await (0, DownloadedUpdateHelper_1.createTempUpdateFile)(`temp-${updateFileName}`, cacheDir, log);
        try {
            await taskOptions.task(tempUpdateFile, downloadOptions, packageFile, removeFileIfAny);
            await (0, builder_util_runtime_1.retry)(() => (0, fs_extra_1.rename)(tempUpdateFile, updateFile), {
                retries: 60,
                interval: 500,
                shouldRetry: (error) => {
                    if (error instanceof Error && /^EBUSY:/.test(error.message)) {
                        return true;
                    }
                    log.warn(`Cannot rename temp file to final file: ${error.message || error.stack}`);
                    return false;
                },
            });
        }
        catch (e) {
            await removeFileIfAny();
            if (e instanceof builder_util_runtime_1.CancellationError) {
                log.info("cancelled");
                this.emit("update-cancelled", updateInfo);
            }
            throw e;
        }
        log.info(`New version ${version} has been downloaded to ${updateFile}`);
        return await done(true);
    }
    async differentialDownloadInstaller(fileInfo, downloadUpdateOptions, installerPath, provider, oldInstallerFileName) {
        try {
            if (this._testOnlyOptions != null && !this._testOnlyOptions.isUseDifferentialDownload) {
                return true;
            }
            const provider = downloadUpdateOptions.updateInfoAndProvider.provider;
            const blockmapFileUrls = await provider.getBlockMapFiles(fileInfo.url, this.app.version, downloadUpdateOptions.updateInfoAndProvider.info.version, this.previousBlockmapBaseUrlOverride);
            this._logger.info(`Download block maps (old: "${blockmapFileUrls[0]}", new: ${blockmapFileUrls[1]})`);
            const downloadBlockMap = async (url) => {
                const data = await this.httpExecutor.downloadToBuffer(url, {
                    headers: downloadUpdateOptions.requestHeaders,
                    cancellationToken: downloadUpdateOptions.cancellationToken,
                });
                if (data == null || data.length === 0) {
                    throw new Error(`Blockmap "${url.href}" is empty`);
                }
                try {
                    return JSON.parse((0, zlib_1.gunzipSync)(data).toString());
                }
                catch (e) {
                    throw new Error(`Cannot parse blockmap "${url.href}", error: ${e}`);
                }
            };
            const downloadOptions = {
                newUrl: fileInfo.url,
                oldFile: path.join(this.downloadedUpdateHelper.cacheDir, oldInstallerFileName),
                logger: this._logger,
                newFile: installerPath,
                isUseMultipleRangeRequest: provider.isUseMultipleRangeRequest,
                requestHeaders: downloadUpdateOptions.requestHeaders,
                cancellationToken: downloadUpdateOptions.cancellationToken,
            };
            if (this.listenerCount(types_1.DOWNLOAD_PROGRESS) > 0) {
                downloadOptions.onProgress = it => this.emit(types_1.DOWNLOAD_PROGRESS, it);
            }
            const saveBlockMapToCacheDir = async (blockMapData, cacheDir) => {
                const blockMapFile = path.join(cacheDir, "current.blockmap");
                await (0, fs_extra_1.outputFile)(blockMapFile, (0, zlib_1.gzipSync)(JSON.stringify(blockMapData)));
            };
            const getBlockMapFromCacheDir = async (cacheDir) => {
                const blockMapFile = path.join(cacheDir, "current.blockmap");
                try {
                    if (await (0, fs_extra_1.pathExists)(blockMapFile)) {
                        return JSON.parse((0, zlib_1.gunzipSync)(await (0, fs_extra_1.readFile)(blockMapFile)).toString());
                    }
                }
                catch (e) {
                    this._logger.warn(`Cannot parse blockmap "${blockMapFile}", error: ${e}`);
                }
                return null;
            };
            const newBlockMapData = await downloadBlockMap(blockmapFileUrls[1]);
            await saveBlockMapToCacheDir(newBlockMapData, this.downloadedUpdateHelper.cacheDirForPendingUpdate);
            // get old blockmap from cache dir first, if not found, download it
            let oldBlockMapData = await getBlockMapFromCacheDir(this.downloadedUpdateHelper.cacheDir);
            if (oldBlockMapData == null) {
                oldBlockMapData = await downloadBlockMap(blockmapFileUrls[0]);
            }
            await new GenericDifferentialDownloader_1.GenericDifferentialDownloader(fileInfo.info, this.httpExecutor, downloadOptions).download(oldBlockMapData, newBlockMapData);
            return false;
        }
        catch (e) {
            this._logger.error(`Cannot download differentially, fallback to full download: ${e.stack || e}`);
            if (this._testOnlyOptions != null) {
                // test mode
                throw e;
            }
            return true;
        }
    }
}
exports.AppUpdater = AppUpdater;
function hasPrereleaseComponents(version) {
    const versionPrereleaseComponent = (0, semver_1.prerelease)(version);
    return versionPrereleaseComponent != null && versionPrereleaseComponent.length > 0;
}
/** @private */
class NoOpLogger {
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    info(message) {
        // ignore
    }
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    warn(message) {
        // ignore
    }
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    error(message) {
        // ignore
    }
}
exports.NoOpLogger = NoOpLogger;
//# sourceMappingURL=AppUpdater.js.map{"version":3,"file":"AppUpdater.js","sourceRoot":"","sources":["../src/AppUpdater.ts"],"names":[],"mappings":";;;AAAA,+DAa6B;AAC7B,mCAAoC;AACpC,2BAA4B;AAC5B,mCAAqC;AACrC,uCAA4F;AAE5F,qCAA8B;AAC9B,uCAA+B;AAC/B,6BAA4B;AAC5B,mCAA8K;AAE9K,qEAAuF;AACvF,6DAAyD;AACzD,iEAA2F;AAC3F,iEAA6D;AAC7D,uDAAwF;AAKxF,+BAA2C;AAE3C,0GAAsG;AACtG,mCAAuJ;AAevJ,MAAsB,UAAW,SAAS,qBAAyD;IAwFjG;;OAEG;IACH,IAAI,OAAO;QACT,OAAO,IAAI,CAAC,QAAQ,CAAA;IACtB,CAAC;IAED;;;;OAIG;IACH,IAAI,OAAO,CAAC,KAAoB;QAC9B,IAAI,IAAI,CAAC,QAAQ,IAAI,IAAI,EAAE,CAAC;YAC1B,qCAAqC;YACrC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;gBAC9B,MAAM,IAAA,+BAAQ,EAAC,sCAAsC,KAAK,EAAE,EAAE,6BAA6B,CAAC,CAAA;YAC9F,CAAC;iBAAM,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBAC9B,MAAM,IAAA,+BAAQ,EAAC,qCAAqC,EAAE,6BAA6B,CAAC,CAAA;YACtF,CAAC;QACH,CAAC;QAED,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAA;QACrB,IAAI,CAAC,cAAc,GAAG,IAAI,CAAA;IAC5B,CAAC;IAOD;;OAEG;IACH,aAAa,CAAC,KAAa;QACzB,IAAI,CAAC,cAAc,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC,cAAc,EAAE;YAC3D,aAAa,EAAE,KAAK;SACrB,CAAC,CAAA;IACJ,CAAC;IAID,yDAAyD;IACzD,IAAI,UAAU;QACZ,OAAO,IAAA,oCAAa,GAAE,CAAA;IACxB,CAAC;IAED;;;OAGG;IACH,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,OAAO,CAAA;IACrB,CAAC;IAED,IAAI,MAAM,CAAC,KAAoB;QAC7B,IAAI,CAAC,OAAO,GAAG,KAAK,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,UAAU,EAAE,CAAC,CAAC,CAAC,KAAK,CAAA;IACzD,CAAC;IAUD,qCAAqC;IACrC;;;OAGG;IACH,IAAI,gBAAgB,CAAC,KAAoB;QACvC,IAAI,CAAC,aAAa,GAAG,IAAI,CAAA;QACzB,IAAI,CAAC,oBAAoB,GAAG,KAAK,CAAA;QACjC,IAAI,CAAC,YAAY,GAAG,IAAI,eAAI,CAAM,GAAG,EAAE,CAAC,IAAI,CAAC,gBAAgB,EAAE,CAAC,CAAA;IAClE,CAAC;IAID;;;OAGG;IACH,IAAI,iBAAiB;QACnB,OAAO,IAAI,CAAC,kBAAkB,CAAA;IAChC,CAAC;IAED,IAAI,iBAAiB,CAAC,KAA0B;QAC9C,IAAI,KAAK,EAAE,CAAC;YACV,IAAI,CAAC,kBAAkB,GAAG,KAAK,CAAA;QACjC,CAAC;IACH,CAAC;IAID;;;;OAIG;IACH,IAAI,mBAAmB;QACrB,OAAO,IAAI,CAAC,oBAAoB,CAAA;IAClC,CAAC;IAED,IAAI,mBAAmB,CAAC,KAA0B;QAChD,IAAI,KAAK,EAAE,CAAC;YACV,IAAI,CAAC,oBAAoB,GAAG,KAAK,CAAA;QACnC,CAAC;IACH,CAAC;IAoBD,YAAsB,OAA6C,EAAE,GAAgB;QACnF,KAAK,EAAE,CAAA;QAzNT;;;WAGG;QACH,iBAAY,GAAG,IAAI,CAAA;QAEnB;;;WAGG;QACH,yBAAoB,GAAG,IAAI,CAAA;QAE3B;;;WAGG;QACH,2BAAsB,GAAG,IAAI,CAAA;QAE7B;;;;WAIG;QACH,oBAAe,GAAG,KAAK,CAAA;QAEvB;;;WAGG;QACH,kBAAa,GAAG,KAAK,CAAA;QAErB;;;;;;WAMG;QACH,mBAAc,GAAG,KAAK,CAAA;QAEtB;;;;;;;WAOG;QACH,wBAAmB,GAAG,KAAK,CAAA;QAE3B;;;;WAIG;QACH,gCAA2B,GAAG,KAAK,CAAA;QAEnC;;;;;;WAMG;QACH,yBAAoB,GAAG,KAAK,CAAA;QAE5B;;;;;;;;;WASG;QACI,oCAA+B,GAAkB,IAAI,CAAA;QAOpD,aAAQ,GAAkB,IAAI,CAAA;QAE5B,2BAAsB,GAAkC,IAAI,CAAA;QA4BtE;;WAEG;QACH,mBAAc,GAA+B,IAAI,CAAA;QAWvC,YAAO,GAAW,OAAO,CAAA;QAmBnC,qCAAqC;QACrC;;WAEG;QACM,YAAO,GAAG,IAAI,qBAAa,CAAC,IAAI,CAAC,CAAA;QAElC,yBAAoB,GAAkB,IAAI,CAAA;QAaxC,uBAAkB,GAAwB,UAAU,CAAC,EAAE,CAAC,IAAI,CAAC,sBAAsB,CAAC,UAAU,CAAC,CAAA;QAgB/F,yBAAoB,GAAwB,UAAU,CAAC,EAAE,CAAC,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,CAAA;QAiB3F,kBAAa,GAAkC,IAAI,CAAA;QAExC,yBAAoB,GAAG,IAAI,eAAI,CAAS,GAAG,EAAE,CAAC,IAAI,CAAC,wBAAwB,EAAE,CAAC,CAAA;QAEjG,8CAA8C;QAC9C,gBAAgB;QAChB,iBAAY,GAAG,IAAI,eAAI,CAAM,GAAG,EAAE,CAAC,IAAI,CAAC,gBAAgB,EAAE,CAAC,CAAA;QAEnD,2BAAsB,GAAsC,IAAI,CAAA;QAChE,oBAAe,GAAkC,IAAI,CAAA;QAInD,0BAAqB,GAAiC,IAAI,CAAA;QAoapE;;;WAGG;QACH,qBAAgB,GAAkC,IAAI,CAAA;QAhapD,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,KAAY,EAAE,EAAE;YAChC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,UAAU,KAAK,CAAC,KAAK,IAAI,KAAK,CAAC,OAAO,EAAE,CAAC,CAAA;QAC9D,CAAC,CAAC,CAAA;QAEF,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC;YAChB,IAAI,CAAC,GAAG,GAAG,IAAI,uCAAkB,EAAE,CAAA;YACnC,IAAI,CAAC,YAAY,GAAG,IAAI,2CAAoB,CAAC,CAAC,QAAQ,EAAE,QAAQ,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAA;QAC9G,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,GAAG,GAAG,GAAG,CAAA;YACd,IAAI,CAAC,YAAY,GAAG,IAAW,CAAA;QACjC,CAAC;QAED,MAAM,oBAAoB,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,CAAA;QAC7C,MAAM,cAAc,GAAG,IAAA,cAAY,EAAC,oBAAoB,CAAC,CAAA;QACzD,IAAI,cAAc,IAAI,IAAI,EAAE,CAAC;YAC3B,MAAM,IAAA,+BAAQ,EAAC,+CAA+C,oBAAoB,GAAG,EAAE,6BAA6B,CAAC,CAAA;QACvH,CAAC;QACD,IAAI,CAAC,cAAc,GAAG,cAAc,CAAA;QACpC,IAAI,CAAC,eAAe,GAAG,uBAAuB,CAAC,cAAc,CAAC,CAAA;QAE9D,IAAI,OAAO,IAAI,IAAI,EAAE,CAAC;YACpB,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAA;YAExB,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,CAAC,cAAc,EAAE,CAAC;gBAC1D,IAAI,CAAC,cAAc,GAAG,OAAO,CAAC,cAAc,CAAA;YAC9C,CAAC;QACH,CAAC;IACH,CAAC;IAED,wDAAwD;IACxD,UAAU;QACR,OAAO,4BAA4B,CAAA;IACrC,CAAC;IAED;;;OAGG;IACH,UAAU,CAAC,OAA0D;QACnE,MAAM,cAAc,GAAG,IAAI,CAAC,4BAA4B,EAAE,CAAA;QAC1D,oEAAoE;QACpE,IAAI,QAAuB,CAAA;QAC3B,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;YAChC,QAAQ,GAAG,IAAI,iCAAe,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE;gBAC1E,GAAG,cAAc;gBACjB,yBAAyB,EAAE,IAAA,wDAAsC,EAAC,OAAO,CAAC;aAC3E,CAAC,CAAA;QACJ,CAAC;aAAM,CAAC;YACN,QAAQ,GAAG,IAAA,8BAAY,EAAC,OAAO,EAAE,IAAI,EAAE,cAAc,CAAC,CAAA;QACxD,CAAC;QACD,IAAI,CAAC,aAAa,GAAG,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAA;IAChD,CAAC;IAED;;;OAGG;IACH,eAAe;QACb,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,EAAE,CAAC;YAC5B,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;QAC9B,CAAC;QAED,IAAI,sBAAsB,GAAG,IAAI,CAAC,sBAAsB,CAAA;QACxD,IAAI,sBAAsB,IAAI,IAAI,EAAE,CAAC;YACnC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,2CAA2C,CAAC,CAAA;YAC9D,OAAO,sBAAsB,CAAA;QAC/B,CAAC;QAED,MAAM,cAAc,GAAG,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,sBAAsB,GAAG,IAAI,CAAC,CAAA;QAEjE,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAA;QACxC,sBAAsB,GAAG,IAAI,CAAC,iBAAiB,EAAE;aAC9C,IAAI,CAAC,EAAE,CAAC,EAAE;YACT,cAAc,EAAE,CAAA;YAChB,OAAO,EAAE,CAAA;QACX,CAAC,CAAC;aACD,KAAK,CAAC,CAAC,CAAM,EAAE,EAAE;YAChB,cAAc,EAAE,CAAA;YAChB,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,EAAE,6BAA6B,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAA;YAC/E,MAAM,CAAC,CAAA;QACT,CAAC,CAAC,CAAA;QAEJ,IAAI,CAAC,sBAAsB,GAAG,sBAAsB,CAAA;QACpD,OAAO,sBAAsB,CAAA;IAC/B,CAAC;IAEM,eAAe;QACpB,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,UAAU,IAAI,IAAI,CAAC,oBAAoB,CAAA;QAClE,IAAI,CAAC,SAAS,EAAE,CAAC;YACf,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,4FAA4F,CAAC,CAAA;YAC/G,OAAO,KAAK,CAAA;QACd,CAAC;QACD,OAAO,IAAI,CAAA;IACb,CAAC;IAED,qCAAqC;IACrC,wBAAwB,CAAC,oBAA2C;QAClE,OAAO,IAAI,CAAC,eAAe,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE;YACtC,IAAI,CAAC,CAAA,EAAE,aAAF,EAAE,uBAAF,EAAE,CAAE,eAAe,CAAA,EAAE,CAAC;gBACzB,IAAI,IAAI,CAAC,OAAO,CAAC,KAAK,IAAI,IAAI,EAAE,CAAC;oBAC/B,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,0DAA0D,CAAC,CAAA;gBAChF,CAAC;gBACD,OAAO,EAAE,CAAA;YACX,CAAC;YAED,KAAK,EAAE,CAAC,eAAe,CAAC,IAAI,CAAC,GAAG,EAAE;gBAChC,MAAM,mBAAmB,GAAG,UAAU,CAAC,0BAA0B,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,oBAAoB,CAAC,CAAA;gBAC7H,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,YAAY,CAAC,CAAC,mBAAmB,CAAC,CAAC,IAAI,EAAE,CAAA;YACpE,CAAC,CAAC,CAAA;YAEF,OAAO,EAAE,CAAA;QACX,CAAC,CAAC,CAAA;IACJ,CAAC;IAEO,MAAM,CAAC,0BAA0B,CAAC,OAAe,EAAE,OAAe,EAAE,oBAA2C;QACrH,IAAI,oBAAoB,IAAI,IAAI,EAAE,CAAC;YACjC,oBAAoB,GAAG;gBACrB,KAAK,EAAE,kCAAkC;gBACzC,IAAI,EAAE,6FAA6F;aACpG,CAAA;QACH,CAAC;QACD,oBAAoB,GAAG;YACrB,KAAK,EAAE,oBAAoB,CAAC,KAAK,CAAC,OAAO,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC,OAAO,CAAC,WAAW,EAAE,OAAO,CAAC;YAC7F,IAAI,EAAE,oBAAoB,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC,OAAO,CAAC,WAAW,EAAE,OAAO,CAAC;SAC5F,CAAA;QACD,OAAO,oBAAoB,CAAA;IAC7B,CAAC;IAEO,KAAK,CAAC,cAAc,CAAC,UAAsB;QACjD,MAAM,oBAAoB,GAAG,UAAU,CAAC,iBAAiB,CAAA;QACzD,IAAI,iBAAiB,GAAG,oBAAoB,CAAA;QAC5C,IAAI,iBAAiB,IAAI,IAAI,EAAE,CAAC;YAC9B,OAAO,IAAI,CAAA;QACb,CAAC;QAED,iBAAiB,GAAG,QAAQ,CAAC,iBAAwB,EAAE,EAAE,CAAC,CAAA;QAC1D,IAAI,KAAK,CAAC,iBAAiB,CAAC,EAAE,CAAC;YAC7B,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,8BAA8B,oBAAoB,EAAE,CAAC,CAAA;YACvE,OAAO,IAAI,CAAA;QACb,CAAC;QAED,0CAA0C;QAC1C,iBAAiB,GAAG,iBAAiB,GAAG,GAAG,CAAA;QAE3C,MAAM,aAAa,GAAG,MAAM,IAAI,CAAC,oBAAoB,CAAC,KAAK,CAAA;QAC3D,MAAM,GAAG,GAAG,2BAAI,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,YAAY,CAAC,EAAE,CAAC,CAAA;QACtD,MAAM,UAAU,GAAG,GAAG,GAAG,UAAU,CAAA;QACnC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,uBAAuB,iBAAiB,iBAAiB,UAAU,cAAc,aAAa,EAAE,CAAC,CAAA;QACnH,OAAO,UAAU,GAAG,iBAAiB,CAAA;IACvC,CAAC;IAEO,mBAAmB,CAAC,OAA4B;QACtD,IAAI,IAAI,CAAC,cAAc,IAAI,IAAI,EAAE,CAAC;YAChC,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,IAAI,CAAC,cAAc,CAAC,CAAA;QAC7C,CAAC;QACD,OAAO,OAAO,CAAA;IAChB,CAAC;IAEO,KAAK,CAAC,iBAAiB,CAAC,UAAsB;QACpD,MAAM,aAAa,GAAG,IAAA,cAAY,EAAC,UAAU,CAAC,OAAO,CAAC,CAAA;QACtD,IAAI,aAAa,IAAI,IAAI,EAAE,CAAC;YAC1B,MAAM,IAAA,+BAAQ,EACZ,wHAAwH,UAAU,CAAC,OAAO,GAAG,EAC7I,6BAA6B,CAC9B,CAAA;QACH,CAAC;QAED,MAAM,cAAc,GAAG,IAAI,CAAC,cAAc,CAAA;QAC1C,IAAI,IAAA,WAAe,EAAC,aAAa,EAAE,cAAc,CAAC,EAAE,CAAC;YACnD,OAAO,KAAK,CAAA;QACd,CAAC;QAED,IAAI,CAAC,CAAC,MAAM,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,iBAAiB,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC;YACjE,OAAO,KAAK,CAAA;QACd,CAAC;QAED,MAAM,mBAAmB,GAAG,MAAM,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,mBAAmB,CAAC,UAAU,CAAC,CAAC,CAAA;QACvF,IAAI,CAAC,mBAAmB,EAAE,CAAC;YACzB,OAAO,KAAK,CAAA;QACd,CAAC;QAED,yFAAyF;QACzF,yFAAyF;QACzF,MAAM,oBAAoB,GAAG,IAAA,WAAoB,EAAC,aAAa,EAAE,cAAc,CAAC,CAAA;QAChF,MAAM,oBAAoB,GAAG,IAAA,WAAiB,EAAC,aAAa,EAAE,cAAc,CAAC,CAAA;QAE7E,IAAI,oBAAoB,EAAE,CAAC;YACzB,OAAO,IAAI,CAAA;QACb,CAAC;QACD,OAAO,IAAI,CAAC,cAAc,IAAI,oBAAoB,CAAA;IACpD,CAAC;IAEO,sBAAsB,CAAC,UAAsB;QACnD,MAAM,oBAAoB,GAAG,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,oBAAoB,CAAA;QAC7D,MAAM,gBAAgB,GAAG,IAAA,YAAO,GAAE,CAAA;QAClC,IAAI,oBAAoB,EAAE,CAAC;YACzB,IAAI,CAAC;gBACH,IAAI,IAAA,WAAiB,EAAC,gBAAgB,EAAE,oBAAoB,CAAC,EAAE,CAAC;oBAC9D,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,sBAAsB,gBAAgB,iDAAiD,oBAAoB,gBAAgB,gBAAgB,EAAE,CAAC,CAAA;oBAChK,OAAO,KAAK,CAAA;gBACd,CAAC;YACH,CAAC;YAAC,OAAO,CAAM,EAAE,CAAC;gBAChB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,wCAAwC,gBAAgB,6BAA6B,oBAAoB,MAAM,CAAC,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAA;YACjK,CAAC;QACH,CAAC;QACD,OAAO,IAAI,CAAA;IACb,CAAC;IAES,KAAK,CAAC,wBAAwB;QACtC,MAAM,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE,CAAA;QAE1B,IAAI,IAAI,CAAC,aAAa,IAAI,IAAI,EAAE,CAAC;YAC/B,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC,IAAA,8BAAY,EAAC,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,4BAA4B,EAAE,CAAC,CAAC,CAAA;QACtH,CAAC;QAED,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,aAAa,CAAA;QACvC,MAAM,aAAa,GAAG,MAAM,IAAI,CAAC,oBAAoB,CAAC,KAAK,CAAA;QAC3D,MAAM,CAAC,iBAAiB,CAAC,IAAI,CAAC,mBAAmB,CAAC,EAAE,mBAAmB,EAAE,aAAa,EAAE,CAAC,CAAC,CAAA;QAC1F,OAAO;YACL,IAAI,EAAE,MAAM,MAAM,CAAC,gBAAgB,EAAE;YACrC,QAAQ,EAAE,MAAM;SACjB,CAAA;IACH,CAAC;IAEO,4BAA4B;QAClC,OAAO;YACL,yBAAyB,EAAE,IAAI;YAC/B,QAAQ,EAAE,IAAI,CAAC,gBAAgB,IAAI,IAAI,CAAC,CAAC,CAAE,OAAO,CAAC,QAA6B,CAAC,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC,QAAQ;YACjH,QAAQ,EAAE,IAAI,CAAC,YAAY;SAC5B,CAAA;IACH,CAAC;IAEO,KAAK,CAAC,iBAAiB;QAC7B,IAAI,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAA;QAEhC,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,wBAAwB,EAAE,CAAA;QACpD,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAA;QAC9B,IAAI,CAAC,CAAC,MAAM,IAAI,CAAC,iBAAiB,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC;YAChD,IAAI,CAAC,OAAO,CAAC,IAAI,CACf,sBAAsB,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE,sCAAsC,UAAU,CAAC,OAAO,kBACxG,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,YACpC,IAAI,CACL,CAAA;YACD,IAAI,CAAC,IAAI,CAAC,sBAAsB,EAAE,UAAU,CAAC,CAAA;YAC7C,OAAO;gBACL,iBAAiB,EAAE,KAAK;gBACxB,WAAW,EAAE,UAAU;gBACvB,UAAU;aACX,CAAA;QACH,CAAC;QAED,IAAI,CAAC,qBAAqB,GAAG,MAAM,CAAA;QACnC,IAAI,CAAC,iBAAiB,CAAC,UAAU,CAAC,CAAA;QAElC,MAAM,iBAAiB,GAAG,IAAI,wCAAiB,EAAE,CAAA;QACjD,8BAA8B;QAC9B,OAAO;YACL,iBAAiB,EAAE,IAAI;YACvB,WAAW,EAAE,UAAU;YACvB,UAAU;YACV,iBAAiB;YACjB,eAAe,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,IAAI;SACnF,CAAA;IACH,CAAC;IAES,iBAAiB,CAAC,UAAsB;QAChD,IAAI,CAAC,OAAO,CAAC,IAAI,CACf,iBAAiB,UAAU,CAAC,OAAO,UAAU,IAAA,8BAAO,EAAC,UAAU,CAAC,KAAK,CAAC;aACnE,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC;aACjB,IAAI,CAAC,IAAI,CAAC,GAAG,CACjB,CAAA;QACD,IAAI,CAAC,IAAI,CAAC,kBAAkB,EAAE,UAAU,CAAC,CAAA;IAC3C,CAAC;IAED;;;OAGG;IACH,cAAc,CAAC,oBAAuC,IAAI,wCAAiB,EAAE;QAC3E,MAAM,qBAAqB,GAAG,IAAI,CAAC,qBAAqB,CAAA;QACxD,IAAI,qBAAqB,IAAI,IAAI,EAAE,CAAC;YAClC,MAAM,KAAK,GAAG,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAA;YACpD,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CAAA;YACzB,OAAO,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;QAC9B,CAAC;QAED,IAAI,IAAI,CAAC,eAAe,IAAI,IAAI,EAAE,CAAC;YACjC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,0CAA0C,CAAC,CAAA;YAC7D,OAAO,IAAI,CAAC,eAAe,CAAA;QAC7B,CAAC;QAED,IAAI,CAAC,OAAO,CAAC,IAAI,CACf,2BAA2B,IAAA,8BAAO,EAAC,qBAAqB,CAAC,IAAI,CAAC,KAAK,CAAC;aACjE,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC;aACjB,IAAI,CAAC,IAAI,CAAC,EAAE,CAChB,CAAA;QACD,MAAM,YAAY,GAAG,CAAC,CAAQ,EAAS,EAAE;YACvC,2FAA2F;YAC3F,IAAI,CAAC,CAAC,CAAC,YAAY,wCAAiB,CAAC,EAAE,CAAC;gBACtC,IAAI,CAAC;oBACH,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,CAAA;gBACvB,CAAC;gBAAC,OAAO,WAAgB,EAAE,CAAC;oBAC1B,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,gCAAgC,WAAW,CAAC,KAAK,IAAI,WAAW,EAAE,CAAC,CAAA;gBACvF,CAAC;YACH,CAAC;YAED,OAAO,CAAC,CAAA;QACV,CAAC,CAAA;QAED,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC,gBAAgB,CAAC;YAC3C,qBAAqB;YACrB,cAAc,EAAE,IAAI,CAAC,qBAAqB,CAAC,qBAAqB,CAAC,QAAQ,CAAC;YAC1E,iBAAiB;YACjB,mBAAmB,EAAE,IAAI,CAAC,mBAAmB;YAC7C,2BAA2B,EAAE,IAAI,CAAC,2BAA2B;SAC9D,CAAC;aACC,KAAK,CAAC,CAAC,CAAM,EAAE,EAAE;YAChB,MAAM,YAAY,CAAC,CAAC,CAAC,CAAA;QACvB,CAAC,CAAC;aACD,OAAO,CAAC,GAAG,EAAE;YACZ,IAAI,CAAC,eAAe,GAAG,IAAI,CAAA;QAC7B,CAAC,CAAC,CAAA;QAEJ,OAAO,IAAI,CAAC,eAAe,CAAA;IAC7B,CAAC;IAES,aAAa,CAAC,CAAQ;QAC9B,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAA;IAClD,CAAC;IAES,wBAAwB,CAAC,KAA4B;QAC7D,IAAI,CAAC,IAAI,CAAC,yBAAiB,EAAE,KAAK,CAAC,CAAA;IACrC,CAAC;IAiBO,KAAK,CAAC,gBAAgB;QAC5B,IAAI,IAAI,CAAC,oBAAoB,IAAI,IAAI,EAAE,CAAC;YACtC,IAAI,CAAC,oBAAoB,GAAG,IAAI,CAAC,GAAG,CAAC,mBAAmB,CAAA;QAC1D,CAAC;QACD,OAAO,IAAA,cAAI,EAAC,MAAM,IAAA,mBAAQ,EAAC,IAAI,CAAC,oBAAoB,EAAE,OAAO,CAAC,CAAC,CAAA;IACjE,CAAC;IAEO,qBAAqB,CAAC,QAAuB;QACnD,MAAM,wBAAwB,GAAG,QAAQ,CAAC,wBAAwB,CAAA;QAClE,IAAI,wBAAwB,IAAI,IAAI,EAAE,CAAC;YACrC,MAAM,cAAc,GAAG,IAAI,CAAC,cAAc,CAAA;YAC1C,OAAO,cAAc,IAAI,IAAI;gBAC3B,CAAC,CAAC,wBAAwB;gBAC1B,CAAC,CAAC;oBACE,GAAG,wBAAwB;oBAC3B,GAAG,cAAc;iBAClB,CAAA;QACP,CAAC;QACD,OAAO,IAAI,CAAC,mBAAmB,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAA;IACpD,CAAC;IAEO,KAAK,CAAC,wBAAwB;QACpC,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,YAAY,EAAE,YAAY,CAAC,CAAA;QAC3D,IAAI,CAAC;YACH,MAAM,EAAE,GAAG,MAAM,IAAA,mBAAQ,EAAC,IAAI,EAAE,OAAO,CAAC,CAAA;YACxC,IAAI,2BAAI,CAAC,KAAK,CAAC,EAAE,CAAC,EAAE,CAAC;gBACnB,OAAO,EAAE,CAAA;YACX,CAAC;iBAAM,CAAC;gBACN,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,yDAAyD,EAAE,EAAE,CAAC,CAAA;YAClF,CAAC;QACH,CAAC;QAAC,OAAO,CAAM,EAAE,CAAC;YAChB,IAAI,CAAC,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;gBACxB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,wDAAwD,CAAC,EAAE,CAAC,CAAA;YAChF,CAAC;QACH,CAAC;QAED,MAAM,EAAE,GAAG,2BAAI,CAAC,EAAE,CAAC,IAAA,oBAAW,EAAC,IAAI,CAAC,EAAE,2BAAI,CAAC,GAAG,CAAC,CAAA;QAC/C,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,kCAAkC,EAAE,EAAE,CAAC,CAAA;QACzD,IAAI,CAAC;YACH,MAAM,IAAA,qBAAU,EAAC,IAAI,EAAE,EAAE,CAAC,CAAA;QAC5B,CAAC;QAAC,OAAO,CAAM,EAAE,CAAC;YAChB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,uCAAuC,CAAC,EAAE,CAAC,CAAA;QAC/D,CAAC;QACD,OAAO,EAAE,CAAA;IACX,CAAC;IAED,gBAAgB;IAChB,IAAI,iBAAiB;QACnB,MAAM,OAAO,GAAG,IAAI,CAAC,cAAc,CAAA;QACnC,oEAAoE;QACpE,IAAI,OAAO,IAAI,IAAI,EAAE,CAAC;YACpB,OAAO,IAAI,CAAA;QACb,CAAC;QAED,KAAK,MAAM,UAAU,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;YAC9C,MAAM,CAAC,GAAG,UAAU,CAAC,WAAW,EAAE,CAAA;YAClC,IAAI,CAAC,KAAK,eAAe,IAAI,CAAC,KAAK,eAAe,EAAE,CAAC;gBACnD,OAAO,KAAK,CAAA;YACd,CAAC;QACH,CAAC;QACD,OAAO,IAAI,CAAA;IACb,CAAC;IAQO,KAAK,CAAC,yBAAyB;QACrC,IAAI,MAAM,GAAG,IAAI,CAAC,sBAAsB,CAAA;QACxC,IAAI,MAAM,IAAI,IAAI,EAAE,CAAC;YACnB,MAAM,OAAO,GAAG,CAAC,MAAM,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,mBAAmB,CAAA;YACnE,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAA;YAC3B,IAAI,OAAO,IAAI,IAAI,EAAE,CAAC;gBACpB,MAAM,CAAC,KAAK,CAAC,+GAA+G,CAAC,CAAA;YAC/H,CAAC;YACD,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,aAAa,EAAE,OAAO,IAAI,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;YAC5E,IAAI,MAAM,CAAC,KAAK,IAAI,IAAI,EAAE,CAAC;gBACzB,MAAM,CAAC,KAAK,CAAC,sBAAsB,QAAQ,EAAE,CAAC,CAAA;YAChD,CAAC;YAED,MAAM,GAAG,IAAI,+CAAsB,CAAC,QAAQ,CAAC,CAAA;YAC7C,IAAI,CAAC,sBAAsB,GAAG,MAAM,CAAA;QACtC,CAAC;QACD,OAAO,MAAM,CAAA;IACf,CAAC;IAES,KAAK,CAAC,eAAe,CAAC,WAAiC;QAC/D,MAAM,QAAQ,GAAG,WAAW,CAAC,QAAQ,CAAA;QACrC,MAAM,eAAe,GAAoB;YACvC,OAAO,EAAE,WAAW,CAAC,qBAAqB,CAAC,cAAc;YACzD,iBAAiB,EAAE,WAAW,CAAC,qBAAqB,CAAC,iBAAiB;YACtE,IAAI,EAAG,QAAQ,CAAC,IAAY,CAAC,IAAI;YACjC,MAAM,EAAE,QAAQ,CAAC,IAAI,CAAC,MAAM;SAC7B,CAAA;QAED,IAAI,IAAI,CAAC,aAAa,CAAC,yBAAiB,CAAC,GAAG,CAAC,EAAE,CAAC;YAC9C,eAAe,CAAC,UAAU,GAAG,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,yBAAiB,EAAE,EAAE,CAAC,CAAA;QACrE,CAAC;QAED,MAAM,UAAU,GAAG,WAAW,CAAC,qBAAqB,CAAC,qBAAqB,CAAC,IAAI,CAAA;QAC/E,MAAM,OAAO,GAAG,UAAU,CAAC,OAAO,CAAA;QAClC,MAAM,WAAW,GAAG,QAAQ,CAAC,WAAW,CAAA;QAExC,SAAS,sBAAsB;YAC7B,0CAA0C;YAC1C,MAAM,OAAO,GAAG,kBAAkB,CAAC,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;YACrE,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,IAAI,WAAW,CAAC,aAAa,CAAC,WAAW,EAAE,EAAE,CAAC,EAAE,CAAC;gBAClF,OAAO,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAA;YAC/B,CAAC;iBAAM,CAAC;gBACN,kFAAkF;gBAClF,kDAAkD;gBAClD,OAAO,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;YACrD,CAAC;QACH,CAAC;QAED,MAAM,sBAAsB,GAAG,MAAM,IAAI,CAAC,yBAAyB,EAAE,CAAA;QACrE,MAAM,QAAQ,GAAG,sBAAsB,CAAC,wBAAwB,CAAA;QAChE,MAAM,IAAA,gBAAK,EAAC,QAAQ,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAA;QAC1C,MAAM,cAAc,GAAG,sBAAsB,EAAE,CAAA;QAC/C,IAAI,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAA;QACpD,MAAM,WAAW,GAAG,WAAW,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,WAAW,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,KAAK,EAAE,CAAC,CAAA;QAEpI,MAAM,IAAI,GAAG,KAAK,EAAE,WAAoB,EAAE,EAAE;YAC1C,MAAM,sBAAsB,CAAC,iBAAiB,CAAC,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAE,cAAc,EAAE,WAAW,CAAC,CAAA;YAC1H,MAAM,WAAW,CAAC,IAAK,CAAC;gBACtB,GAAG,UAAU;gBACb,cAAc,EAAE,UAAU;aAC3B,CAAC,CAAA;YACF,MAAM,mBAAmB,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,kBAAkB,CAAC,CAAA;YACnE,IAAI,MAAM,IAAA,qBAAU,EAAC,mBAAmB,CAAC,EAAE,CAAC;gBAC1C,MAAM,IAAA,mBAAQ,EAAC,mBAAmB,EAAE,IAAI,CAAC,IAAI,CAAC,sBAAsB,CAAC,QAAQ,EAAE,kBAAkB,CAAC,CAAC,CAAA;YACrG,CAAC;YACD,OAAO,WAAW,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,EAAE,WAAW,CAAC,CAAA;QACvE,CAAC,CAAA;QAED,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAA;QACxB,MAAM,gBAAgB,GAAG,MAAM,sBAAsB,CAAC,sBAAsB,CAAC,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAG,CAAC,CAAA;QACnH,IAAI,gBAAgB,IAAI,IAAI,EAAE,CAAC;YAC7B,UAAU,GAAG,gBAAgB,CAAA;YAC7B,OAAO,MAAM,IAAI,CAAC,KAAK,CAAC,CAAA;QAC1B,CAAC;QAED,MAAM,eAAe,GAAG,KAAK,IAAI,EAAE;YACjC,MAAM,sBAAsB,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE;gBAC9C,SAAS;YACX,CAAC,CAAC,CAAA;YACF,OAAO,MAAM,IAAA,iBAAM,EAAC,UAAU,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE;gBACzC,SAAS;YACX,CAAC,CAAC,CAAA;QACJ,CAAC,CAAA;QAED,MAAM,cAAc,GAAG,MAAM,IAAA,6CAAoB,EAAC,QAAQ,cAAc,EAAE,EAAE,QAAQ,EAAE,GAAG,CAAC,CAAA;QAC1F,IAAI,CAAC;YACH,MAAM,WAAW,CAAC,IAAI,CAAC,cAAc,EAAE,eAAe,EAAE,WAAW,EAAE,eAAe,CAAC,CAAA;YACrF,MAAM,IAAA,4BAAK,EAAC,GAAG,EAAE,CAAC,IAAA,iBAAM,EAAC,cAAc,EAAE,UAAU,CAAC,EAAE;gBACpD,OAAO,EAAE,EAAE;gBACX,QAAQ,EAAE,GAAG;gBACb,WAAW,EAAE,CAAC,KAAY,EAAE,EAAE;oBAC5B,IAAI,KAAK,YAAY,KAAK,IAAI,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC;wBAC5D,OAAO,IAAI,CAAA;oBACb,CAAC;oBACD,GAAG,CAAC,IAAI,CAAC,0CAA0C,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,KAAK,EAAE,CAAC,CAAA;oBAClF,OAAO,KAAK,CAAA;gBACd,CAAC;aACF,CAAC,CAAA;QACJ,CAAC;QAAC,OAAO,CAAM,EAAE,CAAC;YAChB,MAAM,eAAe,EAAE,CAAA;YAEvB,IAAI,CAAC,YAAY,wCAAiB,EAAE,CAAC;gBACnC,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,CAAA;gBACrB,IAAI,CAAC,IAAI,CAAC,kBAAkB,EAAE,UAAU,CAAC,CAAA;YAC3C,CAAC;YACD,MAAM,CAAC,CAAA;QACT,CAAC;QAED,GAAG,CAAC,IAAI,CAAC,eAAe,OAAO,2BAA2B,UAAU,EAAE,CAAC,CAAA;QACvE,OAAO,MAAM,IAAI,CAAC,IAAI,CAAC,CAAA;IACzB,CAAC;IACS,KAAK,CAAC,6BAA6B,CAC3C,QAAgC,EAChC,qBAA4C,EAC5C,aAAqB,EACrB,QAAuB,EACvB,oBAA4B;QAE5B,IAAI,CAAC;YACH,IAAI,IAAI,CAAC,gBAAgB,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,yBAAyB,EAAE,CAAC;gBACtF,OAAO,IAAI,CAAA;YACb,CAAC;YACD,MAAM,QAAQ,GAAG,qBAAqB,CAAC,qBAAqB,CAAC,QAAQ,CAAA;YACrE,MAAM,gBAAgB,GAAG,MAAM,QAAQ,CAAC,gBAAgB,CACtD,QAAQ,CAAC,GAAG,EACZ,IAAI,CAAC,GAAG,CAAC,OAAO,EAChB,qBAAqB,CAAC,qBAAqB,CAAC,IAAI,CAAC,OAAO,EACxD,IAAI,CAAC,+BAA+B,CACrC,CAAA;YACD,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,8BAA8B,gBAAgB,CAAC,CAAC,CAAC,WAAW,gBAAgB,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA;YAErG,MAAM,gBAAgB,GAAG,KAAK,EAAE,GAAQ,EAAqB,EAAE;gBAC7D,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,gBAAgB,CAAC,GAAG,EAAE;oBACzD,OAAO,EAAE,qBAAqB,CAAC,cAAc;oBAC7C,iBAAiB,EAAE,qBAAqB,CAAC,iBAAiB;iBAC3D,CAAC,CAAA;gBAEF,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;oBACtC,MAAM,IAAI,KAAK,CAAC,aAAa,GAAG,CAAC,IAAI,YAAY,CAAC,CAAA;gBACpD,CAAC;gBAED,IAAI,CAAC;oBACH,OAAO,IAAI,CAAC,KAAK,CAAC,IAAA,iBAAU,EAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAA;gBAChD,CAAC;gBAAC,OAAO,CAAM,EAAE,CAAC;oBAChB,MAAM,IAAI,KAAK,CAAC,0BAA0B,GAAG,CAAC,IAAI,aAAa,CAAC,EAAE,CAAC,CAAA;gBACrE,CAAC;YACH,CAAC,CAAA;YAED,MAAM,eAAe,GAAkC;gBACrD,MAAM,EAAE,QAAQ,CAAC,GAAG;gBACpB,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,sBAAuB,CAAC,QAAQ,EAAE,oBAAoB,CAAC;gBAC/E,MAAM,EAAE,IAAI,CAAC,OAAO;gBACpB,OAAO,EAAE,aAAa;gBACtB,yBAAyB,EAAE,QAAQ,CAAC,yBAAyB;gBAC7D,cAAc,EAAE,qBAAqB,CAAC,cAAc;gBACpD,iBAAiB,EAAE,qBAAqB,CAAC,iBAAiB;aAC3D,CAAA;YAED,IAAI,IAAI,CAAC,aAAa,CAAC,yBAAiB,CAAC,GAAG,CAAC,EAAE,CAAC;gBAC9C,eAAe,CAAC,UAAU,GAAG,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,yBAAiB,EAAE,EAAE,CAAC,CAAA;YACrE,CAAC;YAED,MAAM,sBAAsB,GAAG,KAAK,EAAE,YAAsB,EAAE,QAAgB,EAAE,EAAE;gBAChF,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,kBAAkB,CAAC,CAAA;gBAC5D,MAAM,IAAA,qBAAU,EAAC,YAAY,EAAE,IAAA,eAAQ,EAAC,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC,CAAC,CAAA;YACxE,CAAC,CAAA;YAED,MAAM,uBAAuB,GAAG,KAAK,EAAE,QAAgB,EAAE,EAAE;gBACzD,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,kBAAkB,CAAC,CAAA;gBAC5D,IAAI,CAAC;oBACH,IAAI,MAAM,IAAA,qBAAU,EAAC,YAAY,CAAC,EAAE,CAAC;wBACnC,OAAO,IAAI,CAAC,KAAK,CAAC,IAAA,iBAAU,EAAC,MAAM,IAAA,mBAAQ,EAAC,YAAY,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAA;oBACxE,CAAC;gBACH,CAAC;gBAAC,OAAO,CAAM,EAAE,CAAC;oBAChB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,0BAA0B,YAAY,aAAa,CAAC,EAAE,CAAC,CAAA;gBAC3E,CAAC;gBACD,OAAO,IAAI,CAAA;YACb,CAAC,CAAA;YAED,MAAM,eAAe,GAAG,MAAM,gBAAgB,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAA;YACnE,MAAM,sBAAsB,CAAC,eAAe,EAAE,IAAI,CAAC,sBAAuB,CAAC,wBAAwB,CAAC,CAAA;YAEpG,mEAAmE;YACnE,IAAI,eAAe,GAAG,MAAM,uBAAuB,CAAC,IAAI,CAAC,sBAAuB,CAAC,QAAQ,CAAC,CAAA;YAC1F,IAAI,eAAe,IAAI,IAAI,EAAE,CAAC;gBAC5B,eAAe,GAAG,MAAM,gBAAgB,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAA;YAC/D,CAAC;YAED,MAAM,IAAI,6DAA6B,CAAC,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,YAAY,EAAE,eAAe,CAAC,CAAC,QAAQ,CAAC,eAAe,EAAE,eAAe,CAAC,CAAA;YACrI,OAAO,KAAK,CAAA;QACd,CAAC;QAAC,OAAO,CAAM,EAAE,CAAC;YAChB,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,8DAA8D,CAAC,CAAC,KAAK,IAAI,CAAC,EAAE,CAAC,CAAA;YAChG,IAAI,IAAI,CAAC,gBAAgB,IAAI,IAAI,EAAE,CAAC;gBAClC,YAAY;gBACZ,MAAM,CAAC,CAAA;YACT,CAAC;YACD,OAAO,IAAI,CAAA;QACb,CAAC;IACH,CAAC;CACF;AAr0BD,gCAq0BC;AAUD,SAAS,uBAAuB,CAAC,OAAe;IAC9C,MAAM,0BAA0B,GAAG,IAAA,mBAA4B,EAAC,OAAO,CAAC,CAAA;IACxE,OAAO,0BAA0B,IAAI,IAAI,IAAI,0BAA0B,CAAC,MAAM,GAAG,CAAC,CAAA;AACpF,CAAC;AAED,eAAe;AACf,MAAa,UAAU;IACrB,6DAA6D;IAC7D,IAAI,CAAC,OAAa;QAChB,SAAS;IACX,CAAC;IAED,6DAA6D;IAC7D,IAAI,CAAC,OAAa;QAChB,SAAS;IACX,CAAC;IAED,6DAA6D;IAC7D,KAAK,CAAC,OAAa;QACjB,SAAS;IACX,CAAC;CACF;AAfD,gCAeC","sourcesContent":["import {\n  AllPublishOptions,\n  asArray,\n  CancellationToken,\n  newError,\n  PublishConfiguration,\n  UpdateInfo,\n  UUID,\n  DownloadOptions,\n  CancellationError,\n  ProgressInfo,\n  BlockMap,\n  retry,\n} from \"builder-util-runtime\"\nimport { randomBytes } from \"crypto\"\nimport { release } from \"os\"\nimport { EventEmitter } from \"events\"\nimport { mkdir, outputFile, readFile, rename, unlink, copyFile, pathExists } from \"fs-extra\"\nimport { OutgoingHttpHeaders } from \"http\"\nimport { load } from \"js-yaml\"\nimport { Lazy } from \"lazy-val\"\nimport * as path from \"path\"\nimport { eq as isVersionsEqual, gt as isVersionGreaterThan, lt as isVersionLessThan, parse as parseVersion, prerelease as getVersionPreleaseComponents, SemVer } from \"semver\"\nimport { AppAdapter } from \"./AppAdapter\"\nimport { createTempUpdateFile, DownloadedUpdateHelper } from \"./DownloadedUpdateHelper\"\nimport { ElectronAppAdapter } from \"./ElectronAppAdapter\"\nimport { ElectronHttpExecutor, getNetSession, LoginCallback } from \"./electronHttpExecutor\"\nimport { GenericProvider } from \"./providers/GenericProvider\"\nimport { createClient, isUrlProbablySupportMultiRangeRequests } from \"./providerFactory\"\nimport { Provider, ProviderPlatform } from \"./providers/Provider\"\nimport type { TypedEmitter } from \"tiny-typed-emitter\"\nimport Session = Electron.Session\nimport type { AuthInfo } from \"electron\"\nimport { gunzipSync, gzipSync } from \"zlib\"\nimport { DifferentialDownloaderOptions } from \"./differentialDownloader/DifferentialDownloader\"\nimport { GenericDifferentialDownloader } from \"./differentialDownloader/GenericDifferentialDownloader\"\nimport { DOWNLOAD_PROGRESS, Logger, ResolvedUpdateFileInfo, UPDATE_DOWNLOADED, UpdateCheckResult, UpdateDownloadedEvent, UpdaterSignal } from \"./types\"\nimport { VerifyUpdateSupport } from \"./main\"\n\nexport type AppUpdaterEvents = {\n  error: (error: Error, message?: string) => void\n  login: (info: AuthInfo, callback: LoginCallback) => void\n  \"checking-for-update\": () => void\n  \"update-not-available\": (info: UpdateInfo) => void\n  \"update-available\": (info: UpdateInfo) => void\n  \"update-downloaded\": (event: UpdateDownloadedEvent) => void\n  \"download-progress\": (info: ProgressInfo) => void\n  \"update-cancelled\": (info: UpdateInfo) => void\n  \"appimage-filename-updated\": (path: string) => void\n}\n\nexport abstract class AppUpdater extends (EventEmitter as new () => TypedEmitter<AppUpdaterEvents>) {\n  /**\n   * Whether to automatically download an update when it is found.\n   * @default true\n   */\n  autoDownload = true\n\n  /**\n   * Whether to automatically install a downloaded update on app quit (if `quitAndInstall` was not called before).\n   * @default true\n   */\n  autoInstallOnAppQuit = true\n\n  /**\n   * Whether to run the app after finish install when run the installer is NOT in silent mode.\n   * @default true\n   */\n  autoRunAppAfterInstall = true\n\n  /**\n   * *GitHub provider only.* Whether to allow update to pre-release versions. Defaults to `true` if application version contains prerelease components (e.g. `0.12.1-alpha.1`, here `alpha` is a prerelease component), otherwise `false`.\n   *\n   * If `true`, downgrade will be allowed (`allowDowngrade` will be set to `true`).\n   */\n  allowPrerelease = false\n\n  /**\n   * *GitHub provider only.* Get all release notes (from current version to latest), not just the latest.\n   * @default false\n   */\n  fullChangelog = false\n\n  /**\n   * Whether to allow version downgrade (when a user from the beta channel wants to go back to the stable channel).\n   *\n   * Taken in account only if channel differs (pre-release version component in terms of semantic versioning).\n   *\n   * @default false\n   */\n  allowDowngrade = false\n\n  /**\n   * Web installer files might not have signature verification, this switch prevents to load them unless it is needed.\n   *\n   * Currently false to prevent breaking the current API, but it should be changed to default true at some point that\n   * breaking changes are allowed.\n   *\n   * @default false\n   */\n  disableWebInstaller = false\n\n  /**\n   * *NSIS only* Disable differential downloads and always perform full download of installer.\n   *\n   * @default false\n   */\n  disableDifferentialDownload = false\n\n  /**\n   * Allows developer to force the updater to work in \"dev\" mode, looking for \"dev-app-update.yml\" instead of \"app-update.yml\"\n   * Dev: `path.join(this.app.getAppPath(), \"dev-app-update.yml\")`\n   * Prod: `path.join(process.resourcesPath!, \"app-update.yml\")`\n   *\n   * @default false\n   */\n  forceDevUpdateConfig = false\n\n  /**\n   * The base URL of the old block map file.\n   *\n   * When null, the updater will use the base URL of the update file to download the update.\n   * When set, the updater will use this string as the base URL of the old block map file.\n   * Some servers like github cannot download the old block map file from latest release,\n   * so you need to compute the old block map file base URL manually.\n   *\n   * @default null\n   */\n  public previousBlockmapBaseUrlOverride: string | null = null\n\n  /**\n   * The current application version.\n   */\n  readonly currentVersion: SemVer\n\n  private _channel: string | null = null\n\n  protected downloadedUpdateHelper: DownloadedUpdateHelper | null = null\n\n  /**\n   * Get the update channel. Doesn't return `channel` from the update configuration, only if was previously set.\n   */\n  get channel(): string | null {\n    return this._channel\n  }\n\n  /**\n   * Set the update channel. Overrides `channel` in the update configuration.\n   *\n   * `allowDowngrade` will be automatically set to `true`. If this behavior is not suitable for you, simple set `allowDowngrade` explicitly after.\n   */\n  set channel(value: string | null) {\n    if (this._channel != null) {\n      // noinspection SuspiciousTypeOfGuard\n      if (typeof value !== \"string\") {\n        throw newError(`Channel must be a string, but got: ${value}`, \"ERR_UPDATER_INVALID_CHANNEL\")\n      } else if (value.length === 0) {\n        throw newError(`Channel must be not an empty string`, \"ERR_UPDATER_INVALID_CHANNEL\")\n      }\n    }\n\n    this._channel = value\n    this.allowDowngrade = true\n  }\n\n  /**\n   *  The request headers.\n   */\n  requestHeaders: OutgoingHttpHeaders | null = null\n\n  /**\n   *  Shortcut for explicitly adding auth tokens to request headers\n   */\n  addAuthHeader(token: string) {\n    this.requestHeaders = Object.assign({}, this.requestHeaders, {\n      authorization: token,\n    })\n  }\n\n  protected _logger: Logger = console\n\n  // noinspection JSMethodCanBeStatic,JSUnusedGlobalSymbols\n  get netSession(): Session {\n    return getNetSession()\n  }\n\n  /**\n   * The logger. You can pass [electron-log](https://github.com/megahertz/electron-log), [winston](https://github.com/winstonjs/winston) or another logger with the following interface: `{ info(), warn(), error() }`.\n   * Set it to `null` if you would like to disable a logging feature.\n   */\n  get logger(): Logger | null {\n    return this._logger\n  }\n\n  set logger(value: Logger | null) {\n    this._logger = value == null ? new NoOpLogger() : value\n  }\n\n  // noinspection JSUnusedGlobalSymbols\n  /**\n   * For type safety you can use signals, e.g. `autoUpdater.signals.updateDownloaded(() => {})` instead of `autoUpdater.on('update-available', () => {})`\n   */\n  readonly signals = new UpdaterSignal(this)\n\n  private _appUpdateConfigPath: string | null = null\n\n  // noinspection JSUnusedGlobalSymbols\n  /**\n   * test only\n   * @private\n   */\n  set updateConfigPath(value: string | null) {\n    this.clientPromise = null\n    this._appUpdateConfigPath = value\n    this.configOnDisk = new Lazy<any>(() => this.loadUpdateConfig())\n  }\n\n  protected _isUpdateSupported: VerifyUpdateSupport = updateInfo => this.checkIfUpdateSupported(updateInfo)\n\n  /**\n   * Allows developer to override default logic for determining if an update is supported.\n   * The default logic compares the `UpdateInfo` minimum system version against the `os.release()` with `semver` package\n   */\n  get isUpdateSupported(): VerifyUpdateSupport {\n    return this._isUpdateSupported\n  }\n\n  set isUpdateSupported(value: VerifyUpdateSupport) {\n    if (value) {\n      this._isUpdateSupported = value\n    }\n  }\n\n  protected _isUserWithinRollout: VerifyUpdateSupport = updateInfo => this.isStagingMatch(updateInfo)\n\n  /**\n   * Allows developer to override default logic for determining if the user is below the rollout threshold.\n   * The default logic compares the staging percentage with numerical representation of user ID.\n   * An override can define custom logic, or bypass it if needed.\n   */\n  get isUserWithinRollout(): VerifyUpdateSupport {\n    return this._isUserWithinRollout\n  }\n\n  set isUserWithinRollout(value: VerifyUpdateSupport) {\n    if (value) {\n      this._isUserWithinRollout = value\n    }\n  }\n\n  private clientPromise: Promise<Provider<any>> | null = null\n\n  protected readonly stagingUserIdPromise = new Lazy<string>(() => this.getOrCreateStagingUserId())\n\n  // public, allow to read old config for anyone\n  /** @internal */\n  configOnDisk = new Lazy<any>(() => this.loadUpdateConfig())\n\n  private checkForUpdatesPromise: Promise<UpdateCheckResult> | null = null\n  private downloadPromise: Promise<Array<string>> | null = null\n\n  protected readonly app: AppAdapter\n\n  protected updateInfoAndProvider: UpdateInfoAndProvider | null = null\n\n  /** @internal */\n  readonly httpExecutor: ElectronHttpExecutor\n\n  protected constructor(options: AllPublishOptions | null | undefined, app?: AppAdapter) {\n    super()\n\n    this.on(\"error\", (error: Error) => {\n      this._logger.error(`Error: ${error.stack || error.message}`)\n    })\n\n    if (app == null) {\n      this.app = new ElectronAppAdapter()\n      this.httpExecutor = new ElectronHttpExecutor((authInfo, callback) => this.emit(\"login\", authInfo, callback))\n    } else {\n      this.app = app\n      this.httpExecutor = null as any\n    }\n\n    const currentVersionString = this.app.version\n    const currentVersion = parseVersion(currentVersionString)\n    if (currentVersion == null) {\n      throw newError(`App version is not a valid semver version: \"${currentVersionString}\"`, \"ERR_UPDATER_INVALID_VERSION\")\n    }\n    this.currentVersion = currentVersion\n    this.allowPrerelease = hasPrereleaseComponents(currentVersion)\n\n    if (options != null) {\n      this.setFeedURL(options)\n\n      if (typeof options !== \"string\" && options.requestHeaders) {\n        this.requestHeaders = options.requestHeaders\n      }\n    }\n  }\n\n  //noinspection JSMethodCanBeStatic,JSUnusedGlobalSymbols\n  getFeedURL(): string | null | undefined {\n    return \"Deprecated. Do not use it.\"\n  }\n\n  /**\n   * Configure update provider. If value is `string`, [GenericServerOptions](https://www.electron.build/publish#genericserveroptions) will be set with value as `url`.\n   * @param options If you want to override configuration in the `app-update.yml`.\n   */\n  setFeedURL(options: PublishConfiguration | AllPublishOptions | string) {\n    const runtimeOptions = this.createProviderRuntimeOptions()\n    // https://github.com/electron-userland/electron-builder/issues/1105\n    let provider: Provider<any>\n    if (typeof options === \"string\") {\n      provider = new GenericProvider({ provider: \"generic\", url: options }, this, {\n        ...runtimeOptions,\n        isUseMultipleRangeRequest: isUrlProbablySupportMultiRangeRequests(options),\n      })\n    } else {\n      provider = createClient(options, this, runtimeOptions)\n    }\n    this.clientPromise = Promise.resolve(provider)\n  }\n\n  /**\n   * Asks the server whether there is an update.\n   * @returns null if the updater is disabled, otherwise info about the latest version\n   */\n  checkForUpdates(): Promise<UpdateCheckResult | null> {\n    if (!this.isUpdaterActive()) {\n      return Promise.resolve(null)\n    }\n\n    let checkForUpdatesPromise = this.checkForUpdatesPromise\n    if (checkForUpdatesPromise != null) {\n      this._logger.info(\"Checking for update (already in progress)\")\n      return checkForUpdatesPromise\n    }\n\n    const nullizePromise = () => (this.checkForUpdatesPromise = null)\n\n    this._logger.info(\"Checking for update\")\n    checkForUpdatesPromise = this.doCheckForUpdates()\n      .then(it => {\n        nullizePromise()\n        return it\n      })\n      .catch((e: any) => {\n        nullizePromise()\n        this.emit(\"error\", e, `Cannot check for updates: ${(e.stack || e).toString()}`)\n        throw e\n      })\n\n    this.checkForUpdatesPromise = checkForUpdatesPromise\n    return checkForUpdatesPromise\n  }\n\n  public isUpdaterActive(): boolean {\n    const isEnabled = this.app.isPackaged || this.forceDevUpdateConfig\n    if (!isEnabled) {\n      this._logger.info(\"Skip checkForUpdates because application is not packed and dev update config is not forced\")\n      return false\n    }\n    return true\n  }\n\n  // noinspection JSUnusedGlobalSymbols\n  checkForUpdatesAndNotify(downloadNotification?: DownloadNotification): Promise<UpdateCheckResult | null> {\n    return this.checkForUpdates().then(it => {\n      if (!it?.downloadPromise) {\n        if (this._logger.debug != null) {\n          this._logger.debug(\"checkForUpdatesAndNotify called, downloadPromise is null\")\n        }\n        return it\n      }\n\n      void it.downloadPromise.then(() => {\n        const notificationContent = AppUpdater.formatDownloadNotification(it.updateInfo.version, this.app.name, downloadNotification)\n        new (require(\"electron\").Notification)(notificationContent).show()\n      })\n\n      return it\n    })\n  }\n\n  private static formatDownloadNotification(version: string, appName: string, downloadNotification?: DownloadNotification): DownloadNotification {\n    if (downloadNotification == null) {\n      downloadNotification = {\n        title: \"A new update is ready to install\",\n        body: `{appName} version {version} has been downloaded and will be automatically installed on exit`,\n      }\n    }\n    downloadNotification = {\n      title: downloadNotification.title.replace(\"{appName}\", appName).replace(\"{version}\", version),\n      body: downloadNotification.body.replace(\"{appName}\", appName).replace(\"{version}\", version),\n    }\n    return downloadNotification\n  }\n\n  private async isStagingMatch(updateInfo: UpdateInfo): Promise<boolean> {\n    const rawStagingPercentage = updateInfo.stagingPercentage\n    let stagingPercentage = rawStagingPercentage\n    if (stagingPercentage == null) {\n      return true\n    }\n\n    stagingPercentage = parseInt(stagingPercentage as any, 10)\n    if (isNaN(stagingPercentage)) {\n      this._logger.warn(`Staging percentage is NaN: ${rawStagingPercentage}`)\n      return true\n    }\n\n    // convert from user 0-100 to internal 0-1\n    stagingPercentage = stagingPercentage / 100\n\n    const stagingUserId = await this.stagingUserIdPromise.value\n    const val = UUID.parse(stagingUserId).readUInt32BE(12)\n    const percentage = val / 0xffffffff\n    this._logger.info(`Staging percentage: ${stagingPercentage}, percentage: ${percentage}, user id: ${stagingUserId}`)\n    return percentage < stagingPercentage\n  }\n\n  private computeFinalHeaders(headers: OutgoingHttpHeaders) {\n    if (this.requestHeaders != null) {\n      Object.assign(headers, this.requestHeaders)\n    }\n    return headers\n  }\n\n  private async isUpdateAvailable(updateInfo: UpdateInfo): Promise<boolean> {\n    const latestVersion = parseVersion(updateInfo.version)\n    if (latestVersion == null) {\n      throw newError(\n        `This file could not be downloaded, or the latest version (from update server) does not have a valid semver version: \"${updateInfo.version}\"`,\n        \"ERR_UPDATER_INVALID_VERSION\"\n      )\n    }\n\n    const currentVersion = this.currentVersion\n    if (isVersionsEqual(latestVersion, currentVersion)) {\n      return false\n    }\n\n    if (!(await Promise.resolve(this.isUpdateSupported(updateInfo)))) {\n      return false\n    }\n\n    const isUserWithinRollout = await Promise.resolve(this.isUserWithinRollout(updateInfo))\n    if (!isUserWithinRollout) {\n      return false\n    }\n\n    // https://github.com/electron-userland/electron-builder/pull/3111#issuecomment-405033227\n    // https://github.com/electron-userland/electron-builder/pull/3111#issuecomment-405030797\n    const isLatestVersionNewer = isVersionGreaterThan(latestVersion, currentVersion)\n    const isLatestVersionOlder = isVersionLessThan(latestVersion, currentVersion)\n\n    if (isLatestVersionNewer) {\n      return true\n    }\n    return this.allowDowngrade && isLatestVersionOlder\n  }\n\n  private checkIfUpdateSupported(updateInfo: UpdateInfo) {\n    const minimumSystemVersion = updateInfo?.minimumSystemVersion\n    const currentOSVersion = release()\n    if (minimumSystemVersion) {\n      try {\n        if (isVersionLessThan(currentOSVersion, minimumSystemVersion)) {\n          this._logger.info(`Current OS version ${currentOSVersion} is less than the minimum OS version required ${minimumSystemVersion} for version ${currentOSVersion}`)\n          return false\n        }\n      } catch (e: any) {\n        this._logger.warn(`Failed to compare current OS version(${currentOSVersion}) with minimum OS version(${minimumSystemVersion}): ${(e.message || e).toString()}`)\n      }\n    }\n    return true\n  }\n\n  protected async getUpdateInfoAndProvider(): Promise<UpdateInfoAndProvider> {\n    await this.app.whenReady()\n\n    if (this.clientPromise == null) {\n      this.clientPromise = this.configOnDisk.value.then(it => createClient(it, this, this.createProviderRuntimeOptions()))\n    }\n\n    const client = await this.clientPromise\n    const stagingUserId = await this.stagingUserIdPromise.value\n    client.setRequestHeaders(this.computeFinalHeaders({ \"x-user-staging-id\": stagingUserId }))\n    return {\n      info: await client.getLatestVersion(),\n      provider: client,\n    }\n  }\n\n  private createProviderRuntimeOptions() {\n    return {\n      isUseMultipleRangeRequest: true,\n      platform: this._testOnlyOptions == null ? (process.platform as ProviderPlatform) : this._testOnlyOptions.platform,\n      executor: this.httpExecutor,\n    }\n  }\n\n  private async doCheckForUpdates(): Promise<UpdateCheckResult> {\n    this.emit(\"checking-for-update\")\n\n    const result = await this.getUpdateInfoAndProvider()\n    const updateInfo = result.info\n    if (!(await this.isUpdateAvailable(updateInfo))) {\n      this._logger.info(\n        `Update for version ${this.currentVersion.format()} is not available (latest version: ${updateInfo.version}, downgrade is ${\n          this.allowDowngrade ? \"allowed\" : \"disallowed\"\n        }).`\n      )\n      this.emit(\"update-not-available\", updateInfo)\n      return {\n        isUpdateAvailable: false,\n        versionInfo: updateInfo,\n        updateInfo,\n      }\n    }\n\n    this.updateInfoAndProvider = result\n    this.onUpdateAvailable(updateInfo)\n\n    const cancellationToken = new CancellationToken()\n    //noinspection ES6MissingAwait\n    return {\n      isUpdateAvailable: true,\n      versionInfo: updateInfo,\n      updateInfo,\n      cancellationToken,\n      downloadPromise: this.autoDownload ? this.downloadUpdate(cancellationToken) : null,\n    }\n  }\n\n  protected onUpdateAvailable(updateInfo: UpdateInfo): void {\n    this._logger.info(\n      `Found version ${updateInfo.version} (url: ${asArray(updateInfo.files)\n        .map(it => it.url)\n        .join(\", \")})`\n    )\n    this.emit(\"update-available\", updateInfo)\n  }\n\n  /**\n   * Start downloading update manually. You can use this method if `autoDownload` option is set to `false`.\n   * @returns {Promise<Array<string>>} Paths to downloaded files.\n   */\n  downloadUpdate(cancellationToken: CancellationToken = new CancellationToken()): Promise<Array<string>> {\n    const updateInfoAndProvider = this.updateInfoAndProvider\n    if (updateInfoAndProvider == null) {\n      const error = new Error(\"Please check update first\")\n      this.dispatchError(error)\n      return Promise.reject(error)\n    }\n\n    if (this.downloadPromise != null) {\n      this._logger.info(\"Downloading update (already in progress)\")\n      return this.downloadPromise\n    }\n\n    this._logger.info(\n      `Downloading update from ${asArray(updateInfoAndProvider.info.files)\n        .map(it => it.url)\n        .join(\", \")}`\n    )\n    const errorHandler = (e: Error): Error => {\n      // https://github.com/electron-userland/electron-builder/issues/1150#issuecomment-436891159\n      if (!(e instanceof CancellationError)) {\n        try {\n          this.dispatchError(e)\n        } catch (nestedError: any) {\n          this._logger.warn(`Cannot dispatch error event: ${nestedError.stack || nestedError}`)\n        }\n      }\n\n      return e\n    }\n\n    this.downloadPromise = this.doDownloadUpdate({\n      updateInfoAndProvider,\n      requestHeaders: this.computeRequestHeaders(updateInfoAndProvider.provider),\n      cancellationToken,\n      disableWebInstaller: this.disableWebInstaller,\n      disableDifferentialDownload: this.disableDifferentialDownload,\n    })\n      .catch((e: any) => {\n        throw errorHandler(e)\n      })\n      .finally(() => {\n        this.downloadPromise = null\n      })\n\n    return this.downloadPromise\n  }\n\n  protected dispatchError(e: Error): void {\n    this.emit(\"error\", e, (e.stack || e).toString())\n  }\n\n  protected dispatchUpdateDownloaded(event: UpdateDownloadedEvent): void {\n    this.emit(UPDATE_DOWNLOADED, event)\n  }\n\n  protected abstract doDownloadUpdate(downloadUpdateOptions: DownloadUpdateOptions): Promise<Array<string>>\n\n  /**\n   * Restarts the app and installs the update after it has been downloaded.\n   * It should only be called after `update-downloaded` has been emitted.\n   *\n   * **Note:** `autoUpdater.quitAndInstall()` will close all application windows first and only emit `before-quit` event on `app` after that.\n   * This is different from the normal quit event sequence.\n   *\n   * @param isSilent *windows-only* Runs the installer in silent mode. Defaults to `false`.\n   * @param isForceRunAfter Run the app after finish even on silent install. Not applicable for macOS.\n   * Ignored if `isSilent` is set to `false`(In this case you can still set `autoRunAppAfterInstall` to `false` to prevent run the app after finish).\n   */\n  abstract quitAndInstall(isSilent?: boolean, isForceRunAfter?: boolean): void\n\n  private async loadUpdateConfig(): Promise<any> {\n    if (this._appUpdateConfigPath == null) {\n      this._appUpdateConfigPath = this.app.appUpdateConfigPath\n    }\n    return load(await readFile(this._appUpdateConfigPath, \"utf-8\"))\n  }\n\n  private computeRequestHeaders(provider: Provider<any>): OutgoingHttpHeaders {\n    const fileExtraDownloadHeaders = provider.fileExtraDownloadHeaders\n    if (fileExtraDownloadHeaders != null) {\n      const requestHeaders = this.requestHeaders\n      return requestHeaders == null\n        ? fileExtraDownloadHeaders\n        : {\n            ...fileExtraDownloadHeaders,\n            ...requestHeaders,\n          }\n    }\n    return this.computeFinalHeaders({ accept: \"*/*\" })\n  }\n\n  private async getOrCreateStagingUserId(): Promise<string> {\n    const file = path.join(this.app.userDataPath, \".updaterId\")\n    try {\n      const id = await readFile(file, \"utf-8\")\n      if (UUID.check(id)) {\n        return id\n      } else {\n        this._logger.warn(`Staging user id file exists, but content was invalid: ${id}`)\n      }\n    } catch (e: any) {\n      if (e.code !== \"ENOENT\") {\n        this._logger.warn(`Couldn't read staging user ID, creating a blank one: ${e}`)\n      }\n    }\n\n    const id = UUID.v5(randomBytes(4096), UUID.OID)\n    this._logger.info(`Generated new staging user ID: ${id}`)\n    try {\n      await outputFile(file, id)\n    } catch (e: any) {\n      this._logger.warn(`Couldn't write out staging user ID: ${e}`)\n    }\n    return id\n  }\n\n  /** @internal */\n  get isAddNoCacheQuery(): boolean {\n    const headers = this.requestHeaders\n    // https://github.com/electron-userland/electron-builder/issues/3021\n    if (headers == null) {\n      return true\n    }\n\n    for (const headerName of Object.keys(headers)) {\n      const s = headerName.toLowerCase()\n      if (s === \"authorization\" || s === \"private-token\") {\n        return false\n      }\n    }\n    return true\n  }\n\n  /**\n   * @private\n   * @internal\n   */\n  _testOnlyOptions: TestOnlyUpdaterOptions | null = null\n\n  private async getOrCreateDownloadHelper(): Promise<DownloadedUpdateHelper> {\n    let result = this.downloadedUpdateHelper\n    if (result == null) {\n      const dirName = (await this.configOnDisk.value).updaterCacheDirName\n      const logger = this._logger\n      if (dirName == null) {\n        logger.error(\"updaterCacheDirName is not specified in app-update.yml Was app build using at least electron-builder 20.34.0?\")\n      }\n      const cacheDir = path.join(this.app.baseCachePath, dirName || this.app.name)\n      if (logger.debug != null) {\n        logger.debug(`updater cache dir: ${cacheDir}`)\n      }\n\n      result = new DownloadedUpdateHelper(cacheDir)\n      this.downloadedUpdateHelper = result\n    }\n    return result\n  }\n\n  protected async executeDownload(taskOptions: DownloadExecutorTask): Promise<Array<string>> {\n    const fileInfo = taskOptions.fileInfo\n    const downloadOptions: DownloadOptions = {\n      headers: taskOptions.downloadUpdateOptions.requestHeaders,\n      cancellationToken: taskOptions.downloadUpdateOptions.cancellationToken,\n      sha2: (fileInfo.info as any).sha2,\n      sha512: fileInfo.info.sha512,\n    }\n\n    if (this.listenerCount(DOWNLOAD_PROGRESS) > 0) {\n      downloadOptions.onProgress = it => this.emit(DOWNLOAD_PROGRESS, it)\n    }\n\n    const updateInfo = taskOptions.downloadUpdateOptions.updateInfoAndProvider.info\n    const version = updateInfo.version\n    const packageInfo = fileInfo.packageInfo\n\n    function getCacheUpdateFileName(): string {\n      // NodeJS URL doesn't decode automatically\n      const urlPath = decodeURIComponent(taskOptions.fileInfo.url.pathname)\n      if (urlPath.toLowerCase().endsWith(`.${taskOptions.fileExtension.toLowerCase()}`)) {\n        return path.basename(urlPath)\n      } else {\n        // url like /latest â€” use basename so a server-supplied path like \"../../etc/evil\"\n        // cannot escape the cache directory via path.join\n        return path.basename(taskOptions.fileInfo.info.url)\n      }\n    }\n\n    const downloadedUpdateHelper = await this.getOrCreateDownloadHelper()\n    const cacheDir = downloadedUpdateHelper.cacheDirForPendingUpdate\n    await mkdir(cacheDir, { recursive: true })\n    const updateFileName = getCacheUpdateFileName()\n    let updateFile = path.join(cacheDir, updateFileName)\n    const packageFile = packageInfo == null ? null : path.join(cacheDir, `package-${version}${path.extname(packageInfo.path) || \".7z\"}`)\n\n    const done = async (isSaveCache: boolean) => {\n      await downloadedUpdateHelper.setDownloadedFile(updateFile, packageFile, updateInfo, fileInfo, updateFileName, isSaveCache)\n      await taskOptions.done!({\n        ...updateInfo,\n        downloadedFile: updateFile,\n      })\n      const currentBlockMapFile = path.join(cacheDir, \"current.blockmap\")\n      if (await pathExists(currentBlockMapFile)) {\n        await copyFile(currentBlockMapFile, path.join(downloadedUpdateHelper.cacheDir, \"current.blockmap\"))\n      }\n      return packageFile == null ? [updateFile] : [updateFile, packageFile]\n    }\n\n    const log = this._logger\n    const cachedUpdateFile = await downloadedUpdateHelper.validateDownloadedPath(updateFile, updateInfo, fileInfo, log)\n    if (cachedUpdateFile != null) {\n      updateFile = cachedUpdateFile\n      return await done(false)\n    }\n\n    const removeFileIfAny = async () => {\n      await downloadedUpdateHelper.clear().catch(() => {\n        // ignore\n      })\n      return await unlink(updateFile).catch(() => {\n        // ignore\n      })\n    }\n\n    const tempUpdateFile = await createTempUpdateFile(`temp-${updateFileName}`, cacheDir, log)\n    try {\n      await taskOptions.task(tempUpdateFile, downloadOptions, packageFile, removeFileIfAny)\n      await retry(() => rename(tempUpdateFile, updateFile), {\n        retries: 60,\n        interval: 500,\n        shouldRetry: (error: Error) => {\n          if (error instanceof Error && /^EBUSY:/.test(error.message)) {\n            return true\n          }\n          log.warn(`Cannot rename temp file to final file: ${error.message || error.stack}`)\n          return false\n        },\n      })\n    } catch (e: any) {\n      await removeFileIfAny()\n\n      if (e instanceof CancellationError) {\n        log.info(\"cancelled\")\n        this.emit(\"update-cancelled\", updateInfo)\n      }\n      throw e\n    }\n\n    log.info(`New version ${version} has been downloaded to ${updateFile}`)\n    return await done(true)\n  }\n  protected async differentialDownloadInstaller(\n    fileInfo: ResolvedUpdateFileInfo,\n    downloadUpdateOptions: DownloadUpdateOptions,\n    installerPath: string,\n    provider: Provider<any>,\n    oldInstallerFileName: string\n  ): Promise<boolean> {\n    try {\n      if (this._testOnlyOptions != null && !this._testOnlyOptions.isUseDifferentialDownload) {\n        return true\n      }\n      const provider = downloadUpdateOptions.updateInfoAndProvider.provider\n      const blockmapFileUrls = await provider.getBlockMapFiles(\n        fileInfo.url,\n        this.app.version,\n        downloadUpdateOptions.updateInfoAndProvider.info.version,\n        this.previousBlockmapBaseUrlOverride\n      )\n      this._logger.info(`Download block maps (old: \"${blockmapFileUrls[0]}\", new: ${blockmapFileUrls[1]})`)\n\n      const downloadBlockMap = async (url: URL): Promise<BlockMap> => {\n        const data = await this.httpExecutor.downloadToBuffer(url, {\n          headers: downloadUpdateOptions.requestHeaders,\n          cancellationToken: downloadUpdateOptions.cancellationToken,\n        })\n\n        if (data == null || data.length === 0) {\n          throw new Error(`Blockmap \"${url.href}\" is empty`)\n        }\n\n        try {\n          return JSON.parse(gunzipSync(data).toString())\n        } catch (e: any) {\n          throw new Error(`Cannot parse blockmap \"${url.href}\", error: ${e}`)\n        }\n      }\n\n      const downloadOptions: DifferentialDownloaderOptions = {\n        newUrl: fileInfo.url,\n        oldFile: path.join(this.downloadedUpdateHelper!.cacheDir, oldInstallerFileName),\n        logger: this._logger,\n        newFile: installerPath,\n        isUseMultipleRangeRequest: provider.isUseMultipleRangeRequest,\n        requestHeaders: downloadUpdateOptions.requestHeaders,\n        cancellationToken: downloadUpdateOptions.cancellationToken,\n      }\n\n      if (this.listenerCount(DOWNLOAD_PROGRESS) > 0) {\n        downloadOptions.onProgress = it => this.emit(DOWNLOAD_PROGRESS, it)\n      }\n\n      const saveBlockMapToCacheDir = async (blockMapData: BlockMap, cacheDir: string) => {\n        const blockMapFile = path.join(cacheDir, \"current.blockmap\")\n        await outputFile(blockMapFile, gzipSync(JSON.stringify(blockMapData)))\n      }\n\n      const getBlockMapFromCacheDir = async (cacheDir: string) => {\n        const blockMapFile = path.join(cacheDir, \"current.blockmap\")\n        try {\n          if (await pathExists(blockMapFile)) {\n            return JSON.parse(gunzipSync(await readFile(blockMapFile)).toString())\n          }\n        } catch (e: any) {\n          this._logger.warn(`Cannot parse blockmap \"${blockMapFile}\", error: ${e}`)\n        }\n        return null\n      }\n\n      const newBlockMapData = await downloadBlockMap(blockmapFileUrls[1])\n      await saveBlockMapToCacheDir(newBlockMapData, this.downloadedUpdateHelper!.cacheDirForPendingUpdate)\n\n      // get old blockmap from cache dir first, if not found, download it\n      let oldBlockMapData = await getBlockMapFromCacheDir(this.downloadedUpdateHelper!.cacheDir)\n      if (oldBlockMapData == null) {\n        oldBlockMapData = await downloadBlockMap(blockmapFileUrls[0])\n      }\n\n      await new GenericDifferentialDownloader(fileInfo.info, this.httpExecutor, downloadOptions).download(oldBlockMapData, newBlockMapData)\n      return false\n    } catch (e: any) {\n      this._logger.error(`Cannot download differentially, fallback to full download: ${e.stack || e}`)\n      if (this._testOnlyOptions != null) {\n        // test mode\n        throw e\n      }\n      return true\n    }\n  }\n}\n\nexport interface DownloadUpdateOptions {\n  readonly updateInfoAndProvider: UpdateInfoAndProvider\n  readonly requestHeaders: OutgoingHttpHeaders\n  readonly cancellationToken: CancellationToken\n  readonly disableWebInstaller?: boolean\n  readonly disableDifferentialDownload?: boolean\n}\n\nfunction hasPrereleaseComponents(version: SemVer) {\n  const versionPrereleaseComponent = getVersionPreleaseComponents(version)\n  return versionPrereleaseComponent != null && versionPrereleaseComponent.length > 0\n}\n\n/** @private */\nexport class NoOpLogger implements Logger {\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\n  info(message?: any) {\n    // ignore\n  }\n\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\n  warn(message?: any) {\n    // ignore\n  }\n\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\n  error(message?: any) {\n    // ignore\n  }\n}\n\nexport interface UpdateInfoAndProvider {\n  info: UpdateInfo\n  provider: Provider<any>\n}\n\nexport interface DownloadExecutorTask {\n  readonly fileExtension: string\n  readonly fileInfo: ResolvedUpdateFileInfo\n  readonly downloadUpdateOptions: DownloadUpdateOptions\n  readonly task: (destinationFile: string, downloadOptions: DownloadOptions, packageFile: string | null, removeTempDirIfAny: () => Promise<any>) => Promise<any>\n\n  readonly done?: (event: UpdateDownloadedEvent) => Promise<any>\n}\n\nexport interface DownloadNotification {\n  body: string\n  title: string\n}\n\n/** @private */\nexport interface TestOnlyUpdaterOptions {\n  platform: ProviderPlatform\n\n  isUseDifferentialDownload?: boolean\n}\n"]}"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.BaseUpdater = void 0;
const child_process_1 = require("child_process");
const path = require("path");
const AppUpdater_1 = require("./AppUpdater");
class BaseUpdater extends AppUpdater_1.AppUpdater {
    constructor(options, app) {
        super(options, app);
        this.quitAndInstallCalled = false;
        this.quitHandlerAdded = false;
    }
    quitAndInstall(isSilent = false, isForceRunAfter = false) {
        this._logger.info(`Install on explicit quitAndInstall`);
        // If NOT in silent mode use `autoRunAppAfterInstall` to determine whether to force run the app
        const isInstalled = this.install(isSilent, isSilent ? isForceRunAfter : this.autoRunAppAfterInstall);
        if (isInstalled) {
            setImmediate(() => {
                // this event is normally emitted when calling quitAndInstall, this emulates that
                require("electron").autoUpdater.emit("before-quit-for-update");
                this.app.quit();
            });
        }
        else {
            this.quitAndInstallCalled = false;
        }
    }
    executeDownload(taskOptions) {
        return super.executeDownload({
            ...taskOptions,
            done: event => {
                this.dispatchUpdateDownloaded(event);
                this.addQuitHandler();
                return Promise.resolve();
            },
        });
    }
    get installerPath() {
        return this.downloadedUpdateHelper == null ? null : this.downloadedUpdateHelper.file;
    }
    // must be sync (because quit even handler is not async)
    install(isSilent = false, isForceRunAfter = false) {
        if (this.quitAndInstallCalled) {
            this._logger.warn("install call ignored: quitAndInstallCalled is set to true");
            return false;
        }
        const downloadedUpdateHelper = this.downloadedUpdateHelper;
        const installerPath = this.installerPath;
        const downloadedFileInfo = downloadedUpdateHelper == null ? null : downloadedUpdateHelper.downloadedFileInfo;
        if (installerPath == null || downloadedFileInfo == null) {
            this.dispatchError(new Error("No update filepath provided, can't quit and install"));
            return false;
        }
        // prevent calling several times
        this.quitAndInstallCalled = true;
        try {
            this._logger.info(`Install: isSilent: ${isSilent}, isForceRunAfter: ${isForceRunAfter}`);
            return this.doInstall({
                isSilent,
                isForceRunAfter,
                isAdminRightsRequired: downloadedFileInfo.isAdminRightsRequired,
            });
        }
        catch (e) {
            this.dispatchError(e);
            return false;
        }
    }
    addQuitHandler() {
        if (this.quitHandlerAdded || !this.autoInstallOnAppQuit) {
            return;
        }
        this.quitHandlerAdded = true;
        this.app.onQuit(exitCode => {
            if (this.quitAndInstallCalled) {
                this._logger.info("Update installer has already been triggered. Quitting application.");
                return;
            }
            if (!this.autoInstallOnAppQuit) {
                this._logger.info("Update will not be installed on quit because autoInstallOnAppQuit is set to false.");
                return;
            }
            if (exitCode !== 0) {
                this._logger.info(`Update will be not installed on quit because application is quitting with exit code ${exitCode}`);
                return;
            }
            this._logger.info("Auto install update on quit");
            this.install(true, false);
        });
    }
    /**
     * Strips relative-path entries from a PATH string.
     * Prevents PATH-poisoning where a writable directory earlier in PATH shadows
     * a trusted package manager binary.
     */
    sanitizeEnvPath(envPath) {
        return envPath
            .split(path.delimiter)
            .filter((dir) => path.isAbsolute(dir))
            .join(path.delimiter);
    }
    spawnSyncLog(cmd, args = [], env = {}) {
        var _a;
        this._logger.info(`Executing: ${cmd} with args: ${args}`);
        const mergedEnv = { ...process.env, ...env };
        const response = (0, child_process_1.spawnSync)(cmd, args, {
            env: { ...mergedEnv, PATH: this.sanitizeEnvPath((_a = mergedEnv.PATH) !== null && _a !== void 0 ? _a : "") },
            encoding: "utf-8",
            shell: true,
        });
        const { error, status, stdout, stderr } = response;
        if (error != null) {
            this._logger.error(stderr);
            throw error;
        }
        else if (status != null && status !== 0) {
            this._logger.error(stderr);
            throw new Error(`Command ${cmd} exited with code ${status}`);
        }
        return stdout.trim();
    }
    /**
     * This handles both node 8 and node 10 way of emitting error when spawning a process
     *   - node 8: Throws the error
     *   - node 10: Emit the error(Need to listen with on)
     */
    // https://github.com/electron-userland/electron-builder/issues/1129
    // Node 8 sends errors: https://nodejs.org/dist/latest-v8.x/docs/api/errors.html#errors_common_system_errors
    async spawnLog(cmd, args = [], env = undefined, stdio = "ignore") {
        this._logger.info(`Executing: ${cmd} with args: ${args}`);
        return new Promise((resolve, reject) => {
            try {
                const params = { stdio, env, detached: true };
                const p = (0, child_process_1.spawn)(cmd, args, params);
                p.on("error", error => {
                    reject(error);
                });
                p.unref();
                if (p.pid !== undefined) {
                    resolve(true);
                }
            }
            catch (error) {
                reject(error);
            }
        });
    }
}
exports.BaseUpdater = BaseUpdater;
//# sourceMappingURL=BaseUpdater.js.map{"version":3,"file":"BaseUpdater.js","sourceRoot":"","sources":["../src/BaseUpdater.ts"],"names":[],"mappings":";;;AACA,iDAA4E;AAC5E,6BAA4B;AAE5B,6CAA+D;AAE/D,MAAsB,WAAY,SAAQ,uBAAU;IAIlD,YAAsB,OAAkC,EAAE,GAAgB;QACxE,KAAK,CAAC,OAAO,EAAE,GAAG,CAAC,CAAA;QAJX,yBAAoB,GAAG,KAAK,CAAA;QAC9B,qBAAgB,GAAG,KAAK,CAAA;IAIhC,CAAC;IAED,cAAc,CAAC,QAAQ,GAAG,KAAK,EAAE,eAAe,GAAG,KAAK;QACtD,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,oCAAoC,CAAC,CAAA;QACvD,+FAA+F;QAC/F,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAA;QACpG,IAAI,WAAW,EAAE,CAAC;YAChB,YAAY,CAAC,GAAG,EAAE;gBAChB,iFAAiF;gBACjF,OAAO,CAAC,UAAU,CAAC,CAAC,WAAW,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAA;gBAC9D,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,CAAA;YACjB,CAAC,CAAC,CAAA;QACJ,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,oBAAoB,GAAG,KAAK,CAAA;QACnC,CAAC;IACH,CAAC;IAES,eAAe,CAAC,WAAiC;QACzD,OAAO,KAAK,CAAC,eAAe,CAAC;YAC3B,GAAG,WAAW;YACd,IAAI,EAAE,KAAK,CAAC,EAAE;gBACZ,IAAI,CAAC,wBAAwB,CAAC,KAAK,CAAC,CAAA;gBACpC,IAAI,CAAC,cAAc,EAAE,CAAA;gBACrB,OAAO,OAAO,CAAC,OAAO,EAAE,CAAA;YAC1B,CAAC;SACF,CAAC,CAAA;IACJ,CAAC;IAED,IAAc,aAAa;QACzB,OAAO,IAAI,CAAC,sBAAsB,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAA;IACtF,CAAC;IAKD,wDAAwD;IACxD,OAAO,CAAC,QAAQ,GAAG,KAAK,EAAE,eAAe,GAAG,KAAK;QAC/C,IAAI,IAAI,CAAC,oBAAoB,EAAE,CAAC;YAC9B,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,2DAA2D,CAAC,CAAA;YAC9E,OAAO,KAAK,CAAA;QACd,CAAC;QAED,MAAM,sBAAsB,GAAG,IAAI,CAAC,sBAAsB,CAAA;QAC1D,MAAM,aAAa,GAAG,IAAI,CAAC,aAAa,CAAA;QACxC,MAAM,kBAAkB,GAAG,sBAAsB,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,sBAAsB,CAAC,kBAAkB,CAAA;QAC5G,IAAI,aAAa,IAAI,IAAI,IAAI,kBAAkB,IAAI,IAAI,EAAE,CAAC;YACxD,IAAI,CAAC,aAAa,CAAC,IAAI,KAAK,CAAC,qDAAqD,CAAC,CAAC,CAAA;YACpF,OAAO,KAAK,CAAA;QACd,CAAC;QAED,gCAAgC;QAChC,IAAI,CAAC,oBAAoB,GAAG,IAAI,CAAA;QAEhC,IAAI,CAAC;YACH,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,sBAAsB,QAAQ,sBAAsB,eAAe,EAAE,CAAC,CAAA;YACxF,OAAO,IAAI,CAAC,SAAS,CAAC;gBACpB,QAAQ;gBACR,eAAe;gBACf,qBAAqB,EAAE,kBAAkB,CAAC,qBAAqB;aAChE,CAAC,CAAA;QACJ,CAAC;QAAC,OAAO,CAAM,EAAE,CAAC;YAChB,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,CAAA;YACrB,OAAO,KAAK,CAAA;QACd,CAAC;IACH,CAAC;IAES,cAAc;QACtB,IAAI,IAAI,CAAC,gBAAgB,IAAI,CAAC,IAAI,CAAC,oBAAoB,EAAE,CAAC;YACxD,OAAM;QACR,CAAC;QAED,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAA;QAE5B,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE;YACzB,IAAI,IAAI,CAAC,oBAAoB,EAAE,CAAC;gBAC9B,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,oEAAoE,CAAC,CAAA;gBACvF,OAAM;YACR,CAAC;YAED,IAAI,CAAC,IAAI,CAAC,oBAAoB,EAAE,CAAC;gBAC/B,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,oFAAoF,CAAC,CAAA;gBACvG,OAAM;YACR,CAAC;YAED,IAAI,QAAQ,KAAK,CAAC,EAAE,CAAC;gBACnB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,uFAAuF,QAAQ,EAAE,CAAC,CAAA;gBACpH,OAAM;YACR,CAAC;YAED,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,6BAA6B,CAAC,CAAA;YAChD,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;QAC3B,CAAC,CAAC,CAAA;IACJ,CAAC;IAED;;;;OAIG;IACO,eAAe,CAAC,OAAe;QACvC,OAAO,OAAO;aACX,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC;aACrB,MAAM,CAAC,CAAC,GAAW,EAAE,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;aAC7C,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;IACzB,CAAC;IAES,YAAY,CAAC,GAAW,EAAE,OAAiB,EAAE,EAAE,GAAG,GAAG,EAAE;;QAC/D,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,GAAG,eAAe,IAAI,EAAE,CAAC,CAAA;QACzD,MAAM,SAAS,GAAsB,EAAE,GAAG,OAAO,CAAC,GAAG,EAAE,GAAG,GAAG,EAAE,CAAA;QAC/D,MAAM,QAAQ,GAAG,IAAA,yBAAS,EAAC,GAAG,EAAE,IAAI,EAAE;YACpC,GAAG,EAAE,EAAE,GAAG,SAAS,EAAE,IAAI,EAAE,IAAI,CAAC,eAAe,CAAC,MAAA,SAAS,CAAC,IAAI,mCAAI,EAAE,CAAC,EAAE;YACvE,QAAQ,EAAE,OAAO;YACjB,KAAK,EAAE,IAAI;SACZ,CAAC,CAAA;QAEF,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,QAAQ,CAAA;QAClD,IAAI,KAAK,IAAI,IAAI,EAAE,CAAC;YAClB,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA;YAC1B,MAAM,KAAK,CAAA;QACb,CAAC;aAAM,IAAI,MAAM,IAAI,IAAI,IAAI,MAAM,KAAK,CAAC,EAAE,CAAC;YAC1C,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA;YAC1B,MAAM,IAAI,KAAK,CAAC,WAAW,GAAG,qBAAqB,MAAM,EAAE,CAAC,CAAA;QAC9D,CAAC;QAED,OAAO,MAAM,CAAC,IAAI,EAAE,CAAA;IACtB,CAAC;IAED;;;;OAIG;IACH,oEAAoE;IACpE,4GAA4G;IAClG,KAAK,CAAC,QAAQ,CAAC,GAAW,EAAE,OAAiB,EAAE,EAAE,MAAW,SAAS,EAAE,QAAsB,QAAQ;QAC7G,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,GAAG,eAAe,IAAI,EAAE,CAAC,CAAA;QACzD,OAAO,IAAI,OAAO,CAAU,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YAC9C,IAAI,CAAC;gBACH,MAAM,MAAM,GAAiB,EAAE,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAA;gBAC3D,MAAM,CAAC,GAAG,IAAA,qBAAK,EAAC,GAAG,EAAE,IAAI,EAAE,MAAM,CAAC,CAAA;gBAClC,CAAC,CAAC,EAAE,CAAC,OAAO,EAAE,KAAK,CAAC,EAAE;oBACpB,MAAM,CAAC,KAAK,CAAC,CAAA;gBACf,CAAC,CAAC,CAAA;gBACF,CAAC,CAAC,KAAK,EAAE,CAAA;gBACT,IAAI,CAAC,CAAC,GAAG,KAAK,SAAS,EAAE,CAAC;oBACxB,OAAO,CAAC,IAAI,CAAC,CAAA;gBACf,CAAC;YACH,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,MAAM,CAAC,KAAK,CAAC,CAAA;YACf,CAAC;QACH,CAAC,CAAC,CAAA;IACJ,CAAC;CACF;AA9JD,kCA8JC","sourcesContent":["import { AllPublishOptions } from \"builder-util-runtime\"\nimport { spawn, SpawnOptions, spawnSync, StdioOptions } from \"child_process\"\nimport * as path from \"path\"\nimport { AppAdapter } from \"./AppAdapter\"\nimport { AppUpdater, DownloadExecutorTask } from \"./AppUpdater\"\n\nexport abstract class BaseUpdater extends AppUpdater {\n  protected quitAndInstallCalled = false\n  private quitHandlerAdded = false\n\n  protected constructor(options?: AllPublishOptions | null, app?: AppAdapter) {\n    super(options, app)\n  }\n\n  quitAndInstall(isSilent = false, isForceRunAfter = false): void {\n    this._logger.info(`Install on explicit quitAndInstall`)\n    // If NOT in silent mode use `autoRunAppAfterInstall` to determine whether to force run the app\n    const isInstalled = this.install(isSilent, isSilent ? isForceRunAfter : this.autoRunAppAfterInstall)\n    if (isInstalled) {\n      setImmediate(() => {\n        // this event is normally emitted when calling quitAndInstall, this emulates that\n        require(\"electron\").autoUpdater.emit(\"before-quit-for-update\")\n        this.app.quit()\n      })\n    } else {\n      this.quitAndInstallCalled = false\n    }\n  }\n\n  protected executeDownload(taskOptions: DownloadExecutorTask): Promise<Array<string>> {\n    return super.executeDownload({\n      ...taskOptions,\n      done: event => {\n        this.dispatchUpdateDownloaded(event)\n        this.addQuitHandler()\n        return Promise.resolve()\n      },\n    })\n  }\n\n  protected get installerPath(): string | null {\n    return this.downloadedUpdateHelper == null ? null : this.downloadedUpdateHelper.file\n  }\n\n  // must be sync\n  protected abstract doInstall(options: InstallOptions): boolean\n\n  // must be sync (because quit even handler is not async)\n  install(isSilent = false, isForceRunAfter = false): boolean {\n    if (this.quitAndInstallCalled) {\n      this._logger.warn(\"install call ignored: quitAndInstallCalled is set to true\")\n      return false\n    }\n\n    const downloadedUpdateHelper = this.downloadedUpdateHelper\n    const installerPath = this.installerPath\n    const downloadedFileInfo = downloadedUpdateHelper == null ? null : downloadedUpdateHelper.downloadedFileInfo\n    if (installerPath == null || downloadedFileInfo == null) {\n      this.dispatchError(new Error(\"No update filepath provided, can't quit and install\"))\n      return false\n    }\n\n    // prevent calling several times\n    this.quitAndInstallCalled = true\n\n    try {\n      this._logger.info(`Install: isSilent: ${isSilent}, isForceRunAfter: ${isForceRunAfter}`)\n      return this.doInstall({\n        isSilent,\n        isForceRunAfter,\n        isAdminRightsRequired: downloadedFileInfo.isAdminRightsRequired,\n      })\n    } catch (e: any) {\n      this.dispatchError(e)\n      return false\n    }\n  }\n\n  protected addQuitHandler(): void {\n    if (this.quitHandlerAdded || !this.autoInstallOnAppQuit) {\n      return\n    }\n\n    this.quitHandlerAdded = true\n\n    this.app.onQuit(exitCode => {\n      if (this.quitAndInstallCalled) {\n        this._logger.info(\"Update installer has already been triggered. Quitting application.\")\n        return\n      }\n\n      if (!this.autoInstallOnAppQuit) {\n        this._logger.info(\"Update will not be installed on quit because autoInstallOnAppQuit is set to false.\")\n        return\n      }\n\n      if (exitCode !== 0) {\n        this._logger.info(`Update will be not installed on quit because application is quitting with exit code ${exitCode}`)\n        return\n      }\n\n      this._logger.info(\"Auto install update on quit\")\n      this.install(true, false)\n    })\n  }\n\n  /**\n   * Strips relative-path entries from a PATH string.\n   * Prevents PATH-poisoning where a writable directory earlier in PATH shadows\n   * a trusted package manager binary.\n   */\n  protected sanitizeEnvPath(envPath: string): string {\n    return envPath\n      .split(path.delimiter)\n      .filter((dir: string) => path.isAbsolute(dir))\n      .join(path.delimiter)\n  }\n\n  protected spawnSyncLog(cmd: string, args: string[] = [], env = {}): string {\n    this._logger.info(`Executing: ${cmd} with args: ${args}`)\n    const mergedEnv: NodeJS.ProcessEnv = { ...process.env, ...env }\n    const response = spawnSync(cmd, args, {\n      env: { ...mergedEnv, PATH: this.sanitizeEnvPath(mergedEnv.PATH ?? \"\") },\n      encoding: \"utf-8\",\n      shell: true,\n    })\n\n    const { error, status, stdout, stderr } = response\n    if (error != null) {\n      this._logger.error(stderr)\n      throw error\n    } else if (status != null && status !== 0) {\n      this._logger.error(stderr)\n      throw new Error(`Command ${cmd} exited with code ${status}`)\n    }\n\n    return stdout.trim()\n  }\n\n  /**\n   * This handles both node 8 and node 10 way of emitting error when spawning a process\n   *   - node 8: Throws the error\n   *   - node 10: Emit the error(Need to listen with on)\n   */\n  // https://github.com/electron-userland/electron-builder/issues/1129\n  // Node 8 sends errors: https://nodejs.org/dist/latest-v8.x/docs/api/errors.html#errors_common_system_errors\n  protected async spawnLog(cmd: string, args: string[] = [], env: any = undefined, stdio: StdioOptions = \"ignore\"): Promise<boolean> {\n    this._logger.info(`Executing: ${cmd} with args: ${args}`)\n    return new Promise<boolean>((resolve, reject) => {\n      try {\n        const params: SpawnOptions = { stdio, env, detached: true }\n        const p = spawn(cmd, args, params)\n        p.on(\"error\", error => {\n          reject(error)\n        })\n        p.unref()\n        if (p.pid !== undefined) {\n          resolve(true)\n        }\n      } catch (error) {\n        reject(error)\n      }\n    })\n  }\n}\n\nexport interface InstallOptions {\n  readonly isSilent: boolean\n  readonly isForceRunAfter: boolean\n  readonly isAdminRightsRequired: boolean\n}\n"]}"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.DebUpdater = void 0;
const Provider_1 = require("./providers/Provider");
const types_1 = require("./types");
const LinuxUpdater_1 = require("./LinuxUpdater");
class DebUpdater extends LinuxUpdater_1.LinuxUpdater {
    constructor(options, app) {
        super(options, app);
    }
    /*** @private */
    doDownloadUpdate(downloadUpdateOptions) {
        const provider = downloadUpdateOptions.updateInfoAndProvider.provider;
        const fileInfo = (0, Provider_1.findFile)(provider.resolveFiles(downloadUpdateOptions.updateInfoAndProvider.info), "deb", ["AppImage", "rpm", "pacman"]);
        return this.executeDownload({
            fileExtension: "deb",
            fileInfo,
            downloadUpdateOptions,
            task: async (updateFile, downloadOptions) => {
                if (this.listenerCount(types_1.DOWNLOAD_PROGRESS) > 0) {
                    downloadOptions.onProgress = it => this.emit(types_1.DOWNLOAD_PROGRESS, it);
                }
                await this.httpExecutor.download(fileInfo.url, updateFile, downloadOptions);
            },
        });
    }
    doInstall(options) {
        const installerPath = this.installerPath;
        if (installerPath == null) {
            this.dispatchError(new Error("No update filepath provided, can't quit and install"));
            return false;
        }
        if (!this.hasCommand("dpkg") && !this.hasCommand("apt")) {
            this.dispatchError(new Error("Neither dpkg nor apt command found. Cannot install .deb package."));
            return false;
        }
        const priorityList = ["dpkg", "apt"];
        const packageManager = this.detectPackageManager(priorityList);
        try {
            DebUpdater.installWithCommandRunner(packageManager, installerPath, this.runCommandWithSudoIfNeeded.bind(this), this._logger);
        }
        catch (error) {
            this.dispatchError(error);
            return false;
        }
        if (options.isForceRunAfter) {
            this.app.relaunch();
        }
        return true;
    }
    static installWithCommandRunner(packageManager, installerPath, commandRunner, logger) {
        var _a;
        if (packageManager === "dpkg") {
            try {
                // Primary: Install unsigned .deb directly with dpkg
                commandRunner(["dpkg", "-i", installerPath]);
            }
            catch (error) {
                // Handle missing dependencies via apt-get
                logger.warn((_a = error.message) !== null && _a !== void 0 ? _a : error);
                logger.warn("dpkg installation failed, trying to fix broken dependencies with apt-get");
                commandRunner(["apt-get", "install", "-f", "-y"]);
            }
        }
        else if (packageManager === "apt") {
            // Fallback: Use apt for direct install (less safe for unsigned .deb)
            logger.warn("Using apt to install a local .deb. This may fail for unsigned packages unless properly configured.");
            commandRunner([
                "apt",
                "install",
                "-y",
                "--allow-unauthenticated", // needed for unsigned .debs
                "--allow-downgrades", // allow lower version installs
                "--allow-change-held-packages",
                installerPath,
            ]);
        }
        else {
            throw new Error(`Package manager ${packageManager} not supported`);
        }
    }
}
exports.DebUpdater = DebUpdater;
//# sourceMappingURL=DebUpdater.js.map{"version":3,"file":"DebUpdater.js","sourceRoot":"","sources":["../src/DebUpdater.ts"],"names":[],"mappings":";;;AAIA,mDAA+C;AAC/C,mCAAmD;AACnD,iDAA6C;AAE7C,MAAa,UAAW,SAAQ,2BAAY;IAC1C,YAAY,OAAkC,EAAE,GAAgB;QAC9D,KAAK,CAAC,OAAO,EAAE,GAAG,CAAC,CAAA;IACrB,CAAC;IAED,gBAAgB;IACN,gBAAgB,CAAC,qBAA4C;QACrE,MAAM,QAAQ,GAAG,qBAAqB,CAAC,qBAAqB,CAAC,QAAQ,CAAA;QACrE,MAAM,QAAQ,GAAG,IAAA,mBAAQ,EAAC,QAAQ,CAAC,YAAY,CAAC,qBAAqB,CAAC,qBAAqB,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,CAAC,UAAU,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAE,CAAA;QACzI,OAAO,IAAI,CAAC,eAAe,CAAC;YAC1B,aAAa,EAAE,KAAK;YACpB,QAAQ;YACR,qBAAqB;YACrB,IAAI,EAAE,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,EAAE;gBAC1C,IAAI,IAAI,CAAC,aAAa,CAAC,yBAAiB,CAAC,GAAG,CAAC,EAAE,CAAC;oBAC9C,eAAe,CAAC,UAAU,GAAG,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,yBAAiB,EAAE,EAAE,CAAC,CAAA;gBACrE,CAAC;gBACD,MAAM,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAAG,EAAE,UAAU,EAAE,eAAe,CAAC,CAAA;YAC7E,CAAC;SACF,CAAC,CAAA;IACJ,CAAC;IAES,SAAS,CAAC,OAAuB;QACzC,MAAM,aAAa,GAAG,IAAI,CAAC,aAAa,CAAA;QACxC,IAAI,aAAa,IAAI,IAAI,EAAE,CAAC;YAC1B,IAAI,CAAC,aAAa,CAAC,IAAI,KAAK,CAAC,qDAAqD,CAAC,CAAC,CAAA;YACpF,OAAO,KAAK,CAAA;QACd,CAAC;QACD,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC;YACxD,IAAI,CAAC,aAAa,CAAC,IAAI,KAAK,CAAC,kEAAkE,CAAC,CAAC,CAAA;YACjG,OAAO,KAAK,CAAA;QACd,CAAC;QACD,MAAM,YAAY,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,CAAA;QACpC,MAAM,cAAc,GAAG,IAAI,CAAC,oBAAoB,CAAC,YAAY,CAAC,CAAA;QAC9D,IAAI,CAAC;YACH,UAAU,CAAC,wBAAwB,CAAC,cAAqB,EAAE,aAAa,EAAE,IAAI,CAAC,0BAA0B,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,CAAA;QACrI,CAAC;QAAC,OAAO,KAAU,EAAE,CAAC;YACpB,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CAAA;YACzB,OAAO,KAAK,CAAA;QACd,CAAC;QACD,IAAI,OAAO,CAAC,eAAe,EAAE,CAAC;YAC5B,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAA;QACrB,CAAC;QACD,OAAO,IAAI,CAAA;IACb,CAAC;IAED,MAAM,CAAC,wBAAwB,CAAC,cAA8B,EAAE,aAAqB,EAAE,aAAkD,EAAE,MAAc;;QACvJ,IAAI,cAAc,KAAK,MAAM,EAAE,CAAC;YAC9B,IAAI,CAAC;gBACH,oDAAoD;gBACpD,aAAa,CAAC,CAAC,MAAM,EAAE,IAAI,EAAE,aAAa,CAAC,CAAC,CAAA;YAC9C,CAAC;YAAC,OAAO,KAAU,EAAE,CAAC;gBACpB,0CAA0C;gBAC1C,MAAM,CAAC,IAAI,CAAC,MAAA,KAAK,CAAC,OAAO,mCAAI,KAAK,CAAC,CAAA;gBACnC,MAAM,CAAC,IAAI,CAAC,0EAA0E,CAAC,CAAA;gBACvF,aAAa,CAAC,CAAC,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAA;YACnD,CAAC;QACH,CAAC;aAAM,IAAI,cAAc,KAAK,KAAK,EAAE,CAAC;YACpC,qEAAqE;YACrE,MAAM,CAAC,IAAI,CAAC,oGAAoG,CAAC,CAAA;YACjH,aAAa,CAAC;gBACZ,KAAK;gBACL,SAAS;gBACT,IAAI;gBACJ,yBAAyB,EAAE,4BAA4B;gBACvD,oBAAoB,EAAE,+BAA+B;gBACrD,8BAA8B;gBAC9B,aAAa;aACd,CAAC,CAAA;QACJ,CAAC;aAAM,CAAC;YACN,MAAM,IAAI,KAAK,CAAC,mBAAmB,cAAc,gBAAgB,CAAC,CAAA;QACpE,CAAC;IACH,CAAC;CACF;AAzED,gCAyEC","sourcesContent":["import { AllPublishOptions } from \"builder-util-runtime\"\nimport { AppAdapter } from \"./AppAdapter\"\nimport { DownloadUpdateOptions } from \"./AppUpdater\"\nimport { InstallOptions } from \"./BaseUpdater\"\nimport { findFile } from \"./providers/Provider\"\nimport { DOWNLOAD_PROGRESS, Logger } from \"./types\"\nimport { LinuxUpdater } from \"./LinuxUpdater\"\n\nexport class DebUpdater extends LinuxUpdater {\n  constructor(options?: AllPublishOptions | null, app?: AppAdapter) {\n    super(options, app)\n  }\n\n  /*** @private */\n  protected doDownloadUpdate(downloadUpdateOptions: DownloadUpdateOptions): Promise<Array<string>> {\n    const provider = downloadUpdateOptions.updateInfoAndProvider.provider\n    const fileInfo = findFile(provider.resolveFiles(downloadUpdateOptions.updateInfoAndProvider.info), \"deb\", [\"AppImage\", \"rpm\", \"pacman\"])!\n    return this.executeDownload({\n      fileExtension: \"deb\",\n      fileInfo,\n      downloadUpdateOptions,\n      task: async (updateFile, downloadOptions) => {\n        if (this.listenerCount(DOWNLOAD_PROGRESS) > 0) {\n          downloadOptions.onProgress = it => this.emit(DOWNLOAD_PROGRESS, it)\n        }\n        await this.httpExecutor.download(fileInfo.url, updateFile, downloadOptions)\n      },\n    })\n  }\n\n  protected doInstall(options: InstallOptions): boolean {\n    const installerPath = this.installerPath\n    if (installerPath == null) {\n      this.dispatchError(new Error(\"No update filepath provided, can't quit and install\"))\n      return false\n    }\n    if (!this.hasCommand(\"dpkg\") && !this.hasCommand(\"apt\")) {\n      this.dispatchError(new Error(\"Neither dpkg nor apt command found. Cannot install .deb package.\"))\n      return false\n    }\n    const priorityList = [\"dpkg\", \"apt\"]\n    const packageManager = this.detectPackageManager(priorityList)\n    try {\n      DebUpdater.installWithCommandRunner(packageManager as any, installerPath, this.runCommandWithSudoIfNeeded.bind(this), this._logger)\n    } catch (error: any) {\n      this.dispatchError(error)\n      return false\n    }\n    if (options.isForceRunAfter) {\n      this.app.relaunch()\n    }\n    return true\n  }\n\n  static installWithCommandRunner(packageManager: \"dpkg\" | \"apt\", installerPath: string, commandRunner: (commandWithArgs: string[]) => void, logger: Logger) {\n    if (packageManager === \"dpkg\") {\n      try {\n        // Primary: Install unsigned .deb directly with dpkg\n        commandRunner([\"dpkg\", \"-i\", installerPath])\n      } catch (error: any) {\n        // Handle missing dependencies via apt-get\n        logger.warn(error.message ?? error)\n        logger.warn(\"dpkg installation failed, trying to fix broken dependencies with apt-get\")\n        commandRunner([\"apt-get\", \"install\", \"-f\", \"-y\"])\n      }\n    } else if (packageManager === \"apt\") {\n      // Fallback: Use apt for direct install (less safe for unsigned .deb)\n      logger.warn(\"Using apt to install a local .deb. This may fail for unsigned packages unless properly configured.\")\n      commandRunner([\n        \"apt\",\n        \"install\",\n        \"-y\",\n        \"--allow-unauthenticated\", // needed for unsigned .debs\n        \"--allow-downgrades\", // allow lower version installs\n        \"--allow-change-held-packages\",\n        installerPath,\n      ])\n    } else {\n      throw new Error(`Package manager ${packageManager} not supported`)\n    }\n  }\n}\n"]}"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.DownloadedUpdateHelper = void 0;
exports.createTempUpdateFile = createTempUpdateFile;
const crypto_1 = require("crypto");
const fs_1 = require("fs");
// @ts-ignore
const isEqual = require("lodash.isequal");
const fs_extra_1 = require("fs-extra");
const path = require("path");
/** @private **/
class DownloadedUpdateHelper {
    constructor(cacheDir) {
        this.cacheDir = cacheDir;
        this._file = null;
        this._packageFile = null;
        this.versionInfo = null;
        this.fileInfo = null;
        this._downloadedFileInfo = null;
    }
    get downloadedFileInfo() {
        return this._downloadedFileInfo;
    }
    get file() {
        return this._file;
    }
    get packageFile() {
        return this._packageFile;
    }
    get cacheDirForPendingUpdate() {
        return path.join(this.cacheDir, "pending");
    }
    async validateDownloadedPath(updateFile, updateInfo, fileInfo, logger) {
        if (this.versionInfo != null && this.file === updateFile && this.fileInfo != null) {
            // update has already been downloaded from this running instance
            // check here only existence, not checksum
            if (isEqual(this.versionInfo, updateInfo) && isEqual(this.fileInfo.info, fileInfo.info) && (await (0, fs_extra_1.pathExists)(updateFile))) {
                return updateFile;
            }
            else {
                return null;
            }
        }
        // update has already been downloaded from some previous app launch
        const cachedUpdateFile = await this.getValidCachedUpdateFile(fileInfo, logger);
        if (cachedUpdateFile === null) {
            return null;
        }
        logger.info(`Update has already been downloaded to ${updateFile}).`);
        this._file = cachedUpdateFile;
        return cachedUpdateFile;
    }
    async setDownloadedFile(downloadedFile, packageFile, versionInfo, fileInfo, updateFileName, isSaveCache) {
        this._file = downloadedFile;
        this._packageFile = packageFile;
        this.versionInfo = versionInfo;
        this.fileInfo = fileInfo;
        this._downloadedFileInfo = {
            fileName: updateFileName,
            sha512: fileInfo.info.sha512,
            isAdminRightsRequired: fileInfo.info.isAdminRightsRequired === true,
        };
        if (isSaveCache) {
            await (0, fs_extra_1.outputJson)(this.getUpdateInfoFile(), this._downloadedFileInfo);
        }
    }
    async clear() {
        this._file = null;
        this._packageFile = null;
        this.versionInfo = null;
        this.fileInfo = null;
        await this.cleanCacheDirForPendingUpdate();
    }
    async cleanCacheDirForPendingUpdate() {
        try {
            // remove stale data
            await (0, fs_extra_1.emptyDir)(this.cacheDirForPendingUpdate);
        }
        catch (_ignore) {
            // ignore
        }
    }
    /**
     * Returns "update-info.json" which is created in the update cache directory's "pending" subfolder after the first update is downloaded.  If the update file does not exist then the cache is cleared and recreated.  If the update file exists then its properties are validated.
     * @param fileInfo
     * @param logger
     */
    async getValidCachedUpdateFile(fileInfo, logger) {
        const updateInfoFilePath = this.getUpdateInfoFile();
        const doesUpdateInfoFileExist = await (0, fs_extra_1.pathExists)(updateInfoFilePath);
        if (!doesUpdateInfoFileExist) {
            return null;
        }
        let cachedInfo;
        try {
            cachedInfo = await (0, fs_extra_1.readJson)(updateInfoFilePath);
        }
        catch (error) {
            let message = `No cached update info available`;
            if (error.code !== "ENOENT") {
                await this.cleanCacheDirForPendingUpdate();
                message += ` (error on read: ${error.message})`;
            }
            logger.info(message);
            return null;
        }
        const isCachedInfoFileNameValid = (cachedInfo === null || cachedInfo === void 0 ? void 0 : cachedInfo.fileName) !== null;
        if (!isCachedInfoFileNameValid) {
            logger.warn(`Cached update info is corrupted: no fileName, directory for cached update will be cleaned`);
            await this.cleanCacheDirForPendingUpdate();
            return null;
        }
        if (fileInfo.info.sha512 !== cachedInfo.sha512) {
            logger.info(`Cached update sha512 checksum doesn't match the latest available update. New update must be downloaded. Cached: ${cachedInfo.sha512}, expected: ${fileInfo.info.sha512}. Directory for cached update will be cleaned`);
            await this.cleanCacheDirForPendingUpdate();
            return null;
        }
        const updateFile = path.join(this.cacheDirForPendingUpdate, cachedInfo.fileName);
        if (!(await (0, fs_extra_1.pathExists)(updateFile))) {
            logger.info("Cached update file doesn't exist");
            return null;
        }
        const sha512 = await hashFile(updateFile);
        if (fileInfo.info.sha512 !== sha512) {
            logger.warn(`Sha512 checksum doesn't match the latest available update. New update must be downloaded. Cached: ${sha512}, expected: ${fileInfo.info.sha512}`);
            await this.cleanCacheDirForPendingUpdate();
            return null;
        }
        this._downloadedFileInfo = cachedInfo;
        return updateFile;
    }
    getUpdateInfoFile() {
        return path.join(this.cacheDirForPendingUpdate, "update-info.json");
    }
}
exports.DownloadedUpdateHelper = DownloadedUpdateHelper;
function hashFile(file, algorithm = "sha512", encoding = "base64", options) {
    return new Promise((resolve, reject) => {
        const hash = (0, crypto_1.createHash)(algorithm);
        hash.on("error", reject).setEncoding(encoding);
        (0, fs_1.createReadStream)(file, { ...options, highWaterMark: 1024 * 1024 /* better to use more memory but hash faster */ })
            .on("error", reject)
            .on("end", () => {
            hash.end();
            resolve(hash.read());
        })
            .pipe(hash, { end: false });
    });
}
async function createTempUpdateFile(name, cacheDir, log) {
    // https://github.com/electron-userland/electron-builder/pull/2474#issuecomment-366481912
    let nameCounter = 0;
    let result = path.join(cacheDir, name);
    for (let i = 0; i < 3; i++) {
        try {
            await (0, fs_extra_1.unlink)(result);
            return result;
        }
        catch (e) {
            if (e.code === "ENOENT") {
                return result;
            }
            log.warn(`Error on remove temp update file: ${e}`);
            result = path.join(cacheDir, `${nameCounter++}-${name}`);
        }
    }
    return result;
}
//# sourceMappingURL=DownloadedUpdateHelper.js.map{"version":3,"file":"DownloadedUpdateHelper.js","sourceRoot":"","sources":["../src/DownloadedUpdateHelper.ts"],"names":[],"mappings":";;;AAqLA,oDAkBC;AAtMD,mCAAmC;AACnC,2BAAqC;AACrC,aAAa;AACb,0CAAyC;AAGzC,uCAA6E;AAC7E,6BAA4B;AAE5B,gBAAgB;AAChB,MAAa,sBAAsB;IAOjC,YAAqB,QAAgB;QAAhB,aAAQ,GAAR,QAAQ,CAAQ;QAN7B,UAAK,GAAkB,IAAI,CAAA;QAC3B,iBAAY,GAAkB,IAAI,CAAA;QAElC,gBAAW,GAAsB,IAAI,CAAA;QACrC,aAAQ,GAAkC,IAAI,CAAA;QAI9C,wBAAmB,GAA4B,IAAI,CAAA;IAFnB,CAAC;IAGzC,IAAI,kBAAkB;QACpB,OAAO,IAAI,CAAC,mBAAmB,CAAA;IACjC,CAAC;IAED,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,KAAK,CAAA;IACnB,CAAC;IAED,IAAI,WAAW;QACb,OAAO,IAAI,CAAC,YAAY,CAAA;IAC1B,CAAC;IAED,IAAI,wBAAwB;QAC1B,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAA;IAC5C,CAAC;IAED,KAAK,CAAC,sBAAsB,CAAC,UAAkB,EAAE,UAAsB,EAAE,QAAgC,EAAE,MAAc;QACvH,IAAI,IAAI,CAAC,WAAW,IAAI,IAAI,IAAI,IAAI,CAAC,IAAI,KAAK,UAAU,IAAI,IAAI,CAAC,QAAQ,IAAI,IAAI,EAAE,CAAC;YAClF,gEAAgE;YAChE,0CAA0C;YAC1C,IAAI,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,UAAU,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,IAAA,qBAAU,EAAC,UAAU,CAAC,CAAC,EAAE,CAAC;gBAC1H,OAAO,UAAU,CAAA;YACnB,CAAC;iBAAM,CAAC;gBACN,OAAO,IAAI,CAAA;YACb,CAAC;QACH,CAAC;QAED,mEAAmE;QACnE,MAAM,gBAAgB,GAAG,MAAM,IAAI,CAAC,wBAAwB,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAA;QAC9E,IAAI,gBAAgB,KAAK,IAAI,EAAE,CAAC;YAC9B,OAAO,IAAI,CAAA;QACb,CAAC;QACD,MAAM,CAAC,IAAI,CAAC,yCAAyC,UAAU,IAAI,CAAC,CAAA;QACpE,IAAI,CAAC,KAAK,GAAG,gBAAgB,CAAA;QAC7B,OAAO,gBAAgB,CAAA;IACzB,CAAC;IAED,KAAK,CAAC,iBAAiB,CACrB,cAAsB,EACtB,WAA0B,EAC1B,WAAuB,EACvB,QAAgC,EAChC,cAAsB,EACtB,WAAoB;QAEpB,IAAI,CAAC,KAAK,GAAG,cAAc,CAAA;QAC3B,IAAI,CAAC,YAAY,GAAG,WAAW,CAAA;QAC/B,IAAI,CAAC,WAAW,GAAG,WAAW,CAAA;QAC9B,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAA;QACxB,IAAI,CAAC,mBAAmB,GAAG;YACzB,QAAQ,EAAE,cAAc;YACxB,MAAM,EAAE,QAAQ,CAAC,IAAI,CAAC,MAAM;YAC5B,qBAAqB,EAAE,QAAQ,CAAC,IAAI,CAAC,qBAAqB,KAAK,IAAI;SACpE,CAAA;QAED,IAAI,WAAW,EAAE,CAAC;YAChB,MAAM,IAAA,qBAAU,EAAC,IAAI,CAAC,iBAAiB,EAAE,EAAE,IAAI,CAAC,mBAAmB,CAAC,CAAA;QACtE,CAAC;IACH,CAAC;IAED,KAAK,CAAC,KAAK;QACT,IAAI,CAAC,KAAK,GAAG,IAAI,CAAA;QACjB,IAAI,CAAC,YAAY,GAAG,IAAI,CAAA;QACxB,IAAI,CAAC,WAAW,GAAG,IAAI,CAAA;QACvB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAA;QACpB,MAAM,IAAI,CAAC,6BAA6B,EAAE,CAAA;IAC5C,CAAC;IAEO,KAAK,CAAC,6BAA6B;QACzC,IAAI,CAAC;YACH,oBAAoB;YACpB,MAAM,IAAA,mBAAQ,EAAC,IAAI,CAAC,wBAAwB,CAAC,CAAA;QAC/C,CAAC;QAAC,OAAO,OAAO,EAAE,CAAC;YACjB,SAAS;QACX,CAAC;IACH,CAAC;IAED;;;;OAIG;IACK,KAAK,CAAC,wBAAwB,CAAC,QAAgC,EAAE,MAAc;QACrF,MAAM,kBAAkB,GAAW,IAAI,CAAC,iBAAiB,EAAE,CAAA;QAE3D,MAAM,uBAAuB,GAAG,MAAM,IAAA,qBAAU,EAAC,kBAAkB,CAAC,CAAA;QACpE,IAAI,CAAC,uBAAuB,EAAE,CAAC;YAC7B,OAAO,IAAI,CAAA;QACb,CAAC;QAED,IAAI,UAA4B,CAAA;QAChC,IAAI,CAAC;YACH,UAAU,GAAG,MAAM,IAAA,mBAAQ,EAAC,kBAAkB,CAAC,CAAA;QACjD,CAAC;QAAC,OAAO,KAAU,EAAE,CAAC;YACpB,IAAI,OAAO,GAAG,iCAAiC,CAAA;YAC/C,IAAI,KAAK,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;gBAC5B,MAAM,IAAI,CAAC,6BAA6B,EAAE,CAAA;gBAC1C,OAAO,IAAI,oBAAoB,KAAK,CAAC,OAAO,GAAG,CAAA;YACjD,CAAC;YACD,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;YACpB,OAAO,IAAI,CAAA;QACb,CAAC;QAED,MAAM,yBAAyB,GAAG,CAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,QAAQ,MAAK,IAAI,CAAA;QAC/D,IAAI,CAAC,yBAAyB,EAAE,CAAC;YAC/B,MAAM,CAAC,IAAI,CAAC,2FAA2F,CAAC,CAAA;YACxG,MAAM,IAAI,CAAC,6BAA6B,EAAE,CAAA;YAC1C,OAAO,IAAI,CAAA;QACb,CAAC;QAED,IAAI,QAAQ,CAAC,IAAI,CAAC,MAAM,KAAK,UAAU,CAAC,MAAM,EAAE,CAAC;YAC/C,MAAM,CAAC,IAAI,CACT,mHAAmH,UAAU,CAAC,MAAM,eAAe,QAAQ,CAAC,IAAI,CAAC,MAAM,+CAA+C,CACvN,CAAA;YACD,MAAM,IAAI,CAAC,6BAA6B,EAAE,CAAA;YAC1C,OAAO,IAAI,CAAA;QACb,CAAC;QAED,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,wBAAwB,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAA;QAChF,IAAI,CAAC,CAAC,MAAM,IAAA,qBAAU,EAAC,UAAU,CAAC,CAAC,EAAE,CAAC;YACpC,MAAM,CAAC,IAAI,CAAC,kCAAkC,CAAC,CAAA;YAC/C,OAAO,IAAI,CAAA;QACb,CAAC;QAED,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,UAAU,CAAC,CAAA;QACzC,IAAI,QAAQ,CAAC,IAAI,CAAC,MAAM,KAAK,MAAM,EAAE,CAAC;YACpC,MAAM,CAAC,IAAI,CAAC,qGAAqG,MAAM,eAAe,QAAQ,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAA;YAC7J,MAAM,IAAI,CAAC,6BAA6B,EAAE,CAAA;YAC1C,OAAO,IAAI,CAAA;QACb,CAAC;QACD,IAAI,CAAC,mBAAmB,GAAG,UAAU,CAAA;QACrC,OAAO,UAAU,CAAA;IACnB,CAAC;IAEO,iBAAiB;QACvB,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,wBAAwB,EAAE,kBAAkB,CAAC,CAAA;IACrE,CAAC;CACF;AAnJD,wDAmJC;AAQD,SAAS,QAAQ,CAAC,IAAY,EAAE,SAAS,GAAG,QAAQ,EAAE,WAA6B,QAAQ,EAAE,OAAa;IACxG,OAAO,IAAI,OAAO,CAAS,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QAC7C,MAAM,IAAI,GAAG,IAAA,mBAAU,EAAC,SAAS,CAAC,CAAA;QAClC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAA;QAE9C,IAAA,qBAAgB,EAAC,IAAI,EAAE,EAAE,GAAG,OAAO,EAAE,aAAa,EAAE,IAAI,GAAG,IAAI,CAAC,+CAA+C,EAAE,CAAC;aAC/G,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC;aACnB,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE;YACd,IAAI,CAAC,GAAG,EAAE,CAAA;YACV,OAAO,CAAC,IAAI,CAAC,IAAI,EAAY,CAAC,CAAA;QAChC,CAAC,CAAC;aACD,IAAI,CAAC,IAAI,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC,CAAA;IAC/B,CAAC,CAAC,CAAA;AACJ,CAAC;AAEM,KAAK,UAAU,oBAAoB,CAAC,IAAY,EAAE,QAAgB,EAAE,GAAW;IACpF,yFAAyF;IACzF,IAAI,WAAW,GAAG,CAAC,CAAA;IACnB,IAAI,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAA;IACtC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;QAC3B,IAAI,CAAC;YACH,MAAM,IAAA,iBAAM,EAAC,MAAM,CAAC,CAAA;YACpB,OAAO,MAAM,CAAA;QACf,CAAC;QAAC,OAAO,CAAM,EAAE,CAAC;YAChB,IAAI,CAAC,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;gBACxB,OAAO,MAAM,CAAA;YACf,CAAC;YAED,GAAG,CAAC,IAAI,CAAC,qCAAqC,CAAC,EAAE,CAAC,CAAA;YAClD,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,WAAW,EAAE,IAAI,IAAI,EAAE,CAAC,CAAA;QAC1D,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAA;AACf,CAAC","sourcesContent":["import { UpdateInfo } from \"builder-util-runtime\"\nimport { createHash } from \"crypto\"\nimport { createReadStream } from \"fs\"\n// @ts-ignore\nimport * as isEqual from \"lodash.isequal\"\nimport { ResolvedUpdateFileInfo } from \"./types\"\nimport { Logger } from \"./types\"\nimport { pathExists, readJson, emptyDir, outputJson, unlink } from \"fs-extra\"\nimport * as path from \"path\"\n\n/** @private **/\nexport class DownloadedUpdateHelper {\n  private _file: string | null = null\n  private _packageFile: string | null = null\n\n  private versionInfo: UpdateInfo | null = null\n  private fileInfo: ResolvedUpdateFileInfo | null = null\n\n  constructor(readonly cacheDir: string) {}\n\n  private _downloadedFileInfo: CachedUpdateInfo | null = null\n  get downloadedFileInfo(): CachedUpdateInfo | null {\n    return this._downloadedFileInfo\n  }\n\n  get file(): string | null {\n    return this._file\n  }\n\n  get packageFile(): string | null {\n    return this._packageFile\n  }\n\n  get cacheDirForPendingUpdate(): string {\n    return path.join(this.cacheDir, \"pending\")\n  }\n\n  async validateDownloadedPath(updateFile: string, updateInfo: UpdateInfo, fileInfo: ResolvedUpdateFileInfo, logger: Logger): Promise<string | null> {\n    if (this.versionInfo != null && this.file === updateFile && this.fileInfo != null) {\n      // update has already been downloaded from this running instance\n      // check here only existence, not checksum\n      if (isEqual(this.versionInfo, updateInfo) && isEqual(this.fileInfo.info, fileInfo.info) && (await pathExists(updateFile))) {\n        return updateFile\n      } else {\n        return null\n      }\n    }\n\n    // update has already been downloaded from some previous app launch\n    const cachedUpdateFile = await this.getValidCachedUpdateFile(fileInfo, logger)\n    if (cachedUpdateFile === null) {\n      return null\n    }\n    logger.info(`Update has already been downloaded to ${updateFile}).`)\n    this._file = cachedUpdateFile\n    return cachedUpdateFile\n  }\n\n  async setDownloadedFile(\n    downloadedFile: string,\n    packageFile: string | null,\n    versionInfo: UpdateInfo,\n    fileInfo: ResolvedUpdateFileInfo,\n    updateFileName: string,\n    isSaveCache: boolean\n  ): Promise<void> {\n    this._file = downloadedFile\n    this._packageFile = packageFile\n    this.versionInfo = versionInfo\n    this.fileInfo = fileInfo\n    this._downloadedFileInfo = {\n      fileName: updateFileName,\n      sha512: fileInfo.info.sha512,\n      isAdminRightsRequired: fileInfo.info.isAdminRightsRequired === true,\n    }\n\n    if (isSaveCache) {\n      await outputJson(this.getUpdateInfoFile(), this._downloadedFileInfo)\n    }\n  }\n\n  async clear(): Promise<void> {\n    this._file = null\n    this._packageFile = null\n    this.versionInfo = null\n    this.fileInfo = null\n    await this.cleanCacheDirForPendingUpdate()\n  }\n\n  private async cleanCacheDirForPendingUpdate(): Promise<void> {\n    try {\n      // remove stale data\n      await emptyDir(this.cacheDirForPendingUpdate)\n    } catch (_ignore) {\n      // ignore\n    }\n  }\n\n  /**\n   * Returns \"update-info.json\" which is created in the update cache directory's \"pending\" subfolder after the first update is downloaded.  If the update file does not exist then the cache is cleared and recreated.  If the update file exists then its properties are validated.\n   * @param fileInfo\n   * @param logger\n   */\n  private async getValidCachedUpdateFile(fileInfo: ResolvedUpdateFileInfo, logger: Logger): Promise<string | null> {\n    const updateInfoFilePath: string = this.getUpdateInfoFile()\n\n    const doesUpdateInfoFileExist = await pathExists(updateInfoFilePath)\n    if (!doesUpdateInfoFileExist) {\n      return null\n    }\n\n    let cachedInfo: CachedUpdateInfo\n    try {\n      cachedInfo = await readJson(updateInfoFilePath)\n    } catch (error: any) {\n      let message = `No cached update info available`\n      if (error.code !== \"ENOENT\") {\n        await this.cleanCacheDirForPendingUpdate()\n        message += ` (error on read: ${error.message})`\n      }\n      logger.info(message)\n      return null\n    }\n\n    const isCachedInfoFileNameValid = cachedInfo?.fileName !== null\n    if (!isCachedInfoFileNameValid) {\n      logger.warn(`Cached update info is corrupted: no fileName, directory for cached update will be cleaned`)\n      await this.cleanCacheDirForPendingUpdate()\n      return null\n    }\n\n    if (fileInfo.info.sha512 !== cachedInfo.sha512) {\n      logger.info(\n        `Cached update sha512 checksum doesn't match the latest available update. New update must be downloaded. Cached: ${cachedInfo.sha512}, expected: ${fileInfo.info.sha512}. Directory for cached update will be cleaned`\n      )\n      await this.cleanCacheDirForPendingUpdate()\n      return null\n    }\n\n    const updateFile = path.join(this.cacheDirForPendingUpdate, cachedInfo.fileName)\n    if (!(await pathExists(updateFile))) {\n      logger.info(\"Cached update file doesn't exist\")\n      return null\n    }\n\n    const sha512 = await hashFile(updateFile)\n    if (fileInfo.info.sha512 !== sha512) {\n      logger.warn(`Sha512 checksum doesn't match the latest available update. New update must be downloaded. Cached: ${sha512}, expected: ${fileInfo.info.sha512}`)\n      await this.cleanCacheDirForPendingUpdate()\n      return null\n    }\n    this._downloadedFileInfo = cachedInfo\n    return updateFile\n  }\n\n  private getUpdateInfoFile(): string {\n    return path.join(this.cacheDirForPendingUpdate, \"update-info.json\")\n  }\n}\n\ninterface CachedUpdateInfo {\n  fileName: string\n  sha512: string\n  readonly isAdminRightsRequired: boolean\n}\n\nfunction hashFile(file: string, algorithm = \"sha512\", encoding: \"base64\" | \"hex\" = \"base64\", options?: any): Promise<string> {\n  return new Promise<string>((resolve, reject) => {\n    const hash = createHash(algorithm)\n    hash.on(\"error\", reject).setEncoding(encoding)\n\n    createReadStream(file, { ...options, highWaterMark: 1024 * 1024 /* better to use more memory but hash faster */ })\n      .on(\"error\", reject)\n      .on(\"end\", () => {\n        hash.end()\n        resolve(hash.read() as string)\n      })\n      .pipe(hash, { end: false })\n  })\n}\n\nexport async function createTempUpdateFile(name: string, cacheDir: string, log: Logger): Promise<string> {\n  // https://github.com/electron-userland/electron-builder/pull/2474#issuecomment-366481912\n  let nameCounter = 0\n  let result = path.join(cacheDir, name)\n  for (let i = 0; i < 3; i++) {\n    try {\n      await unlink(result)\n      return result\n    } catch (e: any) {\n      if (e.code === \"ENOENT\") {\n        return result\n      }\n\n      log.warn(`Error on remove temp update file: ${e}`)\n      result = path.join(cacheDir, `${nameCounter++}-${name}`)\n    }\n  }\n  return result\n}\n"]}"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ElectronAppAdapter = void 0;
const path = require("path");
const AppAdapter_1 = require("./AppAdapter");
class ElectronAppAdapter {
    constructor(app = require("electron").app) {
        this.app = app;
    }
    whenReady() {
        return this.app.whenReady();
    }
    get version() {
        return this.app.getVersion();
    }
    get name() {
        return this.app.getName();
    }
    get isPackaged() {
        return this.app.isPackaged === true;
    }
    get appUpdateConfigPath() {
        return this.isPackaged ? path.join(process.resourcesPath, "app-update.yml") : path.join(this.app.getAppPath(), "dev-app-update.yml");
    }
    get userDataPath() {
        return this.app.getPath("userData");
    }
    get baseCachePath() {
        return (0, AppAdapter_1.getAppCacheDir)();
    }
    quit() {
        this.app.quit();
    }
    relaunch() {
        this.app.relaunch();
    }
    onQuit(handler) {
        this.app.once("quit", (_, exitCode) => handler(exitCode));
    }
}
exports.ElectronAppAdapter = ElectronAppAdapter;
//# sourceMappingURL=ElectronAppAdapter.js.map{"version":3,"file":"ElectronAppAdapter.js","sourceRoot":"","sources":["../src/ElectronAppAdapter.ts"],"names":[],"mappings":";;;AAAA,6BAA4B;AAC5B,6CAAyD;AAEzD,MAAa,kBAAkB;IAC7B,YAA6B,MAAM,OAAO,CAAC,UAAU,CAAC,CAAC,GAAG;QAA7B,QAAG,GAAH,GAAG,CAA0B;IAAG,CAAC;IAE9D,SAAS;QACP,OAAO,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE,CAAA;IAC7B,CAAC;IAED,IAAI,OAAO;QACT,OAAO,IAAI,CAAC,GAAG,CAAC,UAAU,EAAE,CAAA;IAC9B,CAAC;IAED,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,CAAA;IAC3B,CAAC;IAED,IAAI,UAAU;QACZ,OAAO,IAAI,CAAC,GAAG,CAAC,UAAU,KAAK,IAAI,CAAA;IACrC,CAAC;IAED,IAAI,mBAAmB;QACrB,OAAO,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,EAAE,gBAAgB,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,UAAU,EAAE,EAAE,oBAAoB,CAAC,CAAA;IACtI,CAAC;IAED,IAAI,YAAY;QACd,OAAO,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,UAAU,CAAC,CAAA;IACrC,CAAC;IAED,IAAI,aAAa;QACf,OAAO,IAAA,2BAAc,GAAE,CAAA;IACzB,CAAC;IAED,IAAI;QACF,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,CAAA;IACjB,CAAC;IAED,QAAQ;QACN,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAA;IACrB,CAAC;IAED,MAAM,CAAC,OAAmC;QACxC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAiB,EAAE,QAAgB,EAAE,EAAE,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAA;IACnF,CAAC;CACF;AA1CD,gDA0CC","sourcesContent":["import * as path from \"path\"\nimport { AppAdapter, getAppCacheDir } from \"./AppAdapter\"\n\nexport class ElectronAppAdapter implements AppAdapter {\n  constructor(private readonly app = require(\"electron\").app) {}\n\n  whenReady(): Promise<void> {\n    return this.app.whenReady()\n  }\n\n  get version(): string {\n    return this.app.getVersion()\n  }\n\n  get name(): string {\n    return this.app.getName()\n  }\n\n  get isPackaged(): boolean {\n    return this.app.isPackaged === true\n  }\n\n  get appUpdateConfigPath(): string {\n    return this.isPackaged ? path.join(process.resourcesPath, \"app-update.yml\") : path.join(this.app.getAppPath(), \"dev-app-update.yml\")\n  }\n\n  get userDataPath(): string {\n    return this.app.getPath(\"userData\")\n  }\n\n  get baseCachePath(): string {\n    return getAppCacheDir()\n  }\n\n  quit(): void {\n    this.app.quit()\n  }\n\n  relaunch(): void {\n    this.app.relaunch()\n  }\n\n  onQuit(handler: (exitCode: number) => void): void {\n    this.app.once(\"quit\", (_: Electron.Event, exitCode: number) => handler(exitCode))\n  }\n}\n"]}"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.LinuxUpdater = void 0;
const BaseUpdater_1 = require("./BaseUpdater");
// Matches safe package manager names: alphanumeric, hyphens, underscores only.
// Rejects names with shell metacharacters that could cause command injection.
const SAFE_PM_REGEX = /^[a-zA-Z0-9_-]+$/;
class LinuxUpdater extends BaseUpdater_1.BaseUpdater {
    constructor(options, app) {
        super(options, app);
    }
    /**
     * Returns true if the current process is running as root.
     */
    isRunningAsRoot() {
        var _a;
        return ((_a = process.getuid) === null || _a === void 0 ? void 0 : _a.call(process)) === 0;
    }
    /**
     * Sanitizes the installer path for use with shell:true spawn calls.
     * Backslash-escapes metacharacters that have special meaning in POSIX shell.
     * Note: paths containing single-quotes (') are not supported.
     */
    get installerPath() {
        const raw = super.installerPath;
        if (raw == null) {
            return null;
        }
        return raw
            .replace(/\\/g, "\\\\") // must come first
            .replace(/([`$!" ;|&()<>])/g, "\\$1")
            .replace(/[\n\r]/g, "");
    }
    runCommandWithSudoIfNeeded(commandWithArgs) {
        if (this.isRunningAsRoot()) {
            this._logger.info("Running as root, no need to use sudo");
            return this.spawnSyncLog(commandWithArgs[0], commandWithArgs.slice(1));
        }
        const { name } = this.app;
        // Strip characters that could break shell quoting in the sudo dialog comment string
        const safeName = name.replace(/["`$\\!\n\r;|&<>(){}*?[\]#~]/g, "");
        const installComment = `"${safeName} would like to update"`;
        const sudo = this.sudoWithArgs(installComment);
        this._logger.info(`Running as non-root user, using sudo to install: ${sudo}`);
        let wrapper = `"`;
        // some sudo commands dont want the command to be wrapped in " quotes
        if (/pkexec/i.test(sudo[0]) || sudo[0] === "sudo") {
            wrapper = "";
        }
        return this.spawnSyncLog(sudo[0], [...(sudo.length > 1 ? sudo.slice(1) : []), `${wrapper}/bin/bash`, "-c", `'${commandWithArgs.join(" ")}'${wrapper}`]);
    }
    sudoWithArgs(installComment) {
        const sudo = this.determineSudoCommand();
        const command = [sudo];
        if (/kdesudo/i.test(sudo)) {
            command.push("--comment", installComment);
            command.push("-c");
        }
        else if (/gksudo/i.test(sudo)) {
            command.push("--message", installComment);
        }
        else if (/pkexec/i.test(sudo)) {
            command.push("--disable-internal-agent");
        }
        return command;
    }
    hasCommand(cmd) {
        try {
            this.spawnSyncLog(`command`, ["-v", cmd]);
            return true;
        }
        catch {
            return false;
        }
    }
    determineSudoCommand() {
        const sudos = ["gksudo", "kdesudo", "pkexec", "beesu"];
        for (const sudo of sudos) {
            if (this.hasCommand(sudo)) {
                return sudo;
            }
        }
        return "sudo";
    }
    /**
     * Detects the package manager to use based on the available commands.
     * Allows overriding the default behavior by setting the ELECTRON_BUILDER_LINUX_PACKAGE_MANAGER environment variable.
     * If the environment variable is set, it will be used directly. (This is useful for testing each package manager logic path.)
     * Otherwise, it checks for the presence of the specified package manager commands in the order provided.
     * @param pms - An array of package manager commands to check for, in priority order.
     * @returns The detected package manager command or "unknown" if none are found.
     */
    detectPackageManager(pms) {
        var _a;
        let availablePMs = pms;
        const pmOverride = (_a = process.env.ELECTRON_BUILDER_LINUX_PACKAGE_MANAGER) === null || _a === void 0 ? void 0 : _a.trim();
        if (pmOverride) {
            if (!SAFE_PM_REGEX.test(pmOverride)) {
                this._logger.warn(`ELECTRON_BUILDER_LINUX_PACKAGE_MANAGER "${pmOverride}" contains unsafe characters. Ignoring override.`);
            }
            else {
                availablePMs = [pmOverride];
            }
        }
        // Check for the package manager in the order of priority
        for (const pm of availablePMs) {
            if (this.hasCommand(pm)) {
                return pm;
            }
        }
        // return the first/default package manager in the original list if none are found, this will throw upstream for proper logging
        const searchList = pmOverride ? `ELECTRON_BUILDER_LINUX_PACKAGE_MANAGER override "${pmOverride}", ` : "";
        const defaultPM = pms[0];
        this._logger.warn(`No package manager found in the list: ${searchList}${pms.join(", ")}. Utilizing default: ${defaultPM}`);
        return defaultPM;
    }
}
exports.LinuxUpdater = LinuxUpdater;
//# sourceMappingURL=LinuxUpdater.js.map{"version":3,"file":"LinuxUpdater.js","sourceRoot":"","sources":["../src/LinuxUpdater.ts"],"names":[],"mappings":";;;AAEA,+CAA2C;AAE3C,+EAA+E;AAC/E,8EAA8E;AAC9E,MAAM,aAAa,GAAG,kBAAkB,CAAA;AAExC,MAAsB,YAAa,SAAQ,yBAAW;IACpD,YAAY,OAAkC,EAAE,GAAgB;QAC9D,KAAK,CAAC,OAAO,EAAE,GAAG,CAAC,CAAA;IACrB,CAAC;IAED;;OAEG;IACO,eAAe;;QACvB,OAAO,CAAA,MAAA,OAAO,CAAC,MAAM,uDAAI,MAAK,CAAC,CAAA;IACjC,CAAC;IAED;;;;OAIG;IACH,IAAc,aAAa;QACzB,MAAM,GAAG,GAAG,KAAK,CAAC,aAAa,CAAA;QAC/B,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC;YAChB,OAAO,IAAI,CAAA;QACb,CAAC;QACD,OAAO,GAAG;aACP,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,kBAAkB;aACzC,OAAO,CAAC,mBAAmB,EAAE,MAAM,CAAC;aACpC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAAA;IAC3B,CAAC;IAES,0BAA0B,CAAC,eAAyB;QAC5D,IAAI,IAAI,CAAC,eAAe,EAAE,EAAE,CAAC;YAC3B,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,sCAAsC,CAAC,CAAA;YACzD,OAAO,IAAI,CAAC,YAAY,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,eAAe,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAA;QACxE,CAAC;QAED,MAAM,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC,GAAG,CAAA;QACzB,oFAAoF;QACpF,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,+BAA+B,EAAE,EAAE,CAAC,CAAA;QAClE,MAAM,cAAc,GAAG,IAAI,QAAQ,wBAAwB,CAAA;QAC3D,MAAM,IAAI,GAAG,IAAI,CAAC,YAAY,CAAC,cAAc,CAAC,CAAA;QAC9C,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,oDAAoD,IAAI,EAAE,CAAC,CAAA;QAC7E,IAAI,OAAO,GAAG,GAAG,CAAA;QACjB,qEAAqE;QACrE,IAAI,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,MAAM,EAAE,CAAC;YAClD,OAAO,GAAG,EAAE,CAAA;QACd,CAAC;QACD,OAAO,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,OAAO,WAAW,EAAE,IAAI,EAAE,IAAI,eAAe,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,OAAO,EAAE,CAAC,CAAC,CAAA;IACzJ,CAAC;IAES,YAAY,CAAC,cAAsB;QAC3C,MAAM,IAAI,GAAG,IAAI,CAAC,oBAAoB,EAAE,CAAA;QACxC,MAAM,OAAO,GAAG,CAAC,IAAI,CAAC,CAAA;QACtB,IAAI,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;YAC1B,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,cAAc,CAAC,CAAA;YACzC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QACpB,CAAC;aAAM,IAAI,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;YAChC,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,cAAc,CAAC,CAAA;QAC3C,CAAC;aAAM,IAAI,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;YAChC,OAAO,CAAC,IAAI,CAAC,0BAA0B,CAAC,CAAA;QAC1C,CAAC;QACD,OAAO,OAAO,CAAA;IAChB,CAAC;IAES,UAAU,CAAC,GAAW;QAC9B,IAAI,CAAC;YACH,IAAI,CAAC,YAAY,CAAC,SAAS,EAAE,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,CAAA;YACzC,OAAO,IAAI,CAAA;QACb,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,KAAK,CAAA;QACd,CAAC;IACH,CAAC;IAES,oBAAoB;QAC5B,MAAM,KAAK,GAAG,CAAC,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAA;QACtD,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;YACzB,IAAI,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;gBAC1B,OAAO,IAAI,CAAA;YACb,CAAC;QACH,CAAC;QACD,OAAO,MAAM,CAAA;IACf,CAAC;IAED;;;;;;;OAOG;IACO,oBAAoB,CAAC,GAAa;;QAC1C,IAAI,YAAY,GAAG,GAAG,CAAA;QACtB,MAAM,UAAU,GAAG,MAAA,OAAO,CAAC,GAAG,CAAC,sCAAsC,0CAAE,IAAI,EAAE,CAAA;QAC7E,IAAI,UAAU,EAAE,CAAC;YACf,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC;gBACpC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,2CAA2C,UAAU,kDAAkD,CAAC,CAAA;YAC5H,CAAC;iBAAM,CAAC;gBACN,YAAY,GAAG,CAAC,UAAU,CAAC,CAAA;YAC7B,CAAC;QACH,CAAC;QACD,yDAAyD;QACzD,KAAK,MAAM,EAAE,IAAI,YAAY,EAAE,CAAC;YAC9B,IAAI,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,EAAE,CAAC;gBACxB,OAAO,EAAE,CAAA;YACX,CAAC;QACH,CAAC;QACD,+HAA+H;QAC/H,MAAM,UAAU,GAAG,UAAU,CAAC,CAAC,CAAC,oDAAoD,UAAU,KAAK,CAAC,CAAC,CAAC,EAAE,CAAA;QACxG,MAAM,SAAS,GAAG,GAAG,CAAC,CAAC,CAAC,CAAA;QACxB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,yCAAyC,UAAU,GAAG,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,wBAAwB,SAAS,EAAE,CAAC,CAAA;QAC1H,OAAO,SAAS,CAAA;IAClB,CAAC;CACF;AA/GD,oCA+GC","sourcesContent":["import { AllPublishOptions } from \"builder-util-runtime\"\nimport { AppAdapter } from \"./AppAdapter\"\nimport { BaseUpdater } from \"./BaseUpdater\"\n\n// Matches safe package manager names: alphanumeric, hyphens, underscores only.\n// Rejects names with shell metacharacters that could cause command injection.\nconst SAFE_PM_REGEX = /^[a-zA-Z0-9_-]+$/\n\nexport abstract class LinuxUpdater extends BaseUpdater {\n  constructor(options?: AllPublishOptions | null, app?: AppAdapter) {\n    super(options, app)\n  }\n\n  /**\n   * Returns true if the current process is running as root.\n   */\n  protected isRunningAsRoot(): boolean {\n    return process.getuid?.() === 0\n  }\n\n  /**\n   * Sanitizes the installer path for use with shell:true spawn calls.\n   * Backslash-escapes metacharacters that have special meaning in POSIX shell.\n   * Note: paths containing single-quotes (') are not supported.\n   */\n  protected get installerPath(): string | null {\n    const raw = super.installerPath\n    if (raw == null) {\n      return null\n    }\n    return raw\n      .replace(/\\\\/g, \"\\\\\\\\\") // must come first\n      .replace(/([`$!\" ;|&()<>])/g, \"\\\\$1\")\n      .replace(/[\\n\\r]/g, \"\")\n  }\n\n  protected runCommandWithSudoIfNeeded(commandWithArgs: string[]) {\n    if (this.isRunningAsRoot()) {\n      this._logger.info(\"Running as root, no need to use sudo\")\n      return this.spawnSyncLog(commandWithArgs[0], commandWithArgs.slice(1))\n    }\n\n    const { name } = this.app\n    // Strip characters that could break shell quoting in the sudo dialog comment string\n    const safeName = name.replace(/[\"`$\\\\!\\n\\r;|&<>(){}*?[\\]#~]/g, \"\")\n    const installComment = `\"${safeName} would like to update\"`\n    const sudo = this.sudoWithArgs(installComment)\n    this._logger.info(`Running as non-root user, using sudo to install: ${sudo}`)\n    let wrapper = `\"`\n    // some sudo commands dont want the command to be wrapped in \" quotes\n    if (/pkexec/i.test(sudo[0]) || sudo[0] === \"sudo\") {\n      wrapper = \"\"\n    }\n    return this.spawnSyncLog(sudo[0], [...(sudo.length > 1 ? sudo.slice(1) : []), `${wrapper}/bin/bash`, \"-c\", `'${commandWithArgs.join(\" \")}'${wrapper}`])\n  }\n\n  protected sudoWithArgs(installComment: string): string[] {\n    const sudo = this.determineSudoCommand()\n    const command = [sudo]\n    if (/kdesudo/i.test(sudo)) {\n      command.push(\"--comment\", installComment)\n      command.push(\"-c\")\n    } else if (/gksudo/i.test(sudo)) {\n      command.push(\"--message\", installComment)\n    } else if (/pkexec/i.test(sudo)) {\n      command.push(\"--disable-internal-agent\")\n    }\n    return command\n  }\n\n  protected hasCommand(cmd: string): boolean {\n    try {\n      this.spawnSyncLog(`command`, [\"-v\", cmd])\n      return true\n    } catch {\n      return false\n    }\n  }\n\n  protected determineSudoCommand(): string {\n    const sudos = [\"gksudo\", \"kdesudo\", \"pkexec\", \"beesu\"]\n    for (const sudo of sudos) {\n      if (this.hasCommand(sudo)) {\n        return sudo\n      }\n    }\n    return \"sudo\"\n  }\n\n  /**\n   * Detects the package manager to use based on the available commands.\n   * Allows overriding the default behavior by setting the ELECTRON_BUILDER_LINUX_PACKAGE_MANAGER environment variable.\n   * If the environment variable is set, it will be used directly. (This is useful for testing each package manager logic path.)\n   * Otherwise, it checks for the presence of the specified package manager commands in the order provided.\n   * @param pms - An array of package manager commands to check for, in priority order.\n   * @returns The detected package manager command or \"unknown\" if none are found.\n   */\n  protected detectPackageManager(pms: string[]): string {\n    let availablePMs = pms\n    const pmOverride = process.env.ELECTRON_BUILDER_LINUX_PACKAGE_MANAGER?.trim()\n    if (pmOverride) {\n      if (!SAFE_PM_REGEX.test(pmOverride)) {\n        this._logger.warn(`ELECTRON_BUILDER_LINUX_PACKAGE_MANAGER \"${pmOverride}\" contains unsafe characters. Ignoring override.`)\n      } else {\n        availablePMs = [pmOverride]\n      }\n    }\n    // Check for the package manager in the order of priority\n    for (const pm of availablePMs) {\n      if (this.hasCommand(pm)) {\n        return pm\n      }\n    }\n    // return the first/default package manager in the original list if none are found, this will throw upstream for proper logging\n    const searchList = pmOverride ? `ELECTRON_BUILDER_LINUX_PACKAGE_MANAGER override \"${pmOverride}\", ` : \"\"\n    const defaultPM = pms[0]\n    this._logger.warn(`No package manager found in the list: ${searchList}${pms.join(\", \")}. Utilizing default: ${defaultPM}`)\n    return defaultPM\n  }\n}\n"]}"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.MacUpdater = void 0;
const builder_util_runtime_1 = require("builder-util-runtime");
const fs_extra_1 = require("fs-extra");
const fs_1 = require("fs");
const path = require("path");
const http_1 = require("http");
const AppUpdater_1 = require("./AppUpdater");
const Provider_1 = require("./providers/Provider");
const child_process_1 = require("child_process");
const crypto_1 = require("crypto");
class MacUpdater extends AppUpdater_1.AppUpdater {
    constructor(options, app) {
        super(options, app);
        this.nativeUpdater = require("electron").autoUpdater;
        this.squirrelDownloadedUpdate = false;
        this.nativeUpdater.on("error", it => {
            this._logger.warn(it);
            this.emit("error", it);
        });
        this.nativeUpdater.on("update-downloaded", () => {
            this.squirrelDownloadedUpdate = true;
            this.debug("nativeUpdater.update-downloaded");
        });
    }
    /** Filters update files to the appropriate architecture.
     * On arm64 Macs (including Rosetta), arm64 files are preferred when available.
     * On x64 Macs, arm64 files are excluded. */
    static filterFilesForArch(files, isArm64Mac) {
        const isArm64File = (file) => { var _a; return file.url.pathname.includes("arm64") || ((_a = file.info.url) === null || _a === void 0 ? void 0 : _a.includes("arm64")); };
        if (isArm64Mac && files.some(isArm64File)) {
            return files.filter(file => isArm64Mac === isArm64File(file));
        }
        return files.filter(file => !isArm64File(file));
    }
    debug(message) {
        if (this._logger.debug != null) {
            this._logger.debug(message);
        }
    }
    closeServerIfExists() {
        if (this.server) {
            this.debug("Closing proxy server");
            this.server.close(err => {
                if (err) {
                    this.debug("proxy server wasn't already open, probably attempted closing again as a safety check before quit");
                }
            });
        }
    }
    async doDownloadUpdate(downloadUpdateOptions) {
        let files = downloadUpdateOptions.updateInfoAndProvider.provider.resolveFiles(downloadUpdateOptions.updateInfoAndProvider.info);
        const log = this._logger;
        // detect if we are running inside Rosetta emulation
        const sysctlRosettaInfoKey = "sysctl.proc_translated";
        let isRosetta = false;
        try {
            this.debug("Checking for macOS Rosetta environment");
            const result = (0, child_process_1.execFileSync)("sysctl", [sysctlRosettaInfoKey], { encoding: "utf8" });
            isRosetta = result.includes(`${sysctlRosettaInfoKey}: 1`);
            log.info(`Checked for macOS Rosetta environment (isRosetta=${isRosetta})`);
        }
        catch (e) {
            log.warn(`sysctl shell command to check for macOS Rosetta environment failed: ${e}`);
        }
        let isArm64Mac = false;
        try {
            this.debug("Checking for arm64 in uname");
            const result = (0, child_process_1.execFileSync)("uname", ["-a"], { encoding: "utf8" });
            const isArm = result.includes("ARM");
            log.info(`Checked 'uname -a': arm64=${isArm}`);
            isArm64Mac = isArm64Mac || isArm;
        }
        catch (e) {
            log.warn(`uname shell command to check for arm64 failed: ${e}`);
        }
        isArm64Mac = isArm64Mac || process.arch === "arm64" || isRosetta;
        // allow arm64 macs to install universal or rosetta2(x64) - https://github.com/electron-userland/electron-builder/pull/5524
        files = MacUpdater.filterFilesForArch(files, isArm64Mac);
        const zipFileInfo = (0, Provider_1.findFile)(files, "zip", ["pkg", "dmg"]);
        if (zipFileInfo == null) {
            throw (0, builder_util_runtime_1.newError)(`ZIP file not provided: ${(0, builder_util_runtime_1.safeStringifyJson)(files)}`, "ERR_UPDATER_ZIP_FILE_NOT_FOUND");
        }
        const provider = downloadUpdateOptions.updateInfoAndProvider.provider;
        const CURRENT_MAC_APP_ZIP_FILE_NAME = "update.zip";
        return this.executeDownload({
            fileExtension: "zip",
            fileInfo: zipFileInfo,
            downloadUpdateOptions,
            task: async (destinationFile, downloadOptions) => {
                const cachedUpdateFilePath = path.join(this.downloadedUpdateHelper.cacheDir, CURRENT_MAC_APP_ZIP_FILE_NAME);
                const canDifferentialDownload = () => {
                    if (!(0, fs_extra_1.pathExistsSync)(cachedUpdateFilePath)) {
                        log.info("Unable to locate previous update.zip for differential download (is this first install?), falling back to full download");
                        return false;
                    }
                    return !downloadUpdateOptions.disableDifferentialDownload;
                };
                let differentialDownloadFailed = true;
                if (canDifferentialDownload()) {
                    differentialDownloadFailed = await this.differentialDownloadInstaller(zipFileInfo, downloadUpdateOptions, destinationFile, provider, CURRENT_MAC_APP_ZIP_FILE_NAME);
                }
                if (differentialDownloadFailed) {
                    await this.httpExecutor.download(zipFileInfo.url, destinationFile, downloadOptions);
                }
            },
            done: async (event) => {
                if (!downloadUpdateOptions.disableDifferentialDownload) {
                    try {
                        const cachedUpdateFilePath = path.join(this.downloadedUpdateHelper.cacheDir, CURRENT_MAC_APP_ZIP_FILE_NAME);
                        await (0, fs_extra_1.copyFile)(event.downloadedFile, cachedUpdateFilePath);
                    }
                    catch (error) {
                        this._logger.warn(`Unable to copy file for caching for future differential downloads: ${error.message}`);
                    }
                }
                return this.updateDownloaded(zipFileInfo, event);
            },
        });
    }
    async updateDownloaded(zipFileInfo, event) {
        var _a;
        const downloadedFile = event.downloadedFile;
        const updateFileSize = (_a = zipFileInfo.info.size) !== null && _a !== void 0 ? _a : (await (0, fs_extra_1.stat)(downloadedFile)).size;
        const log = this._logger;
        const logContext = `fileToProxy=${zipFileInfo.url.href}`;
        this.closeServerIfExists();
        this.debug(`Creating proxy server for native Squirrel.Mac (${logContext})`);
        this.server = (0, http_1.createServer)();
        this.debug(`Proxy server for native Squirrel.Mac is created (${logContext})`);
        this.server.on("close", () => {
            log.info(`Proxy server for native Squirrel.Mac is closed (${logContext})`);
        });
        // must be called after server is listening, otherwise address is null
        const getServerUrl = (s) => {
            const address = s.address();
            if (typeof address === "string") {
                return address;
            }
            return `http://127.0.0.1:${address === null || address === void 0 ? void 0 : address.port}`;
        };
        return await new Promise((resolve, reject) => {
            const pass = (0, crypto_1.randomBytes)(64).toString("base64").replace(/\//g, "_").replace(/\+/g, "-");
            const authInfo = Buffer.from(`autoupdater:${pass}`, "ascii");
            // insecure random is ok
            const fileUrl = `/${(0, crypto_1.randomBytes)(64).toString("hex")}.zip`;
            this.server.on("request", (request, response) => {
                const requestUrl = request.url;
                log.info(`${requestUrl} requested`);
                if (requestUrl === "/") {
                    // check for basic auth header
                    if (!request.headers.authorization || request.headers.authorization.indexOf("Basic ") === -1) {
                        response.statusCode = 401;
                        response.statusMessage = "Invalid Authentication Credentials";
                        response.end();
                        log.warn("No authenthication info");
                        return;
                    }
                    // verify auth credentials
                    const base64Credentials = request.headers.authorization.split(" ")[1];
                    const credentials = Buffer.from(base64Credentials, "base64").toString("ascii");
                    const [username, password] = credentials.split(":");
                    if (username !== "autoupdater" || password !== pass) {
                        response.statusCode = 401;
                        response.statusMessage = "Invalid Authentication Credentials";
                        response.end();
                        log.warn("Invalid authenthication credentials");
                        return;
                    }
                    const data = Buffer.from(`{ "url": "${getServerUrl(this.server)}${fileUrl}" }`);
                    response.writeHead(200, { "Content-Type": "application/json", "Content-Length": data.length });
                    response.end(data);
                    return;
                }
                if (!requestUrl.startsWith(fileUrl)) {
                    log.warn(`${requestUrl} requested, but not supported`);
                    response.writeHead(404);
                    response.end();
                    return;
                }
                log.info(`${fileUrl} requested by Squirrel.Mac, pipe ${downloadedFile}`);
                let errorOccurred = false;
                response.on("finish", () => {
                    if (!errorOccurred) {
                        this.nativeUpdater.removeListener("error", reject);
                        resolve([]);
                    }
                });
                const readStream = (0, fs_1.createReadStream)(downloadedFile);
                readStream.on("error", error => {
                    try {
                        response.end();
                    }
                    catch (e) {
                        log.warn(`cannot end response: ${e}`);
                    }
                    errorOccurred = true;
                    this.nativeUpdater.removeListener("error", reject);
                    reject(new Error(`Cannot pipe "${downloadedFile}": ${error}`));
                });
                response.writeHead(200, {
                    "Content-Type": "application/zip",
                    "Content-Length": updateFileSize,
                });
                readStream.pipe(response);
            });
            this.debug(`Proxy server for native Squirrel.Mac is starting to listen (${logContext})`);
            this.server.listen(0, "127.0.0.1", () => {
                this.debug(`Proxy server for native Squirrel.Mac is listening (address=${getServerUrl(this.server)}, ${logContext})`);
                this.nativeUpdater.setFeedURL({
                    url: getServerUrl(this.server),
                    headers: {
                        "Cache-Control": "no-cache",
                        Authorization: `Basic ${authInfo.toString("base64")}`,
                    },
                });
                // The update has been downloaded and is ready to be served to Squirrel
                this.dispatchUpdateDownloaded(event);
                if (this.autoInstallOnAppQuit) {
                    this.nativeUpdater.once("error", reject);
                    // This will trigger fetching and installing the file on Squirrel side
                    this.nativeUpdater.checkForUpdates();
                }
                else {
                    resolve([]);
                }
            });
        });
    }
    handleUpdateDownloaded() {
        if (this.autoRunAppAfterInstall) {
            this.nativeUpdater.quitAndInstall();
        }
        else {
            this.app.quit();
        }
        this.closeServerIfExists();
    }
    quitAndInstall() {
        if (this.squirrelDownloadedUpdate) {
            // update already fetched by Squirrel, it's ready to install
            this.handleUpdateDownloaded();
        }
        else {
            // Quit and install as soon as Squirrel get the update
            this.nativeUpdater.on("update-downloaded", () => this.handleUpdateDownloaded());
            if (!this.autoInstallOnAppQuit) {
                /**
                 * If this was not `true` previously then MacUpdater.doDownloadUpdate()
                 * would not actually initiate the downloading by electron's autoUpdater
                 */
                this.nativeUpdater.checkForUpdates();
            }
        }
    }
}
exports.MacUpdater = MacUpdater;
//# sourceMappingURL=MacUpdater.js.map{"version":3,"file":"MacUpdater.js","sourceRoot":"","sources":["../src/MacUpdater.ts"],"names":[],"mappings":";;;AAAA,+DAAqF;AACrF,uCAAyD;AACzD,2BAAqC;AACrC,6BAA4B;AAC5B,+BAA4E;AAE5E,6CAAgE;AAGhE,mDAA+C;AAE/C,iDAA4C;AAC5C,mCAAoC;AAEpC,MAAa,UAAW,SAAQ,uBAAU;IAOxC,YAAY,OAA2B,EAAE,GAAgB;QACvD,KAAK,CAAC,OAAO,EAAE,GAAG,CAAC,CAAA;QAPJ,kBAAa,GAAgB,OAAO,CAAC,UAAU,CAAC,CAAC,WAAW,CAAA;QAErE,6BAAwB,GAAG,KAAK,CAAA;QAOtC,IAAI,CAAC,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,EAAE;YAClC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;YACrB,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,CAAC,CAAA;QACxB,CAAC,CAAC,CAAA;QACF,IAAI,CAAC,aAAa,CAAC,EAAE,CAAC,mBAAmB,EAAE,GAAG,EAAE;YAC9C,IAAI,CAAC,wBAAwB,GAAG,IAAI,CAAA;YACpC,IAAI,CAAC,KAAK,CAAC,iCAAiC,CAAC,CAAA;QAC/C,CAAC,CAAC,CAAA;IACJ,CAAC;IAED;;gDAE4C;IAClC,MAAM,CAAC,kBAAkB,CAAC,KAA+B,EAAE,UAAmB;QACtF,MAAM,WAAW,GAAG,CAAC,IAA4B,EAAE,EAAE,WAAC,OAAA,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAI,MAAA,IAAI,CAAC,IAAI,CAAC,GAAG,0CAAE,QAAQ,CAAC,OAAO,CAAC,CAAA,CAAA,EAAA,CAAA;QAC7H,IAAI,UAAU,IAAI,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC;YAC1C,OAAO,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,UAAU,KAAK,WAAW,CAAC,IAAI,CAAC,CAAC,CAAA;QAC/D,CAAC;QACD,OAAO,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAA;IACjD,CAAC;IAEO,KAAK,CAAC,OAAe;QAC3B,IAAI,IAAI,CAAC,OAAO,CAAC,KAAK,IAAI,IAAI,EAAE,CAAC;YAC/B,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;QAC7B,CAAC;IACH,CAAC;IAEO,mBAAmB;QACzB,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YAChB,IAAI,CAAC,KAAK,CAAC,sBAAsB,CAAC,CAAA;YAClC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE;gBACtB,IAAI,GAAG,EAAE,CAAC;oBACR,IAAI,CAAC,KAAK,CAAC,kGAAkG,CAAC,CAAA;gBAChH,CAAC;YACH,CAAC,CAAC,CAAA;QACJ,CAAC;IACH,CAAC;IAES,KAAK,CAAC,gBAAgB,CAAC,qBAA4C;QAC3E,IAAI,KAAK,GAAG,qBAAqB,CAAC,qBAAqB,CAAC,QAAQ,CAAC,YAAY,CAAC,qBAAqB,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAA;QAE/H,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAA;QAExB,oDAAoD;QACpD,MAAM,oBAAoB,GAAG,wBAAwB,CAAA;QACrD,IAAI,SAAS,GAAG,KAAK,CAAA;QACrB,IAAI,CAAC;YACH,IAAI,CAAC,KAAK,CAAC,wCAAwC,CAAC,CAAA;YACpD,MAAM,MAAM,GAAG,IAAA,4BAAY,EAAC,QAAQ,EAAE,CAAC,oBAAoB,CAAC,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAA;YACnF,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC,GAAG,oBAAoB,KAAK,CAAC,CAAA;YACzD,GAAG,CAAC,IAAI,CAAC,oDAAoD,SAAS,GAAG,CAAC,CAAA;QAC5E,CAAC;QAAC,OAAO,CAAM,EAAE,CAAC;YAChB,GAAG,CAAC,IAAI,CAAC,uEAAuE,CAAC,EAAE,CAAC,CAAA;QACtF,CAAC;QAED,IAAI,UAAU,GAAG,KAAK,CAAA;QACtB,IAAI,CAAC;YACH,IAAI,CAAC,KAAK,CAAC,6BAA6B,CAAC,CAAA;YACzC,MAAM,MAAM,GAAG,IAAA,4BAAY,EAAC,OAAO,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAA;YAClE,MAAM,KAAK,GAAG,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAA;YACpC,GAAG,CAAC,IAAI,CAAC,6BAA6B,KAAK,EAAE,CAAC,CAAA;YAC9C,UAAU,GAAG,UAAU,IAAI,KAAK,CAAA;QAClC,CAAC;QAAC,OAAO,CAAM,EAAE,CAAC;YAChB,GAAG,CAAC,IAAI,CAAC,kDAAkD,CAAC,EAAE,CAAC,CAAA;QACjE,CAAC;QAED,UAAU,GAAG,UAAU,IAAI,OAAO,CAAC,IAAI,KAAK,OAAO,IAAI,SAAS,CAAA;QAEhE,2HAA2H;QAC3H,KAAK,GAAG,UAAU,CAAC,kBAAkB,CAAC,KAAK,EAAE,UAAU,CAAC,CAAA;QAExD,MAAM,WAAW,GAAG,IAAA,mBAAQ,EAAC,KAAK,EAAE,KAAK,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAA;QAE1D,IAAI,WAAW,IAAI,IAAI,EAAE,CAAC;YACxB,MAAM,IAAA,+BAAQ,EAAC,0BAA0B,IAAA,wCAAiB,EAAC,KAAK,CAAC,EAAE,EAAE,gCAAgC,CAAC,CAAA;QACxG,CAAC;QAED,MAAM,QAAQ,GAAG,qBAAqB,CAAC,qBAAqB,CAAC,QAAQ,CAAA;QACrE,MAAM,6BAA6B,GAAG,YAAY,CAAA;QAElD,OAAO,IAAI,CAAC,eAAe,CAAC;YAC1B,aAAa,EAAE,KAAK;YACpB,QAAQ,EAAE,WAAW;YACrB,qBAAqB;YACrB,IAAI,EAAE,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,EAAE;gBAC/C,MAAM,oBAAoB,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,sBAAuB,CAAC,QAAQ,EAAE,6BAA6B,CAAC,CAAA;gBAC5G,MAAM,uBAAuB,GAAG,GAAG,EAAE;oBACnC,IAAI,CAAC,IAAA,yBAAc,EAAC,oBAAoB,CAAC,EAAE,CAAC;wBAC1C,GAAG,CAAC,IAAI,CAAC,wHAAwH,CAAC,CAAA;wBAClI,OAAO,KAAK,CAAA;oBACd,CAAC;oBACD,OAAO,CAAC,qBAAqB,CAAC,2BAA2B,CAAA;gBAC3D,CAAC,CAAA;gBACD,IAAI,0BAA0B,GAAG,IAAI,CAAA;gBACrC,IAAI,uBAAuB,EAAE,EAAE,CAAC;oBAC9B,0BAA0B,GAAG,MAAM,IAAI,CAAC,6BAA6B,CAAC,WAAW,EAAE,qBAAqB,EAAE,eAAe,EAAE,QAAQ,EAAE,6BAA6B,CAAC,CAAA;gBACrK,CAAC;gBAED,IAAI,0BAA0B,EAAE,CAAC;oBAC/B,MAAM,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,WAAW,CAAC,GAAG,EAAE,eAAe,EAAE,eAAe,CAAC,CAAA;gBACrF,CAAC;YACH,CAAC;YACD,IAAI,EAAE,KAAK,EAAC,KAAK,EAAC,EAAE;gBAClB,IAAI,CAAC,qBAAqB,CAAC,2BAA2B,EAAE,CAAC;oBACvD,IAAI,CAAC;wBACH,MAAM,oBAAoB,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,sBAAuB,CAAC,QAAQ,EAAE,6BAA6B,CAAC,CAAA;wBAC5G,MAAM,IAAA,mBAAQ,EAAC,KAAK,CAAC,cAAc,EAAE,oBAAoB,CAAC,CAAA;oBAC5D,CAAC;oBAAC,OAAO,KAAU,EAAE,CAAC;wBACpB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,sEAAsE,KAAK,CAAC,OAAO,EAAE,CAAC,CAAA;oBAC1G,CAAC;gBACH,CAAC;gBACD,OAAO,IAAI,CAAC,gBAAgB,CAAC,WAAW,EAAE,KAAK,CAAC,CAAA;YAClD,CAAC;SACF,CAAC,CAAA;IACJ,CAAC;IAEO,KAAK,CAAC,gBAAgB,CAAC,WAAmC,EAAE,KAA4B;;QAC9F,MAAM,cAAc,GAAG,KAAK,CAAC,cAAc,CAAA;QAC3C,MAAM,cAAc,GAAG,MAAA,WAAW,CAAC,IAAI,CAAC,IAAI,mCAAI,CAAC,MAAM,IAAA,eAAI,EAAC,cAAc,CAAC,CAAC,CAAC,IAAI,CAAA;QAEjF,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAA;QACxB,MAAM,UAAU,GAAG,eAAe,WAAW,CAAC,GAAG,CAAC,IAAI,EAAE,CAAA;QACxD,IAAI,CAAC,mBAAmB,EAAE,CAAA;QAC1B,IAAI,CAAC,KAAK,CAAC,kDAAkD,UAAU,GAAG,CAAC,CAAA;QAC3E,IAAI,CAAC,MAAM,GAAG,IAAA,mBAAY,GAAE,CAAA;QAC5B,IAAI,CAAC,KAAK,CAAC,oDAAoD,UAAU,GAAG,CAAC,CAAA;QAC7E,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE;YAC3B,GAAG,CAAC,IAAI,CAAC,mDAAmD,UAAU,GAAG,CAAC,CAAA;QAC5E,CAAC,CAAC,CAAA;QAEF,sEAAsE;QACtE,MAAM,YAAY,GAAG,CAAC,CAAS,EAAU,EAAE;YACzC,MAAM,OAAO,GAAG,CAAC,CAAC,OAAO,EAAE,CAAA;YAC3B,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;gBAChC,OAAO,OAAO,CAAA;YAChB,CAAC;YACD,OAAO,oBAAoB,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,EAAE,CAAA;QAC5C,CAAC,CAAA;QAED,OAAO,MAAM,IAAI,OAAO,CAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YAC1D,MAAM,IAAI,GAAG,IAAA,oBAAW,EAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAA;YACvF,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,eAAe,IAAI,EAAE,EAAE,OAAO,CAAC,CAAA;YAE5D,wBAAwB;YACxB,MAAM,OAAO,GAAG,IAAI,IAAA,oBAAW,EAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAA;YACzD,IAAI,CAAC,MAAO,CAAC,EAAE,CAAC,SAAS,EAAE,CAAC,OAAwB,EAAE,QAAwB,EAAE,EAAE;gBAChF,MAAM,UAAU,GAAG,OAAO,CAAC,GAAI,CAAA;gBAC/B,GAAG,CAAC,IAAI,CAAC,GAAG,UAAU,YAAY,CAAC,CAAA;gBACnC,IAAI,UAAU,KAAK,GAAG,EAAE,CAAC;oBACvB,8BAA8B;oBAC9B,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,aAAa,IAAI,OAAO,CAAC,OAAO,CAAC,aAAa,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC;wBAC7F,QAAQ,CAAC,UAAU,GAAG,GAAG,CAAA;wBACzB,QAAQ,CAAC,aAAa,GAAG,oCAAoC,CAAA;wBAC7D,QAAQ,CAAC,GAAG,EAAE,CAAA;wBACd,GAAG,CAAC,IAAI,CAAC,yBAAyB,CAAC,CAAA;wBACnC,OAAM;oBACR,CAAC;oBAED,0BAA0B;oBAC1B,MAAM,iBAAiB,GAAG,OAAO,CAAC,OAAO,CAAC,aAAa,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAA;oBACrE,MAAM,WAAW,GAAG,MAAM,CAAC,IAAI,CAAC,iBAAiB,EAAE,QAAQ,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAA;oBAC9E,MAAM,CAAC,QAAQ,EAAE,QAAQ,CAAC,GAAG,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;oBACnD,IAAI,QAAQ,KAAK,aAAa,IAAI,QAAQ,KAAK,IAAI,EAAE,CAAC;wBACpD,QAAQ,CAAC,UAAU,GAAG,GAAG,CAAA;wBACzB,QAAQ,CAAC,aAAa,GAAG,oCAAoC,CAAA;wBAC7D,QAAQ,CAAC,GAAG,EAAE,CAAA;wBACd,GAAG,CAAC,IAAI,CAAC,qCAAqC,CAAC,CAAA;wBAC/C,OAAM;oBACR,CAAC;oBAED,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,aAAa,YAAY,CAAC,IAAI,CAAC,MAAO,CAAC,GAAG,OAAO,KAAK,CAAC,CAAA;oBAChF,QAAQ,CAAC,SAAS,CAAC,GAAG,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,CAAA;oBAC9F,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;oBAClB,OAAM;gBACR,CAAC;gBAED,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;oBACpC,GAAG,CAAC,IAAI,CAAC,GAAG,UAAU,+BAA+B,CAAC,CAAA;oBACtD,QAAQ,CAAC,SAAS,CAAC,GAAG,CAAC,CAAA;oBACvB,QAAQ,CAAC,GAAG,EAAE,CAAA;oBACd,OAAM;gBACR,CAAC;gBAED,GAAG,CAAC,IAAI,CAAC,GAAG,OAAO,oCAAoC,cAAc,EAAE,CAAC,CAAA;gBAExE,IAAI,aAAa,GAAG,KAAK,CAAA;gBACzB,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,GAAG,EAAE;oBACzB,IAAI,CAAC,aAAa,EAAE,CAAC;wBACnB,IAAI,CAAC,aAAa,CAAC,cAAc,CAAC,OAAO,EAAE,MAAM,CAAC,CAAA;wBAClD,OAAO,CAAC,EAAE,CAAC,CAAA;oBACb,CAAC;gBACH,CAAC,CAAC,CAAA;gBAEF,MAAM,UAAU,GAAG,IAAA,qBAAgB,EAAC,cAAc,CAAC,CAAA;gBACnD,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,KAAK,CAAC,EAAE;oBAC7B,IAAI,CAAC;wBACH,QAAQ,CAAC,GAAG,EAAE,CAAA;oBAChB,CAAC;oBAAC,OAAO,CAAM,EAAE,CAAC;wBAChB,GAAG,CAAC,IAAI,CAAC,wBAAwB,CAAC,EAAE,CAAC,CAAA;oBACvC,CAAC;oBACD,aAAa,GAAG,IAAI,CAAA;oBACpB,IAAI,CAAC,aAAa,CAAC,cAAc,CAAC,OAAO,EAAE,MAAM,CAAC,CAAA;oBAClD,MAAM,CAAC,IAAI,KAAK,CAAC,gBAAgB,cAAc,MAAM,KAAK,EAAE,CAAC,CAAC,CAAA;gBAChE,CAAC,CAAC,CAAA;gBAEF,QAAQ,CAAC,SAAS,CAAC,GAAG,EAAE;oBACtB,cAAc,EAAE,iBAAiB;oBACjC,gBAAgB,EAAE,cAAc;iBACjC,CAAC,CAAA;gBACF,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;YAC3B,CAAC,CAAC,CAAA;YAEF,IAAI,CAAC,KAAK,CAAC,+DAA+D,UAAU,GAAG,CAAC,CAAA;YAExF,IAAI,CAAC,MAAO,CAAC,MAAM,CAAC,CAAC,EAAE,WAAW,EAAE,GAAG,EAAE;gBACvC,IAAI,CAAC,KAAK,CAAC,8DAA8D,YAAY,CAAC,IAAI,CAAC,MAAO,CAAC,KAAK,UAAU,GAAG,CAAC,CAAA;gBACtH,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC;oBAC5B,GAAG,EAAE,YAAY,CAAC,IAAI,CAAC,MAAO,CAAC;oBAC/B,OAAO,EAAE;wBACP,eAAe,EAAE,UAAU;wBAC3B,aAAa,EAAE,SAAS,QAAQ,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE;qBACtD;iBACF,CAAC,CAAA;gBAEF,uEAAuE;gBACvE,IAAI,CAAC,wBAAwB,CAAC,KAAK,CAAC,CAAA;gBAEpC,IAAI,IAAI,CAAC,oBAAoB,EAAE,CAAC;oBAC9B,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CAAA;oBACxC,sEAAsE;oBACtE,IAAI,CAAC,aAAa,CAAC,eAAe,EAAE,CAAA;gBACtC,CAAC;qBAAM,CAAC;oBACN,OAAO,CAAC,EAAE,CAAC,CAAA;gBACb,CAAC;YACH,CAAC,CAAC,CAAA;QACJ,CAAC,CAAC,CAAA;IACJ,CAAC;IAEO,sBAAsB;QAC5B,IAAI,IAAI,CAAC,sBAAsB,EAAE,CAAC;YAChC,IAAI,CAAC,aAAa,CAAC,cAAc,EAAE,CAAA;QACrC,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,CAAA;QACjB,CAAC;QACD,IAAI,CAAC,mBAAmB,EAAE,CAAA;IAC5B,CAAC;IAED,cAAc;QACZ,IAAI,IAAI,CAAC,wBAAwB,EAAE,CAAC;YAClC,4DAA4D;YAC5D,IAAI,CAAC,sBAAsB,EAAE,CAAA;QAC/B,CAAC;aAAM,CAAC;YACN,sDAAsD;YACtD,IAAI,CAAC,aAAa,CAAC,EAAE,CAAC,mBAAmB,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,sBAAsB,EAAE,CAAC,CAAA;YAE/E,IAAI,CAAC,IAAI,CAAC,oBAAoB,EAAE,CAAC;gBAC/B;;;mBAGG;gBACH,IAAI,CAAC,aAAa,CAAC,eAAe,EAAE,CAAA;YACtC,CAAC;QACH,CAAC;IACH,CAAC;CACF;AAlRD,gCAkRC","sourcesContent":["import { AllPublishOptions, newError, safeStringifyJson } from \"builder-util-runtime\"\nimport { pathExistsSync, stat, copyFile } from \"fs-extra\"\nimport { createReadStream } from \"fs\"\nimport * as path from \"path\"\nimport { createServer, IncomingMessage, Server, ServerResponse } from \"http\"\nimport { AppAdapter } from \"./AppAdapter\"\nimport { AppUpdater, DownloadUpdateOptions } from \"./AppUpdater\"\nimport { ResolvedUpdateFileInfo } from \"./main\"\nimport { UpdateDownloadedEvent } from \"./types\"\nimport { findFile } from \"./providers/Provider\"\nimport AutoUpdater = Electron.AutoUpdater\nimport { execFileSync } from \"child_process\"\nimport { randomBytes } from \"crypto\"\n\nexport class MacUpdater extends AppUpdater {\n  private readonly nativeUpdater: AutoUpdater = require(\"electron\").autoUpdater\n\n  private squirrelDownloadedUpdate = false\n\n  private server?: Server\n\n  constructor(options?: AllPublishOptions, app?: AppAdapter) {\n    super(options, app)\n\n    this.nativeUpdater.on(\"error\", it => {\n      this._logger.warn(it)\n      this.emit(\"error\", it)\n    })\n    this.nativeUpdater.on(\"update-downloaded\", () => {\n      this.squirrelDownloadedUpdate = true\n      this.debug(\"nativeUpdater.update-downloaded\")\n    })\n  }\n\n  /** Filters update files to the appropriate architecture.\n   * On arm64 Macs (including Rosetta), arm64 files are preferred when available.\n   * On x64 Macs, arm64 files are excluded. */\n  protected static filterFilesForArch(files: ResolvedUpdateFileInfo[], isArm64Mac: boolean): ResolvedUpdateFileInfo[] {\n    const isArm64File = (file: ResolvedUpdateFileInfo) => file.url.pathname.includes(\"arm64\") || file.info.url?.includes(\"arm64\")\n    if (isArm64Mac && files.some(isArm64File)) {\n      return files.filter(file => isArm64Mac === isArm64File(file))\n    }\n    return files.filter(file => !isArm64File(file))\n  }\n\n  private debug(message: string): void {\n    if (this._logger.debug != null) {\n      this._logger.debug(message)\n    }\n  }\n\n  private closeServerIfExists() {\n    if (this.server) {\n      this.debug(\"Closing proxy server\")\n      this.server.close(err => {\n        if (err) {\n          this.debug(\"proxy server wasn't already open, probably attempted closing again as a safety check before quit\")\n        }\n      })\n    }\n  }\n\n  protected async doDownloadUpdate(downloadUpdateOptions: DownloadUpdateOptions): Promise<Array<string>> {\n    let files = downloadUpdateOptions.updateInfoAndProvider.provider.resolveFiles(downloadUpdateOptions.updateInfoAndProvider.info)\n\n    const log = this._logger\n\n    // detect if we are running inside Rosetta emulation\n    const sysctlRosettaInfoKey = \"sysctl.proc_translated\"\n    let isRosetta = false\n    try {\n      this.debug(\"Checking for macOS Rosetta environment\")\n      const result = execFileSync(\"sysctl\", [sysctlRosettaInfoKey], { encoding: \"utf8\" })\n      isRosetta = result.includes(`${sysctlRosettaInfoKey}: 1`)\n      log.info(`Checked for macOS Rosetta environment (isRosetta=${isRosetta})`)\n    } catch (e: any) {\n      log.warn(`sysctl shell command to check for macOS Rosetta environment failed: ${e}`)\n    }\n\n    let isArm64Mac = false\n    try {\n      this.debug(\"Checking for arm64 in uname\")\n      const result = execFileSync(\"uname\", [\"-a\"], { encoding: \"utf8\" })\n      const isArm = result.includes(\"ARM\")\n      log.info(`Checked 'uname -a': arm64=${isArm}`)\n      isArm64Mac = isArm64Mac || isArm\n    } catch (e: any) {\n      log.warn(`uname shell command to check for arm64 failed: ${e}`)\n    }\n\n    isArm64Mac = isArm64Mac || process.arch === \"arm64\" || isRosetta\n\n    // allow arm64 macs to install universal or rosetta2(x64) - https://github.com/electron-userland/electron-builder/pull/5524\n    files = MacUpdater.filterFilesForArch(files, isArm64Mac)\n\n    const zipFileInfo = findFile(files, \"zip\", [\"pkg\", \"dmg\"])\n\n    if (zipFileInfo == null) {\n      throw newError(`ZIP file not provided: ${safeStringifyJson(files)}`, \"ERR_UPDATER_ZIP_FILE_NOT_FOUND\")\n    }\n\n    const provider = downloadUpdateOptions.updateInfoAndProvider.provider\n    const CURRENT_MAC_APP_ZIP_FILE_NAME = \"update.zip\"\n\n    return this.executeDownload({\n      fileExtension: \"zip\",\n      fileInfo: zipFileInfo,\n      downloadUpdateOptions,\n      task: async (destinationFile, downloadOptions) => {\n        const cachedUpdateFilePath = path.join(this.downloadedUpdateHelper!.cacheDir, CURRENT_MAC_APP_ZIP_FILE_NAME)\n        const canDifferentialDownload = () => {\n          if (!pathExistsSync(cachedUpdateFilePath)) {\n            log.info(\"Unable to locate previous update.zip for differential download (is this first install?), falling back to full download\")\n            return false\n          }\n          return !downloadUpdateOptions.disableDifferentialDownload\n        }\n        let differentialDownloadFailed = true\n        if (canDifferentialDownload()) {\n          differentialDownloadFailed = await this.differentialDownloadInstaller(zipFileInfo, downloadUpdateOptions, destinationFile, provider, CURRENT_MAC_APP_ZIP_FILE_NAME)\n        }\n\n        if (differentialDownloadFailed) {\n          await this.httpExecutor.download(zipFileInfo.url, destinationFile, downloadOptions)\n        }\n      },\n      done: async event => {\n        if (!downloadUpdateOptions.disableDifferentialDownload) {\n          try {\n            const cachedUpdateFilePath = path.join(this.downloadedUpdateHelper!.cacheDir, CURRENT_MAC_APP_ZIP_FILE_NAME)\n            await copyFile(event.downloadedFile, cachedUpdateFilePath)\n          } catch (error: any) {\n            this._logger.warn(`Unable to copy file for caching for future differential downloads: ${error.message}`)\n          }\n        }\n        return this.updateDownloaded(zipFileInfo, event)\n      },\n    })\n  }\n\n  private async updateDownloaded(zipFileInfo: ResolvedUpdateFileInfo, event: UpdateDownloadedEvent): Promise<Array<string>> {\n    const downloadedFile = event.downloadedFile\n    const updateFileSize = zipFileInfo.info.size ?? (await stat(downloadedFile)).size\n\n    const log = this._logger\n    const logContext = `fileToProxy=${zipFileInfo.url.href}`\n    this.closeServerIfExists()\n    this.debug(`Creating proxy server for native Squirrel.Mac (${logContext})`)\n    this.server = createServer()\n    this.debug(`Proxy server for native Squirrel.Mac is created (${logContext})`)\n    this.server.on(\"close\", () => {\n      log.info(`Proxy server for native Squirrel.Mac is closed (${logContext})`)\n    })\n\n    // must be called after server is listening, otherwise address is null\n    const getServerUrl = (s: Server): string => {\n      const address = s.address()\n      if (typeof address === \"string\") {\n        return address\n      }\n      return `http://127.0.0.1:${address?.port}`\n    }\n\n    return await new Promise<Array<string>>((resolve, reject) => {\n      const pass = randomBytes(64).toString(\"base64\").replace(/\\//g, \"_\").replace(/\\+/g, \"-\")\n      const authInfo = Buffer.from(`autoupdater:${pass}`, \"ascii\")\n\n      // insecure random is ok\n      const fileUrl = `/${randomBytes(64).toString(\"hex\")}.zip`\n      this.server!.on(\"request\", (request: IncomingMessage, response: ServerResponse) => {\n        const requestUrl = request.url!\n        log.info(`${requestUrl} requested`)\n        if (requestUrl === \"/\") {\n          // check for basic auth header\n          if (!request.headers.authorization || request.headers.authorization.indexOf(\"Basic \") === -1) {\n            response.statusCode = 401\n            response.statusMessage = \"Invalid Authentication Credentials\"\n            response.end()\n            log.warn(\"No authenthication info\")\n            return\n          }\n\n          // verify auth credentials\n          const base64Credentials = request.headers.authorization.split(\" \")[1]\n          const credentials = Buffer.from(base64Credentials, \"base64\").toString(\"ascii\")\n          const [username, password] = credentials.split(\":\")\n          if (username !== \"autoupdater\" || password !== pass) {\n            response.statusCode = 401\n            response.statusMessage = \"Invalid Authentication Credentials\"\n            response.end()\n            log.warn(\"Invalid authenthication credentials\")\n            return\n          }\n\n          const data = Buffer.from(`{ \"url\": \"${getServerUrl(this.server!)}${fileUrl}\" }`)\n          response.writeHead(200, { \"Content-Type\": \"application/json\", \"Content-Length\": data.length })\n          response.end(data)\n          return\n        }\n\n        if (!requestUrl.startsWith(fileUrl)) {\n          log.warn(`${requestUrl} requested, but not supported`)\n          response.writeHead(404)\n          response.end()\n          return\n        }\n\n        log.info(`${fileUrl} requested by Squirrel.Mac, pipe ${downloadedFile}`)\n\n        let errorOccurred = false\n        response.on(\"finish\", () => {\n          if (!errorOccurred) {\n            this.nativeUpdater.removeListener(\"error\", reject)\n            resolve([])\n          }\n        })\n\n        const readStream = createReadStream(downloadedFile)\n        readStream.on(\"error\", error => {\n          try {\n            response.end()\n          } catch (e: any) {\n            log.warn(`cannot end response: ${e}`)\n          }\n          errorOccurred = true\n          this.nativeUpdater.removeListener(\"error\", reject)\n          reject(new Error(`Cannot pipe \"${downloadedFile}\": ${error}`))\n        })\n\n        response.writeHead(200, {\n          \"Content-Type\": \"application/zip\",\n          \"Content-Length\": updateFileSize,\n        })\n        readStream.pipe(response)\n      })\n\n      this.debug(`Proxy server for native Squirrel.Mac is starting to listen (${logContext})`)\n\n      this.server!.listen(0, \"127.0.0.1\", () => {\n        this.debug(`Proxy server for native Squirrel.Mac is listening (address=${getServerUrl(this.server!)}, ${logContext})`)\n        this.nativeUpdater.setFeedURL({\n          url: getServerUrl(this.server!),\n          headers: {\n            \"Cache-Control\": \"no-cache\",\n            Authorization: `Basic ${authInfo.toString(\"base64\")}`,\n          },\n        })\n\n        // The update has been downloaded and is ready to be served to Squirrel\n        this.dispatchUpdateDownloaded(event)\n\n        if (this.autoInstallOnAppQuit) {\n          this.nativeUpdater.once(\"error\", reject)\n          // This will trigger fetching and installing the file on Squirrel side\n          this.nativeUpdater.checkForUpdates()\n        } else {\n          resolve([])\n        }\n      })\n    })\n  }\n\n  private handleUpdateDownloaded() {\n    if (this.autoRunAppAfterInstall) {\n      this.nativeUpdater.quitAndInstall()\n    } else {\n      this.app.quit()\n    }\n    this.closeServerIfExists()\n  }\n\n  quitAndInstall(): void {\n    if (this.squirrelDownloadedUpdate) {\n      // update already fetched by Squirrel, it's ready to install\n      this.handleUpdateDownloaded()\n    } else {\n      // Quit and install as soon as Squirrel get the update\n      this.nativeUpdater.on(\"update-downloaded\", () => this.handleUpdateDownloaded())\n\n      if (!this.autoInstallOnAppQuit) {\n        /**\n         * If this was not `true` previously then MacUpdater.doDownloadUpdate()\n         * would not actually initiate the downloading by electron's autoUpdater\n         */\n        this.nativeUpdater.checkForUpdates()\n      }\n    }\n  }\n}\n"]}"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.NsisUpdater = void 0;
const builder_util_runtime_1 = require("builder-util-runtime");
const path = require("path");
const BaseUpdater_1 = require("./BaseUpdater");
const FileWithEmbeddedBlockMapDifferentialDownloader_1 = require("./differentialDownloader/FileWithEmbeddedBlockMapDifferentialDownloader");
const types_1 = require("./types");
const Provider_1 = require("./providers/Provider");
const fs_extra_1 = require("fs-extra");
const windowsExecutableCodeSignatureVerifier_1 = require("./windowsExecutableCodeSignatureVerifier");
const url_1 = require("url");
class NsisUpdater extends BaseUpdater_1.BaseUpdater {
    constructor(options, app) {
        super(options, app);
        this._verifyUpdateCodeSignature = (publisherNames, unescapedTempUpdateFile) => (0, windowsExecutableCodeSignatureVerifier_1.verifySignature)(publisherNames, unescapedTempUpdateFile, this._logger);
    }
    /**
     * The verifyUpdateCodeSignature. You can pass [win-verify-signature](https://github.com/beyondkmp/win-verify-trust) or another custom verify function: ` (publisherName: string[], path: string) => Promise<string | null>`.
     * The default verify function uses [windowsExecutableCodeSignatureVerifier](https://github.com/electron-userland/electron-builder/blob/master/packages/electron-updater/src/windowsExecutableCodeSignatureVerifier.ts)
     */
    get verifyUpdateCodeSignature() {
        return this._verifyUpdateCodeSignature;
    }
    set verifyUpdateCodeSignature(value) {
        if (value) {
            this._verifyUpdateCodeSignature = value;
        }
    }
    /*** @private */
    doDownloadUpdate(downloadUpdateOptions) {
        const provider = downloadUpdateOptions.updateInfoAndProvider.provider;
        const fileInfo = (0, Provider_1.findFile)(provider.resolveFiles(downloadUpdateOptions.updateInfoAndProvider.info), "exe");
        return this.executeDownload({
            fileExtension: "exe",
            downloadUpdateOptions,
            fileInfo,
            task: async (destinationFile, downloadOptions, packageFile, removeTempDirIfAny) => {
                const packageInfo = fileInfo.packageInfo;
                const isWebInstaller = packageInfo != null && packageFile != null;
                if (isWebInstaller && downloadUpdateOptions.disableWebInstaller) {
                    throw (0, builder_util_runtime_1.newError)(`Unable to download new version ${downloadUpdateOptions.updateInfoAndProvider.info.version}. Web Installers are disabled`, "ERR_UPDATER_WEB_INSTALLER_DISABLED");
                }
                if (!isWebInstaller && !downloadUpdateOptions.disableWebInstaller) {
                    this._logger.warn("disableWebInstaller is set to false, you should set it to true if you do not plan on using a web installer. This will default to true in a future version.");
                }
                if (isWebInstaller ||
                    downloadUpdateOptions.disableDifferentialDownload ||
                    (await this.differentialDownloadInstaller(fileInfo, downloadUpdateOptions, destinationFile, provider, builder_util_runtime_1.CURRENT_APP_INSTALLER_FILE_NAME))) {
                    await this.httpExecutor.download(fileInfo.url, destinationFile, downloadOptions);
                }
                const signatureVerificationStatus = await this.verifySignature(destinationFile);
                if (signatureVerificationStatus != null) {
                    await removeTempDirIfAny();
                    // noinspection ThrowInsideFinallyBlockJS
                    throw (0, builder_util_runtime_1.newError)(`New version ${downloadUpdateOptions.updateInfoAndProvider.info.version} is not signed by the application owner: ${signatureVerificationStatus}`, "ERR_UPDATER_INVALID_SIGNATURE");
                }
                if (isWebInstaller) {
                    if (await this.differentialDownloadWebPackage(downloadUpdateOptions, packageInfo, packageFile, provider)) {
                        try {
                            await this.httpExecutor.download(new url_1.URL(packageInfo.path), packageFile, {
                                headers: downloadUpdateOptions.requestHeaders,
                                cancellationToken: downloadUpdateOptions.cancellationToken,
                                sha512: packageInfo.sha512,
                            });
                        }
                        catch (e) {
                            try {
                                await (0, fs_extra_1.unlink)(packageFile);
                            }
                            catch (_ignored) {
                                // ignore
                            }
                            throw e;
                        }
                    }
                }
            },
        });
    }
    // $certificateInfo = (Get-AuthenticodeSignature 'xxx\yyy.exe'
    // | where {$_.Status.Equals([System.Management.Automation.SignatureStatus]::Valid) -and $_.SignerCertificate.Subject.Contains("CN=siemens.com")})
    // | Out-String ; if ($certificateInfo) { exit 0 } else { exit 1 }
    async verifySignature(tempUpdateFile) {
        let publisherName;
        try {
            publisherName = (await this.configOnDisk.value).publisherName;
            if (publisherName == null) {
                return null;
            }
        }
        catch (e) {
            if (e.code === "ENOENT") {
                // no app-update.yml
                return null;
            }
            throw e;
        }
        return await this._verifyUpdateCodeSignature(Array.isArray(publisherName) ? publisherName : [publisherName], tempUpdateFile);
    }
    doInstall(options) {
        const installerPath = this.installerPath;
        if (installerPath == null) {
            this.dispatchError(new Error("No update filepath provided, can't quit and install"));
            return false;
        }
        const args = ["--updated"];
        if (options.isSilent) {
            args.push("/S");
        }
        if (options.isForceRunAfter) {
            args.push("--force-run");
        }
        if (this.installDirectory) {
            // maybe check if folder exists
            args.push(`/D=${this.installDirectory}`);
        }
        const packagePath = this.downloadedUpdateHelper == null ? null : this.downloadedUpdateHelper.packageFile;
        if (packagePath != null) {
            // only = form is supported
            args.push(`--package-file=${packagePath}`);
        }
        const callUsingElevation = () => {
            this.spawnLog(path.join(process.resourcesPath, "elevate.exe"), [installerPath].concat(args)).catch(e => this.dispatchError(e));
        };
        if (options.isAdminRightsRequired) {
            this._logger.info("isAdminRightsRequired is set to true, run installer using elevate.exe");
            callUsingElevation();
            return true;
        }
        this.spawnLog(installerPath, args).catch((e) => {
            // https://github.com/electron-userland/electron-builder/issues/1129
            // Node 8 sends errors: https://nodejs.org/dist/latest-v8.x/docs/api/errors.html#errors_common_system_errors
            const errorCode = e.code;
            this._logger.info(`Cannot run installer: error code: ${errorCode}, error message: "${e.message}", will be executed again using elevate if EACCES, and will try to use electron.shell.openItem if ENOENT`);
            if (errorCode === "UNKNOWN" || errorCode === "EACCES") {
                callUsingElevation();
            }
            else if (errorCode === "ENOENT") {
                require("electron")
                    .shell.openPath(installerPath)
                    .catch((err) => this.dispatchError(err));
            }
            else {
                this.dispatchError(e);
            }
        });
        return true;
    }
    async differentialDownloadWebPackage(downloadUpdateOptions, packageInfo, packagePath, provider) {
        if (packageInfo.blockMapSize == null) {
            return true;
        }
        try {
            const downloadOptions = {
                newUrl: new url_1.URL(packageInfo.path),
                oldFile: path.join(this.downloadedUpdateHelper.cacheDir, builder_util_runtime_1.CURRENT_APP_PACKAGE_FILE_NAME),
                logger: this._logger,
                newFile: packagePath,
                requestHeaders: this.requestHeaders,
                isUseMultipleRangeRequest: provider.isUseMultipleRangeRequest,
                cancellationToken: downloadUpdateOptions.cancellationToken,
            };
            if (this.listenerCount(types_1.DOWNLOAD_PROGRESS) > 0) {
                downloadOptions.onProgress = it => this.emit(types_1.DOWNLOAD_PROGRESS, it);
            }
            await new FileWithEmbeddedBlockMapDifferentialDownloader_1.FileWithEmbeddedBlockMapDifferentialDownloader(packageInfo, this.httpExecutor, downloadOptions).download();
        }
        catch (e) {
            this._logger.error(`Cannot download differentially, fallback to full download: ${e.stack || e}`);
            // during test (developer machine mac or linux) we must throw error
            return process.platform === "win32";
        }
        return false;
    }
}
exports.NsisUpdater = NsisUpdater;
//# sourceMappingURL=NsisUpdater.js.map{"version":3,"file":"NsisUpdater.js","sourceRoot":"","sources":["../src/NsisUpdater.ts"],"names":[],"mappings":";;;AAAA,+DAAmJ;AACnJ,6BAA4B;AAG5B,+CAA2D;AAE3D,4IAAwI;AACxI,mCAA2C;AAE3C,mDAAyD;AACzD,uCAAiC;AACjC,qGAA0E;AAC1E,6BAAyB;AAEzB,MAAa,WAAY,SAAQ,yBAAW;IAO1C,YAAY,OAAkC,EAAE,GAAgB;QAC9D,KAAK,CAAC,OAAO,EAAE,GAAG,CAAC,CAAA;QAGX,+BAA0B,GAA8B,CAAC,cAA6B,EAAE,uBAA+B,EAAE,EAAE,CACnI,IAAA,wDAAe,EAAC,cAAc,EAAE,uBAAuB,EAAE,IAAI,CAAC,OAAO,CAAC,CAAA;IAHxE,CAAC;IAKD;;;OAGG;IACH,IAAI,yBAAyB;QAC3B,OAAO,IAAI,CAAC,0BAA0B,CAAA;IACxC,CAAC;IAED,IAAI,yBAAyB,CAAC,KAAgC;QAC5D,IAAI,KAAK,EAAE,CAAC;YACV,IAAI,CAAC,0BAA0B,GAAG,KAAK,CAAA;QACzC,CAAC;IACH,CAAC;IAED,gBAAgB;IACN,gBAAgB,CAAC,qBAA4C;QACrE,MAAM,QAAQ,GAAG,qBAAqB,CAAC,qBAAqB,CAAC,QAAQ,CAAA;QACrE,MAAM,QAAQ,GAAG,IAAA,mBAAQ,EAAC,QAAQ,CAAC,YAAY,CAAC,qBAAqB,CAAC,qBAAqB,CAAC,IAAI,CAAC,EAAE,KAAK,CAAE,CAAA;QAC1G,OAAO,IAAI,CAAC,eAAe,CAAC;YAC1B,aAAa,EAAE,KAAK;YACpB,qBAAqB;YACrB,QAAQ;YACR,IAAI,EAAE,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,WAAW,EAAE,kBAAkB,EAAE,EAAE;gBAChF,MAAM,WAAW,GAAG,QAAQ,CAAC,WAAW,CAAA;gBACxC,MAAM,cAAc,GAAG,WAAW,IAAI,IAAI,IAAI,WAAW,IAAI,IAAI,CAAA;gBACjE,IAAI,cAAc,IAAI,qBAAqB,CAAC,mBAAmB,EAAE,CAAC;oBAChE,MAAM,IAAA,+BAAQ,EACZ,kCAAkC,qBAAqB,CAAC,qBAAqB,CAAC,IAAI,CAAC,OAAO,+BAA+B,EACzH,oCAAoC,CACrC,CAAA;gBACH,CAAC;gBACD,IAAI,CAAC,cAAc,IAAI,CAAC,qBAAqB,CAAC,mBAAmB,EAAE,CAAC;oBAClE,IAAI,CAAC,OAAO,CAAC,IAAI,CACf,4JAA4J,CAC7J,CAAA;gBACH,CAAC;gBACD,IACE,cAAc;oBACd,qBAAqB,CAAC,2BAA2B;oBACjD,CAAC,MAAM,IAAI,CAAC,6BAA6B,CAAC,QAAQ,EAAE,qBAAqB,EAAE,eAAe,EAAE,QAAQ,EAAE,sDAA+B,CAAC,CAAC,EACvI,CAAC;oBACD,MAAM,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAAG,EAAE,eAAe,EAAE,eAAe,CAAC,CAAA;gBAClF,CAAC;gBAED,MAAM,2BAA2B,GAAG,MAAM,IAAI,CAAC,eAAe,CAAC,eAAe,CAAC,CAAA;gBAC/E,IAAI,2BAA2B,IAAI,IAAI,EAAE,CAAC;oBACxC,MAAM,kBAAkB,EAAE,CAAA;oBAC1B,yCAAyC;oBACzC,MAAM,IAAA,+BAAQ,EACZ,eAAe,qBAAqB,CAAC,qBAAqB,CAAC,IAAI,CAAC,OAAO,4CAA4C,2BAA2B,EAAE,EAChJ,+BAA+B,CAChC,CAAA;gBACH,CAAC;gBAED,IAAI,cAAc,EAAE,CAAC;oBACnB,IAAI,MAAM,IAAI,CAAC,8BAA8B,CAAC,qBAAqB,EAAE,WAAW,EAAE,WAAW,EAAE,QAAQ,CAAC,EAAE,CAAC;wBACzG,IAAI,CAAC;4BACH,MAAM,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,IAAI,SAAG,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,WAAW,EAAE;gCACvE,OAAO,EAAE,qBAAqB,CAAC,cAAc;gCAC7C,iBAAiB,EAAE,qBAAqB,CAAC,iBAAiB;gCAC1D,MAAM,EAAE,WAAW,CAAC,MAAM;6BAC3B,CAAC,CAAA;wBACJ,CAAC;wBAAC,OAAO,CAAM,EAAE,CAAC;4BAChB,IAAI,CAAC;gCACH,MAAM,IAAA,iBAAM,EAAC,WAAW,CAAC,CAAA;4BAC3B,CAAC;4BAAC,OAAO,QAAQ,EAAE,CAAC;gCAClB,SAAS;4BACX,CAAC;4BAED,MAAM,CAAC,CAAA;wBACT,CAAC;oBACH,CAAC;gBACH,CAAC;YACH,CAAC;SACF,CAAC,CAAA;IACJ,CAAC;IAED,8DAA8D;IAC9D,kJAAkJ;IAClJ,kEAAkE;IAC1D,KAAK,CAAC,eAAe,CAAC,cAAsB;QAClD,IAAI,aAA4C,CAAA;QAChD,IAAI,CAAC;YACH,aAAa,GAAG,CAAC,MAAM,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,aAAa,CAAA;YAC7D,IAAI,aAAa,IAAI,IAAI,EAAE,CAAC;gBAC1B,OAAO,IAAI,CAAA;YACb,CAAC;QACH,CAAC;QAAC,OAAO,CAAM,EAAE,CAAC;YAChB,IAAI,CAAC,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;gBACxB,oBAAoB;gBACpB,OAAO,IAAI,CAAA;YACb,CAAC;YACD,MAAM,CAAC,CAAA;QACT,CAAC;QACD,OAAO,MAAM,IAAI,CAAC,0BAA0B,CAAC,KAAK,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,EAAE,cAAc,CAAC,CAAA;IAC9H,CAAC;IAES,SAAS,CAAC,OAAuB;QACzC,MAAM,aAAa,GAAG,IAAI,CAAC,aAAa,CAAA;QACxC,IAAI,aAAa,IAAI,IAAI,EAAE,CAAC;YAC1B,IAAI,CAAC,aAAa,CAAC,IAAI,KAAK,CAAC,qDAAqD,CAAC,CAAC,CAAA;YACpF,OAAO,KAAK,CAAA;QACd,CAAC;QAED,MAAM,IAAI,GAAG,CAAC,WAAW,CAAC,CAAA;QAC1B,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC;YACrB,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QACjB,CAAC;QAED,IAAI,OAAO,CAAC,eAAe,EAAE,CAAC;YAC5B,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,CAAA;QAC1B,CAAC;QAED,IAAI,IAAI,CAAC,gBAAgB,EAAE,CAAC;YAC1B,+BAA+B;YAC/B,IAAI,CAAC,IAAI,CAAC,MAAM,IAAI,CAAC,gBAAgB,EAAE,CAAC,CAAA;QAC1C,CAAC;QAED,MAAM,WAAW,GAAG,IAAI,CAAC,sBAAsB,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,sBAAsB,CAAC,WAAW,CAAA;QACxG,IAAI,WAAW,IAAI,IAAI,EAAE,CAAC;YACxB,2BAA2B;YAC3B,IAAI,CAAC,IAAI,CAAC,kBAAkB,WAAW,EAAE,CAAC,CAAA;QAC5C,CAAC;QAED,MAAM,kBAAkB,GAAG,GAAS,EAAE;YACpC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,EAAE,aAAa,CAAC,EAAE,CAAC,aAAa,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAA;QAChI,CAAC,CAAA;QAED,IAAI,OAAO,CAAC,qBAAqB,EAAE,CAAC;YAClC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,uEAAuE,CAAC,CAAA;YAC1F,kBAAkB,EAAE,CAAA;YACpB,OAAO,IAAI,CAAA;QACb,CAAC;QAED,IAAI,CAAC,QAAQ,CAAC,aAAa,EAAE,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,CAAQ,EAAE,EAAE;YACpD,oEAAoE;YACpE,4GAA4G;YAC5G,MAAM,SAAS,GAAI,CAA2B,CAAC,IAAI,CAAA;YACnD,IAAI,CAAC,OAAO,CAAC,IAAI,CACf,qCAAqC,SAAS,qBAAqB,CAAC,CAAC,OAAO,0GAA0G,CACvL,CAAA;YACD,IAAI,SAAS,KAAK,SAAS,IAAI,SAAS,KAAK,QAAQ,EAAE,CAAC;gBACtD,kBAAkB,EAAE,CAAA;YACtB,CAAC;iBAAM,IAAI,SAAS,KAAK,QAAQ,EAAE,CAAC;gBAClC,OAAO,CAAC,UAAU,CAAC;qBAChB,KAAK,CAAC,QAAQ,CAAC,aAAa,CAAC;qBAC7B,KAAK,CAAC,CAAC,GAAU,EAAE,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,CAAA;YACnD,CAAC;iBAAM,CAAC;gBACN,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,CAAA;YACvB,CAAC;QACH,CAAC,CAAC,CAAA;QACF,OAAO,IAAI,CAAA;IACb,CAAC;IAEO,KAAK,CAAC,8BAA8B,CAC1C,qBAA4C,EAC5C,WAA4B,EAC5B,WAAmB,EACnB,QAAuB;QAEvB,IAAI,WAAW,CAAC,YAAY,IAAI,IAAI,EAAE,CAAC;YACrC,OAAO,IAAI,CAAA;QACb,CAAC;QAED,IAAI,CAAC;YACH,MAAM,eAAe,GAAkC;gBACrD,MAAM,EAAE,IAAI,SAAG,CAAC,WAAW,CAAC,IAAI,CAAC;gBACjC,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,sBAAuB,CAAC,QAAQ,EAAE,oDAA6B,CAAC;gBACxF,MAAM,EAAE,IAAI,CAAC,OAAO;gBACpB,OAAO,EAAE,WAAW;gBACpB,cAAc,EAAE,IAAI,CAAC,cAAc;gBACnC,yBAAyB,EAAE,QAAQ,CAAC,yBAAyB;gBAC7D,iBAAiB,EAAE,qBAAqB,CAAC,iBAAiB;aAC3D,CAAA;YAED,IAAI,IAAI,CAAC,aAAa,CAAC,yBAAiB,CAAC,GAAG,CAAC,EAAE,CAAC;gBAC9C,eAAe,CAAC,UAAU,GAAG,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,yBAAiB,EAAE,EAAE,CAAC,CAAA;YACrE,CAAC;YAED,MAAM,IAAI,+FAA8C,CAAC,WAAW,EAAE,IAAI,CAAC,YAAY,EAAE,eAAe,CAAC,CAAC,QAAQ,EAAE,CAAA;QACtH,CAAC;QAAC,OAAO,CAAM,EAAE,CAAC;YAChB,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,8DAA8D,CAAC,CAAC,KAAK,IAAI,CAAC,EAAE,CAAC,CAAA;YAChG,mEAAmE;YACnE,OAAO,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAA;QACrC,CAAC;QACD,OAAO,KAAK,CAAA;IACd,CAAC;CACF;AAzMD,kCAyMC","sourcesContent":["import { AllPublishOptions, newError, PackageFileInfo, CURRENT_APP_INSTALLER_FILE_NAME, CURRENT_APP_PACKAGE_FILE_NAME } from \"builder-util-runtime\"\nimport * as path from \"path\"\nimport { AppAdapter } from \"./AppAdapter\"\nimport { DownloadUpdateOptions } from \"./AppUpdater\"\nimport { BaseUpdater, InstallOptions } from \"./BaseUpdater\"\nimport { DifferentialDownloaderOptions } from \"./differentialDownloader/DifferentialDownloader\"\nimport { FileWithEmbeddedBlockMapDifferentialDownloader } from \"./differentialDownloader/FileWithEmbeddedBlockMapDifferentialDownloader\"\nimport { DOWNLOAD_PROGRESS } from \"./types\"\nimport { VerifyUpdateCodeSignature } from \"./main\"\nimport { findFile, Provider } from \"./providers/Provider\"\nimport { unlink } from \"fs-extra\"\nimport { verifySignature } from \"./windowsExecutableCodeSignatureVerifier\"\nimport { URL } from \"url\"\n\nexport class NsisUpdater extends BaseUpdater {\n  /**\n   * Specify custom install directory path\n   *\n   */\n  installDirectory?: string\n\n  constructor(options?: AllPublishOptions | null, app?: AppAdapter) {\n    super(options, app)\n  }\n\n  protected _verifyUpdateCodeSignature: VerifyUpdateCodeSignature = (publisherNames: Array<string>, unescapedTempUpdateFile: string) =>\n    verifySignature(publisherNames, unescapedTempUpdateFile, this._logger)\n\n  /**\n   * The verifyUpdateCodeSignature. You can pass [win-verify-signature](https://github.com/beyondkmp/win-verify-trust) or another custom verify function: ` (publisherName: string[], path: string) => Promise<string | null>`.\n   * The default verify function uses [windowsExecutableCodeSignatureVerifier](https://github.com/electron-userland/electron-builder/blob/master/packages/electron-updater/src/windowsExecutableCodeSignatureVerifier.ts)\n   */\n  get verifyUpdateCodeSignature(): VerifyUpdateCodeSignature {\n    return this._verifyUpdateCodeSignature\n  }\n\n  set verifyUpdateCodeSignature(value: VerifyUpdateCodeSignature) {\n    if (value) {\n      this._verifyUpdateCodeSignature = value\n    }\n  }\n\n  /*** @private */\n  protected doDownloadUpdate(downloadUpdateOptions: DownloadUpdateOptions): Promise<Array<string>> {\n    const provider = downloadUpdateOptions.updateInfoAndProvider.provider\n    const fileInfo = findFile(provider.resolveFiles(downloadUpdateOptions.updateInfoAndProvider.info), \"exe\")!\n    return this.executeDownload({\n      fileExtension: \"exe\",\n      downloadUpdateOptions,\n      fileInfo,\n      task: async (destinationFile, downloadOptions, packageFile, removeTempDirIfAny) => {\n        const packageInfo = fileInfo.packageInfo\n        const isWebInstaller = packageInfo != null && packageFile != null\n        if (isWebInstaller && downloadUpdateOptions.disableWebInstaller) {\n          throw newError(\n            `Unable to download new version ${downloadUpdateOptions.updateInfoAndProvider.info.version}. Web Installers are disabled`,\n            \"ERR_UPDATER_WEB_INSTALLER_DISABLED\"\n          )\n        }\n        if (!isWebInstaller && !downloadUpdateOptions.disableWebInstaller) {\n          this._logger.warn(\n            \"disableWebInstaller is set to false, you should set it to true if you do not plan on using a web installer. This will default to true in a future version.\"\n          )\n        }\n        if (\n          isWebInstaller ||\n          downloadUpdateOptions.disableDifferentialDownload ||\n          (await this.differentialDownloadInstaller(fileInfo, downloadUpdateOptions, destinationFile, provider, CURRENT_APP_INSTALLER_FILE_NAME))\n        ) {\n          await this.httpExecutor.download(fileInfo.url, destinationFile, downloadOptions)\n        }\n\n        const signatureVerificationStatus = await this.verifySignature(destinationFile)\n        if (signatureVerificationStatus != null) {\n          await removeTempDirIfAny()\n          // noinspection ThrowInsideFinallyBlockJS\n          throw newError(\n            `New version ${downloadUpdateOptions.updateInfoAndProvider.info.version} is not signed by the application owner: ${signatureVerificationStatus}`,\n            \"ERR_UPDATER_INVALID_SIGNATURE\"\n          )\n        }\n\n        if (isWebInstaller) {\n          if (await this.differentialDownloadWebPackage(downloadUpdateOptions, packageInfo, packageFile, provider)) {\n            try {\n              await this.httpExecutor.download(new URL(packageInfo.path), packageFile, {\n                headers: downloadUpdateOptions.requestHeaders,\n                cancellationToken: downloadUpdateOptions.cancellationToken,\n                sha512: packageInfo.sha512,\n              })\n            } catch (e: any) {\n              try {\n                await unlink(packageFile)\n              } catch (_ignored) {\n                // ignore\n              }\n\n              throw e\n            }\n          }\n        }\n      },\n    })\n  }\n\n  // $certificateInfo = (Get-AuthenticodeSignature 'xxx\\yyy.exe'\n  // | where {$_.Status.Equals([System.Management.Automation.SignatureStatus]::Valid) -and $_.SignerCertificate.Subject.Contains(\"CN=siemens.com\")})\n  // | Out-String ; if ($certificateInfo) { exit 0 } else { exit 1 }\n  private async verifySignature(tempUpdateFile: string): Promise<string | null> {\n    let publisherName: Array<string> | string | null\n    try {\n      publisherName = (await this.configOnDisk.value).publisherName\n      if (publisherName == null) {\n        return null\n      }\n    } catch (e: any) {\n      if (e.code === \"ENOENT\") {\n        // no app-update.yml\n        return null\n      }\n      throw e\n    }\n    return await this._verifyUpdateCodeSignature(Array.isArray(publisherName) ? publisherName : [publisherName], tempUpdateFile)\n  }\n\n  protected doInstall(options: InstallOptions): boolean {\n    const installerPath = this.installerPath\n    if (installerPath == null) {\n      this.dispatchError(new Error(\"No update filepath provided, can't quit and install\"))\n      return false\n    }\n\n    const args = [\"--updated\"]\n    if (options.isSilent) {\n      args.push(\"/S\")\n    }\n\n    if (options.isForceRunAfter) {\n      args.push(\"--force-run\")\n    }\n\n    if (this.installDirectory) {\n      // maybe check if folder exists\n      args.push(`/D=${this.installDirectory}`)\n    }\n\n    const packagePath = this.downloadedUpdateHelper == null ? null : this.downloadedUpdateHelper.packageFile\n    if (packagePath != null) {\n      // only = form is supported\n      args.push(`--package-file=${packagePath}`)\n    }\n\n    const callUsingElevation = (): void => {\n      this.spawnLog(path.join(process.resourcesPath, \"elevate.exe\"), [installerPath].concat(args)).catch(e => this.dispatchError(e))\n    }\n\n    if (options.isAdminRightsRequired) {\n      this._logger.info(\"isAdminRightsRequired is set to true, run installer using elevate.exe\")\n      callUsingElevation()\n      return true\n    }\n\n    this.spawnLog(installerPath, args).catch((e: Error) => {\n      // https://github.com/electron-userland/electron-builder/issues/1129\n      // Node 8 sends errors: https://nodejs.org/dist/latest-v8.x/docs/api/errors.html#errors_common_system_errors\n      const errorCode = (e as NodeJS.ErrnoException).code\n      this._logger.info(\n        `Cannot run installer: error code: ${errorCode}, error message: \"${e.message}\", will be executed again using elevate if EACCES, and will try to use electron.shell.openItem if ENOENT`\n      )\n      if (errorCode === \"UNKNOWN\" || errorCode === \"EACCES\") {\n        callUsingElevation()\n      } else if (errorCode === \"ENOENT\") {\n        require(\"electron\")\n          .shell.openPath(installerPath)\n          .catch((err: Error) => this.dispatchError(err))\n      } else {\n        this.dispatchError(e)\n      }\n    })\n    return true\n  }\n\n  private async differentialDownloadWebPackage(\n    downloadUpdateOptions: DownloadUpdateOptions,\n    packageInfo: PackageFileInfo,\n    packagePath: string,\n    provider: Provider<any>\n  ): Promise<boolean> {\n    if (packageInfo.blockMapSize == null) {\n      return true\n    }\n\n    try {\n      const downloadOptions: DifferentialDownloaderOptions = {\n        newUrl: new URL(packageInfo.path),\n        oldFile: path.join(this.downloadedUpdateHelper!.cacheDir, CURRENT_APP_PACKAGE_FILE_NAME),\n        logger: this._logger,\n        newFile: packagePath,\n        requestHeaders: this.requestHeaders,\n        isUseMultipleRangeRequest: provider.isUseMultipleRangeRequest,\n        cancellationToken: downloadUpdateOptions.cancellationToken,\n      }\n\n      if (this.listenerCount(DOWNLOAD_PROGRESS) > 0) {\n        downloadOptions.onProgress = it => this.emit(DOWNLOAD_PROGRESS, it)\n      }\n\n      await new FileWithEmbeddedBlockMapDifferentialDownloader(packageInfo, this.httpExecutor, downloadOptions).download()\n    } catch (e: any) {\n      this._logger.error(`Cannot download differentially, fallback to full download: ${e.stack || e}`)\n      // during test (developer machine mac or linux) we must throw error\n      return process.platform === \"win32\"\n    }\n    return false\n  }\n}\n"]}"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.PacmanUpdater = void 0;
const types_1 = require("./types");
const Provider_1 = require("./providers/Provider");
const LinuxUpdater_1 = require("./LinuxUpdater");
class PacmanUpdater extends LinuxUpdater_1.LinuxUpdater {
    constructor(options, app) {
        super(options, app);
    }
    /*** @private */
    doDownloadUpdate(downloadUpdateOptions) {
        const provider = downloadUpdateOptions.updateInfoAndProvider.provider;
        const fileInfo = (0, Provider_1.findFile)(provider.resolveFiles(downloadUpdateOptions.updateInfoAndProvider.info), "pacman", ["AppImage", "deb", "rpm"]);
        return this.executeDownload({
            fileExtension: "pacman",
            fileInfo,
            downloadUpdateOptions,
            task: async (updateFile, downloadOptions) => {
                if (this.listenerCount(types_1.DOWNLOAD_PROGRESS) > 0) {
                    downloadOptions.onProgress = it => this.emit(types_1.DOWNLOAD_PROGRESS, it);
                }
                await this.httpExecutor.download(fileInfo.url, updateFile, downloadOptions);
            },
        });
    }
    doInstall(options) {
        const installerPath = this.installerPath;
        if (installerPath == null) {
            this.dispatchError(new Error("No update filepath provided, can't quit and install"));
            return false;
        }
        try {
            PacmanUpdater.installWithCommandRunner(installerPath, this.runCommandWithSudoIfNeeded.bind(this), this._logger);
        }
        catch (error) {
            this.dispatchError(error);
            return false;
        }
        if (options.isForceRunAfter) {
            this.app.relaunch(); // note: `app` is undefined in tests since vite doesn't run in electron
        }
        return true;
    }
    static installWithCommandRunner(installerPath, commandRunner, logger) {
        var _a;
        try {
            commandRunner(["pacman", "-U", "--noconfirm", installerPath]);
        }
        catch (error) {
            logger.warn((_a = error.message) !== null && _a !== void 0 ? _a : error);
            logger.warn("pacman installation failed, attempting to update package database and retry");
            try {
                // Update package database (not a full upgrade, just sync)
                commandRunner(["pacman", "-Sy", "--noconfirm"]);
                // Retry installation
                commandRunner(["pacman", "-U", "--noconfirm", installerPath]);
            }
            catch (retryError) {
                logger.error("Retry after pacman -Sy failed");
                throw retryError;
            }
        }
    }
}
exports.PacmanUpdater = PacmanUpdater;
//# sourceMappingURL=PacmanUpdater.js.map{"version":3,"file":"PacmanUpdater.js","sourceRoot":"","sources":["../src/PacmanUpdater.ts"],"names":[],"mappings":";;;AAIA,mCAAmD;AACnD,mDAA+C;AAC/C,iDAA6C;AAE7C,MAAa,aAAc,SAAQ,2BAAY;IAC7C,YAAY,OAAkC,EAAE,GAAgB;QAC9D,KAAK,CAAC,OAAO,EAAE,GAAG,CAAC,CAAA;IACrB,CAAC;IAED,gBAAgB;IACN,gBAAgB,CAAC,qBAA4C;QACrE,MAAM,QAAQ,GAAG,qBAAqB,CAAC,qBAAqB,CAAC,QAAQ,CAAA;QACrE,MAAM,QAAQ,GAAG,IAAA,mBAAQ,EAAC,QAAQ,CAAC,YAAY,CAAC,qBAAqB,CAAC,qBAAqB,CAAC,IAAI,CAAC,EAAE,QAAQ,EAAE,CAAC,UAAU,EAAE,KAAK,EAAE,KAAK,CAAC,CAAE,CAAA;QACzI,OAAO,IAAI,CAAC,eAAe,CAAC;YAC1B,aAAa,EAAE,QAAQ;YACvB,QAAQ;YACR,qBAAqB;YACrB,IAAI,EAAE,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,EAAE;gBAC1C,IAAI,IAAI,CAAC,aAAa,CAAC,yBAAiB,CAAC,GAAG,CAAC,EAAE,CAAC;oBAC9C,eAAe,CAAC,UAAU,GAAG,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,yBAAiB,EAAE,EAAE,CAAC,CAAA;gBACrE,CAAC;gBACD,MAAM,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAAG,EAAE,UAAU,EAAE,eAAe,CAAC,CAAA;YAC7E,CAAC;SACF,CAAC,CAAA;IACJ,CAAC;IAES,SAAS,CAAC,OAAuB;QACzC,MAAM,aAAa,GAAG,IAAI,CAAC,aAAa,CAAA;QACxC,IAAI,aAAa,IAAI,IAAI,EAAE,CAAC;YAC1B,IAAI,CAAC,aAAa,CAAC,IAAI,KAAK,CAAC,qDAAqD,CAAC,CAAC,CAAA;YACpF,OAAO,KAAK,CAAA;QACd,CAAC;QACD,IAAI,CAAC;YACH,aAAa,CAAC,wBAAwB,CAAC,aAAa,EAAE,IAAI,CAAC,0BAA0B,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,CAAA;QACjH,CAAC;QAAC,OAAO,KAAU,EAAE,CAAC;YACpB,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CAAA;YACzB,OAAO,KAAK,CAAA;QACd,CAAC;QACD,IAAI,OAAO,CAAC,eAAe,EAAE,CAAC;YAC5B,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAA,CAAC,uEAAuE;QAC7F,CAAC;QACD,OAAO,IAAI,CAAA;IACb,CAAC;IAED,MAAM,CAAC,wBAAwB,CAAC,aAAqB,EAAE,aAAkD,EAAE,MAAc;;QACvH,IAAI,CAAC;YACH,aAAa,CAAC,CAAC,QAAQ,EAAE,IAAI,EAAE,aAAa,EAAE,aAAa,CAAC,CAAC,CAAA;QAC/D,CAAC;QAAC,OAAO,KAAU,EAAE,CAAC;YACpB,MAAM,CAAC,IAAI,CAAC,MAAA,KAAK,CAAC,OAAO,mCAAI,KAAK,CAAC,CAAA;YACnC,MAAM,CAAC,IAAI,CAAC,6EAA6E,CAAC,CAAA;YAE1F,IAAI,CAAC;gBACH,0DAA0D;gBAC1D,aAAa,CAAC,CAAC,QAAQ,EAAE,KAAK,EAAE,aAAa,CAAC,CAAC,CAAA;gBAC/C,qBAAqB;gBACrB,aAAa,CAAC,CAAC,QAAQ,EAAE,IAAI,EAAE,aAAa,EAAE,aAAa,CAAC,CAAC,CAAA;YAC/D,CAAC;YAAC,OAAO,UAAe,EAAE,CAAC;gBACzB,MAAM,CAAC,KAAK,CAAC,+BAA+B,CAAC,CAAA;gBAC7C,MAAM,UAAU,CAAA;YAClB,CAAC;QACH,CAAC;IACH,CAAC;CACF;AA1DD,sCA0DC","sourcesContent":["import { AllPublishOptions } from \"builder-util-runtime\"\nimport { AppAdapter } from \"./AppAdapter\"\nimport { DownloadUpdateOptions } from \"./AppUpdater\"\nimport { InstallOptions } from \"./BaseUpdater\"\nimport { DOWNLOAD_PROGRESS, Logger } from \"./types\"\nimport { findFile } from \"./providers/Provider\"\nimport { LinuxUpdater } from \"./LinuxUpdater\"\n\nexport class PacmanUpdater extends LinuxUpdater {\n  constructor(options?: AllPublishOptions | null, app?: AppAdapter) {\n    super(options, app)\n  }\n\n  /*** @private */\n  protected doDownloadUpdate(downloadUpdateOptions: DownloadUpdateOptions): Promise<Array<string>> {\n    const provider = downloadUpdateOptions.updateInfoAndProvider.provider\n    const fileInfo = findFile(provider.resolveFiles(downloadUpdateOptions.updateInfoAndProvider.info), \"pacman\", [\"AppImage\", \"deb\", \"rpm\"])!\n    return this.executeDownload({\n      fileExtension: \"pacman\",\n      fileInfo,\n      downloadUpdateOptions,\n      task: async (updateFile, downloadOptions) => {\n        if (this.listenerCount(DOWNLOAD_PROGRESS) > 0) {\n          downloadOptions.onProgress = it => this.emit(DOWNLOAD_PROGRESS, it)\n        }\n        await this.httpExecutor.download(fileInfo.url, updateFile, downloadOptions)\n      },\n    })\n  }\n\n  protected doInstall(options: InstallOptions): boolean {\n    const installerPath = this.installerPath\n    if (installerPath == null) {\n      this.dispatchError(new Error(\"No update filepath provided, can't quit and install\"))\n      return false\n    }\n    try {\n      PacmanUpdater.installWithCommandRunner(installerPath, this.runCommandWithSudoIfNeeded.bind(this), this._logger)\n    } catch (error: any) {\n      this.dispatchError(error)\n      return false\n    }\n    if (options.isForceRunAfter) {\n      this.app.relaunch() // note: `app` is undefined in tests since vite doesn't run in electron\n    }\n    return true\n  }\n\n  static installWithCommandRunner(installerPath: string, commandRunner: (commandWithArgs: string[]) => void, logger: Logger) {\n    try {\n      commandRunner([\"pacman\", \"-U\", \"--noconfirm\", installerPath])\n    } catch (error: any) {\n      logger.warn(error.message ?? error)\n      logger.warn(\"pacman installation failed, attempting to update package database and retry\")\n\n      try {\n        // Update package database (not a full upgrade, just sync)\n        commandRunner([\"pacman\", \"-Sy\", \"--noconfirm\"])\n        // Retry installation\n        commandRunner([\"pacman\", \"-U\", \"--noconfirm\", installerPath])\n      } catch (retryError: any) {\n        logger.error(\"Retry after pacman -Sy failed\")\n        throw retryError\n      }\n    }\n  }\n}\n"]}"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.RpmUpdater = void 0;
const types_1 = require("./types");
const Provider_1 = require("./providers/Provider");
const LinuxUpdater_1 = require("./LinuxUpdater");
class RpmUpdater extends LinuxUpdater_1.LinuxUpdater {
    constructor(options, app) {
        super(options, app);
    }
    /*** @private */
    doDownloadUpdate(downloadUpdateOptions) {
        const provider = downloadUpdateOptions.updateInfoAndProvider.provider;
        const fileInfo = (0, Provider_1.findFile)(provider.resolveFiles(downloadUpdateOptions.updateInfoAndProvider.info), "rpm", ["AppImage", "deb", "pacman"]);
        return this.executeDownload({
            fileExtension: "rpm",
            fileInfo,
            downloadUpdateOptions,
            task: async (updateFile, downloadOptions) => {
                if (this.listenerCount(types_1.DOWNLOAD_PROGRESS) > 0) {
                    downloadOptions.onProgress = it => this.emit(types_1.DOWNLOAD_PROGRESS, it);
                }
                await this.httpExecutor.download(fileInfo.url, updateFile, downloadOptions);
            },
        });
    }
    doInstall(options) {
        const installerPath = this.installerPath;
        if (installerPath == null) {
            this.dispatchError(new Error("No update filepath provided, can't quit and install"));
            return false;
        }
        const priorityList = ["zypper", "dnf", "yum", "rpm"];
        const packageManager = this.detectPackageManager(priorityList);
        try {
            RpmUpdater.installWithCommandRunner(packageManager, installerPath, this.runCommandWithSudoIfNeeded.bind(this), this._logger);
        }
        catch (error) {
            this.dispatchError(error);
            return false;
        }
        if (options.isForceRunAfter) {
            this.app.relaunch();
        }
        return true;
    }
    static installWithCommandRunner(packageManager, installerPath, commandRunner, logger) {
        if (packageManager === "zypper") {
            return commandRunner(["zypper", "--non-interactive", "--no-refresh", "install", "--allow-unsigned-rpm", "-f", installerPath]);
        }
        if (packageManager === "dnf") {
            return commandRunner(["dnf", "install", "--nogpgcheck", "-y", installerPath]);
        }
        if (packageManager === "yum") {
            return commandRunner(["yum", "install", "--nogpgcheck", "-y", installerPath]);
        }
        if (packageManager === "rpm") {
            logger.warn("Installing with rpm only (no dependency resolution).");
            return commandRunner(["rpm", "-Uvh", "--replacepkgs", "--replacefiles", "--nodeps", installerPath]);
        }
        throw new Error(`Package manager ${packageManager} not supported`);
    }
}
exports.RpmUpdater = RpmUpdater;
//# sourceMappingURL=RpmUpdater.js.map{"version":3,"file":"RpmUpdater.js","sourceRoot":"","sources":["../src/RpmUpdater.ts"],"names":[],"mappings":";;;AAIA,mCAAmD;AACnD,mDAA+C;AAC/C,iDAA6C;AAE7C,MAAa,UAAW,SAAQ,2BAAY;IAC1C,YAAY,OAAkC,EAAE,GAAgB;QAC9D,KAAK,CAAC,OAAO,EAAE,GAAG,CAAC,CAAA;IACrB,CAAC;IAED,gBAAgB;IACN,gBAAgB,CAAC,qBAA4C;QACrE,MAAM,QAAQ,GAAG,qBAAqB,CAAC,qBAAqB,CAAC,QAAQ,CAAA;QACrE,MAAM,QAAQ,GAAG,IAAA,mBAAQ,EAAC,QAAQ,CAAC,YAAY,CAAC,qBAAqB,CAAC,qBAAqB,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,CAAC,UAAU,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAE,CAAA;QACzI,OAAO,IAAI,CAAC,eAAe,CAAC;YAC1B,aAAa,EAAE,KAAK;YACpB,QAAQ;YACR,qBAAqB;YACrB,IAAI,EAAE,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,EAAE;gBAC1C,IAAI,IAAI,CAAC,aAAa,CAAC,yBAAiB,CAAC,GAAG,CAAC,EAAE,CAAC;oBAC9C,eAAe,CAAC,UAAU,GAAG,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,yBAAiB,EAAE,EAAE,CAAC,CAAA;gBACrE,CAAC;gBACD,MAAM,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAAG,EAAE,UAAU,EAAE,eAAe,CAAC,CAAA;YAC7E,CAAC;SACF,CAAC,CAAA;IACJ,CAAC;IAES,SAAS,CAAC,OAAuB;QACzC,MAAM,aAAa,GAAG,IAAI,CAAC,aAAa,CAAA;QACxC,IAAI,aAAa,IAAI,IAAI,EAAE,CAAC;YAC1B,IAAI,CAAC,aAAa,CAAC,IAAI,KAAK,CAAC,qDAAqD,CAAC,CAAC,CAAA;YACpF,OAAO,KAAK,CAAA;QACd,CAAC;QAED,MAAM,YAAY,GAAG,CAAC,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,CAAA;QACpD,MAAM,cAAc,GAAG,IAAI,CAAC,oBAAoB,CAAC,YAAY,CAAC,CAAA;QAC9D,IAAI,CAAC;YACH,UAAU,CAAC,wBAAwB,CAAC,cAAqB,EAAE,aAAa,EAAE,IAAI,CAAC,0BAA0B,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,CAAA;QACrI,CAAC;QAAC,OAAO,KAAU,EAAE,CAAC;YACpB,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CAAA;YACzB,OAAO,KAAK,CAAA;QACd,CAAC;QACD,IAAI,OAAO,CAAC,eAAe,EAAE,CAAC;YAC5B,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAA;QACrB,CAAC;QACD,OAAO,IAAI,CAAA;IACb,CAAC;IAED,MAAM,CAAC,wBAAwB,CAAC,cAAgD,EAAE,aAAqB,EAAE,aAAkD,EAAE,MAAc;QACzK,IAAI,cAAc,KAAK,QAAQ,EAAE,CAAC;YAChC,OAAO,aAAa,CAAC,CAAC,QAAQ,EAAE,mBAAmB,EAAE,cAAc,EAAE,SAAS,EAAE,sBAAsB,EAAE,IAAI,EAAE,aAAa,CAAC,CAAC,CAAA;QAC/H,CAAC;QACD,IAAI,cAAc,KAAK,KAAK,EAAE,CAAC;YAC7B,OAAO,aAAa,CAAC,CAAC,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,IAAI,EAAE,aAAa,CAAC,CAAC,CAAA;QAC/E,CAAC;QACD,IAAI,cAAc,KAAK,KAAK,EAAE,CAAC;YAC7B,OAAO,aAAa,CAAC,CAAC,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,IAAI,EAAE,aAAa,CAAC,CAAC,CAAA;QAC/E,CAAC;QACD,IAAI,cAAc,KAAK,KAAK,EAAE,CAAC;YAC7B,MAAM,CAAC,IAAI,CAAC,sDAAsD,CAAC,CAAA;YACnE,OAAO,aAAa,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,eAAe,EAAE,gBAAgB,EAAE,UAAU,EAAE,aAAa,CAAC,CAAC,CAAA;QACrG,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,mBAAmB,cAAc,gBAAgB,CAAC,CAAA;IACpE,CAAC;CACF;AA3DD,gCA2DC","sourcesContent":["import { AllPublishOptions } from \"builder-util-runtime\"\nimport { AppAdapter } from \"./AppAdapter\"\nimport { DownloadUpdateOptions } from \"./AppUpdater\"\nimport { InstallOptions } from \"./BaseUpdater\"\nimport { DOWNLOAD_PROGRESS, Logger } from \"./types\"\nimport { findFile } from \"./providers/Provider\"\nimport { LinuxUpdater } from \"./LinuxUpdater\"\n\nexport class RpmUpdater extends LinuxUpdater {\n  constructor(options?: AllPublishOptions | null, app?: AppAdapter) {\n    super(options, app)\n  }\n\n  /*** @private */\n  protected doDownloadUpdate(downloadUpdateOptions: DownloadUpdateOptions): Promise<Array<string>> {\n    const provider = downloadUpdateOptions.updateInfoAndProvider.provider\n    const fileInfo = findFile(provider.resolveFiles(downloadUpdateOptions.updateInfoAndProvider.info), \"rpm\", [\"AppImage\", \"deb\", \"pacman\"])!\n    return this.executeDownload({\n      fileExtension: \"rpm\",\n      fileInfo,\n      downloadUpdateOptions,\n      task: async (updateFile, downloadOptions) => {\n        if (this.listenerCount(DOWNLOAD_PROGRESS) > 0) {\n          downloadOptions.onProgress = it => this.emit(DOWNLOAD_PROGRESS, it)\n        }\n        await this.httpExecutor.download(fileInfo.url, updateFile, downloadOptions)\n      },\n    })\n  }\n\n  protected doInstall(options: InstallOptions): boolean {\n    const installerPath = this.installerPath\n    if (installerPath == null) {\n      this.dispatchError(new Error(\"No update filepath provided, can't quit and install\"))\n      return false\n    }\n\n    const priorityList = [\"zypper\", \"dnf\", \"yum\", \"rpm\"]\n    const packageManager = this.detectPackageManager(priorityList)\n    try {\n      RpmUpdater.installWithCommandRunner(packageManager as any, installerPath, this.runCommandWithSudoIfNeeded.bind(this), this._logger)\n    } catch (error: any) {\n      this.dispatchError(error)\n      return false\n    }\n    if (options.isForceRunAfter) {\n      this.app.relaunch()\n    }\n    return true\n  }\n\n  static installWithCommandRunner(packageManager: \"zypper\" | \"dnf\" | \"yum\" | \"rpm\", installerPath: string, commandRunner: (commandWithArgs: string[]) => void, logger: Logger) {\n    if (packageManager === \"zypper\") {\n      return commandRunner([\"zypper\", \"--non-interactive\", \"--no-refresh\", \"install\", \"--allow-unsigned-rpm\", \"-f\", installerPath])\n    }\n    if (packageManager === \"dnf\") {\n      return commandRunner([\"dnf\", \"install\", \"--nogpgcheck\", \"-y\", installerPath])\n    }\n    if (packageManager === \"yum\") {\n      return commandRunner([\"yum\", \"install\", \"--nogpgcheck\", \"-y\", installerPath])\n    }\n    if (packageManager === \"rpm\") {\n      logger.warn(\"Installing with rpm only (no dependency resolution).\")\n      return commandRunner([\"rpm\", \"-Uvh\", \"--replacepkgs\", \"--replacefiles\", \"--nodeps\", installerPath])\n    }\n    throw new Error(`Package manager ${packageManager} not supported`)\n  }\n}\n"]}"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.DataSplitter = void 0;
exports.copyData = copyData;
const builder_util_runtime_1 = require("builder-util-runtime");
const fs_1 = require("fs");
const stream_1 = require("stream");
const downloadPlanBuilder_1 = require("./downloadPlanBuilder");
const DOUBLE_CRLF = Buffer.from("\r\n\r\n");
var ReadState;
(function (ReadState) {
    ReadState[ReadState["INIT"] = 0] = "INIT";
    ReadState[ReadState["HEADER"] = 1] = "HEADER";
    ReadState[ReadState["BODY"] = 2] = "BODY";
})(ReadState || (ReadState = {}));
function copyData(task, out, oldFileFd, reject, resolve) {
    const readStream = (0, fs_1.createReadStream)("", {
        fd: oldFileFd,
        autoClose: false,
        start: task.start,
        // end is inclusive
        end: task.end - 1,
    });
    readStream.on("error", reject);
    readStream.once("end", resolve);
    readStream.pipe(out, {
        end: false,
    });
}
class DataSplitter extends stream_1.Writable {
    constructor(out, options, partIndexToTaskIndex, boundary, partIndexToLength, finishHandler, grandTotalBytes, onProgress) {
        super();
        this.out = out;
        this.options = options;
        this.partIndexToTaskIndex = partIndexToTaskIndex;
        this.partIndexToLength = partIndexToLength;
        this.finishHandler = finishHandler;
        this.grandTotalBytes = grandTotalBytes;
        this.onProgress = onProgress;
        // properties for progress update calculations
        this.start = Date.now(); // download start time used to calculate average rate
        this.nextUpdate = this.start + 1000; // timestamp of next update to prevent updates more often than once per second
        this.transferred = 0; // total number of bytes transferred
        this.delta = 0; // number of bytes transferred since last update, reset after each update
        this.partIndex = -1;
        this.headerListBuffer = null;
        this.readState = ReadState.INIT;
        this.ignoreByteCount = 0;
        this.remainingPartDataCount = 0;
        this.actualPartLength = 0;
        this.boundaryLength = boundary.length + 4; /* size of \r\n-- */
        // first chunk doesn't start with \r\n
        this.ignoreByteCount = this.boundaryLength - 2;
    }
    get isFinished() {
        return this.partIndex === this.partIndexToLength.length;
    }
    // noinspection JSUnusedGlobalSymbols
    _write(data, encoding, callback) {
        if (this.isFinished) {
            console.error(`Trailing ignored data: ${data.length} bytes`);
            return;
        }
        this.handleData(data)
            .then(() => {
            if (this.onProgress) {
                const now = Date.now();
                if ((now >= this.nextUpdate || this.transferred === this.grandTotalBytes) && this.grandTotalBytes && (now - this.start) / 1000) {
                    this.nextUpdate = now + 1000;
                    this.onProgress({
                        total: this.grandTotalBytes,
                        delta: this.delta,
                        transferred: this.transferred,
                        percent: (this.transferred / this.grandTotalBytes) * 100,
                        bytesPerSecond: Math.round(this.transferred / ((now - this.start) / 1000)),
                    });
                    this.delta = 0;
                }
            }
            callback();
        })
            .catch(callback);
    }
    async handleData(chunk) {
        let start = 0;
        if (this.ignoreByteCount !== 0 && this.remainingPartDataCount !== 0) {
            throw (0, builder_util_runtime_1.newError)("Internal error", "ERR_DATA_SPLITTER_BYTE_COUNT_MISMATCH");
        }
        if (this.ignoreByteCount > 0) {
            const toIgnore = Math.min(this.ignoreByteCount, chunk.length);
            this.ignoreByteCount -= toIgnore;
            start = toIgnore;
        }
        else if (this.remainingPartDataCount > 0) {
            const toRead = Math.min(this.remainingPartDataCount, chunk.length);
            this.remainingPartDataCount -= toRead;
            await this.processPartData(chunk, 0, toRead);
            start = toRead;
        }
        if (start === chunk.length) {
            return;
        }
        if (this.readState === ReadState.HEADER) {
            const headerListEnd = this.searchHeaderListEnd(chunk, start);
            if (headerListEnd === -1) {
                return;
            }
            start = headerListEnd;
            this.readState = ReadState.BODY;
            // header list is ignored, we don't need it
            this.headerListBuffer = null;
        }
        while (true) {
            if (this.readState === ReadState.BODY) {
                this.readState = ReadState.INIT;
            }
            else {
                this.partIndex++;
                let taskIndex = this.partIndexToTaskIndex.get(this.partIndex);
                if (taskIndex == null) {
                    if (this.isFinished) {
                        taskIndex = this.options.end;
                    }
                    else {
                        throw (0, builder_util_runtime_1.newError)("taskIndex is null", "ERR_DATA_SPLITTER_TASK_INDEX_IS_NULL");
                    }
                }
                const prevTaskIndex = this.partIndex === 0 ? this.options.start : this.partIndexToTaskIndex.get(this.partIndex - 1) + 1; /* prev part is download, next maybe copy */
                if (prevTaskIndex < taskIndex) {
                    await this.copyExistingData(prevTaskIndex, taskIndex);
                }
                else if (prevTaskIndex > taskIndex) {
                    throw (0, builder_util_runtime_1.newError)("prevTaskIndex must be < taskIndex", "ERR_DATA_SPLITTER_TASK_INDEX_ASSERT_FAILED");
                }
                if (this.isFinished) {
                    this.onPartEnd();
                    this.finishHandler();
                    return;
                }
                start = this.searchHeaderListEnd(chunk, start);
                if (start === -1) {
                    this.readState = ReadState.HEADER;
                    return;
                }
            }
            const partLength = this.partIndexToLength[this.partIndex];
            const end = start + partLength;
            const effectiveEnd = Math.min(end, chunk.length);
            await this.processPartStarted(chunk, start, effectiveEnd);
            this.remainingPartDataCount = partLength - (effectiveEnd - start);
            if (this.remainingPartDataCount > 0) {
                return;
            }
            start = end + this.boundaryLength;
            if (start >= chunk.length) {
                this.ignoreByteCount = this.boundaryLength - (chunk.length - end);
                return;
            }
        }
    }
    copyExistingData(index, end) {
        return new Promise((resolve, reject) => {
            const w = () => {
                if (index === end) {
                    resolve();
                    return;
                }
                const task = this.options.tasks[index];
                if (task.kind !== downloadPlanBuilder_1.OperationKind.COPY) {
                    reject(new Error("Task kind must be COPY"));
                    return;
                }
                copyData(task, this.out, this.options.oldFileFd, reject, () => {
                    index++;
                    w();
                });
            };
            w();
        });
    }
    searchHeaderListEnd(chunk, readOffset) {
        const headerListEnd = chunk.indexOf(DOUBLE_CRLF, readOffset);
        if (headerListEnd !== -1) {
            return headerListEnd + DOUBLE_CRLF.length;
        }
        // not all headers data were received, save to buffer
        const partialChunk = readOffset === 0 ? chunk : chunk.slice(readOffset);
        if (this.headerListBuffer == null) {
            this.headerListBuffer = partialChunk;
        }
        else {
            this.headerListBuffer = Buffer.concat([this.headerListBuffer, partialChunk]);
        }
        return -1;
    }
    onPartEnd() {
        const expectedLength = this.partIndexToLength[this.partIndex - 1];
        if (this.actualPartLength !== expectedLength) {
            throw (0, builder_util_runtime_1.newError)(`Expected length: ${expectedLength} differs from actual: ${this.actualPartLength}`, "ERR_DATA_SPLITTER_LENGTH_MISMATCH");
        }
        this.actualPartLength = 0;
    }
    processPartStarted(data, start, end) {
        if (this.partIndex !== 0) {
            this.onPartEnd();
        }
        return this.processPartData(data, start, end);
    }
    processPartData(data, start, end) {
        this.actualPartLength += end - start;
        this.transferred += end - start;
        this.delta += end - start;
        const out = this.out;
        if (out.write(start === 0 && data.length === end ? data : data.slice(start, end))) {
            return Promise.resolve();
        }
        else {
            return new Promise((resolve, reject) => {
                out.on("error", reject);
                out.once("drain", () => {
                    out.removeListener("error", reject);
                    resolve();
                });
            });
        }
    }
}
exports.DataSplitter = DataSplitter;
//# sourceMappingURL=DataSplitter.js.map{"version":3,"file":"DataSplitter.js","sourceRoot":"","sources":["../../src/differentialDownloader/DataSplitter.ts"],"names":[],"mappings":";;;AAqBA,4BAaC;AAlCD,+DAA+C;AAC/C,2BAAqC;AACrC,mCAAiC;AACjC,+DAAgE;AAGhE,MAAM,WAAW,GAAG,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAA;AAE3C,IAAK,SAIJ;AAJD,WAAK,SAAS;IACZ,yCAAI,CAAA;IACJ,6CAAM,CAAA;IACN,yCAAI,CAAA;AACN,CAAC,EAJI,SAAS,KAAT,SAAS,QAIb;AASD,SAAgB,QAAQ,CAAC,IAAe,EAAE,GAAa,EAAE,SAAiB,EAAE,MAA8B,EAAE,OAAmB;IAC7H,MAAM,UAAU,GAAG,IAAA,qBAAgB,EAAC,EAAE,EAAE;QACtC,EAAE,EAAE,SAAS;QACb,SAAS,EAAE,KAAK;QAChB,KAAK,EAAE,IAAI,CAAC,KAAK;QACjB,mBAAmB;QACnB,GAAG,EAAE,IAAI,CAAC,GAAG,GAAG,CAAC;KAClB,CAAC,CAAA;IACF,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,CAAA;IAC9B,UAAU,CAAC,IAAI,CAAC,KAAK,EAAE,OAAO,CAAC,CAAA;IAC/B,UAAU,CAAC,IAAI,CAAC,GAAG,EAAE;QACnB,GAAG,EAAE,KAAK;KACX,CAAC,CAAA;AACJ,CAAC;AAED,MAAa,YAAa,SAAQ,iBAAQ;IAgBxC,YACmB,GAAa,EACb,OAAyB,EACzB,oBAAyC,EAC1D,QAAgB,EACC,iBAAgC,EAChC,aAAwB,EACxB,eAAuB,EACvB,UAAwC;QAEzD,KAAK,EAAE,CAAA;QATU,QAAG,GAAH,GAAG,CAAU;QACb,YAAO,GAAP,OAAO,CAAkB;QACzB,yBAAoB,GAApB,oBAAoB,CAAqB;QAEzC,sBAAiB,GAAjB,iBAAiB,CAAe;QAChC,kBAAa,GAAb,aAAa,CAAW;QACxB,oBAAe,GAAf,eAAe,CAAQ;QACvB,eAAU,GAAV,UAAU,CAA8B;QAvB3D,8CAA8C;QACtC,UAAK,GAAG,IAAI,CAAC,GAAG,EAAE,CAAA,CAAC,qDAAqD;QACxE,eAAU,GAAG,IAAI,CAAC,KAAK,GAAG,IAAI,CAAA,CAAC,8EAA8E;QAC7G,gBAAW,GAAG,CAAC,CAAA,CAAC,oCAAoC;QACpD,UAAK,GAAG,CAAC,CAAA,CAAC,yEAAyE;QAE3F,cAAS,GAAG,CAAC,CAAC,CAAA;QAEN,qBAAgB,GAAkB,IAAI,CAAA;QACtC,cAAS,GAAG,SAAS,CAAC,IAAI,CAAA;QAC1B,oBAAe,GAAG,CAAC,CAAA;QACnB,2BAAsB,GAAG,CAAC,CAAA;QAqL1B,qBAAgB,GAAG,CAAC,CAAA;QArK1B,IAAI,CAAC,cAAc,GAAG,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAA,CAAC,oBAAoB;QAC9D,sCAAsC;QACtC,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC,cAAc,GAAG,CAAC,CAAA;IAChD,CAAC;IAED,IAAI,UAAU;QACZ,OAAO,IAAI,CAAC,SAAS,KAAK,IAAI,CAAC,iBAAiB,CAAC,MAAM,CAAA;IACzD,CAAC;IAED,qCAAqC;IACrC,MAAM,CAAC,IAAY,EAAE,QAAgB,EAAE,QAAiC;QACtE,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;YACpB,OAAO,CAAC,KAAK,CAAC,0BAA0B,IAAI,CAAC,MAAM,QAAQ,CAAC,CAAA;YAC5D,OAAM;QACR,CAAC;QAED,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;aAClB,IAAI,CAAC,GAAG,EAAE;YACT,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;gBACpB,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,CAAA;gBACtB,IAAI,CAAC,GAAG,IAAI,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,WAAW,KAAK,IAAI,CAAC,eAAe,CAAC,IAAI,IAAI,CAAC,eAAe,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,IAAI,EAAE,CAAC;oBAC/H,IAAI,CAAC,UAAU,GAAG,GAAG,GAAG,IAAI,CAAA;oBAE5B,IAAI,CAAC,UAAU,CAAC;wBACd,KAAK,EAAE,IAAI,CAAC,eAAe;wBAC3B,KAAK,EAAE,IAAI,CAAC,KAAK;wBACjB,WAAW,EAAE,IAAI,CAAC,WAAW;wBAC7B,OAAO,EAAE,CAAC,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,eAAe,CAAC,GAAG,GAAG;wBACxD,cAAc,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,GAAG,CAAC,CAAC,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC;qBAC3E,CAAC,CAAA;oBACF,IAAI,CAAC,KAAK,GAAG,CAAC,CAAA;gBAChB,CAAC;YACH,CAAC;YAED,QAAQ,EAAE,CAAA;QACZ,CAAC,CAAC;aACD,KAAK,CAAC,QAAQ,CAAC,CAAA;IACpB,CAAC;IAEO,KAAK,CAAC,UAAU,CAAC,KAAa;QACpC,IAAI,KAAK,GAAG,CAAC,CAAA;QAEb,IAAI,IAAI,CAAC,eAAe,KAAK,CAAC,IAAI,IAAI,CAAC,sBAAsB,KAAK,CAAC,EAAE,CAAC;YACpE,MAAM,IAAA,+BAAQ,EAAC,gBAAgB,EAAE,uCAAuC,CAAC,CAAA;QAC3E,CAAC;QAED,IAAI,IAAI,CAAC,eAAe,GAAG,CAAC,EAAE,CAAC;YAC7B,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,eAAe,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;YAC7D,IAAI,CAAC,eAAe,IAAI,QAAQ,CAAA;YAChC,KAAK,GAAG,QAAQ,CAAA;QAClB,CAAC;aAAM,IAAI,IAAI,CAAC,sBAAsB,GAAG,CAAC,EAAE,CAAC;YAC3C,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,sBAAsB,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;YAClE,IAAI,CAAC,sBAAsB,IAAI,MAAM,CAAA;YACrC,MAAM,IAAI,CAAC,eAAe,CAAC,KAAK,EAAE,CAAC,EAAE,MAAM,CAAC,CAAA;YAC5C,KAAK,GAAG,MAAM,CAAA;QAChB,CAAC;QAED,IAAI,KAAK,KAAK,KAAK,CAAC,MAAM,EAAE,CAAC;YAC3B,OAAM;QACR,CAAC;QAED,IAAI,IAAI,CAAC,SAAS,KAAK,SAAS,CAAC,MAAM,EAAE,CAAC;YACxC,MAAM,aAAa,GAAG,IAAI,CAAC,mBAAmB,CAAC,KAAK,EAAE,KAAK,CAAC,CAAA;YAC5D,IAAI,aAAa,KAAK,CAAC,CAAC,EAAE,CAAC;gBACzB,OAAM;YACR,CAAC;YAED,KAAK,GAAG,aAAa,CAAA;YACrB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC,IAAI,CAAA;YAC/B,2CAA2C;YAC3C,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAA;QAC9B,CAAC;QAED,OAAO,IAAI,EAAE,CAAC;YACZ,IAAI,IAAI,CAAC,SAAS,KAAK,SAAS,CAAC,IAAI,EAAE,CAAC;gBACtC,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC,IAAI,CAAA;YACjC,CAAC;iBAAM,CAAC;gBACN,IAAI,CAAC,SAAS,EAAE,CAAA;gBAEhB,IAAI,SAAS,GAAG,IAAI,CAAC,oBAAoB,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;gBAC7D,IAAI,SAAS,IAAI,IAAI,EAAE,CAAC;oBACtB,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;wBACpB,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAA;oBAC9B,CAAC;yBAAM,CAAC;wBACN,MAAM,IAAA,+BAAQ,EAAC,mBAAmB,EAAE,sCAAsC,CAAC,CAAA;oBAC7E,CAAC;gBACH,CAAC;gBAED,MAAM,aAAa,GAAG,IAAI,CAAC,SAAS,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,oBAAoB,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,GAAG,CAAC,CAAE,GAAG,CAAC,CAAA,CAAC,4CAA4C;gBACrK,IAAI,aAAa,GAAG,SAAS,EAAE,CAAC;oBAC9B,MAAM,IAAI,CAAC,gBAAgB,CAAC,aAAa,EAAE,SAAS,CAAC,CAAA;gBACvD,CAAC;qBAAM,IAAI,aAAa,GAAG,SAAS,EAAE,CAAC;oBACrC,MAAM,IAAA,+BAAQ,EAAC,mCAAmC,EAAE,4CAA4C,CAAC,CAAA;gBACnG,CAAC;gBAED,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;oBACpB,IAAI,CAAC,SAAS,EAAE,CAAA;oBAChB,IAAI,CAAC,aAAa,EAAE,CAAA;oBACpB,OAAM;gBACR,CAAC;gBAED,KAAK,GAAG,IAAI,CAAC,mBAAmB,CAAC,KAAK,EAAE,KAAK,CAAC,CAAA;gBAE9C,IAAI,KAAK,KAAK,CAAC,CAAC,EAAE,CAAC;oBACjB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC,MAAM,CAAA;oBACjC,OAAM;gBACR,CAAC;YACH,CAAC;YAED,MAAM,UAAU,GAAG,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;YACzD,MAAM,GAAG,GAAG,KAAK,GAAG,UAAU,CAAA;YAC9B,MAAM,YAAY,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;YAChD,MAAM,IAAI,CAAC,kBAAkB,CAAC,KAAK,EAAE,KAAK,EAAE,YAAY,CAAC,CAAA;YACzD,IAAI,CAAC,sBAAsB,GAAG,UAAU,GAAG,CAAC,YAAY,GAAG,KAAK,CAAC,CAAA;YACjE,IAAI,IAAI,CAAC,sBAAsB,GAAG,CAAC,EAAE,CAAC;gBACpC,OAAM;YACR,CAAC;YAED,KAAK,GAAG,GAAG,GAAG,IAAI,CAAC,cAAc,CAAA;YACjC,IAAI,KAAK,IAAI,KAAK,CAAC,MAAM,EAAE,CAAC;gBAC1B,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC,cAAc,GAAG,CAAC,KAAK,CAAC,MAAM,GAAG,GAAG,CAAC,CAAA;gBACjE,OAAM;YACR,CAAC;QACH,CAAC;IACH,CAAC;IAEO,gBAAgB,CAAC,KAAa,EAAE,GAAW;QACjD,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACrC,MAAM,CAAC,GAAG,GAAS,EAAE;gBACnB,IAAI,KAAK,KAAK,GAAG,EAAE,CAAC;oBAClB,OAAO,EAAE,CAAA;oBACT,OAAM;gBACR,CAAC;gBAED,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;gBACtC,IAAI,IAAI,CAAC,IAAI,KAAK,mCAAa,CAAC,IAAI,EAAE,CAAC;oBACrC,MAAM,CAAC,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAC,CAAA;oBAC3C,OAAM;gBACR,CAAC;gBAED,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE;oBAC5D,KAAK,EAAE,CAAA;oBACP,CAAC,EAAE,CAAA;gBACL,CAAC,CAAC,CAAA;YACJ,CAAC,CAAA;YACD,CAAC,EAAE,CAAA;QACL,CAAC,CAAC,CAAA;IACJ,CAAC;IAEO,mBAAmB,CAAC,KAAa,EAAE,UAAkB;QAC3D,MAAM,aAAa,GAAG,KAAK,CAAC,OAAO,CAAC,WAAW,EAAE,UAAU,CAAC,CAAA;QAC5D,IAAI,aAAa,KAAK,CAAC,CAAC,EAAE,CAAC;YACzB,OAAO,aAAa,GAAG,WAAW,CAAC,MAAM,CAAA;QAC3C,CAAC;QAED,qDAAqD;QACrD,MAAM,YAAY,GAAG,UAAU,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,UAAU,CAAC,CAAA;QACvE,IAAI,IAAI,CAAC,gBAAgB,IAAI,IAAI,EAAE,CAAC;YAClC,IAAI,CAAC,gBAAgB,GAAG,YAAY,CAAA;QACtC,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,gBAAgB,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,gBAAgB,EAAE,YAAY,CAAC,CAAC,CAAA;QAC9E,CAAC;QACD,OAAO,CAAC,CAAC,CAAA;IACX,CAAC;IAIO,SAAS;QACf,MAAM,cAAc,GAAG,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,SAAS,GAAG,CAAC,CAAC,CAAA;QACjE,IAAI,IAAI,CAAC,gBAAgB,KAAK,cAAc,EAAE,CAAC;YAC7C,MAAM,IAAA,+BAAQ,EAAC,oBAAoB,cAAc,yBAAyB,IAAI,CAAC,gBAAgB,EAAE,EAAE,mCAAmC,CAAC,CAAA;QACzI,CAAC;QACD,IAAI,CAAC,gBAAgB,GAAG,CAAC,CAAA;IAC3B,CAAC;IAEO,kBAAkB,CAAC,IAAY,EAAE,KAAa,EAAE,GAAW;QACjE,IAAI,IAAI,CAAC,SAAS,KAAK,CAAC,EAAE,CAAC;YACzB,IAAI,CAAC,SAAS,EAAE,CAAA;QAClB,CAAC;QACD,OAAO,IAAI,CAAC,eAAe,CAAC,IAAI,EAAE,KAAK,EAAE,GAAG,CAAC,CAAA;IAC/C,CAAC;IAEO,eAAe,CAAC,IAAY,EAAE,KAAa,EAAE,GAAW;QAC9D,IAAI,CAAC,gBAAgB,IAAI,GAAG,GAAG,KAAK,CAAA;QACpC,IAAI,CAAC,WAAW,IAAI,GAAG,GAAG,KAAK,CAAA;QAC/B,IAAI,CAAC,KAAK,IAAI,GAAG,GAAG,KAAK,CAAA;QACzB,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAA;QACpB,IAAI,GAAG,CAAC,KAAK,CAAC,KAAK,KAAK,CAAC,IAAI,IAAI,CAAC,MAAM,KAAK,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,EAAE,CAAC;YAClF,OAAO,OAAO,CAAC,OAAO,EAAE,CAAA;QAC1B,CAAC;aAAM,CAAC;YACN,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;gBACrC,GAAG,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,CAAA;gBACvB,GAAG,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,EAAE;oBACrB,GAAG,CAAC,cAAc,CAAC,OAAO,EAAE,MAAM,CAAC,CAAA;oBACnC,OAAO,EAAE,CAAA;gBACX,CAAC,CAAC,CAAA;YACJ,CAAC,CAAC,CAAA;QACJ,CAAC;IACH,CAAC;CACF;AAnOD,oCAmOC","sourcesContent":["import { newError } from \"builder-util-runtime\"\nimport { createReadStream } from \"fs\"\nimport { Writable } from \"stream\"\nimport { Operation, OperationKind } from \"./downloadPlanBuilder\"\nimport { ProgressInfo } from \"./ProgressDifferentialDownloadCallbackTransform\"\n\nconst DOUBLE_CRLF = Buffer.from(\"\\r\\n\\r\\n\")\n\nenum ReadState {\n  INIT,\n  HEADER,\n  BODY,\n}\n\nexport interface PartListDataTask {\n  readonly oldFileFd: number\n  readonly tasks: Array<Operation>\n  readonly start: number\n  readonly end: number\n}\n\nexport function copyData(task: Operation, out: Writable, oldFileFd: number, reject: (error: Error) => void, resolve: () => void): void {\n  const readStream = createReadStream(\"\", {\n    fd: oldFileFd,\n    autoClose: false,\n    start: task.start,\n    // end is inclusive\n    end: task.end - 1,\n  })\n  readStream.on(\"error\", reject)\n  readStream.once(\"end\", resolve)\n  readStream.pipe(out, {\n    end: false,\n  })\n}\n\nexport class DataSplitter extends Writable {\n  // properties for progress update calculations\n  private start = Date.now() // download start time used to calculate average rate\n  private nextUpdate = this.start + 1000 // timestamp of next update to prevent updates more often than once per second\n  private transferred = 0 // total number of bytes transferred\n  private delta = 0 // number of bytes transferred since last update, reset after each update\n\n  partIndex = -1\n\n  private headerListBuffer: Buffer | null = null\n  private readState = ReadState.INIT\n  private ignoreByteCount = 0\n  private remainingPartDataCount = 0\n\n  private readonly boundaryLength: number\n\n  constructor(\n    private readonly out: Writable,\n    private readonly options: PartListDataTask,\n    private readonly partIndexToTaskIndex: Map<number, number>,\n    boundary: string,\n    private readonly partIndexToLength: Array<number>,\n    private readonly finishHandler: () => any,\n    private readonly grandTotalBytes: number,\n    private readonly onProgress?: (info: ProgressInfo) => any\n  ) {\n    super()\n\n    this.boundaryLength = boundary.length + 4 /* size of \\r\\n-- */\n    // first chunk doesn't start with \\r\\n\n    this.ignoreByteCount = this.boundaryLength - 2\n  }\n\n  get isFinished(): boolean {\n    return this.partIndex === this.partIndexToLength.length\n  }\n\n  // noinspection JSUnusedGlobalSymbols\n  _write(data: Buffer, encoding: string, callback: (error?: Error) => void): void {\n    if (this.isFinished) {\n      console.error(`Trailing ignored data: ${data.length} bytes`)\n      return\n    }\n\n    this.handleData(data)\n      .then(() => {\n        if (this.onProgress) {\n          const now = Date.now()\n          if ((now >= this.nextUpdate || this.transferred === this.grandTotalBytes) && this.grandTotalBytes && (now - this.start) / 1000) {\n            this.nextUpdate = now + 1000\n\n            this.onProgress({\n              total: this.grandTotalBytes,\n              delta: this.delta,\n              transferred: this.transferred,\n              percent: (this.transferred / this.grandTotalBytes) * 100,\n              bytesPerSecond: Math.round(this.transferred / ((now - this.start) / 1000)),\n            })\n            this.delta = 0\n          }\n        }\n\n        callback()\n      })\n      .catch(callback)\n  }\n\n  private async handleData(chunk: Buffer): Promise<undefined> {\n    let start = 0\n\n    if (this.ignoreByteCount !== 0 && this.remainingPartDataCount !== 0) {\n      throw newError(\"Internal error\", \"ERR_DATA_SPLITTER_BYTE_COUNT_MISMATCH\")\n    }\n\n    if (this.ignoreByteCount > 0) {\n      const toIgnore = Math.min(this.ignoreByteCount, chunk.length)\n      this.ignoreByteCount -= toIgnore\n      start = toIgnore\n    } else if (this.remainingPartDataCount > 0) {\n      const toRead = Math.min(this.remainingPartDataCount, chunk.length)\n      this.remainingPartDataCount -= toRead\n      await this.processPartData(chunk, 0, toRead)\n      start = toRead\n    }\n\n    if (start === chunk.length) {\n      return\n    }\n\n    if (this.readState === ReadState.HEADER) {\n      const headerListEnd = this.searchHeaderListEnd(chunk, start)\n      if (headerListEnd === -1) {\n        return\n      }\n\n      start = headerListEnd\n      this.readState = ReadState.BODY\n      // header list is ignored, we don't need it\n      this.headerListBuffer = null\n    }\n\n    while (true) {\n      if (this.readState === ReadState.BODY) {\n        this.readState = ReadState.INIT\n      } else {\n        this.partIndex++\n\n        let taskIndex = this.partIndexToTaskIndex.get(this.partIndex)\n        if (taskIndex == null) {\n          if (this.isFinished) {\n            taskIndex = this.options.end\n          } else {\n            throw newError(\"taskIndex is null\", \"ERR_DATA_SPLITTER_TASK_INDEX_IS_NULL\")\n          }\n        }\n\n        const prevTaskIndex = this.partIndex === 0 ? this.options.start : this.partIndexToTaskIndex.get(this.partIndex - 1)! + 1 /* prev part is download, next maybe copy */\n        if (prevTaskIndex < taskIndex) {\n          await this.copyExistingData(prevTaskIndex, taskIndex)\n        } else if (prevTaskIndex > taskIndex) {\n          throw newError(\"prevTaskIndex must be < taskIndex\", \"ERR_DATA_SPLITTER_TASK_INDEX_ASSERT_FAILED\")\n        }\n\n        if (this.isFinished) {\n          this.onPartEnd()\n          this.finishHandler()\n          return\n        }\n\n        start = this.searchHeaderListEnd(chunk, start)\n\n        if (start === -1) {\n          this.readState = ReadState.HEADER\n          return\n        }\n      }\n\n      const partLength = this.partIndexToLength[this.partIndex]\n      const end = start + partLength\n      const effectiveEnd = Math.min(end, chunk.length)\n      await this.processPartStarted(chunk, start, effectiveEnd)\n      this.remainingPartDataCount = partLength - (effectiveEnd - start)\n      if (this.remainingPartDataCount > 0) {\n        return\n      }\n\n      start = end + this.boundaryLength\n      if (start >= chunk.length) {\n        this.ignoreByteCount = this.boundaryLength - (chunk.length - end)\n        return\n      }\n    }\n  }\n\n  private copyExistingData(index: number, end: number): Promise<void> {\n    return new Promise((resolve, reject) => {\n      const w = (): void => {\n        if (index === end) {\n          resolve()\n          return\n        }\n\n        const task = this.options.tasks[index]\n        if (task.kind !== OperationKind.COPY) {\n          reject(new Error(\"Task kind must be COPY\"))\n          return\n        }\n\n        copyData(task, this.out, this.options.oldFileFd, reject, () => {\n          index++\n          w()\n        })\n      }\n      w()\n    })\n  }\n\n  private searchHeaderListEnd(chunk: Buffer, readOffset: number): number {\n    const headerListEnd = chunk.indexOf(DOUBLE_CRLF, readOffset)\n    if (headerListEnd !== -1) {\n      return headerListEnd + DOUBLE_CRLF.length\n    }\n\n    // not all headers data were received, save to buffer\n    const partialChunk = readOffset === 0 ? chunk : chunk.slice(readOffset)\n    if (this.headerListBuffer == null) {\n      this.headerListBuffer = partialChunk\n    } else {\n      this.headerListBuffer = Buffer.concat([this.headerListBuffer, partialChunk])\n    }\n    return -1\n  }\n\n  private actualPartLength = 0\n\n  private onPartEnd(): void {\n    const expectedLength = this.partIndexToLength[this.partIndex - 1]\n    if (this.actualPartLength !== expectedLength) {\n      throw newError(`Expected length: ${expectedLength} differs from actual: ${this.actualPartLength}`, \"ERR_DATA_SPLITTER_LENGTH_MISMATCH\")\n    }\n    this.actualPartLength = 0\n  }\n\n  private processPartStarted(data: Buffer, start: number, end: number): Promise<void> {\n    if (this.partIndex !== 0) {\n      this.onPartEnd()\n    }\n    return this.processPartData(data, start, end)\n  }\n\n  private processPartData(data: Buffer, start: number, end: number): Promise<void> {\n    this.actualPartLength += end - start\n    this.transferred += end - start\n    this.delta += end - start\n    const out = this.out\n    if (out.write(start === 0 && data.length === end ? data : data.slice(start, end))) {\n      return Promise.resolve()\n    } else {\n      return new Promise((resolve, reject) => {\n        out.on(\"error\", reject)\n        out.once(\"drain\", () => {\n          out.removeListener(\"error\", reject)\n          resolve()\n        })\n      })\n    }\n  }\n}\n"]}"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.DifferentialDownloader = void 0;
const builder_util_runtime_1 = require("builder-util-runtime");
const fs_extra_1 = require("fs-extra");
const fs_1 = require("fs");
const DataSplitter_1 = require("./DataSplitter");
const url_1 = require("url");
const downloadPlanBuilder_1 = require("./downloadPlanBuilder");
const multipleRangeDownloader_1 = require("./multipleRangeDownloader");
const ProgressDifferentialDownloadCallbackTransform_1 = require("./ProgressDifferentialDownloadCallbackTransform");
class DifferentialDownloader {
    // noinspection TypeScriptAbstractClassConstructorCanBeMadeProtected
    constructor(blockAwareFileInfo, httpExecutor, options) {
        this.blockAwareFileInfo = blockAwareFileInfo;
        this.httpExecutor = httpExecutor;
        this.options = options;
        this.fileMetadataBuffer = null;
        this.logger = options.logger;
    }
    createRequestOptions() {
        const result = {
            headers: {
                ...this.options.requestHeaders,
                accept: "*/*",
            },
        };
        (0, builder_util_runtime_1.configureRequestUrl)(this.options.newUrl, result);
        // user-agent, cache-control and other common options
        (0, builder_util_runtime_1.configureRequestOptions)(result);
        return result;
    }
    doDownload(oldBlockMap, newBlockMap) {
        // we don't check other metadata like compressionMethod - generic check that it is make sense to differentially update is suitable for it
        if (oldBlockMap.version !== newBlockMap.version) {
            throw new Error(`version is different (${oldBlockMap.version} - ${newBlockMap.version}), full download is required`);
        }
        const logger = this.logger;
        const operations = (0, downloadPlanBuilder_1.computeOperations)(oldBlockMap, newBlockMap, logger);
        if (logger.debug != null) {
            logger.debug(JSON.stringify(operations, null, 2));
        }
        let downloadSize = 0;
        let copySize = 0;
        for (const operation of operations) {
            const length = operation.end - operation.start;
            if (operation.kind === downloadPlanBuilder_1.OperationKind.DOWNLOAD) {
                downloadSize += length;
            }
            else {
                copySize += length;
            }
        }
        const newSize = this.blockAwareFileInfo.size;
        if (downloadSize + copySize + (this.fileMetadataBuffer == null ? 0 : this.fileMetadataBuffer.length) !== newSize) {
            throw new Error(`Internal error, size mismatch: downloadSize: ${downloadSize}, copySize: ${copySize}, newSize: ${newSize}`);
        }
        logger.info(`Full: ${formatBytes(newSize)}, To download: ${formatBytes(downloadSize)} (${Math.round(downloadSize / (newSize / 100))}%)`);
        return this.downloadFile(operations);
    }
    downloadFile(tasks) {
        const fdList = [];
        const closeFiles = () => {
            return Promise.all(fdList.map(openedFile => {
                return (0, fs_extra_1.close)(openedFile.descriptor).catch((e) => {
                    this.logger.error(`cannot close file "${openedFile.path}": ${e}`);
                });
            }));
        };
        return this.doDownloadFile(tasks, fdList)
            .then(closeFiles)
            .catch((e) => {
            // then must be after catch here (since then always throws error)
            return closeFiles()
                .catch(closeFilesError => {
                // closeFiles never throw error, but just to be sure
                try {
                    this.logger.error(`cannot close files: ${closeFilesError}`);
                }
                catch (errorOnLog) {
                    try {
                        console.error(errorOnLog);
                    }
                    catch (_ignored) {
                        // ok, give up and ignore error
                    }
                }
                throw e;
            })
                .then(() => {
                throw e;
            });
        });
    }
    async doDownloadFile(tasks, fdList) {
        const oldFileFd = await (0, fs_extra_1.open)(this.options.oldFile, "r");
        fdList.push({ descriptor: oldFileFd, path: this.options.oldFile });
        const newFileFd = await (0, fs_extra_1.open)(this.options.newFile, "w");
        fdList.push({ descriptor: newFileFd, path: this.options.newFile });
        const fileOut = (0, fs_1.createWriteStream)(this.options.newFile, { fd: newFileFd });
        await new Promise((resolve, reject) => {
            const streams = [];
            // Create our download info transformer if we have one
            let downloadInfoTransform = undefined;
            if (!this.options.isUseMultipleRangeRequest && this.options.onProgress) {
                const expectedByteCounts = [];
                let grandTotalBytes = 0;
                for (const task of tasks) {
                    if (task.kind === downloadPlanBuilder_1.OperationKind.DOWNLOAD) {
                        expectedByteCounts.push(task.end - task.start);
                        grandTotalBytes += task.end - task.start;
                    }
                }
                const progressDifferentialDownloadInfo = {
                    expectedByteCounts: expectedByteCounts,
                    grandTotal: grandTotalBytes,
                };
                downloadInfoTransform = new ProgressDifferentialDownloadCallbackTransform_1.ProgressDifferentialDownloadCallbackTransform(progressDifferentialDownloadInfo, this.options.cancellationToken, this.options.onProgress);
                streams.push(downloadInfoTransform);
            }
            const digestTransform = new builder_util_runtime_1.DigestTransform(this.blockAwareFileInfo.sha512);
            // to simply debug, do manual validation to allow file to be fully written
            digestTransform.isValidateOnEnd = false;
            streams.push(digestTransform);
            // noinspection JSArrowFunctionCanBeReplacedWithShorthand
            fileOut.on("finish", () => {
                ;
                fileOut.close(() => {
                    // remove from fd list because closed successfully
                    fdList.splice(1, 1);
                    try {
                        digestTransform.validate();
                    }
                    catch (e) {
                        reject(e);
                        return;
                    }
                    resolve(undefined);
                });
            });
            streams.push(fileOut);
            let lastStream = null;
            for (const stream of streams) {
                stream.on("error", reject);
                if (lastStream == null) {
                    lastStream = stream;
                }
                else {
                    lastStream = lastStream.pipe(stream);
                }
            }
            const firstStream = streams[0];
            let w;
            if (this.options.isUseMultipleRangeRequest) {
                w = (0, multipleRangeDownloader_1.executeTasksUsingMultipleRangeRequests)(this, tasks, firstStream, oldFileFd, reject);
                w(0);
                return;
            }
            let downloadOperationCount = 0;
            let actualUrl = null;
            this.logger.info(`Differential download: ${this.options.newUrl}`);
            const requestOptions = this.createRequestOptions();
            requestOptions.redirect = "manual";
            w = (index) => {
                var _a, _b;
                if (index >= tasks.length) {
                    if (this.fileMetadataBuffer != null) {
                        firstStream.write(this.fileMetadataBuffer);
                    }
                    firstStream.end();
                    return;
                }
                const operation = tasks[index++];
                if (operation.kind === downloadPlanBuilder_1.OperationKind.COPY) {
                    // We are copying, let's not send status updates to the UI
                    if (downloadInfoTransform) {
                        downloadInfoTransform.beginFileCopy();
                    }
                    (0, DataSplitter_1.copyData)(operation, firstStream, oldFileFd, reject, () => w(index));
                    return;
                }
                const range = `bytes=${operation.start}-${operation.end - 1}`;
                requestOptions.headers.range = range;
                (_b = (_a = this.logger) === null || _a === void 0 ? void 0 : _a.debug) === null || _b === void 0 ? void 0 : _b.call(_a, `download range: ${range}`);
                // We are starting to download
                if (downloadInfoTransform) {
                    downloadInfoTransform.beginRangeDownload();
                }
                const request = this.httpExecutor.createRequest(requestOptions, response => {
                    response.on("error", reject);
                    response.on("aborted", () => {
                        reject(new Error("response has been aborted by the server"));
                    });
                    // Electron net handles redirects automatically, our NodeJS test server doesn't use redirects - so, we don't check 3xx codes.
                    if (response.statusCode >= 400) {
                        reject((0, builder_util_runtime_1.createHttpError)(response));
                    }
                    response.pipe(firstStream, {
                        end: false,
                    });
                    response.once("end", () => {
                        // Pass on that we are downloading a segment
                        if (downloadInfoTransform) {
                            downloadInfoTransform.endRangeDownload();
                        }
                        if (++downloadOperationCount === 100) {
                            downloadOperationCount = 0;
                            setTimeout(() => w(index), 1000);
                        }
                        else {
                            w(index);
                        }
                    });
                });
                request.on("redirect", (statusCode, method, redirectUrl) => {
                    this.logger.info(`Redirect to ${removeQuery(redirectUrl)}`);
                    actualUrl = redirectUrl;
                    (0, builder_util_runtime_1.configureRequestUrl)(new url_1.URL(actualUrl), requestOptions);
                    request.followRedirect();
                });
                this.httpExecutor.addErrorAndTimeoutHandlers(request, reject);
                request.end();
            };
            w(0);
        });
    }
    async readRemoteBytes(start, endInclusive) {
        const buffer = Buffer.allocUnsafe(endInclusive + 1 - start);
        const requestOptions = this.createRequestOptions();
        requestOptions.headers.range = `bytes=${start}-${endInclusive}`;
        let position = 0;
        await this.request(requestOptions, chunk => {
            chunk.copy(buffer, position);
            position += chunk.length;
        });
        if (position !== buffer.length) {
            throw new Error(`Received data length ${position} is not equal to expected ${buffer.length}`);
        }
        return buffer;
    }
    request(requestOptions, dataHandler) {
        return new Promise((resolve, reject) => {
            const request = this.httpExecutor.createRequest(requestOptions, response => {
                if (!(0, multipleRangeDownloader_1.checkIsRangesSupported)(response, reject)) {
                    return;
                }
                response.on("error", reject);
                response.on("aborted", () => {
                    reject(new Error("response has been aborted by the server"));
                });
                response.on("data", dataHandler);
                response.on("end", () => resolve());
            });
            this.httpExecutor.addErrorAndTimeoutHandlers(request, reject);
            request.end();
        });
    }
}
exports.DifferentialDownloader = DifferentialDownloader;
function formatBytes(value, symbol = " KB") {
    return new Intl.NumberFormat("en").format((value / 1024).toFixed(2)) + symbol;
}
// safety
function removeQuery(url) {
    const index = url.indexOf("?");
    return index < 0 ? url : url.substring(0, index);
}
//# sourceMappingURL=DifferentialDownloader.js.map{"version":3,"file":"DifferentialDownloader.js","sourceRoot":"","sources":["../../src/differentialDownloader/DifferentialDownloader.ts"],"names":[],"mappings":";;;AAAA,+DAAuJ;AAEvJ,uCAAsC;AACtC,2BAAsC;AAItC,iDAAyC;AACzC,6BAAyB;AACzB,+DAAmF;AACnF,uEAA0G;AAC1G,mHAAiJ;AAgBjJ,MAAsB,sBAAsB;IAK1C,oEAAoE;IACpE,YACqB,kBAAsC,EAChD,YAA+B,EAC/B,OAAsC;QAF5B,uBAAkB,GAAlB,kBAAkB,CAAoB;QAChD,iBAAY,GAAZ,YAAY,CAAmB;QAC/B,YAAO,GAAP,OAAO,CAA+B;QARjD,uBAAkB,GAAkB,IAAI,CAAA;QAUtC,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAA;IAC9B,CAAC;IAED,oBAAoB;QAClB,MAAM,MAAM,GAAG;YACb,OAAO,EAAE;gBACP,GAAG,IAAI,CAAC,OAAO,CAAC,cAAc;gBAC9B,MAAM,EAAE,KAAK;aACd;SACF,CAAA;QACD,IAAA,0CAAmB,EAAC,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;QAChD,qDAAqD;QACrD,IAAA,8CAAuB,EAAC,MAAM,CAAC,CAAA;QAC/B,OAAO,MAAM,CAAA;IACf,CAAC;IAES,UAAU,CAAC,WAAqB,EAAE,WAAqB;QAC/D,yIAAyI;QACzI,IAAI,WAAW,CAAC,OAAO,KAAK,WAAW,CAAC,OAAO,EAAE,CAAC;YAChD,MAAM,IAAI,KAAK,CAAC,yBAAyB,WAAW,CAAC,OAAO,MAAM,WAAW,CAAC,OAAO,8BAA8B,CAAC,CAAA;QACtH,CAAC;QAED,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAA;QAC1B,MAAM,UAAU,GAAG,IAAA,uCAAiB,EAAC,WAAW,EAAE,WAAW,EAAE,MAAM,CAAC,CAAA;QACtE,IAAI,MAAM,CAAC,KAAK,IAAI,IAAI,EAAE,CAAC;YACzB,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAA;QACnD,CAAC;QAED,IAAI,YAAY,GAAG,CAAC,CAAA;QACpB,IAAI,QAAQ,GAAG,CAAC,CAAA;QAChB,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;YACnC,MAAM,MAAM,GAAG,SAAS,CAAC,GAAG,GAAG,SAAS,CAAC,KAAK,CAAA;YAC9C,IAAI,SAAS,CAAC,IAAI,KAAK,mCAAa,CAAC,QAAQ,EAAE,CAAC;gBAC9C,YAAY,IAAI,MAAM,CAAA;YACxB,CAAC;iBAAM,CAAC;gBACN,QAAQ,IAAI,MAAM,CAAA;YACpB,CAAC;QACH,CAAC;QAED,MAAM,OAAO,GAAG,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAA;QAC5C,IAAI,YAAY,GAAG,QAAQ,GAAG,CAAC,IAAI,CAAC,kBAAkB,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,kBAAkB,CAAC,MAAM,CAAC,KAAK,OAAO,EAAE,CAAC;YACjH,MAAM,IAAI,KAAK,CAAC,gDAAgD,YAAY,eAAe,QAAQ,cAAc,OAAO,EAAE,CAAC,CAAA;QAC7H,CAAC;QAED,MAAM,CAAC,IAAI,CAAC,SAAS,WAAW,CAAC,OAAO,CAAC,kBAAkB,WAAW,CAAC,YAAY,CAAC,KAAK,IAAI,CAAC,KAAK,CAAC,YAAY,GAAG,CAAC,OAAO,GAAG,GAAG,CAAC,CAAC,IAAI,CAAC,CAAA;QAExI,OAAO,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,CAAA;IACtC,CAAC;IAEO,YAAY,CAAC,KAAuB;QAC1C,MAAM,MAAM,GAAsB,EAAE,CAAA;QACpC,MAAM,UAAU,GAAG,GAAyB,EAAE;YAC5C,OAAO,OAAO,CAAC,GAAG,CAChB,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE;gBACtB,OAAO,IAAA,gBAAK,EAAC,UAAU,CAAC,UAAU,CAAC,CAAC,KAAK,CAAC,CAAC,CAAM,EAAE,EAAE;oBACnD,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,sBAAsB,UAAU,CAAC,IAAI,MAAM,CAAC,EAAE,CAAC,CAAA;gBACnE,CAAC,CAAC,CAAA;YACJ,CAAC,CAAC,CACH,CAAA;QACH,CAAC,CAAA;QACD,OAAO,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,MAAM,CAAC;aACtC,IAAI,CAAC,UAAU,CAAC;aAChB,KAAK,CAAC,CAAC,CAAM,EAAE,EAAE;YAChB,iEAAiE;YACjE,OAAO,UAAU,EAAE;iBAChB,KAAK,CAAC,eAAe,CAAC,EAAE;gBACvB,oDAAoD;gBACpD,IAAI,CAAC;oBACH,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,uBAAuB,eAAe,EAAE,CAAC,CAAA;gBAC7D,CAAC;gBAAC,OAAO,UAAU,EAAE,CAAC;oBACpB,IAAI,CAAC;wBACH,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,CAAA;oBAC3B,CAAC;oBAAC,OAAO,QAAQ,EAAE,CAAC;wBAClB,+BAA+B;oBACjC,CAAC;gBACH,CAAC;gBACD,MAAM,CAAC,CAAA;YACT,CAAC,CAAC;iBACD,IAAI,CAAC,GAAG,EAAE;gBACT,MAAM,CAAC,CAAA;YACT,CAAC,CAAC,CAAA;QACN,CAAC,CAAC,CAAA;IACN,CAAC;IAEO,KAAK,CAAC,cAAc,CAAC,KAAuB,EAAE,MAAyB;QAC7E,MAAM,SAAS,GAAG,MAAM,IAAA,eAAI,EAAC,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,CAAA;QACvD,MAAM,CAAC,IAAI,CAAC,EAAE,UAAU,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,CAAA;QAClE,MAAM,SAAS,GAAG,MAAM,IAAA,eAAI,EAAC,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,CAAA;QACvD,MAAM,CAAC,IAAI,CAAC,EAAE,UAAU,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,CAAA;QAClE,MAAM,OAAO,GAAG,IAAA,sBAAiB,EAAC,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,EAAE,EAAE,SAAS,EAAE,CAAC,CAAA;QAC1E,MAAM,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACpC,MAAM,OAAO,GAAe,EAAE,CAAA;YAE9B,sDAAsD;YACtD,IAAI,qBAAqB,GAA8D,SAAS,CAAA;YAChG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,yBAAyB,IAAI,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC;gBACvE,MAAM,kBAAkB,GAAkB,EAAE,CAAA;gBAC5C,IAAI,eAAe,GAAG,CAAC,CAAA;gBAEvB,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;oBACzB,IAAI,IAAI,CAAC,IAAI,KAAK,mCAAa,CAAC,QAAQ,EAAE,CAAC;wBACzC,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,CAAA;wBAC9C,eAAe,IAAI,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,KAAK,CAAA;oBAC1C,CAAC;gBACH,CAAC;gBAED,MAAM,gCAAgC,GAAqC;oBACzE,kBAAkB,EAAE,kBAAkB;oBACtC,UAAU,EAAE,eAAe;iBAC5B,CAAA;gBAED,qBAAqB,GAAG,IAAI,6FAA6C,CAAC,gCAAgC,EAAE,IAAI,CAAC,OAAO,CAAC,iBAAiB,EAAE,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAA;gBACpK,OAAO,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAA;YACrC,CAAC;YAED,MAAM,eAAe,GAAG,IAAI,sCAAe,CAAC,IAAI,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAA;YAC3E,0EAA0E;YAC1E,eAAe,CAAC,eAAe,GAAG,KAAK,CAAA;YACvC,OAAO,CAAC,IAAI,CAAC,eAAe,CAAC,CAAA;YAE7B,yDAAyD;YACzD,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,GAAG,EAAE;gBACxB,CAAC;gBAAC,OAAO,CAAC,KAAa,CAAC,GAAG,EAAE;oBAC3B,kDAAkD;oBAClD,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;oBACnB,IAAI,CAAC;wBACH,eAAe,CAAC,QAAQ,EAAE,CAAA;oBAC5B,CAAC;oBAAC,OAAO,CAAM,EAAE,CAAC;wBAChB,MAAM,CAAC,CAAC,CAAC,CAAA;wBACT,OAAM;oBACR,CAAC;oBAED,OAAO,CAAC,SAAS,CAAC,CAAA;gBACpB,CAAC,CAAC,CAAA;YACJ,CAAC,CAAC,CAAA;YAEF,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;YAErB,IAAI,UAAU,GAAG,IAAI,CAAA;YACrB,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;gBAC7B,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,CAAA;gBAC1B,IAAI,UAAU,IAAI,IAAI,EAAE,CAAC;oBACvB,UAAU,GAAG,MAAM,CAAA;gBACrB,CAAC;qBAAM,CAAC;oBACN,UAAU,GAAG,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;gBACtC,CAAC;YACH,CAAC;YAED,MAAM,WAAW,GAAG,OAAO,CAAC,CAAC,CAAC,CAAA;YAE9B,IAAI,CAAM,CAAA;YACV,IAAI,IAAI,CAAC,OAAO,CAAC,yBAAyB,EAAE,CAAC;gBAC3C,CAAC,GAAG,IAAA,gEAAsC,EAAC,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,CAAC,CAAA;gBACvF,CAAC,CAAC,CAAC,CAAC,CAAA;gBACJ,OAAM;YACR,CAAC;YAED,IAAI,sBAAsB,GAAG,CAAC,CAAA;YAC9B,IAAI,SAAS,GAAkB,IAAI,CAAA;YACnC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,0BAA0B,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,CAAA;YAEjE,MAAM,cAAc,GAAG,IAAI,CAAC,oBAAoB,EAAE,CACjD;YAAC,cAAsB,CAAC,QAAQ,GAAG,QAAQ,CAAA;YAE5C,CAAC,GAAG,CAAC,KAAa,EAAQ,EAAE;;gBAC1B,IAAI,KAAK,IAAI,KAAK,CAAC,MAAM,EAAE,CAAC;oBAC1B,IAAI,IAAI,CAAC,kBAAkB,IAAI,IAAI,EAAE,CAAC;wBACpC,WAAW,CAAC,KAAK,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAA;oBAC5C,CAAC;oBACD,WAAW,CAAC,GAAG,EAAE,CAAA;oBACjB,OAAM;gBACR,CAAC;gBAED,MAAM,SAAS,GAAG,KAAK,CAAC,KAAK,EAAE,CAAC,CAAA;gBAChC,IAAI,SAAS,CAAC,IAAI,KAAK,mCAAa,CAAC,IAAI,EAAE,CAAC;oBAC1C,0DAA0D;oBAC1D,IAAI,qBAAqB,EAAE,CAAC;wBAC1B,qBAAqB,CAAC,aAAa,EAAE,CAAA;oBACvC,CAAC;oBAED,IAAA,uBAAQ,EAAC,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAA;oBACnE,OAAM;gBACR,CAAC;gBAED,MAAM,KAAK,GAAG,SAAS,SAAS,CAAC,KAAK,IAAI,SAAS,CAAC,GAAG,GAAG,CAAC,EAAE,CAAA;gBAC7D,cAAc,CAAC,OAAQ,CAAC,KAAK,GAAG,KAAK,CAAA;gBAErC,MAAA,MAAA,IAAI,CAAC,MAAM,0CAAE,KAAK,mDAAG,mBAAmB,KAAK,EAAE,CAAC,CAAA;gBAEhD,8BAA8B;gBAC9B,IAAI,qBAAqB,EAAE,CAAC;oBAC1B,qBAAqB,CAAC,kBAAkB,EAAE,CAAA;gBAC5C,CAAC;gBAED,MAAM,OAAO,GAAG,IAAI,CAAC,YAAY,CAAC,aAAa,CAAC,cAAc,EAAE,QAAQ,CAAC,EAAE;oBACzE,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,CAAA;oBAC5B,QAAQ,CAAC,EAAE,CAAC,SAAS,EAAE,GAAG,EAAE;wBAC1B,MAAM,CAAC,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAC,CAAA;oBAC9D,CAAC,CAAC,CAAA;oBACF,6HAA6H;oBAC7H,IAAI,QAAQ,CAAC,UAAU,IAAI,GAAG,EAAE,CAAC;wBAC/B,MAAM,CAAC,IAAA,sCAAe,EAAC,QAAQ,CAAC,CAAC,CAAA;oBACnC,CAAC;oBAED,QAAQ,CAAC,IAAI,CAAC,WAAW,EAAE;wBACzB,GAAG,EAAE,KAAK;qBACX,CAAC,CAAA;oBACF,QAAQ,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG,EAAE;wBACxB,4CAA4C;wBAC5C,IAAI,qBAAqB,EAAE,CAAC;4BAC1B,qBAAqB,CAAC,gBAAgB,EAAE,CAAA;wBAC1C,CAAC;wBAED,IAAI,EAAE,sBAAsB,KAAK,GAAG,EAAE,CAAC;4BACrC,sBAAsB,GAAG,CAAC,CAAA;4BAC1B,UAAU,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,IAAI,CAAC,CAAA;wBAClC,CAAC;6BAAM,CAAC;4BACN,CAAC,CAAC,KAAK,CAAC,CAAA;wBACV,CAAC;oBACH,CAAC,CAAC,CAAA;gBACJ,CAAC,CAAC,CAAA;gBACF,OAAO,CAAC,EAAE,CAAC,UAAU,EAAE,CAAC,UAAkB,EAAE,MAAc,EAAE,WAAmB,EAAE,EAAE;oBACjF,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,eAAe,WAAW,CAAC,WAAW,CAAC,EAAE,CAAC,CAAA;oBAC3D,SAAS,GAAG,WAAW,CAAA;oBACvB,IAAA,0CAAmB,EAAC,IAAI,SAAG,CAAC,SAAS,CAAC,EAAE,cAAc,CAAC,CAAA;oBACvD,OAAO,CAAC,cAAc,EAAE,CAAA;gBAC1B,CAAC,CAAC,CAAA;gBACF,IAAI,CAAC,YAAY,CAAC,0BAA0B,CAAC,OAAO,EAAE,MAAM,CAAC,CAAA;gBAC7D,OAAO,CAAC,GAAG,EAAE,CAAA;YACf,CAAC,CAAA;YAED,CAAC,CAAC,CAAC,CAAC,CAAA;QACN,CAAC,CAAC,CAAA;IACJ,CAAC;IAES,KAAK,CAAC,eAAe,CAAC,KAAa,EAAE,YAAoB;QACjE,MAAM,MAAM,GAAG,MAAM,CAAC,WAAW,CAAC,YAAY,GAAG,CAAC,GAAG,KAAK,CAAC,CAAA;QAC3D,MAAM,cAAc,GAAG,IAAI,CAAC,oBAAoB,EAAE,CAAA;QAClD,cAAc,CAAC,OAAQ,CAAC,KAAK,GAAG,SAAS,KAAK,IAAI,YAAY,EAAE,CAAA;QAChE,IAAI,QAAQ,GAAG,CAAC,CAAA;QAChB,MAAM,IAAI,CAAC,OAAO,CAAC,cAAc,EAAE,KAAK,CAAC,EAAE;YACzC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAA;YAC5B,QAAQ,IAAI,KAAK,CAAC,MAAM,CAAA;QAC1B,CAAC,CAAC,CAAA;QAEF,IAAI,QAAQ,KAAK,MAAM,CAAC,MAAM,EAAE,CAAC;YAC/B,MAAM,IAAI,KAAK,CAAC,wBAAwB,QAAQ,6BAA6B,MAAM,CAAC,MAAM,EAAE,CAAC,CAAA;QAC/F,CAAC;QACD,OAAO,MAAM,CAAA;IACf,CAAC;IAEO,OAAO,CAAC,cAA8B,EAAE,WAAoC;QAClF,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACrC,MAAM,OAAO,GAAG,IAAI,CAAC,YAAY,CAAC,aAAa,CAAC,cAAc,EAAE,QAAQ,CAAC,EAAE;gBACzE,IAAI,CAAC,IAAA,gDAAsB,EAAC,QAAQ,EAAE,MAAM,CAAC,EAAE,CAAC;oBAC9C,OAAM;gBACR,CAAC;gBAED,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,CAAA;gBAC5B,QAAQ,CAAC,EAAE,CAAC,SAAS,EAAE,GAAG,EAAE;oBAC1B,MAAM,CAAC,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAC,CAAA;gBAC9D,CAAC,CAAC,CAAA;gBAEF,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,WAAW,CAAC,CAAA;gBAChC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE,CAAC,OAAO,EAAE,CAAC,CAAA;YACrC,CAAC,CAAC,CAAA;YACF,IAAI,CAAC,YAAY,CAAC,0BAA0B,CAAC,OAAO,EAAE,MAAM,CAAC,CAAA;YAC7D,OAAO,CAAC,GAAG,EAAE,CAAA;QACf,CAAC,CAAC,CAAA;IACJ,CAAC;CACF;AAzRD,wDAyRC;AAED,SAAS,WAAW,CAAC,KAAa,EAAE,MAAM,GAAG,KAAK;IAChD,OAAO,IAAI,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAQ,CAAC,GAAG,MAAM,CAAA;AACtF,CAAC;AAED,SAAS;AACT,SAAS,WAAW,CAAC,GAAW;IAC9B,MAAM,KAAK,GAAG,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;IAC9B,OAAO,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,EAAE,KAAK,CAAC,CAAA;AAClD,CAAC","sourcesContent":["import { BlockMapDataHolder, createHttpError, DigestTransform, HttpExecutor, configureRequestUrl, configureRequestOptions } from \"builder-util-runtime\"\nimport { BlockMap } from \"builder-util-runtime/out/blockMapApi\"\nimport { close, open } from \"fs-extra\"\nimport { createWriteStream } from \"fs\"\nimport { OutgoingHttpHeaders, RequestOptions } from \"http\"\nimport { ProgressInfo, CancellationToken } from \"builder-util-runtime\"\nimport { Logger } from \"../types\"\nimport { copyData } from \"./DataSplitter\"\nimport { URL } from \"url\"\nimport { computeOperations, Operation, OperationKind } from \"./downloadPlanBuilder\"\nimport { checkIsRangesSupported, executeTasksUsingMultipleRangeRequests } from \"./multipleRangeDownloader\"\nimport { ProgressDifferentialDownloadCallbackTransform, ProgressDifferentialDownloadInfo } from \"./ProgressDifferentialDownloadCallbackTransform\"\n\nexport interface DifferentialDownloaderOptions {\n  readonly oldFile: string\n  readonly newUrl: URL\n  readonly logger: Logger\n  readonly newFile: string\n\n  readonly requestHeaders: OutgoingHttpHeaders | null\n\n  readonly isUseMultipleRangeRequest?: boolean\n\n  readonly cancellationToken: CancellationToken\n  onProgress?: (progress: ProgressInfo) => void\n}\n\nexport abstract class DifferentialDownloader {\n  fileMetadataBuffer: Buffer | null = null\n\n  private readonly logger: Logger\n\n  // noinspection TypeScriptAbstractClassConstructorCanBeMadeProtected\n  constructor(\n    protected readonly blockAwareFileInfo: BlockMapDataHolder,\n    readonly httpExecutor: HttpExecutor<any>,\n    readonly options: DifferentialDownloaderOptions\n  ) {\n    this.logger = options.logger\n  }\n\n  createRequestOptions(): RequestOptions {\n    const result = {\n      headers: {\n        ...this.options.requestHeaders,\n        accept: \"*/*\",\n      },\n    }\n    configureRequestUrl(this.options.newUrl, result)\n    // user-agent, cache-control and other common options\n    configureRequestOptions(result)\n    return result\n  }\n\n  protected doDownload(oldBlockMap: BlockMap, newBlockMap: BlockMap): Promise<any> {\n    // we don't check other metadata like compressionMethod - generic check that it is make sense to differentially update is suitable for it\n    if (oldBlockMap.version !== newBlockMap.version) {\n      throw new Error(`version is different (${oldBlockMap.version} - ${newBlockMap.version}), full download is required`)\n    }\n\n    const logger = this.logger\n    const operations = computeOperations(oldBlockMap, newBlockMap, logger)\n    if (logger.debug != null) {\n      logger.debug(JSON.stringify(operations, null, 2))\n    }\n\n    let downloadSize = 0\n    let copySize = 0\n    for (const operation of operations) {\n      const length = operation.end - operation.start\n      if (operation.kind === OperationKind.DOWNLOAD) {\n        downloadSize += length\n      } else {\n        copySize += length\n      }\n    }\n\n    const newSize = this.blockAwareFileInfo.size\n    if (downloadSize + copySize + (this.fileMetadataBuffer == null ? 0 : this.fileMetadataBuffer.length) !== newSize) {\n      throw new Error(`Internal error, size mismatch: downloadSize: ${downloadSize}, copySize: ${copySize}, newSize: ${newSize}`)\n    }\n\n    logger.info(`Full: ${formatBytes(newSize)}, To download: ${formatBytes(downloadSize)} (${Math.round(downloadSize / (newSize / 100))}%)`)\n\n    return this.downloadFile(operations)\n  }\n\n  private downloadFile(tasks: Array<Operation>): Promise<any> {\n    const fdList: Array<OpenedFile> = []\n    const closeFiles = (): Promise<Array<void>> => {\n      return Promise.all(\n        fdList.map(openedFile => {\n          return close(openedFile.descriptor).catch((e: any) => {\n            this.logger.error(`cannot close file \"${openedFile.path}\": ${e}`)\n          })\n        })\n      )\n    }\n    return this.doDownloadFile(tasks, fdList)\n      .then(closeFiles)\n      .catch((e: any) => {\n        // then must be after catch here (since then always throws error)\n        return closeFiles()\n          .catch(closeFilesError => {\n            // closeFiles never throw error, but just to be sure\n            try {\n              this.logger.error(`cannot close files: ${closeFilesError}`)\n            } catch (errorOnLog) {\n              try {\n                console.error(errorOnLog)\n              } catch (_ignored) {\n                // ok, give up and ignore error\n              }\n            }\n            throw e\n          })\n          .then(() => {\n            throw e\n          })\n      })\n  }\n\n  private async doDownloadFile(tasks: Array<Operation>, fdList: Array<OpenedFile>): Promise<any> {\n    const oldFileFd = await open(this.options.oldFile, \"r\")\n    fdList.push({ descriptor: oldFileFd, path: this.options.oldFile })\n    const newFileFd = await open(this.options.newFile, \"w\")\n    fdList.push({ descriptor: newFileFd, path: this.options.newFile })\n    const fileOut = createWriteStream(this.options.newFile, { fd: newFileFd })\n    await new Promise((resolve, reject) => {\n      const streams: Array<any> = []\n\n      // Create our download info transformer if we have one\n      let downloadInfoTransform: ProgressDifferentialDownloadCallbackTransform | undefined = undefined\n      if (!this.options.isUseMultipleRangeRequest && this.options.onProgress) {\n        const expectedByteCounts: Array<number> = []\n        let grandTotalBytes = 0\n\n        for (const task of tasks) {\n          if (task.kind === OperationKind.DOWNLOAD) {\n            expectedByteCounts.push(task.end - task.start)\n            grandTotalBytes += task.end - task.start\n          }\n        }\n\n        const progressDifferentialDownloadInfo: ProgressDifferentialDownloadInfo = {\n          expectedByteCounts: expectedByteCounts,\n          grandTotal: grandTotalBytes,\n        }\n\n        downloadInfoTransform = new ProgressDifferentialDownloadCallbackTransform(progressDifferentialDownloadInfo, this.options.cancellationToken, this.options.onProgress)\n        streams.push(downloadInfoTransform)\n      }\n\n      const digestTransform = new DigestTransform(this.blockAwareFileInfo.sha512)\n      // to simply debug, do manual validation to allow file to be fully written\n      digestTransform.isValidateOnEnd = false\n      streams.push(digestTransform)\n\n      // noinspection JSArrowFunctionCanBeReplacedWithShorthand\n      fileOut.on(\"finish\", () => {\n        ;(fileOut.close as any)(() => {\n          // remove from fd list because closed successfully\n          fdList.splice(1, 1)\n          try {\n            digestTransform.validate()\n          } catch (e: any) {\n            reject(e)\n            return\n          }\n\n          resolve(undefined)\n        })\n      })\n\n      streams.push(fileOut)\n\n      let lastStream = null\n      for (const stream of streams) {\n        stream.on(\"error\", reject)\n        if (lastStream == null) {\n          lastStream = stream\n        } else {\n          lastStream = lastStream.pipe(stream)\n        }\n      }\n\n      const firstStream = streams[0]\n\n      let w: any\n      if (this.options.isUseMultipleRangeRequest) {\n        w = executeTasksUsingMultipleRangeRequests(this, tasks, firstStream, oldFileFd, reject)\n        w(0)\n        return\n      }\n\n      let downloadOperationCount = 0\n      let actualUrl: string | null = null\n      this.logger.info(`Differential download: ${this.options.newUrl}`)\n\n      const requestOptions = this.createRequestOptions()\n      ;(requestOptions as any).redirect = \"manual\"\n\n      w = (index: number): void => {\n        if (index >= tasks.length) {\n          if (this.fileMetadataBuffer != null) {\n            firstStream.write(this.fileMetadataBuffer)\n          }\n          firstStream.end()\n          return\n        }\n\n        const operation = tasks[index++]\n        if (operation.kind === OperationKind.COPY) {\n          // We are copying, let's not send status updates to the UI\n          if (downloadInfoTransform) {\n            downloadInfoTransform.beginFileCopy()\n          }\n\n          copyData(operation, firstStream, oldFileFd, reject, () => w(index))\n          return\n        }\n\n        const range = `bytes=${operation.start}-${operation.end - 1}`\n        requestOptions.headers!.range = range\n\n        this.logger?.debug?.(`download range: ${range}`)\n\n        // We are starting to download\n        if (downloadInfoTransform) {\n          downloadInfoTransform.beginRangeDownload()\n        }\n\n        const request = this.httpExecutor.createRequest(requestOptions, response => {\n          response.on(\"error\", reject)\n          response.on(\"aborted\", () => {\n            reject(new Error(\"response has been aborted by the server\"))\n          })\n          // Electron net handles redirects automatically, our NodeJS test server doesn't use redirects - so, we don't check 3xx codes.\n          if (response.statusCode >= 400) {\n            reject(createHttpError(response))\n          }\n\n          response.pipe(firstStream, {\n            end: false,\n          })\n          response.once(\"end\", () => {\n            // Pass on that we are downloading a segment\n            if (downloadInfoTransform) {\n              downloadInfoTransform.endRangeDownload()\n            }\n\n            if (++downloadOperationCount === 100) {\n              downloadOperationCount = 0\n              setTimeout(() => w(index), 1000)\n            } else {\n              w(index)\n            }\n          })\n        })\n        request.on(\"redirect\", (statusCode: number, method: string, redirectUrl: string) => {\n          this.logger.info(`Redirect to ${removeQuery(redirectUrl)}`)\n          actualUrl = redirectUrl\n          configureRequestUrl(new URL(actualUrl), requestOptions)\n          request.followRedirect()\n        })\n        this.httpExecutor.addErrorAndTimeoutHandlers(request, reject)\n        request.end()\n      }\n\n      w(0)\n    })\n  }\n\n  protected async readRemoteBytes(start: number, endInclusive: number): Promise<Buffer> {\n    const buffer = Buffer.allocUnsafe(endInclusive + 1 - start)\n    const requestOptions = this.createRequestOptions()\n    requestOptions.headers!.range = `bytes=${start}-${endInclusive}`\n    let position = 0\n    await this.request(requestOptions, chunk => {\n      chunk.copy(buffer, position)\n      position += chunk.length\n    })\n\n    if (position !== buffer.length) {\n      throw new Error(`Received data length ${position} is not equal to expected ${buffer.length}`)\n    }\n    return buffer\n  }\n\n  private request(requestOptions: RequestOptions, dataHandler: (chunk: Buffer) => void): Promise<void> {\n    return new Promise((resolve, reject) => {\n      const request = this.httpExecutor.createRequest(requestOptions, response => {\n        if (!checkIsRangesSupported(response, reject)) {\n          return\n        }\n\n        response.on(\"error\", reject)\n        response.on(\"aborted\", () => {\n          reject(new Error(\"response has been aborted by the server\"))\n        })\n\n        response.on(\"data\", dataHandler)\n        response.on(\"end\", () => resolve())\n      })\n      this.httpExecutor.addErrorAndTimeoutHandlers(request, reject)\n      request.end()\n    })\n  }\n}\n\nfunction formatBytes(value: number, symbol = \" KB\"): string {\n  return new Intl.NumberFormat(\"en\").format((value / 1024).toFixed(2) as any) + symbol\n}\n\n// safety\nfunction removeQuery(url: string): string {\n  const index = url.indexOf(\"?\")\n  return index < 0 ? url : url.substring(0, index)\n}\n\ninterface OpenedFile {\n  readonly descriptor: number\n  readonly path: string\n}\n"]}"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.FileWithEmbeddedBlockMapDifferentialDownloader = void 0;
const fs_extra_1 = require("fs-extra");
const DifferentialDownloader_1 = require("./DifferentialDownloader");
const zlib_1 = require("zlib");
class FileWithEmbeddedBlockMapDifferentialDownloader extends DifferentialDownloader_1.DifferentialDownloader {
    async download() {
        const packageInfo = this.blockAwareFileInfo;
        const fileSize = packageInfo.size;
        const offset = fileSize - (packageInfo.blockMapSize + 4);
        this.fileMetadataBuffer = await this.readRemoteBytes(offset, fileSize - 1);
        const newBlockMap = readBlockMap(this.fileMetadataBuffer.slice(0, this.fileMetadataBuffer.length - 4));
        await this.doDownload(await readEmbeddedBlockMapData(this.options.oldFile), newBlockMap);
    }
}
exports.FileWithEmbeddedBlockMapDifferentialDownloader = FileWithEmbeddedBlockMapDifferentialDownloader;
function readBlockMap(data) {
    return JSON.parse((0, zlib_1.inflateRawSync)(data).toString());
}
async function readEmbeddedBlockMapData(file) {
    const fd = await (0, fs_extra_1.open)(file, "r");
    try {
        const fileSize = (await (0, fs_extra_1.fstat)(fd)).size;
        const sizeBuffer = Buffer.allocUnsafe(4);
        await (0, fs_extra_1.read)(fd, sizeBuffer, 0, sizeBuffer.length, fileSize - sizeBuffer.length);
        const dataBuffer = Buffer.allocUnsafe(sizeBuffer.readUInt32BE(0));
        await (0, fs_extra_1.read)(fd, dataBuffer, 0, dataBuffer.length, fileSize - sizeBuffer.length - dataBuffer.length);
        await (0, fs_extra_1.close)(fd);
        return readBlockMap(dataBuffer);
    }
    catch (e) {
        await (0, fs_extra_1.close)(fd);
        throw e;
    }
}
//# sourceMappingURL=FileWithEmbeddedBlockMapDifferentialDownloader.js.map{"version":3,"file":"FileWithEmbeddedBlockMapDifferentialDownloader.js","sourceRoot":"","sources":["../../src/differentialDownloader/FileWithEmbeddedBlockMapDifferentialDownloader.ts"],"names":[],"mappings":";;;AACA,uCAAmD;AACnD,qEAAiE;AACjE,+BAAqC;AAErC,MAAa,8CAA+C,SAAQ,+CAAsB;IACxF,KAAK,CAAC,QAAQ;QACZ,MAAM,WAAW,GAAG,IAAI,CAAC,kBAAkB,CAAA;QAC3C,MAAM,QAAQ,GAAG,WAAW,CAAC,IAAK,CAAA;QAClC,MAAM,MAAM,GAAG,QAAQ,GAAG,CAAC,WAAW,CAAC,YAAa,GAAG,CAAC,CAAC,CAAA;QACzD,IAAI,CAAC,kBAAkB,GAAG,MAAM,IAAI,CAAC,eAAe,CAAC,MAAM,EAAE,QAAQ,GAAG,CAAC,CAAC,CAAA;QAC1E,MAAM,WAAW,GAAG,YAAY,CAAC,IAAI,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,kBAAkB,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAA;QACtG,MAAM,IAAI,CAAC,UAAU,CAAC,MAAM,wBAAwB,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,WAAW,CAAC,CAAA;IAC1F,CAAC;CACF;AATD,wGASC;AAED,SAAS,YAAY,CAAC,IAAY;IAChC,OAAO,IAAI,CAAC,KAAK,CAAC,IAAA,qBAAc,EAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAA;AACpD,CAAC;AAED,KAAK,UAAU,wBAAwB,CAAC,IAAY;IAClD,MAAM,EAAE,GAAG,MAAM,IAAA,eAAI,EAAC,IAAI,EAAE,GAAG,CAAC,CAAA;IAChC,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,CAAC,MAAM,IAAA,gBAAK,EAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAA;QACvC,MAAM,UAAU,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,CAAA;QACxC,MAAM,IAAA,eAAI,EAAC,EAAE,EAAE,UAAU,EAAE,CAAC,EAAE,UAAU,CAAC,MAAM,EAAE,QAAQ,GAAG,UAAU,CAAC,MAAM,CAAC,CAAA;QAE9E,MAAM,UAAU,GAAG,MAAM,CAAC,WAAW,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAA;QACjE,MAAM,IAAA,eAAI,EAAC,EAAE,EAAE,UAAU,EAAE,CAAC,EAAE,UAAU,CAAC,MAAM,EAAE,QAAQ,GAAG,UAAU,CAAC,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC,CAAA;QAClG,MAAM,IAAA,gBAAK,EAAC,EAAE,CAAC,CAAA;QAEf,OAAO,YAAY,CAAC,UAAU,CAAC,CAAA;IACjC,CAAC;IAAC,OAAO,CAAM,EAAE,CAAC;QAChB,MAAM,IAAA,gBAAK,EAAC,EAAE,CAAC,CAAA;QACf,MAAM,CAAC,CAAA;IACT,CAAC;AACH,CAAC","sourcesContent":["import { BlockMap } from \"builder-util-runtime/out/blockMapApi\"\nimport { close, fstat, open, read } from \"fs-extra\"\nimport { DifferentialDownloader } from \"./DifferentialDownloader\"\nimport { inflateRawSync } from \"zlib\"\n\nexport class FileWithEmbeddedBlockMapDifferentialDownloader extends DifferentialDownloader {\n  async download(): Promise<void> {\n    const packageInfo = this.blockAwareFileInfo\n    const fileSize = packageInfo.size!\n    const offset = fileSize - (packageInfo.blockMapSize! + 4)\n    this.fileMetadataBuffer = await this.readRemoteBytes(offset, fileSize - 1)\n    const newBlockMap = readBlockMap(this.fileMetadataBuffer.slice(0, this.fileMetadataBuffer.length - 4))\n    await this.doDownload(await readEmbeddedBlockMapData(this.options.oldFile), newBlockMap)\n  }\n}\n\nfunction readBlockMap(data: Buffer): BlockMap {\n  return JSON.parse(inflateRawSync(data).toString())\n}\n\nasync function readEmbeddedBlockMapData(file: string): Promise<BlockMap> {\n  const fd = await open(file, \"r\")\n  try {\n    const fileSize = (await fstat(fd)).size\n    const sizeBuffer = Buffer.allocUnsafe(4)\n    await read(fd, sizeBuffer, 0, sizeBuffer.length, fileSize - sizeBuffer.length)\n\n    const dataBuffer = Buffer.allocUnsafe(sizeBuffer.readUInt32BE(0))\n    await read(fd, dataBuffer, 0, dataBuffer.length, fileSize - sizeBuffer.length - dataBuffer.length)\n    await close(fd)\n\n    return readBlockMap(dataBuffer)\n  } catch (e: any) {\n    await close(fd)\n    throw e\n  }\n}\n"]}"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.GenericDifferentialDownloader = void 0;
const DifferentialDownloader_1 = require("./DifferentialDownloader");
class GenericDifferentialDownloader extends DifferentialDownloader_1.DifferentialDownloader {
    download(oldBlockMap, newBlockMap) {
        return this.doDownload(oldBlockMap, newBlockMap);
    }
}
exports.GenericDifferentialDownloader = GenericDifferentialDownloader;
//# sourceMappingURL=GenericDifferentialDownloader.js.map{"version":3,"file":"GenericDifferentialDownloader.js","sourceRoot":"","sources":["../../src/differentialDownloader/GenericDifferentialDownloader.ts"],"names":[],"mappings":";;;AACA,qEAAiE;AAEjE,MAAa,6BAA8B,SAAQ,+CAAsB;IACvE,QAAQ,CAAC,WAAqB,EAAE,WAAqB;QACnD,OAAO,IAAI,CAAC,UAAU,CAAC,WAAW,EAAE,WAAW,CAAC,CAAA;IAClD,CAAC;CACF;AAJD,sEAIC","sourcesContent":["import { BlockMap } from \"builder-util-runtime/out/blockMapApi\"\nimport { DifferentialDownloader } from \"./DifferentialDownloader\"\n\nexport class GenericDifferentialDownloader extends DifferentialDownloader {\n  download(oldBlockMap: BlockMap, newBlockMap: BlockMap): Promise<any> {\n    return this.doDownload(oldBlockMap, newBlockMap)\n  }\n}\n"]}"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ProgressDifferentialDownloadCallbackTransform = void 0;
const stream_1 = require("stream");
var OperationKind;
(function (OperationKind) {
    OperationKind[OperationKind["COPY"] = 0] = "COPY";
    OperationKind[OperationKind["DOWNLOAD"] = 1] = "DOWNLOAD";
})(OperationKind || (OperationKind = {}));
class ProgressDifferentialDownloadCallbackTransform extends stream_1.Transform {
    constructor(progressDifferentialDownloadInfo, cancellationToken, onProgress) {
        super();
        this.progressDifferentialDownloadInfo = progressDifferentialDownloadInfo;
        this.cancellationToken = cancellationToken;
        this.onProgress = onProgress;
        this.start = Date.now();
        this.transferred = 0;
        this.delta = 0;
        this.expectedBytes = 0;
        this.index = 0;
        this.operationType = OperationKind.COPY;
        this.nextUpdate = this.start + 1000;
    }
    _transform(chunk, encoding, callback) {
        if (this.cancellationToken.cancelled) {
            callback(new Error("cancelled"), null);
            return;
        }
        // Don't send progress update when copying from disk
        if (this.operationType == OperationKind.COPY) {
            callback(null, chunk);
            return;
        }
        this.transferred += chunk.length;
        this.delta += chunk.length;
        const now = Date.now();
        if (now >= this.nextUpdate &&
            this.transferred !== this.expectedBytes /* will be emitted by endRangeDownload() */ &&
            this.transferred !== this.progressDifferentialDownloadInfo.grandTotal /* will be emitted on _flush */) {
            this.nextUpdate = now + 1000;
            this.onProgress({
                total: this.progressDifferentialDownloadInfo.grandTotal,
                delta: this.delta,
                transferred: this.transferred,
                percent: (this.transferred / this.progressDifferentialDownloadInfo.grandTotal) * 100,
                bytesPerSecond: Math.round(this.transferred / ((now - this.start) / 1000)),
            });
            this.delta = 0;
        }
        callback(null, chunk);
    }
    beginFileCopy() {
        this.operationType = OperationKind.COPY;
    }
    beginRangeDownload() {
        this.operationType = OperationKind.DOWNLOAD;
        this.expectedBytes += this.progressDifferentialDownloadInfo.expectedByteCounts[this.index++];
    }
    endRangeDownload() {
        // _flush() will doour final 100%
        if (this.transferred !== this.progressDifferentialDownloadInfo.grandTotal) {
            this.onProgress({
                total: this.progressDifferentialDownloadInfo.grandTotal,
                delta: this.delta,
                transferred: this.transferred,
                percent: (this.transferred / this.progressDifferentialDownloadInfo.grandTotal) * 100,
                bytesPerSecond: Math.round(this.transferred / ((Date.now() - this.start) / 1000)),
            });
        }
    }
    // Called when we are 100% done with the connection/download
    _flush(callback) {
        if (this.cancellationToken.cancelled) {
            callback(new Error("cancelled"));
            return;
        }
        this.onProgress({
            total: this.progressDifferentialDownloadInfo.grandTotal,
            delta: this.delta,
            transferred: this.transferred,
            percent: 100,
            bytesPerSecond: Math.round(this.transferred / ((Date.now() - this.start) / 1000)),
        });
        this.delta = 0;
        this.transferred = 0;
        callback(null);
    }
}
exports.ProgressDifferentialDownloadCallbackTransform = ProgressDifferentialDownloadCallbackTransform;
//# sourceMappingURL=ProgressDifferentialDownloadCallbackTransform.js.map{"version":3,"file":"ProgressDifferentialDownloadCallbackTransform.js","sourceRoot":"","sources":["../../src/differentialDownloader/ProgressDifferentialDownloadCallbackTransform.ts"],"names":[],"mappings":";;;AAAA,mCAAkC;AAGlC,IAAK,aAGJ;AAHD,WAAK,aAAa;IAChB,iDAAI,CAAA;IACJ,yDAAQ,CAAA;AACV,CAAC,EAHI,aAAa,KAAb,aAAa,QAGjB;AAeD,MAAa,6CAA8C,SAAQ,kBAAS;IAU1E,YACmB,gCAAkE,EAClE,iBAAoC,EACpC,UAAuC;QAExD,KAAK,EAAE,CAAA;QAJU,qCAAgC,GAAhC,gCAAgC,CAAkC;QAClE,sBAAiB,GAAjB,iBAAiB,CAAmB;QACpC,eAAU,GAAV,UAAU,CAA6B;QAZlD,UAAK,GAAG,IAAI,CAAC,GAAG,EAAE,CAAA;QAClB,gBAAW,GAAG,CAAC,CAAA;QACf,UAAK,GAAG,CAAC,CAAA;QACT,kBAAa,GAAG,CAAC,CAAA;QACjB,UAAK,GAAG,CAAC,CAAA;QACT,kBAAa,GAAG,aAAa,CAAC,IAAI,CAAA;QAElC,eAAU,GAAG,IAAI,CAAC,KAAK,GAAG,IAAI,CAAA;IAQtC,CAAC;IAED,UAAU,CAAC,KAAU,EAAE,QAAgB,EAAE,QAAa;QACpD,IAAI,IAAI,CAAC,iBAAiB,CAAC,SAAS,EAAE,CAAC;YACrC,QAAQ,CAAC,IAAI,KAAK,CAAC,WAAW,CAAC,EAAE,IAAI,CAAC,CAAA;YACtC,OAAM;QACR,CAAC;QAED,oDAAoD;QACpD,IAAI,IAAI,CAAC,aAAa,IAAI,aAAa,CAAC,IAAI,EAAE,CAAC;YAC7C,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;YACrB,OAAM;QACR,CAAC;QAED,IAAI,CAAC,WAAW,IAAI,KAAK,CAAC,MAAM,CAAA;QAChC,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,MAAM,CAAA;QAE1B,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,CAAA;QACtB,IACE,GAAG,IAAI,IAAI,CAAC,UAAU;YACtB,IAAI,CAAC,WAAW,KAAK,IAAI,CAAC,aAAa,CAAC,2CAA2C;YACnF,IAAI,CAAC,WAAW,KAAK,IAAI,CAAC,gCAAgC,CAAC,UAAU,CAAC,+BAA+B,EACrG,CAAC;YACD,IAAI,CAAC,UAAU,GAAG,GAAG,GAAG,IAAI,CAAA;YAE5B,IAAI,CAAC,UAAU,CAAC;gBACd,KAAK,EAAE,IAAI,CAAC,gCAAgC,CAAC,UAAU;gBACvD,KAAK,EAAE,IAAI,CAAC,KAAK;gBACjB,WAAW,EAAE,IAAI,CAAC,WAAW;gBAC7B,OAAO,EAAE,CAAC,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,gCAAgC,CAAC,UAAU,CAAC,GAAG,GAAG;gBACpF,cAAc,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,GAAG,CAAC,CAAC,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC;aAC3E,CAAC,CAAA;YACF,IAAI,CAAC,KAAK,GAAG,CAAC,CAAA;QAChB,CAAC;QAED,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;IACvB,CAAC;IAED,aAAa;QACX,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC,IAAI,CAAA;IACzC,CAAC;IAED,kBAAkB;QAChB,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC,QAAQ,CAAA;QAE3C,IAAI,CAAC,aAAa,IAAI,IAAI,CAAC,gCAAgC,CAAC,kBAAkB,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,CAAA;IAC9F,CAAC;IAED,gBAAgB;QACd,iCAAiC;QACjC,IAAI,IAAI,CAAC,WAAW,KAAK,IAAI,CAAC,gCAAgC,CAAC,UAAU,EAAE,CAAC;YAC1E,IAAI,CAAC,UAAU,CAAC;gBACd,KAAK,EAAE,IAAI,CAAC,gCAAgC,CAAC,UAAU;gBACvD,KAAK,EAAE,IAAI,CAAC,KAAK;gBACjB,WAAW,EAAE,IAAI,CAAC,WAAW;gBAC7B,OAAO,EAAE,CAAC,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,gCAAgC,CAAC,UAAU,CAAC,GAAG,GAAG;gBACpF,cAAc,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC;aAClF,CAAC,CAAA;QACJ,CAAC;IACH,CAAC;IAED,4DAA4D;IAC5D,MAAM,CAAC,QAAa;QAClB,IAAI,IAAI,CAAC,iBAAiB,CAAC,SAAS,EAAE,CAAC;YACrC,QAAQ,CAAC,IAAI,KAAK,CAAC,WAAW,CAAC,CAAC,CAAA;YAChC,OAAM;QACR,CAAC;QAED,IAAI,CAAC,UAAU,CAAC;YACd,KAAK,EAAE,IAAI,CAAC,gCAAgC,CAAC,UAAU;YACvD,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,OAAO,EAAE,GAAG;YACZ,cAAc,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC;SAClF,CAAC,CAAA;QACF,IAAI,CAAC,KAAK,GAAG,CAAC,CAAA;QACd,IAAI,CAAC,WAAW,GAAG,CAAC,CAAA;QAEpB,QAAQ,CAAC,IAAI,CAAC,CAAA;IAChB,CAAC;CACF;AAhGD,sGAgGC","sourcesContent":["import { Transform } from \"stream\"\nimport { CancellationToken } from \"builder-util-runtime\"\n\nenum OperationKind {\n  COPY,\n  DOWNLOAD,\n}\n\nexport interface ProgressInfo {\n  total: number\n  delta: number\n  transferred: number\n  percent: number\n  bytesPerSecond: number\n}\n\nexport interface ProgressDifferentialDownloadInfo {\n  expectedByteCounts: Array<number>\n  grandTotal: number\n}\n\nexport class ProgressDifferentialDownloadCallbackTransform extends Transform {\n  private start = Date.now()\n  private transferred = 0\n  private delta = 0\n  private expectedBytes = 0\n  private index = 0\n  private operationType = OperationKind.COPY\n\n  private nextUpdate = this.start + 1000\n\n  constructor(\n    private readonly progressDifferentialDownloadInfo: ProgressDifferentialDownloadInfo,\n    private readonly cancellationToken: CancellationToken,\n    private readonly onProgress: (info: ProgressInfo) => any\n  ) {\n    super()\n  }\n\n  _transform(chunk: any, encoding: string, callback: any) {\n    if (this.cancellationToken.cancelled) {\n      callback(new Error(\"cancelled\"), null)\n      return\n    }\n\n    // Don't send progress update when copying from disk\n    if (this.operationType == OperationKind.COPY) {\n      callback(null, chunk)\n      return\n    }\n\n    this.transferred += chunk.length\n    this.delta += chunk.length\n\n    const now = Date.now()\n    if (\n      now >= this.nextUpdate &&\n      this.transferred !== this.expectedBytes /* will be emitted by endRangeDownload() */ &&\n      this.transferred !== this.progressDifferentialDownloadInfo.grandTotal /* will be emitted on _flush */\n    ) {\n      this.nextUpdate = now + 1000\n\n      this.onProgress({\n        total: this.progressDifferentialDownloadInfo.grandTotal,\n        delta: this.delta,\n        transferred: this.transferred,\n        percent: (this.transferred / this.progressDifferentialDownloadInfo.grandTotal) * 100,\n        bytesPerSecond: Math.round(this.transferred / ((now - this.start) / 1000)),\n      })\n      this.delta = 0\n    }\n\n    callback(null, chunk)\n  }\n\n  beginFileCopy(): void {\n    this.operationType = OperationKind.COPY\n  }\n\n  beginRangeDownload(): void {\n    this.operationType = OperationKind.DOWNLOAD\n\n    this.expectedBytes += this.progressDifferentialDownloadInfo.expectedByteCounts[this.index++]\n  }\n\n  endRangeDownload(): void {\n    // _flush() will doour final 100%\n    if (this.transferred !== this.progressDifferentialDownloadInfo.grandTotal) {\n      this.onProgress({\n        total: this.progressDifferentialDownloadInfo.grandTotal,\n        delta: this.delta,\n        transferred: this.transferred,\n        percent: (this.transferred / this.progressDifferentialDownloadInfo.grandTotal) * 100,\n        bytesPerSecond: Math.round(this.transferred / ((Date.now() - this.start) / 1000)),\n      })\n    }\n  }\n\n  // Called when we are 100% done with the connection/download\n  _flush(callback: any): void {\n    if (this.cancellationToken.cancelled) {\n      callback(new Error(\"cancelled\"))\n      return\n    }\n\n    this.onProgress({\n      total: this.progressDifferentialDownloadInfo.grandTotal,\n      delta: this.delta,\n      transferred: this.transferred,\n      percent: 100,\n      bytesPerSecond: Math.round(this.transferred / ((Date.now() - this.start) / 1000)),\n    })\n    this.delta = 0\n    this.transferred = 0\n\n    callback(null)\n  }\n}\n"]}"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.OperationKind = void 0;
exports.computeOperations = computeOperations;
var OperationKind;
(function (OperationKind) {
    OperationKind[OperationKind["COPY"] = 0] = "COPY";
    OperationKind[OperationKind["DOWNLOAD"] = 1] = "DOWNLOAD";
})(OperationKind || (exports.OperationKind = OperationKind = {}));
function computeOperations(oldBlockMap, newBlockMap, logger) {
    const nameToOldBlocks = buildBlockFileMap(oldBlockMap.files);
    const nameToNewBlocks = buildBlockFileMap(newBlockMap.files);
    let lastOperation = null;
    // for now only one file is supported in block map
    const blockMapFile = newBlockMap.files[0];
    const operations = [];
    const name = blockMapFile.name;
    const oldEntry = nameToOldBlocks.get(name);
    if (oldEntry == null) {
        // new file (unrealistic case for now, because in any case both blockmap contain the only file named as "file")
        throw new Error(`no file ${name} in old blockmap`);
    }
    const newFile = nameToNewBlocks.get(name);
    let changedBlockCount = 0;
    const { checksumToOffset: checksumToOldOffset, checksumToOldSize } = buildChecksumMap(nameToOldBlocks.get(name), oldEntry.offset, logger);
    let newOffset = blockMapFile.offset;
    for (let i = 0; i < newFile.checksums.length; newOffset += newFile.sizes[i], i++) {
        const blockSize = newFile.sizes[i];
        const checksum = newFile.checksums[i];
        let oldOffset = checksumToOldOffset.get(checksum);
        if (oldOffset != null && checksumToOldSize.get(checksum) !== blockSize) {
            logger.warn(`Checksum ("${checksum}") matches, but size differs (old: ${checksumToOldSize.get(checksum)}, new: ${blockSize})`);
            oldOffset = undefined;
        }
        if (oldOffset === undefined) {
            // download data from new file
            changedBlockCount++;
            if (lastOperation != null && lastOperation.kind === OperationKind.DOWNLOAD && lastOperation.end === newOffset) {
                lastOperation.end += blockSize;
            }
            else {
                lastOperation = {
                    kind: OperationKind.DOWNLOAD,
                    start: newOffset,
                    end: newOffset + blockSize,
                    // oldBlocks: null,
                };
                validateAndAdd(lastOperation, operations, checksum, i);
            }
        }
        else {
            // reuse data from old file
            if (lastOperation != null && lastOperation.kind === OperationKind.COPY && lastOperation.end === oldOffset) {
                lastOperation.end += blockSize;
                // lastOperation.oldBlocks!!.push(checksum)
            }
            else {
                lastOperation = {
                    kind: OperationKind.COPY,
                    start: oldOffset,
                    end: oldOffset + blockSize,
                    // oldBlocks: [checksum]
                };
                validateAndAdd(lastOperation, operations, checksum, i);
            }
        }
    }
    if (changedBlockCount > 0) {
        logger.info(`File${blockMapFile.name === "file" ? "" : " " + blockMapFile.name} has ${changedBlockCount} changed blocks`);
    }
    return operations;
}
const isValidateOperationRange = process.env["DIFFERENTIAL_DOWNLOAD_PLAN_BUILDER_VALIDATE_RANGES"] === "true";
function validateAndAdd(operation, operations, checksum, index) {
    if (isValidateOperationRange && operations.length !== 0) {
        const lastOperation = operations[operations.length - 1];
        if (lastOperation.kind === operation.kind && operation.start < lastOperation.end && operation.start > lastOperation.start) {
            const min = [lastOperation.start, lastOperation.end, operation.start, operation.end].reduce((p, v) => (p < v ? p : v));
            throw new Error(`operation (block index: ${index}, checksum: ${checksum}, kind: ${OperationKind[operation.kind]}) overlaps previous operation (checksum: ${checksum}):\n` +
                `abs: ${lastOperation.start} until ${lastOperation.end} and ${operation.start} until ${operation.end}\n` +
                `rel: ${lastOperation.start - min} until ${lastOperation.end - min} and ${operation.start - min} until ${operation.end - min}`);
        }
    }
    operations.push(operation);
}
function buildChecksumMap(file, fileOffset, logger) {
    const checksumToOffset = new Map();
    const checksumToSize = new Map();
    let offset = fileOffset;
    for (let i = 0; i < file.checksums.length; i++) {
        const checksum = file.checksums[i];
        const size = file.sizes[i];
        const existing = checksumToSize.get(checksum);
        if (existing === undefined) {
            checksumToOffset.set(checksum, offset);
            checksumToSize.set(checksum, size);
        }
        else if (logger.debug != null) {
            const sizeExplanation = existing === size ? "(same size)" : `(size: ${existing}, this size: ${size})`;
            logger.debug(`${checksum} duplicated in blockmap ${sizeExplanation}, it doesn't lead to broken differential downloader, just corresponding block will be skipped)`);
        }
        offset += size;
    }
    return { checksumToOffset, checksumToOldSize: checksumToSize };
}
function buildBlockFileMap(list) {
    const result = new Map();
    for (const item of list) {
        result.set(item.name, item);
    }
    return result;
}
//# sourceMappingURL=downloadPlanBuilder.js.map{"version":3,"file":"downloadPlanBuilder.js","sourceRoot":"","sources":["../../src/differentialDownloader/downloadPlanBuilder.ts"],"names":[],"mappings":";;;AAoBA,8CAmEC;AApFD,IAAY,aAGX;AAHD,WAAY,aAAa;IACvB,iDAAI,CAAA;IACJ,yDAAQ,CAAA;AACV,CAAC,EAHW,aAAa,6BAAb,aAAa,QAGxB;AAcD,SAAgB,iBAAiB,CAAC,WAAqB,EAAE,WAAqB,EAAE,MAAc;IAC5F,MAAM,eAAe,GAAG,iBAAiB,CAAC,WAAW,CAAC,KAAK,CAAC,CAAA;IAC5D,MAAM,eAAe,GAAG,iBAAiB,CAAC,WAAW,CAAC,KAAK,CAAC,CAAA;IAE5D,IAAI,aAAa,GAAqB,IAAI,CAAA;IAE1C,kDAAkD;IAClD,MAAM,YAAY,GAAqC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;IAC3E,MAAM,UAAU,GAAqB,EAAE,CAAA;IACvC,MAAM,IAAI,GAAG,YAAY,CAAC,IAAI,CAAA;IAC9B,MAAM,QAAQ,GAAG,eAAe,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;IAC1C,IAAI,QAAQ,IAAI,IAAI,EAAE,CAAC;QACrB,+GAA+G;QAC/G,MAAM,IAAI,KAAK,CAAC,WAAW,IAAI,kBAAkB,CAAC,CAAA;IACpD,CAAC;IAED,MAAM,OAAO,GAAG,eAAe,CAAC,GAAG,CAAC,IAAI,CAAE,CAAA;IAC1C,IAAI,iBAAiB,GAAG,CAAC,CAAA;IAEzB,MAAM,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,GAAG,gBAAgB,CAAC,eAAe,CAAC,GAAG,CAAC,IAAI,CAAE,EAAE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAE1I,IAAI,SAAS,GAAG,YAAY,CAAC,MAAM,CAAA;IACnC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,SAAS,CAAC,MAAM,EAAE,SAAS,IAAI,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;QACjF,MAAM,SAAS,GAAW,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;QAC1C,MAAM,QAAQ,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,CAAA;QACrC,IAAI,SAAS,GAAG,mBAAmB,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;QACjD,IAAI,SAAS,IAAI,IAAI,IAAI,iBAAiB,CAAC,GAAG,CAAC,QAAQ,CAAC,KAAK,SAAS,EAAE,CAAC;YACvE,MAAM,CAAC,IAAI,CAAC,cAAc,QAAQ,sCAAsC,iBAAiB,CAAC,GAAG,CAAC,QAAQ,CAAC,UAAU,SAAS,GAAG,CAAC,CAAA;YAC9H,SAAS,GAAG,SAAS,CAAA;QACvB,CAAC;QAED,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;YAC5B,8BAA8B;YAC9B,iBAAiB,EAAE,CAAA;YAEnB,IAAI,aAAa,IAAI,IAAI,IAAI,aAAa,CAAC,IAAI,KAAK,aAAa,CAAC,QAAQ,IAAI,aAAa,CAAC,GAAG,KAAK,SAAS,EAAE,CAAC;gBAC9G,aAAa,CAAC,GAAG,IAAI,SAAS,CAAA;YAChC,CAAC;iBAAM,CAAC;gBACN,aAAa,GAAG;oBACd,IAAI,EAAE,aAAa,CAAC,QAAQ;oBAC5B,KAAK,EAAE,SAAS;oBAChB,GAAG,EAAE,SAAS,GAAG,SAAS;oBAC1B,mBAAmB;iBACpB,CAAA;gBACD,cAAc,CAAC,aAAa,EAAE,UAAU,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAA;YACxD,CAAC;QACH,CAAC;aAAM,CAAC;YACN,2BAA2B;YAC3B,IAAI,aAAa,IAAI,IAAI,IAAI,aAAa,CAAC,IAAI,KAAK,aAAa,CAAC,IAAI,IAAI,aAAa,CAAC,GAAG,KAAK,SAAS,EAAE,CAAC;gBAC1G,aAAa,CAAC,GAAG,IAAI,SAAS,CAAA;gBAC9B,2CAA2C;YAC7C,CAAC;iBAAM,CAAC;gBACN,aAAa,GAAG;oBACd,IAAI,EAAE,aAAa,CAAC,IAAI;oBACxB,KAAK,EAAE,SAAS;oBAChB,GAAG,EAAE,SAAS,GAAG,SAAS;oBAC1B,wBAAwB;iBACzB,CAAA;gBACD,cAAc,CAAC,aAAa,EAAE,UAAU,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAA;YACxD,CAAC;QACH,CAAC;IACH,CAAC;IAED,IAAI,iBAAiB,GAAG,CAAC,EAAE,CAAC;QAC1B,MAAM,CAAC,IAAI,CAAC,OAAO,YAAY,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,GAAG,YAAY,CAAC,IAAI,QAAQ,iBAAiB,iBAAiB,CAAC,CAAA;IAC3H,CAAC;IACD,OAAO,UAAU,CAAA;AACnB,CAAC;AAED,MAAM,wBAAwB,GAAG,OAAO,CAAC,GAAG,CAAC,oDAAoD,CAAC,KAAK,MAAM,CAAA;AAE7G,SAAS,cAAc,CAAC,SAAoB,EAAE,UAA4B,EAAE,QAAgB,EAAE,KAAa;IACzG,IAAI,wBAAwB,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACxD,MAAM,aAAa,GAAG,UAAU,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC,CAAA;QACvD,IAAI,aAAa,CAAC,IAAI,KAAK,SAAS,CAAC,IAAI,IAAI,SAAS,CAAC,KAAK,GAAG,aAAa,CAAC,GAAG,IAAI,SAAS,CAAC,KAAK,GAAG,aAAa,CAAC,KAAK,EAAE,CAAC;YAC1H,MAAM,GAAG,GAAG,CAAC,aAAa,CAAC,KAAK,EAAE,aAAa,CAAC,GAAG,EAAE,SAAS,CAAC,KAAK,EAAE,SAAS,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;YACtH,MAAM,IAAI,KAAK,CACb,2BAA2B,KAAK,eAAe,QAAQ,WAAW,aAAa,CAAC,SAAS,CAAC,IAAI,CAAC,4CAA4C,QAAQ,MAAM;gBACvJ,QAAQ,aAAa,CAAC,KAAK,UAAU,aAAa,CAAC,GAAG,QAAQ,SAAS,CAAC,KAAK,UAAU,SAAS,CAAC,GAAG,IAAI;gBACxG,QAAQ,aAAa,CAAC,KAAK,GAAG,GAAG,UAAU,aAAa,CAAC,GAAG,GAAG,GAAG,QAAQ,SAAS,CAAC,KAAK,GAAG,GAAG,UAAU,SAAS,CAAC,GAAG,GAAG,GAAG,EAAE,CACjI,CAAA;QACH,CAAC;IACH,CAAC;IACD,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;AAC5B,CAAC;AAED,SAAS,gBAAgB,CAAC,IAAkB,EAAE,UAAkB,EAAE,MAAc;IAC9E,MAAM,gBAAgB,GAAG,IAAI,GAAG,EAAkB,CAAA;IAClD,MAAM,cAAc,GAAG,IAAI,GAAG,EAAkB,CAAA;IAChD,IAAI,MAAM,GAAG,UAAU,CAAA;IACvB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QAC/C,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAA;QAClC,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;QAE1B,MAAM,QAAQ,GAAG,cAAc,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;QAC7C,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;YAC3B,gBAAgB,CAAC,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAA;YACtC,cAAc,CAAC,GAAG,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAA;QACpC,CAAC;aAAM,IAAI,MAAM,CAAC,KAAK,IAAI,IAAI,EAAE,CAAC;YAChC,MAAM,eAAe,GAAG,QAAQ,KAAK,IAAI,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,UAAU,QAAQ,gBAAgB,IAAI,GAAG,CAAA;YACrG,MAAM,CAAC,KAAK,CAAC,GAAG,QAAQ,2BAA2B,eAAe,gGAAgG,CAAC,CAAA;QACrK,CAAC;QACD,MAAM,IAAI,IAAI,CAAA;IAChB,CAAC;IACD,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,cAAc,EAAE,CAAA;AAChE,CAAC;AAED,SAAS,iBAAiB,CAAC,IAAyB;IAClD,MAAM,MAAM,GAAG,IAAI,GAAG,EAAwB,CAAA;IAC9C,KAAK,MAAM,IAAI,IAAI,IAAI,EAAE,CAAC;QACxB,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAA;IAC7B,CAAC;IACD,OAAO,MAAM,CAAA;AACf,CAAC","sourcesContent":["import { BlockMap, BlockMapFile } from \"builder-util-runtime/out/blockMapApi\"\nimport { Logger } from \"../types\"\n\nexport enum OperationKind {\n  COPY,\n  DOWNLOAD,\n}\n\nexport interface Operation {\n  kind: OperationKind\n\n  // inclusive\n  start: number\n  // exclusive\n  end: number\n\n  // debug only\n  // oldBlocks: Array<string> | null\n}\n\nexport function computeOperations(oldBlockMap: BlockMap, newBlockMap: BlockMap, logger: Logger): Array<Operation> {\n  const nameToOldBlocks = buildBlockFileMap(oldBlockMap.files)\n  const nameToNewBlocks = buildBlockFileMap(newBlockMap.files)\n\n  let lastOperation: Operation | null = null\n\n  // for now only one file is supported in block map\n  const blockMapFile: { name: string; offset: number } = newBlockMap.files[0]\n  const operations: Array<Operation> = []\n  const name = blockMapFile.name\n  const oldEntry = nameToOldBlocks.get(name)\n  if (oldEntry == null) {\n    // new file (unrealistic case for now, because in any case both blockmap contain the only file named as \"file\")\n    throw new Error(`no file ${name} in old blockmap`)\n  }\n\n  const newFile = nameToNewBlocks.get(name)!\n  let changedBlockCount = 0\n\n  const { checksumToOffset: checksumToOldOffset, checksumToOldSize } = buildChecksumMap(nameToOldBlocks.get(name)!, oldEntry.offset, logger)\n\n  let newOffset = blockMapFile.offset\n  for (let i = 0; i < newFile.checksums.length; newOffset += newFile.sizes[i], i++) {\n    const blockSize: number = newFile.sizes[i]\n    const checksum = newFile.checksums[i]\n    let oldOffset = checksumToOldOffset.get(checksum)\n    if (oldOffset != null && checksumToOldSize.get(checksum) !== blockSize) {\n      logger.warn(`Checksum (\"${checksum}\") matches, but size differs (old: ${checksumToOldSize.get(checksum)}, new: ${blockSize})`)\n      oldOffset = undefined\n    }\n\n    if (oldOffset === undefined) {\n      // download data from new file\n      changedBlockCount++\n\n      if (lastOperation != null && lastOperation.kind === OperationKind.DOWNLOAD && lastOperation.end === newOffset) {\n        lastOperation.end += blockSize\n      } else {\n        lastOperation = {\n          kind: OperationKind.DOWNLOAD,\n          start: newOffset,\n          end: newOffset + blockSize,\n          // oldBlocks: null,\n        }\n        validateAndAdd(lastOperation, operations, checksum, i)\n      }\n    } else {\n      // reuse data from old file\n      if (lastOperation != null && lastOperation.kind === OperationKind.COPY && lastOperation.end === oldOffset) {\n        lastOperation.end += blockSize\n        // lastOperation.oldBlocks!!.push(checksum)\n      } else {\n        lastOperation = {\n          kind: OperationKind.COPY,\n          start: oldOffset,\n          end: oldOffset + blockSize,\n          // oldBlocks: [checksum]\n        }\n        validateAndAdd(lastOperation, operations, checksum, i)\n      }\n    }\n  }\n\n  if (changedBlockCount > 0) {\n    logger.info(`File${blockMapFile.name === \"file\" ? \"\" : \" \" + blockMapFile.name} has ${changedBlockCount} changed blocks`)\n  }\n  return operations\n}\n\nconst isValidateOperationRange = process.env[\"DIFFERENTIAL_DOWNLOAD_PLAN_BUILDER_VALIDATE_RANGES\"] === \"true\"\n\nfunction validateAndAdd(operation: Operation, operations: Array<Operation>, checksum: string, index: number): void {\n  if (isValidateOperationRange && operations.length !== 0) {\n    const lastOperation = operations[operations.length - 1]\n    if (lastOperation.kind === operation.kind && operation.start < lastOperation.end && operation.start > lastOperation.start) {\n      const min = [lastOperation.start, lastOperation.end, operation.start, operation.end].reduce((p, v) => (p < v ? p : v))\n      throw new Error(\n        `operation (block index: ${index}, checksum: ${checksum}, kind: ${OperationKind[operation.kind]}) overlaps previous operation (checksum: ${checksum}):\\n` +\n          `abs: ${lastOperation.start} until ${lastOperation.end} and ${operation.start} until ${operation.end}\\n` +\n          `rel: ${lastOperation.start - min} until ${lastOperation.end - min} and ${operation.start - min} until ${operation.end - min}`\n      )\n    }\n  }\n  operations.push(operation)\n}\n\nfunction buildChecksumMap(file: BlockMapFile, fileOffset: number, logger: Logger) {\n  const checksumToOffset = new Map<string, number>()\n  const checksumToSize = new Map<string, number>()\n  let offset = fileOffset\n  for (let i = 0; i < file.checksums.length; i++) {\n    const checksum = file.checksums[i]\n    const size = file.sizes[i]\n\n    const existing = checksumToSize.get(checksum)\n    if (existing === undefined) {\n      checksumToOffset.set(checksum, offset)\n      checksumToSize.set(checksum, size)\n    } else if (logger.debug != null) {\n      const sizeExplanation = existing === size ? \"(same size)\" : `(size: ${existing}, this size: ${size})`\n      logger.debug(`${checksum} duplicated in blockmap ${sizeExplanation}, it doesn't lead to broken differential downloader, just corresponding block will be skipped)`)\n    }\n    offset += size\n  }\n  return { checksumToOffset, checksumToOldSize: checksumToSize }\n}\n\nfunction buildBlockFileMap(list: Array<BlockMapFile>): Map<string, BlockMapFile> {\n  const result = new Map<string, BlockMapFile>()\n  for (const item of list) {\n    result.set(item.name, item)\n  }\n  return result\n}\n"]}"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.executeTasksUsingMultipleRangeRequests = executeTasksUsingMultipleRangeRequests;
exports.checkIsRangesSupported = checkIsRangesSupported;
const builder_util_runtime_1 = require("builder-util-runtime");
const DataSplitter_1 = require("./DataSplitter");
const downloadPlanBuilder_1 = require("./downloadPlanBuilder");
function executeTasksUsingMultipleRangeRequests(differentialDownloader, tasks, out, oldFileFd, reject) {
    const w = (taskOffset) => {
        if (taskOffset >= tasks.length) {
            if (differentialDownloader.fileMetadataBuffer != null) {
                out.write(differentialDownloader.fileMetadataBuffer);
            }
            out.end();
            return;
        }
        const nextOffset = taskOffset + 1000;
        doExecuteTasks(differentialDownloader, {
            tasks,
            start: taskOffset,
            end: Math.min(tasks.length, nextOffset),
            oldFileFd,
        }, out, () => w(nextOffset), reject);
    };
    return w;
}
function doExecuteTasks(differentialDownloader, options, out, resolve, reject) {
    let ranges = "bytes=";
    let partCount = 0;
    let grandTotalBytes = 0;
    const partIndexToTaskIndex = new Map();
    const partIndexToLength = [];
    for (let i = options.start; i < options.end; i++) {
        const task = options.tasks[i];
        if (task.kind === downloadPlanBuilder_1.OperationKind.DOWNLOAD) {
            ranges += `${task.start}-${task.end - 1}, `;
            partIndexToTaskIndex.set(partCount, i);
            partCount++;
            partIndexToLength.push(task.end - task.start);
            grandTotalBytes += task.end - task.start;
        }
    }
    if (partCount <= 1) {
        // the only remote range - copy
        const w = (index) => {
            if (index >= options.end) {
                resolve();
                return;
            }
            const task = options.tasks[index++];
            if (task.kind === downloadPlanBuilder_1.OperationKind.COPY) {
                (0, DataSplitter_1.copyData)(task, out, options.oldFileFd, reject, () => w(index));
            }
            else {
                const requestOptions = differentialDownloader.createRequestOptions();
                requestOptions.headers.Range = `bytes=${task.start}-${task.end - 1}`;
                const request = differentialDownloader.httpExecutor.createRequest(requestOptions, response => {
                    response.on("error", reject);
                    if (!checkIsRangesSupported(response, reject)) {
                        return;
                    }
                    response.pipe(out, {
                        end: false,
                    });
                    response.once("end", () => w(index));
                });
                differentialDownloader.httpExecutor.addErrorAndTimeoutHandlers(request, reject);
                request.end();
            }
        };
        w(options.start);
        return;
    }
    const requestOptions = differentialDownloader.createRequestOptions();
    requestOptions.headers.Range = ranges.substring(0, ranges.length - 2);
    const request = differentialDownloader.httpExecutor.createRequest(requestOptions, response => {
        if (!checkIsRangesSupported(response, reject)) {
            return;
        }
        const contentType = (0, builder_util_runtime_1.safeGetHeader)(response, "content-type");
        const m = /^multipart\/.+?\s*;\s*boundary=(?:"([^"]+)"|([^\s";]+))\s*$/i.exec(contentType);
        if (m == null) {
            reject(new Error(`Content-Type "multipart/byteranges" is expected, but got "${contentType}"`));
            return;
        }
        const dicer = new DataSplitter_1.DataSplitter(out, options, partIndexToTaskIndex, m[1] || m[2], partIndexToLength, resolve, grandTotalBytes, differentialDownloader.options.onProgress);
        dicer.on("error", reject);
        response.pipe(dicer);
        response.on("end", () => {
            setTimeout(() => {
                request.abort();
                reject(new Error("Response ends without calling any handlers"));
            }, 10000);
        });
    });
    differentialDownloader.httpExecutor.addErrorAndTimeoutHandlers(request, reject);
    request.end();
}
function checkIsRangesSupported(response, reject) {
    // Electron net handles redirects automatically, our NodeJS test server doesn't use redirects - so, we don't check 3xx codes.
    if (response.statusCode >= 400) {
        reject((0, builder_util_runtime_1.createHttpError)(response));
        return false;
    }
    if (response.statusCode !== 206) {
        const acceptRanges = (0, builder_util_runtime_1.safeGetHeader)(response, "accept-ranges");
        if (acceptRanges == null || acceptRanges === "none") {
            reject(new Error(`Server doesn't support Accept-Ranges (response code ${response.statusCode})`));
            return false;
        }
    }
    return true;
}
//# sourceMappingURL=multipleRangeDownloader.js.map{"version":3,"file":"multipleRangeDownloader.js","sourceRoot":"","sources":["../../src/differentialDownloader/multipleRangeDownloader.ts"],"names":[],"mappings":";;AAOA,wFA+BC;AAoFD,wDAeC;AAzID,+DAAqE;AAGrE,iDAAyE;AAEzE,+DAAgE;AAEhE,SAAgB,sCAAsC,CACpD,sBAA8C,EAC9C,KAAuB,EACvB,GAAa,EACb,SAAiB,EACjB,MAA8B;IAE9B,MAAM,CAAC,GAAG,CAAC,UAAkB,EAAQ,EAAE;QACrC,IAAI,UAAU,IAAI,KAAK,CAAC,MAAM,EAAE,CAAC;YAC/B,IAAI,sBAAsB,CAAC,kBAAkB,IAAI,IAAI,EAAE,CAAC;gBACtD,GAAG,CAAC,KAAK,CAAC,sBAAsB,CAAC,kBAAkB,CAAC,CAAA;YACtD,CAAC;YACD,GAAG,CAAC,GAAG,EAAE,CAAA;YACT,OAAM;QACR,CAAC;QAED,MAAM,UAAU,GAAG,UAAU,GAAG,IAAI,CAAA;QACpC,cAAc,CACZ,sBAAsB,EACtB;YACE,KAAK;YACL,KAAK,EAAE,UAAU;YACjB,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,EAAE,UAAU,CAAC;YACvC,SAAS;SACV,EACD,GAAG,EACH,GAAG,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,EACnB,MAAM,CACP,CAAA;IACH,CAAC,CAAA;IACD,OAAO,CAAC,CAAA;AACV,CAAC;AAED,SAAS,cAAc,CAAC,sBAA8C,EAAE,OAAyB,EAAE,GAAa,EAAE,OAAmB,EAAE,MAA8B;IACnK,IAAI,MAAM,GAAG,QAAQ,CAAA;IACrB,IAAI,SAAS,GAAG,CAAC,CAAA;IACjB,IAAI,eAAe,GAAG,CAAC,CAAA;IACvB,MAAM,oBAAoB,GAAG,IAAI,GAAG,EAAkB,CAAA;IACtD,MAAM,iBAAiB,GAAkB,EAAE,CAAA;IAC3C,KAAK,IAAI,CAAC,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC;QACjD,MAAM,IAAI,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;QAC7B,IAAI,IAAI,CAAC,IAAI,KAAK,mCAAa,CAAC,QAAQ,EAAE,CAAC;YACzC,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,GAAG,GAAG,CAAC,IAAI,CAAA;YAC3C,oBAAoB,CAAC,GAAG,CAAC,SAAS,EAAE,CAAC,CAAC,CAAA;YACtC,SAAS,EAAE,CAAA;YACX,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,CAAA;YAC7C,eAAe,IAAI,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,KAAK,CAAA;QAC1C,CAAC;IACH,CAAC;IAED,IAAI,SAAS,IAAI,CAAC,EAAE,CAAC;QACnB,+BAA+B;QAC/B,MAAM,CAAC,GAAG,CAAC,KAAa,EAAQ,EAAE;YAChC,IAAI,KAAK,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;gBACzB,OAAO,EAAE,CAAA;gBACT,OAAM;YACR,CAAC;YAED,MAAM,IAAI,GAAG,OAAO,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC,CAAA;YAEnC,IAAI,IAAI,CAAC,IAAI,KAAK,mCAAa,CAAC,IAAI,EAAE,CAAC;gBACrC,IAAA,uBAAQ,EAAC,IAAI,EAAE,GAAG,EAAE,OAAO,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAA;YAChE,CAAC;iBAAM,CAAC;gBACN,MAAM,cAAc,GAAG,sBAAsB,CAAC,oBAAoB,EAAE,CAAA;gBACpE,cAAc,CAAC,OAAQ,CAAC,KAAK,GAAG,SAAS,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,GAAG,GAAG,CAAC,EAAE,CAAA;gBACrE,MAAM,OAAO,GAAG,sBAAsB,CAAC,YAAY,CAAC,aAAa,CAAC,cAAc,EAAE,QAAQ,CAAC,EAAE;oBAC3F,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,CAAA;oBAE5B,IAAI,CAAC,sBAAsB,CAAC,QAAQ,EAAE,MAAM,CAAC,EAAE,CAAC;wBAC9C,OAAM;oBACR,CAAC;oBAED,QAAQ,CAAC,IAAI,CAAC,GAAG,EAAE;wBACjB,GAAG,EAAE,KAAK;qBACX,CAAC,CAAA;oBACF,QAAQ,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAA;gBACtC,CAAC,CAAC,CAAA;gBACF,sBAAsB,CAAC,YAAY,CAAC,0BAA0B,CAAC,OAAO,EAAE,MAAM,CAAC,CAAA;gBAC/E,OAAO,CAAC,GAAG,EAAE,CAAA;YACf,CAAC;QACH,CAAC,CAAA;QAED,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;QAChB,OAAM;IACR,CAAC;IAED,MAAM,cAAc,GAAG,sBAAsB,CAAC,oBAAoB,EAAE,CAAA;IACpE,cAAc,CAAC,OAAQ,CAAC,KAAK,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAA;IACtE,MAAM,OAAO,GAAG,sBAAsB,CAAC,YAAY,CAAC,aAAa,CAAC,cAAc,EAAE,QAAQ,CAAC,EAAE;QAC3F,IAAI,CAAC,sBAAsB,CAAC,QAAQ,EAAE,MAAM,CAAC,EAAE,CAAC;YAC9C,OAAM;QACR,CAAC;QAED,MAAM,WAAW,GAAG,IAAA,oCAAa,EAAC,QAAQ,EAAE,cAAc,CAAC,CAAA;QAC3D,MAAM,CAAC,GAAG,8DAA8D,CAAC,IAAI,CAAC,WAAW,CAAC,CAAA;QAC1F,IAAI,CAAC,IAAI,IAAI,EAAE,CAAC;YACd,MAAM,CAAC,IAAI,KAAK,CAAC,6DAA6D,WAAW,GAAG,CAAC,CAAC,CAAA;YAC9F,OAAM;QACR,CAAC;QAED,MAAM,KAAK,GAAG,IAAI,2BAAY,CAAC,GAAG,EAAE,OAAO,EAAE,oBAAoB,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,iBAAiB,EAAE,OAAO,EAAE,eAAe,EAAE,sBAAsB,CAAC,OAAO,CAAC,UAAU,CAAC,CAAA;QACxK,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,CAAA;QACzB,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;QAEpB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE;YACtB,UAAU,CAAC,GAAG,EAAE;gBACd,OAAO,CAAC,KAAK,EAAE,CAAA;gBACf,MAAM,CAAC,IAAI,KAAK,CAAC,4CAA4C,CAAC,CAAC,CAAA;YACjE,CAAC,EAAE,KAAK,CAAC,CAAA;QACX,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;IACF,sBAAsB,CAAC,YAAY,CAAC,0BAA0B,CAAC,OAAO,EAAE,MAAM,CAAC,CAAA;IAC/E,OAAO,CAAC,GAAG,EAAE,CAAA;AACf,CAAC;AAED,SAAgB,sBAAsB,CAAC,QAAyB,EAAE,MAA8B;IAC9F,6HAA6H;IAC7H,IAAI,QAAQ,CAAC,UAAW,IAAI,GAAG,EAAE,CAAC;QAChC,MAAM,CAAC,IAAA,sCAAe,EAAC,QAAQ,CAAC,CAAC,CAAA;QACjC,OAAO,KAAK,CAAA;IACd,CAAC;IAED,IAAI,QAAQ,CAAC,UAAU,KAAK,GAAG,EAAE,CAAC;QAChC,MAAM,YAAY,GAAG,IAAA,oCAAa,EAAC,QAAQ,EAAE,eAAe,CAAC,CAAA;QAC7D,IAAI,YAAY,IAAI,IAAI,IAAI,YAAY,KAAK,MAAM,EAAE,CAAC;YACpD,MAAM,CAAC,IAAI,KAAK,CAAC,uDAAuD,QAAQ,CAAC,UAAU,GAAG,CAAC,CAAC,CAAA;YAChG,OAAO,KAAK,CAAA;QACd,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAA;AACb,CAAC","sourcesContent":["import { createHttpError, safeGetHeader } from \"builder-util-runtime\"\nimport { IncomingMessage } from \"http\"\nimport { Writable } from \"stream\"\nimport { copyData, DataSplitter, PartListDataTask } from \"./DataSplitter\"\nimport { DifferentialDownloader } from \"./DifferentialDownloader\"\nimport { Operation, OperationKind } from \"./downloadPlanBuilder\"\n\nexport function executeTasksUsingMultipleRangeRequests(\n  differentialDownloader: DifferentialDownloader,\n  tasks: Array<Operation>,\n  out: Writable,\n  oldFileFd: number,\n  reject: (error: Error) => void\n): (taskOffset: number) => void {\n  const w = (taskOffset: number): void => {\n    if (taskOffset >= tasks.length) {\n      if (differentialDownloader.fileMetadataBuffer != null) {\n        out.write(differentialDownloader.fileMetadataBuffer)\n      }\n      out.end()\n      return\n    }\n\n    const nextOffset = taskOffset + 1000\n    doExecuteTasks(\n      differentialDownloader,\n      {\n        tasks,\n        start: taskOffset,\n        end: Math.min(tasks.length, nextOffset),\n        oldFileFd,\n      },\n      out,\n      () => w(nextOffset),\n      reject\n    )\n  }\n  return w\n}\n\nfunction doExecuteTasks(differentialDownloader: DifferentialDownloader, options: PartListDataTask, out: Writable, resolve: () => void, reject: (error: Error) => void): void {\n  let ranges = \"bytes=\"\n  let partCount = 0\n  let grandTotalBytes = 0\n  const partIndexToTaskIndex = new Map<number, number>()\n  const partIndexToLength: Array<number> = []\n  for (let i = options.start; i < options.end; i++) {\n    const task = options.tasks[i]\n    if (task.kind === OperationKind.DOWNLOAD) {\n      ranges += `${task.start}-${task.end - 1}, `\n      partIndexToTaskIndex.set(partCount, i)\n      partCount++\n      partIndexToLength.push(task.end - task.start)\n      grandTotalBytes += task.end - task.start\n    }\n  }\n\n  if (partCount <= 1) {\n    // the only remote range - copy\n    const w = (index: number): void => {\n      if (index >= options.end) {\n        resolve()\n        return\n      }\n\n      const task = options.tasks[index++]\n\n      if (task.kind === OperationKind.COPY) {\n        copyData(task, out, options.oldFileFd, reject, () => w(index))\n      } else {\n        const requestOptions = differentialDownloader.createRequestOptions()\n        requestOptions.headers!.Range = `bytes=${task.start}-${task.end - 1}`\n        const request = differentialDownloader.httpExecutor.createRequest(requestOptions, response => {\n          response.on(\"error\", reject)\n\n          if (!checkIsRangesSupported(response, reject)) {\n            return\n          }\n\n          response.pipe(out, {\n            end: false,\n          })\n          response.once(\"end\", () => w(index))\n        })\n        differentialDownloader.httpExecutor.addErrorAndTimeoutHandlers(request, reject)\n        request.end()\n      }\n    }\n\n    w(options.start)\n    return\n  }\n\n  const requestOptions = differentialDownloader.createRequestOptions()\n  requestOptions.headers!.Range = ranges.substring(0, ranges.length - 2)\n  const request = differentialDownloader.httpExecutor.createRequest(requestOptions, response => {\n    if (!checkIsRangesSupported(response, reject)) {\n      return\n    }\n\n    const contentType = safeGetHeader(response, \"content-type\")\n    const m = /^multipart\\/.+?\\s*;\\s*boundary=(?:\"([^\"]+)\"|([^\\s\";]+))\\s*$/i.exec(contentType)\n    if (m == null) {\n      reject(new Error(`Content-Type \"multipart/byteranges\" is expected, but got \"${contentType}\"`))\n      return\n    }\n\n    const dicer = new DataSplitter(out, options, partIndexToTaskIndex, m[1] || m[2], partIndexToLength, resolve, grandTotalBytes, differentialDownloader.options.onProgress)\n    dicer.on(\"error\", reject)\n    response.pipe(dicer)\n\n    response.on(\"end\", () => {\n      setTimeout(() => {\n        request.abort()\n        reject(new Error(\"Response ends without calling any handlers\"))\n      }, 10000)\n    })\n  })\n  differentialDownloader.httpExecutor.addErrorAndTimeoutHandlers(request, reject)\n  request.end()\n}\n\nexport function checkIsRangesSupported(response: IncomingMessage, reject: (error: Error) => void): boolean {\n  // Electron net handles redirects automatically, our NodeJS test server doesn't use redirects - so, we don't check 3xx codes.\n  if (response.statusCode! >= 400) {\n    reject(createHttpError(response))\n    return false\n  }\n\n  if (response.statusCode !== 206) {\n    const acceptRanges = safeGetHeader(response, \"accept-ranges\")\n    if (acceptRanges == null || acceptRanges === \"none\") {\n      reject(new Error(`Server doesn't support Accept-Ranges (response code ${response.statusCode})`))\n      return false\n    }\n  }\n  return true\n}\n"]}"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ElectronHttpExecutor = exports.NET_SESSION_NAME = void 0;
exports.getNetSession = getNetSession;
const builder_util_runtime_1 = require("builder-util-runtime");
exports.NET_SESSION_NAME = "electron-updater";
function getNetSession() {
    return require("electron").session.fromPartition(exports.NET_SESSION_NAME, {
        cache: false,
    });
}
class ElectronHttpExecutor extends builder_util_runtime_1.HttpExecutor {
    constructor(proxyLoginCallback) {
        super();
        this.proxyLoginCallback = proxyLoginCallback;
        this.cachedSession = null;
    }
    async download(url, destination, options) {
        return await options.cancellationToken.createPromise((resolve, reject, onCancel) => {
            const requestOptions = {
                headers: options.headers || undefined,
                redirect: "manual",
            };
            (0, builder_util_runtime_1.configureRequestUrl)(url, requestOptions);
            (0, builder_util_runtime_1.configureRequestOptions)(requestOptions);
            this.doDownload(requestOptions, {
                destination,
                options,
                onCancel,
                callback: error => {
                    if (error == null) {
                        resolve(destination);
                    }
                    else {
                        reject(error);
                    }
                },
                responseHandler: null,
            }, 0);
        });
    }
    createRequest(options, callback) {
        // fix (node 7+) for making electron updater work when using AWS private buckets, check if headers contain Host property
        if (options.headers && options.headers.Host) {
            // set host value from headers.Host
            options.host = options.headers.Host;
            // remove header property 'Host', if not removed causes net::ERR_INVALID_ARGUMENT exception
            delete options.headers.Host;
        }
        // differential downloader can call this method very often, so, better to cache session
        if (this.cachedSession == null) {
            this.cachedSession = getNetSession();
        }
        const request = require("electron").net.request({
            ...options,
            session: this.cachedSession,
        });
        request.on("response", callback);
        if (this.proxyLoginCallback != null) {
            request.on("login", this.proxyLoginCallback);
        }
        return request;
    }
    addRedirectHandlers(request, options, reject, redirectCount, handler) {
        request.on("redirect", (statusCode, method, redirectUrl) => {
            // no way to modify request options, abort old and make a new one
            // https://github.com/electron/electron/issues/11505
            request.abort();
            if (redirectCount > this.maxRedirects) {
                reject(this.createMaxRedirectError());
            }
            else {
                handler(builder_util_runtime_1.HttpExecutor.prepareRedirectUrlOptions(redirectUrl, options));
            }
        });
    }
}
exports.ElectronHttpExecutor = ElectronHttpExecutor;
//# sourceMappingURL=electronHttpExecutor.js.map{"version":3,"file":"electronHttpExecutor.js","sourceRoot":"","sources":["../src/electronHttpExecutor.ts"],"names":[],"mappings":";;;AASA,sCAIC;AAbD,+DAAkH;AAOrG,QAAA,gBAAgB,GAAG,kBAAkB,CAAA;AAElD,SAAgB,aAAa;IAC3B,OAAO,OAAO,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,wBAAgB,EAAE;QACjE,KAAK,EAAE,KAAK;KACb,CAAC,CAAA;AACJ,CAAC;AAED,MAAa,oBAAqB,SAAQ,mCAAoC;IAG5E,YAA6B,kBAA0E;QACrG,KAAK,EAAE,CAAA;QADoB,uBAAkB,GAAlB,kBAAkB,CAAwD;QAF/F,kBAAa,GAAmB,IAAI,CAAA;IAI5C,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,GAAQ,EAAE,WAAmB,EAAE,OAAwB;QACpE,OAAO,MAAM,OAAO,CAAC,iBAAiB,CAAC,aAAa,CAAS,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE;YACzF,MAAM,cAAc,GAAG;gBACrB,OAAO,EAAE,OAAO,CAAC,OAAO,IAAI,SAAS;gBACrC,QAAQ,EAAE,QAAQ;aACnB,CAAA;YACD,IAAA,0CAAmB,EAAC,GAAG,EAAE,cAAc,CAAC,CAAA;YACxC,IAAA,8CAAuB,EAAC,cAAc,CAAC,CAAA;YACvC,IAAI,CAAC,UAAU,CACb,cAAc,EACd;gBACE,WAAW;gBACX,OAAO;gBACP,QAAQ;gBACR,QAAQ,EAAE,KAAK,CAAC,EAAE;oBAChB,IAAI,KAAK,IAAI,IAAI,EAAE,CAAC;wBAClB,OAAO,CAAC,WAAW,CAAC,CAAA;oBACtB,CAAC;yBAAM,CAAC;wBACN,MAAM,CAAC,KAAK,CAAC,CAAA;oBACf,CAAC;gBACH,CAAC;gBACD,eAAe,EAAE,IAAI;aACtB,EACD,CAAC,CACF,CAAA;QACH,CAAC,CAAC,CAAA;IACJ,CAAC;IAED,aAAa,CAAC,OAAY,EAAE,QAAiC;QAC3D,wHAAwH;QACxH,IAAI,OAAO,CAAC,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;YAC5C,mCAAmC;YACnC,OAAO,CAAC,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,IAAI,CAAA;YACnC,2FAA2F;YAC3F,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,CAAA;QAC7B,CAAC;QAED,uFAAuF;QACvF,IAAI,IAAI,CAAC,aAAa,IAAI,IAAI,EAAE,CAAC;YAC/B,IAAI,CAAC,aAAa,GAAG,aAAa,EAAE,CAAA;QACtC,CAAC;QAED,MAAM,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC;YAC9C,GAAG,OAAO;YACV,OAAO,EAAE,IAAI,CAAC,aAAa;SAC5B,CAAC,CAAA;QACF,OAAO,CAAC,EAAE,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAA;QAChC,IAAI,IAAI,CAAC,kBAAkB,IAAI,IAAI,EAAE,CAAC;YACpC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,IAAI,CAAC,kBAAkB,CAAC,CAAA;QAC9C,CAAC;QACD,OAAO,OAAO,CAAA;IAChB,CAAC;IAES,mBAAmB,CAC3B,OAAsB,EACtB,OAAuB,EACvB,MAA8B,EAC9B,aAAqB,EACrB,OAA0C;QAE1C,OAAO,CAAC,EAAE,CAAC,UAAU,EAAE,CAAC,UAAkB,EAAE,MAAc,EAAE,WAAmB,EAAE,EAAE;YACjF,iEAAiE;YACjE,oDAAoD;YACpD,OAAO,CAAC,KAAK,EAAE,CAAA;YAEf,IAAI,aAAa,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC;gBACtC,MAAM,CAAC,IAAI,CAAC,sBAAsB,EAAE,CAAC,CAAA;YACvC,CAAC;iBAAM,CAAC;gBACN,OAAO,CAAC,mCAAY,CAAC,yBAAyB,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC,CAAA;YACvE,CAAC;QACH,CAAC,CAAC,CAAA;IACJ,CAAC;CACF;AA/ED,oDA+EC","sourcesContent":["import { DownloadOptions, HttpExecutor, configureRequestOptions, configureRequestUrl } from \"builder-util-runtime\"\nimport type { AuthInfo } from \"electron\"\nimport { RequestOptions } from \"http\"\nimport Session = Electron.Session\nimport ClientRequest = Electron.ClientRequest\n\nexport type LoginCallback = (username: string, password: string) => void\nexport const NET_SESSION_NAME = \"electron-updater\"\n\nexport function getNetSession(): Session {\n  return require(\"electron\").session.fromPartition(NET_SESSION_NAME, {\n    cache: false,\n  })\n}\n\nexport class ElectronHttpExecutor extends HttpExecutor<Electron.ClientRequest> {\n  private cachedSession: Session | null = null\n\n  constructor(private readonly proxyLoginCallback?: (authInfo: AuthInfo, callback: LoginCallback) => void) {\n    super()\n  }\n\n  async download(url: URL, destination: string, options: DownloadOptions): Promise<string> {\n    return await options.cancellationToken.createPromise<string>((resolve, reject, onCancel) => {\n      const requestOptions = {\n        headers: options.headers || undefined,\n        redirect: \"manual\",\n      }\n      configureRequestUrl(url, requestOptions)\n      configureRequestOptions(requestOptions)\n      this.doDownload(\n        requestOptions,\n        {\n          destination,\n          options,\n          onCancel,\n          callback: error => {\n            if (error == null) {\n              resolve(destination)\n            } else {\n              reject(error)\n            }\n          },\n          responseHandler: null,\n        },\n        0\n      )\n    })\n  }\n\n  createRequest(options: any, callback: (response: any) => void): Electron.ClientRequest {\n    // fix (node 7+) for making electron updater work when using AWS private buckets, check if headers contain Host property\n    if (options.headers && options.headers.Host) {\n      // set host value from headers.Host\n      options.host = options.headers.Host\n      // remove header property 'Host', if not removed causes net::ERR_INVALID_ARGUMENT exception\n      delete options.headers.Host\n    }\n\n    // differential downloader can call this method very often, so, better to cache session\n    if (this.cachedSession == null) {\n      this.cachedSession = getNetSession()\n    }\n\n    const request = require(\"electron\").net.request({\n      ...options,\n      session: this.cachedSession,\n    })\n    request.on(\"response\", callback)\n    if (this.proxyLoginCallback != null) {\n      request.on(\"login\", this.proxyLoginCallback)\n    }\n    return request\n  }\n\n  protected addRedirectHandlers(\n    request: ClientRequest,\n    options: RequestOptions,\n    reject: (error: Error) => void,\n    redirectCount: number,\n    handler: (options: RequestOptions) => void\n  ): void {\n    request.on(\"redirect\", (statusCode: number, method: string, redirectUrl: string) => {\n      // no way to modify request options, abort old and make a new one\n      // https://github.com/electron/electron/issues/11505\n      request.abort()\n\n      if (redirectCount > this.maxRedirects) {\n        reject(this.createMaxRedirectError())\n      } else {\n        handler(HttpExecutor.prepareRedirectUrlOptions(redirectUrl, options))\n      }\n    })\n  }\n}\n"]}"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
    for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.NsisUpdater = exports.MacUpdater = exports.RpmUpdater = exports.PacmanUpdater = exports.DebUpdater = exports.AppImageUpdater = exports.Provider = exports.NoOpLogger = exports.AppUpdater = exports.BaseUpdater = void 0;
const fs_extra_1 = require("fs-extra");
const path = require("path");
var BaseUpdater_1 = require("./BaseUpdater");
Object.defineProperty(exports, "BaseUpdater", { enumerable: true, get: function () { return BaseUpdater_1.BaseUpdater; } });
var AppUpdater_1 = require("./AppUpdater");
Object.defineProperty(exports, "AppUpdater", { enumerable: true, get: function () { return AppUpdater_1.AppUpdater; } });
Object.defineProperty(exports, "NoOpLogger", { enumerable: true, get: function () { return AppUpdater_1.NoOpLogger; } });
var Provider_1 = require("./providers/Provider");
Object.defineProperty(exports, "Provider", { enumerable: true, get: function () { return Provider_1.Provider; } });
var AppImageUpdater_1 = require("./AppImageUpdater");
Object.defineProperty(exports, "AppImageUpdater", { enumerable: true, get: function () { return AppImageUpdater_1.AppImageUpdater; } });
var DebUpdater_1 = require("./DebUpdater");
Object.defineProperty(exports, "DebUpdater", { enumerable: true, get: function () { return DebUpdater_1.DebUpdater; } });
var PacmanUpdater_1 = require("./PacmanUpdater");
Object.defineProperty(exports, "PacmanUpdater", { enumerable: true, get: function () { return PacmanUpdater_1.PacmanUpdater; } });
var RpmUpdater_1 = require("./RpmUpdater");
Object.defineProperty(exports, "RpmUpdater", { enumerable: true, get: function () { return RpmUpdater_1.RpmUpdater; } });
var MacUpdater_1 = require("./MacUpdater");
Object.defineProperty(exports, "MacUpdater", { enumerable: true, get: function () { return MacUpdater_1.MacUpdater; } });
var NsisUpdater_1 = require("./NsisUpdater");
Object.defineProperty(exports, "NsisUpdater", { enumerable: true, get: function () { return NsisUpdater_1.NsisUpdater; } });
__exportStar(require("./types"), exports);
// autoUpdater to mimic electron bundled autoUpdater
let _autoUpdater;
function doLoadAutoUpdater() {
    // tslint:disable:prefer-conditional-expression
    if (process.platform === "win32") {
        _autoUpdater = new (require("./NsisUpdater").NsisUpdater)();
    }
    else if (process.platform === "darwin") {
        _autoUpdater = new (require("./MacUpdater").MacUpdater)();
    }
    else {
        _autoUpdater = new (require("./AppImageUpdater").AppImageUpdater)();
        try {
            const identity = path.join(process.resourcesPath, "package-type");
            if (!(0, fs_extra_1.existsSync)(identity)) {
                return _autoUpdater;
            }
            const fileType = (0, fs_extra_1.readFileSync)(identity).toString().trim();
            switch (fileType) {
                case "deb":
                    _autoUpdater = new (require("./DebUpdater").DebUpdater)();
                    break;
                case "rpm":
                    _autoUpdater = new (require("./RpmUpdater").RpmUpdater)();
                    break;
                case "pacman":
                    _autoUpdater = new (require("./PacmanUpdater").PacmanUpdater)();
                    break;
                default:
                    break;
            }
        }
        catch (error) {
            console.warn("Unable to detect 'package-type' for autoUpdater (rpm/deb/pacman support). If you'd like to expand support, please consider contributing to electron-builder", error.message);
        }
    }
    return _autoUpdater;
}
Object.defineProperty(exports, "autoUpdater", {
    enumerable: true,
    get: () => {
        return _autoUpdater || doLoadAutoUpdater();
    },
});
//# sourceMappingURL=main.js.map{"version":3,"file":"main.js","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,uCAAmD;AACnD,6BAA4B;AAI5B,6CAA2C;AAAlC,0GAAA,WAAW,OAAA;AACpB,2CAAqD;AAA5C,wGAAA,UAAU,OAAA;AAAE,wGAAA,UAAU,OAAA;AAC/B,iDAA+C;AAAtC,oGAAA,QAAQ,OAAA;AACjB,qDAAmD;AAA1C,kHAAA,eAAe,OAAA;AACxB,2CAAyC;AAAhC,wGAAA,UAAU,OAAA;AACnB,iDAA+C;AAAtC,8GAAA,aAAa,OAAA;AACtB,2CAAyC;AAAhC,wGAAA,UAAU,OAAA;AACnB,2CAAyC;AAAhC,wGAAA,UAAU,OAAA;AACnB,6CAA2C;AAAlC,0GAAA,WAAW,OAAA;AAEpB,0CAAuB;AAEvB,oDAAoD;AACpD,IAAI,YAAiB,CAAA;AAKrB,SAAS,iBAAiB;IACxB,+CAA+C;IAC/C,IAAI,OAAO,CAAC,QAAQ,KAAK,OAAO,EAAE,CAAC;QACjC,YAAY,GAAG,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC,WAAW,CAAC,EAAE,CAAA;IAC7D,CAAC;SAAM,IAAI,OAAO,CAAC,QAAQ,KAAK,QAAQ,EAAE,CAAC;QACzC,YAAY,GAAG,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,UAAU,CAAC,EAAE,CAAA;IAC3D,CAAC;SAAM,CAAC;QACN,YAAY,GAAG,IAAI,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC,eAAe,CAAC,EAAE,CAAA;QACnE,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,EAAE,cAAc,CAAC,CAAA;YACjE,IAAI,CAAC,IAAA,qBAAU,EAAC,QAAQ,CAAC,EAAE,CAAC;gBAC1B,OAAO,YAAY,CAAA;YACrB,CAAC;YACD,MAAM,QAAQ,GAAG,IAAA,uBAAY,EAAC,QAAQ,CAAC,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,CAAA;YACzD,QAAQ,QAAQ,EAAE,CAAC;gBACjB,KAAK,KAAK;oBACR,YAAY,GAAG,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,UAAU,CAAC,EAAE,CAAA;oBACzD,MAAK;gBACP,KAAK,KAAK;oBACR,YAAY,GAAG,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,UAAU,CAAC,EAAE,CAAA;oBACzD,MAAK;gBACP,KAAK,QAAQ;oBACX,YAAY,GAAG,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC,aAAa,CAAC,EAAE,CAAA;oBAC/D,MAAK;gBACP;oBACE,MAAK;YACT,CAAC;QACH,CAAC;QAAC,OAAO,KAAU,EAAE,CAAC;YACpB,OAAO,CAAC,IAAI,CACV,6JAA6J,EAC7J,KAAK,CAAC,OAAO,CACd,CAAA;QACH,CAAC;IACH,CAAC;IACD,OAAO,YAAY,CAAA;AACrB,CAAC;AAED,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,aAAa,EAAE;IAC5C,UAAU,EAAE,IAAI;IAChB,GAAG,EAAE,GAAG,EAAE;QACR,OAAO,YAAY,IAAI,iBAAiB,EAAE,CAAA;IAC5C,CAAC;CACF,CAAC,CAAA","sourcesContent":["import { existsSync, readFileSync } from \"fs-extra\"\nimport * as path from \"path\"\nimport { AppUpdater } from \"./AppUpdater\"\nimport { UpdateInfo } from \"builder-util-runtime\"\n\nexport { BaseUpdater } from \"./BaseUpdater\"\nexport { AppUpdater, NoOpLogger } from \"./AppUpdater\"\nexport { Provider } from \"./providers/Provider\"\nexport { AppImageUpdater } from \"./AppImageUpdater\"\nexport { DebUpdater } from \"./DebUpdater\"\nexport { PacmanUpdater } from \"./PacmanUpdater\"\nexport { RpmUpdater } from \"./RpmUpdater\"\nexport { MacUpdater } from \"./MacUpdater\"\nexport { NsisUpdater } from \"./NsisUpdater\"\n\nexport * from \"./types\"\n\n// autoUpdater to mimic electron bundled autoUpdater\nlet _autoUpdater: any\n\n// required for jsdoc\nexport declare const autoUpdater: AppUpdater\n\nfunction doLoadAutoUpdater(): AppUpdater {\n  // tslint:disable:prefer-conditional-expression\n  if (process.platform === \"win32\") {\n    _autoUpdater = new (require(\"./NsisUpdater\").NsisUpdater)()\n  } else if (process.platform === \"darwin\") {\n    _autoUpdater = new (require(\"./MacUpdater\").MacUpdater)()\n  } else {\n    _autoUpdater = new (require(\"./AppImageUpdater\").AppImageUpdater)()\n    try {\n      const identity = path.join(process.resourcesPath, \"package-type\")\n      if (!existsSync(identity)) {\n        return _autoUpdater\n      }\n      const fileType = readFileSync(identity).toString().trim()\n      switch (fileType) {\n        case \"deb\":\n          _autoUpdater = new (require(\"./DebUpdater\").DebUpdater)()\n          break\n        case \"rpm\":\n          _autoUpdater = new (require(\"./RpmUpdater\").RpmUpdater)()\n          break\n        case \"pacman\":\n          _autoUpdater = new (require(\"./PacmanUpdater\").PacmanUpdater)()\n          break\n        default:\n          break\n      }\n    } catch (error: any) {\n      console.warn(\n        \"Unable to detect 'package-type' for autoUpdater (rpm/deb/pacman support). If you'd like to expand support, please consider contributing to electron-builder\",\n        error.message\n      )\n    }\n  }\n  return _autoUpdater\n}\n\nObject.defineProperty(exports, \"autoUpdater\", {\n  enumerable: true,\n  get: () => {\n    return _autoUpdater || doLoadAutoUpdater()\n  },\n})\n\n/**\n * return null if verify signature succeed\n * return error message if verify signature failed\n */\nexport type VerifyUpdateCodeSignature = (publisherName: string[], path: string) => Promise<string | null>\n\nexport type VerifyUpdateSupport = (updateInfo: UpdateInfo) => boolean | Promise<boolean>\n"]}"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isUrlProbablySupportMultiRangeRequests = isUrlProbablySupportMultiRangeRequests;
exports.createClient = createClient;
const builder_util_runtime_1 = require("builder-util-runtime");
const BitbucketProvider_1 = require("./providers/BitbucketProvider");
const GenericProvider_1 = require("./providers/GenericProvider");
const GitHubProvider_1 = require("./providers/GitHubProvider");
const GitLabProvider_1 = require("./providers/GitLabProvider");
const KeygenProvider_1 = require("./providers/KeygenProvider");
const PrivateGitHubProvider_1 = require("./providers/PrivateGitHubProvider");
function isUrlProbablySupportMultiRangeRequests(url) {
    return !url.includes("s3.amazonaws.com");
}
function createClient(data, updater, runtimeOptions) {
    // noinspection SuspiciousTypeOfGuard
    if (typeof data === "string") {
        throw (0, builder_util_runtime_1.newError)("Please pass PublishConfiguration object", "ERR_UPDATER_INVALID_PROVIDER_CONFIGURATION");
    }
    const provider = data.provider;
    switch (provider) {
        case "github": {
            const githubOptions = data;
            const token = (githubOptions.private ? process.env["GH_TOKEN"] || process.env["GITHUB_TOKEN"] : null) || githubOptions.token;
            if (token == null) {
                return new GitHubProvider_1.GitHubProvider(githubOptions, updater, runtimeOptions);
            }
            else {
                return new PrivateGitHubProvider_1.PrivateGitHubProvider(githubOptions, updater, token, runtimeOptions);
            }
        }
        case "bitbucket":
            return new BitbucketProvider_1.BitbucketProvider(data, updater, runtimeOptions);
        case "gitlab":
            return new GitLabProvider_1.GitLabProvider(data, updater, runtimeOptions);
        case "keygen":
            return new KeygenProvider_1.KeygenProvider(data, updater, runtimeOptions);
        case "s3":
        case "spaces":
            return new GenericProvider_1.GenericProvider({
                provider: "generic",
                url: (0, builder_util_runtime_1.getS3LikeProviderBaseUrl)(data),
                channel: data.channel || null,
            }, updater, {
                ...runtimeOptions,
                // https://github.com/minio/minio/issues/5285#issuecomment-350428955
                isUseMultipleRangeRequest: false,
            });
        case "generic": {
            const options = data;
            return new GenericProvider_1.GenericProvider(options, updater, {
                ...runtimeOptions,
                isUseMultipleRangeRequest: options.useMultipleRangeRequest !== false && isUrlProbablySupportMultiRangeRequests(options.url),
            });
        }
        case "custom": {
            const options = data;
            const constructor = options.updateProvider;
            if (!constructor) {
                throw (0, builder_util_runtime_1.newError)("Custom provider not specified", "ERR_UPDATER_INVALID_PROVIDER_CONFIGURATION");
            }
            return new constructor(options, updater, runtimeOptions);
        }
        default:
            throw (0, builder_util_runtime_1.newError)(`Unsupported provider: ${provider}`, "ERR_UPDATER_UNSUPPORTED_PROVIDER");
    }
}
//# sourceMappingURL=providerFactory.js.map{"version":3,"file":"providerFactory.js","sourceRoot":"","sources":["../src/providerFactory.ts"],"names":[],"mappings":";;AAsBA,wFAEC;AAED,oCA+DC;AAzFD,+DAY6B;AAE7B,qEAAiE;AACjE,iEAA6D;AAC7D,+DAA2D;AAC3D,+DAA2D;AAC3D,+DAA2D;AAC3D,6EAAyE;AAGzE,SAAgB,sCAAsC,CAAC,GAAW;IAChE,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAAA;AAC1C,CAAC;AAED,SAAgB,YAAY,CAAC,IAA8C,EAAE,OAAmB,EAAE,cAAsC;IACtI,qCAAqC;IACrC,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;QAC7B,MAAM,IAAA,+BAAQ,EAAC,yCAAyC,EAAE,4CAA4C,CAAC,CAAA;IACzG,CAAC;IAED,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAA;IAC9B,QAAQ,QAAQ,EAAE,CAAC;QACjB,KAAK,QAAQ,CAAC,CAAC,CAAC;YACd,MAAM,aAAa,GAAG,IAAqB,CAAA;YAC3C,MAAM,KAAK,GAAG,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,aAAa,CAAC,KAAK,CAAA;YAC5H,IAAI,KAAK,IAAI,IAAI,EAAE,CAAC;gBAClB,OAAO,IAAI,+BAAc,CAAC,aAAa,EAAE,OAAO,EAAE,cAAc,CAAC,CAAA;YACnE,CAAC;iBAAM,CAAC;gBACN,OAAO,IAAI,6CAAqB,CAAC,aAAa,EAAE,OAAO,EAAE,KAAK,EAAE,cAAc,CAAC,CAAA;YACjF,CAAC;QACH,CAAC;QAED,KAAK,WAAW;YACd,OAAO,IAAI,qCAAiB,CAAC,IAAwB,EAAE,OAAO,EAAE,cAAc,CAAC,CAAA;QAEjF,KAAK,QAAQ;YACX,OAAO,IAAI,+BAAc,CAAC,IAAqB,EAAE,OAAO,EAAE,cAAc,CAAC,CAAA;QAE3E,KAAK,QAAQ;YACX,OAAO,IAAI,+BAAc,CAAC,IAAqB,EAAE,OAAO,EAAE,cAAc,CAAC,CAAA;QAE3E,KAAK,IAAI,CAAC;QACV,KAAK,QAAQ;YACX,OAAO,IAAI,iCAAe,CACxB;gBACE,QAAQ,EAAE,SAAS;gBACnB,GAAG,EAAE,IAAA,+CAAwB,EAAC,IAAI,CAAC;gBACnC,OAAO,EAAG,IAAsB,CAAC,OAAO,IAAI,IAAI;aACjD,EACD,OAAO,EACP;gBACE,GAAG,cAAc;gBACjB,oEAAoE;gBACpE,yBAAyB,EAAE,KAAK;aACjC,CACF,CAAA;QAEH,KAAK,SAAS,CAAC,CAAC,CAAC;YACf,MAAM,OAAO,GAAG,IAA4B,CAAA;YAC5C,OAAO,IAAI,iCAAe,CAAC,OAAO,EAAE,OAAO,EAAE;gBAC3C,GAAG,cAAc;gBACjB,yBAAyB,EAAE,OAAO,CAAC,uBAAuB,KAAK,KAAK,IAAI,sCAAsC,CAAC,OAAO,CAAC,GAAG,CAAC;aAC5H,CAAC,CAAA;QACJ,CAAC;QAED,KAAK,QAAQ,CAAC,CAAC,CAAC;YACd,MAAM,OAAO,GAAG,IAA4B,CAAA;YAC5C,MAAM,WAAW,GAAG,OAAO,CAAC,cAAc,CAAA;YAC1C,IAAI,CAAC,WAAW,EAAE,CAAC;gBACjB,MAAM,IAAA,+BAAQ,EAAC,+BAA+B,EAAE,4CAA4C,CAAC,CAAA;YAC/F,CAAC;YACD,OAAO,IAAI,WAAW,CAAC,OAAO,EAAE,OAAO,EAAE,cAAc,CAAC,CAAA;QAC1D,CAAC;QAED;YACE,MAAM,IAAA,+BAAQ,EAAC,yBAAyB,QAAQ,EAAE,EAAE,kCAAkC,CAAC,CAAA;IAC3F,CAAC;AACH,CAAC","sourcesContent":["import {\n  AllPublishOptions,\n  BaseS3Options,\n  BitbucketOptions,\n  CustomPublishOptions,\n  GenericServerOptions,\n  getS3LikeProviderBaseUrl,\n  GithubOptions,\n  GitlabOptions,\n  KeygenOptions,\n  newError,\n  PublishConfiguration,\n} from \"builder-util-runtime\"\nimport { AppUpdater } from \"./AppUpdater\"\nimport { BitbucketProvider } from \"./providers/BitbucketProvider\"\nimport { GenericProvider } from \"./providers/GenericProvider\"\nimport { GitHubProvider } from \"./providers/GitHubProvider\"\nimport { GitLabProvider } from \"./providers/GitLabProvider\"\nimport { KeygenProvider } from \"./providers/KeygenProvider\"\nimport { PrivateGitHubProvider } from \"./providers/PrivateGitHubProvider\"\nimport { Provider, ProviderRuntimeOptions } from \"./providers/Provider\"\n\nexport function isUrlProbablySupportMultiRangeRequests(url: string): boolean {\n  return !url.includes(\"s3.amazonaws.com\")\n}\n\nexport function createClient(data: PublishConfiguration | AllPublishOptions, updater: AppUpdater, runtimeOptions: ProviderRuntimeOptions): Provider<any> {\n  // noinspection SuspiciousTypeOfGuard\n  if (typeof data === \"string\") {\n    throw newError(\"Please pass PublishConfiguration object\", \"ERR_UPDATER_INVALID_PROVIDER_CONFIGURATION\")\n  }\n\n  const provider = data.provider\n  switch (provider) {\n    case \"github\": {\n      const githubOptions = data as GithubOptions\n      const token = (githubOptions.private ? process.env[\"GH_TOKEN\"] || process.env[\"GITHUB_TOKEN\"] : null) || githubOptions.token\n      if (token == null) {\n        return new GitHubProvider(githubOptions, updater, runtimeOptions)\n      } else {\n        return new PrivateGitHubProvider(githubOptions, updater, token, runtimeOptions)\n      }\n    }\n\n    case \"bitbucket\":\n      return new BitbucketProvider(data as BitbucketOptions, updater, runtimeOptions)\n\n    case \"gitlab\":\n      return new GitLabProvider(data as GitlabOptions, updater, runtimeOptions)\n\n    case \"keygen\":\n      return new KeygenProvider(data as KeygenOptions, updater, runtimeOptions)\n\n    case \"s3\":\n    case \"spaces\":\n      return new GenericProvider(\n        {\n          provider: \"generic\",\n          url: getS3LikeProviderBaseUrl(data),\n          channel: (data as BaseS3Options).channel || null,\n        },\n        updater,\n        {\n          ...runtimeOptions,\n          // https://github.com/minio/minio/issues/5285#issuecomment-350428955\n          isUseMultipleRangeRequest: false,\n        }\n      )\n\n    case \"generic\": {\n      const options = data as GenericServerOptions\n      return new GenericProvider(options, updater, {\n        ...runtimeOptions,\n        isUseMultipleRangeRequest: options.useMultipleRangeRequest !== false && isUrlProbablySupportMultiRangeRequests(options.url),\n      })\n    }\n\n    case \"custom\": {\n      const options = data as CustomPublishOptions\n      const constructor = options.updateProvider\n      if (!constructor) {\n        throw newError(\"Custom provider not specified\", \"ERR_UPDATER_INVALID_PROVIDER_CONFIGURATION\")\n      }\n      return new constructor(options, updater, runtimeOptions)\n    }\n\n    default:\n      throw newError(`Unsupported provider: ${provider}`, \"ERR_UPDATER_UNSUPPORTED_PROVIDER\")\n  }\n}\n"]}"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.BitbucketProvider = void 0;
const builder_util_runtime_1 = require("builder-util-runtime");
const util_1 = require("../util");
const Provider_1 = require("./Provider");
class BitbucketProvider extends Provider_1.Provider {
    constructor(configuration, updater, runtimeOptions) {
        super({
            ...runtimeOptions,
            isUseMultipleRangeRequest: false,
        });
        this.configuration = configuration;
        this.updater = updater;
        const { owner, slug } = configuration;
        this.baseUrl = (0, util_1.newBaseUrl)(`https://api.bitbucket.org/2.0/repositories/${owner}/${slug}/downloads`);
    }
    get channel() {
        return this.updater.channel || this.configuration.channel || "latest";
    }
    async getLatestVersion() {
        const cancellationToken = new builder_util_runtime_1.CancellationToken();
        const channelFile = (0, util_1.getChannelFilename)(this.getCustomChannelName(this.channel));
        const channelUrl = (0, util_1.newUrlFromBase)(channelFile, this.baseUrl, this.updater.isAddNoCacheQuery);
        try {
            const updateInfo = await this.httpRequest(channelUrl, undefined, cancellationToken);
            return (0, Provider_1.parseUpdateInfo)(updateInfo, channelFile, channelUrl);
        }
        catch (e) {
            throw (0, builder_util_runtime_1.newError)(`Unable to find latest version on ${this.toString()}, please ensure release exists: ${e.stack || e.message}`, "ERR_UPDATER_LATEST_VERSION_NOT_FOUND");
        }
    }
    resolveFiles(updateInfo) {
        return (0, Provider_1.resolveFiles)(updateInfo, this.baseUrl);
    }
    toString() {
        const { owner, slug } = this.configuration;
        return `Bitbucket (owner: ${owner}, slug: ${slug}, channel: ${this.channel})`;
    }
}
exports.BitbucketProvider = BitbucketProvider;
//# sourceMappingURL=BitbucketProvider.js.map{"version":3,"file":"BitbucketProvider.js","sourceRoot":"","sources":["../../src/providers/BitbucketProvider.ts"],"names":[],"mappings":";;;AAAA,+DAAgG;AAGhG,kCAAwE;AACxE,yCAA4F;AAE5F,MAAa,iBAAkB,SAAQ,mBAAoB;IAGzD,YACmB,aAA+B,EAC/B,OAAmB,EACpC,cAAsC;QAEtC,KAAK,CAAC;YACJ,GAAG,cAAc;YACjB,yBAAyB,EAAE,KAAK;SACjC,CAAC,CAAA;QAPe,kBAAa,GAAb,aAAa,CAAkB;QAC/B,YAAO,GAAP,OAAO,CAAY;QAOpC,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,aAAa,CAAA;QACrC,IAAI,CAAC,OAAO,GAAG,IAAA,iBAAU,EAAC,8CAA8C,KAAK,IAAI,IAAI,YAAY,CAAC,CAAA;IACpG,CAAC;IAED,IAAY,OAAO;QACjB,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,IAAI,IAAI,CAAC,aAAa,CAAC,OAAO,IAAI,QAAQ,CAAA;IACvE,CAAC;IAED,KAAK,CAAC,gBAAgB;QACpB,MAAM,iBAAiB,GAAG,IAAI,wCAAiB,EAAE,CAAA;QACjD,MAAM,WAAW,GAAG,IAAA,yBAAkB,EAAC,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAA;QAC/E,MAAM,UAAU,GAAG,IAAA,qBAAc,EAAC,WAAW,EAAE,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAA;QAC5F,IAAI,CAAC;YACH,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,UAAU,EAAE,SAAS,EAAE,iBAAiB,CAAC,CAAA;YACnF,OAAO,IAAA,0BAAe,EAAC,UAAU,EAAE,WAAW,EAAE,UAAU,CAAC,CAAA;QAC7D,CAAC;QAAC,OAAO,CAAM,EAAE,CAAC;YAChB,MAAM,IAAA,+BAAQ,EAAC,oCAAoC,IAAI,CAAC,QAAQ,EAAE,mCAAmC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,sCAAsC,CAAC,CAAA;QACtK,CAAC;IACH,CAAC;IAED,YAAY,CAAC,UAAsB;QACjC,OAAO,IAAA,uBAAY,EAAC,UAAU,EAAE,IAAI,CAAC,OAAO,CAAC,CAAA;IAC/C,CAAC;IAED,QAAQ;QACN,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC,aAAa,CAAA;QAC1C,OAAO,qBAAqB,KAAK,WAAW,IAAI,cAAc,IAAI,CAAC,OAAO,GAAG,CAAA;IAC/E,CAAC;CACF;AAxCD,8CAwCC","sourcesContent":["import { CancellationToken, BitbucketOptions, newError, UpdateInfo } from \"builder-util-runtime\"\nimport { AppUpdater } from \"../AppUpdater\"\nimport { ResolvedUpdateFileInfo } from \"../types\"\nimport { getChannelFilename, newBaseUrl, newUrlFromBase } from \"../util\"\nimport { parseUpdateInfo, Provider, ProviderRuntimeOptions, resolveFiles } from \"./Provider\"\n\nexport class BitbucketProvider extends Provider<UpdateInfo> {\n  private readonly baseUrl: URL\n\n  constructor(\n    private readonly configuration: BitbucketOptions,\n    private readonly updater: AppUpdater,\n    runtimeOptions: ProviderRuntimeOptions\n  ) {\n    super({\n      ...runtimeOptions,\n      isUseMultipleRangeRequest: false,\n    })\n    const { owner, slug } = configuration\n    this.baseUrl = newBaseUrl(`https://api.bitbucket.org/2.0/repositories/${owner}/${slug}/downloads`)\n  }\n\n  private get channel(): string {\n    return this.updater.channel || this.configuration.channel || \"latest\"\n  }\n\n  async getLatestVersion(): Promise<UpdateInfo> {\n    const cancellationToken = new CancellationToken()\n    const channelFile = getChannelFilename(this.getCustomChannelName(this.channel))\n    const channelUrl = newUrlFromBase(channelFile, this.baseUrl, this.updater.isAddNoCacheQuery)\n    try {\n      const updateInfo = await this.httpRequest(channelUrl, undefined, cancellationToken)\n      return parseUpdateInfo(updateInfo, channelFile, channelUrl)\n    } catch (e: any) {\n      throw newError(`Unable to find latest version on ${this.toString()}, please ensure release exists: ${e.stack || e.message}`, \"ERR_UPDATER_LATEST_VERSION_NOT_FOUND\")\n    }\n  }\n\n  resolveFiles(updateInfo: UpdateInfo): Array<ResolvedUpdateFileInfo> {\n    return resolveFiles(updateInfo, this.baseUrl)\n  }\n\n  toString() {\n    const { owner, slug } = this.configuration\n    return `Bitbucket (owner: ${owner}, slug: ${slug}, channel: ${this.channel})`\n  }\n}\n"]}"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.GenericProvider = void 0;
const builder_util_runtime_1 = require("builder-util-runtime");
const util_1 = require("../util");
const Provider_1 = require("./Provider");
class GenericProvider extends Provider_1.Provider {
    constructor(configuration, updater, runtimeOptions) {
        super(runtimeOptions);
        this.configuration = configuration;
        this.updater = updater;
        this.baseUrl = (0, util_1.newBaseUrl)(this.configuration.url);
    }
    get channel() {
        const result = this.updater.channel || this.configuration.channel;
        return result == null ? this.getDefaultChannelName() : this.getCustomChannelName(result);
    }
    async getLatestVersion() {
        const channelFile = (0, util_1.getChannelFilename)(this.channel);
        const channelUrl = (0, util_1.newUrlFromBase)(channelFile, this.baseUrl, this.updater.isAddNoCacheQuery);
        for (let attemptNumber = 0;; attemptNumber++) {
            try {
                return (0, Provider_1.parseUpdateInfo)(await this.httpRequest(channelUrl), channelFile, channelUrl);
            }
            catch (e) {
                if (e instanceof builder_util_runtime_1.HttpError && e.statusCode === 404) {
                    throw (0, builder_util_runtime_1.newError)(`Cannot find channel "${channelFile}" update info: ${e.stack || e.message}`, "ERR_UPDATER_CHANNEL_FILE_NOT_FOUND");
                }
                else if (e.code === "ECONNREFUSED") {
                    if (attemptNumber < 3) {
                        await new Promise((resolve, reject) => {
                            try {
                                setTimeout(resolve, 1000 * attemptNumber);
                            }
                            catch (e) {
                                reject(e);
                            }
                        });
                        continue;
                    }
                }
                throw e;
            }
        }
    }
    resolveFiles(updateInfo) {
        return (0, Provider_1.resolveFiles)(updateInfo, this.baseUrl);
    }
}
exports.GenericProvider = GenericProvider;
//# sourceMappingURL=GenericProvider.js.map{"version":3,"file":"GenericProvider.js","sourceRoot":"","sources":["../../src/providers/GenericProvider.ts"],"names":[],"mappings":";;;AAAA,+DAA4F;AAG5F,kCAAwE;AACxE,yCAA4F;AAE5F,MAAa,eAAgB,SAAQ,mBAAoB;IAGvD,YACmB,aAAmC,EACnC,OAAmB,EACpC,cAAsC;QAEtC,KAAK,CAAC,cAAc,CAAC,CAAA;QAJJ,kBAAa,GAAb,aAAa,CAAsB;QACnC,YAAO,GAAP,OAAO,CAAY;QAJrB,YAAO,GAAG,IAAA,iBAAU,EAAC,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,CAAA;IAQ7D,CAAC;IAED,IAAY,OAAO;QACjB,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,IAAI,IAAI,CAAC,aAAa,CAAC,OAAO,CAAA;QACjE,OAAO,MAAM,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,qBAAqB,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAA;IAC1F,CAAC;IAED,KAAK,CAAC,gBAAgB;QACpB,MAAM,WAAW,GAAG,IAAA,yBAAkB,EAAC,IAAI,CAAC,OAAO,CAAC,CAAA;QACpD,MAAM,UAAU,GAAG,IAAA,qBAAc,EAAC,WAAW,EAAE,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAA;QAC5F,KAAK,IAAI,aAAa,GAAG,CAAC,GAAI,aAAa,EAAE,EAAE,CAAC;YAC9C,IAAI,CAAC;gBACH,OAAO,IAAA,0BAAe,EAAC,MAAM,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,EAAE,WAAW,EAAE,UAAU,CAAC,CAAA;YACrF,CAAC;YAAC,OAAO,CAAM,EAAE,CAAC;gBAChB,IAAI,CAAC,YAAY,gCAAS,IAAI,CAAC,CAAC,UAAU,KAAK,GAAG,EAAE,CAAC;oBACnD,MAAM,IAAA,+BAAQ,EAAC,wBAAwB,WAAW,kBAAkB,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,oCAAoC,CAAC,CAAA;gBACnI,CAAC;qBAAM,IAAI,CAAC,CAAC,IAAI,KAAK,cAAc,EAAE,CAAC;oBACrC,IAAI,aAAa,GAAG,CAAC,EAAE,CAAC;wBACtB,MAAM,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;4BACpC,IAAI,CAAC;gCACH,UAAU,CAAC,OAAO,EAAE,IAAI,GAAG,aAAa,CAAC,CAAA;4BAC3C,CAAC;4BAAC,OAAO,CAAM,EAAE,CAAC;gCAChB,MAAM,CAAC,CAAC,CAAC,CAAA;4BACX,CAAC;wBACH,CAAC,CAAC,CAAA;wBACF,SAAQ;oBACV,CAAC;gBACH,CAAC;gBACD,MAAM,CAAC,CAAA;YACT,CAAC;QACH,CAAC;IACH,CAAC;IAED,YAAY,CAAC,UAAsB;QACjC,OAAO,IAAA,uBAAY,EAAC,UAAU,EAAE,IAAI,CAAC,OAAO,CAAC,CAAA;IAC/C,CAAC;CACF;AA7CD,0CA6CC","sourcesContent":["import { GenericServerOptions, HttpError, newError, UpdateInfo } from \"builder-util-runtime\"\nimport { AppUpdater } from \"../AppUpdater\"\nimport { ResolvedUpdateFileInfo } from \"../types\"\nimport { getChannelFilename, newBaseUrl, newUrlFromBase } from \"../util\"\nimport { parseUpdateInfo, Provider, ProviderRuntimeOptions, resolveFiles } from \"./Provider\"\n\nexport class GenericProvider extends Provider<UpdateInfo> {\n  private readonly baseUrl = newBaseUrl(this.configuration.url)\n\n  constructor(\n    private readonly configuration: GenericServerOptions,\n    private readonly updater: AppUpdater,\n    runtimeOptions: ProviderRuntimeOptions\n  ) {\n    super(runtimeOptions)\n  }\n\n  private get channel(): string {\n    const result = this.updater.channel || this.configuration.channel\n    return result == null ? this.getDefaultChannelName() : this.getCustomChannelName(result)\n  }\n\n  async getLatestVersion(): Promise<UpdateInfo> {\n    const channelFile = getChannelFilename(this.channel)\n    const channelUrl = newUrlFromBase(channelFile, this.baseUrl, this.updater.isAddNoCacheQuery)\n    for (let attemptNumber = 0; ; attemptNumber++) {\n      try {\n        return parseUpdateInfo(await this.httpRequest(channelUrl), channelFile, channelUrl)\n      } catch (e: any) {\n        if (e instanceof HttpError && e.statusCode === 404) {\n          throw newError(`Cannot find channel \"${channelFile}\" update info: ${e.stack || e.message}`, \"ERR_UPDATER_CHANNEL_FILE_NOT_FOUND\")\n        } else if (e.code === \"ECONNREFUSED\") {\n          if (attemptNumber < 3) {\n            await new Promise((resolve, reject) => {\n              try {\n                setTimeout(resolve, 1000 * attemptNumber)\n              } catch (e: any) {\n                reject(e)\n              }\n            })\n            continue\n          }\n        }\n        throw e\n      }\n    }\n  }\n\n  resolveFiles(updateInfo: UpdateInfo): Array<ResolvedUpdateFileInfo> {\n    return resolveFiles(updateInfo, this.baseUrl)\n  }\n}\n"]}"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.GitHubProvider = exports.BaseGitHubProvider = void 0;
exports.computeReleaseNotes = computeReleaseNotes;
const builder_util_runtime_1 = require("builder-util-runtime");
const semver = require("semver");
const url_1 = require("url");
const util_1 = require("../util");
const Provider_1 = require("./Provider");
const hrefRegExp = /\/tag\/(v?[^/]+)$/;
class BaseGitHubProvider extends Provider_1.Provider {
    constructor(options, defaultHost, runtimeOptions) {
        super({
            ...runtimeOptions,
            /* because GitHib uses S3 */
            isUseMultipleRangeRequest: false,
        });
        this.options = options;
        this.baseUrl = (0, util_1.newBaseUrl)((0, builder_util_runtime_1.githubUrl)(options, defaultHost));
        const apiHost = defaultHost === "github.com" ? "api.github.com" : defaultHost;
        this.baseApiUrl = (0, util_1.newBaseUrl)((0, builder_util_runtime_1.githubUrl)(options, apiHost));
    }
    computeGithubBasePath(result) {
        // https://github.com/electron-userland/electron-builder/issues/1903#issuecomment-320881211
        const host = this.options.host;
        return host && !["github.com", "api.github.com"].includes(host) ? `/api/v3${result}` : result;
    }
}
exports.BaseGitHubProvider = BaseGitHubProvider;
class GitHubProvider extends BaseGitHubProvider {
    constructor(options, updater, runtimeOptions) {
        super(options, "github.com", runtimeOptions);
        this.options = options;
        this.updater = updater;
    }
    get channel() {
        const result = this.updater.channel || this.options.channel;
        return result == null ? this.getDefaultChannelName() : this.getCustomChannelName(result);
    }
    async getLatestVersion() {
        var _a, _b, _c, _d, _e;
        const cancellationToken = new builder_util_runtime_1.CancellationToken();
        const feedXml = (await this.httpRequest((0, util_1.newUrlFromBase)(`${this.basePath}.atom`, this.baseUrl), {
            accept: "application/xml, application/atom+xml, text/xml, */*",
        }, cancellationToken));
        const feed = (0, builder_util_runtime_1.parseXml)(feedXml);
        // noinspection TypeScriptValidateJSTypes
        let latestRelease = feed.element("entry", false, `No published versions on GitHub`);
        let tag = null;
        try {
            if (this.updater.allowPrerelease) {
                const currentChannel = ((_a = this.updater) === null || _a === void 0 ? void 0 : _a.channel) || ((_b = semver.prerelease(this.updater.currentVersion)) === null || _b === void 0 ? void 0 : _b[0]) || null;
                if (currentChannel === null) {
                    // allowPrerelease=true with no explicit channel and stable current version:
                    // pick the first entry from the Atom feed, which may be a prerelease
                    // noinspection TypeScriptValidateJSTypes
                    tag = hrefRegExp.exec(latestRelease.element("link").attribute("href"))[1];
                }
                else {
                    for (const element of feed.getElements("entry")) {
                        // noinspection TypeScriptValidateJSTypes
                        const hrefElement = hrefRegExp.exec(element.element("link").attribute("href"));
                        // If this is null then something is wrong and skip this release
                        if (hrefElement === null) {
                            continue;
                        }
                        // This Release's Tag
                        const hrefTag = hrefElement[1];
                        if (!semver.valid(hrefTag)) {
                            continue;
                        }
                        //Get Channel from this release's tag
                        const hrefChannel = ((_c = semver.prerelease(hrefTag)) === null || _c === void 0 ? void 0 : _c[0]) || null;
                        const shouldFetchVersion = !currentChannel || ["alpha", "beta"].includes(currentChannel);
                        const isCustomChannel = hrefChannel !== null && !["alpha", "beta"].includes(String(hrefChannel));
                        // Allow moving from alpha to beta but not down
                        const channelMismatch = currentChannel === "beta" && hrefChannel === "alpha";
                        if (shouldFetchVersion && !isCustomChannel && !channelMismatch) {
                            tag = hrefTag;
                            latestRelease = element;
                            break;
                        }
                        const isNextPreRelease = hrefChannel && hrefChannel === currentChannel;
                        if (isNextPreRelease) {
                            tag = hrefTag;
                            latestRelease = element;
                            break;
                        }
                    }
                }
            }
            else {
                tag = await this.getLatestTagName(cancellationToken);
                for (const element of feed.getElements("entry")) {
                    // noinspection TypeScriptValidateJSTypes
                    const hrefMatch = hrefRegExp.exec(element.element("link").attribute("href"));
                    if (hrefMatch == null) {
                        continue;
                    }
                    if (hrefMatch[1] === tag) {
                        latestRelease = element;
                        break;
                    }
                }
            }
        }
        catch (e) {
            throw (0, builder_util_runtime_1.newError)(`Cannot parse releases feed: ${e.stack || e.message},\nXML:\n${feedXml}`, "ERR_UPDATER_INVALID_RELEASE_FEED");
        }
        if (tag == null) {
            throw (0, builder_util_runtime_1.newError)(`No published versions on GitHub`, "ERR_UPDATER_NO_PUBLISHED_VERSIONS");
        }
        let rawData;
        let channelFile = "";
        let channelFileUrl = "";
        const fetchData = async (channelName) => {
            channelFile = (0, util_1.getChannelFilename)(channelName);
            channelFileUrl = (0, util_1.newUrlFromBase)(this.getBaseDownloadPath(String(tag), channelFile), this.baseUrl);
            const requestOptions = this.createRequestOptions(channelFileUrl);
            try {
                return (await this.executor.request(requestOptions, cancellationToken));
            }
            catch (e) {
                if (e instanceof builder_util_runtime_1.HttpError && e.statusCode === 404) {
                    throw (0, builder_util_runtime_1.newError)(`Cannot find ${channelFile} in the latest release artifacts (${channelFileUrl}): ${e.stack || e.message}`, "ERR_UPDATER_CHANNEL_FILE_NOT_FOUND");
                }
                throw e;
            }
        };
        try {
            let channel = this.channel;
            if (this.updater.allowPrerelease && ((_d = semver.prerelease(tag)) === null || _d === void 0 ? void 0 : _d[0])) {
                channel = this.getCustomChannelName(String((_e = semver.prerelease(tag)) === null || _e === void 0 ? void 0 : _e[0]));
            }
            rawData = await fetchData(channel);
        }
        catch (e) {
            if (this.updater.allowPrerelease) {
                // Allow fallback to `latest.yml`
                rawData = await fetchData(this.getDefaultChannelName());
            }
            else {
                throw e;
            }
        }
        const result = (0, Provider_1.parseUpdateInfo)(rawData, channelFile, channelFileUrl);
        if (result.releaseName == null) {
            result.releaseName = latestRelease.elementValueOrEmpty("title");
        }
        if (result.releaseNotes == null) {
            result.releaseNotes = computeReleaseNotes(this.updater.currentVersion, this.updater.fullChangelog, feed, latestRelease);
        }
        return {
            tag: tag,
            ...result,
        };
    }
    async getLatestTagName(cancellationToken) {
        const options = this.options;
        // do not use API for GitHub to avoid limit, only for custom host or GitHub Enterprise
        const url = options.host == null || options.host === "github.com"
            ? (0, util_1.newUrlFromBase)(`${this.basePath}/latest`, this.baseUrl)
            : new url_1.URL(`${this.computeGithubBasePath(`/repos/${options.owner}/${options.repo}/releases`)}/latest`, this.baseApiUrl);
        try {
            const rawData = await this.httpRequest(url, { Accept: "application/json" }, cancellationToken);
            if (rawData == null) {
                return null;
            }
            const releaseInfo = JSON.parse(rawData);
            return releaseInfo.tag_name;
        }
        catch (e) {
            throw (0, builder_util_runtime_1.newError)(`Unable to find latest version on GitHub (${url}), please ensure a production release exists: ${e.stack || e.message}`, "ERR_UPDATER_LATEST_VERSION_NOT_FOUND");
        }
    }
    get basePath() {
        return `/${this.options.owner}/${this.options.repo}/releases`;
    }
    resolveFiles(updateInfo) {
        // still replace space to - due to backward compatibility
        return (0, Provider_1.resolveFiles)(updateInfo, this.baseUrl, p => this.getBaseDownloadPath(updateInfo.tag, p.replace(/ /g, "-")));
    }
    getBaseDownloadPath(tag, fileName) {
        return `${this.basePath}/download/${tag}/${fileName}`;
    }
}
exports.GitHubProvider = GitHubProvider;
function getNoteValue(parent) {
    const result = parent.elementValueOrEmpty("content");
    // GitHub reports empty notes as <content>No content.</content>
    return result === "No content." ? "" : result;
}
function computeReleaseNotes(currentVersion, isFullChangelog, feed, latestRelease) {
    if (!isFullChangelog) {
        return getNoteValue(latestRelease);
    }
    const releaseVersionRegExp = /\/tag\/v?([^/]+)$/;
    let latestVersion = undefined;
    try {
        latestVersion = releaseVersionRegExp.exec(latestRelease.element("link").attribute("href"))[1];
        latestVersion = semver.valid(latestVersion) ? latestVersion : undefined;
    }
    catch {
        // If we cannot parse the latest release version, return null â€” notes cannot be determined
    }
    if (latestVersion == null) {
        return null;
    }
    const releaseNotes = [];
    for (const release of feed.getElements("entry")) {
        let versionRelease;
        try {
            const match = releaseVersionRegExp.exec(release.element("link").attribute("href"));
            if (!match) {
                continue;
            }
            versionRelease = match[1];
        }
        catch {
            continue;
        }
        // skip non-semver tags (e.g. doc/website releases in monorepos)
        if (!semver.valid(versionRelease)) {
            continue;
        }
        const isGreaterThanCurrent = semver.gt(versionRelease, currentVersion.raw);
        const isLessOrEqualThanLatest = semver.lte(versionRelease, latestVersion);
        if (isGreaterThanCurrent && isLessOrEqualThanLatest) {
            releaseNotes.push({
                version: versionRelease,
                note: getNoteValue(release),
            });
        }
    }
    return releaseNotes.sort((a, b) => semver.rcompare(a.version, b.version));
}
//# sourceMappingURL=GitHubProvider.js.map{"version":3,"file":"GitHubProvider.js","sourceRoot":"","sources":["../../src/providers/GitHubProvider.ts"],"names":[],"mappings":";;;AAqOA,kDA8CC;AAnRD,+DAAwJ;AACxJ,iCAAgC;AAChC,6BAAyB;AAGzB,kCAAwE;AACxE,yCAA4F;AAE5F,MAAM,UAAU,GAAG,mBAAmB,CAAA;AAKtC,MAAsB,kBAAyC,SAAQ,mBAAW;IAKhF,YACqB,OAAsB,EACzC,WAAmB,EACnB,cAAsC;QAEtC,KAAK,CAAC;YACJ,GAAG,cAAc;YACjB,4BAA4B;YAC5B,yBAAyB,EAAE,KAAK;SACjC,CAAC,CAAA;QARiB,YAAO,GAAP,OAAO,CAAe;QAUzC,IAAI,CAAC,OAAO,GAAG,IAAA,iBAAU,EAAC,IAAA,gCAAS,EAAC,OAAO,EAAE,WAAW,CAAC,CAAC,CAAA;QAC1D,MAAM,OAAO,GAAG,WAAW,KAAK,YAAY,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,WAAW,CAAA;QAC7E,IAAI,CAAC,UAAU,GAAG,IAAA,iBAAU,EAAC,IAAA,gCAAS,EAAC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAA;IAC3D,CAAC;IAES,qBAAqB,CAAC,MAAc;QAC5C,2FAA2F;QAC3F,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAA;QAC9B,OAAO,IAAI,IAAI,CAAC,CAAC,YAAY,EAAE,gBAAgB,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,UAAU,MAAM,EAAE,CAAC,CAAC,CAAC,MAAM,CAAA;IAC/F,CAAC;CACF;AA1BD,gDA0BC;AAED,MAAa,cAAe,SAAQ,kBAAoC;IACtE,YACqB,OAAsB,EACxB,OAAmB,EACpC,cAAsC;QAEtC,KAAK,CAAC,OAAO,EAAE,YAAY,EAAE,cAAc,CAAC,CAAA;QAJzB,YAAO,GAAP,OAAO,CAAe;QACxB,YAAO,GAAP,OAAO,CAAY;IAItC,CAAC;IAED,IAAY,OAAO;QACjB,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,IAAI,IAAI,CAAC,OAAO,CAAC,OAAO,CAAA;QAC3D,OAAO,MAAM,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,qBAAqB,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAA;IAC1F,CAAC;IAED,KAAK,CAAC,gBAAgB;;QACpB,MAAM,iBAAiB,GAAG,IAAI,wCAAiB,EAAE,CAAA;QAEjD,MAAM,OAAO,GAAW,CAAC,MAAM,IAAI,CAAC,WAAW,CAC7C,IAAA,qBAAc,EAAC,GAAG,IAAI,CAAC,QAAQ,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,EACrD;YACE,MAAM,EAAE,sDAAsD;SAC/D,EACD,iBAAiB,CAClB,CAAE,CAAA;QAEH,MAAM,IAAI,GAAG,IAAA,+BAAQ,EAAC,OAAO,CAAC,CAAA;QAC9B,yCAAyC;QACzC,IAAI,aAAa,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,KAAK,EAAE,iCAAiC,CAAC,CAAA;QACnF,IAAI,GAAG,GAAkB,IAAI,CAAA;QAC7B,IAAI,CAAC;YACH,IAAI,IAAI,CAAC,OAAO,CAAC,eAAe,EAAE,CAAC;gBACjC,MAAM,cAAc,GAAG,CAAA,MAAA,IAAI,CAAC,OAAO,0CAAE,OAAO,MAAK,MAAA,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,0CAAG,CAAC,CAAY,CAAA,IAAI,IAAI,CAAA;gBAEvH,IAAI,cAAc,KAAK,IAAI,EAAE,CAAC;oBAC5B,4EAA4E;oBAC5E,qEAAqE;oBACrE,yCAAyC;oBACzC,GAAG,GAAG,UAAU,CAAC,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,CAAE,CAAC,CAAC,CAAC,CAAA;gBAC5E,CAAC;qBAAM,CAAC;oBACN,KAAK,MAAM,OAAO,IAAI,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE,CAAC;wBAChD,yCAAyC;wBACzC,MAAM,WAAW,GAAG,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,CAAE,CAAA;wBAE/E,gEAAgE;wBAChE,IAAI,WAAW,KAAK,IAAI,EAAE,CAAC;4BACzB,SAAQ;wBACV,CAAC;wBAED,qBAAqB;wBACrB,MAAM,OAAO,GAAG,WAAW,CAAC,CAAC,CAAC,CAAA;wBAC9B,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC;4BAC3B,SAAQ;wBACV,CAAC;wBAED,qCAAqC;wBACrC,MAAM,WAAW,GAAG,CAAC,MAAA,MAAM,CAAC,UAAU,CAAC,OAAO,CAAC,0CAAG,CAAC,CAAY,KAAI,IAAI,CAAA;wBAEvE,MAAM,kBAAkB,GAAG,CAAC,cAAc,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAA;wBACxF,MAAM,eAAe,GAAG,WAAW,KAAK,IAAI,IAAI,CAAC,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,CAAA;wBAChG,+CAA+C;wBAC/C,MAAM,eAAe,GAAG,cAAc,KAAK,MAAM,IAAI,WAAW,KAAK,OAAO,CAAA;wBAE5E,IAAI,kBAAkB,IAAI,CAAC,eAAe,IAAI,CAAC,eAAe,EAAE,CAAC;4BAC/D,GAAG,GAAG,OAAO,CAAA;4BACb,aAAa,GAAG,OAAO,CAAA;4BACvB,MAAK;wBACP,CAAC;wBAED,MAAM,gBAAgB,GAAG,WAAW,IAAI,WAAW,KAAK,cAAc,CAAA;wBACtE,IAAI,gBAAgB,EAAE,CAAC;4BACrB,GAAG,GAAG,OAAO,CAAA;4BACb,aAAa,GAAG,OAAO,CAAA;4BACvB,MAAK;wBACP,CAAC;oBACH,CAAC;gBACH,CAAC;YACH,CAAC;iBAAM,CAAC;gBACN,GAAG,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,iBAAiB,CAAC,CAAA;gBACpD,KAAK,MAAM,OAAO,IAAI,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE,CAAC;oBAChD,yCAAyC;oBACzC,MAAM,SAAS,GAAG,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAA;oBAC5E,IAAI,SAAS,IAAI,IAAI,EAAE,CAAC;wBACtB,SAAQ;oBACV,CAAC;oBACD,IAAI,SAAS,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE,CAAC;wBACzB,aAAa,GAAG,OAAO,CAAA;wBACvB,MAAK;oBACP,CAAC;gBACH,CAAC;YACH,CAAC;QACH,CAAC;QAAC,OAAO,CAAM,EAAE,CAAC;YAChB,MAAM,IAAA,+BAAQ,EAAC,+BAA+B,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,OAAO,YAAY,OAAO,EAAE,EAAE,kCAAkC,CAAC,CAAA;QAC9H,CAAC;QAED,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC;YAChB,MAAM,IAAA,+BAAQ,EAAC,iCAAiC,EAAE,mCAAmC,CAAC,CAAA;QACxF,CAAC;QAED,IAAI,OAAe,CAAA;QACnB,IAAI,WAAW,GAAG,EAAE,CAAA;QACpB,IAAI,cAAc,GAAQ,EAAE,CAAA;QAC5B,MAAM,SAAS,GAAG,KAAK,EAAE,WAAmB,EAAE,EAAE;YAC9C,WAAW,GAAG,IAAA,yBAAkB,EAAC,WAAW,CAAC,CAAA;YAC7C,cAAc,GAAG,IAAA,qBAAc,EAAC,IAAI,CAAC,mBAAmB,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,WAAW,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,CAAA;YACjG,MAAM,cAAc,GAAG,IAAI,CAAC,oBAAoB,CAAC,cAAc,CAAC,CAAA;YAChE,IAAI,CAAC;gBACH,OAAO,CAAC,MAAM,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,cAAc,EAAE,iBAAiB,CAAC,CAAE,CAAA;YAC1E,CAAC;YAAC,OAAO,CAAM,EAAE,CAAC;gBAChB,IAAI,CAAC,YAAY,gCAAS,IAAI,CAAC,CAAC,UAAU,KAAK,GAAG,EAAE,CAAC;oBACnD,MAAM,IAAA,+BAAQ,EAAC,eAAe,WAAW,qCAAqC,cAAc,MAAM,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,oCAAoC,CAAC,CAAA;gBACjK,CAAC;gBACD,MAAM,CAAC,CAAA;YACT,CAAC;QACH,CAAC,CAAA;QAED,IAAI,CAAC;YACH,IAAI,OAAO,GAAG,IAAI,CAAC,OAAO,CAAA;YAC1B,IAAI,IAAI,CAAC,OAAO,CAAC,eAAe,KAAI,MAAA,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,0CAAG,CAAC,CAAC,CAAA,EAAE,CAAC;gBAChE,OAAO,GAAG,IAAI,CAAC,oBAAoB,CAAC,MAAM,CAAC,MAAA,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,0CAAG,CAAC,CAAC,CAAC,CAAC,CAAA;YAC1E,CAAC;YACD,OAAO,GAAG,MAAM,SAAS,CAAC,OAAO,CAAC,CAAA;QACpC,CAAC;QAAC,OAAO,CAAM,EAAE,CAAC;YAChB,IAAI,IAAI,CAAC,OAAO,CAAC,eAAe,EAAE,CAAC;gBACjC,iCAAiC;gBACjC,OAAO,GAAG,MAAM,SAAS,CAAC,IAAI,CAAC,qBAAqB,EAAE,CAAC,CAAA;YACzD,CAAC;iBAAM,CAAC;gBACN,MAAM,CAAC,CAAA;YACT,CAAC;QACH,CAAC;QAED,MAAM,MAAM,GAAG,IAAA,0BAAe,EAAC,OAAO,EAAE,WAAW,EAAE,cAAc,CAAC,CAAA;QACpE,IAAI,MAAM,CAAC,WAAW,IAAI,IAAI,EAAE,CAAC;YAC/B,MAAM,CAAC,WAAW,GAAG,aAAa,CAAC,mBAAmB,CAAC,OAAO,CAAC,CAAA;QACjE,CAAC;QAED,IAAI,MAAM,CAAC,YAAY,IAAI,IAAI,EAAE,CAAC;YAChC,MAAM,CAAC,YAAY,GAAG,mBAAmB,CAAC,IAAI,CAAC,OAAO,CAAC,cAAc,EAAE,IAAI,CAAC,OAAO,CAAC,aAAa,EAAE,IAAI,EAAE,aAAa,CAAC,CAAA;QACzH,CAAC;QACD,OAAO;YACL,GAAG,EAAE,GAAG;YACR,GAAG,MAAM;SACV,CAAA;IACH,CAAC;IAEO,KAAK,CAAC,gBAAgB,CAAC,iBAAoC;QACjE,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAA;QAC5B,sFAAsF;QACtF,MAAM,GAAG,GACP,OAAO,CAAC,IAAI,IAAI,IAAI,IAAI,OAAO,CAAC,IAAI,KAAK,YAAY;YACnD,CAAC,CAAC,IAAA,qBAAc,EAAC,GAAG,IAAI,CAAC,QAAQ,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC;YACzD,CAAC,CAAC,IAAI,SAAG,CAAC,GAAG,IAAI,CAAC,qBAAqB,CAAC,UAAU,OAAO,CAAC,KAAK,IAAI,OAAO,CAAC,IAAI,WAAW,CAAC,SAAS,EAAE,IAAI,CAAC,UAAU,CAAC,CAAA;QAC1H,IAAI,CAAC;YACH,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,GAAG,EAAE,EAAE,MAAM,EAAE,kBAAkB,EAAE,EAAE,iBAAiB,CAAC,CAAA;YAC9F,IAAI,OAAO,IAAI,IAAI,EAAE,CAAC;gBACpB,OAAO,IAAI,CAAA;YACb,CAAC;YAED,MAAM,WAAW,GAAsB,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;YAC1D,OAAO,WAAW,CAAC,QAAQ,CAAA;QAC7B,CAAC;QAAC,OAAO,CAAM,EAAE,CAAC;YAChB,MAAM,IAAA,+BAAQ,EAAC,4CAA4C,GAAG,iDAAiD,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,sCAAsC,CAAC,CAAA;QAChL,CAAC;IACH,CAAC;IAED,IAAY,QAAQ;QAClB,OAAO,IAAI,IAAI,CAAC,OAAO,CAAC,KAAK,IAAI,IAAI,CAAC,OAAO,CAAC,IAAI,WAAW,CAAA;IAC/D,CAAC;IAED,YAAY,CAAC,UAA4B;QACvC,yDAAyD;QACzD,OAAO,IAAA,uBAAY,EAAC,UAAU,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,mBAAmB,CAAC,UAAU,CAAC,GAAG,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC,CAAA;IACpH,CAAC;IAEO,mBAAmB,CAAC,GAAW,EAAE,QAAgB;QACvD,OAAO,GAAG,IAAI,CAAC,QAAQ,aAAa,GAAG,IAAI,QAAQ,EAAE,CAAA;IACvD,CAAC;CACF;AAhLD,wCAgLC;AAMD,SAAS,YAAY,CAAC,MAAgB;IACpC,MAAM,MAAM,GAAG,MAAM,CAAC,mBAAmB,CAAC,SAAS,CAAC,CAAA;IACpD,+DAA+D;IAC/D,OAAO,MAAM,KAAK,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAA;AAC/C,CAAC;AAED,SAAgB,mBAAmB,CAAC,cAA6B,EAAE,eAAwB,EAAE,IAAc,EAAE,aAAuB;IAClI,IAAI,CAAC,eAAe,EAAE,CAAC;QACrB,OAAO,YAAY,CAAC,aAAa,CAAC,CAAA;IACpC,CAAC;IAED,MAAM,oBAAoB,GAAG,mBAAmB,CAAA;IAEhD,IAAI,aAAa,GAAuB,SAAS,CAAA;IACjD,IAAI,CAAC;QACH,aAAa,GAAG,oBAAoB,CAAC,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,CAAE,CAAC,CAAC,CAAC,CAAA;QAC9F,aAAa,GAAG,MAAM,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,SAAS,CAAA;IACzE,CAAC;IAAC,MAAM,CAAC;QACP,0FAA0F;IAC5F,CAAC;IAED,IAAI,aAAa,IAAI,IAAI,EAAE,CAAC;QAC1B,OAAO,IAAI,CAAA;IACb,CAAC;IAED,MAAM,YAAY,GAA2B,EAAE,CAAA;IAC/C,KAAK,MAAM,OAAO,IAAI,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE,CAAC;QAChD,IAAI,cAAsB,CAAA;QAC1B,IAAI,CAAC;YACH,MAAM,KAAK,GAAG,oBAAoB,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAA;YAClF,IAAI,CAAC,KAAK,EAAE,CAAC;gBACX,SAAQ;YACV,CAAC;YACD,cAAc,GAAG,KAAK,CAAC,CAAC,CAAC,CAAA;QAC3B,CAAC;QAAC,MAAM,CAAC;YACP,SAAQ;QACV,CAAC;QACD,gEAAgE;QAChE,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,cAAc,CAAC,EAAE,CAAC;YAClC,SAAQ;QACV,CAAC;QAED,MAAM,oBAAoB,GAAG,MAAM,CAAC,EAAE,CAAC,cAAc,EAAE,cAAc,CAAC,GAAG,CAAC,CAAA;QAC1E,MAAM,uBAAuB,GAAG,MAAM,CAAC,GAAG,CAAC,cAAc,EAAE,aAAa,CAAC,CAAA;QACzE,IAAI,oBAAoB,IAAI,uBAAuB,EAAE,CAAC;YACpD,YAAY,CAAC,IAAI,CAAC;gBAChB,OAAO,EAAE,cAAc;gBACvB,IAAI,EAAE,YAAY,CAAC,OAAO,CAAC;aAC5B,CAAC,CAAA;QACJ,CAAC;IACH,CAAC;IACD,OAAO,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAA;AAC3E,CAAC","sourcesContent":["import { CancellationToken, GithubOptions, githubUrl, HttpError, newError, parseXml, ReleaseNoteInfo, UpdateInfo, XElement } from \"builder-util-runtime\"\nimport * as semver from \"semver\"\nimport { URL } from \"url\"\nimport { AppUpdater } from \"../AppUpdater\"\nimport { ResolvedUpdateFileInfo } from \"../types\"\nimport { getChannelFilename, newBaseUrl, newUrlFromBase } from \"../util\"\nimport { parseUpdateInfo, Provider, ProviderRuntimeOptions, resolveFiles } from \"./Provider\"\n\nconst hrefRegExp = /\\/tag\\/(v?[^/]+)$/\n\ninterface GithubUpdateInfo extends UpdateInfo {\n  tag: string\n}\nexport abstract class BaseGitHubProvider<T extends UpdateInfo> extends Provider<T> {\n  // so, we don't need to parse port (because node http doesn't support host as url does)\n  protected readonly baseUrl: URL\n  protected readonly baseApiUrl: URL\n\n  protected constructor(\n    protected readonly options: GithubOptions,\n    defaultHost: string,\n    runtimeOptions: ProviderRuntimeOptions\n  ) {\n    super({\n      ...runtimeOptions,\n      /* because GitHib uses S3 */\n      isUseMultipleRangeRequest: false,\n    })\n\n    this.baseUrl = newBaseUrl(githubUrl(options, defaultHost))\n    const apiHost = defaultHost === \"github.com\" ? \"api.github.com\" : defaultHost\n    this.baseApiUrl = newBaseUrl(githubUrl(options, apiHost))\n  }\n\n  protected computeGithubBasePath(result: string): string {\n    // https://github.com/electron-userland/electron-builder/issues/1903#issuecomment-320881211\n    const host = this.options.host\n    return host && ![\"github.com\", \"api.github.com\"].includes(host) ? `/api/v3${result}` : result\n  }\n}\n\nexport class GitHubProvider extends BaseGitHubProvider<GithubUpdateInfo> {\n  constructor(\n    protected readonly options: GithubOptions,\n    private readonly updater: AppUpdater,\n    runtimeOptions: ProviderRuntimeOptions\n  ) {\n    super(options, \"github.com\", runtimeOptions)\n  }\n\n  private get channel(): string {\n    const result = this.updater.channel || this.options.channel\n    return result == null ? this.getDefaultChannelName() : this.getCustomChannelName(result)\n  }\n\n  async getLatestVersion(): Promise<GithubUpdateInfo> {\n    const cancellationToken = new CancellationToken()\n\n    const feedXml: string = (await this.httpRequest(\n      newUrlFromBase(`${this.basePath}.atom`, this.baseUrl),\n      {\n        accept: \"application/xml, application/atom+xml, text/xml, */*\",\n      },\n      cancellationToken\n    ))!\n\n    const feed = parseXml(feedXml)\n    // noinspection TypeScriptValidateJSTypes\n    let latestRelease = feed.element(\"entry\", false, `No published versions on GitHub`)\n    let tag: string | null = null\n    try {\n      if (this.updater.allowPrerelease) {\n        const currentChannel = this.updater?.channel || (semver.prerelease(this.updater.currentVersion)?.[0] as string) || null\n\n        if (currentChannel === null) {\n          // allowPrerelease=true with no explicit channel and stable current version:\n          // pick the first entry from the Atom feed, which may be a prerelease\n          // noinspection TypeScriptValidateJSTypes\n          tag = hrefRegExp.exec(latestRelease.element(\"link\").attribute(\"href\"))![1]\n        } else {\n          for (const element of feed.getElements(\"entry\")) {\n            // noinspection TypeScriptValidateJSTypes\n            const hrefElement = hrefRegExp.exec(element.element(\"link\").attribute(\"href\"))!\n\n            // If this is null then something is wrong and skip this release\n            if (hrefElement === null) {\n              continue\n            }\n\n            // This Release's Tag\n            const hrefTag = hrefElement[1]\n            if (!semver.valid(hrefTag)) {\n              continue\n            }\n\n            //Get Channel from this release's tag\n            const hrefChannel = (semver.prerelease(hrefTag)?.[0] as string) || null\n\n            const shouldFetchVersion = !currentChannel || [\"alpha\", \"beta\"].includes(currentChannel)\n            const isCustomChannel = hrefChannel !== null && ![\"alpha\", \"beta\"].includes(String(hrefChannel))\n            // Allow moving from alpha to beta but not down\n            const channelMismatch = currentChannel === \"beta\" && hrefChannel === \"alpha\"\n\n            if (shouldFetchVersion && !isCustomChannel && !channelMismatch) {\n              tag = hrefTag\n              latestRelease = element\n              break\n            }\n\n            const isNextPreRelease = hrefChannel && hrefChannel === currentChannel\n            if (isNextPreRelease) {\n              tag = hrefTag\n              latestRelease = element\n              break\n            }\n          }\n        }\n      } else {\n        tag = await this.getLatestTagName(cancellationToken)\n        for (const element of feed.getElements(\"entry\")) {\n          // noinspection TypeScriptValidateJSTypes\n          const hrefMatch = hrefRegExp.exec(element.element(\"link\").attribute(\"href\"))\n          if (hrefMatch == null) {\n            continue\n          }\n          if (hrefMatch[1] === tag) {\n            latestRelease = element\n            break\n          }\n        }\n      }\n    } catch (e: any) {\n      throw newError(`Cannot parse releases feed: ${e.stack || e.message},\\nXML:\\n${feedXml}`, \"ERR_UPDATER_INVALID_RELEASE_FEED\")\n    }\n\n    if (tag == null) {\n      throw newError(`No published versions on GitHub`, \"ERR_UPDATER_NO_PUBLISHED_VERSIONS\")\n    }\n\n    let rawData: string\n    let channelFile = \"\"\n    let channelFileUrl: any = \"\"\n    const fetchData = async (channelName: string) => {\n      channelFile = getChannelFilename(channelName)\n      channelFileUrl = newUrlFromBase(this.getBaseDownloadPath(String(tag), channelFile), this.baseUrl)\n      const requestOptions = this.createRequestOptions(channelFileUrl)\n      try {\n        return (await this.executor.request(requestOptions, cancellationToken))!\n      } catch (e: any) {\n        if (e instanceof HttpError && e.statusCode === 404) {\n          throw newError(`Cannot find ${channelFile} in the latest release artifacts (${channelFileUrl}): ${e.stack || e.message}`, \"ERR_UPDATER_CHANNEL_FILE_NOT_FOUND\")\n        }\n        throw e\n      }\n    }\n\n    try {\n      let channel = this.channel\n      if (this.updater.allowPrerelease && semver.prerelease(tag)?.[0]) {\n        channel = this.getCustomChannelName(String(semver.prerelease(tag)?.[0]))\n      }\n      rawData = await fetchData(channel)\n    } catch (e: any) {\n      if (this.updater.allowPrerelease) {\n        // Allow fallback to `latest.yml`\n        rawData = await fetchData(this.getDefaultChannelName())\n      } else {\n        throw e\n      }\n    }\n\n    const result = parseUpdateInfo(rawData, channelFile, channelFileUrl)\n    if (result.releaseName == null) {\n      result.releaseName = latestRelease.elementValueOrEmpty(\"title\")\n    }\n\n    if (result.releaseNotes == null) {\n      result.releaseNotes = computeReleaseNotes(this.updater.currentVersion, this.updater.fullChangelog, feed, latestRelease)\n    }\n    return {\n      tag: tag,\n      ...result,\n    }\n  }\n\n  private async getLatestTagName(cancellationToken: CancellationToken): Promise<string | null> {\n    const options = this.options\n    // do not use API for GitHub to avoid limit, only for custom host or GitHub Enterprise\n    const url =\n      options.host == null || options.host === \"github.com\"\n        ? newUrlFromBase(`${this.basePath}/latest`, this.baseUrl)\n        : new URL(`${this.computeGithubBasePath(`/repos/${options.owner}/${options.repo}/releases`)}/latest`, this.baseApiUrl)\n    try {\n      const rawData = await this.httpRequest(url, { Accept: \"application/json\" }, cancellationToken)\n      if (rawData == null) {\n        return null\n      }\n\n      const releaseInfo: GithubReleaseInfo = JSON.parse(rawData)\n      return releaseInfo.tag_name\n    } catch (e: any) {\n      throw newError(`Unable to find latest version on GitHub (${url}), please ensure a production release exists: ${e.stack || e.message}`, \"ERR_UPDATER_LATEST_VERSION_NOT_FOUND\")\n    }\n  }\n\n  private get basePath(): string {\n    return `/${this.options.owner}/${this.options.repo}/releases`\n  }\n\n  resolveFiles(updateInfo: GithubUpdateInfo): Array<ResolvedUpdateFileInfo> {\n    // still replace space to - due to backward compatibility\n    return resolveFiles(updateInfo, this.baseUrl, p => this.getBaseDownloadPath(updateInfo.tag, p.replace(/ /g, \"-\")))\n  }\n\n  private getBaseDownloadPath(tag: string, fileName: string): string {\n    return `${this.basePath}/download/${tag}/${fileName}`\n  }\n}\n\ninterface GithubReleaseInfo {\n  readonly tag_name: string\n}\n\nfunction getNoteValue(parent: XElement): string {\n  const result = parent.elementValueOrEmpty(\"content\")\n  // GitHub reports empty notes as <content>No content.</content>\n  return result === \"No content.\" ? \"\" : result\n}\n\nexport function computeReleaseNotes(currentVersion: semver.SemVer, isFullChangelog: boolean, feed: XElement, latestRelease: XElement): string | Array<ReleaseNoteInfo> | null {\n  if (!isFullChangelog) {\n    return getNoteValue(latestRelease)\n  }\n\n  const releaseVersionRegExp = /\\/tag\\/v?([^/]+)$/\n\n  let latestVersion: string | undefined = undefined\n  try {\n    latestVersion = releaseVersionRegExp.exec(latestRelease.element(\"link\").attribute(\"href\"))![1]\n    latestVersion = semver.valid(latestVersion) ? latestVersion : undefined\n  } catch {\n    // If we cannot parse the latest release version, return null â€” notes cannot be determined\n  }\n\n  if (latestVersion == null) {\n    return null\n  }\n\n  const releaseNotes: Array<ReleaseNoteInfo> = []\n  for (const release of feed.getElements(\"entry\")) {\n    let versionRelease: string\n    try {\n      const match = releaseVersionRegExp.exec(release.element(\"link\").attribute(\"href\"))\n      if (!match) {\n        continue\n      }\n      versionRelease = match[1]\n    } catch {\n      continue\n    }\n    // skip non-semver tags (e.g. doc/website releases in monorepos)\n    if (!semver.valid(versionRelease)) {\n      continue\n    }\n\n    const isGreaterThanCurrent = semver.gt(versionRelease, currentVersion.raw)\n    const isLessOrEqualThanLatest = semver.lte(versionRelease, latestVersion)\n    if (isGreaterThanCurrent && isLessOrEqualThanLatest) {\n      releaseNotes.push({\n        version: versionRelease,\n        note: getNoteValue(release),\n      })\n    }\n  }\n  return releaseNotes.sort((a, b) => semver.rcompare(a.version, b.version))\n}\n"]}"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.GitLabProvider = void 0;
const builder_util_runtime_1 = require("builder-util-runtime");
const url_1 = require("url");
// @ts-ignore
const escapeRegExp = require("lodash.escaperegexp");
const util_1 = require("../util");
const Provider_1 = require("./Provider");
class GitLabProvider extends Provider_1.Provider {
    /**
     * Normalizes filenames by replacing spaces and underscores with dashes.
     *
     * This is a workaround to handle filename formatting differences between tools:
     * - electron-builder formats filenames like "test file.txt" as "test-file.txt"
     * - GitLab may provide asset URLs using underscores, such as "test_file.txt"
     *
     * Because of this mismatch, we can't reliably extract the correct filename from
     * the asset path without normalization. This function ensures consistent matching
     * across different filename formats by converting all spaces and underscores to dashes.
     *
     * @param filename The filename to normalize
     * @returns The normalized filename with spaces and underscores replaced by dashes
     */
    normalizeFilename(filename) {
        return filename.replace(/ |_/g, "-");
    }
    constructor(options, updater, runtimeOptions) {
        super({
            ...runtimeOptions,
            // GitLab might not support multiple range requests efficiently
            isUseMultipleRangeRequest: false,
        });
        this.options = options;
        this.updater = updater;
        // Cache the latest version info to avoid unnecessary HTTP requests
        this.cachedLatestVersion = null;
        const defaultHost = "gitlab.com";
        const host = options.host || defaultHost;
        this.baseApiUrl = (0, util_1.newBaseUrl)(`https://${host}/api/v4`);
    }
    createRequestOptions(url, headers) {
        const result = super.createRequestOptions(url, headers);
        result.redirect = "manual";
        return result;
    }
    get channel() {
        const result = this.updater.channel || this.options.channel;
        return result == null ? this.getDefaultChannelName() : this.getCustomChannelName(result);
    }
    async getLatestVersion() {
        const cancellationToken = new builder_util_runtime_1.CancellationToken();
        // Get latest release from GitLab API using the permalink/latest endpoint
        const latestReleaseUrl = (0, util_1.newUrlFromBase)(`projects/${this.options.projectId}/releases/permalink/latest`, this.baseApiUrl);
        const header = { Accept: "application/json", ...this.setAuthHeaderForToken(this.options.token || null) };
        let releaseResponse;
        try {
            releaseResponse = await this.httpRequest(latestReleaseUrl, header, cancellationToken);
        }
        catch (e) {
            throw (0, builder_util_runtime_1.newError)(`Unable to find latest release on GitLab (${latestReleaseUrl}): ${e.stack || e.message}`, "ERR_UPDATER_LATEST_VERSION_NOT_FOUND");
        }
        if (!releaseResponse) {
            throw (0, builder_util_runtime_1.newError)("No published releases on GitLab", "ERR_UPDATER_NO_PUBLISHED_VERSIONS");
        }
        let latestRelease;
        try {
            latestRelease = JSON.parse(releaseResponse);
        }
        catch (e) {
            throw (0, builder_util_runtime_1.newError)(`Unable to parse latest release response from GitLab (${latestReleaseUrl}): response was not valid JSON: ${e.stack || e.message}`, "ERR_UPDATER_LATEST_VERSION_NOT_FOUND");
        }
        if (latestRelease.upcoming_release) {
            throw (0, builder_util_runtime_1.newError)("Latest GitLab release is scheduled but not yet published", "ERR_UPDATER_LATEST_VERSION_NOT_FOUND");
        }
        const tag = latestRelease.tag_name;
        // Look for channel file in release assets
        let rawData = null;
        let channelFile = "";
        let channelFileUrl = null;
        const fetchChannelData = async (channelName) => {
            channelFile = (0, util_1.getChannelFilename)(channelName);
            // Find the channel file in GitLab release assets
            const channelAsset = latestRelease.assets.links.find(asset => asset.name === channelFile);
            if (!channelAsset) {
                throw (0, builder_util_runtime_1.newError)(`Cannot find ${channelFile} in the latest release assets`, "ERR_UPDATER_CHANNEL_FILE_NOT_FOUND");
            }
            channelFileUrl = new url_1.URL(channelAsset.direct_asset_url);
            const authHeaders = this.setAuthHeaderForToken(this.options.token || null);
            const headers = Object.keys(authHeaders).length ? authHeaders : undefined;
            try {
                const result = await this.httpRequest(channelFileUrl, headers, cancellationToken);
                if (!result) {
                    throw (0, builder_util_runtime_1.newError)(`Empty response from ${channelFileUrl}`, "ERR_UPDATER_CHANNEL_FILE_NOT_FOUND");
                }
                return result;
            }
            catch (e) {
                if (e instanceof builder_util_runtime_1.HttpError && e.statusCode === 404) {
                    throw (0, builder_util_runtime_1.newError)(`Cannot find ${channelFile} in the latest release artifacts (${channelFileUrl}): ${e.stack || e.message}`, "ERR_UPDATER_CHANNEL_FILE_NOT_FOUND");
                }
                throw e;
            }
        };
        try {
            rawData = await fetchChannelData(this.channel);
        }
        catch (e) {
            // If custom channel fails, try default channel as fallback
            if (this.channel !== this.getDefaultChannelName()) {
                rawData = await fetchChannelData(this.getDefaultChannelName());
            }
            else {
                throw e;
            }
        }
        if (!rawData) {
            throw (0, builder_util_runtime_1.newError)(`Unable to parse channel data from ${channelFile}`, "ERR_UPDATER_INVALID_UPDATE_INFO");
        }
        const result = (0, Provider_1.parseUpdateInfo)(rawData, channelFile, channelFileUrl);
        // Set release name from GitLab if not present
        if (result.releaseName == null) {
            result.releaseName = latestRelease.name;
        }
        // Set release notes from GitLab description if not present
        if (result.releaseNotes == null) {
            result.releaseNotes = latestRelease.description || null;
        }
        const gitlabUpdateInfo = {
            tag: tag,
            assets: this.convertAssetsToMap(latestRelease.assets),
            ...result,
        };
        // Cache the latest version info
        this.cachedLatestVersion = gitlabUpdateInfo;
        return gitlabUpdateInfo;
    }
    /**
     * Utility function to convert GitlabReleaseAsset to Map<string, string>
     * Maps asset names to their download URLs
     */
    convertAssetsToMap(assets) {
        const assetsMap = new Map();
        for (const asset of assets.links) {
            assetsMap.set(this.normalizeFilename(asset.name), asset.direct_asset_url);
        }
        return assetsMap;
    }
    /**
     * Find blockmap file URL in assets map for a specific filename
     */
    findBlockMapInAssets(assets, filename) {
        const possibleBlockMapNames = [`${filename}.blockmap`, `${this.normalizeFilename(filename)}.blockmap`];
        for (const blockMapName of possibleBlockMapNames) {
            const assetUrl = assets.get(blockMapName);
            if (assetUrl) {
                return new url_1.URL(assetUrl);
            }
        }
        return null;
    }
    async fetchReleaseInfoByVersion(version) {
        const cancellationToken = new builder_util_runtime_1.CancellationToken();
        // Try v-prefixed version first, then fallback to plain version
        const possibleReleaseIds = [`v${version}`, version];
        for (const releaseId of possibleReleaseIds) {
            const releaseUrl = (0, util_1.newUrlFromBase)(`projects/${this.options.projectId}/releases/${encodeURIComponent(releaseId)}`, this.baseApiUrl);
            try {
                const header = { Accept: "application/json", ...this.setAuthHeaderForToken(this.options.token || null) };
                const releaseResponse = await this.httpRequest(releaseUrl, header, cancellationToken);
                if (releaseResponse) {
                    const release = JSON.parse(releaseResponse);
                    return release;
                }
            }
            catch (e) {
                // If it's a 404 error, try the next release ID format
                if (e instanceof builder_util_runtime_1.HttpError && e.statusCode === 404) {
                    continue;
                }
                // For other errors, throw immediately
                throw (0, builder_util_runtime_1.newError)(`Unable to find release ${releaseId} on GitLab (${releaseUrl}): ${e.stack || e.message}`, "ERR_UPDATER_RELEASE_NOT_FOUND");
            }
        }
        // If we get here, none of the release ID formats worked
        throw (0, builder_util_runtime_1.newError)(`Unable to find release with version ${version} (tried: ${possibleReleaseIds.join(", ")}) on GitLab`, "ERR_UPDATER_RELEASE_NOT_FOUND");
    }
    setAuthHeaderForToken(token) {
        const headers = {};
        if (token != null) {
            // If the token starts with "Bearer", it is an OAuth application secret
            // Note that the original gitlab token would not start with "Bearer"
            // it might start with "gloas-", if so user needs to add "Bearer " prefix to the token
            if (token.startsWith("Bearer")) {
                headers.authorization = token;
            }
            else {
                headers["PRIVATE-TOKEN"] = token;
            }
        }
        return headers;
    }
    /**
     * Get version info for blockmap files, using cache when possible
     */
    async getVersionInfoForBlockMap(version) {
        // Check if we can use cached version info
        if (this.cachedLatestVersion && this.cachedLatestVersion.version === version) {
            return this.cachedLatestVersion.assets;
        }
        // Fetch version info if not cached or version doesn't match
        const versionInfo = await this.fetchReleaseInfoByVersion(version);
        if (versionInfo && versionInfo.assets) {
            return this.convertAssetsToMap(versionInfo.assets);
        }
        return null;
    }
    /**
     * Find blockmap URLs from version assets
     */
    async findBlockMapUrlsFromAssets(oldVersion, newVersion, baseFilename) {
        let newBlockMapUrl = null;
        let oldBlockMapUrl = null;
        // Get new version assets
        const newVersionAssets = await this.getVersionInfoForBlockMap(newVersion);
        if (newVersionAssets) {
            newBlockMapUrl = this.findBlockMapInAssets(newVersionAssets, baseFilename);
        }
        // Get old version assets
        const oldVersionAssets = await this.getVersionInfoForBlockMap(oldVersion);
        if (oldVersionAssets) {
            const oldFilename = baseFilename.replace(new RegExp(escapeRegExp(newVersion), "g"), oldVersion);
            oldBlockMapUrl = this.findBlockMapInAssets(oldVersionAssets, oldFilename);
        }
        return [oldBlockMapUrl, newBlockMapUrl];
    }
    async getBlockMapFiles(baseUrl, oldVersion, newVersion, oldBlockMapFileBaseUrl = null) {
        // If is `project_upload`, find blockmap files from corresponding gitLab assets
        // Because each asset has an unique path that includes an identified hash code,
        // e.g. https://gitlab.com/-/project/71361100/uploads/051f27a925eaf679f2ad688105362acc/latest.yml
        if (this.options.uploadTarget === "project_upload") {
            // Get the base filename from the URL to find corresponding blockmap files
            const baseFilename = baseUrl.pathname.split("/").pop() || "";
            // Try to find blockmap files in GitLab assets
            const [oldBlockMapUrl, newBlockMapUrl] = await this.findBlockMapUrlsFromAssets(oldVersion, newVersion, baseFilename);
            if (!newBlockMapUrl) {
                throw (0, builder_util_runtime_1.newError)(`Cannot find blockmap file for ${newVersion} in GitLab assets`, "ERR_UPDATER_BLOCKMAP_FILE_NOT_FOUND");
            }
            if (!oldBlockMapUrl) {
                throw (0, builder_util_runtime_1.newError)(`Cannot find blockmap file for ${oldVersion} in GitLab assets`, "ERR_UPDATER_BLOCKMAP_FILE_NOT_FOUND");
            }
            return [oldBlockMapUrl, newBlockMapUrl];
        }
        else {
            return super.getBlockMapFiles(baseUrl, oldVersion, newVersion, oldBlockMapFileBaseUrl);
        }
    }
    resolveFiles(updateInfo) {
        return (0, Provider_1.getFileList)(updateInfo).map((fileInfo) => {
            // Try both original and normalized filename formats
            const possibleNames = [
                fileInfo.url, // Original filename
                this.normalizeFilename(fileInfo.url), // Normalized filename (spaces/underscores â†’ dashes)
            ];
            const matchingAssetName = possibleNames.find(name => updateInfo.assets.has(name));
            const assetUrl = matchingAssetName ? updateInfo.assets.get(matchingAssetName) : undefined;
            if (!assetUrl) {
                throw (0, builder_util_runtime_1.newError)(`Cannot find asset "${fileInfo.url}" in GitLab release assets. Available assets: ${Array.from(updateInfo.assets.keys()).join(", ")}`, "ERR_UPDATER_ASSET_NOT_FOUND");
            }
            return {
                url: new url_1.URL(assetUrl),
                info: fileInfo,
            };
        });
    }
    toString() {
        return `GitLab (projectId: ${this.options.projectId}, channel: ${this.channel})`;
    }
}
exports.GitLabProvider = GitLabProvider;
//# sourceMappingURL=GitLabProvider.js.map{"version":3,"file":"GitLabProvider.js","sourceRoot":"","sources":["../../src/providers/GitLabProvider.ts"],"names":[],"mappings":";;;AAAA,+DAA+J;AAE/J,6BAAyB;AACzB,aAAa;AACb,oDAAmD;AAGnD,kCAAwE;AACxE,yCAA2F;AAO3F,MAAa,cAAe,SAAQ,mBAA0B;IAK5D;;;;;;;;;;;;;OAaG;IACK,iBAAiB,CAAC,QAAgB;QACxC,OAAO,QAAQ,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACtC,CAAC;IAED,YACmB,OAAsB,EACtB,OAAmB,EACpC,cAAsC;QAEtC,KAAK,CAAC;YACJ,GAAG,cAAc;YACjB,+DAA+D;YAC/D,yBAAyB,EAAE,KAAK;SACjC,CAAC,CAAA;QARe,YAAO,GAAP,OAAO,CAAe;QACtB,YAAO,GAAP,OAAO,CAAY;QAvBtC,mEAAmE;QAC3D,wBAAmB,GAA4B,IAAI,CAAA;QA+BzD,MAAM,WAAW,GAAG,YAAY,CAAA;QAChC,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,IAAI,WAAW,CAAA;QAExC,IAAI,CAAC,UAAU,GAAG,IAAA,iBAAU,EAAC,WAAW,IAAI,SAAS,CAAC,CAAA;IACxD,CAAC;IAES,oBAAoB,CAAC,GAAQ,EAAE,OAAoC;QAC3E,MAAM,MAAM,GAAG,KAAK,CAAC,oBAAoB,CAAC,GAAG,EAAE,OAAO,CAAC,CACtD;QAAC,MAAc,CAAC,QAAQ,GAAG,QAAQ,CAAA;QACpC,OAAO,MAAM,CAAA;IACf,CAAC;IAED,IAAY,OAAO;QACjB,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,IAAI,IAAI,CAAC,OAAO,CAAC,OAAO,CAAA;QAC3D,OAAO,MAAM,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,qBAAqB,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAA;IAC1F,CAAC;IAED,KAAK,CAAC,gBAAgB;QACpB,MAAM,iBAAiB,GAAG,IAAI,wCAAiB,EAAE,CAAA;QAEjD,yEAAyE;QACzE,MAAM,gBAAgB,GAAG,IAAA,qBAAc,EAAC,YAAY,IAAI,CAAC,OAAO,CAAC,SAAS,4BAA4B,EAAE,IAAI,CAAC,UAAU,CAAC,CAAA;QAExH,MAAM,MAAM,GAAG,EAAE,MAAM,EAAE,kBAAkB,EAAE,GAAG,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,IAAI,IAAI,CAAC,EAAE,CAAA;QACxG,IAAI,eAA8B,CAAA;QAClC,IAAI,CAAC;YACH,eAAe,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,gBAAgB,EAAE,MAAM,EAAE,iBAAiB,CAAC,CAAA;QACvF,CAAC;QAAC,OAAO,CAAM,EAAE,CAAC;YAChB,MAAM,IAAA,+BAAQ,EAAC,4CAA4C,gBAAgB,MAAM,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,sCAAsC,CAAC,CAAA;QAClJ,CAAC;QAED,IAAI,CAAC,eAAe,EAAE,CAAC;YACrB,MAAM,IAAA,+BAAQ,EAAC,iCAAiC,EAAE,mCAAmC,CAAC,CAAA;QACxF,CAAC;QAED,IAAI,aAAgC,CAAA;QACpC,IAAI,CAAC;YACH,aAAa,GAAG,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,CAAA;QAC7C,CAAC;QAAC,OAAO,CAAM,EAAE,CAAC;YAChB,MAAM,IAAA,+BAAQ,EACZ,wDAAwD,gBAAgB,mCAAmC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,OAAO,EAAE,EACjI,sCAAsC,CACvC,CAAA;QACH,CAAC;QAED,IAAI,aAAa,CAAC,gBAAgB,EAAE,CAAC;YACnC,MAAM,IAAA,+BAAQ,EAAC,0DAA0D,EAAE,sCAAsC,CAAC,CAAA;QACpH,CAAC;QAED,MAAM,GAAG,GAAG,aAAa,CAAC,QAAQ,CAAA;QAElC,0CAA0C;QAC1C,IAAI,OAAO,GAAkB,IAAI,CAAA;QACjC,IAAI,WAAW,GAAG,EAAE,CAAA;QACpB,IAAI,cAAc,GAAe,IAAI,CAAA;QAErC,MAAM,gBAAgB,GAAG,KAAK,EAAE,WAAmB,EAAmB,EAAE;YACtE,WAAW,GAAG,IAAA,yBAAkB,EAAC,WAAW,CAAC,CAAA;YAE7C,iDAAiD;YACjD,MAAM,YAAY,GAAG,aAAa,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,KAAK,WAAW,CAAC,CAAA;YAEzF,IAAI,CAAC,YAAY,EAAE,CAAC;gBAClB,MAAM,IAAA,+BAAQ,EAAC,eAAe,WAAW,+BAA+B,EAAE,oCAAoC,CAAC,CAAA;YACjH,CAAC;YAED,cAAc,GAAG,IAAI,SAAG,CAAC,YAAY,CAAC,gBAAgB,CAAC,CAAA;YACvD,MAAM,WAAW,GAAG,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,IAAI,IAAI,CAAC,CAAA;YAC1E,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,CAAA;YAEzE,IAAI,CAAC;gBACH,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,cAAc,EAAE,OAAO,EAAE,iBAAiB,CAAC,CAAA;gBACjF,IAAI,CAAC,MAAM,EAAE,CAAC;oBACZ,MAAM,IAAA,+BAAQ,EAAC,uBAAuB,cAAc,EAAE,EAAE,oCAAoC,CAAC,CAAA;gBAC/F,CAAC;gBACD,OAAO,MAAM,CAAA;YACf,CAAC;YAAC,OAAO,CAAM,EAAE,CAAC;gBAChB,IAAI,CAAC,YAAY,gCAAS,IAAI,CAAC,CAAC,UAAU,KAAK,GAAG,EAAE,CAAC;oBACnD,MAAM,IAAA,+BAAQ,EAAC,eAAe,WAAW,qCAAqC,cAAc,MAAM,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,oCAAoC,CAAC,CAAA;gBACjK,CAAC;gBACD,MAAM,CAAC,CAAA;YACT,CAAC;QACH,CAAC,CAAA;QAED,IAAI,CAAC;YACH,OAAO,GAAG,MAAM,gBAAgB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;QAChD,CAAC;QAAC,OAAO,CAAM,EAAE,CAAC;YAChB,2DAA2D;YAC3D,IAAI,IAAI,CAAC,OAAO,KAAK,IAAI,CAAC,qBAAqB,EAAE,EAAE,CAAC;gBAClD,OAAO,GAAG,MAAM,gBAAgB,CAAC,IAAI,CAAC,qBAAqB,EAAE,CAAC,CAAA;YAChE,CAAC;iBAAM,CAAC;gBACN,MAAM,CAAC,CAAA;YACT,CAAC;QACH,CAAC;QAED,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,MAAM,IAAA,+BAAQ,EAAC,qCAAqC,WAAW,EAAE,EAAE,iCAAiC,CAAC,CAAA;QACvG,CAAC;QAED,MAAM,MAAM,GAAG,IAAA,0BAAe,EAAC,OAAO,EAAE,WAAW,EAAE,cAAe,CAAC,CAAA;QAErE,8CAA8C;QAC9C,IAAI,MAAM,CAAC,WAAW,IAAI,IAAI,EAAE,CAAC;YAC/B,MAAM,CAAC,WAAW,GAAG,aAAa,CAAC,IAAI,CAAA;QACzC,CAAC;QAED,2DAA2D;QAC3D,IAAI,MAAM,CAAC,YAAY,IAAI,IAAI,EAAE,CAAC;YAChC,MAAM,CAAC,YAAY,GAAG,aAAa,CAAC,WAAW,IAAI,IAAI,CAAA;QACzD,CAAC;QAED,MAAM,gBAAgB,GAAG;YACvB,GAAG,EAAE,GAAG;YACR,MAAM,EAAE,IAAI,CAAC,kBAAkB,CAAC,aAAa,CAAC,MAAM,CAAC;YACrD,GAAG,MAAM;SACV,CAAA;QAED,gCAAgC;QAChC,IAAI,CAAC,mBAAmB,GAAG,gBAAgB,CAAA;QAE3C,OAAO,gBAAgB,CAAA;IACzB,CAAC;IAED;;;OAGG;IACK,kBAAkB,CAAC,MAA0B;QACnD,MAAM,SAAS,GAAG,IAAI,GAAG,EAAkB,CAAA;QAC3C,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;YACjC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,KAAK,CAAC,gBAAgB,CAAC,CAAA;QAC3E,CAAC;QACD,OAAO,SAAS,CAAA;IAClB,CAAC;IAED;;OAEG;IACK,oBAAoB,CAAC,MAA2B,EAAE,QAAgB;QACxE,MAAM,qBAAqB,GAAG,CAAC,GAAG,QAAQ,WAAW,EAAE,GAAG,IAAI,CAAC,iBAAiB,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAA;QAEtG,KAAK,MAAM,YAAY,IAAI,qBAAqB,EAAE,CAAC;YACjD,MAAM,QAAQ,GAAG,MAAM,CAAC,GAAG,CAAC,YAAY,CAAC,CAAA;YACzC,IAAI,QAAQ,EAAE,CAAC;gBACb,OAAO,IAAI,SAAG,CAAC,QAAQ,CAAC,CAAA;YAC1B,CAAC;QACH,CAAC;QACD,OAAO,IAAI,CAAA;IACb,CAAC;IAEO,KAAK,CAAC,yBAAyB,CAAC,OAAe;QACrD,MAAM,iBAAiB,GAAG,IAAI,wCAAiB,EAAE,CAAA;QAEjD,+DAA+D;QAC/D,MAAM,kBAAkB,GAAG,CAAC,IAAI,OAAO,EAAE,EAAE,OAAO,CAAC,CAAA;QAEnD,KAAK,MAAM,SAAS,IAAI,kBAAkB,EAAE,CAAC;YAC3C,MAAM,UAAU,GAAG,IAAA,qBAAc,EAAC,YAAY,IAAI,CAAC,OAAO,CAAC,SAAS,aAAa,kBAAkB,CAAC,SAAS,CAAC,EAAE,EAAE,IAAI,CAAC,UAAU,CAAC,CAAA;YAElI,IAAI,CAAC;gBACH,MAAM,MAAM,GAAG,EAAE,MAAM,EAAE,kBAAkB,EAAE,GAAG,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,IAAI,IAAI,CAAC,EAAE,CAAA;gBACxG,MAAM,eAAe,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,UAAU,EAAE,MAAM,EAAE,iBAAiB,CAAC,CAAA;gBAErF,IAAI,eAAe,EAAE,CAAC;oBACpB,MAAM,OAAO,GAAsB,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,CAAA;oBAC9D,OAAO,OAAO,CAAA;gBAChB,CAAC;YACH,CAAC;YAAC,OAAO,CAAM,EAAE,CAAC;gBAChB,sDAAsD;gBACtD,IAAI,CAAC,YAAY,gCAAS,IAAI,CAAC,CAAC,UAAU,KAAK,GAAG,EAAE,CAAC;oBACnD,SAAQ;gBACV,CAAC;gBACD,sCAAsC;gBACtC,MAAM,IAAA,+BAAQ,EAAC,0BAA0B,SAAS,eAAe,UAAU,MAAM,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,+BAA+B,CAAC,CAAA;YAC3I,CAAC;QACH,CAAC;QAED,wDAAwD;QACxD,MAAM,IAAA,+BAAQ,EAAC,uCAAuC,OAAO,YAAY,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,+BAA+B,CAAC,CAAA;IACvJ,CAAC;IAEO,qBAAqB,CAAC,KAAoB;QAChD,MAAM,OAAO,GAA8B,EAAE,CAAA;QAE7C,IAAI,KAAK,IAAI,IAAI,EAAE,CAAC;YAClB,uEAAuE;YACvE,oEAAoE;YACpE,sFAAsF;YACtF,IAAI,KAAK,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;gBAC/B,OAAO,CAAC,aAAa,GAAG,KAAK,CAAA;YAC/B,CAAC;iBAAM,CAAC;gBACN,OAAO,CAAC,eAAe,CAAC,GAAG,KAAK,CAAA;YAClC,CAAC;QACH,CAAC;QAED,OAAO,OAAO,CAAA;IAChB,CAAC;IAED;;OAEG;IACK,KAAK,CAAC,yBAAyB,CAAC,OAAe;QACrD,0CAA0C;QAC1C,IAAI,IAAI,CAAC,mBAAmB,IAAI,IAAI,CAAC,mBAAmB,CAAC,OAAO,KAAK,OAAO,EAAE,CAAC;YAC7E,OAAO,IAAI,CAAC,mBAAmB,CAAC,MAAM,CAAA;QACxC,CAAC;QAED,4DAA4D;QAC5D,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,yBAAyB,CAAC,OAAO,CAAC,CAAA;QACjE,IAAI,WAAW,IAAI,WAAW,CAAC,MAAM,EAAE,CAAC;YACtC,OAAO,IAAI,CAAC,kBAAkB,CAAC,WAAW,CAAC,MAAM,CAAC,CAAA;QACpD,CAAC;QAED,OAAO,IAAI,CAAA;IACb,CAAC;IAED;;OAEG;IACK,KAAK,CAAC,0BAA0B,CAAC,UAAkB,EAAE,UAAkB,EAAE,YAAoB;QACnG,IAAI,cAAc,GAAe,IAAI,CAAA;QACrC,IAAI,cAAc,GAAe,IAAI,CAAA;QAErC,yBAAyB;QACzB,MAAM,gBAAgB,GAAG,MAAM,IAAI,CAAC,yBAAyB,CAAC,UAAU,CAAC,CAAA;QACzE,IAAI,gBAAgB,EAAE,CAAC;YACrB,cAAc,GAAG,IAAI,CAAC,oBAAoB,CAAC,gBAAgB,EAAE,YAAY,CAAC,CAAA;QAC5E,CAAC;QAED,yBAAyB;QACzB,MAAM,gBAAgB,GAAG,MAAM,IAAI,CAAC,yBAAyB,CAAC,UAAU,CAAC,CAAA;QACzE,IAAI,gBAAgB,EAAE,CAAC;YACrB,MAAM,WAAW,GAAG,YAAY,CAAC,OAAO,CAAC,IAAI,MAAM,CAAC,YAAY,CAAC,UAAU,CAAC,EAAE,GAAG,CAAC,EAAE,UAAU,CAAC,CAAA;YAC/F,cAAc,GAAG,IAAI,CAAC,oBAAoB,CAAC,gBAAgB,EAAE,WAAW,CAAC,CAAA;QAC3E,CAAC;QAED,OAAO,CAAC,cAAc,EAAE,cAAc,CAAC,CAAA;IACzC,CAAC;IAED,KAAK,CAAC,gBAAgB,CAAC,OAAY,EAAE,UAAkB,EAAE,UAAkB,EAAE,yBAAwC,IAAI;QACvH,+EAA+E;QAC/E,+EAA+E;QAC/E,iGAAiG;QACjG,IAAI,IAAI,CAAC,OAAO,CAAC,YAAY,KAAK,gBAAgB,EAAE,CAAC;YACnD,0EAA0E;YAC1E,MAAM,YAAY,GAAG,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,CAAA;YAE5D,8CAA8C;YAC9C,MAAM,CAAC,cAAc,EAAE,cAAc,CAAC,GAAG,MAAM,IAAI,CAAC,0BAA0B,CAAC,UAAU,EAAE,UAAU,EAAE,YAAY,CAAC,CAAA;YAEpH,IAAI,CAAC,cAAc,EAAE,CAAC;gBACpB,MAAM,IAAA,+BAAQ,EAAC,iCAAiC,UAAU,mBAAmB,EAAE,qCAAqC,CAAC,CAAA;YACvH,CAAC;YAED,IAAI,CAAC,cAAc,EAAE,CAAC;gBACpB,MAAM,IAAA,+BAAQ,EAAC,iCAAiC,UAAU,mBAAmB,EAAE,qCAAqC,CAAC,CAAA;YACvH,CAAC;YAED,OAAO,CAAC,cAAc,EAAE,cAAc,CAAC,CAAA;QACzC,CAAC;aAAM,CAAC;YACN,OAAO,KAAK,CAAC,gBAAgB,CAAC,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,sBAAsB,CAAC,CAAA;QACxF,CAAC;IACH,CAAC;IAED,YAAY,CAAC,UAA4B;QACvC,OAAO,IAAA,sBAAW,EAAC,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,QAAwB,EAAE,EAAE;YAC9D,oDAAoD;YACpD,MAAM,aAAa,GAAG;gBACpB,QAAQ,CAAC,GAAG,EAAE,oBAAoB;gBAClC,IAAI,CAAC,iBAAiB,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,oDAAoD;aAC3F,CAAA;YAED,MAAM,iBAAiB,GAAG,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAA;YACjF,MAAM,QAAQ,GAAG,iBAAiB,CAAC,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;YAEzF,IAAI,CAAC,QAAQ,EAAE,CAAC;gBACd,MAAM,IAAA,+BAAQ,EACZ,sBAAsB,QAAQ,CAAC,GAAG,iDAAiD,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,EACpI,6BAA6B,CAC9B,CAAA;YACH,CAAC;YAED,OAAO;gBACL,GAAG,EAAE,IAAI,SAAG,CAAC,QAAQ,CAAC;gBACtB,IAAI,EAAE,QAAQ;aACf,CAAA;QACH,CAAC,CAAC,CAAA;IACJ,CAAC;IAED,QAAQ;QACN,OAAO,sBAAsB,IAAI,CAAC,OAAO,CAAC,SAAS,cAAc,IAAI,CAAC,OAAO,GAAG,CAAA;IAClF,CAAC;CACF;AAtUD,wCAsUC","sourcesContent":["import { CancellationToken, GitlabOptions, HttpError, newError, UpdateFileInfo, UpdateInfo, GitlabReleaseInfo, GitlabReleaseAsset } from \"builder-util-runtime\"\nimport { OutgoingHttpHeaders, RequestOptions } from \"http\"\nimport { URL } from \"url\"\n// @ts-ignore\nimport * as escapeRegExp from \"lodash.escaperegexp\"\nimport { AppUpdater } from \"../AppUpdater\"\nimport { ResolvedUpdateFileInfo } from \"../types\"\nimport { getChannelFilename, newBaseUrl, newUrlFromBase } from \"../util\"\nimport { getFileList, parseUpdateInfo, Provider, ProviderRuntimeOptions } from \"./Provider\"\n\ninterface GitlabUpdateInfo extends UpdateInfo {\n  tag: string\n  assets: Map<string, string> // filename -> download URL mapping\n}\n\nexport class GitLabProvider extends Provider<GitlabUpdateInfo> {\n  private readonly baseApiUrl: URL\n  // Cache the latest version info to avoid unnecessary HTTP requests\n  private cachedLatestVersion: GitlabUpdateInfo | null = null\n\n  /**\n   * Normalizes filenames by replacing spaces and underscores with dashes.\n   *\n   * This is a workaround to handle filename formatting differences between tools:\n   * - electron-builder formats filenames like \"test file.txt\" as \"test-file.txt\"\n   * - GitLab may provide asset URLs using underscores, such as \"test_file.txt\"\n   *\n   * Because of this mismatch, we can't reliably extract the correct filename from\n   * the asset path without normalization. This function ensures consistent matching\n   * across different filename formats by converting all spaces and underscores to dashes.\n   *\n   * @param filename The filename to normalize\n   * @returns The normalized filename with spaces and underscores replaced by dashes\n   */\n  private normalizeFilename(filename: string): string {\n    return filename.replace(/ |_/g, \"-\")\n  }\n\n  constructor(\n    private readonly options: GitlabOptions,\n    private readonly updater: AppUpdater,\n    runtimeOptions: ProviderRuntimeOptions\n  ) {\n    super({\n      ...runtimeOptions,\n      // GitLab might not support multiple range requests efficiently\n      isUseMultipleRangeRequest: false,\n    })\n\n    const defaultHost = \"gitlab.com\"\n    const host = options.host || defaultHost\n\n    this.baseApiUrl = newBaseUrl(`https://${host}/api/v4`)\n  }\n\n  protected createRequestOptions(url: URL, headers?: OutgoingHttpHeaders | null): RequestOptions {\n    const result = super.createRequestOptions(url, headers)\n    ;(result as any).redirect = \"manual\"\n    return result\n  }\n\n  private get channel(): string {\n    const result = this.updater.channel || this.options.channel\n    return result == null ? this.getDefaultChannelName() : this.getCustomChannelName(result)\n  }\n\n  async getLatestVersion(): Promise<GitlabUpdateInfo> {\n    const cancellationToken = new CancellationToken()\n\n    // Get latest release from GitLab API using the permalink/latest endpoint\n    const latestReleaseUrl = newUrlFromBase(`projects/${this.options.projectId}/releases/permalink/latest`, this.baseApiUrl)\n\n    const header = { Accept: \"application/json\", ...this.setAuthHeaderForToken(this.options.token || null) }\n    let releaseResponse: string | null\n    try {\n      releaseResponse = await this.httpRequest(latestReleaseUrl, header, cancellationToken)\n    } catch (e: any) {\n      throw newError(`Unable to find latest release on GitLab (${latestReleaseUrl}): ${e.stack || e.message}`, \"ERR_UPDATER_LATEST_VERSION_NOT_FOUND\")\n    }\n\n    if (!releaseResponse) {\n      throw newError(\"No published releases on GitLab\", \"ERR_UPDATER_NO_PUBLISHED_VERSIONS\")\n    }\n\n    let latestRelease: GitlabReleaseInfo\n    try {\n      latestRelease = JSON.parse(releaseResponse)\n    } catch (e: any) {\n      throw newError(\n        `Unable to parse latest release response from GitLab (${latestReleaseUrl}): response was not valid JSON: ${e.stack || e.message}`,\n        \"ERR_UPDATER_LATEST_VERSION_NOT_FOUND\"\n      )\n    }\n\n    if (latestRelease.upcoming_release) {\n      throw newError(\"Latest GitLab release is scheduled but not yet published\", \"ERR_UPDATER_LATEST_VERSION_NOT_FOUND\")\n    }\n\n    const tag = latestRelease.tag_name\n\n    // Look for channel file in release assets\n    let rawData: string | null = null\n    let channelFile = \"\"\n    let channelFileUrl: URL | null = null\n\n    const fetchChannelData = async (channelName: string): Promise<string> => {\n      channelFile = getChannelFilename(channelName)\n\n      // Find the channel file in GitLab release assets\n      const channelAsset = latestRelease.assets.links.find(asset => asset.name === channelFile)\n\n      if (!channelAsset) {\n        throw newError(`Cannot find ${channelFile} in the latest release assets`, \"ERR_UPDATER_CHANNEL_FILE_NOT_FOUND\")\n      }\n\n      channelFileUrl = new URL(channelAsset.direct_asset_url)\n      const authHeaders = this.setAuthHeaderForToken(this.options.token || null)\n      const headers = Object.keys(authHeaders).length ? authHeaders : undefined\n\n      try {\n        const result = await this.httpRequest(channelFileUrl, headers, cancellationToken)\n        if (!result) {\n          throw newError(`Empty response from ${channelFileUrl}`, \"ERR_UPDATER_CHANNEL_FILE_NOT_FOUND\")\n        }\n        return result\n      } catch (e: any) {\n        if (e instanceof HttpError && e.statusCode === 404) {\n          throw newError(`Cannot find ${channelFile} in the latest release artifacts (${channelFileUrl}): ${e.stack || e.message}`, \"ERR_UPDATER_CHANNEL_FILE_NOT_FOUND\")\n        }\n        throw e\n      }\n    }\n\n    try {\n      rawData = await fetchChannelData(this.channel)\n    } catch (e: any) {\n      // If custom channel fails, try default channel as fallback\n      if (this.channel !== this.getDefaultChannelName()) {\n        rawData = await fetchChannelData(this.getDefaultChannelName())\n      } else {\n        throw e\n      }\n    }\n\n    if (!rawData) {\n      throw newError(`Unable to parse channel data from ${channelFile}`, \"ERR_UPDATER_INVALID_UPDATE_INFO\")\n    }\n\n    const result = parseUpdateInfo(rawData, channelFile, channelFileUrl!)\n\n    // Set release name from GitLab if not present\n    if (result.releaseName == null) {\n      result.releaseName = latestRelease.name\n    }\n\n    // Set release notes from GitLab description if not present\n    if (result.releaseNotes == null) {\n      result.releaseNotes = latestRelease.description || null\n    }\n\n    const gitlabUpdateInfo = {\n      tag: tag,\n      assets: this.convertAssetsToMap(latestRelease.assets),\n      ...result,\n    }\n\n    // Cache the latest version info\n    this.cachedLatestVersion = gitlabUpdateInfo\n\n    return gitlabUpdateInfo\n  }\n\n  /**\n   * Utility function to convert GitlabReleaseAsset to Map<string, string>\n   * Maps asset names to their download URLs\n   */\n  private convertAssetsToMap(assets: GitlabReleaseAsset): Map<string, string> {\n    const assetsMap = new Map<string, string>()\n    for (const asset of assets.links) {\n      assetsMap.set(this.normalizeFilename(asset.name), asset.direct_asset_url)\n    }\n    return assetsMap\n  }\n\n  /**\n   * Find blockmap file URL in assets map for a specific filename\n   */\n  private findBlockMapInAssets(assets: Map<string, string>, filename: string): URL | null {\n    const possibleBlockMapNames = [`${filename}.blockmap`, `${this.normalizeFilename(filename)}.blockmap`]\n\n    for (const blockMapName of possibleBlockMapNames) {\n      const assetUrl = assets.get(blockMapName)\n      if (assetUrl) {\n        return new URL(assetUrl)\n      }\n    }\n    return null\n  }\n\n  private async fetchReleaseInfoByVersion(version: string): Promise<GitlabReleaseInfo | null> {\n    const cancellationToken = new CancellationToken()\n\n    // Try v-prefixed version first, then fallback to plain version\n    const possibleReleaseIds = [`v${version}`, version]\n\n    for (const releaseId of possibleReleaseIds) {\n      const releaseUrl = newUrlFromBase(`projects/${this.options.projectId}/releases/${encodeURIComponent(releaseId)}`, this.baseApiUrl)\n\n      try {\n        const header = { Accept: \"application/json\", ...this.setAuthHeaderForToken(this.options.token || null) }\n        const releaseResponse = await this.httpRequest(releaseUrl, header, cancellationToken)\n\n        if (releaseResponse) {\n          const release: GitlabReleaseInfo = JSON.parse(releaseResponse)\n          return release\n        }\n      } catch (e: any) {\n        // If it's a 404 error, try the next release ID format\n        if (e instanceof HttpError && e.statusCode === 404) {\n          continue\n        }\n        // For other errors, throw immediately\n        throw newError(`Unable to find release ${releaseId} on GitLab (${releaseUrl}): ${e.stack || e.message}`, \"ERR_UPDATER_RELEASE_NOT_FOUND\")\n      }\n    }\n\n    // If we get here, none of the release ID formats worked\n    throw newError(`Unable to find release with version ${version} (tried: ${possibleReleaseIds.join(\", \")}) on GitLab`, \"ERR_UPDATER_RELEASE_NOT_FOUND\")\n  }\n\n  private setAuthHeaderForToken(token: string | null): { [key: string]: string } {\n    const headers: { [key: string]: string } = {}\n\n    if (token != null) {\n      // If the token starts with \"Bearer\", it is an OAuth application secret\n      // Note that the original gitlab token would not start with \"Bearer\"\n      // it might start with \"gloas-\", if so user needs to add \"Bearer \" prefix to the token\n      if (token.startsWith(\"Bearer\")) {\n        headers.authorization = token\n      } else {\n        headers[\"PRIVATE-TOKEN\"] = token\n      }\n    }\n\n    return headers\n  }\n\n  /**\n   * Get version info for blockmap files, using cache when possible\n   */\n  private async getVersionInfoForBlockMap(version: string): Promise<Map<string, string> | null> {\n    // Check if we can use cached version info\n    if (this.cachedLatestVersion && this.cachedLatestVersion.version === version) {\n      return this.cachedLatestVersion.assets\n    }\n\n    // Fetch version info if not cached or version doesn't match\n    const versionInfo = await this.fetchReleaseInfoByVersion(version)\n    if (versionInfo && versionInfo.assets) {\n      return this.convertAssetsToMap(versionInfo.assets)\n    }\n\n    return null\n  }\n\n  /**\n   * Find blockmap URLs from version assets\n   */\n  private async findBlockMapUrlsFromAssets(oldVersion: string, newVersion: string, baseFilename: string): Promise<[URL | null, URL | null]> {\n    let newBlockMapUrl: URL | null = null\n    let oldBlockMapUrl: URL | null = null\n\n    // Get new version assets\n    const newVersionAssets = await this.getVersionInfoForBlockMap(newVersion)\n    if (newVersionAssets) {\n      newBlockMapUrl = this.findBlockMapInAssets(newVersionAssets, baseFilename)\n    }\n\n    // Get old version assets\n    const oldVersionAssets = await this.getVersionInfoForBlockMap(oldVersion)\n    if (oldVersionAssets) {\n      const oldFilename = baseFilename.replace(new RegExp(escapeRegExp(newVersion), \"g\"), oldVersion)\n      oldBlockMapUrl = this.findBlockMapInAssets(oldVersionAssets, oldFilename)\n    }\n\n    return [oldBlockMapUrl, newBlockMapUrl]\n  }\n\n  async getBlockMapFiles(baseUrl: URL, oldVersion: string, newVersion: string, oldBlockMapFileBaseUrl: string | null = null): Promise<URL[]> {\n    // If is `project_upload`, find blockmap files from corresponding gitLab assets\n    // Because each asset has an unique path that includes an identified hash code,\n    // e.g. https://gitlab.com/-/project/71361100/uploads/051f27a925eaf679f2ad688105362acc/latest.yml\n    if (this.options.uploadTarget === \"project_upload\") {\n      // Get the base filename from the URL to find corresponding blockmap files\n      const baseFilename = baseUrl.pathname.split(\"/\").pop() || \"\"\n\n      // Try to find blockmap files in GitLab assets\n      const [oldBlockMapUrl, newBlockMapUrl] = await this.findBlockMapUrlsFromAssets(oldVersion, newVersion, baseFilename)\n\n      if (!newBlockMapUrl) {\n        throw newError(`Cannot find blockmap file for ${newVersion} in GitLab assets`, \"ERR_UPDATER_BLOCKMAP_FILE_NOT_FOUND\")\n      }\n\n      if (!oldBlockMapUrl) {\n        throw newError(`Cannot find blockmap file for ${oldVersion} in GitLab assets`, \"ERR_UPDATER_BLOCKMAP_FILE_NOT_FOUND\")\n      }\n\n      return [oldBlockMapUrl, newBlockMapUrl]\n    } else {\n      return super.getBlockMapFiles(baseUrl, oldVersion, newVersion, oldBlockMapFileBaseUrl)\n    }\n  }\n\n  resolveFiles(updateInfo: GitlabUpdateInfo): Array<ResolvedUpdateFileInfo> {\n    return getFileList(updateInfo).map((fileInfo: UpdateFileInfo) => {\n      // Try both original and normalized filename formats\n      const possibleNames = [\n        fileInfo.url, // Original filename\n        this.normalizeFilename(fileInfo.url), // Normalized filename (spaces/underscores â†’ dashes)\n      ]\n\n      const matchingAssetName = possibleNames.find(name => updateInfo.assets.has(name))\n      const assetUrl = matchingAssetName ? updateInfo.assets.get(matchingAssetName) : undefined\n\n      if (!assetUrl) {\n        throw newError(\n          `Cannot find asset \"${fileInfo.url}\" in GitLab release assets. Available assets: ${Array.from(updateInfo.assets.keys()).join(\", \")}`,\n          \"ERR_UPDATER_ASSET_NOT_FOUND\"\n        )\n      }\n\n      return {\n        url: new URL(assetUrl),\n        info: fileInfo,\n      }\n    })\n  }\n\n  toString(): string {\n    return `GitLab (projectId: ${this.options.projectId}, channel: ${this.channel})`\n  }\n}\n"]}"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.KeygenProvider = void 0;
const builder_util_runtime_1 = require("builder-util-runtime");
const util_1 = require("../util");
const Provider_1 = require("./Provider");
class KeygenProvider extends Provider_1.Provider {
    constructor(configuration, updater, runtimeOptions) {
        super({
            ...runtimeOptions,
            isUseMultipleRangeRequest: false,
        });
        this.configuration = configuration;
        this.updater = updater;
        this.defaultHostname = "api.keygen.sh";
        const host = this.configuration.host || this.defaultHostname;
        this.baseUrl = (0, util_1.newBaseUrl)(`https://${host}/v1/accounts/${this.configuration.account}/artifacts?product=${this.configuration.product}`);
    }
    get channel() {
        return this.updater.channel || this.configuration.channel || "stable";
    }
    async getLatestVersion() {
        const cancellationToken = new builder_util_runtime_1.CancellationToken();
        const channelFile = (0, util_1.getChannelFilename)(this.getCustomChannelName(this.channel));
        const channelUrl = (0, util_1.newUrlFromBase)(channelFile, this.baseUrl, this.updater.isAddNoCacheQuery);
        try {
            const updateInfo = await this.httpRequest(channelUrl, {
                Accept: "application/vnd.api+json",
                "Keygen-Version": "1.1",
            }, cancellationToken);
            return (0, Provider_1.parseUpdateInfo)(updateInfo, channelFile, channelUrl);
        }
        catch (e) {
            throw (0, builder_util_runtime_1.newError)(`Unable to find latest version on ${this.toString()}, please ensure release exists: ${e.stack || e.message}`, "ERR_UPDATER_LATEST_VERSION_NOT_FOUND");
        }
    }
    resolveFiles(updateInfo) {
        return (0, Provider_1.resolveFiles)(updateInfo, this.baseUrl);
    }
    toString() {
        const { account, product, platform } = this.configuration;
        return `Keygen (account: ${account}, product: ${product}, platform: ${platform}, channel: ${this.channel})`;
    }
}
exports.KeygenProvider = KeygenProvider;
//# sourceMappingURL=KeygenProvider.js.map{"version":3,"file":"KeygenProvider.js","sourceRoot":"","sources":["../../src/providers/KeygenProvider.ts"],"names":[],"mappings":";;;AAAA,+DAA6F;AAG7F,kCAAwE;AACxE,yCAA4F;AAE5F,MAAa,cAAe,SAAQ,mBAAoB;IAItD,YACmB,aAA4B,EAC5B,OAAmB,EACpC,cAAsC;QAEtC,KAAK,CAAC;YACJ,GAAG,cAAc;YACjB,yBAAyB,EAAE,KAAK;SACjC,CAAC,CAAA;QAPe,kBAAa,GAAb,aAAa,CAAe;QAC5B,YAAO,GAAP,OAAO,CAAY;QALrB,oBAAe,GAAG,eAAe,CAAA;QAYhD,MAAM,IAAI,GAAG,IAAI,CAAC,aAAa,CAAC,IAAI,IAAI,IAAI,CAAC,eAAe,CAAA;QAC5D,IAAI,CAAC,OAAO,GAAG,IAAA,iBAAU,EAAC,WAAW,IAAI,gBAAgB,IAAI,CAAC,aAAa,CAAC,OAAO,sBAAsB,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,CAAC,CAAA;IACxI,CAAC;IAED,IAAY,OAAO;QACjB,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,IAAI,IAAI,CAAC,aAAa,CAAC,OAAO,IAAI,QAAQ,CAAA;IACvE,CAAC;IAED,KAAK,CAAC,gBAAgB;QACpB,MAAM,iBAAiB,GAAG,IAAI,wCAAiB,EAAE,CAAA;QACjD,MAAM,WAAW,GAAG,IAAA,yBAAkB,EAAC,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAA;QAC/E,MAAM,UAAU,GAAG,IAAA,qBAAc,EAAC,WAAW,EAAE,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAA;QAC5F,IAAI,CAAC;YACH,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,WAAW,CACvC,UAAU,EACV;gBACE,MAAM,EAAE,0BAA0B;gBAClC,gBAAgB,EAAE,KAAK;aACxB,EACD,iBAAiB,CAClB,CAAA;YACD,OAAO,IAAA,0BAAe,EAAC,UAAU,EAAE,WAAW,EAAE,UAAU,CAAC,CAAA;QAC7D,CAAC;QAAC,OAAO,CAAM,EAAE,CAAC;YAChB,MAAM,IAAA,+BAAQ,EAAC,oCAAoC,IAAI,CAAC,QAAQ,EAAE,mCAAmC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,sCAAsC,CAAC,CAAA;QACtK,CAAC;IACH,CAAC;IAED,YAAY,CAAC,UAAsB;QACjC,OAAO,IAAA,uBAAY,EAAC,UAAU,EAAE,IAAI,CAAC,OAAO,CAAC,CAAA;IAC/C,CAAC;IAED,QAAQ;QACN,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC,aAAa,CAAA;QACzD,OAAO,oBAAoB,OAAO,cAAc,OAAO,eAAe,QAAQ,cAAc,IAAI,CAAC,OAAO,GAAG,CAAA;IAC7G,CAAC;CACF;AAhDD,wCAgDC","sourcesContent":["import { CancellationToken, KeygenOptions, newError, UpdateInfo } from \"builder-util-runtime\"\nimport { AppUpdater } from \"../AppUpdater\"\nimport { ResolvedUpdateFileInfo } from \"../types\"\nimport { getChannelFilename, newBaseUrl, newUrlFromBase } from \"../util\"\nimport { parseUpdateInfo, Provider, ProviderRuntimeOptions, resolveFiles } from \"./Provider\"\n\nexport class KeygenProvider extends Provider<UpdateInfo> {\n  private readonly defaultHostname = \"api.keygen.sh\"\n  private readonly baseUrl: URL\n\n  constructor(\n    private readonly configuration: KeygenOptions,\n    private readonly updater: AppUpdater,\n    runtimeOptions: ProviderRuntimeOptions\n  ) {\n    super({\n      ...runtimeOptions,\n      isUseMultipleRangeRequest: false,\n    })\n    const host = this.configuration.host || this.defaultHostname\n    this.baseUrl = newBaseUrl(`https://${host}/v1/accounts/${this.configuration.account}/artifacts?product=${this.configuration.product}`)\n  }\n\n  private get channel(): string {\n    return this.updater.channel || this.configuration.channel || \"stable\"\n  }\n\n  async getLatestVersion(): Promise<UpdateInfo> {\n    const cancellationToken = new CancellationToken()\n    const channelFile = getChannelFilename(this.getCustomChannelName(this.channel))\n    const channelUrl = newUrlFromBase(channelFile, this.baseUrl, this.updater.isAddNoCacheQuery)\n    try {\n      const updateInfo = await this.httpRequest(\n        channelUrl,\n        {\n          Accept: \"application/vnd.api+json\",\n          \"Keygen-Version\": \"1.1\",\n        },\n        cancellationToken\n      )\n      return parseUpdateInfo(updateInfo, channelFile, channelUrl)\n    } catch (e: any) {\n      throw newError(`Unable to find latest version on ${this.toString()}, please ensure release exists: ${e.stack || e.message}`, \"ERR_UPDATER_LATEST_VERSION_NOT_FOUND\")\n    }\n  }\n\n  resolveFiles(updateInfo: UpdateInfo): Array<ResolvedUpdateFileInfo> {\n    return resolveFiles(updateInfo, this.baseUrl)\n  }\n\n  toString() {\n    const { account, product, platform } = this.configuration\n    return `Keygen (account: ${account}, product: ${product}, platform: ${platform}, channel: ${this.channel})`\n  }\n}\n"]}"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.PrivateGitHubProvider = void 0;
const builder_util_runtime_1 = require("builder-util-runtime");
const js_yaml_1 = require("js-yaml");
const path = require("path");
const url_1 = require("url");
const util_1 = require("../util");
const GitHubProvider_1 = require("./GitHubProvider");
const Provider_1 = require("./Provider");
class PrivateGitHubProvider extends GitHubProvider_1.BaseGitHubProvider {
    constructor(options, updater, token, runtimeOptions) {
        super(options, "api.github.com", runtimeOptions);
        this.updater = updater;
        this.token = token;
    }
    createRequestOptions(url, headers) {
        const result = super.createRequestOptions(url, headers);
        result.redirect = "manual";
        return result;
    }
    async getLatestVersion() {
        const cancellationToken = new builder_util_runtime_1.CancellationToken();
        const channelFile = (0, util_1.getChannelFilename)(this.getDefaultChannelName());
        const releaseInfo = await this.getLatestVersionInfo(cancellationToken);
        const asset = releaseInfo.assets.find(it => it.name === channelFile);
        if (asset == null) {
            // html_url must be always, but just to be sure
            throw (0, builder_util_runtime_1.newError)(`Cannot find ${channelFile} in the release ${releaseInfo.html_url || releaseInfo.name}`, "ERR_UPDATER_CHANNEL_FILE_NOT_FOUND");
        }
        const url = new url_1.URL(asset.url);
        let result;
        try {
            result = (0, js_yaml_1.load)((await this.httpRequest(url, this.configureHeaders("application/octet-stream"), cancellationToken)));
        }
        catch (e) {
            if (e instanceof builder_util_runtime_1.HttpError && e.statusCode === 404) {
                throw (0, builder_util_runtime_1.newError)(`Cannot find ${channelFile} in the latest release artifacts (${url}): ${e.stack || e.message}`, "ERR_UPDATER_CHANNEL_FILE_NOT_FOUND");
            }
            throw e;
        }
        ;
        result.assets = releaseInfo.assets;
        return result;
    }
    get fileExtraDownloadHeaders() {
        return this.configureHeaders("application/octet-stream");
    }
    configureHeaders(accept) {
        return {
            accept,
            authorization: `token ${this.token}`,
        };
    }
    async getLatestVersionInfo(cancellationToken) {
        const allowPrerelease = this.updater.allowPrerelease;
        let basePath = this.basePath;
        if (!allowPrerelease) {
            basePath = `${basePath}/latest`;
        }
        const url = (0, util_1.newUrlFromBase)(basePath, this.baseUrl);
        try {
            const version = JSON.parse((await this.httpRequest(url, this.configureHeaders("application/vnd.github.v3+json"), cancellationToken)));
            // only `latest` can return a single ReleaseInfo. Otherwise, a list of ReleaseInfo is returned and we need to find the latest one ourselves
            if (allowPrerelease) {
                const candidates = version.filter(it => !it.draft);
                return candidates.find(it => it.prerelease) || candidates[0];
            }
            else {
                return version;
            }
        }
        catch (e) {
            throw (0, builder_util_runtime_1.newError)(`Unable to find latest version on GitHub (${url}), please ensure a production release exists: ${e.stack || e.message}`, "ERR_UPDATER_LATEST_VERSION_NOT_FOUND");
        }
    }
    get basePath() {
        return this.computeGithubBasePath(`/repos/${this.options.owner}/${this.options.repo}/releases`);
    }
    resolveFiles(updateInfo) {
        return (0, Provider_1.getFileList)(updateInfo).map(it => {
            const name = path.posix.basename(it.url).replace(/ /g, "-");
            const asset = updateInfo.assets.find(it => it != null && it.name === name);
            if (asset == null) {
                throw (0, builder_util_runtime_1.newError)(`Cannot find asset "${name}" in: ${JSON.stringify(updateInfo.assets, null, 2)}`, "ERR_UPDATER_ASSET_NOT_FOUND");
            }
            return {
                url: new url_1.URL(asset.url),
                info: it,
            };
        });
    }
}
exports.PrivateGitHubProvider = PrivateGitHubProvider;
//# sourceMappingURL=PrivateGitHubProvider.js.map{"version":3,"file":"PrivateGitHubProvider.js","sourceRoot":"","sources":["../../src/providers/PrivateGitHubProvider.ts"],"names":[],"mappings":";;;AAAA,+DAAwG;AAExG,qCAA8B;AAC9B,6BAA4B;AAE5B,6BAAyB;AACzB,kCAA4D;AAC5D,qDAAqD;AAErD,yCAAgE;AAMhE,MAAa,qBAAsB,SAAQ,mCAA2C;IACpF,YACE,OAAsB,EACL,OAAmB,EACnB,KAAa,EAC9B,cAAsC;QAEtC,KAAK,CAAC,OAAO,EAAE,gBAAgB,EAAE,cAAc,CAAC,CAAA;QAJ/B,YAAO,GAAP,OAAO,CAAY;QACnB,UAAK,GAAL,KAAK,CAAQ;IAIhC,CAAC;IAES,oBAAoB,CAAC,GAAQ,EAAE,OAAoC;QAC3E,MAAM,MAAM,GAAG,KAAK,CAAC,oBAAoB,CAAC,GAAG,EAAE,OAAO,CAAC,CACtD;QAAC,MAAc,CAAC,QAAQ,GAAG,QAAQ,CAAA;QACpC,OAAO,MAAM,CAAA;IACf,CAAC;IAED,KAAK,CAAC,gBAAgB;QACpB,MAAM,iBAAiB,GAAG,IAAI,wCAAiB,EAAE,CAAA;QACjD,MAAM,WAAW,GAAG,IAAA,yBAAkB,EAAC,IAAI,CAAC,qBAAqB,EAAE,CAAC,CAAA;QAEpE,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,CAAA;QACtE,MAAM,KAAK,GAAG,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,KAAK,WAAW,CAAC,CAAA;QACpE,IAAI,KAAK,IAAI,IAAI,EAAE,CAAC;YAClB,+CAA+C;YAC/C,MAAM,IAAA,+BAAQ,EAAC,eAAe,WAAW,mBAAmB,WAAW,CAAC,QAAQ,IAAI,WAAW,CAAC,IAAI,EAAE,EAAE,oCAAoC,CAAC,CAAA;QAC/I,CAAC;QAED,MAAM,GAAG,GAAG,IAAI,SAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;QAC9B,IAAI,MAAW,CAAA;QACf,IAAI,CAAC;YACH,MAAM,GAAG,IAAA,cAAI,EAAC,CAAC,MAAM,IAAI,CAAC,WAAW,CAAC,GAAG,EAAE,IAAI,CAAC,gBAAgB,CAAC,0BAA0B,CAAC,EAAE,iBAAiB,CAAC,CAAE,CAAC,CAAA;QACrH,CAAC;QAAC,OAAO,CAAM,EAAE,CAAC;YAChB,IAAI,CAAC,YAAY,gCAAS,IAAI,CAAC,CAAC,UAAU,KAAK,GAAG,EAAE,CAAC;gBACnD,MAAM,IAAA,+BAAQ,EAAC,eAAe,WAAW,qCAAqC,GAAG,MAAM,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,oCAAoC,CAAC,CAAA;YACtJ,CAAC;YACD,MAAM,CAAC,CAAA;QACT,CAAC;QAED,CAAC;QAAC,MAAkC,CAAC,MAAM,GAAG,WAAW,CAAC,MAAM,CAAA;QAChE,OAAO,MAAM,CAAA;IACf,CAAC;IAED,IAAI,wBAAwB;QAC1B,OAAO,IAAI,CAAC,gBAAgB,CAAC,0BAA0B,CAAC,CAAA;IAC1D,CAAC;IAEO,gBAAgB,CAAC,MAAc;QACrC,OAAO;YACL,MAAM;YACN,aAAa,EAAE,SAAS,IAAI,CAAC,KAAK,EAAE;SACrC,CAAA;IACH,CAAC;IAEO,KAAK,CAAC,oBAAoB,CAAC,iBAAoC;QACrE,MAAM,eAAe,GAAG,IAAI,CAAC,OAAO,CAAC,eAAe,CAAA;QACpD,IAAI,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAA;QAC5B,IAAI,CAAC,eAAe,EAAE,CAAC;YACrB,QAAQ,GAAG,GAAG,QAAQ,SAAS,CAAA;QACjC,CAAC;QAED,MAAM,GAAG,GAAG,IAAA,qBAAc,EAAC,QAAQ,EAAE,IAAI,CAAC,OAAO,CAAC,CAAA;QAClD,IAAI,CAAC;YACH,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,IAAI,CAAC,WAAW,CAAC,GAAG,EAAE,IAAI,CAAC,gBAAgB,CAAC,gCAAgC,CAAC,EAAE,iBAAiB,CAAC,CAAE,CAAC,CAAA;YACtI,2IAA2I;YAC3I,IAAI,eAAe,EAAE,CAAC;gBACpB,MAAM,UAAU,GAAI,OAA8B,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAA;gBAC1E,OAAO,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,UAAU,CAAC,IAAI,UAAU,CAAC,CAAC,CAAC,CAAA;YAC9D,CAAC;iBAAM,CAAC;gBACN,OAAO,OAAO,CAAA;YAChB,CAAC;QACH,CAAC;QAAC,OAAO,CAAM,EAAE,CAAC;YAChB,MAAM,IAAA,+BAAQ,EAAC,4CAA4C,GAAG,iDAAiD,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,sCAAsC,CAAC,CAAA;QAChL,CAAC;IACH,CAAC;IAED,IAAY,QAAQ;QAClB,OAAO,IAAI,CAAC,qBAAqB,CAAC,UAAU,IAAI,CAAC,OAAO,CAAC,KAAK,IAAI,IAAI,CAAC,OAAO,CAAC,IAAI,WAAW,CAAC,CAAA;IACjG,CAAC;IAED,YAAY,CAAC,UAAmC;QAC9C,OAAO,IAAA,sBAAW,EAAC,UAAU,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE;YACtC,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAA;YAC3D,MAAM,KAAK,GAAG,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,IAAI,IAAI,IAAI,EAAE,CAAC,IAAI,KAAK,IAAI,CAAC,CAAA;YAC1E,IAAI,KAAK,IAAI,IAAI,EAAE,CAAC;gBAClB,MAAM,IAAA,+BAAQ,EAAC,sBAAsB,IAAI,SAAS,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,EAAE,6BAA6B,CAAC,CAAA;YAChI,CAAC;YAED,OAAO;gBACL,GAAG,EAAE,IAAI,SAAG,CAAC,KAAK,CAAC,GAAG,CAAC;gBACvB,IAAI,EAAE,EAAE;aACT,CAAA;QACH,CAAC,CAAC,CAAA;IACJ,CAAC;CACF;AA7FD,sDA6FC","sourcesContent":["import { CancellationToken, GithubOptions, HttpError, newError, UpdateInfo } from \"builder-util-runtime\"\nimport { OutgoingHttpHeaders, RequestOptions } from \"http\"\nimport { load } from \"js-yaml\"\nimport * as path from \"path\"\nimport { AppUpdater } from \"../AppUpdater\"\nimport { URL } from \"url\"\nimport { getChannelFilename, newUrlFromBase } from \"../util\"\nimport { BaseGitHubProvider } from \"./GitHubProvider\"\nimport { ResolvedUpdateFileInfo } from \"../types\"\nimport { getFileList, ProviderRuntimeOptions } from \"./Provider\"\n\nexport interface PrivateGitHubUpdateInfo extends UpdateInfo {\n  assets: Array<Asset>\n}\n\nexport class PrivateGitHubProvider extends BaseGitHubProvider<PrivateGitHubUpdateInfo> {\n  constructor(\n    options: GithubOptions,\n    private readonly updater: AppUpdater,\n    private readonly token: string,\n    runtimeOptions: ProviderRuntimeOptions\n  ) {\n    super(options, \"api.github.com\", runtimeOptions)\n  }\n\n  protected createRequestOptions(url: URL, headers?: OutgoingHttpHeaders | null): RequestOptions {\n    const result = super.createRequestOptions(url, headers)\n    ;(result as any).redirect = \"manual\"\n    return result\n  }\n\n  async getLatestVersion(): Promise<PrivateGitHubUpdateInfo> {\n    const cancellationToken = new CancellationToken()\n    const channelFile = getChannelFilename(this.getDefaultChannelName())\n\n    const releaseInfo = await this.getLatestVersionInfo(cancellationToken)\n    const asset = releaseInfo.assets.find(it => it.name === channelFile)\n    if (asset == null) {\n      // html_url must be always, but just to be sure\n      throw newError(`Cannot find ${channelFile} in the release ${releaseInfo.html_url || releaseInfo.name}`, \"ERR_UPDATER_CHANNEL_FILE_NOT_FOUND\")\n    }\n\n    const url = new URL(asset.url)\n    let result: any\n    try {\n      result = load((await this.httpRequest(url, this.configureHeaders(\"application/octet-stream\"), cancellationToken))!)\n    } catch (e: any) {\n      if (e instanceof HttpError && e.statusCode === 404) {\n        throw newError(`Cannot find ${channelFile} in the latest release artifacts (${url}): ${e.stack || e.message}`, \"ERR_UPDATER_CHANNEL_FILE_NOT_FOUND\")\n      }\n      throw e\n    }\n\n    ;(result as PrivateGitHubUpdateInfo).assets = releaseInfo.assets\n    return result\n  }\n\n  get fileExtraDownloadHeaders(): OutgoingHttpHeaders | null {\n    return this.configureHeaders(\"application/octet-stream\")\n  }\n\n  private configureHeaders(accept: string) {\n    return {\n      accept,\n      authorization: `token ${this.token}`,\n    }\n  }\n\n  private async getLatestVersionInfo(cancellationToken: CancellationToken): Promise<ReleaseInfo> {\n    const allowPrerelease = this.updater.allowPrerelease\n    let basePath = this.basePath\n    if (!allowPrerelease) {\n      basePath = `${basePath}/latest`\n    }\n\n    const url = newUrlFromBase(basePath, this.baseUrl)\n    try {\n      const version = JSON.parse((await this.httpRequest(url, this.configureHeaders(\"application/vnd.github.v3+json\"), cancellationToken))!)\n      // only `latest` can return a single ReleaseInfo. Otherwise, a list of ReleaseInfo is returned and we need to find the latest one ourselves\n      if (allowPrerelease) {\n        const candidates = (version as Array<ReleaseInfo>).filter(it => !it.draft)\n        return candidates.find(it => it.prerelease) || candidates[0]\n      } else {\n        return version\n      }\n    } catch (e: any) {\n      throw newError(`Unable to find latest version on GitHub (${url}), please ensure a production release exists: ${e.stack || e.message}`, \"ERR_UPDATER_LATEST_VERSION_NOT_FOUND\")\n    }\n  }\n\n  private get basePath(): string {\n    return this.computeGithubBasePath(`/repos/${this.options.owner}/${this.options.repo}/releases`)\n  }\n\n  resolveFiles(updateInfo: PrivateGitHubUpdateInfo): Array<ResolvedUpdateFileInfo> {\n    return getFileList(updateInfo).map(it => {\n      const name = path.posix.basename(it.url).replace(/ /g, \"-\")\n      const asset = updateInfo.assets.find(it => it != null && it.name === name)\n      if (asset == null) {\n        throw newError(`Cannot find asset \"${name}\" in: ${JSON.stringify(updateInfo.assets, null, 2)}`, \"ERR_UPDATER_ASSET_NOT_FOUND\")\n      }\n\n      return {\n        url: new URL(asset.url),\n        info: it,\n      }\n    })\n  }\n}\n\ninterface ReleaseInfo {\n  name: string\n  html_url: string\n  draft: boolean\n  prerelease: boolean\n  assets: Array<Asset>\n}\n\nexport interface Asset {\n  name: string\n  url: string\n}\n"]}"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Provider = void 0;
exports.findFile = findFile;
exports.parseUpdateInfo = parseUpdateInfo;
exports.getFileList = getFileList;
exports.resolveFiles = resolveFiles;
const builder_util_runtime_1 = require("builder-util-runtime");
const js_yaml_1 = require("js-yaml");
const url_1 = require("url");
const util_1 = require("../util");
// @ts-ignore
const escapeRegExp = require("lodash.escaperegexp");
class Provider {
    constructor(runtimeOptions) {
        this.runtimeOptions = runtimeOptions;
        this.requestHeaders = null;
        this.executor = runtimeOptions.executor;
    }
    // By default, the blockmap file is in the same directory as the main file
    // But some providers may have a different blockmap file, so we need to override this method
    getBlockMapFiles(baseUrl, oldVersion, newVersion, oldBlockMapFileBaseUrl = null) {
        const newBlockMapUrl = (0, util_1.newUrlFromBase)(`${baseUrl.pathname}.blockmap`, baseUrl);
        const oldBlockMapUrl = (0, util_1.newUrlFromBase)(`${baseUrl.pathname.replace(new RegExp(escapeRegExp(newVersion), "g"), oldVersion)}.blockmap`, oldBlockMapFileBaseUrl ? new url_1.URL(oldBlockMapFileBaseUrl) : baseUrl);
        return [oldBlockMapUrl, newBlockMapUrl];
    }
    get isUseMultipleRangeRequest() {
        return this.runtimeOptions.isUseMultipleRangeRequest !== false;
    }
    getChannelFilePrefix() {
        if (this.runtimeOptions.platform === "linux") {
            const arch = process.env["TEST_UPDATER_ARCH"] || process.arch;
            const archSuffix = arch === "x64" ? "" : `-${arch}`;
            return "-linux" + archSuffix;
        }
        else {
            return this.runtimeOptions.platform === "darwin" ? "-mac" : "";
        }
    }
    // due to historical reasons for windows we use channel name without platform specifier
    getDefaultChannelName() {
        return this.getCustomChannelName("latest");
    }
    getCustomChannelName(channel) {
        return `${channel}${this.getChannelFilePrefix()}`;
    }
    get fileExtraDownloadHeaders() {
        return null;
    }
    setRequestHeaders(value) {
        this.requestHeaders = value;
    }
    /**
     * Method to perform API request only to resolve update info, but not to download update.
     */
    httpRequest(url, headers, cancellationToken) {
        return this.executor.request(this.createRequestOptions(url, headers), cancellationToken);
    }
    createRequestOptions(url, headers) {
        const result = {};
        if (this.requestHeaders == null) {
            if (headers != null) {
                result.headers = headers;
            }
        }
        else {
            result.headers = headers == null ? this.requestHeaders : { ...this.requestHeaders, ...headers };
        }
        (0, builder_util_runtime_1.configureRequestUrl)(url, result);
        return result;
    }
}
exports.Provider = Provider;
function findFile(files, extension, not) {
    var _a;
    if (files.length === 0) {
        throw (0, builder_util_runtime_1.newError)("No files provided", "ERR_UPDATER_NO_FILES_PROVIDED");
    }
    const filteredFiles = files.filter(it => it.url.pathname.toLowerCase().endsWith(`.${extension.toLowerCase()}`));
    const result = (_a = filteredFiles.find(it => [it.url.pathname, it.info.url].some(n => n.includes(process.arch)))) !== null && _a !== void 0 ? _a : filteredFiles.shift();
    if (result) {
        return result;
    }
    else if (not == null) {
        return files[0];
    }
    else {
        return files.find(fileInfo => !not.some(ext => fileInfo.url.pathname.toLowerCase().endsWith(`.${ext.toLowerCase()}`)));
    }
}
function parseUpdateInfo(rawData, channelFile, channelFileUrl) {
    if (rawData == null) {
        throw (0, builder_util_runtime_1.newError)(`Cannot parse update info from ${channelFile} in the latest release artifacts (${channelFileUrl}): rawData: null`, "ERR_UPDATER_INVALID_UPDATE_INFO");
    }
    let result;
    try {
        result = (0, js_yaml_1.load)(rawData);
    }
    catch (e) {
        throw (0, builder_util_runtime_1.newError)(`Cannot parse update info from ${channelFile} in the latest release artifacts (${channelFileUrl}): ${e.stack || e.message}, rawData: ${rawData}`, "ERR_UPDATER_INVALID_UPDATE_INFO");
    }
    return result;
}
function getFileList(updateInfo) {
    const files = updateInfo.files;
    if (files != null && files.length > 0) {
        return files;
    }
    // noinspection JSDeprecatedSymbols
    if (updateInfo.path != null) {
        // noinspection JSDeprecatedSymbols
        return [
            {
                url: updateInfo.path,
                sha2: updateInfo.sha2,
                sha512: updateInfo.sha512,
            },
        ];
    }
    else {
        throw (0, builder_util_runtime_1.newError)(`No files provided: ${(0, builder_util_runtime_1.safeStringifyJson)(updateInfo)}`, "ERR_UPDATER_NO_FILES_PROVIDED");
    }
}
function resolveFiles(updateInfo, baseUrl, pathTransformer = (p) => p) {
    const files = getFileList(updateInfo);
    const result = files.map(fileInfo => {
        if (fileInfo.sha2 == null && fileInfo.sha512 == null) {
            throw (0, builder_util_runtime_1.newError)(`Update info doesn't contain nor sha256 neither sha512 checksum: ${(0, builder_util_runtime_1.safeStringifyJson)(fileInfo)}`, "ERR_UPDATER_NO_CHECKSUM");
        }
        return {
            url: (0, util_1.newUrlFromBase)(pathTransformer(fileInfo.url), baseUrl),
            info: fileInfo,
        };
    });
    const packages = updateInfo.packages;
    const packageInfo = packages == null ? null : packages[process.arch] || packages.ia32;
    if (packageInfo != null) {
        ;
        result[0].packageInfo = {
            ...packageInfo,
            path: (0, util_1.newUrlFromBase)(pathTransformer(packageInfo.path), baseUrl).href,
        };
    }
    return result;
}
//# sourceMappingURL=Provider.js.map{"version":3,"file":"Provider.js","sourceRoot":"","sources":["../../src/providers/Provider.ts"],"names":[],"mappings":";;;AAgGA,4BAeC;AAED,0CAeC;AAED,kCAmBC;AAED,oCAqBC;AA5KD,+DAAyJ;AAEzJ,qCAA8B;AAC9B,6BAAyB;AAGzB,kCAAwC;AACxC,aAAa;AACb,oDAAmD;AAWnD,MAAsB,QAAQ;IAI5B,YAAuC,cAAsC;QAAtC,mBAAc,GAAd,cAAc,CAAwB;QAHrE,mBAAc,GAA+B,IAAI,CAAA;QAIvD,IAAI,CAAC,QAAQ,GAAG,cAAc,CAAC,QAAQ,CAAA;IACzC,CAAC;IAED,0EAA0E;IAC1E,4FAA4F;IAC5F,gBAAgB,CAAC,OAAY,EAAE,UAAkB,EAAE,UAAkB,EAAE,yBAAwC,IAAI;QACjH,MAAM,cAAc,GAAG,IAAA,qBAAc,EAAC,GAAG,OAAO,CAAC,QAAQ,WAAW,EAAE,OAAO,CAAC,CAAA;QAC9E,MAAM,cAAc,GAAG,IAAA,qBAAc,EACnC,GAAG,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,MAAM,CAAC,YAAY,CAAC,UAAU,CAAC,EAAE,GAAG,CAAC,EAAE,UAAU,CAAC,WAAW,EAC7F,sBAAsB,CAAC,CAAC,CAAC,IAAI,SAAG,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,OAAO,CACnE,CAAA;QAED,OAAO,CAAC,cAAc,EAAE,cAAc,CAAC,CAAA;IACzC,CAAC;IAED,IAAI,yBAAyB;QAC3B,OAAO,IAAI,CAAC,cAAc,CAAC,yBAAyB,KAAK,KAAK,CAAA;IAChE,CAAC;IAEO,oBAAoB;QAC1B,IAAI,IAAI,CAAC,cAAc,CAAC,QAAQ,KAAK,OAAO,EAAE,CAAC;YAC7C,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,IAAI,OAAO,CAAC,IAAI,CAAA;YAC7D,MAAM,UAAU,GAAG,IAAI,KAAK,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAA;YACnD,OAAO,QAAQ,GAAG,UAAU,CAAA;QAC9B,CAAC;aAAM,CAAC;YACN,OAAO,IAAI,CAAC,cAAc,CAAC,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAA;QAChE,CAAC;IACH,CAAC;IAED,uFAAuF;IAC7E,qBAAqB;QAC7B,OAAO,IAAI,CAAC,oBAAoB,CAAC,QAAQ,CAAC,CAAA;IAC5C,CAAC;IAES,oBAAoB,CAAC,OAAe;QAC5C,OAAO,GAAG,OAAO,GAAG,IAAI,CAAC,oBAAoB,EAAE,EAAE,CAAA;IACnD,CAAC;IAED,IAAI,wBAAwB;QAC1B,OAAO,IAAI,CAAA;IACb,CAAC;IAED,iBAAiB,CAAC,KAAiC;QACjD,IAAI,CAAC,cAAc,GAAG,KAAK,CAAA;IAC7B,CAAC;IAMD;;OAEG;IACO,WAAW,CAAC,GAAQ,EAAE,OAAoC,EAAE,iBAAqC;QACzG,OAAO,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,oBAAoB,CAAC,GAAG,EAAE,OAAO,CAAC,EAAE,iBAAiB,CAAC,CAAA;IAC1F,CAAC;IAES,oBAAoB,CAAC,GAAQ,EAAE,OAAoC;QAC3E,MAAM,MAAM,GAAmB,EAAE,CAAA;QACjC,IAAI,IAAI,CAAC,cAAc,IAAI,IAAI,EAAE,CAAC;YAChC,IAAI,OAAO,IAAI,IAAI,EAAE,CAAC;gBACpB,MAAM,CAAC,OAAO,GAAG,OAAO,CAAA;YAC1B,CAAC;QACH,CAAC;aAAM,CAAC;YACN,MAAM,CAAC,OAAO,GAAG,OAAO,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,GAAG,IAAI,CAAC,cAAc,EAAE,GAAG,OAAO,EAAE,CAAA;QACjG,CAAC;QAED,IAAA,0CAAmB,EAAC,GAAG,EAAE,MAAM,CAAC,CAAA;QAChC,OAAO,MAAM,CAAA;IACf,CAAC;CACF;AA3ED,4BA2EC;AAED,SAAgB,QAAQ,CAAC,KAAoC,EAAE,SAAiB,EAAE,GAAmB;;IACnG,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACvB,MAAM,IAAA,+BAAQ,EAAC,mBAAmB,EAAE,+BAA+B,CAAC,CAAA;IACtE,CAAC;IAED,MAAM,aAAa,GAAG,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,QAAQ,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,IAAI,SAAS,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC,CAAA;IAC/G,MAAM,MAAM,GAAG,MAAA,aAAa,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,QAAQ,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,mCAAI,aAAa,CAAC,KAAK,EAAE,CAAA;IAEpI,IAAI,MAAM,EAAE,CAAC;QACX,OAAO,MAAM,CAAA;IACf,CAAC;SAAM,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,OAAO,KAAK,CAAC,CAAC,CAAC,CAAA;IACjB,CAAC;SAAM,CAAC;QACN,OAAO,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,IAAI,GAAG,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC,CAAC,CAAA;IACxH,CAAC;AACH,CAAC;AAED,SAAgB,eAAe,CAAC,OAAsB,EAAE,WAAmB,EAAE,cAAmB;IAC9F,IAAI,OAAO,IAAI,IAAI,EAAE,CAAC;QACpB,MAAM,IAAA,+BAAQ,EAAC,iCAAiC,WAAW,qCAAqC,cAAc,kBAAkB,EAAE,iCAAiC,CAAC,CAAA;IACtK,CAAC;IAED,IAAI,MAAkB,CAAA;IACtB,IAAI,CAAC;QACH,MAAM,GAAG,IAAA,cAAI,EAAC,OAAO,CAAe,CAAA;IACtC,CAAC;IAAC,OAAO,CAAM,EAAE,CAAC;QAChB,MAAM,IAAA,+BAAQ,EACZ,iCAAiC,WAAW,qCAAqC,cAAc,MAAM,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,OAAO,cAAc,OAAO,EAAE,EAChJ,iCAAiC,CAClC,CAAA;IACH,CAAC;IACD,OAAO,MAAM,CAAA;AACf,CAAC;AAED,SAAgB,WAAW,CAAC,UAAsB;IAChD,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK,CAAA;IAC9B,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACtC,OAAO,KAAK,CAAA;IACd,CAAC;IAED,mCAAmC;IACnC,IAAI,UAAU,CAAC,IAAI,IAAI,IAAI,EAAE,CAAC;QAC5B,mCAAmC;QACnC,OAAO;YACL;gBACE,GAAG,EAAE,UAAU,CAAC,IAAI;gBACpB,IAAI,EAAG,UAAkB,CAAC,IAAI;gBAC9B,MAAM,EAAE,UAAU,CAAC,MAAM;aACnB;SACT,CAAA;IACH,CAAC;SAAM,CAAC;QACN,MAAM,IAAA,+BAAQ,EAAC,sBAAsB,IAAA,wCAAiB,EAAC,UAAU,CAAC,EAAE,EAAE,+BAA+B,CAAC,CAAA;IACxG,CAAC;AACH,CAAC;AAED,SAAgB,YAAY,CAAC,UAAsB,EAAE,OAAY,EAAE,kBAAyC,CAAC,CAAS,EAAU,EAAE,CAAC,CAAC;IAClI,MAAM,KAAK,GAAG,WAAW,CAAC,UAAU,CAAC,CAAA;IACrC,MAAM,MAAM,GAAkC,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE;QACjE,IAAK,QAAgB,CAAC,IAAI,IAAI,IAAI,IAAI,QAAQ,CAAC,MAAM,IAAI,IAAI,EAAE,CAAC;YAC9D,MAAM,IAAA,+BAAQ,EAAC,mEAAmE,IAAA,wCAAiB,EAAC,QAAQ,CAAC,EAAE,EAAE,yBAAyB,CAAC,CAAA;QAC7I,CAAC;QACD,OAAO;YACL,GAAG,EAAE,IAAA,qBAAc,EAAC,eAAe,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC;YAC3D,IAAI,EAAE,QAAQ;SACf,CAAA;IACH,CAAC,CAAC,CAAA;IAEF,MAAM,QAAQ,GAAI,UAAgC,CAAC,QAAQ,CAAA;IAC3D,MAAM,WAAW,GAAG,QAAQ,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,QAAQ,CAAC,IAAI,CAAA;IACrF,IAAI,WAAW,IAAI,IAAI,EAAE,CAAC;QACxB,CAAC;QAAC,MAAM,CAAC,CAAC,CAAS,CAAC,WAAW,GAAG;YAChC,GAAG,WAAW;YACd,IAAI,EAAE,IAAA,qBAAc,EAAC,eAAe,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC,CAAC,IAAI;SACtE,CAAA;IACH,CAAC;IACD,OAAO,MAAM,CAAA;AACf,CAAC","sourcesContent":["import { CancellationToken, configureRequestUrl, newError, safeStringifyJson, UpdateFileInfo, UpdateInfo, WindowsUpdateInfo } from \"builder-util-runtime\"\nimport { OutgoingHttpHeaders, RequestOptions } from \"http\"\nimport { load } from \"js-yaml\"\nimport { URL } from \"url\"\nimport { ElectronHttpExecutor } from \"../electronHttpExecutor\"\nimport { ResolvedUpdateFileInfo } from \"../types\"\nimport { newUrlFromBase } from \"../util\"\n// @ts-ignore\nimport * as escapeRegExp from \"lodash.escaperegexp\"\n\nexport type ProviderPlatform = \"darwin\" | \"linux\" | \"win32\"\n\nexport interface ProviderRuntimeOptions {\n  isUseMultipleRangeRequest: boolean\n  platform: ProviderPlatform\n\n  executor: ElectronHttpExecutor\n}\n\nexport abstract class Provider<T extends UpdateInfo> {\n  private requestHeaders: OutgoingHttpHeaders | null = null\n  protected readonly executor: ElectronHttpExecutor\n\n  protected constructor(private readonly runtimeOptions: ProviderRuntimeOptions) {\n    this.executor = runtimeOptions.executor\n  }\n\n  // By default, the blockmap file is in the same directory as the main file\n  // But some providers may have a different blockmap file, so we need to override this method\n  getBlockMapFiles(baseUrl: URL, oldVersion: string, newVersion: string, oldBlockMapFileBaseUrl: string | null = null): URL[] | Promise<URL[]> {\n    const newBlockMapUrl = newUrlFromBase(`${baseUrl.pathname}.blockmap`, baseUrl)\n    const oldBlockMapUrl = newUrlFromBase(\n      `${baseUrl.pathname.replace(new RegExp(escapeRegExp(newVersion), \"g\"), oldVersion)}.blockmap`,\n      oldBlockMapFileBaseUrl ? new URL(oldBlockMapFileBaseUrl) : baseUrl\n    )\n\n    return [oldBlockMapUrl, newBlockMapUrl]\n  }\n\n  get isUseMultipleRangeRequest(): boolean {\n    return this.runtimeOptions.isUseMultipleRangeRequest !== false\n  }\n\n  private getChannelFilePrefix(): string {\n    if (this.runtimeOptions.platform === \"linux\") {\n      const arch = process.env[\"TEST_UPDATER_ARCH\"] || process.arch\n      const archSuffix = arch === \"x64\" ? \"\" : `-${arch}`\n      return \"-linux\" + archSuffix\n    } else {\n      return this.runtimeOptions.platform === \"darwin\" ? \"-mac\" : \"\"\n    }\n  }\n\n  // due to historical reasons for windows we use channel name without platform specifier\n  protected getDefaultChannelName(): string {\n    return this.getCustomChannelName(\"latest\")\n  }\n\n  protected getCustomChannelName(channel: string): string {\n    return `${channel}${this.getChannelFilePrefix()}`\n  }\n\n  get fileExtraDownloadHeaders(): OutgoingHttpHeaders | null {\n    return null\n  }\n\n  setRequestHeaders(value: OutgoingHttpHeaders | null): void {\n    this.requestHeaders = value\n  }\n\n  abstract getLatestVersion(): Promise<T>\n\n  abstract resolveFiles(updateInfo: T): Array<ResolvedUpdateFileInfo>\n\n  /**\n   * Method to perform API request only to resolve update info, but not to download update.\n   */\n  protected httpRequest(url: URL, headers?: OutgoingHttpHeaders | null, cancellationToken?: CancellationToken): Promise<string | null> {\n    return this.executor.request(this.createRequestOptions(url, headers), cancellationToken)\n  }\n\n  protected createRequestOptions(url: URL, headers?: OutgoingHttpHeaders | null): RequestOptions {\n    const result: RequestOptions = {}\n    if (this.requestHeaders == null) {\n      if (headers != null) {\n        result.headers = headers\n      }\n    } else {\n      result.headers = headers == null ? this.requestHeaders : { ...this.requestHeaders, ...headers }\n    }\n\n    configureRequestUrl(url, result)\n    return result\n  }\n}\n\nexport function findFile(files: Array<ResolvedUpdateFileInfo>, extension: string, not?: Array<string>): ResolvedUpdateFileInfo | null | undefined {\n  if (files.length === 0) {\n    throw newError(\"No files provided\", \"ERR_UPDATER_NO_FILES_PROVIDED\")\n  }\n\n  const filteredFiles = files.filter(it => it.url.pathname.toLowerCase().endsWith(`.${extension.toLowerCase()}`))\n  const result = filteredFiles.find(it => [it.url.pathname, it.info.url].some(n => n.includes(process.arch))) ?? filteredFiles.shift()\n\n  if (result) {\n    return result\n  } else if (not == null) {\n    return files[0]\n  } else {\n    return files.find(fileInfo => !not.some(ext => fileInfo.url.pathname.toLowerCase().endsWith(`.${ext.toLowerCase()}`)))\n  }\n}\n\nexport function parseUpdateInfo(rawData: string | null, channelFile: string, channelFileUrl: URL): UpdateInfo {\n  if (rawData == null) {\n    throw newError(`Cannot parse update info from ${channelFile} in the latest release artifacts (${channelFileUrl}): rawData: null`, \"ERR_UPDATER_INVALID_UPDATE_INFO\")\n  }\n\n  let result: UpdateInfo\n  try {\n    result = load(rawData) as UpdateInfo\n  } catch (e: any) {\n    throw newError(\n      `Cannot parse update info from ${channelFile} in the latest release artifacts (${channelFileUrl}): ${e.stack || e.message}, rawData: ${rawData}`,\n      \"ERR_UPDATER_INVALID_UPDATE_INFO\"\n    )\n  }\n  return result\n}\n\nexport function getFileList(updateInfo: UpdateInfo): Array<UpdateFileInfo> {\n  const files = updateInfo.files\n  if (files != null && files.length > 0) {\n    return files\n  }\n\n  // noinspection JSDeprecatedSymbols\n  if (updateInfo.path != null) {\n    // noinspection JSDeprecatedSymbols\n    return [\n      {\n        url: updateInfo.path,\n        sha2: (updateInfo as any).sha2,\n        sha512: updateInfo.sha512,\n      } as any,\n    ]\n  } else {\n    throw newError(`No files provided: ${safeStringifyJson(updateInfo)}`, \"ERR_UPDATER_NO_FILES_PROVIDED\")\n  }\n}\n\nexport function resolveFiles(updateInfo: UpdateInfo, baseUrl: URL, pathTransformer: (p: string) => string = (p: string): string => p): Array<ResolvedUpdateFileInfo> {\n  const files = getFileList(updateInfo)\n  const result: Array<ResolvedUpdateFileInfo> = files.map(fileInfo => {\n    if ((fileInfo as any).sha2 == null && fileInfo.sha512 == null) {\n      throw newError(`Update info doesn't contain nor sha256 neither sha512 checksum: ${safeStringifyJson(fileInfo)}`, \"ERR_UPDATER_NO_CHECKSUM\")\n    }\n    return {\n      url: newUrlFromBase(pathTransformer(fileInfo.url), baseUrl),\n      info: fileInfo,\n    }\n  })\n\n  const packages = (updateInfo as WindowsUpdateInfo).packages\n  const packageInfo = packages == null ? null : packages[process.arch] || packages.ia32\n  if (packageInfo != null) {\n    ;(result[0] as any).packageInfo = {\n      ...packageInfo,\n      path: newUrlFromBase(pathTransformer(packageInfo.path), baseUrl).href,\n    }\n  }\n  return result\n}\n"]}"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.UpdaterSignal = exports.UPDATE_DOWNLOADED = exports.DOWNLOAD_PROGRESS = exports.CancellationToken = void 0;
exports.addHandler = addHandler;
const builder_util_runtime_1 = require("builder-util-runtime");
Object.defineProperty(exports, "CancellationToken", { enumerable: true, get: function () { return builder_util_runtime_1.CancellationToken; } });
exports.DOWNLOAD_PROGRESS = "download-progress";
exports.UPDATE_DOWNLOADED = "update-downloaded";
class UpdaterSignal {
    constructor(emitter) {
        this.emitter = emitter;
    }
    /**
     * Emitted when an authenticating proxy is [asking for user credentials](https://github.com/electron/electron/blob/master/docs/api/client-request.md#event-login).
     */
    login(handler) {
        addHandler(this.emitter, "login", handler);
    }
    progress(handler) {
        addHandler(this.emitter, exports.DOWNLOAD_PROGRESS, handler);
    }
    updateDownloaded(handler) {
        addHandler(this.emitter, exports.UPDATE_DOWNLOADED, handler);
    }
    updateCancelled(handler) {
        addHandler(this.emitter, "update-cancelled", handler);
    }
}
exports.UpdaterSignal = UpdaterSignal;
const isLogEvent = false;
function addHandler(emitter, event, handler) {
    if (isLogEvent) {
        emitter.on(event, (...args) => {
            console.log("%s %s", event, args);
            handler(...args);
        });
    }
    else {
        emitter.on(event, handler);
    }
}
//# sourceMappingURL=types.js.map{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";;;AA6CA,gCASC;AAtDD,+DAAmH;AAK1G,kGALA,wCAAiB,OAKA;AAEb,QAAA,iBAAiB,GAAG,mBAAmB,CAAA;AACvC,QAAA,iBAAiB,GAAG,mBAAmB,CAAA;AAYpD,MAAa,aAAa;IACxB,YAAoB,OAAqB;QAArB,YAAO,GAAP,OAAO,CAAc;IAAG,CAAC;IAE7C;;OAEG;IACH,KAAK,CAAC,OAAqB;QACzB,UAAU,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,CAAA;IAC5C,CAAC;IAED,QAAQ,CAAC,OAAqC;QAC5C,UAAU,CAAC,IAAI,CAAC,OAAO,EAAE,yBAAiB,EAAE,OAAO,CAAC,CAAA;IACtD,CAAC;IAED,gBAAgB,CAAC,OAA8C;QAC7D,UAAU,CAAC,IAAI,CAAC,OAAO,EAAE,yBAAiB,EAAE,OAAO,CAAC,CAAA;IACtD,CAAC;IAED,eAAe,CAAC,OAAmC;QACjD,UAAU,CAAC,IAAI,CAAC,OAAO,EAAE,kBAAkB,EAAE,OAAO,CAAC,CAAA;IACvD,CAAC;CACF;AArBD,sCAqBC;AAED,MAAM,UAAU,GAAG,KAAK,CAAA;AAExB,SAAgB,UAAU,CAAC,OAAqB,EAAE,KAAoB,EAAE,OAAsC;IAC5G,IAAI,UAAU,EAAE,CAAC;QACf,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,GAAG,IAAgB,EAAE,EAAE;YACxC,OAAO,CAAC,GAAG,CAAC,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,CAAA;YACjC,OAAO,CAAC,GAAG,IAAI,CAAC,CAAA;QAClB,CAAC,CAAC,CAAA;IACJ,CAAC;SAAM,CAAC;QACN,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC,CAAA;IAC5B,CAAC;AACH,CAAC","sourcesContent":["import { CancellationToken, PackageFileInfo, ProgressInfo, UpdateFileInfo, UpdateInfo } from \"builder-util-runtime\"\nimport { EventEmitter } from \"events\"\nimport { URL } from \"url\"\nimport { LoginCallback } from \"./electronHttpExecutor\"\n\nexport { CancellationToken, PackageFileInfo, ProgressInfo, UpdateFileInfo, UpdateInfo }\n\nexport const DOWNLOAD_PROGRESS = \"download-progress\"\nexport const UPDATE_DOWNLOADED = \"update-downloaded\"\n\nexport interface Logger {\n  info(message?: any): void\n\n  warn(message?: any): void\n\n  error(message?: any): void\n\n  debug?(message: string): void\n}\n\nexport class UpdaterSignal {\n  constructor(private emitter: EventEmitter) {}\n\n  /**\n   * Emitted when an authenticating proxy is [asking for user credentials](https://github.com/electron/electron/blob/master/docs/api/client-request.md#event-login).\n   */\n  login(handler: LoginHandler): void {\n    addHandler(this.emitter, \"login\", handler)\n  }\n\n  progress(handler: (info: ProgressInfo) => void): void {\n    addHandler(this.emitter, DOWNLOAD_PROGRESS, handler)\n  }\n\n  updateDownloaded(handler: (info: UpdateDownloadedEvent) => void): void {\n    addHandler(this.emitter, UPDATE_DOWNLOADED, handler)\n  }\n\n  updateCancelled(handler: (info: UpdateInfo) => void): void {\n    addHandler(this.emitter, \"update-cancelled\", handler)\n  }\n}\n\nconst isLogEvent = false\n\nexport function addHandler(emitter: EventEmitter, event: UpdaterEvents, handler: (...args: Array<any>) => void): void {\n  if (isLogEvent) {\n    emitter.on(event, (...args: Array<any>) => {\n      console.log(\"%s %s\", event, args)\n      handler(...args)\n    })\n  } else {\n    emitter.on(event, handler)\n  }\n}\n\nexport interface UpdateCheckResult {\n  readonly isUpdateAvailable: boolean\n\n  readonly updateInfo: UpdateInfo\n\n  readonly downloadPromise?: Promise<Array<string>> | null\n\n  readonly cancellationToken?: CancellationToken\n\n  /** @deprecated */\n  readonly versionInfo: UpdateInfo\n}\n\nexport interface UpdateDownloadedEvent extends UpdateInfo {\n  downloadedFile: string\n}\n\nexport interface ResolvedUpdateFileInfo {\n  readonly url: URL\n  readonly info: UpdateFileInfo\n\n  packageInfo?: PackageFileInfo\n}\n\nexport type UpdaterEvents = \"login\" | \"checking-for-update\" | \"update-available\" | \"update-not-available\" | \"update-cancelled\" | \"download-progress\" | \"update-downloaded\" | \"error\"\n\nexport type LoginHandler = (authInfo: any, callback: LoginCallback) => void\n"]}"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.newBaseUrl = newBaseUrl;
exports.newUrlFromBase = newUrlFromBase;
exports.getChannelFilename = getChannelFilename;
// if baseUrl path doesn't ends with /, this path will be not prepended to passed pathname for new URL(input, base)
const url_1 = require("url");
/** @internal */
function newBaseUrl(url) {
    const result = new url_1.URL(url);
    if (!result.pathname.endsWith("/")) {
        result.pathname += "/";
    }
    return result;
}
// addRandomQueryToAvoidCaching is false by default because in most cases URL already contains version number,
// so, it makes sense only for Generic Provider for channel files
function newUrlFromBase(pathname, baseUrl, addRandomQueryToAvoidCaching = false) {
    const result = new url_1.URL(pathname, baseUrl);
    // search is not propagated (search is an empty string if not specified)
    const search = baseUrl.search;
    if (search != null && search.length !== 0) {
        result.search = search;
    }
    else if (addRandomQueryToAvoidCaching) {
        result.search = `noCache=${Date.now().toString(32)}`;
    }
    return result;
}
function getChannelFilename(channel) {
    return `${channel}.yml`;
}
//# sourceMappingURL=util.js.map{"version":3,"file":"util.js","sourceRoot":"","sources":["../src/util.ts"],"names":[],"mappings":";;AAIA,gCAMC;AAID,wCAUC;AAED,gDAEC;AA5BD,mHAAmH;AACnH,6BAAyB;AAEzB,gBAAgB;AAChB,SAAgB,UAAU,CAAC,GAAW;IACpC,MAAM,MAAM,GAAG,IAAI,SAAG,CAAC,GAAG,CAAC,CAAA;IAC3B,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QACnC,MAAM,CAAC,QAAQ,IAAI,GAAG,CAAA;IACxB,CAAC;IACD,OAAO,MAAM,CAAA;AACf,CAAC;AAED,8GAA8G;AAC9G,iEAAiE;AACjE,SAAgB,cAAc,CAAC,QAAgB,EAAE,OAAY,EAAE,4BAA4B,GAAG,KAAK;IACjG,MAAM,MAAM,GAAG,IAAI,SAAG,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAA;IACzC,wEAAwE;IACxE,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAA;IAC7B,IAAI,MAAM,IAAI,IAAI,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC1C,MAAM,CAAC,MAAM,GAAG,MAAM,CAAA;IACxB,CAAC;SAAM,IAAI,4BAA4B,EAAE,CAAC;QACxC,MAAM,CAAC,MAAM,GAAG,WAAW,IAAI,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,CAAA;IACtD,CAAC;IACD,OAAO,MAAM,CAAA;AACf,CAAC;AAED,SAAgB,kBAAkB,CAAC,OAAe;IAChD,OAAO,GAAG,OAAO,MAAM,CAAA;AACzB,CAAC","sourcesContent":["// if baseUrl path doesn't ends with /, this path will be not prepended to passed pathname for new URL(input, base)\nimport { URL } from \"url\"\n\n/** @internal */\nexport function newBaseUrl(url: string): URL {\n  const result = new URL(url)\n  if (!result.pathname.endsWith(\"/\")) {\n    result.pathname += \"/\"\n  }\n  return result\n}\n\n// addRandomQueryToAvoidCaching is false by default because in most cases URL already contains version number,\n// so, it makes sense only for Generic Provider for channel files\nexport function newUrlFromBase(pathname: string, baseUrl: URL, addRandomQueryToAvoidCaching = false): URL {\n  const result = new URL(pathname, baseUrl)\n  // search is not propagated (search is an empty string if not specified)\n  const search = baseUrl.search\n  if (search != null && search.length !== 0) {\n    result.search = search\n  } else if (addRandomQueryToAvoidCaching) {\n    result.search = `noCache=${Date.now().toString(32)}`\n  }\n  return result\n}\n\nexport function getChannelFilename(channel: string): string {\n  return `${channel}.yml`\n}\n"]}"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.verifySignature = verifySignature;
const builder_util_runtime_1 = require("builder-util-runtime");
const child_process_1 = require("child_process");
const os = require("os");
const path = require("path");
function preparePowerShellExec(command, timeout) {
    // https://github.com/electron-userland/electron-builder/issues/2421
    // https://github.com/electron-userland/electron-builder/issues/2535
    // Resetting PSModulePath is necessary https://github.com/electron-userland/electron-builder/issues/7127
    // semicolon wont terminate the set command and run chcp thus leading to verification errors on certificats with special chars like german umlauts, so rather
    //   join commands using & https://github.com/electron-userland/electron-builder/issues/8162
    const executable = `set "PSModulePath=" & chcp 65001 >NUL & powershell.exe`;
    const args = ["-NoProfile", "-NonInteractive", "-InputFormat", "None", "-Command", command];
    const options = {
        shell: true,
        timeout,
    };
    return [executable, args, options];
}
// $certificateInfo = (Get-AuthenticodeSignature 'xxx\yyy.exe'
// | where {$_.Status.Equals([System.Management.Automation.SignatureStatus]::Valid) -and $_.SignerCertificate.Subject.Contains("CN=siemens.com")})
// | Out-String ; if ($certificateInfo) { exit 0 } else { exit 1 }
function verifySignature(publisherNames, unescapedTempUpdateFile, logger) {
    return new Promise((resolve, reject) => {
        // Escape quotes and backticks in filenames to prevent user from breaking the
        // arguments and perform a remote command injection.
        //
        // Consider example powershell command:
        // ```powershell
        // Get-AuthenticodeSignature 'C:\\path\\my-bad-';calc;'filename.exe'
        // ```
        // The above would work expected and find the file name, however, it will also execute `;calc;`
        // command and start the calculator app.
        //
        // From Powershell quoting rules:
        // https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_quoting_rules?view=powershell-7
        // * Double quotes `"` are treated literally within single-quoted strings;
        // * Single quotes can be escaped by doubling them: 'don''t' -> don't;
        //
        // Also note that at this point the file has already been written to the disk, thus we are
        // guaranteed that the path will not contain any illegal characters like <>:"/\|?*
        // https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file
        const tempUpdateFile = unescapedTempUpdateFile.replace(/'/g, "''");
        logger.info(`Verifying signature ${tempUpdateFile}`);
        (0, child_process_1.execFile)(...preparePowerShellExec(`"Get-AuthenticodeSignature -LiteralPath '${tempUpdateFile}' | ConvertTo-Json -Compress"`, 20 * 1000), (error, stdout, stderr) => {
            var _a;
            try {
                if (error != null || stderr) {
                    handleError(logger, error, stderr, reject);
                    resolve(null);
                    return;
                }
                const data = parseOut(stdout);
                if (data.Status === 0) {
                    try {
                        const normlaizedUpdateFilePath = path.normalize(data.Path);
                        const normalizedTempUpdateFile = path.normalize(unescapedTempUpdateFile);
                        logger.info(`LiteralPath: ${normlaizedUpdateFilePath}. Update Path: ${normalizedTempUpdateFile}`);
                        if (normlaizedUpdateFilePath !== normalizedTempUpdateFile) {
                            handleError(logger, new Error(`LiteralPath of ${normlaizedUpdateFilePath} is different than ${normalizedTempUpdateFile}`), stderr, reject);
                            resolve(null);
                            return;
                        }
                    }
                    catch (error) {
                        logger.warn(`Unable to verify LiteralPath of update asset due to missing data.Path. Skipping this step of validation. Message: ${(_a = error.message) !== null && _a !== void 0 ? _a : error.stack}`);
                    }
                    const subject = (0, builder_util_runtime_1.parseDn)(data.SignerCertificate.Subject);
                    let match = false;
                    for (const name of publisherNames) {
                        const dn = (0, builder_util_runtime_1.parseDn)(name);
                        if (dn.size) {
                            // if we have a full DN, compare all values
                            const allKeys = Array.from(dn.keys());
                            match = allKeys.every(key => {
                                return dn.get(key) === subject.get(key);
                            });
                        }
                        else if (name === subject.get("CN")) {
                            logger.warn(`Signature validated using only CN ${name}. Please add your full Distinguished Name (DN) to publisherNames configuration`);
                            match = true;
                        }
                        if (match) {
                            resolve(null);
                            return;
                        }
                    }
                }
                const result = `publisherNames: ${publisherNames.join(" | ")}, raw info: ` + JSON.stringify(data, (name, value) => (name === "RawData" ? undefined : value), 2);
                logger.warn(`Sign verification failed, installer signed with incorrect certificate: ${result}`);
                resolve(result);
            }
            catch (e) {
                handleError(logger, e, null, reject);
                resolve(null);
                return;
            }
        });
    });
}
function parseOut(out) {
    const data = JSON.parse(out);
    delete data.PrivateKey;
    delete data.IsOSBinary;
    delete data.SignatureType;
    const signerCertificate = data.SignerCertificate;
    if (signerCertificate != null) {
        delete signerCertificate.Archived;
        delete signerCertificate.Extensions;
        delete signerCertificate.Handle;
        delete signerCertificate.HasPrivateKey;
        // duplicates data.SignerCertificate (contains RawData)
        delete signerCertificate.SubjectName;
    }
    return data;
}
function handleError(logger, error, stderr, reject) {
    if (isOldWin6()) {
        logger.warn(`Cannot execute Get-AuthenticodeSignature: ${error || stderr}. Ignoring signature validation due to unsupported powershell version. Please upgrade to powershell 3 or higher.`);
        return;
    }
    try {
        (0, child_process_1.execFileSync)(...preparePowerShellExec("ConvertTo-Json test", 10 * 1000));
    }
    catch (testError) {
        logger.warn(`Cannot execute ConvertTo-Json: ${testError.message}. Ignoring signature validation due to unsupported powershell version. Please upgrade to powershell 3 or higher.`);
        return;
    }
    if (error != null) {
        reject(error);
    }
    if (stderr) {
        reject(new Error(`Cannot execute Get-AuthenticodeSignature, stderr: ${stderr}. Failing signature validation due to unknown stderr.`));
    }
}
function isOldWin6() {
    const winVersion = os.release();
    return winVersion.startsWith("6.") && !winVersion.startsWith("6.3");
}
//# sourceMappingURL=windowsExecutableCodeSignatureVerifier.js.map{"version":3,"file":"windowsExecutableCodeSignatureVerifier.js","sourceRoot":"","sources":["../src/windowsExecutableCodeSignatureVerifier.ts"],"names":[],"mappings":";;AAwBA,0CA2EC;AAnGD,+DAA8C;AAC9C,iDAAuE;AACvE,yBAAwB;AAExB,6BAA4B;AAE5B,SAAS,qBAAqB,CAAC,OAAe,EAAE,OAAgB;IAC9D,oEAAoE;IACpE,oEAAoE;IACpE,wGAAwG;IACxG,6JAA6J;IAC7J,4FAA4F;IAC5F,MAAM,UAAU,GAAG,wDAAwD,CAAA;IAC3E,MAAM,IAAI,GAAG,CAAC,YAAY,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,CAAC,CAAA;IAC3F,MAAM,OAAO,GAAoB;QAC/B,KAAK,EAAE,IAAI;QACX,OAAO;KACR,CAAA;IACD,OAAO,CAAC,UAAU,EAAE,IAAI,EAAE,OAAO,CAAU,CAAA;AAC7C,CAAC;AAED,8DAA8D;AAC9D,kJAAkJ;AAClJ,kEAAkE;AAClE,SAAgB,eAAe,CAAC,cAA6B,EAAE,uBAA+B,EAAE,MAAc;IAC5G,OAAO,IAAI,OAAO,CAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACpD,6EAA6E;QAC7E,oDAAoD;QACpD,EAAE;QACF,uCAAuC;QACvC,gBAAgB;QAChB,oEAAoE;QACpE,MAAM;QACN,+FAA+F;QAC/F,wCAAwC;QACxC,EAAE;QACF,iCAAiC;QACjC,2HAA2H;QAC3H,0EAA0E;QAC1E,sEAAsE;QACtE,EAAE;QACF,0FAA0F;QAC1F,kFAAkF;QAClF,sEAAsE;QACtE,MAAM,cAAc,GAAG,uBAAuB,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,CAAA;QAClE,MAAM,CAAC,IAAI,CAAC,uBAAuB,cAAc,EAAE,CAAC,CAAA;QAEpD,IAAA,wBAAQ,EAAC,GAAG,qBAAqB,CAAC,4CAA4C,cAAc,+BAA+B,EAAE,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE;;YACjK,IAAI,CAAC;gBACH,IAAI,KAAK,IAAI,IAAI,IAAI,MAAM,EAAE,CAAC;oBAC5B,WAAW,CAAC,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,CAAA;oBAC1C,OAAO,CAAC,IAAI,CAAC,CAAA;oBACb,OAAM;gBACR,CAAC;gBACD,MAAM,IAAI,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAA;gBAC7B,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;oBACtB,IAAI,CAAC;wBACH,MAAM,wBAAwB,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;wBAC1D,MAAM,wBAAwB,GAAG,IAAI,CAAC,SAAS,CAAC,uBAAuB,CAAC,CAAA;wBACxE,MAAM,CAAC,IAAI,CAAC,gBAAgB,wBAAwB,kBAAkB,wBAAwB,EAAE,CAAC,CAAA;wBACjG,IAAI,wBAAwB,KAAK,wBAAwB,EAAE,CAAC;4BAC1D,WAAW,CAAC,MAAM,EAAE,IAAI,KAAK,CAAC,kBAAkB,wBAAwB,sBAAsB,wBAAwB,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,CAAA;4BAC1I,OAAO,CAAC,IAAI,CAAC,CAAA;4BACb,OAAM;wBACR,CAAC;oBACH,CAAC;oBAAC,OAAO,KAAU,EAAE,CAAC;wBACpB,MAAM,CAAC,IAAI,CAAC,qHAAqH,MAAA,KAAK,CAAC,OAAO,mCAAI,KAAK,CAAC,KAAK,EAAE,CAAC,CAAA;oBAClK,CAAC;oBACD,MAAM,OAAO,GAAG,IAAA,8BAAO,EAAC,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAA;oBACvD,IAAI,KAAK,GAAG,KAAK,CAAA;oBACjB,KAAK,MAAM,IAAI,IAAI,cAAc,EAAE,CAAC;wBAClC,MAAM,EAAE,GAAG,IAAA,8BAAO,EAAC,IAAI,CAAC,CAAA;wBACxB,IAAI,EAAE,CAAC,IAAI,EAAE,CAAC;4BACZ,2CAA2C;4BAC3C,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,CAAA;4BACrC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE;gCAC1B,OAAO,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;4BACzC,CAAC,CAAC,CAAA;wBACJ,CAAC;6BAAM,IAAI,IAAI,KAAK,OAAO,CAAC,GAAG,CAAC,IAAI,CAAE,EAAE,CAAC;4BACvC,MAAM,CAAC,IAAI,CAAC,qCAAqC,IAAI,gFAAgF,CAAC,CAAA;4BACtI,KAAK,GAAG,IAAI,CAAA;wBACd,CAAC;wBACD,IAAI,KAAK,EAAE,CAAC;4BACV,OAAO,CAAC,IAAI,CAAC,CAAA;4BACb,OAAM;wBACR,CAAC;oBACH,CAAC;gBACH,CAAC;gBAED,MAAM,MAAM,GAAG,mBAAmB,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,cAAc,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAA;gBAC/J,MAAM,CAAC,IAAI,CAAC,0EAA0E,MAAM,EAAE,CAAC,CAAA;gBAC/F,OAAO,CAAC,MAAM,CAAC,CAAA;YACjB,CAAC;YAAC,OAAO,CAAM,EAAE,CAAC;gBAChB,WAAW,CAAC,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,CAAA;gBACpC,OAAO,CAAC,IAAI,CAAC,CAAA;gBACb,OAAM;YACR,CAAC;QACH,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC;AAED,SAAS,QAAQ,CAAC,GAAW;IAC3B,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;IAC5B,OAAO,IAAI,CAAC,UAAU,CAAA;IACtB,OAAO,IAAI,CAAC,UAAU,CAAA;IACtB,OAAO,IAAI,CAAC,aAAa,CAAA;IACzB,MAAM,iBAAiB,GAAG,IAAI,CAAC,iBAAiB,CAAA;IAChD,IAAI,iBAAiB,IAAI,IAAI,EAAE,CAAC;QAC9B,OAAO,iBAAiB,CAAC,QAAQ,CAAA;QACjC,OAAO,iBAAiB,CAAC,UAAU,CAAA;QACnC,OAAO,iBAAiB,CAAC,MAAM,CAAA;QAC/B,OAAO,iBAAiB,CAAC,aAAa,CAAA;QACtC,uDAAuD;QACvD,OAAO,iBAAiB,CAAC,WAAW,CAAA;IACtC,CAAC;IACD,OAAO,IAAI,CAAA;AACb,CAAC;AAED,SAAS,WAAW,CAAC,MAAc,EAAE,KAAmB,EAAE,MAAqB,EAAE,MAA6B;IAC5G,IAAI,SAAS,EAAE,EAAE,CAAC;QAChB,MAAM,CAAC,IAAI,CACT,6CAA6C,KAAK,IAAI,MAAM,kHAAkH,CAC/K,CAAA;QACD,OAAM;IACR,CAAC;IAED,IAAI,CAAC;QACH,IAAA,4BAAY,EAAC,GAAG,qBAAqB,CAAC,qBAAqB,EAAE,EAAE,GAAG,IAAI,CAAC,CAAC,CAAA;IAC1E,CAAC;IAAC,OAAO,SAAc,EAAE,CAAC;QACxB,MAAM,CAAC,IAAI,CACT,kCAAkC,SAAS,CAAC,OAAO,kHAAkH,CACtK,CAAA;QACD,OAAM;IACR,CAAC;IAED,IAAI,KAAK,IAAI,IAAI,EAAE,CAAC;QAClB,MAAM,CAAC,KAAK,CAAC,CAAA;IACf,CAAC;IAED,IAAI,MAAM,EAAE,CAAC;QACX,MAAM,CAAC,IAAI,KAAK,CAAC,qDAAqD,MAAM,uDAAuD,CAAC,CAAC,CAAA;IACvI,CAAC;AACH,CAAC;AAED,SAAS,SAAS;IAChB,MAAM,UAAU,GAAG,EAAE,CAAC,OAAO,EAAE,CAAA;IAC/B,OAAO,UAAU,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,KAAK,CAAC,CAAA;AACrE,CAAC","sourcesContent":["import { parseDn } from \"builder-util-runtime\"\nimport { execFile, execFileSync, ExecFileOptions } from \"child_process\"\nimport * as os from \"os\"\nimport { Logger } from \"./types\"\nimport * as path from \"path\"\n\nfunction preparePowerShellExec(command: string, timeout?: number) {\n  // https://github.com/electron-userland/electron-builder/issues/2421\n  // https://github.com/electron-userland/electron-builder/issues/2535\n  // Resetting PSModulePath is necessary https://github.com/electron-userland/electron-builder/issues/7127\n  // semicolon wont terminate the set command and run chcp thus leading to verification errors on certificats with special chars like german umlauts, so rather\n  //   join commands using & https://github.com/electron-userland/electron-builder/issues/8162\n  const executable = `set \"PSModulePath=\" & chcp 65001 >NUL & powershell.exe`\n  const args = [\"-NoProfile\", \"-NonInteractive\", \"-InputFormat\", \"None\", \"-Command\", command]\n  const options: ExecFileOptions = {\n    shell: true,\n    timeout,\n  }\n  return [executable, args, options] as const\n}\n\n// $certificateInfo = (Get-AuthenticodeSignature 'xxx\\yyy.exe'\n// | where {$_.Status.Equals([System.Management.Automation.SignatureStatus]::Valid) -and $_.SignerCertificate.Subject.Contains(\"CN=siemens.com\")})\n// | Out-String ; if ($certificateInfo) { exit 0 } else { exit 1 }\nexport function verifySignature(publisherNames: Array<string>, unescapedTempUpdateFile: string, logger: Logger): Promise<string | null> {\n  return new Promise<string | null>((resolve, reject) => {\n    // Escape quotes and backticks in filenames to prevent user from breaking the\n    // arguments and perform a remote command injection.\n    //\n    // Consider example powershell command:\n    // ```powershell\n    // Get-AuthenticodeSignature 'C:\\\\path\\\\my-bad-';calc;'filename.exe'\n    // ```\n    // The above would work expected and find the file name, however, it will also execute `;calc;`\n    // command and start the calculator app.\n    //\n    // From Powershell quoting rules:\n    // https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_quoting_rules?view=powershell-7\n    // * Double quotes `\"` are treated literally within single-quoted strings;\n    // * Single quotes can be escaped by doubling them: 'don''t' -> don't;\n    //\n    // Also note that at this point the file has already been written to the disk, thus we are\n    // guaranteed that the path will not contain any illegal characters like <>:\"/\\|?*\n    // https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file\n    const tempUpdateFile = unescapedTempUpdateFile.replace(/'/g, \"''\")\n    logger.info(`Verifying signature ${tempUpdateFile}`)\n\n    execFile(...preparePowerShellExec(`\"Get-AuthenticodeSignature -LiteralPath '${tempUpdateFile}' | ConvertTo-Json -Compress\"`, 20 * 1000), (error, stdout, stderr) => {\n      try {\n        if (error != null || stderr) {\n          handleError(logger, error, stderr, reject)\n          resolve(null)\n          return\n        }\n        const data = parseOut(stdout)\n        if (data.Status === 0) {\n          try {\n            const normlaizedUpdateFilePath = path.normalize(data.Path)\n            const normalizedTempUpdateFile = path.normalize(unescapedTempUpdateFile)\n            logger.info(`LiteralPath: ${normlaizedUpdateFilePath}. Update Path: ${normalizedTempUpdateFile}`)\n            if (normlaizedUpdateFilePath !== normalizedTempUpdateFile) {\n              handleError(logger, new Error(`LiteralPath of ${normlaizedUpdateFilePath} is different than ${normalizedTempUpdateFile}`), stderr, reject)\n              resolve(null)\n              return\n            }\n          } catch (error: any) {\n            logger.warn(`Unable to verify LiteralPath of update asset due to missing data.Path. Skipping this step of validation. Message: ${error.message ?? error.stack}`)\n          }\n          const subject = parseDn(data.SignerCertificate.Subject)\n          let match = false\n          for (const name of publisherNames) {\n            const dn = parseDn(name)\n            if (dn.size) {\n              // if we have a full DN, compare all values\n              const allKeys = Array.from(dn.keys())\n              match = allKeys.every(key => {\n                return dn.get(key) === subject.get(key)\n              })\n            } else if (name === subject.get(\"CN\")!) {\n              logger.warn(`Signature validated using only CN ${name}. Please add your full Distinguished Name (DN) to publisherNames configuration`)\n              match = true\n            }\n            if (match) {\n              resolve(null)\n              return\n            }\n          }\n        }\n\n        const result = `publisherNames: ${publisherNames.join(\" | \")}, raw info: ` + JSON.stringify(data, (name, value) => (name === \"RawData\" ? undefined : value), 2)\n        logger.warn(`Sign verification failed, installer signed with incorrect certificate: ${result}`)\n        resolve(result)\n      } catch (e: any) {\n        handleError(logger, e, null, reject)\n        resolve(null)\n        return\n      }\n    })\n  })\n}\n\nfunction parseOut(out: string): any {\n  const data = JSON.parse(out)\n  delete data.PrivateKey\n  delete data.IsOSBinary\n  delete data.SignatureType\n  const signerCertificate = data.SignerCertificate\n  if (signerCertificate != null) {\n    delete signerCertificate.Archived\n    delete signerCertificate.Extensions\n    delete signerCertificate.Handle\n    delete signerCertificate.HasPrivateKey\n    // duplicates data.SignerCertificate (contains RawData)\n    delete signerCertificate.SubjectName\n  }\n  return data\n}\n\nfunction handleError(logger: Logger, error: Error | null, stderr: string | null, reject: (reason: any) => void): void {\n  if (isOldWin6()) {\n    logger.warn(\n      `Cannot execute Get-AuthenticodeSignature: ${error || stderr}. Ignoring signature validation due to unsupported powershell version. Please upgrade to powershell 3 or higher.`\n    )\n    return\n  }\n\n  try {\n    execFileSync(...preparePowerShellExec(\"ConvertTo-Json test\", 10 * 1000))\n  } catch (testError: any) {\n    logger.warn(\n      `Cannot execute ConvertTo-Json: ${testError.message}. Ignoring signature validation due to unsupported powershell version. Please upgrade to powershell 3 or higher.`\n    )\n    return\n  }\n\n  if (error != null) {\n    reject(error)\n  }\n\n  if (stderr) {\n    reject(new Error(`Cannot execute Get-AuthenticodeSignature, stderr: ${stderr}. Failing signature validation due to unknown stderr.`))\n  }\n}\n\nfunction isOldWin6(): boolean {\n  const winVersion = os.release()\n  return winVersion.startsWith(\"6.\") && !winVersion.startsWith(\"6.3\")\n}\n"]}{
  "name": "electron-updater",
  "version": "6.8.9",
  "description": "Cross platform updater for electron applications",
  "main": "out/main.js",
  "author": "Vladimir Krivosheev",
  "license": "MIT",
  "repository": {
    "type": "git",
    "url": "git+https://github.com/electron-userland/electron-builder.git",
    "directory": "packages/electron-updater"
  },
  "homepage": "https://github.com/electron-userland/electron-builder",
  "files": [
    "out"
  ],
  "dependencies": {
    "fs-extra": "^10.1.0",
    "js-yaml": "^4.1.0",
    "lazy-val": "^1.0.5",
    "lodash.escaperegexp": "^4.1.2",
    "lodash.isequal": "^4.5.0",
    "semver": "~7.7.3",
    "tiny-typed-emitter": "^2.1.0",
    "builder-util-runtime": "9.7.0"
  },
  "devDependencies": {
    "@types/fs-extra": "9.0.13",
    "@types/js-yaml": "4.0.3",
    "@types/lodash.escaperegexp": "4.1.6",
    "@types/lodash.isequal": "4.5.5",
    "@types/semver": "7.7.1",
    "electron": "39.8.5"
  },
  "typings": "./out/main.d.ts",
  "publishConfig": {
    "tag": "next"
  }
}(The MIT License)

Copyright (c) 2011-2017 JP Richardson

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files
(the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify,
 merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
 furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
 ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
'use strict'

const fs = require('graceful-fs')
const path = require('path')
const mkdirsSync = require('../mkdirs').mkdirsSync
const utimesMillisSync = require('../util/utimes').utimesMillisSync
const stat = require('../util/stat')

function copySync (src, dest, opts) {
  if (typeof opts === 'function') {
    opts = { filter: opts }
  }

  opts = opts || {}
  opts.clobber = 'clobber' in opts ? !!opts.clobber : true // default to true for now
  opts.overwrite = 'overwrite' in opts ? !!opts.overwrite : opts.clobber // overwrite falls back to clobber

  // Warn about using preserveTimestamps on 32-bit node
  if (opts.preserveTimestamps && process.arch === 'ia32') {
    process.emitWarning(
      'Using the preserveTimestamps option in 32-bit node is not recommended;\n\n' +
      '\tsee https://github.com/jprichardson/node-fs-extra/issues/269',
      'Warning', 'fs-extra-WARN0002'
    )
  }

  const { srcStat, destStat } = stat.checkPathsSync(src, dest, 'copy', opts)
  stat.checkParentPathsSync(src, srcStat, dest, 'copy')
  return handleFilterAndCopy(destStat, src, dest, opts)
}

function handleFilterAndCopy (destStat, src, dest, opts) {
  if (opts.filter && !opts.filter(src, dest)) return
  const destParent = path.dirname(dest)
  if (!fs.existsSync(destParent)) mkdirsSync(destParent)
  return getStats(destStat, src, dest, opts)
}

function startCopy (destStat, src, dest, opts) {
  if (opts.filter && !opts.filter(src, dest)) return
  return getStats(destStat, src, dest, opts)
}

function getStats (destStat, src, dest, opts) {
  const statSync = opts.dereference ? fs.statSync : fs.lstatSync
  const srcStat = statSync(src)

  if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts)
  else if (srcStat.isFile() ||
           srcStat.isCharacterDevice() ||
           srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts)
  else if (srcStat.isSymbolicLink()) return onLink(destStat, src, dest, opts)
  else if (srcStat.isSocket()) throw new Error(`Cannot copy a socket file: ${src}`)
  else if (srcStat.isFIFO()) throw new Error(`Cannot copy a FIFO pipe: ${src}`)
  throw new Error(`Unknown file: ${src}`)
}

function onFile (srcStat, destStat, src, dest, opts) {
  if (!destStat) return copyFile(srcStat, src, dest, opts)
  return mayCopyFile(srcStat, src, dest, opts)
}

function mayCopyFile (srcStat, src, dest, opts) {
  if (opts.overwrite) {
    fs.unlinkSync(dest)
    return copyFile(srcStat, src, dest, opts)
  } else if (opts.errorOnExist) {
    throw new Error(`'${dest}' already exists`)
  }
}

function copyFile (srcStat, src, dest, opts) {
  fs.copyFileSync(src, dest)
  if (opts.preserveTimestamps) handleTimestamps(srcStat.mode, src, dest)
  return setDestMode(dest, srcStat.mode)
}

function handleTimestamps (srcMode, src, dest) {
  // Make sure the file is writable before setting the timestamp
  // otherwise open fails with EPERM when invoked with 'r+'
  // (through utimes call)
  if (fileIsNotWritable(srcMode)) makeFileWritable(dest, srcMode)
  return setDestTimestamps(src, dest)
}

function fileIsNotWritable (srcMode) {
  return (srcMode & 0o200) === 0
}

function makeFileWritable (dest, srcMode) {
  return setDestMode(dest, srcMode | 0o200)
}

function setDestMode (dest, srcMode) {
  return fs.chmodSync(dest, srcMode)
}

function setDestTimestamps (src, dest) {
  // The initial srcStat.atime cannot be trusted
  // because it is modified by the read(2) system call
  // (See https://nodejs.org/api/fs.html#fs_stat_time_values)
  const updatedSrcStat = fs.statSync(src)
  return utimesMillisSync(dest, updatedSrcStat.atime, updatedSrcStat.mtime)
}

function onDir (srcStat, destStat, src, dest, opts) {
  if (!destStat) return mkDirAndCopy(srcStat.mode, src, dest, opts)
  return copyDir(src, dest, opts)
}

function mkDirAndCopy (srcMode, src, dest, opts) {
  fs.mkdirSync(dest)
  copyDir(src, dest, opts)
  return setDestMode(dest, srcMode)
}

function copyDir (src, dest, opts) {
  fs.readdirSync(src).forEach(item => copyDirItem(item, src, dest, opts))
}

function copyDirItem (item, src, dest, opts) {
  const srcItem = path.join(src, item)
  const destItem = path.join(dest, item)
  const { destStat } = stat.checkPathsSync(srcItem, destItem, 'copy', opts)
  return startCopy(destStat, srcItem, destItem, opts)
}

function onLink (destStat, src, dest, opts) {
  let resolvedSrc = fs.readlinkSync(src)
  if (opts.dereference) {
    resolvedSrc = path.resolve(process.cwd(), resolvedSrc)
  }

  if (!destStat) {
    return fs.symlinkSync(resolvedSrc, dest)
  } else {
    let resolvedDest
    try {
      resolvedDest = fs.readlinkSync(dest)
    } catch (err) {
      // dest exists and is a regular file or directory,
      // Windows may throw UNKNOWN error. If dest already exists,
      // fs throws error anyway, so no need to guard against it here.
      if (err.code === 'EINVAL' || err.code === 'UNKNOWN') return fs.symlinkSync(resolvedSrc, dest)
      throw err
    }
    if (opts.dereference) {
      resolvedDest = path.resolve(process.cwd(), resolvedDest)
    }
    if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {
      throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`)
    }

    // prevent copy if src is a subdir of dest since unlinking
    // dest in this case would result in removing src contents
    // and therefore a broken symlink would be created.
    if (fs.statSync(dest).isDirectory() && stat.isSrcSubdir(resolvedDest, resolvedSrc)) {
      throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`)
    }
    return copyLink(resolvedSrc, dest)
  }
}

function copyLink (resolvedSrc, dest) {
  fs.unlinkSync(dest)
  return fs.symlinkSync(resolvedSrc, dest)
}

module.exports = copySync
'use strict'

const fs = require('graceful-fs')
const path = require('path')
const mkdirs = require('../mkdirs').mkdirs
const pathExists = require('../path-exists').pathExists
const utimesMillis = require('../util/utimes').utimesMillis
const stat = require('../util/stat')

function copy (src, dest, opts, cb) {
  if (typeof opts === 'function' && !cb) {
    cb = opts
    opts = {}
  } else if (typeof opts === 'function') {
    opts = { filter: opts }
  }

  cb = cb || function () {}
  opts = opts || {}

  opts.clobber = 'clobber' in opts ? !!opts.clobber : true // default to true for now
  opts.overwrite = 'overwrite' in opts ? !!opts.overwrite : opts.clobber // overwrite falls back to clobber

  // Warn about using preserveTimestamps on 32-bit node
  if (opts.preserveTimestamps && process.arch === 'ia32') {
    process.emitWarning(
      'Using the preserveTimestamps option in 32-bit node is not recommended;\n\n' +
      '\tsee https://github.com/jprichardson/node-fs-extra/issues/269',
      'Warning', 'fs-extra-WARN0001'
    )
  }

  stat.checkPaths(src, dest, 'copy', opts, (err, stats) => {
    if (err) return cb(err)
    const { srcStat, destStat } = stats
    stat.checkParentPaths(src, srcStat, dest, 'copy', err => {
      if (err) return cb(err)
      if (opts.filter) return handleFilter(checkParentDir, destStat, src, dest, opts, cb)
      return checkParentDir(destStat, src, dest, opts, cb)
    })
  })
}

function checkParentDir (destStat, src, dest, opts, cb) {
  const destParent = path.dirname(dest)
  pathExists(destParent, (err, dirExists) => {
    if (err) return cb(err)
    if (dirExists) return getStats(destStat, src, dest, opts, cb)
    mkdirs(destParent, err => {
      if (err) return cb(err)
      return getStats(destStat, src, dest, opts, cb)
    })
  })
}

function handleFilter (onInclude, destStat, src, dest, opts, cb) {
  Promise.resolve(opts.filter(src, dest)).then(include => {
    if (include) return onInclude(destStat, src, dest, opts, cb)
    return cb()
  }, error => cb(error))
}

function startCopy (destStat, src, dest, opts, cb) {
  if (opts.filter) return handleFilter(getStats, destStat, src, dest, opts, cb)
  return getStats(destStat, src, dest, opts, cb)
}

function getStats (destStat, src, dest, opts, cb) {
  const stat = opts.dereference ? fs.stat : fs.lstat
  stat(src, (err, srcStat) => {
    if (err) return cb(err)

    if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts, cb)
    else if (srcStat.isFile() ||
             srcStat.isCharacterDevice() ||
             srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts, cb)
    else if (srcStat.isSymbolicLink()) return onLink(destStat, src, dest, opts, cb)
    else if (srcStat.isSocket()) return cb(new Error(`Cannot copy a socket file: ${src}`))
    else if (srcStat.isFIFO()) return cb(new Error(`Cannot copy a FIFO pipe: ${src}`))
    return cb(new Error(`Unknown file: ${src}`))
  })
}

function onFile (srcStat, destStat, src, dest, opts, cb) {
  if (!destStat) return copyFile(srcStat, src, dest, opts, cb)
  return mayCopyFile(srcStat, src, dest, opts, cb)
}

function mayCopyFile (srcStat, src, dest, opts, cb) {
  if (opts.overwrite) {
    fs.unlink(dest, err => {
      if (err) return cb(err)
      return copyFile(srcStat, src, dest, opts, cb)
    })
  } else if (opts.errorOnExist) {
    return cb(new Error(`'${dest}' already exists`))
  } else return cb()
}

function copyFile (srcStat, src, dest, opts, cb) {
  fs.copyFile(src, dest, err => {
    if (err) return cb(err)
    if (opts.preserveTimestamps) return handleTimestampsAndMode(srcStat.mode, src, dest, cb)
    return setDestMode(dest, srcStat.mode, cb)
  })
}

function handleTimestampsAndMode (srcMode, src, dest, cb) {
  // Make sure the file is writable before setting the timestamp
  // otherwise open fails with EPERM when invoked with 'r+'
  // (through utimes call)
  if (fileIsNotWritable(srcMode)) {
    return makeFileWritable(dest, srcMode, err => {
      if (err) return cb(err)
      return setDestTimestampsAndMode(srcMode, src, dest, cb)
    })
  }
  return setDestTimestampsAndMode(srcMode, src, dest, cb)
}

function fileIsNotWritable (srcMode) {
  return (srcMode & 0o200) === 0
}

function makeFileWritable (dest, srcMode, cb) {
  return setDestMode(dest, srcMode | 0o200, cb)
}

function setDestTimestampsAndMode (srcMode, src, dest, cb) {
  setDestTimestamps(src, dest, err => {
    if (err) return cb(err)
    return setDestMode(dest, srcMode, cb)
  })
}

function setDestMode (dest, srcMode, cb) {
  return fs.chmod(dest, srcMode, cb)
}

function setDestTimestamps (src, dest, cb) {
  // The initial srcStat.atime cannot be trusted
  // because it is modified by the read(2) system call
  // (See https://nodejs.org/api/fs.html#fs_stat_time_values)
  fs.stat(src, (err, updatedSrcStat) => {
    if (err) return cb(err)
    return utimesMillis(dest, updatedSrcStat.atime, updatedSrcStat.mtime, cb)
  })
}

function onDir (srcStat, destStat, src, dest, opts, cb) {
  if (!destStat) return mkDirAndCopy(srcStat.mode, src, dest, opts, cb)
  return copyDir(src, dest, opts, cb)
}

function mkDirAndCopy (srcMode, src, dest, opts, cb) {
  fs.mkdir(dest, err => {
    if (err) return cb(err)
    copyDir(src, dest, opts, err => {
      if (err) return cb(err)
      return setDestMode(dest, srcMode, cb)
    })
  })
}

function copyDir (src, dest, opts, cb) {
  fs.readdir(src, (err, items) => {
    if (err) return cb(err)
    return copyDirItems(items, src, dest, opts, cb)
  })
}

function copyDirItems (items, src, dest, opts, cb) {
  const item = items.pop()
  if (!item) return cb()
  return copyDirItem(items, item, src, dest, opts, cb)
}

function copyDirItem (items, item, src, dest, opts, cb) {
  const srcItem = path.join(src, item)
  const destItem = path.join(dest, item)
  stat.checkPaths(srcItem, destItem, 'copy', opts, (err, stats) => {
    if (err) return cb(err)
    const { destStat } = stats
    startCopy(destStat, srcItem, destItem, opts, err => {
      if (err) return cb(err)
      return copyDirItems(items, src, dest, opts, cb)
    })
  })
}

function onLink (destStat, src, dest, opts, cb) {
  fs.readlink(src, (err, resolvedSrc) => {
    if (err) return cb(err)
    if (opts.dereference) {
      resolvedSrc = path.resolve(process.cwd(), resolvedSrc)
    }

    if (!destStat) {
      return fs.symlink(resolvedSrc, dest, cb)
    } else {
      fs.readlink(dest, (err, resolvedDest) => {
        if (err) {
          // dest exists and is a regular file or directory,
          // Windows may throw UNKNOWN error. If dest already exists,
          // fs throws error anyway, so no need to guard against it here.
          if (err.code === 'EINVAL' || err.code === 'UNKNOWN') return fs.symlink(resolvedSrc, dest, cb)
          return cb(err)
        }
        if (opts.dereference) {
          resolvedDest = path.resolve(process.cwd(), resolvedDest)
        }
        if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {
          return cb(new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`))
        }

        // do not copy if src is a subdir of dest since unlinking
        // dest in this case would result in removing src contents
        // and therefore a broken symlink would be created.
        if (destStat.isDirectory() && stat.isSrcSubdir(resolvedDest, resolvedSrc)) {
          return cb(new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`))
        }
        return copyLink(resolvedSrc, dest, cb)
      })
    }
  })
}

function copyLink (resolvedSrc, dest, cb) {
  fs.unlink(dest, err => {
    if (err) return cb(err)
    return fs.symlink(resolvedSrc, dest, cb)
  })
}

module.exports = copy
'use strict'

const u = require('universalify').fromCallback
module.exports = {
  copy: u(require('./copy')),
  copySync: require('./copy-sync')
}
'use strict'

const u = require('universalify').fromPromise
const fs = require('../fs')
const path = require('path')
const mkdir = require('../mkdirs')
const remove = require('../remove')

const emptyDir = u(async function emptyDir (dir) {
  let items
  try {
    items = await fs.readdir(dir)
  } catch {
    return mkdir.mkdirs(dir)
  }

  return Promise.all(items.map(item => remove.remove(path.join(dir, item))))
})

function emptyDirSync (dir) {
  let items
  try {
    items = fs.readdirSync(dir)
  } catch {
    return mkdir.mkdirsSync(dir)
  }

  items.forEach(item => {
    item = path.join(dir, item)
    remove.removeSync(item)
  })
}

module.exports = {
  emptyDirSync,
  emptydirSync: emptyDirSync,
  emptyDir,
  emptydir: emptyDir
}
'use strict'

const u = require('universalify').fromCallback
const path = require('path')
const fs = require('graceful-fs')
const mkdir = require('../mkdirs')

function createFile (file, callback) {
  function makeFile () {
    fs.writeFile(file, '', err => {
      if (err) return callback(err)
      callback()
    })
  }

  fs.stat(file, (err, stats) => { // eslint-disable-line handle-callback-err
    if (!err && stats.isFile()) return callback()
    const dir = path.dirname(file)
    fs.stat(dir, (err, stats) => {
      if (err) {
        // if the directory doesn't exist, make it
        if (err.code === 'ENOENT') {
          return mkdir.mkdirs(dir, err => {
            if (err) return callback(err)
            makeFile()
          })
        }
        return callback(err)
      }

      if (stats.isDirectory()) makeFile()
      else {
        // parent is not a directory
        // This is just to cause an internal ENOTDIR error to be thrown
        fs.readdir(dir, err => {
          if (err) return callback(err)
        })
      }
    })
  })
}

function createFileSync (file) {
  let stats
  try {
    stats = fs.statSync(file)
  } catch {}
  if (stats && stats.isFile()) return

  const dir = path.dirname(file)
  try {
    if (!fs.statSync(dir).isDirectory()) {
      // parent is not a directory
      // This is just to cause an internal ENOTDIR error to be thrown
      fs.readdirSync(dir)
    }
  } catch (err) {
    // If the stat call above failed because the directory doesn't exist, create it
    if (err && err.code === 'ENOENT') mkdir.mkdirsSync(dir)
    else throw err
  }

  fs.writeFileSync(file, '')
}

module.exports = {
  createFile: u(createFile),
  createFileSync
}
'use strict'

const { createFile, createFileSync } = require('./file')
const { createLink, createLinkSync } = require('./link')
const { createSymlink, createSymlinkSync } = require('./symlink')

module.exports = {
  // file
  createFile,
  createFileSync,
  ensureFile: createFile,
  ensureFileSync: createFileSync,
  // link
  createLink,
  createLinkSync,
  ensureLink: createLink,
  ensureLinkSync: createLinkSync,
  // symlink
  createSymlink,
  createSymlinkSync,
  ensureSymlink: createSymlink,
  ensureSymlinkSync: createSymlinkSync
}
'use strict'

const u = require('universalify').fromCallback
const path = require('path')
const fs = require('graceful-fs')
const mkdir = require('../mkdirs')
const pathExists = require('../path-exists').pathExists
const { areIdentical } = require('../util/stat')

function createLink (srcpath, dstpath, callback) {
  function makeLink (srcpath, dstpath) {
    fs.link(srcpath, dstpath, err => {
      if (err) return callback(err)
      callback(null)
    })
  }

  fs.lstat(dstpath, (_, dstStat) => {
    fs.lstat(srcpath, (err, srcStat) => {
      if (err) {
        err.message = err.message.replace('lstat', 'ensureLink')
        return callback(err)
      }
      if (dstStat && areIdentical(srcStat, dstStat)) return callback(null)

      const dir = path.dirname(dstpath)
      pathExists(dir, (err, dirExists) => {
        if (err) return callback(err)
        if (dirExists) return makeLink(srcpath, dstpath)
        mkdir.mkdirs(dir, err => {
          if (err) return callback(err)
          makeLink(srcpath, dstpath)
        })
      })
    })
  })
}

function createLinkSync (srcpath, dstpath) {
  let dstStat
  try {
    dstStat = fs.lstatSync(dstpath)
  } catch {}

  try {
    const srcStat = fs.lstatSync(srcpath)
    if (dstStat && areIdentical(srcStat, dstStat)) return
  } catch (err) {
    err.message = err.message.replace('lstat', 'ensureLink')
    throw err
  }

  const dir = path.dirname(dstpath)
  const dirExists = fs.existsSync(dir)
  if (dirExists) return fs.linkSync(srcpath, dstpath)
  mkdir.mkdirsSync(dir)

  return fs.linkSync(srcpath, dstpath)
}

module.exports = {
  createLink: u(createLink),
  createLinkSync
}
'use strict'

const path = require('path')
const fs = require('graceful-fs')
const pathExists = require('../path-exists').pathExists

/**
 * Function that returns two types of paths, one relative to symlink, and one
 * relative to the current working directory. Checks if path is absolute or
 * relative. If the path is relative, this function checks if the path is
 * relative to symlink or relative to current working directory. This is an
 * initiative to find a smarter `srcpath` to supply when building symlinks.
 * This allows you to determine which path to use out of one of three possible
 * types of source paths. The first is an absolute path. This is detected by
 * `path.isAbsolute()`. When an absolute path is provided, it is checked to
 * see if it exists. If it does it's used, if not an error is returned
 * (callback)/ thrown (sync). The other two options for `srcpath` are a
 * relative url. By default Node's `fs.symlink` works by creating a symlink
 * using `dstpath` and expects the `srcpath` to be relative to the newly
 * created symlink. If you provide a `srcpath` that does not exist on the file
 * system it results in a broken symlink. To minimize this, the function
 * checks to see if the 'relative to symlink' source file exists, and if it
 * does it will use it. If it does not, it checks if there's a file that
 * exists that is relative to the current working directory, if does its used.
 * This preserves the expectations of the original fs.symlink spec and adds
 * the ability to pass in `relative to current working direcotry` paths.
 */

function symlinkPaths (srcpath, dstpath, callback) {
  if (path.isAbsolute(srcpath)) {
    return fs.lstat(srcpath, (err) => {
      if (err) {
        err.message = err.message.replace('lstat', 'ensureSymlink')
        return callback(err)
      }
      return callback(null, {
        toCwd: srcpath,
        toDst: srcpath
      })
    })
  } else {
    const dstdir = path.dirname(dstpath)
    const relativeToDst = path.join(dstdir, srcpath)
    return pathExists(relativeToDst, (err, exists) => {
      if (err) return callback(err)
      if (exists) {
        return callback(null, {
          toCwd: relativeToDst,
          toDst: srcpath
        })
      } else {
        return fs.lstat(srcpath, (err) => {
          if (err) {
            err.message = err.message.replace('lstat', 'ensureSymlink')
            return callback(err)
          }
          return callback(null, {
            toCwd: srcpath,
            toDst: path.relative(dstdir, srcpath)
          })
        })
      }
    })
  }
}

function symlinkPathsSync (srcpath, dstpath) {
  let exists
  if (path.isAbsolute(srcpath)) {
    exists = fs.existsSync(srcpath)
    if (!exists) throw new Error('absolute srcpath does not exist')
    return {
      toCwd: srcpath,
      toDst: srcpath
    }
  } else {
    const dstdir = path.dirname(dstpath)
    const relativeToDst = path.join(dstdir, srcpath)
    exists = fs.existsSync(relativeToDst)
    if (exists) {
      return {
        toCwd: relativeToDst,
        toDst: srcpath
      }
    } else {
      exists = fs.existsSync(srcpath)
      if (!exists) throw new Error('relative srcpath does not exist')
      return {
        toCwd: srcpath,
        toDst: path.relative(dstdir, srcpath)
      }
    }
  }
}

module.exports = {
  symlinkPaths,
  symlinkPathsSync
}
'use strict'

const fs = require('graceful-fs')

function symlinkType (srcpath, type, callback) {
  callback = (typeof type === 'function') ? type : callback
  type = (typeof type === 'function') ? false : type
  if (type) return callback(null, type)
  fs.lstat(srcpath, (err, stats) => {
    if (err) return callback(null, 'file')
    type = (stats && stats.isDirectory()) ? 'dir' : 'file'
    callback(null, type)
  })
}

function symlinkTypeSync (srcpath, type) {
  let stats

  if (type) return type
  try {
    stats = fs.lstatSync(srcpath)
  } catch {
    return 'file'
  }
  return (stats && stats.isDirectory()) ? 'dir' : 'file'
}

module.exports = {
  symlinkType,
  symlinkTypeSync
}
'use strict'

const u = require('universalify').fromCallback
const path = require('path')
const fs = require('../fs')
const _mkdirs = require('../mkdirs')
const mkdirs = _mkdirs.mkdirs
const mkdirsSync = _mkdirs.mkdirsSync

const _symlinkPaths = require('./symlink-paths')
const symlinkPaths = _symlinkPaths.symlinkPaths
const symlinkPathsSync = _symlinkPaths.symlinkPathsSync

const _symlinkType = require('./symlink-type')
const symlinkType = _symlinkType.symlinkType
const symlinkTypeSync = _symlinkType.symlinkTypeSync

const pathExists = require('../path-exists').pathExists

const { areIdentical } = require('../util/stat')

function createSymlink (srcpath, dstpath, type, callback) {
  callback = (typeof type === 'function') ? type : callback
  type = (typeof type === 'function') ? false : type

  fs.lstat(dstpath, (err, stats) => {
    if (!err && stats.isSymbolicLink()) {
      Promise.all([
        fs.stat(srcpath),
        fs.stat(dstpath)
      ]).then(([srcStat, dstStat]) => {
        if (areIdentical(srcStat, dstStat)) return callback(null)
        _createSymlink(srcpath, dstpath, type, callback)
      })
    } else _createSymlink(srcpath, dstpath, type, callback)
  })
}

function _createSymlink (srcpath, dstpath, type, callback) {
  symlinkPaths(srcpath, dstpath, (err, relative) => {
    if (err) return callback(err)
    srcpath = relative.toDst
    symlinkType(relative.toCwd, type, (err, type) => {
      if (err) return callback(err)
      const dir = path.dirname(dstpath)
      pathExists(dir, (err, dirExists) => {
        if (err) return callback(err)
        if (dirExists) return fs.symlink(srcpath, dstpath, type, callback)
        mkdirs(dir, err => {
          if (err) return callback(err)
          fs.symlink(srcpath, dstpath, type, callback)
        })
      })
    })
  })
}

function createSymlinkSync (srcpath, dstpath, type) {
  let stats
  try {
    stats = fs.lstatSync(dstpath)
  } catch {}
  if (stats && stats.isSymbolicLink()) {
    const srcStat = fs.statSync(srcpath)
    const dstStat = fs.statSync(dstpath)
    if (areIdentical(srcStat, dstStat)) return
  }

  const relative = symlinkPathsSync(srcpath, dstpath)
  srcpath = relative.toDst
  type = symlinkTypeSync(relative.toCwd, type)
  const dir = path.dirname(dstpath)
  const exists = fs.existsSync(dir)
  if (exists) return fs.symlinkSync(srcpath, dstpath, type)
  mkdirsSync(dir)
  return fs.symlinkSync(srcpath, dstpath, type)
}

module.exports = {
  createSymlink: u(createSymlink),
  createSymlinkSync
}
'use strict'
// This is adapted from https://github.com/normalize/mz
// Copyright (c) 2014-2016 Jonathan Ong me@jongleberry.com and Contributors
const u = require('universalify').fromCallback
const fs = require('graceful-fs')

const api = [
  'access',
  'appendFile',
  'chmod',
  'chown',
  'close',
  'copyFile',
  'fchmod',
  'fchown',
  'fdatasync',
  'fstat',
  'fsync',
  'ftruncate',
  'futimes',
  'lchmod',
  'lchown',
  'link',
  'lstat',
  'mkdir',
  'mkdtemp',
  'open',
  'opendir',
  'readdir',
  'readFile',
  'readlink',
  'realpath',
  'rename',
  'rm',
  'rmdir',
  'stat',
  'symlink',
  'truncate',
  'unlink',
  'utimes',
  'writeFile'
].filter(key => {
  // Some commands are not available on some systems. Ex:
  // fs.opendir was added in Node.js v12.12.0
  // fs.rm was added in Node.js v14.14.0
  // fs.lchown is not available on at least some Linux
  return typeof fs[key] === 'function'
})

// Export cloned fs:
Object.assign(exports, fs)

// Universalify async methods:
api.forEach(method => {
  exports[method] = u(fs[method])
})

// We differ from mz/fs in that we still ship the old, broken, fs.exists()
// since we are a drop-in replacement for the native module
exports.exists = function (filename, callback) {
  if (typeof callback === 'function') {
    return fs.exists(filename, callback)
  }
  return new Promise(resolve => {
    return fs.exists(filename, resolve)
  })
}

// fs.read(), fs.write(), & fs.writev() need special treatment due to multiple callback args

exports.read = function (fd, buffer, offset, length, position, callback) {
  if (typeof callback === 'function') {
    return fs.read(fd, buffer, offset, length, position, callback)
  }
  return new Promise((resolve, reject) => {
    fs.read(fd, buffer, offset, length, position, (err, bytesRead, buffer) => {
      if (err) return reject(err)
      resolve({ bytesRead, buffer })
    })
  })
}

// Function signature can be
// fs.write(fd, buffer[, offset[, length[, position]]], callback)
// OR
// fs.write(fd, string[, position[, encoding]], callback)
// We need to handle both cases, so we use ...args
exports.write = function (fd, buffer, ...args) {
  if (typeof args[args.length - 1] === 'function') {
    return fs.write(fd, buffer, ...args)
  }

  return new Promise((resolve, reject) => {
    fs.write(fd, buffer, ...args, (err, bytesWritten, buffer) => {
      if (err) return reject(err)
      resolve({ bytesWritten, buffer })
    })
  })
}

// fs.writev only available in Node v12.9.0+
if (typeof fs.writev === 'function') {
  // Function signature is
  // s.writev(fd, buffers[, position], callback)
  // We need to handle the optional arg, so we use ...args
  exports.writev = function (fd, buffers, ...args) {
    if (typeof args[args.length - 1] === 'function') {
      return fs.writev(fd, buffers, ...args)
    }

    return new Promise((resolve, reject) => {
      fs.writev(fd, buffers, ...args, (err, bytesWritten, buffers) => {
        if (err) return reject(err)
        resolve({ bytesWritten, buffers })
      })
    })
  }
}

// fs.realpath.native sometimes not available if fs is monkey-patched
if (typeof fs.realpath.native === 'function') {
  exports.realpath.native = u(fs.realpath.native)
} else {
  process.emitWarning(
    'fs.realpath.native is not a function. Is fs being monkey-patched?',
    'Warning', 'fs-extra-WARN0003'
  )
}
'use strict'

module.exports = {
  // Export promiseified graceful-fs:
  ...require('./fs'),
  // Export extra methods:
  ...require('./copy'),
  ...require('./empty'),
  ...require('./ensure'),
  ...require('./json'),
  ...require('./mkdirs'),
  ...require('./move'),
  ...require('./output-file'),
  ...require('./path-exists'),
  ...require('./remove')
}
'use strict'

const u = require('universalify').fromPromise
const jsonFile = require('./jsonfile')

jsonFile.outputJson = u(require('./output-json'))
jsonFile.outputJsonSync = require('./output-json-sync')
// aliases
jsonFile.outputJSON = jsonFile.outputJson
jsonFile.outputJSONSync = jsonFile.outputJsonSync
jsonFile.writeJSON = jsonFile.writeJson
jsonFile.writeJSONSync = jsonFile.writeJsonSync
jsonFile.readJSON = jsonFile.readJson
jsonFile.readJSONSync = jsonFile.readJsonSync

module.exports = jsonFile
'use strict'

const jsonFile = require('jsonfile')

module.exports = {
  // jsonfile exports
  readJson: jsonFile.readFile,
  readJsonSync: jsonFile.readFileSync,
  writeJson: jsonFile.writeFile,
  writeJsonSync: jsonFile.writeFileSync
}
'use strict'

const { stringify } = require('jsonfile/utils')
const { outputFileSync } = require('../output-file')

function outputJsonSync (file, data, options) {
  const str = stringify(data, options)

  outputFileSync(file, str, options)
}

module.exports = outputJsonSync
'use strict'

const { stringify } = require('jsonfile/utils')
const { outputFile } = require('../output-file')

async function outputJson (file, data, options = {}) {
  const str = stringify(data, options)

  await outputFile(file, str, options)
}

module.exports = outputJson
'use strict'
const u = require('universalify').fromPromise
const { makeDir: _makeDir, makeDirSync } = require('./make-dir')
const makeDir = u(_makeDir)

module.exports = {
  mkdirs: makeDir,
  mkdirsSync: makeDirSync,
  // alias
  mkdirp: makeDir,
  mkdirpSync: makeDirSync,
  ensureDir: makeDir,
  ensureDirSync: makeDirSync
}
'use strict'
const fs = require('../fs')
const { checkPath } = require('./utils')

const getMode = options => {
  const defaults = { mode: 0o777 }
  if (typeof options === 'number') return options
  return ({ ...defaults, ...options }).mode
}

module.exports.makeDir = async (dir, options) => {
  checkPath(dir)

  return fs.mkdir(dir, {
    mode: getMode(options),
    recursive: true
  })
}

module.exports.makeDirSync = (dir, options) => {
  checkPath(dir)

  return fs.mkdirSync(dir, {
    mode: getMode(options),
    recursive: true
  })
}
// Adapted from https://github.com/sindresorhus/make-dir
// Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
'use strict'
const path = require('path')

// https://github.com/nodejs/node/issues/8987
// https://github.com/libuv/libuv/pull/1088
module.exports.checkPath = function checkPath (pth) {
  if (process.platform === 'win32') {
    const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path.parse(pth).root, ''))

    if (pathHasInvalidWinCharacters) {
      const error = new Error(`Path contains invalid characters: ${pth}`)
      error.code = 'EINVAL'
      throw error
    }
  }
}
'use strict'

const u = require('universalify').fromCallback
module.exports = {
  move: u(require('./move')),
  moveSync: require('./move-sync')
}
'use strict'

const fs = require('graceful-fs')
const path = require('path')
const copySync = require('../copy').copySync
const removeSync = require('../remove').removeSync
const mkdirpSync = require('../mkdirs').mkdirpSync
const stat = require('../util/stat')

function moveSync (src, dest, opts) {
  opts = opts || {}
  const overwrite = opts.overwrite || opts.clobber || false

  const { srcStat, isChangingCase = false } = stat.checkPathsSync(src, dest, 'move', opts)
  stat.checkParentPathsSync(src, srcStat, dest, 'move')
  if (!isParentRoot(dest)) mkdirpSync(path.dirname(dest))
  return doRename(src, dest, overwrite, isChangingCase)
}

function isParentRoot (dest) {
  const parent = path.dirname(dest)
  const parsedPath = path.parse(parent)
  return parsedPath.root === parent
}

function doRename (src, dest, overwrite, isChangingCase) {
  if (isChangingCase) return rename(src, dest, overwrite)
  if (overwrite) {
    removeSync(dest)
    return rename(src, dest, overwrite)
  }
  if (fs.existsSync(dest)) throw new Error('dest already exists.')
  return rename(src, dest, overwrite)
}

function rename (src, dest, overwrite) {
  try {
    fs.renameSync(src, dest)
  } catch (err) {
    if (err.code !== 'EXDEV') throw err
    return moveAcrossDevice(src, dest, overwrite)
  }
}

function moveAcrossDevice (src, dest, overwrite) {
  const opts = {
    overwrite,
    errorOnExist: true
  }
  copySync(src, dest, opts)
  return removeSync(src)
}

module.exports = moveSync
'use strict'

const fs = require('graceful-fs')
const path = require('path')
const copy = require('../copy').copy
const remove = require('../remove').remove
const mkdirp = require('../mkdirs').mkdirp
const pathExists = require('../path-exists').pathExists
const stat = require('../util/stat')

function move (src, dest, opts, cb) {
  if (typeof opts === 'function') {
    cb = opts
    opts = {}
  }

  opts = opts || {}

  const overwrite = opts.overwrite || opts.clobber || false

  stat.checkPaths(src, dest, 'move', opts, (err, stats) => {
    if (err) return cb(err)
    const { srcStat, isChangingCase = false } = stats
    stat.checkParentPaths(src, srcStat, dest, 'move', err => {
      if (err) return cb(err)
      if (isParentRoot(dest)) return doRename(src, dest, overwrite, isChangingCase, cb)
      mkdirp(path.dirname(dest), err => {
        if (err) return cb(err)
        return doRename(src, dest, overwrite, isChangingCase, cb)
      })
    })
  })
}

function isParentRoot (dest) {
  const parent = path.dirname(dest)
  const parsedPath = path.parse(parent)
  return parsedPath.root === parent
}

function doRename (src, dest, overwrite, isChangingCase, cb) {
  if (isChangingCase) return rename(src, dest, overwrite, cb)
  if (overwrite) {
    return remove(dest, err => {
      if (err) return cb(err)
      return rename(src, dest, overwrite, cb)
    })
  }
  pathExists(dest, (err, destExists) => {
    if (err) return cb(err)
    if (destExists) return cb(new Error('dest already exists.'))
    return rename(src, dest, overwrite, cb)
  })
}

function rename (src, dest, overwrite, cb) {
  fs.rename(src, dest, err => {
    if (!err) return cb()
    if (err.code !== 'EXDEV') return cb(err)
    return moveAcrossDevice(src, dest, overwrite, cb)
  })
}

function moveAcrossDevice (src, dest, overwrite, cb) {
  const opts = {
    overwrite,
    errorOnExist: true
  }
  copy(src, dest, opts, err => {
    if (err) return cb(err)
    return remove(src, cb)
  })
}

module.exports = move
'use strict'

const u = require('universalify').fromCallback
const fs = require('graceful-fs')
const path = require('path')
const mkdir = require('../mkdirs')
const pathExists = require('../path-exists').pathExists

function outputFile (file, data, encoding, callback) {
  if (typeof encoding === 'function') {
    callback = encoding
    encoding = 'utf8'
  }

  const dir = path.dirname(file)
  pathExists(dir, (err, itDoes) => {
    if (err) return callback(err)
    if (itDoes) return fs.writeFile(file, data, encoding, callback)

    mkdir.mkdirs(dir, err => {
      if (err) return callback(err)

      fs.writeFile(file, data, encoding, callback)
    })
  })
}

function outputFileSync (file, ...args) {
  const dir = path.dirname(file)
  if (fs.existsSync(dir)) {
    return fs.writeFileSync(file, ...args)
  }
  mkdir.mkdirsSync(dir)
  fs.writeFileSync(file, ...args)
}

module.exports = {
  outputFile: u(outputFile),
  outputFileSync
}
'use strict'
const u = require('universalify').fromPromise
const fs = require('../fs')

function pathExists (path) {
  return fs.access(path).then(() => true).catch(() => false)
}

module.exports = {
  pathExists: u(pathExists),
  pathExistsSync: fs.existsSync
}
'use strict'

const fs = require('graceful-fs')
const u = require('universalify').fromCallback
const rimraf = require('./rimraf')

function remove (path, callback) {
  // Node 14.14.0+
  if (fs.rm) return fs.rm(path, { recursive: true, force: true }, callback)
  rimraf(path, callback)
}

function removeSync (path) {
  // Node 14.14.0+
  if (fs.rmSync) return fs.rmSync(path, { recursive: true, force: true })
  rimraf.sync(path)
}

module.exports = {
  remove: u(remove),
  removeSync
}
'use strict'

const fs = require('graceful-fs')
const path = require('path')
const assert = require('assert')

const isWindows = (process.platform === 'win32')

function defaults (options) {
  const methods = [
    'unlink',
    'chmod',
    'stat',
    'lstat',
    'rmdir',
    'readdir'
  ]
  methods.forEach(m => {
    options[m] = options[m] || fs[m]
    m = m + 'Sync'
    options[m] = options[m] || fs[m]
  })

  options.maxBusyTries = options.maxBusyTries || 3
}

function rimraf (p, options, cb) {
  let busyTries = 0

  if (typeof options === 'function') {
    cb = options
    options = {}
  }

  assert(p, 'rimraf: missing path')
  assert.strictEqual(typeof p, 'string', 'rimraf: path should be a string')
  assert.strictEqual(typeof cb, 'function', 'rimraf: callback function required')
  assert(options, 'rimraf: invalid options argument provided')
  assert.strictEqual(typeof options, 'object', 'rimraf: options should be object')

  defaults(options)

  rimraf_(p, options, function CB (er) {
    if (er) {
      if ((er.code === 'EBUSY' || er.code === 'ENOTEMPTY' || er.code === 'EPERM') &&
          busyTries < options.maxBusyTries) {
        busyTries++
        const time = busyTries * 100
        // try again, with the same exact callback as this one.
        return setTimeout(() => rimraf_(p, options, CB), time)
      }

      // already gone
      if (er.code === 'ENOENT') er = null
    }

    cb(er)
  })
}

// Two possible strategies.
// 1. Assume it's a file.  unlink it, then do the dir stuff on EPERM or EISDIR
// 2. Assume it's a directory.  readdir, then do the file stuff on ENOTDIR
//
// Both result in an extra syscall when you guess wrong.  However, there
// are likely far more normal files in the world than directories.  This
// is based on the assumption that a the average number of files per
// directory is >= 1.
//
// If anyone ever complains about this, then I guess the strategy could
// be made configurable somehow.  But until then, YAGNI.
function rimraf_ (p, options, cb) {
  assert(p)
  assert(options)
  assert(typeof cb === 'function')

  // sunos lets the root user unlink directories, which is... weird.
  // so we have to lstat here and make sure it's not a dir.
  options.lstat(p, (er, st) => {
    if (er && er.code === 'ENOENT') {
      return cb(null)
    }

    // Windows can EPERM on stat.  Life is suffering.
    if (er && er.code === 'EPERM' && isWindows) {
      return fixWinEPERM(p, options, er, cb)
    }

    if (st && st.isDirectory()) {
      return rmdir(p, options, er, cb)
    }

    options.unlink(p, er => {
      if (er) {
        if (er.code === 'ENOENT') {
          return cb(null)
        }
        if (er.code === 'EPERM') {
          return (isWindows)
            ? fixWinEPERM(p, options, er, cb)
            : rmdir(p, options, er, cb)
        }
        if (er.code === 'EISDIR') {
          return rmdir(p, options, er, cb)
        }
      }
      return cb(er)
    })
  })
}

function fixWinEPERM (p, options, er, cb) {
  assert(p)
  assert(options)
  assert(typeof cb === 'function')

  options.chmod(p, 0o666, er2 => {
    if (er2) {
      cb(er2.code === 'ENOENT' ? null : er)
    } else {
      options.stat(p, (er3, stats) => {
        if (er3) {
          cb(er3.code === 'ENOENT' ? null : er)
        } else if (stats.isDirectory()) {
          rmdir(p, options, er, cb)
        } else {
          options.unlink(p, cb)
        }
      })
    }
  })
}

function fixWinEPERMSync (p, options, er) {
  let stats

  assert(p)
  assert(options)

  try {
    options.chmodSync(p, 0o666)
  } catch (er2) {
    if (er2.code === 'ENOENT') {
      return
    } else {
      throw er
    }
  }

  try {
    stats = options.statSync(p)
  } catch (er3) {
    if (er3.code === 'ENOENT') {
      return
    } else {
      throw er
    }
  }

  if (stats.isDirectory()) {
    rmdirSync(p, options, er)
  } else {
    options.unlinkSync(p)
  }
}

function rmdir (p, options, originalEr, cb) {
  assert(p)
  assert(options)
  assert(typeof cb === 'function')

  // try to rmdir first, and only readdir on ENOTEMPTY or EEXIST (SunOS)
  // if we guessed wrong, and it's not a directory, then
  // raise the original error.
  options.rmdir(p, er => {
    if (er && (er.code === 'ENOTEMPTY' || er.code === 'EEXIST' || er.code === 'EPERM')) {
      rmkids(p, options, cb)
    } else if (er && er.code === 'ENOTDIR') {
      cb(originalEr)
    } else {
      cb(er)
    }
  })
}

function rmkids (p, options, cb) {
  assert(p)
  assert(options)
  assert(typeof cb === 'function')

  options.readdir(p, (er, files) => {
    if (er) return cb(er)

    let n = files.length
    let errState

    if (n === 0) return options.rmdir(p, cb)

    files.forEach(f => {
      rimraf(path.join(p, f), options, er => {
        if (errState) {
          return
        }
        if (er) return cb(errState = er)
        if (--n === 0) {
          options.rmdir(p, cb)
        }
      })
    })
  })
}

// this looks simpler, and is strictly *faster*, but will
// tie up the JavaScript thread and fail on excessively
// deep directory trees.
function rimrafSync (p, options) {
  let st

  options = options || {}
  defaults(options)

  assert(p, 'rimraf: missing path')
  assert.strictEqual(typeof p, 'string', 'rimraf: path should be a string')
  assert(options, 'rimraf: missing options')
  assert.strictEqual(typeof options, 'object', 'rimraf: options should be object')

  try {
    st = options.lstatSync(p)
  } catch (er) {
    if (er.code === 'ENOENT') {
      return
    }

    // Windows can EPERM on stat.  Life is suffering.
    if (er.code === 'EPERM' && isWindows) {
      fixWinEPERMSync(p, options, er)
    }
  }

  try {
    // sunos lets the root user unlink directories, which is... weird.
    if (st && st.isDirectory()) {
      rmdirSync(p, options, null)
    } else {
      options.unlinkSync(p)
    }
  } catch (er) {
    if (er.code === 'ENOENT') {
      return
    } else if (er.code === 'EPERM') {
      return isWindows ? fixWinEPERMSync(p, options, er) : rmdirSync(p, options, er)
    } else if (er.code !== 'EISDIR') {
      throw er
    }
    rmdirSync(p, options, er)
  }
}

function rmdirSync (p, options, originalEr) {
  assert(p)
  assert(options)

  try {
    options.rmdirSync(p)
  } catch (er) {
    if (er.code === 'ENOTDIR') {
      throw originalEr
    } else if (er.code === 'ENOTEMPTY' || er.code === 'EEXIST' || er.code === 'EPERM') {
      rmkidsSync(p, options)
    } else if (er.code !== 'ENOENT') {
      throw er
    }
  }
}

function rmkidsSync (p, options) {
  assert(p)
  assert(options)
  options.readdirSync(p).forEach(f => rimrafSync(path.join(p, f), options))

  if (isWindows) {
    // We only end up here once we got ENOTEMPTY at least once, and
    // at this point, we are guaranteed to have removed all the kids.
    // So, we know that it won't be ENOENT or ENOTDIR or anything else.
    // try really hard to delete stuff on windows, because it has a
    // PROFOUNDLY annoying habit of not closing handles promptly when
    // files are deleted, resulting in spurious ENOTEMPTY errors.
    const startTime = Date.now()
    do {
      try {
        const ret = options.rmdirSync(p, options)
        return ret
      } catch {}
    } while (Date.now() - startTime < 500) // give up after 500ms
  } else {
    const ret = options.rmdirSync(p, options)
    return ret
  }
}

module.exports = rimraf
rimraf.sync = rimrafSync
'use strict'

const fs = require('../fs')
const path = require('path')
const util = require('util')

function getStats (src, dest, opts) {
  const statFunc = opts.dereference
    ? (file) => fs.stat(file, { bigint: true })
    : (file) => fs.lstat(file, { bigint: true })
  return Promise.all([
    statFunc(src),
    statFunc(dest).catch(err => {
      if (err.code === 'ENOENT') return null
      throw err
    })
  ]).then(([srcStat, destStat]) => ({ srcStat, destStat }))
}

function getStatsSync (src, dest, opts) {
  let destStat
  const statFunc = opts.dereference
    ? (file) => fs.statSync(file, { bigint: true })
    : (file) => fs.lstatSync(file, { bigint: true })
  const srcStat = statFunc(src)
  try {
    destStat = statFunc(dest)
  } catch (err) {
    if (err.code === 'ENOENT') return { srcStat, destStat: null }
    throw err
  }
  return { srcStat, destStat }
}

function checkPaths (src, dest, funcName, opts, cb) {
  util.callbackify(getStats)(src, dest, opts, (err, stats) => {
    if (err) return cb(err)
    const { srcStat, destStat } = stats

    if (destStat) {
      if (areIdentical(srcStat, destStat)) {
        const srcBaseName = path.basename(src)
        const destBaseName = path.basename(dest)
        if (funcName === 'move' &&
          srcBaseName !== destBaseName &&
          srcBaseName.toLowerCase() === destBaseName.toLowerCase()) {
          return cb(null, { srcStat, destStat, isChangingCase: true })
        }
        return cb(new Error('Source and destination must not be the same.'))
      }
      if (srcStat.isDirectory() && !destStat.isDirectory()) {
        return cb(new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`))
      }
      if (!srcStat.isDirectory() && destStat.isDirectory()) {
        return cb(new Error(`Cannot overwrite directory '${dest}' with non-directory '${src}'.`))
      }
    }

    if (srcStat.isDirectory() && isSrcSubdir(src, dest)) {
      return cb(new Error(errMsg(src, dest, funcName)))
    }
    return cb(null, { srcStat, destStat })
  })
}

function checkPathsSync (src, dest, funcName, opts) {
  const { srcStat, destStat } = getStatsSync(src, dest, opts)

  if (destStat) {
    if (areIdentical(srcStat, destStat)) {
      const srcBaseName = path.basename(src)
      const destBaseName = path.basename(dest)
      if (funcName === 'move' &&
        srcBaseName !== destBaseName &&
        srcBaseName.toLowerCase() === destBaseName.toLowerCase()) {
        return { srcStat, destStat, isChangingCase: true }
      }
      throw new Error('Source and destination must not be the same.')
    }
    if (srcStat.isDirectory() && !destStat.isDirectory()) {
      throw new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`)
    }
    if (!srcStat.isDirectory() && destStat.isDirectory()) {
      throw new Error(`Cannot overwrite directory '${dest}' with non-directory '${src}'.`)
    }
  }

  if (srcStat.isDirectory() && isSrcSubdir(src, dest)) {
    throw new Error(errMsg(src, dest, funcName))
  }
  return { srcStat, destStat }
}

// recursively check if dest parent is a subdirectory of src.
// It works for all file types including symlinks since it
// checks the src and dest inodes. It starts from the deepest
// parent and stops once it reaches the src parent or the root path.
function checkParentPaths (src, srcStat, dest, funcName, cb) {
  const srcParent = path.resolve(path.dirname(src))
  const destParent = path.resolve(path.dirname(dest))
  if (destParent === srcParent || destParent === path.parse(destParent).root) return cb()
  fs.stat(destParent, { bigint: true }, (err, destStat) => {
    if (err) {
      if (err.code === 'ENOENT') return cb()
      return cb(err)
    }
    if (areIdentical(srcStat, destStat)) {
      return cb(new Error(errMsg(src, dest, funcName)))
    }
    return checkParentPaths(src, srcStat, destParent, funcName, cb)
  })
}

function checkParentPathsSync (src, srcStat, dest, funcName) {
  const srcParent = path.resolve(path.dirname(src))
  const destParent = path.resolve(path.dirname(dest))
  if (destParent === srcParent || destParent === path.parse(destParent).root) return
  let destStat
  try {
    destStat = fs.statSync(destParent, { bigint: true })
  } catch (err) {
    if (err.code === 'ENOENT') return
    throw err
  }
  if (areIdentical(srcStat, destStat)) {
    throw new Error(errMsg(src, dest, funcName))
  }
  return checkParentPathsSync(src, srcStat, destParent, funcName)
}

function areIdentical (srcStat, destStat) {
  return destStat.ino && destStat.dev && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev
}

// return true if dest is a subdir of src, otherwise false.
// It only checks the path strings.
function isSrcSubdir (src, dest) {
  const srcArr = path.resolve(src).split(path.sep).filter(i => i)
  const destArr = path.resolve(dest).split(path.sep).filter(i => i)
  return srcArr.reduce((acc, cur, i) => acc && destArr[i] === cur, true)
}

function errMsg (src, dest, funcName) {
  return `Cannot ${funcName} '${src}' to a subdirectory of itself, '${dest}'.`
}

module.exports = {
  checkPaths,
  checkPathsSync,
  checkParentPaths,
  checkParentPathsSync,
  isSrcSubdir,
  areIdentical
}
'use strict'

const fs = require('graceful-fs')

function utimesMillis (path, atime, mtime, callback) {
  // if (!HAS_MILLIS_RES) return fs.utimes(path, atime, mtime, callback)
  fs.open(path, 'r+', (err, fd) => {
    if (err) return callback(err)
    fs.futimes(fd, atime, mtime, futimesErr => {
      fs.close(fd, closeErr => {
        if (callback) callback(futimesErr || closeErr)
      })
    })
  })
}

function utimesMillisSync (path, atime, mtime) {
  const fd = fs.openSync(path, 'r+')
  fs.futimesSync(fd, atime, mtime)
  return fs.closeSync(fd)
}

module.exports = {
  utimesMillis,
  utimesMillisSync
}
{
  "name": "fs-extra",
  "version": "10.1.0",
  "description": "fs-extra contains methods that aren't included in the vanilla Node.js fs package. Such as recursive mkdir, copy, and remove.",
  "engines": {
    "node": ">=12"
  },
  "homepage": "https://github.com/jprichardson/node-fs-extra",
  "repository": {
    "type": "git",
    "url": "https://github.com/jprichardson/node-fs-extra"
  },
  "author": "JP Richardson <jprichardson@gmail.com>",
  "license": "MIT",
  "dependencies": {
    "graceful-fs": "^4.2.0",
    "jsonfile": "^6.0.1",
    "universalify": "^2.0.0"
  },
  "devDependencies": {
    "at-least-node": "^1.0.0",
    "klaw": "^2.1.1",
    "klaw-sync": "^3.0.2",
    "minimist": "^1.1.1",
    "mocha": "^5.0.5",
    "nyc": "^15.0.0",
    "proxyquire": "^2.0.1",
    "read-dir-files": "^0.1.1",
    "standard": "^16.0.3"
  },
  "main": "./lib/index.js",
  "files": [
    "lib/",
    "!lib/**/__tests__/"
  ],
  "sideEffects": false
}The ISC License

Copyright (c) 2011-2022 Isaac Z. Schlueter, Ben Noordhuis, and Contributors

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
'use strict'

module.exports = clone

var getPrototypeOf = Object.getPrototypeOf || function (obj) {
  return obj.__proto__
}

function clone (obj) {
  if (obj === null || typeof obj !== 'object')
    return obj

  if (obj instanceof Object)
    var copy = { __proto__: getPrototypeOf(obj) }
  else
    var copy = Object.create(null)

  Object.getOwnPropertyNames(obj).forEach(function (key) {
    Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key))
  })

  return copy
}
var fs = require('fs')
var polyfills = require('./polyfills.js')
var legacy = require('./legacy-streams.js')
var clone = require('./clone.js')

var util = require('util')

/* istanbul ignore next - node 0.x polyfill */
var gracefulQueue
var previousSymbol

/* istanbul ignore else - node 0.x polyfill */
if (typeof Symbol === 'function' && typeof Symbol.for === 'function') {
  gracefulQueue = Symbol.for('graceful-fs.queue')
  // This is used in testing by future versions
  previousSymbol = Symbol.for('graceful-fs.previous')
} else {
  gracefulQueue = '___graceful-fs.queue'
  previousSymbol = '___graceful-fs.previous'
}

function noop () {}

function publishQueue(context, queue) {
  Object.defineProperty(context, gracefulQueue, {
    get: function() {
      return queue
    }
  })
}

var debug = noop
if (util.debuglog)
  debug = util.debuglog('gfs4')
else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || ''))
  debug = function() {
    var m = util.format.apply(util, arguments)
    m = 'GFS4: ' + m.split(/\n/).join('\nGFS4: ')
    console.error(m)
  }

// Once time initialization
if (!fs[gracefulQueue]) {
  // This queue can be shared by multiple loaded instances
  var queue = global[gracefulQueue] || []
  publishQueue(fs, queue)

  // Patch fs.close/closeSync to shared queue version, because we need
  // to retry() whenever a close happens *anywhere* in the program.
  // This is essential when multiple graceful-fs instances are
  // in play at the same time.
  fs.close = (function (fs$close) {
    function close (fd, cb) {
      return fs$close.call(fs, fd, function (err) {
        // This function uses the graceful-fs shared queue
        if (!err) {
          resetQueue()
        }

        if (typeof cb === 'function')
          cb.apply(this, arguments)
      })
    }

    Object.defineProperty(close, previousSymbol, {
      value: fs$close
    })
    return close
  })(fs.close)

  fs.closeSync = (function (fs$closeSync) {
    function closeSync (fd) {
      // This function uses the graceful-fs shared queue
      fs$closeSync.apply(fs, arguments)
      resetQueue()
    }

    Object.defineProperty(closeSync, previousSymbol, {
      value: fs$closeSync
    })
    return closeSync
  })(fs.closeSync)

  if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || '')) {
    process.on('exit', function() {
      debug(fs[gracefulQueue])
      require('assert').equal(fs[gracefulQueue].length, 0)
    })
  }
}

if (!global[gracefulQueue]) {
  publishQueue(global, fs[gracefulQueue]);
}

module.exports = patch(clone(fs))
if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs.__patched) {
    module.exports = patch(fs)
    fs.__patched = true;
}

function patch (fs) {
  // Everything that references the open() function needs to be in here
  polyfills(fs)
  fs.gracefulify = patch

  fs.createReadStream = createReadStream
  fs.createWriteStream = createWriteStream
  var fs$readFile = fs.readFile
  fs.readFile = readFile
  function readFile (path, options, cb) {
    if (typeof options === 'function')
      cb = options, options = null

    return go$readFile(path, options, cb)

    function go$readFile (path, options, cb, startTime) {
      return fs$readFile(path, options, function (err) {
        if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))
          enqueue([go$readFile, [path, options, cb], err, startTime || Date.now(), Date.now()])
        else {
          if (typeof cb === 'function')
            cb.apply(this, arguments)
        }
      })
    }
  }

  var fs$writeFile = fs.writeFile
  fs.writeFile = writeFile
  function writeFile (path, data, options, cb) {
    if (typeof options === 'function')
      cb = options, options = null

    return go$writeFile(path, data, options, cb)

    function go$writeFile (path, data, options, cb, startTime) {
      return fs$writeFile(path, data, options, function (err) {
        if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))
          enqueue([go$writeFile, [path, data, options, cb], err, startTime || Date.now(), Date.now()])
        else {
          if (typeof cb === 'function')
            cb.apply(this, arguments)
        }
      })
    }
  }

  var fs$appendFile = fs.appendFile
  if (fs$appendFile)
    fs.appendFile = appendFile
  function appendFile (path, data, options, cb) {
    if (typeof options === 'function')
      cb = options, options = null

    return go$appendFile(path, data, options, cb)

    function go$appendFile (path, data, options, cb, startTime) {
      return fs$appendFile(path, data, options, function (err) {
        if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))
          enqueue([go$appendFile, [path, data, options, cb], err, startTime || Date.now(), Date.now()])
        else {
          if (typeof cb === 'function')
            cb.apply(this, arguments)
        }
      })
    }
  }

  var fs$copyFile = fs.copyFile
  if (fs$copyFile)
    fs.copyFile = copyFile
  function copyFile (src, dest, flags, cb) {
    if (typeof flags === 'function') {
      cb = flags
      flags = 0
    }
    return go$copyFile(src, dest, flags, cb)

    function go$copyFile (src, dest, flags, cb, startTime) {
      return fs$copyFile(src, dest, flags, function (err) {
        if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))
          enqueue([go$copyFile, [src, dest, flags, cb], err, startTime || Date.now(), Date.now()])
        else {
          if (typeof cb === 'function')
            cb.apply(this, arguments)
        }
      })
    }
  }

  var fs$readdir = fs.readdir
  fs.readdir = readdir
  var noReaddirOptionVersions = /^v[0-5]\./
  function readdir (path, options, cb) {
    if (typeof options === 'function')
      cb = options, options = null

    var go$readdir = noReaddirOptionVersions.test(process.version)
      ? function go$readdir (path, options, cb, startTime) {
        return fs$readdir(path, fs$readdirCallback(
          path, options, cb, startTime
        ))
      }
      : function go$readdir (path, options, cb, startTime) {
        return fs$readdir(path, options, fs$readdirCallback(
          path, options, cb, startTime
        ))
      }

    return go$readdir(path, options, cb)

    function fs$readdirCallback (path, options, cb, startTime) {
      return function (err, files) {
        if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))
          enqueue([
            go$readdir,
            [path, options, cb],
            err,
            startTime || Date.now(),
            Date.now()
          ])
        else {
          if (files && files.sort)
            files.sort()

          if (typeof cb === 'function')
            cb.call(this, err, files)
        }
      }
    }
  }

  if (process.version.substr(0, 4) === 'v0.8') {
    var legStreams = legacy(fs)
    ReadStream = legStreams.ReadStream
    WriteStream = legStreams.WriteStream
  }

  var fs$ReadStream = fs.ReadStream
  if (fs$ReadStream) {
    ReadStream.prototype = Object.create(fs$ReadStream.prototype)
    ReadStream.prototype.open = ReadStream$open
  }

  var fs$WriteStream = fs.WriteStream
  if (fs$WriteStream) {
    WriteStream.prototype = Object.create(fs$WriteStream.prototype)
    WriteStream.prototype.open = WriteStream$open
  }

  Object.defineProperty(fs, 'ReadStream', {
    get: function () {
      return ReadStream
    },
    set: function (val) {
      ReadStream = val
    },
    enumerable: true,
    configurable: true
  })
  Object.defineProperty(fs, 'WriteStream', {
    get: function () {
      return WriteStream
    },
    set: function (val) {
      WriteStream = val
    },
    enumerable: true,
    configurable: true
  })

  // legacy names
  var FileReadStream = ReadStream
  Object.defineProperty(fs, 'FileReadStream', {
    get: function () {
      return FileReadStream
    },
    set: function (val) {
      FileReadStream = val
    },
    enumerable: true,
    configurable: true
  })
  var FileWriteStream = WriteStream
  Object.defineProperty(fs, 'FileWriteStream', {
    get: function () {
      return FileWriteStream
    },
    set: function (val) {
      FileWriteStream = val
    },
    enumerable: true,
    configurable: true
  })

  function ReadStream (path, options) {
    if (this instanceof ReadStream)
      return fs$ReadStream.apply(this, arguments), this
    else
      return ReadStream.apply(Object.create(ReadStream.prototype), arguments)
  }

  function ReadStream$open () {
    var that = this
    open(that.path, that.flags, that.mode, function (err, fd) {
      if (err) {
        if (that.autoClose)
          that.destroy()

        that.emit('error', err)
      } else {
        that.fd = fd
        that.emit('open', fd)
        that.read()
      }
    })
  }

  function WriteStream (path, options) {
    if (this instanceof WriteStream)
      return fs$WriteStream.apply(this, arguments), this
    else
      return WriteStream.apply(Object.create(WriteStream.prototype), arguments)
  }

  function WriteStream$open () {
    var that = this
    open(that.path, that.flags, that.mode, function (err, fd) {
      if (err) {
        that.destroy()
        that.emit('error', err)
      } else {
        that.fd = fd
        that.emit('open', fd)
      }
    })
  }

  function createReadStream (path, options) {
    return new fs.ReadStream(path, options)
  }

  function createWriteStream (path, options) {
    return new fs.WriteStream(path, options)
  }

  var fs$open = fs.open
  fs.open = open
  function open (path, flags, mode, cb) {
    if (typeof mode === 'function')
      cb = mode, mode = null

    return go$open(path, flags, mode, cb)

    function go$open (path, flags, mode, cb, startTime) {
      return fs$open(path, flags, mode, function (err, fd) {
        if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))
          enqueue([go$open, [path, flags, mode, cb], err, startTime || Date.now(), Date.now()])
        else {
          if (typeof cb === 'function')
            cb.apply(this, arguments)
        }
      })
    }
  }

  return fs
}

function enqueue (elem) {
  debug('ENQUEUE', elem[0].name, elem[1])
  fs[gracefulQueue].push(elem)
  retry()
}

// keep track of the timeout between retry() calls
var retryTimer

// reset the startTime and lastTime to now
// this resets the start of the 60 second overall timeout as well as the
// delay between attempts so that we'll retry these jobs sooner
function resetQueue () {
  var now = Date.now()
  for (var i = 0; i < fs[gracefulQueue].length; ++i) {
    // entries that are only a length of 2 are from an older version, don't
    // bother modifying those since they'll be retried anyway.
    if (fs[gracefulQueue][i].length > 2) {
      fs[gracefulQueue][i][3] = now // startTime
      fs[gracefulQueue][i][4] = now // lastTime
    }
  }
  // call retry to make sure we're actively processing the queue
  retry()
}

function retry () {
  // clear the timer and remove it to help prevent unintended concurrency
  clearTimeout(retryTimer)
  retryTimer = undefined

  if (fs[gracefulQueue].length === 0)
    return

  var elem = fs[gracefulQueue].shift()
  var fn = elem[0]
  var args = elem[1]
  // these items may be unset if they were added by an older graceful-fs
  var err = elem[2]
  var startTime = elem[3]
  var lastTime = elem[4]

  // if we don't have a startTime we have no way of knowing if we've waited
  // long enough, so go ahead and retry this item now
  if (startTime === undefined) {
    debug('RETRY', fn.name, args)
    fn.apply(null, args)
  } else if (Date.now() - startTime >= 60000) {
    // it's been more than 60 seconds total, bail now
    debug('TIMEOUT', fn.name, args)
    var cb = args.pop()
    if (typeof cb === 'function')
      cb.call(null, err)
  } else {
    // the amount of time between the last attempt and right now
    var sinceAttempt = Date.now() - lastTime
    // the amount of time between when we first tried, and when we last tried
    // rounded up to at least 1
    var sinceStart = Math.max(lastTime - startTime, 1)
    // backoff. wait longer than the total time we've been retrying, but only
    // up to a maximum of 100ms
    var desiredDelay = Math.min(sinceStart * 1.2, 100)
    // it's been long enough since the last retry, do it again
    if (sinceAttempt >= desiredDelay) {
      debug('RETRY', fn.name, args)
      fn.apply(null, args.concat([startTime]))
    } else {
      // if we can't do this job yet, push it to the end of the queue
      // and let the next iteration check again
      fs[gracefulQueue].push(elem)
    }
  }

  // schedule our next run if one isn't already scheduled
  if (retryTimer === undefined) {
    retryTimer = setTimeout(retry, 0)
  }
}
var Stream = require('stream').Stream

module.exports = legacy

function legacy (fs) {
  return {
    ReadStream: ReadStream,
    WriteStream: WriteStream
  }

  function ReadStream (path, options) {
    if (!(this instanceof ReadStream)) return new ReadStream(path, options);

    Stream.call(this);

    var self = this;

    this.path = path;
    this.fd = null;
    this.readable = true;
    this.paused = false;

    this.flags = 'r';
    this.mode = 438; /*=0666*/
    this.bufferSize = 64 * 1024;

    options = options || {};

    // Mixin options into this
    var keys = Object.keys(options);
    for (var index = 0, length = keys.length; index < length; index++) {
      var key = keys[index];
      this[key] = options[key];
    }

    if (this.encoding) this.setEncoding(this.encoding);

    if (this.start !== undefined) {
      if ('number' !== typeof this.start) {
        throw TypeError('start must be a Number');
      }
      if (this.end === undefined) {
        this.end = Infinity;
      } else if ('number' !== typeof this.end) {
        throw TypeError('end must be a Number');
      }

      if (this.start > this.end) {
        throw new Error('start must be <= end');
      }

      this.pos = this.start;
    }

    if (this.fd !== null) {
      process.nextTick(function() {
        self._read();
      });
      return;
    }

    fs.open(this.path, this.flags, this.mode, function (err, fd) {
      if (err) {
        self.emit('error', err);
        self.readable = false;
        return;
      }

      self.fd = fd;
      self.emit('open', fd);
      self._read();
    })
  }

  function WriteStream (path, options) {
    if (!(this instanceof WriteStream)) return new WriteStream(path, options);

    Stream.call(this);

    this.path = path;
    this.fd = null;
    this.writable = true;

    this.flags = 'w';
    this.encoding = 'binary';
    this.mode = 438; /*=0666*/
    this.bytesWritten = 0;

    options = options || {};

    // Mixin options into this
    var keys = Object.keys(options);
    for (var index = 0, length = keys.length; index < length; index++) {
      var key = keys[index];
      this[key] = options[key];
    }

    if (this.start !== undefined) {
      if ('number' !== typeof this.start) {
        throw TypeError('start must be a Number');
      }
      if (this.start < 0) {
        throw new Error('start must be >= zero');
      }

      this.pos = this.start;
    }

    this.busy = false;
    this._queue = [];

    if (this.fd === null) {
      this._open = fs.open;
      this._queue.push([this._open, this.path, this.flags, this.mode, undefined]);
      this.flush();
    }
  }
}
{
  "name": "graceful-fs",
  "description": "A drop-in replacement for fs, making various improvements.",
  "version": "4.2.11",
  "repository": {
    "type": "git",
    "url": "https://github.com/isaacs/node-graceful-fs"
  },
  "main": "graceful-fs.js",
  "directories": {
    "test": "test"
  },
  "license": "ISC",
  "devDependencies": {
    "import-fresh": "^2.0.0",
    "mkdirp": "^0.5.0",
    "rimraf": "^2.2.8",
    "tap": "^16.3.4"
  },
  "files": [
    "fs.js",
    "graceful-fs.js",
    "legacy-streams.js",
    "polyfills.js",
    "clone.js"
  ],
  "tap": {
    "reporter": "classic"
  }
}var constants = require('constants')

var origCwd = process.cwd
var cwd = null

var platform = process.env.GRACEFUL_FS_PLATFORM || process.platform

process.cwd = function() {
  if (!cwd)
    cwd = origCwd.call(process)
  return cwd
}
try {
  process.cwd()
} catch (er) {}

// This check is needed until node.js 12 is required
if (typeof process.chdir === 'function') {
  var chdir = process.chdir
  process.chdir = function (d) {
    cwd = null
    chdir.call(process, d)
  }
  if (Object.setPrototypeOf) Object.setPrototypeOf(process.chdir, chdir)
}

module.exports = patch

function patch (fs) {
  // (re-)implement some things that are known busted or missing.

  // lchmod, broken prior to 0.6.2
  // back-port the fix here.
  if (constants.hasOwnProperty('O_SYMLINK') &&
      process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) {
    patchLchmod(fs)
  }

  // lutimes implementation, or no-op
  if (!fs.lutimes) {
    patchLutimes(fs)
  }

  // https://github.com/isaacs/node-graceful-fs/issues/4
  // Chown should not fail on einval or eperm if non-root.
  // It should not fail on enosys ever, as this just indicates
  // that a fs doesn't support the intended operation.

  fs.chown = chownFix(fs.chown)
  fs.fchown = chownFix(fs.fchown)
  fs.lchown = chownFix(fs.lchown)

  fs.chmod = chmodFix(fs.chmod)
  fs.fchmod = chmodFix(fs.fchmod)
  fs.lchmod = chmodFix(fs.lchmod)

  fs.chownSync = chownFixSync(fs.chownSync)
  fs.fchownSync = chownFixSync(fs.fchownSync)
  fs.lchownSync = chownFixSync(fs.lchownSync)

  fs.chmodSync = chmodFixSync(fs.chmodSync)
  fs.fchmodSync = chmodFixSync(fs.fchmodSync)
  fs.lchmodSync = chmodFixSync(fs.lchmodSync)

  fs.stat = statFix(fs.stat)
  fs.fstat = statFix(fs.fstat)
  fs.lstat = statFix(fs.lstat)

  fs.statSync = statFixSync(fs.statSync)
  fs.fstatSync = statFixSync(fs.fstatSync)
  fs.lstatSync = statFixSync(fs.lstatSync)

  // if lchmod/lchown do not exist, then make them no-ops
  if (fs.chmod && !fs.lchmod) {
    fs.lchmod = function (path, mode, cb) {
      if (cb) process.nextTick(cb)
    }
    fs.lchmodSync = function () {}
  }
  if (fs.chown && !fs.lchown) {
    fs.lchown = function (path, uid, gid, cb) {
      if (cb) process.nextTick(cb)
    }
    fs.lchownSync = function () {}
  }

  // on Windows, A/V software can lock the directory, causing this
  // to fail with an EACCES or EPERM if the directory contains newly
  // created files.  Try again on failure, for up to 60 seconds.

  // Set the timeout this long because some Windows Anti-Virus, such as Parity
  // bit9, may lock files for up to a minute, causing npm package install
  // failures. Also, take care to yield the scheduler. Windows scheduling gives
  // CPU to a busy looping process, which can cause the program causing the lock
  // contention to be starved of CPU by node, so the contention doesn't resolve.
  if (platform === "win32") {
    fs.rename = typeof fs.rename !== 'function' ? fs.rename
    : (function (fs$rename) {
      function rename (from, to, cb) {
        var start = Date.now()
        var backoff = 0;
        fs$rename(from, to, function CB (er) {
          if (er
              && (er.code === "EACCES" || er.code === "EPERM" || er.code === "EBUSY")
              && Date.now() - start < 60000) {
            setTimeout(function() {
              fs.stat(to, function (stater, st) {
                if (stater && stater.code === "ENOENT")
                  fs$rename(from, to, CB);
                else
                  cb(er)
              })
            }, backoff)
            if (backoff < 100)
              backoff += 10;
            return;
          }
          if (cb) cb(er)
        })
      }
      if (Object.setPrototypeOf) Object.setPrototypeOf(rename, fs$rename)
      return rename
    })(fs.rename)
  }

  // if read() returns EAGAIN, then just try it again.
  fs.read = typeof fs.read !== 'function' ? fs.read
  : (function (fs$read) {
    function read (fd, buffer, offset, length, position, callback_) {
      var callback
      if (callback_ && typeof callback_ === 'function') {
        var eagCounter = 0
        callback = function (er, _, __) {
          if (er && er.code === 'EAGAIN' && eagCounter < 10) {
            eagCounter ++
            return fs$read.call(fs, fd, buffer, offset, length, position, callback)
          }
          callback_.apply(this, arguments)
        }
      }
      return fs$read.call(fs, fd, buffer, offset, length, position, callback)
    }

    // This ensures `util.promisify` works as it does for native `fs.read`.
    if (Object.setPrototypeOf) Object.setPrototypeOf(read, fs$read)
    return read
  })(fs.read)

  fs.readSync = typeof fs.readSync !== 'function' ? fs.readSync
  : (function (fs$readSync) { return function (fd, buffer, offset, length, position) {
    var eagCounter = 0
    while (true) {
      try {
        return fs$readSync.call(fs, fd, buffer, offset, length, position)
      } catch (er) {
        if (er.code === 'EAGAIN' && eagCounter < 10) {
          eagCounter ++
          continue
        }
        throw er
      }
    }
  }})(fs.readSync)

  function patchLchmod (fs) {
    fs.lchmod = function (path, mode, callback) {
      fs.open( path
             , constants.O_WRONLY | constants.O_SYMLINK
             , mode
             , function (err, fd) {
        if (err) {
          if (callback) callback(err)
          return
        }
        // prefer to return the chmod error, if one occurs,
        // but still try to close, and report closing errors if they occur.
        fs.fchmod(fd, mode, function (err) {
          fs.close(fd, function(err2) {
            if (callback) callback(err || err2)
          })
        })
      })
    }

    fs.lchmodSync = function (path, mode) {
      var fd = fs.openSync(path, constants.O_WRONLY | constants.O_SYMLINK, mode)

      // prefer to return the chmod error, if one occurs,
      // but still try to close, and report closing errors if they occur.
      var threw = true
      var ret
      try {
        ret = fs.fchmodSync(fd, mode)
        threw = false
      } finally {
        if (threw) {
          try {
            fs.closeSync(fd)
          } catch (er) {}
        } else {
          fs.closeSync(fd)
        }
      }
      return ret
    }
  }

  function patchLutimes (fs) {
    if (constants.hasOwnProperty("O_SYMLINK") && fs.futimes) {
      fs.lutimes = function (path, at, mt, cb) {
        fs.open(path, constants.O_SYMLINK, function (er, fd) {
          if (er) {
            if (cb) cb(er)
            return
          }
          fs.futimes(fd, at, mt, function (er) {
            fs.close(fd, function (er2) {
              if (cb) cb(er || er2)
            })
          })
        })
      }

      fs.lutimesSync = function (path, at, mt) {
        var fd = fs.openSync(path, constants.O_SYMLINK)
        var ret
        var threw = true
        try {
          ret = fs.futimesSync(fd, at, mt)
          threw = false
        } finally {
          if (threw) {
            try {
              fs.closeSync(fd)
            } catch (er) {}
          } else {
            fs.closeSync(fd)
          }
        }
        return ret
      }

    } else if (fs.futimes) {
      fs.lutimes = function (_a, _b, _c, cb) { if (cb) process.nextTick(cb) }
      fs.lutimesSync = function () {}
    }
  }

  function chmodFix (orig) {
    if (!orig) return orig
    return function (target, mode, cb) {
      return orig.call(fs, target, mode, function (er) {
        if (chownErOk(er)) er = null
        if (cb) cb.apply(this, arguments)
      })
    }
  }

  function chmodFixSync (orig) {
    if (!orig) return orig
    return function (target, mode) {
      try {
        return orig.call(fs, target, mode)
      } catch (er) {
        if (!chownErOk(er)) throw er
      }
    }
  }


  function chownFix (orig) {
    if (!orig) return orig
    return function (target, uid, gid, cb) {
      return orig.call(fs, target, uid, gid, function (er) {
        if (chownErOk(er)) er = null
        if (cb) cb.apply(this, arguments)
      })
    }
  }

  function chownFixSync (orig) {
    if (!orig) return orig
    return function (target, uid, gid) {
      try {
        return orig.call(fs, target, uid, gid)
      } catch (er) {
        if (!chownErOk(er)) throw er
      }
    }
  }

  function statFix (orig) {
    if (!orig) return orig
    // Older versions of Node erroneously returned signed integers for
    // uid + gid.
    return function (target, options, cb) {
      if (typeof options === 'function') {
        cb = options
        options = null
      }
      function callback (er, stats) {
        if (stats) {
          if (stats.uid < 0) stats.uid += 0x100000000
          if (stats.gid < 0) stats.gid += 0x100000000
        }
        if (cb) cb.apply(this, arguments)
      }
      return options ? orig.call(fs, target, options, callback)
        : orig.call(fs, target, callback)
    }
  }

  function statFixSync (orig) {
    if (!orig) return orig
    // Older versions of Node erroneously returned signed integers for
    // uid + gid.
    return function (target, options) {
      var stats = options ? orig.call(fs, target, options)
        : orig.call(fs, target)
      if (stats) {
        if (stats.uid < 0) stats.uid += 0x100000000
        if (stats.gid < 0) stats.gid += 0x100000000
      }
      return stats;
    }
  }

  // ENOSYS means that the fs doesn't support the op. Just ignore
  // that, because it doesn't matter.
  //
  // if there's no getuid, or if getuid() is something other
  // than 0, and the error is EINVAL or EPERM, then just ignore
  // it.
  //
  // This specific case is a silent failure in cp, install, tar,
  // and most other unix tools that manage permissions.
  //
  // When running as root, or if other types of errors are
  // encountered, then it's strict.
  function chownErOk (er) {
    if (!er)
      return true

    if (er.code === "ENOSYS")
      return true

    var nonroot = !process.getuid || process.getuid() !== 0
    if (nonroot) {
      if (er.code === "EINVAL" || er.code === "EPERM")
        return true
    }

    return false
  }
}
(The MIT License)

Copyright (C) 2011-2015 by Vitaly Puzrin

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
#!/usr/bin/env node

'use strict'

const fs = require('fs')
const argparse = require('argparse')
const yaml = require('..')

/// /////////////////////////////////////////////////////////////////////////////

const cli = new argparse.ArgumentParser({
  prog: 'js-yaml',
  add_help: true
})

cli.add_argument('-v', '--version', {
  action: 'version',
  version: require('../package.json').version
})

cli.add_argument('-c', '--compact', {
  help: 'Display errors in compact mode',
  action: 'store_true'
})

// deprecated (not needed after we removed output colors)
// option suppressed, but not completely removed for compatibility
cli.add_argument('-j', '--to-json', {
  help: argparse.SUPPRESS,
  dest: 'json',
  action: 'store_true'
})

cli.add_argument('-t', '--trace', {
  help: 'Show stack trace on error',
  action: 'store_true'
})

cli.add_argument('file', {
  help: 'File to read, utf-8 encoded without BOM',
  nargs: '?',
  default: '-'
})

/// /////////////////////////////////////////////////////////////////////////////

const options = cli.parse_args()

/// /////////////////////////////////////////////////////////////////////////////

function readFile (filename, encoding, callback) {
  if (options.file === '-') {
    // read from stdin

    const chunks = []

    process.stdin.on('data', function (chunk) {
      chunks.push(chunk)
    })

    process.stdin.on('end', function () {
      return callback(null, Buffer.concat(chunks).toString(encoding))
    })
  } else {
    fs.readFile(filename, encoding, callback)
  }
}

readFile(options.file, 'utf8', function (error, input) {
  let output
  let isYaml

  if (error) {
    if (error.code === 'ENOENT') {
      console.error('File not found: ' + options.file)
      process.exit(2)
    }

    console.error(
      (options.trace && error.stack) ||
      error.message ||
      String(error))

    process.exit(1)
  }

  try {
    output = JSON.parse(input)
    isYaml = false
  } catch (err) {
    if (err instanceof SyntaxError) {
      try {
        output = []
        yaml.loadAll(input, function (doc) { output.push(doc) }, {})
        isYaml = true

        if (output.length === 0) output = null
        else if (output.length === 1) output = output[0]
      } catch (e) {
        if (options.trace && err.stack) console.error(e.stack)
        else console.error(e.toString(options.compact))

        process.exit(1)
      }
    } else {
      console.error(
        (options.trace && err.stack) ||
        err.message ||
        String(err))

      process.exit(1)
    }
  }

  if (isYaml) console.log(JSON.stringify(output, null, '  '))
  else console.log(yaml.dump(output))
})
(function(global, factory) {
    typeof exports === "object" && typeof module !== "undefined" ? factory(exports) : typeof define === "function" && define.amd ? define([ "exports" ], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, 
    factory(global.jsyaml = {}));
})(this, function(exports2) {
    "use strict";
    function getDefaultExportFromCjs(x) {
        return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
    }
    var jsYaml = {};
    var loader = {};
    var common = {};
    var hasRequiredCommon;
    function requireCommon() {
        if (hasRequiredCommon) return common;
        hasRequiredCommon = 1;
        function _typeof(o) {
            "@babel/helpers - typeof";
            return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
                return typeof o2;
            } : function(o2) {
                return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
            }, _typeof(o);
        }
        function isNothing(subject) {
            return typeof subject === "undefined" || subject === null;
        }
        function isObject(subject) {
            return _typeof(subject) === "object" && subject !== null;
        }
        function toArray(sequence) {
            if (Array.isArray(sequence)) return sequence; else if (isNothing(sequence)) return [];
            return [ sequence ];
        }
        function extend(target, source) {
            if (source) {
                var sourceKeys = Object.keys(source);
                for (var index = 0, length = sourceKeys.length; index < length; index += 1) {
                    var key = sourceKeys[index];
                    target[key] = source[key];
                }
            }
            return target;
        }
        function repeat(string, count) {
            var result = "";
            for (var cycle = 0; cycle < count; cycle += 1) {
                result += string;
            }
            return result;
        }
        function isNegativeZero(number) {
            return number === 0 && Number.NEGATIVE_INFINITY === 1 / number;
        }
        common.isNothing = isNothing;
        common.isObject = isObject;
        common.toArray = toArray;
        common.repeat = repeat;
        common.isNegativeZero = isNegativeZero;
        common.extend = extend;
        return common;
    }
    var exception;
    var hasRequiredException;
    function requireException() {
        if (hasRequiredException) return exception;
        hasRequiredException = 1;
        function formatError(exception2, compact) {
            var where = "";
            var message = exception2.reason || "(unknown reason)";
            if (!exception2.mark) return message;
            if (exception2.mark.name) {
                where += 'in "' + exception2.mark.name + '" ';
            }
            where += "(" + (exception2.mark.line + 1) + ":" + (exception2.mark.column + 1) + ")";
            if (!compact && exception2.mark.snippet) {
                where += "\n\n" + exception2.mark.snippet;
            }
            return message + " " + where;
        }
        function YAMLException2(reason, mark) {
            Error.call(this);
            this.name = "YAMLException";
            this.reason = reason;
            this.mark = mark;
            this.message = formatError(this, false);
            if (Error.captureStackTrace) {
                Error.captureStackTrace(this, this.constructor);
            } else {
                this.stack = (new Error).stack || "";
            }
        }
        YAMLException2.prototype = Object.create(Error.prototype);
        YAMLException2.prototype.constructor = YAMLException2;
        YAMLException2.prototype.toString = function toString(compact) {
            return this.name + ": " + formatError(this, compact);
        };
        exception = YAMLException2;
        return exception;
    }
    var snippet;
    var hasRequiredSnippet;
    function requireSnippet() {
        if (hasRequiredSnippet) return snippet;
        hasRequiredSnippet = 1;
        var common2 = requireCommon();
        function getLine(buffer, lineStart, lineEnd, position, maxLineLength) {
            var head = "";
            var tail = "";
            var maxHalfLength = Math.floor(maxLineLength / 2) - 1;
            if (position - lineStart > maxHalfLength) {
                head = " ... ";
                lineStart = position - maxHalfLength + head.length;
            }
            if (lineEnd - position > maxHalfLength) {
                tail = " ...";
                lineEnd = position + maxHalfLength - tail.length;
            }
            return {
                str: head + buffer.slice(lineStart, lineEnd).replace(/\t/g, "â†’") + tail,
                pos: position - lineStart + head.length
            };
        }
        function padStart(string, max) {
            return common2.repeat(" ", max - string.length) + string;
        }
        function makeSnippet(mark, options) {
            options = Object.create(options || null);
            if (!mark.buffer) return null;
            if (!options.maxLength) options.maxLength = 79;
            if (typeof options.indent !== "number") options.indent = 1;
            if (typeof options.linesBefore !== "number") options.linesBefore = 3;
            if (typeof options.linesAfter !== "number") options.linesAfter = 2;
            var re = /\r?\n|\r|\0/g;
            var lineStarts = [ 0 ];
            var lineEnds = [];
            var match;
            var foundLineNo = -1;
            while (match = re.exec(mark.buffer)) {
                lineEnds.push(match.index);
                lineStarts.push(match.index + match[0].length);
                if (mark.position <= match.index && foundLineNo < 0) {
                    foundLineNo = lineStarts.length - 2;
                }
            }
            if (foundLineNo < 0) foundLineNo = lineStarts.length - 1;
            var result = "";
            var lineNoLength = Math.min(mark.line + options.linesAfter, lineEnds.length).toString().length;
            var maxLineLength = options.maxLength - (options.indent + lineNoLength + 3);
            for (var i = 1; i <= options.linesBefore; i++) {
                if (foundLineNo - i < 0) break;
                var _line = getLine(mark.buffer, lineStarts[foundLineNo - i], lineEnds[foundLineNo - i], mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo - i]), maxLineLength);
                result = common2.repeat(" ", options.indent) + padStart((mark.line - i + 1).toString(), lineNoLength) + " | " + _line.str + "\n" + result;
            }
            var line = getLine(mark.buffer, lineStarts[foundLineNo], lineEnds[foundLineNo], mark.position, maxLineLength);
            result += common2.repeat(" ", options.indent) + padStart((mark.line + 1).toString(), lineNoLength) + " | " + line.str + "\n";
            result += common2.repeat("-", options.indent + lineNoLength + 3 + line.pos) + "^\n";
            for (var _i = 1; _i <= options.linesAfter; _i++) {
                if (foundLineNo + _i >= lineEnds.length) break;
                var _line2 = getLine(mark.buffer, lineStarts[foundLineNo + _i], lineEnds[foundLineNo + _i], mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo + _i]), maxLineLength);
                result += common2.repeat(" ", options.indent) + padStart((mark.line + _i + 1).toString(), lineNoLength) + " | " + _line2.str + "\n";
            }
            return result.replace(/\n$/, "");
        }
        snippet = makeSnippet;
        return snippet;
    }
    var type;
    var hasRequiredType;
    function requireType() {
        if (hasRequiredType) return type;
        hasRequiredType = 1;
        var YAMLException2 = requireException();
        var TYPE_CONSTRUCTOR_OPTIONS = [ "kind", "multi", "resolve", "construct", "instanceOf", "predicate", "represent", "representName", "defaultStyle", "styleAliases" ];
        var YAML_NODE_KINDS = [ "scalar", "sequence", "mapping" ];
        function compileStyleAliases(map2) {
            var result = {};
            if (map2 !== null) {
                Object.keys(map2).forEach(function(style) {
                    map2[style].forEach(function(alias) {
                        result[String(alias)] = style;
                    });
                });
            }
            return result;
        }
        function Type2(tag, options) {
            options = options || {};
            Object.keys(options).forEach(function(name) {
                if (TYPE_CONSTRUCTOR_OPTIONS.indexOf(name) === -1) {
                    throw new YAMLException2('Unknown option "' + name + '" is met in definition of "' + tag + '" YAML type.');
                }
            });
            this.options = options;
            this.tag = tag;
            this.kind = options["kind"] || null;
            this.resolve = options["resolve"] || function() {
                return true;
            };
            this.construct = options["construct"] || function(data) {
                return data;
            };
            this.instanceOf = options["instanceOf"] || null;
            this.predicate = options["predicate"] || null;
            this.represent = options["represent"] || null;
            this.representName = options["representName"] || null;
            this.defaultStyle = options["defaultStyle"] || null;
            this.multi = options["multi"] || false;
            this.styleAliases = compileStyleAliases(options["styleAliases"] || null);
            if (YAML_NODE_KINDS.indexOf(this.kind) === -1) {
                throw new YAMLException2('Unknown kind "' + this.kind + '" is specified for "' + tag + '" YAML type.');
            }
        }
        type = Type2;
        return type;
    }
    var schema;
    var hasRequiredSchema;
    function requireSchema() {
        if (hasRequiredSchema) return schema;
        hasRequiredSchema = 1;
        var YAMLException2 = requireException();
        var Type2 = requireType();
        function compileList(schema2, name) {
            var result = [];
            schema2[name].forEach(function(currentType) {
                var newIndex = result.length;
                result.forEach(function(previousType, previousIndex) {
                    if (previousType.tag === currentType.tag && previousType.kind === currentType.kind && previousType.multi === currentType.multi) {
                        newIndex = previousIndex;
                    }
                });
                result[newIndex] = currentType;
            });
            return result;
        }
        function compileMap() {
            var result = {
                scalar: {},
                sequence: {},
                mapping: {},
                fallback: {},
                multi: {
                    scalar: [],
                    sequence: [],
                    mapping: [],
                    fallback: []
                }
            };
            function collectType(type2) {
                if (type2.multi) {
                    result.multi[type2.kind].push(type2);
                    result.multi["fallback"].push(type2);
                } else {
                    result[type2.kind][type2.tag] = result["fallback"][type2.tag] = type2;
                }
            }
            for (var index = 0, length = arguments.length; index < length; index += 1) {
                arguments[index].forEach(collectType);
            }
            return result;
        }
        function Schema2(definition) {
            return this.extend(definition);
        }
        Schema2.prototype.extend = function extend(definition) {
            var implicit = [];
            var explicit = [];
            if (definition instanceof Type2) {
                explicit.push(definition);
            } else if (Array.isArray(definition)) {
                explicit = explicit.concat(definition);
            } else if (definition && (Array.isArray(definition.implicit) || Array.isArray(definition.explicit))) {
                if (definition.implicit) implicit = implicit.concat(definition.implicit);
                if (definition.explicit) explicit = explicit.concat(definition.explicit);
            } else {
                throw new YAMLException2("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");
            }
            implicit.forEach(function(type2) {
                if (!(type2 instanceof Type2)) {
                    throw new YAMLException2("Specified list of YAML types (or a single Type object) contains a non-Type object.");
                }
                if (type2.loadKind && type2.loadKind !== "scalar") {
                    throw new YAMLException2("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");
                }
                if (type2.multi) {
                    throw new YAMLException2("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.");
                }
            });
            explicit.forEach(function(type2) {
                if (!(type2 instanceof Type2)) {
                    throw new YAMLException2("Specified list of YAML types (or a single Type object) contains a non-Type object.");
                }
            });
            var result = Object.create(Schema2.prototype);
            result.implicit = (this.implicit || []).concat(implicit);
            result.explicit = (this.explicit || []).concat(explicit);
            result.compiledImplicit = compileList(result, "implicit");
            result.compiledExplicit = compileList(result, "explicit");
            result.compiledTypeMap = compileMap(result.compiledImplicit, result.compiledExplicit);
            return result;
        };
        schema = Schema2;
        return schema;
    }
    var str;
    var hasRequiredStr;
    function requireStr() {
        if (hasRequiredStr) return str;
        hasRequiredStr = 1;
        var Type2 = requireType();
        str = new Type2("tag:yaml.org,2002:str", {
            kind: "scalar",
            construct: function construct(data) {
                return data !== null ? data : "";
            }
        });
        return str;
    }
    var seq;
    var hasRequiredSeq;
    function requireSeq() {
        if (hasRequiredSeq) return seq;
        hasRequiredSeq = 1;
        var Type2 = requireType();
        seq = new Type2("tag:yaml.org,2002:seq", {
            kind: "sequence",
            construct: function construct(data) {
                return data !== null ? data : [];
            }
        });
        return seq;
    }
    var map;
    var hasRequiredMap;
    function requireMap() {
        if (hasRequiredMap) return map;
        hasRequiredMap = 1;
        var Type2 = requireType();
        map = new Type2("tag:yaml.org,2002:map", {
            kind: "mapping",
            construct: function construct(data) {
                return data !== null ? data : {};
            }
        });
        return map;
    }
    var failsafe;
    var hasRequiredFailsafe;
    function requireFailsafe() {
        if (hasRequiredFailsafe) return failsafe;
        hasRequiredFailsafe = 1;
        var Schema2 = requireSchema();
        failsafe = new Schema2({
            explicit: [ requireStr(), requireSeq(), requireMap() ]
        });
        return failsafe;
    }
    var _null;
    var hasRequired_null;
    function require_null() {
        if (hasRequired_null) return _null;
        hasRequired_null = 1;
        var Type2 = requireType();
        function resolveYamlNull(data) {
            if (data === null) return true;
            var max = data.length;
            return max === 1 && data === "~" || max === 4 && (data === "null" || data === "Null" || data === "NULL");
        }
        function constructYamlNull() {
            return null;
        }
        function isNull(object) {
            return object === null;
        }
        _null = new Type2("tag:yaml.org,2002:null", {
            kind: "scalar",
            resolve: resolveYamlNull,
            construct: constructYamlNull,
            predicate: isNull,
            represent: {
                canonical: function canonical() {
                    return "~";
                },
                lowercase: function lowercase() {
                    return "null";
                },
                uppercase: function uppercase() {
                    return "NULL";
                },
                camelcase: function camelcase() {
                    return "Null";
                },
                empty: function empty() {
                    return "";
                }
            },
            defaultStyle: "lowercase"
        });
        return _null;
    }
    var bool;
    var hasRequiredBool;
    function requireBool() {
        if (hasRequiredBool) return bool;
        hasRequiredBool = 1;
        var Type2 = requireType();
        function resolveYamlBoolean(data) {
            if (data === null) return false;
            var max = data.length;
            return max === 4 && (data === "true" || data === "True" || data === "TRUE") || max === 5 && (data === "false" || data === "False" || data === "FALSE");
        }
        function constructYamlBoolean(data) {
            return data === "true" || data === "True" || data === "TRUE";
        }
        function isBoolean(object) {
            return Object.prototype.toString.call(object) === "[object Boolean]";
        }
        bool = new Type2("tag:yaml.org,2002:bool", {
            kind: "scalar",
            resolve: resolveYamlBoolean,
            construct: constructYamlBoolean,
            predicate: isBoolean,
            represent: {
                lowercase: function lowercase(object) {
                    return object ? "true" : "false";
                },
                uppercase: function uppercase(object) {
                    return object ? "TRUE" : "FALSE";
                },
                camelcase: function camelcase(object) {
                    return object ? "True" : "False";
                }
            },
            defaultStyle: "lowercase"
        });
        return bool;
    }
    var int;
    var hasRequiredInt;
    function requireInt() {
        if (hasRequiredInt) return int;
        hasRequiredInt = 1;
        var common2 = requireCommon();
        var Type2 = requireType();
        function isHexCode(c) {
            return c >= 48 && c <= 57 || c >= 65 && c <= 70 || c >= 97 && c <= 102;
        }
        function isOctCode(c) {
            return c >= 48 && c <= 55;
        }
        function isDecCode(c) {
            return c >= 48 && c <= 57;
        }
        function resolveYamlInteger(data) {
            if (data === null) return false;
            var max = data.length;
            var index = 0;
            var hasDigits = false;
            if (!max) return false;
            var ch = data[index];
            if (ch === "-" || ch === "+") {
                ch = data[++index];
            }
            if (ch === "0") {
                if (index + 1 === max) return true;
                ch = data[++index];
                if (ch === "b") {
                    index++;
                    for (;index < max; index++) {
                        ch = data[index];
                        if (ch !== "0" && ch !== "1") return false;
                        hasDigits = true;
                    }
                    return hasDigits && isFinite(parseYamlInteger(data));
                }
                if (ch === "x") {
                    index++;
                    for (;index < max; index++) {
                        if (!isHexCode(data.charCodeAt(index))) return false;
                        hasDigits = true;
                    }
                    return hasDigits && isFinite(parseYamlInteger(data));
                }
                if (ch === "o") {
                    index++;
                    for (;index < max; index++) {
                        if (!isOctCode(data.charCodeAt(index))) return false;
                        hasDigits = true;
                    }
                    return hasDigits && isFinite(parseYamlInteger(data));
                }
            }
            for (;index < max; index++) {
                if (!isDecCode(data.charCodeAt(index))) {
                    return false;
                }
                hasDigits = true;
            }
            if (!hasDigits) return false;
            return isFinite(parseYamlInteger(data));
        }
        function parseYamlInteger(data) {
            var value = data;
            var sign = 1;
            var ch = value[0];
            if (ch === "-" || ch === "+") {
                if (ch === "-") sign = -1;
                value = value.slice(1);
                ch = value[0];
            }
            if (value === "0") return 0;
            if (ch === "0") {
                if (value[1] === "b") return sign * parseInt(value.slice(2), 2);
                if (value[1] === "x") return sign * parseInt(value.slice(2), 16);
                if (value[1] === "o") return sign * parseInt(value.slice(2), 8);
            }
            return sign * parseInt(value, 10);
        }
        function constructYamlInteger(data) {
            return parseYamlInteger(data);
        }
        function isInteger(object) {
            return Object.prototype.toString.call(object) === "[object Number]" && object % 1 === 0 && !common2.isNegativeZero(object);
        }
        int = new Type2("tag:yaml.org,2002:int", {
            kind: "scalar",
            resolve: resolveYamlInteger,
            construct: constructYamlInteger,
            predicate: isInteger,
            represent: {
                binary: function binary2(obj) {
                    return obj >= 0 ? "0b" + obj.toString(2) : "-0b" + obj.toString(2).slice(1);
                },
                octal: function octal(obj) {
                    return obj >= 0 ? "0o" + obj.toString(8) : "-0o" + obj.toString(8).slice(1);
                },
                decimal: function decimal(obj) {
                    return obj.toString(10);
                },
                hexadecimal: function hexadecimal(obj) {
                    return obj >= 0 ? "0x" + obj.toString(16).toUpperCase() : "-0x" + obj.toString(16).toUpperCase().slice(1);
                }
            },
            defaultStyle: "decimal",
            styleAliases: {
                binary: [ 2, "bin" ],
                octal: [ 8, "oct" ],
                decimal: [ 10, "dec" ],
                hexadecimal: [ 16, "hex" ]
            }
        });
        return int;
    }
    var float;
    var hasRequiredFloat;
    function requireFloat() {
        if (hasRequiredFloat) return float;
        hasRequiredFloat = 1;
        var common2 = requireCommon();
        var Type2 = requireType();
        var YAML_FLOAT_PATTERN = new RegExp("^(?:[-+]?(?:[0-9]+)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");
        var YAML_FLOAT_SPECIAL_PATTERN = new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");
        function resolveYamlFloat(data) {
            if (data === null) return false;
            if (!YAML_FLOAT_PATTERN.test(data)) {
                return false;
            }
            if (isFinite(parseFloat(data, 10))) {
                return true;
            }
            return YAML_FLOAT_SPECIAL_PATTERN.test(data);
        }
        function constructYamlFloat(data) {
            var value = data.toLowerCase();
            var sign = value[0] === "-" ? -1 : 1;
            if ("+-".indexOf(value[0]) >= 0) {
                value = value.slice(1);
            }
            if (value === ".inf") {
                return sign === 1 ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY;
            } else if (value === ".nan") {
                return NaN;
            }
            return sign * parseFloat(value, 10);
        }
        var SCIENTIFIC_WITHOUT_DOT = /^[-+]?[0-9]+e/;
        function representYamlFloat(object, style) {
            if (isNaN(object)) {
                switch (style) {
                  case "lowercase":
                    return ".nan";

                  case "uppercase":
                    return ".NAN";

                  case "camelcase":
                    return ".NaN";
                }
            } else if (Number.POSITIVE_INFINITY === object) {
                switch (style) {
                  case "lowercase":
                    return ".inf";

                  case "uppercase":
                    return ".INF";

                  case "camelcase":
                    return ".Inf";
                }
            } else if (Number.NEGATIVE_INFINITY === object) {
                switch (style) {
                  case "lowercase":
                    return "-.inf";

                  case "uppercase":
                    return "-.INF";

                  case "camelcase":
                    return "-.Inf";
                }
            } else if (common2.isNegativeZero(object)) {
                return "-0.0";
            }
            var res = object.toString(10);
            return SCIENTIFIC_WITHOUT_DOT.test(res) ? res.replace("e", ".e") : res;
        }
        function isFloat(object) {
            return Object.prototype.toString.call(object) === "[object Number]" && (object % 1 !== 0 || common2.isNegativeZero(object));
        }
        float = new Type2("tag:yaml.org,2002:float", {
            kind: "scalar",
            resolve: resolveYamlFloat,
            construct: constructYamlFloat,
            predicate: isFloat,
            represent: representYamlFloat,
            defaultStyle: "lowercase"
        });
        return float;
    }
    var json;
    var hasRequiredJson;
    function requireJson() {
        if (hasRequiredJson) return json;
        hasRequiredJson = 1;
        json = requireFailsafe().extend({
            implicit: [ require_null(), requireBool(), requireInt(), requireFloat() ]
        });
        return json;
    }
    var core;
    var hasRequiredCore;
    function requireCore() {
        if (hasRequiredCore) return core;
        hasRequiredCore = 1;
        core = requireJson();
        return core;
    }
    var timestamp;
    var hasRequiredTimestamp;
    function requireTimestamp() {
        if (hasRequiredTimestamp) return timestamp;
        hasRequiredTimestamp = 1;
        var Type2 = requireType();
        var YAML_DATE_REGEXP = new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$");
        var YAML_TIMESTAMP_REGEXP = new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");
        function resolveYamlTimestamp(data) {
            if (data === null) return false;
            if (YAML_DATE_REGEXP.exec(data) !== null) return true;
            if (YAML_TIMESTAMP_REGEXP.exec(data) !== null) return true;
            return false;
        }
        function constructYamlTimestamp(data) {
            var fraction = 0;
            var delta = null;
            var match = YAML_DATE_REGEXP.exec(data);
            if (match === null) match = YAML_TIMESTAMP_REGEXP.exec(data);
            if (match === null) throw new Error("Date resolve error");
            var year = +match[1];
            var month = +match[2] - 1;
            var day = +match[3];
            if (!match[4]) {
                return new Date(Date.UTC(year, month, day));
            }
            var hour = +match[4];
            var minute = +match[5];
            var second = +match[6];
            if (match[7]) {
                fraction = match[7].slice(0, 3);
                while (fraction.length < 3) {
                    fraction += "0";
                }
                fraction = +fraction;
            }
            if (match[9]) {
                var tzHour = +match[10];
                var tzMinute = +(match[11] || 0);
                delta = (tzHour * 60 + tzMinute) * 6e4;
                if (match[9] === "-") delta = -delta;
            }
            var date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction));
            if (delta) date.setTime(date.getTime() - delta);
            return date;
        }
        function representYamlTimestamp(object) {
            return object.toISOString();
        }
        timestamp = new Type2("tag:yaml.org,2002:timestamp", {
            kind: "scalar",
            resolve: resolveYamlTimestamp,
            construct: constructYamlTimestamp,
            instanceOf: Date,
            represent: representYamlTimestamp
        });
        return timestamp;
    }
    var merge;
    var hasRequiredMerge;
    function requireMerge() {
        if (hasRequiredMerge) return merge;
        hasRequiredMerge = 1;
        var Type2 = requireType();
        function resolveYamlMerge(data) {
            return data === "<<" || data === null;
        }
        merge = new Type2("tag:yaml.org,2002:merge", {
            kind: "scalar",
            resolve: resolveYamlMerge
        });
        return merge;
    }
    var binary;
    var hasRequiredBinary;
    function requireBinary() {
        if (hasRequiredBinary) return binary;
        hasRequiredBinary = 1;
        var Type2 = requireType();
        var BASE64_MAP = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";
        function resolveYamlBinary(data) {
            if (data === null) return false;
            var bitlen = 0;
            var max = data.length;
            var map2 = BASE64_MAP;
            for (var idx = 0; idx < max; idx++) {
                var code = map2.indexOf(data.charAt(idx));
                if (code > 64) continue;
                if (code < 0) return false;
                bitlen += 6;
            }
            return bitlen % 8 === 0;
        }
        function constructYamlBinary(data) {
            var input = data.replace(/[\r\n=]/g, "");
            var max = input.length;
            var map2 = BASE64_MAP;
            var bits = 0;
            var result = [];
            for (var idx = 0; idx < max; idx++) {
                if (idx % 4 === 0 && idx) {
                    result.push(bits >> 16 & 255);
                    result.push(bits >> 8 & 255);
                    result.push(bits & 255);
                }
                bits = bits << 6 | map2.indexOf(input.charAt(idx));
            }
            var tailbits = max % 4 * 6;
            if (tailbits === 0) {
                result.push(bits >> 16 & 255);
                result.push(bits >> 8 & 255);
                result.push(bits & 255);
            } else if (tailbits === 18) {
                result.push(bits >> 10 & 255);
                result.push(bits >> 2 & 255);
            } else if (tailbits === 12) {
                result.push(bits >> 4 & 255);
            }
            return new Uint8Array(result);
        }
        function representYamlBinary(object) {
            var result = "";
            var bits = 0;
            var max = object.length;
            var map2 = BASE64_MAP;
            for (var idx = 0; idx < max; idx++) {
                if (idx % 3 === 0 && idx) {
                    result += map2[bits >> 18 & 63];
                    result += map2[bits >> 12 & 63];
                    result += map2[bits >> 6 & 63];
                    result += map2[bits & 63];
                }
                bits = (bits << 8) + object[idx];
            }
            var tail = max % 3;
            if (tail === 0) {
                result += map2[bits >> 18 & 63];
                result += map2[bits >> 12 & 63];
                result += map2[bits >> 6 & 63];
                result += map2[bits & 63];
            } else if (tail === 2) {
                result += map2[bits >> 10 & 63];
                result += map2[bits >> 4 & 63];
                result += map2[bits << 2 & 63];
                result += map2[64];
            } else if (tail === 1) {
                result += map2[bits >> 2 & 63];
                result += map2[bits << 4 & 63];
                result += map2[64];
                result += map2[64];
            }
            return result;
        }
        function isBinary(obj) {
            return Object.prototype.toString.call(obj) === "[object Uint8Array]";
        }
        binary = new Type2("tag:yaml.org,2002:binary", {
            kind: "scalar",
            resolve: resolveYamlBinary,
            construct: constructYamlBinary,
            predicate: isBinary,
            represent: representYamlBinary
        });
        return binary;
    }
    var omap;
    var hasRequiredOmap;
    function requireOmap() {
        if (hasRequiredOmap) return omap;
        hasRequiredOmap = 1;
        var Type2 = requireType();
        var _hasOwnProperty = Object.prototype.hasOwnProperty;
        var _toString = Object.prototype.toString;
        function resolveYamlOmap(data) {
            if (data === null) return true;
            var objectKeys = [];
            var object = data;
            for (var index = 0, length = object.length; index < length; index += 1) {
                var pair = object[index];
                var pairHasKey = false;
                if (_toString.call(pair) !== "[object Object]") return false;
                var pairKey = void 0;
                for (pairKey in pair) {
                    if (_hasOwnProperty.call(pair, pairKey)) {
                        if (!pairHasKey) pairHasKey = true; else return false;
                    }
                }
                if (!pairHasKey) return false;
                if (objectKeys.indexOf(pairKey) === -1) objectKeys.push(pairKey); else return false;
            }
            return true;
        }
        function constructYamlOmap(data) {
            return data !== null ? data : [];
        }
        omap = new Type2("tag:yaml.org,2002:omap", {
            kind: "sequence",
            resolve: resolveYamlOmap,
            construct: constructYamlOmap
        });
        return omap;
    }
    var pairs;
    var hasRequiredPairs;
    function requirePairs() {
        if (hasRequiredPairs) return pairs;
        hasRequiredPairs = 1;
        var Type2 = requireType();
        var _toString = Object.prototype.toString;
        function resolveYamlPairs(data) {
            if (data === null) return true;
            var object = data;
            var result = new Array(object.length);
            for (var index = 0, length = object.length; index < length; index += 1) {
                var pair = object[index];
                if (_toString.call(pair) !== "[object Object]") return false;
                var keys = Object.keys(pair);
                if (keys.length !== 1) return false;
                result[index] = [ keys[0], pair[keys[0]] ];
            }
            return true;
        }
        function constructYamlPairs(data) {
            if (data === null) return [];
            var object = data;
            var result = new Array(object.length);
            for (var index = 0, length = object.length; index < length; index += 1) {
                var pair = object[index];
                var keys = Object.keys(pair);
                result[index] = [ keys[0], pair[keys[0]] ];
            }
            return result;
        }
        pairs = new Type2("tag:yaml.org,2002:pairs", {
            kind: "sequence",
            resolve: resolveYamlPairs,
            construct: constructYamlPairs
        });
        return pairs;
    }
    var set;
    var hasRequiredSet;
    function requireSet() {
        if (hasRequiredSet) return set;
        hasRequiredSet = 1;
        var Type2 = requireType();
        var _hasOwnProperty = Object.prototype.hasOwnProperty;
        function resolveYamlSet(data) {
            if (data === null) return true;
            var object = data;
            for (var key in object) {
                if (_hasOwnProperty.call(object, key)) {
                    if (object[key] !== null) return false;
                }
            }
            return true;
        }
        function constructYamlSet(data) {
            return data !== null ? data : {};
        }
        set = new Type2("tag:yaml.org,2002:set", {
            kind: "mapping",
            resolve: resolveYamlSet,
            construct: constructYamlSet
        });
        return set;
    }
    var _default;
    var hasRequired_default;
    function require_default() {
        if (hasRequired_default) return _default;
        hasRequired_default = 1;
        _default = requireCore().extend({
            implicit: [ requireTimestamp(), requireMerge() ],
            explicit: [ requireBinary(), requireOmap(), requirePairs(), requireSet() ]
        });
        return _default;
    }
    var hasRequiredLoader;
    function requireLoader() {
        if (hasRequiredLoader) return loader;
        hasRequiredLoader = 1;
        function _typeof(o) {
            "@babel/helpers - typeof";
            return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
                return typeof o2;
            } : function(o2) {
                return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
            }, _typeof(o);
        }
        var common2 = requireCommon();
        var YAMLException2 = requireException();
        var makeSnippet = requireSnippet();
        var DEFAULT_SCHEMA2 = require_default();
        var _hasOwnProperty = Object.prototype.hasOwnProperty;
        var CONTEXT_FLOW_IN = 1;
        var CONTEXT_FLOW_OUT = 2;
        var CONTEXT_BLOCK_IN = 3;
        var CONTEXT_BLOCK_OUT = 4;
        var CHOMPING_CLIP = 1;
        var CHOMPING_STRIP = 2;
        var CHOMPING_KEEP = 3;
        var PATTERN_NON_PRINTABLE = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;
        var PATTERN_NON_ASCII_LINE_BREAKS = /[\x85\u2028\u2029]/;
        var PATTERN_FLOW_INDICATORS = /[,\[\]{}]/;
        var PATTERN_TAG_HANDLE = /^(?:!|!!|![0-9A-Za-z-]+!)$/;
        var PATTERN_TAG_URI = /^(?:!|[^,\[\]{}])(?:%[0-9a-f]{2}|[0-9a-z\-#;/?:@&=+$,_.!~*'()\[\]])*$/i;
        function _class(obj) {
            return Object.prototype.toString.call(obj);
        }
        function isEol(c) {
            return c === 10 || c === 13;
        }
        function isWhiteSpace(c) {
            return c === 9 || c === 32;
        }
        function isWsOrEol(c) {
            return c === 9 || c === 32 || c === 10 || c === 13;
        }
        function isFlowIndicator(c) {
            return c === 44 || c === 91 || c === 93 || c === 123 || c === 125;
        }
        function fromHexCode(c) {
            if (c >= 48 && c <= 57) {
                return c - 48;
            }
            var lc = c | 32;
            if (lc >= 97 && lc <= 102) {
                return lc - 97 + 10;
            }
            return -1;
        }
        function escapedHexLen(c) {
            if (c === 120) {
                return 2;
            }
            if (c === 117) {
                return 4;
            }
            if (c === 85) {
                return 8;
            }
            return 0;
        }
        function fromDecimalCode(c) {
            if (c >= 48 && c <= 57) {
                return c - 48;
            }
            return -1;
        }
        function simpleEscapeSequence(c) {
            switch (c) {
              case 48:
                return "\0";

              case 97:
                return "";

              case 98:
                return "\b";

              case 116:
                return "\t";

              case 9:
                return "\t";

              case 110:
                return "\n";

              case 118:
                return "\v";

              case 102:
                return "\f";

              case 114:
                return "\r";

              case 101:
                return "";

              case 32:
                return " ";

              case 34:
                return '"';

              case 47:
                return "/";

              case 92:
                return "\\";

              case 78:
                return "Â…";

              case 95:
                return "Â ";

              case 76:
                return "\u2028";

              case 80:
                return "\u2029";

              default:
                return "";
            }
        }
        function charFromCodepoint(c) {
            if (c <= 65535) {
                return String.fromCharCode(c);
            }
            return String.fromCharCode((c - 65536 >> 10) + 55296, (c - 65536 & 1023) + 56320);
        }
        function setProperty(object, key, value) {
            if (key === "__proto__") {
                Object.defineProperty(object, key, {
                    configurable: true,
                    enumerable: true,
                    writable: true,
                    value: value
                });
            } else {
                object[key] = value;
            }
        }
        var simpleEscapeCheck = new Array(256);
        var simpleEscapeMap = new Array(256);
        for (var i = 0; i < 256; i++) {
            simpleEscapeCheck[i] = simpleEscapeSequence(i) ? 1 : 0;
            simpleEscapeMap[i] = simpleEscapeSequence(i);
        }
        function State(input, options) {
            this.input = input;
            this.filename = options["filename"] || null;
            this.schema = options["schema"] || DEFAULT_SCHEMA2;
            this.onWarning = options["onWarning"] || null;
            this.legacy = options["legacy"] || false;
            this.json = options["json"] || false;
            this.listener = options["listener"] || null;
            this.maxDepth = typeof options["maxDepth"] === "number" ? options["maxDepth"] : 100;
            this.maxTotalMergeKeys = typeof options["maxTotalMergeKeys"] === "number" ? options["maxTotalMergeKeys"] : 1e4;
            this.implicitTypes = this.schema.compiledImplicit;
            this.typeMap = this.schema.compiledTypeMap;
            this.length = input.length;
            this.position = 0;
            this.line = 0;
            this.lineStart = 0;
            this.lineIndent = 0;
            this.depth = 0;
            this.totalMergeKeys = 0;
            this.firstTabInLine = -1;
            this.documents = [];
            this.anchorMapTransactions = [];
        }
        function generateError(state, message) {
            var mark = {
                name: state.filename,
                buffer: state.input.slice(0, -1),
                position: state.position,
                line: state.line,
                column: state.position - state.lineStart
            };
            mark.snippet = makeSnippet(mark);
            return new YAMLException2(message, mark);
        }
        function throwError(state, message) {
            throw generateError(state, message);
        }
        function throwWarning(state, message) {
            if (state.onWarning) {
                state.onWarning.call(null, generateError(state, message));
            }
        }
        function storeAnchor(state, name, value) {
            var transactions = state.anchorMapTransactions;
            if (transactions.length !== 0) {
                var transaction = transactions[transactions.length - 1];
                if (!_hasOwnProperty.call(transaction, name)) {
                    transaction[name] = {
                        existed: _hasOwnProperty.call(state.anchorMap, name),
                        value: state.anchorMap[name]
                    };
                }
            }
            state.anchorMap[name] = value;
        }
        function beginAnchorTransaction(state) {
            state.anchorMapTransactions.push(Object.create(null));
        }
        function commitAnchorTransaction(state) {
            var transaction = state.anchorMapTransactions.pop();
            var transactions = state.anchorMapTransactions;
            if (transactions.length === 0) return;
            var parent = transactions[transactions.length - 1];
            var names = Object.keys(transaction);
            for (var index = 0, length = names.length; index < length; index += 1) {
                var name = names[index];
                if (!_hasOwnProperty.call(parent, name)) {
                    parent[name] = transaction[name];
                }
            }
        }
        function rollbackAnchorTransaction(state) {
            var transaction = state.anchorMapTransactions.pop();
            var names = Object.keys(transaction);
            for (var index = names.length - 1; index >= 0; index -= 1) {
                var entry = transaction[names[index]];
                if (entry.existed) {
                    state.anchorMap[names[index]] = entry.value;
                } else {
                    delete state.anchorMap[names[index]];
                }
            }
        }
        function snapshotState(state) {
            return {
                position: state.position,
                line: state.line,
                lineStart: state.lineStart,
                lineIndent: state.lineIndent,
                firstTabInLine: state.firstTabInLine,
                tag: state.tag,
                anchor: state.anchor,
                kind: state.kind,
                result: state.result
            };
        }
        function restoreState(state, snapshot) {
            state.position = snapshot.position;
            state.line = snapshot.line;
            state.lineStart = snapshot.lineStart;
            state.lineIndent = snapshot.lineIndent;
            state.firstTabInLine = snapshot.firstTabInLine;
            state.tag = snapshot.tag;
            state.anchor = snapshot.anchor;
            state.kind = snapshot.kind;
            state.result = snapshot.result;
        }
        var directiveHandlers = {
            YAML: function handleYamlDirective(state, name, args) {
                if (state.version !== null) {
                    throwError(state, "duplication of %YAML directive");
                }
                if (args.length !== 1) {
                    throwError(state, "YAML directive accepts exactly one argument");
                }
                var match = /^([0-9]+)\.([0-9]+)$/.exec(args[0]);
                if (match === null) {
                    throwError(state, "ill-formed argument of the YAML directive");
                }
                var major = parseInt(match[1], 10);
                var minor = parseInt(match[2], 10);
                if (major !== 1) {
                    throwError(state, "unacceptable YAML version of the document");
                }
                state.version = args[0];
                state.checkLineBreaks = minor < 2;
                if (minor !== 1 && minor !== 2) {
                    throwWarning(state, "unsupported YAML version of the document");
                }
            },
            TAG: function handleTagDirective(state, name, args) {
                var prefix;
                if (args.length !== 2) {
                    throwError(state, "TAG directive accepts exactly two arguments");
                }
                var handle = args[0];
                prefix = args[1];
                if (!PATTERN_TAG_HANDLE.test(handle)) {
                    throwError(state, "ill-formed tag handle (first argument) of the TAG directive");
                }
                if (_hasOwnProperty.call(state.tagMap, handle)) {
                    throwError(state, 'there is a previously declared suffix for "' + handle + '" tag handle');
                }
                if (!PATTERN_TAG_URI.test(prefix)) {
                    throwError(state, "ill-formed tag prefix (second argument) of the TAG directive");
                }
                try {
                    prefix = decodeURIComponent(prefix);
                } catch (err) {
                    throwError(state, "tag prefix is malformed: " + prefix);
                }
                state.tagMap[handle] = prefix;
            }
        };
        function captureSegment(state, start, end, checkJson) {
            if (start < end) {
                var _result = state.input.slice(start, end);
                if (checkJson) {
                    for (var _position = 0, _length = _result.length; _position < _length; _position += 1) {
                        var _character = _result.charCodeAt(_position);
                        if (!(_character === 9 || _character >= 32 && _character <= 1114111)) {
                            throwError(state, "expected valid JSON character");
                        }
                    }
                } else if (PATTERN_NON_PRINTABLE.test(_result)) {
                    throwError(state, "the stream contains non-printable characters");
                }
                state.result += _result;
            }
        }
        function mergeMappings(state, destination, source, overridableKeys) {
            if (!common2.isObject(source)) {
                throwError(state, "cannot merge mappings; the provided source object is unacceptable");
            }
            var sourceKeys = Object.keys(source);
            for (var index = 0, quantity = sourceKeys.length; index < quantity; index += 1) {
                var key = sourceKeys[index];
                if (state.maxTotalMergeKeys !== -1 && ++state.totalMergeKeys > state.maxTotalMergeKeys) {
                    throwError(state, "merge keys exceeded maxTotalMergeKeys (" + state.maxTotalMergeKeys + ")");
                }
                if (!_hasOwnProperty.call(destination, key)) {
                    setProperty(destination, key, source[key]);
                    overridableKeys[key] = true;
                }
            }
        }
        function storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, startLine, startLineStart, startPos) {
            if (Array.isArray(keyNode)) {
                keyNode = Array.prototype.slice.call(keyNode);
                for (var index = 0, quantity = keyNode.length; index < quantity; index += 1) {
                    if (Array.isArray(keyNode[index])) {
                        throwError(state, "nested arrays are not supported inside keys");
                    }
                    if (_typeof(keyNode) === "object" && _class(keyNode[index]) === "[object Object]") {
                        keyNode[index] = "[object Object]";
                    }
                }
            }
            if (_typeof(keyNode) === "object" && _class(keyNode) === "[object Object]") {
                keyNode = "[object Object]";
            }
            keyNode = String(keyNode);
            if (_result === null) {
                _result = {};
            }
            if (keyTag === "tag:yaml.org,2002:merge") {
                if (Array.isArray(valueNode)) {
                    for (var _index = 0, _quantity = valueNode.length; _index < _quantity; _index += 1) {
                        mergeMappings(state, _result, valueNode[_index], overridableKeys);
                    }
                } else {
                    mergeMappings(state, _result, valueNode, overridableKeys);
                }
            } else {
                if (!state.json && !_hasOwnProperty.call(overridableKeys, keyNode) && _hasOwnProperty.call(_result, keyNode)) {
                    state.line = startLine || state.line;
                    state.lineStart = startLineStart || state.lineStart;
                    state.position = startPos || state.position;
                    throwError(state, "duplicated mapping key");
                }
                setProperty(_result, keyNode, valueNode);
                delete overridableKeys[keyNode];
            }
            return _result;
        }
        function readLineBreak(state) {
            var ch = state.input.charCodeAt(state.position);
            if (ch === 10) {
                state.position++;
            } else if (ch === 13) {
                state.position++;
                if (state.input.charCodeAt(state.position) === 10) {
                    state.position++;
                }
            } else {
                throwError(state, "a line break is expected");
            }
            state.line += 1;
            state.lineStart = state.position;
            state.firstTabInLine = -1;
        }
        function skipSeparationSpace(state, allowComments, checkIndent) {
            var lineBreaks = 0;
            var ch = state.input.charCodeAt(state.position);
            while (ch !== 0) {
                while (isWhiteSpace(ch)) {
                    if (ch === 9 && state.firstTabInLine === -1) {
                        state.firstTabInLine = state.position;
                    }
                    ch = state.input.charCodeAt(++state.position);
                }
                if (allowComments && ch === 35) {
                    do {
                        ch = state.input.charCodeAt(++state.position);
                    } while (ch !== 10 && ch !== 13 && ch !== 0);
                }
                if (isEol(ch)) {
                    readLineBreak(state);
                    ch = state.input.charCodeAt(state.position);
                    lineBreaks++;
                    state.lineIndent = 0;
                    while (ch === 32) {
                        state.lineIndent++;
                        ch = state.input.charCodeAt(++state.position);
                    }
                } else {
                    break;
                }
            }
            if (checkIndent !== -1 && lineBreaks !== 0 && state.lineIndent < checkIndent) {
                throwWarning(state, "deficient indentation");
            }
            return lineBreaks;
        }
        function testDocumentSeparator(state) {
            var _position = state.position;
            var ch = state.input.charCodeAt(_position);
            if ((ch === 45 || ch === 46) && ch === state.input.charCodeAt(_position + 1) && ch === state.input.charCodeAt(_position + 2)) {
                _position += 3;
                ch = state.input.charCodeAt(_position);
                if (ch === 0 || isWsOrEol(ch)) {
                    return true;
                }
            }
            return false;
        }
        function writeFoldedLines(state, count) {
            if (count === 1) {
                state.result += " ";
            } else if (count > 1) {
                state.result += common2.repeat("\n", count - 1);
            }
        }
        function readPlainScalar(state, nodeIndent, withinFlowCollection) {
            var captureStart;
            var captureEnd;
            var hasPendingContent;
            var _line;
            var _lineStart;
            var _lineIndent;
            var _kind = state.kind;
            var _result = state.result;
            var ch = state.input.charCodeAt(state.position);
            if (isWsOrEol(ch) || isFlowIndicator(ch) || ch === 35 || ch === 38 || ch === 42 || ch === 33 || ch === 124 || ch === 62 || ch === 39 || ch === 34 || ch === 37 || ch === 64 || ch === 96) {
                return false;
            }
            if (ch === 63 || ch === 45) {
                var following = state.input.charCodeAt(state.position + 1);
                if (isWsOrEol(following) || withinFlowCollection && isFlowIndicator(following)) {
                    return false;
                }
            }
            state.kind = "scalar";
            state.result = "";
            captureStart = captureEnd = state.position;
            hasPendingContent = false;
            while (ch !== 0) {
                if (ch === 58) {
                    var _following = state.input.charCodeAt(state.position + 1);
                    if (isWsOrEol(_following) || withinFlowCollection && isFlowIndicator(_following)) {
                        break;
                    }
                } else if (ch === 35) {
                    var preceding = state.input.charCodeAt(state.position - 1);
                    if (isWsOrEol(preceding)) {
                        break;
                    }
                } else if (state.position === state.lineStart && testDocumentSeparator(state) || withinFlowCollection && isFlowIndicator(ch)) {
                    break;
                } else if (isEol(ch)) {
                    _line = state.line;
                    _lineStart = state.lineStart;
                    _lineIndent = state.lineIndent;
                    skipSeparationSpace(state, false, -1);
                    if (state.lineIndent >= nodeIndent) {
                        hasPendingContent = true;
                        ch = state.input.charCodeAt(state.position);
                        continue;
                    } else {
                        state.position = captureEnd;
                        state.line = _line;
                        state.lineStart = _lineStart;
                        state.lineIndent = _lineIndent;
                        break;
                    }
                }
                if (hasPendingContent) {
                    captureSegment(state, captureStart, captureEnd, false);
                    writeFoldedLines(state, state.line - _line);
                    captureStart = captureEnd = state.position;
                    hasPendingContent = false;
                }
                if (!isWhiteSpace(ch)) {
                    captureEnd = state.position + 1;
                }
                ch = state.input.charCodeAt(++state.position);
            }
            captureSegment(state, captureStart, captureEnd, false);
            if (state.result) {
                return true;
            }
            state.kind = _kind;
            state.result = _result;
            return false;
        }
        function readSingleQuotedScalar(state, nodeIndent) {
            var captureStart;
            var captureEnd;
            var ch = state.input.charCodeAt(state.position);
            if (ch !== 39) {
                return false;
            }
            state.kind = "scalar";
            state.result = "";
            state.position++;
            captureStart = captureEnd = state.position;
            while ((ch = state.input.charCodeAt(state.position)) !== 0) {
                if (ch === 39) {
                    captureSegment(state, captureStart, state.position, true);
                    ch = state.input.charCodeAt(++state.position);
                    if (ch === 39) {
                        captureStart = state.position;
                        state.position++;
                        captureEnd = state.position;
                    } else {
                        return true;
                    }
                } else if (isEol(ch)) {
                    captureSegment(state, captureStart, captureEnd, true);
                    writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent));
                    captureStart = captureEnd = state.position;
                } else if (state.position === state.lineStart && testDocumentSeparator(state)) {
                    throwError(state, "unexpected end of the document within a single quoted scalar");
                } else {
                    state.position++;
                    if (!isWhiteSpace(ch)) {
                        captureEnd = state.position;
                    }
                }
            }
            throwError(state, "unexpected end of the stream within a single quoted scalar");
        }
        function readDoubleQuotedScalar(state, nodeIndent) {
            var captureStart;
            var captureEnd;
            var tmp;
            var ch = state.input.charCodeAt(state.position);
            if (ch !== 34) {
                return false;
            }
            state.kind = "scalar";
            state.result = "";
            state.position++;
            captureStart = captureEnd = state.position;
            while ((ch = state.input.charCodeAt(state.position)) !== 0) {
                if (ch === 34) {
                    captureSegment(state, captureStart, state.position, true);
                    state.position++;
                    return true;
                } else if (ch === 92) {
                    captureSegment(state, captureStart, state.position, true);
                    ch = state.input.charCodeAt(++state.position);
                    if (isEol(ch)) {
                        skipSeparationSpace(state, false, nodeIndent);
                    } else if (ch < 256 && simpleEscapeCheck[ch]) {
                        state.result += simpleEscapeMap[ch];
                        state.position++;
                    } else if ((tmp = escapedHexLen(ch)) > 0) {
                        var hexLength = tmp;
                        var hexResult = 0;
                        for (;hexLength > 0; hexLength--) {
                            ch = state.input.charCodeAt(++state.position);
                            if ((tmp = fromHexCode(ch)) >= 0) {
                                hexResult = (hexResult << 4) + tmp;
                            } else {
                                throwError(state, "expected hexadecimal character");
                            }
                        }
                        state.result += charFromCodepoint(hexResult);
                        state.position++;
                    } else {
                        throwError(state, "unknown escape sequence");
                    }
                    captureStart = captureEnd = state.position;
                } else if (isEol(ch)) {
                    captureSegment(state, captureStart, captureEnd, true);
                    writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent));
                    captureStart = captureEnd = state.position;
                } else if (state.position === state.lineStart && testDocumentSeparator(state)) {
                    throwError(state, "unexpected end of the document within a double quoted scalar");
                } else {
                    state.position++;
                    if (!isWhiteSpace(ch)) {
                        captureEnd = state.position;
                    }
                }
            }
            throwError(state, "unexpected end of the stream within a double quoted scalar");
        }
        function readFlowCollection(state, nodeIndent) {
            var readNext = true;
            var _line;
            var _lineStart;
            var _pos;
            var _tag = state.tag;
            var _result;
            var _anchor = state.anchor;
            var terminator;
            var isPair;
            var isExplicitPair;
            var isMapping;
            var overridableKeys = Object.create(null);
            var keyNode;
            var keyTag;
            var valueNode;
            var ch = state.input.charCodeAt(state.position);
            if (ch === 91) {
                terminator = 93;
                isMapping = false;
                _result = [];
            } else if (ch === 123) {
                terminator = 125;
                isMapping = true;
                _result = {};
            } else {
                return false;
            }
            if (state.anchor !== null) {
                storeAnchor(state, state.anchor, _result);
            }
            ch = state.input.charCodeAt(++state.position);
            while (ch !== 0) {
                skipSeparationSpace(state, true, nodeIndent);
                ch = state.input.charCodeAt(state.position);
                if (ch === terminator) {
                    state.position++;
                    state.tag = _tag;
                    state.anchor = _anchor;
                    state.kind = isMapping ? "mapping" : "sequence";
                    state.result = _result;
                    return true;
                } else if (!readNext) {
                    throwError(state, "missed comma between flow collection entries");
                } else if (ch === 44) {
                    throwError(state, "expected the node content, but found ','");
                }
                keyTag = keyNode = valueNode = null;
                isPair = isExplicitPair = false;
                if (ch === 63) {
                    var following = state.input.charCodeAt(state.position + 1);
                    if (isWsOrEol(following)) {
                        isPair = isExplicitPair = true;
                        state.position++;
                        skipSeparationSpace(state, true, nodeIndent);
                    }
                }
                _line = state.line;
                _lineStart = state.lineStart;
                _pos = state.position;
                composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true);
                keyTag = state.tag;
                keyNode = state.result;
                skipSeparationSpace(state, true, nodeIndent);
                ch = state.input.charCodeAt(state.position);
                if ((isExplicitPair || state.line === _line) && ch === 58) {
                    isPair = true;
                    ch = state.input.charCodeAt(++state.position);
                    skipSeparationSpace(state, true, nodeIndent);
                    composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true);
                    valueNode = state.result;
                }
                if (isMapping) {
                    storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos);
                } else if (isPair) {
                    _result.push(storeMappingPair(state, null, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos));
                } else {
                    _result.push(keyNode);
                }
                skipSeparationSpace(state, true, nodeIndent);
                ch = state.input.charCodeAt(state.position);
                if (ch === 44) {
                    readNext = true;
                    ch = state.input.charCodeAt(++state.position);
                } else {
                    readNext = false;
                }
            }
            throwError(state, "unexpected end of the stream within a flow collection");
        }
        function readBlockScalar(state, nodeIndent) {
            var folding;
            var chomping = CHOMPING_CLIP;
            var didReadContent = false;
            var detectedIndent = false;
            var textIndent = nodeIndent;
            var emptyLines = 0;
            var atMoreIndented = false;
            var tmp;
            var ch = state.input.charCodeAt(state.position);
            if (ch === 124) {
                folding = false;
            } else if (ch === 62) {
                folding = true;
            } else {
                return false;
            }
            state.kind = "scalar";
            state.result = "";
            while (ch !== 0) {
                ch = state.input.charCodeAt(++state.position);
                if (ch === 43 || ch === 45) {
                    if (CHOMPING_CLIP === chomping) {
                        chomping = ch === 43 ? CHOMPING_KEEP : CHOMPING_STRIP;
                    } else {
                        throwError(state, "repeat of a chomping mode identifier");
                    }
                } else if ((tmp = fromDecimalCode(ch)) >= 0) {
                    if (tmp === 0) {
                        throwError(state, "bad explicit indentation width of a block scalar; it cannot be less than one");
                    } else if (!detectedIndent) {
                        textIndent = nodeIndent + tmp - 1;
                        detectedIndent = true;
                    } else {
                        throwError(state, "repeat of an indentation width identifier");
                    }
                } else {
                    break;
                }
            }
            if (isWhiteSpace(ch)) {
                do {
                    ch = state.input.charCodeAt(++state.position);
                } while (isWhiteSpace(ch));
                if (ch === 35) {
                    do {
                        ch = state.input.charCodeAt(++state.position);
                    } while (!isEol(ch) && ch !== 0);
                }
            }
            while (ch !== 0) {
                readLineBreak(state);
                state.lineIndent = 0;
                ch = state.input.charCodeAt(state.position);
                while ((!detectedIndent || state.lineIndent < textIndent) && ch === 32) {
                    state.lineIndent++;
                    ch = state.input.charCodeAt(++state.position);
                }
                if (!detectedIndent && state.lineIndent > textIndent) {
                    textIndent = state.lineIndent;
                }
                if (isEol(ch)) {
                    emptyLines++;
                    continue;
                }
                if (!detectedIndent && textIndent === 0) {
                    throwError(state, "missing indentation for block scalar");
                }
                if (state.lineIndent < textIndent) {
                    if (chomping === CHOMPING_KEEP) {
                        state.result += common2.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines);
                    } else if (chomping === CHOMPING_CLIP) {
                        if (didReadContent) {
                            state.result += "\n";
                        }
                    }
                    break;
                }
                if (folding) {
                    if (isWhiteSpace(ch)) {
                        atMoreIndented = true;
                        state.result += common2.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines);
                    } else if (atMoreIndented) {
                        atMoreIndented = false;
                        state.result += common2.repeat("\n", emptyLines + 1);
                    } else if (emptyLines === 0) {
                        if (didReadContent) {
                            state.result += " ";
                        }
                    } else {
                        state.result += common2.repeat("\n", emptyLines);
                    }
                } else {
                    state.result += common2.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines);
                }
                didReadContent = true;
                detectedIndent = true;
                emptyLines = 0;
                var captureStart = state.position;
                while (!isEol(ch) && ch !== 0) {
                    ch = state.input.charCodeAt(++state.position);
                }
                captureSegment(state, captureStart, state.position, false);
            }
            return true;
        }
        function readBlockSequence(state, nodeIndent) {
            var _tag = state.tag;
            var _anchor = state.anchor;
            var _result = [];
            var detected = false;
            if (state.firstTabInLine !== -1) return false;
            if (state.anchor !== null) {
                storeAnchor(state, state.anchor, _result);
            }
            var ch = state.input.charCodeAt(state.position);
            while (ch !== 0) {
                if (state.firstTabInLine !== -1) {
                    state.position = state.firstTabInLine;
                    throwError(state, "tab characters must not be used in indentation");
                }
                if (ch !== 45) {
                    break;
                }
                var following = state.input.charCodeAt(state.position + 1);
                if (!isWsOrEol(following)) {
                    break;
                }
                detected = true;
                state.position++;
                if (skipSeparationSpace(state, true, -1)) {
                    if (state.lineIndent <= nodeIndent) {
                        _result.push(null);
                        ch = state.input.charCodeAt(state.position);
                        continue;
                    }
                }
                var _line = state.line;
                composeNode(state, nodeIndent, CONTEXT_BLOCK_IN, false, true);
                _result.push(state.result);
                skipSeparationSpace(state, true, -1);
                ch = state.input.charCodeAt(state.position);
                if ((state.line === _line || state.lineIndent > nodeIndent) && ch !== 0) {
                    throwError(state, "bad indentation of a sequence entry");
                } else if (state.lineIndent < nodeIndent) {
                    break;
                }
            }
            if (detected) {
                state.tag = _tag;
                state.anchor = _anchor;
                state.kind = "sequence";
                state.result = _result;
                return true;
            }
            return false;
        }
        function readBlockMapping(state, nodeIndent, flowIndent) {
            var allowCompact;
            var _keyLine;
            var _keyLineStart;
            var _keyPos;
            var _tag = state.tag;
            var _anchor = state.anchor;
            var _result = {};
            var overridableKeys = Object.create(null);
            var keyTag = null;
            var keyNode = null;
            var valueNode = null;
            var atExplicitKey = false;
            var detected = false;
            if (state.firstTabInLine !== -1) return false;
            if (state.anchor !== null) {
                storeAnchor(state, state.anchor, _result);
            }
            var ch = state.input.charCodeAt(state.position);
            while (ch !== 0) {
                if (!atExplicitKey && state.firstTabInLine !== -1) {
                    state.position = state.firstTabInLine;
                    throwError(state, "tab characters must not be used in indentation");
                }
                var following = state.input.charCodeAt(state.position + 1);
                var _line = state.line;
                if ((ch === 63 || ch === 58) && isWsOrEol(following)) {
                    if (ch === 63) {
                        if (atExplicitKey) {
                            storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos);
                            keyTag = keyNode = valueNode = null;
                        }
                        detected = true;
                        atExplicitKey = true;
                        allowCompact = true;
                    } else if (atExplicitKey) {
                        atExplicitKey = false;
                        allowCompact = true;
                    } else {
                        throwError(state, "incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line");
                    }
                    state.position += 1;
                    ch = following;
                } else {
                    _keyLine = state.line;
                    _keyLineStart = state.lineStart;
                    _keyPos = state.position;
                    if (!composeNode(state, flowIndent, CONTEXT_FLOW_OUT, false, true)) {
                        break;
                    }
                    if (state.line === _line) {
                        ch = state.input.charCodeAt(state.position);
                        while (isWhiteSpace(ch)) {
                            ch = state.input.charCodeAt(++state.position);
                        }
                        if (ch === 58) {
                            ch = state.input.charCodeAt(++state.position);
                            if (!isWsOrEol(ch)) {
                                throwError(state, "a whitespace character is expected after the key-value separator within a block mapping");
                            }
                            if (atExplicitKey) {
                                storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos);
                                keyTag = keyNode = valueNode = null;
                            }
                            detected = true;
                            atExplicitKey = false;
                            allowCompact = false;
                            keyTag = state.tag;
                            keyNode = state.result;
                        } else if (detected) {
                            throwError(state, "can not read an implicit mapping pair; a colon is missed");
                        } else {
                            state.tag = _tag;
                            state.anchor = _anchor;
                            return true;
                        }
                    } else if (detected) {
                        throwError(state, "can not read a block mapping entry; a multiline key may not be an implicit key");
                    } else {
                        state.tag = _tag;
                        state.anchor = _anchor;
                        return true;
                    }
                }
                if (state.line === _line || state.lineIndent > nodeIndent) {
                    if (atExplicitKey) {
                        _keyLine = state.line;
                        _keyLineStart = state.lineStart;
                        _keyPos = state.position;
                    }
                    if (composeNode(state, nodeIndent, CONTEXT_BLOCK_OUT, true, allowCompact)) {
                        if (atExplicitKey) {
                            keyNode = state.result;
                        } else {
                            valueNode = state.result;
                        }
                    }
                    if (!atExplicitKey) {
                        storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _keyLine, _keyLineStart, _keyPos);
                        keyTag = keyNode = valueNode = null;
                    }
                    skipSeparationSpace(state, true, -1);
                    ch = state.input.charCodeAt(state.position);
                }
                if ((state.line === _line || state.lineIndent > nodeIndent) && ch !== 0) {
                    throwError(state, "bad indentation of a mapping entry");
                } else if (state.lineIndent < nodeIndent) {
                    break;
                }
            }
            if (atExplicitKey) {
                storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos);
            }
            if (detected) {
                state.tag = _tag;
                state.anchor = _anchor;
                state.kind = "mapping";
                state.result = _result;
            }
            return detected;
        }
        function readTagProperty(state) {
            var isVerbatim = false;
            var isNamed = false;
            var tagHandle;
            var tagName;
            var ch = state.input.charCodeAt(state.position);
            if (ch !== 33) return false;
            if (state.tag !== null) {
                throwError(state, "duplication of a tag property");
            }
            ch = state.input.charCodeAt(++state.position);
            if (ch === 60) {
                isVerbatim = true;
                ch = state.input.charCodeAt(++state.position);
            } else if (ch === 33) {
                isNamed = true;
                tagHandle = "!!";
                ch = state.input.charCodeAt(++state.position);
            } else {
                tagHandle = "!";
            }
            var _position = state.position;
            if (isVerbatim) {
                do {
                    ch = state.input.charCodeAt(++state.position);
                } while (ch !== 0 && ch !== 62);
                if (state.position < state.length) {
                    tagName = state.input.slice(_position, state.position);
                    ch = state.input.charCodeAt(++state.position);
                } else {
                    throwError(state, "unexpected end of the stream within a verbatim tag");
                }
            } else {
                while (ch !== 0 && !isWsOrEol(ch)) {
                    if (ch === 33) {
                        if (!isNamed) {
                            tagHandle = state.input.slice(_position - 1, state.position + 1);
                            if (!PATTERN_TAG_HANDLE.test(tagHandle)) {
                                throwError(state, "named tag handle cannot contain such characters");
                            }
                            isNamed = true;
                            _position = state.position + 1;
                        } else {
                            throwError(state, "tag suffix cannot contain exclamation marks");
                        }
                    }
                    ch = state.input.charCodeAt(++state.position);
                }
                tagName = state.input.slice(_position, state.position);
                if (PATTERN_FLOW_INDICATORS.test(tagName)) {
                    throwError(state, "tag suffix cannot contain flow indicator characters");
                }
            }
            if (tagName && !PATTERN_TAG_URI.test(tagName)) {
                throwError(state, "tag name cannot contain such characters: " + tagName);
            }
            try {
                tagName = decodeURIComponent(tagName);
            } catch (err) {
                throwError(state, "tag name is malformed: " + tagName);
            }
            if (isVerbatim) {
                state.tag = tagName;
            } else if (_hasOwnProperty.call(state.tagMap, tagHandle)) {
                state.tag = state.tagMap[tagHandle] + tagName;
            } else if (tagHandle === "!") {
                state.tag = "!" + tagName;
            } else if (tagHandle === "!!") {
                state.tag = "tag:yaml.org,2002:" + tagName;
            } else {
                throwError(state, 'undeclared tag handle "' + tagHandle + '"');
            }
            return true;
        }
        function readAnchorProperty(state) {
            var ch = state.input.charCodeAt(state.position);
            if (ch !== 38) return false;
            if (state.anchor !== null) {
                throwError(state, "duplication of an anchor property");
            }
            ch = state.input.charCodeAt(++state.position);
            var _position = state.position;
            while (ch !== 0 && !isWsOrEol(ch) && !isFlowIndicator(ch)) {
                ch = state.input.charCodeAt(++state.position);
            }
            if (state.position === _position) {
                throwError(state, "name of an anchor node must contain at least one character");
            }
            state.anchor = state.input.slice(_position, state.position);
            return true;
        }
        function readAlias(state) {
            var ch = state.input.charCodeAt(state.position);
            if (ch !== 42) return false;
            ch = state.input.charCodeAt(++state.position);
            var _position = state.position;
            while (ch !== 0 && !isWsOrEol(ch) && !isFlowIndicator(ch)) {
                ch = state.input.charCodeAt(++state.position);
            }
            if (state.position === _position) {
                throwError(state, "name of an alias node must contain at least one character");
            }
            var alias = state.input.slice(_position, state.position);
            if (!_hasOwnProperty.call(state.anchorMap, alias)) {
                throwError(state, 'unidentified alias "' + alias + '"');
            }
            state.result = state.anchorMap[alias];
            skipSeparationSpace(state, true, -1);
            return true;
        }
        function tryReadBlockMappingFromProperty(state, propertyStart, nodeIndent, flowIndent) {
            var fallbackState = snapshotState(state);
            beginAnchorTransaction(state);
            restoreState(state, propertyStart);
            state.tag = null;
            state.anchor = null;
            state.kind = null;
            state.result = null;
            if (readBlockMapping(state, nodeIndent, flowIndent) && state.kind === "mapping") {
                commitAnchorTransaction(state);
                return true;
            }
            rollbackAnchorTransaction(state);
            restoreState(state, fallbackState);
            return false;
        }
        function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact) {
            var allowBlockScalars;
            var allowBlockCollections;
            var indentStatus = 1;
            var atNewLine = false;
            var hasContent = false;
            var propertyStart = null;
            var type2;
            var flowIndent;
            var blockIndent;
            if (state.depth >= state.maxDepth) {
                throwError(state, "nesting exceeded maxDepth (" + state.maxDepth + ")");
            }
            state.depth += 1;
            if (state.listener !== null) {
                state.listener("open", state);
            }
            state.tag = null;
            state.anchor = null;
            state.kind = null;
            state.result = null;
            var allowBlockStyles = allowBlockScalars = allowBlockCollections = CONTEXT_BLOCK_OUT === nodeContext || CONTEXT_BLOCK_IN === nodeContext;
            if (allowToSeek) {
                if (skipSeparationSpace(state, true, -1)) {
                    atNewLine = true;
                    if (state.lineIndent > parentIndent) {
                        indentStatus = 1;
                    } else if (state.lineIndent === parentIndent) {
                        indentStatus = 0;
                    } else if (state.lineIndent < parentIndent) {
                        indentStatus = -1;
                    }
                }
            }
            if (indentStatus === 1) {
                while (true) {
                    var ch = state.input.charCodeAt(state.position);
                    var propertyState = snapshotState(state);
                    if (atNewLine && (ch === 33 && state.tag !== null || ch === 38 && state.anchor !== null)) {
                        break;
                    }
                    if (!readTagProperty(state) && !readAnchorProperty(state)) {
                        break;
                    }
                    if (propertyStart === null) {
                        propertyStart = propertyState;
                    }
                    if (skipSeparationSpace(state, true, -1)) {
                        atNewLine = true;
                        allowBlockCollections = allowBlockStyles;
                        if (state.lineIndent > parentIndent) {
                            indentStatus = 1;
                        } else if (state.lineIndent === parentIndent) {
                            indentStatus = 0;
                        } else if (state.lineIndent < parentIndent) {
                            indentStatus = -1;
                        }
                    } else {
                        allowBlockCollections = false;
                    }
                }
            }
            if (allowBlockCollections) {
                allowBlockCollections = atNewLine || allowCompact;
            }
            if (indentStatus === 1 || CONTEXT_BLOCK_OUT === nodeContext) {
                if (CONTEXT_FLOW_IN === nodeContext || CONTEXT_FLOW_OUT === nodeContext) {
                    flowIndent = parentIndent;
                } else {
                    flowIndent = parentIndent + 1;
                }
                blockIndent = state.position - state.lineStart;
                if (indentStatus === 1) {
                    if (allowBlockCollections && (readBlockSequence(state, blockIndent) || readBlockMapping(state, blockIndent, flowIndent)) || readFlowCollection(state, flowIndent)) {
                        hasContent = true;
                    } else {
                        var _ch = state.input.charCodeAt(state.position);
                        if (propertyStart !== null && allowBlockStyles && !allowBlockCollections && _ch !== 124 && _ch !== 62 && tryReadBlockMappingFromProperty(state, propertyStart, propertyStart.position - propertyStart.lineStart, flowIndent)) {
                            hasContent = true;
                        } else if (allowBlockScalars && readBlockScalar(state, flowIndent) || readSingleQuotedScalar(state, flowIndent) || readDoubleQuotedScalar(state, flowIndent)) {
                            hasContent = true;
                        } else if (readAlias(state)) {
                            hasContent = true;
                            if (state.tag !== null || state.anchor !== null) {
                                throwError(state, "alias node should not have any properties");
                            }
                        } else if (readPlainScalar(state, flowIndent, CONTEXT_FLOW_IN === nodeContext)) {
                            hasContent = true;
                            if (state.tag === null) {
                                state.tag = "?";
                            }
                        }
                        if (state.anchor !== null) {
                            storeAnchor(state, state.anchor, state.result);
                        }
                    }
                } else if (indentStatus === 0) {
                    hasContent = allowBlockCollections && readBlockSequence(state, blockIndent);
                }
            }
            if (state.tag === null) {
                if (state.anchor !== null) {
                    storeAnchor(state, state.anchor, state.result);
                }
            } else if (state.tag === "?") {
                if (state.result !== null && state.kind !== "scalar") {
                    throwError(state, 'unacceptable node kind for !<?> tag; it should be "scalar", not "' + state.kind + '"');
                }
                for (var typeIndex = 0, typeQuantity = state.implicitTypes.length; typeIndex < typeQuantity; typeIndex += 1) {
                    type2 = state.implicitTypes[typeIndex];
                    if (type2.resolve(state.result)) {
                        state.result = type2.construct(state.result);
                        state.tag = type2.tag;
                        if (state.anchor !== null) {
                            storeAnchor(state, state.anchor, state.result);
                        }
                        break;
                    }
                }
            } else if (state.tag !== "!") {
                if (_hasOwnProperty.call(state.typeMap[state.kind || "fallback"], state.tag)) {
                    type2 = state.typeMap[state.kind || "fallback"][state.tag];
                } else {
                    type2 = null;
                    var typeList = state.typeMap.multi[state.kind || "fallback"];
                    for (var _typeIndex = 0, _typeQuantity = typeList.length; _typeIndex < _typeQuantity; _typeIndex += 1) {
                        if (state.tag.slice(0, typeList[_typeIndex].tag.length) === typeList[_typeIndex].tag) {
                            type2 = typeList[_typeIndex];
                            break;
                        }
                    }
                }
                if (!type2) {
                    throwError(state, "unknown tag !<" + state.tag + ">");
                }
                if (state.result !== null && type2.kind !== state.kind) {
                    throwError(state, "unacceptable node kind for !<" + state.tag + '> tag; it should be "' + type2.kind + '", not "' + state.kind + '"');
                }
                if (!type2.resolve(state.result, state.tag)) {
                    throwError(state, "cannot resolve a node with !<" + state.tag + "> explicit tag");
                } else {
                    state.result = type2.construct(state.result, state.tag);
                    if (state.anchor !== null) {
                        storeAnchor(state, state.anchor, state.result);
                    }
                }
            }
            if (state.listener !== null) {
                state.listener("close", state);
            }
            state.depth -= 1;
            return state.tag !== null || state.anchor !== null || hasContent;
        }
        function readDocument(state) {
            var documentStart = state.position;
            var hasDirectives = false;
            var ch;
            state.version = null;
            state.checkLineBreaks = state.legacy;
            state.tagMap = Object.create(null);
            state.anchorMap = Object.create(null);
            while ((ch = state.input.charCodeAt(state.position)) !== 0) {
                skipSeparationSpace(state, true, -1);
                ch = state.input.charCodeAt(state.position);
                if (state.lineIndent > 0 || ch !== 37) {
                    break;
                }
                hasDirectives = true;
                ch = state.input.charCodeAt(++state.position);
                var _position = state.position;
                while (ch !== 0 && !isWsOrEol(ch)) {
                    ch = state.input.charCodeAt(++state.position);
                }
                var directiveName = state.input.slice(_position, state.position);
                var directiveArgs = [];
                if (directiveName.length < 1) {
                    throwError(state, "directive name must not be less than one character in length");
                }
                while (ch !== 0) {
                    while (isWhiteSpace(ch)) {
                        ch = state.input.charCodeAt(++state.position);
                    }
                    if (ch === 35) {
                        do {
                            ch = state.input.charCodeAt(++state.position);
                        } while (ch !== 0 && !isEol(ch));
                        break;
                    }
                    if (isEol(ch)) break;
                    _position = state.position;
                    while (ch !== 0 && !isWsOrEol(ch)) {
                        ch = state.input.charCodeAt(++state.position);
                    }
                    directiveArgs.push(state.input.slice(_position, state.position));
                }
                if (ch !== 0) readLineBreak(state);
                if (_hasOwnProperty.call(directiveHandlers, directiveName)) {
                    directiveHandlers[directiveName](state, directiveName, directiveArgs);
                } else {
                    throwWarning(state, 'unknown document directive "' + directiveName + '"');
                }
            }
            skipSeparationSpace(state, true, -1);
            if (state.lineIndent === 0 && state.input.charCodeAt(state.position) === 45 && state.input.charCodeAt(state.position + 1) === 45 && state.input.charCodeAt(state.position + 2) === 45) {
                state.position += 3;
                skipSeparationSpace(state, true, -1);
            } else if (hasDirectives) {
                throwError(state, "directives end mark is expected");
            }
            composeNode(state, state.lineIndent - 1, CONTEXT_BLOCK_OUT, false, true);
            skipSeparationSpace(state, true, -1);
            if (state.checkLineBreaks && PATTERN_NON_ASCII_LINE_BREAKS.test(state.input.slice(documentStart, state.position))) {
                throwWarning(state, "non-ASCII line breaks are interpreted as content");
            }
            state.documents.push(state.result);
            if (state.position === state.lineStart && testDocumentSeparator(state)) {
                if (state.input.charCodeAt(state.position) === 46) {
                    state.position += 3;
                    skipSeparationSpace(state, true, -1);
                }
                return;
            }
            if (state.position < state.length - 1) {
                throwError(state, "end of the stream or a document separator is expected");
            }
        }
        function loadDocuments(input, options) {
            input = String(input);
            options = options || {};
            if (input.length !== 0) {
                if (input.charCodeAt(input.length - 1) !== 10 && input.charCodeAt(input.length - 1) !== 13) {
                    input += "\n";
                }
                if (input.charCodeAt(0) === 65279) {
                    input = input.slice(1);
                }
            }
            var state = new State(input, options);
            var nullpos = input.indexOf("\0");
            if (nullpos !== -1) {
                state.position = nullpos;
                throwError(state, "null byte is not allowed in input");
            }
            state.input += "\0";
            while (state.input.charCodeAt(state.position) === 32) {
                state.lineIndent += 1;
                state.position += 1;
            }
            while (state.position < state.length - 1) {
                readDocument(state);
            }
            return state.documents;
        }
        function loadAll2(input, iterator, options) {
            if (iterator !== null && _typeof(iterator) === "object" && typeof options === "undefined") {
                options = iterator;
                iterator = null;
            }
            var documents = loadDocuments(input, options);
            if (typeof iterator !== "function") {
                return documents;
            }
            for (var index = 0, length = documents.length; index < length; index += 1) {
                iterator(documents[index]);
            }
        }
        function load2(input, options) {
            var documents = loadDocuments(input, options);
            if (documents.length === 0) {
                return void 0;
            } else if (documents.length === 1) {
                return documents[0];
            }
            throw new YAMLException2("expected a single document in the stream, but found more");
        }
        loader.loadAll = loadAll2;
        loader.load = load2;
        return loader;
    }
    var dumper = {};
    var hasRequiredDumper;
    function requireDumper() {
        if (hasRequiredDumper) return dumper;
        hasRequiredDumper = 1;
        function _typeof(o) {
            "@babel/helpers - typeof";
            return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
                return typeof o2;
            } : function(o2) {
                return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
            }, _typeof(o);
        }
        var common2 = requireCommon();
        var YAMLException2 = requireException();
        var DEFAULT_SCHEMA2 = require_default();
        var _toString = Object.prototype.toString;
        var _hasOwnProperty = Object.prototype.hasOwnProperty;
        var CHAR_BOM = 65279;
        var CHAR_TAB = 9;
        var CHAR_LINE_FEED = 10;
        var CHAR_CARRIAGE_RETURN = 13;
        var CHAR_SPACE = 32;
        var CHAR_EXCLAMATION = 33;
        var CHAR_DOUBLE_QUOTE = 34;
        var CHAR_SHARP = 35;
        var CHAR_PERCENT = 37;
        var CHAR_AMPERSAND = 38;
        var CHAR_SINGLE_QUOTE = 39;
        var CHAR_ASTERISK = 42;
        var CHAR_COMMA = 44;
        var CHAR_MINUS = 45;
        var CHAR_COLON = 58;
        var CHAR_EQUALS = 61;
        var CHAR_GREATER_THAN = 62;
        var CHAR_QUESTION = 63;
        var CHAR_COMMERCIAL_AT = 64;
        var CHAR_LEFT_SQUARE_BRACKET = 91;
        var CHAR_RIGHT_SQUARE_BRACKET = 93;
        var CHAR_GRAVE_ACCENT = 96;
        var CHAR_LEFT_CURLY_BRACKET = 123;
        var CHAR_VERTICAL_LINE = 124;
        var CHAR_RIGHT_CURLY_BRACKET = 125;
        var ESCAPE_SEQUENCES = {};
        ESCAPE_SEQUENCES[0] = "\\0";
        ESCAPE_SEQUENCES[7] = "\\a";
        ESCAPE_SEQUENCES[8] = "\\b";
        ESCAPE_SEQUENCES[9] = "\\t";
        ESCAPE_SEQUENCES[10] = "\\n";
        ESCAPE_SEQUENCES[11] = "\\v";
        ESCAPE_SEQUENCES[12] = "\\f";
        ESCAPE_SEQUENCES[13] = "\\r";
        ESCAPE_SEQUENCES[27] = "\\e";
        ESCAPE_SEQUENCES[34] = '\\"';
        ESCAPE_SEQUENCES[92] = "\\\\";
        ESCAPE_SEQUENCES[133] = "\\N";
        ESCAPE_SEQUENCES[160] = "\\_";
        ESCAPE_SEQUENCES[8232] = "\\L";
        ESCAPE_SEQUENCES[8233] = "\\P";
        var DEPRECATED_BOOLEANS_SYNTAX = [ "y", "Y", "yes", "Yes", "YES", "on", "On", "ON", "n", "N", "no", "No", "NO", "off", "Off", "OFF" ];
        var DEPRECATED_BASE60_SYNTAX = /^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;
        function compileStyleMap(schema2, map2) {
            if (map2 === null) return {};
            var result = {};
            var keys = Object.keys(map2);
            for (var index = 0, length = keys.length; index < length; index += 1) {
                var tag = keys[index];
                var style = String(map2[tag]);
                if (tag.slice(0, 2) === "!!") {
                    tag = "tag:yaml.org,2002:" + tag.slice(2);
                }
                var type2 = schema2.compiledTypeMap["fallback"][tag];
                if (type2 && _hasOwnProperty.call(type2.styleAliases, style)) {
                    style = type2.styleAliases[style];
                }
                result[tag] = style;
            }
            return result;
        }
        function encodeHex(character) {
            var handle;
            var length;
            var string = character.toString(16).toUpperCase();
            if (character <= 255) {
                handle = "x";
                length = 2;
            } else if (character <= 65535) {
                handle = "u";
                length = 4;
            } else if (character <= 4294967295) {
                handle = "U";
                length = 8;
            } else {
                throw new YAMLException2("code point within a string may not be greater than 0xFFFFFFFF");
            }
            return "\\" + handle + common2.repeat("0", length - string.length) + string;
        }
        var QUOTING_TYPE_SINGLE = 1;
        var QUOTING_TYPE_DOUBLE = 2;
        function State(options) {
            this.schema = options["schema"] || DEFAULT_SCHEMA2;
            this.indent = Math.max(1, options["indent"] || 2);
            this.noArrayIndent = options["noArrayIndent"] || false;
            this.skipInvalid = options["skipInvalid"] || false;
            this.flowLevel = common2.isNothing(options["flowLevel"]) ? -1 : options["flowLevel"];
            this.styleMap = compileStyleMap(this.schema, options["styles"] || null);
            this.sortKeys = options["sortKeys"] || false;
            this.lineWidth = options["lineWidth"] || 80;
            this.noRefs = options["noRefs"] || false;
            this.noCompatMode = options["noCompatMode"] || false;
            this.condenseFlow = options["condenseFlow"] || false;
            this.quotingType = options["quotingType"] === '"' ? QUOTING_TYPE_DOUBLE : QUOTING_TYPE_SINGLE;
            this.forceQuotes = options["forceQuotes"] || false;
            this.replacer = typeof options["replacer"] === "function" ? options["replacer"] : null;
            this.implicitTypes = this.schema.compiledImplicit;
            this.explicitTypes = this.schema.compiledExplicit;
            this.tag = null;
            this.result = "";
            this.duplicates = [];
            this.usedDuplicates = null;
        }
        function indentString(string, spaces) {
            var ind = common2.repeat(" ", spaces);
            var position = 0;
            var result = "";
            var length = string.length;
            while (position < length) {
                var line = void 0;
                var next = string.indexOf("\n", position);
                if (next === -1) {
                    line = string.slice(position);
                    position = length;
                } else {
                    line = string.slice(position, next + 1);
                    position = next + 1;
                }
                if (line.length && line !== "\n") result += ind;
                result += line;
            }
            return result;
        }
        function generateNextLine(state, level) {
            return "\n" + common2.repeat(" ", state.indent * level);
        }
        function testImplicitResolving(state, str2) {
            for (var index = 0, length = state.implicitTypes.length; index < length; index += 1) {
                var type2 = state.implicitTypes[index];
                if (type2.resolve(str2)) {
                    return true;
                }
            }
            return false;
        }
        function isWhitespace(c) {
            return c === CHAR_SPACE || c === CHAR_TAB;
        }
        function isPrintable(c) {
            return c >= 32 && c <= 126 || c >= 161 && c <= 55295 && c !== 8232 && c !== 8233 || c >= 57344 && c <= 65533 && c !== CHAR_BOM || c >= 65536 && c <= 1114111;
        }
        function isNsCharOrWhitespace(c) {
            return isPrintable(c) && c !== CHAR_BOM && c !== CHAR_CARRIAGE_RETURN && c !== CHAR_LINE_FEED;
        }
        function isPlainSafe(c, prev, inblock) {
            var cIsNsCharOrWhitespace = isNsCharOrWhitespace(c);
            var cIsNsChar = cIsNsCharOrWhitespace && !isWhitespace(c);
            return (inblock ? cIsNsCharOrWhitespace : cIsNsCharOrWhitespace && c !== CHAR_COMMA && c !== CHAR_LEFT_SQUARE_BRACKET && c !== CHAR_RIGHT_SQUARE_BRACKET && c !== CHAR_LEFT_CURLY_BRACKET && c !== CHAR_RIGHT_CURLY_BRACKET) && c !== CHAR_SHARP && !(prev === CHAR_COLON && !cIsNsChar) || isNsCharOrWhitespace(prev) && !isWhitespace(prev) && c === CHAR_SHARP || prev === CHAR_COLON && cIsNsChar;
        }
        function isPlainSafeFirst(c) {
            return isPrintable(c) && c !== CHAR_BOM && !isWhitespace(c) && c !== CHAR_MINUS && c !== CHAR_QUESTION && c !== CHAR_COLON && c !== CHAR_COMMA && c !== CHAR_LEFT_SQUARE_BRACKET && c !== CHAR_RIGHT_SQUARE_BRACKET && c !== CHAR_LEFT_CURLY_BRACKET && c !== CHAR_RIGHT_CURLY_BRACKET && c !== CHAR_SHARP && c !== CHAR_AMPERSAND && c !== CHAR_ASTERISK && c !== CHAR_EXCLAMATION && c !== CHAR_VERTICAL_LINE && c !== CHAR_EQUALS && c !== CHAR_GREATER_THAN && c !== CHAR_SINGLE_QUOTE && c !== CHAR_DOUBLE_QUOTE && c !== CHAR_PERCENT && c !== CHAR_COMMERCIAL_AT && c !== CHAR_GRAVE_ACCENT;
        }
        function isPlainSafeLast(c) {
            return !isWhitespace(c) && c !== CHAR_COLON;
        }
        function codePointAt(string, pos) {
            var first = string.charCodeAt(pos);
            var second;
            if (first >= 55296 && first <= 56319 && pos + 1 < string.length) {
                second = string.charCodeAt(pos + 1);
                if (second >= 56320 && second <= 57343) {
                    return (first - 55296) * 1024 + second - 56320 + 65536;
                }
            }
            return first;
        }
        function needIndentIndicator(string) {
            var leadingSpaceRe = /^\n* /;
            return leadingSpaceRe.test(string);
        }
        var STYLE_PLAIN = 1;
        var STYLE_SINGLE = 2;
        var STYLE_LITERAL = 3;
        var STYLE_FOLDED = 4;
        var STYLE_DOUBLE = 5;
        function chooseScalarStyle(string, singleLineOnly, indentPerLevel, lineWidth, testAmbiguousType, quotingType, forceQuotes, inblock) {
            var i;
            var char = 0;
            var prevChar = null;
            var hasLineBreak = false;
            var hasFoldableLine = false;
            var shouldTrackWidth = lineWidth !== -1;
            var previousLineBreak = -1;
            var plain = isPlainSafeFirst(codePointAt(string, 0)) && isPlainSafeLast(codePointAt(string, string.length - 1));
            if (singleLineOnly || forceQuotes) {
                for (i = 0; i < string.length; char >= 65536 ? i += 2 : i++) {
                    char = codePointAt(string, i);
                    if (!isPrintable(char)) {
                        return STYLE_DOUBLE;
                    }
                    plain = plain && isPlainSafe(char, prevChar, inblock);
                    prevChar = char;
                }
            } else {
                for (i = 0; i < string.length; char >= 65536 ? i += 2 : i++) {
                    char = codePointAt(string, i);
                    if (char === CHAR_LINE_FEED) {
                        hasLineBreak = true;
                        if (shouldTrackWidth) {
                            hasFoldableLine = hasFoldableLine || i - previousLineBreak - 1 > lineWidth && string[previousLineBreak + 1] !== " ";
                            previousLineBreak = i;
                        }
                    } else if (!isPrintable(char)) {
                        return STYLE_DOUBLE;
                    }
                    plain = plain && isPlainSafe(char, prevChar, inblock);
                    prevChar = char;
                }
                hasFoldableLine = hasFoldableLine || shouldTrackWidth && i - previousLineBreak - 1 > lineWidth && string[previousLineBreak + 1] !== " ";
            }
            if (!hasLineBreak && !hasFoldableLine) {
                if (plain && !forceQuotes && !testAmbiguousType(string)) {
                    return STYLE_PLAIN;
                }
                return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : STYLE_SINGLE;
            }
            if (indentPerLevel > 9 && needIndentIndicator(string)) {
                return STYLE_DOUBLE;
            }
            if (!forceQuotes) {
                return hasFoldableLine ? STYLE_FOLDED : STYLE_LITERAL;
            }
            return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : STYLE_SINGLE;
        }
        function writeScalar(state, string, level, iskey, inblock) {
            state.dump = function() {
                if (string.length === 0) {
                    return state.quotingType === QUOTING_TYPE_DOUBLE ? '""' : "''";
                }
                if (!state.noCompatMode) {
                    if (DEPRECATED_BOOLEANS_SYNTAX.indexOf(string) !== -1 || DEPRECATED_BASE60_SYNTAX.test(string)) {
                        return state.quotingType === QUOTING_TYPE_DOUBLE ? '"' + string + '"' : "'" + string + "'";
                    }
                }
                var indent = state.indent * Math.max(1, level);
                var lineWidth = state.lineWidth === -1 ? -1 : Math.max(Math.min(state.lineWidth, 40), state.lineWidth - indent);
                var singleLineOnly = iskey || state.flowLevel > -1 && level >= state.flowLevel;
                function testAmbiguity(string2) {
                    return testImplicitResolving(state, string2);
                }
                switch (chooseScalarStyle(string, singleLineOnly, state.indent, lineWidth, testAmbiguity, state.quotingType, state.forceQuotes && !iskey, inblock)) {
                  case STYLE_PLAIN:
                    return string;

                  case STYLE_SINGLE:
                    return "'" + string.replace(/'/g, "''") + "'";

                  case STYLE_LITERAL:
                    return "|" + blockHeader(string, state.indent) + dropEndingNewline(indentString(string, indent));

                  case STYLE_FOLDED:
                    return ">" + blockHeader(string, state.indent) + dropEndingNewline(indentString(foldString(string, lineWidth), indent));

                  case STYLE_DOUBLE:
                    return '"' + escapeString(string) + '"';

                  default:
                    throw new YAMLException2("impossible error: invalid scalar style");
                }
            }();
        }
        function blockHeader(string, indentPerLevel) {
            var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : "";
            var clip = string[string.length - 1] === "\n";
            var keep = clip && (string[string.length - 2] === "\n" || string === "\n");
            var chomp = keep ? "+" : clip ? "" : "-";
            return indentIndicator + chomp + "\n";
        }
        function dropEndingNewline(string) {
            return string[string.length - 1] === "\n" ? string.slice(0, -1) : string;
        }
        function foldString(string, width) {
            var lineRe = /(\n+)([^\n]*)/g;
            var result = function() {
                var nextLF = string.indexOf("\n");
                nextLF = nextLF !== -1 ? nextLF : string.length;
                lineRe.lastIndex = nextLF;
                return foldLine(string.slice(0, nextLF), width);
            }();
            var prevMoreIndented = string[0] === "\n" || string[0] === " ";
            var moreIndented;
            var match;
            while (match = lineRe.exec(string)) {
                var prefix = match[1];
                var line = match[2];
                moreIndented = line[0] === " ";
                result += prefix + (!prevMoreIndented && !moreIndented && line !== "" ? "\n" : "") + foldLine(line, width);
                prevMoreIndented = moreIndented;
            }
            return result;
        }
        function foldLine(line, width) {
            if (line === "" || line[0] === " ") return line;
            var breakRe = / [^ ]/g;
            var match;
            var start = 0;
            var end;
            var curr = 0;
            var next = 0;
            var result = "";
            while (match = breakRe.exec(line)) {
                next = match.index;
                if (next - start > width) {
                    end = curr > start ? curr : next;
                    result += "\n" + line.slice(start, end);
                    start = end + 1;
                }
                curr = next;
            }
            result += "\n";
            if (line.length - start > width && curr > start) {
                result += line.slice(start, curr) + "\n" + line.slice(curr + 1);
            } else {
                result += line.slice(start);
            }
            return result.slice(1);
        }
        function escapeString(string) {
            var result = "";
            var char = 0;
            for (var i = 0; i < string.length; char >= 65536 ? i += 2 : i++) {
                char = codePointAt(string, i);
                var escapeSeq = ESCAPE_SEQUENCES[char];
                if (!escapeSeq && isPrintable(char)) {
                    result += string[i];
                    if (char >= 65536) result += string[i + 1];
                } else {
                    result += escapeSeq || encodeHex(char);
                }
            }
            return result;
        }
        function writeFlowSequence(state, level, object) {
            var _result = "";
            var _tag = state.tag;
            for (var index = 0, length = object.length; index < length; index += 1) {
                var value = object[index];
                if (state.replacer) {
                    value = state.replacer.call(object, String(index), value);
                }
                if (writeNode(state, level, value, false, false) || typeof value === "undefined" && writeNode(state, level, null, false, false)) {
                    if (_result !== "") _result += "," + (!state.condenseFlow ? " " : "");
                    _result += state.dump;
                }
            }
            state.tag = _tag;
            state.dump = "[" + _result + "]";
        }
        function writeBlockSequence(state, level, object, compact) {
            var _result = "";
            var _tag = state.tag;
            for (var index = 0, length = object.length; index < length; index += 1) {
                var value = object[index];
                if (state.replacer) {
                    value = state.replacer.call(object, String(index), value);
                }
                if (writeNode(state, level + 1, value, true, true, false, true) || typeof value === "undefined" && writeNode(state, level + 1, null, true, true, false, true)) {
                    if (!compact || _result !== "") {
                        _result += generateNextLine(state, level);
                    }
                    if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
                        _result += "-";
                    } else {
                        _result += "- ";
                    }
                    _result += state.dump;
                }
            }
            state.tag = _tag;
            state.dump = _result || "[]";
        }
        function writeFlowMapping(state, level, object) {
            var _result = "";
            var _tag = state.tag;
            var objectKeyList = Object.keys(object);
            for (var index = 0, length = objectKeyList.length; index < length; index += 1) {
                var pairBuffer = "";
                if (_result !== "") pairBuffer += ", ";
                if (state.condenseFlow) pairBuffer += '"';
                var objectKey = objectKeyList[index];
                var objectValue = object[objectKey];
                if (state.replacer) {
                    objectValue = state.replacer.call(object, objectKey, objectValue);
                }
                if (!writeNode(state, level, objectKey, false, false)) {
                    continue;
                }
                if (state.dump.length > 1024) pairBuffer += "? ";
                pairBuffer += state.dump + (state.condenseFlow ? '"' : "") + ":" + (state.condenseFlow ? "" : " ");
                if (!writeNode(state, level, objectValue, false, false)) {
                    continue;
                }
                pairBuffer += state.dump;
                _result += pairBuffer;
            }
            state.tag = _tag;
            state.dump = "{" + _result + "}";
        }
        function writeBlockMapping(state, level, object, compact) {
            var _result = "";
            var _tag = state.tag;
            var objectKeyList = Object.keys(object);
            if (state.sortKeys === true) {
                objectKeyList.sort();
            } else if (typeof state.sortKeys === "function") {
                objectKeyList.sort(state.sortKeys);
            } else if (state.sortKeys) {
                throw new YAMLException2("sortKeys must be a boolean or a function");
            }
            for (var index = 0, length = objectKeyList.length; index < length; index += 1) {
                var pairBuffer = "";
                if (!compact || _result !== "") {
                    pairBuffer += generateNextLine(state, level);
                }
                var objectKey = objectKeyList[index];
                var objectValue = object[objectKey];
                if (state.replacer) {
                    objectValue = state.replacer.call(object, objectKey, objectValue);
                }
                if (!writeNode(state, level + 1, objectKey, true, true, true)) {
                    continue;
                }
                var explicitPair = state.tag !== null && state.tag !== "?" || state.dump && state.dump.length > 1024;
                if (explicitPair) {
                    if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
                        pairBuffer += "?";
                    } else {
                        pairBuffer += "? ";
                    }
                }
                pairBuffer += state.dump;
                if (explicitPair) {
                    pairBuffer += generateNextLine(state, level);
                }
                if (!writeNode(state, level + 1, objectValue, true, explicitPair)) {
                    continue;
                }
                if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
                    pairBuffer += ":";
                } else {
                    pairBuffer += ": ";
                }
                pairBuffer += state.dump;
                _result += pairBuffer;
            }
            state.tag = _tag;
            state.dump = _result || "{}";
        }
        function detectType(state, object, explicit) {
            var typeList = explicit ? state.explicitTypes : state.implicitTypes;
            for (var index = 0, length = typeList.length; index < length; index += 1) {
                var type2 = typeList[index];
                if ((type2.instanceOf || type2.predicate) && (!type2.instanceOf || _typeof(object) === "object" && object instanceof type2.instanceOf) && (!type2.predicate || type2.predicate(object))) {
                    if (explicit) {
                        if (type2.multi && type2.representName) {
                            state.tag = type2.representName(object);
                        } else {
                            state.tag = type2.tag;
                        }
                    } else {
                        state.tag = "?";
                    }
                    if (type2.represent) {
                        var style = state.styleMap[type2.tag] || type2.defaultStyle;
                        var _result = void 0;
                        if (_toString.call(type2.represent) === "[object Function]") {
                            _result = type2.represent(object, style);
                        } else if (_hasOwnProperty.call(type2.represent, style)) {
                            _result = type2.represent[style](object, style);
                        } else {
                            throw new YAMLException2("!<" + type2.tag + '> tag resolver accepts not "' + style + '" style');
                        }
                        state.dump = _result;
                    }
                    return true;
                }
            }
            return false;
        }
        function writeNode(state, level, object, block, compact, iskey, isblockseq) {
            state.tag = null;
            state.dump = object;
            if (!detectType(state, object, false)) {
                detectType(state, object, true);
            }
            var type2 = _toString.call(state.dump);
            var inblock = block;
            if (block) {
                block = state.flowLevel < 0 || state.flowLevel > level;
            }
            var objectOrArray = type2 === "[object Object]" || type2 === "[object Array]";
            var duplicateIndex;
            var duplicate;
            if (objectOrArray) {
                duplicateIndex = state.duplicates.indexOf(object);
                duplicate = duplicateIndex !== -1;
            }
            if (state.tag !== null && state.tag !== "?" || duplicate || state.indent !== 2 && level > 0) {
                compact = false;
            }
            if (duplicate && state.usedDuplicates[duplicateIndex]) {
                state.dump = "*ref_" + duplicateIndex;
            } else {
                if (objectOrArray && duplicate && !state.usedDuplicates[duplicateIndex]) {
                    state.usedDuplicates[duplicateIndex] = true;
                }
                if (type2 === "[object Object]") {
                    if (block && Object.keys(state.dump).length !== 0) {
                        writeBlockMapping(state, level, state.dump, compact);
                        if (duplicate) {
                            state.dump = "&ref_" + duplicateIndex + state.dump;
                        }
                    } else {
                        writeFlowMapping(state, level, state.dump);
                        if (duplicate) {
                            state.dump = "&ref_" + duplicateIndex + " " + state.dump;
                        }
                    }
                } else if (type2 === "[object Array]") {
                    if (block && state.dump.length !== 0) {
                        if (state.noArrayIndent && !isblockseq && level > 0) {
                            writeBlockSequence(state, level - 1, state.dump, compact);
                        } else {
                            writeBlockSequence(state, level, state.dump, compact);
                        }
                        if (duplicate) {
                            state.dump = "&ref_" + duplicateIndex + state.dump;
                        }
                    } else {
                        writeFlowSequence(state, level, state.dump);
                        if (duplicate) {
                            state.dump = "&ref_" + duplicateIndex + " " + state.dump;
                        }
                    }
                } else if (type2 === "[object String]") {
                    if (state.tag !== "?") {
                        writeScalar(state, state.dump, level, iskey, inblock);
                    }
                } else if (type2 === "[object Undefined]") {
                    return false;
                } else {
                    if (state.skipInvalid) return false;
                    throw new YAMLException2("unacceptable kind of an object to dump " + type2);
                }
                if (state.tag !== null && state.tag !== "?") {
                    var tagStr = encodeURI(state.tag[0] === "!" ? state.tag.slice(1) : state.tag).replace(/!/g, "%21");
                    if (state.tag[0] === "!") {
                        tagStr = "!" + tagStr;
                    } else if (tagStr.slice(0, 18) === "tag:yaml.org,2002:") {
                        tagStr = "!!" + tagStr.slice(18);
                    } else {
                        tagStr = "!<" + tagStr + ">";
                    }
                    state.dump = tagStr + " " + state.dump;
                }
            }
            return true;
        }
        function getDuplicateReferences(object, state) {
            var objects = [];
            var duplicatesIndexes = [];
            inspectNode(object, objects, duplicatesIndexes);
            var length = duplicatesIndexes.length;
            for (var index = 0; index < length; index += 1) {
                state.duplicates.push(objects[duplicatesIndexes[index]]);
            }
            state.usedDuplicates = new Array(length);
        }
        function inspectNode(object, objects, duplicatesIndexes) {
            if (object !== null && _typeof(object) === "object") {
                var index = objects.indexOf(object);
                if (index !== -1) {
                    if (duplicatesIndexes.indexOf(index) === -1) {
                        duplicatesIndexes.push(index);
                    }
                } else {
                    objects.push(object);
                    if (Array.isArray(object)) {
                        for (var i = 0, length = object.length; i < length; i += 1) {
                            inspectNode(object[i], objects, duplicatesIndexes);
                        }
                    } else {
                        var objectKeyList = Object.keys(object);
                        for (var _i = 0, _length = objectKeyList.length; _i < _length; _i += 1) {
                            inspectNode(object[objectKeyList[_i]], objects, duplicatesIndexes);
                        }
                    }
                }
            }
        }
        function dump2(input, options) {
            options = options || {};
            var state = new State(options);
            if (!state.noRefs) getDuplicateReferences(input, state);
            var value = input;
            if (state.replacer) {
                value = state.replacer.call({
                    "": value
                }, "", value);
            }
            if (writeNode(state, 0, value, true, true)) return state.dump + "\n";
            return "";
        }
        dumper.dump = dump2;
        return dumper;
    }
    var hasRequiredJsYaml;
    function requireJsYaml() {
        if (hasRequiredJsYaml) return jsYaml;
        hasRequiredJsYaml = 1;
        var loader2 = requireLoader();
        var dumper2 = requireDumper();
        function renamed(from, to) {
            return function() {
                throw new Error("Function yaml." + from + " is removed in js-yaml 4. Use yaml." + to + " instead, which is now safe by default.");
            };
        }
        jsYaml.Type = requireType();
        jsYaml.Schema = requireSchema();
        jsYaml.FAILSAFE_SCHEMA = requireFailsafe();
        jsYaml.JSON_SCHEMA = requireJson();
        jsYaml.CORE_SCHEMA = requireCore();
        jsYaml.DEFAULT_SCHEMA = require_default();
        jsYaml.load = loader2.load;
        jsYaml.loadAll = loader2.loadAll;
        jsYaml.dump = dumper2.dump;
        jsYaml.YAMLException = requireException();
        jsYaml.types = {
            binary: requireBinary(),
            float: requireFloat(),
            map: requireMap(),
            null: require_null(),
            pairs: requirePairs(),
            set: requireSet(),
            timestamp: requireTimestamp(),
            bool: requireBool(),
            int: requireInt(),
            merge: requireMerge(),
            omap: requireOmap(),
            seq: requireSeq(),
            str: requireStr()
        };
        jsYaml.safeLoad = renamed("safeLoad", "load");
        jsYaml.safeLoadAll = renamed("safeLoadAll", "loadAll");
        jsYaml.safeDump = renamed("safeDump", "dump");
        return jsYaml;
    }
    var jsYamlExports = requireJsYaml();
    var yaml = getDefaultExportFromCjs(jsYamlExports);
    var Type = yaml.Type, Schema = yaml.Schema, FAILSAFE_SCHEMA = yaml.FAILSAFE_SCHEMA, JSON_SCHEMA = yaml.JSON_SCHEMA, CORE_SCHEMA = yaml.CORE_SCHEMA, DEFAULT_SCHEMA = yaml.DEFAULT_SCHEMA, load = yaml.load, loadAll = yaml.loadAll, dump = yaml.dump, YAMLException = yaml.YAMLException, types = yaml.types, safeLoad = yaml.safeLoad, safeLoadAll = yaml.safeLoadAll, safeDump = yaml.safeDump;
    exports2.CORE_SCHEMA = CORE_SCHEMA;
    exports2.DEFAULT_SCHEMA = DEFAULT_SCHEMA;
    exports2.FAILSAFE_SCHEMA = FAILSAFE_SCHEMA;
    exports2.JSON_SCHEMA = JSON_SCHEMA;
    exports2.Schema = Schema;
    exports2.Type = Type;
    exports2.YAMLException = YAMLException;
    exports2.default = yaml;
    exports2.dump = dump;
    exports2.load = load;
    exports2.loadAll = loadAll;
    exports2.safeDump = safeDump;
    exports2.safeLoad = safeLoad;
    exports2.safeLoadAll = safeLoadAll;
    exports2.types = types;
    Object.defineProperty(exports2, "__esModule", {
        value: true
    });
});
//# sourceMappingURL=js-yaml.js.map
{"version":3,"file":"js-yaml.js","sources":["../lib/common.js","../lib/exception.js","../lib/snippet.js","../lib/type.js","../lib/schema.js","../lib/type/str.js","../lib/type/seq.js","../lib/type/map.js","../lib/schema/failsafe.js","../lib/type/null.js","../lib/type/bool.js","../lib/type/int.js","../lib/type/float.js","../lib/schema/json.js","../lib/schema/core.js","../lib/type/timestamp.js","../lib/type/merge.js","../lib/type/binary.js","../lib/type/omap.js","../lib/type/pairs.js","../lib/type/set.js","../lib/schema/default.js","../lib/loader.js","../lib/dumper.js","../index.js","../lib/index_vite_proxy.tmp.mjs"],"sourcesContent":["'use strict'\n\nfunction isNothing (subject) {\n  return (typeof subject === 'undefined') || (subject === null)\n}\n\nfunction isObject (subject) {\n  return (typeof subject === 'object') && (subject !== null)\n}\n\nfunction toArray (sequence) {\n  if (Array.isArray(sequence)) return sequence\n  else if (isNothing(sequence)) return []\n\n  return [sequence]\n}\n\nfunction extend (target, source) {\n  if (source) {\n    const sourceKeys = Object.keys(source)\n\n    for (let index = 0, length = sourceKeys.length; index < length; index += 1) {\n      const key = sourceKeys[index]\n      target[key] = source[key]\n    }\n  }\n\n  return target\n}\n\nfunction repeat (string, count) {\n  let result = ''\n\n  for (let cycle = 0; cycle < count; cycle += 1) {\n    result += string\n  }\n\n  return result\n}\n\nfunction isNegativeZero (number) {\n  return (number === 0) && (Number.NEGATIVE_INFINITY === 1 / number)\n}\n\nmodule.exports.isNothing = isNothing\nmodule.exports.isObject = isObject\nmodule.exports.toArray = toArray\nmodule.exports.repeat = repeat\nmodule.exports.isNegativeZero = isNegativeZero\nmodule.exports.extend = extend\n","// YAML error class. http://stackoverflow.com/questions/8458984\n//\n'use strict'\n\nfunction formatError (exception, compact) {\n  let where = ''\n  const message = exception.reason || '(unknown reason)'\n\n  if (!exception.mark) return message\n\n  if (exception.mark.name) {\n    where += 'in \"' + exception.mark.name + '\" '\n  }\n\n  where += '(' + (exception.mark.line + 1) + ':' + (exception.mark.column + 1) + ')'\n\n  if (!compact && exception.mark.snippet) {\n    where += '\\n\\n' + exception.mark.snippet\n  }\n\n  return message + ' ' + where\n}\n\nfunction YAMLException (reason, mark) {\n  // Super constructor\n  Error.call(this)\n\n  this.name = 'YAMLException'\n  this.reason = reason\n  this.mark = mark\n  this.message = formatError(this, false)\n\n  // Include stack trace in error object\n  if (Error.captureStackTrace) {\n    // Chrome and NodeJS\n    Error.captureStackTrace(this, this.constructor)\n  } else {\n    // FF, IE 10+ and Safari 6+. Fallback for others\n    this.stack = (new Error()).stack || ''\n  }\n}\n\n// Inherit from Error\nYAMLException.prototype = Object.create(Error.prototype)\nYAMLException.prototype.constructor = YAMLException\n\nYAMLException.prototype.toString = function toString (compact) {\n  return this.name + ': ' + formatError(this, compact)\n}\n\nmodule.exports = YAMLException\n","'use strict'\n\nconst common = require('./common')\n\n// get snippet for a single line, respecting maxLength\nfunction getLine (buffer, lineStart, lineEnd, position, maxLineLength) {\n  let head = ''\n  let tail = ''\n  const maxHalfLength = Math.floor(maxLineLength / 2) - 1\n\n  if (position - lineStart > maxHalfLength) {\n    head = ' ... '\n    lineStart = position - maxHalfLength + head.length\n  }\n\n  if (lineEnd - position > maxHalfLength) {\n    tail = ' ...'\n    lineEnd = position + maxHalfLength - tail.length\n  }\n\n  return {\n    str: head + buffer.slice(lineStart, lineEnd).replace(/\\t/g, 'â†’') + tail,\n    pos: position - lineStart + head.length // relative position\n  }\n}\n\nfunction padStart (string, max) {\n  return common.repeat(' ', max - string.length) + string\n}\n\nfunction makeSnippet (mark, options) {\n  options = Object.create(options || null)\n\n  if (!mark.buffer) return null\n\n  if (!options.maxLength) options.maxLength = 79\n  if (typeof options.indent !== 'number') options.indent = 1\n  if (typeof options.linesBefore !== 'number') options.linesBefore = 3\n  if (typeof options.linesAfter !== 'number') options.linesAfter = 2\n\n  const re = /\\r?\\n|\\r|\\0/g\n  const lineStarts = [0]\n  const lineEnds = []\n  let match\n  let foundLineNo = -1\n\n  while ((match = re.exec(mark.buffer))) {\n    lineEnds.push(match.index)\n    lineStarts.push(match.index + match[0].length)\n\n    if (mark.position <= match.index && foundLineNo < 0) {\n      foundLineNo = lineStarts.length - 2\n    }\n  }\n\n  if (foundLineNo < 0) foundLineNo = lineStarts.length - 1\n\n  let result = ''\n  const lineNoLength = Math.min(mark.line + options.linesAfter, lineEnds.length).toString().length\n  const maxLineLength = options.maxLength - (options.indent + lineNoLength + 3)\n\n  for (let i = 1; i <= options.linesBefore; i++) {\n    if (foundLineNo - i < 0) break\n    const line = getLine(\n      mark.buffer,\n      lineStarts[foundLineNo - i],\n      lineEnds[foundLineNo - i],\n      mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo - i]),\n      maxLineLength\n    )\n    result = common.repeat(' ', options.indent) + padStart((mark.line - i + 1).toString(), lineNoLength) +\n      ' | ' + line.str + '\\n' + result\n  }\n\n  const line = getLine(mark.buffer, lineStarts[foundLineNo], lineEnds[foundLineNo], mark.position, maxLineLength)\n  result += common.repeat(' ', options.indent) + padStart((mark.line + 1).toString(), lineNoLength) +\n    ' | ' + line.str + '\\n'\n  result += common.repeat('-', options.indent + lineNoLength + 3 + line.pos) + '^' + '\\n'\n\n  for (let i = 1; i <= options.linesAfter; i++) {\n    if (foundLineNo + i >= lineEnds.length) break\n    const line = getLine(\n      mark.buffer,\n      lineStarts[foundLineNo + i],\n      lineEnds[foundLineNo + i],\n      mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo + i]),\n      maxLineLength\n    )\n    result += common.repeat(' ', options.indent) + padStart((mark.line + i + 1).toString(), lineNoLength) +\n      ' | ' + line.str + '\\n'\n  }\n\n  return result.replace(/\\n$/, '')\n}\n\nmodule.exports = makeSnippet\n","'use strict'\n\nconst YAMLException = require('./exception')\n\nconst TYPE_CONSTRUCTOR_OPTIONS = [\n  'kind',\n  'multi',\n  'resolve',\n  'construct',\n  'instanceOf',\n  'predicate',\n  'represent',\n  'representName',\n  'defaultStyle',\n  'styleAliases'\n]\n\nconst YAML_NODE_KINDS = [\n  'scalar',\n  'sequence',\n  'mapping'\n]\n\nfunction compileStyleAliases (map) {\n  const result = {}\n\n  if (map !== null) {\n    Object.keys(map).forEach(function (style) {\n      map[style].forEach(function (alias) {\n        result[String(alias)] = style\n      })\n    })\n  }\n\n  return result\n}\n\nfunction Type (tag, options) {\n  options = options || {}\n\n  Object.keys(options).forEach(function (name) {\n    if (TYPE_CONSTRUCTOR_OPTIONS.indexOf(name) === -1) {\n      throw new YAMLException('Unknown option \"' + name + '\" is met in definition of \"' + tag + '\" YAML type.')\n    }\n  })\n\n  // TODO: Add tag format check.\n  this.options = options // keep original options in case user wants to extend this type later\n  this.tag = tag\n  this.kind = options['kind'] || null\n  this.resolve = options['resolve'] || function () { return true }\n  this.construct = options['construct'] || function (data) { return data }\n  this.instanceOf = options['instanceOf'] || null\n  this.predicate = options['predicate'] || null\n  this.represent = options['represent'] || null\n  this.representName = options['representName'] || null\n  this.defaultStyle = options['defaultStyle'] || null\n  this.multi = options['multi'] || false\n  this.styleAliases = compileStyleAliases(options['styleAliases'] || null)\n\n  if (YAML_NODE_KINDS.indexOf(this.kind) === -1) {\n    throw new YAMLException('Unknown kind \"' + this.kind + '\" is specified for \"' + tag + '\" YAML type.')\n  }\n}\n\nmodule.exports = Type\n","'use strict'\n\nconst YAMLException = require('./exception')\nconst Type = require('./type')\n\nfunction compileList (schema, name) {\n  const result = []\n\n  schema[name].forEach(function (currentType) {\n    let newIndex = result.length\n\n    result.forEach(function (previousType, previousIndex) {\n      if (previousType.tag === currentType.tag &&\n          previousType.kind === currentType.kind &&\n          previousType.multi === currentType.multi) {\n        newIndex = previousIndex\n      }\n    })\n\n    result[newIndex] = currentType\n  })\n\n  return result\n}\n\nfunction compileMap (/* lists... */) {\n  const result = {\n    scalar: {},\n    sequence: {},\n    mapping: {},\n    fallback: {},\n    multi: {\n      scalar: [],\n      sequence: [],\n      mapping: [],\n      fallback: []\n    }\n  }\n  function collectType (type) {\n    if (type.multi) {\n      result.multi[type.kind].push(type)\n      result.multi['fallback'].push(type)\n    } else {\n      result[type.kind][type.tag] = result['fallback'][type.tag] = type\n    }\n  }\n\n  for (let index = 0, length = arguments.length; index < length; index += 1) {\n    arguments[index].forEach(collectType)\n  }\n  return result\n}\n\nfunction Schema (definition) {\n  return this.extend(definition)\n}\n\nSchema.prototype.extend = function extend (definition) {\n  let implicit = []\n  let explicit = []\n\n  if (definition instanceof Type) {\n    // Schema.extend(type)\n    explicit.push(definition)\n  } else if (Array.isArray(definition)) {\n    // Schema.extend([ type1, type2, ... ])\n    explicit = explicit.concat(definition)\n  } else if (definition && (Array.isArray(definition.implicit) || Array.isArray(definition.explicit))) {\n    // Schema.extend({ explicit: [ type1, type2, ... ], implicit: [ type1, type2, ... ] })\n    if (definition.implicit) implicit = implicit.concat(definition.implicit)\n    if (definition.explicit) explicit = explicit.concat(definition.explicit)\n  } else {\n    throw new YAMLException('Schema.extend argument should be a Type, [ Type ], ' +\n      'or a schema definition ({ implicit: [...], explicit: [...] })')\n  }\n\n  implicit.forEach(function (type) {\n    if (!(type instanceof Type)) {\n      throw new YAMLException('Specified list of YAML types (or a single Type object) contains a non-Type object.')\n    }\n\n    if (type.loadKind && type.loadKind !== 'scalar') {\n      throw new YAMLException('There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.')\n    }\n\n    if (type.multi) {\n      throw new YAMLException('There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.')\n    }\n  })\n\n  explicit.forEach(function (type) {\n    if (!(type instanceof Type)) {\n      throw new YAMLException('Specified list of YAML types (or a single Type object) contains a non-Type object.')\n    }\n  })\n\n  const result = Object.create(Schema.prototype)\n\n  result.implicit = (this.implicit || []).concat(implicit)\n  result.explicit = (this.explicit || []).concat(explicit)\n\n  result.compiledImplicit = compileList(result, 'implicit')\n  result.compiledExplicit = compileList(result, 'explicit')\n  result.compiledTypeMap = compileMap(result.compiledImplicit, result.compiledExplicit)\n\n  return result\n}\n\nmodule.exports = Schema\n","'use strict'\n\nconst Type = require('../type')\n\nmodule.exports = new Type('tag:yaml.org,2002:str', {\n  kind: 'scalar',\n  construct: function (data) { return data !== null ? data : '' }\n})\n","'use strict'\n\nconst Type = require('../type')\n\nmodule.exports = new Type('tag:yaml.org,2002:seq', {\n  kind: 'sequence',\n  construct: function (data) { return data !== null ? data : [] }\n})\n","'use strict'\n\nconst Type = require('../type')\n\nmodule.exports = new Type('tag:yaml.org,2002:map', {\n  kind: 'mapping',\n  construct: function (data) { return data !== null ? data : {} }\n})\n","// Standard YAML's Failsafe schema.\n// http://www.yaml.org/spec/1.2/spec.html#id2802346\n\n'use strict'\n\nconst Schema = require('../schema')\n\nmodule.exports = new Schema({\n  explicit: [\n    require('../type/str'),\n    require('../type/seq'),\n    require('../type/map')\n  ]\n})\n","'use strict'\n\nconst Type = require('../type')\n\nfunction resolveYamlNull (data) {\n  if (data === null) return true\n\n  const max = data.length\n\n  return (max === 1 && data === '~') ||\n         (max === 4 && (data === 'null' || data === 'Null' || data === 'NULL'))\n}\n\nfunction constructYamlNull () {\n  return null\n}\n\nfunction isNull (object) {\n  return object === null\n}\n\nmodule.exports = new Type('tag:yaml.org,2002:null', {\n  kind: 'scalar',\n  resolve: resolveYamlNull,\n  construct: constructYamlNull,\n  predicate: isNull,\n  represent: {\n    canonical: function () { return '~' },\n    lowercase: function () { return 'null' },\n    uppercase: function () { return 'NULL' },\n    camelcase: function () { return 'Null' },\n    empty: function () { return '' }\n  },\n  defaultStyle: 'lowercase'\n})\n","'use strict'\n\nconst Type = require('../type')\n\nfunction resolveYamlBoolean (data) {\n  if (data === null) return false\n\n  const max = data.length\n\n  return (max === 4 && (data === 'true' || data === 'True' || data === 'TRUE')) ||\n         (max === 5 && (data === 'false' || data === 'False' || data === 'FALSE'))\n}\n\nfunction constructYamlBoolean (data) {\n  return data === 'true' ||\n         data === 'True' ||\n         data === 'TRUE'\n}\n\nfunction isBoolean (object) {\n  return Object.prototype.toString.call(object) === '[object Boolean]'\n}\n\nmodule.exports = new Type('tag:yaml.org,2002:bool', {\n  kind: 'scalar',\n  resolve: resolveYamlBoolean,\n  construct: constructYamlBoolean,\n  predicate: isBoolean,\n  represent: {\n    lowercase: function (object) { return object ? 'true' : 'false' },\n    uppercase: function (object) { return object ? 'TRUE' : 'FALSE' },\n    camelcase: function (object) { return object ? 'True' : 'False' }\n  },\n  defaultStyle: 'lowercase'\n})\n","'use strict'\n\nconst common = require('../common')\nconst Type = require('../type')\n\nfunction isHexCode (c) {\n  return ((c >= 0x30/* 0 */) && (c <= 0x39/* 9 */)) ||\n         ((c >= 0x41/* A */) && (c <= 0x46/* F */)) ||\n         ((c >= 0x61/* a */) && (c <= 0x66/* f */))\n}\n\nfunction isOctCode (c) {\n  return ((c >= 0x30/* 0 */) && (c <= 0x37/* 7 */))\n}\n\nfunction isDecCode (c) {\n  return ((c >= 0x30/* 0 */) && (c <= 0x39/* 9 */))\n}\n\nfunction resolveYamlInteger (data) {\n  if (data === null) return false\n\n  const max = data.length\n  let index = 0\n  let hasDigits = false\n\n  if (!max) return false\n\n  let ch = data[index]\n\n  // sign\n  if (ch === '-' || ch === '+') {\n    ch = data[++index]\n  }\n\n  if (ch === '0') {\n    // 0\n    if (index + 1 === max) return true\n    ch = data[++index]\n\n    // base 2, base 8, base 16\n\n    if (ch === 'b') {\n      // base 2\n      index++\n\n      for (; index < max; index++) {\n        ch = data[index]\n        if (ch !== '0' && ch !== '1') return false\n        hasDigits = true\n      }\n      return hasDigits && isFinite(parseYamlInteger(data))\n    }\n\n    if (ch === 'x') {\n      // base 16\n      index++\n\n      for (; index < max; index++) {\n        if (!isHexCode(data.charCodeAt(index))) return false\n        hasDigits = true\n      }\n      return hasDigits && isFinite(parseYamlInteger(data))\n    }\n\n    if (ch === 'o') {\n      // base 8\n      index++\n\n      for (; index < max; index++) {\n        if (!isOctCode(data.charCodeAt(index))) return false\n        hasDigits = true\n      }\n      return hasDigits && isFinite(parseYamlInteger(data))\n    }\n  }\n\n  // base 10 (except 0)\n\n  for (; index < max; index++) {\n    if (!isDecCode(data.charCodeAt(index))) {\n      return false\n    }\n    hasDigits = true\n  }\n\n  if (!hasDigits) return false\n\n  return isFinite(parseYamlInteger(data))\n}\n\nfunction parseYamlInteger (data) {\n  let value = data\n  let sign = 1\n\n  let ch = value[0]\n\n  if (ch === '-' || ch === '+') {\n    if (ch === '-') sign = -1\n    value = value.slice(1)\n    ch = value[0]\n  }\n\n  if (value === '0') return 0\n\n  if (ch === '0') {\n    if (value[1] === 'b') return sign * parseInt(value.slice(2), 2)\n    if (value[1] === 'x') return sign * parseInt(value.slice(2), 16)\n    if (value[1] === 'o') return sign * parseInt(value.slice(2), 8)\n  }\n\n  return sign * parseInt(value, 10)\n}\n\nfunction constructYamlInteger (data) {\n  return parseYamlInteger(data)\n}\n\nfunction isInteger (object) {\n  return (Object.prototype.toString.call(object)) === '[object Number]' &&\n         (object % 1 === 0 && !common.isNegativeZero(object))\n}\n\nmodule.exports = new Type('tag:yaml.org,2002:int', {\n  kind: 'scalar',\n  resolve: resolveYamlInteger,\n  construct: constructYamlInteger,\n  predicate: isInteger,\n  represent: {\n    binary: function (obj) { return obj >= 0 ? '0b' + obj.toString(2) : '-0b' + obj.toString(2).slice(1) },\n    octal: function (obj) { return obj >= 0 ? '0o' + obj.toString(8) : '-0o' + obj.toString(8).slice(1) },\n    decimal: function (obj) { return obj.toString(10) },\n    hexadecimal: function (obj) { return obj >= 0 ? '0x' + obj.toString(16).toUpperCase() : '-0x' + obj.toString(16).toUpperCase().slice(1) }\n  },\n  defaultStyle: 'decimal',\n  styleAliases: {\n    binary: [2, 'bin'],\n    octal: [8, 'oct'],\n    decimal: [10, 'dec'],\n    hexadecimal: [16, 'hex']\n  }\n})\n","'use strict'\n\nconst common = require('../common')\nconst Type = require('../type')\n\nconst YAML_FLOAT_PATTERN = new RegExp(\n  // 2.5e4, 2.5 and integers\n  '^(?:[-+]?(?:[0-9]+)(?:\\\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?' +\n  // .2e4, .2\n  // special case, seems not from spec\n  '|\\\\.[0-9]+(?:[eE][-+]?[0-9]+)?' +\n  // .inf\n  '|[-+]?\\\\.(?:inf|Inf|INF)' +\n  // .nan\n  '|\\\\.(?:nan|NaN|NAN))$')\n\nconst YAML_FLOAT_SPECIAL_PATTERN = new RegExp(\n  '^(?:' +\n  // .inf\n  '[-+]?\\\\.(?:inf|Inf|INF)' +\n  // .nan\n  '|\\\\.(?:nan|NaN|NAN))$')\n\nfunction resolveYamlFloat (data) {\n  if (data === null) return false\n\n  if (!YAML_FLOAT_PATTERN.test(data)) {\n    return false\n  }\n\n  if (isFinite(parseFloat(data, 10))) {\n    return true\n  }\n\n  return YAML_FLOAT_SPECIAL_PATTERN.test(data)\n}\n\nfunction constructYamlFloat (data) {\n  let value = data.toLowerCase()\n  const sign = value[0] === '-' ? -1 : 1\n\n  if ('+-'.indexOf(value[0]) >= 0) {\n    value = value.slice(1)\n  }\n\n  if (value === '.inf') {\n    return (sign === 1) ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY\n  } else if (value === '.nan') {\n    return NaN\n  }\n  return sign * parseFloat(value, 10)\n}\n\nconst SCIENTIFIC_WITHOUT_DOT = /^[-+]?[0-9]+e/\n\nfunction representYamlFloat (object, style) {\n  if (isNaN(object)) {\n    switch (style) {\n      case 'lowercase': return '.nan'\n      case 'uppercase': return '.NAN'\n      case 'camelcase': return '.NaN'\n    }\n  } else if (Number.POSITIVE_INFINITY === object) {\n    switch (style) {\n      case 'lowercase': return '.inf'\n      case 'uppercase': return '.INF'\n      case 'camelcase': return '.Inf'\n    }\n  } else if (Number.NEGATIVE_INFINITY === object) {\n    switch (style) {\n      case 'lowercase': return '-.inf'\n      case 'uppercase': return '-.INF'\n      case 'camelcase': return '-.Inf'\n    }\n  } else if (common.isNegativeZero(object)) {\n    return '-0.0'\n  }\n\n  const res = object.toString(10)\n\n  // JS stringifier can build scientific format without dots: 5e-100,\n  // while YAML requres dot: 5.e-100. Fix it with simple hack\n\n  return SCIENTIFIC_WITHOUT_DOT.test(res) ? res.replace('e', '.e') : res\n}\n\nfunction isFloat (object) {\n  return (Object.prototype.toString.call(object) === '[object Number]') &&\n         (object % 1 !== 0 || common.isNegativeZero(object))\n}\n\nmodule.exports = new Type('tag:yaml.org,2002:float', {\n  kind: 'scalar',\n  resolve: resolveYamlFloat,\n  construct: constructYamlFloat,\n  predicate: isFloat,\n  represent: representYamlFloat,\n  defaultStyle: 'lowercase'\n})\n","// Standard YAML's JSON schema.\n// http://www.yaml.org/spec/1.2/spec.html#id2803231\n//\n// NOTE: JS-YAML does not support schema-specific tag resolution restrictions.\n// So, this schema is not such strict as defined in the YAML specification.\n// It allows numbers in binary notaion, use `Null` and `NULL` as `null`, etc.\n\n'use strict'\n\nmodule.exports = require('./failsafe').extend({\n  implicit: [\n    require('../type/null'),\n    require('../type/bool'),\n    require('../type/int'),\n    require('../type/float')\n  ]\n})\n","// Standard YAML's Core schema.\n// http://www.yaml.org/spec/1.2/spec.html#id2804923\n//\n// NOTE: JS-YAML does not support schema-specific tag resolution restrictions.\n// So, Core schema has no distinctions from JSON schema is JS-YAML.\n\n'use strict'\n\nmodule.exports = require('./json')\n","'use strict'\n\nconst Type = require('../type')\n\nconst YAML_DATE_REGEXP = new RegExp(\n  '^([0-9][0-9][0-9][0-9])' + // [1] year\n  '-([0-9][0-9])' + // [2] month\n  '-([0-9][0-9])$')                   // [3] day\n\nconst YAML_TIMESTAMP_REGEXP = new RegExp(\n  '^([0-9][0-9][0-9][0-9])' + // [1] year\n  '-([0-9][0-9]?)' + // [2] month\n  '-([0-9][0-9]?)' + // [3] day\n  '(?:[Tt]|[ \\\\t]+)' + // ...\n  '([0-9][0-9]?)' + // [4] hour\n  ':([0-9][0-9])' + // [5] minute\n  ':([0-9][0-9])' + // [6] second\n  '(?:\\\\.([0-9]*))?' + // [7] fraction\n  '(?:[ \\\\t]*(Z|([-+])([0-9][0-9]?)' + // [8] tz [9] tz_sign [10] tzHour\n  '(?::([0-9][0-9]))?))?$')           // [11] tzMinute\n\nfunction resolveYamlTimestamp (data) {\n  if (data === null) return false\n  if (YAML_DATE_REGEXP.exec(data) !== null) return true\n  if (YAML_TIMESTAMP_REGEXP.exec(data) !== null) return true\n  return false\n}\n\nfunction constructYamlTimestamp (data) {\n  let fraction = 0\n  let delta = null\n\n  let match = YAML_DATE_REGEXP.exec(data)\n  if (match === null) match = YAML_TIMESTAMP_REGEXP.exec(data)\n\n  if (match === null) throw new Error('Date resolve error')\n\n  // match: [1] year [2] month [3] day\n\n  const year = +(match[1])\n  const month = +(match[2]) - 1 // JS month starts with 0\n  const day = +(match[3])\n\n  if (!match[4]) { // no hour\n    return new Date(Date.UTC(year, month, day))\n  }\n\n  // match: [4] hour [5] minute [6] second [7] fraction\n\n  const hour = +(match[4])\n  const minute = +(match[5])\n  const second = +(match[6])\n\n  if (match[7]) {\n    fraction = match[7].slice(0, 3)\n    while (fraction.length < 3) { // milli-seconds\n      fraction += '0'\n    }\n    fraction = +fraction\n  }\n\n  // match: [8] tz [9] tz_sign [10] tzHour [11] tzMinute\n\n  if (match[9]) {\n    const tzHour = +(match[10])\n    const tzMinute = +(match[11] || 0)\n    delta = (tzHour * 60 + tzMinute) * 60000 // delta in mili-seconds\n    if (match[9] === '-') delta = -delta\n  }\n\n  const date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction))\n\n  if (delta) date.setTime(date.getTime() - delta)\n\n  return date\n}\n\nfunction representYamlTimestamp (object /*, style */) {\n  return object.toISOString()\n}\n\nmodule.exports = new Type('tag:yaml.org,2002:timestamp', {\n  kind: 'scalar',\n  resolve: resolveYamlTimestamp,\n  construct: constructYamlTimestamp,\n  instanceOf: Date,\n  represent: representYamlTimestamp\n})\n","'use strict'\n\nconst Type = require('../type')\n\nfunction resolveYamlMerge (data) {\n  return data === '<<' || data === null\n}\n\nmodule.exports = new Type('tag:yaml.org,2002:merge', {\n  kind: 'scalar',\n  resolve: resolveYamlMerge\n})\n","'use strict'\n\nconst Type = require('../type')\n\n// [ 64, 65, 66 ] -> [ padding, CR, LF ]\nconst BASE64_MAP = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\\n\\r'\n\nfunction resolveYamlBinary (data) {\n  if (data === null) return false\n\n  let bitlen = 0\n  const max = data.length\n  const map = BASE64_MAP\n\n  // Convert one by one.\n  for (let idx = 0; idx < max; idx++) {\n    const code = map.indexOf(data.charAt(idx))\n\n    // Skip CR/LF\n    if (code > 64) continue\n\n    // Fail on illegal characters\n    if (code < 0) return false\n\n    bitlen += 6\n  }\n\n  // If there are any bits left, source was corrupted\n  return (bitlen % 8) === 0\n}\n\nfunction constructYamlBinary (data) {\n  const input = data.replace(/[\\r\\n=]/g, '') // remove CR/LF & padding to simplify scan\n  const max = input.length\n  const map = BASE64_MAP\n  let bits = 0\n  const result = []\n\n  // Collect by 6*4 bits (3 bytes)\n\n  for (let idx = 0; idx < max; idx++) {\n    if ((idx % 4 === 0) && idx) {\n      result.push((bits >> 16) & 0xFF)\n      result.push((bits >> 8) & 0xFF)\n      result.push(bits & 0xFF)\n    }\n\n    bits = (bits << 6) | map.indexOf(input.charAt(idx))\n  }\n\n  // Dump tail\n\n  const tailbits = (max % 4) * 6\n\n  if (tailbits === 0) {\n    result.push((bits >> 16) & 0xFF)\n    result.push((bits >> 8) & 0xFF)\n    result.push(bits & 0xFF)\n  } else if (tailbits === 18) {\n    result.push((bits >> 10) & 0xFF)\n    result.push((bits >> 2) & 0xFF)\n  } else if (tailbits === 12) {\n    result.push((bits >> 4) & 0xFF)\n  }\n\n  return new Uint8Array(result)\n}\n\nfunction representYamlBinary (object /*, style */) {\n  let result = ''\n  let bits = 0\n  const max = object.length\n  const map = BASE64_MAP\n\n  // Convert every three bytes to 4 ASCII characters.\n\n  for (let idx = 0; idx < max; idx++) {\n    if ((idx % 3 === 0) && idx) {\n      result += map[(bits >> 18) & 0x3F]\n      result += map[(bits >> 12) & 0x3F]\n      result += map[(bits >> 6) & 0x3F]\n      result += map[bits & 0x3F]\n    }\n\n    bits = (bits << 8) + object[idx]\n  }\n\n  // Dump tail\n\n  const tail = max % 3\n\n  if (tail === 0) {\n    result += map[(bits >> 18) & 0x3F]\n    result += map[(bits >> 12) & 0x3F]\n    result += map[(bits >> 6) & 0x3F]\n    result += map[bits & 0x3F]\n  } else if (tail === 2) {\n    result += map[(bits >> 10) & 0x3F]\n    result += map[(bits >> 4) & 0x3F]\n    result += map[(bits << 2) & 0x3F]\n    result += map[64]\n  } else if (tail === 1) {\n    result += map[(bits >> 2) & 0x3F]\n    result += map[(bits << 4) & 0x3F]\n    result += map[64]\n    result += map[64]\n  }\n\n  return result\n}\n\nfunction isBinary (obj) {\n  return Object.prototype.toString.call(obj) === '[object Uint8Array]'\n}\n\nmodule.exports = new Type('tag:yaml.org,2002:binary', {\n  kind: 'scalar',\n  resolve: resolveYamlBinary,\n  construct: constructYamlBinary,\n  predicate: isBinary,\n  represent: representYamlBinary\n})\n","'use strict'\n\nconst Type = require('../type')\n\nconst _hasOwnProperty = Object.prototype.hasOwnProperty\nconst _toString = Object.prototype.toString\n\nfunction resolveYamlOmap (data) {\n  if (data === null) return true\n\n  const objectKeys = []\n  const object = data\n\n  for (let index = 0, length = object.length; index < length; index += 1) {\n    const pair = object[index]\n    let pairHasKey = false\n\n    if (_toString.call(pair) !== '[object Object]') return false\n\n    let pairKey\n    for (pairKey in pair) {\n      if (_hasOwnProperty.call(pair, pairKey)) {\n        if (!pairHasKey) pairHasKey = true\n        else return false\n      }\n    }\n\n    if (!pairHasKey) return false\n\n    if (objectKeys.indexOf(pairKey) === -1) objectKeys.push(pairKey)\n    else return false\n  }\n\n  return true\n}\n\nfunction constructYamlOmap (data) {\n  return data !== null ? data : []\n}\n\nmodule.exports = new Type('tag:yaml.org,2002:omap', {\n  kind: 'sequence',\n  resolve: resolveYamlOmap,\n  construct: constructYamlOmap\n})\n","'use strict'\n\nconst Type = require('../type')\n\nconst _toString = Object.prototype.toString\n\nfunction resolveYamlPairs (data) {\n  if (data === null) return true\n\n  const object = data\n\n  const result = new Array(object.length)\n\n  for (let index = 0, length = object.length; index < length; index += 1) {\n    const pair = object[index]\n\n    if (_toString.call(pair) !== '[object Object]') return false\n\n    const keys = Object.keys(pair)\n\n    if (keys.length !== 1) return false\n\n    result[index] = [keys[0], pair[keys[0]]]\n  }\n\n  return true\n}\n\nfunction constructYamlPairs (data) {\n  if (data === null) return []\n\n  const object = data\n  const result = new Array(object.length)\n\n  for (let index = 0, length = object.length; index < length; index += 1) {\n    const pair = object[index]\n\n    const keys = Object.keys(pair)\n\n    result[index] = [keys[0], pair[keys[0]]]\n  }\n\n  return result\n}\n\nmodule.exports = new Type('tag:yaml.org,2002:pairs', {\n  kind: 'sequence',\n  resolve: resolveYamlPairs,\n  construct: constructYamlPairs\n})\n","'use strict'\n\nconst Type = require('../type')\n\nconst _hasOwnProperty = Object.prototype.hasOwnProperty\n\nfunction resolveYamlSet (data) {\n  if (data === null) return true\n\n  const object = data\n\n  for (const key in object) {\n    if (_hasOwnProperty.call(object, key)) {\n      if (object[key] !== null) return false\n    }\n  }\n\n  return true\n}\n\nfunction constructYamlSet (data) {\n  return data !== null ? data : {}\n}\n\nmodule.exports = new Type('tag:yaml.org,2002:set', {\n  kind: 'mapping',\n  resolve: resolveYamlSet,\n  construct: constructYamlSet\n})\n","// JS-YAML's default schema for `safeLoad` function.\n// It is not described in the YAML specification.\n//\n// This schema is based on standard YAML's Core schema and includes most of\n// extra types described at YAML tag repository. (http://yaml.org/type/)\n\n'use strict'\n\nmodule.exports = require('./core').extend({\n  implicit: [\n    require('../type/timestamp'),\n    require('../type/merge')\n  ],\n  explicit: [\n    require('../type/binary'),\n    require('../type/omap'),\n    require('../type/pairs'),\n    require('../type/set')\n  ]\n})\n","'use strict'\n\nconst common = require('./common')\nconst YAMLException = require('./exception')\nconst makeSnippet = require('./snippet')\nconst DEFAULT_SCHEMA = require('./schema/default')\n\nconst _hasOwnProperty = Object.prototype.hasOwnProperty\n\nconst CONTEXT_FLOW_IN = 1\nconst CONTEXT_FLOW_OUT = 2\nconst CONTEXT_BLOCK_IN = 3\nconst CONTEXT_BLOCK_OUT = 4\n\nconst CHOMPING_CLIP = 1\nconst CHOMPING_STRIP = 2\nconst CHOMPING_KEEP = 3\n\n// eslint-disable-next-line no-control-regex\nconst PATTERN_NON_PRINTABLE = /[\\x00-\\x08\\x0B\\x0C\\x0E-\\x1F\\x7F-\\x84\\x86-\\x9F\\uFFFE\\uFFFF]|[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF]/\nconst PATTERN_NON_ASCII_LINE_BREAKS = /[\\x85\\u2028\\u2029]/\n// eslint-disable-next-line no-useless-escape\nconst PATTERN_FLOW_INDICATORS = /[,\\[\\]{}]/\n// eslint-disable-next-line no-useless-escape\nconst PATTERN_TAG_HANDLE = /^(?:!|!!|![0-9A-Za-z-]+!)$/\n// eslint-disable-next-line no-useless-escape\nconst PATTERN_TAG_URI = /^(?:!|[^,\\[\\]{}])(?:%[0-9a-f]{2}|[0-9a-z\\-#;/?:@&=+$,_.!~*'()\\[\\]])*$/i\n\nfunction _class (obj) { return Object.prototype.toString.call(obj) }\n\nfunction isEol (c) {\n  return (c === 0x0A/* LF */) || (c === 0x0D/* CR */)\n}\n\nfunction isWhiteSpace (c) {\n  return (c === 0x09/* Tab */) || (c === 0x20/* Space */)\n}\n\nfunction isWsOrEol (c) {\n  return (c === 0x09/* Tab */) ||\n         (c === 0x20/* Space */) ||\n         (c === 0x0A/* LF */) ||\n         (c === 0x0D/* CR */)\n}\n\nfunction isFlowIndicator (c) {\n  return c === 0x2C/* , */ ||\n         c === 0x5B/* [ */ ||\n         c === 0x5D/* ] */ ||\n         c === 0x7B/* { */ ||\n         c === 0x7D/* } */\n}\n\nfunction fromHexCode (c) {\n  if ((c >= 0x30/* 0 */) && (c <= 0x39/* 9 */)) {\n    return c - 0x30\n  }\n\n  const lc = c | 0x20\n\n  if ((lc >= 0x61/* a */) && (lc <= 0x66/* f */)) {\n    return lc - 0x61 + 10\n  }\n\n  return -1\n}\n\nfunction escapedHexLen (c) {\n  if (c === 0x78/* x */) { return 2 }\n  if (c === 0x75/* u */) { return 4 }\n  if (c === 0x55/* U */) { return 8 }\n  return 0\n}\n\nfunction fromDecimalCode (c) {\n  if ((c >= 0x30/* 0 */) && (c <= 0x39/* 9 */)) {\n    return c - 0x30\n  }\n\n  return -1\n}\n\nfunction simpleEscapeSequence (c) {\n  switch (c) {\n    case 0x30/* 0 */: return '\\x00'\n    case 0x61/* a */: return '\\x07'\n    case 0x62/* b */: return '\\x08'\n    case 0x74/* t */: return '\\x09'\n    case 0x09/* Tab */: return '\\x09'\n    case 0x6E/* n */: return '\\x0A'\n    case 0x76/* v */: return '\\x0B'\n    case 0x66/* f */: return '\\x0C'\n    case 0x72/* r */: return '\\x0D'\n    case 0x65/* e */: return '\\x1B'\n    case 0x20/* Space */: return ' '\n    case 0x22/* \" */: return '\\x22'\n    case 0x2F/* / */: return '/'\n    case 0x5C/* \\ */: return '\\x5C'\n    case 0x4E/* N */: return '\\x85'\n    case 0x5F/* _ */: return '\\xA0'\n    case 0x4C/* L */: return '\\u2028'\n    case 0x50/* P */: return '\\u2029'\n    default: return ''\n  }\n}\n\nfunction charFromCodepoint (c) {\n  if (c <= 0xFFFF) {\n    return String.fromCharCode(c)\n  }\n  // Encode UTF-16 surrogate pair\n  // https://en.wikipedia.org/wiki/UTF-16#Code_points_U.2B010000_to_U.2B10FFFF\n  return String.fromCharCode(\n    ((c - 0x010000) >> 10) + 0xD800,\n    ((c - 0x010000) & 0x03FF) + 0xDC00\n  )\n}\n\n// set a property of a literal object, while protecting against prototype pollution,\n// see https://github.com/nodeca/js-yaml/issues/164 for more details\nfunction setProperty (object, key, value) {\n  // used for this specific key only because Object.defineProperty is slow\n  if (key === '__proto__') {\n    Object.defineProperty(object, key, {\n      configurable: true,\n      enumerable: true,\n      writable: true,\n      value: value\n    })\n  } else {\n    object[key] = value\n  }\n}\n\nconst simpleEscapeCheck = new Array(256) // integer, for fast access\nconst simpleEscapeMap = new Array(256)\nfor (let i = 0; i < 256; i++) {\n  simpleEscapeCheck[i] = simpleEscapeSequence(i) ? 1 : 0\n  simpleEscapeMap[i] = simpleEscapeSequence(i)\n}\n\nfunction State (input, options) {\n  this.input = input\n\n  this.filename = options['filename'] || null\n  this.schema = options['schema'] || DEFAULT_SCHEMA\n  this.onWarning = options['onWarning'] || null\n  // (Hidden) Remove? makes the loader to expect YAML 1.1 documents\n  // if such documents have no explicit %YAML directive\n  this.legacy = options['legacy'] || false\n\n  this.json = options['json'] || false\n  this.listener = options['listener'] || null\n  this.maxDepth = typeof options['maxDepth'] === 'number' ? options['maxDepth'] : 100\n  this.maxTotalMergeKeys = typeof options['maxTotalMergeKeys'] === 'number' ? options['maxTotalMergeKeys'] : 10000\n\n  this.implicitTypes = this.schema.compiledImplicit\n  this.typeMap = this.schema.compiledTypeMap\n\n  this.length = input.length\n  this.position = 0\n  this.line = 0\n  this.lineStart = 0\n  this.lineIndent = 0\n  this.depth = 0\n  this.totalMergeKeys = 0\n\n  // position of first leading tab in the current line,\n  // used to make sure there are no tabs in the indentation\n  this.firstTabInLine = -1\n\n  this.documents = []\n  this.anchorMapTransactions = []\n\n  /*\n  this.version;\n  this.checkLineBreaks;\n  this.tagMap;\n  this.anchorMap;\n  this.tag;\n  this.anchor;\n  this.kind;\n  this.result; */\n}\n\nfunction generateError (state, message) {\n  const mark = {\n    name: state.filename,\n    buffer: state.input.slice(0, -1), // omit trailing \\0\n    position: state.position,\n    line: state.line,\n    column: state.position - state.lineStart\n  }\n\n  mark.snippet = makeSnippet(mark)\n\n  return new YAMLException(message, mark)\n}\n\nfunction throwError (state, message) {\n  throw generateError(state, message)\n}\n\nfunction throwWarning (state, message) {\n  if (state.onWarning) {\n    state.onWarning.call(null, generateError(state, message))\n  }\n}\n\nfunction storeAnchor (state, name, value) {\n  const transactions = state.anchorMapTransactions\n\n  if (transactions.length !== 0) {\n    const transaction = transactions[transactions.length - 1]\n\n    if (!_hasOwnProperty.call(transaction, name)) {\n      transaction[name] = {\n        existed: _hasOwnProperty.call(state.anchorMap, name),\n        value: state.anchorMap[name]\n      }\n    }\n  }\n\n  state.anchorMap[name] = value\n}\n\nfunction beginAnchorTransaction (state) {\n  state.anchorMapTransactions.push(Object.create(null))\n}\n\nfunction commitAnchorTransaction (state) {\n  const transaction = state.anchorMapTransactions.pop()\n  const transactions = state.anchorMapTransactions\n\n  if (transactions.length === 0) return\n\n  const parent = transactions[transactions.length - 1]\n  const names = Object.keys(transaction)\n\n  for (let index = 0, length = names.length; index < length; index += 1) {\n    const name = names[index]\n\n    if (!_hasOwnProperty.call(parent, name)) {\n      parent[name] = transaction[name]\n    }\n  }\n}\n\nfunction rollbackAnchorTransaction (state) {\n  const transaction = state.anchorMapTransactions.pop()\n  const names = Object.keys(transaction)\n\n  for (let index = names.length - 1; index >= 0; index -= 1) {\n    const entry = transaction[names[index]]\n\n    if (entry.existed) {\n      state.anchorMap[names[index]] = entry.value\n    } else {\n      delete state.anchorMap[names[index]]\n    }\n  }\n}\n\nfunction snapshotState (state) {\n  return {\n    position: state.position,\n    line: state.line,\n    lineStart: state.lineStart,\n    lineIndent: state.lineIndent,\n    firstTabInLine: state.firstTabInLine,\n    tag: state.tag,\n    anchor: state.anchor,\n    kind: state.kind,\n    result: state.result\n  }\n}\n\nfunction restoreState (state, snapshot) {\n  state.position = snapshot.position\n  state.line = snapshot.line\n  state.lineStart = snapshot.lineStart\n  state.lineIndent = snapshot.lineIndent\n  state.firstTabInLine = snapshot.firstTabInLine\n  state.tag = snapshot.tag\n  state.anchor = snapshot.anchor\n  state.kind = snapshot.kind\n  state.result = snapshot.result\n}\n\nconst directiveHandlers = {\n\n  YAML: function handleYamlDirective (state, name, args) {\n    if (state.version !== null) {\n      throwError(state, 'duplication of %YAML directive')\n    }\n\n    if (args.length !== 1) {\n      throwError(state, 'YAML directive accepts exactly one argument')\n    }\n\n    const match = /^([0-9]+)\\.([0-9]+)$/.exec(args[0])\n\n    if (match === null) {\n      throwError(state, 'ill-formed argument of the YAML directive')\n    }\n\n    const major = parseInt(match[1], 10)\n    const minor = parseInt(match[2], 10)\n\n    if (major !== 1) {\n      throwError(state, 'unacceptable YAML version of the document')\n    }\n\n    state.version = args[0]\n    state.checkLineBreaks = (minor < 2)\n\n    if (minor !== 1 && minor !== 2) {\n      throwWarning(state, 'unsupported YAML version of the document')\n    }\n  },\n\n  TAG: function handleTagDirective (state, name, args) {\n    let prefix\n\n    if (args.length !== 2) {\n      throwError(state, 'TAG directive accepts exactly two arguments')\n    }\n\n    const handle = args[0]\n    prefix = args[1]\n\n    if (!PATTERN_TAG_HANDLE.test(handle)) {\n      throwError(state, 'ill-formed tag handle (first argument) of the TAG directive')\n    }\n\n    if (_hasOwnProperty.call(state.tagMap, handle)) {\n      throwError(state, 'there is a previously declared suffix for \"' + handle + '\" tag handle')\n    }\n\n    if (!PATTERN_TAG_URI.test(prefix)) {\n      throwError(state, 'ill-formed tag prefix (second argument) of the TAG directive')\n    }\n\n    try {\n      prefix = decodeURIComponent(prefix)\n    } catch (err) {\n      throwError(state, 'tag prefix is malformed: ' + prefix)\n    }\n\n    state.tagMap[handle] = prefix\n  }\n}\n\nfunction captureSegment (state, start, end, checkJson) {\n  if (start < end) {\n    const _result = state.input.slice(start, end)\n\n    if (checkJson) {\n      for (let _position = 0, _length = _result.length; _position < _length; _position += 1) {\n        const _character = _result.charCodeAt(_position)\n        if (!(_character === 0x09 ||\n              (_character >= 0x20 && _character <= 0x10FFFF))) {\n          throwError(state, 'expected valid JSON character')\n        }\n      }\n    } else if (PATTERN_NON_PRINTABLE.test(_result)) {\n      throwError(state, 'the stream contains non-printable characters')\n    }\n\n    state.result += _result\n  }\n}\n\nfunction mergeMappings (state, destination, source, overridableKeys) {\n  if (!common.isObject(source)) {\n    throwError(state, 'cannot merge mappings; the provided source object is unacceptable')\n  }\n\n  const sourceKeys = Object.keys(source)\n\n  for (let index = 0, quantity = sourceKeys.length; index < quantity; index += 1) {\n    const key = sourceKeys[index]\n\n    if (state.maxTotalMergeKeys !== -1 && ++state.totalMergeKeys > state.maxTotalMergeKeys) {\n      throwError(state, 'merge keys exceeded maxTotalMergeKeys (' + state.maxTotalMergeKeys + ')')\n    }\n\n    if (!_hasOwnProperty.call(destination, key)) {\n      setProperty(destination, key, source[key])\n      overridableKeys[key] = true\n    }\n  }\n}\n\nfunction storeMappingPair (state, _result, overridableKeys, keyTag, keyNode, valueNode,\n  startLine, startLineStart, startPos) {\n  // The output is a plain object here, so keys can only be strings.\n  // We need to convert keyNode to a string, but doing so can hang the process\n  // (deeply nested arrays that explode exponentially using aliases).\n  if (Array.isArray(keyNode)) {\n    keyNode = Array.prototype.slice.call(keyNode)\n\n    for (let index = 0, quantity = keyNode.length; index < quantity; index += 1) {\n      if (Array.isArray(keyNode[index])) {\n        throwError(state, 'nested arrays are not supported inside keys')\n      }\n\n      if (typeof keyNode === 'object' && _class(keyNode[index]) === '[object Object]') {\n        keyNode[index] = '[object Object]'\n      }\n    }\n  }\n\n  // Avoid code execution in load() via toString property\n  // (still use its own toString for arrays, timestamps,\n  // and whatever user schema extensions happen to have @@toStringTag)\n  if (typeof keyNode === 'object' && _class(keyNode) === '[object Object]') {\n    keyNode = '[object Object]'\n  }\n\n  keyNode = String(keyNode)\n\n  if (_result === null) {\n    _result = {}\n  }\n\n  if (keyTag === 'tag:yaml.org,2002:merge') {\n    if (Array.isArray(valueNode)) {\n      for (let index = 0, quantity = valueNode.length; index < quantity; index += 1) {\n        mergeMappings(state, _result, valueNode[index], overridableKeys)\n      }\n    } else {\n      mergeMappings(state, _result, valueNode, overridableKeys)\n    }\n  } else {\n    if (!state.json &&\n        !_hasOwnProperty.call(overridableKeys, keyNode) &&\n        _hasOwnProperty.call(_result, keyNode)) {\n      state.line = startLine || state.line\n      state.lineStart = startLineStart || state.lineStart\n      state.position = startPos || state.position\n      throwError(state, 'duplicated mapping key')\n    }\n\n    setProperty(_result, keyNode, valueNode)\n    delete overridableKeys[keyNode]\n  }\n\n  return _result\n}\n\nfunction readLineBreak (state) {\n  const ch = state.input.charCodeAt(state.position)\n\n  if (ch === 0x0A/* LF */) {\n    state.position++\n  } else if (ch === 0x0D/* CR */) {\n    state.position++\n    if (state.input.charCodeAt(state.position) === 0x0A/* LF */) {\n      state.position++\n    }\n  } else {\n    throwError(state, 'a line break is expected')\n  }\n\n  state.line += 1\n  state.lineStart = state.position\n  state.firstTabInLine = -1\n}\n\nfunction skipSeparationSpace (state, allowComments, checkIndent) {\n  let lineBreaks = 0\n  let ch = state.input.charCodeAt(state.position)\n\n  while (ch !== 0) {\n    while (isWhiteSpace(ch)) {\n      if (ch === 0x09/* Tab */ && state.firstTabInLine === -1) {\n        state.firstTabInLine = state.position\n      }\n      ch = state.input.charCodeAt(++state.position)\n    }\n\n    if (allowComments && ch === 0x23/* # */) {\n      do {\n        ch = state.input.charCodeAt(++state.position)\n      } while (ch !== 0x0A/* LF */ && ch !== 0x0D/* CR */ && ch !== 0)\n    }\n\n    if (isEol(ch)) {\n      readLineBreak(state)\n\n      ch = state.input.charCodeAt(state.position)\n      lineBreaks++\n      state.lineIndent = 0\n\n      while (ch === 0x20/* Space */) {\n        state.lineIndent++\n        ch = state.input.charCodeAt(++state.position)\n      }\n    } else {\n      break\n    }\n  }\n\n  if (checkIndent !== -1 && lineBreaks !== 0 && state.lineIndent < checkIndent) {\n    throwWarning(state, 'deficient indentation')\n  }\n\n  return lineBreaks\n}\n\nfunction testDocumentSeparator (state) {\n  let _position = state.position\n  let ch = state.input.charCodeAt(_position)\n\n  // Condition state.position === state.lineStart is tested\n  // in parent on each call, for efficiency. No needs to test here again.\n  if ((ch === 0x2D/* - */ || ch === 0x2E/* . */) &&\n      ch === state.input.charCodeAt(_position + 1) &&\n      ch === state.input.charCodeAt(_position + 2)) {\n    _position += 3\n\n    ch = state.input.charCodeAt(_position)\n\n    if (ch === 0 || isWsOrEol(ch)) {\n      return true\n    }\n  }\n\n  return false\n}\n\nfunction writeFoldedLines (state, count) {\n  if (count === 1) {\n    state.result += ' '\n  } else if (count > 1) {\n    state.result += common.repeat('\\n', count - 1)\n  }\n}\n\nfunction readPlainScalar (state, nodeIndent, withinFlowCollection) {\n  let captureStart\n  let captureEnd\n  let hasPendingContent\n  let _line\n  let _lineStart\n  let _lineIndent\n  const _kind = state.kind\n  const _result = state.result\n\n  let ch = state.input.charCodeAt(state.position)\n\n  if (isWsOrEol(ch) ||\n      isFlowIndicator(ch) ||\n      ch === 0x23/* # */ ||\n      ch === 0x26/* & */ ||\n      ch === 0x2A/* * */ ||\n      ch === 0x21/* ! */ ||\n      ch === 0x7C/* | */ ||\n      ch === 0x3E/* > */ ||\n      ch === 0x27/* ' */ ||\n      ch === 0x22/* \" */ ||\n      ch === 0x25/* % */ ||\n      ch === 0x40/* @ */ ||\n      ch === 0x60/* ` */) {\n    return false\n  }\n\n  if (ch === 0x3F/* ? */ || ch === 0x2D/* - */) {\n    const following = state.input.charCodeAt(state.position + 1)\n\n    if (isWsOrEol(following) ||\n        (withinFlowCollection && isFlowIndicator(following))) {\n      return false\n    }\n  }\n\n  state.kind = 'scalar'\n  state.result = ''\n  captureStart = captureEnd = state.position\n  hasPendingContent = false\n\n  while (ch !== 0) {\n    if (ch === 0x3A/* : */) {\n      const following = state.input.charCodeAt(state.position + 1)\n\n      if (isWsOrEol(following) ||\n          (withinFlowCollection && isFlowIndicator(following))) {\n        break\n      }\n    } else if (ch === 0x23/* # */) {\n      const preceding = state.input.charCodeAt(state.position - 1)\n\n      if (isWsOrEol(preceding)) {\n        break\n      }\n    } else if ((state.position === state.lineStart && testDocumentSeparator(state)) ||\n               (withinFlowCollection && isFlowIndicator(ch))) {\n      break\n    } else if (isEol(ch)) {\n      _line = state.line\n      _lineStart = state.lineStart\n      _lineIndent = state.lineIndent\n      skipSeparationSpace(state, false, -1)\n\n      if (state.lineIndent >= nodeIndent) {\n        hasPendingContent = true\n        ch = state.input.charCodeAt(state.position)\n        continue\n      } else {\n        state.position = captureEnd\n        state.line = _line\n        state.lineStart = _lineStart\n        state.lineIndent = _lineIndent\n        break\n      }\n    }\n\n    if (hasPendingContent) {\n      captureSegment(state, captureStart, captureEnd, false)\n      writeFoldedLines(state, state.line - _line)\n      captureStart = captureEnd = state.position\n      hasPendingContent = false\n    }\n\n    if (!isWhiteSpace(ch)) {\n      captureEnd = state.position + 1\n    }\n\n    ch = state.input.charCodeAt(++state.position)\n  }\n\n  captureSegment(state, captureStart, captureEnd, false)\n\n  if (state.result) {\n    return true\n  }\n\n  state.kind = _kind\n  state.result = _result\n  return false\n}\n\nfunction readSingleQuotedScalar (state, nodeIndent) {\n  let captureStart\n  let captureEnd\n\n  let ch = state.input.charCodeAt(state.position)\n\n  if (ch !== 0x27/* ' */) {\n    return false\n  }\n\n  state.kind = 'scalar'\n  state.result = ''\n  state.position++\n  captureStart = captureEnd = state.position\n\n  while ((ch = state.input.charCodeAt(state.position)) !== 0) {\n    if (ch === 0x27/* ' */) {\n      captureSegment(state, captureStart, state.position, true)\n      ch = state.input.charCodeAt(++state.position)\n\n      if (ch === 0x27/* ' */) {\n        captureStart = state.position\n        state.position++\n        captureEnd = state.position\n      } else {\n        return true\n      }\n    } else if (isEol(ch)) {\n      captureSegment(state, captureStart, captureEnd, true)\n      writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent))\n      captureStart = captureEnd = state.position\n    } else if (state.position === state.lineStart && testDocumentSeparator(state)) {\n      throwError(state, 'unexpected end of the document within a single quoted scalar')\n    } else {\n      state.position++\n      if (!isWhiteSpace(ch)) {\n        captureEnd = state.position\n      }\n    }\n  }\n\n  throwError(state, 'unexpected end of the stream within a single quoted scalar')\n}\n\nfunction readDoubleQuotedScalar (state, nodeIndent) {\n  let captureStart\n  let captureEnd\n  let tmp\n\n  let ch = state.input.charCodeAt(state.position)\n\n  if (ch !== 0x22/* \" */) {\n    return false\n  }\n\n  state.kind = 'scalar'\n  state.result = ''\n  state.position++\n  captureStart = captureEnd = state.position\n\n  while ((ch = state.input.charCodeAt(state.position)) !== 0) {\n    if (ch === 0x22/* \" */) {\n      captureSegment(state, captureStart, state.position, true)\n      state.position++\n      return true\n    } else if (ch === 0x5C/* \\ */) {\n      captureSegment(state, captureStart, state.position, true)\n      ch = state.input.charCodeAt(++state.position)\n\n      if (isEol(ch)) {\n        skipSeparationSpace(state, false, nodeIndent)\n\n        // TODO: rework to inline fn with no type cast?\n      } else if (ch < 256 && simpleEscapeCheck[ch]) {\n        state.result += simpleEscapeMap[ch]\n        state.position++\n      } else if ((tmp = escapedHexLen(ch)) > 0) {\n        let hexLength = tmp\n        let hexResult = 0\n\n        for (; hexLength > 0; hexLength--) {\n          ch = state.input.charCodeAt(++state.position)\n\n          if ((tmp = fromHexCode(ch)) >= 0) {\n            hexResult = (hexResult << 4) + tmp\n          } else {\n            throwError(state, 'expected hexadecimal character')\n          }\n        }\n\n        state.result += charFromCodepoint(hexResult)\n\n        state.position++\n      } else {\n        throwError(state, 'unknown escape sequence')\n      }\n\n      captureStart = captureEnd = state.position\n    } else if (isEol(ch)) {\n      captureSegment(state, captureStart, captureEnd, true)\n      writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent))\n      captureStart = captureEnd = state.position\n    } else if (state.position === state.lineStart && testDocumentSeparator(state)) {\n      throwError(state, 'unexpected end of the document within a double quoted scalar')\n    } else {\n      state.position++\n      if (!isWhiteSpace(ch)) {\n        captureEnd = state.position\n      }\n    }\n  }\n\n  throwError(state, 'unexpected end of the stream within a double quoted scalar')\n}\n\nfunction readFlowCollection (state, nodeIndent) {\n  let readNext = true\n  let _line\n  let _lineStart\n  let _pos\n  const _tag = state.tag\n  let _result\n  const _anchor = state.anchor\n  let terminator\n  let isPair\n  let isExplicitPair\n  let isMapping\n  const overridableKeys = Object.create(null)\n  let keyNode\n  let keyTag\n  let valueNode\n\n  let ch = state.input.charCodeAt(state.position)\n\n  if (ch === 0x5B/* [ */) {\n    terminator = 0x5D/* ] */\n    isMapping = false\n    _result = []\n  } else if (ch === 0x7B/* { */) {\n    terminator = 0x7D/* } */\n    isMapping = true\n    _result = {}\n  } else {\n    return false\n  }\n\n  if (state.anchor !== null) {\n    storeAnchor(state, state.anchor, _result)\n  }\n\n  ch = state.input.charCodeAt(++state.position)\n\n  while (ch !== 0) {\n    skipSeparationSpace(state, true, nodeIndent)\n\n    ch = state.input.charCodeAt(state.position)\n\n    if (ch === terminator) {\n      state.position++\n      state.tag = _tag\n      state.anchor = _anchor\n      state.kind = isMapping ? 'mapping' : 'sequence'\n      state.result = _result\n      return true\n    } else if (!readNext) {\n      throwError(state, 'missed comma between flow collection entries')\n    } else if (ch === 0x2C/* , */) {\n      // \"flow collection entries can never be completely empty\", as per YAML 1.2, section 7.4\n      throwError(state, \"expected the node content, but found ','\")\n    }\n\n    keyTag = keyNode = valueNode = null\n    isPair = isExplicitPair = false\n\n    if (ch === 0x3F/* ? */) {\n      const following = state.input.charCodeAt(state.position + 1)\n\n      if (isWsOrEol(following)) {\n        isPair = isExplicitPair = true\n        state.position++\n        skipSeparationSpace(state, true, nodeIndent)\n      }\n    }\n\n    _line = state.line // Save the current line.\n    _lineStart = state.lineStart\n    _pos = state.position\n    composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true)\n    keyTag = state.tag\n    keyNode = state.result\n    skipSeparationSpace(state, true, nodeIndent)\n\n    ch = state.input.charCodeAt(state.position)\n\n    if ((isExplicitPair || state.line === _line) && ch === 0x3A/* : */) {\n      isPair = true\n      ch = state.input.charCodeAt(++state.position)\n      skipSeparationSpace(state, true, nodeIndent)\n      composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true)\n      valueNode = state.result\n    }\n\n    if (isMapping) {\n      storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos)\n    } else if (isPair) {\n      _result.push(storeMappingPair(state, null, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos))\n    } else {\n      _result.push(keyNode)\n    }\n\n    skipSeparationSpace(state, true, nodeIndent)\n\n    ch = state.input.charCodeAt(state.position)\n\n    if (ch === 0x2C/* , */) {\n      readNext = true\n      ch = state.input.charCodeAt(++state.position)\n    } else {\n      readNext = false\n    }\n  }\n\n  throwError(state, 'unexpected end of the stream within a flow collection')\n}\n\nfunction readBlockScalar (state, nodeIndent) {\n  let folding\n  let chomping = CHOMPING_CLIP\n  let didReadContent = false\n  let detectedIndent = false\n  let textIndent = nodeIndent\n  let emptyLines = 0\n  let atMoreIndented = false\n  let tmp\n\n  let ch = state.input.charCodeAt(state.position)\n\n  if (ch === 0x7C/* | */) {\n    folding = false\n  } else if (ch === 0x3E/* > */) {\n    folding = true\n  } else {\n    return false\n  }\n\n  state.kind = 'scalar'\n  state.result = ''\n\n  while (ch !== 0) {\n    ch = state.input.charCodeAt(++state.position)\n\n    if (ch === 0x2B/* + */ || ch === 0x2D/* - */) {\n      if (CHOMPING_CLIP === chomping) {\n        chomping = (ch === 0x2B/* + */) ? CHOMPING_KEEP : CHOMPING_STRIP\n      } else {\n        throwError(state, 'repeat of a chomping mode identifier')\n      }\n    } else if ((tmp = fromDecimalCode(ch)) >= 0) {\n      if (tmp === 0) {\n        throwError(state, 'bad explicit indentation width of a block scalar; it cannot be less than one')\n      } else if (!detectedIndent) {\n        textIndent = nodeIndent + tmp - 1\n        detectedIndent = true\n      } else {\n        throwError(state, 'repeat of an indentation width identifier')\n      }\n    } else {\n      break\n    }\n  }\n\n  if (isWhiteSpace(ch)) {\n    do { ch = state.input.charCodeAt(++state.position) }\n    while (isWhiteSpace(ch))\n\n    if (ch === 0x23/* # */) {\n      do { ch = state.input.charCodeAt(++state.position) }\n      while (!isEol(ch) && (ch !== 0))\n    }\n  }\n\n  while (ch !== 0) {\n    readLineBreak(state)\n    state.lineIndent = 0\n\n    ch = state.input.charCodeAt(state.position)\n\n    // eslint-disable-next-line no-unmodified-loop-condition\n    while ((!detectedIndent || state.lineIndent < textIndent) &&\n           (ch === 0x20/* Space */)) {\n      state.lineIndent++\n      ch = state.input.charCodeAt(++state.position)\n    }\n\n    if (!detectedIndent && state.lineIndent > textIndent) {\n      textIndent = state.lineIndent\n    }\n\n    if (isEol(ch)) {\n      emptyLines++\n      continue\n    }\n\n    if (!detectedIndent && textIndent === 0) {\n      throwError(state, 'missing indentation for block scalar')\n    }\n\n    // End of the scalar.\n    if (state.lineIndent < textIndent) {\n      // Perform the chomping.\n      if (chomping === CHOMPING_KEEP) {\n        state.result += common.repeat('\\n', didReadContent ? 1 + emptyLines : emptyLines)\n      } else if (chomping === CHOMPING_CLIP) {\n        if (didReadContent) { // i.e. only if the scalar is not empty.\n          state.result += '\\n'\n        }\n      }\n\n      // Break this `while` cycle and go to the funciton's epilogue.\n      break\n    }\n\n    // Folded style: use fancy rules to handle line breaks.\n    if (folding) {\n      // Lines starting with white space characters (more-indented lines) are not folded.\n      if (isWhiteSpace(ch)) {\n        atMoreIndented = true\n        // except for the first content line (cf. Example 8.1)\n        state.result += common.repeat('\\n', didReadContent ? 1 + emptyLines : emptyLines)\n\n      // End of more-indented block.\n      } else if (atMoreIndented) {\n        atMoreIndented = false\n        state.result += common.repeat('\\n', emptyLines + 1)\n\n      // Just one line break - perceive as the same line.\n      } else if (emptyLines === 0) {\n        if (didReadContent) { // i.e. only if we have already read some scalar content.\n          state.result += ' '\n        }\n\n      // Several line breaks - perceive as different lines.\n      } else {\n        state.result += common.repeat('\\n', emptyLines)\n      }\n\n    // Literal style: just add exact number of line breaks between content lines.\n    } else {\n      // Keep all line breaks except the header line break.\n      state.result += common.repeat('\\n', didReadContent ? 1 + emptyLines : emptyLines)\n    }\n\n    didReadContent = true\n    detectedIndent = true\n    emptyLines = 0\n    const captureStart = state.position\n\n    while (!isEol(ch) && (ch !== 0)) {\n      ch = state.input.charCodeAt(++state.position)\n    }\n\n    captureSegment(state, captureStart, state.position, false)\n  }\n\n  return true\n}\n\nfunction readBlockSequence (state, nodeIndent) {\n  const _tag = state.tag\n  const _anchor = state.anchor\n  const _result = []\n  let detected = false\n\n  // there is a leading tab before this token, so it can't be a block sequence/mapping;\n  // it can still be flow sequence/mapping or a scalar\n  if (state.firstTabInLine !== -1) return false\n\n  if (state.anchor !== null) {\n    storeAnchor(state, state.anchor, _result)\n  }\n\n  let ch = state.input.charCodeAt(state.position)\n\n  while (ch !== 0) {\n    if (state.firstTabInLine !== -1) {\n      state.position = state.firstTabInLine\n      throwError(state, 'tab characters must not be used in indentation')\n    }\n\n    if (ch !== 0x2D/* - */) {\n      break\n    }\n\n    const following = state.input.charCodeAt(state.position + 1)\n\n    if (!isWsOrEol(following)) {\n      break\n    }\n\n    detected = true\n    state.position++\n\n    if (skipSeparationSpace(state, true, -1)) {\n      if (state.lineIndent <= nodeIndent) {\n        _result.push(null)\n        ch = state.input.charCodeAt(state.position)\n        continue\n      }\n    }\n\n    const _line = state.line\n    composeNode(state, nodeIndent, CONTEXT_BLOCK_IN, false, true)\n    _result.push(state.result)\n    skipSeparationSpace(state, true, -1)\n\n    ch = state.input.charCodeAt(state.position)\n\n    if ((state.line === _line || state.lineIndent > nodeIndent) && (ch !== 0)) {\n      throwError(state, 'bad indentation of a sequence entry')\n    } else if (state.lineIndent < nodeIndent) {\n      break\n    }\n  }\n\n  if (detected) {\n    state.tag = _tag\n    state.anchor = _anchor\n    state.kind = 'sequence'\n    state.result = _result\n    return true\n  }\n  return false\n}\n\nfunction readBlockMapping (state, nodeIndent, flowIndent) {\n  let allowCompact\n  let _keyLine\n  let _keyLineStart\n  let _keyPos\n  const _tag = state.tag\n  const _anchor = state.anchor\n  const _result = {}\n  const overridableKeys = Object.create(null)\n  let keyTag = null\n  let keyNode = null\n  let valueNode = null\n  let atExplicitKey = false\n  let detected = false\n\n  // there is a leading tab before this token, so it can't be a block sequence/mapping;\n  // it can still be flow sequence/mapping or a scalar\n  if (state.firstTabInLine !== -1) return false\n\n  if (state.anchor !== null) {\n    storeAnchor(state, state.anchor, _result)\n  }\n\n  let ch = state.input.charCodeAt(state.position)\n\n  while (ch !== 0) {\n    if (!atExplicitKey && state.firstTabInLine !== -1) {\n      state.position = state.firstTabInLine\n      throwError(state, 'tab characters must not be used in indentation')\n    }\n\n    const following = state.input.charCodeAt(state.position + 1)\n    const _line = state.line // Save the current line.\n\n    //\n    // Explicit notation case. There are two separate blocks:\n    // first for the key (denoted by \"?\") and second for the value (denoted by \":\")\n    //\n    if ((ch === 0x3F/* ? */ || ch === 0x3A/* : */) && isWsOrEol(following)) {\n      if (ch === 0x3F/* ? */) {\n        if (atExplicitKey) {\n          storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos)\n          keyTag = keyNode = valueNode = null\n        }\n\n        detected = true\n        atExplicitKey = true\n        allowCompact = true\n      } else if (atExplicitKey) {\n        // i.e. 0x3A/* : */ === character after the explicit key.\n        atExplicitKey = false\n        allowCompact = true\n      } else {\n        throwError(state, 'incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line')\n      }\n\n      state.position += 1\n      ch = following\n\n    //\n    // Implicit notation case. Flow-style node as the key first, then \":\", and the value.\n    //\n    } else {\n      _keyLine = state.line\n      _keyLineStart = state.lineStart\n      _keyPos = state.position\n\n      if (!composeNode(state, flowIndent, CONTEXT_FLOW_OUT, false, true)) {\n        // Neither implicit nor explicit notation.\n        // Reading is done. Go to the epilogue.\n        break\n      }\n\n      if (state.line === _line) {\n        ch = state.input.charCodeAt(state.position)\n\n        while (isWhiteSpace(ch)) {\n          ch = state.input.charCodeAt(++state.position)\n        }\n\n        if (ch === 0x3A/* : */) {\n          ch = state.input.charCodeAt(++state.position)\n\n          if (!isWsOrEol(ch)) {\n            throwError(state, 'a whitespace character is expected after the key-value separator within a block mapping')\n          }\n\n          if (atExplicitKey) {\n            storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos)\n            keyTag = keyNode = valueNode = null\n          }\n\n          detected = true\n          atExplicitKey = false\n          allowCompact = false\n          keyTag = state.tag\n          keyNode = state.result\n        } else if (detected) {\n          throwError(state, 'can not read an implicit mapping pair; a colon is missed')\n        } else {\n          state.tag = _tag\n          state.anchor = _anchor\n          return true // Keep the result of `composeNode`.\n        }\n      } else if (detected) {\n        throwError(state, 'can not read a block mapping entry; a multiline key may not be an implicit key')\n      } else {\n        state.tag = _tag\n        state.anchor = _anchor\n        return true // Keep the result of `composeNode`.\n      }\n    }\n\n    //\n    // Common reading code for both explicit and implicit notations.\n    //\n    if (state.line === _line || state.lineIndent > nodeIndent) {\n      if (atExplicitKey) {\n        _keyLine = state.line\n        _keyLineStart = state.lineStart\n        _keyPos = state.position\n      }\n\n      if (composeNode(state, nodeIndent, CONTEXT_BLOCK_OUT, true, allowCompact)) {\n        if (atExplicitKey) {\n          keyNode = state.result\n        } else {\n          valueNode = state.result\n        }\n      }\n\n      if (!atExplicitKey) {\n        storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _keyLine, _keyLineStart, _keyPos)\n        keyTag = keyNode = valueNode = null\n      }\n\n      skipSeparationSpace(state, true, -1)\n      ch = state.input.charCodeAt(state.position)\n    }\n\n    if ((state.line === _line || state.lineIndent > nodeIndent) && (ch !== 0)) {\n      throwError(state, 'bad indentation of a mapping entry')\n    } else if (state.lineIndent < nodeIndent) {\n      break\n    }\n  }\n\n  //\n  // Epilogue.\n  //\n\n  // Special case: last mapping's node contains only the key in explicit notation.\n  if (atExplicitKey) {\n    storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos)\n  }\n\n  // Expose the resulting mapping.\n  if (detected) {\n    state.tag = _tag\n    state.anchor = _anchor\n    state.kind = 'mapping'\n    state.result = _result\n  }\n\n  return detected\n}\n\nfunction readTagProperty (state) {\n  let isVerbatim = false\n  let isNamed = false\n  let tagHandle\n  let tagName\n\n  let ch = state.input.charCodeAt(state.position)\n\n  if (ch !== 0x21/* ! */) return false\n\n  if (state.tag !== null) {\n    throwError(state, 'duplication of a tag property')\n  }\n\n  ch = state.input.charCodeAt(++state.position)\n\n  if (ch === 0x3C/* < */) {\n    isVerbatim = true\n    ch = state.input.charCodeAt(++state.position)\n  } else if (ch === 0x21/* ! */) {\n    isNamed = true\n    tagHandle = '!!'\n    ch = state.input.charCodeAt(++state.position)\n  } else {\n    tagHandle = '!'\n  }\n\n  let _position = state.position\n\n  if (isVerbatim) {\n    do { ch = state.input.charCodeAt(++state.position) }\n    while (ch !== 0 && ch !== 0x3E/* > */)\n\n    if (state.position < state.length) {\n      tagName = state.input.slice(_position, state.position)\n      ch = state.input.charCodeAt(++state.position)\n    } else {\n      throwError(state, 'unexpected end of the stream within a verbatim tag')\n    }\n  } else {\n    while (ch !== 0 && !isWsOrEol(ch)) {\n      if (ch === 0x21/* ! */) {\n        if (!isNamed) {\n          tagHandle = state.input.slice(_position - 1, state.position + 1)\n\n          if (!PATTERN_TAG_HANDLE.test(tagHandle)) {\n            throwError(state, 'named tag handle cannot contain such characters')\n          }\n\n          isNamed = true\n          _position = state.position + 1\n        } else {\n          throwError(state, 'tag suffix cannot contain exclamation marks')\n        }\n      }\n\n      ch = state.input.charCodeAt(++state.position)\n    }\n\n    tagName = state.input.slice(_position, state.position)\n\n    if (PATTERN_FLOW_INDICATORS.test(tagName)) {\n      throwError(state, 'tag suffix cannot contain flow indicator characters')\n    }\n  }\n\n  if (tagName && !PATTERN_TAG_URI.test(tagName)) {\n    throwError(state, 'tag name cannot contain such characters: ' + tagName)\n  }\n\n  try {\n    tagName = decodeURIComponent(tagName)\n  } catch (err) {\n    throwError(state, 'tag name is malformed: ' + tagName)\n  }\n\n  if (isVerbatim) {\n    state.tag = tagName\n  } else if (_hasOwnProperty.call(state.tagMap, tagHandle)) {\n    state.tag = state.tagMap[tagHandle] + tagName\n  } else if (tagHandle === '!') {\n    state.tag = '!' + tagName\n  } else if (tagHandle === '!!') {\n    state.tag = 'tag:yaml.org,2002:' + tagName\n  } else {\n    throwError(state, 'undeclared tag handle \"' + tagHandle + '\"')\n  }\n\n  return true\n}\n\nfunction readAnchorProperty (state) {\n  let ch = state.input.charCodeAt(state.position)\n\n  if (ch !== 0x26/* & */) return false\n\n  if (state.anchor !== null) {\n    throwError(state, 'duplication of an anchor property')\n  }\n\n  ch = state.input.charCodeAt(++state.position)\n  const _position = state.position\n\n  while (ch !== 0 && !isWsOrEol(ch) && !isFlowIndicator(ch)) {\n    ch = state.input.charCodeAt(++state.position)\n  }\n\n  if (state.position === _position) {\n    throwError(state, 'name of an anchor node must contain at least one character')\n  }\n\n  state.anchor = state.input.slice(_position, state.position)\n  return true\n}\n\nfunction readAlias (state) {\n  let ch = state.input.charCodeAt(state.position)\n\n  if (ch !== 0x2A/* * */) return false\n\n  ch = state.input.charCodeAt(++state.position)\n  const _position = state.position\n\n  while (ch !== 0 && !isWsOrEol(ch) && !isFlowIndicator(ch)) {\n    ch = state.input.charCodeAt(++state.position)\n  }\n\n  if (state.position === _position) {\n    throwError(state, 'name of an alias node must contain at least one character')\n  }\n\n  const alias = state.input.slice(_position, state.position)\n\n  if (!_hasOwnProperty.call(state.anchorMap, alias)) {\n    throwError(state, 'unidentified alias \"' + alias + '\"')\n  }\n\n  state.result = state.anchorMap[alias]\n  skipSeparationSpace(state, true, -1)\n  return true\n}\n\nfunction tryReadBlockMappingFromProperty (state, propertyStart, nodeIndent, flowIndent) {\n  const fallbackState = snapshotState(state)\n\n  beginAnchorTransaction(state)\n  restoreState(state, propertyStart)\n\n  // Re-read the leading properties as part of the first implicit key, not as\n  // properties of the current node.\n  state.tag = null\n  state.anchor = null\n  state.kind = null\n  state.result = null\n\n  if (readBlockMapping(state, nodeIndent, flowIndent) && state.kind === 'mapping') {\n    commitAnchorTransaction(state)\n    return true\n  }\n\n  rollbackAnchorTransaction(state)\n  restoreState(state, fallbackState)\n  return false\n}\n\nfunction composeNode (state, parentIndent, nodeContext, allowToSeek, allowCompact) {\n  let allowBlockScalars\n  let allowBlockCollections\n  let indentStatus = 1 // 1: this>parent, 0: this=parent, -1: this<parent\n  let atNewLine = false\n  let hasContent = false\n  let propertyStart = null\n  let type\n  let flowIndent\n  let blockIndent\n\n  if (state.depth >= state.maxDepth) {\n    throwError(state, 'nesting exceeded maxDepth (' + state.maxDepth + ')')\n  }\n\n  state.depth += 1\n\n  if (state.listener !== null) {\n    state.listener('open', state)\n  }\n\n  state.tag = null\n  state.anchor = null\n  state.kind = null\n  state.result = null\n\n  const allowBlockStyles = allowBlockScalars = allowBlockCollections =\n    CONTEXT_BLOCK_OUT === nodeContext ||\n    CONTEXT_BLOCK_IN === nodeContext\n\n  if (allowToSeek) {\n    if (skipSeparationSpace(state, true, -1)) {\n      atNewLine = true\n\n      if (state.lineIndent > parentIndent) {\n        indentStatus = 1\n      } else if (state.lineIndent === parentIndent) {\n        indentStatus = 0\n      } else if (state.lineIndent < parentIndent) {\n        indentStatus = -1\n      }\n    }\n  }\n\n  if (indentStatus === 1) {\n    while (true) {\n      const ch = state.input.charCodeAt(state.position)\n      const propertyState = snapshotState(state)\n\n      // A duplicate property token after a line break can be the first key of\n      // a nested block mapping, e.g. `!!map\\n  !!str key: value`.\n      if (atNewLine &&\n          ((ch === 0x21/* ! */ && state.tag !== null) ||\n           (ch === 0x26/* & */ && state.anchor !== null))) {\n        break\n      }\n\n      if (!readTagProperty(state) && !readAnchorProperty(state)) {\n        break\n      }\n\n      if (propertyStart === null) {\n        propertyStart = propertyState\n      }\n\n      if (skipSeparationSpace(state, true, -1)) {\n        atNewLine = true\n        allowBlockCollections = allowBlockStyles\n\n        if (state.lineIndent > parentIndent) {\n          indentStatus = 1\n        } else if (state.lineIndent === parentIndent) {\n          indentStatus = 0\n        } else if (state.lineIndent < parentIndent) {\n          indentStatus = -1\n        }\n      } else {\n        allowBlockCollections = false\n      }\n    }\n  }\n\n  if (allowBlockCollections) {\n    allowBlockCollections = atNewLine || allowCompact\n  }\n\n  if (indentStatus === 1 || CONTEXT_BLOCK_OUT === nodeContext) {\n    if (CONTEXT_FLOW_IN === nodeContext || CONTEXT_FLOW_OUT === nodeContext) {\n      flowIndent = parentIndent\n    } else {\n      flowIndent = parentIndent + 1\n    }\n\n    blockIndent = state.position - state.lineStart\n\n    if (indentStatus === 1) {\n      if ((allowBlockCollections &&\n          (readBlockSequence(state, blockIndent) || readBlockMapping(state, blockIndent, flowIndent))) ||\n          readFlowCollection(state, flowIndent)) {\n        hasContent = true\n      } else {\n        const ch = state.input.charCodeAt(state.position)\n\n        if (propertyStart !== null && allowBlockStyles && !allowBlockCollections &&\n            ch !== 0x7C/* | */ && ch !== 0x3E/* > */ &&\n            tryReadBlockMappingFromProperty(\n              state,\n              propertyStart,\n              propertyStart.position - propertyStart.lineStart,\n              flowIndent\n            )) {\n          hasContent = true\n        } else if ((allowBlockScalars && readBlockScalar(state, flowIndent)) ||\n            readSingleQuotedScalar(state, flowIndent) ||\n            readDoubleQuotedScalar(state, flowIndent)) {\n          hasContent = true\n        } else if (readAlias(state)) {\n          hasContent = true\n\n          if (state.tag !== null || state.anchor !== null) {\n            throwError(state, 'alias node should not have any properties')\n          }\n        } else if (readPlainScalar(state, flowIndent, CONTEXT_FLOW_IN === nodeContext)) {\n          hasContent = true\n\n          if (state.tag === null) {\n            state.tag = '?'\n          }\n        }\n\n        if (state.anchor !== null) {\n          storeAnchor(state, state.anchor, state.result)\n        }\n      }\n    } else if (indentStatus === 0) {\n      // Special case: block sequences are allowed to have same indentation level as the parent.\n      // http://www.yaml.org/spec/1.2/spec.html#id2799784\n      hasContent = allowBlockCollections && readBlockSequence(state, blockIndent)\n    }\n  }\n\n  if (state.tag === null) {\n    if (state.anchor !== null) {\n      storeAnchor(state, state.anchor, state.result)\n    }\n  } else if (state.tag === '?') {\n    // Implicit resolving is not allowed for non-scalar types, and '?'\n    // non-specific tag is only automatically assigned to plain scalars.\n    //\n    // We only need to check kind conformity in case user explicitly assigns '?'\n    // tag, for example like this: \"!<?> [0]\"\n    //\n    if (state.result !== null && state.kind !== 'scalar') {\n      throwError(state, 'unacceptable node kind for !<?> tag; it should be \"scalar\", not \"' + state.kind + '\"')\n    }\n\n    for (let typeIndex = 0, typeQuantity = state.implicitTypes.length; typeIndex < typeQuantity; typeIndex += 1) {\n      type = state.implicitTypes[typeIndex]\n\n      if (type.resolve(state.result)) { // `state.result` updated in resolver if matched\n        state.result = type.construct(state.result)\n        state.tag = type.tag\n        if (state.anchor !== null) {\n          storeAnchor(state, state.anchor, state.result)\n        }\n        break\n      }\n    }\n  } else if (state.tag !== '!') {\n    if (_hasOwnProperty.call(state.typeMap[state.kind || 'fallback'], state.tag)) {\n      type = state.typeMap[state.kind || 'fallback'][state.tag]\n    } else {\n      // looking for multi type\n      type = null\n      const typeList = state.typeMap.multi[state.kind || 'fallback']\n\n      for (let typeIndex = 0, typeQuantity = typeList.length; typeIndex < typeQuantity; typeIndex += 1) {\n        if (state.tag.slice(0, typeList[typeIndex].tag.length) === typeList[typeIndex].tag) {\n          type = typeList[typeIndex]\n          break\n        }\n      }\n    }\n\n    if (!type) {\n      throwError(state, 'unknown tag !<' + state.tag + '>')\n    }\n\n    if (state.result !== null && type.kind !== state.kind) {\n      throwError(state, 'unacceptable node kind for !<' + state.tag + '> tag; it should be \"' + type.kind + '\", not \"' + state.kind + '\"')\n    }\n\n    if (!type.resolve(state.result, state.tag)) { // `state.result` updated in resolver if matched\n      throwError(state, 'cannot resolve a node with !<' + state.tag + '> explicit tag')\n    } else {\n      state.result = type.construct(state.result, state.tag)\n      if (state.anchor !== null) {\n        storeAnchor(state, state.anchor, state.result)\n      }\n    }\n  }\n\n  if (state.listener !== null) {\n    state.listener('close', state)\n  }\n\n  state.depth -= 1\n  return state.tag !== null || state.anchor !== null || hasContent\n}\n\nfunction readDocument (state) {\n  const documentStart = state.position\n  let hasDirectives = false\n  let ch\n\n  state.version = null\n  state.checkLineBreaks = state.legacy\n  state.tagMap = Object.create(null)\n  state.anchorMap = Object.create(null)\n\n  while ((ch = state.input.charCodeAt(state.position)) !== 0) {\n    skipSeparationSpace(state, true, -1)\n\n    ch = state.input.charCodeAt(state.position)\n\n    if (state.lineIndent > 0 || ch !== 0x25/* % */) {\n      break\n    }\n\n    hasDirectives = true\n    ch = state.input.charCodeAt(++state.position)\n    let _position = state.position\n\n    while (ch !== 0 && !isWsOrEol(ch)) {\n      ch = state.input.charCodeAt(++state.position)\n    }\n\n    const directiveName = state.input.slice(_position, state.position)\n    const directiveArgs = []\n\n    if (directiveName.length < 1) {\n      throwError(state, 'directive name must not be less than one character in length')\n    }\n\n    while (ch !== 0) {\n      while (isWhiteSpace(ch)) {\n        ch = state.input.charCodeAt(++state.position)\n      }\n\n      if (ch === 0x23/* # */) {\n        do { ch = state.input.charCodeAt(++state.position) }\n        while (ch !== 0 && !isEol(ch))\n        break\n      }\n\n      if (isEol(ch)) break\n\n      _position = state.position\n\n      while (ch !== 0 && !isWsOrEol(ch)) {\n        ch = state.input.charCodeAt(++state.position)\n      }\n\n      directiveArgs.push(state.input.slice(_position, state.position))\n    }\n\n    if (ch !== 0) readLineBreak(state)\n\n    if (_hasOwnProperty.call(directiveHandlers, directiveName)) {\n      directiveHandlers[directiveName](state, directiveName, directiveArgs)\n    } else {\n      throwWarning(state, 'unknown document directive \"' + directiveName + '\"')\n    }\n  }\n\n  skipSeparationSpace(state, true, -1)\n\n  if (state.lineIndent === 0 &&\n      state.input.charCodeAt(state.position) === 0x2D/* - */ &&\n      state.input.charCodeAt(state.position + 1) === 0x2D/* - */ &&\n      state.input.charCodeAt(state.position + 2) === 0x2D/* - */) {\n    state.position += 3\n    skipSeparationSpace(state, true, -1)\n  } else if (hasDirectives) {\n    throwError(state, 'directives end mark is expected')\n  }\n\n  composeNode(state, state.lineIndent - 1, CONTEXT_BLOCK_OUT, false, true)\n  skipSeparationSpace(state, true, -1)\n\n  if (state.checkLineBreaks &&\n      PATTERN_NON_ASCII_LINE_BREAKS.test(state.input.slice(documentStart, state.position))) {\n    throwWarning(state, 'non-ASCII line breaks are interpreted as content')\n  }\n\n  state.documents.push(state.result)\n\n  if (state.position === state.lineStart && testDocumentSeparator(state)) {\n    if (state.input.charCodeAt(state.position) === 0x2E/* . */) {\n      state.position += 3\n      skipSeparationSpace(state, true, -1)\n    }\n    return\n  }\n\n  if (state.position < (state.length - 1)) {\n    throwError(state, 'end of the stream or a document separator is expected')\n  }\n}\n\nfunction loadDocuments (input, options) {\n  input = String(input)\n  options = options || {}\n\n  if (input.length !== 0) {\n    // Add tailing `\\n` if not exists\n    if (input.charCodeAt(input.length - 1) !== 0x0A/* LF */ &&\n        input.charCodeAt(input.length - 1) !== 0x0D/* CR */) {\n      input += '\\n'\n    }\n\n    // Strip BOM\n    if (input.charCodeAt(0) === 0xFEFF) {\n      input = input.slice(1)\n    }\n  }\n\n  const state = new State(input, options)\n\n  const nullpos = input.indexOf('\\0')\n\n  if (nullpos !== -1) {\n    state.position = nullpos\n    throwError(state, 'null byte is not allowed in input')\n  }\n\n  // Use 0 as string terminator. That significantly simplifies bounds check.\n  state.input += '\\0'\n\n  while (state.input.charCodeAt(state.position) === 0x20/* Space */) {\n    state.lineIndent += 1\n    state.position += 1\n  }\n\n  while (state.position < (state.length - 1)) {\n    readDocument(state)\n  }\n\n  return state.documents\n}\n\nfunction loadAll (input, iterator, options) {\n  if (iterator !== null && typeof iterator === 'object' && typeof options === 'undefined') {\n    options = iterator\n    iterator = null\n  }\n\n  const documents = loadDocuments(input, options)\n\n  if (typeof iterator !== 'function') {\n    return documents\n  }\n\n  for (let index = 0, length = documents.length; index < length; index += 1) {\n    iterator(documents[index])\n  }\n}\n\nfunction load (input, options) {\n  const documents = loadDocuments(input, options)\n\n  if (documents.length === 0) {\n    return undefined\n  } else if (documents.length === 1) {\n    return documents[0]\n  }\n  throw new YAMLException('expected a single document in the stream, but found more')\n}\n\nmodule.exports.loadAll = loadAll\nmodule.exports.load = load\n","'use strict'\n\nconst common = require('./common')\nconst YAMLException = require('./exception')\nconst DEFAULT_SCHEMA = require('./schema/default')\n\nconst _toString = Object.prototype.toString\nconst _hasOwnProperty = Object.prototype.hasOwnProperty\n\nconst CHAR_BOM = 0xFEFF\nconst CHAR_TAB = 0x09 /* Tab */\nconst CHAR_LINE_FEED = 0x0A /* LF */\nconst CHAR_CARRIAGE_RETURN = 0x0D /* CR */\nconst CHAR_SPACE = 0x20 /* Space */\nconst CHAR_EXCLAMATION = 0x21 /* ! */\nconst CHAR_DOUBLE_QUOTE = 0x22 /* \" */\nconst CHAR_SHARP = 0x23 /* # */\nconst CHAR_PERCENT = 0x25 /* % */\nconst CHAR_AMPERSAND = 0x26 /* & */\nconst CHAR_SINGLE_QUOTE = 0x27 /* ' */\nconst CHAR_ASTERISK = 0x2A /* * */\nconst CHAR_COMMA = 0x2C /* , */\nconst CHAR_MINUS = 0x2D /* - */\nconst CHAR_COLON = 0x3A /* : */\nconst CHAR_EQUALS = 0x3D /* = */\nconst CHAR_GREATER_THAN = 0x3E /* > */\nconst CHAR_QUESTION = 0x3F /* ? */\nconst CHAR_COMMERCIAL_AT = 0x40 /* @ */\nconst CHAR_LEFT_SQUARE_BRACKET = 0x5B /* [ */\nconst CHAR_RIGHT_SQUARE_BRACKET = 0x5D /* ] */\nconst CHAR_GRAVE_ACCENT = 0x60 /* ` */\nconst CHAR_LEFT_CURLY_BRACKET = 0x7B /* { */\nconst CHAR_VERTICAL_LINE = 0x7C /* | */\nconst CHAR_RIGHT_CURLY_BRACKET = 0x7D /* } */\n\nconst ESCAPE_SEQUENCES = {}\n\nESCAPE_SEQUENCES[0x00] = '\\\\0'\nESCAPE_SEQUENCES[0x07] = '\\\\a'\nESCAPE_SEQUENCES[0x08] = '\\\\b'\nESCAPE_SEQUENCES[0x09] = '\\\\t'\nESCAPE_SEQUENCES[0x0A] = '\\\\n'\nESCAPE_SEQUENCES[0x0B] = '\\\\v'\nESCAPE_SEQUENCES[0x0C] = '\\\\f'\nESCAPE_SEQUENCES[0x0D] = '\\\\r'\nESCAPE_SEQUENCES[0x1B] = '\\\\e'\nESCAPE_SEQUENCES[0x22] = '\\\\\"'\nESCAPE_SEQUENCES[0x5C] = '\\\\\\\\'\nESCAPE_SEQUENCES[0x85] = '\\\\N'\nESCAPE_SEQUENCES[0xA0] = '\\\\_'\nESCAPE_SEQUENCES[0x2028] = '\\\\L'\nESCAPE_SEQUENCES[0x2029] = '\\\\P'\n\nconst DEPRECATED_BOOLEANS_SYNTAX = [\n  'y', 'Y', 'yes', 'Yes', 'YES', 'on', 'On', 'ON',\n  'n', 'N', 'no', 'No', 'NO', 'off', 'Off', 'OFF'\n]\n\nconst DEPRECATED_BASE60_SYNTAX = /^[-+]?[0-9_]+(?::[0-9_]+)+(?:\\.[0-9_]*)?$/\n\nfunction compileStyleMap (schema, map) {\n  if (map === null) return {}\n\n  const result = {}\n  const keys = Object.keys(map)\n\n  for (let index = 0, length = keys.length; index < length; index += 1) {\n    let tag = keys[index]\n    let style = String(map[tag])\n\n    if (tag.slice(0, 2) === '!!') {\n      tag = 'tag:yaml.org,2002:' + tag.slice(2)\n    }\n    const type = schema.compiledTypeMap['fallback'][tag]\n\n    if (type && _hasOwnProperty.call(type.styleAliases, style)) {\n      style = type.styleAliases[style]\n    }\n\n    result[tag] = style\n  }\n\n  return result\n}\n\nfunction encodeHex (character) {\n  let handle\n  let length\n\n  const string = character.toString(16).toUpperCase()\n\n  if (character <= 0xFF) {\n    handle = 'x'\n    length = 2\n  } else if (character <= 0xFFFF) {\n    handle = 'u'\n    length = 4\n  } else if (character <= 0xFFFFFFFF) {\n    handle = 'U'\n    length = 8\n  } else {\n    throw new YAMLException('code point within a string may not be greater than 0xFFFFFFFF')\n  }\n\n  return '\\\\' + handle + common.repeat('0', length - string.length) + string\n}\n\nconst QUOTING_TYPE_SINGLE = 1\nconst QUOTING_TYPE_DOUBLE = 2\n\nfunction State (options) {\n  this.schema = options['schema'] || DEFAULT_SCHEMA\n  this.indent = Math.max(1, (options['indent'] || 2))\n  this.noArrayIndent = options['noArrayIndent'] || false\n  this.skipInvalid = options['skipInvalid'] || false\n  this.flowLevel = (common.isNothing(options['flowLevel']) ? -1 : options['flowLevel'])\n  this.styleMap = compileStyleMap(this.schema, options['styles'] || null)\n  this.sortKeys = options['sortKeys'] || false\n  this.lineWidth = options['lineWidth'] || 80\n  this.noRefs = options['noRefs'] || false\n  this.noCompatMode = options['noCompatMode'] || false\n  this.condenseFlow = options['condenseFlow'] || false\n  this.quotingType = options['quotingType'] === '\"' ? QUOTING_TYPE_DOUBLE : QUOTING_TYPE_SINGLE\n  this.forceQuotes = options['forceQuotes'] || false\n  this.replacer = typeof options['replacer'] === 'function' ? options['replacer'] : null\n\n  this.implicitTypes = this.schema.compiledImplicit\n  this.explicitTypes = this.schema.compiledExplicit\n\n  this.tag = null\n  this.result = ''\n\n  this.duplicates = []\n  this.usedDuplicates = null\n}\n\n// Indents every line in a string. Empty lines (\\n only) are not indented.\nfunction indentString (string, spaces) {\n  const ind = common.repeat(' ', spaces)\n  let position = 0\n  let result = ''\n  const length = string.length\n\n  while (position < length) {\n    let line\n    const next = string.indexOf('\\n', position)\n    if (next === -1) {\n      line = string.slice(position)\n      position = length\n    } else {\n      line = string.slice(position, next + 1)\n      position = next + 1\n    }\n\n    if (line.length && line !== '\\n') result += ind\n\n    result += line\n  }\n\n  return result\n}\n\nfunction generateNextLine (state, level) {\n  return '\\n' + common.repeat(' ', state.indent * level)\n}\n\nfunction testImplicitResolving (state, str) {\n  for (let index = 0, length = state.implicitTypes.length; index < length; index += 1) {\n    const type = state.implicitTypes[index]\n\n    if (type.resolve(str)) {\n      return true\n    }\n  }\n\n  return false\n}\n\n// [33] s-white ::= s-space | s-tab\nfunction isWhitespace (c) {\n  return c === CHAR_SPACE || c === CHAR_TAB\n}\n\n// Returns true if the character can be printed without escaping.\n// From YAML 1.2: \"any allowed characters known to be non-printable\n// should also be escaped. [However,] This isnâ€™t mandatory\"\n// Derived from nb-char - \\t - #x85 - #xA0 - #x2028 - #x2029.\nfunction isPrintable (c) {\n  return (c >= 0x00020 && c <= 0x00007E) ||\n    ((c >= 0x000A1 && c <= 0x00D7FF) && c !== 0x2028 && c !== 0x2029) ||\n    ((c >= 0x0E000 && c <= 0x00FFFD) && c !== CHAR_BOM) ||\n    (c >= 0x10000 && c <= 0x10FFFF)\n}\n\n// [34] ns-char ::= nb-char - s-white\n// [27] nb-char ::= c-printable - b-char - c-byte-order-mark\n// [26] b-char  ::= b-line-feed | b-carriage-return\n// Including s-white (for some reason, examples doesn't match specs in this aspect)\n// ns-char ::= c-printable - b-line-feed - b-carriage-return - c-byte-order-mark\nfunction isNsCharOrWhitespace (c) {\n  return isPrintable(c) &&\n    c !== CHAR_BOM &&\n    // - b-char\n    c !== CHAR_CARRIAGE_RETURN &&\n    c !== CHAR_LINE_FEED\n}\n\n// [127]  ns-plain-safe(c) ::= c = flow-out  â‡’ ns-plain-safe-out\n//                             c = flow-in   â‡’ ns-plain-safe-in\n//                             c = block-key â‡’ ns-plain-safe-out\n//                             c = flow-key  â‡’ ns-plain-safe-in\n// [128] ns-plain-safe-out ::= ns-char\n// [129]  ns-plain-safe-in ::= ns-char - c-flow-indicator\n// [130]  ns-plain-char(c) ::=  ( ns-plain-safe(c) - â€œ:â€� - â€œ#â€� )\n//                            | ( /* An ns-char preceding */ â€œ#â€� )\n//                            | ( â€œ:â€� /* Followed by an ns-plain-safe(c) */ )\nfunction isPlainSafe (c, prev, inblock) {\n  const cIsNsCharOrWhitespace = isNsCharOrWhitespace(c)\n  const cIsNsChar = cIsNsCharOrWhitespace && !isWhitespace(c)\n  return (\n    (\n      // ns-plain-safe\n      inblock // c = flow-in\n        ? cIsNsCharOrWhitespace\n        : cIsNsCharOrWhitespace &&\n          // - c-flow-indicator\n          c !== CHAR_COMMA &&\n          c !== CHAR_LEFT_SQUARE_BRACKET &&\n          c !== CHAR_RIGHT_SQUARE_BRACKET &&\n          c !== CHAR_LEFT_CURLY_BRACKET &&\n          c !== CHAR_RIGHT_CURLY_BRACKET\n    ) &&\n    // ns-plain-char\n    c !== CHAR_SHARP && // false on '#'\n    !(prev === CHAR_COLON && !cIsNsChar)\n  ) || // false on ': '\n  (isNsCharOrWhitespace(prev) && !isWhitespace(prev) && c === CHAR_SHARP) || // change to true on '[^ ]#'\n  (prev === CHAR_COLON && cIsNsChar) // change to true on ':[^ ]'\n}\n\n// Simplified test for values allowed as the first character in plain style.\nfunction isPlainSafeFirst (c) {\n  // Uses a subset of ns-char - c-indicator\n  // where ns-char = nb-char - s-white.\n  // No support of ( ( â€œ?â€� | â€œ:â€� | â€œ-â€� ) /* Followed by an ns-plain-safe(c)) */ ) part\n  return isPrintable(c) &&\n    c !== CHAR_BOM &&\n    !isWhitespace(c) && // - s-white\n    // - (c-indicator ::=\n    // â€œ-â€� | â€œ?â€� | â€œ:â€� | â€œ,â€� | â€œ[â€� | â€œ]â€� | â€œ{â€� | â€œ}â€�\n    c !== CHAR_MINUS &&\n    c !== CHAR_QUESTION &&\n    c !== CHAR_COLON &&\n    c !== CHAR_COMMA &&\n    c !== CHAR_LEFT_SQUARE_BRACKET &&\n    c !== CHAR_RIGHT_SQUARE_BRACKET &&\n    c !== CHAR_LEFT_CURLY_BRACKET &&\n    c !== CHAR_RIGHT_CURLY_BRACKET &&\n    // | â€œ#â€� | â€œ&â€� | â€œ*â€� | â€œ!â€� | â€œ|â€� | â€œ=â€� | â€œ>â€� | â€œ'â€� | â€œ\"â€�\n    c !== CHAR_SHARP &&\n    c !== CHAR_AMPERSAND &&\n    c !== CHAR_ASTERISK &&\n    c !== CHAR_EXCLAMATION &&\n    c !== CHAR_VERTICAL_LINE &&\n    c !== CHAR_EQUALS &&\n    c !== CHAR_GREATER_THAN &&\n    c !== CHAR_SINGLE_QUOTE &&\n    c !== CHAR_DOUBLE_QUOTE &&\n    // | â€œ%â€� | â€œ@â€� | â€œ`â€�)\n    c !== CHAR_PERCENT &&\n    c !== CHAR_COMMERCIAL_AT &&\n    c !== CHAR_GRAVE_ACCENT\n}\n\n// Simplified test for values allowed as the last character in plain style.\nfunction isPlainSafeLast (c) {\n  // just not whitespace or colon, it will be checked to be plain character later\n  return !isWhitespace(c) && c !== CHAR_COLON\n}\n\n// Same as 'string'.codePointAt(pos), but works in older browsers.\nfunction codePointAt (string, pos) {\n  const first = string.charCodeAt(pos)\n  let second\n\n  if (first >= 0xD800 && first <= 0xDBFF && pos + 1 < string.length) {\n    second = string.charCodeAt(pos + 1)\n    if (second >= 0xDC00 && second <= 0xDFFF) {\n      // https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae\n      return (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000\n    }\n  }\n  return first\n}\n\n// Determines whether block indentation indicator is required.\nfunction needIndentIndicator (string) {\n  const leadingSpaceRe = /^\\n* /\n  return leadingSpaceRe.test(string)\n}\n\nconst STYLE_PLAIN = 1\nconst STYLE_SINGLE = 2\nconst STYLE_LITERAL = 3\nconst STYLE_FOLDED = 4\nconst STYLE_DOUBLE = 5\n\n// Determines which scalar styles are possible and returns the preferred style.\n// lineWidth = -1 => no limit.\n// Pre-conditions: str.length > 0.\n// Post-conditions:\n//    STYLE_PLAIN or STYLE_SINGLE => no \\n are in the string.\n//    STYLE_LITERAL => no lines are suitable for folding (or lineWidth is -1).\n//    STYLE_FOLDED => a line > lineWidth and can be folded (and lineWidth != -1).\nfunction chooseScalarStyle (string, singleLineOnly, indentPerLevel, lineWidth,\n  testAmbiguousType, quotingType, forceQuotes, inblock) {\n  let i\n  let char = 0\n  let prevChar = null\n  let hasLineBreak = false\n  let hasFoldableLine = false // only checked if shouldTrackWidth\n  const shouldTrackWidth = lineWidth !== -1\n  let previousLineBreak = -1 // count the first line correctly\n  let plain = isPlainSafeFirst(codePointAt(string, 0)) &&\n    isPlainSafeLast(codePointAt(string, string.length - 1))\n\n  if (singleLineOnly || forceQuotes) {\n    // Case: no block styles.\n    // Check for disallowed characters to rule out plain and single.\n    for (i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++) {\n      char = codePointAt(string, i)\n      if (!isPrintable(char)) {\n        return STYLE_DOUBLE\n      }\n      plain = plain && isPlainSafe(char, prevChar, inblock)\n      prevChar = char\n    }\n  } else {\n    // Case: block styles permitted.\n    for (i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++) {\n      char = codePointAt(string, i)\n      if (char === CHAR_LINE_FEED) {\n        hasLineBreak = true\n        // Check if any line can be folded.\n        if (shouldTrackWidth) {\n          hasFoldableLine = hasFoldableLine ||\n            // Foldable line = too long, and not more-indented.\n            (i - previousLineBreak - 1 > lineWidth &&\n             string[previousLineBreak + 1] !== ' ')\n          previousLineBreak = i\n        }\n      } else if (!isPrintable(char)) {\n        return STYLE_DOUBLE\n      }\n      plain = plain && isPlainSafe(char, prevChar, inblock)\n      prevChar = char\n    }\n    // in case the end is missing a \\n\n    hasFoldableLine = hasFoldableLine || (shouldTrackWidth &&\n      (i - previousLineBreak - 1 > lineWidth &&\n       string[previousLineBreak + 1] !== ' '))\n  }\n  // Although every style can represent \\n without escaping, prefer block styles\n  // for multiline, since they're more readable and they don't add empty lines.\n  // Also prefer folding a super-long line.\n  if (!hasLineBreak && !hasFoldableLine) {\n    // Strings interpretable as another type have to be quoted;\n    // e.g. the string 'true' vs. the boolean true.\n    if (plain && !forceQuotes && !testAmbiguousType(string)) {\n      return STYLE_PLAIN\n    }\n    return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : STYLE_SINGLE\n  }\n  // Edge case: block indentation indicator can only have one digit.\n  if (indentPerLevel > 9 && needIndentIndicator(string)) {\n    return STYLE_DOUBLE\n  }\n  // At this point we know block styles are valid.\n  // Prefer literal style unless we want to fold.\n  if (!forceQuotes) {\n    return hasFoldableLine ? STYLE_FOLDED : STYLE_LITERAL\n  }\n  return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : STYLE_SINGLE\n}\n\n// Note: line breaking/folding is implemented for only the folded style.\n// NB. We drop the last trailing newline (if any) of a returned block scalar\n//  since the dumper adds its own newline. This always works:\n//    â€¢ No ending newline => unaffected; already using strip \"-\" chomping.\n//    â€¢ Ending newline    => removed then restored.\n//  Importantly, this keeps the \"+\" chomp indicator from gaining an extra line.\nfunction writeScalar (state, string, level, iskey, inblock) {\n  state.dump = (function () {\n    if (string.length === 0) {\n      return state.quotingType === QUOTING_TYPE_DOUBLE ? '\"\"' : \"''\"\n    }\n    if (!state.noCompatMode) {\n      if (DEPRECATED_BOOLEANS_SYNTAX.indexOf(string) !== -1 || DEPRECATED_BASE60_SYNTAX.test(string)) {\n        return state.quotingType === QUOTING_TYPE_DOUBLE ? ('\"' + string + '\"') : (\"'\" + string + \"'\")\n      }\n    }\n\n    const indent = state.indent * Math.max(1, level) // no 0-indent scalars\n    // As indentation gets deeper, let the width decrease monotonically\n    // to the lower bound min(state.lineWidth, 40).\n    // Note that this implies\n    //  state.lineWidth â‰¤ 40 + state.indent: width is fixed at the lower bound.\n    //  state.lineWidth > 40 + state.indent: width decreases until the lower bound.\n    // This behaves better than a constant minimum width which disallows narrower options,\n    // or an indent threshold which causes the width to suddenly increase.\n    const lineWidth = (state.lineWidth === -1)\n      ? -1\n      : Math.max(Math.min(state.lineWidth, 40), state.lineWidth - indent)\n\n    // Without knowing if keys are implicit/explicit, assume implicit for safety.\n    const singleLineOnly = iskey ||\n      // No block styles in flow mode.\n      (state.flowLevel > -1 && level >= state.flowLevel)\n    function testAmbiguity (string) {\n      return testImplicitResolving(state, string)\n    }\n\n    switch (chooseScalarStyle(string, singleLineOnly, state.indent, lineWidth,\n      testAmbiguity, state.quotingType, state.forceQuotes && !iskey, inblock)) {\n      case STYLE_PLAIN:\n        return string\n      case STYLE_SINGLE:\n        return \"'\" + string.replace(/'/g, \"''\") + \"'\"\n      case STYLE_LITERAL:\n        return '|' + blockHeader(string, state.indent) +\n          dropEndingNewline(indentString(string, indent))\n      case STYLE_FOLDED:\n        return '>' + blockHeader(string, state.indent) +\n          dropEndingNewline(indentString(foldString(string, lineWidth), indent))\n      case STYLE_DOUBLE:\n        return '\"' + escapeString(string, lineWidth) + '\"'\n      default:\n        throw new YAMLException('impossible error: invalid scalar style')\n    }\n  }())\n}\n\n// Pre-conditions: string is valid for a block scalar, 1 <= indentPerLevel <= 9.\nfunction blockHeader (string, indentPerLevel) {\n  const indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : ''\n\n  // note the special case: the string '\\n' counts as a \"trailing\" empty line.\n  const clip = string[string.length - 1] === '\\n'\n  const keep = clip && (string[string.length - 2] === '\\n' || string === '\\n')\n  const chomp = keep ? '+' : (clip ? '' : '-')\n\n  return indentIndicator + chomp + '\\n'\n}\n\n// (See the note for writeScalar.)\nfunction dropEndingNewline (string) {\n  return string[string.length - 1] === '\\n' ? string.slice(0, -1) : string\n}\n\n// Note: a long line without a suitable break point will exceed the width limit.\n// Pre-conditions: every char in str isPrintable, str.length > 0, width > 0.\nfunction foldString (string, width) {\n  // In folded style, $k$ consecutive newlines output as $k+1$ newlinesâ€”\n  // unless they're before or after a more-indented line, or at the very\n  // beginning or end, in which case $k$ maps to $k$.\n  // Therefore, parse each chunk as newline(s) followed by a content line.\n  const lineRe = /(\\n+)([^\\n]*)/g\n\n  // first line (possibly an empty line)\n  let result = (function () {\n    let nextLF = string.indexOf('\\n')\n    nextLF = nextLF !== -1 ? nextLF : string.length\n    lineRe.lastIndex = nextLF\n    return foldLine(string.slice(0, nextLF), width)\n  }())\n  // If we haven't reached the first content line yet, don't add an extra \\n.\n  let prevMoreIndented = string[0] === '\\n' || string[0] === ' '\n  let moreIndented\n\n  // rest of the lines\n  let match\n  while ((match = lineRe.exec(string))) {\n    const prefix = match[1]\n    const line = match[2]\n\n    moreIndented = (line[0] === ' ')\n    result += prefix +\n      ((!prevMoreIndented && !moreIndented && line !== '') ? '\\n' : '') +\n      foldLine(line, width)\n    prevMoreIndented = moreIndented\n  }\n\n  return result\n}\n\n// Greedy line breaking.\n// Picks the longest line under the limit each time,\n// otherwise settles for the shortest line over the limit.\n// NB. More-indented lines *cannot* be folded, as that would add an extra \\n.\nfunction foldLine (line, width) {\n  if (line === '' || line[0] === ' ') return line\n\n  // Since a more-indented line adds a \\n, breaks can't be followed by a space.\n  const breakRe = / [^ ]/g // note: the match index will always be <= length-2.\n  let match\n  // start is an inclusive index. end, curr, and next are exclusive.\n  let start = 0\n  let end\n  let curr = 0\n  let next = 0\n  let result = ''\n\n  // Invariants: 0 <= start <= length-1.\n  //   0 <= curr <= next <= max(0, length-2). curr - start <= width.\n  // Inside the loop:\n  //   A match implies length >= 2, so curr and next are <= length-2.\n  while ((match = breakRe.exec(line))) {\n    next = match.index\n    // maintain invariant: curr - start <= width\n    if (next - start > width) {\n      end = (curr > start) ? curr : next // derive end <= length-2\n      result += '\\n' + line.slice(start, end)\n      // skip the space that was output as \\n\n      start = end + 1                    // derive start <= length-1\n    }\n    curr = next\n  }\n\n  // By the invariants, start <= length-1, so there is something left over.\n  // It is either the whole string or a part starting from non-whitespace.\n  result += '\\n'\n  // Insert a break if the remainder is too long and there is a break available.\n  if (line.length - start > width && curr > start) {\n    result += line.slice(start, curr) + '\\n' + line.slice(curr + 1)\n  } else {\n    result += line.slice(start)\n  }\n\n  return result.slice(1) // drop extra \\n joiner\n}\n\n// Escapes a double-quoted string.\nfunction escapeString (string) {\n  let result = ''\n  let char = 0\n\n  for (let i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++) {\n    char = codePointAt(string, i)\n    const escapeSeq = ESCAPE_SEQUENCES[char]\n\n    if (!escapeSeq && isPrintable(char)) {\n      result += string[i]\n      if (char >= 0x10000) result += string[i + 1]\n    } else {\n      result += escapeSeq || encodeHex(char)\n    }\n  }\n\n  return result\n}\n\nfunction writeFlowSequence (state, level, object) {\n  let _result = ''\n  const _tag = state.tag\n\n  for (let index = 0, length = object.length; index < length; index += 1) {\n    let value = object[index]\n\n    if (state.replacer) {\n      value = state.replacer.call(object, String(index), value)\n    }\n\n    // Write only valid elements, put null instead of invalid elements.\n    if (writeNode(state, level, value, false, false) ||\n        (typeof value === 'undefined' &&\n         writeNode(state, level, null, false, false))) {\n      if (_result !== '') _result += ',' + (!state.condenseFlow ? ' ' : '')\n      _result += state.dump\n    }\n  }\n\n  state.tag = _tag\n  state.dump = '[' + _result + ']'\n}\n\nfunction writeBlockSequence (state, level, object, compact) {\n  let _result = ''\n  const _tag = state.tag\n\n  for (let index = 0, length = object.length; index < length; index += 1) {\n    let value = object[index]\n\n    if (state.replacer) {\n      value = state.replacer.call(object, String(index), value)\n    }\n\n    // Write only valid elements, put null instead of invalid elements.\n    if (writeNode(state, level + 1, value, true, true, false, true) ||\n        (typeof value === 'undefined' &&\n         writeNode(state, level + 1, null, true, true, false, true))) {\n      if (!compact || _result !== '') {\n        _result += generateNextLine(state, level)\n      }\n\n      if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {\n        _result += '-'\n      } else {\n        _result += '- '\n      }\n\n      _result += state.dump\n    }\n  }\n\n  state.tag = _tag\n  state.dump = _result || '[]' // Empty sequence if no valid values.\n}\n\nfunction writeFlowMapping (state, level, object) {\n  let _result = ''\n  const _tag = state.tag\n  const objectKeyList = Object.keys(object)\n\n  for (let index = 0, length = objectKeyList.length; index < length; index += 1) {\n    let pairBuffer = ''\n    if (_result !== '') pairBuffer += ', '\n\n    if (state.condenseFlow) pairBuffer += '\"'\n\n    const objectKey = objectKeyList[index]\n    let objectValue = object[objectKey]\n\n    if (state.replacer) {\n      objectValue = state.replacer.call(object, objectKey, objectValue)\n    }\n\n    if (!writeNode(state, level, objectKey, false, false)) {\n      continue // Skip this pair because of invalid key;\n    }\n\n    if (state.dump.length > 1024) pairBuffer += '? '\n\n    pairBuffer += state.dump + (state.condenseFlow ? '\"' : '') + ':' + (state.condenseFlow ? '' : ' ')\n\n    if (!writeNode(state, level, objectValue, false, false)) {\n      continue // Skip this pair because of invalid value.\n    }\n\n    pairBuffer += state.dump\n\n    // Both key and value are valid.\n    _result += pairBuffer\n  }\n\n  state.tag = _tag\n  state.dump = '{' + _result + '}'\n}\n\nfunction writeBlockMapping (state, level, object, compact) {\n  let _result = ''\n  const _tag = state.tag\n  const objectKeyList = Object.keys(object)\n\n  // Allow sorting keys so that the output file is deterministic\n  if (state.sortKeys === true) {\n    // Default sorting\n    objectKeyList.sort()\n  } else if (typeof state.sortKeys === 'function') {\n    // Custom sort function\n    objectKeyList.sort(state.sortKeys)\n  } else if (state.sortKeys) {\n    // Something is wrong\n    throw new YAMLException('sortKeys must be a boolean or a function')\n  }\n\n  for (let index = 0, length = objectKeyList.length; index < length; index += 1) {\n    let pairBuffer = ''\n\n    if (!compact || _result !== '') {\n      pairBuffer += generateNextLine(state, level)\n    }\n\n    const objectKey = objectKeyList[index]\n    let objectValue = object[objectKey]\n\n    if (state.replacer) {\n      objectValue = state.replacer.call(object, objectKey, objectValue)\n    }\n\n    if (!writeNode(state, level + 1, objectKey, true, true, true)) {\n      continue // Skip this pair because of invalid key.\n    }\n\n    const explicitPair = (state.tag !== null && state.tag !== '?') ||\n                   (state.dump && state.dump.length > 1024)\n\n    if (explicitPair) {\n      if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {\n        pairBuffer += '?'\n      } else {\n        pairBuffer += '? '\n      }\n    }\n\n    pairBuffer += state.dump\n\n    if (explicitPair) {\n      pairBuffer += generateNextLine(state, level)\n    }\n\n    if (!writeNode(state, level + 1, objectValue, true, explicitPair)) {\n      continue // Skip this pair because of invalid value.\n    }\n\n    if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {\n      pairBuffer += ':'\n    } else {\n      pairBuffer += ': '\n    }\n\n    pairBuffer += state.dump\n\n    // Both key and value are valid.\n    _result += pairBuffer\n  }\n\n  state.tag = _tag\n  state.dump = _result || '{}' // Empty mapping if no valid pairs.\n}\n\nfunction detectType (state, object, explicit) {\n  const typeList = explicit ? state.explicitTypes : state.implicitTypes\n\n  for (let index = 0, length = typeList.length; index < length; index += 1) {\n    const type = typeList[index]\n\n    if ((type.instanceOf || type.predicate) &&\n        (!type.instanceOf || ((typeof object === 'object') && (object instanceof type.instanceOf))) &&\n        (!type.predicate || type.predicate(object))) {\n      if (explicit) {\n        if (type.multi && type.representName) {\n          state.tag = type.representName(object)\n        } else {\n          state.tag = type.tag\n        }\n      } else {\n        state.tag = '?'\n      }\n\n      if (type.represent) {\n        const style = state.styleMap[type.tag] || type.defaultStyle\n\n        let _result\n        if (_toString.call(type.represent) === '[object Function]') {\n          _result = type.represent(object, style)\n        } else if (_hasOwnProperty.call(type.represent, style)) {\n          _result = type.represent[style](object, style)\n        } else {\n          throw new YAMLException('!<' + type.tag + '> tag resolver accepts not \"' + style + '\" style')\n        }\n\n        state.dump = _result\n      }\n\n      return true\n    }\n  }\n\n  return false\n}\n\n// Serializes `object` and writes it to global `result`.\n// Returns true on success, or false on invalid object.\n//\nfunction writeNode (state, level, object, block, compact, iskey, isblockseq) {\n  state.tag = null\n  state.dump = object\n\n  if (!detectType(state, object, false)) {\n    detectType(state, object, true)\n  }\n\n  const type = _toString.call(state.dump)\n  const inblock = block\n\n  if (block) {\n    block = (state.flowLevel < 0 || state.flowLevel > level)\n  }\n\n  const objectOrArray = type === '[object Object]' || type === '[object Array]'\n  let duplicateIndex\n  let duplicate\n\n  if (objectOrArray) {\n    duplicateIndex = state.duplicates.indexOf(object)\n    duplicate = duplicateIndex !== -1\n  }\n\n  if ((state.tag !== null && state.tag !== '?') || duplicate || (state.indent !== 2 && level > 0)) {\n    compact = false\n  }\n\n  if (duplicate && state.usedDuplicates[duplicateIndex]) {\n    state.dump = '*ref_' + duplicateIndex\n  } else {\n    if (objectOrArray && duplicate && !state.usedDuplicates[duplicateIndex]) {\n      state.usedDuplicates[duplicateIndex] = true\n    }\n    if (type === '[object Object]') {\n      if (block && (Object.keys(state.dump).length !== 0)) {\n        writeBlockMapping(state, level, state.dump, compact)\n        if (duplicate) {\n          state.dump = '&ref_' + duplicateIndex + state.dump\n        }\n      } else {\n        writeFlowMapping(state, level, state.dump)\n        if (duplicate) {\n          state.dump = '&ref_' + duplicateIndex + ' ' + state.dump\n        }\n      }\n    } else if (type === '[object Array]') {\n      if (block && (state.dump.length !== 0)) {\n        if (state.noArrayIndent && !isblockseq && level > 0) {\n          writeBlockSequence(state, level - 1, state.dump, compact)\n        } else {\n          writeBlockSequence(state, level, state.dump, compact)\n        }\n        if (duplicate) {\n          state.dump = '&ref_' + duplicateIndex + state.dump\n        }\n      } else {\n        writeFlowSequence(state, level, state.dump)\n        if (duplicate) {\n          state.dump = '&ref_' + duplicateIndex + ' ' + state.dump\n        }\n      }\n    } else if (type === '[object String]') {\n      if (state.tag !== '?') {\n        writeScalar(state, state.dump, level, iskey, inblock)\n      }\n    } else if (type === '[object Undefined]') {\n      return false\n    } else {\n      if (state.skipInvalid) return false\n      throw new YAMLException('unacceptable kind of an object to dump ' + type)\n    }\n\n    if (state.tag !== null && state.tag !== '?') {\n      // Need to encode all characters except those allowed by the spec:\n      //\n      // [35] ns-dec-digit    ::=  [#x30-#x39] /* 0-9 */\n      // [36] ns-hex-digit    ::=  ns-dec-digit\n      //                         | [#x41-#x46] /* A-F */ | [#x61-#x66] /* a-f */\n      // [37] ns-ascii-letter ::=  [#x41-#x5A] /* A-Z */ | [#x61-#x7A] /* a-z */\n      // [38] ns-word-char    ::=  ns-dec-digit | ns-ascii-letter | â€œ-â€�\n      // [39] ns-uri-char     ::=  â€œ%â€� ns-hex-digit ns-hex-digit | ns-word-char | â€œ#â€�\n      //                         | â€œ;â€� | â€œ/â€� | â€œ?â€� | â€œ:â€� | â€œ@â€� | â€œ&â€� | â€œ=â€� | â€œ+â€� | â€œ$â€� | â€œ,â€�\n      //                         | â€œ_â€� | â€œ.â€� | â€œ!â€� | â€œ~â€� | â€œ*â€� | â€œ'â€� | â€œ(â€� | â€œ)â€� | â€œ[â€� | â€œ]â€�\n      //\n      // Also need to encode '!' because it has special meaning (end of tag prefix).\n      //\n      let tagStr = encodeURI(\n        state.tag[0] === '!' ? state.tag.slice(1) : state.tag\n      ).replace(/!/g, '%21')\n\n      if (state.tag[0] === '!') {\n        tagStr = '!' + tagStr\n      } else if (tagStr.slice(0, 18) === 'tag:yaml.org,2002:') {\n        tagStr = '!!' + tagStr.slice(18)\n      } else {\n        tagStr = '!<' + tagStr + '>'\n      }\n\n      state.dump = tagStr + ' ' + state.dump\n    }\n  }\n\n  return true\n}\n\nfunction getDuplicateReferences (object, state) {\n  const objects = []\n  const duplicatesIndexes = []\n\n  inspectNode(object, objects, duplicatesIndexes)\n\n  const length = duplicatesIndexes.length\n  for (let index = 0; index < length; index += 1) {\n    state.duplicates.push(objects[duplicatesIndexes[index]])\n  }\n  state.usedDuplicates = new Array(length)\n}\n\nfunction inspectNode (object, objects, duplicatesIndexes) {\n  if (object !== null && typeof object === 'object') {\n    const index = objects.indexOf(object)\n    if (index !== -1) {\n      if (duplicatesIndexes.indexOf(index) === -1) {\n        duplicatesIndexes.push(index)\n      }\n    } else {\n      objects.push(object)\n\n      if (Array.isArray(object)) {\n        for (let i = 0, length = object.length; i < length; i += 1) {\n          inspectNode(object[i], objects, duplicatesIndexes)\n        }\n      } else {\n        const objectKeyList = Object.keys(object)\n\n        for (let i = 0, length = objectKeyList.length; i < length; i += 1) {\n          inspectNode(object[objectKeyList[i]], objects, duplicatesIndexes)\n        }\n      }\n    }\n  }\n}\n\nfunction dump (input, options) {\n  options = options || {}\n\n  const state = new State(options)\n\n  if (!state.noRefs) getDuplicateReferences(input, state)\n\n  let value = input\n\n  if (state.replacer) {\n    value = state.replacer.call({ '': value }, '', value)\n  }\n\n  if (writeNode(state, 0, value, true, true)) return state.dump + '\\n'\n\n  return ''\n}\n\nmodule.exports.dump = dump\n","'use strict'\n\nconst loader = require('./lib/loader')\nconst dumper = require('./lib/dumper')\n\nfunction renamed (from, to) {\n  return function () {\n    throw new Error('Function yaml.' + from + ' is removed in js-yaml 4. ' +\n      'Use yaml.' + to + ' instead, which is now safe by default.')\n  }\n}\n\nmodule.exports.Type = require('./lib/type')\nmodule.exports.Schema = require('./lib/schema')\nmodule.exports.FAILSAFE_SCHEMA = require('./lib/schema/failsafe')\nmodule.exports.JSON_SCHEMA = require('./lib/schema/json')\nmodule.exports.CORE_SCHEMA = require('./lib/schema/core')\nmodule.exports.DEFAULT_SCHEMA = require('./lib/schema/default')\nmodule.exports.load = loader.load\nmodule.exports.loadAll = loader.loadAll\nmodule.exports.dump = dumper.dump\nmodule.exports.YAMLException = require('./lib/exception')\n\n// Re-export all types in case user wants to create custom schema\nmodule.exports.types = {\n  binary: require('./lib/type/binary'),\n  float: require('./lib/type/float'),\n  map: require('./lib/type/map'),\n  null: require('./lib/type/null'),\n  pairs: require('./lib/type/pairs'),\n  set: require('./lib/type/set'),\n  timestamp: require('./lib/type/timestamp'),\n  bool: require('./lib/type/bool'),\n  int: require('./lib/type/int'),\n  merge: require('./lib/type/merge'),\n  omap: require('./lib/type/omap'),\n  seq: require('./lib/type/seq'),\n  str: require('./lib/type/str')\n}\n\n// Removed functions from JS-YAML 3.0.x\nmodule.exports.safeLoad = renamed('safeLoad', 'load')\nmodule.exports.safeLoadAll = renamed('safeLoadAll', 'loadAll')\nmodule.exports.safeDump = renamed('safeDump', 'dump')\n","import yaml from '../index.js'\n\nconst {\n  Type,\n  Schema,\n  FAILSAFE_SCHEMA,\n  JSON_SCHEMA,\n  CORE_SCHEMA,\n  DEFAULT_SCHEMA,\n  load,\n  loadAll,\n  dump,\n  YAMLException,\n  types,\n  safeLoad,\n  safeLoadAll,\n  safeDump\n} = yaml\n\nexport {\n  Type,\n  Schema,\n  FAILSAFE_SCHEMA,\n  JSON_SCHEMA,\n  CORE_SCHEMA,\n  DEFAULT_SCHEMA,\n  load,\n  loadAll,\n  dump,\n  YAMLException,\n  types,\n  safeLoad,\n  safeLoadAll,\n  safeDump\n}\n\nexport default yaml\n"],"names":["_typeof","o","Symbol","iterator","constructor","prototype","isNothing","subject","isObject","toArray","sequence","Array","isArray","extend","target","source","sourceKeys","Object","keys","index","length","key","repeat","string","count","result","cycle","isNegativeZero","number","Number","NEGATIVE_INFINITY","common","formatError","exception","compact","where","message","reason","mark","name","line","column","snippet","YAMLException","Error","call","this","captureStackTrace","stack","create","toString","require$$0","getLine","buffer","lineStart","lineEnd","position","maxLineLength","head","tail","maxHalfLength","Math","floor","str","slice","replace","pos","padStart","max","makeSnippet","options","maxLength","indent","linesBefore","linesAfter","re","lineStarts","lineEnds","match","foundLineNo","exec","push","lineNoLength","min","i","TYPE_CONSTRUCTOR_OPTIONS","YAML_NODE_KINDS","compileStyleAliases","map","forEach","style","alias","String","Type","tag","indexOf","kind","resolve","construct","data","instanceOf","predicate","represent","representName","defaultStyle","multi","styleAliases","type","require$$1","compileList","schema","currentType","newIndex","previousType","previousIndex","compileMap","scalar","mapping","fallback","collectType","arguments","Schema","definition","implicit","explicit","concat","loadKind","compiledImplicit","compiledExplicit","compiledTypeMap","seq","failsafe","require$$2","require$$3","resolveYamlNull","constructYamlNull","isNull","object","_null","canonical","lowercase","uppercase","camelcase","empty","resolveYamlBoolean","constructYamlBoolean","isBoolean","bool","isHexCode","c","isOctCode","isDecCode","resolveYamlInteger","hasDigits","ch","isFinite","parseYamlInteger","charCodeAt","value","sign","parseInt","constructYamlInteger","isInteger","int","binary","obj","octal","decimal","hexadecimal","toUpperCase","YAML_FLOAT_PATTERN","RegExp","YAML_FLOAT_SPECIAL_PATTERN","resolveYamlFloat","test","parseFloat","constructYamlFloat","toLowerCase","POSITIVE_INFINITY","NaN","SCIENTIFIC_WITHOUT_DOT","representYamlFloat","isNaN","res","isFloat","float","json","require$$4","core","YAML_DATE_REGEXP","YAML_TIMESTAMP_REGEXP","resolveYamlTimestamp","constructYamlTimestamp","fraction","delta","year","month","day","Date","UTC","hour","minute","second","tzHour","tzMinute","date","setTime","getTime","representYamlTimestamp","toISOString","timestamp","resolveYamlMerge","merge","BASE64_MAP","resolveYamlBinary","bitlen","idx","code","charAt","constructYamlBinary","input","bits","tailbits","Uint8Array","representYamlBinary","isBinary","_hasOwnProperty","hasOwnProperty","_toString","resolveYamlOmap","objectKeys","pair","pairHasKey","pairKey","constructYamlOmap","omap","resolveYamlPairs","constructYamlPairs","pairs","resolveYamlSet","constructYamlSet","set","_default","require$$5","require$$6","DEFAULT_SCHEMA","CONTEXT_FLOW_IN","CONTEXT_FLOW_OUT","CONTEXT_BLOCK_IN","CONTEXT_BLOCK_OUT","CHOMPING_CLIP","CHOMPING_STRIP","CHOMPING_KEEP","PATTERN_NON_PRINTABLE","PATTERN_NON_ASCII_LINE_BREAKS","PATTERN_FLOW_INDICATORS","PATTERN_TAG_HANDLE","PATTERN_TAG_URI","_class","isEol","isWhiteSpace","isWsOrEol","isFlowIndicator","fromHexCode","lc","escapedHexLen","fromDecimalCode","simpleEscapeSequence","charFromCodepoint","fromCharCode","setProperty","defineProperty","configurable","enumerable","writable","simpleEscapeCheck","simpleEscapeMap","State","filename","onWarning","legacy","listener","maxDepth","maxTotalMergeKeys","implicitTypes","typeMap","lineIndent","depth","totalMergeKeys","firstTabInLine","documents","anchorMapTransactions","generateError","state","throwError","throwWarning","storeAnchor","transactions","transaction","existed","anchorMap","beginAnchorTransaction","commitAnchorTransaction","pop","parent","names","rollbackAnchorTransaction","entry","snapshotState","anchor","restoreState","snapshot","directiveHandlers","YAML","handleYamlDirective","args","version","major","minor","checkLineBreaks","TAG","handleTagDirective","prefix","handle","tagMap","decodeURIComponent","err","captureSegment","start","end","checkJson","_result","_position","_length","_character","mergeMappings","destination","overridableKeys","quantity","storeMappingPair","keyTag","keyNode","valueNode","startLine","startLineStart","startPos","readLineBreak","skipSeparationSpace","allowComments","checkIndent","lineBreaks","testDocumentSeparator","writeFoldedLines","readPlainScalar","nodeIndent","withinFlowCollection","captureStart","captureEnd","hasPendingContent","_line","_lineStart","_lineIndent","_kind","following","preceding","readSingleQuotedScalar","readDoubleQuotedScalar","tmp","hexLength","hexResult","readFlowCollection","readNext","_pos","_tag","_anchor","terminator","isPair","isExplicitPair","isMapping","composeNode","readBlockScalar","folding","chomping","didReadContent","detectedIndent","textIndent","emptyLines","atMoreIndented","readBlockSequence","detected","readBlockMapping","flowIndent","allowCompact","_keyLine","_keyLineStart","_keyPos","atExplicitKey","readTagProperty","isVerbatim","isNamed","tagHandle","tagName","readAnchorProperty","readAlias","tryReadBlockMappingFromProperty","propertyStart","fallbackState","parentIndent","nodeContext","allowToSeek","allowBlockScalars","allowBlockCollections","indentStatus","atNewLine","hasContent","blockIndent","allowBlockStyles","propertyState","typeIndex","typeQuantity","typeList","readDocument","documentStart","hasDirectives","directiveName","directiveArgs","loadDocuments","nullpos","loadAll","load","loader","CHAR_BOM","CHAR_TAB","CHAR_LINE_FEED","CHAR_CARRIAGE_RETURN","CHAR_SPACE","CHAR_EXCLAMATION","CHAR_DOUBLE_QUOTE","CHAR_SHARP","CHAR_PERCENT","CHAR_AMPERSAND","CHAR_SINGLE_QUOTE","CHAR_ASTERISK","CHAR_COMMA","CHAR_MINUS","CHAR_COLON","CHAR_EQUALS","CHAR_GREATER_THAN","CHAR_QUESTION","CHAR_COMMERCIAL_AT","CHAR_LEFT_SQUARE_BRACKET","CHAR_RIGHT_SQUARE_BRACKET","CHAR_GRAVE_ACCENT","CHAR_LEFT_CURLY_BRACKET","CHAR_VERTICAL_LINE","CHAR_RIGHT_CURLY_BRACKET","ESCAPE_SEQUENCES","DEPRECATED_BOOLEANS_SYNTAX","DEPRECATED_BASE60_SYNTAX","compileStyleMap","encodeHex","character","QUOTING_TYPE_SINGLE","QUOTING_TYPE_DOUBLE","noArrayIndent","skipInvalid","flowLevel","styleMap","sortKeys","lineWidth","noRefs","noCompatMode","condenseFlow","quotingType","forceQuotes","replacer","explicitTypes","duplicates","usedDuplicates","indentString","spaces","ind","next","generateNextLine","level","testImplicitResolving","isWhitespace","isPrintable","isNsCharOrWhitespace","isPlainSafe","prev","inblock","cIsNsCharOrWhitespace","cIsNsChar","isPlainSafeFirst","isPlainSafeLast","codePointAt","first","needIndentIndicator","leadingSpaceRe","STYLE_PLAIN","STYLE_SINGLE","STYLE_LITERAL","STYLE_FOLDED","STYLE_DOUBLE","chooseScalarStyle","singleLineOnly","indentPerLevel","testAmbiguousType","char","prevChar","hasLineBreak","hasFoldableLine","shouldTrackWidth","previousLineBreak","plain","writeScalar","iskey","dump","testAmbiguity","blockHeader","dropEndingNewline","foldString","escapeString","indentIndicator","clip","keep","chomp","width","lineRe","nextLF","lastIndex","foldLine","prevMoreIndented","moreIndented","breakRe","curr","escapeSeq","writeFlowSequence","writeNode","writeBlockSequence","writeFlowMapping","objectKeyList","pairBuffer","objectKey","objectValue","writeBlockMapping","sort","explicitPair","detectType","block","isblockseq","objectOrArray","duplicateIndex","duplicate","tagStr","encodeURI","getDuplicateReferences","objects","duplicatesIndexes","inspectNode","dumper","renamed","from","to","jsYaml","FAILSAFE_SCHEMA","JSON_SCHEMA","CORE_SCHEMA","require$$7","require$$8","types","require$$9","require$$10","require$$11","null","require$$12","require$$13","require$$14","require$$15","require$$16","require$$17","require$$18","require$$19","require$$20","require$$21","safeLoad","safeLoadAll","safeDump","yaml"],"mappings":";;;;;;;;;;;;;;;QAAY,SAAAA,QAAAC;YAAA;YAAA,OAAAD,UAAA,qBAAAE,UAAA,mBAAAA,OAAAC,WAAA,SAAAF;gBAAA,cAAAA;gBAAA,SAAAA;gBAAA,OAAAA,MAAA,qBAAAC,UAAAD,GAAAG,gBAAAF,UAAAD,OAAAC,OAAAG,YAAA,kBAAAJ;AAAA,eAAAD,QAAAC;AAAA;QAEZ,SAASK,UAAWC;YAClB,cAAeA,YAAY,eAAiBA,YAAY;AAC1D;QAEA,SAASC,SAAUD;YACjB,OAAQP,QAAOO,aAAY,YAAcA,YAAY;AACvD;QAEA,SAASE,QAASC;YAChB,IAAIC,MAAMC,QAAQF,WAAW,OAAOA,eAAA,IAC3BJ,UAAUI,WAAW,OAAO;YAErC,OAAO,EAACA;AACV;QAEA,SAASG,OAAQC,QAAQC;YACvB,IAAIA,QAAQ;gBACV,IAAMC,aAAaC,OAAOC,KAAKH;gBAE/B,KAAA,IAASI,QAAQ,GAAGC,SAASJ,WAAWI,QAAQD,QAAQC,QAAQD,SAAS,GAAG;oBAC1E,IAAME,MAAML,WAAWG;oBACvBL,OAAOO,OAAON,OAAOM;AACvB;AACF;YAEA,OAAOP;AACT;QAEA,SAASQ,OAAQC,QAAQC;YACvB,IAAIC,SAAS;YAEb,KAAA,IAASC,QAAQ,GAAGA,QAAQF,OAAOE,SAAS,GAAG;gBAC7CD,UAAUF;AACZ;YAEA,OAAOE;AACT;QAEA,SAASE,eAAgBC;YACvB,OAAQA,WAAW,KAAOC,OAAOC,sBAAsB,IAAIF;AAC7D;QAEAG,OAAAzB,YAA2BA;QAC3ByB,OAAAvB,WAA0BA;QAC1BuB,OAAAtB,UAAyBA;QACzBsB,OAAAT,SAAwBA;QACxBS,OAAAJ,iBAAgCA;QAChCI,OAAAlB,SAAwBA;;;;;;;;QC7CxB,SAASmB,YAAaC,YAAWC;YAC/B,IAAIC,QAAQ;YACZ,IAAMC,UAAUH,WAAUI,UAAU;YAEpC,KAAKJ,WAAUK,MAAM,OAAOF;YAE5B,IAAIH,WAAUK,KAAKC,MAAM;gBACvBJ,SAAS,SAASF,WAAUK,KAAKC,OAAO;AAC1C;YAEAJ,SAAS,OAAOF,WAAUK,KAAKE,OAAO,KAAK,OAAOP,WAAUK,KAAKG,SAAS,KAAK;YAE/E,KAAKP,WAAWD,WAAUK,KAAKI,SAAS;gBACtCP,SAAS,SAASF,WAAUK,KAAKI;AACnC;YAEA,OAAON,UAAU,MAAMD;AACzB;QAEA,SAASQ,eAAeN,QAAQC;YAE9BM,MAAMC,KAAKC;YAEXA,KAAKP,OAAO;YACZO,KAAKT,SAASA;YACdS,KAAKR,OAAOA;YACZQ,KAAKV,UAAUJ,YAAYc,MAAM;YAGjC,IAAIF,MAAMG,mBAAmB;gBAE3BH,MAAMG,kBAAkBD,MAAMA,KAAK1C;AACrC,mBAAO;gBAEL0C,KAAKE,SAAS,IAAIJ,OAASI,SAAS;AACtC;AACF;QAGAL,eAActC,YAAYY,OAAOgC,OAAOL,MAAMvC;QAC9CsC,eAActC,UAAUD,cAAcuC;QAEtCA,eAActC,UAAU6C,WAAW,SAASA,SAAUhB;YACpD,OAAOY,KAAKP,OAAO,OAAOP,YAAYc,MAAMZ;AAC9C;QAEAD,YAAiBU;;;;;;;;QChDjB,IAAMZ,UAASoB;QAGf,SAASC,QAASC,QAAQC,WAAWC,SAASC,UAAUC;YACtD,IAAIC,OAAO;YACX,IAAIC,OAAO;YACX,IAAMC,gBAAgBC,KAAKC,MAAML,gBAAgB,KAAK;YAEtD,IAAID,WAAWF,YAAYM,eAAe;gBACxCF,OAAO;gBACPJ,YAAYE,WAAWI,gBAAgBF,KAAKtC;AAC9C;YAEA,IAAImC,UAAUC,WAAWI,eAAe;gBACtCD,OAAO;gBACPJ,UAAUC,WAAWI,gBAAgBD,KAAKvC;AAC5C;YAEA,OAAO;gBACL2C,KAAKL,OAAOL,OAAOW,MAAMV,WAAWC,SAASU,QAAQ,OAAO,OAAON;gBACnEO,KAAKV,WAAWF,YAAYI,KAAKtC;;AAErC;QAEA,SAAS+C,SAAU5C,QAAQ6C;YACzB,OAAOrC,QAAOT,OAAO,KAAK8C,MAAM7C,OAAOH,UAAUG;AACnD;QAEA,SAAS8C,YAAa/B,MAAMgC;YAC1BA,UAAUrD,OAAOgC,OAAOqB,WAAW;YAEnC,KAAKhC,KAAKe,QAAQ,OAAO;YAEzB,KAAKiB,QAAQC,WAAWD,QAAQC,YAAY;YAC5C,WAAWD,QAAQE,WAAW,kBAAkBA,SAAS;YACzD,WAAWF,QAAQG,gBAAgB,kBAAkBA,cAAc;YACnE,WAAWH,QAAQI,eAAe,kBAAkBA,aAAa;YAEjE,IAAMC,KAAK;YACX,IAAMC,aAAa,EAAC;YACpB,IAAMC,WAAW;YACjB,IAAIC;YACJ,IAAIC,eAAc;YAElB,OAAQD,QAAQH,GAAGK,KAAK1C,KAAKe,SAAU;gBACrCwB,SAASI,KAAKH,MAAM3D;gBACpByD,WAAWK,KAAKH,MAAM3D,QAAQ2D,MAAM,GAAG1D;gBAEvC,IAAIkB,KAAKkB,YAAYsB,MAAM3D,SAAS4D,cAAc,GAAG;oBACnDA,cAAcH,WAAWxD,SAAS;AACpC;AACF;YAEA,IAAI2D,cAAc,GAAGA,cAAcH,WAAWxD,SAAS;YAEvD,IAAIK,SAAS;YACb,IAAMyD,eAAerB,KAAKsB,IAAI7C,KAAKE,OAAO8B,QAAQI,YAAYG,SAASzD,QAAQ8B,WAAW9B;YAC1F,IAAMqC,gBAAgBa,QAAQC,aAAaD,QAAQE,SAASU,eAAe;YAE3E,KAAA,IAASE,IAAI,GAAGA,KAAKd,QAAQG,aAAaW,KAAK;gBAC7C,IAAIL,cAAcK,IAAI,GAAG;gBACzB,IAAM5C,QAAOY,QACXd,KAAKe,QACLuB,WAAWG,cAAcK,IACzBP,SAASE,cAAcK,IACvB9C,KAAKkB,YAAYoB,WAAWG,eAAeH,WAAWG,cAAcK,KACpE3B;gBAEFhC,SAASM,QAAOT,OAAO,KAAKgD,QAAQE,UAAUL,UAAU7B,KAAKE,OAAO4C,IAAI,GAAGlC,YAAYgC,gBACrF,QAAQ1C,MAAKuB,MAAM,OAAOtC;AAC9B;YAEA,IAAMe,OAAOY,QAAQd,KAAKe,QAAQuB,WAAWG,cAAcF,SAASE,cAAczC,KAAKkB,UAAUC;YACjGhC,UAAUM,QAAOT,OAAO,KAAKgD,QAAQE,UAAUL,UAAU7B,KAAKE,OAAO,GAAGU,YAAYgC,gBAClF,QAAQ1C,KAAKuB,MAAM;YACrBtC,UAAUM,QAAOT,OAAO,KAAKgD,QAAQE,SAASU,eAAe,IAAI1C,KAAK0B,OAAO;YAE7E,KAAA,IAASkB,KAAI,GAAGA,MAAKd,QAAQI,YAAYU,MAAK;gBAC5C,IAAIL,cAAcK,MAAKP,SAASzD,QAAQ;gBACxC,IAAMoB,SAAOY,QACXd,KAAKe,QACLuB,WAAWG,cAAcK,KACzBP,SAASE,cAAcK,KACvB9C,KAAKkB,YAAYoB,WAAWG,eAAeH,WAAWG,cAAcK,MACpE3B;gBAEFhC,UAAUM,QAAOT,OAAO,KAAKgD,QAAQE,UAAUL,UAAU7B,KAAKE,OAAO4C,KAAI,GAAGlC,YAAYgC,gBACtF,QAAQ1C,OAAKuB,MAAM;AACvB;YAEA,OAAOtC,OAAOwC,QAAQ,OAAO;AAC/B;QAEAvB,UAAiB2B;;;;;;;;QC7FjB,IAAM1B,iBAAgBQ;QAEtB,IAAMkC,2BAA2B,EAC/B,QACA,SACA,WACA,aACA,cACA,aACA,aACA,iBACA,gBACA;QAGF,IAAMC,kBAAkB,EACtB,UACA,YACA;QAGF,SAASC,oBAAqBC;YAC5B,IAAM/D,SAAS,CAAA;YAEf,IAAI+D,SAAQ,MAAM;gBAChBvE,OAAOC,KAAKsE,MAAKC,QAAQ,SAAUC;oBACjCF,KAAIE,OAAOD,QAAQ,SAAUE;wBAC3BlE,OAAOmE,OAAOD,UAAUD;AAC1B;AACF;AACF;YAEA,OAAOjE;AACT;QAEA,SAASoE,MAAMC,KAAKxB;YAClBA,UAAUA,WAAW,CAAA;YAErBrD,OAAOC,KAAKoD,SAASmB,QAAQ,SAAUlD;gBACrC,IAAI8C,yBAAyBU,QAAQxD,WAAU,GAAI;oBACjD,MAAM,IAAII,eAAc,qBAAqBJ,OAAO,gCAAgCuD,MAAM;AAC5F;AACF;YAGAhD,KAAKwB,UAAUA;YACfxB,KAAKgD,MAAMA;YACXhD,KAAKkD,OAAO1B,QAAQ,WAAW;YAC/BxB,KAAKmD,UAAU3B,QAAQ,cAAc;gBAAc,OAAO;;YAC1DxB,KAAKoD,YAAY5B,QAAQ,gBAAgB,SAAU6B;gBAAQ,OAAOA;;YAClErD,KAAKsD,aAAa9B,QAAQ,iBAAiB;YAC3CxB,KAAKuD,YAAY/B,QAAQ,gBAAgB;YACzCxB,KAAKwD,YAAYhC,QAAQ,gBAAgB;YACzCxB,KAAKyD,gBAAgBjC,QAAQ,oBAAoB;YACjDxB,KAAK0D,eAAelC,QAAQ,mBAAmB;YAC/CxB,KAAK2D,QAAQnC,QAAQ,YAAY;YACjCxB,KAAK4D,eAAenB,oBAAoBjB,QAAQ,mBAAmB;YAEnE,IAAIgB,gBAAgBS,QAAQjD,KAAKkD,WAAU,GAAI;gBAC7C,MAAM,IAAIrD,eAAc,mBAAmBG,KAAKkD,OAAO,yBAAyBF,MAAM;AACxF;AACF;QAEAa,OAAiBd;;;;;;;;QC/DjB,IAAMlD,iBAAgBQ;QACtB,IAAM0C,QAAOe;QAEb,SAASC,YAAaC,SAAQvE;YAC5B,IAAMd,SAAS;YAEfqF,QAAOvE,MAAMkD,QAAQ,SAAUsB;gBAC7B,IAAIC,WAAWvF,OAAOL;gBAEtBK,OAAOgE,QAAQ,SAAUwB,cAAcC;oBACrC,IAAID,aAAanB,QAAQiB,YAAYjB,OACjCmB,aAAajB,SAASe,YAAYf,QAClCiB,aAAaR,UAAUM,YAAYN,OAAO;wBAC5CO,WAAWE;AACb;AACF;gBAEAzF,OAAOuF,YAAYD;AACrB;YAEA,OAAOtF;AACT;QAEA,SAAS0F;YACP,IAAM1F,SAAS;gBACb2F,QAAQ,CAAA;gBACR1G,UAAU,CAAA;gBACV2G,SAAS,CAAA;gBACTC,UAAU,CAAA;gBACVb,OAAO;oBACLW,QAAQ;oBACR1G,UAAU;oBACV2G,SAAS;oBACTC,UAAU;;;YAGd,SAASC,YAAaZ;gBACpB,IAAIA,MAAKF,OAAO;oBACdhF,OAAOgF,MAAME,MAAKX,MAAMf,KAAK0B;oBAC7BlF,OAAOgF,MAAM,YAAYxB,KAAK0B;AAChC,uBAAO;oBACLlF,OAAOkF,MAAKX,MAAMW,MAAKb,OAAOrE,OAAO,YAAYkF,MAAKb,OAAOa;AAC/D;AACF;YAEA,KAAA,IAASxF,QAAQ,GAAGC,SAASoG,UAAUpG,QAAQD,QAAQC,QAAQD,SAAS,GAAG;gBACzEqG,UAAUrG,OAAOsE,QAAQ8B;AAC3B;YACA,OAAO9F;AACT;QAEA,SAASgG,QAAQC;YACf,OAAO5E,KAAKjC,OAAO6G;AACrB;QAEAD,QAAOpH,UAAUQ,SAAS,SAASA,OAAQ6G;YACzC,IAAIC,WAAW;YACf,IAAIC,WAAW;YAEf,IAAIF,sBAAsB7B,OAAM;gBAE9B+B,SAAS3C,KAAKyC;uBACL/G,MAAMC,QAAQ8G,aAAa;gBAEpCE,WAAWA,SAASC,OAAOH;uBAClBA,eAAe/G,MAAMC,QAAQ8G,WAAWC,aAAahH,MAAMC,QAAQ8G,WAAWE,YAAY;gBAEnG,IAAIF,WAAWC,UAAUA,WAAWA,SAASE,OAAOH,WAAWC;gBAC/D,IAAID,WAAWE,UAAUA,WAAWA,SAASC,OAAOH,WAAWE;AACjE,mBAAO;gBACL,MAAM,IAAIjF,eAAc;AAE1B;YAEAgF,SAASlC,QAAQ,SAAUkB;gBACzB,MAAMA,iBAAgBd,QAAO;oBAC3B,MAAM,IAAIlD,eAAc;AAC1B;gBAEA,IAAIgE,MAAKmB,YAAYnB,MAAKmB,aAAa,UAAU;oBAC/C,MAAM,IAAInF,eAAc;AAC1B;gBAEA,IAAIgE,MAAKF,OAAO;oBACd,MAAM,IAAI9D,eAAc;AAC1B;AACF;YAEAiF,SAASnC,QAAQ,SAAUkB;gBACzB,MAAMA,iBAAgBd,QAAO;oBAC3B,MAAM,IAAIlD,eAAc;AAC1B;AACF;YAEA,IAAMlB,SAASR,OAAOgC,OAAOwE,QAAOpH;YAEpCoB,OAAOkG,YAAY7E,KAAK6E,YAAY,IAAIE,OAAOF;YAC/ClG,OAAOmG,YAAY9E,KAAK8E,YAAY,IAAIC,OAAOD;YAE/CnG,OAAOsG,mBAAmBlB,YAAYpF,QAAQ;YAC9CA,OAAOuG,mBAAmBnB,YAAYpF,QAAQ;YAC9CA,OAAOwG,kBAAkBd,WAAW1F,OAAOsG,kBAAkBtG,OAAOuG;YAEpE,OAAOvG;AACT;QAEAqF,SAAiBW;;;;;;;;QC1GjB,IAAM5B,QAAO1C;QAEbY,MAAiB,IAAI8B,MAAK,yBAAyB;YACjDG,MAAM;YACNE,WAAW,SAAXA,UAAqBC;gBAAQ,OAAOA,SAAS,OAAOA,OAAO;AAAG;;;;;;;;;QCJhE,IAAMN,QAAO1C;QAEb+E,MAAiB,IAAIrC,MAAK,yBAAyB;YACjDG,MAAM;YACNE,WAAW,SAAXA,UAAqBC;gBAAQ,OAAOA,SAAS,OAAOA,OAAO;AAAG;;;;;;;;;QCJhE,IAAMN,QAAO1C;QAEbqC,MAAiB,IAAIK,MAAK,yBAAyB;YACjDG,MAAM;YACNE,WAAW,SAAXA,UAAqBC;gBAAQ,OAAOA,SAAS,OAAOA,OAAO,CAAA;AAAG;;;;;;;;;QCDhE,IAAMsB,UAAStE;QAEfgF,WAAiB,IAAIV,QAAO;YAC1BG,UAAU,EACRhB,cACAwB,cACAC;;;;;;;;;QCTJ,IAAMxC,QAAO1C;QAEb,SAASmF,gBAAiBnC;YACxB,IAAIA,SAAS,MAAM,OAAO;YAE1B,IAAM/B,MAAM+B,KAAK/E;YAEjB,OAAQgD,QAAQ,KAAK+B,SAAS,OACtB/B,QAAQ,MAAM+B,SAAS,UAAUA,SAAS,UAAUA,SAAS;AACvE;QAEA,SAASoC;YACP,OAAO;AACT;QAEA,SAASC,OAAQC;YACf,OAAOA,WAAW;AACpB;QAEAC,QAAiB,IAAI7C,MAAK,0BAA0B;YAClDG,MAAM;YACNC,SAASqC;YACTpC,WAAWqC;YACXlC,WAAWmC;YACXlC,WAAW;gBACTqC,WAAW,SAAXA;oBAAyB,OAAO;;gBAChCC,WAAW,SAAXA;oBAAyB,OAAO;;gBAChCC,WAAW,SAAXA;oBAAyB,OAAO;;gBAChCC,WAAW,SAAXA;oBAAyB,OAAO;;gBAChCC,OAAO,SAAPA;oBAAqB,OAAO;AAAG;;YAEjCvC,cAAc;;;;;;;;;QC/BhB,IAAMX,QAAO1C;QAEb,SAAS6F,mBAAoB7C;YAC3B,IAAIA,SAAS,MAAM,OAAO;YAE1B,IAAM/B,MAAM+B,KAAK/E;YAEjB,OAAQgD,QAAQ,MAAM+B,SAAS,UAAUA,SAAS,UAAUA,SAAS,WAC7D/B,QAAQ,MAAM+B,SAAS,WAAWA,SAAS,WAAWA,SAAS;AACzE;QAEA,SAAS8C,qBAAsB9C;YAC7B,OAAOA,SAAS,UACTA,SAAS,UACTA,SAAS;AAClB;QAEA,SAAS+C,UAAWT;YAClB,OAAOxH,OAAOZ,UAAU6C,SAASL,KAAK4F,YAAY;AACpD;QAEAU,OAAiB,IAAItD,MAAK,0BAA0B;YAClDG,MAAM;YACNC,SAAS+C;YACT9C,WAAW+C;YACX5C,WAAW6C;YACX5C,WAAW;gBACTsC,WAAW,SAAXA,UAAqBH;oBAAU,OAAOA,SAAS,SAAS;;gBACxDI,WAAW,SAAXA,UAAqBJ;oBAAU,OAAOA,SAAS,SAAS;;gBACxDK,WAAW,SAAXA,UAAqBL;oBAAU,OAAOA,SAAS,SAAS;AAAQ;;YAElEjC,cAAc;;;;;;;;;QC/BhB,IAAMzE,UAASoB;QACf,IAAM0C,QAAOe;QAEb,SAASwC,UAAWC;YAClB,OAASA,KAAK,MAAiBA,KAAK,MAC3BA,KAAK,MAAiBA,KAAK,MAC3BA,KAAK,MAAiBA,KAAK;AACtC;QAEA,SAASC,UAAWD;YAClB,OAASA,KAAK,MAAiBA,KAAK;AACtC;QAEA,SAASE,UAAWF;YAClB,OAASA,KAAK,MAAiBA,KAAK;AACtC;QAEA,SAASG,mBAAoBrD;YAC3B,IAAIA,SAAS,MAAM,OAAO;YAE1B,IAAM/B,MAAM+B,KAAK/E;YACjB,IAAID,QAAQ;YACZ,IAAIsI,YAAY;YAEhB,KAAKrF,KAAK,OAAO;YAEjB,IAAIsF,KAAKvD,KAAKhF;YAGd,IAAIuI,OAAO,OAAOA,OAAO,KAAK;gBAC5BA,KAAKvD,OAAOhF;AACd;YAEA,IAAIuI,OAAO,KAAK;gBAEd,IAAIvI,QAAQ,MAAMiD,KAAK,OAAO;gBAC9BsF,KAAKvD,OAAOhF;gBAIZ,IAAIuI,OAAO,KAAK;oBAEdvI;oBAEA,MAAOA,QAAQiD,KAAKjD,SAAS;wBAC3BuI,KAAKvD,KAAKhF;wBACV,IAAIuI,OAAO,OAAOA,OAAO,KAAK,OAAO;wBACrCD,YAAY;AACd;oBACA,OAAOA,aAAaE,SAASC,iBAAiBzD;AAChD;gBAEA,IAAIuD,OAAO,KAAK;oBAEdvI;oBAEA,MAAOA,QAAQiD,KAAKjD,SAAS;wBAC3B,KAAKiI,UAAUjD,KAAK0D,WAAW1I,SAAS,OAAO;wBAC/CsI,YAAY;AACd;oBACA,OAAOA,aAAaE,SAASC,iBAAiBzD;AAChD;gBAEA,IAAIuD,OAAO,KAAK;oBAEdvI;oBAEA,MAAOA,QAAQiD,KAAKjD,SAAS;wBAC3B,KAAKmI,UAAUnD,KAAK0D,WAAW1I,SAAS,OAAO;wBAC/CsI,YAAY;AACd;oBACA,OAAOA,aAAaE,SAASC,iBAAiBzD;AAChD;AACF;YAIA,MAAOhF,QAAQiD,KAAKjD,SAAS;gBAC3B,KAAKoI,UAAUpD,KAAK0D,WAAW1I,SAAS;oBACtC,OAAO;AACT;gBACAsI,YAAY;AACd;YAEA,KAAKA,WAAW,OAAO;YAEvB,OAAOE,SAASC,iBAAiBzD;AACnC;QAEA,SAASyD,iBAAkBzD;YACzB,IAAI2D,QAAQ3D;YACZ,IAAI4D,OAAO;YAEX,IAAIL,KAAKI,MAAM;YAEf,IAAIJ,OAAO,OAAOA,OAAO,KAAK;gBAC5B,IAAIA,OAAO,KAAKK,QAAO;gBACvBD,QAAQA,MAAM9F,MAAM;gBACpB0F,KAAKI,MAAM;AACb;YAEA,IAAIA,UAAU,KAAK,OAAO;YAE1B,IAAIJ,OAAO,KAAK;gBACd,IAAII,MAAM,OAAO,KAAK,OAAOC,OAAOC,SAASF,MAAM9F,MAAM,IAAI;gBAC7D,IAAI8F,MAAM,OAAO,KAAK,OAAOC,OAAOC,SAASF,MAAM9F,MAAM,IAAI;gBAC7D,IAAI8F,MAAM,OAAO,KAAK,OAAOC,OAAOC,SAASF,MAAM9F,MAAM,IAAI;AAC/D;YAEA,OAAO+F,OAAOC,SAASF,OAAO;AAChC;QAEA,SAASG,qBAAsB9D;YAC7B,OAAOyD,iBAAiBzD;AAC1B;QAEA,SAAS+D,UAAWzB;YAClB,OAAQxH,OAAOZ,UAAU6C,SAASL,KAAK4F,YAAa,qBAC5CA,SAAS,MAAM,MAAM1G,QAAOJ,eAAe8G;AACrD;QAEA0B,MAAiB,IAAItE,MAAK,yBAAyB;YACjDG,MAAM;YACNC,SAASuD;YACTtD,WAAW+D;YACX5D,WAAW6D;YACX5D,WAAW;gBACT8D,QAAQ,SAARA,QAAkBC;oBAAO,OAAOA,OAAO,IAAI,OAAOA,IAAInH,SAAS,KAAK,QAAQmH,IAAInH,SAAS,GAAGc,MAAM;;gBAClGsG,OAAO,SAAPA,MAAiBD;oBAAO,OAAOA,OAAO,IAAI,OAAOA,IAAInH,SAAS,KAAK,QAAQmH,IAAInH,SAAS,GAAGc,MAAM;;gBACjGuG,SAAS,SAATA,QAAmBF;oBAAO,OAAOA,IAAInH,SAAS;;gBAC9CsH,aAAa,SAAbA,YAAuBH;oBAAO,OAAOA,OAAO,IAAI,OAAOA,IAAInH,SAAS,IAAIuH,gBAAgB,QAAQJ,IAAInH,SAAS,IAAIuH,cAAczG,MAAM;AAAG;;YAE1IwC,cAAc;YACdE,cAAc;gBACZ0D,QAAQ,EAAC,GAAG;gBACZE,OAAO,EAAC,GAAG;gBACXC,SAAS,EAAC,IAAI;gBACdC,aAAa,EAAC,IAAI;;;;;;;;;;QCzItB,IAAMzI,UAASoB;QACf,IAAM0C,QAAOe;QAEb,IAAM8D,qBAAqB,IAAIC,OAE7B;QASF,IAAMC,6BAA6B,IAAID,OACrC;QAMF,SAASE,iBAAkB1E;YACzB,IAAIA,SAAS,MAAM,OAAO;YAE1B,KAAKuE,mBAAmBI,KAAK3E,OAAO;gBAClC,OAAO;AACT;YAEA,IAAIwD,SAASoB,WAAW5E,MAAM,MAAM;gBAClC,OAAO;AACT;YAEA,OAAOyE,2BAA2BE,KAAK3E;AACzC;QAEA,SAAS6E,mBAAoB7E;YAC3B,IAAI2D,QAAQ3D,KAAK8E;YACjB,IAAMlB,OAAOD,MAAM,OAAO,OAAM,IAAK;YAErC,IAAI,KAAK/D,QAAQ+D,MAAM,OAAO,GAAG;gBAC/BA,QAAQA,MAAM9F,MAAM;AACtB;YAEA,IAAI8F,UAAU,QAAQ;gBACpB,OAAQC,SAAS,IAAKlI,OAAOqJ,oBAAoBrJ,OAAOC;AAC1D,mBAAA,IAAWgI,UAAU,QAAQ;gBAC3B,OAAOqB;AACT;YACA,OAAOpB,OAAOgB,WAAWjB,OAAO;AAClC;QAEA,IAAMsB,yBAAyB;QAE/B,SAASC,mBAAoB5C,QAAQ/C;YACnC,IAAI4F,MAAM7C,SAAS;gBACjB,QAAQ/C;kBACN,KAAK;oBAAa,OAAO;;kBACzB,KAAK;oBAAa,OAAO;;kBACzB,KAAK;oBAAa,OAAO;;AAE7B,mBAAA,IAAW7D,OAAOqJ,sBAAsBzC,QAAQ;gBAC9C,QAAQ/C;kBACN,KAAK;oBAAa,OAAO;;kBACzB,KAAK;oBAAa,OAAO;;kBACzB,KAAK;oBAAa,OAAO;;AAE7B,mBAAA,IAAW7D,OAAOC,sBAAsB2G,QAAQ;gBAC9C,QAAQ/C;kBACN,KAAK;oBAAa,OAAO;;kBACzB,KAAK;oBAAa,OAAO;;kBACzB,KAAK;oBAAa,OAAO;;uBAElB3D,QAAOJ,eAAe8G,SAAS;gBACxC,OAAO;AACT;YAEA,IAAM8C,MAAM9C,OAAOvF,SAAS;YAK5B,OAAOkI,uBAAuBN,KAAKS,OAAOA,IAAItH,QAAQ,KAAK,QAAQsH;AACrE;QAEA,SAASC,QAAS/C;YAChB,OAAQxH,OAAOZ,UAAU6C,SAASL,KAAK4F,YAAY,sBAC3CA,SAAS,MAAM,KAAK1G,QAAOJ,eAAe8G;AACpD;QAEAgD,QAAiB,IAAI5F,MAAK,2BAA2B;YACnDG,MAAM;YACNC,SAAS4E;YACT3E,WAAW8E;YACX3E,WAAWmF;YACXlF,WAAW+E;YACX7E,cAAc;;;;;;;;;QCxFhBkF,OAAiBvI,kBAAsBtC,OAAO;YAC5C8G,UAAU,EACRf,gBACAwB,eACAC,cACAsD;;;;;;;;;QCNJC,OAAiBzI;;;;;;;;QCNjB,IAAM0C,QAAO1C;QAEb,IAAM0I,mBAAmB,IAAIlB,OAC3B;QAIF,IAAMmB,wBAAwB,IAAInB,OAChC;QAWF,SAASoB,qBAAsB5F;YAC7B,IAAIA,SAAS,MAAM,OAAO;YAC1B,IAAI0F,iBAAiB7G,KAAKmB,UAAU,MAAM,OAAO;YACjD,IAAI2F,sBAAsB9G,KAAKmB,UAAU,MAAM,OAAO;YACtD,OAAO;AACT;QAEA,SAAS6F,uBAAwB7F;YAC/B,IAAI8F,WAAW;YACf,IAAIC,QAAQ;YAEZ,IAAIpH,QAAQ+G,iBAAiB7G,KAAKmB;YAClC,IAAIrB,UAAU,MAAMA,QAAQgH,sBAAsB9G,KAAKmB;YAEvD,IAAIrB,UAAU,MAAM,MAAM,IAAIlC,MAAM;YAIpC,IAAMuJ,QAASrH,MAAM;YACrB,IAAMsH,SAAUtH,MAAM,KAAM;YAC5B,IAAMuH,OAAQvH,MAAM;YAEpB,KAAKA,MAAM,IAAI;gBACb,OAAO,IAAIwH,KAAKA,KAAKC,IAAIJ,MAAMC,OAAOC;AACxC;YAIA,IAAMG,QAAS1H,MAAM;YACrB,IAAM2H,UAAW3H,MAAM;YACvB,IAAM4H,UAAW5H,MAAM;YAEvB,IAAIA,MAAM,IAAI;gBACZmH,WAAWnH,MAAM,GAAGd,MAAM,GAAG;gBAC7B,OAAOiI,SAAS7K,SAAS,GAAG;oBAC1B6K,YAAY;AACd;gBACAA,YAAYA;AACd;YAIA,IAAInH,MAAM,IAAI;gBACZ,IAAM6H,UAAW7H,MAAM;gBACvB,IAAM8H,aAAa9H,MAAM,OAAO;gBAChCoH,SAASS,SAAS,KAAKC,YAAY;gBACnC,IAAI9H,MAAM,OAAO,cAAcoH;AACjC;YAEA,IAAMW,OAAO,IAAIP,KAAKA,KAAKC,IAAIJ,MAAMC,OAAOC,KAAKG,MAAMC,QAAQC,QAAQT;YAEvE,IAAIC,OAAOW,KAAKC,QAAQD,KAAKE,YAAYb;YAEzC,OAAOW;AACT;QAEA,SAASG,uBAAwBvE;YAC/B,OAAOA,OAAOwE;AAChB;QAEAC,YAAiB,IAAIrH,MAAK,+BAA+B;YACvDG,MAAM;YACNC,SAAS8F;YACT7F,WAAW8F;YACX5F,YAAYkG;YACZhG,WAAW0G;;;;;;;;;QCpFb,IAAMnH,QAAO1C;QAEb,SAASgK,iBAAkBhH;YACzB,OAAOA,SAAS,QAAQA,SAAS;AACnC;QAEAiH,QAAiB,IAAIvH,MAAK,2BAA2B;YACnDG,MAAM;YACNC,SAASkH;;;;;;;;;QCRX,IAAMtH,QAAO1C;QAGb,IAAMkK,aAAa;QAEnB,SAASC,kBAAmBnH;YAC1B,IAAIA,SAAS,MAAM,OAAO;YAE1B,IAAIoH,SAAS;YACb,IAAMnJ,MAAM+B,KAAK/E;YACjB,IAAMoE,OAAM6H;YAGZ,KAAA,IAASG,MAAM,GAAGA,MAAMpJ,KAAKoJ,OAAO;gBAClC,IAAMC,OAAOjI,KAAIO,QAAQI,KAAKuH,OAAOF;gBAGrC,IAAIC,OAAO,IAAI;gBAGf,IAAIA,OAAO,GAAG,OAAO;gBAErBF,UAAU;AACZ;YAGA,OAAQA,SAAS,MAAO;AAC1B;QAEA,SAASI,oBAAqBxH;YAC5B,IAAMyH,QAAQzH,KAAKlC,QAAQ,YAAY;YACvC,IAAMG,MAAMwJ,MAAMxM;YAClB,IAAMoE,OAAM6H;YACZ,IAAIQ,OAAO;YACX,IAAMpM,SAAS;YAIf,KAAA,IAAS+L,MAAM,GAAGA,MAAMpJ,KAAKoJ,OAAO;gBAClC,IAAKA,MAAM,MAAM,KAAMA,KAAK;oBAC1B/L,OAAOwD,KAAM4I,QAAQ,KAAM;oBAC3BpM,OAAOwD,KAAM4I,QAAQ,IAAK;oBAC1BpM,OAAOwD,KAAK4I,OAAO;AACrB;gBAEAA,OAAQA,QAAQ,IAAKrI,KAAIO,QAAQ6H,MAAMF,OAAOF;AAChD;YAIA,IAAMM,WAAY1J,MAAM,IAAK;YAE7B,IAAI0J,aAAa,GAAG;gBAClBrM,OAAOwD,KAAM4I,QAAQ,KAAM;gBAC3BpM,OAAOwD,KAAM4I,QAAQ,IAAK;gBAC1BpM,OAAOwD,KAAK4I,OAAO;AACrB,mBAAA,IAAWC,aAAa,IAAI;gBAC1BrM,OAAOwD,KAAM4I,QAAQ,KAAM;gBAC3BpM,OAAOwD,KAAM4I,QAAQ,IAAK;AAC5B,mBAAA,IAAWC,aAAa,IAAI;gBAC1BrM,OAAOwD,KAAM4I,QAAQ,IAAK;AAC5B;YAEA,OAAO,IAAIE,WAAWtM;AACxB;QAEA,SAASuM,oBAAqBvF;YAC5B,IAAIhH,SAAS;YACb,IAAIoM,OAAO;YACX,IAAMzJ,MAAMqE,OAAOrH;YACnB,IAAMoE,OAAM6H;YAIZ,KAAA,IAASG,MAAM,GAAGA,MAAMpJ,KAAKoJ,OAAO;gBAClC,IAAKA,MAAM,MAAM,KAAMA,KAAK;oBAC1B/L,UAAU+D,KAAKqI,QAAQ,KAAM;oBAC7BpM,UAAU+D,KAAKqI,QAAQ,KAAM;oBAC7BpM,UAAU+D,KAAKqI,QAAQ,IAAK;oBAC5BpM,UAAU+D,KAAIqI,OAAO;AACvB;gBAEAA,QAAQA,QAAQ,KAAKpF,OAAO+E;AAC9B;YAIA,IAAM7J,OAAOS,MAAM;YAEnB,IAAIT,SAAS,GAAG;gBACdlC,UAAU+D,KAAKqI,QAAQ,KAAM;gBAC7BpM,UAAU+D,KAAKqI,QAAQ,KAAM;gBAC7BpM,UAAU+D,KAAKqI,QAAQ,IAAK;gBAC5BpM,UAAU+D,KAAIqI,OAAO;AACvB,mBAAA,IAAWlK,SAAS,GAAG;gBACrBlC,UAAU+D,KAAKqI,QAAQ,KAAM;gBAC7BpM,UAAU+D,KAAKqI,QAAQ,IAAK;gBAC5BpM,UAAU+D,KAAKqI,QAAQ,IAAK;gBAC5BpM,UAAU+D,KAAI;AAChB,mBAAA,IAAW7B,SAAS,GAAG;gBACrBlC,UAAU+D,KAAKqI,QAAQ,IAAK;gBAC5BpM,UAAU+D,KAAKqI,QAAQ,IAAK;gBAC5BpM,UAAU+D,KAAI;gBACd/D,UAAU+D,KAAI;AAChB;YAEA,OAAO/D;AACT;QAEA,SAASwM,SAAU5D;YACjB,OAAOpJ,OAAOZ,UAAU6C,SAASL,KAAKwH,SAAS;AACjD;QAEAD,SAAiB,IAAIvE,MAAK,4BAA4B;YACpDG,MAAM;YACNC,SAASqH;YACTpH,WAAWyH;YACXtH,WAAW4H;YACX3H,WAAW0H;;;;;;;;;QCtHb,IAAMnI,QAAO1C;QAEb,IAAM+K,kBAAkBjN,OAAOZ,UAAU8N;QACzC,IAAMC,YAAYnN,OAAOZ,UAAU6C;QAEnC,SAASmL,gBAAiBlI;YACxB,IAAIA,SAAS,MAAM,OAAO;YAE1B,IAAMmI,aAAa;YACnB,IAAM7F,SAAStC;YAEf,KAAA,IAAShF,QAAQ,GAAGC,SAASqH,OAAOrH,QAAQD,QAAQC,QAAQD,SAAS,GAAG;gBACtE,IAAMoN,OAAO9F,OAAOtH;gBACpB,IAAIqN,aAAa;gBAEjB,IAAIJ,UAAUvL,KAAK0L,UAAU,mBAAmB,OAAO;gBAEvD,IAAIE,eAAO;gBACX,KAAKA,WAAWF,MAAM;oBACpB,IAAIL,gBAAgBrL,KAAK0L,MAAME,UAAU;wBACvC,KAAKD,YAAYA,aAAa,WACzB,OAAO;AACd;AACF;gBAEA,KAAKA,YAAY,OAAO;gBAExB,IAAIF,WAAWvI,QAAQ0I,cAAa,GAAIH,WAAWrJ,KAAKwJ,eACnD,OAAO;AACd;YAEA,OAAO;AACT;QAEA,SAASC,kBAAmBvI;YAC1B,OAAOA,SAAS,OAAOA,OAAO;AAChC;QAEAwI,OAAiB,IAAI9I,MAAK,0BAA0B;YAClDG,MAAM;YACNC,SAASoI;YACTnI,WAAWwI;;;;;;;;;QCzCb,IAAM7I,QAAO1C;QAEb,IAAMiL,YAAYnN,OAAOZ,UAAU6C;QAEnC,SAAS0L,iBAAkBzI;YACzB,IAAIA,SAAS,MAAM,OAAO;YAE1B,IAAMsC,SAAStC;YAEf,IAAM1E,SAAS,IAAId,MAAM8H,OAAOrH;YAEhC,KAAA,IAASD,QAAQ,GAAGC,SAASqH,OAAOrH,QAAQD,QAAQC,QAAQD,SAAS,GAAG;gBACtE,IAAMoN,OAAO9F,OAAOtH;gBAEpB,IAAIiN,UAAUvL,KAAK0L,UAAU,mBAAmB,OAAO;gBAEvD,IAAMrN,OAAOD,OAAOC,KAAKqN;gBAEzB,IAAIrN,KAAKE,WAAW,GAAG,OAAO;gBAE9BK,OAAON,SAAS,EAACD,KAAK,IAAIqN,KAAKrN,KAAK;AACtC;YAEA,OAAO;AACT;QAEA,SAAS2N,mBAAoB1I;YAC3B,IAAIA,SAAS,MAAM,OAAO;YAE1B,IAAMsC,SAAStC;YACf,IAAM1E,SAAS,IAAId,MAAM8H,OAAOrH;YAEhC,KAAA,IAASD,QAAQ,GAAGC,SAASqH,OAAOrH,QAAQD,QAAQC,QAAQD,SAAS,GAAG;gBACtE,IAAMoN,OAAO9F,OAAOtH;gBAEpB,IAAMD,OAAOD,OAAOC,KAAKqN;gBAEzB9M,OAAON,SAAS,EAACD,KAAK,IAAIqN,KAAKrN,KAAK;AACtC;YAEA,OAAOO;AACT;QAEAqN,QAAiB,IAAIjJ,MAAK,2BAA2B;YACnDG,MAAM;YACNC,SAAS2I;YACT1I,WAAW2I;;;;;;;;;QC9Cb,IAAMhJ,QAAO1C;QAEb,IAAM+K,kBAAkBjN,OAAOZ,UAAU8N;QAEzC,SAASY,eAAgB5I;YACvB,IAAIA,SAAS,MAAM,OAAO;YAE1B,IAAMsC,SAAStC;YAEf,KAAA,IAAW9E,OAAOoH,QAAQ;gBACxB,IAAIyF,gBAAgBrL,KAAK4F,QAAQpH,MAAM;oBACrC,IAAIoH,OAAOpH,SAAS,MAAM,OAAO;AACnC;AACF;YAEA,OAAO;AACT;QAEA,SAAS2N,iBAAkB7I;YACzB,OAAOA,SAAS,OAAOA,OAAO,CAAA;AAChC;QAEA8I,MAAiB,IAAIpJ,MAAK,yBAAyB;YACjDG,MAAM;YACNC,SAAS8I;YACT7I,WAAW8I;;;;;;;;;QCnBbE,WAAiB/L,cAAkBtC,OAAO;YACxC8G,UAAU,EACRf,oBACAwB;YAEFR,UAAU,EACRS,iBACAsD,eACAwD,gBACAC;;;;;;;;QCjBQ,SAAApP,QAAAC;YAAA;YAAA,OAAAD,UAAA,qBAAAE,UAAA,mBAAAA,OAAAC,WAAA,SAAAF;gBAAA,cAAAA;gBAAA,SAAAA;gBAAA,OAAAA,MAAA,qBAAAC,UAAAD,GAAAG,gBAAAF,UAAAD,OAAAC,OAAAG,YAAA,kBAAAJ;AAAA,eAAAD,QAAAC;AAAA;QAEZ,IAAM8B,UAASoB;QACf,IAAMR,iBAAgBiE;QACtB,IAAMvC,cAAc+D;QACpB,IAAMiH,kBAAiBhH;QAEvB,IAAM6F,kBAAkBjN,OAAOZ,UAAU8N;QAEzC,IAAMmB,kBAAkB;QACxB,IAAMC,mBAAmB;QACzB,IAAMC,mBAAmB;QACzB,IAAMC,oBAAoB;QAE1B,IAAMC,gBAAgB;QACtB,IAAMC,iBAAiB;QACvB,IAAMC,gBAAgB;QAGtB,IAAMC,wBAAwB;QAC9B,IAAMC,gCAAgC;QAEtC,IAAMC,0BAA0B;QAEhC,IAAMC,qBAAqB;QAE3B,IAAMC,kBAAkB;QAExB,SAASC,OAAQ7F;YAAO,OAAOpJ,OAAOZ,UAAU6C,SAASL,KAAKwH;AAAK;QAEnE,SAAS8F,MAAO9G;YACd,OAAQA,MAAM,MAAkBA,MAAM;AACxC;QAEA,SAAS+G,aAAc/G;YACrB,OAAQA,MAAM,KAAmBA,MAAM;AACzC;QAEA,SAASgH,UAAWhH;YAClB,OAAQA,MAAM,KACNA,MAAM,MACNA,MAAM,MACNA,MAAM;AAChB;QAEA,SAASiH,gBAAiBjH;YACxB,OAAOA,MAAM,MACNA,MAAM,MACNA,MAAM,MACNA,MAAM,OACNA,MAAM;AACf;QAEA,SAASkH,YAAalH;YACpB,IAAKA,KAAK,MAAiBA,KAAK,IAAc;gBAC5C,OAAOA,IAAI;AACb;YAEA,IAAMmH,KAAKnH,IAAI;YAEf,IAAKmH,MAAM,MAAiBA,MAAM,KAAc;gBAC9C,OAAOA,KAAK,KAAO;AACrB;YAEA,QAAO;AACT;QAEA,SAASC,cAAepH;YACtB,IAAIA,MAAM,KAAa;gBAAE,OAAO;AAAE;YAClC,IAAIA,MAAM,KAAa;gBAAE,OAAO;AAAE;YAClC,IAAIA,MAAM,IAAa;gBAAE,OAAO;AAAE;YAClC,OAAO;AACT;QAEA,SAASqH,gBAAiBrH;YACxB,IAAKA,KAAK,MAAiBA,KAAK,IAAc;gBAC5C,OAAOA,IAAI;AACb;YAEA,QAAO;AACT;QAEA,SAASsH,qBAAsBtH;YAC7B,QAAQA;cACN,KAAK;gBAAa,OAAO;;cACzB,KAAK;gBAAa,OAAO;;cACzB,KAAK;gBAAa,OAAO;;cACzB,KAAK;gBAAa,OAAO;;cACzB,KAAK;gBAAe,OAAO;;cAC3B,KAAK;gBAAa,OAAO;;cACzB,KAAK;gBAAa,OAAO;;cACzB,KAAK;gBAAa,OAAO;;cACzB,KAAK;gBAAa,OAAO;;cACzB,KAAK;gBAAa,OAAO;;cACzB,KAAK;gBAAiB,OAAO;;cAC7B,KAAK;gBAAa,OAAO;;cACzB,KAAK;gBAAa,OAAO;;cACzB,KAAK;gBAAa,OAAO;;cACzB,KAAK;gBAAa,OAAO;;cACzB,KAAK;gBAAa,OAAO;;cACzB,KAAK;gBAAa,OAAO;;cACzB,KAAK;gBAAa,OAAO;;cACzB;gBAAS,OAAO;;AAEpB;QAEA,SAASuH,kBAAmBvH;YAC1B,IAAIA,KAAK,OAAQ;gBACf,OAAOzD,OAAOiL,aAAaxH;AAC7B;YAGA,OAAOzD,OAAOiL,cACVxH,IAAI,SAAa,MAAM,QACvBA,IAAI,QAAY,QAAU;AAEhC;QAIA,SAASyH,YAAarI,QAAQpH,KAAKyI;YAEjC,IAAIzI,QAAQ,aAAa;gBACvBJ,OAAO8P,eAAetI,QAAQpH,KAAK;oBACjC2P,cAAc;oBACdC,YAAY;oBACZC,UAAU;oBACVpH;;AAEJ,mBAAO;gBACLrB,OAAOpH,OAAOyI;AAChB;AACF;QAEA,IAAMqH,oBAAoB,IAAIxQ,MAAM;QACpC,IAAMyQ,kBAAkB,IAAIzQ,MAAM;QAClC,KAAA,IAASyE,IAAI,GAAGA,IAAI,KAAKA,KAAK;YAC5B+L,kBAAkB/L,KAAKuL,qBAAqBvL,KAAK,IAAI;YACrDgM,gBAAgBhM,KAAKuL,qBAAqBvL;AAC5C;QAEA,SAASiM,MAAOzD,OAAOtJ;YACrBxB,KAAK8K,QAAQA;YAEb9K,KAAKwO,WAAWhN,QAAQ,eAAe;YACvCxB,KAAKgE,SAASxC,QAAQ,aAAa+K;YACnCvM,KAAKyO,YAAYjN,QAAQ,gBAAgB;YAGzCxB,KAAK0O,SAASlN,QAAQ,aAAa;YAEnCxB,KAAK4I,OAAOpH,QAAQ,WAAW;YAC/BxB,KAAK2O,WAAWnN,QAAQ,eAAe;YACvCxB,KAAK4O,kBAAkBpN,QAAQ,gBAAgB,WAAWA,QAAQ,cAAc;YAChFxB,KAAK6O,2BAA2BrN,QAAQ,yBAAyB,WAAWA,QAAQ,uBAAuB;YAE3GxB,KAAK8O,gBAAgB9O,KAAKgE,OAAOiB;YACjCjF,KAAK+O,UAAU/O,KAAKgE,OAAOmB;YAE3BnF,KAAK1B,SAASwM,MAAMxM;YACpB0B,KAAKU,WAAW;YAChBV,KAAKN,OAAO;YACZM,KAAKQ,YAAY;YACjBR,KAAKgP,aAAa;YAClBhP,KAAKiP,QAAQ;YACbjP,KAAKkP,iBAAiB;YAItBlP,KAAKmP,kBAAiB;YAEtBnP,KAAKoP,YAAY;YACjBpP,KAAKqP,wBAAwB;AAW/B;QAEA,SAASC,cAAeC,OAAOjQ;YAC7B,IAAME,OAAO;gBACXC,MAAM8P,MAAMf;gBACZjO,QAAQgP,MAAMzE,MAAM5J,MAAM,IAAG;gBAC7BR,UAAU6O,MAAM7O;gBAChBhB,MAAM6P,MAAM7P;gBACZC,QAAQ4P,MAAM7O,WAAW6O,MAAM/O;;YAGjChB,KAAKI,UAAU2B,YAAY/B;YAE3B,OAAO,IAAIK,eAAcP,SAASE;AACpC;QAEA,SAASgQ,WAAYD,OAAOjQ;YAC1B,MAAMgQ,cAAcC,OAAOjQ;AAC7B;QAEA,SAASmQ,aAAcF,OAAOjQ;YAC5B,IAAIiQ,MAAMd,WAAW;gBACnBc,MAAMd,UAAU1O,KAAK,MAAMuP,cAAcC,OAAOjQ;AAClD;AACF;QAEA,SAASoQ,YAAaH,OAAO9P,MAAMuH;YACjC,IAAM2I,eAAeJ,MAAMF;YAE3B,IAAIM,aAAarR,WAAW,GAAG;gBAC7B,IAAMsR,cAAcD,aAAaA,aAAarR,SAAS;gBAEvD,KAAK8M,gBAAgBrL,KAAK6P,aAAanQ,OAAO;oBAC5CmQ,YAAYnQ,QAAQ;wBAClBoQ,SAASzE,gBAAgBrL,KAAKwP,MAAMO,WAAWrQ;wBAC/CuH,OAAOuI,MAAMO,UAAUrQ;;AAE3B;AACF;YAEA8P,MAAMO,UAAUrQ,QAAQuH;AAC1B;QAEA,SAAS+I,uBAAwBR;YAC/BA,MAAMF,sBAAsBlN,KAAKhE,OAAOgC,OAAO;AACjD;QAEA,SAAS6P,wBAAyBT;YAChC,IAAMK,cAAcL,MAAMF,sBAAsBY;YAChD,IAAMN,eAAeJ,MAAMF;YAE3B,IAAIM,aAAarR,WAAW,GAAG;YAE/B,IAAM4R,SAASP,aAAaA,aAAarR,SAAS;YAClD,IAAM6R,QAAQhS,OAAOC,KAAKwR;YAE1B,KAAA,IAASvR,QAAQ,GAAGC,SAAS6R,MAAM7R,QAAQD,QAAQC,QAAQD,SAAS,GAAG;gBACrE,IAAMoB,OAAO0Q,MAAM9R;gBAEnB,KAAK+M,gBAAgBrL,KAAKmQ,QAAQzQ,OAAO;oBACvCyQ,OAAOzQ,QAAQmQ,YAAYnQ;AAC7B;AACF;AACF;QAEA,SAAS2Q,0BAA2Bb;YAClC,IAAMK,cAAcL,MAAMF,sBAAsBY;YAChD,IAAME,QAAQhS,OAAOC,KAAKwR;YAE1B,KAAA,IAASvR,QAAQ8R,MAAM7R,SAAS,GAAGD,SAAS,GAAGA,SAAS,GAAG;gBACzD,IAAMgS,QAAQT,YAAYO,MAAM9R;gBAEhC,IAAIgS,MAAMR,SAAS;oBACjBN,MAAMO,UAAUK,MAAM9R,UAAUgS,MAAMrJ;AACxC,uBAAO;2BACEuI,MAAMO,UAAUK,MAAM9R;AAC/B;AACF;AACF;QAEA,SAASiS,cAAef;YACtB,OAAO;gBACL7O,UAAU6O,MAAM7O;gBAChBhB,MAAM6P,MAAM7P;gBACZc,WAAW+O,MAAM/O;gBACjBwO,YAAYO,MAAMP;gBAClBG,gBAAgBI,MAAMJ;gBACtBnM,KAAKuM,MAAMvM;gBACXuN,QAAQhB,MAAMgB;gBACdrN,MAAMqM,MAAMrM;gBACZvE,QAAQ4Q,MAAM5Q;;AAElB;QAEA,SAAS6R,aAAcjB,OAAOkB;YAC5BlB,MAAM7O,WAAW+P,SAAS/P;YAC1B6O,MAAM7P,OAAO+Q,SAAS/Q;YACtB6P,MAAM/O,YAAYiQ,SAASjQ;YAC3B+O,MAAMP,aAAayB,SAASzB;YAC5BO,MAAMJ,iBAAiBsB,SAAStB;YAChCI,MAAMvM,MAAMyN,SAASzN;YACrBuM,MAAMgB,SAASE,SAASF;YACxBhB,MAAMrM,OAAOuN,SAASvN;YACtBqM,MAAM5Q,SAAS8R,SAAS9R;AAC1B;QAEA,IAAM+R,oBAAoB;YAExBC,MAAM,SAASC,oBAAqBrB,OAAO9P,MAAMoR;gBAC/C,IAAItB,MAAMuB,YAAY,MAAM;oBAC1BtB,WAAWD,OAAO;AACpB;gBAEA,IAAIsB,KAAKvS,WAAW,GAAG;oBACrBkR,WAAWD,OAAO;AACpB;gBAEA,IAAMvN,QAAQ,uBAAuBE,KAAK2O,KAAK;gBAE/C,IAAI7O,UAAU,MAAM;oBAClBwN,WAAWD,OAAO;AACpB;gBAEA,IAAMwB,QAAQ7J,SAASlF,MAAM,IAAI;gBACjC,IAAMgP,QAAQ9J,SAASlF,MAAM,IAAI;gBAEjC,IAAI+O,UAAU,GAAG;oBACfvB,WAAWD,OAAO;AACpB;gBAEAA,MAAMuB,UAAUD,KAAK;gBACrBtB,MAAM0B,kBAAmBD,QAAQ;gBAEjC,IAAIA,UAAU,KAAKA,UAAU,GAAG;oBAC9BvB,aAAaF,OAAO;AACtB;;YAGF2B,KAAK,SAASC,mBAAoB5B,OAAO9P,MAAMoR;gBAC7C,IAAIO;gBAEJ,IAAIP,KAAKvS,WAAW,GAAG;oBACrBkR,WAAWD,OAAO;AACpB;gBAEA,IAAM8B,SAASR,KAAK;gBACpBO,SAASP,KAAK;gBAEd,KAAK3D,mBAAmBlF,KAAKqJ,SAAS;oBACpC7B,WAAWD,OAAO;AACpB;gBAEA,IAAInE,gBAAgBrL,KAAKwP,MAAM+B,QAAQD,SAAS;oBAC9C7B,WAAWD,OAAO,gDAAgD8B,SAAS;AAC7E;gBAEA,KAAKlE,gBAAgBnF,KAAKoJ,SAAS;oBACjC5B,WAAWD,OAAO;AACpB;gBAEA;oBACE6B,SAASG,mBAAmBH;yBACrBI;oBACPhC,WAAWD,OAAO,8BAA8B6B;AAClD;gBAEA7B,MAAM+B,OAAOD,UAAUD;AACzB;;QAGF,SAASK,eAAgBlC,OAAOmC,OAAOC,KAAKC;YAC1C,IAAIF,QAAQC,KAAK;gBACf,IAAME,UAAUtC,MAAMzE,MAAM5J,MAAMwQ,OAAOC;gBAEzC,IAAIC,WAAW;oBACb,KAAA,IAASE,YAAY,GAAGC,UAAUF,QAAQvT,QAAQwT,YAAYC,SAASD,aAAa,GAAG;wBACrF,IAAME,aAAaH,QAAQ9K,WAAW+K;wBACtC,MAAME,eAAe,KACdA,cAAc,MAAQA,cAAc,UAAY;4BACrDxC,WAAWD,OAAO;AACpB;AACF;2BACSxC,sBAAsB/E,KAAK6J,UAAU;oBAC9CrC,WAAWD,OAAO;AACpB;gBAEAA,MAAM5Q,UAAUkT;AAClB;AACF;QAEA,SAASI,cAAe1C,OAAO2C,aAAajU,QAAQkU;YAClD,KAAKlT,QAAOvB,SAASO,SAAS;gBAC5BuR,WAAWD,OAAO;AACpB;YAEA,IAAMrR,aAAaC,OAAOC,KAAKH;YAE/B,KAAA,IAASI,QAAQ,GAAG+T,WAAWlU,WAAWI,QAAQD,QAAQ+T,UAAU/T,SAAS,GAAG;gBAC9E,IAAME,MAAML,WAAWG;gBAEvB,IAAIkR,MAAMV,uBAAsB,OAAQU,MAAML,iBAAiBK,MAAMV,mBAAmB;oBACtFW,WAAWD,OAAO,4CAA4CA,MAAMV,oBAAoB;AAC1F;gBAEA,KAAKzD,gBAAgBrL,KAAKmS,aAAa3T,MAAM;oBAC3CyP,YAAYkE,aAAa3T,KAAKN,OAAOM;oBACrC4T,gBAAgB5T,OAAO;AACzB;AACF;AACF;QAEA,SAAS8T,iBAAkB9C,OAAOsC,SAASM,iBAAiBG,QAAQC,SAASC,WAC3EC,WAAWC,gBAAgBC;YAI3B,IAAI9U,MAAMC,QAAQyU,UAAU;gBAC1BA,UAAU1U,MAAMN,UAAU2D,MAAMnB,KAAKwS;gBAErC,KAAA,IAASlU,QAAQ,GAAG+T,WAAWG,QAAQjU,QAAQD,QAAQ+T,UAAU/T,SAAS,GAAG;oBAC3E,IAAIR,MAAMC,QAAQyU,QAAQlU,SAAS;wBACjCmR,WAAWD,OAAO;AACpB;oBAEA,IAAIrS,QAAOqV,aAAY,YAAYnF,OAAOmF,QAAQlU,YAAY,mBAAmB;wBAC/EkU,QAAQlU,SAAS;AACnB;AACF;AACF;YAKA,IAAInB,QAAOqV,aAAY,YAAYnF,OAAOmF,aAAa,mBAAmB;gBACxEA,UAAU;AACZ;YAEAA,UAAUzP,OAAOyP;YAEjB,IAAIV,YAAY,MAAM;gBACpBA,UAAU,CAAA;AACZ;YAEA,IAAIS,WAAW,2BAA2B;gBACxC,IAAIzU,MAAMC,QAAQ0U,YAAY;oBAC5B,KAAA,IAASnU,SAAQ,GAAG+T,YAAWI,UAAUlU,QAAQD,SAAQ+T,WAAU/T,UAAS,GAAG;wBAC7E4T,cAAc1C,OAAOsC,SAASW,UAAUnU,SAAQ8T;AAClD;AACF,uBAAO;oBACLF,cAAc1C,OAAOsC,SAASW,WAAWL;AAC3C;AACF,mBAAO;gBACL,KAAK5C,MAAM3G,SACNwC,gBAAgBrL,KAAKoS,iBAAiBI,YACvCnH,gBAAgBrL,KAAK8R,SAASU,UAAU;oBAC1ChD,MAAM7P,OAAO+S,aAAalD,MAAM7P;oBAChC6P,MAAM/O,YAAYkS,kBAAkBnD,MAAM/O;oBAC1C+O,MAAM7O,WAAWiS,YAAYpD,MAAM7O;oBACnC8O,WAAWD,OAAO;AACpB;gBAEAvB,YAAY6D,SAASU,SAASC;uBACvBL,gBAAgBI;AACzB;YAEA,OAAOV;AACT;QAEA,SAASe,cAAerD;YACtB,IAAM3I,KAAK2I,MAAMzE,MAAM/D,WAAWwI,MAAM7O;YAExC,IAAIkG,OAAO,IAAc;gBACvB2I,MAAM7O;AACR,mBAAA,IAAWkG,OAAO,IAAc;gBAC9B2I,MAAM7O;gBACN,IAAI6O,MAAMzE,MAAM/D,WAAWwI,MAAM7O,cAAc,IAAc;oBAC3D6O,MAAM7O;AACR;AACF,mBAAO;gBACL8O,WAAWD,OAAO;AACpB;YAEAA,MAAM7P,QAAQ;YACd6P,MAAM/O,YAAY+O,MAAM7O;YACxB6O,MAAMJ,kBAAiB;AACzB;QAEA,SAAS0D,oBAAqBtD,OAAOuD,eAAeC;YAClD,IAAIC,aAAa;YACjB,IAAIpM,KAAK2I,MAAMzE,MAAM/D,WAAWwI,MAAM7O;YAEtC,OAAOkG,OAAO,GAAG;gBACf,OAAO0G,aAAa1G,KAAK;oBACvB,IAAIA,OAAO,KAAiB2I,MAAMJ,oBAAmB,GAAI;wBACvDI,MAAMJ,iBAAiBI,MAAM7O;AAC/B;oBACAkG,KAAK2I,MAAMzE,MAAM/D,aAAawI,MAAM7O;AACtC;gBAEA,IAAIoS,iBAAiBlM,OAAO,IAAa;oBACvC,GAAG;wBACDA,KAAK2I,MAAMzE,MAAM/D,aAAawI,MAAM7O;6BAC7BkG,OAAO,MAAgBA,OAAO,MAAgBA,OAAO;AAChE;gBAEA,IAAIyG,MAAMzG,KAAK;oBACbgM,cAAcrD;oBAEd3I,KAAK2I,MAAMzE,MAAM/D,WAAWwI,MAAM7O;oBAClCsS;oBACAzD,MAAMP,aAAa;oBAEnB,OAAOpI,OAAO,IAAiB;wBAC7B2I,MAAMP;wBACNpI,KAAK2I,MAAMzE,MAAM/D,aAAawI,MAAM7O;AACtC;AACF,uBAAO;oBACL;AACF;AACF;YAEA,IAAIqS,iBAAgB,KAAMC,eAAe,KAAKzD,MAAMP,aAAa+D,aAAa;gBAC5EtD,aAAaF,OAAO;AACtB;YAEA,OAAOyD;AACT;QAEA,SAASC,sBAAuB1D;YAC9B,IAAIuC,YAAYvC,MAAM7O;YACtB,IAAIkG,KAAK2I,MAAMzE,MAAM/D,WAAW+K;YAIhC,KAAKlL,OAAO,MAAeA,OAAO,OAC9BA,OAAO2I,MAAMzE,MAAM/D,WAAW+K,YAAY,MAC1ClL,OAAO2I,MAAMzE,MAAM/D,WAAW+K,YAAY,IAAI;gBAChDA,aAAa;gBAEblL,KAAK2I,MAAMzE,MAAM/D,WAAW+K;gBAE5B,IAAIlL,OAAO,KAAK2G,UAAU3G,KAAK;oBAC7B,OAAO;AACT;AACF;YAEA,OAAO;AACT;QAEA,SAASsM,iBAAkB3D,OAAO7Q;YAChC,IAAIA,UAAU,GAAG;gBACf6Q,MAAM5Q,UAAU;AAClB,mBAAA,IAAWD,QAAQ,GAAG;gBACpB6Q,MAAM5Q,UAAUM,QAAOT,OAAO,MAAME,QAAQ;AAC9C;AACF;QAEA,SAASyU,gBAAiB5D,OAAO6D,YAAYC;YAC3C,IAAIC;YACJ,IAAIC;YACJ,IAAIC;YACJ,IAAIC;YACJ,IAAIC;YACJ,IAAIC;YACJ,IAAMC,QAAQrE,MAAMrM;YACpB,IAAM2O,UAAUtC,MAAM5Q;YAEtB,IAAIiI,KAAK2I,MAAMzE,MAAM/D,WAAWwI,MAAM7O;YAEtC,IAAI6M,UAAU3G,OACV4G,gBAAgB5G,OAChBA,OAAO,MACPA,OAAO,MACPA,OAAO,MACPA,OAAO,MACPA,OAAO,OACPA,OAAO,MACPA,OAAO,MACPA,OAAO,MACPA,OAAO,MACPA,OAAO,MACPA,OAAO,IAAa;gBACtB,OAAO;AACT;YAEA,IAAIA,OAAO,MAAeA,OAAO,IAAa;gBAC5C,IAAMiN,YAAYtE,MAAMzE,MAAM/D,WAAWwI,MAAM7O,WAAW;gBAE1D,IAAI6M,UAAUsG,cACTR,wBAAwB7F,gBAAgBqG,YAAa;oBACxD,OAAO;AACT;AACF;YAEAtE,MAAMrM,OAAO;YACbqM,MAAM5Q,SAAS;YACf2U,eAAeC,aAAahE,MAAM7O;YAClC8S,oBAAoB;YAEpB,OAAO5M,OAAO,GAAG;gBACf,IAAIA,OAAO,IAAa;oBACtB,IAAMiN,aAAYtE,MAAMzE,MAAM/D,WAAWwI,MAAM7O,WAAW;oBAE1D,IAAI6M,UAAUsG,eACTR,wBAAwB7F,gBAAgBqG,aAAa;wBACxD;AACF;AACF,uBAAA,IAAWjN,OAAO,IAAa;oBAC7B,IAAMkN,YAAYvE,MAAMzE,MAAM/D,WAAWwI,MAAM7O,WAAW;oBAE1D,IAAI6M,UAAUuG,YAAY;wBACxB;AACF;2BACUvE,MAAM7O,aAAa6O,MAAM/O,aAAayS,sBAAsB1D,UAC5D8D,wBAAwB7F,gBAAgB5G,KAAM;oBACxD;AACF,uBAAA,IAAWyG,MAAMzG,KAAK;oBACpB6M,QAAQlE,MAAM7P;oBACdgU,aAAanE,MAAM/O;oBACnBmT,cAAcpE,MAAMP;oBACpB6D,oBAAoBtD,OAAO,QAAO;oBAElC,IAAIA,MAAMP,cAAcoE,YAAY;wBAClCI,oBAAoB;wBACpB5M,KAAK2I,MAAMzE,MAAM/D,WAAWwI,MAAM7O;wBAClC;AACF,2BAAO;wBACL6O,MAAM7O,WAAW6S;wBACjBhE,MAAM7P,OAAO+T;wBACblE,MAAM/O,YAAYkT;wBAClBnE,MAAMP,aAAa2E;wBACnB;AACF;AACF;gBAEA,IAAIH,mBAAmB;oBACrB/B,eAAelC,OAAO+D,cAAcC,YAAY;oBAChDL,iBAAiB3D,OAAOA,MAAM7P,OAAO+T;oBACrCH,eAAeC,aAAahE,MAAM7O;oBAClC8S,oBAAoB;AACtB;gBAEA,KAAKlG,aAAa1G,KAAK;oBACrB2M,aAAahE,MAAM7O,WAAW;AAChC;gBAEAkG,KAAK2I,MAAMzE,MAAM/D,aAAawI,MAAM7O;AACtC;YAEA+Q,eAAelC,OAAO+D,cAAcC,YAAY;YAEhD,IAAIhE,MAAM5Q,QAAQ;gBAChB,OAAO;AACT;YAEA4Q,MAAMrM,OAAO0Q;YACbrE,MAAM5Q,SAASkT;YACf,OAAO;AACT;QAEA,SAASkC,uBAAwBxE,OAAO6D;YACtC,IAAIE;YACJ,IAAIC;YAEJ,IAAI3M,KAAK2I,MAAMzE,MAAM/D,WAAWwI,MAAM7O;YAEtC,IAAIkG,OAAO,IAAa;gBACtB,OAAO;AACT;YAEA2I,MAAMrM,OAAO;YACbqM,MAAM5Q,SAAS;YACf4Q,MAAM7O;YACN4S,eAAeC,aAAahE,MAAM7O;YAElC,QAAQkG,KAAK2I,MAAMzE,MAAM/D,WAAWwI,MAAM7O,eAAe,GAAG;gBAC1D,IAAIkG,OAAO,IAAa;oBACtB6K,eAAelC,OAAO+D,cAAc/D,MAAM7O,UAAU;oBACpDkG,KAAK2I,MAAMzE,MAAM/D,aAAawI,MAAM7O;oBAEpC,IAAIkG,OAAO,IAAa;wBACtB0M,eAAe/D,MAAM7O;wBACrB6O,MAAM7O;wBACN6S,aAAahE,MAAM7O;AACrB,2BAAO;wBACL,OAAO;AACT;AACF,uBAAA,IAAW2M,MAAMzG,KAAK;oBACpB6K,eAAelC,OAAO+D,cAAcC,YAAY;oBAChDL,iBAAiB3D,OAAOsD,oBAAoBtD,OAAO,OAAO6D;oBAC1DE,eAAeC,aAAahE,MAAM7O;AACpC,2BAAW6O,MAAM7O,aAAa6O,MAAM/O,aAAayS,sBAAsB1D,QAAQ;oBAC7EC,WAAWD,OAAO;AACpB,uBAAO;oBACLA,MAAM7O;oBACN,KAAK4M,aAAa1G,KAAK;wBACrB2M,aAAahE,MAAM7O;AACrB;AACF;AACF;YAEA8O,WAAWD,OAAO;AACpB;QAEA,SAASyE,uBAAwBzE,OAAO6D;YACtC,IAAIE;YACJ,IAAIC;YACJ,IAAIU;YAEJ,IAAIrN,KAAK2I,MAAMzE,MAAM/D,WAAWwI,MAAM7O;YAEtC,IAAIkG,OAAO,IAAa;gBACtB,OAAO;AACT;YAEA2I,MAAMrM,OAAO;YACbqM,MAAM5Q,SAAS;YACf4Q,MAAM7O;YACN4S,eAAeC,aAAahE,MAAM7O;YAElC,QAAQkG,KAAK2I,MAAMzE,MAAM/D,WAAWwI,MAAM7O,eAAe,GAAG;gBAC1D,IAAIkG,OAAO,IAAa;oBACtB6K,eAAelC,OAAO+D,cAAc/D,MAAM7O,UAAU;oBACpD6O,MAAM7O;oBACN,OAAO;AACT,uBAAA,IAAWkG,OAAO,IAAa;oBAC7B6K,eAAelC,OAAO+D,cAAc/D,MAAM7O,UAAU;oBACpDkG,KAAK2I,MAAMzE,MAAM/D,aAAawI,MAAM7O;oBAEpC,IAAI2M,MAAMzG,KAAK;wBACbiM,oBAAoBtD,OAAO,OAAO6D;+BAGzBxM,KAAK,OAAOyH,kBAAkBzH,KAAK;wBAC5C2I,MAAM5Q,UAAU2P,gBAAgB1H;wBAChC2I,MAAM7O;gCACIuT,MAAMtG,cAAc/G,OAAO,GAAG;wBACxC,IAAIsN,YAAYD;wBAChB,IAAIE,YAAY;wBAEhB,MAAOD,YAAY,GAAGA,aAAa;4BACjCtN,KAAK2I,MAAMzE,MAAM/D,aAAawI,MAAM7O;4BAEpC,KAAKuT,MAAMxG,YAAY7G,QAAQ,GAAG;gCAChCuN,aAAaA,aAAa,KAAKF;AACjC,mCAAO;gCACLzE,WAAWD,OAAO;AACpB;AACF;wBAEAA,MAAM5Q,UAAUmP,kBAAkBqG;wBAElC5E,MAAM7O;AACR,2BAAO;wBACL8O,WAAWD,OAAO;AACpB;oBAEA+D,eAAeC,aAAahE,MAAM7O;AACpC,uBAAA,IAAW2M,MAAMzG,KAAK;oBACpB6K,eAAelC,OAAO+D,cAAcC,YAAY;oBAChDL,iBAAiB3D,OAAOsD,oBAAoBtD,OAAO,OAAO6D;oBAC1DE,eAAeC,aAAahE,MAAM7O;AACpC,2BAAW6O,MAAM7O,aAAa6O,MAAM/O,aAAayS,sBAAsB1D,QAAQ;oBAC7EC,WAAWD,OAAO;AACpB,uBAAO;oBACLA,MAAM7O;oBACN,KAAK4M,aAAa1G,KAAK;wBACrB2M,aAAahE,MAAM7O;AACrB;AACF;AACF;YAEA8O,WAAWD,OAAO;AACpB;QAEA,SAAS6E,mBAAoB7E,OAAO6D;YAClC,IAAIiB,WAAW;YACf,IAAIZ;YACJ,IAAIC;YACJ,IAAIY;YACJ,IAAMC,OAAOhF,MAAMvM;YACnB,IAAI6O;YACJ,IAAM2C,UAAUjF,MAAMgB;YACtB,IAAIkE;YACJ,IAAIC;YACJ,IAAIC;YACJ,IAAIC;YACJ,IAAMzC,kBAAkBhU,OAAOgC,OAAO;YACtC,IAAIoS;YACJ,IAAID;YACJ,IAAIE;YAEJ,IAAI5L,KAAK2I,MAAMzE,MAAM/D,WAAWwI,MAAM7O;YAEtC,IAAIkG,OAAO,IAAa;gBACtB6N,aAAa;gBACbG,YAAY;gBACZ/C,UAAU;AACZ,mBAAA,IAAWjL,OAAO,KAAa;gBAC7B6N,aAAa;gBACbG,YAAY;gBACZ/C,UAAU,CAAA;AACZ,mBAAO;gBACL,OAAO;AACT;YAEA,IAAItC,MAAMgB,WAAW,MAAM;gBACzBb,YAAYH,OAAOA,MAAMgB,QAAQsB;AACnC;YAEAjL,KAAK2I,MAAMzE,MAAM/D,aAAawI,MAAM7O;YAEpC,OAAOkG,OAAO,GAAG;gBACfiM,oBAAoBtD,OAAO,MAAM6D;gBAEjCxM,KAAK2I,MAAMzE,MAAM/D,WAAWwI,MAAM7O;gBAElC,IAAIkG,OAAO6N,YAAY;oBACrBlF,MAAM7O;oBACN6O,MAAMvM,MAAMuR;oBACZhF,MAAMgB,SAASiE;oBACfjF,MAAMrM,OAAO0R,YAAY,YAAY;oBACrCrF,MAAM5Q,SAASkT;oBACf,OAAO;AACT,uBAAA,KAAYwC,UAAU;oBACpB7E,WAAWD,OAAO;AACpB,uBAAA,IAAW3I,OAAO,IAAa;oBAE7B4I,WAAWD,OAAO;AACpB;gBAEA+C,SAASC,UAAUC,YAAY;gBAC/BkC,SAASC,iBAAiB;gBAE1B,IAAI/N,OAAO,IAAa;oBACtB,IAAMiN,YAAYtE,MAAMzE,MAAM/D,WAAWwI,MAAM7O,WAAW;oBAE1D,IAAI6M,UAAUsG,YAAY;wBACxBa,SAASC,iBAAiB;wBAC1BpF,MAAM7O;wBACNmS,oBAAoBtD,OAAO,MAAM6D;AACnC;AACF;gBAEAK,QAAQlE,MAAM7P;gBACdgU,aAAanE,MAAM/O;gBACnB8T,OAAO/E,MAAM7O;gBACbmU,YAAYtF,OAAO6D,YAAY5G,iBAAiB,OAAO;gBACvD8F,SAAS/C,MAAMvM;gBACfuP,UAAUhD,MAAM5Q;gBAChBkU,oBAAoBtD,OAAO,MAAM6D;gBAEjCxM,KAAK2I,MAAMzE,MAAM/D,WAAWwI,MAAM7O;gBAElC,KAAKiU,kBAAkBpF,MAAM7P,SAAS+T,UAAU7M,OAAO,IAAa;oBAClE8N,SAAS;oBACT9N,KAAK2I,MAAMzE,MAAM/D,aAAawI,MAAM7O;oBACpCmS,oBAAoBtD,OAAO,MAAM6D;oBACjCyB,YAAYtF,OAAO6D,YAAY5G,iBAAiB,OAAO;oBACvDgG,YAAYjD,MAAM5Q;AACpB;gBAEA,IAAIiW,WAAW;oBACbvC,iBAAiB9C,OAAOsC,SAASM,iBAAiBG,QAAQC,SAASC,WAAWiB,OAAOC,YAAYY;2BACxFI,QAAQ;oBACjB7C,QAAQ1P,KAAKkQ,iBAAiB9C,OAAO,MAAM4C,iBAAiBG,QAAQC,SAASC,WAAWiB,OAAOC,YAAYY;AAC7G,uBAAO;oBACLzC,QAAQ1P,KAAKoQ;AACf;gBAEAM,oBAAoBtD,OAAO,MAAM6D;gBAEjCxM,KAAK2I,MAAMzE,MAAM/D,WAAWwI,MAAM7O;gBAElC,IAAIkG,OAAO,IAAa;oBACtByN,WAAW;oBACXzN,KAAK2I,MAAMzE,MAAM/D,aAAawI,MAAM7O;AACtC,uBAAO;oBACL2T,WAAW;AACb;AACF;YAEA7E,WAAWD,OAAO;AACpB;QAEA,SAASuF,gBAAiBvF,OAAO6D;YAC/B,IAAI2B;YACJ,IAAIC,WAAWpI;YACf,IAAIqI,iBAAiB;YACrB,IAAIC,iBAAiB;YACrB,IAAIC,aAAa/B;YACjB,IAAIgC,aAAa;YACjB,IAAIC,iBAAiB;YACrB,IAAIpB;YAEJ,IAAIrN,KAAK2I,MAAMzE,MAAM/D,WAAWwI,MAAM7O;YAEtC,IAAIkG,OAAO,KAAa;gBACtBmO,UAAU;AACZ,mBAAA,IAAWnO,OAAO,IAAa;gBAC7BmO,UAAU;AACZ,mBAAO;gBACL,OAAO;AACT;YAEAxF,MAAMrM,OAAO;YACbqM,MAAM5Q,SAAS;YAEf,OAAOiI,OAAO,GAAG;gBACfA,KAAK2I,MAAMzE,MAAM/D,aAAawI,MAAM7O;gBAEpC,IAAIkG,OAAO,MAAeA,OAAO,IAAa;oBAC5C,IAAIgG,kBAAkBoI,UAAU;wBAC9BA,WAAYpO,OAAO,KAAekG,gBAAgBD;AACpD,2BAAO;wBACL2C,WAAWD,OAAO;AACpB;4BACU0E,MAAMrG,gBAAgBhH,QAAQ,GAAG;oBAC3C,IAAIqN,QAAQ,GAAG;wBACbzE,WAAWD,OAAO;AACpB,2BAAA,KAAY2F,gBAAgB;wBAC1BC,aAAa/B,aAAaa,MAAM;wBAChCiB,iBAAiB;AACnB,2BAAO;wBACL1F,WAAWD,OAAO;AACpB;AACF,uBAAO;oBACL;AACF;AACF;YAEA,IAAIjC,aAAa1G,KAAK;gBACpB,GAAG;oBAAEA,KAAK2I,MAAMzE,MAAM/D,aAAawI,MAAM7O;AAAU,yBAC5C4M,aAAa1G;gBAEpB,IAAIA,OAAO,IAAa;oBACtB,GAAG;wBAAEA,KAAK2I,MAAMzE,MAAM/D,aAAawI,MAAM7O;8BACjC2M,MAAMzG,OAAQA,OAAO;AAC/B;AACF;YAEA,OAAOA,OAAO,GAAG;gBACfgM,cAAcrD;gBACdA,MAAMP,aAAa;gBAEnBpI,KAAK2I,MAAMzE,MAAM/D,WAAWwI,MAAM7O;gBAGlC,SAASwU,kBAAkB3F,MAAMP,aAAamG,eACtCvO,OAAO,IAAkB;oBAC/B2I,MAAMP;oBACNpI,KAAK2I,MAAMzE,MAAM/D,aAAawI,MAAM7O;AACtC;gBAEA,KAAKwU,kBAAkB3F,MAAMP,aAAamG,YAAY;oBACpDA,aAAa5F,MAAMP;AACrB;gBAEA,IAAI3B,MAAMzG,KAAK;oBACbwO;oBACA;AACF;gBAEA,KAAKF,kBAAkBC,eAAe,GAAG;oBACvC3F,WAAWD,OAAO;AACpB;gBAGA,IAAIA,MAAMP,aAAamG,YAAY;oBAEjC,IAAIH,aAAalI,eAAe;wBAC9ByC,MAAM5Q,UAAUM,QAAOT,OAAO,MAAMyW,iBAAiB,IAAIG,aAAaA;AACxE,2BAAA,IAAWJ,aAAapI,eAAe;wBACrC,IAAIqI,gBAAgB;4BAClB1F,MAAM5Q,UAAU;AAClB;AACF;oBAGA;AACF;gBAGA,IAAIoW,SAAS;oBAEX,IAAIzH,aAAa1G,KAAK;wBACpByO,iBAAiB;wBAEjB9F,MAAM5Q,UAAUM,QAAOT,OAAO,MAAMyW,iBAAiB,IAAIG,aAAaA;+BAG7DC,gBAAgB;wBACzBA,iBAAiB;wBACjB9F,MAAM5Q,UAAUM,QAAOT,OAAO,MAAM4W,aAAa;AAGnD,2BAAA,IAAWA,eAAe,GAAG;wBAC3B,IAAIH,gBAAgB;4BAClB1F,MAAM5Q,UAAU;AAClB;AAGF,2BAAO;wBACL4Q,MAAM5Q,UAAUM,QAAOT,OAAO,MAAM4W;AACtC;AAGF,uBAAO;oBAEL7F,MAAM5Q,UAAUM,QAAOT,OAAO,MAAMyW,iBAAiB,IAAIG,aAAaA;AACxE;gBAEAH,iBAAiB;gBACjBC,iBAAiB;gBACjBE,aAAa;gBACb,IAAM9B,eAAe/D,MAAM7O;gBAE3B,QAAQ2M,MAAMzG,OAAQA,OAAO,GAAI;oBAC/BA,KAAK2I,MAAMzE,MAAM/D,aAAawI,MAAM7O;AACtC;gBAEA+Q,eAAelC,OAAO+D,cAAc/D,MAAM7O,UAAU;AACtD;YAEA,OAAO;AACT;QAEA,SAAS4U,kBAAmB/F,OAAO6D;YACjC,IAAMmB,OAAOhF,MAAMvM;YACnB,IAAMwR,UAAUjF,MAAMgB;YACtB,IAAMsB,UAAU;YAChB,IAAI0D,WAAW;YAIf,IAAIhG,MAAMJ,oBAAmB,GAAI,OAAO;YAExC,IAAII,MAAMgB,WAAW,MAAM;gBACzBb,YAAYH,OAAOA,MAAMgB,QAAQsB;AACnC;YAEA,IAAIjL,KAAK2I,MAAMzE,MAAM/D,WAAWwI,MAAM7O;YAEtC,OAAOkG,OAAO,GAAG;gBACf,IAAI2I,MAAMJ,oBAAmB,GAAI;oBAC/BI,MAAM7O,WAAW6O,MAAMJ;oBACvBK,WAAWD,OAAO;AACpB;gBAEA,IAAI3I,OAAO,IAAa;oBACtB;AACF;gBAEA,IAAMiN,YAAYtE,MAAMzE,MAAM/D,WAAWwI,MAAM7O,WAAW;gBAE1D,KAAK6M,UAAUsG,YAAY;oBACzB;AACF;gBAEA0B,WAAW;gBACXhG,MAAM7O;gBAEN,IAAImS,oBAAoBtD,OAAO,OAAM,IAAK;oBACxC,IAAIA,MAAMP,cAAcoE,YAAY;wBAClCvB,QAAQ1P,KAAK;wBACbyE,KAAK2I,MAAMzE,MAAM/D,WAAWwI,MAAM7O;wBAClC;AACF;AACF;gBAEA,IAAM+S,QAAQlE,MAAM7P;gBACpBmV,YAAYtF,OAAO6D,YAAY1G,kBAAkB,OAAO;gBACxDmF,QAAQ1P,KAAKoN,MAAM5Q;gBACnBkU,oBAAoBtD,OAAO,OAAM;gBAEjC3I,KAAK2I,MAAMzE,MAAM/D,WAAWwI,MAAM7O;gBAElC,KAAK6O,MAAM7P,SAAS+T,SAASlE,MAAMP,aAAaoE,eAAgBxM,OAAO,GAAI;oBACzE4I,WAAWD,OAAO;AACpB,uBAAA,IAAWA,MAAMP,aAAaoE,YAAY;oBACxC;AACF;AACF;YAEA,IAAImC,UAAU;gBACZhG,MAAMvM,MAAMuR;gBACZhF,MAAMgB,SAASiE;gBACfjF,MAAMrM,OAAO;gBACbqM,MAAM5Q,SAASkT;gBACf,OAAO;AACT;YACA,OAAO;AACT;QAEA,SAAS2D,iBAAkBjG,OAAO6D,YAAYqC;YAC5C,IAAIC;YACJ,IAAIC;YACJ,IAAIC;YACJ,IAAIC;YACJ,IAAMtB,OAAOhF,MAAMvM;YACnB,IAAMwR,UAAUjF,MAAMgB;YACtB,IAAMsB,UAAU,CAAA;YAChB,IAAMM,kBAAkBhU,OAAOgC,OAAO;YACtC,IAAImS,SAAS;YACb,IAAIC,UAAU;YACd,IAAIC,YAAY;YAChB,IAAIsD,gBAAgB;YACpB,IAAIP,WAAW;YAIf,IAAIhG,MAAMJ,oBAAmB,GAAI,OAAO;YAExC,IAAII,MAAMgB,WAAW,MAAM;gBACzBb,YAAYH,OAAOA,MAAMgB,QAAQsB;AACnC;YAEA,IAAIjL,KAAK2I,MAAMzE,MAAM/D,WAAWwI,MAAM7O;YAEtC,OAAOkG,OAAO,GAAG;gBACf,KAAKkP,iBAAiBvG,MAAMJ,oBAAmB,GAAI;oBACjDI,MAAM7O,WAAW6O,MAAMJ;oBACvBK,WAAWD,OAAO;AACpB;gBAEA,IAAMsE,YAAYtE,MAAMzE,MAAM/D,WAAWwI,MAAM7O,WAAW;gBAC1D,IAAM+S,QAAQlE,MAAM7P;gBAMpB,KAAKkH,OAAO,MAAeA,OAAO,OAAgB2G,UAAUsG,YAAY;oBACtE,IAAIjN,OAAO,IAAa;wBACtB,IAAIkP,eAAe;4BACjBzD,iBAAiB9C,OAAOsC,SAASM,iBAAiBG,QAAQC,SAAS,MAAMoD,UAAUC,eAAeC;4BAClGvD,SAASC,UAAUC,YAAY;AACjC;wBAEA+C,WAAW;wBACXO,gBAAgB;wBAChBJ,eAAe;+BACNI,eAAe;wBAExBA,gBAAgB;wBAChBJ,eAAe;AACjB,2BAAO;wBACLlG,WAAWD,OAAO;AACpB;oBAEAA,MAAM7O,YAAY;oBAClBkG,KAAKiN;AAKP,uBAAO;oBACL8B,WAAWpG,MAAM7P;oBACjBkW,gBAAgBrG,MAAM/O;oBACtBqV,UAAUtG,MAAM7O;oBAEhB,KAAKmU,YAAYtF,OAAOkG,YAAYhJ,kBAAkB,OAAO,OAAO;wBAGlE;AACF;oBAEA,IAAI8C,MAAM7P,SAAS+T,OAAO;wBACxB7M,KAAK2I,MAAMzE,MAAM/D,WAAWwI,MAAM7O;wBAElC,OAAO4M,aAAa1G,KAAK;4BACvBA,KAAK2I,MAAMzE,MAAM/D,aAAawI,MAAM7O;AACtC;wBAEA,IAAIkG,OAAO,IAAa;4BACtBA,KAAK2I,MAAMzE,MAAM/D,aAAawI,MAAM7O;4BAEpC,KAAK6M,UAAU3G,KAAK;gCAClB4I,WAAWD,OAAO;AACpB;4BAEA,IAAIuG,eAAe;gCACjBzD,iBAAiB9C,OAAOsC,SAASM,iBAAiBG,QAAQC,SAAS,MAAMoD,UAAUC,eAAeC;gCAClGvD,SAASC,UAAUC,YAAY;AACjC;4BAEA+C,WAAW;4BACXO,gBAAgB;4BAChBJ,eAAe;4BACfpD,SAAS/C,MAAMvM;4BACfuP,UAAUhD,MAAM5Q;mCACP4W,UAAU;4BACnB/F,WAAWD,OAAO;AACpB,+BAAO;4BACLA,MAAMvM,MAAMuR;4BACZhF,MAAMgB,SAASiE;4BACf,OAAO;AACT;+BACSe,UAAU;wBACnB/F,WAAWD,OAAO;AACpB,2BAAO;wBACLA,MAAMvM,MAAMuR;wBACZhF,MAAMgB,SAASiE;wBACf,OAAO;AACT;AACF;gBAKA,IAAIjF,MAAM7P,SAAS+T,SAASlE,MAAMP,aAAaoE,YAAY;oBACzD,IAAI0C,eAAe;wBACjBH,WAAWpG,MAAM7P;wBACjBkW,gBAAgBrG,MAAM/O;wBACtBqV,UAAUtG,MAAM7O;AAClB;oBAEA,IAAImU,YAAYtF,OAAO6D,YAAYzG,mBAAmB,MAAM+I,eAAe;wBACzE,IAAII,eAAe;4BACjBvD,UAAUhD,MAAM5Q;AAClB,+BAAO;4BACL6T,YAAYjD,MAAM5Q;AACpB;AACF;oBAEA,KAAKmX,eAAe;wBAClBzD,iBAAiB9C,OAAOsC,SAASM,iBAAiBG,QAAQC,SAASC,WAAWmD,UAAUC,eAAeC;wBACvGvD,SAASC,UAAUC,YAAY;AACjC;oBAEAK,oBAAoBtD,OAAO,OAAM;oBACjC3I,KAAK2I,MAAMzE,MAAM/D,WAAWwI,MAAM7O;AACpC;gBAEA,KAAK6O,MAAM7P,SAAS+T,SAASlE,MAAMP,aAAaoE,eAAgBxM,OAAO,GAAI;oBACzE4I,WAAWD,OAAO;AACpB,uBAAA,IAAWA,MAAMP,aAAaoE,YAAY;oBACxC;AACF;AACF;YAOA,IAAI0C,eAAe;gBACjBzD,iBAAiB9C,OAAOsC,SAASM,iBAAiBG,QAAQC,SAAS,MAAMoD,UAAUC,eAAeC;AACpG;YAGA,IAAIN,UAAU;gBACZhG,MAAMvM,MAAMuR;gBACZhF,MAAMgB,SAASiE;gBACfjF,MAAMrM,OAAO;gBACbqM,MAAM5Q,SAASkT;AACjB;YAEA,OAAO0D;AACT;QAEA,SAASQ,gBAAiBxG;YACxB,IAAIyG,aAAa;YACjB,IAAIC,UAAU;YACd,IAAIC;YACJ,IAAIC;YAEJ,IAAIvP,KAAK2I,MAAMzE,MAAM/D,WAAWwI,MAAM7O;YAEtC,IAAIkG,OAAO,IAAa,OAAO;YAE/B,IAAI2I,MAAMvM,QAAQ,MAAM;gBACtBwM,WAAWD,OAAO;AACpB;YAEA3I,KAAK2I,MAAMzE,MAAM/D,aAAawI,MAAM7O;YAEpC,IAAIkG,OAAO,IAAa;gBACtBoP,aAAa;gBACbpP,KAAK2I,MAAMzE,MAAM/D,aAAawI,MAAM7O;AACtC,mBAAA,IAAWkG,OAAO,IAAa;gBAC7BqP,UAAU;gBACVC,YAAY;gBACZtP,KAAK2I,MAAMzE,MAAM/D,aAAawI,MAAM7O;AACtC,mBAAO;gBACLwV,YAAY;AACd;YAEA,IAAIpE,YAAYvC,MAAM7O;YAEtB,IAAIsV,YAAY;gBACd,GAAG;oBAAEpP,KAAK2I,MAAMzE,MAAM/D,aAAawI,MAAM7O;AAAU,yBAC5CkG,OAAO,KAAKA,OAAO;gBAE1B,IAAI2I,MAAM7O,WAAW6O,MAAMjR,QAAQ;oBACjC6X,UAAU5G,MAAMzE,MAAM5J,MAAM4Q,WAAWvC,MAAM7O;oBAC7CkG,KAAK2I,MAAMzE,MAAM/D,aAAawI,MAAM7O;AACtC,uBAAO;oBACL8O,WAAWD,OAAO;AACpB;AACF,mBAAO;gBACL,OAAO3I,OAAO,MAAM2G,UAAU3G,KAAK;oBACjC,IAAIA,OAAO,IAAa;wBACtB,KAAKqP,SAAS;4BACZC,YAAY3G,MAAMzE,MAAM5J,MAAM4Q,YAAY,GAAGvC,MAAM7O,WAAW;4BAE9D,KAAKwM,mBAAmBlF,KAAKkO,YAAY;gCACvC1G,WAAWD,OAAO;AACpB;4BAEA0G,UAAU;4BACVnE,YAAYvC,MAAM7O,WAAW;AAC/B,+BAAO;4BACL8O,WAAWD,OAAO;AACpB;AACF;oBAEA3I,KAAK2I,MAAMzE,MAAM/D,aAAawI,MAAM7O;AACtC;gBAEAyV,UAAU5G,MAAMzE,MAAM5J,MAAM4Q,WAAWvC,MAAM7O;gBAE7C,IAAIuM,wBAAwBjF,KAAKmO,UAAU;oBACzC3G,WAAWD,OAAO;AACpB;AACF;YAEA,IAAI4G,YAAYhJ,gBAAgBnF,KAAKmO,UAAU;gBAC7C3G,WAAWD,OAAO,8CAA8C4G;AAClE;YAEA;gBACEA,UAAU5E,mBAAmB4E;qBACtB3E;gBACPhC,WAAWD,OAAO,4BAA4B4G;AAChD;YAEA,IAAIH,YAAY;gBACdzG,MAAMvM,MAAMmT;AACd,uBAAW/K,gBAAgBrL,KAAKwP,MAAM+B,QAAQ4E,YAAY;gBACxD3G,MAAMvM,MAAMuM,MAAM+B,OAAO4E,aAAaC;AACxC,mBAAA,IAAWD,cAAc,KAAK;gBAC5B3G,MAAMvM,MAAM,MAAMmT;AACpB,mBAAA,IAAWD,cAAc,MAAM;gBAC7B3G,MAAMvM,MAAM,uBAAuBmT;AACrC,mBAAO;gBACL3G,WAAWD,OAAO,4BAA4B2G,YAAY;AAC5D;YAEA,OAAO;AACT;QAEA,SAASE,mBAAoB7G;YAC3B,IAAI3I,KAAK2I,MAAMzE,MAAM/D,WAAWwI,MAAM7O;YAEtC,IAAIkG,OAAO,IAAa,OAAO;YAE/B,IAAI2I,MAAMgB,WAAW,MAAM;gBACzBf,WAAWD,OAAO;AACpB;YAEA3I,KAAK2I,MAAMzE,MAAM/D,aAAawI,MAAM7O;YACpC,IAAMoR,YAAYvC,MAAM7O;YAExB,OAAOkG,OAAO,MAAM2G,UAAU3G,QAAQ4G,gBAAgB5G,KAAK;gBACzDA,KAAK2I,MAAMzE,MAAM/D,aAAawI,MAAM7O;AACtC;YAEA,IAAI6O,MAAM7O,aAAaoR,WAAW;gBAChCtC,WAAWD,OAAO;AACpB;YAEAA,MAAMgB,SAAShB,MAAMzE,MAAM5J,MAAM4Q,WAAWvC,MAAM7O;YAClD,OAAO;AACT;QAEA,SAAS2V,UAAW9G;YAClB,IAAI3I,KAAK2I,MAAMzE,MAAM/D,WAAWwI,MAAM7O;YAEtC,IAAIkG,OAAO,IAAa,OAAO;YAE/BA,KAAK2I,MAAMzE,MAAM/D,aAAawI,MAAM7O;YACpC,IAAMoR,YAAYvC,MAAM7O;YAExB,OAAOkG,OAAO,MAAM2G,UAAU3G,QAAQ4G,gBAAgB5G,KAAK;gBACzDA,KAAK2I,MAAMzE,MAAM/D,aAAawI,MAAM7O;AACtC;YAEA,IAAI6O,MAAM7O,aAAaoR,WAAW;gBAChCtC,WAAWD,OAAO;AACpB;YAEA,IAAM1M,QAAQ0M,MAAMzE,MAAM5J,MAAM4Q,WAAWvC,MAAM7O;YAEjD,KAAK0K,gBAAgBrL,KAAKwP,MAAMO,WAAWjN,QAAQ;gBACjD2M,WAAWD,OAAO,yBAAyB1M,QAAQ;AACrD;YAEA0M,MAAM5Q,SAAS4Q,MAAMO,UAAUjN;YAC/BgQ,oBAAoBtD,OAAO,OAAM;YACjC,OAAO;AACT;QAEA,SAAS+G,gCAAiC/G,OAAOgH,eAAenD,YAAYqC;YAC1E,IAAMe,gBAAgBlG,cAAcf;YAEpCQ,uBAAuBR;YACvBiB,aAAajB,OAAOgH;YAIpBhH,MAAMvM,MAAM;YACZuM,MAAMgB,SAAS;YACfhB,MAAMrM,OAAO;YACbqM,MAAM5Q,SAAS;YAEf,IAAI6W,iBAAiBjG,OAAO6D,YAAYqC,eAAelG,MAAMrM,SAAS,WAAW;gBAC/E8M,wBAAwBT;gBACxB,OAAO;AACT;YAEAa,0BAA0Bb;YAC1BiB,aAAajB,OAAOiH;YACpB,OAAO;AACT;QAEA,SAAS3B,YAAatF,OAAOkH,cAAcC,aAAaC,aAAajB;YACnE,IAAIkB;YACJ,IAAIC;YACJ,IAAIC,eAAe;YACnB,IAAIC,YAAY;YAChB,IAAIC,aAAa;YACjB,IAAIT,gBAAgB;YACpB,IAAI1S;YACJ,IAAI4R;YACJ,IAAIwB;YAEJ,IAAI1H,MAAMN,SAASM,MAAMX,UAAU;gBACjCY,WAAWD,OAAO,gCAAgCA,MAAMX,WAAW;AACrE;YAEAW,MAAMN,SAAS;YAEf,IAAIM,MAAMZ,aAAa,MAAM;gBAC3BY,MAAMZ,SAAS,QAAQY;AACzB;YAEAA,MAAMvM,MAAM;YACZuM,MAAMgB,SAAS;YACfhB,MAAMrM,OAAO;YACbqM,MAAM5Q,SAAS;YAEf,IAAMuY,mBAAmBN,oBAAoBC,wBAC3ClK,sBAAsB+J,eACtBhK,qBAAqBgK;YAEvB,IAAIC,aAAa;gBACf,IAAI9D,oBAAoBtD,OAAO,OAAM,IAAK;oBACxCwH,YAAY;oBAEZ,IAAIxH,MAAMP,aAAayH,cAAc;wBACnCK,eAAe;AACjB,2BAAA,IAAWvH,MAAMP,eAAeyH,cAAc;wBAC5CK,eAAe;AACjB,2BAAA,IAAWvH,MAAMP,aAAayH,cAAc;wBAC1CK,gBAAe;AACjB;AACF;AACF;YAEA,IAAIA,iBAAiB,GAAG;gBACtB,OAAO,MAAM;oBACX,IAAMlQ,KAAK2I,MAAMzE,MAAM/D,WAAWwI,MAAM7O;oBACxC,IAAMyW,gBAAgB7G,cAAcf;oBAIpC,IAAIwH,cACEnQ,OAAO,MAAe2I,MAAMvM,QAAQ,QACpC4D,OAAO,MAAe2I,MAAMgB,WAAW,OAAQ;wBACnD;AACF;oBAEA,KAAKwF,gBAAgBxG,WAAW6G,mBAAmB7G,QAAQ;wBACzD;AACF;oBAEA,IAAIgH,kBAAkB,MAAM;wBAC1BA,gBAAgBY;AAClB;oBAEA,IAAItE,oBAAoBtD,OAAO,OAAM,IAAK;wBACxCwH,YAAY;wBACZF,wBAAwBK;wBAExB,IAAI3H,MAAMP,aAAayH,cAAc;4BACnCK,eAAe;AACjB,+BAAA,IAAWvH,MAAMP,eAAeyH,cAAc;4BAC5CK,eAAe;AACjB,+BAAA,IAAWvH,MAAMP,aAAayH,cAAc;4BAC1CK,gBAAe;AACjB;AACF,2BAAO;wBACLD,wBAAwB;AAC1B;AACF;AACF;YAEA,IAAIA,uBAAuB;gBACzBA,wBAAwBE,aAAarB;AACvC;YAEA,IAAIoB,iBAAiB,KAAKnK,sBAAsB+J,aAAa;gBAC3D,IAAIlK,oBAAoBkK,eAAejK,qBAAqBiK,aAAa;oBACvEjB,aAAagB;AACf,uBAAO;oBACLhB,aAAagB,eAAe;AAC9B;gBAEAQ,cAAc1H,MAAM7O,WAAW6O,MAAM/O;gBAErC,IAAIsW,iBAAiB,GAAG;oBACtB,IAAKD,0BACAvB,kBAAkB/F,OAAO0H,gBAAgBzB,iBAAiBjG,OAAO0H,aAAaxB,gBAC/ErB,mBAAmB7E,OAAOkG,aAAa;wBACzCuB,aAAa;AACf,2BAAO;wBACL,IAAMpQ,MAAK2I,MAAMzE,MAAM/D,WAAWwI,MAAM7O;wBAExC,IAAI6V,kBAAkB,QAAQW,qBAAqBL,yBAC/CjQ,QAAO,OAAeA,QAAO,MAC7B0P,gCACE/G,OACAgH,eACAA,cAAc7V,WAAW6V,cAAc/V,WACvCiV,aACC;4BACLuB,aAAa;mCACHJ,qBAAqB9B,gBAAgBvF,OAAOkG,eACpD1B,uBAAuBxE,OAAOkG,eAC9BzB,uBAAuBzE,OAAOkG,aAAa;4BAC7CuB,aAAa;AACf,+BAAA,IAAWX,UAAU9G,QAAQ;4BAC3ByH,aAAa;4BAEb,IAAIzH,MAAMvM,QAAQ,QAAQuM,MAAMgB,WAAW,MAAM;gCAC/Cf,WAAWD,OAAO;AACpB;AACF,mCAAW4D,gBAAgB5D,OAAOkG,YAAYjJ,oBAAoBkK,cAAc;4BAC9EM,aAAa;4BAEb,IAAIzH,MAAMvM,QAAQ,MAAM;gCACtBuM,MAAMvM,MAAM;AACd;AACF;wBAEA,IAAIuM,MAAMgB,WAAW,MAAM;4BACzBb,YAAYH,OAAOA,MAAMgB,QAAQhB,MAAM5Q;AACzC;AACF;AACF,uBAAA,IAAWmY,iBAAiB,GAAG;oBAG7BE,aAAaH,yBAAyBvB,kBAAkB/F,OAAO0H;AACjE;AACF;YAEA,IAAI1H,MAAMvM,QAAQ,MAAM;gBACtB,IAAIuM,MAAMgB,WAAW,MAAM;oBACzBb,YAAYH,OAAOA,MAAMgB,QAAQhB,MAAM5Q;AACzC;AACF,mBAAA,IAAW4Q,MAAMvM,QAAQ,KAAK;gBAO5B,IAAIuM,MAAM5Q,WAAW,QAAQ4Q,MAAMrM,SAAS,UAAU;oBACpDsM,WAAWD,OAAO,sEAAsEA,MAAMrM,OAAO;AACvG;gBAEA,KAAA,IAASkU,YAAY,GAAGC,eAAe9H,MAAMT,cAAcxQ,QAAQ8Y,YAAYC,cAAcD,aAAa,GAAG;oBAC3GvT,QAAO0L,MAAMT,cAAcsI;oBAE3B,IAAIvT,MAAKV,QAAQoM,MAAM5Q,SAAS;wBAC9B4Q,MAAM5Q,SAASkF,MAAKT,UAAUmM,MAAM5Q;wBACpC4Q,MAAMvM,MAAMa,MAAKb;wBACjB,IAAIuM,MAAMgB,WAAW,MAAM;4BACzBb,YAAYH,OAAOA,MAAMgB,QAAQhB,MAAM5Q;AACzC;wBACA;AACF;AACF;AACF,mBAAA,IAAW4Q,MAAMvM,QAAQ,KAAK;gBAC5B,IAAIoI,gBAAgBrL,KAAKwP,MAAMR,QAAQQ,MAAMrM,QAAQ,aAAaqM,MAAMvM,MAAM;oBAC5Ea,QAAO0L,MAAMR,QAAQQ,MAAMrM,QAAQ,YAAYqM,MAAMvM;AACvD,uBAAO;oBAELa,QAAO;oBACP,IAAMyT,WAAW/H,MAAMR,QAAQpL,MAAM4L,MAAMrM,QAAQ;oBAEnD,KAAA,IAASkU,aAAY,GAAGC,gBAAeC,SAAShZ,QAAQ8Y,aAAYC,eAAcD,cAAa,GAAG;wBAChG,IAAI7H,MAAMvM,IAAI9B,MAAM,GAAGoW,SAASF,YAAWpU,IAAI1E,YAAYgZ,SAASF,YAAWpU,KAAK;4BAClFa,QAAOyT,SAASF;4BAChB;AACF;AACF;AACF;gBAEA,KAAKvT,OAAM;oBACT2L,WAAWD,OAAO,mBAAmBA,MAAMvM,MAAM;AACnD;gBAEA,IAAIuM,MAAM5Q,WAAW,QAAQkF,MAAKX,SAASqM,MAAMrM,MAAM;oBACrDsM,WAAWD,OAAO,kCAAkCA,MAAMvM,MAAM,0BAA0Ba,MAAKX,OAAO,aAAaqM,MAAMrM,OAAO;AAClI;gBAEA,KAAKW,MAAKV,QAAQoM,MAAM5Q,QAAQ4Q,MAAMvM,MAAM;oBAC1CwM,WAAWD,OAAO,kCAAkCA,MAAMvM,MAAM;AAClE,uBAAO;oBACLuM,MAAM5Q,SAASkF,MAAKT,UAAUmM,MAAM5Q,QAAQ4Q,MAAMvM;oBAClD,IAAIuM,MAAMgB,WAAW,MAAM;wBACzBb,YAAYH,OAAOA,MAAMgB,QAAQhB,MAAM5Q;AACzC;AACF;AACF;YAEA,IAAI4Q,MAAMZ,aAAa,MAAM;gBAC3BY,MAAMZ,SAAS,SAASY;AAC1B;YAEAA,MAAMN,SAAS;YACf,OAAOM,MAAMvM,QAAQ,QAAQuM,MAAMgB,WAAW,QAAQyG;AACxD;QAEA,SAASO,aAAchI;YACrB,IAAMiI,gBAAgBjI,MAAM7O;YAC5B,IAAI+W,gBAAgB;YACpB,IAAI7Q;YAEJ2I,MAAMuB,UAAU;YAChBvB,MAAM0B,kBAAkB1B,MAAMb;YAC9Ba,MAAM+B,SAASnT,OAAOgC,OAAO;YAC7BoP,MAAMO,YAAY3R,OAAOgC,OAAO;YAEhC,QAAQyG,KAAK2I,MAAMzE,MAAM/D,WAAWwI,MAAM7O,eAAe,GAAG;gBAC1DmS,oBAAoBtD,OAAO,OAAM;gBAEjC3I,KAAK2I,MAAMzE,MAAM/D,WAAWwI,MAAM7O;gBAElC,IAAI6O,MAAMP,aAAa,KAAKpI,OAAO,IAAa;oBAC9C;AACF;gBAEA6Q,gBAAgB;gBAChB7Q,KAAK2I,MAAMzE,MAAM/D,aAAawI,MAAM7O;gBACpC,IAAIoR,YAAYvC,MAAM7O;gBAEtB,OAAOkG,OAAO,MAAM2G,UAAU3G,KAAK;oBACjCA,KAAK2I,MAAMzE,MAAM/D,aAAawI,MAAM7O;AACtC;gBAEA,IAAMgX,gBAAgBnI,MAAMzE,MAAM5J,MAAM4Q,WAAWvC,MAAM7O;gBACzD,IAAMiX,gBAAgB;gBAEtB,IAAID,cAAcpZ,SAAS,GAAG;oBAC5BkR,WAAWD,OAAO;AACpB;gBAEA,OAAO3I,OAAO,GAAG;oBACf,OAAO0G,aAAa1G,KAAK;wBACvBA,KAAK2I,MAAMzE,MAAM/D,aAAawI,MAAM7O;AACtC;oBAEA,IAAIkG,OAAO,IAAa;wBACtB,GAAG;4BAAEA,KAAK2I,MAAMzE,MAAM/D,aAAawI,MAAM7O;iCAClCkG,OAAO,MAAMyG,MAAMzG;wBAC1B;AACF;oBAEA,IAAIyG,MAAMzG,KAAK;oBAEfkL,YAAYvC,MAAM7O;oBAElB,OAAOkG,OAAO,MAAM2G,UAAU3G,KAAK;wBACjCA,KAAK2I,MAAMzE,MAAM/D,aAAawI,MAAM7O;AACtC;oBAEAiX,cAAcxV,KAAKoN,MAAMzE,MAAM5J,MAAM4Q,WAAWvC,MAAM7O;AACxD;gBAEA,IAAIkG,OAAO,GAAGgM,cAAcrD;gBAE5B,IAAInE,gBAAgBrL,KAAK2Q,mBAAmBgH,gBAAgB;oBAC1DhH,kBAAkBgH,eAAenI,OAAOmI,eAAeC;AACzD,uBAAO;oBACLlI,aAAaF,OAAO,iCAAiCmI,gBAAgB;AACvE;AACF;YAEA7E,oBAAoBtD,OAAO,OAAM;YAEjC,IAAIA,MAAMP,eAAe,KACrBO,MAAMzE,MAAM/D,WAAWwI,MAAM7O,cAAc,MAC3C6O,MAAMzE,MAAM/D,WAAWwI,MAAM7O,WAAW,OAAO,MAC/C6O,MAAMzE,MAAM/D,WAAWwI,MAAM7O,WAAW,OAAO,IAAa;gBAC9D6O,MAAM7O,YAAY;gBAClBmS,oBAAoBtD,OAAO,OAAM;uBACxBkI,eAAe;gBACxBjI,WAAWD,OAAO;AACpB;YAEAsF,YAAYtF,OAAOA,MAAMP,aAAa,GAAGrC,mBAAmB,OAAO;YACnEkG,oBAAoBtD,OAAO,OAAM;YAEjC,IAAIA,MAAM0B,mBACNjE,8BAA8BhF,KAAKuH,MAAMzE,MAAM5J,MAAMsW,eAAejI,MAAM7O,YAAY;gBACxF+O,aAAaF,OAAO;AACtB;YAEAA,MAAMH,UAAUjN,KAAKoN,MAAM5Q;YAE3B,IAAI4Q,MAAM7O,aAAa6O,MAAM/O,aAAayS,sBAAsB1D,QAAQ;gBACtE,IAAIA,MAAMzE,MAAM/D,WAAWwI,MAAM7O,cAAc,IAAa;oBAC1D6O,MAAM7O,YAAY;oBAClBmS,oBAAoBtD,OAAO,OAAM;AACnC;gBACA;AACF;YAEA,IAAIA,MAAM7O,WAAY6O,MAAMjR,SAAS,GAAI;gBACvCkR,WAAWD,OAAO;AACpB;AACF;QAEA,SAASqI,cAAe9M,OAAOtJ;YAC7BsJ,QAAQhI,OAAOgI;YACftJ,UAAUA,WAAW,CAAA;YAErB,IAAIsJ,MAAMxM,WAAW,GAAG;gBAEtB,IAAIwM,MAAM/D,WAAW+D,MAAMxM,SAAS,OAAO,MACvCwM,MAAM/D,WAAW+D,MAAMxM,SAAS,OAAO,IAAc;oBACvDwM,SAAS;AACX;gBAGA,IAAIA,MAAM/D,WAAW,OAAO,OAAQ;oBAClC+D,QAAQA,MAAM5J,MAAM;AACtB;AACF;YAEA,IAAMqO,QAAQ,IAAIhB,MAAMzD,OAAOtJ;YAE/B,IAAMqW,UAAU/M,MAAM7H,QAAQ;YAE9B,IAAI4U,aAAY,GAAI;gBAClBtI,MAAM7O,WAAWmX;gBACjBrI,WAAWD,OAAO;AACpB;YAGAA,MAAMzE,SAAS;YAEf,OAAOyE,MAAMzE,MAAM/D,WAAWwI,MAAM7O,cAAc,IAAiB;gBACjE6O,MAAMP,cAAc;gBACpBO,MAAM7O,YAAY;AACpB;YAEA,OAAO6O,MAAM7O,WAAY6O,MAAMjR,SAAS,GAAI;gBAC1CiZ,aAAahI;AACf;YAEA,OAAOA,MAAMH;AACf;QAEA,SAAS0I,SAAShN,OAAOzN,UAAUmE;YACjC,IAAInE,aAAa,QAAQH,QAAOG,cAAa,mBAAmBmE,YAAY,aAAa;gBACvFA,UAAUnE;gBACVA,WAAW;AACb;YAEA,IAAM+R,YAAYwI,cAAc9M,OAAOtJ;YAEvC,WAAWnE,aAAa,YAAY;gBAClC,OAAO+R;AACT;YAEA,KAAA,IAAS/Q,QAAQ,GAAGC,SAAS8Q,UAAU9Q,QAAQD,QAAQC,QAAQD,SAAS,GAAG;gBACzEhB,SAAS+R,UAAU/Q;AACrB;AACF;QAEA,SAAS0Z,MAAMjN,OAAOtJ;YACpB,IAAM4N,YAAYwI,cAAc9M,OAAOtJ;YAEvC,IAAI4N,UAAU9Q,WAAW,GAAG;gBAC1B,YAAO;AACT,mBAAA,IAAW8Q,UAAU9Q,WAAW,GAAG;gBACjC,OAAO8Q,UAAU;AACnB;YACA,MAAM,IAAIvP,eAAc;AAC1B;QAEAmY,OAAAF,UAAyBA;QACzBE,OAAAD,OAAsBA;;;;;;;;QC7vDV,SAAA7a,QAAAC;YAAA;YAAA,OAAAD,UAAA,qBAAAE,UAAA,mBAAAA,OAAAC,WAAA,SAAAF;gBAAA,cAAAA;gBAAA,SAAAA;gBAAA,OAAAA,MAAA,qBAAAC,UAAAD,GAAAG,gBAAAF,UAAAD,OAAAC,OAAAG,YAAA,kBAAAJ;AAAA,eAAAD,QAAAC;AAAA;QAEZ,IAAM8B,UAASoB;QACf,IAAMR,iBAAgBiE;QACtB,IAAMyI,kBAAiBjH;QAEvB,IAAMgG,YAAYnN,OAAOZ,UAAU6C;QACnC,IAAMgL,kBAAkBjN,OAAOZ,UAAU8N;QAEzC,IAAM4M,WAAW;QACjB,IAAMC,WAAW;QACjB,IAAMC,iBAAiB;QACvB,IAAMC,uBAAuB;QAC7B,IAAMC,aAAa;QACnB,IAAMC,mBAAmB;QACzB,IAAMC,oBAAoB;QAC1B,IAAMC,aAAa;QACnB,IAAMC,eAAe;QACrB,IAAMC,iBAAiB;QACvB,IAAMC,oBAAoB;QAC1B,IAAMC,gBAAgB;QACtB,IAAMC,aAAa;QACnB,IAAMC,aAAa;QACnB,IAAMC,aAAa;QACnB,IAAMC,cAAc;QACpB,IAAMC,oBAAoB;QAC1B,IAAMC,gBAAgB;QACtB,IAAMC,qBAAqB;QAC3B,IAAMC,2BAA2B;QACjC,IAAMC,4BAA4B;QAClC,IAAMC,oBAAoB;QAC1B,IAAMC,0BAA0B;QAChC,IAAMC,qBAAqB;QAC3B,IAAMC,2BAA2B;QAEjC,IAAMC,mBAAmB,CAAA;QAEzBA,iBAAiB,KAAQ;QACzBA,iBAAiB,KAAQ;QACzBA,iBAAiB,KAAQ;QACzBA,iBAAiB,KAAQ;QACzBA,iBAAiB,MAAQ;QACzBA,iBAAiB,MAAQ;QACzBA,iBAAiB,MAAQ;QACzBA,iBAAiB,MAAQ;QACzBA,iBAAiB,MAAQ;QACzBA,iBAAiB,MAAQ;QACzBA,iBAAiB,MAAQ;QACzBA,iBAAiB,OAAQ;QACzBA,iBAAiB,OAAQ;QACzBA,iBAAiB,QAAU;QAC3BA,iBAAiB,QAAU;QAE3B,IAAMC,6BAA6B,EACjC,KAAK,KAAK,OAAO,OAAO,OAAO,MAAM,MAAM,MAC3C,KAAK,KAAK,MAAM,MAAM,MAAM,OAAO,OAAO;QAG5C,IAAMC,2BAA2B;QAEjC,SAASC,gBAAiB7V,SAAQtB;YAChC,IAAIA,SAAQ,MAAM,OAAO,CAAA;YAEzB,IAAM/D,SAAS,CAAA;YACf,IAAMP,OAAOD,OAAOC,KAAKsE;YAEzB,KAAA,IAASrE,QAAQ,GAAGC,SAASF,KAAKE,QAAQD,QAAQC,QAAQD,SAAS,GAAG;gBACpE,IAAI2E,MAAM5E,KAAKC;gBACf,IAAIuE,QAAQE,OAAOJ,KAAIM;gBAEvB,IAAIA,IAAI9B,MAAM,GAAG,OAAO,MAAM;oBAC5B8B,MAAM,uBAAuBA,IAAI9B,MAAM;AACzC;gBACA,IAAM2C,QAAOG,QAAOmB,gBAAgB,YAAYnC;gBAEhD,IAAIa,SAAQuH,gBAAgBrL,KAAK8D,MAAKD,cAAchB,QAAQ;oBAC1DA,QAAQiB,MAAKD,aAAahB;AAC5B;gBAEAjE,OAAOqE,OAAOJ;AAChB;YAEA,OAAOjE;AACT;QAEA,SAASmb,UAAWC;YAClB,IAAI1I;YACJ,IAAI/S;YAEJ,IAAMG,SAASsb,UAAU3Z,SAAS,IAAIuH;YAEtC,IAAIoS,aAAa,KAAM;gBACrB1I,SAAS;gBACT/S,SAAS;AACX,mBAAA,IAAWyb,aAAa,OAAQ;gBAC9B1I,SAAS;gBACT/S,SAAS;AACX,mBAAA,IAAWyb,aAAa,YAAY;gBAClC1I,SAAS;gBACT/S,SAAS;AACX,mBAAO;gBACL,MAAM,IAAIuB,eAAc;AAC1B;YAEA,OAAO,OAAOwR,SAASpS,QAAOT,OAAO,KAAKF,SAASG,OAAOH,UAAUG;AACtE;QAEA,IAAMub,sBAAsB;QAC5B,IAAMC,sBAAsB;QAE5B,SAAS1L,MAAO/M;YACdxB,KAAKgE,SAASxC,QAAQ,aAAa+K;YACnCvM,KAAK0B,SAASX,KAAKO,IAAI,GAAIE,QAAQ,aAAa;YAChDxB,KAAKka,gBAAgB1Y,QAAQ,oBAAoB;YACjDxB,KAAKma,cAAc3Y,QAAQ,kBAAkB;YAC7CxB,KAAKoa,YAAanb,QAAOzB,UAAUgE,QAAQ,iBAAgB,IAAKA,QAAQ;YACxExB,KAAKqa,WAAWR,gBAAgB7Z,KAAKgE,QAAQxC,QAAQ,aAAa;YAClExB,KAAKsa,WAAW9Y,QAAQ,eAAe;YACvCxB,KAAKua,YAAY/Y,QAAQ,gBAAgB;YACzCxB,KAAKwa,SAAShZ,QAAQ,aAAa;YACnCxB,KAAKya,eAAejZ,QAAQ,mBAAmB;YAC/CxB,KAAK0a,eAAelZ,QAAQ,mBAAmB;YAC/CxB,KAAK2a,cAAcnZ,QAAQ,mBAAmB,MAAMyY,sBAAsBD;YAC1Eha,KAAK4a,cAAcpZ,QAAQ,kBAAkB;YAC7CxB,KAAK6a,kBAAkBrZ,QAAQ,gBAAgB,aAAaA,QAAQ,cAAc;YAElFxB,KAAK8O,gBAAgB9O,KAAKgE,OAAOiB;YACjCjF,KAAK8a,gBAAgB9a,KAAKgE,OAAOkB;YAEjClF,KAAKgD,MAAM;YACXhD,KAAKrB,SAAS;YAEdqB,KAAK+a,aAAa;YAClB/a,KAAKgb,iBAAiB;AACxB;QAGA,SAASC,aAAcxc,QAAQyc;YAC7B,IAAMC,MAAMlc,QAAOT,OAAO,KAAK0c;YAC/B,IAAIxa,WAAW;YACf,IAAI/B,SAAS;YACb,IAAML,SAASG,OAAOH;YAEtB,OAAOoC,WAAWpC,QAAQ;gBACxB,IAAIoB,YAAI;gBACR,IAAM0b,OAAO3c,OAAOwE,QAAQ,MAAMvC;gBAClC,IAAI0a,UAAS,GAAI;oBACf1b,OAAOjB,OAAOyC,MAAMR;oBACpBA,WAAWpC;AACb,uBAAO;oBACLoB,OAAOjB,OAAOyC,MAAMR,UAAU0a,OAAO;oBACrC1a,WAAW0a,OAAO;AACpB;gBAEA,IAAI1b,KAAKpB,UAAUoB,SAAS,MAAMf,UAAUwc;gBAE5Cxc,UAAUe;AACZ;YAEA,OAAOf;AACT;QAEA,SAAS0c,iBAAkB9L,OAAO+L;YAChC,OAAO,OAAOrc,QAAOT,OAAO,KAAK+Q,MAAM7N,SAAS4Z;AAClD;QAEA,SAASC,sBAAuBhM,OAAOtO;YACrC,KAAA,IAAS5C,QAAQ,GAAGC,SAASiR,MAAMT,cAAcxQ,QAAQD,QAAQC,QAAQD,SAAS,GAAG;gBACnF,IAAMwF,QAAO0L,MAAMT,cAAczQ;gBAEjC,IAAIwF,MAAKV,QAAQlC,OAAM;oBACrB,OAAO;AACT;AACF;YAEA,OAAO;AACT;QAGA,SAASua,aAAcjV;YACrB,OAAOA,MAAM8R,cAAc9R,MAAM2R;AACnC;QAMA,SAASuD,YAAalV;YACpB,OAAQA,KAAK,MAAWA,KAAK,OACzBA,KAAK,OAAWA,KAAK,SAAaA,MAAM,QAAUA,MAAM,QACxDA,KAAK,SAAWA,KAAK,SAAaA,MAAM0R,YACzC1R,KAAK,SAAWA,KAAK;AAC1B;QAOA,SAASmV,qBAAsBnV;YAC7B,OAAOkV,YAAYlV,MACjBA,MAAM0R,YAEN1R,MAAM6R,wBACN7R,MAAM4R;AACV;QAWA,SAASwD,YAAapV,GAAGqV,MAAMC;YAC7B,IAAMC,wBAAwBJ,qBAAqBnV;YACnD,IAAMwV,YAAYD,0BAA0BN,aAAajV;YACzD,QAGIsV,UACIC,wBACAA,yBAEAvV,MAAMsS,cACNtS,MAAM6S,4BACN7S,MAAM8S,6BACN9S,MAAMgT,2BACNhT,MAAMkT,6BAGZlT,MAAMiS,gBACJoD,SAAS7C,eAAegD,cAE3BL,qBAAqBE,UAAUJ,aAAaI,SAASrV,MAAMiS,cAC3DoD,SAAS7C,cAAcgD;AAC1B;QAGA,SAASC,iBAAkBzV;YAIzB,OAAOkV,YAAYlV,MACjBA,MAAM0R,aACLuD,aAAajV,MAGdA,MAAMuS,cACNvS,MAAM2S,iBACN3S,MAAMwS,cACNxS,MAAMsS,cACNtS,MAAM6S,4BACN7S,MAAM8S,6BACN9S,MAAMgT,2BACNhT,MAAMkT,4BAENlT,MAAMiS,cACNjS,MAAMmS,kBACNnS,MAAMqS,iBACNrS,MAAM+R,oBACN/R,MAAMiT,sBACNjT,MAAMyS,eACNzS,MAAM0S,qBACN1S,MAAMoS,qBACNpS,MAAMgS,qBAENhS,MAAMkS,gBACNlS,MAAM4S,sBACN5S,MAAM+S;AACV;QAGA,SAAS2C,gBAAiB1V;YAExB,QAAQiV,aAAajV,MAAMA,MAAMwS;AACnC;QAGA,SAASmD,YAAazd,QAAQ2C;YAC5B,IAAM+a,QAAQ1d,OAAOsI,WAAW3F;YAChC,IAAIwI;YAEJ,IAAIuS,SAAS,SAAUA,SAAS,SAAU/a,MAAM,IAAI3C,OAAOH,QAAQ;gBACjEsL,SAASnL,OAAOsI,WAAW3F,MAAM;gBACjC,IAAIwI,UAAU,SAAUA,UAAU,OAAQ;oBAExC,QAAQuS,QAAQ,SAAU,OAAQvS,SAAS,QAAS;AACtD;AACF;YACA,OAAOuS;AACT;QAGA,SAASC,oBAAqB3d;YAC5B,IAAM4d,iBAAiB;YACvB,OAAOA,eAAerU,KAAKvJ;AAC7B;QAEA,IAAM6d,cAAc;QACpB,IAAMC,eAAe;QACrB,IAAMC,gBAAgB;QACtB,IAAMC,eAAe;QACrB,IAAMC,eAAe;QASrB,SAASC,kBAAmBle,QAAQme,gBAAgBC,gBAAgBtC,WAClEuC,mBAAmBnC,aAAaC,aAAaiB;YAC7C,IAAIvZ;YACJ,IAAIya,OAAO;YACX,IAAIC,WAAW;YACf,IAAIC,eAAe;YACnB,IAAIC,kBAAkB;YACtB,IAAMC,mBAAmB5C,eAAc;YACvC,IAAI6C,qBAAoB;YACxB,IAAIC,QAAQrB,iBAAiBE,YAAYzd,QAAQ,OAC/Cwd,gBAAgBC,YAAYzd,QAAQA,OAAOH,SAAS;YAEtD,IAAIse,kBAAkBhC,aAAa;gBAGjC,KAAKtY,IAAI,GAAGA,IAAI7D,OAAOH,QAAQye,QAAQ,QAAUza,KAAK,IAAIA,KAAK;oBAC7Dya,OAAOb,YAAYzd,QAAQ6D;oBAC3B,KAAKmZ,YAAYsB,OAAO;wBACtB,OAAOL;AACT;oBACAW,QAAQA,SAAS1B,YAAYoB,MAAMC,UAAUnB;oBAC7CmB,WAAWD;AACb;AACF,mBAAO;gBAEL,KAAKza,IAAI,GAAGA,IAAI7D,OAAOH,QAAQye,QAAQ,QAAUza,KAAK,IAAIA,KAAK;oBAC7Dya,OAAOb,YAAYzd,QAAQ6D;oBAC3B,IAAIya,SAAS5E,gBAAgB;wBAC3B8E,eAAe;wBAEf,IAAIE,kBAAkB;4BACpBD,kBAAkBA,mBAEf5a,IAAI8a,oBAAoB,IAAI7C,aAC5B9b,OAAO2e,oBAAoB,OAAO;4BACrCA,oBAAoB9a;AACtB;AACF,2BAAA,KAAYmZ,YAAYsB,OAAO;wBAC7B,OAAOL;AACT;oBACAW,QAAQA,SAAS1B,YAAYoB,MAAMC,UAAUnB;oBAC7CmB,WAAWD;AACb;gBAEAG,kBAAkBA,mBAAoBC,oBACnC7a,IAAI8a,oBAAoB,IAAI7C,aAC5B9b,OAAO2e,oBAAoB,OAAO;AACvC;YAIA,KAAKH,iBAAiBC,iBAAiB;gBAGrC,IAAIG,UAAUzC,gBAAgBkC,kBAAkBre,SAAS;oBACvD,OAAO6d;AACT;gBACA,OAAO3B,gBAAgBV,sBAAsByC,eAAeH;AAC9D;YAEA,IAAIM,iBAAiB,KAAKT,oBAAoB3d,SAAS;gBACrD,OAAOie;AACT;YAGA,KAAK9B,aAAa;gBAChB,OAAOsC,kBAAkBT,eAAeD;AAC1C;YACA,OAAO7B,gBAAgBV,sBAAsByC,eAAeH;AAC9D;QAQA,SAASe,YAAa/N,OAAO9Q,QAAQ6c,OAAOiC,OAAO1B;YACjDtM,MAAMiO;gBACJ,IAAI/e,OAAOH,WAAW,GAAG;oBACvB,OAAOiR,MAAMoL,gBAAgBV,sBAAsB,OAAO;AAC5D;gBACA,KAAK1K,MAAMkL,cAAc;oBACvB,IAAId,2BAA2B1W,QAAQxE,kBAAkBmb,yBAAyB5R,KAAKvJ,SAAS;wBAC9F,OAAO8Q,MAAMoL,gBAAgBV,sBAAuB,MAAMxb,SAAS,MAAQ,MAAMA,SAAS;AAC5F;AACF;gBAEA,IAAMiD,SAAS6N,MAAM7N,SAASX,KAAKO,IAAI,GAAGga;gBAQ1C,IAAMf,YAAahL,MAAMgL,eAAc,SAEnCxZ,KAAKO,IAAIP,KAAKsB,IAAIkN,MAAMgL,WAAW,KAAKhL,MAAMgL,YAAY7Y;gBAG9D,IAAMkb,iBAAiBW,SAEpBhO,MAAM6K,aAAY,KAAMkB,SAAS/L,MAAM6K;gBAC1C,SAASqD,cAAehf;oBACtB,OAAO8c,sBAAsBhM,OAAO9Q;AACtC;gBAEA,QAAQke,kBAAkBle,QAAQme,gBAAgBrN,MAAM7N,QAAQ6Y,WAC9DkD,eAAelO,MAAMoL,aAAapL,MAAMqL,gBAAgB2C,OAAO1B;kBAC/D,KAAKS;oBACH,OAAO7d;;kBACT,KAAK8d;oBACH,OAAO,MAAM9d,OAAO0C,QAAQ,MAAM,QAAQ;;kBAC5C,KAAKqb;oBACH,OAAO,MAAMkB,YAAYjf,QAAQ8Q,MAAM7N,UACrCic,kBAAkB1C,aAAaxc,QAAQiD;;kBAC3C,KAAK+a;oBACH,OAAO,MAAMiB,YAAYjf,QAAQ8Q,MAAM7N,UACrCic,kBAAkB1C,aAAa2C,WAAWnf,QAAQ8b,YAAY7Y;;kBAClE,KAAKgb;oBACH,OAAO,MAAMmB,aAAapf,UAAqB;;kBACjD;oBACE,MAAM,IAAIoB,eAAc;;AAE9B;AACF;QAGA,SAAS6d,YAAajf,QAAQoe;YAC5B,IAAMiB,kBAAkB1B,oBAAoB3d,UAAUqE,OAAO+Z,kBAAkB;YAG/E,IAAMkB,OAAOtf,OAAOA,OAAOH,SAAS,OAAO;YAC3C,IAAM0f,OAAOD,SAAStf,OAAOA,OAAOH,SAAS,OAAO,QAAQG,WAAW;YACvE,IAAMwf,QAAQD,OAAO,MAAOD,OAAO,KAAK;YAExC,OAAOD,kBAAkBG,QAAQ;AACnC;QAGA,SAASN,kBAAmBlf;YAC1B,OAAOA,OAAOA,OAAOH,SAAS,OAAO,OAAOG,OAAOyC,MAAM,IAAG,KAAMzC;AACpE;QAIA,SAASmf,WAAYnf,QAAQyf;YAK3B,IAAMC,SAAS;YAGf,IAAIxf;gBACF,IAAIyf,SAAS3f,OAAOwE,QAAQ;gBAC5Bmb,SAASA,YAAW,IAAKA,SAAS3f,OAAOH;gBACzC6f,OAAOE,YAAYD;gBACnB,OAAOE,SAAS7f,OAAOyC,MAAM,GAAGkd,SAASF;AAC3C;YAEA,IAAIK,mBAAmB9f,OAAO,OAAO,QAAQA,OAAO,OAAO;YAC3D,IAAI+f;YAGJ,IAAIxc;YACJ,OAAQA,QAAQmc,OAAOjc,KAAKzD,SAAU;gBACpC,IAAM2S,SAASpP,MAAM;gBACrB,IAAMtC,OAAOsC,MAAM;gBAEnBwc,eAAgB9e,KAAK,OAAO;gBAC5Bf,UAAUyS,WACLmN,qBAAqBC,gBAAgB9e,SAAS,KAAM,OAAO,MAC9D4e,SAAS5e,MAAMwe;gBACjBK,mBAAmBC;AACrB;YAEA,OAAO7f;AACT;QAMA,SAAS2f,SAAU5e,MAAMwe;YACvB,IAAIxe,SAAS,MAAMA,KAAK,OAAO,KAAK,OAAOA;YAG3C,IAAM+e,UAAU;YAChB,IAAIzc;YAEJ,IAAI0P,QAAQ;YACZ,IAAIC;YACJ,IAAI+M,OAAO;YACX,IAAItD,OAAO;YACX,IAAIzc,SAAS;YAMb,OAAQqD,QAAQyc,QAAQvc,KAAKxC,OAAQ;gBACnC0b,OAAOpZ,MAAM3D;gBAEb,IAAI+c,OAAO1J,QAAQwM,OAAO;oBACxBvM,MAAO+M,OAAOhN,QAASgN,OAAOtD;oBAC9Bzc,UAAU,OAAOe,KAAKwB,MAAMwQ,OAAOC;oBAEnCD,QAAQC,MAAM;AAChB;gBACA+M,OAAOtD;AACT;YAIAzc,UAAU;YAEV,IAAIe,KAAKpB,SAASoT,QAAQwM,SAASQ,OAAOhN,OAAO;gBAC/C/S,UAAUe,KAAKwB,MAAMwQ,OAAOgN,QAAQ,OAAOhf,KAAKwB,MAAMwd,OAAO;AAC/D,mBAAO;gBACL/f,UAAUe,KAAKwB,MAAMwQ;AACvB;YAEA,OAAO/S,OAAOuC,MAAM;AACtB;QAGA,SAAS2c,aAAcpf;YACrB,IAAIE,SAAS;YACb,IAAIoe,OAAO;YAEX,KAAA,IAASza,IAAI,GAAGA,IAAI7D,OAAOH,QAAQye,QAAQ,QAAUza,KAAK,IAAIA,KAAK;gBACjEya,OAAOb,YAAYzd,QAAQ6D;gBAC3B,IAAMqc,YAAYjF,iBAAiBqD;gBAEnC,KAAK4B,aAAalD,YAAYsB,OAAO;oBACnCpe,UAAUF,OAAO6D;oBACjB,IAAIya,QAAQ,OAASpe,UAAUF,OAAO6D,IAAI;AAC5C,uBAAO;oBACL3D,UAAUggB,aAAa7E,UAAUiD;AACnC;AACF;YAEA,OAAOpe;AACT;QAEA,SAASigB,kBAAmBrP,OAAO+L,OAAO3V;YACxC,IAAIkM,UAAU;YACd,IAAM0C,OAAOhF,MAAMvM;YAEnB,KAAA,IAAS3E,QAAQ,GAAGC,SAASqH,OAAOrH,QAAQD,QAAQC,QAAQD,SAAS,GAAG;gBACtE,IAAI2I,QAAQrB,OAAOtH;gBAEnB,IAAIkR,MAAMsL,UAAU;oBAClB7T,QAAQuI,MAAMsL,SAAS9a,KAAK4F,QAAQ7C,OAAOzE,QAAQ2I;AACrD;gBAGA,IAAI6X,UAAUtP,OAAO+L,OAAOtU,OAAO,OAAO,iBAC9BA,UAAU,eACjB6X,UAAUtP,OAAO+L,OAAO,MAAM,OAAO,QAAS;oBACjD,IAAIzJ,YAAY,IAAIA,WAAW,QAAQtC,MAAMmL,eAAe,MAAM;oBAClE7I,WAAWtC,MAAMiO;AACnB;AACF;YAEAjO,MAAMvM,MAAMuR;YACZhF,MAAMiO,OAAO,MAAM3L,UAAU;AAC/B;QAEA,SAASiN,mBAAoBvP,OAAO+L,OAAO3V,QAAQvG;YACjD,IAAIyS,UAAU;YACd,IAAM0C,OAAOhF,MAAMvM;YAEnB,KAAA,IAAS3E,QAAQ,GAAGC,SAASqH,OAAOrH,QAAQD,QAAQC,QAAQD,SAAS,GAAG;gBACtE,IAAI2I,QAAQrB,OAAOtH;gBAEnB,IAAIkR,MAAMsL,UAAU;oBAClB7T,QAAQuI,MAAMsL,SAAS9a,KAAK4F,QAAQ7C,OAAOzE,QAAQ2I;AACrD;gBAGA,IAAI6X,UAAUtP,OAAO+L,QAAQ,GAAGtU,OAAO,MAAM,MAAM,OAAO,gBAC9CA,UAAU,eACjB6X,UAAUtP,OAAO+L,QAAQ,GAAG,MAAM,MAAM,MAAM,OAAO,OAAQ;oBAChE,KAAKlc,WAAWyS,YAAY,IAAI;wBAC9BA,WAAWwJ,iBAAiB9L,OAAO+L;AACrC;oBAEA,IAAI/L,MAAMiO,QAAQrF,mBAAmB5I,MAAMiO,KAAKzW,WAAW,IAAI;wBAC7D8K,WAAW;AACb,2BAAO;wBACLA,WAAW;AACb;oBAEAA,WAAWtC,MAAMiO;AACnB;AACF;YAEAjO,MAAMvM,MAAMuR;YACZhF,MAAMiO,OAAO3L,WAAW;AAC1B;QAEA,SAASkN,iBAAkBxP,OAAO+L,OAAO3V;YACvC,IAAIkM,UAAU;YACd,IAAM0C,OAAOhF,MAAMvM;YACnB,IAAMgc,gBAAgB7gB,OAAOC,KAAKuH;YAElC,KAAA,IAAStH,QAAQ,GAAGC,SAAS0gB,cAAc1gB,QAAQD,QAAQC,QAAQD,SAAS,GAAG;gBAC7E,IAAI4gB,aAAa;gBACjB,IAAIpN,YAAY,IAAIoN,cAAc;gBAElC,IAAI1P,MAAMmL,cAAcuE,cAAc;gBAEtC,IAAMC,YAAYF,cAAc3gB;gBAChC,IAAI8gB,cAAcxZ,OAAOuZ;gBAEzB,IAAI3P,MAAMsL,UAAU;oBAClBsE,cAAc5P,MAAMsL,SAAS9a,KAAK4F,QAAQuZ,WAAWC;AACvD;gBAEA,KAAKN,UAAUtP,OAAO+L,OAAO4D,WAAW,OAAO,QAAQ;oBACrD;AACF;gBAEA,IAAI3P,MAAMiO,KAAKlf,SAAS,MAAM2gB,cAAc;gBAE5CA,cAAc1P,MAAMiO,QAAQjO,MAAMmL,eAAe,MAAM,MAAM,OAAOnL,MAAMmL,eAAe,KAAK;gBAE9F,KAAKmE,UAAUtP,OAAO+L,OAAO6D,aAAa,OAAO,QAAQ;oBACvD;AACF;gBAEAF,cAAc1P,MAAMiO;gBAGpB3L,WAAWoN;AACb;YAEA1P,MAAMvM,MAAMuR;YACZhF,MAAMiO,OAAO,MAAM3L,UAAU;AAC/B;QAEA,SAASuN,kBAAmB7P,OAAO+L,OAAO3V,QAAQvG;YAChD,IAAIyS,UAAU;YACd,IAAM0C,OAAOhF,MAAMvM;YACnB,IAAMgc,gBAAgB7gB,OAAOC,KAAKuH;YAGlC,IAAI4J,MAAM+K,aAAa,MAAM;gBAE3B0E,cAAcK;8BACE9P,MAAM+K,aAAa,YAAY;gBAE/C0E,cAAcK,KAAK9P,MAAM+K;AAC3B,mBAAA,IAAW/K,MAAM+K,UAAU;gBAEzB,MAAM,IAAIza,eAAc;AAC1B;YAEA,KAAA,IAASxB,QAAQ,GAAGC,SAAS0gB,cAAc1gB,QAAQD,QAAQC,QAAQD,SAAS,GAAG;gBAC7E,IAAI4gB,aAAa;gBAEjB,KAAK7f,WAAWyS,YAAY,IAAI;oBAC9BoN,cAAc5D,iBAAiB9L,OAAO+L;AACxC;gBAEA,IAAM4D,YAAYF,cAAc3gB;gBAChC,IAAI8gB,cAAcxZ,OAAOuZ;gBAEzB,IAAI3P,MAAMsL,UAAU;oBAClBsE,cAAc5P,MAAMsL,SAAS9a,KAAK4F,QAAQuZ,WAAWC;AACvD;gBAEA,KAAKN,UAAUtP,OAAO+L,QAAQ,GAAG4D,WAAW,MAAM,MAAM,OAAO;oBAC7D;AACF;gBAEA,IAAMI,eAAgB/P,MAAMvM,QAAQ,QAAQuM,MAAMvM,QAAQ,OAC1CuM,MAAMiO,QAAQjO,MAAMiO,KAAKlf,SAAS;gBAElD,IAAIghB,cAAc;oBAChB,IAAI/P,MAAMiO,QAAQrF,mBAAmB5I,MAAMiO,KAAKzW,WAAW,IAAI;wBAC7DkY,cAAc;AAChB,2BAAO;wBACLA,cAAc;AAChB;AACF;gBAEAA,cAAc1P,MAAMiO;gBAEpB,IAAI8B,cAAc;oBAChBL,cAAc5D,iBAAiB9L,OAAO+L;AACxC;gBAEA,KAAKuD,UAAUtP,OAAO+L,QAAQ,GAAG6D,aAAa,MAAMG,eAAe;oBACjE;AACF;gBAEA,IAAI/P,MAAMiO,QAAQrF,mBAAmB5I,MAAMiO,KAAKzW,WAAW,IAAI;oBAC7DkY,cAAc;AAChB,uBAAO;oBACLA,cAAc;AAChB;gBAEAA,cAAc1P,MAAMiO;gBAGpB3L,WAAWoN;AACb;YAEA1P,MAAMvM,MAAMuR;YACZhF,MAAMiO,OAAO3L,WAAW;AAC1B;QAEA,SAAS0N,WAAYhQ,OAAO5J,QAAQb;YAClC,IAAMwS,WAAWxS,WAAWyK,MAAMuL,gBAAgBvL,MAAMT;YAExD,KAAA,IAASzQ,QAAQ,GAAGC,SAASgZ,SAAShZ,QAAQD,QAAQC,QAAQD,SAAS,GAAG;gBACxE,IAAMwF,QAAOyT,SAASjZ;gBAEtB,KAAKwF,MAAKP,cAAcO,MAAKN,gBACvBM,MAAKP,cAAgBpG,QAAOyI,YAAW,YAAcA,kBAAkB9B,MAAKP,iBAC5EO,MAAKN,aAAaM,MAAKN,UAAUoC,UAAU;oBAC/C,IAAIb,UAAU;wBACZ,IAAIjB,MAAKF,SAASE,MAAKJ,eAAe;4BACpC8L,MAAMvM,MAAMa,MAAKJ,cAAckC;AACjC,+BAAO;4BACL4J,MAAMvM,MAAMa,MAAKb;AACnB;AACF,2BAAO;wBACLuM,MAAMvM,MAAM;AACd;oBAEA,IAAIa,MAAKL,WAAW;wBAClB,IAAMZ,QAAQ2M,MAAM8K,SAASxW,MAAKb,QAAQa,MAAKH;wBAE/C,IAAImO,eAAO;wBACX,IAAIvG,UAAUvL,KAAK8D,MAAKL,eAAe,qBAAqB;4BAC1DqO,UAAUhO,MAAKL,UAAUmC,QAAQ/C;AACnC,mCAAWwI,gBAAgBrL,KAAK8D,MAAKL,WAAWZ,QAAQ;4BACtDiP,UAAUhO,MAAKL,UAAUZ,OAAO+C,QAAQ/C;AAC1C,+BAAO;4BACL,MAAM,IAAI/C,eAAc,OAAOgE,MAAKb,MAAM,iCAAiCJ,QAAQ;AACrF;wBAEA2M,MAAMiO,OAAO3L;AACf;oBAEA,OAAO;AACT;AACF;YAEA,OAAO;AACT;QAKA,SAASgN,UAAWtP,OAAO+L,OAAO3V,QAAQ6Z,OAAOpgB,SAASme,OAAOkC;YAC/DlQ,MAAMvM,MAAM;YACZuM,MAAMiO,OAAO7X;YAEb,KAAK4Z,WAAWhQ,OAAO5J,QAAQ,QAAQ;gBACrC4Z,WAAWhQ,OAAO5J,QAAQ;AAC5B;YAEA,IAAM9B,QAAOyH,UAAUvL,KAAKwP,MAAMiO;YAClC,IAAM3B,UAAU2D;YAEhB,IAAIA,OAAO;gBACTA,QAASjQ,MAAM6K,YAAY,KAAK7K,MAAM6K,YAAYkB;AACpD;YAEA,IAAMoE,gBAAgB7b,UAAS,qBAAqBA,UAAS;YAC7D,IAAI8b;YACJ,IAAIC;YAEJ,IAAIF,eAAe;gBACjBC,iBAAiBpQ,MAAMwL,WAAW9X,QAAQ0C;gBAC1Cia,YAAYD,oBAAmB;AACjC;YAEA,IAAKpQ,MAAMvM,QAAQ,QAAQuM,MAAMvM,QAAQ,OAAQ4c,aAAcrQ,MAAM7N,WAAW,KAAK4Z,QAAQ,GAAI;gBAC/Flc,UAAU;AACZ;YAEA,IAAIwgB,aAAarQ,MAAMyL,eAAe2E,iBAAiB;gBACrDpQ,MAAMiO,OAAO,UAAUmC;AACzB,mBAAO;gBACL,IAAID,iBAAiBE,cAAcrQ,MAAMyL,eAAe2E,iBAAiB;oBACvEpQ,MAAMyL,eAAe2E,kBAAkB;AACzC;gBACA,IAAI9b,UAAS,mBAAmB;oBAC9B,IAAI2b,SAAUrhB,OAAOC,KAAKmR,MAAMiO,MAAMlf,WAAW,GAAI;wBACnD8gB,kBAAkB7P,OAAO+L,OAAO/L,MAAMiO,MAAMpe;wBAC5C,IAAIwgB,WAAW;4BACbrQ,MAAMiO,OAAO,UAAUmC,iBAAiBpQ,MAAMiO;AAChD;AACF,2BAAO;wBACLuB,iBAAiBxP,OAAO+L,OAAO/L,MAAMiO;wBACrC,IAAIoC,WAAW;4BACbrQ,MAAMiO,OAAO,UAAUmC,iBAAiB,MAAMpQ,MAAMiO;AACtD;AACF;AACF,uBAAA,IAAW3Z,UAAS,kBAAkB;oBACpC,IAAI2b,SAAUjQ,MAAMiO,KAAKlf,WAAW,GAAI;wBACtC,IAAIiR,MAAM2K,kBAAkBuF,cAAcnE,QAAQ,GAAG;4BACnDwD,mBAAmBvP,OAAO+L,QAAQ,GAAG/L,MAAMiO,MAAMpe;AACnD,+BAAO;4BACL0f,mBAAmBvP,OAAO+L,OAAO/L,MAAMiO,MAAMpe;AAC/C;wBACA,IAAIwgB,WAAW;4BACbrQ,MAAMiO,OAAO,UAAUmC,iBAAiBpQ,MAAMiO;AAChD;AACF,2BAAO;wBACLoB,kBAAkBrP,OAAO+L,OAAO/L,MAAMiO;wBACtC,IAAIoC,WAAW;4BACbrQ,MAAMiO,OAAO,UAAUmC,iBAAiB,MAAMpQ,MAAMiO;AACtD;AACF;AACF,uBAAA,IAAW3Z,UAAS,mBAAmB;oBACrC,IAAI0L,MAAMvM,QAAQ,KAAK;wBACrBsa,YAAY/N,OAAOA,MAAMiO,MAAMlC,OAAOiC,OAAO1B;AAC/C;AACF,uBAAA,IAAWhY,UAAS,sBAAsB;oBACxC,OAAO;AACT,uBAAO;oBACL,IAAI0L,MAAM4K,aAAa,OAAO;oBAC9B,MAAM,IAAIta,eAAc,4CAA4CgE;AACtE;gBAEA,IAAI0L,MAAMvM,QAAQ,QAAQuM,MAAMvM,QAAQ,KAAK;oBAc3C,IAAI6c,SAASC,UACXvQ,MAAMvM,IAAI,OAAO,MAAMuM,MAAMvM,IAAI9B,MAAM,KAAKqO,MAAMvM,KAClD7B,QAAQ,MAAM;oBAEhB,IAAIoO,MAAMvM,IAAI,OAAO,KAAK;wBACxB6c,SAAS,MAAMA;AACjB,+BAAWA,OAAO3e,MAAM,GAAG,QAAQ,sBAAsB;wBACvD2e,SAAS,OAAOA,OAAO3e,MAAM;AAC/B,2BAAO;wBACL2e,SAAS,OAAOA,SAAS;AAC3B;oBAEAtQ,MAAMiO,OAAOqC,SAAS,MAAMtQ,MAAMiO;AACpC;AACF;YAEA,OAAO;AACT;QAEA,SAASuC,uBAAwBpa,QAAQ4J;YACvC,IAAMyQ,UAAU;YAChB,IAAMC,oBAAoB;YAE1BC,YAAYva,QAAQqa,SAASC;YAE7B,IAAM3hB,SAAS2hB,kBAAkB3hB;YACjC,KAAA,IAASD,QAAQ,GAAGA,QAAQC,QAAQD,SAAS,GAAG;gBAC9CkR,MAAMwL,WAAW5Y,KAAK6d,QAAQC,kBAAkB5hB;AAClD;YACAkR,MAAMyL,iBAAiB,IAAInd,MAAMS;AACnC;QAEA,SAAS4hB,YAAava,QAAQqa,SAASC;YACrC,IAAIta,WAAW,QAAQzI,QAAOyI,YAAW,UAAU;gBACjD,IAAMtH,QAAQ2hB,QAAQ/c,QAAQ0C;gBAC9B,IAAItH,WAAU,GAAI;oBAChB,IAAI4hB,kBAAkBhd,QAAQ5E,YAAW,GAAI;wBAC3C4hB,kBAAkB9d,KAAK9D;AACzB;AACF,uBAAO;oBACL2hB,QAAQ7d,KAAKwD;oBAEb,IAAI9H,MAAMC,QAAQ6H,SAAS;wBACzB,KAAA,IAASrD,IAAI,GAAGhE,SAASqH,OAAOrH,QAAQgE,IAAIhE,QAAQgE,KAAK,GAAG;4BAC1D4d,YAAYva,OAAOrD,IAAI0d,SAASC;AAClC;AACF,2BAAO;wBACL,IAAMjB,gBAAgB7gB,OAAOC,KAAKuH;wBAElC,KAAA,IAASrD,KAAI,GAAGhE,UAAS0gB,cAAc1gB,QAAQgE,KAAIhE,SAAQgE,MAAK,GAAG;4BACjE4d,YAAYva,OAAOqZ,cAAc1c,MAAK0d,SAASC;AACjD;AACF;AACF;AACF;AACF;QAEA,SAASzC,MAAM1S,OAAOtJ;YACpBA,UAAUA,WAAW,CAAA;YAErB,IAAM+N,QAAQ,IAAIhB,MAAM/M;YAExB,KAAK+N,MAAMiL,QAAQuF,uBAAuBjV,OAAOyE;YAEjD,IAAIvI,QAAQ8D;YAEZ,IAAIyE,MAAMsL,UAAU;gBAClB7T,QAAQuI,MAAMsL,SAAS9a,KAAK;oBAAE,IAAIiH;mBAAS,IAAIA;AACjD;YAEA,IAAI6X,UAAUtP,OAAO,GAAGvI,OAAO,MAAM,OAAO,OAAOuI,MAAMiO,OAAO;YAEhE,OAAO;AACT;QAEA2C,OAAA3C,OAAsBA;;;;;;;QCt6BtB,IAAMxF,UAAS3X;QACf,IAAM8f,UAASrc;QAEf,SAASsc,QAASC,MAAMC;YACtB,OAAO;gBACL,MAAM,IAAIxgB,MAAM,mBAAmBugB,OAAO,wCAC1BC,KAAK;;AAEzB;QAEAC,OAAAxd,OAAsBuC;QACtBib,OAAA5b,SAAwBY;QACxBgb,OAAAC,kBAAiC3X;QACjC0X,OAAAE,cAA6BpU;QAC7BkU,OAAAG,cAA6BpU;QAC7BiU,OAAAhU,iBAAgCoU;QAChCJ,OAAAxI,OAAsBC,QAAOD;QAC7BwI,OAAAzI,UAAyBE,QAAOF;QAChCyI,OAAA/C,OAAsB2C,QAAO3C;QAC7B+C,OAAA1gB,gBAA+B+gB;QAG/BL,OAAAM,QAAuB;YACrBvZ,QAAQwZ;YACRnY,OAAOoY;YACPre,KAAKse;YACLC,MAAMC;YACNlV,OAAOmV;YACPhV,KAAKiV;YACLhX,WAAWiX;YACXhb,MAAMib;YACNja,KAAKka;YACLjX,OAAOkX;YACP3V,MAAM4V;YACNrc,KAAKsc;YACLzgB,KAAK0gB;;QAIPpB,OAAAqB,WAA0BxB,QAAQ,YAAY;QAC9CG,OAAAsB,cAA6BzB,QAAQ,eAAe;QACpDG,OAAAuB,WAA0B1B,QAAQ,YAAY;;;;;ICzC9C,IACErd,OAcEgf,KAdFhf,MACA4B,SAaEod,KAbFpd,QACA6b,kBAYEuB,KAZFvB,iBACAC,cAWEsB,KAXFtB,aACAC,cAUEqB,KAVFrB,aACAnU,iBASEwV,KATFxV,gBACAwL,OAQEgK,KARFhK,MACAD,UAOEiK,KAPFjK,SACA0F,OAMEuE,KANFvE,MACA3d,gBAKEkiB,KALFliB,eACAghB,QAIEkB,KAJFlB,OACAe,WAGEG,KAHFH,UACAC,cAEEE,KAFFF,aACAC,WACEC,KADFD;;;;;;;;;;;;;;;;;;;"}!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).jsyaml={})}(this,function(e){"use strict";function t(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var n,r,i,o,a,l,u,c,s,p,f,d,h,m,g,y,v,b,A,k,x,w,C,S,I,T,O,j,M,F,E,N,L,_,D,U,Y,q,K,R,H,B,P,W,$={},G={},Z={};function V(){if(n)return Z;function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(t)}function t(e){return null==e}return n=1,Z.isNothing=t,Z.isObject=function(t){return"object"===e(t)&&null!==t},Z.toArray=function(e){return Array.isArray(e)?e:t(e)?[]:[e]},Z.repeat=function(e,t){for(var n="",r=0;r<t;r+=1)n+=e;return n},Z.isNegativeZero=function(e){return 0===e&&Number.NEGATIVE_INFINITY===1/e},Z.extend=function(e,t){if(t)for(var n=Object.keys(t),r=0,i=n.length;r<i;r+=1){var o=n[r];e[o]=t[o]}return e},Z}function J(){if(i)return r;function e(e,t){var n="",r=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(n+='in "'+e.mark.name+'" '),n+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!t&&e.mark.snippet&&(n+="\n\n"+e.mark.snippet),r+" "+n):r}function t(t,n){Error.call(this),this.name="YAMLException",this.reason=t,this.mark=n,this.message=e(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack||""}return i=1,t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t.prototype.toString=function(t){return this.name+": "+e(this,t)},r=t}function Q(){if(u)return l;u=1;var e=J(),t=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],n=["scalar","sequence","mapping"];return l=function(r,i){var o,a;if(i=i||{},Object.keys(i).forEach(function(n){if(-1===t.indexOf(n))throw new e('Unknown option "'+n+'" is met in definition of "'+r+'" YAML type.')}),this.options=i,this.tag=r,this.kind=i.kind||null,this.resolve=i.resolve||function(){return!0},this.construct=i.construct||function(e){return e},this.instanceOf=i.instanceOf||null,this.predicate=i.predicate||null,this.represent=i.represent||null,this.representName=i.representName||null,this.defaultStyle=i.defaultStyle||null,this.multi=i.multi||!1,this.styleAliases=(o=i.styleAliases||null,a={},null!==o&&Object.keys(o).forEach(function(e){o[e].forEach(function(t){a[String(t)]=e})}),a),-1===n.indexOf(this.kind))throw new e('Unknown kind "'+this.kind+'" is specified for "'+r+'" YAML type.')}}function z(){if(s)return c;s=1;var e=J(),t=Q();function n(e,t){var n=[];return e[t].forEach(function(e){var t=n.length;n.forEach(function(n,r){n.tag===e.tag&&n.kind===e.kind&&n.multi===e.multi&&(t=r)}),n[t]=e}),n}function r(e){return this.extend(e)}return r.prototype.extend=function(i){var o=[],a=[];if(i instanceof t)a.push(i);else if(Array.isArray(i))a=a.concat(i);else{if(!i||!Array.isArray(i.implicit)&&!Array.isArray(i.explicit))throw new e("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");i.implicit&&(o=o.concat(i.implicit)),i.explicit&&(a=a.concat(i.explicit))}o.forEach(function(n){if(!(n instanceof t))throw new e("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(n.loadKind&&"scalar"!==n.loadKind)throw new e("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(n.multi)throw new e("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),a.forEach(function(n){if(!(n instanceof t))throw new e("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var l=Object.create(r.prototype);return l.implicit=(this.implicit||[]).concat(o),l.explicit=(this.explicit||[]).concat(a),l.compiledImplicit=n(l,"implicit"),l.compiledExplicit=n(l,"explicit"),l.compiledTypeMap=function(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function t(t){t.multi?(e.multi[t.kind].push(t),e.multi.fallback.push(t)):e[t.kind][t.tag]=e.fallback[t.tag]=t}for(var n=0,r=arguments.length;n<r;n+=1)arguments[n].forEach(t);return e}(l.compiledImplicit,l.compiledExplicit),l},c=r}function X(){if(f)return p;f=1;var e=Q();return p=new e("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return null!==e?e:""}})}function ee(){if(h)return d;h=1;var e=Q();return d=new e("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return null!==e?e:[]}})}function te(){if(g)return m;g=1;var e=Q();return m=new e("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return null!==e?e:{}}})}function ne(){if(v)return y;v=1;var e=z();return y=new e({explicit:[X(),ee(),te()]})}function re(){if(A)return b;A=1;var e=Q();return b=new e("tag:yaml.org,2002:null",{kind:"scalar",resolve:function(e){if(null===e)return!0;var t=e.length;return 1===t&&"~"===e||4===t&&("null"===e||"Null"===e||"NULL"===e)},construct:function(){return null},predicate:function(e){return null===e},represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"})}function ie(){if(x)return k;x=1;var e=Q();return k=new e("tag:yaml.org,2002:bool",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t=e.length;return 4===t&&("true"===e||"True"===e||"TRUE"===e)||5===t&&("false"===e||"False"===e||"FALSE"===e)},construct:function(e){return"true"===e||"True"===e||"TRUE"===e},predicate:function(e){return"[object Boolean]"===Object.prototype.toString.call(e)},represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"})}function oe(){if(C)return w;C=1;var e=V(),t=Q();function n(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function r(e){return e>=48&&e<=55}function i(e){return e>=48&&e<=57}function o(e){var t=e,n=1,r=t[0];if("-"!==r&&"+"!==r||("-"===r&&(n=-1),r=(t=t.slice(1))[0]),"0"===t)return 0;if("0"===r){if("b"===t[1])return n*parseInt(t.slice(2),2);if("x"===t[1])return n*parseInt(t.slice(2),16);if("o"===t[1])return n*parseInt(t.slice(2),8)}return n*parseInt(t,10)}return w=new t("tag:yaml.org,2002:int",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t=e.length,a=0,l=!1;if(!t)return!1;var u=e[a];if("-"!==u&&"+"!==u||(u=e[++a]),"0"===u){if(a+1===t)return!0;if("b"===(u=e[++a])){for(a++;a<t;a++){if("0"!==(u=e[a])&&"1"!==u)return!1;l=!0}return l&&isFinite(o(e))}if("x"===u){for(a++;a<t;a++){if(!n(e.charCodeAt(a)))return!1;l=!0}return l&&isFinite(o(e))}if("o"===u){for(a++;a<t;a++){if(!r(e.charCodeAt(a)))return!1;l=!0}return l&&isFinite(o(e))}}for(;a<t;a++){if(!i(e.charCodeAt(a)))return!1;l=!0}return!!l&&isFinite(o(e))},construct:function(e){return o(e)},predicate:function(t){return"[object Number]"===Object.prototype.toString.call(t)&&t%1==0&&!e.isNegativeZero(t)},represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}})}function ae(){if(I)return S;I=1;var e=V(),t=Q(),n=new RegExp("^(?:[-+]?(?:[0-9]+)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),r=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");var i=/^[-+]?[0-9]+e/;return S=new t("tag:yaml.org,2002:float",{kind:"scalar",resolve:function(e){return null!==e&&(!!n.test(e)&&(!!isFinite(parseFloat(e,10))||r.test(e)))},construct:function(e){var t=e.toLowerCase(),n="-"===t[0]?-1:1;return"+-".indexOf(t[0])>=0&&(t=t.slice(1)),".inf"===t?1===n?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:".nan"===t?NaN:n*parseFloat(t,10)},predicate:function(t){return"[object Number]"===Object.prototype.toString.call(t)&&(t%1!=0||e.isNegativeZero(t))},represent:function(t,n){if(isNaN(t))switch(n){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===t)switch(n){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===t)switch(n){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(e.isNegativeZero(t))return"-0.0";var r=t.toString(10);return i.test(r)?r.replace("e",".e"):r},defaultStyle:"lowercase"})}function le(){return O?T:(O=1,T=ne().extend({implicit:[re(),ie(),oe(),ae()]}))}function ue(){return M?j:(M=1,j=le())}function ce(){if(E)return F;E=1;var e=Q(),t=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),n=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");return F=new e("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:function(e){return null!==e&&(null!==t.exec(e)||null!==n.exec(e))},construct:function(e){var r=0,i=null,o=t.exec(e);if(null===o&&(o=n.exec(e)),null===o)throw new Error("Date resolve error");var a=+o[1],l=+o[2]-1,u=+o[3];if(!o[4])return new Date(Date.UTC(a,l,u));var c=+o[4],s=+o[5],p=+o[6];if(o[7]){for(r=o[7].slice(0,3);r.length<3;)r+="0";r=+r}o[9]&&(i=6e4*(60*+o[10]+ +(o[11]||0)),"-"===o[9]&&(i=-i));var f=new Date(Date.UTC(a,l,u,c,s,p,r));return i&&f.setTime(f.getTime()-i),f},instanceOf:Date,represent:function(e){return e.toISOString()}})}function se(){if(L)return N;L=1;var e=Q();return N=new e("tag:yaml.org,2002:merge",{kind:"scalar",resolve:function(e){return"<<"===e||null===e}})}function pe(){if(D)return _;D=1;var e=Q(),t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";return _=new e("tag:yaml.org,2002:binary",{kind:"scalar",resolve:function(e){if(null===e)return!1;for(var n=0,r=e.length,i=t,o=0;o<r;o++){var a=i.indexOf(e.charAt(o));if(!(a>64)){if(a<0)return!1;n+=6}}return n%8==0},construct:function(e){for(var n=e.replace(/[\r\n=]/g,""),r=n.length,i=t,o=0,a=[],l=0;l<r;l++)l%4==0&&l&&(a.push(o>>16&255),a.push(o>>8&255),a.push(255&o)),o=o<<6|i.indexOf(n.charAt(l));var u=r%4*6;return 0===u?(a.push(o>>16&255),a.push(o>>8&255),a.push(255&o)):18===u?(a.push(o>>10&255),a.push(o>>2&255)):12===u&&a.push(o>>4&255),new Uint8Array(a)},predicate:function(e){return"[object Uint8Array]"===Object.prototype.toString.call(e)},represent:function(e){for(var n="",r=0,i=e.length,o=t,a=0;a<i;a++)a%3==0&&a&&(n+=o[r>>18&63],n+=o[r>>12&63],n+=o[r>>6&63],n+=o[63&r]),r=(r<<8)+e[a];var l=i%3;return 0===l?(n+=o[r>>18&63],n+=o[r>>12&63],n+=o[r>>6&63],n+=o[63&r]):2===l?(n+=o[r>>10&63],n+=o[r>>4&63],n+=o[r<<2&63],n+=o[64]):1===l&&(n+=o[r>>2&63],n+=o[r<<4&63],n+=o[64],n+=o[64]),n}})}function fe(){if(Y)return U;Y=1;var e=Q(),t=Object.prototype.hasOwnProperty,n=Object.prototype.toString;return U=new e("tag:yaml.org,2002:omap",{kind:"sequence",resolve:function(e){if(null===e)return!0;for(var r=[],i=e,o=0,a=i.length;o<a;o+=1){var l=i[o],u=!1;if("[object Object]"!==n.call(l))return!1;var c=void 0;for(c in l)if(t.call(l,c)){if(u)return!1;u=!0}if(!u)return!1;if(-1!==r.indexOf(c))return!1;r.push(c)}return!0},construct:function(e){return null!==e?e:[]}})}function de(){if(K)return q;K=1;var e=Q(),t=Object.prototype.toString;return q=new e("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:function(e){if(null===e)return!0;for(var n=e,r=new Array(n.length),i=0,o=n.length;i<o;i+=1){var a=n[i];if("[object Object]"!==t.call(a))return!1;var l=Object.keys(a);if(1!==l.length)return!1;r[i]=[l[0],a[l[0]]]}return!0},construct:function(e){if(null===e)return[];for(var t=e,n=new Array(t.length),r=0,i=t.length;r<i;r+=1){var o=t[r],a=Object.keys(o);n[r]=[a[0],o[a[0]]]}return n}})}function he(){if(H)return R;H=1;var e=Q(),t=Object.prototype.hasOwnProperty;return R=new e("tag:yaml.org,2002:set",{kind:"mapping",resolve:function(e){if(null===e)return!0;var n=e;for(var r in n)if(t.call(n,r)&&null!==n[r])return!1;return!0},construct:function(e){return null!==e?e:{}}})}function me(){return P?B:(P=1,B=ue().extend({implicit:[ce(),se()],explicit:[pe(),fe(),de(),he()]}))}function ge(){if(W)return G;function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(t)}W=1;var t=V(),n=J(),r=function(){if(a)return o;a=1;var e=V();function t(e,t,n,r,i){var o="",a="",l=Math.floor(i/2)-1;return r-t>l&&(t=r-l+(o=" ... ").length),n-r>l&&(n=r+l-(a=" ...").length),{str:o+e.slice(t,n).replace(/\t/g,"â†’")+a,pos:r-t+o.length}}function n(t,n){return e.repeat(" ",n-t.length)+t}return o=function(r,i){if(i=Object.create(i||null),!r.buffer)return null;i.maxLength||(i.maxLength=79),"number"!=typeof i.indent&&(i.indent=1),"number"!=typeof i.linesBefore&&(i.linesBefore=3),"number"!=typeof i.linesAfter&&(i.linesAfter=2);for(var o,a=/\r?\n|\r|\0/g,l=[0],u=[],c=-1;o=a.exec(r.buffer);)u.push(o.index),l.push(o.index+o[0].length),r.position<=o.index&&c<0&&(c=l.length-2);c<0&&(c=l.length-1);for(var s="",p=Math.min(r.line+i.linesAfter,u.length).toString().length,f=i.maxLength-(i.indent+p+3),d=1;d<=i.linesBefore&&!(c-d<0);d++){var h=t(r.buffer,l[c-d],u[c-d],r.position-(l[c]-l[c-d]),f);s=e.repeat(" ",i.indent)+n((r.line-d+1).toString(),p)+" | "+h.str+"\n"+s}var m=t(r.buffer,l[c],u[c],r.position,f);s+=e.repeat(" ",i.indent)+n((r.line+1).toString(),p)+" | "+m.str+"\n",s+=e.repeat("-",i.indent+p+3+m.pos)+"^\n";for(var g=1;g<=i.linesAfter&&!(c+g>=u.length);g++){var y=t(r.buffer,l[c+g],u[c+g],r.position-(l[c]-l[c+g]),f);s+=e.repeat(" ",i.indent)+n((r.line+g+1).toString(),p)+" | "+y.str+"\n"}return s.replace(/\n$/,"")}}(),i=me(),l=Object.prototype.hasOwnProperty,u=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,c=/[\x85\u2028\u2029]/,s=/[,\[\]{}]/,p=/^(?:!|!!|![0-9A-Za-z-]+!)$/,f=/^(?:!|[^,\[\]{}])(?:%[0-9a-f]{2}|[0-9a-z\-#;/?:@&=+$,_.!~*'()\[\]])*$/i;function d(e){return Object.prototype.toString.call(e)}function h(e){return 10===e||13===e}function m(e){return 9===e||32===e}function g(e){return 9===e||32===e||10===e||13===e}function y(e){return 44===e||91===e||93===e||123===e||125===e}function v(e){if(e>=48&&e<=57)return e-48;var t=32|e;return t>=97&&t<=102?t-97+10:-1}function b(e){return 120===e?2:117===e?4:85===e?8:0}function A(e){return e>=48&&e<=57?e-48:-1}function k(e){switch(e){case 48:return"\0";case 97:return"";case 98:return"\b";case 116:case 9:return"\t";case 110:return"\n";case 118:return"\v";case 102:return"\f";case 114:return"\r";case 101:return"";case 32:return" ";case 34:return'"';case 47:return"/";case 92:return"\\";case 78:return"Â…";case 95:return"Â ";case 76:return"\u2028";case 80:return"\u2029";default:return""}}function x(e){return e<=65535?String.fromCharCode(e):String.fromCharCode(55296+(e-65536>>10),56320+(e-65536&1023))}function w(e,t,n){"__proto__"===t?Object.defineProperty(e,t,{configurable:!0,enumerable:!0,writable:!0,value:n}):e[t]=n}for(var C=new Array(256),S=new Array(256),I=0;I<256;I++)C[I]=k(I)?1:0,S[I]=k(I);function T(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||i,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.maxDepth="number"==typeof t.maxDepth?t.maxDepth:100,this.maxTotalMergeKeys="number"==typeof t.maxTotalMergeKeys?t.maxTotalMergeKeys:1e4,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.depth=0,this.totalMergeKeys=0,this.firstTabInLine=-1,this.documents=[],this.anchorMapTransactions=[]}function O(e,t){var i={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return i.snippet=r(i),new n(t,i)}function j(e,t){throw O(e,t)}function M(e,t){e.onWarning&&e.onWarning.call(null,O(e,t))}function F(e,t,n){var r=e.anchorMapTransactions;if(0!==r.length){var i=r[r.length-1];l.call(i,t)||(i[t]={existed:l.call(e.anchorMap,t),value:e.anchorMap[t]})}e.anchorMap[t]=n}function E(e){return{position:e.position,line:e.line,lineStart:e.lineStart,lineIndent:e.lineIndent,firstTabInLine:e.firstTabInLine,tag:e.tag,anchor:e.anchor,kind:e.kind,result:e.result}}function N(e,t){e.position=t.position,e.line=t.line,e.lineStart=t.lineStart,e.lineIndent=t.lineIndent,e.firstTabInLine=t.firstTabInLine,e.tag=t.tag,e.anchor=t.anchor,e.kind=t.kind,e.result=t.result}var L={YAML:function(e,t,n){null!==e.version&&j(e,"duplication of %YAML directive"),1!==n.length&&j(e,"YAML directive accepts exactly one argument");var r=/^([0-9]+)\.([0-9]+)$/.exec(n[0]);null===r&&j(e,"ill-formed argument of the YAML directive");var i=parseInt(r[1],10),o=parseInt(r[2],10);1!==i&&j(e,"unacceptable YAML version of the document"),e.version=n[0],e.checkLineBreaks=o<2,1!==o&&2!==o&&M(e,"unsupported YAML version of the document")},TAG:function(e,t,n){var r;2!==n.length&&j(e,"TAG directive accepts exactly two arguments");var i=n[0];r=n[1],p.test(i)||j(e,"ill-formed tag handle (first argument) of the TAG directive"),l.call(e.tagMap,i)&&j(e,'there is a previously declared suffix for "'+i+'" tag handle'),f.test(r)||j(e,"ill-formed tag prefix (second argument) of the TAG directive");try{r=decodeURIComponent(r)}catch(t){j(e,"tag prefix is malformed: "+r)}e.tagMap[i]=r}};function _(e,t,n,r){if(t<n){var i=e.input.slice(t,n);if(r)for(var o=0,a=i.length;o<a;o+=1){var l=i.charCodeAt(o);9===l||l>=32&&l<=1114111||j(e,"expected valid JSON character")}else u.test(i)&&j(e,"the stream contains non-printable characters");e.result+=i}}function D(e,n,r,i){t.isObject(r)||j(e,"cannot merge mappings; the provided source object is unacceptable");for(var o=Object.keys(r),a=0,u=o.length;a<u;a+=1){var c=o[a];-1!==e.maxTotalMergeKeys&&++e.totalMergeKeys>e.maxTotalMergeKeys&&j(e,"merge keys exceeded maxTotalMergeKeys ("+e.maxTotalMergeKeys+")"),l.call(n,c)||(w(n,c,r[c]),i[c]=!0)}}function U(t,n,r,i,o,a,u,c,s){if(Array.isArray(o))for(var p=0,f=(o=Array.prototype.slice.call(o)).length;p<f;p+=1)Array.isArray(o[p])&&j(t,"nested arrays are not supported inside keys"),"object"===e(o)&&"[object Object]"===d(o[p])&&(o[p]="[object Object]");if("object"===e(o)&&"[object Object]"===d(o)&&(o="[object Object]"),o=String(o),null===n&&(n={}),"tag:yaml.org,2002:merge"===i)if(Array.isArray(a))for(var h=0,m=a.length;h<m;h+=1)D(t,n,a[h],r);else D(t,n,a,r);else t.json||l.call(r,o)||!l.call(n,o)||(t.line=u||t.line,t.lineStart=c||t.lineStart,t.position=s||t.position,j(t,"duplicated mapping key")),w(n,o,a),delete r[o];return n}function Y(e){var t=e.input.charCodeAt(e.position);10===t?e.position++:13===t?(e.position++,10===e.input.charCodeAt(e.position)&&e.position++):j(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function q(e,t,n){for(var r=0,i=e.input.charCodeAt(e.position);0!==i;){for(;m(i);)9===i&&-1===e.firstTabInLine&&(e.firstTabInLine=e.position),i=e.input.charCodeAt(++e.position);if(t&&35===i)do{i=e.input.charCodeAt(++e.position)}while(10!==i&&13!==i&&0!==i);if(!h(i))break;for(Y(e),i=e.input.charCodeAt(e.position),r++,e.lineIndent=0;32===i;)e.lineIndent++,i=e.input.charCodeAt(++e.position)}return-1!==n&&0!==r&&e.lineIndent<n&&M(e,"deficient indentation"),r}function K(e){var t=e.position,n=e.input.charCodeAt(t);return!(45!==n&&46!==n||n!==e.input.charCodeAt(t+1)||n!==e.input.charCodeAt(t+2)||(t+=3,0!==(n=e.input.charCodeAt(t))&&!g(n)))}function R(e,n){1===n?e.result+=" ":n>1&&(e.result+=t.repeat("\n",n-1))}function H(e,t){var n=e.tag,r=e.anchor,i=[],o=!1;if(-1!==e.firstTabInLine)return!1;null!==e.anchor&&F(e,e.anchor,i);for(var a=e.input.charCodeAt(e.position);0!==a&&(-1!==e.firstTabInLine&&(e.position=e.firstTabInLine,j(e,"tab characters must not be used in indentation")),45===a);){if(!g(e.input.charCodeAt(e.position+1)))break;if(o=!0,e.position++,q(e,!0,-1)&&e.lineIndent<=t)i.push(null),a=e.input.charCodeAt(e.position);else{var l=e.line;if(Q(e,t,3,!1,!0),i.push(e.result),q(e,!0,-1),a=e.input.charCodeAt(e.position),(e.line===l||e.lineIndent>t)&&0!==a)j(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break}}return!!o&&(e.tag=n,e.anchor=r,e.kind="sequence",e.result=i,!0)}function B(e,t,n){var r,i,o,a,l=e.tag,u=e.anchor,c={},s=Object.create(null),p=null,f=null,d=null,h=!1,y=!1;if(-1!==e.firstTabInLine)return!1;null!==e.anchor&&F(e,e.anchor,c);for(var v=e.input.charCodeAt(e.position);0!==v;){h||-1===e.firstTabInLine||(e.position=e.firstTabInLine,j(e,"tab characters must not be used in indentation"));var b=e.input.charCodeAt(e.position+1),A=e.line;if(63!==v&&58!==v||!g(b)){if(i=e.line,o=e.lineStart,a=e.position,!Q(e,n,2,!1,!0))break;if(e.line===A){for(v=e.input.charCodeAt(e.position);m(v);)v=e.input.charCodeAt(++e.position);if(58===v)g(v=e.input.charCodeAt(++e.position))||j(e,"a whitespace character is expected after the key-value separator within a block mapping"),h&&(U(e,c,s,p,f,null,i,o,a),p=f=d=null),y=!0,h=!1,r=!1,p=e.tag,f=e.result;else{if(!y)return e.tag=l,e.anchor=u,!0;j(e,"can not read an implicit mapping pair; a colon is missed")}}else{if(!y)return e.tag=l,e.anchor=u,!0;j(e,"can not read a block mapping entry; a multiline key may not be an implicit key")}}else 63===v?(h&&(U(e,c,s,p,f,null,i,o,a),p=f=d=null),y=!0,h=!0,r=!0):h?(h=!1,r=!0):j(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,v=b;if((e.line===A||e.lineIndent>t)&&(h&&(i=e.line,o=e.lineStart,a=e.position),Q(e,t,4,!0,r)&&(h?f=e.result:d=e.result),h||(U(e,c,s,p,f,d,i,o,a),p=f=d=null),q(e,!0,-1),v=e.input.charCodeAt(e.position)),(e.line===A||e.lineIndent>t)&&0!==v)j(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return h&&U(e,c,s,p,f,null,i,o,a),y&&(e.tag=l,e.anchor=u,e.kind="mapping",e.result=c),y}function P(e){var t,n,r=!1,i=!1,o=e.input.charCodeAt(e.position);if(33!==o)return!1;null!==e.tag&&j(e,"duplication of a tag property"),60===(o=e.input.charCodeAt(++e.position))?(r=!0,o=e.input.charCodeAt(++e.position)):33===o?(i=!0,t="!!",o=e.input.charCodeAt(++e.position)):t="!";var a=e.position;if(r){do{o=e.input.charCodeAt(++e.position)}while(0!==o&&62!==o);e.position<e.length?(n=e.input.slice(a,e.position),o=e.input.charCodeAt(++e.position)):j(e,"unexpected end of the stream within a verbatim tag")}else{for(;0!==o&&!g(o);)33===o&&(i?j(e,"tag suffix cannot contain exclamation marks"):(t=e.input.slice(a-1,e.position+1),p.test(t)||j(e,"named tag handle cannot contain such characters"),i=!0,a=e.position+1)),o=e.input.charCodeAt(++e.position);n=e.input.slice(a,e.position),s.test(n)&&j(e,"tag suffix cannot contain flow indicator characters")}n&&!f.test(n)&&j(e,"tag name cannot contain such characters: "+n);try{n=decodeURIComponent(n)}catch(t){j(e,"tag name is malformed: "+n)}return r?e.tag=n:l.call(e.tagMap,t)?e.tag=e.tagMap[t]+n:"!"===t?e.tag="!"+n:"!!"===t?e.tag="tag:yaml.org,2002:"+n:j(e,'undeclared tag handle "'+t+'"'),!0}function $(e){var t=e.input.charCodeAt(e.position);if(38!==t)return!1;null!==e.anchor&&j(e,"duplication of an anchor property"),t=e.input.charCodeAt(++e.position);for(var n=e.position;0!==t&&!g(t)&&!y(t);)t=e.input.charCodeAt(++e.position);return e.position===n&&j(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(n,e.position),!0}function Z(e,t,n,r){var i=E(e);return function(e){e.anchorMapTransactions.push(Object.create(null))}(e),N(e,t),e.tag=null,e.anchor=null,e.kind=null,e.result=null,B(e,n,r)&&"mapping"===e.kind?(function(e){var t=e.anchorMapTransactions.pop(),n=e.anchorMapTransactions;if(0!==n.length)for(var r=n[n.length-1],i=Object.keys(t),o=0,a=i.length;o<a;o+=1){var u=i[o];l.call(r,u)||(r[u]=t[u])}}(e),!0):(function(e){for(var t=e.anchorMapTransactions.pop(),n=Object.keys(t),r=n.length-1;r>=0;r-=1){var i=t[n[r]];i.existed?e.anchorMap[n[r]]=i.value:delete e.anchorMap[n[r]]}}(e),N(e,i),!1)}function Q(e,n,r,i,o){var a,u,c,s,p,f=1,d=!1,k=!1,w=null;e.depth>=e.maxDepth&&j(e,"nesting exceeded maxDepth ("+e.maxDepth+")"),e.depth+=1,null!==e.listener&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null;var I=a=u=4===r||3===r;if(i&&q(e,!0,-1)&&(d=!0,e.lineIndent>n?f=1:e.lineIndent===n?f=0:e.lineIndent<n&&(f=-1)),1===f)for(;;){var T=e.input.charCodeAt(e.position),O=E(e);if(d&&(33===T&&null!==e.tag||38===T&&null!==e.anchor))break;if(!P(e)&&!$(e))break;null===w&&(w=O),q(e,!0,-1)?(d=!0,u=I,e.lineIndent>n?f=1:e.lineIndent===n?f=0:e.lineIndent<n&&(f=-1)):u=!1}if(u&&(u=d||o),1===f||4===r)if(s=1===r||2===r?n:n+1,p=e.position-e.lineStart,1===f)if(u&&(H(e,p)||B(e,p,s))||function(e,t){var n,r,i,o,a,l,u,c,s,p,f,d=!0,h=e.tag,m=e.anchor,y=Object.create(null),v=e.input.charCodeAt(e.position);if(91===v)a=93,c=!1,o=[];else{if(123!==v)return!1;a=125,c=!0,o={}}for(null!==e.anchor&&F(e,e.anchor,o),v=e.input.charCodeAt(++e.position);0!==v;){if(q(e,!0,t),(v=e.input.charCodeAt(e.position))===a)return e.position++,e.tag=h,e.anchor=m,e.kind=c?"mapping":"sequence",e.result=o,!0;d?44===v&&j(e,"expected the node content, but found ','"):j(e,"missed comma between flow collection entries"),f=null,l=u=!1,63===v&&g(e.input.charCodeAt(e.position+1))&&(l=u=!0,e.position++,q(e,!0,t)),n=e.line,r=e.lineStart,i=e.position,Q(e,t,1,!1,!0),p=e.tag,s=e.result,q(e,!0,t),v=e.input.charCodeAt(e.position),!u&&e.line!==n||58!==v||(l=!0,v=e.input.charCodeAt(++e.position),q(e,!0,t),Q(e,t,1,!1,!0),f=e.result),c?U(e,o,y,p,s,f,n,r,i):l?o.push(U(e,null,y,p,s,f,n,r,i)):o.push(s),q(e,!0,t),44===(v=e.input.charCodeAt(e.position))?(d=!0,v=e.input.charCodeAt(++e.position)):d=!1}j(e,"unexpected end of the stream within a flow collection")}(e,s))k=!0;else{var M=e.input.charCodeAt(e.position);null!==w&&I&&!u&&124!==M&&62!==M&&Z(e,w,w.position-w.lineStart,s)||a&&function(e,n){var r,i,o=1,a=!1,l=!1,u=n,c=0,s=!1,p=e.input.charCodeAt(e.position);if(124===p)r=!1;else{if(62!==p)return!1;r=!0}for(e.kind="scalar",e.result="";0!==p;)if(43===(p=e.input.charCodeAt(++e.position))||45===p)1===o?o=43===p?3:2:j(e,"repeat of a chomping mode identifier");else{if(!((i=A(p))>=0))break;0===i?j(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):l?j(e,"repeat of an indentation width identifier"):(u=n+i-1,l=!0)}if(m(p)){do{p=e.input.charCodeAt(++e.position)}while(m(p));if(35===p)do{p=e.input.charCodeAt(++e.position)}while(!h(p)&&0!==p)}for(;0!==p;){for(Y(e),e.lineIndent=0,p=e.input.charCodeAt(e.position);(!l||e.lineIndent<u)&&32===p;)e.lineIndent++,p=e.input.charCodeAt(++e.position);if(!l&&e.lineIndent>u&&(u=e.lineIndent),h(p))c++;else{if(l||0!==u||j(e,"missing indentation for block scalar"),e.lineIndent<u){3===o?e.result+=t.repeat("\n",a?1+c:c):1===o&&a&&(e.result+="\n");break}r?m(p)?(s=!0,e.result+=t.repeat("\n",a?1+c:c)):s?(s=!1,e.result+=t.repeat("\n",c+1)):0===c?a&&(e.result+=" "):e.result+=t.repeat("\n",c):e.result+=t.repeat("\n",a?1+c:c),a=!0,l=!0,c=0;for(var f=e.position;!h(p)&&0!==p;)p=e.input.charCodeAt(++e.position);_(e,f,e.position,!1)}}return!0}(e,s)||function(e,t){var n,r,i=e.input.charCodeAt(e.position);if(39!==i)return!1;for(e.kind="scalar",e.result="",e.position++,n=r=e.position;0!==(i=e.input.charCodeAt(e.position));)if(39===i){if(_(e,n,e.position,!0),39!==(i=e.input.charCodeAt(++e.position)))return!0;n=e.position,e.position++,r=e.position}else h(i)?(_(e,n,r,!0),R(e,q(e,!1,t)),n=r=e.position):e.position===e.lineStart&&K(e)?j(e,"unexpected end of the document within a single quoted scalar"):(e.position++,m(i)||(r=e.position));j(e,"unexpected end of the stream within a single quoted scalar")}(e,s)||function(e,t){var n,r,i,o=e.input.charCodeAt(e.position);if(34!==o)return!1;for(e.kind="scalar",e.result="",e.position++,n=r=e.position;0!==(o=e.input.charCodeAt(e.position));){if(34===o)return _(e,n,e.position,!0),e.position++,!0;if(92===o){if(_(e,n,e.position,!0),h(o=e.input.charCodeAt(++e.position)))q(e,!1,t);else if(o<256&&C[o])e.result+=S[o],e.position++;else if((i=b(o))>0){for(var a=i,l=0;a>0;a--)(i=v(o=e.input.charCodeAt(++e.position)))>=0?l=(l<<4)+i:j(e,"expected hexadecimal character");e.result+=x(l),e.position++}else j(e,"unknown escape sequence");n=r=e.position}else h(o)?(_(e,n,r,!0),R(e,q(e,!1,t)),n=r=e.position):e.position===e.lineStart&&K(e)?j(e,"unexpected end of the document within a double quoted scalar"):(e.position++,m(o)||(r=e.position))}j(e,"unexpected end of the stream within a double quoted scalar")}(e,s)?k=!0:!function(e){var t=e.input.charCodeAt(e.position);if(42!==t)return!1;t=e.input.charCodeAt(++e.position);for(var n=e.position;0!==t&&!g(t)&&!y(t);)t=e.input.charCodeAt(++e.position);e.position===n&&j(e,"name of an alias node must contain at least one character");var r=e.input.slice(n,e.position);return l.call(e.anchorMap,r)||j(e,'unidentified alias "'+r+'"'),e.result=e.anchorMap[r],q(e,!0,-1),!0}(e)?function(e,t,n){var r,i,o,a,l,u,c=e.kind,s=e.result,p=e.input.charCodeAt(e.position);if(g(p)||y(p)||35===p||38===p||42===p||33===p||124===p||62===p||39===p||34===p||37===p||64===p||96===p)return!1;if(63===p||45===p){var f=e.input.charCodeAt(e.position+1);if(g(f)||n&&y(f))return!1}for(e.kind="scalar",e.result="",r=i=e.position,o=!1;0!==p;){if(58===p){var d=e.input.charCodeAt(e.position+1);if(g(d)||n&&y(d))break}else if(35===p){if(g(e.input.charCodeAt(e.position-1)))break}else{if(e.position===e.lineStart&&K(e)||n&&y(p))break;if(h(p)){if(a=e.line,l=e.lineStart,u=e.lineIndent,q(e,!1,-1),e.lineIndent>=t){o=!0,p=e.input.charCodeAt(e.position);continue}e.position=i,e.line=a,e.lineStart=l,e.lineIndent=u;break}}o&&(_(e,r,i,!1),R(e,e.line-a),r=i=e.position,o=!1),m(p)||(i=e.position+1),p=e.input.charCodeAt(++e.position)}return _(e,r,i,!1),!!e.result||(e.kind=c,e.result=s,!1)}(e,s,1===r)&&(k=!0,null===e.tag&&(e.tag="?")):(k=!0,null===e.tag&&null===e.anchor||j(e,"alias node should not have any properties")),null!==e.anchor&&F(e,e.anchor,e.result)}else 0===f&&(k=u&&H(e,p));if(null===e.tag)null!==e.anchor&&F(e,e.anchor,e.result);else if("?"===e.tag){null!==e.result&&"scalar"!==e.kind&&j(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"');for(var N=0,L=e.implicitTypes.length;N<L;N+=1)if((c=e.implicitTypes[N]).resolve(e.result)){e.result=c.construct(e.result),e.tag=c.tag,null!==e.anchor&&F(e,e.anchor,e.result);break}}else if("!"!==e.tag){if(l.call(e.typeMap[e.kind||"fallback"],e.tag))c=e.typeMap[e.kind||"fallback"][e.tag];else{c=null;for(var D=e.typeMap.multi[e.kind||"fallback"],W=0,G=D.length;W<G;W+=1)if(e.tag.slice(0,D[W].tag.length)===D[W].tag){c=D[W];break}}c||j(e,"unknown tag !<"+e.tag+">"),null!==e.result&&c.kind!==e.kind&&j(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+c.kind+'", not "'+e.kind+'"'),c.resolve(e.result,e.tag)?(e.result=c.construct(e.result,e.tag),null!==e.anchor&&F(e,e.anchor,e.result)):j(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return null!==e.listener&&e.listener("close",e),e.depth-=1,null!==e.tag||null!==e.anchor||k}function z(e){var t,n=e.position,r=!1;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);0!==(t=e.input.charCodeAt(e.position))&&(q(e,!0,-1),t=e.input.charCodeAt(e.position),!(e.lineIndent>0||37!==t));){r=!0,t=e.input.charCodeAt(++e.position);for(var i=e.position;0!==t&&!g(t);)t=e.input.charCodeAt(++e.position);var o=e.input.slice(i,e.position),a=[];for(o.length<1&&j(e,"directive name must not be less than one character in length");0!==t;){for(;m(t);)t=e.input.charCodeAt(++e.position);if(35===t){do{t=e.input.charCodeAt(++e.position)}while(0!==t&&!h(t));break}if(h(t))break;for(i=e.position;0!==t&&!g(t);)t=e.input.charCodeAt(++e.position);a.push(e.input.slice(i,e.position))}0!==t&&Y(e),l.call(L,o)?L[o](e,o,a):M(e,'unknown document directive "'+o+'"')}q(e,!0,-1),0===e.lineIndent&&45===e.input.charCodeAt(e.position)&&45===e.input.charCodeAt(e.position+1)&&45===e.input.charCodeAt(e.position+2)?(e.position+=3,q(e,!0,-1)):r&&j(e,"directives end mark is expected"),Q(e,e.lineIndent-1,4,!1,!0),q(e,!0,-1),e.checkLineBreaks&&c.test(e.input.slice(n,e.position))&&M(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&K(e)?46===e.input.charCodeAt(e.position)&&(e.position+=3,q(e,!0,-1)):e.position<e.length-1&&j(e,"end of the stream or a document separator is expected")}function X(e,t){t=t||{},0!==(e=String(e)).length&&(10!==e.charCodeAt(e.length-1)&&13!==e.charCodeAt(e.length-1)&&(e+="\n"),65279===e.charCodeAt(0)&&(e=e.slice(1)));var n=new T(e,t),r=e.indexOf("\0");for(-1!==r&&(n.position=r,j(n,"null byte is not allowed in input")),n.input+="\0";32===n.input.charCodeAt(n.position);)n.lineIndent+=1,n.position+=1;for(;n.position<n.length-1;)z(n);return n.documents}return G.loadAll=function(t,n,r){null!==n&&"object"===e(n)&&void 0===r&&(r=n,n=null);var i=X(t,r);if("function"!=typeof n)return i;for(var o=0,a=i.length;o<a;o+=1)n(i[o])},G.load=function(e,t){var r=X(e,t);if(0!==r.length){if(1===r.length)return r[0];throw new n("expected a single document in the stream, but found more")}},G}var ye,ve,be={};function Ae(){if(ye)return be;function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(t)}ye=1;var t=V(),n=J(),r=me(),i=Object.prototype.toString,o=Object.prototype.hasOwnProperty,a=65279,l={0:"\\0",7:"\\a",8:"\\b",9:"\\t",10:"\\n",11:"\\v",12:"\\f",13:"\\r",27:"\\e",34:'\\"',92:"\\\\",133:"\\N",160:"\\_",8232:"\\L",8233:"\\P"},u=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],c=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function s(e){var r,i,o=e.toString(16).toUpperCase();if(e<=255)r="x",i=2;else if(e<=65535)r="u",i=4;else{if(!(e<=4294967295))throw new n("code point within a string may not be greater than 0xFFFFFFFF");r="U",i=8}return"\\"+r+t.repeat("0",i-o.length)+o}function p(e){this.schema=e.schema||r,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=t.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=function(e,t){if(null===t)return{};for(var n={},r=Object.keys(t),i=0,a=r.length;i<a;i+=1){var l=r[i],u=String(t[l]);"!!"===l.slice(0,2)&&(l="tag:yaml.org,2002:"+l.slice(2));var c=e.compiledTypeMap.fallback[l];c&&o.call(c.styleAliases,u)&&(u=c.styleAliases[u]),n[l]=u}return n}(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.quotingType='"'===e.quotingType?2:1,this.forceQuotes=e.forceQuotes||!1,this.replacer="function"==typeof e.replacer?e.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function f(e,n){for(var r=t.repeat(" ",n),i=0,o="",a=e.length;i<a;){var l=void 0,u=e.indexOf("\n",i);-1===u?(l=e.slice(i),i=a):(l=e.slice(i,u+1),i=u+1),l.length&&"\n"!==l&&(o+=r),o+=l}return o}function d(e,n){return"\n"+t.repeat(" ",e.indent*n)}function h(e){return 32===e||9===e}function m(e){return e>=32&&e<=126||e>=161&&e<=55295&&8232!==e&&8233!==e||e>=57344&&e<=65533&&e!==a||e>=65536&&e<=1114111}function g(e){return m(e)&&e!==a&&13!==e&&10!==e}function y(e,t,n){var r=g(e),i=r&&!h(e);return(n?r:r&&44!==e&&91!==e&&93!==e&&123!==e&&125!==e)&&35!==e&&!(58===t&&!i)||g(t)&&!h(t)&&35===e||58===t&&i}function v(e,t){var n,r=e.charCodeAt(t);return r>=55296&&r<=56319&&t+1<e.length&&(n=e.charCodeAt(t+1))>=56320&&n<=57343?1024*(r-55296)+n-56320+65536:r}function b(e){return/^\n* /.test(e)}function A(e,t,n,r,i,o,l,u){var c,s,p=0,f=null,d=!1,g=!1,A=-1!==r,k=-1,x=m(s=v(e,0))&&s!==a&&!h(s)&&45!==s&&63!==s&&58!==s&&44!==s&&91!==s&&93!==s&&123!==s&&125!==s&&35!==s&&38!==s&&42!==s&&33!==s&&124!==s&&61!==s&&62!==s&&39!==s&&34!==s&&37!==s&&64!==s&&96!==s&&function(e){return!h(e)&&58!==e}(v(e,e.length-1));if(t||l)for(c=0;c<e.length;p>=65536?c+=2:c++){if(!m(p=v(e,c)))return 5;x=x&&y(p,f,u),f=p}else{for(c=0;c<e.length;p>=65536?c+=2:c++){if(10===(p=v(e,c)))d=!0,A&&(g=g||c-k-1>r&&" "!==e[k+1],k=c);else if(!m(p))return 5;x=x&&y(p,f,u),f=p}g=g||A&&c-k-1>r&&" "!==e[k+1]}return d||g?n>9&&b(e)?5:l?2===o?5:2:g?4:3:!x||l||i(e)?2===o?5:2:1}function k(e,t,r,i,o){e.dump=function(){if(0===t.length)return 2===e.quotingType?'""':"''";if(!e.noCompatMode&&(-1!==u.indexOf(t)||c.test(t)))return 2===e.quotingType?'"'+t+'"':"'"+t+"'";var a=e.indent*Math.max(1,r),p=-1===e.lineWidth?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-a),d=i||e.flowLevel>-1&&r>=e.flowLevel;switch(A(t,d,e.indent,p,function(t){return function(e,t){for(var n=0,r=e.implicitTypes.length;n<r;n+=1)if(e.implicitTypes[n].resolve(t))return!0;return!1}(e,t)},e.quotingType,e.forceQuotes&&!i,o)){case 1:return t;case 2:return"'"+t.replace(/'/g,"''")+"'";case 3:return"|"+x(t,e.indent)+w(f(t,a));case 4:return">"+x(t,e.indent)+w(f(function(e,t){var n,r,i=/(\n+)([^\n]*)/g,o=(l=e.indexOf("\n"),l=-1!==l?l:e.length,i.lastIndex=l,C(e.slice(0,l),t)),a="\n"===e[0]||" "===e[0];var l;for(;r=i.exec(e);){var u=r[1],c=r[2];n=" "===c[0],o+=u+(a||n||""===c?"":"\n")+C(c,t),a=n}return o}(t,p),a));case 5:return'"'+function(e){for(var t="",n=0,r=0;r<e.length;n>=65536?r+=2:r++){n=v(e,r);var i=l[n];!i&&m(n)?(t+=e[r],n>=65536&&(t+=e[r+1])):t+=i||s(n)}return t}(t)+'"';default:throw new n("impossible error: invalid scalar style")}}()}function x(e,t){var n=b(e)?String(t):"",r="\n"===e[e.length-1];return n+(r&&("\n"===e[e.length-2]||"\n"===e)?"+":r?"":"-")+"\n"}function w(e){return"\n"===e[e.length-1]?e.slice(0,-1):e}function C(e,t){if(""===e||" "===e[0])return e;for(var n,r,i=/ [^ ]/g,o=0,a=0,l=0,u="";n=i.exec(e);)(l=n.index)-o>t&&(r=a>o?a:l,u+="\n"+e.slice(o,r),o=r+1),a=l;return u+="\n",e.length-o>t&&a>o?u+=e.slice(o,a)+"\n"+e.slice(a+1):u+=e.slice(o),u.slice(1)}function S(e,t,n,r){for(var i="",o=e.tag,a=0,l=n.length;a<l;a+=1){var u=n[a];e.replacer&&(u=e.replacer.call(n,String(a),u)),(T(e,t+1,u,!0,!0,!1,!0)||void 0===u&&T(e,t+1,null,!0,!0,!1,!0))&&(r&&""===i||(i+=d(e,t)),e.dump&&10===e.dump.charCodeAt(0)?i+="-":i+="- ",i+=e.dump)}e.tag=o,e.dump=i||"[]"}function I(t,r,a){for(var l=a?t.explicitTypes:t.implicitTypes,u=0,c=l.length;u<c;u+=1){var s=l[u];if((s.instanceOf||s.predicate)&&(!s.instanceOf||"object"===e(r)&&r instanceof s.instanceOf)&&(!s.predicate||s.predicate(r))){if(a?s.multi&&s.representName?t.tag=s.representName(r):t.tag=s.tag:t.tag="?",s.represent){var p=t.styleMap[s.tag]||s.defaultStyle,f=void 0;if("[object Function]"===i.call(s.represent))f=s.represent(r,p);else{if(!o.call(s.represent,p))throw new n("!<"+s.tag+'> tag resolver accepts not "'+p+'" style');f=s.represent[p](r,p)}t.dump=f}return!0}}return!1}function T(e,t,r,o,a,l,u){e.tag=null,e.dump=r,I(e,r,!1)||I(e,r,!0);var c=i.call(e.dump),s=o;o&&(o=e.flowLevel<0||e.flowLevel>t);var p,f,h="[object Object]"===c||"[object Array]"===c;if(h&&(f=-1!==(p=e.duplicates.indexOf(r))),(null!==e.tag&&"?"!==e.tag||f||2!==e.indent&&t>0)&&(a=!1),f&&e.usedDuplicates[p])e.dump="*ref_"+p;else{if(h&&f&&!e.usedDuplicates[p]&&(e.usedDuplicates[p]=!0),"[object Object]"===c)o&&0!==Object.keys(e.dump).length?(!function(e,t,r,i){var o="",a=e.tag,l=Object.keys(r);if(!0===e.sortKeys)l.sort();else if("function"==typeof e.sortKeys)l.sort(e.sortKeys);else if(e.sortKeys)throw new n("sortKeys must be a boolean or a function");for(var u=0,c=l.length;u<c;u+=1){var s="";i&&""===o||(s+=d(e,t));var p=l[u],f=r[p];if(e.replacer&&(f=e.replacer.call(r,p,f)),T(e,t+1,p,!0,!0,!0)){var h=null!==e.tag&&"?"!==e.tag||e.dump&&e.dump.length>1024;h&&(e.dump&&10===e.dump.charCodeAt(0)?s+="?":s+="? "),s+=e.dump,h&&(s+=d(e,t)),T(e,t+1,f,!0,h)&&(e.dump&&10===e.dump.charCodeAt(0)?s+=":":s+=": ",o+=s+=e.dump)}}e.tag=a,e.dump=o||"{}"}(e,t,e.dump,a),f&&(e.dump="&ref_"+p+e.dump)):(!function(e,t,n){for(var r="",i=e.tag,o=Object.keys(n),a=0,l=o.length;a<l;a+=1){var u="";""!==r&&(u+=", "),e.condenseFlow&&(u+='"');var c=o[a],s=n[c];e.replacer&&(s=e.replacer.call(n,c,s)),T(e,t,c,!1,!1)&&(e.dump.length>1024&&(u+="? "),u+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),T(e,t,s,!1,!1)&&(r+=u+=e.dump))}e.tag=i,e.dump="{"+r+"}"}(e,t,e.dump),f&&(e.dump="&ref_"+p+" "+e.dump));else if("[object Array]"===c)o&&0!==e.dump.length?(e.noArrayIndent&&!u&&t>0?S(e,t-1,e.dump,a):S(e,t,e.dump,a),f&&(e.dump="&ref_"+p+e.dump)):(!function(e,t,n){for(var r="",i=e.tag,o=0,a=n.length;o<a;o+=1){var l=n[o];e.replacer&&(l=e.replacer.call(n,String(o),l)),(T(e,t,l,!1,!1)||void 0===l&&T(e,t,null,!1,!1))&&(""!==r&&(r+=","+(e.condenseFlow?"":" ")),r+=e.dump)}e.tag=i,e.dump="["+r+"]"}(e,t,e.dump),f&&(e.dump="&ref_"+p+" "+e.dump));else{if("[object String]"!==c){if("[object Undefined]"===c)return!1;if(e.skipInvalid)return!1;throw new n("unacceptable kind of an object to dump "+c)}"?"!==e.tag&&k(e,e.dump,t,l,s)}if(null!==e.tag&&"?"!==e.tag){var m=encodeURI("!"===e.tag[0]?e.tag.slice(1):e.tag).replace(/!/g,"%21");m="!"===e.tag[0]?"!"+m:"tag:yaml.org,2002:"===m.slice(0,18)?"!!"+m.slice(18):"!<"+m+">",e.dump=m+" "+e.dump}}return!0}function O(e,t){var n=[],r=[];j(e,n,r);for(var i=r.length,o=0;o<i;o+=1)t.duplicates.push(n[r[o]]);t.usedDuplicates=new Array(i)}function j(t,n,r){if(null!==t&&"object"===e(t)){var i=n.indexOf(t);if(-1!==i)-1===r.indexOf(i)&&r.push(i);else if(n.push(t),Array.isArray(t))for(var o=0,a=t.length;o<a;o+=1)j(t[o],n,r);else for(var l=Object.keys(t),u=0,c=l.length;u<c;u+=1)j(t[l[u]],n,r)}}return be.dump=function(e,t){var n=new p(t=t||{});n.noRefs||O(e,n);var r=e;return n.replacer&&(r=n.replacer.call({"":r},"",r)),T(n,0,r,!0,!0)?n.dump+"\n":""},be}var ke=t(function(){if(ve)return $;ve=1;var e=ge(),t=Ae();function n(e,t){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+t+" instead, which is now safe by default.")}}return $.Type=Q(),$.Schema=z(),$.FAILSAFE_SCHEMA=ne(),$.JSON_SCHEMA=le(),$.CORE_SCHEMA=ue(),$.DEFAULT_SCHEMA=me(),$.load=e.load,$.loadAll=e.loadAll,$.dump=t.dump,$.YAMLException=J(),$.types={binary:pe(),float:ae(),map:te(),null:re(),pairs:de(),set:he(),timestamp:ce(),bool:ie(),int:oe(),merge:se(),omap:fe(),seq:ee(),str:X()},$.safeLoad=n("safeLoad","load"),$.safeLoadAll=n("safeLoadAll","loadAll"),$.safeDump=n("safeDump","dump"),$}()),xe=ke.Type,we=ke.Schema,Ce=ke.FAILSAFE_SCHEMA,Se=ke.JSON_SCHEMA,Ie=ke.CORE_SCHEMA,Te=ke.DEFAULT_SCHEMA,Oe=ke.load,je=ke.loadAll,Me=ke.dump,Fe=ke.YAMLException,Ee=ke.types,Ne=ke.safeLoad,Le=ke.safeLoadAll,_e=ke.safeDump;e.CORE_SCHEMA=Ie,e.DEFAULT_SCHEMA=Te,e.FAILSAFE_SCHEMA=Ce,e.JSON_SCHEMA=Se,e.Schema=we,e.Type=xe,e.YAMLException=Fe,e.default=ke,e.dump=Me,e.load=Oe,e.loadAll=je,e.safeDump=_e,e.safeLoad=Ne,e.safeLoadAll=Le,e.types=Ee,Object.defineProperty(e,"__esModule",{value:!0})});
//# sourceMappingURL=js-yaml.min.js.map
{"version":3,"file":"js-yaml.min.js","sources":["../lib/common.js","../lib/exception.js","../lib/type.js","../lib/schema.js","../lib/type/str.js","../lib/type/seq.js","../lib/type/map.js","../lib/schema/failsafe.js","../lib/type/null.js","../lib/type/bool.js","../lib/type/int.js","../lib/type/float.js","../lib/schema/json.js","../lib/schema/core.js","../lib/type/timestamp.js","../lib/type/merge.js","../lib/type/binary.js","../lib/type/omap.js","../lib/type/pairs.js","../lib/type/set.js","../lib/schema/default.js","../lib/loader.js","../lib/snippet.js","../lib/dumper.js","../index.js","../lib/index_vite_proxy.tmp.mjs"],"sourcesContent":["'use strict'\n\nfunction isNothing (subject) {\n  return (typeof subject === 'undefined') || (subject === null)\n}\n\nfunction isObject (subject) {\n  return (typeof subject === 'object') && (subject !== null)\n}\n\nfunction toArray (sequence) {\n  if (Array.isArray(sequence)) return sequence\n  else if (isNothing(sequence)) return []\n\n  return [sequence]\n}\n\nfunction extend (target, source) {\n  if (source) {\n    const sourceKeys = Object.keys(source)\n\n    for (let index = 0, length = sourceKeys.length; index < length; index += 1) {\n      const key = sourceKeys[index]\n      target[key] = source[key]\n    }\n  }\n\n  return target\n}\n\nfunction repeat (string, count) {\n  let result = ''\n\n  for (let cycle = 0; cycle < count; cycle += 1) {\n    result += string\n  }\n\n  return result\n}\n\nfunction isNegativeZero (number) {\n  return (number === 0) && (Number.NEGATIVE_INFINITY === 1 / number)\n}\n\nmodule.exports.isNothing = isNothing\nmodule.exports.isObject = isObject\nmodule.exports.toArray = toArray\nmodule.exports.repeat = repeat\nmodule.exports.isNegativeZero = isNegativeZero\nmodule.exports.extend = extend\n","// YAML error class. http://stackoverflow.com/questions/8458984\n//\n'use strict'\n\nfunction formatError (exception, compact) {\n  let where = ''\n  const message = exception.reason || '(unknown reason)'\n\n  if (!exception.mark) return message\n\n  if (exception.mark.name) {\n    where += 'in \"' + exception.mark.name + '\" '\n  }\n\n  where += '(' + (exception.mark.line + 1) + ':' + (exception.mark.column + 1) + ')'\n\n  if (!compact && exception.mark.snippet) {\n    where += '\\n\\n' + exception.mark.snippet\n  }\n\n  return message + ' ' + where\n}\n\nfunction YAMLException (reason, mark) {\n  // Super constructor\n  Error.call(this)\n\n  this.name = 'YAMLException'\n  this.reason = reason\n  this.mark = mark\n  this.message = formatError(this, false)\n\n  // Include stack trace in error object\n  if (Error.captureStackTrace) {\n    // Chrome and NodeJS\n    Error.captureStackTrace(this, this.constructor)\n  } else {\n    // FF, IE 10+ and Safari 6+. Fallback for others\n    this.stack = (new Error()).stack || ''\n  }\n}\n\n// Inherit from Error\nYAMLException.prototype = Object.create(Error.prototype)\nYAMLException.prototype.constructor = YAMLException\n\nYAMLException.prototype.toString = function toString (compact) {\n  return this.name + ': ' + formatError(this, compact)\n}\n\nmodule.exports = YAMLException\n","'use strict'\n\nconst YAMLException = require('./exception')\n\nconst TYPE_CONSTRUCTOR_OPTIONS = [\n  'kind',\n  'multi',\n  'resolve',\n  'construct',\n  'instanceOf',\n  'predicate',\n  'represent',\n  'representName',\n  'defaultStyle',\n  'styleAliases'\n]\n\nconst YAML_NODE_KINDS = [\n  'scalar',\n  'sequence',\n  'mapping'\n]\n\nfunction compileStyleAliases (map) {\n  const result = {}\n\n  if (map !== null) {\n    Object.keys(map).forEach(function (style) {\n      map[style].forEach(function (alias) {\n        result[String(alias)] = style\n      })\n    })\n  }\n\n  return result\n}\n\nfunction Type (tag, options) {\n  options = options || {}\n\n  Object.keys(options).forEach(function (name) {\n    if (TYPE_CONSTRUCTOR_OPTIONS.indexOf(name) === -1) {\n      throw new YAMLException('Unknown option \"' + name + '\" is met in definition of \"' + tag + '\" YAML type.')\n    }\n  })\n\n  // TODO: Add tag format check.\n  this.options = options // keep original options in case user wants to extend this type later\n  this.tag = tag\n  this.kind = options['kind'] || null\n  this.resolve = options['resolve'] || function () { return true }\n  this.construct = options['construct'] || function (data) { return data }\n  this.instanceOf = options['instanceOf'] || null\n  this.predicate = options['predicate'] || null\n  this.represent = options['represent'] || null\n  this.representName = options['representName'] || null\n  this.defaultStyle = options['defaultStyle'] || null\n  this.multi = options['multi'] || false\n  this.styleAliases = compileStyleAliases(options['styleAliases'] || null)\n\n  if (YAML_NODE_KINDS.indexOf(this.kind) === -1) {\n    throw new YAMLException('Unknown kind \"' + this.kind + '\" is specified for \"' + tag + '\" YAML type.')\n  }\n}\n\nmodule.exports = Type\n","'use strict'\n\nconst YAMLException = require('./exception')\nconst Type = require('./type')\n\nfunction compileList (schema, name) {\n  const result = []\n\n  schema[name].forEach(function (currentType) {\n    let newIndex = result.length\n\n    result.forEach(function (previousType, previousIndex) {\n      if (previousType.tag === currentType.tag &&\n          previousType.kind === currentType.kind &&\n          previousType.multi === currentType.multi) {\n        newIndex = previousIndex\n      }\n    })\n\n    result[newIndex] = currentType\n  })\n\n  return result\n}\n\nfunction compileMap (/* lists... */) {\n  const result = {\n    scalar: {},\n    sequence: {},\n    mapping: {},\n    fallback: {},\n    multi: {\n      scalar: [],\n      sequence: [],\n      mapping: [],\n      fallback: []\n    }\n  }\n  function collectType (type) {\n    if (type.multi) {\n      result.multi[type.kind].push(type)\n      result.multi['fallback'].push(type)\n    } else {\n      result[type.kind][type.tag] = result['fallback'][type.tag] = type\n    }\n  }\n\n  for (let index = 0, length = arguments.length; index < length; index += 1) {\n    arguments[index].forEach(collectType)\n  }\n  return result\n}\n\nfunction Schema (definition) {\n  return this.extend(definition)\n}\n\nSchema.prototype.extend = function extend (definition) {\n  let implicit = []\n  let explicit = []\n\n  if (definition instanceof Type) {\n    // Schema.extend(type)\n    explicit.push(definition)\n  } else if (Array.isArray(definition)) {\n    // Schema.extend([ type1, type2, ... ])\n    explicit = explicit.concat(definition)\n  } else if (definition && (Array.isArray(definition.implicit) || Array.isArray(definition.explicit))) {\n    // Schema.extend({ explicit: [ type1, type2, ... ], implicit: [ type1, type2, ... ] })\n    if (definition.implicit) implicit = implicit.concat(definition.implicit)\n    if (definition.explicit) explicit = explicit.concat(definition.explicit)\n  } else {\n    throw new YAMLException('Schema.extend argument should be a Type, [ Type ], ' +\n      'or a schema definition ({ implicit: [...], explicit: [...] })')\n  }\n\n  implicit.forEach(function (type) {\n    if (!(type instanceof Type)) {\n      throw new YAMLException('Specified list of YAML types (or a single Type object) contains a non-Type object.')\n    }\n\n    if (type.loadKind && type.loadKind !== 'scalar') {\n      throw new YAMLException('There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.')\n    }\n\n    if (type.multi) {\n      throw new YAMLException('There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.')\n    }\n  })\n\n  explicit.forEach(function (type) {\n    if (!(type instanceof Type)) {\n      throw new YAMLException('Specified list of YAML types (or a single Type object) contains a non-Type object.')\n    }\n  })\n\n  const result = Object.create(Schema.prototype)\n\n  result.implicit = (this.implicit || []).concat(implicit)\n  result.explicit = (this.explicit || []).concat(explicit)\n\n  result.compiledImplicit = compileList(result, 'implicit')\n  result.compiledExplicit = compileList(result, 'explicit')\n  result.compiledTypeMap = compileMap(result.compiledImplicit, result.compiledExplicit)\n\n  return result\n}\n\nmodule.exports = Schema\n","'use strict'\n\nconst Type = require('../type')\n\nmodule.exports = new Type('tag:yaml.org,2002:str', {\n  kind: 'scalar',\n  construct: function (data) { return data !== null ? data : '' }\n})\n","'use strict'\n\nconst Type = require('../type')\n\nmodule.exports = new Type('tag:yaml.org,2002:seq', {\n  kind: 'sequence',\n  construct: function (data) { return data !== null ? data : [] }\n})\n","'use strict'\n\nconst Type = require('../type')\n\nmodule.exports = new Type('tag:yaml.org,2002:map', {\n  kind: 'mapping',\n  construct: function (data) { return data !== null ? data : {} }\n})\n","// Standard YAML's Failsafe schema.\n// http://www.yaml.org/spec/1.2/spec.html#id2802346\n\n'use strict'\n\nconst Schema = require('../schema')\n\nmodule.exports = new Schema({\n  explicit: [\n    require('../type/str'),\n    require('../type/seq'),\n    require('../type/map')\n  ]\n})\n","'use strict'\n\nconst Type = require('../type')\n\nfunction resolveYamlNull (data) {\n  if (data === null) return true\n\n  const max = data.length\n\n  return (max === 1 && data === '~') ||\n         (max === 4 && (data === 'null' || data === 'Null' || data === 'NULL'))\n}\n\nfunction constructYamlNull () {\n  return null\n}\n\nfunction isNull (object) {\n  return object === null\n}\n\nmodule.exports = new Type('tag:yaml.org,2002:null', {\n  kind: 'scalar',\n  resolve: resolveYamlNull,\n  construct: constructYamlNull,\n  predicate: isNull,\n  represent: {\n    canonical: function () { return '~' },\n    lowercase: function () { return 'null' },\n    uppercase: function () { return 'NULL' },\n    camelcase: function () { return 'Null' },\n    empty: function () { return '' }\n  },\n  defaultStyle: 'lowercase'\n})\n","'use strict'\n\nconst Type = require('../type')\n\nfunction resolveYamlBoolean (data) {\n  if (data === null) return false\n\n  const max = data.length\n\n  return (max === 4 && (data === 'true' || data === 'True' || data === 'TRUE')) ||\n         (max === 5 && (data === 'false' || data === 'False' || data === 'FALSE'))\n}\n\nfunction constructYamlBoolean (data) {\n  return data === 'true' ||\n         data === 'True' ||\n         data === 'TRUE'\n}\n\nfunction isBoolean (object) {\n  return Object.prototype.toString.call(object) === '[object Boolean]'\n}\n\nmodule.exports = new Type('tag:yaml.org,2002:bool', {\n  kind: 'scalar',\n  resolve: resolveYamlBoolean,\n  construct: constructYamlBoolean,\n  predicate: isBoolean,\n  represent: {\n    lowercase: function (object) { return object ? 'true' : 'false' },\n    uppercase: function (object) { return object ? 'TRUE' : 'FALSE' },\n    camelcase: function (object) { return object ? 'True' : 'False' }\n  },\n  defaultStyle: 'lowercase'\n})\n","'use strict'\n\nconst common = require('../common')\nconst Type = require('../type')\n\nfunction isHexCode (c) {\n  return ((c >= 0x30/* 0 */) && (c <= 0x39/* 9 */)) ||\n         ((c >= 0x41/* A */) && (c <= 0x46/* F */)) ||\n         ((c >= 0x61/* a */) && (c <= 0x66/* f */))\n}\n\nfunction isOctCode (c) {\n  return ((c >= 0x30/* 0 */) && (c <= 0x37/* 7 */))\n}\n\nfunction isDecCode (c) {\n  return ((c >= 0x30/* 0 */) && (c <= 0x39/* 9 */))\n}\n\nfunction resolveYamlInteger (data) {\n  if (data === null) return false\n\n  const max = data.length\n  let index = 0\n  let hasDigits = false\n\n  if (!max) return false\n\n  let ch = data[index]\n\n  // sign\n  if (ch === '-' || ch === '+') {\n    ch = data[++index]\n  }\n\n  if (ch === '0') {\n    // 0\n    if (index + 1 === max) return true\n    ch = data[++index]\n\n    // base 2, base 8, base 16\n\n    if (ch === 'b') {\n      // base 2\n      index++\n\n      for (; index < max; index++) {\n        ch = data[index]\n        if (ch !== '0' && ch !== '1') return false\n        hasDigits = true\n      }\n      return hasDigits && isFinite(parseYamlInteger(data))\n    }\n\n    if (ch === 'x') {\n      // base 16\n      index++\n\n      for (; index < max; index++) {\n        if (!isHexCode(data.charCodeAt(index))) return false\n        hasDigits = true\n      }\n      return hasDigits && isFinite(parseYamlInteger(data))\n    }\n\n    if (ch === 'o') {\n      // base 8\n      index++\n\n      for (; index < max; index++) {\n        if (!isOctCode(data.charCodeAt(index))) return false\n        hasDigits = true\n      }\n      return hasDigits && isFinite(parseYamlInteger(data))\n    }\n  }\n\n  // base 10 (except 0)\n\n  for (; index < max; index++) {\n    if (!isDecCode(data.charCodeAt(index))) {\n      return false\n    }\n    hasDigits = true\n  }\n\n  if (!hasDigits) return false\n\n  return isFinite(parseYamlInteger(data))\n}\n\nfunction parseYamlInteger (data) {\n  let value = data\n  let sign = 1\n\n  let ch = value[0]\n\n  if (ch === '-' || ch === '+') {\n    if (ch === '-') sign = -1\n    value = value.slice(1)\n    ch = value[0]\n  }\n\n  if (value === '0') return 0\n\n  if (ch === '0') {\n    if (value[1] === 'b') return sign * parseInt(value.slice(2), 2)\n    if (value[1] === 'x') return sign * parseInt(value.slice(2), 16)\n    if (value[1] === 'o') return sign * parseInt(value.slice(2), 8)\n  }\n\n  return sign * parseInt(value, 10)\n}\n\nfunction constructYamlInteger (data) {\n  return parseYamlInteger(data)\n}\n\nfunction isInteger (object) {\n  return (Object.prototype.toString.call(object)) === '[object Number]' &&\n         (object % 1 === 0 && !common.isNegativeZero(object))\n}\n\nmodule.exports = new Type('tag:yaml.org,2002:int', {\n  kind: 'scalar',\n  resolve: resolveYamlInteger,\n  construct: constructYamlInteger,\n  predicate: isInteger,\n  represent: {\n    binary: function (obj) { return obj >= 0 ? '0b' + obj.toString(2) : '-0b' + obj.toString(2).slice(1) },\n    octal: function (obj) { return obj >= 0 ? '0o' + obj.toString(8) : '-0o' + obj.toString(8).slice(1) },\n    decimal: function (obj) { return obj.toString(10) },\n    hexadecimal: function (obj) { return obj >= 0 ? '0x' + obj.toString(16).toUpperCase() : '-0x' + obj.toString(16).toUpperCase().slice(1) }\n  },\n  defaultStyle: 'decimal',\n  styleAliases: {\n    binary: [2, 'bin'],\n    octal: [8, 'oct'],\n    decimal: [10, 'dec'],\n    hexadecimal: [16, 'hex']\n  }\n})\n","'use strict'\n\nconst common = require('../common')\nconst Type = require('../type')\n\nconst YAML_FLOAT_PATTERN = new RegExp(\n  // 2.5e4, 2.5 and integers\n  '^(?:[-+]?(?:[0-9]+)(?:\\\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?' +\n  // .2e4, .2\n  // special case, seems not from spec\n  '|\\\\.[0-9]+(?:[eE][-+]?[0-9]+)?' +\n  // .inf\n  '|[-+]?\\\\.(?:inf|Inf|INF)' +\n  // .nan\n  '|\\\\.(?:nan|NaN|NAN))$')\n\nconst YAML_FLOAT_SPECIAL_PATTERN = new RegExp(\n  '^(?:' +\n  // .inf\n  '[-+]?\\\\.(?:inf|Inf|INF)' +\n  // .nan\n  '|\\\\.(?:nan|NaN|NAN))$')\n\nfunction resolveYamlFloat (data) {\n  if (data === null) return false\n\n  if (!YAML_FLOAT_PATTERN.test(data)) {\n    return false\n  }\n\n  if (isFinite(parseFloat(data, 10))) {\n    return true\n  }\n\n  return YAML_FLOAT_SPECIAL_PATTERN.test(data)\n}\n\nfunction constructYamlFloat (data) {\n  let value = data.toLowerCase()\n  const sign = value[0] === '-' ? -1 : 1\n\n  if ('+-'.indexOf(value[0]) >= 0) {\n    value = value.slice(1)\n  }\n\n  if (value === '.inf') {\n    return (sign === 1) ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY\n  } else if (value === '.nan') {\n    return NaN\n  }\n  return sign * parseFloat(value, 10)\n}\n\nconst SCIENTIFIC_WITHOUT_DOT = /^[-+]?[0-9]+e/\n\nfunction representYamlFloat (object, style) {\n  if (isNaN(object)) {\n    switch (style) {\n      case 'lowercase': return '.nan'\n      case 'uppercase': return '.NAN'\n      case 'camelcase': return '.NaN'\n    }\n  } else if (Number.POSITIVE_INFINITY === object) {\n    switch (style) {\n      case 'lowercase': return '.inf'\n      case 'uppercase': return '.INF'\n      case 'camelcase': return '.Inf'\n    }\n  } else if (Number.NEGATIVE_INFINITY === object) {\n    switch (style) {\n      case 'lowercase': return '-.inf'\n      case 'uppercase': return '-.INF'\n      case 'camelcase': return '-.Inf'\n    }\n  } else if (common.isNegativeZero(object)) {\n    return '-0.0'\n  }\n\n  const res = object.toString(10)\n\n  // JS stringifier can build scientific format without dots: 5e-100,\n  // while YAML requres dot: 5.e-100. Fix it with simple hack\n\n  return SCIENTIFIC_WITHOUT_DOT.test(res) ? res.replace('e', '.e') : res\n}\n\nfunction isFloat (object) {\n  return (Object.prototype.toString.call(object) === '[object Number]') &&\n         (object % 1 !== 0 || common.isNegativeZero(object))\n}\n\nmodule.exports = new Type('tag:yaml.org,2002:float', {\n  kind: 'scalar',\n  resolve: resolveYamlFloat,\n  construct: constructYamlFloat,\n  predicate: isFloat,\n  represent: representYamlFloat,\n  defaultStyle: 'lowercase'\n})\n","// Standard YAML's JSON schema.\n// http://www.yaml.org/spec/1.2/spec.html#id2803231\n//\n// NOTE: JS-YAML does not support schema-specific tag resolution restrictions.\n// So, this schema is not such strict as defined in the YAML specification.\n// It allows numbers in binary notaion, use `Null` and `NULL` as `null`, etc.\n\n'use strict'\n\nmodule.exports = require('./failsafe').extend({\n  implicit: [\n    require('../type/null'),\n    require('../type/bool'),\n    require('../type/int'),\n    require('../type/float')\n  ]\n})\n","// Standard YAML's Core schema.\n// http://www.yaml.org/spec/1.2/spec.html#id2804923\n//\n// NOTE: JS-YAML does not support schema-specific tag resolution restrictions.\n// So, Core schema has no distinctions from JSON schema is JS-YAML.\n\n'use strict'\n\nmodule.exports = require('./json')\n","'use strict'\n\nconst Type = require('../type')\n\nconst YAML_DATE_REGEXP = new RegExp(\n  '^([0-9][0-9][0-9][0-9])' + // [1] year\n  '-([0-9][0-9])' + // [2] month\n  '-([0-9][0-9])$')                   // [3] day\n\nconst YAML_TIMESTAMP_REGEXP = new RegExp(\n  '^([0-9][0-9][0-9][0-9])' + // [1] year\n  '-([0-9][0-9]?)' + // [2] month\n  '-([0-9][0-9]?)' + // [3] day\n  '(?:[Tt]|[ \\\\t]+)' + // ...\n  '([0-9][0-9]?)' + // [4] hour\n  ':([0-9][0-9])' + // [5] minute\n  ':([0-9][0-9])' + // [6] second\n  '(?:\\\\.([0-9]*))?' + // [7] fraction\n  '(?:[ \\\\t]*(Z|([-+])([0-9][0-9]?)' + // [8] tz [9] tz_sign [10] tzHour\n  '(?::([0-9][0-9]))?))?$')           // [11] tzMinute\n\nfunction resolveYamlTimestamp (data) {\n  if (data === null) return false\n  if (YAML_DATE_REGEXP.exec(data) !== null) return true\n  if (YAML_TIMESTAMP_REGEXP.exec(data) !== null) return true\n  return false\n}\n\nfunction constructYamlTimestamp (data) {\n  let fraction = 0\n  let delta = null\n\n  let match = YAML_DATE_REGEXP.exec(data)\n  if (match === null) match = YAML_TIMESTAMP_REGEXP.exec(data)\n\n  if (match === null) throw new Error('Date resolve error')\n\n  // match: [1] year [2] month [3] day\n\n  const year = +(match[1])\n  const month = +(match[2]) - 1 // JS month starts with 0\n  const day = +(match[3])\n\n  if (!match[4]) { // no hour\n    return new Date(Date.UTC(year, month, day))\n  }\n\n  // match: [4] hour [5] minute [6] second [7] fraction\n\n  const hour = +(match[4])\n  const minute = +(match[5])\n  const second = +(match[6])\n\n  if (match[7]) {\n    fraction = match[7].slice(0, 3)\n    while (fraction.length < 3) { // milli-seconds\n      fraction += '0'\n    }\n    fraction = +fraction\n  }\n\n  // match: [8] tz [9] tz_sign [10] tzHour [11] tzMinute\n\n  if (match[9]) {\n    const tzHour = +(match[10])\n    const tzMinute = +(match[11] || 0)\n    delta = (tzHour * 60 + tzMinute) * 60000 // delta in mili-seconds\n    if (match[9] === '-') delta = -delta\n  }\n\n  const date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction))\n\n  if (delta) date.setTime(date.getTime() - delta)\n\n  return date\n}\n\nfunction representYamlTimestamp (object /*, style */) {\n  return object.toISOString()\n}\n\nmodule.exports = new Type('tag:yaml.org,2002:timestamp', {\n  kind: 'scalar',\n  resolve: resolveYamlTimestamp,\n  construct: constructYamlTimestamp,\n  instanceOf: Date,\n  represent: representYamlTimestamp\n})\n","'use strict'\n\nconst Type = require('../type')\n\nfunction resolveYamlMerge (data) {\n  return data === '<<' || data === null\n}\n\nmodule.exports = new Type('tag:yaml.org,2002:merge', {\n  kind: 'scalar',\n  resolve: resolveYamlMerge\n})\n","'use strict'\n\nconst Type = require('../type')\n\n// [ 64, 65, 66 ] -> [ padding, CR, LF ]\nconst BASE64_MAP = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\\n\\r'\n\nfunction resolveYamlBinary (data) {\n  if (data === null) return false\n\n  let bitlen = 0\n  const max = data.length\n  const map = BASE64_MAP\n\n  // Convert one by one.\n  for (let idx = 0; idx < max; idx++) {\n    const code = map.indexOf(data.charAt(idx))\n\n    // Skip CR/LF\n    if (code > 64) continue\n\n    // Fail on illegal characters\n    if (code < 0) return false\n\n    bitlen += 6\n  }\n\n  // If there are any bits left, source was corrupted\n  return (bitlen % 8) === 0\n}\n\nfunction constructYamlBinary (data) {\n  const input = data.replace(/[\\r\\n=]/g, '') // remove CR/LF & padding to simplify scan\n  const max = input.length\n  const map = BASE64_MAP\n  let bits = 0\n  const result = []\n\n  // Collect by 6*4 bits (3 bytes)\n\n  for (let idx = 0; idx < max; idx++) {\n    if ((idx % 4 === 0) && idx) {\n      result.push((bits >> 16) & 0xFF)\n      result.push((bits >> 8) & 0xFF)\n      result.push(bits & 0xFF)\n    }\n\n    bits = (bits << 6) | map.indexOf(input.charAt(idx))\n  }\n\n  // Dump tail\n\n  const tailbits = (max % 4) * 6\n\n  if (tailbits === 0) {\n    result.push((bits >> 16) & 0xFF)\n    result.push((bits >> 8) & 0xFF)\n    result.push(bits & 0xFF)\n  } else if (tailbits === 18) {\n    result.push((bits >> 10) & 0xFF)\n    result.push((bits >> 2) & 0xFF)\n  } else if (tailbits === 12) {\n    result.push((bits >> 4) & 0xFF)\n  }\n\n  return new Uint8Array(result)\n}\n\nfunction representYamlBinary (object /*, style */) {\n  let result = ''\n  let bits = 0\n  const max = object.length\n  const map = BASE64_MAP\n\n  // Convert every three bytes to 4 ASCII characters.\n\n  for (let idx = 0; idx < max; idx++) {\n    if ((idx % 3 === 0) && idx) {\n      result += map[(bits >> 18) & 0x3F]\n      result += map[(bits >> 12) & 0x3F]\n      result += map[(bits >> 6) & 0x3F]\n      result += map[bits & 0x3F]\n    }\n\n    bits = (bits << 8) + object[idx]\n  }\n\n  // Dump tail\n\n  const tail = max % 3\n\n  if (tail === 0) {\n    result += map[(bits >> 18) & 0x3F]\n    result += map[(bits >> 12) & 0x3F]\n    result += map[(bits >> 6) & 0x3F]\n    result += map[bits & 0x3F]\n  } else if (tail === 2) {\n    result += map[(bits >> 10) & 0x3F]\n    result += map[(bits >> 4) & 0x3F]\n    result += map[(bits << 2) & 0x3F]\n    result += map[64]\n  } else if (tail === 1) {\n    result += map[(bits >> 2) & 0x3F]\n    result += map[(bits << 4) & 0x3F]\n    result += map[64]\n    result += map[64]\n  }\n\n  return result\n}\n\nfunction isBinary (obj) {\n  return Object.prototype.toString.call(obj) === '[object Uint8Array]'\n}\n\nmodule.exports = new Type('tag:yaml.org,2002:binary', {\n  kind: 'scalar',\n  resolve: resolveYamlBinary,\n  construct: constructYamlBinary,\n  predicate: isBinary,\n  represent: representYamlBinary\n})\n","'use strict'\n\nconst Type = require('../type')\n\nconst _hasOwnProperty = Object.prototype.hasOwnProperty\nconst _toString = Object.prototype.toString\n\nfunction resolveYamlOmap (data) {\n  if (data === null) return true\n\n  const objectKeys = []\n  const object = data\n\n  for (let index = 0, length = object.length; index < length; index += 1) {\n    const pair = object[index]\n    let pairHasKey = false\n\n    if (_toString.call(pair) !== '[object Object]') return false\n\n    let pairKey\n    for (pairKey in pair) {\n      if (_hasOwnProperty.call(pair, pairKey)) {\n        if (!pairHasKey) pairHasKey = true\n        else return false\n      }\n    }\n\n    if (!pairHasKey) return false\n\n    if (objectKeys.indexOf(pairKey) === -1) objectKeys.push(pairKey)\n    else return false\n  }\n\n  return true\n}\n\nfunction constructYamlOmap (data) {\n  return data !== null ? data : []\n}\n\nmodule.exports = new Type('tag:yaml.org,2002:omap', {\n  kind: 'sequence',\n  resolve: resolveYamlOmap,\n  construct: constructYamlOmap\n})\n","'use strict'\n\nconst Type = require('../type')\n\nconst _toString = Object.prototype.toString\n\nfunction resolveYamlPairs (data) {\n  if (data === null) return true\n\n  const object = data\n\n  const result = new Array(object.length)\n\n  for (let index = 0, length = object.length; index < length; index += 1) {\n    const pair = object[index]\n\n    if (_toString.call(pair) !== '[object Object]') return false\n\n    const keys = Object.keys(pair)\n\n    if (keys.length !== 1) return false\n\n    result[index] = [keys[0], pair[keys[0]]]\n  }\n\n  return true\n}\n\nfunction constructYamlPairs (data) {\n  if (data === null) return []\n\n  const object = data\n  const result = new Array(object.length)\n\n  for (let index = 0, length = object.length; index < length; index += 1) {\n    const pair = object[index]\n\n    const keys = Object.keys(pair)\n\n    result[index] = [keys[0], pair[keys[0]]]\n  }\n\n  return result\n}\n\nmodule.exports = new Type('tag:yaml.org,2002:pairs', {\n  kind: 'sequence',\n  resolve: resolveYamlPairs,\n  construct: constructYamlPairs\n})\n","'use strict'\n\nconst Type = require('../type')\n\nconst _hasOwnProperty = Object.prototype.hasOwnProperty\n\nfunction resolveYamlSet (data) {\n  if (data === null) return true\n\n  const object = data\n\n  for (const key in object) {\n    if (_hasOwnProperty.call(object, key)) {\n      if (object[key] !== null) return false\n    }\n  }\n\n  return true\n}\n\nfunction constructYamlSet (data) {\n  return data !== null ? data : {}\n}\n\nmodule.exports = new Type('tag:yaml.org,2002:set', {\n  kind: 'mapping',\n  resolve: resolveYamlSet,\n  construct: constructYamlSet\n})\n","// JS-YAML's default schema for `safeLoad` function.\n// It is not described in the YAML specification.\n//\n// This schema is based on standard YAML's Core schema and includes most of\n// extra types described at YAML tag repository. (http://yaml.org/type/)\n\n'use strict'\n\nmodule.exports = require('./core').extend({\n  implicit: [\n    require('../type/timestamp'),\n    require('../type/merge')\n  ],\n  explicit: [\n    require('../type/binary'),\n    require('../type/omap'),\n    require('../type/pairs'),\n    require('../type/set')\n  ]\n})\n","'use strict'\n\nconst common = require('./common')\nconst YAMLException = require('./exception')\nconst makeSnippet = require('./snippet')\nconst DEFAULT_SCHEMA = require('./schema/default')\n\nconst _hasOwnProperty = Object.prototype.hasOwnProperty\n\nconst CONTEXT_FLOW_IN = 1\nconst CONTEXT_FLOW_OUT = 2\nconst CONTEXT_BLOCK_IN = 3\nconst CONTEXT_BLOCK_OUT = 4\n\nconst CHOMPING_CLIP = 1\nconst CHOMPING_STRIP = 2\nconst CHOMPING_KEEP = 3\n\n// eslint-disable-next-line no-control-regex\nconst PATTERN_NON_PRINTABLE = /[\\x00-\\x08\\x0B\\x0C\\x0E-\\x1F\\x7F-\\x84\\x86-\\x9F\\uFFFE\\uFFFF]|[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF]/\nconst PATTERN_NON_ASCII_LINE_BREAKS = /[\\x85\\u2028\\u2029]/\n// eslint-disable-next-line no-useless-escape\nconst PATTERN_FLOW_INDICATORS = /[,\\[\\]{}]/\n// eslint-disable-next-line no-useless-escape\nconst PATTERN_TAG_HANDLE = /^(?:!|!!|![0-9A-Za-z-]+!)$/\n// eslint-disable-next-line no-useless-escape\nconst PATTERN_TAG_URI = /^(?:!|[^,\\[\\]{}])(?:%[0-9a-f]{2}|[0-9a-z\\-#;/?:@&=+$,_.!~*'()\\[\\]])*$/i\n\nfunction _class (obj) { return Object.prototype.toString.call(obj) }\n\nfunction isEol (c) {\n  return (c === 0x0A/* LF */) || (c === 0x0D/* CR */)\n}\n\nfunction isWhiteSpace (c) {\n  return (c === 0x09/* Tab */) || (c === 0x20/* Space */)\n}\n\nfunction isWsOrEol (c) {\n  return (c === 0x09/* Tab */) ||\n         (c === 0x20/* Space */) ||\n         (c === 0x0A/* LF */) ||\n         (c === 0x0D/* CR */)\n}\n\nfunction isFlowIndicator (c) {\n  return c === 0x2C/* , */ ||\n         c === 0x5B/* [ */ ||\n         c === 0x5D/* ] */ ||\n         c === 0x7B/* { */ ||\n         c === 0x7D/* } */\n}\n\nfunction fromHexCode (c) {\n  if ((c >= 0x30/* 0 */) && (c <= 0x39/* 9 */)) {\n    return c - 0x30\n  }\n\n  const lc = c | 0x20\n\n  if ((lc >= 0x61/* a */) && (lc <= 0x66/* f */)) {\n    return lc - 0x61 + 10\n  }\n\n  return -1\n}\n\nfunction escapedHexLen (c) {\n  if (c === 0x78/* x */) { return 2 }\n  if (c === 0x75/* u */) { return 4 }\n  if (c === 0x55/* U */) { return 8 }\n  return 0\n}\n\nfunction fromDecimalCode (c) {\n  if ((c >= 0x30/* 0 */) && (c <= 0x39/* 9 */)) {\n    return c - 0x30\n  }\n\n  return -1\n}\n\nfunction simpleEscapeSequence (c) {\n  switch (c) {\n    case 0x30/* 0 */: return '\\x00'\n    case 0x61/* a */: return '\\x07'\n    case 0x62/* b */: return '\\x08'\n    case 0x74/* t */: return '\\x09'\n    case 0x09/* Tab */: return '\\x09'\n    case 0x6E/* n */: return '\\x0A'\n    case 0x76/* v */: return '\\x0B'\n    case 0x66/* f */: return '\\x0C'\n    case 0x72/* r */: return '\\x0D'\n    case 0x65/* e */: return '\\x1B'\n    case 0x20/* Space */: return ' '\n    case 0x22/* \" */: return '\\x22'\n    case 0x2F/* / */: return '/'\n    case 0x5C/* \\ */: return '\\x5C'\n    case 0x4E/* N */: return '\\x85'\n    case 0x5F/* _ */: return '\\xA0'\n    case 0x4C/* L */: return '\\u2028'\n    case 0x50/* P */: return '\\u2029'\n    default: return ''\n  }\n}\n\nfunction charFromCodepoint (c) {\n  if (c <= 0xFFFF) {\n    return String.fromCharCode(c)\n  }\n  // Encode UTF-16 surrogate pair\n  // https://en.wikipedia.org/wiki/UTF-16#Code_points_U.2B010000_to_U.2B10FFFF\n  return String.fromCharCode(\n    ((c - 0x010000) >> 10) + 0xD800,\n    ((c - 0x010000) & 0x03FF) + 0xDC00\n  )\n}\n\n// set a property of a literal object, while protecting against prototype pollution,\n// see https://github.com/nodeca/js-yaml/issues/164 for more details\nfunction setProperty (object, key, value) {\n  // used for this specific key only because Object.defineProperty is slow\n  if (key === '__proto__') {\n    Object.defineProperty(object, key, {\n      configurable: true,\n      enumerable: true,\n      writable: true,\n      value: value\n    })\n  } else {\n    object[key] = value\n  }\n}\n\nconst simpleEscapeCheck = new Array(256) // integer, for fast access\nconst simpleEscapeMap = new Array(256)\nfor (let i = 0; i < 256; i++) {\n  simpleEscapeCheck[i] = simpleEscapeSequence(i) ? 1 : 0\n  simpleEscapeMap[i] = simpleEscapeSequence(i)\n}\n\nfunction State (input, options) {\n  this.input = input\n\n  this.filename = options['filename'] || null\n  this.schema = options['schema'] || DEFAULT_SCHEMA\n  this.onWarning = options['onWarning'] || null\n  // (Hidden) Remove? makes the loader to expect YAML 1.1 documents\n  // if such documents have no explicit %YAML directive\n  this.legacy = options['legacy'] || false\n\n  this.json = options['json'] || false\n  this.listener = options['listener'] || null\n  this.maxDepth = typeof options['maxDepth'] === 'number' ? options['maxDepth'] : 100\n  this.maxTotalMergeKeys = typeof options['maxTotalMergeKeys'] === 'number' ? options['maxTotalMergeKeys'] : 10000\n\n  this.implicitTypes = this.schema.compiledImplicit\n  this.typeMap = this.schema.compiledTypeMap\n\n  this.length = input.length\n  this.position = 0\n  this.line = 0\n  this.lineStart = 0\n  this.lineIndent = 0\n  this.depth = 0\n  this.totalMergeKeys = 0\n\n  // position of first leading tab in the current line,\n  // used to make sure there are no tabs in the indentation\n  this.firstTabInLine = -1\n\n  this.documents = []\n  this.anchorMapTransactions = []\n\n  /*\n  this.version;\n  this.checkLineBreaks;\n  this.tagMap;\n  this.anchorMap;\n  this.tag;\n  this.anchor;\n  this.kind;\n  this.result; */\n}\n\nfunction generateError (state, message) {\n  const mark = {\n    name: state.filename,\n    buffer: state.input.slice(0, -1), // omit trailing \\0\n    position: state.position,\n    line: state.line,\n    column: state.position - state.lineStart\n  }\n\n  mark.snippet = makeSnippet(mark)\n\n  return new YAMLException(message, mark)\n}\n\nfunction throwError (state, message) {\n  throw generateError(state, message)\n}\n\nfunction throwWarning (state, message) {\n  if (state.onWarning) {\n    state.onWarning.call(null, generateError(state, message))\n  }\n}\n\nfunction storeAnchor (state, name, value) {\n  const transactions = state.anchorMapTransactions\n\n  if (transactions.length !== 0) {\n    const transaction = transactions[transactions.length - 1]\n\n    if (!_hasOwnProperty.call(transaction, name)) {\n      transaction[name] = {\n        existed: _hasOwnProperty.call(state.anchorMap, name),\n        value: state.anchorMap[name]\n      }\n    }\n  }\n\n  state.anchorMap[name] = value\n}\n\nfunction beginAnchorTransaction (state) {\n  state.anchorMapTransactions.push(Object.create(null))\n}\n\nfunction commitAnchorTransaction (state) {\n  const transaction = state.anchorMapTransactions.pop()\n  const transactions = state.anchorMapTransactions\n\n  if (transactions.length === 0) return\n\n  const parent = transactions[transactions.length - 1]\n  const names = Object.keys(transaction)\n\n  for (let index = 0, length = names.length; index < length; index += 1) {\n    const name = names[index]\n\n    if (!_hasOwnProperty.call(parent, name)) {\n      parent[name] = transaction[name]\n    }\n  }\n}\n\nfunction rollbackAnchorTransaction (state) {\n  const transaction = state.anchorMapTransactions.pop()\n  const names = Object.keys(transaction)\n\n  for (let index = names.length - 1; index >= 0; index -= 1) {\n    const entry = transaction[names[index]]\n\n    if (entry.existed) {\n      state.anchorMap[names[index]] = entry.value\n    } else {\n      delete state.anchorMap[names[index]]\n    }\n  }\n}\n\nfunction snapshotState (state) {\n  return {\n    position: state.position,\n    line: state.line,\n    lineStart: state.lineStart,\n    lineIndent: state.lineIndent,\n    firstTabInLine: state.firstTabInLine,\n    tag: state.tag,\n    anchor: state.anchor,\n    kind: state.kind,\n    result: state.result\n  }\n}\n\nfunction restoreState (state, snapshot) {\n  state.position = snapshot.position\n  state.line = snapshot.line\n  state.lineStart = snapshot.lineStart\n  state.lineIndent = snapshot.lineIndent\n  state.firstTabInLine = snapshot.firstTabInLine\n  state.tag = snapshot.tag\n  state.anchor = snapshot.anchor\n  state.kind = snapshot.kind\n  state.result = snapshot.result\n}\n\nconst directiveHandlers = {\n\n  YAML: function handleYamlDirective (state, name, args) {\n    if (state.version !== null) {\n      throwError(state, 'duplication of %YAML directive')\n    }\n\n    if (args.length !== 1) {\n      throwError(state, 'YAML directive accepts exactly one argument')\n    }\n\n    const match = /^([0-9]+)\\.([0-9]+)$/.exec(args[0])\n\n    if (match === null) {\n      throwError(state, 'ill-formed argument of the YAML directive')\n    }\n\n    const major = parseInt(match[1], 10)\n    const minor = parseInt(match[2], 10)\n\n    if (major !== 1) {\n      throwError(state, 'unacceptable YAML version of the document')\n    }\n\n    state.version = args[0]\n    state.checkLineBreaks = (minor < 2)\n\n    if (minor !== 1 && minor !== 2) {\n      throwWarning(state, 'unsupported YAML version of the document')\n    }\n  },\n\n  TAG: function handleTagDirective (state, name, args) {\n    let prefix\n\n    if (args.length !== 2) {\n      throwError(state, 'TAG directive accepts exactly two arguments')\n    }\n\n    const handle = args[0]\n    prefix = args[1]\n\n    if (!PATTERN_TAG_HANDLE.test(handle)) {\n      throwError(state, 'ill-formed tag handle (first argument) of the TAG directive')\n    }\n\n    if (_hasOwnProperty.call(state.tagMap, handle)) {\n      throwError(state, 'there is a previously declared suffix for \"' + handle + '\" tag handle')\n    }\n\n    if (!PATTERN_TAG_URI.test(prefix)) {\n      throwError(state, 'ill-formed tag prefix (second argument) of the TAG directive')\n    }\n\n    try {\n      prefix = decodeURIComponent(prefix)\n    } catch (err) {\n      throwError(state, 'tag prefix is malformed: ' + prefix)\n    }\n\n    state.tagMap[handle] = prefix\n  }\n}\n\nfunction captureSegment (state, start, end, checkJson) {\n  if (start < end) {\n    const _result = state.input.slice(start, end)\n\n    if (checkJson) {\n      for (let _position = 0, _length = _result.length; _position < _length; _position += 1) {\n        const _character = _result.charCodeAt(_position)\n        if (!(_character === 0x09 ||\n              (_character >= 0x20 && _character <= 0x10FFFF))) {\n          throwError(state, 'expected valid JSON character')\n        }\n      }\n    } else if (PATTERN_NON_PRINTABLE.test(_result)) {\n      throwError(state, 'the stream contains non-printable characters')\n    }\n\n    state.result += _result\n  }\n}\n\nfunction mergeMappings (state, destination, source, overridableKeys) {\n  if (!common.isObject(source)) {\n    throwError(state, 'cannot merge mappings; the provided source object is unacceptable')\n  }\n\n  const sourceKeys = Object.keys(source)\n\n  for (let index = 0, quantity = sourceKeys.length; index < quantity; index += 1) {\n    const key = sourceKeys[index]\n\n    if (state.maxTotalMergeKeys !== -1 && ++state.totalMergeKeys > state.maxTotalMergeKeys) {\n      throwError(state, 'merge keys exceeded maxTotalMergeKeys (' + state.maxTotalMergeKeys + ')')\n    }\n\n    if (!_hasOwnProperty.call(destination, key)) {\n      setProperty(destination, key, source[key])\n      overridableKeys[key] = true\n    }\n  }\n}\n\nfunction storeMappingPair (state, _result, overridableKeys, keyTag, keyNode, valueNode,\n  startLine, startLineStart, startPos) {\n  // The output is a plain object here, so keys can only be strings.\n  // We need to convert keyNode to a string, but doing so can hang the process\n  // (deeply nested arrays that explode exponentially using aliases).\n  if (Array.isArray(keyNode)) {\n    keyNode = Array.prototype.slice.call(keyNode)\n\n    for (let index = 0, quantity = keyNode.length; index < quantity; index += 1) {\n      if (Array.isArray(keyNode[index])) {\n        throwError(state, 'nested arrays are not supported inside keys')\n      }\n\n      if (typeof keyNode === 'object' && _class(keyNode[index]) === '[object Object]') {\n        keyNode[index] = '[object Object]'\n      }\n    }\n  }\n\n  // Avoid code execution in load() via toString property\n  // (still use its own toString for arrays, timestamps,\n  // and whatever user schema extensions happen to have @@toStringTag)\n  if (typeof keyNode === 'object' && _class(keyNode) === '[object Object]') {\n    keyNode = '[object Object]'\n  }\n\n  keyNode = String(keyNode)\n\n  if (_result === null) {\n    _result = {}\n  }\n\n  if (keyTag === 'tag:yaml.org,2002:merge') {\n    if (Array.isArray(valueNode)) {\n      for (let index = 0, quantity = valueNode.length; index < quantity; index += 1) {\n        mergeMappings(state, _result, valueNode[index], overridableKeys)\n      }\n    } else {\n      mergeMappings(state, _result, valueNode, overridableKeys)\n    }\n  } else {\n    if (!state.json &&\n        !_hasOwnProperty.call(overridableKeys, keyNode) &&\n        _hasOwnProperty.call(_result, keyNode)) {\n      state.line = startLine || state.line\n      state.lineStart = startLineStart || state.lineStart\n      state.position = startPos || state.position\n      throwError(state, 'duplicated mapping key')\n    }\n\n    setProperty(_result, keyNode, valueNode)\n    delete overridableKeys[keyNode]\n  }\n\n  return _result\n}\n\nfunction readLineBreak (state) {\n  const ch = state.input.charCodeAt(state.position)\n\n  if (ch === 0x0A/* LF */) {\n    state.position++\n  } else if (ch === 0x0D/* CR */) {\n    state.position++\n    if (state.input.charCodeAt(state.position) === 0x0A/* LF */) {\n      state.position++\n    }\n  } else {\n    throwError(state, 'a line break is expected')\n  }\n\n  state.line += 1\n  state.lineStart = state.position\n  state.firstTabInLine = -1\n}\n\nfunction skipSeparationSpace (state, allowComments, checkIndent) {\n  let lineBreaks = 0\n  let ch = state.input.charCodeAt(state.position)\n\n  while (ch !== 0) {\n    while (isWhiteSpace(ch)) {\n      if (ch === 0x09/* Tab */ && state.firstTabInLine === -1) {\n        state.firstTabInLine = state.position\n      }\n      ch = state.input.charCodeAt(++state.position)\n    }\n\n    if (allowComments && ch === 0x23/* # */) {\n      do {\n        ch = state.input.charCodeAt(++state.position)\n      } while (ch !== 0x0A/* LF */ && ch !== 0x0D/* CR */ && ch !== 0)\n    }\n\n    if (isEol(ch)) {\n      readLineBreak(state)\n\n      ch = state.input.charCodeAt(state.position)\n      lineBreaks++\n      state.lineIndent = 0\n\n      while (ch === 0x20/* Space */) {\n        state.lineIndent++\n        ch = state.input.charCodeAt(++state.position)\n      }\n    } else {\n      break\n    }\n  }\n\n  if (checkIndent !== -1 && lineBreaks !== 0 && state.lineIndent < checkIndent) {\n    throwWarning(state, 'deficient indentation')\n  }\n\n  return lineBreaks\n}\n\nfunction testDocumentSeparator (state) {\n  let _position = state.position\n  let ch = state.input.charCodeAt(_position)\n\n  // Condition state.position === state.lineStart is tested\n  // in parent on each call, for efficiency. No needs to test here again.\n  if ((ch === 0x2D/* - */ || ch === 0x2E/* . */) &&\n      ch === state.input.charCodeAt(_position + 1) &&\n      ch === state.input.charCodeAt(_position + 2)) {\n    _position += 3\n\n    ch = state.input.charCodeAt(_position)\n\n    if (ch === 0 || isWsOrEol(ch)) {\n      return true\n    }\n  }\n\n  return false\n}\n\nfunction writeFoldedLines (state, count) {\n  if (count === 1) {\n    state.result += ' '\n  } else if (count > 1) {\n    state.result += common.repeat('\\n', count - 1)\n  }\n}\n\nfunction readPlainScalar (state, nodeIndent, withinFlowCollection) {\n  let captureStart\n  let captureEnd\n  let hasPendingContent\n  let _line\n  let _lineStart\n  let _lineIndent\n  const _kind = state.kind\n  const _result = state.result\n\n  let ch = state.input.charCodeAt(state.position)\n\n  if (isWsOrEol(ch) ||\n      isFlowIndicator(ch) ||\n      ch === 0x23/* # */ ||\n      ch === 0x26/* & */ ||\n      ch === 0x2A/* * */ ||\n      ch === 0x21/* ! */ ||\n      ch === 0x7C/* | */ ||\n      ch === 0x3E/* > */ ||\n      ch === 0x27/* ' */ ||\n      ch === 0x22/* \" */ ||\n      ch === 0x25/* % */ ||\n      ch === 0x40/* @ */ ||\n      ch === 0x60/* ` */) {\n    return false\n  }\n\n  if (ch === 0x3F/* ? */ || ch === 0x2D/* - */) {\n    const following = state.input.charCodeAt(state.position + 1)\n\n    if (isWsOrEol(following) ||\n        (withinFlowCollection && isFlowIndicator(following))) {\n      return false\n    }\n  }\n\n  state.kind = 'scalar'\n  state.result = ''\n  captureStart = captureEnd = state.position\n  hasPendingContent = false\n\n  while (ch !== 0) {\n    if (ch === 0x3A/* : */) {\n      const following = state.input.charCodeAt(state.position + 1)\n\n      if (isWsOrEol(following) ||\n          (withinFlowCollection && isFlowIndicator(following))) {\n        break\n      }\n    } else if (ch === 0x23/* # */) {\n      const preceding = state.input.charCodeAt(state.position - 1)\n\n      if (isWsOrEol(preceding)) {\n        break\n      }\n    } else if ((state.position === state.lineStart && testDocumentSeparator(state)) ||\n               (withinFlowCollection && isFlowIndicator(ch))) {\n      break\n    } else if (isEol(ch)) {\n      _line = state.line\n      _lineStart = state.lineStart\n      _lineIndent = state.lineIndent\n      skipSeparationSpace(state, false, -1)\n\n      if (state.lineIndent >= nodeIndent) {\n        hasPendingContent = true\n        ch = state.input.charCodeAt(state.position)\n        continue\n      } else {\n        state.position = captureEnd\n        state.line = _line\n        state.lineStart = _lineStart\n        state.lineIndent = _lineIndent\n        break\n      }\n    }\n\n    if (hasPendingContent) {\n      captureSegment(state, captureStart, captureEnd, false)\n      writeFoldedLines(state, state.line - _line)\n      captureStart = captureEnd = state.position\n      hasPendingContent = false\n    }\n\n    if (!isWhiteSpace(ch)) {\n      captureEnd = state.position + 1\n    }\n\n    ch = state.input.charCodeAt(++state.position)\n  }\n\n  captureSegment(state, captureStart, captureEnd, false)\n\n  if (state.result) {\n    return true\n  }\n\n  state.kind = _kind\n  state.result = _result\n  return false\n}\n\nfunction readSingleQuotedScalar (state, nodeIndent) {\n  let captureStart\n  let captureEnd\n\n  let ch = state.input.charCodeAt(state.position)\n\n  if (ch !== 0x27/* ' */) {\n    return false\n  }\n\n  state.kind = 'scalar'\n  state.result = ''\n  state.position++\n  captureStart = captureEnd = state.position\n\n  while ((ch = state.input.charCodeAt(state.position)) !== 0) {\n    if (ch === 0x27/* ' */) {\n      captureSegment(state, captureStart, state.position, true)\n      ch = state.input.charCodeAt(++state.position)\n\n      if (ch === 0x27/* ' */) {\n        captureStart = state.position\n        state.position++\n        captureEnd = state.position\n      } else {\n        return true\n      }\n    } else if (isEol(ch)) {\n      captureSegment(state, captureStart, captureEnd, true)\n      writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent))\n      captureStart = captureEnd = state.position\n    } else if (state.position === state.lineStart && testDocumentSeparator(state)) {\n      throwError(state, 'unexpected end of the document within a single quoted scalar')\n    } else {\n      state.position++\n      if (!isWhiteSpace(ch)) {\n        captureEnd = state.position\n      }\n    }\n  }\n\n  throwError(state, 'unexpected end of the stream within a single quoted scalar')\n}\n\nfunction readDoubleQuotedScalar (state, nodeIndent) {\n  let captureStart\n  let captureEnd\n  let tmp\n\n  let ch = state.input.charCodeAt(state.position)\n\n  if (ch !== 0x22/* \" */) {\n    return false\n  }\n\n  state.kind = 'scalar'\n  state.result = ''\n  state.position++\n  captureStart = captureEnd = state.position\n\n  while ((ch = state.input.charCodeAt(state.position)) !== 0) {\n    if (ch === 0x22/* \" */) {\n      captureSegment(state, captureStart, state.position, true)\n      state.position++\n      return true\n    } else if (ch === 0x5C/* \\ */) {\n      captureSegment(state, captureStart, state.position, true)\n      ch = state.input.charCodeAt(++state.position)\n\n      if (isEol(ch)) {\n        skipSeparationSpace(state, false, nodeIndent)\n\n        // TODO: rework to inline fn with no type cast?\n      } else if (ch < 256 && simpleEscapeCheck[ch]) {\n        state.result += simpleEscapeMap[ch]\n        state.position++\n      } else if ((tmp = escapedHexLen(ch)) > 0) {\n        let hexLength = tmp\n        let hexResult = 0\n\n        for (; hexLength > 0; hexLength--) {\n          ch = state.input.charCodeAt(++state.position)\n\n          if ((tmp = fromHexCode(ch)) >= 0) {\n            hexResult = (hexResult << 4) + tmp\n          } else {\n            throwError(state, 'expected hexadecimal character')\n          }\n        }\n\n        state.result += charFromCodepoint(hexResult)\n\n        state.position++\n      } else {\n        throwError(state, 'unknown escape sequence')\n      }\n\n      captureStart = captureEnd = state.position\n    } else if (isEol(ch)) {\n      captureSegment(state, captureStart, captureEnd, true)\n      writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent))\n      captureStart = captureEnd = state.position\n    } else if (state.position === state.lineStart && testDocumentSeparator(state)) {\n      throwError(state, 'unexpected end of the document within a double quoted scalar')\n    } else {\n      state.position++\n      if (!isWhiteSpace(ch)) {\n        captureEnd = state.position\n      }\n    }\n  }\n\n  throwError(state, 'unexpected end of the stream within a double quoted scalar')\n}\n\nfunction readFlowCollection (state, nodeIndent) {\n  let readNext = true\n  let _line\n  let _lineStart\n  let _pos\n  const _tag = state.tag\n  let _result\n  const _anchor = state.anchor\n  let terminator\n  let isPair\n  let isExplicitPair\n  let isMapping\n  const overridableKeys = Object.create(null)\n  let keyNode\n  let keyTag\n  let valueNode\n\n  let ch = state.input.charCodeAt(state.position)\n\n  if (ch === 0x5B/* [ */) {\n    terminator = 0x5D/* ] */\n    isMapping = false\n    _result = []\n  } else if (ch === 0x7B/* { */) {\n    terminator = 0x7D/* } */\n    isMapping = true\n    _result = {}\n  } else {\n    return false\n  }\n\n  if (state.anchor !== null) {\n    storeAnchor(state, state.anchor, _result)\n  }\n\n  ch = state.input.charCodeAt(++state.position)\n\n  while (ch !== 0) {\n    skipSeparationSpace(state, true, nodeIndent)\n\n    ch = state.input.charCodeAt(state.position)\n\n    if (ch === terminator) {\n      state.position++\n      state.tag = _tag\n      state.anchor = _anchor\n      state.kind = isMapping ? 'mapping' : 'sequence'\n      state.result = _result\n      return true\n    } else if (!readNext) {\n      throwError(state, 'missed comma between flow collection entries')\n    } else if (ch === 0x2C/* , */) {\n      // \"flow collection entries can never be completely empty\", as per YAML 1.2, section 7.4\n      throwError(state, \"expected the node content, but found ','\")\n    }\n\n    keyTag = keyNode = valueNode = null\n    isPair = isExplicitPair = false\n\n    if (ch === 0x3F/* ? */) {\n      const following = state.input.charCodeAt(state.position + 1)\n\n      if (isWsOrEol(following)) {\n        isPair = isExplicitPair = true\n        state.position++\n        skipSeparationSpace(state, true, nodeIndent)\n      }\n    }\n\n    _line = state.line // Save the current line.\n    _lineStart = state.lineStart\n    _pos = state.position\n    composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true)\n    keyTag = state.tag\n    keyNode = state.result\n    skipSeparationSpace(state, true, nodeIndent)\n\n    ch = state.input.charCodeAt(state.position)\n\n    if ((isExplicitPair || state.line === _line) && ch === 0x3A/* : */) {\n      isPair = true\n      ch = state.input.charCodeAt(++state.position)\n      skipSeparationSpace(state, true, nodeIndent)\n      composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true)\n      valueNode = state.result\n    }\n\n    if (isMapping) {\n      storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos)\n    } else if (isPair) {\n      _result.push(storeMappingPair(state, null, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos))\n    } else {\n      _result.push(keyNode)\n    }\n\n    skipSeparationSpace(state, true, nodeIndent)\n\n    ch = state.input.charCodeAt(state.position)\n\n    if (ch === 0x2C/* , */) {\n      readNext = true\n      ch = state.input.charCodeAt(++state.position)\n    } else {\n      readNext = false\n    }\n  }\n\n  throwError(state, 'unexpected end of the stream within a flow collection')\n}\n\nfunction readBlockScalar (state, nodeIndent) {\n  let folding\n  let chomping = CHOMPING_CLIP\n  let didReadContent = false\n  let detectedIndent = false\n  let textIndent = nodeIndent\n  let emptyLines = 0\n  let atMoreIndented = false\n  let tmp\n\n  let ch = state.input.charCodeAt(state.position)\n\n  if (ch === 0x7C/* | */) {\n    folding = false\n  } else if (ch === 0x3E/* > */) {\n    folding = true\n  } else {\n    return false\n  }\n\n  state.kind = 'scalar'\n  state.result = ''\n\n  while (ch !== 0) {\n    ch = state.input.charCodeAt(++state.position)\n\n    if (ch === 0x2B/* + */ || ch === 0x2D/* - */) {\n      if (CHOMPING_CLIP === chomping) {\n        chomping = (ch === 0x2B/* + */) ? CHOMPING_KEEP : CHOMPING_STRIP\n      } else {\n        throwError(state, 'repeat of a chomping mode identifier')\n      }\n    } else if ((tmp = fromDecimalCode(ch)) >= 0) {\n      if (tmp === 0) {\n        throwError(state, 'bad explicit indentation width of a block scalar; it cannot be less than one')\n      } else if (!detectedIndent) {\n        textIndent = nodeIndent + tmp - 1\n        detectedIndent = true\n      } else {\n        throwError(state, 'repeat of an indentation width identifier')\n      }\n    } else {\n      break\n    }\n  }\n\n  if (isWhiteSpace(ch)) {\n    do { ch = state.input.charCodeAt(++state.position) }\n    while (isWhiteSpace(ch))\n\n    if (ch === 0x23/* # */) {\n      do { ch = state.input.charCodeAt(++state.position) }\n      while (!isEol(ch) && (ch !== 0))\n    }\n  }\n\n  while (ch !== 0) {\n    readLineBreak(state)\n    state.lineIndent = 0\n\n    ch = state.input.charCodeAt(state.position)\n\n    // eslint-disable-next-line no-unmodified-loop-condition\n    while ((!detectedIndent || state.lineIndent < textIndent) &&\n           (ch === 0x20/* Space */)) {\n      state.lineIndent++\n      ch = state.input.charCodeAt(++state.position)\n    }\n\n    if (!detectedIndent && state.lineIndent > textIndent) {\n      textIndent = state.lineIndent\n    }\n\n    if (isEol(ch)) {\n      emptyLines++\n      continue\n    }\n\n    if (!detectedIndent && textIndent === 0) {\n      throwError(state, 'missing indentation for block scalar')\n    }\n\n    // End of the scalar.\n    if (state.lineIndent < textIndent) {\n      // Perform the chomping.\n      if (chomping === CHOMPING_KEEP) {\n        state.result += common.repeat('\\n', didReadContent ? 1 + emptyLines : emptyLines)\n      } else if (chomping === CHOMPING_CLIP) {\n        if (didReadContent) { // i.e. only if the scalar is not empty.\n          state.result += '\\n'\n        }\n      }\n\n      // Break this `while` cycle and go to the funciton's epilogue.\n      break\n    }\n\n    // Folded style: use fancy rules to handle line breaks.\n    if (folding) {\n      // Lines starting with white space characters (more-indented lines) are not folded.\n      if (isWhiteSpace(ch)) {\n        atMoreIndented = true\n        // except for the first content line (cf. Example 8.1)\n        state.result += common.repeat('\\n', didReadContent ? 1 + emptyLines : emptyLines)\n\n      // End of more-indented block.\n      } else if (atMoreIndented) {\n        atMoreIndented = false\n        state.result += common.repeat('\\n', emptyLines + 1)\n\n      // Just one line break - perceive as the same line.\n      } else if (emptyLines === 0) {\n        if (didReadContent) { // i.e. only if we have already read some scalar content.\n          state.result += ' '\n        }\n\n      // Several line breaks - perceive as different lines.\n      } else {\n        state.result += common.repeat('\\n', emptyLines)\n      }\n\n    // Literal style: just add exact number of line breaks between content lines.\n    } else {\n      // Keep all line breaks except the header line break.\n      state.result += common.repeat('\\n', didReadContent ? 1 + emptyLines : emptyLines)\n    }\n\n    didReadContent = true\n    detectedIndent = true\n    emptyLines = 0\n    const captureStart = state.position\n\n    while (!isEol(ch) && (ch !== 0)) {\n      ch = state.input.charCodeAt(++state.position)\n    }\n\n    captureSegment(state, captureStart, state.position, false)\n  }\n\n  return true\n}\n\nfunction readBlockSequence (state, nodeIndent) {\n  const _tag = state.tag\n  const _anchor = state.anchor\n  const _result = []\n  let detected = false\n\n  // there is a leading tab before this token, so it can't be a block sequence/mapping;\n  // it can still be flow sequence/mapping or a scalar\n  if (state.firstTabInLine !== -1) return false\n\n  if (state.anchor !== null) {\n    storeAnchor(state, state.anchor, _result)\n  }\n\n  let ch = state.input.charCodeAt(state.position)\n\n  while (ch !== 0) {\n    if (state.firstTabInLine !== -1) {\n      state.position = state.firstTabInLine\n      throwError(state, 'tab characters must not be used in indentation')\n    }\n\n    if (ch !== 0x2D/* - */) {\n      break\n    }\n\n    const following = state.input.charCodeAt(state.position + 1)\n\n    if (!isWsOrEol(following)) {\n      break\n    }\n\n    detected = true\n    state.position++\n\n    if (skipSeparationSpace(state, true, -1)) {\n      if (state.lineIndent <= nodeIndent) {\n        _result.push(null)\n        ch = state.input.charCodeAt(state.position)\n        continue\n      }\n    }\n\n    const _line = state.line\n    composeNode(state, nodeIndent, CONTEXT_BLOCK_IN, false, true)\n    _result.push(state.result)\n    skipSeparationSpace(state, true, -1)\n\n    ch = state.input.charCodeAt(state.position)\n\n    if ((state.line === _line || state.lineIndent > nodeIndent) && (ch !== 0)) {\n      throwError(state, 'bad indentation of a sequence entry')\n    } else if (state.lineIndent < nodeIndent) {\n      break\n    }\n  }\n\n  if (detected) {\n    state.tag = _tag\n    state.anchor = _anchor\n    state.kind = 'sequence'\n    state.result = _result\n    return true\n  }\n  return false\n}\n\nfunction readBlockMapping (state, nodeIndent, flowIndent) {\n  let allowCompact\n  let _keyLine\n  let _keyLineStart\n  let _keyPos\n  const _tag = state.tag\n  const _anchor = state.anchor\n  const _result = {}\n  const overridableKeys = Object.create(null)\n  let keyTag = null\n  let keyNode = null\n  let valueNode = null\n  let atExplicitKey = false\n  let detected = false\n\n  // there is a leading tab before this token, so it can't be a block sequence/mapping;\n  // it can still be flow sequence/mapping or a scalar\n  if (state.firstTabInLine !== -1) return false\n\n  if (state.anchor !== null) {\n    storeAnchor(state, state.anchor, _result)\n  }\n\n  let ch = state.input.charCodeAt(state.position)\n\n  while (ch !== 0) {\n    if (!atExplicitKey && state.firstTabInLine !== -1) {\n      state.position = state.firstTabInLine\n      throwError(state, 'tab characters must not be used in indentation')\n    }\n\n    const following = state.input.charCodeAt(state.position + 1)\n    const _line = state.line // Save the current line.\n\n    //\n    // Explicit notation case. There are two separate blocks:\n    // first for the key (denoted by \"?\") and second for the value (denoted by \":\")\n    //\n    if ((ch === 0x3F/* ? */ || ch === 0x3A/* : */) && isWsOrEol(following)) {\n      if (ch === 0x3F/* ? */) {\n        if (atExplicitKey) {\n          storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos)\n          keyTag = keyNode = valueNode = null\n        }\n\n        detected = true\n        atExplicitKey = true\n        allowCompact = true\n      } else if (atExplicitKey) {\n        // i.e. 0x3A/* : */ === character after the explicit key.\n        atExplicitKey = false\n        allowCompact = true\n      } else {\n        throwError(state, 'incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line')\n      }\n\n      state.position += 1\n      ch = following\n\n    //\n    // Implicit notation case. Flow-style node as the key first, then \":\", and the value.\n    //\n    } else {\n      _keyLine = state.line\n      _keyLineStart = state.lineStart\n      _keyPos = state.position\n\n      if (!composeNode(state, flowIndent, CONTEXT_FLOW_OUT, false, true)) {\n        // Neither implicit nor explicit notation.\n        // Reading is done. Go to the epilogue.\n        break\n      }\n\n      if (state.line === _line) {\n        ch = state.input.charCodeAt(state.position)\n\n        while (isWhiteSpace(ch)) {\n          ch = state.input.charCodeAt(++state.position)\n        }\n\n        if (ch === 0x3A/* : */) {\n          ch = state.input.charCodeAt(++state.position)\n\n          if (!isWsOrEol(ch)) {\n            throwError(state, 'a whitespace character is expected after the key-value separator within a block mapping')\n          }\n\n          if (atExplicitKey) {\n            storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos)\n            keyTag = keyNode = valueNode = null\n          }\n\n          detected = true\n          atExplicitKey = false\n          allowCompact = false\n          keyTag = state.tag\n          keyNode = state.result\n        } else if (detected) {\n          throwError(state, 'can not read an implicit mapping pair; a colon is missed')\n        } else {\n          state.tag = _tag\n          state.anchor = _anchor\n          return true // Keep the result of `composeNode`.\n        }\n      } else if (detected) {\n        throwError(state, 'can not read a block mapping entry; a multiline key may not be an implicit key')\n      } else {\n        state.tag = _tag\n        state.anchor = _anchor\n        return true // Keep the result of `composeNode`.\n      }\n    }\n\n    //\n    // Common reading code for both explicit and implicit notations.\n    //\n    if (state.line === _line || state.lineIndent > nodeIndent) {\n      if (atExplicitKey) {\n        _keyLine = state.line\n        _keyLineStart = state.lineStart\n        _keyPos = state.position\n      }\n\n      if (composeNode(state, nodeIndent, CONTEXT_BLOCK_OUT, true, allowCompact)) {\n        if (atExplicitKey) {\n          keyNode = state.result\n        } else {\n          valueNode = state.result\n        }\n      }\n\n      if (!atExplicitKey) {\n        storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _keyLine, _keyLineStart, _keyPos)\n        keyTag = keyNode = valueNode = null\n      }\n\n      skipSeparationSpace(state, true, -1)\n      ch = state.input.charCodeAt(state.position)\n    }\n\n    if ((state.line === _line || state.lineIndent > nodeIndent) && (ch !== 0)) {\n      throwError(state, 'bad indentation of a mapping entry')\n    } else if (state.lineIndent < nodeIndent) {\n      break\n    }\n  }\n\n  //\n  // Epilogue.\n  //\n\n  // Special case: last mapping's node contains only the key in explicit notation.\n  if (atExplicitKey) {\n    storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos)\n  }\n\n  // Expose the resulting mapping.\n  if (detected) {\n    state.tag = _tag\n    state.anchor = _anchor\n    state.kind = 'mapping'\n    state.result = _result\n  }\n\n  return detected\n}\n\nfunction readTagProperty (state) {\n  let isVerbatim = false\n  let isNamed = false\n  let tagHandle\n  let tagName\n\n  let ch = state.input.charCodeAt(state.position)\n\n  if (ch !== 0x21/* ! */) return false\n\n  if (state.tag !== null) {\n    throwError(state, 'duplication of a tag property')\n  }\n\n  ch = state.input.charCodeAt(++state.position)\n\n  if (ch === 0x3C/* < */) {\n    isVerbatim = true\n    ch = state.input.charCodeAt(++state.position)\n  } else if (ch === 0x21/* ! */) {\n    isNamed = true\n    tagHandle = '!!'\n    ch = state.input.charCodeAt(++state.position)\n  } else {\n    tagHandle = '!'\n  }\n\n  let _position = state.position\n\n  if (isVerbatim) {\n    do { ch = state.input.charCodeAt(++state.position) }\n    while (ch !== 0 && ch !== 0x3E/* > */)\n\n    if (state.position < state.length) {\n      tagName = state.input.slice(_position, state.position)\n      ch = state.input.charCodeAt(++state.position)\n    } else {\n      throwError(state, 'unexpected end of the stream within a verbatim tag')\n    }\n  } else {\n    while (ch !== 0 && !isWsOrEol(ch)) {\n      if (ch === 0x21/* ! */) {\n        if (!isNamed) {\n          tagHandle = state.input.slice(_position - 1, state.position + 1)\n\n          if (!PATTERN_TAG_HANDLE.test(tagHandle)) {\n            throwError(state, 'named tag handle cannot contain such characters')\n          }\n\n          isNamed = true\n          _position = state.position + 1\n        } else {\n          throwError(state, 'tag suffix cannot contain exclamation marks')\n        }\n      }\n\n      ch = state.input.charCodeAt(++state.position)\n    }\n\n    tagName = state.input.slice(_position, state.position)\n\n    if (PATTERN_FLOW_INDICATORS.test(tagName)) {\n      throwError(state, 'tag suffix cannot contain flow indicator characters')\n    }\n  }\n\n  if (tagName && !PATTERN_TAG_URI.test(tagName)) {\n    throwError(state, 'tag name cannot contain such characters: ' + tagName)\n  }\n\n  try {\n    tagName = decodeURIComponent(tagName)\n  } catch (err) {\n    throwError(state, 'tag name is malformed: ' + tagName)\n  }\n\n  if (isVerbatim) {\n    state.tag = tagName\n  } else if (_hasOwnProperty.call(state.tagMap, tagHandle)) {\n    state.tag = state.tagMap[tagHandle] + tagName\n  } else if (tagHandle === '!') {\n    state.tag = '!' + tagName\n  } else if (tagHandle === '!!') {\n    state.tag = 'tag:yaml.org,2002:' + tagName\n  } else {\n    throwError(state, 'undeclared tag handle \"' + tagHandle + '\"')\n  }\n\n  return true\n}\n\nfunction readAnchorProperty (state) {\n  let ch = state.input.charCodeAt(state.position)\n\n  if (ch !== 0x26/* & */) return false\n\n  if (state.anchor !== null) {\n    throwError(state, 'duplication of an anchor property')\n  }\n\n  ch = state.input.charCodeAt(++state.position)\n  const _position = state.position\n\n  while (ch !== 0 && !isWsOrEol(ch) && !isFlowIndicator(ch)) {\n    ch = state.input.charCodeAt(++state.position)\n  }\n\n  if (state.position === _position) {\n    throwError(state, 'name of an anchor node must contain at least one character')\n  }\n\n  state.anchor = state.input.slice(_position, state.position)\n  return true\n}\n\nfunction readAlias (state) {\n  let ch = state.input.charCodeAt(state.position)\n\n  if (ch !== 0x2A/* * */) return false\n\n  ch = state.input.charCodeAt(++state.position)\n  const _position = state.position\n\n  while (ch !== 0 && !isWsOrEol(ch) && !isFlowIndicator(ch)) {\n    ch = state.input.charCodeAt(++state.position)\n  }\n\n  if (state.position === _position) {\n    throwError(state, 'name of an alias node must contain at least one character')\n  }\n\n  const alias = state.input.slice(_position, state.position)\n\n  if (!_hasOwnProperty.call(state.anchorMap, alias)) {\n    throwError(state, 'unidentified alias \"' + alias + '\"')\n  }\n\n  state.result = state.anchorMap[alias]\n  skipSeparationSpace(state, true, -1)\n  return true\n}\n\nfunction tryReadBlockMappingFromProperty (state, propertyStart, nodeIndent, flowIndent) {\n  const fallbackState = snapshotState(state)\n\n  beginAnchorTransaction(state)\n  restoreState(state, propertyStart)\n\n  // Re-read the leading properties as part of the first implicit key, not as\n  // properties of the current node.\n  state.tag = null\n  state.anchor = null\n  state.kind = null\n  state.result = null\n\n  if (readBlockMapping(state, nodeIndent, flowIndent) && state.kind === 'mapping') {\n    commitAnchorTransaction(state)\n    return true\n  }\n\n  rollbackAnchorTransaction(state)\n  restoreState(state, fallbackState)\n  return false\n}\n\nfunction composeNode (state, parentIndent, nodeContext, allowToSeek, allowCompact) {\n  let allowBlockScalars\n  let allowBlockCollections\n  let indentStatus = 1 // 1: this>parent, 0: this=parent, -1: this<parent\n  let atNewLine = false\n  let hasContent = false\n  let propertyStart = null\n  let type\n  let flowIndent\n  let blockIndent\n\n  if (state.depth >= state.maxDepth) {\n    throwError(state, 'nesting exceeded maxDepth (' + state.maxDepth + ')')\n  }\n\n  state.depth += 1\n\n  if (state.listener !== null) {\n    state.listener('open', state)\n  }\n\n  state.tag = null\n  state.anchor = null\n  state.kind = null\n  state.result = null\n\n  const allowBlockStyles = allowBlockScalars = allowBlockCollections =\n    CONTEXT_BLOCK_OUT === nodeContext ||\n    CONTEXT_BLOCK_IN === nodeContext\n\n  if (allowToSeek) {\n    if (skipSeparationSpace(state, true, -1)) {\n      atNewLine = true\n\n      if (state.lineIndent > parentIndent) {\n        indentStatus = 1\n      } else if (state.lineIndent === parentIndent) {\n        indentStatus = 0\n      } else if (state.lineIndent < parentIndent) {\n        indentStatus = -1\n      }\n    }\n  }\n\n  if (indentStatus === 1) {\n    while (true) {\n      const ch = state.input.charCodeAt(state.position)\n      const propertyState = snapshotState(state)\n\n      // A duplicate property token after a line break can be the first key of\n      // a nested block mapping, e.g. `!!map\\n  !!str key: value`.\n      if (atNewLine &&\n          ((ch === 0x21/* ! */ && state.tag !== null) ||\n           (ch === 0x26/* & */ && state.anchor !== null))) {\n        break\n      }\n\n      if (!readTagProperty(state) && !readAnchorProperty(state)) {\n        break\n      }\n\n      if (propertyStart === null) {\n        propertyStart = propertyState\n      }\n\n      if (skipSeparationSpace(state, true, -1)) {\n        atNewLine = true\n        allowBlockCollections = allowBlockStyles\n\n        if (state.lineIndent > parentIndent) {\n          indentStatus = 1\n        } else if (state.lineIndent === parentIndent) {\n          indentStatus = 0\n        } else if (state.lineIndent < parentIndent) {\n          indentStatus = -1\n        }\n      } else {\n        allowBlockCollections = false\n      }\n    }\n  }\n\n  if (allowBlockCollections) {\n    allowBlockCollections = atNewLine || allowCompact\n  }\n\n  if (indentStatus === 1 || CONTEXT_BLOCK_OUT === nodeContext) {\n    if (CONTEXT_FLOW_IN === nodeContext || CONTEXT_FLOW_OUT === nodeContext) {\n      flowIndent = parentIndent\n    } else {\n      flowIndent = parentIndent + 1\n    }\n\n    blockIndent = state.position - state.lineStart\n\n    if (indentStatus === 1) {\n      if ((allowBlockCollections &&\n          (readBlockSequence(state, blockIndent) || readBlockMapping(state, blockIndent, flowIndent))) ||\n          readFlowCollection(state, flowIndent)) {\n        hasContent = true\n      } else {\n        const ch = state.input.charCodeAt(state.position)\n\n        if (propertyStart !== null && allowBlockStyles && !allowBlockCollections &&\n            ch !== 0x7C/* | */ && ch !== 0x3E/* > */ &&\n            tryReadBlockMappingFromProperty(\n              state,\n              propertyStart,\n              propertyStart.position - propertyStart.lineStart,\n              flowIndent\n            )) {\n          hasContent = true\n        } else if ((allowBlockScalars && readBlockScalar(state, flowIndent)) ||\n            readSingleQuotedScalar(state, flowIndent) ||\n            readDoubleQuotedScalar(state, flowIndent)) {\n          hasContent = true\n        } else if (readAlias(state)) {\n          hasContent = true\n\n          if (state.tag !== null || state.anchor !== null) {\n            throwError(state, 'alias node should not have any properties')\n          }\n        } else if (readPlainScalar(state, flowIndent, CONTEXT_FLOW_IN === nodeContext)) {\n          hasContent = true\n\n          if (state.tag === null) {\n            state.tag = '?'\n          }\n        }\n\n        if (state.anchor !== null) {\n          storeAnchor(state, state.anchor, state.result)\n        }\n      }\n    } else if (indentStatus === 0) {\n      // Special case: block sequences are allowed to have same indentation level as the parent.\n      // http://www.yaml.org/spec/1.2/spec.html#id2799784\n      hasContent = allowBlockCollections && readBlockSequence(state, blockIndent)\n    }\n  }\n\n  if (state.tag === null) {\n    if (state.anchor !== null) {\n      storeAnchor(state, state.anchor, state.result)\n    }\n  } else if (state.tag === '?') {\n    // Implicit resolving is not allowed for non-scalar types, and '?'\n    // non-specific tag is only automatically assigned to plain scalars.\n    //\n    // We only need to check kind conformity in case user explicitly assigns '?'\n    // tag, for example like this: \"!<?> [0]\"\n    //\n    if (state.result !== null && state.kind !== 'scalar') {\n      throwError(state, 'unacceptable node kind for !<?> tag; it should be \"scalar\", not \"' + state.kind + '\"')\n    }\n\n    for (let typeIndex = 0, typeQuantity = state.implicitTypes.length; typeIndex < typeQuantity; typeIndex += 1) {\n      type = state.implicitTypes[typeIndex]\n\n      if (type.resolve(state.result)) { // `state.result` updated in resolver if matched\n        state.result = type.construct(state.result)\n        state.tag = type.tag\n        if (state.anchor !== null) {\n          storeAnchor(state, state.anchor, state.result)\n        }\n        break\n      }\n    }\n  } else if (state.tag !== '!') {\n    if (_hasOwnProperty.call(state.typeMap[state.kind || 'fallback'], state.tag)) {\n      type = state.typeMap[state.kind || 'fallback'][state.tag]\n    } else {\n      // looking for multi type\n      type = null\n      const typeList = state.typeMap.multi[state.kind || 'fallback']\n\n      for (let typeIndex = 0, typeQuantity = typeList.length; typeIndex < typeQuantity; typeIndex += 1) {\n        if (state.tag.slice(0, typeList[typeIndex].tag.length) === typeList[typeIndex].tag) {\n          type = typeList[typeIndex]\n          break\n        }\n      }\n    }\n\n    if (!type) {\n      throwError(state, 'unknown tag !<' + state.tag + '>')\n    }\n\n    if (state.result !== null && type.kind !== state.kind) {\n      throwError(state, 'unacceptable node kind for !<' + state.tag + '> tag; it should be \"' + type.kind + '\", not \"' + state.kind + '\"')\n    }\n\n    if (!type.resolve(state.result, state.tag)) { // `state.result` updated in resolver if matched\n      throwError(state, 'cannot resolve a node with !<' + state.tag + '> explicit tag')\n    } else {\n      state.result = type.construct(state.result, state.tag)\n      if (state.anchor !== null) {\n        storeAnchor(state, state.anchor, state.result)\n      }\n    }\n  }\n\n  if (state.listener !== null) {\n    state.listener('close', state)\n  }\n\n  state.depth -= 1\n  return state.tag !== null || state.anchor !== null || hasContent\n}\n\nfunction readDocument (state) {\n  const documentStart = state.position\n  let hasDirectives = false\n  let ch\n\n  state.version = null\n  state.checkLineBreaks = state.legacy\n  state.tagMap = Object.create(null)\n  state.anchorMap = Object.create(null)\n\n  while ((ch = state.input.charCodeAt(state.position)) !== 0) {\n    skipSeparationSpace(state, true, -1)\n\n    ch = state.input.charCodeAt(state.position)\n\n    if (state.lineIndent > 0 || ch !== 0x25/* % */) {\n      break\n    }\n\n    hasDirectives = true\n    ch = state.input.charCodeAt(++state.position)\n    let _position = state.position\n\n    while (ch !== 0 && !isWsOrEol(ch)) {\n      ch = state.input.charCodeAt(++state.position)\n    }\n\n    const directiveName = state.input.slice(_position, state.position)\n    const directiveArgs = []\n\n    if (directiveName.length < 1) {\n      throwError(state, 'directive name must not be less than one character in length')\n    }\n\n    while (ch !== 0) {\n      while (isWhiteSpace(ch)) {\n        ch = state.input.charCodeAt(++state.position)\n      }\n\n      if (ch === 0x23/* # */) {\n        do { ch = state.input.charCodeAt(++state.position) }\n        while (ch !== 0 && !isEol(ch))\n        break\n      }\n\n      if (isEol(ch)) break\n\n      _position = state.position\n\n      while (ch !== 0 && !isWsOrEol(ch)) {\n        ch = state.input.charCodeAt(++state.position)\n      }\n\n      directiveArgs.push(state.input.slice(_position, state.position))\n    }\n\n    if (ch !== 0) readLineBreak(state)\n\n    if (_hasOwnProperty.call(directiveHandlers, directiveName)) {\n      directiveHandlers[directiveName](state, directiveName, directiveArgs)\n    } else {\n      throwWarning(state, 'unknown document directive \"' + directiveName + '\"')\n    }\n  }\n\n  skipSeparationSpace(state, true, -1)\n\n  if (state.lineIndent === 0 &&\n      state.input.charCodeAt(state.position) === 0x2D/* - */ &&\n      state.input.charCodeAt(state.position + 1) === 0x2D/* - */ &&\n      state.input.charCodeAt(state.position + 2) === 0x2D/* - */) {\n    state.position += 3\n    skipSeparationSpace(state, true, -1)\n  } else if (hasDirectives) {\n    throwError(state, 'directives end mark is expected')\n  }\n\n  composeNode(state, state.lineIndent - 1, CONTEXT_BLOCK_OUT, false, true)\n  skipSeparationSpace(state, true, -1)\n\n  if (state.checkLineBreaks &&\n      PATTERN_NON_ASCII_LINE_BREAKS.test(state.input.slice(documentStart, state.position))) {\n    throwWarning(state, 'non-ASCII line breaks are interpreted as content')\n  }\n\n  state.documents.push(state.result)\n\n  if (state.position === state.lineStart && testDocumentSeparator(state)) {\n    if (state.input.charCodeAt(state.position) === 0x2E/* . */) {\n      state.position += 3\n      skipSeparationSpace(state, true, -1)\n    }\n    return\n  }\n\n  if (state.position < (state.length - 1)) {\n    throwError(state, 'end of the stream or a document separator is expected')\n  }\n}\n\nfunction loadDocuments (input, options) {\n  input = String(input)\n  options = options || {}\n\n  if (input.length !== 0) {\n    // Add tailing `\\n` if not exists\n    if (input.charCodeAt(input.length - 1) !== 0x0A/* LF */ &&\n        input.charCodeAt(input.length - 1) !== 0x0D/* CR */) {\n      input += '\\n'\n    }\n\n    // Strip BOM\n    if (input.charCodeAt(0) === 0xFEFF) {\n      input = input.slice(1)\n    }\n  }\n\n  const state = new State(input, options)\n\n  const nullpos = input.indexOf('\\0')\n\n  if (nullpos !== -1) {\n    state.position = nullpos\n    throwError(state, 'null byte is not allowed in input')\n  }\n\n  // Use 0 as string terminator. That significantly simplifies bounds check.\n  state.input += '\\0'\n\n  while (state.input.charCodeAt(state.position) === 0x20/* Space */) {\n    state.lineIndent += 1\n    state.position += 1\n  }\n\n  while (state.position < (state.length - 1)) {\n    readDocument(state)\n  }\n\n  return state.documents\n}\n\nfunction loadAll (input, iterator, options) {\n  if (iterator !== null && typeof iterator === 'object' && typeof options === 'undefined') {\n    options = iterator\n    iterator = null\n  }\n\n  const documents = loadDocuments(input, options)\n\n  if (typeof iterator !== 'function') {\n    return documents\n  }\n\n  for (let index = 0, length = documents.length; index < length; index += 1) {\n    iterator(documents[index])\n  }\n}\n\nfunction load (input, options) {\n  const documents = loadDocuments(input, options)\n\n  if (documents.length === 0) {\n    return undefined\n  } else if (documents.length === 1) {\n    return documents[0]\n  }\n  throw new YAMLException('expected a single document in the stream, but found more')\n}\n\nmodule.exports.loadAll = loadAll\nmodule.exports.load = load\n","'use strict'\n\nconst common = require('./common')\n\n// get snippet for a single line, respecting maxLength\nfunction getLine (buffer, lineStart, lineEnd, position, maxLineLength) {\n  let head = ''\n  let tail = ''\n  const maxHalfLength = Math.floor(maxLineLength / 2) - 1\n\n  if (position - lineStart > maxHalfLength) {\n    head = ' ... '\n    lineStart = position - maxHalfLength + head.length\n  }\n\n  if (lineEnd - position > maxHalfLength) {\n    tail = ' ...'\n    lineEnd = position + maxHalfLength - tail.length\n  }\n\n  return {\n    str: head + buffer.slice(lineStart, lineEnd).replace(/\\t/g, 'â†’') + tail,\n    pos: position - lineStart + head.length // relative position\n  }\n}\n\nfunction padStart (string, max) {\n  return common.repeat(' ', max - string.length) + string\n}\n\nfunction makeSnippet (mark, options) {\n  options = Object.create(options || null)\n\n  if (!mark.buffer) return null\n\n  if (!options.maxLength) options.maxLength = 79\n  if (typeof options.indent !== 'number') options.indent = 1\n  if (typeof options.linesBefore !== 'number') options.linesBefore = 3\n  if (typeof options.linesAfter !== 'number') options.linesAfter = 2\n\n  const re = /\\r?\\n|\\r|\\0/g\n  const lineStarts = [0]\n  const lineEnds = []\n  let match\n  let foundLineNo = -1\n\n  while ((match = re.exec(mark.buffer))) {\n    lineEnds.push(match.index)\n    lineStarts.push(match.index + match[0].length)\n\n    if (mark.position <= match.index && foundLineNo < 0) {\n      foundLineNo = lineStarts.length - 2\n    }\n  }\n\n  if (foundLineNo < 0) foundLineNo = lineStarts.length - 1\n\n  let result = ''\n  const lineNoLength = Math.min(mark.line + options.linesAfter, lineEnds.length).toString().length\n  const maxLineLength = options.maxLength - (options.indent + lineNoLength + 3)\n\n  for (let i = 1; i <= options.linesBefore; i++) {\n    if (foundLineNo - i < 0) break\n    const line = getLine(\n      mark.buffer,\n      lineStarts[foundLineNo - i],\n      lineEnds[foundLineNo - i],\n      mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo - i]),\n      maxLineLength\n    )\n    result = common.repeat(' ', options.indent) + padStart((mark.line - i + 1).toString(), lineNoLength) +\n      ' | ' + line.str + '\\n' + result\n  }\n\n  const line = getLine(mark.buffer, lineStarts[foundLineNo], lineEnds[foundLineNo], mark.position, maxLineLength)\n  result += common.repeat(' ', options.indent) + padStart((mark.line + 1).toString(), lineNoLength) +\n    ' | ' + line.str + '\\n'\n  result += common.repeat('-', options.indent + lineNoLength + 3 + line.pos) + '^' + '\\n'\n\n  for (let i = 1; i <= options.linesAfter; i++) {\n    if (foundLineNo + i >= lineEnds.length) break\n    const line = getLine(\n      mark.buffer,\n      lineStarts[foundLineNo + i],\n      lineEnds[foundLineNo + i],\n      mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo + i]),\n      maxLineLength\n    )\n    result += common.repeat(' ', options.indent) + padStart((mark.line + i + 1).toString(), lineNoLength) +\n      ' | ' + line.str + '\\n'\n  }\n\n  return result.replace(/\\n$/, '')\n}\n\nmodule.exports = makeSnippet\n","'use strict'\n\nconst common = require('./common')\nconst YAMLException = require('./exception')\nconst DEFAULT_SCHEMA = require('./schema/default')\n\nconst _toString = Object.prototype.toString\nconst _hasOwnProperty = Object.prototype.hasOwnProperty\n\nconst CHAR_BOM = 0xFEFF\nconst CHAR_TAB = 0x09 /* Tab */\nconst CHAR_LINE_FEED = 0x0A /* LF */\nconst CHAR_CARRIAGE_RETURN = 0x0D /* CR */\nconst CHAR_SPACE = 0x20 /* Space */\nconst CHAR_EXCLAMATION = 0x21 /* ! */\nconst CHAR_DOUBLE_QUOTE = 0x22 /* \" */\nconst CHAR_SHARP = 0x23 /* # */\nconst CHAR_PERCENT = 0x25 /* % */\nconst CHAR_AMPERSAND = 0x26 /* & */\nconst CHAR_SINGLE_QUOTE = 0x27 /* ' */\nconst CHAR_ASTERISK = 0x2A /* * */\nconst CHAR_COMMA = 0x2C /* , */\nconst CHAR_MINUS = 0x2D /* - */\nconst CHAR_COLON = 0x3A /* : */\nconst CHAR_EQUALS = 0x3D /* = */\nconst CHAR_GREATER_THAN = 0x3E /* > */\nconst CHAR_QUESTION = 0x3F /* ? */\nconst CHAR_COMMERCIAL_AT = 0x40 /* @ */\nconst CHAR_LEFT_SQUARE_BRACKET = 0x5B /* [ */\nconst CHAR_RIGHT_SQUARE_BRACKET = 0x5D /* ] */\nconst CHAR_GRAVE_ACCENT = 0x60 /* ` */\nconst CHAR_LEFT_CURLY_BRACKET = 0x7B /* { */\nconst CHAR_VERTICAL_LINE = 0x7C /* | */\nconst CHAR_RIGHT_CURLY_BRACKET = 0x7D /* } */\n\nconst ESCAPE_SEQUENCES = {}\n\nESCAPE_SEQUENCES[0x00] = '\\\\0'\nESCAPE_SEQUENCES[0x07] = '\\\\a'\nESCAPE_SEQUENCES[0x08] = '\\\\b'\nESCAPE_SEQUENCES[0x09] = '\\\\t'\nESCAPE_SEQUENCES[0x0A] = '\\\\n'\nESCAPE_SEQUENCES[0x0B] = '\\\\v'\nESCAPE_SEQUENCES[0x0C] = '\\\\f'\nESCAPE_SEQUENCES[0x0D] = '\\\\r'\nESCAPE_SEQUENCES[0x1B] = '\\\\e'\nESCAPE_SEQUENCES[0x22] = '\\\\\"'\nESCAPE_SEQUENCES[0x5C] = '\\\\\\\\'\nESCAPE_SEQUENCES[0x85] = '\\\\N'\nESCAPE_SEQUENCES[0xA0] = '\\\\_'\nESCAPE_SEQUENCES[0x2028] = '\\\\L'\nESCAPE_SEQUENCES[0x2029] = '\\\\P'\n\nconst DEPRECATED_BOOLEANS_SYNTAX = [\n  'y', 'Y', 'yes', 'Yes', 'YES', 'on', 'On', 'ON',\n  'n', 'N', 'no', 'No', 'NO', 'off', 'Off', 'OFF'\n]\n\nconst DEPRECATED_BASE60_SYNTAX = /^[-+]?[0-9_]+(?::[0-9_]+)+(?:\\.[0-9_]*)?$/\n\nfunction compileStyleMap (schema, map) {\n  if (map === null) return {}\n\n  const result = {}\n  const keys = Object.keys(map)\n\n  for (let index = 0, length = keys.length; index < length; index += 1) {\n    let tag = keys[index]\n    let style = String(map[tag])\n\n    if (tag.slice(0, 2) === '!!') {\n      tag = 'tag:yaml.org,2002:' + tag.slice(2)\n    }\n    const type = schema.compiledTypeMap['fallback'][tag]\n\n    if (type && _hasOwnProperty.call(type.styleAliases, style)) {\n      style = type.styleAliases[style]\n    }\n\n    result[tag] = style\n  }\n\n  return result\n}\n\nfunction encodeHex (character) {\n  let handle\n  let length\n\n  const string = character.toString(16).toUpperCase()\n\n  if (character <= 0xFF) {\n    handle = 'x'\n    length = 2\n  } else if (character <= 0xFFFF) {\n    handle = 'u'\n    length = 4\n  } else if (character <= 0xFFFFFFFF) {\n    handle = 'U'\n    length = 8\n  } else {\n    throw new YAMLException('code point within a string may not be greater than 0xFFFFFFFF')\n  }\n\n  return '\\\\' + handle + common.repeat('0', length - string.length) + string\n}\n\nconst QUOTING_TYPE_SINGLE = 1\nconst QUOTING_TYPE_DOUBLE = 2\n\nfunction State (options) {\n  this.schema = options['schema'] || DEFAULT_SCHEMA\n  this.indent = Math.max(1, (options['indent'] || 2))\n  this.noArrayIndent = options['noArrayIndent'] || false\n  this.skipInvalid = options['skipInvalid'] || false\n  this.flowLevel = (common.isNothing(options['flowLevel']) ? -1 : options['flowLevel'])\n  this.styleMap = compileStyleMap(this.schema, options['styles'] || null)\n  this.sortKeys = options['sortKeys'] || false\n  this.lineWidth = options['lineWidth'] || 80\n  this.noRefs = options['noRefs'] || false\n  this.noCompatMode = options['noCompatMode'] || false\n  this.condenseFlow = options['condenseFlow'] || false\n  this.quotingType = options['quotingType'] === '\"' ? QUOTING_TYPE_DOUBLE : QUOTING_TYPE_SINGLE\n  this.forceQuotes = options['forceQuotes'] || false\n  this.replacer = typeof options['replacer'] === 'function' ? options['replacer'] : null\n\n  this.implicitTypes = this.schema.compiledImplicit\n  this.explicitTypes = this.schema.compiledExplicit\n\n  this.tag = null\n  this.result = ''\n\n  this.duplicates = []\n  this.usedDuplicates = null\n}\n\n// Indents every line in a string. Empty lines (\\n only) are not indented.\nfunction indentString (string, spaces) {\n  const ind = common.repeat(' ', spaces)\n  let position = 0\n  let result = ''\n  const length = string.length\n\n  while (position < length) {\n    let line\n    const next = string.indexOf('\\n', position)\n    if (next === -1) {\n      line = string.slice(position)\n      position = length\n    } else {\n      line = string.slice(position, next + 1)\n      position = next + 1\n    }\n\n    if (line.length && line !== '\\n') result += ind\n\n    result += line\n  }\n\n  return result\n}\n\nfunction generateNextLine (state, level) {\n  return '\\n' + common.repeat(' ', state.indent * level)\n}\n\nfunction testImplicitResolving (state, str) {\n  for (let index = 0, length = state.implicitTypes.length; index < length; index += 1) {\n    const type = state.implicitTypes[index]\n\n    if (type.resolve(str)) {\n      return true\n    }\n  }\n\n  return false\n}\n\n// [33] s-white ::= s-space | s-tab\nfunction isWhitespace (c) {\n  return c === CHAR_SPACE || c === CHAR_TAB\n}\n\n// Returns true if the character can be printed without escaping.\n// From YAML 1.2: \"any allowed characters known to be non-printable\n// should also be escaped. [However,] This isnâ€™t mandatory\"\n// Derived from nb-char - \\t - #x85 - #xA0 - #x2028 - #x2029.\nfunction isPrintable (c) {\n  return (c >= 0x00020 && c <= 0x00007E) ||\n    ((c >= 0x000A1 && c <= 0x00D7FF) && c !== 0x2028 && c !== 0x2029) ||\n    ((c >= 0x0E000 && c <= 0x00FFFD) && c !== CHAR_BOM) ||\n    (c >= 0x10000 && c <= 0x10FFFF)\n}\n\n// [34] ns-char ::= nb-char - s-white\n// [27] nb-char ::= c-printable - b-char - c-byte-order-mark\n// [26] b-char  ::= b-line-feed | b-carriage-return\n// Including s-white (for some reason, examples doesn't match specs in this aspect)\n// ns-char ::= c-printable - b-line-feed - b-carriage-return - c-byte-order-mark\nfunction isNsCharOrWhitespace (c) {\n  return isPrintable(c) &&\n    c !== CHAR_BOM &&\n    // - b-char\n    c !== CHAR_CARRIAGE_RETURN &&\n    c !== CHAR_LINE_FEED\n}\n\n// [127]  ns-plain-safe(c) ::= c = flow-out  â‡’ ns-plain-safe-out\n//                             c = flow-in   â‡’ ns-plain-safe-in\n//                             c = block-key â‡’ ns-plain-safe-out\n//                             c = flow-key  â‡’ ns-plain-safe-in\n// [128] ns-plain-safe-out ::= ns-char\n// [129]  ns-plain-safe-in ::= ns-char - c-flow-indicator\n// [130]  ns-plain-char(c) ::=  ( ns-plain-safe(c) - â€œ:â€� - â€œ#â€� )\n//                            | ( /* An ns-char preceding */ â€œ#â€� )\n//                            | ( â€œ:â€� /* Followed by an ns-plain-safe(c) */ )\nfunction isPlainSafe (c, prev, inblock) {\n  const cIsNsCharOrWhitespace = isNsCharOrWhitespace(c)\n  const cIsNsChar = cIsNsCharOrWhitespace && !isWhitespace(c)\n  return (\n    (\n      // ns-plain-safe\n      inblock // c = flow-in\n        ? cIsNsCharOrWhitespace\n        : cIsNsCharOrWhitespace &&\n          // - c-flow-indicator\n          c !== CHAR_COMMA &&\n          c !== CHAR_LEFT_SQUARE_BRACKET &&\n          c !== CHAR_RIGHT_SQUARE_BRACKET &&\n          c !== CHAR_LEFT_CURLY_BRACKET &&\n          c !== CHAR_RIGHT_CURLY_BRACKET\n    ) &&\n    // ns-plain-char\n    c !== CHAR_SHARP && // false on '#'\n    !(prev === CHAR_COLON && !cIsNsChar)\n  ) || // false on ': '\n  (isNsCharOrWhitespace(prev) && !isWhitespace(prev) && c === CHAR_SHARP) || // change to true on '[^ ]#'\n  (prev === CHAR_COLON && cIsNsChar) // change to true on ':[^ ]'\n}\n\n// Simplified test for values allowed as the first character in plain style.\nfunction isPlainSafeFirst (c) {\n  // Uses a subset of ns-char - c-indicator\n  // where ns-char = nb-char - s-white.\n  // No support of ( ( â€œ?â€� | â€œ:â€� | â€œ-â€� ) /* Followed by an ns-plain-safe(c)) */ ) part\n  return isPrintable(c) &&\n    c !== CHAR_BOM &&\n    !isWhitespace(c) && // - s-white\n    // - (c-indicator ::=\n    // â€œ-â€� | â€œ?â€� | â€œ:â€� | â€œ,â€� | â€œ[â€� | â€œ]â€� | â€œ{â€� | â€œ}â€�\n    c !== CHAR_MINUS &&\n    c !== CHAR_QUESTION &&\n    c !== CHAR_COLON &&\n    c !== CHAR_COMMA &&\n    c !== CHAR_LEFT_SQUARE_BRACKET &&\n    c !== CHAR_RIGHT_SQUARE_BRACKET &&\n    c !== CHAR_LEFT_CURLY_BRACKET &&\n    c !== CHAR_RIGHT_CURLY_BRACKET &&\n    // | â€œ#â€� | â€œ&â€� | â€œ*â€� | â€œ!â€� | â€œ|â€� | â€œ=â€� | â€œ>â€� | â€œ'â€� | â€œ\"â€�\n    c !== CHAR_SHARP &&\n    c !== CHAR_AMPERSAND &&\n    c !== CHAR_ASTERISK &&\n    c !== CHAR_EXCLAMATION &&\n    c !== CHAR_VERTICAL_LINE &&\n    c !== CHAR_EQUALS &&\n    c !== CHAR_GREATER_THAN &&\n    c !== CHAR_SINGLE_QUOTE &&\n    c !== CHAR_DOUBLE_QUOTE &&\n    // | â€œ%â€� | â€œ@â€� | â€œ`â€�)\n    c !== CHAR_PERCENT &&\n    c !== CHAR_COMMERCIAL_AT &&\n    c !== CHAR_GRAVE_ACCENT\n}\n\n// Simplified test for values allowed as the last character in plain style.\nfunction isPlainSafeLast (c) {\n  // just not whitespace or colon, it will be checked to be plain character later\n  return !isWhitespace(c) && c !== CHAR_COLON\n}\n\n// Same as 'string'.codePointAt(pos), but works in older browsers.\nfunction codePointAt (string, pos) {\n  const first = string.charCodeAt(pos)\n  let second\n\n  if (first >= 0xD800 && first <= 0xDBFF && pos + 1 < string.length) {\n    second = string.charCodeAt(pos + 1)\n    if (second >= 0xDC00 && second <= 0xDFFF) {\n      // https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae\n      return (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000\n    }\n  }\n  return first\n}\n\n// Determines whether block indentation indicator is required.\nfunction needIndentIndicator (string) {\n  const leadingSpaceRe = /^\\n* /\n  return leadingSpaceRe.test(string)\n}\n\nconst STYLE_PLAIN = 1\nconst STYLE_SINGLE = 2\nconst STYLE_LITERAL = 3\nconst STYLE_FOLDED = 4\nconst STYLE_DOUBLE = 5\n\n// Determines which scalar styles are possible and returns the preferred style.\n// lineWidth = -1 => no limit.\n// Pre-conditions: str.length > 0.\n// Post-conditions:\n//    STYLE_PLAIN or STYLE_SINGLE => no \\n are in the string.\n//    STYLE_LITERAL => no lines are suitable for folding (or lineWidth is -1).\n//    STYLE_FOLDED => a line > lineWidth and can be folded (and lineWidth != -1).\nfunction chooseScalarStyle (string, singleLineOnly, indentPerLevel, lineWidth,\n  testAmbiguousType, quotingType, forceQuotes, inblock) {\n  let i\n  let char = 0\n  let prevChar = null\n  let hasLineBreak = false\n  let hasFoldableLine = false // only checked if shouldTrackWidth\n  const shouldTrackWidth = lineWidth !== -1\n  let previousLineBreak = -1 // count the first line correctly\n  let plain = isPlainSafeFirst(codePointAt(string, 0)) &&\n    isPlainSafeLast(codePointAt(string, string.length - 1))\n\n  if (singleLineOnly || forceQuotes) {\n    // Case: no block styles.\n    // Check for disallowed characters to rule out plain and single.\n    for (i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++) {\n      char = codePointAt(string, i)\n      if (!isPrintable(char)) {\n        return STYLE_DOUBLE\n      }\n      plain = plain && isPlainSafe(char, prevChar, inblock)\n      prevChar = char\n    }\n  } else {\n    // Case: block styles permitted.\n    for (i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++) {\n      char = codePointAt(string, i)\n      if (char === CHAR_LINE_FEED) {\n        hasLineBreak = true\n        // Check if any line can be folded.\n        if (shouldTrackWidth) {\n          hasFoldableLine = hasFoldableLine ||\n            // Foldable line = too long, and not more-indented.\n            (i - previousLineBreak - 1 > lineWidth &&\n             string[previousLineBreak + 1] !== ' ')\n          previousLineBreak = i\n        }\n      } else if (!isPrintable(char)) {\n        return STYLE_DOUBLE\n      }\n      plain = plain && isPlainSafe(char, prevChar, inblock)\n      prevChar = char\n    }\n    // in case the end is missing a \\n\n    hasFoldableLine = hasFoldableLine || (shouldTrackWidth &&\n      (i - previousLineBreak - 1 > lineWidth &&\n       string[previousLineBreak + 1] !== ' '))\n  }\n  // Although every style can represent \\n without escaping, prefer block styles\n  // for multiline, since they're more readable and they don't add empty lines.\n  // Also prefer folding a super-long line.\n  if (!hasLineBreak && !hasFoldableLine) {\n    // Strings interpretable as another type have to be quoted;\n    // e.g. the string 'true' vs. the boolean true.\n    if (plain && !forceQuotes && !testAmbiguousType(string)) {\n      return STYLE_PLAIN\n    }\n    return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : STYLE_SINGLE\n  }\n  // Edge case: block indentation indicator can only have one digit.\n  if (indentPerLevel > 9 && needIndentIndicator(string)) {\n    return STYLE_DOUBLE\n  }\n  // At this point we know block styles are valid.\n  // Prefer literal style unless we want to fold.\n  if (!forceQuotes) {\n    return hasFoldableLine ? STYLE_FOLDED : STYLE_LITERAL\n  }\n  return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : STYLE_SINGLE\n}\n\n// Note: line breaking/folding is implemented for only the folded style.\n// NB. We drop the last trailing newline (if any) of a returned block scalar\n//  since the dumper adds its own newline. This always works:\n//    â€¢ No ending newline => unaffected; already using strip \"-\" chomping.\n//    â€¢ Ending newline    => removed then restored.\n//  Importantly, this keeps the \"+\" chomp indicator from gaining an extra line.\nfunction writeScalar (state, string, level, iskey, inblock) {\n  state.dump = (function () {\n    if (string.length === 0) {\n      return state.quotingType === QUOTING_TYPE_DOUBLE ? '\"\"' : \"''\"\n    }\n    if (!state.noCompatMode) {\n      if (DEPRECATED_BOOLEANS_SYNTAX.indexOf(string) !== -1 || DEPRECATED_BASE60_SYNTAX.test(string)) {\n        return state.quotingType === QUOTING_TYPE_DOUBLE ? ('\"' + string + '\"') : (\"'\" + string + \"'\")\n      }\n    }\n\n    const indent = state.indent * Math.max(1, level) // no 0-indent scalars\n    // As indentation gets deeper, let the width decrease monotonically\n    // to the lower bound min(state.lineWidth, 40).\n    // Note that this implies\n    //  state.lineWidth â‰¤ 40 + state.indent: width is fixed at the lower bound.\n    //  state.lineWidth > 40 + state.indent: width decreases until the lower bound.\n    // This behaves better than a constant minimum width which disallows narrower options,\n    // or an indent threshold which causes the width to suddenly increase.\n    const lineWidth = (state.lineWidth === -1)\n      ? -1\n      : Math.max(Math.min(state.lineWidth, 40), state.lineWidth - indent)\n\n    // Without knowing if keys are implicit/explicit, assume implicit for safety.\n    const singleLineOnly = iskey ||\n      // No block styles in flow mode.\n      (state.flowLevel > -1 && level >= state.flowLevel)\n    function testAmbiguity (string) {\n      return testImplicitResolving(state, string)\n    }\n\n    switch (chooseScalarStyle(string, singleLineOnly, state.indent, lineWidth,\n      testAmbiguity, state.quotingType, state.forceQuotes && !iskey, inblock)) {\n      case STYLE_PLAIN:\n        return string\n      case STYLE_SINGLE:\n        return \"'\" + string.replace(/'/g, \"''\") + \"'\"\n      case STYLE_LITERAL:\n        return '|' + blockHeader(string, state.indent) +\n          dropEndingNewline(indentString(string, indent))\n      case STYLE_FOLDED:\n        return '>' + blockHeader(string, state.indent) +\n          dropEndingNewline(indentString(foldString(string, lineWidth), indent))\n      case STYLE_DOUBLE:\n        return '\"' + escapeString(string, lineWidth) + '\"'\n      default:\n        throw new YAMLException('impossible error: invalid scalar style')\n    }\n  }())\n}\n\n// Pre-conditions: string is valid for a block scalar, 1 <= indentPerLevel <= 9.\nfunction blockHeader (string, indentPerLevel) {\n  const indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : ''\n\n  // note the special case: the string '\\n' counts as a \"trailing\" empty line.\n  const clip = string[string.length - 1] === '\\n'\n  const keep = clip && (string[string.length - 2] === '\\n' || string === '\\n')\n  const chomp = keep ? '+' : (clip ? '' : '-')\n\n  return indentIndicator + chomp + '\\n'\n}\n\n// (See the note for writeScalar.)\nfunction dropEndingNewline (string) {\n  return string[string.length - 1] === '\\n' ? string.slice(0, -1) : string\n}\n\n// Note: a long line without a suitable break point will exceed the width limit.\n// Pre-conditions: every char in str isPrintable, str.length > 0, width > 0.\nfunction foldString (string, width) {\n  // In folded style, $k$ consecutive newlines output as $k+1$ newlinesâ€”\n  // unless they're before or after a more-indented line, or at the very\n  // beginning or end, in which case $k$ maps to $k$.\n  // Therefore, parse each chunk as newline(s) followed by a content line.\n  const lineRe = /(\\n+)([^\\n]*)/g\n\n  // first line (possibly an empty line)\n  let result = (function () {\n    let nextLF = string.indexOf('\\n')\n    nextLF = nextLF !== -1 ? nextLF : string.length\n    lineRe.lastIndex = nextLF\n    return foldLine(string.slice(0, nextLF), width)\n  }())\n  // If we haven't reached the first content line yet, don't add an extra \\n.\n  let prevMoreIndented = string[0] === '\\n' || string[0] === ' '\n  let moreIndented\n\n  // rest of the lines\n  let match\n  while ((match = lineRe.exec(string))) {\n    const prefix = match[1]\n    const line = match[2]\n\n    moreIndented = (line[0] === ' ')\n    result += prefix +\n      ((!prevMoreIndented && !moreIndented && line !== '') ? '\\n' : '') +\n      foldLine(line, width)\n    prevMoreIndented = moreIndented\n  }\n\n  return result\n}\n\n// Greedy line breaking.\n// Picks the longest line under the limit each time,\n// otherwise settles for the shortest line over the limit.\n// NB. More-indented lines *cannot* be folded, as that would add an extra \\n.\nfunction foldLine (line, width) {\n  if (line === '' || line[0] === ' ') return line\n\n  // Since a more-indented line adds a \\n, breaks can't be followed by a space.\n  const breakRe = / [^ ]/g // note: the match index will always be <= length-2.\n  let match\n  // start is an inclusive index. end, curr, and next are exclusive.\n  let start = 0\n  let end\n  let curr = 0\n  let next = 0\n  let result = ''\n\n  // Invariants: 0 <= start <= length-1.\n  //   0 <= curr <= next <= max(0, length-2). curr - start <= width.\n  // Inside the loop:\n  //   A match implies length >= 2, so curr and next are <= length-2.\n  while ((match = breakRe.exec(line))) {\n    next = match.index\n    // maintain invariant: curr - start <= width\n    if (next - start > width) {\n      end = (curr > start) ? curr : next // derive end <= length-2\n      result += '\\n' + line.slice(start, end)\n      // skip the space that was output as \\n\n      start = end + 1                    // derive start <= length-1\n    }\n    curr = next\n  }\n\n  // By the invariants, start <= length-1, so there is something left over.\n  // It is either the whole string or a part starting from non-whitespace.\n  result += '\\n'\n  // Insert a break if the remainder is too long and there is a break available.\n  if (line.length - start > width && curr > start) {\n    result += line.slice(start, curr) + '\\n' + line.slice(curr + 1)\n  } else {\n    result += line.slice(start)\n  }\n\n  return result.slice(1) // drop extra \\n joiner\n}\n\n// Escapes a double-quoted string.\nfunction escapeString (string) {\n  let result = ''\n  let char = 0\n\n  for (let i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++) {\n    char = codePointAt(string, i)\n    const escapeSeq = ESCAPE_SEQUENCES[char]\n\n    if (!escapeSeq && isPrintable(char)) {\n      result += string[i]\n      if (char >= 0x10000) result += string[i + 1]\n    } else {\n      result += escapeSeq || encodeHex(char)\n    }\n  }\n\n  return result\n}\n\nfunction writeFlowSequence (state, level, object) {\n  let _result = ''\n  const _tag = state.tag\n\n  for (let index = 0, length = object.length; index < length; index += 1) {\n    let value = object[index]\n\n    if (state.replacer) {\n      value = state.replacer.call(object, String(index), value)\n    }\n\n    // Write only valid elements, put null instead of invalid elements.\n    if (writeNode(state, level, value, false, false) ||\n        (typeof value === 'undefined' &&\n         writeNode(state, level, null, false, false))) {\n      if (_result !== '') _result += ',' + (!state.condenseFlow ? ' ' : '')\n      _result += state.dump\n    }\n  }\n\n  state.tag = _tag\n  state.dump = '[' + _result + ']'\n}\n\nfunction writeBlockSequence (state, level, object, compact) {\n  let _result = ''\n  const _tag = state.tag\n\n  for (let index = 0, length = object.length; index < length; index += 1) {\n    let value = object[index]\n\n    if (state.replacer) {\n      value = state.replacer.call(object, String(index), value)\n    }\n\n    // Write only valid elements, put null instead of invalid elements.\n    if (writeNode(state, level + 1, value, true, true, false, true) ||\n        (typeof value === 'undefined' &&\n         writeNode(state, level + 1, null, true, true, false, true))) {\n      if (!compact || _result !== '') {\n        _result += generateNextLine(state, level)\n      }\n\n      if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {\n        _result += '-'\n      } else {\n        _result += '- '\n      }\n\n      _result += state.dump\n    }\n  }\n\n  state.tag = _tag\n  state.dump = _result || '[]' // Empty sequence if no valid values.\n}\n\nfunction writeFlowMapping (state, level, object) {\n  let _result = ''\n  const _tag = state.tag\n  const objectKeyList = Object.keys(object)\n\n  for (let index = 0, length = objectKeyList.length; index < length; index += 1) {\n    let pairBuffer = ''\n    if (_result !== '') pairBuffer += ', '\n\n    if (state.condenseFlow) pairBuffer += '\"'\n\n    const objectKey = objectKeyList[index]\n    let objectValue = object[objectKey]\n\n    if (state.replacer) {\n      objectValue = state.replacer.call(object, objectKey, objectValue)\n    }\n\n    if (!writeNode(state, level, objectKey, false, false)) {\n      continue // Skip this pair because of invalid key;\n    }\n\n    if (state.dump.length > 1024) pairBuffer += '? '\n\n    pairBuffer += state.dump + (state.condenseFlow ? '\"' : '') + ':' + (state.condenseFlow ? '' : ' ')\n\n    if (!writeNode(state, level, objectValue, false, false)) {\n      continue // Skip this pair because of invalid value.\n    }\n\n    pairBuffer += state.dump\n\n    // Both key and value are valid.\n    _result += pairBuffer\n  }\n\n  state.tag = _tag\n  state.dump = '{' + _result + '}'\n}\n\nfunction writeBlockMapping (state, level, object, compact) {\n  let _result = ''\n  const _tag = state.tag\n  const objectKeyList = Object.keys(object)\n\n  // Allow sorting keys so that the output file is deterministic\n  if (state.sortKeys === true) {\n    // Default sorting\n    objectKeyList.sort()\n  } else if (typeof state.sortKeys === 'function') {\n    // Custom sort function\n    objectKeyList.sort(state.sortKeys)\n  } else if (state.sortKeys) {\n    // Something is wrong\n    throw new YAMLException('sortKeys must be a boolean or a function')\n  }\n\n  for (let index = 0, length = objectKeyList.length; index < length; index += 1) {\n    let pairBuffer = ''\n\n    if (!compact || _result !== '') {\n      pairBuffer += generateNextLine(state, level)\n    }\n\n    const objectKey = objectKeyList[index]\n    let objectValue = object[objectKey]\n\n    if (state.replacer) {\n      objectValue = state.replacer.call(object, objectKey, objectValue)\n    }\n\n    if (!writeNode(state, level + 1, objectKey, true, true, true)) {\n      continue // Skip this pair because of invalid key.\n    }\n\n    const explicitPair = (state.tag !== null && state.tag !== '?') ||\n                   (state.dump && state.dump.length > 1024)\n\n    if (explicitPair) {\n      if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {\n        pairBuffer += '?'\n      } else {\n        pairBuffer += '? '\n      }\n    }\n\n    pairBuffer += state.dump\n\n    if (explicitPair) {\n      pairBuffer += generateNextLine(state, level)\n    }\n\n    if (!writeNode(state, level + 1, objectValue, true, explicitPair)) {\n      continue // Skip this pair because of invalid value.\n    }\n\n    if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {\n      pairBuffer += ':'\n    } else {\n      pairBuffer += ': '\n    }\n\n    pairBuffer += state.dump\n\n    // Both key and value are valid.\n    _result += pairBuffer\n  }\n\n  state.tag = _tag\n  state.dump = _result || '{}' // Empty mapping if no valid pairs.\n}\n\nfunction detectType (state, object, explicit) {\n  const typeList = explicit ? state.explicitTypes : state.implicitTypes\n\n  for (let index = 0, length = typeList.length; index < length; index += 1) {\n    const type = typeList[index]\n\n    if ((type.instanceOf || type.predicate) &&\n        (!type.instanceOf || ((typeof object === 'object') && (object instanceof type.instanceOf))) &&\n        (!type.predicate || type.predicate(object))) {\n      if (explicit) {\n        if (type.multi && type.representName) {\n          state.tag = type.representName(object)\n        } else {\n          state.tag = type.tag\n        }\n      } else {\n        state.tag = '?'\n      }\n\n      if (type.represent) {\n        const style = state.styleMap[type.tag] || type.defaultStyle\n\n        let _result\n        if (_toString.call(type.represent) === '[object Function]') {\n          _result = type.represent(object, style)\n        } else if (_hasOwnProperty.call(type.represent, style)) {\n          _result = type.represent[style](object, style)\n        } else {\n          throw new YAMLException('!<' + type.tag + '> tag resolver accepts not \"' + style + '\" style')\n        }\n\n        state.dump = _result\n      }\n\n      return true\n    }\n  }\n\n  return false\n}\n\n// Serializes `object` and writes it to global `result`.\n// Returns true on success, or false on invalid object.\n//\nfunction writeNode (state, level, object, block, compact, iskey, isblockseq) {\n  state.tag = null\n  state.dump = object\n\n  if (!detectType(state, object, false)) {\n    detectType(state, object, true)\n  }\n\n  const type = _toString.call(state.dump)\n  const inblock = block\n\n  if (block) {\n    block = (state.flowLevel < 0 || state.flowLevel > level)\n  }\n\n  const objectOrArray = type === '[object Object]' || type === '[object Array]'\n  let duplicateIndex\n  let duplicate\n\n  if (objectOrArray) {\n    duplicateIndex = state.duplicates.indexOf(object)\n    duplicate = duplicateIndex !== -1\n  }\n\n  if ((state.tag !== null && state.tag !== '?') || duplicate || (state.indent !== 2 && level > 0)) {\n    compact = false\n  }\n\n  if (duplicate && state.usedDuplicates[duplicateIndex]) {\n    state.dump = '*ref_' + duplicateIndex\n  } else {\n    if (objectOrArray && duplicate && !state.usedDuplicates[duplicateIndex]) {\n      state.usedDuplicates[duplicateIndex] = true\n    }\n    if (type === '[object Object]') {\n      if (block && (Object.keys(state.dump).length !== 0)) {\n        writeBlockMapping(state, level, state.dump, compact)\n        if (duplicate) {\n          state.dump = '&ref_' + duplicateIndex + state.dump\n        }\n      } else {\n        writeFlowMapping(state, level, state.dump)\n        if (duplicate) {\n          state.dump = '&ref_' + duplicateIndex + ' ' + state.dump\n        }\n      }\n    } else if (type === '[object Array]') {\n      if (block && (state.dump.length !== 0)) {\n        if (state.noArrayIndent && !isblockseq && level > 0) {\n          writeBlockSequence(state, level - 1, state.dump, compact)\n        } else {\n          writeBlockSequence(state, level, state.dump, compact)\n        }\n        if (duplicate) {\n          state.dump = '&ref_' + duplicateIndex + state.dump\n        }\n      } else {\n        writeFlowSequence(state, level, state.dump)\n        if (duplicate) {\n          state.dump = '&ref_' + duplicateIndex + ' ' + state.dump\n        }\n      }\n    } else if (type === '[object String]') {\n      if (state.tag !== '?') {\n        writeScalar(state, state.dump, level, iskey, inblock)\n      }\n    } else if (type === '[object Undefined]') {\n      return false\n    } else {\n      if (state.skipInvalid) return false\n      throw new YAMLException('unacceptable kind of an object to dump ' + type)\n    }\n\n    if (state.tag !== null && state.tag !== '?') {\n      // Need to encode all characters except those allowed by the spec:\n      //\n      // [35] ns-dec-digit    ::=  [#x30-#x39] /* 0-9 */\n      // [36] ns-hex-digit    ::=  ns-dec-digit\n      //                         | [#x41-#x46] /* A-F */ | [#x61-#x66] /* a-f */\n      // [37] ns-ascii-letter ::=  [#x41-#x5A] /* A-Z */ | [#x61-#x7A] /* a-z */\n      // [38] ns-word-char    ::=  ns-dec-digit | ns-ascii-letter | â€œ-â€�\n      // [39] ns-uri-char     ::=  â€œ%â€� ns-hex-digit ns-hex-digit | ns-word-char | â€œ#â€�\n      //                         | â€œ;â€� | â€œ/â€� | â€œ?â€� | â€œ:â€� | â€œ@â€� | â€œ&â€� | â€œ=â€� | â€œ+â€� | â€œ$â€� | â€œ,â€�\n      //                         | â€œ_â€� | â€œ.â€� | â€œ!â€� | â€œ~â€� | â€œ*â€� | â€œ'â€� | â€œ(â€� | â€œ)â€� | â€œ[â€� | â€œ]â€�\n      //\n      // Also need to encode '!' because it has special meaning (end of tag prefix).\n      //\n      let tagStr = encodeURI(\n        state.tag[0] === '!' ? state.tag.slice(1) : state.tag\n      ).replace(/!/g, '%21')\n\n      if (state.tag[0] === '!') {\n        tagStr = '!' + tagStr\n      } else if (tagStr.slice(0, 18) === 'tag:yaml.org,2002:') {\n        tagStr = '!!' + tagStr.slice(18)\n      } else {\n        tagStr = '!<' + tagStr + '>'\n      }\n\n      state.dump = tagStr + ' ' + state.dump\n    }\n  }\n\n  return true\n}\n\nfunction getDuplicateReferences (object, state) {\n  const objects = []\n  const duplicatesIndexes = []\n\n  inspectNode(object, objects, duplicatesIndexes)\n\n  const length = duplicatesIndexes.length\n  for (let index = 0; index < length; index += 1) {\n    state.duplicates.push(objects[duplicatesIndexes[index]])\n  }\n  state.usedDuplicates = new Array(length)\n}\n\nfunction inspectNode (object, objects, duplicatesIndexes) {\n  if (object !== null && typeof object === 'object') {\n    const index = objects.indexOf(object)\n    if (index !== -1) {\n      if (duplicatesIndexes.indexOf(index) === -1) {\n        duplicatesIndexes.push(index)\n      }\n    } else {\n      objects.push(object)\n\n      if (Array.isArray(object)) {\n        for (let i = 0, length = object.length; i < length; i += 1) {\n          inspectNode(object[i], objects, duplicatesIndexes)\n        }\n      } else {\n        const objectKeyList = Object.keys(object)\n\n        for (let i = 0, length = objectKeyList.length; i < length; i += 1) {\n          inspectNode(object[objectKeyList[i]], objects, duplicatesIndexes)\n        }\n      }\n    }\n  }\n}\n\nfunction dump (input, options) {\n  options = options || {}\n\n  const state = new State(options)\n\n  if (!state.noRefs) getDuplicateReferences(input, state)\n\n  let value = input\n\n  if (state.replacer) {\n    value = state.replacer.call({ '': value }, '', value)\n  }\n\n  if (writeNode(state, 0, value, true, true)) return state.dump + '\\n'\n\n  return ''\n}\n\nmodule.exports.dump = dump\n","'use strict'\n\nconst loader = require('./lib/loader')\nconst dumper = require('./lib/dumper')\n\nfunction renamed (from, to) {\n  return function () {\n    throw new Error('Function yaml.' + from + ' is removed in js-yaml 4. ' +\n      'Use yaml.' + to + ' instead, which is now safe by default.')\n  }\n}\n\nmodule.exports.Type = require('./lib/type')\nmodule.exports.Schema = require('./lib/schema')\nmodule.exports.FAILSAFE_SCHEMA = require('./lib/schema/failsafe')\nmodule.exports.JSON_SCHEMA = require('./lib/schema/json')\nmodule.exports.CORE_SCHEMA = require('./lib/schema/core')\nmodule.exports.DEFAULT_SCHEMA = require('./lib/schema/default')\nmodule.exports.load = loader.load\nmodule.exports.loadAll = loader.loadAll\nmodule.exports.dump = dumper.dump\nmodule.exports.YAMLException = require('./lib/exception')\n\n// Re-export all types in case user wants to create custom schema\nmodule.exports.types = {\n  binary: require('./lib/type/binary'),\n  float: require('./lib/type/float'),\n  map: require('./lib/type/map'),\n  null: require('./lib/type/null'),\n  pairs: require('./lib/type/pairs'),\n  set: require('./lib/type/set'),\n  timestamp: require('./lib/type/timestamp'),\n  bool: require('./lib/type/bool'),\n  int: require('./lib/type/int'),\n  merge: require('./lib/type/merge'),\n  omap: require('./lib/type/omap'),\n  seq: require('./lib/type/seq'),\n  str: require('./lib/type/str')\n}\n\n// Removed functions from JS-YAML 3.0.x\nmodule.exports.safeLoad = renamed('safeLoad', 'load')\nmodule.exports.safeLoadAll = renamed('safeLoadAll', 'loadAll')\nmodule.exports.safeDump = renamed('safeDump', 'dump')\n","import yaml from '../index.js'\n\nconst {\n  Type,\n  Schema,\n  FAILSAFE_SCHEMA,\n  JSON_SCHEMA,\n  CORE_SCHEMA,\n  DEFAULT_SCHEMA,\n  load,\n  loadAll,\n  dump,\n  YAMLException,\n  types,\n  safeLoad,\n  safeLoadAll,\n  safeDump\n} = yaml\n\nexport {\n  Type,\n  Schema,\n  FAILSAFE_SCHEMA,\n  JSON_SCHEMA,\n  CORE_SCHEMA,\n  DEFAULT_SCHEMA,\n  load,\n  loadAll,\n  dump,\n  YAMLException,\n  types,\n  safeLoad,\n  safeLoadAll,\n  safeDump\n}\n\nexport default yaml\n"],"names":["_typeof","o","Symbol","iterator","constructor","prototype","isNothing","subject","common","isObject","toArray","sequence","Array","isArray","repeat","string","count","result","cycle","isNegativeZero","number","Number","NEGATIVE_INFINITY","extend","target","source","sourceKeys","Object","keys","index","length","key","formatError","exception","compact","where","message","reason","mark","name","line","column","snippet","YAMLException","Error","call","this","captureStackTrace","stack","create","toString","require$$0","TYPE_CONSTRUCTOR_OPTIONS","YAML_NODE_KINDS","type","tag","options","map","forEach","indexOf","kind","resolve","construct","data","instanceOf","predicate","represent","representName","defaultStyle","multi","styleAliases","style","alias","String","Type","require$$1","compileList","schema","currentType","newIndex","previousType","previousIndex","Schema","definition","implicit","explicit","push","concat","loadKind","compiledImplicit","compiledExplicit","compiledTypeMap","scalar","mapping","fallback","collectType","arguments","compileMap","str","seq","failsafe","require$$2","require$$3","_null","max","object","canonical","lowercase","uppercase","camelcase","empty","bool","isHexCode","c","isOctCode","isDecCode","parseYamlInteger","value","sign","ch","slice","parseInt","int","hasDigits","isFinite","charCodeAt","binary","obj","octal","decimal","hexadecimal","toUpperCase","YAML_FLOAT_PATTERN","RegExp","YAML_FLOAT_SPECIAL_PATTERN","SCIENTIFIC_WITHOUT_DOT","float","test","parseFloat","toLowerCase","POSITIVE_INFINITY","NaN","isNaN","res","replace","json","require$$4","core","YAML_DATE_REGEXP","YAML_TIMESTAMP_REGEXP","timestamp","exec","fraction","delta","match","year","month","day","Date","UTC","hour","minute","second","date","setTime","getTime","toISOString","merge","BASE64_MAP","bitlen","idx","code","charAt","input","bits","tailbits","Uint8Array","tail","_hasOwnProperty","hasOwnProperty","_toString","omap","objectKeys","pair","pairHasKey","pairKey","pairs","set","_default","require$$5","require$$6","makeSnippet","getLine","buffer","lineStart","lineEnd","position","maxLineLength","head","maxHalfLength","Math","floor","pos","padStart","maxLength","indent","linesBefore","linesAfter","re","lineStarts","lineEnds","foundLineNo","lineNoLength","min","i","DEFAULT_SCHEMA","PATTERN_NON_PRINTABLE","PATTERN_NON_ASCII_LINE_BREAKS","PATTERN_FLOW_INDICATORS","PATTERN_TAG_HANDLE","PATTERN_TAG_URI","_class","isEol","isWhiteSpace","isWsOrEol","isFlowIndicator","fromHexCode","lc","escapedHexLen","fromDecimalCode","simpleEscapeSequence","charFromCodepoint","fromCharCode","setProperty","defineProperty","configurable","enumerable","writable","simpleEscapeCheck","simpleEscapeMap","State","filename","onWarning","legacy","listener","maxDepth","maxTotalMergeKeys","implicitTypes","typeMap","lineIndent","depth","totalMergeKeys","firstTabInLine","documents","anchorMapTransactions","generateError","state","throwError","throwWarning","storeAnchor","transactions","transaction","existed","anchorMap","snapshotState","anchor","restoreState","snapshot","directiveHandlers","YAML","args","version","major","minor","checkLineBreaks","TAG","prefix","handle","tagMap","decodeURIComponent","err","captureSegment","start","end","checkJson","_result","_position","_length","_character","mergeMappings","destination","overridableKeys","quantity","storeMappingPair","keyTag","keyNode","valueNode","startLine","startLineStart","startPos","readLineBreak","skipSeparationSpace","allowComments","checkIndent","lineBreaks","testDocumentSeparator","writeFoldedLines","readBlockSequence","nodeIndent","_tag","_anchor","detected","_line","composeNode","readBlockMapping","flowIndent","allowCompact","_keyLine","_keyLineStart","_keyPos","atExplicitKey","following","readTagProperty","tagHandle","tagName","isVerbatim","isNamed","readAnchorProperty","tryReadBlockMappingFromProperty","propertyStart","fallbackState","beginAnchorTransaction","pop","parent","names","commitAnchorTransaction","entry","rollbackAnchorTransaction","parentIndent","nodeContext","allowToSeek","allowBlockScalars","allowBlockCollections","blockIndent","indentStatus","atNewLine","hasContent","allowBlockStyles","propertyState","_lineStart","_pos","terminator","isPair","isExplicitPair","isMapping","readNext","readFlowCollection","folding","tmp","chomping","didReadContent","detectedIndent","textIndent","emptyLines","atMoreIndented","captureStart","readBlockScalar","captureEnd","readSingleQuotedScalar","hexLength","hexResult","readDoubleQuotedScalar","readAlias","withinFlowCollection","hasPendingContent","_lineIndent","_kind","readPlainScalar","typeIndex","typeQuantity","typeList","readDocument","documentStart","hasDirectives","directiveName","directiveArgs","loadDocuments","nullpos","loader","loadAll","load","CHAR_BOM","ESCAPE_SEQUENCES","DEPRECATED_BOOLEANS_SYNTAX","DEPRECATED_BASE60_SYNTAX","encodeHex","character","noArrayIndent","skipInvalid","flowLevel","styleMap","compileStyleMap","sortKeys","lineWidth","noRefs","noCompatMode","condenseFlow","quotingType","forceQuotes","replacer","explicitTypes","duplicates","usedDuplicates","indentString","spaces","ind","next","generateNextLine","level","isWhitespace","isPrintable","isNsCharOrWhitespace","isPlainSafe","prev","inblock","cIsNsCharOrWhitespace","cIsNsChar","codePointAt","first","needIndentIndicator","chooseScalarStyle","singleLineOnly","indentPerLevel","testAmbiguousType","char","prevChar","hasLineBreak","hasFoldableLine","shouldTrackWidth","previousLineBreak","plain","isPlainSafeLast","writeScalar","iskey","dump","testImplicitResolving","blockHeader","dropEndingNewline","width","moreIndented","lineRe","nextLF","lastIndex","foldLine","prevMoreIndented","foldString","escapeSeq","escapeString","indentIndicator","clip","breakRe","curr","writeBlockSequence","writeNode","detectType","block","isblockseq","duplicateIndex","duplicate","objectOrArray","objectKeyList","sort","pairBuffer","objectKey","objectValue","explicitPair","writeBlockMapping","writeFlowMapping","writeFlowSequence","tagStr","encodeURI","getDuplicateReferences","objects","duplicatesIndexes","inspectNode","dumper","renamed","from","to","jsYaml","FAILSAFE_SCHEMA","JSON_SCHEMA","CORE_SCHEMA","require$$7","require$$8","types","require$$9","require$$10","require$$11","null","require$$12","require$$13","require$$14","require$$15","require$$16","require$$17","require$$18","require$$19","require$$20","require$$21","safeLoad","safeLoadAll","safeDump","yaml"],"mappings":"udAAY,SAAAA,EAAAC,GAAA,OAAAD,EAAA,mBAAAE,QAAA,iBAAAA,OAAAC,SAAA,SAAAF,GAAA,cAAAA,GAAA,SAAAA,GAAA,OAAAA,GAAA,mBAAAC,QAAAD,EAAAG,cAAAF,QAAAD,IAAAC,OAAAG,UAAA,gBAAAJ,CAAA,GAAAA,EAAA,CAEZ,SAASK,EAAWC,GAClB,OAAQ,MAAOA,CACjB,YAwCAC,EAAAF,UAA2BA,EAC3BE,EAAAC,SAvCA,SAAmBF,GACjB,MAA2B,WAAnBP,EAAOO,IAAsC,OAAZA,CAC3C,EAsCAC,EAAAE,QApCA,SAAkBC,GAChB,OAAIC,MAAMC,QAAQF,GAAkBA,EAC3BL,EAAUK,GAAkB,GAE9B,CAACA,EACV,EAgCAH,EAAAM,OAjBA,SAAiBC,EAAQC,GAGvB,IAFA,IAAIC,EAAS,GAEJC,EAAQ,EAAGA,EAAQF,EAAOE,GAAS,EAC1CD,GAAUF,EAGZ,OAAOE,CACT,EAUAT,EAAAW,eARA,SAAyBC,GACvB,OAAmB,IAAXA,GAAkBC,OAAOC,oBAAsB,EAAIF,CAC7D,EAOAZ,EAAAe,OAhCA,SAAiBC,EAAQC,GACvB,GAAIA,EAGF,IAFA,IAAMC,EAAaC,OAAOC,KAAKH,GAEtBI,EAAQ,EAAGC,EAASJ,EAAWI,OAAQD,EAAQC,EAAQD,GAAS,EAAG,CAC1E,IAAME,EAAML,EAAWG,GACvBL,EAAOO,GAAON,EAAOM,EACvB,CAGF,OAAOP,CACT,+BCxBA,SAASQ,EAAaC,EAAWC,GAC/B,IAAIC,EAAQ,GACNC,EAAUH,EAAUI,QAAU,mBAEpC,OAAKJ,EAAUK,MAEXL,EAAUK,KAAKC,OACjBJ,GAAS,OAASF,EAAUK,KAAKC,KAAO,MAG1CJ,GAAS,KAAOF,EAAUK,KAAKE,KAAO,GAAK,KAAOP,EAAUK,KAAKG,OAAS,GAAK,KAE1EP,GAAWD,EAAUK,KAAKI,UAC7BP,GAAS,OAASF,EAAUK,KAAKI,SAG5BN,EAAU,IAAMD,GAZKC,CAa9B,CAEA,SAASO,EAAeN,EAAQC,GAE9BM,MAAMC,KAAKC,MAEXA,KAAKP,KAAO,gBACZO,KAAKT,OAASA,EACdS,KAAKR,KAAOA,EACZQ,KAAKV,QAAUJ,EAAYc,MAAM,GAG7BF,MAAMG,kBAERH,MAAMG,kBAAkBD,KAAMA,KAAK1C,aAGnC0C,KAAKE,OAAS,IAAIJ,OAASI,OAAS,EAExC,YAGAL,EAActC,UAAYsB,OAAOsB,OAAOL,MAAMvC,WAC9CsC,EAActC,UAAUD,YAAcuC,EAEtCA,EAActC,UAAU6C,SAAW,SAAmBhB,GACpD,OAAOY,KAAKP,KAAO,KAAOP,EAAYc,KAAMZ,EAC9C,EAEAD,EAAiBU,iCChDjB,IAAMA,EAAgBQ,IAEhBC,EAA2B,CAC/B,OACA,QACA,UACA,YACA,aACA,YACA,YACA,gBACA,eACA,gBAGIC,EAAkB,CACtB,SACA,WACA,kBA6CFC,EA5BA,SAAeC,EAAKC,GAdpB,IAA8BC,EACtBxC,EAoCN,GAtBAuC,EAAUA,GAAW,CAAA,EAErB7B,OAAOC,KAAK4B,GAASE,QAAQ,SAAUnB,GACrC,IAA+C,IAA3Ca,EAAyBO,QAAQpB,GACnC,MAAM,IAAII,EAAc,mBAAqBJ,EAAO,8BAAgCgB,EAAM,eAE9F,GAGAT,KAAKU,QAAUA,EACfV,KAAKS,IAAMA,EACXT,KAAKc,KAAOJ,EAAc,MAAK,KAC/BV,KAAKe,QAAUL,EAAiB,SAAK,WAAc,OAAO,GAC1DV,KAAKgB,UAAYN,EAAmB,WAAK,SAAUO,GAAQ,OAAOA,GAClEjB,KAAKkB,WAAaR,EAAoB,YAAK,KAC3CV,KAAKmB,UAAYT,EAAmB,WAAK,KACzCV,KAAKoB,UAAYV,EAAmB,WAAK,KACzCV,KAAKqB,cAAgBX,EAAuB,eAAK,KACjDV,KAAKsB,aAAeZ,EAAsB,cAAK,KAC/CV,KAAKuB,MAAQb,EAAe,QAAK,EACjCV,KAAKwB,cAnCuBb,EAmCYD,EAAsB,cAAK,KAlC7DvC,EAAS,CAAA,EAEH,OAARwC,GACF9B,OAAOC,KAAK6B,GAAKC,QAAQ,SAAUa,GACjCd,EAAIc,GAAOb,QAAQ,SAAUc,GAC3BvD,EAAOwD,OAAOD,IAAUD,CAC1B,EACF,GAGKtD,IA0BoC,IAAvCoC,EAAgBM,QAAQb,KAAKc,MAC/B,MAAM,IAAIjB,EAAc,iBAAmBG,KAAKc,KAAO,uBAAyBL,EAAM,eAE1F,iCC7DA,IAAMZ,EAAgBQ,IAChBuB,EAAOC,IAEb,SAASC,EAAaC,EAAQtC,GAC5B,IAAMtB,EAAS,GAgBf,OAdA4D,EAAOtC,GAAMmB,QAAQ,SAAUoB,GAC7B,IAAIC,EAAW9D,EAAOa,OAEtBb,EAAOyC,QAAQ,SAAUsB,EAAcC,GACjCD,EAAazB,MAAQuB,EAAYvB,KACjCyB,EAAapB,OAASkB,EAAYlB,MAClCoB,EAAaX,QAAUS,EAAYT,QACrCU,EAAWE,EAEf,GAEAhE,EAAO8D,GAAYD,CACrB,GAEO7D,CACT,CA8BA,SAASiE,EAAQC,GACf,OAAOrC,KAAKvB,OAAO4D,EACrB,QAEAD,EAAO7E,UAAUkB,OAAS,SAAiB4D,GACzC,IAAIC,EAAW,GACXC,EAAW,GAEf,GAAIF,aAAsBT,EAExBW,EAASC,KAAKH,WACLvE,MAAMC,QAAQsE,GAEvBE,EAAWA,EAASE,OAAOJ,YAClBA,IAAevE,MAAMC,QAAQsE,EAAWC,YAAaxE,MAAMC,QAAQsE,EAAWE,UAKvF,MAAM,IAAI1C,EAAc,oHAHpBwC,EAAWC,WAAUA,EAAWA,EAASG,OAAOJ,EAAWC,WAC3DD,EAAWE,WAAUA,EAAWA,EAASE,OAAOJ,EAAWE,UAIjE,CAEAD,EAAS1B,QAAQ,SAAUJ,GACzB,KAAMA,aAAgBoB,GACpB,MAAM,IAAI/B,EAAc,sFAG1B,GAAIW,EAAKkC,UAA8B,WAAlBlC,EAAKkC,SACxB,MAAM,IAAI7C,EAAc,mHAG1B,GAAIW,EAAKe,MACP,MAAM,IAAI1B,EAAc,qGAE5B,GAEA0C,EAAS3B,QAAQ,SAAUJ,GACzB,KAAMA,aAAgBoB,GACpB,MAAM,IAAI/B,EAAc,qFAE5B,GAEA,IAAM1B,EAASU,OAAOsB,OAAOiC,EAAO7E,WASpC,OAPAY,EAAOmE,UAAYtC,KAAKsC,UAAY,IAAIG,OAAOH,GAC/CnE,EAAOoE,UAAYvC,KAAKuC,UAAY,IAAIE,OAAOF,GAE/CpE,EAAOwE,iBAAmBb,EAAY3D,EAAQ,YAC9CA,EAAOyE,iBAAmBd,EAAY3D,EAAQ,YAC9CA,EAAO0E,gBA9ET,WACE,IAAM1E,EAAS,CACb2E,OAAQ,CAAA,EACRjF,SAAU,CAAA,EACVkF,QAAS,CAAA,EACTC,SAAU,CAAA,EACVzB,MAAO,CACLuB,OAAQ,GACRjF,SAAU,GACVkF,QAAS,GACTC,SAAU,KAGd,SAASC,EAAazC,GAChBA,EAAKe,OACPpD,EAAOoD,MAAMf,EAAKM,MAAM0B,KAAKhC,GAC7BrC,EAAOoD,MAAgB,SAAEiB,KAAKhC,IAE9BrC,EAAOqC,EAAKM,MAAMN,EAAKC,KAAOtC,EAAiB,SAAEqC,EAAKC,KAAOD,CAEjE,CAEA,IAAA,IAASzB,EAAQ,EAAGC,EAASkE,UAAUlE,OAAQD,EAAQC,EAAQD,GAAS,EACtEmE,UAAUnE,GAAO6B,QAAQqC,GAE3B,OAAO9E,CACT,CAoD2BgF,CAAWhF,EAAOwE,iBAAkBxE,EAAOyE,kBAE7DzE,CACT,EAEA4D,EAAiBK,iCC1GjB,IAAMR,EAAOvB,WAEb+C,EAAiB,IAAIxB,EAAK,wBAAyB,CACjDd,KAAM,SACNE,UAAW,SAAUC,GAAQ,OAAgB,OAATA,EAAgBA,EAAO,EAAG,oCCJhE,IAAMW,EAAOvB,WAEbgD,EAAiB,IAAIzB,EAAK,wBAAyB,CACjDd,KAAM,WACNE,UAAW,SAAUC,GAAQ,OAAgB,OAATA,EAAgBA,EAAO,EAAG,oCCJhE,IAAMW,EAAOvB,WAEbM,EAAiB,IAAIiB,EAAK,wBAAyB,CACjDd,KAAM,UACNE,UAAW,SAAUC,GAAQ,OAAgB,OAATA,EAAgBA,EAAO,CAAA,CAAG,oCCDhE,IAAMmB,EAAS/B,WAEfiD,EAAiB,IAAIlB,EAAO,CAC1BG,SAAU,CACRV,IACA0B,KACAC,wCCTJ,IAAM5B,EAAOvB,WAmBboD,EAAiB,IAAI7B,EAAK,yBAA0B,CAClDd,KAAM,SACNC,QAnBF,SAA0BE,GACxB,GAAa,OAATA,EAAe,OAAO,EAE1B,IAAMyC,EAAMzC,EAAKjC,OAEjB,OAAgB,IAAR0E,GAAsB,MAATzC,GACL,IAARyC,IAAuB,SAATzC,GAA4B,SAATA,GAA4B,SAATA,EAC9D,EAaED,UAXF,WACE,OAAO,IACT,EAUEG,UARF,SAAiBwC,GACf,OAAkB,OAAXA,CACT,EAOEvC,UAAW,CACTwC,UAAW,WAAc,MAAO,KAChCC,UAAW,WAAc,MAAO,QAChCC,UAAW,WAAc,MAAO,QAChCC,UAAW,WAAc,MAAO,QAChCC,MAAO,WAAc,MAAO,EAAG,GAEjC1C,aAAc,8CC/BhB,IAAMM,EAAOvB,WAqBb4D,EAAiB,IAAIrC,EAAK,yBAA0B,CAClDd,KAAM,SACNC,QArBF,SAA6BE,GAC3B,GAAa,OAATA,EAAe,OAAO,EAE1B,IAAMyC,EAAMzC,EAAKjC,OAEjB,OAAgB,IAAR0E,IAAuB,SAATzC,GAA4B,SAATA,GAA4B,SAATA,IAC5C,IAARyC,IAAuB,UAATzC,GAA6B,UAATA,GAA6B,UAATA,EAChE,EAeED,UAbF,SAA+BC,GAC7B,MAAgB,SAATA,GACS,SAATA,GACS,SAATA,CACT,EAUEE,UARF,SAAoBwC,GAClB,MAAkD,qBAA3C9E,OAAOtB,UAAU6C,SAASL,KAAK4D,EACxC,EAOEvC,UAAW,CACTyC,UAAW,SAAUF,GAAU,OAAOA,EAAS,OAAS,SACxDG,UAAW,SAAUH,GAAU,OAAOA,EAAS,OAAS,SACxDI,UAAW,SAAUJ,GAAU,OAAOA,EAAS,OAAS,OAAQ,GAElErC,aAAc,8CC/BhB,IAAM5D,EAAS2C,IACTuB,EAAOC,IAEb,SAASqC,EAAWC,GAClB,OAASA,GAAK,IAAiBA,GAAK,IAC3BA,GAAK,IAAiBA,GAAK,IAC3BA,GAAK,IAAiBA,GAAK,GACtC,CAEA,SAASC,EAAWD,GAClB,OAASA,GAAK,IAAiBA,GAAK,EACtC,CAEA,SAASE,EAAWF,GAClB,OAASA,GAAK,IAAiBA,GAAK,EACtC,CA0EA,SAASG,EAAkBrD,GACzB,IAAIsD,EAAQtD,EACRuD,EAAO,EAEPC,EAAKF,EAAM,GAQf,GANW,MAAPE,GAAqB,MAAPA,IACL,MAAPA,IAAYD,GAAO,GAEvBC,GADAF,EAAQA,EAAMG,MAAM,IACT,IAGC,MAAVH,EAAe,OAAO,EAE1B,GAAW,MAAPE,EAAY,CACd,GAAiB,MAAbF,EAAM,GAAY,OAAOC,EAAOG,SAASJ,EAAMG,MAAM,GAAI,GAC7D,GAAiB,MAAbH,EAAM,GAAY,OAAOC,EAAOG,SAASJ,EAAMG,MAAM,GAAI,IAC7D,GAAiB,MAAbH,EAAM,GAAY,OAAOC,EAAOG,SAASJ,EAAMG,MAAM,GAAI,EAC/D,CAEA,OAAOF,EAAOG,SAASJ,EAAO,GAChC,QAWAK,EAAiB,IAAIhD,EAAK,wBAAyB,CACjDd,KAAM,SACNC,QA1GF,SAA6BE,GAC3B,GAAa,OAATA,EAAe,OAAO,EAE1B,IAAMyC,EAAMzC,EAAKjC,OACbD,EAAQ,EACR8F,GAAY,EAEhB,IAAKnB,EAAK,OAAO,EAEjB,IAAIe,EAAKxD,EAAKlC,GAOd,GAJW,MAAP0F,GAAqB,MAAPA,IAChBA,EAAKxD,IAAOlC,IAGH,MAAP0F,EAAY,CAEd,GAAI1F,EAAQ,IAAM2E,EAAK,OAAO,EAK9B,GAAW,OAJXe,EAAKxD,IAAOlC,IAII,CAId,IAFAA,IAEOA,EAAQ2E,EAAK3E,IAAS,CAE3B,GAAW,OADX0F,EAAKxD,EAAKlC,KACe,MAAP0F,EAAY,OAAO,EACrCI,GAAY,CACd,CACA,OAAOA,GAAaC,SAASR,EAAiBrD,GAChD,CAEA,GAAW,MAAPwD,EAAY,CAId,IAFA1F,IAEOA,EAAQ2E,EAAK3E,IAAS,CAC3B,IAAKmF,EAAUjD,EAAK8D,WAAWhG,IAAS,OAAO,EAC/C8F,GAAY,CACd,CACA,OAAOA,GAAaC,SAASR,EAAiBrD,GAChD,CAEA,GAAW,MAAPwD,EAAY,CAId,IAFA1F,IAEOA,EAAQ2E,EAAK3E,IAAS,CAC3B,IAAKqF,EAAUnD,EAAK8D,WAAWhG,IAAS,OAAO,EAC/C8F,GAAY,CACd,CACA,OAAOA,GAAaC,SAASR,EAAiBrD,GAChD,CACF,CAIA,KAAOlC,EAAQ2E,EAAK3E,IAAS,CAC3B,IAAKsF,EAAUpD,EAAK8D,WAAWhG,IAC7B,OAAO,EAET8F,GAAY,CACd,CAEA,QAAKA,GAEEC,SAASR,EAAiBrD,GACnC,EAqCED,UAZF,SAA+BC,GAC7B,OAAOqD,EAAiBrD,EAC1B,EAWEE,UATF,SAAoBwC,GAClB,MAAoD,oBAA5C9E,OAAOtB,UAAU6C,SAASL,KAAK4D,IAC/BA,EAAS,GAAM,IAAMjG,EAAOW,eAAesF,EACrD,EAOEvC,UAAW,CACT4D,OAAQ,SAAUC,GAAO,OAAOA,GAAO,EAAI,KAAOA,EAAI7E,SAAS,GAAK,MAAQ6E,EAAI7E,SAAS,GAAGsE,MAAM,IAClGQ,MAAO,SAAUD,GAAO,OAAOA,GAAO,EAAI,KAAOA,EAAI7E,SAAS,GAAK,MAAQ6E,EAAI7E,SAAS,GAAGsE,MAAM,IACjGS,QAAS,SAAUF,GAAO,OAAOA,EAAI7E,SAAS,KAC9CgF,YAAa,SAAUH,GAAO,OAAOA,GAAO,EAAI,KAAOA,EAAI7E,SAAS,IAAIiF,cAAgB,MAAQJ,EAAI7E,SAAS,IAAIiF,cAAcX,MAAM,EAAG,GAE1IpD,aAAc,UACdE,aAAc,CACZwD,OAAQ,CAAC,EAAG,OACZE,MAAO,CAAC,EAAG,OACXC,QAAS,CAAC,GAAI,OACdC,YAAa,CAAC,GAAI,0CCzItB,IAAM1H,EAAS2C,IACTuB,EAAOC,IAEPyD,EAAqB,IAAIC,OAE7B,oIASIC,EAA6B,IAAID,OACrC,oDAoCF,IAAME,EAAyB,uBAsC/BC,EAAiB,IAAI9D,EAAK,0BAA2B,CACnDd,KAAM,SACNC,QAtEF,SAA2BE,GACzB,OAAa,OAATA,MAECqE,EAAmBK,KAAK1E,OAIzB6D,SAASc,WAAW3E,EAAM,MAIvBuE,EAA2BG,KAAK1E,IACzC,EA2DED,UAzDF,SAA6BC,GAC3B,IAAIsD,EAAQtD,EAAK4E,cACXrB,EAAoB,MAAbD,EAAM,IAAa,EAAK,EAMrC,MAJI,KAAK1D,QAAQ0D,EAAM,KAAO,IAC5BA,EAAQA,EAAMG,MAAM,IAGR,SAAVH,EACe,IAATC,EAAcjG,OAAOuH,kBAAoBvH,OAAOC,kBACrC,SAAV+F,EACFwB,IAEFvB,EAAOoB,WAAWrB,EAAO,GAClC,EA4CEpD,UATF,SAAkBwC,GAChB,MAAmD,oBAA3C9E,OAAOtB,UAAU6C,SAASL,KAAK4D,KAC/BA,EAAS,GAAM,GAAKjG,EAAOW,eAAesF,GACpD,EAOEvC,UAzCF,SAA6BuC,EAAQlC,GACnC,GAAIuE,MAAMrC,GACR,OAAQlC,GACN,IAAK,YAAa,MAAO,OACzB,IAAK,YAAa,MAAO,OACzB,IAAK,YAAa,MAAO,YAE7B,GAAWlD,OAAOuH,oBAAsBnC,EACtC,OAAQlC,GACN,IAAK,YAAa,MAAO,OACzB,IAAK,YAAa,MAAO,OACzB,IAAK,YAAa,MAAO,YAE7B,GAAWlD,OAAOC,oBAAsBmF,EACtC,OAAQlC,GACN,IAAK,YAAa,MAAO,QACzB,IAAK,YAAa,MAAO,QACzB,IAAK,YAAa,MAAO,gBAElB/D,EAAOW,eAAesF,GAC/B,MAAO,OAGT,IAAMsC,EAAMtC,EAAOvD,SAAS,IAK5B,OAAOqF,EAAuBE,KAAKM,GAAOA,EAAIC,QAAQ,IAAK,MAAQD,CACrE,EAaE3E,aAAc,4CCxFhB6E,EAAiB9F,KAAsB5B,OAAO,CAC5C6D,SAAU,CACRT,KACA0B,KACAC,KACA4C,uCCNJC,EAAiBhG,sCCNjB,IAAMuB,EAAOvB,IAEPiG,EAAmB,IAAIf,OAC3B,sDAIIgB,EAAwB,IAAIhB,OAChC,2LAuEFiB,EAAiB,IAAI5E,EAAK,8BAA+B,CACvDd,KAAM,SACNC,QA9DF,SAA+BE,GAC7B,OAAa,OAATA,IACgC,OAAhCqF,EAAiBG,KAAKxF,IACe,OAArCsF,EAAsBE,KAAKxF,GAEjC,EA0DED,UAxDF,SAAiCC,GAC/B,IAAIyF,EAAW,EACXC,EAAQ,KAERC,EAAQN,EAAiBG,KAAKxF,GAGlC,GAFc,OAAV2F,IAAgBA,EAAQL,EAAsBE,KAAKxF,IAEzC,OAAV2F,EAAgB,MAAM,IAAI9G,MAAM,sBAIpC,IAAM+G,GAASD,EAAM,GACfE,GAAUF,EAAM,GAAM,EACtBG,GAAQH,EAAM,GAEpB,IAAKA,EAAM,GACT,OAAO,IAAII,KAAKA,KAAKC,IAAIJ,EAAMC,EAAOC,IAKxC,IAAMG,GAASN,EAAM,GACfO,GAAWP,EAAM,GACjBQ,GAAWR,EAAM,GAEvB,GAAIA,EAAM,GAAI,CAEZ,IADAF,EAAWE,EAAM,GAAGlC,MAAM,EAAG,GACtBgC,EAAS1H,OAAS,GACvB0H,GAAY,IAEdA,GAAYA,CACd,CAIIE,EAAM,KAGRD,EAAmC,KAAjB,IAFDC,EAAM,OACJA,EAAM,KAAO,IAEf,MAAbA,EAAM,QAAqBD,IAGjC,IAAMU,EAAO,IAAIL,KAAKA,KAAKC,IAAIJ,EAAMC,EAAOC,EAAKG,EAAMC,EAAQC,EAAQV,IAIvE,OAFIC,GAAOU,EAAKC,QAAQD,EAAKE,UAAYZ,GAElCU,CACT,EAUEnG,WAAY8F,KACZ5F,UATF,SAAiCuC,GAC/B,OAAOA,EAAO6D,aAChB,oCC7EA,IAAM5F,EAAOvB,WAMboH,EAAiB,IAAI7F,EAAK,0BAA2B,CACnDd,KAAM,SACNC,QANF,SAA2BE,GACzB,MAAgB,OAATA,GAA0B,OAATA,CAC1B,oCCJA,IAAMW,EAAOvB,IAGPqH,EAAa,+EA8GnB1C,EAAiB,IAAIpD,EAAK,2BAA4B,CACpDd,KAAM,SACNC,QA9GF,SAA4BE,GAC1B,GAAa,OAATA,EAAe,OAAO,EAO1B,IALA,IAAI0G,EAAS,EACPjE,EAAMzC,EAAKjC,OACX2B,EAAM+G,EAGHE,EAAM,EAAGA,EAAMlE,EAAKkE,IAAO,CAClC,IAAMC,EAAOlH,EAAIE,QAAQI,EAAK6G,OAAOF,IAGrC,KAAIC,EAAO,IAAX,CAGA,GAAIA,EAAO,EAAG,OAAO,EAErBF,GAAU,CALK,CAMjB,CAGA,OAAQA,EAAS,GAAO,CAC1B,EAyFE3G,UAvFF,SAA8BC,GAS5B,IARA,IAAM8G,EAAQ9G,EAAKiF,QAAQ,WAAY,IACjCxC,EAAMqE,EAAM/I,OACZ2B,EAAM+G,EACRM,EAAO,EACL7J,EAAS,GAINyJ,EAAM,EAAGA,EAAMlE,EAAKkE,IACtBA,EAAM,GAAM,GAAMA,IACrBzJ,EAAOqE,KAAMwF,GAAQ,GAAM,KAC3B7J,EAAOqE,KAAMwF,GAAQ,EAAK,KAC1B7J,EAAOqE,KAAY,IAAPwF,IAGdA,EAAQA,GAAQ,EAAKrH,EAAIE,QAAQkH,EAAMD,OAAOF,IAKhD,IAAMK,EAAYvE,EAAM,EAAK,EAa7B,OAXiB,IAAbuE,GACF9J,EAAOqE,KAAMwF,GAAQ,GAAM,KAC3B7J,EAAOqE,KAAMwF,GAAQ,EAAK,KAC1B7J,EAAOqE,KAAY,IAAPwF,IACU,KAAbC,GACT9J,EAAOqE,KAAMwF,GAAQ,GAAM,KAC3B7J,EAAOqE,KAAMwF,GAAQ,EAAK,MACJ,KAAbC,GACT9J,EAAOqE,KAAMwF,GAAQ,EAAK,KAGrB,IAAIE,WAAW/J,EACxB,EAqDEgD,UARF,SAAmB8D,GACjB,MAA+C,wBAAxCpG,OAAOtB,UAAU6C,SAASL,KAAKkF,EACxC,EAOE7D,UApDF,SAA8BuC,GAQ5B,IAPA,IAAIxF,EAAS,GACT6J,EAAO,EACLtE,EAAMC,EAAO3E,OACb2B,EAAM+G,EAIHE,EAAM,EAAGA,EAAMlE,EAAKkE,IACtBA,EAAM,GAAM,GAAMA,IACrBzJ,GAAUwC,EAAKqH,GAAQ,GAAM,IAC7B7J,GAAUwC,EAAKqH,GAAQ,GAAM,IAC7B7J,GAAUwC,EAAKqH,GAAQ,EAAK,IAC5B7J,GAAUwC,EAAW,GAAPqH,IAGhBA,GAAQA,GAAQ,GAAKrE,EAAOiE,GAK9B,IAAMO,EAAOzE,EAAM,EAmBnB,OAjBa,IAATyE,GACFhK,GAAUwC,EAAKqH,GAAQ,GAAM,IAC7B7J,GAAUwC,EAAKqH,GAAQ,GAAM,IAC7B7J,GAAUwC,EAAKqH,GAAQ,EAAK,IAC5B7J,GAAUwC,EAAW,GAAPqH,IACI,IAATG,GACThK,GAAUwC,EAAKqH,GAAQ,GAAM,IAC7B7J,GAAUwC,EAAKqH,GAAQ,EAAK,IAC5B7J,GAAUwC,EAAKqH,GAAQ,EAAK,IAC5B7J,GAAUwC,EAAI,KACI,IAATwH,IACThK,GAAUwC,EAAKqH,GAAQ,EAAK,IAC5B7J,GAAUwC,EAAKqH,GAAQ,EAAK,IAC5B7J,GAAUwC,EAAI,IACdxC,GAAUwC,EAAI,KAGTxC,CACT,oCC3GA,IAAMyD,EAAOvB,IAEP+H,EAAkBvJ,OAAOtB,UAAU8K,eACnCC,EAAYzJ,OAAOtB,UAAU6C,gBAmCnCmI,EAAiB,IAAI3G,EAAK,yBAA0B,CAClDd,KAAM,WACNC,QAnCF,SAA0BE,GACxB,GAAa,OAATA,EAAe,OAAO,EAK1B,IAHA,IAAMuH,EAAa,GACb7E,EAAS1C,EAENlC,EAAQ,EAAGC,EAAS2E,EAAO3E,OAAQD,EAAQC,EAAQD,GAAS,EAAG,CACtE,IAAM0J,EAAO9E,EAAO5E,GAChB2J,GAAa,EAEjB,GAA6B,oBAAzBJ,EAAUvI,KAAK0I,GAA6B,OAAO,EAEvD,IAAIE,OAAO,EACX,IAAKA,KAAWF,EACd,GAAIL,EAAgBrI,KAAK0I,EAAME,GAAU,CACvC,GAAKD,EACA,OAAO,EADKA,GAAa,CAEhC,CAGF,IAAKA,EAAY,OAAO,EAExB,IAAoC,IAAhCF,EAAW3H,QAAQ8H,GAClB,OAAO,EAD4BH,EAAWhG,KAAKmG,EAE1D,CAEA,OAAO,CACT,EASE3H,UAPF,SAA4BC,GAC1B,OAAgB,OAATA,EAAgBA,EAAO,EAChC,oCCpCA,IAAMW,EAAOvB,IAEPiI,EAAYzJ,OAAOtB,UAAU6C,gBAyCnCwI,EAAiB,IAAIhH,EAAK,0BAA2B,CACnDd,KAAM,WACNC,QAzCF,SAA2BE,GACzB,GAAa,OAATA,EAAe,OAAO,EAM1B,IAJA,IAAM0C,EAAS1C,EAET9C,EAAS,IAAIL,MAAM6F,EAAO3E,QAEvBD,EAAQ,EAAGC,EAAS2E,EAAO3E,OAAQD,EAAQC,EAAQD,GAAS,EAAG,CACtE,IAAM0J,EAAO9E,EAAO5E,GAEpB,GAA6B,oBAAzBuJ,EAAUvI,KAAK0I,GAA6B,OAAO,EAEvD,IAAM3J,EAAOD,OAAOC,KAAK2J,GAEzB,GAAoB,IAAhB3J,EAAKE,OAAc,OAAO,EAE9Bb,EAAOY,GAAS,CAACD,EAAK,GAAI2J,EAAK3J,EAAK,IACtC,CAEA,OAAO,CACT,EAsBEkC,UApBF,SAA6BC,GAC3B,GAAa,OAATA,EAAe,MAAO,GAK1B,IAHA,IAAM0C,EAAS1C,EACT9C,EAAS,IAAIL,MAAM6F,EAAO3E,QAEvBD,EAAQ,EAAGC,EAAS2E,EAAO3E,OAAQD,EAAQC,EAAQD,GAAS,EAAG,CACtE,IAAM0J,EAAO9E,EAAO5E,GAEdD,EAAOD,OAAOC,KAAK2J,GAEzBtK,EAAOY,GAAS,CAACD,EAAK,GAAI2J,EAAK3J,EAAK,IACtC,CAEA,OAAOX,CACT,oCCzCA,IAAMyD,EAAOvB,IAEP+H,EAAkBvJ,OAAOtB,UAAU8K,sBAoBzCQ,EAAiB,IAAIjH,EAAK,wBAAyB,CACjDd,KAAM,UACNC,QApBF,SAAyBE,GACvB,GAAa,OAATA,EAAe,OAAO,EAE1B,IAAM0C,EAAS1C,EAEf,IAAA,IAAWhC,KAAO0E,EAChB,GAAIyE,EAAgBrI,KAAK4D,EAAQ1E,IACX,OAAhB0E,EAAO1E,GAAe,OAAO,EAIrC,OAAO,CACT,EASE+B,UAPF,SAA2BC,GACzB,OAAgB,OAATA,EAAgBA,EAAO,CAAA,CAChC,kCCdA6H,EAAiBzI,KAAkB5B,OAAO,CACxC6D,SAAU,CACRT,KACA0B,MAEFhB,SAAU,CACRiB,KACA4C,KACA2C,KACAC,qCCjBQ,SAAA9L,EAAAC,GAAA,OAAAD,EAAA,mBAAAE,QAAA,iBAAAA,OAAAC,SAAA,SAAAF,GAAA,cAAAA,GAAA,SAAAA,GAAA,OAAAA,GAAA,mBAAAC,QAAAD,EAAAG,cAAAF,QAAAD,IAAAC,OAAAG,UAAA,gBAAAJ,CAAA,GAAAA,EAAA,KAEZ,IAAMO,EAAS2C,IACTR,EAAgBgC,IAChBoH,+BCFN,IAAMvL,EAAS2C,IAGf,SAAS6I,EAASC,EAAQC,EAAWC,EAASC,EAAUC,GACtD,IAAIC,EAAO,GACPrB,EAAO,GACLsB,EAAgBC,KAAKC,MAAMJ,EAAgB,GAAK,EAYtD,OAVID,EAAWF,EAAYK,IAEzBL,EAAYE,EAAWG,GADvBD,EAAO,SACqCxK,QAG1CqK,EAAUC,EAAWG,IAEvBJ,EAAUC,EAAWG,GADrBtB,EAAO,QACmCnJ,QAGrC,CACLoE,IAAKoG,EAAOL,EAAOzE,MAAM0E,EAAWC,GAASnD,QAAQ,MAAO,KAAOiC,EACnEyB,IAAKN,EAAWF,EAAYI,EAAKxK,OAErC,CAEA,SAAS6K,EAAU5L,EAAQyF,GACzB,OAAOhG,EAAOM,OAAO,IAAK0F,EAAMzF,EAAOe,QAAUf,CACnD,QAmEA2B,EAjEA,SAAsBJ,EAAMkB,GAG1B,GAFAA,EAAU7B,OAAOsB,OAAOO,GAAW,OAE9BlB,EAAK2J,OAAQ,OAAO,KAEpBzI,EAAQoJ,YAAWpJ,EAAQoJ,UAAY,IACd,iBAAnBpJ,EAAQqJ,WAA6BA,OAAS,GACtB,iBAAxBrJ,EAAQsJ,gBAAkCA,YAAc,GACjC,iBAAvBtJ,EAAQuJ,eAAiCA,WAAa,GAQjE,IANA,IAGIrD,EAHEsD,EAAK,eACLC,EAAa,CAAC,GACdC,EAAW,GAEbC,GAAc,EAEVzD,EAAQsD,EAAGzD,KAAKjH,EAAK2J,SAC3BiB,EAAS5H,KAAKoE,EAAM7H,OACpBoL,EAAW3H,KAAKoE,EAAM7H,MAAQ6H,EAAM,GAAG5H,QAEnCQ,EAAK8J,UAAY1C,EAAM7H,OAASsL,EAAc,IAChDA,EAAcF,EAAWnL,OAAS,GAIlCqL,EAAc,IAAGA,EAAcF,EAAWnL,OAAS,GAMvD,IAJA,IAAIb,EAAS,GACPmM,EAAeZ,KAAKa,IAAI/K,EAAKE,KAAOgB,EAAQuJ,WAAYG,EAASpL,QAAQoB,WAAWpB,OACpFuK,EAAgB7I,EAAQoJ,WAAapJ,EAAQqJ,OAASO,EAAe,GAElEE,EAAI,EAAGA,GAAK9J,EAAQsJ,eACvBK,EAAcG,EAAI,GADkBA,IAAK,CAE7C,IAAM9K,EAAOwJ,EACX1J,EAAK2J,OACLgB,EAAWE,EAAcG,GACzBJ,EAASC,EAAcG,GACvBhL,EAAK8J,UAAYa,EAAWE,GAAeF,EAAWE,EAAcG,IACpEjB,GAEFpL,EAAST,EAAOM,OAAO,IAAK0C,EAAQqJ,QAAUF,GAAUrK,EAAKE,KAAO8K,EAAI,GAAGpK,WAAYkK,GACrF,MAAQ5K,EAAK0D,IAAM,KAAOjF,CAC9B,CAEA,IAAMuB,EAAOwJ,EAAQ1J,EAAK2J,OAAQgB,EAAWE,GAAcD,EAASC,GAAc7K,EAAK8J,SAAUC,GACjGpL,GAAUT,EAAOM,OAAO,IAAK0C,EAAQqJ,QAAUF,GAAUrK,EAAKE,KAAO,GAAGU,WAAYkK,GAClF,MAAQ5K,EAAK0D,IAAM,KACrBjF,GAAUT,EAAOM,OAAO,IAAK0C,EAAQqJ,OAASO,EAAe,EAAI5K,EAAKkK,KAAO,MAE7E,IAAA,IAASY,EAAI,EAAGA,GAAK9J,EAAQuJ,cACvBI,EAAcG,GAAKJ,EAASpL,QADOwL,IAAK,CAE5C,IAAM9K,EAAOwJ,EACX1J,EAAK2J,OACLgB,EAAWE,EAAcG,GACzBJ,EAASC,EAAcG,GACvBhL,EAAK8J,UAAYa,EAAWE,GAAeF,EAAWE,EAAcG,IACpEjB,GAEFpL,GAAUT,EAAOM,OAAO,IAAK0C,EAAQqJ,QAAUF,GAAUrK,EAAKE,KAAO8K,EAAI,GAAGpK,WAAYkK,GACtF,MAAQ5K,EAAK0D,IAAM,IACvB,CAEA,OAAOjF,EAAO+H,QAAQ,MAAO,GAC/B,EDzFoB3C,GACdkH,EAAiBjH,KAEjB4E,EAAkBvJ,OAAOtB,UAAU8K,eAYnCqC,EAAwB,sIACxBC,EAAgC,qBAEhCC,EAA0B,YAE1BC,EAAqB,6BAErBC,EAAkB,yEAExB,SAASC,EAAQ9F,GAAO,OAAOpG,OAAOtB,UAAU6C,SAASL,KAAKkF,EAAK,CAEnE,SAAS+F,EAAO7G,GACd,OAAc,KAANA,GAA8B,KAANA,CAClC,CAEA,SAAS8G,EAAc9G,GACrB,OAAc,IAANA,GAA+B,KAANA,CACnC,CAEA,SAAS+G,EAAW/G,GAClB,OAAc,IAANA,GACM,KAANA,GACM,KAANA,GACM,KAANA,CACV,CAEA,SAASgH,EAAiBhH,GACxB,OAAa,KAANA,GACM,KAANA,GACM,KAANA,GACM,MAANA,GACM,MAANA,CACT,CAEA,SAASiH,EAAajH,GACpB,GAAKA,GAAK,IAAiBA,GAAK,GAC9B,OAAOA,EAAI,GAGb,IAAMkH,EAAS,GAAJlH,EAEX,OAAKkH,GAAM,IAAiBA,GAAM,IACzBA,EAAK,GAAO,IAGd,CACT,CAEA,SAASC,EAAenH,GACtB,OAAU,MAANA,EAA4B,EACtB,MAANA,EAA4B,EACtB,KAANA,EAA4B,EACzB,CACT,CAEA,SAASoH,EAAiBpH,GACxB,OAAKA,GAAK,IAAiBA,GAAK,GACvBA,EAAI,IAGN,CACT,CAEA,SAASqH,EAAsBrH,GAC7B,OAAQA,GACN,KAAK,GAAa,MAAO,KACzB,KAAK,GAAa,MAAO,IACzB,KAAK,GAAa,MAAO,KACzB,KAAK,IACL,KAAK,EAAe,MAAO,KAC3B,KAAK,IAAa,MAAO,KACzB,KAAK,IAAa,MAAO,KACzB,KAAK,IAAa,MAAO,KACzB,KAAK,IAAa,MAAO,KACzB,KAAK,IAAa,MAAO,IACzB,KAAK,GAAiB,MAAO,IAC7B,KAAK,GAAa,MAAO,IACzB,KAAK,GAAa,MAAO,IACzB,KAAK,GAAa,MAAO,KACzB,KAAK,GAAa,MAAO,IACzB,KAAK,GAAa,MAAO,IACzB,KAAK,GAAa,MAAO,SACzB,KAAK,GAAa,MAAO,SACzB,QAAS,MAAO,GAEpB,CAEA,SAASsH,EAAmBtH,GAC1B,OAAIA,GAAK,MACAxC,OAAO+J,aAAavH,GAItBxC,OAAO+J,aACa,OAAvBvH,EAAI,OAAa,IACS,OAA1BA,EAAI,MAAY,MAEtB,CAIA,SAASwH,EAAahI,EAAQ1E,EAAKsF,GAErB,cAARtF,EACFJ,OAAO+M,eAAejI,EAAQ1E,EAAK,CACjC4M,cAAc,EACdC,YAAY,EACZC,UAAU,EACVxH,UAGFZ,EAAO1E,GAAOsF,CAElB,CAIA,IAFA,IAAMyH,EAAoB,IAAIlO,MAAM,KAC9BmO,EAAkB,IAAInO,MAAM,KACzB0M,EAAI,EAAGA,EAAI,IAAKA,IACvBwB,EAAkBxB,GAAKgB,EAAqBhB,GAAK,EAAI,EACrDyB,EAAgBzB,GAAKgB,EAAqBhB,GAG5C,SAAS0B,EAAOnE,EAAOrH,GACrBV,KAAK+H,MAAQA,EAEb/H,KAAKmM,SAAWzL,EAAkB,UAAK,KACvCV,KAAK+B,OAASrB,EAAgB,QAAK+J,EACnCzK,KAAKoM,UAAY1L,EAAmB,WAAK,KAGzCV,KAAKqM,OAAS3L,EAAgB,SAAK,EAEnCV,KAAKmG,KAAOzF,EAAc,OAAK,EAC/BV,KAAKsM,SAAW5L,EAAkB,UAAK,KACvCV,KAAKuM,SAA0C,iBAAxB7L,EAAkB,SAAiBA,EAAkB,SAAI,IAChFV,KAAKwM,kBAA4D,iBAAjC9L,EAA2B,kBAAiBA,EAA2B,kBAAI,IAE3GV,KAAKyM,cAAgBzM,KAAK+B,OAAOY,iBACjC3C,KAAK0M,QAAU1M,KAAK+B,OAAOc,gBAE3B7C,KAAKhB,OAAS+I,EAAM/I,OACpBgB,KAAKsJ,SAAW,EAChBtJ,KAAKN,KAAO,EACZM,KAAKoJ,UAAY,EACjBpJ,KAAK2M,WAAa,EAClB3M,KAAK4M,MAAQ,EACb5M,KAAK6M,eAAiB,EAItB7M,KAAK8M,gBAAiB,EAEtB9M,KAAK+M,UAAY,GACjB/M,KAAKgN,sBAAwB,EAW/B,CAEA,SAASC,EAAeC,EAAO5N,GAC7B,IAAME,EAAO,CACXC,KAAMyN,EAAMf,SACZhD,OAAQ+D,EAAMnF,MAAMrD,MAAM,GAAG,GAC7B4E,SAAU4D,EAAM5D,SAChB5J,KAAMwN,EAAMxN,KACZC,OAAQuN,EAAM5D,SAAW4D,EAAM9D,WAKjC,OAFA5J,EAAKI,QAAUqJ,EAAYzJ,GAEpB,IAAIK,EAAcP,EAASE,EACpC,CAEA,SAAS2N,EAAYD,EAAO5N,GAC1B,MAAM2N,EAAcC,EAAO5N,EAC7B,CAEA,SAAS8N,EAAcF,EAAO5N,GACxB4N,EAAMd,WACRc,EAAMd,UAAUrM,KAAK,KAAMkN,EAAcC,EAAO5N,GAEpD,CAEA,SAAS+N,EAAaH,EAAOzN,EAAM8E,GACjC,IAAM+I,EAAeJ,EAAMF,sBAE3B,GAA4B,IAAxBM,EAAatO,OAAc,CAC7B,IAAMuO,EAAcD,EAAaA,EAAatO,OAAS,GAElDoJ,EAAgBrI,KAAKwN,EAAa9N,KACrC8N,EAAY9N,GAAQ,CAClB+N,QAASpF,EAAgBrI,KAAKmN,EAAMO,UAAWhO,GAC/C8E,MAAO2I,EAAMO,UAAUhO,IAG7B,CAEAyN,EAAMO,UAAUhO,GAAQ8E,CAC1B,CAuCA,SAASmJ,EAAeR,GACtB,MAAO,CACL5D,SAAU4D,EAAM5D,SAChB5J,KAAMwN,EAAMxN,KACZ0J,UAAW8D,EAAM9D,UACjBuD,WAAYO,EAAMP,WAClBG,eAAgBI,EAAMJ,eACtBrM,IAAKyM,EAAMzM,IACXkN,OAAQT,EAAMS,OACd7M,KAAMoM,EAAMpM,KACZ3C,OAAQ+O,EAAM/O,OAElB,CAEA,SAASyP,EAAcV,EAAOW,GAC5BX,EAAM5D,SAAWuE,EAASvE,SAC1B4D,EAAMxN,KAAOmO,EAASnO,KACtBwN,EAAM9D,UAAYyE,EAASzE,UAC3B8D,EAAMP,WAAakB,EAASlB,WAC5BO,EAAMJ,eAAiBe,EAASf,eAChCI,EAAMzM,IAAMoN,EAASpN,IACrByM,EAAMS,OAASE,EAASF,OACxBT,EAAMpM,KAAO+M,EAAS/M,KACtBoM,EAAM/O,OAAS0P,EAAS1P,MAC1B,CAEA,IAAM2P,EAAoB,CAExBC,KAAM,SAA8Bb,EAAOzN,EAAMuO,GACzB,OAAlBd,EAAMe,SACRd,EAAWD,EAAO,kCAGA,IAAhBc,EAAKhP,QACPmO,EAAWD,EAAO,+CAGpB,IAAMtG,EAAQ,uBAAuBH,KAAKuH,EAAK,IAEjC,OAAVpH,GACFuG,EAAWD,EAAO,6CAGpB,IAAMgB,EAAQvJ,SAASiC,EAAM,GAAI,IAC3BuH,EAAQxJ,SAASiC,EAAM,GAAI,IAEnB,IAAVsH,GACFf,EAAWD,EAAO,6CAGpBA,EAAMe,QAAUD,EAAK,GACrBd,EAAMkB,gBAAmBD,EAAQ,EAEnB,IAAVA,GAAyB,IAAVA,GACjBf,EAAaF,EAAO,6CAIxBmB,IAAK,SAA6BnB,EAAOzN,EAAMuO,GAC7C,IAAIM,EAEgB,IAAhBN,EAAKhP,QACPmO,EAAWD,EAAO,+CAGpB,IAAMqB,EAASP,EAAK,GACpBM,EAASN,EAAK,GAETnD,EAAmBlF,KAAK4I,IAC3BpB,EAAWD,EAAO,+DAGhB9E,EAAgBrI,KAAKmN,EAAMsB,OAAQD,IACrCpB,EAAWD,EAAO,8CAAgDqB,EAAS,gBAGxEzD,EAAgBnF,KAAK2I,IACxBnB,EAAWD,EAAO,gEAGpB,IACEoB,EAASG,mBAAmBH,SACrBI,GACPvB,EAAWD,EAAO,4BAA8BoB,EAClD,CAEApB,EAAMsB,OAAOD,GAAUD,CACzB,GAGF,SAASK,EAAgBzB,EAAO0B,EAAOC,EAAKC,GAC1C,GAAIF,EAAQC,EAAK,CACf,IAAME,EAAU7B,EAAMnF,MAAMrD,MAAMkK,EAAOC,GAEzC,GAAIC,EACF,IAAA,IAASE,EAAY,EAAGC,EAAUF,EAAQ/P,OAAQgQ,EAAYC,EAASD,GAAa,EAAG,CACrF,IAAME,EAAaH,EAAQhK,WAAWiK,GACjB,IAAfE,GACCA,GAAc,IAAQA,GAAc,SACzC/B,EAAWD,EAAO,gCAEtB,MACSxC,EAAsB/E,KAAKoJ,IACpC5B,EAAWD,EAAO,gDAGpBA,EAAM/O,QAAU4Q,CAClB,CACF,CAEA,SAASI,EAAejC,EAAOkC,EAAazQ,EAAQ0Q,GAC7C3R,EAAOC,SAASgB,IACnBwO,EAAWD,EAAO,qEAKpB,IAFA,IAAMtO,EAAaC,OAAOC,KAAKH,GAEtBI,EAAQ,EAAGuQ,EAAW1Q,EAAWI,OAAQD,EAAQuQ,EAAUvQ,GAAS,EAAG,CAC9E,IAAME,EAAML,EAAWG,IAES,IAA5BmO,EAAMV,qBAA8BU,EAAML,eAAiBK,EAAMV,mBACnEW,EAAWD,EAAO,0CAA4CA,EAAMV,kBAAoB,KAGrFpE,EAAgBrI,KAAKqP,EAAanQ,KACrC0M,EAAYyD,EAAanQ,EAAKN,EAAOM,IACrCoQ,EAAgBpQ,IAAO,EAE3B,CACF,CAEA,SAASsQ,EAAkBrC,EAAO6B,EAASM,EAAiBG,EAAQC,EAASC,EAC3EC,EAAWC,EAAgBC,GAI3B,GAAI/R,MAAMC,QAAQ0R,GAGhB,IAAA,IAAS1Q,EAAQ,EAAGuQ,GAFpBG,EAAU3R,MAAMP,UAAUmH,MAAM3E,KAAK0P,IAEEzQ,OAAQD,EAAQuQ,EAAUvQ,GAAS,EACpEjB,MAAMC,QAAQ0R,EAAQ1Q,KACxBoO,EAAWD,EAAO,+CAGG,WAAnBhQ,EAAOuS,IAAmD,oBAA3B1E,EAAO0E,EAAQ1Q,MAChD0Q,EAAQ1Q,GAAS,mBAkBvB,GAVuB,WAAnB7B,EAAOuS,IAA4C,oBAApB1E,EAAO0E,KACxCA,EAAU,mBAGZA,EAAU9N,OAAO8N,GAED,OAAZV,IACFA,EAAU,CAAA,GAGG,4BAAXS,EACF,GAAI1R,MAAMC,QAAQ2R,GAChB,IAAA,IAAS3Q,EAAQ,EAAGuQ,EAAWI,EAAU1Q,OAAQD,EAAQuQ,EAAUvQ,GAAS,EAC1EoQ,EAAcjC,EAAO6B,EAASW,EAAU3Q,GAAQsQ,QAGlDF,EAAcjC,EAAO6B,EAASW,EAAWL,QAGtCnC,EAAM/G,MACNiC,EAAgBrI,KAAKsP,EAAiBI,KACvCrH,EAAgBrI,KAAKgP,EAASU,KAChCvC,EAAMxN,KAAOiQ,GAAazC,EAAMxN,KAChCwN,EAAM9D,UAAYwG,GAAkB1C,EAAM9D,UAC1C8D,EAAM5D,SAAWuG,GAAY3C,EAAM5D,SACnC6D,EAAWD,EAAO,2BAGpBvB,EAAYoD,EAASU,EAASC,UACvBL,EAAgBI,GAGzB,OAAOV,CACT,CAEA,SAASe,EAAe5C,GACtB,IAAMzI,EAAKyI,EAAMnF,MAAMhD,WAAWmI,EAAM5D,UAE7B,KAAP7E,EACFyI,EAAM5D,WACU,KAAP7E,GACTyI,EAAM5D,WACyC,KAA3C4D,EAAMnF,MAAMhD,WAAWmI,EAAM5D,WAC/B4D,EAAM5D,YAGR6D,EAAWD,EAAO,4BAGpBA,EAAMxN,MAAQ,EACdwN,EAAM9D,UAAY8D,EAAM5D,SACxB4D,EAAMJ,gBAAiB,CACzB,CAEA,SAASiD,EAAqB7C,EAAO8C,EAAeC,GAIlD,IAHA,IAAIC,EAAa,EACbzL,EAAKyI,EAAMnF,MAAMhD,WAAWmI,EAAM5D,UAExB,IAAP7E,GAAU,CACf,KAAOwG,EAAaxG,IACP,IAAPA,IAAiD,IAAzByI,EAAMJ,iBAChCI,EAAMJ,eAAiBI,EAAM5D,UAE/B7E,EAAKyI,EAAMnF,MAAMhD,aAAamI,EAAM5D,UAGtC,GAAI0G,GAAwB,KAAPvL,EACnB,GACEA,EAAKyI,EAAMnF,MAAMhD,aAAamI,EAAM5D,gBACtB,KAAP7E,GAA8B,KAAPA,GAA8B,IAAPA,GAGzD,IAAIuG,EAAMvG,GAYR,MALA,IANAqL,EAAc5C,GAEdzI,EAAKyI,EAAMnF,MAAMhD,WAAWmI,EAAM5D,UAClC4G,IACAhD,EAAMP,WAAa,EAEL,KAAPlI,GACLyI,EAAMP,aACNlI,EAAKyI,EAAMnF,MAAMhD,aAAamI,EAAM5D,SAK1C,CAMA,OAJoB,IAAhB2G,GAAqC,IAAfC,GAAoBhD,EAAMP,WAAasD,GAC/D7C,EAAaF,EAAO,yBAGfgD,CACT,CAEA,SAASC,EAAuBjD,GAC9B,IAAI8B,EAAY9B,EAAM5D,SAClB7E,EAAKyI,EAAMnF,MAAMhD,WAAWiK,GAIhC,QAAY,KAAPvK,GAA6B,KAAPA,GACvBA,IAAOyI,EAAMnF,MAAMhD,WAAWiK,EAAY,IAC1CvK,IAAOyI,EAAMnF,MAAMhD,WAAWiK,EAAY,KAC5CA,GAAa,EAIF,KAFXvK,EAAKyI,EAAMnF,MAAMhD,WAAWiK,MAEZ9D,EAAUzG,IAM9B,CAEA,SAAS2L,EAAkBlD,EAAOhP,GAClB,IAAVA,EACFgP,EAAM/O,QAAU,IACPD,EAAQ,IACjBgP,EAAM/O,QAAUT,EAAOM,OAAO,KAAME,EAAQ,GAEhD,CAwdA,SAASmS,EAAmBnD,EAAOoD,GACjC,IAAMC,EAAOrD,EAAMzM,IACb+P,EAAUtD,EAAMS,OAChBoB,EAAU,GACZ0B,GAAW,EAIf,IAA6B,IAAzBvD,EAAMJ,eAAuB,OAAO,EAEnB,OAAjBI,EAAMS,QACRN,EAAYH,EAAOA,EAAMS,OAAQoB,GAKnC,IAFA,IAAItK,EAAKyI,EAAMnF,MAAMhD,WAAWmI,EAAM5D,UAExB,IAAP7E,KACwB,IAAzByI,EAAMJ,iBACRI,EAAM5D,SAAW4D,EAAMJ,eACvBK,EAAWD,EAAO,mDAGT,KAAPzI,IANW,CAYf,IAAKyG,EAFagC,EAAMnF,MAAMhD,WAAWmI,EAAM5D,SAAW,IAGxD,MAMF,GAHAmH,GAAW,EACXvD,EAAM5D,WAEFyG,EAAoB7C,GAAO,GAAM,IAC/BA,EAAMP,YAAc2D,EACtBvB,EAAQvM,KAAK,MACbiC,EAAKyI,EAAMnF,MAAMhD,WAAWmI,EAAM5D,cAHtC,CAQA,IAAMoH,EAAQxD,EAAMxN,KAOpB,GANAiR,EAAYzD,EAAOoD,EAnhCE,GAmhC4B,GAAO,GACxDvB,EAAQvM,KAAK0K,EAAM/O,QACnB4R,EAAoB7C,GAAO,GAAM,GAEjCzI,EAAKyI,EAAMnF,MAAMhD,WAAWmI,EAAM5D,WAE7B4D,EAAMxN,OAASgR,GAASxD,EAAMP,WAAa2D,IAAuB,IAAP7L,EAC9D0I,EAAWD,EAAO,4CACpB,GAAWA,EAAMP,WAAa2D,EAC5B,KAZF,CAcF,CAEA,QAAIG,IACFvD,EAAMzM,IAAM8P,EACZrD,EAAMS,OAAS6C,EACftD,EAAMpM,KAAO,WACboM,EAAM/O,OAAS4Q,GACR,EAGX,CAEA,SAAS6B,EAAkB1D,EAAOoD,EAAYO,GAC5C,IAAIC,EACAC,EACAC,EACAC,EACEV,EAAOrD,EAAMzM,IACb+P,EAAUtD,EAAMS,OAChBoB,EAAU,CAAA,EACVM,EAAkBxQ,OAAOsB,OAAO,MAClCqP,EAAS,KACTC,EAAU,KACVC,EAAY,KACZwB,GAAgB,EAChBT,GAAW,EAIf,IAA6B,IAAzBvD,EAAMJ,eAAuB,OAAO,EAEnB,OAAjBI,EAAMS,QACRN,EAAYH,EAAOA,EAAMS,OAAQoB,GAKnC,IAFA,IAAItK,EAAKyI,EAAMnF,MAAMhD,WAAWmI,EAAM5D,UAExB,IAAP7E,GAAU,CACVyM,IAA0C,IAAzBhE,EAAMJ,iBAC1BI,EAAM5D,SAAW4D,EAAMJ,eACvBK,EAAWD,EAAO,mDAGpB,IAAMiE,EAAYjE,EAAMnF,MAAMhD,WAAWmI,EAAM5D,SAAW,GACpDoH,EAAQxD,EAAMxN,KAMpB,GAAY,KAAP+E,GAA6B,KAAPA,IAAuByG,EAAUiG,GAwBrD,CAKL,GAJAJ,EAAW7D,EAAMxN,KACjBsR,EAAgB9D,EAAM9D,UACtB6H,EAAU/D,EAAM5D,UAEXqH,EAAYzD,EAAO2D,EA9mCL,GA8mCmC,GAAO,GAG3D,MAGF,GAAI3D,EAAMxN,OAASgR,EAAO,CAGxB,IAFAjM,EAAKyI,EAAMnF,MAAMhD,WAAWmI,EAAM5D,UAE3B2B,EAAaxG,IAClBA,EAAKyI,EAAMnF,MAAMhD,aAAamI,EAAM5D,UAGtC,GAAW,KAAP7E,EAGGyG,EAFLzG,EAAKyI,EAAMnF,MAAMhD,aAAamI,EAAM5D,YAGlC6D,EAAWD,EAAO,2FAGhBgE,IACF3B,EAAiBrC,EAAO6B,EAASM,EAAiBG,EAAQC,EAAS,KAAMsB,EAAUC,EAAeC,GAClGzB,EAASC,EAAUC,EAAY,MAGjCe,GAAW,EACXS,GAAgB,EAChBJ,GAAe,EACftB,EAAStC,EAAMzM,IACfgP,EAAUvC,EAAM/O,gBACPsS,EAKT,OAFAvD,EAAMzM,IAAM8P,EACZrD,EAAMS,OAAS6C,GACR,EAJPrD,EAAWD,EAAO,2DAKpB,WACSuD,EAKT,OAFAvD,EAAMzM,IAAM8P,EACZrD,EAAMS,OAAS6C,GACR,EAJPrD,EAAWD,EAAO,iFAKpB,CACF,MAxEa,KAAPzI,GACEyM,IACF3B,EAAiBrC,EAAO6B,EAASM,EAAiBG,EAAQC,EAAS,KAAMsB,EAAUC,EAAeC,GAClGzB,EAASC,EAAUC,EAAY,MAGjCe,GAAW,EACXS,GAAgB,EAChBJ,GAAe,GACNI,GAETA,GAAgB,EAChBJ,GAAe,GAEf3D,EAAWD,EAAO,qGAGpBA,EAAM5D,UAAY,EAClB7E,EAAK0M,EAmFP,IAxBIjE,EAAMxN,OAASgR,GAASxD,EAAMP,WAAa2D,KACzCY,IACFH,EAAW7D,EAAMxN,KACjBsR,EAAgB9D,EAAM9D,UACtB6H,EAAU/D,EAAM5D,UAGdqH,EAAYzD,EAAOoD,EApqCH,GAoqCkC,EAAMQ,KACtDI,EACFzB,EAAUvC,EAAM/O,OAEhBuR,EAAYxC,EAAM/O,QAIjB+S,IACH3B,EAAiBrC,EAAO6B,EAASM,EAAiBG,EAAQC,EAASC,EAAWqB,EAAUC,EAAeC,GACvGzB,EAASC,EAAUC,EAAY,MAGjCK,EAAoB7C,GAAO,GAAM,GACjCzI,EAAKyI,EAAMnF,MAAMhD,WAAWmI,EAAM5D,YAG/B4D,EAAMxN,OAASgR,GAASxD,EAAMP,WAAa2D,IAAuB,IAAP7L,EAC9D0I,EAAWD,EAAO,2CACpB,GAAWA,EAAMP,WAAa2D,EAC5B,KAEJ,CAmBA,OAZIY,GACF3B,EAAiBrC,EAAO6B,EAASM,EAAiBG,EAAQC,EAAS,KAAMsB,EAAUC,EAAeC,GAIhGR,IACFvD,EAAMzM,IAAM8P,EACZrD,EAAMS,OAAS6C,EACftD,EAAMpM,KAAO,UACboM,EAAM/O,OAAS4Q,GAGV0B,CACT,CAEA,SAASW,EAAiBlE,GACxB,IAEImE,EACAC,EAHAC,GAAa,EACbC,GAAU,EAIV/M,EAAKyI,EAAMnF,MAAMhD,WAAWmI,EAAM5D,UAEtC,GAAW,KAAP7E,EAAoB,OAAO,EAEb,OAAdyI,EAAMzM,KACR0M,EAAWD,EAAO,iCAKT,MAFXzI,EAAKyI,EAAMnF,MAAMhD,aAAamI,EAAM5D,YAGlCiI,GAAa,EACb9M,EAAKyI,EAAMnF,MAAMhD,aAAamI,EAAM5D,WACpB,KAAP7E,GACT+M,GAAU,EACVH,EAAY,KACZ5M,EAAKyI,EAAMnF,MAAMhD,aAAamI,EAAM5D,WAEpC+H,EAAY,IAGd,IAAIrC,EAAY9B,EAAM5D,SAEtB,GAAIiI,EAAY,CACd,GAAK9M,EAAKyI,EAAMnF,MAAMhD,aAAamI,EAAM5D,gBAC3B,IAAP7E,GAAmB,KAAPA,GAEfyI,EAAM5D,SAAW4D,EAAMlO,QACzBsS,EAAUpE,EAAMnF,MAAMrD,MAAMsK,EAAW9B,EAAM5D,UAC7C7E,EAAKyI,EAAMnF,MAAMhD,aAAamI,EAAM5D,WAEpC6D,EAAWD,EAAO,qDAEtB,KAAO,CACL,KAAc,IAAPzI,IAAayG,EAAUzG,IACjB,KAAPA,IACG+M,EAUHrE,EAAWD,EAAO,gDATlBmE,EAAYnE,EAAMnF,MAAMrD,MAAMsK,EAAY,EAAG9B,EAAM5D,SAAW,GAEzDuB,EAAmBlF,KAAK0L,IAC3BlE,EAAWD,EAAO,mDAGpBsE,GAAU,EACVxC,EAAY9B,EAAM5D,SAAW,IAMjC7E,EAAKyI,EAAMnF,MAAMhD,aAAamI,EAAM5D,UAGtCgI,EAAUpE,EAAMnF,MAAMrD,MAAMsK,EAAW9B,EAAM5D,UAEzCsB,EAAwBjF,KAAK2L,IAC/BnE,EAAWD,EAAO,sDAEtB,CAEIoE,IAAYxG,EAAgBnF,KAAK2L,IACnCnE,EAAWD,EAAO,4CAA8CoE,GAGlE,IACEA,EAAU7C,mBAAmB6C,SACtB5C,GACPvB,EAAWD,EAAO,0BAA4BoE,EAChD,CAcA,OAZIC,EACFrE,EAAMzM,IAAM6Q,EACHlJ,EAAgBrI,KAAKmN,EAAMsB,OAAQ6C,GAC5CnE,EAAMzM,IAAMyM,EAAMsB,OAAO6C,GAAaC,EACf,MAAdD,EACTnE,EAAMzM,IAAM,IAAM6Q,EACK,OAAdD,EACTnE,EAAMzM,IAAM,qBAAuB6Q,EAEnCnE,EAAWD,EAAO,0BAA4BmE,EAAY,MAGrD,CACT,CAEA,SAASI,EAAoBvE,GAC3B,IAAIzI,EAAKyI,EAAMnF,MAAMhD,WAAWmI,EAAM5D,UAEtC,GAAW,KAAP7E,EAAoB,OAAO,EAEV,OAAjByI,EAAMS,QACRR,EAAWD,EAAO,qCAGpBzI,EAAKyI,EAAMnF,MAAMhD,aAAamI,EAAM5D,UAGpC,IAFA,IAAM0F,EAAY9B,EAAM5D,SAEV,IAAP7E,IAAayG,EAAUzG,KAAQ0G,EAAgB1G,IACpDA,EAAKyI,EAAMnF,MAAMhD,aAAamI,EAAM5D,UAQtC,OALI4D,EAAM5D,WAAa0F,GACrB7B,EAAWD,EAAO,8DAGpBA,EAAMS,OAAST,EAAMnF,MAAMrD,MAAMsK,EAAW9B,EAAM5D,WAC3C,CACT,CA6BA,SAASoI,EAAiCxE,EAAOyE,EAAerB,EAAYO,GAC1E,IAAMe,EAAgBlE,EAAcR,GAYpC,OArpCF,SAAiCA,GAC/BA,EAAMF,sBAAsBxK,KAAK3D,OAAOsB,OAAO,MACjD,CAyoCE0R,CAAuB3E,GACvBU,EAAaV,EAAOyE,GAIpBzE,EAAMzM,IAAM,KACZyM,EAAMS,OAAS,KACfT,EAAMpM,KAAO,KACboM,EAAM/O,OAAS,KAEXyS,EAAiB1D,EAAOoD,EAAYO,IAA8B,YAAf3D,EAAMpM,MAjpC/D,SAAkCoM,GAChC,IAAMK,EAAcL,EAAMF,sBAAsB8E,MAC1CxE,EAAeJ,EAAMF,sBAE3B,GAA4B,IAAxBM,EAAatO,OAKjB,IAHA,IAAM+S,EAASzE,EAAaA,EAAatO,OAAS,GAC5CgT,EAAQnT,OAAOC,KAAKyO,GAEjBxO,EAAQ,EAAGC,EAASgT,EAAMhT,OAAQD,EAAQC,EAAQD,GAAS,EAAG,CACrE,IAAMU,EAAOuS,EAAMjT,GAEdqJ,EAAgBrI,KAAKgS,EAAQtS,KAChCsS,EAAOtS,GAAQ8N,EAAY9N,GAE/B,CACF,CAkoCIwS,CAAwB/E,IACjB,IAjoCX,SAAoCA,GAIlC,IAHA,IAAMK,EAAcL,EAAMF,sBAAsB8E,MAC1CE,EAAQnT,OAAOC,KAAKyO,GAEjBxO,EAAQiT,EAAMhT,OAAS,EAAGD,GAAS,EAAGA,GAAS,EAAG,CACzD,IAAMmT,EAAQ3E,EAAYyE,EAAMjT,IAE5BmT,EAAM1E,QACRN,EAAMO,UAAUuE,EAAMjT,IAAUmT,EAAM3N,aAE/B2I,EAAMO,UAAUuE,EAAMjT,GAEjC,CACF,CAunCEoT,CAA0BjF,GAC1BU,EAAaV,EAAO0E,IACb,EACT,CAEA,SAASjB,EAAazD,EAAOkF,EAAcC,EAAaC,EAAaxB,GACnE,IAAIyB,EACAC,EAKAhS,EACAqQ,EACA4B,EANAC,EAAe,EACfC,GAAY,EACZC,GAAa,EACbjB,EAAgB,KAKhBzE,EAAMN,OAASM,EAAMX,UACvBY,EAAWD,EAAO,8BAAgCA,EAAMX,SAAW,KAGrEW,EAAMN,OAAS,EAEQ,OAAnBM,EAAMZ,UACRY,EAAMZ,SAAS,OAAQY,GAGzBA,EAAMzM,IAAM,KACZyM,EAAMS,OAAS,KACfT,EAAMpM,KAAO,KACboM,EAAM/O,OAAS,KAEf,IAAM0U,EAAmBN,EAAoBC,EA/4CrB,IAg5CAH,GAj5CD,IAk5CAA,EAgBvB,GAdIC,GACEvC,EAAoB7C,GAAO,GAAM,KACnCyF,GAAY,EAERzF,EAAMP,WAAayF,EACrBM,EAAe,EACNxF,EAAMP,aAAeyF,EAC9BM,EAAe,EACNxF,EAAMP,WAAayF,IAC5BM,GAAe,IAKA,IAAjBA,EACF,OAAa,CACX,IAAMjO,EAAKyI,EAAMnF,MAAMhD,WAAWmI,EAAM5D,UAClCwJ,EAAgBpF,EAAcR,GAIpC,GAAIyF,IACS,KAAPlO,GAAoC,OAAdyI,EAAMzM,KACrB,KAAPgE,GAAuC,OAAjByI,EAAMS,QAChC,MAGF,IAAKyD,EAAgBlE,KAAWuE,EAAmBvE,GACjD,MAGoB,OAAlByE,IACFA,EAAgBmB,GAGd/C,EAAoB7C,GAAO,GAAM,IACnCyF,GAAY,EACZH,EAAwBK,EAEpB3F,EAAMP,WAAayF,EACrBM,EAAe,EACNxF,EAAMP,aAAeyF,EAC9BM,EAAe,EACNxF,EAAMP,WAAayF,IAC5BM,GAAe,IAGjBF,GAAwB,CAE5B,CAOF,GAJIA,IACFA,EAAwBG,GAAa7B,GAGlB,IAAjB4B,GA38CoB,IA28CwBL,EAS9C,GAPExB,EAh9CkB,IA+8CIwB,GA98CH,IA88CuCA,EAC7CD,EAEAA,EAAe,EAG9BK,EAAcvF,EAAM5D,SAAW4D,EAAM9D,UAEhB,IAAjBsJ,EACF,GAAKF,IACAnC,EAAkBnD,EAAOuF,IAAgB7B,EAAiB1D,EAAOuF,EAAa5B,KA5uBzF,SAA6B3D,EAAOoD,GAClC,IACII,EACAqC,EACAC,EAEAjE,EAEAkE,EACAC,EACAC,EACAC,EAEA3D,EACAD,EACAE,EAdA2D,GAAW,EAIT9C,EAAOrD,EAAMzM,IAEb+P,EAAUtD,EAAMS,OAKhB0B,EAAkBxQ,OAAOsB,OAAO,MAKlCsE,EAAKyI,EAAMnF,MAAMhD,WAAWmI,EAAM5D,UAEtC,GAAW,KAAP7E,EACFwO,EAAa,GACbG,GAAY,EACZrE,EAAU,OACZ,IAAkB,MAAPtK,EAKT,OAAO,EAJPwO,EAAa,IACbG,GAAY,EACZrE,EAAU,CAAA,CAGZ,CAQA,IANqB,OAAjB7B,EAAMS,QACRN,EAAYH,EAAOA,EAAMS,OAAQoB,GAGnCtK,EAAKyI,EAAMnF,MAAMhD,aAAamI,EAAM5D,UAEtB,IAAP7E,GAAU,CAKf,GAJAsL,EAAoB7C,GAAO,EAAMoD,IAEjC7L,EAAKyI,EAAMnF,MAAMhD,WAAWmI,EAAM5D,aAEvB2J,EAMT,OALA/F,EAAM5D,WACN4D,EAAMzM,IAAM8P,EACZrD,EAAMS,OAAS6C,EACftD,EAAMpM,KAAOsS,EAAY,UAAY,WACrClG,EAAM/O,OAAS4Q,GACR,EACGsE,EAEM,KAAP5O,GAET0I,EAAWD,EAAO,4CAHlBC,EAAWD,EAAO,gDAMDwC,EAAY,KAC/BwD,EAASC,GAAiB,EAEf,KAAP1O,GAGEyG,EAFcgC,EAAMnF,MAAMhD,WAAWmI,EAAM5D,SAAW,MAGxD4J,EAASC,GAAiB,EAC1BjG,EAAM5D,WACNyG,EAAoB7C,GAAO,EAAMoD,IAIrCI,EAAQxD,EAAMxN,KACdqT,EAAa7F,EAAM9D,UACnB4J,EAAO9F,EAAM5D,SACbqH,EAAYzD,EAAOoD,EArzBC,GAqzB4B,GAAO,GACvDd,EAAStC,EAAMzM,IACfgP,EAAUvC,EAAM/O,OAChB4R,EAAoB7C,GAAO,EAAMoD,GAEjC7L,EAAKyI,EAAMnF,MAAMhD,WAAWmI,EAAM5D,WAE7B6J,GAAkBjG,EAAMxN,OAASgR,GAAiB,KAAPjM,IAC9CyO,GAAS,EACTzO,EAAKyI,EAAMnF,MAAMhD,aAAamI,EAAM5D,UACpCyG,EAAoB7C,GAAO,EAAMoD,GACjCK,EAAYzD,EAAOoD,EAh0BD,GAg0B8B,GAAO,GACvDZ,EAAYxC,EAAM/O,QAGhBiV,EACF7D,EAAiBrC,EAAO6B,EAASM,EAAiBG,EAAQC,EAASC,EAAWgB,EAAOqC,EAAYC,GACxFE,EACTnE,EAAQvM,KAAK+M,EAAiBrC,EAAO,KAAMmC,EAAiBG,EAAQC,EAASC,EAAWgB,EAAOqC,EAAYC,IAE3GjE,EAAQvM,KAAKiN,GAGfM,EAAoB7C,GAAO,EAAMoD,GAItB,MAFX7L,EAAKyI,EAAMnF,MAAMhD,WAAWmI,EAAM5D,YAGhC+J,GAAW,EACX5O,EAAKyI,EAAMnF,MAAMhD,aAAamI,EAAM5D,WAEpC+J,GAAW,CAEf,CAEAlG,EAAWD,EAAO,wDACpB,CAioBUoG,CAAmBpG,EAAO2D,GAC5B+B,GAAa,MACR,CACL,IAAMnO,EAAKyI,EAAMnF,MAAMhD,WAAWmI,EAAM5D,UAElB,OAAlBqI,GAA0BkB,IAAqBL,GACxC,MAAP/N,GAA6B,KAAPA,GACtBiN,EACExE,EACAyE,EACAA,EAAcrI,SAAWqI,EAAcvI,UACvCyH,IAGM0B,GA7oBpB,SAA0BrF,EAAOoD,GAC/B,IAAIiD,EAOAC,EANAC,EAx1BgB,EAy1BhBC,GAAiB,EACjBC,GAAiB,EACjBC,EAAatD,EACbuD,EAAa,EACbC,GAAiB,EAGjBrP,EAAKyI,EAAMnF,MAAMhD,WAAWmI,EAAM5D,UAEtC,GAAW,MAAP7E,EACF8O,GAAU,MACZ,IAAkB,KAAP9O,EAGT,OAAO,EAFP8O,GAAU,CAGZ,CAKA,IAHArG,EAAMpM,KAAO,SACboM,EAAM/O,OAAS,GAED,IAAPsG,GAGL,GAAW,MAFXA,EAAKyI,EAAMnF,MAAMhD,aAAamI,EAAM5D,YAEH,KAAP7E,EAh3BR,IAi3BMgP,EACpBA,EAAmB,KAAPhP,EAh3BE,EADC,EAm3Bf0I,EAAWD,EAAO,mDAEVsG,EAAMjI,EAAgB9G,KAAQ,GAUxC,MATY,IAAR+O,EACFrG,EAAWD,EAAO,gFACRyG,EAIVxG,EAAWD,EAAO,8CAHlB0G,EAAatD,EAAakD,EAAM,EAChCG,GAAiB,EAMrB,CAGF,GAAI1I,EAAaxG,GAAK,CACpB,GAAKA,EAAKyI,EAAMnF,MAAMhD,aAAamI,EAAM5D,gBAClC2B,EAAaxG,IAEpB,GAAW,KAAPA,EACF,GAAKA,EAAKyI,EAAMnF,MAAMhD,aAAamI,EAAM5D,iBACjC0B,EAAMvG,IAAe,IAAPA,EAE1B,CAEA,KAAc,IAAPA,GAAU,CAOf,IANAqL,EAAc5C,GACdA,EAAMP,WAAa,EAEnBlI,EAAKyI,EAAMnF,MAAMhD,WAAWmI,EAAM5D,YAGzBqK,GAAkBzG,EAAMP,WAAaiH,IAC/B,KAAPnP,GACNyI,EAAMP,aACNlI,EAAKyI,EAAMnF,MAAMhD,aAAamI,EAAM5D,UAOtC,IAJKqK,GAAkBzG,EAAMP,WAAaiH,IACxCA,EAAa1G,EAAMP,YAGjB3B,EAAMvG,GACRoP,QADF,CAUA,GALKF,GAAiC,IAAfC,GACrBzG,EAAWD,EAAO,wCAIhBA,EAAMP,WAAaiH,EAAY,CAv6BjB,IAy6BZH,EACFvG,EAAM/O,QAAUT,EAAOM,OAAO,KAAM0V,EAAiB,EAAIG,EAAaA,GA56BxD,IA66BLJ,GACLC,IACFxG,EAAM/O,QAAU,MAKpB,KACF,CAGIoV,EAEEtI,EAAaxG,IACfqP,GAAiB,EAEjB5G,EAAM/O,QAAUT,EAAOM,OAAO,KAAM0V,EAAiB,EAAIG,EAAaA,IAG7DC,GACTA,GAAiB,EACjB5G,EAAM/O,QAAUT,EAAOM,OAAO,KAAM6V,EAAa,IAGzB,IAAfA,EACLH,IACFxG,EAAM/O,QAAU,KAKlB+O,EAAM/O,QAAUT,EAAOM,OAAO,KAAM6V,GAMtC3G,EAAM/O,QAAUT,EAAOM,OAAO,KAAM0V,EAAiB,EAAIG,EAAaA,GAGxEH,GAAiB,EACjBC,GAAiB,EACjBE,EAAa,EAGb,IAFA,IAAME,EAAe7G,EAAM5D,UAEnB0B,EAAMvG,IAAe,IAAPA,GACpBA,EAAKyI,EAAMnF,MAAMhD,aAAamI,EAAM5D,UAGtCqF,EAAezB,EAAO6G,EAAc7G,EAAM5D,UAAU,EA5DpD,CA6DF,CAEA,OAAO,CACT,CAigByC0K,CAAgB9G,EAAO2D,IA92BhE,SAAiC3D,EAAOoD,GACtC,IAAIyD,EACAE,EAEAxP,EAAKyI,EAAMnF,MAAMhD,WAAWmI,EAAM5D,UAEtC,GAAW,KAAP7E,EACF,OAAO,EAQT,IALAyI,EAAMpM,KAAO,SACboM,EAAM/O,OAAS,GACf+O,EAAM5D,WACNyK,EAAeE,EAAa/G,EAAM5D,SAEuB,KAAjD7E,EAAKyI,EAAMnF,MAAMhD,WAAWmI,EAAM5D,YACxC,GAAW,KAAP7E,EAAoB,CAItB,GAHAkK,EAAezB,EAAO6G,EAAc7G,EAAM5D,UAAU,GAGzC,MAFX7E,EAAKyI,EAAMnF,MAAMhD,aAAamI,EAAM5D,WAOlC,OAAO,EAJPyK,EAAe7G,EAAM5D,SACrB4D,EAAM5D,WACN2K,EAAa/G,EAAM5D,QAIvB,MAAW0B,EAAMvG,IACfkK,EAAezB,EAAO6G,EAAcE,GAAY,GAChD7D,EAAiBlD,EAAO6C,EAAoB7C,GAAO,EAAOoD,IAC1DyD,EAAeE,EAAa/G,EAAM5D,UACzB4D,EAAM5D,WAAa4D,EAAM9D,WAAa+G,EAAsBjD,GACrEC,EAAWD,EAAO,iEAElBA,EAAM5D,WACD2B,EAAaxG,KAChBwP,EAAa/G,EAAM5D,WAKzB6D,EAAWD,EAAO,6DACpB,CAq0BYgH,CAAuBhH,EAAO2D,IAn0B1C,SAAiC3D,EAAOoD,GACtC,IAAIyD,EACAE,EACAT,EAEA/O,EAAKyI,EAAMnF,MAAMhD,WAAWmI,EAAM5D,UAEtC,GAAW,KAAP7E,EACF,OAAO,EAQT,IALAyI,EAAMpM,KAAO,SACboM,EAAM/O,OAAS,GACf+O,EAAM5D,WACNyK,EAAeE,EAAa/G,EAAM5D,SAEuB,KAAjD7E,EAAKyI,EAAMnF,MAAMhD,WAAWmI,EAAM5D,YAAkB,CAC1D,GAAW,KAAP7E,EAGF,OAFAkK,EAAezB,EAAO6G,EAAc7G,EAAM5D,UAAU,GACpD4D,EAAM5D,YACC,EACT,GAAkB,KAAP7E,EAAoB,CAI7B,GAHAkK,EAAezB,EAAO6G,EAAc7G,EAAM5D,UAAU,GAGhD0B,EAFJvG,EAAKyI,EAAMnF,MAAMhD,aAAamI,EAAM5D,WAGlCyG,EAAoB7C,GAAO,EAAOoD,WAGzB7L,EAAK,KAAOuH,EAAkBvH,GACvCyI,EAAM/O,QAAU8N,EAAgBxH,GAChCyI,EAAM5D,oBACIkK,EAAMlI,EAAc7G,IAAO,EAAG,CAIxC,IAHA,IAAI0P,EAAYX,EACZY,EAAY,EAETD,EAAY,EAAGA,KAGfX,EAAMpI,EAFX3G,EAAKyI,EAAMnF,MAAMhD,aAAamI,EAAM5D,aAEL,EAC7B8K,GAAaA,GAAa,GAAKZ,EAE/BrG,EAAWD,EAAO,kCAItBA,EAAM/O,QAAUsN,EAAkB2I,GAElClH,EAAM5D,UACR,MACE6D,EAAWD,EAAO,2BAGpB6G,EAAeE,EAAa/G,EAAM5D,QACpC,MAAW0B,EAAMvG,IACfkK,EAAezB,EAAO6G,EAAcE,GAAY,GAChD7D,EAAiBlD,EAAO6C,EAAoB7C,GAAO,EAAOoD,IAC1DyD,EAAeE,EAAa/G,EAAM5D,UACzB4D,EAAM5D,WAAa4D,EAAM9D,WAAa+G,EAAsBjD,GACrEC,EAAWD,EAAO,iEAElBA,EAAM5D,WACD2B,EAAaxG,KAChBwP,EAAa/G,EAAM5D,UAGzB,CAEA6D,EAAWD,EAAO,6DACpB,CA+vBYmH,CAAuBnH,EAAO2D,GAHhC+B,GAAa,GAjKvB,SAAoB1F,GAClB,IAAIzI,EAAKyI,EAAMnF,MAAMhD,WAAWmI,EAAM5D,UAEtC,GAAW,KAAP7E,EAAoB,OAAO,EAE/BA,EAAKyI,EAAMnF,MAAMhD,aAAamI,EAAM5D,UAGpC,IAFA,IAAM0F,EAAY9B,EAAM5D,SAEV,IAAP7E,IAAayG,EAAUzG,KAAQ0G,EAAgB1G,IACpDA,EAAKyI,EAAMnF,MAAMhD,aAAamI,EAAM5D,UAGlC4D,EAAM5D,WAAa0F,GACrB7B,EAAWD,EAAO,6DAGpB,IAAMxL,EAAQwL,EAAMnF,MAAMrD,MAAMsK,EAAW9B,EAAM5D,UAQjD,OANKlB,EAAgBrI,KAAKmN,EAAMO,UAAW/L,IACzCyL,EAAWD,EAAO,uBAAyBxL,EAAQ,KAGrDwL,EAAM/O,OAAS+O,EAAMO,UAAU/L,GAC/BqO,EAAoB7C,GAAO,GAAM,IAC1B,CACT,CA6ImBoH,CAAUpH,GAz9B7B,SAA0BA,EAAOoD,EAAYiE,GAC3C,IAAIR,EACAE,EACAO,EACA9D,EACAqC,EACA0B,EACEC,EAAQxH,EAAMpM,KACdiO,EAAU7B,EAAM/O,OAElBsG,EAAKyI,EAAMnF,MAAMhD,WAAWmI,EAAM5D,UAEtC,GAAI4B,EAAUzG,IACV0G,EAAgB1G,IACT,KAAPA,GACO,KAAPA,GACO,KAAPA,GACO,KAAPA,GACO,MAAPA,GACO,KAAPA,GACO,KAAPA,GACO,KAAPA,GACO,KAAPA,GACO,KAAPA,GACO,KAAPA,EACF,OAAO,EAGT,GAAW,KAAPA,GAA6B,KAAPA,EAAoB,CAC5C,IAAM0M,EAAYjE,EAAMnF,MAAMhD,WAAWmI,EAAM5D,SAAW,GAE1D,GAAI4B,EAAUiG,IACToD,GAAwBpJ,EAAgBgG,GAC3C,OAAO,CAEX,CAOA,IALAjE,EAAMpM,KAAO,SACboM,EAAM/O,OAAS,GACf4V,EAAeE,EAAa/G,EAAM5D,SAClCkL,GAAoB,EAEN,IAAP/P,GAAU,CACf,GAAW,KAAPA,EAAoB,CACtB,IAAM0M,EAAYjE,EAAMnF,MAAMhD,WAAWmI,EAAM5D,SAAW,GAE1D,GAAI4B,EAAUiG,IACToD,GAAwBpJ,EAAgBgG,GAC3C,KAEJ,MAAA,GAAkB,KAAP1M,GAGT,GAAIyG,EAFcgC,EAAMnF,MAAMhD,WAAWmI,EAAM5D,SAAW,IAGxD,cAEQ4D,EAAM5D,WAAa4D,EAAM9D,WAAa+G,EAAsBjD,IAC5DqH,GAAwBpJ,EAAgB1G,GAClD,MACF,GAAWuG,EAAMvG,GAAK,CAMpB,GALAiM,EAAQxD,EAAMxN,KACdqT,EAAa7F,EAAM9D,UACnBqL,EAAcvH,EAAMP,WACpBoD,EAAoB7C,GAAO,GAAO,GAE9BA,EAAMP,YAAc2D,EAAY,CAClCkE,GAAoB,EACpB/P,EAAKyI,EAAMnF,MAAMhD,WAAWmI,EAAM5D,UAClC,QACF,CACE4D,EAAM5D,SAAW2K,EACjB/G,EAAMxN,KAAOgR,EACbxD,EAAM9D,UAAY2J,EAClB7F,EAAMP,WAAa8H,EACnB,KAEJ,EAEID,IACF7F,EAAezB,EAAO6G,EAAcE,GAAY,GAChD7D,EAAiBlD,EAAOA,EAAMxN,KAAOgR,GACrCqD,EAAeE,EAAa/G,EAAM5D,SAClCkL,GAAoB,GAGjBvJ,EAAaxG,KAChBwP,EAAa/G,EAAM5D,SAAW,GAGhC7E,EAAKyI,EAAMnF,MAAMhD,aAAamI,EAAM5D,SACtC,CAIA,OAFAqF,EAAezB,EAAO6G,EAAcE,GAAY,KAE5C/G,EAAM/O,SAIV+O,EAAMpM,KAAO4T,EACbxH,EAAM/O,OAAS4Q,GACR,EACT,CA03BmB4F,CAAgBzH,EAAO2D,EAl/ClB,IAk/CkDwB,KAChEO,GAAa,EAEK,OAAd1F,EAAMzM,MACRyM,EAAMzM,IAAM,OATdmS,GAAa,EAEK,OAAd1F,EAAMzM,KAAiC,OAAjByM,EAAMS,QAC9BR,EAAWD,EAAO,8CAUD,OAAjBA,EAAMS,QACRN,EAAYH,EAAOA,EAAMS,OAAQT,EAAM/O,OAE3C,MAC0B,IAAjBuU,IAGTE,EAAaJ,GAAyBnC,EAAkBnD,EAAOuF,IAInE,GAAkB,OAAdvF,EAAMzM,IACa,OAAjByM,EAAMS,QACRN,EAAYH,EAAOA,EAAMS,OAAQT,EAAM/O,aAE3C,GAAyB,MAAd+O,EAAMzM,IAAa,CAOP,OAAjByM,EAAM/O,QAAkC,WAAf+O,EAAMpM,MACjCqM,EAAWD,EAAO,oEAAsEA,EAAMpM,KAAO,KAGvG,IAAA,IAAS8T,EAAY,EAAGC,EAAe3H,EAAMT,cAAczN,OAAQ4V,EAAYC,EAAcD,GAAa,EAGxG,IAFApU,EAAO0M,EAAMT,cAAcmI,IAElB7T,QAAQmM,EAAM/O,QAAS,CAC9B+O,EAAM/O,OAASqC,EAAKQ,UAAUkM,EAAM/O,QACpC+O,EAAMzM,IAAMD,EAAKC,IACI,OAAjByM,EAAMS,QACRN,EAAYH,EAAOA,EAAMS,OAAQT,EAAM/O,QAEzC,KACF,CAEJ,MAAA,GAAyB,MAAd+O,EAAMzM,IAAa,CAC5B,GAAI2H,EAAgBrI,KAAKmN,EAAMR,QAAQQ,EAAMpM,MAAQ,YAAaoM,EAAMzM,KACtED,EAAO0M,EAAMR,QAAQQ,EAAMpM,MAAQ,YAAYoM,EAAMzM,SAChD,CAELD,EAAO,KAGP,IAFA,IAAMsU,EAAW5H,EAAMR,QAAQnL,MAAM2L,EAAMpM,MAAQ,YAE1C8T,EAAY,EAAGC,EAAeC,EAAS9V,OAAQ4V,EAAYC,EAAcD,GAAa,EAC7F,GAAI1H,EAAMzM,IAAIiE,MAAM,EAAGoQ,EAASF,GAAWnU,IAAIzB,UAAY8V,EAASF,GAAWnU,IAAK,CAClFD,EAAOsU,EAASF,GAChB,KACF,CAEJ,CAEKpU,GACH2M,EAAWD,EAAO,iBAAmBA,EAAMzM,IAAM,KAG9B,OAAjByM,EAAM/O,QAAmBqC,EAAKM,OAASoM,EAAMpM,MAC/CqM,EAAWD,EAAO,gCAAkCA,EAAMzM,IAAM,wBAA0BD,EAAKM,KAAO,WAAaoM,EAAMpM,KAAO,KAG7HN,EAAKO,QAAQmM,EAAM/O,OAAQ+O,EAAMzM,MAGpCyM,EAAM/O,OAASqC,EAAKQ,UAAUkM,EAAM/O,OAAQ+O,EAAMzM,KAC7B,OAAjByM,EAAMS,QACRN,EAAYH,EAAOA,EAAMS,OAAQT,EAAM/O,SAJzCgP,EAAWD,EAAO,gCAAkCA,EAAMzM,IAAM,iBAOpE,CAOA,OALuB,OAAnByM,EAAMZ,UACRY,EAAMZ,SAAS,QAASY,GAG1BA,EAAMN,OAAS,EACM,OAAdM,EAAMzM,KAAiC,OAAjByM,EAAMS,QAAmBiF,CACxD,CAEA,SAASmC,EAAc7H,GACrB,IAEIzI,EAFEuQ,EAAgB9H,EAAM5D,SACxB2L,GAAgB,EAQpB,IALA/H,EAAMe,QAAU,KAChBf,EAAMkB,gBAAkBlB,EAAMb,OAC9Ba,EAAMsB,OAAS3P,OAAOsB,OAAO,MAC7B+M,EAAMO,UAAY5O,OAAOsB,OAAO,MAEyB,KAAjDsE,EAAKyI,EAAMnF,MAAMhD,WAAWmI,EAAM5D,aACxCyG,EAAoB7C,GAAO,GAAM,GAEjCzI,EAAKyI,EAAMnF,MAAMhD,WAAWmI,EAAM5D,YAE9B4D,EAAMP,WAAa,GAAY,KAAPlI,KAL8B,CAS1DwQ,GAAgB,EAChBxQ,EAAKyI,EAAMnF,MAAMhD,aAAamI,EAAM5D,UAGpC,IAFA,IAAI0F,EAAY9B,EAAM5D,SAER,IAAP7E,IAAayG,EAAUzG,IAC5BA,EAAKyI,EAAMnF,MAAMhD,aAAamI,EAAM5D,UAGtC,IAAM4L,EAAgBhI,EAAMnF,MAAMrD,MAAMsK,EAAW9B,EAAM5D,UACnD6L,EAAgB,GAMtB,IAJID,EAAclW,OAAS,GACzBmO,EAAWD,EAAO,gEAGN,IAAPzI,GAAU,CACf,KAAOwG,EAAaxG,IAClBA,EAAKyI,EAAMnF,MAAMhD,aAAamI,EAAM5D,UAGtC,GAAW,KAAP7E,EAAoB,CACtB,GAAKA,EAAKyI,EAAMnF,MAAMhD,aAAamI,EAAM5D,gBAC3B,IAAP7E,IAAauG,EAAMvG,IAC1B,KACF,CAEA,GAAIuG,EAAMvG,GAAK,MAIf,IAFAuK,EAAY9B,EAAM5D,SAEJ,IAAP7E,IAAayG,EAAUzG,IAC5BA,EAAKyI,EAAMnF,MAAMhD,aAAamI,EAAM5D,UAGtC6L,EAAc3S,KAAK0K,EAAMnF,MAAMrD,MAAMsK,EAAW9B,EAAM5D,UACxD,CAEW,IAAP7E,GAAUqL,EAAc5C,GAExB9E,EAAgBrI,KAAK+N,EAAmBoH,GAC1CpH,EAAkBoH,GAAehI,EAAOgI,EAAeC,GAEvD/H,EAAaF,EAAO,+BAAiCgI,EAAgB,IAEzE,CAEAnF,EAAoB7C,GAAO,GAAM,GAER,IAArBA,EAAMP,YACqC,KAA3CO,EAAMnF,MAAMhD,WAAWmI,EAAM5D,WACkB,KAA/C4D,EAAMnF,MAAMhD,WAAWmI,EAAM5D,SAAW,IACO,KAA/C4D,EAAMnF,MAAMhD,WAAWmI,EAAM5D,SAAW,IAC1C4D,EAAM5D,UAAY,EAClByG,EAAoB7C,GAAO,GAAM,IACxB+H,GACT9H,EAAWD,EAAO,mCAGpByD,EAAYzD,EAAOA,EAAMP,WAAa,EAppDd,GAopDoC,GAAO,GACnEoD,EAAoB7C,GAAO,GAAM,GAE7BA,EAAMkB,iBACNzD,EAA8BhF,KAAKuH,EAAMnF,MAAMrD,MAAMsQ,EAAe9H,EAAM5D,YAC5E8D,EAAaF,EAAO,oDAGtBA,EAAMH,UAAUvK,KAAK0K,EAAM/O,QAEvB+O,EAAM5D,WAAa4D,EAAM9D,WAAa+G,EAAsBjD,GACf,KAA3CA,EAAMnF,MAAMhD,WAAWmI,EAAM5D,YAC/B4D,EAAM5D,UAAY,EAClByG,EAAoB7C,GAAO,GAAM,IAKjCA,EAAM5D,SAAY4D,EAAMlO,OAAS,GACnCmO,EAAWD,EAAO,wDAEtB,CAEA,SAASkI,EAAerN,EAAOrH,GAE7BA,EAAUA,GAAW,CAAA,EAEA,KAHrBqH,EAAQpG,OAAOoG,IAGL/I,SAEmC,KAAvC+I,EAAMhD,WAAWgD,EAAM/I,OAAS,IACO,KAAvC+I,EAAMhD,WAAWgD,EAAM/I,OAAS,KAClC+I,GAAS,MAIiB,QAAxBA,EAAMhD,WAAW,KACnBgD,EAAQA,EAAMrD,MAAM,KAIxB,IAAMwI,EAAQ,IAAIhB,EAAMnE,EAAOrH,GAEzB2U,EAAUtN,EAAMlH,QAAQ,MAU9B,KARgB,IAAZwU,IACFnI,EAAM5D,SAAW+L,EACjBlI,EAAWD,EAAO,sCAIpBA,EAAMnF,OAAS,KAEmC,KAA3CmF,EAAMnF,MAAMhD,WAAWmI,EAAM5D,WAClC4D,EAAMP,YAAc,EACpBO,EAAM5D,UAAY,EAGpB,KAAO4D,EAAM5D,SAAY4D,EAAMlO,OAAS,GACtC+V,EAAa7H,GAGf,OAAOA,EAAMH,SACf,QA8BAuI,EAAAC,QA5BA,SAAkBxN,EAAO1K,EAAUqD,GAChB,OAAbrD,GAAyC,WAApBH,EAAOG,SAA4C,IAAZqD,IAC9DA,EAAUrD,EACVA,EAAW,MAGb,IAAM0P,EAAYqI,EAAcrN,EAAOrH,GAEvC,GAAwB,mBAAbrD,EACT,OAAO0P,EAGT,IAAA,IAAShO,EAAQ,EAAGC,EAAS+N,EAAU/N,OAAQD,EAAQC,EAAQD,GAAS,EACtE1B,EAAS0P,EAAUhO,GAEvB,EAcAuW,EAAAE,KAZA,SAAezN,EAAOrH,GACpB,IAAMqM,EAAYqI,EAAcrN,EAAOrH,GAEvC,GAAyB,IAArBqM,EAAU/N,OAAd,CAEA,GAAgC,IAArB+N,EAAU/N,OACnB,OAAO+N,EAAU,GAEnB,MAAM,IAAIlN,EAAc,2DADxB,CAEF,kDE1vDY,SAAA3C,EAAAC,GAAA,OAAAD,EAAA,mBAAAE,QAAA,iBAAAA,OAAAC,SAAA,SAAAF,GAAA,cAAAA,GAAA,SAAAA,GAAA,OAAAA,GAAA,mBAAAC,QAAAD,EAAAG,cAAAF,QAAAD,IAAAC,OAAAG,UAAA,gBAAAJ,CAAA,GAAAA,EAAA,MAEZ,IAAMO,EAAS2C,IACTR,EAAgBgC,IAChB4I,EAAiBlH,KAEjB+E,EAAYzJ,OAAOtB,UAAU6C,SAC7BgI,EAAkBvJ,OAAOtB,UAAU8K,eAEnCoN,EAAW,MA0BXC,EAAmB,CAEzBA,EAAyB,MACzBA,EAAyB,MACzBA,EAAyB,MACzBA,EAAyB,MACzBA,GAAyB,MACzBA,GAAyB,MACzBA,GAAyB,MACzBA,GAAyB,MACzBA,GAAyB,MACzBA,GAAyB,MACzBA,GAAyB,OACzBA,IAAyB,MACzBA,IAAyB,MACzBA,KAA2B,MAC3BA,KAA2B,OAErBC,EAA6B,CACjC,IAAK,IAAK,MAAO,MAAO,MAAO,KAAM,KAAM,KAC3C,IAAK,IAAK,KAAM,KAAM,KAAM,MAAO,MAAO,OAGtCC,EAA2B,4CA2BjC,SAASC,EAAWC,GAClB,IAAIvH,EACAvP,EAEEf,EAAS6X,EAAU1V,SAAS,IAAIiF,cAEtC,GAAIyQ,GAAa,IACfvH,EAAS,IACTvP,EAAS,OACX,GAAW8W,GAAa,MACtBvH,EAAS,IACTvP,EAAS,MACX,MAAW8W,GAAa,YAItB,MAAM,IAAIjW,EAAc,iEAHxB0O,EAAS,IACTvP,EAAS,CAGX,CAEA,MAAO,KAAOuP,EAAS7Q,EAAOM,OAAO,IAAKgB,EAASf,EAAOe,QAAUf,CACtE,CAKA,SAASiO,EAAOxL,GACdV,KAAK+B,OAASrB,EAAgB,QAAK+J,EACnCzK,KAAK+J,OAASL,KAAKhG,IAAI,EAAIhD,EAAgB,QAAK,GAChDV,KAAK+V,cAAgBrV,EAAuB,gBAAK,EACjDV,KAAKgW,YAActV,EAAqB,cAAK,EAC7CV,KAAKiW,UAAavY,EAAOF,UAAUkD,EAAmB,YAAK,EAAKA,EAAmB,UACnFV,KAAKkW,SAxDP,SAA0BnU,EAAQpB,GAChC,GAAY,OAARA,EAAc,MAAO,CAAA,EAKzB,IAHA,IAAMxC,EAAS,CAAA,EACTW,EAAOD,OAAOC,KAAK6B,GAEhB5B,EAAQ,EAAGC,EAASF,EAAKE,OAAQD,EAAQC,EAAQD,GAAS,EAAG,CACpE,IAAI0B,EAAM3B,EAAKC,GACX0C,EAAQE,OAAOhB,EAAIF,IAEC,OAApBA,EAAIiE,MAAM,EAAG,KACfjE,EAAM,qBAAuBA,EAAIiE,MAAM,IAEzC,IAAMlE,EAAOuB,EAAOc,gBAA0B,SAAEpC,GAE5CD,GAAQ4H,EAAgBrI,KAAKS,EAAKgB,aAAcC,KAClDA,EAAQjB,EAAKgB,aAAaC,IAG5BtD,EAAOsC,GAAOgB,CAChB,CAEA,OAAOtD,CACT,CAiCkBgY,CAAgBnW,KAAK+B,OAAQrB,EAAgB,QAAK,MAClEV,KAAKoW,SAAW1V,EAAkB,WAAK,EACvCV,KAAKqW,UAAY3V,EAAmB,WAAK,GACzCV,KAAKsW,OAAS5V,EAAgB,SAAK,EACnCV,KAAKuW,aAAe7V,EAAsB,eAAK,EAC/CV,KAAKwW,aAAe9V,EAAsB,eAAK,EAC/CV,KAAKyW,YAAyC,MAA3B/V,EAAqB,YAdd,EADA,EAgB1BV,KAAK0W,YAAchW,EAAqB,cAAK,EAC7CV,KAAK2W,SAA0C,mBAAxBjW,EAAkB,SAAmBA,EAAkB,SAAI,KAElFV,KAAKyM,cAAgBzM,KAAK+B,OAAOY,iBACjC3C,KAAK4W,cAAgB5W,KAAK+B,OAAOa,iBAEjC5C,KAAKS,IAAM,KACXT,KAAK7B,OAAS,GAEd6B,KAAK6W,WAAa,GAClB7W,KAAK8W,eAAiB,IACxB,CAGA,SAASC,EAAc9Y,EAAQ+Y,GAM7B,IALA,IAAMC,EAAMvZ,EAAOM,OAAO,IAAKgZ,GAC3B1N,EAAW,EACXnL,EAAS,GACPa,EAASf,EAAOe,OAEfsK,EAAWtK,GAAQ,CACxB,IAAIU,OAAI,EACFwX,EAAOjZ,EAAO4C,QAAQ,KAAMyI,IACrB,IAAT4N,GACFxX,EAAOzB,EAAOyG,MAAM4E,GACpBA,EAAWtK,IAEXU,EAAOzB,EAAOyG,MAAM4E,EAAU4N,EAAO,GACrC5N,EAAW4N,EAAO,GAGhBxX,EAAKV,QAAmB,OAATU,IAAevB,GAAU8Y,GAE5C9Y,GAAUuB,CACZ,CAEA,OAAOvB,CACT,CAEA,SAASgZ,EAAkBjK,EAAOkK,GAChC,MAAO,KAAO1Z,EAAOM,OAAO,IAAKkP,EAAMnD,OAASqN,EAClD,CAeA,SAASC,EAAclT,GACrB,OAvKiB,KAuKVA,GA1KQ,IA0KYA,CAC7B,CAMA,SAASmT,EAAanT,GACpB,OAAQA,GAAK,IAAWA,GAAK,KACzBA,GAAK,KAAWA,GAAK,OAAmB,OAANA,GAAsB,OAANA,GAClDA,GAAK,OAAWA,GAAK,OAAaA,IAAMsR,GACzCtR,GAAK,OAAWA,GAAK,OAC1B,CAOA,SAASoT,EAAsBpT,GAC7B,OAAOmT,EAAYnT,IACjBA,IAAMsR,GA7LmB,KA+LzBtR,GAhMmB,KAiMnBA,CACJ,CAWA,SAASqT,EAAarT,EAAGsT,EAAMC,GAC7B,IAAMC,EAAwBJ,EAAqBpT,GAC7CyT,EAAYD,IAA0BN,EAAalT,GACzD,OAGIuT,EACIC,EACAA,GA3MS,KA6MTxT,GAtMuB,KAuMvBA,GAtMwB,KAuMxBA,GArMsB,MAsMtBA,GApMuB,MAqMvBA,IAtNS,KAyNfA,KAlNe,KAmNbsT,IAAwBG,IAE3BL,EAAqBE,KAAUJ,EAAaI,IA5N5B,KA4NqCtT,GArNrC,KAsNhBsT,GAAuBG,CAC1B,CA2CA,SAASC,EAAa5Z,EAAQ2L,GAC5B,IACIxC,EADE0Q,EAAQ7Z,EAAO8G,WAAW6E,GAGhC,OAAIkO,GAAS,OAAUA,GAAS,OAAUlO,EAAM,EAAI3L,EAAOe,SACzDoI,EAASnJ,EAAO8G,WAAW6E,EAAM,KACnB,OAAUxC,GAAU,MAEN,MAAlB0Q,EAAQ,OAAkB1Q,EAAS,MAAS,MAGjD0Q,CACT,CAGA,SAASC,EAAqB9Z,GAE5B,MADuB,QACD0H,KAAK1H,EAC7B,CAeA,SAAS+Z,EAAmB/Z,EAAQga,EAAgBC,EAAgB7B,EAClE8B,EAAmB1B,EAAaC,EAAagB,GAC7C,IAAIlN,EA3EqBrG,EA4ErBiU,EAAO,EACPC,EAAW,KACXC,GAAe,EACfC,GAAkB,EAChBC,GAAiC,IAAdnC,EACrBoC,GAAoB,EACpBC,EA9EGpB,EAJkBnT,EAkFI0T,EAAY5Z,EAAQ,KA7E/CkG,IAAMsR,IACL4B,EAAalT,IAjOC,KAoOfA,GAhOkB,KAiOlBA,GApOe,KAqOfA,GAvOe,KAwOfA,GAjO6B,KAkO7BA,GAjO8B,KAkO9BA,GAhO4B,MAiO5BA,GA/N6B,MAgO7BA,GAjPe,KAmPfA,GAjPmB,KAkPnBA,GAhPkB,KAiPlBA,GAvPqB,KAwPrBA,GAtOuB,MAuOvBA,GA/OgB,KAgPhBA,GA/OsB,KAgPtBA,GAtPsB,KAuPtBA,GA3PsB,KA4PtBA,GA1PiB,KA4PjBA,GAlPuB,KAmPvBA,GAhPsB,KAiPtBA,GAIJ,SAA0BA,GAExB,OAAQkT,EAAalT,IA9PJ,KA8PUA,CAC7B,CA8CIwU,CAAgBd,EAAY5Z,EAAQA,EAAOe,OAAS,IAEtD,GAAIiZ,GAAkBvB,EAGpB,IAAKlM,EAAI,EAAGA,EAAIvM,EAAOe,OAAQoZ,GAAQ,MAAU5N,GAAK,EAAIA,IAAK,CAE7D,IAAK8M,EADLc,EAAOP,EAAY5Z,EAAQuM,IAEzB,OA3Ba,EA6BfkO,EAAQA,GAASlB,EAAYY,EAAMC,EAAUX,GAC7CW,EAAWD,CACb,KACK,CAEL,IAAK5N,EAAI,EAAGA,EAAIvM,EAAOe,OAAQoZ,GAAQ,MAAU5N,GAAK,EAAIA,IAAK,CAE7D,GA1UiB,MAyUjB4N,EAAOP,EAAY5Z,EAAQuM,IAEzB8N,GAAe,EAEXE,IACFD,EAAkBA,GAEf/N,EAAIiO,EAAoB,EAAIpC,GACM,MAAlCpY,EAAOwa,EAAoB,GAC9BA,EAAoBjO,QAExB,IAAY8M,EAAYc,GACtB,OA/Ca,EAiDfM,EAAQA,GAASlB,EAAYY,EAAMC,EAAUX,GAC7CW,EAAWD,CACb,CAEAG,EAAkBA,GAAoBC,GACnChO,EAAIiO,EAAoB,EAAIpC,GACM,MAAlCpY,EAAOwa,EAAoB,EAChC,CAIA,OAAKH,GAAiBC,EASlBL,EAAiB,GAAKH,EAAoB9Z,GArE3B,EA0EdyY,EA/QqB,IAkRnBD,EA7EY,EAHA,EA8EV8B,EA5EU,EADC,GAiEdG,GAAUhC,GAAgByB,EAAkBla,GApQxB,IAuQjBwY,EAlEU,EAHA,EADD,CAkFpB,CAQA,SAASmC,EAAa1L,EAAOjP,EAAQmZ,EAAOyB,EAAOnB,GACjDxK,EAAM4L,gBACJ,GAAsB,IAAlB7a,EAAOe,OACT,OA9RsB,IA8RfkO,EAAMuJ,YAAsC,KAAO,KAE5D,IAAKvJ,EAAMqJ,oBACLZ,EAA2B9U,QAAQ5C,IAAkB2X,EAAyBjQ,KAAK1H,IACrF,OAlSoB,IAkSbiP,EAAMuJ,YAAuC,IAAMxY,EAAS,IAAQ,IAAMA,EAAS,IAI9F,IAAM8L,EAASmD,EAAMnD,OAASL,KAAKhG,IAAI,EAAG0T,GAQpCf,GAAiC,IAApBnJ,EAAMmJ,aAErB3M,KAAKhG,IAAIgG,KAAKa,IAAI2C,EAAMmJ,UAAW,IAAKnJ,EAAMmJ,UAAYtM,GAGxDkO,EAAiBY,GAEpB3L,EAAM+I,WAAY,GAAMmB,GAASlK,EAAM+I,UAK1C,OAAQ+B,EAAkB/Z,EAAQga,EAAgB/K,EAAMnD,OAAQsM,EAJhE,SAAwBpY,GACtB,OA7PN,SAAgCiP,EAAO9J,GACrC,IAAA,IAASrE,EAAQ,EAAGC,EAASkO,EAAMT,cAAczN,OAAQD,EAAQC,EAAQD,GAAS,EAGhF,GAFamO,EAAMT,cAAc1N,GAExBgC,QAAQqC,GACf,OAAO,EAIX,OAAO,CACT,CAmPa2V,CAAsB7L,EAAOjP,EACtC,EAGiBiP,EAAMuJ,YAAavJ,EAAMwJ,cAAgBmC,EAAOnB,IAC/D,KA3Hc,EA4HZ,OAAOzZ,EACT,KA5He,EA6Hb,MAAO,IAAMA,EAAOiI,QAAQ,KAAM,MAAQ,IAC5C,KA7HgB,EA8Hd,MAAO,IAAM8S,EAAY/a,EAAQiP,EAAMnD,QACrCkP,EAAkBlC,EAAa9Y,EAAQ8L,IAC3C,KA/He,EAgIb,MAAO,IAAMiP,EAAY/a,EAAQiP,EAAMnD,QACrCkP,EAAkBlC,EA4B5B,SAAqB9Y,EAAQib,GAK3B,IAWIC,EAGAvS,EAdEwS,EAAS,iBAGXjb,GACEkb,EAASpb,EAAO4C,QAAQ,MAC5BwY,GAAoB,IAAXA,EAAgBA,EAASpb,EAAOe,OACzCoa,EAAOE,UAAYD,EACZE,EAAStb,EAAOyG,MAAM,EAAG2U,GAASH,IAGvCM,EAAiC,OAAdvb,EAAO,IAA6B,MAAdA,EAAO,OAN9Cob,EAWN,KAAQzS,EAAQwS,EAAO3S,KAAKxI,IAAU,CACpC,IAAMqQ,EAAS1H,EAAM,GACflH,EAAOkH,EAAM,GAEnBuS,EAA4B,MAAZzZ,EAAK,GACrBvB,GAAUmQ,GACLkL,GAAqBL,GAAyB,KAATzZ,EAAsB,GAAP,MACvD6Z,EAAS7Z,EAAMwZ,GACjBM,EAAmBL,CACrB,CAEA,OAAOhb,CACT,CA5DyCsb,CAAWxb,EAAQoY,GAAYtM,IAClE,KAjIe,EAkIb,MAAO,IA2Gf,SAAuB9L,GAIrB,IAHA,IAAIE,EAAS,GACTia,EAAO,EAEF5N,EAAI,EAAGA,EAAIvM,EAAOe,OAAQoZ,GAAQ,MAAU5N,GAAK,EAAIA,IAAK,CACjE4N,EAAOP,EAAY5Z,EAAQuM,GAC3B,IAAMkP,EAAYhE,EAAiB0C,IAE9BsB,GAAapC,EAAYc,IAC5Bja,GAAUF,EAAOuM,GACb4N,GAAQ,QAASja,GAAUF,EAAOuM,EAAI,KAE1CrM,GAAUub,GAAa7D,EAAUuC,EAErC,CAEA,OAAOja,CACT,CA5HqBwb,CAAa1b,GAAqB,IACjD,QACE,MAAM,IAAI4B,EAAc,0CAE9B,GACF,CAGA,SAASmZ,EAAa/a,EAAQia,GAC5B,IAAM0B,EAAkB7B,EAAoB9Z,GAAU0D,OAAOuW,GAAkB,GAGzE2B,EAAqC,OAA9B5b,EAAOA,EAAOe,OAAS,GAIpC,OAAO4a,GAHMC,IAAuC,OAA9B5b,EAAOA,EAAOe,OAAS,IAA0B,OAAXf,GACvC,IAAO4b,EAAO,GAAK,KAEP,IACnC,CAGA,SAASZ,EAAmBhb,GAC1B,MAAqC,OAA9BA,EAAOA,EAAOe,OAAS,GAAcf,EAAOyG,MAAM,GAAG,GAAMzG,CACpE,CA0CA,SAASsb,EAAU7Z,EAAMwZ,GACvB,GAAa,KAATxZ,GAA2B,MAAZA,EAAK,GAAY,OAAOA,EAgB3C,IAbA,IACIkH,EAGAiI,EAJEiL,EAAU,SAGZlL,EAAQ,EAERmL,EAAO,EACP7C,EAAO,EACP/Y,EAAS,GAMLyI,EAAQkT,EAAQrT,KAAK/G,KAC3BwX,EAAOtQ,EAAM7H,OAEF6P,EAAQsK,IACjBrK,EAAOkL,EAAOnL,EAASmL,EAAO7C,EAC9B/Y,GAAU,KAAOuB,EAAKgF,MAAMkK,EAAOC,GAEnCD,EAAQC,EAAM,GAEhBkL,EAAO7C,EAaT,OARA/Y,GAAU,KAENuB,EAAKV,OAAS4P,EAAQsK,GAASa,EAAOnL,EACxCzQ,GAAUuB,EAAKgF,MAAMkK,EAAOmL,GAAQ,KAAOra,EAAKgF,MAAMqV,EAAO,GAE7D5b,GAAUuB,EAAKgF,MAAMkK,GAGhBzQ,EAAOuG,MAAM,EACtB,CA8CA,SAASsV,EAAoB9M,EAAOkK,EAAOzT,EAAQvE,GAIjD,IAHA,IAAI2P,EAAU,GACRwB,EAAOrD,EAAMzM,IAEV1B,EAAQ,EAAGC,EAAS2E,EAAO3E,OAAQD,EAAQC,EAAQD,GAAS,EAAG,CACtE,IAAIwF,EAAQZ,EAAO5E,GAEfmO,EAAMyJ,WACRpS,EAAQ2I,EAAMyJ,SAAS5W,KAAK4D,EAAQhC,OAAO5C,GAAQwF,KAIjD0V,EAAU/M,EAAOkK,EAAQ,EAAG7S,GAAO,GAAM,GAAM,GAAO,SACpC,IAAVA,GACP0V,EAAU/M,EAAOkK,EAAQ,EAAG,MAAM,GAAM,GAAM,GAAO,MACnDhY,GAAuB,KAAZ2P,IACdA,GAAWoI,EAAiBjK,EAAOkK,IAGjClK,EAAM4L,MAjlBO,KAilBoB5L,EAAM4L,KAAK/T,WAAW,GACzDgK,GAAW,IAEXA,GAAW,KAGbA,GAAW7B,EAAM4L,KAErB,CAEA5L,EAAMzM,IAAM8P,EACZrD,EAAM4L,KAAO/J,GAAW,IAC1B,CAkHA,SAASmL,EAAYhN,EAAOvJ,EAAQpB,GAGlC,IAFA,IAAMuS,EAAWvS,EAAW2K,EAAM0J,cAAgB1J,EAAMT,cAE/C1N,EAAQ,EAAGC,EAAS8V,EAAS9V,OAAQD,EAAQC,EAAQD,GAAS,EAAG,CACxE,IAAMyB,EAAOsU,EAAS/V,GAEtB,IAAKyB,EAAKU,YAAcV,EAAKW,cACvBX,EAAKU,YAAkC,WAAlBhE,EAAOyG,IAAyBA,aAAkBnD,EAAKU,eAC5EV,EAAKW,WAAaX,EAAKW,UAAUwC,IAAU,CAW/C,GAVIpB,EACE/B,EAAKe,OAASf,EAAKa,cACrB6L,EAAMzM,IAAMD,EAAKa,cAAcsC,GAE/BuJ,EAAMzM,IAAMD,EAAKC,IAGnByM,EAAMzM,IAAM,IAGVD,EAAKY,UAAW,CAClB,IAAMK,EAAQyL,EAAMgJ,SAAS1V,EAAKC,MAAQD,EAAKc,aAE3CyN,OAAO,EACX,GAAuC,sBAAnCzG,EAAUvI,KAAKS,EAAKY,WACtB2N,EAAUvO,EAAKY,UAAUuC,EAAQlC,YACxB2G,EAAgBrI,KAAKS,EAAKY,UAAWK,GAG9C,MAAM,IAAI5B,EAAc,KAAOW,EAAKC,IAAM,+BAAiCgB,EAAQ,WAFnFsN,EAAUvO,EAAKY,UAAUK,GAAOkC,EAAQlC,EAG1C,CAEAyL,EAAM4L,KAAO/J,CACf,CAEA,OAAO,CACT,CACF,CAEA,OAAO,CACT,CAKA,SAASkL,EAAW/M,EAAOkK,EAAOzT,EAAQwW,EAAO/a,EAASyZ,EAAOuB,GAC/DlN,EAAMzM,IAAM,KACZyM,EAAM4L,KAAOnV,EAERuW,EAAWhN,EAAOvJ,GAAQ,IAC7BuW,EAAWhN,EAAOvJ,GAAQ,GAG5B,IAAMnD,EAAO8H,EAAUvI,KAAKmN,EAAM4L,MAC5BpB,EAAUyC,EAEZA,IACFA,EAASjN,EAAM+I,UAAY,GAAK/I,EAAM+I,UAAYmB,GAGpD,IACIiD,EACAC,EAFEC,EAAyB,oBAAT/Z,GAAuC,mBAATA,EAapD,GATI+Z,IAEFD,GAA+B,KAD/BD,EAAiBnN,EAAM2J,WAAWhW,QAAQ8C,MAIzB,OAAduJ,EAAMzM,KAA8B,MAAdyM,EAAMzM,KAAgB6Z,GAA+B,IAAjBpN,EAAMnD,QAAgBqN,EAAQ,KAC3FhY,GAAU,GAGRkb,GAAapN,EAAM4J,eAAeuD,GACpCnN,EAAM4L,KAAO,QAAUuB,MAClB,CAIL,GAHIE,GAAiBD,IAAcpN,EAAM4J,eAAeuD,KACtDnN,EAAM4J,eAAeuD,IAAkB,GAE5B,oBAAT7Z,EACE2Z,GAA6C,IAAnCtb,OAAOC,KAAKoO,EAAM4L,MAAM9Z,SAvJ5C,SAA4BkO,EAAOkK,EAAOzT,EAAQvE,GAChD,IAAI2P,EAAU,GACRwB,EAAOrD,EAAMzM,IACb+Z,EAAgB3b,OAAOC,KAAK6E,GAGlC,IAAuB,IAAnBuJ,EAAMkJ,SAERoE,EAAcC,eACqB,mBAAnBvN,EAAMkJ,SAEtBoE,EAAcC,KAAKvN,EAAMkJ,eAC3B,GAAWlJ,EAAMkJ,SAEf,MAAM,IAAIvW,EAAc,4CAG1B,IAAA,IAASd,EAAQ,EAAGC,EAASwb,EAAcxb,OAAQD,EAAQC,EAAQD,GAAS,EAAG,CAC7E,IAAI2b,EAAa,GAEZtb,GAAuB,KAAZ2P,IACd2L,GAAcvD,EAAiBjK,EAAOkK,IAGxC,IAAMuD,EAAYH,EAAczb,GAC5B6b,EAAcjX,EAAOgX,GAMzB,GAJIzN,EAAMyJ,WACRiE,EAAc1N,EAAMyJ,SAAS5W,KAAK4D,EAAQgX,EAAWC,IAGlDX,EAAU/M,EAAOkK,EAAQ,EAAGuD,GAAW,GAAM,GAAM,GAAxD,CAIA,IAAME,EAA8B,OAAd3N,EAAMzM,KAA8B,MAAdyM,EAAMzM,KAClCyM,EAAM4L,MAAQ5L,EAAM4L,KAAK9Z,OAAS,KAE9C6b,IACE3N,EAAM4L,MA9qBO,KA8qBoB5L,EAAM4L,KAAK/T,WAAW,GACzD2V,GAAc,IAEdA,GAAc,MAIlBA,GAAcxN,EAAM4L,KAEhB+B,IACFH,GAAcvD,EAAiBjK,EAAOkK,IAGnC6C,EAAU/M,EAAOkK,EAAQ,EAAGwD,GAAa,EAAMC,KAIhD3N,EAAM4L,MA/rBS,KA+rBkB5L,EAAM4L,KAAK/T,WAAW,GACzD2V,GAAc,IAEdA,GAAc,KAMhB3L,GAHA2L,GAAcxN,EAAM4L,KA7BpB,CAiCF,CAEA5L,EAAMzM,IAAM8P,EACZrD,EAAM4L,KAAO/J,GAAW,IAC1B,CAkFQ+L,CAAkB5N,EAAOkK,EAAOlK,EAAM4L,KAAM1Z,GACxCkb,IACFpN,EAAM4L,KAAO,QAAUuB,EAAiBnN,EAAM4L,SAlMxD,SAA2B5L,EAAOkK,EAAOzT,GAKvC,IAJA,IAAIoL,EAAU,GACRwB,EAAOrD,EAAMzM,IACb+Z,EAAgB3b,OAAOC,KAAK6E,GAEzB5E,EAAQ,EAAGC,EAASwb,EAAcxb,OAAQD,EAAQC,EAAQD,GAAS,EAAG,CAC7E,IAAI2b,EAAa,GACD,KAAZ3L,IAAgB2L,GAAc,MAE9BxN,EAAMsJ,eAAckE,GAAc,KAEtC,IAAMC,EAAYH,EAAczb,GAC5B6b,EAAcjX,EAAOgX,GAErBzN,EAAMyJ,WACRiE,EAAc1N,EAAMyJ,SAAS5W,KAAK4D,EAAQgX,EAAWC,IAGlDX,EAAU/M,EAAOkK,EAAOuD,GAAW,GAAO,KAI3CzN,EAAM4L,KAAK9Z,OAAS,OAAM0b,GAAc,MAE5CA,GAAcxN,EAAM4L,MAAQ5L,EAAMsJ,aAAe,IAAM,IAAM,KAAOtJ,EAAMsJ,aAAe,GAAK,KAEzFyD,EAAU/M,EAAOkK,EAAOwD,GAAa,GAAO,KAOjD7L,GAHA2L,GAAcxN,EAAM4L,MAItB,CAEA5L,EAAMzM,IAAM8P,EACZrD,EAAM4L,KAAO,IAAM/J,EAAU,GAC/B,CA+JQgM,CAAiB7N,EAAOkK,EAAOlK,EAAM4L,MACjCwB,IACFpN,EAAM4L,KAAO,QAAUuB,EAAiB,IAAMnN,EAAM4L,YAG1D,GAAoB,mBAATtY,EACL2Z,GAAgC,IAAtBjN,EAAM4L,KAAK9Z,QACnBkO,EAAM6I,gBAAkBqE,GAAchD,EAAQ,EAChD4C,EAAmB9M,EAAOkK,EAAQ,EAAGlK,EAAM4L,KAAM1Z,GAEjD4a,EAAmB9M,EAAOkK,EAAOlK,EAAM4L,KAAM1Z,GAE3Ckb,IACFpN,EAAM4L,KAAO,QAAUuB,EAAiBnN,EAAM4L,SA3QxD,SAA4B5L,EAAOkK,EAAOzT,GAIxC,IAHA,IAAIoL,EAAU,GACRwB,EAAOrD,EAAMzM,IAEV1B,EAAQ,EAAGC,EAAS2E,EAAO3E,OAAQD,EAAQC,EAAQD,GAAS,EAAG,CACtE,IAAIwF,EAAQZ,EAAO5E,GAEfmO,EAAMyJ,WACRpS,EAAQ2I,EAAMyJ,SAAS5W,KAAK4D,EAAQhC,OAAO5C,GAAQwF,KAIjD0V,EAAU/M,EAAOkK,EAAO7S,GAAO,GAAO,SACpB,IAAVA,GACP0V,EAAU/M,EAAOkK,EAAO,MAAM,GAAO,MACxB,KAAZrI,IAAgBA,GAAW,KAAQ7B,EAAMsJ,aAAqB,GAAN,MAC5DzH,GAAW7B,EAAM4L,KAErB,CAEA5L,EAAMzM,IAAM8P,EACZrD,EAAM4L,KAAO,IAAM/J,EAAU,GAC/B,CAwPQiM,CAAkB9N,EAAOkK,EAAOlK,EAAM4L,MAClCwB,IACFpN,EAAM4L,KAAO,QAAUuB,EAAiB,IAAMnN,EAAM4L,WAG1D,IAAoB,oBAATtY,EAIX,IAAoB,uBAATA,EACT,OAAO,EAEP,GAAI0M,EAAM8I,YAAa,OAAO,EAC9B,MAAM,IAAInW,EAAc,0CAA4CW,EACtE,CARoB,MAAd0M,EAAMzM,KACRmY,EAAY1L,EAAOA,EAAM4L,KAAM1B,EAAOyB,EAAOnB,EAOjD,CAEA,GAAkB,OAAdxK,EAAMzM,KAA8B,MAAdyM,EAAMzM,IAAa,CAc3C,IAAIwa,EAASC,UACM,MAAjBhO,EAAMzM,IAAI,GAAayM,EAAMzM,IAAIiE,MAAM,GAAKwI,EAAMzM,KAClDyF,QAAQ,KAAM,OAGd+U,EADmB,MAAjB/N,EAAMzM,IAAI,GACH,IAAMwa,EACkB,uBAAxBA,EAAOvW,MAAM,EAAG,IAChB,KAAOuW,EAAOvW,MAAM,IAEpB,KAAOuW,EAAS,IAG3B/N,EAAM4L,KAAOmC,EAAS,IAAM/N,EAAM4L,IACpC,CACF,CAEA,OAAO,CACT,CAEA,SAASqC,EAAwBxX,EAAQuJ,GACvC,IAAMkO,EAAU,GACVC,EAAoB,GAE1BC,EAAY3X,EAAQyX,EAASC,GAG7B,IADA,IAAMrc,EAASqc,EAAkBrc,OACxBD,EAAQ,EAAGA,EAAQC,EAAQD,GAAS,EAC3CmO,EAAM2J,WAAWrU,KAAK4Y,EAAQC,EAAkBtc,KAElDmO,EAAM4J,eAAiB,IAAIhZ,MAAMkB,EACnC,CAEA,SAASsc,EAAa3X,EAAQyX,EAASC,GACrC,GAAe,OAAX1X,GAAqC,WAAlBzG,EAAOyG,GAAqB,CACjD,IAAM5E,EAAQqc,EAAQva,QAAQ8C,GAC9B,IAAc,IAAV5E,GACuC,IAArCsc,EAAkBxa,QAAQ9B,IAC5Bsc,EAAkB7Y,KAAKzD,QAKzB,GAFAqc,EAAQ5Y,KAAKmB,GAET7F,MAAMC,QAAQ4F,GAChB,IAAA,IAAS6G,EAAI,EAAGxL,EAAS2E,EAAO3E,OAAQwL,EAAIxL,EAAQwL,GAAK,EACvD8Q,EAAY3X,EAAO6G,GAAI4Q,EAASC,QAKlC,IAFA,IAAMb,EAAgB3b,OAAOC,KAAK6E,GAEzB6G,EAAI,EAAGxL,EAASwb,EAAcxb,OAAQwL,EAAIxL,EAAQwL,GAAK,EAC9D8Q,EAAY3X,EAAO6W,EAAchQ,IAAK4Q,EAASC,EAIvD,CACF,QAoBAE,GAAAzC,KAlBA,SAAe/Q,EAAOrH,GAGpB,IAAMwM,EAAQ,IAAIhB,EAFlBxL,EAAUA,GAAW,CAAA,GAIhBwM,EAAMoJ,QAAQ6E,EAAuBpT,EAAOmF,GAEjD,IAAI3I,EAAQwD,EAMZ,OAJImF,EAAMyJ,WACRpS,EAAQ2I,EAAMyJ,SAAS5W,KAAK,CAAE,GAAIwE,GAAS,GAAIA,IAG7C0V,EAAU/M,EAAO,EAAG3I,GAAO,GAAM,GAAc2I,EAAM4L,KAAO,KAEzD,EACT,6CCp6BA,IAAMxD,EAASjV,KACTkb,EAAS1Z,KAEf,SAAS2Z,EAASC,EAAMC,GACtB,OAAO,WACL,MAAM,IAAI5b,MAAM,iBAAmB2b,EAAO,sCAC1BC,EAAK,2CAEzB,QAEAC,EAAA/Z,KAAsB2B,IACtBoY,EAAAvZ,OAAwBoB,IACxBmY,EAAAC,gBAAiCxV,KACjCuV,EAAAE,YAA6B9S,KAC7B4S,EAAAG,YAA6B9S,KAC7B2S,EAAAlR,eAAgCsR,KAChCJ,EAAAnG,KAAsBF,EAAOE,KAC7BmG,EAAApG,QAAyBD,EAAOC,QAChCoG,EAAA7C,KAAsByC,EAAOzC,KAC7B6C,EAAA9b,cAA+Bmc,IAG/BL,EAAAM,MAAuB,CACrBjX,OAAQkX,KACRxW,MAAOyW,KACPxb,IAAKyb,KACLC,KAAMC,KACN1T,MAAO2T,KACP1T,IAAK2T,KACLhW,UAAWiW,KACXxY,KAAMyY,KACN9X,IAAK+X,KACLlV,MAAOmV,KACPrU,KAAMsU,KACNxZ,IAAKyZ,KACL1Z,IAAK2Z,KAIPpB,EAAAqB,SAA0BxB,EAAQ,WAAY,QAC9CG,EAAAsB,YAA6BzB,EAAQ,cAAe,WACpDG,EAAAuB,SAA0B1B,EAAQ,WAAY,cCxC5C5Z,GAcEub,GAdFvb,KACAQ,GAaE+a,GAbF/a,OACAwZ,GAYEuB,GAZFvB,gBACAC,GAWEsB,GAXFtB,YACAC,GAUEqB,GAVFrB,YACArR,GASE0S,GATF1S,eACA+K,GAQE2H,GARF3H,KACAD,GAOE4H,GAPF5H,QACAuD,GAMEqE,GANFrE,KACAjZ,GAKEsd,GALFtd,cACAoc,GAIEkB,GAJFlB,MACAe,GAGEG,GAHFH,SACAC,GAEEE,GAFFF,YACAC,GACEC,GADFD"}function getDefaultExportFromCjs(x) {
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
}
var jsYaml = {};
var loader = {};
var common = {};
var hasRequiredCommon;
function requireCommon() {
  if (hasRequiredCommon) return common;
  hasRequiredCommon = 1;
  function isNothing(subject) {
    return typeof subject === "undefined" || subject === null;
  }
  function isObject(subject) {
    return typeof subject === "object" && subject !== null;
  }
  function toArray(sequence) {
    if (Array.isArray(sequence)) return sequence;
    else if (isNothing(sequence)) return [];
    return [sequence];
  }
  function extend(target, source) {
    if (source) {
      const sourceKeys = Object.keys(source);
      for (let index = 0, length = sourceKeys.length; index < length; index += 1) {
        const key = sourceKeys[index];
        target[key] = source[key];
      }
    }
    return target;
  }
  function repeat(string, count) {
    let result = "";
    for (let cycle = 0; cycle < count; cycle += 1) {
      result += string;
    }
    return result;
  }
  function isNegativeZero(number) {
    return number === 0 && Number.NEGATIVE_INFINITY === 1 / number;
  }
  common.isNothing = isNothing;
  common.isObject = isObject;
  common.toArray = toArray;
  common.repeat = repeat;
  common.isNegativeZero = isNegativeZero;
  common.extend = extend;
  return common;
}
var exception;
var hasRequiredException;
function requireException() {
  if (hasRequiredException) return exception;
  hasRequiredException = 1;
  function formatError(exception2, compact) {
    let where = "";
    const message = exception2.reason || "(unknown reason)";
    if (!exception2.mark) return message;
    if (exception2.mark.name) {
      where += 'in "' + exception2.mark.name + '" ';
    }
    where += "(" + (exception2.mark.line + 1) + ":" + (exception2.mark.column + 1) + ")";
    if (!compact && exception2.mark.snippet) {
      where += "\n\n" + exception2.mark.snippet;
    }
    return message + " " + where;
  }
  function YAMLException2(reason, mark) {
    Error.call(this);
    this.name = "YAMLException";
    this.reason = reason;
    this.mark = mark;
    this.message = formatError(this, false);
    if (Error.captureStackTrace) {
      Error.captureStackTrace(this, this.constructor);
    } else {
      this.stack = new Error().stack || "";
    }
  }
  YAMLException2.prototype = Object.create(Error.prototype);
  YAMLException2.prototype.constructor = YAMLException2;
  YAMLException2.prototype.toString = function toString(compact) {
    return this.name + ": " + formatError(this, compact);
  };
  exception = YAMLException2;
  return exception;
}
var snippet;
var hasRequiredSnippet;
function requireSnippet() {
  if (hasRequiredSnippet) return snippet;
  hasRequiredSnippet = 1;
  const common2 = requireCommon();
  function getLine(buffer, lineStart, lineEnd, position, maxLineLength) {
    let head = "";
    let tail = "";
    const maxHalfLength = Math.floor(maxLineLength / 2) - 1;
    if (position - lineStart > maxHalfLength) {
      head = " ... ";
      lineStart = position - maxHalfLength + head.length;
    }
    if (lineEnd - position > maxHalfLength) {
      tail = " ...";
      lineEnd = position + maxHalfLength - tail.length;
    }
    return {
      str: head + buffer.slice(lineStart, lineEnd).replace(/\t/g, "â†’") + tail,
      pos: position - lineStart + head.length
      // relative position
    };
  }
  function padStart(string, max) {
    return common2.repeat(" ", max - string.length) + string;
  }
  function makeSnippet(mark, options) {
    options = Object.create(options || null);
    if (!mark.buffer) return null;
    if (!options.maxLength) options.maxLength = 79;
    if (typeof options.indent !== "number") options.indent = 1;
    if (typeof options.linesBefore !== "number") options.linesBefore = 3;
    if (typeof options.linesAfter !== "number") options.linesAfter = 2;
    const re = /\r?\n|\r|\0/g;
    const lineStarts = [0];
    const lineEnds = [];
    let match;
    let foundLineNo = -1;
    while (match = re.exec(mark.buffer)) {
      lineEnds.push(match.index);
      lineStarts.push(match.index + match[0].length);
      if (mark.position <= match.index && foundLineNo < 0) {
        foundLineNo = lineStarts.length - 2;
      }
    }
    if (foundLineNo < 0) foundLineNo = lineStarts.length - 1;
    let result = "";
    const lineNoLength = Math.min(mark.line + options.linesAfter, lineEnds.length).toString().length;
    const maxLineLength = options.maxLength - (options.indent + lineNoLength + 3);
    for (let i = 1; i <= options.linesBefore; i++) {
      if (foundLineNo - i < 0) break;
      const line2 = getLine(
        mark.buffer,
        lineStarts[foundLineNo - i],
        lineEnds[foundLineNo - i],
        mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo - i]),
        maxLineLength
      );
      result = common2.repeat(" ", options.indent) + padStart((mark.line - i + 1).toString(), lineNoLength) + " | " + line2.str + "\n" + result;
    }
    const line = getLine(mark.buffer, lineStarts[foundLineNo], lineEnds[foundLineNo], mark.position, maxLineLength);
    result += common2.repeat(" ", options.indent) + padStart((mark.line + 1).toString(), lineNoLength) + " | " + line.str + "\n";
    result += common2.repeat("-", options.indent + lineNoLength + 3 + line.pos) + "^\n";
    for (let i = 1; i <= options.linesAfter; i++) {
      if (foundLineNo + i >= lineEnds.length) break;
      const line2 = getLine(
        mark.buffer,
        lineStarts[foundLineNo + i],
        lineEnds[foundLineNo + i],
        mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo + i]),
        maxLineLength
      );
      result += common2.repeat(" ", options.indent) + padStart((mark.line + i + 1).toString(), lineNoLength) + " | " + line2.str + "\n";
    }
    return result.replace(/\n$/, "");
  }
  snippet = makeSnippet;
  return snippet;
}
var type;
var hasRequiredType;
function requireType() {
  if (hasRequiredType) return type;
  hasRequiredType = 1;
  const YAMLException2 = requireException();
  const TYPE_CONSTRUCTOR_OPTIONS = [
    "kind",
    "multi",
    "resolve",
    "construct",
    "instanceOf",
    "predicate",
    "represent",
    "representName",
    "defaultStyle",
    "styleAliases"
  ];
  const YAML_NODE_KINDS = [
    "scalar",
    "sequence",
    "mapping"
  ];
  function compileStyleAliases(map2) {
    const result = {};
    if (map2 !== null) {
      Object.keys(map2).forEach(function(style) {
        map2[style].forEach(function(alias) {
          result[String(alias)] = style;
        });
      });
    }
    return result;
  }
  function Type2(tag, options) {
    options = options || {};
    Object.keys(options).forEach(function(name) {
      if (TYPE_CONSTRUCTOR_OPTIONS.indexOf(name) === -1) {
        throw new YAMLException2('Unknown option "' + name + '" is met in definition of "' + tag + '" YAML type.');
      }
    });
    this.options = options;
    this.tag = tag;
    this.kind = options["kind"] || null;
    this.resolve = options["resolve"] || function() {
      return true;
    };
    this.construct = options["construct"] || function(data) {
      return data;
    };
    this.instanceOf = options["instanceOf"] || null;
    this.predicate = options["predicate"] || null;
    this.represent = options["represent"] || null;
    this.representName = options["representName"] || null;
    this.defaultStyle = options["defaultStyle"] || null;
    this.multi = options["multi"] || false;
    this.styleAliases = compileStyleAliases(options["styleAliases"] || null);
    if (YAML_NODE_KINDS.indexOf(this.kind) === -1) {
      throw new YAMLException2('Unknown kind "' + this.kind + '" is specified for "' + tag + '" YAML type.');
    }
  }
  type = Type2;
  return type;
}
var schema;
var hasRequiredSchema;
function requireSchema() {
  if (hasRequiredSchema) return schema;
  hasRequiredSchema = 1;
  const YAMLException2 = requireException();
  const Type2 = requireType();
  function compileList(schema2, name) {
    const result = [];
    schema2[name].forEach(function(currentType) {
      let newIndex = result.length;
      result.forEach(function(previousType, previousIndex) {
        if (previousType.tag === currentType.tag && previousType.kind === currentType.kind && previousType.multi === currentType.multi) {
          newIndex = previousIndex;
        }
      });
      result[newIndex] = currentType;
    });
    return result;
  }
  function compileMap() {
    const result = {
      scalar: {},
      sequence: {},
      mapping: {},
      fallback: {},
      multi: {
        scalar: [],
        sequence: [],
        mapping: [],
        fallback: []
      }
    };
    function collectType(type2) {
      if (type2.multi) {
        result.multi[type2.kind].push(type2);
        result.multi["fallback"].push(type2);
      } else {
        result[type2.kind][type2.tag] = result["fallback"][type2.tag] = type2;
      }
    }
    for (let index = 0, length = arguments.length; index < length; index += 1) {
      arguments[index].forEach(collectType);
    }
    return result;
  }
  function Schema2(definition) {
    return this.extend(definition);
  }
  Schema2.prototype.extend = function extend(definition) {
    let implicit = [];
    let explicit = [];
    if (definition instanceof Type2) {
      explicit.push(definition);
    } else if (Array.isArray(definition)) {
      explicit = explicit.concat(definition);
    } else if (definition && (Array.isArray(definition.implicit) || Array.isArray(definition.explicit))) {
      if (definition.implicit) implicit = implicit.concat(definition.implicit);
      if (definition.explicit) explicit = explicit.concat(definition.explicit);
    } else {
      throw new YAMLException2("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");
    }
    implicit.forEach(function(type2) {
      if (!(type2 instanceof Type2)) {
        throw new YAMLException2("Specified list of YAML types (or a single Type object) contains a non-Type object.");
      }
      if (type2.loadKind && type2.loadKind !== "scalar") {
        throw new YAMLException2("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");
      }
      if (type2.multi) {
        throw new YAMLException2("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.");
      }
    });
    explicit.forEach(function(type2) {
      if (!(type2 instanceof Type2)) {
        throw new YAMLException2("Specified list of YAML types (or a single Type object) contains a non-Type object.");
      }
    });
    const result = Object.create(Schema2.prototype);
    result.implicit = (this.implicit || []).concat(implicit);
    result.explicit = (this.explicit || []).concat(explicit);
    result.compiledImplicit = compileList(result, "implicit");
    result.compiledExplicit = compileList(result, "explicit");
    result.compiledTypeMap = compileMap(result.compiledImplicit, result.compiledExplicit);
    return result;
  };
  schema = Schema2;
  return schema;
}
var str;
var hasRequiredStr;
function requireStr() {
  if (hasRequiredStr) return str;
  hasRequiredStr = 1;
  const Type2 = requireType();
  str = new Type2("tag:yaml.org,2002:str", {
    kind: "scalar",
    construct: function(data) {
      return data !== null ? data : "";
    }
  });
  return str;
}
var seq;
var hasRequiredSeq;
function requireSeq() {
  if (hasRequiredSeq) return seq;
  hasRequiredSeq = 1;
  const Type2 = requireType();
  seq = new Type2("tag:yaml.org,2002:seq", {
    kind: "sequence",
    construct: function(data) {
      return data !== null ? data : [];
    }
  });
  return seq;
}
var map;
var hasRequiredMap;
function requireMap() {
  if (hasRequiredMap) return map;
  hasRequiredMap = 1;
  const Type2 = requireType();
  map = new Type2("tag:yaml.org,2002:map", {
    kind: "mapping",
    construct: function(data) {
      return data !== null ? data : {};
    }
  });
  return map;
}
var failsafe;
var hasRequiredFailsafe;
function requireFailsafe() {
  if (hasRequiredFailsafe) return failsafe;
  hasRequiredFailsafe = 1;
  const Schema2 = requireSchema();
  failsafe = new Schema2({
    explicit: [
      requireStr(),
      requireSeq(),
      requireMap()
    ]
  });
  return failsafe;
}
var _null;
var hasRequired_null;
function require_null() {
  if (hasRequired_null) return _null;
  hasRequired_null = 1;
  const Type2 = requireType();
  function resolveYamlNull(data) {
    if (data === null) return true;
    const max = data.length;
    return max === 1 && data === "~" || max === 4 && (data === "null" || data === "Null" || data === "NULL");
  }
  function constructYamlNull() {
    return null;
  }
  function isNull(object) {
    return object === null;
  }
  _null = new Type2("tag:yaml.org,2002:null", {
    kind: "scalar",
    resolve: resolveYamlNull,
    construct: constructYamlNull,
    predicate: isNull,
    represent: {
      canonical: function() {
        return "~";
      },
      lowercase: function() {
        return "null";
      },
      uppercase: function() {
        return "NULL";
      },
      camelcase: function() {
        return "Null";
      },
      empty: function() {
        return "";
      }
    },
    defaultStyle: "lowercase"
  });
  return _null;
}
var bool;
var hasRequiredBool;
function requireBool() {
  if (hasRequiredBool) return bool;
  hasRequiredBool = 1;
  const Type2 = requireType();
  function resolveYamlBoolean(data) {
    if (data === null) return false;
    const max = data.length;
    return max === 4 && (data === "true" || data === "True" || data === "TRUE") || max === 5 && (data === "false" || data === "False" || data === "FALSE");
  }
  function constructYamlBoolean(data) {
    return data === "true" || data === "True" || data === "TRUE";
  }
  function isBoolean(object) {
    return Object.prototype.toString.call(object) === "[object Boolean]";
  }
  bool = new Type2("tag:yaml.org,2002:bool", {
    kind: "scalar",
    resolve: resolveYamlBoolean,
    construct: constructYamlBoolean,
    predicate: isBoolean,
    represent: {
      lowercase: function(object) {
        return object ? "true" : "false";
      },
      uppercase: function(object) {
        return object ? "TRUE" : "FALSE";
      },
      camelcase: function(object) {
        return object ? "True" : "False";
      }
    },
    defaultStyle: "lowercase"
  });
  return bool;
}
var int;
var hasRequiredInt;
function requireInt() {
  if (hasRequiredInt) return int;
  hasRequiredInt = 1;
  const common2 = requireCommon();
  const Type2 = requireType();
  function isHexCode(c) {
    return c >= 48 && c <= 57 || c >= 65 && c <= 70 || c >= 97 && c <= 102;
  }
  function isOctCode(c) {
    return c >= 48 && c <= 55;
  }
  function isDecCode(c) {
    return c >= 48 && c <= 57;
  }
  function resolveYamlInteger(data) {
    if (data === null) return false;
    const max = data.length;
    let index = 0;
    let hasDigits = false;
    if (!max) return false;
    let ch = data[index];
    if (ch === "-" || ch === "+") {
      ch = data[++index];
    }
    if (ch === "0") {
      if (index + 1 === max) return true;
      ch = data[++index];
      if (ch === "b") {
        index++;
        for (; index < max; index++) {
          ch = data[index];
          if (ch !== "0" && ch !== "1") return false;
          hasDigits = true;
        }
        return hasDigits && isFinite(parseYamlInteger(data));
      }
      if (ch === "x") {
        index++;
        for (; index < max; index++) {
          if (!isHexCode(data.charCodeAt(index))) return false;
          hasDigits = true;
        }
        return hasDigits && isFinite(parseYamlInteger(data));
      }
      if (ch === "o") {
        index++;
        for (; index < max; index++) {
          if (!isOctCode(data.charCodeAt(index))) return false;
          hasDigits = true;
        }
        return hasDigits && isFinite(parseYamlInteger(data));
      }
    }
    for (; index < max; index++) {
      if (!isDecCode(data.charCodeAt(index))) {
        return false;
      }
      hasDigits = true;
    }
    if (!hasDigits) return false;
    return isFinite(parseYamlInteger(data));
  }
  function parseYamlInteger(data) {
    let value = data;
    let sign = 1;
    let ch = value[0];
    if (ch === "-" || ch === "+") {
      if (ch === "-") sign = -1;
      value = value.slice(1);
      ch = value[0];
    }
    if (value === "0") return 0;
    if (ch === "0") {
      if (value[1] === "b") return sign * parseInt(value.slice(2), 2);
      if (value[1] === "x") return sign * parseInt(value.slice(2), 16);
      if (value[1] === "o") return sign * parseInt(value.slice(2), 8);
    }
    return sign * parseInt(value, 10);
  }
  function constructYamlInteger(data) {
    return parseYamlInteger(data);
  }
  function isInteger(object) {
    return Object.prototype.toString.call(object) === "[object Number]" && (object % 1 === 0 && !common2.isNegativeZero(object));
  }
  int = new Type2("tag:yaml.org,2002:int", {
    kind: "scalar",
    resolve: resolveYamlInteger,
    construct: constructYamlInteger,
    predicate: isInteger,
    represent: {
      binary: function(obj) {
        return obj >= 0 ? "0b" + obj.toString(2) : "-0b" + obj.toString(2).slice(1);
      },
      octal: function(obj) {
        return obj >= 0 ? "0o" + obj.toString(8) : "-0o" + obj.toString(8).slice(1);
      },
      decimal: function(obj) {
        return obj.toString(10);
      },
      hexadecimal: function(obj) {
        return obj >= 0 ? "0x" + obj.toString(16).toUpperCase() : "-0x" + obj.toString(16).toUpperCase().slice(1);
      }
    },
    defaultStyle: "decimal",
    styleAliases: {
      binary: [2, "bin"],
      octal: [8, "oct"],
      decimal: [10, "dec"],
      hexadecimal: [16, "hex"]
    }
  });
  return int;
}
var float;
var hasRequiredFloat;
function requireFloat() {
  if (hasRequiredFloat) return float;
  hasRequiredFloat = 1;
  const common2 = requireCommon();
  const Type2 = requireType();
  const YAML_FLOAT_PATTERN = new RegExp(
    // 2.5e4, 2.5 and integers
    "^(?:[-+]?(?:[0-9]+)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"
  );
  const YAML_FLOAT_SPECIAL_PATTERN = new RegExp(
    "^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"
  );
  function resolveYamlFloat(data) {
    if (data === null) return false;
    if (!YAML_FLOAT_PATTERN.test(data)) {
      return false;
    }
    if (isFinite(parseFloat(data, 10))) {
      return true;
    }
    return YAML_FLOAT_SPECIAL_PATTERN.test(data);
  }
  function constructYamlFloat(data) {
    let value = data.toLowerCase();
    const sign = value[0] === "-" ? -1 : 1;
    if ("+-".indexOf(value[0]) >= 0) {
      value = value.slice(1);
    }
    if (value === ".inf") {
      return sign === 1 ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY;
    } else if (value === ".nan") {
      return NaN;
    }
    return sign * parseFloat(value, 10);
  }
  const SCIENTIFIC_WITHOUT_DOT = /^[-+]?[0-9]+e/;
  function representYamlFloat(object, style) {
    if (isNaN(object)) {
      switch (style) {
        case "lowercase":
          return ".nan";
        case "uppercase":
          return ".NAN";
        case "camelcase":
          return ".NaN";
      }
    } else if (Number.POSITIVE_INFINITY === object) {
      switch (style) {
        case "lowercase":
          return ".inf";
        case "uppercase":
          return ".INF";
        case "camelcase":
          return ".Inf";
      }
    } else if (Number.NEGATIVE_INFINITY === object) {
      switch (style) {
        case "lowercase":
          return "-.inf";
        case "uppercase":
          return "-.INF";
        case "camelcase":
          return "-.Inf";
      }
    } else if (common2.isNegativeZero(object)) {
      return "-0.0";
    }
    const res = object.toString(10);
    return SCIENTIFIC_WITHOUT_DOT.test(res) ? res.replace("e", ".e") : res;
  }
  function isFloat(object) {
    return Object.prototype.toString.call(object) === "[object Number]" && (object % 1 !== 0 || common2.isNegativeZero(object));
  }
  float = new Type2("tag:yaml.org,2002:float", {
    kind: "scalar",
    resolve: resolveYamlFloat,
    construct: constructYamlFloat,
    predicate: isFloat,
    represent: representYamlFloat,
    defaultStyle: "lowercase"
  });
  return float;
}
var json;
var hasRequiredJson;
function requireJson() {
  if (hasRequiredJson) return json;
  hasRequiredJson = 1;
  json = requireFailsafe().extend({
    implicit: [
      require_null(),
      requireBool(),
      requireInt(),
      requireFloat()
    ]
  });
  return json;
}
var core;
var hasRequiredCore;
function requireCore() {
  if (hasRequiredCore) return core;
  hasRequiredCore = 1;
  core = requireJson();
  return core;
}
var timestamp;
var hasRequiredTimestamp;
function requireTimestamp() {
  if (hasRequiredTimestamp) return timestamp;
  hasRequiredTimestamp = 1;
  const Type2 = requireType();
  const YAML_DATE_REGEXP = new RegExp(
    "^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"
  );
  const YAML_TIMESTAMP_REGEXP = new RegExp(
    "^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$"
  );
  function resolveYamlTimestamp(data) {
    if (data === null) return false;
    if (YAML_DATE_REGEXP.exec(data) !== null) return true;
    if (YAML_TIMESTAMP_REGEXP.exec(data) !== null) return true;
    return false;
  }
  function constructYamlTimestamp(data) {
    let fraction = 0;
    let delta = null;
    let match = YAML_DATE_REGEXP.exec(data);
    if (match === null) match = YAML_TIMESTAMP_REGEXP.exec(data);
    if (match === null) throw new Error("Date resolve error");
    const year = +match[1];
    const month = +match[2] - 1;
    const day = +match[3];
    if (!match[4]) {
      return new Date(Date.UTC(year, month, day));
    }
    const hour = +match[4];
    const minute = +match[5];
    const second = +match[6];
    if (match[7]) {
      fraction = match[7].slice(0, 3);
      while (fraction.length < 3) {
        fraction += "0";
      }
      fraction = +fraction;
    }
    if (match[9]) {
      const tzHour = +match[10];
      const tzMinute = +(match[11] || 0);
      delta = (tzHour * 60 + tzMinute) * 6e4;
      if (match[9] === "-") delta = -delta;
    }
    const date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction));
    if (delta) date.setTime(date.getTime() - delta);
    return date;
  }
  function representYamlTimestamp(object) {
    return object.toISOString();
  }
  timestamp = new Type2("tag:yaml.org,2002:timestamp", {
    kind: "scalar",
    resolve: resolveYamlTimestamp,
    construct: constructYamlTimestamp,
    instanceOf: Date,
    represent: representYamlTimestamp
  });
  return timestamp;
}
var merge;
var hasRequiredMerge;
function requireMerge() {
  if (hasRequiredMerge) return merge;
  hasRequiredMerge = 1;
  const Type2 = requireType();
  function resolveYamlMerge(data) {
    return data === "<<" || data === null;
  }
  merge = new Type2("tag:yaml.org,2002:merge", {
    kind: "scalar",
    resolve: resolveYamlMerge
  });
  return merge;
}
var binary;
var hasRequiredBinary;
function requireBinary() {
  if (hasRequiredBinary) return binary;
  hasRequiredBinary = 1;
  const Type2 = requireType();
  const BASE64_MAP = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";
  function resolveYamlBinary(data) {
    if (data === null) return false;
    let bitlen = 0;
    const max = data.length;
    const map2 = BASE64_MAP;
    for (let idx = 0; idx < max; idx++) {
      const code = map2.indexOf(data.charAt(idx));
      if (code > 64) continue;
      if (code < 0) return false;
      bitlen += 6;
    }
    return bitlen % 8 === 0;
  }
  function constructYamlBinary(data) {
    const input = data.replace(/[\r\n=]/g, "");
    const max = input.length;
    const map2 = BASE64_MAP;
    let bits = 0;
    const result = [];
    for (let idx = 0; idx < max; idx++) {
      if (idx % 4 === 0 && idx) {
        result.push(bits >> 16 & 255);
        result.push(bits >> 8 & 255);
        result.push(bits & 255);
      }
      bits = bits << 6 | map2.indexOf(input.charAt(idx));
    }
    const tailbits = max % 4 * 6;
    if (tailbits === 0) {
      result.push(bits >> 16 & 255);
      result.push(bits >> 8 & 255);
      result.push(bits & 255);
    } else if (tailbits === 18) {
      result.push(bits >> 10 & 255);
      result.push(bits >> 2 & 255);
    } else if (tailbits === 12) {
      result.push(bits >> 4 & 255);
    }
    return new Uint8Array(result);
  }
  function representYamlBinary(object) {
    let result = "";
    let bits = 0;
    const max = object.length;
    const map2 = BASE64_MAP;
    for (let idx = 0; idx < max; idx++) {
      if (idx % 3 === 0 && idx) {
        result += map2[bits >> 18 & 63];
        result += map2[bits >> 12 & 63];
        result += map2[bits >> 6 & 63];
        result += map2[bits & 63];
      }
      bits = (bits << 8) + object[idx];
    }
    const tail = max % 3;
    if (tail === 0) {
      result += map2[bits >> 18 & 63];
      result += map2[bits >> 12 & 63];
      result += map2[bits >> 6 & 63];
      result += map2[bits & 63];
    } else if (tail === 2) {
      result += map2[bits >> 10 & 63];
      result += map2[bits >> 4 & 63];
      result += map2[bits << 2 & 63];
      result += map2[64];
    } else if (tail === 1) {
      result += map2[bits >> 2 & 63];
      result += map2[bits << 4 & 63];
      result += map2[64];
      result += map2[64];
    }
    return result;
  }
  function isBinary(obj) {
    return Object.prototype.toString.call(obj) === "[object Uint8Array]";
  }
  binary = new Type2("tag:yaml.org,2002:binary", {
    kind: "scalar",
    resolve: resolveYamlBinary,
    construct: constructYamlBinary,
    predicate: isBinary,
    represent: representYamlBinary
  });
  return binary;
}
var omap;
var hasRequiredOmap;
function requireOmap() {
  if (hasRequiredOmap) return omap;
  hasRequiredOmap = 1;
  const Type2 = requireType();
  const _hasOwnProperty = Object.prototype.hasOwnProperty;
  const _toString = Object.prototype.toString;
  function resolveYamlOmap(data) {
    if (data === null) return true;
    const objectKeys = [];
    const object = data;
    for (let index = 0, length = object.length; index < length; index += 1) {
      const pair = object[index];
      let pairHasKey = false;
      if (_toString.call(pair) !== "[object Object]") return false;
      let pairKey;
      for (pairKey in pair) {
        if (_hasOwnProperty.call(pair, pairKey)) {
          if (!pairHasKey) pairHasKey = true;
          else return false;
        }
      }
      if (!pairHasKey) return false;
      if (objectKeys.indexOf(pairKey) === -1) objectKeys.push(pairKey);
      else return false;
    }
    return true;
  }
  function constructYamlOmap(data) {
    return data !== null ? data : [];
  }
  omap = new Type2("tag:yaml.org,2002:omap", {
    kind: "sequence",
    resolve: resolveYamlOmap,
    construct: constructYamlOmap
  });
  return omap;
}
var pairs;
var hasRequiredPairs;
function requirePairs() {
  if (hasRequiredPairs) return pairs;
  hasRequiredPairs = 1;
  const Type2 = requireType();
  const _toString = Object.prototype.toString;
  function resolveYamlPairs(data) {
    if (data === null) return true;
    const object = data;
    const result = new Array(object.length);
    for (let index = 0, length = object.length; index < length; index += 1) {
      const pair = object[index];
      if (_toString.call(pair) !== "[object Object]") return false;
      const keys = Object.keys(pair);
      if (keys.length !== 1) return false;
      result[index] = [keys[0], pair[keys[0]]];
    }
    return true;
  }
  function constructYamlPairs(data) {
    if (data === null) return [];
    const object = data;
    const result = new Array(object.length);
    for (let index = 0, length = object.length; index < length; index += 1) {
      const pair = object[index];
      const keys = Object.keys(pair);
      result[index] = [keys[0], pair[keys[0]]];
    }
    return result;
  }
  pairs = new Type2("tag:yaml.org,2002:pairs", {
    kind: "sequence",
    resolve: resolveYamlPairs,
    construct: constructYamlPairs
  });
  return pairs;
}
var set;
var hasRequiredSet;
function requireSet() {
  if (hasRequiredSet) return set;
  hasRequiredSet = 1;
  const Type2 = requireType();
  const _hasOwnProperty = Object.prototype.hasOwnProperty;
  function resolveYamlSet(data) {
    if (data === null) return true;
    const object = data;
    for (const key in object) {
      if (_hasOwnProperty.call(object, key)) {
        if (object[key] !== null) return false;
      }
    }
    return true;
  }
  function constructYamlSet(data) {
    return data !== null ? data : {};
  }
  set = new Type2("tag:yaml.org,2002:set", {
    kind: "mapping",
    resolve: resolveYamlSet,
    construct: constructYamlSet
  });
  return set;
}
var _default;
var hasRequired_default;
function require_default() {
  if (hasRequired_default) return _default;
  hasRequired_default = 1;
  _default = requireCore().extend({
    implicit: [
      requireTimestamp(),
      requireMerge()
    ],
    explicit: [
      requireBinary(),
      requireOmap(),
      requirePairs(),
      requireSet()
    ]
  });
  return _default;
}
var hasRequiredLoader;
function requireLoader() {
  if (hasRequiredLoader) return loader;
  hasRequiredLoader = 1;
  const common2 = requireCommon();
  const YAMLException2 = requireException();
  const makeSnippet = requireSnippet();
  const DEFAULT_SCHEMA2 = require_default();
  const _hasOwnProperty = Object.prototype.hasOwnProperty;
  const CONTEXT_FLOW_IN = 1;
  const CONTEXT_FLOW_OUT = 2;
  const CONTEXT_BLOCK_IN = 3;
  const CONTEXT_BLOCK_OUT = 4;
  const CHOMPING_CLIP = 1;
  const CHOMPING_STRIP = 2;
  const CHOMPING_KEEP = 3;
  const PATTERN_NON_PRINTABLE = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;
  const PATTERN_NON_ASCII_LINE_BREAKS = /[\x85\u2028\u2029]/;
  const PATTERN_FLOW_INDICATORS = /[,\[\]{}]/;
  const PATTERN_TAG_HANDLE = /^(?:!|!!|![0-9A-Za-z-]+!)$/;
  const PATTERN_TAG_URI = /^(?:!|[^,\[\]{}])(?:%[0-9a-f]{2}|[0-9a-z\-#;/?:@&=+$,_.!~*'()\[\]])*$/i;
  function _class(obj) {
    return Object.prototype.toString.call(obj);
  }
  function isEol(c) {
    return c === 10 || c === 13;
  }
  function isWhiteSpace(c) {
    return c === 9 || c === 32;
  }
  function isWsOrEol(c) {
    return c === 9 || c === 32 || c === 10 || c === 13;
  }
  function isFlowIndicator(c) {
    return c === 44 || c === 91 || c === 93 || c === 123 || c === 125;
  }
  function fromHexCode(c) {
    if (c >= 48 && c <= 57) {
      return c - 48;
    }
    const lc = c | 32;
    if (lc >= 97 && lc <= 102) {
      return lc - 97 + 10;
    }
    return -1;
  }
  function escapedHexLen(c) {
    if (c === 120) {
      return 2;
    }
    if (c === 117) {
      return 4;
    }
    if (c === 85) {
      return 8;
    }
    return 0;
  }
  function fromDecimalCode(c) {
    if (c >= 48 && c <= 57) {
      return c - 48;
    }
    return -1;
  }
  function simpleEscapeSequence(c) {
    switch (c) {
      case 48:
        return "\0";
      case 97:
        return "\x07";
      case 98:
        return "\b";
      case 116:
        return "	";
      case 9:
        return "	";
      case 110:
        return "\n";
      case 118:
        return "\v";
      case 102:
        return "\f";
      case 114:
        return "\r";
      case 101:
        return "\x1B";
      case 32:
        return " ";
      case 34:
        return '"';
      case 47:
        return "/";
      case 92:
        return "\\";
      case 78:
        return "Â…";
      case 95:
        return "Â ";
      case 76:
        return "\u2028";
      case 80:
        return "\u2029";
      default:
        return "";
    }
  }
  function charFromCodepoint(c) {
    if (c <= 65535) {
      return String.fromCharCode(c);
    }
    return String.fromCharCode(
      (c - 65536 >> 10) + 55296,
      (c - 65536 & 1023) + 56320
    );
  }
  function setProperty(object, key, value) {
    if (key === "__proto__") {
      Object.defineProperty(object, key, {
        configurable: true,
        enumerable: true,
        writable: true,
        value
      });
    } else {
      object[key] = value;
    }
  }
  const simpleEscapeCheck = new Array(256);
  const simpleEscapeMap = new Array(256);
  for (let i = 0; i < 256; i++) {
    simpleEscapeCheck[i] = simpleEscapeSequence(i) ? 1 : 0;
    simpleEscapeMap[i] = simpleEscapeSequence(i);
  }
  function State(input, options) {
    this.input = input;
    this.filename = options["filename"] || null;
    this.schema = options["schema"] || DEFAULT_SCHEMA2;
    this.onWarning = options["onWarning"] || null;
    this.legacy = options["legacy"] || false;
    this.json = options["json"] || false;
    this.listener = options["listener"] || null;
    this.maxDepth = typeof options["maxDepth"] === "number" ? options["maxDepth"] : 100;
    this.maxTotalMergeKeys = typeof options["maxTotalMergeKeys"] === "number" ? options["maxTotalMergeKeys"] : 1e4;
    this.implicitTypes = this.schema.compiledImplicit;
    this.typeMap = this.schema.compiledTypeMap;
    this.length = input.length;
    this.position = 0;
    this.line = 0;
    this.lineStart = 0;
    this.lineIndent = 0;
    this.depth = 0;
    this.totalMergeKeys = 0;
    this.firstTabInLine = -1;
    this.documents = [];
    this.anchorMapTransactions = [];
  }
  function generateError(state, message) {
    const mark = {
      name: state.filename,
      buffer: state.input.slice(0, -1),
      // omit trailing \0
      position: state.position,
      line: state.line,
      column: state.position - state.lineStart
    };
    mark.snippet = makeSnippet(mark);
    return new YAMLException2(message, mark);
  }
  function throwError(state, message) {
    throw generateError(state, message);
  }
  function throwWarning(state, message) {
    if (state.onWarning) {
      state.onWarning.call(null, generateError(state, message));
    }
  }
  function storeAnchor(state, name, value) {
    const transactions = state.anchorMapTransactions;
    if (transactions.length !== 0) {
      const transaction = transactions[transactions.length - 1];
      if (!_hasOwnProperty.call(transaction, name)) {
        transaction[name] = {
          existed: _hasOwnProperty.call(state.anchorMap, name),
          value: state.anchorMap[name]
        };
      }
    }
    state.anchorMap[name] = value;
  }
  function beginAnchorTransaction(state) {
    state.anchorMapTransactions.push(/* @__PURE__ */ Object.create(null));
  }
  function commitAnchorTransaction(state) {
    const transaction = state.anchorMapTransactions.pop();
    const transactions = state.anchorMapTransactions;
    if (transactions.length === 0) return;
    const parent = transactions[transactions.length - 1];
    const names = Object.keys(transaction);
    for (let index = 0, length = names.length; index < length; index += 1) {
      const name = names[index];
      if (!_hasOwnProperty.call(parent, name)) {
        parent[name] = transaction[name];
      }
    }
  }
  function rollbackAnchorTransaction(state) {
    const transaction = state.anchorMapTransactions.pop();
    const names = Object.keys(transaction);
    for (let index = names.length - 1; index >= 0; index -= 1) {
      const entry = transaction[names[index]];
      if (entry.existed) {
        state.anchorMap[names[index]] = entry.value;
      } else {
        delete state.anchorMap[names[index]];
      }
    }
  }
  function snapshotState(state) {
    return {
      position: state.position,
      line: state.line,
      lineStart: state.lineStart,
      lineIndent: state.lineIndent,
      firstTabInLine: state.firstTabInLine,
      tag: state.tag,
      anchor: state.anchor,
      kind: state.kind,
      result: state.result
    };
  }
  function restoreState(state, snapshot) {
    state.position = snapshot.position;
    state.line = snapshot.line;
    state.lineStart = snapshot.lineStart;
    state.lineIndent = snapshot.lineIndent;
    state.firstTabInLine = snapshot.firstTabInLine;
    state.tag = snapshot.tag;
    state.anchor = snapshot.anchor;
    state.kind = snapshot.kind;
    state.result = snapshot.result;
  }
  const directiveHandlers = {
    YAML: function handleYamlDirective(state, name, args) {
      if (state.version !== null) {
        throwError(state, "duplication of %YAML directive");
      }
      if (args.length !== 1) {
        throwError(state, "YAML directive accepts exactly one argument");
      }
      const match = /^([0-9]+)\.([0-9]+)$/.exec(args[0]);
      if (match === null) {
        throwError(state, "ill-formed argument of the YAML directive");
      }
      const major = parseInt(match[1], 10);
      const minor = parseInt(match[2], 10);
      if (major !== 1) {
        throwError(state, "unacceptable YAML version of the document");
      }
      state.version = args[0];
      state.checkLineBreaks = minor < 2;
      if (minor !== 1 && minor !== 2) {
        throwWarning(state, "unsupported YAML version of the document");
      }
    },
    TAG: function handleTagDirective(state, name, args) {
      let prefix;
      if (args.length !== 2) {
        throwError(state, "TAG directive accepts exactly two arguments");
      }
      const handle = args[0];
      prefix = args[1];
      if (!PATTERN_TAG_HANDLE.test(handle)) {
        throwError(state, "ill-formed tag handle (first argument) of the TAG directive");
      }
      if (_hasOwnProperty.call(state.tagMap, handle)) {
        throwError(state, 'there is a previously declared suffix for "' + handle + '" tag handle');
      }
      if (!PATTERN_TAG_URI.test(prefix)) {
        throwError(state, "ill-formed tag prefix (second argument) of the TAG directive");
      }
      try {
        prefix = decodeURIComponent(prefix);
      } catch (err) {
        throwError(state, "tag prefix is malformed: " + prefix);
      }
      state.tagMap[handle] = prefix;
    }
  };
  function captureSegment(state, start, end, checkJson) {
    if (start < end) {
      const _result = state.input.slice(start, end);
      if (checkJson) {
        for (let _position = 0, _length = _result.length; _position < _length; _position += 1) {
          const _character = _result.charCodeAt(_position);
          if (!(_character === 9 || _character >= 32 && _character <= 1114111)) {
            throwError(state, "expected valid JSON character");
          }
        }
      } else if (PATTERN_NON_PRINTABLE.test(_result)) {
        throwError(state, "the stream contains non-printable characters");
      }
      state.result += _result;
    }
  }
  function mergeMappings(state, destination, source, overridableKeys) {
    if (!common2.isObject(source)) {
      throwError(state, "cannot merge mappings; the provided source object is unacceptable");
    }
    const sourceKeys = Object.keys(source);
    for (let index = 0, quantity = sourceKeys.length; index < quantity; index += 1) {
      const key = sourceKeys[index];
      if (state.maxTotalMergeKeys !== -1 && ++state.totalMergeKeys > state.maxTotalMergeKeys) {
        throwError(state, "merge keys exceeded maxTotalMergeKeys (" + state.maxTotalMergeKeys + ")");
      }
      if (!_hasOwnProperty.call(destination, key)) {
        setProperty(destination, key, source[key]);
        overridableKeys[key] = true;
      }
    }
  }
  function storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, startLine, startLineStart, startPos) {
    if (Array.isArray(keyNode)) {
      keyNode = Array.prototype.slice.call(keyNode);
      for (let index = 0, quantity = keyNode.length; index < quantity; index += 1) {
        if (Array.isArray(keyNode[index])) {
          throwError(state, "nested arrays are not supported inside keys");
        }
        if (typeof keyNode === "object" && _class(keyNode[index]) === "[object Object]") {
          keyNode[index] = "[object Object]";
        }
      }
    }
    if (typeof keyNode === "object" && _class(keyNode) === "[object Object]") {
      keyNode = "[object Object]";
    }
    keyNode = String(keyNode);
    if (_result === null) {
      _result = {};
    }
    if (keyTag === "tag:yaml.org,2002:merge") {
      if (Array.isArray(valueNode)) {
        for (let index = 0, quantity = valueNode.length; index < quantity; index += 1) {
          mergeMappings(state, _result, valueNode[index], overridableKeys);
        }
      } else {
        mergeMappings(state, _result, valueNode, overridableKeys);
      }
    } else {
      if (!state.json && !_hasOwnProperty.call(overridableKeys, keyNode) && _hasOwnProperty.call(_result, keyNode)) {
        state.line = startLine || state.line;
        state.lineStart = startLineStart || state.lineStart;
        state.position = startPos || state.position;
        throwError(state, "duplicated mapping key");
      }
      setProperty(_result, keyNode, valueNode);
      delete overridableKeys[keyNode];
    }
    return _result;
  }
  function readLineBreak(state) {
    const ch = state.input.charCodeAt(state.position);
    if (ch === 10) {
      state.position++;
    } else if (ch === 13) {
      state.position++;
      if (state.input.charCodeAt(state.position) === 10) {
        state.position++;
      }
    } else {
      throwError(state, "a line break is expected");
    }
    state.line += 1;
    state.lineStart = state.position;
    state.firstTabInLine = -1;
  }
  function skipSeparationSpace(state, allowComments, checkIndent) {
    let lineBreaks = 0;
    let ch = state.input.charCodeAt(state.position);
    while (ch !== 0) {
      while (isWhiteSpace(ch)) {
        if (ch === 9 && state.firstTabInLine === -1) {
          state.firstTabInLine = state.position;
        }
        ch = state.input.charCodeAt(++state.position);
      }
      if (allowComments && ch === 35) {
        do {
          ch = state.input.charCodeAt(++state.position);
        } while (ch !== 10 && ch !== 13 && ch !== 0);
      }
      if (isEol(ch)) {
        readLineBreak(state);
        ch = state.input.charCodeAt(state.position);
        lineBreaks++;
        state.lineIndent = 0;
        while (ch === 32) {
          state.lineIndent++;
          ch = state.input.charCodeAt(++state.position);
        }
      } else {
        break;
      }
    }
    if (checkIndent !== -1 && lineBreaks !== 0 && state.lineIndent < checkIndent) {
      throwWarning(state, "deficient indentation");
    }
    return lineBreaks;
  }
  function testDocumentSeparator(state) {
    let _position = state.position;
    let ch = state.input.charCodeAt(_position);
    if ((ch === 45 || ch === 46) && ch === state.input.charCodeAt(_position + 1) && ch === state.input.charCodeAt(_position + 2)) {
      _position += 3;
      ch = state.input.charCodeAt(_position);
      if (ch === 0 || isWsOrEol(ch)) {
        return true;
      }
    }
    return false;
  }
  function writeFoldedLines(state, count) {
    if (count === 1) {
      state.result += " ";
    } else if (count > 1) {
      state.result += common2.repeat("\n", count - 1);
    }
  }
  function readPlainScalar(state, nodeIndent, withinFlowCollection) {
    let captureStart;
    let captureEnd;
    let hasPendingContent;
    let _line;
    let _lineStart;
    let _lineIndent;
    const _kind = state.kind;
    const _result = state.result;
    let ch = state.input.charCodeAt(state.position);
    if (isWsOrEol(ch) || isFlowIndicator(ch) || ch === 35 || ch === 38 || ch === 42 || ch === 33 || ch === 124 || ch === 62 || ch === 39 || ch === 34 || ch === 37 || ch === 64 || ch === 96) {
      return false;
    }
    if (ch === 63 || ch === 45) {
      const following = state.input.charCodeAt(state.position + 1);
      if (isWsOrEol(following) || withinFlowCollection && isFlowIndicator(following)) {
        return false;
      }
    }
    state.kind = "scalar";
    state.result = "";
    captureStart = captureEnd = state.position;
    hasPendingContent = false;
    while (ch !== 0) {
      if (ch === 58) {
        const following = state.input.charCodeAt(state.position + 1);
        if (isWsOrEol(following) || withinFlowCollection && isFlowIndicator(following)) {
          break;
        }
      } else if (ch === 35) {
        const preceding = state.input.charCodeAt(state.position - 1);
        if (isWsOrEol(preceding)) {
          break;
        }
      } else if (state.position === state.lineStart && testDocumentSeparator(state) || withinFlowCollection && isFlowIndicator(ch)) {
        break;
      } else if (isEol(ch)) {
        _line = state.line;
        _lineStart = state.lineStart;
        _lineIndent = state.lineIndent;
        skipSeparationSpace(state, false, -1);
        if (state.lineIndent >= nodeIndent) {
          hasPendingContent = true;
          ch = state.input.charCodeAt(state.position);
          continue;
        } else {
          state.position = captureEnd;
          state.line = _line;
          state.lineStart = _lineStart;
          state.lineIndent = _lineIndent;
          break;
        }
      }
      if (hasPendingContent) {
        captureSegment(state, captureStart, captureEnd, false);
        writeFoldedLines(state, state.line - _line);
        captureStart = captureEnd = state.position;
        hasPendingContent = false;
      }
      if (!isWhiteSpace(ch)) {
        captureEnd = state.position + 1;
      }
      ch = state.input.charCodeAt(++state.position);
    }
    captureSegment(state, captureStart, captureEnd, false);
    if (state.result) {
      return true;
    }
    state.kind = _kind;
    state.result = _result;
    return false;
  }
  function readSingleQuotedScalar(state, nodeIndent) {
    let captureStart;
    let captureEnd;
    let ch = state.input.charCodeAt(state.position);
    if (ch !== 39) {
      return false;
    }
    state.kind = "scalar";
    state.result = "";
    state.position++;
    captureStart = captureEnd = state.position;
    while ((ch = state.input.charCodeAt(state.position)) !== 0) {
      if (ch === 39) {
        captureSegment(state, captureStart, state.position, true);
        ch = state.input.charCodeAt(++state.position);
        if (ch === 39) {
          captureStart = state.position;
          state.position++;
          captureEnd = state.position;
        } else {
          return true;
        }
      } else if (isEol(ch)) {
        captureSegment(state, captureStart, captureEnd, true);
        writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent));
        captureStart = captureEnd = state.position;
      } else if (state.position === state.lineStart && testDocumentSeparator(state)) {
        throwError(state, "unexpected end of the document within a single quoted scalar");
      } else {
        state.position++;
        if (!isWhiteSpace(ch)) {
          captureEnd = state.position;
        }
      }
    }
    throwError(state, "unexpected end of the stream within a single quoted scalar");
  }
  function readDoubleQuotedScalar(state, nodeIndent) {
    let captureStart;
    let captureEnd;
    let tmp;
    let ch = state.input.charCodeAt(state.position);
    if (ch !== 34) {
      return false;
    }
    state.kind = "scalar";
    state.result = "";
    state.position++;
    captureStart = captureEnd = state.position;
    while ((ch = state.input.charCodeAt(state.position)) !== 0) {
      if (ch === 34) {
        captureSegment(state, captureStart, state.position, true);
        state.position++;
        return true;
      } else if (ch === 92) {
        captureSegment(state, captureStart, state.position, true);
        ch = state.input.charCodeAt(++state.position);
        if (isEol(ch)) {
          skipSeparationSpace(state, false, nodeIndent);
        } else if (ch < 256 && simpleEscapeCheck[ch]) {
          state.result += simpleEscapeMap[ch];
          state.position++;
        } else if ((tmp = escapedHexLen(ch)) > 0) {
          let hexLength = tmp;
          let hexResult = 0;
          for (; hexLength > 0; hexLength--) {
            ch = state.input.charCodeAt(++state.position);
            if ((tmp = fromHexCode(ch)) >= 0) {
              hexResult = (hexResult << 4) + tmp;
            } else {
              throwError(state, "expected hexadecimal character");
            }
          }
          state.result += charFromCodepoint(hexResult);
          state.position++;
        } else {
          throwError(state, "unknown escape sequence");
        }
        captureStart = captureEnd = state.position;
      } else if (isEol(ch)) {
        captureSegment(state, captureStart, captureEnd, true);
        writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent));
        captureStart = captureEnd = state.position;
      } else if (state.position === state.lineStart && testDocumentSeparator(state)) {
        throwError(state, "unexpected end of the document within a double quoted scalar");
      } else {
        state.position++;
        if (!isWhiteSpace(ch)) {
          captureEnd = state.position;
        }
      }
    }
    throwError(state, "unexpected end of the stream within a double quoted scalar");
  }
  function readFlowCollection(state, nodeIndent) {
    let readNext = true;
    let _line;
    let _lineStart;
    let _pos;
    const _tag = state.tag;
    let _result;
    const _anchor = state.anchor;
    let terminator;
    let isPair;
    let isExplicitPair;
    let isMapping;
    const overridableKeys = /* @__PURE__ */ Object.create(null);
    let keyNode;
    let keyTag;
    let valueNode;
    let ch = state.input.charCodeAt(state.position);
    if (ch === 91) {
      terminator = 93;
      isMapping = false;
      _result = [];
    } else if (ch === 123) {
      terminator = 125;
      isMapping = true;
      _result = {};
    } else {
      return false;
    }
    if (state.anchor !== null) {
      storeAnchor(state, state.anchor, _result);
    }
    ch = state.input.charCodeAt(++state.position);
    while (ch !== 0) {
      skipSeparationSpace(state, true, nodeIndent);
      ch = state.input.charCodeAt(state.position);
      if (ch === terminator) {
        state.position++;
        state.tag = _tag;
        state.anchor = _anchor;
        state.kind = isMapping ? "mapping" : "sequence";
        state.result = _result;
        return true;
      } else if (!readNext) {
        throwError(state, "missed comma between flow collection entries");
      } else if (ch === 44) {
        throwError(state, "expected the node content, but found ','");
      }
      keyTag = keyNode = valueNode = null;
      isPair = isExplicitPair = false;
      if (ch === 63) {
        const following = state.input.charCodeAt(state.position + 1);
        if (isWsOrEol(following)) {
          isPair = isExplicitPair = true;
          state.position++;
          skipSeparationSpace(state, true, nodeIndent);
        }
      }
      _line = state.line;
      _lineStart = state.lineStart;
      _pos = state.position;
      composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true);
      keyTag = state.tag;
      keyNode = state.result;
      skipSeparationSpace(state, true, nodeIndent);
      ch = state.input.charCodeAt(state.position);
      if ((isExplicitPair || state.line === _line) && ch === 58) {
        isPair = true;
        ch = state.input.charCodeAt(++state.position);
        skipSeparationSpace(state, true, nodeIndent);
        composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true);
        valueNode = state.result;
      }
      if (isMapping) {
        storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos);
      } else if (isPair) {
        _result.push(storeMappingPair(state, null, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos));
      } else {
        _result.push(keyNode);
      }
      skipSeparationSpace(state, true, nodeIndent);
      ch = state.input.charCodeAt(state.position);
      if (ch === 44) {
        readNext = true;
        ch = state.input.charCodeAt(++state.position);
      } else {
        readNext = false;
      }
    }
    throwError(state, "unexpected end of the stream within a flow collection");
  }
  function readBlockScalar(state, nodeIndent) {
    let folding;
    let chomping = CHOMPING_CLIP;
    let didReadContent = false;
    let detectedIndent = false;
    let textIndent = nodeIndent;
    let emptyLines = 0;
    let atMoreIndented = false;
    let tmp;
    let ch = state.input.charCodeAt(state.position);
    if (ch === 124) {
      folding = false;
    } else if (ch === 62) {
      folding = true;
    } else {
      return false;
    }
    state.kind = "scalar";
    state.result = "";
    while (ch !== 0) {
      ch = state.input.charCodeAt(++state.position);
      if (ch === 43 || ch === 45) {
        if (CHOMPING_CLIP === chomping) {
          chomping = ch === 43 ? CHOMPING_KEEP : CHOMPING_STRIP;
        } else {
          throwError(state, "repeat of a chomping mode identifier");
        }
      } else if ((tmp = fromDecimalCode(ch)) >= 0) {
        if (tmp === 0) {
          throwError(state, "bad explicit indentation width of a block scalar; it cannot be less than one");
        } else if (!detectedIndent) {
          textIndent = nodeIndent + tmp - 1;
          detectedIndent = true;
        } else {
          throwError(state, "repeat of an indentation width identifier");
        }
      } else {
        break;
      }
    }
    if (isWhiteSpace(ch)) {
      do {
        ch = state.input.charCodeAt(++state.position);
      } while (isWhiteSpace(ch));
      if (ch === 35) {
        do {
          ch = state.input.charCodeAt(++state.position);
        } while (!isEol(ch) && ch !== 0);
      }
    }
    while (ch !== 0) {
      readLineBreak(state);
      state.lineIndent = 0;
      ch = state.input.charCodeAt(state.position);
      while ((!detectedIndent || state.lineIndent < textIndent) && ch === 32) {
        state.lineIndent++;
        ch = state.input.charCodeAt(++state.position);
      }
      if (!detectedIndent && state.lineIndent > textIndent) {
        textIndent = state.lineIndent;
      }
      if (isEol(ch)) {
        emptyLines++;
        continue;
      }
      if (!detectedIndent && textIndent === 0) {
        throwError(state, "missing indentation for block scalar");
      }
      if (state.lineIndent < textIndent) {
        if (chomping === CHOMPING_KEEP) {
          state.result += common2.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines);
        } else if (chomping === CHOMPING_CLIP) {
          if (didReadContent) {
            state.result += "\n";
          }
        }
        break;
      }
      if (folding) {
        if (isWhiteSpace(ch)) {
          atMoreIndented = true;
          state.result += common2.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines);
        } else if (atMoreIndented) {
          atMoreIndented = false;
          state.result += common2.repeat("\n", emptyLines + 1);
        } else if (emptyLines === 0) {
          if (didReadContent) {
            state.result += " ";
          }
        } else {
          state.result += common2.repeat("\n", emptyLines);
        }
      } else {
        state.result += common2.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines);
      }
      didReadContent = true;
      detectedIndent = true;
      emptyLines = 0;
      const captureStart = state.position;
      while (!isEol(ch) && ch !== 0) {
        ch = state.input.charCodeAt(++state.position);
      }
      captureSegment(state, captureStart, state.position, false);
    }
    return true;
  }
  function readBlockSequence(state, nodeIndent) {
    const _tag = state.tag;
    const _anchor = state.anchor;
    const _result = [];
    let detected = false;
    if (state.firstTabInLine !== -1) return false;
    if (state.anchor !== null) {
      storeAnchor(state, state.anchor, _result);
    }
    let ch = state.input.charCodeAt(state.position);
    while (ch !== 0) {
      if (state.firstTabInLine !== -1) {
        state.position = state.firstTabInLine;
        throwError(state, "tab characters must not be used in indentation");
      }
      if (ch !== 45) {
        break;
      }
      const following = state.input.charCodeAt(state.position + 1);
      if (!isWsOrEol(following)) {
        break;
      }
      detected = true;
      state.position++;
      if (skipSeparationSpace(state, true, -1)) {
        if (state.lineIndent <= nodeIndent) {
          _result.push(null);
          ch = state.input.charCodeAt(state.position);
          continue;
        }
      }
      const _line = state.line;
      composeNode(state, nodeIndent, CONTEXT_BLOCK_IN, false, true);
      _result.push(state.result);
      skipSeparationSpace(state, true, -1);
      ch = state.input.charCodeAt(state.position);
      if ((state.line === _line || state.lineIndent > nodeIndent) && ch !== 0) {
        throwError(state, "bad indentation of a sequence entry");
      } else if (state.lineIndent < nodeIndent) {
        break;
      }
    }
    if (detected) {
      state.tag = _tag;
      state.anchor = _anchor;
      state.kind = "sequence";
      state.result = _result;
      return true;
    }
    return false;
  }
  function readBlockMapping(state, nodeIndent, flowIndent) {
    let allowCompact;
    let _keyLine;
    let _keyLineStart;
    let _keyPos;
    const _tag = state.tag;
    const _anchor = state.anchor;
    const _result = {};
    const overridableKeys = /* @__PURE__ */ Object.create(null);
    let keyTag = null;
    let keyNode = null;
    let valueNode = null;
    let atExplicitKey = false;
    let detected = false;
    if (state.firstTabInLine !== -1) return false;
    if (state.anchor !== null) {
      storeAnchor(state, state.anchor, _result);
    }
    let ch = state.input.charCodeAt(state.position);
    while (ch !== 0) {
      if (!atExplicitKey && state.firstTabInLine !== -1) {
        state.position = state.firstTabInLine;
        throwError(state, "tab characters must not be used in indentation");
      }
      const following = state.input.charCodeAt(state.position + 1);
      const _line = state.line;
      if ((ch === 63 || ch === 58) && isWsOrEol(following)) {
        if (ch === 63) {
          if (atExplicitKey) {
            storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos);
            keyTag = keyNode = valueNode = null;
          }
          detected = true;
          atExplicitKey = true;
          allowCompact = true;
        } else if (atExplicitKey) {
          atExplicitKey = false;
          allowCompact = true;
        } else {
          throwError(state, "incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line");
        }
        state.position += 1;
        ch = following;
      } else {
        _keyLine = state.line;
        _keyLineStart = state.lineStart;
        _keyPos = state.position;
        if (!composeNode(state, flowIndent, CONTEXT_FLOW_OUT, false, true)) {
          break;
        }
        if (state.line === _line) {
          ch = state.input.charCodeAt(state.position);
          while (isWhiteSpace(ch)) {
            ch = state.input.charCodeAt(++state.position);
          }
          if (ch === 58) {
            ch = state.input.charCodeAt(++state.position);
            if (!isWsOrEol(ch)) {
              throwError(state, "a whitespace character is expected after the key-value separator within a block mapping");
            }
            if (atExplicitKey) {
              storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos);
              keyTag = keyNode = valueNode = null;
            }
            detected = true;
            atExplicitKey = false;
            allowCompact = false;
            keyTag = state.tag;
            keyNode = state.result;
          } else if (detected) {
            throwError(state, "can not read an implicit mapping pair; a colon is missed");
          } else {
            state.tag = _tag;
            state.anchor = _anchor;
            return true;
          }
        } else if (detected) {
          throwError(state, "can not read a block mapping entry; a multiline key may not be an implicit key");
        } else {
          state.tag = _tag;
          state.anchor = _anchor;
          return true;
        }
      }
      if (state.line === _line || state.lineIndent > nodeIndent) {
        if (atExplicitKey) {
          _keyLine = state.line;
          _keyLineStart = state.lineStart;
          _keyPos = state.position;
        }
        if (composeNode(state, nodeIndent, CONTEXT_BLOCK_OUT, true, allowCompact)) {
          if (atExplicitKey) {
            keyNode = state.result;
          } else {
            valueNode = state.result;
          }
        }
        if (!atExplicitKey) {
          storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _keyLine, _keyLineStart, _keyPos);
          keyTag = keyNode = valueNode = null;
        }
        skipSeparationSpace(state, true, -1);
        ch = state.input.charCodeAt(state.position);
      }
      if ((state.line === _line || state.lineIndent > nodeIndent) && ch !== 0) {
        throwError(state, "bad indentation of a mapping entry");
      } else if (state.lineIndent < nodeIndent) {
        break;
      }
    }
    if (atExplicitKey) {
      storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos);
    }
    if (detected) {
      state.tag = _tag;
      state.anchor = _anchor;
      state.kind = "mapping";
      state.result = _result;
    }
    return detected;
  }
  function readTagProperty(state) {
    let isVerbatim = false;
    let isNamed = false;
    let tagHandle;
    let tagName;
    let ch = state.input.charCodeAt(state.position);
    if (ch !== 33) return false;
    if (state.tag !== null) {
      throwError(state, "duplication of a tag property");
    }
    ch = state.input.charCodeAt(++state.position);
    if (ch === 60) {
      isVerbatim = true;
      ch = state.input.charCodeAt(++state.position);
    } else if (ch === 33) {
      isNamed = true;
      tagHandle = "!!";
      ch = state.input.charCodeAt(++state.position);
    } else {
      tagHandle = "!";
    }
    let _position = state.position;
    if (isVerbatim) {
      do {
        ch = state.input.charCodeAt(++state.position);
      } while (ch !== 0 && ch !== 62);
      if (state.position < state.length) {
        tagName = state.input.slice(_position, state.position);
        ch = state.input.charCodeAt(++state.position);
      } else {
        throwError(state, "unexpected end of the stream within a verbatim tag");
      }
    } else {
      while (ch !== 0 && !isWsOrEol(ch)) {
        if (ch === 33) {
          if (!isNamed) {
            tagHandle = state.input.slice(_position - 1, state.position + 1);
            if (!PATTERN_TAG_HANDLE.test(tagHandle)) {
              throwError(state, "named tag handle cannot contain such characters");
            }
            isNamed = true;
            _position = state.position + 1;
          } else {
            throwError(state, "tag suffix cannot contain exclamation marks");
          }
        }
        ch = state.input.charCodeAt(++state.position);
      }
      tagName = state.input.slice(_position, state.position);
      if (PATTERN_FLOW_INDICATORS.test(tagName)) {
        throwError(state, "tag suffix cannot contain flow indicator characters");
      }
    }
    if (tagName && !PATTERN_TAG_URI.test(tagName)) {
      throwError(state, "tag name cannot contain such characters: " + tagName);
    }
    try {
      tagName = decodeURIComponent(tagName);
    } catch (err) {
      throwError(state, "tag name is malformed: " + tagName);
    }
    if (isVerbatim) {
      state.tag = tagName;
    } else if (_hasOwnProperty.call(state.tagMap, tagHandle)) {
      state.tag = state.tagMap[tagHandle] + tagName;
    } else if (tagHandle === "!") {
      state.tag = "!" + tagName;
    } else if (tagHandle === "!!") {
      state.tag = "tag:yaml.org,2002:" + tagName;
    } else {
      throwError(state, 'undeclared tag handle "' + tagHandle + '"');
    }
    return true;
  }
  function readAnchorProperty(state) {
    let ch = state.input.charCodeAt(state.position);
    if (ch !== 38) return false;
    if (state.anchor !== null) {
      throwError(state, "duplication of an anchor property");
    }
    ch = state.input.charCodeAt(++state.position);
    const _position = state.position;
    while (ch !== 0 && !isWsOrEol(ch) && !isFlowIndicator(ch)) {
      ch = state.input.charCodeAt(++state.position);
    }
    if (state.position === _position) {
      throwError(state, "name of an anchor node must contain at least one character");
    }
    state.anchor = state.input.slice(_position, state.position);
    return true;
  }
  function readAlias(state) {
    let ch = state.input.charCodeAt(state.position);
    if (ch !== 42) return false;
    ch = state.input.charCodeAt(++state.position);
    const _position = state.position;
    while (ch !== 0 && !isWsOrEol(ch) && !isFlowIndicator(ch)) {
      ch = state.input.charCodeAt(++state.position);
    }
    if (state.position === _position) {
      throwError(state, "name of an alias node must contain at least one character");
    }
    const alias = state.input.slice(_position, state.position);
    if (!_hasOwnProperty.call(state.anchorMap, alias)) {
      throwError(state, 'unidentified alias "' + alias + '"');
    }
    state.result = state.anchorMap[alias];
    skipSeparationSpace(state, true, -1);
    return true;
  }
  function tryReadBlockMappingFromProperty(state, propertyStart, nodeIndent, flowIndent) {
    const fallbackState = snapshotState(state);
    beginAnchorTransaction(state);
    restoreState(state, propertyStart);
    state.tag = null;
    state.anchor = null;
    state.kind = null;
    state.result = null;
    if (readBlockMapping(state, nodeIndent, flowIndent) && state.kind === "mapping") {
      commitAnchorTransaction(state);
      return true;
    }
    rollbackAnchorTransaction(state);
    restoreState(state, fallbackState);
    return false;
  }
  function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact) {
    let allowBlockScalars;
    let allowBlockCollections;
    let indentStatus = 1;
    let atNewLine = false;
    let hasContent = false;
    let propertyStart = null;
    let type2;
    let flowIndent;
    let blockIndent;
    if (state.depth >= state.maxDepth) {
      throwError(state, "nesting exceeded maxDepth (" + state.maxDepth + ")");
    }
    state.depth += 1;
    if (state.listener !== null) {
      state.listener("open", state);
    }
    state.tag = null;
    state.anchor = null;
    state.kind = null;
    state.result = null;
    const allowBlockStyles = allowBlockScalars = allowBlockCollections = CONTEXT_BLOCK_OUT === nodeContext || CONTEXT_BLOCK_IN === nodeContext;
    if (allowToSeek) {
      if (skipSeparationSpace(state, true, -1)) {
        atNewLine = true;
        if (state.lineIndent > parentIndent) {
          indentStatus = 1;
        } else if (state.lineIndent === parentIndent) {
          indentStatus = 0;
        } else if (state.lineIndent < parentIndent) {
          indentStatus = -1;
        }
      }
    }
    if (indentStatus === 1) {
      while (true) {
        const ch = state.input.charCodeAt(state.position);
        const propertyState = snapshotState(state);
        if (atNewLine && (ch === 33 && state.tag !== null || ch === 38 && state.anchor !== null)) {
          break;
        }
        if (!readTagProperty(state) && !readAnchorProperty(state)) {
          break;
        }
        if (propertyStart === null) {
          propertyStart = propertyState;
        }
        if (skipSeparationSpace(state, true, -1)) {
          atNewLine = true;
          allowBlockCollections = allowBlockStyles;
          if (state.lineIndent > parentIndent) {
            indentStatus = 1;
          } else if (state.lineIndent === parentIndent) {
            indentStatus = 0;
          } else if (state.lineIndent < parentIndent) {
            indentStatus = -1;
          }
        } else {
          allowBlockCollections = false;
        }
      }
    }
    if (allowBlockCollections) {
      allowBlockCollections = atNewLine || allowCompact;
    }
    if (indentStatus === 1 || CONTEXT_BLOCK_OUT === nodeContext) {
      if (CONTEXT_FLOW_IN === nodeContext || CONTEXT_FLOW_OUT === nodeContext) {
        flowIndent = parentIndent;
      } else {
        flowIndent = parentIndent + 1;
      }
      blockIndent = state.position - state.lineStart;
      if (indentStatus === 1) {
        if (allowBlockCollections && (readBlockSequence(state, blockIndent) || readBlockMapping(state, blockIndent, flowIndent)) || readFlowCollection(state, flowIndent)) {
          hasContent = true;
        } else {
          const ch = state.input.charCodeAt(state.position);
          if (propertyStart !== null && allowBlockStyles && !allowBlockCollections && ch !== 124 && ch !== 62 && tryReadBlockMappingFromProperty(
            state,
            propertyStart,
            propertyStart.position - propertyStart.lineStart,
            flowIndent
          )) {
            hasContent = true;
          } else if (allowBlockScalars && readBlockScalar(state, flowIndent) || readSingleQuotedScalar(state, flowIndent) || readDoubleQuotedScalar(state, flowIndent)) {
            hasContent = true;
          } else if (readAlias(state)) {
            hasContent = true;
            if (state.tag !== null || state.anchor !== null) {
              throwError(state, "alias node should not have any properties");
            }
          } else if (readPlainScalar(state, flowIndent, CONTEXT_FLOW_IN === nodeContext)) {
            hasContent = true;
            if (state.tag === null) {
              state.tag = "?";
            }
          }
          if (state.anchor !== null) {
            storeAnchor(state, state.anchor, state.result);
          }
        }
      } else if (indentStatus === 0) {
        hasContent = allowBlockCollections && readBlockSequence(state, blockIndent);
      }
    }
    if (state.tag === null) {
      if (state.anchor !== null) {
        storeAnchor(state, state.anchor, state.result);
      }
    } else if (state.tag === "?") {
      if (state.result !== null && state.kind !== "scalar") {
        throwError(state, 'unacceptable node kind for !<?> tag; it should be "scalar", not "' + state.kind + '"');
      }
      for (let typeIndex = 0, typeQuantity = state.implicitTypes.length; typeIndex < typeQuantity; typeIndex += 1) {
        type2 = state.implicitTypes[typeIndex];
        if (type2.resolve(state.result)) {
          state.result = type2.construct(state.result);
          state.tag = type2.tag;
          if (state.anchor !== null) {
            storeAnchor(state, state.anchor, state.result);
          }
          break;
        }
      }
    } else if (state.tag !== "!") {
      if (_hasOwnProperty.call(state.typeMap[state.kind || "fallback"], state.tag)) {
        type2 = state.typeMap[state.kind || "fallback"][state.tag];
      } else {
        type2 = null;
        const typeList = state.typeMap.multi[state.kind || "fallback"];
        for (let typeIndex = 0, typeQuantity = typeList.length; typeIndex < typeQuantity; typeIndex += 1) {
          if (state.tag.slice(0, typeList[typeIndex].tag.length) === typeList[typeIndex].tag) {
            type2 = typeList[typeIndex];
            break;
          }
        }
      }
      if (!type2) {
        throwError(state, "unknown tag !<" + state.tag + ">");
      }
      if (state.result !== null && type2.kind !== state.kind) {
        throwError(state, "unacceptable node kind for !<" + state.tag + '> tag; it should be "' + type2.kind + '", not "' + state.kind + '"');
      }
      if (!type2.resolve(state.result, state.tag)) {
        throwError(state, "cannot resolve a node with !<" + state.tag + "> explicit tag");
      } else {
        state.result = type2.construct(state.result, state.tag);
        if (state.anchor !== null) {
          storeAnchor(state, state.anchor, state.result);
        }
      }
    }
    if (state.listener !== null) {
      state.listener("close", state);
    }
    state.depth -= 1;
    return state.tag !== null || state.anchor !== null || hasContent;
  }
  function readDocument(state) {
    const documentStart = state.position;
    let hasDirectives = false;
    let ch;
    state.version = null;
    state.checkLineBreaks = state.legacy;
    state.tagMap = /* @__PURE__ */ Object.create(null);
    state.anchorMap = /* @__PURE__ */ Object.create(null);
    while ((ch = state.input.charCodeAt(state.position)) !== 0) {
      skipSeparationSpace(state, true, -1);
      ch = state.input.charCodeAt(state.position);
      if (state.lineIndent > 0 || ch !== 37) {
        break;
      }
      hasDirectives = true;
      ch = state.input.charCodeAt(++state.position);
      let _position = state.position;
      while (ch !== 0 && !isWsOrEol(ch)) {
        ch = state.input.charCodeAt(++state.position);
      }
      const directiveName = state.input.slice(_position, state.position);
      const directiveArgs = [];
      if (directiveName.length < 1) {
        throwError(state, "directive name must not be less than one character in length");
      }
      while (ch !== 0) {
        while (isWhiteSpace(ch)) {
          ch = state.input.charCodeAt(++state.position);
        }
        if (ch === 35) {
          do {
            ch = state.input.charCodeAt(++state.position);
          } while (ch !== 0 && !isEol(ch));
          break;
        }
        if (isEol(ch)) break;
        _position = state.position;
        while (ch !== 0 && !isWsOrEol(ch)) {
          ch = state.input.charCodeAt(++state.position);
        }
        directiveArgs.push(state.input.slice(_position, state.position));
      }
      if (ch !== 0) readLineBreak(state);
      if (_hasOwnProperty.call(directiveHandlers, directiveName)) {
        directiveHandlers[directiveName](state, directiveName, directiveArgs);
      } else {
        throwWarning(state, 'unknown document directive "' + directiveName + '"');
      }
    }
    skipSeparationSpace(state, true, -1);
    if (state.lineIndent === 0 && state.input.charCodeAt(state.position) === 45 && state.input.charCodeAt(state.position + 1) === 45 && state.input.charCodeAt(state.position + 2) === 45) {
      state.position += 3;
      skipSeparationSpace(state, true, -1);
    } else if (hasDirectives) {
      throwError(state, "directives end mark is expected");
    }
    composeNode(state, state.lineIndent - 1, CONTEXT_BLOCK_OUT, false, true);
    skipSeparationSpace(state, true, -1);
    if (state.checkLineBreaks && PATTERN_NON_ASCII_LINE_BREAKS.test(state.input.slice(documentStart, state.position))) {
      throwWarning(state, "non-ASCII line breaks are interpreted as content");
    }
    state.documents.push(state.result);
    if (state.position === state.lineStart && testDocumentSeparator(state)) {
      if (state.input.charCodeAt(state.position) === 46) {
        state.position += 3;
        skipSeparationSpace(state, true, -1);
      }
      return;
    }
    if (state.position < state.length - 1) {
      throwError(state, "end of the stream or a document separator is expected");
    }
  }
  function loadDocuments(input, options) {
    input = String(input);
    options = options || {};
    if (input.length !== 0) {
      if (input.charCodeAt(input.length - 1) !== 10 && input.charCodeAt(input.length - 1) !== 13) {
        input += "\n";
      }
      if (input.charCodeAt(0) === 65279) {
        input = input.slice(1);
      }
    }
    const state = new State(input, options);
    const nullpos = input.indexOf("\0");
    if (nullpos !== -1) {
      state.position = nullpos;
      throwError(state, "null byte is not allowed in input");
    }
    state.input += "\0";
    while (state.input.charCodeAt(state.position) === 32) {
      state.lineIndent += 1;
      state.position += 1;
    }
    while (state.position < state.length - 1) {
      readDocument(state);
    }
    return state.documents;
  }
  function loadAll2(input, iterator, options) {
    if (iterator !== null && typeof iterator === "object" && typeof options === "undefined") {
      options = iterator;
      iterator = null;
    }
    const documents = loadDocuments(input, options);
    if (typeof iterator !== "function") {
      return documents;
    }
    for (let index = 0, length = documents.length; index < length; index += 1) {
      iterator(documents[index]);
    }
  }
  function load2(input, options) {
    const documents = loadDocuments(input, options);
    if (documents.length === 0) {
      return void 0;
    } else if (documents.length === 1) {
      return documents[0];
    }
    throw new YAMLException2("expected a single document in the stream, but found more");
  }
  loader.loadAll = loadAll2;
  loader.load = load2;
  return loader;
}
var dumper = {};
var hasRequiredDumper;
function requireDumper() {
  if (hasRequiredDumper) return dumper;
  hasRequiredDumper = 1;
  const common2 = requireCommon();
  const YAMLException2 = requireException();
  const DEFAULT_SCHEMA2 = require_default();
  const _toString = Object.prototype.toString;
  const _hasOwnProperty = Object.prototype.hasOwnProperty;
  const CHAR_BOM = 65279;
  const CHAR_TAB = 9;
  const CHAR_LINE_FEED = 10;
  const CHAR_CARRIAGE_RETURN = 13;
  const CHAR_SPACE = 32;
  const CHAR_EXCLAMATION = 33;
  const CHAR_DOUBLE_QUOTE = 34;
  const CHAR_SHARP = 35;
  const CHAR_PERCENT = 37;
  const CHAR_AMPERSAND = 38;
  const CHAR_SINGLE_QUOTE = 39;
  const CHAR_ASTERISK = 42;
  const CHAR_COMMA = 44;
  const CHAR_MINUS = 45;
  const CHAR_COLON = 58;
  const CHAR_EQUALS = 61;
  const CHAR_GREATER_THAN = 62;
  const CHAR_QUESTION = 63;
  const CHAR_COMMERCIAL_AT = 64;
  const CHAR_LEFT_SQUARE_BRACKET = 91;
  const CHAR_RIGHT_SQUARE_BRACKET = 93;
  const CHAR_GRAVE_ACCENT = 96;
  const CHAR_LEFT_CURLY_BRACKET = 123;
  const CHAR_VERTICAL_LINE = 124;
  const CHAR_RIGHT_CURLY_BRACKET = 125;
  const ESCAPE_SEQUENCES = {};
  ESCAPE_SEQUENCES[0] = "\\0";
  ESCAPE_SEQUENCES[7] = "\\a";
  ESCAPE_SEQUENCES[8] = "\\b";
  ESCAPE_SEQUENCES[9] = "\\t";
  ESCAPE_SEQUENCES[10] = "\\n";
  ESCAPE_SEQUENCES[11] = "\\v";
  ESCAPE_SEQUENCES[12] = "\\f";
  ESCAPE_SEQUENCES[13] = "\\r";
  ESCAPE_SEQUENCES[27] = "\\e";
  ESCAPE_SEQUENCES[34] = '\\"';
  ESCAPE_SEQUENCES[92] = "\\\\";
  ESCAPE_SEQUENCES[133] = "\\N";
  ESCAPE_SEQUENCES[160] = "\\_";
  ESCAPE_SEQUENCES[8232] = "\\L";
  ESCAPE_SEQUENCES[8233] = "\\P";
  const DEPRECATED_BOOLEANS_SYNTAX = [
    "y",
    "Y",
    "yes",
    "Yes",
    "YES",
    "on",
    "On",
    "ON",
    "n",
    "N",
    "no",
    "No",
    "NO",
    "off",
    "Off",
    "OFF"
  ];
  const DEPRECATED_BASE60_SYNTAX = /^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;
  function compileStyleMap(schema2, map2) {
    if (map2 === null) return {};
    const result = {};
    const keys = Object.keys(map2);
    for (let index = 0, length = keys.length; index < length; index += 1) {
      let tag = keys[index];
      let style = String(map2[tag]);
      if (tag.slice(0, 2) === "!!") {
        tag = "tag:yaml.org,2002:" + tag.slice(2);
      }
      const type2 = schema2.compiledTypeMap["fallback"][tag];
      if (type2 && _hasOwnProperty.call(type2.styleAliases, style)) {
        style = type2.styleAliases[style];
      }
      result[tag] = style;
    }
    return result;
  }
  function encodeHex(character) {
    let handle;
    let length;
    const string = character.toString(16).toUpperCase();
    if (character <= 255) {
      handle = "x";
      length = 2;
    } else if (character <= 65535) {
      handle = "u";
      length = 4;
    } else if (character <= 4294967295) {
      handle = "U";
      length = 8;
    } else {
      throw new YAMLException2("code point within a string may not be greater than 0xFFFFFFFF");
    }
    return "\\" + handle + common2.repeat("0", length - string.length) + string;
  }
  const QUOTING_TYPE_SINGLE = 1;
  const QUOTING_TYPE_DOUBLE = 2;
  function State(options) {
    this.schema = options["schema"] || DEFAULT_SCHEMA2;
    this.indent = Math.max(1, options["indent"] || 2);
    this.noArrayIndent = options["noArrayIndent"] || false;
    this.skipInvalid = options["skipInvalid"] || false;
    this.flowLevel = common2.isNothing(options["flowLevel"]) ? -1 : options["flowLevel"];
    this.styleMap = compileStyleMap(this.schema, options["styles"] || null);
    this.sortKeys = options["sortKeys"] || false;
    this.lineWidth = options["lineWidth"] || 80;
    this.noRefs = options["noRefs"] || false;
    this.noCompatMode = options["noCompatMode"] || false;
    this.condenseFlow = options["condenseFlow"] || false;
    this.quotingType = options["quotingType"] === '"' ? QUOTING_TYPE_DOUBLE : QUOTING_TYPE_SINGLE;
    this.forceQuotes = options["forceQuotes"] || false;
    this.replacer = typeof options["replacer"] === "function" ? options["replacer"] : null;
    this.implicitTypes = this.schema.compiledImplicit;
    this.explicitTypes = this.schema.compiledExplicit;
    this.tag = null;
    this.result = "";
    this.duplicates = [];
    this.usedDuplicates = null;
  }
  function indentString(string, spaces) {
    const ind = common2.repeat(" ", spaces);
    let position = 0;
    let result = "";
    const length = string.length;
    while (position < length) {
      let line;
      const next = string.indexOf("\n", position);
      if (next === -1) {
        line = string.slice(position);
        position = length;
      } else {
        line = string.slice(position, next + 1);
        position = next + 1;
      }
      if (line.length && line !== "\n") result += ind;
      result += line;
    }
    return result;
  }
  function generateNextLine(state, level) {
    return "\n" + common2.repeat(" ", state.indent * level);
  }
  function testImplicitResolving(state, str2) {
    for (let index = 0, length = state.implicitTypes.length; index < length; index += 1) {
      const type2 = state.implicitTypes[index];
      if (type2.resolve(str2)) {
        return true;
      }
    }
    return false;
  }
  function isWhitespace(c) {
    return c === CHAR_SPACE || c === CHAR_TAB;
  }
  function isPrintable(c) {
    return c >= 32 && c <= 126 || c >= 161 && c <= 55295 && c !== 8232 && c !== 8233 || c >= 57344 && c <= 65533 && c !== CHAR_BOM || c >= 65536 && c <= 1114111;
  }
  function isNsCharOrWhitespace(c) {
    return isPrintable(c) && c !== CHAR_BOM && // - b-char
    c !== CHAR_CARRIAGE_RETURN && c !== CHAR_LINE_FEED;
  }
  function isPlainSafe(c, prev, inblock) {
    const cIsNsCharOrWhitespace = isNsCharOrWhitespace(c);
    const cIsNsChar = cIsNsCharOrWhitespace && !isWhitespace(c);
    return (
      // ns-plain-safe
      (inblock ? cIsNsCharOrWhitespace : cIsNsCharOrWhitespace && // - c-flow-indicator
      c !== CHAR_COMMA && c !== CHAR_LEFT_SQUARE_BRACKET && c !== CHAR_RIGHT_SQUARE_BRACKET && c !== CHAR_LEFT_CURLY_BRACKET && c !== CHAR_RIGHT_CURLY_BRACKET) && // ns-plain-char
      c !== CHAR_SHARP && // false on '#'
      !(prev === CHAR_COLON && !cIsNsChar) || // false on ': '
      isNsCharOrWhitespace(prev) && !isWhitespace(prev) && c === CHAR_SHARP || // change to true on '[^ ]#'
      prev === CHAR_COLON && cIsNsChar
    );
  }
  function isPlainSafeFirst(c) {
    return isPrintable(c) && c !== CHAR_BOM && !isWhitespace(c) && // - s-white
    // - (c-indicator ::=
    // â€œ-â€� | â€œ?â€� | â€œ:â€� | â€œ,â€� | â€œ[â€� | â€œ]â€� | â€œ{â€� | â€œ}â€�
    c !== CHAR_MINUS && c !== CHAR_QUESTION && c !== CHAR_COLON && c !== CHAR_COMMA && c !== CHAR_LEFT_SQUARE_BRACKET && c !== CHAR_RIGHT_SQUARE_BRACKET && c !== CHAR_LEFT_CURLY_BRACKET && c !== CHAR_RIGHT_CURLY_BRACKET && // | â€œ#â€� | â€œ&â€� | â€œ*â€� | â€œ!â€� | â€œ|â€� | â€œ=â€� | â€œ>â€� | â€œ'â€� | â€œ"â€�
    c !== CHAR_SHARP && c !== CHAR_AMPERSAND && c !== CHAR_ASTERISK && c !== CHAR_EXCLAMATION && c !== CHAR_VERTICAL_LINE && c !== CHAR_EQUALS && c !== CHAR_GREATER_THAN && c !== CHAR_SINGLE_QUOTE && c !== CHAR_DOUBLE_QUOTE && // | â€œ%â€� | â€œ@â€� | â€œ`â€�)
    c !== CHAR_PERCENT && c !== CHAR_COMMERCIAL_AT && c !== CHAR_GRAVE_ACCENT;
  }
  function isPlainSafeLast(c) {
    return !isWhitespace(c) && c !== CHAR_COLON;
  }
  function codePointAt(string, pos) {
    const first = string.charCodeAt(pos);
    let second;
    if (first >= 55296 && first <= 56319 && pos + 1 < string.length) {
      second = string.charCodeAt(pos + 1);
      if (second >= 56320 && second <= 57343) {
        return (first - 55296) * 1024 + second - 56320 + 65536;
      }
    }
    return first;
  }
  function needIndentIndicator(string) {
    const leadingSpaceRe = /^\n* /;
    return leadingSpaceRe.test(string);
  }
  const STYLE_PLAIN = 1;
  const STYLE_SINGLE = 2;
  const STYLE_LITERAL = 3;
  const STYLE_FOLDED = 4;
  const STYLE_DOUBLE = 5;
  function chooseScalarStyle(string, singleLineOnly, indentPerLevel, lineWidth, testAmbiguousType, quotingType, forceQuotes, inblock) {
    let i;
    let char = 0;
    let prevChar = null;
    let hasLineBreak = false;
    let hasFoldableLine = false;
    const shouldTrackWidth = lineWidth !== -1;
    let previousLineBreak = -1;
    let plain = isPlainSafeFirst(codePointAt(string, 0)) && isPlainSafeLast(codePointAt(string, string.length - 1));
    if (singleLineOnly || forceQuotes) {
      for (i = 0; i < string.length; char >= 65536 ? i += 2 : i++) {
        char = codePointAt(string, i);
        if (!isPrintable(char)) {
          return STYLE_DOUBLE;
        }
        plain = plain && isPlainSafe(char, prevChar, inblock);
        prevChar = char;
      }
    } else {
      for (i = 0; i < string.length; char >= 65536 ? i += 2 : i++) {
        char = codePointAt(string, i);
        if (char === CHAR_LINE_FEED) {
          hasLineBreak = true;
          if (shouldTrackWidth) {
            hasFoldableLine = hasFoldableLine || // Foldable line = too long, and not more-indented.
            i - previousLineBreak - 1 > lineWidth && string[previousLineBreak + 1] !== " ";
            previousLineBreak = i;
          }
        } else if (!isPrintable(char)) {
          return STYLE_DOUBLE;
        }
        plain = plain && isPlainSafe(char, prevChar, inblock);
        prevChar = char;
      }
      hasFoldableLine = hasFoldableLine || shouldTrackWidth && (i - previousLineBreak - 1 > lineWidth && string[previousLineBreak + 1] !== " ");
    }
    if (!hasLineBreak && !hasFoldableLine) {
      if (plain && !forceQuotes && !testAmbiguousType(string)) {
        return STYLE_PLAIN;
      }
      return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : STYLE_SINGLE;
    }
    if (indentPerLevel > 9 && needIndentIndicator(string)) {
      return STYLE_DOUBLE;
    }
    if (!forceQuotes) {
      return hasFoldableLine ? STYLE_FOLDED : STYLE_LITERAL;
    }
    return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : STYLE_SINGLE;
  }
  function writeScalar(state, string, level, iskey, inblock) {
    state.dump = (function() {
      if (string.length === 0) {
        return state.quotingType === QUOTING_TYPE_DOUBLE ? '""' : "''";
      }
      if (!state.noCompatMode) {
        if (DEPRECATED_BOOLEANS_SYNTAX.indexOf(string) !== -1 || DEPRECATED_BASE60_SYNTAX.test(string)) {
          return state.quotingType === QUOTING_TYPE_DOUBLE ? '"' + string + '"' : "'" + string + "'";
        }
      }
      const indent = state.indent * Math.max(1, level);
      const lineWidth = state.lineWidth === -1 ? -1 : Math.max(Math.min(state.lineWidth, 40), state.lineWidth - indent);
      const singleLineOnly = iskey || // No block styles in flow mode.
      state.flowLevel > -1 && level >= state.flowLevel;
      function testAmbiguity(string2) {
        return testImplicitResolving(state, string2);
      }
      switch (chooseScalarStyle(
        string,
        singleLineOnly,
        state.indent,
        lineWidth,
        testAmbiguity,
        state.quotingType,
        state.forceQuotes && !iskey,
        inblock
      )) {
        case STYLE_PLAIN:
          return string;
        case STYLE_SINGLE:
          return "'" + string.replace(/'/g, "''") + "'";
        case STYLE_LITERAL:
          return "|" + blockHeader(string, state.indent) + dropEndingNewline(indentString(string, indent));
        case STYLE_FOLDED:
          return ">" + blockHeader(string, state.indent) + dropEndingNewline(indentString(foldString(string, lineWidth), indent));
        case STYLE_DOUBLE:
          return '"' + escapeString(string) + '"';
        default:
          throw new YAMLException2("impossible error: invalid scalar style");
      }
    })();
  }
  function blockHeader(string, indentPerLevel) {
    const indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : "";
    const clip = string[string.length - 1] === "\n";
    const keep = clip && (string[string.length - 2] === "\n" || string === "\n");
    const chomp = keep ? "+" : clip ? "" : "-";
    return indentIndicator + chomp + "\n";
  }
  function dropEndingNewline(string) {
    return string[string.length - 1] === "\n" ? string.slice(0, -1) : string;
  }
  function foldString(string, width) {
    const lineRe = /(\n+)([^\n]*)/g;
    let result = (function() {
      let nextLF = string.indexOf("\n");
      nextLF = nextLF !== -1 ? nextLF : string.length;
      lineRe.lastIndex = nextLF;
      return foldLine(string.slice(0, nextLF), width);
    })();
    let prevMoreIndented = string[0] === "\n" || string[0] === " ";
    let moreIndented;
    let match;
    while (match = lineRe.exec(string)) {
      const prefix = match[1];
      const line = match[2];
      moreIndented = line[0] === " ";
      result += prefix + (!prevMoreIndented && !moreIndented && line !== "" ? "\n" : "") + foldLine(line, width);
      prevMoreIndented = moreIndented;
    }
    return result;
  }
  function foldLine(line, width) {
    if (line === "" || line[0] === " ") return line;
    const breakRe = / [^ ]/g;
    let match;
    let start = 0;
    let end;
    let curr = 0;
    let next = 0;
    let result = "";
    while (match = breakRe.exec(line)) {
      next = match.index;
      if (next - start > width) {
        end = curr > start ? curr : next;
        result += "\n" + line.slice(start, end);
        start = end + 1;
      }
      curr = next;
    }
    result += "\n";
    if (line.length - start > width && curr > start) {
      result += line.slice(start, curr) + "\n" + line.slice(curr + 1);
    } else {
      result += line.slice(start);
    }
    return result.slice(1);
  }
  function escapeString(string) {
    let result = "";
    let char = 0;
    for (let i = 0; i < string.length; char >= 65536 ? i += 2 : i++) {
      char = codePointAt(string, i);
      const escapeSeq = ESCAPE_SEQUENCES[char];
      if (!escapeSeq && isPrintable(char)) {
        result += string[i];
        if (char >= 65536) result += string[i + 1];
      } else {
        result += escapeSeq || encodeHex(char);
      }
    }
    return result;
  }
  function writeFlowSequence(state, level, object) {
    let _result = "";
    const _tag = state.tag;
    for (let index = 0, length = object.length; index < length; index += 1) {
      let value = object[index];
      if (state.replacer) {
        value = state.replacer.call(object, String(index), value);
      }
      if (writeNode(state, level, value, false, false) || typeof value === "undefined" && writeNode(state, level, null, false, false)) {
        if (_result !== "") _result += "," + (!state.condenseFlow ? " " : "");
        _result += state.dump;
      }
    }
    state.tag = _tag;
    state.dump = "[" + _result + "]";
  }
  function writeBlockSequence(state, level, object, compact) {
    let _result = "";
    const _tag = state.tag;
    for (let index = 0, length = object.length; index < length; index += 1) {
      let value = object[index];
      if (state.replacer) {
        value = state.replacer.call(object, String(index), value);
      }
      if (writeNode(state, level + 1, value, true, true, false, true) || typeof value === "undefined" && writeNode(state, level + 1, null, true, true, false, true)) {
        if (!compact || _result !== "") {
          _result += generateNextLine(state, level);
        }
        if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
          _result += "-";
        } else {
          _result += "- ";
        }
        _result += state.dump;
      }
    }
    state.tag = _tag;
    state.dump = _result || "[]";
  }
  function writeFlowMapping(state, level, object) {
    let _result = "";
    const _tag = state.tag;
    const objectKeyList = Object.keys(object);
    for (let index = 0, length = objectKeyList.length; index < length; index += 1) {
      let pairBuffer = "";
      if (_result !== "") pairBuffer += ", ";
      if (state.condenseFlow) pairBuffer += '"';
      const objectKey = objectKeyList[index];
      let objectValue = object[objectKey];
      if (state.replacer) {
        objectValue = state.replacer.call(object, objectKey, objectValue);
      }
      if (!writeNode(state, level, objectKey, false, false)) {
        continue;
      }
      if (state.dump.length > 1024) pairBuffer += "? ";
      pairBuffer += state.dump + (state.condenseFlow ? '"' : "") + ":" + (state.condenseFlow ? "" : " ");
      if (!writeNode(state, level, objectValue, false, false)) {
        continue;
      }
      pairBuffer += state.dump;
      _result += pairBuffer;
    }
    state.tag = _tag;
    state.dump = "{" + _result + "}";
  }
  function writeBlockMapping(state, level, object, compact) {
    let _result = "";
    const _tag = state.tag;
    const objectKeyList = Object.keys(object);
    if (state.sortKeys === true) {
      objectKeyList.sort();
    } else if (typeof state.sortKeys === "function") {
      objectKeyList.sort(state.sortKeys);
    } else if (state.sortKeys) {
      throw new YAMLException2("sortKeys must be a boolean or a function");
    }
    for (let index = 0, length = objectKeyList.length; index < length; index += 1) {
      let pairBuffer = "";
      if (!compact || _result !== "") {
        pairBuffer += generateNextLine(state, level);
      }
      const objectKey = objectKeyList[index];
      let objectValue = object[objectKey];
      if (state.replacer) {
        objectValue = state.replacer.call(object, objectKey, objectValue);
      }
      if (!writeNode(state, level + 1, objectKey, true, true, true)) {
        continue;
      }
      const explicitPair = state.tag !== null && state.tag !== "?" || state.dump && state.dump.length > 1024;
      if (explicitPair) {
        if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
          pairBuffer += "?";
        } else {
          pairBuffer += "? ";
        }
      }
      pairBuffer += state.dump;
      if (explicitPair) {
        pairBuffer += generateNextLine(state, level);
      }
      if (!writeNode(state, level + 1, objectValue, true, explicitPair)) {
        continue;
      }
      if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
        pairBuffer += ":";
      } else {
        pairBuffer += ": ";
      }
      pairBuffer += state.dump;
      _result += pairBuffer;
    }
    state.tag = _tag;
    state.dump = _result || "{}";
  }
  function detectType(state, object, explicit) {
    const typeList = explicit ? state.explicitTypes : state.implicitTypes;
    for (let index = 0, length = typeList.length; index < length; index += 1) {
      const type2 = typeList[index];
      if ((type2.instanceOf || type2.predicate) && (!type2.instanceOf || typeof object === "object" && object instanceof type2.instanceOf) && (!type2.predicate || type2.predicate(object))) {
        if (explicit) {
          if (type2.multi && type2.representName) {
            state.tag = type2.representName(object);
          } else {
            state.tag = type2.tag;
          }
        } else {
          state.tag = "?";
        }
        if (type2.represent) {
          const style = state.styleMap[type2.tag] || type2.defaultStyle;
          let _result;
          if (_toString.call(type2.represent) === "[object Function]") {
            _result = type2.represent(object, style);
          } else if (_hasOwnProperty.call(type2.represent, style)) {
            _result = type2.represent[style](object, style);
          } else {
            throw new YAMLException2("!<" + type2.tag + '> tag resolver accepts not "' + style + '" style');
          }
          state.dump = _result;
        }
        return true;
      }
    }
    return false;
  }
  function writeNode(state, level, object, block, compact, iskey, isblockseq) {
    state.tag = null;
    state.dump = object;
    if (!detectType(state, object, false)) {
      detectType(state, object, true);
    }
    const type2 = _toString.call(state.dump);
    const inblock = block;
    if (block) {
      block = state.flowLevel < 0 || state.flowLevel > level;
    }
    const objectOrArray = type2 === "[object Object]" || type2 === "[object Array]";
    let duplicateIndex;
    let duplicate;
    if (objectOrArray) {
      duplicateIndex = state.duplicates.indexOf(object);
      duplicate = duplicateIndex !== -1;
    }
    if (state.tag !== null && state.tag !== "?" || duplicate || state.indent !== 2 && level > 0) {
      compact = false;
    }
    if (duplicate && state.usedDuplicates[duplicateIndex]) {
      state.dump = "*ref_" + duplicateIndex;
    } else {
      if (objectOrArray && duplicate && !state.usedDuplicates[duplicateIndex]) {
        state.usedDuplicates[duplicateIndex] = true;
      }
      if (type2 === "[object Object]") {
        if (block && Object.keys(state.dump).length !== 0) {
          writeBlockMapping(state, level, state.dump, compact);
          if (duplicate) {
            state.dump = "&ref_" + duplicateIndex + state.dump;
          }
        } else {
          writeFlowMapping(state, level, state.dump);
          if (duplicate) {
            state.dump = "&ref_" + duplicateIndex + " " + state.dump;
          }
        }
      } else if (type2 === "[object Array]") {
        if (block && state.dump.length !== 0) {
          if (state.noArrayIndent && !isblockseq && level > 0) {
            writeBlockSequence(state, level - 1, state.dump, compact);
          } else {
            writeBlockSequence(state, level, state.dump, compact);
          }
          if (duplicate) {
            state.dump = "&ref_" + duplicateIndex + state.dump;
          }
        } else {
          writeFlowSequence(state, level, state.dump);
          if (duplicate) {
            state.dump = "&ref_" + duplicateIndex + " " + state.dump;
          }
        }
      } else if (type2 === "[object String]") {
        if (state.tag !== "?") {
          writeScalar(state, state.dump, level, iskey, inblock);
        }
      } else if (type2 === "[object Undefined]") {
        return false;
      } else {
        if (state.skipInvalid) return false;
        throw new YAMLException2("unacceptable kind of an object to dump " + type2);
      }
      if (state.tag !== null && state.tag !== "?") {
        let tagStr = encodeURI(
          state.tag[0] === "!" ? state.tag.slice(1) : state.tag
        ).replace(/!/g, "%21");
        if (state.tag[0] === "!") {
          tagStr = "!" + tagStr;
        } else if (tagStr.slice(0, 18) === "tag:yaml.org,2002:") {
          tagStr = "!!" + tagStr.slice(18);
        } else {
          tagStr = "!<" + tagStr + ">";
        }
        state.dump = tagStr + " " + state.dump;
      }
    }
    return true;
  }
  function getDuplicateReferences(object, state) {
    const objects = [];
    const duplicatesIndexes = [];
    inspectNode(object, objects, duplicatesIndexes);
    const length = duplicatesIndexes.length;
    for (let index = 0; index < length; index += 1) {
      state.duplicates.push(objects[duplicatesIndexes[index]]);
    }
    state.usedDuplicates = new Array(length);
  }
  function inspectNode(object, objects, duplicatesIndexes) {
    if (object !== null && typeof object === "object") {
      const index = objects.indexOf(object);
      if (index !== -1) {
        if (duplicatesIndexes.indexOf(index) === -1) {
          duplicatesIndexes.push(index);
        }
      } else {
        objects.push(object);
        if (Array.isArray(object)) {
          for (let i = 0, length = object.length; i < length; i += 1) {
            inspectNode(object[i], objects, duplicatesIndexes);
          }
        } else {
          const objectKeyList = Object.keys(object);
          for (let i = 0, length = objectKeyList.length; i < length; i += 1) {
            inspectNode(object[objectKeyList[i]], objects, duplicatesIndexes);
          }
        }
      }
    }
  }
  function dump2(input, options) {
    options = options || {};
    const state = new State(options);
    if (!state.noRefs) getDuplicateReferences(input, state);
    let value = input;
    if (state.replacer) {
      value = state.replacer.call({ "": value }, "", value);
    }
    if (writeNode(state, 0, value, true, true)) return state.dump + "\n";
    return "";
  }
  dumper.dump = dump2;
  return dumper;
}
var hasRequiredJsYaml;
function requireJsYaml() {
  if (hasRequiredJsYaml) return jsYaml;
  hasRequiredJsYaml = 1;
  const loader2 = requireLoader();
  const dumper2 = requireDumper();
  function renamed(from, to) {
    return function() {
      throw new Error("Function yaml." + from + " is removed in js-yaml 4. Use yaml." + to + " instead, which is now safe by default.");
    };
  }
  jsYaml.Type = requireType();
  jsYaml.Schema = requireSchema();
  jsYaml.FAILSAFE_SCHEMA = requireFailsafe();
  jsYaml.JSON_SCHEMA = requireJson();
  jsYaml.CORE_SCHEMA = requireCore();
  jsYaml.DEFAULT_SCHEMA = require_default();
  jsYaml.load = loader2.load;
  jsYaml.loadAll = loader2.loadAll;
  jsYaml.dump = dumper2.dump;
  jsYaml.YAMLException = requireException();
  jsYaml.types = {
    binary: requireBinary(),
    float: requireFloat(),
    map: requireMap(),
    null: require_null(),
    pairs: requirePairs(),
    set: requireSet(),
    timestamp: requireTimestamp(),
    bool: requireBool(),
    int: requireInt(),
    merge: requireMerge(),
    omap: requireOmap(),
    seq: requireSeq(),
    str: requireStr()
  };
  jsYaml.safeLoad = renamed("safeLoad", "load");
  jsYaml.safeLoadAll = renamed("safeLoadAll", "loadAll");
  jsYaml.safeDump = renamed("safeDump", "dump");
  return jsYaml;
}
var jsYamlExports = requireJsYaml();
const yaml = /* @__PURE__ */ getDefaultExportFromCjs(jsYamlExports);
const {
  Type,
  Schema,
  FAILSAFE_SCHEMA,
  JSON_SCHEMA,
  CORE_SCHEMA,
  DEFAULT_SCHEMA,
  load,
  loadAll,
  dump,
  YAMLException,
  types,
  safeLoad,
  safeLoadAll,
  safeDump
} = yaml;
export {
  CORE_SCHEMA,
  DEFAULT_SCHEMA,
  FAILSAFE_SCHEMA,
  JSON_SCHEMA,
  Schema,
  Type,
  YAMLException,
  yaml as default,
  dump,
  load,
  loadAll,
  safeDump,
  safeLoad,
  safeLoadAll,
  types
};
//# sourceMappingURL=js-yaml.mjs.map
{"version":3,"file":"js-yaml.mjs","sources":["../lib/common.js","../lib/exception.js","../lib/snippet.js","../lib/type.js","../lib/schema.js","../lib/type/str.js","../lib/type/seq.js","../lib/type/map.js","../lib/schema/failsafe.js","../lib/type/null.js","../lib/type/bool.js","../lib/type/int.js","../lib/type/float.js","../lib/schema/json.js","../lib/schema/core.js","../lib/type/timestamp.js","../lib/type/merge.js","../lib/type/binary.js","../lib/type/omap.js","../lib/type/pairs.js","../lib/type/set.js","../lib/schema/default.js","../lib/loader.js","../lib/dumper.js","../index.js","../lib/index_vite_proxy.tmp.mjs"],"sourcesContent":["'use strict'\n\nfunction isNothing (subject) {\n  return (typeof subject === 'undefined') || (subject === null)\n}\n\nfunction isObject (subject) {\n  return (typeof subject === 'object') && (subject !== null)\n}\n\nfunction toArray (sequence) {\n  if (Array.isArray(sequence)) return sequence\n  else if (isNothing(sequence)) return []\n\n  return [sequence]\n}\n\nfunction extend (target, source) {\n  if (source) {\n    const sourceKeys = Object.keys(source)\n\n    for (let index = 0, length = sourceKeys.length; index < length; index += 1) {\n      const key = sourceKeys[index]\n      target[key] = source[key]\n    }\n  }\n\n  return target\n}\n\nfunction repeat (string, count) {\n  let result = ''\n\n  for (let cycle = 0; cycle < count; cycle += 1) {\n    result += string\n  }\n\n  return result\n}\n\nfunction isNegativeZero (number) {\n  return (number === 0) && (Number.NEGATIVE_INFINITY === 1 / number)\n}\n\nmodule.exports.isNothing = isNothing\nmodule.exports.isObject = isObject\nmodule.exports.toArray = toArray\nmodule.exports.repeat = repeat\nmodule.exports.isNegativeZero = isNegativeZero\nmodule.exports.extend = extend\n","// YAML error class. http://stackoverflow.com/questions/8458984\n//\n'use strict'\n\nfunction formatError (exception, compact) {\n  let where = ''\n  const message = exception.reason || '(unknown reason)'\n\n  if (!exception.mark) return message\n\n  if (exception.mark.name) {\n    where += 'in \"' + exception.mark.name + '\" '\n  }\n\n  where += '(' + (exception.mark.line + 1) + ':' + (exception.mark.column + 1) + ')'\n\n  if (!compact && exception.mark.snippet) {\n    where += '\\n\\n' + exception.mark.snippet\n  }\n\n  return message + ' ' + where\n}\n\nfunction YAMLException (reason, mark) {\n  // Super constructor\n  Error.call(this)\n\n  this.name = 'YAMLException'\n  this.reason = reason\n  this.mark = mark\n  this.message = formatError(this, false)\n\n  // Include stack trace in error object\n  if (Error.captureStackTrace) {\n    // Chrome and NodeJS\n    Error.captureStackTrace(this, this.constructor)\n  } else {\n    // FF, IE 10+ and Safari 6+. Fallback for others\n    this.stack = (new Error()).stack || ''\n  }\n}\n\n// Inherit from Error\nYAMLException.prototype = Object.create(Error.prototype)\nYAMLException.prototype.constructor = YAMLException\n\nYAMLException.prototype.toString = function toString (compact) {\n  return this.name + ': ' + formatError(this, compact)\n}\n\nmodule.exports = YAMLException\n","'use strict'\n\nconst common = require('./common')\n\n// get snippet for a single line, respecting maxLength\nfunction getLine (buffer, lineStart, lineEnd, position, maxLineLength) {\n  let head = ''\n  let tail = ''\n  const maxHalfLength = Math.floor(maxLineLength / 2) - 1\n\n  if (position - lineStart > maxHalfLength) {\n    head = ' ... '\n    lineStart = position - maxHalfLength + head.length\n  }\n\n  if (lineEnd - position > maxHalfLength) {\n    tail = ' ...'\n    lineEnd = position + maxHalfLength - tail.length\n  }\n\n  return {\n    str: head + buffer.slice(lineStart, lineEnd).replace(/\\t/g, 'â†’') + tail,\n    pos: position - lineStart + head.length // relative position\n  }\n}\n\nfunction padStart (string, max) {\n  return common.repeat(' ', max - string.length) + string\n}\n\nfunction makeSnippet (mark, options) {\n  options = Object.create(options || null)\n\n  if (!mark.buffer) return null\n\n  if (!options.maxLength) options.maxLength = 79\n  if (typeof options.indent !== 'number') options.indent = 1\n  if (typeof options.linesBefore !== 'number') options.linesBefore = 3\n  if (typeof options.linesAfter !== 'number') options.linesAfter = 2\n\n  const re = /\\r?\\n|\\r|\\0/g\n  const lineStarts = [0]\n  const lineEnds = []\n  let match\n  let foundLineNo = -1\n\n  while ((match = re.exec(mark.buffer))) {\n    lineEnds.push(match.index)\n    lineStarts.push(match.index + match[0].length)\n\n    if (mark.position <= match.index && foundLineNo < 0) {\n      foundLineNo = lineStarts.length - 2\n    }\n  }\n\n  if (foundLineNo < 0) foundLineNo = lineStarts.length - 1\n\n  let result = ''\n  const lineNoLength = Math.min(mark.line + options.linesAfter, lineEnds.length).toString().length\n  const maxLineLength = options.maxLength - (options.indent + lineNoLength + 3)\n\n  for (let i = 1; i <= options.linesBefore; i++) {\n    if (foundLineNo - i < 0) break\n    const line = getLine(\n      mark.buffer,\n      lineStarts[foundLineNo - i],\n      lineEnds[foundLineNo - i],\n      mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo - i]),\n      maxLineLength\n    )\n    result = common.repeat(' ', options.indent) + padStart((mark.line - i + 1).toString(), lineNoLength) +\n      ' | ' + line.str + '\\n' + result\n  }\n\n  const line = getLine(mark.buffer, lineStarts[foundLineNo], lineEnds[foundLineNo], mark.position, maxLineLength)\n  result += common.repeat(' ', options.indent) + padStart((mark.line + 1).toString(), lineNoLength) +\n    ' | ' + line.str + '\\n'\n  result += common.repeat('-', options.indent + lineNoLength + 3 + line.pos) + '^' + '\\n'\n\n  for (let i = 1; i <= options.linesAfter; i++) {\n    if (foundLineNo + i >= lineEnds.length) break\n    const line = getLine(\n      mark.buffer,\n      lineStarts[foundLineNo + i],\n      lineEnds[foundLineNo + i],\n      mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo + i]),\n      maxLineLength\n    )\n    result += common.repeat(' ', options.indent) + padStart((mark.line + i + 1).toString(), lineNoLength) +\n      ' | ' + line.str + '\\n'\n  }\n\n  return result.replace(/\\n$/, '')\n}\n\nmodule.exports = makeSnippet\n","'use strict'\n\nconst YAMLException = require('./exception')\n\nconst TYPE_CONSTRUCTOR_OPTIONS = [\n  'kind',\n  'multi',\n  'resolve',\n  'construct',\n  'instanceOf',\n  'predicate',\n  'represent',\n  'representName',\n  'defaultStyle',\n  'styleAliases'\n]\n\nconst YAML_NODE_KINDS = [\n  'scalar',\n  'sequence',\n  'mapping'\n]\n\nfunction compileStyleAliases (map) {\n  const result = {}\n\n  if (map !== null) {\n    Object.keys(map).forEach(function (style) {\n      map[style].forEach(function (alias) {\n        result[String(alias)] = style\n      })\n    })\n  }\n\n  return result\n}\n\nfunction Type (tag, options) {\n  options = options || {}\n\n  Object.keys(options).forEach(function (name) {\n    if (TYPE_CONSTRUCTOR_OPTIONS.indexOf(name) === -1) {\n      throw new YAMLException('Unknown option \"' + name + '\" is met in definition of \"' + tag + '\" YAML type.')\n    }\n  })\n\n  // TODO: Add tag format check.\n  this.options = options // keep original options in case user wants to extend this type later\n  this.tag = tag\n  this.kind = options['kind'] || null\n  this.resolve = options['resolve'] || function () { return true }\n  this.construct = options['construct'] || function (data) { return data }\n  this.instanceOf = options['instanceOf'] || null\n  this.predicate = options['predicate'] || null\n  this.represent = options['represent'] || null\n  this.representName = options['representName'] || null\n  this.defaultStyle = options['defaultStyle'] || null\n  this.multi = options['multi'] || false\n  this.styleAliases = compileStyleAliases(options['styleAliases'] || null)\n\n  if (YAML_NODE_KINDS.indexOf(this.kind) === -1) {\n    throw new YAMLException('Unknown kind \"' + this.kind + '\" is specified for \"' + tag + '\" YAML type.')\n  }\n}\n\nmodule.exports = Type\n","'use strict'\n\nconst YAMLException = require('./exception')\nconst Type = require('./type')\n\nfunction compileList (schema, name) {\n  const result = []\n\n  schema[name].forEach(function (currentType) {\n    let newIndex = result.length\n\n    result.forEach(function (previousType, previousIndex) {\n      if (previousType.tag === currentType.tag &&\n          previousType.kind === currentType.kind &&\n          previousType.multi === currentType.multi) {\n        newIndex = previousIndex\n      }\n    })\n\n    result[newIndex] = currentType\n  })\n\n  return result\n}\n\nfunction compileMap (/* lists... */) {\n  const result = {\n    scalar: {},\n    sequence: {},\n    mapping: {},\n    fallback: {},\n    multi: {\n      scalar: [],\n      sequence: [],\n      mapping: [],\n      fallback: []\n    }\n  }\n  function collectType (type) {\n    if (type.multi) {\n      result.multi[type.kind].push(type)\n      result.multi['fallback'].push(type)\n    } else {\n      result[type.kind][type.tag] = result['fallback'][type.tag] = type\n    }\n  }\n\n  for (let index = 0, length = arguments.length; index < length; index += 1) {\n    arguments[index].forEach(collectType)\n  }\n  return result\n}\n\nfunction Schema (definition) {\n  return this.extend(definition)\n}\n\nSchema.prototype.extend = function extend (definition) {\n  let implicit = []\n  let explicit = []\n\n  if (definition instanceof Type) {\n    // Schema.extend(type)\n    explicit.push(definition)\n  } else if (Array.isArray(definition)) {\n    // Schema.extend([ type1, type2, ... ])\n    explicit = explicit.concat(definition)\n  } else if (definition && (Array.isArray(definition.implicit) || Array.isArray(definition.explicit))) {\n    // Schema.extend({ explicit: [ type1, type2, ... ], implicit: [ type1, type2, ... ] })\n    if (definition.implicit) implicit = implicit.concat(definition.implicit)\n    if (definition.explicit) explicit = explicit.concat(definition.explicit)\n  } else {\n    throw new YAMLException('Schema.extend argument should be a Type, [ Type ], ' +\n      'or a schema definition ({ implicit: [...], explicit: [...] })')\n  }\n\n  implicit.forEach(function (type) {\n    if (!(type instanceof Type)) {\n      throw new YAMLException('Specified list of YAML types (or a single Type object) contains a non-Type object.')\n    }\n\n    if (type.loadKind && type.loadKind !== 'scalar') {\n      throw new YAMLException('There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.')\n    }\n\n    if (type.multi) {\n      throw new YAMLException('There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.')\n    }\n  })\n\n  explicit.forEach(function (type) {\n    if (!(type instanceof Type)) {\n      throw new YAMLException('Specified list of YAML types (or a single Type object) contains a non-Type object.')\n    }\n  })\n\n  const result = Object.create(Schema.prototype)\n\n  result.implicit = (this.implicit || []).concat(implicit)\n  result.explicit = (this.explicit || []).concat(explicit)\n\n  result.compiledImplicit = compileList(result, 'implicit')\n  result.compiledExplicit = compileList(result, 'explicit')\n  result.compiledTypeMap = compileMap(result.compiledImplicit, result.compiledExplicit)\n\n  return result\n}\n\nmodule.exports = Schema\n","'use strict'\n\nconst Type = require('../type')\n\nmodule.exports = new Type('tag:yaml.org,2002:str', {\n  kind: 'scalar',\n  construct: function (data) { return data !== null ? data : '' }\n})\n","'use strict'\n\nconst Type = require('../type')\n\nmodule.exports = new Type('tag:yaml.org,2002:seq', {\n  kind: 'sequence',\n  construct: function (data) { return data !== null ? data : [] }\n})\n","'use strict'\n\nconst Type = require('../type')\n\nmodule.exports = new Type('tag:yaml.org,2002:map', {\n  kind: 'mapping',\n  construct: function (data) { return data !== null ? data : {} }\n})\n","// Standard YAML's Failsafe schema.\n// http://www.yaml.org/spec/1.2/spec.html#id2802346\n\n'use strict'\n\nconst Schema = require('../schema')\n\nmodule.exports = new Schema({\n  explicit: [\n    require('../type/str'),\n    require('../type/seq'),\n    require('../type/map')\n  ]\n})\n","'use strict'\n\nconst Type = require('../type')\n\nfunction resolveYamlNull (data) {\n  if (data === null) return true\n\n  const max = data.length\n\n  return (max === 1 && data === '~') ||\n         (max === 4 && (data === 'null' || data === 'Null' || data === 'NULL'))\n}\n\nfunction constructYamlNull () {\n  return null\n}\n\nfunction isNull (object) {\n  return object === null\n}\n\nmodule.exports = new Type('tag:yaml.org,2002:null', {\n  kind: 'scalar',\n  resolve: resolveYamlNull,\n  construct: constructYamlNull,\n  predicate: isNull,\n  represent: {\n    canonical: function () { return '~' },\n    lowercase: function () { return 'null' },\n    uppercase: function () { return 'NULL' },\n    camelcase: function () { return 'Null' },\n    empty: function () { return '' }\n  },\n  defaultStyle: 'lowercase'\n})\n","'use strict'\n\nconst Type = require('../type')\n\nfunction resolveYamlBoolean (data) {\n  if (data === null) return false\n\n  const max = data.length\n\n  return (max === 4 && (data === 'true' || data === 'True' || data === 'TRUE')) ||\n         (max === 5 && (data === 'false' || data === 'False' || data === 'FALSE'))\n}\n\nfunction constructYamlBoolean (data) {\n  return data === 'true' ||\n         data === 'True' ||\n         data === 'TRUE'\n}\n\nfunction isBoolean (object) {\n  return Object.prototype.toString.call(object) === '[object Boolean]'\n}\n\nmodule.exports = new Type('tag:yaml.org,2002:bool', {\n  kind: 'scalar',\n  resolve: resolveYamlBoolean,\n  construct: constructYamlBoolean,\n  predicate: isBoolean,\n  represent: {\n    lowercase: function (object) { return object ? 'true' : 'false' },\n    uppercase: function (object) { return object ? 'TRUE' : 'FALSE' },\n    camelcase: function (object) { return object ? 'True' : 'False' }\n  },\n  defaultStyle: 'lowercase'\n})\n","'use strict'\n\nconst common = require('../common')\nconst Type = require('../type')\n\nfunction isHexCode (c) {\n  return ((c >= 0x30/* 0 */) && (c <= 0x39/* 9 */)) ||\n         ((c >= 0x41/* A */) && (c <= 0x46/* F */)) ||\n         ((c >= 0x61/* a */) && (c <= 0x66/* f */))\n}\n\nfunction isOctCode (c) {\n  return ((c >= 0x30/* 0 */) && (c <= 0x37/* 7 */))\n}\n\nfunction isDecCode (c) {\n  return ((c >= 0x30/* 0 */) && (c <= 0x39/* 9 */))\n}\n\nfunction resolveYamlInteger (data) {\n  if (data === null) return false\n\n  const max = data.length\n  let index = 0\n  let hasDigits = false\n\n  if (!max) return false\n\n  let ch = data[index]\n\n  // sign\n  if (ch === '-' || ch === '+') {\n    ch = data[++index]\n  }\n\n  if (ch === '0') {\n    // 0\n    if (index + 1 === max) return true\n    ch = data[++index]\n\n    // base 2, base 8, base 16\n\n    if (ch === 'b') {\n      // base 2\n      index++\n\n      for (; index < max; index++) {\n        ch = data[index]\n        if (ch !== '0' && ch !== '1') return false\n        hasDigits = true\n      }\n      return hasDigits && isFinite(parseYamlInteger(data))\n    }\n\n    if (ch === 'x') {\n      // base 16\n      index++\n\n      for (; index < max; index++) {\n        if (!isHexCode(data.charCodeAt(index))) return false\n        hasDigits = true\n      }\n      return hasDigits && isFinite(parseYamlInteger(data))\n    }\n\n    if (ch === 'o') {\n      // base 8\n      index++\n\n      for (; index < max; index++) {\n        if (!isOctCode(data.charCodeAt(index))) return false\n        hasDigits = true\n      }\n      return hasDigits && isFinite(parseYamlInteger(data))\n    }\n  }\n\n  // base 10 (except 0)\n\n  for (; index < max; index++) {\n    if (!isDecCode(data.charCodeAt(index))) {\n      return false\n    }\n    hasDigits = true\n  }\n\n  if (!hasDigits) return false\n\n  return isFinite(parseYamlInteger(data))\n}\n\nfunction parseYamlInteger (data) {\n  let value = data\n  let sign = 1\n\n  let ch = value[0]\n\n  if (ch === '-' || ch === '+') {\n    if (ch === '-') sign = -1\n    value = value.slice(1)\n    ch = value[0]\n  }\n\n  if (value === '0') return 0\n\n  if (ch === '0') {\n    if (value[1] === 'b') return sign * parseInt(value.slice(2), 2)\n    if (value[1] === 'x') return sign * parseInt(value.slice(2), 16)\n    if (value[1] === 'o') return sign * parseInt(value.slice(2), 8)\n  }\n\n  return sign * parseInt(value, 10)\n}\n\nfunction constructYamlInteger (data) {\n  return parseYamlInteger(data)\n}\n\nfunction isInteger (object) {\n  return (Object.prototype.toString.call(object)) === '[object Number]' &&\n         (object % 1 === 0 && !common.isNegativeZero(object))\n}\n\nmodule.exports = new Type('tag:yaml.org,2002:int', {\n  kind: 'scalar',\n  resolve: resolveYamlInteger,\n  construct: constructYamlInteger,\n  predicate: isInteger,\n  represent: {\n    binary: function (obj) { return obj >= 0 ? '0b' + obj.toString(2) : '-0b' + obj.toString(2).slice(1) },\n    octal: function (obj) { return obj >= 0 ? '0o' + obj.toString(8) : '-0o' + obj.toString(8).slice(1) },\n    decimal: function (obj) { return obj.toString(10) },\n    hexadecimal: function (obj) { return obj >= 0 ? '0x' + obj.toString(16).toUpperCase() : '-0x' + obj.toString(16).toUpperCase().slice(1) }\n  },\n  defaultStyle: 'decimal',\n  styleAliases: {\n    binary: [2, 'bin'],\n    octal: [8, 'oct'],\n    decimal: [10, 'dec'],\n    hexadecimal: [16, 'hex']\n  }\n})\n","'use strict'\n\nconst common = require('../common')\nconst Type = require('../type')\n\nconst YAML_FLOAT_PATTERN = new RegExp(\n  // 2.5e4, 2.5 and integers\n  '^(?:[-+]?(?:[0-9]+)(?:\\\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?' +\n  // .2e4, .2\n  // special case, seems not from spec\n  '|\\\\.[0-9]+(?:[eE][-+]?[0-9]+)?' +\n  // .inf\n  '|[-+]?\\\\.(?:inf|Inf|INF)' +\n  // .nan\n  '|\\\\.(?:nan|NaN|NAN))$')\n\nconst YAML_FLOAT_SPECIAL_PATTERN = new RegExp(\n  '^(?:' +\n  // .inf\n  '[-+]?\\\\.(?:inf|Inf|INF)' +\n  // .nan\n  '|\\\\.(?:nan|NaN|NAN))$')\n\nfunction resolveYamlFloat (data) {\n  if (data === null) return false\n\n  if (!YAML_FLOAT_PATTERN.test(data)) {\n    return false\n  }\n\n  if (isFinite(parseFloat(data, 10))) {\n    return true\n  }\n\n  return YAML_FLOAT_SPECIAL_PATTERN.test(data)\n}\n\nfunction constructYamlFloat (data) {\n  let value = data.toLowerCase()\n  const sign = value[0] === '-' ? -1 : 1\n\n  if ('+-'.indexOf(value[0]) >= 0) {\n    value = value.slice(1)\n  }\n\n  if (value === '.inf') {\n    return (sign === 1) ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY\n  } else if (value === '.nan') {\n    return NaN\n  }\n  return sign * parseFloat(value, 10)\n}\n\nconst SCIENTIFIC_WITHOUT_DOT = /^[-+]?[0-9]+e/\n\nfunction representYamlFloat (object, style) {\n  if (isNaN(object)) {\n    switch (style) {\n      case 'lowercase': return '.nan'\n      case 'uppercase': return '.NAN'\n      case 'camelcase': return '.NaN'\n    }\n  } else if (Number.POSITIVE_INFINITY === object) {\n    switch (style) {\n      case 'lowercase': return '.inf'\n      case 'uppercase': return '.INF'\n      case 'camelcase': return '.Inf'\n    }\n  } else if (Number.NEGATIVE_INFINITY === object) {\n    switch (style) {\n      case 'lowercase': return '-.inf'\n      case 'uppercase': return '-.INF'\n      case 'camelcase': return '-.Inf'\n    }\n  } else if (common.isNegativeZero(object)) {\n    return '-0.0'\n  }\n\n  const res = object.toString(10)\n\n  // JS stringifier can build scientific format without dots: 5e-100,\n  // while YAML requres dot: 5.e-100. Fix it with simple hack\n\n  return SCIENTIFIC_WITHOUT_DOT.test(res) ? res.replace('e', '.e') : res\n}\n\nfunction isFloat (object) {\n  return (Object.prototype.toString.call(object) === '[object Number]') &&\n         (object % 1 !== 0 || common.isNegativeZero(object))\n}\n\nmodule.exports = new Type('tag:yaml.org,2002:float', {\n  kind: 'scalar',\n  resolve: resolveYamlFloat,\n  construct: constructYamlFloat,\n  predicate: isFloat,\n  represent: representYamlFloat,\n  defaultStyle: 'lowercase'\n})\n","// Standard YAML's JSON schema.\n// http://www.yaml.org/spec/1.2/spec.html#id2803231\n//\n// NOTE: JS-YAML does not support schema-specific tag resolution restrictions.\n// So, this schema is not such strict as defined in the YAML specification.\n// It allows numbers in binary notaion, use `Null` and `NULL` as `null`, etc.\n\n'use strict'\n\nmodule.exports = require('./failsafe').extend({\n  implicit: [\n    require('../type/null'),\n    require('../type/bool'),\n    require('../type/int'),\n    require('../type/float')\n  ]\n})\n","// Standard YAML's Core schema.\n// http://www.yaml.org/spec/1.2/spec.html#id2804923\n//\n// NOTE: JS-YAML does not support schema-specific tag resolution restrictions.\n// So, Core schema has no distinctions from JSON schema is JS-YAML.\n\n'use strict'\n\nmodule.exports = require('./json')\n","'use strict'\n\nconst Type = require('../type')\n\nconst YAML_DATE_REGEXP = new RegExp(\n  '^([0-9][0-9][0-9][0-9])' + // [1] year\n  '-([0-9][0-9])' + // [2] month\n  '-([0-9][0-9])$')                   // [3] day\n\nconst YAML_TIMESTAMP_REGEXP = new RegExp(\n  '^([0-9][0-9][0-9][0-9])' + // [1] year\n  '-([0-9][0-9]?)' + // [2] month\n  '-([0-9][0-9]?)' + // [3] day\n  '(?:[Tt]|[ \\\\t]+)' + // ...\n  '([0-9][0-9]?)' + // [4] hour\n  ':([0-9][0-9])' + // [5] minute\n  ':([0-9][0-9])' + // [6] second\n  '(?:\\\\.([0-9]*))?' + // [7] fraction\n  '(?:[ \\\\t]*(Z|([-+])([0-9][0-9]?)' + // [8] tz [9] tz_sign [10] tzHour\n  '(?::([0-9][0-9]))?))?$')           // [11] tzMinute\n\nfunction resolveYamlTimestamp (data) {\n  if (data === null) return false\n  if (YAML_DATE_REGEXP.exec(data) !== null) return true\n  if (YAML_TIMESTAMP_REGEXP.exec(data) !== null) return true\n  return false\n}\n\nfunction constructYamlTimestamp (data) {\n  let fraction = 0\n  let delta = null\n\n  let match = YAML_DATE_REGEXP.exec(data)\n  if (match === null) match = YAML_TIMESTAMP_REGEXP.exec(data)\n\n  if (match === null) throw new Error('Date resolve error')\n\n  // match: [1] year [2] month [3] day\n\n  const year = +(match[1])\n  const month = +(match[2]) - 1 // JS month starts with 0\n  const day = +(match[3])\n\n  if (!match[4]) { // no hour\n    return new Date(Date.UTC(year, month, day))\n  }\n\n  // match: [4] hour [5] minute [6] second [7] fraction\n\n  const hour = +(match[4])\n  const minute = +(match[5])\n  const second = +(match[6])\n\n  if (match[7]) {\n    fraction = match[7].slice(0, 3)\n    while (fraction.length < 3) { // milli-seconds\n      fraction += '0'\n    }\n    fraction = +fraction\n  }\n\n  // match: [8] tz [9] tz_sign [10] tzHour [11] tzMinute\n\n  if (match[9]) {\n    const tzHour = +(match[10])\n    const tzMinute = +(match[11] || 0)\n    delta = (tzHour * 60 + tzMinute) * 60000 // delta in mili-seconds\n    if (match[9] === '-') delta = -delta\n  }\n\n  const date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction))\n\n  if (delta) date.setTime(date.getTime() - delta)\n\n  return date\n}\n\nfunction representYamlTimestamp (object /*, style */) {\n  return object.toISOString()\n}\n\nmodule.exports = new Type('tag:yaml.org,2002:timestamp', {\n  kind: 'scalar',\n  resolve: resolveYamlTimestamp,\n  construct: constructYamlTimestamp,\n  instanceOf: Date,\n  represent: representYamlTimestamp\n})\n","'use strict'\n\nconst Type = require('../type')\n\nfunction resolveYamlMerge (data) {\n  return data === '<<' || data === null\n}\n\nmodule.exports = new Type('tag:yaml.org,2002:merge', {\n  kind: 'scalar',\n  resolve: resolveYamlMerge\n})\n","'use strict'\n\nconst Type = require('../type')\n\n// [ 64, 65, 66 ] -> [ padding, CR, LF ]\nconst BASE64_MAP = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\\n\\r'\n\nfunction resolveYamlBinary (data) {\n  if (data === null) return false\n\n  let bitlen = 0\n  const max = data.length\n  const map = BASE64_MAP\n\n  // Convert one by one.\n  for (let idx = 0; idx < max; idx++) {\n    const code = map.indexOf(data.charAt(idx))\n\n    // Skip CR/LF\n    if (code > 64) continue\n\n    // Fail on illegal characters\n    if (code < 0) return false\n\n    bitlen += 6\n  }\n\n  // If there are any bits left, source was corrupted\n  return (bitlen % 8) === 0\n}\n\nfunction constructYamlBinary (data) {\n  const input = data.replace(/[\\r\\n=]/g, '') // remove CR/LF & padding to simplify scan\n  const max = input.length\n  const map = BASE64_MAP\n  let bits = 0\n  const result = []\n\n  // Collect by 6*4 bits (3 bytes)\n\n  for (let idx = 0; idx < max; idx++) {\n    if ((idx % 4 === 0) && idx) {\n      result.push((bits >> 16) & 0xFF)\n      result.push((bits >> 8) & 0xFF)\n      result.push(bits & 0xFF)\n    }\n\n    bits = (bits << 6) | map.indexOf(input.charAt(idx))\n  }\n\n  // Dump tail\n\n  const tailbits = (max % 4) * 6\n\n  if (tailbits === 0) {\n    result.push((bits >> 16) & 0xFF)\n    result.push((bits >> 8) & 0xFF)\n    result.push(bits & 0xFF)\n  } else if (tailbits === 18) {\n    result.push((bits >> 10) & 0xFF)\n    result.push((bits >> 2) & 0xFF)\n  } else if (tailbits === 12) {\n    result.push((bits >> 4) & 0xFF)\n  }\n\n  return new Uint8Array(result)\n}\n\nfunction representYamlBinary (object /*, style */) {\n  let result = ''\n  let bits = 0\n  const max = object.length\n  const map = BASE64_MAP\n\n  // Convert every three bytes to 4 ASCII characters.\n\n  for (let idx = 0; idx < max; idx++) {\n    if ((idx % 3 === 0) && idx) {\n      result += map[(bits >> 18) & 0x3F]\n      result += map[(bits >> 12) & 0x3F]\n      result += map[(bits >> 6) & 0x3F]\n      result += map[bits & 0x3F]\n    }\n\n    bits = (bits << 8) + object[idx]\n  }\n\n  // Dump tail\n\n  const tail = max % 3\n\n  if (tail === 0) {\n    result += map[(bits >> 18) & 0x3F]\n    result += map[(bits >> 12) & 0x3F]\n    result += map[(bits >> 6) & 0x3F]\n    result += map[bits & 0x3F]\n  } else if (tail === 2) {\n    result += map[(bits >> 10) & 0x3F]\n    result += map[(bits >> 4) & 0x3F]\n    result += map[(bits << 2) & 0x3F]\n    result += map[64]\n  } else if (tail === 1) {\n    result += map[(bits >> 2) & 0x3F]\n    result += map[(bits << 4) & 0x3F]\n    result += map[64]\n    result += map[64]\n  }\n\n  return result\n}\n\nfunction isBinary (obj) {\n  return Object.prototype.toString.call(obj) === '[object Uint8Array]'\n}\n\nmodule.exports = new Type('tag:yaml.org,2002:binary', {\n  kind: 'scalar',\n  resolve: resolveYamlBinary,\n  construct: constructYamlBinary,\n  predicate: isBinary,\n  represent: representYamlBinary\n})\n","'use strict'\n\nconst Type = require('../type')\n\nconst _hasOwnProperty = Object.prototype.hasOwnProperty\nconst _toString = Object.prototype.toString\n\nfunction resolveYamlOmap (data) {\n  if (data === null) return true\n\n  const objectKeys = []\n  const object = data\n\n  for (let index = 0, length = object.length; index < length; index += 1) {\n    const pair = object[index]\n    let pairHasKey = false\n\n    if (_toString.call(pair) !== '[object Object]') return false\n\n    let pairKey\n    for (pairKey in pair) {\n      if (_hasOwnProperty.call(pair, pairKey)) {\n        if (!pairHasKey) pairHasKey = true\n        else return false\n      }\n    }\n\n    if (!pairHasKey) return false\n\n    if (objectKeys.indexOf(pairKey) === -1) objectKeys.push(pairKey)\n    else return false\n  }\n\n  return true\n}\n\nfunction constructYamlOmap (data) {\n  return data !== null ? data : []\n}\n\nmodule.exports = new Type('tag:yaml.org,2002:omap', {\n  kind: 'sequence',\n  resolve: resolveYamlOmap,\n  construct: constructYamlOmap\n})\n","'use strict'\n\nconst Type = require('../type')\n\nconst _toString = Object.prototype.toString\n\nfunction resolveYamlPairs (data) {\n  if (data === null) return true\n\n  const object = data\n\n  const result = new Array(object.length)\n\n  for (let index = 0, length = object.length; index < length; index += 1) {\n    const pair = object[index]\n\n    if (_toString.call(pair) !== '[object Object]') return false\n\n    const keys = Object.keys(pair)\n\n    if (keys.length !== 1) return false\n\n    result[index] = [keys[0], pair[keys[0]]]\n  }\n\n  return true\n}\n\nfunction constructYamlPairs (data) {\n  if (data === null) return []\n\n  const object = data\n  const result = new Array(object.length)\n\n  for (let index = 0, length = object.length; index < length; index += 1) {\n    const pair = object[index]\n\n    const keys = Object.keys(pair)\n\n    result[index] = [keys[0], pair[keys[0]]]\n  }\n\n  return result\n}\n\nmodule.exports = new Type('tag:yaml.org,2002:pairs', {\n  kind: 'sequence',\n  resolve: resolveYamlPairs,\n  construct: constructYamlPairs\n})\n","'use strict'\n\nconst Type = require('../type')\n\nconst _hasOwnProperty = Object.prototype.hasOwnProperty\n\nfunction resolveYamlSet (data) {\n  if (data === null) return true\n\n  const object = data\n\n  for (const key in object) {\n    if (_hasOwnProperty.call(object, key)) {\n      if (object[key] !== null) return false\n    }\n  }\n\n  return true\n}\n\nfunction constructYamlSet (data) {\n  return data !== null ? data : {}\n}\n\nmodule.exports = new Type('tag:yaml.org,2002:set', {\n  kind: 'mapping',\n  resolve: resolveYamlSet,\n  construct: constructYamlSet\n})\n","// JS-YAML's default schema for `safeLoad` function.\n// It is not described in the YAML specification.\n//\n// This schema is based on standard YAML's Core schema and includes most of\n// extra types described at YAML tag repository. (http://yaml.org/type/)\n\n'use strict'\n\nmodule.exports = require('./core').extend({\n  implicit: [\n    require('../type/timestamp'),\n    require('../type/merge')\n  ],\n  explicit: [\n    require('../type/binary'),\n    require('../type/omap'),\n    require('../type/pairs'),\n    require('../type/set')\n  ]\n})\n","'use strict'\n\nconst common = require('./common')\nconst YAMLException = require('./exception')\nconst makeSnippet = require('./snippet')\nconst DEFAULT_SCHEMA = require('./schema/default')\n\nconst _hasOwnProperty = Object.prototype.hasOwnProperty\n\nconst CONTEXT_FLOW_IN = 1\nconst CONTEXT_FLOW_OUT = 2\nconst CONTEXT_BLOCK_IN = 3\nconst CONTEXT_BLOCK_OUT = 4\n\nconst CHOMPING_CLIP = 1\nconst CHOMPING_STRIP = 2\nconst CHOMPING_KEEP = 3\n\n// eslint-disable-next-line no-control-regex\nconst PATTERN_NON_PRINTABLE = /[\\x00-\\x08\\x0B\\x0C\\x0E-\\x1F\\x7F-\\x84\\x86-\\x9F\\uFFFE\\uFFFF]|[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF]/\nconst PATTERN_NON_ASCII_LINE_BREAKS = /[\\x85\\u2028\\u2029]/\n// eslint-disable-next-line no-useless-escape\nconst PATTERN_FLOW_INDICATORS = /[,\\[\\]{}]/\n// eslint-disable-next-line no-useless-escape\nconst PATTERN_TAG_HANDLE = /^(?:!|!!|![0-9A-Za-z-]+!)$/\n// eslint-disable-next-line no-useless-escape\nconst PATTERN_TAG_URI = /^(?:!|[^,\\[\\]{}])(?:%[0-9a-f]{2}|[0-9a-z\\-#;/?:@&=+$,_.!~*'()\\[\\]])*$/i\n\nfunction _class (obj) { return Object.prototype.toString.call(obj) }\n\nfunction isEol (c) {\n  return (c === 0x0A/* LF */) || (c === 0x0D/* CR */)\n}\n\nfunction isWhiteSpace (c) {\n  return (c === 0x09/* Tab */) || (c === 0x20/* Space */)\n}\n\nfunction isWsOrEol (c) {\n  return (c === 0x09/* Tab */) ||\n         (c === 0x20/* Space */) ||\n         (c === 0x0A/* LF */) ||\n         (c === 0x0D/* CR */)\n}\n\nfunction isFlowIndicator (c) {\n  return c === 0x2C/* , */ ||\n         c === 0x5B/* [ */ ||\n         c === 0x5D/* ] */ ||\n         c === 0x7B/* { */ ||\n         c === 0x7D/* } */\n}\n\nfunction fromHexCode (c) {\n  if ((c >= 0x30/* 0 */) && (c <= 0x39/* 9 */)) {\n    return c - 0x30\n  }\n\n  const lc = c | 0x20\n\n  if ((lc >= 0x61/* a */) && (lc <= 0x66/* f */)) {\n    return lc - 0x61 + 10\n  }\n\n  return -1\n}\n\nfunction escapedHexLen (c) {\n  if (c === 0x78/* x */) { return 2 }\n  if (c === 0x75/* u */) { return 4 }\n  if (c === 0x55/* U */) { return 8 }\n  return 0\n}\n\nfunction fromDecimalCode (c) {\n  if ((c >= 0x30/* 0 */) && (c <= 0x39/* 9 */)) {\n    return c - 0x30\n  }\n\n  return -1\n}\n\nfunction simpleEscapeSequence (c) {\n  switch (c) {\n    case 0x30/* 0 */: return '\\x00'\n    case 0x61/* a */: return '\\x07'\n    case 0x62/* b */: return '\\x08'\n    case 0x74/* t */: return '\\x09'\n    case 0x09/* Tab */: return '\\x09'\n    case 0x6E/* n */: return '\\x0A'\n    case 0x76/* v */: return '\\x0B'\n    case 0x66/* f */: return '\\x0C'\n    case 0x72/* r */: return '\\x0D'\n    case 0x65/* e */: return '\\x1B'\n    case 0x20/* Space */: return ' '\n    case 0x22/* \" */: return '\\x22'\n    case 0x2F/* / */: return '/'\n    case 0x5C/* \\ */: return '\\x5C'\n    case 0x4E/* N */: return '\\x85'\n    case 0x5F/* _ */: return '\\xA0'\n    case 0x4C/* L */: return '\\u2028'\n    case 0x50/* P */: return '\\u2029'\n    default: return ''\n  }\n}\n\nfunction charFromCodepoint (c) {\n  if (c <= 0xFFFF) {\n    return String.fromCharCode(c)\n  }\n  // Encode UTF-16 surrogate pair\n  // https://en.wikipedia.org/wiki/UTF-16#Code_points_U.2B010000_to_U.2B10FFFF\n  return String.fromCharCode(\n    ((c - 0x010000) >> 10) + 0xD800,\n    ((c - 0x010000) & 0x03FF) + 0xDC00\n  )\n}\n\n// set a property of a literal object, while protecting against prototype pollution,\n// see https://github.com/nodeca/js-yaml/issues/164 for more details\nfunction setProperty (object, key, value) {\n  // used for this specific key only because Object.defineProperty is slow\n  if (key === '__proto__') {\n    Object.defineProperty(object, key, {\n      configurable: true,\n      enumerable: true,\n      writable: true,\n      value: value\n    })\n  } else {\n    object[key] = value\n  }\n}\n\nconst simpleEscapeCheck = new Array(256) // integer, for fast access\nconst simpleEscapeMap = new Array(256)\nfor (let i = 0; i < 256; i++) {\n  simpleEscapeCheck[i] = simpleEscapeSequence(i) ? 1 : 0\n  simpleEscapeMap[i] = simpleEscapeSequence(i)\n}\n\nfunction State (input, options) {\n  this.input = input\n\n  this.filename = options['filename'] || null\n  this.schema = options['schema'] || DEFAULT_SCHEMA\n  this.onWarning = options['onWarning'] || null\n  // (Hidden) Remove? makes the loader to expect YAML 1.1 documents\n  // if such documents have no explicit %YAML directive\n  this.legacy = options['legacy'] || false\n\n  this.json = options['json'] || false\n  this.listener = options['listener'] || null\n  this.maxDepth = typeof options['maxDepth'] === 'number' ? options['maxDepth'] : 100\n  this.maxTotalMergeKeys = typeof options['maxTotalMergeKeys'] === 'number' ? options['maxTotalMergeKeys'] : 10000\n\n  this.implicitTypes = this.schema.compiledImplicit\n  this.typeMap = this.schema.compiledTypeMap\n\n  this.length = input.length\n  this.position = 0\n  this.line = 0\n  this.lineStart = 0\n  this.lineIndent = 0\n  this.depth = 0\n  this.totalMergeKeys = 0\n\n  // position of first leading tab in the current line,\n  // used to make sure there are no tabs in the indentation\n  this.firstTabInLine = -1\n\n  this.documents = []\n  this.anchorMapTransactions = []\n\n  /*\n  this.version;\n  this.checkLineBreaks;\n  this.tagMap;\n  this.anchorMap;\n  this.tag;\n  this.anchor;\n  this.kind;\n  this.result; */\n}\n\nfunction generateError (state, message) {\n  const mark = {\n    name: state.filename,\n    buffer: state.input.slice(0, -1), // omit trailing \\0\n    position: state.position,\n    line: state.line,\n    column: state.position - state.lineStart\n  }\n\n  mark.snippet = makeSnippet(mark)\n\n  return new YAMLException(message, mark)\n}\n\nfunction throwError (state, message) {\n  throw generateError(state, message)\n}\n\nfunction throwWarning (state, message) {\n  if (state.onWarning) {\n    state.onWarning.call(null, generateError(state, message))\n  }\n}\n\nfunction storeAnchor (state, name, value) {\n  const transactions = state.anchorMapTransactions\n\n  if (transactions.length !== 0) {\n    const transaction = transactions[transactions.length - 1]\n\n    if (!_hasOwnProperty.call(transaction, name)) {\n      transaction[name] = {\n        existed: _hasOwnProperty.call(state.anchorMap, name),\n        value: state.anchorMap[name]\n      }\n    }\n  }\n\n  state.anchorMap[name] = value\n}\n\nfunction beginAnchorTransaction (state) {\n  state.anchorMapTransactions.push(Object.create(null))\n}\n\nfunction commitAnchorTransaction (state) {\n  const transaction = state.anchorMapTransactions.pop()\n  const transactions = state.anchorMapTransactions\n\n  if (transactions.length === 0) return\n\n  const parent = transactions[transactions.length - 1]\n  const names = Object.keys(transaction)\n\n  for (let index = 0, length = names.length; index < length; index += 1) {\n    const name = names[index]\n\n    if (!_hasOwnProperty.call(parent, name)) {\n      parent[name] = transaction[name]\n    }\n  }\n}\n\nfunction rollbackAnchorTransaction (state) {\n  const transaction = state.anchorMapTransactions.pop()\n  const names = Object.keys(transaction)\n\n  for (let index = names.length - 1; index >= 0; index -= 1) {\n    const entry = transaction[names[index]]\n\n    if (entry.existed) {\n      state.anchorMap[names[index]] = entry.value\n    } else {\n      delete state.anchorMap[names[index]]\n    }\n  }\n}\n\nfunction snapshotState (state) {\n  return {\n    position: state.position,\n    line: state.line,\n    lineStart: state.lineStart,\n    lineIndent: state.lineIndent,\n    firstTabInLine: state.firstTabInLine,\n    tag: state.tag,\n    anchor: state.anchor,\n    kind: state.kind,\n    result: state.result\n  }\n}\n\nfunction restoreState (state, snapshot) {\n  state.position = snapshot.position\n  state.line = snapshot.line\n  state.lineStart = snapshot.lineStart\n  state.lineIndent = snapshot.lineIndent\n  state.firstTabInLine = snapshot.firstTabInLine\n  state.tag = snapshot.tag\n  state.anchor = snapshot.anchor\n  state.kind = snapshot.kind\n  state.result = snapshot.result\n}\n\nconst directiveHandlers = {\n\n  YAML: function handleYamlDirective (state, name, args) {\n    if (state.version !== null) {\n      throwError(state, 'duplication of %YAML directive')\n    }\n\n    if (args.length !== 1) {\n      throwError(state, 'YAML directive accepts exactly one argument')\n    }\n\n    const match = /^([0-9]+)\\.([0-9]+)$/.exec(args[0])\n\n    if (match === null) {\n      throwError(state, 'ill-formed argument of the YAML directive')\n    }\n\n    const major = parseInt(match[1], 10)\n    const minor = parseInt(match[2], 10)\n\n    if (major !== 1) {\n      throwError(state, 'unacceptable YAML version of the document')\n    }\n\n    state.version = args[0]\n    state.checkLineBreaks = (minor < 2)\n\n    if (minor !== 1 && minor !== 2) {\n      throwWarning(state, 'unsupported YAML version of the document')\n    }\n  },\n\n  TAG: function handleTagDirective (state, name, args) {\n    let prefix\n\n    if (args.length !== 2) {\n      throwError(state, 'TAG directive accepts exactly two arguments')\n    }\n\n    const handle = args[0]\n    prefix = args[1]\n\n    if (!PATTERN_TAG_HANDLE.test(handle)) {\n      throwError(state, 'ill-formed tag handle (first argument) of the TAG directive')\n    }\n\n    if (_hasOwnProperty.call(state.tagMap, handle)) {\n      throwError(state, 'there is a previously declared suffix for \"' + handle + '\" tag handle')\n    }\n\n    if (!PATTERN_TAG_URI.test(prefix)) {\n      throwError(state, 'ill-formed tag prefix (second argument) of the TAG directive')\n    }\n\n    try {\n      prefix = decodeURIComponent(prefix)\n    } catch (err) {\n      throwError(state, 'tag prefix is malformed: ' + prefix)\n    }\n\n    state.tagMap[handle] = prefix\n  }\n}\n\nfunction captureSegment (state, start, end, checkJson) {\n  if (start < end) {\n    const _result = state.input.slice(start, end)\n\n    if (checkJson) {\n      for (let _position = 0, _length = _result.length; _position < _length; _position += 1) {\n        const _character = _result.charCodeAt(_position)\n        if (!(_character === 0x09 ||\n              (_character >= 0x20 && _character <= 0x10FFFF))) {\n          throwError(state, 'expected valid JSON character')\n        }\n      }\n    } else if (PATTERN_NON_PRINTABLE.test(_result)) {\n      throwError(state, 'the stream contains non-printable characters')\n    }\n\n    state.result += _result\n  }\n}\n\nfunction mergeMappings (state, destination, source, overridableKeys) {\n  if (!common.isObject(source)) {\n    throwError(state, 'cannot merge mappings; the provided source object is unacceptable')\n  }\n\n  const sourceKeys = Object.keys(source)\n\n  for (let index = 0, quantity = sourceKeys.length; index < quantity; index += 1) {\n    const key = sourceKeys[index]\n\n    if (state.maxTotalMergeKeys !== -1 && ++state.totalMergeKeys > state.maxTotalMergeKeys) {\n      throwError(state, 'merge keys exceeded maxTotalMergeKeys (' + state.maxTotalMergeKeys + ')')\n    }\n\n    if (!_hasOwnProperty.call(destination, key)) {\n      setProperty(destination, key, source[key])\n      overridableKeys[key] = true\n    }\n  }\n}\n\nfunction storeMappingPair (state, _result, overridableKeys, keyTag, keyNode, valueNode,\n  startLine, startLineStart, startPos) {\n  // The output is a plain object here, so keys can only be strings.\n  // We need to convert keyNode to a string, but doing so can hang the process\n  // (deeply nested arrays that explode exponentially using aliases).\n  if (Array.isArray(keyNode)) {\n    keyNode = Array.prototype.slice.call(keyNode)\n\n    for (let index = 0, quantity = keyNode.length; index < quantity; index += 1) {\n      if (Array.isArray(keyNode[index])) {\n        throwError(state, 'nested arrays are not supported inside keys')\n      }\n\n      if (typeof keyNode === 'object' && _class(keyNode[index]) === '[object Object]') {\n        keyNode[index] = '[object Object]'\n      }\n    }\n  }\n\n  // Avoid code execution in load() via toString property\n  // (still use its own toString for arrays, timestamps,\n  // and whatever user schema extensions happen to have @@toStringTag)\n  if (typeof keyNode === 'object' && _class(keyNode) === '[object Object]') {\n    keyNode = '[object Object]'\n  }\n\n  keyNode = String(keyNode)\n\n  if (_result === null) {\n    _result = {}\n  }\n\n  if (keyTag === 'tag:yaml.org,2002:merge') {\n    if (Array.isArray(valueNode)) {\n      for (let index = 0, quantity = valueNode.length; index < quantity; index += 1) {\n        mergeMappings(state, _result, valueNode[index], overridableKeys)\n      }\n    } else {\n      mergeMappings(state, _result, valueNode, overridableKeys)\n    }\n  } else {\n    if (!state.json &&\n        !_hasOwnProperty.call(overridableKeys, keyNode) &&\n        _hasOwnProperty.call(_result, keyNode)) {\n      state.line = startLine || state.line\n      state.lineStart = startLineStart || state.lineStart\n      state.position = startPos || state.position\n      throwError(state, 'duplicated mapping key')\n    }\n\n    setProperty(_result, keyNode, valueNode)\n    delete overridableKeys[keyNode]\n  }\n\n  return _result\n}\n\nfunction readLineBreak (state) {\n  const ch = state.input.charCodeAt(state.position)\n\n  if (ch === 0x0A/* LF */) {\n    state.position++\n  } else if (ch === 0x0D/* CR */) {\n    state.position++\n    if (state.input.charCodeAt(state.position) === 0x0A/* LF */) {\n      state.position++\n    }\n  } else {\n    throwError(state, 'a line break is expected')\n  }\n\n  state.line += 1\n  state.lineStart = state.position\n  state.firstTabInLine = -1\n}\n\nfunction skipSeparationSpace (state, allowComments, checkIndent) {\n  let lineBreaks = 0\n  let ch = state.input.charCodeAt(state.position)\n\n  while (ch !== 0) {\n    while (isWhiteSpace(ch)) {\n      if (ch === 0x09/* Tab */ && state.firstTabInLine === -1) {\n        state.firstTabInLine = state.position\n      }\n      ch = state.input.charCodeAt(++state.position)\n    }\n\n    if (allowComments && ch === 0x23/* # */) {\n      do {\n        ch = state.input.charCodeAt(++state.position)\n      } while (ch !== 0x0A/* LF */ && ch !== 0x0D/* CR */ && ch !== 0)\n    }\n\n    if (isEol(ch)) {\n      readLineBreak(state)\n\n      ch = state.input.charCodeAt(state.position)\n      lineBreaks++\n      state.lineIndent = 0\n\n      while (ch === 0x20/* Space */) {\n        state.lineIndent++\n        ch = state.input.charCodeAt(++state.position)\n      }\n    } else {\n      break\n    }\n  }\n\n  if (checkIndent !== -1 && lineBreaks !== 0 && state.lineIndent < checkIndent) {\n    throwWarning(state, 'deficient indentation')\n  }\n\n  return lineBreaks\n}\n\nfunction testDocumentSeparator (state) {\n  let _position = state.position\n  let ch = state.input.charCodeAt(_position)\n\n  // Condition state.position === state.lineStart is tested\n  // in parent on each call, for efficiency. No needs to test here again.\n  if ((ch === 0x2D/* - */ || ch === 0x2E/* . */) &&\n      ch === state.input.charCodeAt(_position + 1) &&\n      ch === state.input.charCodeAt(_position + 2)) {\n    _position += 3\n\n    ch = state.input.charCodeAt(_position)\n\n    if (ch === 0 || isWsOrEol(ch)) {\n      return true\n    }\n  }\n\n  return false\n}\n\nfunction writeFoldedLines (state, count) {\n  if (count === 1) {\n    state.result += ' '\n  } else if (count > 1) {\n    state.result += common.repeat('\\n', count - 1)\n  }\n}\n\nfunction readPlainScalar (state, nodeIndent, withinFlowCollection) {\n  let captureStart\n  let captureEnd\n  let hasPendingContent\n  let _line\n  let _lineStart\n  let _lineIndent\n  const _kind = state.kind\n  const _result = state.result\n\n  let ch = state.input.charCodeAt(state.position)\n\n  if (isWsOrEol(ch) ||\n      isFlowIndicator(ch) ||\n      ch === 0x23/* # */ ||\n      ch === 0x26/* & */ ||\n      ch === 0x2A/* * */ ||\n      ch === 0x21/* ! */ ||\n      ch === 0x7C/* | */ ||\n      ch === 0x3E/* > */ ||\n      ch === 0x27/* ' */ ||\n      ch === 0x22/* \" */ ||\n      ch === 0x25/* % */ ||\n      ch === 0x40/* @ */ ||\n      ch === 0x60/* ` */) {\n    return false\n  }\n\n  if (ch === 0x3F/* ? */ || ch === 0x2D/* - */) {\n    const following = state.input.charCodeAt(state.position + 1)\n\n    if (isWsOrEol(following) ||\n        (withinFlowCollection && isFlowIndicator(following))) {\n      return false\n    }\n  }\n\n  state.kind = 'scalar'\n  state.result = ''\n  captureStart = captureEnd = state.position\n  hasPendingContent = false\n\n  while (ch !== 0) {\n    if (ch === 0x3A/* : */) {\n      const following = state.input.charCodeAt(state.position + 1)\n\n      if (isWsOrEol(following) ||\n          (withinFlowCollection && isFlowIndicator(following))) {\n        break\n      }\n    } else if (ch === 0x23/* # */) {\n      const preceding = state.input.charCodeAt(state.position - 1)\n\n      if (isWsOrEol(preceding)) {\n        break\n      }\n    } else if ((state.position === state.lineStart && testDocumentSeparator(state)) ||\n               (withinFlowCollection && isFlowIndicator(ch))) {\n      break\n    } else if (isEol(ch)) {\n      _line = state.line\n      _lineStart = state.lineStart\n      _lineIndent = state.lineIndent\n      skipSeparationSpace(state, false, -1)\n\n      if (state.lineIndent >= nodeIndent) {\n        hasPendingContent = true\n        ch = state.input.charCodeAt(state.position)\n        continue\n      } else {\n        state.position = captureEnd\n        state.line = _line\n        state.lineStart = _lineStart\n        state.lineIndent = _lineIndent\n        break\n      }\n    }\n\n    if (hasPendingContent) {\n      captureSegment(state, captureStart, captureEnd, false)\n      writeFoldedLines(state, state.line - _line)\n      captureStart = captureEnd = state.position\n      hasPendingContent = false\n    }\n\n    if (!isWhiteSpace(ch)) {\n      captureEnd = state.position + 1\n    }\n\n    ch = state.input.charCodeAt(++state.position)\n  }\n\n  captureSegment(state, captureStart, captureEnd, false)\n\n  if (state.result) {\n    return true\n  }\n\n  state.kind = _kind\n  state.result = _result\n  return false\n}\n\nfunction readSingleQuotedScalar (state, nodeIndent) {\n  let captureStart\n  let captureEnd\n\n  let ch = state.input.charCodeAt(state.position)\n\n  if (ch !== 0x27/* ' */) {\n    return false\n  }\n\n  state.kind = 'scalar'\n  state.result = ''\n  state.position++\n  captureStart = captureEnd = state.position\n\n  while ((ch = state.input.charCodeAt(state.position)) !== 0) {\n    if (ch === 0x27/* ' */) {\n      captureSegment(state, captureStart, state.position, true)\n      ch = state.input.charCodeAt(++state.position)\n\n      if (ch === 0x27/* ' */) {\n        captureStart = state.position\n        state.position++\n        captureEnd = state.position\n      } else {\n        return true\n      }\n    } else if (isEol(ch)) {\n      captureSegment(state, captureStart, captureEnd, true)\n      writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent))\n      captureStart = captureEnd = state.position\n    } else if (state.position === state.lineStart && testDocumentSeparator(state)) {\n      throwError(state, 'unexpected end of the document within a single quoted scalar')\n    } else {\n      state.position++\n      if (!isWhiteSpace(ch)) {\n        captureEnd = state.position\n      }\n    }\n  }\n\n  throwError(state, 'unexpected end of the stream within a single quoted scalar')\n}\n\nfunction readDoubleQuotedScalar (state, nodeIndent) {\n  let captureStart\n  let captureEnd\n  let tmp\n\n  let ch = state.input.charCodeAt(state.position)\n\n  if (ch !== 0x22/* \" */) {\n    return false\n  }\n\n  state.kind = 'scalar'\n  state.result = ''\n  state.position++\n  captureStart = captureEnd = state.position\n\n  while ((ch = state.input.charCodeAt(state.position)) !== 0) {\n    if (ch === 0x22/* \" */) {\n      captureSegment(state, captureStart, state.position, true)\n      state.position++\n      return true\n    } else if (ch === 0x5C/* \\ */) {\n      captureSegment(state, captureStart, state.position, true)\n      ch = state.input.charCodeAt(++state.position)\n\n      if (isEol(ch)) {\n        skipSeparationSpace(state, false, nodeIndent)\n\n        // TODO: rework to inline fn with no type cast?\n      } else if (ch < 256 && simpleEscapeCheck[ch]) {\n        state.result += simpleEscapeMap[ch]\n        state.position++\n      } else if ((tmp = escapedHexLen(ch)) > 0) {\n        let hexLength = tmp\n        let hexResult = 0\n\n        for (; hexLength > 0; hexLength--) {\n          ch = state.input.charCodeAt(++state.position)\n\n          if ((tmp = fromHexCode(ch)) >= 0) {\n            hexResult = (hexResult << 4) + tmp\n          } else {\n            throwError(state, 'expected hexadecimal character')\n          }\n        }\n\n        state.result += charFromCodepoint(hexResult)\n\n        state.position++\n      } else {\n        throwError(state, 'unknown escape sequence')\n      }\n\n      captureStart = captureEnd = state.position\n    } else if (isEol(ch)) {\n      captureSegment(state, captureStart, captureEnd, true)\n      writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent))\n      captureStart = captureEnd = state.position\n    } else if (state.position === state.lineStart && testDocumentSeparator(state)) {\n      throwError(state, 'unexpected end of the document within a double quoted scalar')\n    } else {\n      state.position++\n      if (!isWhiteSpace(ch)) {\n        captureEnd = state.position\n      }\n    }\n  }\n\n  throwError(state, 'unexpected end of the stream within a double quoted scalar')\n}\n\nfunction readFlowCollection (state, nodeIndent) {\n  let readNext = true\n  let _line\n  let _lineStart\n  let _pos\n  const _tag = state.tag\n  let _result\n  const _anchor = state.anchor\n  let terminator\n  let isPair\n  let isExplicitPair\n  let isMapping\n  const overridableKeys = Object.create(null)\n  let keyNode\n  let keyTag\n  let valueNode\n\n  let ch = state.input.charCodeAt(state.position)\n\n  if (ch === 0x5B/* [ */) {\n    terminator = 0x5D/* ] */\n    isMapping = false\n    _result = []\n  } else if (ch === 0x7B/* { */) {\n    terminator = 0x7D/* } */\n    isMapping = true\n    _result = {}\n  } else {\n    return false\n  }\n\n  if (state.anchor !== null) {\n    storeAnchor(state, state.anchor, _result)\n  }\n\n  ch = state.input.charCodeAt(++state.position)\n\n  while (ch !== 0) {\n    skipSeparationSpace(state, true, nodeIndent)\n\n    ch = state.input.charCodeAt(state.position)\n\n    if (ch === terminator) {\n      state.position++\n      state.tag = _tag\n      state.anchor = _anchor\n      state.kind = isMapping ? 'mapping' : 'sequence'\n      state.result = _result\n      return true\n    } else if (!readNext) {\n      throwError(state, 'missed comma between flow collection entries')\n    } else if (ch === 0x2C/* , */) {\n      // \"flow collection entries can never be completely empty\", as per YAML 1.2, section 7.4\n      throwError(state, \"expected the node content, but found ','\")\n    }\n\n    keyTag = keyNode = valueNode = null\n    isPair = isExplicitPair = false\n\n    if (ch === 0x3F/* ? */) {\n      const following = state.input.charCodeAt(state.position + 1)\n\n      if (isWsOrEol(following)) {\n        isPair = isExplicitPair = true\n        state.position++\n        skipSeparationSpace(state, true, nodeIndent)\n      }\n    }\n\n    _line = state.line // Save the current line.\n    _lineStart = state.lineStart\n    _pos = state.position\n    composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true)\n    keyTag = state.tag\n    keyNode = state.result\n    skipSeparationSpace(state, true, nodeIndent)\n\n    ch = state.input.charCodeAt(state.position)\n\n    if ((isExplicitPair || state.line === _line) && ch === 0x3A/* : */) {\n      isPair = true\n      ch = state.input.charCodeAt(++state.position)\n      skipSeparationSpace(state, true, nodeIndent)\n      composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true)\n      valueNode = state.result\n    }\n\n    if (isMapping) {\n      storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos)\n    } else if (isPair) {\n      _result.push(storeMappingPair(state, null, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos))\n    } else {\n      _result.push(keyNode)\n    }\n\n    skipSeparationSpace(state, true, nodeIndent)\n\n    ch = state.input.charCodeAt(state.position)\n\n    if (ch === 0x2C/* , */) {\n      readNext = true\n      ch = state.input.charCodeAt(++state.position)\n    } else {\n      readNext = false\n    }\n  }\n\n  throwError(state, 'unexpected end of the stream within a flow collection')\n}\n\nfunction readBlockScalar (state, nodeIndent) {\n  let folding\n  let chomping = CHOMPING_CLIP\n  let didReadContent = false\n  let detectedIndent = false\n  let textIndent = nodeIndent\n  let emptyLines = 0\n  let atMoreIndented = false\n  let tmp\n\n  let ch = state.input.charCodeAt(state.position)\n\n  if (ch === 0x7C/* | */) {\n    folding = false\n  } else if (ch === 0x3E/* > */) {\n    folding = true\n  } else {\n    return false\n  }\n\n  state.kind = 'scalar'\n  state.result = ''\n\n  while (ch !== 0) {\n    ch = state.input.charCodeAt(++state.position)\n\n    if (ch === 0x2B/* + */ || ch === 0x2D/* - */) {\n      if (CHOMPING_CLIP === chomping) {\n        chomping = (ch === 0x2B/* + */) ? CHOMPING_KEEP : CHOMPING_STRIP\n      } else {\n        throwError(state, 'repeat of a chomping mode identifier')\n      }\n    } else if ((tmp = fromDecimalCode(ch)) >= 0) {\n      if (tmp === 0) {\n        throwError(state, 'bad explicit indentation width of a block scalar; it cannot be less than one')\n      } else if (!detectedIndent) {\n        textIndent = nodeIndent + tmp - 1\n        detectedIndent = true\n      } else {\n        throwError(state, 'repeat of an indentation width identifier')\n      }\n    } else {\n      break\n    }\n  }\n\n  if (isWhiteSpace(ch)) {\n    do { ch = state.input.charCodeAt(++state.position) }\n    while (isWhiteSpace(ch))\n\n    if (ch === 0x23/* # */) {\n      do { ch = state.input.charCodeAt(++state.position) }\n      while (!isEol(ch) && (ch !== 0))\n    }\n  }\n\n  while (ch !== 0) {\n    readLineBreak(state)\n    state.lineIndent = 0\n\n    ch = state.input.charCodeAt(state.position)\n\n    // eslint-disable-next-line no-unmodified-loop-condition\n    while ((!detectedIndent || state.lineIndent < textIndent) &&\n           (ch === 0x20/* Space */)) {\n      state.lineIndent++\n      ch = state.input.charCodeAt(++state.position)\n    }\n\n    if (!detectedIndent && state.lineIndent > textIndent) {\n      textIndent = state.lineIndent\n    }\n\n    if (isEol(ch)) {\n      emptyLines++\n      continue\n    }\n\n    if (!detectedIndent && textIndent === 0) {\n      throwError(state, 'missing indentation for block scalar')\n    }\n\n    // End of the scalar.\n    if (state.lineIndent < textIndent) {\n      // Perform the chomping.\n      if (chomping === CHOMPING_KEEP) {\n        state.result += common.repeat('\\n', didReadContent ? 1 + emptyLines : emptyLines)\n      } else if (chomping === CHOMPING_CLIP) {\n        if (didReadContent) { // i.e. only if the scalar is not empty.\n          state.result += '\\n'\n        }\n      }\n\n      // Break this `while` cycle and go to the funciton's epilogue.\n      break\n    }\n\n    // Folded style: use fancy rules to handle line breaks.\n    if (folding) {\n      // Lines starting with white space characters (more-indented lines) are not folded.\n      if (isWhiteSpace(ch)) {\n        atMoreIndented = true\n        // except for the first content line (cf. Example 8.1)\n        state.result += common.repeat('\\n', didReadContent ? 1 + emptyLines : emptyLines)\n\n      // End of more-indented block.\n      } else if (atMoreIndented) {\n        atMoreIndented = false\n        state.result += common.repeat('\\n', emptyLines + 1)\n\n      // Just one line break - perceive as the same line.\n      } else if (emptyLines === 0) {\n        if (didReadContent) { // i.e. only if we have already read some scalar content.\n          state.result += ' '\n        }\n\n      // Several line breaks - perceive as different lines.\n      } else {\n        state.result += common.repeat('\\n', emptyLines)\n      }\n\n    // Literal style: just add exact number of line breaks between content lines.\n    } else {\n      // Keep all line breaks except the header line break.\n      state.result += common.repeat('\\n', didReadContent ? 1 + emptyLines : emptyLines)\n    }\n\n    didReadContent = true\n    detectedIndent = true\n    emptyLines = 0\n    const captureStart = state.position\n\n    while (!isEol(ch) && (ch !== 0)) {\n      ch = state.input.charCodeAt(++state.position)\n    }\n\n    captureSegment(state, captureStart, state.position, false)\n  }\n\n  return true\n}\n\nfunction readBlockSequence (state, nodeIndent) {\n  const _tag = state.tag\n  const _anchor = state.anchor\n  const _result = []\n  let detected = false\n\n  // there is a leading tab before this token, so it can't be a block sequence/mapping;\n  // it can still be flow sequence/mapping or a scalar\n  if (state.firstTabInLine !== -1) return false\n\n  if (state.anchor !== null) {\n    storeAnchor(state, state.anchor, _result)\n  }\n\n  let ch = state.input.charCodeAt(state.position)\n\n  while (ch !== 0) {\n    if (state.firstTabInLine !== -1) {\n      state.position = state.firstTabInLine\n      throwError(state, 'tab characters must not be used in indentation')\n    }\n\n    if (ch !== 0x2D/* - */) {\n      break\n    }\n\n    const following = state.input.charCodeAt(state.position + 1)\n\n    if (!isWsOrEol(following)) {\n      break\n    }\n\n    detected = true\n    state.position++\n\n    if (skipSeparationSpace(state, true, -1)) {\n      if (state.lineIndent <= nodeIndent) {\n        _result.push(null)\n        ch = state.input.charCodeAt(state.position)\n        continue\n      }\n    }\n\n    const _line = state.line\n    composeNode(state, nodeIndent, CONTEXT_BLOCK_IN, false, true)\n    _result.push(state.result)\n    skipSeparationSpace(state, true, -1)\n\n    ch = state.input.charCodeAt(state.position)\n\n    if ((state.line === _line || state.lineIndent > nodeIndent) && (ch !== 0)) {\n      throwError(state, 'bad indentation of a sequence entry')\n    } else if (state.lineIndent < nodeIndent) {\n      break\n    }\n  }\n\n  if (detected) {\n    state.tag = _tag\n    state.anchor = _anchor\n    state.kind = 'sequence'\n    state.result = _result\n    return true\n  }\n  return false\n}\n\nfunction readBlockMapping (state, nodeIndent, flowIndent) {\n  let allowCompact\n  let _keyLine\n  let _keyLineStart\n  let _keyPos\n  const _tag = state.tag\n  const _anchor = state.anchor\n  const _result = {}\n  const overridableKeys = Object.create(null)\n  let keyTag = null\n  let keyNode = null\n  let valueNode = null\n  let atExplicitKey = false\n  let detected = false\n\n  // there is a leading tab before this token, so it can't be a block sequence/mapping;\n  // it can still be flow sequence/mapping or a scalar\n  if (state.firstTabInLine !== -1) return false\n\n  if (state.anchor !== null) {\n    storeAnchor(state, state.anchor, _result)\n  }\n\n  let ch = state.input.charCodeAt(state.position)\n\n  while (ch !== 0) {\n    if (!atExplicitKey && state.firstTabInLine !== -1) {\n      state.position = state.firstTabInLine\n      throwError(state, 'tab characters must not be used in indentation')\n    }\n\n    const following = state.input.charCodeAt(state.position + 1)\n    const _line = state.line // Save the current line.\n\n    //\n    // Explicit notation case. There are two separate blocks:\n    // first for the key (denoted by \"?\") and second for the value (denoted by \":\")\n    //\n    if ((ch === 0x3F/* ? */ || ch === 0x3A/* : */) && isWsOrEol(following)) {\n      if (ch === 0x3F/* ? */) {\n        if (atExplicitKey) {\n          storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos)\n          keyTag = keyNode = valueNode = null\n        }\n\n        detected = true\n        atExplicitKey = true\n        allowCompact = true\n      } else if (atExplicitKey) {\n        // i.e. 0x3A/* : */ === character after the explicit key.\n        atExplicitKey = false\n        allowCompact = true\n      } else {\n        throwError(state, 'incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line')\n      }\n\n      state.position += 1\n      ch = following\n\n    //\n    // Implicit notation case. Flow-style node as the key first, then \":\", and the value.\n    //\n    } else {\n      _keyLine = state.line\n      _keyLineStart = state.lineStart\n      _keyPos = state.position\n\n      if (!composeNode(state, flowIndent, CONTEXT_FLOW_OUT, false, true)) {\n        // Neither implicit nor explicit notation.\n        // Reading is done. Go to the epilogue.\n        break\n      }\n\n      if (state.line === _line) {\n        ch = state.input.charCodeAt(state.position)\n\n        while (isWhiteSpace(ch)) {\n          ch = state.input.charCodeAt(++state.position)\n        }\n\n        if (ch === 0x3A/* : */) {\n          ch = state.input.charCodeAt(++state.position)\n\n          if (!isWsOrEol(ch)) {\n            throwError(state, 'a whitespace character is expected after the key-value separator within a block mapping')\n          }\n\n          if (atExplicitKey) {\n            storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos)\n            keyTag = keyNode = valueNode = null\n          }\n\n          detected = true\n          atExplicitKey = false\n          allowCompact = false\n          keyTag = state.tag\n          keyNode = state.result\n        } else if (detected) {\n          throwError(state, 'can not read an implicit mapping pair; a colon is missed')\n        } else {\n          state.tag = _tag\n          state.anchor = _anchor\n          return true // Keep the result of `composeNode`.\n        }\n      } else if (detected) {\n        throwError(state, 'can not read a block mapping entry; a multiline key may not be an implicit key')\n      } else {\n        state.tag = _tag\n        state.anchor = _anchor\n        return true // Keep the result of `composeNode`.\n      }\n    }\n\n    //\n    // Common reading code for both explicit and implicit notations.\n    //\n    if (state.line === _line || state.lineIndent > nodeIndent) {\n      if (atExplicitKey) {\n        _keyLine = state.line\n        _keyLineStart = state.lineStart\n        _keyPos = state.position\n      }\n\n      if (composeNode(state, nodeIndent, CONTEXT_BLOCK_OUT, true, allowCompact)) {\n        if (atExplicitKey) {\n          keyNode = state.result\n        } else {\n          valueNode = state.result\n        }\n      }\n\n      if (!atExplicitKey) {\n        storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _keyLine, _keyLineStart, _keyPos)\n        keyTag = keyNode = valueNode = null\n      }\n\n      skipSeparationSpace(state, true, -1)\n      ch = state.input.charCodeAt(state.position)\n    }\n\n    if ((state.line === _line || state.lineIndent > nodeIndent) && (ch !== 0)) {\n      throwError(state, 'bad indentation of a mapping entry')\n    } else if (state.lineIndent < nodeIndent) {\n      break\n    }\n  }\n\n  //\n  // Epilogue.\n  //\n\n  // Special case: last mapping's node contains only the key in explicit notation.\n  if (atExplicitKey) {\n    storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos)\n  }\n\n  // Expose the resulting mapping.\n  if (detected) {\n    state.tag = _tag\n    state.anchor = _anchor\n    state.kind = 'mapping'\n    state.result = _result\n  }\n\n  return detected\n}\n\nfunction readTagProperty (state) {\n  let isVerbatim = false\n  let isNamed = false\n  let tagHandle\n  let tagName\n\n  let ch = state.input.charCodeAt(state.position)\n\n  if (ch !== 0x21/* ! */) return false\n\n  if (state.tag !== null) {\n    throwError(state, 'duplication of a tag property')\n  }\n\n  ch = state.input.charCodeAt(++state.position)\n\n  if (ch === 0x3C/* < */) {\n    isVerbatim = true\n    ch = state.input.charCodeAt(++state.position)\n  } else if (ch === 0x21/* ! */) {\n    isNamed = true\n    tagHandle = '!!'\n    ch = state.input.charCodeAt(++state.position)\n  } else {\n    tagHandle = '!'\n  }\n\n  let _position = state.position\n\n  if (isVerbatim) {\n    do { ch = state.input.charCodeAt(++state.position) }\n    while (ch !== 0 && ch !== 0x3E/* > */)\n\n    if (state.position < state.length) {\n      tagName = state.input.slice(_position, state.position)\n      ch = state.input.charCodeAt(++state.position)\n    } else {\n      throwError(state, 'unexpected end of the stream within a verbatim tag')\n    }\n  } else {\n    while (ch !== 0 && !isWsOrEol(ch)) {\n      if (ch === 0x21/* ! */) {\n        if (!isNamed) {\n          tagHandle = state.input.slice(_position - 1, state.position + 1)\n\n          if (!PATTERN_TAG_HANDLE.test(tagHandle)) {\n            throwError(state, 'named tag handle cannot contain such characters')\n          }\n\n          isNamed = true\n          _position = state.position + 1\n        } else {\n          throwError(state, 'tag suffix cannot contain exclamation marks')\n        }\n      }\n\n      ch = state.input.charCodeAt(++state.position)\n    }\n\n    tagName = state.input.slice(_position, state.position)\n\n    if (PATTERN_FLOW_INDICATORS.test(tagName)) {\n      throwError(state, 'tag suffix cannot contain flow indicator characters')\n    }\n  }\n\n  if (tagName && !PATTERN_TAG_URI.test(tagName)) {\n    throwError(state, 'tag name cannot contain such characters: ' + tagName)\n  }\n\n  try {\n    tagName = decodeURIComponent(tagName)\n  } catch (err) {\n    throwError(state, 'tag name is malformed: ' + tagName)\n  }\n\n  if (isVerbatim) {\n    state.tag = tagName\n  } else if (_hasOwnProperty.call(state.tagMap, tagHandle)) {\n    state.tag = state.tagMap[tagHandle] + tagName\n  } else if (tagHandle === '!') {\n    state.tag = '!' + tagName\n  } else if (tagHandle === '!!') {\n    state.tag = 'tag:yaml.org,2002:' + tagName\n  } else {\n    throwError(state, 'undeclared tag handle \"' + tagHandle + '\"')\n  }\n\n  return true\n}\n\nfunction readAnchorProperty (state) {\n  let ch = state.input.charCodeAt(state.position)\n\n  if (ch !== 0x26/* & */) return false\n\n  if (state.anchor !== null) {\n    throwError(state, 'duplication of an anchor property')\n  }\n\n  ch = state.input.charCodeAt(++state.position)\n  const _position = state.position\n\n  while (ch !== 0 && !isWsOrEol(ch) && !isFlowIndicator(ch)) {\n    ch = state.input.charCodeAt(++state.position)\n  }\n\n  if (state.position === _position) {\n    throwError(state, 'name of an anchor node must contain at least one character')\n  }\n\n  state.anchor = state.input.slice(_position, state.position)\n  return true\n}\n\nfunction readAlias (state) {\n  let ch = state.input.charCodeAt(state.position)\n\n  if (ch !== 0x2A/* * */) return false\n\n  ch = state.input.charCodeAt(++state.position)\n  const _position = state.position\n\n  while (ch !== 0 && !isWsOrEol(ch) && !isFlowIndicator(ch)) {\n    ch = state.input.charCodeAt(++state.position)\n  }\n\n  if (state.position === _position) {\n    throwError(state, 'name of an alias node must contain at least one character')\n  }\n\n  const alias = state.input.slice(_position, state.position)\n\n  if (!_hasOwnProperty.call(state.anchorMap, alias)) {\n    throwError(state, 'unidentified alias \"' + alias + '\"')\n  }\n\n  state.result = state.anchorMap[alias]\n  skipSeparationSpace(state, true, -1)\n  return true\n}\n\nfunction tryReadBlockMappingFromProperty (state, propertyStart, nodeIndent, flowIndent) {\n  const fallbackState = snapshotState(state)\n\n  beginAnchorTransaction(state)\n  restoreState(state, propertyStart)\n\n  // Re-read the leading properties as part of the first implicit key, not as\n  // properties of the current node.\n  state.tag = null\n  state.anchor = null\n  state.kind = null\n  state.result = null\n\n  if (readBlockMapping(state, nodeIndent, flowIndent) && state.kind === 'mapping') {\n    commitAnchorTransaction(state)\n    return true\n  }\n\n  rollbackAnchorTransaction(state)\n  restoreState(state, fallbackState)\n  return false\n}\n\nfunction composeNode (state, parentIndent, nodeContext, allowToSeek, allowCompact) {\n  let allowBlockScalars\n  let allowBlockCollections\n  let indentStatus = 1 // 1: this>parent, 0: this=parent, -1: this<parent\n  let atNewLine = false\n  let hasContent = false\n  let propertyStart = null\n  let type\n  let flowIndent\n  let blockIndent\n\n  if (state.depth >= state.maxDepth) {\n    throwError(state, 'nesting exceeded maxDepth (' + state.maxDepth + ')')\n  }\n\n  state.depth += 1\n\n  if (state.listener !== null) {\n    state.listener('open', state)\n  }\n\n  state.tag = null\n  state.anchor = null\n  state.kind = null\n  state.result = null\n\n  const allowBlockStyles = allowBlockScalars = allowBlockCollections =\n    CONTEXT_BLOCK_OUT === nodeContext ||\n    CONTEXT_BLOCK_IN === nodeContext\n\n  if (allowToSeek) {\n    if (skipSeparationSpace(state, true, -1)) {\n      atNewLine = true\n\n      if (state.lineIndent > parentIndent) {\n        indentStatus = 1\n      } else if (state.lineIndent === parentIndent) {\n        indentStatus = 0\n      } else if (state.lineIndent < parentIndent) {\n        indentStatus = -1\n      }\n    }\n  }\n\n  if (indentStatus === 1) {\n    while (true) {\n      const ch = state.input.charCodeAt(state.position)\n      const propertyState = snapshotState(state)\n\n      // A duplicate property token after a line break can be the first key of\n      // a nested block mapping, e.g. `!!map\\n  !!str key: value`.\n      if (atNewLine &&\n          ((ch === 0x21/* ! */ && state.tag !== null) ||\n           (ch === 0x26/* & */ && state.anchor !== null))) {\n        break\n      }\n\n      if (!readTagProperty(state) && !readAnchorProperty(state)) {\n        break\n      }\n\n      if (propertyStart === null) {\n        propertyStart = propertyState\n      }\n\n      if (skipSeparationSpace(state, true, -1)) {\n        atNewLine = true\n        allowBlockCollections = allowBlockStyles\n\n        if (state.lineIndent > parentIndent) {\n          indentStatus = 1\n        } else if (state.lineIndent === parentIndent) {\n          indentStatus = 0\n        } else if (state.lineIndent < parentIndent) {\n          indentStatus = -1\n        }\n      } else {\n        allowBlockCollections = false\n      }\n    }\n  }\n\n  if (allowBlockCollections) {\n    allowBlockCollections = atNewLine || allowCompact\n  }\n\n  if (indentStatus === 1 || CONTEXT_BLOCK_OUT === nodeContext) {\n    if (CONTEXT_FLOW_IN === nodeContext || CONTEXT_FLOW_OUT === nodeContext) {\n      flowIndent = parentIndent\n    } else {\n      flowIndent = parentIndent + 1\n    }\n\n    blockIndent = state.position - state.lineStart\n\n    if (indentStatus === 1) {\n      if ((allowBlockCollections &&\n          (readBlockSequence(state, blockIndent) || readBlockMapping(state, blockIndent, flowIndent))) ||\n          readFlowCollection(state, flowIndent)) {\n        hasContent = true\n      } else {\n        const ch = state.input.charCodeAt(state.position)\n\n        if (propertyStart !== null && allowBlockStyles && !allowBlockCollections &&\n            ch !== 0x7C/* | */ && ch !== 0x3E/* > */ &&\n            tryReadBlockMappingFromProperty(\n              state,\n              propertyStart,\n              propertyStart.position - propertyStart.lineStart,\n              flowIndent\n            )) {\n          hasContent = true\n        } else if ((allowBlockScalars && readBlockScalar(state, flowIndent)) ||\n            readSingleQuotedScalar(state, flowIndent) ||\n            readDoubleQuotedScalar(state, flowIndent)) {\n          hasContent = true\n        } else if (readAlias(state)) {\n          hasContent = true\n\n          if (state.tag !== null || state.anchor !== null) {\n            throwError(state, 'alias node should not have any properties')\n          }\n        } else if (readPlainScalar(state, flowIndent, CONTEXT_FLOW_IN === nodeContext)) {\n          hasContent = true\n\n          if (state.tag === null) {\n            state.tag = '?'\n          }\n        }\n\n        if (state.anchor !== null) {\n          storeAnchor(state, state.anchor, state.result)\n        }\n      }\n    } else if (indentStatus === 0) {\n      // Special case: block sequences are allowed to have same indentation level as the parent.\n      // http://www.yaml.org/spec/1.2/spec.html#id2799784\n      hasContent = allowBlockCollections && readBlockSequence(state, blockIndent)\n    }\n  }\n\n  if (state.tag === null) {\n    if (state.anchor !== null) {\n      storeAnchor(state, state.anchor, state.result)\n    }\n  } else if (state.tag === '?') {\n    // Implicit resolving is not allowed for non-scalar types, and '?'\n    // non-specific tag is only automatically assigned to plain scalars.\n    //\n    // We only need to check kind conformity in case user explicitly assigns '?'\n    // tag, for example like this: \"!<?> [0]\"\n    //\n    if (state.result !== null && state.kind !== 'scalar') {\n      throwError(state, 'unacceptable node kind for !<?> tag; it should be \"scalar\", not \"' + state.kind + '\"')\n    }\n\n    for (let typeIndex = 0, typeQuantity = state.implicitTypes.length; typeIndex < typeQuantity; typeIndex += 1) {\n      type = state.implicitTypes[typeIndex]\n\n      if (type.resolve(state.result)) { // `state.result` updated in resolver if matched\n        state.result = type.construct(state.result)\n        state.tag = type.tag\n        if (state.anchor !== null) {\n          storeAnchor(state, state.anchor, state.result)\n        }\n        break\n      }\n    }\n  } else if (state.tag !== '!') {\n    if (_hasOwnProperty.call(state.typeMap[state.kind || 'fallback'], state.tag)) {\n      type = state.typeMap[state.kind || 'fallback'][state.tag]\n    } else {\n      // looking for multi type\n      type = null\n      const typeList = state.typeMap.multi[state.kind || 'fallback']\n\n      for (let typeIndex = 0, typeQuantity = typeList.length; typeIndex < typeQuantity; typeIndex += 1) {\n        if (state.tag.slice(0, typeList[typeIndex].tag.length) === typeList[typeIndex].tag) {\n          type = typeList[typeIndex]\n          break\n        }\n      }\n    }\n\n    if (!type) {\n      throwError(state, 'unknown tag !<' + state.tag + '>')\n    }\n\n    if (state.result !== null && type.kind !== state.kind) {\n      throwError(state, 'unacceptable node kind for !<' + state.tag + '> tag; it should be \"' + type.kind + '\", not \"' + state.kind + '\"')\n    }\n\n    if (!type.resolve(state.result, state.tag)) { // `state.result` updated in resolver if matched\n      throwError(state, 'cannot resolve a node with !<' + state.tag + '> explicit tag')\n    } else {\n      state.result = type.construct(state.result, state.tag)\n      if (state.anchor !== null) {\n        storeAnchor(state, state.anchor, state.result)\n      }\n    }\n  }\n\n  if (state.listener !== null) {\n    state.listener('close', state)\n  }\n\n  state.depth -= 1\n  return state.tag !== null || state.anchor !== null || hasContent\n}\n\nfunction readDocument (state) {\n  const documentStart = state.position\n  let hasDirectives = false\n  let ch\n\n  state.version = null\n  state.checkLineBreaks = state.legacy\n  state.tagMap = Object.create(null)\n  state.anchorMap = Object.create(null)\n\n  while ((ch = state.input.charCodeAt(state.position)) !== 0) {\n    skipSeparationSpace(state, true, -1)\n\n    ch = state.input.charCodeAt(state.position)\n\n    if (state.lineIndent > 0 || ch !== 0x25/* % */) {\n      break\n    }\n\n    hasDirectives = true\n    ch = state.input.charCodeAt(++state.position)\n    let _position = state.position\n\n    while (ch !== 0 && !isWsOrEol(ch)) {\n      ch = state.input.charCodeAt(++state.position)\n    }\n\n    const directiveName = state.input.slice(_position, state.position)\n    const directiveArgs = []\n\n    if (directiveName.length < 1) {\n      throwError(state, 'directive name must not be less than one character in length')\n    }\n\n    while (ch !== 0) {\n      while (isWhiteSpace(ch)) {\n        ch = state.input.charCodeAt(++state.position)\n      }\n\n      if (ch === 0x23/* # */) {\n        do { ch = state.input.charCodeAt(++state.position) }\n        while (ch !== 0 && !isEol(ch))\n        break\n      }\n\n      if (isEol(ch)) break\n\n      _position = state.position\n\n      while (ch !== 0 && !isWsOrEol(ch)) {\n        ch = state.input.charCodeAt(++state.position)\n      }\n\n      directiveArgs.push(state.input.slice(_position, state.position))\n    }\n\n    if (ch !== 0) readLineBreak(state)\n\n    if (_hasOwnProperty.call(directiveHandlers, directiveName)) {\n      directiveHandlers[directiveName](state, directiveName, directiveArgs)\n    } else {\n      throwWarning(state, 'unknown document directive \"' + directiveName + '\"')\n    }\n  }\n\n  skipSeparationSpace(state, true, -1)\n\n  if (state.lineIndent === 0 &&\n      state.input.charCodeAt(state.position) === 0x2D/* - */ &&\n      state.input.charCodeAt(state.position + 1) === 0x2D/* - */ &&\n      state.input.charCodeAt(state.position + 2) === 0x2D/* - */) {\n    state.position += 3\n    skipSeparationSpace(state, true, -1)\n  } else if (hasDirectives) {\n    throwError(state, 'directives end mark is expected')\n  }\n\n  composeNode(state, state.lineIndent - 1, CONTEXT_BLOCK_OUT, false, true)\n  skipSeparationSpace(state, true, -1)\n\n  if (state.checkLineBreaks &&\n      PATTERN_NON_ASCII_LINE_BREAKS.test(state.input.slice(documentStart, state.position))) {\n    throwWarning(state, 'non-ASCII line breaks are interpreted as content')\n  }\n\n  state.documents.push(state.result)\n\n  if (state.position === state.lineStart && testDocumentSeparator(state)) {\n    if (state.input.charCodeAt(state.position) === 0x2E/* . */) {\n      state.position += 3\n      skipSeparationSpace(state, true, -1)\n    }\n    return\n  }\n\n  if (state.position < (state.length - 1)) {\n    throwError(state, 'end of the stream or a document separator is expected')\n  }\n}\n\nfunction loadDocuments (input, options) {\n  input = String(input)\n  options = options || {}\n\n  if (input.length !== 0) {\n    // Add tailing `\\n` if not exists\n    if (input.charCodeAt(input.length - 1) !== 0x0A/* LF */ &&\n        input.charCodeAt(input.length - 1) !== 0x0D/* CR */) {\n      input += '\\n'\n    }\n\n    // Strip BOM\n    if (input.charCodeAt(0) === 0xFEFF) {\n      input = input.slice(1)\n    }\n  }\n\n  const state = new State(input, options)\n\n  const nullpos = input.indexOf('\\0')\n\n  if (nullpos !== -1) {\n    state.position = nullpos\n    throwError(state, 'null byte is not allowed in input')\n  }\n\n  // Use 0 as string terminator. That significantly simplifies bounds check.\n  state.input += '\\0'\n\n  while (state.input.charCodeAt(state.position) === 0x20/* Space */) {\n    state.lineIndent += 1\n    state.position += 1\n  }\n\n  while (state.position < (state.length - 1)) {\n    readDocument(state)\n  }\n\n  return state.documents\n}\n\nfunction loadAll (input, iterator, options) {\n  if (iterator !== null && typeof iterator === 'object' && typeof options === 'undefined') {\n    options = iterator\n    iterator = null\n  }\n\n  const documents = loadDocuments(input, options)\n\n  if (typeof iterator !== 'function') {\n    return documents\n  }\n\n  for (let index = 0, length = documents.length; index < length; index += 1) {\n    iterator(documents[index])\n  }\n}\n\nfunction load (input, options) {\n  const documents = loadDocuments(input, options)\n\n  if (documents.length === 0) {\n    return undefined\n  } else if (documents.length === 1) {\n    return documents[0]\n  }\n  throw new YAMLException('expected a single document in the stream, but found more')\n}\n\nmodule.exports.loadAll = loadAll\nmodule.exports.load = load\n","'use strict'\n\nconst common = require('./common')\nconst YAMLException = require('./exception')\nconst DEFAULT_SCHEMA = require('./schema/default')\n\nconst _toString = Object.prototype.toString\nconst _hasOwnProperty = Object.prototype.hasOwnProperty\n\nconst CHAR_BOM = 0xFEFF\nconst CHAR_TAB = 0x09 /* Tab */\nconst CHAR_LINE_FEED = 0x0A /* LF */\nconst CHAR_CARRIAGE_RETURN = 0x0D /* CR */\nconst CHAR_SPACE = 0x20 /* Space */\nconst CHAR_EXCLAMATION = 0x21 /* ! */\nconst CHAR_DOUBLE_QUOTE = 0x22 /* \" */\nconst CHAR_SHARP = 0x23 /* # */\nconst CHAR_PERCENT = 0x25 /* % */\nconst CHAR_AMPERSAND = 0x26 /* & */\nconst CHAR_SINGLE_QUOTE = 0x27 /* ' */\nconst CHAR_ASTERISK = 0x2A /* * */\nconst CHAR_COMMA = 0x2C /* , */\nconst CHAR_MINUS = 0x2D /* - */\nconst CHAR_COLON = 0x3A /* : */\nconst CHAR_EQUALS = 0x3D /* = */\nconst CHAR_GREATER_THAN = 0x3E /* > */\nconst CHAR_QUESTION = 0x3F /* ? */\nconst CHAR_COMMERCIAL_AT = 0x40 /* @ */\nconst CHAR_LEFT_SQUARE_BRACKET = 0x5B /* [ */\nconst CHAR_RIGHT_SQUARE_BRACKET = 0x5D /* ] */\nconst CHAR_GRAVE_ACCENT = 0x60 /* ` */\nconst CHAR_LEFT_CURLY_BRACKET = 0x7B /* { */\nconst CHAR_VERTICAL_LINE = 0x7C /* | */\nconst CHAR_RIGHT_CURLY_BRACKET = 0x7D /* } */\n\nconst ESCAPE_SEQUENCES = {}\n\nESCAPE_SEQUENCES[0x00] = '\\\\0'\nESCAPE_SEQUENCES[0x07] = '\\\\a'\nESCAPE_SEQUENCES[0x08] = '\\\\b'\nESCAPE_SEQUENCES[0x09] = '\\\\t'\nESCAPE_SEQUENCES[0x0A] = '\\\\n'\nESCAPE_SEQUENCES[0x0B] = '\\\\v'\nESCAPE_SEQUENCES[0x0C] = '\\\\f'\nESCAPE_SEQUENCES[0x0D] = '\\\\r'\nESCAPE_SEQUENCES[0x1B] = '\\\\e'\nESCAPE_SEQUENCES[0x22] = '\\\\\"'\nESCAPE_SEQUENCES[0x5C] = '\\\\\\\\'\nESCAPE_SEQUENCES[0x85] = '\\\\N'\nESCAPE_SEQUENCES[0xA0] = '\\\\_'\nESCAPE_SEQUENCES[0x2028] = '\\\\L'\nESCAPE_SEQUENCES[0x2029] = '\\\\P'\n\nconst DEPRECATED_BOOLEANS_SYNTAX = [\n  'y', 'Y', 'yes', 'Yes', 'YES', 'on', 'On', 'ON',\n  'n', 'N', 'no', 'No', 'NO', 'off', 'Off', 'OFF'\n]\n\nconst DEPRECATED_BASE60_SYNTAX = /^[-+]?[0-9_]+(?::[0-9_]+)+(?:\\.[0-9_]*)?$/\n\nfunction compileStyleMap (schema, map) {\n  if (map === null) return {}\n\n  const result = {}\n  const keys = Object.keys(map)\n\n  for (let index = 0, length = keys.length; index < length; index += 1) {\n    let tag = keys[index]\n    let style = String(map[tag])\n\n    if (tag.slice(0, 2) === '!!') {\n      tag = 'tag:yaml.org,2002:' + tag.slice(2)\n    }\n    const type = schema.compiledTypeMap['fallback'][tag]\n\n    if (type && _hasOwnProperty.call(type.styleAliases, style)) {\n      style = type.styleAliases[style]\n    }\n\n    result[tag] = style\n  }\n\n  return result\n}\n\nfunction encodeHex (character) {\n  let handle\n  let length\n\n  const string = character.toString(16).toUpperCase()\n\n  if (character <= 0xFF) {\n    handle = 'x'\n    length = 2\n  } else if (character <= 0xFFFF) {\n    handle = 'u'\n    length = 4\n  } else if (character <= 0xFFFFFFFF) {\n    handle = 'U'\n    length = 8\n  } else {\n    throw new YAMLException('code point within a string may not be greater than 0xFFFFFFFF')\n  }\n\n  return '\\\\' + handle + common.repeat('0', length - string.length) + string\n}\n\nconst QUOTING_TYPE_SINGLE = 1\nconst QUOTING_TYPE_DOUBLE = 2\n\nfunction State (options) {\n  this.schema = options['schema'] || DEFAULT_SCHEMA\n  this.indent = Math.max(1, (options['indent'] || 2))\n  this.noArrayIndent = options['noArrayIndent'] || false\n  this.skipInvalid = options['skipInvalid'] || false\n  this.flowLevel = (common.isNothing(options['flowLevel']) ? -1 : options['flowLevel'])\n  this.styleMap = compileStyleMap(this.schema, options['styles'] || null)\n  this.sortKeys = options['sortKeys'] || false\n  this.lineWidth = options['lineWidth'] || 80\n  this.noRefs = options['noRefs'] || false\n  this.noCompatMode = options['noCompatMode'] || false\n  this.condenseFlow = options['condenseFlow'] || false\n  this.quotingType = options['quotingType'] === '\"' ? QUOTING_TYPE_DOUBLE : QUOTING_TYPE_SINGLE\n  this.forceQuotes = options['forceQuotes'] || false\n  this.replacer = typeof options['replacer'] === 'function' ? options['replacer'] : null\n\n  this.implicitTypes = this.schema.compiledImplicit\n  this.explicitTypes = this.schema.compiledExplicit\n\n  this.tag = null\n  this.result = ''\n\n  this.duplicates = []\n  this.usedDuplicates = null\n}\n\n// Indents every line in a string. Empty lines (\\n only) are not indented.\nfunction indentString (string, spaces) {\n  const ind = common.repeat(' ', spaces)\n  let position = 0\n  let result = ''\n  const length = string.length\n\n  while (position < length) {\n    let line\n    const next = string.indexOf('\\n', position)\n    if (next === -1) {\n      line = string.slice(position)\n      position = length\n    } else {\n      line = string.slice(position, next + 1)\n      position = next + 1\n    }\n\n    if (line.length && line !== '\\n') result += ind\n\n    result += line\n  }\n\n  return result\n}\n\nfunction generateNextLine (state, level) {\n  return '\\n' + common.repeat(' ', state.indent * level)\n}\n\nfunction testImplicitResolving (state, str) {\n  for (let index = 0, length = state.implicitTypes.length; index < length; index += 1) {\n    const type = state.implicitTypes[index]\n\n    if (type.resolve(str)) {\n      return true\n    }\n  }\n\n  return false\n}\n\n// [33] s-white ::= s-space | s-tab\nfunction isWhitespace (c) {\n  return c === CHAR_SPACE || c === CHAR_TAB\n}\n\n// Returns true if the character can be printed without escaping.\n// From YAML 1.2: \"any allowed characters known to be non-printable\n// should also be escaped. [However,] This isnâ€™t mandatory\"\n// Derived from nb-char - \\t - #x85 - #xA0 - #x2028 - #x2029.\nfunction isPrintable (c) {\n  return (c >= 0x00020 && c <= 0x00007E) ||\n    ((c >= 0x000A1 && c <= 0x00D7FF) && c !== 0x2028 && c !== 0x2029) ||\n    ((c >= 0x0E000 && c <= 0x00FFFD) && c !== CHAR_BOM) ||\n    (c >= 0x10000 && c <= 0x10FFFF)\n}\n\n// [34] ns-char ::= nb-char - s-white\n// [27] nb-char ::= c-printable - b-char - c-byte-order-mark\n// [26] b-char  ::= b-line-feed | b-carriage-return\n// Including s-white (for some reason, examples doesn't match specs in this aspect)\n// ns-char ::= c-printable - b-line-feed - b-carriage-return - c-byte-order-mark\nfunction isNsCharOrWhitespace (c) {\n  return isPrintable(c) &&\n    c !== CHAR_BOM &&\n    // - b-char\n    c !== CHAR_CARRIAGE_RETURN &&\n    c !== CHAR_LINE_FEED\n}\n\n// [127]  ns-plain-safe(c) ::= c = flow-out  â‡’ ns-plain-safe-out\n//                             c = flow-in   â‡’ ns-plain-safe-in\n//                             c = block-key â‡’ ns-plain-safe-out\n//                             c = flow-key  â‡’ ns-plain-safe-in\n// [128] ns-plain-safe-out ::= ns-char\n// [129]  ns-plain-safe-in ::= ns-char - c-flow-indicator\n// [130]  ns-plain-char(c) ::=  ( ns-plain-safe(c) - â€œ:â€� - â€œ#â€� )\n//                            | ( /* An ns-char preceding */ â€œ#â€� )\n//                            | ( â€œ:â€� /* Followed by an ns-plain-safe(c) */ )\nfunction isPlainSafe (c, prev, inblock) {\n  const cIsNsCharOrWhitespace = isNsCharOrWhitespace(c)\n  const cIsNsChar = cIsNsCharOrWhitespace && !isWhitespace(c)\n  return (\n    (\n      // ns-plain-safe\n      inblock // c = flow-in\n        ? cIsNsCharOrWhitespace\n        : cIsNsCharOrWhitespace &&\n          // - c-flow-indicator\n          c !== CHAR_COMMA &&\n          c !== CHAR_LEFT_SQUARE_BRACKET &&\n          c !== CHAR_RIGHT_SQUARE_BRACKET &&\n          c !== CHAR_LEFT_CURLY_BRACKET &&\n          c !== CHAR_RIGHT_CURLY_BRACKET\n    ) &&\n    // ns-plain-char\n    c !== CHAR_SHARP && // false on '#'\n    !(prev === CHAR_COLON && !cIsNsChar)\n  ) || // false on ': '\n  (isNsCharOrWhitespace(prev) && !isWhitespace(prev) && c === CHAR_SHARP) || // change to true on '[^ ]#'\n  (prev === CHAR_COLON && cIsNsChar) // change to true on ':[^ ]'\n}\n\n// Simplified test for values allowed as the first character in plain style.\nfunction isPlainSafeFirst (c) {\n  // Uses a subset of ns-char - c-indicator\n  // where ns-char = nb-char - s-white.\n  // No support of ( ( â€œ?â€� | â€œ:â€� | â€œ-â€� ) /* Followed by an ns-plain-safe(c)) */ ) part\n  return isPrintable(c) &&\n    c !== CHAR_BOM &&\n    !isWhitespace(c) && // - s-white\n    // - (c-indicator ::=\n    // â€œ-â€� | â€œ?â€� | â€œ:â€� | â€œ,â€� | â€œ[â€� | â€œ]â€� | â€œ{â€� | â€œ}â€�\n    c !== CHAR_MINUS &&\n    c !== CHAR_QUESTION &&\n    c !== CHAR_COLON &&\n    c !== CHAR_COMMA &&\n    c !== CHAR_LEFT_SQUARE_BRACKET &&\n    c !== CHAR_RIGHT_SQUARE_BRACKET &&\n    c !== CHAR_LEFT_CURLY_BRACKET &&\n    c !== CHAR_RIGHT_CURLY_BRACKET &&\n    // | â€œ#â€� | â€œ&â€� | â€œ*â€� | â€œ!â€� | â€œ|â€� | â€œ=â€� | â€œ>â€� | â€œ'â€� | â€œ\"â€�\n    c !== CHAR_SHARP &&\n    c !== CHAR_AMPERSAND &&\n    c !== CHAR_ASTERISK &&\n    c !== CHAR_EXCLAMATION &&\n    c !== CHAR_VERTICAL_LINE &&\n    c !== CHAR_EQUALS &&\n    c !== CHAR_GREATER_THAN &&\n    c !== CHAR_SINGLE_QUOTE &&\n    c !== CHAR_DOUBLE_QUOTE &&\n    // | â€œ%â€� | â€œ@â€� | â€œ`â€�)\n    c !== CHAR_PERCENT &&\n    c !== CHAR_COMMERCIAL_AT &&\n    c !== CHAR_GRAVE_ACCENT\n}\n\n// Simplified test for values allowed as the last character in plain style.\nfunction isPlainSafeLast (c) {\n  // just not whitespace or colon, it will be checked to be plain character later\n  return !isWhitespace(c) && c !== CHAR_COLON\n}\n\n// Same as 'string'.codePointAt(pos), but works in older browsers.\nfunction codePointAt (string, pos) {\n  const first = string.charCodeAt(pos)\n  let second\n\n  if (first >= 0xD800 && first <= 0xDBFF && pos + 1 < string.length) {\n    second = string.charCodeAt(pos + 1)\n    if (second >= 0xDC00 && second <= 0xDFFF) {\n      // https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae\n      return (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000\n    }\n  }\n  return first\n}\n\n// Determines whether block indentation indicator is required.\nfunction needIndentIndicator (string) {\n  const leadingSpaceRe = /^\\n* /\n  return leadingSpaceRe.test(string)\n}\n\nconst STYLE_PLAIN = 1\nconst STYLE_SINGLE = 2\nconst STYLE_LITERAL = 3\nconst STYLE_FOLDED = 4\nconst STYLE_DOUBLE = 5\n\n// Determines which scalar styles are possible and returns the preferred style.\n// lineWidth = -1 => no limit.\n// Pre-conditions: str.length > 0.\n// Post-conditions:\n//    STYLE_PLAIN or STYLE_SINGLE => no \\n are in the string.\n//    STYLE_LITERAL => no lines are suitable for folding (or lineWidth is -1).\n//    STYLE_FOLDED => a line > lineWidth and can be folded (and lineWidth != -1).\nfunction chooseScalarStyle (string, singleLineOnly, indentPerLevel, lineWidth,\n  testAmbiguousType, quotingType, forceQuotes, inblock) {\n  let i\n  let char = 0\n  let prevChar = null\n  let hasLineBreak = false\n  let hasFoldableLine = false // only checked if shouldTrackWidth\n  const shouldTrackWidth = lineWidth !== -1\n  let previousLineBreak = -1 // count the first line correctly\n  let plain = isPlainSafeFirst(codePointAt(string, 0)) &&\n    isPlainSafeLast(codePointAt(string, string.length - 1))\n\n  if (singleLineOnly || forceQuotes) {\n    // Case: no block styles.\n    // Check for disallowed characters to rule out plain and single.\n    for (i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++) {\n      char = codePointAt(string, i)\n      if (!isPrintable(char)) {\n        return STYLE_DOUBLE\n      }\n      plain = plain && isPlainSafe(char, prevChar, inblock)\n      prevChar = char\n    }\n  } else {\n    // Case: block styles permitted.\n    for (i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++) {\n      char = codePointAt(string, i)\n      if (char === CHAR_LINE_FEED) {\n        hasLineBreak = true\n        // Check if any line can be folded.\n        if (shouldTrackWidth) {\n          hasFoldableLine = hasFoldableLine ||\n            // Foldable line = too long, and not more-indented.\n            (i - previousLineBreak - 1 > lineWidth &&\n             string[previousLineBreak + 1] !== ' ')\n          previousLineBreak = i\n        }\n      } else if (!isPrintable(char)) {\n        return STYLE_DOUBLE\n      }\n      plain = plain && isPlainSafe(char, prevChar, inblock)\n      prevChar = char\n    }\n    // in case the end is missing a \\n\n    hasFoldableLine = hasFoldableLine || (shouldTrackWidth &&\n      (i - previousLineBreak - 1 > lineWidth &&\n       string[previousLineBreak + 1] !== ' '))\n  }\n  // Although every style can represent \\n without escaping, prefer block styles\n  // for multiline, since they're more readable and they don't add empty lines.\n  // Also prefer folding a super-long line.\n  if (!hasLineBreak && !hasFoldableLine) {\n    // Strings interpretable as another type have to be quoted;\n    // e.g. the string 'true' vs. the boolean true.\n    if (plain && !forceQuotes && !testAmbiguousType(string)) {\n      return STYLE_PLAIN\n    }\n    return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : STYLE_SINGLE\n  }\n  // Edge case: block indentation indicator can only have one digit.\n  if (indentPerLevel > 9 && needIndentIndicator(string)) {\n    return STYLE_DOUBLE\n  }\n  // At this point we know block styles are valid.\n  // Prefer literal style unless we want to fold.\n  if (!forceQuotes) {\n    return hasFoldableLine ? STYLE_FOLDED : STYLE_LITERAL\n  }\n  return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : STYLE_SINGLE\n}\n\n// Note: line breaking/folding is implemented for only the folded style.\n// NB. We drop the last trailing newline (if any) of a returned block scalar\n//  since the dumper adds its own newline. This always works:\n//    â€¢ No ending newline => unaffected; already using strip \"-\" chomping.\n//    â€¢ Ending newline    => removed then restored.\n//  Importantly, this keeps the \"+\" chomp indicator from gaining an extra line.\nfunction writeScalar (state, string, level, iskey, inblock) {\n  state.dump = (function () {\n    if (string.length === 0) {\n      return state.quotingType === QUOTING_TYPE_DOUBLE ? '\"\"' : \"''\"\n    }\n    if (!state.noCompatMode) {\n      if (DEPRECATED_BOOLEANS_SYNTAX.indexOf(string) !== -1 || DEPRECATED_BASE60_SYNTAX.test(string)) {\n        return state.quotingType === QUOTING_TYPE_DOUBLE ? ('\"' + string + '\"') : (\"'\" + string + \"'\")\n      }\n    }\n\n    const indent = state.indent * Math.max(1, level) // no 0-indent scalars\n    // As indentation gets deeper, let the width decrease monotonically\n    // to the lower bound min(state.lineWidth, 40).\n    // Note that this implies\n    //  state.lineWidth â‰¤ 40 + state.indent: width is fixed at the lower bound.\n    //  state.lineWidth > 40 + state.indent: width decreases until the lower bound.\n    // This behaves better than a constant minimum width which disallows narrower options,\n    // or an indent threshold which causes the width to suddenly increase.\n    const lineWidth = (state.lineWidth === -1)\n      ? -1\n      : Math.max(Math.min(state.lineWidth, 40), state.lineWidth - indent)\n\n    // Without knowing if keys are implicit/explicit, assume implicit for safety.\n    const singleLineOnly = iskey ||\n      // No block styles in flow mode.\n      (state.flowLevel > -1 && level >= state.flowLevel)\n    function testAmbiguity (string) {\n      return testImplicitResolving(state, string)\n    }\n\n    switch (chooseScalarStyle(string, singleLineOnly, state.indent, lineWidth,\n      testAmbiguity, state.quotingType, state.forceQuotes && !iskey, inblock)) {\n      case STYLE_PLAIN:\n        return string\n      case STYLE_SINGLE:\n        return \"'\" + string.replace(/'/g, \"''\") + \"'\"\n      case STYLE_LITERAL:\n        return '|' + blockHeader(string, state.indent) +\n          dropEndingNewline(indentString(string, indent))\n      case STYLE_FOLDED:\n        return '>' + blockHeader(string, state.indent) +\n          dropEndingNewline(indentString(foldString(string, lineWidth), indent))\n      case STYLE_DOUBLE:\n        return '\"' + escapeString(string, lineWidth) + '\"'\n      default:\n        throw new YAMLException('impossible error: invalid scalar style')\n    }\n  }())\n}\n\n// Pre-conditions: string is valid for a block scalar, 1 <= indentPerLevel <= 9.\nfunction blockHeader (string, indentPerLevel) {\n  const indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : ''\n\n  // note the special case: the string '\\n' counts as a \"trailing\" empty line.\n  const clip = string[string.length - 1] === '\\n'\n  const keep = clip && (string[string.length - 2] === '\\n' || string === '\\n')\n  const chomp = keep ? '+' : (clip ? '' : '-')\n\n  return indentIndicator + chomp + '\\n'\n}\n\n// (See the note for writeScalar.)\nfunction dropEndingNewline (string) {\n  return string[string.length - 1] === '\\n' ? string.slice(0, -1) : string\n}\n\n// Note: a long line without a suitable break point will exceed the width limit.\n// Pre-conditions: every char in str isPrintable, str.length > 0, width > 0.\nfunction foldString (string, width) {\n  // In folded style, $k$ consecutive newlines output as $k+1$ newlinesâ€”\n  // unless they're before or after a more-indented line, or at the very\n  // beginning or end, in which case $k$ maps to $k$.\n  // Therefore, parse each chunk as newline(s) followed by a content line.\n  const lineRe = /(\\n+)([^\\n]*)/g\n\n  // first line (possibly an empty line)\n  let result = (function () {\n    let nextLF = string.indexOf('\\n')\n    nextLF = nextLF !== -1 ? nextLF : string.length\n    lineRe.lastIndex = nextLF\n    return foldLine(string.slice(0, nextLF), width)\n  }())\n  // If we haven't reached the first content line yet, don't add an extra \\n.\n  let prevMoreIndented = string[0] === '\\n' || string[0] === ' '\n  let moreIndented\n\n  // rest of the lines\n  let match\n  while ((match = lineRe.exec(string))) {\n    const prefix = match[1]\n    const line = match[2]\n\n    moreIndented = (line[0] === ' ')\n    result += prefix +\n      ((!prevMoreIndented && !moreIndented && line !== '') ? '\\n' : '') +\n      foldLine(line, width)\n    prevMoreIndented = moreIndented\n  }\n\n  return result\n}\n\n// Greedy line breaking.\n// Picks the longest line under the limit each time,\n// otherwise settles for the shortest line over the limit.\n// NB. More-indented lines *cannot* be folded, as that would add an extra \\n.\nfunction foldLine (line, width) {\n  if (line === '' || line[0] === ' ') return line\n\n  // Since a more-indented line adds a \\n, breaks can't be followed by a space.\n  const breakRe = / [^ ]/g // note: the match index will always be <= length-2.\n  let match\n  // start is an inclusive index. end, curr, and next are exclusive.\n  let start = 0\n  let end\n  let curr = 0\n  let next = 0\n  let result = ''\n\n  // Invariants: 0 <= start <= length-1.\n  //   0 <= curr <= next <= max(0, length-2). curr - start <= width.\n  // Inside the loop:\n  //   A match implies length >= 2, so curr and next are <= length-2.\n  while ((match = breakRe.exec(line))) {\n    next = match.index\n    // maintain invariant: curr - start <= width\n    if (next - start > width) {\n      end = (curr > start) ? curr : next // derive end <= length-2\n      result += '\\n' + line.slice(start, end)\n      // skip the space that was output as \\n\n      start = end + 1                    // derive start <= length-1\n    }\n    curr = next\n  }\n\n  // By the invariants, start <= length-1, so there is something left over.\n  // It is either the whole string or a part starting from non-whitespace.\n  result += '\\n'\n  // Insert a break if the remainder is too long and there is a break available.\n  if (line.length - start > width && curr > start) {\n    result += line.slice(start, curr) + '\\n' + line.slice(curr + 1)\n  } else {\n    result += line.slice(start)\n  }\n\n  return result.slice(1) // drop extra \\n joiner\n}\n\n// Escapes a double-quoted string.\nfunction escapeString (string) {\n  let result = ''\n  let char = 0\n\n  for (let i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++) {\n    char = codePointAt(string, i)\n    const escapeSeq = ESCAPE_SEQUENCES[char]\n\n    if (!escapeSeq && isPrintable(char)) {\n      result += string[i]\n      if (char >= 0x10000) result += string[i + 1]\n    } else {\n      result += escapeSeq || encodeHex(char)\n    }\n  }\n\n  return result\n}\n\nfunction writeFlowSequence (state, level, object) {\n  let _result = ''\n  const _tag = state.tag\n\n  for (let index = 0, length = object.length; index < length; index += 1) {\n    let value = object[index]\n\n    if (state.replacer) {\n      value = state.replacer.call(object, String(index), value)\n    }\n\n    // Write only valid elements, put null instead of invalid elements.\n    if (writeNode(state, level, value, false, false) ||\n        (typeof value === 'undefined' &&\n         writeNode(state, level, null, false, false))) {\n      if (_result !== '') _result += ',' + (!state.condenseFlow ? ' ' : '')\n      _result += state.dump\n    }\n  }\n\n  state.tag = _tag\n  state.dump = '[' + _result + ']'\n}\n\nfunction writeBlockSequence (state, level, object, compact) {\n  let _result = ''\n  const _tag = state.tag\n\n  for (let index = 0, length = object.length; index < length; index += 1) {\n    let value = object[index]\n\n    if (state.replacer) {\n      value = state.replacer.call(object, String(index), value)\n    }\n\n    // Write only valid elements, put null instead of invalid elements.\n    if (writeNode(state, level + 1, value, true, true, false, true) ||\n        (typeof value === 'undefined' &&\n         writeNode(state, level + 1, null, true, true, false, true))) {\n      if (!compact || _result !== '') {\n        _result += generateNextLine(state, level)\n      }\n\n      if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {\n        _result += '-'\n      } else {\n        _result += '- '\n      }\n\n      _result += state.dump\n    }\n  }\n\n  state.tag = _tag\n  state.dump = _result || '[]' // Empty sequence if no valid values.\n}\n\nfunction writeFlowMapping (state, level, object) {\n  let _result = ''\n  const _tag = state.tag\n  const objectKeyList = Object.keys(object)\n\n  for (let index = 0, length = objectKeyList.length; index < length; index += 1) {\n    let pairBuffer = ''\n    if (_result !== '') pairBuffer += ', '\n\n    if (state.condenseFlow) pairBuffer += '\"'\n\n    const objectKey = objectKeyList[index]\n    let objectValue = object[objectKey]\n\n    if (state.replacer) {\n      objectValue = state.replacer.call(object, objectKey, objectValue)\n    }\n\n    if (!writeNode(state, level, objectKey, false, false)) {\n      continue // Skip this pair because of invalid key;\n    }\n\n    if (state.dump.length > 1024) pairBuffer += '? '\n\n    pairBuffer += state.dump + (state.condenseFlow ? '\"' : '') + ':' + (state.condenseFlow ? '' : ' ')\n\n    if (!writeNode(state, level, objectValue, false, false)) {\n      continue // Skip this pair because of invalid value.\n    }\n\n    pairBuffer += state.dump\n\n    // Both key and value are valid.\n    _result += pairBuffer\n  }\n\n  state.tag = _tag\n  state.dump = '{' + _result + '}'\n}\n\nfunction writeBlockMapping (state, level, object, compact) {\n  let _result = ''\n  const _tag = state.tag\n  const objectKeyList = Object.keys(object)\n\n  // Allow sorting keys so that the output file is deterministic\n  if (state.sortKeys === true) {\n    // Default sorting\n    objectKeyList.sort()\n  } else if (typeof state.sortKeys === 'function') {\n    // Custom sort function\n    objectKeyList.sort(state.sortKeys)\n  } else if (state.sortKeys) {\n    // Something is wrong\n    throw new YAMLException('sortKeys must be a boolean or a function')\n  }\n\n  for (let index = 0, length = objectKeyList.length; index < length; index += 1) {\n    let pairBuffer = ''\n\n    if (!compact || _result !== '') {\n      pairBuffer += generateNextLine(state, level)\n    }\n\n    const objectKey = objectKeyList[index]\n    let objectValue = object[objectKey]\n\n    if (state.replacer) {\n      objectValue = state.replacer.call(object, objectKey, objectValue)\n    }\n\n    if (!writeNode(state, level + 1, objectKey, true, true, true)) {\n      continue // Skip this pair because of invalid key.\n    }\n\n    const explicitPair = (state.tag !== null && state.tag !== '?') ||\n                   (state.dump && state.dump.length > 1024)\n\n    if (explicitPair) {\n      if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {\n        pairBuffer += '?'\n      } else {\n        pairBuffer += '? '\n      }\n    }\n\n    pairBuffer += state.dump\n\n    if (explicitPair) {\n      pairBuffer += generateNextLine(state, level)\n    }\n\n    if (!writeNode(state, level + 1, objectValue, true, explicitPair)) {\n      continue // Skip this pair because of invalid value.\n    }\n\n    if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {\n      pairBuffer += ':'\n    } else {\n      pairBuffer += ': '\n    }\n\n    pairBuffer += state.dump\n\n    // Both key and value are valid.\n    _result += pairBuffer\n  }\n\n  state.tag = _tag\n  state.dump = _result || '{}' // Empty mapping if no valid pairs.\n}\n\nfunction detectType (state, object, explicit) {\n  const typeList = explicit ? state.explicitTypes : state.implicitTypes\n\n  for (let index = 0, length = typeList.length; index < length; index += 1) {\n    const type = typeList[index]\n\n    if ((type.instanceOf || type.predicate) &&\n        (!type.instanceOf || ((typeof object === 'object') && (object instanceof type.instanceOf))) &&\n        (!type.predicate || type.predicate(object))) {\n      if (explicit) {\n        if (type.multi && type.representName) {\n          state.tag = type.representName(object)\n        } else {\n          state.tag = type.tag\n        }\n      } else {\n        state.tag = '?'\n      }\n\n      if (type.represent) {\n        const style = state.styleMap[type.tag] || type.defaultStyle\n\n        let _result\n        if (_toString.call(type.represent) === '[object Function]') {\n          _result = type.represent(object, style)\n        } else if (_hasOwnProperty.call(type.represent, style)) {\n          _result = type.represent[style](object, style)\n        } else {\n          throw new YAMLException('!<' + type.tag + '> tag resolver accepts not \"' + style + '\" style')\n        }\n\n        state.dump = _result\n      }\n\n      return true\n    }\n  }\n\n  return false\n}\n\n// Serializes `object` and writes it to global `result`.\n// Returns true on success, or false on invalid object.\n//\nfunction writeNode (state, level, object, block, compact, iskey, isblockseq) {\n  state.tag = null\n  state.dump = object\n\n  if (!detectType(state, object, false)) {\n    detectType(state, object, true)\n  }\n\n  const type = _toString.call(state.dump)\n  const inblock = block\n\n  if (block) {\n    block = (state.flowLevel < 0 || state.flowLevel > level)\n  }\n\n  const objectOrArray = type === '[object Object]' || type === '[object Array]'\n  let duplicateIndex\n  let duplicate\n\n  if (objectOrArray) {\n    duplicateIndex = state.duplicates.indexOf(object)\n    duplicate = duplicateIndex !== -1\n  }\n\n  if ((state.tag !== null && state.tag !== '?') || duplicate || (state.indent !== 2 && level > 0)) {\n    compact = false\n  }\n\n  if (duplicate && state.usedDuplicates[duplicateIndex]) {\n    state.dump = '*ref_' + duplicateIndex\n  } else {\n    if (objectOrArray && duplicate && !state.usedDuplicates[duplicateIndex]) {\n      state.usedDuplicates[duplicateIndex] = true\n    }\n    if (type === '[object Object]') {\n      if (block && (Object.keys(state.dump).length !== 0)) {\n        writeBlockMapping(state, level, state.dump, compact)\n        if (duplicate) {\n          state.dump = '&ref_' + duplicateIndex + state.dump\n        }\n      } else {\n        writeFlowMapping(state, level, state.dump)\n        if (duplicate) {\n          state.dump = '&ref_' + duplicateIndex + ' ' + state.dump\n        }\n      }\n    } else if (type === '[object Array]') {\n      if (block && (state.dump.length !== 0)) {\n        if (state.noArrayIndent && !isblockseq && level > 0) {\n          writeBlockSequence(state, level - 1, state.dump, compact)\n        } else {\n          writeBlockSequence(state, level, state.dump, compact)\n        }\n        if (duplicate) {\n          state.dump = '&ref_' + duplicateIndex + state.dump\n        }\n      } else {\n        writeFlowSequence(state, level, state.dump)\n        if (duplicate) {\n          state.dump = '&ref_' + duplicateIndex + ' ' + state.dump\n        }\n      }\n    } else if (type === '[object String]') {\n      if (state.tag !== '?') {\n        writeScalar(state, state.dump, level, iskey, inblock)\n      }\n    } else if (type === '[object Undefined]') {\n      return false\n    } else {\n      if (state.skipInvalid) return false\n      throw new YAMLException('unacceptable kind of an object to dump ' + type)\n    }\n\n    if (state.tag !== null && state.tag !== '?') {\n      // Need to encode all characters except those allowed by the spec:\n      //\n      // [35] ns-dec-digit    ::=  [#x30-#x39] /* 0-9 */\n      // [36] ns-hex-digit    ::=  ns-dec-digit\n      //                         | [#x41-#x46] /* A-F */ | [#x61-#x66] /* a-f */\n      // [37] ns-ascii-letter ::=  [#x41-#x5A] /* A-Z */ | [#x61-#x7A] /* a-z */\n      // [38] ns-word-char    ::=  ns-dec-digit | ns-ascii-letter | â€œ-â€�\n      // [39] ns-uri-char     ::=  â€œ%â€� ns-hex-digit ns-hex-digit | ns-word-char | â€œ#â€�\n      //                         | â€œ;â€� | â€œ/â€� | â€œ?â€� | â€œ:â€� | â€œ@â€� | â€œ&â€� | â€œ=â€� | â€œ+â€� | â€œ$â€� | â€œ,â€�\n      //                         | â€œ_â€� | â€œ.â€� | â€œ!â€� | â€œ~â€� | â€œ*â€� | â€œ'â€� | â€œ(â€� | â€œ)â€� | â€œ[â€� | â€œ]â€�\n      //\n      // Also need to encode '!' because it has special meaning (end of tag prefix).\n      //\n      let tagStr = encodeURI(\n        state.tag[0] === '!' ? state.tag.slice(1) : state.tag\n      ).replace(/!/g, '%21')\n\n      if (state.tag[0] === '!') {\n        tagStr = '!' + tagStr\n      } else if (tagStr.slice(0, 18) === 'tag:yaml.org,2002:') {\n        tagStr = '!!' + tagStr.slice(18)\n      } else {\n        tagStr = '!<' + tagStr + '>'\n      }\n\n      state.dump = tagStr + ' ' + state.dump\n    }\n  }\n\n  return true\n}\n\nfunction getDuplicateReferences (object, state) {\n  const objects = []\n  const duplicatesIndexes = []\n\n  inspectNode(object, objects, duplicatesIndexes)\n\n  const length = duplicatesIndexes.length\n  for (let index = 0; index < length; index += 1) {\n    state.duplicates.push(objects[duplicatesIndexes[index]])\n  }\n  state.usedDuplicates = new Array(length)\n}\n\nfunction inspectNode (object, objects, duplicatesIndexes) {\n  if (object !== null && typeof object === 'object') {\n    const index = objects.indexOf(object)\n    if (index !== -1) {\n      if (duplicatesIndexes.indexOf(index) === -1) {\n        duplicatesIndexes.push(index)\n      }\n    } else {\n      objects.push(object)\n\n      if (Array.isArray(object)) {\n        for (let i = 0, length = object.length; i < length; i += 1) {\n          inspectNode(object[i], objects, duplicatesIndexes)\n        }\n      } else {\n        const objectKeyList = Object.keys(object)\n\n        for (let i = 0, length = objectKeyList.length; i < length; i += 1) {\n          inspectNode(object[objectKeyList[i]], objects, duplicatesIndexes)\n        }\n      }\n    }\n  }\n}\n\nfunction dump (input, options) {\n  options = options || {}\n\n  const state = new State(options)\n\n  if (!state.noRefs) getDuplicateReferences(input, state)\n\n  let value = input\n\n  if (state.replacer) {\n    value = state.replacer.call({ '': value }, '', value)\n  }\n\n  if (writeNode(state, 0, value, true, true)) return state.dump + '\\n'\n\n  return ''\n}\n\nmodule.exports.dump = dump\n","'use strict'\n\nconst loader = require('./lib/loader')\nconst dumper = require('./lib/dumper')\n\nfunction renamed (from, to) {\n  return function () {\n    throw new Error('Function yaml.' + from + ' is removed in js-yaml 4. ' +\n      'Use yaml.' + to + ' instead, which is now safe by default.')\n  }\n}\n\nmodule.exports.Type = require('./lib/type')\nmodule.exports.Schema = require('./lib/schema')\nmodule.exports.FAILSAFE_SCHEMA = require('./lib/schema/failsafe')\nmodule.exports.JSON_SCHEMA = require('./lib/schema/json')\nmodule.exports.CORE_SCHEMA = require('./lib/schema/core')\nmodule.exports.DEFAULT_SCHEMA = require('./lib/schema/default')\nmodule.exports.load = loader.load\nmodule.exports.loadAll = loader.loadAll\nmodule.exports.dump = dumper.dump\nmodule.exports.YAMLException = require('./lib/exception')\n\n// Re-export all types in case user wants to create custom schema\nmodule.exports.types = {\n  binary: require('./lib/type/binary'),\n  float: require('./lib/type/float'),\n  map: require('./lib/type/map'),\n  null: require('./lib/type/null'),\n  pairs: require('./lib/type/pairs'),\n  set: require('./lib/type/set'),\n  timestamp: require('./lib/type/timestamp'),\n  bool: require('./lib/type/bool'),\n  int: require('./lib/type/int'),\n  merge: require('./lib/type/merge'),\n  omap: require('./lib/type/omap'),\n  seq: require('./lib/type/seq'),\n  str: require('./lib/type/str')\n}\n\n// Removed functions from JS-YAML 3.0.x\nmodule.exports.safeLoad = renamed('safeLoad', 'load')\nmodule.exports.safeLoadAll = renamed('safeLoadAll', 'loadAll')\nmodule.exports.safeDump = renamed('safeDump', 'dump')\n","import yaml from '../index.js'\n\nconst {\n  Type,\n  Schema,\n  FAILSAFE_SCHEMA,\n  JSON_SCHEMA,\n  CORE_SCHEMA,\n  DEFAULT_SCHEMA,\n  load,\n  loadAll,\n  dump,\n  YAMLException,\n  types,\n  safeLoad,\n  safeLoadAll,\n  safeDump\n} = yaml\n\nexport {\n  Type,\n  Schema,\n  FAILSAFE_SCHEMA,\n  JSON_SCHEMA,\n  CORE_SCHEMA,\n  DEFAULT_SCHEMA,\n  load,\n  loadAll,\n  dump,\n  YAMLException,\n  types,\n  safeLoad,\n  safeLoadAll,\n  safeDump\n}\n\nexport default yaml\n"],"names":["exception","YAMLException","common","require$$0","line","map","Type","require$$1","schema","type","Schema","require$$2","require$$3","require$$4","require$$5","require$$6","DEFAULT_SCHEMA","loadAll","load","str","string","dump","loader","dumper","require$$7","require$$8","require$$9","require$$10","require$$11","require$$12","require$$13","require$$14","require$$15","require$$16","require$$17","require$$18","require$$19","require$$20","require$$21"],"mappings":";;;;;;;;;;AAEA,WAAS,UAAW,SAAS;AAC3B,WAAQ,OAAO,YAAY,eAAiB,YAAY;AAAA,EAC1D;AAEA,WAAS,SAAU,SAAS;AAC1B,WAAQ,OAAO,YAAY,YAAc,YAAY;AAAA,EACvD;AAEA,WAAS,QAAS,UAAU;AAC1B,QAAI,MAAM,QAAQ,QAAQ,EAAG,QAAO;AAAA,aAC3B,UAAU,QAAQ,EAAG,QAAO,CAAA;AAErC,WAAO,CAAC,QAAQ;AAAA,EAClB;AAEA,WAAS,OAAQ,QAAQ,QAAQ;AAC/B,QAAI,QAAQ;AACV,YAAM,aAAa,OAAO,KAAK,MAAM;AAErC,eAAS,QAAQ,GAAG,SAAS,WAAW,QAAQ,QAAQ,QAAQ,SAAS,GAAG;AAC1E,cAAM,MAAM,WAAW,KAAK;AAC5B,eAAO,GAAG,IAAI,OAAO,GAAG;AAAA,MAC9B;AAAA,IACA;AAEE,WAAO;AAAA,EACT;AAEA,WAAS,OAAQ,QAAQ,OAAO;AAC9B,QAAI,SAAS;AAEb,aAAS,QAAQ,GAAG,QAAQ,OAAO,SAAS,GAAG;AAC7C,gBAAU;AAAA,IACd;AAEE,WAAO;AAAA,EACT;AAEA,WAAS,eAAgB,QAAQ;AAC/B,WAAQ,WAAW,KAAO,OAAO,sBAAsB,IAAI;AAAA,EAC7D;AAEA,SAAA,YAA2B;AAC3B,SAAA,WAA0B;AAC1B,SAAA,UAAyB;AACzB,SAAA,SAAwB;AACxB,SAAA,iBAAgC;AAChC,SAAA,SAAwB;;;;;;;;AC7CxB,WAAS,YAAaA,YAAW,SAAS;AACxC,QAAI,QAAQ;AACZ,UAAM,UAAUA,WAAU,UAAU;AAEpC,QAAI,CAACA,WAAU,KAAM,QAAO;AAE5B,QAAIA,WAAU,KAAK,MAAM;AACvB,eAAS,SAASA,WAAU,KAAK,OAAO;AAAA,IAC5C;AAEE,aAAS,OAAOA,WAAU,KAAK,OAAO,KAAK,OAAOA,WAAU,KAAK,SAAS,KAAK;AAE/E,QAAI,CAAC,WAAWA,WAAU,KAAK,SAAS;AACtC,eAAS,SAASA,WAAU,KAAK;AAAA,IACrC;AAEE,WAAO,UAAU,MAAM;AAAA,EACzB;AAEA,WAASC,eAAe,QAAQ,MAAM;AAEpC,UAAM,KAAK,IAAI;AAEf,SAAK,OAAO;AACZ,SAAK,SAAS;AACd,SAAK,OAAO;AACZ,SAAK,UAAU,YAAY,MAAM,KAAK;AAGtC,QAAI,MAAM,mBAAmB;AAE3B,YAAM,kBAAkB,MAAM,KAAK,WAAW;AAAA,IAClD,OAAS;AAEL,WAAK,QAAS,IAAI,MAAK,EAAI,SAAS;AAAA,IACxC;AAAA,EACA;AAGA,EAAAA,eAAc,YAAY,OAAO,OAAO,MAAM,SAAS;AACvD,EAAAA,eAAc,UAAU,cAAcA;AAEtC,EAAAA,eAAc,UAAU,WAAW,SAAS,SAAU,SAAS;AAC7D,WAAO,KAAK,OAAO,OAAO,YAAY,MAAM,OAAO;AAAA,EACrD;AAEA,cAAiBA;;;;;;;;AChDjB,QAAMC,UAASC,cAAA;AAGf,WAAS,QAAS,QAAQ,WAAW,SAAS,UAAU,eAAe;AACrE,QAAI,OAAO;AACX,QAAI,OAAO;AACX,UAAM,gBAAgB,KAAK,MAAM,gBAAgB,CAAC,IAAI;AAEtD,QAAI,WAAW,YAAY,eAAe;AACxC,aAAO;AACP,kBAAY,WAAW,gBAAgB,KAAK;AAAA,IAChD;AAEE,QAAI,UAAU,WAAW,eAAe;AACtC,aAAO;AACP,gBAAU,WAAW,gBAAgB,KAAK;AAAA,IAC9C;AAEE,WAAO;AAAA,MACL,KAAK,OAAO,OAAO,MAAM,WAAW,OAAO,EAAE,QAAQ,OAAO,GAAG,IAAI;AAAA,MACnE,KAAK,WAAW,YAAY,KAAK;AAAA;AAAA,IACrC;AAAA,EACA;AAEA,WAAS,SAAU,QAAQ,KAAK;AAC9B,WAAOD,QAAO,OAAO,KAAK,MAAM,OAAO,MAAM,IAAI;AAAA,EACnD;AAEA,WAAS,YAAa,MAAM,SAAS;AACnC,cAAU,OAAO,OAAO,WAAW,IAAI;AAEvC,QAAI,CAAC,KAAK,OAAQ,QAAO;AAEzB,QAAI,CAAC,QAAQ,UAAW,SAAQ,YAAY;AAC5C,QAAI,OAAO,QAAQ,WAAW,SAAU,SAAQ,SAAS;AACzD,QAAI,OAAO,QAAQ,gBAAgB,SAAU,SAAQ,cAAc;AACnE,QAAI,OAAO,QAAQ,eAAe,SAAU,SAAQ,aAAa;AAEjE,UAAM,KAAK;AACX,UAAM,aAAa,CAAC,CAAC;AACrB,UAAM,WAAW,CAAA;AACjB,QAAI;AACJ,QAAI,cAAc;AAElB,WAAQ,QAAQ,GAAG,KAAK,KAAK,MAAM,GAAI;AACrC,eAAS,KAAK,MAAM,KAAK;AACzB,iBAAW,KAAK,MAAM,QAAQ,MAAM,CAAC,EAAE,MAAM;AAE7C,UAAI,KAAK,YAAY,MAAM,SAAS,cAAc,GAAG;AACnD,sBAAc,WAAW,SAAS;AAAA,MACxC;AAAA,IACA;AAEE,QAAI,cAAc,EAAG,eAAc,WAAW,SAAS;AAEvD,QAAI,SAAS;AACb,UAAM,eAAe,KAAK,IAAI,KAAK,OAAO,QAAQ,YAAY,SAAS,MAAM,EAAE,SAAQ,EAAG;AAC1F,UAAM,gBAAgB,QAAQ,aAAa,QAAQ,SAAS,eAAe;AAE3E,aAAS,IAAI,GAAG,KAAK,QAAQ,aAAa,KAAK;AAC7C,UAAI,cAAc,IAAI,EAAG;AACzB,YAAME,QAAO;AAAA,QACX,KAAK;AAAA,QACL,WAAW,cAAc,CAAC;AAAA,QAC1B,SAAS,cAAc,CAAC;AAAA,QACxB,KAAK,YAAY,WAAW,WAAW,IAAI,WAAW,cAAc,CAAC;AAAA,QACrE;AAAA,MACN;AACI,eAASF,QAAO,OAAO,KAAK,QAAQ,MAAM,IAAI,UAAU,KAAK,OAAO,IAAI,GAAG,SAAQ,GAAI,YAAY,IACjG,QAAQE,MAAK,MAAM,OAAO;AAAA,IAChC;AAEE,UAAM,OAAO,QAAQ,KAAK,QAAQ,WAAW,WAAW,GAAG,SAAS,WAAW,GAAG,KAAK,UAAU,aAAa;AAC9G,cAAUF,QAAO,OAAO,KAAK,QAAQ,MAAM,IAAI,UAAU,KAAK,OAAO,GAAG,SAAQ,GAAI,YAAY,IAC9F,QAAQ,KAAK,MAAM;AACrB,cAAUA,QAAO,OAAO,KAAK,QAAQ,SAAS,eAAe,IAAI,KAAK,GAAG,IAAI;AAE7E,aAAS,IAAI,GAAG,KAAK,QAAQ,YAAY,KAAK;AAC5C,UAAI,cAAc,KAAK,SAAS,OAAQ;AACxC,YAAME,QAAO;AAAA,QACX,KAAK;AAAA,QACL,WAAW,cAAc,CAAC;AAAA,QAC1B,SAAS,cAAc,CAAC;AAAA,QACxB,KAAK,YAAY,WAAW,WAAW,IAAI,WAAW,cAAc,CAAC;AAAA,QACrE;AAAA,MACN;AACI,gBAAUF,QAAO,OAAO,KAAK,QAAQ,MAAM,IAAI,UAAU,KAAK,OAAO,IAAI,GAAG,SAAQ,GAAI,YAAY,IAClG,QAAQE,MAAK,MAAM;AAAA,IACzB;AAEE,WAAO,OAAO,QAAQ,OAAO,EAAE;AAAA,EACjC;AAEA,YAAiB;;;;;;;;AC7FjB,QAAMH,iBAAgBE,iBAAA;AAEtB,QAAM,2BAA2B;AAAA,IAC/B;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAEA,QAAM,kBAAkB;AAAA,IACtB;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAEA,WAAS,oBAAqBE,MAAK;AACjC,UAAM,SAAS,CAAA;AAEf,QAAIA,SAAQ,MAAM;AAChB,aAAO,KAAKA,IAAG,EAAE,QAAQ,SAAU,OAAO;AACxC,QAAAA,KAAI,KAAK,EAAE,QAAQ,SAAU,OAAO;AAClC,iBAAO,OAAO,KAAK,CAAC,IAAI;AAAA,QAChC,CAAO;AAAA,MACP,CAAK;AAAA,IACL;AAEE,WAAO;AAAA,EACT;AAEA,WAASC,MAAM,KAAK,SAAS;AAC3B,cAAU,WAAW,CAAA;AAErB,WAAO,KAAK,OAAO,EAAE,QAAQ,SAAU,MAAM;AAC3C,UAAI,yBAAyB,QAAQ,IAAI,MAAM,IAAI;AACjD,cAAM,IAAIL,eAAc,qBAAqB,OAAO,gCAAgC,MAAM,cAAc;AAAA,MAC9G;AAAA,IACA,CAAG;AAGD,SAAK,UAAU;AACf,SAAK,MAAM;AACX,SAAK,OAAO,QAAQ,MAAM,KAAK;AAC/B,SAAK,UAAU,QAAQ,SAAS,KAAK,WAAY;AAAE,aAAO;AAAA,IAAI;AAC9D,SAAK,YAAY,QAAQ,WAAW,KAAK,SAAU,MAAM;AAAE,aAAO;AAAA,IAAI;AACtE,SAAK,aAAa,QAAQ,YAAY,KAAK;AAC3C,SAAK,YAAY,QAAQ,WAAW,KAAK;AACzC,SAAK,YAAY,QAAQ,WAAW,KAAK;AACzC,SAAK,gBAAgB,QAAQ,eAAe,KAAK;AACjD,SAAK,eAAe,QAAQ,cAAc,KAAK;AAC/C,SAAK,QAAQ,QAAQ,OAAO,KAAK;AACjC,SAAK,eAAe,oBAAoB,QAAQ,cAAc,KAAK,IAAI;AAEvE,QAAI,gBAAgB,QAAQ,KAAK,IAAI,MAAM,IAAI;AAC7C,YAAM,IAAIA,eAAc,mBAAmB,KAAK,OAAO,yBAAyB,MAAM,cAAc;AAAA,IACxG;AAAA,EACA;AAEA,SAAiBK;;;;;;;;AC/DjB,QAAML,iBAAgBE,iBAAA;AACtB,QAAMG,QAAOC,YAAA;AAEb,WAAS,YAAaC,SAAQ,MAAM;AAClC,UAAM,SAAS,CAAA;AAEf,IAAAA,QAAO,IAAI,EAAE,QAAQ,SAAU,aAAa;AAC1C,UAAI,WAAW,OAAO;AAEtB,aAAO,QAAQ,SAAU,cAAc,eAAe;AACpD,YAAI,aAAa,QAAQ,YAAY,OACjC,aAAa,SAAS,YAAY,QAClC,aAAa,UAAU,YAAY,OAAO;AAC5C,qBAAW;AAAA,QACnB;AAAA,MACA,CAAK;AAED,aAAO,QAAQ,IAAI;AAAA,IACvB,CAAG;AAED,WAAO;AAAA,EACT;AAEA,WAAS,aAA4B;AACnC,UAAM,SAAS;AAAA,MACb,QAAQ,CAAA;AAAA,MACR,UAAU,CAAA;AAAA,MACV,SAAS,CAAA;AAAA,MACT,UAAU,CAAA;AAAA,MACV,OAAO;AAAA,QACL,QAAQ,CAAA;AAAA,QACR,UAAU,CAAA;AAAA,QACV,SAAS,CAAA;AAAA,QACT,UAAU,CAAA;AAAA,MAChB;AAAA,IACA;AACE,aAAS,YAAaC,OAAM;AAC1B,UAAIA,MAAK,OAAO;AACd,eAAO,MAAMA,MAAK,IAAI,EAAE,KAAKA,KAAI;AACjC,eAAO,MAAM,UAAU,EAAE,KAAKA,KAAI;AAAA,MACxC,OAAW;AACL,eAAOA,MAAK,IAAI,EAAEA,MAAK,GAAG,IAAI,OAAO,UAAU,EAAEA,MAAK,GAAG,IAAIA;AAAA,MACnE;AAAA,IACA;AAEE,aAAS,QAAQ,GAAG,SAAS,UAAU,QAAQ,QAAQ,QAAQ,SAAS,GAAG;AACzE,gBAAU,KAAK,EAAE,QAAQ,WAAW;AAAA,IACxC;AACE,WAAO;AAAA,EACT;AAEA,WAASC,QAAQ,YAAY;AAC3B,WAAO,KAAK,OAAO,UAAU;AAAA,EAC/B;AAEA,EAAAA,QAAO,UAAU,SAAS,SAAS,OAAQ,YAAY;AACrD,QAAI,WAAW,CAAA;AACf,QAAI,WAAW,CAAA;AAEf,QAAI,sBAAsBJ,OAAM;AAE9B,eAAS,KAAK,UAAU;AAAA,IAC5B,WAAa,MAAM,QAAQ,UAAU,GAAG;AAEpC,iBAAW,SAAS,OAAO,UAAU;AAAA,IACzC,WAAa,eAAe,MAAM,QAAQ,WAAW,QAAQ,KAAK,MAAM,QAAQ,WAAW,QAAQ,IAAI;AAEnG,UAAI,WAAW,SAAU,YAAW,SAAS,OAAO,WAAW,QAAQ;AACvE,UAAI,WAAW,SAAU,YAAW,SAAS,OAAO,WAAW,QAAQ;AAAA,IAC3E,OAAS;AACL,YAAM,IAAIL,eAAc,kHACyC;AAAA,IACrE;AAEE,aAAS,QAAQ,SAAUQ,OAAM;AAC/B,UAAI,EAAEA,iBAAgBH,QAAO;AAC3B,cAAM,IAAIL,eAAc,oFAAoF;AAAA,MAClH;AAEI,UAAIQ,MAAK,YAAYA,MAAK,aAAa,UAAU;AAC/C,cAAM,IAAIR,eAAc,iHAAiH;AAAA,MAC/I;AAEI,UAAIQ,MAAK,OAAO;AACd,cAAM,IAAIR,eAAc,oGAAoG;AAAA,MAClI;AAAA,IACA,CAAG;AAED,aAAS,QAAQ,SAAUQ,OAAM;AAC/B,UAAI,EAAEA,iBAAgBH,QAAO;AAC3B,cAAM,IAAIL,eAAc,oFAAoF;AAAA,MAClH;AAAA,IACA,CAAG;AAED,UAAM,SAAS,OAAO,OAAOS,QAAO,SAAS;AAE7C,WAAO,YAAY,KAAK,YAAY,CAAA,GAAI,OAAO,QAAQ;AACvD,WAAO,YAAY,KAAK,YAAY,CAAA,GAAI,OAAO,QAAQ;AAEvD,WAAO,mBAAmB,YAAY,QAAQ,UAAU;AACxD,WAAO,mBAAmB,YAAY,QAAQ,UAAU;AACxD,WAAO,kBAAkB,WAAW,OAAO,kBAAkB,OAAO,gBAAgB;AAEpF,WAAO;AAAA,EACT;AAEA,WAAiBA;;;;;;;;AC1GjB,QAAMJ,QAAOH,YAAA;AAEb,QAAiB,IAAIG,MAAK,yBAAyB;AAAA,IACjD,MAAM;AAAA,IACN,WAAW,SAAU,MAAM;AAAE,aAAO,SAAS,OAAO,OAAO;AAAA,IAAE;AAAA,GAC9D;;;;;;;;ACLD,QAAMA,QAAOH,YAAA;AAEb,QAAiB,IAAIG,MAAK,yBAAyB;AAAA,IACjD,MAAM;AAAA,IACN,WAAW,SAAU,MAAM;AAAE,aAAO,SAAS,OAAO,OAAO;IAAE;AAAA,GAC9D;;;;;;;;ACLD,QAAMA,QAAOH,YAAA;AAEb,QAAiB,IAAIG,MAAK,yBAAyB;AAAA,IACjD,MAAM;AAAA,IACN,WAAW,SAAU,MAAM;AAAE,aAAO,SAAS,OAAO,OAAO;IAAE;AAAA,GAC9D;;;;;;;;ACFD,QAAMI,UAASP,cAAA;AAEf,aAAiB,IAAIO,QAAO;AAAA,IAC1B,UAAU;AAAA,MACRH,WAAA;AAAA,MACAI,WAAA;AAAA,MACAC,WAAA;AAAA,IACJ;AAAA,GACC;;;;;;;;ACXD,QAAMN,QAAOH,YAAA;AAEb,WAAS,gBAAiB,MAAM;AAC9B,QAAI,SAAS,KAAM,QAAO;AAE1B,UAAM,MAAM,KAAK;AAEjB,WAAQ,QAAQ,KAAK,SAAS,OACtB,QAAQ,MAAM,SAAS,UAAU,SAAS,UAAU,SAAS;AAAA,EACvE;AAEA,WAAS,oBAAqB;AAC5B,WAAO;AAAA,EACT;AAEA,WAAS,OAAQ,QAAQ;AACvB,WAAO,WAAW;AAAA,EACpB;AAEA,UAAiB,IAAIG,MAAK,0BAA0B;AAAA,IAClD,MAAM;AAAA,IACN,SAAS;AAAA,IACT,WAAW;AAAA,IACX,WAAW;AAAA,IACX,WAAW;AAAA,MACT,WAAW,WAAY;AAAE,eAAO;AAAA,MAAG;AAAA,MACnC,WAAW,WAAY;AAAE,eAAO;AAAA,MAAM;AAAA,MACtC,WAAW,WAAY;AAAE,eAAO;AAAA,MAAM;AAAA,MACtC,WAAW,WAAY;AAAE,eAAO;AAAA,MAAM;AAAA,MACtC,OAAO,WAAY;AAAE,eAAO;AAAA,MAAE;AAAA;IAEhC,cAAc;AAAA,GACf;;;;;;;;AChCD,QAAMA,QAAOH,YAAA;AAEb,WAAS,mBAAoB,MAAM;AACjC,QAAI,SAAS,KAAM,QAAO;AAE1B,UAAM,MAAM,KAAK;AAEjB,WAAQ,QAAQ,MAAM,SAAS,UAAU,SAAS,UAAU,SAAS,WAC7D,QAAQ,MAAM,SAAS,WAAW,SAAS,WAAW,SAAS;AAAA,EACzE;AAEA,WAAS,qBAAsB,MAAM;AACnC,WAAO,SAAS,UACT,SAAS,UACT,SAAS;AAAA,EAClB;AAEA,WAAS,UAAW,QAAQ;AAC1B,WAAO,OAAO,UAAU,SAAS,KAAK,MAAM,MAAM;AAAA,EACpD;AAEA,SAAiB,IAAIG,MAAK,0BAA0B;AAAA,IAClD,MAAM;AAAA,IACN,SAAS;AAAA,IACT,WAAW;AAAA,IACX,WAAW;AAAA,IACX,WAAW;AAAA,MACT,WAAW,SAAU,QAAQ;AAAE,eAAO,SAAS,SAAS;AAAA,MAAO;AAAA,MAC/D,WAAW,SAAU,QAAQ;AAAE,eAAO,SAAS,SAAS;AAAA,MAAO;AAAA,MAC/D,WAAW,SAAU,QAAQ;AAAE,eAAO,SAAS,SAAS;AAAA,MAAO;AAAA;IAEjE,cAAc;AAAA,GACf;;;;;;;;AChCD,QAAMJ,UAASC,cAAA;AACf,QAAMG,QAAOC,YAAA;AAEb,WAAS,UAAW,GAAG;AACrB,WAAS,KAAK,MAAiB,KAAK,MAC3B,KAAK,MAAiB,KAAK,MAC3B,KAAK,MAAiB,KAAK;AAAA,EACtC;AAEA,WAAS,UAAW,GAAG;AACrB,WAAS,KAAK,MAAiB,KAAK;AAAA,EACtC;AAEA,WAAS,UAAW,GAAG;AACrB,WAAS,KAAK,MAAiB,KAAK;AAAA,EACtC;AAEA,WAAS,mBAAoB,MAAM;AACjC,QAAI,SAAS,KAAM,QAAO;AAE1B,UAAM,MAAM,KAAK;AACjB,QAAI,QAAQ;AACZ,QAAI,YAAY;AAEhB,QAAI,CAAC,IAAK,QAAO;AAEjB,QAAI,KAAK,KAAK,KAAK;AAGnB,QAAI,OAAO,OAAO,OAAO,KAAK;AAC5B,WAAK,KAAK,EAAE,KAAK;AAAA,IACrB;AAEE,QAAI,OAAO,KAAK;AAEd,UAAI,QAAQ,MAAM,IAAK,QAAO;AAC9B,WAAK,KAAK,EAAE,KAAK;AAIjB,UAAI,OAAO,KAAK;AAEd;AAEA,eAAO,QAAQ,KAAK,SAAS;AAC3B,eAAK,KAAK,KAAK;AACf,cAAI,OAAO,OAAO,OAAO,IAAK,QAAO;AACrC,sBAAY;AAAA,QACpB;AACM,eAAO,aAAa,SAAS,iBAAiB,IAAI,CAAC;AAAA,MACzD;AAEI,UAAI,OAAO,KAAK;AAEd;AAEA,eAAO,QAAQ,KAAK,SAAS;AAC3B,cAAI,CAAC,UAAU,KAAK,WAAW,KAAK,CAAC,EAAG,QAAO;AAC/C,sBAAY;AAAA,QACpB;AACM,eAAO,aAAa,SAAS,iBAAiB,IAAI,CAAC;AAAA,MACzD;AAEI,UAAI,OAAO,KAAK;AAEd;AAEA,eAAO,QAAQ,KAAK,SAAS;AAC3B,cAAI,CAAC,UAAU,KAAK,WAAW,KAAK,CAAC,EAAG,QAAO;AAC/C,sBAAY;AAAA,QACpB;AACM,eAAO,aAAa,SAAS,iBAAiB,IAAI,CAAC;AAAA,MACzD;AAAA,IACA;AAIE,WAAO,QAAQ,KAAK,SAAS;AAC3B,UAAI,CAAC,UAAU,KAAK,WAAW,KAAK,CAAC,GAAG;AACtC,eAAO;AAAA,MACb;AACI,kBAAY;AAAA,IAChB;AAEE,QAAI,CAAC,UAAW,QAAO;AAEvB,WAAO,SAAS,iBAAiB,IAAI,CAAC;AAAA,EACxC;AAEA,WAAS,iBAAkB,MAAM;AAC/B,QAAI,QAAQ;AACZ,QAAI,OAAO;AAEX,QAAI,KAAK,MAAM,CAAC;AAEhB,QAAI,OAAO,OAAO,OAAO,KAAK;AAC5B,UAAI,OAAO,IAAK,QAAO;AACvB,cAAQ,MAAM,MAAM,CAAC;AACrB,WAAK,MAAM,CAAC;AAAA,IAChB;AAEE,QAAI,UAAU,IAAK,QAAO;AAE1B,QAAI,OAAO,KAAK;AACd,UAAI,MAAM,CAAC,MAAM,IAAK,QAAO,OAAO,SAAS,MAAM,MAAM,CAAC,GAAG,CAAC;AAC9D,UAAI,MAAM,CAAC,MAAM,IAAK,QAAO,OAAO,SAAS,MAAM,MAAM,CAAC,GAAG,EAAE;AAC/D,UAAI,MAAM,CAAC,MAAM,IAAK,QAAO,OAAO,SAAS,MAAM,MAAM,CAAC,GAAG,CAAC;AAAA,IAClE;AAEE,WAAO,OAAO,SAAS,OAAO,EAAE;AAAA,EAClC;AAEA,WAAS,qBAAsB,MAAM;AACnC,WAAO,iBAAiB,IAAI;AAAA,EAC9B;AAEA,WAAS,UAAW,QAAQ;AAC1B,WAAQ,OAAO,UAAU,SAAS,KAAK,MAAM,MAAO,sBAC5C,SAAS,MAAM,KAAK,CAACL,QAAO,eAAe,MAAM;AAAA,EAC3D;AAEA,QAAiB,IAAII,MAAK,yBAAyB;AAAA,IACjD,MAAM;AAAA,IACN,SAAS;AAAA,IACT,WAAW;AAAA,IACX,WAAW;AAAA,IACX,WAAW;AAAA,MACT,QAAQ,SAAU,KAAK;AAAE,eAAO,OAAO,IAAI,OAAO,IAAI,SAAS,CAAC,IAAI,QAAQ,IAAI,SAAS,CAAC,EAAE,MAAM,CAAC;AAAA,MAAC;AAAA,MACpG,OAAO,SAAU,KAAK;AAAE,eAAO,OAAO,IAAI,OAAO,IAAI,SAAS,CAAC,IAAI,QAAQ,IAAI,SAAS,CAAC,EAAE,MAAM,CAAC;AAAA,MAAC;AAAA,MACnG,SAAS,SAAU,KAAK;AAAE,eAAO,IAAI,SAAS,EAAE;AAAA,MAAC;AAAA,MACjD,aAAa,SAAU,KAAK;AAAE,eAAO,OAAO,IAAI,OAAO,IAAI,SAAS,EAAE,EAAE,gBAAgB,QAAQ,IAAI,SAAS,EAAE,EAAE,YAAW,EAAG,MAAM,CAAC;AAAA,MAAC;AAAA;IAEzI,cAAc;AAAA,IACd,cAAc;AAAA,MACZ,QAAQ,CAAC,GAAG,KAAK;AAAA,MACjB,OAAO,CAAC,GAAG,KAAK;AAAA,MAChB,SAAS,CAAC,IAAI,KAAK;AAAA,MACnB,aAAa,CAAC,IAAI,KAAK;AAAA,IAC3B;AAAA,GACC;;;;;;;;AC3ID,QAAMJ,UAASC,cAAA;AACf,QAAMG,QAAOC,YAAA;AAEb,QAAM,qBAAqB,IAAI;AAAA;AAAA,IAE7B;AAAA,EAOuB;AAEzB,QAAM,6BAA6B,IAAI;AAAA,IACrC;AAAA,EAIuB;AAEzB,WAAS,iBAAkB,MAAM;AAC/B,QAAI,SAAS,KAAM,QAAO;AAE1B,QAAI,CAAC,mBAAmB,KAAK,IAAI,GAAG;AAClC,aAAO;AAAA,IACX;AAEE,QAAI,SAAS,WAAW,MAAM,EAAE,CAAC,GAAG;AAClC,aAAO;AAAA,IACX;AAEE,WAAO,2BAA2B,KAAK,IAAI;AAAA,EAC7C;AAEA,WAAS,mBAAoB,MAAM;AACjC,QAAI,QAAQ,KAAK,YAAW;AAC5B,UAAM,OAAO,MAAM,CAAC,MAAM,MAAM,KAAK;AAErC,QAAI,KAAK,QAAQ,MAAM,CAAC,CAAC,KAAK,GAAG;AAC/B,cAAQ,MAAM,MAAM,CAAC;AAAA,IACzB;AAEE,QAAI,UAAU,QAAQ;AACpB,aAAQ,SAAS,IAAK,OAAO,oBAAoB,OAAO;AAAA,IAC5D,WAAa,UAAU,QAAQ;AAC3B,aAAO;AAAA,IACX;AACE,WAAO,OAAO,WAAW,OAAO,EAAE;AAAA,EACpC;AAEA,QAAM,yBAAyB;AAE/B,WAAS,mBAAoB,QAAQ,OAAO;AAC1C,QAAI,MAAM,MAAM,GAAG;AACjB,cAAQ,OAAK;AAAA,QACX,KAAK;AAAa,iBAAO;AAAA,QACzB,KAAK;AAAa,iBAAO;AAAA,QACzB,KAAK;AAAa,iBAAO;AAAA,MAC/B;AAAA,IACA,WAAa,OAAO,sBAAsB,QAAQ;AAC9C,cAAQ,OAAK;AAAA,QACX,KAAK;AAAa,iBAAO;AAAA,QACzB,KAAK;AAAa,iBAAO;AAAA,QACzB,KAAK;AAAa,iBAAO;AAAA,MAC/B;AAAA,IACA,WAAa,OAAO,sBAAsB,QAAQ;AAC9C,cAAQ,OAAK;AAAA,QACX,KAAK;AAAa,iBAAO;AAAA,QACzB,KAAK;AAAa,iBAAO;AAAA,QACzB,KAAK;AAAa,iBAAO;AAAA,MAC/B;AAAA,IACA,WAAaL,QAAO,eAAe,MAAM,GAAG;AACxC,aAAO;AAAA,IACX;AAEE,UAAM,MAAM,OAAO,SAAS,EAAE;AAK9B,WAAO,uBAAuB,KAAK,GAAG,IAAI,IAAI,QAAQ,KAAK,IAAI,IAAI;AAAA,EACrE;AAEA,WAAS,QAAS,QAAQ;AACxB,WAAQ,OAAO,UAAU,SAAS,KAAK,MAAM,MAAM,sBAC3C,SAAS,MAAM,KAAKA,QAAO,eAAe,MAAM;AAAA,EAC1D;AAEA,UAAiB,IAAII,MAAK,2BAA2B;AAAA,IACnD,MAAM;AAAA,IACN,SAAS;AAAA,IACT,WAAW;AAAA,IACX,WAAW;AAAA,IACX,WAAW;AAAA,IACX,cAAc;AAAA,GACf;;;;;;;;ACzFD,SAAiBH,gBAAA,EAAsB,OAAO;AAAA,IAC5C,UAAU;AAAA,MACRI,aAAA;AAAA,MACAI,YAAA;AAAA,MACAC,WAAA;AAAA,MACAC,aAAA;AAAA,IACJ;AAAA,GACC;;;;;;;;ACRD,SAAiBV,YAAA;;;;;;;;ACNjB,QAAMG,QAAOH,YAAA;AAEb,QAAM,mBAAmB,IAAI;AAAA,IAC3B;AAAA,EAEgB;AAElB,QAAM,wBAAwB,IAAI;AAAA,IAChC;AAAA,EASwB;AAE1B,WAAS,qBAAsB,MAAM;AACnC,QAAI,SAAS,KAAM,QAAO;AAC1B,QAAI,iBAAiB,KAAK,IAAI,MAAM,KAAM,QAAO;AACjD,QAAI,sBAAsB,KAAK,IAAI,MAAM,KAAM,QAAO;AACtD,WAAO;AAAA,EACT;AAEA,WAAS,uBAAwB,MAAM;AACrC,QAAI,WAAW;AACf,QAAI,QAAQ;AAEZ,QAAI,QAAQ,iBAAiB,KAAK,IAAI;AACtC,QAAI,UAAU,KAAM,SAAQ,sBAAsB,KAAK,IAAI;AAE3D,QAAI,UAAU,KAAM,OAAM,IAAI,MAAM,oBAAoB;AAIxD,UAAM,OAAO,CAAE,MAAM,CAAC;AACtB,UAAM,QAAQ,CAAE,MAAM,CAAC,IAAK;AAC5B,UAAM,MAAM,CAAE,MAAM,CAAC;AAErB,QAAI,CAAC,MAAM,CAAC,GAAG;AACb,aAAO,IAAI,KAAK,KAAK,IAAI,MAAM,OAAO,GAAG,CAAC;AAAA,IAC9C;AAIE,UAAM,OAAO,CAAE,MAAM,CAAC;AACtB,UAAM,SAAS,CAAE,MAAM,CAAC;AACxB,UAAM,SAAS,CAAE,MAAM,CAAC;AAExB,QAAI,MAAM,CAAC,GAAG;AACZ,iBAAW,MAAM,CAAC,EAAE,MAAM,GAAG,CAAC;AAC9B,aAAO,SAAS,SAAS,GAAG;AAC1B,oBAAY;AAAA,MAClB;AACI,iBAAW,CAAC;AAAA,IAChB;AAIE,QAAI,MAAM,CAAC,GAAG;AACZ,YAAM,SAAS,CAAE,MAAM,EAAE;AACzB,YAAM,WAAW,EAAE,MAAM,EAAE,KAAK;AAChC,eAAS,SAAS,KAAK,YAAY;AACnC,UAAI,MAAM,CAAC,MAAM,IAAK,SAAQ,CAAC;AAAA,IACnC;AAEE,UAAM,OAAO,IAAI,KAAK,KAAK,IAAI,MAAM,OAAO,KAAK,MAAM,QAAQ,QAAQ,QAAQ,CAAC;AAEhF,QAAI,MAAO,MAAK,QAAQ,KAAK,QAAO,IAAK,KAAK;AAE9C,WAAO;AAAA,EACT;AAEA,WAAS,uBAAwB,QAAqB;AACpD,WAAO,OAAO,YAAW;AAAA,EAC3B;AAEA,cAAiB,IAAIG,MAAK,+BAA+B;AAAA,IACvD,MAAM;AAAA,IACN,SAAS;AAAA,IACT,WAAW;AAAA,IACX,YAAY;AAAA,IACZ,WAAW;AAAA,GACZ;;;;;;;;ACrFD,QAAMA,QAAOH,YAAA;AAEb,WAAS,iBAAkB,MAAM;AAC/B,WAAO,SAAS,QAAQ,SAAS;AAAA,EACnC;AAEA,UAAiB,IAAIG,MAAK,2BAA2B;AAAA,IACnD,MAAM;AAAA,IACN,SAAS;AAAA,GACV;;;;;;;;ACTD,QAAMA,QAAOH,YAAA;AAGb,QAAM,aAAa;AAEnB,WAAS,kBAAmB,MAAM;AAChC,QAAI,SAAS,KAAM,QAAO;AAE1B,QAAI,SAAS;AACb,UAAM,MAAM,KAAK;AACjB,UAAME,OAAM;AAGZ,aAAS,MAAM,GAAG,MAAM,KAAK,OAAO;AAClC,YAAM,OAAOA,KAAI,QAAQ,KAAK,OAAO,GAAG,CAAC;AAGzC,UAAI,OAAO,GAAI;AAGf,UAAI,OAAO,EAAG,QAAO;AAErB,gBAAU;AAAA,IACd;AAGE,WAAQ,SAAS,MAAO;AAAA,EAC1B;AAEA,WAAS,oBAAqB,MAAM;AAClC,UAAM,QAAQ,KAAK,QAAQ,YAAY,EAAE;AACzC,UAAM,MAAM,MAAM;AAClB,UAAMA,OAAM;AACZ,QAAI,OAAO;AACX,UAAM,SAAS,CAAA;AAIf,aAAS,MAAM,GAAG,MAAM,KAAK,OAAO;AAClC,UAAK,MAAM,MAAM,KAAM,KAAK;AAC1B,eAAO,KAAM,QAAQ,KAAM,GAAI;AAC/B,eAAO,KAAM,QAAQ,IAAK,GAAI;AAC9B,eAAO,KAAK,OAAO,GAAI;AAAA,MAC7B;AAEI,aAAQ,QAAQ,IAAKA,KAAI,QAAQ,MAAM,OAAO,GAAG,CAAC;AAAA,IACtD;AAIE,UAAM,WAAY,MAAM,IAAK;AAE7B,QAAI,aAAa,GAAG;AAClB,aAAO,KAAM,QAAQ,KAAM,GAAI;AAC/B,aAAO,KAAM,QAAQ,IAAK,GAAI;AAC9B,aAAO,KAAK,OAAO,GAAI;AAAA,IAC3B,WAAa,aAAa,IAAI;AAC1B,aAAO,KAAM,QAAQ,KAAM,GAAI;AAC/B,aAAO,KAAM,QAAQ,IAAK,GAAI;AAAA,IAClC,WAAa,aAAa,IAAI;AAC1B,aAAO,KAAM,QAAQ,IAAK,GAAI;AAAA,IAClC;AAEE,WAAO,IAAI,WAAW,MAAM;AAAA,EAC9B;AAEA,WAAS,oBAAqB,QAAqB;AACjD,QAAI,SAAS;AACb,QAAI,OAAO;AACX,UAAM,MAAM,OAAO;AACnB,UAAMA,OAAM;AAIZ,aAAS,MAAM,GAAG,MAAM,KAAK,OAAO;AAClC,UAAK,MAAM,MAAM,KAAM,KAAK;AAC1B,kBAAUA,KAAK,QAAQ,KAAM,EAAI;AACjC,kBAAUA,KAAK,QAAQ,KAAM,EAAI;AACjC,kBAAUA,KAAK,QAAQ,IAAK,EAAI;AAChC,kBAAUA,KAAI,OAAO,EAAI;AAAA,MAC/B;AAEI,cAAQ,QAAQ,KAAK,OAAO,GAAG;AAAA,IACnC;AAIE,UAAM,OAAO,MAAM;AAEnB,QAAI,SAAS,GAAG;AACd,gBAAUA,KAAK,QAAQ,KAAM,EAAI;AACjC,gBAAUA,KAAK,QAAQ,KAAM,EAAI;AACjC,gBAAUA,KAAK,QAAQ,IAAK,EAAI;AAChC,gBAAUA,KAAI,OAAO,EAAI;AAAA,IAC7B,WAAa,SAAS,GAAG;AACrB,gBAAUA,KAAK,QAAQ,KAAM,EAAI;AACjC,gBAAUA,KAAK,QAAQ,IAAK,EAAI;AAChC,gBAAUA,KAAK,QAAQ,IAAK,EAAI;AAChC,gBAAUA,KAAI,EAAE;AAAA,IACpB,WAAa,SAAS,GAAG;AACrB,gBAAUA,KAAK,QAAQ,IAAK,EAAI;AAChC,gBAAUA,KAAK,QAAQ,IAAK,EAAI;AAChC,gBAAUA,KAAI,EAAE;AAChB,gBAAUA,KAAI,EAAE;AAAA,IACpB;AAEE,WAAO;AAAA,EACT;AAEA,WAAS,SAAU,KAAK;AACtB,WAAO,OAAO,UAAU,SAAS,KAAK,GAAG,MAAM;AAAA,EACjD;AAEA,WAAiB,IAAIC,MAAK,4BAA4B;AAAA,IACpD,MAAM;AAAA,IACN,SAAS;AAAA,IACT,WAAW;AAAA,IACX,WAAW;AAAA,IACX,WAAW;AAAA,GACZ;;;;;;;;ACvHD,QAAMA,QAAOH,YAAA;AAEb,QAAM,kBAAkB,OAAO,UAAU;AACzC,QAAM,YAAY,OAAO,UAAU;AAEnC,WAAS,gBAAiB,MAAM;AAC9B,QAAI,SAAS,KAAM,QAAO;AAE1B,UAAM,aAAa,CAAA;AACnB,UAAM,SAAS;AAEf,aAAS,QAAQ,GAAG,SAAS,OAAO,QAAQ,QAAQ,QAAQ,SAAS,GAAG;AACtE,YAAM,OAAO,OAAO,KAAK;AACzB,UAAI,aAAa;AAEjB,UAAI,UAAU,KAAK,IAAI,MAAM,kBAAmB,QAAO;AAEvD,UAAI;AACJ,WAAK,WAAW,MAAM;AACpB,YAAI,gBAAgB,KAAK,MAAM,OAAO,GAAG;AACvC,cAAI,CAAC,WAAY,cAAa;AAAA,cACzB,QAAO;AAAA,QACpB;AAAA,MACA;AAEI,UAAI,CAAC,WAAY,QAAO;AAExB,UAAI,WAAW,QAAQ,OAAO,MAAM,GAAI,YAAW,KAAK,OAAO;AAAA,UAC1D,QAAO;AAAA,IAChB;AAEE,WAAO;AAAA,EACT;AAEA,WAAS,kBAAmB,MAAM;AAChC,WAAO,SAAS,OAAO,OAAO,CAAA;AAAA,EAChC;AAEA,SAAiB,IAAIG,MAAK,0BAA0B;AAAA,IAClD,MAAM;AAAA,IACN,SAAS;AAAA,IACT,WAAW;AAAA,GACZ;;;;;;;;AC1CD,QAAMA,QAAOH,YAAA;AAEb,QAAM,YAAY,OAAO,UAAU;AAEnC,WAAS,iBAAkB,MAAM;AAC/B,QAAI,SAAS,KAAM,QAAO;AAE1B,UAAM,SAAS;AAEf,UAAM,SAAS,IAAI,MAAM,OAAO,MAAM;AAEtC,aAAS,QAAQ,GAAG,SAAS,OAAO,QAAQ,QAAQ,QAAQ,SAAS,GAAG;AACtE,YAAM,OAAO,OAAO,KAAK;AAEzB,UAAI,UAAU,KAAK,IAAI,MAAM,kBAAmB,QAAO;AAEvD,YAAM,OAAO,OAAO,KAAK,IAAI;AAE7B,UAAI,KAAK,WAAW,EAAG,QAAO;AAE9B,aAAO,KAAK,IAAI,CAAC,KAAK,CAAC,GAAG,KAAK,KAAK,CAAC,CAAC,CAAC;AAAA,IAC3C;AAEE,WAAO;AAAA,EACT;AAEA,WAAS,mBAAoB,MAAM;AACjC,QAAI,SAAS,KAAM,QAAO,CAAA;AAE1B,UAAM,SAAS;AACf,UAAM,SAAS,IAAI,MAAM,OAAO,MAAM;AAEtC,aAAS,QAAQ,GAAG,SAAS,OAAO,QAAQ,QAAQ,QAAQ,SAAS,GAAG;AACtE,YAAM,OAAO,OAAO,KAAK;AAEzB,YAAM,OAAO,OAAO,KAAK,IAAI;AAE7B,aAAO,KAAK,IAAI,CAAC,KAAK,CAAC,GAAG,KAAK,KAAK,CAAC,CAAC,CAAC;AAAA,IAC3C;AAEE,WAAO;AAAA,EACT;AAEA,UAAiB,IAAIG,MAAK,2BAA2B;AAAA,IACnD,MAAM;AAAA,IACN,SAAS;AAAA,IACT,WAAW;AAAA,GACZ;;;;;;;;AC/CD,QAAMA,QAAOH,YAAA;AAEb,QAAM,kBAAkB,OAAO,UAAU;AAEzC,WAAS,eAAgB,MAAM;AAC7B,QAAI,SAAS,KAAM,QAAO;AAE1B,UAAM,SAAS;AAEf,eAAW,OAAO,QAAQ;AACxB,UAAI,gBAAgB,KAAK,QAAQ,GAAG,GAAG;AACrC,YAAI,OAAO,GAAG,MAAM,KAAM,QAAO;AAAA,MACvC;AAAA,IACA;AAEE,WAAO;AAAA,EACT;AAEA,WAAS,iBAAkB,MAAM;AAC/B,WAAO,SAAS,OAAO,OAAO,CAAA;AAAA,EAChC;AAEA,QAAiB,IAAIG,MAAK,yBAAyB;AAAA,IACjD,MAAM;AAAA,IACN,SAAS;AAAA,IACT,WAAW;AAAA,GACZ;;;;;;;;ACpBD,aAAiBH,YAAA,EAAkB,OAAO;AAAA,IACxC,UAAU;AAAA,MACRI,iBAAA;AAAA,MACAI,aAAA;AAAA;IAEF,UAAU;AAAA,MACRC,cAAA;AAAA,MACAC,YAAA;AAAA,MACAC,aAAA;AAAA,MACAC,WAAA;AAAA,IACJ;AAAA,GACC;;;;;;;ACjBD,QAAMb,UAASC,cAAA;AACf,QAAMF,iBAAgBM,iBAAA;AACtB,QAAM,cAAcI,eAAA;AACpB,QAAMK,kBAAiBJ,gBAAA;AAEvB,QAAM,kBAAkB,OAAO,UAAU;AAEzC,QAAM,kBAAkB;AACxB,QAAM,mBAAmB;AACzB,QAAM,mBAAmB;AACzB,QAAM,oBAAoB;AAE1B,QAAM,gBAAgB;AACtB,QAAM,iBAAiB;AACvB,QAAM,gBAAgB;AAGtB,QAAM,wBAAwB;AAC9B,QAAM,gCAAgC;AAEtC,QAAM,0BAA0B;AAEhC,QAAM,qBAAqB;AAE3B,QAAM,kBAAkB;AAExB,WAAS,OAAQ,KAAK;AAAE,WAAO,OAAO,UAAU,SAAS,KAAK,GAAG;AAAA,EAAC;AAElE,WAAS,MAAO,GAAG;AACjB,WAAQ,MAAM,MAAkB,MAAM;AAAA,EACxC;AAEA,WAAS,aAAc,GAAG;AACxB,WAAQ,MAAM,KAAmB,MAAM;AAAA,EACzC;AAEA,WAAS,UAAW,GAAG;AACrB,WAAQ,MAAM,KACN,MAAM,MACN,MAAM,MACN,MAAM;AAAA,EAChB;AAEA,WAAS,gBAAiB,GAAG;AAC3B,WAAO,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,OACN,MAAM;AAAA,EACf;AAEA,WAAS,YAAa,GAAG;AACvB,QAAK,KAAK,MAAiB,KAAK,IAAc;AAC5C,aAAO,IAAI;AAAA,IACf;AAEE,UAAM,KAAK,IAAI;AAEf,QAAK,MAAM,MAAiB,MAAM,KAAc;AAC9C,aAAO,KAAK,KAAO;AAAA,IACvB;AAEE,WAAO;AAAA,EACT;AAEA,WAAS,cAAe,GAAG;AACzB,QAAI,MAAM,KAAa;AAAE,aAAO;AAAA,IAAC;AACjC,QAAI,MAAM,KAAa;AAAE,aAAO;AAAA,IAAC;AACjC,QAAI,MAAM,IAAa;AAAE,aAAO;AAAA,IAAC;AACjC,WAAO;AAAA,EACT;AAEA,WAAS,gBAAiB,GAAG;AAC3B,QAAK,KAAK,MAAiB,KAAK,IAAc;AAC5C,aAAO,IAAI;AAAA,IACf;AAEE,WAAO;AAAA,EACT;AAEA,WAAS,qBAAsB,GAAG;AAChC,YAAQ,GAAC;AAAA,MACP,KAAK;AAAa,eAAO;AAAA,MACzB,KAAK;AAAa,eAAO;AAAA,MACzB,KAAK;AAAa,eAAO;AAAA,MACzB,KAAK;AAAa,eAAO;AAAA,MACzB,KAAK;AAAe,eAAO;AAAA,MAC3B,KAAK;AAAa,eAAO;AAAA,MACzB,KAAK;AAAa,eAAO;AAAA,MACzB,KAAK;AAAa,eAAO;AAAA,MACzB,KAAK;AAAa,eAAO;AAAA,MACzB,KAAK;AAAa,eAAO;AAAA,MACzB,KAAK;AAAiB,eAAO;AAAA,MAC7B,KAAK;AAAa,eAAO;AAAA,MACzB,KAAK;AAAa,eAAO;AAAA,MACzB,KAAK;AAAa,eAAO;AAAA,MACzB,KAAK;AAAa,eAAO;AAAA,MACzB,KAAK;AAAa,eAAO;AAAA,MACzB,KAAK;AAAa,eAAO;AAAA,MACzB,KAAK;AAAa,eAAO;AAAA,MACzB;AAAS,eAAO;AAAA,IACpB;AAAA,EACA;AAEA,WAAS,kBAAmB,GAAG;AAC7B,QAAI,KAAK,OAAQ;AACf,aAAO,OAAO,aAAa,CAAC;AAAA,IAChC;AAGE,WAAO,OAAO;AAAA,OACV,IAAI,SAAa,MAAM;AAAA,OACvB,IAAI,QAAY,QAAU;AAAA,IAChC;AAAA,EACA;AAIA,WAAS,YAAa,QAAQ,KAAK,OAAO;AAExC,QAAI,QAAQ,aAAa;AACvB,aAAO,eAAe,QAAQ,KAAK;AAAA,QACjC,cAAc;AAAA,QACd,YAAY;AAAA,QACZ,UAAU;AAAA,QACV;AAAA,OACD;AAAA,IACL,OAAS;AACL,aAAO,GAAG,IAAI;AAAA,IAClB;AAAA,EACA;AAEA,QAAM,oBAAoB,IAAI,MAAM,GAAG;AACvC,QAAM,kBAAkB,IAAI,MAAM,GAAG;AACrC,WAAS,IAAI,GAAG,IAAI,KAAK,KAAK;AAC5B,sBAAkB,CAAC,IAAI,qBAAqB,CAAC,IAAI,IAAI;AACrD,oBAAgB,CAAC,IAAI,qBAAqB,CAAC;AAAA,EAC7C;AAEA,WAAS,MAAO,OAAO,SAAS;AAC9B,SAAK,QAAQ;AAEb,SAAK,WAAW,QAAQ,UAAU,KAAK;AACvC,SAAK,SAAS,QAAQ,QAAQ,KAAKI;AACnC,SAAK,YAAY,QAAQ,WAAW,KAAK;AAGzC,SAAK,SAAS,QAAQ,QAAQ,KAAK;AAEnC,SAAK,OAAO,QAAQ,MAAM,KAAK;AAC/B,SAAK,WAAW,QAAQ,UAAU,KAAK;AACvC,SAAK,WAAW,OAAO,QAAQ,UAAU,MAAM,WAAW,QAAQ,UAAU,IAAI;AAChF,SAAK,oBAAoB,OAAO,QAAQ,mBAAmB,MAAM,WAAW,QAAQ,mBAAmB,IAAI;AAE3G,SAAK,gBAAgB,KAAK,OAAO;AACjC,SAAK,UAAU,KAAK,OAAO;AAE3B,SAAK,SAAS,MAAM;AACpB,SAAK,WAAW;AAChB,SAAK,OAAO;AACZ,SAAK,YAAY;AACjB,SAAK,aAAa;AAClB,SAAK,QAAQ;AACb,SAAK,iBAAiB;AAItB,SAAK,iBAAiB;AAEtB,SAAK,YAAY,CAAA;AACjB,SAAK,wBAAwB,CAAA;AAAA,EAW/B;AAEA,WAAS,cAAe,OAAO,SAAS;AACtC,UAAM,OAAO;AAAA,MACX,MAAM,MAAM;AAAA,MACZ,QAAQ,MAAM,MAAM,MAAM,GAAG,EAAE;AAAA;AAAA,MAC/B,UAAU,MAAM;AAAA,MAChB,MAAM,MAAM;AAAA,MACZ,QAAQ,MAAM,WAAW,MAAM;AAAA,IACnC;AAEE,SAAK,UAAU,YAAY,IAAI;AAE/B,WAAO,IAAIf,eAAc,SAAS,IAAI;AAAA,EACxC;AAEA,WAAS,WAAY,OAAO,SAAS;AACnC,UAAM,cAAc,OAAO,OAAO;AAAA,EACpC;AAEA,WAAS,aAAc,OAAO,SAAS;AACrC,QAAI,MAAM,WAAW;AACnB,YAAM,UAAU,KAAK,MAAM,cAAc,OAAO,OAAO,CAAC;AAAA,IAC5D;AAAA,EACA;AAEA,WAAS,YAAa,OAAO,MAAM,OAAO;AACxC,UAAM,eAAe,MAAM;AAE3B,QAAI,aAAa,WAAW,GAAG;AAC7B,YAAM,cAAc,aAAa,aAAa,SAAS,CAAC;AAExD,UAAI,CAAC,gBAAgB,KAAK,aAAa,IAAI,GAAG;AAC5C,oBAAY,IAAI,IAAI;AAAA,UAClB,SAAS,gBAAgB,KAAK,MAAM,WAAW,IAAI;AAAA,UACnD,OAAO,MAAM,UAAU,IAAI;AAAA,QACnC;AAAA,MACA;AAAA,IACA;AAEE,UAAM,UAAU,IAAI,IAAI;AAAA,EAC1B;AAEA,WAAS,uBAAwB,OAAO;AACtC,UAAM,sBAAsB,KAAK,uBAAO,OAAO,IAAI,CAAC;AAAA,EACtD;AAEA,WAAS,wBAAyB,OAAO;AACvC,UAAM,cAAc,MAAM,sBAAsB,IAAG;AACnD,UAAM,eAAe,MAAM;AAE3B,QAAI,aAAa,WAAW,EAAG;AAE/B,UAAM,SAAS,aAAa,aAAa,SAAS,CAAC;AACnD,UAAM,QAAQ,OAAO,KAAK,WAAW;AAErC,aAAS,QAAQ,GAAG,SAAS,MAAM,QAAQ,QAAQ,QAAQ,SAAS,GAAG;AACrE,YAAM,OAAO,MAAM,KAAK;AAExB,UAAI,CAAC,gBAAgB,KAAK,QAAQ,IAAI,GAAG;AACvC,eAAO,IAAI,IAAI,YAAY,IAAI;AAAA,MACrC;AAAA,IACA;AAAA,EACA;AAEA,WAAS,0BAA2B,OAAO;AACzC,UAAM,cAAc,MAAM,sBAAsB,IAAG;AACnD,UAAM,QAAQ,OAAO,KAAK,WAAW;AAErC,aAAS,QAAQ,MAAM,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG;AACzD,YAAM,QAAQ,YAAY,MAAM,KAAK,CAAC;AAEtC,UAAI,MAAM,SAAS;AACjB,cAAM,UAAU,MAAM,KAAK,CAAC,IAAI,MAAM;AAAA,MAC5C,OAAW;AACL,eAAO,MAAM,UAAU,MAAM,KAAK,CAAC;AAAA,MACzC;AAAA,IACA;AAAA,EACA;AAEA,WAAS,cAAe,OAAO;AAC7B,WAAO;AAAA,MACL,UAAU,MAAM;AAAA,MAChB,MAAM,MAAM;AAAA,MACZ,WAAW,MAAM;AAAA,MACjB,YAAY,MAAM;AAAA,MAClB,gBAAgB,MAAM;AAAA,MACtB,KAAK,MAAM;AAAA,MACX,QAAQ,MAAM;AAAA,MACd,MAAM,MAAM;AAAA,MACZ,QAAQ,MAAM;AAAA,IAClB;AAAA,EACA;AAEA,WAAS,aAAc,OAAO,UAAU;AACtC,UAAM,WAAW,SAAS;AAC1B,UAAM,OAAO,SAAS;AACtB,UAAM,YAAY,SAAS;AAC3B,UAAM,aAAa,SAAS;AAC5B,UAAM,iBAAiB,SAAS;AAChC,UAAM,MAAM,SAAS;AACrB,UAAM,SAAS,SAAS;AACxB,UAAM,OAAO,SAAS;AACtB,UAAM,SAAS,SAAS;AAAA,EAC1B;AAEA,QAAM,oBAAoB;AAAA,IAExB,MAAM,SAAS,oBAAqB,OAAO,MAAM,MAAM;AACrD,UAAI,MAAM,YAAY,MAAM;AAC1B,mBAAW,OAAO,gCAAgC;AAAA,MACxD;AAEI,UAAI,KAAK,WAAW,GAAG;AACrB,mBAAW,OAAO,6CAA6C;AAAA,MACrE;AAEI,YAAM,QAAQ,uBAAuB,KAAK,KAAK,CAAC,CAAC;AAEjD,UAAI,UAAU,MAAM;AAClB,mBAAW,OAAO,2CAA2C;AAAA,MACnE;AAEI,YAAM,QAAQ,SAAS,MAAM,CAAC,GAAG,EAAE;AACnC,YAAM,QAAQ,SAAS,MAAM,CAAC,GAAG,EAAE;AAEnC,UAAI,UAAU,GAAG;AACf,mBAAW,OAAO,2CAA2C;AAAA,MACnE;AAEI,YAAM,UAAU,KAAK,CAAC;AACtB,YAAM,kBAAmB,QAAQ;AAEjC,UAAI,UAAU,KAAK,UAAU,GAAG;AAC9B,qBAAa,OAAO,0CAA0C;AAAA,MACpE;AAAA,IACA;AAAA,IAEE,KAAK,SAAS,mBAAoB,OAAO,MAAM,MAAM;AACnD,UAAI;AAEJ,UAAI,KAAK,WAAW,GAAG;AACrB,mBAAW,OAAO,6CAA6C;AAAA,MACrE;AAEI,YAAM,SAAS,KAAK,CAAC;AACrB,eAAS,KAAK,CAAC;AAEf,UAAI,CAAC,mBAAmB,KAAK,MAAM,GAAG;AACpC,mBAAW,OAAO,6DAA6D;AAAA,MACrF;AAEI,UAAI,gBAAgB,KAAK,MAAM,QAAQ,MAAM,GAAG;AAC9C,mBAAW,OAAO,gDAAgD,SAAS,cAAc;AAAA,MAC/F;AAEI,UAAI,CAAC,gBAAgB,KAAK,MAAM,GAAG;AACjC,mBAAW,OAAO,8DAA8D;AAAA,MACtF;AAEI,UAAI;AACF,iBAAS,mBAAmB,MAAM;AAAA,MACxC,SAAa,KAAK;AACZ,mBAAW,OAAO,8BAA8B,MAAM;AAAA,MAC5D;AAEI,YAAM,OAAO,MAAM,IAAI;AAAA,IAC3B;AAAA,EACA;AAEA,WAAS,eAAgB,OAAO,OAAO,KAAK,WAAW;AACrD,QAAI,QAAQ,KAAK;AACf,YAAM,UAAU,MAAM,MAAM,MAAM,OAAO,GAAG;AAE5C,UAAI,WAAW;AACb,iBAAS,YAAY,GAAG,UAAU,QAAQ,QAAQ,YAAY,SAAS,aAAa,GAAG;AACrF,gBAAM,aAAa,QAAQ,WAAW,SAAS;AAC/C,cAAI,EAAE,eAAe,KACd,cAAc,MAAQ,cAAc,UAAY;AACrD,uBAAW,OAAO,+BAA+B;AAAA,UAC3D;AAAA,QACA;AAAA,MACA,WAAe,sBAAsB,KAAK,OAAO,GAAG;AAC9C,mBAAW,OAAO,8CAA8C;AAAA,MACtE;AAEI,YAAM,UAAU;AAAA,IACpB;AAAA,EACA;AAEA,WAAS,cAAe,OAAO,aAAa,QAAQ,iBAAiB;AACnE,QAAI,CAACC,QAAO,SAAS,MAAM,GAAG;AAC5B,iBAAW,OAAO,mEAAmE;AAAA,IACzF;AAEE,UAAM,aAAa,OAAO,KAAK,MAAM;AAErC,aAAS,QAAQ,GAAG,WAAW,WAAW,QAAQ,QAAQ,UAAU,SAAS,GAAG;AAC9E,YAAM,MAAM,WAAW,KAAK;AAE5B,UAAI,MAAM,sBAAsB,MAAM,EAAE,MAAM,iBAAiB,MAAM,mBAAmB;AACtF,mBAAW,OAAO,4CAA4C,MAAM,oBAAoB,GAAG;AAAA,MACjG;AAEI,UAAI,CAAC,gBAAgB,KAAK,aAAa,GAAG,GAAG;AAC3C,oBAAY,aAAa,KAAK,OAAO,GAAG,CAAC;AACzC,wBAAgB,GAAG,IAAI;AAAA,MAC7B;AAAA,IACA;AAAA,EACA;AAEA,WAAS,iBAAkB,OAAO,SAAS,iBAAiB,QAAQ,SAAS,WAC3E,WAAW,gBAAgB,UAAU;AAIrC,QAAI,MAAM,QAAQ,OAAO,GAAG;AAC1B,gBAAU,MAAM,UAAU,MAAM,KAAK,OAAO;AAE5C,eAAS,QAAQ,GAAG,WAAW,QAAQ,QAAQ,QAAQ,UAAU,SAAS,GAAG;AAC3E,YAAI,MAAM,QAAQ,QAAQ,KAAK,CAAC,GAAG;AACjC,qBAAW,OAAO,6CAA6C;AAAA,QACvE;AAEM,YAAI,OAAO,YAAY,YAAY,OAAO,QAAQ,KAAK,CAAC,MAAM,mBAAmB;AAC/E,kBAAQ,KAAK,IAAI;AAAA,QACzB;AAAA,MACA;AAAA,IACA;AAKE,QAAI,OAAO,YAAY,YAAY,OAAO,OAAO,MAAM,mBAAmB;AACxE,gBAAU;AAAA,IACd;AAEE,cAAU,OAAO,OAAO;AAExB,QAAI,YAAY,MAAM;AACpB,gBAAU,CAAA;AAAA,IACd;AAEE,QAAI,WAAW,2BAA2B;AACxC,UAAI,MAAM,QAAQ,SAAS,GAAG;AAC5B,iBAAS,QAAQ,GAAG,WAAW,UAAU,QAAQ,QAAQ,UAAU,SAAS,GAAG;AAC7E,wBAAc,OAAO,SAAS,UAAU,KAAK,GAAG,eAAe;AAAA,QACvE;AAAA,MACA,OAAW;AACL,sBAAc,OAAO,SAAS,WAAW,eAAe;AAAA,MAC9D;AAAA,IACA,OAAS;AACL,UAAI,CAAC,MAAM,QACP,CAAC,gBAAgB,KAAK,iBAAiB,OAAO,KAC9C,gBAAgB,KAAK,SAAS,OAAO,GAAG;AAC1C,cAAM,OAAO,aAAa,MAAM;AAChC,cAAM,YAAY,kBAAkB,MAAM;AAC1C,cAAM,WAAW,YAAY,MAAM;AACnC,mBAAW,OAAO,wBAAwB;AAAA,MAChD;AAEI,kBAAY,SAAS,SAAS,SAAS;AACvC,aAAO,gBAAgB,OAAO;AAAA,IAClC;AAEE,WAAO;AAAA,EACT;AAEA,WAAS,cAAe,OAAO;AAC7B,UAAM,KAAK,MAAM,MAAM,WAAW,MAAM,QAAQ;AAEhD,QAAI,OAAO,IAAc;AACvB,YAAM;AAAA,IACV,WAAa,OAAO,IAAc;AAC9B,YAAM;AACN,UAAI,MAAM,MAAM,WAAW,MAAM,QAAQ,MAAM,IAAc;AAC3D,cAAM;AAAA,MACZ;AAAA,IACA,OAAS;AACL,iBAAW,OAAO,0BAA0B;AAAA,IAChD;AAEE,UAAM,QAAQ;AACd,UAAM,YAAY,MAAM;AACxB,UAAM,iBAAiB;AAAA,EACzB;AAEA,WAAS,oBAAqB,OAAO,eAAe,aAAa;AAC/D,QAAI,aAAa;AACjB,QAAI,KAAK,MAAM,MAAM,WAAW,MAAM,QAAQ;AAE9C,WAAO,OAAO,GAAG;AACf,aAAO,aAAa,EAAE,GAAG;AACvB,YAAI,OAAO,KAAiB,MAAM,mBAAmB,IAAI;AACvD,gBAAM,iBAAiB,MAAM;AAAA,QACrC;AACM,aAAK,MAAM,MAAM,WAAW,EAAE,MAAM,QAAQ;AAAA,MAClD;AAEI,UAAI,iBAAiB,OAAO,IAAa;AACvC,WAAG;AACD,eAAK,MAAM,MAAM,WAAW,EAAE,MAAM,QAAQ;AAAA,QACpD,SAAe,OAAO,MAAgB,OAAO,MAAgB,OAAO;AAAA,MACpE;AAEI,UAAI,MAAM,EAAE,GAAG;AACb,sBAAc,KAAK;AAEnB,aAAK,MAAM,MAAM,WAAW,MAAM,QAAQ;AAC1C;AACA,cAAM,aAAa;AAEnB,eAAO,OAAO,IAAiB;AAC7B,gBAAM;AACN,eAAK,MAAM,MAAM,WAAW,EAAE,MAAM,QAAQ;AAAA,QACpD;AAAA,MACA,OAAW;AACL;AAAA,MACN;AAAA,IACA;AAEE,QAAI,gBAAgB,MAAM,eAAe,KAAK,MAAM,aAAa,aAAa;AAC5E,mBAAa,OAAO,uBAAuB;AAAA,IAC/C;AAEE,WAAO;AAAA,EACT;AAEA,WAAS,sBAAuB,OAAO;AACrC,QAAI,YAAY,MAAM;AACtB,QAAI,KAAK,MAAM,MAAM,WAAW,SAAS;AAIzC,SAAK,OAAO,MAAe,OAAO,OAC9B,OAAO,MAAM,MAAM,WAAW,YAAY,CAAC,KAC3C,OAAO,MAAM,MAAM,WAAW,YAAY,CAAC,GAAG;AAChD,mBAAa;AAEb,WAAK,MAAM,MAAM,WAAW,SAAS;AAErC,UAAI,OAAO,KAAK,UAAU,EAAE,GAAG;AAC7B,eAAO;AAAA,MACb;AAAA,IACA;AAEE,WAAO;AAAA,EACT;AAEA,WAAS,iBAAkB,OAAO,OAAO;AACvC,QAAI,UAAU,GAAG;AACf,YAAM,UAAU;AAAA,IACpB,WAAa,QAAQ,GAAG;AACpB,YAAM,UAAUA,QAAO,OAAO,MAAM,QAAQ,CAAC;AAAA,IACjD;AAAA,EACA;AAEA,WAAS,gBAAiB,OAAO,YAAY,sBAAsB;AACjE,QAAI;AACJ,QAAI;AACJ,QAAI;AACJ,QAAI;AACJ,QAAI;AACJ,QAAI;AACJ,UAAM,QAAQ,MAAM;AACpB,UAAM,UAAU,MAAM;AAEtB,QAAI,KAAK,MAAM,MAAM,WAAW,MAAM,QAAQ;AAE9C,QAAI,UAAU,EAAE,KACZ,gBAAgB,EAAE,KAClB,OAAO,MACP,OAAO,MACP,OAAO,MACP,OAAO,MACP,OAAO,OACP,OAAO,MACP,OAAO,MACP,OAAO,MACP,OAAO,MACP,OAAO,MACP,OAAO,IAAa;AACtB,aAAO;AAAA,IACX;AAEE,QAAI,OAAO,MAAe,OAAO,IAAa;AAC5C,YAAM,YAAY,MAAM,MAAM,WAAW,MAAM,WAAW,CAAC;AAE3D,UAAI,UAAU,SAAS,KAClB,wBAAwB,gBAAgB,SAAS,GAAI;AACxD,eAAO;AAAA,MACb;AAAA,IACA;AAEE,UAAM,OAAO;AACb,UAAM,SAAS;AACf,mBAAe,aAAa,MAAM;AAClC,wBAAoB;AAEpB,WAAO,OAAO,GAAG;AACf,UAAI,OAAO,IAAa;AACtB,cAAM,YAAY,MAAM,MAAM,WAAW,MAAM,WAAW,CAAC;AAE3D,YAAI,UAAU,SAAS,KAClB,wBAAwB,gBAAgB,SAAS,GAAI;AACxD;AAAA,QACR;AAAA,MACA,WAAe,OAAO,IAAa;AAC7B,cAAM,YAAY,MAAM,MAAM,WAAW,MAAM,WAAW,CAAC;AAE3D,YAAI,UAAU,SAAS,GAAG;AACxB;AAAA,QACR;AAAA,MACA,WAAgB,MAAM,aAAa,MAAM,aAAa,sBAAsB,KAAK,KACjE,wBAAwB,gBAAgB,EAAE,GAAI;AACxD;AAAA,MACN,WAAe,MAAM,EAAE,GAAG;AACpB,gBAAQ,MAAM;AACd,qBAAa,MAAM;AACnB,sBAAc,MAAM;AACpB,4BAAoB,OAAO,OAAO,EAAE;AAEpC,YAAI,MAAM,cAAc,YAAY;AAClC,8BAAoB;AACpB,eAAK,MAAM,MAAM,WAAW,MAAM,QAAQ;AAC1C;AAAA,QACR,OAAa;AACL,gBAAM,WAAW;AACjB,gBAAM,OAAO;AACb,gBAAM,YAAY;AAClB,gBAAM,aAAa;AACnB;AAAA,QACR;AAAA,MACA;AAEI,UAAI,mBAAmB;AACrB,uBAAe,OAAO,cAAc,YAAY,KAAK;AACrD,yBAAiB,OAAO,MAAM,OAAO,KAAK;AAC1C,uBAAe,aAAa,MAAM;AAClC,4BAAoB;AAAA,MAC1B;AAEI,UAAI,CAAC,aAAa,EAAE,GAAG;AACrB,qBAAa,MAAM,WAAW;AAAA,MACpC;AAEI,WAAK,MAAM,MAAM,WAAW,EAAE,MAAM,QAAQ;AAAA,IAChD;AAEE,mBAAe,OAAO,cAAc,YAAY,KAAK;AAErD,QAAI,MAAM,QAAQ;AAChB,aAAO;AAAA,IACX;AAEE,UAAM,OAAO;AACb,UAAM,SAAS;AACf,WAAO;AAAA,EACT;AAEA,WAAS,uBAAwB,OAAO,YAAY;AAClD,QAAI;AACJ,QAAI;AAEJ,QAAI,KAAK,MAAM,MAAM,WAAW,MAAM,QAAQ;AAE9C,QAAI,OAAO,IAAa;AACtB,aAAO;AAAA,IACX;AAEE,UAAM,OAAO;AACb,UAAM,SAAS;AACf,UAAM;AACN,mBAAe,aAAa,MAAM;AAElC,YAAQ,KAAK,MAAM,MAAM,WAAW,MAAM,QAAQ,OAAO,GAAG;AAC1D,UAAI,OAAO,IAAa;AACtB,uBAAe,OAAO,cAAc,MAAM,UAAU,IAAI;AACxD,aAAK,MAAM,MAAM,WAAW,EAAE,MAAM,QAAQ;AAE5C,YAAI,OAAO,IAAa;AACtB,yBAAe,MAAM;AACrB,gBAAM;AACN,uBAAa,MAAM;AAAA,QAC3B,OAAa;AACL,iBAAO;AAAA,QACf;AAAA,MACA,WAAe,MAAM,EAAE,GAAG;AACpB,uBAAe,OAAO,cAAc,YAAY,IAAI;AACpD,yBAAiB,OAAO,oBAAoB,OAAO,OAAO,UAAU,CAAC;AACrE,uBAAe,aAAa,MAAM;AAAA,MACxC,WAAe,MAAM,aAAa,MAAM,aAAa,sBAAsB,KAAK,GAAG;AAC7E,mBAAW,OAAO,8DAA8D;AAAA,MACtF,OAAW;AACL,cAAM;AACN,YAAI,CAAC,aAAa,EAAE,GAAG;AACrB,uBAAa,MAAM;AAAA,QAC3B;AAAA,MACA;AAAA,IACA;AAEE,eAAW,OAAO,4DAA4D;AAAA,EAChF;AAEA,WAAS,uBAAwB,OAAO,YAAY;AAClD,QAAI;AACJ,QAAI;AACJ,QAAI;AAEJ,QAAI,KAAK,MAAM,MAAM,WAAW,MAAM,QAAQ;AAE9C,QAAI,OAAO,IAAa;AACtB,aAAO;AAAA,IACX;AAEE,UAAM,OAAO;AACb,UAAM,SAAS;AACf,UAAM;AACN,mBAAe,aAAa,MAAM;AAElC,YAAQ,KAAK,MAAM,MAAM,WAAW,MAAM,QAAQ,OAAO,GAAG;AAC1D,UAAI,OAAO,IAAa;AACtB,uBAAe,OAAO,cAAc,MAAM,UAAU,IAAI;AACxD,cAAM;AACN,eAAO;AAAA,MACb,WAAe,OAAO,IAAa;AAC7B,uBAAe,OAAO,cAAc,MAAM,UAAU,IAAI;AACxD,aAAK,MAAM,MAAM,WAAW,EAAE,MAAM,QAAQ;AAE5C,YAAI,MAAM,EAAE,GAAG;AACb,8BAAoB,OAAO,OAAO,UAAU;AAAA,QAGpD,WAAiB,KAAK,OAAO,kBAAkB,EAAE,GAAG;AAC5C,gBAAM,UAAU,gBAAgB,EAAE;AAClC,gBAAM;AAAA,QACd,YAAkB,MAAM,cAAc,EAAE,KAAK,GAAG;AACxC,cAAI,YAAY;AAChB,cAAI,YAAY;AAEhB,iBAAO,YAAY,GAAG,aAAa;AACjC,iBAAK,MAAM,MAAM,WAAW,EAAE,MAAM,QAAQ;AAE5C,iBAAK,MAAM,YAAY,EAAE,MAAM,GAAG;AAChC,2BAAa,aAAa,KAAK;AAAA,YAC3C,OAAiB;AACL,yBAAW,OAAO,gCAAgC;AAAA,YAC9D;AAAA,UACA;AAEQ,gBAAM,UAAU,kBAAkB,SAAS;AAE3C,gBAAM;AAAA,QACd,OAAa;AACL,qBAAW,OAAO,yBAAyB;AAAA,QACnD;AAEM,uBAAe,aAAa,MAAM;AAAA,MACxC,WAAe,MAAM,EAAE,GAAG;AACpB,uBAAe,OAAO,cAAc,YAAY,IAAI;AACpD,yBAAiB,OAAO,oBAAoB,OAAO,OAAO,UAAU,CAAC;AACrE,uBAAe,aAAa,MAAM;AAAA,MACxC,WAAe,MAAM,aAAa,MAAM,aAAa,sBAAsB,KAAK,GAAG;AAC7E,mBAAW,OAAO,8DAA8D;AAAA,MACtF,OAAW;AACL,cAAM;AACN,YAAI,CAAC,aAAa,EAAE,GAAG;AACrB,uBAAa,MAAM;AAAA,QAC3B;AAAA,MACA;AAAA,IACA;AAEE,eAAW,OAAO,4DAA4D;AAAA,EAChF;AAEA,WAAS,mBAAoB,OAAO,YAAY;AAC9C,QAAI,WAAW;AACf,QAAI;AACJ,QAAI;AACJ,QAAI;AACJ,UAAM,OAAO,MAAM;AACnB,QAAI;AACJ,UAAM,UAAU,MAAM;AACtB,QAAI;AACJ,QAAI;AACJ,QAAI;AACJ,QAAI;AACJ,UAAM,kBAAkB,uBAAO,OAAO,IAAI;AAC1C,QAAI;AACJ,QAAI;AACJ,QAAI;AAEJ,QAAI,KAAK,MAAM,MAAM,WAAW,MAAM,QAAQ;AAE9C,QAAI,OAAO,IAAa;AACtB,mBAAa;AACb,kBAAY;AACZ,gBAAU,CAAA;AAAA,IACd,WAAa,OAAO,KAAa;AAC7B,mBAAa;AACb,kBAAY;AACZ,gBAAU,CAAA;AAAA,IACd,OAAS;AACL,aAAO;AAAA,IACX;AAEE,QAAI,MAAM,WAAW,MAAM;AACzB,kBAAY,OAAO,MAAM,QAAQ,OAAO;AAAA,IAC5C;AAEE,SAAK,MAAM,MAAM,WAAW,EAAE,MAAM,QAAQ;AAE5C,WAAO,OAAO,GAAG;AACf,0BAAoB,OAAO,MAAM,UAAU;AAE3C,WAAK,MAAM,MAAM,WAAW,MAAM,QAAQ;AAE1C,UAAI,OAAO,YAAY;AACrB,cAAM;AACN,cAAM,MAAM;AACZ,cAAM,SAAS;AACf,cAAM,OAAO,YAAY,YAAY;AACrC,cAAM,SAAS;AACf,eAAO;AAAA,MACb,WAAe,CAAC,UAAU;AACpB,mBAAW,OAAO,8CAA8C;AAAA,MACtE,WAAe,OAAO,IAAa;AAE7B,mBAAW,OAAO,0CAA0C;AAAA,MAClE;AAEI,eAAS,UAAU,YAAY;AAC/B,eAAS,iBAAiB;AAE1B,UAAI,OAAO,IAAa;AACtB,cAAM,YAAY,MAAM,MAAM,WAAW,MAAM,WAAW,CAAC;AAE3D,YAAI,UAAU,SAAS,GAAG;AACxB,mBAAS,iBAAiB;AAC1B,gBAAM;AACN,8BAAoB,OAAO,MAAM,UAAU;AAAA,QACnD;AAAA,MACA;AAEI,cAAQ,MAAM;AACd,mBAAa,MAAM;AACnB,aAAO,MAAM;AACb,kBAAY,OAAO,YAAY,iBAAiB,OAAO,IAAI;AAC3D,eAAS,MAAM;AACf,gBAAU,MAAM;AAChB,0BAAoB,OAAO,MAAM,UAAU;AAE3C,WAAK,MAAM,MAAM,WAAW,MAAM,QAAQ;AAE1C,WAAK,kBAAkB,MAAM,SAAS,UAAU,OAAO,IAAa;AAClE,iBAAS;AACT,aAAK,MAAM,MAAM,WAAW,EAAE,MAAM,QAAQ;AAC5C,4BAAoB,OAAO,MAAM,UAAU;AAC3C,oBAAY,OAAO,YAAY,iBAAiB,OAAO,IAAI;AAC3D,oBAAY,MAAM;AAAA,MACxB;AAEI,UAAI,WAAW;AACb,yBAAiB,OAAO,SAAS,iBAAiB,QAAQ,SAAS,WAAW,OAAO,YAAY,IAAI;AAAA,MAC3G,WAAe,QAAQ;AACjB,gBAAQ,KAAK,iBAAiB,OAAO,MAAM,iBAAiB,QAAQ,SAAS,WAAW,OAAO,YAAY,IAAI,CAAC;AAAA,MACtH,OAAW;AACL,gBAAQ,KAAK,OAAO;AAAA,MAC1B;AAEI,0BAAoB,OAAO,MAAM,UAAU;AAE3C,WAAK,MAAM,MAAM,WAAW,MAAM,QAAQ;AAE1C,UAAI,OAAO,IAAa;AACtB,mBAAW;AACX,aAAK,MAAM,MAAM,WAAW,EAAE,MAAM,QAAQ;AAAA,MAClD,OAAW;AACL,mBAAW;AAAA,MACjB;AAAA,IACA;AAEE,eAAW,OAAO,uDAAuD;AAAA,EAC3E;AAEA,WAAS,gBAAiB,OAAO,YAAY;AAC3C,QAAI;AACJ,QAAI,WAAW;AACf,QAAI,iBAAiB;AACrB,QAAI,iBAAiB;AACrB,QAAI,aAAa;AACjB,QAAI,aAAa;AACjB,QAAI,iBAAiB;AACrB,QAAI;AAEJ,QAAI,KAAK,MAAM,MAAM,WAAW,MAAM,QAAQ;AAE9C,QAAI,OAAO,KAAa;AACtB,gBAAU;AAAA,IACd,WAAa,OAAO,IAAa;AAC7B,gBAAU;AAAA,IACd,OAAS;AACL,aAAO;AAAA,IACX;AAEE,UAAM,OAAO;AACb,UAAM,SAAS;AAEf,WAAO,OAAO,GAAG;AACf,WAAK,MAAM,MAAM,WAAW,EAAE,MAAM,QAAQ;AAE5C,UAAI,OAAO,MAAe,OAAO,IAAa;AAC5C,YAAI,kBAAkB,UAAU;AAC9B,qBAAY,OAAO,KAAe,gBAAgB;AAAA,QAC1D,OAAa;AACL,qBAAW,OAAO,sCAAsC;AAAA,QAChE;AAAA,MACA,YAAgB,MAAM,gBAAgB,EAAE,MAAM,GAAG;AAC3C,YAAI,QAAQ,GAAG;AACb,qBAAW,OAAO,8EAA8E;AAAA,QACxG,WAAiB,CAAC,gBAAgB;AAC1B,uBAAa,aAAa,MAAM;AAChC,2BAAiB;AAAA,QACzB,OAAa;AACL,qBAAW,OAAO,2CAA2C;AAAA,QACrE;AAAA,MACA,OAAW;AACL;AAAA,MACN;AAAA,IACA;AAEE,QAAI,aAAa,EAAE,GAAG;AACpB,SAAG;AAAE,aAAK,MAAM,MAAM,WAAW,EAAE,MAAM,QAAQ;AAAA,MAAC,SAC3C,aAAa,EAAE;AAEtB,UAAI,OAAO,IAAa;AACtB,WAAG;AAAE,eAAK,MAAM,MAAM,WAAW,EAAE,MAAM,QAAQ;AAAA,QAAC,SAC3C,CAAC,MAAM,EAAE,KAAM,OAAO;AAAA,MACnC;AAAA,IACA;AAEE,WAAO,OAAO,GAAG;AACf,oBAAc,KAAK;AACnB,YAAM,aAAa;AAEnB,WAAK,MAAM,MAAM,WAAW,MAAM,QAAQ;AAG1C,cAAQ,CAAC,kBAAkB,MAAM,aAAa,eACtC,OAAO,IAAkB;AAC/B,cAAM;AACN,aAAK,MAAM,MAAM,WAAW,EAAE,MAAM,QAAQ;AAAA,MAClD;AAEI,UAAI,CAAC,kBAAkB,MAAM,aAAa,YAAY;AACpD,qBAAa,MAAM;AAAA,MACzB;AAEI,UAAI,MAAM,EAAE,GAAG;AACb;AACA;AAAA,MACN;AAEI,UAAI,CAAC,kBAAkB,eAAe,GAAG;AACvC,mBAAW,OAAO,sCAAsC;AAAA,MAC9D;AAGI,UAAI,MAAM,aAAa,YAAY;AAEjC,YAAI,aAAa,eAAe;AAC9B,gBAAM,UAAUA,QAAO,OAAO,MAAM,iBAAiB,IAAI,aAAa,UAAU;AAAA,QACxF,WAAiB,aAAa,eAAe;AACrC,cAAI,gBAAgB;AAClB,kBAAM,UAAU;AAAA,UAC1B;AAAA,QACA;AAGM;AAAA,MACN;AAGI,UAAI,SAAS;AAEX,YAAI,aAAa,EAAE,GAAG;AACpB,2BAAiB;AAEjB,gBAAM,UAAUA,QAAO,OAAO,MAAM,iBAAiB,IAAI,aAAa,UAAU;AAAA,QAGxF,WAAiB,gBAAgB;AACzB,2BAAiB;AACjB,gBAAM,UAAUA,QAAO,OAAO,MAAM,aAAa,CAAC;AAAA,QAG1D,WAAiB,eAAe,GAAG;AAC3B,cAAI,gBAAgB;AAClB,kBAAM,UAAU;AAAA,UAC1B;AAAA,QAGA,OAAa;AACL,gBAAM,UAAUA,QAAO,OAAO,MAAM,UAAU;AAAA,QACtD;AAAA,MAGA,OAAW;AAEL,cAAM,UAAUA,QAAO,OAAO,MAAM,iBAAiB,IAAI,aAAa,UAAU;AAAA,MACtF;AAEI,uBAAiB;AACjB,uBAAiB;AACjB,mBAAa;AACb,YAAM,eAAe,MAAM;AAE3B,aAAO,CAAC,MAAM,EAAE,KAAM,OAAO,GAAI;AAC/B,aAAK,MAAM,MAAM,WAAW,EAAE,MAAM,QAAQ;AAAA,MAClD;AAEI,qBAAe,OAAO,cAAc,MAAM,UAAU,KAAK;AAAA,IAC7D;AAEE,WAAO;AAAA,EACT;AAEA,WAAS,kBAAmB,OAAO,YAAY;AAC7C,UAAM,OAAO,MAAM;AACnB,UAAM,UAAU,MAAM;AACtB,UAAM,UAAU,CAAA;AAChB,QAAI,WAAW;AAIf,QAAI,MAAM,mBAAmB,GAAI,QAAO;AAExC,QAAI,MAAM,WAAW,MAAM;AACzB,kBAAY,OAAO,MAAM,QAAQ,OAAO;AAAA,IAC5C;AAEE,QAAI,KAAK,MAAM,MAAM,WAAW,MAAM,QAAQ;AAE9C,WAAO,OAAO,GAAG;AACf,UAAI,MAAM,mBAAmB,IAAI;AAC/B,cAAM,WAAW,MAAM;AACvB,mBAAW,OAAO,gDAAgD;AAAA,MACxE;AAEI,UAAI,OAAO,IAAa;AACtB;AAAA,MACN;AAEI,YAAM,YAAY,MAAM,MAAM,WAAW,MAAM,WAAW,CAAC;AAE3D,UAAI,CAAC,UAAU,SAAS,GAAG;AACzB;AAAA,MACN;AAEI,iBAAW;AACX,YAAM;AAEN,UAAI,oBAAoB,OAAO,MAAM,EAAE,GAAG;AACxC,YAAI,MAAM,cAAc,YAAY;AAClC,kBAAQ,KAAK,IAAI;AACjB,eAAK,MAAM,MAAM,WAAW,MAAM,QAAQ;AAC1C;AAAA,QACR;AAAA,MACA;AAEI,YAAM,QAAQ,MAAM;AACpB,kBAAY,OAAO,YAAY,kBAAkB,OAAO,IAAI;AAC5D,cAAQ,KAAK,MAAM,MAAM;AACzB,0BAAoB,OAAO,MAAM,EAAE;AAEnC,WAAK,MAAM,MAAM,WAAW,MAAM,QAAQ;AAE1C,WAAK,MAAM,SAAS,SAAS,MAAM,aAAa,eAAgB,OAAO,GAAI;AACzE,mBAAW,OAAO,qCAAqC;AAAA,MAC7D,WAAe,MAAM,aAAa,YAAY;AACxC;AAAA,MACN;AAAA,IACA;AAEE,QAAI,UAAU;AACZ,YAAM,MAAM;AACZ,YAAM,SAAS;AACf,YAAM,OAAO;AACb,YAAM,SAAS;AACf,aAAO;AAAA,IACX;AACE,WAAO;AAAA,EACT;AAEA,WAAS,iBAAkB,OAAO,YAAY,YAAY;AACxD,QAAI;AACJ,QAAI;AACJ,QAAI;AACJ,QAAI;AACJ,UAAM,OAAO,MAAM;AACnB,UAAM,UAAU,MAAM;AACtB,UAAM,UAAU,CAAA;AAChB,UAAM,kBAAkB,uBAAO,OAAO,IAAI;AAC1C,QAAI,SAAS;AACb,QAAI,UAAU;AACd,QAAI,YAAY;AAChB,QAAI,gBAAgB;AACpB,QAAI,WAAW;AAIf,QAAI,MAAM,mBAAmB,GAAI,QAAO;AAExC,QAAI,MAAM,WAAW,MAAM;AACzB,kBAAY,OAAO,MAAM,QAAQ,OAAO;AAAA,IAC5C;AAEE,QAAI,KAAK,MAAM,MAAM,WAAW,MAAM,QAAQ;AAE9C,WAAO,OAAO,GAAG;AACf,UAAI,CAAC,iBAAiB,MAAM,mBAAmB,IAAI;AACjD,cAAM,WAAW,MAAM;AACvB,mBAAW,OAAO,gDAAgD;AAAA,MACxE;AAEI,YAAM,YAAY,MAAM,MAAM,WAAW,MAAM,WAAW,CAAC;AAC3D,YAAM,QAAQ,MAAM;AAMpB,WAAK,OAAO,MAAe,OAAO,OAAgB,UAAU,SAAS,GAAG;AACtE,YAAI,OAAO,IAAa;AACtB,cAAI,eAAe;AACjB,6BAAiB,OAAO,SAAS,iBAAiB,QAAQ,SAAS,MAAM,UAAU,eAAe,OAAO;AACzG,qBAAS,UAAU,YAAY;AAAA,UACzC;AAEQ,qBAAW;AACX,0BAAgB;AAChB,yBAAe;AAAA,QACvB,WAAiB,eAAe;AAExB,0BAAgB;AAChB,yBAAe;AAAA,QACvB,OAAa;AACL,qBAAW,OAAO,mGAAmG;AAAA,QAC7H;AAEM,cAAM,YAAY;AAClB,aAAK;AAAA,MAKX,OAAW;AACL,mBAAW,MAAM;AACjB,wBAAgB,MAAM;AACtB,kBAAU,MAAM;AAEhB,YAAI,CAAC,YAAY,OAAO,YAAY,kBAAkB,OAAO,IAAI,GAAG;AAGlE;AAAA,QACR;AAEM,YAAI,MAAM,SAAS,OAAO;AACxB,eAAK,MAAM,MAAM,WAAW,MAAM,QAAQ;AAE1C,iBAAO,aAAa,EAAE,GAAG;AACvB,iBAAK,MAAM,MAAM,WAAW,EAAE,MAAM,QAAQ;AAAA,UACtD;AAEQ,cAAI,OAAO,IAAa;AACtB,iBAAK,MAAM,MAAM,WAAW,EAAE,MAAM,QAAQ;AAE5C,gBAAI,CAAC,UAAU,EAAE,GAAG;AAClB,yBAAW,OAAO,yFAAyF;AAAA,YACvH;AAEU,gBAAI,eAAe;AACjB,+BAAiB,OAAO,SAAS,iBAAiB,QAAQ,SAAS,MAAM,UAAU,eAAe,OAAO;AACzG,uBAAS,UAAU,YAAY;AAAA,YAC3C;AAEU,uBAAW;AACX,4BAAgB;AAChB,2BAAe;AACf,qBAAS,MAAM;AACf,sBAAU,MAAM;AAAA,UAC1B,WAAmB,UAAU;AACnB,uBAAW,OAAO,0DAA0D;AAAA,UACtF,OAAe;AACL,kBAAM,MAAM;AACZ,kBAAM,SAAS;AACf,mBAAO;AAAA,UACjB;AAAA,QACA,WAAiB,UAAU;AACnB,qBAAW,OAAO,gFAAgF;AAAA,QAC1G,OAAa;AACL,gBAAM,MAAM;AACZ,gBAAM,SAAS;AACf,iBAAO;AAAA,QACf;AAAA,MACA;AAKI,UAAI,MAAM,SAAS,SAAS,MAAM,aAAa,YAAY;AACzD,YAAI,eAAe;AACjB,qBAAW,MAAM;AACjB,0BAAgB,MAAM;AACtB,oBAAU,MAAM;AAAA,QACxB;AAEM,YAAI,YAAY,OAAO,YAAY,mBAAmB,MAAM,YAAY,GAAG;AACzE,cAAI,eAAe;AACjB,sBAAU,MAAM;AAAA,UAC1B,OAAe;AACL,wBAAY,MAAM;AAAA,UAC5B;AAAA,QACA;AAEM,YAAI,CAAC,eAAe;AAClB,2BAAiB,OAAO,SAAS,iBAAiB,QAAQ,SAAS,WAAW,UAAU,eAAe,OAAO;AAC9G,mBAAS,UAAU,YAAY;AAAA,QACvC;AAEM,4BAAoB,OAAO,MAAM,EAAE;AACnC,aAAK,MAAM,MAAM,WAAW,MAAM,QAAQ;AAAA,MAChD;AAEI,WAAK,MAAM,SAAS,SAAS,MAAM,aAAa,eAAgB,OAAO,GAAI;AACzE,mBAAW,OAAO,oCAAoC;AAAA,MAC5D,WAAe,MAAM,aAAa,YAAY;AACxC;AAAA,MACN;AAAA,IACA;AAOE,QAAI,eAAe;AACjB,uBAAiB,OAAO,SAAS,iBAAiB,QAAQ,SAAS,MAAM,UAAU,eAAe,OAAO;AAAA,IAC7G;AAGE,QAAI,UAAU;AACZ,YAAM,MAAM;AACZ,YAAM,SAAS;AACf,YAAM,OAAO;AACb,YAAM,SAAS;AAAA,IACnB;AAEE,WAAO;AAAA,EACT;AAEA,WAAS,gBAAiB,OAAO;AAC/B,QAAI,aAAa;AACjB,QAAI,UAAU;AACd,QAAI;AACJ,QAAI;AAEJ,QAAI,KAAK,MAAM,MAAM,WAAW,MAAM,QAAQ;AAE9C,QAAI,OAAO,GAAa,QAAO;AAE/B,QAAI,MAAM,QAAQ,MAAM;AACtB,iBAAW,OAAO,+BAA+B;AAAA,IACrD;AAEE,SAAK,MAAM,MAAM,WAAW,EAAE,MAAM,QAAQ;AAE5C,QAAI,OAAO,IAAa;AACtB,mBAAa;AACb,WAAK,MAAM,MAAM,WAAW,EAAE,MAAM,QAAQ;AAAA,IAChD,WAAa,OAAO,IAAa;AAC7B,gBAAU;AACV,kBAAY;AACZ,WAAK,MAAM,MAAM,WAAW,EAAE,MAAM,QAAQ;AAAA,IAChD,OAAS;AACL,kBAAY;AAAA,IAChB;AAEE,QAAI,YAAY,MAAM;AAEtB,QAAI,YAAY;AACd,SAAG;AAAE,aAAK,MAAM,MAAM,WAAW,EAAE,MAAM,QAAQ;AAAA,MAAC,SAC3C,OAAO,KAAK,OAAO;AAE1B,UAAI,MAAM,WAAW,MAAM,QAAQ;AACjC,kBAAU,MAAM,MAAM,MAAM,WAAW,MAAM,QAAQ;AACrD,aAAK,MAAM,MAAM,WAAW,EAAE,MAAM,QAAQ;AAAA,MAClD,OAAW;AACL,mBAAW,OAAO,oDAAoD;AAAA,MAC5E;AAAA,IACA,OAAS;AACL,aAAO,OAAO,KAAK,CAAC,UAAU,EAAE,GAAG;AACjC,YAAI,OAAO,IAAa;AACtB,cAAI,CAAC,SAAS;AACZ,wBAAY,MAAM,MAAM,MAAM,YAAY,GAAG,MAAM,WAAW,CAAC;AAE/D,gBAAI,CAAC,mBAAmB,KAAK,SAAS,GAAG;AACvC,yBAAW,OAAO,iDAAiD;AAAA,YAC/E;AAEU,sBAAU;AACV,wBAAY,MAAM,WAAW;AAAA,UACvC,OAAe;AACL,uBAAW,OAAO,6CAA6C;AAAA,UACzE;AAAA,QACA;AAEM,aAAK,MAAM,MAAM,WAAW,EAAE,MAAM,QAAQ;AAAA,MAClD;AAEI,gBAAU,MAAM,MAAM,MAAM,WAAW,MAAM,QAAQ;AAErD,UAAI,wBAAwB,KAAK,OAAO,GAAG;AACzC,mBAAW,OAAO,qDAAqD;AAAA,MAC7E;AAAA,IACA;AAEE,QAAI,WAAW,CAAC,gBAAgB,KAAK,OAAO,GAAG;AAC7C,iBAAW,OAAO,8CAA8C,OAAO;AAAA,IAC3E;AAEE,QAAI;AACF,gBAAU,mBAAmB,OAAO;AAAA,IACxC,SAAW,KAAK;AACZ,iBAAW,OAAO,4BAA4B,OAAO;AAAA,IACzD;AAEE,QAAI,YAAY;AACd,YAAM,MAAM;AAAA,IAChB,WAAa,gBAAgB,KAAK,MAAM,QAAQ,SAAS,GAAG;AACxD,YAAM,MAAM,MAAM,OAAO,SAAS,IAAI;AAAA,IAC1C,WAAa,cAAc,KAAK;AAC5B,YAAM,MAAM,MAAM;AAAA,IACtB,WAAa,cAAc,MAAM;AAC7B,YAAM,MAAM,uBAAuB;AAAA,IACvC,OAAS;AACL,iBAAW,OAAO,4BAA4B,YAAY,GAAG;AAAA,IACjE;AAEE,WAAO;AAAA,EACT;AAEA,WAAS,mBAAoB,OAAO;AAClC,QAAI,KAAK,MAAM,MAAM,WAAW,MAAM,QAAQ;AAE9C,QAAI,OAAO,GAAa,QAAO;AAE/B,QAAI,MAAM,WAAW,MAAM;AACzB,iBAAW,OAAO,mCAAmC;AAAA,IACzD;AAEE,SAAK,MAAM,MAAM,WAAW,EAAE,MAAM,QAAQ;AAC5C,UAAM,YAAY,MAAM;AAExB,WAAO,OAAO,KAAK,CAAC,UAAU,EAAE,KAAK,CAAC,gBAAgB,EAAE,GAAG;AACzD,WAAK,MAAM,MAAM,WAAW,EAAE,MAAM,QAAQ;AAAA,IAChD;AAEE,QAAI,MAAM,aAAa,WAAW;AAChC,iBAAW,OAAO,4DAA4D;AAAA,IAClF;AAEE,UAAM,SAAS,MAAM,MAAM,MAAM,WAAW,MAAM,QAAQ;AAC1D,WAAO;AAAA,EACT;AAEA,WAAS,UAAW,OAAO;AACzB,QAAI,KAAK,MAAM,MAAM,WAAW,MAAM,QAAQ;AAE9C,QAAI,OAAO,GAAa,QAAO;AAE/B,SAAK,MAAM,MAAM,WAAW,EAAE,MAAM,QAAQ;AAC5C,UAAM,YAAY,MAAM;AAExB,WAAO,OAAO,KAAK,CAAC,UAAU,EAAE,KAAK,CAAC,gBAAgB,EAAE,GAAG;AACzD,WAAK,MAAM,MAAM,WAAW,EAAE,MAAM,QAAQ;AAAA,IAChD;AAEE,QAAI,MAAM,aAAa,WAAW;AAChC,iBAAW,OAAO,2DAA2D;AAAA,IACjF;AAEE,UAAM,QAAQ,MAAM,MAAM,MAAM,WAAW,MAAM,QAAQ;AAEzD,QAAI,CAAC,gBAAgB,KAAK,MAAM,WAAW,KAAK,GAAG;AACjD,iBAAW,OAAO,yBAAyB,QAAQ,GAAG;AAAA,IAC1D;AAEE,UAAM,SAAS,MAAM,UAAU,KAAK;AACpC,wBAAoB,OAAO,MAAM,EAAE;AACnC,WAAO;AAAA,EACT;AAEA,WAAS,gCAAiC,OAAO,eAAe,YAAY,YAAY;AACtF,UAAM,gBAAgB,cAAc,KAAK;AAEzC,2BAAuB,KAAK;AAC5B,iBAAa,OAAO,aAAa;AAIjC,UAAM,MAAM;AACZ,UAAM,SAAS;AACf,UAAM,OAAO;AACb,UAAM,SAAS;AAEf,QAAI,iBAAiB,OAAO,YAAY,UAAU,KAAK,MAAM,SAAS,WAAW;AAC/E,8BAAwB,KAAK;AAC7B,aAAO;AAAA,IACX;AAEE,8BAA0B,KAAK;AAC/B,iBAAa,OAAO,aAAa;AACjC,WAAO;AAAA,EACT;AAEA,WAAS,YAAa,OAAO,cAAc,aAAa,aAAa,cAAc;AACjF,QAAI;AACJ,QAAI;AACJ,QAAI,eAAe;AACnB,QAAI,YAAY;AAChB,QAAI,aAAa;AACjB,QAAI,gBAAgB;AACpB,QAAIO;AACJ,QAAI;AACJ,QAAI;AAEJ,QAAI,MAAM,SAAS,MAAM,UAAU;AACjC,iBAAW,OAAO,gCAAgC,MAAM,WAAW,GAAG;AAAA,IAC1E;AAEE,UAAM,SAAS;AAEf,QAAI,MAAM,aAAa,MAAM;AAC3B,YAAM,SAAS,QAAQ,KAAK;AAAA,IAChC;AAEE,UAAM,MAAM;AACZ,UAAM,SAAS;AACf,UAAM,OAAO;AACb,UAAM,SAAS;AAEf,UAAM,mBAAmB,oBAAoB,wBAC3C,sBAAsB,eACtB,qBAAqB;AAEvB,QAAI,aAAa;AACf,UAAI,oBAAoB,OAAO,MAAM,EAAE,GAAG;AACxC,oBAAY;AAEZ,YAAI,MAAM,aAAa,cAAc;AACnC,yBAAe;AAAA,QACvB,WAAiB,MAAM,eAAe,cAAc;AAC5C,yBAAe;AAAA,QACvB,WAAiB,MAAM,aAAa,cAAc;AAC1C,yBAAe;AAAA,QACvB;AAAA,MACA;AAAA,IACA;AAEE,QAAI,iBAAiB,GAAG;AACtB,aAAO,MAAM;AACX,cAAM,KAAK,MAAM,MAAM,WAAW,MAAM,QAAQ;AAChD,cAAM,gBAAgB,cAAc,KAAK;AAIzC,YAAI,cACE,OAAO,MAAe,MAAM,QAAQ,QACpC,OAAO,MAAe,MAAM,WAAW,OAAQ;AACnD;AAAA,QACR;AAEM,YAAI,CAAC,gBAAgB,KAAK,KAAK,CAAC,mBAAmB,KAAK,GAAG;AACzD;AAAA,QACR;AAEM,YAAI,kBAAkB,MAAM;AAC1B,0BAAgB;AAAA,QACxB;AAEM,YAAI,oBAAoB,OAAO,MAAM,EAAE,GAAG;AACxC,sBAAY;AACZ,kCAAwB;AAExB,cAAI,MAAM,aAAa,cAAc;AACnC,2BAAe;AAAA,UACzB,WAAmB,MAAM,eAAe,cAAc;AAC5C,2BAAe;AAAA,UACzB,WAAmB,MAAM,aAAa,cAAc;AAC1C,2BAAe;AAAA,UACzB;AAAA,QACA,OAAa;AACL,kCAAwB;AAAA,QAChC;AAAA,MACA;AAAA,IACA;AAEE,QAAI,uBAAuB;AACzB,8BAAwB,aAAa;AAAA,IACzC;AAEE,QAAI,iBAAiB,KAAK,sBAAsB,aAAa;AAC3D,UAAI,oBAAoB,eAAe,qBAAqB,aAAa;AACvE,qBAAa;AAAA,MACnB,OAAW;AACL,qBAAa,eAAe;AAAA,MAClC;AAEI,oBAAc,MAAM,WAAW,MAAM;AAErC,UAAI,iBAAiB,GAAG;AACtB,YAAK,0BACA,kBAAkB,OAAO,WAAW,KAAK,iBAAiB,OAAO,aAAa,UAAU,MACzF,mBAAmB,OAAO,UAAU,GAAG;AACzC,uBAAa;AAAA,QACrB,OAAa;AACL,gBAAM,KAAK,MAAM,MAAM,WAAW,MAAM,QAAQ;AAEhD,cAAI,kBAAkB,QAAQ,oBAAoB,CAAC,yBAC/C,OAAO,OAAe,OAAO,MAC7B;AAAA,YACE;AAAA,YACA;AAAA,YACA,cAAc,WAAW,cAAc;AAAA,YACvC;AAAA,UACd,GAAe;AACL,yBAAa;AAAA,UACvB,WAAoB,qBAAqB,gBAAgB,OAAO,UAAU,KAC9D,uBAAuB,OAAO,UAAU,KACxC,uBAAuB,OAAO,UAAU,GAAG;AAC7C,yBAAa;AAAA,UACvB,WAAmB,UAAU,KAAK,GAAG;AAC3B,yBAAa;AAEb,gBAAI,MAAM,QAAQ,QAAQ,MAAM,WAAW,MAAM;AAC/C,yBAAW,OAAO,2CAA2C;AAAA,YACzE;AAAA,UACA,WAAmB,gBAAgB,OAAO,YAAY,oBAAoB,WAAW,GAAG;AAC9E,yBAAa;AAEb,gBAAI,MAAM,QAAQ,MAAM;AACtB,oBAAM,MAAM;AAAA,YACxB;AAAA,UACA;AAEQ,cAAI,MAAM,WAAW,MAAM;AACzB,wBAAY,OAAO,MAAM,QAAQ,MAAM,MAAM;AAAA,UACvD;AAAA,QACA;AAAA,MACA,WAAe,iBAAiB,GAAG;AAG7B,qBAAa,yBAAyB,kBAAkB,OAAO,WAAW;AAAA,MAChF;AAAA,IACA;AAEE,QAAI,MAAM,QAAQ,MAAM;AACtB,UAAI,MAAM,WAAW,MAAM;AACzB,oBAAY,OAAO,MAAM,QAAQ,MAAM,MAAM;AAAA,MACnD;AAAA,IACA,WAAa,MAAM,QAAQ,KAAK;AAO5B,UAAI,MAAM,WAAW,QAAQ,MAAM,SAAS,UAAU;AACpD,mBAAW,OAAO,sEAAsE,MAAM,OAAO,GAAG;AAAA,MAC9G;AAEI,eAAS,YAAY,GAAG,eAAe,MAAM,cAAc,QAAQ,YAAY,cAAc,aAAa,GAAG;AAC3G,QAAAA,QAAO,MAAM,cAAc,SAAS;AAEpC,YAAIA,MAAK,QAAQ,MAAM,MAAM,GAAG;AAC9B,gBAAM,SAASA,MAAK,UAAU,MAAM,MAAM;AAC1C,gBAAM,MAAMA,MAAK;AACjB,cAAI,MAAM,WAAW,MAAM;AACzB,wBAAY,OAAO,MAAM,QAAQ,MAAM,MAAM;AAAA,UACvD;AACQ;AAAA,QACR;AAAA,MACA;AAAA,IACA,WAAa,MAAM,QAAQ,KAAK;AAC5B,UAAI,gBAAgB,KAAK,MAAM,QAAQ,MAAM,QAAQ,UAAU,GAAG,MAAM,GAAG,GAAG;AAC5E,QAAAA,QAAO,MAAM,QAAQ,MAAM,QAAQ,UAAU,EAAE,MAAM,GAAG;AAAA,MAC9D,OAAW;AAEL,QAAAA,QAAO;AACP,cAAM,WAAW,MAAM,QAAQ,MAAM,MAAM,QAAQ,UAAU;AAE7D,iBAAS,YAAY,GAAG,eAAe,SAAS,QAAQ,YAAY,cAAc,aAAa,GAAG;AAChG,cAAI,MAAM,IAAI,MAAM,GAAG,SAAS,SAAS,EAAE,IAAI,MAAM,MAAM,SAAS,SAAS,EAAE,KAAK;AAClF,YAAAA,QAAO,SAAS,SAAS;AACzB;AAAA,UACV;AAAA,QACA;AAAA,MACA;AAEI,UAAI,CAACA,OAAM;AACT,mBAAW,OAAO,mBAAmB,MAAM,MAAM,GAAG;AAAA,MAC1D;AAEI,UAAI,MAAM,WAAW,QAAQA,MAAK,SAAS,MAAM,MAAM;AACrD,mBAAW,OAAO,kCAAkC,MAAM,MAAM,0BAA0BA,MAAK,OAAO,aAAa,MAAM,OAAO,GAAG;AAAA,MACzI;AAEI,UAAI,CAACA,MAAK,QAAQ,MAAM,QAAQ,MAAM,GAAG,GAAG;AAC1C,mBAAW,OAAO,kCAAkC,MAAM,MAAM,gBAAgB;AAAA,MACtF,OAAW;AACL,cAAM,SAASA,MAAK,UAAU,MAAM,QAAQ,MAAM,GAAG;AACrD,YAAI,MAAM,WAAW,MAAM;AACzB,sBAAY,OAAO,MAAM,QAAQ,MAAM,MAAM;AAAA,QACrD;AAAA,MACA;AAAA,IACA;AAEE,QAAI,MAAM,aAAa,MAAM;AAC3B,YAAM,SAAS,SAAS,KAAK;AAAA,IACjC;AAEE,UAAM,SAAS;AACf,WAAO,MAAM,QAAQ,QAAQ,MAAM,WAAW,QAAQ;AAAA,EACxD;AAEA,WAAS,aAAc,OAAO;AAC5B,UAAM,gBAAgB,MAAM;AAC5B,QAAI,gBAAgB;AACpB,QAAI;AAEJ,UAAM,UAAU;AAChB,UAAM,kBAAkB,MAAM;AAC9B,UAAM,SAAS,uBAAO,OAAO,IAAI;AACjC,UAAM,YAAY,uBAAO,OAAO,IAAI;AAEpC,YAAQ,KAAK,MAAM,MAAM,WAAW,MAAM,QAAQ,OAAO,GAAG;AAC1D,0BAAoB,OAAO,MAAM,EAAE;AAEnC,WAAK,MAAM,MAAM,WAAW,MAAM,QAAQ;AAE1C,UAAI,MAAM,aAAa,KAAK,OAAO,IAAa;AAC9C;AAAA,MACN;AAEI,sBAAgB;AAChB,WAAK,MAAM,MAAM,WAAW,EAAE,MAAM,QAAQ;AAC5C,UAAI,YAAY,MAAM;AAEtB,aAAO,OAAO,KAAK,CAAC,UAAU,EAAE,GAAG;AACjC,aAAK,MAAM,MAAM,WAAW,EAAE,MAAM,QAAQ;AAAA,MAClD;AAEI,YAAM,gBAAgB,MAAM,MAAM,MAAM,WAAW,MAAM,QAAQ;AACjE,YAAM,gBAAgB,CAAA;AAEtB,UAAI,cAAc,SAAS,GAAG;AAC5B,mBAAW,OAAO,8DAA8D;AAAA,MACtF;AAEI,aAAO,OAAO,GAAG;AACf,eAAO,aAAa,EAAE,GAAG;AACvB,eAAK,MAAM,MAAM,WAAW,EAAE,MAAM,QAAQ;AAAA,QACpD;AAEM,YAAI,OAAO,IAAa;AACtB,aAAG;AAAE,iBAAK,MAAM,MAAM,WAAW,EAAE,MAAM,QAAQ;AAAA,UAAC,SAC3C,OAAO,KAAK,CAAC,MAAM,EAAE;AAC5B;AAAA,QACR;AAEM,YAAI,MAAM,EAAE,EAAG;AAEf,oBAAY,MAAM;AAElB,eAAO,OAAO,KAAK,CAAC,UAAU,EAAE,GAAG;AACjC,eAAK,MAAM,MAAM,WAAW,EAAE,MAAM,QAAQ;AAAA,QACpD;AAEM,sBAAc,KAAK,MAAM,MAAM,MAAM,WAAW,MAAM,QAAQ,CAAC;AAAA,MACrE;AAEI,UAAI,OAAO,EAAG,eAAc,KAAK;AAEjC,UAAI,gBAAgB,KAAK,mBAAmB,aAAa,GAAG;AAC1D,0BAAkB,aAAa,EAAE,OAAO,eAAe,aAAa;AAAA,MAC1E,OAAW;AACL,qBAAa,OAAO,iCAAiC,gBAAgB,GAAG;AAAA,MAC9E;AAAA,IACA;AAEE,wBAAoB,OAAO,MAAM,EAAE;AAEnC,QAAI,MAAM,eAAe,KACrB,MAAM,MAAM,WAAW,MAAM,QAAQ,MAAM,MAC3C,MAAM,MAAM,WAAW,MAAM,WAAW,CAAC,MAAM,MAC/C,MAAM,MAAM,WAAW,MAAM,WAAW,CAAC,MAAM,IAAa;AAC9D,YAAM,YAAY;AAClB,0BAAoB,OAAO,MAAM,EAAE;AAAA,IACvC,WAAa,eAAe;AACxB,iBAAW,OAAO,iCAAiC;AAAA,IACvD;AAEE,gBAAY,OAAO,MAAM,aAAa,GAAG,mBAAmB,OAAO,IAAI;AACvE,wBAAoB,OAAO,MAAM,EAAE;AAEnC,QAAI,MAAM,mBACN,8BAA8B,KAAK,MAAM,MAAM,MAAM,eAAe,MAAM,QAAQ,CAAC,GAAG;AACxF,mBAAa,OAAO,kDAAkD;AAAA,IAC1E;AAEE,UAAM,UAAU,KAAK,MAAM,MAAM;AAEjC,QAAI,MAAM,aAAa,MAAM,aAAa,sBAAsB,KAAK,GAAG;AACtE,UAAI,MAAM,MAAM,WAAW,MAAM,QAAQ,MAAM,IAAa;AAC1D,cAAM,YAAY;AAClB,4BAAoB,OAAO,MAAM,EAAE;AAAA,MACzC;AACI;AAAA,IACJ;AAEE,QAAI,MAAM,WAAY,MAAM,SAAS,GAAI;AACvC,iBAAW,OAAO,uDAAuD;AAAA,IAC7E;AAAA,EACA;AAEA,WAAS,cAAe,OAAO,SAAS;AACtC,YAAQ,OAAO,KAAK;AACpB,cAAU,WAAW,CAAA;AAErB,QAAI,MAAM,WAAW,GAAG;AAEtB,UAAI,MAAM,WAAW,MAAM,SAAS,CAAC,MAAM,MACvC,MAAM,WAAW,MAAM,SAAS,CAAC,MAAM,IAAc;AACvD,iBAAS;AAAA,MACf;AAGI,UAAI,MAAM,WAAW,CAAC,MAAM,OAAQ;AAClC,gBAAQ,MAAM,MAAM,CAAC;AAAA,MAC3B;AAAA,IACA;AAEE,UAAM,QAAQ,IAAI,MAAM,OAAO,OAAO;AAEtC,UAAM,UAAU,MAAM,QAAQ,IAAI;AAElC,QAAI,YAAY,IAAI;AAClB,YAAM,WAAW;AACjB,iBAAW,OAAO,mCAAmC;AAAA,IACzD;AAGE,UAAM,SAAS;AAEf,WAAO,MAAM,MAAM,WAAW,MAAM,QAAQ,MAAM,IAAiB;AACjE,YAAM,cAAc;AACpB,YAAM,YAAY;AAAA,IACtB;AAEE,WAAO,MAAM,WAAY,MAAM,SAAS,GAAI;AAC1C,mBAAa,KAAK;AAAA,IACtB;AAEE,WAAO,MAAM;AAAA,EACf;AAEA,WAASQ,SAAS,OAAO,UAAU,SAAS;AAC1C,QAAI,aAAa,QAAQ,OAAO,aAAa,YAAY,OAAO,YAAY,aAAa;AACvF,gBAAU;AACV,iBAAW;AAAA,IACf;AAEE,UAAM,YAAY,cAAc,OAAO,OAAO;AAE9C,QAAI,OAAO,aAAa,YAAY;AAClC,aAAO;AAAA,IACX;AAEE,aAAS,QAAQ,GAAG,SAAS,UAAU,QAAQ,QAAQ,QAAQ,SAAS,GAAG;AACzE,eAAS,UAAU,KAAK,CAAC;AAAA,IAC7B;AAAA,EACA;AAEA,WAASC,MAAM,OAAO,SAAS;AAC7B,UAAM,YAAY,cAAc,OAAO,OAAO;AAE9C,QAAI,UAAU,WAAW,GAAG;AAC1B,aAAO;AAAA,IACX,WAAa,UAAU,WAAW,GAAG;AACjC,aAAO,UAAU,CAAC;AAAA,IACtB;AACE,UAAM,IAAIjB,eAAc,0DAA0D;AAAA,EACpF;AAEA,SAAA,UAAyBgB;AACzB,SAAA,OAAsBC;;;;;;;;AC3vDtB,QAAMhB,UAASC,cAAA;AACf,QAAMF,iBAAgBM,iBAAA;AACtB,QAAMS,kBAAiBL,gBAAA;AAEvB,QAAM,YAAY,OAAO,UAAU;AACnC,QAAM,kBAAkB,OAAO,UAAU;AAEzC,QAAM,WAAW;AACjB,QAAM,WAAW;AACjB,QAAM,iBAAiB;AACvB,QAAM,uBAAuB;AAC7B,QAAM,aAAa;AACnB,QAAM,mBAAmB;AACzB,QAAM,oBAAoB;AAC1B,QAAM,aAAa;AACnB,QAAM,eAAe;AACrB,QAAM,iBAAiB;AACvB,QAAM,oBAAoB;AAC1B,QAAM,gBAAgB;AACtB,QAAM,aAAa;AACnB,QAAM,aAAa;AACnB,QAAM,aAAa;AACnB,QAAM,cAAc;AACpB,QAAM,oBAAoB;AAC1B,QAAM,gBAAgB;AACtB,QAAM,qBAAqB;AAC3B,QAAM,2BAA2B;AACjC,QAAM,4BAA4B;AAClC,QAAM,oBAAoB;AAC1B,QAAM,0BAA0B;AAChC,QAAM,qBAAqB;AAC3B,QAAM,2BAA2B;AAEjC,QAAM,mBAAmB,CAAA;AAEzB,mBAAiB,CAAI,IAAI;AACzB,mBAAiB,CAAI,IAAI;AACzB,mBAAiB,CAAI,IAAI;AACzB,mBAAiB,CAAI,IAAI;AACzB,mBAAiB,EAAI,IAAI;AACzB,mBAAiB,EAAI,IAAI;AACzB,mBAAiB,EAAI,IAAI;AACzB,mBAAiB,EAAI,IAAI;AACzB,mBAAiB,EAAI,IAAI;AACzB,mBAAiB,EAAI,IAAI;AACzB,mBAAiB,EAAI,IAAI;AACzB,mBAAiB,GAAI,IAAI;AACzB,mBAAiB,GAAI,IAAI;AACzB,mBAAiB,IAAM,IAAI;AAC3B,mBAAiB,IAAM,IAAI;AAE3B,QAAM,6BAA6B;AAAA,IACjC;AAAA,IAAK;AAAA,IAAK;AAAA,IAAO;AAAA,IAAO;AAAA,IAAO;AAAA,IAAM;AAAA,IAAM;AAAA,IAC3C;AAAA,IAAK;AAAA,IAAK;AAAA,IAAM;AAAA,IAAM;AAAA,IAAM;AAAA,IAAO;AAAA,IAAO;AAAA,EAC5C;AAEA,QAAM,2BAA2B;AAEjC,WAAS,gBAAiBH,SAAQH,MAAK;AACrC,QAAIA,SAAQ,KAAM,QAAO,CAAA;AAEzB,UAAM,SAAS,CAAA;AACf,UAAM,OAAO,OAAO,KAAKA,IAAG;AAE5B,aAAS,QAAQ,GAAG,SAAS,KAAK,QAAQ,QAAQ,QAAQ,SAAS,GAAG;AACpE,UAAI,MAAM,KAAK,KAAK;AACpB,UAAI,QAAQ,OAAOA,KAAI,GAAG,CAAC;AAE3B,UAAI,IAAI,MAAM,GAAG,CAAC,MAAM,MAAM;AAC5B,cAAM,uBAAuB,IAAI,MAAM,CAAC;AAAA,MAC9C;AACI,YAAMI,QAAOD,QAAO,gBAAgB,UAAU,EAAE,GAAG;AAEnD,UAAIC,SAAQ,gBAAgB,KAAKA,MAAK,cAAc,KAAK,GAAG;AAC1D,gBAAQA,MAAK,aAAa,KAAK;AAAA,MACrC;AAEI,aAAO,GAAG,IAAI;AAAA,IAClB;AAEE,WAAO;AAAA,EACT;AAEA,WAAS,UAAW,WAAW;AAC7B,QAAI;AACJ,QAAI;AAEJ,UAAM,SAAS,UAAU,SAAS,EAAE,EAAE,YAAW;AAEjD,QAAI,aAAa,KAAM;AACrB,eAAS;AACT,eAAS;AAAA,IACb,WAAa,aAAa,OAAQ;AAC9B,eAAS;AACT,eAAS;AAAA,IACb,WAAa,aAAa,YAAY;AAClC,eAAS;AACT,eAAS;AAAA,IACb,OAAS;AACL,YAAM,IAAIR,eAAc,+DAA+D;AAAA,IAC3F;AAEE,WAAO,OAAO,SAASC,QAAO,OAAO,KAAK,SAAS,OAAO,MAAM,IAAI;AAAA,EACtE;AAEA,QAAM,sBAAsB;AAC5B,QAAM,sBAAsB;AAE5B,WAAS,MAAO,SAAS;AACvB,SAAK,SAAS,QAAQ,QAAQ,KAAKc;AACnC,SAAK,SAAS,KAAK,IAAI,GAAI,QAAQ,QAAQ,KAAK,CAAC;AACjD,SAAK,gBAAgB,QAAQ,eAAe,KAAK;AACjD,SAAK,cAAc,QAAQ,aAAa,KAAK;AAC7C,SAAK,YAAad,QAAO,UAAU,QAAQ,WAAW,CAAC,IAAI,KAAK,QAAQ,WAAW;AACnF,SAAK,WAAW,gBAAgB,KAAK,QAAQ,QAAQ,QAAQ,KAAK,IAAI;AACtE,SAAK,WAAW,QAAQ,UAAU,KAAK;AACvC,SAAK,YAAY,QAAQ,WAAW,KAAK;AACzC,SAAK,SAAS,QAAQ,QAAQ,KAAK;AACnC,SAAK,eAAe,QAAQ,cAAc,KAAK;AAC/C,SAAK,eAAe,QAAQ,cAAc,KAAK;AAC/C,SAAK,cAAc,QAAQ,aAAa,MAAM,MAAM,sBAAsB;AAC1E,SAAK,cAAc,QAAQ,aAAa,KAAK;AAC7C,SAAK,WAAW,OAAO,QAAQ,UAAU,MAAM,aAAa,QAAQ,UAAU,IAAI;AAElF,SAAK,gBAAgB,KAAK,OAAO;AACjC,SAAK,gBAAgB,KAAK,OAAO;AAEjC,SAAK,MAAM;AACX,SAAK,SAAS;AAEd,SAAK,aAAa,CAAA;AAClB,SAAK,iBAAiB;AAAA,EACxB;AAGA,WAAS,aAAc,QAAQ,QAAQ;AACrC,UAAM,MAAMA,QAAO,OAAO,KAAK,MAAM;AACrC,QAAI,WAAW;AACf,QAAI,SAAS;AACb,UAAM,SAAS,OAAO;AAEtB,WAAO,WAAW,QAAQ;AACxB,UAAI;AACJ,YAAM,OAAO,OAAO,QAAQ,MAAM,QAAQ;AAC1C,UAAI,SAAS,IAAI;AACf,eAAO,OAAO,MAAM,QAAQ;AAC5B,mBAAW;AAAA,MACjB,OAAW;AACL,eAAO,OAAO,MAAM,UAAU,OAAO,CAAC;AACtC,mBAAW,OAAO;AAAA,MACxB;AAEI,UAAI,KAAK,UAAU,SAAS,KAAM,WAAU;AAE5C,gBAAU;AAAA,IACd;AAEE,WAAO;AAAA,EACT;AAEA,WAAS,iBAAkB,OAAO,OAAO;AACvC,WAAO,OAAOA,QAAO,OAAO,KAAK,MAAM,SAAS,KAAK;AAAA,EACvD;AAEA,WAAS,sBAAuB,OAAOiB,MAAK;AAC1C,aAAS,QAAQ,GAAG,SAAS,MAAM,cAAc,QAAQ,QAAQ,QAAQ,SAAS,GAAG;AACnF,YAAMV,QAAO,MAAM,cAAc,KAAK;AAEtC,UAAIA,MAAK,QAAQU,IAAG,GAAG;AACrB,eAAO;AAAA,MACb;AAAA,IACA;AAEE,WAAO;AAAA,EACT;AAGA,WAAS,aAAc,GAAG;AACxB,WAAO,MAAM,cAAc,MAAM;AAAA,EACnC;AAMA,WAAS,YAAa,GAAG;AACvB,WAAQ,KAAK,MAAW,KAAK,OACzB,KAAK,OAAW,KAAK,SAAa,MAAM,QAAU,MAAM,QACxD,KAAK,SAAW,KAAK,SAAa,MAAM,YACzC,KAAK,SAAW,KAAK;AAAA,EAC1B;AAOA,WAAS,qBAAsB,GAAG;AAChC,WAAO,YAAY,CAAC,KAClB,MAAM;AAAA,IAEN,MAAM,wBACN,MAAM;AAAA,EACV;AAWA,WAAS,YAAa,GAAG,MAAM,SAAS;AACtC,UAAM,wBAAwB,qBAAqB,CAAC;AACpD,UAAM,YAAY,yBAAyB,CAAC,aAAa,CAAC;AAC1D;AAAA;AAAA,OAGI,UACI,wBACA;AAAA,MAEA,MAAM,cACN,MAAM,4BACN,MAAM,6BACN,MAAM,2BACN,MAAM;AAAA,MAGZ,MAAM;AAAA,MACN,EAAE,SAAS,cAAc,CAAC;AAAA,MAE3B,qBAAqB,IAAI,KAAK,CAAC,aAAa,IAAI,KAAK,MAAM;AAAA,MAC3D,SAAS,cAAc;AAAA;AAAA,EAC1B;AAGA,WAAS,iBAAkB,GAAG;AAI5B,WAAO,YAAY,CAAC,KAClB,MAAM,YACN,CAAC,aAAa,CAAC;AAAA;AAAA;AAAA,IAGf,MAAM,cACN,MAAM,iBACN,MAAM,cACN,MAAM,cACN,MAAM,4BACN,MAAM,6BACN,MAAM,2BACN,MAAM;AAAA,IAEN,MAAM,cACN,MAAM,kBACN,MAAM,iBACN,MAAM,oBACN,MAAM,sBACN,MAAM,eACN,MAAM,qBACN,MAAM,qBACN,MAAM;AAAA,IAEN,MAAM,gBACN,MAAM,sBACN,MAAM;AAAA,EACV;AAGA,WAAS,gBAAiB,GAAG;AAE3B,WAAO,CAAC,aAAa,CAAC,KAAK,MAAM;AAAA,EACnC;AAGA,WAAS,YAAa,QAAQ,KAAK;AACjC,UAAM,QAAQ,OAAO,WAAW,GAAG;AACnC,QAAI;AAEJ,QAAI,SAAS,SAAU,SAAS,SAAU,MAAM,IAAI,OAAO,QAAQ;AACjE,eAAS,OAAO,WAAW,MAAM,CAAC;AAClC,UAAI,UAAU,SAAU,UAAU,OAAQ;AAExC,gBAAQ,QAAQ,SAAU,OAAQ,SAAS,QAAS;AAAA,MAC1D;AAAA,IACA;AACE,WAAO;AAAA,EACT;AAGA,WAAS,oBAAqB,QAAQ;AACpC,UAAM,iBAAiB;AACvB,WAAO,eAAe,KAAK,MAAM;AAAA,EACnC;AAEA,QAAM,cAAc;AACpB,QAAM,eAAe;AACrB,QAAM,gBAAgB;AACtB,QAAM,eAAe;AACrB,QAAM,eAAe;AASrB,WAAS,kBAAmB,QAAQ,gBAAgB,gBAAgB,WAClE,mBAAmB,aAAa,aAAa,SAAS;AACtD,QAAI;AACJ,QAAI,OAAO;AACX,QAAI,WAAW;AACf,QAAI,eAAe;AACnB,QAAI,kBAAkB;AACtB,UAAM,mBAAmB,cAAc;AACvC,QAAI,oBAAoB;AACxB,QAAI,QAAQ,iBAAiB,YAAY,QAAQ,CAAC,CAAC,KACjD,gBAAgB,YAAY,QAAQ,OAAO,SAAS,CAAC,CAAC;AAExD,QAAI,kBAAkB,aAAa;AAGjC,WAAK,IAAI,GAAG,IAAI,OAAO,QAAQ,QAAQ,QAAU,KAAK,IAAI,KAAK;AAC7D,eAAO,YAAY,QAAQ,CAAC;AAC5B,YAAI,CAAC,YAAY,IAAI,GAAG;AACtB,iBAAO;AAAA,QACf;AACM,gBAAQ,SAAS,YAAY,MAAM,UAAU,OAAO;AACpD,mBAAW;AAAA,MACjB;AAAA,IACA,OAAS;AAEL,WAAK,IAAI,GAAG,IAAI,OAAO,QAAQ,QAAQ,QAAU,KAAK,IAAI,KAAK;AAC7D,eAAO,YAAY,QAAQ,CAAC;AAC5B,YAAI,SAAS,gBAAgB;AAC3B,yBAAe;AAEf,cAAI,kBAAkB;AACpB,8BAAkB;AAAA,YAEf,IAAI,oBAAoB,IAAI,aAC5B,OAAO,oBAAoB,CAAC,MAAM;AACrC,gCAAoB;AAAA,UAC9B;AAAA,QACA,WAAiB,CAAC,YAAY,IAAI,GAAG;AAC7B,iBAAO;AAAA,QACf;AACM,gBAAQ,SAAS,YAAY,MAAM,UAAU,OAAO;AACpD,mBAAW;AAAA,MACjB;AAEI,wBAAkB,mBAAoB,qBACnC,IAAI,oBAAoB,IAAI,aAC5B,OAAO,oBAAoB,CAAC,MAAM;AAAA,IACzC;AAIE,QAAI,CAAC,gBAAgB,CAAC,iBAAiB;AAGrC,UAAI,SAAS,CAAC,eAAe,CAAC,kBAAkB,MAAM,GAAG;AACvD,eAAO;AAAA,MACb;AACI,aAAO,gBAAgB,sBAAsB,eAAe;AAAA,IAChE;AAEE,QAAI,iBAAiB,KAAK,oBAAoB,MAAM,GAAG;AACrD,aAAO;AAAA,IACX;AAGE,QAAI,CAAC,aAAa;AAChB,aAAO,kBAAkB,eAAe;AAAA,IAC5C;AACE,WAAO,gBAAgB,sBAAsB,eAAe;AAAA,EAC9D;AAQA,WAAS,YAAa,OAAO,QAAQ,OAAO,OAAO,SAAS;AAC1D,UAAM,QAAQ,WAAY;AACxB,UAAI,OAAO,WAAW,GAAG;AACvB,eAAO,MAAM,gBAAgB,sBAAsB,OAAO;AAAA,MAChE;AACI,UAAI,CAAC,MAAM,cAAc;AACvB,YAAI,2BAA2B,QAAQ,MAAM,MAAM,MAAM,yBAAyB,KAAK,MAAM,GAAG;AAC9F,iBAAO,MAAM,gBAAgB,sBAAuB,MAAM,SAAS,MAAQ,MAAM,SAAS;AAAA,QAClG;AAAA,MACA;AAEI,YAAM,SAAS,MAAM,SAAS,KAAK,IAAI,GAAG,KAAK;AAQ/C,YAAM,YAAa,MAAM,cAAc,KACnC,KACA,KAAK,IAAI,KAAK,IAAI,MAAM,WAAW,EAAE,GAAG,MAAM,YAAY,MAAM;AAGpE,YAAM,iBAAiB;AAAA,MAEpB,MAAM,YAAY,MAAM,SAAS,MAAM;AAC1C,eAAS,cAAeC,SAAQ;AAC9B,eAAO,sBAAsB,OAAOA,OAAM;AAAA,MAChD;AAEI,cAAQ;AAAA,QAAkB;AAAA,QAAQ;AAAA,QAAgB,MAAM;AAAA,QAAQ;AAAA,QAC9D;AAAA,QAAe,MAAM;AAAA,QAAa,MAAM,eAAe,CAAC;AAAA,QAAO;AAAA,MAAO,GAAC;AAAA,QACvE,KAAK;AACH,iBAAO;AAAA,QACT,KAAK;AACH,iBAAO,MAAM,OAAO,QAAQ,MAAM,IAAI,IAAI;AAAA,QAC5C,KAAK;AACH,iBAAO,MAAM,YAAY,QAAQ,MAAM,MAAM,IAC3C,kBAAkB,aAAa,QAAQ,MAAM,CAAC;AAAA,QAClD,KAAK;AACH,iBAAO,MAAM,YAAY,QAAQ,MAAM,MAAM,IAC3C,kBAAkB,aAAa,WAAW,QAAQ,SAAS,GAAG,MAAM,CAAC;AAAA,QACzE,KAAK;AACH,iBAAO,MAAM,aAAa,MAAiB,IAAI;AAAA,QACjD;AACE,gBAAM,IAAInB,eAAc,wCAAwC;AAAA,MACxE;AAAA,IACA,GAAG;AAAA,EACH;AAGA,WAAS,YAAa,QAAQ,gBAAgB;AAC5C,UAAM,kBAAkB,oBAAoB,MAAM,IAAI,OAAO,cAAc,IAAI;AAG/E,UAAM,OAAO,OAAO,OAAO,SAAS,CAAC,MAAM;AAC3C,UAAM,OAAO,SAAS,OAAO,OAAO,SAAS,CAAC,MAAM,QAAQ,WAAW;AACvE,UAAM,QAAQ,OAAO,MAAO,OAAO,KAAK;AAExC,WAAO,kBAAkB,QAAQ;AAAA,EACnC;AAGA,WAAS,kBAAmB,QAAQ;AAClC,WAAO,OAAO,OAAO,SAAS,CAAC,MAAM,OAAO,OAAO,MAAM,GAAG,EAAE,IAAI;AAAA,EACpE;AAIA,WAAS,WAAY,QAAQ,OAAO;AAKlC,UAAM,SAAS;AAGf,QAAI,UAAU,WAAY;AACxB,UAAI,SAAS,OAAO,QAAQ,IAAI;AAChC,eAAS,WAAW,KAAK,SAAS,OAAO;AACzC,aAAO,YAAY;AACnB,aAAO,SAAS,OAAO,MAAM,GAAG,MAAM,GAAG,KAAK;AAAA,IAClD,GAAG;AAED,QAAI,mBAAmB,OAAO,CAAC,MAAM,QAAQ,OAAO,CAAC,MAAM;AAC3D,QAAI;AAGJ,QAAI;AACJ,WAAQ,QAAQ,OAAO,KAAK,MAAM,GAAI;AACpC,YAAM,SAAS,MAAM,CAAC;AACtB,YAAM,OAAO,MAAM,CAAC;AAEpB,qBAAgB,KAAK,CAAC,MAAM;AAC5B,gBAAU,UACN,CAAC,oBAAoB,CAAC,gBAAgB,SAAS,KAAM,OAAO,MAC9D,SAAS,MAAM,KAAK;AACtB,yBAAmB;AAAA,IACvB;AAEE,WAAO;AAAA,EACT;AAMA,WAAS,SAAU,MAAM,OAAO;AAC9B,QAAI,SAAS,MAAM,KAAK,CAAC,MAAM,IAAK,QAAO;AAG3C,UAAM,UAAU;AAChB,QAAI;AAEJ,QAAI,QAAQ;AACZ,QAAI;AACJ,QAAI,OAAO;AACX,QAAI,OAAO;AACX,QAAI,SAAS;AAMb,WAAQ,QAAQ,QAAQ,KAAK,IAAI,GAAI;AACnC,aAAO,MAAM;AAEb,UAAI,OAAO,QAAQ,OAAO;AACxB,cAAO,OAAO,QAAS,OAAO;AAC9B,kBAAU,OAAO,KAAK,MAAM,OAAO,GAAG;AAEtC,gBAAQ,MAAM;AAAA,MACpB;AACI,aAAO;AAAA,IACX;AAIE,cAAU;AAEV,QAAI,KAAK,SAAS,QAAQ,SAAS,OAAO,OAAO;AAC/C,gBAAU,KAAK,MAAM,OAAO,IAAI,IAAI,OAAO,KAAK,MAAM,OAAO,CAAC;AAAA,IAClE,OAAS;AACL,gBAAU,KAAK,MAAM,KAAK;AAAA,IAC9B;AAEE,WAAO,OAAO,MAAM,CAAC;AAAA,EACvB;AAGA,WAAS,aAAc,QAAQ;AAC7B,QAAI,SAAS;AACb,QAAI,OAAO;AAEX,aAAS,IAAI,GAAG,IAAI,OAAO,QAAQ,QAAQ,QAAU,KAAK,IAAI,KAAK;AACjE,aAAO,YAAY,QAAQ,CAAC;AAC5B,YAAM,YAAY,iBAAiB,IAAI;AAEvC,UAAI,CAAC,aAAa,YAAY,IAAI,GAAG;AACnC,kBAAU,OAAO,CAAC;AAClB,YAAI,QAAQ,MAAS,WAAU,OAAO,IAAI,CAAC;AAAA,MACjD,OAAW;AACL,kBAAU,aAAa,UAAU,IAAI;AAAA,MAC3C;AAAA,IACA;AAEE,WAAO;AAAA,EACT;AAEA,WAAS,kBAAmB,OAAO,OAAO,QAAQ;AAChD,QAAI,UAAU;AACd,UAAM,OAAO,MAAM;AAEnB,aAAS,QAAQ,GAAG,SAAS,OAAO,QAAQ,QAAQ,QAAQ,SAAS,GAAG;AACtE,UAAI,QAAQ,OAAO,KAAK;AAExB,UAAI,MAAM,UAAU;AAClB,gBAAQ,MAAM,SAAS,KAAK,QAAQ,OAAO,KAAK,GAAG,KAAK;AAAA,MAC9D;AAGI,UAAI,UAAU,OAAO,OAAO,OAAO,OAAO,KAAK,KAC1C,OAAO,UAAU,eACjB,UAAU,OAAO,OAAO,MAAM,OAAO,KAAK,GAAI;AACjD,YAAI,YAAY,GAAI,YAAW,OAAO,CAAC,MAAM,eAAe,MAAM;AAClE,mBAAW,MAAM;AAAA,MACvB;AAAA,IACA;AAEE,UAAM,MAAM;AACZ,UAAM,OAAO,MAAM,UAAU;AAAA,EAC/B;AAEA,WAAS,mBAAoB,OAAO,OAAO,QAAQ,SAAS;AAC1D,QAAI,UAAU;AACd,UAAM,OAAO,MAAM;AAEnB,aAAS,QAAQ,GAAG,SAAS,OAAO,QAAQ,QAAQ,QAAQ,SAAS,GAAG;AACtE,UAAI,QAAQ,OAAO,KAAK;AAExB,UAAI,MAAM,UAAU;AAClB,gBAAQ,MAAM,SAAS,KAAK,QAAQ,OAAO,KAAK,GAAG,KAAK;AAAA,MAC9D;AAGI,UAAI,UAAU,OAAO,QAAQ,GAAG,OAAO,MAAM,MAAM,OAAO,IAAI,KACzD,OAAO,UAAU,eACjB,UAAU,OAAO,QAAQ,GAAG,MAAM,MAAM,MAAM,OAAO,IAAI,GAAI;AAChE,YAAI,CAAC,WAAW,YAAY,IAAI;AAC9B,qBAAW,iBAAiB,OAAO,KAAK;AAAA,QAChD;AAEM,YAAI,MAAM,QAAQ,mBAAmB,MAAM,KAAK,WAAW,CAAC,GAAG;AAC7D,qBAAW;AAAA,QACnB,OAAa;AACL,qBAAW;AAAA,QACnB;AAEM,mBAAW,MAAM;AAAA,MACvB;AAAA,IACA;AAEE,UAAM,MAAM;AACZ,UAAM,OAAO,WAAW;AAAA,EAC1B;AAEA,WAAS,iBAAkB,OAAO,OAAO,QAAQ;AAC/C,QAAI,UAAU;AACd,UAAM,OAAO,MAAM;AACnB,UAAM,gBAAgB,OAAO,KAAK,MAAM;AAExC,aAAS,QAAQ,GAAG,SAAS,cAAc,QAAQ,QAAQ,QAAQ,SAAS,GAAG;AAC7E,UAAI,aAAa;AACjB,UAAI,YAAY,GAAI,eAAc;AAElC,UAAI,MAAM,aAAc,eAAc;AAEtC,YAAM,YAAY,cAAc,KAAK;AACrC,UAAI,cAAc,OAAO,SAAS;AAElC,UAAI,MAAM,UAAU;AAClB,sBAAc,MAAM,SAAS,KAAK,QAAQ,WAAW,WAAW;AAAA,MACtE;AAEI,UAAI,CAAC,UAAU,OAAO,OAAO,WAAW,OAAO,KAAK,GAAG;AACrD;AAAA,MACN;AAEI,UAAI,MAAM,KAAK,SAAS,KAAM,eAAc;AAE5C,oBAAc,MAAM,QAAQ,MAAM,eAAe,MAAM,MAAM,OAAO,MAAM,eAAe,KAAK;AAE9F,UAAI,CAAC,UAAU,OAAO,OAAO,aAAa,OAAO,KAAK,GAAG;AACvD;AAAA,MACN;AAEI,oBAAc,MAAM;AAGpB,iBAAW;AAAA,IACf;AAEE,UAAM,MAAM;AACZ,UAAM,OAAO,MAAM,UAAU;AAAA,EAC/B;AAEA,WAAS,kBAAmB,OAAO,OAAO,QAAQ,SAAS;AACzD,QAAI,UAAU;AACd,UAAM,OAAO,MAAM;AACnB,UAAM,gBAAgB,OAAO,KAAK,MAAM;AAGxC,QAAI,MAAM,aAAa,MAAM;AAE3B,oBAAc,KAAI;AAAA,IACtB,WAAa,OAAO,MAAM,aAAa,YAAY;AAE/C,oBAAc,KAAK,MAAM,QAAQ;AAAA,IACrC,WAAa,MAAM,UAAU;AAEzB,YAAM,IAAIA,eAAc,0CAA0C;AAAA,IACtE;AAEE,aAAS,QAAQ,GAAG,SAAS,cAAc,QAAQ,QAAQ,QAAQ,SAAS,GAAG;AAC7E,UAAI,aAAa;AAEjB,UAAI,CAAC,WAAW,YAAY,IAAI;AAC9B,sBAAc,iBAAiB,OAAO,KAAK;AAAA,MACjD;AAEI,YAAM,YAAY,cAAc,KAAK;AACrC,UAAI,cAAc,OAAO,SAAS;AAElC,UAAI,MAAM,UAAU;AAClB,sBAAc,MAAM,SAAS,KAAK,QAAQ,WAAW,WAAW;AAAA,MACtE;AAEI,UAAI,CAAC,UAAU,OAAO,QAAQ,GAAG,WAAW,MAAM,MAAM,IAAI,GAAG;AAC7D;AAAA,MACN;AAEI,YAAM,eAAgB,MAAM,QAAQ,QAAQ,MAAM,QAAQ,OAC1C,MAAM,QAAQ,MAAM,KAAK,SAAS;AAElD,UAAI,cAAc;AAChB,YAAI,MAAM,QAAQ,mBAAmB,MAAM,KAAK,WAAW,CAAC,GAAG;AAC7D,wBAAc;AAAA,QACtB,OAAa;AACL,wBAAc;AAAA,QACtB;AAAA,MACA;AAEI,oBAAc,MAAM;AAEpB,UAAI,cAAc;AAChB,sBAAc,iBAAiB,OAAO,KAAK;AAAA,MACjD;AAEI,UAAI,CAAC,UAAU,OAAO,QAAQ,GAAG,aAAa,MAAM,YAAY,GAAG;AACjE;AAAA,MACN;AAEI,UAAI,MAAM,QAAQ,mBAAmB,MAAM,KAAK,WAAW,CAAC,GAAG;AAC7D,sBAAc;AAAA,MACpB,OAAW;AACL,sBAAc;AAAA,MACpB;AAEI,oBAAc,MAAM;AAGpB,iBAAW;AAAA,IACf;AAEE,UAAM,MAAM;AACZ,UAAM,OAAO,WAAW;AAAA,EAC1B;AAEA,WAAS,WAAY,OAAO,QAAQ,UAAU;AAC5C,UAAM,WAAW,WAAW,MAAM,gBAAgB,MAAM;AAExD,aAAS,QAAQ,GAAG,SAAS,SAAS,QAAQ,QAAQ,QAAQ,SAAS,GAAG;AACxE,YAAMQ,QAAO,SAAS,KAAK;AAE3B,WAAKA,MAAK,cAAcA,MAAK,eACxB,CAACA,MAAK,cAAgB,OAAO,WAAW,YAAc,kBAAkBA,MAAK,gBAC7E,CAACA,MAAK,aAAaA,MAAK,UAAU,MAAM,IAAI;AAC/C,YAAI,UAAU;AACZ,cAAIA,MAAK,SAASA,MAAK,eAAe;AACpC,kBAAM,MAAMA,MAAK,cAAc,MAAM;AAAA,UAC/C,OAAe;AACL,kBAAM,MAAMA,MAAK;AAAA,UAC3B;AAAA,QACA,OAAa;AACL,gBAAM,MAAM;AAAA,QACpB;AAEM,YAAIA,MAAK,WAAW;AAClB,gBAAM,QAAQ,MAAM,SAASA,MAAK,GAAG,KAAKA,MAAK;AAE/C,cAAI;AACJ,cAAI,UAAU,KAAKA,MAAK,SAAS,MAAM,qBAAqB;AAC1D,sBAAUA,MAAK,UAAU,QAAQ,KAAK;AAAA,UAChD,WAAmB,gBAAgB,KAAKA,MAAK,WAAW,KAAK,GAAG;AACtD,sBAAUA,MAAK,UAAU,KAAK,EAAE,QAAQ,KAAK;AAAA,UACvD,OAAe;AACL,kBAAM,IAAIR,eAAc,OAAOQ,MAAK,MAAM,iCAAiC,QAAQ,SAAS;AAAA,UACtG;AAEQ,gBAAM,OAAO;AAAA,QACrB;AAEM,eAAO;AAAA,MACb;AAAA,IACA;AAEE,WAAO;AAAA,EACT;AAKA,WAAS,UAAW,OAAO,OAAO,QAAQ,OAAO,SAAS,OAAO,YAAY;AAC3E,UAAM,MAAM;AACZ,UAAM,OAAO;AAEb,QAAI,CAAC,WAAW,OAAO,QAAQ,KAAK,GAAG;AACrC,iBAAW,OAAO,QAAQ,IAAI;AAAA,IAClC;AAEE,UAAMA,QAAO,UAAU,KAAK,MAAM,IAAI;AACtC,UAAM,UAAU;AAEhB,QAAI,OAAO;AACT,cAAS,MAAM,YAAY,KAAK,MAAM,YAAY;AAAA,IACtD;AAEE,UAAM,gBAAgBA,UAAS,qBAAqBA,UAAS;AAC7D,QAAI;AACJ,QAAI;AAEJ,QAAI,eAAe;AACjB,uBAAiB,MAAM,WAAW,QAAQ,MAAM;AAChD,kBAAY,mBAAmB;AAAA,IACnC;AAEE,QAAK,MAAM,QAAQ,QAAQ,MAAM,QAAQ,OAAQ,aAAc,MAAM,WAAW,KAAK,QAAQ,GAAI;AAC/F,gBAAU;AAAA,IACd;AAEE,QAAI,aAAa,MAAM,eAAe,cAAc,GAAG;AACrD,YAAM,OAAO,UAAU;AAAA,IAC3B,OAAS;AACL,UAAI,iBAAiB,aAAa,CAAC,MAAM,eAAe,cAAc,GAAG;AACvE,cAAM,eAAe,cAAc,IAAI;AAAA,MAC7C;AACI,UAAIA,UAAS,mBAAmB;AAC9B,YAAI,SAAU,OAAO,KAAK,MAAM,IAAI,EAAE,WAAW,GAAI;AACnD,4BAAkB,OAAO,OAAO,MAAM,MAAM,OAAO;AACnD,cAAI,WAAW;AACb,kBAAM,OAAO,UAAU,iBAAiB,MAAM;AAAA,UACxD;AAAA,QACA,OAAa;AACL,2BAAiB,OAAO,OAAO,MAAM,IAAI;AACzC,cAAI,WAAW;AACb,kBAAM,OAAO,UAAU,iBAAiB,MAAM,MAAM;AAAA,UAC9D;AAAA,QACA;AAAA,MACA,WAAeA,UAAS,kBAAkB;AACpC,YAAI,SAAU,MAAM,KAAK,WAAW,GAAI;AACtC,cAAI,MAAM,iBAAiB,CAAC,cAAc,QAAQ,GAAG;AACnD,+BAAmB,OAAO,QAAQ,GAAG,MAAM,MAAM,OAAO;AAAA,UAClE,OAAe;AACL,+BAAmB,OAAO,OAAO,MAAM,MAAM,OAAO;AAAA,UAC9D;AACQ,cAAI,WAAW;AACb,kBAAM,OAAO,UAAU,iBAAiB,MAAM;AAAA,UACxD;AAAA,QACA,OAAa;AACL,4BAAkB,OAAO,OAAO,MAAM,IAAI;AAC1C,cAAI,WAAW;AACb,kBAAM,OAAO,UAAU,iBAAiB,MAAM,MAAM;AAAA,UAC9D;AAAA,QACA;AAAA,MACA,WAAeA,UAAS,mBAAmB;AACrC,YAAI,MAAM,QAAQ,KAAK;AACrB,sBAAY,OAAO,MAAM,MAAM,OAAO,OAAO,OAAO;AAAA,QAC5D;AAAA,MACA,WAAeA,UAAS,sBAAsB;AACxC,eAAO;AAAA,MACb,OAAW;AACL,YAAI,MAAM,YAAa,QAAO;AAC9B,cAAM,IAAIR,eAAc,4CAA4CQ,KAAI;AAAA,MAC9E;AAEI,UAAI,MAAM,QAAQ,QAAQ,MAAM,QAAQ,KAAK;AAc3C,YAAI,SAAS;AAAA,UACX,MAAM,IAAI,CAAC,MAAM,MAAM,MAAM,IAAI,MAAM,CAAC,IAAI,MAAM;AAAA,QAC1D,EAAQ,QAAQ,MAAM,KAAK;AAErB,YAAI,MAAM,IAAI,CAAC,MAAM,KAAK;AACxB,mBAAS,MAAM;AAAA,QACvB,WAAiB,OAAO,MAAM,GAAG,EAAE,MAAM,sBAAsB;AACvD,mBAAS,OAAO,OAAO,MAAM,EAAE;AAAA,QACvC,OAAa;AACL,mBAAS,OAAO,SAAS;AAAA,QACjC;AAEM,cAAM,OAAO,SAAS,MAAM,MAAM;AAAA,MACxC;AAAA,IACA;AAEE,WAAO;AAAA,EACT;AAEA,WAAS,uBAAwB,QAAQ,OAAO;AAC9C,UAAM,UAAU,CAAA;AAChB,UAAM,oBAAoB,CAAA;AAE1B,gBAAY,QAAQ,SAAS,iBAAiB;AAE9C,UAAM,SAAS,kBAAkB;AACjC,aAAS,QAAQ,GAAG,QAAQ,QAAQ,SAAS,GAAG;AAC9C,YAAM,WAAW,KAAK,QAAQ,kBAAkB,KAAK,CAAC,CAAC;AAAA,IAC3D;AACE,UAAM,iBAAiB,IAAI,MAAM,MAAM;AAAA,EACzC;AAEA,WAAS,YAAa,QAAQ,SAAS,mBAAmB;AACxD,QAAI,WAAW,QAAQ,OAAO,WAAW,UAAU;AACjD,YAAM,QAAQ,QAAQ,QAAQ,MAAM;AACpC,UAAI,UAAU,IAAI;AAChB,YAAI,kBAAkB,QAAQ,KAAK,MAAM,IAAI;AAC3C,4BAAkB,KAAK,KAAK;AAAA,QACpC;AAAA,MACA,OAAW;AACL,gBAAQ,KAAK,MAAM;AAEnB,YAAI,MAAM,QAAQ,MAAM,GAAG;AACzB,mBAAS,IAAI,GAAG,SAAS,OAAO,QAAQ,IAAI,QAAQ,KAAK,GAAG;AAC1D,wBAAY,OAAO,CAAC,GAAG,SAAS,iBAAiB;AAAA,UAC3D;AAAA,QACA,OAAa;AACL,gBAAM,gBAAgB,OAAO,KAAK,MAAM;AAExC,mBAAS,IAAI,GAAG,SAAS,cAAc,QAAQ,IAAI,QAAQ,KAAK,GAAG;AACjE,wBAAY,OAAO,cAAc,CAAC,CAAC,GAAG,SAAS,iBAAiB;AAAA,UAC1E;AAAA,QACA;AAAA,MACA;AAAA,IACA;AAAA,EACA;AAEA,WAASY,MAAM,OAAO,SAAS;AAC7B,cAAU,WAAW,CAAA;AAErB,UAAM,QAAQ,IAAI,MAAM,OAAO;AAE/B,QAAI,CAAC,MAAM,OAAQ,wBAAuB,OAAO,KAAK;AAEtD,QAAI,QAAQ;AAEZ,QAAI,MAAM,UAAU;AAClB,cAAQ,MAAM,SAAS,KAAK,EAAE,IAAI,MAAK,GAAI,IAAI,KAAK;AAAA,IACxD;AAEE,QAAI,UAAU,OAAO,GAAG,OAAO,MAAM,IAAI,EAAG,QAAO,MAAM,OAAO;AAEhE,WAAO;AAAA,EACT;AAEA,SAAA,OAAsBA;;;;;;;ACt6BtB,QAAMC,UAASnB,cAAA;AACf,QAAMoB,UAAShB,cAAA;AAEf,WAAS,QAAS,MAAM,IAAI;AAC1B,WAAO,WAAY;AACjB,YAAM,IAAI,MAAM,mBAAmB,OAAO,wCAC1B,KAAK,yCAAyC;AAAA,IAClE;AAAA,EACA;AAEA,SAAA,OAAsBI,YAAA;AACtB,SAAA,SAAwBC,cAAA;AACxB,SAAA,kBAAiCC,gBAAA;AACjC,SAAA,cAA6BC,YAAA;AAC7B,SAAA,cAA6BC,YAAA;AAC7B,SAAA,iBAAgCS,gBAAA;AAChC,SAAA,OAAsBF,QAAO;AAC7B,SAAA,UAAyBA,QAAO;AAChC,SAAA,OAAsBC,QAAO;AAC7B,SAAA,gBAA+BE,iBAAA;AAG/B,SAAA,QAAuB;AAAA,IACrB,QAAQC,cAAA;AAAA,IACR,OAAOC,aAAA;AAAA,IACP,KAAKC,WAAA;AAAA,IACL,MAAMC,aAAA;AAAA,IACN,OAAOC,aAAA;AAAA,IACP,KAAKC,WAAA;AAAA,IACL,WAAWC,iBAAA;AAAA,IACX,MAAMC,YAAA;AAAA,IACN,KAAKC,WAAA;AAAA,IACL,OAAOC,aAAA;AAAA,IACP,MAAMC,YAAA;AAAA,IACN,KAAKC,WAAA;AAAA,IACL,KAAKC,WAAA;AAAA,EACP;AAGA,SAAA,WAA0B,QAAQ,YAAY,MAAM;AACpD,SAAA,cAA6B,QAAQ,eAAe,SAAS;AAC7D,SAAA,WAA0B,QAAQ,YAAY,MAAM;;;;;ACzC/C,MAAC;AAAA,EACJ;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,IAAI;"}'use strict'

const loader = require('./lib/loader')
const dumper = require('./lib/dumper')

function renamed (from, to) {
  return function () {
    throw new Error('Function yaml.' + from + ' is removed in js-yaml 4. ' +
      'Use yaml.' + to + ' instead, which is now safe by default.')
  }
}

module.exports.Type = require('./lib/type')
module.exports.Schema = require('./lib/schema')
module.exports.FAILSAFE_SCHEMA = require('./lib/schema/failsafe')
module.exports.JSON_SCHEMA = require('./lib/schema/json')
module.exports.CORE_SCHEMA = require('./lib/schema/core')
module.exports.DEFAULT_SCHEMA = require('./lib/schema/default')
module.exports.load = loader.load
module.exports.loadAll = loader.loadAll
module.exports.dump = dumper.dump
module.exports.YAMLException = require('./lib/exception')

// Re-export all types in case user wants to create custom schema
module.exports.types = {
  binary: require('./lib/type/binary'),
  float: require('./lib/type/float'),
  map: require('./lib/type/map'),
  null: require('./lib/type/null'),
  pairs: require('./lib/type/pairs'),
  set: require('./lib/type/set'),
  timestamp: require('./lib/type/timestamp'),
  bool: require('./lib/type/bool'),
  int: require('./lib/type/int'),
  merge: require('./lib/type/merge'),
  omap: require('./lib/type/omap'),
  seq: require('./lib/type/seq'),
  str: require('./lib/type/str')
}

// Removed functions from JS-YAML 3.0.x
module.exports.safeLoad = renamed('safeLoad', 'load')
module.exports.safeLoadAll = renamed('safeLoadAll', 'loadAll')
module.exports.safeDump = renamed('safeDump', 'dump')
'use strict'

function isNothing (subject) {
  return (typeof subject === 'undefined') || (subject === null)
}

function isObject (subject) {
  return (typeof subject === 'object') && (subject !== null)
}

function toArray (sequence) {
  if (Array.isArray(sequence)) return sequence
  else if (isNothing(sequence)) return []

  return [sequence]
}

function extend (target, source) {
  if (source) {
    const sourceKeys = Object.keys(source)

    for (let index = 0, length = sourceKeys.length; index < length; index += 1) {
      const key = sourceKeys[index]
      target[key] = source[key]
    }
  }

  return target
}

function repeat (string, count) {
  let result = ''

  for (let cycle = 0; cycle < count; cycle += 1) {
    result += string
  }

  return result
}

function isNegativeZero (number) {
  return (number === 0) && (Number.NEGATIVE_INFINITY === 1 / number)
}

module.exports.isNothing = isNothing
module.exports.isObject = isObject
module.exports.toArray = toArray
module.exports.repeat = repeat
module.exports.isNegativeZero = isNegativeZero
module.exports.extend = extend
'use strict'

const common = require('./common')
const YAMLException = require('./exception')
const DEFAULT_SCHEMA = require('./schema/default')

const _toString = Object.prototype.toString
const _hasOwnProperty = Object.prototype.hasOwnProperty

const CHAR_BOM = 0xFEFF
const CHAR_TAB = 0x09 /* Tab */
const CHAR_LINE_FEED = 0x0A /* LF */
const CHAR_CARRIAGE_RETURN = 0x0D /* CR */
const CHAR_SPACE = 0x20 /* Space */
const CHAR_EXCLAMATION = 0x21 /* ! */
const CHAR_DOUBLE_QUOTE = 0x22 /* " */
const CHAR_SHARP = 0x23 /* # */
const CHAR_PERCENT = 0x25 /* % */
const CHAR_AMPERSAND = 0x26 /* & */
const CHAR_SINGLE_QUOTE = 0x27 /* ' */
const CHAR_ASTERISK = 0x2A /* * */
const CHAR_COMMA = 0x2C /* , */
const CHAR_MINUS = 0x2D /* - */
const CHAR_COLON = 0x3A /* : */
const CHAR_EQUALS = 0x3D /* = */
const CHAR_GREATER_THAN = 0x3E /* > */
const CHAR_QUESTION = 0x3F /* ? */
const CHAR_COMMERCIAL_AT = 0x40 /* @ */
const CHAR_LEFT_SQUARE_BRACKET = 0x5B /* [ */
const CHAR_RIGHT_SQUARE_BRACKET = 0x5D /* ] */
const CHAR_GRAVE_ACCENT = 0x60 /* ` */
const CHAR_LEFT_CURLY_BRACKET = 0x7B /* { */
const CHAR_VERTICAL_LINE = 0x7C /* | */
const CHAR_RIGHT_CURLY_BRACKET = 0x7D /* } */

const ESCAPE_SEQUENCES = {}

ESCAPE_SEQUENCES[0x00] = '\\0'
ESCAPE_SEQUENCES[0x07] = '\\a'
ESCAPE_SEQUENCES[0x08] = '\\b'
ESCAPE_SEQUENCES[0x09] = '\\t'
ESCAPE_SEQUENCES[0x0A] = '\\n'
ESCAPE_SEQUENCES[0x0B] = '\\v'
ESCAPE_SEQUENCES[0x0C] = '\\f'
ESCAPE_SEQUENCES[0x0D] = '\\r'
ESCAPE_SEQUENCES[0x1B] = '\\e'
ESCAPE_SEQUENCES[0x22] = '\\"'
ESCAPE_SEQUENCES[0x5C] = '\\\\'
ESCAPE_SEQUENCES[0x85] = '\\N'
ESCAPE_SEQUENCES[0xA0] = '\\_'
ESCAPE_SEQUENCES[0x2028] = '\\L'
ESCAPE_SEQUENCES[0x2029] = '\\P'

const DEPRECATED_BOOLEANS_SYNTAX = [
  'y', 'Y', 'yes', 'Yes', 'YES', 'on', 'On', 'ON',
  'n', 'N', 'no', 'No', 'NO', 'off', 'Off', 'OFF'
]

const DEPRECATED_BASE60_SYNTAX = /^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/

function compileStyleMap (schema, map) {
  if (map === null) return {}

  const result = {}
  const keys = Object.keys(map)

  for (let index = 0, length = keys.length; index < length; index += 1) {
    let tag = keys[index]
    let style = String(map[tag])

    if (tag.slice(0, 2) === '!!') {
      tag = 'tag:yaml.org,2002:' + tag.slice(2)
    }
    const type = schema.compiledTypeMap['fallback'][tag]

    if (type && _hasOwnProperty.call(type.styleAliases, style)) {
      style = type.styleAliases[style]
    }

    result[tag] = style
  }

  return result
}

function encodeHex (character) {
  let handle
  let length

  const string = character.toString(16).toUpperCase()

  if (character <= 0xFF) {
    handle = 'x'
    length = 2
  } else if (character <= 0xFFFF) {
    handle = 'u'
    length = 4
  } else if (character <= 0xFFFFFFFF) {
    handle = 'U'
    length = 8
  } else {
    throw new YAMLException('code point within a string may not be greater than 0xFFFFFFFF')
  }

  return '\\' + handle + common.repeat('0', length - string.length) + string
}

const QUOTING_TYPE_SINGLE = 1
const QUOTING_TYPE_DOUBLE = 2

function State (options) {
  this.schema = options['schema'] || DEFAULT_SCHEMA
  this.indent = Math.max(1, (options['indent'] || 2))
  this.noArrayIndent = options['noArrayIndent'] || false
  this.skipInvalid = options['skipInvalid'] || false
  this.flowLevel = (common.isNothing(options['flowLevel']) ? -1 : options['flowLevel'])
  this.styleMap = compileStyleMap(this.schema, options['styles'] || null)
  this.sortKeys = options['sortKeys'] || false
  this.lineWidth = options['lineWidth'] || 80
  this.noRefs = options['noRefs'] || false
  this.noCompatMode = options['noCompatMode'] || false
  this.condenseFlow = options['condenseFlow'] || false
  this.quotingType = options['quotingType'] === '"' ? QUOTING_TYPE_DOUBLE : QUOTING_TYPE_SINGLE
  this.forceQuotes = options['forceQuotes'] || false
  this.replacer = typeof options['replacer'] === 'function' ? options['replacer'] : null

  this.implicitTypes = this.schema.compiledImplicit
  this.explicitTypes = this.schema.compiledExplicit

  this.tag = null
  this.result = ''

  this.duplicates = []
  this.usedDuplicates = null
}

// Indents every line in a string. Empty lines (\n only) are not indented.
function indentString (string, spaces) {
  const ind = common.repeat(' ', spaces)
  let position = 0
  let result = ''
  const length = string.length

  while (position < length) {
    let line
    const next = string.indexOf('\n', position)
    if (next === -1) {
      line = string.slice(position)
      position = length
    } else {
      line = string.slice(position, next + 1)
      position = next + 1
    }

    if (line.length && line !== '\n') result += ind

    result += line
  }

  return result
}

function generateNextLine (state, level) {
  return '\n' + common.repeat(' ', state.indent * level)
}

function testImplicitResolving (state, str) {
  for (let index = 0, length = state.implicitTypes.length; index < length; index += 1) {
    const type = state.implicitTypes[index]

    if (type.resolve(str)) {
      return true
    }
  }

  return false
}

// [33] s-white ::= s-space | s-tab
function isWhitespace (c) {
  return c === CHAR_SPACE || c === CHAR_TAB
}

// Returns true if the character can be printed without escaping.
// From YAML 1.2: "any allowed characters known to be non-printable
// should also be escaped. [However,] This isnâ€™t mandatory"
// Derived from nb-char - \t - #x85 - #xA0 - #x2028 - #x2029.
function isPrintable (c) {
  return (c >= 0x00020 && c <= 0x00007E) ||
    ((c >= 0x000A1 && c <= 0x00D7FF) && c !== 0x2028 && c !== 0x2029) ||
    ((c >= 0x0E000 && c <= 0x00FFFD) && c !== CHAR_BOM) ||
    (c >= 0x10000 && c <= 0x10FFFF)
}

// [34] ns-char ::= nb-char - s-white
// [27] nb-char ::= c-printable - b-char - c-byte-order-mark
// [26] b-char  ::= b-line-feed | b-carriage-return
// Including s-white (for some reason, examples doesn't match specs in this aspect)
// ns-char ::= c-printable - b-line-feed - b-carriage-return - c-byte-order-mark
function isNsCharOrWhitespace (c) {
  return isPrintable(c) &&
    c !== CHAR_BOM &&
    // - b-char
    c !== CHAR_CARRIAGE_RETURN &&
    c !== CHAR_LINE_FEED
}

// [127]  ns-plain-safe(c) ::= c = flow-out  â‡’ ns-plain-safe-out
//                             c = flow-in   â‡’ ns-plain-safe-in
//                             c = block-key â‡’ ns-plain-safe-out
//                             c = flow-key  â‡’ ns-plain-safe-in
// [128] ns-plain-safe-out ::= ns-char
// [129]  ns-plain-safe-in ::= ns-char - c-flow-indicator
// [130]  ns-plain-char(c) ::=  ( ns-plain-safe(c) - â€œ:â€� - â€œ#â€� )
//                            | ( /* An ns-char preceding */ â€œ#â€� )
//                            | ( â€œ:â€� /* Followed by an ns-plain-safe(c) */ )
function isPlainSafe (c, prev, inblock) {
  const cIsNsCharOrWhitespace = isNsCharOrWhitespace(c)
  const cIsNsChar = cIsNsCharOrWhitespace && !isWhitespace(c)
  return (
    (
      // ns-plain-safe
      inblock // c = flow-in
        ? cIsNsCharOrWhitespace
        : cIsNsCharOrWhitespace &&
          // - c-flow-indicator
          c !== CHAR_COMMA &&
          c !== CHAR_LEFT_SQUARE_BRACKET &&
          c !== CHAR_RIGHT_SQUARE_BRACKET &&
          c !== CHAR_LEFT_CURLY_BRACKET &&
          c !== CHAR_RIGHT_CURLY_BRACKET
    ) &&
    // ns-plain-char
    c !== CHAR_SHARP && // false on '#'
    !(prev === CHAR_COLON && !cIsNsChar)
  ) || // false on ': '
  (isNsCharOrWhitespace(prev) && !isWhitespace(prev) && c === CHAR_SHARP) || // change to true on '[^ ]#'
  (prev === CHAR_COLON && cIsNsChar) // change to true on ':[^ ]'
}

// Simplified test for values allowed as the first character in plain style.
function isPlainSafeFirst (c) {
  // Uses a subset of ns-char - c-indicator
  // where ns-char = nb-char - s-white.
  // No support of ( ( â€œ?â€� | â€œ:â€� | â€œ-â€� ) /* Followed by an ns-plain-safe(c)) */ ) part
  return isPrintable(c) &&
    c !== CHAR_BOM &&
    !isWhitespace(c) && // - s-white
    // - (c-indicator ::=
    // â€œ-â€� | â€œ?â€� | â€œ:â€� | â€œ,â€� | â€œ[â€� | â€œ]â€� | â€œ{â€� | â€œ}â€�
    c !== CHAR_MINUS &&
    c !== CHAR_QUESTION &&
    c !== CHAR_COLON &&
    c !== CHAR_COMMA &&
    c !== CHAR_LEFT_SQUARE_BRACKET &&
    c !== CHAR_RIGHT_SQUARE_BRACKET &&
    c !== CHAR_LEFT_CURLY_BRACKET &&
    c !== CHAR_RIGHT_CURLY_BRACKET &&
    // | â€œ#â€� | â€œ&â€� | â€œ*â€� | â€œ!â€� | â€œ|â€� | â€œ=â€� | â€œ>â€� | â€œ'â€� | â€œ"â€�
    c !== CHAR_SHARP &&
    c !== CHAR_AMPERSAND &&
    c !== CHAR_ASTERISK &&
    c !== CHAR_EXCLAMATION &&
    c !== CHAR_VERTICAL_LINE &&
    c !== CHAR_EQUALS &&
    c !== CHAR_GREATER_THAN &&
    c !== CHAR_SINGLE_QUOTE &&
    c !== CHAR_DOUBLE_QUOTE &&
    // | â€œ%â€� | â€œ@â€� | â€œ`â€�)
    c !== CHAR_PERCENT &&
    c !== CHAR_COMMERCIAL_AT &&
    c !== CHAR_GRAVE_ACCENT
}

// Simplified test for values allowed as the last character in plain style.
function isPlainSafeLast (c) {
  // just not whitespace or colon, it will be checked to be plain character later
  return !isWhitespace(c) && c !== CHAR_COLON
}

// Same as 'string'.codePointAt(pos), but works in older browsers.
function codePointAt (string, pos) {
  const first = string.charCodeAt(pos)
  let second

  if (first >= 0xD800 && first <= 0xDBFF && pos + 1 < string.length) {
    second = string.charCodeAt(pos + 1)
    if (second >= 0xDC00 && second <= 0xDFFF) {
      // https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
      return (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000
    }
  }
  return first
}

// Determines whether block indentation indicator is required.
function needIndentIndicator (string) {
  const leadingSpaceRe = /^\n* /
  return leadingSpaceRe.test(string)
}

const STYLE_PLAIN = 1
const STYLE_SINGLE = 2
const STYLE_LITERAL = 3
const STYLE_FOLDED = 4
const STYLE_DOUBLE = 5

// Determines which scalar styles are possible and returns the preferred style.
// lineWidth = -1 => no limit.
// Pre-conditions: str.length > 0.
// Post-conditions:
//    STYLE_PLAIN or STYLE_SINGLE => no \n are in the string.
//    STYLE_LITERAL => no lines are suitable for folding (or lineWidth is -1).
//    STYLE_FOLDED => a line > lineWidth and can be folded (and lineWidth != -1).
function chooseScalarStyle (string, singleLineOnly, indentPerLevel, lineWidth,
  testAmbiguousType, quotingType, forceQuotes, inblock) {
  let i
  let char = 0
  let prevChar = null
  let hasLineBreak = false
  let hasFoldableLine = false // only checked if shouldTrackWidth
  const shouldTrackWidth = lineWidth !== -1
  let previousLineBreak = -1 // count the first line correctly
  let plain = isPlainSafeFirst(codePointAt(string, 0)) &&
    isPlainSafeLast(codePointAt(string, string.length - 1))

  if (singleLineOnly || forceQuotes) {
    // Case: no block styles.
    // Check for disallowed characters to rule out plain and single.
    for (i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++) {
      char = codePointAt(string, i)
      if (!isPrintable(char)) {
        return STYLE_DOUBLE
      }
      plain = plain && isPlainSafe(char, prevChar, inblock)
      prevChar = char
    }
  } else {
    // Case: block styles permitted.
    for (i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++) {
      char = codePointAt(string, i)
      if (char === CHAR_LINE_FEED) {
        hasLineBreak = true
        // Check if any line can be folded.
        if (shouldTrackWidth) {
          hasFoldableLine = hasFoldableLine ||
            // Foldable line = too long, and not more-indented.
            (i - previousLineBreak - 1 > lineWidth &&
             string[previousLineBreak + 1] !== ' ')
          previousLineBreak = i
        }
      } else if (!isPrintable(char)) {
        return STYLE_DOUBLE
      }
      plain = plain && isPlainSafe(char, prevChar, inblock)
      prevChar = char
    }
    // in case the end is missing a \n
    hasFoldableLine = hasFoldableLine || (shouldTrackWidth &&
      (i - previousLineBreak - 1 > lineWidth &&
       string[previousLineBreak + 1] !== ' '))
  }
  // Although every style can represent \n without escaping, prefer block styles
  // for multiline, since they're more readable and they don't add empty lines.
  // Also prefer folding a super-long line.
  if (!hasLineBreak && !hasFoldableLine) {
    // Strings interpretable as another type have to be quoted;
    // e.g. the string 'true' vs. the boolean true.
    if (plain && !forceQuotes && !testAmbiguousType(string)) {
      return STYLE_PLAIN
    }
    return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : STYLE_SINGLE
  }
  // Edge case: block indentation indicator can only have one digit.
  if (indentPerLevel > 9 && needIndentIndicator(string)) {
    return STYLE_DOUBLE
  }
  // At this point we know block styles are valid.
  // Prefer literal style unless we want to fold.
  if (!forceQuotes) {
    return hasFoldableLine ? STYLE_FOLDED : STYLE_LITERAL
  }
  return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : STYLE_SINGLE
}

// Note: line breaking/folding is implemented for only the folded style.
// NB. We drop the last trailing newline (if any) of a returned block scalar
//  since the dumper adds its own newline. This always works:
//    â€¢ No ending newline => unaffected; already using strip "-" chomping.
//    â€¢ Ending newline    => removed then restored.
//  Importantly, this keeps the "+" chomp indicator from gaining an extra line.
function writeScalar (state, string, level, iskey, inblock) {
  state.dump = (function () {
    if (string.length === 0) {
      return state.quotingType === QUOTING_TYPE_DOUBLE ? '""' : "''"
    }
    if (!state.noCompatMode) {
      if (DEPRECATED_BOOLEANS_SYNTAX.indexOf(string) !== -1 || DEPRECATED_BASE60_SYNTAX.test(string)) {
        return state.quotingType === QUOTING_TYPE_DOUBLE ? ('"' + string + '"') : ("'" + string + "'")
      }
    }

    const indent = state.indent * Math.max(1, level) // no 0-indent scalars
    // As indentation gets deeper, let the width decrease monotonically
    // to the lower bound min(state.lineWidth, 40).
    // Note that this implies
    //  state.lineWidth â‰¤ 40 + state.indent: width is fixed at the lower bound.
    //  state.lineWidth > 40 + state.indent: width decreases until the lower bound.
    // This behaves better than a constant minimum width which disallows narrower options,
    // or an indent threshold which causes the width to suddenly increase.
    const lineWidth = (state.lineWidth === -1)
      ? -1
      : Math.max(Math.min(state.lineWidth, 40), state.lineWidth - indent)

    // Without knowing if keys are implicit/explicit, assume implicit for safety.
    const singleLineOnly = iskey ||
      // No block styles in flow mode.
      (state.flowLevel > -1 && level >= state.flowLevel)
    function testAmbiguity (string) {
      return testImplicitResolving(state, string)
    }

    switch (chooseScalarStyle(string, singleLineOnly, state.indent, lineWidth,
      testAmbiguity, state.quotingType, state.forceQuotes && !iskey, inblock)) {
      case STYLE_PLAIN:
        return string
      case STYLE_SINGLE:
        return "'" + string.replace(/'/g, "''") + "'"
      case STYLE_LITERAL:
        return '|' + blockHeader(string, state.indent) +
          dropEndingNewline(indentString(string, indent))
      case STYLE_FOLDED:
        return '>' + blockHeader(string, state.indent) +
          dropEndingNewline(indentString(foldString(string, lineWidth), indent))
      case STYLE_DOUBLE:
        return '"' + escapeString(string, lineWidth) + '"'
      default:
        throw new YAMLException('impossible error: invalid scalar style')
    }
  }())
}

// Pre-conditions: string is valid for a block scalar, 1 <= indentPerLevel <= 9.
function blockHeader (string, indentPerLevel) {
  const indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : ''

  // note the special case: the string '\n' counts as a "trailing" empty line.
  const clip = string[string.length - 1] === '\n'
  const keep = clip && (string[string.length - 2] === '\n' || string === '\n')
  const chomp = keep ? '+' : (clip ? '' : '-')

  return indentIndicator + chomp + '\n'
}

// (See the note for writeScalar.)
function dropEndingNewline (string) {
  return string[string.length - 1] === '\n' ? string.slice(0, -1) : string
}

// Note: a long line without a suitable break point will exceed the width limit.
// Pre-conditions: every char in str isPrintable, str.length > 0, width > 0.
function foldString (string, width) {
  // In folded style, $k$ consecutive newlines output as $k+1$ newlinesâ€”
  // unless they're before or after a more-indented line, or at the very
  // beginning or end, in which case $k$ maps to $k$.
  // Therefore, parse each chunk as newline(s) followed by a content line.
  const lineRe = /(\n+)([^\n]*)/g

  // first line (possibly an empty line)
  let result = (function () {
    let nextLF = string.indexOf('\n')
    nextLF = nextLF !== -1 ? nextLF : string.length
    lineRe.lastIndex = nextLF
    return foldLine(string.slice(0, nextLF), width)
  }())
  // If we haven't reached the first content line yet, don't add an extra \n.
  let prevMoreIndented = string[0] === '\n' || string[0] === ' '
  let moreIndented

  // rest of the lines
  let match
  while ((match = lineRe.exec(string))) {
    const prefix = match[1]
    const line = match[2]

    moreIndented = (line[0] === ' ')
    result += prefix +
      ((!prevMoreIndented && !moreIndented && line !== '') ? '\n' : '') +
      foldLine(line, width)
    prevMoreIndented = moreIndented
  }

  return result
}

// Greedy line breaking.
// Picks the longest line under the limit each time,
// otherwise settles for the shortest line over the limit.
// NB. More-indented lines *cannot* be folded, as that would add an extra \n.
function foldLine (line, width) {
  if (line === '' || line[0] === ' ') return line

  // Since a more-indented line adds a \n, breaks can't be followed by a space.
  const breakRe = / [^ ]/g // note: the match index will always be <= length-2.
  let match
  // start is an inclusive index. end, curr, and next are exclusive.
  let start = 0
  let end
  let curr = 0
  let next = 0
  let result = ''

  // Invariants: 0 <= start <= length-1.
  //   0 <= curr <= next <= max(0, length-2). curr - start <= width.
  // Inside the loop:
  //   A match implies length >= 2, so curr and next are <= length-2.
  while ((match = breakRe.exec(line))) {
    next = match.index
    // maintain invariant: curr - start <= width
    if (next - start > width) {
      end = (curr > start) ? curr : next // derive end <= length-2
      result += '\n' + line.slice(start, end)
      // skip the space that was output as \n
      start = end + 1                    // derive start <= length-1
    }
    curr = next
  }

  // By the invariants, start <= length-1, so there is something left over.
  // It is either the whole string or a part starting from non-whitespace.
  result += '\n'
  // Insert a break if the remainder is too long and there is a break available.
  if (line.length - start > width && curr > start) {
    result += line.slice(start, curr) + '\n' + line.slice(curr + 1)
  } else {
    result += line.slice(start)
  }

  return result.slice(1) // drop extra \n joiner
}

// Escapes a double-quoted string.
function escapeString (string) {
  let result = ''
  let char = 0

  for (let i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++) {
    char = codePointAt(string, i)
    const escapeSeq = ESCAPE_SEQUENCES[char]

    if (!escapeSeq && isPrintable(char)) {
      result += string[i]
      if (char >= 0x10000) result += string[i + 1]
    } else {
      result += escapeSeq || encodeHex(char)
    }
  }

  return result
}

function writeFlowSequence (state, level, object) {
  let _result = ''
  const _tag = state.tag

  for (let index = 0, length = object.length; index < length; index += 1) {
    let value = object[index]

    if (state.replacer) {
      value = state.replacer.call(object, String(index), value)
    }

    // Write only valid elements, put null instead of invalid elements.
    if (writeNode(state, level, value, false, false) ||
        (typeof value === 'undefined' &&
         writeNode(state, level, null, false, false))) {
      if (_result !== '') _result += ',' + (!state.condenseFlow ? ' ' : '')
      _result += state.dump
    }
  }

  state.tag = _tag
  state.dump = '[' + _result + ']'
}

function writeBlockSequence (state, level, object, compact) {
  let _result = ''
  const _tag = state.tag

  for (let index = 0, length = object.length; index < length; index += 1) {
    let value = object[index]

    if (state.replacer) {
      value = state.replacer.call(object, String(index), value)
    }

    // Write only valid elements, put null instead of invalid elements.
    if (writeNode(state, level + 1, value, true, true, false, true) ||
        (typeof value === 'undefined' &&
         writeNode(state, level + 1, null, true, true, false, true))) {
      if (!compact || _result !== '') {
        _result += generateNextLine(state, level)
      }

      if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
        _result += '-'
      } else {
        _result += '- '
      }

      _result += state.dump
    }
  }

  state.tag = _tag
  state.dump = _result || '[]' // Empty sequence if no valid values.
}

function writeFlowMapping (state, level, object) {
  let _result = ''
  const _tag = state.tag
  const objectKeyList = Object.keys(object)

  for (let index = 0, length = objectKeyList.length; index < length; index += 1) {
    let pairBuffer = ''
    if (_result !== '') pairBuffer += ', '

    if (state.condenseFlow) pairBuffer += '"'

    const objectKey = objectKeyList[index]
    let objectValue = object[objectKey]

    if (state.replacer) {
      objectValue = state.replacer.call(object, objectKey, objectValue)
    }

    if (!writeNode(state, level, objectKey, false, false)) {
      continue // Skip this pair because of invalid key;
    }

    if (state.dump.length > 1024) pairBuffer += '? '

    pairBuffer += state.dump + (state.condenseFlow ? '"' : '') + ':' + (state.condenseFlow ? '' : ' ')

    if (!writeNode(state, level, objectValue, false, false)) {
      continue // Skip this pair because of invalid value.
    }

    pairBuffer += state.dump

    // Both key and value are valid.
    _result += pairBuffer
  }

  state.tag = _tag
  state.dump = '{' + _result + '}'
}

function writeBlockMapping (state, level, object, compact) {
  let _result = ''
  const _tag = state.tag
  const objectKeyList = Object.keys(object)

  // Allow sorting keys so that the output file is deterministic
  if (state.sortKeys === true) {
    // Default sorting
    objectKeyList.sort()
  } else if (typeof state.sortKeys === 'function') {
    // Custom sort function
    objectKeyList.sort(state.sortKeys)
  } else if (state.sortKeys) {
    // Something is wrong
    throw new YAMLException('sortKeys must be a boolean or a function')
  }

  for (let index = 0, length = objectKeyList.length; index < length; index += 1) {
    let pairBuffer = ''

    if (!compact || _result !== '') {
      pairBuffer += generateNextLine(state, level)
    }

    const objectKey = objectKeyList[index]
    let objectValue = object[objectKey]

    if (state.replacer) {
      objectValue = state.replacer.call(object, objectKey, objectValue)
    }

    if (!writeNode(state, level + 1, objectKey, true, true, true)) {
      continue // Skip this pair because of invalid key.
    }

    const explicitPair = (state.tag !== null && state.tag !== '?') ||
                   (state.dump && state.dump.length > 1024)

    if (explicitPair) {
      if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
        pairBuffer += '?'
      } else {
        pairBuffer += '? '
      }
    }

    pairBuffer += state.dump

    if (explicitPair) {
      pairBuffer += generateNextLine(state, level)
    }

    if (!writeNode(state, level + 1, objectValue, true, explicitPair)) {
      continue // Skip this pair because of invalid value.
    }

    if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
      pairBuffer += ':'
    } else {
      pairBuffer += ': '
    }

    pairBuffer += state.dump

    // Both key and value are valid.
    _result += pairBuffer
  }

  state.tag = _tag
  state.dump = _result || '{}' // Empty mapping if no valid pairs.
}

function detectType (state, object, explicit) {
  const typeList = explicit ? state.explicitTypes : state.implicitTypes

  for (let index = 0, length = typeList.length; index < length; index += 1) {
    const type = typeList[index]

    if ((type.instanceOf || type.predicate) &&
        (!type.instanceOf || ((typeof object === 'object') && (object instanceof type.instanceOf))) &&
        (!type.predicate || type.predicate(object))) {
      if (explicit) {
        if (type.multi && type.representName) {
          state.tag = type.representName(object)
        } else {
          state.tag = type.tag
        }
      } else {
        state.tag = '?'
      }

      if (type.represent) {
        const style = state.styleMap[type.tag] || type.defaultStyle

        let _result
        if (_toString.call(type.represent) === '[object Function]') {
          _result = type.represent(object, style)
        } else if (_hasOwnProperty.call(type.represent, style)) {
          _result = type.represent[style](object, style)
        } else {
          throw new YAMLException('!<' + type.tag + '> tag resolver accepts not "' + style + '" style')
        }

        state.dump = _result
      }

      return true
    }
  }

  return false
}

// Serializes `object` and writes it to global `result`.
// Returns true on success, or false on invalid object.
//
function writeNode (state, level, object, block, compact, iskey, isblockseq) {
  state.tag = null
  state.dump = object

  if (!detectType(state, object, false)) {
    detectType(state, object, true)
  }

  const type = _toString.call(state.dump)
  const inblock = block

  if (block) {
    block = (state.flowLevel < 0 || state.flowLevel > level)
  }

  const objectOrArray = type === '[object Object]' || type === '[object Array]'
  let duplicateIndex
  let duplicate

  if (objectOrArray) {
    duplicateIndex = state.duplicates.indexOf(object)
    duplicate = duplicateIndex !== -1
  }

  if ((state.tag !== null && state.tag !== '?') || duplicate || (state.indent !== 2 && level > 0)) {
    compact = false
  }

  if (duplicate && state.usedDuplicates[duplicateIndex]) {
    state.dump = '*ref_' + duplicateIndex
  } else {
    if (objectOrArray && duplicate && !state.usedDuplicates[duplicateIndex]) {
      state.usedDuplicates[duplicateIndex] = true
    }
    if (type === '[object Object]') {
      if (block && (Object.keys(state.dump).length !== 0)) {
        writeBlockMapping(state, level, state.dump, compact)
        if (duplicate) {
          state.dump = '&ref_' + duplicateIndex + state.dump
        }
      } else {
        writeFlowMapping(state, level, state.dump)
        if (duplicate) {
          state.dump = '&ref_' + duplicateIndex + ' ' + state.dump
        }
      }
    } else if (type === '[object Array]') {
      if (block && (state.dump.length !== 0)) {
        if (state.noArrayIndent && !isblockseq && level > 0) {
          writeBlockSequence(state, level - 1, state.dump, compact)
        } else {
          writeBlockSequence(state, level, state.dump, compact)
        }
        if (duplicate) {
          state.dump = '&ref_' + duplicateIndex + state.dump
        }
      } else {
        writeFlowSequence(state, level, state.dump)
        if (duplicate) {
          state.dump = '&ref_' + duplicateIndex + ' ' + state.dump
        }
      }
    } else if (type === '[object String]') {
      if (state.tag !== '?') {
        writeScalar(state, state.dump, level, iskey, inblock)
      }
    } else if (type === '[object Undefined]') {
      return false
    } else {
      if (state.skipInvalid) return false
      throw new YAMLException('unacceptable kind of an object to dump ' + type)
    }

    if (state.tag !== null && state.tag !== '?') {
      // Need to encode all characters except those allowed by the spec:
      //
      // [35] ns-dec-digit    ::=  [#x30-#x39] /* 0-9 */
      // [36] ns-hex-digit    ::=  ns-dec-digit
      //                         | [#x41-#x46] /* A-F */ | [#x61-#x66] /* a-f */
      // [37] ns-ascii-letter ::=  [#x41-#x5A] /* A-Z */ | [#x61-#x7A] /* a-z */
      // [38] ns-word-char    ::=  ns-dec-digit | ns-ascii-letter | â€œ-â€�
      // [39] ns-uri-char     ::=  â€œ%â€� ns-hex-digit ns-hex-digit | ns-word-char | â€œ#â€�
      //                         | â€œ;â€� | â€œ/â€� | â€œ?â€� | â€œ:â€� | â€œ@â€� | â€œ&â€� | â€œ=â€� | â€œ+â€� | â€œ$â€� | â€œ,â€�
      //                         | â€œ_â€� | â€œ.â€� | â€œ!â€� | â€œ~â€� | â€œ*â€� | â€œ'â€� | â€œ(â€� | â€œ)â€� | â€œ[â€� | â€œ]â€�
      //
      // Also need to encode '!' because it has special meaning (end of tag prefix).
      //
      let tagStr = encodeURI(
        state.tag[0] === '!' ? state.tag.slice(1) : state.tag
      ).replace(/!/g, '%21')

      if (state.tag[0] === '!') {
        tagStr = '!' + tagStr
      } else if (tagStr.slice(0, 18) === 'tag:yaml.org,2002:') {
        tagStr = '!!' + tagStr.slice(18)
      } else {
        tagStr = '!<' + tagStr + '>'
      }

      state.dump = tagStr + ' ' + state.dump
    }
  }

  return true
}

function getDuplicateReferences (object, state) {
  const objects = []
  const duplicatesIndexes = []

  inspectNode(object, objects, duplicatesIndexes)

  const length = duplicatesIndexes.length
  for (let index = 0; index < length; index += 1) {
    state.duplicates.push(objects[duplicatesIndexes[index]])
  }
  state.usedDuplicates = new Array(length)
}

function inspectNode (object, objects, duplicatesIndexes) {
  if (object !== null && typeof object === 'object') {
    const index = objects.indexOf(object)
    if (index !== -1) {
      if (duplicatesIndexes.indexOf(index) === -1) {
        duplicatesIndexes.push(index)
      }
    } else {
      objects.push(object)

      if (Array.isArray(object)) {
        for (let i = 0, length = object.length; i < length; i += 1) {
          inspectNode(object[i], objects, duplicatesIndexes)
        }
      } else {
        const objectKeyList = Object.keys(object)

        for (let i = 0, length = objectKeyList.length; i < length; i += 1) {
          inspectNode(object[objectKeyList[i]], objects, duplicatesIndexes)
        }
      }
    }
  }
}

function dump (input, options) {
  options = options || {}

  const state = new State(options)

  if (!state.noRefs) getDuplicateReferences(input, state)

  let value = input

  if (state.replacer) {
    value = state.replacer.call({ '': value }, '', value)
  }

  if (writeNode(state, 0, value, true, true)) return state.dump + '\n'

  return ''
}

module.exports.dump = dump
// YAML error class. http://stackoverflow.com/questions/8458984
//
'use strict'

function formatError (exception, compact) {
  let where = ''
  const message = exception.reason || '(unknown reason)'

  if (!exception.mark) return message

  if (exception.mark.name) {
    where += 'in "' + exception.mark.name + '" '
  }

  where += '(' + (exception.mark.line + 1) + ':' + (exception.mark.column + 1) + ')'

  if (!compact && exception.mark.snippet) {
    where += '\n\n' + exception.mark.snippet
  }

  return message + ' ' + where
}

function YAMLException (reason, mark) {
  // Super constructor
  Error.call(this)

  this.name = 'YAMLException'
  this.reason = reason
  this.mark = mark
  this.message = formatError(this, false)

  // Include stack trace in error object
  if (Error.captureStackTrace) {
    // Chrome and NodeJS
    Error.captureStackTrace(this, this.constructor)
  } else {
    // FF, IE 10+ and Safari 6+. Fallback for others
    this.stack = (new Error()).stack || ''
  }
}

// Inherit from Error
YAMLException.prototype = Object.create(Error.prototype)
YAMLException.prototype.constructor = YAMLException

YAMLException.prototype.toString = function toString (compact) {
  return this.name + ': ' + formatError(this, compact)
}

module.exports = YAMLException
import yaml from '../index.js'

const {
  Type,
  Schema,
  FAILSAFE_SCHEMA,
  JSON_SCHEMA,
  CORE_SCHEMA,
  DEFAULT_SCHEMA,
  load,
  loadAll,
  dump,
  YAMLException,
  types,
  safeLoad,
  safeLoadAll,
  safeDump
} = yaml

export {
  Type,
  Schema,
  FAILSAFE_SCHEMA,
  JSON_SCHEMA,
  CORE_SCHEMA,
  DEFAULT_SCHEMA,
  load,
  loadAll,
  dump,
  YAMLException,
  types,
  safeLoad,
  safeLoadAll,
  safeDump
}

export default yaml
'use strict'

const common = require('./common')
const YAMLException = require('./exception')
const makeSnippet = require('./snippet')
const DEFAULT_SCHEMA = require('./schema/default')

const _hasOwnProperty = Object.prototype.hasOwnProperty

const CONTEXT_FLOW_IN = 1
const CONTEXT_FLOW_OUT = 2
const CONTEXT_BLOCK_IN = 3
const CONTEXT_BLOCK_OUT = 4

const CHOMPING_CLIP = 1
const CHOMPING_STRIP = 2
const CHOMPING_KEEP = 3

// eslint-disable-next-line no-control-regex
const PATTERN_NON_PRINTABLE = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/
const PATTERN_NON_ASCII_LINE_BREAKS = /[\x85\u2028\u2029]/
// eslint-disable-next-line no-useless-escape
const PATTERN_FLOW_INDICATORS = /[,\[\]{}]/
// eslint-disable-next-line no-useless-escape
const PATTERN_TAG_HANDLE = /^(?:!|!!|![0-9A-Za-z-]+!)$/
// eslint-disable-next-line no-useless-escape
const PATTERN_TAG_URI = /^(?:!|[^,\[\]{}])(?:%[0-9a-f]{2}|[0-9a-z\-#;/?:@&=+$,_.!~*'()\[\]])*$/i

function _class (obj) { return Object.prototype.toString.call(obj) }

function isEol (c) {
  return (c === 0x0A/* LF */) || (c === 0x0D/* CR */)
}

function isWhiteSpace (c) {
  return (c === 0x09/* Tab */) || (c === 0x20/* Space */)
}

function isWsOrEol (c) {
  return (c === 0x09/* Tab */) ||
         (c === 0x20/* Space */) ||
         (c === 0x0A/* LF */) ||
         (c === 0x0D/* CR */)
}

function isFlowIndicator (c) {
  return c === 0x2C/* , */ ||
         c === 0x5B/* [ */ ||
         c === 0x5D/* ] */ ||
         c === 0x7B/* { */ ||
         c === 0x7D/* } */
}

function fromHexCode (c) {
  if ((c >= 0x30/* 0 */) && (c <= 0x39/* 9 */)) {
    return c - 0x30
  }

  const lc = c | 0x20

  if ((lc >= 0x61/* a */) && (lc <= 0x66/* f */)) {
    return lc - 0x61 + 10
  }

  return -1
}

function escapedHexLen (c) {
  if (c === 0x78/* x */) { return 2 }
  if (c === 0x75/* u */) { return 4 }
  if (c === 0x55/* U */) { return 8 }
  return 0
}

function fromDecimalCode (c) {
  if ((c >= 0x30/* 0 */) && (c <= 0x39/* 9 */)) {
    return c - 0x30
  }

  return -1
}

function simpleEscapeSequence (c) {
  switch (c) {
    case 0x30/* 0 */: return '\x00'
    case 0x61/* a */: return '\x07'
    case 0x62/* b */: return '\x08'
    case 0x74/* t */: return '\x09'
    case 0x09/* Tab */: return '\x09'
    case 0x6E/* n */: return '\x0A'
    case 0x76/* v */: return '\x0B'
    case 0x66/* f */: return '\x0C'
    case 0x72/* r */: return '\x0D'
    case 0x65/* e */: return '\x1B'
    case 0x20/* Space */: return ' '
    case 0x22/* " */: return '\x22'
    case 0x2F/* / */: return '/'
    case 0x5C/* \ */: return '\x5C'
    case 0x4E/* N */: return '\x85'
    case 0x5F/* _ */: return '\xA0'
    case 0x4C/* L */: return '\u2028'
    case 0x50/* P */: return '\u2029'
    default: return ''
  }
}

function charFromCodepoint (c) {
  if (c <= 0xFFFF) {
    return String.fromCharCode(c)
  }
  // Encode UTF-16 surrogate pair
  // https://en.wikipedia.org/wiki/UTF-16#Code_points_U.2B010000_to_U.2B10FFFF
  return String.fromCharCode(
    ((c - 0x010000) >> 10) + 0xD800,
    ((c - 0x010000) & 0x03FF) + 0xDC00
  )
}

// set a property of a literal object, while protecting against prototype pollution,
// see https://github.com/nodeca/js-yaml/issues/164 for more details
function setProperty (object, key, value) {
  // used for this specific key only because Object.defineProperty is slow
  if (key === '__proto__') {
    Object.defineProperty(object, key, {
      configurable: true,
      enumerable: true,
      writable: true,
      value: value
    })
  } else {
    object[key] = value
  }
}

const simpleEscapeCheck = new Array(256) // integer, for fast access
const simpleEscapeMap = new Array(256)
for (let i = 0; i < 256; i++) {
  simpleEscapeCheck[i] = simpleEscapeSequence(i) ? 1 : 0
  simpleEscapeMap[i] = simpleEscapeSequence(i)
}

function State (input, options) {
  this.input = input

  this.filename = options['filename'] || null
  this.schema = options['schema'] || DEFAULT_SCHEMA
  this.onWarning = options['onWarning'] || null
  // (Hidden) Remove? makes the loader to expect YAML 1.1 documents
  // if such documents have no explicit %YAML directive
  this.legacy = options['legacy'] || false

  this.json = options['json'] || false
  this.listener = options['listener'] || null
  this.maxDepth = typeof options['maxDepth'] === 'number' ? options['maxDepth'] : 100
  this.maxTotalMergeKeys = typeof options['maxTotalMergeKeys'] === 'number' ? options['maxTotalMergeKeys'] : 10000

  this.implicitTypes = this.schema.compiledImplicit
  this.typeMap = this.schema.compiledTypeMap

  this.length = input.length
  this.position = 0
  this.line = 0
  this.lineStart = 0
  this.lineIndent = 0
  this.depth = 0
  this.totalMergeKeys = 0

  // position of first leading tab in the current line,
  // used to make sure there are no tabs in the indentation
  this.firstTabInLine = -1

  this.documents = []
  this.anchorMapTransactions = []

  /*
  this.version;
  this.checkLineBreaks;
  this.tagMap;
  this.anchorMap;
  this.tag;
  this.anchor;
  this.kind;
  this.result; */
}

function generateError (state, message) {
  const mark = {
    name: state.filename,
    buffer: state.input.slice(0, -1), // omit trailing \0
    position: state.position,
    line: state.line,
    column: state.position - state.lineStart
  }

  mark.snippet = makeSnippet(mark)

  return new YAMLException(message, mark)
}

function throwError (state, message) {
  throw generateError(state, message)
}

function throwWarning (state, message) {
  if (state.onWarning) {
    state.onWarning.call(null, generateError(state, message))
  }
}

function storeAnchor (state, name, value) {
  const transactions = state.anchorMapTransactions

  if (transactions.length !== 0) {
    const transaction = transactions[transactions.length - 1]

    if (!_hasOwnProperty.call(transaction, name)) {
      transaction[name] = {
        existed: _hasOwnProperty.call(state.anchorMap, name),
        value: state.anchorMap[name]
      }
    }
  }

  state.anchorMap[name] = value
}

function beginAnchorTransaction (state) {
  state.anchorMapTransactions.push(Object.create(null))
}

function commitAnchorTransaction (state) {
  const transaction = state.anchorMapTransactions.pop()
  const transactions = state.anchorMapTransactions

  if (transactions.length === 0) return

  const parent = transactions[transactions.length - 1]
  const names = Object.keys(transaction)

  for (let index = 0, length = names.length; index < length; index += 1) {
    const name = names[index]

    if (!_hasOwnProperty.call(parent, name)) {
      parent[name] = transaction[name]
    }
  }
}

function rollbackAnchorTransaction (state) {
  const transaction = state.anchorMapTransactions.pop()
  const names = Object.keys(transaction)

  for (let index = names.length - 1; index >= 0; index -= 1) {
    const entry = transaction[names[index]]

    if (entry.existed) {
      state.anchorMap[names[index]] = entry.value
    } else {
      delete state.anchorMap[names[index]]
    }
  }
}

function snapshotState (state) {
  return {
    position: state.position,
    line: state.line,
    lineStart: state.lineStart,
    lineIndent: state.lineIndent,
    firstTabInLine: state.firstTabInLine,
    tag: state.tag,
    anchor: state.anchor,
    kind: state.kind,
    result: state.result
  }
}

function restoreState (state, snapshot) {
  state.position = snapshot.position
  state.line = snapshot.line
  state.lineStart = snapshot.lineStart
  state.lineIndent = snapshot.lineIndent
  state.firstTabInLine = snapshot.firstTabInLine
  state.tag = snapshot.tag
  state.anchor = snapshot.anchor
  state.kind = snapshot.kind
  state.result = snapshot.result
}

const directiveHandlers = {

  YAML: function handleYamlDirective (state, name, args) {
    if (state.version !== null) {
      throwError(state, 'duplication of %YAML directive')
    }

    if (args.length !== 1) {
      throwError(state, 'YAML directive accepts exactly one argument')
    }

    const match = /^([0-9]+)\.([0-9]+)$/.exec(args[0])

    if (match === null) {
      throwError(state, 'ill-formed argument of the YAML directive')
    }

    const major = parseInt(match[1], 10)
    const minor = parseInt(match[2], 10)

    if (major !== 1) {
      throwError(state, 'unacceptable YAML version of the document')
    }

    state.version = args[0]
    state.checkLineBreaks = (minor < 2)

    if (minor !== 1 && minor !== 2) {
      throwWarning(state, 'unsupported YAML version of the document')
    }
  },

  TAG: function handleTagDirective (state, name, args) {
    let prefix

    if (args.length !== 2) {
      throwError(state, 'TAG directive accepts exactly two arguments')
    }

    const handle = args[0]
    prefix = args[1]

    if (!PATTERN_TAG_HANDLE.test(handle)) {
      throwError(state, 'ill-formed tag handle (first argument) of the TAG directive')
    }

    if (_hasOwnProperty.call(state.tagMap, handle)) {
      throwError(state, 'there is a previously declared suffix for "' + handle + '" tag handle')
    }

    if (!PATTERN_TAG_URI.test(prefix)) {
      throwError(state, 'ill-formed tag prefix (second argument) of the TAG directive')
    }

    try {
      prefix = decodeURIComponent(prefix)
    } catch (err) {
      throwError(state, 'tag prefix is malformed: ' + prefix)
    }

    state.tagMap[handle] = prefix
  }
}

function captureSegment (state, start, end, checkJson) {
  if (start < end) {
    const _result = state.input.slice(start, end)

    if (checkJson) {
      for (let _position = 0, _length = _result.length; _position < _length; _position += 1) {
        const _character = _result.charCodeAt(_position)
        if (!(_character === 0x09 ||
              (_character >= 0x20 && _character <= 0x10FFFF))) {
          throwError(state, 'expected valid JSON character')
        }
      }
    } else if (PATTERN_NON_PRINTABLE.test(_result)) {
      throwError(state, 'the stream contains non-printable characters')
    }

    state.result += _result
  }
}

function mergeMappings (state, destination, source, overridableKeys) {
  if (!common.isObject(source)) {
    throwError(state, 'cannot merge mappings; the provided source object is unacceptable')
  }

  const sourceKeys = Object.keys(source)

  for (let index = 0, quantity = sourceKeys.length; index < quantity; index += 1) {
    const key = sourceKeys[index]

    if (state.maxTotalMergeKeys !== -1 && ++state.totalMergeKeys > state.maxTotalMergeKeys) {
      throwError(state, 'merge keys exceeded maxTotalMergeKeys (' + state.maxTotalMergeKeys + ')')
    }

    if (!_hasOwnProperty.call(destination, key)) {
      setProperty(destination, key, source[key])
      overridableKeys[key] = true
    }
  }
}

function storeMappingPair (state, _result, overridableKeys, keyTag, keyNode, valueNode,
  startLine, startLineStart, startPos) {
  // The output is a plain object here, so keys can only be strings.
  // We need to convert keyNode to a string, but doing so can hang the process
  // (deeply nested arrays that explode exponentially using aliases).
  if (Array.isArray(keyNode)) {
    keyNode = Array.prototype.slice.call(keyNode)

    for (let index = 0, quantity = keyNode.length; index < quantity; index += 1) {
      if (Array.isArray(keyNode[index])) {
        throwError(state, 'nested arrays are not supported inside keys')
      }

      if (typeof keyNode === 'object' && _class(keyNode[index]) === '[object Object]') {
        keyNode[index] = '[object Object]'
      }
    }
  }

  // Avoid code execution in load() via toString property
  // (still use its own toString for arrays, timestamps,
  // and whatever user schema extensions happen to have @@toStringTag)
  if (typeof keyNode === 'object' && _class(keyNode) === '[object Object]') {
    keyNode = '[object Object]'
  }

  keyNode = String(keyNode)

  if (_result === null) {
    _result = {}
  }

  if (keyTag === 'tag:yaml.org,2002:merge') {
    if (Array.isArray(valueNode)) {
      for (let index = 0, quantity = valueNode.length; index < quantity; index += 1) {
        mergeMappings(state, _result, valueNode[index], overridableKeys)
      }
    } else {
      mergeMappings(state, _result, valueNode, overridableKeys)
    }
  } else {
    if (!state.json &&
        !_hasOwnProperty.call(overridableKeys, keyNode) &&
        _hasOwnProperty.call(_result, keyNode)) {
      state.line = startLine || state.line
      state.lineStart = startLineStart || state.lineStart
      state.position = startPos || state.position
      throwError(state, 'duplicated mapping key')
    }

    setProperty(_result, keyNode, valueNode)
    delete overridableKeys[keyNode]
  }

  return _result
}

function readLineBreak (state) {
  const ch = state.input.charCodeAt(state.position)

  if (ch === 0x0A/* LF */) {
    state.position++
  } else if (ch === 0x0D/* CR */) {
    state.position++
    if (state.input.charCodeAt(state.position) === 0x0A/* LF */) {
      state.position++
    }
  } else {
    throwError(state, 'a line break is expected')
  }

  state.line += 1
  state.lineStart = state.position
  state.firstTabInLine = -1
}

function skipSeparationSpace (state, allowComments, checkIndent) {
  let lineBreaks = 0
  let ch = state.input.charCodeAt(state.position)

  while (ch !== 0) {
    while (isWhiteSpace(ch)) {
      if (ch === 0x09/* Tab */ && state.firstTabInLine === -1) {
        state.firstTabInLine = state.position
      }
      ch = state.input.charCodeAt(++state.position)
    }

    if (allowComments && ch === 0x23/* # */) {
      do {
        ch = state.input.charCodeAt(++state.position)
      } while (ch !== 0x0A/* LF */ && ch !== 0x0D/* CR */ && ch !== 0)
    }

    if (isEol(ch)) {
      readLineBreak(state)

      ch = state.input.charCodeAt(state.position)
      lineBreaks++
      state.lineIndent = 0

      while (ch === 0x20/* Space */) {
        state.lineIndent++
        ch = state.input.charCodeAt(++state.position)
      }
    } else {
      break
    }
  }

  if (checkIndent !== -1 && lineBreaks !== 0 && state.lineIndent < checkIndent) {
    throwWarning(state, 'deficient indentation')
  }

  return lineBreaks
}

function testDocumentSeparator (state) {
  let _position = state.position
  let ch = state.input.charCodeAt(_position)

  // Condition state.position === state.lineStart is tested
  // in parent on each call, for efficiency. No needs to test here again.
  if ((ch === 0x2D/* - */ || ch === 0x2E/* . */) &&
      ch === state.input.charCodeAt(_position + 1) &&
      ch === state.input.charCodeAt(_position + 2)) {
    _position += 3

    ch = state.input.charCodeAt(_position)

    if (ch === 0 || isWsOrEol(ch)) {
      return true
    }
  }

  return false
}

function writeFoldedLines (state, count) {
  if (count === 1) {
    state.result += ' '
  } else if (count > 1) {
    state.result += common.repeat('\n', count - 1)
  }
}

function readPlainScalar (state, nodeIndent, withinFlowCollection) {
  let captureStart
  let captureEnd
  let hasPendingContent
  let _line
  let _lineStart
  let _lineIndent
  const _kind = state.kind
  const _result = state.result

  let ch = state.input.charCodeAt(state.position)

  if (isWsOrEol(ch) ||
      isFlowIndicator(ch) ||
      ch === 0x23/* # */ ||
      ch === 0x26/* & */ ||
      ch === 0x2A/* * */ ||
      ch === 0x21/* ! */ ||
      ch === 0x7C/* | */ ||
      ch === 0x3E/* > */ ||
      ch === 0x27/* ' */ ||
      ch === 0x22/* " */ ||
      ch === 0x25/* % */ ||
      ch === 0x40/* @ */ ||
      ch === 0x60/* ` */) {
    return false
  }

  if (ch === 0x3F/* ? */ || ch === 0x2D/* - */) {
    const following = state.input.charCodeAt(state.position + 1)

    if (isWsOrEol(following) ||
        (withinFlowCollection && isFlowIndicator(following))) {
      return false
    }
  }

  state.kind = 'scalar'
  state.result = ''
  captureStart = captureEnd = state.position
  hasPendingContent = false

  while (ch !== 0) {
    if (ch === 0x3A/* : */) {
      const following = state.input.charCodeAt(state.position + 1)

      if (isWsOrEol(following) ||
          (withinFlowCollection && isFlowIndicator(following))) {
        break
      }
    } else if (ch === 0x23/* # */) {
      const preceding = state.input.charCodeAt(state.position - 1)

      if (isWsOrEol(preceding)) {
        break
      }
    } else if ((state.position === state.lineStart && testDocumentSeparator(state)) ||
               (withinFlowCollection && isFlowIndicator(ch))) {
      break
    } else if (isEol(ch)) {
      _line = state.line
      _lineStart = state.lineStart
      _lineIndent = state.lineIndent
      skipSeparationSpace(state, false, -1)

      if (state.lineIndent >= nodeIndent) {
        hasPendingContent = true
        ch = state.input.charCodeAt(state.position)
        continue
      } else {
        state.position = captureEnd
        state.line = _line
        state.lineStart = _lineStart
        state.lineIndent = _lineIndent
        break
      }
    }

    if (hasPendingContent) {
      captureSegment(state, captureStart, captureEnd, false)
      writeFoldedLines(state, state.line - _line)
      captureStart = captureEnd = state.position
      hasPendingContent = false
    }

    if (!isWhiteSpace(ch)) {
      captureEnd = state.position + 1
    }

    ch = state.input.charCodeAt(++state.position)
  }

  captureSegment(state, captureStart, captureEnd, false)

  if (state.result) {
    return true
  }

  state.kind = _kind
  state.result = _result
  return false
}

function readSingleQuotedScalar (state, nodeIndent) {
  let captureStart
  let captureEnd

  let ch = state.input.charCodeAt(state.position)

  if (ch !== 0x27/* ' */) {
    return false
  }

  state.kind = 'scalar'
  state.result = ''
  state.position++
  captureStart = captureEnd = state.position

  while ((ch = state.input.charCodeAt(state.position)) !== 0) {
    if (ch === 0x27/* ' */) {
      captureSegment(state, captureStart, state.position, true)
      ch = state.input.charCodeAt(++state.position)

      if (ch === 0x27/* ' */) {
        captureStart = state.position
        state.position++
        captureEnd = state.position
      } else {
        return true
      }
    } else if (isEol(ch)) {
      captureSegment(state, captureStart, captureEnd, true)
      writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent))
      captureStart = captureEnd = state.position
    } else if (state.position === state.lineStart && testDocumentSeparator(state)) {
      throwError(state, 'unexpected end of the document within a single quoted scalar')
    } else {
      state.position++
      if (!isWhiteSpace(ch)) {
        captureEnd = state.position
      }
    }
  }

  throwError(state, 'unexpected end of the stream within a single quoted scalar')
}

function readDoubleQuotedScalar (state, nodeIndent) {
  let captureStart
  let captureEnd
  let tmp

  let ch = state.input.charCodeAt(state.position)

  if (ch !== 0x22/* " */) {
    return false
  }

  state.kind = 'scalar'
  state.result = ''
  state.position++
  captureStart = captureEnd = state.position

  while ((ch = state.input.charCodeAt(state.position)) !== 0) {
    if (ch === 0x22/* " */) {
      captureSegment(state, captureStart, state.position, true)
      state.position++
      return true
    } else if (ch === 0x5C/* \ */) {
      captureSegment(state, captureStart, state.position, true)
      ch = state.input.charCodeAt(++state.position)

      if (isEol(ch)) {
        skipSeparationSpace(state, false, nodeIndent)

        // TODO: rework to inline fn with no type cast?
      } else if (ch < 256 && simpleEscapeCheck[ch]) {
        state.result += simpleEscapeMap[ch]
        state.position++
      } else if ((tmp = escapedHexLen(ch)) > 0) {
        let hexLength = tmp
        let hexResult = 0

        for (; hexLength > 0; hexLength--) {
          ch = state.input.charCodeAt(++state.position)

          if ((tmp = fromHexCode(ch)) >= 0) {
            hexResult = (hexResult << 4) + tmp
          } else {
            throwError(state, 'expected hexadecimal character')
          }
        }

        state.result += charFromCodepoint(hexResult)

        state.position++
      } else {
        throwError(state, 'unknown escape sequence')
      }

      captureStart = captureEnd = state.position
    } else if (isEol(ch)) {
      captureSegment(state, captureStart, captureEnd, true)
      writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent))
      captureStart = captureEnd = state.position
    } else if (state.position === state.lineStart && testDocumentSeparator(state)) {
      throwError(state, 'unexpected end of the document within a double quoted scalar')
    } else {
      state.position++
      if (!isWhiteSpace(ch)) {
        captureEnd = state.position
      }
    }
  }

  throwError(state, 'unexpected end of the stream within a double quoted scalar')
}

function readFlowCollection (state, nodeIndent) {
  let readNext = true
  let _line
  let _lineStart
  let _pos
  const _tag = state.tag
  let _result
  const _anchor = state.anchor
  let terminator
  let isPair
  let isExplicitPair
  let isMapping
  const overridableKeys = Object.create(null)
  let keyNode
  let keyTag
  let valueNode

  let ch = state.input.charCodeAt(state.position)

  if (ch === 0x5B/* [ */) {
    terminator = 0x5D/* ] */
    isMapping = false
    _result = []
  } else if (ch === 0x7B/* { */) {
    terminator = 0x7D/* } */
    isMapping = true
    _result = {}
  } else {
    return false
  }

  if (state.anchor !== null) {
    storeAnchor(state, state.anchor, _result)
  }

  ch = state.input.charCodeAt(++state.position)

  while (ch !== 0) {
    skipSeparationSpace(state, true, nodeIndent)

    ch = state.input.charCodeAt(state.position)

    if (ch === terminator) {
      state.position++
      state.tag = _tag
      state.anchor = _anchor
      state.kind = isMapping ? 'mapping' : 'sequence'
      state.result = _result
      return true
    } else if (!readNext) {
      throwError(state, 'missed comma between flow collection entries')
    } else if (ch === 0x2C/* , */) {
      // "flow collection entries can never be completely empty", as per YAML 1.2, section 7.4
      throwError(state, "expected the node content, but found ','")
    }

    keyTag = keyNode = valueNode = null
    isPair = isExplicitPair = false

    if (ch === 0x3F/* ? */) {
      const following = state.input.charCodeAt(state.position + 1)

      if (isWsOrEol(following)) {
        isPair = isExplicitPair = true
        state.position++
        skipSeparationSpace(state, true, nodeIndent)
      }
    }

    _line = state.line // Save the current line.
    _lineStart = state.lineStart
    _pos = state.position
    composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true)
    keyTag = state.tag
    keyNode = state.result
    skipSeparationSpace(state, true, nodeIndent)

    ch = state.input.charCodeAt(state.position)

    if ((isExplicitPair || state.line === _line) && ch === 0x3A/* : */) {
      isPair = true
      ch = state.input.charCodeAt(++state.position)
      skipSeparationSpace(state, true, nodeIndent)
      composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true)
      valueNode = state.result
    }

    if (isMapping) {
      storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos)
    } else if (isPair) {
      _result.push(storeMappingPair(state, null, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos))
    } else {
      _result.push(keyNode)
    }

    skipSeparationSpace(state, true, nodeIndent)

    ch = state.input.charCodeAt(state.position)

    if (ch === 0x2C/* , */) {
      readNext = true
      ch = state.input.charCodeAt(++state.position)
    } else {
      readNext = false
    }
  }

  throwError(state, 'unexpected end of the stream within a flow collection')
}

function readBlockScalar (state, nodeIndent) {
  let folding
  let chomping = CHOMPING_CLIP
  let didReadContent = false
  let detectedIndent = false
  let textIndent = nodeIndent
  let emptyLines = 0
  let atMoreIndented = false
  let tmp

  let ch = state.input.charCodeAt(state.position)

  if (ch === 0x7C/* | */) {
    folding = false
  } else if (ch === 0x3E/* > */) {
    folding = true
  } else {
    return false
  }

  state.kind = 'scalar'
  state.result = ''

  while (ch !== 0) {
    ch = state.input.charCodeAt(++state.position)

    if (ch === 0x2B/* + */ || ch === 0x2D/* - */) {
      if (CHOMPING_CLIP === chomping) {
        chomping = (ch === 0x2B/* + */) ? CHOMPING_KEEP : CHOMPING_STRIP
      } else {
        throwError(state, 'repeat of a chomping mode identifier')
      }
    } else if ((tmp = fromDecimalCode(ch)) >= 0) {
      if (tmp === 0) {
        throwError(state, 'bad explicit indentation width of a block scalar; it cannot be less than one')
      } else if (!detectedIndent) {
        textIndent = nodeIndent + tmp - 1
        detectedIndent = true
      } else {
        throwError(state, 'repeat of an indentation width identifier')
      }
    } else {
      break
    }
  }

  if (isWhiteSpace(ch)) {
    do { ch = state.input.charCodeAt(++state.position) }
    while (isWhiteSpace(ch))

    if (ch === 0x23/* # */) {
      do { ch = state.input.charCodeAt(++state.position) }
      while (!isEol(ch) && (ch !== 0))
    }
  }

  while (ch !== 0) {
    readLineBreak(state)
    state.lineIndent = 0

    ch = state.input.charCodeAt(state.position)

    // eslint-disable-next-line no-unmodified-loop-condition
    while ((!detectedIndent || state.lineIndent < textIndent) &&
           (ch === 0x20/* Space */)) {
      state.lineIndent++
      ch = state.input.charCodeAt(++state.position)
    }

    if (!detectedIndent && state.lineIndent > textIndent) {
      textIndent = state.lineIndent
    }

    if (isEol(ch)) {
      emptyLines++
      continue
    }

    if (!detectedIndent && textIndent === 0) {
      throwError(state, 'missing indentation for block scalar')
    }

    // End of the scalar.
    if (state.lineIndent < textIndent) {
      // Perform the chomping.
      if (chomping === CHOMPING_KEEP) {
        state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines)
      } else if (chomping === CHOMPING_CLIP) {
        if (didReadContent) { // i.e. only if the scalar is not empty.
          state.result += '\n'
        }
      }

      // Break this `while` cycle and go to the funciton's epilogue.
      break
    }

    // Folded style: use fancy rules to handle line breaks.
    if (folding) {
      // Lines starting with white space characters (more-indented lines) are not folded.
      if (isWhiteSpace(ch)) {
        atMoreIndented = true
        // except for the first content line (cf. Example 8.1)
        state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines)

      // End of more-indented block.
      } else if (atMoreIndented) {
        atMoreIndented = false
        state.result += common.repeat('\n', emptyLines + 1)

      // Just one line break - perceive as the same line.
      } else if (emptyLines === 0) {
        if (didReadContent) { // i.e. only if we have already read some scalar content.
          state.result += ' '
        }

      // Several line breaks - perceive as different lines.
      } else {
        state.result += common.repeat('\n', emptyLines)
      }

    // Literal style: just add exact number of line breaks between content lines.
    } else {
      // Keep all line breaks except the header line break.
      state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines)
    }

    didReadContent = true
    detectedIndent = true
    emptyLines = 0
    const captureStart = state.position

    while (!isEol(ch) && (ch !== 0)) {
      ch = state.input.charCodeAt(++state.position)
    }

    captureSegment(state, captureStart, state.position, false)
  }

  return true
}

function readBlockSequence (state, nodeIndent) {
  const _tag = state.tag
  const _anchor = state.anchor
  const _result = []
  let detected = false

  // there is a leading tab before this token, so it can't be a block sequence/mapping;
  // it can still be flow sequence/mapping or a scalar
  if (state.firstTabInLine !== -1) return false

  if (state.anchor !== null) {
    storeAnchor(state, state.anchor, _result)
  }

  let ch = state.input.charCodeAt(state.position)

  while (ch !== 0) {
    if (state.firstTabInLine !== -1) {
      state.position = state.firstTabInLine
      throwError(state, 'tab characters must not be used in indentation')
    }

    if (ch !== 0x2D/* - */) {
      break
    }

    const following = state.input.charCodeAt(state.position + 1)

    if (!isWsOrEol(following)) {
      break
    }

    detected = true
    state.position++

    if (skipSeparationSpace(state, true, -1)) {
      if (state.lineIndent <= nodeIndent) {
        _result.push(null)
        ch = state.input.charCodeAt(state.position)
        continue
      }
    }

    const _line = state.line
    composeNode(state, nodeIndent, CONTEXT_BLOCK_IN, false, true)
    _result.push(state.result)
    skipSeparationSpace(state, true, -1)

    ch = state.input.charCodeAt(state.position)

    if ((state.line === _line || state.lineIndent > nodeIndent) && (ch !== 0)) {
      throwError(state, 'bad indentation of a sequence entry')
    } else if (state.lineIndent < nodeIndent) {
      break
    }
  }

  if (detected) {
    state.tag = _tag
    state.anchor = _anchor
    state.kind = 'sequence'
    state.result = _result
    return true
  }
  return false
}

function readBlockMapping (state, nodeIndent, flowIndent) {
  let allowCompact
  let _keyLine
  let _keyLineStart
  let _keyPos
  const _tag = state.tag
  const _anchor = state.anchor
  const _result = {}
  const overridableKeys = Object.create(null)
  let keyTag = null
  let keyNode = null
  let valueNode = null
  let atExplicitKey = false
  let detected = false

  // there is a leading tab before this token, so it can't be a block sequence/mapping;
  // it can still be flow sequence/mapping or a scalar
  if (state.firstTabInLine !== -1) return false

  if (state.anchor !== null) {
    storeAnchor(state, state.anchor, _result)
  }

  let ch = state.input.charCodeAt(state.position)

  while (ch !== 0) {
    if (!atExplicitKey && state.firstTabInLine !== -1) {
      state.position = state.firstTabInLine
      throwError(state, 'tab characters must not be used in indentation')
    }

    const following = state.input.charCodeAt(state.position + 1)
    const _line = state.line // Save the current line.

    //
    // Explicit notation case. There are two separate blocks:
    // first for the key (denoted by "?") and second for the value (denoted by ":")
    //
    if ((ch === 0x3F/* ? */ || ch === 0x3A/* : */) && isWsOrEol(following)) {
      if (ch === 0x3F/* ? */) {
        if (atExplicitKey) {
          storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos)
          keyTag = keyNode = valueNode = null
        }

        detected = true
        atExplicitKey = true
        allowCompact = true
      } else if (atExplicitKey) {
        // i.e. 0x3A/* : */ === character after the explicit key.
        atExplicitKey = false
        allowCompact = true
      } else {
        throwError(state, 'incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line')
      }

      state.position += 1
      ch = following

    //
    // Implicit notation case. Flow-style node as the key first, then ":", and the value.
    //
    } else {
      _keyLine = state.line
      _keyLineStart = state.lineStart
      _keyPos = state.position

      if (!composeNode(state, flowIndent, CONTEXT_FLOW_OUT, false, true)) {
        // Neither implicit nor explicit notation.
        // Reading is done. Go to the epilogue.
        break
      }

      if (state.line === _line) {
        ch = state.input.charCodeAt(state.position)

        while (isWhiteSpace(ch)) {
          ch = state.input.charCodeAt(++state.position)
        }

        if (ch === 0x3A/* : */) {
          ch = state.input.charCodeAt(++state.position)

          if (!isWsOrEol(ch)) {
            throwError(state, 'a whitespace character is expected after the key-value separator within a block mapping')
          }

          if (atExplicitKey) {
            storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos)
            keyTag = keyNode = valueNode = null
          }

          detected = true
          atExplicitKey = false
          allowCompact = false
          keyTag = state.tag
          keyNode = state.result
        } else if (detected) {
          throwError(state, 'can not read an implicit mapping pair; a colon is missed')
        } else {
          state.tag = _tag
          state.anchor = _anchor
          return true // Keep the result of `composeNode`.
        }
      } else if (detected) {
        throwError(state, 'can not read a block mapping entry; a multiline key may not be an implicit key')
      } else {
        state.tag = _tag
        state.anchor = _anchor
        return true // Keep the result of `composeNode`.
      }
    }

    //
    // Common reading code for both explicit and implicit notations.
    //
    if (state.line === _line || state.lineIndent > nodeIndent) {
      if (atExplicitKey) {
        _keyLine = state.line
        _keyLineStart = state.lineStart
        _keyPos = state.position
      }

      if (composeNode(state, nodeIndent, CONTEXT_BLOCK_OUT, true, allowCompact)) {
        if (atExplicitKey) {
          keyNode = state.result
        } else {
          valueNode = state.result
        }
      }

      if (!atExplicitKey) {
        storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _keyLine, _keyLineStart, _keyPos)
        keyTag = keyNode = valueNode = null
      }

      skipSeparationSpace(state, true, -1)
      ch = state.input.charCodeAt(state.position)
    }

    if ((state.line === _line || state.lineIndent > nodeIndent) && (ch !== 0)) {
      throwError(state, 'bad indentation of a mapping entry')
    } else if (state.lineIndent < nodeIndent) {
      break
    }
  }

  //
  // Epilogue.
  //

  // Special case: last mapping's node contains only the key in explicit notation.
  if (atExplicitKey) {
    storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos)
  }

  // Expose the resulting mapping.
  if (detected) {
    state.tag = _tag
    state.anchor = _anchor
    state.kind = 'mapping'
    state.result = _result
  }

  return detected
}

function readTagProperty (state) {
  let isVerbatim = false
  let isNamed = false
  let tagHandle
  let tagName

  let ch = state.input.charCodeAt(state.position)

  if (ch !== 0x21/* ! */) return false

  if (state.tag !== null) {
    throwError(state, 'duplication of a tag property')
  }

  ch = state.input.charCodeAt(++state.position)

  if (ch === 0x3C/* < */) {
    isVerbatim = true
    ch = state.input.charCodeAt(++state.position)
  } else if (ch === 0x21/* ! */) {
    isNamed = true
    tagHandle = '!!'
    ch = state.input.charCodeAt(++state.position)
  } else {
    tagHandle = '!'
  }

  let _position = state.position

  if (isVerbatim) {
    do { ch = state.input.charCodeAt(++state.position) }
    while (ch !== 0 && ch !== 0x3E/* > */)

    if (state.position < state.length) {
      tagName = state.input.slice(_position, state.position)
      ch = state.input.charCodeAt(++state.position)
    } else {
      throwError(state, 'unexpected end of the stream within a verbatim tag')
    }
  } else {
    while (ch !== 0 && !isWsOrEol(ch)) {
      if (ch === 0x21/* ! */) {
        if (!isNamed) {
          tagHandle = state.input.slice(_position - 1, state.position + 1)

          if (!PATTERN_TAG_HANDLE.test(tagHandle)) {
            throwError(state, 'named tag handle cannot contain such characters')
          }

          isNamed = true
          _position = state.position + 1
        } else {
          throwError(state, 'tag suffix cannot contain exclamation marks')
        }
      }

      ch = state.input.charCodeAt(++state.position)
    }

    tagName = state.input.slice(_position, state.position)

    if (PATTERN_FLOW_INDICATORS.test(tagName)) {
      throwError(state, 'tag suffix cannot contain flow indicator characters')
    }
  }

  if (tagName && !PATTERN_TAG_URI.test(tagName)) {
    throwError(state, 'tag name cannot contain such characters: ' + tagName)
  }

  try {
    tagName = decodeURIComponent(tagName)
  } catch (err) {
    throwError(state, 'tag name is malformed: ' + tagName)
  }

  if (isVerbatim) {
    state.tag = tagName
  } else if (_hasOwnProperty.call(state.tagMap, tagHandle)) {
    state.tag = state.tagMap[tagHandle] + tagName
  } else if (tagHandle === '!') {
    state.tag = '!' + tagName
  } else if (tagHandle === '!!') {
    state.tag = 'tag:yaml.org,2002:' + tagName
  } else {
    throwError(state, 'undeclared tag handle "' + tagHandle + '"')
  }

  return true
}

function readAnchorProperty (state) {
  let ch = state.input.charCodeAt(state.position)

  if (ch !== 0x26/* & */) return false

  if (state.anchor !== null) {
    throwError(state, 'duplication of an anchor property')
  }

  ch = state.input.charCodeAt(++state.position)
  const _position = state.position

  while (ch !== 0 && !isWsOrEol(ch) && !isFlowIndicator(ch)) {
    ch = state.input.charCodeAt(++state.position)
  }

  if (state.position === _position) {
    throwError(state, 'name of an anchor node must contain at least one character')
  }

  state.anchor = state.input.slice(_position, state.position)
  return true
}

function readAlias (state) {
  let ch = state.input.charCodeAt(state.position)

  if (ch !== 0x2A/* * */) return false

  ch = state.input.charCodeAt(++state.position)
  const _position = state.position

  while (ch !== 0 && !isWsOrEol(ch) && !isFlowIndicator(ch)) {
    ch = state.input.charCodeAt(++state.position)
  }

  if (state.position === _position) {
    throwError(state, 'name of an alias node must contain at least one character')
  }

  const alias = state.input.slice(_position, state.position)

  if (!_hasOwnProperty.call(state.anchorMap, alias)) {
    throwError(state, 'unidentified alias "' + alias + '"')
  }

  state.result = state.anchorMap[alias]
  skipSeparationSpace(state, true, -1)
  return true
}

function tryReadBlockMappingFromProperty (state, propertyStart, nodeIndent, flowIndent) {
  const fallbackState = snapshotState(state)

  beginAnchorTransaction(state)
  restoreState(state, propertyStart)

  // Re-read the leading properties as part of the first implicit key, not as
  // properties of the current node.
  state.tag = null
  state.anchor = null
  state.kind = null
  state.result = null

  if (readBlockMapping(state, nodeIndent, flowIndent) && state.kind === 'mapping') {
    commitAnchorTransaction(state)
    return true
  }

  rollbackAnchorTransaction(state)
  restoreState(state, fallbackState)
  return false
}

function composeNode (state, parentIndent, nodeContext, allowToSeek, allowCompact) {
  let allowBlockScalars
  let allowBlockCollections
  let indentStatus = 1 // 1: this>parent, 0: this=parent, -1: this<parent
  let atNewLine = false
  let hasContent = false
  let propertyStart = null
  let type
  let flowIndent
  let blockIndent

  if (state.depth >= state.maxDepth) {
    throwError(state, 'nesting exceeded maxDepth (' + state.maxDepth + ')')
  }

  state.depth += 1

  if (state.listener !== null) {
    state.listener('open', state)
  }

  state.tag = null
  state.anchor = null
  state.kind = null
  state.result = null

  const allowBlockStyles = allowBlockScalars = allowBlockCollections =
    CONTEXT_BLOCK_OUT === nodeContext ||
    CONTEXT_BLOCK_IN === nodeContext

  if (allowToSeek) {
    if (skipSeparationSpace(state, true, -1)) {
      atNewLine = true

      if (state.lineIndent > parentIndent) {
        indentStatus = 1
      } else if (state.lineIndent === parentIndent) {
        indentStatus = 0
      } else if (state.lineIndent < parentIndent) {
        indentStatus = -1
      }
    }
  }

  if (indentStatus === 1) {
    while (true) {
      const ch = state.input.charCodeAt(state.position)
      const propertyState = snapshotState(state)

      // A duplicate property token after a line break can be the first key of
      // a nested block mapping, e.g. `!!map\n  !!str key: value`.
      if (atNewLine &&
          ((ch === 0x21/* ! */ && state.tag !== null) ||
           (ch === 0x26/* & */ && state.anchor !== null))) {
        break
      }

      if (!readTagProperty(state) && !readAnchorProperty(state)) {
        break
      }

      if (propertyStart === null) {
        propertyStart = propertyState
      }

      if (skipSeparationSpace(state, true, -1)) {
        atNewLine = true
        allowBlockCollections = allowBlockStyles

        if (state.lineIndent > parentIndent) {
          indentStatus = 1
        } else if (state.lineIndent === parentIndent) {
          indentStatus = 0
        } else if (state.lineIndent < parentIndent) {
          indentStatus = -1
        }
      } else {
        allowBlockCollections = false
      }
    }
  }

  if (allowBlockCollections) {
    allowBlockCollections = atNewLine || allowCompact
  }

  if (indentStatus === 1 || CONTEXT_BLOCK_OUT === nodeContext) {
    if (CONTEXT_FLOW_IN === nodeContext || CONTEXT_FLOW_OUT === nodeContext) {
      flowIndent = parentIndent
    } else {
      flowIndent = parentIndent + 1
    }

    blockIndent = state.position - state.lineStart

    if (indentStatus === 1) {
      if ((allowBlockCollections &&
          (readBlockSequence(state, blockIndent) || readBlockMapping(state, blockIndent, flowIndent))) ||
          readFlowCollection(state, flowIndent)) {
        hasContent = true
      } else {
        const ch = state.input.charCodeAt(state.position)

        if (propertyStart !== null && allowBlockStyles && !allowBlockCollections &&
            ch !== 0x7C/* | */ && ch !== 0x3E/* > */ &&
            tryReadBlockMappingFromProperty(
              state,
              propertyStart,
              propertyStart.position - propertyStart.lineStart,
              flowIndent
            )) {
          hasContent = true
        } else if ((allowBlockScalars && readBlockScalar(state, flowIndent)) ||
            readSingleQuotedScalar(state, flowIndent) ||
            readDoubleQuotedScalar(state, flowIndent)) {
          hasContent = true
        } else if (readAlias(state)) {
          hasContent = true

          if (state.tag !== null || state.anchor !== null) {
            throwError(state, 'alias node should not have any properties')
          }
        } else if (readPlainScalar(state, flowIndent, CONTEXT_FLOW_IN === nodeContext)) {
          hasContent = true

          if (state.tag === null) {
            state.tag = '?'
          }
        }

        if (state.anchor !== null) {
          storeAnchor(state, state.anchor, state.result)
        }
      }
    } else if (indentStatus === 0) {
      // Special case: block sequences are allowed to have same indentation level as the parent.
      // http://www.yaml.org/spec/1.2/spec.html#id2799784
      hasContent = allowBlockCollections && readBlockSequence(state, blockIndent)
    }
  }

  if (state.tag === null) {
    if (state.anchor !== null) {
      storeAnchor(state, state.anchor, state.result)
    }
  } else if (state.tag === '?') {
    // Implicit resolving is not allowed for non-scalar types, and '?'
    // non-specific tag is only automatically assigned to plain scalars.
    //
    // We only need to check kind conformity in case user explicitly assigns '?'
    // tag, for example like this: "!<?> [0]"
    //
    if (state.result !== null && state.kind !== 'scalar') {
      throwError(state, 'unacceptable node kind for !<?> tag; it should be "scalar", not "' + state.kind + '"')
    }

    for (let typeIndex = 0, typeQuantity = state.implicitTypes.length; typeIndex < typeQuantity; typeIndex += 1) {
      type = state.implicitTypes[typeIndex]

      if (type.resolve(state.result)) { // `state.result` updated in resolver if matched
        state.result = type.construct(state.result)
        state.tag = type.tag
        if (state.anchor !== null) {
          storeAnchor(state, state.anchor, state.result)
        }
        break
      }
    }
  } else if (state.tag !== '!') {
    if (_hasOwnProperty.call(state.typeMap[state.kind || 'fallback'], state.tag)) {
      type = state.typeMap[state.kind || 'fallback'][state.tag]
    } else {
      // looking for multi type
      type = null
      const typeList = state.typeMap.multi[state.kind || 'fallback']

      for (let typeIndex = 0, typeQuantity = typeList.length; typeIndex < typeQuantity; typeIndex += 1) {
        if (state.tag.slice(0, typeList[typeIndex].tag.length) === typeList[typeIndex].tag) {
          type = typeList[typeIndex]
          break
        }
      }
    }

    if (!type) {
      throwError(state, 'unknown tag !<' + state.tag + '>')
    }

    if (state.result !== null && type.kind !== state.kind) {
      throwError(state, 'unacceptable node kind for !<' + state.tag + '> tag; it should be "' + type.kind + '", not "' + state.kind + '"')
    }

    if (!type.resolve(state.result, state.tag)) { // `state.result` updated in resolver if matched
      throwError(state, 'cannot resolve a node with !<' + state.tag + '> explicit tag')
    } else {
      state.result = type.construct(state.result, state.tag)
      if (state.anchor !== null) {
        storeAnchor(state, state.anchor, state.result)
      }
    }
  }

  if (state.listener !== null) {
    state.listener('close', state)
  }

  state.depth -= 1
  return state.tag !== null || state.anchor !== null || hasContent
}

function readDocument (state) {
  const documentStart = state.position
  let hasDirectives = false
  let ch

  state.version = null
  state.checkLineBreaks = state.legacy
  state.tagMap = Object.create(null)
  state.anchorMap = Object.create(null)

  while ((ch = state.input.charCodeAt(state.position)) !== 0) {
    skipSeparationSpace(state, true, -1)

    ch = state.input.charCodeAt(state.position)

    if (state.lineIndent > 0 || ch !== 0x25/* % */) {
      break
    }

    hasDirectives = true
    ch = state.input.charCodeAt(++state.position)
    let _position = state.position

    while (ch !== 0 && !isWsOrEol(ch)) {
      ch = state.input.charCodeAt(++state.position)
    }

    const directiveName = state.input.slice(_position, state.position)
    const directiveArgs = []

    if (directiveName.length < 1) {
      throwError(state, 'directive name must not be less than one character in length')
    }

    while (ch !== 0) {
      while (isWhiteSpace(ch)) {
        ch = state.input.charCodeAt(++state.position)
      }

      if (ch === 0x23/* # */) {
        do { ch = state.input.charCodeAt(++state.position) }
        while (ch !== 0 && !isEol(ch))
        break
      }

      if (isEol(ch)) break

      _position = state.position

      while (ch !== 0 && !isWsOrEol(ch)) {
        ch = state.input.charCodeAt(++state.position)
      }

      directiveArgs.push(state.input.slice(_position, state.position))
    }

    if (ch !== 0) readLineBreak(state)

    if (_hasOwnProperty.call(directiveHandlers, directiveName)) {
      directiveHandlers[directiveName](state, directiveName, directiveArgs)
    } else {
      throwWarning(state, 'unknown document directive "' + directiveName + '"')
    }
  }

  skipSeparationSpace(state, true, -1)

  if (state.lineIndent === 0 &&
      state.input.charCodeAt(state.position) === 0x2D/* - */ &&
      state.input.charCodeAt(state.position + 1) === 0x2D/* - */ &&
      state.input.charCodeAt(state.position + 2) === 0x2D/* - */) {
    state.position += 3
    skipSeparationSpace(state, true, -1)
  } else if (hasDirectives) {
    throwError(state, 'directives end mark is expected')
  }

  composeNode(state, state.lineIndent - 1, CONTEXT_BLOCK_OUT, false, true)
  skipSeparationSpace(state, true, -1)

  if (state.checkLineBreaks &&
      PATTERN_NON_ASCII_LINE_BREAKS.test(state.input.slice(documentStart, state.position))) {
    throwWarning(state, 'non-ASCII line breaks are interpreted as content')
  }

  state.documents.push(state.result)

  if (state.position === state.lineStart && testDocumentSeparator(state)) {
    if (state.input.charCodeAt(state.position) === 0x2E/* . */) {
      state.position += 3
      skipSeparationSpace(state, true, -1)
    }
    return
  }

  if (state.position < (state.length - 1)) {
    throwError(state, 'end of the stream or a document separator is expected')
  }
}

function loadDocuments (input, options) {
  input = String(input)
  options = options || {}

  if (input.length !== 0) {
    // Add tailing `\n` if not exists
    if (input.charCodeAt(input.length - 1) !== 0x0A/* LF */ &&
        input.charCodeAt(input.length - 1) !== 0x0D/* CR */) {
      input += '\n'
    }

    // Strip BOM
    if (input.charCodeAt(0) === 0xFEFF) {
      input = input.slice(1)
    }
  }

  const state = new State(input, options)

  const nullpos = input.indexOf('\0')

  if (nullpos !== -1) {
    state.position = nullpos
    throwError(state, 'null byte is not allowed in input')
  }

  // Use 0 as string terminator. That significantly simplifies bounds check.
  state.input += '\0'

  while (state.input.charCodeAt(state.position) === 0x20/* Space */) {
    state.lineIndent += 1
    state.position += 1
  }

  while (state.position < (state.length - 1)) {
    readDocument(state)
  }

  return state.documents
}

function loadAll (input, iterator, options) {
  if (iterator !== null && typeof iterator === 'object' && typeof options === 'undefined') {
    options = iterator
    iterator = null
  }

  const documents = loadDocuments(input, options)

  if (typeof iterator !== 'function') {
    return documents
  }

  for (let index = 0, length = documents.length; index < length; index += 1) {
    iterator(documents[index])
  }
}

function load (input, options) {
  const documents = loadDocuments(input, options)

  if (documents.length === 0) {
    return undefined
  } else if (documents.length === 1) {
    return documents[0]
  }
  throw new YAMLException('expected a single document in the stream, but found more')
}

module.exports.loadAll = loadAll
module.exports.load = load
'use strict'

const YAMLException = require('./exception')
const Type = require('./type')

function compileList (schema, name) {
  const result = []

  schema[name].forEach(function (currentType) {
    let newIndex = result.length

    result.forEach(function (previousType, previousIndex) {
      if (previousType.tag === currentType.tag &&
          previousType.kind === currentType.kind &&
          previousType.multi === currentType.multi) {
        newIndex = previousIndex
      }
    })

    result[newIndex] = currentType
  })

  return result
}

function compileMap (/* lists... */) {
  const result = {
    scalar: {},
    sequence: {},
    mapping: {},
    fallback: {},
    multi: {
      scalar: [],
      sequence: [],
      mapping: [],
      fallback: []
    }
  }
  function collectType (type) {
    if (type.multi) {
      result.multi[type.kind].push(type)
      result.multi['fallback'].push(type)
    } else {
      result[type.kind][type.tag] = result['fallback'][type.tag] = type
    }
  }

  for (let index = 0, length = arguments.length; index < length; index += 1) {
    arguments[index].forEach(collectType)
  }
  return result
}

function Schema (definition) {
  return this.extend(definition)
}

Schema.prototype.extend = function extend (definition) {
  let implicit = []
  let explicit = []

  if (definition instanceof Type) {
    // Schema.extend(type)
    explicit.push(definition)
  } else if (Array.isArray(definition)) {
    // Schema.extend([ type1, type2, ... ])
    explicit = explicit.concat(definition)
  } else if (definition && (Array.isArray(definition.implicit) || Array.isArray(definition.explicit))) {
    // Schema.extend({ explicit: [ type1, type2, ... ], implicit: [ type1, type2, ... ] })
    if (definition.implicit) implicit = implicit.concat(definition.implicit)
    if (definition.explicit) explicit = explicit.concat(definition.explicit)
  } else {
    throw new YAMLException('Schema.extend argument should be a Type, [ Type ], ' +
      'or a schema definition ({ implicit: [...], explicit: [...] })')
  }

  implicit.forEach(function (type) {
    if (!(type instanceof Type)) {
      throw new YAMLException('Specified list of YAML types (or a single Type object) contains a non-Type object.')
    }

    if (type.loadKind && type.loadKind !== 'scalar') {
      throw new YAMLException('There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.')
    }

    if (type.multi) {
      throw new YAMLException('There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.')
    }
  })

  explicit.forEach(function (type) {
    if (!(type instanceof Type)) {
      throw new YAMLException('Specified list of YAML types (or a single Type object) contains a non-Type object.')
    }
  })

  const result = Object.create(Schema.prototype)

  result.implicit = (this.implicit || []).concat(implicit)
  result.explicit = (this.explicit || []).concat(explicit)

  result.compiledImplicit = compileList(result, 'implicit')
  result.compiledExplicit = compileList(result, 'explicit')
  result.compiledTypeMap = compileMap(result.compiledImplicit, result.compiledExplicit)

  return result
}

module.exports = Schema
// Standard YAML's Core schema.
// http://www.yaml.org/spec/1.2/spec.html#id2804923
//
// NOTE: JS-YAML does not support schema-specific tag resolution restrictions.
// So, Core schema has no distinctions from JSON schema is JS-YAML.

'use strict'

module.exports = require('./json')
// JS-YAML's default schema for `safeLoad` function.
// It is not described in the YAML specification.
//
// This schema is based on standard YAML's Core schema and includes most of
// extra types described at YAML tag repository. (http://yaml.org/type/)

'use strict'

module.exports = require('./core').extend({
  implicit: [
    require('../type/timestamp'),
    require('../type/merge')
  ],
  explicit: [
    require('../type/binary'),
    require('../type/omap'),
    require('../type/pairs'),
    require('../type/set')
  ]
})
// Standard YAML's Failsafe schema.
// http://www.yaml.org/spec/1.2/spec.html#id2802346

'use strict'

const Schema = require('../schema')

module.exports = new Schema({
  explicit: [
    require('../type/str'),
    require('../type/seq'),
    require('../type/map')
  ]
})
// Standard YAML's JSON schema.
// http://www.yaml.org/spec/1.2/spec.html#id2803231
//
// NOTE: JS-YAML does not support schema-specific tag resolution restrictions.
// So, this schema is not such strict as defined in the YAML specification.
// It allows numbers in binary notaion, use `Null` and `NULL` as `null`, etc.

'use strict'

module.exports = require('./failsafe').extend({
  implicit: [
    require('../type/null'),
    require('../type/bool'),
    require('../type/int'),
    require('../type/float')
  ]
})
'use strict'

const common = require('./common')

// get snippet for a single line, respecting maxLength
function getLine (buffer, lineStart, lineEnd, position, maxLineLength) {
  let head = ''
  let tail = ''
  const maxHalfLength = Math.floor(maxLineLength / 2) - 1

  if (position - lineStart > maxHalfLength) {
    head = ' ... '
    lineStart = position - maxHalfLength + head.length
  }

  if (lineEnd - position > maxHalfLength) {
    tail = ' ...'
    lineEnd = position + maxHalfLength - tail.length
  }

  return {
    str: head + buffer.slice(lineStart, lineEnd).replace(/\t/g, 'â†’') + tail,
    pos: position - lineStart + head.length // relative position
  }
}

function padStart (string, max) {
  return common.repeat(' ', max - string.length) + string
}

function makeSnippet (mark, options) {
  options = Object.create(options || null)

  if (!mark.buffer) return null

  if (!options.maxLength) options.maxLength = 79
  if (typeof options.indent !== 'number') options.indent = 1
  if (typeof options.linesBefore !== 'number') options.linesBefore = 3
  if (typeof options.linesAfter !== 'number') options.linesAfter = 2

  const re = /\r?\n|\r|\0/g
  const lineStarts = [0]
  const lineEnds = []
  let match
  let foundLineNo = -1

  while ((match = re.exec(mark.buffer))) {
    lineEnds.push(match.index)
    lineStarts.push(match.index + match[0].length)

    if (mark.position <= match.index && foundLineNo < 0) {
      foundLineNo = lineStarts.length - 2
    }
  }

  if (foundLineNo < 0) foundLineNo = lineStarts.length - 1

  let result = ''
  const lineNoLength = Math.min(mark.line + options.linesAfter, lineEnds.length).toString().length
  const maxLineLength = options.maxLength - (options.indent + lineNoLength + 3)

  for (let i = 1; i <= options.linesBefore; i++) {
    if (foundLineNo - i < 0) break
    const line = getLine(
      mark.buffer,
      lineStarts[foundLineNo - i],
      lineEnds[foundLineNo - i],
      mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo - i]),
      maxLineLength
    )
    result = common.repeat(' ', options.indent) + padStart((mark.line - i + 1).toString(), lineNoLength) +
      ' | ' + line.str + '\n' + result
  }

  const line = getLine(mark.buffer, lineStarts[foundLineNo], lineEnds[foundLineNo], mark.position, maxLineLength)
  result += common.repeat(' ', options.indent) + padStart((mark.line + 1).toString(), lineNoLength) +
    ' | ' + line.str + '\n'
  result += common.repeat('-', options.indent + lineNoLength + 3 + line.pos) + '^' + '\n'

  for (let i = 1; i <= options.linesAfter; i++) {
    if (foundLineNo + i >= lineEnds.length) break
    const line = getLine(
      mark.buffer,
      lineStarts[foundLineNo + i],
      lineEnds[foundLineNo + i],
      mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo + i]),
      maxLineLength
    )
    result += common.repeat(' ', options.indent) + padStart((mark.line + i + 1).toString(), lineNoLength) +
      ' | ' + line.str + '\n'
  }

  return result.replace(/\n$/, '')
}

module.exports = makeSnippet
'use strict'

const YAMLException = require('./exception')

const TYPE_CONSTRUCTOR_OPTIONS = [
  'kind',
  'multi',
  'resolve',
  'construct',
  'instanceOf',
  'predicate',
  'represent',
  'representName',
  'defaultStyle',
  'styleAliases'
]

const YAML_NODE_KINDS = [
  'scalar',
  'sequence',
  'mapping'
]

function compileStyleAliases (map) {
  const result = {}

  if (map !== null) {
    Object.keys(map).forEach(function (style) {
      map[style].forEach(function (alias) {
        result[String(alias)] = style
      })
    })
  }

  return result
}

function Type (tag, options) {
  options = options || {}

  Object.keys(options).forEach(function (name) {
    if (TYPE_CONSTRUCTOR_OPTIONS.indexOf(name) === -1) {
      throw new YAMLException('Unknown option "' + name + '" is met in definition of "' + tag + '" YAML type.')
    }
  })

  // TODO: Add tag format check.
  this.options = options // keep original options in case user wants to extend this type later
  this.tag = tag
  this.kind = options['kind'] || null
  this.resolve = options['resolve'] || function () { return true }
  this.construct = options['construct'] || function (data) { return data }
  this.instanceOf = options['instanceOf'] || null
  this.predicate = options['predicate'] || null
  this.represent = options['represent'] || null
  this.representName = options['representName'] || null
  this.defaultStyle = options['defaultStyle'] || null
  this.multi = options['multi'] || false
  this.styleAliases = compileStyleAliases(options['styleAliases'] || null)

  if (YAML_NODE_KINDS.indexOf(this.kind) === -1) {
    throw new YAMLException('Unknown kind "' + this.kind + '" is specified for "' + tag + '" YAML type.')
  }
}

module.exports = Type
'use strict'

const Type = require('../type')

// [ 64, 65, 66 ] -> [ padding, CR, LF ]
const BASE64_MAP = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r'

function resolveYamlBinary (data) {
  if (data === null) return false

  let bitlen = 0
  const max = data.length
  const map = BASE64_MAP

  // Convert one by one.
  for (let idx = 0; idx < max; idx++) {
    const code = map.indexOf(data.charAt(idx))

    // Skip CR/LF
    if (code > 64) continue

    // Fail on illegal characters
    if (code < 0) return false

    bitlen += 6
  }

  // If there are any bits left, source was corrupted
  return (bitlen % 8) === 0
}

function constructYamlBinary (data) {
  const input = data.replace(/[\r\n=]/g, '') // remove CR/LF & padding to simplify scan
  const max = input.length
  const map = BASE64_MAP
  let bits = 0
  const result = []

  // Collect by 6*4 bits (3 bytes)

  for (let idx = 0; idx < max; idx++) {
    if ((idx % 4 === 0) && idx) {
      result.push((bits >> 16) & 0xFF)
      result.push((bits >> 8) & 0xFF)
      result.push(bits & 0xFF)
    }

    bits = (bits << 6) | map.indexOf(input.charAt(idx))
  }

  // Dump tail

  const tailbits = (max % 4) * 6

  if (tailbits === 0) {
    result.push((bits >> 16) & 0xFF)
    result.push((bits >> 8) & 0xFF)
    result.push(bits & 0xFF)
  } else if (tailbits === 18) {
    result.push((bits >> 10) & 0xFF)
    result.push((bits >> 2) & 0xFF)
  } else if (tailbits === 12) {
    result.push((bits >> 4) & 0xFF)
  }

  return new Uint8Array(result)
}

function representYamlBinary (object /*, style */) {
  let result = ''
  let bits = 0
  const max = object.length
  const map = BASE64_MAP

  // Convert every three bytes to 4 ASCII characters.

  for (let idx = 0; idx < max; idx++) {
    if ((idx % 3 === 0) && idx) {
      result += map[(bits >> 18) & 0x3F]
      result += map[(bits >> 12) & 0x3F]
      result += map[(bits >> 6) & 0x3F]
      result += map[bits & 0x3F]
    }

    bits = (bits << 8) + object[idx]
  }

  // Dump tail

  const tail = max % 3

  if (tail === 0) {
    result += map[(bits >> 18) & 0x3F]
    result += map[(bits >> 12) & 0x3F]
    result += map[(bits >> 6) & 0x3F]
    result += map[bits & 0x3F]
  } else if (tail === 2) {
    result += map[(bits >> 10) & 0x3F]
    result += map[(bits >> 4) & 0x3F]
    result += map[(bits << 2) & 0x3F]
    result += map[64]
  } else if (tail === 1) {
    result += map[(bits >> 2) & 0x3F]
    result += map[(bits << 4) & 0x3F]
    result += map[64]
    result += map[64]
  }

  return result
}

function isBinary (obj) {
  return Object.prototype.toString.call(obj) === '[object Uint8Array]'
}

module.exports = new Type('tag:yaml.org,2002:binary', {
  kind: 'scalar',
  resolve: resolveYamlBinary,
  construct: constructYamlBinary,
  predicate: isBinary,
  represent: representYamlBinary
})
'use strict'

const Type = require('../type')

function resolveYamlBoolean (data) {
  if (data === null) return false

  const max = data.length

  return (max === 4 && (data === 'true' || data === 'True' || data === 'TRUE')) ||
         (max === 5 && (data === 'false' || data === 'False' || data === 'FALSE'))
}

function constructYamlBoolean (data) {
  return data === 'true' ||
         data === 'True' ||
         data === 'TRUE'
}

function isBoolean (object) {
  return Object.prototype.toString.call(object) === '[object Boolean]'
}

module.exports = new Type('tag:yaml.org,2002:bool', {
  kind: 'scalar',
  resolve: resolveYamlBoolean,
  construct: constructYamlBoolean,
  predicate: isBoolean,
  represent: {
    lowercase: function (object) { return object ? 'true' : 'false' },
    uppercase: function (object) { return object ? 'TRUE' : 'FALSE' },
    camelcase: function (object) { return object ? 'True' : 'False' }
  },
  defaultStyle: 'lowercase'
})
'use strict'

const common = require('../common')
const Type = require('../type')

const YAML_FLOAT_PATTERN = new RegExp(
  // 2.5e4, 2.5 and integers
  '^(?:[-+]?(?:[0-9]+)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?' +
  // .2e4, .2
  // special case, seems not from spec
  '|\\.[0-9]+(?:[eE][-+]?[0-9]+)?' +
  // .inf
  '|[-+]?\\.(?:inf|Inf|INF)' +
  // .nan
  '|\\.(?:nan|NaN|NAN))$')

const YAML_FLOAT_SPECIAL_PATTERN = new RegExp(
  '^(?:' +
  // .inf
  '[-+]?\\.(?:inf|Inf|INF)' +
  // .nan
  '|\\.(?:nan|NaN|NAN))$')

function resolveYamlFloat (data) {
  if (data === null) return false

  if (!YAML_FLOAT_PATTERN.test(data)) {
    return false
  }

  if (isFinite(parseFloat(data, 10))) {
    return true
  }

  return YAML_FLOAT_SPECIAL_PATTERN.test(data)
}

function constructYamlFloat (data) {
  let value = data.toLowerCase()
  const sign = value[0] === '-' ? -1 : 1

  if ('+-'.indexOf(value[0]) >= 0) {
    value = value.slice(1)
  }

  if (value === '.inf') {
    return (sign === 1) ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY
  } else if (value === '.nan') {
    return NaN
  }
  return sign * parseFloat(value, 10)
}

const SCIENTIFIC_WITHOUT_DOT = /^[-+]?[0-9]+e/

function representYamlFloat (object, style) {
  if (isNaN(object)) {
    switch (style) {
      case 'lowercase': return '.nan'
      case 'uppercase': return '.NAN'
      case 'camelcase': return '.NaN'
    }
  } else if (Number.POSITIVE_INFINITY === object) {
    switch (style) {
      case 'lowercase': return '.inf'
      case 'uppercase': return '.INF'
      case 'camelcase': return '.Inf'
    }
  } else if (Number.NEGATIVE_INFINITY === object) {
    switch (style) {
      case 'lowercase': return '-.inf'
      case 'uppercase': return '-.INF'
      case 'camelcase': return '-.Inf'
    }
  } else if (common.isNegativeZero(object)) {
    return '-0.0'
  }

  const res = object.toString(10)

  // JS stringifier can build scientific format without dots: 5e-100,
  // while YAML requres dot: 5.e-100. Fix it with simple hack

  return SCIENTIFIC_WITHOUT_DOT.test(res) ? res.replace('e', '.e') : res
}

function isFloat (object) {
  return (Object.prototype.toString.call(object) === '[object Number]') &&
         (object % 1 !== 0 || common.isNegativeZero(object))
}

module.exports = new Type('tag:yaml.org,2002:float', {
  kind: 'scalar',
  resolve: resolveYamlFloat,
  construct: constructYamlFloat,
  predicate: isFloat,
  represent: representYamlFloat,
  defaultStyle: 'lowercase'
})
'use strict'

const common = require('../common')
const Type = require('../type')

function isHexCode (c) {
  return ((c >= 0x30/* 0 */) && (c <= 0x39/* 9 */)) ||
         ((c >= 0x41/* A */) && (c <= 0x46/* F */)) ||
         ((c >= 0x61/* a */) && (c <= 0x66/* f */))
}

function isOctCode (c) {
  return ((c >= 0x30/* 0 */) && (c <= 0x37/* 7 */))
}

function isDecCode (c) {
  return ((c >= 0x30/* 0 */) && (c <= 0x39/* 9 */))
}

function resolveYamlInteger (data) {
  if (data === null) return false

  const max = data.length
  let index = 0
  let hasDigits = false

  if (!max) return false

  let ch = data[index]

  // sign
  if (ch === '-' || ch === '+') {
    ch = data[++index]
  }

  if (ch === '0') {
    // 0
    if (index + 1 === max) return true
    ch = data[++index]

    // base 2, base 8, base 16

    if (ch === 'b') {
      // base 2
      index++

      for (; index < max; index++) {
        ch = data[index]
        if (ch !== '0' && ch !== '1') return false
        hasDigits = true
      }
      return hasDigits && isFinite(parseYamlInteger(data))
    }

    if (ch === 'x') {
      // base 16
      index++

      for (; index < max; index++) {
        if (!isHexCode(data.charCodeAt(index))) return false
        hasDigits = true
      }
      return hasDigits && isFinite(parseYamlInteger(data))
    }

    if (ch === 'o') {
      // base 8
      index++

      for (; index < max; index++) {
        if (!isOctCode(data.charCodeAt(index))) return false
        hasDigits = true
      }
      return hasDigits && isFinite(parseYamlInteger(data))
    }
  }

  // base 10 (except 0)

  for (; index < max; index++) {
    if (!isDecCode(data.charCodeAt(index))) {
      return false
    }
    hasDigits = true
  }

  if (!hasDigits) return false

  return isFinite(parseYamlInteger(data))
}

function parseYamlInteger (data) {
  let value = data
  let sign = 1

  let ch = value[0]

  if (ch === '-' || ch === '+') {
    if (ch === '-') sign = -1
    value = value.slice(1)
    ch = value[0]
  }

  if (value === '0') return 0

  if (ch === '0') {
    if (value[1] === 'b') return sign * parseInt(value.slice(2), 2)
    if (value[1] === 'x') return sign * parseInt(value.slice(2), 16)
    if (value[1] === 'o') return sign * parseInt(value.slice(2), 8)
  }

  return sign * parseInt(value, 10)
}

function constructYamlInteger (data) {
  return parseYamlInteger(data)
}

function isInteger (object) {
  return (Object.prototype.toString.call(object)) === '[object Number]' &&
         (object % 1 === 0 && !common.isNegativeZero(object))
}

module.exports = new Type('tag:yaml.org,2002:int', {
  kind: 'scalar',
  resolve: resolveYamlInteger,
  construct: constructYamlInteger,
  predicate: isInteger,
  represent: {
    binary: function (obj) { return obj >= 0 ? '0b' + obj.toString(2) : '-0b' + obj.toString(2).slice(1) },
    octal: function (obj) { return obj >= 0 ? '0o' + obj.toString(8) : '-0o' + obj.toString(8).slice(1) },
    decimal: function (obj) { return obj.toString(10) },
    hexadecimal: function (obj) { return obj >= 0 ? '0x' + obj.toString(16).toUpperCase() : '-0x' + obj.toString(16).toUpperCase().slice(1) }
  },
  defaultStyle: 'decimal',
  styleAliases: {
    binary: [2, 'bin'],
    octal: [8, 'oct'],
    decimal: [10, 'dec'],
    hexadecimal: [16, 'hex']
  }
})
'use strict'

const Type = require('../type')

module.exports = new Type('tag:yaml.org,2002:map', {
  kind: 'mapping',
  construct: function (data) { return data !== null ? data : {} }
})
'use strict'

const Type = require('../type')

function resolveYamlMerge (data) {
  return data === '<<' || data === null
}

module.exports = new Type('tag:yaml.org,2002:merge', {
  kind: 'scalar',
  resolve: resolveYamlMerge
})
'use strict'

const Type = require('../type')

function resolveYamlNull (data) {
  if (data === null) return true

  const max = data.length

  return (max === 1 && data === '~') ||
         (max === 4 && (data === 'null' || data === 'Null' || data === 'NULL'))
}

function constructYamlNull () {
  return null
}

function isNull (object) {
  return object === null
}

module.exports = new Type('tag:yaml.org,2002:null', {
  kind: 'scalar',
  resolve: resolveYamlNull,
  construct: constructYamlNull,
  predicate: isNull,
  represent: {
    canonical: function () { return '~' },
    lowercase: function () { return 'null' },
    uppercase: function () { return 'NULL' },
    camelcase: function () { return 'Null' },
    empty: function () { return '' }
  },
  defaultStyle: 'lowercase'
})
'use strict'

const Type = require('../type')

const _hasOwnProperty = Object.prototype.hasOwnProperty
const _toString = Object.prototype.toString

function resolveYamlOmap (data) {
  if (data === null) return true

  const objectKeys = []
  const object = data

  for (let index = 0, length = object.length; index < length; index += 1) {
    const pair = object[index]
    let pairHasKey = false

    if (_toString.call(pair) !== '[object Object]') return false

    let pairKey
    for (pairKey in pair) {
      if (_hasOwnProperty.call(pair, pairKey)) {
        if (!pairHasKey) pairHasKey = true
        else return false
      }
    }

    if (!pairHasKey) return false

    if (objectKeys.indexOf(pairKey) === -1) objectKeys.push(pairKey)
    else return false
  }

  return true
}

function constructYamlOmap (data) {
  return data !== null ? data : []
}

module.exports = new Type('tag:yaml.org,2002:omap', {
  kind: 'sequence',
  resolve: resolveYamlOmap,
  construct: constructYamlOmap
})
'use strict'

const Type = require('../type')

const _toString = Object.prototype.toString

function resolveYamlPairs (data) {
  if (data === null) return true

  const object = data

  const result = new Array(object.length)

  for (let index = 0, length = object.length; index < length; index += 1) {
    const pair = object[index]

    if (_toString.call(pair) !== '[object Object]') return false

    const keys = Object.keys(pair)

    if (keys.length !== 1) return false

    result[index] = [keys[0], pair[keys[0]]]
  }

  return true
}

function constructYamlPairs (data) {
  if (data === null) return []

  const object = data
  const result = new Array(object.length)

  for (let index = 0, length = object.length; index < length; index += 1) {
    const pair = object[index]

    const keys = Object.keys(pair)

    result[index] = [keys[0], pair[keys[0]]]
  }

  return result
}

module.exports = new Type('tag:yaml.org,2002:pairs', {
  kind: 'sequence',
  resolve: resolveYamlPairs,
  construct: constructYamlPairs
})
'use strict'

const Type = require('../type')

module.exports = new Type('tag:yaml.org,2002:seq', {
  kind: 'sequence',
  construct: function (data) { return data !== null ? data : [] }
})
'use strict'

const Type = require('../type')

const _hasOwnProperty = Object.prototype.hasOwnProperty

function resolveYamlSet (data) {
  if (data === null) return true

  const object = data

  for (const key in object) {
    if (_hasOwnProperty.call(object, key)) {
      if (object[key] !== null) return false
    }
  }

  return true
}

function constructYamlSet (data) {
  return data !== null ? data : {}
}

module.exports = new Type('tag:yaml.org,2002:set', {
  kind: 'mapping',
  resolve: resolveYamlSet,
  construct: constructYamlSet
})
'use strict'

const Type = require('../type')

module.exports = new Type('tag:yaml.org,2002:str', {
  kind: 'scalar',
  construct: function (data) { return data !== null ? data : '' }
})
'use strict'

const Type = require('../type')

const YAML_DATE_REGEXP = new RegExp(
  '^([0-9][0-9][0-9][0-9])' + // [1] year
  '-([0-9][0-9])' + // [2] month
  '-([0-9][0-9])$')                   // [3] day

const YAML_TIMESTAMP_REGEXP = new RegExp(
  '^([0-9][0-9][0-9][0-9])' + // [1] year
  '-([0-9][0-9]?)' + // [2] month
  '-([0-9][0-9]?)' + // [3] day
  '(?:[Tt]|[ \\t]+)' + // ...
  '([0-9][0-9]?)' + // [4] hour
  ':([0-9][0-9])' + // [5] minute
  ':([0-9][0-9])' + // [6] second
  '(?:\\.([0-9]*))?' + // [7] fraction
  '(?:[ \\t]*(Z|([-+])([0-9][0-9]?)' + // [8] tz [9] tz_sign [10] tzHour
  '(?::([0-9][0-9]))?))?$')           // [11] tzMinute

function resolveYamlTimestamp (data) {
  if (data === null) return false
  if (YAML_DATE_REGEXP.exec(data) !== null) return true
  if (YAML_TIMESTAMP_REGEXP.exec(data) !== null) return true
  return false
}

function constructYamlTimestamp (data) {
  let fraction = 0
  let delta = null

  let match = YAML_DATE_REGEXP.exec(data)
  if (match === null) match = YAML_TIMESTAMP_REGEXP.exec(data)

  if (match === null) throw new Error('Date resolve error')

  // match: [1] year [2] month [3] day

  const year = +(match[1])
  const month = +(match[2]) - 1 // JS month starts with 0
  const day = +(match[3])

  if (!match[4]) { // no hour
    return new Date(Date.UTC(year, month, day))
  }

  // match: [4] hour [5] minute [6] second [7] fraction

  const hour = +(match[4])
  const minute = +(match[5])
  const second = +(match[6])

  if (match[7]) {
    fraction = match[7].slice(0, 3)
    while (fraction.length < 3) { // milli-seconds
      fraction += '0'
    }
    fraction = +fraction
  }

  // match: [8] tz [9] tz_sign [10] tzHour [11] tzMinute

  if (match[9]) {
    const tzHour = +(match[10])
    const tzMinute = +(match[11] || 0)
    delta = (tzHour * 60 + tzMinute) * 60000 // delta in mili-seconds
    if (match[9] === '-') delta = -delta
  }

  const date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction))

  if (delta) date.setTime(date.getTime() - delta)

  return date
}

function representYamlTimestamp (object /*, style */) {
  return object.toISOString()
}

module.exports = new Type('tag:yaml.org,2002:timestamp', {
  kind: 'scalar',
  resolve: resolveYamlTimestamp,
  construct: constructYamlTimestamp,
  instanceOf: Date,
  represent: representYamlTimestamp
})
{
  "name": "js-yaml",
  "version": "4.3.0",
  "description": "YAML 1.2 parser and serializer",
  "author": "Vladimir Zapparov <dervus.grim@gmail.com>",
  "license": "MIT",
  "repository": "nodeca/js-yaml",
  "funding": [
    {
      "type": "github",
      "url": "https://github.com/sponsors/puzrin"
    },
    {
      "type": "github",
      "url": "https://github.com/sponsors/nodeca"
    }
  ],
  "files": [
    "index.js",
    "lib/",
    "bin/",
    "dist/"
  ],
  "publishConfig": {
    "tag": "v4-legacy"
  },
  "bin": {
    "js-yaml": "bin/js-yaml.js"
  },
  "module": "./dist/js-yaml.mjs",
  "exports": {
    ".": {
      "import": "./dist/js-yaml.mjs",
      "require": "./index.js"
    },
    "./package.json": "./package.json"
  },
  "unpkg": "dist/js-yaml.min.js",
  "jsdelivr": "dist/js-yaml.min.js",
  "dependencies": {
    "argparse": "^2.0.1"
  },
  "devDependencies": {
    "@babel/core": "8.0.1",
    "@babel/preset-env": "8.0.1",
    "@rollup/plugin-commonjs": "29.0.3",
    "@rollup/plugin-terser": "0.4.4",
    "c8": "^11.0.0",
    "codemirror": "^5.65.21",
    "eslint": "^9.39.4",
    "fast-check": "^4.8.0",
    "gh-pages": "^6.3.0",
    "neostandard": "^0.13.0",
    "tinybench": "^6.0.2",
    "vite": "7.3.6",
    "vite-plugin-node-polyfills": "^0.28.0",
    "vite-plugin-singlefile": "^2.3.3",
    "workerpool": "^10.0.2"
  }
}(The MIT License)

Copyright (c) 2012-2015, JP Richardson <jprichardson@gmail.com>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files
(the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify,
 merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
 furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
 ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
let _fs
try {
  _fs = require('graceful-fs')
} catch (_) {
  _fs = require('fs')
}
const universalify = require('universalify')
const { stringify, stripBom } = require('./utils')

async function _readFile (file, options = {}) {
  if (typeof options === 'string') {
    options = { encoding: options }
  }

  const fs = options.fs || _fs

  const shouldThrow = 'throws' in options ? options.throws : true

  let data = await universalify.fromCallback(fs.readFile)(file, options)

  data = stripBom(data)

  let obj
  try {
    obj = JSON.parse(data, options ? options.reviver : null)
  } catch (err) {
    if (shouldThrow) {
      err.message = `${file}: ${err.message}`
      throw err
    } else {
      return null
    }
  }

  return obj
}

const readFile = universalify.fromPromise(_readFile)

function readFileSync (file, options = {}) {
  if (typeof options === 'string') {
    options = { encoding: options }
  }

  const fs = options.fs || _fs

  const shouldThrow = 'throws' in options ? options.throws : true

  try {
    let content = fs.readFileSync(file, options)
    content = stripBom(content)
    return JSON.parse(content, options.reviver)
  } catch (err) {
    if (shouldThrow) {
      err.message = `${file}: ${err.message}`
      throw err
    } else {
      return null
    }
  }
}

async function _writeFile (file, obj, options = {}) {
  const fs = options.fs || _fs

  const str = stringify(obj, options)

  await universalify.fromCallback(fs.writeFile)(file, str, options)
}

const writeFile = universalify.fromPromise(_writeFile)

function writeFileSync (file, obj, options = {}) {
  const fs = options.fs || _fs

  const str = stringify(obj, options)
  // not sure if fs.writeFileSync returns anything, but just in case
  return fs.writeFileSync(file, str, options)
}

// NOTE: do not change this export format; required for ESM compat
// see https://github.com/jprichardson/node-jsonfile/pull/162 for details
module.exports = {
  readFile,
  readFileSync,
  writeFile,
  writeFileSync
}
{
  "name": "jsonfile",
  "version": "6.2.1",
  "description": "Easily read/write JSON files.",
  "repository": {
    "type": "git",
    "url": "git@github.com:jprichardson/node-jsonfile.git"
  },
  "author": "JP Richardson <jprichardson@gmail.com>",
  "license": "MIT",
  "dependencies": {
    "universalify": "^2.0.0"
  },
  "optionalDependencies": {
    "graceful-fs": "^4.1.6"
  },
  "devDependencies": {
    "mocha": "^8.2.0",
    "rimraf": "^2.4.0",
    "standard": "^16.0.1"
  },
  "main": "index.js",
  "files": [
    "index.js",
    "utils.js"
  ]
}function stringify (obj, { EOL = '\n', finalEOL = true, replacer = null, spaces } = {}) {
  const EOF = finalEOL ? EOL : ''
  const str = JSON.stringify(obj, replacer, spaces)

  if (str === undefined) {
    throw new TypeError(`Converting ${typeof obj} value to JSON is not supported`)
  }

  return str.replace(/\n/g, EOL) + EOF
}

function stripBom (content) {
  // we do this because JSON.parse would convert it to a utf8 string if encoding wasn't specified
  if (Buffer.isBuffer(content)) content = content.toString('utf8')
  return content.replace(/^\uFEFF/, '')
}

module.exports = { stringify, stripBom }
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Lazy = void 0;
class Lazy {
    constructor(creator) {
        this._value = null;
        this.creator = creator;
    }
    get hasValue() {
        return this.creator == null;
    }
    get value() {
        if (this.creator == null) {
            return this._value;
        }
        const result = this.creator();
        this.value = result;
        return result;
    }
    set value(value) {
        this._value = value;
        this.creator = null;
    }
}
exports.Lazy = Lazy;
//# sourceMappingURL=main.js.map{"version":3,"file":"main.js","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":";;;AAAA,MAAa,IAAI;IAIf,YAAY,OAAyB;QAH7B,WAAM,GAAsB,IAAI,CAAA;QAItC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;IACxB,CAAC;IAED,IAAI,QAAQ;QACV,OAAO,IAAI,CAAC,OAAO,IAAI,IAAI,CAAA;IAC7B,CAAC;IAED,IAAI,KAAK;QACP,IAAI,IAAI,CAAC,OAAO,IAAI,IAAI,EAAE;YACxB,OAAO,IAAI,CAAC,MAAQ,CAAA;SACrB;QAED,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,EAAE,CAAA;QAC7B,IAAI,CAAC,KAAK,GAAG,MAAM,CAAA;QACnB,OAAO,MAAM,CAAA;IACf,CAAC;IAED,IAAI,KAAK,CAAC,KAAiB;QACzB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAA;QACnB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAA;IACrB,CAAC;CACF;AA1BD,oBA0BC","sourcesContent":["export class Lazy<T> {\n  private _value: Promise<T> | null = null\n  private creator: (() => Promise<T>) | null\n\n  constructor(creator: () => Promise<T>) {\n    this.creator = creator\n  }\n\n  get hasValue() {\n    return this.creator == null\n  }\n\n  get value(): Promise<T> {\n    if (this.creator == null) {\n      return this._value!!\n    }\n\n    const result = this.creator()\n    this.value = result\n    return result\n  }\n\n  set value(value: Promise<T>) {\n    this._value = value\n    this.creator = null\n  }\n}"]}{
  "name": "lazy-val",
  "version": "1.0.5",
  "main": "out/main.js",
  "author": "Vladimir Krivosheev",
  "license": "MIT",
  "repository": "develar/lazy-val",
  "homepage": "https://github.com/develar/lazy-val",
  "files": [
    "out"
  ],
  "devDependencies": {
    "typescript": "^4.2.4"
  },
  "typings": "./out/main.d.ts"
}Copyright jQuery Foundation and other contributors <https://jquery.org/>

Based on Underscore.js, copyright Jeremy Ashkenas,
DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/>

This software consists of voluntary contributions made by many
individuals. For exact contribution history, see the revision history
available at https://github.com/lodash/lodash

The following license applies to all parts of this software except as
documented below:

====

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

====

Copyright and related rights for sample code are waived via CC0. Sample
code is defined as all source code displayed within the prose of the
documentation.

CC0: http://creativecommons.org/publicdomain/zero/1.0/

====

Files located in the node_modules and vendor directories are externally
maintained libraries used by this software which have their own
licenses; we recommend you read them, as their terms may differ from the
terms above.
/**
 * lodash (Custom Build) <https://lodash.com/>
 * Build: `lodash modularize exports="npm" -o ./`
 * Copyright jQuery Foundation and other contributors <https://jquery.org/>
 * Released under MIT license <https://lodash.com/license>
 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
 */

/** Used as references for various `Number` constants. */
var INFINITY = 1 / 0;

/** `Object#toString` result references. */
var symbolTag = '[object Symbol]';

/**
 * Used to match `RegExp`
 * [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns).
 */
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,
    reHasRegExpChar = RegExp(reRegExpChar.source);

/** Detect free variable `global` from Node.js. */
var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;

/** Detect free variable `self`. */
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;

/** Used as a reference to the global object. */
var root = freeGlobal || freeSelf || Function('return this')();

/** Used for built-in method references. */
var objectProto = Object.prototype;

/**
 * Used to resolve the
 * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
 * of values.
 */
var objectToString = objectProto.toString;

/** Built-in value references. */
var Symbol = root.Symbol;

/** Used to convert symbols to primitives and strings. */
var symbolProto = Symbol ? Symbol.prototype : undefined,
    symbolToString = symbolProto ? symbolProto.toString : undefined;

/**
 * The base implementation of `_.toString` which doesn't convert nullish
 * values to empty strings.
 *
 * @private
 * @param {*} value The value to process.
 * @returns {string} Returns the string.
 */
function baseToString(value) {
  // Exit early for strings to avoid a performance hit in some environments.
  if (typeof value == 'string') {
    return value;
  }
  if (isSymbol(value)) {
    return symbolToString ? symbolToString.call(value) : '';
  }
  var result = (value + '');
  return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
}

/**
 * Checks if `value` is object-like. A value is object-like if it's not `null`
 * and has a `typeof` result of "object".
 *
 * @static
 * @memberOf _
 * @since 4.0.0
 * @category Lang
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
 * @example
 *
 * _.isObjectLike({});
 * // => true
 *
 * _.isObjectLike([1, 2, 3]);
 * // => true
 *
 * _.isObjectLike(_.noop);
 * // => false
 *
 * _.isObjectLike(null);
 * // => false
 */
function isObjectLike(value) {
  return !!value && typeof value == 'object';
}

/**
 * Checks if `value` is classified as a `Symbol` primitive or object.
 *
 * @static
 * @memberOf _
 * @since 4.0.0
 * @category Lang
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
 * @example
 *
 * _.isSymbol(Symbol.iterator);
 * // => true
 *
 * _.isSymbol('abc');
 * // => false
 */
function isSymbol(value) {
  return typeof value == 'symbol' ||
    (isObjectLike(value) && objectToString.call(value) == symbolTag);
}

/**
 * Converts `value` to a string. An empty string is returned for `null`
 * and `undefined` values. The sign of `-0` is preserved.
 *
 * @static
 * @memberOf _
 * @since 4.0.0
 * @category Lang
 * @param {*} value The value to process.
 * @returns {string} Returns the string.
 * @example
 *
 * _.toString(null);
 * // => ''
 *
 * _.toString(-0);
 * // => '-0'
 *
 * _.toString([1, 2, 3]);
 * // => '1,2,3'
 */
function toString(value) {
  return value == null ? '' : baseToString(value);
}

/**
 * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+",
 * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`.
 *
 * @static
 * @memberOf _
 * @since 3.0.0
 * @category String
 * @param {string} [string=''] The string to escape.
 * @returns {string} Returns the escaped string.
 * @example
 *
 * _.escapeRegExp('[lodash](https://lodash.com/)');
 * // => '\[lodash\]\(https://lodash\.com/\)'
 */
function escapeRegExp(string) {
  string = toString(string);
  return (string && reHasRegExpChar.test(string))
    ? string.replace(reRegExpChar, '\\$&')
    : string;
}

module.exports = escapeRegExp;
{
  "name": "lodash.escaperegexp",
  "version": "4.1.2",
  "description": "The lodash method `_.escapeRegExp` exported as a module.",
  "homepage": "https://lodash.com/",
  "icon": "https://lodash.com/icon.svg",
  "license": "MIT",
  "author": "John-David Dalton <john.david.dalton@gmail.com> (http://allyoucanleet.com/)",
  "repository": "lodash/lodash"
}Copyright JS Foundation and other contributors <https://js.foundation/>

Based on Underscore.js, copyright Jeremy Ashkenas,
DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/>

This software consists of voluntary contributions made by many
individuals. For exact contribution history, see the revision history
available at https://github.com/lodash/lodash

The following license applies to all parts of this software except as
documented below:

====

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

====

Copyright and related rights for sample code are waived via CC0. Sample
code is defined as all source code displayed within the prose of the
documentation.

CC0: http://creativecommons.org/publicdomain/zero/1.0/

====

Files located in the node_modules and vendor directories are externally
maintained libraries used by this software which have their own
licenses; we recommend you read them, as their terms may differ from the
terms above.
/**
 * Lodash (Custom Build) <https://lodash.com/>
 * Build: `lodash modularize exports="npm" -o ./`
 * Copyright JS Foundation and other contributors <https://js.foundation/>
 * Released under MIT license <https://lodash.com/license>
 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
 */

/** Used as the size to enable large array optimizations. */
var LARGE_ARRAY_SIZE = 200;

/** Used to stand-in for `undefined` hash values. */
var HASH_UNDEFINED = '__lodash_hash_undefined__';

/** Used to compose bitmasks for value comparisons. */
var COMPARE_PARTIAL_FLAG = 1,
    COMPARE_UNORDERED_FLAG = 2;

/** Used as references for various `Number` constants. */
var MAX_SAFE_INTEGER = 9007199254740991;

/** `Object#toString` result references. */
var argsTag = '[object Arguments]',
    arrayTag = '[object Array]',
    asyncTag = '[object AsyncFunction]',
    boolTag = '[object Boolean]',
    dateTag = '[object Date]',
    errorTag = '[object Error]',
    funcTag = '[object Function]',
    genTag = '[object GeneratorFunction]',
    mapTag = '[object Map]',
    numberTag = '[object Number]',
    nullTag = '[object Null]',
    objectTag = '[object Object]',
    promiseTag = '[object Promise]',
    proxyTag = '[object Proxy]',
    regexpTag = '[object RegExp]',
    setTag = '[object Set]',
    stringTag = '[object String]',
    symbolTag = '[object Symbol]',
    undefinedTag = '[object Undefined]',
    weakMapTag = '[object WeakMap]';

var arrayBufferTag = '[object ArrayBuffer]',
    dataViewTag = '[object DataView]',
    float32Tag = '[object Float32Array]',
    float64Tag = '[object Float64Array]',
    int8Tag = '[object Int8Array]',
    int16Tag = '[object Int16Array]',
    int32Tag = '[object Int32Array]',
    uint8Tag = '[object Uint8Array]',
    uint8ClampedTag = '[object Uint8ClampedArray]',
    uint16Tag = '[object Uint16Array]',
    uint32Tag = '[object Uint32Array]';

/**
 * Used to match `RegExp`
 * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
 */
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;

/** Used to detect host constructors (Safari). */
var reIsHostCtor = /^\[object .+?Constructor\]$/;

/** Used to detect unsigned integer values. */
var reIsUint = /^(?:0|[1-9]\d*)$/;

/** Used to identify `toStringTag` values of typed arrays. */
var typedArrayTags = {};
typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
typedArrayTags[uint32Tag] = true;
typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
typedArrayTags[errorTag] = typedArrayTags[funcTag] =
typedArrayTags[mapTag] = typedArrayTags[numberTag] =
typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
typedArrayTags[setTag] = typedArrayTags[stringTag] =
typedArrayTags[weakMapTag] = false;

/** Detect free variable `global` from Node.js. */
var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;

/** Detect free variable `self`. */
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;

/** Used as a reference to the global object. */
var root = freeGlobal || freeSelf || Function('return this')();

/** Detect free variable `exports`. */
var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;

/** Detect free variable `module`. */
var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;

/** Detect the popular CommonJS extension `module.exports`. */
var moduleExports = freeModule && freeModule.exports === freeExports;

/** Detect free variable `process` from Node.js. */
var freeProcess = moduleExports && freeGlobal.process;

/** Used to access faster Node.js helpers. */
var nodeUtil = (function() {
  try {
    return freeProcess && freeProcess.binding && freeProcess.binding('util');
  } catch (e) {}
}());

/* Node.js helper references. */
var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;

/**
 * A specialized version of `_.filter` for arrays without support for
 * iteratee shorthands.
 *
 * @private
 * @param {Array} [array] The array to iterate over.
 * @param {Function} predicate The function invoked per iteration.
 * @returns {Array} Returns the new filtered array.
 */
function arrayFilter(array, predicate) {
  var index = -1,
      length = array == null ? 0 : array.length,
      resIndex = 0,
      result = [];

  while (++index < length) {
    var value = array[index];
    if (predicate(value, index, array)) {
      result[resIndex++] = value;
    }
  }
  return result;
}

/**
 * Appends the elements of `values` to `array`.
 *
 * @private
 * @param {Array} array The array to modify.
 * @param {Array} values The values to append.
 * @returns {Array} Returns `array`.
 */
function arrayPush(array, values) {
  var index = -1,
      length = values.length,
      offset = array.length;

  while (++index < length) {
    array[offset + index] = values[index];
  }
  return array;
}

/**
 * A specialized version of `_.some` for arrays without support for iteratee
 * shorthands.
 *
 * @private
 * @param {Array} [array] The array to iterate over.
 * @param {Function} predicate The function invoked per iteration.
 * @returns {boolean} Returns `true` if any element passes the predicate check,
 *  else `false`.
 */
function arraySome(array, predicate) {
  var index = -1,
      length = array == null ? 0 : array.length;

  while (++index < length) {
    if (predicate(array[index], index, array)) {
      return true;
    }
  }
  return false;
}

/**
 * The base implementation of `_.times` without support for iteratee shorthands
 * or max array length checks.
 *
 * @private
 * @param {number} n The number of times to invoke `iteratee`.
 * @param {Function} iteratee The function invoked per iteration.
 * @returns {Array} Returns the array of results.
 */
function baseTimes(n, iteratee) {
  var index = -1,
      result = Array(n);

  while (++index < n) {
    result[index] = iteratee(index);
  }
  return result;
}

/**
 * The base implementation of `_.unary` without support for storing metadata.
 *
 * @private
 * @param {Function} func The function to cap arguments for.
 * @returns {Function} Returns the new capped function.
 */
function baseUnary(func) {
  return function(value) {
    return func(value);
  };
}

/**
 * Checks if a `cache` value for `key` exists.
 *
 * @private
 * @param {Object} cache The cache to query.
 * @param {string} key The key of the entry to check.
 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
 */
function cacheHas(cache, key) {
  return cache.has(key);
}

/**
 * Gets the value at `key` of `object`.
 *
 * @private
 * @param {Object} [object] The object to query.
 * @param {string} key The key of the property to get.
 * @returns {*} Returns the property value.
 */
function getValue(object, key) {
  return object == null ? undefined : object[key];
}

/**
 * Converts `map` to its key-value pairs.
 *
 * @private
 * @param {Object} map The map to convert.
 * @returns {Array} Returns the key-value pairs.
 */
function mapToArray(map) {
  var index = -1,
      result = Array(map.size);

  map.forEach(function(value, key) {
    result[++index] = [key, value];
  });
  return result;
}

/**
 * Creates a unary function that invokes `func` with its argument transformed.
 *
 * @private
 * @param {Function} func The function to wrap.
 * @param {Function} transform The argument transform.
 * @returns {Function} Returns the new function.
 */
function overArg(func, transform) {
  return function(arg) {
    return func(transform(arg));
  };
}

/**
 * Converts `set` to an array of its values.
 *
 * @private
 * @param {Object} set The set to convert.
 * @returns {Array} Returns the values.
 */
function setToArray(set) {
  var index = -1,
      result = Array(set.size);

  set.forEach(function(value) {
    result[++index] = value;
  });
  return result;
}

/** Used for built-in method references. */
var arrayProto = Array.prototype,
    funcProto = Function.prototype,
    objectProto = Object.prototype;

/** Used to detect overreaching core-js shims. */
var coreJsData = root['__core-js_shared__'];

/** Used to resolve the decompiled source of functions. */
var funcToString = funcProto.toString;

/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;

/** Used to detect methods masquerading as native. */
var maskSrcKey = (function() {
  var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  return uid ? ('Symbol(src)_1.' + uid) : '';
}());

/**
 * Used to resolve the
 * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
 * of values.
 */
var nativeObjectToString = objectProto.toString;

/** Used to detect if a method is native. */
var reIsNative = RegExp('^' +
  funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
);

/** Built-in value references. */
var Buffer = moduleExports ? root.Buffer : undefined,
    Symbol = root.Symbol,
    Uint8Array = root.Uint8Array,
    propertyIsEnumerable = objectProto.propertyIsEnumerable,
    splice = arrayProto.splice,
    symToStringTag = Symbol ? Symbol.toStringTag : undefined;

/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeGetSymbols = Object.getOwnPropertySymbols,
    nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
    nativeKeys = overArg(Object.keys, Object);

/* Built-in method references that are verified to be native. */
var DataView = getNative(root, 'DataView'),
    Map = getNative(root, 'Map'),
    Promise = getNative(root, 'Promise'),
    Set = getNative(root, 'Set'),
    WeakMap = getNative(root, 'WeakMap'),
    nativeCreate = getNative(Object, 'create');

/** Used to detect maps, sets, and weakmaps. */
var dataViewCtorString = toSource(DataView),
    mapCtorString = toSource(Map),
    promiseCtorString = toSource(Promise),
    setCtorString = toSource(Set),
    weakMapCtorString = toSource(WeakMap);

/** Used to convert symbols to primitives and strings. */
var symbolProto = Symbol ? Symbol.prototype : undefined,
    symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;

/**
 * Creates a hash object.
 *
 * @private
 * @constructor
 * @param {Array} [entries] The key-value pairs to cache.
 */
function Hash(entries) {
  var index = -1,
      length = entries == null ? 0 : entries.length;

  this.clear();
  while (++index < length) {
    var entry = entries[index];
    this.set(entry[0], entry[1]);
  }
}

/**
 * Removes all key-value entries from the hash.
 *
 * @private
 * @name clear
 * @memberOf Hash
 */
function hashClear() {
  this.__data__ = nativeCreate ? nativeCreate(null) : {};
  this.size = 0;
}

/**
 * Removes `key` and its value from the hash.
 *
 * @private
 * @name delete
 * @memberOf Hash
 * @param {Object} hash The hash to modify.
 * @param {string} key The key of the value to remove.
 * @returns {boolean} Returns `true` if the entry was removed, else `false`.
 */
function hashDelete(key) {
  var result = this.has(key) && delete this.__data__[key];
  this.size -= result ? 1 : 0;
  return result;
}

/**
 * Gets the hash value for `key`.
 *
 * @private
 * @name get
 * @memberOf Hash
 * @param {string} key The key of the value to get.
 * @returns {*} Returns the entry value.
 */
function hashGet(key) {
  var data = this.__data__;
  if (nativeCreate) {
    var result = data[key];
    return result === HASH_UNDEFINED ? undefined : result;
  }
  return hasOwnProperty.call(data, key) ? data[key] : undefined;
}

/**
 * Checks if a hash value for `key` exists.
 *
 * @private
 * @name has
 * @memberOf Hash
 * @param {string} key The key of the entry to check.
 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
 */
function hashHas(key) {
  var data = this.__data__;
  return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
}

/**
 * Sets the hash `key` to `value`.
 *
 * @private
 * @name set
 * @memberOf Hash
 * @param {string} key The key of the value to set.
 * @param {*} value The value to set.
 * @returns {Object} Returns the hash instance.
 */
function hashSet(key, value) {
  var data = this.__data__;
  this.size += this.has(key) ? 0 : 1;
  data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  return this;
}

// Add methods to `Hash`.
Hash.prototype.clear = hashClear;
Hash.prototype['delete'] = hashDelete;
Hash.prototype.get = hashGet;
Hash.prototype.has = hashHas;
Hash.prototype.set = hashSet;

/**
 * Creates an list cache object.
 *
 * @private
 * @constructor
 * @param {Array} [entries] The key-value pairs to cache.
 */
function ListCache(entries) {
  var index = -1,
      length = entries == null ? 0 : entries.length;

  this.clear();
  while (++index < length) {
    var entry = entries[index];
    this.set(entry[0], entry[1]);
  }
}

/**
 * Removes all key-value entries from the list cache.
 *
 * @private
 * @name clear
 * @memberOf ListCache
 */
function listCacheClear() {
  this.__data__ = [];
  this.size = 0;
}

/**
 * Removes `key` and its value from the list cache.
 *
 * @private
 * @name delete
 * @memberOf ListCache
 * @param {string} key The key of the value to remove.
 * @returns {boolean} Returns `true` if the entry was removed, else `false`.
 */
function listCacheDelete(key) {
  var data = this.__data__,
      index = assocIndexOf(data, key);

  if (index < 0) {
    return false;
  }
  var lastIndex = data.length - 1;
  if (index == lastIndex) {
    data.pop();
  } else {
    splice.call(data, index, 1);
  }
  --this.size;
  return true;
}

/**
 * Gets the list cache value for `key`.
 *
 * @private
 * @name get
 * @memberOf ListCache
 * @param {string} key The key of the value to get.
 * @returns {*} Returns the entry value.
 */
function listCacheGet(key) {
  var data = this.__data__,
      index = assocIndexOf(data, key);

  return index < 0 ? undefined : data[index][1];
}

/**
 * Checks if a list cache value for `key` exists.
 *
 * @private
 * @name has
 * @memberOf ListCache
 * @param {string} key The key of the entry to check.
 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
 */
function listCacheHas(key) {
  return assocIndexOf(this.__data__, key) > -1;
}

/**
 * Sets the list cache `key` to `value`.
 *
 * @private
 * @name set
 * @memberOf ListCache
 * @param {string} key The key of the value to set.
 * @param {*} value The value to set.
 * @returns {Object} Returns the list cache instance.
 */
function listCacheSet(key, value) {
  var data = this.__data__,
      index = assocIndexOf(data, key);

  if (index < 0) {
    ++this.size;
    data.push([key, value]);
  } else {
    data[index][1] = value;
  }
  return this;
}

// Add methods to `ListCache`.
ListCache.prototype.clear = listCacheClear;
ListCache.prototype['delete'] = listCacheDelete;
ListCache.prototype.get = listCacheGet;
ListCache.prototype.has = listCacheHas;
ListCache.prototype.set = listCacheSet;

/**
 * Creates a map cache object to store key-value pairs.
 *
 * @private
 * @constructor
 * @param {Array} [entries] The key-value pairs to cache.
 */
function MapCache(entries) {
  var index = -1,
      length = entries == null ? 0 : entries.length;

  this.clear();
  while (++index < length) {
    var entry = entries[index];
    this.set(entry[0], entry[1]);
  }
}

/**
 * Removes all key-value entries from the map.
 *
 * @private
 * @name clear
 * @memberOf MapCache
 */
function mapCacheClear() {
  this.size = 0;
  this.__data__ = {
    'hash': new Hash,
    'map': new (Map || ListCache),
    'string': new Hash
  };
}

/**
 * Removes `key` and its value from the map.
 *
 * @private
 * @name delete
 * @memberOf MapCache
 * @param {string} key The key of the value to remove.
 * @returns {boolean} Returns `true` if the entry was removed, else `false`.
 */
function mapCacheDelete(key) {
  var result = getMapData(this, key)['delete'](key);
  this.size -= result ? 1 : 0;
  return result;
}

/**
 * Gets the map value for `key`.
 *
 * @private
 * @name get
 * @memberOf MapCache
 * @param {string} key The key of the value to get.
 * @returns {*} Returns the entry value.
 */
function mapCacheGet(key) {
  return getMapData(this, key).get(key);
}

/**
 * Checks if a map value for `key` exists.
 *
 * @private
 * @name has
 * @memberOf MapCache
 * @param {string} key The key of the entry to check.
 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
 */
function mapCacheHas(key) {
  return getMapData(this, key).has(key);
}

/**
 * Sets the map `key` to `value`.
 *
 * @private
 * @name set
 * @memberOf MapCache
 * @param {string} key The key of the value to set.
 * @param {*} value The value to set.
 * @returns {Object} Returns the map cache instance.
 */
function mapCacheSet(key, value) {
  var data = getMapData(this, key),
      size = data.size;

  data.set(key, value);
  this.size += data.size == size ? 0 : 1;
  return this;
}

// Add methods to `MapCache`.
MapCache.prototype.clear = mapCacheClear;
MapCache.prototype['delete'] = mapCacheDelete;
MapCache.prototype.get = mapCacheGet;
MapCache.prototype.has = mapCacheHas;
MapCache.prototype.set = mapCacheSet;

/**
 *
 * Creates an array cache object to store unique values.
 *
 * @private
 * @constructor
 * @param {Array} [values] The values to cache.
 */
function SetCache(values) {
  var index = -1,
      length = values == null ? 0 : values.length;

  this.__data__ = new MapCache;
  while (++index < length) {
    this.add(values[index]);
  }
}

/**
 * Adds `value` to the array cache.
 *
 * @private
 * @name add
 * @memberOf SetCache
 * @alias push
 * @param {*} value The value to cache.
 * @returns {Object} Returns the cache instance.
 */
function setCacheAdd(value) {
  this.__data__.set(value, HASH_UNDEFINED);
  return this;
}

/**
 * Checks if `value` is in the array cache.
 *
 * @private
 * @name has
 * @memberOf SetCache
 * @param {*} value The value to search for.
 * @returns {number} Returns `true` if `value` is found, else `false`.
 */
function setCacheHas(value) {
  return this.__data__.has(value);
}

// Add methods to `SetCache`.
SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
SetCache.prototype.has = setCacheHas;

/**
 * Creates a stack cache object to store key-value pairs.
 *
 * @private
 * @constructor
 * @param {Array} [entries] The key-value pairs to cache.
 */
function Stack(entries) {
  var data = this.__data__ = new ListCache(entries);
  this.size = data.size;
}

/**
 * Removes all key-value entries from the stack.
 *
 * @private
 * @name clear
 * @memberOf Stack
 */
function stackClear() {
  this.__data__ = new ListCache;
  this.size = 0;
}

/**
 * Removes `key` and its value from the stack.
 *
 * @private
 * @name delete
 * @memberOf Stack
 * @param {string} key The key of the value to remove.
 * @returns {boolean} Returns `true` if the entry was removed, else `false`.
 */
function stackDelete(key) {
  var data = this.__data__,
      result = data['delete'](key);

  this.size = data.size;
  return result;
}

/**
 * Gets the stack value for `key`.
 *
 * @private
 * @name get
 * @memberOf Stack
 * @param {string} key The key of the value to get.
 * @returns {*} Returns the entry value.
 */
function stackGet(key) {
  return this.__data__.get(key);
}

/**
 * Checks if a stack value for `key` exists.
 *
 * @private
 * @name has
 * @memberOf Stack
 * @param {string} key The key of the entry to check.
 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
 */
function stackHas(key) {
  return this.__data__.has(key);
}

/**
 * Sets the stack `key` to `value`.
 *
 * @private
 * @name set
 * @memberOf Stack
 * @param {string} key The key of the value to set.
 * @param {*} value The value to set.
 * @returns {Object} Returns the stack cache instance.
 */
function stackSet(key, value) {
  var data = this.__data__;
  if (data instanceof ListCache) {
    var pairs = data.__data__;
    if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
      pairs.push([key, value]);
      this.size = ++data.size;
      return this;
    }
    data = this.__data__ = new MapCache(pairs);
  }
  data.set(key, value);
  this.size = data.size;
  return this;
}

// Add methods to `Stack`.
Stack.prototype.clear = stackClear;
Stack.prototype['delete'] = stackDelete;
Stack.prototype.get = stackGet;
Stack.prototype.has = stackHas;
Stack.prototype.set = stackSet;

/**
 * Creates an array of the enumerable property names of the array-like `value`.
 *
 * @private
 * @param {*} value The value to query.
 * @param {boolean} inherited Specify returning inherited property names.
 * @returns {Array} Returns the array of property names.
 */
function arrayLikeKeys(value, inherited) {
  var isArr = isArray(value),
      isArg = !isArr && isArguments(value),
      isBuff = !isArr && !isArg && isBuffer(value),
      isType = !isArr && !isArg && !isBuff && isTypedArray(value),
      skipIndexes = isArr || isArg || isBuff || isType,
      result = skipIndexes ? baseTimes(value.length, String) : [],
      length = result.length;

  for (var key in value) {
    if ((inherited || hasOwnProperty.call(value, key)) &&
        !(skipIndexes && (
           // Safari 9 has enumerable `arguments.length` in strict mode.
           key == 'length' ||
           // Node.js 0.10 has enumerable non-index properties on buffers.
           (isBuff && (key == 'offset' || key == 'parent')) ||
           // PhantomJS 2 has enumerable non-index properties on typed arrays.
           (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
           // Skip index properties.
           isIndex(key, length)
        ))) {
      result.push(key);
    }
  }
  return result;
}

/**
 * Gets the index at which the `key` is found in `array` of key-value pairs.
 *
 * @private
 * @param {Array} array The array to inspect.
 * @param {*} key The key to search for.
 * @returns {number} Returns the index of the matched value, else `-1`.
 */
function assocIndexOf(array, key) {
  var length = array.length;
  while (length--) {
    if (eq(array[length][0], key)) {
      return length;
    }
  }
  return -1;
}

/**
 * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
 * `keysFunc` and `symbolsFunc` to get the enumerable property names and
 * symbols of `object`.
 *
 * @private
 * @param {Object} object The object to query.
 * @param {Function} keysFunc The function to get the keys of `object`.
 * @param {Function} symbolsFunc The function to get the symbols of `object`.
 * @returns {Array} Returns the array of property names and symbols.
 */
function baseGetAllKeys(object, keysFunc, symbolsFunc) {
  var result = keysFunc(object);
  return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
}

/**
 * The base implementation of `getTag` without fallbacks for buggy environments.
 *
 * @private
 * @param {*} value The value to query.
 * @returns {string} Returns the `toStringTag`.
 */
function baseGetTag(value) {
  if (value == null) {
    return value === undefined ? undefinedTag : nullTag;
  }
  return (symToStringTag && symToStringTag in Object(value))
    ? getRawTag(value)
    : objectToString(value);
}

/**
 * The base implementation of `_.isArguments`.
 *
 * @private
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is an `arguments` object,
 */
function baseIsArguments(value) {
  return isObjectLike(value) && baseGetTag(value) == argsTag;
}

/**
 * The base implementation of `_.isEqual` which supports partial comparisons
 * and tracks traversed objects.
 *
 * @private
 * @param {*} value The value to compare.
 * @param {*} other The other value to compare.
 * @param {boolean} bitmask The bitmask flags.
 *  1 - Unordered comparison
 *  2 - Partial comparison
 * @param {Function} [customizer] The function to customize comparisons.
 * @param {Object} [stack] Tracks traversed `value` and `other` objects.
 * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
 */
function baseIsEqual(value, other, bitmask, customizer, stack) {
  if (value === other) {
    return true;
  }
  if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {
    return value !== value && other !== other;
  }
  return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
}

/**
 * A specialized version of `baseIsEqual` for arrays and objects which performs
 * deep comparisons and tracks traversed objects enabling objects with circular
 * references to be compared.
 *
 * @private
 * @param {Object} object The object to compare.
 * @param {Object} other The other object to compare.
 * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
 * @param {Function} customizer The function to customize comparisons.
 * @param {Function} equalFunc The function to determine equivalents of values.
 * @param {Object} [stack] Tracks traversed `object` and `other` objects.
 * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
 */
function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
  var objIsArr = isArray(object),
      othIsArr = isArray(other),
      objTag = objIsArr ? arrayTag : getTag(object),
      othTag = othIsArr ? arrayTag : getTag(other);

  objTag = objTag == argsTag ? objectTag : objTag;
  othTag = othTag == argsTag ? objectTag : othTag;

  var objIsObj = objTag == objectTag,
      othIsObj = othTag == objectTag,
      isSameTag = objTag == othTag;

  if (isSameTag && isBuffer(object)) {
    if (!isBuffer(other)) {
      return false;
    }
    objIsArr = true;
    objIsObj = false;
  }
  if (isSameTag && !objIsObj) {
    stack || (stack = new Stack);
    return (objIsArr || isTypedArray(object))
      ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)
      : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
  }
  if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
    var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
        othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');

    if (objIsWrapped || othIsWrapped) {
      var objUnwrapped = objIsWrapped ? object.value() : object,
          othUnwrapped = othIsWrapped ? other.value() : other;

      stack || (stack = new Stack);
      return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
    }
  }
  if (!isSameTag) {
    return false;
  }
  stack || (stack = new Stack);
  return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
}

/**
 * The base implementation of `_.isNative` without bad shim checks.
 *
 * @private
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is a native function,
 *  else `false`.
 */
function baseIsNative(value) {
  if (!isObject(value) || isMasked(value)) {
    return false;
  }
  var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
  return pattern.test(toSource(value));
}

/**
 * The base implementation of `_.isTypedArray` without Node.js optimizations.
 *
 * @private
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
 */
function baseIsTypedArray(value) {
  return isObjectLike(value) &&
    isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
}

/**
 * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
 *
 * @private
 * @param {Object} object The object to query.
 * @returns {Array} Returns the array of property names.
 */
function baseKeys(object) {
  if (!isPrototype(object)) {
    return nativeKeys(object);
  }
  var result = [];
  for (var key in Object(object)) {
    if (hasOwnProperty.call(object, key) && key != 'constructor') {
      result.push(key);
    }
  }
  return result;
}

/**
 * A specialized version of `baseIsEqualDeep` for arrays with support for
 * partial deep comparisons.
 *
 * @private
 * @param {Array} array The array to compare.
 * @param {Array} other The other array to compare.
 * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
 * @param {Function} customizer The function to customize comparisons.
 * @param {Function} equalFunc The function to determine equivalents of values.
 * @param {Object} stack Tracks traversed `array` and `other` objects.
 * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
 */
function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
  var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
      arrLength = array.length,
      othLength = other.length;

  if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
    return false;
  }
  // Assume cyclic values are equal.
  var stacked = stack.get(array);
  if (stacked && stack.get(other)) {
    return stacked == other;
  }
  var index = -1,
      result = true,
      seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;

  stack.set(array, other);
  stack.set(other, array);

  // Ignore non-index properties.
  while (++index < arrLength) {
    var arrValue = array[index],
        othValue = other[index];

    if (customizer) {
      var compared = isPartial
        ? customizer(othValue, arrValue, index, other, array, stack)
        : customizer(arrValue, othValue, index, array, other, stack);
    }
    if (compared !== undefined) {
      if (compared) {
        continue;
      }
      result = false;
      break;
    }
    // Recursively compare arrays (susceptible to call stack limits).
    if (seen) {
      if (!arraySome(other, function(othValue, othIndex) {
            if (!cacheHas(seen, othIndex) &&
                (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
              return seen.push(othIndex);
            }
          })) {
        result = false;
        break;
      }
    } else if (!(
          arrValue === othValue ||
            equalFunc(arrValue, othValue, bitmask, customizer, stack)
        )) {
      result = false;
      break;
    }
  }
  stack['delete'](array);
  stack['delete'](other);
  return result;
}

/**
 * A specialized version of `baseIsEqualDeep` for comparing objects of
 * the same `toStringTag`.
 *
 * **Note:** This function only supports comparing values with tags of
 * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
 *
 * @private
 * @param {Object} object The object to compare.
 * @param {Object} other The other object to compare.
 * @param {string} tag The `toStringTag` of the objects to compare.
 * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
 * @param {Function} customizer The function to customize comparisons.
 * @param {Function} equalFunc The function to determine equivalents of values.
 * @param {Object} stack Tracks traversed `object` and `other` objects.
 * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
 */
function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
  switch (tag) {
    case dataViewTag:
      if ((object.byteLength != other.byteLength) ||
          (object.byteOffset != other.byteOffset)) {
        return false;
      }
      object = object.buffer;
      other = other.buffer;

    case arrayBufferTag:
      if ((object.byteLength != other.byteLength) ||
          !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
        return false;
      }
      return true;

    case boolTag:
    case dateTag:
    case numberTag:
      // Coerce booleans to `1` or `0` and dates to milliseconds.
      // Invalid dates are coerced to `NaN`.
      return eq(+object, +other);

    case errorTag:
      return object.name == other.name && object.message == other.message;

    case regexpTag:
    case stringTag:
      // Coerce regexes to strings and treat strings, primitives and objects,
      // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
      // for more details.
      return object == (other + '');

    case mapTag:
      var convert = mapToArray;

    case setTag:
      var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
      convert || (convert = setToArray);

      if (object.size != other.size && !isPartial) {
        return false;
      }
      // Assume cyclic values are equal.
      var stacked = stack.get(object);
      if (stacked) {
        return stacked == other;
      }
      bitmask |= COMPARE_UNORDERED_FLAG;

      // Recursively compare objects (susceptible to call stack limits).
      stack.set(object, other);
      var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
      stack['delete'](object);
      return result;

    case symbolTag:
      if (symbolValueOf) {
        return symbolValueOf.call(object) == symbolValueOf.call(other);
      }
  }
  return false;
}

/**
 * A specialized version of `baseIsEqualDeep` for objects with support for
 * partial deep comparisons.
 *
 * @private
 * @param {Object} object The object to compare.
 * @param {Object} other The other object to compare.
 * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
 * @param {Function} customizer The function to customize comparisons.
 * @param {Function} equalFunc The function to determine equivalents of values.
 * @param {Object} stack Tracks traversed `object` and `other` objects.
 * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
 */
function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
  var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
      objProps = getAllKeys(object),
      objLength = objProps.length,
      othProps = getAllKeys(other),
      othLength = othProps.length;

  if (objLength != othLength && !isPartial) {
    return false;
  }
  var index = objLength;
  while (index--) {
    var key = objProps[index];
    if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
      return false;
    }
  }
  // Assume cyclic values are equal.
  var stacked = stack.get(object);
  if (stacked && stack.get(other)) {
    return stacked == other;
  }
  var result = true;
  stack.set(object, other);
  stack.set(other, object);

  var skipCtor = isPartial;
  while (++index < objLength) {
    key = objProps[index];
    var objValue = object[key],
        othValue = other[key];

    if (customizer) {
      var compared = isPartial
        ? customizer(othValue, objValue, key, other, object, stack)
        : customizer(objValue, othValue, key, object, other, stack);
    }
    // Recursively compare objects (susceptible to call stack limits).
    if (!(compared === undefined
          ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
          : compared
        )) {
      result = false;
      break;
    }
    skipCtor || (skipCtor = key == 'constructor');
  }
  if (result && !skipCtor) {
    var objCtor = object.constructor,
        othCtor = other.constructor;

    // Non `Object` object instances with different constructors are not equal.
    if (objCtor != othCtor &&
        ('constructor' in object && 'constructor' in other) &&
        !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
          typeof othCtor == 'function' && othCtor instanceof othCtor)) {
      result = false;
    }
  }
  stack['delete'](object);
  stack['delete'](other);
  return result;
}

/**
 * Creates an array of own enumerable property names and symbols of `object`.
 *
 * @private
 * @param {Object} object The object to query.
 * @returns {Array} Returns the array of property names and symbols.
 */
function getAllKeys(object) {
  return baseGetAllKeys(object, keys, getSymbols);
}

/**
 * Gets the data for `map`.
 *
 * @private
 * @param {Object} map The map to query.
 * @param {string} key The reference key.
 * @returns {*} Returns the map data.
 */
function getMapData(map, key) {
  var data = map.__data__;
  return isKeyable(key)
    ? data[typeof key == 'string' ? 'string' : 'hash']
    : data.map;
}

/**
 * Gets the native function at `key` of `object`.
 *
 * @private
 * @param {Object} object The object to query.
 * @param {string} key The key of the method to get.
 * @returns {*} Returns the function if it's native, else `undefined`.
 */
function getNative(object, key) {
  var value = getValue(object, key);
  return baseIsNative(value) ? value : undefined;
}

/**
 * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
 *
 * @private
 * @param {*} value The value to query.
 * @returns {string} Returns the raw `toStringTag`.
 */
function getRawTag(value) {
  var isOwn = hasOwnProperty.call(value, symToStringTag),
      tag = value[symToStringTag];

  try {
    value[symToStringTag] = undefined;
    var unmasked = true;
  } catch (e) {}

  var result = nativeObjectToString.call(value);
  if (unmasked) {
    if (isOwn) {
      value[symToStringTag] = tag;
    } else {
      delete value[symToStringTag];
    }
  }
  return result;
}

/**
 * Creates an array of the own enumerable symbols of `object`.
 *
 * @private
 * @param {Object} object The object to query.
 * @returns {Array} Returns the array of symbols.
 */
var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
  if (object == null) {
    return [];
  }
  object = Object(object);
  return arrayFilter(nativeGetSymbols(object), function(symbol) {
    return propertyIsEnumerable.call(object, symbol);
  });
};

/**
 * Gets the `toStringTag` of `value`.
 *
 * @private
 * @param {*} value The value to query.
 * @returns {string} Returns the `toStringTag`.
 */
var getTag = baseGetTag;

// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
    (Map && getTag(new Map) != mapTag) ||
    (Promise && getTag(Promise.resolve()) != promiseTag) ||
    (Set && getTag(new Set) != setTag) ||
    (WeakMap && getTag(new WeakMap) != weakMapTag)) {
  getTag = function(value) {
    var result = baseGetTag(value),
        Ctor = result == objectTag ? value.constructor : undefined,
        ctorString = Ctor ? toSource(Ctor) : '';

    if (ctorString) {
      switch (ctorString) {
        case dataViewCtorString: return dataViewTag;
        case mapCtorString: return mapTag;
        case promiseCtorString: return promiseTag;
        case setCtorString: return setTag;
        case weakMapCtorString: return weakMapTag;
      }
    }
    return result;
  };
}

/**
 * Checks if `value` is a valid array-like index.
 *
 * @private
 * @param {*} value The value to check.
 * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
 * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
 */
function isIndex(value, length) {
  length = length == null ? MAX_SAFE_INTEGER : length;
  return !!length &&
    (typeof value == 'number' || reIsUint.test(value)) &&
    (value > -1 && value % 1 == 0 && value < length);
}

/**
 * Checks if `value` is suitable for use as unique object key.
 *
 * @private
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
 */
function isKeyable(value) {
  var type = typeof value;
  return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
    ? (value !== '__proto__')
    : (value === null);
}

/**
 * Checks if `func` has its source masked.
 *
 * @private
 * @param {Function} func The function to check.
 * @returns {boolean} Returns `true` if `func` is masked, else `false`.
 */
function isMasked(func) {
  return !!maskSrcKey && (maskSrcKey in func);
}

/**
 * Checks if `value` is likely a prototype object.
 *
 * @private
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
 */
function isPrototype(value) {
  var Ctor = value && value.constructor,
      proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;

  return value === proto;
}

/**
 * Converts `value` to a string using `Object.prototype.toString`.
 *
 * @private
 * @param {*} value The value to convert.
 * @returns {string} Returns the converted string.
 */
function objectToString(value) {
  return nativeObjectToString.call(value);
}

/**
 * Converts `func` to its source code.
 *
 * @private
 * @param {Function} func The function to convert.
 * @returns {string} Returns the source code.
 */
function toSource(func) {
  if (func != null) {
    try {
      return funcToString.call(func);
    } catch (e) {}
    try {
      return (func + '');
    } catch (e) {}
  }
  return '';
}

/**
 * Performs a
 * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
 * comparison between two values to determine if they are equivalent.
 *
 * @static
 * @memberOf _
 * @since 4.0.0
 * @category Lang
 * @param {*} value The value to compare.
 * @param {*} other The other value to compare.
 * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
 * @example
 *
 * var object = { 'a': 1 };
 * var other = { 'a': 1 };
 *
 * _.eq(object, object);
 * // => true
 *
 * _.eq(object, other);
 * // => false
 *
 * _.eq('a', 'a');
 * // => true
 *
 * _.eq('a', Object('a'));
 * // => false
 *
 * _.eq(NaN, NaN);
 * // => true
 */
function eq(value, other) {
  return value === other || (value !== value && other !== other);
}

/**
 * Checks if `value` is likely an `arguments` object.
 *
 * @static
 * @memberOf _
 * @since 0.1.0
 * @category Lang
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is an `arguments` object,
 *  else `false`.
 * @example
 *
 * _.isArguments(function() { return arguments; }());
 * // => true
 *
 * _.isArguments([1, 2, 3]);
 * // => false
 */
var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
  return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
    !propertyIsEnumerable.call(value, 'callee');
};

/**
 * Checks if `value` is classified as an `Array` object.
 *
 * @static
 * @memberOf _
 * @since 0.1.0
 * @category Lang
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is an array, else `false`.
 * @example
 *
 * _.isArray([1, 2, 3]);
 * // => true
 *
 * _.isArray(document.body.children);
 * // => false
 *
 * _.isArray('abc');
 * // => false
 *
 * _.isArray(_.noop);
 * // => false
 */
var isArray = Array.isArray;

/**
 * Checks if `value` is array-like. A value is considered array-like if it's
 * not a function and has a `value.length` that's an integer greater than or
 * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
 *
 * @static
 * @memberOf _
 * @since 4.0.0
 * @category Lang
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
 * @example
 *
 * _.isArrayLike([1, 2, 3]);
 * // => true
 *
 * _.isArrayLike(document.body.children);
 * // => true
 *
 * _.isArrayLike('abc');
 * // => true
 *
 * _.isArrayLike(_.noop);
 * // => false
 */
function isArrayLike(value) {
  return value != null && isLength(value.length) && !isFunction(value);
}

/**
 * Checks if `value` is a buffer.
 *
 * @static
 * @memberOf _
 * @since 4.3.0
 * @category Lang
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
 * @example
 *
 * _.isBuffer(new Buffer(2));
 * // => true
 *
 * _.isBuffer(new Uint8Array(2));
 * // => false
 */
var isBuffer = nativeIsBuffer || stubFalse;

/**
 * Performs a deep comparison between two values to determine if they are
 * equivalent.
 *
 * **Note:** This method supports comparing arrays, array buffers, booleans,
 * date objects, error objects, maps, numbers, `Object` objects, regexes,
 * sets, strings, symbols, and typed arrays. `Object` objects are compared
 * by their own, not inherited, enumerable properties. Functions and DOM
 * nodes are compared by strict equality, i.e. `===`.
 *
 * @static
 * @memberOf _
 * @since 0.1.0
 * @category Lang
 * @param {*} value The value to compare.
 * @param {*} other The other value to compare.
 * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
 * @example
 *
 * var object = { 'a': 1 };
 * var other = { 'a': 1 };
 *
 * _.isEqual(object, other);
 * // => true
 *
 * object === other;
 * // => false
 */
function isEqual(value, other) {
  return baseIsEqual(value, other);
}

/**
 * Checks if `value` is classified as a `Function` object.
 *
 * @static
 * @memberOf _
 * @since 0.1.0
 * @category Lang
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is a function, else `false`.
 * @example
 *
 * _.isFunction(_);
 * // => true
 *
 * _.isFunction(/abc/);
 * // => false
 */
function isFunction(value) {
  if (!isObject(value)) {
    return false;
  }
  // The use of `Object#toString` avoids issues with the `typeof` operator
  // in Safari 9 which returns 'object' for typed arrays and other constructors.
  var tag = baseGetTag(value);
  return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
}

/**
 * Checks if `value` is a valid array-like length.
 *
 * **Note:** This method is loosely based on
 * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
 *
 * @static
 * @memberOf _
 * @since 4.0.0
 * @category Lang
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
 * @example
 *
 * _.isLength(3);
 * // => true
 *
 * _.isLength(Number.MIN_VALUE);
 * // => false
 *
 * _.isLength(Infinity);
 * // => false
 *
 * _.isLength('3');
 * // => false
 */
function isLength(value) {
  return typeof value == 'number' &&
    value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
}

/**
 * Checks if `value` is the
 * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
 * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
 *
 * @static
 * @memberOf _
 * @since 0.1.0
 * @category Lang
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is an object, else `false`.
 * @example
 *
 * _.isObject({});
 * // => true
 *
 * _.isObject([1, 2, 3]);
 * // => true
 *
 * _.isObject(_.noop);
 * // => true
 *
 * _.isObject(null);
 * // => false
 */
function isObject(value) {
  var type = typeof value;
  return value != null && (type == 'object' || type == 'function');
}

/**
 * Checks if `value` is object-like. A value is object-like if it's not `null`
 * and has a `typeof` result of "object".
 *
 * @static
 * @memberOf _
 * @since 4.0.0
 * @category Lang
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
 * @example
 *
 * _.isObjectLike({});
 * // => true
 *
 * _.isObjectLike([1, 2, 3]);
 * // => true
 *
 * _.isObjectLike(_.noop);
 * // => false
 *
 * _.isObjectLike(null);
 * // => false
 */
function isObjectLike(value) {
  return value != null && typeof value == 'object';
}

/**
 * Checks if `value` is classified as a typed array.
 *
 * @static
 * @memberOf _
 * @since 3.0.0
 * @category Lang
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
 * @example
 *
 * _.isTypedArray(new Uint8Array);
 * // => true
 *
 * _.isTypedArray([]);
 * // => false
 */
var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;

/**
 * Creates an array of the own enumerable property names of `object`.
 *
 * **Note:** Non-object values are coerced to objects. See the
 * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
 * for more details.
 *
 * @static
 * @since 0.1.0
 * @memberOf _
 * @category Object
 * @param {Object} object The object to query.
 * @returns {Array} Returns the array of property names.
 * @example
 *
 * function Foo() {
 *   this.a = 1;
 *   this.b = 2;
 * }
 *
 * Foo.prototype.c = 3;
 *
 * _.keys(new Foo);
 * // => ['a', 'b'] (iteration order is not guaranteed)
 *
 * _.keys('hi');
 * // => ['0', '1']
 */
function keys(object) {
  return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
}

/**
 * This method returns a new empty array.
 *
 * @static
 * @memberOf _
 * @since 4.13.0
 * @category Util
 * @returns {Array} Returns the new empty array.
 * @example
 *
 * var arrays = _.times(2, _.stubArray);
 *
 * console.log(arrays);
 * // => [[], []]
 *
 * console.log(arrays[0] === arrays[1]);
 * // => false
 */
function stubArray() {
  return [];
}

/**
 * This method returns `false`.
 *
 * @static
 * @memberOf _
 * @since 4.13.0
 * @category Util
 * @returns {boolean} Returns `false`.
 * @example
 *
 * _.times(2, _.stubFalse);
 * // => [false, false]
 */
function stubFalse() {
  return false;
}

module.exports = isEqual;
{
  "name": "lodash.isequal",
  "version": "4.5.0",
  "description": "The Lodash method `_.isEqual` exported as a module.",
  "homepage": "https://lodash.com/",
  "icon": "https://lodash.com/icon.svg",
  "license": "MIT",
  "author": "John-David Dalton <john.david.dalton@gmail.com> (http://allyoucanleet.com/)",
  "repository": "lodash/lodash"
}/**
 * Helpers.
 */

var s = 1000;
var m = s * 60;
var h = m * 60;
var d = h * 24;
var w = d * 7;
var y = d * 365.25;

/**
 * Parse or format the given `val`.
 *
 * Options:
 *
 *  - `long` verbose formatting [false]
 *
 * @param {String|Number} val
 * @param {Object} [options]
 * @throws {Error} throw an error if val is not a non-empty string or a number
 * @return {String|Number}
 * @api public
 */

module.exports = function (val, options) {
  options = options || {};
  var type = typeof val;
  if (type === 'string' && val.length > 0) {
    return parse(val);
  } else if (type === 'number' && isFinite(val)) {
    return options.long ? fmtLong(val) : fmtShort(val);
  }
  throw new Error(
    'val is not a non-empty string or a valid number. val=' +
      JSON.stringify(val)
  );
};

/**
 * Parse the given `str` and return milliseconds.
 *
 * @param {String} str
 * @return {Number}
 * @api private
 */

function parse(str) {
  str = String(str);
  if (str.length > 100) {
    return;
  }
  var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
    str
  );
  if (!match) {
    return;
  }
  var n = parseFloat(match[1]);
  var type = (match[2] || 'ms').toLowerCase();
  switch (type) {
    case 'years':
    case 'year':
    case 'yrs':
    case 'yr':
    case 'y':
      return n * y;
    case 'weeks':
    case 'week':
    case 'w':
      return n * w;
    case 'days':
    case 'day':
    case 'd':
      return n * d;
    case 'hours':
    case 'hour':
    case 'hrs':
    case 'hr':
    case 'h':
      return n * h;
    case 'minutes':
    case 'minute':
    case 'mins':
    case 'min':
    case 'm':
      return n * m;
    case 'seconds':
    case 'second':
    case 'secs':
    case 'sec':
    case 's':
      return n * s;
    case 'milliseconds':
    case 'millisecond':
    case 'msecs':
    case 'msec':
    case 'ms':
      return n;
    default:
      return undefined;
  }
}

/**
 * Short format for `ms`.
 *
 * @param {Number} ms
 * @return {String}
 * @api private
 */

function fmtShort(ms) {
  var msAbs = Math.abs(ms);
  if (msAbs >= d) {
    return Math.round(ms / d) + 'd';
  }
  if (msAbs >= h) {
    return Math.round(ms / h) + 'h';
  }
  if (msAbs >= m) {
    return Math.round(ms / m) + 'm';
  }
  if (msAbs >= s) {
    return Math.round(ms / s) + 's';
  }
  return ms + 'ms';
}

/**
 * Long format for `ms`.
 *
 * @param {Number} ms
 * @return {String}
 * @api private
 */

function fmtLong(ms) {
  var msAbs = Math.abs(ms);
  if (msAbs >= d) {
    return plural(ms, msAbs, d, 'day');
  }
  if (msAbs >= h) {
    return plural(ms, msAbs, h, 'hour');
  }
  if (msAbs >= m) {
    return plural(ms, msAbs, m, 'minute');
  }
  if (msAbs >= s) {
    return plural(ms, msAbs, s, 'second');
  }
  return ms + ' ms';
}

/**
 * Pluralization helper.
 */

function plural(ms, msAbs, n, name) {
  var isPlural = msAbs >= n * 1.5;
  return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');
}
The MIT License (MIT)

Copyright (c) 2020 Vercel, Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
{
  "name": "ms",
  "version": "2.1.3",
  "description": "Tiny millisecond conversion utility",
  "repository": "vercel/ms",
  "main": "./index",
  "files": [
    "index.js"
  ],
  "lint-staged": {
    "*.js": [
      "npm run lint",
      "prettier --single-quote --write",
      "git add"
    ]
  },
  "license": "MIT",
  "devDependencies": {
    "eslint": "4.18.2",
    "expect.js": "0.3.1",
    "husky": "0.14.3",
    "lint-staged": "5.0.0",
    "mocha": "4.0.1",
    "prettier": "2.0.5"
  }
}                                 Apache License
                           Version 2.0, January 2004
                        http://www.apache.org/licenses/

   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

   1. Definitions.

      "License" shall mean the terms and conditions for use, reproduction,
      and distribution as defined by Sections 1 through 9 of this document.

      "Licensor" shall mean the copyright owner or entity authorized by
      the copyright owner that is granting the License.

      "Legal Entity" shall mean the union of the acting entity and all
      other entities that control, are controlled by, or are under common
      control with that entity. For the purposes of this definition,
      "control" means (i) the power, direct or indirect, to cause the
      direction or management of such entity, whether by contract or
      otherwise, or (ii) ownership of fifty percent (50%) or more of the
      outstanding shares, or (iii) beneficial ownership of such entity.

      "You" (or "Your") shall mean an individual or Legal Entity
      exercising permissions granted by this License.

      "Source" form shall mean the preferred form for making modifications,
      including but not limited to software source code, documentation
      source, and configuration files.

      "Object" form shall mean any form resulting from mechanical
      transformation or translation of a Source form, including but
      not limited to compiled object code, generated documentation,
      and conversions to other media types.

      "Work" shall mean the work of authorship, whether in Source or
      Object form, made available under the License, as indicated by a
      copyright notice that is included in or attached to the work
      (an example is provided in the Appendix below).

      "Derivative Works" shall mean any work, whether in Source or Object
      form, that is based on (or derived from) the Work and for which the
      editorial revisions, annotations, elaborations, or other modifications
      represent, as a whole, an original work of authorship. For the purposes
      of this License, Derivative Works shall not include works that remain
      separable from, or merely link (or bind by name) to the interfaces of,
      the Work and Derivative Works thereof.

      "Contribution" shall mean any work of authorship, including
      the original version of the Work and any modifications or additions
      to that Work or Derivative Works thereof, that is intentionally
      submitted to Licensor for inclusion in the Work by the copyright owner
      or by an individual or Legal Entity authorized to submit on behalf of
      the copyright owner. For the purposes of this definition, "submitted"
      means any form of electronic, verbal, or written communication sent
      to the Licensor or its representatives, including but not limited to
      communication on electronic mailing lists, source code control systems,
      and issue tracking systems that are managed by, or on behalf of, the
      Licensor for the purpose of discussing and improving the Work, but
      excluding communication that is conspicuously marked or otherwise
      designated in writing by the copyright owner as "Not a Contribution."

      "Contributor" shall mean Licensor and any individual or Legal Entity
      on behalf of whom a Contribution has been received by Licensor and
      subsequently incorporated within the Work.

   2. Grant of Copyright License. Subject to the terms and conditions of
      this License, each Contributor hereby grants to You a perpetual,
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
      copyright license to reproduce, prepare Derivative Works of,
      publicly display, publicly perform, sublicense, and distribute the
      Work and such Derivative Works in Source or Object form.

   3. Grant of Patent License. Subject to the terms and conditions of
      this License, each Contributor hereby grants to You a perpetual,
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
      (except as stated in this section) patent license to make, have made,
      use, offer to sell, sell, import, and otherwise transfer the Work,
      where such license applies only to those patent claims licensable
      by such Contributor that are necessarily infringed by their
      Contribution(s) alone or by combination of their Contribution(s)
      with the Work to which such Contribution(s) was submitted. If You
      institute patent litigation against any entity (including a
      cross-claim or counterclaim in a lawsuit) alleging that the Work
      or a Contribution incorporated within the Work constitutes direct
      or contributory patent infringement, then any patent licenses
      granted to You under this License for that Work shall terminate
      as of the date such litigation is filed.

   4. Redistribution. You may reproduce and distribute copies of the
      Work or Derivative Works thereof in any medium, with or without
      modifications, and in Source or Object form, provided that You
      meet the following conditions:

      (a) You must give any other recipients of the Work or
          Derivative Works a copy of this License; and

      (b) You must cause any modified files to carry prominent notices
          stating that You changed the files; and

      (c) You must retain, in the Source form of any Derivative Works
          that You distribute, all copyright, patent, trademark, and
          attribution notices from the Source form of the Work,
          excluding those notices that do not pertain to any part of
          the Derivative Works; and

      (d) If the Work includes a "NOTICE" text file as part of its
          distribution, then any Derivative Works that You distribute must
          include a readable copy of the attribution notices contained
          within such NOTICE file, excluding those notices that do not
          pertain to any part of the Derivative Works, in at least one
          of the following places: within a NOTICE text file distributed
          as part of the Derivative Works; within the Source form or
          documentation, if provided along with the Derivative Works; or,
          within a display generated by the Derivative Works, if and
          wherever such third-party notices normally appear. The contents
          of the NOTICE file are for informational purposes only and
          do not modify the License. You may add Your own attribution
          notices within Derivative Works that You distribute, alongside
          or as an addendum to the NOTICE text from the Work, provided
          that such additional attribution notices cannot be construed
          as modifying the License.

      You may add Your own copyright statement to Your modifications and
      may provide additional or different license terms and conditions
      for use, reproduction, or distribution of Your modifications, or
      for any such Derivative Works as a whole, provided Your use,
      reproduction, and distribution of the Work otherwise complies with
      the conditions stated in this License.

   5. Submission of Contributions. Unless You explicitly state otherwise,
      any Contribution intentionally submitted for inclusion in the Work
      by You to the Licensor shall be under the terms and conditions of
      this License, without any additional terms or conditions.
      Notwithstanding the above, nothing herein shall supersede or modify
      the terms of any separate license agreement you may have executed
      with Licensor regarding such Contributions.

   6. Trademarks. This License does not grant permission to use the trade
      names, trademarks, service marks, or product names of the Licensor,
      except as required for reasonable and customary use in describing the
      origin of the Work and reproducing the content of the NOTICE file.

   7. Disclaimer of Warranty. Unless required by applicable law or
      agreed to in writing, Licensor provides the Work (and each
      Contributor provides its Contributions) on an "AS IS" BASIS,
      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
      implied, including, without limitation, any warranties or conditions
      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
      PARTICULAR PURPOSE. You are solely responsible for determining the
      appropriateness of using or redistributing the Work and assume any
      risks associated with Your exercise of permissions under this License.

   8. Limitation of Liability. In no event and under no legal theory,
      whether in tort (including negligence), contract, or otherwise,
      unless required by applicable law (such as deliberate and grossly
      negligent acts) or agreed to in writing, shall any Contributor be
      liable to You for damages, including any direct, indirect, special,
      incidental, or consequential damages of any character arising as a
      result of this License or out of the use or inability to use the
      Work (including but not limited to damages for loss of goodwill,
      work stoppage, computer failure or malfunction, or any and all
      other commercial damages or losses), even if such Contributor
      has been advised of the possibility of such damages.

   9. Accepting Warranty or Additional Liability. While redistributing
      the Work or Derivative Works thereof, You may choose to offer,
      and charge a fee for, acceptance of support, warranty, indemnity,
      or other liability obligations and/or rights consistent with this
      License. However, in accepting such obligations, You may act only
      on Your own behalf and on Your sole responsibility, not on behalf
      of any other Contributor, and only if You agree to indemnify,
      defend, and hold each Contributor harmless for any liability
      incurred by, or claims asserted against, such Contributor by reason
      of your accepting any such warranty or additional liability.

   END OF TERMS AND CONDITIONS

   APPENDIX: How to apply the Apache License to your work.

      To apply the Apache License to your work, attach the following
      boilerplate notice, with the fields enclosed by brackets "[]"
      replaced with your own identifying information. (Don't include
      the brackets!)  The text should be enclosed in the appropriate
      comment syntax for the file format. We also recommend that a
      file or class name and description of purpose be included on the
      same "printed page" as the copyright notice for easier
      identification within third-party archives.

   Portions Copyright (c) Microsoft Corporation.
   Portions Copyright 2017 Google Inc.

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
Playwright
Copyright (c) Microsoft Corporation

This software contains code derived from the Puppeteer project (https://github.com/puppeteer/puppeteer),
available under the Apache 2.0 license (https://github.com/puppeteer/puppeteer/blob/master/LICENSE).
microsoft/playwright

THIRD-PARTY SOFTWARE NOTICES AND INFORMATION

This package bundles third-party software inside individual files under
`lib/`. Each bundled output has a sidecar `<bundle>.js.LICENSE` file next
to it listing every npm package whose source was inlined into that
bundle, together with the full license text for each.

For example:
- lib/common/index.js.LICENSE
- lib/matchers/expect.js.LICENSE

This project incorporates components from the projects listed below. The original copyright notices and the licenses under which Microsoft received such components are set forth below. Microsoft reserves all rights not expressly granted herein, whether by implication, estoppel or otherwise.
#!/usr/bin/env node
/**
 * Copyright (c) Microsoft Corporation.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

const { program } = require('./lib/program');
program.parse(process.argv);
/**
 * Copyright (c) Microsoft Corporation.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

module.exports = require('playwright-core');
/**
 * Copyright (c) Microsoft Corporation.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
export * from 'playwright-core';
import playwright from 'playwright-core';
export default playwright;
/**
 * Copyright (c) Microsoft Corporation.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

function jsx(type, props, key) {
  return {
    __pw_type: 'jsx',
    type,
    props,
    key,
  };
}

function jsxs(type, props, key) {
  return {
    __pw_type: 'jsx',
    type,
    props,
    key,
  };
}

// this is used in <></> notation
const Fragment = { __pw_jsx_fragment: true };

module.exports = {
  Fragment,
  jsx,
  jsxs,
};
/**
 * Copyright (c) Microsoft Corporation.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

import jsxRuntime from './jsx-runtime.js';

export const jsx = jsxRuntime.jsx;
export const jsxs = jsxRuntime.jsxs;
export const Fragment = jsxRuntime.Fragment;
"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  // If the importer is in node compatibility mode or this is not an ESM
  // file that has been converted to a CommonJS file using a Babel-
  // compatible transform (i.e. "__esModule" has not been set), then set
  // "default" to the CommonJS "module.exports" for node compatibility.
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var agentParser_exports = {};
__export(agentParser_exports, {
  parseAgentSpec: () => parseAgentSpec
});
module.exports = __toCommonJS(agentParser_exports);
var import_fs = __toESM(require("fs"));
const yaml = require("playwright-core/lib/utilsBundle").yaml;
async function parseAgentSpec(filePath) {
  const source = await import_fs.default.promises.readFile(filePath, "utf-8");
  const { header, content } = extractYamlAndContent(source);
  const { instructions, examples } = extractInstructionsAndExamples(content);
  return {
    ...header,
    instructions,
    examples
  };
}
function extractYamlAndContent(markdown) {
  const lines = markdown.split("\n");
  if (lines[0] !== "---")
    throw new Error("Markdown file must start with YAML front matter (---)");
  let yamlEndIndex = -1;
  for (let i = 1; i < lines.length; i++) {
    if (lines[i] === "---") {
      yamlEndIndex = i;
      break;
    }
  }
  if (yamlEndIndex === -1)
    throw new Error("YAML front matter must be closed with ---");
  const yamlLines = lines.slice(1, yamlEndIndex);
  const yamlRaw = yamlLines.join("\n");
  const contentLines = lines.slice(yamlEndIndex + 1);
  const content = contentLines.join("\n");
  let header;
  try {
    header = yaml.parse(yamlRaw);
  } catch (error) {
    throw new Error(`Failed to parse YAML header: ${error.message}`);
  }
  if (!header.name)
    throw new Error('YAML header must contain a "name" field');
  if (!header.description)
    throw new Error('YAML header must contain a "description" field');
  return { header, content };
}
function extractInstructionsAndExamples(content) {
  const examples = [];
  const instructions = content.split("<example>")[0].trim();
  const exampleRegex = /<example>([\s\S]*?)<\/example>/g;
  let match;
  while ((match = exampleRegex.exec(content)) !== null) {
    const example = match[1].trim();
    examples.push(example.replace(/[\n]/g, " ").replace(/ +/g, " "));
  }
  return { instructions, examples };
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  parseAgentSpec
});
name: "Copilot Setup Steps"

on:
  workflow_dispatch:
  push:
    paths:
      - .github/workflows/copilot-setup-steps.yml
  pull_request:
    paths:
      - .github/workflows/copilot-setup-steps.yml

jobs:
  copilot-setup-steps:
    runs-on: ubuntu-latest

    permissions:
      contents: read

    steps:
    - uses: actions/checkout@v4

    - uses: actions/setup-node@v4
      with:
        node-version: lts/*

    - name: Install dependencies
      run: npm ci

    - name: Install Playwright Browsers
      run: npx playwright install --with-deps

    # Customize this step as needed
    - name: Build application
      run: npx run build
"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  // If the importer is in node compatibility mode or this is not an ESM
  // file that has been converted to a CommonJS file using a Babel-
  // compatible transform (i.e. "__esModule" has not been set), then set
  // "default" to the CommonJS "module.exports" for node compatibility.
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var generateAgents_exports = {};
__export(generateAgents_exports, {
  ClaudeGenerator: () => ClaudeGenerator,
  CodexGenerator: () => CodexGenerator,
  CopilotGenerator: () => CopilotGenerator,
  OpencodeGenerator: () => OpencodeGenerator,
  VSCodeGenerator: () => VSCodeGenerator
});
module.exports = __toCommonJS(generateAgents_exports);
var import_fs = __toESM(require("fs"));
var import_path = __toESM(require("path"));
var import_seed = require("../mcp/test/seed");
var import_agentParser = require("./agentParser");
const colors = require("playwright-core/lib/utilsBundle").colors;
const yaml = require("playwright-core/lib/utilsBundle").yaml;
const { tomlArray, tomlBasicString, tomlMultilineBasicString } = require("playwright-core/lib/coreBundle").iso;
const { mkdirIfNeeded } = require("playwright-core/lib/coreBundle").utils;
async function loadAgentSpecs() {
  const files = await import_fs.default.promises.readdir(__dirname);
  return Promise.all(files.filter((file) => file.endsWith(".agent.md")).map((file) => (0, import_agentParser.parseAgentSpec)(import_path.default.join(__dirname, file))));
}
class ClaudeGenerator {
  static async init(fullConfig, projectName, prompts) {
    await initRepo(fullConfig, projectName, {
      promptsFolder: prompts ? ".claude/prompts" : void 0
    });
    const agents = await loadAgentSpecs();
    await import_fs.default.promises.mkdir(".claude/agents", { recursive: true });
    for (const agent of agents)
      await writeFile(`.claude/agents/${agent.name}.md`, ClaudeGenerator.agentSpec(agent), "\u{1F916}", "agent definition");
    const mcpServer = process.platform === "win32" ? { command: "cmd", args: ["/c", "npx", "playwright", "run-test-mcp-server"] } : { command: "npx", args: ["playwright", "run-test-mcp-server"] };
    await writeFile(".mcp.json", JSON.stringify({
      mcpServers: {
        "playwright-test": mcpServer
      }
    }, null, 2), "\u{1F527}", "mcp configuration");
    initRepoDone();
  }
  static agentSpec(agent) {
    const claudeToolMap = /* @__PURE__ */ new Map([
      ["search", ["Glob", "Grep", "Read", "LS"]],
      ["edit", ["Edit", "MultiEdit", "Write"]]
    ]);
    function asClaudeTool(tool) {
      const [first, second] = tool.split("/");
      if (!second)
        return (claudeToolMap.get(first) || [first]).join(", ");
      return `mcp__${first}__${second}`;
    }
    const examples = agent.examples.length ? ` Examples: ${agent.examples.map((example) => `<example>${example}</example>`).join("")}` : "";
    const lines = [];
    const header = {
      name: agent.name,
      description: agent.description + examples,
      tools: agent.tools.map((tool) => asClaudeTool(tool)).join(", "),
      model: agent.model,
      color: agent.color
    };
    lines.push(`---`);
    lines.push(yaml.stringify(header, { lineWidth: 1e5 }) + `---`);
    lines.push("");
    lines.push(agent.instructions);
    return lines.join("\n");
  }
}
class CodexGenerator {
  static async init(fullConfig, projectName, prompts) {
    await initRepo(fullConfig, projectName, {
      promptsFolder: prompts ? ".codex/prompts" : void 0
    });
    const agents = await loadAgentSpecs();
    await import_fs.default.promises.mkdir(".codex/agents", { recursive: true });
    for (const agent of agents)
      await writeFile(`.codex/agents/${CodexGenerator.codexName(agent)}.toml`, CodexGenerator.agentSpec(agent), "\u{1F916}", "agent definition");
    initRepoDone();
  }
  // Codex's subagent registry rejects hyphenated identifiers at spawn time with
  // `error=unknown agent_type '<name>'`. Codex's own documentation only shows
  // snake_case names (`pr_explorer`, `reviewer`, `docs_researcher`, ...), see
  // https://developers.openai.com/codex/subagents. Translate the shared agent
  // name into snake_case so the filename and the `name` field stay in sync.
  static codexName(agent) {
    return agent.name.replace(/-/g, "_");
  }
  static agentSpec(agent) {
    const mcpName = "playwright-test";
    const enabledTools = [];
    for (const tool of agent.tools) {
      const [first, second] = tool.split("/");
      if (second && first === mcpName)
        enabledTools.push(second);
    }
    const sandboxMode = agent.tools.includes("edit") ? "workspace-write" : "read-only";
    const mcpServer = process.platform === "win32" ? { command: "cmd", args: ["/c", "npx", "playwright", "run-test-mcp-server"] } : { command: "npx", args: ["playwright", "run-test-mcp-server"] };
    const examples = agent.examples.length ? ` Examples: ${agent.examples.map((example) => `<example>${example}</example>`).join("")}` : "";
    const lines = [];
    lines.push(`name = ${tomlBasicString(CodexGenerator.codexName(agent))}`);
    lines.push(`description = ${tomlBasicString(agent.description + examples)}`);
    lines.push(`sandbox_mode = ${tomlBasicString(sandboxMode)}`);
    lines.push(`developer_instructions = ${tomlMultilineBasicString(agent.instructions)}`);
    lines.push("");
    lines.push(`[mcp_servers.${mcpName}]`);
    lines.push(`command = ${tomlBasicString(mcpServer.command)}`);
    lines.push(`args = ${tomlArray(mcpServer.args)}`);
    if (enabledTools.length)
      lines.push(`enabled_tools = ${tomlArray(enabledTools)}`);
    lines.push("");
    return lines.join("\n");
  }
}
class OpencodeGenerator {
  static async init(fullConfig, projectName, prompts) {
    await initRepo(fullConfig, projectName, {
      defaultAgentName: "Build",
      promptsFolder: prompts ? ".opencode/prompts" : void 0
    });
    const agents = await loadAgentSpecs();
    for (const agent of agents) {
      const prompt = [agent.instructions];
      prompt.push("");
      prompt.push(...agent.examples.map((example) => `<example>${example}</example>`));
      await writeFile(`.opencode/prompts/${agent.name}.md`, prompt.join("\n"), "\u{1F916}", "agent definition");
    }
    await writeFile("opencode.json", OpencodeGenerator.configuration(agents), "\u{1F527}", "opencode configuration");
    initRepoDone();
  }
  static configuration(agents) {
    const opencodeToolMap = /* @__PURE__ */ new Map([
      ["search", ["ls", "glob", "grep", "read"]],
      ["edit", ["edit", "write"]]
    ]);
    const asOpencodeTool = (tools, tool) => {
      const [first, second] = tool.split("/");
      if (!second) {
        for (const tool2 of opencodeToolMap.get(first) || [first])
          tools[tool2] = true;
      } else {
        tools[`${first}*${second}`] = true;
      }
    };
    const result = {};
    result["$schema"] = "https://opencode.ai/config.json";
    result["mcp"] = {};
    result["tools"] = {
      "playwright*": false
    };
    result["agent"] = {};
    for (const agent of agents) {
      const tools = {};
      result["agent"][agent.name] = {
        description: agent.description,
        mode: "subagent",
        prompt: `{file:.opencode/prompts/${agent.name}.md}`,
        tools
      };
      for (const tool of agent.tools)
        asOpencodeTool(tools, tool);
    }
    result["mcp"]["playwright-test"] = {
      type: "local",
      command: ["npx", "playwright", "run-test-mcp-server"],
      enabled: true
    };
    return JSON.stringify(result, null, 2);
  }
}
class CopilotGenerator {
  static async init(fullConfig, projectName, prompts) {
    await initRepo(fullConfig, projectName, {
      defaultAgentName: "agent",
      promptsFolder: prompts ? ".github/prompts" : void 0,
      promptSuffix: "prompt"
    });
    const agents = await loadAgentSpecs();
    await import_fs.default.promises.mkdir(".github/agents", { recursive: true });
    for (const agent of agents)
      await writeFile(`.github/agents/${agent.name}.agent.md`, CopilotGenerator.agentSpec(agent), "\u{1F916}", "agent definition");
    await deleteFile(`.github/chatmodes/ \u{1F3AD} planner.chatmode.md`, "legacy planner chatmode");
    await deleteFile(`.github/chatmodes/\u{1F3AD} generator.chatmode.md`, "legacy generator chatmode");
    await deleteFile(`.github/chatmodes/\u{1F3AD} healer.chatmode.md`, "legacy healer chatmode");
    await deleteFile(`.github/agents/ \u{1F3AD} planner.agent.md`, "legacy planner agent");
    await deleteFile(`.github/agents/\u{1F3AD} generator.agent.md`, "legacy generator agent");
    await deleteFile(`.github/agents/\u{1F3AD} healer.agent.md`, "legacy healer agent");
    await VSCodeGenerator.appendToMCPJson();
    const mcpConfig = { mcpServers: CopilotGenerator.mcpServers };
    if (!import_fs.default.existsSync(".github/copilot-setup-steps.yml")) {
      const yaml2 = import_fs.default.readFileSync(import_path.default.join(__dirname, "copilot-setup-steps.yml"), "utf-8");
      await writeFile(".github/workflows/copilot-setup-steps.yml", yaml2, "\u{1F527}", "GitHub Copilot setup steps");
    }
    console.log("");
    console.log("");
    console.log(" \u{1F527} TODO: GitHub > Settings > Copilot > Coding agent > MCP configuration");
    console.log("------------------------------------------------------------------");
    console.log(JSON.stringify(mcpConfig, null, 2));
    console.log("------------------------------------------------------------------");
    initRepoDone();
  }
  static agentSpec(agent) {
    const examples = agent.examples.length ? ` Examples: ${agent.examples.map((example) => `<example>${example}</example>`).join("")}` : "";
    const lines = [];
    const header = {
      "name": agent.name,
      "description": agent.description + examples,
      "tools": agent.tools,
      "model": "Claude Sonnet 4.6",
      "mcp-servers": CopilotGenerator.mcpServers
    };
    lines.push(`---`);
    lines.push(yaml.stringify(header, { lineWidth: 1e5 }) + `---`);
    lines.push("");
    lines.push(agent.instructions);
    lines.push("");
    return lines.join("\n");
  }
  static {
    this.mcpServers = {
      "playwright-test": {
        "type": "stdio",
        "command": "npx",
        "args": [
          "playwright",
          "run-test-mcp-server"
        ],
        "tools": ["*"]
      }
    };
  }
}
class VSCodeGenerator {
  static async init(fullConfig, projectName) {
    await initRepo(fullConfig, projectName, {
      promptsFolder: void 0
    });
    const agents = await loadAgentSpecs();
    const nameMap = /* @__PURE__ */ new Map([
      ["playwright-test-planner", " \u{1F3AD} planner"],
      ["playwright-test-generator", "\u{1F3AD} generator"],
      ["playwright-test-healer", "\u{1F3AD} healer"]
    ]);
    await import_fs.default.promises.mkdir(".github/chatmodes", { recursive: true });
    for (const agent of agents)
      await writeFile(`.github/chatmodes/${nameMap.get(agent.name)}.chatmode.md`, VSCodeGenerator.agentSpec(agent), "\u{1F916}", "chatmode definition");
    await VSCodeGenerator.appendToMCPJson();
    initRepoDone();
  }
  static async appendToMCPJson() {
    await import_fs.default.promises.mkdir(".vscode", { recursive: true });
    const mcpJsonPath = ".vscode/mcp.json";
    let mcpJson = {
      servers: {},
      inputs: []
    };
    try {
      mcpJson = JSON.parse(import_fs.default.readFileSync(mcpJsonPath, "utf8"));
    } catch {
    }
    if (!mcpJson.servers)
      mcpJson.servers = {};
    mcpJson.servers["playwright-test"] = {
      type: "stdio",
      command: "npx",
      args: ["playwright", "run-test-mcp-server"]
    };
    await writeFile(mcpJsonPath, JSON.stringify(mcpJson, null, 2), "\u{1F527}", "mcp configuration");
  }
  static agentSpec(agent) {
    const vscodeToolMap = /* @__PURE__ */ new Map([
      ["search", ["search/listDirectory", "search/fileSearch", "search/textSearch"]],
      ["read", ["search/readFile"]],
      ["edit", ["edit/editFiles"]],
      ["write", ["edit/createFile", "edit/createDirectory"]]
    ]);
    const vscodeToolsOrder = ["edit/createFile", "edit/createDirectory", "edit/editFiles", "search/fileSearch", "search/textSearch", "search/listDirectory", "search/readFile"];
    const vscodeMcpName = "playwright-test";
    function asVscodeTool(tool) {
      const [first, second] = tool.split("/");
      if (second)
        return `${vscodeMcpName}/${second}`;
      return vscodeToolMap.get(first) || first;
    }
    const tools = agent.tools.map(asVscodeTool).flat().sort((a, b) => {
      const indexA = vscodeToolsOrder.indexOf(a);
      const indexB = vscodeToolsOrder.indexOf(b);
      if (indexA === -1 && indexB === -1)
        return a.localeCompare(b);
      if (indexA === -1)
        return 1;
      if (indexB === -1)
        return -1;
      return indexA - indexB;
    }).map((tool) => `'${tool}'`).join(", ");
    const lines = [];
    lines.push(`---`);
    lines.push(`description: ${agent.description}.`);
    lines.push(`tools: [${tools}]`);
    lines.push(`---`);
    lines.push("");
    lines.push(agent.instructions);
    for (const example of agent.examples)
      lines.push(`<example>${example}</example>`);
    lines.push("");
    return lines.join("\n");
  }
}
async function writeFile(filePath, content, icon, description) {
  console.log(` ${icon} ${import_path.default.relative(process.cwd(), filePath)} ${colors.dim("- " + description)}`);
  await mkdirIfNeeded(filePath);
  await import_fs.default.promises.writeFile(filePath, content, "utf-8");
}
async function deleteFile(filePath, description) {
  try {
    if (!import_fs.default.existsSync(filePath))
      return;
  } catch {
    return;
  }
  console.log(` \u2702\uFE0F  ${import_path.default.relative(process.cwd(), filePath)} ${colors.dim("- " + description)}`);
  await import_fs.default.promises.unlink(filePath);
}
async function initRepo(fullConfig, projectName, options) {
  const project = (0, import_seed.seedProject)(fullConfig, projectName);
  console.log(` \u{1F3AD} Using project "${project.project.name}" as a primary project`);
  if (!import_fs.default.existsSync("specs")) {
    await import_fs.default.promises.mkdir("specs");
    await writeFile(import_path.default.join("specs", "README.md"), `# Specs

This is a directory for test plans.
`, "\u{1F4DD}", "directory for test plans");
  }
  let seedFile = await (0, import_seed.findSeedFile)(project);
  if (!seedFile) {
    seedFile = (0, import_seed.defaultSeedFile)(project);
    await writeFile(seedFile, import_seed.seedFileContent, "\u{1F331}", "default environment seed file");
  }
  if (options.promptsFolder) {
    await import_fs.default.promises.mkdir(options.promptsFolder, { recursive: true });
    for (const promptFile of await import_fs.default.promises.readdir(__dirname)) {
      if (!promptFile.endsWith(".prompt.md"))
        continue;
      const shortName = promptFile.replace(".prompt.md", "");
      const fileName = options.promptSuffix ? `${shortName}.${options.promptSuffix}.md` : `${shortName}.md`;
      const content = await loadPrompt(promptFile, {
        defaultAgentName: "default",
        ...options,
        seedFile: import_path.default.relative(process.cwd(), seedFile)
      });
      await writeFile(import_path.default.join(options.promptsFolder, fileName), content, "\u{1F4DD}", "prompt template");
    }
  }
}
function initRepoDone() {
  console.log(" \u2705 Done.");
}
async function loadPrompt(file, params) {
  const content = await import_fs.default.promises.readFile(import_path.default.join(__dirname, file), "utf-8");
  return Object.entries(params).reduce((acc, [key, value]) => {
    return acc.replace(new RegExp(`\\\${${key}}`, "g"), value);
  }, content);
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  ClaudeGenerator,
  CodexGenerator,
  CopilotGenerator,
  OpencodeGenerator,
  VSCodeGenerator
});
---
agent: ${defaultAgentName}
description: Produce test coverage
---

Parameters:
- Task: the task to perform
- Seed file (optional): the seed file to use, defaults to `${seedFile}`
- Test plan file (optional): the test plan file to write, under `specs/` folder.

1. Call #playwright-test-planner subagent with prompt:

<plan>
  <task-text><!-- the task --></task-text>
  <seed-file><!-- path to seed file --></seed-file>
  <plan-file><!-- path to test plan file to generate --></plan-file>
</plan>

2. For each test case from the test plan file (1.1, 1.2, ...), one after another, not in parallel, call #playwright-test-generator subagent with prompt:

<generate>
  <test-suite><!-- Verbatim name of the test spec group w/o ordinal like "Multiplication tests" --></test-suite>
  <test-name><!-- Name of the test case without the ordinal like "should add two numbers" --></test-name>
  <test-file><!-- Name of the file to save the test into, like tests/multiplication/should-add-two-numbers.spec.ts --></test-file>
  <seed-file><!-- Seed file path from test plan --></seed-file>
  <body><!-- Test case content including steps and expectations --></body>
</generate>

3. Call #playwright-test-healer subagent with prompt:

<heal>Run all tests and fix the failing ones one after another.</heal>
---
agent: playwright-test-generator
description: Generate test plan
---

Generate tests for the test plan's bullet 1.1 Add item to card.

Test plan: `specs/coverage.plan.md`
---
name: playwright-test-generator
description: Use this agent when you need to create automated browser tests using Playwright
model: sonnet
color: blue
tools:
  - search
  - playwright-test/browser_click
  - playwright-test/browser_drag
  - playwright-test/browser_evaluate
  - playwright-test/browser_file_upload
  - playwright-test/browser_handle_dialog
  - playwright-test/browser_hover
  - playwright-test/browser_navigate
  - playwright-test/browser_press_key
  - playwright-test/browser_select_option
  - playwright-test/browser_snapshot
  - playwright-test/browser_type
  - playwright-test/browser_verify_element_visible
  - playwright-test/browser_verify_list_visible
  - playwright-test/browser_verify_text_visible
  - playwright-test/browser_verify_value
  - playwright-test/browser_wait_for
  - playwright-test/generator_read_log
  - playwright-test/generator_setup_page
  - playwright-test/generator_write_test
---

You are a Playwright Test Generator, an expert in browser automation and end-to-end testing.
Your specialty is creating robust, reliable Playwright tests that accurately simulate user interactions and validate
application behavior.

# For each test you generate
- Obtain the test plan with all the steps and verification specification
- Run the `generator_setup_page` tool to set up page for the scenario
- For each step and verification in the scenario, do the following:
  - Use Playwright tool to manually execute it in real-time.
  - Use the step description as the intent for each Playwright tool call.
- Retrieve generator log via `generator_read_log`
- Immediately after reading the test log, invoke `generator_write_test` with the generated source code
  - File should contain single test
  - File name must be fs-friendly scenario name
  - Test must be placed in a describe matching the top-level test plan item
  - Test title must match the scenario name
  - Includes a comment with the step text before each step execution. Do not duplicate comments if step requires
    multiple actions.
  - Always use best practices from the log when generating tests.

   <example-generation>
   For following plan:

   ```markdown file=specs/plan.md
   ### 1. Adding New Todos
   **Seed:** `tests/seed.spec.ts`

   #### 1.1 Add Valid Todo
   **Steps:**
   1. Click in the "What needs to be done?" input field

   #### 1.2 Add Multiple Todos
   ...
   ```

   Following file is generated:

   ```ts file=add-valid-todo.spec.ts
   // spec: specs/plan.md
   // seed: tests/seed.spec.ts

   test.describe('Adding New Todos', () => {
     test('Add Valid Todo', async { page } => {
       // 1. Click in the "What needs to be done?" input field
       await page.click(...);

       ...
     });
   });
   ```
   </example-generation>

<example>
  Context: User wants to generate a test for the test plan item.
  <test-suite><!-- Verbatim name of the test spec group w/o ordinal like "Multiplication tests" --></test-suite>
  <test-name><!-- Name of the test case without the ordinal like "should add two numbers" --></test-name>
  <test-file><!-- Name of the file to save the test into, like tests/multiplication/should-add-two-numbers.spec.ts --></test-file>
  <seed-file><!-- Seed file path from test plan --></seed-file>
  <body><!-- Test case content including steps and expectations --></body>
</example>
---
agent: playwright-test-healer
description: Fix tests
---

Run all my tests and fix the failing ones.
---
name: playwright-test-healer
description: Use this agent when you need to debug and fix failing Playwright tests
model: sonnet
color: red
tools:
  - search
  - edit
  - playwright-test/browser_console_messages
  - playwright-test/browser_evaluate
  - playwright-test/browser_generate_locator
  - playwright-test/browser_network_request
  - playwright-test/browser_network_requests
  - playwright-test/browser_snapshot
  - playwright-test/test_debug
  - playwright-test/test_list
  - playwright-test/test_run
---

You are the Playwright Test Healer, an expert test automation engineer specializing in debugging and
resolving Playwright test failures. Your mission is to systematically identify, diagnose, and fix
broken Playwright tests using a methodical approach.

Your workflow:
1. **Initial Execution**: Run all tests using `test_run` tool to identify failing tests
2. **Debug failed tests**: For each failing test run `test_debug`.
3. **Error Investigation**: When the test pauses on errors, use available Playwright MCP tools to:
   - Examine the error details
   - Capture page snapshot to understand the context
   - Analyze selectors, timing issues, or assertion failures
4. **Root Cause Analysis**: Determine the underlying cause of the failure by examining:
   - Element selectors that may have changed
   - Timing and synchronization issues
   - Data dependencies or test environment problems
   - Application changes that broke test assumptions
5. **Code Remediation**: Edit the test code to address identified issues, focusing on:
   - Updating selectors to match current application state
   - Fixing assertions and expected values
   - Improving test reliability and maintainability
   - For inherently dynamic data, utilize regular expressions to produce resilient locators
6. **Verification**: Restart the test after each fix to validate the changes
7. **Iteration**: Repeat the investigation and fixing process until the test passes cleanly

Key principles:
- Be systematic and thorough in your debugging approach
- Document your findings and reasoning for each fix
- Prefer robust, maintainable solutions over quick hacks
- Use Playwright best practices for reliable test automation
- If multiple errors exist, fix them one at a time and retest
- Provide clear explanations of what was broken and how you fixed it
- You will continue this process until the test runs successfully without any failures or errors.
- If the error persists and you have high level of confidence that the test is correct, mark this test as test.fixme()
  so that it is skipped during the execution. Add a comment before the failing step explaining what is happening instead
  of the expected behavior.
- Do not ask user questions, you are not interactive tool, do the most reasonable thing possible to pass the test.
- Never wait for networkidle or use other discouraged or deprecated apis
---
agent: playwright-test-planner
description: Create test plan
---

Create test plan for "add to cart" functionality of my app.

- Seed file: `${seedFile}`
- Test plan: `specs/coverage.plan.md`
---
name: playwright-test-planner
description: Use this agent when you need to create comprehensive test plan for a web application or website
model: sonnet
color: green
tools:
  - search
  - playwright-test/browser_click
  - playwright-test/browser_close
  - playwright-test/browser_console_messages
  - playwright-test/browser_drag
  - playwright-test/browser_evaluate
  - playwright-test/browser_file_upload
  - playwright-test/browser_handle_dialog
  - playwright-test/browser_hover
  - playwright-test/browser_navigate
  - playwright-test/browser_navigate_back
  - playwright-test/browser_network_request
  - playwright-test/browser_network_requests
  - playwright-test/browser_press_key
  - playwright-test/browser_run_code_unsafe
  - playwright-test/browser_select_option
  - playwright-test/browser_snapshot
  - playwright-test/browser_take_screenshot
  - playwright-test/browser_type
  - playwright-test/browser_wait_for
  - playwright-test/planner_setup_page
  - playwright-test/planner_save_plan
---

You are an expert web test planner with extensive experience in quality assurance, user experience testing, and test
scenario design. Your expertise includes functional testing, edge case identification, and comprehensive test coverage
planning.

You will:

1. **Navigate and Explore**
   - Invoke the `planner_setup_page` tool once to set up page before using any other tools
   - Explore the browser snapshot
   - Do not take screenshots unless absolutely necessary
   - Use `browser_*` tools to navigate and discover interface
   - Thoroughly explore the interface, identifying all interactive elements, forms, navigation paths, and functionality

2. **Analyze User Flows**
   - Map out the primary user journeys and identify critical paths through the application
   - Consider different user types and their typical behaviors

3. **Design Comprehensive Scenarios**

   Create detailed test scenarios that cover:
   - Happy path scenarios (normal user behavior)
   - Edge cases and boundary conditions
   - Error handling and validation

4. **Structure Test Plans**

   Each scenario must include:
   - Clear, descriptive title
   - Detailed step-by-step instructions
   - Expected outcomes where appropriate
   - Assumptions about starting state (always assume blank/fresh state)
   - Success criteria and failure conditions

5. **Create Documentation**

   Submit your test plan using `planner_save_plan` tool.

**Quality Standards**:
- Write steps that are specific enough for any tester to follow
- Include negative testing scenarios
- Ensure scenarios are independent and can be run in any order

**Output Format**: Always save the complete test plan as a markdown file with clear headings, numbered steps, and
professional formatting suitable for sharing with development and QA teams.
"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  // If the importer is in node compatibility mode or this is not an ESM
  // file that has been converted to a CommonJS file using a Babel-
  // compatible transform (i.e. "__esModule" has not been set), then set
  // "default" to the CommonJS "module.exports" for node compatibility.
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var reportActions_exports = {};
__export(reportActions_exports, {
  mergeReports: () => mergeReports,
  showReport: () => showReport
});
module.exports = __toCommonJS(reportActions_exports);
var import_fs = __toESM(require("fs"));
var import_path = __toESM(require("path"));
var import_common = require("../common");
var import_runner = require("../runner");
const { gracefullyProcessExitDoNotHang } = require("playwright-core/lib/coreBundle").utils;
async function showReport(report, host, port) {
  await import_runner.html.showHTMLReport(report, host, port);
}
async function mergeReports(reportDir, opts) {
  const configFile = opts.config;
  const config = configFile ? await import_common.configLoader.loadConfigFromFile(configFile) : await import_common.configLoader.loadEmptyConfigForMergeReports();
  const dir = import_path.default.resolve(process.cwd(), reportDir || "");
  const dirStat = await import_fs.default.promises.stat(dir).catch((e) => null);
  if (!dirStat)
    throw new Error("Directory does not exist: " + dir);
  if (!dirStat.isDirectory())
    throw new Error(`"${dir}" is not a directory`);
  let reporterDescriptions = resolveReporterOption(opts.reporter);
  if (!reporterDescriptions && configFile)
    reporterDescriptions = config.config.reporter;
  if (!reporterDescriptions)
    reporterDescriptions = [[import_common.config.defaultReporter]];
  const rootDirOverride = configFile ? config.config.rootDir : void 0;
  await import_runner.merge.createMergedReport(config, dir, reporterDescriptions, rootDirOverride);
  gracefullyProcessExitDoNotHang(0);
}
function resolveReporterOption(reporter) {
  if (!reporter || !reporter.length)
    return void 0;
  return reporter.split(",").map((r) => [resolveReporter(r)]);
}
function resolveReporter(id) {
  if (import_common.builtInReporters.includes(id))
    return id;
  const localPath = import_path.default.resolve(process.cwd(), id);
  if (import_fs.default.existsSync(localPath))
    return localPath;
  return require.resolve(id, { paths: [process.cwd()] });
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  mergeReports,
  showReport
});
"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  // If the importer is in node compatibility mode or this is not an ESM
  // file that has been converted to a CommonJS file using a Babel-
  // compatible transform (i.e. "__esModule" has not been set), then set
  // "default" to the CommonJS "module.exports" for node compatibility.
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var testActions_exports = {};
__export(testActions_exports, {
  clearCache: () => clearCache,
  runTestServerAction: () => runTestServerAction,
  runTests: () => runTests
});
module.exports = __toCommonJS(testActions_exports);
var import_fs = __toESM(require("fs"));
var import_path = __toESM(require("path"));
var import_common = require("../common");
var import_runner = require("../runner");
const { gracefullyProcessExitDoNotHang } = require("playwright-core/lib/coreBundle").utils;
const { startProfiling, stopProfiling } = require("playwright-core/lib/coreBundle").utils;
async function runTests(args, opts) {
  await startProfiling();
  const cliOverrides = overridesFromOptions(opts);
  cliOverrides.argv = process.argv;
  const config = await import_common.configLoader.loadConfigFromFile(opts.config, cliOverrides, opts.deps === false);
  const options = {
    locations: args.length ? args : void 0,
    grep: opts.grep,
    grepInvert: opts.grepInvert,
    onlyChanged: opts.onlyChanged === true ? "HEAD" : opts.onlyChanged,
    listMode: !!opts.list,
    projectFilter: opts.project || void 0,
    passWithNoTests: !!opts.passWithNoTests,
    lastFailed: !!opts.lastFailed,
    lastFailedFile: opts.lastFailedFile,
    testList: opts.testList ? import_path.default.resolve(process.cwd(), opts.testList) : void 0,
    testListInvert: opts.testListInvert ? import_path.default.resolve(process.cwd(), opts.testListInvert) : void 0,
    shardWeights: resolveShardWeightsOption()
  };
  import_runner.projectUtils.filterProjects(config.projects, options.projectFilter);
  if (opts.ui || opts.uiHost || opts.uiPort) {
    if (opts.onlyChanged)
      throw new Error(`--only-changed is not supported in UI mode. If you'd like that to change, see https://github.com/microsoft/playwright/issues/15075 for more details.`);
    const status2 = await import_runner.testServer.runUIMode(opts.config, cliOverrides, {
      host: opts.uiHost,
      port: opts.uiPort ? +opts.uiPort : void 0,
      args,
      grep: opts.grep,
      grepInvert: opts.grepInvert,
      project: opts.project || void 0,
      reporter: Array.isArray(opts.reporter) ? opts.reporter : opts.reporter ? [opts.reporter] : void 0
    });
    await stopProfiling("runner");
    const exitCode2 = status2 === "interrupted" ? 130 : status2 === "passed" ? 0 : 1;
    gracefullyProcessExitDoNotHang(exitCode2);
    return;
  }
  if (process.env.PWTEST_WATCH) {
    if (opts.onlyChanged)
      throw new Error(`--only-changed is not supported in watch mode. If you'd like that to change, file an issue and let us know about your usecase for it.`);
    const status2 = await import_runner.watchMode.runWatchModeLoop(
      import_common.configLoader.resolveConfigLocation(opts.config),
      {
        projects: opts.project,
        files: args,
        grep: opts.grep
      }
    );
    await stopProfiling("runner");
    const exitCode2 = status2 === "interrupted" ? 130 : status2 === "passed" ? 0 : 1;
    gracefullyProcessExitDoNotHang(exitCode2);
    return;
  }
  const status = await import_runner.testRunner.runAllTestsWithConfig(config, options);
  await stopProfiling("runner");
  const exitCode = status === "interrupted" ? 130 : status === "passed" ? 0 : 1;
  gracefullyProcessExitDoNotHang(exitCode);
}
async function runTestServerAction(opts) {
  const host = opts.host;
  const port = opts.port ? +opts.port : void 0;
  const status = await import_runner.testServer.runTestServer(opts.config, {}, { host, port });
  const exitCode = status === "interrupted" ? 130 : status === "passed" ? 0 : 1;
  gracefullyProcessExitDoNotHang(exitCode);
}
async function clearCache(opts) {
  const runner = new import_runner.testRunner.TestRunner(import_common.configLoader.resolveConfigLocation(opts.config), {});
  const { status } = await runner.clearCache(import_runner.runnerReporters.createErrorCollectingReporter(import_runner.base.terminalScreen));
  const exitCode = status === "interrupted" ? 130 : status === "passed" ? 0 : 1;
  gracefullyProcessExitDoNotHang(exitCode);
}
function overridesFromOptions(options) {
  if (options.ui) {
    options.debug = void 0;
    options.trace = void 0;
  }
  const overrides = {
    debug: options.debug,
    failOnFlakyTests: options.failOnFlakyTests ? true : void 0,
    forbidOnly: options.forbidOnly ? true : void 0,
    fullyParallel: options.fullyParallel ? true : void 0,
    globalTimeout: options.globalTimeout ? parseInt(options.globalTimeout, 10) : void 0,
    maxFailures: options.x ? 1 : options.maxFailures ? parseInt(options.maxFailures, 10) : void 0,
    outputDir: options.output ? import_path.default.resolve(process.cwd(), options.output) : void 0,
    pause: !!process.env.PWPAUSE,
    quiet: options.quiet ? options.quiet : void 0,
    repeatEach: options.repeatEach ? parseInt(options.repeatEach, 10) : void 0,
    retries: options.retries ? parseInt(options.retries, 10) : void 0,
    reporter: resolveReporterOption(options.reporter),
    shard: resolveShardOption(options.shard),
    timeout: options.timeout ? parseInt(options.timeout, 10) : void 0,
    tsconfig: options.tsconfig ? import_path.default.resolve(process.cwd(), options.tsconfig) : void 0,
    ignoreSnapshots: options.ignoreSnapshots ? !!options.ignoreSnapshots : void 0,
    updateSnapshots: options.updateSnapshots,
    updateSourceMethod: options.updateSourceMethod,
    use: {
      trace: options.trace
    },
    workers: options.workers
  };
  if (options.browser) {
    const browserOpt = options.browser.toLowerCase();
    if (!["all", "chromium", "firefox", "webkit"].includes(browserOpt))
      throw new Error(`Unsupported browser "${options.browser}", must be one of "all", "chromium", "firefox" or "webkit"`);
    const browserNames = browserOpt === "all" ? ["chromium", "firefox", "webkit"] : [browserOpt];
    overrides.projects = browserNames.map((browserName) => {
      return {
        name: browserName,
        use: { browserName }
      };
    });
  }
  if (options.headed)
    overrides.use.headless = false;
  if (options.debug === "inspector") {
    overrides.use.headless = false;
    process.env.PWDEBUG = "1";
  }
  if (overrides.tsconfig && !import_fs.default.existsSync(overrides.tsconfig))
    throw new Error(`--tsconfig "${options.tsconfig}" does not exist`);
  return overrides;
}
function resolveReporterOption(reporter) {
  if (!reporter || !reporter.length)
    return void 0;
  return reporter.split(",").map((r) => [resolveReporter(r)]);
}
function resolveShardOption(shard) {
  if (!shard)
    return void 0;
  const shardPair = shard.split("/");
  if (shardPair.length !== 2) {
    throw new Error(
      `--shard "${shard}", expected format is "current/all", 1-based, for example "3/5".`
    );
  }
  const current = parseInt(shardPair[0], 10);
  const total = parseInt(shardPair[1], 10);
  if (isNaN(total) || total < 1)
    throw new Error(`--shard "${shard}" total must be a positive number`);
  if (isNaN(current) || current < 1 || current > total) {
    throw new Error(
      `--shard "${shard}" current must be a positive number, not greater than shard total`
    );
  }
  return { current, total };
}
function resolveShardWeightsOption() {
  const shardWeights = process.env.PWTEST_SHARD_WEIGHTS;
  if (!shardWeights)
    return void 0;
  return shardWeights.split(":").map((w) => {
    const weight = parseInt(w, 10);
    if (isNaN(weight) || weight < 0)
      throw new Error(`PWTEST_SHARD_WEIGHTS="${shardWeights}" weights must be non-negative numbers`);
    return weight;
  });
}
function resolveReporter(id) {
  if (import_common.builtInReporters.includes(id))
    return id;
  const localPath = import_path.default.resolve(process.cwd(), id);
  if (import_fs.default.existsSync(localPath))
    return localPath;
  return require.resolve(id, { paths: [process.cwd()] });
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  clearCache,
  runTestServerAction,
  runTests
});
"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  // If the importer is in node compatibility mode or this is not an ESM
  // file that has been converted to a CommonJS file using a Babel-
  // compatible transform (i.e. "__esModule" has not been set), then set
  // "default" to the CommonJS "module.exports" for node compatibility.
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);

// packages/playwright/src/common/index.ts
var index_exports = {};
__export(index_exports, {
  FullConfigInternal: () => FullConfigInternal,
  ProcessRunner: () => ProcessRunner,
  builtInReporters: () => builtInReporters,
  cc: () => compilationCache_exports,
  config: () => config_exports,
  configLoader: () => configLoader_exports,
  defineConfig: () => defineConfig,
  fixtures: () => fixtures_exports,
  ipc: () => ipc_exports,
  mergeTests: () => mergeTests,
  poolBuilder: () => poolBuilder_exports,
  processRunner: () => process_exports,
  startProcessRunner: () => startProcessRunner,
  suiteUtils: () => suiteUtils_exports,
  test: () => test_exports,
  testLoader: () => testLoader_exports,
  testType: () => testType_exports,
  transform: () => transform_exports
});
module.exports = __toCommonJS(index_exports);

// packages/playwright/src/transform/compilationCache.ts
var compilationCache_exports = {};
__export(compilationCache_exports, {
  addToCompilationCache: () => addToCompilationCache,
  affectedTestFiles: () => affectedTestFiles,
  belongsToNodeModules: () => belongsToNodeModules,
  cacheDir: () => cacheDir,
  collectAffectedTestFiles: () => collectAffectedTestFiles,
  currentFileDepsCollector: () => currentFileDepsCollector,
  dependenciesForTestFile: () => dependenciesForTestFile,
  fileDependenciesForTest: () => fileDependenciesForTest,
  getFromCompilationCache: () => getFromCompilationCache,
  getUserData: () => getUserData,
  installSourceMapSupport: () => installSourceMapSupport,
  internalDependenciesForTestFile: () => internalDependenciesForTestFile,
  serializeCompilationCache: () => serializeCompilationCache,
  setExternalDependencies: () => setExternalDependencies,
  startCollectingFileDeps: () => startCollectingFileDeps,
  stopCollectingFileDeps: () => stopCollectingFileDeps
});
var import_fs = __toESM(require("fs"));
var import_os = __toESM(require("os"));
var import_path = __toESM(require("path"));
var import_globals = require("../globals");
var import_package = require("../package");
var sourceMapSupport = require("playwright-core/lib/utilsBundle").sourceMapSupport;
var { calculateSha1 } = require("playwright-core/lib/coreBundle").utils;
var { isUnderTest } = require("playwright-core/lib/coreBundle").utils;
var cacheDir = process.env.PWTEST_CACHE_DIR || (() => {
  if (process.platform === "win32")
    return import_path.default.join(import_os.default.tmpdir(), `playwright-transform-cache`);
  return import_path.default.join(import_os.default.tmpdir(), `playwright-transform-cache-` + process.geteuid?.());
})();
var sourceMaps = /* @__PURE__ */ new Map();
var memoryCache = /* @__PURE__ */ new Map();
var fileDependencies = /* @__PURE__ */ new Map();
var externalDependencies = /* @__PURE__ */ new Map();
var devSourceInfix = import_path.default.sep + "playwright" + import_path.default.sep + "packages" + import_path.default.sep;
function installSourceMapSupport() {
  Error.stackTraceLimit = 200;
  sourceMapSupport.install({
    environment: "node",
    handleUncaughtExceptions: false,
    retrieveSourceMap(source) {
      if (!process.env.PWDEBUGIMPL && isUnderTest() && source.includes(devSourceInfix))
        return { map: identitySourceMap(source), url: source };
      if (!sourceMaps.has(source))
        return null;
      const sourceMapPath = sourceMaps.get(source);
      try {
        return {
          map: JSON.parse(import_fs.default.readFileSync(sourceMapPath, "utf-8")),
          url: source
        };
      } catch {
        return null;
      }
    }
  });
}
function identitySourceMap(source) {
  const lineCount = import_fs.default.readFileSync(source, "utf8").split("\n").length;
  return {
    version: 3,
    sources: [source],
    mappings: lineCount ? "AAAA" + ";AACA".repeat(lineCount - 1) : ""
  };
}
function _innerAddToCompilationCacheAndSerialize(filename, entry) {
  sourceMaps.set(entry.moduleUrl || filename, entry.sourceMapPath);
  memoryCache.set(filename, entry);
  return {
    sourceMaps: [[entry.moduleUrl || filename, entry.sourceMapPath]],
    memoryCache: [[filename, entry]],
    fileDependencies: [],
    externalDependencies: []
  };
}
function getFromCompilationCache(filename, contentHash, moduleUrl) {
  const cache = memoryCache.get(filename);
  if (cache?.codePath) {
    try {
      return { cachedCode: import_fs.default.readFileSync(cache.codePath, "utf-8") };
    } catch {
    }
  }
  const filePathHash = calculateFilePathHash(filename);
  const hashPrefix = filePathHash + "_" + contentHash.substring(0, 7);
  const cacheFolderName = filePathHash.substring(0, 2);
  const cachePath = calculateCachePath(filename, cacheFolderName, hashPrefix);
  const codePath = cachePath + ".js";
  const sourceMapPath = cachePath + ".map";
  const dataPath = cachePath + ".data";
  try {
    const cachedCode = import_fs.default.readFileSync(codePath, "utf8");
    const serializedCache = _innerAddToCompilationCacheAndSerialize(filename, { codePath, sourceMapPath, dataPath, moduleUrl });
    return { cachedCode, serializedCache };
  } catch {
  }
  return {
    addToCache: (code, map, data) => {
      if ((0, import_globals.isWorkerProcess)())
        return {};
      clearOldCacheEntries(cacheFolderName, filePathHash);
      import_fs.default.mkdirSync(import_path.default.dirname(cachePath), { recursive: true });
      if (map)
        import_fs.default.writeFileSync(sourceMapPath, JSON.stringify(map), "utf8");
      if (data.size)
        import_fs.default.writeFileSync(dataPath, JSON.stringify(Object.fromEntries(data.entries()), void 0, 2), "utf8");
      import_fs.default.writeFileSync(codePath, code, "utf8");
      const serializedCache = _innerAddToCompilationCacheAndSerialize(filename, { codePath, sourceMapPath, dataPath, moduleUrl });
      return { serializedCache };
    }
  };
}
function serializeCompilationCache() {
  return {
    sourceMaps: [...sourceMaps.entries()],
    memoryCache: [...memoryCache.entries()],
    fileDependencies: [...fileDependencies.entries()].map(([filename, deps]) => [filename, [...deps]]),
    externalDependencies: [...externalDependencies.entries()].map(([filename, deps]) => [filename, [...deps]])
  };
}
function addToCompilationCache(payload) {
  for (const entry of payload.sourceMaps)
    sourceMaps.set(entry[0], entry[1]);
  for (const entry of payload.memoryCache)
    memoryCache.set(entry[0], entry[1]);
  for (const entry of payload.fileDependencies) {
    const existing = fileDependencies.get(entry[0]) || [];
    fileDependencies.set(entry[0], /* @__PURE__ */ new Set([...entry[1], ...existing]));
  }
  for (const entry of payload.externalDependencies) {
    const existing = externalDependencies.get(entry[0]) || [];
    externalDependencies.set(entry[0], /* @__PURE__ */ new Set([...entry[1], ...existing]));
  }
}
function calculateFilePathHash(filePath) {
  return calculateSha1(filePath).substring(0, 10);
}
function calculateCachePath(filePath, cacheFolderName, hashPrefix) {
  const fileName2 = hashPrefix + "_" + import_path.default.basename(filePath, import_path.default.extname(filePath)).replace(/\W/g, "");
  return import_path.default.join(cacheDir, cacheFolderName, fileName2);
}
function clearOldCacheEntries(cacheFolderName, filePathHash) {
  const cachePath = import_path.default.join(cacheDir, cacheFolderName);
  try {
    const cachedRelevantFiles = import_fs.default.readdirSync(cachePath).filter((file2) => file2.startsWith(filePathHash));
    for (const file2 of cachedRelevantFiles)
      import_fs.default.rmSync(import_path.default.join(cachePath, file2), { force: true });
  } catch {
  }
}
var depsCollector2;
function startCollectingFileDeps() {
  depsCollector2 = /* @__PURE__ */ new Set();
}
function stopCollectingFileDeps(filename) {
  if (!depsCollector2)
    return;
  depsCollector2.delete(filename);
  for (const dep of depsCollector2) {
    if (belongsToNodeModules(dep))
      depsCollector2.delete(dep);
  }
  fileDependencies.set(filename, depsCollector2);
  depsCollector2 = void 0;
}
function currentFileDepsCollector() {
  return depsCollector2;
}
function setExternalDependencies(filename, deps) {
  const depsSet = new Set(deps.filter((dep) => !belongsToNodeModules(dep) && dep !== filename));
  externalDependencies.set(filename, depsSet);
}
function fileDependenciesForTest() {
  return Object.fromEntries([...fileDependencies.entries()].map((entry) => [import_path.default.basename(entry[0]), [...entry[1]].map((f) => import_path.default.basename(f)).sort()]));
}
function collectAffectedTestFiles(changedFile, testFileCollector) {
  const isTestFile = (file2) => fileDependencies.has(file2);
  if (isTestFile(changedFile))
    testFileCollector.add(changedFile);
  for (const [testFile, deps] of fileDependencies) {
    if (deps.has(changedFile))
      testFileCollector.add(testFile);
  }
  for (const [importingFile, depsOfImportingFile] of externalDependencies) {
    if (depsOfImportingFile.has(changedFile)) {
      if (isTestFile(importingFile))
        testFileCollector.add(importingFile);
      for (const [testFile, depsOfTestFile] of fileDependencies) {
        if (depsOfTestFile.has(importingFile))
          testFileCollector.add(testFile);
      }
    }
  }
}
function affectedTestFiles(changes) {
  const result2 = /* @__PURE__ */ new Set();
  for (const change of changes)
    collectAffectedTestFiles(change, result2);
  return [...result2];
}
function internalDependenciesForTestFile(filename) {
  return fileDependencies.get(filename);
}
function dependenciesForTestFile(filename) {
  const result2 = /* @__PURE__ */ new Set();
  for (const testDependency of fileDependencies.get(filename) || []) {
    result2.add(testDependency);
    for (const externalDependency of externalDependencies.get(testDependency) || [])
      result2.add(externalDependency);
  }
  for (const dep of externalDependencies.get(filename) || [])
    result2.add(dep);
  return result2;
}
var kPlaywrightInternalPrefix = import_package.packageRoot;
function belongsToNodeModules(file2) {
  if (file2.includes(`${import_path.default.sep}node_modules${import_path.default.sep}`))
    return true;
  if (file2.startsWith(kPlaywrightInternalPrefix) && (file2.endsWith(".js") || file2.endsWith(".mjs")))
    return true;
  return false;
}
async function getUserData(pluginName) {
  const result2 = /* @__PURE__ */ new Map();
  for (const [fileName2, cache] of memoryCache) {
    if (!cache.dataPath)
      continue;
    if (!import_fs.default.existsSync(cache.dataPath))
      continue;
    const data = JSON.parse(await import_fs.default.promises.readFile(cache.dataPath, "utf8"));
    if (data[pluginName])
      result2.set(fileName2, data[pluginName]);
  }
  return result2;
}

// packages/playwright/src/common/config.ts
var config_exports = {};
__export(config_exports, {
  FullConfigInternal: () => FullConfigInternal,
  FullProjectInternal: () => FullProjectInternal,
  builtInReporters: () => builtInReporters,
  defaultGrep: () => defaultGrep,
  defaultReporter: () => defaultReporter,
  defaultTimeout: () => defaultTimeout,
  getProjectId: () => getProjectId,
  toReporters: () => toReporters
});
var import_fs3 = __toESM(require("fs"));
var import_os2 = __toESM(require("os"));
var import_path3 = __toESM(require("path"));
var import_package2 = require("../package");

// packages/playwright/src/util.ts
var import_fs2 = __toESM(require("fs"));
var import_path2 = __toESM(require("path"));
var import_util = __toESM(require("util"));
var debug = require("playwright-core/lib/utilsBundle").debug;
var mime = require("playwright-core/lib/utilsBundle").mime;
var minimatch = require("playwright-core/lib/utilsBundle").minimatch;
var { calculateSha1: calculateSha12 } = require("playwright-core/lib/coreBundle").utils;
var { sanitizeForFilePath } = require("playwright-core/lib/coreBundle").utils;
var { isRegExp } = require("playwright-core/lib/coreBundle").iso;
var { parseStackFrame, stringifyStackFrames } = require("playwright-core/lib/coreBundle").iso;
var { ansiRegex, isString, stripAnsiEscapes } = require("playwright-core/lib/coreBundle").iso;
var PLAYWRIGHT_TEST_PATH = import_path2.default.join(__dirname, "..");
var PLAYWRIGHT_CORE_PATH = import_path2.default.dirname(require.resolve("playwright-core/package.json"));
function filterStackTrace(e) {
  const name = e.name ? e.name + ": " : "";
  const cause = e.cause instanceof Error ? filterStackTrace(e.cause) : void 0;
  if (process.env.PWDEBUGIMPL)
    return { message: name + e.message, stack: e.stack || "", cause };
  const stackLines = stringifyStackFrames(filteredStackTrace(e.stack?.split("\n") || []));
  return {
    message: name + e.message,
    stack: `${name}${e.message}${stackLines.map((line) => "\n" + line).join("")}`,
    cause
  };
}
function filterStackFile(file2) {
  if (process.env.PWDEBUGIMPL)
    return true;
  if (file2.startsWith(PLAYWRIGHT_TEST_PATH))
    return false;
  if (file2.startsWith(PLAYWRIGHT_CORE_PATH))
    return false;
  return true;
}
function filteredStackTrace(rawStack) {
  const frames = [];
  for (const line of rawStack) {
    const frame = parseStackFrame(line, import_path2.default.sep, !!process.env.PWDEBUGIMPL);
    if (!frame || !frame.file)
      continue;
    if (!filterStackFile(frame.file))
      continue;
    frames.push(frame);
  }
  return frames;
}
function serializeError(error) {
  if (error instanceof Error)
    return filterStackTrace(error);
  return {
    value: import_util.default.inspect(error)
  };
}
function parseLocationArg(arg) {
  const match = /^(.*?):(\d+):?(\d+)?$/.exec(arg);
  return {
    file: match ? match[1] : arg,
    line: match ? parseInt(match[2], 10) : null,
    column: match?.[3] ? parseInt(match[3], 10) : null
  };
}
function createFileMatcher(patterns) {
  const reList = [];
  const filePatterns = [];
  for (const pattern of Array.isArray(patterns) ? patterns : [patterns]) {
    if (isRegExp(pattern)) {
      reList.push(pattern);
    } else {
      if (!pattern.startsWith("**/"))
        filePatterns.push("**/" + pattern);
      else
        filePatterns.push(pattern);
    }
  }
  return (filePath) => {
    for (const re of reList) {
      re.lastIndex = 0;
      if (re.test(filePath))
        return true;
    }
    if (import_path2.default.sep === "\\") {
      const unixPath = filePath.split(import_path2.default.sep).join("/");
      for (const re of reList) {
        re.lastIndex = 0;
        if (re.test(unixPath))
          return true;
      }
    }
    for (const pattern of filePatterns) {
      if (minimatch(filePath, pattern, { nocase: true, dot: true }))
        return true;
    }
    return false;
  };
}
function mergeObjects(a, b, c) {
  const result2 = { ...a };
  for (const x of [b, c].filter(Boolean)) {
    for (const [name, value] of Object.entries(x)) {
      if (!Object.is(value, void 0))
        result2[name] = value;
    }
  }
  return result2;
}
function forceRegExp(pattern) {
  const match = pattern.match(/^\/(.*)\/([gi]*)$/);
  if (match)
    return new RegExp(match[1], match[2]);
  return new RegExp(pattern, "gi");
}
function relativeFilePath(file2) {
  if (!import_path2.default.isAbsolute(file2))
    return file2;
  return import_path2.default.relative(process.cwd(), file2);
}
function formatLocation(location) {
  return relativeFilePath(location.file) + ":" + location.line + ":" + location.column;
}
function errorWithFile(file2, message) {
  return new Error(`${relativeFilePath(file2)}: ${message}`);
}
var debugTest = debug("pw:test");
var folderToPackageJsonPath = /* @__PURE__ */ new Map();
function getPackageJsonPath(folderPath) {
  const cached = folderToPackageJsonPath.get(folderPath);
  if (cached !== void 0)
    return cached;
  const packageJsonPath = import_path2.default.join(folderPath, "package.json");
  if (import_fs2.default.existsSync(packageJsonPath)) {
    folderToPackageJsonPath.set(folderPath, packageJsonPath);
    return packageJsonPath;
  }
  const parentFolder = import_path2.default.dirname(folderPath);
  if (folderPath === parentFolder) {
    folderToPackageJsonPath.set(folderPath, "");
    return "";
  }
  const result2 = getPackageJsonPath(parentFolder);
  folderToPackageJsonPath.set(folderPath, result2);
  return result2;
}
function fileIsModule(file2) {
  if (file2.endsWith(".mjs") || file2.endsWith(".mts"))
    return true;
  if (file2.endsWith(".cjs") || file2.endsWith(".cts"))
    return false;
  const folder = import_path2.default.dirname(file2);
  return folderIsModule(folder);
}
var packageJsonIsModuleCache = /* @__PURE__ */ new Map();
function folderIsModule(folder) {
  const packageJsonPath = getPackageJsonPath(folder);
  if (!packageJsonPath)
    return false;
  if (!packageJsonIsModuleCache.has(packageJsonPath)) {
    let isModule2 = false;
    try {
      isModule2 = JSON.parse(import_fs2.default.readFileSync(packageJsonPath, "utf8")).type === "module";
    } catch {
    }
    packageJsonIsModuleCache.set(packageJsonPath, isModule2);
  }
  return packageJsonIsModuleCache.get(packageJsonPath);
}
var packageJsonMainFieldCache = /* @__PURE__ */ new Map();
function getMainFieldFromPackageJson(packageJsonPath) {
  if (!packageJsonMainFieldCache.has(packageJsonPath)) {
    let mainField;
    try {
      mainField = JSON.parse(import_fs2.default.readFileSync(packageJsonPath, "utf8")).main;
    } catch {
    }
    packageJsonMainFieldCache.set(packageJsonPath, mainField);
  }
  return packageJsonMainFieldCache.get(packageJsonPath);
}
var kExtLookups = /* @__PURE__ */ new Map([
  [".js", [".jsx", ".ts", ".tsx"]],
  [".jsx", [".tsx"]],
  [".cjs", [".cts"]],
  [".mjs", [".mts"]],
  ["", [".js", ".ts", ".jsx", ".tsx", ".cjs", ".mjs", ".cts", ".mts"]]
]);
function resolveImportSpecifierExtension(resolved) {
  if (fileExists(resolved))
    return resolved;
  for (const [ext, others] of kExtLookups) {
    if (!resolved.endsWith(ext))
      continue;
    for (const other of others) {
      const modified = resolved.substring(0, resolved.length - ext.length) + other;
      if (fileExists(modified))
        return modified;
    }
    break;
  }
}
function resolveImportSpecifierAfterMapping(resolved, afterPathMapping) {
  const resolvedFile = resolveImportSpecifierExtension(resolved);
  if (resolvedFile)
    return resolvedFile;
  if (dirExists(resolved)) {
    const packageJsonPath = import_path2.default.join(resolved, "package.json");
    if (afterPathMapping) {
      const mainField = getMainFieldFromPackageJson(packageJsonPath);
      const mainFieldResolved = mainField ? resolveImportSpecifierExtension(import_path2.default.resolve(resolved, mainField)) : void 0;
      return mainFieldResolved || resolveImportSpecifierExtension(import_path2.default.join(resolved, "index"));
    }
    if (fileExists(packageJsonPath))
      return resolved;
    const dirImport = import_path2.default.join(resolved, "index");
    return resolveImportSpecifierExtension(dirImport);
  }
}
function fileExists(resolved) {
  return import_fs2.default.statSync(resolved, { throwIfNoEntry: false })?.isFile();
}
function dirExists(resolved) {
  return import_fs2.default.statSync(resolved, { throwIfNoEntry: false })?.isDirectory();
}
function takeFirst(...args) {
  for (const arg of args) {
    if (arg !== void 0)
      return arg;
  }
  return void 0;
}

// packages/playwright/src/common/config.ts
var defaultTimeout = 3e4;
var FullConfigInternal = class {
  constructor(location, userConfig, configCLIOverrides, metadata) {
    this.projects = [];
    this.defineConfigWasUsed = false;
    this.globalSetups = [];
    this.globalTeardowns = [];
    if (configCLIOverrides.projects && userConfig.projects)
      throw new Error(`Cannot use --browser option when configuration file defines projects. Specify browserName in the projects instead.`);
    const { resolvedConfigFile, configDir } = location;
    const packageJsonPath = getPackageJsonPath(configDir);
    const packageJsonDir = packageJsonPath ? import_path3.default.dirname(packageJsonPath) : process.cwd();
    this.configDir = configDir;
    this.configCLIOverrides = configCLIOverrides;
    const privateConfiguration = userConfig["@playwright/test"];
    this.plugins = (privateConfiguration?.plugins || []).map((p) => ({ factory: p }));
    this.singleTSConfigPath = pathResolve(configDir, userConfig.tsconfig);
    this.captureGitInfo = userConfig.captureGitInfo;
    this.globalSetups = (Array.isArray(userConfig.globalSetup) ? userConfig.globalSetup : [userConfig.globalSetup]).map((s) => resolveScript(s, configDir)).filter((script) => script !== void 0);
    this.globalTeardowns = (Array.isArray(userConfig.globalTeardown) ? userConfig.globalTeardown : [userConfig.globalTeardown]).map((s) => resolveScript(s, configDir)).filter((script) => script !== void 0);
    userConfig.metadata = userConfig.metadata || {};
    const globalTags = Array.isArray(userConfig.tag) ? userConfig.tag : userConfig.tag ? [userConfig.tag] : [];
    for (const tag of globalTags) {
      if (tag[0] !== "@")
        throw new Error(`Tag must start with "@" symbol, got "${tag}" instead.`);
    }
    this.config = {
      argv: configCLIOverrides.argv ?? [],
      configFile: resolvedConfigFile,
      rootDir: pathResolve(configDir, userConfig.testDir) || configDir,
      failOnFlakyTests: takeFirst(configCLIOverrides.failOnFlakyTests, userConfig.failOnFlakyTests, false),
      forbidOnly: takeFirst(configCLIOverrides.forbidOnly, userConfig.forbidOnly, false),
      fullyParallel: takeFirst(configCLIOverrides.fullyParallel, userConfig.fullyParallel, false),
      globalSetup: this.globalSetups[0] ?? null,
      globalTeardown: this.globalTeardowns[0] ?? null,
      globalTimeout: takeFirst(configCLIOverrides.debug ? 0 : void 0, configCLIOverrides.globalTimeout, userConfig.globalTimeout, 0),
      grep: takeFirst(userConfig.grep, defaultGrep),
      grepInvert: takeFirst(userConfig.grepInvert, null),
      maxFailures: takeFirst(configCLIOverrides.debug ? 1 : void 0, configCLIOverrides.maxFailures, userConfig.maxFailures, 0),
      metadata: metadata ?? userConfig.metadata,
      preserveOutput: takeFirst(userConfig.preserveOutput, "always"),
      projects: [],
      quiet: takeFirst(configCLIOverrides.quiet, userConfig.quiet, false),
      reporter: takeFirst(configCLIOverrides.reporter, resolveReporters(userConfig.reporter, configDir), [[defaultReporter]]),
      reportSlowTests: takeFirst(userConfig.reportSlowTests, {
        max: 5,
        threshold: 3e5
        /* 5 minutes */
      }),
      shard: takeFirst(configCLIOverrides.shard, userConfig.shard, null),
      tags: globalTags,
      updateSnapshots: takeFirst(configCLIOverrides.updateSnapshots, userConfig.updateSnapshots, "missing"),
      updateSourceMethod: takeFirst(configCLIOverrides.updateSourceMethod, userConfig.updateSourceMethod, "patch"),
      version: import_package2.packageJSON.version,
      workers: resolveWorkers(takeFirst(configCLIOverrides.debug || configCLIOverrides.pause ? 1 : void 0, configCLIOverrides.workers, userConfig.workers, "50%")),
      webServer: null
    };
    for (const key in userConfig) {
      if (key.startsWith("@"))
        this.config[key] = userConfig[key];
    }
    this.config[configInternalSymbol] = this;
    const webServers = takeFirst(userConfig.webServer, null);
    if (Array.isArray(webServers)) {
      this.config.webServer = null;
      this.webServers = webServers;
    } else if (webServers) {
      this.config.webServer = webServers;
      this.webServers = [webServers];
    } else {
      this.webServers = [];
    }
    const projectConfigs = configCLIOverrides.projects || userConfig.projects || [{ ...userConfig, workers: void 0 }];
    this.projects = projectConfigs.map((p) => new FullProjectInternal(configDir, userConfig, this, p, this.configCLIOverrides, packageJsonDir));
    resolveProjectDependencies(this.projects);
    this._assignUniqueProjectIds(this.projects);
    this.config.projects = this.projects.map((p) => p.project);
  }
  _assignUniqueProjectIds(projects) {
    const usedNames = /* @__PURE__ */ new Set();
    for (const p of projects) {
      const name = p.project.name || "";
      for (let i = 0; i < projects.length; ++i) {
        const candidate = name + (i ? i : "");
        if (usedNames.has(candidate))
          continue;
        p.id = candidate;
        p.project.__projectId = p.id;
        usedNames.add(candidate);
        break;
      }
    }
  }
};
var FullProjectInternal = class {
  constructor(configDir, config, fullConfig, projectConfig, configCLIOverrides, packageJsonDir) {
    this.id = "";
    this.deps = [];
    this.fullConfig = fullConfig;
    const testDir = takeFirst(pathResolve(configDir, projectConfig.testDir), pathResolve(configDir, config.testDir), fullConfig.configDir);
    this.snapshotPathTemplate = takeFirst(projectConfig.snapshotPathTemplate, config.snapshotPathTemplate);
    this.project = {
      grep: takeFirst(projectConfig.grep, config.grep, defaultGrep),
      grepInvert: takeFirst(projectConfig.grepInvert, config.grepInvert, null),
      outputDir: takeFirst(configCLIOverrides.outputDir, pathResolve(configDir, projectConfig.outputDir), pathResolve(configDir, config.outputDir), import_path3.default.join(packageJsonDir, "test-results")),
      // Note: we either apply the cli override for repeatEach or not, depending on whether the
      // project is top-level vs dependency. See collectProjectsAndTestFiles in loadUtils.
      repeatEach: takeFirst(projectConfig.repeatEach, config.repeatEach, 1),
      retries: takeFirst(configCLIOverrides.retries, projectConfig.retries, config.retries, 0),
      metadata: takeFirst(projectConfig.metadata, config.metadata, {}),
      name: takeFirst(projectConfig.name, config.name, ""),
      testDir,
      snapshotDir: takeFirst(pathResolve(configDir, projectConfig.snapshotDir), pathResolve(configDir, config.snapshotDir), testDir),
      testIgnore: takeFirst(projectConfig.testIgnore, config.testIgnore, []),
      testMatch: takeFirst(projectConfig.testMatch, config.testMatch, "**/*.@(spec|test).?(c|m)[jt]s?(x)"),
      timeout: takeFirst(configCLIOverrides.debug === "inspector" ? 0 : void 0, configCLIOverrides.timeout, projectConfig.timeout, config.timeout, defaultTimeout),
      use: mergeObjects(config.use, projectConfig.use, configCLIOverrides.use),
      dependencies: projectConfig.dependencies || [],
      teardown: projectConfig.teardown,
      ignoreSnapshots: takeFirst(configCLIOverrides.ignoreSnapshots, projectConfig.ignoreSnapshots, config.ignoreSnapshots, false)
    };
    this.fullyParallel = takeFirst(configCLIOverrides.fullyParallel, projectConfig.fullyParallel, config.fullyParallel, void 0);
    this.expect = takeFirst(projectConfig.expect, config.expect, {});
    if (this.expect.toHaveScreenshot?.stylePath) {
      const stylePaths = Array.isArray(this.expect.toHaveScreenshot.stylePath) ? this.expect.toHaveScreenshot.stylePath : [this.expect.toHaveScreenshot.stylePath];
      this.expect.toHaveScreenshot.stylePath = stylePaths.map((stylePath) => import_path3.default.resolve(configDir, stylePath));
    }
    this.respectGitIgnore = takeFirst(projectConfig.respectGitIgnore, config.respectGitIgnore, !projectConfig.testDir && !config.testDir);
    this.workers = projectConfig.workers ? resolveWorkers(projectConfig.workers) : void 0;
    if (configCLIOverrides.debug && this.workers)
      this.workers = 1;
  }
};
function pathResolve(baseDir, relative) {
  if (!relative)
    return void 0;
  return import_path3.default.resolve(baseDir, relative);
}
function resolveReporters(reporters, rootDir) {
  return toReporters(reporters)?.map(([id, arg]) => {
    if (builtInReporters.includes(id))
      return [id, arg];
    return [require.resolve(id, { paths: [rootDir] }), arg];
  });
}
function resolveWorkers(workers) {
  if (typeof workers === "string") {
    if (workers.endsWith("%")) {
      const cpus = import_os2.default.cpus().length;
      return Math.max(1, Math.floor(cpus * (parseInt(workers, 10) / 100)));
    }
    const parsedWorkers = parseInt(workers, 10);
    if (isNaN(parsedWorkers))
      throw new Error(`Workers ${workers} must be a number or percentage.`);
    if (parsedWorkers < 1)
      throw new Error(`Workers must be a positive number, received ${parsedWorkers}.`);
    return parsedWorkers;
  }
  if (workers < 1)
    throw new Error(`Workers must be a positive number, received ${workers}.`);
  return workers;
}
function resolveProjectDependencies(projects) {
  const teardownSet = /* @__PURE__ */ new Set();
  for (const project of projects) {
    for (const dependencyName of project.project.dependencies) {
      const dependencies = projects.filter((p) => p.project.name === dependencyName);
      if (!dependencies.length)
        throw new Error(`Project '${project.project.name}' depends on unknown project '${dependencyName}'`);
      if (dependencies.length > 1)
        throw new Error(`Project dependencies should have unique names, reading ${dependencyName}`);
      project.deps.push(...dependencies);
    }
    if (project.project.teardown) {
      const teardowns = projects.filter((p) => p.project.name === project.project.teardown);
      if (!teardowns.length)
        throw new Error(`Project '${project.project.name}' has unknown teardown project '${project.project.teardown}'`);
      if (teardowns.length > 1)
        throw new Error(`Project teardowns should have unique names, reading ${project.project.teardown}`);
      const teardown = teardowns[0];
      project.teardown = teardown;
      teardownSet.add(teardown);
    }
  }
  for (const teardown of teardownSet) {
    if (teardown.deps.length)
      throw new Error(`Teardown project ${teardown.project.name} must not have dependencies`);
  }
  for (const project of projects) {
    for (const dep of project.deps) {
      if (teardownSet.has(dep))
        throw new Error(`Project ${project.project.name} must not depend on a teardown project ${dep.project.name}`);
    }
  }
}
function toReporters(reporters) {
  if (!reporters)
    return;
  if (typeof reporters === "string")
    return [[reporters]];
  return reporters;
}
var builtInReporters = ["list", "line", "dot", "json", "junit", "null", "github", "html", "blob"];
function resolveScript(id, rootDir) {
  if (!id)
    return void 0;
  const localPath = import_path3.default.resolve(rootDir, id);
  if (import_fs3.default.existsSync(localPath))
    return localPath;
  return require.resolve(id, { paths: [rootDir] });
}
var defaultGrep = /.*/;
var defaultReporter = process.env.CI ? "dot" : "list";
var configInternalSymbol = Symbol("configInternalSymbol");
function getProjectId(project) {
  return project.__projectId;
}

// packages/playwright/src/common/configLoader.ts
var configLoader_exports = {};
__export(configLoader_exports, {
  defineConfig: () => defineConfig,
  deserializeConfig: () => deserializeConfig,
  loadConfig: () => loadConfig,
  loadConfigFromFile: () => loadConfigFromFile,
  loadEmptyConfigForMergeReports: () => loadEmptyConfigForMergeReports,
  resolveConfigLocation: () => resolveConfigLocation
});
var import_fs7 = __toESM(require("fs"));
var import_path7 = __toESM(require("path"));

// packages/playwright/src/transform/transform.ts
var transform_exports = {};
__export(transform_exports, {
  incorporateCompilationCache: () => incorporateCompilationCache,
  requireOrImport: () => requireOrImport,
  resolveHook: () => resolveHook,
  setSingleTSConfig: () => setSingleTSConfig,
  setTransformConfig: () => setTransformConfig,
  setTransformData: () => setTransformData,
  shouldTransform: () => shouldTransform,
  startCollectingFileDeps: () => startCollectingFileDeps2,
  stopCollectingFileDeps: () => stopCollectingFileDeps2,
  transformHook: () => transformHook,
  wrapFunctionWithLocation: () => wrapFunctionWithLocation
});
var import_fs6 = __toESM(require("fs"));
var import_module2 = __toESM(require("module"));
var import_path6 = __toESM(require("path"));
var import_url2 = __toESM(require("url"));
var import_crypto = __toESM(require("crypto"));

// packages/playwright/src/transform/tsconfig-loader.ts
var import_path4 = __toESM(require("path"));
var import_fs4 = __toESM(require("fs"));
var json5 = require("playwright-core/lib/utilsBundle").json5;
function loadTsConfig(configPath) {
  try {
    const references = [];
    const config = innerLoadTsConfig(configPath, references);
    return [config, ...references];
  } catch (e) {
    throw new Error(`Failed to load tsconfig file at ${configPath}:
${e.message}`);
  }
}
function resolveConfigFile(baseConfigFile, referencedConfigFile) {
  if (!referencedConfigFile.endsWith(".json"))
    referencedConfigFile += ".json";
  const currentDir = import_path4.default.dirname(baseConfigFile);
  let resolvedConfigFile = import_path4.default.resolve(currentDir, referencedConfigFile);
  if (referencedConfigFile.includes("/") && referencedConfigFile.includes(".") && !import_fs4.default.existsSync(resolvedConfigFile))
    resolvedConfigFile = import_path4.default.join(currentDir, "node_modules", referencedConfigFile);
  return resolvedConfigFile;
}
function innerLoadTsConfig(configFilePath, references, visited = /* @__PURE__ */ new Map()) {
  if (visited.has(configFilePath))
    return visited.get(configFilePath);
  let result2 = {
    tsConfigPath: configFilePath
  };
  visited.set(configFilePath, result2);
  if (!import_fs4.default.existsSync(configFilePath))
    return result2;
  const configString = import_fs4.default.readFileSync(configFilePath, "utf-8");
  const cleanedJson = StripBom(configString);
  const parsedConfig = json5.parse(cleanedJson);
  const extendsArray = Array.isArray(parsedConfig.extends) ? parsedConfig.extends : parsedConfig.extends ? [parsedConfig.extends] : [];
  for (const extendedConfig of extendsArray) {
    const extendedConfigPath = resolveConfigFile(configFilePath, extendedConfig);
    const base = innerLoadTsConfig(extendedConfigPath, references, visited);
    Object.assign(result2, base, { tsConfigPath: configFilePath });
  }
  if (parsedConfig.compilerOptions?.allowJs !== void 0)
    result2.allowJs = parsedConfig.compilerOptions.allowJs;
  if (parsedConfig.compilerOptions?.paths !== void 0) {
    result2.paths = {
      mapping: parsedConfig.compilerOptions.paths,
      pathsBasePath: import_path4.default.dirname(configFilePath)
    };
  }
  if (parsedConfig.compilerOptions?.baseUrl !== void 0) {
    result2.absoluteBaseUrl = import_path4.default.resolve(import_path4.default.dirname(configFilePath), parsedConfig.compilerOptions.baseUrl);
  }
  for (const ref of parsedConfig.references || [])
    references.push(innerLoadTsConfig(resolveConfigFile(configFilePath, ref.path), references, visited));
  if (import_path4.default.basename(configFilePath) === "jsconfig.json" && result2.allowJs === void 0)
    result2.allowJs = true;
  return result2;
}
function StripBom(string) {
  if (typeof string !== "string") {
    throw new TypeError(`Expected a string, got ${typeof string}`);
  }
  if (string.charCodeAt(0) === 65279) {
    return string.slice(1);
  }
  return string;
}

// packages/playwright/src/transform/transform.ts
var import_package3 = require("../package");

// packages/playwright/src/transform/esmLoaderSync.ts
var import_fs5 = __toESM(require("fs"));
var import_url = __toESM(require("url"));
function resolve(specifier, context, nextResolve) {
  if (context.parentURL && context.parentURL.startsWith("file://")) {
    const filename = import_url.default.fileURLToPath(context.parentURL);
    const resolved = resolveHook(filename, specifier);
    if (resolved !== void 0) {
      specifier = new Set(context.conditions).has("import") ? import_url.default.pathToFileURL(resolved).toString() : resolved;
    }
  }
  const result2 = nextResolve(specifier, context);
  if (result2?.url && result2.url.startsWith("file://"))
    currentFileDepsCollector()?.add(import_url.default.fileURLToPath(result2.url));
  return result2;
}
var kSupportedFormats = /* @__PURE__ */ new Map([
  ["commonjs", "commonjs"],
  ["module", "module"],
  ["commonjs-typescript", "commonjs"],
  ["module-typescript", "module"],
  ["typescript", null],
  [null, null],
  [void 0, void 0]
]);
function load(moduleUrl, context, nextLoad) {
  if (!kSupportedFormats.has(context.format))
    return nextLoad(moduleUrl, context);
  if (!moduleUrl.startsWith("file://"))
    return nextLoad(moduleUrl, context);
  const filename = import_url.default.fileURLToPath(moduleUrl);
  if (!shouldTransform(filename))
    return nextLoad(moduleUrl, context);
  const isRequire = !new Set(context.conditions).has("import");
  const format = isRequire ? "commonjs" : kSupportedFormats.get(context.format) || (fileIsModule(filename) ? "module" : "commonjs");
  const code = import_fs5.default.readFileSync(filename, "utf-8");
  const transformed = transformHook(code, filename, format === "module" ? moduleUrl : void 0);
  return {
    format,
    source: transformed.code,
    shortCircuit: true
  };
}

// packages/playwright/src/transform/pirates.ts
var import_module = __toESM(require("module"));
var import_path5 = __toESM(require("path"));
function addHook(transformHook2, shouldTransform2, extensions) {
  const extensionsToOverwrite = extensions.filter((e) => e !== ".cjs");
  const allSupportedExtensions = new Set(extensions);
  const loaders = import_module.default._extensions;
  const jsLoader = loaders[".js"];
  for (const extension of extensionsToOverwrite) {
    let newLoader2 = function(mod, filename, ...loaderArgs) {
      if (allSupportedExtensions.has(import_path5.default.extname(filename)) && shouldTransform2(filename)) {
        let newCompile2 = function(code, file2, ...ignoredArgs) {
          mod._compile = oldCompile;
          return oldCompile.call(this, transformHook2(code, filename), file2);
        };
        var newCompile = newCompile2;
        const oldCompile = mod._compile;
        mod._compile = newCompile2;
      }
      originalLoader.call(this, mod, filename, ...loaderArgs);
    };
    var newLoader = newLoader2;
    const originalLoader = loaders[extension] || jsLoader;
    loaders[extension] = newLoader2;
  }
}

// packages/playwright/src/transform/portTransport.ts
var PortTransport = class {
  constructor(port, handler) {
    this._lastId = 0;
    this._callbacks = /* @__PURE__ */ new Map();
    this._port = port;
    port.addEventListener("message", async (event) => {
      const message = event.data;
      const { id, ackId, method, params, result: result2 } = message;
      if (ackId) {
        const callback = this._callbacks.get(ackId);
        this._callbacks.delete(ackId);
        this._resetRef();
        callback?.(result2);
        return;
      }
      const handlerResult = await handler(method, params);
      if (id)
        this._port.postMessage({ ackId: id, result: handlerResult });
    });
    this._resetRef();
  }
  post(method, params) {
    this._port.postMessage({ method, params });
  }
  async send(method, params) {
    return await new Promise((f) => {
      const id = ++this._lastId;
      this._callbacks.set(id, f);
      this._resetRef();
      this._port.postMessage({ id, method, params });
    });
  }
  _resetRef() {
    if (this._callbacks.size) {
      this._port.ref();
    } else {
      this._port.unref();
    }
  }
};

// packages/playwright/src/transform/transform.ts
var sourceMapSupport2 = require("playwright-core/lib/utilsBundle").sourceMapSupport;
var version = import_package3.packageJSON.version;
var cachedTSConfigs = /* @__PURE__ */ new Map();
var _transformConfig = {
  babelPlugins: [],
  external: []
};
var _externalMatcher = () => false;
async function setTransformConfig(config) {
  _transformConfig = config;
  _externalMatcher = createFileMatcher(_transformConfig.external);
  if (loaderChannel)
    await loaderChannel.send("setTransformConfig", { config });
}
var _singleTSConfigPath;
var _singleTSConfig;
async function setSingleTSConfig(value) {
  _singleTSConfigPath = value;
  if (loaderChannel)
    await loaderChannel.send("setSingleTSConfig", { tsconfig: value });
}
function validateTsConfig(tsconfig) {
  const pathsBase = tsconfig.absoluteBaseUrl ?? tsconfig.paths?.pathsBasePath;
  const pathsFallback = tsconfig.absoluteBaseUrl ? [{ key: "*", values: ["*"] }] : [];
  return {
    allowJs: !!tsconfig.allowJs,
    pathsBase,
    paths: Object.entries(tsconfig.paths?.mapping || {}).map(([key, values]) => ({ key, values })).concat(pathsFallback)
  };
}
function loadAndValidateTsconfigsForFile(file2) {
  if (_singleTSConfigPath && !_singleTSConfig)
    _singleTSConfig = loadTsConfig(_singleTSConfigPath).map(validateTsConfig);
  if (_singleTSConfig)
    return _singleTSConfig;
  return loadAndValidateTsconfigsForFolder(import_path6.default.dirname(file2));
}
function loadAndValidateTsconfigsForFolder(folder) {
  const foldersWithConfig = [];
  let currentFolder = import_path6.default.resolve(folder);
  let result2;
  while (true) {
    const cached = cachedTSConfigs.get(currentFolder);
    if (cached) {
      result2 = cached;
      break;
    }
    foldersWithConfig.push(currentFolder);
    for (const name of ["tsconfig.json", "jsconfig.json"]) {
      const configPath = import_path6.default.join(currentFolder, name);
      if (import_fs6.default.existsSync(configPath)) {
        const loaded = loadTsConfig(configPath);
        result2 = loaded.map(validateTsConfig);
        break;
      }
    }
    if (result2)
      break;
    const parentFolder = import_path6.default.resolve(currentFolder, "../");
    if (currentFolder === parentFolder)
      break;
    currentFolder = parentFolder;
  }
  result2 = result2 || [];
  for (const folder2 of foldersWithConfig)
    cachedTSConfigs.set(folder2, result2);
  return result2;
}
var pathSeparator = process.platform === "win32" ? ";" : ":";
var builtins = new Set(import_module2.default.builtinModules);
function resolveHook(filename, specifier) {
  if (specifier.startsWith("node:") || builtins.has(specifier))
    return;
  if (!shouldTransform(filename))
    return;
  if (isRelativeSpecifier(specifier))
    return resolveImportSpecifierAfterMapping(import_path6.default.resolve(import_path6.default.dirname(filename), specifier), false);
  const isTypeScript = filename.endsWith(".ts") || filename.endsWith(".tsx");
  const tsconfigs = loadAndValidateTsconfigsForFile(filename);
  for (const tsconfig of tsconfigs) {
    if (!isTypeScript && !tsconfig.allowJs)
      continue;
    let longestPrefixLength = -1;
    let pathMatchedByLongestPrefix;
    for (const { key, values } of tsconfig.paths) {
      let matchedPartOfSpecifier = specifier;
      const [keyPrefix, keySuffix] = key.split("*");
      if (key.includes("*")) {
        if (keyPrefix) {
          if (!specifier.startsWith(keyPrefix))
            continue;
          matchedPartOfSpecifier = matchedPartOfSpecifier.substring(keyPrefix.length, matchedPartOfSpecifier.length);
        }
        if (keySuffix) {
          if (!specifier.endsWith(keySuffix))
            continue;
          matchedPartOfSpecifier = matchedPartOfSpecifier.substring(0, matchedPartOfSpecifier.length - keySuffix.length);
        }
      } else {
        if (specifier !== key)
          continue;
        matchedPartOfSpecifier = specifier;
      }
      if (keyPrefix.length <= longestPrefixLength)
        continue;
      for (const value of values) {
        let candidate = value;
        if (value.includes("*"))
          candidate = candidate.replace("*", matchedPartOfSpecifier);
        candidate = import_path6.default.resolve(tsconfig.pathsBase, candidate);
        const existing = resolveImportSpecifierAfterMapping(candidate, true);
        if (existing) {
          longestPrefixLength = keyPrefix.length;
          pathMatchedByLongestPrefix = existing;
        }
      }
    }
    if (pathMatchedByLongestPrefix)
      return pathMatchedByLongestPrefix;
  }
  if (import_path6.default.isAbsolute(specifier)) {
    return resolveImportSpecifierAfterMapping(specifier, false);
  }
}
function shouldTransform(filename) {
  if (_externalMatcher(filename))
    return false;
  return !belongsToNodeModules(filename);
}
var transformData;
function setTransformData(pluginName, value) {
  transformData.set(pluginName, value);
}
function transformHook(originalCode, filename, moduleUrl) {
  const hasPreprocessor = process.env.PW_TEST_SOURCE_TRANSFORM && process.env.PW_TEST_SOURCE_TRANSFORM_SCOPE && process.env.PW_TEST_SOURCE_TRANSFORM_SCOPE.split(pathSeparator).some((f) => filename.startsWith(f));
  const pluginsPrologue = _transformConfig.babelPlugins;
  const pluginsEpilogue = hasPreprocessor ? [[process.env.PW_TEST_SOURCE_TRANSFORM]] : [];
  const hash = calculateHash(originalCode, filename, !!moduleUrl, pluginsPrologue, pluginsEpilogue);
  const { cachedCode, addToCache, serializedCache } = getFromCompilationCache(filename, hash, moduleUrl);
  if (cachedCode !== void 0)
    return { code: cachedCode, serializedCache };
  process.env.BROWSERSLIST_IGNORE_OLD_DATA = "true";
  const { babelTransform } = require((0, import_package3.libPath)("transform", "babelBundle"));
  transformData = /* @__PURE__ */ new Map();
  const setTransformDataForPlugin = (key, value) => transformData.set(key, value);
  const wrappedPrologue = pluginsPrologue.map(([name, opts]) => [
    name,
    { ...opts || {}, setTransformData: setTransformDataForPlugin }
  ]);
  const babelResult = babelTransform(originalCode, filename, !!moduleUrl, wrappedPrologue, pluginsEpilogue, _transformConfig.jsxImportSource);
  if (!babelResult?.code)
    return { code: originalCode, serializedCache };
  const { code, map } = babelResult;
  const added = addToCache(code, map, transformData);
  return { code, serializedCache: added.serializedCache };
}
function calculateHash(content, filePath, isModule2, pluginsPrologue, pluginsEpilogue) {
  const hash = import_crypto.default.createHash("sha1").update(isModule2 ? "esm" : "no_esm").update(content).update(filePath).update(version).update(pluginsPrologue.map((p) => p[0]).join(",")).update(pluginsEpilogue.map((p) => p[0]).join(",")).digest("hex");
  return hash;
}
async function requireOrImport(file) {
  installTransformIfNeeded();
  const isModule = fileIsModule(file);
  if (isModule) {
    const fileName = import_url2.default.pathToFileURL(file);
    const esmImport = () => eval(`import(${JSON.stringify(fileName)})`);
    if (loaderChannel) {
      await eval(`import(${JSON.stringify(fileName + ".esm.preflight")})`).catch((error) => debugTest("Failed to load preflight for " + file + ", source maps may be missing for errors thrown during loading.", error)).finally(nextTask);
    }
    return await esmImport().finally(nextTask);
  }
  const result = require(file);
  const depsCollector = currentFileDepsCollector();
  if (depsCollector) {
    const module2 = require.cache[file];
    if (module2) {
      const cjsDeps = /* @__PURE__ */ new Set();
      collectCJSDependencies(module2, cjsDeps);
      for (const dep of cjsDeps)
        depsCollector.add(dep);
    }
  }
  return result;
}
var transformInstalled = false;
function installTransformIfNeeded() {
  if (transformInstalled)
    return;
  transformInstalled = true;
  registerESMLoader();
  installSourceMapSupport();
  if (loaderChannel) {
    installCJSHooks();
    return;
  }
  const extensions = import_module2.default._extensions;
  for (const ext of [".ts", ".cts", ".tsx", ".jsx"])
    extensions[ext] = extensions[".js"];
}
function installCJSHooks() {
  const originalResolveFilename = import_module2.default._resolveFilename;
  function resolveFilename(specifier, parent, ...rest) {
    if (parent) {
      const resolved = resolveHook(parent.filename, specifier);
      if (resolved !== void 0)
        specifier = resolved;
    }
    return originalResolveFilename.call(this, specifier, parent, ...rest);
  }
  import_module2.default._resolveFilename = resolveFilename;
  addHook((code, filename) => {
    return transformHook(code, filename).code;
  }, shouldTransform, [".ts", ".tsx", ".js", ".jsx", ".mjs", ".mts", ".cjs", ".cts"]);
}
var collectCJSDependencies = (module2, dependencies) => {
  module2.children.forEach((child) => {
    if (!belongsToNodeModules(child.filename) && !dependencies.has(child.filename)) {
      dependencies.add(child.filename);
      collectCJSDependencies(child, dependencies);
    }
  });
};
function wrapFunctionWithLocation(func) {
  return (...args) => {
    const oldPrepareStackTrace = Error.prepareStackTrace;
    Error.prepareStackTrace = (error, stackFrames) => {
      const frame = sourceMapSupport2.wrapCallSite(stackFrames[1]);
      const fileName2 = frame.getFileName();
      const file2 = fileName2 && fileName2.startsWith("file://") ? import_url2.default.fileURLToPath(fileName2) : fileName2;
      return {
        file: file2,
        line: frame.getLineNumber(),
        column: frame.getColumnNumber()
      };
    };
    const oldStackTraceLimit = Error.stackTraceLimit;
    Error.stackTraceLimit = 2;
    const obj = {};
    Error.captureStackTrace(obj);
    const location = obj.stack;
    Error.stackTraceLimit = oldStackTraceLimit;
    Error.prepareStackTrace = oldPrepareStackTrace;
    return func(location, ...args);
  };
}
function isRelativeSpecifier(specifier) {
  return specifier === "." || specifier === ".." || specifier.startsWith("./") || specifier.startsWith("../");
}
async function nextTask() {
  return new Promise((resolve2) => setTimeout(resolve2, 0));
}
var loaderChannel;
function registerESMLoader() {
  if (process.env.PW_DISABLE_TS_ESM)
    return;
  if ("Bun" in globalThis)
    return;
  const nodeModule = require("node:module");
  if (nodeModule.registerHooks && !process.env.PLAYWRIGHT_FORCE_ASYNC_LOADER) {
    nodeModule.registerHooks({ resolve, load });
    return;
  }
  if (!nodeModule.register)
    return;
  const { port1, port2 } = new MessageChannel();
  nodeModule.register(import_url2.default.pathToFileURL(require.resolve("../transform/esmLoader.js")), {
    data: { port: port2 },
    transferList: [port2]
  });
  loaderChannel = new PortTransport(port1, async (method, params) => {
    if (method === "pushToCompilationCache")
      addToCompilationCache(params.cache);
  });
  void loaderChannel.send("setSingleTSConfig", { tsconfig: _singleTSConfigPath });
  void loaderChannel.send("setTransformConfig", { config: _transformConfig });
  void loaderChannel.send("addToCompilationCache", { cache: serializeCompilationCache() });
}
async function startCollectingFileDeps2() {
  startCollectingFileDeps();
  if (loaderChannel)
    await loaderChannel.send("startCollectingFileDeps", {});
}
async function stopCollectingFileDeps2(file2) {
  stopCollectingFileDeps(file2);
  if (loaderChannel)
    await loaderChannel.send("stopCollectingFileDeps", { file: file2 });
}
async function incorporateCompilationCache() {
  if (!loaderChannel)
    return;
  const result2 = await loaderChannel.send("getCompilationCache", {});
  addToCompilationCache(result2.cache);
}

// packages/playwright/src/common/configLoader.ts
var { isRegExp: isRegExp2 } = require("playwright-core/lib/coreBundle").iso;
var kDefineConfigWasUsed = Symbol("defineConfigWasUsed");
var defineConfig = (...configs) => {
  let result2 = configs[0];
  for (let i = 1; i < configs.length; ++i) {
    const config = configs[i];
    const prevProjects = result2.projects;
    result2 = {
      ...result2,
      ...config,
      expect: {
        ...result2.expect,
        ...config.expect
      },
      use: {
        ...result2.use,
        ...config.use
      },
      build: {
        ...result2.build,
        ...config.build
      },
      webServer: [
        ...Array.isArray(result2.webServer) ? result2.webServer : result2.webServer ? [result2.webServer] : [],
        ...Array.isArray(config.webServer) ? config.webServer : config.webServer ? [config.webServer] : []
      ]
    };
    if (!result2.projects && !config.projects)
      continue;
    const projectOverrides = /* @__PURE__ */ new Map();
    for (const project of config.projects || [])
      projectOverrides.set(project.name, project);
    const projects = [];
    for (const project of prevProjects || []) {
      const projectOverride = projectOverrides.get(project.name);
      if (projectOverride) {
        projects.push({
          ...project,
          ...projectOverride,
          use: {
            ...project.use,
            ...projectOverride.use
          }
        });
        projectOverrides.delete(project.name);
      } else {
        projects.push(project);
      }
    }
    projects.push(...projectOverrides.values());
    result2.projects = projects;
  }
  result2[kDefineConfigWasUsed] = true;
  return result2;
};
async function deserializeConfig(data) {
  if (data.compilationCache)
    addToCompilationCache(data.compilationCache);
  return await loadConfig(data.location, data.configCLIOverrides, void 0, data.metadata ? JSON.parse(data.metadata) : void 0);
}
async function loadUserConfig(location) {
  let object = location.resolvedConfigFile ? await requireOrImport(location.resolvedConfigFile) : {};
  if (object && typeof object === "object" && "default" in object)
    object = object["default"];
  return object;
}
async function loadConfig(location, overrides, ignoreProjectDependencies = false, metadata) {
  await setSingleTSConfig(overrides?.tsconfig);
  const userConfig = await loadUserConfig(location);
  validateConfig(location.resolvedConfigFile || "<default config>", userConfig);
  const fullConfig = new FullConfigInternal(location, userConfig, overrides || {}, metadata);
  fullConfig.defineConfigWasUsed = !!userConfig[kDefineConfigWasUsed];
  if (ignoreProjectDependencies) {
    for (const project of fullConfig.projects) {
      project.deps = [];
      project.teardown = void 0;
    }
  }
  const babelPlugins = userConfig["@playwright/test"]?.babelPlugins || [];
  const external = userConfig.build?.external || [];
  const jsxImportSource = import_path7.default.dirname(require.resolve("playwright"));
  await setTransformConfig({ babelPlugins, external, jsxImportSource });
  if (!overrides?.tsconfig)
    await setSingleTSConfig(fullConfig?.singleTSConfigPath);
  return fullConfig;
}
function validateConfig(file2, config) {
  if (typeof config !== "object" || !config)
    throw errorWithFile(file2, `Configuration file must export a single object`);
  validateProject(file2, config, "config");
  if ("forbidOnly" in config && config.forbidOnly !== void 0) {
    if (typeof config.forbidOnly !== "boolean")
      throw errorWithFile(file2, `config.forbidOnly must be a boolean`);
  }
  if ("globalSetup" in config && config.globalSetup !== void 0) {
    if (Array.isArray(config.globalSetup)) {
      config.globalSetup.forEach((item, index) => {
        if (typeof item !== "string")
          throw errorWithFile(file2, `config.globalSetup[${index}] must be a string`);
      });
    } else if (typeof config.globalSetup !== "string") {
      throw errorWithFile(file2, `config.globalSetup must be a string`);
    }
  }
  if ("globalTeardown" in config && config.globalTeardown !== void 0) {
    if (Array.isArray(config.globalTeardown)) {
      config.globalTeardown.forEach((item, index) => {
        if (typeof item !== "string")
          throw errorWithFile(file2, `config.globalTeardown[${index}] must be a string`);
      });
    } else if (typeof config.globalTeardown !== "string") {
      throw errorWithFile(file2, `config.globalTeardown must be a string`);
    }
  }
  if ("globalTimeout" in config && config.globalTimeout !== void 0) {
    if (typeof config.globalTimeout !== "number" || config.globalTimeout < 0)
      throw errorWithFile(file2, `config.globalTimeout must be a non-negative number`);
  }
  if ("grep" in config && config.grep !== void 0) {
    if (Array.isArray(config.grep)) {
      config.grep.forEach((item, index) => {
        if (!isRegExp2(item))
          throw errorWithFile(file2, `config.grep[${index}] must be a RegExp`);
      });
    } else if (!isRegExp2(config.grep)) {
      throw errorWithFile(file2, `config.grep must be a RegExp`);
    }
  }
  if ("grepInvert" in config && config.grepInvert !== void 0) {
    if (Array.isArray(config.grepInvert)) {
      config.grepInvert.forEach((item, index) => {
        if (!isRegExp2(item))
          throw errorWithFile(file2, `config.grepInvert[${index}] must be a RegExp`);
      });
    } else if (!isRegExp2(config.grepInvert)) {
      throw errorWithFile(file2, `config.grepInvert must be a RegExp`);
    }
  }
  if ("maxFailures" in config && config.maxFailures !== void 0) {
    if (typeof config.maxFailures !== "number" || config.maxFailures < 0)
      throw errorWithFile(file2, `config.maxFailures must be a non-negative number`);
  }
  if ("preserveOutput" in config && config.preserveOutput !== void 0) {
    if (typeof config.preserveOutput !== "string" || !["always", "never", "failures-only"].includes(config.preserveOutput))
      throw errorWithFile(file2, `config.preserveOutput must be one of "always", "never" or "failures-only"`);
  }
  if ("projects" in config && config.projects !== void 0) {
    if (!Array.isArray(config.projects))
      throw errorWithFile(file2, `config.projects must be an array`);
    config.projects.forEach((project, index) => {
      validateProject(file2, project, `config.projects[${index}]`);
    });
  }
  if ("quiet" in config && config.quiet !== void 0) {
    if (typeof config.quiet !== "boolean")
      throw errorWithFile(file2, `config.quiet must be a boolean`);
  }
  if ("reporter" in config && config.reporter !== void 0) {
    if (Array.isArray(config.reporter)) {
      config.reporter.forEach((item, index) => {
        if (!Array.isArray(item) || item.length <= 0 || item.length > 2 || typeof item[0] !== "string")
          throw errorWithFile(file2, `config.reporter[${index}] must be a tuple [name, optionalArgument]`);
      });
    } else if (typeof config.reporter !== "string") {
      throw errorWithFile(file2, `config.reporter must be a string`);
    }
  }
  if ("reportSlowTests" in config && config.reportSlowTests !== void 0 && config.reportSlowTests !== null) {
    if (!config.reportSlowTests || typeof config.reportSlowTests !== "object")
      throw errorWithFile(file2, `config.reportSlowTests must be an object`);
    if (!("max" in config.reportSlowTests) || typeof config.reportSlowTests.max !== "number" || config.reportSlowTests.max < 0)
      throw errorWithFile(file2, `config.reportSlowTests.max must be a non-negative number`);
    if (!("threshold" in config.reportSlowTests) || typeof config.reportSlowTests.threshold !== "number" || config.reportSlowTests.threshold < 0)
      throw errorWithFile(file2, `config.reportSlowTests.threshold must be a non-negative number`);
  }
  if ("shard" in config && config.shard !== void 0 && config.shard !== null) {
    if (!config.shard || typeof config.shard !== "object")
      throw errorWithFile(file2, `config.shard must be an object`);
    if (!("total" in config.shard) || typeof config.shard.total !== "number" || config.shard.total < 1)
      throw errorWithFile(file2, `config.shard.total must be a positive number`);
    if (!("current" in config.shard) || typeof config.shard.current !== "number" || config.shard.current < 1 || config.shard.current > config.shard.total)
      throw errorWithFile(file2, `config.shard.current must be a positive number, not greater than config.shard.total`);
  }
  if ("updateSnapshots" in config && config.updateSnapshots !== void 0) {
    if (typeof config.updateSnapshots !== "string" || !["all", "changed", "missing", "none"].includes(config.updateSnapshots))
      throw errorWithFile(file2, `config.updateSnapshots must be one of "all", "changed", "missing" or "none"`);
  }
  if ("tsconfig" in config && config.tsconfig !== void 0) {
    if (typeof config.tsconfig !== "string")
      throw errorWithFile(file2, `config.tsconfig must be a string`);
    if (!import_fs7.default.existsSync(import_path7.default.resolve(file2, "..", config.tsconfig)))
      throw errorWithFile(file2, `config.tsconfig does not exist`);
  }
}
function validateProject(file2, project, title) {
  if (typeof project !== "object" || !project)
    throw errorWithFile(file2, `${title} must be an object`);
  if ("name" in project && project.name !== void 0) {
    if (typeof project.name !== "string")
      throw errorWithFile(file2, `${title}.name must be a string`);
  }
  if ("outputDir" in project && project.outputDir !== void 0) {
    if (typeof project.outputDir !== "string")
      throw errorWithFile(file2, `${title}.outputDir must be a string`);
  }
  if ("repeatEach" in project && project.repeatEach !== void 0) {
    if (typeof project.repeatEach !== "number" || project.repeatEach < 0)
      throw errorWithFile(file2, `${title}.repeatEach must be a non-negative number`);
  }
  if ("retries" in project && project.retries !== void 0) {
    if (typeof project.retries !== "number" || project.retries < 0)
      throw errorWithFile(file2, `${title}.retries must be a non-negative number`);
  }
  if ("testDir" in project && project.testDir !== void 0) {
    if (typeof project.testDir !== "string")
      throw errorWithFile(file2, `${title}.testDir must be a string`);
  }
  for (const prop of ["testIgnore", "testMatch"]) {
    if (prop in project && project[prop] !== void 0) {
      const value = project[prop];
      if (Array.isArray(value)) {
        value.forEach((item, index) => {
          if (typeof item !== "string" && !isRegExp2(item))
            throw errorWithFile(file2, `${title}.${prop}[${index}] must be a string or a RegExp`);
        });
      } else if (typeof value !== "string" && !isRegExp2(value)) {
        throw errorWithFile(file2, `${title}.${prop} must be a string or a RegExp`);
      }
    }
  }
  if ("timeout" in project && project.timeout !== void 0) {
    if (typeof project.timeout !== "number" || project.timeout < 0)
      throw errorWithFile(file2, `${title}.timeout must be a non-negative number`);
  }
  if ("use" in project && project.use !== void 0) {
    if (!project.use || typeof project.use !== "object")
      throw errorWithFile(file2, `${title}.use must be an object`);
  }
  if ("ignoreSnapshots" in project && project.ignoreSnapshots !== void 0) {
    if (typeof project.ignoreSnapshots !== "boolean")
      throw errorWithFile(file2, `${title}.ignoreSnapshots must be a boolean`);
  }
  if ("workers" in project && project.workers !== void 0) {
    if (typeof project.workers === "number" && project.workers <= 0)
      throw errorWithFile(file2, `${title}.workers must be a positive number`);
    else if (typeof project.workers === "string" && !project.workers.endsWith("%"))
      throw errorWithFile(file2, `${title}.workers must be a number or percentage`);
  }
}
function resolveConfigLocation(configFile) {
  const configFileOrDirectory = configFile ? import_path7.default.resolve(process.cwd(), configFile) : process.cwd();
  const resolvedConfigFile = resolveConfigFile2(configFileOrDirectory);
  return {
    resolvedConfigFile,
    configDir: resolvedConfigFile ? import_path7.default.dirname(resolvedConfigFile) : configFileOrDirectory
  };
}
function resolveConfigFile2(configFileOrDirectory) {
  const resolveConfig = (configFile) => {
    if (import_fs7.default.existsSync(configFile))
      return configFile;
  };
  const resolveConfigFileFromDirectory = (directory) => {
    for (const ext of [".ts", ".js", ".mts", ".mjs", ".cts", ".cjs"]) {
      const configFile = resolveConfig(import_path7.default.resolve(directory, "playwright.config" + ext));
      if (configFile)
        return configFile;
    }
  };
  if (!import_fs7.default.existsSync(configFileOrDirectory))
    throw new Error(`${configFileOrDirectory} does not exist`);
  if (import_fs7.default.statSync(configFileOrDirectory).isDirectory()) {
    const configFile = resolveConfigFileFromDirectory(configFileOrDirectory);
    if (configFile)
      return configFile;
    return void 0;
  }
  return configFileOrDirectory;
}
async function loadConfigFromFile(configFile, overrides, ignoreDeps) {
  return await loadConfig(resolveConfigLocation(configFile), overrides, ignoreDeps);
}
async function loadEmptyConfigForMergeReports() {
  return await loadConfig({ configDir: process.cwd() });
}

// packages/playwright/src/common/fixtures.ts
var fixtures_exports = {};
__export(fixtures_exports, {
  FixturePool: () => FixturePool,
  fixtureParameterNames: () => fixtureParameterNames,
  formatPotentiallyInternalLocation: () => formatPotentiallyInternalLocation,
  inheritFixtureNames: () => inheritFixtureNames
});
var import_crypto2 = __toESM(require("crypto"));
var kScopeOrder = ["test", "worker"];
function isFixtureTuple(value) {
  return Array.isArray(value) && typeof value[1] === "object";
}
function isFixtureOption(value) {
  return isFixtureTuple(value) && !!value[1].option;
}
var FixturePool = class {
  constructor(fixturesList, onLoadError, parentPool, disallowWorkerFixtures, optionOverrides) {
    this._registrations = new Map(parentPool ? parentPool._registrations : []);
    this._onLoadError = onLoadError;
    const allOverrides = optionOverrides?.overrides ?? {};
    const overrideKeys = new Set(Object.keys(allOverrides));
    for (const list of fixturesList) {
      this._appendFixtureList(list, !!disallowWorkerFixtures, false);
      const selectedOverrides = {};
      for (const [key, value] of Object.entries(list.fixtures)) {
        if (isFixtureOption(value) && overrideKeys.has(key))
          selectedOverrides[key] = [allOverrides[key], value[1]];
      }
      if (Object.entries(selectedOverrides).length)
        this._appendFixtureList({ fixtures: selectedOverrides, location: optionOverrides.location }, !!disallowWorkerFixtures, true);
    }
    if (optionOverrides) {
      for (const key of overrideKeys) {
        const registration = this._registrations.get(key);
        if (registration && !registration.option)
          this._addLoadError(`Fixture "${key}" cannot be overridden in the configuration "use" section. Only fixtures registered with { option: true } can be set in the config.`, optionOverrides.location);
      }
    }
    this.digest = this.validate();
  }
  _appendFixtureList(list, disallowWorkerFixtures, isOptionsOverride) {
    const { fixtures, location } = list;
    for (const entry of Object.entries(fixtures)) {
      const name = entry[0];
      let value = entry[1];
      let options;
      if (isFixtureTuple(value)) {
        options = {
          auto: value[1].auto ?? false,
          scope: value[1].scope || "test",
          option: !!value[1].option,
          timeout: value[1].timeout,
          customTitle: value[1].title,
          box: value[1].box
        };
        value = value[0];
      }
      let fn = value;
      const previous = this._registrations.get(name);
      if (previous && options) {
        if (previous.scope !== options.scope) {
          this._addLoadError(`Fixture "${name}" has already been registered as a { scope: '${previous.scope}' } fixture defined in ${formatLocation(previous.location)}.`, location);
          continue;
        }
        if (previous.auto !== options.auto) {
          this._addLoadError(`Fixture "${name}" has already been registered as a { auto: '${previous.scope}' } fixture defined in ${formatLocation(previous.location)}.`, location);
          continue;
        }
      } else if (previous) {
        options = { auto: previous.auto, scope: previous.scope, option: previous.option, timeout: previous.timeout, customTitle: previous.customTitle };
      } else if (!options) {
        options = { auto: false, scope: "test", option: false, timeout: void 0 };
      }
      if (!kScopeOrder.includes(options.scope)) {
        this._addLoadError(`Fixture "${name}" has unknown { scope: '${options.scope}' }.`, location);
        continue;
      }
      if (options.scope === "worker" && disallowWorkerFixtures) {
        this._addLoadError(`Cannot use({ ${name} }) in a describe group, because it forces a new worker.
Make it top-level in the test file or put in the configuration file.`, location);
        continue;
      }
      if (fn === void 0 && options.option && previous) {
        let original = previous;
        while (!original.optionOverride && original.super)
          original = original.super;
        fn = original.fn;
      }
      const deps = fixtureParameterNames(fn, location, (e) => this._onLoadError(e));
      const registration = { id: "", name, location, scope: options.scope, fn, auto: options.auto, option: options.option, timeout: options.timeout, customTitle: options.customTitle, box: options.box, deps, super: previous, optionOverride: isOptionsOverride };
      registrationId(registration);
      this._registrations.set(name, registration);
    }
  }
  validate() {
    const markers = /* @__PURE__ */ new Map();
    const stack = [];
    let hasDependencyErrors = false;
    const addDependencyError = (message, location) => {
      hasDependencyErrors = true;
      this._addLoadError(message, location);
    };
    const visit = (registration, boxedOnly) => {
      markers.set(registration, "visiting");
      stack.push(registration);
      for (const name of registration.deps) {
        const dep = this.resolve(name, registration);
        if (!dep) {
          if (name === registration.name)
            addDependencyError(`Fixture "${registration.name}" references itself, but does not have a base implementation.`, registration.location);
          else
            addDependencyError(`Fixture "${registration.name}" has unknown parameter "${name}".`, registration.location);
          continue;
        }
        if (kScopeOrder.indexOf(registration.scope) > kScopeOrder.indexOf(dep.scope)) {
          addDependencyError(`${registration.scope} fixture "${registration.name}" cannot depend on a ${dep.scope} fixture "${name}" defined in ${formatPotentiallyInternalLocation(dep.location)}.`, registration.location);
          continue;
        }
        if (!markers.has(dep)) {
          visit(dep, boxedOnly);
        } else if (markers.get(dep) === "visiting") {
          const index = stack.indexOf(dep);
          const allRegs = stack.slice(index, stack.length);
          const filteredRegs = allRegs.filter((r) => !r.box);
          const regs = boxedOnly ? filteredRegs : allRegs;
          const names2 = regs.map((r) => `"${r.name}"`);
          addDependencyError(`Fixtures ${names2.join(" -> ")} -> "${dep.name}" form a dependency cycle: ${regs.map((r) => formatPotentiallyInternalLocation(r.location)).join(" -> ")} -> ${formatPotentiallyInternalLocation(dep.location)}`, dep.location);
          continue;
        }
      }
      markers.set(registration, "visited");
      stack.pop();
    };
    const names = Array.from(this._registrations.keys()).sort();
    for (const name of names) {
      const registration = this._registrations.get(name);
      if (!registration.box)
        visit(registration, true);
    }
    if (!hasDependencyErrors) {
      for (const name of names) {
        const registration = this._registrations.get(name);
        if (registration.box)
          visit(registration, false);
      }
    }
    const hash = import_crypto2.default.createHash("sha1");
    for (const name of names) {
      const registration = this._registrations.get(name);
      if (registration.scope === "worker")
        hash.update(registration.id + ";");
    }
    return hash.digest("hex");
  }
  validateFunction(fn, prefix, location) {
    for (const name of fixtureParameterNames(fn, location, (e) => this._onLoadError(e))) {
      const registration = this._registrations.get(name);
      if (!registration)
        this._addLoadError(`${prefix} has unknown parameter "${name}".`, location);
    }
  }
  resolve(name, forFixture) {
    if (name === forFixture?.name)
      return forFixture.super;
    return this._registrations.get(name);
  }
  autoFixtures() {
    return [...this._registrations.values()].filter((r) => r.auto !== false);
  }
  _addLoadError(message, location) {
    this._onLoadError({ message, location });
  }
};
var signatureSymbol = Symbol("signature");
function formatPotentiallyInternalLocation(location) {
  const isUserFixture = location && filterStackFile(location.file);
  return isUserFixture ? formatLocation(location) : "<builtin>";
}
function fixtureParameterNames(fn, location, onError) {
  if (typeof fn !== "function")
    return [];
  if (!fn[signatureSymbol])
    fn[signatureSymbol] = innerFixtureParameterNames(fn, location, onError);
  return fn[signatureSymbol];
}
function inheritFixtureNames(from, to) {
  to[signatureSymbol] = from[signatureSymbol];
}
function innerFixtureParameterNames(fn, location, onError) {
  const text = filterOutComments(fn.toString());
  const match = text.match(/(?:async)?(?:\s+function)?[^(]*\(([^)]*)/);
  if (!match)
    return [];
  const trimmedParams = match[1].trim();
  if (!trimmedParams)
    return [];
  const [firstParam] = splitByComma(trimmedParams);
  if (firstParam[0] !== "{" || firstParam[firstParam.length - 1] !== "}") {
    onError({ message: "First argument must use the object destructuring pattern: " + firstParam, location });
    return [];
  }
  const props = splitByComma(firstParam.substring(1, firstParam.length - 1)).map((prop) => {
    const colon = prop.indexOf(":");
    return colon === -1 ? prop.trim() : prop.substring(0, colon).trim();
  });
  const restProperty = props.find((prop) => prop.startsWith("..."));
  if (restProperty) {
    onError({ message: `Rest property "${restProperty}" is not supported. List all used fixtures explicitly, separated by comma.`, location });
    return [];
  }
  return props;
}
function filterOutComments(s) {
  const result2 = [];
  let commentState = "none";
  for (let i = 0; i < s.length; ++i) {
    if (commentState === "singleline") {
      if (s[i] === "\n")
        commentState = "none";
    } else if (commentState === "multiline") {
      if (s[i - 1] === "*" && s[i] === "/")
        commentState = "none";
    } else if (commentState === "none") {
      if (s[i] === "/" && s[i + 1] === "/") {
        commentState = "singleline";
      } else if (s[i] === "/" && s[i + 1] === "*") {
        commentState = "multiline";
        i += 2;
      } else {
        result2.push(s[i]);
      }
    }
  }
  return result2.join("");
}
function splitByComma(s) {
  const result2 = [];
  const stack = [];
  let start = 0;
  for (let i = 0; i < s.length; i++) {
    if (s[i] === "{" || s[i] === "[") {
      stack.push(s[i] === "{" ? "}" : "]");
    } else if (s[i] === stack[stack.length - 1]) {
      stack.pop();
    } else if (!stack.length && s[i] === ",") {
      const token = s.substring(start, i).trim();
      if (token)
        result2.push(token);
      start = i + 1;
    }
  }
  const lastToken = s.substring(start).trim();
  if (lastToken)
    result2.push(lastToken);
  return result2;
}
var registrationIdMap = /* @__PURE__ */ new Map();
var lastId = 0;
function registrationId(registration) {
  if (registration.id)
    return registration.id;
  const key = registration.name + "@@@" + (registration.super ? registrationId(registration.super) : "");
  let map = registrationIdMap.get(key);
  if (!map) {
    map = /* @__PURE__ */ new Map();
    registrationIdMap.set(key, map);
  }
  if (!map.has(registration.fn))
    map.set(registration.fn, String(lastId++));
  registration.id = map.get(registration.fn);
  return registration.id;
}

// packages/playwright/src/common/ipc.ts
var ipc_exports = {};
__export(ipc_exports, {
  serializeConfig: () => serializeConfig,
  stdioChunkToParams: () => stdioChunkToParams,
  toTestInfoErrorPayload: () => toTestInfoErrorPayload
});
var import_util7 = __toESM(require("util"));
function serializeConfig(config, passCompilationCache) {
  const result2 = {
    location: { configDir: config.configDir, resolvedConfigFile: config.config.configFile },
    configCLIOverrides: config.configCLIOverrides,
    compilationCache: passCompilationCache ? serializeCompilationCache() : void 0
  };
  try {
    result2.metadata = JSON.stringify(config.config.metadata);
  } catch (error) {
  }
  return result2;
}
function stdioChunkToParams(chunk) {
  if (chunk instanceof Uint8Array)
    return { buffer: Buffer.from(chunk).toString("base64") };
  if (typeof chunk !== "string")
    return { text: import_util7.default.inspect(chunk) };
  return { text: chunk };
}
function toTestInfoErrorPayload(error) {
  const result2 = {};
  if (error.message !== void 0)
    result2.message = error.message;
  if (error.stack !== void 0)
    result2.stack = error.stack;
  if (error.value !== void 0)
    result2.value = error.value;
  if (error.cause !== void 0)
    result2.cause = toTestInfoErrorPayload(error.cause);
  return result2;
}

// packages/playwright/src/common/poolBuilder.ts
var poolBuilder_exports = {};
__export(poolBuilder_exports, {
  PoolBuilder: () => PoolBuilder
});
var PoolBuilder = class _PoolBuilder {
  constructor(type, project) {
    this._testTypePools = /* @__PURE__ */ new Map();
    this._type = type;
    this._project = project;
  }
  static createForLoader() {
    return new _PoolBuilder("loader");
  }
  static createForWorker(project) {
    return new _PoolBuilder("worker", project);
  }
  buildPools(suite, testErrors) {
    suite.forEachTest((test) => {
      const pool = this._buildPoolForTest(test, testErrors);
      if (this._type === "loader")
        test._poolDigest = pool.digest;
      if (this._type === "worker")
        test._pool = pool;
    });
  }
  _buildPoolForTest(test, testErrors) {
    let pool = this._buildTestTypePool(test._testType, testErrors);
    const parents = [];
    for (let parent = test.parent; parent; parent = parent.parent)
      parents.push(parent);
    parents.reverse();
    for (const parent of parents) {
      if (parent._use.length)
        pool = new FixturePool(parent._use, (e) => this._handleLoadError(e, testErrors), pool, parent._type === "describe");
      for (const hook of parent._hooks)
        pool.validateFunction(hook.fn, hook.type + " hook", hook.location);
      for (const modifier of parent._modifiers)
        pool.validateFunction(modifier.fn, modifier.type + " modifier", modifier.location);
    }
    pool.validateFunction(test.fn, "Test", test.location);
    return pool;
  }
  _buildTestTypePool(testType, testErrors) {
    if (!this._testTypePools.has(testType)) {
      const optionOverrides = {
        overrides: this._project?.project?.use ?? {},
        location: { file: `project#${this._project?.id}`, line: 1, column: 1 }
      };
      const pool = new FixturePool(testType.fixtures, (e) => this._handleLoadError(e, testErrors), void 0, void 0, optionOverrides);
      this._testTypePools.set(testType, pool);
    }
    return this._testTypePools.get(testType);
  }
  _handleLoadError(e, testErrors) {
    if (testErrors)
      testErrors.push(e);
    else
      throw new Error(`${formatLocation(e.location)}: ${e.message}`);
  }
};

// packages/playwright/src/common/process.ts
var process_exports = {};
__export(process_exports, {
  ProcessRunner: () => ProcessRunner,
  startProcessRunner: () => startProcessRunner
});
var import_bootstrap = require("playwright-core/lib/bootstrap");
var { ManualPromise } = require("playwright-core/lib/coreBundle").iso;
var { setTimeOrigin } = require("playwright-core/lib/coreBundle").iso;
var { startProfiling, stopProfiling } = require("playwright-core/lib/coreBundle").utils;
var ProcessRunner = class {
  async gracefullyClose() {
  }
  dispatchEvent(method, params) {
    const response = { method, params };
    sendMessageToParent({ method: "__dispatch__", params: response });
  }
  async sendRequest(method, params) {
    return await sendRequestToParent(method, params);
  }
  async sendMessageNoReply(method, params) {
    void sendRequestToParent(method, params).catch(() => {
    });
  }
};
var gracefullyCloseCalled = false;
var forceExitInitiated = false;
var processRunner;
var processName;
var startingEnv = { ...process.env };
function startProcessRunner(create) {
  sendMessageToParent({ method: "ready" });
  process.on("disconnect", () => gracefullyCloseAndExit(true));
  process.on("SIGINT", () => {
  });
  process.on("SIGTERM", () => {
  });
  process.on("message", async (message) => {
    if (message.method === "__init__") {
      const { processParams, runnerParams } = message.params;
      void startProfiling();
      setTimeOrigin(processParams.timeOrigin);
      processRunner = create(runnerParams);
      processName = processParams.processName;
      return;
    }
    if (message.method === "__stop__") {
      const keys = /* @__PURE__ */ new Set([...Object.keys(process.env), ...Object.keys(startingEnv)]);
      const producedEnv = [...keys].filter((key) => startingEnv[key] !== process.env[key]).map((key) => [key, process.env[key] ?? null]);
      sendMessageToParent({ method: "__env_produced__", params: producedEnv });
      await gracefullyCloseAndExit(false);
      return;
    }
    if (message.method === "__dispatch__") {
      const { id, method, params } = message.params;
      try {
        const result2 = await processRunner[method](params);
        const response = { id, result: result2 };
        sendMessageToParent({ method: "__dispatch__", params: response });
      } catch (e) {
        const response = { id, error: serializeError(e) };
        sendMessageToParent({ method: "__dispatch__", params: response });
      }
    }
    if (message.method === "__response__")
      handleResponseFromParent(message.params);
  });
}
var kForceExitTimeout = +(process.env.PWTEST_FORCE_EXIT_TIMEOUT || 3e4);
async function gracefullyCloseAndExit(forceExit) {
  if (forceExit && !forceExitInitiated) {
    forceExitInitiated = true;
    setTimeout(() => process.exit(0), kForceExitTimeout);
  }
  if (!gracefullyCloseCalled) {
    gracefullyCloseCalled = true;
    await processRunner?.gracefullyClose().catch(() => {
    });
    if (processName)
      await stopProfiling(processName).catch(() => {
      });
    process.exit(0);
  }
}
function sendMessageToParent(message) {
  try {
    process.send(message);
  } catch (e) {
    try {
      JSON.stringify(message);
    } catch {
      throw e;
    }
  }
}
var lastId2 = 0;
var requestCallbacks = /* @__PURE__ */ new Map();
async function sendRequestToParent(method, params) {
  const id = ++lastId2;
  sendMessageToParent({ method: "__request__", params: { id, method, params } });
  const promise = new ManualPromise();
  requestCallbacks.set(id, promise);
  return promise;
}
function handleResponseFromParent(response) {
  const promise = requestCallbacks.get(response.id);
  if (!promise)
    return;
  requestCallbacks.delete(response.id);
  if (response.error)
    promise.reject(new Error(response.error.message));
  else
    promise.resolve(response.result);
}

// packages/playwright/src/common/suiteUtils.ts
var suiteUtils_exports = {};
__export(suiteUtils_exports, {
  applyRepeatEachIndex: () => applyRepeatEachIndex,
  bindFileSuiteToProject: () => bindFileSuiteToProject,
  createFiltersFromArguments: () => createFiltersFromArguments,
  filterOnly: () => filterOnly,
  filterTestsRemoveEmptySuites: () => filterTestsRemoveEmptySuites
});
var import_path8 = __toESM(require("path"));
var { calculateSha1: calculateSha13 } = require("playwright-core/lib/coreBundle").utils;
var { toPosixPath } = require("playwright-core/lib/coreBundle").utils;
function filterTestsRemoveEmptySuites(suite, filter) {
  const filteredSuites = suite.suites.filter((child) => filterTestsRemoveEmptySuites(child, filter));
  const filteredTests = suite.tests.filter(filter);
  const entries = /* @__PURE__ */ new Set([...filteredSuites, ...filteredTests]);
  suite._entries = suite._entries.filter((e) => entries.has(e));
  return !!suite._entries.length;
}
function bindFileSuiteToProject(project, suite) {
  const relativeFile = import_path8.default.relative(project.project.testDir, suite.location.file);
  const fileId = calculateSha13(toPosixPath(relativeFile)).slice(0, 20);
  const result2 = suite._deepClone();
  result2._fileId = fileId;
  result2.forEachTest((test, suite2) => {
    suite2._fileId = fileId;
    const [file2, ...titles] = test.titlePath();
    const testIdExpression = `[project=${project.id}]${toPosixPath(file2)}${titles.join("")}`;
    const testId = fileId + "-" + calculateSha13(testIdExpression).slice(0, 20);
    test.id = testId;
    test._projectId = project.id;
    let inheritedRetries;
    let inheritedTimeout;
    for (let parentSuite = suite2; parentSuite; parentSuite = parentSuite.parent) {
      if (parentSuite._staticAnnotations.length)
        test.annotations.unshift(...parentSuite._staticAnnotations);
      if (inheritedRetries === void 0 && parentSuite._retries !== void 0)
        inheritedRetries = parentSuite._retries;
      if (inheritedTimeout === void 0 && parentSuite._timeout !== void 0)
        inheritedTimeout = parentSuite._timeout;
    }
    test.retries = inheritedRetries ?? project.project.retries;
    test.timeout = inheritedTimeout ?? project.project.timeout;
    if (test.annotations.some((a) => a.type === "skip" || a.type === "fixme"))
      test.expectedStatus = "skipped";
    if (test._poolDigest)
      test._workerHash = `${project.id}-${test._poolDigest}-0`;
  });
  return result2;
}
function applyRepeatEachIndex(project, fileSuite, repeatEachIndex) {
  fileSuite.forEachTest((test, suite) => {
    if (repeatEachIndex) {
      const [file2, ...titles] = test.titlePath();
      const testIdExpression = `[project=${project.id}]${toPosixPath(file2)}${titles.join("")} (repeat:${repeatEachIndex})`;
      const testId = suite._fileId + "-" + calculateSha13(testIdExpression).slice(0, 20);
      test.id = testId;
      test.repeatEachIndex = repeatEachIndex;
      if (test._poolDigest)
        test._workerHash = `${project.id}-${test._poolDigest}-${repeatEachIndex}`;
    }
  });
}
function filterOnly(suite) {
  if (!suite._getOnlyItems().length)
    return;
  const suiteFilter = (suite2) => suite2._only;
  const testFilter = (test) => test._only;
  return filterSuiteWithOnlySemantics(suite, suiteFilter, testFilter);
}
function filterSuiteWithOnlySemantics(suite, suiteFilter, testFilter) {
  const onlySuites = suite.suites.filter((child) => filterSuiteWithOnlySemantics(child, suiteFilter, testFilter) || suiteFilter(child));
  const onlyTests = suite.tests.filter(testFilter);
  const onlyEntries = /* @__PURE__ */ new Set([...onlySuites, ...onlyTests]);
  if (onlyEntries.size) {
    suite._entries = suite._entries.filter((e) => onlyEntries.has(e));
    return true;
  }
  return false;
}
function createFiltersFromArguments(args) {
  const matchers = args.map((arg) => {
    const parsed = parseLocationArg(arg);
    const fileMatcher = createFileMatcher(forceRegExp(parsed.file));
    const locationMatcher2 = (file2, line, column) => fileMatcher(file2) && (parsed.line === line || parsed.line === null) && (parsed.column === column || parsed.column === null);
    return { fileMatcher, locationMatcher: locationMatcher2 };
  });
  const fileFilter = (file2) => matchers.some((m) => m.fileMatcher(file2));
  const locationMatcher = (file2, line, column) => matchers.some((m) => m.locationMatcher(file2, line, column));
  const testFilter = (test) => {
    for (let suite = test.parent; suite; suite = suite.parent) {
      if (suite.location && locationMatcher(suite.location.file, suite.location.line, suite.location.column))
        return true;
    }
    return locationMatcher(test.location.file, test.location.line, test.location.column);
  };
  return { fileFilter, testFilter };
}

// packages/playwright/src/common/test.ts
var test_exports = {};
__export(test_exports, {
  Suite: () => Suite,
  TestCase: () => TestCase
});

// packages/playwright/src/common/testType.ts
var testType_exports = {};
__export(testType_exports, {
  TestTypeImpl: () => TestTypeImpl,
  mergeTests: () => mergeTests,
  rootTestType: () => rootTestType
});
var import_globals2 = require("../globals");
var import_expect = require("../matchers/expect");

// packages/playwright/src/common/validators.ts
var { validate } = require("playwright-core/lib/coreBundle").iso;
var testAnnotationSchema = {
  type: "object",
  properties: {
    type: { type: "string" },
    description: { type: "string" }
  },
  required: ["type"]
};
var testDetailsSchema = {
  type: "object",
  properties: {
    tag: {
      oneOf: [
        { type: "string", pattern: "^@", patternError: "Tag must start with '@'" },
        { type: "array", items: { type: "string", pattern: "^@", patternError: "Tag must start with '@'" } }
      ]
    },
    annotation: {
      oneOf: [
        testAnnotationSchema,
        { type: "array", items: testAnnotationSchema }
      ]
    }
  }
};
function validateTestDetails(details, location) {
  const errors = validate(details, testDetailsSchema, "details");
  if (errors.length)
    throw new Error(errors.join("\n"));
  const obj = details;
  const tag = obj.tag;
  const tags = tag === void 0 ? [] : typeof tag === "string" ? [tag] : tag;
  const annotation = obj.annotation;
  const annotations = annotation === void 0 ? [] : Array.isArray(annotation) ? annotation : [annotation];
  return {
    annotations: annotations.map((a) => ({ ...a, location })),
    tags,
    location
  };
}

// packages/playwright/src/common/testType.ts
var { monotonicTime } = require("playwright-core/lib/coreBundle").iso;
var { raceAgainstDeadline } = require("playwright-core/lib/coreBundle").iso;
var { getPackageManagerExecCommand } = require("playwright-core/lib/coreBundle").utils;
var { currentZone } = require("playwright-core/lib/coreBundle").utils;
var testTypeSymbol = Symbol("testType");
var TestTypeImpl = class _TestTypeImpl {
  constructor(fixtures) {
    this.fixtures = fixtures;
    const test = wrapFunctionWithLocation(this._createTest.bind(this, "default"));
    test[testTypeSymbol] = this;
    test.expect = import_expect.expect;
    test.only = wrapFunctionWithLocation(this._createTest.bind(this, "only"));
    test.describe = wrapFunctionWithLocation(this._describe.bind(this, "default"));
    test.describe.only = wrapFunctionWithLocation(this._describe.bind(this, "only"));
    test.describe.configure = wrapFunctionWithLocation(this._configure.bind(this));
    test.describe.fixme = wrapFunctionWithLocation(this._describe.bind(this, "fixme"));
    test.describe.parallel = wrapFunctionWithLocation(this._describe.bind(this, "parallel"));
    test.describe.parallel.only = wrapFunctionWithLocation(this._describe.bind(this, "parallel.only"));
    test.describe.serial = wrapFunctionWithLocation(this._describe.bind(this, "serial"));
    test.describe.serial.only = wrapFunctionWithLocation(this._describe.bind(this, "serial.only"));
    test.describe.skip = wrapFunctionWithLocation(this._describe.bind(this, "skip"));
    test.beforeEach = wrapFunctionWithLocation(this._hook.bind(this, "beforeEach"));
    test.afterEach = wrapFunctionWithLocation(this._hook.bind(this, "afterEach"));
    test.beforeAll = wrapFunctionWithLocation(this._hook.bind(this, "beforeAll"));
    test.afterAll = wrapFunctionWithLocation(this._hook.bind(this, "afterAll"));
    test.skip = wrapFunctionWithLocation(this._modifier.bind(this, "skip"));
    test.fixme = wrapFunctionWithLocation(this._modifier.bind(this, "fixme"));
    test.fail = wrapFunctionWithLocation(this._modifier.bind(this, "fail"));
    test.abort = wrapFunctionWithLocation(this._abort.bind(this));
    test.fail.only = wrapFunctionWithLocation(this._createTest.bind(this, "fail.only"));
    test.slow = wrapFunctionWithLocation(this._modifier.bind(this, "slow"));
    test.setTimeout = wrapFunctionWithLocation(this._setTimeout.bind(this));
    test.step = this._step.bind(this, "pass");
    test.step.skip = this._step.bind(this, "skip");
    test.use = wrapFunctionWithLocation(this._use.bind(this));
    test.extend = wrapFunctionWithLocation(this._extend.bind(this));
    test.info = () => {
      const result2 = (0, import_globals2.currentTestInfo)();
      if (!result2)
        throw new Error("test.info() can only be called while test is running");
      return result2;
    };
    this.test = test;
  }
  _currentSuite(location, title) {
    const suite = (0, import_globals2.currentlyLoadingFileSuite)();
    if (!suite) {
      throw new Error([
        `Playwright Test did not expect ${title} to be called here.`,
        `Most common reasons include:`,
        `- You are calling ${title} in a configuration file.`,
        `- You are calling ${title} in a file that is imported by the configuration file.`,
        `- You have two different versions of @playwright/test. This usually happens`,
        `  when one of the dependencies in your package.json depends on @playwright/test.`,
        `- You are calling ${title} from an async test.describe() block. Only sync ones are supported.`
      ].join("\n"));
    }
    return suite;
  }
  _createTest(type, location, title, fnOrDetails, fn) {
    throwIfRunningInsideJest();
    const suite = this._currentSuite(location, "test()");
    if (!suite)
      return;
    let details;
    let body;
    if (typeof fnOrDetails === "function") {
      body = fnOrDetails;
      details = {};
    } else {
      body = fn;
      details = fnOrDetails;
    }
    const validatedDetails = validateTestDetails(details, location);
    const test = new TestCase(title, body, this, location);
    test._requireFile = suite._requireFile;
    test.annotations.push(...validatedDetails.annotations);
    test._tags.push(...validatedDetails.tags);
    suite._addTest(test);
    if (type === "only" || type === "fail.only")
      test._only = true;
    if (type === "skip" || type === "fixme" || type === "fail")
      test.annotations.push({ type, location });
    else if (type === "fail.only")
      test.annotations.push({ type: "fail", location });
  }
  _describe(type, location, titleOrFn, fnOrDetails, fn) {
    throwIfRunningInsideJest();
    const suite = this._currentSuite(location, "test.describe()");
    if (!suite)
      return;
    let title;
    let body;
    let details;
    if (typeof titleOrFn === "function") {
      title = "";
      details = {};
      body = titleOrFn;
    } else if (typeof fnOrDetails === "function") {
      title = titleOrFn;
      details = {};
      body = fnOrDetails;
    } else {
      title = titleOrFn;
      details = fnOrDetails;
      body = fn;
    }
    const validatedDetails = validateTestDetails(details, location);
    const child = new Suite(title, "describe");
    child._requireFile = suite._requireFile;
    child.location = location;
    child._staticAnnotations.push(...validatedDetails.annotations);
    child._tags.push(...validatedDetails.tags);
    suite._addSuite(child);
    if (type === "only" || type === "serial.only" || type === "parallel.only")
      child._only = true;
    if (type === "serial" || type === "serial.only")
      child._parallelMode = "serial";
    if (type === "parallel" || type === "parallel.only")
      child._parallelMode = "parallel";
    if (type === "skip" || type === "fixme")
      child._staticAnnotations.push({ type, location });
    for (let parent = suite; parent; parent = parent.parent) {
      if (parent._parallelMode === "serial" && child._parallelMode === "parallel")
        throw new Error("describe.parallel cannot be nested inside describe.serial");
      if (parent._parallelMode === "default" && child._parallelMode === "parallel")
        throw new Error("describe.parallel cannot be nested inside describe with default mode");
    }
    (0, import_globals2.setCurrentlyLoadingFileSuite)(child);
    body();
    (0, import_globals2.setCurrentlyLoadingFileSuite)(suite);
  }
  _hook(name, location, title, fn) {
    const suite = this._currentSuite(location, `test.${name}()`);
    if (!suite)
      return;
    if (typeof title === "function") {
      fn = title;
      title = `${name} hook`;
    }
    suite._hooks.push({ type: name, fn, title, location });
  }
  _configure(location, options) {
    throwIfRunningInsideJest();
    const suite = this._currentSuite(location, `test.describe.configure()`);
    if (!suite)
      return;
    if (options.timeout !== void 0)
      suite._timeout = options.timeout;
    if (options.retries !== void 0)
      suite._retries = options.retries;
    if (options.mode !== void 0) {
      if (suite._parallelMode !== "none")
        throw new Error(`"${suite._parallelMode}" mode is already assigned for the enclosing scope.`);
      suite._parallelMode = options.mode;
      for (let parent = suite.parent; parent; parent = parent.parent) {
        if (parent._parallelMode === "serial" && suite._parallelMode === "parallel")
          throw new Error("describe with parallel mode cannot be nested inside describe with serial mode");
        if (parent._parallelMode === "default" && suite._parallelMode === "parallel")
          throw new Error("describe with parallel mode cannot be nested inside describe with default mode");
      }
    }
  }
  _modifier(type, location, ...modifierArgs) {
    const suite = (0, import_globals2.currentlyLoadingFileSuite)();
    if (suite) {
      if (typeof modifierArgs[0] === "string" && typeof modifierArgs[1] === "function" && (type === "skip" || type === "fixme" || type === "fail")) {
        this._createTest(type, location, modifierArgs[0], modifierArgs[1]);
        return;
      }
      if (typeof modifierArgs[0] === "string" && typeof modifierArgs[1] === "object" && typeof modifierArgs[2] === "function" && (type === "skip" || type === "fixme" || type === "fail")) {
        this._createTest(type, location, modifierArgs[0], modifierArgs[1], modifierArgs[2]);
        return;
      }
      if (typeof modifierArgs[0] === "function") {
        suite._modifiers.push({ type, fn: modifierArgs[0], location, description: modifierArgs[1] });
      } else {
        if (modifierArgs.length >= 1 && !modifierArgs[0])
          return;
        const description = modifierArgs[1];
        suite._staticAnnotations.push({ type, description, location });
      }
      return;
    }
    const testInfo = (0, import_globals2.currentTestInfo)();
    if (!testInfo)
      throw new Error(`test.${type}() can only be called inside test, describe block or fixture`);
    if (typeof modifierArgs[0] === "function")
      throw new Error(`test.${type}() with a function can only be called inside describe block`);
    testInfo._modifier(type, location, modifierArgs);
  }
  _abort(location, message) {
    const testInfo = (0, import_globals2.currentTestInfo)();
    if (!testInfo)
      throw new Error(`test.abort() can only be called inside a test or fixture`);
    testInfo._abort(location, message);
  }
  _setTimeout(location, timeout) {
    const suite = (0, import_globals2.currentlyLoadingFileSuite)();
    if (suite) {
      suite._timeout = timeout;
      return;
    }
    const testInfo = (0, import_globals2.currentTestInfo)();
    if (!testInfo)
      throw new Error(`test.setTimeout() can only be called from a test`);
    testInfo.setTimeout(timeout);
  }
  _use(location, fixtures) {
    const suite = this._currentSuite(location, `test.use()`);
    if (!suite)
      return;
    suite._use.push({ fixtures, location });
  }
  async _step(expectation, title, body, options = {}) {
    const testInfo = (0, import_globals2.currentTestInfo)();
    if (!testInfo)
      throw new Error(`test.step() can only be called from a test`);
    await testInfo._onUserStepBegin?.(title);
    const step = testInfo._addStep({ category: "test.step", title, location: options.location, box: options.box });
    return await currentZone().with("stepZone", step).run(async () => {
      try {
        let result2 = void 0;
        result2 = await raceAgainstDeadline(async () => {
          try {
            return await step.info._runStepBody(expectation === "skip", body, step.location);
          } catch (e) {
            if (result2?.timedOut)
              testInfo._failWithError(e);
            throw e;
          }
        }, options.timeout ? monotonicTime() + options.timeout : 0);
        if (result2.timedOut)
          throw new TimeoutError(`Step timeout of ${options.timeout}ms exceeded.`);
        step.complete({});
        return result2.result;
      } catch (error) {
        step.complete({ error });
        throw error;
      } finally {
        await testInfo._onUserStepEnd?.();
      }
    });
  }
  _extend(location, fixtures) {
    if (fixtures[testTypeSymbol])
      throw new Error(`test.extend() accepts fixtures object, not a test object.
Did you mean to call mergeTests()?`);
    const fixturesWithLocation = { fixtures, location };
    return new _TestTypeImpl([...this.fixtures, fixturesWithLocation]).test;
  }
};
function throwIfRunningInsideJest() {
  if (process.env.JEST_WORKER_ID) {
    const packageManagerCommand = getPackageManagerExecCommand();
    throw new Error(
      `Playwright Test needs to be invoked via '${packageManagerCommand} playwright test' and excluded from Jest test runs.
Creating one directory for Playwright tests and one for Jest is the recommended way of doing it.
See https://playwright.dev/docs/intro for more information about Playwright Test.`
    );
  }
}
var rootTestType = new TestTypeImpl([]);
function mergeTests(...tests) {
  let result2 = rootTestType;
  for (const t of tests) {
    const testTypeImpl = t[testTypeSymbol];
    if (!testTypeImpl)
      throw new Error(`mergeTests() accepts "test" functions as parameters.
Did you mean to call test.extend() with fixtures instead?`);
    const newFixtures = testTypeImpl.fixtures.filter((theirs) => !result2.fixtures.find((ours) => ours.fixtures === theirs.fixtures));
    result2 = new TestTypeImpl([...result2.fixtures, ...newFixtures]);
  }
  return result2.test;
}
var TimeoutError = class extends Error {
  constructor(message) {
    super(message);
    this.name = "TimeoutError";
  }
};

// packages/playwright/src/isomorphic/teleReceiver.ts
var baseFullConfig = {
  argv: [],
  failOnFlakyTests: false,
  forbidOnly: false,
  fullyParallel: false,
  globalSetup: null,
  globalTeardown: null,
  globalTimeout: 0,
  grep: /.*/,
  grepInvert: null,
  maxFailures: 0,
  metadata: {},
  preserveOutput: "always",
  projects: [],
  reporter: [[process.env.CI ? "dot" : "list"]],
  reportSlowTests: {
    max: 5,
    threshold: 3e5
    /* 5 minutes */
  },
  configFile: "",
  rootDir: "",
  quiet: false,
  shard: null,
  tags: [],
  updateSnapshots: "missing",
  updateSourceMethod: "patch",
  version: "",
  workers: 0,
  webServer: null
};
function computeTestCaseOutcome(test) {
  let skipped = 0;
  let didNotRun = 0;
  let expected = 0;
  let interrupted = 0;
  let unexpected = 0;
  for (const result2 of test.results) {
    if (result2.status === "interrupted") {
      ++interrupted;
    } else if (result2.status === "skipped" && test.expectedStatus === "skipped") {
      ++skipped;
    } else if (result2.status === "skipped") {
      ++didNotRun;
    } else if (result2.status === test.expectedStatus) {
      ++expected;
    } else {
      ++unexpected;
    }
  }
  if (expected === 0 && unexpected === 0)
    return "skipped";
  if (unexpected === 0)
    return "expected";
  if (expected === 0 && skipped === 0)
    return "unexpected";
  return "flaky";
}

// packages/playwright/src/common/test.ts
var Base = class {
  constructor(title) {
    this._only = false;
    this._requireFile = "";
    this.title = title;
  }
};
var Suite = class _Suite extends Base {
  constructor(title, type) {
    super(title);
    this._use = [];
    this._entries = [];
    this._hooks = [];
    // Annotations known statically before running the test, e.g. `test.describe.skip()` or `test.describe({ annotation }, body)`.
    this._staticAnnotations = [];
    // Explicitly declared tags that are not a part of the title.
    this._tags = [];
    this._modifiers = [];
    this._parallelMode = "none";
    this._type = type;
  }
  get type() {
    return this._type;
  }
  entries() {
    return this._entries;
  }
  get suites() {
    return this._entries.filter((entry) => entry instanceof _Suite);
  }
  get tests() {
    return this._entries.filter((entry) => entry instanceof TestCase);
  }
  _addTest(test) {
    test.parent = this;
    this._entries.push(test);
  }
  _addSuite(suite) {
    suite.parent = this;
    this._entries.push(suite);
  }
  _prependSuite(suite) {
    suite.parent = this;
    this._entries.unshift(suite);
  }
  allTests() {
    const result2 = [];
    const visit = (suite) => {
      for (const entry of suite._entries) {
        if (entry instanceof _Suite)
          visit(entry);
        else
          result2.push(entry);
      }
    };
    visit(this);
    return result2;
  }
  _hasTests() {
    let result2 = false;
    const visit = (suite) => {
      for (const entry of suite._entries) {
        if (result2)
          return;
        if (entry instanceof _Suite)
          visit(entry);
        else
          result2 = true;
      }
    };
    visit(this);
    return result2;
  }
  titlePath() {
    const titlePath = this.parent ? this.parent.titlePath() : [];
    if (this.title || this._type !== "describe")
      titlePath.push(this.title);
    return titlePath;
  }
  _collectGrepTitlePath(path10) {
    if (this.parent)
      this.parent._collectGrepTitlePath(path10);
    if (this.title || this._type !== "describe")
      path10.push(this.title);
    path10.push(...this._tags);
  }
  _collectTagTitlePath(path10) {
    this.parent?._collectTagTitlePath(path10);
    if (this._type === "describe")
      path10.push(this.title);
    path10.push(...this._tags);
  }
  _getOnlyItems() {
    const items = [];
    if (this._only)
      items.push(this);
    for (const suite of this.suites)
      items.push(...suite._getOnlyItems());
    items.push(...this.tests.filter((test) => test._only));
    return items;
  }
  _deepClone() {
    const suite = this._clone();
    for (const entry of this._entries) {
      if (entry instanceof _Suite)
        suite._addSuite(entry._deepClone());
      else
        suite._addTest(entry._clone());
    }
    return suite;
  }
  _deepSerialize() {
    const suite = this._serialize();
    suite.entries = [];
    for (const entry of this._entries) {
      if (entry instanceof _Suite)
        suite.entries.push(entry._deepSerialize());
      else
        suite.entries.push(entry._serialize());
    }
    return suite;
  }
  static _deepParse(data) {
    const suite = _Suite._parse(data);
    for (const entry of data.entries) {
      if (entry.kind === "suite")
        suite._addSuite(_Suite._deepParse(entry));
      else
        suite._addTest(TestCase._parse(entry));
    }
    return suite;
  }
  forEachTest(visitor) {
    for (const entry of this._entries) {
      if (entry instanceof _Suite)
        entry.forEachTest(visitor);
      else
        visitor(entry, this);
    }
  }
  _serialize() {
    return {
      kind: "suite",
      title: this.title,
      type: this._type,
      location: this.location,
      only: this._only,
      requireFile: this._requireFile,
      timeout: this._timeout,
      retries: this._retries,
      staticAnnotations: this._staticAnnotations.slice(),
      tags: this._tags.slice(),
      modifiers: this._modifiers.slice(),
      parallelMode: this._parallelMode,
      hooks: this._hooks.map((h) => ({ type: h.type, location: h.location, title: h.title })),
      fileId: this._fileId
    };
  }
  static _parse(data) {
    const suite = new _Suite(data.title, data.type);
    suite.location = data.location;
    suite._only = data.only;
    suite._requireFile = data.requireFile;
    suite._timeout = data.timeout;
    suite._retries = data.retries;
    suite._staticAnnotations = data.staticAnnotations;
    suite._tags = data.tags;
    suite._modifiers = data.modifiers;
    suite._parallelMode = data.parallelMode;
    suite._hooks = data.hooks.map((h) => ({ type: h.type, location: h.location, title: h.title, fn: () => {
    } }));
    suite._fileId = data.fileId;
    return suite;
  }
  _clone() {
    const data = this._serialize();
    const suite = _Suite._parse(data);
    suite._use = this._use.slice();
    suite._hooks = this._hooks.slice();
    suite._fullProject = this._fullProject;
    return suite;
  }
  project() {
    return this._fullProject?.project || this.parent?.project();
  }
};
var TestCase = class _TestCase extends Base {
  constructor(title, fn, testType, location) {
    super(title);
    this.results = [];
    this.type = "test";
    this.expectedStatus = "passed";
    this.timeout = 0;
    this.annotations = [];
    this.retries = 0;
    this.repeatEachIndex = 0;
    this.id = "";
    this._poolDigest = "";
    this._workerHash = "";
    this._projectId = "";
    // Explicitly declared tags that are not a part of the title.
    this._tags = [];
    this.fn = fn;
    this._testType = testType;
    this.location = location;
  }
  titlePath() {
    const titlePath = this.parent ? this.parent.titlePath() : [];
    titlePath.push(this.title);
    return titlePath;
  }
  outcome() {
    return computeTestCaseOutcome(this);
  }
  ok() {
    const status = this.outcome();
    return status === "expected" || status === "flaky" || status === "skipped";
  }
  get tags() {
    const path10 = [];
    this.parent._collectTagTitlePath(path10);
    path10.push(this.title);
    const titleTags = path10.join(" ").match(/@[\S]+/g) || [];
    return [
      ...titleTags,
      ...this._tags
    ];
  }
  _serialize() {
    return {
      kind: "test",
      id: this.id,
      title: this.title,
      retries: this.retries,
      timeout: this.timeout,
      expectedStatus: this.expectedStatus,
      location: this.location,
      only: this._only,
      requireFile: this._requireFile,
      poolDigest: this._poolDigest,
      workerHash: this._workerHash,
      annotations: this.annotations.slice(),
      tags: this._tags.slice(),
      projectId: this._projectId
    };
  }
  static _parse(data) {
    const test = new _TestCase(data.title, () => {
    }, rootTestType, data.location);
    test.id = data.id;
    test.retries = data.retries;
    test.timeout = data.timeout;
    test.expectedStatus = data.expectedStatus;
    test._only = data.only;
    test._requireFile = data.requireFile;
    test._poolDigest = data.poolDigest;
    test._workerHash = data.workerHash;
    test.annotations = data.annotations;
    test._tags = data.tags;
    test._projectId = data.projectId;
    return test;
  }
  _clone() {
    const data = this._serialize();
    const test = _TestCase._parse(data);
    test._testType = this._testType;
    test.fn = this.fn;
    return test;
  }
  _appendTestResult() {
    const result2 = {
      retry: this.results.length,
      parallelIndex: -1,
      workerIndex: -1,
      duration: 0,
      startTime: /* @__PURE__ */ new Date(),
      stdout: [],
      stderr: [],
      attachments: [],
      status: "skipped",
      steps: [],
      errors: [],
      annotations: []
    };
    this.results.push(result2);
    return result2;
  }
  _grepBaseTitlePath() {
    const path10 = [];
    this.parent._collectGrepTitlePath(path10);
    path10.push(this.title);
    return path10;
  }
  _grepTitleWithTags() {
    const path10 = this._grepBaseTitlePath();
    path10.push(...this._tags);
    return path10.join(" ");
  }
};

// packages/playwright/src/common/testLoader.ts
var testLoader_exports = {};
__export(testLoader_exports, {
  defaultTimeout: () => defaultTimeout2,
  loadTestFile: () => loadTestFile
});
var import_path9 = __toESM(require("path"));
var import_util11 = __toESM(require("util"));
var import_globals3 = require("../globals");
var defaultTimeout2 = 3e4;
var cachedFileSuites = /* @__PURE__ */ new Map();
async function loadTestFile(file2, config, testErrors) {
  if (cachedFileSuites.has(file2))
    return cachedFileSuites.get(file2);
  const suite = new Suite(import_path9.default.relative(config.config.rootDir, file2) || import_path9.default.basename(file2), "file");
  suite._requireFile = file2;
  suite.location = { file: file2, line: 0, column: 0 };
  suite._tags = [...config.config.tags];
  (0, import_globals3.setCurrentlyLoadingFileSuite)(suite);
  if (!(0, import_globals3.isWorkerProcess)())
    await startCollectingFileDeps2();
  try {
    await requireOrImport(file2);
    cachedFileSuites.set(file2, suite);
  } catch (e) {
    if (!testErrors)
      throw e;
    testErrors.push(serializeLoadError(file2, e));
  } finally {
    (0, import_globals3.setCurrentlyLoadingFileSuite)(void 0);
    if (!(0, import_globals3.isWorkerProcess)())
      await stopCollectingFileDeps2(file2);
  }
  {
    const files = /* @__PURE__ */ new Set();
    suite.allTests().map((t) => files.add(t.location.file));
    if (files.size === 1) {
      const mappedFile = files.values().next().value;
      if (suite.location.file !== mappedFile) {
        if (import_path9.default.extname(mappedFile) !== import_path9.default.extname(suite.location.file))
          suite.location.file = mappedFile;
      }
    }
  }
  return suite;
}
function serializeLoadError(file2, error) {
  if (error instanceof Error) {
    const result2 = filterStackTrace(error);
    const loc = error.loc;
    result2.location = loc ? {
      file: file2,
      line: loc.line || 0,
      column: loc.column || 0
    } : void 0;
    return result2;
  }
  return { value: import_util11.default.inspect(error) };
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  FullConfigInternal,
  ProcessRunner,
  builtInReporters,
  cc,
  config,
  configLoader,
  defineConfig,
  fixtures,
  ipc,
  mergeTests,
  poolBuilder,
  processRunner,
  startProcessRunner,
  suiteUtils,
  test,
  testLoader,
  testType,
  transform
});
# packages/playwright/lib/common/index.js
# total: 112.8 KB

## Inlined (20)
  11.7 KB  packages/playwright/src/common/config.ts
  13.4 KB  packages/playwright/src/common/configLoader.ts
  10.9 KB  packages/playwright/src/common/fixtures.ts
   0.8 KB  packages/playwright/src/common/index.ts
   1.3 KB  packages/playwright/src/common/ipc.ts
   2.1 KB  packages/playwright/src/common/poolBuilder.ts
   3.7 KB  packages/playwright/src/common/process.ts
   4.7 KB  packages/playwright/src/common/suiteUtils.ts
   7.9 KB  packages/playwright/src/common/test.ts
   2.0 KB  packages/playwright/src/common/testLoader.ts
  12.6 KB  packages/playwright/src/common/testType.ts
   1.2 KB  packages/playwright/src/common/validators.ts
   1.3 KB  packages/playwright/src/isomorphic/teleReceiver.ts
   9.6 KB  packages/playwright/src/transform/compilationCache.ts
   1.7 KB  packages/playwright/src/transform/esmLoaderSync.ts
   1.1 KB  packages/playwright/src/transform/pirates.ts
   1.1 KB  packages/playwright/src/transform/portTransport.ts
  12.3 KB  packages/playwright/src/transform/transform.ts
   2.9 KB  packages/playwright/src/transform/tsconfig-loader.ts
   7.8 KB  packages/playwright/src/util.ts

## External (9)
  ../globals
  ../matchers/expect
  ../package
  ../transform/esmLoader.js
  playwright
  playwright-core/lib/bootstrap
  playwright-core/lib/coreBundle
  playwright-core/lib/utilsBundle
  playwright-core/package.json
"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  // If the importer is in node compatibility mode or this is not an ESM
  // file that has been converted to a CommonJS file using a Babel-
  // compatible transform (i.e. "__esModule" has not been set), then set
  // "default" to the CommonJS "module.exports" for node compatibility.
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var errorContext_exports = {};
__export(errorContext_exports, {
  buildErrorContext: () => buildErrorContext
});
module.exports = __toCommonJS(errorContext_exports);
var import_fs = __toESM(require("fs"));
var import_path = __toESM(require("path"));
var import_util = require("./util");
const { parseErrorStack } = require("playwright-core/lib/coreBundle").iso;
const { stripAnsiEscapes } = require("playwright-core/lib/coreBundle").iso;
const fixTestInstructions = `# Instructions

- Following Playwright test failed.
- Explain why, be concise, respect Playwright best practices.
- Provide a snippet of code with the fix, if possible.
`;
function buildErrorContext(options) {
  const { titlePath, location, errors, pageSnapshot } = options;
  const meaningfulErrors = errors.filter((e) => !!e.message);
  if (!meaningfulErrors.length && !pageSnapshot)
    return void 0;
  const lines = [
    fixTestInstructions,
    "# Test info",
    "",
    `- Name: ${titlePath.join(" >> ")}`,
    `- Location: ${(0, import_util.relativeFilePath)(location.file)}:${location.line}:${location.column}`
  ];
  if (meaningfulErrors.length) {
    lines.push("", "# Error details");
    for (const error of meaningfulErrors) {
      lines.push(
        "",
        "```",
        stripAnsiEscapes(error.message || ""),
        "```"
      );
      if (error.errorContext) {
        lines.push(
          "",
          "```yaml",
          error.errorContext,
          "```"
        );
      }
    }
  }
  if (pageSnapshot) {
    lines.push(
      "",
      "# Page snapshot",
      "",
      "```yaml",
      pageSnapshot,
      "```"
    );
  }
  const lastError = meaningfulErrors[meaningfulErrors.length - 1];
  const codeFrame = lastError ? buildCodeFrame(lastError, location) : void 0;
  if (codeFrame) {
    lines.push(
      "",
      "# Test source",
      "",
      "```ts",
      codeFrame,
      "```"
    );
  }
  return lines.join("\n");
}
function buildCodeFrame(error, testLocation) {
  const stack = error.stack;
  if (!stack)
    return void 0;
  const parsed = parseErrorStack(stack, import_path.default.sep);
  const errorLocation = parsed.location;
  if (!errorLocation)
    return void 0;
  let source;
  try {
    source = import_fs.default.readFileSync(errorLocation.file, "utf8");
  } catch {
    return void 0;
  }
  const sourceLines = source.split("\n");
  const linesAbove = 100;
  const linesBelow = 100;
  const start = Math.max(0, errorLocation.line - linesAbove - 1);
  const end = Math.min(sourceLines.length, errorLocation.line + linesBelow);
  const scope = sourceLines.slice(start, end);
  const lineNumberWidth = String(end).length;
  const message = stripAnsiEscapes(error.message || "").split("\n")[0] || void 0;
  const frame = scope.map((line, index) => `${start + index + 1 === errorLocation.line ? "> " : "  "}${(start + index + 1).toString().padEnd(lineNumberWidth, " ")} | ${line}`);
  if (message)
    frame.splice(errorLocation.line - start, 0, `${" ".repeat(lineNumberWidth + 2)} | ${" ".repeat(Math.max(0, errorLocation.column - 2))} ^ ${message}`);
  return frame.join("\n");
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  buildErrorContext
});
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var globals_exports = {};
__export(globals_exports, {
  currentTestInfo: () => currentTestInfo,
  currentlyLoadingFileSuite: () => currentlyLoadingFileSuite,
  isWorkerProcess: () => isWorkerProcess,
  setCurrentTestInfo: () => setCurrentTestInfo,
  setCurrentlyLoadingFileSuite: () => setCurrentlyLoadingFileSuite,
  setIsWorkerProcess: () => setIsWorkerProcess
});
module.exports = __toCommonJS(globals_exports);
let currentTestInfoValue = null;
function setCurrentTestInfo(testInfo) {
  currentTestInfoValue = testInfo;
}
function currentTestInfo() {
  return currentTestInfoValue;
}
let currentFileSuite;
function setCurrentlyLoadingFileSuite(suite) {
  currentFileSuite = suite;
}
function currentlyLoadingFileSuite() {
  return currentFileSuite;
}
let _isWorkerProcess = false;
function setIsWorkerProcess() {
  _isWorkerProcess = true;
}
function isWorkerProcess() {
  return _isWorkerProcess;
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  currentTestInfo,
  currentlyLoadingFileSuite,
  isWorkerProcess,
  setCurrentTestInfo,
  setCurrentlyLoadingFileSuite,
  setIsWorkerProcess
});
"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  // If the importer is in node compatibility mode or this is not an ESM
  // file that has been converted to a CommonJS file using a Babel-
  // compatible transform (i.e. "__esModule" has not been set), then set
  // "default" to the CommonJS "module.exports" for node compatibility.
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var index_exports = {};
__export(index_exports, {
  _baseTest: () => _baseTest,
  _utilityTest: () => _utilityTest,
  defineConfig: () => import_common2.defineConfig,
  expect: () => import_expect.expect,
  mergeExpects: () => import_expect2.mergeExpects,
  mergeTests: () => import_common2.mergeTests,
  test: () => test
});
module.exports = __toCommonJS(index_exports);
var import_fs = __toESM(require("fs"));
var import_path = __toESM(require("path"));
var playwrightLibrary = __toESM(require("playwright-core"));
var import_errorContext = require("./errorContext");
var import_common = require("./common");
var globals = __toESM(require("./globals"));
var import_package = require("./package");
var import_browserBackend = require("./mcp/test/browserBackend");
var import_expect = require("./matchers/expect");
var import_common2 = require("./common");
var import_expect2 = require("./matchers/expect");
const { asLocatorDescription } = require("playwright-core/lib/coreBundle").iso;
const { getActionGroup, renderTitleForCall } = require("playwright-core/lib/coreBundle").iso;
const { escapeHTML } = require("playwright-core/lib/coreBundle").iso;
const { jsonStringifyForceASCII } = require("playwright-core/lib/coreBundle").utils;
const { createGuid } = require("playwright-core/lib/coreBundle").utils;
const { debugMode } = require("playwright-core/lib/coreBundle").utils;
const { setBoxedStackPrefixes } = require("playwright-core/lib/coreBundle").utils;
const { currentZone } = require("playwright-core/lib/coreBundle").utils;
const _baseTest = import_common.testType.rootTestType.test;
setBoxedStackPrefixes([import_package.packageRoot]);
if (process["__pw_initiator__"]) {
  const originalStackTraceLimit = Error.stackTraceLimit;
  Error.stackTraceLimit = 200;
  try {
    throw new Error("Requiring @playwright/test second time, \nFirst:\n" + process["__pw_initiator__"] + "\n\nSecond: ");
  } finally {
    Error.stackTraceLimit = originalStackTraceLimit;
  }
} else {
  process["__pw_initiator__"] = new Error().stack;
}
const utilityFixtures = {
  playwright: [async ({}, use) => {
    await use(require("playwright-core"));
  }, { scope: "worker", box: true }],
  screenshot: ["off", { scope: "worker", option: true, box: true }],
  trace: ["off", { scope: "worker", option: true, box: true }],
  testIdAttribute: ["data-testid", { option: true, box: true }],
  _combinedContextOptions: [{}, { box: true }],
  _setupArtifacts: [async ({ playwright, screenshot, _combinedContextOptions }, use, testInfo) => {
    testInfo.setTimeout(testInfo.project.timeout);
    const artifactsRecorder = new ArtifactsRecorder(playwright, tracing().artifactsDir(), screenshot);
    await artifactsRecorder.willStartTest(testInfo);
    const tracingGroupSteps = [];
    const pausedContexts = /* @__PURE__ */ new Set();
    const csiListener = {
      onApiCallBegin: (data, channel) => {
        const testInfo2 = globals.currentTestInfo();
        if (!testInfo2 || data.apiName.includes("setTestIdAttribute") || data.apiName === "tracing.groupEnd")
          return;
        const zone = currentZone().data("stepZone");
        const isExpectCall = data.apiName === "locator._expect" || data.apiName === "frame._expect" || data.apiName === "page._expectScreenshot";
        if (zone && zone.category === "expect" && isExpectCall) {
          if (zone.apiName)
            data.apiName = zone.apiName;
          if (zone.shortTitle || zone.title)
            data.title = zone.shortTitle ?? zone.title;
          data.stepId = zone.stepId;
          return;
        }
        const step = testInfo2._addStep({
          location: data.frames[0],
          category: "pw:api",
          title: renderTitle(channel.type, channel.method, channel.params, data.title),
          apiName: data.apiName,
          params: channel.params,
          group: getActionGroup({ type: channel.type, method: channel.method })
        }, tracingGroupSteps[tracingGroupSteps.length - 1]);
        data.userData = step;
        data.stepId = step.stepId;
        if (data.apiName === "tracing.group")
          tracingGroupSteps.push(step);
      },
      onApiCallEnd: (data) => {
        if (data.apiName === "tracing.group")
          return;
        if (data.apiName === "tracing.groupEnd") {
          const step2 = tracingGroupSteps.pop();
          step2?.complete({ error: data.error });
          return;
        }
        const step = data.userData;
        step?.complete({ error: data.error });
      },
      onWillPause: ({ keepTestTimeout }) => {
        if (!keepTestTimeout)
          globals.currentTestInfo()?._setIgnoreTimeouts(true);
      },
      runBeforeCreateBrowserContext: async (options) => {
        for (const [key, value] of Object.entries(_combinedContextOptions)) {
          if (!(key in options))
            options[key] = value;
        }
      },
      runBeforeCreateRequestContext: async (options) => {
        for (const [key, value] of Object.entries(_combinedContextOptions)) {
          if (!(key in options))
            options[key] = value;
        }
      },
      runAfterCreateBrowserContext: async (context) => {
        context.debugger.on("pausedstatechanged", () => {
          const paused = !!context.debugger.pausedDetails();
          if (pausedContexts.has(context) && !paused) {
            pausedContexts.delete(context);
            testInfo._setIgnoreTimeouts(false);
          } else if (!pausedContexts.has(context) && paused) {
            pausedContexts.add(context);
            testInfo._setIgnoreTimeouts(true);
          }
        });
        await artifactsRecorder.didCreateBrowserContext(context);
        const currentTestInfo = globals.currentTestInfo();
        if (currentTestInfo) {
          attachConnectedHeaderIfNeeded(currentTestInfo, context.browser());
          currentTestInfo._onCustomMessageCallback = (0, import_browserBackend.createCustomMessageHandler)(currentTestInfo, context);
          await (0, import_browserBackend.runDaemonForContext)(currentTestInfo, context);
        }
      },
      runAfterCreateRequestContext: async (context) => {
        await artifactsRecorder.didCreateRequestContext(context);
      },
      runBeforeCloseBrowserContext: async (context) => {
        await artifactsRecorder.willCloseBrowserContext(context);
      },
      runBeforeCloseRequestContext: async (context) => {
        await artifactsRecorder.willCloseRequestContext(context);
      }
    };
    const clientInstrumentation = playwright._instrumentation;
    clientInstrumentation.addListener(csiListener);
    await use();
    clientInstrumentation.removeListener(csiListener);
    await artifactsRecorder.didFinishTest();
  }, { auto: "all-hooks-included", title: "trace recording", box: true, timeout: 0 }],
  request: async ({ playwright }, use) => {
    const request = await playwright.request.newContext();
    await use(request);
    const hook = test.info()._currentHookType();
    if (hook === "beforeAll") {
      await request.dispose({ reason: [
        `Fixture { request } from beforeAll cannot be reused in a test.`,
        `  - Recommended fix: use a separate { request } in the test.`,
        `  - Alternatively, manually create APIRequestContext in beforeAll and dispose it in afterAll.`,
        `See https://playwright.dev/docs/api-testing#sending-api-requests-from-ui-tests for more details.`
      ].join("\n") });
    } else {
      await request.dispose();
    }
  }
};
const _utilityTest = _baseTest.extend(utilityFixtures);
const playwrightFixtures = {
  defaultBrowserType: ["chromium", { scope: "worker", option: true, box: true }],
  browserName: [({ defaultBrowserType }, use) => use(defaultBrowserType), { scope: "worker", option: true, box: true }],
  headless: [({ launchOptions }, use) => use(launchOptions.headless ?? true), { scope: "worker", option: true, box: true }],
  channel: [({ launchOptions }, use) => use(launchOptions.channel), { scope: "worker", option: true, box: true }],
  launchOptions: [{}, { scope: "worker", option: true, box: true }],
  connectOptions: [async ({ _optionConnectOptions }, use) => {
    await use(connectOptionsFromEnv() || _optionConnectOptions);
  }, { scope: "worker", option: true, box: true }],
  video: ["off", { scope: "worker", option: true, box: true }],
  _browserOptions: [async ({ playwright, headless, channel, launchOptions }, use) => {
    const options = {
      handleSIGINT: false,
      ...launchOptions,
      tracesDir: tracing().tracesDir(),
      artifactsDir: tracing().artifactsDir()
    };
    if (headless !== void 0)
      options.headless = headless;
    if (channel !== void 0)
      options.channel = channel;
    playwright._defaultLaunchOptions = options;
    await use(options);
    playwright._defaultLaunchOptions = void 0;
  }, { scope: "worker", auto: true, box: true }],
  browser: [async ({ playwright, browserName, _browserOptions, connectOptions }, use, workerInfo) => {
    if (!["chromium", "firefox", "webkit"].includes(browserName))
      throw new Error(`Unexpected browserName "${browserName}", must be one of "chromium", "firefox" or "webkit"`);
    if (connectOptions) {
      const browser2 = await playwright[browserName].connect(connectOptions.wsEndpoint, {
        ...connectOptions,
        exposeNetwork: connectOptions.exposeNetwork,
        headers: {
          // HTTP headers are ASCII only (not UTF-8).
          "x-playwright-launch-options": jsonStringifyForceASCII(_browserOptions),
          ...connectOptions.headers
        }
      });
      await use(browser2);
      await browser2.close({ reason: "Test ended." });
      return;
    }
    const browser = await playwright[browserName].launch();
    if (process.env.PLAYWRIGHT_DASHBOARD)
      await browser.bind(`worker-${workerInfo.parallelIndex}`);
    await use(browser);
    await browser.close({ reason: "Test ended." });
  }, { scope: "worker", timeout: 0 }],
  acceptDownloads: [({ contextOptions }, use) => use(contextOptions.acceptDownloads ?? true), { option: true, box: true }],
  bypassCSP: [({ contextOptions }, use) => use(contextOptions.bypassCSP ?? false), { option: true, box: true }],
  colorScheme: [({ contextOptions }, use) => use(contextOptions.colorScheme === void 0 ? "light" : contextOptions.colorScheme), { option: true, box: true }],
  deviceScaleFactor: [({ contextOptions }, use) => use(contextOptions.deviceScaleFactor), { option: true, box: true }],
  extraHTTPHeaders: [({ contextOptions }, use) => use(contextOptions.extraHTTPHeaders), { option: true, box: true }],
  geolocation: [({ contextOptions }, use) => use(contextOptions.geolocation), { option: true, box: true }],
  hasTouch: [({ contextOptions }, use) => use(contextOptions.hasTouch ?? false), { option: true, box: true }],
  httpCredentials: [({ contextOptions }, use) => use(contextOptions.httpCredentials), { option: true, box: true }],
  ignoreHTTPSErrors: [({ contextOptions }, use) => use(contextOptions.ignoreHTTPSErrors ?? false), { option: true, box: true }],
  isMobile: [({ contextOptions }, use) => use(contextOptions.isMobile ?? false), { option: true, box: true }],
  javaScriptEnabled: [({ contextOptions }, use) => use(contextOptions.javaScriptEnabled ?? true), { option: true, box: true }],
  locale: [({ contextOptions }, use) => use(contextOptions.locale ?? "en-US"), { option: true, box: true }],
  offline: [({ contextOptions }, use) => use(contextOptions.offline ?? false), { option: true, box: true }],
  permissions: [({ contextOptions }, use) => use(contextOptions.permissions), { option: true, box: true }],
  proxy: [({ contextOptions }, use) => use(contextOptions.proxy), { option: true, box: true }],
  storageState: [({ contextOptions }, use) => use(contextOptions.storageState), { option: true, box: true }],
  clientCertificates: [({ contextOptions }, use) => use(contextOptions.clientCertificates), { option: true, box: true }],
  timezoneId: [({ contextOptions }, use) => use(contextOptions.timezoneId), { option: true, box: true }],
  userAgent: [({ contextOptions }, use) => use(contextOptions.userAgent), { option: true, box: true }],
  viewport: [({ contextOptions }, use) => use(contextOptions.viewport === void 0 ? { width: 1280, height: 720 } : contextOptions.viewport), { option: true, box: true }],
  actionTimeout: [0, { option: true, box: true }],
  navigationTimeout: [0, { option: true, box: true }],
  baseURL: [async ({}, use) => {
    await use(process.env.PLAYWRIGHT_TEST_BASE_URL);
  }, { option: true, box: true }],
  serviceWorkers: [({ contextOptions }, use) => use(contextOptions.serviceWorkers ?? "allow"), { option: true, box: true }],
  contextOptions: [{}, { option: true, box: true }],
  _combinedContextOptions: [async ({
    acceptDownloads,
    bypassCSP,
    clientCertificates,
    colorScheme,
    deviceScaleFactor,
    extraHTTPHeaders,
    hasTouch,
    geolocation,
    httpCredentials,
    ignoreHTTPSErrors,
    isMobile,
    javaScriptEnabled,
    locale,
    offline,
    permissions,
    proxy,
    storageState,
    viewport,
    timezoneId,
    userAgent,
    baseURL,
    contextOptions,
    serviceWorkers
  }, use, testInfo) => {
    const options = {};
    if (acceptDownloads !== void 0)
      options.acceptDownloads = acceptDownloads;
    if (bypassCSP !== void 0)
      options.bypassCSP = bypassCSP;
    if (colorScheme !== void 0)
      options.colorScheme = colorScheme;
    if (deviceScaleFactor !== void 0)
      options.deviceScaleFactor = deviceScaleFactor;
    if (extraHTTPHeaders !== void 0)
      options.extraHTTPHeaders = extraHTTPHeaders;
    if (geolocation !== void 0)
      options.geolocation = geolocation;
    if (hasTouch !== void 0)
      options.hasTouch = hasTouch;
    if (httpCredentials !== void 0)
      options.httpCredentials = httpCredentials;
    if (ignoreHTTPSErrors !== void 0)
      options.ignoreHTTPSErrors = ignoreHTTPSErrors;
    if (isMobile !== void 0)
      options.isMobile = isMobile;
    if (javaScriptEnabled !== void 0)
      options.javaScriptEnabled = javaScriptEnabled;
    if (locale !== void 0)
      options.locale = locale;
    if (offline !== void 0)
      options.offline = offline;
    if (permissions !== void 0)
      options.permissions = permissions;
    if (proxy !== void 0)
      options.proxy = proxy;
    if (storageState !== void 0)
      options.storageState = storageState;
    if (clientCertificates?.length)
      options.clientCertificates = resolveClientCerticates(clientCertificates);
    if (timezoneId !== void 0)
      options.timezoneId = timezoneId;
    if (userAgent !== void 0)
      options.userAgent = userAgent;
    if (viewport !== void 0)
      options.viewport = viewport;
    if (baseURL !== void 0)
      options.baseURL = baseURL;
    if (serviceWorkers !== void 0)
      options.serviceWorkers = serviceWorkers;
    await use({
      ...contextOptions,
      ...options
    });
  }, { scope: "test", box: true }],
  _setupContextOptions: [async ({ playwright, actionTimeout, navigationTimeout, testIdAttribute }, use, _testInfo) => {
    const testInfo = _testInfo;
    if (testIdAttribute)
      playwrightLibrary.selectors.setTestIdAttribute(testIdAttribute);
    testInfo.snapshotSuffix = process.platform;
    testInfo._onCustomMessageCallback = () => Promise.reject(new Error("Only tests that use default Playwright context or page fixture support test_debug"));
    if (debugMode() === "inspector")
      testInfo._setIgnoreTimeouts(true);
    playwright._defaultContextTimeout = actionTimeout || 0;
    playwright._defaultContextNavigationTimeout = navigationTimeout || 0;
    await use();
    playwright._defaultContextTimeout = void 0;
    playwright._defaultContextNavigationTimeout = void 0;
  }, { auto: "all-hooks-included", title: "context configuration", box: true }],
  _contextFactory: [async ({
    browser,
    video,
    _reuseContext,
    _combinedContextOptions
    /** mitigate dep-via-auto lack of traceability */
  }, use, testInfo) => {
    const testInfoImpl = testInfo;
    const videoMode = normalizeVideoMode(video);
    const captureVideo = shouldCaptureVideo(videoMode, testInfo) && !_reuseContext;
    const contexts = /* @__PURE__ */ new Map();
    let counter = 0;
    await use(async (options) => {
      const hook = testInfoImpl._currentHookType();
      if (hook === "beforeAll" || hook === "afterAll") {
        throw new Error([
          `"context" and "page" fixtures are not supported in "${hook}" since they are created on a per-test basis.`,
          `If you would like to reuse a single page between tests, create context manually with browser.newContext(). See https://aka.ms/playwright/reuse-page for details.`,
          `If you would like to configure your page before each test, do that in beforeEach hook instead.`
        ].join("\n"));
      }
      const show = typeof video === "string" ? void 0 : video.show;
      const videoOptions = captureVideo ? {
        recordVideo: {
          dir: tracing().artifactsDir(),
          size: typeof video === "string" ? void 0 : video.size,
          showActions: show?.actions
        }
      } : {};
      const context = await browser.newContext({ ...videoOptions, ...options });
      let closed = false;
      const close = async () => {
        if (closed)
          return;
        closed = true;
        const closeReason = testInfo.status === "timedOut" ? "Test timeout of " + testInfo.timeout + "ms exceeded." : "Test ended.";
        await context.close({ reason: closeReason });
        const preserveVideo = captureVideo && shouldPreserveVideo(videoMode, testInfo);
        if (preserveVideo) {
          const { pagesWithVideo: pagesForVideo } = contexts.get(context);
          const videos = pagesForVideo.map((p) => p.video()).filter((video2) => !!video2);
          await Promise.all(videos.map(async (v) => {
            try {
              const savedPath = testInfo.outputPath(`video${counter ? "-" + counter : ""}.webm`);
              ++counter;
              await v.saveAs(savedPath);
              testInfo.attachments.push({ name: "video", path: savedPath, contentType: "video/webm" });
            } catch (e) {
            }
          }));
        }
      };
      const contextData = { close, pagesWithVideo: [] };
      if (captureVideo)
        context.on("page", (page) => contextData.pagesWithVideo.push(page));
      contexts.set(context, contextData);
      return { context, close };
    });
    await Promise.all([...contexts.values()].map((data) => data.close()));
  }, { scope: "test", title: "context", box: true }],
  _optionContextReuseMode: ["none", { scope: "worker", option: true, box: true }],
  _optionConnectOptions: [void 0, { scope: "worker", option: true, box: true }],
  _reuseContext: [async ({ video, _optionContextReuseMode }, use) => {
    let mode = _optionContextReuseMode;
    if (process.env.PW_TEST_REUSE_CONTEXT)
      mode = "when-possible";
    const reuse = mode === "when-possible" && normalizeVideoMode(video) === "off";
    await use(reuse);
  }, { scope: "worker", title: "context", box: true }],
  context: async ({ browser, video, _reuseContext, _contextFactory }, use, testInfoPublic) => {
    const browserImpl = browser;
    const testInfo = testInfoPublic;
    const show = typeof video === "string" ? void 0 : video.show;
    attachConnectedHeaderIfNeeded(testInfo, browserImpl);
    if (!_reuseContext) {
      const { context: context2, close } = await _contextFactory();
      await installScreencastTitleUpdater(testInfo, context2, show?.test);
      await use(context2);
      await close();
      return;
    }
    const context = await browserImpl._wrapApiCall(() => browserImpl._newContextForReuse(), { internal: true });
    await installScreencastTitleUpdater(testInfo, context, show?.test);
    await use(context);
    const closeReason = testInfo.status === "timedOut" ? "Test timeout of " + testInfo.timeout + "ms exceeded." : "Test ended.";
    await browserImpl._wrapApiCall(() => browserImpl._disconnectFromReusedContext(closeReason), { internal: true });
  },
  page: async ({ context, _reuseContext }, use) => {
    if (!_reuseContext) {
      await use(await context.newPage());
      return;
    }
    let [page] = context.pages();
    if (!page)
      page = await context.newPage();
    await use(page);
  }
};
function normalizeVideoMode(video) {
  if (!video)
    return "off";
  let videoMode = typeof video === "string" ? video : video.mode;
  if (videoMode === "retry-with-video")
    videoMode = "on-first-retry";
  return videoMode;
}
function shouldCaptureVideo(videoMode, testInfo) {
  return videoMode === "on" || videoMode === "retain-on-failure" || videoMode === "retain-on-failure-and-retries" || videoMode === "on-first-retry" && testInfo.retry === 1 || videoMode === "on-all-retries" && testInfo.retry > 0 || videoMode === "retain-on-first-failure" && testInfo.retry === 0;
}
function shouldPreserveVideo(videoMode, testInfo) {
  const testFailed = testInfo.status !== testInfo.expectedStatus;
  switch (videoMode) {
    case "on":
    case "on-first-retry":
    case "on-all-retries":
      return true;
    case "retain-on-failure":
    case "retain-on-first-failure":
      return testFailed;
    case "retain-on-failure-and-retries":
      return testFailed || testInfo.retry > 0;
    default:
      return false;
  }
}
function normalizeScreenshotMode(screenshot) {
  if (!screenshot)
    return "off";
  return typeof screenshot === "string" ? screenshot : screenshot.mode;
}
function attachConnectedHeaderIfNeeded(testInfo, browser) {
  const connectHeaders = browser?._connection.headers;
  if (!connectHeaders)
    return;
  for (const header of connectHeaders) {
    if (header.name !== "x-playwright-attachment")
      continue;
    const [name, value] = header.value.split("=");
    if (!name || !value)
      continue;
    if (testInfo.attachments.some((attachment) => attachment.name === name))
      continue;
    testInfo.attachments.push({ name, contentType: "text/plain", body: Buffer.from(value) });
  }
}
function resolveFileToConfig(file) {
  const config2 = test.info().config.configFile;
  if (!config2 || !file)
    return file;
  if (import_path.default.isAbsolute(file))
    return file;
  return import_path.default.resolve(import_path.default.dirname(config2), file);
}
function resolveClientCerticates(clientCertificates) {
  for (const cert of clientCertificates) {
    cert.certPath = resolveFileToConfig(cert.certPath);
    cert.keyPath = resolveFileToConfig(cert.keyPath);
    cert.pfxPath = resolveFileToConfig(cert.pfxPath);
  }
  return clientCertificates;
}
const kTracingStarted = Symbol("kTracingStarted");
function connectOptionsFromEnv() {
  const wsEndpoint = process.env.PW_TEST_CONNECT_WS_ENDPOINT;
  if (!wsEndpoint)
    return void 0;
  const headers = process.env.PW_TEST_CONNECT_HEADERS ? JSON.parse(process.env.PW_TEST_CONNECT_HEADERS) : void 0;
  return {
    wsEndpoint,
    headers,
    exposeNetwork: process.env.PW_TEST_CONNECT_EXPOSE_NETWORK
  };
}
class SnapshotRecorder {
  constructor(_artifactsRecorder, _mode, _name, _contentType, _extension, _doSnapshot) {
    this._artifactsRecorder = _artifactsRecorder;
    this._mode = _mode;
    this._name = _name;
    this._contentType = _contentType;
    this._extension = _extension;
    this._doSnapshot = _doSnapshot;
    this._ordinal = 0;
    this._temporary = [];
  }
  fixOrdinal() {
    this._ordinal = this.testInfo.attachments.filter((a) => a.name === this._name).length;
  }
  shouldCaptureUponFinish() {
    return this._mode === "on" || this._mode === "only-on-failure" && this.testInfo._isFailure() || this._mode === "on-first-failure" && this.testInfo._isFailure() && this.testInfo.retry === 0;
  }
  async maybeCapture() {
    if (!this.shouldCaptureUponFinish())
      return;
    await Promise.all(this._artifactsRecorder._playwright._allPages().map((page) => this._snapshotPage(page, false)));
  }
  async persistTemporary() {
    if (this.shouldCaptureUponFinish()) {
      await Promise.all(this._temporary.map(async (file) => {
        try {
          const path2 = this._createAttachmentPath();
          await import_fs.default.promises.rename(file, path2);
          this._attach(path2);
        } catch {
        }
      }));
    }
  }
  async captureTemporary(context) {
    if (this._mode === "on" || this._mode === "only-on-failure" || this._mode === "on-first-failure" && this.testInfo.retry === 0)
      await Promise.all(context.pages().map((page) => this._snapshotPage(page, true)));
  }
  _attach(screenshotPath) {
    this.testInfo.attachments.push({ name: this._name, path: screenshotPath, contentType: this._contentType });
  }
  _createAttachmentPath() {
    const testFailed = this.testInfo._isFailure();
    const index = this._ordinal + 1;
    ++this._ordinal;
    const path2 = this.testInfo.outputPath(`test-${testFailed ? "failed" : "finished"}-${index}${this._extension}`);
    return path2;
  }
  _createTemporaryArtifact(...name) {
    const file = import_path.default.join(this._artifactsRecorder._artifactsDir, ...name);
    return file;
  }
  async _snapshotPage(page, temporary) {
    if (page[this.testInfo._uniqueSymbol])
      return;
    page[this.testInfo._uniqueSymbol] = true;
    try {
      const path2 = temporary ? this._createTemporaryArtifact(createGuid() + this._extension) : this._createAttachmentPath();
      await this._doSnapshot(page, path2);
      if (temporary)
        this._temporary.push(path2);
      else
        this._attach(path2);
    } catch {
    }
  }
  get testInfo() {
    return this._artifactsRecorder._testInfo;
  }
}
class ArtifactsRecorder {
  constructor(playwright, artifactsDir, screenshot) {
    this._playwright = playwright;
    this._artifactsDir = artifactsDir;
    const screenshotOptions = typeof screenshot === "string" ? void 0 : screenshot;
    this._startedCollectingArtifacts = Symbol("startedCollectingArtifacts");
    this._screenshotRecorder = new SnapshotRecorder(this, normalizeScreenshotMode(screenshot), "screenshot", "image/png", ".png", async (page, path2) => {
      await page._wrapApiCall(async () => {
        await page.screenshot({ ...screenshotOptions, timeout: 5e3, path: path2, caret: "initial" });
      }, { internal: true });
    });
  }
  async willStartTest(testInfo) {
    this._testInfo = testInfo;
    testInfo._onDidFinishTestFunctionCallbacks.add(() => this.didFinishTestFunction());
    this._screenshotRecorder.fixOrdinal();
    await Promise.all(this._playwright._allContexts().map((context) => this.didCreateBrowserContext(context)));
    const existingApiRequests = Array.from(this._playwright.request._contexts);
    await Promise.all(existingApiRequests.map((c) => this.didCreateRequestContext(c)));
  }
  async didCreateBrowserContext(context) {
    await this._startTraceChunkOnContextCreation(context, context.tracing);
  }
  async willCloseBrowserContext(context) {
    await this._stopTracing(context, context.tracing);
    await this._screenshotRecorder.captureTemporary(context);
    await this._takePageSnapshot(context);
  }
  async _takePageSnapshot(context) {
    if (process.env.PLAYWRIGHT_NO_COPY_PROMPT)
      return;
    if (this._testInfo.errors.length === 0)
      return;
    if (this._testInfo.errors.some((e) => e.errorContext))
      return;
    if (this._pageSnapshot)
      return;
    const page = context.pages()[0];
    if (!page)
      return;
    try {
      await page._wrapApiCall(async () => {
        this._pageSnapshot = await page.ariaSnapshot({ mode: "ai", timeout: 5e3 });
      }, { internal: true });
    } catch {
    }
  }
  async didCreateRequestContext(context) {
    await this._startTraceChunkOnContextCreation(context, context.tracing);
  }
  async willCloseRequestContext(context) {
    await this._stopTracing(context, context.tracing);
  }
  async didFinishTestFunction() {
    await this._screenshotRecorder.maybeCapture();
  }
  async didFinishTest() {
    await this.didFinishTestFunction();
    const leftoverContexts = this._playwright._allContexts();
    const leftoverApiRequests = Array.from(this._playwright.request._contexts);
    await Promise.all(leftoverContexts.map(async (context2) => {
      await this._stopTracing(context2, context2.tracing);
    }).concat(leftoverApiRequests.map(async (context2) => {
      await this._stopTracing(context2, context2.tracing);
    })));
    await this._screenshotRecorder.persistTemporary();
    const context = leftoverContexts[0];
    if (context)
      await this._takePageSnapshot(context);
    if (this._testInfo.errors.length > 0) {
      const hasMatcherAriaSnapshot = this._testInfo.errors.some((e) => e.errorContext);
      const errorContextContent = (0, import_errorContext.buildErrorContext)({
        titlePath: this._testInfo.titlePath,
        location: { file: this._testInfo.file, line: this._testInfo.line, column: this._testInfo.column },
        errors: this._testInfo.errors,
        pageSnapshot: hasMatcherAriaSnapshot ? void 0 : this._pageSnapshot
      });
      if (errorContextContent) {
        const filePath = this._testInfo.outputPath("error-context.md");
        await import_fs.default.promises.writeFile(filePath, errorContextContent, "utf8");
        this._testInfo._attach({
          name: "error-context",
          contentType: "text/markdown",
          path: filePath
        }, void 0);
      }
    }
  }
  async _startTraceChunkOnContextCreation(channelOwner, tracing2) {
    await channelOwner._wrapApiCall(async () => {
      const options = this._testInfo._tracing.traceOptions();
      if (options) {
        const title = this._testInfo._tracing.traceTitle();
        const name = this._testInfo._tracing.generateNextTraceRecordingName();
        if (!tracing2[kTracingStarted]) {
          await tracing2.start({ ...options, title, name });
          tracing2[kTracingStarted] = true;
        } else {
          await tracing2.startChunk({ title, name });
        }
      } else {
        if (tracing2[kTracingStarted]) {
          tracing2[kTracingStarted] = false;
          await tracing2.stop();
        }
      }
    }, { internal: true });
  }
  async _stopTracing(channelOwner, tracing2) {
    await channelOwner._wrapApiCall(async () => {
      if (tracing2[this._startedCollectingArtifacts])
        return;
      tracing2[this._startedCollectingArtifacts] = true;
      if (this._testInfo._tracing.traceOptions() && tracing2[kTracingStarted])
        await tracing2.stopChunk({ path: this._testInfo._tracing.maybeGenerateNextTraceRecordingPath() });
    }, { internal: true });
  }
}
async function installScreencastTitleUpdater(testInfo, context, testAnnotate) {
  if (!testAnnotate)
    return;
  const testTitle = testAnnotate.level === "file" ? [testInfo.titlePath[0]] : testInfo.titlePath;
  const stepStack = [];
  const overlays = /* @__PURE__ */ new Map();
  const position = testAnnotate.position ?? "top-left";
  const fontSize = testAnnotate.fontSize ?? 14;
  const level = testAnnotate.level ?? "step";
  const updateOverlay = async () => {
    const parts = level === "step" ? [...testTitle, ...stepStack] : testTitle;
    const html = createTestOverlay(parts, position, fontSize);
    for (const page of context.pages()) {
      await overlays.get(page)?.dispose();
      overlays.delete(page);
      const disposable = await page.screencast.showOverlay(html);
      overlays.set(page, disposable);
    }
  };
  testInfo._onUserStepBegin = async (title) => {
    stepStack.push(title);
    await updateOverlay();
  };
  testInfo._onUserStepEnd = async () => {
    stepStack.pop();
    await updateOverlay();
  };
  context.on("page", async () => {
    void updateOverlay();
  });
  await updateOverlay();
}
function createTestOverlay(parts, position, fontSize) {
  const positionStyles = {
    "top-left": "top: 6px; left: 6px;",
    "top": "top: 6px; left: 50%; transform: translateX(-50%);",
    "top-right": "top: 6px; right: 6px;",
    "bottom-left": "bottom: 6px; left: 6px;",
    "bottom": "bottom: 6px; left: 50%; transform: translateX(-50%);",
    "bottom-right": "bottom: 6px; right: 6px;"
  };
  const posStyle = positionStyles[position] ?? positionStyles["top-left"];
  return `<div style="white-space: nowrap; font-size: ${fontSize}px; padding: 3px 6px; background: rgba(0,0,0,0.5); color: white; border-radius: 4px; position: absolute; ${posStyle}">
    ${parts.map((p) => `<div>${escapeHTML(p)}</div>`).join("")}
  </div>`;
}
function renderTitle(type, method, params, title) {
  const prefix = renderTitleForCall({ title, type, method, params });
  let selector;
  if (params?.["selector"] && typeof params.selector === "string")
    selector = asLocatorDescription("javascript", params.selector);
  return prefix + (selector ? ` ${selector}` : "");
}
function tracing() {
  return test.info()._tracing;
}
const test = _utilityTest.extend(playwrightFixtures);
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  _baseTest,
  _utilityTest,
  defineConfig,
  expect,
  mergeExpects,
  mergeTests,
  test
});
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);

// packages/playwright/src/isomorphic/index.ts
var index_exports = {};
__export(index_exports, {
  TestServerConnection: () => TestServerConnection,
  TestServerConnectionClosedError: () => TestServerConnectionClosedError,
  WebSocketTestServerTransport: () => WebSocketTestServerTransport
});
module.exports = __toCommonJS(index_exports);

// packages/playwright/src/isomorphic/events.ts
var Disposable;
((Disposable2) => {
  function disposeAll(disposables) {
    for (const disposable of disposables.splice(0))
      disposable.dispose();
  }
  Disposable2.disposeAll = disposeAll;
})(Disposable || (Disposable = {}));
var EventEmitter = class {
  constructor() {
    this._listeners = /* @__PURE__ */ new Set();
    this.event = (listener, disposables) => {
      this._listeners.add(listener);
      let disposed = false;
      const self = this;
      const result = {
        dispose() {
          if (!disposed) {
            disposed = true;
            self._listeners.delete(listener);
          }
        }
      };
      if (disposables)
        disposables.push(result);
      return result;
    };
  }
  fire(event) {
    const dispatch = !this._deliveryQueue;
    if (!this._deliveryQueue)
      this._deliveryQueue = [];
    for (const listener of this._listeners)
      this._deliveryQueue.push({ listener, event });
    if (!dispatch)
      return;
    for (let index = 0; index < this._deliveryQueue.length; index++) {
      const { listener, event: event2 } = this._deliveryQueue[index];
      listener.call(null, event2);
    }
    this._deliveryQueue = void 0;
  }
  dispose() {
    this._listeners.clear();
    if (this._deliveryQueue)
      this._deliveryQueue = [];
  }
};

// packages/playwright/src/isomorphic/testServerConnection.ts
var TestServerConnectionClosedError = class extends Error {
};
var WebSocketTestServerTransport = class {
  constructor(url) {
    this._ws = new WebSocket(url);
  }
  onmessage(listener) {
    this._ws.addEventListener("message", (event) => listener(event.data.toString()));
  }
  onopen(listener) {
    this._ws.addEventListener("open", listener);
  }
  onerror(listener) {
    this._ws.addEventListener("error", listener);
  }
  onclose(listener) {
    this._ws.addEventListener("close", listener);
  }
  send(data) {
    this._ws.send(data);
  }
  close() {
    this._ws.close();
  }
};
var TestServerConnection = class {
  constructor(transport) {
    this._onCloseEmitter = new EventEmitter();
    this._onReportEmitter = new EventEmitter();
    this._onStdioEmitter = new EventEmitter();
    this._onTestFilesChangedEmitter = new EventEmitter();
    this._onLoadTraceRequestedEmitter = new EventEmitter();
    this._onTestPausedEmitter = new EventEmitter();
    this._lastId = 0;
    this._callbacks = /* @__PURE__ */ new Map();
    this._isClosed = false;
    this.onClose = this._onCloseEmitter.event;
    this.onReport = this._onReportEmitter.event;
    this.onStdio = this._onStdioEmitter.event;
    this.onTestFilesChanged = this._onTestFilesChangedEmitter.event;
    this.onLoadTraceRequested = this._onLoadTraceRequestedEmitter.event;
    this.onTestPaused = this._onTestPausedEmitter.event;
    this._transport = transport;
    this._transport.onmessage((data) => {
      const message = JSON.parse(data);
      const { id, result, error, method, params } = message;
      if (id) {
        const callback = this._callbacks.get(id);
        if (!callback)
          return;
        this._callbacks.delete(id);
        if (error)
          callback.reject(new Error(error));
        else
          callback.resolve(result);
      } else {
        this._dispatchEvent(method, params);
      }
    });
    const pingInterval = setInterval(() => this._sendMessage("ping").catch(() => {
    }), 3e4);
    this._connectedPromise = new Promise((f, r) => {
      this._transport.onopen(f);
      this._transport.onerror(r);
    });
    this._transport.onclose(() => {
      this._isClosed = true;
      this._onCloseEmitter.fire();
      clearInterval(pingInterval);
      for (const callback of this._callbacks.values())
        callback.reject(callback.error);
      this._callbacks.clear();
    });
  }
  isClosed() {
    return this._isClosed;
  }
  async _sendMessage(method, params) {
    const logForTest = globalThis.__logForTest;
    logForTest?.({ method, params });
    await this._connectedPromise;
    const id = ++this._lastId;
    const message = { id, method, params };
    const error = new TestServerConnectionClosedError(`${method}: test server connection closed`);
    this._transport.send(JSON.stringify(message));
    return new Promise((resolve, reject) => {
      this._callbacks.set(id, { resolve, reject, error });
    });
  }
  _sendMessageNoReply(method, params) {
    this._sendMessage(method, params).catch(() => {
    });
  }
  _dispatchEvent(method, params) {
    if (method === "report")
      this._onReportEmitter.fire(params);
    else if (method === "stdio")
      this._onStdioEmitter.fire(params);
    else if (method === "testFilesChanged")
      this._onTestFilesChangedEmitter.fire(params);
    else if (method === "loadTraceRequested")
      this._onLoadTraceRequestedEmitter.fire(params);
    else if (method === "testPaused")
      this._onTestPausedEmitter.fire(params);
  }
  async initialize(params) {
    await this._sendMessage("initialize", params);
  }
  async ping(params) {
    await this._sendMessage("ping", params);
  }
  async pingNoReply(params) {
    this._sendMessageNoReply("ping", params);
  }
  async watch(params) {
    await this._sendMessage("watch", params);
  }
  watchNoReply(params) {
    this._sendMessageNoReply("watch", params);
  }
  async open(params) {
    await this._sendMessage("open", params);
  }
  openNoReply(params) {
    this._sendMessageNoReply("open", params);
  }
  async resizeTerminal(params) {
    await this._sendMessage("resizeTerminal", params);
  }
  resizeTerminalNoReply(params) {
    this._sendMessageNoReply("resizeTerminal", params);
  }
  async checkBrowsers(params) {
    return await this._sendMessage("checkBrowsers", params);
  }
  async installBrowsers(params) {
    await this._sendMessage("installBrowsers", params);
  }
  async runGlobalSetup(params) {
    return await this._sendMessage("runGlobalSetup", params);
  }
  async runGlobalTeardown(params) {
    return await this._sendMessage("runGlobalTeardown", params);
  }
  async clearCache(params) {
    return await this._sendMessage("clearCache", params);
  }
  async listFiles(params) {
    return await this._sendMessage("listFiles", params);
  }
  async listTests(params) {
    return await this._sendMessage("listTests", params);
  }
  async runTests(params) {
    return await this._sendMessage("runTests", params);
  }
  async findRelatedTestFiles(params) {
    return await this._sendMessage("findRelatedTestFiles", params);
  }
  async stopTests(params) {
    await this._sendMessage("stopTests", params);
  }
  stopTestsNoReply(params) {
    this._sendMessageNoReply("stopTests", params);
  }
  async closeGracefully(params) {
    await this._sendMessage("closeGracefully", params);
  }
  close() {
    try {
      this._transport.close();
    } catch {
    }
  }
};
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  TestServerConnection,
  TestServerConnectionClosedError,
  WebSocketTestServerTransport
});
# packages/playwright/lib/isomorphic.js
# total: 8.0 KB

## Inlined (3)
  1.3 KB  packages/playwright/src/isomorphic/events.ts
  0.3 KB  packages/playwright/src/isomorphic/index.ts
  5.3 KB  packages/playwright/src/isomorphic/testServerConnection.ts

## External (0)
"use strict";

// packages/playwright/src/loader/loaderProcessEntry.ts
var import_common2 = require("../common");

// packages/playwright/src/loader/loaderMain.ts
var import_common = require("../common");
var LoaderMain = class extends import_common.ProcessRunner {
  constructor(serializedConfig) {
    super();
    this._poolBuilder = import_common.poolBuilder.PoolBuilder.createForLoader();
    this._serializedConfig = serializedConfig;
  }
  _config() {
    if (!this._configPromise)
      this._configPromise = import_common.configLoader.deserializeConfig(this._serializedConfig);
    return this._configPromise;
  }
  async loadTestFile(params) {
    const testErrors = [];
    const config = await this._config();
    const fileSuite = await import_common.testLoader.loadTestFile(params.file, config, testErrors);
    this._poolBuilder.buildPools(fileSuite);
    return { fileSuite: fileSuite._deepSerialize(), testErrors };
  }
  async getCompilationCacheFromLoader() {
    await import_common.transform.incorporateCompilationCache();
    return import_common.cc.serializeCompilationCache();
  }
};
var create = (config) => new LoaderMain(config);

// packages/playwright/src/loader/loaderProcessEntry.ts
(0, import_common2.startProcessRunner)(create);
# packages/playwright/lib/loader/loaderProcessEntry.js
# total: 1.2 KB

## Inlined (2)
  1.0 KB  packages/playwright/src/loader/loaderMain.ts
  0.1 KB  packages/playwright/src/loader/loaderProcessEntry.ts

## External (1)
  ../common
"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __commonJS = (cb, mod) => function __require() {
  return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
};
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  // If the importer is in node compatibility mode or this is not an ESM
  // file that has been converted to a CommonJS file using a Babel-
  // compatible transform (i.e. "__esModule" has not been set), then set
  // "default" to the CommonJS "module.exports" for node compatibility.
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);

// node_modules/@jest/get-type/build/index.js
var require_build = __commonJS({
  "node_modules/@jest/get-type/build/index.js"(exports2, module2) {
    (() => {
      "use strict";
      var __webpack_exports__ = {};
      (() => {
        var exports3 = __webpack_exports__;
        Object.defineProperty(exports3, "__esModule", {
          value: true
        });
        exports3.getType = getType2;
        exports3.isPrimitive = void 0;
        function getType2(value) {
          if (value === void 0) {
            return "undefined";
          } else if (value === null) {
            return "null";
          } else if (Array.isArray(value)) {
            return "array";
          } else if (typeof value === "boolean") {
            return "boolean";
          } else if (typeof value === "function") {
            return "function";
          } else if (typeof value === "number") {
            return "number";
          } else if (typeof value === "string") {
            return "string";
          } else if (typeof value === "bigint") {
            return "bigint";
          } else if (typeof value === "object") {
            if (value.constructor === RegExp) {
              return "regexp";
            } else if (value.constructor === Map) {
              return "map";
            } else if (value.constructor === Set) {
              return "set";
            } else if (value.constructor === Date) {
              return "date";
            }
            return "object";
          } else if (typeof value === "symbol") {
            return "symbol";
          }
          throw new Error(`value of unknown type: ${value}`);
        }
        const isPrimitive2 = (value) => Object(value) !== value;
        exports3.isPrimitive = isPrimitive2;
      })();
      module2.exports = __webpack_exports__;
    })();
  }
});

// node_modules/@jest/expect-utils/build/index.js
var require_build2 = __commonJS({
  "node_modules/@jest/expect-utils/build/index.js"(exports2, module2) {
    (() => {
      "use strict";
      var __webpack_modules__ = {
        /***/
        "./src/immutableUtils.ts": (
          /***/
          ((__unused_webpack_module, exports3) => {
            Object.defineProperty(exports3, "__esModule", {
              value: true
            });
            exports3.isImmutableList = isImmutableList;
            exports3.isImmutableOrderedKeyed = isImmutableOrderedKeyed;
            exports3.isImmutableOrderedSet = isImmutableOrderedSet;
            exports3.isImmutableRecord = isImmutableRecord;
            exports3.isImmutableUnorderedKeyed = isImmutableUnorderedKeyed;
            exports3.isImmutableUnorderedSet = isImmutableUnorderedSet;
            const IS_KEYED_SENTINEL = "@@__IMMUTABLE_KEYED__@@";
            const IS_SET_SENTINEL = "@@__IMMUTABLE_SET__@@";
            const IS_LIST_SENTINEL = "@@__IMMUTABLE_LIST__@@";
            const IS_ORDERED_SENTINEL = "@@__IMMUTABLE_ORDERED__@@";
            const IS_RECORD_SYMBOL = "@@__IMMUTABLE_RECORD__@@";
            function isObjectLiteral(source) {
              return source != null && typeof source === "object" && !Array.isArray(source);
            }
            function isImmutableUnorderedKeyed(source) {
              return Boolean(source && isObjectLiteral(source) && source[IS_KEYED_SENTINEL] && !source[IS_ORDERED_SENTINEL]);
            }
            function isImmutableUnorderedSet(source) {
              return Boolean(source && isObjectLiteral(source) && source[IS_SET_SENTINEL] && !source[IS_ORDERED_SENTINEL]);
            }
            function isImmutableList(source) {
              return Boolean(source && isObjectLiteral(source) && source[IS_LIST_SENTINEL]);
            }
            function isImmutableOrderedKeyed(source) {
              return Boolean(source && isObjectLiteral(source) && source[IS_KEYED_SENTINEL] && source[IS_ORDERED_SENTINEL]);
            }
            function isImmutableOrderedSet(source) {
              return Boolean(source && isObjectLiteral(source) && source[IS_SET_SENTINEL] && source[IS_ORDERED_SENTINEL]);
            }
            function isImmutableRecord(source) {
              return Boolean(source && isObjectLiteral(source) && source[IS_RECORD_SYMBOL]);
            }
          })
        ),
        /***/
        "./src/index.ts": (
          /***/
          ((__unused_webpack_module, exports3, __webpack_require__2) => {
            Object.defineProperty(exports3, "__esModule", {
              value: true
            });
            var _exportNames = {
              equals: true,
              isA: true
            };
            Object.defineProperty(exports3, "equals", {
              enumerable: true,
              get: function() {
                return _jasmineUtils.equals;
              }
            });
            Object.defineProperty(exports3, "isA", {
              enumerable: true,
              get: function() {
                return _jasmineUtils.isA;
              }
            });
            var _jasmineUtils = __webpack_require__2("./src/jasmineUtils.ts");
            var _utils = __webpack_require__2("./src/utils.ts");
            Object.keys(_utils).forEach(function(key) {
              if (key === "default" || key === "__esModule") return;
              if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
              if (key in exports3 && exports3[key] === _utils[key]) return;
              Object.defineProperty(exports3, key, {
                enumerable: true,
                get: function() {
                  return _utils[key];
                }
              });
            });
          })
        ),
        /***/
        "./src/jasmineUtils.ts": (
          /***/
          ((__unused_webpack_module, exports3) => {
            Object.defineProperty(exports3, "__esModule", {
              value: true
            });
            exports3.equals = void 0;
            exports3.isA = isA2;
            const equals2 = (a, b, customTesters, strictCheck) => {
              customTesters = customTesters || [];
              return eq(a, b, [], [], customTesters, strictCheck);
            };
            exports3.equals = equals2;
            function isAsymmetric(obj) {
              return !!obj && isA2("Function", obj.asymmetricMatch);
            }
            function asymmetricMatch(a, b) {
              const asymmetricA = isAsymmetric(a);
              const asymmetricB = isAsymmetric(b);
              if (asymmetricA && asymmetricB) {
                return void 0;
              }
              if (asymmetricA) {
                return a.asymmetricMatch(b);
              }
              if (asymmetricB) {
                return b.asymmetricMatch(a);
              }
            }
            function eq(a, b, aStack, bStack, customTesters, strictCheck) {
              let result = true;
              const asymmetricResult = asymmetricMatch(a, b);
              if (asymmetricResult !== void 0) {
                return asymmetricResult;
              }
              const testerContext = {
                equals: equals2
              };
              for (const item of customTesters) {
                const customTesterResult = item.call(testerContext, a, b, customTesters);
                if (customTesterResult !== void 0) {
                  return customTesterResult;
                }
              }
              if (a instanceof Error && b instanceof Error) {
                return a.message === b.message;
              }
              if (Object.is(a, b)) {
                return true;
              }
              if (a === null || b === null) {
                return false;
              }
              const className = Object.prototype.toString.call(a);
              if (className !== Object.prototype.toString.call(b)) {
                return false;
              }
              switch (className) {
                case "[object Boolean]":
                case "[object String]":
                case "[object Number]":
                  if (typeof a !== typeof b) {
                    return false;
                  } else if (typeof a !== "object" && typeof b !== "object") {
                    return false;
                  } else {
                    return Object.is(a.valueOf(), b.valueOf());
                  }
                case "[object Date]":
                  return +a === +b;
                // RegExps are compared by their source patterns and flags.
                case "[object RegExp]":
                  return a.source === b.source && a.flags === b.flags;
                // URLs are compared by their href property which contains the entire url string.
                case "[object URL]":
                  return a.href === b.href;
              }
              if (typeof a !== "object" || typeof b !== "object") {
                return false;
              }
              if (isDomNode(a) && isDomNode(b)) {
                return a.isEqualNode(b);
              }
              let length = aStack.length;
              while (length--) {
                if (aStack[length] === a) {
                  return bStack[length] === b;
                } else if (bStack[length] === b) {
                  return false;
                }
              }
              aStack.push(a);
              bStack.push(b);
              if (strictCheck && className === "[object Array]" && a.length !== b.length) {
                return false;
              }
              const aKeys = keys(a, hasKey);
              let key;
              const bKeys = keys(b, hasKey);
              if (!strictCheck) {
                for (let index = 0; index !== bKeys.length; ++index) {
                  key = bKeys[index];
                  if ((isAsymmetric(b[key]) || b[key] === void 0) && !hasKey(a, key)) {
                    aKeys.push(key);
                  }
                }
                for (let index = 0; index !== aKeys.length; ++index) {
                  key = aKeys[index];
                  if ((isAsymmetric(a[key]) || a[key] === void 0) && !hasKey(b, key)) {
                    bKeys.push(key);
                  }
                }
              }
              let size = aKeys.length;
              if (bKeys.length !== size) {
                return false;
              }
              while (size--) {
                key = aKeys[size];
                if (strictCheck) result = hasKey(b, key) && eq(a[key], b[key], aStack, bStack, customTesters, strictCheck);
                else result = (hasKey(b, key) || isAsymmetric(a[key]) || a[key] === void 0) && eq(a[key], b[key], aStack, bStack, customTesters, strictCheck);
                if (!result) {
                  return false;
                }
              }
              aStack.pop();
              bStack.pop();
              return result;
            }
            function keys(obj, hasKey2) {
              const keys2 = [];
              for (const key in obj) {
                if (hasKey2(obj, key)) {
                  keys2.push(key);
                }
              }
              return [...keys2, ...Object.getOwnPropertySymbols(obj).filter((symbol) => Object.getOwnPropertyDescriptor(obj, symbol).enumerable)];
            }
            function hasKey(obj, key) {
              return Object.prototype.hasOwnProperty.call(obj, key);
            }
            function isA2(typeName, value) {
              return Object.prototype.toString.apply(value) === `[object ${typeName}]`;
            }
            function isDomNode(obj) {
              return obj !== null && typeof obj === "object" && typeof obj.nodeType === "number" && typeof obj.nodeName === "string" && typeof obj.isEqualNode === "function";
            }
          })
        ),
        /***/
        "./src/utils.ts": (
          /***/
          ((__unused_webpack_module, exports3, __webpack_require__2) => {
            Object.defineProperty(exports3, "__esModule", {
              value: true
            });
            exports3.arrayBufferEquality = void 0;
            exports3.emptyObject = emptyObject2;
            exports3.typeEquality = exports3.subsetEquality = exports3.sparseArrayEquality = exports3.pathAsArray = exports3.partition = exports3.iterableEquality = exports3.isOneline = exports3.isError = exports3.getPath = exports3.getObjectSubset = exports3.getObjectKeys = void 0;
            var _getType = require_build();
            var _immutableUtils = __webpack_require__2("./src/immutableUtils.ts");
            var _jasmineUtils = __webpack_require__2("./src/jasmineUtils.ts");
            var Symbol2 = globalThis["jest-symbol-do-not-touch"] || globalThis.Symbol;
            const hasPropertyInObject = (object, key) => {
              const shouldTerminate = !object || typeof object !== "object" || object === Object.prototype;
              if (shouldTerminate) {
                return false;
              }
              return Object.prototype.hasOwnProperty.call(object, key) || hasPropertyInObject(Object.getPrototypeOf(object), key);
            };
            const getObjectKeys2 = (object) => {
              return [...Object.keys(object), ...Object.getOwnPropertySymbols(object).filter((s) => Object.getOwnPropertyDescriptor(object, s)?.enumerable)];
            };
            exports3.getObjectKeys = getObjectKeys2;
            const getPath2 = (object, propertyPath) => {
              if (!Array.isArray(propertyPath)) {
                propertyPath = pathAsArray2(propertyPath);
              }
              if (propertyPath.length > 0) {
                const lastProp = propertyPath.length === 1;
                const prop = propertyPath[0];
                const newObject = object[prop];
                if (!lastProp && (newObject === null || newObject === void 0)) {
                  return {
                    hasEndProp: false,
                    lastTraversedObject: object,
                    traversedPath: []
                  };
                }
                const result = getPath2(newObject, propertyPath.slice(1));
                if (result.lastTraversedObject === null) {
                  result.lastTraversedObject = object;
                }
                result.traversedPath.unshift(prop);
                if (lastProp) {
                  result.endPropIsDefined = !(0, _getType.isPrimitive)(object) && prop in object;
                  result.hasEndProp = newObject !== void 0 || result.endPropIsDefined;
                  if (!result.hasEndProp) {
                    result.traversedPath.shift();
                  }
                }
                return result;
              }
              return {
                lastTraversedObject: null,
                traversedPath: [],
                value: object
              };
            };
            exports3.getPath = getPath2;
            const getObjectSubset2 = (object, subset, customTesters = [], seenReferences = /* @__PURE__ */ new WeakMap()) => {
              if (Array.isArray(object)) {
                if (Array.isArray(subset) && subset.length === object.length) {
                  return subset.map((sub, i) => getObjectSubset2(object[i], sub, customTesters));
                }
              } else if (object instanceof Date) {
                return object;
              } else if (isObject2(object) && isObject2(subset)) {
                if ((0, _jasmineUtils.equals)(object, subset, [...customTesters, iterableEquality2, subsetEquality2])) {
                  return subset;
                }
                const trimmed = {};
                seenReferences.set(object, trimmed);
                for (const key of getObjectKeys2(object).filter((key2) => hasPropertyInObject(subset, key2))) {
                  trimmed[key] = seenReferences.has(object[key]) ? seenReferences.get(object[key]) : getObjectSubset2(object[key], subset[key], customTesters, seenReferences);
                }
                if (getObjectKeys2(trimmed).length > 0) {
                  return trimmed;
                }
              }
              return object;
            };
            exports3.getObjectSubset = getObjectSubset2;
            const IteratorSymbol = Symbol2.iterator;
            const hasIterator = (object) => !!(object != null && object[IteratorSymbol]);
            const iterableEquality2 = (a, b, customTesters = [], aStack = [], bStack = []) => {
              if (typeof a !== "object" || typeof b !== "object" || Array.isArray(a) || Array.isArray(b) || ArrayBuffer.isView(a) || ArrayBuffer.isView(b) || !hasIterator(a) || !hasIterator(b)) {
                return void 0;
              }
              if (a.constructor !== b.constructor) {
                return false;
              }
              let length = aStack.length;
              while (length--) {
                if (aStack[length] === a) {
                  return bStack[length] === b;
                }
              }
              aStack.push(a);
              bStack.push(b);
              const iterableEqualityWithStack = (a2, b2) => iterableEquality2(a2, b2, [...filteredCustomTesters], [...aStack], [...bStack]);
              const filteredCustomTesters = [...customTesters.filter((t) => t !== iterableEquality2), iterableEqualityWithStack];
              if (a.size !== void 0) {
                if (a.size !== b.size) {
                  return false;
                } else if ((0, _jasmineUtils.isA)("Set", a) || (0, _immutableUtils.isImmutableUnorderedSet)(a)) {
                  let allFound = true;
                  for (const aValue of a) {
                    if (!b.has(aValue)) {
                      let has = false;
                      for (const bValue of b) {
                        const isEqual = (0, _jasmineUtils.equals)(aValue, bValue, filteredCustomTesters);
                        if (isEqual === true) {
                          has = true;
                        }
                      }
                      if (has === false) {
                        allFound = false;
                        break;
                      }
                    }
                  }
                  aStack.pop();
                  bStack.pop();
                  return allFound;
                } else if ((0, _jasmineUtils.isA)("Map", a) || (0, _immutableUtils.isImmutableUnorderedKeyed)(a)) {
                  let allFound = true;
                  for (const aEntry of a) {
                    if (!b.has(aEntry[0]) || !(0, _jasmineUtils.equals)(aEntry[1], b.get(aEntry[0]), filteredCustomTesters)) {
                      let has = false;
                      for (const bEntry of b) {
                        const matchedKey = (0, _jasmineUtils.equals)(aEntry[0], bEntry[0], filteredCustomTesters);
                        let matchedValue = false;
                        if (matchedKey === true) {
                          matchedValue = (0, _jasmineUtils.equals)(aEntry[1], bEntry[1], filteredCustomTesters);
                        }
                        if (matchedValue === true) {
                          has = true;
                        }
                      }
                      if (has === false) {
                        allFound = false;
                        break;
                      }
                    }
                  }
                  aStack.pop();
                  bStack.pop();
                  return allFound;
                }
              }
              const bIterator = b[IteratorSymbol]();
              for (const aValue of a) {
                const nextB = bIterator.next();
                if (nextB.done || !(0, _jasmineUtils.equals)(aValue, nextB.value, filteredCustomTesters)) {
                  return false;
                }
              }
              if (!bIterator.next().done) {
                return false;
              }
              if (!(0, _immutableUtils.isImmutableList)(a) && !(0, _immutableUtils.isImmutableOrderedKeyed)(a) && !(0, _immutableUtils.isImmutableOrderedSet)(a) && !(0, _immutableUtils.isImmutableRecord)(a)) {
                const aEntries = entries(a);
                const bEntries = entries(b);
                if (!(0, _jasmineUtils.equals)(aEntries, bEntries)) {
                  return false;
                }
              }
              aStack.pop();
              bStack.pop();
              return true;
            };
            exports3.iterableEquality = iterableEquality2;
            const entries = (obj) => {
              if (!isObject2(obj)) return [];
              const symbolProperties = Object.getOwnPropertySymbols(obj).filter((key) => key !== Symbol2.iterator).map((key) => [key, obj[key]]);
              return [...symbolProperties, ...Object.entries(obj)];
            };
            const isObject2 = (a) => a !== null && typeof a === "object";
            const isObjectWithKeys = (a) => isObject2(a) && !(a instanceof Error) && !Array.isArray(a) && !(a instanceof Date) && !(a instanceof Set) && !(a instanceof Map);
            const subsetEquality2 = (object, subset, customTesters = []) => {
              const filteredCustomTesters = customTesters.filter((t) => t !== subsetEquality2);
              const subsetEqualityWithContext = (seenReferences = /* @__PURE__ */ new WeakMap()) => (object2, subset2) => {
                if (!isObjectWithKeys(subset2)) {
                  return void 0;
                }
                if (seenReferences.has(subset2)) return void 0;
                seenReferences.set(subset2, true);
                const matchResult = getObjectKeys2(subset2).every((key) => {
                  if (isObjectWithKeys(subset2[key])) {
                    if (seenReferences.has(subset2[key])) {
                      return (0, _jasmineUtils.equals)(object2[key], subset2[key], filteredCustomTesters);
                    }
                  }
                  const result = object2 != null && hasPropertyInObject(object2, key) && (0, _jasmineUtils.equals)(object2[key], subset2[key], [...filteredCustomTesters, subsetEqualityWithContext(seenReferences)]);
                  seenReferences.delete(subset2[key]);
                  return result;
                });
                seenReferences.delete(subset2);
                return matchResult;
              };
              return subsetEqualityWithContext()(object, subset);
            };
            exports3.subsetEquality = subsetEquality2;
            const typeEquality2 = (a, b) => {
              if (a == null || b == null || a.constructor === b.constructor || // Since Jest globals are different from Node globals,
              // constructors are different even between arrays when comparing properties of mock objects.
              // Both of them should be able to compare correctly when they are array-to-array.
              // https://github.com/jestjs/jest/issues/2549
              Array.isArray(a) && Array.isArray(b)) {
                return void 0;
              }
              return false;
            };
            exports3.typeEquality = typeEquality2;
            const arrayBufferEquality2 = (a, b) => {
              let dataViewA = a;
              let dataViewB = b;
              if (isArrayBuffer(a) && isArrayBuffer(b)) {
                dataViewA = new DataView(a);
                dataViewB = new DataView(b);
              } else if (ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) {
                dataViewA = new DataView(a.buffer, a.byteOffset, a.byteLength);
                dataViewB = new DataView(b.buffer, b.byteOffset, b.byteLength);
              }
              if (!(dataViewA instanceof DataView && dataViewB instanceof DataView)) {
                return void 0;
              }
              if (dataViewA.byteLength !== dataViewB.byteLength) {
                return false;
              }
              for (let i = 0; i < dataViewA.byteLength; i++) {
                if (dataViewA.getUint8(i) !== dataViewB.getUint8(i)) {
                  return false;
                }
              }
              return true;
            };
            exports3.arrayBufferEquality = arrayBufferEquality2;
            function isArrayBuffer(obj) {
              return Object.prototype.toString.call(obj) === "[object ArrayBuffer]";
            }
            const sparseArrayEquality2 = (a, b, customTesters = []) => {
              if (!Array.isArray(a) || !Array.isArray(b)) {
                return void 0;
              }
              const aKeys = Object.keys(a);
              const bKeys = Object.keys(b);
              return (0, _jasmineUtils.equals)(a, b, customTesters.filter((t) => t !== sparseArrayEquality2), true) && (0, _jasmineUtils.equals)(aKeys, bKeys);
            };
            exports3.sparseArrayEquality = sparseArrayEquality2;
            const partition2 = (items, predicate) => {
              const result = [[], []];
              for (const item of items) result[predicate(item) ? 0 : 1].push(item);
              return result;
            };
            exports3.partition = partition2;
            const pathAsArray2 = (propertyPath) => {
              const properties = [];
              if (propertyPath === "") {
                properties.push("");
                return properties;
              }
              const pattern = new RegExp("[^.[\\]]+|(?=(?:\\.)(?:\\.|$))", "g");
              if (propertyPath[0] === ".") {
                properties.push("");
              }
              propertyPath.replaceAll(pattern, (match) => {
                properties.push(match);
                return match;
              });
              return properties;
            };
            exports3.pathAsArray = pathAsArray2;
            const isError2 = (value) => {
              switch (Object.prototype.toString.call(value)) {
                case "[object Error]":
                case "[object Exception]":
                case "[object DOMException]":
                  return true;
                default:
                  return value instanceof Error;
              }
            };
            exports3.isError = isError2;
            function emptyObject2(obj) {
              return obj && typeof obj === "object" ? Object.keys(obj).length === 0 : false;
            }
            const MULTILINE_REGEXP = /[\n\r]/;
            const isOneline2 = (expected, received) => typeof expected === "string" && typeof received === "string" && (!MULTILINE_REGEXP.test(expected) || !MULTILINE_REGEXP.test(received));
            exports3.isOneline = isOneline2;
          })
        )
        /******/
      };
      var __webpack_module_cache__ = {};
      function __webpack_require__(moduleId) {
        var cachedModule = __webpack_module_cache__[moduleId];
        if (cachedModule !== void 0) {
          return cachedModule.exports;
        }
        var module3 = __webpack_module_cache__[moduleId] = {
          /******/
          // no module.id needed
          /******/
          // no module.loaded needed
          /******/
          exports: {}
          /******/
        };
        __webpack_modules__[moduleId](module3, module3.exports, __webpack_require__);
        return module3.exports;
      }
      var __webpack_exports__ = __webpack_require__("./src/index.ts");
      module2.exports = __webpack_exports__;
    })();
  }
});

// node_modules/pretty-format/node_modules/react-is/cjs/react-is.production.min.js
var require_react_is_production_min = __commonJS({
  "node_modules/pretty-format/node_modules/react-is/cjs/react-is.production.min.js"(exports2) {
    "use strict";
    var b = Symbol.for("react.element");
    var c = Symbol.for("react.portal");
    var d = Symbol.for("react.fragment");
    var e = Symbol.for("react.strict_mode");
    var f = Symbol.for("react.profiler");
    var g = Symbol.for("react.provider");
    var h = Symbol.for("react.context");
    var k = Symbol.for("react.server_context");
    var l = Symbol.for("react.forward_ref");
    var m = Symbol.for("react.suspense");
    var n = Symbol.for("react.suspense_list");
    var p = Symbol.for("react.memo");
    var q = Symbol.for("react.lazy");
    var t = Symbol.for("react.offscreen");
    var u;
    u = Symbol.for("react.module.reference");
    function v(a) {
      if ("object" === typeof a && null !== a) {
        var r = a.$$typeof;
        switch (r) {
          case b:
            switch (a = a.type, a) {
              case d:
              case f:
              case e:
              case m:
              case n:
                return a;
              default:
                switch (a = a && a.$$typeof, a) {
                  case k:
                  case h:
                  case l:
                  case q:
                  case p:
                  case g:
                    return a;
                  default:
                    return r;
                }
            }
          case c:
            return r;
        }
      }
    }
    exports2.ContextConsumer = h;
    exports2.ContextProvider = g;
    exports2.Element = b;
    exports2.ForwardRef = l;
    exports2.Fragment = d;
    exports2.Lazy = q;
    exports2.Memo = p;
    exports2.Portal = c;
    exports2.Profiler = f;
    exports2.StrictMode = e;
    exports2.Suspense = m;
    exports2.SuspenseList = n;
    exports2.isAsyncMode = function() {
      return false;
    };
    exports2.isConcurrentMode = function() {
      return false;
    };
    exports2.isContextConsumer = function(a) {
      return v(a) === h;
    };
    exports2.isContextProvider = function(a) {
      return v(a) === g;
    };
    exports2.isElement = function(a) {
      return "object" === typeof a && null !== a && a.$$typeof === b;
    };
    exports2.isForwardRef = function(a) {
      return v(a) === l;
    };
    exports2.isFragment = function(a) {
      return v(a) === d;
    };
    exports2.isLazy = function(a) {
      return v(a) === q;
    };
    exports2.isMemo = function(a) {
      return v(a) === p;
    };
    exports2.isPortal = function(a) {
      return v(a) === c;
    };
    exports2.isProfiler = function(a) {
      return v(a) === f;
    };
    exports2.isStrictMode = function(a) {
      return v(a) === e;
    };
    exports2.isSuspense = function(a) {
      return v(a) === m;
    };
    exports2.isSuspenseList = function(a) {
      return v(a) === n;
    };
    exports2.isValidElementType = function(a) {
      return "string" === typeof a || "function" === typeof a || a === d || a === f || a === e || a === m || a === n || a === t || "object" === typeof a && null !== a && (a.$$typeof === q || a.$$typeof === p || a.$$typeof === g || a.$$typeof === h || a.$$typeof === l || a.$$typeof === u || void 0 !== a.getModuleId) ? true : false;
    };
    exports2.typeOf = v;
  }
});

// node_modules/pretty-format/node_modules/react-is/cjs/react-is.development.js
var require_react_is_development = __commonJS({
  "node_modules/pretty-format/node_modules/react-is/cjs/react-is.development.js"(exports2) {
    "use strict";
    if (process.env.NODE_ENV !== "production") {
      (function() {
        "use strict";
        var REACT_ELEMENT_TYPE = Symbol.for("react.element");
        var REACT_PORTAL_TYPE = Symbol.for("react.portal");
        var REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
        var REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode");
        var REACT_PROFILER_TYPE = Symbol.for("react.profiler");
        var REACT_PROVIDER_TYPE = Symbol.for("react.provider");
        var REACT_CONTEXT_TYPE = Symbol.for("react.context");
        var REACT_SERVER_CONTEXT_TYPE = Symbol.for("react.server_context");
        var REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref");
        var REACT_SUSPENSE_TYPE = Symbol.for("react.suspense");
        var REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list");
        var REACT_MEMO_TYPE = Symbol.for("react.memo");
        var REACT_LAZY_TYPE = Symbol.for("react.lazy");
        var REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen");
        var enableScopeAPI = false;
        var enableCacheElement = false;
        var enableTransitionTracing = false;
        var enableLegacyHidden = false;
        var enableDebugTracing = false;
        var REACT_MODULE_REFERENCE;
        {
          REACT_MODULE_REFERENCE = Symbol.for("react.module.reference");
        }
        function isValidElementType(type) {
          if (typeof type === "string" || typeof type === "function") {
            return true;
          }
          if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing) {
            return true;
          }
          if (typeof type === "object" && type !== null) {
            if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object
            // types supported by any Flight configuration anywhere since
            // we don't know which Flight build this will end up being used
            // with.
            type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== void 0) {
              return true;
            }
          }
          return false;
        }
        function typeOf(object) {
          if (typeof object === "object" && object !== null) {
            var $$typeof = object.$$typeof;
            switch ($$typeof) {
              case REACT_ELEMENT_TYPE:
                var type = object.type;
                switch (type) {
                  case REACT_FRAGMENT_TYPE:
                  case REACT_PROFILER_TYPE:
                  case REACT_STRICT_MODE_TYPE:
                  case REACT_SUSPENSE_TYPE:
                  case REACT_SUSPENSE_LIST_TYPE:
                    return type;
                  default:
                    var $$typeofType = type && type.$$typeof;
                    switch ($$typeofType) {
                      case REACT_SERVER_CONTEXT_TYPE:
                      case REACT_CONTEXT_TYPE:
                      case REACT_FORWARD_REF_TYPE:
                      case REACT_LAZY_TYPE:
                      case REACT_MEMO_TYPE:
                      case REACT_PROVIDER_TYPE:
                        return $$typeofType;
                      default:
                        return $$typeof;
                    }
                }
              case REACT_PORTAL_TYPE:
                return $$typeof;
            }
          }
          return void 0;
        }
        var ContextConsumer = REACT_CONTEXT_TYPE;
        var ContextProvider = REACT_PROVIDER_TYPE;
        var Element = REACT_ELEMENT_TYPE;
        var ForwardRef = REACT_FORWARD_REF_TYPE;
        var Fragment = REACT_FRAGMENT_TYPE;
        var Lazy = REACT_LAZY_TYPE;
        var Memo = REACT_MEMO_TYPE;
        var Portal = REACT_PORTAL_TYPE;
        var Profiler = REACT_PROFILER_TYPE;
        var StrictMode = REACT_STRICT_MODE_TYPE;
        var Suspense = REACT_SUSPENSE_TYPE;
        var SuspenseList = REACT_SUSPENSE_LIST_TYPE;
        var hasWarnedAboutDeprecatedIsAsyncMode = false;
        var hasWarnedAboutDeprecatedIsConcurrentMode = false;
        function isAsyncMode(object) {
          {
            if (!hasWarnedAboutDeprecatedIsAsyncMode) {
              hasWarnedAboutDeprecatedIsAsyncMode = true;
              console["warn"]("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 18+.");
            }
          }
          return false;
        }
        function isConcurrentMode(object) {
          {
            if (!hasWarnedAboutDeprecatedIsConcurrentMode) {
              hasWarnedAboutDeprecatedIsConcurrentMode = true;
              console["warn"]("The ReactIs.isConcurrentMode() alias has been deprecated, and will be removed in React 18+.");
            }
          }
          return false;
        }
        function isContextConsumer(object) {
          return typeOf(object) === REACT_CONTEXT_TYPE;
        }
        function isContextProvider(object) {
          return typeOf(object) === REACT_PROVIDER_TYPE;
        }
        function isElement(object) {
          return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
        }
        function isForwardRef(object) {
          return typeOf(object) === REACT_FORWARD_REF_TYPE;
        }
        function isFragment(object) {
          return typeOf(object) === REACT_FRAGMENT_TYPE;
        }
        function isLazy(object) {
          return typeOf(object) === REACT_LAZY_TYPE;
        }
        function isMemo(object) {
          return typeOf(object) === REACT_MEMO_TYPE;
        }
        function isPortal(object) {
          return typeOf(object) === REACT_PORTAL_TYPE;
        }
        function isProfiler(object) {
          return typeOf(object) === REACT_PROFILER_TYPE;
        }
        function isStrictMode(object) {
          return typeOf(object) === REACT_STRICT_MODE_TYPE;
        }
        function isSuspense(object) {
          return typeOf(object) === REACT_SUSPENSE_TYPE;
        }
        function isSuspenseList(object) {
          return typeOf(object) === REACT_SUSPENSE_LIST_TYPE;
        }
        exports2.ContextConsumer = ContextConsumer;
        exports2.ContextProvider = ContextProvider;
        exports2.Element = Element;
        exports2.ForwardRef = ForwardRef;
        exports2.Fragment = Fragment;
        exports2.Lazy = Lazy;
        exports2.Memo = Memo;
        exports2.Portal = Portal;
        exports2.Profiler = Profiler;
        exports2.StrictMode = StrictMode;
        exports2.Suspense = Suspense;
        exports2.SuspenseList = SuspenseList;
        exports2.isAsyncMode = isAsyncMode;
        exports2.isConcurrentMode = isConcurrentMode;
        exports2.isContextConsumer = isContextConsumer;
        exports2.isContextProvider = isContextProvider;
        exports2.isElement = isElement;
        exports2.isForwardRef = isForwardRef;
        exports2.isFragment = isFragment;
        exports2.isLazy = isLazy;
        exports2.isMemo = isMemo;
        exports2.isPortal = isPortal;
        exports2.isProfiler = isProfiler;
        exports2.isStrictMode = isStrictMode;
        exports2.isSuspense = isSuspense;
        exports2.isSuspenseList = isSuspenseList;
        exports2.isValidElementType = isValidElementType;
        exports2.typeOf = typeOf;
      })();
    }
  }
});

// node_modules/pretty-format/node_modules/react-is/index.js
var require_react_is = __commonJS({
  "node_modules/pretty-format/node_modules/react-is/index.js"(exports2, module2) {
    "use strict";
    if (process.env.NODE_ENV === "production") {
      module2.exports = require_react_is_production_min();
    } else {
      module2.exports = require_react_is_development();
    }
  }
});

// node_modules/pretty-format/node_modules/ansi-styles/index.js
var require_ansi_styles = __commonJS({
  "node_modules/pretty-format/node_modules/ansi-styles/index.js"(exports2, module2) {
    "use strict";
    var ANSI_BACKGROUND_OFFSET = 10;
    var wrapAnsi256 = (offset = 0) => (code) => `\x1B[${38 + offset};5;${code}m`;
    var wrapAnsi16m = (offset = 0) => (red, green, blue) => `\x1B[${38 + offset};2;${red};${green};${blue}m`;
    function assembleStyles() {
      const codes = /* @__PURE__ */ new Map();
      const styles = {
        modifier: {
          reset: [0, 0],
          // 21 isn't widely supported and 22 does the same thing
          bold: [1, 22],
          dim: [2, 22],
          italic: [3, 23],
          underline: [4, 24],
          overline: [53, 55],
          inverse: [7, 27],
          hidden: [8, 28],
          strikethrough: [9, 29]
        },
        color: {
          black: [30, 39],
          red: [31, 39],
          green: [32, 39],
          yellow: [33, 39],
          blue: [34, 39],
          magenta: [35, 39],
          cyan: [36, 39],
          white: [37, 39],
          // Bright color
          blackBright: [90, 39],
          redBright: [91, 39],
          greenBright: [92, 39],
          yellowBright: [93, 39],
          blueBright: [94, 39],
          magentaBright: [95, 39],
          cyanBright: [96, 39],
          whiteBright: [97, 39]
        },
        bgColor: {
          bgBlack: [40, 49],
          bgRed: [41, 49],
          bgGreen: [42, 49],
          bgYellow: [43, 49],
          bgBlue: [44, 49],
          bgMagenta: [45, 49],
          bgCyan: [46, 49],
          bgWhite: [47, 49],
          // Bright color
          bgBlackBright: [100, 49],
          bgRedBright: [101, 49],
          bgGreenBright: [102, 49],
          bgYellowBright: [103, 49],
          bgBlueBright: [104, 49],
          bgMagentaBright: [105, 49],
          bgCyanBright: [106, 49],
          bgWhiteBright: [107, 49]
        }
      };
      styles.color.gray = styles.color.blackBright;
      styles.bgColor.bgGray = styles.bgColor.bgBlackBright;
      styles.color.grey = styles.color.blackBright;
      styles.bgColor.bgGrey = styles.bgColor.bgBlackBright;
      for (const [groupName, group] of Object.entries(styles)) {
        for (const [styleName, style] of Object.entries(group)) {
          styles[styleName] = {
            open: `\x1B[${style[0]}m`,
            close: `\x1B[${style[1]}m`
          };
          group[styleName] = styles[styleName];
          codes.set(style[0], style[1]);
        }
        Object.defineProperty(styles, groupName, {
          value: group,
          enumerable: false
        });
      }
      Object.defineProperty(styles, "codes", {
        value: codes,
        enumerable: false
      });
      styles.color.close = "\x1B[39m";
      styles.bgColor.close = "\x1B[49m";
      styles.color.ansi256 = wrapAnsi256();
      styles.color.ansi16m = wrapAnsi16m();
      styles.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);
      styles.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);
      Object.defineProperties(styles, {
        rgbToAnsi256: {
          value: (red, green, blue) => {
            if (red === green && green === blue) {
              if (red < 8) {
                return 16;
              }
              if (red > 248) {
                return 231;
              }
              return Math.round((red - 8) / 247 * 24) + 232;
            }
            return 16 + 36 * Math.round(red / 255 * 5) + 6 * Math.round(green / 255 * 5) + Math.round(blue / 255 * 5);
          },
          enumerable: false
        },
        hexToRgb: {
          value: (hex) => {
            const matches = /(?<colorString>[a-f\d]{6}|[a-f\d]{3})/i.exec(hex.toString(16));
            if (!matches) {
              return [0, 0, 0];
            }
            let { colorString } = matches.groups;
            if (colorString.length === 3) {
              colorString = colorString.split("").map((character) => character + character).join("");
            }
            const integer = Number.parseInt(colorString, 16);
            return [
              integer >> 16 & 255,
              integer >> 8 & 255,
              integer & 255
            ];
          },
          enumerable: false
        },
        hexToAnsi256: {
          value: (hex) => styles.rgbToAnsi256(...styles.hexToRgb(hex)),
          enumerable: false
        }
      });
      return styles;
    }
    Object.defineProperty(module2, "exports", {
      enumerable: true,
      get: assembleStyles
    });
  }
});

// node_modules/pretty-format/build/index.js
var require_build3 = __commonJS({
  "node_modules/pretty-format/build/index.js"(exports2, module2) {
    (() => {
      "use strict";
      var __webpack_modules__ = {
        /***/
        "./src/collections.ts": (
          /***/
          ((__unused_webpack_module, exports3) => {
            Object.defineProperty(exports3, "__esModule", {
              value: true
            });
            exports3.printIteratorEntries = printIteratorEntries;
            exports3.printIteratorValues = printIteratorValues;
            exports3.printListItems = printListItems;
            exports3.printObjectProperties = printObjectProperties;
            const getKeysOfEnumerableProperties = (object, compareKeys) => {
              const rawKeys = Object.keys(object);
              const keys = compareKeys === null ? rawKeys : rawKeys.sort(compareKeys);
              if (Object.getOwnPropertySymbols) {
                for (const symbol of Object.getOwnPropertySymbols(object)) {
                  if (Object.getOwnPropertyDescriptor(object, symbol).enumerable) {
                    keys.push(symbol);
                  }
                }
              }
              return keys;
            };
            function printIteratorEntries(iterator, config, indentation, depth, refs, printer, separator = ": ") {
              let result = "";
              let width = 0;
              let current = iterator.next();
              if (!current.done) {
                result += config.spacingOuter;
                const indentationNext = indentation + config.indent;
                while (!current.done) {
                  result += indentationNext;
                  if (width++ === config.maxWidth) {
                    result += "\u2026";
                    break;
                  }
                  const name = printer(current.value[0], config, indentationNext, depth, refs);
                  const value = printer(current.value[1], config, indentationNext, depth, refs);
                  result += name + separator + value;
                  current = iterator.next();
                  if (!current.done) {
                    result += `,${config.spacingInner}`;
                  } else if (!config.min) {
                    result += ",";
                  }
                }
                result += config.spacingOuter + indentation;
              }
              return result;
            }
            function printIteratorValues(iterator, config, indentation, depth, refs, printer) {
              let result = "";
              let width = 0;
              let current = iterator.next();
              if (!current.done) {
                result += config.spacingOuter;
                const indentationNext = indentation + config.indent;
                while (!current.done) {
                  result += indentationNext;
                  if (width++ === config.maxWidth) {
                    result += "\u2026";
                    break;
                  }
                  result += printer(current.value, config, indentationNext, depth, refs);
                  current = iterator.next();
                  if (!current.done) {
                    result += `,${config.spacingInner}`;
                  } else if (!config.min) {
                    result += ",";
                  }
                }
                result += config.spacingOuter + indentation;
              }
              return result;
            }
            function printListItems(list, config, indentation, depth, refs, printer) {
              let result = "";
              list = list instanceof ArrayBuffer ? new DataView(list) : list;
              const isDataView = (l) => l instanceof DataView;
              const length = isDataView(list) ? list.byteLength : list.length;
              if (length > 0) {
                result += config.spacingOuter;
                const indentationNext = indentation + config.indent;
                for (let i = 0; i < length; i++) {
                  result += indentationNext;
                  if (i === config.maxWidth) {
                    result += "\u2026";
                    break;
                  }
                  if (isDataView(list) || i in list) {
                    result += printer(isDataView(list) ? list.getInt8(i) : list[i], config, indentationNext, depth, refs);
                  }
                  if (i < length - 1) {
                    result += `,${config.spacingInner}`;
                  } else if (!config.min) {
                    result += ",";
                  }
                }
                result += config.spacingOuter + indentation;
              }
              return result;
            }
            function printObjectProperties(val, config, indentation, depth, refs, printer) {
              let result = "";
              const keys = getKeysOfEnumerableProperties(val, config.compareKeys);
              if (keys.length > 0) {
                result += config.spacingOuter;
                const indentationNext = indentation + config.indent;
                for (let i = 0; i < keys.length; i++) {
                  const key = keys[i];
                  const name = printer(key, config, indentationNext, depth, refs);
                  const value = printer(val[key], config, indentationNext, depth, refs);
                  result += `${indentationNext + name}: ${value}`;
                  if (i < keys.length - 1) {
                    result += `,${config.spacingInner}`;
                  } else if (!config.min) {
                    result += ",";
                  }
                }
                result += config.spacingOuter + indentation;
              }
              return result;
            }
          })
        ),
        /***/
        "./src/plugins/AsymmetricMatcher.ts": (
          /***/
          ((__unused_webpack_module, exports3, __webpack_require__2) => {
            Object.defineProperty(exports3, "__esModule", {
              value: true
            });
            exports3.test = exports3.serialize = exports3["default"] = void 0;
            var _collections = __webpack_require__2("./src/collections.ts");
            var Symbol2 = globalThis["jest-symbol-do-not-touch"] || globalThis.Symbol;
            const asymmetricMatcher = typeof Symbol2 === "function" && Symbol2.for ? Symbol2.for("jest.asymmetricMatcher") : 1267621;
            const SPACE = " ";
            const serialize = (val, config, indentation, depth, refs, printer) => {
              const stringedValue = val.toString();
              if (stringedValue === "ArrayContaining" || stringedValue === "ArrayNotContaining") {
                if (++depth > config.maxDepth) {
                  return `[${stringedValue}]`;
                }
                return `${stringedValue + SPACE}[${(0, _collections.printListItems)(val.sample, config, indentation, depth, refs, printer)}]`;
              }
              if (stringedValue === "ObjectContaining" || stringedValue === "ObjectNotContaining") {
                if (++depth > config.maxDepth) {
                  return `[${stringedValue}]`;
                }
                return `${stringedValue + SPACE}{${(0, _collections.printObjectProperties)(val.sample, config, indentation, depth, refs, printer)}}`;
              }
              if (stringedValue === "StringMatching" || stringedValue === "StringNotMatching") {
                return stringedValue + SPACE + printer(val.sample, config, indentation, depth, refs);
              }
              if (stringedValue === "StringContaining" || stringedValue === "StringNotContaining") {
                return stringedValue + SPACE + printer(val.sample, config, indentation, depth, refs);
              }
              if (stringedValue === "ArrayOf" || stringedValue === "NotArrayOf") {
                if (++depth > config.maxDepth) {
                  return `[${stringedValue}]`;
                }
                return `${stringedValue + SPACE}${printer(val.sample, config, indentation, depth, refs)}`;
              }
              if (typeof val.toAsymmetricMatcher !== "function") {
                throw new TypeError(`Asymmetric matcher ${val.constructor.name} does not implement toAsymmetricMatcher()`);
              }
              return val.toAsymmetricMatcher();
            };
            exports3.serialize = serialize;
            const test = (val) => val && val.$$typeof === asymmetricMatcher;
            exports3.test = test;
            const plugin = {
              serialize,
              test
            };
            var _default = exports3["default"] = plugin;
          })
        ),
        /***/
        "./src/plugins/DOMCollection.ts": (
          /***/
          ((__unused_webpack_module, exports3, __webpack_require__2) => {
            Object.defineProperty(exports3, "__esModule", {
              value: true
            });
            exports3.test = exports3.serialize = exports3["default"] = void 0;
            var _collections = __webpack_require__2("./src/collections.ts");
            const SPACE = " ";
            const OBJECT_NAMES = /* @__PURE__ */ new Set(["DOMStringMap", "NamedNodeMap"]);
            const ARRAY_REGEXP = /^(HTML\w*Collection|NodeList)$/;
            const testName = (name) => OBJECT_NAMES.has(name) || ARRAY_REGEXP.test(name);
            const test = (val) => val && val.constructor && !!val.constructor.name && testName(val.constructor.name);
            exports3.test = test;
            const isNamedNodeMap = (collection) => collection.constructor.name === "NamedNodeMap";
            const serialize = (collection, config, indentation, depth, refs, printer) => {
              const name = collection.constructor.name;
              if (++depth > config.maxDepth) {
                return `[${name}]`;
              }
              return (config.min ? "" : name + SPACE) + (OBJECT_NAMES.has(name) ? `{${(0, _collections.printObjectProperties)(isNamedNodeMap(collection) ? [...collection].reduce((props, attribute) => {
                props[attribute.name] = attribute.value;
                return props;
              }, {}) : {
                ...collection
              }, config, indentation, depth, refs, printer)}}` : `[${(0, _collections.printListItems)([...collection], config, indentation, depth, refs, printer)}]`);
            };
            exports3.serialize = serialize;
            const plugin = {
              serialize,
              test
            };
            var _default = exports3["default"] = plugin;
          })
        ),
        /***/
        "./src/plugins/DOMElement.ts": (
          /***/
          ((__unused_webpack_module, exports3, __webpack_require__2) => {
            Object.defineProperty(exports3, "__esModule", {
              value: true
            });
            exports3.test = exports3.serialize = exports3["default"] = void 0;
            var _markup = __webpack_require__2("./src/plugins/lib/markup.ts");
            const ELEMENT_NODE = 1;
            const TEXT_NODE = 3;
            const COMMENT_NODE = 8;
            const FRAGMENT_NODE = 11;
            const ELEMENT_REGEXP = /^((HTML|SVG)\w*)?Element$/;
            const testHasAttribute = (val) => {
              try {
                return typeof val.hasAttribute === "function" && val.hasAttribute("is");
              } catch {
                return false;
              }
            };
            const isCustomElement = (val) => {
              const tagName = val?.tagName;
              return typeof tagName === "string" && tagName.includes("-") || testHasAttribute(val);
            };
            const testNode = (val) => {
              const constructorName = val.constructor.name;
              const {
                nodeType
              } = val;
              return nodeType === ELEMENT_NODE && (ELEMENT_REGEXP.test(constructorName) || isCustomElement(val)) || nodeType === TEXT_NODE && constructorName === "Text" || nodeType === COMMENT_NODE && constructorName === "Comment" || nodeType === FRAGMENT_NODE && constructorName === "DocumentFragment";
            };
            const test = (val) => (val?.constructor?.name || isCustomElement(val)) && testNode(val);
            exports3.test = test;
            function nodeIsText(node) {
              return node.nodeType === TEXT_NODE;
            }
            function nodeIsComment(node) {
              return node.nodeType === COMMENT_NODE;
            }
            function nodeIsFragment(node) {
              return node.nodeType === FRAGMENT_NODE;
            }
            const serialize = (node, config, indentation, depth, refs, printer) => {
              if (nodeIsText(node)) {
                return (0, _markup.printText)(node.data, config);
              }
              if (nodeIsComment(node)) {
                return (0, _markup.printComment)(node.data, config);
              }
              const type = nodeIsFragment(node) ? "DocumentFragment" : node.tagName.toLowerCase();
              if (++depth > config.maxDepth) {
                return (0, _markup.printElementAsLeaf)(type, config);
              }
              return (0, _markup.printElement)(type, (0, _markup.printProps)(nodeIsFragment(node) ? [] : Array.from(node.attributes, (attr) => attr.name).sort(), nodeIsFragment(node) ? {} : [...node.attributes].reduce((props, attribute) => {
                props[attribute.name] = attribute.value;
                return props;
              }, {}), config, indentation + config.indent, depth, refs, printer), (0, _markup.printChildren)(Array.prototype.slice.call(node.childNodes || node.children), config, indentation + config.indent, depth, refs, printer), config, indentation);
            };
            exports3.serialize = serialize;
            const plugin = {
              serialize,
              test
            };
            var _default = exports3["default"] = plugin;
          })
        ),
        /***/
        "./src/plugins/Immutable.ts": (
          /***/
          ((__unused_webpack_module, exports3, __webpack_require__2) => {
            Object.defineProperty(exports3, "__esModule", {
              value: true
            });
            exports3.test = exports3.serialize = exports3["default"] = void 0;
            var _collections = __webpack_require__2("./src/collections.ts");
            const IS_ITERABLE_SENTINEL = "@@__IMMUTABLE_ITERABLE__@@";
            const IS_LIST_SENTINEL = "@@__IMMUTABLE_LIST__@@";
            const IS_KEYED_SENTINEL = "@@__IMMUTABLE_KEYED__@@";
            const IS_MAP_SENTINEL = "@@__IMMUTABLE_MAP__@@";
            const IS_ORDERED_SENTINEL = "@@__IMMUTABLE_ORDERED__@@";
            const IS_RECORD_SENTINEL = "@@__IMMUTABLE_RECORD__@@";
            const IS_SEQ_SENTINEL = "@@__IMMUTABLE_SEQ__@@";
            const IS_SET_SENTINEL = "@@__IMMUTABLE_SET__@@";
            const IS_STACK_SENTINEL = "@@__IMMUTABLE_STACK__@@";
            const getImmutableName = (name) => `Immutable.${name}`;
            const printAsLeaf = (name) => `[${name}]`;
            const SPACE = " ";
            const LAZY = "\u2026";
            const printImmutableEntries = (val, config, indentation, depth, refs, printer, type) => ++depth > config.maxDepth ? printAsLeaf(getImmutableName(type)) : `${getImmutableName(type) + SPACE}{${(0, _collections.printIteratorEntries)(val.entries(), config, indentation, depth, refs, printer)}}`;
            function getRecordEntries(val) {
              let i = 0;
              return {
                next() {
                  if (i < val._keys.length) {
                    const key = val._keys[i++];
                    return {
                      done: false,
                      value: [key, val.get(key)]
                    };
                  }
                  return {
                    done: true,
                    value: void 0
                  };
                }
              };
            }
            const printImmutableRecord = (val, config, indentation, depth, refs, printer) => {
              const name = getImmutableName(val._name || "Record");
              return ++depth > config.maxDepth ? printAsLeaf(name) : `${name + SPACE}{${(0, _collections.printIteratorEntries)(getRecordEntries(val), config, indentation, depth, refs, printer)}}`;
            };
            const printImmutableSeq = (val, config, indentation, depth, refs, printer) => {
              const name = getImmutableName("Seq");
              if (++depth > config.maxDepth) {
                return printAsLeaf(name);
              }
              if (val[IS_KEYED_SENTINEL]) {
                return `${name + SPACE}{${// from Immutable collection of entries or from ECMAScript object
                val._iter || val._object ? (0, _collections.printIteratorEntries)(val.entries(), config, indentation, depth, refs, printer) : LAZY}}`;
              }
              return `${name + SPACE}[${val._iter || // from Immutable collection of values
              val._array || // from ECMAScript array
              val._collection || // from ECMAScript collection in immutable v4
              val._iterable ? (0, _collections.printIteratorValues)(val.values(), config, indentation, depth, refs, printer) : LAZY}]`;
            };
            const printImmutableValues = (val, config, indentation, depth, refs, printer, type) => ++depth > config.maxDepth ? printAsLeaf(getImmutableName(type)) : `${getImmutableName(type) + SPACE}[${(0, _collections.printIteratorValues)(val.values(), config, indentation, depth, refs, printer)}]`;
            const serialize = (val, config, indentation, depth, refs, printer) => {
              if (val[IS_MAP_SENTINEL]) {
                return printImmutableEntries(val, config, indentation, depth, refs, printer, val[IS_ORDERED_SENTINEL] ? "OrderedMap" : "Map");
              }
              if (val[IS_LIST_SENTINEL]) {
                return printImmutableValues(val, config, indentation, depth, refs, printer, "List");
              }
              if (val[IS_SET_SENTINEL]) {
                return printImmutableValues(val, config, indentation, depth, refs, printer, val[IS_ORDERED_SENTINEL] ? "OrderedSet" : "Set");
              }
              if (val[IS_STACK_SENTINEL]) {
                return printImmutableValues(val, config, indentation, depth, refs, printer, "Stack");
              }
              if (val[IS_SEQ_SENTINEL]) {
                return printImmutableSeq(val, config, indentation, depth, refs, printer);
              }
              return printImmutableRecord(val, config, indentation, depth, refs, printer);
            };
            exports3.serialize = serialize;
            const test = (val) => val && (val[IS_ITERABLE_SENTINEL] === true || val[IS_RECORD_SENTINEL] === true);
            exports3.test = test;
            const plugin = {
              serialize,
              test
            };
            var _default = exports3["default"] = plugin;
          })
        ),
        /***/
        "./src/plugins/ReactElement.ts": (
          /***/
          ((__unused_webpack_module, exports3, __webpack_require__2) => {
            Object.defineProperty(exports3, "__esModule", {
              value: true
            });
            exports3.test = exports3.serialize = exports3["default"] = void 0;
            var ReactIs = _interopRequireWildcard(require_react_is());
            var _markup = __webpack_require__2("./src/plugins/lib/markup.ts");
            function _interopRequireWildcard(e, t) {
              if ("function" == typeof WeakMap) var r = /* @__PURE__ */ new WeakMap(), n = /* @__PURE__ */ new WeakMap();
              return (_interopRequireWildcard = function(e2, t2) {
                if (!t2 && e2 && e2.__esModule) return e2;
                var o, i, f = { __proto__: null, default: e2 };
                if (null === e2 || "object" != typeof e2 && "function" != typeof e2) return f;
                if (o = t2 ? n : r) {
                  if (o.has(e2)) return o.get(e2);
                  o.set(e2, f);
                }
                for (const t3 in e2) "default" !== t3 && {}.hasOwnProperty.call(e2, t3) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e2, t3)) && (i.get || i.set) ? o(f, t3, i) : f[t3] = e2[t3]);
                return f;
              })(e, t);
            }
            const getChildren = (arg, children = []) => {
              if (Array.isArray(arg)) {
                for (const item of arg) {
                  getChildren(item, children);
                }
              } else if (arg != null && arg !== false && arg !== "") {
                children.push(arg);
              }
              return children;
            };
            const getType2 = (element) => {
              const type = element.type;
              if (typeof type === "string") {
                return type;
              }
              if (typeof type === "function") {
                return type.displayName || type.name || "Unknown";
              }
              if (ReactIs.isFragment(element)) {
                return "React.Fragment";
              }
              if (ReactIs.isSuspense(element)) {
                return "React.Suspense";
              }
              if (typeof type === "object" && type !== null) {
                if (ReactIs.isContextProvider(element)) {
                  return "Context.Provider";
                }
                if (ReactIs.isContextConsumer(element)) {
                  return "Context.Consumer";
                }
                if (ReactIs.isForwardRef(element)) {
                  if (type.displayName) {
                    return type.displayName;
                  }
                  const functionName = type.render.displayName || type.render.name || "";
                  return functionName === "" ? "ForwardRef" : `ForwardRef(${functionName})`;
                }
                if (ReactIs.isMemo(element)) {
                  const functionName = type.displayName || type.type.displayName || type.type.name || "";
                  return functionName === "" ? "Memo" : `Memo(${functionName})`;
                }
              }
              return "UNDEFINED";
            };
            const getPropKeys = (element) => {
              const {
                props
              } = element;
              return Object.keys(props).filter((key) => key !== "children" && props[key] !== void 0).sort();
            };
            const serialize = (element, config, indentation, depth, refs, printer) => ++depth > config.maxDepth ? (0, _markup.printElementAsLeaf)(getType2(element), config) : (0, _markup.printElement)(getType2(element), (0, _markup.printProps)(getPropKeys(element), element.props, config, indentation + config.indent, depth, refs, printer), (0, _markup.printChildren)(getChildren(element.props.children), config, indentation + config.indent, depth, refs, printer), config, indentation);
            exports3.serialize = serialize;
            const test = (val) => val != null && ReactIs.isElement(val);
            exports3.test = test;
            const plugin = {
              serialize,
              test
            };
            var _default = exports3["default"] = plugin;
          })
        ),
        /***/
        "./src/plugins/ReactTestComponent.ts": (
          /***/
          ((__unused_webpack_module, exports3, __webpack_require__2) => {
            Object.defineProperty(exports3, "__esModule", {
              value: true
            });
            exports3.test = exports3.serialize = exports3["default"] = void 0;
            var _markup = __webpack_require__2("./src/plugins/lib/markup.ts");
            var Symbol2 = globalThis["jest-symbol-do-not-touch"] || globalThis.Symbol;
            const testSymbol = typeof Symbol2 === "function" && Symbol2.for ? Symbol2.for("react.test.json") : 245830487;
            const getPropKeys = (object) => {
              const {
                props
              } = object;
              return props ? Object.keys(props).filter((key) => props[key] !== void 0).sort() : [];
            };
            const serialize = (object, config, indentation, depth, refs, printer) => ++depth > config.maxDepth ? (0, _markup.printElementAsLeaf)(object.type, config) : (0, _markup.printElement)(object.type, object.props ? (0, _markup.printProps)(getPropKeys(object), object.props, config, indentation + config.indent, depth, refs, printer) : "", object.children ? (0, _markup.printChildren)(object.children, config, indentation + config.indent, depth, refs, printer) : "", config, indentation);
            exports3.serialize = serialize;
            const test = (val) => val && val.$$typeof === testSymbol;
            exports3.test = test;
            const plugin = {
              serialize,
              test
            };
            var _default = exports3["default"] = plugin;
          })
        ),
        /***/
        "./src/plugins/lib/escapeHTML.ts": (
          /***/
          ((__unused_webpack_module, exports3) => {
            Object.defineProperty(exports3, "__esModule", {
              value: true
            });
            exports3["default"] = escapeHTML;
            function escapeHTML(str) {
              return str.replaceAll("<", "&lt;").replaceAll(">", "&gt;");
            }
          })
        ),
        /***/
        "./src/plugins/lib/markup.ts": (
          /***/
          ((__unused_webpack_module, exports3, __webpack_require__2) => {
            Object.defineProperty(exports3, "__esModule", {
              value: true
            });
            exports3.printText = exports3.printProps = exports3.printElementAsLeaf = exports3.printElement = exports3.printComment = exports3.printChildren = void 0;
            var _escapeHTML = _interopRequireDefault(__webpack_require__2("./src/plugins/lib/escapeHTML.ts"));
            function _interopRequireDefault(e) {
              return e && e.__esModule ? e : { default: e };
            }
            const printProps = (keys, props, config, indentation, depth, refs, printer) => {
              const indentationNext = indentation + config.indent;
              const colors3 = config.colors;
              return keys.map((key) => {
                const value = props[key];
                let printed = printer(value, config, indentationNext, depth, refs);
                if (typeof value !== "string") {
                  if (printed.includes("\n")) {
                    printed = config.spacingOuter + indentationNext + printed + config.spacingOuter + indentation;
                  }
                  printed = `{${printed}}`;
                }
                return `${config.spacingInner + indentation + colors3.prop.open + key + colors3.prop.close}=${colors3.value.open}${printed}${colors3.value.close}`;
              }).join("");
            };
            exports3.printProps = printProps;
            const printChildren = (children, config, indentation, depth, refs, printer) => children.map((child) => config.spacingOuter + indentation + (typeof child === "string" ? printText(child, config) : printer(child, config, indentation, depth, refs))).join("");
            exports3.printChildren = printChildren;
            const printText = (text, config) => {
              const contentColor = config.colors.content;
              return contentColor.open + (0, _escapeHTML.default)(text) + contentColor.close;
            };
            exports3.printText = printText;
            const printComment = (comment, config) => {
              const commentColor = config.colors.comment;
              return `${commentColor.open}<!--${(0, _escapeHTML.default)(comment)}-->${commentColor.close}`;
            };
            exports3.printComment = printComment;
            const printElement = (type, printedProps, printedChildren, config, indentation) => {
              const tagColor = config.colors.tag;
              return `${tagColor.open}<${type}${printedProps && tagColor.close + printedProps + config.spacingOuter + indentation + tagColor.open}${printedChildren ? `>${tagColor.close}${printedChildren}${config.spacingOuter}${indentation}${tagColor.open}</${type}` : `${printedProps && !config.min ? "" : " "}/`}>${tagColor.close}`;
            };
            exports3.printElement = printElement;
            const printElementAsLeaf = (type, config) => {
              const tagColor = config.colors.tag;
              return `${tagColor.open}<${type}${tagColor.close} \u2026${tagColor.open} />${tagColor.close}`;
            };
            exports3.printElementAsLeaf = printElementAsLeaf;
          })
        )
        /******/
      };
      var __webpack_module_cache__ = {};
      function __webpack_require__(moduleId) {
        var cachedModule = __webpack_module_cache__[moduleId];
        if (cachedModule !== void 0) {
          return cachedModule.exports;
        }
        var module3 = __webpack_module_cache__[moduleId] = {
          /******/
          // no module.id needed
          /******/
          // no module.loaded needed
          /******/
          exports: {}
          /******/
        };
        __webpack_modules__[moduleId](module3, module3.exports, __webpack_require__);
        return module3.exports;
      }
      var __webpack_exports__ = {};
      (() => {
        var exports3 = __webpack_exports__;
        Object.defineProperty(exports3, "__esModule", {
          value: true
        });
        exports3["default"] = exports3.DEFAULT_OPTIONS = void 0;
        exports3.format = format;
        exports3.plugins = void 0;
        var _ansiStyles = _interopRequireDefault(require_ansi_styles());
        var _collections = __webpack_require__("./src/collections.ts");
        var _AsymmetricMatcher = _interopRequireDefault(__webpack_require__("./src/plugins/AsymmetricMatcher.ts"));
        var _DOMCollection = _interopRequireDefault(__webpack_require__("./src/plugins/DOMCollection.ts"));
        var _DOMElement = _interopRequireDefault(__webpack_require__("./src/plugins/DOMElement.ts"));
        var _Immutable = _interopRequireDefault(__webpack_require__("./src/plugins/Immutable.ts"));
        var _ReactElement = _interopRequireDefault(__webpack_require__("./src/plugins/ReactElement.ts"));
        var _ReactTestComponent = _interopRequireDefault(__webpack_require__("./src/plugins/ReactTestComponent.ts"));
        function _interopRequireDefault(e) {
          return e && e.__esModule ? e : { default: e };
        }
        const src_toString = Object.prototype.toString;
        const toISOString = Date.prototype.toISOString;
        const errorToString = Error.prototype.toString;
        const regExpToString = RegExp.prototype.toString;
        const getConstructorName = (val) => typeof val.constructor === "function" && val.constructor.name || "Object";
        const isWindow = (val) => (
          // eslint-disable-next-line unicorn/prefer-global-this
          typeof window !== "undefined" && val === window
        );
        const SYMBOL_REGEXP = /^Symbol\((.*)\)(.*)$/;
        const NEWLINE_REGEXP = /\n/gi;
        class PrettyFormatPluginError extends Error {
          constructor(message, stack) {
            super(message);
            this.stack = stack;
            this.name = this.constructor.name;
          }
        }
        function isToStringedArrayType(toStringed) {
          return toStringed === "[object Array]" || toStringed === "[object ArrayBuffer]" || toStringed === "[object DataView]" || toStringed === "[object Float32Array]" || toStringed === "[object Float64Array]" || toStringed === "[object Int8Array]" || toStringed === "[object Int16Array]" || toStringed === "[object Int32Array]" || toStringed === "[object Uint8Array]" || toStringed === "[object Uint8ClampedArray]" || toStringed === "[object Uint16Array]" || toStringed === "[object Uint32Array]";
        }
        function printNumber(val) {
          return Object.is(val, -0) ? "-0" : String(val);
        }
        function printBigInt(val) {
          return String(`${val}n`);
        }
        function printFunction(val, printFunctionName) {
          if (!printFunctionName) {
            return "[Function]";
          }
          return `[Function ${val.name || "anonymous"}]`;
        }
        function printSymbol(val) {
          return String(val).replace(SYMBOL_REGEXP, "Symbol($1)");
        }
        function printError(val) {
          return `[${errorToString.call(val)}]`;
        }
        function printBasicValue(val, printFunctionName, escapeRegex, escapeString) {
          if (val === true || val === false) {
            return `${val}`;
          }
          if (val === void 0) {
            return "undefined";
          }
          if (val === null) {
            return "null";
          }
          const typeOf = typeof val;
          if (typeOf === "number") {
            return printNumber(val);
          }
          if (typeOf === "bigint") {
            return printBigInt(val);
          }
          if (typeOf === "string") {
            if (escapeString) {
              return `"${val.replaceAll(/"|\\/g, "\\$&")}"`;
            }
            return `"${val}"`;
          }
          if (typeOf === "function") {
            return printFunction(val, printFunctionName);
          }
          if (typeOf === "symbol") {
            return printSymbol(val);
          }
          const toStringed = src_toString.call(val);
          if (toStringed === "[object Promise]") {
            return "Promise {}";
          }
          if (toStringed === "[object WeakMap]") {
            return "WeakMap {}";
          }
          if (toStringed === "[object WeakSet]") {
            return "WeakSet {}";
          }
          if (toStringed === "[object Function]" || toStringed === "[object GeneratorFunction]") {
            return printFunction(val, printFunctionName);
          }
          if (toStringed === "[object Symbol]") {
            return printSymbol(val);
          }
          if (toStringed === "[object Date]") {
            return Number.isNaN(+val) ? "Date { NaN }" : toISOString.call(val);
          }
          if (toStringed === "[object Error]") {
            return printError(val);
          }
          if (toStringed === "[object RegExp]") {
            if (escapeRegex) {
              return regExpToString.call(val).replaceAll(/[$()*+.?[\\\]^{|}]/g, "\\$&");
            }
            return regExpToString.call(val);
          }
          if (val instanceof Error) {
            return printError(val);
          }
          return null;
        }
        function printComplexValue(val, config, indentation, depth, refs, hasCalledToJSON) {
          if (refs.includes(val)) {
            return "[Circular]";
          }
          refs = [...refs];
          refs.push(val);
          const hitMaxDepth = ++depth > config.maxDepth;
          const min = config.min;
          if (config.callToJSON && !hitMaxDepth && val.toJSON && typeof val.toJSON === "function" && !hasCalledToJSON) {
            return printer(val.toJSON(), config, indentation, depth, refs, true);
          }
          const toStringed = src_toString.call(val);
          if (toStringed === "[object Arguments]") {
            return hitMaxDepth ? "[Arguments]" : `${min ? "" : "Arguments "}[${(0, _collections.printListItems)(val, config, indentation, depth, refs, printer)}]`;
          }
          if (isToStringedArrayType(toStringed)) {
            return hitMaxDepth ? `[${val.constructor.name}]` : `${min ? "" : !config.printBasicPrototype && val.constructor.name === "Array" ? "" : `${val.constructor.name} `}[${(0, _collections.printListItems)(val, config, indentation, depth, refs, printer)}]`;
          }
          if (toStringed === "[object Map]") {
            return hitMaxDepth ? "[Map]" : `Map {${(0, _collections.printIteratorEntries)(val.entries(), config, indentation, depth, refs, printer, " => ")}}`;
          }
          if (toStringed === "[object Set]") {
            return hitMaxDepth ? "[Set]" : `Set {${(0, _collections.printIteratorValues)(val.values(), config, indentation, depth, refs, printer)}}`;
          }
          return hitMaxDepth || isWindow(val) ? `[${getConstructorName(val)}]` : `${min ? "" : !config.printBasicPrototype && getConstructorName(val) === "Object" ? "" : `${getConstructorName(val)} `}{${(0, _collections.printObjectProperties)(val, config, indentation, depth, refs, printer)}}`;
        }
        function isNewPlugin(plugin) {
          return plugin.serialize != null;
        }
        function printPlugin(plugin, val, config, indentation, depth, refs) {
          let printed;
          try {
            printed = isNewPlugin(plugin) ? plugin.serialize(val, config, indentation, depth, refs, printer) : plugin.print(val, (valChild) => printer(valChild, config, indentation, depth, refs), (str) => {
              const indentationNext = indentation + config.indent;
              return indentationNext + str.replaceAll(NEWLINE_REGEXP, `
${indentationNext}`);
            }, {
              edgeSpacing: config.spacingOuter,
              min: config.min,
              spacing: config.spacingInner
            }, config.colors);
          } catch (error) {
            throw new PrettyFormatPluginError(error.message, error.stack);
          }
          if (typeof printed !== "string") {
            throw new TypeError(`pretty-format: Plugin must return type "string" but instead returned "${typeof printed}".`);
          }
          return printed;
        }
        function findPlugin(plugins2, val) {
          for (const plugin of plugins2) {
            try {
              if (plugin.test(val)) {
                return plugin;
              }
            } catch (error) {
              throw new PrettyFormatPluginError(error.message, error.stack);
            }
          }
          return null;
        }
        function printer(val, config, indentation, depth, refs, hasCalledToJSON) {
          const plugin = findPlugin(config.plugins, val);
          if (plugin !== null) {
            return printPlugin(plugin, val, config, indentation, depth, refs);
          }
          const basicResult = printBasicValue(val, config.printFunctionName, config.escapeRegex, config.escapeString);
          if (basicResult !== null) {
            return basicResult;
          }
          return printComplexValue(val, config, indentation, depth, refs, hasCalledToJSON);
        }
        const DEFAULT_THEME = {
          comment: "gray",
          content: "reset",
          prop: "yellow",
          tag: "cyan",
          value: "green"
        };
        const DEFAULT_THEME_KEYS = Object.keys(DEFAULT_THEME);
        const toOptionsSubtype = (options) => options;
        const DEFAULT_OPTIONS = exports3.DEFAULT_OPTIONS = toOptionsSubtype({
          callToJSON: true,
          compareKeys: void 0,
          escapeRegex: false,
          escapeString: true,
          highlight: false,
          indent: 2,
          maxDepth: Number.POSITIVE_INFINITY,
          maxWidth: Number.POSITIVE_INFINITY,
          min: false,
          plugins: [],
          printBasicPrototype: true,
          printFunctionName: true,
          theme: DEFAULT_THEME
        });
        function validateOptions(options) {
          for (const key of Object.keys(options)) {
            if (!Object.prototype.hasOwnProperty.call(DEFAULT_OPTIONS, key)) {
              throw new Error(`pretty-format: Unknown option "${key}".`);
            }
          }
          if (options.min && options.indent !== void 0 && options.indent !== 0) {
            throw new Error('pretty-format: Options "min" and "indent" cannot be used together.');
          }
          if (options.theme !== void 0) {
            if (options.theme === null) {
              throw new Error('pretty-format: Option "theme" must not be null.');
            }
            if (typeof options.theme !== "object") {
              throw new TypeError(`pretty-format: Option "theme" must be of type "object" but instead received "${typeof options.theme}".`);
            }
          }
        }
        const getColorsHighlight = (options) => DEFAULT_THEME_KEYS.reduce((colors3, key) => {
          const value = options.theme && options.theme[key] !== void 0 ? options.theme[key] : DEFAULT_THEME[key];
          const color = value && _ansiStyles.default[value];
          if (color && typeof color.close === "string" && typeof color.open === "string") {
            colors3[key] = color;
          } else {
            throw new Error(`pretty-format: Option "theme" has a key "${key}" whose value "${value}" is undefined in ansi-styles.`);
          }
          return colors3;
        }, /* @__PURE__ */ Object.create(null));
        const getColorsEmpty = () => DEFAULT_THEME_KEYS.reduce((colors3, key) => {
          colors3[key] = {
            close: "",
            open: ""
          };
          return colors3;
        }, /* @__PURE__ */ Object.create(null));
        const getPrintFunctionName = (options) => options?.printFunctionName ?? DEFAULT_OPTIONS.printFunctionName;
        const getEscapeRegex = (options) => options?.escapeRegex ?? DEFAULT_OPTIONS.escapeRegex;
        const getEscapeString = (options) => options?.escapeString ?? DEFAULT_OPTIONS.escapeString;
        const getConfig = (options) => ({
          callToJSON: options?.callToJSON ?? DEFAULT_OPTIONS.callToJSON,
          colors: options?.highlight ? getColorsHighlight(options) : getColorsEmpty(),
          compareKeys: typeof options?.compareKeys === "function" || options?.compareKeys === null ? options.compareKeys : DEFAULT_OPTIONS.compareKeys,
          escapeRegex: getEscapeRegex(options),
          escapeString: getEscapeString(options),
          indent: options?.min ? "" : createIndent(options?.indent ?? DEFAULT_OPTIONS.indent),
          maxDepth: options?.maxDepth ?? DEFAULT_OPTIONS.maxDepth,
          maxWidth: options?.maxWidth ?? DEFAULT_OPTIONS.maxWidth,
          min: options?.min ?? DEFAULT_OPTIONS.min,
          plugins: options?.plugins ?? DEFAULT_OPTIONS.plugins,
          printBasicPrototype: options?.printBasicPrototype ?? true,
          printFunctionName: getPrintFunctionName(options),
          spacingInner: options?.min ? " " : "\n",
          spacingOuter: options?.min ? "" : "\n"
        });
        function createIndent(indent3) {
          return Array.from({
            length: indent3 + 1
          }).join(" ");
        }
        function format(val, options) {
          if (options) {
            validateOptions(options);
            if (options.plugins) {
              const plugin = findPlugin(options.plugins, val);
              if (plugin !== null) {
                return printPlugin(plugin, val, getConfig(options), "", 0, []);
              }
            }
          }
          const basicResult = printBasicValue(val, getPrintFunctionName(options), getEscapeRegex(options), getEscapeString(options));
          if (basicResult !== null) {
            return basicResult;
          }
          return printComplexValue(val, getConfig(options), "", 0, []);
        }
        const plugins = exports3.plugins = {
          AsymmetricMatcher: _AsymmetricMatcher.default,
          DOMCollection: _DOMCollection.default,
          DOMElement: _DOMElement.default,
          Immutable: _Immutable.default,
          ReactElement: _ReactElement.default,
          ReactTestComponent: _ReactTestComponent.default
        };
        var _default = exports3["default"] = format;
      })();
      module2.exports = __webpack_exports__;
    })();
  }
});

// node_modules/color-name/index.js
var require_color_name = __commonJS({
  "node_modules/color-name/index.js"(exports2, module2) {
    "use strict";
    module2.exports = {
      "aliceblue": [240, 248, 255],
      "antiquewhite": [250, 235, 215],
      "aqua": [0, 255, 255],
      "aquamarine": [127, 255, 212],
      "azure": [240, 255, 255],
      "beige": [245, 245, 220],
      "bisque": [255, 228, 196],
      "black": [0, 0, 0],
      "blanchedalmond": [255, 235, 205],
      "blue": [0, 0, 255],
      "blueviolet": [138, 43, 226],
      "brown": [165, 42, 42],
      "burlywood": [222, 184, 135],
      "cadetblue": [95, 158, 160],
      "chartreuse": [127, 255, 0],
      "chocolate": [210, 105, 30],
      "coral": [255, 127, 80],
      "cornflowerblue": [100, 149, 237],
      "cornsilk": [255, 248, 220],
      "crimson": [220, 20, 60],
      "cyan": [0, 255, 255],
      "darkblue": [0, 0, 139],
      "darkcyan": [0, 139, 139],
      "darkgoldenrod": [184, 134, 11],
      "darkgray": [169, 169, 169],
      "darkgreen": [0, 100, 0],
      "darkgrey": [169, 169, 169],
      "darkkhaki": [189, 183, 107],
      "darkmagenta": [139, 0, 139],
      "darkolivegreen": [85, 107, 47],
      "darkorange": [255, 140, 0],
      "darkorchid": [153, 50, 204],
      "darkred": [139, 0, 0],
      "darksalmon": [233, 150, 122],
      "darkseagreen": [143, 188, 143],
      "darkslateblue": [72, 61, 139],
      "darkslategray": [47, 79, 79],
      "darkslategrey": [47, 79, 79],
      "darkturquoise": [0, 206, 209],
      "darkviolet": [148, 0, 211],
      "deeppink": [255, 20, 147],
      "deepskyblue": [0, 191, 255],
      "dimgray": [105, 105, 105],
      "dimgrey": [105, 105, 105],
      "dodgerblue": [30, 144, 255],
      "firebrick": [178, 34, 34],
      "floralwhite": [255, 250, 240],
      "forestgreen": [34, 139, 34],
      "fuchsia": [255, 0, 255],
      "gainsboro": [220, 220, 220],
      "ghostwhite": [248, 248, 255],
      "gold": [255, 215, 0],
      "goldenrod": [218, 165, 32],
      "gray": [128, 128, 128],
      "green": [0, 128, 0],
      "greenyellow": [173, 255, 47],
      "grey": [128, 128, 128],
      "honeydew": [240, 255, 240],
      "hotpink": [255, 105, 180],
      "indianred": [205, 92, 92],
      "indigo": [75, 0, 130],
      "ivory": [255, 255, 240],
      "khaki": [240, 230, 140],
      "lavender": [230, 230, 250],
      "lavenderblush": [255, 240, 245],
      "lawngreen": [124, 252, 0],
      "lemonchiffon": [255, 250, 205],
      "lightblue": [173, 216, 230],
      "lightcoral": [240, 128, 128],
      "lightcyan": [224, 255, 255],
      "lightgoldenrodyellow": [250, 250, 210],
      "lightgray": [211, 211, 211],
      "lightgreen": [144, 238, 144],
      "lightgrey": [211, 211, 211],
      "lightpink": [255, 182, 193],
      "lightsalmon": [255, 160, 122],
      "lightseagreen": [32, 178, 170],
      "lightskyblue": [135, 206, 250],
      "lightslategray": [119, 136, 153],
      "lightslategrey": [119, 136, 153],
      "lightsteelblue": [176, 196, 222],
      "lightyellow": [255, 255, 224],
      "lime": [0, 255, 0],
      "limegreen": [50, 205, 50],
      "linen": [250, 240, 230],
      "magenta": [255, 0, 255],
      "maroon": [128, 0, 0],
      "mediumaquamarine": [102, 205, 170],
      "mediumblue": [0, 0, 205],
      "mediumorchid": [186, 85, 211],
      "mediumpurple": [147, 112, 219],
      "mediumseagreen": [60, 179, 113],
      "mediumslateblue": [123, 104, 238],
      "mediumspringgreen": [0, 250, 154],
      "mediumturquoise": [72, 209, 204],
      "mediumvioletred": [199, 21, 133],
      "midnightblue": [25, 25, 112],
      "mintcream": [245, 255, 250],
      "mistyrose": [255, 228, 225],
      "moccasin": [255, 228, 181],
      "navajowhite": [255, 222, 173],
      "navy": [0, 0, 128],
      "oldlace": [253, 245, 230],
      "olive": [128, 128, 0],
      "olivedrab": [107, 142, 35],
      "orange": [255, 165, 0],
      "orangered": [255, 69, 0],
      "orchid": [218, 112, 214],
      "palegoldenrod": [238, 232, 170],
      "palegreen": [152, 251, 152],
      "paleturquoise": [175, 238, 238],
      "palevioletred": [219, 112, 147],
      "papayawhip": [255, 239, 213],
      "peachpuff": [255, 218, 185],
      "peru": [205, 133, 63],
      "pink": [255, 192, 203],
      "plum": [221, 160, 221],
      "powderblue": [176, 224, 230],
      "purple": [128, 0, 128],
      "rebeccapurple": [102, 51, 153],
      "red": [255, 0, 0],
      "rosybrown": [188, 143, 143],
      "royalblue": [65, 105, 225],
      "saddlebrown": [139, 69, 19],
      "salmon": [250, 128, 114],
      "sandybrown": [244, 164, 96],
      "seagreen": [46, 139, 87],
      "seashell": [255, 245, 238],
      "sienna": [160, 82, 45],
      "silver": [192, 192, 192],
      "skyblue": [135, 206, 235],
      "slateblue": [106, 90, 205],
      "slategray": [112, 128, 144],
      "slategrey": [112, 128, 144],
      "snow": [255, 250, 250],
      "springgreen": [0, 255, 127],
      "steelblue": [70, 130, 180],
      "tan": [210, 180, 140],
      "teal": [0, 128, 128],
      "thistle": [216, 191, 216],
      "tomato": [255, 99, 71],
      "turquoise": [64, 224, 208],
      "violet": [238, 130, 238],
      "wheat": [245, 222, 179],
      "white": [255, 255, 255],
      "whitesmoke": [245, 245, 245],
      "yellow": [255, 255, 0],
      "yellowgreen": [154, 205, 50]
    };
  }
});

// node_modules/color-convert/conversions.js
var require_conversions = __commonJS({
  "node_modules/color-convert/conversions.js"(exports2, module2) {
    var cssKeywords = require_color_name();
    var reverseKeywords = {};
    for (const key of Object.keys(cssKeywords)) {
      reverseKeywords[cssKeywords[key]] = key;
    }
    var convert = {
      rgb: { channels: 3, labels: "rgb" },
      hsl: { channels: 3, labels: "hsl" },
      hsv: { channels: 3, labels: "hsv" },
      hwb: { channels: 3, labels: "hwb" },
      cmyk: { channels: 4, labels: "cmyk" },
      xyz: { channels: 3, labels: "xyz" },
      lab: { channels: 3, labels: "lab" },
      lch: { channels: 3, labels: "lch" },
      hex: { channels: 1, labels: ["hex"] },
      keyword: { channels: 1, labels: ["keyword"] },
      ansi16: { channels: 1, labels: ["ansi16"] },
      ansi256: { channels: 1, labels: ["ansi256"] },
      hcg: { channels: 3, labels: ["h", "c", "g"] },
      apple: { channels: 3, labels: ["r16", "g16", "b16"] },
      gray: { channels: 1, labels: ["gray"] }
    };
    module2.exports = convert;
    for (const model of Object.keys(convert)) {
      if (!("channels" in convert[model])) {
        throw new Error("missing channels property: " + model);
      }
      if (!("labels" in convert[model])) {
        throw new Error("missing channel labels property: " + model);
      }
      if (convert[model].labels.length !== convert[model].channels) {
        throw new Error("channel and label counts mismatch: " + model);
      }
      const { channels, labels } = convert[model];
      delete convert[model].channels;
      delete convert[model].labels;
      Object.defineProperty(convert[model], "channels", { value: channels });
      Object.defineProperty(convert[model], "labels", { value: labels });
    }
    convert.rgb.hsl = function(rgb) {
      const r = rgb[0] / 255;
      const g = rgb[1] / 255;
      const b = rgb[2] / 255;
      const min = Math.min(r, g, b);
      const max = Math.max(r, g, b);
      const delta = max - min;
      let h;
      let s;
      if (max === min) {
        h = 0;
      } else if (r === max) {
        h = (g - b) / delta;
      } else if (g === max) {
        h = 2 + (b - r) / delta;
      } else if (b === max) {
        h = 4 + (r - g) / delta;
      }
      h = Math.min(h * 60, 360);
      if (h < 0) {
        h += 360;
      }
      const l = (min + max) / 2;
      if (max === min) {
        s = 0;
      } else if (l <= 0.5) {
        s = delta / (max + min);
      } else {
        s = delta / (2 - max - min);
      }
      return [h, s * 100, l * 100];
    };
    convert.rgb.hsv = function(rgb) {
      let rdif;
      let gdif;
      let bdif;
      let h;
      let s;
      const r = rgb[0] / 255;
      const g = rgb[1] / 255;
      const b = rgb[2] / 255;
      const v = Math.max(r, g, b);
      const diff2 = v - Math.min(r, g, b);
      const diffc = function(c) {
        return (v - c) / 6 / diff2 + 1 / 2;
      };
      if (diff2 === 0) {
        h = 0;
        s = 0;
      } else {
        s = diff2 / v;
        rdif = diffc(r);
        gdif = diffc(g);
        bdif = diffc(b);
        if (r === v) {
          h = bdif - gdif;
        } else if (g === v) {
          h = 1 / 3 + rdif - bdif;
        } else if (b === v) {
          h = 2 / 3 + gdif - rdif;
        }
        if (h < 0) {
          h += 1;
        } else if (h > 1) {
          h -= 1;
        }
      }
      return [
        h * 360,
        s * 100,
        v * 100
      ];
    };
    convert.rgb.hwb = function(rgb) {
      const r = rgb[0];
      const g = rgb[1];
      let b = rgb[2];
      const h = convert.rgb.hsl(rgb)[0];
      const w = 1 / 255 * Math.min(r, Math.min(g, b));
      b = 1 - 1 / 255 * Math.max(r, Math.max(g, b));
      return [h, w * 100, b * 100];
    };
    convert.rgb.cmyk = function(rgb) {
      const r = rgb[0] / 255;
      const g = rgb[1] / 255;
      const b = rgb[2] / 255;
      const k = Math.min(1 - r, 1 - g, 1 - b);
      const c = (1 - r - k) / (1 - k) || 0;
      const m = (1 - g - k) / (1 - k) || 0;
      const y = (1 - b - k) / (1 - k) || 0;
      return [c * 100, m * 100, y * 100, k * 100];
    };
    function comparativeDistance(x, y) {
      return (x[0] - y[0]) ** 2 + (x[1] - y[1]) ** 2 + (x[2] - y[2]) ** 2;
    }
    convert.rgb.keyword = function(rgb) {
      const reversed = reverseKeywords[rgb];
      if (reversed) {
        return reversed;
      }
      let currentClosestDistance = Infinity;
      let currentClosestKeyword;
      for (const keyword of Object.keys(cssKeywords)) {
        const value = cssKeywords[keyword];
        const distance = comparativeDistance(rgb, value);
        if (distance < currentClosestDistance) {
          currentClosestDistance = distance;
          currentClosestKeyword = keyword;
        }
      }
      return currentClosestKeyword;
    };
    convert.keyword.rgb = function(keyword) {
      return cssKeywords[keyword];
    };
    convert.rgb.xyz = function(rgb) {
      let r = rgb[0] / 255;
      let g = rgb[1] / 255;
      let b = rgb[2] / 255;
      r = r > 0.04045 ? ((r + 0.055) / 1.055) ** 2.4 : r / 12.92;
      g = g > 0.04045 ? ((g + 0.055) / 1.055) ** 2.4 : g / 12.92;
      b = b > 0.04045 ? ((b + 0.055) / 1.055) ** 2.4 : b / 12.92;
      const x = r * 0.4124 + g * 0.3576 + b * 0.1805;
      const y = r * 0.2126 + g * 0.7152 + b * 0.0722;
      const z = r * 0.0193 + g * 0.1192 + b * 0.9505;
      return [x * 100, y * 100, z * 100];
    };
    convert.rgb.lab = function(rgb) {
      const xyz = convert.rgb.xyz(rgb);
      let x = xyz[0];
      let y = xyz[1];
      let z = xyz[2];
      x /= 95.047;
      y /= 100;
      z /= 108.883;
      x = x > 8856e-6 ? x ** (1 / 3) : 7.787 * x + 16 / 116;
      y = y > 8856e-6 ? y ** (1 / 3) : 7.787 * y + 16 / 116;
      z = z > 8856e-6 ? z ** (1 / 3) : 7.787 * z + 16 / 116;
      const l = 116 * y - 16;
      const a = 500 * (x - y);
      const b = 200 * (y - z);
      return [l, a, b];
    };
    convert.hsl.rgb = function(hsl) {
      const h = hsl[0] / 360;
      const s = hsl[1] / 100;
      const l = hsl[2] / 100;
      let t2;
      let t3;
      let val;
      if (s === 0) {
        val = l * 255;
        return [val, val, val];
      }
      if (l < 0.5) {
        t2 = l * (1 + s);
      } else {
        t2 = l + s - l * s;
      }
      const t1 = 2 * l - t2;
      const rgb = [0, 0, 0];
      for (let i = 0; i < 3; i++) {
        t3 = h + 1 / 3 * -(i - 1);
        if (t3 < 0) {
          t3++;
        }
        if (t3 > 1) {
          t3--;
        }
        if (6 * t3 < 1) {
          val = t1 + (t2 - t1) * 6 * t3;
        } else if (2 * t3 < 1) {
          val = t2;
        } else if (3 * t3 < 2) {
          val = t1 + (t2 - t1) * (2 / 3 - t3) * 6;
        } else {
          val = t1;
        }
        rgb[i] = val * 255;
      }
      return rgb;
    };
    convert.hsl.hsv = function(hsl) {
      const h = hsl[0];
      let s = hsl[1] / 100;
      let l = hsl[2] / 100;
      let smin = s;
      const lmin = Math.max(l, 0.01);
      l *= 2;
      s *= l <= 1 ? l : 2 - l;
      smin *= lmin <= 1 ? lmin : 2 - lmin;
      const v = (l + s) / 2;
      const sv = l === 0 ? 2 * smin / (lmin + smin) : 2 * s / (l + s);
      return [h, sv * 100, v * 100];
    };
    convert.hsv.rgb = function(hsv) {
      const h = hsv[0] / 60;
      const s = hsv[1] / 100;
      let v = hsv[2] / 100;
      const hi = Math.floor(h) % 6;
      const f = h - Math.floor(h);
      const p = 255 * v * (1 - s);
      const q = 255 * v * (1 - s * f);
      const t = 255 * v * (1 - s * (1 - f));
      v *= 255;
      switch (hi) {
        case 0:
          return [v, t, p];
        case 1:
          return [q, v, p];
        case 2:
          return [p, v, t];
        case 3:
          return [p, q, v];
        case 4:
          return [t, p, v];
        case 5:
          return [v, p, q];
      }
    };
    convert.hsv.hsl = function(hsv) {
      const h = hsv[0];
      const s = hsv[1] / 100;
      const v = hsv[2] / 100;
      const vmin = Math.max(v, 0.01);
      let sl;
      let l;
      l = (2 - s) * v;
      const lmin = (2 - s) * vmin;
      sl = s * vmin;
      sl /= lmin <= 1 ? lmin : 2 - lmin;
      sl = sl || 0;
      l /= 2;
      return [h, sl * 100, l * 100];
    };
    convert.hwb.rgb = function(hwb) {
      const h = hwb[0] / 360;
      let wh = hwb[1] / 100;
      let bl = hwb[2] / 100;
      const ratio = wh + bl;
      let f;
      if (ratio > 1) {
        wh /= ratio;
        bl /= ratio;
      }
      const i = Math.floor(6 * h);
      const v = 1 - bl;
      f = 6 * h - i;
      if ((i & 1) !== 0) {
        f = 1 - f;
      }
      const n = wh + f * (v - wh);
      let r;
      let g;
      let b;
      switch (i) {
        default:
        case 6:
        case 0:
          r = v;
          g = n;
          b = wh;
          break;
        case 1:
          r = n;
          g = v;
          b = wh;
          break;
        case 2:
          r = wh;
          g = v;
          b = n;
          break;
        case 3:
          r = wh;
          g = n;
          b = v;
          break;
        case 4:
          r = n;
          g = wh;
          b = v;
          break;
        case 5:
          r = v;
          g = wh;
          b = n;
          break;
      }
      return [r * 255, g * 255, b * 255];
    };
    convert.cmyk.rgb = function(cmyk) {
      const c = cmyk[0] / 100;
      const m = cmyk[1] / 100;
      const y = cmyk[2] / 100;
      const k = cmyk[3] / 100;
      const r = 1 - Math.min(1, c * (1 - k) + k);
      const g = 1 - Math.min(1, m * (1 - k) + k);
      const b = 1 - Math.min(1, y * (1 - k) + k);
      return [r * 255, g * 255, b * 255];
    };
    convert.xyz.rgb = function(xyz) {
      const x = xyz[0] / 100;
      const y = xyz[1] / 100;
      const z = xyz[2] / 100;
      let r;
      let g;
      let b;
      r = x * 3.2406 + y * -1.5372 + z * -0.4986;
      g = x * -0.9689 + y * 1.8758 + z * 0.0415;
      b = x * 0.0557 + y * -0.204 + z * 1.057;
      r = r > 31308e-7 ? 1.055 * r ** (1 / 2.4) - 0.055 : r * 12.92;
      g = g > 31308e-7 ? 1.055 * g ** (1 / 2.4) - 0.055 : g * 12.92;
      b = b > 31308e-7 ? 1.055 * b ** (1 / 2.4) - 0.055 : b * 12.92;
      r = Math.min(Math.max(0, r), 1);
      g = Math.min(Math.max(0, g), 1);
      b = Math.min(Math.max(0, b), 1);
      return [r * 255, g * 255, b * 255];
    };
    convert.xyz.lab = function(xyz) {
      let x = xyz[0];
      let y = xyz[1];
      let z = xyz[2];
      x /= 95.047;
      y /= 100;
      z /= 108.883;
      x = x > 8856e-6 ? x ** (1 / 3) : 7.787 * x + 16 / 116;
      y = y > 8856e-6 ? y ** (1 / 3) : 7.787 * y + 16 / 116;
      z = z > 8856e-6 ? z ** (1 / 3) : 7.787 * z + 16 / 116;
      const l = 116 * y - 16;
      const a = 500 * (x - y);
      const b = 200 * (y - z);
      return [l, a, b];
    };
    convert.lab.xyz = function(lab) {
      const l = lab[0];
      const a = lab[1];
      const b = lab[2];
      let x;
      let y;
      let z;
      y = (l + 16) / 116;
      x = a / 500 + y;
      z = y - b / 200;
      const y2 = y ** 3;
      const x2 = x ** 3;
      const z2 = z ** 3;
      y = y2 > 8856e-6 ? y2 : (y - 16 / 116) / 7.787;
      x = x2 > 8856e-6 ? x2 : (x - 16 / 116) / 7.787;
      z = z2 > 8856e-6 ? z2 : (z - 16 / 116) / 7.787;
      x *= 95.047;
      y *= 100;
      z *= 108.883;
      return [x, y, z];
    };
    convert.lab.lch = function(lab) {
      const l = lab[0];
      const a = lab[1];
      const b = lab[2];
      let h;
      const hr = Math.atan2(b, a);
      h = hr * 360 / 2 / Math.PI;
      if (h < 0) {
        h += 360;
      }
      const c = Math.sqrt(a * a + b * b);
      return [l, c, h];
    };
    convert.lch.lab = function(lch) {
      const l = lch[0];
      const c = lch[1];
      const h = lch[2];
      const hr = h / 360 * 2 * Math.PI;
      const a = c * Math.cos(hr);
      const b = c * Math.sin(hr);
      return [l, a, b];
    };
    convert.rgb.ansi16 = function(args, saturation = null) {
      const [r, g, b] = args;
      let value = saturation === null ? convert.rgb.hsv(args)[2] : saturation;
      value = Math.round(value / 50);
      if (value === 0) {
        return 30;
      }
      let ansi = 30 + (Math.round(b / 255) << 2 | Math.round(g / 255) << 1 | Math.round(r / 255));
      if (value === 2) {
        ansi += 60;
      }
      return ansi;
    };
    convert.hsv.ansi16 = function(args) {
      return convert.rgb.ansi16(convert.hsv.rgb(args), args[2]);
    };
    convert.rgb.ansi256 = function(args) {
      const r = args[0];
      const g = args[1];
      const b = args[2];
      if (r === g && g === b) {
        if (r < 8) {
          return 16;
        }
        if (r > 248) {
          return 231;
        }
        return Math.round((r - 8) / 247 * 24) + 232;
      }
      const ansi = 16 + 36 * Math.round(r / 255 * 5) + 6 * Math.round(g / 255 * 5) + Math.round(b / 255 * 5);
      return ansi;
    };
    convert.ansi16.rgb = function(args) {
      let color = args % 10;
      if (color === 0 || color === 7) {
        if (args > 50) {
          color += 3.5;
        }
        color = color / 10.5 * 255;
        return [color, color, color];
      }
      const mult = (~~(args > 50) + 1) * 0.5;
      const r = (color & 1) * mult * 255;
      const g = (color >> 1 & 1) * mult * 255;
      const b = (color >> 2 & 1) * mult * 255;
      return [r, g, b];
    };
    convert.ansi256.rgb = function(args) {
      if (args >= 232) {
        const c = (args - 232) * 10 + 8;
        return [c, c, c];
      }
      args -= 16;
      let rem;
      const r = Math.floor(args / 36) / 5 * 255;
      const g = Math.floor((rem = args % 36) / 6) / 5 * 255;
      const b = rem % 6 / 5 * 255;
      return [r, g, b];
    };
    convert.rgb.hex = function(args) {
      const integer = ((Math.round(args[0]) & 255) << 16) + ((Math.round(args[1]) & 255) << 8) + (Math.round(args[2]) & 255);
      const string = integer.toString(16).toUpperCase();
      return "000000".substring(string.length) + string;
    };
    convert.hex.rgb = function(args) {
      const match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);
      if (!match) {
        return [0, 0, 0];
      }
      let colorString = match[0];
      if (match[0].length === 3) {
        colorString = colorString.split("").map((char) => {
          return char + char;
        }).join("");
      }
      const integer = parseInt(colorString, 16);
      const r = integer >> 16 & 255;
      const g = integer >> 8 & 255;
      const b = integer & 255;
      return [r, g, b];
    };
    convert.rgb.hcg = function(rgb) {
      const r = rgb[0] / 255;
      const g = rgb[1] / 255;
      const b = rgb[2] / 255;
      const max = Math.max(Math.max(r, g), b);
      const min = Math.min(Math.min(r, g), b);
      const chroma = max - min;
      let grayscale;
      let hue;
      if (chroma < 1) {
        grayscale = min / (1 - chroma);
      } else {
        grayscale = 0;
      }
      if (chroma <= 0) {
        hue = 0;
      } else if (max === r) {
        hue = (g - b) / chroma % 6;
      } else if (max === g) {
        hue = 2 + (b - r) / chroma;
      } else {
        hue = 4 + (r - g) / chroma;
      }
      hue /= 6;
      hue %= 1;
      return [hue * 360, chroma * 100, grayscale * 100];
    };
    convert.hsl.hcg = function(hsl) {
      const s = hsl[1] / 100;
      const l = hsl[2] / 100;
      const c = l < 0.5 ? 2 * s * l : 2 * s * (1 - l);
      let f = 0;
      if (c < 1) {
        f = (l - 0.5 * c) / (1 - c);
      }
      return [hsl[0], c * 100, f * 100];
    };
    convert.hsv.hcg = function(hsv) {
      const s = hsv[1] / 100;
      const v = hsv[2] / 100;
      const c = s * v;
      let f = 0;
      if (c < 1) {
        f = (v - c) / (1 - c);
      }
      return [hsv[0], c * 100, f * 100];
    };
    convert.hcg.rgb = function(hcg) {
      const h = hcg[0] / 360;
      const c = hcg[1] / 100;
      const g = hcg[2] / 100;
      if (c === 0) {
        return [g * 255, g * 255, g * 255];
      }
      const pure = [0, 0, 0];
      const hi = h % 1 * 6;
      const v = hi % 1;
      const w = 1 - v;
      let mg = 0;
      switch (Math.floor(hi)) {
        case 0:
          pure[0] = 1;
          pure[1] = v;
          pure[2] = 0;
          break;
        case 1:
          pure[0] = w;
          pure[1] = 1;
          pure[2] = 0;
          break;
        case 2:
          pure[0] = 0;
          pure[1] = 1;
          pure[2] = v;
          break;
        case 3:
          pure[0] = 0;
          pure[1] = w;
          pure[2] = 1;
          break;
        case 4:
          pure[0] = v;
          pure[1] = 0;
          pure[2] = 1;
          break;
        default:
          pure[0] = 1;
          pure[1] = 0;
          pure[2] = w;
      }
      mg = (1 - c) * g;
      return [
        (c * pure[0] + mg) * 255,
        (c * pure[1] + mg) * 255,
        (c * pure[2] + mg) * 255
      ];
    };
    convert.hcg.hsv = function(hcg) {
      const c = hcg[1] / 100;
      const g = hcg[2] / 100;
      const v = c + g * (1 - c);
      let f = 0;
      if (v > 0) {
        f = c / v;
      }
      return [hcg[0], f * 100, v * 100];
    };
    convert.hcg.hsl = function(hcg) {
      const c = hcg[1] / 100;
      const g = hcg[2] / 100;
      const l = g * (1 - c) + 0.5 * c;
      let s = 0;
      if (l > 0 && l < 0.5) {
        s = c / (2 * l);
      } else if (l >= 0.5 && l < 1) {
        s = c / (2 * (1 - l));
      }
      return [hcg[0], s * 100, l * 100];
    };
    convert.hcg.hwb = function(hcg) {
      const c = hcg[1] / 100;
      const g = hcg[2] / 100;
      const v = c + g * (1 - c);
      return [hcg[0], (v - c) * 100, (1 - v) * 100];
    };
    convert.hwb.hcg = function(hwb) {
      const w = hwb[1] / 100;
      const b = hwb[2] / 100;
      const v = 1 - b;
      const c = v - w;
      let g = 0;
      if (c < 1) {
        g = (v - c) / (1 - c);
      }
      return [hwb[0], c * 100, g * 100];
    };
    convert.apple.rgb = function(apple) {
      return [apple[0] / 65535 * 255, apple[1] / 65535 * 255, apple[2] / 65535 * 255];
    };
    convert.rgb.apple = function(rgb) {
      return [rgb[0] / 255 * 65535, rgb[1] / 255 * 65535, rgb[2] / 255 * 65535];
    };
    convert.gray.rgb = function(args) {
      return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255];
    };
    convert.gray.hsl = function(args) {
      return [0, 0, args[0]];
    };
    convert.gray.hsv = convert.gray.hsl;
    convert.gray.hwb = function(gray) {
      return [0, 100, gray[0]];
    };
    convert.gray.cmyk = function(gray) {
      return [0, 0, 0, gray[0]];
    };
    convert.gray.lab = function(gray) {
      return [gray[0], 0, 0];
    };
    convert.gray.hex = function(gray) {
      const val = Math.round(gray[0] / 100 * 255) & 255;
      const integer = (val << 16) + (val << 8) + val;
      const string = integer.toString(16).toUpperCase();
      return "000000".substring(string.length) + string;
    };
    convert.rgb.gray = function(rgb) {
      const val = (rgb[0] + rgb[1] + rgb[2]) / 3;
      return [val / 255 * 100];
    };
  }
});

// node_modules/color-convert/route.js
var require_route = __commonJS({
  "node_modules/color-convert/route.js"(exports2, module2) {
    var conversions = require_conversions();
    function buildGraph() {
      const graph = {};
      const models = Object.keys(conversions);
      for (let len = models.length, i = 0; i < len; i++) {
        graph[models[i]] = {
          // http://jsperf.com/1-vs-infinity
          // micro-opt, but this is simple.
          distance: -1,
          parent: null
        };
      }
      return graph;
    }
    function deriveBFS(fromModel) {
      const graph = buildGraph();
      const queue = [fromModel];
      graph[fromModel].distance = 0;
      while (queue.length) {
        const current = queue.pop();
        const adjacents = Object.keys(conversions[current]);
        for (let len = adjacents.length, i = 0; i < len; i++) {
          const adjacent = adjacents[i];
          const node = graph[adjacent];
          if (node.distance === -1) {
            node.distance = graph[current].distance + 1;
            node.parent = current;
            queue.unshift(adjacent);
          }
        }
      }
      return graph;
    }
    function link(from, to) {
      return function(args) {
        return to(from(args));
      };
    }
    function wrapConversion(toModel, graph) {
      const path4 = [graph[toModel].parent, toModel];
      let fn = conversions[graph[toModel].parent][toModel];
      let cur = graph[toModel].parent;
      while (graph[cur].parent) {
        path4.unshift(graph[cur].parent);
        fn = link(conversions[graph[cur].parent][cur], fn);
        cur = graph[cur].parent;
      }
      fn.conversion = path4;
      return fn;
    }
    module2.exports = function(fromModel) {
      const graph = deriveBFS(fromModel);
      const conversion = {};
      const models = Object.keys(graph);
      for (let len = models.length, i = 0; i < len; i++) {
        const toModel = models[i];
        const node = graph[toModel];
        if (node.parent === null) {
          continue;
        }
        conversion[toModel] = wrapConversion(toModel, graph);
      }
      return conversion;
    };
  }
});

// node_modules/color-convert/index.js
var require_color_convert = __commonJS({
  "node_modules/color-convert/index.js"(exports2, module2) {
    var conversions = require_conversions();
    var route = require_route();
    var convert = {};
    var models = Object.keys(conversions);
    function wrapRaw(fn) {
      const wrappedFn = function(...args) {
        const arg0 = args[0];
        if (arg0 === void 0 || arg0 === null) {
          return arg0;
        }
        if (arg0.length > 1) {
          args = arg0;
        }
        return fn(args);
      };
      if ("conversion" in fn) {
        wrappedFn.conversion = fn.conversion;
      }
      return wrappedFn;
    }
    function wrapRounded(fn) {
      const wrappedFn = function(...args) {
        const arg0 = args[0];
        if (arg0 === void 0 || arg0 === null) {
          return arg0;
        }
        if (arg0.length > 1) {
          args = arg0;
        }
        const result = fn(args);
        if (typeof result === "object") {
          for (let len = result.length, i = 0; i < len; i++) {
            result[i] = Math.round(result[i]);
          }
        }
        return result;
      };
      if ("conversion" in fn) {
        wrappedFn.conversion = fn.conversion;
      }
      return wrappedFn;
    }
    models.forEach((fromModel) => {
      convert[fromModel] = {};
      Object.defineProperty(convert[fromModel], "channels", { value: conversions[fromModel].channels });
      Object.defineProperty(convert[fromModel], "labels", { value: conversions[fromModel].labels });
      const routes = route(fromModel);
      const routeModels = Object.keys(routes);
      routeModels.forEach((toModel) => {
        const fn = routes[toModel];
        convert[fromModel][toModel] = wrapRounded(fn);
        convert[fromModel][toModel].raw = wrapRaw(fn);
      });
    });
    module2.exports = convert;
  }
});

// node_modules/ansi-styles/index.js
var require_ansi_styles2 = __commonJS({
  "node_modules/ansi-styles/index.js"(exports2, module2) {
    "use strict";
    var wrapAnsi16 = (fn, offset) => (...args) => {
      const code = fn(...args);
      return `\x1B[${code + offset}m`;
    };
    var wrapAnsi256 = (fn, offset) => (...args) => {
      const code = fn(...args);
      return `\x1B[${38 + offset};5;${code}m`;
    };
    var wrapAnsi16m = (fn, offset) => (...args) => {
      const rgb = fn(...args);
      return `\x1B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`;
    };
    var ansi2ansi = (n) => n;
    var rgb2rgb = (r, g, b) => [r, g, b];
    var setLazyProperty = (object, property, get) => {
      Object.defineProperty(object, property, {
        get: () => {
          const value = get();
          Object.defineProperty(object, property, {
            value,
            enumerable: true,
            configurable: true
          });
          return value;
        },
        enumerable: true,
        configurable: true
      });
    };
    var colorConvert;
    var makeDynamicStyles = (wrap, targetSpace, identity, isBackground) => {
      if (colorConvert === void 0) {
        colorConvert = require_color_convert();
      }
      const offset = isBackground ? 10 : 0;
      const styles = {};
      for (const [sourceSpace, suite] of Object.entries(colorConvert)) {
        const name = sourceSpace === "ansi16" ? "ansi" : sourceSpace;
        if (sourceSpace === targetSpace) {
          styles[name] = wrap(identity, offset);
        } else if (typeof suite === "object") {
          styles[name] = wrap(suite[targetSpace], offset);
        }
      }
      return styles;
    };
    function assembleStyles() {
      const codes = /* @__PURE__ */ new Map();
      const styles = {
        modifier: {
          reset: [0, 0],
          // 21 isn't widely supported and 22 does the same thing
          bold: [1, 22],
          dim: [2, 22],
          italic: [3, 23],
          underline: [4, 24],
          inverse: [7, 27],
          hidden: [8, 28],
          strikethrough: [9, 29]
        },
        color: {
          black: [30, 39],
          red: [31, 39],
          green: [32, 39],
          yellow: [33, 39],
          blue: [34, 39],
          magenta: [35, 39],
          cyan: [36, 39],
          white: [37, 39],
          // Bright color
          blackBright: [90, 39],
          redBright: [91, 39],
          greenBright: [92, 39],
          yellowBright: [93, 39],
          blueBright: [94, 39],
          magentaBright: [95, 39],
          cyanBright: [96, 39],
          whiteBright: [97, 39]
        },
        bgColor: {
          bgBlack: [40, 49],
          bgRed: [41, 49],
          bgGreen: [42, 49],
          bgYellow: [43, 49],
          bgBlue: [44, 49],
          bgMagenta: [45, 49],
          bgCyan: [46, 49],
          bgWhite: [47, 49],
          // Bright color
          bgBlackBright: [100, 49],
          bgRedBright: [101, 49],
          bgGreenBright: [102, 49],
          bgYellowBright: [103, 49],
          bgBlueBright: [104, 49],
          bgMagentaBright: [105, 49],
          bgCyanBright: [106, 49],
          bgWhiteBright: [107, 49]
        }
      };
      styles.color.gray = styles.color.blackBright;
      styles.bgColor.bgGray = styles.bgColor.bgBlackBright;
      styles.color.grey = styles.color.blackBright;
      styles.bgColor.bgGrey = styles.bgColor.bgBlackBright;
      for (const [groupName, group] of Object.entries(styles)) {
        for (const [styleName, style] of Object.entries(group)) {
          styles[styleName] = {
            open: `\x1B[${style[0]}m`,
            close: `\x1B[${style[1]}m`
          };
          group[styleName] = styles[styleName];
          codes.set(style[0], style[1]);
        }
        Object.defineProperty(styles, groupName, {
          value: group,
          enumerable: false
        });
      }
      Object.defineProperty(styles, "codes", {
        value: codes,
        enumerable: false
      });
      styles.color.close = "\x1B[39m";
      styles.bgColor.close = "\x1B[49m";
      setLazyProperty(styles.color, "ansi", () => makeDynamicStyles(wrapAnsi16, "ansi16", ansi2ansi, false));
      setLazyProperty(styles.color, "ansi256", () => makeDynamicStyles(wrapAnsi256, "ansi256", ansi2ansi, false));
      setLazyProperty(styles.color, "ansi16m", () => makeDynamicStyles(wrapAnsi16m, "rgb", rgb2rgb, false));
      setLazyProperty(styles.bgColor, "ansi", () => makeDynamicStyles(wrapAnsi16, "ansi16", ansi2ansi, true));
      setLazyProperty(styles.bgColor, "ansi256", () => makeDynamicStyles(wrapAnsi256, "ansi256", ansi2ansi, true));
      setLazyProperty(styles.bgColor, "ansi16m", () => makeDynamicStyles(wrapAnsi16m, "rgb", rgb2rgb, true));
      return styles;
    }
    Object.defineProperty(module2, "exports", {
      enumerable: true,
      get: assembleStyles
    });
  }
});

// node_modules/has-flag/index.js
var require_has_flag = __commonJS({
  "node_modules/has-flag/index.js"(exports2, module2) {
    "use strict";
    module2.exports = (flag, argv = process.argv) => {
      const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
      const position = argv.indexOf(prefix + flag);
      const terminatorPosition = argv.indexOf("--");
      return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
    };
  }
});

// node_modules/chalk/node_modules/supports-color/index.js
var require_supports_color = __commonJS({
  "node_modules/chalk/node_modules/supports-color/index.js"(exports2, module2) {
    "use strict";
    var os = require("os");
    var tty = require("tty");
    var hasFlag = require_has_flag();
    var { env } = process;
    var forceColor;
    if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
      forceColor = 0;
    } else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
      forceColor = 1;
    }
    if ("FORCE_COLOR" in env) {
      if (env.FORCE_COLOR === "true") {
        forceColor = 1;
      } else if (env.FORCE_COLOR === "false") {
        forceColor = 0;
      } else {
        forceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3);
      }
    }
    function translateLevel(level) {
      if (level === 0) {
        return false;
      }
      return {
        level,
        hasBasic: true,
        has256: level >= 2,
        has16m: level >= 3
      };
    }
    function supportsColor(haveStream, streamIsTTY) {
      if (forceColor === 0) {
        return 0;
      }
      if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
        return 3;
      }
      if (hasFlag("color=256")) {
        return 2;
      }
      if (haveStream && !streamIsTTY && forceColor === void 0) {
        return 0;
      }
      const min = forceColor || 0;
      if (env.TERM === "dumb") {
        return min;
      }
      if (process.platform === "win32") {
        const osRelease = os.release().split(".");
        if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
          return Number(osRelease[2]) >= 14931 ? 3 : 2;
        }
        return 1;
      }
      if ("CI" in env) {
        if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "GITHUB_ACTIONS", "BUILDKITE"].some((sign) => sign in env) || env.CI_NAME === "codeship") {
          return 1;
        }
        return min;
      }
      if ("TEAMCITY_VERSION" in env) {
        return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
      }
      if (env.COLORTERM === "truecolor") {
        return 3;
      }
      if ("TERM_PROGRAM" in env) {
        const version = parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
        switch (env.TERM_PROGRAM) {
          case "iTerm.app":
            return version >= 3 ? 3 : 2;
          case "Apple_Terminal":
            return 2;
        }
      }
      if (/-256(color)?$/i.test(env.TERM)) {
        return 2;
      }
      if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
        return 1;
      }
      if ("COLORTERM" in env) {
        return 1;
      }
      return min;
    }
    function getSupportLevel(stream) {
      const level = supportsColor(stream, stream && stream.isTTY);
      return translateLevel(level);
    }
    module2.exports = {
      supportsColor: getSupportLevel,
      stdout: translateLevel(supportsColor(true, tty.isatty(1))),
      stderr: translateLevel(supportsColor(true, tty.isatty(2)))
    };
  }
});

// node_modules/chalk/source/util.js
var require_util = __commonJS({
  "node_modules/chalk/source/util.js"(exports2, module2) {
    "use strict";
    var stringReplaceAll = (string, substring, replacer) => {
      let index = string.indexOf(substring);
      if (index === -1) {
        return string;
      }
      const substringLength = substring.length;
      let endIndex = 0;
      let returnValue = "";
      do {
        returnValue += string.substr(endIndex, index - endIndex) + substring + replacer;
        endIndex = index + substringLength;
        index = string.indexOf(substring, endIndex);
      } while (index !== -1);
      returnValue += string.substr(endIndex);
      return returnValue;
    };
    var stringEncaseCRLFWithFirstIndex = (string, prefix, postfix, index) => {
      let endIndex = 0;
      let returnValue = "";
      do {
        const gotCR = string[index - 1] === "\r";
        returnValue += string.substr(endIndex, (gotCR ? index - 1 : index) - endIndex) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
        endIndex = index + 1;
        index = string.indexOf("\n", endIndex);
      } while (index !== -1);
      returnValue += string.substr(endIndex);
      return returnValue;
    };
    module2.exports = {
      stringReplaceAll,
      stringEncaseCRLFWithFirstIndex
    };
  }
});

// node_modules/chalk/source/templates.js
var require_templates = __commonJS({
  "node_modules/chalk/source/templates.js"(exports2, module2) {
    "use strict";
    var TEMPLATE_REGEX = /(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi;
    var STYLE_REGEX = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g;
    var STRING_REGEX = /^(['"])((?:\\.|(?!\1)[^\\])*)\1$/;
    var ESCAPE_REGEX = /\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi;
    var ESCAPES = /* @__PURE__ */ new Map([
      ["n", "\n"],
      ["r", "\r"],
      ["t", "	"],
      ["b", "\b"],
      ["f", "\f"],
      ["v", "\v"],
      ["0", "\0"],
      ["\\", "\\"],
      ["e", "\x1B"],
      ["a", "\x07"]
    ]);
    function unescape(c) {
      const u = c[0] === "u";
      const bracket = c[1] === "{";
      if (u && !bracket && c.length === 5 || c[0] === "x" && c.length === 3) {
        return String.fromCharCode(parseInt(c.slice(1), 16));
      }
      if (u && bracket) {
        return String.fromCodePoint(parseInt(c.slice(2, -1), 16));
      }
      return ESCAPES.get(c) || c;
    }
    function parseArguments(name, arguments_) {
      const results = [];
      const chunks = arguments_.trim().split(/\s*,\s*/g);
      let matches;
      for (const chunk of chunks) {
        const number = Number(chunk);
        if (!Number.isNaN(number)) {
          results.push(number);
        } else if (matches = chunk.match(STRING_REGEX)) {
          results.push(matches[2].replace(ESCAPE_REGEX, (m, escape, character) => escape ? unescape(escape) : character));
        } else {
          throw new Error(`Invalid Chalk template style argument: ${chunk} (in style '${name}')`);
        }
      }
      return results;
    }
    function parseStyle(style) {
      STYLE_REGEX.lastIndex = 0;
      const results = [];
      let matches;
      while ((matches = STYLE_REGEX.exec(style)) !== null) {
        const name = matches[1];
        if (matches[2]) {
          const args = parseArguments(name, matches[2]);
          results.push([name].concat(args));
        } else {
          results.push([name]);
        }
      }
      return results;
    }
    function buildStyle(chalk, styles) {
      const enabled = {};
      for (const layer of styles) {
        for (const style of layer.styles) {
          enabled[style[0]] = layer.inverse ? null : style.slice(1);
        }
      }
      let current = chalk;
      for (const [styleName, styles2] of Object.entries(enabled)) {
        if (!Array.isArray(styles2)) {
          continue;
        }
        if (!(styleName in current)) {
          throw new Error(`Unknown Chalk style: ${styleName}`);
        }
        current = styles2.length > 0 ? current[styleName](...styles2) : current[styleName];
      }
      return current;
    }
    module2.exports = (chalk, temporary) => {
      const styles = [];
      const chunks = [];
      let chunk = [];
      temporary.replace(TEMPLATE_REGEX, (m, escapeCharacter, inverse, style, close, character) => {
        if (escapeCharacter) {
          chunk.push(unescape(escapeCharacter));
        } else if (style) {
          const string = chunk.join("");
          chunk = [];
          chunks.push(styles.length === 0 ? string : buildStyle(chalk, styles)(string));
          styles.push({ inverse, styles: parseStyle(style) });
        } else if (close) {
          if (styles.length === 0) {
            throw new Error("Found extraneous } in Chalk template literal");
          }
          chunks.push(buildStyle(chalk, styles)(chunk.join("")));
          chunk = [];
          styles.pop();
        } else {
          chunk.push(character);
        }
      });
      chunks.push(chunk.join(""));
      if (styles.length > 0) {
        const errMessage = `Chalk template literal is missing ${styles.length} closing bracket${styles.length === 1 ? "" : "s"} (\`}\`)`;
        throw new Error(errMessage);
      }
      return chunks.join("");
    };
  }
});

// node_modules/chalk/source/index.js
var require_source = __commonJS({
  "node_modules/chalk/source/index.js"(exports2, module2) {
    "use strict";
    var ansiStyles = require_ansi_styles2();
    var { stdout: stdoutColor, stderr: stderrColor } = require_supports_color();
    var {
      stringReplaceAll,
      stringEncaseCRLFWithFirstIndex
    } = require_util();
    var { isArray } = Array;
    var levelMapping = [
      "ansi",
      "ansi",
      "ansi256",
      "ansi16m"
    ];
    var styles = /* @__PURE__ */ Object.create(null);
    var applyOptions = (object, options = {}) => {
      if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) {
        throw new Error("The `level` option should be an integer from 0 to 3");
      }
      const colorLevel = stdoutColor ? stdoutColor.level : 0;
      object.level = options.level === void 0 ? colorLevel : options.level;
    };
    var ChalkClass = class {
      constructor(options) {
        return chalkFactory(options);
      }
    };
    var chalkFactory = (options) => {
      const chalk2 = {};
      applyOptions(chalk2, options);
      chalk2.template = (...arguments_) => chalkTag(chalk2.template, ...arguments_);
      Object.setPrototypeOf(chalk2, Chalk.prototype);
      Object.setPrototypeOf(chalk2.template, chalk2);
      chalk2.template.constructor = () => {
        throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.");
      };
      chalk2.template.Instance = ChalkClass;
      return chalk2.template;
    };
    function Chalk(options) {
      return chalkFactory(options);
    }
    for (const [styleName, style] of Object.entries(ansiStyles)) {
      styles[styleName] = {
        get() {
          const builder = createBuilder(this, createStyler(style.open, style.close, this._styler), this._isEmpty);
          Object.defineProperty(this, styleName, { value: builder });
          return builder;
        }
      };
    }
    styles.visible = {
      get() {
        const builder = createBuilder(this, this._styler, true);
        Object.defineProperty(this, "visible", { value: builder });
        return builder;
      }
    };
    var usedModels = ["rgb", "hex", "keyword", "hsl", "hsv", "hwb", "ansi", "ansi256"];
    for (const model of usedModels) {
      styles[model] = {
        get() {
          const { level } = this;
          return function(...arguments_) {
            const styler = createStyler(ansiStyles.color[levelMapping[level]][model](...arguments_), ansiStyles.color.close, this._styler);
            return createBuilder(this, styler, this._isEmpty);
          };
        }
      };
    }
    for (const model of usedModels) {
      const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
      styles[bgModel] = {
        get() {
          const { level } = this;
          return function(...arguments_) {
            const styler = createStyler(ansiStyles.bgColor[levelMapping[level]][model](...arguments_), ansiStyles.bgColor.close, this._styler);
            return createBuilder(this, styler, this._isEmpty);
          };
        }
      };
    }
    var proto = Object.defineProperties(() => {
    }, {
      ...styles,
      level: {
        enumerable: true,
        get() {
          return this._generator.level;
        },
        set(level) {
          this._generator.level = level;
        }
      }
    });
    var createStyler = (open, close, parent) => {
      let openAll;
      let closeAll;
      if (parent === void 0) {
        openAll = open;
        closeAll = close;
      } else {
        openAll = parent.openAll + open;
        closeAll = close + parent.closeAll;
      }
      return {
        open,
        close,
        openAll,
        closeAll,
        parent
      };
    };
    var createBuilder = (self, _styler, _isEmpty) => {
      const builder = (...arguments_) => {
        if (isArray(arguments_[0]) && isArray(arguments_[0].raw)) {
          return applyStyle(builder, chalkTag(builder, ...arguments_));
        }
        return applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
      };
      Object.setPrototypeOf(builder, proto);
      builder._generator = self;
      builder._styler = _styler;
      builder._isEmpty = _isEmpty;
      return builder;
    };
    var applyStyle = (self, string) => {
      if (self.level <= 0 || !string) {
        return self._isEmpty ? "" : string;
      }
      let styler = self._styler;
      if (styler === void 0) {
        return string;
      }
      const { openAll, closeAll } = styler;
      if (string.indexOf("\x1B") !== -1) {
        while (styler !== void 0) {
          string = stringReplaceAll(string, styler.close, styler.open);
          styler = styler.parent;
        }
      }
      const lfIndex = string.indexOf("\n");
      if (lfIndex !== -1) {
        string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);
      }
      return openAll + string + closeAll;
    };
    var template;
    var chalkTag = (chalk2, ...strings) => {
      const [firstString] = strings;
      if (!isArray(firstString) || !isArray(firstString.raw)) {
        return strings.join(" ");
      }
      const arguments_ = strings.slice(1);
      const parts = [firstString.raw[0]];
      for (let i = 1; i < firstString.length; i++) {
        parts.push(
          String(arguments_[i - 1]).replace(/[{}\\]/g, "\\$&"),
          String(firstString.raw[i])
        );
      }
      if (template === void 0) {
        template = require_templates();
      }
      return template(chalk2, parts.join(""));
    };
    Object.defineProperties(Chalk.prototype, styles);
    var chalk = Chalk();
    chalk.supportsColor = stdoutColor;
    chalk.stderr = Chalk({ level: stderrColor ? stderrColor.level : 0 });
    chalk.stderr.supportsColor = stderrColor;
    module2.exports = chalk;
  }
});

// node_modules/@jest/diff-sequences/build/index.js
var require_build4 = __commonJS({
  "node_modules/@jest/diff-sequences/build/index.js"(exports2, module2) {
    (() => {
      "use strict";
      var __webpack_exports__ = {};
      (() => {
        var exports3 = __webpack_exports__;
        Object.defineProperty(exports3, "__esModule", {
          value: true
        });
        exports3["default"] = diffSequence;
        const pkg = "@jest/diff-sequences";
        const NOT_YET_SET = 0;
        const countCommonItemsF = (aIndex, aEnd, bIndex, bEnd, isCommon) => {
          let nCommon = 0;
          while (aIndex < aEnd && bIndex < bEnd && isCommon(aIndex, bIndex)) {
            aIndex += 1;
            bIndex += 1;
            nCommon += 1;
          }
          return nCommon;
        };
        const countCommonItemsR = (aStart, aIndex, bStart, bIndex, isCommon) => {
          let nCommon = 0;
          while (aStart <= aIndex && bStart <= bIndex && isCommon(aIndex, bIndex)) {
            aIndex -= 1;
            bIndex -= 1;
            nCommon += 1;
          }
          return nCommon;
        };
        const extendPathsF = (d, aEnd, bEnd, bF, isCommon, aIndexesF, iMaxF) => {
          let iF = 0;
          let kF = -d;
          let aFirst = aIndexesF[iF];
          let aIndexPrev1 = aFirst;
          aIndexesF[iF] += countCommonItemsF(aFirst + 1, aEnd, bF + aFirst - kF + 1, bEnd, isCommon);
          const nF = Math.min(d, iMaxF);
          for (iF += 1, kF += 2; iF <= nF; iF += 1, kF += 2) {
            if (iF !== d && aIndexPrev1 < aIndexesF[iF]) {
              aFirst = aIndexesF[iF];
            } else {
              aFirst = aIndexPrev1 + 1;
              if (aEnd <= aFirst) {
                return iF - 1;
              }
            }
            aIndexPrev1 = aIndexesF[iF];
            aIndexesF[iF] = aFirst + countCommonItemsF(aFirst + 1, aEnd, bF + aFirst - kF + 1, bEnd, isCommon);
          }
          return iMaxF;
        };
        const extendPathsR = (d, aStart, bStart, bR, isCommon, aIndexesR, iMaxR) => {
          let iR = 0;
          let kR = d;
          let aFirst = aIndexesR[iR];
          let aIndexPrev1 = aFirst;
          aIndexesR[iR] -= countCommonItemsR(aStart, aFirst - 1, bStart, bR + aFirst - kR - 1, isCommon);
          const nR = Math.min(d, iMaxR);
          for (iR += 1, kR -= 2; iR <= nR; iR += 1, kR -= 2) {
            if (iR !== d && aIndexesR[iR] < aIndexPrev1) {
              aFirst = aIndexesR[iR];
            } else {
              aFirst = aIndexPrev1 - 1;
              if (aFirst < aStart) {
                return iR - 1;
              }
            }
            aIndexPrev1 = aIndexesR[iR];
            aIndexesR[iR] = aFirst - countCommonItemsR(aStart, aFirst - 1, bStart, bR + aFirst - kR - 1, isCommon);
          }
          return iMaxR;
        };
        const extendOverlappablePathsF = (d, aStart, aEnd, bStart, bEnd, isCommon, aIndexesF, iMaxF, aIndexesR, iMaxR, division) => {
          const bF = bStart - aStart;
          const aLength = aEnd - aStart;
          const bLength = bEnd - bStart;
          const baDeltaLength = bLength - aLength;
          const kMinOverlapF = -baDeltaLength - (d - 1);
          const kMaxOverlapF = -baDeltaLength + (d - 1);
          let aIndexPrev1 = NOT_YET_SET;
          const nF = Math.min(d, iMaxF);
          for (let iF = 0, kF = -d; iF <= nF; iF += 1, kF += 2) {
            const insert = iF === 0 || iF !== d && aIndexPrev1 < aIndexesF[iF];
            const aLastPrev = insert ? aIndexesF[iF] : aIndexPrev1;
            const aFirst = insert ? aLastPrev : aLastPrev + 1;
            const bFirst = bF + aFirst - kF;
            const nCommonF = countCommonItemsF(aFirst + 1, aEnd, bFirst + 1, bEnd, isCommon);
            const aLast = aFirst + nCommonF;
            aIndexPrev1 = aIndexesF[iF];
            aIndexesF[iF] = aLast;
            if (kMinOverlapF <= kF && kF <= kMaxOverlapF) {
              const iR = (d - 1 - (kF + baDeltaLength)) / 2;
              if (iR <= iMaxR && aIndexesR[iR] - 1 <= aLast) {
                const bLastPrev = bF + aLastPrev - (insert ? kF + 1 : kF - 1);
                const nCommonR = countCommonItemsR(aStart, aLastPrev, bStart, bLastPrev, isCommon);
                const aIndexPrevFirst = aLastPrev - nCommonR;
                const bIndexPrevFirst = bLastPrev - nCommonR;
                const aEndPreceding = aIndexPrevFirst + 1;
                const bEndPreceding = bIndexPrevFirst + 1;
                division.nChangePreceding = d - 1;
                if (d - 1 === aEndPreceding + bEndPreceding - aStart - bStart) {
                  division.aEndPreceding = aStart;
                  division.bEndPreceding = bStart;
                } else {
                  division.aEndPreceding = aEndPreceding;
                  division.bEndPreceding = bEndPreceding;
                }
                division.nCommonPreceding = nCommonR;
                if (nCommonR !== 0) {
                  division.aCommonPreceding = aEndPreceding;
                  division.bCommonPreceding = bEndPreceding;
                }
                division.nCommonFollowing = nCommonF;
                if (nCommonF !== 0) {
                  division.aCommonFollowing = aFirst + 1;
                  division.bCommonFollowing = bFirst + 1;
                }
                const aStartFollowing = aLast + 1;
                const bStartFollowing = bFirst + nCommonF + 1;
                division.nChangeFollowing = d - 1;
                if (d - 1 === aEnd + bEnd - aStartFollowing - bStartFollowing) {
                  division.aStartFollowing = aEnd;
                  division.bStartFollowing = bEnd;
                } else {
                  division.aStartFollowing = aStartFollowing;
                  division.bStartFollowing = bStartFollowing;
                }
                return true;
              }
            }
          }
          return false;
        };
        const extendOverlappablePathsR = (d, aStart, aEnd, bStart, bEnd, isCommon, aIndexesF, iMaxF, aIndexesR, iMaxR, division) => {
          const bR = bEnd - aEnd;
          const aLength = aEnd - aStart;
          const bLength = bEnd - bStart;
          const baDeltaLength = bLength - aLength;
          const kMinOverlapR = baDeltaLength - d;
          const kMaxOverlapR = baDeltaLength + d;
          let aIndexPrev1 = NOT_YET_SET;
          const nR = Math.min(d, iMaxR);
          for (let iR = 0, kR = d; iR <= nR; iR += 1, kR -= 2) {
            const insert = iR === 0 || iR !== d && aIndexesR[iR] < aIndexPrev1;
            const aLastPrev = insert ? aIndexesR[iR] : aIndexPrev1;
            const aFirst = insert ? aLastPrev : aLastPrev - 1;
            const bFirst = bR + aFirst - kR;
            const nCommonR = countCommonItemsR(aStart, aFirst - 1, bStart, bFirst - 1, isCommon);
            const aLast = aFirst - nCommonR;
            aIndexPrev1 = aIndexesR[iR];
            aIndexesR[iR] = aLast;
            if (kMinOverlapR <= kR && kR <= kMaxOverlapR) {
              const iF = (d + (kR - baDeltaLength)) / 2;
              if (iF <= iMaxF && aLast - 1 <= aIndexesF[iF]) {
                const bLast = bFirst - nCommonR;
                division.nChangePreceding = d;
                if (d === aLast + bLast - aStart - bStart) {
                  division.aEndPreceding = aStart;
                  division.bEndPreceding = bStart;
                } else {
                  division.aEndPreceding = aLast;
                  division.bEndPreceding = bLast;
                }
                division.nCommonPreceding = nCommonR;
                if (nCommonR !== 0) {
                  division.aCommonPreceding = aLast;
                  division.bCommonPreceding = bLast;
                }
                division.nChangeFollowing = d - 1;
                if (d === 1) {
                  division.nCommonFollowing = 0;
                  division.aStartFollowing = aEnd;
                  division.bStartFollowing = bEnd;
                } else {
                  const bLastPrev = bR + aLastPrev - (insert ? kR - 1 : kR + 1);
                  const nCommonF = countCommonItemsF(aLastPrev, aEnd, bLastPrev, bEnd, isCommon);
                  division.nCommonFollowing = nCommonF;
                  if (nCommonF !== 0) {
                    division.aCommonFollowing = aLastPrev;
                    division.bCommonFollowing = bLastPrev;
                  }
                  const aStartFollowing = aLastPrev + nCommonF;
                  const bStartFollowing = bLastPrev + nCommonF;
                  if (d - 1 === aEnd + bEnd - aStartFollowing - bStartFollowing) {
                    division.aStartFollowing = aEnd;
                    division.bStartFollowing = bEnd;
                  } else {
                    division.aStartFollowing = aStartFollowing;
                    division.bStartFollowing = bStartFollowing;
                  }
                }
                return true;
              }
            }
          }
          return false;
        };
        const divide = (nChange, aStart, aEnd, bStart, bEnd, isCommon, aIndexesF, aIndexesR, division) => {
          const bF = bStart - aStart;
          const bR = bEnd - aEnd;
          const aLength = aEnd - aStart;
          const bLength = bEnd - bStart;
          const baDeltaLength = bLength - aLength;
          let iMaxF = aLength;
          let iMaxR = aLength;
          aIndexesF[0] = aStart - 1;
          aIndexesR[0] = aEnd;
          if (baDeltaLength % 2 === 0) {
            const dMin = (nChange || baDeltaLength) / 2;
            const dMax = (aLength + bLength) / 2;
            for (let d = 1; d <= dMax; d += 1) {
              iMaxF = extendPathsF(d, aEnd, bEnd, bF, isCommon, aIndexesF, iMaxF);
              if (d < dMin) {
                iMaxR = extendPathsR(d, aStart, bStart, bR, isCommon, aIndexesR, iMaxR);
              } else if (
                // If a reverse path overlaps a forward path in the same diagonal,
                // return a division of the index intervals at the middle change.
                extendOverlappablePathsR(d, aStart, aEnd, bStart, bEnd, isCommon, aIndexesF, iMaxF, aIndexesR, iMaxR, division)
              ) {
                return;
              }
            }
          } else {
            const dMin = ((nChange || baDeltaLength) + 1) / 2;
            const dMax = (aLength + bLength + 1) / 2;
            let d = 1;
            iMaxF = extendPathsF(d, aEnd, bEnd, bF, isCommon, aIndexesF, iMaxF);
            for (d += 1; d <= dMax; d += 1) {
              iMaxR = extendPathsR(d - 1, aStart, bStart, bR, isCommon, aIndexesR, iMaxR);
              if (d < dMin) {
                iMaxF = extendPathsF(d, aEnd, bEnd, bF, isCommon, aIndexesF, iMaxF);
              } else if (
                // If a forward path overlaps a reverse path in the same diagonal,
                // return a division of the index intervals at the middle change.
                extendOverlappablePathsF(d, aStart, aEnd, bStart, bEnd, isCommon, aIndexesF, iMaxF, aIndexesR, iMaxR, division)
              ) {
                return;
              }
            }
          }
          throw new Error(`${pkg}: no overlap aStart=${aStart} aEnd=${aEnd} bStart=${bStart} bEnd=${bEnd}`);
        };
        const findSubsequences = (nChange, aStart, aEnd, bStart, bEnd, transposed, callbacks, aIndexesF, aIndexesR, division) => {
          if (bEnd - bStart < aEnd - aStart) {
            transposed = !transposed;
            if (transposed && callbacks.length === 1) {
              const {
                foundSubsequence: foundSubsequence2,
                isCommon: isCommon2
              } = callbacks[0];
              callbacks[1] = {
                foundSubsequence: (nCommon, bCommon, aCommon) => {
                  foundSubsequence2(nCommon, aCommon, bCommon);
                },
                isCommon: (bIndex, aIndex) => isCommon2(aIndex, bIndex)
              };
            }
            const tStart = aStart;
            const tEnd = aEnd;
            aStart = bStart;
            aEnd = bEnd;
            bStart = tStart;
            bEnd = tEnd;
          }
          const {
            foundSubsequence,
            isCommon
          } = callbacks[transposed ? 1 : 0];
          divide(nChange, aStart, aEnd, bStart, bEnd, isCommon, aIndexesF, aIndexesR, division);
          const {
            nChangePreceding,
            aEndPreceding,
            bEndPreceding,
            nCommonPreceding,
            aCommonPreceding,
            bCommonPreceding,
            nCommonFollowing,
            aCommonFollowing,
            bCommonFollowing,
            nChangeFollowing,
            aStartFollowing,
            bStartFollowing
          } = division;
          if (aStart < aEndPreceding && bStart < bEndPreceding) {
            findSubsequences(nChangePreceding, aStart, aEndPreceding, bStart, bEndPreceding, transposed, callbacks, aIndexesF, aIndexesR, division);
          }
          if (nCommonPreceding !== 0) {
            foundSubsequence(nCommonPreceding, aCommonPreceding, bCommonPreceding);
          }
          if (nCommonFollowing !== 0) {
            foundSubsequence(nCommonFollowing, aCommonFollowing, bCommonFollowing);
          }
          if (aStartFollowing < aEnd && bStartFollowing < bEnd) {
            findSubsequences(nChangeFollowing, aStartFollowing, aEnd, bStartFollowing, bEnd, transposed, callbacks, aIndexesF, aIndexesR, division);
          }
        };
        const validateLength = (name, arg) => {
          if (typeof arg !== "number") {
            throw new TypeError(`${pkg}: ${name} typeof ${typeof arg} is not a number`);
          }
          if (!Number.isSafeInteger(arg)) {
            throw new RangeError(`${pkg}: ${name} value ${arg} is not a safe integer`);
          }
          if (arg < 0) {
            throw new RangeError(`${pkg}: ${name} value ${arg} is a negative integer`);
          }
        };
        const validateCallback = (name, arg) => {
          const type = typeof arg;
          if (type !== "function") {
            throw new TypeError(`${pkg}: ${name} typeof ${type} is not a function`);
          }
        };
        function diffSequence(aLength, bLength, isCommon, foundSubsequence) {
          validateLength("aLength", aLength);
          validateLength("bLength", bLength);
          validateCallback("isCommon", isCommon);
          validateCallback("foundSubsequence", foundSubsequence);
          const nCommonF = countCommonItemsF(0, aLength, 0, bLength, isCommon);
          if (nCommonF !== 0) {
            foundSubsequence(nCommonF, 0, 0);
          }
          if (aLength !== nCommonF || bLength !== nCommonF) {
            const aStart = nCommonF;
            const bStart = nCommonF;
            const nCommonR = countCommonItemsR(aStart, aLength - 1, bStart, bLength - 1, isCommon);
            const aEnd = aLength - nCommonR;
            const bEnd = bLength - nCommonR;
            const nCommonFR = nCommonF + nCommonR;
            if (aLength !== nCommonFR && bLength !== nCommonFR) {
              const nChange = 0;
              const transposed = false;
              const callbacks = [{
                foundSubsequence,
                isCommon
              }];
              const aIndexesF = [NOT_YET_SET];
              const aIndexesR = [NOT_YET_SET];
              const division = {
                aCommonFollowing: NOT_YET_SET,
                aCommonPreceding: NOT_YET_SET,
                aEndPreceding: NOT_YET_SET,
                aStartFollowing: NOT_YET_SET,
                bCommonFollowing: NOT_YET_SET,
                bCommonPreceding: NOT_YET_SET,
                bEndPreceding: NOT_YET_SET,
                bStartFollowing: NOT_YET_SET,
                nChangeFollowing: NOT_YET_SET,
                nChangePreceding: NOT_YET_SET,
                nCommonFollowing: NOT_YET_SET,
                nCommonPreceding: NOT_YET_SET
              };
              findSubsequences(nChange, aStart, aEnd, bStart, bEnd, transposed, callbacks, aIndexesF, aIndexesR, division);
            }
            if (nCommonR !== 0) {
              foundSubsequence(nCommonR, aEnd, bEnd);
            }
          }
        }
      })();
      module2.exports = __webpack_exports__;
    })();
  }
});

// node_modules/jest-diff/build/index.js
var require_build5 = __commonJS({
  "node_modules/jest-diff/build/index.js"(exports2, module2) {
    (() => {
      "use strict";
      var __webpack_modules__ = {
        /***/
        "./src/cleanupSemantic.ts": (
          /***/
          ((__unused_webpack_module, exports3) => {
            Object.defineProperty(exports3, "__esModule", {
              value: true
            });
            exports3.cleanupSemantic = exports3.Diff = exports3.DIFF_INSERT = exports3.DIFF_EQUAL = exports3.DIFF_DELETE = void 0;
            var DIFF_DELETE = exports3.DIFF_DELETE = -1;
            var DIFF_INSERT = exports3.DIFF_INSERT = 1;
            var DIFF_EQUAL = exports3.DIFF_EQUAL = 0;
            class Diff {
              0;
              1;
              constructor(op, text) {
                this[0] = op;
                this[1] = text;
              }
            }
            exports3.Diff = Diff;
            var diff_commonPrefix = function(text1, text2) {
              if (!text1 || !text2 || text1.charAt(0) != text2.charAt(0)) {
                return 0;
              }
              var pointermin = 0;
              var pointermax = Math.min(text1.length, text2.length);
              var pointermid = pointermax;
              var pointerstart = 0;
              while (pointermin < pointermid) {
                if (text1.substring(pointerstart, pointermid) == text2.substring(pointerstart, pointermid)) {
                  pointermin = pointermid;
                  pointerstart = pointermin;
                } else {
                  pointermax = pointermid;
                }
                pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);
              }
              return pointermid;
            };
            var diff_commonSuffix = function(text1, text2) {
              if (!text1 || !text2 || text1.charAt(text1.length - 1) != text2.charAt(text2.length - 1)) {
                return 0;
              }
              var pointermin = 0;
              var pointermax = Math.min(text1.length, text2.length);
              var pointermid = pointermax;
              var pointerend = 0;
              while (pointermin < pointermid) {
                if (text1.substring(text1.length - pointermid, text1.length - pointerend) == text2.substring(text2.length - pointermid, text2.length - pointerend)) {
                  pointermin = pointermid;
                  pointerend = pointermin;
                } else {
                  pointermax = pointermid;
                }
                pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);
              }
              return pointermid;
            };
            var diff_commonOverlap_ = function(text1, text2) {
              var text1_length = text1.length;
              var text2_length = text2.length;
              if (text1_length == 0 || text2_length == 0) {
                return 0;
              }
              if (text1_length > text2_length) {
                text1 = text1.substring(text1_length - text2_length);
              } else if (text1_length < text2_length) {
                text2 = text2.substring(0, text1_length);
              }
              var text_length = Math.min(text1_length, text2_length);
              if (text1 == text2) {
                return text_length;
              }
              var best = 0;
              var length = 1;
              while (true) {
                var pattern = text1.substring(text_length - length);
                var found = text2.indexOf(pattern);
                if (found == -1) {
                  return best;
                }
                length += found;
                if (found == 0 || text1.substring(text_length - length) == text2.substring(0, length)) {
                  best = length;
                  length++;
                }
              }
            };
            var diff_cleanupSemantic = function(diffs) {
              var changes = false;
              var equalities = [];
              var equalitiesLength = 0;
              var lastEquality = null;
              var pointer = 0;
              var length_insertions1 = 0;
              var length_deletions1 = 0;
              var length_insertions2 = 0;
              var length_deletions2 = 0;
              while (pointer < diffs.length) {
                if (diffs[pointer][0] == DIFF_EQUAL) {
                  equalities[equalitiesLength++] = pointer;
                  length_insertions1 = length_insertions2;
                  length_deletions1 = length_deletions2;
                  length_insertions2 = 0;
                  length_deletions2 = 0;
                  lastEquality = diffs[pointer][1];
                } else {
                  if (diffs[pointer][0] == DIFF_INSERT) {
                    length_insertions2 += diffs[pointer][1].length;
                  } else {
                    length_deletions2 += diffs[pointer][1].length;
                  }
                  if (lastEquality && lastEquality.length <= Math.max(length_insertions1, length_deletions1) && lastEquality.length <= Math.max(length_insertions2, length_deletions2)) {
                    diffs.splice(equalities[equalitiesLength - 1], 0, new Diff(DIFF_DELETE, lastEquality));
                    diffs[equalities[equalitiesLength - 1] + 1][0] = DIFF_INSERT;
                    equalitiesLength--;
                    equalitiesLength--;
                    pointer = equalitiesLength > 0 ? equalities[equalitiesLength - 1] : -1;
                    length_insertions1 = 0;
                    length_deletions1 = 0;
                    length_insertions2 = 0;
                    length_deletions2 = 0;
                    lastEquality = null;
                    changes = true;
                  }
                }
                pointer++;
              }
              if (changes) {
                diff_cleanupMerge(diffs);
              }
              diff_cleanupSemanticLossless(diffs);
              pointer = 1;
              while (pointer < diffs.length) {
                if (diffs[pointer - 1][0] == DIFF_DELETE && diffs[pointer][0] == DIFF_INSERT) {
                  var deletion = diffs[pointer - 1][1];
                  var insertion = diffs[pointer][1];
                  var overlap_length1 = diff_commonOverlap_(deletion, insertion);
                  var overlap_length2 = diff_commonOverlap_(insertion, deletion);
                  if (overlap_length1 >= overlap_length2) {
                    if (overlap_length1 >= deletion.length / 2 || overlap_length1 >= insertion.length / 2) {
                      diffs.splice(pointer, 0, new Diff(DIFF_EQUAL, insertion.substring(0, overlap_length1)));
                      diffs[pointer - 1][1] = deletion.substring(0, deletion.length - overlap_length1);
                      diffs[pointer + 1][1] = insertion.substring(overlap_length1);
                      pointer++;
                    }
                  } else {
                    if (overlap_length2 >= deletion.length / 2 || overlap_length2 >= insertion.length / 2) {
                      diffs.splice(pointer, 0, new Diff(DIFF_EQUAL, deletion.substring(0, overlap_length2)));
                      diffs[pointer - 1][0] = DIFF_INSERT;
                      diffs[pointer - 1][1] = insertion.substring(0, insertion.length - overlap_length2);
                      diffs[pointer + 1][0] = DIFF_DELETE;
                      diffs[pointer + 1][1] = deletion.substring(overlap_length2);
                      pointer++;
                    }
                  }
                  pointer++;
                }
                pointer++;
              }
            };
            exports3.cleanupSemantic = diff_cleanupSemantic;
            var diff_cleanupSemanticLossless = function(diffs) {
              function diff_cleanupSemanticScore_(one, two) {
                if (!one || !two) {
                  return 6;
                }
                var char1 = one.charAt(one.length - 1);
                var char2 = two.charAt(0);
                var nonAlphaNumeric1 = char1.match(nonAlphaNumericRegex_);
                var nonAlphaNumeric2 = char2.match(nonAlphaNumericRegex_);
                var whitespace1 = nonAlphaNumeric1 && char1.match(whitespaceRegex_);
                var whitespace2 = nonAlphaNumeric2 && char2.match(whitespaceRegex_);
                var lineBreak1 = whitespace1 && char1.match(linebreakRegex_);
                var lineBreak2 = whitespace2 && char2.match(linebreakRegex_);
                var blankLine1 = lineBreak1 && one.match(blanklineEndRegex_);
                var blankLine2 = lineBreak2 && two.match(blanklineStartRegex_);
                if (blankLine1 || blankLine2) {
                  return 5;
                } else if (lineBreak1 || lineBreak2) {
                  return 4;
                } else if (nonAlphaNumeric1 && !whitespace1 && whitespace2) {
                  return 3;
                } else if (whitespace1 || whitespace2) {
                  return 2;
                } else if (nonAlphaNumeric1 || nonAlphaNumeric2) {
                  return 1;
                }
                return 0;
              }
              var pointer = 1;
              while (pointer < diffs.length - 1) {
                if (diffs[pointer - 1][0] == DIFF_EQUAL && diffs[pointer + 1][0] == DIFF_EQUAL) {
                  var equality1 = diffs[pointer - 1][1];
                  var edit = diffs[pointer][1];
                  var equality2 = diffs[pointer + 1][1];
                  var commonOffset = diff_commonSuffix(equality1, edit);
                  if (commonOffset) {
                    var commonString = edit.substring(edit.length - commonOffset);
                    equality1 = equality1.substring(0, equality1.length - commonOffset);
                    edit = commonString + edit.substring(0, edit.length - commonOffset);
                    equality2 = commonString + equality2;
                  }
                  var bestEquality1 = equality1;
                  var bestEdit = edit;
                  var bestEquality2 = equality2;
                  var bestScore = diff_cleanupSemanticScore_(equality1, edit) + diff_cleanupSemanticScore_(edit, equality2);
                  while (edit.charAt(0) === equality2.charAt(0)) {
                    equality1 += edit.charAt(0);
                    edit = edit.substring(1) + equality2.charAt(0);
                    equality2 = equality2.substring(1);
                    var score = diff_cleanupSemanticScore_(equality1, edit) + diff_cleanupSemanticScore_(edit, equality2);
                    if (score >= bestScore) {
                      bestScore = score;
                      bestEquality1 = equality1;
                      bestEdit = edit;
                      bestEquality2 = equality2;
                    }
                  }
                  if (diffs[pointer - 1][1] != bestEquality1) {
                    if (bestEquality1) {
                      diffs[pointer - 1][1] = bestEquality1;
                    } else {
                      diffs.splice(pointer - 1, 1);
                      pointer--;
                    }
                    diffs[pointer][1] = bestEdit;
                    if (bestEquality2) {
                      diffs[pointer + 1][1] = bestEquality2;
                    } else {
                      diffs.splice(pointer + 1, 1);
                      pointer--;
                    }
                  }
                }
                pointer++;
              }
            };
            var nonAlphaNumericRegex_ = /[^a-zA-Z0-9]/;
            var whitespaceRegex_ = /\s/;
            var linebreakRegex_ = /[\r\n]/;
            var blanklineEndRegex_ = /\n\r?\n$/;
            var blanklineStartRegex_ = /^\r?\n\r?\n/;
            var diff_cleanupMerge = function(diffs) {
              diffs.push(new Diff(DIFF_EQUAL, ""));
              var pointer = 0;
              var count_delete = 0;
              var count_insert = 0;
              var text_delete = "";
              var text_insert = "";
              var commonlength;
              while (pointer < diffs.length) {
                switch (diffs[pointer][0]) {
                  case DIFF_INSERT:
                    count_insert++;
                    text_insert += diffs[pointer][1];
                    pointer++;
                    break;
                  case DIFF_DELETE:
                    count_delete++;
                    text_delete += diffs[pointer][1];
                    pointer++;
                    break;
                  case DIFF_EQUAL:
                    if (count_delete + count_insert > 1) {
                      if (count_delete !== 0 && count_insert !== 0) {
                        commonlength = diff_commonPrefix(text_insert, text_delete);
                        if (commonlength !== 0) {
                          if (pointer - count_delete - count_insert > 0 && diffs[pointer - count_delete - count_insert - 1][0] == DIFF_EQUAL) {
                            diffs[pointer - count_delete - count_insert - 1][1] += text_insert.substring(0, commonlength);
                          } else {
                            diffs.splice(0, 0, new Diff(DIFF_EQUAL, text_insert.substring(0, commonlength)));
                            pointer++;
                          }
                          text_insert = text_insert.substring(commonlength);
                          text_delete = text_delete.substring(commonlength);
                        }
                        commonlength = diff_commonSuffix(text_insert, text_delete);
                        if (commonlength !== 0) {
                          diffs[pointer][1] = text_insert.substring(text_insert.length - commonlength) + diffs[pointer][1];
                          text_insert = text_insert.substring(0, text_insert.length - commonlength);
                          text_delete = text_delete.substring(0, text_delete.length - commonlength);
                        }
                      }
                      pointer -= count_delete + count_insert;
                      diffs.splice(pointer, count_delete + count_insert);
                      if (text_delete.length) {
                        diffs.splice(pointer, 0, new Diff(DIFF_DELETE, text_delete));
                        pointer++;
                      }
                      if (text_insert.length) {
                        diffs.splice(pointer, 0, new Diff(DIFF_INSERT, text_insert));
                        pointer++;
                      }
                      pointer++;
                    } else if (pointer !== 0 && diffs[pointer - 1][0] == DIFF_EQUAL) {
                      diffs[pointer - 1][1] += diffs[pointer][1];
                      diffs.splice(pointer, 1);
                    } else {
                      pointer++;
                    }
                    count_insert = 0;
                    count_delete = 0;
                    text_delete = "";
                    text_insert = "";
                    break;
                }
              }
              if (diffs[diffs.length - 1][1] === "") {
                diffs.pop();
              }
              var changes = false;
              pointer = 1;
              while (pointer < diffs.length - 1) {
                if (diffs[pointer - 1][0] == DIFF_EQUAL && diffs[pointer + 1][0] == DIFF_EQUAL) {
                  if (diffs[pointer][1].substring(diffs[pointer][1].length - diffs[pointer - 1][1].length) == diffs[pointer - 1][1]) {
                    diffs[pointer][1] = diffs[pointer - 1][1] + diffs[pointer][1].substring(0, diffs[pointer][1].length - diffs[pointer - 1][1].length);
                    diffs[pointer + 1][1] = diffs[pointer - 1][1] + diffs[pointer + 1][1];
                    diffs.splice(pointer - 1, 1);
                    changes = true;
                  } else if (diffs[pointer][1].substring(0, diffs[pointer + 1][1].length) == diffs[pointer + 1][1]) {
                    diffs[pointer - 1][1] += diffs[pointer + 1][1];
                    diffs[pointer][1] = diffs[pointer][1].substring(diffs[pointer + 1][1].length) + diffs[pointer + 1][1];
                    diffs.splice(pointer + 1, 1);
                    changes = true;
                  }
                }
                pointer++;
              }
              if (changes) {
                diff_cleanupMerge(diffs);
              }
            };
          })
        ),
        /***/
        "./src/constants.ts": (
          /***/
          ((__unused_webpack_module, exports3) => {
            Object.defineProperty(exports3, "__esModule", {
              value: true
            });
            exports3.SIMILAR_MESSAGE = exports3.NO_DIFF_MESSAGE = void 0;
            const NO_DIFF_MESSAGE = exports3.NO_DIFF_MESSAGE = "Compared values have no visual difference.";
            const SIMILAR_MESSAGE = exports3.SIMILAR_MESSAGE = "Compared values serialize to the same structure.\nPrinting internal object structure without calling `toJSON` instead.";
          })
        ),
        /***/
        "./src/diffLines.ts": (
          /***/
          ((__unused_webpack_module, exports3, __webpack_require__2) => {
            Object.defineProperty(exports3, "__esModule", {
              value: true
            });
            exports3.printDiffLines = exports3.diffLinesUnified2 = exports3.diffLinesUnified = exports3.diffLinesRaw = void 0;
            var _diffSequences = _interopRequireDefault(require_build4());
            var _cleanupSemantic = __webpack_require__2("./src/cleanupSemantic.ts");
            var _escapeControlCharacters = __webpack_require__2("./src/escapeControlCharacters.ts");
            var _joinAlignedDiffs = __webpack_require__2("./src/joinAlignedDiffs.ts");
            var _normalizeDiffOptions = __webpack_require__2("./src/normalizeDiffOptions.ts");
            function _interopRequireDefault(e) {
              return e && e.__esModule ? e : { default: e };
            }
            const isEmptyString = (lines) => lines.length === 1 && lines[0].length === 0;
            const countChanges = (diffs) => {
              let a = 0;
              let b = 0;
              for (const diff2 of diffs) {
                switch (diff2[0]) {
                  case _cleanupSemantic.DIFF_DELETE:
                    a += 1;
                    break;
                  case _cleanupSemantic.DIFF_INSERT:
                    b += 1;
                    break;
                }
              }
              return {
                a,
                b
              };
            };
            const printAnnotation = ({
              aAnnotation,
              aColor,
              aIndicator,
              bAnnotation,
              bColor,
              bIndicator,
              includeChangeCounts,
              omitAnnotationLines
            }, changeCounts) => {
              if (omitAnnotationLines) {
                return "";
              }
              let aRest = "";
              let bRest = "";
              if (includeChangeCounts) {
                const aCount = String(changeCounts.a);
                const bCount = String(changeCounts.b);
                const baAnnotationLengthDiff = bAnnotation.length - aAnnotation.length;
                const aAnnotationPadding = " ".repeat(Math.max(0, baAnnotationLengthDiff));
                const bAnnotationPadding = " ".repeat(Math.max(0, -baAnnotationLengthDiff));
                const baCountLengthDiff = bCount.length - aCount.length;
                const aCountPadding = " ".repeat(Math.max(0, baCountLengthDiff));
                const bCountPadding = " ".repeat(Math.max(0, -baCountLengthDiff));
                aRest = `${aAnnotationPadding}  ${aIndicator} ${aCountPadding}${aCount}`;
                bRest = `${bAnnotationPadding}  ${bIndicator} ${bCountPadding}${bCount}`;
              }
              const a = `${aIndicator} ${aAnnotation}${aRest}`;
              const b = `${bIndicator} ${bAnnotation}${bRest}`;
              return `${aColor(a)}
${bColor(b)}

`;
            };
            const printDiffLines = (diffs, options) => printAnnotation(options, countChanges(diffs)) + (options.expand ? (0, _joinAlignedDiffs.joinAlignedDiffsExpand)(diffs, options) : (0, _joinAlignedDiffs.joinAlignedDiffsNoExpand)(diffs, options));
            exports3.printDiffLines = printDiffLines;
            const diffLinesUnified = (aLines, bLines, options) => printDiffLines(diffLinesRaw(isEmptyString(aLines) ? [] : aLines.map(_escapeControlCharacters.escapeControlCharacters), isEmptyString(bLines) ? [] : bLines.map(_escapeControlCharacters.escapeControlCharacters)), (0, _normalizeDiffOptions.normalizeDiffOptions)(options));
            exports3.diffLinesUnified = diffLinesUnified;
            const diffLinesUnified2 = (aLinesDisplay, bLinesDisplay, aLinesCompare, bLinesCompare, options) => {
              if (isEmptyString(aLinesDisplay) && isEmptyString(aLinesCompare)) {
                aLinesDisplay = [];
                aLinesCompare = [];
              }
              if (isEmptyString(bLinesDisplay) && isEmptyString(bLinesCompare)) {
                bLinesDisplay = [];
                bLinesCompare = [];
              }
              if (aLinesDisplay.length !== aLinesCompare.length || bLinesDisplay.length !== bLinesCompare.length) {
                return diffLinesUnified(aLinesDisplay, bLinesDisplay, options);
              }
              const diffs = diffLinesRaw(aLinesCompare, bLinesCompare);
              let aIndex = 0;
              let bIndex = 0;
              for (const diff2 of diffs) {
                switch (diff2[0]) {
                  case _cleanupSemantic.DIFF_DELETE:
                    diff2[1] = aLinesDisplay[aIndex];
                    aIndex += 1;
                    break;
                  case _cleanupSemantic.DIFF_INSERT:
                    diff2[1] = bLinesDisplay[bIndex];
                    bIndex += 1;
                    break;
                  default:
                    diff2[1] = bLinesDisplay[bIndex];
                    aIndex += 1;
                    bIndex += 1;
                }
              }
              return printDiffLines(diffs, (0, _normalizeDiffOptions.normalizeDiffOptions)(options));
            };
            exports3.diffLinesUnified2 = diffLinesUnified2;
            const diffLinesRaw = (aLines, bLines) => {
              const aLength = aLines.length;
              const bLength = bLines.length;
              const isCommon = (aIndex2, bIndex2) => aLines[aIndex2] === bLines[bIndex2];
              const diffs = [];
              let aIndex = 0;
              let bIndex = 0;
              const foundSubsequence = (nCommon, aCommon, bCommon) => {
                for (; aIndex !== aCommon; aIndex += 1) {
                  diffs.push(new _cleanupSemantic.Diff(_cleanupSemantic.DIFF_DELETE, aLines[aIndex]));
                }
                for (; bIndex !== bCommon; bIndex += 1) {
                  diffs.push(new _cleanupSemantic.Diff(_cleanupSemantic.DIFF_INSERT, bLines[bIndex]));
                }
                for (; nCommon !== 0; nCommon -= 1, aIndex += 1, bIndex += 1) {
                  diffs.push(new _cleanupSemantic.Diff(_cleanupSemantic.DIFF_EQUAL, bLines[bIndex]));
                }
              };
              (0, _diffSequences.default)(aLength, bLength, isCommon, foundSubsequence);
              for (; aIndex !== aLength; aIndex += 1) {
                diffs.push(new _cleanupSemantic.Diff(_cleanupSemantic.DIFF_DELETE, aLines[aIndex]));
              }
              for (; bIndex !== bLength; bIndex += 1) {
                diffs.push(new _cleanupSemantic.Diff(_cleanupSemantic.DIFF_INSERT, bLines[bIndex]));
              }
              return diffs;
            };
            exports3.diffLinesRaw = diffLinesRaw;
          })
        ),
        /***/
        "./src/diffStrings.ts": (
          /***/
          ((__unused_webpack_module, exports3, __webpack_require__2) => {
            Object.defineProperty(exports3, "__esModule", {
              value: true
            });
            exports3["default"] = void 0;
            var _diffSequences = _interopRequireDefault(require_build4());
            var _cleanupSemantic = __webpack_require__2("./src/cleanupSemantic.ts");
            function _interopRequireDefault(e) {
              return e && e.__esModule ? e : { default: e };
            }
            const diffStrings = (a, b) => {
              const isCommon = (aIndex2, bIndex2) => a[aIndex2] === b[bIndex2];
              let aIndex = 0;
              let bIndex = 0;
              const diffs = [];
              const foundSubsequence = (nCommon, aCommon, bCommon) => {
                if (aIndex !== aCommon) {
                  diffs.push(new _cleanupSemantic.Diff(_cleanupSemantic.DIFF_DELETE, a.slice(aIndex, aCommon)));
                }
                if (bIndex !== bCommon) {
                  diffs.push(new _cleanupSemantic.Diff(_cleanupSemantic.DIFF_INSERT, b.slice(bIndex, bCommon)));
                }
                aIndex = aCommon + nCommon;
                bIndex = bCommon + nCommon;
                diffs.push(new _cleanupSemantic.Diff(_cleanupSemantic.DIFF_EQUAL, b.slice(bCommon, bIndex)));
              };
              (0, _diffSequences.default)(a.length, b.length, isCommon, foundSubsequence);
              if (aIndex !== a.length) {
                diffs.push(new _cleanupSemantic.Diff(_cleanupSemantic.DIFF_DELETE, a.slice(aIndex)));
              }
              if (bIndex !== b.length) {
                diffs.push(new _cleanupSemantic.Diff(_cleanupSemantic.DIFF_INSERT, b.slice(bIndex)));
              }
              return diffs;
            };
            var _default = exports3["default"] = diffStrings;
          })
        ),
        /***/
        "./src/escapeControlCharacters.ts": (
          /***/
          ((__unused_webpack_module, exports3) => {
            Object.defineProperty(exports3, "__esModule", {
              value: true
            });
            exports3.escapeControlCharacters = void 0;
            const escapeControlCharacters = (str) => str.replaceAll(/[\u0000-\u0008\u000B\u000C\u000E-\u001F\u007F-\u009F]/g, (match) => {
              switch (match) {
                case "\b":
                  return "\\b";
                case "\f":
                  return "\\f";
                case "\v":
                  return "\\v";
                default: {
                  const code = match.codePointAt(0);
                  return `\\x${code.toString(16).padStart(2, "0")}`;
                }
              }
            });
            exports3.escapeControlCharacters = escapeControlCharacters;
          })
        ),
        /***/
        "./src/getAlignedDiffs.ts": (
          /***/
          ((__unused_webpack_module, exports3, __webpack_require__2) => {
            Object.defineProperty(exports3, "__esModule", {
              value: true
            });
            exports3["default"] = void 0;
            var _cleanupSemantic = __webpack_require__2("./src/cleanupSemantic.ts");
            const concatenateRelevantDiffs = (op, diffs, changeColor) => diffs.reduce((reduced, diff2) => reduced + (diff2[0] === _cleanupSemantic.DIFF_EQUAL ? diff2[1] : diff2[0] === op && diff2[1].length > 0 ? changeColor(diff2[1]) : ""), "");
            class ChangeBuffer {
              op;
              line;
              // incomplete line
              lines;
              // complete lines
              changeColor;
              constructor(op, changeColor) {
                this.op = op;
                this.line = [];
                this.lines = [];
                this.changeColor = changeColor;
              }
              pushSubstring(substring) {
                this.pushDiff(new _cleanupSemantic.Diff(this.op, substring));
              }
              pushLine() {
                this.lines.push(
                  this.line.length === 1 ? this.line[0][0] === this.op ? this.line[0] : new _cleanupSemantic.Diff(this.op, this.line[0][1]) : new _cleanupSemantic.Diff(this.op, concatenateRelevantDiffs(this.op, this.line, this.changeColor))
                  // was common diff
                );
                this.line.length = 0;
              }
              isLineEmpty() {
                return this.line.length === 0;
              }
              // Minor input to buffer.
              pushDiff(diff2) {
                this.line.push(diff2);
              }
              // Main input to buffer.
              align(diff2) {
                const string = diff2[1];
                if (string.includes("\n")) {
                  const substrings = string.split("\n");
                  const iLast = substrings.length - 1;
                  for (const [i, substring] of substrings.entries()) {
                    if (i < iLast) {
                      this.pushSubstring(substring);
                      this.pushLine();
                    } else if (substring.length > 0) {
                      this.pushSubstring(substring);
                    }
                  }
                } else {
                  this.pushDiff(diff2);
                }
              }
              // Output from buffer.
              moveLinesTo(lines) {
                if (!this.isLineEmpty()) {
                  this.pushLine();
                }
                lines.push(...this.lines);
                this.lines.length = 0;
              }
            }
            class CommonBuffer {
              deleteBuffer;
              insertBuffer;
              lines;
              constructor(deleteBuffer, insertBuffer) {
                this.deleteBuffer = deleteBuffer;
                this.insertBuffer = insertBuffer;
                this.lines = [];
              }
              pushDiffCommonLine(diff2) {
                this.lines.push(diff2);
              }
              pushDiffChangeLines(diff2) {
                const isDiffEmpty = diff2[1].length === 0;
                if (!isDiffEmpty || this.deleteBuffer.isLineEmpty()) {
                  this.deleteBuffer.pushDiff(diff2);
                }
                if (!isDiffEmpty || this.insertBuffer.isLineEmpty()) {
                  this.insertBuffer.pushDiff(diff2);
                }
              }
              flushChangeLines() {
                this.deleteBuffer.moveLinesTo(this.lines);
                this.insertBuffer.moveLinesTo(this.lines);
              }
              // Input to buffer.
              align(diff2) {
                const op = diff2[0];
                const string = diff2[1];
                if (string.includes("\n")) {
                  const substrings = string.split("\n");
                  const iLast = substrings.length - 1;
                  for (const [i, substring] of substrings.entries()) {
                    if (i === 0) {
                      const subdiff = new _cleanupSemantic.Diff(op, substring);
                      if (this.deleteBuffer.isLineEmpty() && this.insertBuffer.isLineEmpty()) {
                        this.flushChangeLines();
                        this.pushDiffCommonLine(subdiff);
                      } else {
                        this.pushDiffChangeLines(subdiff);
                        this.flushChangeLines();
                      }
                    } else if (i < iLast) {
                      this.pushDiffCommonLine(new _cleanupSemantic.Diff(op, substring));
                    } else if (substring.length > 0) {
                      this.pushDiffChangeLines(new _cleanupSemantic.Diff(op, substring));
                    }
                  }
                } else {
                  this.pushDiffChangeLines(diff2);
                }
              }
              // Output from buffer.
              getLines() {
                this.flushChangeLines();
                return this.lines;
              }
            }
            const getAlignedDiffs = (diffs, changeColor) => {
              const deleteBuffer = new ChangeBuffer(_cleanupSemantic.DIFF_DELETE, changeColor);
              const insertBuffer = new ChangeBuffer(_cleanupSemantic.DIFF_INSERT, changeColor);
              const commonBuffer = new CommonBuffer(deleteBuffer, insertBuffer);
              for (const diff2 of diffs) {
                switch (diff2[0]) {
                  case _cleanupSemantic.DIFF_DELETE:
                    deleteBuffer.align(diff2);
                    break;
                  case _cleanupSemantic.DIFF_INSERT:
                    insertBuffer.align(diff2);
                    break;
                  default:
                    commonBuffer.align(diff2);
                }
              }
              return commonBuffer.getLines();
            };
            var _default = exports3["default"] = getAlignedDiffs;
          })
        ),
        /***/
        "./src/joinAlignedDiffs.ts": (
          /***/
          ((__unused_webpack_module, exports3, __webpack_require__2) => {
            Object.defineProperty(exports3, "__esModule", {
              value: true
            });
            exports3.joinAlignedDiffsNoExpand = exports3.joinAlignedDiffsExpand = void 0;
            var _cleanupSemantic = __webpack_require__2("./src/cleanupSemantic.ts");
            const formatTrailingSpaces = (line, trailingSpaceFormatter) => line.replace(/\s+$/, (match) => trailingSpaceFormatter(match));
            const printDiffLine = (line, isFirstOrLast, color, indicator, trailingSpaceFormatter, emptyFirstOrLastLinePlaceholder) => line.length === 0 ? indicator === " " ? isFirstOrLast && emptyFirstOrLastLinePlaceholder.length > 0 ? color(`${indicator} ${emptyFirstOrLastLinePlaceholder}`) : "" : color(indicator) : color(`${indicator} ${formatTrailingSpaces(line, trailingSpaceFormatter)}`);
            const printDeleteLine = (line, isFirstOrLast, {
              aColor,
              aIndicator,
              changeLineTrailingSpaceColor,
              emptyFirstOrLastLinePlaceholder
            }) => printDiffLine(line, isFirstOrLast, aColor, aIndicator, changeLineTrailingSpaceColor, emptyFirstOrLastLinePlaceholder);
            const printInsertLine = (line, isFirstOrLast, {
              bColor,
              bIndicator,
              changeLineTrailingSpaceColor,
              emptyFirstOrLastLinePlaceholder
            }) => printDiffLine(line, isFirstOrLast, bColor, bIndicator, changeLineTrailingSpaceColor, emptyFirstOrLastLinePlaceholder);
            const printCommonLine = (line, isFirstOrLast, {
              commonColor,
              commonIndicator,
              commonLineTrailingSpaceColor,
              emptyFirstOrLastLinePlaceholder
            }) => printDiffLine(line, isFirstOrLast, commonColor, commonIndicator, commonLineTrailingSpaceColor, emptyFirstOrLastLinePlaceholder);
            const createPatchMark = (aStart, aEnd, bStart, bEnd, {
              patchColor
            }) => patchColor(`@@ -${aStart + 1},${aEnd - aStart} +${bStart + 1},${bEnd - bStart} @@`);
            const joinAlignedDiffsNoExpand = (diffs, options) => {
              const iLength = diffs.length;
              const nContextLines = options.contextLines;
              const nContextLines2 = nContextLines + nContextLines;
              let jLength = iLength;
              let hasExcessAtStartOrEnd = false;
              let nExcessesBetweenChanges = 0;
              let i = 0;
              while (i !== iLength) {
                const iStart = i;
                while (i !== iLength && diffs[i][0] === _cleanupSemantic.DIFF_EQUAL) {
                  i += 1;
                }
                if (iStart !== i) {
                  if (iStart === 0) {
                    if (i > nContextLines) {
                      jLength -= i - nContextLines;
                      hasExcessAtStartOrEnd = true;
                    }
                  } else if (i === iLength) {
                    const n = i - iStart;
                    if (n > nContextLines) {
                      jLength -= n - nContextLines;
                      hasExcessAtStartOrEnd = true;
                    }
                  } else {
                    const n = i - iStart;
                    if (n > nContextLines2) {
                      jLength -= n - nContextLines2;
                      nExcessesBetweenChanges += 1;
                    }
                  }
                }
                while (i !== iLength && diffs[i][0] !== _cleanupSemantic.DIFF_EQUAL) {
                  i += 1;
                }
              }
              const hasPatch = nExcessesBetweenChanges !== 0 || hasExcessAtStartOrEnd;
              if (nExcessesBetweenChanges !== 0) {
                jLength += nExcessesBetweenChanges + 1;
              } else if (hasExcessAtStartOrEnd) {
                jLength += 1;
              }
              const jLast = jLength - 1;
              const lines = [];
              let jPatchMark = 0;
              if (hasPatch) {
                lines.push("");
              }
              let aStart = 0;
              let bStart = 0;
              let aEnd = 0;
              let bEnd = 0;
              const pushCommonLine = (line) => {
                const j = lines.length;
                lines.push(printCommonLine(line, j === 0 || j === jLast, options));
                aEnd += 1;
                bEnd += 1;
              };
              const pushDeleteLine = (line) => {
                const j = lines.length;
                lines.push(printDeleteLine(line, j === 0 || j === jLast, options));
                aEnd += 1;
              };
              const pushInsertLine = (line) => {
                const j = lines.length;
                lines.push(printInsertLine(line, j === 0 || j === jLast, options));
                bEnd += 1;
              };
              i = 0;
              while (i !== iLength) {
                let iStart = i;
                while (i !== iLength && diffs[i][0] === _cleanupSemantic.DIFF_EQUAL) {
                  i += 1;
                }
                if (iStart !== i) {
                  if (iStart === 0) {
                    if (i > nContextLines) {
                      iStart = i - nContextLines;
                      aStart = iStart;
                      bStart = iStart;
                      aEnd = aStart;
                      bEnd = bStart;
                    }
                    for (let iCommon = iStart; iCommon !== i; iCommon += 1) {
                      pushCommonLine(diffs[iCommon][1]);
                    }
                  } else if (i === iLength) {
                    const iEnd = i - iStart > nContextLines ? iStart + nContextLines : i;
                    for (let iCommon = iStart; iCommon !== iEnd; iCommon += 1) {
                      pushCommonLine(diffs[iCommon][1]);
                    }
                  } else {
                    const nCommon = i - iStart;
                    if (nCommon > nContextLines2) {
                      const iEnd = iStart + nContextLines;
                      for (let iCommon = iStart; iCommon !== iEnd; iCommon += 1) {
                        pushCommonLine(diffs[iCommon][1]);
                      }
                      lines[jPatchMark] = createPatchMark(aStart, aEnd, bStart, bEnd, options);
                      jPatchMark = lines.length;
                      lines.push("");
                      const nOmit = nCommon - nContextLines2;
                      aStart = aEnd + nOmit;
                      bStart = bEnd + nOmit;
                      aEnd = aStart;
                      bEnd = bStart;
                      for (let iCommon = i - nContextLines; iCommon !== i; iCommon += 1) {
                        pushCommonLine(diffs[iCommon][1]);
                      }
                    } else {
                      for (let iCommon = iStart; iCommon !== i; iCommon += 1) {
                        pushCommonLine(diffs[iCommon][1]);
                      }
                    }
                  }
                }
                while (i !== iLength && diffs[i][0] === _cleanupSemantic.DIFF_DELETE) {
                  pushDeleteLine(diffs[i][1]);
                  i += 1;
                }
                while (i !== iLength && diffs[i][0] === _cleanupSemantic.DIFF_INSERT) {
                  pushInsertLine(diffs[i][1]);
                  i += 1;
                }
              }
              if (hasPatch) {
                lines[jPatchMark] = createPatchMark(aStart, aEnd, bStart, bEnd, options);
              }
              return lines.join("\n");
            };
            exports3.joinAlignedDiffsNoExpand = joinAlignedDiffsNoExpand;
            const joinAlignedDiffsExpand = (diffs, options) => diffs.map((diff2, i, diffs2) => {
              const line = diff2[1];
              const isFirstOrLast = i === 0 || i === diffs2.length - 1;
              switch (diff2[0]) {
                case _cleanupSemantic.DIFF_DELETE:
                  return printDeleteLine(line, isFirstOrLast, options);
                case _cleanupSemantic.DIFF_INSERT:
                  return printInsertLine(line, isFirstOrLast, options);
                default:
                  return printCommonLine(line, isFirstOrLast, options);
              }
            }).join("\n");
            exports3.joinAlignedDiffsExpand = joinAlignedDiffsExpand;
          })
        ),
        /***/
        "./src/normalizeDiffOptions.ts": (
          /***/
          ((__unused_webpack_module, exports3) => {
            Object.defineProperty(exports3, "__esModule", {
              value: true
            });
            exports3.normalizeDiffOptions = exports3.noColor = void 0;
            var _chalk = _interopRequireDefault(require_source());
            function _interopRequireDefault(e) {
              return e && e.__esModule ? e : { default: e };
            }
            const noColor = (string) => string;
            exports3.noColor = noColor;
            const DIFF_CONTEXT_DEFAULT = 5;
            const OPTIONS_DEFAULT = {
              aAnnotation: "Expected",
              aColor: _chalk.default.green,
              aIndicator: "-",
              bAnnotation: "Received",
              bColor: _chalk.default.red,
              bIndicator: "+",
              changeColor: _chalk.default.inverse,
              changeLineTrailingSpaceColor: noColor,
              commonColor: _chalk.default.dim,
              commonIndicator: " ",
              commonLineTrailingSpaceColor: noColor,
              compareKeys: void 0,
              contextLines: DIFF_CONTEXT_DEFAULT,
              emptyFirstOrLastLinePlaceholder: "",
              expand: true,
              includeChangeCounts: false,
              omitAnnotationLines: false,
              patchColor: _chalk.default.yellow
            };
            const getCompareKeys = (compareKeys) => compareKeys && typeof compareKeys === "function" ? compareKeys : OPTIONS_DEFAULT.compareKeys;
            const getContextLines = (contextLines) => typeof contextLines === "number" && Number.isSafeInteger(contextLines) && contextLines >= 0 ? contextLines : DIFF_CONTEXT_DEFAULT;
            const normalizeDiffOptions = (options = {}) => ({
              ...OPTIONS_DEFAULT,
              ...options,
              compareKeys: getCompareKeys(options.compareKeys),
              contextLines: getContextLines(options.contextLines)
            });
            exports3.normalizeDiffOptions = normalizeDiffOptions;
          })
        ),
        /***/
        "./src/printDiffs.ts": (
          /***/
          ((__unused_webpack_module, exports3, __webpack_require__2) => {
            Object.defineProperty(exports3, "__esModule", {
              value: true
            });
            exports3.diffStringsUnified = exports3.diffStringsRaw = void 0;
            var _cleanupSemantic = __webpack_require__2("./src/cleanupSemantic.ts");
            var _diffLines = __webpack_require__2("./src/diffLines.ts");
            var _diffStrings = _interopRequireDefault(__webpack_require__2("./src/diffStrings.ts"));
            var _getAlignedDiffs = _interopRequireDefault(__webpack_require__2("./src/getAlignedDiffs.ts"));
            var _normalizeDiffOptions = __webpack_require__2("./src/normalizeDiffOptions.ts");
            function _interopRequireDefault(e) {
              return e && e.__esModule ? e : { default: e };
            }
            const hasCommonDiff = (diffs, isMultiline) => {
              if (isMultiline) {
                const iLast = diffs.length - 1;
                return diffs.some((diff2, i) => diff2[0] === _cleanupSemantic.DIFF_EQUAL && (i !== iLast || diff2[1] !== "\n"));
              }
              return diffs.some((diff2) => diff2[0] === _cleanupSemantic.DIFF_EQUAL);
            };
            const diffStringsUnified = (a, b, options) => {
              if (a !== b && a.length > 0 && b.length > 0) {
                const isMultiline = a.includes("\n") || b.includes("\n");
                const diffs = diffStringsRaw(
                  isMultiline ? `${a}
` : a,
                  isMultiline ? `${b}
` : b,
                  true
                  // cleanupSemantic
                );
                if (hasCommonDiff(diffs, isMultiline)) {
                  const optionsNormalized = (0, _normalizeDiffOptions.normalizeDiffOptions)(options);
                  const lines = (0, _getAlignedDiffs.default)(diffs, optionsNormalized.changeColor);
                  return (0, _diffLines.printDiffLines)(lines, optionsNormalized);
                }
              }
              return (0, _diffLines.diffLinesUnified)(a.split("\n"), b.split("\n"), options);
            };
            exports3.diffStringsUnified = diffStringsUnified;
            const diffStringsRaw = (a, b, cleanup) => {
              const diffs = (0, _diffStrings.default)(a, b);
              if (cleanup) {
                (0, _cleanupSemantic.cleanupSemantic)(diffs);
              }
              return diffs;
            };
            exports3.diffStringsRaw = diffStringsRaw;
          })
        )
        /******/
      };
      var __webpack_module_cache__ = {};
      function __webpack_require__(moduleId) {
        var cachedModule = __webpack_module_cache__[moduleId];
        if (cachedModule !== void 0) {
          return cachedModule.exports;
        }
        var module3 = __webpack_module_cache__[moduleId] = {
          /******/
          // no module.id needed
          /******/
          // no module.loaded needed
          /******/
          exports: {}
          /******/
        };
        __webpack_modules__[moduleId](module3, module3.exports, __webpack_require__);
        return module3.exports;
      }
      var __webpack_exports__ = {};
      (() => {
        var exports3 = __webpack_exports__;
        Object.defineProperty(exports3, "__esModule", {
          value: true
        });
        Object.defineProperty(exports3, "DIFF_DELETE", {
          enumerable: true,
          get: function() {
            return _cleanupSemantic.DIFF_DELETE;
          }
        });
        Object.defineProperty(exports3, "DIFF_EQUAL", {
          enumerable: true,
          get: function() {
            return _cleanupSemantic.DIFF_EQUAL;
          }
        });
        Object.defineProperty(exports3, "DIFF_INSERT", {
          enumerable: true,
          get: function() {
            return _cleanupSemantic.DIFF_INSERT;
          }
        });
        Object.defineProperty(exports3, "Diff", {
          enumerable: true,
          get: function() {
            return _cleanupSemantic.Diff;
          }
        });
        exports3.diff = diff2;
        Object.defineProperty(exports3, "diffLinesRaw", {
          enumerable: true,
          get: function() {
            return _diffLines.diffLinesRaw;
          }
        });
        Object.defineProperty(exports3, "diffLinesUnified", {
          enumerable: true,
          get: function() {
            return _diffLines.diffLinesUnified;
          }
        });
        Object.defineProperty(exports3, "diffLinesUnified2", {
          enumerable: true,
          get: function() {
            return _diffLines.diffLinesUnified2;
          }
        });
        Object.defineProperty(exports3, "diffStringsRaw", {
          enumerable: true,
          get: function() {
            return _printDiffs.diffStringsRaw;
          }
        });
        Object.defineProperty(exports3, "diffStringsUnified", {
          enumerable: true,
          get: function() {
            return _printDiffs.diffStringsUnified;
          }
        });
        var _chalk = _interopRequireDefault(require_source());
        var _getType = require_build();
        var _prettyFormat = require_build3();
        var _cleanupSemantic = __webpack_require__("./src/cleanupSemantic.ts");
        var _constants = __webpack_require__("./src/constants.ts");
        var _diffLines = __webpack_require__("./src/diffLines.ts");
        var _escapeControlCharacters = __webpack_require__("./src/escapeControlCharacters.ts");
        var _normalizeDiffOptions = __webpack_require__("./src/normalizeDiffOptions.ts");
        var _printDiffs = __webpack_require__("./src/printDiffs.ts");
        function _interopRequireDefault(e) {
          return e && e.__esModule ? e : { default: e };
        }
        var src_Symbol = globalThis["jest-symbol-do-not-touch"] || globalThis.Symbol;
        const getCommonMessage = (message, options) => {
          const {
            commonColor
          } = (0, _normalizeDiffOptions.normalizeDiffOptions)(options);
          return commonColor(message);
        };
        const {
          AsymmetricMatcher: AsymmetricMatcher2,
          DOMCollection,
          DOMElement,
          Immutable,
          ReactElement,
          ReactTestComponent
        } = _prettyFormat.plugins;
        const PLUGINS = [ReactTestComponent, ReactElement, DOMElement, DOMCollection, Immutable, AsymmetricMatcher2];
        const FORMAT_OPTIONS = {
          plugins: PLUGINS
        };
        const FALLBACK_FORMAT_OPTIONS = {
          callToJSON: false,
          maxDepth: 10,
          plugins: PLUGINS
        };
        function diff2(a, b, options) {
          if (Object.is(a, b)) {
            return getCommonMessage(_constants.NO_DIFF_MESSAGE, options);
          }
          const aType = (0, _getType.getType)(a);
          let expectedType = aType;
          let omitDifference = false;
          if (aType === "object" && typeof a.asymmetricMatch === "function") {
            if (a.$$typeof !== src_Symbol.for("jest.asymmetricMatcher")) {
              return null;
            }
            if (typeof a.getExpectedType !== "function") {
              return null;
            }
            expectedType = a.getExpectedType();
            omitDifference = expectedType === "string";
          }
          if (expectedType !== (0, _getType.getType)(b)) {
            return `  Comparing two different types of values. Expected ${_chalk.default.green(expectedType)} but received ${_chalk.default.red((0, _getType.getType)(b))}.`;
          }
          if (omitDifference) {
            return null;
          }
          switch (aType) {
            case "string":
              return (0, _diffLines.diffLinesUnified)((0, _escapeControlCharacters.escapeControlCharacters)(a).split("\n"), (0, _escapeControlCharacters.escapeControlCharacters)(b).split("\n"), options);
            case "boolean":
            case "number":
              return comparePrimitive(a, b, options);
            case "map":
              return compareObjects(sortMap(a), sortMap(b), options);
            case "set":
              return compareObjects(sortSet(a), sortSet(b), options);
            default:
              return compareObjects(a, b, options);
          }
        }
        function comparePrimitive(a, b, options) {
          const aFormat = (0, _prettyFormat.format)(a, FORMAT_OPTIONS);
          const bFormat = (0, _prettyFormat.format)(b, FORMAT_OPTIONS);
          return aFormat === bFormat ? getCommonMessage(_constants.NO_DIFF_MESSAGE, options) : (0, _diffLines.diffLinesUnified)(aFormat.split("\n"), bFormat.split("\n"), options);
        }
        function sortMap(map) {
          return new Map([...map].sort());
        }
        function sortSet(set) {
          return new Set([...set].sort());
        }
        function compareObjects(a, b, options) {
          let difference;
          let hasThrown = false;
          try {
            const formatOptions = getFormatOptions(FORMAT_OPTIONS, options);
            difference = getObjectsDifference(a, b, formatOptions, options);
          } catch {
            hasThrown = true;
          }
          const noDiffMessage = getCommonMessage(_constants.NO_DIFF_MESSAGE, options);
          if (difference === void 0 || difference === noDiffMessage) {
            const formatOptions = getFormatOptions(FALLBACK_FORMAT_OPTIONS, options);
            difference = getObjectsDifference(a, b, formatOptions, options);
            if (difference !== noDiffMessage && !hasThrown) {
              difference = `${getCommonMessage(_constants.SIMILAR_MESSAGE, options)}

${difference}`;
            }
          }
          return difference;
        }
        function getFormatOptions(formatOptions, options) {
          const {
            compareKeys
          } = (0, _normalizeDiffOptions.normalizeDiffOptions)(options);
          return {
            ...formatOptions,
            compareKeys
          };
        }
        function getObjectsDifference(a, b, formatOptions, options) {
          const formatOptionsZeroIndent = {
            ...formatOptions,
            indent: 0
          };
          const aCompare = (0, _prettyFormat.format)(a, formatOptionsZeroIndent);
          const bCompare = (0, _prettyFormat.format)(b, formatOptionsZeroIndent);
          if (aCompare === bCompare) {
            return getCommonMessage(_constants.NO_DIFF_MESSAGE, options);
          } else {
            const aDisplay = (0, _prettyFormat.format)(a, formatOptions);
            const bDisplay = (0, _prettyFormat.format)(b, formatOptions);
            return (0, _diffLines.diffLinesUnified2)(aDisplay.split("\n"), bDisplay.split("\n"), aCompare.split("\n"), bCompare.split("\n"), options);
          }
        }
      })();
      module2.exports = __webpack_exports__;
    })();
  }
});

// node_modules/jest-matcher-utils/build/index.js
var require_build6 = __commonJS({
  "node_modules/jest-matcher-utils/build/index.js"(exports2, module2) {
    (() => {
      "use strict";
      var __webpack_modules__ = {
        /***/
        "./src/Replaceable.ts": (
          /***/
          ((__unused_webpack_module, exports3) => {
            Object.defineProperty(exports3, "__esModule", {
              value: true
            });
            exports3["default"] = void 0;
            var _getType = require_build();
            const supportTypes = /* @__PURE__ */ new Set(["map", "array", "object"]);
            class Replaceable {
              object;
              type;
              constructor(object) {
                this.object = object;
                this.type = (0, _getType.getType)(object);
                if (!supportTypes.has(this.type)) {
                  throw new Error(`Type ${this.type} is not support in Replaceable!`);
                }
              }
              static isReplaceable(obj1, obj2) {
                const obj1Type = (0, _getType.getType)(obj1);
                const obj2Type = (0, _getType.getType)(obj2);
                return obj1Type === obj2Type && supportTypes.has(obj1Type);
              }
              forEach(cb) {
                if (this.type === "object") {
                  const descriptors = Object.getOwnPropertyDescriptors(this.object);
                  for (const key of [...Object.keys(descriptors), ...Object.getOwnPropertySymbols(descriptors)].filter((key2) => descriptors[key2].enumerable)) {
                    cb(this.object[key], key, this.object);
                  }
                } else {
                  this.object.forEach(cb);
                }
              }
              get(key) {
                if (this.type === "map") {
                  return this.object.get(key);
                }
                return this.object[key];
              }
              set(key, value) {
                if (this.type === "map") {
                  this.object.set(key, value);
                } else {
                  this.object[key] = value;
                }
              }
            }
            exports3["default"] = Replaceable;
          })
        ),
        /***/
        "./src/deepCyclicCopyReplaceable.ts": (
          /***/
          ((__unused_webpack_module, exports3) => {
            Object.defineProperty(exports3, "__esModule", {
              value: true
            });
            exports3.SERIALIZABLE_PROPERTIES = void 0;
            exports3["default"] = deepCyclicCopyReplaceable;
            var _prettyFormat = require_build3();
            var Symbol2 = globalThis["jest-symbol-do-not-touch"] || globalThis.Symbol;
            const builtInObject = [Array, Date, Float32Array, Float64Array, Int16Array, Int32Array, Int8Array, Map, Set, RegExp, Uint16Array, Uint32Array, Uint8Array, Uint8ClampedArray];
            if (typeof Buffer !== "undefined") {
              builtInObject.push(Buffer);
            }
            if (typeof Window !== "undefined") {
              builtInObject.push(Window);
            }
            const SERIALIZABLE_PROPERTIES2 = exports3.SERIALIZABLE_PROPERTIES = Symbol2.for("@jest/serializableProperties");
            const isBuiltInObject = (object) => builtInObject.includes(object.constructor);
            const isMap = (value) => value.constructor === Map;
            function deepCyclicCopyReplaceable(value, cycles = /* @__PURE__ */ new WeakMap()) {
              if (typeof value !== "object" || value === null) {
                return value;
              } else if (cycles.has(value)) {
                return cycles.get(value);
              } else if (Array.isArray(value)) {
                return deepCyclicCopyArray(value, cycles);
              } else if (isMap(value)) {
                return deepCyclicCopyMap(value, cycles);
              } else if (isBuiltInObject(value)) {
                return value;
              } else if (_prettyFormat.plugins.DOMElement.test(value)) {
                return value.cloneNode(true);
              } else {
                return deepCyclicCopyObject(value, cycles);
              }
            }
            function deepCyclicCopyObject(object, cycles) {
              const newObject = Object.create(Object.getPrototypeOf(object));
              let descriptors = {};
              let obj = object;
              do {
                const serializableProperties = getSerializableProperties(obj);
                if (serializableProperties === void 0) {
                  descriptors = Object.assign(/* @__PURE__ */ Object.create(null), Object.getOwnPropertyDescriptors(obj), descriptors);
                } else {
                  for (const property of serializableProperties) {
                    if (!descriptors[property]) {
                      descriptors[property] = Object.getOwnPropertyDescriptor(obj, property);
                    }
                  }
                }
              } while ((obj = Object.getPrototypeOf(obj)) && obj !== Object.getPrototypeOf({}));
              cycles.set(object, newObject);
              const newDescriptors = [...Object.keys(descriptors), ...Object.getOwnPropertySymbols(descriptors)].reduce(
                //@ts-expect-error because typescript do not support symbol key in object
                //https://github.com/microsoft/TypeScript/issues/1863
                (newDescriptors2, key) => {
                  const enumerable = descriptors[key].enumerable;
                  newDescriptors2[key] = {
                    configurable: true,
                    enumerable,
                    value: deepCyclicCopyReplaceable(
                      // this accesses the value or getter, depending. We just care about the value anyways, and this allows us to not mess with accessors
                      // it has the side effect of invoking the getter here though, rather than copying it over
                      object[key],
                      cycles
                    ),
                    writable: true
                  };
                  return newDescriptors2;
                },
                /* @__PURE__ */ Object.create(null)
              );
              return Object.defineProperties(newObject, newDescriptors);
            }
            function deepCyclicCopyArray(array, cycles) {
              const newArray = new (Object.getPrototypeOf(array)).constructor(array.length);
              const length = array.length;
              cycles.set(array, newArray);
              for (let i = 0; i < length; i++) {
                newArray[i] = deepCyclicCopyReplaceable(array[i], cycles);
              }
              return newArray;
            }
            function deepCyclicCopyMap(map, cycles) {
              const newMap = /* @__PURE__ */ new Map();
              cycles.set(map, newMap);
              for (const [key, value] of map) {
                newMap.set(key, deepCyclicCopyReplaceable(value, cycles));
              }
              return newMap;
            }
            function getSerializableProperties(obj) {
              if (typeof obj !== "object" || obj === null) {
                return;
              }
              const serializableProperties = obj[SERIALIZABLE_PROPERTIES2];
              if (!Array.isArray(serializableProperties)) {
                return;
              }
              return serializableProperties.filter((key) => typeof key === "string" || typeof key === "symbol");
            }
          })
        )
        /******/
      };
      var __webpack_module_cache__ = {};
      function __webpack_require__(moduleId) {
        var cachedModule = __webpack_module_cache__[moduleId];
        if (cachedModule !== void 0) {
          return cachedModule.exports;
        }
        var module3 = __webpack_module_cache__[moduleId] = {
          /******/
          // no module.id needed
          /******/
          // no module.loaded needed
          /******/
          exports: {}
          /******/
        };
        __webpack_modules__[moduleId](module3, module3.exports, __webpack_require__);
        return module3.exports;
      }
      var __webpack_exports__ = {};
      (() => {
        var exports3 = __webpack_exports__;
        Object.defineProperty(exports3, "__esModule", {
          value: true
        });
        exports3.RECEIVED_COLOR = exports3.INVERTED_COLOR = exports3.EXPECTED_COLOR = exports3.DIM_COLOR = exports3.BOLD_WEIGHT = void 0;
        Object.defineProperty(exports3, "SERIALIZABLE_PROPERTIES", {
          enumerable: true,
          get: function() {
            return _deepCyclicCopyReplaceable.SERIALIZABLE_PROPERTIES;
          }
        });
        exports3.printReceived = exports3.printExpected = exports3.printDiffOrStringify = exports3.pluralize = exports3.matcherHint = exports3.matcherErrorMessage = exports3.highlightTrailingWhitespace = exports3.getLabelPrinter = exports3.ensureNumbers = exports3.ensureNoExpected = exports3.ensureExpectedIsNumber = exports3.ensureExpectedIsNonNegativeInteger = exports3.ensureActualIsNumber = exports3.diff = exports3.SUGGEST_TO_CONTAIN_EQUAL = void 0;
        exports3.printWithType = printWithType2;
        exports3.replaceMatchedToAsymmetricMatcher = replaceMatchedToAsymmetricMatcher2;
        exports3.stringify = void 0;
        var _chalk = _interopRequireDefault(require_source());
        var _getType = require_build();
        var _jestDiff = require_build5();
        var _prettyFormat = require_build3();
        var _Replaceable = _interopRequireDefault(__webpack_require__("./src/Replaceable.ts"));
        var _deepCyclicCopyReplaceable = _interopRequireWildcard(__webpack_require__("./src/deepCyclicCopyReplaceable.ts"));
        function _interopRequireWildcard(e, t) {
          if ("function" == typeof WeakMap) var r = /* @__PURE__ */ new WeakMap(), n = /* @__PURE__ */ new WeakMap();
          return (_interopRequireWildcard = function(e2, t2) {
            if (!t2 && e2 && e2.__esModule) return e2;
            var o, i, f = { __proto__: null, default: e2 };
            if (null === e2 || "object" != typeof e2 && "function" != typeof e2) return f;
            if (o = t2 ? n : r) {
              if (o.has(e2)) return o.get(e2);
              o.set(e2, f);
            }
            for (const t3 in e2) "default" !== t3 && {}.hasOwnProperty.call(e2, t3) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e2, t3)) && (i.get || i.set) ? o(f, t3, i) : f[t3] = e2[t3]);
            return f;
          })(e, t);
        }
        function _interopRequireDefault(e) {
          return e && e.__esModule ? e : { default: e };
        }
        const {
          AsymmetricMatcher: AsymmetricMatcher2,
          DOMCollection,
          DOMElement,
          Immutable,
          ReactElement,
          ReactTestComponent
        } = _prettyFormat.plugins;
        const PLUGINS = [ReactTestComponent, ReactElement, DOMElement, DOMCollection, Immutable, AsymmetricMatcher2];
        const EXPECTED_COLOR2 = exports3.EXPECTED_COLOR = _chalk.default.green;
        const RECEIVED_COLOR2 = exports3.RECEIVED_COLOR = _chalk.default.red;
        const INVERTED_COLOR2 = exports3.INVERTED_COLOR = _chalk.default.inverse;
        const BOLD_WEIGHT2 = exports3.BOLD_WEIGHT = _chalk.default.bold;
        const DIM_COLOR2 = exports3.DIM_COLOR = _chalk.default.dim;
        const MULTILINE_REGEXP = /\n/;
        const SPACE_SYMBOL = "\xB7";
        const NUMBERS = ["zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten", "eleven", "twelve", "thirteen"];
        const SUGGEST_TO_CONTAIN_EQUAL2 = exports3.SUGGEST_TO_CONTAIN_EQUAL = _chalk.default.dim("Looks like you wanted to test for object/array equality with the stricter `toContain` matcher. You probably need to use `toContainEqual` instead.");
        const stringify2 = (object, maxDepth = 10, maxWidth = 10) => {
          const MAX_LENGTH = 1e4;
          let result;
          try {
            result = (0, _prettyFormat.format)(object, {
              maxDepth,
              maxWidth,
              min: true,
              plugins: PLUGINS
            });
          } catch {
            result = (0, _prettyFormat.format)(object, {
              callToJSON: false,
              maxDepth,
              maxWidth,
              min: true,
              plugins: PLUGINS
            });
          }
          if (result.length >= MAX_LENGTH && maxDepth > 1) {
            return stringify2(object, Math.floor(maxDepth / 2), maxWidth);
          } else if (result.length >= MAX_LENGTH && maxWidth > 1) {
            return stringify2(object, maxDepth, Math.floor(maxWidth / 2));
          } else {
            return result;
          }
        };
        exports3.stringify = stringify2;
        const highlightTrailingWhitespace2 = (text) => text.replaceAll(/\s+$/gm, _chalk.default.inverse("$&"));
        exports3.highlightTrailingWhitespace = highlightTrailingWhitespace2;
        const replaceTrailingSpaces = (text) => text.replaceAll(/\s+$/gm, (spaces) => SPACE_SYMBOL.repeat(spaces.length));
        const printReceived2 = (object) => RECEIVED_COLOR2(replaceTrailingSpaces(stringify2(object)));
        exports3.printReceived = printReceived2;
        const printExpected2 = (value) => EXPECTED_COLOR2(replaceTrailingSpaces(stringify2(value)));
        exports3.printExpected = printExpected2;
        function printWithType2(name, value, print) {
          const type = (0, _getType.getType)(value);
          const hasType = type !== "null" && type !== "undefined" ? `${name} has type:  ${type}
` : "";
          const hasValue = `${name} has value: ${print(value)}`;
          return hasType + hasValue;
        }
        const ensureNoExpected2 = (expected, matcherName, options) => {
          if (expected !== void 0) {
            const matcherString = (options ? "" : "[.not]") + matcherName;
            throw new Error(matcherErrorMessage2(
              matcherHint2(matcherString, void 0, "", options),
              // Because expected is omitted in hint above,
              // expected is black instead of green in message below.
              "this matcher must not have an expected argument",
              printWithType2("Expected", expected, printExpected2)
            ));
          }
        };
        exports3.ensureNoExpected = ensureNoExpected2;
        const ensureActualIsNumber2 = (actual, matcherName, options) => {
          if (typeof actual !== "number" && typeof actual !== "bigint") {
            const matcherString = (options ? "" : "[.not]") + matcherName;
            throw new Error(matcherErrorMessage2(matcherHint2(matcherString, void 0, void 0, options), `${RECEIVED_COLOR2("received")} value must be a number or bigint`, printWithType2("Received", actual, printReceived2)));
          }
        };
        exports3.ensureActualIsNumber = ensureActualIsNumber2;
        const ensureExpectedIsNumber2 = (expected, matcherName, options) => {
          if (typeof expected !== "number" && typeof expected !== "bigint") {
            const matcherString = (options ? "" : "[.not]") + matcherName;
            throw new Error(matcherErrorMessage2(matcherHint2(matcherString, void 0, void 0, options), `${EXPECTED_COLOR2("expected")} value must be a number or bigint`, printWithType2("Expected", expected, printExpected2)));
          }
        };
        exports3.ensureExpectedIsNumber = ensureExpectedIsNumber2;
        const ensureNumbers2 = (actual, expected, matcherName, options) => {
          ensureActualIsNumber2(actual, matcherName, options);
          ensureExpectedIsNumber2(expected, matcherName, options);
        };
        exports3.ensureNumbers = ensureNumbers2;
        const ensureExpectedIsNonNegativeInteger2 = (expected, matcherName, options) => {
          if (typeof expected !== "number" || !Number.isSafeInteger(expected) || expected < 0) {
            const matcherString = (options ? "" : "[.not]") + matcherName;
            throw new Error(matcherErrorMessage2(matcherHint2(matcherString, void 0, void 0, options), `${EXPECTED_COLOR2("expected")} value must be a non-negative integer`, printWithType2("Expected", expected, printExpected2)));
          }
        };
        exports3.ensureExpectedIsNonNegativeInteger = ensureExpectedIsNonNegativeInteger2;
        const getCommonAndChangedSubstrings = (diffs, op, hasCommonDiff) => diffs.reduce((reduced, diff3) => reduced + (diff3[0] === _jestDiff.DIFF_EQUAL ? diff3[1] : diff3[0] === op ? hasCommonDiff ? INVERTED_COLOR2(diff3[1]) : diff3[1] : ""), "");
        const isLineDiffable = (expected, received) => {
          const expectedType = (0, _getType.getType)(expected);
          const receivedType = (0, _getType.getType)(received);
          if (expectedType !== receivedType) {
            return false;
          }
          if ((0, _getType.isPrimitive)(expected)) {
            return typeof expected === "string" && typeof received === "string" && expected.length > 0 && received.length > 0 && (MULTILINE_REGEXP.test(expected) || MULTILINE_REGEXP.test(received));
          }
          if (expectedType === "date" || expectedType === "function" || expectedType === "regexp") {
            return false;
          }
          if (expected instanceof Error && received instanceof Error) {
            return false;
          }
          if (receivedType === "object" && typeof received.asymmetricMatch === "function") {
            return false;
          }
          return true;
        };
        const MAX_DIFF_STRING_LENGTH = 2e4;
        const printDiffOrStringify2 = (expected, received, expectedLabel, receivedLabel, expand) => {
          if (typeof expected === "string" && typeof received === "string" && expected.length > 0 && received.length > 0 && expected.length <= MAX_DIFF_STRING_LENGTH && received.length <= MAX_DIFF_STRING_LENGTH && expected !== received) {
            if (expected.includes("\n") || received.includes("\n")) {
              return (0, _jestDiff.diffStringsUnified)(expected, received, {
                aAnnotation: expectedLabel,
                bAnnotation: receivedLabel,
                changeLineTrailingSpaceColor: _chalk.default.bgYellow,
                commonLineTrailingSpaceColor: _chalk.default.bgYellow,
                emptyFirstOrLastLinePlaceholder: "\u21B5",
                // U+21B5
                expand,
                includeChangeCounts: true
              });
            }
            const diffs = (0, _jestDiff.diffStringsRaw)(expected, received, true);
            const hasCommonDiff = diffs.some((diff3) => diff3[0] === _jestDiff.DIFF_EQUAL);
            const printLabel2 = getLabelPrinter2(expectedLabel, receivedLabel);
            const expectedLine2 = printLabel2(expectedLabel) + printExpected2(getCommonAndChangedSubstrings(diffs, _jestDiff.DIFF_DELETE, hasCommonDiff));
            const receivedLine2 = printLabel2(receivedLabel) + printReceived2(getCommonAndChangedSubstrings(diffs, _jestDiff.DIFF_INSERT, hasCommonDiff));
            return `${expectedLine2}
${receivedLine2}`;
          }
          if (isLineDiffable(expected, received)) {
            const {
              replacedExpected,
              replacedReceived
            } = replaceMatchedToAsymmetricMatcher2(expected, received, [], []);
            const difference = (0, _jestDiff.diff)(replacedExpected, replacedReceived, {
              aAnnotation: expectedLabel,
              bAnnotation: receivedLabel,
              expand,
              includeChangeCounts: true
            });
            if (typeof difference === "string" && difference.includes(`- ${expectedLabel}`) && difference.includes(`+ ${receivedLabel}`)) {
              return difference;
            }
          }
          const printLabel = getLabelPrinter2(expectedLabel, receivedLabel);
          const expectedLine = printLabel(expectedLabel) + printExpected2(expected);
          const receivedLine = printLabel(receivedLabel) + (stringify2(expected) === stringify2(received) ? "serializes to the same string" : printReceived2(received));
          return `${expectedLine}
${receivedLine}`;
        };
        exports3.printDiffOrStringify = printDiffOrStringify2;
        const shouldPrintDiff = (actual, expected) => {
          if (typeof actual === "number" && typeof expected === "number") {
            return false;
          }
          if (typeof actual === "bigint" && typeof expected === "bigint") {
            return false;
          }
          if (typeof actual === "boolean" && typeof expected === "boolean") {
            return false;
          }
          return true;
        };
        function replaceMatchedToAsymmetricMatcher2(replacedExpected, replacedReceived, expectedCycles, receivedCycles) {
          return _replaceMatchedToAsymmetricMatcher((0, _deepCyclicCopyReplaceable.default)(replacedExpected), (0, _deepCyclicCopyReplaceable.default)(replacedReceived), expectedCycles, receivedCycles);
        }
        function _replaceMatchedToAsymmetricMatcher(replacedExpected, replacedReceived, expectedCycles, receivedCycles) {
          if (!_Replaceable.default.isReplaceable(replacedExpected, replacedReceived)) {
            return {
              replacedExpected,
              replacedReceived
            };
          }
          if (expectedCycles.includes(replacedExpected) || receivedCycles.includes(replacedReceived)) {
            return {
              replacedExpected,
              replacedReceived
            };
          }
          expectedCycles.push(replacedExpected);
          receivedCycles.push(replacedReceived);
          const expectedReplaceable = new _Replaceable.default(replacedExpected);
          const receivedReplaceable = new _Replaceable.default(replacedReceived);
          expectedReplaceable.forEach((expectedValue, key) => {
            const receivedValue = receivedReplaceable.get(key);
            if (isAsymmetricMatcher(expectedValue)) {
              if (expectedValue.asymmetricMatch(receivedValue)) {
                receivedReplaceable.set(key, expectedValue);
              }
            } else if (isAsymmetricMatcher(receivedValue)) {
              if (receivedValue.asymmetricMatch(expectedValue)) {
                expectedReplaceable.set(key, receivedValue);
              }
            } else if (_Replaceable.default.isReplaceable(expectedValue, receivedValue)) {
              const replaced = _replaceMatchedToAsymmetricMatcher(expectedValue, receivedValue, expectedCycles, receivedCycles);
              expectedReplaceable.set(key, replaced.replacedExpected);
              receivedReplaceable.set(key, replaced.replacedReceived);
            }
          });
          return {
            replacedExpected: expectedReplaceable.object,
            replacedReceived: receivedReplaceable.object
          };
        }
        function isAsymmetricMatcher(data) {
          const type = (0, _getType.getType)(data);
          return type === "object" && typeof data.asymmetricMatch === "function";
        }
        const diff2 = (a, b, options) => shouldPrintDiff(a, b) ? (0, _jestDiff.diff)(a, b, options) : null;
        exports3.diff = diff2;
        const pluralize2 = (word, count) => `${NUMBERS[count] || count} ${word}${count === 1 ? "" : "s"}`;
        exports3.pluralize = pluralize2;
        const getLabelPrinter2 = (...strings) => {
          const maxLength = strings.reduce((max, string) => Math.max(string.length, max), 0);
          return (string) => `${string}: ${" ".repeat(maxLength - string.length)}`;
        };
        exports3.getLabelPrinter = getLabelPrinter2;
        const matcherErrorMessage2 = (hint, generic, specific) => `${hint}

${_chalk.default.bold("Matcher error")}: ${generic}${typeof specific === "string" ? `

${specific}` : ""}`;
        exports3.matcherErrorMessage = matcherErrorMessage2;
        const matcherHint2 = (matcherName, received = "received", expected = "expected", options = {}) => {
          const {
            comment = "",
            expectedColor = EXPECTED_COLOR2,
            isDirectExpectCall = false,
            // seems redundant with received === ''
            isNot = false,
            promise = "",
            receivedColor = RECEIVED_COLOR2,
            secondArgument = "",
            secondArgumentColor = EXPECTED_COLOR2
          } = options;
          let hint = "";
          let dimString = "expect";
          if (!isDirectExpectCall && received !== "") {
            hint += DIM_COLOR2(`${dimString}(`) + receivedColor(received);
            dimString = ")";
          }
          if (promise !== "") {
            hint += DIM_COLOR2(`${dimString}.`) + promise;
            dimString = "";
          }
          if (isNot) {
            hint += `${DIM_COLOR2(`${dimString}.`)}not`;
            dimString = "";
          }
          if (matcherName.includes(".")) {
            dimString += matcherName;
          } else {
            hint += DIM_COLOR2(`${dimString}.`) + matcherName;
            dimString = "";
          }
          if (expected === "") {
            dimString += "()";
          } else {
            hint += DIM_COLOR2(`${dimString}(`) + expectedColor(expected);
            if (secondArgument) {
              hint += DIM_COLOR2(", ") + secondArgumentColor(secondArgument);
            }
            dimString = ")";
          }
          if (comment !== "") {
            dimString += ` // ${comment}`;
          }
          if (dimString !== "") {
            hint += DIM_COLOR2(dimString);
          }
          return hint;
        };
        exports3.matcherHint = matcherHint2;
      })();
      module2.exports = __webpack_exports__;
    })();
  }
});

// node_modules/picocolors/picocolors.js
var require_picocolors = __commonJS({
  "node_modules/picocolors/picocolors.js"(exports2, module2) {
    var p = process || {};
    var argv = p.argv || [];
    var env = p.env || {};
    var isColorSupported = !(!!env.NO_COLOR || argv.includes("--no-color")) && (!!env.FORCE_COLOR || argv.includes("--color") || p.platform === "win32" || (p.stdout || {}).isTTY && env.TERM !== "dumb" || !!env.CI);
    var formatter = (open, close, replace = open) => (input) => {
      let string = "" + input, index = string.indexOf(close, open.length);
      return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
    };
    var replaceClose = (string, close, replace, index) => {
      let result = "", cursor = 0;
      do {
        result += string.substring(cursor, index) + replace;
        cursor = index + close.length;
        index = string.indexOf(close, cursor);
      } while (~index);
      return result + string.substring(cursor);
    };
    var createColors = (enabled = isColorSupported) => {
      let f = enabled ? formatter : () => String;
      return {
        isColorSupported: enabled,
        reset: f("\x1B[0m", "\x1B[0m"),
        bold: f("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"),
        dim: f("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"),
        italic: f("\x1B[3m", "\x1B[23m"),
        underline: f("\x1B[4m", "\x1B[24m"),
        inverse: f("\x1B[7m", "\x1B[27m"),
        hidden: f("\x1B[8m", "\x1B[28m"),
        strikethrough: f("\x1B[9m", "\x1B[29m"),
        black: f("\x1B[30m", "\x1B[39m"),
        red: f("\x1B[31m", "\x1B[39m"),
        green: f("\x1B[32m", "\x1B[39m"),
        yellow: f("\x1B[33m", "\x1B[39m"),
        blue: f("\x1B[34m", "\x1B[39m"),
        magenta: f("\x1B[35m", "\x1B[39m"),
        cyan: f("\x1B[36m", "\x1B[39m"),
        white: f("\x1B[37m", "\x1B[39m"),
        gray: f("\x1B[90m", "\x1B[39m"),
        bgBlack: f("\x1B[40m", "\x1B[49m"),
        bgRed: f("\x1B[41m", "\x1B[49m"),
        bgGreen: f("\x1B[42m", "\x1B[49m"),
        bgYellow: f("\x1B[43m", "\x1B[49m"),
        bgBlue: f("\x1B[44m", "\x1B[49m"),
        bgMagenta: f("\x1B[45m", "\x1B[49m"),
        bgCyan: f("\x1B[46m", "\x1B[49m"),
        bgWhite: f("\x1B[47m", "\x1B[49m"),
        blackBright: f("\x1B[90m", "\x1B[39m"),
        redBright: f("\x1B[91m", "\x1B[39m"),
        greenBright: f("\x1B[92m", "\x1B[39m"),
        yellowBright: f("\x1B[93m", "\x1B[39m"),
        blueBright: f("\x1B[94m", "\x1B[39m"),
        magentaBright: f("\x1B[95m", "\x1B[39m"),
        cyanBright: f("\x1B[96m", "\x1B[39m"),
        whiteBright: f("\x1B[97m", "\x1B[39m"),
        bgBlackBright: f("\x1B[100m", "\x1B[49m"),
        bgRedBright: f("\x1B[101m", "\x1B[49m"),
        bgGreenBright: f("\x1B[102m", "\x1B[49m"),
        bgYellowBright: f("\x1B[103m", "\x1B[49m"),
        bgBlueBright: f("\x1B[104m", "\x1B[49m"),
        bgMagentaBright: f("\x1B[105m", "\x1B[49m"),
        bgCyanBright: f("\x1B[106m", "\x1B[49m"),
        bgWhiteBright: f("\x1B[107m", "\x1B[49m")
      };
    };
    module2.exports = createColors();
    module2.exports.createColors = createColors;
  }
});

// node_modules/js-tokens/index.js
var require_js_tokens = __commonJS({
  "node_modules/js-tokens/index.js"(exports2) {
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = /((['"])(?:(?!\2|\\).|\\(?:\r\n|[\s\S]))*(\2)?|`(?:[^`\\$]|\\[\s\S]|\$(?!\{)|\$\{(?:[^{}]|\{[^}]*\}?)*\}?)*(`)?)|(\/\/.*)|(\/\*(?:[^*]|\*(?!\/))*(\*\/)?)|(\/(?!\*)(?:\[(?:(?![\]\\]).|\\.)*\]|(?![\/\]\\]).|\\.)+\/(?:(?!\s*(?:\b|[\u0080-\uFFFF$\\'"~({]|[+\-!](?!=)|\.?\d))|[gmiyus]{1,6}\b(?![\u0080-\uFFFF$\\]|\s*(?:[+\-*%&|^<>!=?({]|\/(?![\/*])))))|(0[xX][\da-fA-F]+|0[oO][0-7]+|0[bB][01]+|(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?)|((?!\d)(?:(?!\s)[$\w\u0080-\uFFFF]|\\u[\da-fA-F]{4}|\\u\{[\da-fA-F]+\})+)|(--|\+\+|&&|\|\||=>|\.{3}|(?:[+\-\/%&|^]|\*{1,2}|<{1,2}|>{1,3}|!=?|={1,2})=?|[?~.,:;[\](){}])|(\s+)|(^$|[\s\S])/g;
    exports2.matchToToken = function(match) {
      var token = { type: "invalid", value: match[0], closed: void 0 };
      if (match[1]) token.type = "string", token.closed = !!(match[3] || match[4]);
      else if (match[5]) token.type = "comment";
      else if (match[6]) token.type = "comment", token.closed = !!match[7];
      else if (match[8]) token.type = "regex";
      else if (match[9]) token.type = "number";
      else if (match[10]) token.type = "name";
      else if (match[11]) token.type = "punctuator";
      else if (match[12]) token.type = "whitespace";
      return token;
    };
  }
});

// node_modules/@babel/helper-validator-identifier/lib/identifier.js
var require_identifier = __commonJS({
  "node_modules/@babel/helper-validator-identifier/lib/identifier.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.isIdentifierChar = isIdentifierChar;
    exports2.isIdentifierName = isIdentifierName;
    exports2.isIdentifierStart = isIdentifierStart;
    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\u0870-\u0887\u0889-\u088F\u08A0-\u08C9\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\u0C5C\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDC-\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-\u1711\u171F-\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-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C8A\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-\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-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7DC\uA7F1-\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 = "\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\u0897-\u089F\u08CA-\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\u0C3C\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\u0CF3\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-\u0ECE\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-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1ADD\u1AE0-\u1AEB\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-\u1DFF\u200C\u200D\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\u30FB\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\uFF65";
    var nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]");
    var nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]");
    nonASCIIidentifierStartChars = nonASCIIidentifierChars = null;
    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, 13, 10, 2, 14, 2, 6, 2, 1, 2, 10, 2, 14, 2, 6, 2, 1, 4, 51, 13, 310, 10, 21, 11, 7, 25, 5, 2, 41, 2, 8, 70, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 7, 25, 39, 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, 39, 27, 10, 22, 251, 41, 7, 1, 17, 5, 57, 28, 11, 0, 9, 21, 43, 17, 47, 20, 28, 22, 13, 52, 58, 1, 3, 0, 14, 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, 20, 1, 64, 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, 31, 9, 2, 0, 3, 0, 2, 37, 2, 0, 26, 0, 2, 0, 45, 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, 38, 6, 186, 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, 19, 72, 200, 32, 32, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 24, 43, 261, 18, 16, 0, 2, 12, 2, 33, 125, 0, 80, 921, 103, 110, 18, 195, 2637, 96, 16, 1071, 18, 5, 26, 3994, 6, 582, 6842, 29, 1763, 568, 8, 30, 18, 78, 18, 29, 19, 47, 17, 3, 32, 20, 6, 18, 433, 44, 212, 63, 33, 24, 3, 24, 45, 74, 6, 0, 67, 12, 65, 1, 2, 0, 15, 4, 10, 7381, 42, 31, 98, 114, 8702, 3, 2, 6, 2, 1, 2, 290, 16, 0, 30, 2, 3, 0, 15, 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, 1845, 30, 7, 5, 262, 61, 147, 44, 11, 6, 17, 0, 322, 29, 19, 43, 485, 27, 229, 29, 3, 0, 208, 30, 2, 2, 2, 1, 2, 6, 3, 4, 10, 1, 225, 6, 2, 3, 2, 1, 2, 14, 2, 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, 42719, 33, 4381, 3, 5773, 3, 7472, 16, 621, 2467, 541, 1507, 4938, 6, 8489];
    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, 7, 9, 32, 4, 318, 1, 78, 5, 71, 10, 50, 3, 123, 2, 54, 14, 32, 10, 3, 1, 11, 3, 46, 10, 8, 0, 46, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 3, 0, 158, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 68, 8, 2, 0, 3, 0, 2, 3, 2, 4, 2, 0, 15, 1, 83, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 7, 19, 58, 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, 199, 7, 137, 9, 54, 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, 55, 9, 266, 3, 10, 1, 2, 0, 49, 6, 4, 4, 14, 10, 5350, 0, 7, 14, 11465, 27, 2343, 9, 87, 9, 39, 4, 60, 6, 26, 9, 535, 9, 470, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 4178, 9, 519, 45, 3, 22, 543, 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, 101, 0, 161, 6, 10, 9, 357, 0, 62, 13, 499, 13, 245, 1, 2, 9, 233, 0, 3, 0, 8, 1, 6, 0, 475, 6, 110, 6, 6, 9, 4759, 9, 787719, 239];
    function isInAstralSet(code, set) {
      let pos = 65536;
      for (let i = 0, length = set.length; i < length; i += 2) {
        pos += set[i];
        if (pos > code) return false;
        pos += set[i + 1];
        if (pos >= code) return true;
      }
      return false;
    }
    function isIdentifierStart(code) {
      if (code < 65) return code === 36;
      if (code <= 90) return true;
      if (code < 97) return code === 95;
      if (code <= 122) return true;
      if (code <= 65535) {
        return code >= 170 && nonASCIIidentifierStart.test(String.fromCharCode(code));
      }
      return isInAstralSet(code, astralIdentifierStartCodes);
    }
    function isIdentifierChar(code) {
      if (code < 48) return code === 36;
      if (code < 58) return true;
      if (code < 65) return false;
      if (code <= 90) return true;
      if (code < 97) return code === 95;
      if (code <= 122) return true;
      if (code <= 65535) {
        return code >= 170 && nonASCIIidentifier.test(String.fromCharCode(code));
      }
      return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes);
    }
    function isIdentifierName(name) {
      let isFirst = true;
      for (let i = 0; i < name.length; i++) {
        let cp = name.charCodeAt(i);
        if ((cp & 64512) === 55296 && i + 1 < name.length) {
          const trail = name.charCodeAt(++i);
          if ((trail & 64512) === 56320) {
            cp = 65536 + ((cp & 1023) << 10) + (trail & 1023);
          }
        }
        if (isFirst) {
          isFirst = false;
          if (!isIdentifierStart(cp)) {
            return false;
          }
        } else if (!isIdentifierChar(cp)) {
          return false;
        }
      }
      return !isFirst;
    }
  }
});

// node_modules/@babel/helper-validator-identifier/lib/keyword.js
var require_keyword = __commonJS({
  "node_modules/@babel/helper-validator-identifier/lib/keyword.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.isKeyword = isKeyword;
    exports2.isReservedWord = isReservedWord;
    exports2.isStrictBindOnlyReservedWord = isStrictBindOnlyReservedWord;
    exports2.isStrictBindReservedWord = isStrictBindReservedWord;
    exports2.isStrictReservedWord = isStrictReservedWord;
    var reservedWords = {
      keyword: ["break", "case", "catch", "continue", "debugger", "default", "do", "else", "finally", "for", "function", "if", "return", "switch", "throw", "try", "var", "const", "while", "with", "new", "this", "super", "class", "extends", "export", "import", "null", "true", "false", "in", "instanceof", "typeof", "void", "delete"],
      strict: ["implements", "interface", "let", "package", "private", "protected", "public", "static", "yield"],
      strictBind: ["eval", "arguments"]
    };
    var keywords = new Set(reservedWords.keyword);
    var reservedWordsStrictSet = new Set(reservedWords.strict);
    var reservedWordsStrictBindSet = new Set(reservedWords.strictBind);
    function isReservedWord(word, inModule) {
      return inModule && word === "await" || word === "enum";
    }
    function isStrictReservedWord(word, inModule) {
      return isReservedWord(word, inModule) || reservedWordsStrictSet.has(word);
    }
    function isStrictBindOnlyReservedWord(word) {
      return reservedWordsStrictBindSet.has(word);
    }
    function isStrictBindReservedWord(word, inModule) {
      return isStrictReservedWord(word, inModule) || isStrictBindOnlyReservedWord(word);
    }
    function isKeyword(word) {
      return keywords.has(word);
    }
  }
});

// node_modules/@babel/helper-validator-identifier/lib/index.js
var require_lib = __commonJS({
  "node_modules/@babel/helper-validator-identifier/lib/index.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    Object.defineProperty(exports2, "isIdentifierChar", {
      enumerable: true,
      get: function() {
        return _identifier.isIdentifierChar;
      }
    });
    Object.defineProperty(exports2, "isIdentifierName", {
      enumerable: true,
      get: function() {
        return _identifier.isIdentifierName;
      }
    });
    Object.defineProperty(exports2, "isIdentifierStart", {
      enumerable: true,
      get: function() {
        return _identifier.isIdentifierStart;
      }
    });
    Object.defineProperty(exports2, "isKeyword", {
      enumerable: true,
      get: function() {
        return _keyword.isKeyword;
      }
    });
    Object.defineProperty(exports2, "isReservedWord", {
      enumerable: true,
      get: function() {
        return _keyword.isReservedWord;
      }
    });
    Object.defineProperty(exports2, "isStrictBindOnlyReservedWord", {
      enumerable: true,
      get: function() {
        return _keyword.isStrictBindOnlyReservedWord;
      }
    });
    Object.defineProperty(exports2, "isStrictBindReservedWord", {
      enumerable: true,
      get: function() {
        return _keyword.isStrictBindReservedWord;
      }
    });
    Object.defineProperty(exports2, "isStrictReservedWord", {
      enumerable: true,
      get: function() {
        return _keyword.isStrictReservedWord;
      }
    });
    var _identifier = require_identifier();
    var _keyword = require_keyword();
  }
});

// node_modules/@babel/code-frame/lib/index.js
var require_lib2 = __commonJS({
  "node_modules/@babel/code-frame/lib/index.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    var picocolors = require_picocolors();
    var jsTokens = require_js_tokens();
    var helperValidatorIdentifier = require_lib();
    function isColorSupported() {
      return typeof process === "object" && (process.env.FORCE_COLOR === "0" || process.env.FORCE_COLOR === "false") ? false : picocolors.isColorSupported;
    }
    var compose = (f, g) => (v) => f(g(v));
    function buildDefs(colors3) {
      return {
        keyword: colors3.cyan,
        capitalized: colors3.yellow,
        jsxIdentifier: colors3.yellow,
        punctuator: colors3.yellow,
        number: colors3.magenta,
        string: colors3.green,
        regex: colors3.magenta,
        comment: colors3.gray,
        invalid: compose(compose(colors3.white, colors3.bgRed), colors3.bold),
        gutter: colors3.gray,
        marker: compose(colors3.red, colors3.bold),
        message: compose(colors3.red, colors3.bold),
        reset: colors3.reset
      };
    }
    var defsOn = buildDefs(picocolors.createColors(true));
    var defsOff = buildDefs(picocolors.createColors(false));
    function getDefs(enabled) {
      return enabled ? defsOn : defsOff;
    }
    var sometimesKeywords = /* @__PURE__ */ new Set(["as", "async", "from", "get", "of", "set"]);
    var NEWLINE$1 = /\r\n|[\n\r\u2028\u2029]/;
    var BRACKET = /^[()[\]{}]$/;
    var tokenize;
    var JSX_TAG = /^[a-z][\w-]*$/i;
    var getTokenType = function(token, offset, text) {
      if (token.type === "name") {
        const tokenValue = token.value;
        if (helperValidatorIdentifier.isKeyword(tokenValue) || helperValidatorIdentifier.isStrictReservedWord(tokenValue, true) || sometimesKeywords.has(tokenValue)) {
          return "keyword";
        }
        if (JSX_TAG.test(tokenValue) && (text[offset - 1] === "<" || text.slice(offset - 2, offset) === "</")) {
          return "jsxIdentifier";
        }
        const firstChar = String.fromCodePoint(tokenValue.codePointAt(0));
        if (firstChar !== firstChar.toLowerCase()) {
          return "capitalized";
        }
      }
      if (token.type === "punctuator" && BRACKET.test(token.value)) {
        return "bracket";
      }
      if (token.type === "invalid" && (token.value === "@" || token.value === "#")) {
        return "punctuator";
      }
      return token.type;
    };
    tokenize = function* (text) {
      let match;
      while (match = jsTokens.default.exec(text)) {
        const token = jsTokens.matchToToken(match);
        yield {
          type: getTokenType(token, match.index, text),
          value: token.value
        };
      }
    };
    function highlight(text) {
      if (text === "") return "";
      const defs = getDefs(true);
      let highlighted = "";
      for (const {
        type,
        value
      } of tokenize(text)) {
        if (type in defs) {
          highlighted += value.split(NEWLINE$1).map((str) => defs[type](str)).join("\n");
        } else {
          highlighted += value;
        }
      }
      return highlighted;
    }
    var deprecationWarningShown = false;
    var NEWLINE = /\r\n|[\n\r\u2028\u2029]/;
    function getMarkerLines(loc, source, opts, startLineBaseZero) {
      const startLoc = Object.assign({
        column: 0,
        line: -1
      }, loc.start);
      const endLoc = Object.assign({}, startLoc, loc.end);
      const {
        linesAbove = 2,
        linesBelow = 3
      } = opts || {};
      const startLine = startLoc.line - startLineBaseZero;
      const startColumn = startLoc.column;
      const endLine = endLoc.line - startLineBaseZero;
      const endColumn = endLoc.column;
      let start = Math.max(startLine - (linesAbove + 1), 0);
      let end = Math.min(source.length, endLine + linesBelow);
      if (startLine === -1) {
        start = 0;
      }
      if (endLine === -1) {
        end = source.length;
      }
      const lineDiff = endLine - startLine;
      const markerLines = {};
      if (lineDiff) {
        for (let i = 0; i <= lineDiff; i++) {
          const lineNumber = i + startLine;
          if (!startColumn) {
            markerLines[lineNumber] = true;
          } else if (i === 0) {
            const sourceLength = source[lineNumber - 1].length;
            markerLines[lineNumber] = [startColumn, sourceLength - startColumn + 1];
          } else if (i === lineDiff) {
            markerLines[lineNumber] = [0, endColumn];
          } else {
            const sourceLength = source[lineNumber - i].length;
            markerLines[lineNumber] = [0, sourceLength];
          }
        }
      } else {
        if (startColumn === endColumn) {
          if (startColumn) {
            markerLines[startLine] = [startColumn, 0];
          } else {
            markerLines[startLine] = true;
          }
        } else {
          markerLines[startLine] = [startColumn, endColumn - startColumn];
        }
      }
      return {
        start,
        end,
        markerLines
      };
    }
    function codeFrameColumns(rawLines, loc, opts = {}) {
      const shouldHighlight = opts.forceColor || isColorSupported() && opts.highlightCode;
      const startLineBaseZero = (opts.startLine || 1) - 1;
      const defs = getDefs(shouldHighlight);
      const lines = rawLines.split(NEWLINE);
      const {
        start,
        end,
        markerLines
      } = getMarkerLines(loc, lines, opts, startLineBaseZero);
      const hasColumns = loc.start && typeof loc.start.column === "number";
      const numberMaxWidth = String(end + startLineBaseZero).length;
      const highlightedLines = shouldHighlight ? highlight(rawLines) : rawLines;
      let frame = highlightedLines.split(NEWLINE, end).slice(start, end).map((line, index2) => {
        const number = start + 1 + index2;
        const paddedNumber = ` ${number + startLineBaseZero}`.slice(-numberMaxWidth);
        const gutter = ` ${paddedNumber} |`;
        const hasMarker = markerLines[number];
        const lastMarkerLine = !markerLines[number + 1];
        if (hasMarker) {
          let markerLine = "";
          if (Array.isArray(hasMarker)) {
            const markerSpacing = line.slice(0, Math.max(hasMarker[0] - 1, 0)).replace(/[^\t]/g, " ");
            const numberOfMarkers = hasMarker[1] || 1;
            markerLine = ["\n ", defs.gutter(gutter.replace(/\d/g, " ")), " ", markerSpacing, defs.marker("^").repeat(numberOfMarkers)].join("");
            if (lastMarkerLine && opts.message) {
              markerLine += " " + defs.message(opts.message);
            }
          }
          return [defs.marker(">"), defs.gutter(gutter), line.length > 0 ? ` ${line}` : "", markerLine].join("");
        } else {
          return ` ${defs.gutter(gutter)}${line.length > 0 ? ` ${line}` : ""}`;
        }
      }).join("\n");
      if (opts.message && !hasColumns) {
        frame = `${" ".repeat(numberMaxWidth + 1)}${opts.message}
${frame}`;
      }
      if (shouldHighlight) {
        return defs.reset(frame);
      } else {
        return frame;
      }
    }
    function index(rawLines, lineNumber, colNumber, opts = {}) {
      if (!deprecationWarningShown) {
        deprecationWarningShown = true;
        const message = "Passing lineNumber and colNumber is deprecated to @babel/code-frame. Please use `codeFrameColumns`.";
        if (process.emitWarning) {
          process.emitWarning(message, "DeprecationWarning");
        } else {
          const deprecationError = new Error(message);
          deprecationError.name = "DeprecationWarning";
          console.warn(new Error(message));
        }
      }
      colNumber = Math.max(colNumber, 0);
      const location = {
        start: {
          column: colNumber,
          line: lineNumber
        }
      };
      return codeFrameColumns(rawLines, location, opts);
    }
    exports2.codeFrameColumns = codeFrameColumns;
    exports2.default = index;
    exports2.highlight = highlight;
  }
});

// node_modules/jest-message-util/node_modules/graceful-fs/polyfills.js
var require_polyfills = __commonJS({
  "node_modules/jest-message-util/node_modules/graceful-fs/polyfills.js"(exports2, module2) {
    var constants = require("constants");
    var origCwd = process.cwd;
    var cwd = null;
    var platform = process.env.GRACEFUL_FS_PLATFORM || process.platform;
    process.cwd = function() {
      if (!cwd)
        cwd = origCwd.call(process);
      return cwd;
    };
    try {
      process.cwd();
    } catch (er) {
    }
    if (typeof process.chdir === "function") {
      chdir = process.chdir;
      process.chdir = function(d) {
        cwd = null;
        chdir.call(process, d);
      };
      if (Object.setPrototypeOf) Object.setPrototypeOf(process.chdir, chdir);
    }
    var chdir;
    module2.exports = patch;
    function patch(fs3) {
      if (constants.hasOwnProperty("O_SYMLINK") && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) {
        patchLchmod(fs3);
      }
      if (!fs3.lutimes) {
        patchLutimes(fs3);
      }
      fs3.chown = chownFix(fs3.chown);
      fs3.fchown = chownFix(fs3.fchown);
      fs3.lchown = chownFix(fs3.lchown);
      fs3.chmod = chmodFix(fs3.chmod);
      fs3.fchmod = chmodFix(fs3.fchmod);
      fs3.lchmod = chmodFix(fs3.lchmod);
      fs3.chownSync = chownFixSync(fs3.chownSync);
      fs3.fchownSync = chownFixSync(fs3.fchownSync);
      fs3.lchownSync = chownFixSync(fs3.lchownSync);
      fs3.chmodSync = chmodFixSync(fs3.chmodSync);
      fs3.fchmodSync = chmodFixSync(fs3.fchmodSync);
      fs3.lchmodSync = chmodFixSync(fs3.lchmodSync);
      fs3.stat = statFix(fs3.stat);
      fs3.fstat = statFix(fs3.fstat);
      fs3.lstat = statFix(fs3.lstat);
      fs3.statSync = statFixSync(fs3.statSync);
      fs3.fstatSync = statFixSync(fs3.fstatSync);
      fs3.lstatSync = statFixSync(fs3.lstatSync);
      if (fs3.chmod && !fs3.lchmod) {
        fs3.lchmod = function(path4, mode, cb) {
          if (cb) process.nextTick(cb);
        };
        fs3.lchmodSync = function() {
        };
      }
      if (fs3.chown && !fs3.lchown) {
        fs3.lchown = function(path4, uid, gid, cb) {
          if (cb) process.nextTick(cb);
        };
        fs3.lchownSync = function() {
        };
      }
      if (platform === "win32") {
        fs3.rename = typeof fs3.rename !== "function" ? fs3.rename : (function(fs$rename) {
          function rename(from, to, cb) {
            var start = Date.now();
            var backoff = 0;
            fs$rename(from, to, function CB(er) {
              if (er && (er.code === "EACCES" || er.code === "EPERM" || er.code === "EBUSY") && Date.now() - start < 6e4) {
                setTimeout(function() {
                  fs3.stat(to, function(stater, st) {
                    if (stater && stater.code === "ENOENT")
                      fs$rename(from, to, CB);
                    else
                      cb(er);
                  });
                }, backoff);
                if (backoff < 100)
                  backoff += 10;
                return;
              }
              if (cb) cb(er);
            });
          }
          if (Object.setPrototypeOf) Object.setPrototypeOf(rename, fs$rename);
          return rename;
        })(fs3.rename);
      }
      fs3.read = typeof fs3.read !== "function" ? fs3.read : (function(fs$read) {
        function read(fd, buffer, offset, length, position, callback_) {
          var callback;
          if (callback_ && typeof callback_ === "function") {
            var eagCounter = 0;
            callback = function(er, _, __) {
              if (er && er.code === "EAGAIN" && eagCounter < 10) {
                eagCounter++;
                return fs$read.call(fs3, fd, buffer, offset, length, position, callback);
              }
              callback_.apply(this, arguments);
            };
          }
          return fs$read.call(fs3, fd, buffer, offset, length, position, callback);
        }
        if (Object.setPrototypeOf) Object.setPrototypeOf(read, fs$read);
        return read;
      })(fs3.read);
      fs3.readSync = typeof fs3.readSync !== "function" ? fs3.readSync : /* @__PURE__ */ (function(fs$readSync) {
        return function(fd, buffer, offset, length, position) {
          var eagCounter = 0;
          while (true) {
            try {
              return fs$readSync.call(fs3, fd, buffer, offset, length, position);
            } catch (er) {
              if (er.code === "EAGAIN" && eagCounter < 10) {
                eagCounter++;
                continue;
              }
              throw er;
            }
          }
        };
      })(fs3.readSync);
      function patchLchmod(fs4) {
        fs4.lchmod = function(path4, mode, callback) {
          fs4.open(
            path4,
            constants.O_WRONLY | constants.O_SYMLINK,
            mode,
            function(err, fd) {
              if (err) {
                if (callback) callback(err);
                return;
              }
              fs4.fchmod(fd, mode, function(err2) {
                fs4.close(fd, function(err22) {
                  if (callback) callback(err2 || err22);
                });
              });
            }
          );
        };
        fs4.lchmodSync = function(path4, mode) {
          var fd = fs4.openSync(path4, constants.O_WRONLY | constants.O_SYMLINK, mode);
          var threw = true;
          var ret;
          try {
            ret = fs4.fchmodSync(fd, mode);
            threw = false;
          } finally {
            if (threw) {
              try {
                fs4.closeSync(fd);
              } catch (er) {
              }
            } else {
              fs4.closeSync(fd);
            }
          }
          return ret;
        };
      }
      function patchLutimes(fs4) {
        if (constants.hasOwnProperty("O_SYMLINK") && fs4.futimes) {
          fs4.lutimes = function(path4, at, mt, cb) {
            fs4.open(path4, constants.O_SYMLINK, function(er, fd) {
              if (er) {
                if (cb) cb(er);
                return;
              }
              fs4.futimes(fd, at, mt, function(er2) {
                fs4.close(fd, function(er22) {
                  if (cb) cb(er2 || er22);
                });
              });
            });
          };
          fs4.lutimesSync = function(path4, at, mt) {
            var fd = fs4.openSync(path4, constants.O_SYMLINK);
            var ret;
            var threw = true;
            try {
              ret = fs4.futimesSync(fd, at, mt);
              threw = false;
            } finally {
              if (threw) {
                try {
                  fs4.closeSync(fd);
                } catch (er) {
                }
              } else {
                fs4.closeSync(fd);
              }
            }
            return ret;
          };
        } else if (fs4.futimes) {
          fs4.lutimes = function(_a, _b, _c, cb) {
            if (cb) process.nextTick(cb);
          };
          fs4.lutimesSync = function() {
          };
        }
      }
      function chmodFix(orig) {
        if (!orig) return orig;
        return function(target, mode, cb) {
          return orig.call(fs3, target, mode, function(er) {
            if (chownErOk(er)) er = null;
            if (cb) cb.apply(this, arguments);
          });
        };
      }
      function chmodFixSync(orig) {
        if (!orig) return orig;
        return function(target, mode) {
          try {
            return orig.call(fs3, target, mode);
          } catch (er) {
            if (!chownErOk(er)) throw er;
          }
        };
      }
      function chownFix(orig) {
        if (!orig) return orig;
        return function(target, uid, gid, cb) {
          return orig.call(fs3, target, uid, gid, function(er) {
            if (chownErOk(er)) er = null;
            if (cb) cb.apply(this, arguments);
          });
        };
      }
      function chownFixSync(orig) {
        if (!orig) return orig;
        return function(target, uid, gid) {
          try {
            return orig.call(fs3, target, uid, gid);
          } catch (er) {
            if (!chownErOk(er)) throw er;
          }
        };
      }
      function statFix(orig) {
        if (!orig) return orig;
        return function(target, options, cb) {
          if (typeof options === "function") {
            cb = options;
            options = null;
          }
          function callback(er, stats) {
            if (stats) {
              if (stats.uid < 0) stats.uid += 4294967296;
              if (stats.gid < 0) stats.gid += 4294967296;
            }
            if (cb) cb.apply(this, arguments);
          }
          return options ? orig.call(fs3, target, options, callback) : orig.call(fs3, target, callback);
        };
      }
      function statFixSync(orig) {
        if (!orig) return orig;
        return function(target, options) {
          var stats = options ? orig.call(fs3, target, options) : orig.call(fs3, target);
          if (stats) {
            if (stats.uid < 0) stats.uid += 4294967296;
            if (stats.gid < 0) stats.gid += 4294967296;
          }
          return stats;
        };
      }
      function chownErOk(er) {
        if (!er)
          return true;
        if (er.code === "ENOSYS")
          return true;
        var nonroot = !process.getuid || process.getuid() !== 0;
        if (nonroot) {
          if (er.code === "EINVAL" || er.code === "EPERM")
            return true;
        }
        return false;
      }
    }
  }
});

// node_modules/jest-message-util/node_modules/graceful-fs/legacy-streams.js
var require_legacy_streams = __commonJS({
  "node_modules/jest-message-util/node_modules/graceful-fs/legacy-streams.js"(exports2, module2) {
    var Stream = require("stream").Stream;
    module2.exports = legacy;
    function legacy(fs3) {
      return {
        ReadStream,
        WriteStream
      };
      function ReadStream(path4, options) {
        if (!(this instanceof ReadStream)) return new ReadStream(path4, options);
        Stream.call(this);
        var self = this;
        this.path = path4;
        this.fd = null;
        this.readable = true;
        this.paused = false;
        this.flags = "r";
        this.mode = 438;
        this.bufferSize = 64 * 1024;
        options = options || {};
        var keys = Object.keys(options);
        for (var index = 0, length = keys.length; index < length; index++) {
          var key = keys[index];
          this[key] = options[key];
        }
        if (this.encoding) this.setEncoding(this.encoding);
        if (this.start !== void 0) {
          if ("number" !== typeof this.start) {
            throw TypeError("start must be a Number");
          }
          if (this.end === void 0) {
            this.end = Infinity;
          } else if ("number" !== typeof this.end) {
            throw TypeError("end must be a Number");
          }
          if (this.start > this.end) {
            throw new Error("start must be <= end");
          }
          this.pos = this.start;
        }
        if (this.fd !== null) {
          process.nextTick(function() {
            self._read();
          });
          return;
        }
        fs3.open(this.path, this.flags, this.mode, function(err, fd) {
          if (err) {
            self.emit("error", err);
            self.readable = false;
            return;
          }
          self.fd = fd;
          self.emit("open", fd);
          self._read();
        });
      }
      function WriteStream(path4, options) {
        if (!(this instanceof WriteStream)) return new WriteStream(path4, options);
        Stream.call(this);
        this.path = path4;
        this.fd = null;
        this.writable = true;
        this.flags = "w";
        this.encoding = "binary";
        this.mode = 438;
        this.bytesWritten = 0;
        options = options || {};
        var keys = Object.keys(options);
        for (var index = 0, length = keys.length; index < length; index++) {
          var key = keys[index];
          this[key] = options[key];
        }
        if (this.start !== void 0) {
          if ("number" !== typeof this.start) {
            throw TypeError("start must be a Number");
          }
          if (this.start < 0) {
            throw new Error("start must be >= zero");
          }
          this.pos = this.start;
        }
        this.busy = false;
        this._queue = [];
        if (this.fd === null) {
          this._open = fs3.open;
          this._queue.push([this._open, this.path, this.flags, this.mode, void 0]);
          this.flush();
        }
      }
    }
  }
});

// node_modules/jest-message-util/node_modules/graceful-fs/clone.js
var require_clone = __commonJS({
  "node_modules/jest-message-util/node_modules/graceful-fs/clone.js"(exports2, module2) {
    "use strict";
    module2.exports = clone;
    var getPrototypeOf = Object.getPrototypeOf || function(obj) {
      return obj.__proto__;
    };
    function clone(obj) {
      if (obj === null || typeof obj !== "object")
        return obj;
      if (obj instanceof Object)
        var copy = { __proto__: getPrototypeOf(obj) };
      else
        var copy = /* @__PURE__ */ Object.create(null);
      Object.getOwnPropertyNames(obj).forEach(function(key) {
        Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key));
      });
      return copy;
    }
  }
});

// node_modules/jest-message-util/node_modules/graceful-fs/graceful-fs.js
var require_graceful_fs = __commonJS({
  "node_modules/jest-message-util/node_modules/graceful-fs/graceful-fs.js"(exports2, module2) {
    var fs3 = require("fs");
    var polyfills = require_polyfills();
    var legacy = require_legacy_streams();
    var clone = require_clone();
    var util2 = require("util");
    var gracefulQueue;
    var previousSymbol;
    if (typeof Symbol === "function" && typeof Symbol.for === "function") {
      gracefulQueue = Symbol.for("graceful-fs.queue");
      previousSymbol = Symbol.for("graceful-fs.previous");
    } else {
      gracefulQueue = "___graceful-fs.queue";
      previousSymbol = "___graceful-fs.previous";
    }
    function noop() {
    }
    function publishQueue(context, queue2) {
      Object.defineProperty(context, gracefulQueue, {
        get: function() {
          return queue2;
        }
      });
    }
    var debug = noop;
    if (util2.debuglog)
      debug = util2.debuglog("gfs4");
    else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || ""))
      debug = function() {
        var m = util2.format.apply(util2, arguments);
        m = "GFS4: " + m.split(/\n/).join("\nGFS4: ");
        console.error(m);
      };
    if (!fs3[gracefulQueue]) {
      queue = global[gracefulQueue] || [];
      publishQueue(fs3, queue);
      fs3.close = (function(fs$close) {
        function close(fd, cb) {
          return fs$close.call(fs3, fd, function(err) {
            if (!err) {
              resetQueue();
            }
            if (typeof cb === "function")
              cb.apply(this, arguments);
          });
        }
        Object.defineProperty(close, previousSymbol, {
          value: fs$close
        });
        return close;
      })(fs3.close);
      fs3.closeSync = (function(fs$closeSync) {
        function closeSync(fd) {
          fs$closeSync.apply(fs3, arguments);
          resetQueue();
        }
        Object.defineProperty(closeSync, previousSymbol, {
          value: fs$closeSync
        });
        return closeSync;
      })(fs3.closeSync);
      if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) {
        process.on("exit", function() {
          debug(fs3[gracefulQueue]);
          require("assert").equal(fs3[gracefulQueue].length, 0);
        });
      }
    }
    var queue;
    if (!global[gracefulQueue]) {
      publishQueue(global, fs3[gracefulQueue]);
    }
    module2.exports = patch(clone(fs3));
    if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs3.__patched) {
      module2.exports = patch(fs3);
      fs3.__patched = true;
    }
    function patch(fs4) {
      polyfills(fs4);
      fs4.gracefulify = patch;
      fs4.createReadStream = createReadStream;
      fs4.createWriteStream = createWriteStream;
      var fs$readFile = fs4.readFile;
      fs4.readFile = readFile;
      function readFile(path4, options, cb) {
        if (typeof options === "function")
          cb = options, options = null;
        return go$readFile(path4, options, cb);
        function go$readFile(path5, options2, cb2, startTime) {
          return fs$readFile(path5, options2, function(err) {
            if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
              enqueue([go$readFile, [path5, options2, cb2], err, startTime || Date.now(), Date.now()]);
            else {
              if (typeof cb2 === "function")
                cb2.apply(this, arguments);
            }
          });
        }
      }
      var fs$writeFile = fs4.writeFile;
      fs4.writeFile = writeFile;
      function writeFile(path4, data, options, cb) {
        if (typeof options === "function")
          cb = options, options = null;
        return go$writeFile(path4, data, options, cb);
        function go$writeFile(path5, data2, options2, cb2, startTime) {
          return fs$writeFile(path5, data2, options2, function(err) {
            if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
              enqueue([go$writeFile, [path5, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
            else {
              if (typeof cb2 === "function")
                cb2.apply(this, arguments);
            }
          });
        }
      }
      var fs$appendFile = fs4.appendFile;
      if (fs$appendFile)
        fs4.appendFile = appendFile;
      function appendFile(path4, data, options, cb) {
        if (typeof options === "function")
          cb = options, options = null;
        return go$appendFile(path4, data, options, cb);
        function go$appendFile(path5, data2, options2, cb2, startTime) {
          return fs$appendFile(path5, data2, options2, function(err) {
            if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
              enqueue([go$appendFile, [path5, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
            else {
              if (typeof cb2 === "function")
                cb2.apply(this, arguments);
            }
          });
        }
      }
      var fs$copyFile = fs4.copyFile;
      if (fs$copyFile)
        fs4.copyFile = copyFile;
      function copyFile(src, dest, flags, cb) {
        if (typeof flags === "function") {
          cb = flags;
          flags = 0;
        }
        return go$copyFile(src, dest, flags, cb);
        function go$copyFile(src2, dest2, flags2, cb2, startTime) {
          return fs$copyFile(src2, dest2, flags2, function(err) {
            if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
              enqueue([go$copyFile, [src2, dest2, flags2, cb2], err, startTime || Date.now(), Date.now()]);
            else {
              if (typeof cb2 === "function")
                cb2.apply(this, arguments);
            }
          });
        }
      }
      var fs$readdir = fs4.readdir;
      fs4.readdir = readdir;
      var noReaddirOptionVersions = /^v[0-5]\./;
      function readdir(path4, options, cb) {
        if (typeof options === "function")
          cb = options, options = null;
        var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(path5, options2, cb2, startTime) {
          return fs$readdir(path5, fs$readdirCallback(
            path5,
            options2,
            cb2,
            startTime
          ));
        } : function go$readdir2(path5, options2, cb2, startTime) {
          return fs$readdir(path5, options2, fs$readdirCallback(
            path5,
            options2,
            cb2,
            startTime
          ));
        };
        return go$readdir(path4, options, cb);
        function fs$readdirCallback(path5, options2, cb2, startTime) {
          return function(err, files) {
            if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
              enqueue([
                go$readdir,
                [path5, options2, cb2],
                err,
                startTime || Date.now(),
                Date.now()
              ]);
            else {
              if (files && files.sort)
                files.sort();
              if (typeof cb2 === "function")
                cb2.call(this, err, files);
            }
          };
        }
      }
      if (process.version.substr(0, 4) === "v0.8") {
        var legStreams = legacy(fs4);
        ReadStream = legStreams.ReadStream;
        WriteStream = legStreams.WriteStream;
      }
      var fs$ReadStream = fs4.ReadStream;
      if (fs$ReadStream) {
        ReadStream.prototype = Object.create(fs$ReadStream.prototype);
        ReadStream.prototype.open = ReadStream$open;
      }
      var fs$WriteStream = fs4.WriteStream;
      if (fs$WriteStream) {
        WriteStream.prototype = Object.create(fs$WriteStream.prototype);
        WriteStream.prototype.open = WriteStream$open;
      }
      Object.defineProperty(fs4, "ReadStream", {
        get: function() {
          return ReadStream;
        },
        set: function(val) {
          ReadStream = val;
        },
        enumerable: true,
        configurable: true
      });
      Object.defineProperty(fs4, "WriteStream", {
        get: function() {
          return WriteStream;
        },
        set: function(val) {
          WriteStream = val;
        },
        enumerable: true,
        configurable: true
      });
      var FileReadStream = ReadStream;
      Object.defineProperty(fs4, "FileReadStream", {
        get: function() {
          return FileReadStream;
        },
        set: function(val) {
          FileReadStream = val;
        },
        enumerable: true,
        configurable: true
      });
      var FileWriteStream = WriteStream;
      Object.defineProperty(fs4, "FileWriteStream", {
        get: function() {
          return FileWriteStream;
        },
        set: function(val) {
          FileWriteStream = val;
        },
        enumerable: true,
        configurable: true
      });
      function ReadStream(path4, options) {
        if (this instanceof ReadStream)
          return fs$ReadStream.apply(this, arguments), this;
        else
          return ReadStream.apply(Object.create(ReadStream.prototype), arguments);
      }
      function ReadStream$open() {
        var that = this;
        open(that.path, that.flags, that.mode, function(err, fd) {
          if (err) {
            if (that.autoClose)
              that.destroy();
            that.emit("error", err);
          } else {
            that.fd = fd;
            that.emit("open", fd);
            that.read();
          }
        });
      }
      function WriteStream(path4, options) {
        if (this instanceof WriteStream)
          return fs$WriteStream.apply(this, arguments), this;
        else
          return WriteStream.apply(Object.create(WriteStream.prototype), arguments);
      }
      function WriteStream$open() {
        var that = this;
        open(that.path, that.flags, that.mode, function(err, fd) {
          if (err) {
            that.destroy();
            that.emit("error", err);
          } else {
            that.fd = fd;
            that.emit("open", fd);
          }
        });
      }
      function createReadStream(path4, options) {
        return new fs4.ReadStream(path4, options);
      }
      function createWriteStream(path4, options) {
        return new fs4.WriteStream(path4, options);
      }
      var fs$open = fs4.open;
      fs4.open = open;
      function open(path4, flags, mode, cb) {
        if (typeof mode === "function")
          cb = mode, mode = null;
        return go$open(path4, flags, mode, cb);
        function go$open(path5, flags2, mode2, cb2, startTime) {
          return fs$open(path5, flags2, mode2, function(err, fd) {
            if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
              enqueue([go$open, [path5, flags2, mode2, cb2], err, startTime || Date.now(), Date.now()]);
            else {
              if (typeof cb2 === "function")
                cb2.apply(this, arguments);
            }
          });
        }
      }
      return fs4;
    }
    function enqueue(elem) {
      debug("ENQUEUE", elem[0].name, elem[1]);
      fs3[gracefulQueue].push(elem);
      retry();
    }
    var retryTimer;
    function resetQueue() {
      var now = Date.now();
      for (var i = 0; i < fs3[gracefulQueue].length; ++i) {
        if (fs3[gracefulQueue][i].length > 2) {
          fs3[gracefulQueue][i][3] = now;
          fs3[gracefulQueue][i][4] = now;
        }
      }
      retry();
    }
    function retry() {
      clearTimeout(retryTimer);
      retryTimer = void 0;
      if (fs3[gracefulQueue].length === 0)
        return;
      var elem = fs3[gracefulQueue].shift();
      var fn = elem[0];
      var args = elem[1];
      var err = elem[2];
      var startTime = elem[3];
      var lastTime = elem[4];
      if (startTime === void 0) {
        debug("RETRY", fn.name, args);
        fn.apply(null, args);
      } else if (Date.now() - startTime >= 6e4) {
        debug("TIMEOUT", fn.name, args);
        var cb = args.pop();
        if (typeof cb === "function")
          cb.call(null, err);
      } else {
        var sinceAttempt = Date.now() - lastTime;
        var sinceStart = Math.max(lastTime - startTime, 1);
        var desiredDelay = Math.min(sinceStart * 1.2, 100);
        if (sinceAttempt >= desiredDelay) {
          debug("RETRY", fn.name, args);
          fn.apply(null, args.concat([startTime]));
        } else {
          fs3[gracefulQueue].push(elem);
        }
      }
      if (retryTimer === void 0) {
        retryTimer = setTimeout(retry, 0);
      }
    }
  }
});

// node_modules/braces/lib/utils.js
var require_utils = __commonJS({
  "node_modules/braces/lib/utils.js"(exports2) {
    "use strict";
    exports2.isInteger = (num) => {
      if (typeof num === "number") {
        return Number.isInteger(num);
      }
      if (typeof num === "string" && num.trim() !== "") {
        return Number.isInteger(Number(num));
      }
      return false;
    };
    exports2.find = (node, type) => node.nodes.find((node2) => node2.type === type);
    exports2.exceedsLimit = (min, max, step = 1, limit) => {
      if (limit === false) return false;
      if (!exports2.isInteger(min) || !exports2.isInteger(max)) return false;
      return (Number(max) - Number(min)) / Number(step) >= limit;
    };
    exports2.escapeNode = (block, n = 0, type) => {
      const node = block.nodes[n];
      if (!node) return;
      if (type && node.type === type || node.type === "open" || node.type === "close") {
        if (node.escaped !== true) {
          node.value = "\\" + node.value;
          node.escaped = true;
        }
      }
    };
    exports2.encloseBrace = (node) => {
      if (node.type !== "brace") return false;
      if (node.commas >> 0 + node.ranges >> 0 === 0) {
        node.invalid = true;
        return true;
      }
      return false;
    };
    exports2.isInvalidBrace = (block) => {
      if (block.type !== "brace") return false;
      if (block.invalid === true || block.dollar) return true;
      if (block.commas >> 0 + block.ranges >> 0 === 0) {
        block.invalid = true;
        return true;
      }
      if (block.open !== true || block.close !== true) {
        block.invalid = true;
        return true;
      }
      return false;
    };
    exports2.isOpenOrClose = (node) => {
      if (node.type === "open" || node.type === "close") {
        return true;
      }
      return node.open === true || node.close === true;
    };
    exports2.reduce = (nodes) => nodes.reduce((acc, node) => {
      if (node.type === "text") acc.push(node.value);
      if (node.type === "range") node.type = "text";
      return acc;
    }, []);
    exports2.flatten = (...args) => {
      const result = [];
      const flat = (arr) => {
        for (let i = 0; i < arr.length; i++) {
          const ele = arr[i];
          if (Array.isArray(ele)) {
            flat(ele);
            continue;
          }
          if (ele !== void 0) {
            result.push(ele);
          }
        }
        return result;
      };
      flat(args);
      return result;
    };
  }
});

// node_modules/braces/lib/stringify.js
var require_stringify = __commonJS({
  "node_modules/braces/lib/stringify.js"(exports2, module2) {
    "use strict";
    var utils2 = require_utils();
    module2.exports = (ast, options = {}) => {
      const stringify2 = (node, parent = {}) => {
        const invalidBlock = options.escapeInvalid && utils2.isInvalidBrace(parent);
        const invalidNode = node.invalid === true && options.escapeInvalid === true;
        let output = "";
        if (node.value) {
          if ((invalidBlock || invalidNode) && utils2.isOpenOrClose(node)) {
            return "\\" + node.value;
          }
          return node.value;
        }
        if (node.value) {
          return node.value;
        }
        if (node.nodes) {
          for (const child of node.nodes) {
            output += stringify2(child);
          }
        }
        return output;
      };
      return stringify2(ast);
    };
  }
});

// node_modules/is-number/index.js
var require_is_number = __commonJS({
  "node_modules/is-number/index.js"(exports2, module2) {
    "use strict";
    module2.exports = function(num) {
      if (typeof num === "number") {
        return num - num === 0;
      }
      if (typeof num === "string" && num.trim() !== "") {
        return Number.isFinite ? Number.isFinite(+num) : isFinite(+num);
      }
      return false;
    };
  }
});

// node_modules/to-regex-range/index.js
var require_to_regex_range = __commonJS({
  "node_modules/to-regex-range/index.js"(exports2, module2) {
    "use strict";
    var isNumber = require_is_number();
    var toRegexRange = (min, max, options) => {
      if (isNumber(min) === false) {
        throw new TypeError("toRegexRange: expected the first argument to be a number");
      }
      if (max === void 0 || min === max) {
        return String(min);
      }
      if (isNumber(max) === false) {
        throw new TypeError("toRegexRange: expected the second argument to be a number.");
      }
      let opts = { relaxZeros: true, ...options };
      if (typeof opts.strictZeros === "boolean") {
        opts.relaxZeros = opts.strictZeros === false;
      }
      let relax = String(opts.relaxZeros);
      let shorthand = String(opts.shorthand);
      let capture = String(opts.capture);
      let wrap = String(opts.wrap);
      let cacheKey = min + ":" + max + "=" + relax + shorthand + capture + wrap;
      if (toRegexRange.cache.hasOwnProperty(cacheKey)) {
        return toRegexRange.cache[cacheKey].result;
      }
      let a = Math.min(min, max);
      let b = Math.max(min, max);
      if (Math.abs(a - b) === 1) {
        let result = min + "|" + max;
        if (opts.capture) {
          return `(${result})`;
        }
        if (opts.wrap === false) {
          return result;
        }
        return `(?:${result})`;
      }
      let isPadded = hasPadding(min) || hasPadding(max);
      let state = { min, max, a, b };
      let positives = [];
      let negatives = [];
      if (isPadded) {
        state.isPadded = isPadded;
        state.maxLen = String(state.max).length;
      }
      if (a < 0) {
        let newMin = b < 0 ? Math.abs(b) : 1;
        negatives = splitToPatterns(newMin, Math.abs(a), state, opts);
        a = state.a = 0;
      }
      if (b >= 0) {
        positives = splitToPatterns(a, b, state, opts);
      }
      state.negatives = negatives;
      state.positives = positives;
      state.result = collatePatterns(negatives, positives, opts);
      if (opts.capture === true) {
        state.result = `(${state.result})`;
      } else if (opts.wrap !== false && positives.length + negatives.length > 1) {
        state.result = `(?:${state.result})`;
      }
      toRegexRange.cache[cacheKey] = state;
      return state.result;
    };
    function collatePatterns(neg, pos, options) {
      let onlyNegative = filterPatterns(neg, pos, "-", false, options) || [];
      let onlyPositive = filterPatterns(pos, neg, "", false, options) || [];
      let intersected = filterPatterns(neg, pos, "-?", true, options) || [];
      let subpatterns = onlyNegative.concat(intersected).concat(onlyPositive);
      return subpatterns.join("|");
    }
    function splitToRanges(min, max) {
      let nines = 1;
      let zeros = 1;
      let stop = countNines(min, nines);
      let stops = /* @__PURE__ */ new Set([max]);
      while (min <= stop && stop <= max) {
        stops.add(stop);
        nines += 1;
        stop = countNines(min, nines);
      }
      stop = countZeros(max + 1, zeros) - 1;
      while (min < stop && stop <= max) {
        stops.add(stop);
        zeros += 1;
        stop = countZeros(max + 1, zeros) - 1;
      }
      stops = [...stops];
      stops.sort(compare);
      return stops;
    }
    function rangeToPattern(start, stop, options) {
      if (start === stop) {
        return { pattern: start, count: [], digits: 0 };
      }
      let zipped = zip(start, stop);
      let digits = zipped.length;
      let pattern = "";
      let count = 0;
      for (let i = 0; i < digits; i++) {
        let [startDigit, stopDigit] = zipped[i];
        if (startDigit === stopDigit) {
          pattern += startDigit;
        } else if (startDigit !== "0" || stopDigit !== "9") {
          pattern += toCharacterClass(startDigit, stopDigit, options);
        } else {
          count++;
        }
      }
      if (count) {
        pattern += options.shorthand === true ? "\\d" : "[0-9]";
      }
      return { pattern, count: [count], digits };
    }
    function splitToPatterns(min, max, tok, options) {
      let ranges = splitToRanges(min, max);
      let tokens = [];
      let start = min;
      let prev;
      for (let i = 0; i < ranges.length; i++) {
        let max2 = ranges[i];
        let obj = rangeToPattern(String(start), String(max2), options);
        let zeros = "";
        if (!tok.isPadded && prev && prev.pattern === obj.pattern) {
          if (prev.count.length > 1) {
            prev.count.pop();
          }
          prev.count.push(obj.count[0]);
          prev.string = prev.pattern + toQuantifier(prev.count);
          start = max2 + 1;
          continue;
        }
        if (tok.isPadded) {
          zeros = padZeros(max2, tok, options);
        }
        obj.string = zeros + obj.pattern + toQuantifier(obj.count);
        tokens.push(obj);
        start = max2 + 1;
        prev = obj;
      }
      return tokens;
    }
    function filterPatterns(arr, comparison, prefix, intersection, options) {
      let result = [];
      for (let ele of arr) {
        let { string } = ele;
        if (!intersection && !contains(comparison, "string", string)) {
          result.push(prefix + string);
        }
        if (intersection && contains(comparison, "string", string)) {
          result.push(prefix + string);
        }
      }
      return result;
    }
    function zip(a, b) {
      let arr = [];
      for (let i = 0; i < a.length; i++) arr.push([a[i], b[i]]);
      return arr;
    }
    function compare(a, b) {
      return a > b ? 1 : b > a ? -1 : 0;
    }
    function contains(arr, key, val) {
      return arr.some((ele) => ele[key] === val);
    }
    function countNines(min, len) {
      return Number(String(min).slice(0, -len) + "9".repeat(len));
    }
    function countZeros(integer, zeros) {
      return integer - integer % Math.pow(10, zeros);
    }
    function toQuantifier(digits) {
      let [start = 0, stop = ""] = digits;
      if (stop || start > 1) {
        return `{${start + (stop ? "," + stop : "")}}`;
      }
      return "";
    }
    function toCharacterClass(a, b, options) {
      return `[${a}${b - a === 1 ? "" : "-"}${b}]`;
    }
    function hasPadding(str) {
      return /^-?(0+)\d/.test(str);
    }
    function padZeros(value, tok, options) {
      if (!tok.isPadded) {
        return value;
      }
      let diff2 = Math.abs(tok.maxLen - String(value).length);
      let relax = options.relaxZeros !== false;
      switch (diff2) {
        case 0:
          return "";
        case 1:
          return relax ? "0?" : "0";
        case 2:
          return relax ? "0{0,2}" : "00";
        default: {
          return relax ? `0{0,${diff2}}` : `0{${diff2}}`;
        }
      }
    }
    toRegexRange.cache = {};
    toRegexRange.clearCache = () => toRegexRange.cache = {};
    module2.exports = toRegexRange;
  }
});

// node_modules/fill-range/index.js
var require_fill_range = __commonJS({
  "node_modules/fill-range/index.js"(exports2, module2) {
    "use strict";
    var util2 = require("util");
    var toRegexRange = require_to_regex_range();
    var isObject2 = (val) => val !== null && typeof val === "object" && !Array.isArray(val);
    var transform = (toNumber) => {
      return (value) => toNumber === true ? Number(value) : String(value);
    };
    var isValidValue = (value) => {
      return typeof value === "number" || typeof value === "string" && value !== "";
    };
    var isNumber = (num) => Number.isInteger(+num);
    var zeros = (input) => {
      let value = `${input}`;
      let index = -1;
      if (value[0] === "-") value = value.slice(1);
      if (value === "0") return false;
      while (value[++index] === "0") ;
      return index > 0;
    };
    var stringify2 = (start, end, options) => {
      if (typeof start === "string" || typeof end === "string") {
        return true;
      }
      return options.stringify === true;
    };
    var pad = (input, maxLength, toNumber) => {
      if (maxLength > 0) {
        let dash = input[0] === "-" ? "-" : "";
        if (dash) input = input.slice(1);
        input = dash + input.padStart(dash ? maxLength - 1 : maxLength, "0");
      }
      if (toNumber === false) {
        return String(input);
      }
      return input;
    };
    var toMaxLen = (input, maxLength) => {
      let negative = input[0] === "-" ? "-" : "";
      if (negative) {
        input = input.slice(1);
        maxLength--;
      }
      while (input.length < maxLength) input = "0" + input;
      return negative ? "-" + input : input;
    };
    var toSequence = (parts, options, maxLen) => {
      parts.negatives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
      parts.positives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
      let prefix = options.capture ? "" : "?:";
      let positives = "";
      let negatives = "";
      let result;
      if (parts.positives.length) {
        positives = parts.positives.map((v) => toMaxLen(String(v), maxLen)).join("|");
      }
      if (parts.negatives.length) {
        negatives = `-(${prefix}${parts.negatives.map((v) => toMaxLen(String(v), maxLen)).join("|")})`;
      }
      if (positives && negatives) {
        result = `${positives}|${negatives}`;
      } else {
        result = positives || negatives;
      }
      if (options.wrap) {
        return `(${prefix}${result})`;
      }
      return result;
    };
    var toRange = (a, b, isNumbers, options) => {
      if (isNumbers) {
        return toRegexRange(a, b, { wrap: false, ...options });
      }
      let start = String.fromCharCode(a);
      if (a === b) return start;
      let stop = String.fromCharCode(b);
      return `[${start}-${stop}]`;
    };
    var toRegex = (start, end, options) => {
      if (Array.isArray(start)) {
        let wrap = options.wrap === true;
        let prefix = options.capture ? "" : "?:";
        return wrap ? `(${prefix}${start.join("|")})` : start.join("|");
      }
      return toRegexRange(start, end, options);
    };
    var rangeError = (...args) => {
      return new RangeError("Invalid range arguments: " + util2.inspect(...args));
    };
    var invalidRange = (start, end, options) => {
      if (options.strictRanges === true) throw rangeError([start, end]);
      return [];
    };
    var invalidStep = (step, options) => {
      if (options.strictRanges === true) {
        throw new TypeError(`Expected step "${step}" to be a number`);
      }
      return [];
    };
    var fillNumbers = (start, end, step = 1, options = {}) => {
      let a = Number(start);
      let b = Number(end);
      if (!Number.isInteger(a) || !Number.isInteger(b)) {
        if (options.strictRanges === true) throw rangeError([start, end]);
        return [];
      }
      if (a === 0) a = 0;
      if (b === 0) b = 0;
      let descending = a > b;
      let startString = String(start);
      let endString = String(end);
      let stepString = String(step);
      step = Math.max(Math.abs(step), 1);
      let padded = zeros(startString) || zeros(endString) || zeros(stepString);
      let maxLen = padded ? Math.max(startString.length, endString.length, stepString.length) : 0;
      let toNumber = padded === false && stringify2(start, end, options) === false;
      let format = options.transform || transform(toNumber);
      if (options.toRegex && step === 1) {
        return toRange(toMaxLen(start, maxLen), toMaxLen(end, maxLen), true, options);
      }
      let parts = { negatives: [], positives: [] };
      let push = (num) => parts[num < 0 ? "negatives" : "positives"].push(Math.abs(num));
      let range = [];
      let index = 0;
      while (descending ? a >= b : a <= b) {
        if (options.toRegex === true && step > 1) {
          push(a);
        } else {
          range.push(pad(format(a, index), maxLen, toNumber));
        }
        a = descending ? a - step : a + step;
        index++;
      }
      if (options.toRegex === true) {
        return step > 1 ? toSequence(parts, options, maxLen) : toRegex(range, null, { wrap: false, ...options });
      }
      return range;
    };
    var fillLetters = (start, end, step = 1, options = {}) => {
      if (!isNumber(start) && start.length > 1 || !isNumber(end) && end.length > 1) {
        return invalidRange(start, end, options);
      }
      let format = options.transform || ((val) => String.fromCharCode(val));
      let a = `${start}`.charCodeAt(0);
      let b = `${end}`.charCodeAt(0);
      let descending = a > b;
      let min = Math.min(a, b);
      let max = Math.max(a, b);
      if (options.toRegex && step === 1) {
        return toRange(min, max, false, options);
      }
      let range = [];
      let index = 0;
      while (descending ? a >= b : a <= b) {
        range.push(format(a, index));
        a = descending ? a - step : a + step;
        index++;
      }
      if (options.toRegex === true) {
        return toRegex(range, null, { wrap: false, options });
      }
      return range;
    };
    var fill = (start, end, step, options = {}) => {
      if (end == null && isValidValue(start)) {
        return [start];
      }
      if (!isValidValue(start) || !isValidValue(end)) {
        return invalidRange(start, end, options);
      }
      if (typeof step === "function") {
        return fill(start, end, 1, { transform: step });
      }
      if (isObject2(step)) {
        return fill(start, end, 0, step);
      }
      let opts = { ...options };
      if (opts.capture === true) opts.wrap = true;
      step = step || opts.step || 1;
      if (!isNumber(step)) {
        if (step != null && !isObject2(step)) return invalidStep(step, opts);
        return fill(start, end, 1, step);
      }
      if (isNumber(start) && isNumber(end)) {
        return fillNumbers(start, end, step, opts);
      }
      return fillLetters(start, end, Math.max(Math.abs(step), 1), opts);
    };
    module2.exports = fill;
  }
});

// node_modules/braces/lib/compile.js
var require_compile = __commonJS({
  "node_modules/braces/lib/compile.js"(exports2, module2) {
    "use strict";
    var fill = require_fill_range();
    var utils2 = require_utils();
    var compile = (ast, options = {}) => {
      const walk = (node, parent = {}) => {
        const invalidBlock = utils2.isInvalidBrace(parent);
        const invalidNode = node.invalid === true && options.escapeInvalid === true;
        const invalid = invalidBlock === true || invalidNode === true;
        const prefix = options.escapeInvalid === true ? "\\" : "";
        let output = "";
        if (node.isOpen === true) {
          return prefix + node.value;
        }
        if (node.isClose === true) {
          console.log("node.isClose", prefix, node.value);
          return prefix + node.value;
        }
        if (node.type === "open") {
          return invalid ? prefix + node.value : "(";
        }
        if (node.type === "close") {
          return invalid ? prefix + node.value : ")";
        }
        if (node.type === "comma") {
          return node.prev.type === "comma" ? "" : invalid ? node.value : "|";
        }
        if (node.value) {
          return node.value;
        }
        if (node.nodes && node.ranges > 0) {
          const args = utils2.reduce(node.nodes);
          const range = fill(...args, { ...options, wrap: false, toRegex: true, strictZeros: true });
          if (range.length !== 0) {
            return args.length > 1 && range.length > 1 ? `(${range})` : range;
          }
        }
        if (node.nodes) {
          for (const child of node.nodes) {
            output += walk(child, node);
          }
        }
        return output;
      };
      return walk(ast);
    };
    module2.exports = compile;
  }
});

// node_modules/braces/lib/expand.js
var require_expand = __commonJS({
  "node_modules/braces/lib/expand.js"(exports2, module2) {
    "use strict";
    var fill = require_fill_range();
    var stringify2 = require_stringify();
    var utils2 = require_utils();
    var append = (queue = "", stash = "", enclose = false) => {
      const result = [];
      queue = [].concat(queue);
      stash = [].concat(stash);
      if (!stash.length) return queue;
      if (!queue.length) {
        return enclose ? utils2.flatten(stash).map((ele) => `{${ele}}`) : stash;
      }
      for (const item of queue) {
        if (Array.isArray(item)) {
          for (const value of item) {
            result.push(append(value, stash, enclose));
          }
        } else {
          for (let ele of stash) {
            if (enclose === true && typeof ele === "string") ele = `{${ele}}`;
            result.push(Array.isArray(ele) ? append(item, ele, enclose) : item + ele);
          }
        }
      }
      return utils2.flatten(result);
    };
    var expand = (ast, options = {}) => {
      const rangeLimit = options.rangeLimit === void 0 ? 1e3 : options.rangeLimit;
      const walk = (node, parent = {}) => {
        node.queue = [];
        let p = parent;
        let q = parent.queue;
        while (p.type !== "brace" && p.type !== "root" && p.parent) {
          p = p.parent;
          q = p.queue;
        }
        if (node.invalid || node.dollar) {
          q.push(append(q.pop(), stringify2(node, options)));
          return;
        }
        if (node.type === "brace" && node.invalid !== true && node.nodes.length === 2) {
          q.push(append(q.pop(), ["{}"]));
          return;
        }
        if (node.nodes && node.ranges > 0) {
          const args = utils2.reduce(node.nodes);
          if (utils2.exceedsLimit(...args, options.step, rangeLimit)) {
            throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");
          }
          let range = fill(...args, options);
          if (range.length === 0) {
            range = stringify2(node, options);
          }
          q.push(append(q.pop(), range));
          node.nodes = [];
          return;
        }
        const enclose = utils2.encloseBrace(node);
        let queue = node.queue;
        let block = node;
        while (block.type !== "brace" && block.type !== "root" && block.parent) {
          block = block.parent;
          queue = block.queue;
        }
        for (let i = 0; i < node.nodes.length; i++) {
          const child = node.nodes[i];
          if (child.type === "comma" && node.type === "brace") {
            if (i === 1) queue.push("");
            queue.push("");
            continue;
          }
          if (child.type === "close") {
            q.push(append(q.pop(), queue, enclose));
            continue;
          }
          if (child.value && child.type !== "open") {
            queue.push(append(queue.pop(), child.value));
            continue;
          }
          if (child.nodes) {
            walk(child, node);
          }
        }
        return queue;
      };
      return utils2.flatten(walk(ast));
    };
    module2.exports = expand;
  }
});

// node_modules/braces/lib/constants.js
var require_constants = __commonJS({
  "node_modules/braces/lib/constants.js"(exports2, module2) {
    "use strict";
    module2.exports = {
      MAX_LENGTH: 1e4,
      // Digits
      CHAR_0: "0",
      /* 0 */
      CHAR_9: "9",
      /* 9 */
      // Alphabet chars.
      CHAR_UPPERCASE_A: "A",
      /* A */
      CHAR_LOWERCASE_A: "a",
      /* a */
      CHAR_UPPERCASE_Z: "Z",
      /* Z */
      CHAR_LOWERCASE_Z: "z",
      /* z */
      CHAR_LEFT_PARENTHESES: "(",
      /* ( */
      CHAR_RIGHT_PARENTHESES: ")",
      /* ) */
      CHAR_ASTERISK: "*",
      /* * */
      // Non-alphabetic chars.
      CHAR_AMPERSAND: "&",
      /* & */
      CHAR_AT: "@",
      /* @ */
      CHAR_BACKSLASH: "\\",
      /* \ */
      CHAR_BACKTICK: "`",
      /* ` */
      CHAR_CARRIAGE_RETURN: "\r",
      /* \r */
      CHAR_CIRCUMFLEX_ACCENT: "^",
      /* ^ */
      CHAR_COLON: ":",
      /* : */
      CHAR_COMMA: ",",
      /* , */
      CHAR_DOLLAR: "$",
      /* . */
      CHAR_DOT: ".",
      /* . */
      CHAR_DOUBLE_QUOTE: '"',
      /* " */
      CHAR_EQUAL: "=",
      /* = */
      CHAR_EXCLAMATION_MARK: "!",
      /* ! */
      CHAR_FORM_FEED: "\f",
      /* \f */
      CHAR_FORWARD_SLASH: "/",
      /* / */
      CHAR_HASH: "#",
      /* # */
      CHAR_HYPHEN_MINUS: "-",
      /* - */
      CHAR_LEFT_ANGLE_BRACKET: "<",
      /* < */
      CHAR_LEFT_CURLY_BRACE: "{",
      /* { */
      CHAR_LEFT_SQUARE_BRACKET: "[",
      /* [ */
      CHAR_LINE_FEED: "\n",
      /* \n */
      CHAR_NO_BREAK_SPACE: "\xA0",
      /* \u00A0 */
      CHAR_PERCENT: "%",
      /* % */
      CHAR_PLUS: "+",
      /* + */
      CHAR_QUESTION_MARK: "?",
      /* ? */
      CHAR_RIGHT_ANGLE_BRACKET: ">",
      /* > */
      CHAR_RIGHT_CURLY_BRACE: "}",
      /* } */
      CHAR_RIGHT_SQUARE_BRACKET: "]",
      /* ] */
      CHAR_SEMICOLON: ";",
      /* ; */
      CHAR_SINGLE_QUOTE: "'",
      /* ' */
      CHAR_SPACE: " ",
      /*   */
      CHAR_TAB: "	",
      /* \t */
      CHAR_UNDERSCORE: "_",
      /* _ */
      CHAR_VERTICAL_LINE: "|",
      /* | */
      CHAR_ZERO_WIDTH_NOBREAK_SPACE: "\uFEFF"
      /* \uFEFF */
    };
  }
});

// node_modules/braces/lib/parse.js
var require_parse = __commonJS({
  "node_modules/braces/lib/parse.js"(exports2, module2) {
    "use strict";
    var stringify2 = require_stringify();
    var {
      MAX_LENGTH,
      CHAR_BACKSLASH,
      /* \ */
      CHAR_BACKTICK,
      /* ` */
      CHAR_COMMA,
      /* , */
      CHAR_DOT,
      /* . */
      CHAR_LEFT_PARENTHESES,
      /* ( */
      CHAR_RIGHT_PARENTHESES,
      /* ) */
      CHAR_LEFT_CURLY_BRACE,
      /* { */
      CHAR_RIGHT_CURLY_BRACE,
      /* } */
      CHAR_LEFT_SQUARE_BRACKET,
      /* [ */
      CHAR_RIGHT_SQUARE_BRACKET,
      /* ] */
      CHAR_DOUBLE_QUOTE,
      /* " */
      CHAR_SINGLE_QUOTE,
      /* ' */
      CHAR_NO_BREAK_SPACE,
      CHAR_ZERO_WIDTH_NOBREAK_SPACE
    } = require_constants();
    var parse = (input, options = {}) => {
      if (typeof input !== "string") {
        throw new TypeError("Expected a string");
      }
      const opts = options || {};
      const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
      if (input.length > max) {
        throw new SyntaxError(`Input length (${input.length}), exceeds max characters (${max})`);
      }
      const ast = { type: "root", input, nodes: [] };
      const stack = [ast];
      let block = ast;
      let prev = ast;
      let brackets = 0;
      const length = input.length;
      let index = 0;
      let depth = 0;
      let value;
      const advance = () => input[index++];
      const push = (node) => {
        if (node.type === "text" && prev.type === "dot") {
          prev.type = "text";
        }
        if (prev && prev.type === "text" && node.type === "text") {
          prev.value += node.value;
          return;
        }
        block.nodes.push(node);
        node.parent = block;
        node.prev = prev;
        prev = node;
        return node;
      };
      push({ type: "bos" });
      while (index < length) {
        block = stack[stack.length - 1];
        value = advance();
        if (value === CHAR_ZERO_WIDTH_NOBREAK_SPACE || value === CHAR_NO_BREAK_SPACE) {
          continue;
        }
        if (value === CHAR_BACKSLASH) {
          push({ type: "text", value: (options.keepEscaping ? value : "") + advance() });
          continue;
        }
        if (value === CHAR_RIGHT_SQUARE_BRACKET) {
          push({ type: "text", value: "\\" + value });
          continue;
        }
        if (value === CHAR_LEFT_SQUARE_BRACKET) {
          brackets++;
          let next;
          while (index < length && (next = advance())) {
            value += next;
            if (next === CHAR_LEFT_SQUARE_BRACKET) {
              brackets++;
              continue;
            }
            if (next === CHAR_BACKSLASH) {
              value += advance();
              continue;
            }
            if (next === CHAR_RIGHT_SQUARE_BRACKET) {
              brackets--;
              if (brackets === 0) {
                break;
              }
            }
          }
          push({ type: "text", value });
          continue;
        }
        if (value === CHAR_LEFT_PARENTHESES) {
          block = push({ type: "paren", nodes: [] });
          stack.push(block);
          push({ type: "text", value });
          continue;
        }
        if (value === CHAR_RIGHT_PARENTHESES) {
          if (block.type !== "paren") {
            push({ type: "text", value });
            continue;
          }
          block = stack.pop();
          push({ type: "text", value });
          block = stack[stack.length - 1];
          continue;
        }
        if (value === CHAR_DOUBLE_QUOTE || value === CHAR_SINGLE_QUOTE || value === CHAR_BACKTICK) {
          const open = value;
          let next;
          if (options.keepQuotes !== true) {
            value = "";
          }
          while (index < length && (next = advance())) {
            if (next === CHAR_BACKSLASH) {
              value += next + advance();
              continue;
            }
            if (next === open) {
              if (options.keepQuotes === true) value += next;
              break;
            }
            value += next;
          }
          push({ type: "text", value });
          continue;
        }
        if (value === CHAR_LEFT_CURLY_BRACE) {
          depth++;
          const dollar = prev.value && prev.value.slice(-1) === "$" || block.dollar === true;
          const brace = {
            type: "brace",
            open: true,
            close: false,
            dollar,
            depth,
            commas: 0,
            ranges: 0,
            nodes: []
          };
          block = push(brace);
          stack.push(block);
          push({ type: "open", value });
          continue;
        }
        if (value === CHAR_RIGHT_CURLY_BRACE) {
          if (block.type !== "brace") {
            push({ type: "text", value });
            continue;
          }
          const type = "close";
          block = stack.pop();
          block.close = true;
          push({ type, value });
          depth--;
          block = stack[stack.length - 1];
          continue;
        }
        if (value === CHAR_COMMA && depth > 0) {
          if (block.ranges > 0) {
            block.ranges = 0;
            const open = block.nodes.shift();
            block.nodes = [open, { type: "text", value: stringify2(block) }];
          }
          push({ type: "comma", value });
          block.commas++;
          continue;
        }
        if (value === CHAR_DOT && depth > 0 && block.commas === 0) {
          const siblings = block.nodes;
          if (depth === 0 || siblings.length === 0) {
            push({ type: "text", value });
            continue;
          }
          if (prev.type === "dot") {
            block.range = [];
            prev.value += value;
            prev.type = "range";
            if (block.nodes.length !== 3 && block.nodes.length !== 5) {
              block.invalid = true;
              block.ranges = 0;
              prev.type = "text";
              continue;
            }
            block.ranges++;
            block.args = [];
            continue;
          }
          if (prev.type === "range") {
            siblings.pop();
            const before = siblings[siblings.length - 1];
            before.value += prev.value + value;
            prev = before;
            block.ranges--;
            continue;
          }
          push({ type: "dot", value });
          continue;
        }
        push({ type: "text", value });
      }
      do {
        block = stack.pop();
        if (block.type !== "root") {
          block.nodes.forEach((node) => {
            if (!node.nodes) {
              if (node.type === "open") node.isOpen = true;
              if (node.type === "close") node.isClose = true;
              if (!node.nodes) node.type = "text";
              node.invalid = true;
            }
          });
          const parent = stack[stack.length - 1];
          const index2 = parent.nodes.indexOf(block);
          parent.nodes.splice(index2, 1, ...block.nodes);
        }
      } while (stack.length > 0);
      push({ type: "eos" });
      return ast;
    };
    module2.exports = parse;
  }
});

// node_modules/braces/index.js
var require_braces = __commonJS({
  "node_modules/braces/index.js"(exports2, module2) {
    "use strict";
    var stringify2 = require_stringify();
    var compile = require_compile();
    var expand = require_expand();
    var parse = require_parse();
    var braces = (input, options = {}) => {
      let output = [];
      if (Array.isArray(input)) {
        for (const pattern of input) {
          const result = braces.create(pattern, options);
          if (Array.isArray(result)) {
            output.push(...result);
          } else {
            output.push(result);
          }
        }
      } else {
        output = [].concat(braces.create(input, options));
      }
      if (options && options.expand === true && options.nodupes === true) {
        output = [...new Set(output)];
      }
      return output;
    };
    braces.parse = (input, options = {}) => parse(input, options);
    braces.stringify = (input, options = {}) => {
      if (typeof input === "string") {
        return stringify2(braces.parse(input, options), options);
      }
      return stringify2(input, options);
    };
    braces.compile = (input, options = {}) => {
      if (typeof input === "string") {
        input = braces.parse(input, options);
      }
      return compile(input, options);
    };
    braces.expand = (input, options = {}) => {
      if (typeof input === "string") {
        input = braces.parse(input, options);
      }
      let result = expand(input, options);
      if (options.noempty === true) {
        result = result.filter(Boolean);
      }
      if (options.nodupes === true) {
        result = [...new Set(result)];
      }
      return result;
    };
    braces.create = (input, options = {}) => {
      if (input === "" || input.length < 3) {
        return [input];
      }
      return options.expand !== true ? braces.compile(input, options) : braces.expand(input, options);
    };
    module2.exports = braces;
  }
});

// node_modules/micromatch/node_modules/picomatch/lib/constants.js
var require_constants2 = __commonJS({
  "node_modules/micromatch/node_modules/picomatch/lib/constants.js"(exports2, module2) {
    "use strict";
    var path4 = require("path");
    var WIN_SLASH = "\\\\/";
    var WIN_NO_SLASH = `[^${WIN_SLASH}]`;
    var DEFAULT_MAX_EXTGLOB_RECURSION = 0;
    var DOT_LITERAL = "\\.";
    var PLUS_LITERAL = "\\+";
    var QMARK_LITERAL = "\\?";
    var SLASH_LITERAL = "\\/";
    var ONE_CHAR = "(?=.)";
    var QMARK = "[^/]";
    var END_ANCHOR = `(?:${SLASH_LITERAL}|$)`;
    var START_ANCHOR = `(?:^|${SLASH_LITERAL})`;
    var DOTS_SLASH = `${DOT_LITERAL}{1,2}${END_ANCHOR}`;
    var NO_DOT = `(?!${DOT_LITERAL})`;
    var NO_DOTS = `(?!${START_ANCHOR}${DOTS_SLASH})`;
    var NO_DOT_SLASH = `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`;
    var NO_DOTS_SLASH = `(?!${DOTS_SLASH})`;
    var QMARK_NO_DOT = `[^.${SLASH_LITERAL}]`;
    var STAR = `${QMARK}*?`;
    var POSIX_CHARS = {
      DOT_LITERAL,
      PLUS_LITERAL,
      QMARK_LITERAL,
      SLASH_LITERAL,
      ONE_CHAR,
      QMARK,
      END_ANCHOR,
      DOTS_SLASH,
      NO_DOT,
      NO_DOTS,
      NO_DOT_SLASH,
      NO_DOTS_SLASH,
      QMARK_NO_DOT,
      STAR,
      START_ANCHOR
    };
    var WINDOWS_CHARS = {
      ...POSIX_CHARS,
      SLASH_LITERAL: `[${WIN_SLASH}]`,
      QMARK: WIN_NO_SLASH,
      STAR: `${WIN_NO_SLASH}*?`,
      DOTS_SLASH: `${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$)`,
      NO_DOT: `(?!${DOT_LITERAL})`,
      NO_DOTS: `(?!(?:^|[${WIN_SLASH}])${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
      NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}(?:[${WIN_SLASH}]|$))`,
      NO_DOTS_SLASH: `(?!${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
      QMARK_NO_DOT: `[^.${WIN_SLASH}]`,
      START_ANCHOR: `(?:^|[${WIN_SLASH}])`,
      END_ANCHOR: `(?:[${WIN_SLASH}]|$)`
    };
    var POSIX_REGEX_SOURCE = {
      __proto__: null,
      alnum: "a-zA-Z0-9",
      alpha: "a-zA-Z",
      ascii: "\\x00-\\x7F",
      blank: " \\t",
      cntrl: "\\x00-\\x1F\\x7F",
      digit: "0-9",
      graph: "\\x21-\\x7E",
      lower: "a-z",
      print: "\\x20-\\x7E ",
      punct: "\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",
      space: " \\t\\r\\n\\v\\f",
      upper: "A-Z",
      word: "A-Za-z0-9_",
      xdigit: "A-Fa-f0-9"
    };
    module2.exports = {
      DEFAULT_MAX_EXTGLOB_RECURSION,
      MAX_LENGTH: 1024 * 64,
      POSIX_REGEX_SOURCE,
      // regular expressions
      REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g,
      REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/,
      REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/,
      REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g,
      REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g,
      REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g,
      // Replace globs with equivalent patterns to reduce parsing time.
      REPLACEMENTS: {
        __proto__: null,
        "***": "*",
        "**/**": "**",
        "**/**/**": "**"
      },
      // Digits
      CHAR_0: 48,
      /* 0 */
      CHAR_9: 57,
      /* 9 */
      // Alphabet chars.
      CHAR_UPPERCASE_A: 65,
      /* A */
      CHAR_LOWERCASE_A: 97,
      /* a */
      CHAR_UPPERCASE_Z: 90,
      /* Z */
      CHAR_LOWERCASE_Z: 122,
      /* z */
      CHAR_LEFT_PARENTHESES: 40,
      /* ( */
      CHAR_RIGHT_PARENTHESES: 41,
      /* ) */
      CHAR_ASTERISK: 42,
      /* * */
      // Non-alphabetic chars.
      CHAR_AMPERSAND: 38,
      /* & */
      CHAR_AT: 64,
      /* @ */
      CHAR_BACKWARD_SLASH: 92,
      /* \ */
      CHAR_CARRIAGE_RETURN: 13,
      /* \r */
      CHAR_CIRCUMFLEX_ACCENT: 94,
      /* ^ */
      CHAR_COLON: 58,
      /* : */
      CHAR_COMMA: 44,
      /* , */
      CHAR_DOT: 46,
      /* . */
      CHAR_DOUBLE_QUOTE: 34,
      /* " */
      CHAR_EQUAL: 61,
      /* = */
      CHAR_EXCLAMATION_MARK: 33,
      /* ! */
      CHAR_FORM_FEED: 12,
      /* \f */
      CHAR_FORWARD_SLASH: 47,
      /* / */
      CHAR_GRAVE_ACCENT: 96,
      /* ` */
      CHAR_HASH: 35,
      /* # */
      CHAR_HYPHEN_MINUS: 45,
      /* - */
      CHAR_LEFT_ANGLE_BRACKET: 60,
      /* < */
      CHAR_LEFT_CURLY_BRACE: 123,
      /* { */
      CHAR_LEFT_SQUARE_BRACKET: 91,
      /* [ */
      CHAR_LINE_FEED: 10,
      /* \n */
      CHAR_NO_BREAK_SPACE: 160,
      /* \u00A0 */
      CHAR_PERCENT: 37,
      /* % */
      CHAR_PLUS: 43,
      /* + */
      CHAR_QUESTION_MARK: 63,
      /* ? */
      CHAR_RIGHT_ANGLE_BRACKET: 62,
      /* > */
      CHAR_RIGHT_CURLY_BRACE: 125,
      /* } */
      CHAR_RIGHT_SQUARE_BRACKET: 93,
      /* ] */
      CHAR_SEMICOLON: 59,
      /* ; */
      CHAR_SINGLE_QUOTE: 39,
      /* ' */
      CHAR_SPACE: 32,
      /*   */
      CHAR_TAB: 9,
      /* \t */
      CHAR_UNDERSCORE: 95,
      /* _ */
      CHAR_VERTICAL_LINE: 124,
      /* | */
      CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279,
      /* \uFEFF */
      SEP: path4.sep,
      /**
       * Create EXTGLOB_CHARS
       */
      extglobChars(chars) {
        return {
          "!": { type: "negate", open: "(?:(?!(?:", close: `))${chars.STAR})` },
          "?": { type: "qmark", open: "(?:", close: ")?" },
          "+": { type: "plus", open: "(?:", close: ")+" },
          "*": { type: "star", open: "(?:", close: ")*" },
          "@": { type: "at", open: "(?:", close: ")" }
        };
      },
      /**
       * Create GLOB_CHARS
       */
      globChars(win32) {
        return win32 === true ? WINDOWS_CHARS : POSIX_CHARS;
      }
    };
  }
});

// node_modules/micromatch/node_modules/picomatch/lib/utils.js
var require_utils2 = __commonJS({
  "node_modules/micromatch/node_modules/picomatch/lib/utils.js"(exports2) {
    "use strict";
    var path4 = require("path");
    var win32 = process.platform === "win32";
    var {
      REGEX_BACKSLASH,
      REGEX_REMOVE_BACKSLASH,
      REGEX_SPECIAL_CHARS,
      REGEX_SPECIAL_CHARS_GLOBAL
    } = require_constants2();
    exports2.isObject = (val) => val !== null && typeof val === "object" && !Array.isArray(val);
    exports2.hasRegexChars = (str) => REGEX_SPECIAL_CHARS.test(str);
    exports2.isRegexChar = (str) => str.length === 1 && exports2.hasRegexChars(str);
    exports2.escapeRegex = (str) => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, "\\$1");
    exports2.toPosixSlashes = (str) => str.replace(REGEX_BACKSLASH, "/");
    exports2.removeBackslashes = (str) => {
      return str.replace(REGEX_REMOVE_BACKSLASH, (match) => {
        return match === "\\" ? "" : match;
      });
    };
    exports2.supportsLookbehinds = () => {
      const segs = process.version.slice(1).split(".").map(Number);
      if (segs.length === 3 && segs[0] >= 9 || segs[0] === 8 && segs[1] >= 10) {
        return true;
      }
      return false;
    };
    exports2.isWindows = (options) => {
      if (options && typeof options.windows === "boolean") {
        return options.windows;
      }
      return win32 === true || path4.sep === "\\";
    };
    exports2.escapeLast = (input, char, lastIdx) => {
      const idx = input.lastIndexOf(char, lastIdx);
      if (idx === -1) return input;
      if (input[idx - 1] === "\\") return exports2.escapeLast(input, char, idx - 1);
      return `${input.slice(0, idx)}\\${input.slice(idx)}`;
    };
    exports2.removePrefix = (input, state = {}) => {
      let output = input;
      if (output.startsWith("./")) {
        output = output.slice(2);
        state.prefix = "./";
      }
      return output;
    };
    exports2.wrapOutput = (input, state = {}, options = {}) => {
      const prepend = options.contains ? "" : "^";
      const append = options.contains ? "" : "$";
      let output = `${prepend}(?:${input})${append}`;
      if (state.negated === true) {
        output = `(?:^(?!${output}).*$)`;
      }
      return output;
    };
  }
});

// node_modules/micromatch/node_modules/picomatch/lib/scan.js
var require_scan = __commonJS({
  "node_modules/micromatch/node_modules/picomatch/lib/scan.js"(exports2, module2) {
    "use strict";
    var utils2 = require_utils2();
    var {
      CHAR_ASTERISK,
      /* * */
      CHAR_AT,
      /* @ */
      CHAR_BACKWARD_SLASH,
      /* \ */
      CHAR_COMMA,
      /* , */
      CHAR_DOT,
      /* . */
      CHAR_EXCLAMATION_MARK,
      /* ! */
      CHAR_FORWARD_SLASH,
      /* / */
      CHAR_LEFT_CURLY_BRACE,
      /* { */
      CHAR_LEFT_PARENTHESES,
      /* ( */
      CHAR_LEFT_SQUARE_BRACKET,
      /* [ */
      CHAR_PLUS,
      /* + */
      CHAR_QUESTION_MARK,
      /* ? */
      CHAR_RIGHT_CURLY_BRACE,
      /* } */
      CHAR_RIGHT_PARENTHESES,
      /* ) */
      CHAR_RIGHT_SQUARE_BRACKET
      /* ] */
    } = require_constants2();
    var isPathSeparator = (code) => {
      return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH;
    };
    var depth = (token) => {
      if (token.isPrefix !== true) {
        token.depth = token.isGlobstar ? Infinity : 1;
      }
    };
    var scan = (input, options) => {
      const opts = options || {};
      const length = input.length - 1;
      const scanToEnd = opts.parts === true || opts.scanToEnd === true;
      const slashes = [];
      const tokens = [];
      const parts = [];
      let str = input;
      let index = -1;
      let start = 0;
      let lastIndex = 0;
      let isBrace = false;
      let isBracket = false;
      let isGlob = false;
      let isExtglob = false;
      let isGlobstar = false;
      let braceEscaped = false;
      let backslashes = false;
      let negated = false;
      let negatedExtglob = false;
      let finished = false;
      let braces = 0;
      let prev;
      let code;
      let token = { value: "", depth: 0, isGlob: false };
      const eos = () => index >= length;
      const peek = () => str.charCodeAt(index + 1);
      const advance = () => {
        prev = code;
        return str.charCodeAt(++index);
      };
      while (index < length) {
        code = advance();
        let next;
        if (code === CHAR_BACKWARD_SLASH) {
          backslashes = token.backslashes = true;
          code = advance();
          if (code === CHAR_LEFT_CURLY_BRACE) {
            braceEscaped = true;
          }
          continue;
        }
        if (braceEscaped === true || code === CHAR_LEFT_CURLY_BRACE) {
          braces++;
          while (eos() !== true && (code = advance())) {
            if (code === CHAR_BACKWARD_SLASH) {
              backslashes = token.backslashes = true;
              advance();
              continue;
            }
            if (code === CHAR_LEFT_CURLY_BRACE) {
              braces++;
              continue;
            }
            if (braceEscaped !== true && code === CHAR_DOT && (code = advance()) === CHAR_DOT) {
              isBrace = token.isBrace = true;
              isGlob = token.isGlob = true;
              finished = true;
              if (scanToEnd === true) {
                continue;
              }
              break;
            }
            if (braceEscaped !== true && code === CHAR_COMMA) {
              isBrace = token.isBrace = true;
              isGlob = token.isGlob = true;
              finished = true;
              if (scanToEnd === true) {
                continue;
              }
              break;
            }
            if (code === CHAR_RIGHT_CURLY_BRACE) {
              braces--;
              if (braces === 0) {
                braceEscaped = false;
                isBrace = token.isBrace = true;
                finished = true;
                break;
              }
            }
          }
          if (scanToEnd === true) {
            continue;
          }
          break;
        }
        if (code === CHAR_FORWARD_SLASH) {
          slashes.push(index);
          tokens.push(token);
          token = { value: "", depth: 0, isGlob: false };
          if (finished === true) continue;
          if (prev === CHAR_DOT && index === start + 1) {
            start += 2;
            continue;
          }
          lastIndex = index + 1;
          continue;
        }
        if (opts.noext !== true) {
          const isExtglobChar = code === CHAR_PLUS || code === CHAR_AT || code === CHAR_ASTERISK || code === CHAR_QUESTION_MARK || code === CHAR_EXCLAMATION_MARK;
          if (isExtglobChar === true && peek() === CHAR_LEFT_PARENTHESES) {
            isGlob = token.isGlob = true;
            isExtglob = token.isExtglob = true;
            finished = true;
            if (code === CHAR_EXCLAMATION_MARK && index === start) {
              negatedExtglob = true;
            }
            if (scanToEnd === true) {
              while (eos() !== true && (code = advance())) {
                if (code === CHAR_BACKWARD_SLASH) {
                  backslashes = token.backslashes = true;
                  code = advance();
                  continue;
                }
                if (code === CHAR_RIGHT_PARENTHESES) {
                  isGlob = token.isGlob = true;
                  finished = true;
                  break;
                }
              }
              continue;
            }
            break;
          }
        }
        if (code === CHAR_ASTERISK) {
          if (prev === CHAR_ASTERISK) isGlobstar = token.isGlobstar = true;
          isGlob = token.isGlob = true;
          finished = true;
          if (scanToEnd === true) {
            continue;
          }
          break;
        }
        if (code === CHAR_QUESTION_MARK) {
          isGlob = token.isGlob = true;
          finished = true;
          if (scanToEnd === true) {
            continue;
          }
          break;
        }
        if (code === CHAR_LEFT_SQUARE_BRACKET) {
          while (eos() !== true && (next = advance())) {
            if (next === CHAR_BACKWARD_SLASH) {
              backslashes = token.backslashes = true;
              advance();
              continue;
            }
            if (next === CHAR_RIGHT_SQUARE_BRACKET) {
              isBracket = token.isBracket = true;
              isGlob = token.isGlob = true;
              finished = true;
              break;
            }
          }
          if (scanToEnd === true) {
            continue;
          }
          break;
        }
        if (opts.nonegate !== true && code === CHAR_EXCLAMATION_MARK && index === start) {
          negated = token.negated = true;
          start++;
          continue;
        }
        if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES) {
          isGlob = token.isGlob = true;
          if (scanToEnd === true) {
            while (eos() !== true && (code = advance())) {
              if (code === CHAR_LEFT_PARENTHESES) {
                backslashes = token.backslashes = true;
                code = advance();
                continue;
              }
              if (code === CHAR_RIGHT_PARENTHESES) {
                finished = true;
                break;
              }
            }
            continue;
          }
          break;
        }
        if (isGlob === true) {
          finished = true;
          if (scanToEnd === true) {
            continue;
          }
          break;
        }
      }
      if (opts.noext === true) {
        isExtglob = false;
        isGlob = false;
      }
      let base = str;
      let prefix = "";
      let glob = "";
      if (start > 0) {
        prefix = str.slice(0, start);
        str = str.slice(start);
        lastIndex -= start;
      }
      if (base && isGlob === true && lastIndex > 0) {
        base = str.slice(0, lastIndex);
        glob = str.slice(lastIndex);
      } else if (isGlob === true) {
        base = "";
        glob = str;
      } else {
        base = str;
      }
      if (base && base !== "" && base !== "/" && base !== str) {
        if (isPathSeparator(base.charCodeAt(base.length - 1))) {
          base = base.slice(0, -1);
        }
      }
      if (opts.unescape === true) {
        if (glob) glob = utils2.removeBackslashes(glob);
        if (base && backslashes === true) {
          base = utils2.removeBackslashes(base);
        }
      }
      const state = {
        prefix,
        input,
        start,
        base,
        glob,
        isBrace,
        isBracket,
        isGlob,
        isExtglob,
        isGlobstar,
        negated,
        negatedExtglob
      };
      if (opts.tokens === true) {
        state.maxDepth = 0;
        if (!isPathSeparator(code)) {
          tokens.push(token);
        }
        state.tokens = tokens;
      }
      if (opts.parts === true || opts.tokens === true) {
        let prevIndex;
        for (let idx = 0; idx < slashes.length; idx++) {
          const n = prevIndex ? prevIndex + 1 : start;
          const i = slashes[idx];
          const value = input.slice(n, i);
          if (opts.tokens) {
            if (idx === 0 && start !== 0) {
              tokens[idx].isPrefix = true;
              tokens[idx].value = prefix;
            } else {
              tokens[idx].value = value;
            }
            depth(tokens[idx]);
            state.maxDepth += tokens[idx].depth;
          }
          if (idx !== 0 || value !== "") {
            parts.push(value);
          }
          prevIndex = i;
        }
        if (prevIndex && prevIndex + 1 < input.length) {
          const value = input.slice(prevIndex + 1);
          parts.push(value);
          if (opts.tokens) {
            tokens[tokens.length - 1].value = value;
            depth(tokens[tokens.length - 1]);
            state.maxDepth += tokens[tokens.length - 1].depth;
          }
        }
        state.slashes = slashes;
        state.parts = parts;
      }
      return state;
    };
    module2.exports = scan;
  }
});

// node_modules/micromatch/node_modules/picomatch/lib/parse.js
var require_parse2 = __commonJS({
  "node_modules/micromatch/node_modules/picomatch/lib/parse.js"(exports2, module2) {
    "use strict";
    var constants = require_constants2();
    var utils2 = require_utils2();
    var {
      MAX_LENGTH,
      POSIX_REGEX_SOURCE,
      REGEX_NON_SPECIAL_CHARS,
      REGEX_SPECIAL_CHARS_BACKREF,
      REPLACEMENTS
    } = constants;
    var expandRange = (args, options) => {
      if (typeof options.expandRange === "function") {
        return options.expandRange(...args, options);
      }
      args.sort();
      const value = `[${args.join("-")}]`;
      try {
        new RegExp(value);
      } catch (ex) {
        return args.map((v) => utils2.escapeRegex(v)).join("..");
      }
      return value;
    };
    var syntaxError = (type, char) => {
      return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`;
    };
    var splitTopLevel = (input) => {
      const parts = [];
      let bracket = 0;
      let paren = 0;
      let quote = 0;
      let value = "";
      let escaped = false;
      for (const ch of input) {
        if (escaped === true) {
          value += ch;
          escaped = false;
          continue;
        }
        if (ch === "\\") {
          value += ch;
          escaped = true;
          continue;
        }
        if (ch === '"') {
          quote = quote === 1 ? 0 : 1;
          value += ch;
          continue;
        }
        if (quote === 0) {
          if (ch === "[") {
            bracket++;
          } else if (ch === "]" && bracket > 0) {
            bracket--;
          } else if (bracket === 0) {
            if (ch === "(") {
              paren++;
            } else if (ch === ")" && paren > 0) {
              paren--;
            } else if (ch === "|" && paren === 0) {
              parts.push(value);
              value = "";
              continue;
            }
          }
        }
        value += ch;
      }
      parts.push(value);
      return parts;
    };
    var isPlainBranch = (branch) => {
      let escaped = false;
      for (const ch of branch) {
        if (escaped === true) {
          escaped = false;
          continue;
        }
        if (ch === "\\") {
          escaped = true;
          continue;
        }
        if (/[?*+@!()[\]{}]/.test(ch)) {
          return false;
        }
      }
      return true;
    };
    var normalizeSimpleBranch = (branch) => {
      let value = branch.trim();
      let changed = true;
      while (changed === true) {
        changed = false;
        if (/^@\([^\\()[\]{}|]+\)$/.test(value)) {
          value = value.slice(2, -1);
          changed = true;
        }
      }
      if (!isPlainBranch(value)) {
        return;
      }
      return value.replace(/\\(.)/g, "$1");
    };
    var hasRepeatedCharPrefixOverlap = (branches) => {
      const values = branches.map(normalizeSimpleBranch).filter(Boolean);
      for (let i = 0; i < values.length; i++) {
        for (let j = i + 1; j < values.length; j++) {
          const a = values[i];
          const b = values[j];
          const char = a[0];
          if (!char || a !== char.repeat(a.length) || b !== char.repeat(b.length)) {
            continue;
          }
          if (a === b || a.startsWith(b) || b.startsWith(a)) {
            return true;
          }
        }
      }
      return false;
    };
    var parseRepeatedExtglob = (pattern, requireEnd = true) => {
      if (pattern[0] !== "+" && pattern[0] !== "*" || pattern[1] !== "(") {
        return;
      }
      let bracket = 0;
      let paren = 0;
      let quote = 0;
      let escaped = false;
      for (let i = 1; i < pattern.length; i++) {
        const ch = pattern[i];
        if (escaped === true) {
          escaped = false;
          continue;
        }
        if (ch === "\\") {
          escaped = true;
          continue;
        }
        if (ch === '"') {
          quote = quote === 1 ? 0 : 1;
          continue;
        }
        if (quote === 1) {
          continue;
        }
        if (ch === "[") {
          bracket++;
          continue;
        }
        if (ch === "]" && bracket > 0) {
          bracket--;
          continue;
        }
        if (bracket > 0) {
          continue;
        }
        if (ch === "(") {
          paren++;
          continue;
        }
        if (ch === ")") {
          paren--;
          if (paren === 0) {
            if (requireEnd === true && i !== pattern.length - 1) {
              return;
            }
            return {
              type: pattern[0],
              body: pattern.slice(2, i),
              end: i
            };
          }
        }
      }
    };
    var getStarExtglobSequenceOutput = (pattern) => {
      let index = 0;
      const chars = [];
      while (index < pattern.length) {
        const match = parseRepeatedExtglob(pattern.slice(index), false);
        if (!match || match.type !== "*") {
          return;
        }
        const branches = splitTopLevel(match.body).map((branch2) => branch2.trim());
        if (branches.length !== 1) {
          return;
        }
        const branch = normalizeSimpleBranch(branches[0]);
        if (!branch || branch.length !== 1) {
          return;
        }
        chars.push(branch);
        index += match.end + 1;
      }
      if (chars.length < 1) {
        return;
      }
      const source = chars.length === 1 ? utils2.escapeRegex(chars[0]) : `[${chars.map((ch) => utils2.escapeRegex(ch)).join("")}]`;
      return `${source}*`;
    };
    var repeatedExtglobRecursion = (pattern) => {
      let depth = 0;
      let value = pattern.trim();
      let match = parseRepeatedExtglob(value);
      while (match) {
        depth++;
        value = match.body.trim();
        match = parseRepeatedExtglob(value);
      }
      return depth;
    };
    var analyzeRepeatedExtglob = (body, options) => {
      if (options.maxExtglobRecursion === false) {
        return { risky: false };
      }
      const max = typeof options.maxExtglobRecursion === "number" ? options.maxExtglobRecursion : constants.DEFAULT_MAX_EXTGLOB_RECURSION;
      const branches = splitTopLevel(body).map((branch) => branch.trim());
      if (branches.length > 1) {
        if (branches.some((branch) => branch === "") || branches.some((branch) => /^[*?]+$/.test(branch)) || hasRepeatedCharPrefixOverlap(branches)) {
          return { risky: true };
        }
      }
      for (const branch of branches) {
        const safeOutput = getStarExtglobSequenceOutput(branch);
        if (safeOutput) {
          return { risky: true, safeOutput };
        }
        if (repeatedExtglobRecursion(branch) > max) {
          return { risky: true };
        }
      }
      return { risky: false };
    };
    var parse = (input, options) => {
      if (typeof input !== "string") {
        throw new TypeError("Expected a string");
      }
      input = REPLACEMENTS[input] || input;
      const opts = { ...options };
      const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
      let len = input.length;
      if (len > max) {
        throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
      }
      const bos = { type: "bos", value: "", output: opts.prepend || "" };
      const tokens = [bos];
      const capture = opts.capture ? "" : "?:";
      const win32 = utils2.isWindows(options);
      const PLATFORM_CHARS = constants.globChars(win32);
      const EXTGLOB_CHARS = constants.extglobChars(PLATFORM_CHARS);
      const {
        DOT_LITERAL,
        PLUS_LITERAL,
        SLASH_LITERAL,
        ONE_CHAR,
        DOTS_SLASH,
        NO_DOT,
        NO_DOT_SLASH,
        NO_DOTS_SLASH,
        QMARK,
        QMARK_NO_DOT,
        STAR,
        START_ANCHOR
      } = PLATFORM_CHARS;
      const globstar = (opts2) => {
        return `(${capture}(?:(?!${START_ANCHOR}${opts2.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
      };
      const nodot = opts.dot ? "" : NO_DOT;
      const qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT;
      let star = opts.bash === true ? globstar(opts) : STAR;
      if (opts.capture) {
        star = `(${star})`;
      }
      if (typeof opts.noext === "boolean") {
        opts.noextglob = opts.noext;
      }
      const state = {
        input,
        index: -1,
        start: 0,
        dot: opts.dot === true,
        consumed: "",
        output: "",
        prefix: "",
        backtrack: false,
        negated: false,
        brackets: 0,
        braces: 0,
        parens: 0,
        quotes: 0,
        globstar: false,
        tokens
      };
      input = utils2.removePrefix(input, state);
      len = input.length;
      const extglobs = [];
      const braces = [];
      const stack = [];
      let prev = bos;
      let value;
      const eos = () => state.index === len - 1;
      const peek = state.peek = (n = 1) => input[state.index + n];
      const advance = state.advance = () => input[++state.index] || "";
      const remaining = () => input.slice(state.index + 1);
      const consume = (value2 = "", num = 0) => {
        state.consumed += value2;
        state.index += num;
      };
      const append = (token) => {
        state.output += token.output != null ? token.output : token.value;
        consume(token.value);
      };
      const negate = () => {
        let count = 1;
        while (peek() === "!" && (peek(2) !== "(" || peek(3) === "?")) {
          advance();
          state.start++;
          count++;
        }
        if (count % 2 === 0) {
          return false;
        }
        state.negated = true;
        state.start++;
        return true;
      };
      const increment = (type) => {
        state[type]++;
        stack.push(type);
      };
      const decrement = (type) => {
        state[type]--;
        stack.pop();
      };
      const push = (tok) => {
        if (prev.type === "globstar") {
          const isBrace = state.braces > 0 && (tok.type === "comma" || tok.type === "brace");
          const isExtglob = tok.extglob === true || extglobs.length && (tok.type === "pipe" || tok.type === "paren");
          if (tok.type !== "slash" && tok.type !== "paren" && !isBrace && !isExtglob) {
            state.output = state.output.slice(0, -prev.output.length);
            prev.type = "star";
            prev.value = "*";
            prev.output = star;
            state.output += prev.output;
          }
        }
        if (extglobs.length && tok.type !== "paren") {
          extglobs[extglobs.length - 1].inner += tok.value;
        }
        if (tok.value || tok.output) append(tok);
        if (prev && prev.type === "text" && tok.type === "text") {
          prev.value += tok.value;
          prev.output = (prev.output || "") + tok.value;
          return;
        }
        tok.prev = prev;
        tokens.push(tok);
        prev = tok;
      };
      const extglobOpen = (type, value2) => {
        const token = { ...EXTGLOB_CHARS[value2], conditions: 1, inner: "" };
        token.prev = prev;
        token.parens = state.parens;
        token.output = state.output;
        token.startIndex = state.index;
        token.tokensIndex = tokens.length;
        const output = (opts.capture ? "(" : "") + token.open;
        increment("parens");
        push({ type, value: value2, output: state.output ? "" : ONE_CHAR });
        push({ type: "paren", extglob: true, value: advance(), output });
        extglobs.push(token);
      };
      const extglobClose = (token) => {
        const literal = input.slice(token.startIndex, state.index + 1);
        const body = input.slice(token.startIndex + 2, state.index);
        const analysis = analyzeRepeatedExtglob(body, opts);
        if ((token.type === "plus" || token.type === "star") && analysis.risky) {
          const safeOutput = analysis.safeOutput ? (token.output ? "" : ONE_CHAR) + (opts.capture ? `(${analysis.safeOutput})` : analysis.safeOutput) : void 0;
          const open = tokens[token.tokensIndex];
          open.type = "text";
          open.value = literal;
          open.output = safeOutput || utils2.escapeRegex(literal);
          for (let i = token.tokensIndex + 1; i < tokens.length; i++) {
            tokens[i].value = "";
            tokens[i].output = "";
            delete tokens[i].suffix;
          }
          state.output = token.output + open.output;
          state.backtrack = true;
          push({ type: "paren", extglob: true, value, output: "" });
          decrement("parens");
          return;
        }
        let output = token.close + (opts.capture ? ")" : "");
        let rest;
        if (token.type === "negate") {
          let extglobStar = star;
          if (token.inner && token.inner.length > 1 && token.inner.includes("/")) {
            extglobStar = globstar(opts);
          }
          if (extglobStar !== star || eos() || /^\)+$/.test(remaining())) {
            output = token.close = `)$))${extglobStar}`;
          }
          if (token.inner.includes("*") && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) {
            const expression = parse(rest, { ...options, fastpaths: false }).output;
            output = token.close = `)${expression})${extglobStar})`;
          }
          if (token.prev.type === "bos") {
            state.negatedExtglob = true;
          }
        }
        push({ type: "paren", extglob: true, value, output });
        decrement("parens");
      };
      if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input)) {
        let backslashes = false;
        let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index) => {
          if (first === "\\") {
            backslashes = true;
            return m;
          }
          if (first === "?") {
            if (esc) {
              return esc + first + (rest ? QMARK.repeat(rest.length) : "");
            }
            if (index === 0) {
              return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : "");
            }
            return QMARK.repeat(chars.length);
          }
          if (first === ".") {
            return DOT_LITERAL.repeat(chars.length);
          }
          if (first === "*") {
            if (esc) {
              return esc + first + (rest ? star : "");
            }
            return star;
          }
          return esc ? m : `\\${m}`;
        });
        if (backslashes === true) {
          if (opts.unescape === true) {
            output = output.replace(/\\/g, "");
          } else {
            output = output.replace(/\\+/g, (m) => {
              return m.length % 2 === 0 ? "\\\\" : m ? "\\" : "";
            });
          }
        }
        if (output === input && opts.contains === true) {
          state.output = input;
          return state;
        }
        state.output = utils2.wrapOutput(output, state, options);
        return state;
      }
      while (!eos()) {
        value = advance();
        if (value === "\0") {
          continue;
        }
        if (value === "\\") {
          const next = peek();
          if (next === "/" && opts.bash !== true) {
            continue;
          }
          if (next === "." || next === ";") {
            continue;
          }
          if (!next) {
            value += "\\";
            push({ type: "text", value });
            continue;
          }
          const match = /^\\+/.exec(remaining());
          let slashes = 0;
          if (match && match[0].length > 2) {
            slashes = match[0].length;
            state.index += slashes;
            if (slashes % 2 !== 0) {
              value += "\\";
            }
          }
          if (opts.unescape === true) {
            value = advance();
          } else {
            value += advance();
          }
          if (state.brackets === 0) {
            push({ type: "text", value });
            continue;
          }
        }
        if (state.brackets > 0 && (value !== "]" || prev.value === "[" || prev.value === "[^")) {
          if (opts.posix !== false && value === ":") {
            const inner = prev.value.slice(1);
            if (inner.includes("[")) {
              prev.posix = true;
              if (inner.includes(":")) {
                const idx = prev.value.lastIndexOf("[");
                const pre = prev.value.slice(0, idx);
                const rest2 = prev.value.slice(idx + 2);
                const posix = POSIX_REGEX_SOURCE[rest2];
                if (posix) {
                  prev.value = pre + posix;
                  state.backtrack = true;
                  advance();
                  if (!bos.output && tokens.indexOf(prev) === 1) {
                    bos.output = ONE_CHAR;
                  }
                  continue;
                }
              }
            }
          }
          if (value === "[" && peek() !== ":" || value === "-" && peek() === "]") {
            value = `\\${value}`;
          }
          if (value === "]" && (prev.value === "[" || prev.value === "[^")) {
            value = `\\${value}`;
          }
          if (opts.posix === true && value === "!" && prev.value === "[") {
            value = "^";
          }
          prev.value += value;
          append({ value });
          continue;
        }
        if (state.quotes === 1 && value !== '"') {
          value = utils2.escapeRegex(value);
          prev.value += value;
          append({ value });
          continue;
        }
        if (value === '"') {
          state.quotes = state.quotes === 1 ? 0 : 1;
          if (opts.keepQuotes === true) {
            push({ type: "text", value });
          }
          continue;
        }
        if (value === "(") {
          increment("parens");
          push({ type: "paren", value });
          continue;
        }
        if (value === ")") {
          if (state.parens === 0 && opts.strictBrackets === true) {
            throw new SyntaxError(syntaxError("opening", "("));
          }
          const extglob = extglobs[extglobs.length - 1];
          if (extglob && state.parens === extglob.parens + 1) {
            extglobClose(extglobs.pop());
            continue;
          }
          push({ type: "paren", value, output: state.parens ? ")" : "\\)" });
          decrement("parens");
          continue;
        }
        if (value === "[") {
          if (opts.nobracket === true || !remaining().includes("]")) {
            if (opts.nobracket !== true && opts.strictBrackets === true) {
              throw new SyntaxError(syntaxError("closing", "]"));
            }
            value = `\\${value}`;
          } else {
            increment("brackets");
          }
          push({ type: "bracket", value });
          continue;
        }
        if (value === "]") {
          if (opts.nobracket === true || prev && prev.type === "bracket" && prev.value.length === 1) {
            push({ type: "text", value, output: `\\${value}` });
            continue;
          }
          if (state.brackets === 0) {
            if (opts.strictBrackets === true) {
              throw new SyntaxError(syntaxError("opening", "["));
            }
            push({ type: "text", value, output: `\\${value}` });
            continue;
          }
          decrement("brackets");
          const prevValue = prev.value.slice(1);
          if (prev.posix !== true && prevValue[0] === "^" && !prevValue.includes("/")) {
            value = `/${value}`;
          }
          prev.value += value;
          append({ value });
          if (opts.literalBrackets === false || utils2.hasRegexChars(prevValue)) {
            continue;
          }
          const escaped = utils2.escapeRegex(prev.value);
          state.output = state.output.slice(0, -prev.value.length);
          if (opts.literalBrackets === true) {
            state.output += escaped;
            prev.value = escaped;
            continue;
          }
          prev.value = `(${capture}${escaped}|${prev.value})`;
          state.output += prev.value;
          continue;
        }
        if (value === "{" && opts.nobrace !== true) {
          increment("braces");
          const open = {
            type: "brace",
            value,
            output: "(",
            outputIndex: state.output.length,
            tokensIndex: state.tokens.length
          };
          braces.push(open);
          push(open);
          continue;
        }
        if (value === "}") {
          const brace = braces[braces.length - 1];
          if (opts.nobrace === true || !brace) {
            push({ type: "text", value, output: value });
            continue;
          }
          let output = ")";
          if (brace.dots === true) {
            const arr = tokens.slice();
            const range = [];
            for (let i = arr.length - 1; i >= 0; i--) {
              tokens.pop();
              if (arr[i].type === "brace") {
                break;
              }
              if (arr[i].type !== "dots") {
                range.unshift(arr[i].value);
              }
            }
            output = expandRange(range, opts);
            state.backtrack = true;
          }
          if (brace.comma !== true && brace.dots !== true) {
            const out = state.output.slice(0, brace.outputIndex);
            const toks = state.tokens.slice(brace.tokensIndex);
            brace.value = brace.output = "\\{";
            value = output = "\\}";
            state.output = out;
            for (const t of toks) {
              state.output += t.output || t.value;
            }
          }
          push({ type: "brace", value, output });
          decrement("braces");
          braces.pop();
          continue;
        }
        if (value === "|") {
          if (extglobs.length > 0) {
            extglobs[extglobs.length - 1].conditions++;
          }
          push({ type: "text", value });
          continue;
        }
        if (value === ",") {
          let output = value;
          const brace = braces[braces.length - 1];
          if (brace && stack[stack.length - 1] === "braces") {
            brace.comma = true;
            output = "|";
          }
          push({ type: "comma", value, output });
          continue;
        }
        if (value === "/") {
          if (prev.type === "dot" && state.index === state.start + 1) {
            state.start = state.index + 1;
            state.consumed = "";
            state.output = "";
            tokens.pop();
            prev = bos;
            continue;
          }
          push({ type: "slash", value, output: SLASH_LITERAL });
          continue;
        }
        if (value === ".") {
          if (state.braces > 0 && prev.type === "dot") {
            if (prev.value === ".") prev.output = DOT_LITERAL;
            const brace = braces[braces.length - 1];
            prev.type = "dots";
            prev.output += value;
            prev.value += value;
            brace.dots = true;
            continue;
          }
          if (state.braces + state.parens === 0 && prev.type !== "bos" && prev.type !== "slash") {
            push({ type: "text", value, output: DOT_LITERAL });
            continue;
          }
          push({ type: "dot", value, output: DOT_LITERAL });
          continue;
        }
        if (value === "?") {
          const isGroup = prev && prev.value === "(";
          if (!isGroup && opts.noextglob !== true && peek() === "(" && peek(2) !== "?") {
            extglobOpen("qmark", value);
            continue;
          }
          if (prev && prev.type === "paren") {
            const next = peek();
            let output = value;
            if (next === "<" && !utils2.supportsLookbehinds()) {
              throw new Error("Node.js v10 or higher is required for regex lookbehinds");
            }
            if (prev.value === "(" && !/[!=<:]/.test(next) || next === "<" && !/<([!=]|\w+>)/.test(remaining())) {
              output = `\\${value}`;
            }
            push({ type: "text", value, output });
            continue;
          }
          if (opts.dot !== true && (prev.type === "slash" || prev.type === "bos")) {
            push({ type: "qmark", value, output: QMARK_NO_DOT });
            continue;
          }
          push({ type: "qmark", value, output: QMARK });
          continue;
        }
        if (value === "!") {
          if (opts.noextglob !== true && peek() === "(") {
            if (peek(2) !== "?" || !/[!=<:]/.test(peek(3))) {
              extglobOpen("negate", value);
              continue;
            }
          }
          if (opts.nonegate !== true && state.index === 0) {
            negate();
            continue;
          }
        }
        if (value === "+") {
          if (opts.noextglob !== true && peek() === "(" && peek(2) !== "?") {
            extglobOpen("plus", value);
            continue;
          }
          if (prev && prev.value === "(" || opts.regex === false) {
            push({ type: "plus", value, output: PLUS_LITERAL });
            continue;
          }
          if (prev && (prev.type === "bracket" || prev.type === "paren" || prev.type === "brace") || state.parens > 0) {
            push({ type: "plus", value });
            continue;
          }
          push({ type: "plus", value: PLUS_LITERAL });
          continue;
        }
        if (value === "@") {
          if (opts.noextglob !== true && peek() === "(" && peek(2) !== "?") {
            push({ type: "at", extglob: true, value, output: "" });
            continue;
          }
          push({ type: "text", value });
          continue;
        }
        if (value !== "*") {
          if (value === "$" || value === "^") {
            value = `\\${value}`;
          }
          const match = REGEX_NON_SPECIAL_CHARS.exec(remaining());
          if (match) {
            value += match[0];
            state.index += match[0].length;
          }
          push({ type: "text", value });
          continue;
        }
        if (prev && (prev.type === "globstar" || prev.star === true)) {
          prev.type = "star";
          prev.star = true;
          prev.value += value;
          prev.output = star;
          state.backtrack = true;
          state.globstar = true;
          consume(value);
          continue;
        }
        let rest = remaining();
        if (opts.noextglob !== true && /^\([^?]/.test(rest)) {
          extglobOpen("star", value);
          continue;
        }
        if (prev.type === "star") {
          if (opts.noglobstar === true) {
            consume(value);
            continue;
          }
          const prior = prev.prev;
          const before = prior.prev;
          const isStart = prior.type === "slash" || prior.type === "bos";
          const afterStar = before && (before.type === "star" || before.type === "globstar");
          if (opts.bash === true && (!isStart || rest[0] && rest[0] !== "/")) {
            push({ type: "star", value, output: "" });
            continue;
          }
          const isBrace = state.braces > 0 && (prior.type === "comma" || prior.type === "brace");
          const isExtglob = extglobs.length && (prior.type === "pipe" || prior.type === "paren");
          if (!isStart && prior.type !== "paren" && !isBrace && !isExtglob) {
            push({ type: "star", value, output: "" });
            continue;
          }
          while (rest.slice(0, 3) === "/**") {
            const after = input[state.index + 4];
            if (after && after !== "/") {
              break;
            }
            rest = rest.slice(3);
            consume("/**", 3);
          }
          if (prior.type === "bos" && eos()) {
            prev.type = "globstar";
            prev.value += value;
            prev.output = globstar(opts);
            state.output = prev.output;
            state.globstar = true;
            consume(value);
            continue;
          }
          if (prior.type === "slash" && prior.prev.type !== "bos" && !afterStar && eos()) {
            state.output = state.output.slice(0, -(prior.output + prev.output).length);
            prior.output = `(?:${prior.output}`;
            prev.type = "globstar";
            prev.output = globstar(opts) + (opts.strictSlashes ? ")" : "|$)");
            prev.value += value;
            state.globstar = true;
            state.output += prior.output + prev.output;
            consume(value);
            continue;
          }
          if (prior.type === "slash" && prior.prev.type !== "bos" && rest[0] === "/") {
            const end = rest[1] !== void 0 ? "|$" : "";
            state.output = state.output.slice(0, -(prior.output + prev.output).length);
            prior.output = `(?:${prior.output}`;
            prev.type = "globstar";
            prev.output = `${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`;
            prev.value += value;
            state.output += prior.output + prev.output;
            state.globstar = true;
            consume(value + advance());
            push({ type: "slash", value: "/", output: "" });
            continue;
          }
          if (prior.type === "bos" && rest[0] === "/") {
            prev.type = "globstar";
            prev.value += value;
            prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`;
            state.output = prev.output;
            state.globstar = true;
            consume(value + advance());
            push({ type: "slash", value: "/", output: "" });
            continue;
          }
          state.output = state.output.slice(0, -prev.output.length);
          prev.type = "globstar";
          prev.output = globstar(opts);
          prev.value += value;
          state.output += prev.output;
          state.globstar = true;
          consume(value);
          continue;
        }
        const token = { type: "star", value, output: star };
        if (opts.bash === true) {
          token.output = ".*?";
          if (prev.type === "bos" || prev.type === "slash") {
            token.output = nodot + token.output;
          }
          push(token);
          continue;
        }
        if (prev && (prev.type === "bracket" || prev.type === "paren") && opts.regex === true) {
          token.output = value;
          push(token);
          continue;
        }
        if (state.index === state.start || prev.type === "slash" || prev.type === "dot") {
          if (prev.type === "dot") {
            state.output += NO_DOT_SLASH;
            prev.output += NO_DOT_SLASH;
          } else if (opts.dot === true) {
            state.output += NO_DOTS_SLASH;
            prev.output += NO_DOTS_SLASH;
          } else {
            state.output += nodot;
            prev.output += nodot;
          }
          if (peek() !== "*") {
            state.output += ONE_CHAR;
            prev.output += ONE_CHAR;
          }
        }
        push(token);
      }
      while (state.brackets > 0) {
        if (opts.strictBrackets === true) throw new SyntaxError(syntaxError("closing", "]"));
        state.output = utils2.escapeLast(state.output, "[");
        decrement("brackets");
      }
      while (state.parens > 0) {
        if (opts.strictBrackets === true) throw new SyntaxError(syntaxError("closing", ")"));
        state.output = utils2.escapeLast(state.output, "(");
        decrement("parens");
      }
      while (state.braces > 0) {
        if (opts.strictBrackets === true) throw new SyntaxError(syntaxError("closing", "}"));
        state.output = utils2.escapeLast(state.output, "{");
        decrement("braces");
      }
      if (opts.strictSlashes !== true && (prev.type === "star" || prev.type === "bracket")) {
        push({ type: "maybe_slash", value: "", output: `${SLASH_LITERAL}?` });
      }
      if (state.backtrack === true) {
        state.output = "";
        for (const token of state.tokens) {
          state.output += token.output != null ? token.output : token.value;
          if (token.suffix) {
            state.output += token.suffix;
          }
        }
      }
      return state;
    };
    parse.fastpaths = (input, options) => {
      const opts = { ...options };
      const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
      const len = input.length;
      if (len > max) {
        throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
      }
      input = REPLACEMENTS[input] || input;
      const win32 = utils2.isWindows(options);
      const {
        DOT_LITERAL,
        SLASH_LITERAL,
        ONE_CHAR,
        DOTS_SLASH,
        NO_DOT,
        NO_DOTS,
        NO_DOTS_SLASH,
        STAR,
        START_ANCHOR
      } = constants.globChars(win32);
      const nodot = opts.dot ? NO_DOTS : NO_DOT;
      const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT;
      const capture = opts.capture ? "" : "?:";
      const state = { negated: false, prefix: "" };
      let star = opts.bash === true ? ".*?" : STAR;
      if (opts.capture) {
        star = `(${star})`;
      }
      const globstar = (opts2) => {
        if (opts2.noglobstar === true) return star;
        return `(${capture}(?:(?!${START_ANCHOR}${opts2.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
      };
      const create = (str) => {
        switch (str) {
          case "*":
            return `${nodot}${ONE_CHAR}${star}`;
          case ".*":
            return `${DOT_LITERAL}${ONE_CHAR}${star}`;
          case "*.*":
            return `${nodot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
          case "*/*":
            return `${nodot}${star}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star}`;
          case "**":
            return nodot + globstar(opts);
          case "**/*":
            return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star}`;
          case "**/*.*":
            return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
          case "**/.*":
            return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`;
          default: {
            const match = /^(.*?)\.(\w+)$/.exec(str);
            if (!match) return;
            const source2 = create(match[1]);
            if (!source2) return;
            return source2 + DOT_LITERAL + match[2];
          }
        }
      };
      const output = utils2.removePrefix(input, state);
      let source = create(output);
      if (source && opts.strictSlashes !== true) {
        source += `${SLASH_LITERAL}?`;
      }
      return source;
    };
    module2.exports = parse;
  }
});

// node_modules/micromatch/node_modules/picomatch/lib/picomatch.js
var require_picomatch = __commonJS({
  "node_modules/micromatch/node_modules/picomatch/lib/picomatch.js"(exports2, module2) {
    "use strict";
    var path4 = require("path");
    var scan = require_scan();
    var parse = require_parse2();
    var utils2 = require_utils2();
    var constants = require_constants2();
    var isObject2 = (val) => val && typeof val === "object" && !Array.isArray(val);
    var picomatch = (glob, options, returnState = false) => {
      if (Array.isArray(glob)) {
        const fns = glob.map((input) => picomatch(input, options, returnState));
        const arrayMatcher = (str) => {
          for (const isMatch of fns) {
            const state2 = isMatch(str);
            if (state2) return state2;
          }
          return false;
        };
        return arrayMatcher;
      }
      const isState = isObject2(glob) && glob.tokens && glob.input;
      if (glob === "" || typeof glob !== "string" && !isState) {
        throw new TypeError("Expected pattern to be a non-empty string");
      }
      const opts = options || {};
      const posix = utils2.isWindows(options);
      const regex = isState ? picomatch.compileRe(glob, options) : picomatch.makeRe(glob, options, false, true);
      const state = regex.state;
      delete regex.state;
      let isIgnored = () => false;
      if (opts.ignore) {
        const ignoreOpts = { ...options, ignore: null, onMatch: null, onResult: null };
        isIgnored = picomatch(opts.ignore, ignoreOpts, returnState);
      }
      const matcher = (input, returnObject = false) => {
        const { isMatch, match, output } = picomatch.test(input, regex, options, { glob, posix });
        const result = { glob, state, regex, posix, input, output, match, isMatch };
        if (typeof opts.onResult === "function") {
          opts.onResult(result);
        }
        if (isMatch === false) {
          result.isMatch = false;
          return returnObject ? result : false;
        }
        if (isIgnored(input)) {
          if (typeof opts.onIgnore === "function") {
            opts.onIgnore(result);
          }
          result.isMatch = false;
          return returnObject ? result : false;
        }
        if (typeof opts.onMatch === "function") {
          opts.onMatch(result);
        }
        return returnObject ? result : true;
      };
      if (returnState) {
        matcher.state = state;
      }
      return matcher;
    };
    picomatch.test = (input, regex, options, { glob, posix } = {}) => {
      if (typeof input !== "string") {
        throw new TypeError("Expected input to be a string");
      }
      if (input === "") {
        return { isMatch: false, output: "" };
      }
      const opts = options || {};
      const format = opts.format || (posix ? utils2.toPosixSlashes : null);
      let match = input === glob;
      let output = match && format ? format(input) : input;
      if (match === false) {
        output = format ? format(input) : input;
        match = output === glob;
      }
      if (match === false || opts.capture === true) {
        if (opts.matchBase === true || opts.basename === true) {
          match = picomatch.matchBase(input, regex, options, posix);
        } else {
          match = regex.exec(output);
        }
      }
      return { isMatch: Boolean(match), match, output };
    };
    picomatch.matchBase = (input, glob, options, posix = utils2.isWindows(options)) => {
      const regex = glob instanceof RegExp ? glob : picomatch.makeRe(glob, options);
      return regex.test(path4.basename(input));
    };
    picomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str);
    picomatch.parse = (pattern, options) => {
      if (Array.isArray(pattern)) return pattern.map((p) => picomatch.parse(p, options));
      return parse(pattern, { ...options, fastpaths: false });
    };
    picomatch.scan = (input, options) => scan(input, options);
    picomatch.compileRe = (state, options, returnOutput = false, returnState = false) => {
      if (returnOutput === true) {
        return state.output;
      }
      const opts = options || {};
      const prepend = opts.contains ? "" : "^";
      const append = opts.contains ? "" : "$";
      let source = `${prepend}(?:${state.output})${append}`;
      if (state && state.negated === true) {
        source = `^(?!${source}).*$`;
      }
      const regex = picomatch.toRegex(source, options);
      if (returnState === true) {
        regex.state = state;
      }
      return regex;
    };
    picomatch.makeRe = (input, options = {}, returnOutput = false, returnState = false) => {
      if (!input || typeof input !== "string") {
        throw new TypeError("Expected a non-empty string");
      }
      let parsed = { negated: false, fastpaths: true };
      if (options.fastpaths !== false && (input[0] === "." || input[0] === "*")) {
        parsed.output = parse.fastpaths(input, options);
      }
      if (!parsed.output) {
        parsed = parse(input, options);
      }
      return picomatch.compileRe(parsed, options, returnOutput, returnState);
    };
    picomatch.toRegex = (source, options) => {
      try {
        const opts = options || {};
        return new RegExp(source, opts.flags || (opts.nocase ? "i" : ""));
      } catch (err) {
        if (options && options.debug === true) throw err;
        return /$^/;
      }
    };
    picomatch.constants = constants;
    module2.exports = picomatch;
  }
});

// node_modules/micromatch/node_modules/picomatch/index.js
var require_picomatch2 = __commonJS({
  "node_modules/micromatch/node_modules/picomatch/index.js"(exports2, module2) {
    "use strict";
    module2.exports = require_picomatch();
  }
});

// node_modules/micromatch/index.js
var require_micromatch = __commonJS({
  "node_modules/micromatch/index.js"(exports2, module2) {
    "use strict";
    var util2 = require("util");
    var braces = require_braces();
    var picomatch = require_picomatch2();
    var utils2 = require_utils2();
    var isEmptyString = (v) => v === "" || v === "./";
    var hasBraces = (v) => {
      const index = v.indexOf("{");
      return index > -1 && v.indexOf("}", index) > -1;
    };
    var micromatch = (list, patterns, options) => {
      patterns = [].concat(patterns);
      list = [].concat(list);
      let omit = /* @__PURE__ */ new Set();
      let keep = /* @__PURE__ */ new Set();
      let items = /* @__PURE__ */ new Set();
      let negatives = 0;
      let onResult = (state) => {
        items.add(state.output);
        if (options && options.onResult) {
          options.onResult(state);
        }
      };
      for (let i = 0; i < patterns.length; i++) {
        let isMatch = picomatch(String(patterns[i]), { ...options, onResult }, true);
        let negated = isMatch.state.negated || isMatch.state.negatedExtglob;
        if (negated) negatives++;
        for (let item of list) {
          let matched = isMatch(item, true);
          let match = negated ? !matched.isMatch : matched.isMatch;
          if (!match) continue;
          if (negated) {
            omit.add(matched.output);
          } else {
            omit.delete(matched.output);
            keep.add(matched.output);
          }
        }
      }
      let result = negatives === patterns.length ? [...items] : [...keep];
      let matches = result.filter((item) => !omit.has(item));
      if (options && matches.length === 0) {
        if (options.failglob === true) {
          throw new Error(`No matches found for "${patterns.join(", ")}"`);
        }
        if (options.nonull === true || options.nullglob === true) {
          return options.unescape ? patterns.map((p) => p.replace(/\\/g, "")) : patterns;
        }
      }
      return matches;
    };
    micromatch.match = micromatch;
    micromatch.matcher = (pattern, options) => picomatch(pattern, options);
    micromatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str);
    micromatch.any = micromatch.isMatch;
    micromatch.not = (list, patterns, options = {}) => {
      patterns = [].concat(patterns).map(String);
      let result = /* @__PURE__ */ new Set();
      let items = [];
      let onResult = (state) => {
        if (options.onResult) options.onResult(state);
        items.push(state.output);
      };
      let matches = new Set(micromatch(list, patterns, { ...options, onResult }));
      for (let item of items) {
        if (!matches.has(item)) {
          result.add(item);
        }
      }
      return [...result];
    };
    micromatch.contains = (str, pattern, options) => {
      if (typeof str !== "string") {
        throw new TypeError(`Expected a string: "${util2.inspect(str)}"`);
      }
      if (Array.isArray(pattern)) {
        return pattern.some((p) => micromatch.contains(str, p, options));
      }
      if (typeof pattern === "string") {
        if (isEmptyString(str) || isEmptyString(pattern)) {
          return false;
        }
        if (str.includes(pattern) || str.startsWith("./") && str.slice(2).includes(pattern)) {
          return true;
        }
      }
      return micromatch.isMatch(str, pattern, { ...options, contains: true });
    };
    micromatch.matchKeys = (obj, patterns, options) => {
      if (!utils2.isObject(obj)) {
        throw new TypeError("Expected the first argument to be an object");
      }
      let keys = micromatch(Object.keys(obj), patterns, options);
      let res = {};
      for (let key of keys) res[key] = obj[key];
      return res;
    };
    micromatch.some = (list, patterns, options) => {
      let items = [].concat(list);
      for (let pattern of [].concat(patterns)) {
        let isMatch = picomatch(String(pattern), options);
        if (items.some((item) => isMatch(item))) {
          return true;
        }
      }
      return false;
    };
    micromatch.every = (list, patterns, options) => {
      let items = [].concat(list);
      for (let pattern of [].concat(patterns)) {
        let isMatch = picomatch(String(pattern), options);
        if (!items.every((item) => isMatch(item))) {
          return false;
        }
      }
      return true;
    };
    micromatch.all = (str, patterns, options) => {
      if (typeof str !== "string") {
        throw new TypeError(`Expected a string: "${util2.inspect(str)}"`);
      }
      return [].concat(patterns).every((p) => picomatch(p, options)(str));
    };
    micromatch.capture = (glob, input, options) => {
      let posix = utils2.isWindows(options);
      let regex = picomatch.makeRe(String(glob), { ...options, capture: true });
      let match = regex.exec(posix ? utils2.toPosixSlashes(input) : input);
      if (match) {
        return match.slice(1).map((v) => v === void 0 ? "" : v);
      }
    };
    micromatch.makeRe = (...args) => picomatch.makeRe(...args);
    micromatch.scan = (...args) => picomatch.scan(...args);
    micromatch.parse = (patterns, options) => {
      let res = [];
      for (let pattern of [].concat(patterns || [])) {
        for (let str of braces(String(pattern), options)) {
          res.push(picomatch.parse(str, options));
        }
      }
      return res;
    };
    micromatch.braces = (pattern, options) => {
      if (typeof pattern !== "string") throw new TypeError("Expected a string");
      if (options && options.nobrace === true || !hasBraces(pattern)) {
        return [pattern];
      }
      return braces(pattern, options);
    };
    micromatch.braceExpand = (pattern, options) => {
      if (typeof pattern !== "string") throw new TypeError("Expected a string");
      return micromatch.braces(pattern, { ...options, expand: true });
    };
    micromatch.hasBraces = hasBraces;
    module2.exports = micromatch;
  }
});

// node_modules/slash/index.js
var require_slash = __commonJS({
  "node_modules/slash/index.js"(exports2, module2) {
    "use strict";
    module2.exports = (path4) => {
      const isExtendedLengthPath = /^\\\\\?\\/.test(path4);
      const hasNonAscii = /[^\u0000-\u0080]+/.test(path4);
      if (isExtendedLengthPath || hasNonAscii) {
        return path4;
      }
      return path4.replace(/\\/g, "/");
    };
  }
});

// node_modules/stack-utils/node_modules/escape-string-regexp/index.js
var require_escape_string_regexp = __commonJS({
  "node_modules/stack-utils/node_modules/escape-string-regexp/index.js"(exports2, module2) {
    "use strict";
    var matchOperatorsRegex = /[|\\{}()[\]^$+*?.-]/g;
    module2.exports = (string) => {
      if (typeof string !== "string") {
        throw new TypeError("Expected a string");
      }
      return string.replace(matchOperatorsRegex, "\\$&");
    };
  }
});

// node_modules/stack-utils/index.js
var require_stack_utils = __commonJS({
  "node_modules/stack-utils/index.js"(exports2, module2) {
    "use strict";
    var escapeStringRegexp = require_escape_string_regexp();
    var cwd = typeof process === "object" && process && typeof process.cwd === "function" ? process.cwd() : ".";
    var natives = [].concat(
      require("module").builtinModules,
      "bootstrap_node",
      "node"
    ).map((n) => new RegExp(`(?:\\((?:node:)?${n}(?:\\.js)?:\\d+:\\d+\\)$|^\\s*at (?:node:)?${n}(?:\\.js)?:\\d+:\\d+$)`));
    natives.push(
      /\((?:node:)?internal\/[^:]+:\d+:\d+\)$/,
      /\s*at (?:node:)?internal\/[^:]+:\d+:\d+$/,
      /\/\.node-spawn-wrap-\w+-\w+\/node:\d+:\d+\)?$/
    );
    var StackUtils = class _StackUtils {
      constructor(opts) {
        opts = {
          ignoredPackages: [],
          ...opts
        };
        if ("internals" in opts === false) {
          opts.internals = _StackUtils.nodeInternals();
        }
        if ("cwd" in opts === false) {
          opts.cwd = cwd;
        }
        this._cwd = opts.cwd.replace(/\\/g, "/");
        this._internals = [].concat(
          opts.internals,
          ignoredPackagesRegExp(opts.ignoredPackages)
        );
        this._wrapCallSite = opts.wrapCallSite || false;
      }
      static nodeInternals() {
        return [...natives];
      }
      clean(stack, indent3 = 0) {
        indent3 = " ".repeat(indent3);
        if (!Array.isArray(stack)) {
          stack = stack.split("\n");
        }
        if (!/^\s*at /.test(stack[0]) && /^\s*at /.test(stack[1])) {
          stack = stack.slice(1);
        }
        let outdent = false;
        let lastNonAtLine = null;
        const result = [];
        stack.forEach((st) => {
          st = st.replace(/\\/g, "/");
          if (this._internals.some((internal) => internal.test(st))) {
            return;
          }
          const isAtLine = /^\s*at /.test(st);
          if (outdent) {
            st = st.trimEnd().replace(/^(\s+)at /, "$1");
          } else {
            st = st.trim();
            if (isAtLine) {
              st = st.slice(3);
            }
          }
          st = st.replace(`${this._cwd}/`, "");
          if (st) {
            if (isAtLine) {
              if (lastNonAtLine) {
                result.push(lastNonAtLine);
                lastNonAtLine = null;
              }
              result.push(st);
            } else {
              outdent = true;
              lastNonAtLine = st;
            }
          }
        });
        return result.map((line) => `${indent3}${line}
`).join("");
      }
      captureString(limit, fn = this.captureString) {
        if (typeof limit === "function") {
          fn = limit;
          limit = Infinity;
        }
        const { stackTraceLimit } = Error;
        if (limit) {
          Error.stackTraceLimit = limit;
        }
        const obj = {};
        Error.captureStackTrace(obj, fn);
        const { stack } = obj;
        Error.stackTraceLimit = stackTraceLimit;
        return this.clean(stack);
      }
      capture(limit, fn = this.capture) {
        if (typeof limit === "function") {
          fn = limit;
          limit = Infinity;
        }
        const { prepareStackTrace, stackTraceLimit } = Error;
        Error.prepareStackTrace = (obj2, site) => {
          if (this._wrapCallSite) {
            return site.map(this._wrapCallSite);
          }
          return site;
        };
        if (limit) {
          Error.stackTraceLimit = limit;
        }
        const obj = {};
        Error.captureStackTrace(obj, fn);
        const { stack } = obj;
        Object.assign(Error, { prepareStackTrace, stackTraceLimit });
        return stack;
      }
      at(fn = this.at) {
        const [site] = this.capture(1, fn);
        if (!site) {
          return {};
        }
        const res = {
          line: site.getLineNumber(),
          column: site.getColumnNumber()
        };
        setFile(res, site.getFileName(), this._cwd);
        if (site.isConstructor()) {
          Object.defineProperty(res, "constructor", {
            value: true,
            configurable: true
          });
        }
        if (site.isEval()) {
          res.evalOrigin = site.getEvalOrigin();
        }
        if (site.isNative()) {
          res.native = true;
        }
        let typename;
        try {
          typename = site.getTypeName();
        } catch (_) {
        }
        if (typename && typename !== "Object" && typename !== "[object Object]") {
          res.type = typename;
        }
        const fname = site.getFunctionName();
        if (fname) {
          res.function = fname;
        }
        const meth = site.getMethodName();
        if (meth && fname !== meth) {
          res.method = meth;
        }
        return res;
      }
      parseLine(line) {
        const match = line && line.match(re);
        if (!match) {
          return null;
        }
        const ctor = match[1] === "new";
        let fname = match[2];
        const evalOrigin = match[3];
        const evalFile = match[4];
        const evalLine = Number(match[5]);
        const evalCol = Number(match[6]);
        let file = match[7];
        const lnum = match[8];
        const col = match[9];
        const native = match[10] === "native";
        const closeParen = match[11] === ")";
        let method;
        const res = {};
        if (lnum) {
          res.line = Number(lnum);
        }
        if (col) {
          res.column = Number(col);
        }
        if (closeParen && file) {
          let closes = 0;
          for (let i = file.length - 1; i > 0; i--) {
            if (file.charAt(i) === ")") {
              closes++;
            } else if (file.charAt(i) === "(" && file.charAt(i - 1) === " ") {
              closes--;
              if (closes === -1 && file.charAt(i - 1) === " ") {
                const before = file.slice(0, i - 1);
                const after = file.slice(i + 1);
                file = after;
                fname += ` (${before}`;
                break;
              }
            }
          }
        }
        if (fname) {
          const methodMatch = fname.match(methodRe);
          if (methodMatch) {
            fname = methodMatch[1];
            method = methodMatch[2];
          }
        }
        setFile(res, file, this._cwd);
        if (ctor) {
          Object.defineProperty(res, "constructor", {
            value: true,
            configurable: true
          });
        }
        if (evalOrigin) {
          res.evalOrigin = evalOrigin;
          res.evalLine = evalLine;
          res.evalColumn = evalCol;
          res.evalFile = evalFile && evalFile.replace(/\\/g, "/");
        }
        if (native) {
          res.native = true;
        }
        if (fname) {
          res.function = fname;
        }
        if (method && fname !== method) {
          res.method = method;
        }
        return res;
      }
    };
    function setFile(result, filename, cwd2) {
      if (filename) {
        filename = filename.replace(/\\/g, "/");
        if (filename.startsWith(`${cwd2}/`)) {
          filename = filename.slice(cwd2.length + 1);
        }
        result.file = filename;
      }
    }
    function ignoredPackagesRegExp(ignoredPackages) {
      if (ignoredPackages.length === 0) {
        return [];
      }
      const packages = ignoredPackages.map((mod) => escapeStringRegexp(mod));
      return new RegExp(`[/\\\\]node_modules[/\\\\](?:${packages.join("|")})[/\\\\][^:]+:\\d+:\\d+`);
    }
    var re = new RegExp(
      "^(?:\\s*at )?(?:(new) )?(?:(.*?) \\()?(?:eval at ([^ ]+) \\((.+?):(\\d+):(\\d+)\\), )?(?:(.+?):(\\d+):(\\d+)|(native))(\\)?)$"
    );
    var methodRe = /^(.*?) \[as (.*?)\]$/;
    module2.exports = StackUtils;
  }
});

// node_modules/jest-message-util/build/index.js
var require_build7 = __commonJS({
  "node_modules/jest-message-util/build/index.js"(exports2, module2) {
    (() => {
      "use strict";
      var __webpack_exports__ = {};
      (() => {
        var exports3 = __webpack_exports__;
        Object.defineProperty(exports3, "__esModule", {
          value: true
        });
        exports3.formatResultsErrors = exports3.formatPath = exports3.formatExecError = void 0;
        exports3.formatStackTrace = formatStackTrace2;
        exports3.getStackTraceLines = getStackTraceLines2;
        exports3.getTopFrame = getTopFrame2;
        exports3.separateMessageFromStack = exports3.indentAllLines = void 0;
        var path4 = _interopRequireWildcard(require("path"));
        var _url = require("url");
        var _util = require("util");
        var _codeFrame = require_lib2();
        var _chalk = _interopRequireDefault(require_source());
        var fs3 = _interopRequireWildcard(require_graceful_fs());
        var _micromatch = _interopRequireDefault(require_micromatch());
        var _slash = _interopRequireDefault(require_slash());
        var _stackUtils = _interopRequireDefault(require_stack_utils());
        var _prettyFormat = require_build3();
        function _interopRequireDefault(e) {
          return e && e.__esModule ? e : { default: e };
        }
        function _interopRequireWildcard(e, t) {
          if ("function" == typeof WeakMap) var r = /* @__PURE__ */ new WeakMap(), n = /* @__PURE__ */ new WeakMap();
          return (_interopRequireWildcard = function(e2, t2) {
            if (!t2 && e2 && e2.__esModule) return e2;
            var o, i, f = { __proto__: null, default: e2 };
            if (null === e2 || "object" != typeof e2 && "function" != typeof e2) return f;
            if (o = t2 ? n : r) {
              if (o.has(e2)) return o.get(e2);
              o.set(e2, f);
            }
            for (const t3 in e2) "default" !== t3 && {}.hasOwnProperty.call(e2, t3) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e2, t3)) && (i.get || i.set) ? o(f, t3, i) : f[t3] = e2[t3]);
            return f;
          })(e, t);
        }
        var Symbol2 = globalThis["jest-symbol-do-not-touch"] || globalThis.Symbol;
        var Symbol2 = globalThis["jest-symbol-do-not-touch"] || globalThis.Symbol;
        var jestReadFile = globalThis[Symbol2.for("jest-native-read-file")] || fs3.readFileSync;
        const stackUtils = new _stackUtils.default({
          cwd: "something which does not exist"
        });
        let nodeInternals = [];
        try {
          nodeInternals = _stackUtils.default.nodeInternals();
        } catch {
        }
        const PATH_NODE_MODULES = `${path4.sep}node_modules${path4.sep}`;
        const PATH_JEST_PACKAGES = `${path4.sep}jest${path4.sep}packages${path4.sep}`;
        const JASMINE_IGNORE = /^\s+at(?:(?:.jasmine-)|\s+jasmine\.buildExpectationResult)/;
        const JEST_INTERNALS_IGNORE = /^\s+at.*?jest(-.*?)?(\/|\\)(build|node_modules|packages)(\/|\\)/;
        const ANONYMOUS_FN_IGNORE = /^\s+at <anonymous>.*$/;
        const ANONYMOUS_PROMISE_IGNORE = /^\s+at (new )?Promise \(<anonymous>\).*$/;
        const ANONYMOUS_GENERATOR_IGNORE = /^\s+at Generator.next \(<anonymous>\).*$/;
        const NATIVE_NEXT_IGNORE = /^\s+at next \(native\).*$/;
        const TITLE_INDENT = "  ";
        const MESSAGE_INDENT = "    ";
        const STACK_INDENT = "      ";
        const ANCESTRY_SEPARATOR = " \u203A ";
        const TITLE_BULLET = _chalk.default.bold("\u25CF ");
        const STACK_TRACE_COLOR = _chalk.default.dim;
        const STACK_PATH_REGEXP = /\s*at.*\(?(:\d*:\d*|native)\)?/;
        const EXEC_ERROR_MESSAGE = "Test suite failed to run";
        const NOT_EMPTY_LINE_REGEXP = /^(?!$)/gm;
        const indentAllLines2 = (lines) => lines.replaceAll(NOT_EMPTY_LINE_REGEXP, MESSAGE_INDENT);
        exports3.indentAllLines = indentAllLines2;
        const trim = (string) => (string || "").trim();
        const trimPaths = (string) => STACK_PATH_REGEXP.test(string) ? trim(string) : string;
        const getRenderedCallsite = (fileContent, line, column) => {
          let renderedCallsite = (0, _codeFrame.codeFrameColumns)(fileContent, {
            start: {
              column,
              line
            }
          }, {
            highlightCode: true
          });
          renderedCallsite = indentAllLines2(renderedCallsite);
          renderedCallsite = `
${renderedCallsite}
`;
          return renderedCallsite;
        };
        const blankStringRegexp = /^\s*$/;
        function checkForCommonEnvironmentErrors(error) {
          if (error.includes("ReferenceError: document is not defined") || error.includes("ReferenceError: window is not defined") || error.includes("ReferenceError: navigator is not defined")) {
            return warnAboutWrongTestEnvironment(error, "jsdom");
          } else if (error.includes(".unref is not a function")) {
            return warnAboutWrongTestEnvironment(error, "node");
          }
          return error;
        }
        function warnAboutWrongTestEnvironment(error, env) {
          return _chalk.default.bold.red(`The error below may be caused by using the wrong test environment, see ${_chalk.default.dim.underline("https://jestjs.io/docs/configuration#testenvironment-string")}.
Consider using the "${env}" test environment.

`) + error;
        }
        const formatExecError2 = (error, config, options, testPath, reuseMessage, noTitle) => {
          if (!error || typeof error === "number") {
            error = new Error(`Expected an Error, but "${String(error)}" was thrown`);
            error.stack = "";
          }
          let message, stack;
          let cause = "";
          const subErrors = [];
          if (typeof error === "string" || !error) {
            error ||= "EMPTY ERROR";
            message = "";
            stack = error;
          } else {
            message = error.message;
            stack = typeof error.stack === "string" ? error.stack : `thrown: ${(0, _prettyFormat.format)(error, {
              maxDepth: 3
            })}`;
            if ("cause" in error) {
              const prefix = "\n\nCause:\n";
              if (typeof error.cause === "string" || typeof error.cause === "number") {
                cause += `${prefix}${error.cause}`;
              } else if (_util.types.isNativeError(error.cause) || error.cause instanceof Error) {
                const formatted = formatExecError2(error.cause, config, options, testPath, reuseMessage, true);
                cause += `${prefix}${formatted}`;
              }
            }
            if ("errors" in error && Array.isArray(error.errors)) {
              for (const subError of error.errors) {
                subErrors.push(formatExecError2(subError, config, options, testPath, reuseMessage, true));
              }
            }
          }
          if (cause !== "") {
            cause = indentAllLines2(cause);
          }
          const separated = separateMessageFromStack2(stack || "");
          stack = separated.stack;
          if (separated.message.includes(trim(message))) {
            message = separated.message;
          }
          message = checkForCommonEnvironmentErrors(message);
          message = indentAllLines2(message);
          stack = stack && !options.noStackTrace ? `
${formatStackTrace2(stack, config, options, testPath)}` : "";
          if (typeof stack !== "string" || blankStringRegexp.test(message) && blankStringRegexp.test(stack)) {
            message = `thrown: ${(0, _prettyFormat.format)(error, {
              maxDepth: 3
            })}`;
          }
          let messageToUse;
          if (reuseMessage || noTitle) {
            messageToUse = ` ${message.trim()}`;
          } else {
            messageToUse = `${EXEC_ERROR_MESSAGE}

${message}`;
          }
          const title = noTitle ? "" : `${TITLE_INDENT + TITLE_BULLET}`;
          const subErrorStr = subErrors.length > 0 ? indentAllLines2(`

Errors contained in AggregateError:
${subErrors.join("\n")}`) : "";
          return `${title + messageToUse + stack + cause + subErrorStr}
`;
        };
        exports3.formatExecError = formatExecError2;
        const removeInternalStackEntries = (lines, options) => {
          let pathCounter = 0;
          return lines.filter((line) => {
            if (!line) {
              return false;
            }
            if (ANONYMOUS_FN_IGNORE.test(line)) {
              return false;
            }
            if (ANONYMOUS_PROMISE_IGNORE.test(line)) {
              return false;
            }
            if (ANONYMOUS_GENERATOR_IGNORE.test(line)) {
              return false;
            }
            if (NATIVE_NEXT_IGNORE.test(line)) {
              return false;
            }
            if (nodeInternals.some((internal) => internal.test(line))) {
              return false;
            }
            if (!STACK_PATH_REGEXP.test(line)) {
              return true;
            }
            if (JASMINE_IGNORE.test(line)) {
              return false;
            }
            if (++pathCounter === 1) {
              return true;
            }
            if (options.noStackTrace) {
              return false;
            }
            if (JEST_INTERNALS_IGNORE.test(line)) {
              return false;
            }
            return true;
          });
        };
        const formatPath2 = (line, config, relativeTestPath = null) => {
          const match = line.match(/(^\s*at .*?\(?)([^()]+)(:\d+:\d+\)?.*$)/);
          if (!match) {
            return line;
          }
          let filePath = (0, _slash.default)(path4.relative(config.rootDir, match[2]));
          if (config.testMatch && config.testMatch.length > 0 && (0, _micromatch.default)([filePath], config.testMatch).length > 0 || filePath === relativeTestPath) {
            filePath = _chalk.default.reset.cyan(filePath);
          }
          return STACK_TRACE_COLOR(match[1]) + filePath + STACK_TRACE_COLOR(match[3]);
        };
        exports3.formatPath = formatPath2;
        function getStackTraceLines2(stack, options) {
          options = {
            noCodeFrame: false,
            noStackTrace: false,
            ...options
          };
          return removeInternalStackEntries(stack.split(/\n/), options);
        }
        function getTopFrame2(lines) {
          for (const line of lines) {
            if (line.includes(PATH_NODE_MODULES) || line.includes(PATH_JEST_PACKAGES)) {
              continue;
            }
            const parsedFrame = stackUtils.parseLine(line.trim());
            if (parsedFrame && parsedFrame.file) {
              if (parsedFrame.file.startsWith("file://")) {
                parsedFrame.file = (0, _slash.default)((0, _url.fileURLToPath)(parsedFrame.file));
              }
              return parsedFrame;
            }
          }
          return null;
        }
        function formatStackTrace2(stack, config, options, testPath) {
          const lines = getStackTraceLines2(stack, options);
          let renderedCallsite = "";
          const relativeTestPath = testPath ? (0, _slash.default)(path4.relative(config.rootDir, testPath)) : null;
          if (!options.noStackTrace && !options.noCodeFrame) {
            const topFrame = getTopFrame2(lines);
            if (topFrame) {
              const {
                column,
                file: filename,
                line
              } = topFrame;
              if (line && filename && path4.isAbsolute(filename)) {
                let fileContent;
                try {
                  fileContent = jestReadFile(filename, "utf8");
                  renderedCallsite = getRenderedCallsite(fileContent, line, column);
                } catch {
                }
              }
            }
          }
          const stacktrace = lines.length === 0 ? "" : `
${lines.map((line) => STACK_INDENT + formatPath2(trimPaths(line), config, relativeTestPath)).join("\n")}`;
          return renderedCallsite + stacktrace;
        }
        function isErrorOrStackWithCause(errorOrStack) {
          return typeof errorOrStack !== "string" && "cause" in errorOrStack && (typeof errorOrStack.cause === "string" || _util.types.isNativeError(errorOrStack.cause) || errorOrStack.cause instanceof Error);
        }
        function formatErrorStack(errorOrStack, config, options, testPath) {
          const sourceStack = typeof errorOrStack === "string" ? errorOrStack : errorOrStack.stack || "";
          let {
            message,
            stack
          } = separateMessageFromStack2(sourceStack);
          stack = options.noStackTrace ? "" : `${STACK_TRACE_COLOR(formatStackTrace2(stack, config, options, testPath))}
`;
          message = checkForCommonEnvironmentErrors(message);
          message = indentAllLines2(message);
          let cause = "";
          if (isErrorOrStackWithCause(errorOrStack)) {
            const nestedCause = formatErrorStack(errorOrStack.cause, config, options, testPath);
            cause = `
${MESSAGE_INDENT}Cause:
${nestedCause}`;
          }
          return `${message}
${stack}${cause}`;
        }
        function failureDetailsToErrorOrStack(failureDetails, content) {
          if (!failureDetails) {
            return content;
          }
          if (_util.types.isNativeError(failureDetails) || failureDetails instanceof Error) {
            return failureDetails;
          }
          if (typeof failureDetails === "object" && "error" in failureDetails && (_util.types.isNativeError(failureDetails.error) || failureDetails.error instanceof Error)) {
            return failureDetails.error;
          }
          return content;
        }
        const formatResultsErrors2 = (testResults, config, options, testPath) => {
          const failedResults = testResults.flatMap((result) => result.failureMessages.map((item, index) => ({
            content: item,
            failureDetails: result.failureDetails[index],
            result
          })));
          if (failedResults.length === 0) {
            return null;
          }
          return failedResults.map(({
            result,
            content,
            failureDetails
          }) => {
            const rootErrorOrStack = failureDetailsToErrorOrStack(failureDetails, content);
            const title = `${_chalk.default.bold.red(TITLE_INDENT + TITLE_BULLET + result.ancestorTitles.join(ANCESTRY_SEPARATOR) + (result.ancestorTitles.length > 0 ? ANCESTRY_SEPARATOR : "") + result.title)}
`;
            return `${title}
${formatErrorStack(rootErrorOrStack, config, options, testPath)}`;
          }).join("\n");
        };
        exports3.formatResultsErrors = formatResultsErrors2;
        const errorRegexp = /^Error:?\s*$/;
        const removeBlankErrorLine = (str) => str.split("\n").filter((line) => !errorRegexp.test(line)).join("\n").trimEnd();
        const separateMessageFromStack2 = (content) => {
          if (!content) {
            return {
              message: "",
              stack: ""
            };
          }
          const messageMatch = content.match(/^(?:Error: )?([\S\s]*?(?=\n\s*at\s.*:\d*:\d*)|\s*.*)([\S\s]*)$/);
          if (!messageMatch) {
            throw new Error("If you hit this error, the regex above is buggy.");
          }
          const message = removeBlankErrorLine(messageMatch[1]);
          const stack = removeBlankErrorLine(messageMatch[2]);
          return {
            message,
            stack
          };
        };
        exports3.separateMessageFromStack = separateMessageFromStack2;
      })();
      module2.exports = __webpack_exports__;
    })();
  }
});

// packages/playwright/src/matchers/expect.ts
var expect_exports = {};
__export(expect_exports, {
  expect: () => expect,
  expectConfig: () => expectConfig,
  mergeExpects: () => mergeExpects,
  setExpectConfig: () => setExpectConfig
});
module.exports = __toCommonJS(expect_exports);
var import_path3 = __toESM(require("path"));

// node_modules/@jest/expect-utils/build/index.mjs
var import_index = __toESM(require_build2(), 1);
var equals = import_index.default.equals;
var isA = import_index.default.isA;
var arrayBufferEquality = import_index.default.arrayBufferEquality;
var emptyObject = import_index.default.emptyObject;
var getObjectKeys = import_index.default.getObjectKeys;
var getObjectSubset = import_index.default.getObjectSubset;
var getPath = import_index.default.getPath;
var isError = import_index.default.isError;
var isOneline = import_index.default.isOneline;
var iterableEquality = import_index.default.iterableEquality;
var partition = import_index.default.partition;
var pathAsArray = import_index.default.pathAsArray;
var sparseArrayEquality = import_index.default.sparseArrayEquality;
var subsetEquality = import_index.default.subsetEquality;
var typeEquality = import_index.default.typeEquality;

// node_modules/jest-matcher-utils/build/index.mjs
var build_exports = {};
__export(build_exports, {
  BOLD_WEIGHT: () => BOLD_WEIGHT,
  DIM_COLOR: () => DIM_COLOR,
  EXPECTED_COLOR: () => EXPECTED_COLOR,
  INVERTED_COLOR: () => INVERTED_COLOR,
  RECEIVED_COLOR: () => RECEIVED_COLOR,
  SERIALIZABLE_PROPERTIES: () => SERIALIZABLE_PROPERTIES,
  SUGGEST_TO_CONTAIN_EQUAL: () => SUGGEST_TO_CONTAIN_EQUAL,
  diff: () => diff,
  ensureActualIsNumber: () => ensureActualIsNumber,
  ensureExpectedIsNonNegativeInteger: () => ensureExpectedIsNonNegativeInteger,
  ensureExpectedIsNumber: () => ensureExpectedIsNumber,
  ensureNoExpected: () => ensureNoExpected,
  ensureNumbers: () => ensureNumbers,
  getLabelPrinter: () => getLabelPrinter,
  highlightTrailingWhitespace: () => highlightTrailingWhitespace,
  matcherErrorMessage: () => matcherErrorMessage,
  matcherHint: () => matcherHint,
  pluralize: () => pluralize,
  printDiffOrStringify: () => printDiffOrStringify,
  printExpected: () => printExpected,
  printReceived: () => printReceived,
  printWithType: () => printWithType,
  replaceMatchedToAsymmetricMatcher: () => replaceMatchedToAsymmetricMatcher,
  stringify: () => stringify
});
var import_index2 = __toESM(require_build6(), 1);
var BOLD_WEIGHT = import_index2.default.BOLD_WEIGHT;
var DIM_COLOR = import_index2.default.DIM_COLOR;
var EXPECTED_COLOR = import_index2.default.EXPECTED_COLOR;
var INVERTED_COLOR = import_index2.default.INVERTED_COLOR;
var RECEIVED_COLOR = import_index2.default.RECEIVED_COLOR;
var SERIALIZABLE_PROPERTIES = import_index2.default.SERIALIZABLE_PROPERTIES;
var SUGGEST_TO_CONTAIN_EQUAL = import_index2.default.SUGGEST_TO_CONTAIN_EQUAL;
var diff = import_index2.default.diff;
var ensureActualIsNumber = import_index2.default.ensureActualIsNumber;
var ensureExpectedIsNonNegativeInteger = import_index2.default.ensureExpectedIsNonNegativeInteger;
var ensureExpectedIsNumber = import_index2.default.ensureExpectedIsNumber;
var ensureNoExpected = import_index2.default.ensureNoExpected;
var ensureNumbers = import_index2.default.ensureNumbers;
var getLabelPrinter = import_index2.default.getLabelPrinter;
var highlightTrailingWhitespace = import_index2.default.highlightTrailingWhitespace;
var matcherErrorMessage = import_index2.default.matcherErrorMessage;
var matcherHint = import_index2.default.matcherHint;
var pluralize = import_index2.default.pluralize;
var printDiffOrStringify = import_index2.default.printDiffOrStringify;
var printExpected = import_index2.default.printExpected;
var printReceived = import_index2.default.printReceived;
var printWithType = import_index2.default.printWithType;
var replaceMatchedToAsymmetricMatcher = import_index2.default.replaceMatchedToAsymmetricMatcher;
var stringify = import_index2.default.stringify;

// node_modules/jest-message-util/build/index.mjs
var import_index3 = __toESM(require_build7(), 1);
var formatExecError = import_index3.default.formatExecError;
var formatPath = import_index3.default.formatPath;
var formatResultsErrors = import_index3.default.formatResultsErrors;
var formatStackTrace = import_index3.default.formatStackTrace;
var getStackTraceLines = import_index3.default.getStackTraceLines;
var getTopFrame = import_index3.default.getTopFrame;
var indentAllLines = import_index3.default.indentAllLines;
var separateMessageFromStack = import_index3.default.separateMessageFromStack;

// packages/playwright/src/matchers/expectLibrary.ts
function getType(value) {
  if (value === void 0)
    return "undefined";
  if (value === null)
    return "null";
  if (Array.isArray(value))
    return "array";
  if (typeof value === "boolean")
    return "boolean";
  if (typeof value === "function")
    return "function";
  if (typeof value === "number")
    return "number";
  if (typeof value === "string")
    return "string";
  if (typeof value === "bigint")
    return "bigint";
  if (typeof value === "object") {
    if (value.constructor === RegExp)
      return "regexp";
    if (value.constructor === Map)
      return "map";
    if (value.constructor === Set)
      return "set";
    if (value.constructor === Date)
      return "date";
    return "object";
  }
  if (typeof value === "symbol")
    return "symbol";
  throw new Error(`value of unknown type: ${value}`);
}
var isPrimitive = (value) => Object(value) !== value;
function isPromise(candidate) {
  return candidate !== null && candidate !== void 0 && (typeof candidate === "object" || typeof candidate === "function") && typeof candidate.then === "function";
}
var functionToString = Function.prototype.toString;
function fnNameFor(func) {
  if (func.name)
    return func.name;
  const matches = functionToString.call(func).match(/^(?:async)?\s*function\s*\*?\s*([\w$]+)\s*\(/);
  return matches ? matches[1] : "<anonymous>";
}
var utils = Object.freeze({
  ...build_exports,
  iterableEquality,
  subsetEquality
});
function hasProperty(obj, property) {
  if (!obj)
    return false;
  if (Object.prototype.hasOwnProperty.call(obj, property))
    return true;
  return hasProperty(Object.getPrototypeOf(obj), property);
}
var AsymmetricMatcher = class {
  constructor(sample, inverse = false) {
    this.sample = sample;
    this.inverse = inverse;
    this.$$typeof = Symbol.for("jest.asymmetricMatcher");
  }
  getMatcherContext() {
    return {
      customTesters: [],
      equals,
      isNot: this.inverse,
      utils
    };
  }
};
function buildCustomAsymmetricMatcher(matcherName, matcher) {
  class CustomMatcher extends AsymmetricMatcher {
    constructor(inverse2 = false, ...sample) {
      super(sample, inverse2);
    }
    asymmetricMatch(other) {
      const { pass } = matcher.call(
        this.getMatcherContext(),
        other,
        ...this.sample
      );
      return this.inverse ? !pass : pass;
    }
    toString() {
      return `${this.inverse ? "not." : ""}${matcherName}`;
    }
    getExpectedType() {
      return "any";
    }
    toAsymmetricMatcher() {
      return `${this.toString()}<${this.sample.map(String).join(", ")}>`;
    }
  }
  const positive = (...sample) => new CustomMatcher(false, ...sample);
  const inverse = (...sample) => new CustomMatcher(true, ...sample);
  return { positive, inverse };
}
var Any = class extends AsymmetricMatcher {
  constructor(sample) {
    if (sample === void 0) {
      throw new TypeError(
        "any() expects to be passed a constructor function. Please pass one or use anything() to match any object."
      );
    }
    super(sample);
  }
  asymmetricMatch(other) {
    if (this.sample === String)
      return typeof other === "string" || other instanceof String;
    if (this.sample === Number)
      return typeof other === "number" || other instanceof Number;
    if (this.sample === Function)
      return typeof other === "function" || other instanceof Function;
    if (this.sample === Boolean)
      return typeof other === "boolean" || other instanceof Boolean;
    if (this.sample === BigInt)
      return typeof other === "bigint" || other instanceof BigInt;
    if (this.sample === Symbol)
      return typeof other === "symbol" || other instanceof Symbol;
    if (this.sample === Object)
      return typeof other === "object";
    if (this.sample === Array)
      return Array.isArray(other);
    return other instanceof this.sample;
  }
  toString() {
    return "Any";
  }
  getExpectedType() {
    if (this.sample === String)
      return "string";
    if (this.sample === Number)
      return "number";
    if (this.sample === Function)
      return "function";
    if (this.sample === Object)
      return "object";
    if (this.sample === Boolean)
      return "boolean";
    if (this.sample === Array)
      return "array";
    return fnNameFor(this.sample);
  }
  toAsymmetricMatcher() {
    return `Any<${fnNameFor(this.sample)}>`;
  }
};
var Anything = class extends AsymmetricMatcher {
  asymmetricMatch(other) {
    return other !== null && other !== void 0;
  }
  toString() {
    return "Anything";
  }
  toAsymmetricMatcher() {
    return "Anything";
  }
};
var ArrayContaining = class extends AsymmetricMatcher {
  constructor(sample, inverse = false) {
    super(sample, inverse);
  }
  asymmetricMatch(other) {
    if (!Array.isArray(this.sample)) {
      throw new TypeError(
        `You must provide an array to ${this.toString()}, not '${typeof this.sample}'.`
      );
    }
    const matcherContext = this.getMatcherContext();
    const result = this.sample.length === 0 || Array.isArray(other) && this.sample.every(
      (item) => other.some(
        (another) => equals(item, another, matcherContext.customTesters)
      )
    );
    return this.inverse ? !result : result;
  }
  toString() {
    return `Array${this.inverse ? "Not" : ""}Containing`;
  }
  getExpectedType() {
    return "array";
  }
};
var ArrayOf = class extends AsymmetricMatcher {
  asymmetricMatch(other) {
    const matcherContext = this.getMatcherContext();
    const result = Array.isArray(other) && other.every(
      (item) => equals(this.sample, item, matcherContext.customTesters)
    );
    return this.inverse ? !result : result;
  }
  toString() {
    return `${this.inverse ? "Not" : ""}ArrayOf`;
  }
  getExpectedType() {
    return "array";
  }
};
var ObjectContaining = class extends AsymmetricMatcher {
  constructor(sample, inverse = false) {
    super(sample, inverse);
  }
  asymmetricMatch(other) {
    if (typeof this.sample !== "object") {
      throw new TypeError(
        `You must provide an object to ${this.toString()}, not '${typeof this.sample}'.`
      );
    }
    if (typeof other !== "object" || Array.isArray(other))
      return false;
    let result = true;
    const matcherContext = this.getMatcherContext();
    const objectKeys = getObjectKeys(this.sample);
    for (const key of objectKeys) {
      if (!hasProperty(other, key) || !equals(this.sample[key], other[key], matcherContext.customTesters)) {
        result = false;
        break;
      }
    }
    return this.inverse ? !result : result;
  }
  toString() {
    return `Object${this.inverse ? "Not" : ""}Containing`;
  }
  getExpectedType() {
    return "object";
  }
};
var StringContaining = class extends AsymmetricMatcher {
  constructor(sample, inverse = false) {
    if (!isA("String", sample))
      throw new Error("Expected is not a string");
    super(sample, inverse);
  }
  asymmetricMatch(other) {
    const result = isA("String", other) && other.includes(this.sample);
    return this.inverse ? !result : result;
  }
  toString() {
    return `String${this.inverse ? "Not" : ""}Containing`;
  }
  getExpectedType() {
    return "string";
  }
};
var StringMatching = class extends AsymmetricMatcher {
  constructor(sample, inverse = false) {
    if (!isA("String", sample) && !isA("RegExp", sample))
      throw new Error("Expected is not a String or a RegExp");
    super(new RegExp(sample), inverse);
  }
  asymmetricMatch(other) {
    const result = isA("String", other) && this.sample.test(other);
    return this.inverse ? !result : result;
  }
  toString() {
    return `String${this.inverse ? "Not" : ""}Matching`;
  }
  getExpectedType() {
    return "string";
  }
};
var CloseTo = class extends AsymmetricMatcher {
  constructor(sample, precision = 2, inverse = false) {
    if (!isA("Number", sample))
      throw new Error("Expected is not a Number");
    if (!isA("Number", precision))
      throw new Error("Precision is not a Number");
    super(sample);
    this.inverse = inverse;
    this.precision = precision;
  }
  asymmetricMatch(other) {
    if (!isA("Number", other))
      return false;
    let result = false;
    if (other === Number.POSITIVE_INFINITY && this.sample === Number.POSITIVE_INFINITY)
      result = true;
    else if (other === Number.NEGATIVE_INFINITY && this.sample === Number.NEGATIVE_INFINITY)
      result = true;
    else
      result = Math.abs(this.sample - other) < Math.pow(10, -this.precision) / 2;
    return this.inverse ? !result : result;
  }
  toString() {
    return `Number${this.inverse ? "Not" : ""}CloseTo`;
  }
  getExpectedType() {
    return "number";
  }
  toAsymmetricMatcher() {
    return [
      this.toString(),
      this.sample,
      `(${this.precision} ${this.precision === 1 ? "digit" : "digits"})`
    ].join(" ");
  }
};
var any = (expectedObject) => new Any(expectedObject);
var anything = () => new Anything();
var arrayContaining = (sample) => new ArrayContaining(sample);
var arrayNotContaining = (sample) => new ArrayContaining(sample, true);
var arrayOf = (sample) => new ArrayOf(sample);
var notArrayOf = (sample) => new ArrayOf(sample, true);
var objectContaining = (sample) => new ObjectContaining(sample);
var objectNotContaining = (sample) => new ObjectContaining(sample, true);
var stringContaining = (expected) => new StringContaining(expected);
var stringNotContaining = (expected) => new StringContaining(expected, true);
var stringMatching = (expected) => new StringMatching(expected);
var stringNotMatching = (expected) => new StringMatching(expected, true);
var closeTo = (expected, precision) => new CloseTo(expected, precision);
var notCloseTo = (expected, precision) => new CloseTo(expected, precision, true);
var printSubstring = (val) => val.replace(/"|\\/g, "\\$&");
var printReceivedStringContainExpectedSubstring = (received, start, length) => RECEIVED_COLOR(
  `"${printSubstring(received.slice(0, start))}${INVERTED_COLOR(
    printSubstring(received.slice(start, start + length))
  )}${printSubstring(received.slice(start + length))}"`
);
var printReceivedStringContainExpectedResult = (received, result) => result === null ? printReceived(received) : printReceivedStringContainExpectedSubstring(received, result.index, result[0].length);
var printReceivedArrayContainExpectedItem = (received, index) => RECEIVED_COLOR(
  `[${received.map((item, i) => {
    const stringified = stringify(item);
    return i === index ? INVERTED_COLOR(stringified) : stringified;
  }).join(", ")}]`
);
var printCloseTo = (receivedDiff, expectedDiff, precision, isNot) => {
  const receivedDiffString = stringify(receivedDiff);
  const expectedDiffString = receivedDiffString.includes("e") ? expectedDiff.toExponential(0) : 0 <= precision && precision < 20 ? expectedDiff.toFixed(precision + 1) : stringify(expectedDiff);
  return `Expected precision:  ${isNot ? "    " : ""}  ${stringify(precision)}
Expected difference: ${isNot ? "not " : ""}< ${EXPECTED_COLOR(expectedDiffString)}
Received difference: ${isNot ? "    " : ""}  ${RECEIVED_COLOR(receivedDiffString)}`;
};
var printConstructorName = (label, constructor, isNot, isExpected) => typeof constructor.name === "string" ? constructor.name.length === 0 ? `${label} name is an empty string` : `${label}: ${isNot ? isExpected ? "not " : "    " : ""}${isExpected ? EXPECTED_COLOR(constructor.name) : RECEIVED_COLOR(constructor.name)}` : `${label} name is not a string`;
var printExpectedConstructorName = (label, expected) => `${printConstructorName(label, expected, false, true)}
`;
var printExpectedConstructorNameNot = (label, expected) => `${printConstructorName(label, expected, true, true)}
`;
var printReceivedConstructorName = (label, received) => `${printConstructorName(label, received, false, false)}
`;
var printReceivedConstructorNameNot = (label, received, expected) => typeof expected.name === "string" && expected.name.length > 0 && typeof received.name === "string" && received.name.length > 0 ? `${printConstructorName(label, received, true, false)} ${Object.getPrototypeOf(received) === expected ? "extends" : "extends \u2026 extends"} ${EXPECTED_COLOR(expected.name)}
` : `${printConstructorName(label, received, false, false)}
`;
var EXPECTED_LABEL = "Expected";
var RECEIVED_LABEL = "Received";
var EXPECTED_VALUE_LABEL = "Expected value";
var RECEIVED_VALUE_LABEL = "Received value";
var toStrictEqualTesters = [
  iterableEquality,
  typeEquality,
  sparseArrayEquality,
  arrayBufferEquality
];
var matchers = {
  toBe(received, expected) {
    const matcherName = "toBe";
    const options = {
      comment: "Object.is equality",
      isNot: this.isNot,
      promise: this.promise
    };
    const pass = Object.is(received, expected);
    const message = pass ? () => matcherHint(matcherName, void 0, void 0, options) + `

Expected: not ${printExpected(expected)}` : () => {
      const expectedType = getType(expected);
      let deepEqualityName = null;
      if (expectedType !== "map" && expectedType !== "set") {
        if (equals(received, expected, [...this.customTesters, ...toStrictEqualTesters], true))
          deepEqualityName = "toStrictEqual";
        else if (equals(received, expected, [...this.customTesters, iterableEquality]))
          deepEqualityName = "toEqual";
      }
      return matcherHint(matcherName, void 0, void 0, options) + "\n\n" + (deepEqualityName === null ? "" : `${DIM_COLOR(
        `If it should pass with deep equality, replace "${matcherName}" with "${deepEqualityName}"`
      )}

`) + printDiffOrStringify(expected, received, EXPECTED_LABEL, RECEIVED_LABEL, false);
    };
    return { actual: received, expected, message, name: matcherName, pass };
  },
  toBeCloseTo(received, expected, precision = 2) {
    const matcherName = "toBeCloseTo";
    const secondArgument = arguments.length === 3 ? "precision" : void 0;
    const isNot = this.isNot;
    const options = {
      isNot,
      promise: this.promise,
      secondArgument,
      secondArgumentColor: (arg) => arg
    };
    if (typeof expected !== "number") {
      throw new TypeError(
        matcherErrorMessage(
          matcherHint(matcherName, void 0, void 0, options),
          `${EXPECTED_COLOR("expected")} value must be a number`,
          printWithType("Expected", expected, printExpected)
        )
      );
    }
    if (typeof received !== "number") {
      throw new TypeError(
        matcherErrorMessage(
          matcherHint(matcherName, void 0, void 0, options),
          `${RECEIVED_COLOR("received")} value must be a number`,
          printWithType("Received", received, printReceived)
        )
      );
    }
    let pass = false;
    let expectedDiff = 0;
    let receivedDiff = 0;
    if (received === Number.POSITIVE_INFINITY && expected === Number.POSITIVE_INFINITY) {
      pass = true;
    } else if (received === Number.NEGATIVE_INFINITY && expected === Number.NEGATIVE_INFINITY) {
      pass = true;
    } else {
      expectedDiff = Math.pow(10, -precision) / 2;
      receivedDiff = Math.abs(expected - received);
      pass = receivedDiff < expectedDiff;
    }
    const message = pass ? () => matcherHint(matcherName, void 0, void 0, options) + `

Expected: not ${printExpected(expected)}
` + (receivedDiff === 0 ? "" : `Received:     ${printReceived(received)}

${printCloseTo(receivedDiff, expectedDiff, precision, isNot)}`) : () => matcherHint(matcherName, void 0, void 0, options) + `

Expected: ${printExpected(expected)}
Received: ${printReceived(received)}

` + printCloseTo(receivedDiff, expectedDiff, precision, isNot);
    return { message, pass };
  },
  toBeDefined(received, expected) {
    const matcherName = "toBeDefined";
    const options = { isNot: this.isNot, promise: this.promise };
    ensureNoExpected(expected, matcherName, options);
    const pass = received !== void 0;
    const message = () => matcherHint(matcherName, void 0, "", options) + `

Received: ${printReceived(received)}`;
    return { message, pass };
  },
  toBeFalsy(received, expected) {
    const matcherName = "toBeFalsy";
    const options = { isNot: this.isNot, promise: this.promise };
    ensureNoExpected(expected, matcherName, options);
    const pass = !received;
    const message = () => matcherHint(matcherName, void 0, "", options) + `

Received: ${printReceived(received)}`;
    return { message, pass };
  },
  toBeGreaterThan(received, expected) {
    const matcherName = "toBeGreaterThan";
    const isNot = this.isNot;
    const options = { isNot, promise: this.promise };
    ensureNumbers(received, expected, matcherName, options);
    const pass = received > expected;
    const message = () => matcherHint(matcherName, void 0, void 0, options) + `

Expected:${isNot ? " not" : ""} > ${printExpected(expected)}
Received:${isNot ? "    " : ""}   ${printReceived(received)}`;
    return { message, pass };
  },
  toBeGreaterThanOrEqual(received, expected) {
    const matcherName = "toBeGreaterThanOrEqual";
    const isNot = this.isNot;
    const options = { isNot, promise: this.promise };
    ensureNumbers(received, expected, matcherName, options);
    const pass = received >= expected;
    const message = () => matcherHint(matcherName, void 0, void 0, options) + `

Expected:${isNot ? " not" : ""} >= ${printExpected(expected)}
Received:${isNot ? "    " : ""}    ${printReceived(received)}`;
    return { message, pass };
  },
  toBeInstanceOf(received, expected) {
    const matcherName = "toBeInstanceOf";
    const options = { isNot: this.isNot, promise: this.promise };
    if (typeof expected !== "function") {
      throw new TypeError(
        matcherErrorMessage(
          matcherHint(matcherName, void 0, void 0, options),
          `${EXPECTED_COLOR("expected")} value must be a function`,
          printWithType("Expected", expected, printExpected)
        )
      );
    }
    const pass = received instanceof expected;
    const message = pass ? () => matcherHint(matcherName, void 0, void 0, options) + "\n\n" + printExpectedConstructorNameNot("Expected constructor", expected) + (typeof received.constructor === "function" && received.constructor !== expected ? printReceivedConstructorNameNot("Received constructor", received.constructor, expected) : "") : () => matcherHint(matcherName, void 0, void 0, options) + "\n\n" + printExpectedConstructorName("Expected constructor", expected) + (isPrimitive(received) || Object.getPrototypeOf(received) === null ? `
Received value has no prototype
Received value: ${printReceived(received)}` : typeof received.constructor === "function" ? printReceivedConstructorName("Received constructor", received.constructor) : `
Received value: ${printReceived(received)}`);
    return { message, pass };
  },
  toBeLessThan(received, expected) {
    const matcherName = "toBeLessThan";
    const isNot = this.isNot;
    const options = { isNot, promise: this.promise };
    ensureNumbers(received, expected, matcherName, options);
    const pass = received < expected;
    const message = () => matcherHint(matcherName, void 0, void 0, options) + `

Expected:${isNot ? " not" : ""} < ${printExpected(expected)}
Received:${isNot ? "    " : ""}   ${printReceived(received)}`;
    return { message, pass };
  },
  toBeLessThanOrEqual(received, expected) {
    const matcherName = "toBeLessThanOrEqual";
    const isNot = this.isNot;
    const options = { isNot, promise: this.promise };
    ensureNumbers(received, expected, matcherName, options);
    const pass = received <= expected;
    const message = () => matcherHint(matcherName, void 0, void 0, options) + `

Expected:${isNot ? " not" : ""} <= ${printExpected(expected)}
Received:${isNot ? "    " : ""}    ${printReceived(received)}`;
    return { message, pass };
  },
  toBeNaN(received, expected) {
    const matcherName = "toBeNaN";
    const options = { isNot: this.isNot, promise: this.promise };
    ensureNoExpected(expected, matcherName, options);
    const pass = Number.isNaN(received);
    const message = () => matcherHint(matcherName, void 0, "", options) + `

Received: ${printReceived(received)}`;
    return { message, pass };
  },
  toBeNull(received, expected) {
    const matcherName = "toBeNull";
    const options = { isNot: this.isNot, promise: this.promise };
    ensureNoExpected(expected, matcherName, options);
    const pass = received === null;
    const message = () => matcherHint(matcherName, void 0, "", options) + `

Received: ${printReceived(received)}`;
    return { message, pass };
  },
  toBeTruthy(received, expected) {
    const matcherName = "toBeTruthy";
    const options = { isNot: this.isNot, promise: this.promise };
    ensureNoExpected(expected, matcherName, options);
    const pass = !!received;
    const message = () => matcherHint(matcherName, void 0, "", options) + `

Received: ${printReceived(received)}`;
    return { message, pass };
  },
  toBeUndefined(received, expected) {
    const matcherName = "toBeUndefined";
    const options = { isNot: this.isNot, promise: this.promise };
    ensureNoExpected(expected, matcherName, options);
    const pass = received === void 0;
    const message = () => matcherHint(matcherName, void 0, "", options) + `

Received: ${printReceived(received)}`;
    return { message, pass };
  },
  toContain(received, expected) {
    const matcherName = "toContain";
    const isNot = this.isNot;
    const options = { comment: "indexOf", isNot, promise: this.promise };
    if (received === null || received === void 0) {
      throw new Error(
        matcherErrorMessage(
          matcherHint(matcherName, void 0, void 0, options),
          `${RECEIVED_COLOR("received")} value must not be null nor undefined`,
          printWithType("Received", received, printReceived)
        )
      );
    }
    if (typeof received === "string") {
      const wrongTypeErrorMessage = `${EXPECTED_COLOR("expected")} value must be a string if ${RECEIVED_COLOR("received")} value is a string`;
      if (typeof expected !== "string") {
        throw new TypeError(
          matcherErrorMessage(
            matcherHint(matcherName, received, String(expected), options),
            wrongTypeErrorMessage,
            printWithType("Expected", expected, printExpected) + "\n" + printWithType("Received", received, printReceived)
          )
        );
      }
      const index2 = received.indexOf(String(expected));
      const pass2 = index2 !== -1;
      const message2 = () => {
        const labelExpected = `Expected ${typeof expected === "string" ? "substring" : "value"}`;
        const labelReceived = "Received string";
        const printLabel = getLabelPrinter(labelExpected, labelReceived);
        return matcherHint(matcherName, void 0, void 0, options) + `

${printLabel(labelExpected)}${isNot ? "not " : ""}${printExpected(expected)}
${printLabel(labelReceived)}${isNot ? "    " : ""}${isNot ? printReceivedStringContainExpectedSubstring(received, index2, String(expected).length) : printReceived(received)}`;
      };
      return { message: message2, pass: pass2 };
    }
    const indexable = [...received];
    const index = indexable.indexOf(expected);
    const pass = index !== -1;
    const message = () => {
      const labelExpected = "Expected value";
      const labelReceived = `Received ${getType(received)}`;
      const printLabel = getLabelPrinter(labelExpected, labelReceived);
      return matcherHint(matcherName, void 0, void 0, options) + `

${printLabel(labelExpected)}${isNot ? "not " : ""}${printExpected(expected)}
${printLabel(labelReceived)}${isNot ? "    " : ""}${isNot && Array.isArray(received) ? printReceivedArrayContainExpectedItem(received, index) : printReceived(received)}` + (!isNot && indexable.some(
        (item) => equals(item, expected, [...this.customTesters, iterableEquality])
      ) ? `

${SUGGEST_TO_CONTAIN_EQUAL}` : "");
    };
    return { message, pass };
  },
  toContainEqual(received, expected) {
    const matcherName = "toContainEqual";
    const isNot = this.isNot;
    const options = { comment: "deep equality", isNot, promise: this.promise };
    if (received === null || received === void 0) {
      throw new Error(
        matcherErrorMessage(
          matcherHint(matcherName, void 0, void 0, options),
          `${RECEIVED_COLOR("received")} value must not be null nor undefined`,
          printWithType("Received", received, printReceived)
        )
      );
    }
    const index = [...received].findIndex(
      (item) => equals(item, expected, [...this.customTesters, iterableEquality])
    );
    const pass = index !== -1;
    const message = () => {
      const labelExpected = "Expected value";
      const labelReceived = `Received ${getType(received)}`;
      const printLabel = getLabelPrinter(labelExpected, labelReceived);
      return matcherHint(matcherName, void 0, void 0, options) + `

${printLabel(labelExpected)}${isNot ? "not " : ""}${printExpected(expected)}
${printLabel(labelReceived)}${isNot ? "    " : ""}${isNot && Array.isArray(received) ? printReceivedArrayContainExpectedItem(received, index) : printReceived(received)}`;
    };
    return { message, pass };
  },
  toEqual(received, expected) {
    const matcherName = "toEqual";
    const options = { comment: "deep equality", isNot: this.isNot, promise: this.promise };
    const pass = equals(received, expected, [...this.customTesters, iterableEquality]);
    const message = pass ? () => matcherHint(matcherName, void 0, void 0, options) + `

Expected: not ${printExpected(expected)}
` + (stringify(expected) === stringify(received) ? "" : `Received:     ${printReceived(received)}`) : () => matcherHint(matcherName, void 0, void 0, options) + "\n\n" + printDiffOrStringify(expected, received, EXPECTED_LABEL, RECEIVED_LABEL, false);
    return { actual: received, expected, message, name: matcherName, pass };
  },
  toHaveLength(received, expected) {
    const matcherName = "toHaveLength";
    const isNot = this.isNot;
    const options = { isNot, promise: this.promise };
    if (typeof received?.length !== "number") {
      throw new TypeError(
        matcherErrorMessage(
          matcherHint(matcherName, void 0, void 0, options),
          `${RECEIVED_COLOR("received")} value must have a length property whose value must be a number`,
          printWithType("Received", received, printReceived)
        )
      );
    }
    ensureExpectedIsNonNegativeInteger(expected, matcherName, options);
    const pass = received.length === expected;
    const message = () => {
      const labelExpected = "Expected length";
      const labelReceivedLength = "Received length";
      const labelReceivedValue = `Received ${getType(received)}`;
      const printLabel = getLabelPrinter(labelExpected, labelReceivedLength, labelReceivedValue);
      return matcherHint(matcherName, void 0, void 0, options) + `

${printLabel(labelExpected)}${isNot ? "not " : ""}${printExpected(expected)}
` + (isNot ? "" : `${printLabel(labelReceivedLength)}${printReceived(received.length)}
`) + `${printLabel(labelReceivedValue)}${isNot ? "    " : ""}${printReceived(received)}`;
    };
    return { message, pass };
  },
  toHaveProperty(received, expectedPath, expectedValue) {
    const matcherName = "toHaveProperty";
    const expectedArgument = "path";
    const hasValue = arguments.length === 3;
    const options = {
      isNot: this.isNot,
      promise: this.promise,
      secondArgument: hasValue ? "value" : ""
    };
    if (received === null || received === void 0) {
      throw new Error(
        matcherErrorMessage(
          matcherHint(matcherName, void 0, expectedArgument, options),
          `${RECEIVED_COLOR("received")} value must not be null nor undefined`,
          printWithType("Received", received, printReceived)
        )
      );
    }
    const expectedPathType = getType(expectedPath);
    if (expectedPathType !== "string" && expectedPathType !== "array") {
      throw new Error(
        matcherErrorMessage(
          matcherHint(matcherName, void 0, expectedArgument, options),
          `${EXPECTED_COLOR("expected")} path must be a string or array`,
          printWithType("Expected", expectedPath, printExpected)
        )
      );
    }
    const expectedPathLength = typeof expectedPath === "string" ? pathAsArray(expectedPath).length : expectedPath.length;
    if (expectedPathType === "array" && expectedPathLength === 0) {
      throw new Error(
        matcherErrorMessage(
          matcherHint(matcherName, void 0, expectedArgument, options),
          `${EXPECTED_COLOR("expected")} path must not be an empty array`,
          printWithType("Expected", expectedPath, printExpected)
        )
      );
    }
    const result = getPath(received, expectedPath);
    const { lastTraversedObject, endPropIsDefined, hasEndProp, value } = result;
    const receivedPath = result.traversedPath;
    const hasCompletePath = receivedPath.length === expectedPathLength;
    const receivedValue = hasCompletePath ? result.value : lastTraversedObject;
    const pass = hasValue && endPropIsDefined ? equals(value, expectedValue, [...this.customTesters, iterableEquality]) : Boolean(hasEndProp);
    const message = pass ? () => matcherHint(matcherName, void 0, expectedArgument, options) + "\n\n" + (hasValue ? `Expected path: ${printExpected(expectedPath)}

Expected value: not ${printExpected(expectedValue)}${stringify(expectedValue) === stringify(receivedValue) ? "" : `
Received value:     ${printReceived(receivedValue)}`}` : `Expected path: not ${printExpected(expectedPath)}

Received value: ${printReceived(receivedValue)}`) : () => matcherHint(matcherName, void 0, expectedArgument, options) + `

Expected path: ${printExpected(expectedPath)}
` + (hasCompletePath ? `
${printDiffOrStringify(
      expectedValue,
      receivedValue,
      EXPECTED_VALUE_LABEL,
      RECEIVED_VALUE_LABEL,
      false
    )}` : `Received path: ${printReceived(
      expectedPathType === "array" || receivedPath.length === 0 ? receivedPath : receivedPath.join(".")
    )}

${hasValue ? `Expected value: ${printExpected(expectedValue)}
` : ""}Received value: ${printReceived(receivedValue)}`);
    return { message, pass };
  },
  toMatch(received, expected) {
    const matcherName = "toMatch";
    const options = { isNot: this.isNot, promise: this.promise };
    if (typeof received !== "string") {
      throw new TypeError(
        matcherErrorMessage(
          matcherHint(matcherName, void 0, void 0, options),
          `${RECEIVED_COLOR("received")} value must be a string`,
          printWithType("Received", received, printReceived)
        )
      );
    }
    if (!(typeof expected === "string") && !(expected && typeof expected.test === "function")) {
      throw new Error(
        matcherErrorMessage(
          matcherHint(matcherName, void 0, void 0, options),
          `${EXPECTED_COLOR("expected")} value must be a string or regular expression`,
          printWithType("Expected", expected, printExpected)
        )
      );
    }
    const pass = typeof expected === "string" ? received.includes(expected) : new RegExp(expected).test(received);
    const message = pass ? () => typeof expected === "string" ? matcherHint(matcherName, void 0, void 0, options) + `

Expected substring: not ${printExpected(expected)}
Received string:        ${printReceivedStringContainExpectedSubstring(
      received,
      received.indexOf(expected),
      expected.length
    )}` : matcherHint(matcherName, void 0, void 0, options) + `

Expected pattern: not ${printExpected(expected)}
Received string:      ${printReceivedStringContainExpectedResult(
      received,
      typeof expected.exec === "function" ? expected.exec(received) : null
    )}` : () => {
      const labelExpected = `Expected ${typeof expected === "string" ? "substring" : "pattern"}`;
      const labelReceived = "Received string";
      const printLabel = getLabelPrinter(labelExpected, labelReceived);
      return matcherHint(matcherName, void 0, void 0, options) + `

${printLabel(labelExpected)}${printExpected(expected)}
${printLabel(labelReceived)}${printReceived(received)}`;
    };
    return { message, pass };
  },
  toMatchObject(received, expected) {
    const matcherName = "toMatchObject";
    const options = { isNot: this.isNot, promise: this.promise };
    if (typeof received !== "object" || received === null) {
      throw new Error(
        matcherErrorMessage(
          matcherHint(matcherName, void 0, void 0, options),
          `${RECEIVED_COLOR("received")} value must be a non-null object`,
          printWithType("Received", received, printReceived)
        )
      );
    }
    if (typeof expected !== "object" || expected === null) {
      throw new Error(
        matcherErrorMessage(
          matcherHint(matcherName, void 0, void 0, options),
          `${EXPECTED_COLOR("expected")} value must be a non-null object`,
          printWithType("Expected", expected, printExpected)
        )
      );
    }
    const pass = equals(received, expected, [...this.customTesters, iterableEquality, subsetEquality]);
    const message = pass ? () => matcherHint(matcherName, void 0, void 0, options) + `

Expected: not ${printExpected(expected)}` + (stringify(expected) === stringify(received) ? "" : `
Received:     ${printReceived(received)}`) : () => matcherHint(matcherName, void 0, void 0, options) + "\n\n" + printDiffOrStringify(
      expected,
      getObjectSubset(received, expected, this.customTesters),
      EXPECTED_LABEL,
      RECEIVED_LABEL,
      false
    );
    return { message, pass };
  },
  toStrictEqual(received, expected) {
    const matcherName = "toStrictEqual";
    const options = { comment: "deep equality", isNot: this.isNot, promise: this.promise };
    const pass = equals(received, expected, [...this.customTesters, ...toStrictEqualTesters], true);
    const message = pass ? () => matcherHint(matcherName, void 0, void 0, options) + `

Expected: not ${printExpected(expected)}
` + (stringify(expected) === stringify(received) ? "" : `Received:     ${printReceived(received)}`) : () => matcherHint(matcherName, void 0, void 0, options) + "\n\n" + printDiffOrStringify(expected, received, EXPECTED_LABEL, RECEIVED_LABEL, false);
    return { actual: received, expected, message, name: matcherName, pass };
  }
};
var DID_NOT_THROW = "Received function did not throw";
var getThrown = (e) => {
  const hasMessage = e !== null && e !== void 0 && typeof e.message === "string";
  if (hasMessage && typeof e.name === "string" && typeof e.stack === "string")
    return { hasMessage, isError: true, message: e.message, value: e };
  return {
    hasMessage,
    isError: false,
    message: hasMessage ? e.message : String(e),
    value: e
  };
};
var createThrowMatcher = (matcherName, fromPromise) => function(received, expected) {
  const options = { isNot: this.isNot, promise: this.promise };
  let thrown = null;
  if (fromPromise && isError(received)) {
    thrown = getThrown(received);
  } else {
    if (typeof received === "function") {
      try {
        received();
      } catch (error) {
        thrown = getThrown(error);
      }
    } else if (!fromPromise) {
      const placeholder = expected === void 0 ? "" : "expected";
      throw new Error(
        matcherErrorMessage(
          matcherHint(matcherName, void 0, placeholder, options),
          `${RECEIVED_COLOR("received")} value must be a function`,
          printWithType("Received", received, printReceived)
        )
      );
    }
  }
  if (expected === void 0)
    return toThrow(matcherName, options, thrown);
  if (typeof expected === "function")
    return toThrowExpectedClass(matcherName, options, thrown, expected);
  if (typeof expected === "string")
    return toThrowExpectedString(matcherName, options, thrown, expected);
  if (expected !== null && typeof expected.test === "function")
    return toThrowExpectedRegExp(matcherName, options, thrown, expected);
  if (expected !== null && typeof expected.asymmetricMatch === "function")
    return toThrowExpectedAsymmetric(matcherName, options, thrown, expected);
  if (expected !== null && typeof expected === "object")
    return toThrowExpectedObject(matcherName, options, thrown, expected);
  throw new Error(
    matcherErrorMessage(
      matcherHint(matcherName, void 0, void 0, options),
      `${EXPECTED_COLOR("expected")} value must be a string or regular expression or class or error`,
      printWithType("Expected", expected, printExpected)
    )
  );
};
var toThrowExpectedRegExp = (matcherName, options, thrown, expected) => {
  const pass = thrown !== null && expected.test(thrown.message);
  const message = pass ? () => matcherHint(matcherName, void 0, void 0, options) + "\n\n" + formatExpected("Expected pattern: not ", expected) + (thrown !== null && thrown.hasMessage ? formatReceived("Received message:     ", thrown, "message", expected) + formatStack(thrown) : formatReceived("Received value:       ", thrown, "value")) : () => matcherHint(matcherName, void 0, void 0, options) + "\n\n" + formatExpected("Expected pattern: ", expected) + (thrown === null ? `
${DID_NOT_THROW}` : thrown.hasMessage ? formatReceived("Received message: ", thrown, "message") + formatStack(thrown) : formatReceived("Received value:   ", thrown, "value"));
  return { message, pass };
};
var toThrowExpectedAsymmetric = (matcherName, options, thrown, expected) => {
  const pass = thrown !== null && expected.asymmetricMatch(thrown.value);
  const message = pass ? () => matcherHint(matcherName, void 0, void 0, options) + "\n\n" + formatExpected("Expected asymmetric matcher: not ", expected) + "\n" + (thrown !== null && thrown.hasMessage ? formatReceived("Received name:    ", thrown, "name") + formatReceived("Received message: ", thrown, "message") + formatStack(thrown) : formatReceived("Thrown value: ", thrown, "value")) : () => matcherHint(matcherName, void 0, void 0, options) + "\n\n" + formatExpected("Expected asymmetric matcher: ", expected) + "\n" + (thrown === null ? DID_NOT_THROW : thrown.hasMessage ? formatReceived("Received name:    ", thrown, "name") + formatReceived("Received message: ", thrown, "message") + formatStack(thrown) : formatReceived("Thrown value: ", thrown, "value"));
  return { message, pass };
};
var toThrowExpectedObject = (matcherName, options, thrown, expected) => {
  const expectedMessageAndCause = createMessageAndCause(expected);
  const thrownMessageAndCause = thrown === null ? null : createMessageAndCause(thrown.value);
  const isCompareErrorInstance = thrown?.isError && expected instanceof Error;
  const isExpectedCustomErrorInstance = expected.constructor.name !== Error.name;
  const pass = thrown !== null && thrown.message === expected.message && thrownMessageAndCause === expectedMessageAndCause && (!isCompareErrorInstance || !isExpectedCustomErrorInstance || thrown.value instanceof expected.constructor);
  const message = pass ? () => matcherHint(matcherName, void 0, void 0, options) + "\n\n" + formatExpected(`Expected ${messageAndCause(expected)}: not `, expectedMessageAndCause) + (thrown !== null && thrown.hasMessage ? formatStack(thrown) : formatReceived("Received value:       ", thrown, "value")) : () => matcherHint(matcherName, void 0, void 0, options) + "\n\n" + (thrown === null ? formatExpected(`Expected ${messageAndCause(expected)}: `, expectedMessageAndCause) + "\n" + DID_NOT_THROW : thrown.hasMessage ? printDiffOrStringify(
    expectedMessageAndCause,
    thrownMessageAndCause,
    `Expected ${messageAndCause(expected)}`,
    `Received ${messageAndCause(thrown.value)}`,
    true
  ) + "\n" + formatStack(thrown) : formatExpected(`Expected ${messageAndCause(expected)}: `, expectedMessageAndCause) + formatReceived("Received value:   ", thrown, "value"));
  return { message, pass };
};
var toThrowExpectedClass = (matcherName, options, thrown, expected) => {
  const pass = thrown !== null && thrown.value instanceof expected;
  const message = pass ? () => matcherHint(matcherName, void 0, void 0, options) + "\n\n" + printExpectedConstructorNameNot("Expected constructor", expected) + (thrown !== null && thrown.value !== null && thrown.value !== void 0 && typeof thrown.value.constructor === "function" && thrown.value.constructor !== expected ? printReceivedConstructorNameNot("Received constructor", thrown.value.constructor, expected) : "") + "\n" + (thrown !== null && thrown.hasMessage ? formatReceived("Received message: ", thrown, "message") + formatStack(thrown) : formatReceived("Received value: ", thrown, "value")) : () => matcherHint(matcherName, void 0, void 0, options) + "\n\n" + printExpectedConstructorName("Expected constructor", expected) + (thrown === null ? `
${DID_NOT_THROW}` : `${thrown.value !== null && thrown.value !== void 0 && typeof thrown.value.constructor === "function" ? printReceivedConstructorName("Received constructor", thrown.value.constructor) : ""}
${thrown.hasMessage ? formatReceived("Received message: ", thrown, "message") + formatStack(thrown) : formatReceived("Received value: ", thrown, "value")}`);
  return { message, pass };
};
var toThrowExpectedString = (matcherName, options, thrown, expected) => {
  const pass = thrown !== null && thrown.message.includes(expected);
  const message = pass ? () => matcherHint(matcherName, void 0, void 0, options) + "\n\n" + formatExpected("Expected substring: not ", expected) + (thrown !== null && thrown.hasMessage ? formatReceived("Received message:       ", thrown, "message", expected) + formatStack(thrown) : formatReceived("Received value:         ", thrown, "value")) : () => matcherHint(matcherName, void 0, void 0, options) + "\n\n" + formatExpected("Expected substring: ", expected) + (thrown === null ? `
${DID_NOT_THROW}` : thrown.hasMessage ? formatReceived("Received message:   ", thrown, "message") + formatStack(thrown) : formatReceived("Received value:     ", thrown, "value"));
  return { message, pass };
};
var toThrow = (matcherName, options, thrown) => {
  const pass = thrown !== null;
  const message = pass ? () => matcherHint(matcherName, void 0, "", options) + "\n\n" + (thrown !== null && thrown.hasMessage ? formatReceived("Error name:    ", thrown, "name") + formatReceived("Error message: ", thrown, "message") + formatStack(thrown) : formatReceived("Thrown value: ", thrown, "value")) : () => matcherHint(matcherName, void 0, "", options) + "\n\n" + DID_NOT_THROW;
  return { message, pass };
};
var formatExpected = (label, expected) => `${label + printExpected(expected)}
`;
var formatReceived = (label, thrown, key, expected) => {
  if (thrown === null)
    return "";
  if (key === "message") {
    const message = thrown.message;
    if (typeof expected === "string") {
      const index = message.indexOf(expected);
      if (index !== -1) {
        return `${label + printReceivedStringContainExpectedSubstring(message, index, expected.length)}
`;
      }
    } else if (expected instanceof RegExp) {
      return `${label + printReceivedStringContainExpectedResult(
        message,
        typeof expected.exec === "function" ? expected.exec(message) : null
      )}
`;
    }
    return `${label + printReceived(message)}
`;
  }
  if (key === "name")
    return thrown.isError ? `${label + printReceived(thrown.value.name)}
` : "";
  if (key === "value")
    return thrown.isError ? "" : `${label + printReceived(thrown.value)}
`;
  return "";
};
var formatStack = (thrown) => {
  if (thrown === null || !thrown.isError)
    return "";
  const config = { rootDir: process.cwd(), testMatch: [] };
  const options = { noStackTrace: false };
  if (thrown.value instanceof AggregateError)
    return formatExecError(thrown.value, config, options);
  return formatStackTrace(
    separateMessageFromStack(thrown.value.stack).stack,
    config,
    options
  );
};
function createMessageAndCause(error) {
  if (error.cause) {
    const seen = /* @__PURE__ */ new WeakSet();
    return JSON.stringify(buildSerializeError(error), (_, value) => {
      if (isObject(value)) {
        if (seen.has(value))
          return;
        seen.add(value);
      }
      if (typeof value === "bigint" || value === void 0)
        return String(value);
      return value;
    });
  }
  return error.message;
}
function buildSerializeError(error) {
  if (!isObject(error))
    return error;
  const result = {};
  for (const name of Object.getOwnPropertyNames(error).sort()) {
    if (["stack", "fileName", "lineNumber"].includes(name))
      continue;
    if (name === "cause") {
      result[name] = buildSerializeError(error["cause"]);
      continue;
    }
    result[name] = error[name];
  }
  return result;
}
function isObject(obj) {
  return obj !== null && obj !== void 0 && typeof obj === "object";
}
function messageAndCause(error) {
  return error.cause === void 0 ? "message" : "message and cause";
}
var getMessage = (message) => message && message() || RECEIVED_COLOR("No message was specified for this matcher.");
var validateMatcherResult = (result) => {
  if (typeof result !== "object" || typeof result.pass !== "boolean" || result.message && typeof result.message !== "string" && typeof result.message !== "function") {
    throw new Error(
      `Unexpected return from a matcher function.
Matcher functions should return an object in the following format:
  {message?: string | function, pass: boolean}
'${stringify(result)}' was returned`
    );
  }
};
function createExpectedPromiseMessage(matcherName, isNot, promise, actual) {
  return () => matcherErrorMessage(
    matcherHint(matcherName, void 0, "", { isNot, promise }),
    `${RECEIVED_COLOR("received")} value must be a promise or a function returning a promise`,
    printWithType("Received", actual, printReceived)
  );
}
function createExpectedToResolveMessage(matcherName, isNot, promise, actual) {
  return () => `${matcherHint(matcherName, void 0, "", { isNot, promise })}

Received promise rejected instead of resolved
Rejected to value: ${printReceived(actual)}`;
}
function createExpectedToRejectMessage(matcherName, isNot, promise, actual) {
  return () => `${matcherHint(matcherName, void 0, "", { isNot, promise })}

Received promise resolved instead of rejected
Resolved to value: ${printReceived(actual)}`;
}

// packages/playwright/src/matchers/matcherHint.ts
var import_util = __toESM(require("util"));
var { stringifyStackFrames } = require("playwright-core/lib/coreBundle").iso;
var ExpectError = class extends Error {
  constructor(matcherResult, customMessage, stackFrames) {
    super("");
    this.message = matcherResult.message;
    this.matcherResult = matcherResult;
    if (customMessage)
      this.message = customMessage + "\n\n" + this.message;
    this.stack = this.name + ": " + this.message + "\n" + stringifyStackFrames(stackFrames).join("\n");
  }
};
function expectTypes(receiver, types, matcherName) {
  if (typeof receiver !== "object" || !types.includes(receiver._apiName)) {
    const receiverString = typeof receiver === "object" && receiver !== null ? `${receiver.constructor.name} ${import_util.default.inspect(receiver)}` : String(receiver);
    const commaSeparated = types.slice();
    const lastType = commaSeparated.pop();
    const typesString = commaSeparated.length ? commaSeparated.join(", ") + " or " + lastType : lastType;
    throw new Error(`${matcherName} can be only used with ${typesString} object${types.length > 1 ? "s" : ""}, was called with ${receiverString}`);
  }
}
var printSubstring2 = (val) => val.replace(/"|\\/g, "\\$&");
var printReceivedStringContainExpectedSubstring2 = (utils2, received, start, length) => utils2.RECEIVED_COLOR(
  '"' + printSubstring2(received.slice(0, start)) + utils2.INVERTED_COLOR(printSubstring2(received.slice(start, start + length))) + printSubstring2(received.slice(start + length)) + '"'
);
var printReceivedStringContainExpectedResult2 = (utils2, received, result) => result === null ? utils2.printReceived(received) : printReceivedStringContainExpectedSubstring2(
  utils2,
  received,
  result.index,
  result[0].length
);
function formatMatcherMessage(utils2, details) {
  const receiver = details.receiver ?? (details.locator ? "locator" : "page");
  let message = utils2.DIM_COLOR("expect(") + utils2.RECEIVED_COLOR(receiver) + utils2.DIM_COLOR(")" + (details.promise ? "." + details.promise : "") + (details.isNot ? ".not" : "") + ".") + details.matcherName + utils2.DIM_COLOR("(") + utils2.EXPECTED_COLOR(details.expectation) + utils2.DIM_COLOR(")") + " failed\n\n";
  const diffLines = details.printedDiff?.split("\n");
  if (diffLines?.length === 2) {
    details.printedExpected = diffLines[0];
    details.printedReceived = diffLines[1];
    details.printedDiff = void 0;
  }
  const align = !details.errorMessage && details.printedExpected?.startsWith("Expected:") && (!details.printedReceived || details.printedReceived.startsWith("Received:"));
  if (details.locator)
    message += `Locator: ${align ? " " : ""}${details.locator}
`;
  if (details.printedExpected)
    message += details.printedExpected + "\n";
  if (details.printedReceived)
    message += details.printedReceived + "\n";
  if (details.timedOut && details.timeout)
    message += `Timeout: ${align ? " " : ""}${details.timeout}ms
`;
  if (details.printedDiff)
    message += details.printedDiff + "\n";
  if (details.errorMessage) {
    message += details.errorMessage;
    if (!details.errorMessage.endsWith("\n"))
      message += "\n";
  }
  message += callLogText(utils2, details.log);
  return message;
}
var callLogText = (utils2, log) => {
  if (!log || !log.some((l) => !!l))
    return "";
  return `
Call log:
${utils2.DIM_COLOR(log.join("\n"))}
`;
};

// packages/playwright/src/matchers/toBeTruthy.ts
async function toBeTruthy(matcherName, locator, receiverType, expected, arg, query, options = {}) {
  expectTypes(locator, [receiverType], matcherName);
  const timeout = options.timeout ?? this.timeout;
  const { matches: pass, log, timedOut, received, errorMessage } = await query(!!this.isNot, timeout);
  const receivedValue = received?.value;
  if (pass === !this.isNot) {
    return {
      name: matcherName,
      message: () => "",
      pass,
      expected
    };
  }
  let printedReceived;
  let printedExpected;
  if (pass) {
    printedExpected = `Expected: not ${expected}`;
    printedReceived = errorMessage ? "" : `Received: ${expected}`;
  } else {
    printedExpected = `Expected: ${expected}`;
    printedReceived = errorMessage ? "" : `Received: ${receivedValue}`;
  }
  const message = () => {
    return formatMatcherMessage(this.utils, {
      isNot: this.isNot,
      promise: this.promise,
      matcherName,
      expectation: arg,
      locator: locator.toString(),
      timeout,
      timedOut,
      printedExpected,
      printedReceived,
      errorMessage,
      log
    });
  };
  return {
    message,
    pass,
    actual: receivedValue,
    name: matcherName,
    expected,
    log,
    timeout: timedOut ? timeout : void 0,
    ariaSnapshot: received?.ariaSnapshot
  };
}

// packages/playwright/src/matchers/toEqual.ts
var { isRegExp } = require("playwright-core/lib/coreBundle").iso;
var EXPECTED_LABEL2 = "Expected";
var RECEIVED_LABEL2 = "Received";
async function toEqual(matcherName, locator, receiverType, query, expected, options = {}) {
  expectTypes(locator, [receiverType], matcherName);
  const timeout = options.timeout ?? this.timeout;
  const { matches: pass, received, log, timedOut, errorMessage } = await query(!!this.isNot, timeout);
  const receivedValue = received?.value;
  if (pass === !this.isNot) {
    return {
      name: matcherName,
      message: () => "",
      pass,
      expected
    };
  }
  let printedReceived;
  let printedExpected;
  let printedDiff;
  if (pass) {
    printedExpected = `Expected: not ${this.utils.printExpected(expected)}`;
    printedReceived = errorMessage ? "" : `Received: ${this.utils.printReceived(receivedValue)}`;
  } else if (errorMessage) {
    printedExpected = `Expected: ${this.utils.printExpected(expected)}`;
  } else if (Array.isArray(expected) && Array.isArray(receivedValue)) {
    const normalizedExpected = expected.map((exp, index) => {
      const rec = receivedValue[index];
      if (isRegExp(exp))
        return exp.test(rec) ? rec : exp;
      return exp;
    });
    printedDiff = this.utils.printDiffOrStringify(
      normalizedExpected,
      receivedValue,
      EXPECTED_LABEL2,
      RECEIVED_LABEL2,
      false
    );
  } else {
    printedDiff = this.utils.printDiffOrStringify(
      expected,
      receivedValue,
      EXPECTED_LABEL2,
      RECEIVED_LABEL2,
      false
    );
  }
  const message = () => {
    return formatMatcherMessage(this.utils, {
      isNot: this.isNot,
      promise: this.promise,
      matcherName,
      expectation: "expected",
      locator: locator.toString(),
      timeout,
      timedOut,
      printedExpected,
      printedReceived,
      printedDiff,
      errorMessage,
      log
    });
  };
  return {
    actual: receivedValue,
    expected,
    message,
    name: matcherName,
    pass,
    log,
    timeout: timedOut ? timeout : void 0,
    ariaSnapshot: received?.ariaSnapshot
  };
}

// packages/playwright/src/matchers/toHaveURL.ts
var { urlMatches } = require("playwright-core/lib/coreBundle").iso;
async function toHaveURLWithPredicate(page, expected, options) {
  const matcherName = "toHaveURL";
  const timeout = options?.timeout ?? this.timeout;
  const baseURL = page.context()._options.baseURL;
  let conditionSucceeded = false;
  let lastCheckedURLString = void 0;
  try {
    await page.mainFrame().waitForURL(
      (url) => {
        lastCheckedURLString = url.toString();
        if (options?.ignoreCase) {
          return !this.isNot === urlMatches(
            baseURL?.toLocaleLowerCase(),
            lastCheckedURLString.toLocaleLowerCase(),
            expected
          );
        }
        return !this.isNot === urlMatches(baseURL, lastCheckedURLString, expected);
      },
      { timeout }
    );
    conditionSucceeded = true;
  } catch (e) {
    conditionSucceeded = false;
  }
  if (conditionSucceeded)
    return { name: matcherName, pass: !this.isNot, message: () => "" };
  return {
    name: matcherName,
    pass: this.isNot,
    message: () => toHaveURLMessage(
      this,
      matcherName,
      expected,
      lastCheckedURLString,
      this.isNot,
      true,
      timeout
    ),
    actual: lastCheckedURLString,
    timeout
  };
}
function toHaveURLMessage(state, matcherName, expected, received, pass, timedOut, timeout) {
  const receivedString = received || "";
  let printedReceived;
  let printedExpected;
  let printedDiff;
  if (typeof expected === "function") {
    printedExpected = `Expected: predicate to ${!state.isNot ? "succeed" : "fail"}`;
    printedReceived = `Received: ${state.utils.printReceived(receivedString)}`;
  } else {
    if (pass) {
      printedExpected = `Expected pattern: not ${state.utils.printExpected(expected)}`;
      const formattedReceived = printReceivedStringContainExpectedResult2(state.utils, receivedString, null);
      printedReceived = `Received string: ${formattedReceived}`;
    } else {
      const labelExpected = `Expected ${typeof expected === "string" ? "string" : "pattern"}`;
      printedDiff = state.utils.printDiffOrStringify(expected, receivedString, labelExpected, "Received string", false);
    }
  }
  return formatMatcherMessage(state.utils, {
    isNot: state.isNot,
    promise: state.promise,
    matcherName,
    expectation: "expected",
    timeout,
    timedOut,
    printedExpected,
    printedReceived,
    printedDiff
  });
}

// packages/playwright/src/matchers/toMatchText.ts
async function toMatchText(matcherName, receiver, receiverType, query, expected, options = {}) {
  expectTypes(receiver, [receiverType], matcherName);
  const locator = receiverType === "Locator" ? receiver : void 0;
  if (!(typeof expected === "string") && !(expected && typeof expected.test === "function")) {
    const errorMessage2 = `Error: ${this.utils.EXPECTED_COLOR("expected")} value must be a string or regular expression
${this.utils.printWithType("Expected", expected, this.utils.printExpected)}`;
    throw new Error(formatMatcherMessage(this.utils, { promise: this.promise, isNot: this.isNot, locator: locator?.toString(), matcherName, expectation: "expected", errorMessage: errorMessage2 }));
  }
  const timeout = options.timeout ?? this.timeout;
  const { matches: pass, received, log, timedOut, errorMessage } = await query(!!this.isNot, timeout);
  if (pass === !this.isNot) {
    return {
      name: matcherName,
      message: () => "",
      pass,
      expected
    };
  }
  const expectedSuffix = typeof expected === "string" ? options.matchSubstring ? " substring" : "" : " pattern";
  const receivedSuffix = typeof expected === "string" ? options.matchSubstring ? " string" : "" : " string";
  const receivedValue = received?.value;
  const receivedString = receivedValue || "";
  let printedReceived;
  let printedExpected;
  let printedDiff;
  if (pass) {
    if (typeof expected === "string") {
      printedExpected = `Expected${expectedSuffix}: not ${this.utils.printExpected(expected)}`;
      if (!errorMessage) {
        const formattedReceived = printReceivedStringContainExpectedSubstring2(this.utils, receivedString, receivedString.indexOf(expected), expected.length);
        printedReceived = `Received${receivedSuffix}: ${formattedReceived}`;
      }
    } else {
      printedExpected = `Expected${expectedSuffix}: not ${this.utils.printExpected(expected)}`;
      if (!errorMessage) {
        const formattedReceived = printReceivedStringContainExpectedResult2(this.utils, receivedString, typeof expected.exec === "function" ? expected.exec(receivedString) : null);
        printedReceived = `Received${receivedSuffix}: ${formattedReceived}`;
      }
    }
  } else {
    if (errorMessage)
      printedExpected = `Expected${expectedSuffix}: ${this.utils.printExpected(expected)}`;
    else
      printedDiff = this.utils.printDiffOrStringify(expected, receivedString, `Expected${expectedSuffix}`, `Received${receivedSuffix}`, false);
  }
  const message = () => {
    return formatMatcherMessage(this.utils, {
      promise: this.promise,
      isNot: this.isNot,
      matcherName,
      expectation: "expected",
      locator: locator?.toString(),
      timeout,
      timedOut,
      printedExpected,
      printedReceived,
      printedDiff,
      log,
      errorMessage
    });
  };
  return {
    name: matcherName,
    expected,
    message,
    pass,
    actual: receivedValue,
    log,
    timeout: timedOut ? timeout : void 0,
    ariaSnapshot: received?.ariaSnapshot
  };
}

// packages/playwright/src/matchers/toMatchSnapshot.ts
var import_fs = __toESM(require("fs"));
var import_path = __toESM(require("path"));
var colors = require("playwright-core/lib/utilsBundle").colors;
var { getMimeTypeForPath } = require("playwright-core/lib/coreBundle").iso;
var { isString } = require("playwright-core/lib/coreBundle").iso;
var { compareBuffersOrStrings, getComparator } = require("playwright-core/lib/coreBundle").utils;
var { addSuffixToFilePath } = require("playwright-core/lib/coreBundle").utils;
var NonConfigProperties = [
  "clip",
  "fullPage",
  "mask",
  "maskColor",
  "omitBackground"
];
var SnapshotHelper = class {
  constructor(state, testInfo, matcherName, locator, anonymousSnapshotExtension, configOptions, nameOrOptions, optOptions) {
    let name;
    if (Array.isArray(nameOrOptions) || typeof nameOrOptions === "string") {
      name = nameOrOptions;
      this.options = { ...optOptions };
    } else {
      const { name: nameFromOptions, ...options } = nameOrOptions;
      this.options = options;
      name = nameFromOptions;
    }
    this.name = Array.isArray(name) ? name.join(import_path.default.sep) : name || "";
    const resolvedPaths = testInfo._resolveSnapshotPaths(matcherName === "toHaveScreenshot" ? "screenshot" : "snapshot", name, "updateSnapshotIndex", anonymousSnapshotExtension);
    this.expectedPath = resolvedPaths.absoluteSnapshotPath;
    this.attachmentBaseName = resolvedPaths.relativeOutputPath;
    const outputBasePath = testInfo._getOutputPath(resolvedPaths.relativeOutputPath);
    this.legacyExpectedPath = addSuffixToFilePath(outputBasePath, "-expected");
    this.previousPath = addSuffixToFilePath(outputBasePath, "-previous");
    this.actualPath = addSuffixToFilePath(outputBasePath, "-actual");
    this.diffPath = addSuffixToFilePath(outputBasePath, "-diff");
    const filteredConfigOptions = { ...configOptions };
    for (const prop of NonConfigProperties)
      delete filteredConfigOptions[prop];
    this.options = {
      ...filteredConfigOptions,
      ...this.options
    };
    if (this.options._comparator) {
      this.options.comparator = this.options._comparator;
      delete this.options._comparator;
    }
    if (this.options.maxDiffPixels !== void 0 && this.options.maxDiffPixels < 0)
      throw new Error("`maxDiffPixels` option value must be non-negative integer");
    if (this.options.maxDiffPixelRatio !== void 0 && (this.options.maxDiffPixelRatio < 0 || this.options.maxDiffPixelRatio > 1))
      throw new Error("`maxDiffPixelRatio` option value must be between 0 and 1");
    this.matcherName = matcherName;
    this.locator = locator;
    this.updateSnapshots = expectConfig().updateSnapshots;
    this.mimeType = getMimeTypeForPath(import_path.default.basename(this.expectedPath)) ?? "application/octet-stream";
    this.comparator = getComparator(this.mimeType);
    this.testInfo = testInfo;
    this.state = state;
    this.kind = this.mimeType.startsWith("image/") ? "Screenshot" : "Snapshot";
  }
  createMatcherResult(message, pass, log, attachments) {
    const unfiltered = {
      name: this.matcherName,
      expected: this.expectedPath,
      actual: this.actualPath,
      diff: this.diffPath,
      pass,
      message: () => message,
      log,
      attachments
    };
    return Object.fromEntries(Object.entries(unfiltered).filter(([_, v]) => v !== void 0));
  }
  handleMissingNegated() {
    const isWriteMissingMode = this.updateSnapshots !== "none";
    const message = `A snapshot doesn't exist at ${this.expectedPath}${isWriteMissingMode ? `, matchers using ".not" won't write them automatically.` : "."}`;
    return this.createMatcherResult(message, true);
  }
  handleDifferentNegated() {
    return this.createMatcherResult("", false);
  }
  handleMatchingNegated() {
    const message = [
      colors.red(`${this.kind} comparison failed:`),
      "",
      indent("Expected result should be different from the actual one.", "  ")
    ].join("\n");
    return this.createMatcherResult(message, true);
  }
  handleMissing(actual) {
    const attachments = [];
    const isWriteMissingMode = this.updateSnapshots !== "none";
    if (isWriteMissingMode)
      writeFileSync(this.expectedPath, actual);
    attachments.push({ name: addSuffixToFilePath(this.attachmentBaseName, "-expected"), contentType: this.mimeType, path: this.expectedPath });
    writeFileSync(this.actualPath, actual);
    attachments.push({ name: addSuffixToFilePath(this.attachmentBaseName, "-actual"), contentType: this.mimeType, path: this.actualPath });
    const message = `A snapshot doesn't exist at ${this.expectedPath}${isWriteMissingMode ? ", writing actual." : "."}`;
    if (this.updateSnapshots === "all" || this.updateSnapshots === "changed") {
      console.log(message);
      return this.createMatcherResult(message, true, void 0, attachments);
    }
    if (this.updateSnapshots === "missing") {
      return {
        ...this.createMatcherResult("", true, void 0, attachments),
        softError: new Error(message),
        shouldNotRetryTest: true
      };
    }
    return this.createMatcherResult(message, false, void 0, attachments);
  }
  handleDifferent(actual, expected, previous, diff2, header, diffError, log) {
    const output = [`${header}${indent(diffError, "  ")}`];
    if (this.name) {
      output.push("");
      output.push(`  Snapshot: ${this.name}`);
    }
    const attachments = [];
    if (expected !== void 0) {
      writeFileSync(this.legacyExpectedPath, expected);
      attachments.push({ name: addSuffixToFilePath(this.attachmentBaseName, "-expected"), contentType: this.mimeType, path: this.expectedPath });
    }
    if (previous !== void 0) {
      writeFileSync(this.previousPath, previous);
      attachments.push({ name: addSuffixToFilePath(this.attachmentBaseName, "-previous"), contentType: this.mimeType, path: this.previousPath });
    }
    if (actual !== void 0) {
      writeFileSync(this.actualPath, actual);
      attachments.push({ name: addSuffixToFilePath(this.attachmentBaseName, "-actual"), contentType: this.mimeType, path: this.actualPath });
    }
    if (diff2 !== void 0) {
      writeFileSync(this.diffPath, diff2);
      attachments.push({ name: addSuffixToFilePath(this.attachmentBaseName, "-diff"), contentType: this.mimeType, path: this.diffPath });
    }
    if (log?.length)
      output.push(callLogText(this.state.utils, log));
    else
      output.push("");
    return this.createMatcherResult(output.join("\n"), false, log, attachments);
  }
  handleMatching() {
    return this.createMatcherResult("", true);
  }
};
function toMatchSnapshot(received, nameOrOptions = {}, optOptions = {}) {
  const testInfo = expectConfig().testInfo;
  if (!testInfo)
    throw new Error(`toMatchSnapshot() must be called during the test`);
  if (received instanceof Promise)
    throw new Error("An unresolved Promise was passed to toMatchSnapshot(), make sure to resolve it by adding await to it.");
  if (expectConfig().ignoreSnapshots)
    return { pass: !this.isNot, message: () => "", name: "toMatchSnapshot", expected: nameOrOptions };
  const configOptions = expectConfig().toMatchSnapshot || {};
  const helper = new SnapshotHelper(
    this,
    testInfo,
    "toMatchSnapshot",
    void 0,
    "." + determineFileExtension(received),
    configOptions,
    nameOrOptions,
    optOptions
  );
  if (this.isNot) {
    if (!import_fs.default.existsSync(helper.expectedPath))
      return helper.handleMissingNegated();
    const isDifferent = !!helper.comparator(received, import_fs.default.readFileSync(helper.expectedPath), helper.options);
    return isDifferent ? helper.handleDifferentNegated() : helper.handleMatchingNegated();
  }
  if (!import_fs.default.existsSync(helper.expectedPath))
    return helper.handleMissing(received);
  const expected = import_fs.default.readFileSync(helper.expectedPath);
  if (helper.updateSnapshots === "all") {
    if (!compareBuffersOrStrings(received, expected))
      return helper.handleMatching();
    writeFileSync(helper.expectedPath, received);
    console.log(helper.expectedPath + " is not the same, writing actual.");
    return helper.createMatcherResult(helper.expectedPath + " running with --update-snapshots, writing actual.", true);
  }
  if (helper.updateSnapshots === "changed") {
    const result2 = helper.comparator(received, expected, helper.options);
    if (!result2)
      return helper.handleMatching();
    writeFileSync(helper.expectedPath, received);
    console.log(helper.expectedPath + " does not match, writing actual.");
    return helper.createMatcherResult(helper.expectedPath + " running with --update-snapshots, writing actual.", true);
  }
  const result = helper.comparator(received, expected, helper.options);
  if (!result)
    return helper.handleMatching();
  const header = formatMatcherMessage(this.utils, { promise: this.promise, isNot: this.isNot, matcherName: "toMatchSnapshot", receiver: isString(received) ? "string" : "Buffer", expectation: "expected" });
  return helper.handleDifferent(received, expected, void 0, result.diff, header, result.errorMessage, void 0);
}
function toHaveScreenshotStepTitle(nameOrOptions = {}, optOptions = {}) {
  let name;
  if (typeof nameOrOptions === "object" && !Array.isArray(nameOrOptions))
    name = nameOrOptions.name;
  else
    name = nameOrOptions;
  return Array.isArray(name) ? name.join(import_path.default.sep) : name || "";
}
async function toHaveScreenshot(pageOrLocator, nameOrOptions = {}, optOptions = {}) {
  const testInfo = expectConfig().testInfo;
  if (!testInfo)
    throw new Error(`toHaveScreenshot() must be called during the test`);
  if (expectConfig().ignoreSnapshots)
    return { pass: !this.isNot, message: () => "", name: "toHaveScreenshot", expected: nameOrOptions };
  expectTypes(pageOrLocator, ["Page", "Locator"], "toHaveScreenshot");
  const [page, locator] = pageOrLocator._apiName === "Page" ? [pageOrLocator, void 0] : [pageOrLocator.page(), pageOrLocator];
  const configOptions = expectConfig().toHaveScreenshot || {};
  const helper = new SnapshotHelper(this, testInfo, "toHaveScreenshot", locator, void 0, configOptions, nameOrOptions, optOptions);
  if (!helper.expectedPath.toLowerCase().endsWith(".png"))
    throw new Error(`Screenshot name "${import_path.default.basename(helper.expectedPath)}" must have '.png' extension`);
  expectTypes(pageOrLocator, ["Page", "Locator"], "toHaveScreenshot");
  const style = await loadScreenshotStyles(helper.options.stylePath);
  const timeout = helper.options.timeout ?? this.timeout;
  const expectScreenshotOptions = {
    locator,
    animations: helper.options.animations ?? "disabled",
    caret: helper.options.caret ?? "hide",
    clip: helper.options.clip,
    fullPage: helper.options.fullPage,
    mask: helper.options.mask,
    maskColor: helper.options.maskColor,
    omitBackground: helper.options.omitBackground,
    scale: helper.options.scale ?? "css",
    style,
    isNot: !!this.isNot,
    timeout,
    comparator: helper.options.comparator,
    maxDiffPixels: helper.options.maxDiffPixels,
    maxDiffPixelRatio: helper.options.maxDiffPixelRatio,
    threshold: helper.options.threshold
  };
  const hasSnapshot = import_fs.default.existsSync(helper.expectedPath);
  if (this.isNot) {
    if (!hasSnapshot)
      return helper.handleMissingNegated();
  }
  if (!this.isNot && helper.updateSnapshots === "none" && !hasSnapshot)
    return helper.createMatcherResult(`A snapshot doesn't exist at ${helper.expectedPath}.`, false);
  await page.screencast.hideOverlays();
  try {
    if (this.isNot) {
      expectScreenshotOptions.expected = await import_fs.default.promises.readFile(helper.expectedPath);
      const isDifferent = !(await page._expectScreenshot(expectScreenshotOptions)).errorMessage;
      return isDifferent ? helper.handleDifferentNegated() : helper.handleMatchingNegated();
    }
    if (!hasSnapshot) {
      const { actual: actual2, previous: previous2, diff: diff3, errorMessage: errorMessage2, log: log2, timedOut: timedOut2 } = await page._expectScreenshot(expectScreenshotOptions);
      if (errorMessage2) {
        const header2 = formatMatcherMessage(this.utils, { promise: this.promise, isNot: this.isNot, matcherName: "toHaveScreenshot", locator: locator?.toString(), expectation: "expected", timeout, timedOut: timedOut2 });
        return helper.handleDifferent(actual2, void 0, previous2, diff3, header2, errorMessage2, log2);
      }
      return helper.handleMissing(actual2);
    }
    const expected = await import_fs.default.promises.readFile(helper.expectedPath);
    expectScreenshotOptions.expected = helper.updateSnapshots === "all" ? void 0 : expected;
    const { actual, previous, diff: diff2, errorMessage, log, timedOut } = await page._expectScreenshot(expectScreenshotOptions);
    const writeFiles = (actualBuffer) => {
      writeFileSync(helper.expectedPath, actualBuffer);
      writeFileSync(helper.actualPath, actualBuffer);
      console.log(helper.expectedPath + " is re-generated, writing actual.");
      return helper.createMatcherResult(helper.expectedPath + " running with --update-snapshots, writing actual.", true);
    };
    if (!errorMessage) {
      if (helper.updateSnapshots === "all" && actual && compareBuffersOrStrings(actual, expected)) {
        console.log(helper.expectedPath + " is re-generated, writing actual.");
        return writeFiles(actual);
      }
      return helper.handleMatching();
    }
    if (helper.updateSnapshots === "changed" || helper.updateSnapshots === "all") {
      if (actual)
        return writeFiles(actual);
      let header2 = formatMatcherMessage(this.utils, { promise: this.promise, isNot: this.isNot, matcherName: "toHaveScreenshot", locator: locator?.toString(), expectation: "expected", timeout, timedOut });
      header2 += "  Failed to re-generate expected.\n";
      return helper.handleDifferent(actual, expectScreenshotOptions.expected, previous, diff2, header2, errorMessage, log);
    }
    const header = formatMatcherMessage(this.utils, { promise: this.promise, isNot: this.isNot, matcherName: "toHaveScreenshot", locator: locator?.toString(), expectation: "expected", timeout, timedOut });
    return helper.handleDifferent(actual, expectScreenshotOptions.expected, previous, diff2, header, errorMessage, log);
  } finally {
    await page.screencast.showOverlays();
  }
}
function writeFileSync(aPath, content) {
  import_fs.default.mkdirSync(import_path.default.dirname(aPath), { recursive: true });
  import_fs.default.writeFileSync(aPath, content);
}
function indent(lines, tab) {
  return lines.replace(/^(?=.+$)/gm, tab);
}
function determineFileExtension(file) {
  if (typeof file === "string")
    return "txt";
  if (compareMagicBytes(file, [137, 80, 78, 71, 13, 10, 26, 10]))
    return "png";
  if (compareMagicBytes(file, [255, 216, 255]))
    return "jpg";
  return "dat";
}
function compareMagicBytes(file, magicBytes) {
  return Buffer.compare(Buffer.from(magicBytes), file.slice(0, magicBytes.length)) === 0;
}
async function loadScreenshotStyles(stylePath) {
  if (!stylePath)
    return;
  const stylePaths = Array.isArray(stylePath) ? stylePath : [stylePath];
  const styles = await Promise.all(stylePaths.map(async (stylePath2) => {
    const text = await import_fs.default.promises.readFile(stylePath2, "utf8");
    return text.trim();
  }));
  return styles.join("\n").trim() || void 0;
}

// packages/playwright/src/matchers/matchers.ts
var colors2 = require("playwright-core/lib/utilsBundle").colors;
var { asLocatorDescription } = require("playwright-core/lib/coreBundle").iso;
var { isTextualMimeType } = require("playwright-core/lib/coreBundle").iso;
var { isRegExp: isRegExp2 } = require("playwright-core/lib/coreBundle").iso;
var { isString: isString2 } = require("playwright-core/lib/coreBundle").iso;
var { pollAgainstDeadline } = require("playwright-core/lib/coreBundle").iso;
var { constructURLBasedOnBaseURL, isURLPattern } = require("playwright-core/lib/coreBundle").iso;
var { serializeExpectedTextValues } = require("playwright-core/lib/coreBundle").iso;
var { monotonicTime } = require("playwright-core/lib/coreBundle").iso;
function toBeAttached(locator, options) {
  const attached = !options || options.attached === void 0 || options.attached;
  const expected = attached ? "attached" : "detached";
  const arg = attached ? "" : "{ attached: false }";
  return toBeTruthy.call(this, "toBeAttached", locator, "Locator", expected, arg, async (isNot, timeout) => {
    return await locator._expect(attached ? "to.be.attached" : "to.be.detached", { isNot, timeout });
  }, options);
}
function toBeChecked(locator, options) {
  const checked = options?.checked;
  const indeterminate = options?.indeterminate;
  const expectedValue = {
    checked,
    indeterminate
  };
  let expected;
  let arg;
  if (options?.indeterminate) {
    expected = "indeterminate";
    arg = `{ indeterminate: true }`;
  } else {
    expected = options?.checked === false ? "unchecked" : "checked";
    arg = options?.checked === false ? `{ checked: false }` : "";
  }
  return toBeTruthy.call(this, "toBeChecked", locator, "Locator", expected, arg, async (isNot, timeout) => {
    return await locator._expect("to.be.checked", { isNot, timeout, expectedValue });
  }, options);
}
function toBeDisabled(locator, options) {
  return toBeTruthy.call(this, "toBeDisabled", locator, "Locator", "disabled", "", async (isNot, timeout) => {
    return await locator._expect("to.be.disabled", { isNot, timeout });
  }, options);
}
function toBeEditable(locator, options) {
  const editable = !options || options.editable === void 0 || options.editable;
  const expected = editable ? "editable" : "readOnly";
  const arg = editable ? "" : "{ editable: false }";
  return toBeTruthy.call(this, "toBeEditable", locator, "Locator", expected, arg, async (isNot, timeout) => {
    return await locator._expect(editable ? "to.be.editable" : "to.be.readonly", { isNot, timeout });
  }, options);
}
function toBeEmpty(locator, options) {
  return toBeTruthy.call(this, "toBeEmpty", locator, "Locator", "empty", "", async (isNot, timeout) => {
    return await locator._expect("to.be.empty", { isNot, timeout });
  }, options);
}
function toBeEnabled(locator, options) {
  const enabled = !options || options.enabled === void 0 || options.enabled;
  const expected = enabled ? "enabled" : "disabled";
  const arg = enabled ? "" : "{ enabled: false }";
  return toBeTruthy.call(this, "toBeEnabled", locator, "Locator", expected, arg, async (isNot, timeout) => {
    return await locator._expect(enabled ? "to.be.enabled" : "to.be.disabled", { isNot, timeout });
  }, options);
}
function toBeFocused(locator, options) {
  return toBeTruthy.call(this, "toBeFocused", locator, "Locator", "focused", "", async (isNot, timeout) => {
    return await locator._expect("to.be.focused", { isNot, timeout });
  }, options);
}
function toBeHidden(locator, options) {
  return toBeTruthy.call(this, "toBeHidden", locator, "Locator", "hidden", "", async (isNot, timeout) => {
    return await locator._expect("to.be.hidden", { isNot, timeout });
  }, options);
}
function toBeVisible(locator, options) {
  const visible = !options || options.visible === void 0 || options.visible;
  const expected = visible ? "visible" : "hidden";
  const arg = visible ? "" : "{ visible: false }";
  return toBeTruthy.call(this, "toBeVisible", locator, "Locator", expected, arg, async (isNot, timeout) => {
    return await locator._expect(visible ? "to.be.visible" : "to.be.hidden", { isNot, timeout });
  }, options);
}
function toBeInViewport(locator, options) {
  return toBeTruthy.call(this, "toBeInViewport", locator, "Locator", "in viewport", "", async (isNot, timeout) => {
    return await locator._expect("to.be.in.viewport", { isNot, expectedNumber: options?.ratio, timeout });
  }, options);
}
function toContainText(locator, expected, options = {}) {
  if (Array.isArray(expected)) {
    return toEqual.call(this, "toContainText", locator, "Locator", async (isNot, timeout) => {
      const expectedText = serializeExpectedTextValues(expected, { matchSubstring: true, normalizeWhiteSpace: true, ignoreCase: options.ignoreCase });
      return await locator._expect("to.contain.text.array", { expectedText, isNot, useInnerText: options.useInnerText, timeout });
    }, expected, { ...options, contains: true });
  } else {
    return toMatchText.call(this, "toContainText", locator, "Locator", async (isNot, timeout) => {
      const expectedText = serializeExpectedTextValues([expected], { matchSubstring: true, normalizeWhiteSpace: true, ignoreCase: options.ignoreCase });
      return await locator._expect("to.have.text", { expectedText, isNot, useInnerText: options.useInnerText, timeout });
    }, expected, { ...options, matchSubstring: true });
  }
}
function toHaveAccessibleDescription(locator, expected, options) {
  return toMatchText.call(this, "toHaveAccessibleDescription", locator, "Locator", async (isNot, timeout) => {
    const expectedText = serializeExpectedTextValues([expected], { ignoreCase: options?.ignoreCase, normalizeWhiteSpace: true });
    return await locator._expect("to.have.accessible.description", { expectedText, isNot, timeout });
  }, expected, options);
}
function toHaveAccessibleName(locator, expected, options) {
  return toMatchText.call(this, "toHaveAccessibleName", locator, "Locator", async (isNot, timeout) => {
    const expectedText = serializeExpectedTextValues([expected], { ignoreCase: options?.ignoreCase, normalizeWhiteSpace: true });
    return await locator._expect("to.have.accessible.name", { expectedText, isNot, timeout });
  }, expected, options);
}
function toHaveAccessibleErrorMessage(locator, expected, options) {
  return toMatchText.call(this, "toHaveAccessibleErrorMessage", locator, "Locator", async (isNot, timeout) => {
    const expectedText = serializeExpectedTextValues([expected], { ignoreCase: options?.ignoreCase, normalizeWhiteSpace: true });
    return await locator._expect("to.have.accessible.error.message", { expectedText, isNot, timeout });
  }, expected, options);
}
function toHaveAttribute(locator, name, expected, options) {
  if (!options) {
    if (typeof expected === "object" && !isRegExp2(expected)) {
      options = expected;
      expected = void 0;
    }
  }
  if (expected === void 0) {
    return toBeTruthy.call(this, "toHaveAttribute", locator, "Locator", "have attribute", "", async (isNot, timeout) => {
      return await locator._expect("to.have.attribute", { expressionArg: name, isNot, timeout });
    }, options);
  }
  return toMatchText.call(this, "toHaveAttribute", locator, "Locator", async (isNot, timeout) => {
    const expectedText = serializeExpectedTextValues([expected], { ignoreCase: options?.ignoreCase });
    return await locator._expect("to.have.attribute.value", { expressionArg: name, expectedText, isNot, timeout });
  }, expected, options);
}
function toHaveClass(locator, expected, options) {
  if (Array.isArray(expected)) {
    return toEqual.call(this, "toHaveClass", locator, "Locator", async (isNot, timeout) => {
      const expectedText = serializeExpectedTextValues(expected);
      return await locator._expect("to.have.class.array", { expectedText, isNot, timeout });
    }, expected, options);
  } else {
    return toMatchText.call(this, "toHaveClass", locator, "Locator", async (isNot, timeout) => {
      const expectedText = serializeExpectedTextValues([expected]);
      return await locator._expect("to.have.class", { expectedText, isNot, timeout });
    }, expected, options);
  }
}
function toContainClass(locator, expected, options) {
  if (Array.isArray(expected)) {
    if (expected.some((e) => isRegExp2(e)))
      throw new Error(`"expected" argument in toContainClass cannot contain RegExp values`);
    return toEqual.call(this, "toContainClass", locator, "Locator", async (isNot, timeout) => {
      const expectedText = serializeExpectedTextValues(expected);
      return await locator._expect("to.contain.class.array", { expectedText, isNot, timeout });
    }, expected, options);
  } else {
    if (isRegExp2(expected))
      throw new Error(`"expected" argument in toContainClass cannot be a RegExp value`);
    return toMatchText.call(this, "toContainClass", locator, "Locator", async (isNot, timeout) => {
      const expectedText = serializeExpectedTextValues([expected]);
      return await locator._expect("to.contain.class", { expectedText, isNot, timeout });
    }, expected, options);
  }
}
function toHaveCount(locator, expected, options) {
  return toEqual.call(this, "toHaveCount", locator, "Locator", async (isNot, timeout) => {
    return await locator._expect("to.have.count", { expectedNumber: expected, isNot, timeout });
  }, expected, options);
}
function toHaveCSS(locator, name, expected, options) {
  return toMatchText.call(this, "toHaveCSS", locator, "Locator", async (isNot, timeout) => {
    const expectedText = serializeExpectedTextValues([expected]);
    return await locator._expect("to.have.css", { expressionArg: name, expectedText, isNot, pseudo: options?.pseudo, timeout });
  }, expected, options);
}
function toHaveId(locator, expected, options) {
  return toMatchText.call(this, "toHaveId", locator, "Locator", async (isNot, timeout) => {
    const expectedText = serializeExpectedTextValues([expected]);
    return await locator._expect("to.have.id", { expectedText, isNot, timeout });
  }, expected, options);
}
function toHaveJSProperty(locator, name, expected, options) {
  return toEqual.call(this, "toHaveJSProperty", locator, "Locator", async (isNot, timeout) => {
    return await locator._expect("to.have.property", { expressionArg: name, expectedValue: expected, isNot, timeout });
  }, expected, options);
}
function toHaveRole(locator, expected, options) {
  if (!isString2(expected))
    throw new Error(`"role" argument in toHaveRole must be a string`);
  return toMatchText.call(this, "toHaveRole", locator, "Locator", async (isNot, timeout) => {
    const expectedText = serializeExpectedTextValues([expected]);
    return await locator._expect("to.have.role", { expectedText, isNot, timeout });
  }, expected, options);
}
function toHaveText(locator, expected, options = {}) {
  if (Array.isArray(expected)) {
    return toEqual.call(this, "toHaveText", locator, "Locator", async (isNot, timeout) => {
      const expectedText = serializeExpectedTextValues(expected, { normalizeWhiteSpace: true, ignoreCase: options.ignoreCase });
      return await locator._expect("to.have.text.array", { expectedText, isNot, useInnerText: options?.useInnerText, timeout });
    }, expected, options);
  } else {
    return toMatchText.call(this, "toHaveText", locator, "Locator", async (isNot, timeout) => {
      const expectedText = serializeExpectedTextValues([expected], { normalizeWhiteSpace: true, ignoreCase: options.ignoreCase });
      return await locator._expect("to.have.text", { expectedText, isNot, useInnerText: options?.useInnerText, timeout });
    }, expected, options);
  }
}
function toHaveValue(locator, expected, options) {
  return toMatchText.call(this, "toHaveValue", locator, "Locator", async (isNot, timeout) => {
    const expectedText = serializeExpectedTextValues([expected]);
    return await locator._expect("to.have.value", { expectedText, isNot, timeout });
  }, expected, options);
}
function toHaveValues(locator, expected, options) {
  return toEqual.call(this, "toHaveValues", locator, "Locator", async (isNot, timeout) => {
    const expectedText = serializeExpectedTextValues(expected);
    return await locator._expect("to.have.values", { expectedText, isNot, timeout });
  }, expected, options);
}
function toHaveTitle(page, expected, options = {}) {
  return toMatchText.call(this, "toHaveTitle", page, "Page", async (isNot, timeout) => {
    const expectedText = serializeExpectedTextValues([expected], { normalizeWhiteSpace: true });
    return await page.mainFrame()._expect("to.have.title", { expectedText, isNot, timeout });
  }, expected, options);
}
function toHaveURL(page, expected, options) {
  if (isURLPattern(expected))
    return toHaveURLWithPredicate.call(this, page, (url) => expected.test(url.href), options);
  if (typeof expected === "function")
    return toHaveURLWithPredicate.call(this, page, expected, options);
  const baseURL = page.context()._options.baseURL;
  expected = typeof expected === "string" ? constructURLBasedOnBaseURL(baseURL, expected) : expected;
  return toMatchText.call(this, "toHaveURL", page, "Page", async (isNot, timeout) => {
    const expectedText = serializeExpectedTextValues([expected], { ignoreCase: options?.ignoreCase });
    return await page.mainFrame()._expect("to.have.url", { expectedText, isNot, timeout });
  }, expected, options);
}
async function toBeOK(response) {
  const matcherName = "toBeOK";
  expectTypes(response, ["APIResponse"], matcherName);
  const contentType = response.headers()["content-type"];
  const isTextEncoding = contentType && isTextualMimeType(contentType);
  const [log, text] = this.isNot === response.ok() ? await Promise.all([
    response._fetchLog(),
    isTextEncoding ? response.text() : null
  ]) : [];
  const message = () => formatMatcherMessage(this.utils, {
    isNot: this.isNot,
    promise: this.promise,
    matcherName,
    receiver: "response",
    expectation: "",
    log
  }) + (text === null ? "" : `
Response text:
${colors2.dim(text?.substring(0, 1e3) || "")}`);
  const pass = response.ok();
  return { message, pass };
}
async function toPass(callback, options = {}) {
  const testInfo = expectConfig().testInfo;
  const timeout = options.timeout ?? expectConfig().toPass?.timeout ?? 0;
  const intervals = options.intervals ?? expectConfig().toPass?.intervals ?? [100, 250, 500, 1e3];
  const { deadline, timeoutMessage } = deadlineForMatcher(testInfo, timeout);
  const result = await pollAgainstDeadline(async () => {
    if (testInfo && expectConfig().testInfo !== testInfo)
      return { continuePolling: false, result: void 0 };
    try {
      await callback();
      return { continuePolling: !!this.isNot, result: void 0 };
    } catch (e) {
      return { continuePolling: !this.isNot, result: e };
    }
  }, deadline, intervals);
  if (result.timedOut) {
    const message = result.result ? [
      result.result.message,
      "",
      `Call Log:`,
      `- ${timeoutMessage}`
    ].join("\n") : timeoutMessage;
    return { message: () => message, pass: !!this.isNot };
  }
  return { pass: !this.isNot, message: () => "" };
}
function computeMatcherTitleSuffix(matcherName, receiver, args) {
  if (matcherName === "toHaveScreenshot") {
    const title = toHaveScreenshotStepTitle(...args);
    return { short: title ? `(${title})` : "" };
  }
  if (receiver && typeof receiver === "object" && receiver._apiName === "Locator") {
    try {
      return { long: " " + asLocatorDescription("javascript", receiver._selector) };
    } catch {
    }
  }
  return {};
}
function deadlineForMatcher(testInfo, timeout) {
  const startTime = monotonicTime();
  const matcherDeadline = timeout ? startTime + timeout : 0;
  const matcherMessage = `Timeout ${timeout}ms exceeded while waiting on the predicate`;
  if (!testInfo)
    return { deadline: matcherDeadline, timeoutMessage: matcherMessage };
  const { deadline: testDeadline, timeout: testTimeout } = testInfo._deadline();
  const effectiveTestDeadline = testDeadline - 250;
  const testMessage = `Test timeout of ${testTimeout}ms exceeded`;
  if (!matcherDeadline)
    return { deadline: effectiveTestDeadline, timeoutMessage: testMessage };
  return { deadline: Math.min(effectiveTestDeadline, matcherDeadline), timeoutMessage: effectiveTestDeadline < matcherDeadline ? testMessage : matcherMessage };
}

// packages/playwright/src/matchers/toMatchAriaSnapshot.ts
var import_fs2 = __toESM(require("fs"));
var import_path2 = __toESM(require("path"));
var { escapeTemplateString, isString: isString3 } = require("playwright-core/lib/coreBundle").iso;
var { existsAsync } = require("playwright-core/lib/coreBundle").utils;
var kImpossibleAriaMatch = `- none "Generating new baseline"`;
async function toMatchAriaSnapshot(receiver, expectedParam, options = {}) {
  const matcherName = "toMatchAriaSnapshot";
  expectTypes(receiver, ["Page", "Locator"], matcherName);
  const locator = receiver._apiName === "Page" ? void 0 : receiver;
  const testInfo = expectConfig().testInfo;
  if (!testInfo)
    throw new Error(`${matcherName}() must be called during the test`);
  if (expectConfig().ignoreSnapshots)
    return { pass: !this.isNot, message: () => "", name: "toMatchAriaSnapshot", expected: "" };
  const updateSnapshots = expectConfig().updateSnapshots;
  let expected;
  let timeout;
  let expectedPath;
  if (isString3(expectedParam)) {
    expected = expectedParam;
    timeout = options.timeout ?? this.timeout;
  } else {
    const legacyPath = testInfo._resolveSnapshotPaths("aria", expectedParam?.name, "dontUpdateSnapshotIndex", ".yml").absoluteSnapshotPath;
    expectedPath = testInfo._resolveSnapshotPaths("aria", expectedParam?.name, "updateSnapshotIndex").absoluteSnapshotPath;
    if (!await existsAsync(expectedPath) && await existsAsync(legacyPath))
      expectedPath = legacyPath;
    expected = await import_fs2.default.promises.readFile(expectedPath, "utf8").catch(() => "");
    timeout = expectedParam?.timeout ?? this.timeout;
  }
  const isMissingBaseline = updateSnapshots === "missing" && !expected;
  if (isMissingBaseline && this.isNot) {
    const message2 = `Matchers using ".not" can't generate new baselines`;
    return { pass: this.isNot, message: () => message2, name: "toMatchAriaSnapshot" };
  }
  const generateBaseline = !this.isNot && (updateSnapshots === "all" || isMissingBaseline);
  if (generateBaseline) {
    expected = kImpossibleAriaMatch;
  }
  expected = unshift(expected);
  const globalChildren = expectConfig().toMatchAriaSnapshot?.children;
  if (globalChildren && !expected.match(/^- \/children:/m))
    expected = `- /children: ${globalChildren}
` + expected;
  const expectParams = { expectedValue: expected, isNot: this.isNot, timeout };
  const { matches: pass, received, log, timedOut, errorMessage } = locator ? await locator._expect("to.match.aria", expectParams) : await receiver.mainFrame()._expect("to.match.aria", expectParams);
  const typedReceived = received?.value;
  const message = () => {
    let printedExpected;
    let printedReceived;
    let printedDiff;
    if (errorMessage) {
      printedExpected = `Expected: ${this.isNot ? "not " : ""}${this.utils.printExpected(expected)}`;
    } else if (pass) {
      const receivedString = printReceivedStringContainExpectedSubstring2(this.utils, typedReceived.raw, typedReceived.raw.indexOf(expected), expected.length);
      printedExpected = `Expected: not ${this.utils.printExpected(expected)}`;
      printedReceived = `Received: ${receivedString}`;
    } else {
      printedDiff = this.utils.printDiffOrStringify(expected, typedReceived.raw, "Expected", "Received", false);
    }
    return formatMatcherMessage(this.utils, {
      isNot: this.isNot,
      promise: this.promise,
      matcherName,
      expectation: "expected",
      locator: locator?.toString(),
      timeout,
      timedOut,
      printedExpected,
      printedReceived,
      printedDiff,
      errorMessage,
      log
    });
  };
  if (errorMessage)
    return { pass: this.isNot, message, name: "toMatchAriaSnapshot", expected };
  if (!this.isNot) {
    if (generateBaseline || updateSnapshots === "changed" && pass === this.isNot) {
      if (expectedPath) {
        await import_fs2.default.promises.mkdir(import_path2.default.dirname(expectedPath), { recursive: true });
        await import_fs2.default.promises.writeFile(expectedPath, typedReceived.regex, "utf8");
        const relativePath = import_path2.default.relative(process.cwd(), expectedPath);
        if (isMissingBaseline) {
          const message3 = `A snapshot doesn't exist at ${relativePath}, writing actual.`;
          return { pass: true, message: () => "", name: "toMatchAriaSnapshot", softError: new Error(message3), shouldNotRetryTest: true };
        }
        const message2 = `A snapshot is generated at ${relativePath}.`;
        console.log(message2);
        return { pass: true, message: () => "", name: "toMatchAriaSnapshot" };
      } else {
        const suggestedRebaseline = `\`
${escapeTemplateString(indent2(typedReceived.regex, "{indent}  "))}
{indent}\``;
        if (isMissingBaseline) {
          const message2 = "A snapshot is not provided, generating new baseline.";
          return { pass: true, message: () => "", name: "toMatchAriaSnapshot", suggestedRebaseline, softError: new Error(message2), shouldNotRetryTest: true };
        }
        return { pass: true, message: () => "", name: "toMatchAriaSnapshot", suggestedRebaseline };
      }
    }
  }
  return {
    name: matcherName,
    expected,
    message,
    pass,
    actual: typedReceived?.raw,
    log,
    timeout: timedOut ? timeout : void 0
  };
}
function unshift(snapshot) {
  const lines = snapshot.split("\n");
  let whitespacePrefixLength = 100;
  for (const line of lines) {
    if (!line.trim())
      continue;
    const match = line.match(/^(\s*)/);
    if (match && match[1].length < whitespacePrefixLength)
      whitespacePrefixLength = match[1].length;
  }
  return lines.filter((t) => t.trim()).map((line) => line.substring(whitespacePrefixLength)).join("\n");
}
function indent2(snapshot, indent3) {
  return snapshot.split("\n").map((line) => indent3 + line).join("\n");
}

// packages/playwright/src/matchers/expect.ts
var { parseStackFrame, captureRawStack } = require("playwright-core/lib/coreBundle").iso;
var { escapeWithQuotes, isString: isString4 } = require("playwright-core/lib/coreBundle").iso;
var { pollAgainstDeadline: pollAgainstDeadline2 } = require("playwright-core/lib/coreBundle").iso;
var { currentZone } = require("playwright-core/lib/coreBundle").utils;
function unfilteredStackTrace(rawStack) {
  return rawStack.map((frame) => parseStackFrame(frame, import_path3.default.sep, !!process.env.PWDEBUGIMPL)).filter((f) => !!f);
}
var _expectConfig = { testInfo: null, filteredStackTrace: unfilteredStackTrace, ignoreSnapshots: false, updateSnapshots: "missing" };
function setExpectConfig(config) {
  _expectConfig = config;
}
function expectConfig() {
  return _expectConfig;
}
var META_INFO = Symbol("expectMetaInfo");
var defaultExpectTimeout = 5e3;
function throwUnsupportedExpectMatcherError() {
  throw new Error("It looks like you are using custom expect matchers that are not compatible with Playwright. See https://aka.ms/playwright/expect-compatibility");
}
var customAsyncMatchers = {
  toBeAttached,
  toBeChecked,
  toBeDisabled,
  toBeEditable,
  toBeEmpty,
  toBeEnabled,
  toBeFocused,
  toBeHidden,
  toBeInViewport,
  toBeOK,
  toBeVisible,
  toContainText,
  toContainClass,
  toHaveAccessibleDescription,
  toHaveAccessibleName,
  toHaveAccessibleErrorMessage,
  toHaveAttribute,
  toHaveClass,
  toHaveCount,
  toHaveCSS,
  toHaveId,
  toHaveJSProperty,
  toHaveRole,
  toHaveText,
  toHaveTitle,
  toHaveURL,
  toHaveValue,
  toHaveValues,
  toHaveScreenshot,
  toMatchAriaSnapshot,
  toPass
};
var allBuiltinMatchers = {
  ...matchers,
  toThrow: createThrowMatcher("toThrow"),
  toThrowError: createThrowMatcher("toThrowError"),
  ...customAsyncMatchers,
  toMatchSnapshot
};
var promiseThrowMatchers = {
  toThrow: createThrowMatcher("toThrow", true),
  toThrowError: createThrowMatcher("toThrowError", true)
};
function createExpect(info) {
  const expectFn = (actual, messageOrOptions) => createMatchers(actual, info, messageOrOptions);
  Object.defineProperty(expectFn, META_INFO, { value: info });
  expectFn.any = any;
  expectFn.anything = anything;
  expectFn.arrayContaining = arrayContaining;
  expectFn.arrayOf = arrayOf;
  expectFn.closeTo = closeTo;
  expectFn.objectContaining = objectContaining;
  expectFn.stringContaining = stringContaining;
  expectFn.stringMatching = stringMatching;
  const notAsymmetric = {
    arrayContaining: arrayNotContaining,
    arrayOf: notArrayOf,
    closeTo: notCloseTo,
    objectContaining: objectNotContaining,
    stringContaining: stringNotContaining,
    stringMatching: stringNotMatching
  };
  expectFn.not = notAsymmetric;
  for (const [name, matcher] of Object.entries(info.userMatchers)) {
    const { positive, inverse } = buildCustomAsymmetricMatcher(name, matcher);
    expectFn[name] = positive;
    notAsymmetric[name] = inverse;
  }
  expectFn.getState = () => ({});
  expectFn.configure = (configuration) => {
    const newInfo = { ...info };
    if ("message" in configuration)
      newInfo.message = configuration.message;
    if ("timeout" in configuration)
      newInfo.timeout = configuration.timeout;
    if ("soft" in configuration)
      newInfo.isSoft = configuration.soft;
    return createExpect(newInfo);
  };
  Object.defineProperty(expectFn, "soft", {
    configurable: true,
    enumerable: true,
    get: () => info.isSoft ? expectFn : createExpect({ ...info, isSoft: true })
  });
  expectFn.poll = (actual, messageOrOptions) => {
    const poll = isString4(messageOrOptions) ? {} : messageOrOptions || {};
    return createMatchers(actual, { ...info, poll: { timeout: poll.timeout, intervals: poll.intervals } }, messageOrOptions);
  };
  expectFn.extend = (matchers2) => {
    for (const [name, m] of Object.entries(matchers2)) {
      if (typeof m !== "function")
        throw new TypeError(`expect.extend: \`${name}\` is not a valid matcher. Must be a function, is "${typeof m}"`);
    }
    for (const [name, matcher] of Object.entries(matchers2)) {
      if (name in allBuiltinMatchers)
        continue;
      info.userMatchers[name] = matcher;
      const { positive, inverse } = buildCustomAsymmetricMatcher(name, matcher);
      expectFn[name] = positive;
      notAsymmetric[name] = inverse;
    }
    return createExpect({
      ...info,
      userMatchers: { ...info.userMatchers, ...matchers2 }
    });
  };
  return expectFn;
}
function createMatchers(actual, originalInfo, messageOrOptions) {
  const message = isString4(messageOrOptions) ? messageOrOptions : messageOrOptions?.message || originalInfo.message;
  const info = { ...originalInfo, message };
  const result = { not: {}, resolves: { not: {} }, rejects: { not: {} } };
  const notInfo = { ...info, isNot: !info.isNot };
  for (const [name, matcher] of Object.entries({ ...allBuiltinMatchers, ...info.userMatchers })) {
    result[name] = createMatcher(name, info, actual, matcher);
    result.not[name] = createMatcher(name, notInfo, actual, matcher);
    const promiseMatcher = promiseThrowMatchers[name] ?? matcher;
    result.resolves[name] = createMatcher(name, info, actual, promiseMatcher, "resolves");
    result.resolves.not[name] = createMatcher(name, notInfo, actual, promiseMatcher, "resolves");
    result.rejects[name] = createMatcher(name, info, actual, promiseMatcher, "rejects");
    result.rejects.not[name] = createMatcher(name, notInfo, actual, promiseMatcher, "rejects");
  }
  return result;
}
function createMatcher(matcherName, info, actual, matcher, promise) {
  return (...args) => callMatcherAsStep(matcherName, info, actual, matcher, args, promise);
}
function callMatcherAsStep(matcherName, info, actual, matcher, args, promise) {
  const testInfo = expectConfig().testInfo;
  const customMessage = info.message || "";
  const suffixes = computeMatcherTitleSuffix(matcherName, actual, args);
  const defaultTitle = `${info.poll ? "poll " : ""}${info.isSoft ? "soft " : ""}${info.isNot ? "not " : ""}${matcherName}${suffixes.short || ""}`;
  const shortTitle = customMessage || `Expect ${escapeWithQuotes(defaultTitle, '"')}`;
  const longTitle = shortTitle + (suffixes.long || "");
  const apiName = `expect${info.poll ? ".poll " : ""}${info.isSoft ? ".soft " : ""}${info.isNot ? ".not" : ""}.${matcherName}${suffixes.short || ""}`;
  const stackFrames = expectConfig().filteredStackTrace(captureRawStack());
  const stepData = {
    category: "expect",
    apiName,
    title: longTitle,
    shortTitle,
    params: args[0] ? { expected: args[0] } : void 0
  };
  const step = testInfo?._addStep(stepData);
  const handleError = (error, result) => {
    if (info.isSoft && step) {
      step.complete({ ...result, error, softError: error });
    } else {
      step?.complete({ ...result, error });
      throw error;
    }
  };
  const finalizer = (result) => {
    validateMatcherResult(result);
    if (result.pass === !!info.isNot) {
      const error = new ExpectError({ ...result, name: matcherName, message: getMessage(result.message) }, customMessage, stackFrames);
      handleError(error, result);
    } else {
      step?.complete(result);
    }
  };
  try {
    const invoke = () => info.poll ? invokePollMatcher(matcherName, info, matcher, actual, args, promise) : invokeMatcher(matcherName, info, matcher, actual, args, promise);
    const result = step ? currentZone().with("stepZone", step).run(invoke) : invoke();
    if (result instanceof Promise)
      return result.then(finalizer, handleError);
    finalizer(result);
  } catch (error) {
    handleError(error);
  }
}
function invokeMatcher(matcherName, info, matcher, actual, args, promise) {
  const isNot = !!info.isNot;
  const timeout = info.timeout ?? expectConfig().timeout ?? defaultExpectTimeout;
  const matcherContext = {
    customTesters: [],
    isNot,
    promise: promise ?? "",
    utils,
    timeout,
    equals: throwUnsupportedExpectMatcherError
  };
  if (!promise)
    return matcher.call(matcherContext, actual, ...args);
  if (typeof actual === "function")
    actual = actual();
  if (!isPromise(actual))
    return { pass: false, message: createExpectedPromiseMessage(matcherName, isNot, promise, actual) };
  if (promise === "resolves") {
    return actual.then(
      (result) => matcher.call(matcherContext, result, ...args),
      (error) => ({ pass: false, message: createExpectedToResolveMessage(matcherName, isNot, promise, error) })
    );
  } else {
    return actual.then(
      (result) => ({ pass: false, message: createExpectedToRejectMessage(matcherName, isNot, promise, result) }),
      (error) => matcher.call(matcherContext, error, ...args)
    );
  }
}
async function invokePollMatcher(matcherName, info, matcher, actual, args, promise) {
  if (typeof actual !== "function")
    throw new Error("`expect.poll()` accepts only function as a first argument");
  if (promise || customAsyncMatchers[matcherName])
    throw new Error(`\`expect.poll()\` does not support "${promise ?? matcherName}" matcher.`);
  const testInfo = expectConfig().testInfo;
  const poll = info.poll;
  const timeout = poll.timeout ?? info.timeout ?? expectConfig().timeout ?? defaultExpectTimeout;
  const { deadline, timeoutMessage } = deadlineForMatcher(testInfo, timeout);
  const result = await pollAgainstDeadline2(async () => {
    if (testInfo && expectConfig().testInfo !== testInfo)
      return { continuePolling: false, result: void 0 };
    const value = await actual();
    try {
      await callMatcherAsStep(matcherName, { ...info, poll: void 0, isSoft: false }, value, matcher, args);
      return { continuePolling: false, result: void 0 };
    } catch (error) {
      return { continuePolling: true, result: error };
    }
  }, deadline, poll.intervals ?? [100, 250, 500, 1e3]);
  if (result.timedOut) {
    const message = result.result ? [
      result.result.message,
      "",
      `Call Log:`,
      `- ${timeoutMessage}`
    ].join("\n") : timeoutMessage;
    return { pass: !!info.isNot, message: () => message };
  }
  return { pass: !info.isNot, message: () => "" };
}
var expect = createExpect({ userMatchers: {} });
function mergeExpects(...expects) {
  let merged = expect;
  for (const e of expects) {
    const info = e[META_INFO];
    if (!info)
      continue;
    merged = merged.extend(info.userMatchers);
  }
  return merged;
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  expect,
  expectConfig,
  mergeExpects,
  setExpectConfig
});
/*! Bundled license information:

@jest/get-type/build/index.js:
@jest/expect-utils/build/index.js:
pretty-format/build/index.js:
@jest/diff-sequences/build/index.js:
jest-diff/build/index.js:
jest-matcher-utils/build/index.js:
jest-message-util/build/index.js:
  (*!
   * /**
   *  * Copyright (c) Meta Platforms, Inc. and affiliates.
   *  *
   *  * This source code is licensed under the MIT license found in the
   *  * LICENSE file in the root directory of this source tree.
   *  * /
   *)

react-is/cjs/react-is.production.min.js:
  (**
   * @license React
   * react-is.production.min.js
   *
   * Copyright (c) Facebook, Inc. and its affiliates.
   *
   * This source code is licensed under the MIT license found in the
   * LICENSE file in the root directory of this source tree.
   *)

react-is/cjs/react-is.development.js:
  (**
   * @license React
   * react-is.development.js
   *
   * Copyright (c) Facebook, Inc. and its affiliates.
   *
   * This source code is licensed under the MIT license found in the
   * LICENSE file in the root directory of this source tree.
   *)

is-number/index.js:
  (*!
   * is-number <https://github.com/jonschlinkert/is-number>
   *
   * Copyright (c) 2014-present, Jon Schlinkert.
   * Released under the MIT License.
   *)

to-regex-range/index.js:
  (*!
   * to-regex-range <https://github.com/micromatch/to-regex-range>
   *
   * Copyright (c) 2015-present, Jon Schlinkert.
   * Released under the MIT License.
   *)

fill-range/index.js:
  (*!
   * fill-range <https://github.com/jonschlinkert/fill-range>
   *
   * Copyright (c) 2014-present, Jon Schlinkert.
   * Licensed under the MIT License.
   *)
*/
packages/playwright/lib/matchers/expect.js

THIRD-PARTY SOFTWARE NOTICES AND INFORMATION

The following npm packages are inlined into this bundle.

- @babel/code-frame@7.29.0 (https://github.com/babel/babel)
- @babel/helper-validator-identifier@7.28.5 (https://github.com/babel/babel)
- @jest/diff-sequences@30.0.1 (https://github.com/jestjs/jest)
- @jest/expect-utils@30.2.0 (https://github.com/jestjs/jest)
- @jest/get-type@30.1.0 (https://github.com/jestjs/jest)
- ansi-styles@4.3.0 (https://github.com/chalk/ansi-styles)
- ansi-styles@5.2.0 (https://github.com/chalk/ansi-styles)
- braces@3.0.3 (https://github.com/micromatch/braces)
- chalk@4.1.2 (https://github.com/chalk/chalk)
- color-convert@2.0.1 (https://github.com/Qix-/color-convert)
- color-name@1.1.4 (https://github.com/colorjs/color-name)
- escape-string-regexp@2.0.0 (https://github.com/sindresorhus/escape-string-regexp)
- fill-range@7.1.1 (https://github.com/jonschlinkert/fill-range)
- graceful-fs@4.2.11 (https://github.com/isaacs/node-graceful-fs)
- has-flag@4.0.0 (https://github.com/sindresorhus/has-flag)
- is-number@7.0.0 (https://github.com/jonschlinkert/is-number)
- jest-diff@30.2.0 (https://github.com/jestjs/jest)
- jest-matcher-utils@30.2.0 (https://github.com/jestjs/jest)
- jest-message-util@30.2.0 (https://github.com/jestjs/jest)
- js-tokens@4.0.0 (https://github.com/lydell/js-tokens)
- micromatch@4.0.8 (https://github.com/micromatch/micromatch)
- picocolors@1.1.1 (https://github.com/alexeyraspopov/picocolors)
- picomatch@2.3.2 (https://github.com/micromatch/picomatch)
- pretty-format@30.2.0 (https://github.com/jestjs/jest)
- react-is@18.3.1 (https://github.com/facebook/react)
- slash@3.0.0 (https://github.com/sindresorhus/slash)
- stack-utils@2.0.6 (https://github.com/tapjs/stack-utils)
- supports-color@7.2.0 (https://github.com/chalk/supports-color)
- to-regex-range@5.0.1 (https://github.com/micromatch/to-regex-range)

%% @babel/code-frame@7.29.0 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License

Copyright (c) 2014-present Sebastian McKenzie and other contributors

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF @babel/code-frame@7.29.0 NOTICES AND INFORMATION

%% @babel/helper-validator-identifier@7.28.5 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License

Copyright (c) 2014-present Sebastian McKenzie and other contributors

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF @babel/helper-validator-identifier@7.28.5 NOTICES AND INFORMATION

%% @jest/diff-sequences@30.0.1 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License

Copyright (c) Meta Platforms, Inc. and affiliates.
Copyright Contributors to the Jest project.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
=========================================
END OF @jest/diff-sequences@30.0.1 NOTICES AND INFORMATION

%% @jest/expect-utils@30.2.0 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License

Copyright (c) Meta Platforms, Inc. and affiliates.
Copyright Contributors to the Jest project.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
=========================================
END OF @jest/expect-utils@30.2.0 NOTICES AND INFORMATION

%% @jest/get-type@30.1.0 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License

Copyright (c) Meta Platforms, Inc. and affiliates.
Copyright Contributors to the Jest project.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
=========================================
END OF @jest/get-type@30.1.0 NOTICES AND INFORMATION

%% ansi-styles@4.3.0 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License

Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF ansi-styles@4.3.0 NOTICES AND INFORMATION

%% ansi-styles@5.2.0 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License

Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF ansi-styles@5.2.0 NOTICES AND INFORMATION

%% braces@3.0.3 NOTICES AND INFORMATION BEGIN HERE
=========================================
The MIT License (MIT)

Copyright (c) 2014-present, Jon Schlinkert.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
=========================================
END OF braces@3.0.3 NOTICES AND INFORMATION

%% chalk@4.1.2 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License

Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF chalk@4.1.2 NOTICES AND INFORMATION

%% color-convert@2.0.1 NOTICES AND INFORMATION BEGIN HERE
=========================================
Copyright (c) 2011-2016 Heather Arthur <fayearthur@gmail.com>

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF color-convert@2.0.1 NOTICES AND INFORMATION

%% color-name@1.1.4 NOTICES AND INFORMATION BEGIN HERE
=========================================
The MIT License (MIT)
Copyright (c) 2015 Dmitry Ivanov

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF color-name@1.1.4 NOTICES AND INFORMATION

%% escape-string-regexp@2.0.0 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License

Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF escape-string-regexp@2.0.0 NOTICES AND INFORMATION

%% fill-range@7.1.1 NOTICES AND INFORMATION BEGIN HERE
=========================================
The MIT License (MIT)

Copyright (c) 2014-present, Jon Schlinkert.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
=========================================
END OF fill-range@7.1.1 NOTICES AND INFORMATION

%% graceful-fs@4.2.11 NOTICES AND INFORMATION BEGIN HERE
=========================================
The ISC License

Copyright (c) 2011-2022 Isaac Z. Schlueter, Ben Noordhuis, and Contributors

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
=========================================
END OF graceful-fs@4.2.11 NOTICES AND INFORMATION

%% has-flag@4.0.0 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License

Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF has-flag@4.0.0 NOTICES AND INFORMATION

%% is-number@7.0.0 NOTICES AND INFORMATION BEGIN HERE
=========================================
The MIT License (MIT)

Copyright (c) 2014-present, Jon Schlinkert.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
=========================================
END OF is-number@7.0.0 NOTICES AND INFORMATION

%% jest-diff@30.2.0 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License

Copyright (c) Meta Platforms, Inc. and affiliates.
Copyright Contributors to the Jest project.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
=========================================
END OF jest-diff@30.2.0 NOTICES AND INFORMATION

%% jest-matcher-utils@30.2.0 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License

Copyright (c) Meta Platforms, Inc. and affiliates.
Copyright Contributors to the Jest project.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
=========================================
END OF jest-matcher-utils@30.2.0 NOTICES AND INFORMATION

%% jest-message-util@30.2.0 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License

Copyright (c) Meta Platforms, Inc. and affiliates.
Copyright Contributors to the Jest project.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
=========================================
END OF jest-message-util@30.2.0 NOTICES AND INFORMATION

%% js-tokens@4.0.0 NOTICES AND INFORMATION BEGIN HERE
=========================================
The MIT License (MIT)

Copyright (c) 2014, 2015, 2016, 2017, 2018 Simon Lydell

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
=========================================
END OF js-tokens@4.0.0 NOTICES AND INFORMATION

%% micromatch@4.0.8 NOTICES AND INFORMATION BEGIN HERE
=========================================
The MIT License (MIT)

Copyright (c) 2014-present, Jon Schlinkert.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
=========================================
END OF micromatch@4.0.8 NOTICES AND INFORMATION

%% picocolors@1.1.1 NOTICES AND INFORMATION BEGIN HERE
=========================================
ISC License

Copyright (c) 2021-2024 Oleksii Raspopov, Kostiantyn Denysov, Anton Verinov

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
=========================================
END OF picocolors@1.1.1 NOTICES AND INFORMATION

%% picomatch@2.3.2 NOTICES AND INFORMATION BEGIN HERE
=========================================
The MIT License (MIT)

Copyright (c) 2017-present, Jon Schlinkert.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
=========================================
END OF picomatch@2.3.2 NOTICES AND INFORMATION

%% pretty-format@30.2.0 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License

Copyright (c) Meta Platforms, Inc. and affiliates.
Copyright Contributors to the Jest project.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
=========================================
END OF pretty-format@30.2.0 NOTICES AND INFORMATION

%% react-is@18.3.1 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License

Copyright (c) Facebook, Inc. and its affiliates.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
=========================================
END OF react-is@18.3.1 NOTICES AND INFORMATION

%% slash@3.0.0 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License

Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF slash@3.0.0 NOTICES AND INFORMATION

%% stack-utils@2.0.6 NOTICES AND INFORMATION BEGIN HERE
=========================================
The MIT License (MIT)

Copyright (c) 2016-2022 Isaac Z. Schlueter <i@izs.me>, James Talmage <james@talmage.io> (github.com/jamestalmage), and Contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
=========================================
END OF stack-utils@2.0.6 NOTICES AND INFORMATION

%% supports-color@7.2.0 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License

Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF supports-color@7.2.0 NOTICES AND INFORMATION

%% to-regex-range@5.0.1 NOTICES AND INFORMATION BEGIN HERE
=========================================
The MIT License (MIT)

Copyright (c) 2015-present, Jon Schlinkert.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
=========================================
END OF to-regex-range@5.0.1 NOTICES AND INFORMATION

SUMMARY
=========================================
Total Packages: 29
=========================================# packages/playwright/lib/matchers/expect.js
# total: 513.9 KB

## Inlined (64)
   7.9 KB  node_modules/@babel/code-frame/lib/index.js
  12.6 KB  node_modules/@babel/helper-validator-identifier/lib/identifier.js
   1.6 KB  node_modules/@babel/helper-validator-identifier/lib/index.js
   1.7 KB  node_modules/@babel/helper-validator-identifier/lib/keyword.js
  15.9 KB  node_modules/@jest/diff-sequences/build/index.js
  24.9 KB  node_modules/@jest/expect-utils/build/index.js
   0.8 KB  node_modules/@jest/expect-utils/build/index.mjs
   1.8 KB  node_modules/@jest/get-type/build/index.js
   4.8 KB  node_modules/ansi-styles/index.js
   1.9 KB  node_modules/braces/index.js
   1.7 KB  node_modules/braces/lib/compile.js
   2.1 KB  node_modules/braces/lib/constants.js
   3.1 KB  node_modules/braces/lib/expand.js
   7.0 KB  node_modules/braces/lib/parse.js
   0.9 KB  node_modules/braces/lib/stringify.js
   2.4 KB  node_modules/braces/lib/utils.js
   3.1 KB  node_modules/chalk/node_modules/supports-color/index.js
   5.8 KB  node_modules/chalk/source/index.js
   3.9 KB  node_modules/chalk/source/templates.js
   1.3 KB  node_modules/chalk/source/util.js
  18.7 KB  node_modules/color-convert/conversions.js
   1.8 KB  node_modules/color-convert/index.js
   2.1 KB  node_modules/color-convert/route.js
   5.2 KB  node_modules/color-name/index.js
   6.8 KB  node_modules/fill-range/index.js
   0.4 KB  node_modules/has-flag/index.js
   0.4 KB  node_modules/is-number/index.js
  53.2 KB  node_modules/jest-diff/build/index.js
  25.2 KB  node_modules/jest-matcher-utils/build/index.js
   2.7 KB  node_modules/jest-matcher-utils/build/index.mjs
  15.3 KB  node_modules/jest-message-util/build/index.js
   0.5 KB  node_modules/jest-message-util/build/index.mjs
   0.7 KB  node_modules/jest-message-util/node_modules/graceful-fs/clone.js
  12.2 KB  node_modules/jest-message-util/node_modules/graceful-fs/graceful-fs.js
   3.0 KB  node_modules/jest-message-util/node_modules/graceful-fs/legacy-streams.js
   9.3 KB  node_modules/jest-message-util/node_modules/graceful-fs/polyfills.js
   1.4 KB  node_modules/js-tokens/index.js
   5.8 KB  node_modules/micromatch/index.js
   0.2 KB  node_modules/micromatch/node_modules/picomatch/index.js
   5.3 KB  node_modules/micromatch/node_modules/picomatch/lib/constants.js
  33.9 KB  node_modules/micromatch/node_modules/picomatch/lib/parse.js
   5.3 KB  node_modules/micromatch/node_modules/picomatch/lib/picomatch.js
   9.6 KB  node_modules/micromatch/node_modules/picomatch/lib/scan.js
   2.2 KB  node_modules/micromatch/node_modules/picomatch/lib/utils.js
   3.1 KB  node_modules/picocolors/picocolors.js
  42.7 KB  node_modules/pretty-format/build/index.js
   4.4 KB  node_modules/pretty-format/node_modules/ansi-styles/index.js
   7.7 KB  node_modules/pretty-format/node_modules/react-is/cjs/react-is.development.js
   3.3 KB  node_modules/pretty-format/node_modules/react-is/cjs/react-is.production.min.js
   0.3 KB  node_modules/pretty-format/node_modules/react-is/index.js
   0.4 KB  node_modules/slash/index.js
   7.6 KB  node_modules/stack-utils/index.js
   0.4 KB  node_modules/stack-utils/node_modules/escape-string-regexp/index.js
   6.8 KB  node_modules/to-regex-range/index.js
  10.4 KB  packages/playwright/src/matchers/expect.ts
  45.2 KB  packages/playwright/src/matchers/expectLibrary.ts
   3.3 KB  packages/playwright/src/matchers/matcherHint.ts
  16.0 KB  packages/playwright/src/matchers/matchers.ts
   1.3 KB  packages/playwright/src/matchers/toBeTruthy.ts
   2.1 KB  packages/playwright/src/matchers/toEqual.ts
   2.4 KB  packages/playwright/src/matchers/toHaveURL.ts
   5.7 KB  packages/playwright/src/matchers/toMatchAriaSnapshot.ts
  15.1 KB  packages/playwright/src/matchers/toMatchSnapshot.ts
   3.0 KB  packages/playwright/src/matchers/toMatchText.ts

## External (2)
  playwright-core/lib/coreBundle
  playwright-core/lib/utilsBundle
"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  // If the importer is in node compatibility mode or this is not an ESM
  // file that has been converted to a CommonJS file using a Babel-
  // compatible transform (i.e. "__esModule" has not been set), then set
  // "default" to the CommonJS "module.exports" for node compatibility.
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var browserBackend_exports = {};
__export(browserBackend_exports, {
  createCustomMessageHandler: () => createCustomMessageHandler,
  runDaemonForContext: () => runDaemonForContext
});
module.exports = __toCommonJS(browserBackend_exports);
var import_crypto = __toESM(require("crypto"));
const { stripAnsiEscapes } = require("playwright-core/lib/coreBundle").iso;
function createCustomMessageHandler(testInfo, context) {
  let backend;
  const config = { capabilities: ["testing"] };
  let tools;
  context.once("close", () => {
    void backend?.dispose();
    backend = void 0;
  });
  return async (data) => {
    if (!tools)
      ({ tools } = require("playwright-core/lib/coreBundle"));
    const toolList = tools.filteredTools(config);
    if (data.initialize) {
      if (backend)
        throw new Error("MCP backend is already initialized");
      backend = new tools.BrowserBackend(config, context, toolList);
      await backend.initialize(data.initialize.clientInfo);
      const pausedMessage = await generatePausedMessage(tools, testInfo, context);
      return { initialize: { pausedMessage } };
    }
    if (data.callTool) {
      if (!backend)
        throw new Error("MCP backend is not initialized");
      return { callTool: await backend.callTool(data.callTool.name, data.callTool.arguments) };
    }
    if (data.close) {
      await backend?.dispose();
      backend = void 0;
      return { close: {} };
    }
    throw new Error("Unknown MCP request");
  };
}
async function generatePausedMessage(tools, testInfo, context) {
  const lines = [];
  if (testInfo.errors.length) {
    lines.push(`### Paused on error:`);
    for (const error of testInfo.errors)
      lines.push(stripAnsiEscapes(error.message || ""));
  } else {
    lines.push(`### Paused at end of test. ready for interaction`);
  }
  for (let i = 0; i < context.pages().length; i++) {
    const page = context.pages()[i];
    const stateSuffix = context.pages().length > 1 ? i + 1 + " of " + context.pages().length : "state";
    lines.push(
      "",
      `### Page ${stateSuffix}`,
      `- Page URL: ${page.url()}`,
      `- Page Title: ${await page.title()}`.trim()
    );
    let console2 = testInfo.errors.length ? await tools.Tab.collectConsoleMessages(page) : [];
    console2 = console2.filter((msg) => msg.type === "error");
    if (console2.length) {
      lines.push("- Console Messages:");
      for (const message of console2)
        lines.push(`  - ${message.toString()}`);
    }
    lines.push(
      `- Page Snapshot:`,
      "```yaml",
      await page.ariaSnapshot({ mode: "ai" }),
      "```"
    );
  }
  lines.push("");
  if (testInfo.errors.length)
    lines.push(`### Task`, `Try recovering from the error prior to continuing`);
  return lines.join("\n");
}
async function runDaemonForContext(testInfo, context) {
  if (testInfo._configInternal.configCLIOverrides.debug !== "cli")
    return false;
  const sessionName = `tw-${import_crypto.default.randomBytes(3).toString("hex")}`;
  await context.browser().bind(sessionName, { workspaceDir: testInfo.project.testDir });
  console.log([
    `### The test is currently paused at the start`,
    ``,
    `### Debugging Instructions`,
    `- Run "playwright-cli attach ${sessionName}" to attach to this test`
  ].join("\n"));
  await context.debugger.requestPause();
  return true;
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  createCustomMessageHandler,
  runDaemonForContext
});
"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  // If the importer is in node compatibility mode or this is not an ESM
  // file that has been converted to a CommonJS file using a Babel-
  // compatible transform (i.e. "__esModule" has not been set), then set
  // "default" to the CommonJS "module.exports" for node compatibility.
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var generatorTools_exports = {};
__export(generatorTools_exports, {
  generatorReadLog: () => generatorReadLog,
  generatorWriteTest: () => generatorWriteTest,
  setupPage: () => setupPage
});
module.exports = __toCommonJS(generatorTools_exports);
var import_fs = __toESM(require("fs"));
var import_path = __toESM(require("path"));
var import_testTool = require("./testTool");
var import_testContext = require("./testContext");
const z = require("playwright-core/lib/utilsBundle").z;
const { isPathInside, resolveWithinRoot } = require("playwright-core/lib/coreBundle").utils;
const setupPage = (0, import_testTool.defineTestTool)({
  schema: {
    name: "generator_setup_page",
    title: "Setup generator page",
    description: "Setup the page for test.",
    inputSchema: z.object({
      plan: z.string().describe("The plan for the test. This should be the actual test plan with all the steps."),
      project: z.string().optional().describe('Project to use for setup. For example: "chromium", if no project is provided uses the first project in the config.'),
      seedFile: z.string().optional().describe('A seed file contains a single test that is used to setup the page for testing, for example: "tests/seed.spec.ts". If no seed file is provided, a default seed file is created.')
    }),
    type: "readOnly"
  },
  handle: async (context, params, signal) => {
    const seed = await context.getOrCreateSeedFile(params.seedFile, params.project);
    context.generatorJournal = new import_testContext.GeneratorJournal(context.rootPath, params.plan, seed);
    const { output, status } = await context.runSeedTest(seed.file, seed.projectName, signal);
    return { content: [{ type: "text", text: output }], isError: status !== "paused" };
  }
});
const generatorReadLog = (0, import_testTool.defineTestTool)({
  schema: {
    name: "generator_read_log",
    title: "Retrieve test log",
    description: "Retrieve the performed test log",
    inputSchema: z.object({}),
    type: "readOnly"
  },
  handle: async (context) => {
    if (!context.generatorJournal)
      throw new Error(`Please setup page using "${setupPage.schema.name}" first.`);
    const result = context.generatorJournal.journal();
    return { content: [{
      type: "text",
      text: result
    }] };
  }
});
const generatorWriteTest = (0, import_testTool.defineTestTool)({
  schema: {
    name: "generator_write_test",
    title: "Write test",
    description: "Write the generated test to the test file",
    inputSchema: z.object({
      fileName: z.string().describe("The file to write the test to"),
      code: z.string().describe("The generated test code")
    }),
    type: "readOnly"
  },
  handle: async (context, params) => {
    if (!context.generatorJournal)
      throw new Error(`Please setup page using "${setupPage.schema.name}" first.`);
    const testRunner = context.existingTestRunner();
    if (!testRunner)
      throw new Error("No test runner found, please setup page and perform actions first.");
    const config = await testRunner.loadConfig();
    const resolvedFile = resolveWithinRoot(context.rootPath, params.fileName);
    const dirs = [];
    for (const project of config.projects) {
      const projectTestDir = project.project.testDir;
      if (resolvedFile && isPathInside(projectTestDir, resolvedFile)) {
        await import_fs.default.promises.mkdir(import_path.default.dirname(resolvedFile), { recursive: true });
        await import_fs.default.promises.writeFile(resolvedFile, params.code);
        return {
          content: [{
            type: "text",
            text: `### Result
Test written to ${params.fileName}`
          }]
        };
      }
      dirs.push(import_path.default.relative(context.rootPath, projectTestDir).replace(/\\/g, "/"));
    }
    throw new Error(`Test file did not match any of the test dirs: ${dirs.join(", ")}`);
  }
});
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  generatorReadLog,
  generatorWriteTest,
  setupPage
});
"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  // If the importer is in node compatibility mode or this is not an ESM
  // file that has been converted to a CommonJS file using a Babel-
  // compatible transform (i.e. "__esModule" has not been set), then set
  // "default" to the CommonJS "module.exports" for node compatibility.
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var plannerTools_exports = {};
__export(plannerTools_exports, {
  saveTestPlan: () => saveTestPlan,
  setupPage: () => setupPage,
  submitTestPlan: () => submitTestPlan
});
module.exports = __toCommonJS(plannerTools_exports);
var import_fs = __toESM(require("fs"));
var import_path = __toESM(require("path"));
var import_testTool = require("./testTool");
const z = require("playwright-core/lib/utilsBundle").z;
const { resolveWithinRoot } = require("playwright-core/lib/coreBundle").utils;
const setupPage = (0, import_testTool.defineTestTool)({
  schema: {
    name: "planner_setup_page",
    title: "Setup planner page",
    description: "Setup the page for test planning",
    inputSchema: z.object({
      project: z.string().optional().describe('Project to use for setup. For example: "chromium", if no project is provided uses the first project in the config.'),
      seedFile: z.string().optional().describe('A seed file contains a single test that is used to setup the page for testing, for example: "tests/seed.spec.ts". If no seed file is provided, a default seed file is created.')
    }),
    type: "readOnly"
  },
  handle: async (context, params, signal) => {
    const seed = await context.getOrCreateSeedFile(params.seedFile, params.project);
    const { output, status } = await context.runSeedTest(seed.file, seed.projectName, signal);
    return { content: [{ type: "text", text: output }], isError: status !== "paused" };
  }
});
const planSchema = z.object({
  overview: z.string().describe("A brief overview of the application to be tested"),
  suites: z.array(z.object({
    name: z.string().describe("The name of the suite"),
    seedFile: z.string().describe("A seed file that was used to setup the page for testing."),
    tests: z.array(z.object({
      name: z.string().describe("The name of the test"),
      file: z.string().describe('The file the test should be saved to, for example: "tests/<suite-name>/<test-name>.spec.ts".'),
      steps: z.array(z.object({
        perform: z.string().optional().describe(`Action to perform. For example: 'Click on the "Submit" button'.`),
        expect: z.string().array().describe(`Expected result of the action where appropriate. For example: 'The page should show the "Thank you for your submission" message'`)
      }))
    }))
  }))
});
const submitTestPlan = (0, import_testTool.defineTestTool)({
  schema: {
    name: "planner_submit_plan",
    title: "Submit test plan",
    description: "Submit the test plan to the test planner",
    inputSchema: planSchema,
    type: "readOnly"
  },
  handle: async (context, params) => {
    return {
      content: [{
        type: "text",
        text: JSON.stringify(params, null, 2)
      }]
    };
  }
});
const saveTestPlan = (0, import_testTool.defineTestTool)({
  schema: {
    name: "planner_save_plan",
    title: "Save test plan as markdown file",
    description: "Save the test plan as a markdown file",
    inputSchema: planSchema.extend({
      name: z.string().describe('The name of the test plan, for example: "Test Plan".'),
      fileName: z.string().describe('The file to save the test plan to, for example: "spec/test.plan.md". Relative to the workspace root.')
    }),
    type: "readOnly"
  },
  handle: async (context, params) => {
    const lines = [];
    lines.push(`# ${params.name}`);
    lines.push(``);
    lines.push(`## Application Overview`);
    lines.push(``);
    lines.push(params.overview);
    lines.push(``);
    lines.push(`## Test Scenarios`);
    for (let i = 0; i < params.suites.length; i++) {
      lines.push(``);
      const suite = params.suites[i];
      lines.push(`### ${i + 1}. ${suite.name}`);
      lines.push(``);
      lines.push(`**Seed:** \`${suite.seedFile}\``);
      for (let j = 0; j < suite.tests.length; j++) {
        lines.push(``);
        const test = suite.tests[j];
        lines.push(`#### ${i + 1}.${j + 1}. ${test.name}`);
        lines.push(``);
        lines.push(`**File:** \`${test.file}\``);
        lines.push(``);
        lines.push(`**Steps:**`);
        for (let k = 0; k < test.steps.length; k++) {
          lines.push(`  ${k + 1}. ${test.steps[k].perform ?? "-"}`);
          for (const expect of test.steps[k].expect)
            lines.push(`    - expect: ${expect}`);
        }
      }
    }
    lines.push(``);
    const resolvedFile = resolveWithinRoot(context.rootPath, params.fileName);
    if (!resolvedFile)
      throw new Error(`Plan file name must be a relative path inside the workspace: ${params.fileName}`);
    await import_fs.default.promises.mkdir(import_path.default.dirname(resolvedFile), { recursive: true });
    await import_fs.default.promises.writeFile(resolvedFile, lines.join("\n"));
    return {
      content: [{
        type: "text",
        text: `Test plan saved to ${params.fileName}`
      }]
    };
  }
});
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  saveTestPlan,
  setupPage,
  submitTestPlan
});
"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  // If the importer is in node compatibility mode or this is not an ESM
  // file that has been converted to a CommonJS file using a Babel-
  // compatible transform (i.e. "__esModule" has not been set), then set
  // "default" to the CommonJS "module.exports" for node compatibility.
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var seed_exports = {};
__export(seed_exports, {
  defaultSeedFile: () => defaultSeedFile,
  ensureSeedFile: () => ensureSeedFile,
  findSeedFile: () => findSeedFile,
  seedFileContent: () => seedFileContent,
  seedProject: () => seedProject
});
module.exports = __toCommonJS(seed_exports);
var import_fs = __toESM(require("fs"));
var import_path = __toESM(require("path"));
var import_runner = require("../../runner");
const { mkdirIfNeeded } = require("playwright-core/lib/coreBundle").utils;
function seedProject(fullConfig, projectName) {
  if (!projectName)
    return import_runner.projectUtils.findTopLevelProjects(fullConfig)[0];
  const project = fullConfig.projects.find((p) => p.project.name === projectName);
  if (!project)
    throw new Error(`Project ${projectName} not found`);
  return project;
}
async function findSeedFile(project) {
  const files = await import_runner.projectUtils.collectFilesForProject(project);
  return files.find((file) => import_path.default.basename(file).includes("seed"));
}
function defaultSeedFile(project) {
  const testDir = project.project.testDir;
  return import_path.default.resolve(testDir, "seed.spec.ts");
}
async function ensureSeedFile(project) {
  const seedFile = await findSeedFile(project);
  if (seedFile)
    return seedFile;
  const seedFilePath = defaultSeedFile(project);
  await mkdirIfNeeded(seedFilePath);
  await import_fs.default.promises.writeFile(seedFilePath, seedFileContent);
  return seedFilePath;
}
const seedFileContent = `import { test, expect } from '@playwright/test';

test.describe('Test group', () => {
  test('seed', async ({ page }) => {
    // generate code here.
  });
});
`;
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  defaultSeedFile,
  ensureSeedFile,
  findSeedFile,
  seedFileContent,
  seedProject
});
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var streams_exports = {};
__export(streams_exports, {
  StringWriteStream: () => StringWriteStream
});
module.exports = __toCommonJS(streams_exports);
var import_stream = require("stream");
var import_util = require("../../util");
class StringWriteStream extends import_stream.Writable {
  constructor(output, stdio) {
    super();
    this._output = output;
    this._prefix = stdio === "stdout" ? "" : "[err] ";
  }
  _write(chunk, encoding, callback) {
    let text = (0, import_util.stripAnsiEscapes)(chunk.toString());
    if (text.endsWith("\n"))
      text = text.slice(0, -1);
    if (text)
      this._output.push(this._prefix + text);
    callback();
  }
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  StringWriteStream
});
"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  // If the importer is in node compatibility mode or this is not an ESM
  // file that has been converted to a CommonJS file using a Babel-
  // compatible transform (i.e. "__esModule" has not been set), then set
  // "default" to the CommonJS "module.exports" for node compatibility.
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var testBackend_exports = {};
__export(testBackend_exports, {
  TestServerBackend: () => TestServerBackend,
  testServerBackendTools: () => testServerBackendTools
});
module.exports = __toCommonJS(testBackend_exports);
var import_events = __toESM(require("events"));
var import_coreBundle = require("playwright-core/lib/coreBundle");
var import_testContext = require("./testContext");
var testTools = __toESM(require("./testTools.js"));
var generatorTools = __toESM(require("./generatorTools.js"));
var plannerTools = __toESM(require("./plannerTools.js"));
const zod = require("playwright-core/lib/utilsBundle").z;
const typesWithIntent = ["action", "assertion", "input"];
const testServerBackendTools = [
  plannerTools.saveTestPlan,
  plannerTools.setupPage,
  plannerTools.submitTestPlan,
  generatorTools.setupPage,
  generatorTools.generatorReadLog,
  generatorTools.generatorWriteTest,
  testTools.listTests,
  testTools.runTests,
  testTools.debugTest,
  ...import_coreBundle.tools.browserTools.map((tool) => wrapBrowserTool(tool))
];
class TestServerBackend extends import_events.default {
  constructor(configPath, options) {
    super();
    this.name = "Playwright";
    this.version = "0.0.1";
    this._options = options || {};
    this._configPath = configPath;
  }
  async initialize(clientInfo) {
    this._context = new import_testContext.TestContext(clientInfo, this._configPath, this._options);
  }
  async callTool(name, args, signal) {
    const tool = testServerBackendTools.find((tool2) => tool2.schema.name === name);
    if (!tool)
      throw new Error(`Tool not found: ${name}. Available tools: ${testServerBackendTools.map((tool2) => tool2.schema.name).join(", ")}`);
    try {
      return await tool.handle(this._context, tool.schema.inputSchema.parse(args || {}), signal);
    } catch (e) {
      return { content: [{ type: "text", text: String(e) }], isError: true };
    }
  }
  async dispose() {
    await this._context?.close();
  }
}
function wrapBrowserTool(tool) {
  const inputSchema = typesWithIntent.includes(tool.schema.type) ? tool.schema.inputSchema.extend({
    intent: zod.string().describe("The intent of the call, for example the test step description plan idea")
  }) : tool.schema.inputSchema;
  return {
    schema: {
      ...tool.schema,
      inputSchema
    },
    handle: async (context, params, _signal) => {
      const response = await context.sendMessageToPausedTest({ callTool: { name: tool.schema.name, arguments: params } });
      return response.callTool;
    }
  };
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  TestServerBackend,
  testServerBackendTools
});
"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  // If the importer is in node compatibility mode or this is not an ESM
  // file that has been converted to a CommonJS file using a Babel-
  // compatible transform (i.e. "__esModule" has not been set), then set
  // "default" to the CommonJS "module.exports" for node compatibility.
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var testContext_exports = {};
__export(testContext_exports, {
  GeneratorJournal: () => GeneratorJournal,
  TestContext: () => TestContext,
  createScreen: () => createScreen
});
module.exports = __toCommonJS(testContext_exports);
var import_fs = __toESM(require("fs"));
var import_os = __toESM(require("os"));
var import_path = __toESM(require("path"));
var import_coreBundle = require("playwright-core/lib/coreBundle");
var import_runner = require("../../runner");
var import_streams = require("./streams");
var import_util = require("../../util");
var import_seed = require("./seed");
var import_common = require("../../common");
const debug = require("playwright-core/lib/utilsBundle").debug;
const { noColors } = require("playwright-core/lib/coreBundle").iso;
const { ManualPromise, signalToPromise } = require("playwright-core/lib/coreBundle").iso;
const { escapeRegExp } = require("playwright-core/lib/coreBundle").iso;
const { toPosixPath } = require("playwright-core/lib/coreBundle").utils;
class GeneratorJournal {
  constructor(rootPath, plan, seed) {
    this._rootPath = rootPath;
    this._plan = plan;
    this._seed = seed;
    this._steps = [];
  }
  logStep(title, code) {
    if (title)
      this._steps.push({ title, code });
  }
  journal() {
    const result = [];
    result.push(`# Plan`);
    result.push(this._plan);
    result.push(`# Seed file: ${toPosixPath(import_path.default.relative(this._rootPath, this._seed.file))}`);
    result.push("```ts");
    result.push(this._seed.content);
    result.push("```");
    result.push(`# Steps`);
    result.push(this._steps.map((step) => `### ${step.title}
\`\`\`ts
${step.code}
\`\`\``).join("\n\n"));
    result.push(bestPracticesMarkdown);
    return result.join("\n\n");
  }
}
class TestContext {
  constructor(clientInfo, configPath, options) {
    this._testOpQueue = Promise.resolve();
    this._clientInfo = clientInfo;
    this._configLocation = import_common.configLoader.resolveConfigLocation(configPath || clientInfo.cwd);
    this.rootPath = clientInfo.cwd || this._configLocation.configDir;
    if (options?.headless !== void 0)
      this.computedHeaded = !options.headless;
    else
      this.computedHeaded = !process.env.CI && !(import_os.default.platform() === "linux" && !process.env.DISPLAY);
  }
  async _enqueue(fn) {
    const next = this._testOpQueue.then(fn);
    this._testOpQueue = next.then(() => {
    }, () => {
    });
    return await next;
  }
  existingTestRunner() {
    return this._testRunnerAndScreen?.testRunner;
  }
  async _cleanupTestRunner() {
    if (!this._testRunnerAndScreen)
      return;
    await this._testRunnerAndScreen.testRunner.stopTests();
    this._testRunnerAndScreen.claimStdio();
    try {
      await this._testRunnerAndScreen.testRunner.runGlobalTeardown();
    } finally {
      this._testRunnerAndScreen.releaseStdio();
      this._testRunnerAndScreen = void 0;
    }
  }
  async createTestRunner() {
    await this._cleanupTestRunner();
    const runner = new import_runner.testRunner.TestRunner(this._configLocation, {});
    await runner.initialize({});
    const testPaused = new ManualPromise();
    const testRunnerAndScreen = {
      ...createScreen(),
      testRunner: runner,
      waitForTestPaused: () => testPaused
    };
    this._testRunnerAndScreen = testRunnerAndScreen;
    runner.on(import_runner.testRunner.TestRunnerEvent.TestPaused, (params) => {
      testRunnerAndScreen.sendMessageToPausedTest = params.sendMessage;
      testPaused.resolve();
    });
    return testRunnerAndScreen;
  }
  async getOrCreateSeedFile(seedFile, projectName) {
    const configDir = this._configLocation.configDir;
    const { testRunner: runner } = await this.createTestRunner();
    const config = await runner.loadConfig();
    const project = (0, import_seed.seedProject)(config, projectName);
    if (!seedFile) {
      seedFile = await (0, import_seed.ensureSeedFile)(project);
    } else {
      const candidateFiles = [];
      const testDir = project.project.testDir;
      candidateFiles.push(import_path.default.resolve(testDir, seedFile));
      candidateFiles.push(import_path.default.resolve(configDir, seedFile));
      candidateFiles.push(import_path.default.resolve(this.rootPath, seedFile));
      let resolvedSeedFile;
      for (const candidateFile of candidateFiles) {
        if (await (0, import_util.fileExistsAsync)(candidateFile)) {
          resolvedSeedFile = candidateFile;
          break;
        }
      }
      if (!resolvedSeedFile)
        throw new Error("seed test not found.");
      seedFile = resolvedSeedFile;
    }
    const seedFileContent = await import_fs.default.promises.readFile(seedFile, "utf8");
    return {
      file: seedFile,
      content: seedFileContent,
      projectName: project.project.name
    };
  }
  async runSeedTest(seedFile, projectName, signal) {
    const result = await this.runTestsWithGlobalSetupAndPossiblePause({
      headed: this.computedHeaded,
      locations: ["/" + escapeRegExp(seedFile) + "/"],
      projects: [projectName],
      timeout: 0,
      workers: 1,
      pauseAtEnd: true,
      disableConfigReporters: true,
      failOnLoadErrors: true
    }, signal);
    if (result.status === "passed")
      result.output += "\nError: seed test not found.";
    else if (result.status !== "paused")
      result.output += "\nError while running the seed test.";
    return result;
  }
  async runTestsWithGlobalSetupAndPossiblePause(params, signal) {
    return this._enqueue(() => this._runTestsImpl(params, signal));
  }
  async _runTestsImpl(params, signal) {
    const configDir = this._configLocation.configDir;
    const testRunnerAndScreen = await this.createTestRunner();
    const { testRunner: runner, screen, claimStdio, releaseStdio } = testRunnerAndScreen;
    claimStdio();
    try {
      const setupReporter = new MCPListReporter({ configDir, screen, includeTestId: true });
      const { status: status2 } = await runner.runGlobalSetup([setupReporter]);
      if (status2 !== "passed")
        return { output: testRunnerAndScreen.output.join("\n"), status: status2 };
    } finally {
      releaseStdio();
    }
    let status = "passed";
    const cleanup = async () => {
      claimStdio();
      try {
        const result = await runner.runGlobalTeardown();
        if (status === "passed")
          status = result.status;
      } finally {
        releaseStdio();
      }
    };
    const abort = signal ? signalToPromise(signal) : void 0;
    const abortPromise = abort ? abort.promise.then(() => "interrupted") : new Promise(() => {
    });
    try {
      const reporter = new MCPListReporter({ configDir, screen, includeTestId: true });
      status = await Promise.race([
        runner.runTests(reporter, params).then((result) => result.status),
        testRunnerAndScreen.waitForTestPaused().then(() => "paused"),
        abortPromise
      ]);
      if (status === "interrupted") {
        await runner.stopTests();
        await cleanup();
        return { output: testRunnerAndScreen.output.join("\n"), status };
      }
      if (status === "paused") {
        const response = await testRunnerAndScreen.sendMessageToPausedTest({ request: { initialize: { clientInfo: this._clientInfo } } });
        if (response.error)
          throw new Error(response.error.message);
        testRunnerAndScreen.output.push(response.response.initialize.pausedMessage);
        return { output: testRunnerAndScreen.output.join("\n"), status };
      }
    } catch (e) {
      status = "failed";
      testRunnerAndScreen.output.push(String(e));
      await cleanup();
      return { output: testRunnerAndScreen.output.join("\n"), status };
    } finally {
      abort?.dispose();
    }
    await cleanup();
    return { output: testRunnerAndScreen.output.join("\n"), status };
  }
  async close() {
    await this._enqueue(() => this._cleanupTestRunner()).catch((e) => debug("pw:mcp:error")(e));
  }
  async sendMessageToPausedTest(request) {
    const sendMessage = this._testRunnerAndScreen?.sendMessageToPausedTest;
    if (!sendMessage)
      throw new Error("Must setup test before interacting with the page");
    const result = await sendMessage({ request });
    if (result.error)
      throw new Error(result.error.message);
    if (typeof request?.callTool?.arguments?.["intent"] === "string") {
      const response = import_coreBundle.tools.parseResponse(result.response.callTool);
      if (response && !response.isError && response.code)
        this.generatorJournal?.logStep(request.callTool.arguments["intent"], response.code);
    }
    return result.response;
  }
}
function createScreen() {
  const output = [];
  const stdout = new import_streams.StringWriteStream(output, "stdout");
  const stderr = new import_streams.StringWriteStream(output, "stderr");
  const screen = {
    ...import_runner.base.terminalScreen,
    isTTY: false,
    colors: noColors,
    stdout,
    stderr
  };
  const originalStdoutWrite = process.stdout.write;
  const originalStderrWrite = process.stderr.write;
  const claimStdio = () => {
    process.stdout.write = (chunk) => {
      stdout.write(chunk);
      return true;
    };
    process.stderr.write = (chunk) => {
      stderr.write(chunk);
      return true;
    };
  };
  const releaseStdio = () => {
    process.stdout.write = originalStdoutWrite;
    process.stderr.write = originalStderrWrite;
  };
  return { screen, claimStdio, releaseStdio, output };
}
const bestPracticesMarkdown = `
# Best practices
- Do not improvise, do not add directives that were not asked for
- Use clear, descriptive assertions to validate the expected behavior
- Use reliable locators from this log
- Use local variables for locators that are used multiple times
- Use Playwright waiting assertions and best practices from this log
- NEVER! use page.waitForLoadState()
- NEVER! use page.waitForNavigation()
- NEVER! use page.waitForTimeout()
- NEVER! use page.evaluate()
`;
class MCPListReporter extends import_runner.ListReporter {
  async onTestPaused() {
    await new Promise(() => {
    });
  }
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  GeneratorJournal,
  TestContext,
  createScreen
});
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var testTool_exports = {};
__export(testTool_exports, {
  defineTestTool: () => defineTestTool
});
module.exports = __toCommonJS(testTool_exports);
function defineTestTool(tool) {
  return tool;
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  defineTestTool
});
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var testTools_exports = {};
__export(testTools_exports, {
  debugTest: () => debugTest,
  listTests: () => listTests,
  runTests: () => runTests
});
module.exports = __toCommonJS(testTools_exports);
var import_runner = require("../../runner");
var import_testTool = require("./testTool");
const z = require("playwright-core/lib/utilsBundle").z;
const listTests = (0, import_testTool.defineTestTool)({
  schema: {
    name: "test_list",
    title: "List tests",
    description: "List tests",
    inputSchema: z.object({}),
    type: "readOnly"
  },
  handle: async (context) => {
    const { testRunner, screen, output } = await context.createTestRunner();
    const reporter = new import_runner.ListModeReporter({ screen, includeTestId: true });
    await testRunner.listTests(reporter, {});
    return { content: output.map((text) => ({ type: "text", text })) };
  }
});
const runTests = (0, import_testTool.defineTestTool)({
  schema: {
    name: "test_run",
    title: "Run tests",
    description: "Run tests",
    inputSchema: z.object({
      locations: z.array(z.string()).optional().describe('Folder, file or location to run: "test/e2e" or "test/e2e/file.spec.ts" or "test/e2e/file.spec.ts:20"'),
      projects: z.array(z.string()).optional().describe('Projects to run, projects from playwright.config.ts, by default runs all projects. Running with "chromium" is a good start')
    }),
    type: "readOnly"
  },
  handle: async (context, params, signal) => {
    const { output } = await context.runTestsWithGlobalSetupAndPossiblePause({
      locations: params.locations ?? [],
      projects: params.projects,
      disableConfigReporters: true
    }, signal);
    return { content: [{ type: "text", text: output }] };
  }
});
const debugTest = (0, import_testTool.defineTestTool)({
  schema: {
    name: "test_debug",
    title: "Debug single test",
    description: "Debug single test",
    inputSchema: z.object({
      test: z.object({
        id: z.string().describe("Test ID to debug."),
        title: z.string().describe("Human readable test title for granting permission to debug the test.")
      })
    }),
    type: "readOnly"
  },
  handle: async (context, params, signal) => {
    const { output, status } = await context.runTestsWithGlobalSetupAndPossiblePause({
      headed: context.computedHeaded,
      locations: [],
      // we can make this faster by passing the test's location, so we don't need to scan all tests to find the ID
      testIds: [params.test.id],
      // For automatic recovery
      timeout: 0,
      workers: 1,
      pauseOnError: true,
      disableConfigReporters: true,
      actionTimeout: 5e3
    }, signal);
    return { content: [{ type: "text", text: output }], isError: status !== "paused" && status !== "passed" };
  }
});
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  debugTest,
  listTests,
  runTests
});
"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  // If the importer is in node compatibility mode or this is not an ESM
  // file that has been converted to a CommonJS file using a Babel-
  // compatible transform (i.e. "__esModule" has not been set), then set
  // "default" to the CommonJS "module.exports" for node compatibility.
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var package_exports = {};
__export(package_exports, {
  libPath: () => libPath,
  packageJSON: () => packageJSON,
  packageRoot: () => packageRoot
});
module.exports = __toCommonJS(package_exports);
var import_path = __toESM(require("path"));
const packageRoot = import_path.default.join(__dirname, "..");
const packageJSON = require(import_path.default.join(packageRoot, "package.json"));
function libPath(...parts) {
  return import_path.default.join(packageRoot, "lib", ...parts);
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  libPath,
  packageJSON,
  packageRoot
});
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var program_exports = {};
__export(program_exports, {
  program: () => program
});
module.exports = __toCommonJS(program_exports);
var import_bootstrap = require("playwright-core/lib/bootstrap");
var import_coreBundle = require("playwright-core/lib/coreBundle");
var import_common = require("./common");
var import_testActions = require("./cli/testActions");
var import_reportActions = require("./cli/reportActions");
var import_testBackend = require("./mcp/test/testBackend");
var import_generateAgents = require("./agents/generateAgents");
var import_package = require("./package");
const { program } = require("playwright-core/lib/utilsBundle");
const { gracefullyProcessExitDoNotHang } = require("playwright-core/lib/coreBundle").utils;
import_coreBundle.libCli.decorateProgram(program);
function addTestCommand(program2) {
  const command = program2.command("test [test-filter...]");
  command.description("run tests with Playwright Test");
  const options = testOptions.sort((a, b) => a[0].replace(/-/g, "").localeCompare(b[0].replace(/-/g, "")));
  options.forEach(([name, { description, choices, preset }]) => {
    const option = command.createOption(name, description);
    if (choices)
      option.choices(choices);
    if (preset)
      option.preset(preset);
    command.addOption(option);
    return command;
  });
  command.action(async (args, opts) => {
    const dashDashIndex = process.argv.indexOf("--");
    const postDashCount = dashDashIndex >= 0 ? process.argv.length - 1 - dashDashIndex : 0;
    const testFilters = args.slice(0, args.length - postDashCount);
    try {
      await (0, import_testActions.runTests)(testFilters, opts);
    } catch (e) {
      console.error(e);
      gracefullyProcessExitDoNotHang(1);
    }
  });
  command.addHelpText("afterAll", `
Arguments [test-filter...]:
  Pass arguments to filter test files. Each argument is treated as a regular expression. Matching is performed against the absolute file paths.

Examples:
  $ npx playwright test my.spec.ts
  $ npx playwright test some.spec.ts:42
  $ npx playwright test --headed
  $ npx playwright test --project=webkit`);
}
function addClearCacheCommand(program2) {
  const command = program2.command("clear-cache");
  command.description("clears build and test caches");
  command.option("-c, --config <file>", `Configuration file, or a test directory with optional "playwright.config.{m,c}?{js,ts}"`);
  command.action(async (opts) => {
    await (0, import_testActions.clearCache)(opts);
  });
}
function addTestServerCommand(program2) {
  const command = program2.command("test-server", { hidden: true });
  command.description("start test server");
  command.option("-c, --config <file>", `Configuration file, or a test directory with optional "playwright.config.{m,c}?{js,ts}"`);
  command.option("--host <host>", "Host to start the server on", "localhost");
  command.option("--port <port>", "Port to start the server on", "0");
  command.action(async (opts) => {
    await (0, import_testActions.runTestServerAction)(opts);
  });
}
function addShowReportCommand(program2) {
  const command = program2.command("show-report [report]");
  command.description("show HTML report");
  command.action(async (report, options) => {
    await (0, import_reportActions.showReport)(report, options.host, +options.port);
  });
  command.option("--host <host>", "Host to serve report on", "localhost");
  command.option("--port <port>", "Port to serve report on", "9323");
  command.addHelpText("afterAll", `
Arguments [report]:
  When specified, opens given report, otherwise opens last generated report.
  Accepts a directory or a .zip archive whose top-level entry is "index.html" (e.g. one downloaded from a CI artifact).

Examples:
  $ npx playwright show-report
  $ npx playwright show-report playwright-report
  $ npx playwright show-report playwright-report.zip`);
}
function addMergeReportsCommand(program2) {
  const command = program2.command("merge-reports [dir]");
  command.description("merge multiple blob reports (for sharded tests) into a single report");
  command.action(async (dir, options) => {
    try {
      await (0, import_reportActions.mergeReports)(dir, options);
    } catch (e) {
      console.error(e);
      gracefullyProcessExitDoNotHang(1);
    }
  });
  command.option("-c, --config <file>", `Configuration file. Can be used to specify additional configuration for the output report.`);
  command.option("--reporter <reporter>", `Reporter to use, comma-separated, can be ${import_common.builtInReporters.map((name) => `"${name}"`).join(", ")} (default: "${import_common.config.defaultReporter}")`);
  command.addHelpText("afterAll", `
Arguments [dir]:
  Directory containing blob reports.

Examples:
  $ npx playwright merge-reports playwright-report`);
}
function addTestMCPServerCommand(program2) {
  const command = program2.command("run-test-mcp-server", { hidden: true });
  command.description("Interact with the test runner over MCP");
  command.option("--headless", "run browser in headless mode, headed by default");
  command.option("-c, --config <file>", `Configuration file, or a test directory with optional "playwright.config.{m,c}?{js,ts}"`);
  command.option("--host <host>", "host to bind server to. Default is localhost. Use 0.0.0.0 to bind to all interfaces.");
  command.option("--port <port>", "port to listen on for SSE transport.");
  command.action(async (options) => {
    import_coreBundle.tools.setupExitWatchdog();
    const factory = {
      name: "Playwright Test Runner",
      nameInConfig: "playwright-test-runner",
      version: import_package.packageJSON.version,
      toolSchemas: import_testBackend.testServerBackendTools.map((tool) => tool.schema),
      create: async () => new import_testBackend.TestServerBackend(options.config, { muteConsole: options.port === void 0, headless: options.headless }),
      disposed: async () => {
      }
    };
    await import_coreBundle.tools.start(factory, { port: options.port === void 0 ? void 0 : +options.port, host: options.host });
  });
}
function addInitAgentsCommand(program2) {
  const command = program2.command("init-agents");
  command.description("Initialize repository agents");
  const option = command.createOption("--loop <loop>", "Agentic loop provider");
  option.choices(["claude", "codex", "copilot", "opencode", "vscode", "vscode-legacy"]);
  command.addOption(option);
  command.option("-c, --config <file>", `Configuration file to find a project to use for seed test`);
  command.option("--project <project>", "Project to use for seed test");
  command.option("--prompts", "Whether to include prompts in the agent initialization");
  command.action(async (opts) => {
    const loadedConfig = await import_common.configLoader.loadConfigFromFile(opts.config);
    if (opts.loop === "opencode") {
      await import_generateAgents.OpencodeGenerator.init(loadedConfig, opts.project, opts.prompts);
    } else if (opts.loop === "vscode-legacy") {
      await import_generateAgents.VSCodeGenerator.init(loadedConfig, opts.project);
    } else if (opts.loop === "claude") {
      await import_generateAgents.ClaudeGenerator.init(loadedConfig, opts.project, opts.prompts);
    } else if (opts.loop === "codex") {
      await import_generateAgents.CodexGenerator.init(loadedConfig, opts.project, opts.prompts);
    } else {
      await import_generateAgents.CopilotGenerator.init(loadedConfig, opts.project, opts.prompts);
      return;
    }
  });
}
const kTraceModes = ["on", "off", "on-first-retry", "on-all-retries", "retain-on-failure", "retain-on-first-failure", "retain-on-failure-and-retries"];
const testOptions = [
  /* deprecated */
  ["--browser <browser>", { description: `Browser to use for tests, one of "all", "chromium", "firefox" or "webkit" (default: "chromium")` }],
  ["-c, --config <file>", { description: `Configuration file, or a test directory with optional "playwright.config.{m,c}?{js,ts}"` }],
  ["--debug [mode]", { description: `Run tests with Playwright Inspector. Shortcut for "PWDEBUG=1" environment variable and "--timeout=0 --max-failures=1 --headed --workers=1" options`, choices: ["inspector", "cli"], preset: "inspector" }],
  ["--fail-on-flaky-tests", { description: `Fail if any test is flagged as flaky (default: false)` }],
  ["--forbid-only", { description: `Fail if test.only is called (default: false)` }],
  ["--fully-parallel", { description: `Run all tests in parallel (default: false)` }],
  ["--global-timeout <timeout>", { description: `Maximum time this test suite can run in milliseconds (default: unlimited)` }],
  ["-g, --grep <grep>", { description: `Only run tests matching this regular expression (default: ".*")` }],
  ["-G, --grep-invert <grep>", { description: `Only run tests that do not match this regular expression` }],
  ["--headed", { description: `Run tests in headed browsers (default: headless)` }],
  ["--ignore-snapshots", { description: `Ignore screenshot and snapshot expectations` }],
  ["--last-failed", { description: `Only re-run the failures` }],
  ["--last-failed-file <file>", { description: `Override the default path for the last-run JSON file used with --last-failed (default: <outputDir>/.last-run.json). Same as PLAYWRIGHT_LAST_RUN_OUTPUT_FILE environment variable.` }],
  ["--list", { description: `Collect all the tests and report them, but do not run` }],
  ["--max-failures <N>", { description: `Stop after the first N failures` }],
  ["--no-deps", { description: `Do not run project dependencies` }],
  ["--output <dir>", { description: `Folder for output artifacts (default: "test-results")` }],
  ["--only-changed [ref]", { description: `Only run test files that have been changed between 'HEAD' and 'ref'. Defaults to running all uncommitted changes. Only supports Git.` }],
  ["--pass-with-no-tests", { description: `Makes test run succeed even if no tests were found` }],
  ["--project <project-name...>", { description: `Only run tests from the specified list of projects, supports '*' wildcard (default: run all projects)` }],
  ["--quiet", { description: `Suppress stdio` }],
  ["--repeat-each <N>", { description: `Run each test N times (default: 1)` }],
  ["--reporter <reporter>", { description: `Reporter to use, comma-separated, can be ${import_common.builtInReporters.map((name) => `"${name}"`).join(", ")} (default: "${import_common.config.defaultReporter}")` }],
  ["--retries <retries>", { description: `Maximum retry count for flaky tests, zero for no retries (default: no retries)` }],
  ["--run-agents <mode>", { description: `Run agents to generate the code for page.perform`, choices: ["missing", "all", "none"], preset: "none" }],
  ["--shard <shard>", { description: `Shard tests and execute only the selected shard, specify in the form "current/all", 1-based, for example "3/5"` }],
  ["--test-list <file>", { description: `Path to a file containing a list of tests to run. See https://playwright.dev/docs/test-cli for more details.` }],
  ["--test-list-invert <file>", { description: `Path to a file containing a list of tests to skip. See https://playwright.dev/docs/test-cli for more details.` }],
  ["--timeout <timeout>", { description: `Specify test timeout threshold in milliseconds, zero for unlimited (default: ${import_common.config.defaultTimeout})` }],
  ["--trace <mode>", { description: `Force tracing mode`, choices: kTraceModes }],
  ["--tsconfig <path>", { description: `Path to a single tsconfig applicable to all imported files (default: look up tsconfig for each imported file separately)` }],
  ["--ui", { description: `Run tests in interactive UI mode` }],
  ["--ui-host <host>", { description: `Host to serve UI on; specifying this option opens UI in a browser tab` }],
  ["--ui-port <port>", { description: `Port to serve UI on, 0 for any free port; specifying this option opens UI in a browser tab` }],
  ["-u, --update-snapshots [mode]", { description: `Update snapshots with actual results. Running tests without the flag defaults to "missing"`, choices: ["all", "changed", "missing", "none"], preset: "changed" }],
  ["--update-source-method <method>", { description: `Chooses the way source is updated (default: "patch")`, choices: ["overwrite", "3way", "patch"] }],
  ["-j, --workers <workers>", { description: `Number of concurrent workers or percentage of logical CPU cores, use 1 to run in a single worker (default: 50%)` }],
  ["-x", { description: `Stop after the first failure` }]
];
addTestCommand(program);
addShowReportCommand(program);
addMergeReportsCommand(program);
addClearCacheCommand(program);
addTestMCPServerCommand(program);
addTestServerCommand(program);
addInitAgentsCommand(program);
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  program
});
"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  // If the importer is in node compatibility mode or this is not an ESM
  // file that has been converted to a CommonJS file using a Babel-
  // compatible transform (i.e. "__esModule" has not been set), then set
  // "default" to the CommonJS "module.exports" for node compatibility.
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);

// packages/playwright/src/runner/index.ts
var index_exports = {};
__export(index_exports, {
  ListModeReporter: () => listModeReporter_default,
  ListReporter: () => list_default,
  TestServerConnection: () => TestServerConnection,
  base: () => base_exports,
  html: () => html_exports,
  merge: () => merge_exports,
  projectUtils: () => projectUtils_exports,
  runnerReporters: () => reporters_exports,
  testRunner: () => testRunner_exports,
  testServer: () => testServer_exports,
  watchMode: () => watchMode_exports,
  webServer: () => webServer
});
module.exports = __toCommonJS(index_exports);

// packages/playwright/src/runner/testRunner.ts
var testRunner_exports = {};
__export(testRunner_exports, {
  TestRunner: () => TestRunner,
  TestRunnerEvent: () => TestRunnerEvent,
  runAllTestsWithConfig: () => runAllTestsWithConfig
});
var import_events2 = __toESM(require("events"));
var import_fs13 = __toESM(require("fs"));
var import_path17 = __toESM(require("path"));
var import_coreBundle2 = require("playwright-core/lib/coreBundle");
var import_common9 = require("../common");

// packages/playwright/src/runner/fsWatcher.ts
var chokidar = require("playwright-core/lib/utilsBundle").chokidar;
var FSWatcher = class {
  constructor(onChange) {
    this._watchedPaths = [];
    this._ignoredFolders = [];
    this._collector = [];
    this._onChange = onChange;
  }
  async update(watchedPaths, ignoredFolders, reportPending) {
    if (JSON.stringify([this._watchedPaths, this._ignoredFolders]) === JSON.stringify([watchedPaths, ignoredFolders]))
      return;
    if (reportPending)
      this._reportEventsIfAny();
    this._watchedPaths = watchedPaths;
    this._ignoredFolders = ignoredFolders;
    void this._fsWatcher?.close();
    this._fsWatcher = void 0;
    this._collector.length = 0;
    clearTimeout(this._throttleTimer);
    this._throttleTimer = void 0;
    if (!this._watchedPaths.length)
      return;
    const ignored = [...this._ignoredFolders, "**/node_modules/**"];
    this._fsWatcher = chokidar.watch(watchedPaths, { ignoreInitial: true, ignored }).on("all", async (event, file) => {
      if (this._throttleTimer)
        clearTimeout(this._throttleTimer);
      this._collector.push({ event, file });
      this._throttleTimer = setTimeout(() => this._reportEventsIfAny(), 250);
    });
    await new Promise((resolve, reject) => this._fsWatcher.once("ready", resolve).once("error", reject));
  }
  async close() {
    await this._fsWatcher?.close();
  }
  _reportEventsIfAny() {
    if (this._collector.length)
      this._onChange(this._collector.slice());
    this._collector.length = 0;
  }
};

// packages/playwright/src/isomorphic/teleReceiver.ts
var TeleReporterReceiver = class {
  constructor(reporter, options = {}) {
    this.isListing = false;
    this._tests = /* @__PURE__ */ new Map();
    this._rootSuite = new TeleSuite("", "root");
    this._options = options;
    this._reporter = reporter;
  }
  reset() {
    this._rootSuite._entries = [];
    this._tests.clear();
  }
  dispatch(message) {
    const { method, params } = message;
    if (method === "onConfigure") {
      this._onConfigure(params.config);
      return;
    }
    if (method === "onProject") {
      this._onProject(params.project);
      return;
    }
    if (method === "onBegin") {
      this._onBegin();
      return;
    }
    if (method === "onTestBegin") {
      this._onTestBegin(params.testId, params.result);
      return;
    }
    if (method === "onTestPaused") {
      this._onTestPaused(params.testId, params.resultId, params.errors);
      return;
    }
    if (method === "onTestEnd") {
      this._onTestEnd(params.test, params.result);
      return;
    }
    if (method === "onStepBegin") {
      this._onStepBegin(params.testId, params.resultId, params.step);
      return;
    }
    if (method === "onAttach") {
      this._onAttach(params.testId, params.resultId, params.attachments);
      return;
    }
    if (method === "onStepEnd") {
      this._onStepEnd(params.testId, params.resultId, params.step);
      return;
    }
    if (method === "onError") {
      this._onError(params.error, params.workerInfo);
      return;
    }
    if (method === "onStdIO") {
      this._onStdIO(params.type, params.testId, params.resultId, params.data, params.isBase64);
      return;
    }
    if (method === "onEnd")
      return this._onEnd(params.result);
    if (method === "onExit")
      return this._onExit();
  }
  _onConfigure(config2) {
    this._rootDir = config2.rootDir;
    this._config = this._parseConfig(config2);
    this._reporter.onConfigure?.(this._config);
  }
  _onProject(project) {
    let projectSuite = this._options.mergeProjects ? this._rootSuite.suites.find((suite) => suite.project().name === project.name) : void 0;
    if (!projectSuite) {
      projectSuite = new TeleSuite(project.name, "project");
      this._rootSuite._addSuite(projectSuite);
    }
    const parsed = this._parseProject(project);
    projectSuite._project = parsed;
    let index = -1;
    if (this._options.mergeProjects)
      index = this._config.projects.findIndex((p) => p.name === project.name);
    if (index === -1)
      this._config.projects.push(parsed);
    else
      this._config.projects[index] = parsed;
    for (const suite of project.suites)
      this._mergeSuiteInto(suite, projectSuite);
  }
  _onBegin() {
    this._reporter.onBegin?.(this._rootSuite);
  }
  _onTestBegin(testId, payload) {
    const test = this._tests.get(testId);
    if (this._options.clearPreviousResultsWhenTestBegins)
      test.results = [];
    const testResult = test._createTestResult(payload.id);
    testResult.retry = payload.retry;
    testResult.workerIndex = payload.workerIndex;
    testResult.parallelIndex = payload.parallelIndex;
    testResult.setStartTimeNumber(payload.startTime);
    this._reporter.onTestBegin?.(test, testResult);
  }
  _onTestPaused(testId, resultId, errors) {
    const test = this._tests.get(testId);
    const result = test.results.find((r) => r._id === resultId);
    result.errors.push(...errors);
    result.error = result.errors[0];
    void this._reporter.onTestPaused?.(test, result);
  }
  _onTestEnd(testEndPayload, payload) {
    const test = this._tests.get(testEndPayload.testId);
    test.timeout = testEndPayload.timeout;
    test.expectedStatus = testEndPayload.expectedStatus;
    const result = test.results.find((r) => r._id === payload.id);
    result.duration = payload.duration;
    result.status = payload.status;
    result.errors.push(...payload.errors ?? []);
    result.error = result.errors[0];
    if (!!payload.attachments)
      result.attachments = this._parseAttachments(payload.attachments);
    if (payload.annotations) {
      this._absoluteAnnotationLocationsInplace(payload.annotations);
      result.annotations = payload.annotations;
      test.annotations = payload.annotations;
    }
    this._reporter.onTestEnd?.(test, result);
    result._stepMap = /* @__PURE__ */ new Map();
  }
  _onStepBegin(testId, resultId, payload) {
    const test = this._tests.get(testId);
    const result = test.results.find((r) => r._id === resultId);
    const parentStep = payload.parentStepId ? result._stepMap.get(payload.parentStepId) : void 0;
    const location = this._absoluteLocation(payload.location);
    const step = new TeleTestStep(payload, parentStep, location, result);
    if (parentStep)
      parentStep.steps.push(step);
    else
      result.steps.push(step);
    result._stepMap.set(payload.id, step);
    this._reporter.onStepBegin?.(test, result, step);
  }
  _onStepEnd(testId, resultId, payload) {
    const test = this._tests.get(testId);
    const result = test.results.find((r) => r._id === resultId);
    const step = result._stepMap.get(payload.id);
    step._endPayload = payload;
    step.duration = payload.duration;
    step.error = payload.error;
    this._reporter.onStepEnd?.(test, result, step);
  }
  _onAttach(testId, resultId, attachments) {
    const test = this._tests.get(testId);
    const result = test.results.find((r) => r._id === resultId);
    result.attachments.push(...attachments.map((a) => ({
      name: a.name,
      contentType: a.contentType,
      path: a.path,
      body: a.base64 && globalThis.Buffer ? Buffer.from(a.base64, "base64") : void 0
    })));
  }
  _onError(error, workerInfo) {
    let fullWorkerInfo;
    if (workerInfo) {
      const project = this._config.projects.find((p) => p.name === workerInfo.projectName);
      if (project) {
        fullWorkerInfo = {
          workerIndex: workerInfo.workerIndex,
          parallelIndex: workerInfo.parallelIndex,
          config: this._config,
          project
        };
      }
    }
    this._reporter.onError?.(error, fullWorkerInfo);
  }
  _onStdIO(type, testId, resultId, data, isBase64) {
    const chunk = isBase64 ? globalThis.Buffer ? Buffer.from(data, "base64") : atob(data) : data;
    const test = testId ? this._tests.get(testId) : void 0;
    const result = test && resultId ? test.results.find((r) => r._id === resultId) : void 0;
    if (type === "stdout") {
      result?.stdout.push(chunk);
      this._reporter.onStdOut?.(chunk, test, result);
    } else {
      result?.stderr.push(chunk);
      this._reporter.onStdErr?.(chunk, test, result);
    }
  }
  async _onEnd(result) {
    await this._reporter.onEnd?.(asFullResult(result));
  }
  _onExit() {
    return this._reporter.onExit?.();
  }
  _parseConfig(config2) {
    const result = asFullConfig(config2);
    if (this._options.configOverrides) {
      result.configFile = this._options.configOverrides.configFile;
      result.reportSlowTests = this._options.configOverrides.reportSlowTests;
      result.quiet = this._options.configOverrides.quiet;
      result.reporter = [...this._options.configOverrides.reporter];
    }
    return result;
  }
  _parseProject(project) {
    return {
      metadata: project.metadata,
      name: project.name,
      outputDir: this._absolutePath(project.outputDir),
      repeatEach: project.repeatEach,
      retries: project.retries,
      testDir: this._absolutePath(project.testDir),
      testIgnore: parseRegexPatterns(project.testIgnore),
      testMatch: parseRegexPatterns(project.testMatch),
      timeout: project.timeout,
      grep: parseRegexPatterns(project.grep),
      grepInvert: parseRegexPatterns(project.grepInvert),
      dependencies: project.dependencies,
      teardown: project.teardown,
      snapshotDir: this._absolutePath(project.snapshotDir),
      ignoreSnapshots: project.ignoreSnapshots ?? false,
      use: project.use
    };
  }
  _parseAttachments(attachments) {
    return attachments.map((a) => {
      return {
        ...a,
        body: a.base64 && globalThis.Buffer ? Buffer.from(a.base64, "base64") : void 0
      };
    });
  }
  _mergeSuiteInto(jsonSuite, parent) {
    let targetSuite = parent.suites.find((s) => s.title === jsonSuite.title);
    if (!targetSuite) {
      targetSuite = new TeleSuite(jsonSuite.title, parent.type === "project" ? "file" : "describe");
      parent._addSuite(targetSuite);
    }
    targetSuite.location = this._absoluteLocation(jsonSuite.location);
    jsonSuite.entries.forEach((e) => {
      if ("testId" in e)
        this._mergeTestInto(e, targetSuite);
      else
        this._mergeSuiteInto(e, targetSuite);
    });
  }
  _mergeTestInto(jsonTest, parent) {
    let targetTest = this._options.mergeTestCases ? parent.tests.find((s) => s.title === jsonTest.title && s.repeatEachIndex === jsonTest.repeatEachIndex) : void 0;
    if (!targetTest) {
      targetTest = new TeleTestCase(jsonTest.testId, jsonTest.title, this._absoluteLocation(jsonTest.location), jsonTest.repeatEachIndex);
      parent._addTest(targetTest);
      this._tests.set(targetTest.id, targetTest);
    }
    this._updateTest(jsonTest, targetTest);
  }
  _updateTest(payload, test) {
    test.id = payload.testId;
    test.location = this._absoluteLocation(payload.location);
    test.retries = payload.retries;
    test.tags = payload.tags ?? [];
    test.annotations = payload.annotations ?? [];
    this._absoluteAnnotationLocationsInplace(test.annotations);
    return test;
  }
  _absoluteAnnotationLocationsInplace(annotations) {
    for (const annotation of annotations) {
      if (annotation.location)
        annotation.location = this._absoluteLocation(annotation.location);
    }
  }
  _absoluteLocation(location) {
    if (!location)
      return location;
    return {
      ...location,
      file: this._absolutePath(location.file)
    };
  }
  _absolutePath(relativePath) {
    if (relativePath === void 0)
      return;
    return this._options.resolvePath ? this._options.resolvePath(this._rootDir, relativePath) : this._rootDir + "/" + relativePath;
  }
};
var TeleSuite = class {
  constructor(title, type) {
    this._entries = [];
    this._requireFile = "";
    this._parallelMode = "none";
    this.title = title;
    this._type = type;
  }
  get type() {
    return this._type;
  }
  get suites() {
    return this._entries.filter((e) => e.type !== "test");
  }
  get tests() {
    return this._entries.filter((e) => e.type === "test");
  }
  entries() {
    return this._entries;
  }
  allTests() {
    const result = [];
    const visit = (suite) => {
      for (const entry of suite.entries()) {
        if (entry.type === "test")
          result.push(entry);
        else
          visit(entry);
      }
    };
    visit(this);
    return result;
  }
  titlePath() {
    const titlePath = this.parent ? this.parent.titlePath() : [];
    if (this.title || this._type !== "describe")
      titlePath.push(this.title);
    return titlePath;
  }
  project() {
    return this._project ?? this.parent?.project();
  }
  _addTest(test) {
    test.parent = this;
    this._entries.push(test);
  }
  _addSuite(suite) {
    suite.parent = this;
    this._entries.push(suite);
  }
};
var TeleTestCase = class {
  constructor(id, title, location, repeatEachIndex) {
    this.fn = () => {
    };
    this.results = [];
    this.type = "test";
    this.expectedStatus = "passed";
    this.timeout = 0;
    this.annotations = [];
    this.retries = 0;
    this.tags = [];
    this.repeatEachIndex = 0;
    this.id = id;
    this.title = title;
    this.location = location;
    this.repeatEachIndex = repeatEachIndex;
  }
  titlePath() {
    const titlePath = this.parent ? this.parent.titlePath() : [];
    titlePath.push(this.title);
    return titlePath;
  }
  outcome() {
    return computeTestCaseOutcome(this);
  }
  ok() {
    const status = this.outcome();
    return status === "expected" || status === "flaky" || status === "skipped";
  }
  _createTestResult(id) {
    const result = new TeleTestResult(this.results.length, id);
    this.results.push(result);
    return result;
  }
};
var TeleTestStep = class {
  constructor(payload, parentStep, location, result) {
    this.duration = -1;
    this.steps = [];
    this._startTime = 0;
    this.title = payload.title;
    this.category = payload.category;
    this.location = location;
    this.parent = parentStep;
    this._startTime = payload.startTime;
    this._result = result;
  }
  titlePath() {
    const parentPath = this.parent?.titlePath() || [];
    return [...parentPath, this.title];
  }
  get startTime() {
    return new Date(this._startTime);
  }
  set startTime(value) {
    this._startTime = +value;
  }
  get attachments() {
    return this._endPayload?.attachments?.map((index) => this._result.attachments[index]) ?? [];
  }
  get annotations() {
    return this._endPayload?.annotations ?? [];
  }
};
var TeleTestResult = class {
  constructor(retry, id) {
    this.parallelIndex = -1;
    this.workerIndex = -1;
    this.duration = -1;
    this.stdout = [];
    this.stderr = [];
    this.attachments = [];
    this.annotations = [];
    this.status = "skipped";
    this.steps = [];
    this.errors = [];
    this._stepMap = /* @__PURE__ */ new Map();
    this._startTime = 0;
    this.retry = retry;
    this._id = id;
  }
  setStartTimeNumber(startTime) {
    this._startTime = startTime;
  }
  get startTime() {
    return new Date(this._startTime);
  }
  set startTime(value) {
    this._startTime = +value;
  }
};
var baseFullConfig = {
  argv: [],
  failOnFlakyTests: false,
  forbidOnly: false,
  fullyParallel: false,
  globalSetup: null,
  globalTeardown: null,
  globalTimeout: 0,
  grep: /.*/,
  grepInvert: null,
  maxFailures: 0,
  metadata: {},
  preserveOutput: "always",
  projects: [],
  reporter: [[process.env.CI ? "dot" : "list"]],
  reportSlowTests: {
    max: 5,
    threshold: 3e5
    /* 5 minutes */
  },
  configFile: "",
  rootDir: "",
  quiet: false,
  shard: null,
  tags: [],
  updateSnapshots: "missing",
  updateSourceMethod: "patch",
  version: "",
  workers: 0,
  webServer: null
};
function serializeRegexPatterns(patterns) {
  if (!Array.isArray(patterns))
    patterns = [patterns];
  return patterns.map((s) => {
    if (typeof s === "string")
      return { s };
    return { r: { source: s.source, flags: s.flags } };
  });
}
function parseRegexPatterns(patterns) {
  return patterns.map((p) => {
    if (p.s !== void 0)
      return p.s;
    return new RegExp(p.r.source, p.r.flags);
  });
}
function computeTestCaseOutcome(test) {
  let skipped = 0;
  let didNotRun = 0;
  let expected = 0;
  let interrupted = 0;
  let unexpected = 0;
  for (const result of test.results) {
    if (result.status === "interrupted") {
      ++interrupted;
    } else if (result.status === "skipped" && test.expectedStatus === "skipped") {
      ++skipped;
    } else if (result.status === "skipped") {
      ++didNotRun;
    } else if (result.status === test.expectedStatus) {
      ++expected;
    } else {
      ++unexpected;
    }
  }
  if (expected === 0 && unexpected === 0)
    return "skipped";
  if (unexpected === 0)
    return "expected";
  if (expected === 0 && skipped === 0)
    return "unexpected";
  return "flaky";
}
function asFullResult(result) {
  return {
    status: result.status,
    startTime: new Date(result.startTime),
    duration: result.duration
  };
}
function asFullConfig(config2) {
  return { ...baseFullConfig, ...config2 };
}

// packages/playwright/src/plugins/gitCommitInfoPlugin.ts
var fs = __toESM(require("fs"));
var { monotonicTime } = require("playwright-core/lib/coreBundle").iso;
var { spawnAsync } = require("playwright-core/lib/coreBundle").utils;
var GIT_OPERATIONS_TIMEOUT_MS = 3e3;
var addGitCommitInfoPlugin = (fullConfig) => {
  fullConfig.plugins.push({ factory: gitCommitInfoPlugin.bind(null, fullConfig) });
};
function print(s, ...args) {
  console.log("GitCommitInfo: " + s, ...args);
}
function debug(s, ...args) {
  if (!process.env.DEBUG_GIT_COMMIT_INFO)
    return;
  print(s, ...args);
}
var gitCommitInfoPlugin = (fullConfig) => {
  return {
    name: "playwright:git-commit-info",
    setup: async (config2, configDir) => {
      const metadata = config2.metadata;
      const ci = await ciInfo();
      if (!metadata.ci && ci) {
        debug("ci info", ci);
        metadata.ci = ci;
      }
      if (fullConfig.captureGitInfo?.commit || fullConfig.captureGitInfo?.commit === void 0 && ci) {
        const git = await gitCommitInfo(configDir).catch((e) => print("failed to get git commit info", e));
        if (git) {
          debug("commit info", git);
          metadata.gitCommit = git;
        }
      }
      if (fullConfig.captureGitInfo?.diff || fullConfig.captureGitInfo?.diff === void 0 && ci) {
        const diffResult = await gitDiff(configDir, ci).catch((e) => print("failed to get git diff", e));
        if (diffResult) {
          debug(`diff length ${diffResult.length}`);
          metadata.gitDiff = diffResult;
        }
      }
    }
  };
};
async function ciInfo() {
  if (process.env.GITHUB_ACTIONS) {
    let pr;
    try {
      const json = JSON.parse(await fs.promises.readFile(process.env.GITHUB_EVENT_PATH, "utf8"));
      pr = { title: json.pull_request.title, number: json.pull_request.number, baseHash: json.pull_request.base.sha };
    } catch {
    }
    return {
      commitHref: `${process.env.GITHUB_SERVER_URL}/${process.env.GITHUB_REPOSITORY}/commit/${process.env.GITHUB_SHA}`,
      commitHash: process.env.GITHUB_SHA,
      prHref: pr ? `${process.env.GITHUB_SERVER_URL}/${process.env.GITHUB_REPOSITORY}/pull/${pr.number}` : void 0,
      prTitle: pr?.title,
      prBaseHash: pr?.baseHash,
      buildHref: `${process.env.GITHUB_SERVER_URL}/${process.env.GITHUB_REPOSITORY}/actions/runs/${process.env.GITHUB_RUN_ID}`
    };
  }
  if (process.env.GITLAB_CI) {
    return {
      commitHref: `${process.env.CI_PROJECT_URL}/-/commit/${process.env.CI_COMMIT_SHA}`,
      commitHash: process.env.CI_COMMIT_SHA,
      buildHref: process.env.CI_JOB_URL,
      branch: process.env.CI_COMMIT_REF_NAME
    };
  }
  if (process.env.JENKINS_URL && process.env.BUILD_URL) {
    return {
      commitHref: process.env.BUILD_URL,
      commitHash: process.env.GIT_COMMIT,
      branch: process.env.GIT_BRANCH
    };
  }
}
async function gitCommitInfo(gitDir) {
  const separator2 = `---786eec917292---`;
  const tokens = [
    "%H",
    // commit hash
    "%h",
    // abbreviated commit hash
    "%s",
    // subject
    "%B",
    // raw body (unwrapped subject and body)
    "%an",
    // author name
    "%ae",
    // author email
    "%at",
    // author date, UNIX timestamp
    "%cn",
    // committer name
    "%ce",
    // committer email
    "%ct"
    // committer date, UNIX timestamp
  ];
  const logOutput = await runGit(["log", "-1", `--pretty=format:${tokens.join(separator2)}`], gitDir);
  if (!logOutput)
    return void 0;
  const branchOutput = await runGit(["rev-parse", "--abbrev-ref", "HEAD"], gitDir);
  const [hash, shortHash, subject, body, authorName, authorEmail, authorTime, committerName, committerEmail, committerTime] = logOutput.split(separator2);
  return {
    shortHash,
    hash,
    subject,
    body,
    author: {
      name: authorName,
      email: authorEmail,
      time: +authorTime * 1e3
    },
    committer: {
      name: committerName,
      email: committerEmail,
      time: +committerTime * 1e3
    },
    branch: branchOutput?.trim() ?? ""
  };
}
async function gitDiff(gitDir, ci) {
  const diffLimit = 1e5;
  if (ci?.prBaseHash) {
    await runGit(["fetch", "origin", ci.prBaseHash, "--depth=1", "--no-auto-maintenance", "--no-auto-gc", "--no-tags", "--no-recurse-submodules"], gitDir);
    const diff3 = await runGit(["diff", ci.prBaseHash, "HEAD"], gitDir);
    if (diff3)
      return diff3.substring(0, diffLimit);
  }
  if (ci)
    return;
  const uncommitted = await runGit(["diff"], gitDir);
  if (uncommitted === void 0) {
    return;
  }
  if (uncommitted)
    return uncommitted.substring(0, diffLimit);
  const diff2 = await runGit(["diff", "HEAD~1"], gitDir);
  return diff2?.substring(0, diffLimit);
}
async function runGit(args, cwd) {
  debug(`running "git ${args.join(" ")}"`);
  const start = monotonicTime();
  const result = await spawnAsync(
    "git",
    args,
    { stdio: "pipe", cwd, timeout: GIT_OPERATIONS_TIMEOUT_MS }
  );
  if (monotonicTime() - start > GIT_OPERATIONS_TIMEOUT_MS) {
    print(`timeout of ${GIT_OPERATIONS_TIMEOUT_MS}ms exceeded while running "git ${args.join(" ")}"`);
    return;
  }
  if (result.code)
    debug(`failure, code=${result.code}

${result.stderr}`);
  else
    debug(`success`);
  return result.code ? void 0 : result.stdout.trim();
}

// packages/playwright/src/plugins/webServerPlugin.ts
var import_net = __toESM(require("net"));
var import_path = __toESM(require("path"));
var import_util = require("util");
var colors = require("playwright-core/lib/utilsBundle").colors;
var debug2 = require("playwright-core/lib/utilsBundle").debug;
var { ManualPromise } = require("playwright-core/lib/coreBundle").iso;
var { monotonicTime: monotonicTime2 } = require("playwright-core/lib/coreBundle").iso;
var { raceAgainstDeadline } = require("playwright-core/lib/coreBundle").iso;
var { isURLAvailable } = require("playwright-core/lib/coreBundle").utils;
var { launchProcess } = require("playwright-core/lib/coreBundle").utils;
var DEFAULT_ENVIRONMENT_VARIABLES = {
  "BROWSER": "none",
  // Disable that create-react-app will open the page in the browser
  "FORCE_COLOR": "1",
  "DEBUG_COLORS": "1"
};
var debugWebServer = debug2("pw:webserver");
var WebServerPlugin = class {
  constructor(options, checkPortOnly) {
    this.name = "playwright:webserver";
    this._options = options;
    this._checkPortOnly = checkPortOnly;
  }
  async setup(config2, configDir, reporter) {
    this._reporter = reporter;
    if (this._options.url)
      this._isAvailableCallback = getIsAvailableFunction(this._options.url, this._checkPortOnly, !!this._options.ignoreHTTPSErrors, this._reporter.onStdErr?.bind(this._reporter));
    this._options.cwd = this._options.cwd ? import_path.default.resolve(configDir, this._options.cwd) : configDir;
    try {
      await this._startProcess();
      await this._waitForProcess();
    } catch (error) {
      await this.teardown();
      throw error;
    }
  }
  async teardown() {
    debugWebServer(`Terminating the WebServer`);
    await this._killProcess?.();
    debugWebServer(`Terminated the WebServer`);
  }
  async _startProcess() {
    let processExitedReject = (error) => {
    };
    this._processExitedPromise = new Promise((_, reject) => processExitedReject = reject);
    const isAlreadyAvailable = await this._isAvailableCallback?.();
    if (isAlreadyAvailable) {
      debugWebServer(`WebServer is already available`);
      if (this._options.reuseExistingServer)
        return;
      const port = new URL(this._options.url).port;
      throw new Error(`${this._options.url ?? `http://localhost${port ? ":" + port : ""}`} is already used, make sure that nothing is running on the port/url or set reuseExistingServer:true in config.webServer.`);
    }
    if (!this._options.command)
      throw new Error("config.webServer.command cannot be empty");
    debugWebServer(`Starting WebServer process ${this._options.command}...`);
    const { launchedProcess, gracefullyClose } = await launchProcess({
      command: this._options.command,
      env: {
        ...DEFAULT_ENVIRONMENT_VARIABLES,
        ...process.env,
        ...this._options.env
      },
      cwd: this._options.cwd,
      stdio: "stdin",
      shell: true,
      attemptToGracefullyClose: async () => {
        if (process.platform === "win32")
          throw new Error("Graceful shutdown is not supported on Windows");
        if (!this._options.gracefulShutdown)
          throw new Error("skip graceful shutdown");
        const { signal, timeout = 0 } = this._options.gracefulShutdown;
        process.kill(-launchedProcess.pid, signal);
        return new Promise((resolve, reject) => {
          const timer = timeout !== 0 ? setTimeout(() => reject(new Error(`process didn't close gracefully within timeout`)), timeout) : void 0;
          launchedProcess.once("close", (...args) => {
            clearTimeout(timer);
            resolve();
          });
        });
      },
      log: () => {
      },
      onExit: (code) => processExitedReject(new Error(code ? `Process from config.webServer was not able to start. Exit code: ${code}` : "Process from config.webServer exited early.")),
      tempDirectories: []
    });
    this._killProcess = gracefullyClose;
    debugWebServer(`Process started`);
    if (this._options.wait?.stdout || this._options.wait?.stderr)
      this._waitForStdioPromise = new ManualPromise();
    const stdioWaitCollectors = {
      stdout: this._options.wait?.stdout ? "" : void 0,
      stderr: this._options.wait?.stderr ? "" : void 0
    };
    launchedProcess.stdout.on("data", (data) => {
      if (debugWebServer.enabled || this._options.stdout === "pipe")
        this._reporter.onStdOut?.(prefixOutputLines(data.toString(), this._options.name));
    });
    launchedProcess.stderr.on("data", (data) => {
      if (debugWebServer.enabled || (this._options.stderr === "pipe" || !this._options.stderr))
        this._reporter.onStdErr?.(prefixOutputLines(data.toString(), this._options.name));
    });
    const resolveStdioPromise = () => {
      stdioWaitCollectors.stdout = void 0;
      stdioWaitCollectors.stderr = void 0;
      this._waitForStdioPromise?.resolve();
    };
    for (const stdio of ["stdout", "stderr"]) {
      launchedProcess[stdio].on("data", (data) => {
        if (!this._options.wait?.[stdio] || stdioWaitCollectors[stdio] === void 0)
          return;
        stdioWaitCollectors[stdio] += (0, import_util.stripVTControlCharacters)(data.toString());
        this._options.wait[stdio].lastIndex = 0;
        const result = this._options.wait[stdio].exec(stdioWaitCollectors[stdio]);
        if (result) {
          for (const [key, value] of Object.entries(result.groups || {}))
            process.env[key.toUpperCase()] = value;
          resolveStdioPromise();
        }
      });
    }
  }
  async _waitForProcess() {
    if (!this._isAvailableCallback && !this._waitForStdioPromise) {
      this._processExitedPromise.catch(() => {
      });
      return;
    }
    debugWebServer(`Waiting for availability...`);
    const launchTimeout = this._options.timeout || 60 * 1e3;
    const cancellationToken = { canceled: false };
    const deadline = monotonicTime2() + launchTimeout;
    const racingPromises = [this._processExitedPromise];
    if (this._isAvailableCallback)
      racingPromises.push(raceAgainstDeadline(() => waitFor(this._isAvailableCallback, cancellationToken), deadline));
    if (this._waitForStdioPromise)
      racingPromises.push(raceAgainstDeadline(() => this._waitForStdioPromise, deadline));
    const { timedOut } = await Promise.race(racingPromises);
    cancellationToken.canceled = true;
    if (timedOut)
      throw new Error(`Timed out waiting ${launchTimeout}ms from config.webServer.`);
    debugWebServer(`WebServer available`);
  }
};
async function isPortUsed(port) {
  const innerIsPortUsed = (host) => new Promise((resolve) => {
    const conn = import_net.default.connect(port, host).on("error", () => {
      resolve(false);
    }).on("connect", () => {
      conn.end();
      resolve(true);
    });
  });
  return new Promise((resolve) => {
    let pending = 2;
    const onResult = (result) => {
      if (result)
        resolve(true);
      else if (--pending === 0)
        resolve(false);
    };
    void innerIsPortUsed("127.0.0.1").then(onResult);
    void innerIsPortUsed("::1").then(onResult);
  });
}
async function waitFor(waitFn, cancellationToken) {
  const logScale = [100, 250, 500];
  while (!cancellationToken.canceled) {
    const connected = await waitFn();
    if (connected)
      return;
    const delay = logScale.shift() || 1e3;
    debugWebServer(`Waiting ${delay}ms`);
    await new Promise((x) => setTimeout(x, delay));
  }
}
function getIsAvailableFunction(url, checkPortOnly, ignoreHTTPSErrors, onStdErr) {
  const urlObject = new URL(url);
  if (!checkPortOnly)
    return () => isURLAvailable(urlObject, ignoreHTTPSErrors, debugWebServer, onStdErr);
  const port = urlObject.port;
  return () => isPortUsed(+port);
}
var webServer = (options) => {
  return new WebServerPlugin(options, false);
};
var webServerPluginsForConfig = (config2) => {
  const shouldSetBaseUrl = !!config2.config.webServer;
  const webServerPlugins = [];
  for (const webServerConfig of config2.webServers) {
    if (webServerConfig.port && webServerConfig.url)
      throw new Error(`Either 'port' or 'url' should be specified in config.webServer.`);
    let url;
    if (webServerConfig.port || webServerConfig.url) {
      url = webServerConfig.url || `http://localhost:${webServerConfig.port}`;
      if (shouldSetBaseUrl && !webServerConfig.url)
        process.env.PLAYWRIGHT_TEST_BASE_URL = url;
    }
    webServerPlugins.push(new WebServerPlugin({ ...webServerConfig, url }, webServerConfig.port !== void 0));
  }
  return webServerPlugins;
};
function prefixOutputLines(output, prefixName = "WebServer") {
  const lastIsNewLine = output[output.length - 1] === "\n";
  let lines = output.split("\n");
  if (lastIsNewLine)
    lines.pop();
  lines = lines.map((line) => colors.dim(`[${prefixName}] `) + line);
  if (lastIsNewLine)
    lines.push("");
  return lines.join("\n");
}

// packages/playwright/src/reporters/base.ts
var base_exports = {};
__export(base_exports, {
  TerminalReporter: () => TerminalReporter,
  formatError: () => formatError,
  formatFailure: () => formatFailure,
  formatResultFailure: () => formatResultFailure,
  formatRetry: () => formatRetry,
  internalScreen: () => internalScreen,
  kOutputSymbol: () => kOutputSymbol,
  markErrorsAsReported: () => markErrorsAsReported,
  nonTerminalScreen: () => nonTerminalScreen,
  prepareErrorStack: () => prepareErrorStack,
  relativeFilePath: () => relativeFilePath,
  resolveOutputFile: () => resolveOutputFile,
  separator: () => separator,
  stepSuffix: () => stepSuffix,
  terminalScreen: () => terminalScreen
});
var import_path2 = __toESM(require("path"));
var import_stream = require("stream");
var import_util2 = require("../util");
var realColors = require("playwright-core/lib/utilsBundle").colors;
var { noColors } = require("playwright-core/lib/coreBundle").iso;
var { msToString } = require("playwright-core/lib/coreBundle").iso;
var { parseErrorStack } = require("playwright-core/lib/coreBundle").iso;
var { getPackageManagerExecCommand } = require("playwright-core/lib/coreBundle").utils;
var { fitToWidth } = require("playwright-core/lib/coreBundle").utils;
var kOutputSymbol = Symbol("output");
var DEFAULT_TTY_WIDTH = 100;
var DEFAULT_TTY_HEIGHT = 40;
var originalProcessStdout = process.stdout;
var originalProcessStderr = process.stderr;
var StripAnsiStream = class extends import_stream.Writable {
  constructor(target) {
    super();
    this._target = target;
  }
  _write(chunk, encoding, callback) {
    this._target.write((0, import_util2.stripAnsiEscapes)(chunk.toString()), callback);
  }
};
var terminalScreen = (() => {
  let isTTY = !!originalProcessStdout.isTTY;
  let ttyWidth = originalProcessStdout.columns || 0;
  let ttyHeight = originalProcessStdout.rows || 0;
  if (process.env.PLAYWRIGHT_FORCE_TTY === "false" || process.env.PLAYWRIGHT_FORCE_TTY === "0") {
    isTTY = false;
    ttyWidth = 0;
    ttyHeight = 0;
  } else if (process.env.PLAYWRIGHT_FORCE_TTY === "true" || process.env.PLAYWRIGHT_FORCE_TTY === "1") {
    isTTY = true;
    ttyWidth = originalProcessStdout.columns || DEFAULT_TTY_WIDTH;
    ttyHeight = originalProcessStdout.rows || DEFAULT_TTY_HEIGHT;
  } else if (process.env.PLAYWRIGHT_FORCE_TTY) {
    isTTY = true;
    const sizeMatch = process.env.PLAYWRIGHT_FORCE_TTY.match(/^(\d+)x(\d+)$/);
    if (sizeMatch) {
      ttyWidth = +sizeMatch[1];
      ttyHeight = +sizeMatch[2];
    } else {
      ttyWidth = +process.env.PLAYWRIGHT_FORCE_TTY;
      ttyHeight = DEFAULT_TTY_HEIGHT;
    }
    if (isNaN(ttyWidth))
      ttyWidth = DEFAULT_TTY_WIDTH;
    if (isNaN(ttyHeight))
      ttyHeight = DEFAULT_TTY_HEIGHT;
  }
  let useColors = isTTY;
  if (process.env.DEBUG_COLORS === "0" || process.env.DEBUG_COLORS === "false" || process.env.FORCE_COLOR === "0" || process.env.FORCE_COLOR === "false" || process.env.NO_COLOR !== void 0 && process.env.NO_COLOR !== "")
    useColors = false;
  else if (process.env.DEBUG_COLORS || process.env.FORCE_COLOR)
    useColors = true;
  const colors7 = useColors ? realColors : noColors;
  return {
    resolveFiles: "cwd",
    isTTY,
    ttyWidth,
    ttyHeight,
    colors: colors7,
    stdout: useColors ? originalProcessStdout : new StripAnsiStream(originalProcessStdout),
    stderr: useColors ? originalProcessStderr : new StripAnsiStream(originalProcessStderr)
  };
})();
var nonTerminalScreen = {
  colors: terminalScreen.colors,
  isTTY: false,
  ttyWidth: 0,
  ttyHeight: 0,
  resolveFiles: "rootDir"
};
var internalScreen = {
  colors: realColors,
  isTTY: false,
  ttyWidth: 0,
  ttyHeight: 0,
  resolveFiles: "rootDir"
};
var TerminalReporter = class {
  constructor(options = {}) {
    this.totalTestCount = 0;
    this.fileDurations = /* @__PURE__ */ new Map();
    this._fatalErrors = [];
    this._failureCount = 0;
    this.screen = options.screen ?? terminalScreen;
    this._options = options;
  }
  version() {
    return "v2";
  }
  onConfigure(config2) {
    this.config = config2;
  }
  onBegin(suite) {
    this.suite = suite;
    this.totalTestCount = suite.allTests().length;
  }
  onStdOut(chunk, test, result) {
    this._appendOutput({ chunk, type: "stdout" }, result);
  }
  onStdErr(chunk, test, result) {
    this._appendOutput({ chunk, type: "stderr" }, result);
  }
  _appendOutput(output, result) {
    if (!result)
      return;
    result[kOutputSymbol] = result[kOutputSymbol] || [];
    result[kOutputSymbol].push(output);
  }
  onTestEnd(test, result) {
    if (result.status !== "skipped" && result.status !== test.expectedStatus)
      ++this._failureCount;
    const projectName = test.titlePath()[1];
    const relativePath = relativeTestPath(this.screen, this.config, test);
    const fileAndProject = (projectName ? `[${projectName}] \u203A ` : "") + relativePath;
    const entry = this.fileDurations.get(fileAndProject) || { duration: 0, workers: /* @__PURE__ */ new Set() };
    entry.duration += result.duration;
    entry.workers.add(result.workerIndex);
    this.fileDurations.set(fileAndProject, entry);
  }
  onError(error) {
    this._fatalErrors.push(error);
  }
  async onEnd(result) {
    this.result = result;
  }
  fitToScreen(line, prefix) {
    if (!this.screen.ttyWidth) {
      return line;
    }
    return fitToWidth(line, this.screen.ttyWidth, prefix);
  }
  generateStartingMessage() {
    const jobs = this.config.metadata.actualWorkers ?? this.config.workers;
    const shardDetails = this.config.shard ? `, shard ${this.config.shard.current} of ${this.config.shard.total}` : "";
    if (!this.totalTestCount)
      return "";
    return "\n" + this.screen.colors.dim("Running ") + this.totalTestCount + this.screen.colors.dim(` test${this.totalTestCount !== 1 ? "s" : ""} using `) + jobs + this.screen.colors.dim(` worker${jobs !== 1 ? "s" : ""}${shardDetails}`);
  }
  getSlowTests() {
    if (!this.config.reportSlowTests)
      return [];
    const fileDurations = [...this.fileDurations.entries()].filter(([key, value]) => value.workers.size === 1).map(([key, value]) => [key, value.duration]);
    fileDurations.sort((a, b) => b[1] - a[1]);
    const count = Math.min(fileDurations.length, this.config.reportSlowTests.max || Number.POSITIVE_INFINITY);
    const threshold = this.config.reportSlowTests.threshold;
    return fileDurations.filter(([, duration]) => duration > threshold).slice(0, count);
  }
  generateSummaryMessage({ didNotRun, skipped, expected, interrupted, unexpected, flaky, fatalErrors }) {
    const tokens = [];
    if (unexpected.length) {
      tokens.push(this.screen.colors.red(`  ${unexpected.length} failed`));
      for (const test of unexpected)
        tokens.push(this.screen.colors.red(this.formatTestHeader(test, { indent: "    " })));
    }
    if (interrupted.length) {
      tokens.push(this.screen.colors.yellow(`  ${interrupted.length} interrupted`));
      for (const test of interrupted)
        tokens.push(this.screen.colors.yellow(this.formatTestHeader(test, { indent: "    " })));
    }
    if (flaky.length) {
      tokens.push(this.screen.colors.yellow(`  ${flaky.length} flaky`));
      for (const test of flaky)
        tokens.push(this.screen.colors.yellow(this.formatTestHeader(test, { indent: "    " })));
    }
    if (skipped)
      tokens.push(this.screen.colors.yellow(`  ${skipped} skipped`));
    if (didNotRun)
      tokens.push(this.screen.colors.yellow(`  ${didNotRun} did not run`));
    if (expected)
      tokens.push(this.screen.colors.green(`  ${expected} passed`) + this.screen.colors.dim(` (${msToString(this.result.duration)})`));
    if (fatalErrors.length && expected + unexpected.length + interrupted.length + flaky.length > 0)
      tokens.push(this.screen.colors.red(`  ${fatalErrors.length === 1 ? "1 error was not a part of any test" : fatalErrors.length + " errors were not a part of any test"}, see above for details`));
    return tokens.join("\n");
  }
  generateSummary() {
    let didNotRun = 0;
    let skipped = 0;
    let expected = 0;
    const interrupted = [];
    const interruptedToPrint = [];
    const unexpected = [];
    const flaky = [];
    this.suite.allTests().forEach((test) => {
      switch (test.outcome()) {
        case "skipped": {
          if (test.results.some((result) => result.status === "interrupted")) {
            if (test.results.some((result) => !!result.error))
              interruptedToPrint.push(test);
            interrupted.push(test);
          } else if (!test.results.length || test.expectedStatus !== "skipped") {
            ++didNotRun;
          } else {
            ++skipped;
          }
          break;
        }
        case "expected":
          ++expected;
          break;
        case "unexpected":
          unexpected.push(test);
          break;
        case "flaky":
          flaky.push(test);
          break;
      }
    });
    const failuresToPrint = [...unexpected, ...flaky, ...interruptedToPrint];
    return {
      didNotRun,
      skipped,
      expected,
      interrupted,
      unexpected,
      flaky,
      failuresToPrint,
      fatalErrors: this._fatalErrors
    };
  }
  epilogue(full) {
    const summary = this.generateSummary();
    const summaryMessage = this.generateSummaryMessage(summary);
    if (full && summary.failuresToPrint.length && !this._options.omitFailures)
      this._printFailures(summary.failuresToPrint);
    this._printSlowTests();
    this._printSummary(summaryMessage);
  }
  _printFailures(failures) {
    this.writeLine("");
    failures.forEach((test, index) => {
      this.writeLine(this.formatFailure(test, index + 1));
    });
  }
  _printSlowTests() {
    const slowTests = this.getSlowTests();
    slowTests.forEach(([file, duration]) => {
      this.writeLine(this.screen.colors.yellow("  Slow test file: ") + file + this.screen.colors.yellow(` (${msToString(duration)})`));
    });
    if (slowTests.length)
      this.writeLine(this.screen.colors.yellow("  Consider running tests from slow files in parallel. See: https://playwright.dev/docs/test-parallel"));
  }
  _printSummary(summary) {
    if (summary.trim())
      this.writeLine(summary);
  }
  willRetry(test) {
    return test.outcome() === "unexpected" && test.results.length <= test.retries;
  }
  formatTestTitle(test, step) {
    return formatTestTitle(this.screen, this.config, test, step, this._options);
  }
  formatTestHeader(test, options = {}) {
    return formatTestHeader(this.screen, this.config, test, { ...options, includeTestId: this._options.includeTestId });
  }
  formatFailure(test, index) {
    return formatFailure(this.screen, this.config, test, index, this._options);
  }
  formatError(error) {
    return formatError(this.screen, error);
  }
  formatResultErrors(test, result) {
    return formatResultErrors(this.screen, test, result);
  }
  writeLine(line) {
    this.screen.stdout?.write(line ? line + "\n" : "\n");
  }
};
function formatResultErrors(screen, test, result) {
  const lines = [];
  if (test.outcome() === "unexpected") {
    const errorDetails = formatResultFailure(screen, test, result, "    ");
    if (errorDetails.length > 0)
      lines.push("");
    for (const error of errorDetails)
      lines.push(error.message, "");
  }
  return lines.join("\n");
}
function formatFailure(screen, config2, test, index, options) {
  const lines = [];
  let printedHeader = false;
  for (const result of test.results) {
    const resultLines = [];
    const errors = formatResultFailure(screen, test, result, "    ");
    if (!errors.length)
      continue;
    if (!printedHeader) {
      const header = formatTestHeader(screen, config2, test, { indent: "  ", index, mode: "error", includeTestId: options?.includeTestId });
      lines.push(screen.colors.red(header));
      printedHeader = true;
    }
    if (result.retry) {
      resultLines.push("");
      resultLines.push(screen.colors.gray(separator(screen, `    Retry #${result.retry}`)));
    }
    resultLines.push(...errors.map((error) => "\n" + error.message));
    const attachmentGroups = groupAttachments(result.attachments);
    for (let i = 0; i < attachmentGroups.length; ++i) {
      const attachment = attachmentGroups[i];
      if (attachment.name === "error-context" && attachment.path) {
        resultLines.push("");
        resultLines.push(screen.colors.dim(`    Error Context: ${relativeFilePath(screen, config2, attachment.path)}`));
        continue;
      }
      if (attachment.name.startsWith("_"))
        continue;
      const hasPrintableContent = attachment.contentType.startsWith("text/");
      if (!attachment.path && !hasPrintableContent)
        continue;
      resultLines.push("");
      resultLines.push(screen.colors.dim(separator(screen, `    attachment #${i + 1}: ${screen.colors.bold(attachment.name)} (${attachment.contentType})`)));
      if (attachment.actual?.path) {
        if (attachment.expected?.path) {
          const expectedPath = relativeFilePath(screen, config2, attachment.expected.path);
          resultLines.push(screen.colors.dim(`    Expected: ${expectedPath}`));
        }
        const actualPath = relativeFilePath(screen, config2, attachment.actual.path);
        resultLines.push(screen.colors.dim(`    Received: ${actualPath}`));
        if (attachment.previous?.path) {
          const previousPath = relativeFilePath(screen, config2, attachment.previous.path);
          resultLines.push(screen.colors.dim(`    Previous: ${previousPath}`));
        }
        if (attachment.diff?.path) {
          const diffPath = relativeFilePath(screen, config2, attachment.diff.path);
          resultLines.push(screen.colors.dim(`    Diff:     ${diffPath}`));
        }
      } else if (attachment.path) {
        const relativePath = relativeFilePath(screen, config2, attachment.path);
        resultLines.push(screen.colors.dim(`    ${relativePath}`));
        if (attachment.name === "trace") {
          const packageManagerCommand = getPackageManagerExecCommand();
          resultLines.push(screen.colors.dim(`    Usage:`));
          resultLines.push("");
          resultLines.push(screen.colors.dim(`        ${packageManagerCommand} playwright show-trace ${quotePathIfNeeded(relativePath)}`));
          resultLines.push("");
        }
      } else {
        if (attachment.contentType.startsWith("text/") && attachment.body) {
          let text = attachment.body.toString();
          if (text.length > 300)
            text = text.slice(0, 300) + "...";
          for (const line of text.split("\n"))
            resultLines.push(screen.colors.dim(`    ${line}`));
        }
      }
      resultLines.push(screen.colors.dim(separator(screen, "   ")));
    }
    lines.push(...resultLines);
  }
  lines.push("");
  return lines.join("\n");
}
function formatRetry(screen, result) {
  const retryLines = [];
  if (result.retry) {
    retryLines.push("");
    retryLines.push(screen.colors.gray(separator(screen, `    Retry #${result.retry}`)));
  }
  return retryLines;
}
function quotePathIfNeeded(path20) {
  if (/\s/.test(path20))
    return `"${path20}"`;
  return path20;
}
var kReportedSymbol = Symbol("reported");
function markErrorsAsReported(result) {
  result[kReportedSymbol] = result.errors.length;
}
function formatResultFailure(screen, test, result, initialIndent) {
  const errorDetails = [];
  if (result.status === "passed" && test.expectedStatus === "failed") {
    errorDetails.push({
      message: indent(screen.colors.red(`Expected to fail, but passed.`), initialIndent)
    });
  }
  if (result.status === "interrupted") {
    errorDetails.push({
      message: indent(screen.colors.red(`Test was interrupted.`), initialIndent)
    });
  }
  const reportedIndex = result[kReportedSymbol] || 0;
  for (const error of result.errors.slice(reportedIndex)) {
    const formattedError = formatError(screen, error);
    errorDetails.push({
      message: indent(formattedError.message, initialIndent),
      location: formattedError.location
    });
  }
  return errorDetails;
}
function relativeFilePath(screen, config2, file) {
  if (screen.resolveFiles === "cwd")
    return import_path2.default.relative(process.cwd(), file);
  return import_path2.default.relative(config2.rootDir, file);
}
function relativeTestPath(screen, config2, test) {
  return relativeFilePath(screen, config2, test.location.file);
}
function stepSuffix(step) {
  const stepTitles = step ? step.titlePath() : [];
  return stepTitles.map((t2) => t2.split("\n")[0]).map((t2) => " \u203A " + t2).join("");
}
function formatTestTitle(screen, config2, test, step, options = {}) {
  const [, projectName, , ...titles] = test.titlePath();
  const location = `${relativeTestPath(screen, config2, test)}:${test.location.line}:${test.location.column}`;
  const testId = options.includeTestId ? `[id=${test.id}] ` : "";
  const projectLabel = options.includeTestId ? `project=` : "";
  const projectTitle = projectName ? `[${projectLabel}${projectName}] \u203A ` : "";
  const testTitle = `${testId}${projectTitle}${location} \u203A ${titles.join(" \u203A ")}`;
  const extraTags = test.tags.filter((t2) => !testTitle.includes(t2) && !config2.tags.includes(t2));
  return `${testTitle}${stepSuffix(step)}${extraTags.length ? " " + extraTags.join(" ") : ""}`;
}
function formatTestHeader(screen, config2, test, options = {}) {
  const title = formatTestTitle(screen, config2, test, void 0, options);
  const header = `${options.indent || ""}${options.index ? options.index + ") " : ""}${title}`;
  let fullHeader = header;
  if (options.mode === "error") {
    const stepPaths = /* @__PURE__ */ new Set();
    for (const result of test.results.filter((r) => !!r.errors.length)) {
      const stepPath = [];
      const visit = (steps) => {
        const errors = steps.filter((s) => s.error);
        if (errors.length > 1)
          return;
        if (errors.length === 1 && errors[0].category === "test.step") {
          stepPath.push(errors[0].title);
          visit(errors[0].steps);
        }
      };
      visit(result.steps);
      stepPaths.add(["", ...stepPath].join(" \u203A "));
    }
    fullHeader = header + (stepPaths.size === 1 ? stepPaths.values().next().value : "");
  }
  return separator(screen, fullHeader);
}
function formatError(screen, error) {
  const message = error.message || error.value || "";
  const stack = error.stack;
  if (!stack && !error.location)
    return { message };
  const tokens = [];
  const parsedStack = stack ? prepareErrorStack(stack) : void 0;
  tokens.push(parsedStack?.message || message);
  if (error.snippet) {
    let snippet = error.snippet;
    if (!screen.colors.enabled)
      snippet = (0, import_util2.stripAnsiEscapes)(snippet);
    tokens.push("");
    tokens.push(snippet);
  }
  if (parsedStack && parsedStack.stackLines.length)
    tokens.push(screen.colors.dim(parsedStack.stackLines.join("\n")));
  let location = error.location;
  if (parsedStack && !location)
    location = parsedStack.location;
  if (error.cause)
    tokens.push(screen.colors.dim("[cause]: ") + formatError(screen, error.cause).message);
  return {
    location,
    message: tokens.join("\n")
  };
}
function separator(screen, text = "") {
  if (text)
    text += " ";
  const columns = Math.min(100, screen.ttyWidth || 100);
  return text + screen.colors.dim("\u2500".repeat(Math.max(0, columns - (0, import_util2.stripAnsiEscapes)(text).length)));
}
function indent(lines, tab) {
  return lines.replace(/^(?=.+$)/gm, tab);
}
function prepareErrorStack(stack) {
  return parseErrorStack(stack, import_path2.default.sep, !!process.env.PWDEBUGIMPL);
}
function resolveFromEnv(name) {
  const value = process.env[name];
  if (value)
    return import_path2.default.resolve(process.cwd(), value);
  return void 0;
}
function resolveOutputFile(reporterName, options) {
  const name = reporterName.toUpperCase();
  let outputFile = resolveFromEnv(`PLAYWRIGHT_${name}_OUTPUT_FILE`);
  if (!outputFile && options.outputFile)
    outputFile = import_path2.default.resolve(options.configDir, options.outputFile);
  if (outputFile)
    return { outputFile };
  let outputDir = resolveFromEnv(`PLAYWRIGHT_${name}_OUTPUT_DIR`);
  if (!outputDir && options.outputDir)
    outputDir = import_path2.default.resolve(options.configDir, options.outputDir);
  if (!outputDir && options.default)
    outputDir = (0, import_util2.resolveReporterOutputPath)(options.default.outputDir, options.configDir, void 0);
  if (!outputDir)
    outputDir = options.configDir;
  const reportName = process.env[`PLAYWRIGHT_${name}_OUTPUT_NAME`] ?? options.fileName ?? options.default?.fileName;
  if (!reportName)
    return void 0;
  outputFile = import_path2.default.resolve(outputDir, reportName);
  return { outputFile, outputDir };
}
function groupAttachments(attachments) {
  const result = [];
  const attachmentsByPrefix = /* @__PURE__ */ new Map();
  for (const attachment of attachments) {
    if (!attachment.path) {
      result.push(attachment);
      continue;
    }
    const match = attachment.name.match(/^(.*)-(expected|actual|diff|previous)(\.[^.]+)?$/);
    if (!match) {
      result.push(attachment);
      continue;
    }
    const [, name, category] = match;
    let group = attachmentsByPrefix.get(name);
    if (!group) {
      group = { ...attachment, name };
      attachmentsByPrefix.set(name, group);
      result.push(group);
    }
    if (category === "expected")
      group.expected = attachment;
    else if (category === "actual")
      group.actual = attachment;
    else if (category === "diff")
      group.diff = attachment;
    else if (category === "previous")
      group.previous = attachment;
  }
  return result;
}

// packages/playwright/src/reporters/internalReporter.ts
var import_fs = __toESM(require("fs"));

// packages/playwright/src/reporters/multiplexer.ts
var Multiplexer = class {
  constructor(reporters) {
    this._reporters = reporters;
  }
  version() {
    return "v2";
  }
  onConfigure(config2) {
    for (const reporter of this._reporters)
      wrap(() => reporter.onConfigure?.(config2));
  }
  onBegin(suite) {
    for (const reporter of this._reporters)
      wrap(() => reporter.onBegin?.(suite));
  }
  onTestBegin(test, result) {
    for (const reporter of this._reporters)
      wrap(() => reporter.onTestBegin?.(test, result));
  }
  onStdOut(chunk, test, result) {
    for (const reporter of this._reporters)
      wrap(() => reporter.onStdOut?.(chunk, test, result));
  }
  onStdErr(chunk, test, result) {
    for (const reporter of this._reporters)
      wrap(() => reporter.onStdErr?.(chunk, test, result));
  }
  async onTestPaused(test, result) {
    for (const reporter of this._reporters)
      await wrapAsync(() => reporter.onTestPaused?.(test, result));
  }
  onTestEnd(test, result) {
    for (const reporter of this._reporters)
      wrap(() => reporter.onTestEnd?.(test, result));
  }
  onReportConfigure(params) {
    for (const reporter of this._reporters)
      wrap(() => reporter.onReportConfigure?.(params));
  }
  onReportEnd(params) {
    for (const reporter of this._reporters)
      wrap(() => reporter.onReportEnd?.(params));
  }
  async onEnd(result) {
    for (const reporter of this._reporters) {
      const outResult = await wrapAsync(() => reporter.onEnd?.(result));
      if (outResult?.status)
        result.status = outResult.status;
    }
    return result;
  }
  async onExit() {
    for (const reporter of this._reporters)
      await wrapAsync(() => reporter.onExit?.());
  }
  onError(error, workerInfo) {
    for (const reporter of this._reporters)
      wrap(() => reporter.onError?.(error, workerInfo));
  }
  onStepBegin(test, result, step) {
    for (const reporter of this._reporters)
      wrap(() => reporter.onStepBegin?.(test, result, step));
  }
  onStepEnd(test, result, step) {
    for (const reporter of this._reporters)
      wrap(() => reporter.onStepEnd?.(test, result, step));
  }
  printsToStdio() {
    return this._reporters.some((r) => {
      let prints = false;
      wrap(() => prints = r.printsToStdio ? r.printsToStdio() : true);
      return prints;
    });
  }
};
async function wrapAsync(callback) {
  try {
    return await callback();
  } catch (e) {
    console.error("Error in reporter", e);
  }
}
function wrap(callback) {
  try {
    callback();
  } catch (e) {
    console.error("Error in reporter", e);
  }
}

// packages/playwright/src/reporters/internalReporter.ts
var import_common = require("../common");
var babel = __toESM(require("../transform/babelBundle"));

// packages/playwright/src/reporters/reporterV2.ts
function wrapReporterAsV2(reporter) {
  try {
    if ("version" in reporter && reporter.version() === "v2")
      return reporter;
  } catch (e) {
  }
  return new ReporterV2Wrapper(reporter);
}
var ReporterV2Wrapper = class {
  constructor(reporter) {
    this._deferred = [];
    this._reporter = reporter;
  }
  version() {
    return "v2";
  }
  onConfigure(config2) {
    this._config = config2;
  }
  onBegin(suite) {
    this._reporter.onBegin?.(this._config, suite);
    const deferred = this._deferred;
    this._deferred = null;
    for (const item of deferred) {
      if (item.error)
        this.onError(item.error.error, item.error.workerInfo);
      if (item.stdout)
        this.onStdOut(item.stdout.chunk, item.stdout.test, item.stdout.result);
      if (item.stderr)
        this.onStdErr(item.stderr.chunk, item.stderr.test, item.stderr.result);
    }
  }
  onTestBegin(test, result) {
    this._reporter.onTestBegin?.(test, result);
  }
  onStdOut(chunk, test, result) {
    if (this._deferred) {
      this._deferred.push({ stdout: { chunk, test, result } });
      return;
    }
    this._reporter.onStdOut?.(chunk, test, result);
  }
  onStdErr(chunk, test, result) {
    if (this._deferred) {
      this._deferred.push({ stderr: { chunk, test, result } });
      return;
    }
    this._reporter.onStdErr?.(chunk, test, result);
  }
  onTestEnd(test, result) {
    this._reporter.onTestEnd?.(test, result);
  }
  async onEnd(result) {
    return await this._reporter.onEnd?.(result);
  }
  async onExit() {
    await this._reporter.onExit?.();
  }
  onError(error, workerInfo) {
    if (this._deferred) {
      this._deferred.push({ error: { error, workerInfo } });
      return;
    }
    this._reporter.onError?.(error, workerInfo);
  }
  onStepBegin(test, result, step) {
    this._reporter.onStepBegin?.(test, result, step);
  }
  onStepEnd(test, result, step) {
    this._reporter.onStepEnd?.(test, result, step);
  }
  printsToStdio() {
    return this._reporter.printsToStdio ? this._reporter.printsToStdio() : true;
  }
};

// packages/playwright/src/reporters/internalReporter.ts
var { monotonicTime: monotonicTime3 } = require("playwright-core/lib/coreBundle").iso;
var InternalReporter = class {
  constructor(reporters) {
    this._didBegin = false;
    this._reporter = new Multiplexer(reporters.map(wrapReporterAsV2));
  }
  version() {
    return "v2";
  }
  onConfigure(config2) {
    this._config = config2;
    this._startTime = /* @__PURE__ */ new Date();
    this._monotonicStartTime = monotonicTime3();
    this._reporter.onConfigure?.(config2);
  }
  onBegin(suite) {
    this._didBegin = true;
    this._reporter.onBegin?.(suite);
  }
  onTestBegin(test, result) {
    this._reporter.onTestBegin?.(test, result);
  }
  onStdOut(chunk, test, result) {
    this._reporter.onStdOut?.(chunk, test, result);
  }
  onStdErr(chunk, test, result) {
    this._reporter.onStdErr?.(chunk, test, result);
  }
  async onTestPaused(test, result) {
    this._addSnippetToTestErrors(test, result);
    return await this._reporter.onTestPaused?.(test, result);
  }
  onTestEnd(test, result) {
    this._addSnippetToTestErrors(test, result);
    this._reporter.onTestEnd?.(test, result);
  }
  async onEnd(result) {
    if (!this._didBegin) {
      this.onBegin(new import_common.test.Suite("", "root"));
    }
    return await this._reporter.onEnd?.({
      ...result,
      startTime: this._startTime,
      duration: monotonicTime3() - this._monotonicStartTime
    });
  }
  async onExit() {
    await this._reporter.onExit?.();
  }
  onError(error, workerInfo) {
    addLocationAndSnippetToError(this._config, error);
    this._reporter.onError?.(error, workerInfo);
  }
  onStepBegin(test, result, step) {
    this._reporter.onStepBegin?.(test, result, step);
  }
  onStepEnd(test, result, step) {
    this._addSnippetToStepError(test, step);
    this._reporter.onStepEnd?.(test, result, step);
  }
  printsToStdio() {
    return this._reporter.printsToStdio ? this._reporter.printsToStdio() : true;
  }
  _addSnippetToTestErrors(test, result) {
    for (const error of result.errors)
      addLocationAndSnippetToError(this._config, error, test.location.file);
  }
  _addSnippetToStepError(test, step) {
    if (step.error)
      addLocationAndSnippetToError(this._config, step.error, test.location.file);
  }
};
function addLocationAndSnippetToError(config2, error, file) {
  if (error.stack && !error.location)
    error.location = prepareErrorStack(error.stack).location;
  const location = error.location;
  if (!location)
    return;
  if (!!error.snippet)
    return;
  try {
    const tokens = [];
    const source = import_fs.default.readFileSync(location.file, "utf8");
    const codeFrame = babel.codeFrameColumns(source, { start: location }, { highlightCode: true });
    if (!file || import_fs.default.realpathSync(file) !== location.file) {
      tokens.push(internalScreen.colors.gray(`   at `) + `${relativeFilePath(internalScreen, config2, location.file)}:${location.line}`);
      tokens.push("");
    }
    tokens.push(codeFrame);
    error.snippet = tokens.join("\n");
  } catch (e) {
  }
}

// packages/playwright/src/runner/testRunner.ts
var import_util14 = require("../util");

// packages/playwright/src/runner/reporters.ts
var reporters_exports = {};
__export(reporters_exports, {
  createErrorCollectingReporter: () => createErrorCollectingReporter,
  createReporters: () => createReporters
});
var import_fs8 = __toESM(require("fs"));

// packages/playwright/src/runner/loadUtils.ts
var import_path4 = __toESM(require("path"));
var import_fs3 = __toESM(require("fs"));

// packages/playwright/src/runner/processHost.ts
var import_child_process = __toESM(require("child_process"));
var import_events = require("events");
var debug3 = require("playwright-core/lib/utilsBundle").debug;
var { assert } = require("playwright-core/lib/coreBundle").iso;
var { monotonicTime: monotonicTime4, timeOrigin } = require("playwright-core/lib/coreBundle").iso;
var { raceAgainstDeadline: raceAgainstDeadline2 } = require("playwright-core/lib/coreBundle").iso;
var ProcessHost = class extends import_events.EventEmitter {
  constructor(entryScript, processName, env) {
    super();
    this._didSendStop = false;
    this._processDidExit = false;
    this._didExitAndRanOnExit = false;
    this._lastMessageId = 0;
    this._callbacks = /* @__PURE__ */ new Map();
    this._producedEnv = {};
    this._requestHandlers = /* @__PURE__ */ new Map();
    this._entryScript = entryScript;
    this._processName = processName;
    this._extraEnv = env;
  }
  async startRunner(runnerParams, options = {}) {
    assert(!this.process, "Internal error: starting the same process twice");
    this.process = import_child_process.default.fork(this._entryScript, {
      // Note: we pass detached:false, so that workers are in the same process group.
      // This way Ctrl+C or a kill command can shutdown all workers in case they misbehave.
      // Otherwise user can end up with a bunch of workers stuck in a busy loop without self-destructing.
      detached: false,
      env: {
        ...process.env,
        ...this._extraEnv
      },
      stdio: [
        "ignore",
        options.onStdOut ? "pipe" : "inherit",
        options.onStdErr && !process.env.PW_RUNNER_DEBUG ? "pipe" : "inherit",
        "ipc"
      ]
    });
    this.process.on("exit", async (code, signal) => {
      this._processDidExit = true;
      await this.onExit();
      this._didExitAndRanOnExit = true;
      this.emit("exit", { unexpectedly: !this._didSendStop, code, signal });
    });
    this.process.on("error", (e) => {
    });
    this.process.on("message", (message) => {
      if (debug3.enabled("pw:test:protocol"))
        debug3("pw:test:protocol")("\u25C0 RECV " + JSON.stringify(message));
      if (message.method === "__env_produced__") {
        const producedEnv = message.params;
        this._producedEnv = Object.fromEntries(producedEnv.map((e) => [e[0], e[1] ?? void 0]));
      } else if (message.method === "__dispatch__") {
        const { id, error: error2, method, params, result } = message.params;
        if (id && this._callbacks.has(id)) {
          const { resolve, reject } = this._callbacks.get(id);
          this._callbacks.delete(id);
          if (error2) {
            const errorObject = new Error(error2.message);
            errorObject.stack = error2.stack;
            reject(errorObject);
          } else {
            resolve(result);
          }
        } else {
          this.emit(method, params);
        }
      } else if (message.method === "__request__") {
        const { id, method, params } = message.params;
        const handler = this._requestHandlers.get(method);
        if (!handler) {
          this.send({ method: "__response__", params: { id, error: { message: "Unknown method" } } });
        } else {
          handler(params).then((result) => {
            this.send({ method: "__response__", params: { id, result } });
          }).catch((error2) => {
            this.send({ method: "__response__", params: { id, error: { message: error2.message } } });
          });
        }
      } else {
        this.emit(message.method, message.params);
      }
    });
    if (options.onStdOut)
      this.process.stdout?.on("data", options.onStdOut);
    if (options.onStdErr)
      this.process.stderr?.on("data", options.onStdErr);
    const error = await new Promise((resolve) => {
      this.process.once("exit", (code, signal) => resolve({ unexpectedly: true, code, signal }));
      this.once("ready", () => resolve(void 0));
    });
    if (error)
      return error;
    const processParams = {
      processName: this._processName,
      timeOrigin: timeOrigin()
    };
    this.send({
      method: "__init__",
      params: {
        processParams,
        runnerParams
      }
    });
  }
  sendMessage(message) {
    const id = ++this._lastMessageId;
    this.send({
      method: "__dispatch__",
      params: { id, ...message }
    });
    return new Promise((resolve, reject) => {
      this._callbacks.set(id, { resolve, reject });
    });
  }
  sendMessageNoReply(message) {
    this.sendMessage(message).catch(() => {
    });
  }
  async onExit() {
  }
  onRequest(method, handler) {
    this._requestHandlers.set(method, handler);
  }
  async stop() {
    if (!this._processDidExit && !this._didSendStop) {
      this.send({ method: "__stop__" });
      this._didSendStop = true;
    }
    if (this._didExitAndRanOnExit)
      return;
    const exitPromise = new Promise((f) => this.once("exit", () => f()));
    const timeout = +(process.env.PWTEST_CHILD_PROCESS_TIMEOUT || 5 * 60 * 1e3);
    const result = await raceAgainstDeadline2(() => exitPromise, monotonicTime4() + timeout);
    if (result.timedOut) {
      this.emit("processError", { message: `Error: ${this._processName} process did not exit within ${timeout}ms after stop, force-killed it` });
      this._forceKill();
      await exitPromise;
    }
  }
  _forceKill() {
    const pid = this.process?.pid;
    if (!pid)
      return;
    try {
      if (process.platform === "win32")
        import_child_process.default.spawnSync(`taskkill /pid ${pid} /T /F`, { shell: true });
      else
        process.kill(pid, "SIGKILL");
    } catch {
    }
  }
  didSendStop() {
    return this._didSendStop;
  }
  producedEnv() {
    return this._producedEnv;
  }
  send(message) {
    if (debug3.enabled("pw:test:protocol"))
      debug3("pw:test:protocol")("SEND \u25BA " + JSON.stringify(message));
    this.process?.send(message);
  }
};

// packages/playwright/src/runner/loaderHost.ts
var import_common2 = require("../common");
var InProcessLoaderHost = class {
  constructor(config2) {
    this._config = config2;
    this._poolBuilder = import_common2.poolBuilder.PoolBuilder.createForLoader();
  }
  async start(errors) {
    return true;
  }
  async loadTestFile(file, testErrors) {
    const result = await import_common2.testLoader.loadTestFile(file, this._config, testErrors);
    this._poolBuilder.buildPools(result, testErrors);
    return result;
  }
  async stop() {
    await import_common2.transform.incorporateCompilationCache();
  }
};
var OutOfProcessLoaderHost = class {
  constructor(config2) {
    this._config = config2;
    this._processHost = new ProcessHost(require.resolve("../loader/loaderProcessEntry.js"), "loader", {});
  }
  async start(errors) {
    const startError = await this._processHost.startRunner(import_common2.ipc.serializeConfig(this._config, false));
    if (startError) {
      errors.push({
        message: `Test loader process failed to start with code "${startError.code}" and signal "${startError.signal}"`
      });
      return false;
    }
    return true;
  }
  async loadTestFile(file, testErrors) {
    const result = await this._processHost.sendMessage({ method: "loadTestFile", params: { file } });
    testErrors.push(...result.testErrors);
    return import_common2.test.Suite._deepParse(result.fileSuite);
  }
  async stop() {
    const result = await this._processHost.sendMessage({ method: "getCompilationCacheFromLoader" });
    import_common2.cc.addToCompilationCache(result);
    await this._processHost.stop();
  }
};

// packages/playwright/src/runner/loadUtils.ts
var import_util5 = require("../util");

// packages/playwright/src/runner/projectUtils.ts
var projectUtils_exports = {};
__export(projectUtils_exports, {
  buildDependentProjects: () => buildDependentProjects,
  buildProjectsClosure: () => buildProjectsClosure,
  buildTeardownToSetupsMap: () => buildTeardownToSetupsMap,
  collectFilesForProject: () => collectFilesForProject,
  filterProjects: () => filterProjects,
  findTopLevelProjects: () => findTopLevelProjects
});
var import_fs2 = __toESM(require("fs"));
var import_path3 = __toESM(require("path"));
var import_util3 = require("util");
var import_util4 = require("../util");
var minimatch = require("playwright-core/lib/utilsBundle").minimatch;
var { escapeRegExp } = require("playwright-core/lib/coreBundle").iso;
var readFileAsync = (0, import_util3.promisify)(import_fs2.default.readFile);
var readDirAsync = (0, import_util3.promisify)(import_fs2.default.readdir);
function wildcardPatternToRegExp(pattern) {
  return new RegExp("^" + pattern.split("*").map(escapeRegExp).join(".*") + "$", "ig");
}
function filterProjects(projects, projectNames) {
  if (!projectNames)
    return [...projects];
  const projectNamesToFind = /* @__PURE__ */ new Set();
  const unmatchedProjectNames = /* @__PURE__ */ new Map();
  const patterns = /* @__PURE__ */ new Set();
  for (const name of projectNames) {
    const lowerCaseName = name.toLocaleLowerCase();
    if (lowerCaseName.includes("*")) {
      patterns.add(wildcardPatternToRegExp(lowerCaseName));
    } else {
      projectNamesToFind.add(lowerCaseName);
      unmatchedProjectNames.set(lowerCaseName, name);
    }
  }
  const result = projects.filter((project) => {
    const lowerCaseName = project.project.name.toLocaleLowerCase();
    if (projectNamesToFind.has(lowerCaseName)) {
      unmatchedProjectNames.delete(lowerCaseName);
      return true;
    }
    for (const regex of patterns) {
      regex.lastIndex = 0;
      if (regex.test(lowerCaseName))
        return true;
    }
    return false;
  });
  if (unmatchedProjectNames.size) {
    const unknownProjectNames = Array.from(unmatchedProjectNames.values()).map((n) => `"${n}"`).join(", ");
    throw new Error(`Project(s) ${unknownProjectNames} not found. Available projects: ${projects.map((p) => `"${p.project.name}"`).join(", ")}`);
  }
  if (!result.length) {
    const allProjects = projects.map((p) => `"${p.project.name}"`).join(", ");
    throw new Error(`No projects matched. Available projects: ${allProjects}`);
  }
  return result;
}
function buildTeardownToSetupsMap(projects) {
  const result = /* @__PURE__ */ new Map();
  for (const project of projects) {
    if (project.teardown) {
      const setups = result.get(project.teardown) || [];
      setups.push(project);
      result.set(project.teardown, setups);
    }
  }
  return result;
}
function buildProjectsClosure(projects, hasTests) {
  const result = /* @__PURE__ */ new Map();
  const visit = (depth, project) => {
    if (depth > 100) {
      const error = new Error("Circular dependency detected between projects.");
      error.stack = "";
      throw error;
    }
    if (depth === 0 && hasTests && !hasTests(project))
      return;
    if (result.get(project) !== "dependency")
      result.set(project, depth ? "dependency" : "top-level");
    for (const dep of project.deps)
      visit(depth + 1, dep);
    if (project.teardown)
      visit(depth + 1, project.teardown);
  };
  for (const p of projects)
    visit(0, p);
  return result;
}
function findTopLevelProjects(config2) {
  const closure = buildProjectsClosure(config2.projects);
  return [...closure].filter((entry) => entry[1] === "top-level").map((entry) => entry[0]);
}
function buildDependentProjects(forProjects, projects) {
  const reverseDeps = new Map(projects.map((p) => [p, []]));
  for (const project of projects) {
    for (const dep of project.deps)
      reverseDeps.get(dep).push(project);
  }
  const result = /* @__PURE__ */ new Set();
  const visit = (depth, project) => {
    if (depth > 100) {
      const error = new Error("Circular dependency detected between projects.");
      error.stack = "";
      throw error;
    }
    result.add(project);
    for (const reverseDep of reverseDeps.get(project))
      visit(depth + 1, reverseDep);
    if (project.teardown)
      visit(depth + 1, project.teardown);
  };
  for (const forProject of forProjects)
    visit(0, forProject);
  return result;
}
async function collectFilesForProject(project, fsCache = /* @__PURE__ */ new Map()) {
  const extensions = /* @__PURE__ */ new Set([".js", ".ts", ".mjs", ".mts", ".cjs", ".cts", ".jsx", ".tsx", ".mjsx", ".mtsx", ".cjsx", ".ctsx"]);
  const testFileExtension = (file) => extensions.has(import_path3.default.extname(file));
  const allFiles = await cachedCollectFiles(project.project.testDir, project.respectGitIgnore, fsCache);
  const testMatch = (0, import_util4.createFileMatcher)(project.project.testMatch);
  const testIgnore = (0, import_util4.createFileMatcher)(project.project.testIgnore);
  const testFiles = allFiles.filter((file) => {
    if (!testFileExtension(file))
      return false;
    const isTest = !testIgnore(file) && testMatch(file);
    if (!isTest)
      return false;
    return true;
  });
  return testFiles;
}
async function cachedCollectFiles(testDir, respectGitIgnore, fsCache) {
  const key = testDir + ":" + respectGitIgnore;
  let result = fsCache.get(key);
  if (!result) {
    result = await collectFiles(testDir, respectGitIgnore);
    fsCache.set(key, result);
  }
  return result;
}
async function collectFiles(testDir, respectGitIgnore) {
  if (!import_fs2.default.existsSync(testDir))
    return [];
  if (!import_fs2.default.statSync(testDir).isDirectory())
    return [];
  const checkIgnores = (entryPath, rules, isDirectory, parentStatus) => {
    let status = parentStatus;
    for (const rule of rules) {
      const ruleIncludes = rule.negate;
      if (status === "included" === ruleIncludes)
        continue;
      const relative = import_path3.default.relative(rule.dir, entryPath);
      if (rule.match("/" + relative) || rule.match(relative)) {
        status = ruleIncludes ? "included" : "ignored";
      } else if (isDirectory && (rule.match("/" + relative + "/") || rule.match(relative + "/"))) {
        status = ruleIncludes ? "included" : "ignored";
      } else if (isDirectory && ruleIncludes && (rule.match("/" + relative, true) || rule.match(relative, true))) {
        status = "ignored-but-recurse";
      }
    }
    return status;
  };
  const files = [];
  const visit = async (dir, rules, status) => {
    const entries = await readDirAsync(dir, { withFileTypes: true });
    entries.sort((a, b) => a.name.localeCompare(b.name));
    if (respectGitIgnore) {
      const gitignore = entries.find((e) => e.isFile() && e.name === ".gitignore");
      if (gitignore) {
        const content = await readFileAsync(import_path3.default.join(dir, gitignore.name), "utf8");
        const newRules = content.split(/\r?\n/).map((s) => {
          s = s.trim();
          if (!s)
            return;
          const rule = new minimatch.Minimatch(s, { matchBase: true, dot: true, flipNegate: true });
          if (rule.comment)
            return;
          rule.dir = dir;
          return rule;
        }).filter((rule) => !!rule);
        rules = [...rules, ...newRules];
      }
    }
    for (const entry of entries) {
      if (entry.name === "." || entry.name === "..")
        continue;
      if (entry.isFile() && entry.name === ".gitignore")
        continue;
      if (entry.isDirectory() && entry.name === "node_modules")
        continue;
      const entryPath = import_path3.default.join(dir, entry.name);
      const entryStatus = checkIgnores(entryPath, rules, entry.isDirectory(), status);
      if (entry.isDirectory() && entryStatus !== "ignored")
        await visit(entryPath, rules, entryStatus);
      else if (entry.isFile() && entryStatus === "included")
        files.push(entryPath);
    }
  };
  await visit(testDir, [], "included");
  return files;
}

// packages/playwright/src/runner/testGroups.ts
function createTestGroups(projectSuite, expectedParallelism) {
  const groups = /* @__PURE__ */ new Map();
  const createGroup = (test) => {
    return {
      workerHash: test._workerHash,
      requireFile: test._requireFile,
      repeatEachIndex: test.repeatEachIndex,
      projectId: test._projectId,
      tests: []
    };
  };
  for (const test of projectSuite.allTests()) {
    let withWorkerHash = groups.get(test._workerHash);
    if (!withWorkerHash) {
      withWorkerHash = /* @__PURE__ */ new Map();
      groups.set(test._workerHash, withWorkerHash);
    }
    let withRequireFile = withWorkerHash.get(test._requireFile);
    if (!withRequireFile) {
      withRequireFile = {
        general: createGroup(test),
        parallel: /* @__PURE__ */ new Map(),
        parallelWithHooks: createGroup(test)
      };
      withWorkerHash.set(test._requireFile, withRequireFile);
    }
    let insideParallel = false;
    let outerMostSequentialSuite;
    let hasAllHooks = false;
    for (let parent = test.parent; parent; parent = parent.parent) {
      if (parent._parallelMode === "serial" || parent._parallelMode === "default")
        outerMostSequentialSuite = parent;
      insideParallel = insideParallel || parent._parallelMode === "parallel";
      hasAllHooks = hasAllHooks || parent._hooks.some((hook) => hook.type === "beforeAll" || hook.type === "afterAll");
    }
    if (insideParallel) {
      if (hasAllHooks && !outerMostSequentialSuite) {
        withRequireFile.parallelWithHooks.tests.push(test);
      } else {
        const key = outerMostSequentialSuite || test;
        let group = withRequireFile.parallel.get(key);
        if (!group) {
          group = createGroup(test);
          withRequireFile.parallel.set(key, group);
        }
        group.tests.push(test);
      }
    } else {
      withRequireFile.general.tests.push(test);
    }
  }
  const result = [];
  for (const withWorkerHash of groups.values()) {
    for (const withRequireFile of withWorkerHash.values()) {
      if (withRequireFile.general.tests.length)
        result.push(withRequireFile.general);
      result.push(...withRequireFile.parallel.values());
      const parallelWithHooksGroupSize = Math.ceil(withRequireFile.parallelWithHooks.tests.length / expectedParallelism);
      let lastGroup;
      for (const test of withRequireFile.parallelWithHooks.tests) {
        if (!lastGroup || lastGroup.tests.length >= parallelWithHooksGroupSize) {
          lastGroup = createGroup(test);
          result.push(lastGroup);
        }
        lastGroup.tests.push(test);
      }
    }
  }
  return result;
}
function filterForShard(shard, weights, testGroups) {
  weights ??= Array.from({ length: shard.total }, () => 1);
  if (weights.length !== shard.total)
    throw new Error(`PWTEST_SHARD_WEIGHTS number of weights must match the shard total of ${shard.total}`);
  const totalWeight = weights.reduce((a, b) => a + b, 0);
  let shardableTotal = 0;
  for (const group of testGroups)
    shardableTotal += group.tests.length;
  const shardSizes = weights.map((w) => Math.floor(w * shardableTotal / totalWeight));
  const remainder = shardableTotal - shardSizes.reduce((a, b) => a + b, 0);
  for (let i = 0; i < remainder; i++) {
    shardSizes[i % shardSizes.length]++;
  }
  let from = 0;
  for (let i = 0; i < shard.current - 1; i++)
    from += shardSizes[i];
  const to = from + shardSizes[shard.current - 1];
  let current = 0;
  const result = /* @__PURE__ */ new Set();
  for (const group of testGroups) {
    if (current >= from && current < to)
      result.add(group);
    current += group.tests.length;
  }
  return result;
}

// packages/playwright/src/runner/loadUtils.ts
var import_common3 = require("../common");
var sourceMapSupport = require("playwright-core/lib/utilsBundle").sourceMapSupport;
var { toPosixPath } = require("playwright-core/lib/coreBundle").utils;
async function collectProjectsAndTestFiles(testRun, doNotRunTestsOutsideProjectFilter) {
  const fsCache = /* @__PURE__ */ new Map();
  const sourceMapCache = /* @__PURE__ */ new Map();
  const allFilesForProject = /* @__PURE__ */ new Map();
  for (const project of testRun.filteredProjects) {
    const files = await collectFilesForProject(project, fsCache);
    allFilesForProject.set(project, files);
  }
  const filesToRunByProject = /* @__PURE__ */ new Map();
  for (const [project, files] of allFilesForProject) {
    const matchedFiles = files.filter((file) => {
      if (!testRun.loadFileFilters.length) {
        return true;
      }
      const hasMatchingSources = sourceMapSources(file, sourceMapCache).some((source) => {
        const matchesAllFileFilters = testRun.loadFileFilters.every((filter) => filter(source));
        return matchesAllFileFilters;
      });
      return hasMatchingSources;
    });
    const filteredFiles = matchedFiles.filter(Boolean);
    filesToRunByProject.set(project, filteredFiles);
  }
  const projectClosure = buildProjectsClosure([...filesToRunByProject.keys()]);
  for (const [project, type] of projectClosure) {
    if (type === "dependency") {
      const treatProjectAsEmpty = doNotRunTestsOutsideProjectFilter && !testRun.filteredProjects.includes(project);
      const files = treatProjectAsEmpty ? [] : allFilesForProject.get(project) || await collectFilesForProject(project, fsCache);
      filesToRunByProject.set(project, files);
    }
  }
  testRun.projectFiles = filesToRunByProject;
  testRun.projectSuites = /* @__PURE__ */ new Map();
}
async function loadFileSuites(testRun, mode, errors) {
  const config2 = testRun.config;
  const allTestFiles = /* @__PURE__ */ new Set();
  for (const files of testRun.projectFiles.values())
    files.forEach((file) => allTestFiles.add(file));
  const fileSuiteByFile = /* @__PURE__ */ new Map();
  const loaderHost = mode === "out-of-process" ? new OutOfProcessLoaderHost(config2) : new InProcessLoaderHost(config2);
  if (await loaderHost.start(errors)) {
    for (const file of allTestFiles) {
      const fileSuite = await loaderHost.loadTestFile(file, errors);
      fileSuiteByFile.set(file, fileSuite);
      errors.push(...createDuplicateTitlesErrors(config2, fileSuite));
    }
    await loaderHost.stop();
  }
  for (const file of allTestFiles) {
    for (const dependency of import_common3.cc.dependenciesForTestFile(file)) {
      if (allTestFiles.has(dependency)) {
        const importer = import_path4.default.relative(config2.config.rootDir, file);
        const importee = import_path4.default.relative(config2.config.rootDir, dependency);
        errors.push({
          message: `Error: test file "${importer}" should not import test file "${importee}"`,
          location: { file, line: 1, column: 1 }
        });
      }
    }
  }
  for (const [project, files] of testRun.projectFiles) {
    const suites = files.map((file) => fileSuiteByFile.get(file)).filter(Boolean);
    testRun.projectSuites.set(project, suites);
  }
}
async function createRootSuite(testRun, errors, shouldFilterOnly) {
  const config2 = testRun.config;
  const rootSuite = new import_common3.test.Suite("", "root");
  const projectSuites = /* @__PURE__ */ new Map();
  const filteredProjectSuites = /* @__PURE__ */ new Map();
  {
    for (const [project, fileSuites] of testRun.projectSuites) {
      const projectSuite = createProjectSuite(project, fileSuites);
      projectSuites.set(project, projectSuite);
      const filteredProjectSuite = filterProjectSuite(projectSuite, testRun.preOnlyTestFilters);
      filteredProjectSuites.set(project, filteredProjectSuite);
    }
  }
  if (shouldFilterOnly) {
    const filteredRoot = new import_common3.test.Suite("", "root");
    for (const filteredProjectSuite of filteredProjectSuites.values())
      filteredRoot._addSuite(filteredProjectSuite);
    import_common3.suiteUtils.filterOnly(filteredRoot);
    for (const [project, filteredProjectSuite] of filteredProjectSuites) {
      if (!filteredRoot.suites.includes(filteredProjectSuite))
        filteredProjectSuites.delete(project);
    }
  }
  const projectClosure = buildProjectsClosure([...filteredProjectSuites.keys()], (project) => filteredProjectSuites.get(project)._hasTests());
  for (const [project, type] of projectClosure) {
    if (type === "top-level") {
      project.project.repeatEach = project.fullConfig.configCLIOverrides.repeatEach ?? project.project.repeatEach;
      rootSuite._addSuite(buildProjectSuite(project, filteredProjectSuites.get(project)));
    }
  }
  if (config2.config.forbidOnly) {
    const onlyTestsAndSuites = rootSuite._getOnlyItems();
    if (onlyTestsAndSuites.length > 0) {
      const configFilePath = config2.config.configFile ? import_path4.default.relative(config2.config.rootDir, config2.config.configFile) : void 0;
      errors.push(...createForbidOnlyErrors(onlyTestsAndSuites, config2.configCLIOverrides.forbidOnly, configFilePath));
    }
  }
  if (config2.config.shard) {
    const testGroups = [];
    for (const projectSuite of rootSuite.suites) {
      for (const group of createTestGroups(projectSuite, config2.config.shard.total))
        testGroups.push(group);
    }
    const testGroupsInThisShard = filterForShard(config2.config.shard, testRun.options.shardWeights, testGroups);
    const testsInThisShard = /* @__PURE__ */ new Set();
    for (const group of testGroupsInThisShard) {
      for (const test of group.tests)
        testsInThisShard.add(test);
    }
    import_common3.suiteUtils.filterTestsRemoveEmptySuites(rootSuite, (test) => testsInThisShard.has(test));
  }
  if (testRun.postShardTestFilters.length)
    import_common3.suiteUtils.filterTestsRemoveEmptySuites(rootSuite, (test) => testRun.postShardTestFilters.every((filter) => filter(test)));
  const topLevelProjects = [];
  {
    const projectClosure2 = new Map(buildProjectsClosure(rootSuite.suites.map((suite) => suite._fullProject)));
    for (const [project, level] of projectClosure2.entries()) {
      if (level === "dependency")
        rootSuite._prependSuite(buildProjectSuite(project, projectSuites.get(project)));
      else
        topLevelProjects.push(project);
    }
  }
  testRun.rootSuite = rootSuite;
  testRun.topLevelProjects = topLevelProjects;
}
function createProjectSuite(project, fileSuites) {
  const projectSuite = new import_common3.test.Suite(project.project.name, "project");
  for (const fileSuite of fileSuites)
    projectSuite._addSuite(import_common3.suiteUtils.bindFileSuiteToProject(project, fileSuite));
  const grepMatcher = (0, import_util5.createTitleMatcher)(project.project.grep);
  const grepInvertMatcher = project.project.grepInvert ? (0, import_util5.createTitleMatcher)(project.project.grepInvert) : null;
  import_common3.suiteUtils.filterTestsRemoveEmptySuites(projectSuite, (test) => {
    const grepTitle = test._grepTitleWithTags();
    if (grepInvertMatcher?.(grepTitle))
      return false;
    return grepMatcher(grepTitle);
  });
  return projectSuite;
}
function filterProjectSuite(projectSuite, testFilters) {
  if (!testFilters.length)
    return projectSuite;
  const result = projectSuite._deepClone();
  import_common3.suiteUtils.filterTestsRemoveEmptySuites(result, (test) => testFilters.every((filter) => filter(test)));
  return result;
}
function buildProjectSuite(project, projectSuite) {
  const result = new import_common3.test.Suite(project.project.name, "project");
  result._fullProject = project;
  if (project.fullyParallel)
    result._parallelMode = "parallel";
  for (const fileSuite of projectSuite.suites) {
    result._addSuite(fileSuite);
    for (let repeatEachIndex = 1; repeatEachIndex < project.project.repeatEach; repeatEachIndex++) {
      const clone = fileSuite._deepClone();
      import_common3.suiteUtils.applyRepeatEachIndex(project, clone, repeatEachIndex);
      result._addSuite(clone);
    }
  }
  return result;
}
function createForbidOnlyErrors(onlyTestsAndSuites, forbidOnlyCLIFlag, configFilePath) {
  const errors = [];
  for (const testOrSuite of onlyTestsAndSuites) {
    const title = testOrSuite.titlePath().slice(2).join(" ");
    const configFilePathName = configFilePath ? `'${configFilePath}'` : "the Playwright configuration file";
    const forbidOnlySource = forbidOnlyCLIFlag ? `'--forbid-only' CLI flag` : `'forbidOnly' option in ${configFilePathName}`;
    const error = {
      message: `Error: item focused with '.only' is not allowed due to the ${forbidOnlySource}: "${title}"`,
      location: testOrSuite.location
    };
    errors.push(error);
  }
  return errors;
}
function createDuplicateTitlesErrors(config2, fileSuite) {
  const errors = [];
  const testsByFullTitle = /* @__PURE__ */ new Map();
  for (const test of fileSuite.allTests()) {
    const fullTitle = test.titlePath().slice(1).join(" \u203A ");
    const existingTest = testsByFullTitle.get(fullTitle);
    if (existingTest) {
      const error = {
        message: `Error: duplicate test title "${fullTitle}", first declared in ${buildItemLocation(config2.config.rootDir, existingTest)}`,
        location: test.location
      };
      errors.push(error);
    }
    testsByFullTitle.set(fullTitle, test);
  }
  return errors;
}
function buildItemLocation(rootDir, testOrSuite) {
  if (!testOrSuite.location)
    return "";
  return `${import_path4.default.relative(rootDir, testOrSuite.location.file)}:${testOrSuite.location.line}`;
}
async function requireOrImportDefaultFunction(file, expectConstructor) {
  let func = await import_common3.transform.requireOrImport(file);
  if (func && typeof func === "object" && "default" in func)
    func = func["default"];
  if (typeof func !== "function")
    throw (0, import_util5.errorWithFile)(file, `file must export a single ${expectConstructor ? "class" : "function"}.`);
  return func;
}
function loadGlobalHook(config2, file) {
  return requireOrImportDefaultFunction(import_path4.default.resolve(config2.config.rootDir, file), false);
}
function loadReporter(config2, file) {
  return requireOrImportDefaultFunction(config2 ? import_path4.default.resolve(config2.config.rootDir, file) : file, true);
}
function sourceMapSources(file, cache) {
  let sources = [file];
  if (!file.endsWith(".js"))
    return sources;
  if (cache.has(file))
    return cache.get(file);
  try {
    const sourceMap = sourceMapSupport.retrieveSourceMap(file);
    const sourceMapData = typeof sourceMap?.map === "string" ? JSON.parse(sourceMap.map) : sourceMap?.map;
    if (sourceMapData?.sources)
      sources = sourceMapData.sources.map((source) => import_path4.default.resolve(import_path4.default.dirname(file), source));
  } finally {
    cache.set(file, sources);
    return sources;
  }
}
async function loadTestList(config2, filePath) {
  try {
    const content = await import_fs3.default.promises.readFile(filePath, "utf-8");
    const lines = content.split("\n").map((line) => line.trim()).filter((line) => line && !line.startsWith("#"));
    const descriptions = lines.map((line) => {
      const delimiter = line.includes("\u203A") ? "\u203A" : ">";
      const tokens = line.split(delimiter).map((token) => token.trim());
      let project;
      if (tokens[0].startsWith("[")) {
        if (!tokens[0].endsWith("]"))
          throw new Error(`Malformed test description: ${line}`);
        project = tokens[0].substring(1, tokens[0].length - 1);
        tokens.shift();
      }
      return { project, file: toPosixPath((0, import_util5.parseLocationArg)(tokens[0]).file), titlePath: tokens.slice(1) };
    });
    const testFilter = (test) => descriptions.some((d) => {
      const [projectName, , ...titles] = test.titlePath();
      if (d.project !== void 0 && d.project !== projectName)
        return false;
      const relativeFile = toPosixPath(import_path4.default.relative(config2.config.rootDir, test.location.file));
      if (relativeFile !== d.file)
        return false;
      return d.titlePath.length <= titles.length && d.titlePath.every((_, index) => titles[index] === d.titlePath[index]);
    });
    const fileFilter = (file) => {
      const relativeFile = toPosixPath(import_path4.default.relative(config2.config.rootDir, file));
      return descriptions.some((d) => d.file === relativeFile);
    };
    return { testFilter, fileFilter };
  } catch (e) {
    throw (0, import_util5.errorWithFile)(filePath, "Cannot read test list file: " + e.message);
  }
}

// packages/playwright/src/reporters/blob.ts
var import_fs4 = __toESM(require("fs"));
var import_path6 = __toESM(require("path"));
var import_stream2 = require("stream");
var import_coreBundle = require("playwright-core/lib/coreBundle");

// packages/playwright/src/reporters/teleEmitter.ts
var import_path5 = __toESM(require("path"));
var { createGuid } = require("playwright-core/lib/coreBundle").utils;
var TeleReporterEmitter = class {
  constructor(messageSink, options = {}) {
    this._resultKnownAttachmentCounts = /* @__PURE__ */ new Map();
    this._resultKnownErrorCounts = /* @__PURE__ */ new Map();
    // In case there is blob reporter and UI mode, make sure one doesn't override
    // the id assigned by the other.
    this._idSymbol = Symbol("id");
    this._messageSink = messageSink;
    this._emitterOptions = options;
  }
  version() {
    return "v2";
  }
  onConfigure(config2) {
    this._rootDir = config2.rootDir;
    this._messageSink({ method: "onConfigure", params: { config: this._serializeConfig(config2) } });
  }
  onBegin(suite) {
    const projects = suite.suites.map((projectSuite) => this._serializeProject(projectSuite));
    for (const project of projects)
      this._messageSink({ method: "onProject", params: { project } });
    this._messageSink({ method: "onBegin", params: void 0 });
  }
  onTestBegin(test, result) {
    result[this._idSymbol] = createGuid();
    this._messageSink({
      method: "onTestBegin",
      params: {
        testId: test.id,
        result: this._serializeResultStart(result)
      }
    });
  }
  async onTestPaused(test, result) {
    const resultId = result[this._idSymbol];
    this._resultKnownErrorCounts.set(resultId, result.errors.length);
    this._messageSink({
      method: "onTestPaused",
      params: {
        testId: test.id,
        resultId,
        errors: result.errors
      }
    });
    await new Promise(() => {
    });
  }
  onTestEnd(test, result) {
    const testEnd = {
      testId: test.id,
      expectedStatus: test.expectedStatus,
      timeout: test.timeout,
      annotations: []
    };
    this._sendNewAttachments(result, test.id);
    this._messageSink({
      method: "onTestEnd",
      params: {
        test: testEnd,
        result: this._serializeResultEnd(result)
      }
    });
    const resultId = result[this._idSymbol];
    this._resultKnownAttachmentCounts.delete(resultId);
    this._resultKnownErrorCounts.delete(resultId);
  }
  onStepBegin(test, result, step) {
    step[this._idSymbol] = createGuid();
    this._messageSink({
      method: "onStepBegin",
      params: {
        testId: test.id,
        resultId: result[this._idSymbol],
        step: this._serializeStepStart(step)
      }
    });
  }
  onStepEnd(test, result, step) {
    const resultId = result[this._idSymbol];
    this._sendNewAttachments(result, test.id);
    this._messageSink({
      method: "onStepEnd",
      params: {
        testId: test.id,
        resultId,
        step: this._serializeStepEnd(step, result)
      }
    });
  }
  onError(error, workerInfo) {
    this._messageSink({
      method: "onError",
      params: {
        error,
        workerInfo: workerInfo ? {
          workerIndex: workerInfo.workerIndex,
          parallelIndex: workerInfo.parallelIndex,
          projectName: workerInfo.project.name
        } : void 0
      }
    });
  }
  onStdOut(chunk, test, result) {
    this._onStdIO("stdout", chunk, test, result);
  }
  onStdErr(chunk, test, result) {
    this._onStdIO("stderr", chunk, test, result);
  }
  _onStdIO(type, chunk, test, result) {
    if (this._emitterOptions.omitOutput)
      return;
    const isBase64 = typeof chunk !== "string";
    const data = isBase64 ? chunk.toString("base64") : chunk;
    this._messageSink({
      method: "onStdIO",
      params: { testId: test?.id, resultId: result ? result[this._idSymbol] : void 0, type, data, isBase64 }
    });
  }
  async onEnd(result) {
    const resultPayload = {
      status: result.status,
      startTime: result.startTime.getTime(),
      duration: result.duration
    };
    this._messageSink({
      method: "onEnd",
      params: {
        result: resultPayload
      }
    });
  }
  printsToStdio() {
    return false;
  }
  _serializeConfig(config2) {
    return {
      configFile: this._relativePath(config2.configFile),
      globalTimeout: config2.globalTimeout,
      maxFailures: config2.maxFailures,
      metadata: config2.metadata,
      rootDir: config2.rootDir,
      shard: config2.shard,
      version: config2.version,
      workers: config2.workers,
      globalSetup: config2.globalSetup,
      globalTeardown: config2.globalTeardown,
      tags: config2.tags,
      webServer: config2.webServer,
      failOnFlakyTests: config2.failOnFlakyTests
    };
  }
  _serializeProject(suite) {
    const project = suite.project();
    const report = {
      metadata: project.metadata,
      name: project.name,
      outputDir: this._relativePath(project.outputDir),
      repeatEach: project.repeatEach,
      retries: project.retries,
      testDir: this._relativePath(project.testDir),
      testIgnore: serializeRegexPatterns(project.testIgnore),
      testMatch: serializeRegexPatterns(project.testMatch),
      timeout: project.timeout,
      suites: suite.suites.map((fileSuite) => {
        return this._serializeSuite(fileSuite);
      }),
      grep: serializeRegexPatterns(project.grep),
      grepInvert: serializeRegexPatterns(project.grepInvert || []),
      dependencies: project.dependencies,
      snapshotDir: this._relativePath(project.snapshotDir),
      teardown: project.teardown,
      ignoreSnapshots: project.ignoreSnapshots ? true : void 0,
      use: this._serializeProjectUseOptions(project.use)
    };
    return report;
  }
  _serializeProjectUseOptions(use) {
    return {
      testIdAttribute: use.testIdAttribute
    };
  }
  _serializeSuite(suite) {
    const result = {
      title: suite.title,
      location: this._relativeLocation(suite.location),
      entries: suite.entries().map((e) => {
        if (e.type === "test")
          return this._serializeTest(e);
        return this._serializeSuite(e);
      })
    };
    return result;
  }
  _serializeTest(test) {
    return {
      testId: test.id,
      title: test.title,
      location: this._relativeLocation(test.location),
      retries: test.retries,
      tags: test.tags,
      repeatEachIndex: test.repeatEachIndex,
      annotations: this._relativeAnnotationLocations(test.annotations)
    };
  }
  _serializeResultStart(result) {
    return {
      id: result[this._idSymbol],
      retry: result.retry,
      workerIndex: result.workerIndex,
      parallelIndex: result.parallelIndex,
      startTime: +result.startTime
    };
  }
  _serializeResultEnd(result) {
    const id = result[this._idSymbol];
    return {
      id,
      duration: result.duration,
      status: result.status,
      errors: this._resultKnownErrorCounts.has(id) ? result.errors.slice(this._resultKnownAttachmentCounts.get(id)) : result.errors,
      annotations: result.annotations?.length ? this._relativeAnnotationLocations(result.annotations) : void 0
    };
  }
  _sendNewAttachments(result, testId) {
    const resultId = result[this._idSymbol];
    const knownAttachmentCount = this._resultKnownAttachmentCounts.get(resultId) ?? 0;
    if (result.attachments.length > knownAttachmentCount) {
      this._messageSink({
        method: "onAttach",
        params: {
          testId,
          resultId,
          attachments: this._serializeAttachments(result.attachments.slice(knownAttachmentCount))
        }
      });
    }
    this._resultKnownAttachmentCounts.set(resultId, result.attachments.length);
  }
  _serializeAttachments(attachments) {
    return attachments.map((a) => {
      const { body, ...rest } = a;
      return {
        ...rest,
        // There is no Buffer in the browser, so there is no point in sending the data there.
        base64: body && !this._emitterOptions.omitBuffers ? body.toString("base64") : void 0
      };
    });
  }
  _serializeStepStart(step) {
    return {
      id: step[this._idSymbol],
      parentStepId: step.parent?.[this._idSymbol],
      title: step.title,
      category: step.category,
      startTime: +step.startTime,
      location: this._relativeLocation(step.location)
    };
  }
  _serializeStepEnd(step, result) {
    return {
      id: step[this._idSymbol],
      duration: step.duration,
      error: step.error,
      attachments: step.attachments.length ? step.attachments.map((a) => result.attachments.indexOf(a)) : void 0,
      annotations: step.annotations.length ? this._relativeAnnotationLocations(step.annotations) : void 0
    };
  }
  _relativeAnnotationLocations(annotations) {
    return annotations.map((annotation) => ({
      ...annotation,
      location: annotation.location ? this._relativeLocation(annotation.location) : void 0
    }));
  }
  _relativeLocation(location) {
    if (!location)
      return location;
    return {
      ...location,
      file: this._relativePath(location.file)
    };
  }
  _relativePath(absolutePath) {
    if (!absolutePath)
      return absolutePath;
    return import_path5.default.relative(this._rootDir, absolutePath);
  }
};

// packages/playwright/src/reporters/blob.ts
var mime = require("playwright-core/lib/utilsBundle").mime;
var yazl = require("playwright-core/lib/utilsBundle").yazl;
var { ManualPromise: ManualPromise2 } = require("playwright-core/lib/coreBundle").iso;
var { calculateSha1, createGuid: createGuid2 } = require("playwright-core/lib/coreBundle").utils;
var { removeFolders, sanitizeForFilePath } = require("playwright-core/lib/coreBundle").utils;
var currentBlobReportVersion = 2;
var BlobReporter = class extends TeleReporterEmitter {
  constructor(options) {
    super((message) => this._messages.push(message));
    this._messages = [];
    this._attachments = [];
    this._options = options;
    if (this._options.fileName && !this._options.fileName.endsWith(".zip"))
      throw new Error(`Blob report file name must end with .zip extension: ${this._options.fileName}`);
    this._salt = createGuid2();
  }
  onConfigure(config2) {
    const metadata = {
      version: currentBlobReportVersion,
      userAgent: (0, import_coreBundle.getUserAgent)(),
      // TODO: remove after some time, recommend config.tag instead.
      name: process.env.PWTEST_BOT_NAME,
      shard: config2.shard ?? void 0,
      pathSeparator: import_path6.default.sep
    };
    this._messages.push({
      method: "onBlobReportMetadata",
      params: metadata
    });
    this._config = config2;
    super.onConfigure(config2);
  }
  async onTestPaused(test, result) {
  }
  async onEnd(result) {
    await super.onEnd(result);
    const zipFileName = await this._prepareOutputFile();
    const zipFile = new yazl.ZipFile();
    const zipFinishPromise = new ManualPromise2();
    const finishPromise = zipFinishPromise.catch((e) => {
      throw new Error(`Failed to write report ${zipFileName}: ` + e.message);
    });
    zipFile.on("error", (error) => zipFinishPromise.reject(error));
    zipFile.outputStream.pipe(import_fs4.default.createWriteStream(zipFileName)).on("close", () => {
      zipFinishPromise.resolve(void 0);
    }).on("error", (error) => zipFinishPromise.reject(error));
    for (const { originalPath, zipEntryPath } of this._attachments) {
      if (!import_fs4.default.statSync(originalPath, { throwIfNoEntry: false })?.isFile())
        continue;
      zipFile.addFile(originalPath, zipEntryPath);
    }
    const lines = this._messages.map((m) => JSON.stringify(m) + "\n");
    const content = import_stream2.Readable.from(lines);
    zipFile.addReadStream(content, "report.jsonl");
    zipFile.end();
    await finishPromise;
  }
  async _prepareOutputFile() {
    const { outputFile, outputDir } = resolveOutputFile("BLOB", {
      ...this._options,
      default: {
        fileName: this._defaultReportName(this._config),
        outputDir: "blob-report"
      }
    });
    if (!process.env.PWTEST_BLOB_DO_NOT_REMOVE)
      await removeFolders([outputDir]);
    await import_fs4.default.promises.mkdir(import_path6.default.dirname(outputFile), { recursive: true });
    return outputFile;
  }
  _defaultReportName(config2) {
    let reportName = "report";
    if (this._options._commandHash)
      reportName += "-" + sanitizeForFilePath(this._options._commandHash);
    if (config2.shard) {
      const paddedNumber = `${config2.shard.current}`.padStart(`${config2.shard.total}`.length, "0");
      reportName = `${reportName}-${paddedNumber}`;
    }
    return `${reportName}.zip`;
  }
  _serializeAttachments(attachments) {
    return super._serializeAttachments(attachments).map((attachment) => {
      if (!attachment.path)
        return attachment;
      const sha1 = calculateSha1(attachment.path + this._salt);
      const extension = mime.getExtension(attachment.contentType) || "dat";
      const newPath = `resources/${sha1}.${extension}`;
      this._attachments.push({ originalPath: attachment.path, zipEntryPath: newPath });
      return {
        ...attachment,
        path: newPath
      };
    });
  }
};

// packages/playwright/src/reporters/dot.ts
var DotReporter = class extends TerminalReporter {
  constructor() {
    super(...arguments);
    this._counter = 0;
  }
  onBegin(suite) {
    super.onBegin(suite);
    this.writeLine(this.generateStartingMessage());
  }
  onStdOut(chunk, test, result) {
    super.onStdOut(chunk, test, result);
    if (!this.config.quiet)
      this.screen.stdout.write(chunk);
  }
  onStdErr(chunk, test, result) {
    super.onStdErr(chunk, test, result);
    if (!this.config.quiet)
      this.screen.stderr.write(chunk);
  }
  onTestEnd(test, result) {
    super.onTestEnd(test, result);
    if (this._counter === 80) {
      this.screen.stdout.write("\n");
      this._counter = 0;
    }
    ++this._counter;
    if (result.status === "skipped") {
      this.screen.stdout.write(this.screen.colors.yellow("\xB0"));
      return;
    }
    if (this.willRetry(test)) {
      this.screen.stdout.write(this.screen.colors.gray("\xD7"));
      return;
    }
    switch (test.outcome()) {
      case "expected":
        this.screen.stdout.write(this.screen.colors.green("\xB7"));
        break;
      case "unexpected":
        this.screen.stdout.write(this.screen.colors.red(result.status === "timedOut" ? "T" : "F"));
        break;
      case "flaky":
        this.screen.stdout.write(this.screen.colors.yellow("\xB1"));
        break;
    }
  }
  onError(error) {
    super.onError(error);
    this.writeLine("\n" + this.formatError(error).message);
    this._counter = 0;
  }
  async onTestPaused(test, result) {
    if (!process.stdin.isTTY && !process.env.PW_TEST_DEBUG_REPORTERS)
      return;
    this.screen.stdout.write("\n");
    if (test.outcome() === "unexpected") {
      this.writeLine(this.screen.colors.red(this.formatTestHeader(test, { indent: "  " })));
      this.writeLine(this.formatResultErrors(test, result));
      markErrorsAsReported(result);
      this.writeLine(this.screen.colors.yellow("    Paused on error. Press Ctrl+C to end.") + "\n");
    } else {
      this.writeLine(this.screen.colors.yellow(this.formatTestHeader(test, { indent: "  " })));
      this.writeLine(this.screen.colors.yellow("    Paused at test end. Press Ctrl+C to end.") + "\n");
    }
    this._counter = 0;
    await new Promise(() => {
    });
  }
  async onEnd(result) {
    await super.onEnd(result);
    this.screen.stdout.write("\n");
    this.epilogue(true);
  }
};
var dot_default = DotReporter;

// packages/playwright/src/reporters/empty.ts
var EmptyReporter = class {
  version() {
    return "v2";
  }
  printsToStdio() {
    return false;
  }
};
var empty_default = EmptyReporter;

// packages/playwright/src/reporters/github.ts
var import_path7 = __toESM(require("path"));
var import_util6 = require("../util");
var { noColors: noColors2 } = require("playwright-core/lib/coreBundle").iso;
var { msToString: msToString2 } = require("playwright-core/lib/coreBundle").iso;
var GitHubLogger = class {
  _log(message, type = "notice", options = {}) {
    message = message.replace(/\n/g, "%0A");
    const configs = Object.entries(options).map(([key, option]) => `${key}=${option}`).join(",");
    process.stdout.write((0, import_util6.stripAnsiEscapes)(`::${type} ${configs}::${message}
`));
  }
  debug(message, options) {
    this._log(message, "debug", options);
  }
  error(message, options) {
    this._log(message, "error", options);
  }
  notice(message, options) {
    this._log(message, "notice", options);
  }
  warning(message, options) {
    this._log(message, "warning", options);
  }
};
var GitHubReporter = class extends TerminalReporter {
  constructor(options = {}) {
    super(options);
    this.githubLogger = new GitHubLogger();
    this._failedTestCount = 0;
    this.screen = { ...this.screen, colors: noColors2 };
  }
  printsToStdio() {
    return false;
  }
  onTestEnd(test, result) {
    super.onTestEnd(test, result);
    if (this.willRetry(test))
      return;
    if (!this._shouldPrintFailureAnnotations(test))
      return;
    this._failedTestCount++;
    for (const r of test.results)
      this._printFailureAnnotation(test, r, this._failedTestCount);
  }
  _shouldPrintFailureAnnotations(test) {
    switch (test.outcome()) {
      case "unexpected":
      case "flaky":
        return true;
      case "skipped":
        return test.results.some((r) => r.status === "interrupted") && test.results.some((r) => !!r.error);
      default:
        return false;
    }
  }
  async onEnd(result) {
    await super.onEnd(result);
    this._printAnnotations();
  }
  onError(error) {
    const errorMessage = this.formatError(error).message;
    this.githubLogger.error(errorMessage);
  }
  _printAnnotations() {
    const summary = this.generateSummary();
    const summaryMessage = this.generateSummaryMessage(summary);
    this._printSlowTestAnnotations();
    this._printSummaryAnnotation(summaryMessage);
  }
  _printSlowTestAnnotations() {
    this.getSlowTests().forEach(([file, duration]) => {
      const filePath = workspaceRelativePath(import_path7.default.join(process.cwd(), file));
      this.githubLogger.warning(`${filePath} took ${msToString2(duration)}`, {
        title: "Slow Test",
        file: filePath
      });
    });
  }
  _printSummaryAnnotation(summary) {
    this.githubLogger.notice(summary, {
      title: "\u{1F3AD} Playwright Run Summary"
    });
  }
  _printFailureAnnotation(test, result, index) {
    const title = this.formatTestTitle(test);
    const header = this.formatTestHeader(test, { indent: "  ", index, mode: "error" });
    const errors = formatResultFailure(this.screen, test, result, "    ");
    for (const error of errors) {
      const options = {
        file: workspaceRelativePath(error.location?.file || test.location.file),
        title
      };
      if (error.location) {
        options.line = error.location.line;
        options.col = error.location.column;
      }
      const message = [header, ...formatRetry(this.screen, result), error.message].join("\n");
      this.githubLogger.error(message, options);
    }
  }
};
function workspaceRelativePath(filePath) {
  return import_path7.default.relative(process.env["GITHUB_WORKSPACE"] ?? "", filePath);
}
var github_default = GitHubReporter;

// packages/playwright/src/reporters/html.ts
var html_exports = {};
__export(html_exports, {
  default: () => html_default,
  showHTMLReport: () => showHTMLReport
});
var import_fs5 = __toESM(require("fs"));
var import_os = __toESM(require("os"));
var import_path8 = __toESM(require("path"));
var import_stream3 = require("stream");
var babel2 = __toESM(require("../transform/babelBundle"));
var import_util7 = require("../util");
var colors2 = require("playwright-core/lib/utilsBundle").colors;
var mime2 = require("playwright-core/lib/utilsBundle").mime;
var open = require("playwright-core/lib/utilsBundle").open;
var yazl2 = require("playwright-core/lib/utilsBundle").yazl;
var { MultiMap } = require("playwright-core/lib/coreBundle").iso;
var { calculateSha1: calculateSha12 } = require("playwright-core/lib/coreBundle").utils;
var { copyFileAndMakeWritable, removeFolders: removeFolders2, sanitizeForFilePath: sanitizeForFilePath2, toPosixPath: toPosixPath2 } = require("playwright-core/lib/coreBundle").utils;
var { getPackageManagerExecCommand: getPackageManagerExecCommand2, isCodingAgent } = require("playwright-core/lib/coreBundle").utils;
var { HttpServer, serveFolder } = require("playwright-core/lib/coreBundle").utils;
var { gracefullyProcessExitDoNotHang } = require("playwright-core/lib/coreBundle").utils;
var { extractZip } = require("playwright-core/lib/coreBundle").utils;
var htmlReportOptions = ["always", "never", "on-failure"];
var isHtmlReportOption = (type) => {
  return htmlReportOptions.includes(type);
};
var HtmlReporter = class {
  constructor(options) {
    this._topLevelErrors = [];
    this._reportConfigs = /* @__PURE__ */ new Map();
    this._machines = [];
    this._options = options;
  }
  version() {
    return "v2";
  }
  printsToStdio() {
    return false;
  }
  onConfigure(config2) {
    this.config = config2;
  }
  onBegin(suite) {
    const { outputFolder, open: open3, attachmentsBaseURL, host, port } = this._resolveOptions();
    this._outputFolder = outputFolder;
    this._open = open3;
    this._host = host;
    this._port = port;
    this._attachmentsBaseURL = attachmentsBaseURL;
    const reportedWarnings = /* @__PURE__ */ new Set();
    for (const project of this.config.projects) {
      if (this._isSubdirectory(outputFolder, project.outputDir) || this._isSubdirectory(project.outputDir, outputFolder)) {
        const key = outputFolder + "|" + project.outputDir;
        if (reportedWarnings.has(key))
          continue;
        reportedWarnings.add(key);
        writeLine(colors2.red(`Configuration Error: HTML reporter output folder clashes with the tests output folder:`));
        writeLine(`
    html reporter folder: ${colors2.bold(outputFolder)}
    test results folder: ${colors2.bold(project.outputDir)}`);
        writeLine("");
        writeLine(`HTML reporter will clear its output directory prior to being generated, which will lead to the artifact loss.
`);
      }
    }
    this.suite = suite;
  }
  _resolveOptions() {
    const outputFolder = reportFolderFromEnv() ?? (0, import_util7.resolveReporterOutputPath)("playwright-report", this._options.configDir, this._options.outputFolder);
    return {
      outputFolder,
      open: getHtmlReportOptionProcessEnv() || this._options.open || "on-failure",
      attachmentsBaseURL: process.env.PLAYWRIGHT_HTML_ATTACHMENTS_BASE_URL || this._options.attachmentsBaseURL || "data/",
      host: process.env.PLAYWRIGHT_HTML_HOST || this._options.host,
      port: process.env.PLAYWRIGHT_HTML_PORT ? +process.env.PLAYWRIGHT_HTML_PORT : this._options.port
    };
  }
  _isSubdirectory(parentDir, dir) {
    const relativePath = import_path8.default.relative(parentDir, dir);
    return !!relativePath && !relativePath.startsWith("..") && !import_path8.default.isAbsolute(relativePath);
  }
  onError(error) {
    this._topLevelErrors.push(error);
  }
  onReportConfigure(params) {
    this._reportConfigs.set(params.reportPath, params.config);
  }
  onReportEnd(params) {
    const config2 = this._reportConfigs.get(params.reportPath);
    if (config2)
      this._machines.push({ config: config2, result: params.result, reportPath: params.reportPath });
  }
  async onEnd(result) {
    const projectSuites = this.suite.suites;
    await removeFolders2([this._outputFolder]);
    const noSnippets = parseBooleanEnvVar("PLAYWRIGHT_HTML_NO_SNIPPETS") ?? this._options.noSnippets;
    const noCopyPrompt = parseBooleanEnvVar("PLAYWRIGHT_HTML_NO_COPY_PROMPT") ?? this._options.noCopyPrompt;
    const doNotInlineAssets = parseBooleanEnvVar("PLAYWRIGHT_HTML_DO_NOT_INLINE_ASSETS") ?? this._options.doNotInlineAssets ?? false;
    const builder = new HtmlBuilder(yazl2, this.config, this._outputFolder, this._attachmentsBaseURL, doNotInlineAssets, {
      title: process.env.PLAYWRIGHT_HTML_TITLE || this._options.title,
      noSnippets,
      noCopyPrompt
    });
    this._buildResult = await builder.build(this.config.metadata, projectSuites, result, this._topLevelErrors, this._machines);
  }
  async onExit() {
    if (process.env.CI || !this._buildResult)
      return;
    const { ok, singleTestId } = this._buildResult;
    const shouldOpen = !isCodingAgent() && !!process.stdin.isTTY && (this._open === "always" || !ok && this._open === "on-failure");
    if (shouldOpen) {
      await showHTMLReport(this._outputFolder, this._host, this._port, singleTestId);
    } else if (this._options._mode === "test" && !!process.stdin.isTTY) {
      const packageManagerCommand = getPackageManagerExecCommand2();
      const relativeReportPath = this._outputFolder === standaloneDefaultFolder() ? "" : " " + import_path8.default.relative(process.cwd(), this._outputFolder);
      const hostArg = this._host ? ` --host ${this._host}` : "";
      const portArg = this._port ? ` --port ${this._port}` : "";
      writeLine("");
      writeLine("To open last HTML report run:");
      writeLine(colors2.cyan(`
  ${packageManagerCommand} playwright show-report${relativeReportPath}${hostArg}${portArg}
`));
    }
  }
};
function reportFolderFromEnv() {
  const envValue = process.env.PLAYWRIGHT_HTML_OUTPUT_DIR || process.env.PLAYWRIGHT_HTML_REPORT;
  return envValue ? import_path8.default.resolve(envValue) : void 0;
}
function getHtmlReportOptionProcessEnv() {
  const htmlOpenEnv = process.env.PLAYWRIGHT_HTML_OPEN || process.env.PW_TEST_HTML_REPORT_OPEN;
  if (!htmlOpenEnv)
    return void 0;
  if (!isHtmlReportOption(htmlOpenEnv)) {
    writeLine(colors2.red(`Configuration Error: HTML reporter Invalid value for PLAYWRIGHT_HTML_OPEN: ${htmlOpenEnv}. Valid values are: ${htmlReportOptions.join(", ")}`));
    return void 0;
  }
  return htmlOpenEnv;
}
function parseBooleanEnvVar(name) {
  const value = process.env[name];
  if (value === "false" || value === "0")
    return false;
  if (value)
    return true;
  return void 0;
}
function standaloneDefaultFolder() {
  return reportFolderFromEnv() ?? (0, import_util7.resolveReporterOutputPath)("playwright-report", process.cwd(), void 0);
}
async function resolveReportFolder(reportPath) {
  const stat = await import_fs5.default.promises.stat(reportPath).catch(() => null);
  if (!stat)
    throw new Error(`No report found at "${reportPath}"`);
  if (stat.isDirectory())
    return reportPath;
  if (stat.isFile() && reportPath.toLowerCase().endsWith(".zip"))
    return await extractReportZip(reportPath);
  throw new Error(`No report found at "${reportPath}"`);
}
async function extractReportZip(zipPath) {
  const tempDir = await import_fs5.default.promises.mkdtemp(import_path8.default.join(import_os.default.tmpdir(), "playwright-show-report-"));
  const cleanup = () => {
    try {
      import_fs5.default.rmSync(tempDir, { recursive: true, force: true });
    } catch {
    }
  };
  process.on("exit", cleanup);
  try {
    await extractZip(zipPath, { dir: tempDir });
  } catch (e) {
    cleanup();
    throw new Error(`Failed to extract report from "${zipPath}": ${e.message}`);
  }
  const hasIndex = await import_fs5.default.promises.access(import_path8.default.join(tempDir, "index.html")).then(() => true, () => false);
  if (!hasIndex) {
    cleanup();
    throw new Error(`No "index.html" found at the top level of "${zipPath}"`);
  }
  return tempDir;
}
async function showHTMLReport(reportFolder, host = "localhost", port, testId) {
  const requestedPath = reportFolder ?? standaloneDefaultFolder();
  let folder;
  try {
    folder = await resolveReportFolder(requestedPath);
  } catch (e) {
    writeLine(colors2.red(e.message));
    gracefullyProcessExitDoNotHang(1);
    return;
  }
  const server = false ? await serveHtmlReportWithHMR(folder) : serveFolder(folder);
  await server.start({ port, host, preferredPort: port ? void 0 : 9323 });
  let url = server.urlPrefix("human-readable");
  writeLine("");
  writeLine(colors2.cyan(`  Serving HTML report at ${url}. Press Ctrl+C to quit.`));
  if (testId)
    url += `#?testId=${testId}`;
  url = url.replace("0.0.0.0", "localhost");
  if (!isCodingAgent())
    await open(url, { wait: true }).catch(() => {
    });
  await new Promise(() => {
  });
}
var HtmlBuilder = class {
  constructor(yazl3, config2, outputDir, attachmentsBaseURL, doNotInlineAssets, options) {
    this._stepsInFile = new MultiMap();
    this._hasTraces = false;
    this._dataZipFile = new yazl3.ZipFile();
    this._config = config2;
    this._reportFolder = outputDir;
    this._options = options;
    this._doNotInlineAssets = doNotInlineAssets;
    import_fs5.default.mkdirSync(this._reportFolder, { recursive: true });
    this._attachmentsBaseURL = attachmentsBaseURL;
  }
  async build(metadata, projectSuites, result, topLevelErrors, machines) {
    const data = /* @__PURE__ */ new Map();
    for (const projectSuite of projectSuites) {
      const projectName = projectSuite.project().name;
      for (const fileSuite of projectSuite.suites) {
        const fileName = this._relativeLocation(fileSuite.location).file;
        this._createEntryForSuite(data, projectName, fileSuite, fileName, true);
      }
    }
    if (!this._options.noSnippets)
      createSnippets(this._stepsInFile);
    let ok = true;
    for (const [fileId, { testFile, testFileSummary }] of data) {
      const stats = testFileSummary.stats;
      for (const test of testFileSummary.tests) {
        if (test.outcome === "expected")
          ++stats.expected;
        if (test.outcome === "skipped")
          ++stats.skipped;
        if (test.outcome === "unexpected")
          ++stats.unexpected;
        if (test.outcome === "flaky")
          ++stats.flaky;
        ++stats.total;
      }
      stats.ok = stats.unexpected + stats.flaky === 0;
      if (!stats.ok)
        ok = false;
      const testCaseSummaryComparator = (t1, t2) => {
        const w1 = (t1.outcome === "unexpected" ? 1e3 : 0) + (t1.outcome === "flaky" ? 1 : 0);
        const w2 = (t2.outcome === "unexpected" ? 1e3 : 0) + (t2.outcome === "flaky" ? 1 : 0);
        return w2 - w1;
      };
      testFileSummary.tests.sort(testCaseSummaryComparator);
      this._addDataFile(fileId + ".json", testFile);
    }
    const htmlReport = {
      metadata,
      startTime: result.startTime.getTime(),
      duration: result.duration,
      files: [...data.values()].map((e) => e.testFileSummary),
      projectNames: projectSuites.map((r) => r.project().name),
      stats: { ...[...data.values()].reduce((a, e) => addStats(a, e.testFileSummary.stats), emptyStats()) },
      errors: topLevelErrors.map((error) => formatError(internalScreen, error).message),
      options: this._options,
      machines: machines.map((machine) => ({
        duration: machine.result.duration,
        startTime: machine.result.startTime.getTime(),
        tag: machine.config.tags,
        shardIndex: machine.config.shard?.current
      }))
    };
    htmlReport.files.sort((f1, f2) => {
      const w1 = f1.stats.unexpected * 1e3 + f1.stats.flaky;
      const w2 = f2.stats.unexpected * 1e3 + f2.stats.flaky;
      return w2 - w1;
    });
    this._addDataFile("report.json", htmlReport);
    let singleTestId;
    if (htmlReport.stats.total === 1) {
      const testFile = data.values().next().value.testFile;
      singleTestId = testFile.tests[0].testId;
    }
    const reportIndexFile = await this._writeStaticAssets();
    if (this._hasTraces) {
      const traceViewerFolder = import_path8.default.join(require.resolve("playwright-core"), "..", "lib", "vite", "traceViewer");
      const traceViewerTargetFolder = import_path8.default.join(this._reportFolder, "trace");
      const traceViewerAssetsTargetFolder = import_path8.default.join(traceViewerTargetFolder, "assets");
      import_fs5.default.mkdirSync(traceViewerAssetsTargetFolder, { recursive: true });
      for (const file of import_fs5.default.readdirSync(traceViewerFolder)) {
        if (file.endsWith(".map") || file.includes("watch") || file.includes("assets"))
          continue;
        await copyFileAndMakeWritable(import_path8.default.join(traceViewerFolder, file), import_path8.default.join(traceViewerTargetFolder, file));
      }
      for (const file of import_fs5.default.readdirSync(import_path8.default.join(traceViewerFolder, "assets"))) {
        if (file.endsWith(".map") || file.includes("xtermModule"))
          continue;
        await copyFileAndMakeWritable(import_path8.default.join(traceViewerFolder, "assets", file), import_path8.default.join(traceViewerAssetsTargetFolder, file));
      }
    }
    await this._writeReportData(reportIndexFile);
    return { ok, singleTestId };
  }
  async _writeStaticAssets() {
    const appFolder = import_path8.default.join(require.resolve("playwright-core"), "..", "lib", "vite", "htmlReport");
    const reportIndexFile = import_path8.default.join(this._reportFolder, "index.html");
    if (this._doNotInlineAssets) {
      const html = await import_fs5.default.promises.readFile(import_path8.default.join(appFolder, "index.html"), "utf-8");
      await Promise.all([
        import_fs5.default.promises.writeFile(reportIndexFile, html),
        import_fs5.default.promises.copyFile(import_path8.default.join(appFolder, "report.js"), import_path8.default.join(this._reportFolder, "report.js")),
        import_fs5.default.promises.copyFile(import_path8.default.join(appFolder, "report.css"), import_path8.default.join(this._reportFolder, "report.css"))
      ]);
    } else {
      let html = await import_fs5.default.promises.readFile(import_path8.default.join(appFolder, "index.html"), "utf-8");
      const [js, css] = await Promise.all([
        import_fs5.default.promises.readFile(import_path8.default.join(appFolder, "report.js"), "utf-8"),
        import_fs5.default.promises.readFile(import_path8.default.join(appFolder, "report.css"), "utf-8")
      ]);
      html = html.replace(/<script type="module"[^>]*><\/script>/, () => `<script type="module">${js}</script>`);
      html = html.replace(/<link rel="stylesheet"[^>]*>/, () => `<style type='text/css'>${css}</style>`);
      await import_fs5.default.promises.writeFile(reportIndexFile, html);
    }
    return reportIndexFile;
  }
  async _writeReportData(filePath) {
    import_fs5.default.appendFileSync(filePath, '<template id="playwrightReportBase64">data:application/zip;base64,');
    await new Promise((resolve, reject) => {
      this._dataZipFile.end(void 0, () => {
        this._dataZipFile.outputStream.pipe(new Base64Encoder()).pipe(import_fs5.default.createWriteStream(filePath, { flags: "a" })).on("close", resolve).on("error", reject);
      });
    });
    import_fs5.default.appendFileSync(filePath, "</template>");
  }
  _addDataFile(fileName, data) {
    this._dataZipFile.addBuffer(Buffer.from(JSON.stringify(data)), fileName);
  }
  _createEntryForSuite(data, projectName, suite, fileName, deep) {
    const fileId = calculateSha12(fileName).slice(0, 20);
    let fileEntry = data.get(fileId);
    if (!fileEntry) {
      fileEntry = {
        testFile: { fileId, fileName, tests: [] },
        testFileSummary: { fileId, fileName, tests: [], stats: emptyStats() }
      };
      data.set(fileId, fileEntry);
    }
    const { testFile, testFileSummary } = fileEntry;
    const testEntries = [];
    this._processSuite(suite, projectName, [], deep, testEntries);
    for (const test of testEntries) {
      testFile.tests.push(test.testCase);
      testFileSummary.tests.push(test.testCaseSummary);
    }
  }
  _processSuite(suite, projectName, path20, deep, outTests) {
    const newPath = [...path20, suite.title];
    suite.entries().forEach((e) => {
      if (e.type === "test")
        outTests.push(this._createTestEntry(e, projectName, newPath));
      else if (deep)
        this._processSuite(e, projectName, newPath, deep, outTests);
    });
  }
  _createTestEntry(test, projectName, path20) {
    const duration = test.results.reduce((a, r) => a + r.duration, 0);
    const location = this._relativeLocation(test.location);
    path20 = path20.slice(1).filter((path21) => path21.length > 0);
    const results = test.results.map((r) => this._createTestResult(test, r));
    return {
      testCase: {
        testId: test.id,
        title: test.title,
        projectName,
        location,
        duration,
        annotations: this._serializeAnnotations(test.annotations),
        tags: [...new Set(test.tags)],
        outcome: test.outcome(),
        path: path20,
        results,
        repeatEachIndex: test.repeatEachIndex || void 0,
        // Do not include zero.
        ok: test.outcome() === "expected" || test.outcome() === "flaky"
      },
      testCaseSummary: {
        testId: test.id,
        title: test.title,
        projectName,
        location,
        duration,
        annotations: this._serializeAnnotations(test.annotations),
        tags: [...new Set(test.tags)],
        outcome: test.outcome(),
        path: path20,
        ok: test.outcome() === "expected" || test.outcome() === "flaky",
        repeatEachIndex: test.repeatEachIndex || void 0,
        // Do not include zero.
        results: results.map((result) => {
          return {
            attachments: result.attachments.map((a) => ({ name: a.name, contentType: a.contentType, path: a.path })),
            startTime: result.startTime,
            workerIndex: result.workerIndex
          };
        })
      }
    };
  }
  _serializeAttachments(attachments) {
    let lastAttachment;
    return attachments.map((a) => {
      if (a.name === "trace")
        this._hasTraces = true;
      if ((a.name === "stdout" || a.name === "stderr") && a.contentType === "text/plain") {
        if (lastAttachment && lastAttachment.name === a.name && lastAttachment.contentType === a.contentType) {
          lastAttachment.body += (0, import_util7.stripAnsiEscapes)(a.body);
          return null;
        }
        a.body = (0, import_util7.stripAnsiEscapes)(a.body);
        lastAttachment = a;
        return a;
      }
      if (a.path) {
        let fileName = a.path;
        try {
          const buffer = import_fs5.default.readFileSync(a.path);
          const sha1 = calculateSha12(buffer) + import_path8.default.extname(a.path);
          fileName = this._attachmentsBaseURL + sha1;
          import_fs5.default.mkdirSync(import_path8.default.join(this._reportFolder, "data"), { recursive: true });
          import_fs5.default.writeFileSync(import_path8.default.join(this._reportFolder, "data", sha1), buffer);
        } catch (e) {
        }
        return {
          name: a.name,
          contentType: a.contentType,
          path: fileName,
          body: a.body
        };
      }
      if (a.body instanceof Buffer) {
        if (isTextContentType(a.contentType)) {
          const charset = a.contentType.match(/charset=(.*)/)?.[1];
          try {
            const body = a.body.toString(charset || "utf-8");
            return {
              name: a.name,
              contentType: a.contentType,
              body
            };
          } catch (e) {
          }
        }
        import_fs5.default.mkdirSync(import_path8.default.join(this._reportFolder, "data"), { recursive: true });
        const extension = sanitizeForFilePath2(import_path8.default.extname(a.name).replace(/^\./, "")) || mime2.getExtension(a.contentType) || "dat";
        const sha1 = calculateSha12(a.body) + "." + extension;
        import_fs5.default.writeFileSync(import_path8.default.join(this._reportFolder, "data", sha1), a.body);
        return {
          name: a.name,
          contentType: a.contentType,
          path: this._attachmentsBaseURL + sha1
        };
      }
      return {
        name: a.name,
        contentType: a.contentType,
        body: a.body
      };
    }).filter(Boolean);
  }
  _serializeAnnotations(annotations) {
    return annotations.map((a) => ({
      type: a.type,
      description: a.description === void 0 ? void 0 : String(a.description),
      location: a.location ? {
        file: a.location.file,
        line: a.location.line,
        column: a.location.column
      } : void 0
    }));
  }
  _createTestResult(test, result) {
    return {
      duration: result.duration,
      startTime: result.startTime.toISOString(),
      retry: result.retry,
      steps: dedupeSteps(result.steps).map((s) => this._createTestStep(s, result)),
      errors: formatResultFailure(internalScreen, test, result, "").map((error) => {
        return {
          message: error.message,
          codeframe: error.location ? createErrorCodeframe(error.message, error.location) : void 0
        };
      }),
      status: result.status,
      annotations: this._serializeAnnotations(result.annotations),
      attachments: this._serializeAttachments([
        ...result.attachments,
        ...result.stdout.map((m) => stdioAttachment(m, "stdout")),
        ...result.stderr.map((m) => stdioAttachment(m, "stderr"))
      ]),
      workerIndex: result.workerIndex
    };
  }
  _createTestStep(dedupedStep, result) {
    const { step, duration, count } = dedupedStep;
    const skipped = dedupedStep.step.annotations?.find((a) => a.type === "skip");
    let title = step.title;
    if (skipped)
      title = `${title} (skipped${skipped.description ? ": " + skipped.description : ""})`;
    const testStep = {
      title,
      startTime: step.startTime.toISOString(),
      duration,
      steps: dedupeSteps(step.steps).map((s) => this._createTestStep(s, result)),
      attachments: step.attachments.map((s) => {
        const index = result.attachments.indexOf(s);
        if (index === -1)
          throw new Error("Unexpected, attachment not found");
        return index;
      }),
      location: this._relativeLocation(step.location),
      error: step.error?.message,
      count,
      skipped: !!skipped
    };
    if (step.location)
      this._stepsInFile.set(step.location.file, testStep);
    return testStep;
  }
  _relativeLocation(location) {
    if (!location)
      return void 0;
    const file = toPosixPath2(import_path8.default.relative(this._config.rootDir, location.file));
    return {
      file,
      line: location.line,
      column: location.column
    };
  }
};
var emptyStats = () => {
  return {
    total: 0,
    expected: 0,
    unexpected: 0,
    flaky: 0,
    skipped: 0,
    ok: true
  };
};
var addStats = (stats, delta) => {
  stats.total += delta.total;
  stats.skipped += delta.skipped;
  stats.expected += delta.expected;
  stats.unexpected += delta.unexpected;
  stats.flaky += delta.flaky;
  stats.ok = stats.ok && delta.ok;
  return stats;
};
var Base64Encoder = class extends import_stream3.Transform {
  _transform(chunk, encoding, callback) {
    if (this._remainder) {
      chunk = Buffer.concat([this._remainder, chunk]);
      this._remainder = void 0;
    }
    const remaining = chunk.length % 3;
    if (remaining) {
      this._remainder = chunk.slice(chunk.length - remaining);
      chunk = chunk.slice(0, chunk.length - remaining);
    }
    chunk = chunk.toString("base64");
    this.push(Buffer.from(chunk));
    callback();
  }
  _flush(callback) {
    if (this._remainder)
      this.push(Buffer.from(this._remainder.toString("base64")));
    callback();
  }
};
function isTextContentType(contentType) {
  return contentType.startsWith("text/") || contentType.startsWith("application/json");
}
function stdioAttachment(chunk, type) {
  return {
    name: type,
    contentType: "text/plain",
    body: typeof chunk === "string" ? chunk : chunk.toString("utf-8")
  };
}
function dedupeSteps(steps) {
  const result = [];
  let lastResult = void 0;
  for (const step of steps) {
    const canDedupe = !step.error && step.duration >= 0 && step.location?.file && !step.steps.length;
    const lastStep = lastResult?.step;
    if (canDedupe && lastResult && lastStep && step.category === lastStep.category && step.title === lastStep.title && step.location?.file === lastStep.location?.file && step.location?.line === lastStep.location?.line && step.location?.column === lastStep.location?.column) {
      ++lastResult.count;
      lastResult.duration += step.duration;
      continue;
    }
    lastResult = { step, count: 1, duration: step.duration };
    result.push(lastResult);
    if (!canDedupe)
      lastResult = void 0;
  }
  return result;
}
function createSnippets(stepsInFile) {
  for (const file of stepsInFile.keys()) {
    let source;
    try {
      source = import_fs5.default.readFileSync(file, "utf-8") + "\n//";
    } catch (e) {
      continue;
    }
    const lines = source.split("\n").length;
    const highlighted = babel2.codeFrameColumns(source, { start: { line: lines, column: 1 } }, { highlightCode: true, linesAbove: lines, linesBelow: 0 });
    const highlightedLines = highlighted.split("\n");
    const lineWithArrow = highlightedLines[highlightedLines.length - 1];
    for (const step of stepsInFile.get(file)) {
      if (step.location.line < 2 || step.location.line >= lines)
        continue;
      const snippetLines = highlightedLines.slice(step.location.line - 2, step.location.line + 1);
      const index = lineWithArrow.indexOf("^");
      const shiftedArrow = lineWithArrow.slice(0, index) + " ".repeat(step.location.column - 1) + lineWithArrow.slice(index);
      snippetLines.splice(2, 0, shiftedArrow);
      step.snippet = snippetLines.join("\n");
    }
  }
}
function createErrorCodeframe(message, location) {
  let source;
  try {
    source = import_fs5.default.readFileSync(location.file, "utf-8") + "\n//";
  } catch (e) {
    return;
  }
  return babel2.codeFrameColumns(
    source,
    {
      start: {
        line: location.line,
        column: location.column
      }
    },
    {
      highlightCode: false,
      linesAbove: 100,
      linesBelow: 100,
      message: (0, import_util7.stripAnsiEscapes)(message).split("\n")[0] || void 0
    }
  );
}
function writeLine(line) {
  process.stdout.write(line + "\n");
}
var html_default = HtmlReporter;

// packages/playwright/src/reporters/json.ts
var import_fs6 = __toESM(require("fs"));
var import_path9 = __toESM(require("path"));
var import_common4 = require("../common");
var { MultiMap: MultiMap2 } = require("playwright-core/lib/coreBundle").iso;
var { toPosixPath: toPosixPath3 } = require("playwright-core/lib/coreBundle").utils;
var JSONReporter = class {
  constructor(options) {
    this._errors = [];
    this._resolvedOutputFile = resolveOutputFile("JSON", options)?.outputFile;
  }
  version() {
    return "v2";
  }
  printsToStdio() {
    return !this._resolvedOutputFile;
  }
  onConfigure(config2) {
    this.config = config2;
  }
  onBegin(suite) {
    this.suite = suite;
  }
  onError(error) {
    this._errors.push(error);
  }
  async onEnd(result) {
    await outputReport(this._serializeReport(result), this._resolvedOutputFile);
  }
  _serializeReport(result) {
    const report = {
      config: {
        ...removePrivateFields(this.config),
        rootDir: toPosixPath3(this.config.rootDir),
        projects: this.config.projects.map((project) => {
          return {
            outputDir: toPosixPath3(project.outputDir),
            repeatEach: project.repeatEach,
            retries: project.retries,
            metadata: project.metadata,
            id: import_common4.config.getProjectId(project),
            name: project.name,
            testDir: toPosixPath3(project.testDir),
            testIgnore: serializePatterns(project.testIgnore),
            testMatch: serializePatterns(project.testMatch),
            timeout: project.timeout
          };
        })
      },
      suites: this._mergeSuites(this.suite.suites),
      errors: this._errors,
      stats: {
        startTime: result.startTime.toISOString(),
        duration: result.duration,
        expected: 0,
        skipped: 0,
        unexpected: 0,
        flaky: 0
      }
    };
    for (const test of this.suite.allTests())
      ++report.stats[test.outcome()];
    return report;
  }
  _mergeSuites(suites) {
    const fileSuites = new MultiMap2();
    for (const projectSuite of suites) {
      const projectId = import_common4.config.getProjectId(projectSuite.project());
      const projectName = projectSuite.project().name;
      for (const fileSuite of projectSuite.suites) {
        const file = fileSuite.location.file;
        const serialized = this._serializeSuite(projectId, projectName, fileSuite);
        if (serialized)
          fileSuites.set(file, serialized);
      }
    }
    const results = [];
    for (const [, suites2] of fileSuites) {
      const result = {
        title: suites2[0].title,
        file: suites2[0].file,
        column: 0,
        line: 0,
        specs: []
      };
      for (const suite of suites2)
        this._mergeTestsFromSuite(result, suite);
      results.push(result);
    }
    return results;
  }
  _relativeLocation(location) {
    if (!location)
      return { file: "", line: 0, column: 0 };
    return {
      file: toPosixPath3(import_path9.default.relative(this.config.rootDir, location.file)),
      line: location.line,
      column: location.column
    };
  }
  _locationMatches(s1, s2) {
    return s1.file === s2.file && s1.line === s2.line && s1.column === s2.column;
  }
  _mergeTestsFromSuite(to, from) {
    for (const fromSuite of from.suites || []) {
      const toSuite = (to.suites || []).find((s) => s.title === fromSuite.title && this._locationMatches(s, fromSuite));
      if (toSuite) {
        this._mergeTestsFromSuite(toSuite, fromSuite);
      } else {
        if (!to.suites)
          to.suites = [];
        to.suites.push(fromSuite);
      }
    }
    for (const spec of from.specs || []) {
      const toSpec = to.specs.find((s) => s.title === spec.title && s.file === toPosixPath3(import_path9.default.relative(this.config.rootDir, spec.file)) && s.line === spec.line && s.column === spec.column);
      if (toSpec)
        toSpec.tests.push(...spec.tests);
      else
        to.specs.push(spec);
    }
  }
  _serializeSuite(projectId, projectName, suite) {
    if (!suite.allTests().length)
      return null;
    const suites = suite.suites.map((suite2) => this._serializeSuite(projectId, projectName, suite2)).filter((s) => s);
    return {
      title: suite.title,
      ...this._relativeLocation(suite.location),
      specs: suite.tests.map((test) => this._serializeTestSpec(projectId, projectName, test)),
      suites: suites.length ? suites : void 0
    };
  }
  _serializeTestSpec(projectId, projectName, test) {
    return {
      title: test.title,
      ok: test.ok(),
      tags: test.tags.map((tag) => tag.substring(1)),
      // Strip '@'.
      tests: [this._serializeTest(projectId, projectName, test)],
      id: test.id,
      ...this._relativeLocation(test.location)
    };
  }
  _serializeTest(projectId, projectName, test) {
    return {
      timeout: test.timeout,
      annotations: test.annotations,
      expectedStatus: test.expectedStatus,
      projectId,
      projectName,
      results: test.results.map((r) => this._serializeTestResult(r, test)),
      status: test.outcome()
    };
  }
  _serializeTestResult(result, test) {
    const steps = result.steps.filter((s) => s.category === "test.step");
    const jsonResult = {
      workerIndex: result.workerIndex,
      parallelIndex: result.parallelIndex,
      status: result.status,
      duration: result.duration,
      error: result.error,
      errors: result.errors.map((e) => this._serializeError(e)),
      stdout: result.stdout.map((s) => stdioEntry(s)),
      stderr: result.stderr.map((s) => stdioEntry(s)),
      retry: result.retry,
      steps: steps.length ? steps.map((s) => this._serializeTestStep(s)) : void 0,
      startTime: result.startTime.toISOString(),
      annotations: result.annotations,
      attachments: result.attachments.map((a) => ({
        name: a.name,
        contentType: a.contentType,
        path: a.path,
        body: a.body?.toString("base64")
      }))
    };
    if (result.error?.stack)
      jsonResult.errorLocation = prepareErrorStack(result.error.stack).location;
    return jsonResult;
  }
  _serializeError(error) {
    return formatError(nonTerminalScreen, error);
  }
  _serializeTestStep(step) {
    const steps = step.steps.filter((s) => s.category === "test.step");
    return {
      title: step.title,
      duration: step.duration,
      error: step.error,
      steps: steps.length ? steps.map((s) => this._serializeTestStep(s)) : void 0
    };
  }
};
async function outputReport(report, resolvedOutputFile) {
  const reportString = JSON.stringify(report, void 0, 2);
  if (resolvedOutputFile) {
    await import_fs6.default.promises.mkdir(import_path9.default.dirname(resolvedOutputFile), { recursive: true });
    await import_fs6.default.promises.writeFile(resolvedOutputFile, reportString);
  } else {
    console.log(reportString);
  }
}
function stdioEntry(s) {
  if (typeof s === "string")
    return { text: s };
  return { buffer: s.toString("base64") };
}
function removePrivateFields(config2) {
  return Object.fromEntries(Object.entries(config2).filter(([name, value]) => !name.startsWith("_")));
}
function serializePatterns(patterns) {
  if (!Array.isArray(patterns))
    patterns = [patterns];
  return patterns.map((s) => s.toString());
}
var json_default = JSONReporter;

// packages/playwright/src/reporters/junit.ts
var import_fs7 = __toESM(require("fs"));
var import_path10 = __toESM(require("path"));
var import_util8 = require("../util");
var { getAsBooleanFromENV } = require("playwright-core/lib/coreBundle").utils;
var JUnitReporter = class {
  constructor(options) {
    this.totalTests = 0;
    this.totalFailures = 0;
    this.totalErrors = 0;
    this.totalSkipped = 0;
    this.stripANSIControlSequences = false;
    this.includeProjectInTestName = false;
    this.includeRetries = false;
    this.stripANSIControlSequences = getAsBooleanFromENV("PLAYWRIGHT_JUNIT_STRIP_ANSI", !!options.stripANSIControlSequences);
    this.includeProjectInTestName = getAsBooleanFromENV("PLAYWRIGHT_JUNIT_INCLUDE_PROJECT_IN_TEST_NAME", !!options.includeProjectInTestName);
    this.includeRetries = getAsBooleanFromENV("PLAYWRIGHT_JUNIT_INCLUDE_RETRIES", !!options.includeRetries);
    this.configDir = options.configDir;
    this.resolvedOutputFile = resolveOutputFile("JUNIT", options)?.outputFile;
  }
  version() {
    return "v2";
  }
  printsToStdio() {
    return !this.resolvedOutputFile;
  }
  onConfigure(config2) {
    this.config = config2;
  }
  onBegin(suite) {
    this.suite = suite;
    this.timestamp = /* @__PURE__ */ new Date();
  }
  async onEnd(result) {
    const children = [];
    for (const projectSuite of this.suite.suites) {
      for (const fileSuite of projectSuite.suites)
        children.push(await this._buildTestSuite(projectSuite.title, fileSuite));
    }
    const tokens = [];
    const self = this;
    const root = {
      name: "testsuites",
      attributes: {
        id: process.env[`PLAYWRIGHT_JUNIT_SUITE_ID`] || "",
        name: process.env[`PLAYWRIGHT_JUNIT_SUITE_NAME`] || "",
        tests: self.totalTests,
        failures: self.totalFailures,
        skipped: self.totalSkipped,
        errors: self.totalErrors,
        time: result.duration / 1e3
      },
      children
    };
    serializeXML(root, tokens, this.stripANSIControlSequences);
    const reportString = tokens.join("\n");
    if (this.resolvedOutputFile) {
      await import_fs7.default.promises.mkdir(import_path10.default.dirname(this.resolvedOutputFile), { recursive: true });
      await import_fs7.default.promises.writeFile(this.resolvedOutputFile, reportString);
    } else {
      console.log(reportString);
    }
  }
  async _buildTestSuite(projectName, suite) {
    let tests = 0;
    let skipped = 0;
    let failures = 0;
    let errors = 0;
    let duration = 0;
    const children = [];
    const testCaseNamePrefix = projectName && this.includeProjectInTestName ? `[${projectName}] ` : "";
    for (const test of suite.allTests()) {
      ++tests;
      if (test.outcome() === "skipped")
        ++skipped;
      for (const result of test.results)
        duration += result.duration;
      const classification = await this._addTestCase(suite.title, testCaseNamePrefix, test, children);
      if (classification === "error")
        ++errors;
      else if (classification === "failure")
        ++failures;
    }
    this.totalTests += tests;
    this.totalSkipped += skipped;
    this.totalFailures += failures;
    this.totalErrors += errors;
    const entry = {
      name: "testsuite",
      attributes: {
        name: suite.title,
        timestamp: this.timestamp.toISOString(),
        hostname: projectName,
        tests,
        failures,
        skipped,
        time: duration / 1e3,
        errors
      },
      children
    };
    return entry;
  }
  async _addTestCase(suiteName, namePrefix, test, entries) {
    const entry = {
      name: "testcase",
      attributes: {
        // Skip root, project, file
        name: namePrefix + test.titlePath().slice(3).join(" \u203A "),
        // filename
        classname: suiteName
      },
      children: []
    };
    entries.push(entry);
    const properties = {
      name: "properties",
      children: []
    };
    for (const annotation of test.annotations) {
      const property = {
        name: "property",
        attributes: {
          name: annotation.type,
          value: annotation?.description ? annotation.description : ""
        }
      };
      properties.children?.push(property);
    }
    if (properties.children?.length)
      entry.children.push(properties);
    if (test.outcome() === "skipped") {
      entry.children.push({ name: "skipped" });
      return null;
    }
    if (this.includeRetries && test.ok()) {
      const passResult = test.results[test.results.length - 1];
      entry.attributes.time = passResult.duration / 1e3;
      await this._appendStdIO(entry, [passResult]);
      for (let i = 0; i < test.results.length - 1; i++) {
        const result = test.results[i];
        if (result.status === "passed" || result.status === "skipped")
          continue;
        entry.children.push(await this._buildRetryEntry(result, "flaky"));
      }
      return null;
    }
    if (this.includeRetries) {
      entry.attributes.time = test.results[0].duration / 1e3;
      await this._appendStdIO(entry, [test.results[0]]);
      for (let i = 1; i < test.results.length; i++) {
        const result = test.results[i];
        if (result.status === "passed" || result.status === "skipped")
          continue;
        entry.children.push(await this._buildRetryEntry(result, "rerun"));
      }
      return this._addFailureEntry(test, classifyResultError(test.results[0]), entry);
    }
    entry.attributes.time = test.results.reduce((acc, value) => acc + value.duration, 0) / 1e3;
    await this._appendStdIO(entry, test.results);
    if (test.ok())
      return null;
    return this._addFailureEntry(test, classifyTestError(test), entry);
  }
  _addFailureEntry(test, errorInfo, entry) {
    if (errorInfo) {
      entry.children.push({
        name: errorInfo.elementName,
        attributes: { message: errorInfo.message, type: errorInfo.type },
        text: (0, import_util8.stripAnsiEscapes)(formatFailure(nonTerminalScreen, this.config, test))
      });
      return errorInfo.elementName;
    }
    entry.children.push({
      name: "failure",
      attributes: {
        message: `${import_path10.default.basename(test.location.file)}:${test.location.line}:${test.location.column} ${test.title}`,
        type: "FAILURE"
      },
      text: (0, import_util8.stripAnsiEscapes)(formatFailure(nonTerminalScreen, this.config, test))
    });
    return "failure";
  }
  async _appendStdIO(entry, results) {
    const systemOut = [];
    const systemErr = [];
    for (const result of results) {
      for (const item of result.stdout)
        systemOut.push(item.toString());
      for (const item of result.stderr)
        systemErr.push(item.toString());
      for (const attachment of result.attachments) {
        if (!attachment.path)
          continue;
        let attachmentPath = import_path10.default.relative(this.configDir, attachment.path);
        try {
          if (this.resolvedOutputFile)
            attachmentPath = import_path10.default.relative(import_path10.default.dirname(this.resolvedOutputFile), attachment.path);
        } catch {
          systemOut.push(`
Warning: Unable to make attachment path ${attachment.path} relative to report output file ${this.resolvedOutputFile}`);
        }
        try {
          await import_fs7.default.promises.access(attachment.path);
          systemOut.push(`
[[ATTACHMENT|${attachmentPath}]]
`);
        } catch {
          systemErr.push(`
Warning: attachment ${attachmentPath} is missing`);
        }
      }
    }
    if (systemOut.length)
      entry.children.push({ name: "system-out", text: systemOut.join("") });
    if (systemErr.length)
      entry.children.push({ name: "system-err", text: systemErr.join("") });
  }
  async _buildRetryEntry(result, prefix) {
    const errorInfo = classifyResultError(result);
    const entry = {
      name: `${prefix}${errorInfo?.elementName === "error" ? "Error" : "Failure"}`,
      attributes: { message: errorInfo?.message || "", type: errorInfo?.type || "FAILURE", time: result.duration / 1e3 },
      children: []
    };
    const stackTrace = result.error?.stack || result.error?.message || result.error?.value || "";
    entry.children.push({ name: "stackTrace", text: (0, import_util8.stripAnsiEscapes)(stackTrace) });
    await this._appendStdIO(entry, [result]);
    return entry;
  }
};
function classifyResultError(result) {
  const error = result.error;
  if (!error)
    return null;
  const rawMessage = (0, import_util8.stripAnsiEscapes)(error.message || error.value || "");
  const nameMatch = rawMessage.match(/^(\w+): /);
  const errorName = nameMatch ? nameMatch[1] : "";
  const messageBody = nameMatch ? rawMessage.slice(nameMatch[0].length) : rawMessage;
  const firstLine = messageBody.split("\n")[0].trim();
  const matcherMatch = rawMessage.match(/expect\(.*?\)\.(not\.)?(\w+)/);
  if (matcherMatch) {
    const matcherName = `expect.${matcherMatch[1] || ""}${matcherMatch[2]}`;
    return {
      elementName: "failure",
      type: matcherName,
      message: firstLine
    };
  }
  return {
    elementName: "error",
    type: errorName || "Error",
    message: firstLine
  };
}
function classifyTestError(test) {
  for (const result of test.results) {
    const info = classifyResultError(result);
    if (info)
      return info;
  }
  return null;
}
function serializeXML(entry, tokens, stripANSIControlSequences) {
  const attrs = [];
  for (const [name, value] of Object.entries(entry.attributes || {}))
    attrs.push(`${name}="${escape(String(value), stripANSIControlSequences, false)}"`);
  tokens.push(`<${entry.name}${attrs.length ? " " : ""}${attrs.join(" ")}>`);
  for (const child of entry.children || [])
    serializeXML(child, tokens, stripANSIControlSequences);
  if (entry.text)
    tokens.push(escape(entry.text, stripANSIControlSequences, true));
  tokens.push(`</${entry.name}>`);
}
var discouragedXMLCharacters = /[\u0000-\u0008\u000b-\u000c\u000e-\u001f\u007f-\u0084\u0086-\u009f]/g;
function escape(text, stripANSIControlSequences, isCharacterData) {
  if (stripANSIControlSequences)
    text = (0, import_util8.stripAnsiEscapes)(text);
  if (isCharacterData) {
    text = "<![CDATA[" + text.replace(/]]>/g, "]]&gt;") + "]]>";
  } else {
    const escapeRe = /[&"'<>]/g;
    text = text.replace(escapeRe, (c) => ({ "&": "&amp;", '"': "&quot;", "'": "&apos;", "<": "&lt;", ">": "&gt;" })[c]);
  }
  text = text.replace(discouragedXMLCharacters, "");
  return text;
}
var junit_default = JUnitReporter;

// packages/playwright/src/reporters/line.ts
var LineReporter = class extends TerminalReporter {
  constructor() {
    super(...arguments);
    this._current = 0;
    this._failures = 0;
    this._didBegin = false;
  }
  onBegin(suite) {
    super.onBegin(suite);
    const startingMessage = this.generateStartingMessage();
    if (startingMessage) {
      this.writeLine(startingMessage);
      this.writeLine();
    }
    this._didBegin = true;
  }
  onStdOut(chunk, test, result) {
    super.onStdOut(chunk, test, result);
    this._dumpToStdio(test, chunk, this.screen.stdout);
  }
  onStdErr(chunk, test, result) {
    super.onStdErr(chunk, test, result);
    this._dumpToStdio(test, chunk, this.screen.stderr);
  }
  _dumpToStdio(test, chunk, stream) {
    if (this.config.quiet)
      return;
    if (!process.env.PW_TEST_DEBUG_REPORTERS)
      stream.write(`\x1B[1A\x1B[2K`);
    if (test && this._lastTest !== test) {
      const title = this.screen.colors.dim(this.formatTestTitle(test));
      stream.write(this.fitToScreen(title) + `
`);
      this._lastTest = test;
    }
    stream.write(chunk);
    if (chunk[chunk.length - 1] !== "\n")
      this.writeLine();
    this.writeLine();
  }
  onTestBegin(test, result) {
    ++this._current;
    this._updateLine(test, result, void 0);
  }
  onStepBegin(test, result, step) {
    if (this.screen.isTTY && step.category === "test.step")
      this._updateLine(test, result, step);
  }
  onStepEnd(test, result, step) {
    if (this.screen.isTTY && step.category === "test.step")
      this._updateLine(test, result, step.parent);
  }
  async onTestPaused(test, result) {
    if (!process.stdin.isTTY && !process.env.PW_TEST_DEBUG_REPORTERS)
      return;
    if (!process.env.PW_TEST_DEBUG_REPORTERS)
      this.screen.stdout.write(`\x1B[1A\x1B[2K`);
    if (test.outcome() === "unexpected") {
      this.writeLine(this.screen.colors.red(this.formatTestHeader(test, { indent: "  ", index: ++this._failures })));
      this.writeLine(this.formatResultErrors(test, result));
      markErrorsAsReported(result);
      this.writeLine(this.screen.colors.yellow(`    Paused on error. Press Ctrl+C to end.`) + "\n\n");
    } else {
      this.writeLine(this.screen.colors.yellow(this.formatTestHeader(test, { indent: "  " })));
      this.writeLine(this.screen.colors.yellow(`    Paused at test end. Press Ctrl+C to end.`) + "\n\n");
    }
    this._updateLine(test, result, void 0);
    await new Promise(() => {
    });
  }
  onTestEnd(test, result) {
    super.onTestEnd(test, result);
    if (!this.willRetry(test) && (test.outcome() === "flaky" || test.outcome() === "unexpected" || result.status === "interrupted")) {
      if (!process.env.PW_TEST_DEBUG_REPORTERS)
        this.screen.stdout.write(`\x1B[1A\x1B[2K`);
      this.writeLine(this.formatFailure(test, ++this._failures));
      this.writeLine();
    }
  }
  _updateLine(test, result, step) {
    const retriesPrefix = result.retry ? ` (retries)` : ``;
    const prefix = `[${this._current}/${this.totalTestCount}]${retriesPrefix} `;
    const currentRetrySuffix = result.retry ? this.screen.colors.yellow(` (retry #${result.retry})`) : "";
    const title = this.formatTestTitle(test, step) + currentRetrySuffix;
    if (process.env.PW_TEST_DEBUG_REPORTERS)
      this.screen.stdout.write(`${prefix + title}
`);
    else
      this.screen.stdout.write(`\x1B[1A\x1B[2K${prefix + this.fitToScreen(title, prefix)}
`);
  }
  onError(error) {
    super.onError(error);
    const message = this.formatError(error).message + "\n";
    if (!process.env.PW_TEST_DEBUG_REPORTERS && this._didBegin)
      this.screen.stdout.write(`\x1B[1A\x1B[2K`);
    this.screen.stdout.write(message);
    this.writeLine();
  }
  async onEnd(result) {
    if (!process.env.PW_TEST_DEBUG_REPORTERS && this._didBegin)
      this.screen.stdout.write(`\x1B[1A\x1B[2K`);
    await super.onEnd(result);
    this.epilogue(false);
  }
};
var line_default = LineReporter;

// packages/playwright/src/reporters/list.ts
var import_util9 = require("../util");
var { msToString: msToString3 } = require("playwright-core/lib/coreBundle").iso;
var { getAsBooleanFromENV: getAsBooleanFromENV2 } = require("playwright-core/lib/coreBundle").utils;
var DOES_NOT_SUPPORT_UTF8_IN_TERMINAL = process.platform === "win32" && process.env.TERM_PROGRAM !== "vscode" && !process.env.WT_SESSION;
var POSITIVE_STATUS_MARK = DOES_NOT_SUPPORT_UTF8_IN_TERMINAL ? "ok" : "\u2713";
var NEGATIVE_STATUS_MARK = DOES_NOT_SUPPORT_UTF8_IN_TERMINAL ? "x" : "\u2718";
var ListReporter = class extends TerminalReporter {
  constructor(options) {
    super(options);
    this._lastRow = 0;
    this._lastColumn = 0;
    this._testRows = /* @__PURE__ */ new Map();
    this._stepRows = /* @__PURE__ */ new Map();
    this._resultIndex = /* @__PURE__ */ new Map();
    this._stepIndex = /* @__PURE__ */ new Map();
    this._needNewLine = false;
    this._failureIndex = 0;
    this._paused = /* @__PURE__ */ new Set();
    this._printSteps = getAsBooleanFromENV2("PLAYWRIGHT_LIST_PRINT_STEPS", options?.printSteps);
    this._printFailuresInline = getAsBooleanFromENV2("PLAYWRIGHT_LIST_PRINT_FAILURES_INLINE", options?.printFailuresInline);
  }
  onBegin(suite) {
    super.onBegin(suite);
    const startingMessage = this.generateStartingMessage();
    if (startingMessage) {
      this.writeLine(startingMessage);
      this.writeLine("");
    }
  }
  onTestBegin(test, result) {
    const index = String(this._resultIndex.size + 1);
    this._resultIndex.set(result, index);
    if (!this.screen.isTTY)
      return;
    this._maybeWriteNewLine();
    this._testRows.set(test, this._lastRow);
    const prefix = this._testPrefix(index, "");
    const line = this.screen.colors.dim(this.formatTestTitle(test)) + this._retrySuffix(result);
    this._appendLine(line, prefix);
  }
  onStdOut(chunk, test, result) {
    super.onStdOut(chunk, test, result);
    this._dumpToStdio(test, chunk, this.screen.stdout, "out");
  }
  onStdErr(chunk, test, result) {
    super.onStdErr(chunk, test, result);
    this._dumpToStdio(test, chunk, this.screen.stderr, "err");
  }
  getStepIndex(testIndex, result, step) {
    if (this._stepIndex.has(step))
      return this._stepIndex.get(step);
    const ordinal = (result[lastStepOrdinalSymbol] || 0) + 1;
    result[lastStepOrdinalSymbol] = ordinal;
    const stepIndex = `${testIndex}.${ordinal}`;
    this._stepIndex.set(step, stepIndex);
    return stepIndex;
  }
  onStepBegin(test, result, step) {
    if (step.category !== "test.step")
      return;
    const testIndex = this._resultIndex.get(result) || "";
    if (!this.screen.isTTY)
      return;
    if (this._printSteps) {
      this._maybeWriteNewLine();
      this._stepRows.set(step, this._lastRow);
      const prefix = this._testPrefix(this.getStepIndex(testIndex, result, step), "");
      const line = test.title + this.screen.colors.dim(stepSuffix(step));
      this._appendLine(line, prefix);
    } else {
      this._updateOrAppendLine(this._testRows, test, this.screen.colors.dim(this.formatTestTitle(test, step)) + this._retrySuffix(result), this._testPrefix(testIndex, ""));
    }
  }
  onStepEnd(test, result, step) {
    if (step.category !== "test.step")
      return;
    const testIndex = this._resultIndex.get(result) || "";
    if (!this._printSteps) {
      if (this.screen.isTTY)
        this._updateOrAppendLine(this._testRows, test, this.screen.colors.dim(this.formatTestTitle(test, step.parent)) + this._retrySuffix(result), this._testPrefix(testIndex, ""));
      return;
    }
    const index = this.getStepIndex(testIndex, result, step);
    const title = this.screen.isTTY ? test.title + this.screen.colors.dim(stepSuffix(step)) : this.formatTestTitle(test, step);
    const prefix = this._testPrefix(index, "");
    let text = "";
    if (step.error)
      text = this.screen.colors.red(title);
    else
      text = title;
    text += this.screen.colors.dim(` (${msToString3(step.duration)})`);
    this._updateOrAppendLine(this._stepRows, step, text, prefix);
  }
  _maybeWriteNewLine() {
    if (this._needNewLine) {
      this._needNewLine = false;
      this.screen.stdout.write("\n");
      ++this._lastRow;
      this._lastColumn = 0;
    }
  }
  _updateLineCountAndNewLineFlagForOutput(text) {
    this._needNewLine = text[text.length - 1] !== "\n";
    if (!this.screen.ttyWidth)
      return;
    for (const ch of text) {
      if (ch === "\n") {
        this._lastColumn = 0;
        ++this._lastRow;
        continue;
      }
      ++this._lastColumn;
      if (this._lastColumn > this.screen.ttyWidth) {
        this._lastColumn = 0;
        ++this._lastRow;
      }
    }
  }
  _dumpToStdio(test, chunk, stream, stdio) {
    if (this.config.quiet)
      return;
    const text = chunk.toString("utf-8");
    this._updateLineCountAndNewLineFlagForOutput(text);
    stream.write(chunk);
  }
  async onTestPaused(test, result) {
    if (!process.stdin.isTTY && !process.env.PW_TEST_DEBUG_REPORTERS)
      return;
    this._paused.add(result);
    this._updateTestLine(test, result);
    this._maybeWriteNewLine();
    if (test.outcome() === "unexpected") {
      const errors = this.formatResultErrors(test, result);
      this.writeLine(errors);
      this._updateLineCountAndNewLineFlagForOutput(errors);
      markErrorsAsReported(result);
    }
    this._appendLine(this.screen.colors.yellow(`Paused ${test.outcome() === "unexpected" ? "on error" : "at test end"}. Press Ctrl+C to end.`), this._testPrefix("", ""));
    await new Promise(() => {
    });
  }
  onTestEnd(test, result) {
    super.onTestEnd(test, result);
    const wasPaused = this._paused.delete(result);
    if (!wasPaused)
      this._updateTestLine(test, result);
    const isFailure = result.status !== "skipped" && result.status !== test.expectedStatus;
    if (!wasPaused && this._printFailuresInline && isFailure)
      this._printFailure(test);
  }
  _printFailure(test) {
    this._maybeWriteNewLine();
    const message = "\n" + this.formatFailure(test, ++this._failureIndex) + "\n";
    this._updateLineCountAndNewLineFlagForOutput(message);
    this.screen.stdout.write(message);
  }
  _updateTestLine(test, result) {
    const title = this.formatTestTitle(test);
    let prefix = "";
    let text = "";
    let index = this._resultIndex.get(result);
    if (!index) {
      index = String(this._resultIndex.size + 1);
      this._resultIndex.set(result, index);
    }
    if (result.status === "skipped") {
      prefix = this._testPrefix(index, this.screen.colors.green("-"));
      text = this.screen.colors.cyan(title) + this._retrySuffix(result);
    } else {
      const statusMark = result.status === "passed" ? POSITIVE_STATUS_MARK : NEGATIVE_STATUS_MARK;
      if (result.status === test.expectedStatus) {
        prefix = this._testPrefix(index, this.screen.colors.green(statusMark));
        text = title;
      } else {
        prefix = this._testPrefix(index, this.screen.colors.red(statusMark));
        text = this.screen.colors.red(title);
      }
      text += this._retrySuffix(result) + this.screen.colors.dim(` (${msToString3(result.duration)})`);
    }
    this._updateOrAppendLine(this._testRows, test, text, prefix);
  }
  _updateOrAppendLine(entityRowNumbers, entity, text, prefix) {
    const row = entityRowNumbers.get(entity);
    if (row !== void 0 && this.screen.isTTY && this._lastRow - row < this.screen.ttyHeight) {
      this._updateLine(row, text, prefix);
    } else {
      this._maybeWriteNewLine();
      entityRowNumbers.set(entity, this._lastRow);
      this._appendLine(text, prefix);
    }
  }
  _appendLine(text, prefix) {
    const line = prefix + this.fitToScreen(text, prefix);
    if (process.env.PW_TEST_DEBUG_REPORTERS) {
      this.screen.stdout.write("#" + this._lastRow + " : " + line + "\n");
    } else {
      this.screen.stdout.write(line);
      this.screen.stdout.write("\n");
    }
    ++this._lastRow;
    this._lastColumn = 0;
  }
  _updateLine(row, text, prefix) {
    const line = prefix + this.fitToScreen(text, prefix);
    if (process.env.PW_TEST_DEBUG_REPORTERS)
      this.screen.stdout.write("#" + row + " : " + line + "\n");
    else
      this._updateLineForTTY(row, line);
  }
  _updateLineForTTY(row, line) {
    if (row !== this._lastRow)
      this.screen.stdout.write(`\x1B[${this._lastRow - row}A`);
    this.screen.stdout.write("\x1B[2K\x1B[0G");
    this.screen.stdout.write(line);
    if (row !== this._lastRow)
      this.screen.stdout.write(`\x1B[${this._lastRow - row}E`);
  }
  _testPrefix(index, statusMark) {
    const statusMarkLength = (0, import_util9.stripAnsiEscapes)(statusMark).length;
    const indexLength = Math.ceil(Math.log10(this.totalTestCount + 1));
    return "  " + statusMark + " ".repeat(3 - statusMarkLength) + this.screen.colors.dim(index.padStart(indexLength) + " ");
  }
  _retrySuffix(result) {
    return result.retry ? this.screen.colors.yellow(` (retry #${result.retry})`) : "";
  }
  onError(error) {
    super.onError(error);
    this._maybeWriteNewLine();
    const message = this.formatError(error).message + "\n";
    this._updateLineCountAndNewLineFlagForOutput(message);
    this.screen.stdout.write(message);
  }
  async onEnd(result) {
    await super.onEnd(result);
    this.screen.stdout.write("\n");
    this.epilogue(!this._printFailuresInline);
  }
};
var lastStepOrdinalSymbol = Symbol("lastStepOrdinal");
var list_default = ListReporter;

// packages/playwright/src/reporters/listModeReporter.ts
var import_path11 = __toESM(require("path"));
var ListModeReporter = class {
  constructor(options = {}) {
    this._options = options;
    this.screen = options?.screen ?? terminalScreen;
  }
  version() {
    return "v2";
  }
  onConfigure(config2) {
    this.config = config2;
  }
  onBegin(suite) {
    this._writeLine(`Listing tests:`);
    const tests = suite.allTests();
    const files = /* @__PURE__ */ new Set();
    for (const test of tests) {
      const [, projectName, , ...titles] = test.titlePath();
      const location = `${import_path11.default.relative(this.config.rootDir, test.location.file)}:${test.location.line}:${test.location.column}`;
      const testId = this._options.includeTestId ? `[id=${test.id}] ` : "";
      const projectLabel = this._options.includeTestId ? `project=` : "";
      const projectTitle = projectName ? `[${projectLabel}${projectName}] \u203A ` : "";
      this._writeLine(`  ${testId}${projectTitle}${location} \u203A ${titles.join(" \u203A ")}`);
      files.add(test.location.file);
    }
    this._writeLine(`Total: ${tests.length} ${tests.length === 1 ? "test" : "tests"} in ${files.size} ${files.size === 1 ? "file" : "files"}`);
  }
  onError(error) {
    this.screen.stderr.write("\n" + formatError(terminalScreen, error).message + "\n");
  }
  _writeLine(line) {
    this.screen.stdout.write(line + "\n");
  }
};
var listModeReporter_default = ListModeReporter;

// packages/playwright/src/runner/reporters.ts
var { calculateSha1: calculateSha13 } = require("playwright-core/lib/coreBundle").utils;
async function createReporters(config2, mode, descriptions, runOptions) {
  const defaultReporters = {
    blob: BlobReporter,
    dot: mode === "list" ? listModeReporter_default : dot_default,
    line: mode === "list" ? listModeReporter_default : line_default,
    list: mode === "list" ? listModeReporter_default : list_default,
    github: github_default,
    json: json_default,
    junit: junit_default,
    null: empty_default,
    html: html_default
  };
  const reporters = [];
  descriptions ??= config2.config.reporter;
  if (runOptions?.additionalReporters)
    descriptions = [...descriptions, ...runOptions.additionalReporters];
  const reportOptions = reporterCommandOptions(config2, mode, runOptions);
  for (const r of descriptions) {
    const [name, arg] = r;
    const options = { ...reportOptions, ...arg };
    if (name in defaultReporters) {
      reporters.push(new defaultReporters[name](options));
    } else {
      const reporterConstructor = await loadReporter(config2, name);
      reporters.push(wrapReporterAsV2(new reporterConstructor(options)));
    }
  }
  if (process.env.PW_TEST_REPORTER) {
    const name = process.env.PW_TEST_REPORTER;
    if (name in defaultReporters) {
      reporters.push(new defaultReporters[name](reportOptions));
    } else {
      const reporterConstructor = await loadReporter(config2, name);
      reporters.push(wrapReporterAsV2(new reporterConstructor(reportOptions)));
    }
  }
  const someReporterPrintsToStdio = reporters.some((r) => r.printsToStdio ? r.printsToStdio() : true);
  if (reporters.length && !someReporterPrintsToStdio) {
    if (mode === "list")
      reporters.unshift(new listModeReporter_default());
    else if (mode !== "merge")
      reporters.unshift(!process.env.CI ? new line_default() : new dot_default());
  }
  return reporters;
}
function createErrorCollectingReporter(screen) {
  const errors = [];
  return {
    version: () => "v2",
    onError(error) {
      errors.push(error);
      screen.stderr?.write(formatError(screen, error).message + "\n");
    },
    errors: () => errors
  };
}
function reporterCommandOptions(config2, mode, runOptions) {
  return {
    configDir: config2.configDir,
    _mode: mode,
    _commandHash: computeCommandHash(config2, runOptions)
  };
}
function computeCommandHash(config2, runOptions) {
  const parts = [];
  if (runOptions?.projectFilter)
    parts.push(...runOptions.projectFilter);
  const command = {};
  if (runOptions?.locations?.length)
    command.locations = runOptions.locations;
  if (runOptions?.grep)
    command.grep = runOptions.grep;
  if (runOptions?.grepInvert)
    command.grepInvert = runOptions.grepInvert;
  if (runOptions?.onlyChanged)
    command.onlyChanged = runOptions.onlyChanged;
  if (config2.config.tags.length)
    command.tags = config2.config.tags.join(" ");
  if (runOptions?.testList)
    command.testList = calculateSha13(import_fs8.default.readFileSync(runOptions.testList));
  if (runOptions?.testListInvert)
    command.testListInvert = calculateSha13(import_fs8.default.readFileSync(runOptions.testListInvert));
  if (Object.keys(command).length)
    parts.push(calculateSha13(JSON.stringify(command)).substring(0, 7));
  return parts.join("-");
}

// packages/playwright/src/runner/tasks.ts
var import_fs11 = __toESM(require("fs"));
var import_path15 = __toESM(require("path"));
var import_util12 = require("util");

// packages/playwright/src/runner/rebase.ts
var import_fs9 = __toESM(require("fs"));
var import_path12 = __toESM(require("path"));
var babel3 = __toESM(require("../transform/babelBundle"));
var colors3 = require("playwright-core/lib/utilsBundle").colors;
var diff = require("playwright-core/lib/utilsBundle").diff;
var { MultiMap: MultiMap3 } = require("playwright-core/lib/coreBundle").iso;
var t = babel3.types;
var suggestedRebaselines = new MultiMap3();
function addSuggestedRebaseline(location, suggestedRebaseline) {
  suggestedRebaselines.set(location.file, { location, code: suggestedRebaseline });
}
function clearSuggestedRebaselines() {
  suggestedRebaselines.clear();
}
async function applySuggestedRebaselines(config2, reporter, filteredProjects) {
  if (config2.config.updateSnapshots === "none")
    return;
  if (!suggestedRebaselines.size)
    return;
  const [project] = filteredProjects;
  if (!project)
    return;
  const patches = [];
  const files = [];
  const gitCache = /* @__PURE__ */ new Map();
  const patchFile = import_path12.default.join(project.project.outputDir, "rebaselines.patch");
  for (const fileName of [...suggestedRebaselines.keys()].sort()) {
    const source = await import_fs9.default.promises.readFile(fileName, "utf8");
    const lines = source.split("\n");
    const replacements = suggestedRebaselines.get(fileName);
    const fileNode = babel3.babelParse(source, fileName, true);
    const ranges = [];
    babel3.traverse(fileNode, {
      CallExpression: (path20) => {
        const node = path20.node;
        if (node.arguments.length < 1)
          return;
        if (!t.isMemberExpression(node.callee))
          return;
        const argument = node.arguments[0];
        if (!t.isStringLiteral(argument) && !t.isTemplateLiteral(argument))
          return;
        const prop = node.callee.property;
        if (!prop.loc || !argument.start || !argument.end)
          return;
        for (const replacement of replacements) {
          if (prop.loc.start.line !== replacement.location.line)
            continue;
          if (prop.loc.start.column + 1 !== replacement.location.column)
            continue;
          const indent2 = lines[prop.loc.start.line - 1].match(/^\s*/)[0];
          const newText = replacement.code.replace(/\{indent\}/g, indent2);
          ranges.push({ start: argument.start, end: argument.end, oldText: source.substring(argument.start, argument.end), newText });
          break;
        }
      }
    });
    ranges.sort((a, b) => b.start - a.start);
    let result = source;
    for (const range of ranges)
      result = result.substring(0, range.start) + range.newText + result.substring(range.end);
    const relativeName = import_path12.default.relative(process.cwd(), fileName);
    files.push(relativeName);
    if (config2.config.updateSourceMethod === "overwrite") {
      await import_fs9.default.promises.writeFile(fileName, result);
    } else if (config2.config.updateSourceMethod === "3way") {
      await import_fs9.default.promises.writeFile(fileName, applyPatchWithConflictMarkers(source, result));
    } else {
      const gitFolder = findGitRoot(import_path12.default.dirname(fileName), gitCache);
      const relativeToGit = import_path12.default.relative(gitFolder || process.cwd(), fileName);
      patches.push(createPatch(relativeToGit, source, result));
    }
  }
  const fileList = files.map((file) => "  " + colors3.dim(file)).join("\n");
  reporter.onStdErr(`
New baselines created for:

${fileList}
`);
  if (config2.config.updateSourceMethod === "patch") {
    await import_fs9.default.promises.mkdir(import_path12.default.dirname(patchFile), { recursive: true });
    await import_fs9.default.promises.writeFile(patchFile, patches.join("\n"));
    reporter.onStdErr(`
  ` + colors3.cyan("git apply " + import_path12.default.relative(process.cwd(), patchFile)) + "\n");
  }
}
function createPatch(fileName, before, after) {
  const file = fileName.replace(/\\/g, "/");
  const text = diff.createPatch(file, before, after, void 0, void 0, { context: 3 });
  return [
    "diff --git a/" + file + " b/" + file,
    "--- a/" + file,
    "+++ b/" + file,
    ...text.split("\n").slice(4)
  ].join("\n");
}
function findGitRoot(dir, cache) {
  const result = cache.get(dir);
  if (result !== void 0)
    return result;
  const gitPath = import_path12.default.join(dir, ".git");
  if (import_fs9.default.existsSync(gitPath) && import_fs9.default.lstatSync(gitPath).isDirectory()) {
    cache.set(dir, dir);
    return dir;
  }
  const parentDir = import_path12.default.dirname(dir);
  if (dir === parentDir) {
    cache.set(dir, null);
    return null;
  }
  const parentResult = findGitRoot(parentDir, cache);
  cache.set(dir, parentResult);
  return parentResult;
}
function applyPatchWithConflictMarkers(oldText, newText) {
  const diffResult = diff.diffLines(oldText, newText);
  let result = "";
  let conflict = false;
  diffResult.forEach((part) => {
    if (part.added) {
      if (conflict) {
        result += part.value;
        result += ">>>>>>> SNAPSHOT\n";
        conflict = false;
      } else {
        result += "<<<<<<< HEAD\n";
        result += part.value;
        result += "=======\n";
        conflict = true;
      }
    } else if (part.removed) {
      result += "<<<<<<< HEAD\n";
      result += part.value;
      result += "=======\n";
      conflict = true;
    } else {
      if (conflict) {
        result += ">>>>>>> SNAPSHOT\n";
        conflict = false;
      }
      result += part.value;
    }
  });
  if (conflict)
    result += ">>>>>>> SNAPSHOT\n";
  return result;
}

// packages/playwright/src/runner/workerHost.ts
var import_fs10 = __toESM(require("fs"));
var import_path13 = __toESM(require("path"));
var import_common5 = require("../common");

// packages/playwright/src/isomorphic/folders.ts
function artifactsFolderName(workerIndex) {
  return `.playwright-artifacts-${workerIndex}`;
}

// packages/playwright/src/runner/workerHost.ts
var { removeFolders: removeFolders3 } = require("playwright-core/lib/coreBundle").utils;
var lastWorkerIndex = 0;
var WorkerHost = class extends ProcessHost {
  constructor(testGroup, options) {
    const workerIndex = lastWorkerIndex++;
    super(require.resolve("../worker/workerProcessEntry.js"), `worker-${workerIndex}`, {
      ...options.extraEnv,
      FORCE_COLOR: "1",
      DEBUG_COLORS: process.env.DEBUG_COLORS === void 0 ? "1" : process.env.DEBUG_COLORS
    });
    this._didFail = false;
    this.workerIndex = workerIndex;
    this.parallelIndex = options.parallelIndex;
    this._hash = testGroup.workerHash;
    this._params = {
      workerIndex: this.workerIndex,
      parallelIndex: options.parallelIndex,
      repeatEachIndex: testGroup.repeatEachIndex,
      projectId: testGroup.projectId,
      config: options.config,
      artifactsDir: import_path13.default.join(options.outputDir, artifactsFolderName(workerIndex)),
      pauseOnError: options.pauseOnError,
      pauseAtEnd: options.pauseAtEnd
    };
  }
  async start() {
    await import_fs10.default.promises.mkdir(this._params.artifactsDir, { recursive: true });
    return await this.startRunner(this._params, {
      onStdOut: (chunk) => this.emit("stdOut", import_common5.ipc.stdioChunkToParams(chunk)),
      onStdErr: (chunk) => this.emit("stdErr", import_common5.ipc.stdioChunkToParams(chunk))
    });
  }
  async onExit() {
    await removeFolders3([this._params.artifactsDir]);
  }
  async stop(didFail) {
    if (didFail)
      this._didFail = true;
    await super.stop();
  }
  runTestGroup(runPayload) {
    this.sendMessageNoReply({ method: "runTestGroup", params: runPayload });
  }
  async sendCustomMessage(payload) {
    return await this.sendMessage({ method: "customMessage", params: payload });
  }
  sendResume(payload) {
    this.sendMessageNoReply({ method: "resume", params: payload });
  }
  hash() {
    return this._hash;
  }
  projectId() {
    return this._params.projectId;
  }
  didFail() {
    return this._didFail;
  }
};

// packages/playwright/src/runner/dispatcher.ts
var import_common6 = require("../common");
var import_util10 = require("../util");
var colors4 = require("playwright-core/lib/utilsBundle").colors;
var { ManualPromise: ManualPromise3 } = require("playwright-core/lib/coreBundle").iso;
var { eventsHelper } = require("playwright-core/lib/coreBundle").utils;
var Dispatcher = class {
  constructor(testRun) {
    // Worker slot is claimed when it has jobDispatcher assigned.
    this._workerSlots = [];
    this._queue = [];
    this._workerLimitPerProjectId = /* @__PURE__ */ new Map();
    this._queuedOrRunningHashCount = /* @__PURE__ */ new Map();
    this._finished = new ManualPromise3();
    this._isStopped = true;
    this._extraEnvByProjectId = /* @__PURE__ */ new Map();
    this._producedEnvByProjectId = /* @__PURE__ */ new Map();
    this._testRun = testRun;
    for (const project of testRun.config.projects) {
      if (project.workers)
        this._workerLimitPerProjectId.set(project.id, project.workers);
    }
  }
  _findFirstJobToRun() {
    for (let index = 0; index < this._queue.length; index++) {
      const job = this._queue[index];
      const projectIdWorkerLimit = this._workerLimitPerProjectId.get(job.projectId);
      if (!projectIdWorkerLimit)
        return index;
      const runningWorkersWithSameProjectId = this._workerSlots.filter((w) => w.jobDispatcher?.job.projectId === job.projectId).length;
      if (runningWorkersWithSameProjectId < projectIdWorkerLimit)
        return index;
    }
    return -1;
  }
  _scheduleJob() {
    if (this._isStopped)
      return;
    const jobIndex = this._findFirstJobToRun();
    if (jobIndex === -1)
      return;
    const job = this._queue[jobIndex];
    let workerIndex = this._workerSlots.findIndex((w) => !w.jobDispatcher && w.worker && w.worker.hash() === job.workerHash && !w.worker.didSendStop());
    if (workerIndex === -1)
      workerIndex = this._workerSlots.findIndex((w) => !w.jobDispatcher);
    if (workerIndex === -1) {
      return;
    }
    this._queue.splice(jobIndex, 1);
    const jobDispatcher = new JobDispatcher(job, this._testRun, () => this.stop().catch(() => {
    }));
    this._workerSlots[workerIndex].jobDispatcher = jobDispatcher;
    void this._runJobInWorker(workerIndex, jobDispatcher).then(() => {
      this._workerSlots[workerIndex].jobDispatcher = void 0;
      this._checkFinished();
      this._scheduleJob();
    });
  }
  async _runJobInWorker(index, jobDispatcher) {
    const job = jobDispatcher.job;
    if (jobDispatcher.skipWholeJob())
      return;
    let worker = this._workerSlots[index].worker;
    if (worker && (worker.hash() !== job.workerHash || worker.didSendStop())) {
      await worker.stop();
      worker = void 0;
      if (this._isStopped)
        return;
    }
    let startError;
    if (!worker) {
      worker = this._createWorker(job, index, import_common6.ipc.serializeConfig(this._testRun.config, true));
      this._workerSlots[index].worker = worker;
      worker.on("exit", () => this._workerSlots[index].worker = void 0);
      startError = await worker.start();
      if (this._isStopped)
        return;
    }
    if (startError)
      jobDispatcher.onExit(startError);
    else
      jobDispatcher.runInWorker(worker);
    const result = await jobDispatcher.jobResult;
    this._updateCounterForWorkerHash(job.workerHash, -1);
    if (result.didFail)
      void worker.stop(
        true
        /* didFail */
      );
    else if (this._isWorkerRedundant(worker))
      void worker.stop();
    if (!this._isStopped && result.newJob) {
      this._queue.unshift(result.newJob);
      this._updateCounterForWorkerHash(result.newJob.workerHash, 1);
    }
  }
  _checkFinished() {
    if (this._finished.isDone())
      return;
    if (this._queue.length && !this._isStopped)
      return;
    if (this._workerSlots.some((w) => !!w.jobDispatcher))
      return;
    this._finished.resolve();
  }
  _isWorkerRedundant(worker) {
    let workersWithSameHash = 0;
    for (const slot of this._workerSlots) {
      if (slot.worker && !slot.worker.didSendStop() && slot.worker.hash() === worker.hash())
        workersWithSameHash++;
    }
    return workersWithSameHash > this._queuedOrRunningHashCount.get(worker.hash());
  }
  _updateCounterForWorkerHash(hash, delta) {
    this._queuedOrRunningHashCount.set(hash, delta + (this._queuedOrRunningHashCount.get(hash) || 0));
  }
  async run(testGroups, extraEnvByProjectId) {
    this._extraEnvByProjectId = extraEnvByProjectId;
    this._queue = testGroups;
    for (const group of testGroups)
      this._updateCounterForWorkerHash(group.workerHash, 1);
    this._isStopped = false;
    this._workerSlots = [];
    if (this._testRun.hasReachedMaxFailures())
      void this.stop();
    for (let i = 0; i < this._testRun.config.config.workers; i++)
      this._workerSlots.push({});
    for (let i = 0; i < this._workerSlots.length; i++)
      this._scheduleJob();
    this._checkFinished();
    await this._finished;
  }
  _createWorker(testGroup, parallelIndex, loaderData) {
    const project = this._testRun.config.projects.find((p) => p.id === testGroup.projectId);
    const pauseAtEnd = this._testRun.topLevelProjects.includes(project) && !!this._testRun.options.pauseAtEnd;
    const worker = new WorkerHost(testGroup, {
      parallelIndex,
      config: loaderData,
      extraEnv: this._extraEnvByProjectId.get(testGroup.projectId) || {},
      outputDir: project.project.outputDir,
      pauseOnError: !!this._testRun.options.pauseOnError,
      pauseAtEnd
    });
    const handleOutput = (params) => {
      const chunk = chunkFromParams(params);
      if (worker.didFail()) {
        return { chunk };
      }
      const currentlyRunning = this._workerSlots[parallelIndex].jobDispatcher?.currentlyRunning();
      if (!currentlyRunning)
        return { chunk };
      return { chunk, test: currentlyRunning.test, result: currentlyRunning.result };
    };
    worker.on("stdOut", (params) => {
      const { chunk, test, result } = handleOutput(params);
      result?.stdout.push(chunk);
      this._testRun.reporter.onStdOut?.(chunk, test, result);
    });
    worker.on("stdErr", (params) => {
      const { chunk, test, result } = handleOutput(params);
      result?.stderr.push(chunk);
      this._testRun.reporter.onStdErr?.(chunk, test, result);
    });
    worker.on("teardownErrors", (params) => {
      this._testRun.hasWorkerErrors = true;
      const workerInfo = {
        config: this._testRun.config.config,
        project: project.project,
        workerIndex: worker.workerIndex,
        parallelIndex: worker.parallelIndex
      };
      for (const error of params.fatalErrors)
        this._testRun.reporter.onError?.(error, workerInfo);
    });
    worker.on("processError", (error) => {
      this._testRun.hasWorkerErrors = true;
      this._testRun.reporter.onError?.(error);
    });
    worker.on("exit", () => {
      const producedEnv = this._producedEnvByProjectId.get(testGroup.projectId) || {};
      this._producedEnvByProjectId.set(testGroup.projectId, { ...producedEnv, ...worker.producedEnv() });
    });
    return worker;
  }
  producedEnvByProjectId() {
    return this._producedEnvByProjectId;
  }
  async stop() {
    if (this._isStopped)
      return;
    this._isStopped = true;
    await Promise.all(this._workerSlots.map(({ worker }) => worker?.stop()));
    this._checkFinished();
  }
};
var JobDispatcher = class {
  constructor(job, testRun, stopCallback) {
    this.jobResult = new ManualPromise3();
    this._listeners = [];
    this._failedTests = /* @__PURE__ */ new Set();
    this._failedWithNonRetriableError = /* @__PURE__ */ new Set();
    this._remainingByTestId = /* @__PURE__ */ new Map();
    this._dataByTestId = /* @__PURE__ */ new Map();
    this._parallelIndex = 0;
    this._workerIndex = 0;
    this.job = job;
    this._testRun = testRun;
    this._stopCallback = stopCallback;
    this._remainingByTestId = new Map(this.job.tests.map((e) => [e.id, e]));
  }
  _onTestBegin(params) {
    const test = this._remainingByTestId.get(params.testId);
    if (!test) {
      return;
    }
    const result = test._appendTestResult();
    this._dataByTestId.set(test.id, { test, result, steps: /* @__PURE__ */ new Map() });
    result.parallelIndex = this._parallelIndex;
    result.workerIndex = this._workerIndex;
    result.startTime = new Date(params.startWallTime);
    this._testRun.reporter.onTestBegin?.(test, result);
    this._currentlyRunning = { test, result };
  }
  _onTestEnd(params) {
    if (this._testRun.hasReachedMaxFailures()) {
      params.status = "interrupted";
      params.errors = [];
    }
    const data = this._dataByTestId.get(params.testId);
    if (!data) {
      return;
    }
    this._dataByTestId.delete(params.testId);
    this._remainingByTestId.delete(params.testId);
    const { result, test } = data;
    result.duration = params.duration;
    result.errors = params.errors;
    result.error = result.errors[0];
    result.status = params.status;
    result.annotations = params.annotations;
    test.annotations = [...params.annotations];
    test.expectedStatus = params.expectedStatus;
    test.timeout = params.timeout;
    const isFailure = result.status !== "skipped" && result.status !== test.expectedStatus;
    if (isFailure)
      this._failedTests.add(test);
    if (params.hasNonRetriableError)
      this._addNonretriableTestAndSerialModeParents(test);
    this._reportTestEnd(test, result);
    this._currentlyRunning = void 0;
  }
  _addNonretriableTestAndSerialModeParents(test) {
    this._failedWithNonRetriableError.add(test);
    for (let parent = test.parent; parent; parent = parent.parent) {
      if (parent._parallelMode === "serial")
        this._failedWithNonRetriableError.add(parent);
    }
  }
  _onStepBegin(params) {
    const data = this._dataByTestId.get(params.testId);
    if (!data) {
      return;
    }
    const { result, steps, test } = data;
    const parentStep = params.parentStepId ? steps.get(params.parentStepId) : void 0;
    const step = {
      title: params.title,
      titlePath: () => {
        const parentPath = parentStep?.titlePath() || [];
        return [...parentPath, params.title];
      },
      parent: parentStep,
      category: params.category,
      startTime: new Date(params.wallTime),
      duration: -1,
      steps: [],
      attachments: [],
      annotations: [],
      location: params.location
    };
    steps.set(params.stepId, step);
    (parentStep || result).steps.push(step);
    this._testRun.reporter.onStepBegin?.(test, result, step);
  }
  _onStepEnd(params) {
    const data = this._dataByTestId.get(params.testId);
    if (!data) {
      return;
    }
    const { result, steps, test } = data;
    const step = steps.get(params.stepId);
    if (!step) {
      this._testRun.reporter.onStdErr?.("Internal error: step end without step begin: " + params.stepId, test, result);
      return;
    }
    step.duration = params.wallTime - step.startTime.getTime();
    if (params.error)
      step.error = params.error;
    if (params.suggestedRebaseline)
      addSuggestedRebaseline(step.location, params.suggestedRebaseline);
    step.annotations = params.annotations;
    steps.delete(params.stepId);
    this._testRun.reporter.onStepEnd?.(test, result, step);
  }
  _onAttach(params) {
    const data = this._dataByTestId.get(params.testId);
    if (!data) {
      return;
    }
    const attachment = {
      name: params.name,
      path: params.path,
      contentType: params.contentType,
      body: params.body !== void 0 ? Buffer.from(params.body, "base64") : void 0
    };
    data.result.attachments.push(attachment);
    if (params.stepId) {
      const step = data.steps.get(params.stepId);
      if (step)
        step.attachments.push(attachment);
      else
        this._testRun.reporter.onStdErr?.("Internal error: step id not found: " + params.stepId);
    }
  }
  _failTestWithErrors(test, errors) {
    const runData = this._dataByTestId.get(test.id);
    let result;
    if (runData) {
      result = runData.result;
    } else {
      result = test._appendTestResult();
      this._testRun.reporter.onTestBegin?.(test, result);
    }
    result.errors = [...errors];
    result.error = result.errors[0];
    result.status = errors.length ? "failed" : "skipped";
    this._reportTestEnd(test, result);
    this._failedTests.add(test);
  }
  _massSkipTestsFromRemaining(testIds, errors) {
    for (const test of this._remainingByTestId.values()) {
      if (!testIds.has(test.id))
        continue;
      if (!this._testRun.hasReachedMaxFailures()) {
        this._failTestWithErrors(test, errors);
        errors = [];
      }
      this._remainingByTestId.delete(test.id);
    }
    if (errors.length) {
      this._testRun.hasWorkerErrors = true;
      for (const error of errors)
        this._testRun.reporter.onError?.(error);
    }
  }
  _onDone(params) {
    if (!this._remainingByTestId.size && !this._failedTests.size && !params.fatalErrors.length && !params.skipTestsDueToSetupFailure.length && !params.fatalUnknownTestIds && !params.unexpectedExitError && !params.stoppedDueToUnhandledErrorInTestFail) {
      this._finished({ didFail: false });
      return;
    }
    for (const testId of params.fatalUnknownTestIds || []) {
      const test = this._remainingByTestId.get(testId);
      if (test) {
        this._remainingByTestId.delete(testId);
        this._failTestWithErrors(test, [{ message: `Test not found in the worker process. Make sure test title does not change.` }]);
      }
    }
    if (params.fatalErrors.length) {
      this._massSkipTestsFromRemaining(new Set(this._remainingByTestId.keys()), params.fatalErrors);
    }
    this._massSkipTestsFromRemaining(new Set(params.skipTestsDueToSetupFailure), []);
    if (params.unexpectedExitError) {
      if (this._currentlyRunning)
        this._massSkipTestsFromRemaining(/* @__PURE__ */ new Set([this._currentlyRunning.test.id]), [params.unexpectedExitError]);
      else
        this._massSkipTestsFromRemaining(new Set(this._remainingByTestId.keys()), [params.unexpectedExitError]);
    }
    const retryCandidates = /* @__PURE__ */ new Set();
    const serialSuitesWithFailures = /* @__PURE__ */ new Set();
    for (const failedTest of this._failedTests) {
      if (this._failedWithNonRetriableError.has(failedTest))
        continue;
      retryCandidates.add(failedTest);
      let outermostSerialSuite;
      for (let parent = failedTest.parent; parent; parent = parent.parent) {
        if (parent._parallelMode === "serial")
          outermostSerialSuite = parent;
      }
      if (outermostSerialSuite && !this._failedWithNonRetriableError.has(outermostSerialSuite))
        serialSuitesWithFailures.add(outermostSerialSuite);
    }
    const testsBelongingToSomeSerialSuiteWithFailures = [...this._remainingByTestId.values()].filter((test) => {
      let parent = test.parent;
      while (parent && !serialSuitesWithFailures.has(parent))
        parent = parent.parent;
      return !!parent;
    });
    this._massSkipTestsFromRemaining(new Set(testsBelongingToSomeSerialSuiteWithFailures.map((test) => test.id)), []);
    for (const serialSuite of serialSuitesWithFailures) {
      serialSuite.allTests().forEach((test) => retryCandidates.add(test));
    }
    const remaining = [...this._remainingByTestId.values()];
    for (const test of retryCandidates) {
      if (test.results.length < test.retries + 1)
        remaining.push(test);
    }
    const newJob = remaining.length ? { ...this.job, tests: remaining } : void 0;
    this._finished({ didFail: true, newJob });
  }
  onExit(data) {
    const unexpectedExitError = data.unexpectedly ? {
      message: `Error: worker process exited unexpectedly (code=${data.code}, signal=${data.signal})`
    } : void 0;
    this._onDone({ skipTestsDueToSetupFailure: [], fatalErrors: [], unexpectedExitError });
  }
  _finished(result) {
    eventsHelper.removeEventListeners(this._listeners);
    this.jobResult.resolve(result);
  }
  runInWorker(worker) {
    this._parallelIndex = worker.parallelIndex;
    this._workerIndex = worker.workerIndex;
    const runPayload = {
      file: this.job.requireFile,
      entries: this.job.tests.map((test) => {
        return { testId: test.id, retry: test.results.length };
      })
    };
    worker.runTestGroup(runPayload);
    this._listeners = [
      eventsHelper.addEventListener(worker, "testBegin", this._onTestBegin.bind(this)),
      eventsHelper.addEventListener(worker, "testEnd", this._onTestEnd.bind(this)),
      eventsHelper.addEventListener(worker, "stepBegin", this._onStepBegin.bind(this)),
      eventsHelper.addEventListener(worker, "stepEnd", this._onStepEnd.bind(this)),
      eventsHelper.addEventListener(worker, "attach", this._onAttach.bind(this)),
      eventsHelper.addEventListener(worker, "testPaused", this._onTestPaused.bind(this, worker)),
      eventsHelper.addEventListener(worker, "done", this._onDone.bind(this)),
      eventsHelper.addEventListener(worker, "exit", this.onExit.bind(this))
    ];
  }
  _onTestPaused(worker, params) {
    const data = this._dataByTestId.get(params.testId);
    if (!data)
      return;
    const { result, test } = data;
    const sendMessage = async (message) => {
      try {
        if (this.jobResult.isDone())
          throw new Error("Test has already stopped");
        const response = await worker.sendCustomMessage({ testId: test.id, request: message.request });
        if (response.error)
          addLocationAndSnippetToError(this._testRun.config.config, response.error);
        return response;
      } catch (e) {
        const error = (0, import_util10.serializeError)(e);
        addLocationAndSnippetToError(this._testRun.config.config, error);
        return { response: void 0, error };
      }
    };
    result.status = params.status;
    result.errors = params.errors;
    result.error = result.errors[0];
    void this._testRun.reporter.onTestPaused?.(test, result).then(() => {
      worker.sendResume({});
    });
    this._testRun.onTestPaused({ ...params, sendMessage });
  }
  skipWholeJob() {
    const allTestsSkipped = this.job.tests.every((test) => test.expectedStatus === "skipped");
    if (allTestsSkipped && !this._testRun.hasReachedMaxFailures()) {
      for (const test of this.job.tests) {
        const result = test._appendTestResult();
        this._testRun.reporter.onTestBegin?.(test, result);
        result.status = "skipped";
        result.annotations = [...test.annotations];
        this._reportTestEnd(test, result);
      }
      return true;
    }
    return false;
  }
  currentlyRunning() {
    return this._currentlyRunning;
  }
  _reportTestEnd(test, result) {
    this._testRun.reporter.onTestEnd?.(test, result);
    const hadMaxFailures = this._testRun.hasReachedMaxFailures();
    if (test.outcome() === "unexpected" && test.results.length > test.retries)
      ++this._testRun.failedTestCount;
    if (!hadMaxFailures && this._testRun.hasReachedMaxFailures()) {
      this._stopCallback();
      this._testRun.reporter.onError?.({ message: colors4.red(`Testing stopped early after ${this._testRun.config.config.maxFailures} maximum allowed failures.`) });
    }
  }
};
function chunkFromParams(params) {
  if (typeof params.text === "string")
    return params.text;
  return Buffer.from(params.buffer, "base64");
}

// packages/playwright/src/runner/sigIntWatcher.ts
var SigIntWatcher = class {
  constructor() {
    this._hadSignal = false;
    let sigintCallback;
    this._sigintPromise = new Promise((f) => sigintCallback = f);
    this._sigintHandler = () => {
      FixedNodeSIGINTHandler.off(this._sigintHandler);
      this._hadSignal = true;
      sigintCallback();
    };
    FixedNodeSIGINTHandler.on(this._sigintHandler);
  }
  promise() {
    return this._sigintPromise;
  }
  hadSignal() {
    return this._hadSignal;
  }
  disarm() {
    FixedNodeSIGINTHandler.off(this._sigintHandler);
  }
};
var FixedNodeSIGINTHandler = class {
  static {
    this._handlers = [];
  }
  static {
    this._ignoreNextSIGINTs = false;
  }
  static {
    this._handlerInstalled = false;
  }
  static {
    this._dispatch = () => {
      if (this._ignoreNextSIGINTs)
        return;
      this._ignoreNextSIGINTs = true;
      setTimeout(() => {
        this._ignoreNextSIGINTs = false;
        if (!this._handlers.length)
          this._uninstall();
      }, 1e3);
      for (const handler of this._handlers)
        handler();
    };
  }
  static _install() {
    if (!this._handlerInstalled) {
      this._handlerInstalled = true;
      process.on("SIGINT", this._dispatch);
    }
  }
  static _uninstall() {
    if (this._handlerInstalled) {
      this._handlerInstalled = false;
      process.off("SIGINT", this._dispatch);
    }
  }
  static on(handler) {
    this._handlers.push(handler);
    if (this._handlers.length === 1)
      this._install();
  }
  static off(handler) {
    this._handlers = this._handlers.filter((h) => h !== handler);
    if (!this._ignoreNextSIGINTs && !this._handlers.length)
      this._uninstall();
  }
};

// packages/playwright/src/runner/taskRunner.ts
var import_util11 = require("../util");
var colors5 = require("playwright-core/lib/utilsBundle").colors;
var debug4 = require("playwright-core/lib/utilsBundle").debug;
var { ManualPromise: ManualPromise4 } = require("playwright-core/lib/coreBundle").iso;
var { monotonicTime: monotonicTime5 } = require("playwright-core/lib/coreBundle").iso;
var TaskRunner = class _TaskRunner {
  constructor(reporter, globalTimeoutForError) {
    this._tasks = [];
    this._hasErrors = false;
    this._interrupted = false;
    this._isTearDown = false;
    this._reporter = reporter;
    this._globalTimeoutForError = globalTimeoutForError;
  }
  addTask(task) {
    this._tasks.push(task);
  }
  async run(context, deadline, cancelPromise) {
    const { status, cleanup } = await this.runDeferCleanup(context, deadline, cancelPromise);
    const teardownStatus = await cleanup();
    return status === "passed" ? teardownStatus : status;
  }
  async runDeferCleanup(context, deadline, cancelPromise = new ManualPromise4()) {
    const sigintWatcher = new SigIntWatcher();
    const timeoutWatcher = new TimeoutWatcher(deadline);
    const teardownRunner = new _TaskRunner(this._reporter, this._globalTimeoutForError);
    teardownRunner._isTearDown = true;
    let currentTaskName;
    const taskLoop = async () => {
      for (const task of this._tasks) {
        currentTaskName = task.title;
        if (this._interrupted)
          break;
        debug4("pw:test:task")(`"${task.title}" started`);
        const errors = [];
        const softErrors = [];
        try {
          teardownRunner._tasks.unshift({ title: `teardown for ${task.title}`, setup: task.teardown });
          await task.setup?.(context, errors, softErrors);
        } catch (e) {
          debug4("pw:test:task")(`error in "${task.title}": `, e);
          errors.push((0, import_util11.serializeError)(e));
        } finally {
          for (const error of [...softErrors, ...errors])
            this._reporter.onError?.(error);
          if (errors.length) {
            if (!this._isTearDown)
              this._interrupted = true;
            this._hasErrors = true;
          }
        }
        debug4("pw:test:task")(`"${task.title}" finished`);
      }
    };
    await Promise.race([
      taskLoop(),
      cancelPromise,
      sigintWatcher.promise(),
      timeoutWatcher.promise
    ]);
    sigintWatcher.disarm();
    timeoutWatcher.disarm();
    this._interrupted = true;
    let status = "passed";
    if (sigintWatcher.hadSignal() || cancelPromise?.isDone()) {
      status = "interrupted";
    } else if (timeoutWatcher.timedOut()) {
      this._reporter.onError?.({ message: colors5.red(`Timed out waiting ${this._globalTimeoutForError / 1e3}s for the ${currentTaskName} to run`) });
      status = "timedout";
    } else if (this._hasErrors) {
      status = "failed";
    }
    cancelPromise?.resolve();
    const cleanup = () => teardownRunner.runDeferCleanup(context, deadline).then((r) => r.status);
    return { status, cleanup };
  }
};
var TimeoutWatcher = class {
  constructor(deadline) {
    this._timedOut = false;
    this.promise = new ManualPromise4();
    if (!deadline)
      return;
    if (deadline - monotonicTime5() <= 0) {
      this._timedOut = true;
      this.promise.resolve();
      return;
    }
    this._timer = setTimeout(() => {
      this._timedOut = true;
      this.promise.resolve();
    }, deadline - monotonicTime5());
  }
  timedOut() {
    return this._timedOut;
  }
  disarm() {
    clearTimeout(this._timer);
  }
};

// packages/playwright/src/runner/vcs.ts
var import_child_process2 = __toESM(require("child_process"));
var import_path14 = __toESM(require("path"));
var import_common7 = require("../common");
async function detectChangedTestFiles(baseCommit, configDir) {
  function gitFileList(args) {
    try {
      return import_child_process2.default.execFileSync(
        "git",
        args,
        { encoding: "utf-8", stdio: "pipe", cwd: configDir }
      ).split("\n").filter(Boolean);
    } catch (_error) {
      const error = _error;
      const unknownRevision = error.output.some((line) => line?.includes("unknown revision"));
      if (unknownRevision) {
        const isShallowClone = import_child_process2.default.execFileSync("git", ["rev-parse", "--is-shallow-repository"], { encoding: "utf-8", stdio: "pipe", cwd: configDir }).trim() === "true";
        if (isShallowClone) {
          throw new Error([
            `The repository is a shallow clone and does not have '${baseCommit}' available locally.`,
            `Note that GitHub Actions checkout is shallow by default: https://github.com/actions/checkout`
          ].join("\n"));
        }
      }
      throw new Error([
        `Cannot detect changed files for --only-changed mode:`,
        `git ${args.join(" ")}`,
        "",
        ...error.output
      ].join("\n"));
    }
  }
  const untrackedFiles = gitFileList(["ls-files", "--others", "--exclude-standard"]).map((file) => import_path14.default.join(configDir, file));
  const [gitRoot] = gitFileList(["rev-parse", "--show-toplevel"]);
  const trackedFilesWithChanges = gitFileList(["diff", baseCommit, "--name-only"]).map((file) => import_path14.default.join(gitRoot, file));
  return new Set(import_common7.cc.affectedTestFiles([...untrackedFiles, ...trackedFilesWithChanges]));
}

// packages/playwright/src/runner/tasks.ts
var import_common8 = require("../common");
var import_util13 = require("../util");
var debug5 = require("playwright-core/lib/utilsBundle").debug;
var { ManualPromise: ManualPromise5 } = require("playwright-core/lib/coreBundle").iso;
var { monotonicTime: monotonicTime6 } = require("playwright-core/lib/coreBundle").iso;
var { removeFolders: removeFolders4 } = require("playwright-core/lib/coreBundle").utils;
var readDirAsync2 = (0, import_util12.promisify)(import_fs11.default.readdir);
var TestRun = class {
  constructor(config2, reporter, options) {
    this.rootSuite = void 0;
    this.phases = [];
    this.projectFiles = /* @__PURE__ */ new Map();
    this.projectSuites = /* @__PURE__ */ new Map();
    this.topLevelProjects = [];
    this.hasWorkerErrors = false;
    this.failedTestCount = 0;
    this.loadFileFilters = [];
    this.preOnlyTestFilters = [];
    this.postShardTestFilters = [];
    this.config = config2;
    this.options = options ?? {};
    this.reporter = reporter;
    this.filteredProjects = filterProjects(config2.projects, this.options.projectFilter);
  }
  onTestPaused(params) {
    this.options.onTestPaused?.(params);
  }
  hasReachedMaxFailures() {
    const max = this.config.config.maxFailures;
    return max > 0 && this.failedTestCount >= max;
  }
  result() {
    const hasFailedTests = this.rootSuite?.allTests().some((test) => !test.ok());
    const hasFlakyTests = this.rootSuite?.allTests().some((test) => test.outcome() === "flaky");
    return this.hasWorkerErrors || this.hasReachedMaxFailures() || hasFailedTests || this.config.config.failOnFlakyTests && hasFlakyTests ? "failed" : "passed";
  }
};
async function runTasks(testRun, tasks, globalTimeout, cancelPromise) {
  const deadline = globalTimeout ? monotonicTime6() + globalTimeout : 0;
  const taskRunner = new TaskRunner(testRun.reporter, globalTimeout || 0);
  for (const task of tasks)
    taskRunner.addTask(task);
  testRun.reporter.onConfigure(testRun.config.config);
  const status = await taskRunner.run(testRun, deadline, cancelPromise);
  return await finishTaskRun(testRun, status);
}
async function runTasksDeferCleanup(testRun, tasks) {
  const taskRunner = new TaskRunner(testRun.reporter, 0);
  for (const task of tasks)
    taskRunner.addTask(task);
  testRun.reporter.onConfigure(testRun.config.config);
  const { status, cleanup } = await taskRunner.runDeferCleanup(testRun, 0);
  return { status: await finishTaskRun(testRun, status), cleanup };
}
async function finishTaskRun(testRun, status) {
  if (status === "passed")
    status = testRun.result();
  const modifiedResult = await testRun.reporter.onEnd({ status });
  if (modifiedResult && modifiedResult.status)
    status = modifiedResult.status;
  await testRun.reporter.onExit();
  return status;
}
function createGlobalSetupTasks(config2) {
  return [
    createRemoveOutputDirsTask(),
    ...createPluginSetupTasks(config2),
    ...config2.globalTeardowns.map((file) => createGlobalTeardownTask(file, config2)).reverse(),
    ...config2.globalSetups.map((file) => createGlobalSetupTask(file, config2))
  ];
}
function createRunTestsTasks(config2) {
  return [
    createPhasesTask(),
    createReportBeginTask(),
    ...config2.plugins.map((plugin) => createPluginBeginTask(plugin)),
    createRunTestsTask()
  ];
}
function createClearCacheTask(config2) {
  return {
    title: "clear cache",
    setup: async () => {
      await (0, import_util13.removeDirAndLogToConsole)(import_common8.cc.cacheDir);
      for (const plugin of config2.plugins)
        await plugin.instance?.clearCache?.();
    }
  };
}
function createReportBeginTask() {
  return {
    title: "report begin",
    setup: async (testRun) => {
      testRun.reporter.onBegin?.(testRun.rootSuite);
    },
    teardown: async ({}) => {
    }
  };
}
function createPluginSetupTasks(config2) {
  return config2.plugins.map((plugin) => ({
    title: "plugin setup",
    setup: async ({ reporter }) => {
      if (typeof plugin.factory === "function")
        plugin.instance = await plugin.factory();
      else
        plugin.instance = plugin.factory;
      await plugin.instance?.setup?.(config2.config, config2.configDir, reporter);
    },
    teardown: async () => {
      await plugin.instance?.teardown?.();
    }
  }));
}
function createPluginBeginTask(plugin) {
  return {
    title: "plugin begin",
    setup: async (testRun) => {
      await plugin.instance?.begin?.(testRun.rootSuite);
    },
    teardown: async () => {
      await plugin.instance?.end?.();
    }
  };
}
function createGlobalSetupTask(file, config2) {
  let title = "global setup";
  if (config2.globalSetups.length > 1)
    title += ` (${file})`;
  let globalSetupResult;
  return {
    title,
    setup: async ({ config: config3 }) => {
      const setupHook = await loadGlobalHook(config3, file);
      globalSetupResult = await setupHook(config3.config);
    },
    teardown: async () => {
      if (typeof globalSetupResult === "function")
        await globalSetupResult();
    }
  };
}
function createGlobalTeardownTask(file, config2) {
  let title = "global teardown";
  if (config2.globalTeardowns.length > 1)
    title += ` (${file})`;
  return {
    title,
    teardown: async ({ config: config3 }) => {
      const teardownHook = await loadGlobalHook(config3, file);
      await teardownHook(config3.config);
    }
  };
}
function createRemoveOutputDirsTask() {
  return {
    title: "clear output",
    setup: async (testRun) => {
      if (testRun.options.preserveOutputDir)
        return;
      const outputDirs = /* @__PURE__ */ new Set();
      testRun.filteredProjects.forEach((p) => outputDirs.add(p.project.outputDir));
      await Promise.all(Array.from(outputDirs).map((outputDir) => removeFolders4([outputDir]).then(async ([error]) => {
        if (!error)
          return;
        if (error.code === "EBUSY") {
          const entries = await readDirAsync2(outputDir).catch((e) => []);
          await Promise.all(entries.map((entry) => removeFolders4([import_path15.default.join(outputDir, entry)])));
        } else {
          throw error;
        }
      })));
    }
  };
}
function createListFilesTask() {
  return {
    title: "load tests",
    setup: async (testRun, errors) => {
      await createRootSuite(testRun, errors, false);
      await collectProjectsAndTestFiles(testRun, false);
      for (const [project, files] of testRun.projectFiles) {
        const projectSuite = new import_common8.test.Suite(project.project.name, "project");
        projectSuite._fullProject = project;
        testRun.rootSuite._addSuite(projectSuite);
        const suites = files.map((file) => {
          const title = import_path15.default.relative(testRun.config.config.rootDir, file);
          const suite = new import_common8.test.Suite(title, "file");
          suite.location = { file, line: 0, column: 0 };
          projectSuite._addSuite(suite);
          return suite;
        });
        testRun.projectSuites.set(project, suites);
      }
    }
  };
}
function createLoadTask(mode, options) {
  return {
    title: "load tests",
    setup: async (testRun, errors, softErrors) => {
      if (testRun.options.locations?.length) {
        const { testFilter, fileFilter } = import_common8.suiteUtils.createFiltersFromArguments(testRun.options.locations);
        testRun.loadFileFilters.push(fileFilter);
        testRun.preOnlyTestFilters.push(testFilter);
      }
      if (testRun.options.testList) {
        const { testFilter, fileFilter } = await loadTestList(testRun.config, testRun.options.testList);
        testRun.preOnlyTestFilters.push(testFilter);
        testRun.loadFileFilters.push(fileFilter);
      }
      if (testRun.options.testListInvert) {
        const { testFilter } = await loadTestList(testRun.config, testRun.options.testListInvert);
        testRun.preOnlyTestFilters.push((test) => !testFilter(test));
      }
      if (testRun.options.grep || testRun.options.grepInvert) {
        const grepMatcher = testRun.options.grep ? (0, import_util13.createTitleMatcher)((0, import_util13.forceRegExp)(testRun.options.grep)) : () => true;
        const grepInvertMatcher = testRun.options.grepInvert ? (0, import_util13.createTitleMatcher)((0, import_util13.forceRegExp)(testRun.options.grepInvert)) : () => false;
        testRun.preOnlyTestFilters.push((test) => {
          const grepTitle = test._grepTitleWithTags();
          return !grepInvertMatcher(grepTitle) && grepMatcher(grepTitle);
        });
      }
      if (testRun.options.lastFailedTestIds?.length) {
        const failedTestIds = new Set(testRun.options.lastFailedTestIds);
        testRun.postShardTestFilters.push((test) => failedTestIds.has(test.id));
      }
      await collectProjectsAndTestFiles(testRun, !!options.doNotRunDepsOutsideProjectFilter);
      await loadFileSuites(testRun, mode, options.failOnLoadErrors ? errors : softErrors);
      if (testRun.options.onlyChanged || options.populateDependencies) {
        for (const plugin of testRun.config.plugins)
          await plugin.instance?.populateDependencies?.();
      }
      if (testRun.options.onlyChanged) {
        const changedFiles = await detectChangedTestFiles(testRun.options.onlyChanged, testRun.config.configDir);
        testRun.preOnlyTestFilters.push((test) => changedFiles.has(test.location.file));
      }
      await createRootSuite(testRun, options.failOnLoadErrors ? errors : softErrors, !!options.filterOnly);
      if (options.failOnLoadErrors && !testRun.rootSuite?.allTests().length && !testRun.options.passWithNoTests && !testRun.config.config.shard && !testRun.options.onlyChanged && !testRun.options.testList && !testRun.options.testListInvert) {
        if (testRun.options.locations?.length) {
          throw new Error([
            `No tests found.`,
            `Make sure that arguments are regular expressions matching test files.`,
            `You may need to escape symbols like "$" or "*" and quote the arguments.`
          ].join("\n"));
        }
        throw new Error(`No tests found`);
      }
    }
  };
}
function createApplyRebaselinesTask() {
  return {
    title: "apply rebaselines",
    setup: async () => {
      clearSuggestedRebaselines();
    },
    teardown: async (testRun) => {
      await applySuggestedRebaselines(testRun.config, testRun.reporter, testRun.filteredProjects);
    }
  };
}
function createPhasesTask() {
  return {
    title: "create phases",
    setup: async (testRun) => {
      let maxConcurrentTestGroups = 0;
      const processed = /* @__PURE__ */ new Set();
      const projectToSuite = new Map(testRun.rootSuite.suites.map((suite) => [suite._fullProject, suite]));
      const allProjects = [...projectToSuite.keys()];
      const teardownToSetups = buildTeardownToSetupsMap(allProjects);
      const teardownToSetupsDependents = /* @__PURE__ */ new Map();
      for (const [teardown, setups] of teardownToSetups) {
        const closure = buildDependentProjects(setups, allProjects);
        closure.delete(teardown);
        teardownToSetupsDependents.set(teardown, [...closure]);
      }
      for (let i = 0; i < projectToSuite.size; i++) {
        const phaseProjects = [];
        for (const project of projectToSuite.keys()) {
          if (processed.has(project))
            continue;
          const projectsThatShouldFinishFirst = [...project.deps, ...teardownToSetupsDependents.get(project) || []];
          if (projectsThatShouldFinishFirst.find((p) => !processed.has(p)))
            continue;
          phaseProjects.push(project);
        }
        for (const project of phaseProjects)
          processed.add(project);
        if (phaseProjects.length) {
          let testGroupsInPhase = 0;
          const phase = { dispatcher: new Dispatcher(testRun), projects: [] };
          testRun.phases.push(phase);
          for (const project of phaseProjects) {
            const projectSuite = projectToSuite.get(project);
            const testGroups = createTestGroups(projectSuite, testRun.config.config.workers);
            phase.projects.push({ project, projectSuite, testGroups });
            testGroupsInPhase += Math.min(project.workers ?? Number.MAX_SAFE_INTEGER, testGroups.length);
          }
          debug5("pw:test:task")(`created phase #${testRun.phases.length} with ${phase.projects.map((p) => p.project.project.name).sort()} projects, ${testGroupsInPhase} testGroups`);
          maxConcurrentTestGroups = Math.max(maxConcurrentTestGroups, testGroupsInPhase);
        }
      }
      testRun.config.config.metadata.actualWorkers = Math.min(testRun.config.config.workers, maxConcurrentTestGroups);
    }
  };
}
function createRunTestsTask() {
  return {
    title: "test suite",
    setup: async (testRun) => {
      const successfulProjects = /* @__PURE__ */ new Set();
      const extraEnvByProjectId = /* @__PURE__ */ new Map();
      const teardownToSetups = buildTeardownToSetupsMap(testRun.phases.map((phase) => phase.projects.map((p) => p.project)).flat());
      for (const { dispatcher, projects } of testRun.phases) {
        const phaseTestGroups = [];
        for (const { project, testGroups } of projects) {
          let extraEnv = {};
          for (const dep of project.deps)
            extraEnv = { ...extraEnv, ...extraEnvByProjectId.get(dep.id) };
          for (const setup of teardownToSetups.get(project) || [])
            extraEnv = { ...extraEnv, ...extraEnvByProjectId.get(setup.id) };
          extraEnvByProjectId.set(project.id, extraEnv);
          const hasFailedDeps = project.deps.some((p) => !successfulProjects.has(p));
          if (!hasFailedDeps)
            phaseTestGroups.push(...testGroups);
        }
        if (phaseTestGroups.length) {
          await dispatcher.run(phaseTestGroups, extraEnvByProjectId);
          await dispatcher.stop();
          for (const [projectId, envProduced] of dispatcher.producedEnvByProjectId()) {
            const extraEnv = extraEnvByProjectId.get(projectId) || {};
            extraEnvByProjectId.set(projectId, { ...extraEnv, ...envProduced });
          }
        }
        if (!testRun.hasWorkerErrors) {
          for (const { project, projectSuite } of projects) {
            const hasFailedDeps = project.deps.some((p) => !successfulProjects.has(p));
            if (!hasFailedDeps && !projectSuite.allTests().some((test) => !test.ok()))
              successfulProjects.add(project);
          }
        }
      }
    },
    teardown: async ({ phases }) => {
      for (const { dispatcher } of phases.reverse())
        await dispatcher.stop();
    }
  };
}

// packages/playwright/src/runner/lastRun.ts
var import_fs12 = __toESM(require("fs"));
var import_path16 = __toESM(require("path"));
var LastRunReporter = class {
  constructor(filteredProjects, listMode, lastFailedFileOverride) {
    this._listMode = !!listMode;
    const override = lastFailedFileOverride ?? process.env.PLAYWRIGHT_LAST_RUN_OUTPUT_FILE;
    if (override) {
      this._lastRunFile = import_path16.default.resolve(process.cwd(), override);
    } else {
      const [project] = filteredProjects;
      if (project)
        this._lastRunFile = import_path16.default.join(project.project.outputDir, ".last-run.json");
    }
  }
  async filterLastFailed() {
    if (!this._lastRunFile)
      return [];
    try {
      const lastRunInfo = JSON.parse(await import_fs12.default.promises.readFile(this._lastRunFile, "utf8"));
      return lastRunInfo.failedTests;
    } catch {
      return [];
    }
  }
  version() {
    return "v2";
  }
  printsToStdio() {
    return false;
  }
  onBegin(suite) {
    this._suite = suite;
  }
  async onEnd(result) {
    if (!this._lastRunFile || this._listMode)
      return;
    const lastRunInfo = {
      status: result.status,
      failedTests: this._suite?.allTests().filter((t2) => !t2.ok()).map((t2) => t2.id) || []
    };
    await import_fs12.default.promises.mkdir(import_path16.default.dirname(this._lastRunFile), { recursive: true });
    await import_fs12.default.promises.writeFile(this._lastRunFile, JSON.stringify(lastRunInfo, void 0, 2));
  }
};

// packages/playwright/src/runner/testRunner.ts
var { ManualPromise: ManualPromise6 } = require("playwright-core/lib/coreBundle").iso;
var { setPlaywrightTestProcessEnv } = require("playwright-core/lib/coreBundle").utils;
var { gracefullyProcessExitDoNotHang: gracefullyProcessExitDoNotHang2 } = require("playwright-core/lib/coreBundle").utils;
var TestRunnerEvent = {
  TestFilesChanged: "testFilesChanged",
  TestPaused: "testPaused"
};
var TestRunner = class extends import_events2.default {
  constructor(configLocation, configCLIOverrides) {
    super();
    this._watchedProjectDirs = /* @__PURE__ */ new Set();
    this._ignoredProjectOutputs = /* @__PURE__ */ new Set();
    this._watchedTestDependencies = /* @__PURE__ */ new Set();
    this._queue = Promise.resolve();
    this._watchTestDirs = false;
    this._populateDependenciesOnList = false;
    this._startingEnv = {};
    this.configLocation = configLocation;
    this._configCLIOverrides = configCLIOverrides;
    this._watcher = new FSWatcher((events) => {
      const collector = /* @__PURE__ */ new Set();
      events.forEach((f) => import_common9.cc.collectAffectedTestFiles(f.file, collector));
      this.emit(TestRunnerEvent.TestFilesChanged, [...collector]);
    });
  }
  async initialize(params) {
    setPlaywrightTestProcessEnv();
    this._watchTestDirs = !!params.watchTestDirs;
    this._populateDependenciesOnList = !!params.populateDependenciesOnList;
    this._startingEnv = { ...process.env };
  }
  resizeTerminal(params) {
    process.stdout.columns = params.cols;
    process.stdout.rows = params.rows;
    process.stderr.columns = params.cols;
    process.stderr.rows = params.rows;
  }
  hasSomeBrowsers() {
    for (const browserName of ["chromium", "webkit", "firefox"]) {
      try {
        import_coreBundle2.registry.registry.findExecutable(browserName).executablePathOrDie("javascript");
        return true;
      } catch {
      }
    }
    return false;
  }
  async installBrowsers() {
    const executables = import_coreBundle2.registry.registry.defaultExecutables();
    await import_coreBundle2.registry.registry.install(executables);
  }
  async loadConfig() {
    const { config: config2, error } = await this._loadConfig(this._configCLIOverrides);
    if (config2)
      return config2;
    throw new Error("Failed to load config: " + (error ? error.message : "Unknown error"));
  }
  async runGlobalSetup(userReporters) {
    await this.runGlobalTeardown();
    const reporter = new InternalReporter(userReporters);
    const config2 = await this._loadConfigOrReportError(reporter, this._configCLIOverrides);
    if (!config2)
      return { status: "failed", env: [] };
    const { status, cleanup } = await runTasksDeferCleanup(new TestRun(config2, reporter), [
      ...createGlobalSetupTasks(config2)
    ]);
    const env = [];
    for (const key of /* @__PURE__ */ new Set([...Object.keys(process.env), ...Object.keys(this._startingEnv)])) {
      if (this._startingEnv[key] !== process.env[key])
        env.push([key, process.env[key] ?? null]);
    }
    if (status !== "passed")
      await cleanup();
    else
      this._globalSetup = { cleanup };
    return { status, env };
  }
  async runGlobalTeardown() {
    const globalSetup = this._globalSetup;
    const status = await globalSetup?.cleanup();
    this._globalSetup = void 0;
    return { status };
  }
  async clearCache(userReporter) {
    const reporter = new InternalReporter(userReporter ? [userReporter] : []);
    const config2 = await this._loadConfigOrReportError(reporter);
    if (!config2)
      return { status: "failed" };
    const status = await runTasks(new TestRun(config2, reporter), [
      ...createPluginSetupTasks(config2),
      createClearCacheTask(config2)
    ]);
    return { status };
  }
  async listFiles(userReporter, projects) {
    const reporter = new InternalReporter([userReporter]);
    const config2 = await this._loadConfigOrReportError(reporter);
    if (!config2)
      return { status: "failed" };
    const options = { projectFilter: projects?.length ? projects : void 0 };
    const status = await runTasks(new TestRun(config2, reporter, options), [
      createListFilesTask(),
      createReportBeginTask()
    ]);
    return { status };
  }
  async listTests(userReporter, params) {
    let result;
    this._queue = this._queue.then(async () => {
      const { config: config2, status } = await this._innerListTests(userReporter, params);
      if (config2)
        await this._updateWatchedDirs(config2);
      result = { status };
    }).catch(printInternalError);
    await this._queue;
    return result;
  }
  async _innerListTests(userReporter, params) {
    const overrides = {
      ...this._configCLIOverrides,
      repeatEach: 1,
      retries: 0
    };
    const reporter = new InternalReporter([userReporter]);
    const config2 = await this._loadConfigOrReportError(reporter, overrides);
    if (!config2)
      return { status: "failed" };
    const options = {
      locations: params.locations?.length ? params.locations : void 0,
      grep: params.grep,
      grepInvert: params.grepInvert,
      projectFilter: params.projects?.length ? params.projects : void 0,
      onlyChanged: params.onlyChanged ? "HEAD" : void 0,
      listMode: true
    };
    const status = await runTasks(new TestRun(config2, reporter, options), [
      createLoadTask("out-of-process", { failOnLoadErrors: false, filterOnly: false, populateDependencies: this._populateDependenciesOnList }),
      createReportBeginTask()
    ]);
    return { config: config2, status };
  }
  async _updateWatchedDirs(config2) {
    this._watchedProjectDirs = /* @__PURE__ */ new Set();
    this._ignoredProjectOutputs = /* @__PURE__ */ new Set();
    for (const p of config2.projects) {
      this._watchedProjectDirs.add(p.project.testDir);
      this._ignoredProjectOutputs.add(p.project.outputDir);
    }
    const result = await resolveCtDirs(config2);
    if (result) {
      this._watchedProjectDirs.add(result.templateDir);
      this._ignoredProjectOutputs.add(result.outDir);
    }
    if (this._watchTestDirs)
      await this._updateWatcher(false);
  }
  async _updateWatcher(reportPending) {
    await this._watcher.update([...this._watchedProjectDirs, ...this._watchedTestDependencies], [...this._ignoredProjectOutputs], reportPending);
  }
  async runTests(userReporter, params) {
    let result = { status: "passed" };
    this._queue = this._queue.then(async () => {
      result = await this._innerRunTests(userReporter, params).catch((e) => {
        printInternalError(e);
        return { status: "failed" };
      });
    });
    await this._queue;
    return result;
  }
  async _innerRunTests(userReporter, params) {
    await this.stopTests();
    const overrides = {
      ...this._configCLIOverrides,
      repeatEach: 1,
      retries: 0,
      timeout: params.timeout,
      reporter: params.reporters ? params.reporters.map((r) => [r]) : void 0,
      use: {
        ...this._configCLIOverrides.use,
        ...params.trace === "on" ? { trace: { mode: "on", sources: false, live: true } } : {},
        ...params.trace === "off" ? { trace: "off" } : {},
        ...params.video === "on" || params.video === "off" ? { video: params.video } : {},
        ...params.headed !== void 0 ? { headless: !params.headed } : {},
        _optionContextReuseMode: params.reuseContext ? "when-possible" : void 0,
        _optionConnectOptions: params.connectWsEndpoint ? { wsEndpoint: params.connectWsEndpoint } : void 0,
        actionTimeout: params.actionTimeout
      },
      ...params.updateSnapshots ? { updateSnapshots: params.updateSnapshots } : {},
      ...params.updateSourceMethod ? { updateSourceMethod: params.updateSourceMethod } : {},
      ...params.workers ? { workers: params.workers } : {},
      ...params.maxFailures ? { maxFailures: params.maxFailures } : {}
    };
    const config2 = await this._loadConfigOrReportError(new InternalReporter([userReporter]), overrides);
    if (!config2)
      return { status: "failed" };
    const options = {
      passWithNoTests: true,
      locations: params.locations?.length ? params.locations : void 0,
      grep: params.grep,
      grepInvert: params.grepInvert,
      projectFilter: params.projects?.length ? params.projects : void 0,
      pauseOnError: params.pauseOnError,
      pauseAtEnd: params.pauseAtEnd,
      preserveOutputDir: true,
      onTestPaused: (params2) => this.emit(TestRunnerEvent.TestPaused, params2)
    };
    const configReporters = params.disableConfigReporters ? [] : await createReporters(config2, "test", void 0, options);
    const reporter = new InternalReporter([...configReporters, userReporter]);
    const stop = new ManualPromise6();
    const testRun = new TestRun(config2, reporter, options);
    if (params.testIds) {
      const testIdSet = new Set(params.testIds);
      testRun.preOnlyTestFilters.push((test) => testIdSet.has(test.id));
    }
    const tasks = [
      createApplyRebaselinesTask(),
      createLoadTask("out-of-process", { filterOnly: true, failOnLoadErrors: !!params.failOnLoadErrors, doNotRunDepsOutsideProjectFilter: params.doNotRunDepsOutsideProjectFilter }),
      ...createRunTestsTasks(config2)
    ];
    const run = runTasks(testRun, tasks, 0, stop).then(async (status) => {
      this._testRun = void 0;
      return status;
    });
    this._testRun = { run, stop };
    return { status: await run };
  }
  async watch(fileNames) {
    this._watchedTestDependencies = /* @__PURE__ */ new Set();
    for (const fileName of fileNames) {
      this._watchedTestDependencies.add(fileName);
      import_common9.cc.dependenciesForTestFile(fileName).forEach((file) => this._watchedTestDependencies.add(file));
    }
    await this._updateWatcher(true);
  }
  async findRelatedTestFiles(files, userReporter) {
    const errorReporter = createErrorCollectingReporter(internalScreen);
    const reporter = new InternalReporter(userReporter ? [userReporter, errorReporter] : [errorReporter]);
    const config2 = await this._loadConfigOrReportError(reporter);
    if (!config2)
      return { errors: errorReporter.errors(), testFiles: [] };
    const status = await runTasks(new TestRun(config2, reporter), [
      ...createPluginSetupTasks(config2),
      createLoadTask("out-of-process", { failOnLoadErrors: true, filterOnly: false, populateDependencies: true })
    ]);
    if (status !== "passed")
      return { errors: errorReporter.errors(), testFiles: [] };
    return { testFiles: import_common9.cc.affectedTestFiles(files) };
  }
  async stopTests() {
    this._testRun?.stop?.resolve();
    await this._testRun?.run;
  }
  async closeGracefully() {
    gracefullyProcessExitDoNotHang2(0);
  }
  async stop() {
    await this.runGlobalTeardown();
  }
  async _loadConfig(overrides) {
    try {
      const config2 = await import_common9.configLoader.loadConfig(this.configLocation, overrides);
      if (!this._plugins) {
        webServerPluginsForConfig(config2).forEach((p) => config2.plugins.push({ factory: p }));
        addGitCommitInfoPlugin(config2);
        this._plugins = config2.plugins || [];
      } else {
        config2.plugins.splice(0, config2.plugins.length, ...this._plugins);
      }
      this._lastLoadedConfig = config2;
      return { config: config2 };
    } catch (e) {
      return { config: null, error: (0, import_util14.serializeError)(e) };
    }
  }
  lastLoadedConfig() {
    return this._lastLoadedConfig;
  }
  async _loadConfigOrReportError(reporter, overrides) {
    const { config: config2, error } = await this._loadConfig(overrides);
    if (config2)
      return config2;
    reporter.onConfigure(baseFullConfig);
    reporter.onError(error);
    await reporter.onEnd({ status: "failed" });
    await reporter.onExit();
    return null;
  }
};
function printInternalError(e) {
  console.error("Internal error:", e);
}
async function resolveCtDirs(config2) {
  const use = config2.config.projects[0].use;
  const relativeTemplateDir = use.ctTemplateDir || "playwright";
  const templateDir = await import_fs13.default.promises.realpath(import_path17.default.normalize(import_path17.default.join(config2.configDir, relativeTemplateDir))).catch(() => void 0);
  if (!templateDir)
    return null;
  const outDir = use.ctCacheDir ? import_path17.default.resolve(config2.configDir, use.ctCacheDir) : import_path17.default.resolve(templateDir, ".cache");
  return {
    outDir,
    templateDir
  };
}
async function runAllTestsWithConfig(config2, options) {
  setPlaywrightTestProcessEnv();
  addGitCommitInfoPlugin(config2);
  webServerPluginsForConfig(config2).forEach((p) => config2.plugins.push({ factory: p }));
  const filteredProjects = filterProjects(config2.projects, options.projectFilter);
  const reporters = await createReporters(config2, options.listMode ? "list" : "test", void 0, options);
  const lastRun = new LastRunReporter(filteredProjects, options.listMode, options.lastFailedFile);
  if (options.lastFailed) {
    const lastFailedTestIds = await lastRun.filterLastFailed();
    if (lastFailedTestIds.length)
      options = { ...options, lastFailedTestIds };
  }
  const reporter = new InternalReporter([...reporters, lastRun]);
  const tasks = options.listMode ? [
    createLoadTask("in-process", { failOnLoadErrors: true, filterOnly: false }),
    createReportBeginTask()
  ] : [
    createApplyRebaselinesTask(),
    ...createGlobalSetupTasks(config2),
    createLoadTask("in-process", { filterOnly: true, failOnLoadErrors: true }),
    ...createRunTestsTasks(config2)
  ];
  const testRun = new TestRun(config2, reporter, { ...options, pauseAtEnd: config2.configCLIOverrides.pause, pauseOnError: config2.configCLIOverrides.pause });
  const status = await runTasks(testRun, tasks, config2.config.globalTimeout);
  await new Promise((resolve) => process.stdout.write("", () => resolve()));
  await new Promise((resolve) => process.stderr.write("", () => resolve()));
  return status;
}

// packages/playwright/src/runner/testServer.ts
var testServer_exports = {};
__export(testServer_exports, {
  TestServerDispatcher: () => TestServerDispatcher,
  runTestServer: () => runTestServer,
  runUIMode: () => runUIMode
});
var import_util15 = __toESM(require("util"));
var import_coreBundle3 = require("playwright-core/lib/coreBundle");
var import_common10 = require("../common");

// packages/playwright/src/runner/uiModeReporter.ts
var UIModeReporter = class extends TeleReporterEmitter {
  constructor(options) {
    super(options._send, { omitBuffers: true });
  }
};
var uiModeReporter_default = UIModeReporter;

// packages/playwright/src/runner/testServer.ts
var debug6 = require("playwright-core/lib/utilsBundle").debug;
var open2 = require("playwright-core/lib/utilsBundle").open;
var { ManualPromise: ManualPromise7 } = require("playwright-core/lib/coreBundle").iso;
var { isUnderTest } = require("playwright-core/lib/coreBundle").utils;
var { HttpServer: HttpServer2 } = require("playwright-core/lib/coreBundle").utils;
var { gracefullyProcessExitDoNotHang: gracefullyProcessExitDoNotHang3 } = require("playwright-core/lib/coreBundle").utils;
var originalDebugLog = debug6.log;
var originalStdoutWrite = process.stdout.write;
var originalStderrWrite = process.stderr.write;
var originalStdinIsTTY = process.stdin.isTTY;
var TestServer = class {
  constructor(configLocation, configCLIOverrides) {
    this._configLocation = configLocation;
    this._configCLIOverrides = configCLIOverrides;
  }
  async start(options) {
    this._dispatcher = new TestServerDispatcher(this._configLocation, this._configCLIOverrides);
    return await import_coreBundle3.server.startTraceViewerServer({
      host: options.host,
      port: options.port,
      allowedFileRoots: () => this._allowedFileRoots(),
      transport: this._dispatcher.transport
    });
  }
  _allowedFileRoots() {
    const roots = /* @__PURE__ */ new Set([process.cwd(), this._configLocation.configDir]);
    const config2 = this._dispatcher?._testRunner.lastLoadedConfig();
    if (config2) {
      for (const project of config2.projects) {
        roots.add(project.project.outputDir);
        roots.add(project.project.testDir);
      }
    }
    return [...roots];
  }
  async stop() {
    await this._dispatcher?.stop();
  }
};
var TestServerDispatcher = class {
  constructor(configLocation, configCLIOverrides) {
    this._closeOnDisconnect = false;
    this._testRunner = new TestRunner(configLocation, configCLIOverrides);
    this.transport = {
      onconnect: () => {
      },
      dispatch: (method, params) => this[method](params),
      onclose: () => {
        if (this._closeOnDisconnect)
          gracefullyProcessExitDoNotHang3(0);
      }
    };
    this._dispatchEvent = (method, params) => this.transport.sendEvent?.(method, params);
    this._testRunner.on(TestRunnerEvent.TestFilesChanged, (testFiles) => this._dispatchEvent("testFilesChanged", { testFiles }));
    this._testRunner.on(TestRunnerEvent.TestPaused, (params) => this._dispatchEvent("testPaused", { errors: params.errors }));
  }
  async _wireReporter(messageSink) {
    return await createReporterForTestServer(this._serializer, messageSink);
  }
  async _collectingReporter() {
    const report = [];
    return {
      reporter: await createReporterForTestServer(this._serializer, (e) => report.push(e)),
      report
    };
  }
  async initialize(params) {
    this._serializer = params.serializer;
    this._closeOnDisconnect = !!params.closeOnDisconnect;
    await this._testRunner.initialize({
      ...params
    });
    this._setInterceptStdio(!!params.interceptStdio);
  }
  async ping() {
  }
  async open(params) {
    if (isUnderTest())
      return;
    open2("vscode://file/" + params.location.file + ":" + params.location.line).catch((e) => console.error(e));
  }
  async resizeTerminal(params) {
    this._testRunner.resizeTerminal(params);
  }
  async checkBrowsers() {
    return { hasBrowsers: this._testRunner.hasSomeBrowsers() };
  }
  async installBrowsers() {
    await this._testRunner.installBrowsers();
  }
  async runGlobalSetup(params) {
    const { reporter, report } = await this._collectingReporter();
    this._globalSetupReport = report;
    const { status, env } = await this._testRunner.runGlobalSetup([reporter, new list_default()]);
    return { report, status, env };
  }
  async runGlobalTeardown() {
    const { status } = await this._testRunner.runGlobalTeardown();
    const report = this._globalSetupReport || [];
    this._globalSetupReport = void 0;
    return { status, report };
  }
  async clearCache(params) {
    await this._testRunner.clearCache();
  }
  async listFiles(params) {
    const { reporter, report } = await this._collectingReporter();
    const { status } = await this._testRunner.listFiles(reporter, params.projects);
    return { report, status };
  }
  async listTests(params) {
    const { reporter, report } = await this._collectingReporter();
    const { status } = await this._testRunner.listTests(reporter, params);
    return { report, status };
  }
  async runTests(params) {
    const wireReporter = await this._wireReporter((e) => this._dispatchEvent("report", e));
    const { status } = await this._testRunner.runTests(wireReporter, {
      ...params,
      doNotRunDepsOutsideProjectFilter: true,
      pauseAtEnd: params.pauseAtEnd,
      pauseOnError: params.pauseOnError
    });
    return { status };
  }
  async watch(params) {
    await this._testRunner.watch(params.fileNames);
  }
  async findRelatedTestFiles(params) {
    return this._testRunner.findRelatedTestFiles(params.files);
  }
  async stopTests() {
    await this._testRunner.stopTests();
  }
  async stop() {
    this._setInterceptStdio(false);
    await this._testRunner.stop();
  }
  async closeGracefully() {
    await this._testRunner.closeGracefully();
  }
  _setInterceptStdio(interceptStdio) {
    if (process.env.PWTEST_DEBUG)
      return;
    if (interceptStdio) {
      if (debug6.log === originalDebugLog) {
        debug6.log = (...args) => {
          const string = import_util15.default.format(...args) + "\n";
          return originalStderrWrite.apply(process.stderr, [string]);
        };
      }
      const stdoutWrite = (chunk) => {
        this._dispatchEvent("stdio", chunkToPayload("stdout", chunk));
        return true;
      };
      const stderrWrite = (chunk) => {
        this._dispatchEvent("stdio", chunkToPayload("stderr", chunk));
        return true;
      };
      process.stdout.write = stdoutWrite;
      process.stderr.write = stderrWrite;
      process.stdin.isTTY = void 0;
    } else {
      debug6.log = originalDebugLog;
      process.stdout.write = originalStdoutWrite;
      process.stderr.write = originalStderrWrite;
      process.stdin.isTTY = originalStdinIsTTY;
    }
  }
};
async function runUIMode(configFile, configCLIOverrides, options) {
  const configLocation = import_common10.configLoader.resolveConfigLocation(configFile);
  return await innerRunTestServer(configLocation, configCLIOverrides, options, async (server, cancelPromise) => {
    await import_coreBundle3.server.installRootRedirect(server, void 0, { ...options, webApp: "uiMode.html" });
    if (options.host !== void 0 || options.port !== void 0) {
      await import_coreBundle3.server.openTraceInBrowser(server.urlPrefix("human-readable"));
    } else {
      const channel = await installedChromiumChannelForUI(configLocation, configCLIOverrides);
      const page = await import_coreBundle3.server.openTraceViewerApp(server.urlPrefix("precise"), "chromium", {
        headless: isUnderTest() && process.env.PWTEST_HEADED_FOR_TEST !== "1",
        persistentContextOptions: {
          handleSIGINT: false,
          channel
        }
      });
      page.on("close", () => cancelPromise.resolve());
    }
  });
}
async function installedChromiumChannelForUI(configLocation, configCLIOverrides) {
  const config2 = await import_common10.configLoader.loadConfig(configLocation, configCLIOverrides).catch((e) => null);
  if (!config2)
    return void 0;
  if (config2.projects.some((p) => (!p.project.use.browserName || p.project.use.browserName === "chromium") && !p.project.use.channel))
    return void 0;
  for (const channel of ["chromium", "chrome", "msedge"]) {
    if (config2.projects.some((p) => p.project.use.channel === channel))
      return channel;
  }
  return void 0;
}
async function runTestServer(configFile, configCLIOverrides, options) {
  const configLocation = import_common10.configLoader.resolveConfigLocation(configFile);
  return await innerRunTestServer(configLocation, configCLIOverrides, options, async (server) => {
    console.log("Listening on " + server.urlPrefix("precise").replace("http:", "ws:") + "/" + server.wsGuid());
  });
}
async function innerRunTestServer(configLocation, configCLIOverrides, options, openUI) {
  const testServer = new TestServer(configLocation, configCLIOverrides);
  const cancelPromise = new ManualPromise7();
  const sigintWatcher = new SigIntWatcher();
  process.stdin.on("close", () => gracefullyProcessExitDoNotHang3(0));
  void sigintWatcher.promise().then(() => cancelPromise.resolve());
  try {
    const server = await testServer.start(options);
    await openUI(server, cancelPromise);
    await cancelPromise;
  } finally {
    await testServer.stop();
    sigintWatcher.disarm();
  }
  return sigintWatcher.hadSignal() ? "interrupted" : "passed";
}
function chunkToPayload(type, chunk) {
  if (chunk instanceof Uint8Array)
    return { type, buffer: chunk.toString("base64") };
  return { type, text: chunk };
}
async function createReporterForTestServer(file, messageSink) {
  const reporterConstructor = file ? await loadReporter(null, file) : uiModeReporter_default;
  return wrapReporterAsV2(new reporterConstructor({
    _send: messageSink
  }));
}

// packages/playwright/src/runner/watchMode.ts
var watchMode_exports = {};
__export(watchMode_exports, {
  runWatchModeLoop: () => runWatchModeLoop
});
var import_path18 = __toESM(require("path"));
var import_readline = __toESM(require("readline"));
var import_events3 = require("events");
var import_coreBundle4 = require("playwright-core/lib/coreBundle");

// packages/playwright/src/isomorphic/testTree.ts
var statusEx = Symbol("statusEx");

// packages/playwright/src/isomorphic/teleSuiteUpdater.ts
var TeleSuiteUpdater = class {
  constructor(options) {
    this.loadErrors = [];
    this.progress = {
      total: 0,
      passed: 0,
      failed: 0,
      skipped: 0
    };
    this._lastRunTestCount = 0;
    this._receiver = new TeleReporterReceiver(this._createReporter(), {
      mergeProjects: true,
      mergeTestCases: true,
      resolvePath: createPathResolve(options.pathSeparator),
      clearPreviousResultsWhenTestBegins: true
    });
    this._options = options;
  }
  _createReporter() {
    return {
      version: () => "v2",
      onConfigure: (config2) => {
        this.config = config2;
        this._lastRunReceiver = new TeleReporterReceiver({
          version: () => "v2",
          onBegin: (suite) => {
            this._lastRunTestCount = suite.allTests().length;
            this._lastRunReceiver = void 0;
          }
        }, {
          mergeProjects: true,
          mergeTestCases: false,
          resolvePath: createPathResolve(this._options.pathSeparator)
        });
        void this._lastRunReceiver.dispatch({ method: "onConfigure", params: { config: config2 } });
      },
      onBegin: (suite) => {
        if (!this.rootSuite)
          this.rootSuite = suite;
        if (this._testResultsSnapshot) {
          for (const test of this.rootSuite.allTests())
            test.results = this._testResultsSnapshot?.get(test.id) || test.results;
          this._testResultsSnapshot = void 0;
        }
        this.progress.total = this._lastRunTestCount;
        this.progress.passed = 0;
        this.progress.failed = 0;
        this.progress.skipped = 0;
        this._options.onUpdate(true);
      },
      onEnd: () => {
        this._options.onUpdate(true);
      },
      onTestBegin: (test, testResult) => {
        testResult[statusEx] = "running";
        this._options.onUpdate();
      },
      onTestEnd: (test, testResult) => {
        if (test.outcome() === "skipped")
          ++this.progress.skipped;
        else if (test.outcome() === "unexpected")
          ++this.progress.failed;
        else
          ++this.progress.passed;
        testResult[statusEx] = testResult.status;
        this._options.onUpdate();
      },
      onError: (error) => this._handleOnError(error),
      printsToStdio: () => false
    };
  }
  processGlobalReport(report) {
    const receiver = new TeleReporterReceiver({
      version: () => "v2",
      onConfigure: (c) => {
        this.config = c;
      },
      onError: (error) => this._handleOnError(error)
    });
    for (const message of report)
      void receiver.dispatch(message);
  }
  processListReport(report) {
    const tests = this.rootSuite?.allTests() || [];
    this._testResultsSnapshot = new Map(tests.map((test) => [test.id, test.results]));
    this._receiver.reset();
    for (const message of report)
      void this._receiver.dispatch(message);
  }
  processTestReportEvent(message) {
    this._lastRunReceiver?.dispatch(message)?.catch(() => {
    });
    this._receiver.dispatch(message)?.catch(() => {
    });
  }
  _handleOnError(error) {
    this.loadErrors.push(error);
    this._options.onError?.(error);
    this._options.onUpdate();
  }
  asModel() {
    return {
      rootSuite: this.rootSuite || new TeleSuite("", "root"),
      config: this.config,
      loadErrors: this.loadErrors,
      progress: this.progress
    };
  }
};
function createPathResolve(pathSeparator) {
  return (rootDir, relativePath) => {
    const segments = [];
    for (const segment of [...rootDir.split(pathSeparator), ...relativePath.split(pathSeparator)]) {
      const isAfterDrive = pathSeparator === "\\" && segments.length === 1 && segments[0].endsWith(":");
      const isFirst = !segments.length;
      if (!segment && !isFirst && !isAfterDrive)
        continue;
      if (segment === ".")
        continue;
      if (segment === "..") {
        segments.pop();
        continue;
      }
      segments.push(segment);
    }
    return segments.join(pathSeparator);
  };
}

// packages/playwright/src/isomorphic/events.ts
var Disposable;
((Disposable2) => {
  function disposeAll(disposables) {
    for (const disposable of disposables.splice(0))
      disposable.dispose();
  }
  Disposable2.disposeAll = disposeAll;
})(Disposable || (Disposable = {}));
var EventEmitter3 = class {
  constructor() {
    this._listeners = /* @__PURE__ */ new Set();
    this.event = (listener, disposables) => {
      this._listeners.add(listener);
      let disposed = false;
      const self = this;
      const result = {
        dispose() {
          if (!disposed) {
            disposed = true;
            self._listeners.delete(listener);
          }
        }
      };
      if (disposables)
        disposables.push(result);
      return result;
    };
  }
  fire(event) {
    const dispatch = !this._deliveryQueue;
    if (!this._deliveryQueue)
      this._deliveryQueue = [];
    for (const listener of this._listeners)
      this._deliveryQueue.push({ listener, event });
    if (!dispatch)
      return;
    for (let index = 0; index < this._deliveryQueue.length; index++) {
      const { listener, event: event2 } = this._deliveryQueue[index];
      listener.call(null, event2);
    }
    this._deliveryQueue = void 0;
  }
  dispose() {
    this._listeners.clear();
    if (this._deliveryQueue)
      this._deliveryQueue = [];
  }
};

// packages/playwright/src/isomorphic/testServerConnection.ts
var TestServerConnectionClosedError = class extends Error {
};
var TestServerConnection = class {
  constructor(transport) {
    this._onCloseEmitter = new EventEmitter3();
    this._onReportEmitter = new EventEmitter3();
    this._onStdioEmitter = new EventEmitter3();
    this._onTestFilesChangedEmitter = new EventEmitter3();
    this._onLoadTraceRequestedEmitter = new EventEmitter3();
    this._onTestPausedEmitter = new EventEmitter3();
    this._lastId = 0;
    this._callbacks = /* @__PURE__ */ new Map();
    this._isClosed = false;
    this.onClose = this._onCloseEmitter.event;
    this.onReport = this._onReportEmitter.event;
    this.onStdio = this._onStdioEmitter.event;
    this.onTestFilesChanged = this._onTestFilesChangedEmitter.event;
    this.onLoadTraceRequested = this._onLoadTraceRequestedEmitter.event;
    this.onTestPaused = this._onTestPausedEmitter.event;
    this._transport = transport;
    this._transport.onmessage((data) => {
      const message = JSON.parse(data);
      const { id, result, error, method, params } = message;
      if (id) {
        const callback = this._callbacks.get(id);
        if (!callback)
          return;
        this._callbacks.delete(id);
        if (error)
          callback.reject(new Error(error));
        else
          callback.resolve(result);
      } else {
        this._dispatchEvent(method, params);
      }
    });
    const pingInterval = setInterval(() => this._sendMessage("ping").catch(() => {
    }), 3e4);
    this._connectedPromise = new Promise((f, r) => {
      this._transport.onopen(f);
      this._transport.onerror(r);
    });
    this._transport.onclose(() => {
      this._isClosed = true;
      this._onCloseEmitter.fire();
      clearInterval(pingInterval);
      for (const callback of this._callbacks.values())
        callback.reject(callback.error);
      this._callbacks.clear();
    });
  }
  isClosed() {
    return this._isClosed;
  }
  async _sendMessage(method, params) {
    const logForTest = globalThis.__logForTest;
    logForTest?.({ method, params });
    await this._connectedPromise;
    const id = ++this._lastId;
    const message = { id, method, params };
    const error = new TestServerConnectionClosedError(`${method}: test server connection closed`);
    this._transport.send(JSON.stringify(message));
    return new Promise((resolve, reject) => {
      this._callbacks.set(id, { resolve, reject, error });
    });
  }
  _sendMessageNoReply(method, params) {
    this._sendMessage(method, params).catch(() => {
    });
  }
  _dispatchEvent(method, params) {
    if (method === "report")
      this._onReportEmitter.fire(params);
    else if (method === "stdio")
      this._onStdioEmitter.fire(params);
    else if (method === "testFilesChanged")
      this._onTestFilesChangedEmitter.fire(params);
    else if (method === "loadTraceRequested")
      this._onLoadTraceRequestedEmitter.fire(params);
    else if (method === "testPaused")
      this._onTestPausedEmitter.fire(params);
  }
  async initialize(params) {
    await this._sendMessage("initialize", params);
  }
  async ping(params) {
    await this._sendMessage("ping", params);
  }
  async pingNoReply(params) {
    this._sendMessageNoReply("ping", params);
  }
  async watch(params) {
    await this._sendMessage("watch", params);
  }
  watchNoReply(params) {
    this._sendMessageNoReply("watch", params);
  }
  async open(params) {
    await this._sendMessage("open", params);
  }
  openNoReply(params) {
    this._sendMessageNoReply("open", params);
  }
  async resizeTerminal(params) {
    await this._sendMessage("resizeTerminal", params);
  }
  resizeTerminalNoReply(params) {
    this._sendMessageNoReply("resizeTerminal", params);
  }
  async checkBrowsers(params) {
    return await this._sendMessage("checkBrowsers", params);
  }
  async installBrowsers(params) {
    await this._sendMessage("installBrowsers", params);
  }
  async runGlobalSetup(params) {
    return await this._sendMessage("runGlobalSetup", params);
  }
  async runGlobalTeardown(params) {
    return await this._sendMessage("runGlobalTeardown", params);
  }
  async clearCache(params) {
    return await this._sendMessage("clearCache", params);
  }
  async listFiles(params) {
    return await this._sendMessage("listFiles", params);
  }
  async listTests(params) {
    return await this._sendMessage("listTests", params);
  }
  async runTests(params) {
    return await this._sendMessage("runTests", params);
  }
  async findRelatedTestFiles(params) {
    return await this._sendMessage("findRelatedTestFiles", params);
  }
  async stopTests(params) {
    await this._sendMessage("stopTests", params);
  }
  stopTestsNoReply(params) {
    this._sendMessageNoReply("stopTests", params);
  }
  async closeGracefully(params) {
    await this._sendMessage("closeGracefully", params);
  }
  close() {
    try {
      this._transport.close();
    } catch {
    }
  }
};

// packages/playwright/src/runner/watchMode.ts
var colors6 = require("playwright-core/lib/utilsBundle").colors;
var enquirer = require("playwright-core/lib/utilsBundle").enquirer;
var { ManualPromise: ManualPromise8 } = require("playwright-core/lib/coreBundle").iso;
var { createGuid: createGuid3 } = require("playwright-core/lib/coreBundle").utils;
var { getPackageManagerExecCommand: getPackageManagerExecCommand3 } = require("playwright-core/lib/coreBundle").utils;
var { eventsHelper: eventsHelper2 } = require("playwright-core/lib/coreBundle").utils;
var InMemoryTransport = class extends import_events3.EventEmitter {
  constructor(send) {
    super();
    this._send = send;
  }
  close() {
    this.emit("close");
  }
  onclose(listener) {
    this.on("close", listener);
  }
  onerror(listener) {
  }
  onmessage(listener) {
    this.on("message", listener);
  }
  onopen(listener) {
    this.on("open", listener);
  }
  send(data) {
    this._send(data);
  }
};
async function runWatchModeLoop(configLocation, initialOptions) {
  const options = { ...initialOptions };
  let bufferMode = false;
  const testServerDispatcher = new TestServerDispatcher(configLocation, {});
  const transport = new InMemoryTransport(
    async (data) => {
      const { id, method, params } = JSON.parse(data);
      try {
        const result2 = await testServerDispatcher.transport.dispatch(method, params);
        transport.emit("message", JSON.stringify({ id, result: result2 }));
      } catch (e) {
        transport.emit("message", JSON.stringify({ id, error: String(e) }));
      }
    }
  );
  testServerDispatcher.transport.sendEvent = (method, params) => {
    transport.emit("message", JSON.stringify({ method, params }));
  };
  const testServerConnection = new TestServerConnection(transport);
  transport.emit("open");
  const teleSuiteUpdater = new TeleSuiteUpdater({ pathSeparator: import_path18.default.sep, onUpdate() {
  } });
  const dirtyTestFiles = /* @__PURE__ */ new Set();
  const dirtyTestIds = /* @__PURE__ */ new Set();
  let onDirtyTests = new ManualPromise8();
  let queue = Promise.resolve();
  const changedFiles = /* @__PURE__ */ new Set();
  testServerConnection.onTestFilesChanged(({ testFiles }) => {
    testFiles.forEach((file) => changedFiles.add(file));
    queue = queue.then(async () => {
      if (changedFiles.size === 0)
        return;
      const { report: report2 } = await testServerConnection.listTests({ locations: options.files, projects: options.projects, grep: options.grep });
      teleSuiteUpdater.processListReport(report2);
      for (const test of teleSuiteUpdater.rootSuite.allTests()) {
        if (changedFiles.has(test.location.file)) {
          dirtyTestFiles.add(test.location.file);
          dirtyTestIds.add(test.id);
        }
      }
      changedFiles.clear();
      if (dirtyTestIds.size > 0) {
        onDirtyTests.resolve("changed");
        onDirtyTests = new ManualPromise8();
      }
    });
  });
  testServerConnection.onReport((report2) => teleSuiteUpdater.processTestReportEvent(report2));
  await testServerConnection.initialize({
    interceptStdio: false,
    watchTestDirs: true,
    populateDependenciesOnList: true
  });
  await testServerConnection.runGlobalSetup({});
  const { report } = await testServerConnection.listTests({});
  teleSuiteUpdater.processListReport(report);
  const projectNames = teleSuiteUpdater.rootSuite.suites.map((s) => s.title);
  let lastRun = { type: "regular" };
  let result = "passed";
  while (true) {
    if (bufferMode)
      printBufferPrompt(dirtyTestFiles, teleSuiteUpdater.config.rootDir);
    else
      printPrompt();
    const waitForCommand = readCommand();
    const command = await Promise.race([
      onDirtyTests,
      waitForCommand.result
    ]);
    if (command === "changed")
      waitForCommand.dispose();
    if (bufferMode && command === "changed")
      continue;
    const shouldRunChangedFiles = bufferMode ? command === "run" : command === "changed";
    if (shouldRunChangedFiles) {
      if (dirtyTestIds.size === 0)
        continue;
      const testIds = [...dirtyTestIds];
      dirtyTestIds.clear();
      dirtyTestFiles.clear();
      await runTests(options, testServerConnection, { testIds, title: "files changed" });
      lastRun = { type: "changed", dirtyTestIds: testIds };
      continue;
    }
    if (command === "run") {
      await runTests(options, testServerConnection);
      lastRun = { type: "regular" };
      continue;
    }
    if (command === "project") {
      const { selectedProjects } = await enquirer.prompt({
        type: "multiselect",
        name: "selectedProjects",
        message: "Select projects",
        choices: projectNames
      }).catch(() => ({ selectedProjects: null }));
      if (!selectedProjects)
        continue;
      options.projects = selectedProjects.length ? selectedProjects : void 0;
      await runTests(options, testServerConnection);
      lastRun = { type: "regular" };
      continue;
    }
    if (command === "file") {
      const { filePattern } = await enquirer.prompt({
        type: "text",
        name: "filePattern",
        message: "Input filename pattern (regex)"
      }).catch(() => ({ filePattern: null }));
      if (filePattern === null)
        continue;
      if (filePattern.trim())
        options.files = filePattern.split(" ");
      else
        options.files = void 0;
      await runTests(options, testServerConnection);
      lastRun = { type: "regular" };
      continue;
    }
    if (command === "grep") {
      const { testPattern } = await enquirer.prompt({
        type: "text",
        name: "testPattern",
        message: "Input test name pattern (regex)"
      }).catch(() => ({ testPattern: null }));
      if (testPattern === null)
        continue;
      if (testPattern.trim())
        options.grep = testPattern;
      else
        options.grep = void 0;
      await runTests(options, testServerConnection);
      lastRun = { type: "regular" };
      continue;
    }
    if (command === "failed") {
      const failedTestIds = teleSuiteUpdater.rootSuite.allTests().filter((t2) => !t2.ok()).map((t2) => t2.id);
      await runTests({}, testServerConnection, { title: "running failed tests", testIds: failedTestIds });
      lastRun = { type: "failed", failedTestIds };
      continue;
    }
    if (command === "repeat") {
      if (lastRun.type === "regular") {
        await runTests(options, testServerConnection, { title: "re-running tests" });
        continue;
      } else if (lastRun.type === "changed") {
        await runTests(options, testServerConnection, { title: "re-running tests", testIds: lastRun.dirtyTestIds });
      } else if (lastRun.type === "failed") {
        await runTests({}, testServerConnection, { title: "re-running tests", testIds: lastRun.failedTestIds });
      }
      continue;
    }
    if (command === "toggle-show-browser") {
      await toggleShowBrowser();
      continue;
    }
    if (command === "toggle-buffer-mode") {
      bufferMode = !bufferMode;
      continue;
    }
    if (command === "exit")
      break;
    if (command === "interrupted") {
      result = "interrupted";
      break;
    }
  }
  const teardown = await testServerConnection.runGlobalTeardown({});
  return result === "passed" ? teardown.status : result;
}
function readKeyPress(handler) {
  const promise = new ManualPromise8();
  const rl = import_readline.default.createInterface({ input: process.stdin, escapeCodeTimeout: 50 });
  import_readline.default.emitKeypressEvents(process.stdin, rl);
  if (process.stdin.isTTY)
    process.stdin.setRawMode(true);
  const listener = eventsHelper2.addEventListener(process.stdin, "keypress", (text, key) => {
    const result = handler(text, key);
    if (result)
      promise.resolve(result);
  });
  const dispose = () => {
    eventsHelper2.removeEventListeners([listener]);
    rl.close();
    if (process.stdin.isTTY)
      process.stdin.setRawMode(false);
  };
  void promise.finally(dispose);
  return { result: promise, dispose };
}
var isInterrupt = (text, key) => text === "" || text === "\x1B" || key && key.name === "escape" || key && key.ctrl && key.name === "c";
async function runTests(watchOptions, testServerConnection, options) {
  printConfiguration(watchOptions, options?.title);
  const waitForDone = readKeyPress((text, key) => {
    if (isInterrupt(text, key)) {
      testServerConnection.stopTestsNoReply({});
      return "done";
    }
  });
  await testServerConnection.runTests({
    grep: watchOptions.grep,
    testIds: options?.testIds,
    locations: watchOptions?.files ?? [],
    // TODO: always collect locations based on knowledge about tree, so that we don't have to load all tests
    projects: watchOptions.projects,
    connectWsEndpoint,
    reuseContext: connectWsEndpoint ? true : void 0,
    workers: connectWsEndpoint ? 1 : void 0,
    headed: connectWsEndpoint ? true : void 0
  }).finally(() => waitForDone.dispose());
}
function readCommand() {
  return readKeyPress((text, key) => {
    if (isInterrupt(text, key))
      return "interrupted";
    if (process.platform !== "win32" && key && key.ctrl && key.name === "z") {
      process.kill(process.ppid, "SIGTSTP");
      process.kill(process.pid, "SIGTSTP");
    }
    const name = key?.name;
    if (name === "q")
      return "exit";
    if (name === "h") {
      process.stdout.write(`${separator(terminalScreen)}
Run tests
  ${colors6.bold("enter")}    ${colors6.dim("run tests")}
  ${colors6.bold("f")}        ${colors6.dim("run failed tests")}
  ${colors6.bold("r")}        ${colors6.dim("repeat last run")}
  ${colors6.bold("q")}        ${colors6.dim("quit")}

Change settings
  ${colors6.bold("c")}        ${colors6.dim("set project")}
  ${colors6.bold("p")}        ${colors6.dim("set file filter")}
  ${colors6.bold("t")}        ${colors6.dim("set title filter")}
  ${colors6.bold("s")}        ${colors6.dim("toggle show & reuse the browser")}
  ${colors6.bold("b")}        ${colors6.dim("toggle buffer mode")}
`);
      return;
    }
    switch (name) {
      case "return":
        return "run";
      case "r":
        return "repeat";
      case "c":
        return "project";
      case "p":
        return "file";
      case "t":
        return "grep";
      case "f":
        return "failed";
      case "s":
        return "toggle-show-browser";
      case "b":
        return "toggle-buffer-mode";
    }
  });
}
var showBrowserServer;
var connectWsEndpoint = void 0;
var seq = 1;
function printConfiguration(options, title) {
  const packageManagerCommand = getPackageManagerExecCommand3();
  const tokens = [];
  tokens.push(`${packageManagerCommand} playwright test`);
  if (options.projects)
    tokens.push(...options.projects.map((p) => colors6.blue(`--project ${p}`)));
  if (options.grep)
    tokens.push(colors6.red(`--grep ${options.grep}`));
  if (options.files)
    tokens.push(...options.files.map((a) => colors6.bold(a)));
  if (title)
    tokens.push(colors6.dim(`(${title})`));
  tokens.push(colors6.dim(`#${seq++}`));
  const lines = [];
  const sep = separator(terminalScreen);
  lines.push("\x1Bc" + sep);
  lines.push(`${tokens.join(" ")}`);
  lines.push(`${colors6.dim("Show & reuse browser:")} ${colors6.bold(showBrowserServer ? "on" : "off")}`);
  process.stdout.write(lines.join("\n"));
}
function printBufferPrompt(dirtyTestFiles, rootDir) {
  const sep = separator(terminalScreen);
  process.stdout.write("\x1Bc");
  process.stdout.write(`${sep}
`);
  if (dirtyTestFiles.size === 0) {
    process.stdout.write(`${colors6.dim("Waiting for file changes. Press")} ${colors6.bold("q")} ${colors6.dim("to quit or")} ${colors6.bold("h")} ${colors6.dim("for more options.")}

`);
    return;
  }
  process.stdout.write(`${colors6.dim(`${dirtyTestFiles.size} test ${dirtyTestFiles.size === 1 ? "file" : "files"} changed:`)}

`);
  for (const file of dirtyTestFiles)
    process.stdout.write(` \xB7 ${import_path18.default.relative(rootDir, file)}
`);
  process.stdout.write(`
${colors6.dim(`Press`)} ${colors6.bold("enter")} ${colors6.dim("to run")}, ${colors6.bold("q")} ${colors6.dim("to quit or")} ${colors6.bold("h")} ${colors6.dim("for more options.")}

`);
}
function printPrompt() {
  const sep = separator(terminalScreen);
  process.stdout.write(`
${sep}
${colors6.dim("Waiting for file changes. Press")} ${colors6.bold("enter")} ${colors6.dim("to run tests")}, ${colors6.bold("q")} ${colors6.dim("to quit or")} ${colors6.bold("h")} ${colors6.dim("for more options.")}
`);
}
async function toggleShowBrowser() {
  if (!showBrowserServer) {
    showBrowserServer = new import_coreBundle4.remote.PlaywrightServer({ mode: "extension", path: "/" + createGuid3(), maxConnections: 1 });
    connectWsEndpoint = await showBrowserServer.listen();
    process.stdout.write(`${colors6.dim("Show & reuse browser:")} ${colors6.bold("on")}
`);
  } else {
    await showBrowserServer?.close();
    showBrowserServer = void 0;
    connectWsEndpoint = void 0;
    process.stdout.write(`${colors6.dim("Show & reuse browser:")} ${colors6.bold("off")}
`);
  }
}

// packages/playwright/src/reporters/merge.ts
var merge_exports = {};
__export(merge_exports, {
  createMergedReport: () => createMergedReport
});
var import_fs14 = __toESM(require("fs"));
var import_path19 = __toESM(require("path"));

// packages/playwright/src/isomorphic/stringInternPool.ts
var StringInternPool = class {
  constructor() {
    this._stringCache = /* @__PURE__ */ new Map();
  }
  internString(s) {
    let result = this._stringCache.get(s);
    if (!result) {
      this._stringCache.set(s, s);
      result = s;
    }
    return result;
  }
};
var JsonStringInternalizer = class {
  constructor(pool) {
    this._pool = pool;
  }
  traverse(value) {
    if (typeof value !== "object")
      return;
    if (Array.isArray(value)) {
      for (let i = 0; i < value.length; i++) {
        if (typeof value[i] === "string")
          value[i] = this.intern(value[i]);
        else
          this.traverse(value[i]);
      }
    } else {
      for (const name in value) {
        if (typeof value[name] === "string")
          value[name] = this.intern(value[name]);
        else
          this.traverse(value[name]);
      }
    }
  }
  intern(value) {
    return this._pool.internString(value);
  }
};

// packages/playwright/src/reporters/merge.ts
var import_util16 = require("../util");
var { isPathInside } = require("playwright-core/lib/coreBundle").utils;
var { ZipFile } = require("playwright-core/lib/coreBundle").utils;
async function createMergedReport(config2, dir, reporterDescriptions, rootDirOverride) {
  const reporters = await createReporters(config2, "merge", reporterDescriptions);
  const multiplexer = new Multiplexer(reporters);
  const stringPool = new StringInternPool();
  let printStatus = () => {
  };
  if (!multiplexer.printsToStdio()) {
    printStatus = printStatusToStdout;
    printStatus(`merging reports from ${dir}`);
  }
  const shardFiles = await sortedShardFiles(dir);
  if (shardFiles.length === 0)
    throw new Error(`No report files found in ${dir}`);
  const eventData = await mergeEvents(dir, shardFiles, stringPool, printStatus, rootDirOverride);
  const pathSeparator = rootDirOverride ? import_path19.default.sep : eventData.pathSeparatorFromMetadata ?? import_path19.default.sep;
  const pathPackage = pathSeparator === "/" ? import_path19.default.posix : import_path19.default.win32;
  const receiver = new TeleReporterReceiver(multiplexer, {
    mergeProjects: false,
    mergeTestCases: false,
    // When merging on a different OS, an absolute path like `C:\foo\bar` from win may look like
    // a relative path on posix, and vice versa.
    // Therefore, we cannot use `path.resolve()` here - it will resolve relative-looking paths
    // against `process.cwd()`, while we just want to normalize ".." and "." segments.
    resolvePath: (rootDir, relativePath) => stringPool.internString(pathPackage.normalize(pathPackage.join(rootDir, relativePath))),
    configOverrides: config2.config
  });
  printStatus(`processing test events`);
  const dispatchEvents = async (events) => {
    for (const event of events) {
      if (event.method === "onEnd")
        printStatus(`building final report`);
      await receiver.dispatch(event);
      if (event.method === "onEnd")
        printStatus(`finished building report`);
    }
  };
  await dispatchEvents(eventData.prologue);
  let usedWorkers = 0;
  for (const { reportFile, zipFile, eventPatchers, metadata, config: config3, fullResult } of eventData.reports) {
    multiplexer.onReportConfigure({
      reportPath: zipFile,
      config: asFullConfig(config3)
    });
    const reportJsonl = await import_fs14.default.promises.readFile(reportFile);
    const events = parseTestEvents(reportJsonl);
    new JsonStringInternalizer(stringPool).traverse(events);
    eventPatchers.patchers.push(new AttachmentPathPatcher(dir));
    if (metadata.name)
      eventPatchers.patchers.push(new GlobalErrorPatcher(metadata.name));
    if (config3?.tags?.length)
      eventPatchers.patchers.push(new GlobalErrorPatcher(config3.tags.join(" ")));
    const workerIndexPatcher = new WorkerIndexPatcher(usedWorkers);
    eventPatchers.patchers.push(workerIndexPatcher);
    eventPatchers.patchEvents(events);
    usedWorkers += workerIndexPatcher.usedWorkers();
    await dispatchEvents(events);
    multiplexer.onReportEnd({
      reportPath: zipFile,
      result: asFullResult(fullResult)
    });
  }
  await dispatchEvents(eventData.epilogue);
}
var commonEventNames = ["onBlobReportMetadata", "onConfigure", "onProject", "onBegin", "onEnd"];
var commonEvents = new Set(commonEventNames);
var commonEventRegex = new RegExp(`${commonEventNames.join("|")}`);
function parseCommonEvents(reportJsonl) {
  return splitBufferLines(reportJsonl).map((line) => line.toString("utf8")).filter((line) => commonEventRegex.test(line)).map((line) => JSON.parse(line)).filter((event) => commonEvents.has(event.method));
}
function parseTestEvents(reportJsonl) {
  return splitBufferLines(reportJsonl).map((line) => line.toString("utf8")).filter((line) => line.length).map((line) => JSON.parse(line)).filter((event) => !commonEvents.has(event.method));
}
function splitBufferLines(buffer) {
  const lines = [];
  let start = 0;
  while (start < buffer.length) {
    const end = buffer.indexOf(10, start);
    if (end === -1) {
      lines.push(buffer.slice(start));
      break;
    }
    lines.push(buffer.slice(start, end));
    start = end + 1;
  }
  return lines;
}
async function extractAndParseReports(dir, shardFiles, internalizer, printStatus) {
  const shardEvents = [];
  await import_fs14.default.promises.mkdir(import_path19.default.join(dir, "resources"), { recursive: true });
  const reportNames = new UniqueFileNameGenerator();
  for (const file of shardFiles) {
    const absolutePath = import_path19.default.join(dir, file);
    printStatus(`extracting: ${(0, import_util16.relativeFilePath)(absolutePath)}`);
    const zipFile = new ZipFile(absolutePath);
    const entryNames = await zipFile.entries();
    for (const entryName of entryNames.sort()) {
      let reportFile = import_path19.default.join(dir, entryName);
      const content = await zipFile.read(entryName);
      if (entryName.endsWith(".jsonl")) {
        reportFile = reportNames.makeUnique(reportFile);
        let parsedEvents = parseCommonEvents(content);
        internalizer.traverse(parsedEvents);
        const metadata = findMetadata(parsedEvents, file);
        parsedEvents = modernizer.modernize(metadata.version, parsedEvents);
        shardEvents.push({
          zipFile: absolutePath,
          reportFile,
          metadata,
          parsedEvents
        });
      }
      await import_fs14.default.promises.writeFile(reportFile, content);
    }
    zipFile.close();
  }
  return shardEvents;
}
function findMetadata(events, file) {
  if (events[0]?.method !== "onBlobReportMetadata")
    throw new Error(`No metadata event found in ${file}`);
  const metadata = events[0].params;
  if (metadata.version > currentBlobReportVersion)
    throw new Error(`Blob report ${file} was created with a newer version of Playwright.`);
  return metadata;
}
async function mergeEvents(dir, shardReportFiles, stringPool, printStatus, rootDirOverride) {
  const internalizer = new JsonStringInternalizer(stringPool);
  const configureEvents = [];
  const projectEvents = [];
  const endEvents = [];
  const blobs = await extractAndParseReports(dir, shardReportFiles, internalizer, printStatus);
  blobs.sort((a, b) => {
    const nameA = a.metadata.name ?? "";
    const nameB = b.metadata.name ?? "";
    if (nameA !== nameB)
      return nameA.localeCompare(nameB);
    const shardA = a.metadata.shard?.current ?? 0;
    const shardB = b.metadata.shard?.current ?? 0;
    if (shardA !== shardB)
      return shardA - shardB;
    return a.zipFile.localeCompare(b.zipFile);
  });
  printStatus(`merging events`);
  const reports = [];
  const globalTestIdSet = /* @__PURE__ */ new Set();
  for (let i = 0; i < blobs.length; ++i) {
    const { parsedEvents, metadata, reportFile, zipFile } = blobs[i];
    const eventPatchers = new JsonEventPatchers();
    eventPatchers.patchers.push(new IdsPatcher(
      stringPool,
      metadata.name,
      String(i),
      globalTestIdSet
    ));
    if (rootDirOverride)
      eventPatchers.patchers.push(new PathSeparatorPatcher(metadata.pathSeparator));
    eventPatchers.patchEvents(parsedEvents);
    let config2;
    let fullResult;
    for (const event of parsedEvents) {
      if (event.method === "onConfigure") {
        configureEvents.push(event);
        config2 = event.params.config;
      } else if (event.method === "onProject") {
        projectEvents.push(event);
      } else if (event.method === "onEnd") {
        fullResult = event.params.result;
        endEvents.push({ event, metadata });
      }
    }
    reports.push({
      eventPatchers,
      reportFile,
      zipFile,
      metadata,
      config: config2,
      fullResult
    });
  }
  return {
    prologue: [
      mergeConfigureEvents(configureEvents, rootDirOverride),
      ...projectEvents,
      { method: "onBegin", params: void 0 }
    ],
    reports,
    epilogue: [
      mergeEndEvents(endEvents),
      { method: "onExit", params: void 0 }
    ],
    pathSeparatorFromMetadata: blobs[0]?.metadata.pathSeparator
  };
}
function mergeConfigureEvents(configureEvents, rootDirOverride) {
  if (!configureEvents.length)
    throw new Error("No configure events found");
  let config2 = {
    configFile: void 0,
    globalTimeout: 0,
    maxFailures: 0,
    metadata: {},
    shard: null,
    rootDir: "",
    version: "",
    workers: 0,
    globalSetup: null,
    globalTeardown: null
  };
  for (const event of configureEvents)
    config2 = mergeConfigs(config2, event.params.config);
  if (rootDirOverride) {
    config2.rootDir = rootDirOverride;
  } else {
    const rootDirs = new Set(configureEvents.map((e) => e.params.config.rootDir));
    if (rootDirs.size > 1) {
      throw new Error([
        `Blob reports being merged were recorded with different test directories, and`,
        `merging cannot proceed. This may happen if you are merging reports from`,
        `machines with different environments, like different operating systems or`,
        `if the tests ran with different playwright configs.`,
        ``,
        `You can force merge by specifying a merge config file with "-c" option. If`,
        `you'd like all test paths to be correct, make sure 'testDir' in the merge config`,
        `file points to the actual tests location.`,
        ``,
        `Found directories:`,
        ...rootDirs
      ].join("\n"));
    }
  }
  return {
    method: "onConfigure",
    params: {
      config: config2
    }
  };
}
function mergeConfigs(to, from) {
  return {
    ...to,
    ...from,
    metadata: {
      ...to.metadata,
      ...from.metadata,
      actualWorkers: (to.metadata.actualWorkers || 0) + (from.metadata.actualWorkers || 0)
    },
    shard: null,
    workers: to.workers + from.workers
  };
}
function mergeEndEvents(endEvents) {
  let startTime = endEvents.length ? 1e13 : Date.now();
  let status = "passed";
  let endTime = 0;
  for (const { event } of endEvents) {
    const shardResult = event.params.result;
    if (shardResult.status === "failed")
      status = "failed";
    else if (shardResult.status === "timedout" && status !== "failed")
      status = "timedout";
    else if (shardResult.status === "interrupted" && status !== "failed" && status !== "timedout")
      status = "interrupted";
    startTime = Math.min(startTime, shardResult.startTime);
    endTime = Math.max(endTime, shardResult.startTime + shardResult.duration);
  }
  const result = {
    status,
    startTime,
    duration: endTime - startTime
  };
  return {
    method: "onEnd",
    params: {
      result
    }
  };
}
async function sortedShardFiles(dir) {
  const files = await import_fs14.default.promises.readdir(dir);
  return files.filter((file) => file.endsWith(".zip")).sort();
}
function printStatusToStdout(message) {
  process.stdout.write(`${message}
`);
}
var UniqueFileNameGenerator = class {
  constructor() {
    this._usedNames = /* @__PURE__ */ new Set();
  }
  makeUnique(name) {
    if (!this._usedNames.has(name)) {
      this._usedNames.add(name);
      return name;
    }
    const extension = import_path19.default.extname(name);
    name = name.substring(0, name.length - extension.length);
    let index = 0;
    while (true) {
      const candidate = `${name}-${++index}${extension}`;
      if (!this._usedNames.has(candidate)) {
        this._usedNames.add(candidate);
        return candidate;
      }
    }
  }
};
var IdsPatcher = class {
  constructor(stringPool, botName, salt, globalTestIdSet) {
    this._stringPool = stringPool;
    this._botName = botName;
    this._salt = salt;
    this._testIdsMap = /* @__PURE__ */ new Map();
    this._globalTestIdSet = globalTestIdSet;
  }
  patchEvent(event) {
    const { method, params } = event;
    switch (method) {
      case "onProject":
        this._onProject(params.project);
        return;
      case "onAttach":
      case "onTestBegin":
      case "onStepBegin":
      case "onStepEnd":
      case "onStdIO":
        params.testId = params.testId ? this._mapTestId(params.testId) : void 0;
        return;
      case "onTestEnd":
        params.test.testId = this._mapTestId(params.test.testId);
        return;
    }
  }
  _onProject(project) {
    project.metadata ??= {};
    project.suites.forEach((suite) => this._updateTestIds(suite));
  }
  _updateTestIds(suite) {
    suite.entries.forEach((entry) => {
      if ("testId" in entry)
        this._updateTestId(entry);
      else
        this._updateTestIds(entry);
    });
  }
  _updateTestId(test) {
    test.testId = this._mapTestId(test.testId);
    if (this._botName) {
      test.tags = test.tags || [];
      test.tags.unshift("@" + this._botName);
    }
  }
  _mapTestId(testId) {
    const t1 = this._stringPool.internString(testId);
    if (this._testIdsMap.has(t1))
      return this._testIdsMap.get(t1);
    if (this._globalTestIdSet.has(t1)) {
      const t2 = this._stringPool.internString(testId + this._salt);
      this._globalTestIdSet.add(t2);
      this._testIdsMap.set(t1, t2);
      return t2;
    }
    this._globalTestIdSet.add(t1);
    this._testIdsMap.set(t1, t1);
    return t1;
  }
};
var AttachmentPathPatcher = class {
  constructor(_resourceDir) {
    this._resourceDir = _resourceDir;
  }
  patchEvent(event) {
    if (event.method === "onAttach")
      this._patchAttachments(event.params.attachments);
    else if (event.method === "onTestEnd")
      this._patchAttachments(event.params.result.attachments ?? []);
  }
  _patchAttachments(attachments) {
    const resourceRoot = import_path19.default.resolve(this._resourceDir);
    for (const attachment of attachments) {
      if (!attachment.path)
        continue;
      const joined = import_path19.default.resolve(resourceRoot, attachment.path);
      if (!isPathInside(resourceRoot, joined)) {
        attachment.path = void 0;
        continue;
      }
      attachment.path = joined;
    }
  }
};
var PathSeparatorPatcher = class {
  constructor(from) {
    this._from = from ?? (import_path19.default.sep === "/" ? "\\" : "/");
    this._to = import_path19.default.sep;
  }
  patchEvent(jsonEvent) {
    if (this._from === this._to)
      return;
    if (jsonEvent.method === "onProject") {
      this._updateProject(jsonEvent.params.project);
      return;
    }
    if (jsonEvent.method === "onTestEnd") {
      const test = jsonEvent.params.test;
      test.annotations?.forEach((annotation) => this._updateAnnotationLocation(annotation));
      const testResult = jsonEvent.params.result;
      testResult.annotations?.forEach((annotation) => this._updateAnnotationLocation(annotation));
      testResult.errors.forEach((error) => this._updateErrorLocations(error));
      (testResult.attachments ?? []).forEach((attachment) => {
        if (attachment.path)
          attachment.path = this._updatePath(attachment.path);
      });
      return;
    }
    if (jsonEvent.method === "onStepBegin") {
      const step = jsonEvent.params.step;
      this._updateLocation(step.location);
      return;
    }
    if (jsonEvent.method === "onStepEnd") {
      const step = jsonEvent.params.step;
      this._updateErrorLocations(step.error);
      step.annotations?.forEach((annotation) => this._updateAnnotationLocation(annotation));
      return;
    }
    if (jsonEvent.method === "onAttach") {
      const attach = jsonEvent.params;
      attach.attachments.forEach((attachment) => {
        if (attachment.path)
          attachment.path = this._updatePath(attachment.path);
      });
      return;
    }
  }
  _updateProject(project) {
    project.outputDir = this._updatePath(project.outputDir);
    project.testDir = this._updatePath(project.testDir);
    project.snapshotDir = this._updatePath(project.snapshotDir);
    project.suites.forEach((suite) => this._updateSuite(suite, true));
  }
  _updateSuite(suite, isFileSuite = false) {
    this._updateLocation(suite.location);
    if (isFileSuite)
      suite.title = this._updatePath(suite.title);
    for (const entry of suite.entries) {
      if ("testId" in entry) {
        this._updateLocation(entry.location);
        entry.annotations?.forEach((annotation) => this._updateAnnotationLocation(annotation));
      } else {
        this._updateSuite(entry);
      }
    }
  }
  _updateErrorLocations(error) {
    while (error) {
      this._updateLocation(error.location);
      error = error.cause;
    }
  }
  _updateAnnotationLocation(annotation) {
    this._updateLocation(annotation.location);
  }
  _updateLocation(location) {
    if (location)
      location.file = this._updatePath(location.file);
  }
  _updatePath(text) {
    return text.split(this._from).join(this._to);
  }
};
var GlobalErrorPatcher = class {
  constructor(botName) {
    this._prefix = `(${botName}) `;
  }
  patchEvent(event) {
    if (event.method !== "onError")
      return;
    const error = event.params.error;
    if (error.message !== void 0)
      error.message = this._prefix + error.message;
    if (error.stack !== void 0)
      error.stack = this._prefix + error.stack;
  }
};
var WorkerIndexPatcher = class {
  constructor(baseWorkerIndex) {
    this._maxWorkerIndex = 0;
    this._baseWorkerIndex = baseWorkerIndex;
  }
  patchEvent(event) {
    if (event.method === "onTestBegin") {
      this._maxWorkerIndex = Math.max(this._maxWorkerIndex, event.params.result.workerIndex);
      event.params.result.workerIndex += this._baseWorkerIndex;
    }
  }
  usedWorkers() {
    return this._maxWorkerIndex + 1;
  }
};
var JsonEventPatchers = class {
  constructor() {
    this.patchers = [];
  }
  patchEvents(events) {
    for (const event of events) {
      for (const patcher of this.patchers)
        patcher.patchEvent(event);
    }
  }
};
var BlobModernizer = class {
  modernize(fromVersion, events) {
    const result = [];
    for (const event of events)
      result.push(...this._modernize(fromVersion, event));
    return result;
  }
  _modernize(fromVersion, event) {
    let events = [event];
    for (let version = fromVersion; version < currentBlobReportVersion; ++version)
      events = this[`_modernize_${version}_to_${version + 1}`].call(this, events);
    return events;
  }
  _modernize_1_to_2(events) {
    return events.map((event) => {
      if (event.method === "onProject") {
        const modernizeSuite = (suite) => {
          const newSuites = suite.suites.map(modernizeSuite);
          const { suites, tests, ...remainder } = suite;
          return { entries: [...newSuites, ...tests], ...remainder };
        };
        const project = event.params.project;
        project.suites = project.suites.map(modernizeSuite);
      }
      return event;
    });
  }
};
var modernizer = new BlobModernizer();
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  ListModeReporter,
  ListReporter,
  TestServerConnection,
  base,
  html,
  merge,
  projectUtils,
  runnerReporters,
  testRunner,
  testServer,
  watchMode,
  webServer
});
# packages/playwright/lib/runner/index.js
# total: 290.8 KB

## Inlined (45)
   1.3 KB  packages/playwright/src/isomorphic/events.ts
   0.1 KB  packages/playwright/src/isomorphic/folders.ts
   0.9 KB  packages/playwright/src/isomorphic/stringInternPool.ts
  15.1 KB  packages/playwright/src/isomorphic/teleReceiver.ts
   3.9 KB  packages/playwright/src/isomorphic/teleSuiteUpdater.ts
   4.8 KB  packages/playwright/src/isomorphic/testServerConnection.ts
   0.0 KB  packages/playwright/src/isomorphic/testTree.ts
   5.1 KB  packages/playwright/src/plugins/gitCommitInfoPlugin.ts
   8.6 KB  packages/playwright/src/plugins/webServerPlugin.ts
  21.2 KB  packages/playwright/src/reporters/base.ts
   4.0 KB  packages/playwright/src/reporters/blob.ts
   2.3 KB  packages/playwright/src/reporters/dot.ts
   0.1 KB  packages/playwright/src/reporters/empty.ts
   3.5 KB  packages/playwright/src/reporters/github.ts
  26.2 KB  packages/playwright/src/reporters/html.ts
   3.1 KB  packages/playwright/src/reporters/internalReporter.ts
   7.1 KB  packages/playwright/src/reporters/json.ts
  10.3 KB  packages/playwright/src/reporters/junit.ts
   3.8 KB  packages/playwright/src/reporters/line.ts
   9.2 KB  packages/playwright/src/reporters/list.ts
   1.4 KB  packages/playwright/src/reporters/listModeReporter.ts
  18.5 KB  packages/playwright/src/reporters/merge.ts
   2.5 KB  packages/playwright/src/reporters/multiplexer.ts
   2.0 KB  packages/playwright/src/reporters/reporterV2.ts
   8.8 KB  packages/playwright/src/reporters/teleEmitter.ts
  19.0 KB  packages/playwright/src/runner/dispatcher.ts
   1.5 KB  packages/playwright/src/runner/fsWatcher.ts
   0.5 KB  packages/playwright/src/runner/index.ts
   1.4 KB  packages/playwright/src/runner/lastRun.ts
   1.6 KB  packages/playwright/src/runner/loaderHost.ts
  12.5 KB  packages/playwright/src/runner/loadUtils.ts
   5.8 KB  packages/playwright/src/runner/processHost.ts
   7.8 KB  packages/playwright/src/runner/projectUtils.ts
   5.5 KB  packages/playwright/src/runner/rebase.ts
   3.5 KB  packages/playwright/src/runner/reporters.ts
   1.6 KB  packages/playwright/src/runner/sigIntWatcher.ts
   3.5 KB  packages/playwright/src/runner/taskRunner.ts
  14.4 KB  packages/playwright/src/runner/tasks.ts
   3.6 KB  packages/playwright/src/runner/testGroups.ts
  14.1 KB  packages/playwright/src/runner/testRunner.ts
   9.3 KB  packages/playwright/src/runner/testServer.ts
   0.2 KB  packages/playwright/src/runner/uiModeReporter.ts
   1.7 KB  packages/playwright/src/runner/vcs.ts
  13.1 KB  packages/playwright/src/runner/watchMode.ts
   2.1 KB  packages/playwright/src/runner/workerHost.ts

## External (8)
  ../common
  ../loader/loaderProcessEntry.js
  ../transform/babelBundle
  ../util
  ../worker/workerProcessEntry.js
  playwright-core
  playwright-core/lib/coreBundle
  playwright-core/lib/utilsBundle
"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __commonJS = (cb, mod) => function __require() {
  return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
};
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  // If the importer is in node compatibility mode or this is not an ESM
  // file that has been converted to a CommonJS file using a Babel-
  // compatible transform (i.e. "__esModule" has not been set), then set
  // "default" to the CommonJS "module.exports" for node compatibility.
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);

// node_modules/@babel/types/lib/utils/shallowEqual.js
var require_shallowEqual = __commonJS({
  "node_modules/@babel/types/lib/utils/shallowEqual.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = shallowEqual;
    function shallowEqual(actual, expected) {
      const keys = Object.keys(expected);
      for (const key of keys) {
        if (actual[key] !== expected[key]) {
          return false;
        }
      }
      return true;
    }
  }
});

// node_modules/@babel/types/lib/utils/deprecationWarning.js
var require_deprecationWarning = __commonJS({
  "node_modules/@babel/types/lib/utils/deprecationWarning.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = deprecationWarning;
    var warnings = /* @__PURE__ */ new Set();
    function deprecationWarning(oldName, newName, prefix = "", cacheKey = oldName) {
      if (warnings.has(cacheKey)) return;
      warnings.add(cacheKey);
      const {
        internal,
        trace
      } = captureShortStackTrace(1, 2);
      if (internal) {
        return;
      }
      console.warn(`${prefix}\`${oldName}\` has been deprecated, please migrate to \`${newName}\`
${trace}`);
    }
    function captureShortStackTrace(skip, length) {
      const {
        stackTraceLimit,
        prepareStackTrace
      } = Error;
      let stackTrace;
      Error.stackTraceLimit = 1 + skip + length;
      Error.prepareStackTrace = function(err, stack) {
        stackTrace = stack;
      };
      new Error().stack;
      Error.stackTraceLimit = stackTraceLimit;
      Error.prepareStackTrace = prepareStackTrace;
      if (!stackTrace) return {
        internal: false,
        trace: ""
      };
      const shortStackTrace = stackTrace.slice(1 + skip, 1 + skip + length);
      return {
        internal: /[\\/]@babel[\\/]/.test(shortStackTrace[1].getFileName()),
        trace: shortStackTrace.map((frame) => `    at ${frame}`).join("\n")
      };
    }
  }
});

// node_modules/@babel/types/lib/validators/generated/index.js
var require_generated = __commonJS({
  "node_modules/@babel/types/lib/validators/generated/index.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.isAccessor = isAccessor;
    exports2.isAnyTypeAnnotation = isAnyTypeAnnotation;
    exports2.isArgumentPlaceholder = isArgumentPlaceholder;
    exports2.isArrayExpression = isArrayExpression;
    exports2.isArrayPattern = isArrayPattern;
    exports2.isArrayTypeAnnotation = isArrayTypeAnnotation;
    exports2.isArrowFunctionExpression = isArrowFunctionExpression;
    exports2.isAssignmentExpression = isAssignmentExpression;
    exports2.isAssignmentPattern = isAssignmentPattern;
    exports2.isAwaitExpression = isAwaitExpression;
    exports2.isBigIntLiteral = isBigIntLiteral;
    exports2.isBinary = isBinary;
    exports2.isBinaryExpression = isBinaryExpression;
    exports2.isBindExpression = isBindExpression;
    exports2.isBlock = isBlock;
    exports2.isBlockParent = isBlockParent;
    exports2.isBlockStatement = isBlockStatement;
    exports2.isBooleanLiteral = isBooleanLiteral;
    exports2.isBooleanLiteralTypeAnnotation = isBooleanLiteralTypeAnnotation;
    exports2.isBooleanTypeAnnotation = isBooleanTypeAnnotation;
    exports2.isBreakStatement = isBreakStatement;
    exports2.isCallExpression = isCallExpression;
    exports2.isCatchClause = isCatchClause;
    exports2.isClass = isClass;
    exports2.isClassAccessorProperty = isClassAccessorProperty;
    exports2.isClassBody = isClassBody;
    exports2.isClassDeclaration = isClassDeclaration;
    exports2.isClassExpression = isClassExpression;
    exports2.isClassImplements = isClassImplements;
    exports2.isClassMethod = isClassMethod;
    exports2.isClassPrivateMethod = isClassPrivateMethod;
    exports2.isClassPrivateProperty = isClassPrivateProperty;
    exports2.isClassProperty = isClassProperty;
    exports2.isCompletionStatement = isCompletionStatement;
    exports2.isConditional = isConditional;
    exports2.isConditionalExpression = isConditionalExpression;
    exports2.isContinueStatement = isContinueStatement;
    exports2.isDebuggerStatement = isDebuggerStatement;
    exports2.isDecimalLiteral = isDecimalLiteral;
    exports2.isDeclaration = isDeclaration;
    exports2.isDeclareClass = isDeclareClass;
    exports2.isDeclareExportAllDeclaration = isDeclareExportAllDeclaration;
    exports2.isDeclareExportDeclaration = isDeclareExportDeclaration;
    exports2.isDeclareFunction = isDeclareFunction;
    exports2.isDeclareInterface = isDeclareInterface;
    exports2.isDeclareModule = isDeclareModule;
    exports2.isDeclareModuleExports = isDeclareModuleExports;
    exports2.isDeclareOpaqueType = isDeclareOpaqueType;
    exports2.isDeclareTypeAlias = isDeclareTypeAlias;
    exports2.isDeclareVariable = isDeclareVariable;
    exports2.isDeclaredPredicate = isDeclaredPredicate;
    exports2.isDecorator = isDecorator;
    exports2.isDirective = isDirective;
    exports2.isDirectiveLiteral = isDirectiveLiteral;
    exports2.isDoExpression = isDoExpression;
    exports2.isDoWhileStatement = isDoWhileStatement;
    exports2.isEmptyStatement = isEmptyStatement;
    exports2.isEmptyTypeAnnotation = isEmptyTypeAnnotation;
    exports2.isEnumBody = isEnumBody;
    exports2.isEnumBooleanBody = isEnumBooleanBody;
    exports2.isEnumBooleanMember = isEnumBooleanMember;
    exports2.isEnumDeclaration = isEnumDeclaration;
    exports2.isEnumDefaultedMember = isEnumDefaultedMember;
    exports2.isEnumMember = isEnumMember;
    exports2.isEnumNumberBody = isEnumNumberBody;
    exports2.isEnumNumberMember = isEnumNumberMember;
    exports2.isEnumStringBody = isEnumStringBody;
    exports2.isEnumStringMember = isEnumStringMember;
    exports2.isEnumSymbolBody = isEnumSymbolBody;
    exports2.isExistsTypeAnnotation = isExistsTypeAnnotation;
    exports2.isExportAllDeclaration = isExportAllDeclaration;
    exports2.isExportDeclaration = isExportDeclaration;
    exports2.isExportDefaultDeclaration = isExportDefaultDeclaration;
    exports2.isExportDefaultSpecifier = isExportDefaultSpecifier;
    exports2.isExportNamedDeclaration = isExportNamedDeclaration;
    exports2.isExportNamespaceSpecifier = isExportNamespaceSpecifier;
    exports2.isExportSpecifier = isExportSpecifier;
    exports2.isExpression = isExpression;
    exports2.isExpressionStatement = isExpressionStatement;
    exports2.isExpressionWrapper = isExpressionWrapper;
    exports2.isFile = isFile;
    exports2.isFlow = isFlow;
    exports2.isFlowBaseAnnotation = isFlowBaseAnnotation;
    exports2.isFlowDeclaration = isFlowDeclaration;
    exports2.isFlowPredicate = isFlowPredicate;
    exports2.isFlowType = isFlowType;
    exports2.isFor = isFor;
    exports2.isForInStatement = isForInStatement;
    exports2.isForOfStatement = isForOfStatement;
    exports2.isForStatement = isForStatement;
    exports2.isForXStatement = isForXStatement;
    exports2.isFunction = isFunction;
    exports2.isFunctionDeclaration = isFunctionDeclaration;
    exports2.isFunctionExpression = isFunctionExpression;
    exports2.isFunctionParameter = isFunctionParameter;
    exports2.isFunctionParent = isFunctionParent;
    exports2.isFunctionTypeAnnotation = isFunctionTypeAnnotation;
    exports2.isFunctionTypeParam = isFunctionTypeParam;
    exports2.isGenericTypeAnnotation = isGenericTypeAnnotation;
    exports2.isIdentifier = isIdentifier;
    exports2.isIfStatement = isIfStatement;
    exports2.isImmutable = isImmutable;
    exports2.isImport = isImport;
    exports2.isImportAttribute = isImportAttribute;
    exports2.isImportDeclaration = isImportDeclaration;
    exports2.isImportDefaultSpecifier = isImportDefaultSpecifier;
    exports2.isImportExpression = isImportExpression;
    exports2.isImportNamespaceSpecifier = isImportNamespaceSpecifier;
    exports2.isImportOrExportDeclaration = isImportOrExportDeclaration;
    exports2.isImportSpecifier = isImportSpecifier;
    exports2.isIndexedAccessType = isIndexedAccessType;
    exports2.isInferredPredicate = isInferredPredicate;
    exports2.isInterfaceDeclaration = isInterfaceDeclaration;
    exports2.isInterfaceExtends = isInterfaceExtends;
    exports2.isInterfaceTypeAnnotation = isInterfaceTypeAnnotation;
    exports2.isInterpreterDirective = isInterpreterDirective;
    exports2.isIntersectionTypeAnnotation = isIntersectionTypeAnnotation;
    exports2.isJSX = isJSX;
    exports2.isJSXAttribute = isJSXAttribute;
    exports2.isJSXClosingElement = isJSXClosingElement;
    exports2.isJSXClosingFragment = isJSXClosingFragment;
    exports2.isJSXElement = isJSXElement;
    exports2.isJSXEmptyExpression = isJSXEmptyExpression;
    exports2.isJSXExpressionContainer = isJSXExpressionContainer;
    exports2.isJSXFragment = isJSXFragment;
    exports2.isJSXIdentifier = isJSXIdentifier;
    exports2.isJSXMemberExpression = isJSXMemberExpression;
    exports2.isJSXNamespacedName = isJSXNamespacedName;
    exports2.isJSXOpeningElement = isJSXOpeningElement;
    exports2.isJSXOpeningFragment = isJSXOpeningFragment;
    exports2.isJSXSpreadAttribute = isJSXSpreadAttribute;
    exports2.isJSXSpreadChild = isJSXSpreadChild;
    exports2.isJSXText = isJSXText;
    exports2.isLVal = isLVal;
    exports2.isLabeledStatement = isLabeledStatement;
    exports2.isLiteral = isLiteral;
    exports2.isLogicalExpression = isLogicalExpression;
    exports2.isLoop = isLoop;
    exports2.isMemberExpression = isMemberExpression;
    exports2.isMetaProperty = isMetaProperty;
    exports2.isMethod = isMethod;
    exports2.isMiscellaneous = isMiscellaneous;
    exports2.isMixedTypeAnnotation = isMixedTypeAnnotation;
    exports2.isModuleDeclaration = isModuleDeclaration;
    exports2.isModuleExpression = isModuleExpression;
    exports2.isModuleSpecifier = isModuleSpecifier;
    exports2.isNewExpression = isNewExpression;
    exports2.isNoop = isNoop;
    exports2.isNullLiteral = isNullLiteral;
    exports2.isNullLiteralTypeAnnotation = isNullLiteralTypeAnnotation;
    exports2.isNullableTypeAnnotation = isNullableTypeAnnotation;
    exports2.isNumberLiteral = isNumberLiteral;
    exports2.isNumberLiteralTypeAnnotation = isNumberLiteralTypeAnnotation;
    exports2.isNumberTypeAnnotation = isNumberTypeAnnotation;
    exports2.isNumericLiteral = isNumericLiteral;
    exports2.isObjectExpression = isObjectExpression;
    exports2.isObjectMember = isObjectMember;
    exports2.isObjectMethod = isObjectMethod;
    exports2.isObjectPattern = isObjectPattern;
    exports2.isObjectProperty = isObjectProperty;
    exports2.isObjectTypeAnnotation = isObjectTypeAnnotation;
    exports2.isObjectTypeCallProperty = isObjectTypeCallProperty;
    exports2.isObjectTypeIndexer = isObjectTypeIndexer;
    exports2.isObjectTypeInternalSlot = isObjectTypeInternalSlot;
    exports2.isObjectTypeProperty = isObjectTypeProperty;
    exports2.isObjectTypeSpreadProperty = isObjectTypeSpreadProperty;
    exports2.isOpaqueType = isOpaqueType;
    exports2.isOptionalCallExpression = isOptionalCallExpression;
    exports2.isOptionalIndexedAccessType = isOptionalIndexedAccessType;
    exports2.isOptionalMemberExpression = isOptionalMemberExpression;
    exports2.isParenthesizedExpression = isParenthesizedExpression;
    exports2.isPattern = isPattern;
    exports2.isPatternLike = isPatternLike;
    exports2.isPipelineBareFunction = isPipelineBareFunction;
    exports2.isPipelinePrimaryTopicReference = isPipelinePrimaryTopicReference;
    exports2.isPipelineTopicExpression = isPipelineTopicExpression;
    exports2.isPlaceholder = isPlaceholder;
    exports2.isPrivate = isPrivate;
    exports2.isPrivateName = isPrivateName;
    exports2.isProgram = isProgram;
    exports2.isProperty = isProperty;
    exports2.isPureish = isPureish;
    exports2.isQualifiedTypeIdentifier = isQualifiedTypeIdentifier;
    exports2.isRecordExpression = isRecordExpression;
    exports2.isRegExpLiteral = isRegExpLiteral;
    exports2.isRegexLiteral = isRegexLiteral;
    exports2.isRestElement = isRestElement;
    exports2.isRestProperty = isRestProperty;
    exports2.isReturnStatement = isReturnStatement;
    exports2.isScopable = isScopable;
    exports2.isSequenceExpression = isSequenceExpression;
    exports2.isSpreadElement = isSpreadElement;
    exports2.isSpreadProperty = isSpreadProperty;
    exports2.isStandardized = isStandardized;
    exports2.isStatement = isStatement;
    exports2.isStaticBlock = isStaticBlock;
    exports2.isStringLiteral = isStringLiteral;
    exports2.isStringLiteralTypeAnnotation = isStringLiteralTypeAnnotation;
    exports2.isStringTypeAnnotation = isStringTypeAnnotation;
    exports2.isSuper = isSuper;
    exports2.isSwitchCase = isSwitchCase;
    exports2.isSwitchStatement = isSwitchStatement;
    exports2.isSymbolTypeAnnotation = isSymbolTypeAnnotation;
    exports2.isTSAnyKeyword = isTSAnyKeyword;
    exports2.isTSArrayType = isTSArrayType;
    exports2.isTSAsExpression = isTSAsExpression;
    exports2.isTSBaseType = isTSBaseType;
    exports2.isTSBigIntKeyword = isTSBigIntKeyword;
    exports2.isTSBooleanKeyword = isTSBooleanKeyword;
    exports2.isTSCallSignatureDeclaration = isTSCallSignatureDeclaration;
    exports2.isTSConditionalType = isTSConditionalType;
    exports2.isTSConstructSignatureDeclaration = isTSConstructSignatureDeclaration;
    exports2.isTSConstructorType = isTSConstructorType;
    exports2.isTSDeclareFunction = isTSDeclareFunction;
    exports2.isTSDeclareMethod = isTSDeclareMethod;
    exports2.isTSEntityName = isTSEntityName;
    exports2.isTSEnumBody = isTSEnumBody;
    exports2.isTSEnumDeclaration = isTSEnumDeclaration;
    exports2.isTSEnumMember = isTSEnumMember;
    exports2.isTSExportAssignment = isTSExportAssignment;
    exports2.isTSExpressionWithTypeArguments = isTSExpressionWithTypeArguments;
    exports2.isTSExternalModuleReference = isTSExternalModuleReference;
    exports2.isTSFunctionType = isTSFunctionType;
    exports2.isTSImportEqualsDeclaration = isTSImportEqualsDeclaration;
    exports2.isTSImportType = isTSImportType;
    exports2.isTSIndexSignature = isTSIndexSignature;
    exports2.isTSIndexedAccessType = isTSIndexedAccessType;
    exports2.isTSInferType = isTSInferType;
    exports2.isTSInstantiationExpression = isTSInstantiationExpression;
    exports2.isTSInterfaceBody = isTSInterfaceBody;
    exports2.isTSInterfaceDeclaration = isTSInterfaceDeclaration;
    exports2.isTSIntersectionType = isTSIntersectionType;
    exports2.isTSIntrinsicKeyword = isTSIntrinsicKeyword;
    exports2.isTSLiteralType = isTSLiteralType;
    exports2.isTSMappedType = isTSMappedType;
    exports2.isTSMethodSignature = isTSMethodSignature;
    exports2.isTSModuleBlock = isTSModuleBlock;
    exports2.isTSModuleDeclaration = isTSModuleDeclaration;
    exports2.isTSNamedTupleMember = isTSNamedTupleMember;
    exports2.isTSNamespaceExportDeclaration = isTSNamespaceExportDeclaration;
    exports2.isTSNeverKeyword = isTSNeverKeyword;
    exports2.isTSNonNullExpression = isTSNonNullExpression;
    exports2.isTSNullKeyword = isTSNullKeyword;
    exports2.isTSNumberKeyword = isTSNumberKeyword;
    exports2.isTSObjectKeyword = isTSObjectKeyword;
    exports2.isTSOptionalType = isTSOptionalType;
    exports2.isTSParameterProperty = isTSParameterProperty;
    exports2.isTSParenthesizedType = isTSParenthesizedType;
    exports2.isTSPropertySignature = isTSPropertySignature;
    exports2.isTSQualifiedName = isTSQualifiedName;
    exports2.isTSRestType = isTSRestType;
    exports2.isTSSatisfiesExpression = isTSSatisfiesExpression;
    exports2.isTSStringKeyword = isTSStringKeyword;
    exports2.isTSSymbolKeyword = isTSSymbolKeyword;
    exports2.isTSTemplateLiteralType = isTSTemplateLiteralType;
    exports2.isTSThisType = isTSThisType;
    exports2.isTSTupleType = isTSTupleType;
    exports2.isTSType = isTSType;
    exports2.isTSTypeAliasDeclaration = isTSTypeAliasDeclaration;
    exports2.isTSTypeAnnotation = isTSTypeAnnotation;
    exports2.isTSTypeAssertion = isTSTypeAssertion;
    exports2.isTSTypeElement = isTSTypeElement;
    exports2.isTSTypeLiteral = isTSTypeLiteral;
    exports2.isTSTypeOperator = isTSTypeOperator;
    exports2.isTSTypeParameter = isTSTypeParameter;
    exports2.isTSTypeParameterDeclaration = isTSTypeParameterDeclaration;
    exports2.isTSTypeParameterInstantiation = isTSTypeParameterInstantiation;
    exports2.isTSTypePredicate = isTSTypePredicate;
    exports2.isTSTypeQuery = isTSTypeQuery;
    exports2.isTSTypeReference = isTSTypeReference;
    exports2.isTSUndefinedKeyword = isTSUndefinedKeyword;
    exports2.isTSUnionType = isTSUnionType;
    exports2.isTSUnknownKeyword = isTSUnknownKeyword;
    exports2.isTSVoidKeyword = isTSVoidKeyword;
    exports2.isTaggedTemplateExpression = isTaggedTemplateExpression;
    exports2.isTemplateElement = isTemplateElement;
    exports2.isTemplateLiteral = isTemplateLiteral;
    exports2.isTerminatorless = isTerminatorless;
    exports2.isThisExpression = isThisExpression;
    exports2.isThisTypeAnnotation = isThisTypeAnnotation;
    exports2.isThrowStatement = isThrowStatement;
    exports2.isTopicReference = isTopicReference;
    exports2.isTryStatement = isTryStatement;
    exports2.isTupleExpression = isTupleExpression;
    exports2.isTupleTypeAnnotation = isTupleTypeAnnotation;
    exports2.isTypeAlias = isTypeAlias;
    exports2.isTypeAnnotation = isTypeAnnotation;
    exports2.isTypeCastExpression = isTypeCastExpression;
    exports2.isTypeParameter = isTypeParameter;
    exports2.isTypeParameterDeclaration = isTypeParameterDeclaration;
    exports2.isTypeParameterInstantiation = isTypeParameterInstantiation;
    exports2.isTypeScript = isTypeScript2;
    exports2.isTypeofTypeAnnotation = isTypeofTypeAnnotation;
    exports2.isUnaryExpression = isUnaryExpression;
    exports2.isUnaryLike = isUnaryLike;
    exports2.isUnionTypeAnnotation = isUnionTypeAnnotation;
    exports2.isUpdateExpression = isUpdateExpression;
    exports2.isUserWhitespacable = isUserWhitespacable;
    exports2.isV8IntrinsicIdentifier = isV8IntrinsicIdentifier;
    exports2.isVariableDeclaration = isVariableDeclaration;
    exports2.isVariableDeclarator = isVariableDeclarator;
    exports2.isVariance = isVariance;
    exports2.isVoidPattern = isVoidPattern;
    exports2.isVoidTypeAnnotation = isVoidTypeAnnotation;
    exports2.isWhile = isWhile;
    exports2.isWhileStatement = isWhileStatement;
    exports2.isWithStatement = isWithStatement;
    exports2.isYieldExpression = isYieldExpression;
    var _shallowEqual = require_shallowEqual();
    var _deprecationWarning = require_deprecationWarning();
    function isArrayExpression(node, opts) {
      if (!node) return false;
      if (node.type !== "ArrayExpression") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isAssignmentExpression(node, opts) {
      if (!node) return false;
      if (node.type !== "AssignmentExpression") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isBinaryExpression(node, opts) {
      if (!node) return false;
      if (node.type !== "BinaryExpression") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isInterpreterDirective(node, opts) {
      if (!node) return false;
      if (node.type !== "InterpreterDirective") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isDirective(node, opts) {
      if (!node) return false;
      if (node.type !== "Directive") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isDirectiveLiteral(node, opts) {
      if (!node) return false;
      if (node.type !== "DirectiveLiteral") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isBlockStatement(node, opts) {
      if (!node) return false;
      if (node.type !== "BlockStatement") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isBreakStatement(node, opts) {
      if (!node) return false;
      if (node.type !== "BreakStatement") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isCallExpression(node, opts) {
      if (!node) return false;
      if (node.type !== "CallExpression") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isCatchClause(node, opts) {
      if (!node) return false;
      if (node.type !== "CatchClause") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isConditionalExpression(node, opts) {
      if (!node) return false;
      if (node.type !== "ConditionalExpression") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isContinueStatement(node, opts) {
      if (!node) return false;
      if (node.type !== "ContinueStatement") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isDebuggerStatement(node, opts) {
      if (!node) return false;
      if (node.type !== "DebuggerStatement") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isDoWhileStatement(node, opts) {
      if (!node) return false;
      if (node.type !== "DoWhileStatement") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isEmptyStatement(node, opts) {
      if (!node) return false;
      if (node.type !== "EmptyStatement") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isExpressionStatement(node, opts) {
      if (!node) return false;
      if (node.type !== "ExpressionStatement") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isFile(node, opts) {
      if (!node) return false;
      if (node.type !== "File") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isForInStatement(node, opts) {
      if (!node) return false;
      if (node.type !== "ForInStatement") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isForStatement(node, opts) {
      if (!node) return false;
      if (node.type !== "ForStatement") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isFunctionDeclaration(node, opts) {
      if (!node) return false;
      if (node.type !== "FunctionDeclaration") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isFunctionExpression(node, opts) {
      if (!node) return false;
      if (node.type !== "FunctionExpression") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isIdentifier(node, opts) {
      if (!node) return false;
      if (node.type !== "Identifier") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isIfStatement(node, opts) {
      if (!node) return false;
      if (node.type !== "IfStatement") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isLabeledStatement(node, opts) {
      if (!node) return false;
      if (node.type !== "LabeledStatement") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isStringLiteral(node, opts) {
      if (!node) return false;
      if (node.type !== "StringLiteral") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isNumericLiteral(node, opts) {
      if (!node) return false;
      if (node.type !== "NumericLiteral") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isNullLiteral(node, opts) {
      if (!node) return false;
      if (node.type !== "NullLiteral") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isBooleanLiteral(node, opts) {
      if (!node) return false;
      if (node.type !== "BooleanLiteral") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isRegExpLiteral(node, opts) {
      if (!node) return false;
      if (node.type !== "RegExpLiteral") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isLogicalExpression(node, opts) {
      if (!node) return false;
      if (node.type !== "LogicalExpression") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isMemberExpression(node, opts) {
      if (!node) return false;
      if (node.type !== "MemberExpression") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isNewExpression(node, opts) {
      if (!node) return false;
      if (node.type !== "NewExpression") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isProgram(node, opts) {
      if (!node) return false;
      if (node.type !== "Program") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isObjectExpression(node, opts) {
      if (!node) return false;
      if (node.type !== "ObjectExpression") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isObjectMethod(node, opts) {
      if (!node) return false;
      if (node.type !== "ObjectMethod") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isObjectProperty(node, opts) {
      if (!node) return false;
      if (node.type !== "ObjectProperty") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isRestElement(node, opts) {
      if (!node) return false;
      if (node.type !== "RestElement") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isReturnStatement(node, opts) {
      if (!node) return false;
      if (node.type !== "ReturnStatement") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isSequenceExpression(node, opts) {
      if (!node) return false;
      if (node.type !== "SequenceExpression") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isParenthesizedExpression(node, opts) {
      if (!node) return false;
      if (node.type !== "ParenthesizedExpression") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isSwitchCase(node, opts) {
      if (!node) return false;
      if (node.type !== "SwitchCase") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isSwitchStatement(node, opts) {
      if (!node) return false;
      if (node.type !== "SwitchStatement") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isThisExpression(node, opts) {
      if (!node) return false;
      if (node.type !== "ThisExpression") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isThrowStatement(node, opts) {
      if (!node) return false;
      if (node.type !== "ThrowStatement") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isTryStatement(node, opts) {
      if (!node) return false;
      if (node.type !== "TryStatement") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isUnaryExpression(node, opts) {
      if (!node) return false;
      if (node.type !== "UnaryExpression") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isUpdateExpression(node, opts) {
      if (!node) return false;
      if (node.type !== "UpdateExpression") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isVariableDeclaration(node, opts) {
      if (!node) return false;
      if (node.type !== "VariableDeclaration") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isVariableDeclarator(node, opts) {
      if (!node) return false;
      if (node.type !== "VariableDeclarator") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isWhileStatement(node, opts) {
      if (!node) return false;
      if (node.type !== "WhileStatement") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isWithStatement(node, opts) {
      if (!node) return false;
      if (node.type !== "WithStatement") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isAssignmentPattern(node, opts) {
      if (!node) return false;
      if (node.type !== "AssignmentPattern") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isArrayPattern(node, opts) {
      if (!node) return false;
      if (node.type !== "ArrayPattern") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isArrowFunctionExpression(node, opts) {
      if (!node) return false;
      if (node.type !== "ArrowFunctionExpression") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isClassBody(node, opts) {
      if (!node) return false;
      if (node.type !== "ClassBody") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isClassExpression(node, opts) {
      if (!node) return false;
      if (node.type !== "ClassExpression") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isClassDeclaration(node, opts) {
      if (!node) return false;
      if (node.type !== "ClassDeclaration") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isExportAllDeclaration(node, opts) {
      if (!node) return false;
      if (node.type !== "ExportAllDeclaration") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isExportDefaultDeclaration(node, opts) {
      if (!node) return false;
      if (node.type !== "ExportDefaultDeclaration") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isExportNamedDeclaration(node, opts) {
      if (!node) return false;
      if (node.type !== "ExportNamedDeclaration") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isExportSpecifier(node, opts) {
      if (!node) return false;
      if (node.type !== "ExportSpecifier") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isForOfStatement(node, opts) {
      if (!node) return false;
      if (node.type !== "ForOfStatement") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isImportDeclaration(node, opts) {
      if (!node) return false;
      if (node.type !== "ImportDeclaration") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isImportDefaultSpecifier(node, opts) {
      if (!node) return false;
      if (node.type !== "ImportDefaultSpecifier") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isImportNamespaceSpecifier(node, opts) {
      if (!node) return false;
      if (node.type !== "ImportNamespaceSpecifier") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isImportSpecifier(node, opts) {
      if (!node) return false;
      if (node.type !== "ImportSpecifier") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isImportExpression(node, opts) {
      if (!node) return false;
      if (node.type !== "ImportExpression") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isMetaProperty(node, opts) {
      if (!node) return false;
      if (node.type !== "MetaProperty") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isClassMethod(node, opts) {
      if (!node) return false;
      if (node.type !== "ClassMethod") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isObjectPattern(node, opts) {
      if (!node) return false;
      if (node.type !== "ObjectPattern") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isSpreadElement(node, opts) {
      if (!node) return false;
      if (node.type !== "SpreadElement") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isSuper(node, opts) {
      if (!node) return false;
      if (node.type !== "Super") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isTaggedTemplateExpression(node, opts) {
      if (!node) return false;
      if (node.type !== "TaggedTemplateExpression") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isTemplateElement(node, opts) {
      if (!node) return false;
      if (node.type !== "TemplateElement") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isTemplateLiteral(node, opts) {
      if (!node) return false;
      if (node.type !== "TemplateLiteral") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isYieldExpression(node, opts) {
      if (!node) return false;
      if (node.type !== "YieldExpression") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isAwaitExpression(node, opts) {
      if (!node) return false;
      if (node.type !== "AwaitExpression") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isImport(node, opts) {
      if (!node) return false;
      if (node.type !== "Import") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isBigIntLiteral(node, opts) {
      if (!node) return false;
      if (node.type !== "BigIntLiteral") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isExportNamespaceSpecifier(node, opts) {
      if (!node) return false;
      if (node.type !== "ExportNamespaceSpecifier") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isOptionalMemberExpression(node, opts) {
      if (!node) return false;
      if (node.type !== "OptionalMemberExpression") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isOptionalCallExpression(node, opts) {
      if (!node) return false;
      if (node.type !== "OptionalCallExpression") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isClassProperty(node, opts) {
      if (!node) return false;
      if (node.type !== "ClassProperty") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isClassAccessorProperty(node, opts) {
      if (!node) return false;
      if (node.type !== "ClassAccessorProperty") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isClassPrivateProperty(node, opts) {
      if (!node) return false;
      if (node.type !== "ClassPrivateProperty") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isClassPrivateMethod(node, opts) {
      if (!node) return false;
      if (node.type !== "ClassPrivateMethod") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isPrivateName(node, opts) {
      if (!node) return false;
      if (node.type !== "PrivateName") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isStaticBlock(node, opts) {
      if (!node) return false;
      if (node.type !== "StaticBlock") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isImportAttribute(node, opts) {
      if (!node) return false;
      if (node.type !== "ImportAttribute") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isAnyTypeAnnotation(node, opts) {
      if (!node) return false;
      if (node.type !== "AnyTypeAnnotation") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isArrayTypeAnnotation(node, opts) {
      if (!node) return false;
      if (node.type !== "ArrayTypeAnnotation") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isBooleanTypeAnnotation(node, opts) {
      if (!node) return false;
      if (node.type !== "BooleanTypeAnnotation") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isBooleanLiteralTypeAnnotation(node, opts) {
      if (!node) return false;
      if (node.type !== "BooleanLiteralTypeAnnotation") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isNullLiteralTypeAnnotation(node, opts) {
      if (!node) return false;
      if (node.type !== "NullLiteralTypeAnnotation") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isClassImplements(node, opts) {
      if (!node) return false;
      if (node.type !== "ClassImplements") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isDeclareClass(node, opts) {
      if (!node) return false;
      if (node.type !== "DeclareClass") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isDeclareFunction(node, opts) {
      if (!node) return false;
      if (node.type !== "DeclareFunction") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isDeclareInterface(node, opts) {
      if (!node) return false;
      if (node.type !== "DeclareInterface") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isDeclareModule(node, opts) {
      if (!node) return false;
      if (node.type !== "DeclareModule") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isDeclareModuleExports(node, opts) {
      if (!node) return false;
      if (node.type !== "DeclareModuleExports") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isDeclareTypeAlias(node, opts) {
      if (!node) return false;
      if (node.type !== "DeclareTypeAlias") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isDeclareOpaqueType(node, opts) {
      if (!node) return false;
      if (node.type !== "DeclareOpaqueType") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isDeclareVariable(node, opts) {
      if (!node) return false;
      if (node.type !== "DeclareVariable") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isDeclareExportDeclaration(node, opts) {
      if (!node) return false;
      if (node.type !== "DeclareExportDeclaration") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isDeclareExportAllDeclaration(node, opts) {
      if (!node) return false;
      if (node.type !== "DeclareExportAllDeclaration") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isDeclaredPredicate(node, opts) {
      if (!node) return false;
      if (node.type !== "DeclaredPredicate") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isExistsTypeAnnotation(node, opts) {
      if (!node) return false;
      if (node.type !== "ExistsTypeAnnotation") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isFunctionTypeAnnotation(node, opts) {
      if (!node) return false;
      if (node.type !== "FunctionTypeAnnotation") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isFunctionTypeParam(node, opts) {
      if (!node) return false;
      if (node.type !== "FunctionTypeParam") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isGenericTypeAnnotation(node, opts) {
      if (!node) return false;
      if (node.type !== "GenericTypeAnnotation") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isInferredPredicate(node, opts) {
      if (!node) return false;
      if (node.type !== "InferredPredicate") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isInterfaceExtends(node, opts) {
      if (!node) return false;
      if (node.type !== "InterfaceExtends") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isInterfaceDeclaration(node, opts) {
      if (!node) return false;
      if (node.type !== "InterfaceDeclaration") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isInterfaceTypeAnnotation(node, opts) {
      if (!node) return false;
      if (node.type !== "InterfaceTypeAnnotation") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isIntersectionTypeAnnotation(node, opts) {
      if (!node) return false;
      if (node.type !== "IntersectionTypeAnnotation") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isMixedTypeAnnotation(node, opts) {
      if (!node) return false;
      if (node.type !== "MixedTypeAnnotation") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isEmptyTypeAnnotation(node, opts) {
      if (!node) return false;
      if (node.type !== "EmptyTypeAnnotation") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isNullableTypeAnnotation(node, opts) {
      if (!node) return false;
      if (node.type !== "NullableTypeAnnotation") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isNumberLiteralTypeAnnotation(node, opts) {
      if (!node) return false;
      if (node.type !== "NumberLiteralTypeAnnotation") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isNumberTypeAnnotation(node, opts) {
      if (!node) return false;
      if (node.type !== "NumberTypeAnnotation") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isObjectTypeAnnotation(node, opts) {
      if (!node) return false;
      if (node.type !== "ObjectTypeAnnotation") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isObjectTypeInternalSlot(node, opts) {
      if (!node) return false;
      if (node.type !== "ObjectTypeInternalSlot") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isObjectTypeCallProperty(node, opts) {
      if (!node) return false;
      if (node.type !== "ObjectTypeCallProperty") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isObjectTypeIndexer(node, opts) {
      if (!node) return false;
      if (node.type !== "ObjectTypeIndexer") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isObjectTypeProperty(node, opts) {
      if (!node) return false;
      if (node.type !== "ObjectTypeProperty") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isObjectTypeSpreadProperty(node, opts) {
      if (!node) return false;
      if (node.type !== "ObjectTypeSpreadProperty") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isOpaqueType(node, opts) {
      if (!node) return false;
      if (node.type !== "OpaqueType") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isQualifiedTypeIdentifier(node, opts) {
      if (!node) return false;
      if (node.type !== "QualifiedTypeIdentifier") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isStringLiteralTypeAnnotation(node, opts) {
      if (!node) return false;
      if (node.type !== "StringLiteralTypeAnnotation") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isStringTypeAnnotation(node, opts) {
      if (!node) return false;
      if (node.type !== "StringTypeAnnotation") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isSymbolTypeAnnotation(node, opts) {
      if (!node) return false;
      if (node.type !== "SymbolTypeAnnotation") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isThisTypeAnnotation(node, opts) {
      if (!node) return false;
      if (node.type !== "ThisTypeAnnotation") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isTupleTypeAnnotation(node, opts) {
      if (!node) return false;
      if (node.type !== "TupleTypeAnnotation") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isTypeofTypeAnnotation(node, opts) {
      if (!node) return false;
      if (node.type !== "TypeofTypeAnnotation") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isTypeAlias(node, opts) {
      if (!node) return false;
      if (node.type !== "TypeAlias") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isTypeAnnotation(node, opts) {
      if (!node) return false;
      if (node.type !== "TypeAnnotation") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isTypeCastExpression(node, opts) {
      if (!node) return false;
      if (node.type !== "TypeCastExpression") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isTypeParameter(node, opts) {
      if (!node) return false;
      if (node.type !== "TypeParameter") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isTypeParameterDeclaration(node, opts) {
      if (!node) return false;
      if (node.type !== "TypeParameterDeclaration") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isTypeParameterInstantiation(node, opts) {
      if (!node) return false;
      if (node.type !== "TypeParameterInstantiation") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isUnionTypeAnnotation(node, opts) {
      if (!node) return false;
      if (node.type !== "UnionTypeAnnotation") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isVariance(node, opts) {
      if (!node) return false;
      if (node.type !== "Variance") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isVoidTypeAnnotation(node, opts) {
      if (!node) return false;
      if (node.type !== "VoidTypeAnnotation") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isEnumDeclaration(node, opts) {
      if (!node) return false;
      if (node.type !== "EnumDeclaration") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isEnumBooleanBody(node, opts) {
      if (!node) return false;
      if (node.type !== "EnumBooleanBody") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isEnumNumberBody(node, opts) {
      if (!node) return false;
      if (node.type !== "EnumNumberBody") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isEnumStringBody(node, opts) {
      if (!node) return false;
      if (node.type !== "EnumStringBody") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isEnumSymbolBody(node, opts) {
      if (!node) return false;
      if (node.type !== "EnumSymbolBody") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isEnumBooleanMember(node, opts) {
      if (!node) return false;
      if (node.type !== "EnumBooleanMember") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isEnumNumberMember(node, opts) {
      if (!node) return false;
      if (node.type !== "EnumNumberMember") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isEnumStringMember(node, opts) {
      if (!node) return false;
      if (node.type !== "EnumStringMember") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isEnumDefaultedMember(node, opts) {
      if (!node) return false;
      if (node.type !== "EnumDefaultedMember") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isIndexedAccessType(node, opts) {
      if (!node) return false;
      if (node.type !== "IndexedAccessType") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isOptionalIndexedAccessType(node, opts) {
      if (!node) return false;
      if (node.type !== "OptionalIndexedAccessType") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isJSXAttribute(node, opts) {
      if (!node) return false;
      if (node.type !== "JSXAttribute") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isJSXClosingElement(node, opts) {
      if (!node) return false;
      if (node.type !== "JSXClosingElement") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isJSXElement(node, opts) {
      if (!node) return false;
      if (node.type !== "JSXElement") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isJSXEmptyExpression(node, opts) {
      if (!node) return false;
      if (node.type !== "JSXEmptyExpression") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isJSXExpressionContainer(node, opts) {
      if (!node) return false;
      if (node.type !== "JSXExpressionContainer") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isJSXSpreadChild(node, opts) {
      if (!node) return false;
      if (node.type !== "JSXSpreadChild") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isJSXIdentifier(node, opts) {
      if (!node) return false;
      if (node.type !== "JSXIdentifier") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isJSXMemberExpression(node, opts) {
      if (!node) return false;
      if (node.type !== "JSXMemberExpression") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isJSXNamespacedName(node, opts) {
      if (!node) return false;
      if (node.type !== "JSXNamespacedName") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isJSXOpeningElement(node, opts) {
      if (!node) return false;
      if (node.type !== "JSXOpeningElement") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isJSXSpreadAttribute(node, opts) {
      if (!node) return false;
      if (node.type !== "JSXSpreadAttribute") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isJSXText(node, opts) {
      if (!node) return false;
      if (node.type !== "JSXText") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isJSXFragment(node, opts) {
      if (!node) return false;
      if (node.type !== "JSXFragment") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isJSXOpeningFragment(node, opts) {
      if (!node) return false;
      if (node.type !== "JSXOpeningFragment") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isJSXClosingFragment(node, opts) {
      if (!node) return false;
      if (node.type !== "JSXClosingFragment") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isNoop(node, opts) {
      if (!node) return false;
      if (node.type !== "Noop") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isPlaceholder(node, opts) {
      if (!node) return false;
      if (node.type !== "Placeholder") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isV8IntrinsicIdentifier(node, opts) {
      if (!node) return false;
      if (node.type !== "V8IntrinsicIdentifier") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isArgumentPlaceholder(node, opts) {
      if (!node) return false;
      if (node.type !== "ArgumentPlaceholder") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isBindExpression(node, opts) {
      if (!node) return false;
      if (node.type !== "BindExpression") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isDecorator(node, opts) {
      if (!node) return false;
      if (node.type !== "Decorator") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isDoExpression(node, opts) {
      if (!node) return false;
      if (node.type !== "DoExpression") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isExportDefaultSpecifier(node, opts) {
      if (!node) return false;
      if (node.type !== "ExportDefaultSpecifier") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isRecordExpression(node, opts) {
      if (!node) return false;
      if (node.type !== "RecordExpression") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isTupleExpression(node, opts) {
      if (!node) return false;
      if (node.type !== "TupleExpression") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isDecimalLiteral(node, opts) {
      if (!node) return false;
      if (node.type !== "DecimalLiteral") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isModuleExpression(node, opts) {
      if (!node) return false;
      if (node.type !== "ModuleExpression") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isTopicReference(node, opts) {
      if (!node) return false;
      if (node.type !== "TopicReference") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isPipelineTopicExpression(node, opts) {
      if (!node) return false;
      if (node.type !== "PipelineTopicExpression") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isPipelineBareFunction(node, opts) {
      if (!node) return false;
      if (node.type !== "PipelineBareFunction") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isPipelinePrimaryTopicReference(node, opts) {
      if (!node) return false;
      if (node.type !== "PipelinePrimaryTopicReference") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isVoidPattern(node, opts) {
      if (!node) return false;
      if (node.type !== "VoidPattern") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isTSParameterProperty(node, opts) {
      if (!node) return false;
      if (node.type !== "TSParameterProperty") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isTSDeclareFunction(node, opts) {
      if (!node) return false;
      if (node.type !== "TSDeclareFunction") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isTSDeclareMethod(node, opts) {
      if (!node) return false;
      if (node.type !== "TSDeclareMethod") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isTSQualifiedName(node, opts) {
      if (!node) return false;
      if (node.type !== "TSQualifiedName") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isTSCallSignatureDeclaration(node, opts) {
      if (!node) return false;
      if (node.type !== "TSCallSignatureDeclaration") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isTSConstructSignatureDeclaration(node, opts) {
      if (!node) return false;
      if (node.type !== "TSConstructSignatureDeclaration") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isTSPropertySignature(node, opts) {
      if (!node) return false;
      if (node.type !== "TSPropertySignature") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isTSMethodSignature(node, opts) {
      if (!node) return false;
      if (node.type !== "TSMethodSignature") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isTSIndexSignature(node, opts) {
      if (!node) return false;
      if (node.type !== "TSIndexSignature") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isTSAnyKeyword(node, opts) {
      if (!node) return false;
      if (node.type !== "TSAnyKeyword") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isTSBooleanKeyword(node, opts) {
      if (!node) return false;
      if (node.type !== "TSBooleanKeyword") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isTSBigIntKeyword(node, opts) {
      if (!node) return false;
      if (node.type !== "TSBigIntKeyword") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isTSIntrinsicKeyword(node, opts) {
      if (!node) return false;
      if (node.type !== "TSIntrinsicKeyword") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isTSNeverKeyword(node, opts) {
      if (!node) return false;
      if (node.type !== "TSNeverKeyword") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isTSNullKeyword(node, opts) {
      if (!node) return false;
      if (node.type !== "TSNullKeyword") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isTSNumberKeyword(node, opts) {
      if (!node) return false;
      if (node.type !== "TSNumberKeyword") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isTSObjectKeyword(node, opts) {
      if (!node) return false;
      if (node.type !== "TSObjectKeyword") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isTSStringKeyword(node, opts) {
      if (!node) return false;
      if (node.type !== "TSStringKeyword") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isTSSymbolKeyword(node, opts) {
      if (!node) return false;
      if (node.type !== "TSSymbolKeyword") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isTSUndefinedKeyword(node, opts) {
      if (!node) return false;
      if (node.type !== "TSUndefinedKeyword") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isTSUnknownKeyword(node, opts) {
      if (!node) return false;
      if (node.type !== "TSUnknownKeyword") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isTSVoidKeyword(node, opts) {
      if (!node) return false;
      if (node.type !== "TSVoidKeyword") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isTSThisType(node, opts) {
      if (!node) return false;
      if (node.type !== "TSThisType") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isTSFunctionType(node, opts) {
      if (!node) return false;
      if (node.type !== "TSFunctionType") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isTSConstructorType(node, opts) {
      if (!node) return false;
      if (node.type !== "TSConstructorType") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isTSTypeReference(node, opts) {
      if (!node) return false;
      if (node.type !== "TSTypeReference") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isTSTypePredicate(node, opts) {
      if (!node) return false;
      if (node.type !== "TSTypePredicate") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isTSTypeQuery(node, opts) {
      if (!node) return false;
      if (node.type !== "TSTypeQuery") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isTSTypeLiteral(node, opts) {
      if (!node) return false;
      if (node.type !== "TSTypeLiteral") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isTSArrayType(node, opts) {
      if (!node) return false;
      if (node.type !== "TSArrayType") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isTSTupleType(node, opts) {
      if (!node) return false;
      if (node.type !== "TSTupleType") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isTSOptionalType(node, opts) {
      if (!node) return false;
      if (node.type !== "TSOptionalType") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isTSRestType(node, opts) {
      if (!node) return false;
      if (node.type !== "TSRestType") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isTSNamedTupleMember(node, opts) {
      if (!node) return false;
      if (node.type !== "TSNamedTupleMember") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isTSUnionType(node, opts) {
      if (!node) return false;
      if (node.type !== "TSUnionType") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isTSIntersectionType(node, opts) {
      if (!node) return false;
      if (node.type !== "TSIntersectionType") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isTSConditionalType(node, opts) {
      if (!node) return false;
      if (node.type !== "TSConditionalType") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isTSInferType(node, opts) {
      if (!node) return false;
      if (node.type !== "TSInferType") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isTSParenthesizedType(node, opts) {
      if (!node) return false;
      if (node.type !== "TSParenthesizedType") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isTSTypeOperator(node, opts) {
      if (!node) return false;
      if (node.type !== "TSTypeOperator") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isTSIndexedAccessType(node, opts) {
      if (!node) return false;
      if (node.type !== "TSIndexedAccessType") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isTSMappedType(node, opts) {
      if (!node) return false;
      if (node.type !== "TSMappedType") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isTSTemplateLiteralType(node, opts) {
      if (!node) return false;
      if (node.type !== "TSTemplateLiteralType") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isTSLiteralType(node, opts) {
      if (!node) return false;
      if (node.type !== "TSLiteralType") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isTSExpressionWithTypeArguments(node, opts) {
      if (!node) return false;
      if (node.type !== "TSExpressionWithTypeArguments") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isTSInterfaceDeclaration(node, opts) {
      if (!node) return false;
      if (node.type !== "TSInterfaceDeclaration") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isTSInterfaceBody(node, opts) {
      if (!node) return false;
      if (node.type !== "TSInterfaceBody") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isTSTypeAliasDeclaration(node, opts) {
      if (!node) return false;
      if (node.type !== "TSTypeAliasDeclaration") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isTSInstantiationExpression(node, opts) {
      if (!node) return false;
      if (node.type !== "TSInstantiationExpression") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isTSAsExpression(node, opts) {
      if (!node) return false;
      if (node.type !== "TSAsExpression") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isTSSatisfiesExpression(node, opts) {
      if (!node) return false;
      if (node.type !== "TSSatisfiesExpression") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isTSTypeAssertion(node, opts) {
      if (!node) return false;
      if (node.type !== "TSTypeAssertion") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isTSEnumBody(node, opts) {
      if (!node) return false;
      if (node.type !== "TSEnumBody") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isTSEnumDeclaration(node, opts) {
      if (!node) return false;
      if (node.type !== "TSEnumDeclaration") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isTSEnumMember(node, opts) {
      if (!node) return false;
      if (node.type !== "TSEnumMember") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isTSModuleDeclaration(node, opts) {
      if (!node) return false;
      if (node.type !== "TSModuleDeclaration") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isTSModuleBlock(node, opts) {
      if (!node) return false;
      if (node.type !== "TSModuleBlock") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isTSImportType(node, opts) {
      if (!node) return false;
      if (node.type !== "TSImportType") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isTSImportEqualsDeclaration(node, opts) {
      if (!node) return false;
      if (node.type !== "TSImportEqualsDeclaration") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isTSExternalModuleReference(node, opts) {
      if (!node) return false;
      if (node.type !== "TSExternalModuleReference") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isTSNonNullExpression(node, opts) {
      if (!node) return false;
      if (node.type !== "TSNonNullExpression") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isTSExportAssignment(node, opts) {
      if (!node) return false;
      if (node.type !== "TSExportAssignment") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isTSNamespaceExportDeclaration(node, opts) {
      if (!node) return false;
      if (node.type !== "TSNamespaceExportDeclaration") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isTSTypeAnnotation(node, opts) {
      if (!node) return false;
      if (node.type !== "TSTypeAnnotation") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isTSTypeParameterInstantiation(node, opts) {
      if (!node) return false;
      if (node.type !== "TSTypeParameterInstantiation") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isTSTypeParameterDeclaration(node, opts) {
      if (!node) return false;
      if (node.type !== "TSTypeParameterDeclaration") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isTSTypeParameter(node, opts) {
      if (!node) return false;
      if (node.type !== "TSTypeParameter") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isStandardized(node, opts) {
      if (!node) return false;
      switch (node.type) {
        case "ArrayExpression":
        case "AssignmentExpression":
        case "BinaryExpression":
        case "InterpreterDirective":
        case "Directive":
        case "DirectiveLiteral":
        case "BlockStatement":
        case "BreakStatement":
        case "CallExpression":
        case "CatchClause":
        case "ConditionalExpression":
        case "ContinueStatement":
        case "DebuggerStatement":
        case "DoWhileStatement":
        case "EmptyStatement":
        case "ExpressionStatement":
        case "File":
        case "ForInStatement":
        case "ForStatement":
        case "FunctionDeclaration":
        case "FunctionExpression":
        case "Identifier":
        case "IfStatement":
        case "LabeledStatement":
        case "StringLiteral":
        case "NumericLiteral":
        case "NullLiteral":
        case "BooleanLiteral":
        case "RegExpLiteral":
        case "LogicalExpression":
        case "MemberExpression":
        case "NewExpression":
        case "Program":
        case "ObjectExpression":
        case "ObjectMethod":
        case "ObjectProperty":
        case "RestElement":
        case "ReturnStatement":
        case "SequenceExpression":
        case "ParenthesizedExpression":
        case "SwitchCase":
        case "SwitchStatement":
        case "ThisExpression":
        case "ThrowStatement":
        case "TryStatement":
        case "UnaryExpression":
        case "UpdateExpression":
        case "VariableDeclaration":
        case "VariableDeclarator":
        case "WhileStatement":
        case "WithStatement":
        case "AssignmentPattern":
        case "ArrayPattern":
        case "ArrowFunctionExpression":
        case "ClassBody":
        case "ClassExpression":
        case "ClassDeclaration":
        case "ExportAllDeclaration":
        case "ExportDefaultDeclaration":
        case "ExportNamedDeclaration":
        case "ExportSpecifier":
        case "ForOfStatement":
        case "ImportDeclaration":
        case "ImportDefaultSpecifier":
        case "ImportNamespaceSpecifier":
        case "ImportSpecifier":
        case "ImportExpression":
        case "MetaProperty":
        case "ClassMethod":
        case "ObjectPattern":
        case "SpreadElement":
        case "Super":
        case "TaggedTemplateExpression":
        case "TemplateElement":
        case "TemplateLiteral":
        case "YieldExpression":
        case "AwaitExpression":
        case "Import":
        case "BigIntLiteral":
        case "ExportNamespaceSpecifier":
        case "OptionalMemberExpression":
        case "OptionalCallExpression":
        case "ClassProperty":
        case "ClassAccessorProperty":
        case "ClassPrivateProperty":
        case "ClassPrivateMethod":
        case "PrivateName":
        case "StaticBlock":
        case "ImportAttribute":
          break;
        case "Placeholder":
          switch (node.expectedNode) {
            case "Identifier":
            case "StringLiteral":
            case "BlockStatement":
            case "ClassBody":
              break;
            default:
              return false;
          }
          break;
        default:
          return false;
      }
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isExpression(node, opts) {
      if (!node) return false;
      switch (node.type) {
        case "ArrayExpression":
        case "AssignmentExpression":
        case "BinaryExpression":
        case "CallExpression":
        case "ConditionalExpression":
        case "FunctionExpression":
        case "Identifier":
        case "StringLiteral":
        case "NumericLiteral":
        case "NullLiteral":
        case "BooleanLiteral":
        case "RegExpLiteral":
        case "LogicalExpression":
        case "MemberExpression":
        case "NewExpression":
        case "ObjectExpression":
        case "SequenceExpression":
        case "ParenthesizedExpression":
        case "ThisExpression":
        case "UnaryExpression":
        case "UpdateExpression":
        case "ArrowFunctionExpression":
        case "ClassExpression":
        case "ImportExpression":
        case "MetaProperty":
        case "Super":
        case "TaggedTemplateExpression":
        case "TemplateLiteral":
        case "YieldExpression":
        case "AwaitExpression":
        case "Import":
        case "BigIntLiteral":
        case "OptionalMemberExpression":
        case "OptionalCallExpression":
        case "TypeCastExpression":
        case "JSXElement":
        case "JSXFragment":
        case "BindExpression":
        case "DoExpression":
        case "RecordExpression":
        case "TupleExpression":
        case "DecimalLiteral":
        case "ModuleExpression":
        case "TopicReference":
        case "PipelineTopicExpression":
        case "PipelineBareFunction":
        case "PipelinePrimaryTopicReference":
        case "TSInstantiationExpression":
        case "TSAsExpression":
        case "TSSatisfiesExpression":
        case "TSTypeAssertion":
        case "TSNonNullExpression":
          break;
        case "Placeholder":
          switch (node.expectedNode) {
            case "Expression":
            case "Identifier":
            case "StringLiteral":
              break;
            default:
              return false;
          }
          break;
        default:
          return false;
      }
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isBinary(node, opts) {
      if (!node) return false;
      switch (node.type) {
        case "BinaryExpression":
        case "LogicalExpression":
          break;
        default:
          return false;
      }
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isScopable(node, opts) {
      if (!node) return false;
      switch (node.type) {
        case "BlockStatement":
        case "CatchClause":
        case "DoWhileStatement":
        case "ForInStatement":
        case "ForStatement":
        case "FunctionDeclaration":
        case "FunctionExpression":
        case "Program":
        case "ObjectMethod":
        case "SwitchStatement":
        case "WhileStatement":
        case "ArrowFunctionExpression":
        case "ClassExpression":
        case "ClassDeclaration":
        case "ForOfStatement":
        case "ClassMethod":
        case "ClassPrivateMethod":
        case "StaticBlock":
        case "TSModuleBlock":
          break;
        case "Placeholder":
          if (node.expectedNode === "BlockStatement") break;
        default:
          return false;
      }
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isBlockParent(node, opts) {
      if (!node) return false;
      switch (node.type) {
        case "BlockStatement":
        case "CatchClause":
        case "DoWhileStatement":
        case "ForInStatement":
        case "ForStatement":
        case "FunctionDeclaration":
        case "FunctionExpression":
        case "Program":
        case "ObjectMethod":
        case "SwitchStatement":
        case "WhileStatement":
        case "ArrowFunctionExpression":
        case "ForOfStatement":
        case "ClassMethod":
        case "ClassPrivateMethod":
        case "StaticBlock":
        case "TSModuleBlock":
          break;
        case "Placeholder":
          if (node.expectedNode === "BlockStatement") break;
        default:
          return false;
      }
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isBlock(node, opts) {
      if (!node) return false;
      switch (node.type) {
        case "BlockStatement":
        case "Program":
        case "TSModuleBlock":
          break;
        case "Placeholder":
          if (node.expectedNode === "BlockStatement") break;
        default:
          return false;
      }
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isStatement(node, opts) {
      if (!node) return false;
      switch (node.type) {
        case "BlockStatement":
        case "BreakStatement":
        case "ContinueStatement":
        case "DebuggerStatement":
        case "DoWhileStatement":
        case "EmptyStatement":
        case "ExpressionStatement":
        case "ForInStatement":
        case "ForStatement":
        case "FunctionDeclaration":
        case "IfStatement":
        case "LabeledStatement":
        case "ReturnStatement":
        case "SwitchStatement":
        case "ThrowStatement":
        case "TryStatement":
        case "VariableDeclaration":
        case "WhileStatement":
        case "WithStatement":
        case "ClassDeclaration":
        case "ExportAllDeclaration":
        case "ExportDefaultDeclaration":
        case "ExportNamedDeclaration":
        case "ForOfStatement":
        case "ImportDeclaration":
        case "DeclareClass":
        case "DeclareFunction":
        case "DeclareInterface":
        case "DeclareModule":
        case "DeclareModuleExports":
        case "DeclareTypeAlias":
        case "DeclareOpaqueType":
        case "DeclareVariable":
        case "DeclareExportDeclaration":
        case "DeclareExportAllDeclaration":
        case "InterfaceDeclaration":
        case "OpaqueType":
        case "TypeAlias":
        case "EnumDeclaration":
        case "TSDeclareFunction":
        case "TSInterfaceDeclaration":
        case "TSTypeAliasDeclaration":
        case "TSEnumDeclaration":
        case "TSModuleDeclaration":
        case "TSImportEqualsDeclaration":
        case "TSExportAssignment":
        case "TSNamespaceExportDeclaration":
          break;
        case "Placeholder":
          switch (node.expectedNode) {
            case "Statement":
            case "Declaration":
            case "BlockStatement":
              break;
            default:
              return false;
          }
          break;
        default:
          return false;
      }
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isTerminatorless(node, opts) {
      if (!node) return false;
      switch (node.type) {
        case "BreakStatement":
        case "ContinueStatement":
        case "ReturnStatement":
        case "ThrowStatement":
        case "YieldExpression":
        case "AwaitExpression":
          break;
        default:
          return false;
      }
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isCompletionStatement(node, opts) {
      if (!node) return false;
      switch (node.type) {
        case "BreakStatement":
        case "ContinueStatement":
        case "ReturnStatement":
        case "ThrowStatement":
          break;
        default:
          return false;
      }
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isConditional(node, opts) {
      if (!node) return false;
      switch (node.type) {
        case "ConditionalExpression":
        case "IfStatement":
          break;
        default:
          return false;
      }
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isLoop(node, opts) {
      if (!node) return false;
      switch (node.type) {
        case "DoWhileStatement":
        case "ForInStatement":
        case "ForStatement":
        case "WhileStatement":
        case "ForOfStatement":
          break;
        default:
          return false;
      }
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isWhile(node, opts) {
      if (!node) return false;
      switch (node.type) {
        case "DoWhileStatement":
        case "WhileStatement":
          break;
        default:
          return false;
      }
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isExpressionWrapper(node, opts) {
      if (!node) return false;
      switch (node.type) {
        case "ExpressionStatement":
        case "ParenthesizedExpression":
        case "TypeCastExpression":
          break;
        default:
          return false;
      }
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isFor(node, opts) {
      if (!node) return false;
      switch (node.type) {
        case "ForInStatement":
        case "ForStatement":
        case "ForOfStatement":
          break;
        default:
          return false;
      }
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isForXStatement(node, opts) {
      if (!node) return false;
      switch (node.type) {
        case "ForInStatement":
        case "ForOfStatement":
          break;
        default:
          return false;
      }
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isFunction(node, opts) {
      if (!node) return false;
      switch (node.type) {
        case "FunctionDeclaration":
        case "FunctionExpression":
        case "ObjectMethod":
        case "ArrowFunctionExpression":
        case "ClassMethod":
        case "ClassPrivateMethod":
          break;
        default:
          return false;
      }
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isFunctionParent(node, opts) {
      if (!node) return false;
      switch (node.type) {
        case "FunctionDeclaration":
        case "FunctionExpression":
        case "ObjectMethod":
        case "ArrowFunctionExpression":
        case "ClassMethod":
        case "ClassPrivateMethod":
        case "StaticBlock":
        case "TSModuleBlock":
          break;
        default:
          return false;
      }
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isPureish(node, opts) {
      if (!node) return false;
      switch (node.type) {
        case "FunctionDeclaration":
        case "FunctionExpression":
        case "StringLiteral":
        case "NumericLiteral":
        case "NullLiteral":
        case "BooleanLiteral":
        case "RegExpLiteral":
        case "ArrowFunctionExpression":
        case "BigIntLiteral":
        case "DecimalLiteral":
          break;
        case "Placeholder":
          if (node.expectedNode === "StringLiteral") break;
        default:
          return false;
      }
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isDeclaration(node, opts) {
      if (!node) return false;
      switch (node.type) {
        case "FunctionDeclaration":
        case "VariableDeclaration":
        case "ClassDeclaration":
        case "ExportAllDeclaration":
        case "ExportDefaultDeclaration":
        case "ExportNamedDeclaration":
        case "ImportDeclaration":
        case "DeclareClass":
        case "DeclareFunction":
        case "DeclareInterface":
        case "DeclareModule":
        case "DeclareModuleExports":
        case "DeclareTypeAlias":
        case "DeclareOpaqueType":
        case "DeclareVariable":
        case "DeclareExportDeclaration":
        case "DeclareExportAllDeclaration":
        case "InterfaceDeclaration":
        case "OpaqueType":
        case "TypeAlias":
        case "EnumDeclaration":
        case "TSDeclareFunction":
        case "TSInterfaceDeclaration":
        case "TSTypeAliasDeclaration":
        case "TSEnumDeclaration":
        case "TSModuleDeclaration":
        case "TSImportEqualsDeclaration":
          break;
        case "Placeholder":
          if (node.expectedNode === "Declaration") break;
        default:
          return false;
      }
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isFunctionParameter(node, opts) {
      if (!node) return false;
      switch (node.type) {
        case "Identifier":
        case "RestElement":
        case "AssignmentPattern":
        case "ArrayPattern":
        case "ObjectPattern":
        case "VoidPattern":
          break;
        case "Placeholder":
          if (node.expectedNode === "Identifier") break;
        default:
          return false;
      }
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isPatternLike(node, opts) {
      if (!node) return false;
      switch (node.type) {
        case "Identifier":
        case "MemberExpression":
        case "RestElement":
        case "AssignmentPattern":
        case "ArrayPattern":
        case "ObjectPattern":
        case "VoidPattern":
        case "TSAsExpression":
        case "TSSatisfiesExpression":
        case "TSTypeAssertion":
        case "TSNonNullExpression":
          break;
        case "Placeholder":
          switch (node.expectedNode) {
            case "Pattern":
            case "Identifier":
              break;
            default:
              return false;
          }
          break;
        default:
          return false;
      }
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isLVal(node, opts) {
      if (!node) return false;
      switch (node.type) {
        case "Identifier":
        case "MemberExpression":
        case "RestElement":
        case "AssignmentPattern":
        case "ArrayPattern":
        case "ObjectPattern":
        case "TSParameterProperty":
        case "TSAsExpression":
        case "TSSatisfiesExpression":
        case "TSTypeAssertion":
        case "TSNonNullExpression":
          break;
        case "Placeholder":
          switch (node.expectedNode) {
            case "Pattern":
            case "Identifier":
              break;
            default:
              return false;
          }
          break;
        default:
          return false;
      }
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isTSEntityName(node, opts) {
      if (!node) return false;
      switch (node.type) {
        case "Identifier":
        case "TSQualifiedName":
          break;
        case "Placeholder":
          if (node.expectedNode === "Identifier") break;
        default:
          return false;
      }
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isLiteral(node, opts) {
      if (!node) return false;
      switch (node.type) {
        case "StringLiteral":
        case "NumericLiteral":
        case "NullLiteral":
        case "BooleanLiteral":
        case "RegExpLiteral":
        case "TemplateLiteral":
        case "BigIntLiteral":
        case "DecimalLiteral":
          break;
        case "Placeholder":
          if (node.expectedNode === "StringLiteral") break;
        default:
          return false;
      }
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isImmutable(node, opts) {
      if (!node) return false;
      switch (node.type) {
        case "StringLiteral":
        case "NumericLiteral":
        case "NullLiteral":
        case "BooleanLiteral":
        case "BigIntLiteral":
        case "JSXAttribute":
        case "JSXClosingElement":
        case "JSXElement":
        case "JSXExpressionContainer":
        case "JSXSpreadChild":
        case "JSXOpeningElement":
        case "JSXText":
        case "JSXFragment":
        case "JSXOpeningFragment":
        case "JSXClosingFragment":
        case "DecimalLiteral":
          break;
        case "Placeholder":
          if (node.expectedNode === "StringLiteral") break;
        default:
          return false;
      }
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isUserWhitespacable(node, opts) {
      if (!node) return false;
      switch (node.type) {
        case "ObjectMethod":
        case "ObjectProperty":
        case "ObjectTypeInternalSlot":
        case "ObjectTypeCallProperty":
        case "ObjectTypeIndexer":
        case "ObjectTypeProperty":
        case "ObjectTypeSpreadProperty":
          break;
        default:
          return false;
      }
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isMethod(node, opts) {
      if (!node) return false;
      switch (node.type) {
        case "ObjectMethod":
        case "ClassMethod":
        case "ClassPrivateMethod":
          break;
        default:
          return false;
      }
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isObjectMember(node, opts) {
      if (!node) return false;
      switch (node.type) {
        case "ObjectMethod":
        case "ObjectProperty":
          break;
        default:
          return false;
      }
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isProperty(node, opts) {
      if (!node) return false;
      switch (node.type) {
        case "ObjectProperty":
        case "ClassProperty":
        case "ClassAccessorProperty":
        case "ClassPrivateProperty":
          break;
        default:
          return false;
      }
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isUnaryLike(node, opts) {
      if (!node) return false;
      switch (node.type) {
        case "UnaryExpression":
        case "SpreadElement":
          break;
        default:
          return false;
      }
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isPattern(node, opts) {
      if (!node) return false;
      switch (node.type) {
        case "AssignmentPattern":
        case "ArrayPattern":
        case "ObjectPattern":
        case "VoidPattern":
          break;
        case "Placeholder":
          if (node.expectedNode === "Pattern") break;
        default:
          return false;
      }
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isClass(node, opts) {
      if (!node) return false;
      switch (node.type) {
        case "ClassExpression":
        case "ClassDeclaration":
          break;
        default:
          return false;
      }
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isImportOrExportDeclaration(node, opts) {
      if (!node) return false;
      switch (node.type) {
        case "ExportAllDeclaration":
        case "ExportDefaultDeclaration":
        case "ExportNamedDeclaration":
        case "ImportDeclaration":
          break;
        default:
          return false;
      }
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isExportDeclaration(node, opts) {
      if (!node) return false;
      switch (node.type) {
        case "ExportAllDeclaration":
        case "ExportDefaultDeclaration":
        case "ExportNamedDeclaration":
          break;
        default:
          return false;
      }
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isModuleSpecifier(node, opts) {
      if (!node) return false;
      switch (node.type) {
        case "ExportSpecifier":
        case "ImportDefaultSpecifier":
        case "ImportNamespaceSpecifier":
        case "ImportSpecifier":
        case "ExportNamespaceSpecifier":
        case "ExportDefaultSpecifier":
          break;
        default:
          return false;
      }
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isAccessor(node, opts) {
      if (!node) return false;
      switch (node.type) {
        case "ClassAccessorProperty":
          break;
        default:
          return false;
      }
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isPrivate(node, opts) {
      if (!node) return false;
      switch (node.type) {
        case "ClassPrivateProperty":
        case "ClassPrivateMethod":
        case "PrivateName":
          break;
        default:
          return false;
      }
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isFlow(node, opts) {
      if (!node) return false;
      switch (node.type) {
        case "AnyTypeAnnotation":
        case "ArrayTypeAnnotation":
        case "BooleanTypeAnnotation":
        case "BooleanLiteralTypeAnnotation":
        case "NullLiteralTypeAnnotation":
        case "ClassImplements":
        case "DeclareClass":
        case "DeclareFunction":
        case "DeclareInterface":
        case "DeclareModule":
        case "DeclareModuleExports":
        case "DeclareTypeAlias":
        case "DeclareOpaqueType":
        case "DeclareVariable":
        case "DeclareExportDeclaration":
        case "DeclareExportAllDeclaration":
        case "DeclaredPredicate":
        case "ExistsTypeAnnotation":
        case "FunctionTypeAnnotation":
        case "FunctionTypeParam":
        case "GenericTypeAnnotation":
        case "InferredPredicate":
        case "InterfaceExtends":
        case "InterfaceDeclaration":
        case "InterfaceTypeAnnotation":
        case "IntersectionTypeAnnotation":
        case "MixedTypeAnnotation":
        case "EmptyTypeAnnotation":
        case "NullableTypeAnnotation":
        case "NumberLiteralTypeAnnotation":
        case "NumberTypeAnnotation":
        case "ObjectTypeAnnotation":
        case "ObjectTypeInternalSlot":
        case "ObjectTypeCallProperty":
        case "ObjectTypeIndexer":
        case "ObjectTypeProperty":
        case "ObjectTypeSpreadProperty":
        case "OpaqueType":
        case "QualifiedTypeIdentifier":
        case "StringLiteralTypeAnnotation":
        case "StringTypeAnnotation":
        case "SymbolTypeAnnotation":
        case "ThisTypeAnnotation":
        case "TupleTypeAnnotation":
        case "TypeofTypeAnnotation":
        case "TypeAlias":
        case "TypeAnnotation":
        case "TypeCastExpression":
        case "TypeParameter":
        case "TypeParameterDeclaration":
        case "TypeParameterInstantiation":
        case "UnionTypeAnnotation":
        case "Variance":
        case "VoidTypeAnnotation":
        case "EnumDeclaration":
        case "EnumBooleanBody":
        case "EnumNumberBody":
        case "EnumStringBody":
        case "EnumSymbolBody":
        case "EnumBooleanMember":
        case "EnumNumberMember":
        case "EnumStringMember":
        case "EnumDefaultedMember":
        case "IndexedAccessType":
        case "OptionalIndexedAccessType":
          break;
        default:
          return false;
      }
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isFlowType(node, opts) {
      if (!node) return false;
      switch (node.type) {
        case "AnyTypeAnnotation":
        case "ArrayTypeAnnotation":
        case "BooleanTypeAnnotation":
        case "BooleanLiteralTypeAnnotation":
        case "NullLiteralTypeAnnotation":
        case "ExistsTypeAnnotation":
        case "FunctionTypeAnnotation":
        case "GenericTypeAnnotation":
        case "InterfaceTypeAnnotation":
        case "IntersectionTypeAnnotation":
        case "MixedTypeAnnotation":
        case "EmptyTypeAnnotation":
        case "NullableTypeAnnotation":
        case "NumberLiteralTypeAnnotation":
        case "NumberTypeAnnotation":
        case "ObjectTypeAnnotation":
        case "StringLiteralTypeAnnotation":
        case "StringTypeAnnotation":
        case "SymbolTypeAnnotation":
        case "ThisTypeAnnotation":
        case "TupleTypeAnnotation":
        case "TypeofTypeAnnotation":
        case "UnionTypeAnnotation":
        case "VoidTypeAnnotation":
        case "IndexedAccessType":
        case "OptionalIndexedAccessType":
          break;
        default:
          return false;
      }
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isFlowBaseAnnotation(node, opts) {
      if (!node) return false;
      switch (node.type) {
        case "AnyTypeAnnotation":
        case "BooleanTypeAnnotation":
        case "NullLiteralTypeAnnotation":
        case "MixedTypeAnnotation":
        case "EmptyTypeAnnotation":
        case "NumberTypeAnnotation":
        case "StringTypeAnnotation":
        case "SymbolTypeAnnotation":
        case "ThisTypeAnnotation":
        case "VoidTypeAnnotation":
          break;
        default:
          return false;
      }
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isFlowDeclaration(node, opts) {
      if (!node) return false;
      switch (node.type) {
        case "DeclareClass":
        case "DeclareFunction":
        case "DeclareInterface":
        case "DeclareModule":
        case "DeclareModuleExports":
        case "DeclareTypeAlias":
        case "DeclareOpaqueType":
        case "DeclareVariable":
        case "DeclareExportDeclaration":
        case "DeclareExportAllDeclaration":
        case "InterfaceDeclaration":
        case "OpaqueType":
        case "TypeAlias":
          break;
        default:
          return false;
      }
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isFlowPredicate(node, opts) {
      if (!node) return false;
      switch (node.type) {
        case "DeclaredPredicate":
        case "InferredPredicate":
          break;
        default:
          return false;
      }
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isEnumBody(node, opts) {
      if (!node) return false;
      switch (node.type) {
        case "EnumBooleanBody":
        case "EnumNumberBody":
        case "EnumStringBody":
        case "EnumSymbolBody":
          break;
        default:
          return false;
      }
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isEnumMember(node, opts) {
      if (!node) return false;
      switch (node.type) {
        case "EnumBooleanMember":
        case "EnumNumberMember":
        case "EnumStringMember":
        case "EnumDefaultedMember":
          break;
        default:
          return false;
      }
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isJSX(node, opts) {
      if (!node) return false;
      switch (node.type) {
        case "JSXAttribute":
        case "JSXClosingElement":
        case "JSXElement":
        case "JSXEmptyExpression":
        case "JSXExpressionContainer":
        case "JSXSpreadChild":
        case "JSXIdentifier":
        case "JSXMemberExpression":
        case "JSXNamespacedName":
        case "JSXOpeningElement":
        case "JSXSpreadAttribute":
        case "JSXText":
        case "JSXFragment":
        case "JSXOpeningFragment":
        case "JSXClosingFragment":
          break;
        default:
          return false;
      }
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isMiscellaneous(node, opts) {
      if (!node) return false;
      switch (node.type) {
        case "Noop":
        case "Placeholder":
        case "V8IntrinsicIdentifier":
          break;
        default:
          return false;
      }
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isTypeScript2(node, opts) {
      if (!node) return false;
      switch (node.type) {
        case "TSParameterProperty":
        case "TSDeclareFunction":
        case "TSDeclareMethod":
        case "TSQualifiedName":
        case "TSCallSignatureDeclaration":
        case "TSConstructSignatureDeclaration":
        case "TSPropertySignature":
        case "TSMethodSignature":
        case "TSIndexSignature":
        case "TSAnyKeyword":
        case "TSBooleanKeyword":
        case "TSBigIntKeyword":
        case "TSIntrinsicKeyword":
        case "TSNeverKeyword":
        case "TSNullKeyword":
        case "TSNumberKeyword":
        case "TSObjectKeyword":
        case "TSStringKeyword":
        case "TSSymbolKeyword":
        case "TSUndefinedKeyword":
        case "TSUnknownKeyword":
        case "TSVoidKeyword":
        case "TSThisType":
        case "TSFunctionType":
        case "TSConstructorType":
        case "TSTypeReference":
        case "TSTypePredicate":
        case "TSTypeQuery":
        case "TSTypeLiteral":
        case "TSArrayType":
        case "TSTupleType":
        case "TSOptionalType":
        case "TSRestType":
        case "TSNamedTupleMember":
        case "TSUnionType":
        case "TSIntersectionType":
        case "TSConditionalType":
        case "TSInferType":
        case "TSParenthesizedType":
        case "TSTypeOperator":
        case "TSIndexedAccessType":
        case "TSMappedType":
        case "TSTemplateLiteralType":
        case "TSLiteralType":
        case "TSExpressionWithTypeArguments":
        case "TSInterfaceDeclaration":
        case "TSInterfaceBody":
        case "TSTypeAliasDeclaration":
        case "TSInstantiationExpression":
        case "TSAsExpression":
        case "TSSatisfiesExpression":
        case "TSTypeAssertion":
        case "TSEnumBody":
        case "TSEnumDeclaration":
        case "TSEnumMember":
        case "TSModuleDeclaration":
        case "TSModuleBlock":
        case "TSImportType":
        case "TSImportEqualsDeclaration":
        case "TSExternalModuleReference":
        case "TSNonNullExpression":
        case "TSExportAssignment":
        case "TSNamespaceExportDeclaration":
        case "TSTypeAnnotation":
        case "TSTypeParameterInstantiation":
        case "TSTypeParameterDeclaration":
        case "TSTypeParameter":
          break;
        default:
          return false;
      }
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isTSTypeElement(node, opts) {
      if (!node) return false;
      switch (node.type) {
        case "TSCallSignatureDeclaration":
        case "TSConstructSignatureDeclaration":
        case "TSPropertySignature":
        case "TSMethodSignature":
        case "TSIndexSignature":
          break;
        default:
          return false;
      }
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isTSType(node, opts) {
      if (!node) return false;
      switch (node.type) {
        case "TSAnyKeyword":
        case "TSBooleanKeyword":
        case "TSBigIntKeyword":
        case "TSIntrinsicKeyword":
        case "TSNeverKeyword":
        case "TSNullKeyword":
        case "TSNumberKeyword":
        case "TSObjectKeyword":
        case "TSStringKeyword":
        case "TSSymbolKeyword":
        case "TSUndefinedKeyword":
        case "TSUnknownKeyword":
        case "TSVoidKeyword":
        case "TSThisType":
        case "TSFunctionType":
        case "TSConstructorType":
        case "TSTypeReference":
        case "TSTypePredicate":
        case "TSTypeQuery":
        case "TSTypeLiteral":
        case "TSArrayType":
        case "TSTupleType":
        case "TSOptionalType":
        case "TSRestType":
        case "TSUnionType":
        case "TSIntersectionType":
        case "TSConditionalType":
        case "TSInferType":
        case "TSParenthesizedType":
        case "TSTypeOperator":
        case "TSIndexedAccessType":
        case "TSMappedType":
        case "TSTemplateLiteralType":
        case "TSLiteralType":
        case "TSExpressionWithTypeArguments":
        case "TSImportType":
          break;
        default:
          return false;
      }
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isTSBaseType(node, opts) {
      if (!node) return false;
      switch (node.type) {
        case "TSAnyKeyword":
        case "TSBooleanKeyword":
        case "TSBigIntKeyword":
        case "TSIntrinsicKeyword":
        case "TSNeverKeyword":
        case "TSNullKeyword":
        case "TSNumberKeyword":
        case "TSObjectKeyword":
        case "TSStringKeyword":
        case "TSSymbolKeyword":
        case "TSUndefinedKeyword":
        case "TSUnknownKeyword":
        case "TSVoidKeyword":
        case "TSThisType":
        case "TSTemplateLiteralType":
        case "TSLiteralType":
          break;
        default:
          return false;
      }
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isNumberLiteral(node, opts) {
      (0, _deprecationWarning.default)("isNumberLiteral", "isNumericLiteral");
      if (!node) return false;
      if (node.type !== "NumberLiteral") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isRegexLiteral(node, opts) {
      (0, _deprecationWarning.default)("isRegexLiteral", "isRegExpLiteral");
      if (!node) return false;
      if (node.type !== "RegexLiteral") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isRestProperty(node, opts) {
      (0, _deprecationWarning.default)("isRestProperty", "isRestElement");
      if (!node) return false;
      if (node.type !== "RestProperty") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isSpreadProperty(node, opts) {
      (0, _deprecationWarning.default)("isSpreadProperty", "isSpreadElement");
      if (!node) return false;
      if (node.type !== "SpreadProperty") return false;
      return opts == null || (0, _shallowEqual.default)(node, opts);
    }
    function isModuleDeclaration(node, opts) {
      (0, _deprecationWarning.default)("isModuleDeclaration", "isImportOrExportDeclaration");
      return isImportOrExportDeclaration(node, opts);
    }
  }
});

// node_modules/@babel/types/lib/validators/matchesPattern.js
var require_matchesPattern = __commonJS({
  "node_modules/@babel/types/lib/validators/matchesPattern.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = matchesPattern;
    var _index = require_generated();
    function isMemberExpressionLike(node) {
      return (0, _index.isMemberExpression)(node) || (0, _index.isMetaProperty)(node);
    }
    function matchesPattern(member, match, allowPartial) {
      if (!isMemberExpressionLike(member)) return false;
      const parts = Array.isArray(match) ? match : match.split(".");
      const nodes = [];
      let node;
      for (node = member; isMemberExpressionLike(node); node = (_object = node.object) != null ? _object : node.meta) {
        var _object;
        nodes.push(node.property);
      }
      nodes.push(node);
      if (nodes.length < parts.length) return false;
      if (!allowPartial && nodes.length > parts.length) return false;
      for (let i = 0, j = nodes.length - 1; i < parts.length; i++, j--) {
        const node2 = nodes[j];
        let value2;
        if ((0, _index.isIdentifier)(node2)) {
          value2 = node2.name;
        } else if ((0, _index.isStringLiteral)(node2)) {
          value2 = node2.value;
        } else if ((0, _index.isThisExpression)(node2)) {
          value2 = "this";
        } else if ((0, _index.isSuper)(node2)) {
          value2 = "super";
        } else if ((0, _index.isPrivateName)(node2)) {
          value2 = "#" + node2.id.name;
        } else {
          return false;
        }
        if (parts[i] !== value2) return false;
      }
      return true;
    }
  }
});

// node_modules/@babel/types/lib/validators/buildMatchMemberExpression.js
var require_buildMatchMemberExpression = __commonJS({
  "node_modules/@babel/types/lib/validators/buildMatchMemberExpression.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = buildMatchMemberExpression;
    var _matchesPattern = require_matchesPattern();
    function buildMatchMemberExpression(match, allowPartial) {
      const parts = match.split(".");
      return (member) => (0, _matchesPattern.default)(member, parts, allowPartial);
    }
  }
});

// node_modules/@babel/types/lib/validators/react/isReactComponent.js
var require_isReactComponent = __commonJS({
  "node_modules/@babel/types/lib/validators/react/isReactComponent.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = void 0;
    var _buildMatchMemberExpression = require_buildMatchMemberExpression();
    var isReactComponent = (0, _buildMatchMemberExpression.default)("React.Component");
    var _default = exports2.default = isReactComponent;
  }
});

// node_modules/@babel/types/lib/validators/react/isCompatTag.js
var require_isCompatTag = __commonJS({
  "node_modules/@babel/types/lib/validators/react/isCompatTag.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = isCompatTag;
    function isCompatTag(tagName) {
      return !!tagName && /^[a-z]/.test(tagName);
    }
  }
});

// node_modules/@babel/types/lib/validators/isType.js
var require_isType = __commonJS({
  "node_modules/@babel/types/lib/validators/isType.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = isType;
    var _index = require_definitions();
    function isType(nodeType, targetType) {
      if (nodeType === targetType) return true;
      if (nodeType == null) return false;
      if (_index.ALIAS_KEYS[targetType]) return false;
      const aliases = _index.FLIPPED_ALIAS_KEYS[targetType];
      if (aliases != null && aliases.includes(nodeType)) return true;
      return false;
    }
  }
});

// node_modules/@babel/types/lib/validators/isPlaceholderType.js
var require_isPlaceholderType = __commonJS({
  "node_modules/@babel/types/lib/validators/isPlaceholderType.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = isPlaceholderType;
    var _index = require_definitions();
    function isPlaceholderType(placeholderType, targetType) {
      if (placeholderType === targetType) return true;
      const aliases = _index.PLACEHOLDERS_ALIAS[placeholderType];
      if (aliases != null && aliases.includes(targetType)) return true;
      return false;
    }
  }
});

// node_modules/@babel/types/lib/validators/is.js
var require_is = __commonJS({
  "node_modules/@babel/types/lib/validators/is.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = is;
    var _shallowEqual = require_shallowEqual();
    var _isType = require_isType();
    var _isPlaceholderType = require_isPlaceholderType();
    var _index = require_definitions();
    function is(type, node, opts) {
      if (!node) return false;
      const matches = (0, _isType.default)(node.type, type);
      if (!matches) {
        if (!opts && node.type === "Placeholder" && type in _index.FLIPPED_ALIAS_KEYS) {
          return (0, _isPlaceholderType.default)(node.expectedNode, type);
        }
        return false;
      }
      if (opts === void 0) {
        return true;
      } else {
        return (0, _shallowEqual.default)(node, opts);
      }
    }
  }
});

// node_modules/@babel/helper-validator-identifier/lib/identifier.js
var require_identifier = __commonJS({
  "node_modules/@babel/helper-validator-identifier/lib/identifier.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.isIdentifierChar = isIdentifierChar;
    exports2.isIdentifierName = isIdentifierName;
    exports2.isIdentifierStart = isIdentifierStart;
    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\u0870-\u0887\u0889-\u088F\u08A0-\u08C9\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\u0C5C\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDC-\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-\u1711\u171F-\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-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C8A\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-\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-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7DC\uA7F1-\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 = "\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\u0897-\u089F\u08CA-\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\u0C3C\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\u0CF3\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-\u0ECE\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-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1ADD\u1AE0-\u1AEB\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-\u1DFF\u200C\u200D\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\u30FB\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\uFF65";
    var nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]");
    var nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]");
    nonASCIIidentifierStartChars = nonASCIIidentifierChars = null;
    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, 13, 10, 2, 14, 2, 6, 2, 1, 2, 10, 2, 14, 2, 6, 2, 1, 4, 51, 13, 310, 10, 21, 11, 7, 25, 5, 2, 41, 2, 8, 70, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 7, 25, 39, 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, 39, 27, 10, 22, 251, 41, 7, 1, 17, 5, 57, 28, 11, 0, 9, 21, 43, 17, 47, 20, 28, 22, 13, 52, 58, 1, 3, 0, 14, 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, 20, 1, 64, 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, 31, 9, 2, 0, 3, 0, 2, 37, 2, 0, 26, 0, 2, 0, 45, 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, 38, 6, 186, 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, 19, 72, 200, 32, 32, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 24, 43, 261, 18, 16, 0, 2, 12, 2, 33, 125, 0, 80, 921, 103, 110, 18, 195, 2637, 96, 16, 1071, 18, 5, 26, 3994, 6, 582, 6842, 29, 1763, 568, 8, 30, 18, 78, 18, 29, 19, 47, 17, 3, 32, 20, 6, 18, 433, 44, 212, 63, 33, 24, 3, 24, 45, 74, 6, 0, 67, 12, 65, 1, 2, 0, 15, 4, 10, 7381, 42, 31, 98, 114, 8702, 3, 2, 6, 2, 1, 2, 290, 16, 0, 30, 2, 3, 0, 15, 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, 1845, 30, 7, 5, 262, 61, 147, 44, 11, 6, 17, 0, 322, 29, 19, 43, 485, 27, 229, 29, 3, 0, 208, 30, 2, 2, 2, 1, 2, 6, 3, 4, 10, 1, 225, 6, 2, 3, 2, 1, 2, 14, 2, 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, 42719, 33, 4381, 3, 5773, 3, 7472, 16, 621, 2467, 541, 1507, 4938, 6, 8489];
    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, 7, 9, 32, 4, 318, 1, 78, 5, 71, 10, 50, 3, 123, 2, 54, 14, 32, 10, 3, 1, 11, 3, 46, 10, 8, 0, 46, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 3, 0, 158, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 68, 8, 2, 0, 3, 0, 2, 3, 2, 4, 2, 0, 15, 1, 83, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 7, 19, 58, 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, 199, 7, 137, 9, 54, 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, 55, 9, 266, 3, 10, 1, 2, 0, 49, 6, 4, 4, 14, 10, 5350, 0, 7, 14, 11465, 27, 2343, 9, 87, 9, 39, 4, 60, 6, 26, 9, 535, 9, 470, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 4178, 9, 519, 45, 3, 22, 543, 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, 101, 0, 161, 6, 10, 9, 357, 0, 62, 13, 499, 13, 245, 1, 2, 9, 233, 0, 3, 0, 8, 1, 6, 0, 475, 6, 110, 6, 6, 9, 4759, 9, 787719, 239];
    function isInAstralSet(code, set) {
      let pos = 65536;
      for (let i = 0, length = set.length; i < length; i += 2) {
        pos += set[i];
        if (pos > code) return false;
        pos += set[i + 1];
        if (pos >= code) return true;
      }
      return false;
    }
    function isIdentifierStart(code) {
      if (code < 65) return code === 36;
      if (code <= 90) return true;
      if (code < 97) return code === 95;
      if (code <= 122) return true;
      if (code <= 65535) {
        return code >= 170 && nonASCIIidentifierStart.test(String.fromCharCode(code));
      }
      return isInAstralSet(code, astralIdentifierStartCodes);
    }
    function isIdentifierChar(code) {
      if (code < 48) return code === 36;
      if (code < 58) return true;
      if (code < 65) return false;
      if (code <= 90) return true;
      if (code < 97) return code === 95;
      if (code <= 122) return true;
      if (code <= 65535) {
        return code >= 170 && nonASCIIidentifier.test(String.fromCharCode(code));
      }
      return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes);
    }
    function isIdentifierName(name) {
      let isFirst = true;
      for (let i = 0; i < name.length; i++) {
        let cp = name.charCodeAt(i);
        if ((cp & 64512) === 55296 && i + 1 < name.length) {
          const trail = name.charCodeAt(++i);
          if ((trail & 64512) === 56320) {
            cp = 65536 + ((cp & 1023) << 10) + (trail & 1023);
          }
        }
        if (isFirst) {
          isFirst = false;
          if (!isIdentifierStart(cp)) {
            return false;
          }
        } else if (!isIdentifierChar(cp)) {
          return false;
        }
      }
      return !isFirst;
    }
  }
});

// node_modules/@babel/helper-validator-identifier/lib/keyword.js
var require_keyword = __commonJS({
  "node_modules/@babel/helper-validator-identifier/lib/keyword.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.isKeyword = isKeyword;
    exports2.isReservedWord = isReservedWord;
    exports2.isStrictBindOnlyReservedWord = isStrictBindOnlyReservedWord;
    exports2.isStrictBindReservedWord = isStrictBindReservedWord;
    exports2.isStrictReservedWord = isStrictReservedWord;
    var reservedWords = {
      keyword: ["break", "case", "catch", "continue", "debugger", "default", "do", "else", "finally", "for", "function", "if", "return", "switch", "throw", "try", "var", "const", "while", "with", "new", "this", "super", "class", "extends", "export", "import", "null", "true", "false", "in", "instanceof", "typeof", "void", "delete"],
      strict: ["implements", "interface", "let", "package", "private", "protected", "public", "static", "yield"],
      strictBind: ["eval", "arguments"]
    };
    var keywords = new Set(reservedWords.keyword);
    var reservedWordsStrictSet = new Set(reservedWords.strict);
    var reservedWordsStrictBindSet = new Set(reservedWords.strictBind);
    function isReservedWord(word, inModule) {
      return inModule && word === "await" || word === "enum";
    }
    function isStrictReservedWord(word, inModule) {
      return isReservedWord(word, inModule) || reservedWordsStrictSet.has(word);
    }
    function isStrictBindOnlyReservedWord(word) {
      return reservedWordsStrictBindSet.has(word);
    }
    function isStrictBindReservedWord(word, inModule) {
      return isStrictReservedWord(word, inModule) || isStrictBindOnlyReservedWord(word);
    }
    function isKeyword(word) {
      return keywords.has(word);
    }
  }
});

// node_modules/@babel/helper-validator-identifier/lib/index.js
var require_lib = __commonJS({
  "node_modules/@babel/helper-validator-identifier/lib/index.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    Object.defineProperty(exports2, "isIdentifierChar", {
      enumerable: true,
      get: function() {
        return _identifier.isIdentifierChar;
      }
    });
    Object.defineProperty(exports2, "isIdentifierName", {
      enumerable: true,
      get: function() {
        return _identifier.isIdentifierName;
      }
    });
    Object.defineProperty(exports2, "isIdentifierStart", {
      enumerable: true,
      get: function() {
        return _identifier.isIdentifierStart;
      }
    });
    Object.defineProperty(exports2, "isKeyword", {
      enumerable: true,
      get: function() {
        return _keyword.isKeyword;
      }
    });
    Object.defineProperty(exports2, "isReservedWord", {
      enumerable: true,
      get: function() {
        return _keyword.isReservedWord;
      }
    });
    Object.defineProperty(exports2, "isStrictBindOnlyReservedWord", {
      enumerable: true,
      get: function() {
        return _keyword.isStrictBindOnlyReservedWord;
      }
    });
    Object.defineProperty(exports2, "isStrictBindReservedWord", {
      enumerable: true,
      get: function() {
        return _keyword.isStrictBindReservedWord;
      }
    });
    Object.defineProperty(exports2, "isStrictReservedWord", {
      enumerable: true,
      get: function() {
        return _keyword.isStrictReservedWord;
      }
    });
    var _identifier = require_identifier();
    var _keyword = require_keyword();
  }
});

// node_modules/@babel/types/lib/validators/isValidIdentifier.js
var require_isValidIdentifier = __commonJS({
  "node_modules/@babel/types/lib/validators/isValidIdentifier.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = isValidIdentifier;
    var _helperValidatorIdentifier = require_lib();
    function isValidIdentifier(name, reserved = true) {
      if (typeof name !== "string") return false;
      if (reserved) {
        if ((0, _helperValidatorIdentifier.isKeyword)(name) || (0, _helperValidatorIdentifier.isStrictReservedWord)(name, true)) {
          return false;
        }
      }
      return (0, _helperValidatorIdentifier.isIdentifierName)(name);
    }
  }
});

// node_modules/@babel/helper-string-parser/lib/index.js
var require_lib2 = __commonJS({
  "node_modules/@babel/helper-string-parser/lib/index.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.readCodePoint = readCodePoint;
    exports2.readInt = readInt;
    exports2.readStringContents = readStringContents;
    var _isDigit = function isDigit(code) {
      return code >= 48 && code <= 57;
    };
    var forbiddenNumericSeparatorSiblings = {
      decBinOct: /* @__PURE__ */ new Set([46, 66, 69, 79, 95, 98, 101, 111]),
      hex: /* @__PURE__ */ new Set([46, 88, 95, 120])
    };
    var isAllowedNumericSeparatorSibling = {
      bin: (ch) => ch === 48 || ch === 49,
      oct: (ch) => ch >= 48 && ch <= 55,
      dec: (ch) => ch >= 48 && ch <= 57,
      hex: (ch) => ch >= 48 && ch <= 57 || ch >= 65 && ch <= 70 || ch >= 97 && ch <= 102
    };
    function readStringContents(type, input, pos, lineStart, curLine, errors) {
      const initialPos = pos;
      const initialLineStart = lineStart;
      const initialCurLine = curLine;
      let out = "";
      let firstInvalidLoc = null;
      let chunkStart = pos;
      const {
        length
      } = input;
      for (; ; ) {
        if (pos >= length) {
          errors.unterminated(initialPos, initialLineStart, initialCurLine);
          out += input.slice(chunkStart, pos);
          break;
        }
        const ch = input.charCodeAt(pos);
        if (isStringEnd(type, ch, input, pos)) {
          out += input.slice(chunkStart, pos);
          break;
        }
        if (ch === 92) {
          out += input.slice(chunkStart, pos);
          const res = readEscapedChar(input, pos, lineStart, curLine, type === "template", errors);
          if (res.ch === null && !firstInvalidLoc) {
            firstInvalidLoc = {
              pos,
              lineStart,
              curLine
            };
          } else {
            out += res.ch;
          }
          ({
            pos,
            lineStart,
            curLine
          } = res);
          chunkStart = pos;
        } else if (ch === 8232 || ch === 8233) {
          ++pos;
          ++curLine;
          lineStart = pos;
        } else if (ch === 10 || ch === 13) {
          if (type === "template") {
            out += input.slice(chunkStart, pos) + "\n";
            ++pos;
            if (ch === 13 && input.charCodeAt(pos) === 10) {
              ++pos;
            }
            ++curLine;
            chunkStart = lineStart = pos;
          } else {
            errors.unterminated(initialPos, initialLineStart, initialCurLine);
          }
        } else {
          ++pos;
        }
      }
      return {
        pos,
        str: out,
        firstInvalidLoc,
        lineStart,
        curLine,
        containsInvalid: !!firstInvalidLoc
      };
    }
    function isStringEnd(type, ch, input, pos) {
      if (type === "template") {
        return ch === 96 || ch === 36 && input.charCodeAt(pos + 1) === 123;
      }
      return ch === (type === "double" ? 34 : 39);
    }
    function readEscapedChar(input, pos, lineStart, curLine, inTemplate, errors) {
      const throwOnInvalid = !inTemplate;
      pos++;
      const res = (ch2) => ({
        pos,
        ch: ch2,
        lineStart,
        curLine
      });
      const ch = input.charCodeAt(pos++);
      switch (ch) {
        case 110:
          return res("\n");
        case 114:
          return res("\r");
        case 120: {
          let code;
          ({
            code,
            pos
          } = readHexChar(input, pos, lineStart, curLine, 2, false, throwOnInvalid, errors));
          return res(code === null ? null : String.fromCharCode(code));
        }
        case 117: {
          let code;
          ({
            code,
            pos
          } = readCodePoint(input, pos, lineStart, curLine, throwOnInvalid, errors));
          return res(code === null ? null : String.fromCodePoint(code));
        }
        case 116:
          return res("	");
        case 98:
          return res("\b");
        case 118:
          return res("\v");
        case 102:
          return res("\f");
        case 13:
          if (input.charCodeAt(pos) === 10) {
            ++pos;
          }
        case 10:
          lineStart = pos;
          ++curLine;
        case 8232:
        case 8233:
          return res("");
        case 56:
        case 57:
          if (inTemplate) {
            return res(null);
          } else {
            errors.strictNumericEscape(pos - 1, lineStart, curLine);
          }
        default:
          if (ch >= 48 && ch <= 55) {
            const startPos = pos - 1;
            const match = /^[0-7]+/.exec(input.slice(startPos, pos + 2));
            let octalStr = match[0];
            let octal = parseInt(octalStr, 8);
            if (octal > 255) {
              octalStr = octalStr.slice(0, -1);
              octal = parseInt(octalStr, 8);
            }
            pos += octalStr.length - 1;
            const next = input.charCodeAt(pos);
            if (octalStr !== "0" || next === 56 || next === 57) {
              if (inTemplate) {
                return res(null);
              } else {
                errors.strictNumericEscape(startPos, lineStart, curLine);
              }
            }
            return res(String.fromCharCode(octal));
          }
          return res(String.fromCharCode(ch));
      }
    }
    function readHexChar(input, pos, lineStart, curLine, len, forceLen, throwOnInvalid, errors) {
      const initialPos = pos;
      let n;
      ({
        n,
        pos
      } = readInt(input, pos, lineStart, curLine, 16, len, forceLen, false, errors, !throwOnInvalid));
      if (n === null) {
        if (throwOnInvalid) {
          errors.invalidEscapeSequence(initialPos, lineStart, curLine);
        } else {
          pos = initialPos - 1;
        }
      }
      return {
        code: n,
        pos
      };
    }
    function readInt(input, pos, lineStart, curLine, radix, len, forceLen, allowNumSeparator, errors, bailOnError) {
      const start = pos;
      const forbiddenSiblings = radix === 16 ? forbiddenNumericSeparatorSiblings.hex : forbiddenNumericSeparatorSiblings.decBinOct;
      const isAllowedSibling = radix === 16 ? isAllowedNumericSeparatorSibling.hex : radix === 10 ? isAllowedNumericSeparatorSibling.dec : radix === 8 ? isAllowedNumericSeparatorSibling.oct : isAllowedNumericSeparatorSibling.bin;
      let invalid = false;
      let total = 0;
      for (let i = 0, e = len == null ? Infinity : len; i < e; ++i) {
        const code = input.charCodeAt(pos);
        let val;
        if (code === 95 && allowNumSeparator !== "bail") {
          const prev = input.charCodeAt(pos - 1);
          const next = input.charCodeAt(pos + 1);
          if (!allowNumSeparator) {
            if (bailOnError) return {
              n: null,
              pos
            };
            errors.numericSeparatorInEscapeSequence(pos, lineStart, curLine);
          } else if (Number.isNaN(next) || !isAllowedSibling(next) || forbiddenSiblings.has(prev) || forbiddenSiblings.has(next)) {
            if (bailOnError) return {
              n: null,
              pos
            };
            errors.unexpectedNumericSeparator(pos, lineStart, curLine);
          }
          ++pos;
          continue;
        }
        if (code >= 97) {
          val = code - 97 + 10;
        } else if (code >= 65) {
          val = code - 65 + 10;
        } else if (_isDigit(code)) {
          val = code - 48;
        } else {
          val = Infinity;
        }
        if (val >= radix) {
          if (val <= 9 && bailOnError) {
            return {
              n: null,
              pos
            };
          } else if (val <= 9 && errors.invalidDigit(pos, lineStart, curLine, radix)) {
            val = 0;
          } else if (forceLen) {
            val = 0;
            invalid = true;
          } else {
            break;
          }
        }
        ++pos;
        total = total * radix + val;
      }
      if (pos === start || len != null && pos - start !== len || invalid) {
        return {
          n: null,
          pos
        };
      }
      return {
        n: total,
        pos
      };
    }
    function readCodePoint(input, pos, lineStart, curLine, throwOnInvalid, errors) {
      const ch = input.charCodeAt(pos);
      let code;
      if (ch === 123) {
        ++pos;
        ({
          code,
          pos
        } = readHexChar(input, pos, lineStart, curLine, input.indexOf("}", pos) - pos, true, throwOnInvalid, errors));
        ++pos;
        if (code !== null && code > 1114111) {
          if (throwOnInvalid) {
            errors.invalidCodePoint(pos, lineStart, curLine);
          } else {
            return {
              code: null,
              pos
            };
          }
        }
      } else {
        ({
          code,
          pos
        } = readHexChar(input, pos, lineStart, curLine, 4, false, throwOnInvalid, errors));
      }
      return {
        code,
        pos
      };
    }
  }
});

// node_modules/@babel/types/lib/constants/index.js
var require_constants = __commonJS({
  "node_modules/@babel/types/lib/constants/index.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.UPDATE_OPERATORS = exports2.UNARY_OPERATORS = exports2.STRING_UNARY_OPERATORS = exports2.STATEMENT_OR_BLOCK_KEYS = exports2.NUMBER_UNARY_OPERATORS = exports2.NUMBER_BINARY_OPERATORS = exports2.LOGICAL_OPERATORS = exports2.INHERIT_KEYS = exports2.FOR_INIT_KEYS = exports2.FLATTENABLE_KEYS = exports2.EQUALITY_BINARY_OPERATORS = exports2.COMPARISON_BINARY_OPERATORS = exports2.COMMENT_KEYS = exports2.BOOLEAN_UNARY_OPERATORS = exports2.BOOLEAN_NUMBER_BINARY_OPERATORS = exports2.BOOLEAN_BINARY_OPERATORS = exports2.BINARY_OPERATORS = exports2.ASSIGNMENT_OPERATORS = void 0;
    var STATEMENT_OR_BLOCK_KEYS = exports2.STATEMENT_OR_BLOCK_KEYS = ["consequent", "body", "alternate"];
    var FLATTENABLE_KEYS = exports2.FLATTENABLE_KEYS = ["body", "expressions"];
    var FOR_INIT_KEYS = exports2.FOR_INIT_KEYS = ["left", "init"];
    var COMMENT_KEYS = exports2.COMMENT_KEYS = ["leadingComments", "trailingComments", "innerComments"];
    var LOGICAL_OPERATORS = exports2.LOGICAL_OPERATORS = ["||", "&&", "??"];
    var UPDATE_OPERATORS = exports2.UPDATE_OPERATORS = ["++", "--"];
    var BOOLEAN_NUMBER_BINARY_OPERATORS = exports2.BOOLEAN_NUMBER_BINARY_OPERATORS = [">", "<", ">=", "<="];
    var EQUALITY_BINARY_OPERATORS = exports2.EQUALITY_BINARY_OPERATORS = ["==", "===", "!=", "!=="];
    var COMPARISON_BINARY_OPERATORS = exports2.COMPARISON_BINARY_OPERATORS = [...EQUALITY_BINARY_OPERATORS, "in", "instanceof"];
    var BOOLEAN_BINARY_OPERATORS = exports2.BOOLEAN_BINARY_OPERATORS = [...COMPARISON_BINARY_OPERATORS, ...BOOLEAN_NUMBER_BINARY_OPERATORS];
    var NUMBER_BINARY_OPERATORS = exports2.NUMBER_BINARY_OPERATORS = ["-", "/", "%", "*", "**", "&", "|", ">>", ">>>", "<<", "^"];
    var BINARY_OPERATORS = exports2.BINARY_OPERATORS = ["+", ...NUMBER_BINARY_OPERATORS, ...BOOLEAN_BINARY_OPERATORS, "|>"];
    var ASSIGNMENT_OPERATORS = exports2.ASSIGNMENT_OPERATORS = ["=", "+=", ...NUMBER_BINARY_OPERATORS.map((op) => op + "="), ...LOGICAL_OPERATORS.map((op) => op + "=")];
    var BOOLEAN_UNARY_OPERATORS = exports2.BOOLEAN_UNARY_OPERATORS = ["delete", "!"];
    var NUMBER_UNARY_OPERATORS = exports2.NUMBER_UNARY_OPERATORS = ["+", "-", "~"];
    var STRING_UNARY_OPERATORS = exports2.STRING_UNARY_OPERATORS = ["typeof"];
    var UNARY_OPERATORS = exports2.UNARY_OPERATORS = ["void", "throw", ...BOOLEAN_UNARY_OPERATORS, ...NUMBER_UNARY_OPERATORS, ...STRING_UNARY_OPERATORS];
    var INHERIT_KEYS = exports2.INHERIT_KEYS = {
      optional: ["typeAnnotation", "typeParameters", "returnType"],
      force: ["start", "loc", "end"]
    };
    exports2.BLOCK_SCOPED_SYMBOL = Symbol.for("var used to be block scoped");
    exports2.NOT_LOCAL_BINDING = Symbol.for("should not be considered a local binding");
  }
});

// node_modules/@babel/types/lib/definitions/utils.js
var require_utils = __commonJS({
  "node_modules/@babel/types/lib/definitions/utils.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.allExpandedTypes = exports2.VISITOR_KEYS = exports2.NODE_UNION_SHAPES__PRIVATE = exports2.NODE_PARENT_VALIDATIONS = exports2.NODE_FIELDS = exports2.FLIPPED_ALIAS_KEYS = exports2.DEPRECATED_KEYS = exports2.BUILDER_KEYS = exports2.ALIAS_KEYS = void 0;
    exports2.arrayOf = arrayOf;
    exports2.arrayOfType = arrayOfType;
    exports2.assertEach = assertEach;
    exports2.assertNodeOrValueType = assertNodeOrValueType;
    exports2.assertNodeType = assertNodeType;
    exports2.assertOneOf = assertOneOf;
    exports2.assertOptionalChainStart = assertOptionalChainStart;
    exports2.assertShape = assertShape;
    exports2.assertValueType = assertValueType;
    exports2.chain = chain;
    exports2.default = defineType;
    exports2.defineAliasedType = defineAliasedType;
    exports2.validate = validate;
    exports2.validateArrayOfType = validateArrayOfType;
    exports2.validateOptional = validateOptional;
    exports2.validateOptionalType = validateOptionalType;
    exports2.validateType = validateType;
    var _is = require_is();
    var _validate = require_validate();
    var VISITOR_KEYS = exports2.VISITOR_KEYS = {};
    var ALIAS_KEYS = exports2.ALIAS_KEYS = {};
    var FLIPPED_ALIAS_KEYS = exports2.FLIPPED_ALIAS_KEYS = {};
    var NODE_FIELDS = exports2.NODE_FIELDS = {};
    var BUILDER_KEYS = exports2.BUILDER_KEYS = {};
    var DEPRECATED_KEYS = exports2.DEPRECATED_KEYS = {};
    var NODE_PARENT_VALIDATIONS = exports2.NODE_PARENT_VALIDATIONS = {};
    var NODE_UNION_SHAPES__PRIVATE = exports2.NODE_UNION_SHAPES__PRIVATE = {};
    function getType(val) {
      if (Array.isArray(val)) {
        return "array";
      } else if (val === null) {
        return "null";
      } else {
        return typeof val;
      }
    }
    function validate(validate2) {
      return {
        validate: validate2
      };
    }
    function validateType(...typeNames) {
      return validate(assertNodeType(...typeNames));
    }
    function validateOptional(validate2) {
      return {
        validate: validate2,
        optional: true
      };
    }
    function validateOptionalType(...typeNames) {
      return {
        validate: assertNodeType(...typeNames),
        optional: true
      };
    }
    function arrayOf(elementType) {
      return chain(assertValueType("array"), assertEach(elementType));
    }
    function arrayOfType(...typeNames) {
      return arrayOf(assertNodeType(...typeNames));
    }
    function validateArrayOfType(...typeNames) {
      return validate(arrayOfType(...typeNames));
    }
    function assertEach(callback) {
      const childValidator = process.env.BABEL_TYPES_8_BREAKING ? _validate.validateChild : () => {
      };
      function validator(node, key, val) {
        if (!Array.isArray(val)) return;
        let i = 0;
        const subKey = {
          toString() {
            return `${key}[${i}]`;
          }
        };
        for (; i < val.length; i++) {
          const v = val[i];
          callback(node, subKey, v);
          childValidator(node, subKey, v);
        }
      }
      validator.each = callback;
      return validator;
    }
    function assertOneOf(...values) {
      function validate2(node, key, val) {
        if (!values.includes(val)) {
          throw new TypeError(`Property ${key} expected value to be one of ${JSON.stringify(values)} but got ${JSON.stringify(val)}`);
        }
      }
      validate2.oneOf = values;
      return validate2;
    }
    var allExpandedTypes = exports2.allExpandedTypes = [];
    function assertNodeType(...types2) {
      const expandedTypes = /* @__PURE__ */ new Set();
      allExpandedTypes.push({
        types: types2,
        set: expandedTypes
      });
      function validate2(node, key, val) {
        const valType = val == null ? void 0 : val.type;
        if (valType != null) {
          if (expandedTypes.has(valType)) {
            (0, _validate.validateChild)(node, key, val);
            return;
          }
          if (valType === "Placeholder") {
            for (const type of types2) {
              if ((0, _is.default)(type, val)) {
                (0, _validate.validateChild)(node, key, val);
                return;
              }
            }
          }
        }
        throw new TypeError(`Property ${key} of ${node.type} expected node to be of a type ${JSON.stringify(types2)} but instead got ${JSON.stringify(valType)}`);
      }
      validate2.oneOfNodeTypes = types2;
      return validate2;
    }
    function assertNodeOrValueType(...types2) {
      function validate2(node, key, val) {
        const primitiveType = getType(val);
        for (const type of types2) {
          if (primitiveType === type || (0, _is.default)(type, val)) {
            (0, _validate.validateChild)(node, key, val);
            return;
          }
        }
        throw new TypeError(`Property ${key} of ${node.type} expected node to be of a type ${JSON.stringify(types2)} but instead got ${JSON.stringify(val == null ? void 0 : val.type)}`);
      }
      validate2.oneOfNodeOrValueTypes = types2;
      return validate2;
    }
    function assertValueType(type) {
      function validate2(node, key, val) {
        if (getType(val) === type) {
          return;
        }
        throw new TypeError(`Property ${key} expected type of ${type} but got ${getType(val)}`);
      }
      validate2.type = type;
      return validate2;
    }
    function assertShape(shape) {
      const keys = Object.keys(shape);
      function validate2(node, key, val) {
        const errors = [];
        for (const property of keys) {
          try {
            (0, _validate.validateField)(node, property, val[property], shape[property]);
          } catch (error) {
            if (error instanceof TypeError) {
              errors.push(error.message);
              continue;
            }
            throw error;
          }
        }
        if (errors.length) {
          throw new TypeError(`Property ${key} of ${node.type} expected to have the following:
${errors.join("\n")}`);
        }
      }
      validate2.shapeOf = shape;
      return validate2;
    }
    function assertOptionalChainStart() {
      function validate2(node) {
        var _current;
        let current = node;
        while (node) {
          const {
            type
          } = current;
          if (type === "OptionalCallExpression") {
            if (current.optional) return;
            current = current.callee;
            continue;
          }
          if (type === "OptionalMemberExpression") {
            if (current.optional) return;
            current = current.object;
            continue;
          }
          break;
        }
        throw new TypeError(`Non-optional ${node.type} must chain from an optional OptionalMemberExpression or OptionalCallExpression. Found chain from ${(_current = current) == null ? void 0 : _current.type}`);
      }
      return validate2;
    }
    function chain(...fns) {
      function validate2(...args) {
        for (const fn of fns) {
          fn(...args);
        }
      }
      validate2.chainOf = fns;
      if (fns.length >= 2 && "type" in fns[0] && fns[0].type === "array" && !("each" in fns[1])) {
        throw new Error(`An assertValueType("array") validator can only be followed by an assertEach(...) validator.`);
      }
      return validate2;
    }
    var validTypeOpts = /* @__PURE__ */ new Set(["aliases", "builder", "deprecatedAlias", "fields", "inherits", "visitor", "validate", "unionShape"]);
    var validFieldKeys = /* @__PURE__ */ new Set(["default", "optional", "deprecated", "validate"]);
    var store = {};
    function defineAliasedType(...aliases) {
      return (type, opts = {}) => {
        let defined = opts.aliases;
        if (!defined) {
          var _store$opts$inherits$;
          if (opts.inherits) defined = (_store$opts$inherits$ = store[opts.inherits].aliases) == null ? void 0 : _store$opts$inherits$.slice();
          defined != null ? defined : defined = [];
          opts.aliases = defined;
        }
        const additional = aliases.filter((a) => !defined.includes(a));
        defined.unshift(...additional);
        defineType(type, opts);
      };
    }
    function defineType(type, opts = {}) {
      const inherits = opts.inherits && store[opts.inherits] || {};
      let fields = opts.fields;
      if (!fields) {
        fields = {};
        if (inherits.fields) {
          const keys = Object.getOwnPropertyNames(inherits.fields);
          for (const key of keys) {
            const field = inherits.fields[key];
            const def = field.default;
            if (Array.isArray(def) ? def.length > 0 : def && typeof def === "object") {
              throw new Error("field defaults can only be primitives or empty arrays currently");
            }
            fields[key] = {
              default: Array.isArray(def) ? [] : def,
              optional: field.optional,
              deprecated: field.deprecated,
              validate: field.validate
            };
          }
        }
      }
      const visitor = opts.visitor || inherits.visitor || [];
      const aliases = opts.aliases || inherits.aliases || [];
      const builder = opts.builder || inherits.builder || opts.visitor || [];
      for (const k of Object.keys(opts)) {
        if (!validTypeOpts.has(k)) {
          throw new Error(`Unknown type option "${k}" on ${type}`);
        }
      }
      if (opts.deprecatedAlias) {
        DEPRECATED_KEYS[opts.deprecatedAlias] = type;
      }
      for (const key of visitor.concat(builder)) {
        fields[key] = fields[key] || {};
      }
      for (const key of Object.keys(fields)) {
        const field = fields[key];
        if (field.default !== void 0 && !builder.includes(key)) {
          field.optional = true;
        }
        if (field.default === void 0) {
          field.default = null;
        } else if (!field.validate && field.default != null) {
          field.validate = assertValueType(getType(field.default));
        }
        for (const k of Object.keys(field)) {
          if (!validFieldKeys.has(k)) {
            throw new Error(`Unknown field key "${k}" on ${type}.${key}`);
          }
        }
      }
      VISITOR_KEYS[type] = opts.visitor = visitor;
      BUILDER_KEYS[type] = opts.builder = builder;
      NODE_FIELDS[type] = opts.fields = fields;
      ALIAS_KEYS[type] = opts.aliases = aliases;
      aliases.forEach((alias) => {
        FLIPPED_ALIAS_KEYS[alias] = FLIPPED_ALIAS_KEYS[alias] || [];
        FLIPPED_ALIAS_KEYS[alias].push(type);
      });
      if (opts.validate) {
        NODE_PARENT_VALIDATIONS[type] = opts.validate;
      }
      if (opts.unionShape) {
        NODE_UNION_SHAPES__PRIVATE[type] = opts.unionShape;
      }
      store[type] = opts;
    }
  }
});

// node_modules/@babel/types/lib/definitions/core.js
var require_core = __commonJS({
  "node_modules/@babel/types/lib/definitions/core.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.patternLikeCommon = exports2.importAttributes = exports2.functionTypeAnnotationCommon = exports2.functionDeclarationCommon = exports2.functionCommon = exports2.classMethodOrPropertyUnionShapeCommon = exports2.classMethodOrPropertyCommon = exports2.classMethodOrDeclareMethodCommon = void 0;
    var _is = require_is();
    var _isValidIdentifier = require_isValidIdentifier();
    var _helperValidatorIdentifier = require_lib();
    var _helperStringParser = require_lib2();
    var _index = require_constants();
    var _utils = require_utils();
    var classMethodOrPropertyUnionShapeCommon = (allowPrivateName = false) => ({
      unionShape: {
        discriminator: "computed",
        shapes: [{
          name: "computed",
          value: [true],
          properties: {
            key: {
              validate: (0, _utils.assertNodeType)("Expression")
            }
          }
        }, {
          name: "nonComputed",
          value: [false],
          properties: {
            key: {
              validate: allowPrivateName ? (0, _utils.assertNodeType)("Identifier", "StringLiteral", "NumericLiteral", "BigIntLiteral", "PrivateName") : (0, _utils.assertNodeType)("Identifier", "StringLiteral", "NumericLiteral", "BigIntLiteral")
            }
          }
        }]
      }
    });
    exports2.classMethodOrPropertyUnionShapeCommon = classMethodOrPropertyUnionShapeCommon;
    var defineType = (0, _utils.defineAliasedType)("Standardized");
    defineType("ArrayExpression", {
      fields: {
        elements: {
          validate: (0, _utils.arrayOf)((0, _utils.assertNodeOrValueType)("null", "Expression", "SpreadElement")),
          default: !process.env.BABEL_TYPES_8_BREAKING ? [] : void 0
        }
      },
      visitor: ["elements"],
      aliases: ["Expression"]
    });
    defineType("AssignmentExpression", {
      fields: {
        operator: {
          validate: !process.env.BABEL_TYPES_8_BREAKING ? (0, _utils.assertValueType)("string") : Object.assign((function() {
            const identifier = (0, _utils.assertOneOf)(..._index.ASSIGNMENT_OPERATORS);
            const pattern = (0, _utils.assertOneOf)("=");
            return function(node, key, val) {
              const validator = (0, _is.default)("Pattern", node.left) ? pattern : identifier;
              validator(node, key, val);
            };
          })(), {
            oneOf: _index.ASSIGNMENT_OPERATORS
          })
        },
        left: {
          validate: !process.env.BABEL_TYPES_8_BREAKING ? (0, _utils.assertNodeType)("LVal", "OptionalMemberExpression") : (0, _utils.assertNodeType)("Identifier", "MemberExpression", "OptionalMemberExpression", "ArrayPattern", "ObjectPattern", "TSAsExpression", "TSSatisfiesExpression", "TSTypeAssertion", "TSNonNullExpression")
        },
        right: {
          validate: (0, _utils.assertNodeType)("Expression")
        }
      },
      builder: ["operator", "left", "right"],
      visitor: ["left", "right"],
      aliases: ["Expression"]
    });
    defineType("BinaryExpression", {
      builder: ["operator", "left", "right"],
      fields: {
        operator: {
          validate: (0, _utils.assertOneOf)(..._index.BINARY_OPERATORS)
        },
        left: {
          validate: (function() {
            const expression = (0, _utils.assertNodeType)("Expression");
            const inOp = (0, _utils.assertNodeType)("Expression", "PrivateName");
            const validator = Object.assign(function(node, key, val) {
              const validator2 = node.operator === "in" ? inOp : expression;
              validator2(node, key, val);
            }, {
              oneOfNodeTypes: ["Expression", "PrivateName"]
            });
            return validator;
          })()
        },
        right: {
          validate: (0, _utils.assertNodeType)("Expression")
        }
      },
      visitor: ["left", "right"],
      aliases: ["Binary", "Expression"]
    });
    defineType("InterpreterDirective", {
      builder: ["value"],
      fields: {
        value: {
          validate: (0, _utils.assertValueType)("string")
        }
      }
    });
    defineType("Directive", {
      visitor: ["value"],
      fields: {
        value: {
          validate: (0, _utils.assertNodeType)("DirectiveLiteral")
        }
      }
    });
    defineType("DirectiveLiteral", {
      builder: ["value"],
      fields: {
        value: {
          validate: (0, _utils.assertValueType)("string")
        }
      }
    });
    defineType("BlockStatement", {
      builder: ["body", "directives"],
      visitor: ["directives", "body"],
      fields: {
        directives: {
          validate: (0, _utils.arrayOfType)("Directive"),
          default: []
        },
        body: (0, _utils.validateArrayOfType)("Statement")
      },
      aliases: ["Scopable", "BlockParent", "Block", "Statement"]
    });
    defineType("BreakStatement", {
      visitor: ["label"],
      fields: {
        label: {
          validate: (0, _utils.assertNodeType)("Identifier"),
          optional: true
        }
      },
      aliases: ["Statement", "Terminatorless", "CompletionStatement"]
    });
    defineType("CallExpression", {
      visitor: ["callee", "typeParameters", "typeArguments", "arguments"],
      builder: ["callee", "arguments"],
      aliases: ["Expression"],
      fields: Object.assign({
        callee: {
          validate: (0, _utils.assertNodeType)("Expression", "Super", "V8IntrinsicIdentifier")
        },
        arguments: (0, _utils.validateArrayOfType)("Expression", "SpreadElement", "ArgumentPlaceholder"),
        typeArguments: {
          validate: (0, _utils.assertNodeType)("TypeParameterInstantiation"),
          optional: true
        }
      }, process.env.BABEL_TYPES_8_BREAKING ? {} : {
        optional: {
          validate: (0, _utils.assertValueType)("boolean"),
          optional: true
        },
        typeParameters: {
          validate: (0, _utils.assertNodeType)("TSTypeParameterInstantiation"),
          optional: true
        }
      })
    });
    defineType("CatchClause", {
      visitor: ["param", "body"],
      fields: {
        param: {
          validate: (0, _utils.assertNodeType)("Identifier", "ArrayPattern", "ObjectPattern"),
          optional: true
        },
        body: {
          validate: (0, _utils.assertNodeType)("BlockStatement")
        }
      },
      aliases: ["Scopable", "BlockParent"]
    });
    defineType("ConditionalExpression", {
      visitor: ["test", "consequent", "alternate"],
      fields: {
        test: {
          validate: (0, _utils.assertNodeType)("Expression")
        },
        consequent: {
          validate: (0, _utils.assertNodeType)("Expression")
        },
        alternate: {
          validate: (0, _utils.assertNodeType)("Expression")
        }
      },
      aliases: ["Expression", "Conditional"]
    });
    defineType("ContinueStatement", {
      visitor: ["label"],
      fields: {
        label: {
          validate: (0, _utils.assertNodeType)("Identifier"),
          optional: true
        }
      },
      aliases: ["Statement", "Terminatorless", "CompletionStatement"]
    });
    defineType("DebuggerStatement", {
      aliases: ["Statement"]
    });
    defineType("DoWhileStatement", {
      builder: ["test", "body"],
      visitor: ["body", "test"],
      fields: {
        test: {
          validate: (0, _utils.assertNodeType)("Expression")
        },
        body: {
          validate: (0, _utils.assertNodeType)("Statement")
        }
      },
      aliases: ["Statement", "BlockParent", "Loop", "While", "Scopable"]
    });
    defineType("EmptyStatement", {
      aliases: ["Statement"]
    });
    defineType("ExpressionStatement", {
      visitor: ["expression"],
      fields: {
        expression: {
          validate: (0, _utils.assertNodeType)("Expression")
        }
      },
      aliases: ["Statement", "ExpressionWrapper"]
    });
    defineType("File", {
      builder: ["program", "comments", "tokens"],
      visitor: ["program"],
      fields: {
        program: {
          validate: (0, _utils.assertNodeType)("Program")
        },
        comments: {
          validate: !process.env.BABEL_TYPES_8_BREAKING ? Object.assign(() => {
          }, {
            each: {
              oneOfNodeTypes: ["CommentBlock", "CommentLine"]
            }
          }) : (0, _utils.assertEach)((0, _utils.assertNodeType)("CommentBlock", "CommentLine")),
          optional: true
        },
        tokens: {
          validate: (0, _utils.assertEach)(Object.assign(() => {
          }, {
            type: "any"
          })),
          optional: true
        }
      }
    });
    defineType("ForInStatement", {
      visitor: ["left", "right", "body"],
      aliases: ["Scopable", "Statement", "For", "BlockParent", "Loop", "ForXStatement"],
      fields: {
        left: {
          validate: !process.env.BABEL_TYPES_8_BREAKING ? (0, _utils.assertNodeType)("VariableDeclaration", "LVal") : (0, _utils.assertNodeType)("VariableDeclaration", "Identifier", "MemberExpression", "ArrayPattern", "ObjectPattern", "TSAsExpression", "TSSatisfiesExpression", "TSTypeAssertion", "TSNonNullExpression")
        },
        right: {
          validate: (0, _utils.assertNodeType)("Expression")
        },
        body: {
          validate: (0, _utils.assertNodeType)("Statement")
        }
      }
    });
    defineType("ForStatement", {
      visitor: ["init", "test", "update", "body"],
      aliases: ["Scopable", "Statement", "For", "BlockParent", "Loop"],
      fields: {
        init: {
          validate: (0, _utils.assertNodeType)("VariableDeclaration", "Expression"),
          optional: true
        },
        test: {
          validate: (0, _utils.assertNodeType)("Expression"),
          optional: true
        },
        update: {
          validate: (0, _utils.assertNodeType)("Expression"),
          optional: true
        },
        body: {
          validate: (0, _utils.assertNodeType)("Statement")
        }
      }
    });
    var functionCommon = () => ({
      params: (0, _utils.validateArrayOfType)("FunctionParameter"),
      generator: {
        default: false
      },
      async: {
        default: false
      }
    });
    exports2.functionCommon = functionCommon;
    var functionTypeAnnotationCommon = () => ({
      returnType: {
        validate: (0, _utils.assertNodeType)("TypeAnnotation", "TSTypeAnnotation", "Noop"),
        optional: true
      },
      typeParameters: {
        validate: (0, _utils.assertNodeType)("TypeParameterDeclaration", "TSTypeParameterDeclaration", "Noop"),
        optional: true
      }
    });
    exports2.functionTypeAnnotationCommon = functionTypeAnnotationCommon;
    var functionDeclarationCommon = () => Object.assign({}, functionCommon(), {
      declare: {
        validate: (0, _utils.assertValueType)("boolean"),
        optional: true
      },
      id: {
        validate: (0, _utils.assertNodeType)("Identifier"),
        optional: true
      }
    });
    exports2.functionDeclarationCommon = functionDeclarationCommon;
    defineType("FunctionDeclaration", {
      builder: ["id", "params", "body", "generator", "async"],
      visitor: ["id", "typeParameters", "params", "predicate", "returnType", "body"],
      fields: Object.assign({}, functionDeclarationCommon(), functionTypeAnnotationCommon(), {
        body: {
          validate: (0, _utils.assertNodeType)("BlockStatement")
        },
        predicate: {
          validate: (0, _utils.assertNodeType)("DeclaredPredicate", "InferredPredicate"),
          optional: true
        }
      }),
      aliases: ["Scopable", "Function", "BlockParent", "FunctionParent", "Statement", "Pureish", "Declaration"],
      validate: !process.env.BABEL_TYPES_8_BREAKING ? void 0 : (function() {
        const identifier = (0, _utils.assertNodeType)("Identifier");
        return function(parent, key, node) {
          if (!(0, _is.default)("ExportDefaultDeclaration", parent)) {
            identifier(node, "id", node.id);
          }
        };
      })()
    });
    defineType("FunctionExpression", {
      inherits: "FunctionDeclaration",
      aliases: ["Scopable", "Function", "BlockParent", "FunctionParent", "Expression", "Pureish"],
      fields: Object.assign({}, functionCommon(), functionTypeAnnotationCommon(), {
        id: {
          validate: (0, _utils.assertNodeType)("Identifier"),
          optional: true
        },
        body: {
          validate: (0, _utils.assertNodeType)("BlockStatement")
        },
        predicate: {
          validate: (0, _utils.assertNodeType)("DeclaredPredicate", "InferredPredicate"),
          optional: true
        }
      })
    });
    var patternLikeCommon = () => ({
      typeAnnotation: {
        validate: (0, _utils.assertNodeType)("TypeAnnotation", "TSTypeAnnotation", "Noop"),
        optional: true
      },
      optional: {
        validate: (0, _utils.assertValueType)("boolean"),
        optional: true
      },
      decorators: {
        validate: (0, _utils.arrayOfType)("Decorator"),
        optional: true
      }
    });
    exports2.patternLikeCommon = patternLikeCommon;
    defineType("Identifier", {
      builder: ["name"],
      visitor: ["typeAnnotation", "decorators"],
      aliases: ["Expression", "FunctionParameter", "PatternLike", "LVal", "TSEntityName"],
      fields: Object.assign({}, patternLikeCommon(), {
        name: {
          validate: process.env.BABEL_TYPES_8_BREAKING ? (0, _utils.chain)((0, _utils.assertValueType)("string"), Object.assign(function(node, key, val) {
            if (!(0, _isValidIdentifier.default)(val, false)) {
              throw new TypeError(`"${val}" is not a valid identifier name`);
            }
          }, {
            type: "string"
          })) : (0, _utils.assertValueType)("string")
        }
      }),
      validate: process.env.BABEL_TYPES_8_BREAKING ? function(parent, key, node) {
        const match = /\.(\w+)$/.exec(key.toString());
        if (!match) return;
        const [, parentKey] = match;
        const nonComp = {
          computed: false
        };
        if (parentKey === "property") {
          if ((0, _is.default)("MemberExpression", parent, nonComp)) return;
          if ((0, _is.default)("OptionalMemberExpression", parent, nonComp)) return;
        } else if (parentKey === "key") {
          if ((0, _is.default)("Property", parent, nonComp)) return;
          if ((0, _is.default)("Method", parent, nonComp)) return;
        } else if (parentKey === "exported") {
          if ((0, _is.default)("ExportSpecifier", parent)) return;
        } else if (parentKey === "imported") {
          if ((0, _is.default)("ImportSpecifier", parent, {
            imported: node
          })) return;
        } else if (parentKey === "meta") {
          if ((0, _is.default)("MetaProperty", parent, {
            meta: node
          })) return;
        }
        if (((0, _helperValidatorIdentifier.isKeyword)(node.name) || (0, _helperValidatorIdentifier.isReservedWord)(node.name, false)) && node.name !== "this") {
          throw new TypeError(`"${node.name}" is not a valid identifier`);
        }
      } : void 0
    });
    defineType("IfStatement", {
      visitor: ["test", "consequent", "alternate"],
      aliases: ["Statement", "Conditional"],
      fields: {
        test: {
          validate: (0, _utils.assertNodeType)("Expression")
        },
        consequent: {
          validate: (0, _utils.assertNodeType)("Statement")
        },
        alternate: {
          optional: true,
          validate: (0, _utils.assertNodeType)("Statement")
        }
      }
    });
    defineType("LabeledStatement", {
      visitor: ["label", "body"],
      aliases: ["Statement"],
      fields: {
        label: {
          validate: (0, _utils.assertNodeType)("Identifier")
        },
        body: {
          validate: (0, _utils.assertNodeType)("Statement")
        }
      }
    });
    defineType("StringLiteral", {
      builder: ["value"],
      fields: {
        value: {
          validate: (0, _utils.assertValueType)("string")
        }
      },
      aliases: ["Expression", "Pureish", "Literal", "Immutable"]
    });
    defineType("NumericLiteral", {
      builder: ["value"],
      deprecatedAlias: "NumberLiteral",
      fields: {
        value: {
          validate: (0, _utils.chain)((0, _utils.assertValueType)("number"), Object.assign(function(node, key, val) {
            if (1 / val < 0 || !Number.isFinite(val)) {
              const error = new Error(`NumericLiterals must be non-negative finite numbers. You can use t.valueToNode(${val}) instead.`);
            }
          }, {
            type: "number"
          }))
        }
      },
      aliases: ["Expression", "Pureish", "Literal", "Immutable"]
    });
    defineType("NullLiteral", {
      aliases: ["Expression", "Pureish", "Literal", "Immutable"]
    });
    defineType("BooleanLiteral", {
      builder: ["value"],
      fields: {
        value: {
          validate: (0, _utils.assertValueType)("boolean")
        }
      },
      aliases: ["Expression", "Pureish", "Literal", "Immutable"]
    });
    defineType("RegExpLiteral", {
      builder: ["pattern", "flags"],
      deprecatedAlias: "RegexLiteral",
      aliases: ["Expression", "Pureish", "Literal"],
      fields: {
        pattern: {
          validate: (0, _utils.assertValueType)("string")
        },
        flags: {
          validate: process.env.BABEL_TYPES_8_BREAKING ? (0, _utils.chain)((0, _utils.assertValueType)("string"), Object.assign(function(node, key, val) {
            const invalid = /[^dgimsuvy]/.exec(val);
            if (invalid) {
              throw new TypeError(`"${invalid[0]}" is not a valid RegExp flag`);
            }
          }, {
            type: "string"
          })) : (0, _utils.assertValueType)("string"),
          default: ""
        }
      }
    });
    defineType("LogicalExpression", {
      builder: ["operator", "left", "right"],
      visitor: ["left", "right"],
      aliases: ["Binary", "Expression"],
      fields: {
        operator: {
          validate: (0, _utils.assertOneOf)(..._index.LOGICAL_OPERATORS)
        },
        left: {
          validate: (0, _utils.assertNodeType)("Expression")
        },
        right: {
          validate: (0, _utils.assertNodeType)("Expression")
        }
      }
    });
    defineType("MemberExpression", {
      builder: ["object", "property", "computed", ...!process.env.BABEL_TYPES_8_BREAKING ? ["optional"] : []],
      visitor: ["object", "property"],
      aliases: ["Expression", "LVal", "PatternLike"],
      unionShape: {
        discriminator: "computed",
        shapes: [{
          name: "computed",
          value: [true],
          properties: {
            property: {
              validate: (0, _utils.assertNodeType)("Expression")
            }
          }
        }, {
          name: "nonComputed",
          value: [false],
          properties: {
            property: {
              validate: (0, _utils.assertNodeType)("Identifier", "PrivateName")
            }
          }
        }]
      },
      fields: Object.assign({
        object: {
          validate: (0, _utils.assertNodeType)("Expression", "Super")
        },
        property: {
          validate: (function() {
            const normal = (0, _utils.assertNodeType)("Identifier", "PrivateName");
            const computed = (0, _utils.assertNodeType)("Expression");
            const validator = function(node, key, val) {
              const validator2 = node.computed ? computed : normal;
              validator2(node, key, val);
            };
            validator.oneOfNodeTypes = ["Expression", "Identifier", "PrivateName"];
            return validator;
          })()
        },
        computed: {
          default: false
        }
      }, !process.env.BABEL_TYPES_8_BREAKING ? {
        optional: {
          validate: (0, _utils.assertValueType)("boolean"),
          optional: true
        }
      } : {})
    });
    defineType("NewExpression", {
      inherits: "CallExpression"
    });
    defineType("Program", {
      visitor: ["directives", "body"],
      builder: ["body", "directives", "sourceType", "interpreter"],
      fields: {
        sourceType: {
          validate: (0, _utils.assertOneOf)("script", "module"),
          default: "script"
        },
        interpreter: {
          validate: (0, _utils.assertNodeType)("InterpreterDirective"),
          default: null,
          optional: true
        },
        directives: {
          validate: (0, _utils.arrayOfType)("Directive"),
          default: []
        },
        body: (0, _utils.validateArrayOfType)("Statement")
      },
      aliases: ["Scopable", "BlockParent", "Block"]
    });
    defineType("ObjectExpression", {
      visitor: ["properties"],
      aliases: ["Expression"],
      fields: {
        properties: (0, _utils.validateArrayOfType)("ObjectMethod", "ObjectProperty", "SpreadElement")
      }
    });
    defineType("ObjectMethod", Object.assign({
      builder: ["kind", "key", "params", "body", "computed", "generator", "async"],
      visitor: ["decorators", "key", "typeParameters", "params", "returnType", "body"]
    }, classMethodOrPropertyUnionShapeCommon(), {
      fields: Object.assign({}, functionCommon(), functionTypeAnnotationCommon(), {
        kind: Object.assign({
          validate: (0, _utils.assertOneOf)("method", "get", "set")
        }, !process.env.BABEL_TYPES_8_BREAKING ? {
          default: "method"
        } : {}),
        computed: {
          default: false
        },
        key: {
          validate: (function() {
            const normal = (0, _utils.assertNodeType)("Identifier", "StringLiteral", "NumericLiteral", "BigIntLiteral");
            const computed = (0, _utils.assertNodeType)("Expression");
            const validator = function(node, key, val) {
              const validator2 = node.computed ? computed : normal;
              validator2(node, key, val);
            };
            validator.oneOfNodeTypes = ["Expression", "Identifier", "StringLiteral", "NumericLiteral", "BigIntLiteral"];
            return validator;
          })()
        },
        decorators: {
          validate: (0, _utils.arrayOfType)("Decorator"),
          optional: true
        },
        body: {
          validate: (0, _utils.assertNodeType)("BlockStatement")
        }
      }),
      aliases: ["UserWhitespacable", "Function", "Scopable", "BlockParent", "FunctionParent", "Method", "ObjectMember"]
    }));
    defineType("ObjectProperty", {
      builder: ["key", "value", "computed", "shorthand", ...!process.env.BABEL_TYPES_8_BREAKING ? ["decorators"] : []],
      unionShape: {
        discriminator: "computed",
        shapes: [{
          name: "computed",
          value: [true],
          properties: {
            key: {
              validate: (0, _utils.assertNodeType)("Expression")
            }
          }
        }, {
          name: "nonComputed",
          value: [false],
          properties: {
            key: {
              validate: (0, _utils.assertNodeType)("Identifier", "StringLiteral", "NumericLiteral", "BigIntLiteral", "DecimalLiteral", "PrivateName")
            }
          }
        }]
      },
      fields: {
        computed: {
          default: false
        },
        key: {
          validate: (function() {
            const normal = (0, _utils.assertNodeType)("Identifier", "StringLiteral", "NumericLiteral", "BigIntLiteral", "DecimalLiteral", "PrivateName");
            const computed = (0, _utils.assertNodeType)("Expression");
            const validator = Object.assign(function(node, key, val) {
              const validator2 = node.computed ? computed : normal;
              validator2(node, key, val);
            }, {
              oneOfNodeTypes: ["Expression", "Identifier", "StringLiteral", "NumericLiteral", "BigIntLiteral", "DecimalLiteral", "PrivateName"]
            });
            return validator;
          })()
        },
        value: {
          validate: (0, _utils.assertNodeType)("Expression", "PatternLike")
        },
        shorthand: {
          validate: process.env.BABEL_TYPES_8_BREAKING ? (0, _utils.chain)((0, _utils.assertValueType)("boolean"), Object.assign(function(node, key, shorthand) {
            if (!shorthand) return;
            if (node.computed) {
              throw new TypeError("Property shorthand of ObjectProperty cannot be true if computed is true");
            }
            if (!(0, _is.default)("Identifier", node.key)) {
              throw new TypeError("Property shorthand of ObjectProperty cannot be true if key is not an Identifier");
            }
          }, {
            type: "boolean"
          })) : (0, _utils.assertValueType)("boolean"),
          default: false
        },
        decorators: {
          validate: (0, _utils.arrayOfType)("Decorator"),
          optional: true
        }
      },
      visitor: ["decorators", "key", "value"],
      aliases: ["UserWhitespacable", "Property", "ObjectMember"],
      validate: !process.env.BABEL_TYPES_8_BREAKING ? void 0 : (function() {
        const pattern = (0, _utils.assertNodeType)("Identifier", "Pattern", "TSAsExpression", "TSSatisfiesExpression", "TSNonNullExpression", "TSTypeAssertion");
        const expression = (0, _utils.assertNodeType)("Expression");
        return function(parent, key, node) {
          const validator = (0, _is.default)("ObjectPattern", parent) ? pattern : expression;
          validator(node, "value", node.value);
        };
      })()
    });
    defineType("RestElement", {
      visitor: ["argument", "typeAnnotation"],
      builder: ["argument"],
      aliases: ["FunctionParameter", "PatternLike", "LVal"],
      deprecatedAlias: "RestProperty",
      fields: Object.assign({}, patternLikeCommon(), {
        argument: {
          validate: !process.env.BABEL_TYPES_8_BREAKING ? (0, _utils.assertNodeType)("Identifier", "ArrayPattern", "ObjectPattern", "MemberExpression", "TSAsExpression", "TSSatisfiesExpression", "TSTypeAssertion", "TSNonNullExpression", "RestElement", "AssignmentPattern") : (0, _utils.assertNodeType)("Identifier", "ArrayPattern", "ObjectPattern", "MemberExpression", "TSAsExpression", "TSSatisfiesExpression", "TSTypeAssertion", "TSNonNullExpression")
        }
      }),
      validate: process.env.BABEL_TYPES_8_BREAKING ? function(parent, key) {
        const match = /(\w+)\[(\d+)\]/.exec(key.toString());
        if (!match) throw new Error("Internal Babel error: malformed key.");
        const [, listKey, index] = match;
        if (parent[listKey].length > +index + 1) {
          throw new TypeError(`RestElement must be last element of ${listKey}`);
        }
      } : void 0
    });
    defineType("ReturnStatement", {
      visitor: ["argument"],
      aliases: ["Statement", "Terminatorless", "CompletionStatement"],
      fields: {
        argument: {
          validate: (0, _utils.assertNodeType)("Expression"),
          optional: true
        }
      }
    });
    defineType("SequenceExpression", {
      visitor: ["expressions"],
      fields: {
        expressions: (0, _utils.validateArrayOfType)("Expression")
      },
      aliases: ["Expression"]
    });
    defineType("ParenthesizedExpression", {
      visitor: ["expression"],
      aliases: ["Expression", "ExpressionWrapper"],
      fields: {
        expression: {
          validate: (0, _utils.assertNodeType)("Expression")
        }
      }
    });
    defineType("SwitchCase", {
      visitor: ["test", "consequent"],
      fields: {
        test: {
          validate: (0, _utils.assertNodeType)("Expression"),
          optional: true
        },
        consequent: (0, _utils.validateArrayOfType)("Statement")
      }
    });
    defineType("SwitchStatement", {
      visitor: ["discriminant", "cases"],
      aliases: ["Statement", "BlockParent", "Scopable"],
      fields: {
        discriminant: {
          validate: (0, _utils.assertNodeType)("Expression")
        },
        cases: (0, _utils.validateArrayOfType)("SwitchCase")
      }
    });
    defineType("ThisExpression", {
      aliases: ["Expression"]
    });
    defineType("ThrowStatement", {
      visitor: ["argument"],
      aliases: ["Statement", "Terminatorless", "CompletionStatement"],
      fields: {
        argument: {
          validate: (0, _utils.assertNodeType)("Expression")
        }
      }
    });
    defineType("TryStatement", {
      visitor: ["block", "handler", "finalizer"],
      aliases: ["Statement"],
      fields: {
        block: {
          validate: process.env.BABEL_TYPES_8_BREAKING ? (0, _utils.chain)((0, _utils.assertNodeType)("BlockStatement"), Object.assign(function(node) {
            if (!node.handler && !node.finalizer) {
              throw new TypeError("TryStatement expects either a handler or finalizer, or both");
            }
          }, {
            oneOfNodeTypes: ["BlockStatement"]
          })) : (0, _utils.assertNodeType)("BlockStatement")
        },
        handler: {
          optional: true,
          validate: (0, _utils.assertNodeType)("CatchClause")
        },
        finalizer: {
          optional: true,
          validate: (0, _utils.assertNodeType)("BlockStatement")
        }
      }
    });
    defineType("UnaryExpression", {
      builder: ["operator", "argument", "prefix"],
      fields: {
        prefix: {
          default: true
        },
        argument: {
          validate: (0, _utils.assertNodeType)("Expression")
        },
        operator: {
          validate: (0, _utils.assertOneOf)(..._index.UNARY_OPERATORS)
        }
      },
      visitor: ["argument"],
      aliases: ["UnaryLike", "Expression"]
    });
    defineType("UpdateExpression", {
      builder: ["operator", "argument", "prefix"],
      fields: {
        prefix: {
          default: false
        },
        argument: {
          validate: !process.env.BABEL_TYPES_8_BREAKING ? (0, _utils.assertNodeType)("Expression") : (0, _utils.assertNodeType)("Identifier", "MemberExpression")
        },
        operator: {
          validate: (0, _utils.assertOneOf)(..._index.UPDATE_OPERATORS)
        }
      },
      visitor: ["argument"],
      aliases: ["Expression"]
    });
    defineType("VariableDeclaration", {
      builder: ["kind", "declarations"],
      visitor: ["declarations"],
      aliases: ["Statement", "Declaration"],
      fields: {
        declare: {
          validate: (0, _utils.assertValueType)("boolean"),
          optional: true
        },
        kind: {
          validate: (0, _utils.assertOneOf)("var", "let", "const", "using", "await using")
        },
        declarations: (0, _utils.validateArrayOfType)("VariableDeclarator")
      },
      validate: process.env.BABEL_TYPES_8_BREAKING ? (() => {
        const withoutInit = (0, _utils.assertNodeType)("Identifier", "Placeholder");
        const constOrLetOrVar = (0, _utils.assertNodeType)("Identifier", "ArrayPattern", "ObjectPattern", "Placeholder");
        const usingOrAwaitUsing = (0, _utils.assertNodeType)("Identifier", "VoidPattern", "Placeholder");
        return function(parent, key, node) {
          const {
            kind,
            declarations
          } = node;
          const parentIsForX = (0, _is.default)("ForXStatement", parent, {
            left: node
          });
          if (parentIsForX) {
            if (declarations.length !== 1) {
              throw new TypeError(`Exactly one VariableDeclarator is required in the VariableDeclaration of a ${parent.type}`);
            }
          }
          for (const decl of declarations) {
            if (kind === "const" || kind === "let" || kind === "var") {
              if (!parentIsForX && !decl.init) {
                withoutInit(decl, "id", decl.id);
              } else {
                constOrLetOrVar(decl, "id", decl.id);
              }
            } else {
              usingOrAwaitUsing(decl, "id", decl.id);
            }
          }
        };
      })() : void 0
    });
    defineType("VariableDeclarator", {
      visitor: ["id", "init"],
      fields: {
        id: {
          validate: !process.env.BABEL_TYPES_8_BREAKING ? (0, _utils.assertNodeType)("LVal", "VoidPattern") : (0, _utils.assertNodeType)("Identifier", "ArrayPattern", "ObjectPattern", "VoidPattern")
        },
        definite: {
          optional: true,
          validate: (0, _utils.assertValueType)("boolean")
        },
        init: {
          optional: true,
          validate: (0, _utils.assertNodeType)("Expression")
        }
      }
    });
    defineType("WhileStatement", {
      visitor: ["test", "body"],
      aliases: ["Statement", "BlockParent", "Loop", "While", "Scopable"],
      fields: {
        test: {
          validate: (0, _utils.assertNodeType)("Expression")
        },
        body: {
          validate: (0, _utils.assertNodeType)("Statement")
        }
      }
    });
    defineType("WithStatement", {
      visitor: ["object", "body"],
      aliases: ["Statement"],
      fields: {
        object: {
          validate: (0, _utils.assertNodeType)("Expression")
        },
        body: {
          validate: (0, _utils.assertNodeType)("Statement")
        }
      }
    });
    defineType("AssignmentPattern", {
      visitor: ["left", "right", "decorators"],
      builder: ["left", "right"],
      aliases: ["FunctionParameter", "Pattern", "PatternLike", "LVal"],
      fields: Object.assign({}, patternLikeCommon(), {
        left: {
          validate: (0, _utils.assertNodeType)("Identifier", "ObjectPattern", "ArrayPattern", "MemberExpression", "TSAsExpression", "TSSatisfiesExpression", "TSTypeAssertion", "TSNonNullExpression")
        },
        right: {
          validate: (0, _utils.assertNodeType)("Expression")
        },
        decorators: {
          validate: (0, _utils.arrayOfType)("Decorator"),
          optional: true
        }
      })
    });
    defineType("ArrayPattern", {
      visitor: ["elements", "typeAnnotation"],
      builder: ["elements"],
      aliases: ["FunctionParameter", "Pattern", "PatternLike", "LVal"],
      fields: Object.assign({}, patternLikeCommon(), {
        elements: {
          validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeOrValueType)("null", "PatternLike")))
        }
      })
    });
    defineType("ArrowFunctionExpression", {
      builder: ["params", "body", "async"],
      visitor: ["typeParameters", "params", "predicate", "returnType", "body"],
      aliases: ["Scopable", "Function", "BlockParent", "FunctionParent", "Expression", "Pureish"],
      fields: Object.assign({}, functionCommon(), functionTypeAnnotationCommon(), {
        expression: {
          validate: (0, _utils.assertValueType)("boolean")
        },
        body: {
          validate: (0, _utils.assertNodeType)("BlockStatement", "Expression")
        },
        predicate: {
          validate: (0, _utils.assertNodeType)("DeclaredPredicate", "InferredPredicate"),
          optional: true
        }
      })
    });
    defineType("ClassBody", {
      visitor: ["body"],
      fields: {
        body: (0, _utils.validateArrayOfType)("ClassMethod", "ClassPrivateMethod", "ClassProperty", "ClassPrivateProperty", "ClassAccessorProperty", "TSDeclareMethod", "TSIndexSignature", "StaticBlock")
      }
    });
    defineType("ClassExpression", {
      builder: ["id", "superClass", "body", "decorators"],
      visitor: ["decorators", "id", "typeParameters", "superClass", "superTypeParameters", "mixins", "implements", "body"],
      aliases: ["Scopable", "Class", "Expression"],
      fields: {
        id: {
          validate: (0, _utils.assertNodeType)("Identifier"),
          optional: true
        },
        typeParameters: {
          validate: (0, _utils.assertNodeType)("TypeParameterDeclaration", "TSTypeParameterDeclaration", "Noop"),
          optional: true
        },
        body: {
          validate: (0, _utils.assertNodeType)("ClassBody")
        },
        superClass: {
          optional: true,
          validate: (0, _utils.assertNodeType)("Expression")
        },
        ["superTypeParameters"]: {
          validate: (0, _utils.assertNodeType)("TypeParameterInstantiation", "TSTypeParameterInstantiation"),
          optional: true
        },
        implements: {
          validate: (0, _utils.arrayOfType)("TSExpressionWithTypeArguments", "ClassImplements"),
          optional: true
        },
        decorators: {
          validate: (0, _utils.arrayOfType)("Decorator"),
          optional: true
        },
        mixins: {
          validate: (0, _utils.assertNodeType)("InterfaceExtends"),
          optional: true
        }
      }
    });
    defineType("ClassDeclaration", {
      inherits: "ClassExpression",
      aliases: ["Scopable", "Class", "Statement", "Declaration"],
      fields: {
        id: {
          validate: (0, _utils.assertNodeType)("Identifier"),
          optional: true
        },
        typeParameters: {
          validate: (0, _utils.assertNodeType)("TypeParameterDeclaration", "TSTypeParameterDeclaration", "Noop"),
          optional: true
        },
        body: {
          validate: (0, _utils.assertNodeType)("ClassBody")
        },
        superClass: {
          optional: true,
          validate: (0, _utils.assertNodeType)("Expression")
        },
        ["superTypeParameters"]: {
          validate: (0, _utils.assertNodeType)("TypeParameterInstantiation", "TSTypeParameterInstantiation"),
          optional: true
        },
        implements: {
          validate: (0, _utils.arrayOfType)("TSExpressionWithTypeArguments", "ClassImplements"),
          optional: true
        },
        decorators: {
          validate: (0, _utils.arrayOfType)("Decorator"),
          optional: true
        },
        mixins: {
          validate: (0, _utils.assertNodeType)("InterfaceExtends"),
          optional: true
        },
        declare: {
          validate: (0, _utils.assertValueType)("boolean"),
          optional: true
        },
        abstract: {
          validate: (0, _utils.assertValueType)("boolean"),
          optional: true
        }
      },
      validate: !process.env.BABEL_TYPES_8_BREAKING ? void 0 : (function() {
        const identifier = (0, _utils.assertNodeType)("Identifier");
        return function(parent, key, node) {
          if (!(0, _is.default)("ExportDefaultDeclaration", parent)) {
            identifier(node, "id", node.id);
          }
        };
      })()
    });
    var importAttributes = exports2.importAttributes = {
      attributes: {
        optional: true,
        validate: (0, _utils.arrayOfType)("ImportAttribute")
      }
    };
    importAttributes.assertions = {
      deprecated: true,
      optional: true,
      validate: (0, _utils.arrayOfType)("ImportAttribute")
    };
    defineType("ExportAllDeclaration", {
      builder: ["source", "attributes"],
      visitor: ["source", "attributes", "assertions"],
      aliases: ["Statement", "Declaration", "ImportOrExportDeclaration", "ExportDeclaration"],
      fields: Object.assign({
        source: {
          validate: (0, _utils.assertNodeType)("StringLiteral")
        },
        exportKind: (0, _utils.validateOptional)((0, _utils.assertOneOf)("type", "value"))
      }, importAttributes)
    });
    defineType("ExportDefaultDeclaration", {
      visitor: ["declaration"],
      aliases: ["Statement", "Declaration", "ImportOrExportDeclaration", "ExportDeclaration"],
      fields: {
        declaration: (0, _utils.validateType)("TSDeclareFunction", "FunctionDeclaration", "ClassDeclaration", "Expression"),
        exportKind: (0, _utils.validateOptional)((0, _utils.assertOneOf)("value"))
      }
    });
    defineType("ExportNamedDeclaration", {
      builder: ["declaration", "specifiers", "source", "attributes"],
      visitor: ["declaration", "specifiers", "source", "attributes", "assertions"],
      aliases: ["Statement", "Declaration", "ImportOrExportDeclaration", "ExportDeclaration"],
      fields: Object.assign({
        declaration: {
          optional: true,
          validate: process.env.BABEL_TYPES_8_BREAKING ? (0, _utils.chain)((0, _utils.assertNodeType)("Declaration"), Object.assign(function(node, key, val) {
            if (val && node.specifiers.length) {
              throw new TypeError("Only declaration or specifiers is allowed on ExportNamedDeclaration");
            }
            if (val && node.source) {
              throw new TypeError("Cannot export a declaration from a source");
            }
          }, {
            oneOfNodeTypes: ["Declaration"]
          })) : (0, _utils.assertNodeType)("Declaration")
        }
      }, importAttributes, {
        specifiers: {
          default: [],
          validate: (0, _utils.arrayOf)((function() {
            const sourced = (0, _utils.assertNodeType)("ExportSpecifier", "ExportDefaultSpecifier", "ExportNamespaceSpecifier");
            const sourceless = (0, _utils.assertNodeType)("ExportSpecifier");
            if (!process.env.BABEL_TYPES_8_BREAKING) return sourced;
            return Object.assign(function(node, key, val) {
              const validator = node.source ? sourced : sourceless;
              validator(node, key, val);
            }, {
              oneOfNodeTypes: ["ExportSpecifier", "ExportDefaultSpecifier", "ExportNamespaceSpecifier"]
            });
          })())
        },
        source: {
          validate: (0, _utils.assertNodeType)("StringLiteral"),
          optional: true
        },
        exportKind: (0, _utils.validateOptional)((0, _utils.assertOneOf)("type", "value"))
      })
    });
    defineType("ExportSpecifier", {
      visitor: ["local", "exported"],
      aliases: ["ModuleSpecifier"],
      fields: {
        local: {
          validate: (0, _utils.assertNodeType)("Identifier")
        },
        exported: {
          validate: (0, _utils.assertNodeType)("Identifier", "StringLiteral")
        },
        exportKind: {
          validate: (0, _utils.assertOneOf)("type", "value"),
          optional: true
        }
      }
    });
    defineType("ForOfStatement", {
      visitor: ["left", "right", "body"],
      builder: ["left", "right", "body", "await"],
      aliases: ["Scopable", "Statement", "For", "BlockParent", "Loop", "ForXStatement"],
      fields: {
        left: {
          validate: (function() {
            if (!process.env.BABEL_TYPES_8_BREAKING) {
              return (0, _utils.assertNodeType)("VariableDeclaration", "LVal");
            }
            const declaration = (0, _utils.assertNodeType)("VariableDeclaration");
            const lval = (0, _utils.assertNodeType)("Identifier", "MemberExpression", "ArrayPattern", "ObjectPattern", "TSAsExpression", "TSSatisfiesExpression", "TSTypeAssertion", "TSNonNullExpression");
            return Object.assign(function(node, key, val) {
              if ((0, _is.default)("VariableDeclaration", val)) {
                declaration(node, key, val);
              } else {
                lval(node, key, val);
              }
            }, {
              oneOfNodeTypes: ["VariableDeclaration", "Identifier", "MemberExpression", "ArrayPattern", "ObjectPattern", "TSAsExpression", "TSSatisfiesExpression", "TSTypeAssertion", "TSNonNullExpression"]
            });
          })()
        },
        right: {
          validate: (0, _utils.assertNodeType)("Expression")
        },
        body: {
          validate: (0, _utils.assertNodeType)("Statement")
        },
        await: {
          default: false
        }
      }
    });
    defineType("ImportDeclaration", {
      builder: ["specifiers", "source", "attributes"],
      visitor: ["specifiers", "source", "attributes", "assertions"],
      aliases: ["Statement", "Declaration", "ImportOrExportDeclaration"],
      fields: Object.assign({}, importAttributes, {
        module: {
          optional: true,
          validate: (0, _utils.assertValueType)("boolean")
        },
        phase: {
          default: null,
          validate: (0, _utils.assertOneOf)("source", "defer")
        },
        specifiers: (0, _utils.validateArrayOfType)("ImportSpecifier", "ImportDefaultSpecifier", "ImportNamespaceSpecifier"),
        source: {
          validate: (0, _utils.assertNodeType)("StringLiteral")
        },
        importKind: {
          validate: (0, _utils.assertOneOf)("type", "typeof", "value"),
          optional: true
        }
      })
    });
    defineType("ImportDefaultSpecifier", {
      visitor: ["local"],
      aliases: ["ModuleSpecifier"],
      fields: {
        local: {
          validate: (0, _utils.assertNodeType)("Identifier")
        }
      }
    });
    defineType("ImportNamespaceSpecifier", {
      visitor: ["local"],
      aliases: ["ModuleSpecifier"],
      fields: {
        local: {
          validate: (0, _utils.assertNodeType)("Identifier")
        }
      }
    });
    defineType("ImportSpecifier", {
      visitor: ["imported", "local"],
      builder: ["local", "imported"],
      aliases: ["ModuleSpecifier"],
      fields: {
        local: {
          validate: (0, _utils.assertNodeType)("Identifier")
        },
        imported: {
          validate: (0, _utils.assertNodeType)("Identifier", "StringLiteral")
        },
        importKind: {
          validate: (0, _utils.assertOneOf)("type", "typeof", "value"),
          optional: true
        }
      }
    });
    defineType("ImportExpression", {
      visitor: ["source", "options"],
      aliases: ["Expression"],
      fields: {
        phase: {
          default: null,
          validate: (0, _utils.assertOneOf)("source", "defer")
        },
        source: {
          validate: (0, _utils.assertNodeType)("Expression")
        },
        options: {
          validate: (0, _utils.assertNodeType)("Expression"),
          optional: true
        }
      }
    });
    defineType("MetaProperty", {
      visitor: ["meta", "property"],
      aliases: ["Expression"],
      fields: {
        meta: {
          validate: process.env.BABEL_TYPES_8_BREAKING ? (0, _utils.chain)((0, _utils.assertNodeType)("Identifier"), Object.assign(function(node, key, val) {
            let property;
            switch (val.name) {
              case "function":
                property = "sent";
                break;
              case "new":
                property = "target";
                break;
              case "import":
                property = "meta";
                break;
            }
            if (!(0, _is.default)("Identifier", node.property, {
              name: property
            })) {
              throw new TypeError("Unrecognised MetaProperty");
            }
          }, {
            oneOfNodeTypes: ["Identifier"]
          })) : (0, _utils.assertNodeType)("Identifier")
        },
        property: {
          validate: (0, _utils.assertNodeType)("Identifier")
        }
      }
    });
    var classMethodOrPropertyCommon = () => ({
      abstract: {
        validate: (0, _utils.assertValueType)("boolean"),
        optional: true
      },
      accessibility: {
        validate: (0, _utils.assertOneOf)("public", "private", "protected"),
        optional: true
      },
      static: {
        default: false
      },
      override: {
        default: false
      },
      computed: {
        default: false
      },
      optional: {
        validate: (0, _utils.assertValueType)("boolean"),
        optional: true
      },
      key: {
        validate: (0, _utils.chain)((function() {
          const normal = (0, _utils.assertNodeType)("Identifier", "StringLiteral", "NumericLiteral", "BigIntLiteral");
          const computed = (0, _utils.assertNodeType)("Expression");
          return function(node, key, val) {
            const validator = node.computed ? computed : normal;
            validator(node, key, val);
          };
        })(), (0, _utils.assertNodeType)("Identifier", "StringLiteral", "NumericLiteral", "BigIntLiteral", "Expression"))
      }
    });
    exports2.classMethodOrPropertyCommon = classMethodOrPropertyCommon;
    var classMethodOrDeclareMethodCommon = () => Object.assign({}, functionCommon(), classMethodOrPropertyCommon(), {
      params: (0, _utils.validateArrayOfType)("FunctionParameter", "TSParameterProperty"),
      kind: {
        validate: (0, _utils.assertOneOf)("get", "set", "method", "constructor"),
        default: "method"
      },
      access: {
        validate: (0, _utils.chain)((0, _utils.assertValueType)("string"), (0, _utils.assertOneOf)("public", "private", "protected")),
        optional: true
      },
      decorators: {
        validate: (0, _utils.arrayOfType)("Decorator"),
        optional: true
      }
    });
    exports2.classMethodOrDeclareMethodCommon = classMethodOrDeclareMethodCommon;
    defineType("ClassMethod", Object.assign({
      aliases: ["Function", "Scopable", "BlockParent", "FunctionParent", "Method"],
      builder: ["kind", "key", "params", "body", "computed", "static", "generator", "async"],
      visitor: ["decorators", "key", "typeParameters", "params", "returnType", "body"]
    }, classMethodOrPropertyUnionShapeCommon(), {
      fields: Object.assign({}, classMethodOrDeclareMethodCommon(), functionTypeAnnotationCommon(), {
        body: {
          validate: (0, _utils.assertNodeType)("BlockStatement")
        }
      })
    }));
    defineType("ObjectPattern", {
      visitor: ["decorators", "properties", "typeAnnotation"],
      builder: ["properties"],
      aliases: ["FunctionParameter", "Pattern", "PatternLike", "LVal"],
      fields: Object.assign({}, patternLikeCommon(), {
        properties: (0, _utils.validateArrayOfType)("RestElement", "ObjectProperty")
      })
    });
    defineType("SpreadElement", {
      visitor: ["argument"],
      aliases: ["UnaryLike"],
      deprecatedAlias: "SpreadProperty",
      fields: {
        argument: {
          validate: (0, _utils.assertNodeType)("Expression")
        }
      }
    });
    defineType("Super", {
      aliases: ["Expression"]
    });
    defineType("TaggedTemplateExpression", {
      visitor: ["tag", "typeParameters", "quasi"],
      builder: ["tag", "quasi"],
      aliases: ["Expression"],
      fields: {
        tag: {
          validate: (0, _utils.assertNodeType)("Expression")
        },
        quasi: {
          validate: (0, _utils.assertNodeType)("TemplateLiteral")
        },
        ["typeParameters"]: {
          validate: (0, _utils.assertNodeType)("TypeParameterInstantiation", "TSTypeParameterInstantiation"),
          optional: true
        }
      }
    });
    defineType("TemplateElement", {
      builder: ["value", "tail"],
      fields: {
        value: {
          validate: (0, _utils.chain)((0, _utils.assertShape)({
            raw: {
              validate: (0, _utils.assertValueType)("string")
            },
            cooked: {
              validate: (0, _utils.assertValueType)("string"),
              optional: true
            }
          }), function templateElementCookedValidator(node) {
            const raw = node.value.raw;
            let unterminatedCalled = false;
            const error = () => {
              throw new Error("Internal @babel/types error.");
            };
            const {
              str,
              firstInvalidLoc
            } = (0, _helperStringParser.readStringContents)("template", raw, 0, 0, 0, {
              unterminated() {
                unterminatedCalled = true;
              },
              strictNumericEscape: error,
              invalidEscapeSequence: error,
              numericSeparatorInEscapeSequence: error,
              unexpectedNumericSeparator: error,
              invalidDigit: error,
              invalidCodePoint: error
            });
            if (!unterminatedCalled) throw new Error("Invalid raw");
            node.value.cooked = firstInvalidLoc ? null : str;
          })
        },
        tail: {
          default: false
        }
      }
    });
    defineType("TemplateLiteral", {
      visitor: ["quasis", "expressions"],
      aliases: ["Expression", "Literal"],
      fields: {
        quasis: (0, _utils.validateArrayOfType)("TemplateElement"),
        expressions: {
          validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Expression", "TSType")), function(node, key, val) {
            if (node.quasis.length !== val.length + 1) {
              throw new TypeError(`Number of ${node.type} quasis should be exactly one more than the number of expressions.
Expected ${val.length + 1} quasis but got ${node.quasis.length}`);
            }
          })
        }
      }
    });
    defineType("YieldExpression", {
      builder: ["argument", "delegate"],
      visitor: ["argument"],
      aliases: ["Expression", "Terminatorless"],
      fields: {
        delegate: {
          validate: process.env.BABEL_TYPES_8_BREAKING ? (0, _utils.chain)((0, _utils.assertValueType)("boolean"), Object.assign(function(node, key, val) {
            if (val && !node.argument) {
              throw new TypeError("Property delegate of YieldExpression cannot be true if there is no argument");
            }
          }, {
            type: "boolean"
          })) : (0, _utils.assertValueType)("boolean"),
          default: false
        },
        argument: {
          optional: true,
          validate: (0, _utils.assertNodeType)("Expression")
        }
      }
    });
    defineType("AwaitExpression", {
      builder: ["argument"],
      visitor: ["argument"],
      aliases: ["Expression", "Terminatorless"],
      fields: {
        argument: {
          validate: (0, _utils.assertNodeType)("Expression")
        }
      }
    });
    defineType("Import", {
      aliases: ["Expression"]
    });
    defineType("BigIntLiteral", {
      builder: ["value"],
      fields: {
        value: {
          validate: (0, _utils.assertValueType)("string")
        }
      },
      aliases: ["Expression", "Pureish", "Literal", "Immutable"]
    });
    defineType("ExportNamespaceSpecifier", {
      visitor: ["exported"],
      aliases: ["ModuleSpecifier"],
      fields: {
        exported: {
          validate: (0, _utils.assertNodeType)("Identifier")
        }
      }
    });
    defineType("OptionalMemberExpression", {
      builder: ["object", "property", "computed", "optional"],
      visitor: ["object", "property"],
      aliases: ["Expression"],
      fields: {
        object: {
          validate: (0, _utils.assertNodeType)("Expression")
        },
        property: {
          validate: (function() {
            const normal = (0, _utils.assertNodeType)("Identifier");
            const computed = (0, _utils.assertNodeType)("Expression");
            const validator = Object.assign(function(node, key, val) {
              const validator2 = node.computed ? computed : normal;
              validator2(node, key, val);
            }, {
              oneOfNodeTypes: ["Expression", "Identifier"]
            });
            return validator;
          })()
        },
        computed: {
          default: false
        },
        optional: {
          validate: !process.env.BABEL_TYPES_8_BREAKING ? (0, _utils.assertValueType)("boolean") : (0, _utils.chain)((0, _utils.assertValueType)("boolean"), (0, _utils.assertOptionalChainStart)())
        }
      }
    });
    defineType("OptionalCallExpression", {
      visitor: ["callee", "typeParameters", "typeArguments", "arguments"],
      builder: ["callee", "arguments", "optional"],
      aliases: ["Expression"],
      fields: Object.assign({
        callee: {
          validate: (0, _utils.assertNodeType)("Expression")
        },
        arguments: (0, _utils.validateArrayOfType)("Expression", "SpreadElement", "ArgumentPlaceholder"),
        optional: {
          validate: !process.env.BABEL_TYPES_8_BREAKING ? (0, _utils.assertValueType)("boolean") : (0, _utils.chain)((0, _utils.assertValueType)("boolean"), (0, _utils.assertOptionalChainStart)())
        },
        typeArguments: {
          validate: (0, _utils.assertNodeType)("TypeParameterInstantiation"),
          optional: true
        }
      }, {
        typeParameters: {
          validate: (0, _utils.assertNodeType)("TSTypeParameterInstantiation"),
          optional: true
        }
      })
    });
    defineType("ClassProperty", Object.assign({
      visitor: ["decorators", "variance", "key", "typeAnnotation", "value"],
      builder: ["key", "value", "typeAnnotation", "decorators", "computed", "static"],
      aliases: ["Property"]
    }, classMethodOrPropertyUnionShapeCommon(), {
      fields: Object.assign({}, classMethodOrPropertyCommon(), {
        value: {
          validate: (0, _utils.assertNodeType)("Expression"),
          optional: true
        },
        definite: {
          validate: (0, _utils.assertValueType)("boolean"),
          optional: true
        },
        typeAnnotation: {
          validate: (0, _utils.assertNodeType)("TypeAnnotation", "TSTypeAnnotation", "Noop"),
          optional: true
        },
        decorators: {
          validate: (0, _utils.arrayOfType)("Decorator"),
          optional: true
        },
        readonly: {
          validate: (0, _utils.assertValueType)("boolean"),
          optional: true
        },
        declare: {
          validate: (0, _utils.assertValueType)("boolean"),
          optional: true
        },
        variance: {
          validate: (0, _utils.assertNodeType)("Variance"),
          optional: true
        }
      })
    }));
    defineType("ClassAccessorProperty", Object.assign({
      visitor: ["decorators", "key", "typeAnnotation", "value"],
      builder: ["key", "value", "typeAnnotation", "decorators", "computed", "static"],
      aliases: ["Property", "Accessor"]
    }, classMethodOrPropertyUnionShapeCommon(true), {
      fields: Object.assign({}, classMethodOrPropertyCommon(), {
        key: {
          validate: (0, _utils.chain)((function() {
            const normal = (0, _utils.assertNodeType)("Identifier", "StringLiteral", "NumericLiteral", "BigIntLiteral", "PrivateName");
            const computed = (0, _utils.assertNodeType)("Expression");
            return function(node, key, val) {
              const validator = node.computed ? computed : normal;
              validator(node, key, val);
            };
          })(), (0, _utils.assertNodeType)("Identifier", "StringLiteral", "NumericLiteral", "BigIntLiteral", "Expression", "PrivateName"))
        },
        value: {
          validate: (0, _utils.assertNodeType)("Expression"),
          optional: true
        },
        definite: {
          validate: (0, _utils.assertValueType)("boolean"),
          optional: true
        },
        typeAnnotation: {
          validate: (0, _utils.assertNodeType)("TypeAnnotation", "TSTypeAnnotation", "Noop"),
          optional: true
        },
        decorators: {
          validate: (0, _utils.arrayOfType)("Decorator"),
          optional: true
        },
        readonly: {
          validate: (0, _utils.assertValueType)("boolean"),
          optional: true
        },
        declare: {
          validate: (0, _utils.assertValueType)("boolean"),
          optional: true
        },
        variance: {
          validate: (0, _utils.assertNodeType)("Variance"),
          optional: true
        }
      })
    }));
    defineType("ClassPrivateProperty", {
      visitor: ["decorators", "variance", "key", "typeAnnotation", "value"],
      builder: ["key", "value", "decorators", "static"],
      aliases: ["Property", "Private"],
      fields: {
        key: {
          validate: (0, _utils.assertNodeType)("PrivateName")
        },
        value: {
          validate: (0, _utils.assertNodeType)("Expression"),
          optional: true
        },
        typeAnnotation: {
          validate: (0, _utils.assertNodeType)("TypeAnnotation", "TSTypeAnnotation", "Noop"),
          optional: true
        },
        decorators: {
          validate: (0, _utils.arrayOfType)("Decorator"),
          optional: true
        },
        static: {
          validate: (0, _utils.assertValueType)("boolean"),
          default: false
        },
        readonly: {
          validate: (0, _utils.assertValueType)("boolean"),
          optional: true
        },
        optional: {
          validate: (0, _utils.assertValueType)("boolean"),
          optional: true
        },
        definite: {
          validate: (0, _utils.assertValueType)("boolean"),
          optional: true
        },
        variance: {
          validate: (0, _utils.assertNodeType)("Variance"),
          optional: true
        }
      }
    });
    defineType("ClassPrivateMethod", {
      builder: ["kind", "key", "params", "body", "static"],
      visitor: ["decorators", "key", "typeParameters", "params", "returnType", "body"],
      aliases: ["Function", "Scopable", "BlockParent", "FunctionParent", "Method", "Private"],
      fields: Object.assign({}, classMethodOrDeclareMethodCommon(), functionTypeAnnotationCommon(), {
        kind: {
          validate: (0, _utils.assertOneOf)("get", "set", "method"),
          default: "method"
        },
        key: {
          validate: (0, _utils.assertNodeType)("PrivateName")
        },
        body: {
          validate: (0, _utils.assertNodeType)("BlockStatement")
        }
      })
    });
    defineType("PrivateName", {
      visitor: ["id"],
      aliases: ["Private"],
      fields: {
        id: {
          validate: (0, _utils.assertNodeType)("Identifier")
        }
      }
    });
    defineType("StaticBlock", {
      visitor: ["body"],
      fields: {
        body: (0, _utils.validateArrayOfType)("Statement")
      },
      aliases: ["Scopable", "BlockParent", "FunctionParent"]
    });
    defineType("ImportAttribute", {
      visitor: ["key", "value"],
      fields: {
        key: {
          validate: (0, _utils.assertNodeType)("Identifier", "StringLiteral")
        },
        value: {
          validate: (0, _utils.assertNodeType)("StringLiteral")
        }
      }
    });
  }
});

// node_modules/@babel/types/lib/definitions/flow.js
var require_flow = __commonJS({
  "node_modules/@babel/types/lib/definitions/flow.js"() {
    "use strict";
    var _core = require_core();
    var _utils = require_utils();
    var defineType = (0, _utils.defineAliasedType)("Flow");
    var defineInterfaceishType = (name) => {
      const isDeclareClass = name === "DeclareClass";
      defineType(name, {
        builder: ["id", "typeParameters", "extends", "body"],
        visitor: ["id", "typeParameters", "extends", ...isDeclareClass ? ["mixins", "implements"] : [], "body"],
        aliases: ["FlowDeclaration", "Statement", "Declaration"],
        fields: Object.assign({
          id: (0, _utils.validateType)("Identifier"),
          typeParameters: (0, _utils.validateOptionalType)("TypeParameterDeclaration"),
          extends: (0, _utils.validateOptional)((0, _utils.arrayOfType)("InterfaceExtends"))
        }, isDeclareClass ? {
          mixins: (0, _utils.validateOptional)((0, _utils.arrayOfType)("InterfaceExtends")),
          implements: (0, _utils.validateOptional)((0, _utils.arrayOfType)("ClassImplements"))
        } : {}, {
          body: (0, _utils.validateType)("ObjectTypeAnnotation")
        })
      });
    };
    defineType("AnyTypeAnnotation", {
      aliases: ["FlowType", "FlowBaseAnnotation"]
    });
    defineType("ArrayTypeAnnotation", {
      visitor: ["elementType"],
      aliases: ["FlowType"],
      fields: {
        elementType: (0, _utils.validateType)("FlowType")
      }
    });
    defineType("BooleanTypeAnnotation", {
      aliases: ["FlowType", "FlowBaseAnnotation"]
    });
    defineType("BooleanLiteralTypeAnnotation", {
      builder: ["value"],
      aliases: ["FlowType"],
      fields: {
        value: (0, _utils.validate)((0, _utils.assertValueType)("boolean"))
      }
    });
    defineType("NullLiteralTypeAnnotation", {
      aliases: ["FlowType", "FlowBaseAnnotation"]
    });
    defineType("ClassImplements", {
      visitor: ["id", "typeParameters"],
      fields: {
        id: (0, _utils.validateType)("Identifier"),
        typeParameters: (0, _utils.validateOptionalType)("TypeParameterInstantiation")
      }
    });
    defineInterfaceishType("DeclareClass");
    defineType("DeclareFunction", {
      builder: ["id"],
      visitor: ["id", "predicate"],
      aliases: ["FlowDeclaration", "Statement", "Declaration"],
      fields: {
        id: (0, _utils.validateType)("Identifier"),
        predicate: (0, _utils.validateOptionalType)("DeclaredPredicate")
      }
    });
    defineInterfaceishType("DeclareInterface");
    defineType("DeclareModule", {
      builder: ["id", "body", "kind"],
      visitor: ["id", "body"],
      aliases: ["FlowDeclaration", "Statement", "Declaration"],
      fields: {
        id: (0, _utils.validateType)("Identifier", "StringLiteral"),
        body: (0, _utils.validateType)("BlockStatement"),
        kind: (0, _utils.validateOptional)((0, _utils.assertOneOf)("CommonJS", "ES"))
      }
    });
    defineType("DeclareModuleExports", {
      visitor: ["typeAnnotation"],
      aliases: ["FlowDeclaration", "Statement", "Declaration"],
      fields: {
        typeAnnotation: (0, _utils.validateType)("TypeAnnotation")
      }
    });
    defineType("DeclareTypeAlias", {
      visitor: ["id", "typeParameters", "right"],
      aliases: ["FlowDeclaration", "Statement", "Declaration"],
      fields: {
        id: (0, _utils.validateType)("Identifier"),
        typeParameters: (0, _utils.validateOptionalType)("TypeParameterDeclaration"),
        right: (0, _utils.validateType)("FlowType")
      }
    });
    defineType("DeclareOpaqueType", {
      visitor: ["id", "typeParameters", "supertype"],
      aliases: ["FlowDeclaration", "Statement", "Declaration"],
      fields: {
        id: (0, _utils.validateType)("Identifier"),
        typeParameters: (0, _utils.validateOptionalType)("TypeParameterDeclaration"),
        supertype: (0, _utils.validateOptionalType)("FlowType"),
        impltype: (0, _utils.validateOptionalType)("FlowType")
      }
    });
    defineType("DeclareVariable", {
      visitor: ["id"],
      aliases: ["FlowDeclaration", "Statement", "Declaration"],
      fields: {
        id: (0, _utils.validateType)("Identifier")
      }
    });
    defineType("DeclareExportDeclaration", {
      visitor: ["declaration", "specifiers", "source", "attributes"],
      aliases: ["FlowDeclaration", "Statement", "Declaration"],
      fields: Object.assign({
        declaration: (0, _utils.validateOptionalType)("Flow"),
        specifiers: (0, _utils.validateOptional)((0, _utils.arrayOfType)("ExportSpecifier", "ExportNamespaceSpecifier")),
        source: (0, _utils.validateOptionalType)("StringLiteral"),
        default: (0, _utils.validateOptional)((0, _utils.assertValueType)("boolean"))
      }, _core.importAttributes)
    });
    defineType("DeclareExportAllDeclaration", {
      visitor: ["source", "attributes"],
      aliases: ["FlowDeclaration", "Statement", "Declaration"],
      fields: Object.assign({
        source: (0, _utils.validateType)("StringLiteral"),
        exportKind: (0, _utils.validateOptional)((0, _utils.assertOneOf)("type", "value"))
      }, _core.importAttributes)
    });
    defineType("DeclaredPredicate", {
      visitor: ["value"],
      aliases: ["FlowPredicate"],
      fields: {
        value: (0, _utils.validateType)("Flow")
      }
    });
    defineType("ExistsTypeAnnotation", {
      aliases: ["FlowType"]
    });
    defineType("FunctionTypeAnnotation", {
      builder: ["typeParameters", "params", "rest", "returnType"],
      visitor: ["typeParameters", "this", "params", "rest", "returnType"],
      aliases: ["FlowType"],
      fields: {
        typeParameters: (0, _utils.validateOptionalType)("TypeParameterDeclaration"),
        params: (0, _utils.validateArrayOfType)("FunctionTypeParam"),
        rest: (0, _utils.validateOptionalType)("FunctionTypeParam"),
        this: (0, _utils.validateOptionalType)("FunctionTypeParam"),
        returnType: (0, _utils.validateType)("FlowType")
      }
    });
    defineType("FunctionTypeParam", {
      visitor: ["name", "typeAnnotation"],
      fields: {
        name: (0, _utils.validateOptionalType)("Identifier"),
        typeAnnotation: (0, _utils.validateType)("FlowType"),
        optional: (0, _utils.validateOptional)((0, _utils.assertValueType)("boolean"))
      }
    });
    defineType("GenericTypeAnnotation", {
      visitor: ["id", "typeParameters"],
      aliases: ["FlowType"],
      fields: {
        id: (0, _utils.validateType)("Identifier", "QualifiedTypeIdentifier"),
        typeParameters: (0, _utils.validateOptionalType)("TypeParameterInstantiation")
      }
    });
    defineType("InferredPredicate", {
      aliases: ["FlowPredicate"]
    });
    defineType("InterfaceExtends", {
      visitor: ["id", "typeParameters"],
      fields: {
        id: (0, _utils.validateType)("Identifier", "QualifiedTypeIdentifier"),
        typeParameters: (0, _utils.validateOptionalType)("TypeParameterInstantiation")
      }
    });
    defineInterfaceishType("InterfaceDeclaration");
    defineType("InterfaceTypeAnnotation", {
      visitor: ["extends", "body"],
      aliases: ["FlowType"],
      fields: {
        extends: (0, _utils.validateOptional)((0, _utils.arrayOfType)("InterfaceExtends")),
        body: (0, _utils.validateType)("ObjectTypeAnnotation")
      }
    });
    defineType("IntersectionTypeAnnotation", {
      visitor: ["types"],
      aliases: ["FlowType"],
      fields: {
        types: (0, _utils.validate)((0, _utils.arrayOfType)("FlowType"))
      }
    });
    defineType("MixedTypeAnnotation", {
      aliases: ["FlowType", "FlowBaseAnnotation"]
    });
    defineType("EmptyTypeAnnotation", {
      aliases: ["FlowType", "FlowBaseAnnotation"]
    });
    defineType("NullableTypeAnnotation", {
      visitor: ["typeAnnotation"],
      aliases: ["FlowType"],
      fields: {
        typeAnnotation: (0, _utils.validateType)("FlowType")
      }
    });
    defineType("NumberLiteralTypeAnnotation", {
      builder: ["value"],
      aliases: ["FlowType"],
      fields: {
        value: (0, _utils.validate)((0, _utils.assertValueType)("number"))
      }
    });
    defineType("NumberTypeAnnotation", {
      aliases: ["FlowType", "FlowBaseAnnotation"]
    });
    defineType("ObjectTypeAnnotation", {
      visitor: ["properties", "indexers", "callProperties", "internalSlots"],
      aliases: ["FlowType"],
      builder: ["properties", "indexers", "callProperties", "internalSlots", "exact"],
      fields: {
        properties: (0, _utils.validate)((0, _utils.arrayOfType)("ObjectTypeProperty", "ObjectTypeSpreadProperty")),
        indexers: {
          validate: (0, _utils.arrayOfType)("ObjectTypeIndexer"),
          optional: true,
          default: []
        },
        callProperties: {
          validate: (0, _utils.arrayOfType)("ObjectTypeCallProperty"),
          optional: true,
          default: []
        },
        internalSlots: {
          validate: (0, _utils.arrayOfType)("ObjectTypeInternalSlot"),
          optional: true,
          default: []
        },
        exact: {
          validate: (0, _utils.assertValueType)("boolean"),
          default: false
        },
        inexact: (0, _utils.validateOptional)((0, _utils.assertValueType)("boolean"))
      }
    });
    defineType("ObjectTypeInternalSlot", {
      visitor: ["id", "value"],
      builder: ["id", "value", "optional", "static", "method"],
      aliases: ["UserWhitespacable"],
      fields: {
        id: (0, _utils.validateType)("Identifier"),
        value: (0, _utils.validateType)("FlowType"),
        optional: (0, _utils.validate)((0, _utils.assertValueType)("boolean")),
        static: (0, _utils.validate)((0, _utils.assertValueType)("boolean")),
        method: (0, _utils.validate)((0, _utils.assertValueType)("boolean"))
      }
    });
    defineType("ObjectTypeCallProperty", {
      visitor: ["value"],
      aliases: ["UserWhitespacable"],
      fields: {
        value: (0, _utils.validateType)("FlowType"),
        static: (0, _utils.validate)((0, _utils.assertValueType)("boolean"))
      }
    });
    defineType("ObjectTypeIndexer", {
      visitor: ["variance", "id", "key", "value"],
      builder: ["id", "key", "value", "variance"],
      aliases: ["UserWhitespacable"],
      fields: {
        id: (0, _utils.validateOptionalType)("Identifier"),
        key: (0, _utils.validateType)("FlowType"),
        value: (0, _utils.validateType)("FlowType"),
        static: (0, _utils.validate)((0, _utils.assertValueType)("boolean")),
        variance: (0, _utils.validateOptionalType)("Variance")
      }
    });
    defineType("ObjectTypeProperty", {
      visitor: ["key", "value", "variance"],
      aliases: ["UserWhitespacable"],
      fields: {
        key: (0, _utils.validateType)("Identifier", "StringLiteral"),
        value: (0, _utils.validateType)("FlowType"),
        kind: (0, _utils.validate)((0, _utils.assertOneOf)("init", "get", "set")),
        static: (0, _utils.validate)((0, _utils.assertValueType)("boolean")),
        proto: (0, _utils.validate)((0, _utils.assertValueType)("boolean")),
        optional: (0, _utils.validate)((0, _utils.assertValueType)("boolean")),
        variance: (0, _utils.validateOptionalType)("Variance"),
        method: (0, _utils.validate)((0, _utils.assertValueType)("boolean"))
      }
    });
    defineType("ObjectTypeSpreadProperty", {
      visitor: ["argument"],
      aliases: ["UserWhitespacable"],
      fields: {
        argument: (0, _utils.validateType)("FlowType")
      }
    });
    defineType("OpaqueType", {
      visitor: ["id", "typeParameters", "supertype", "impltype"],
      aliases: ["FlowDeclaration", "Statement", "Declaration"],
      fields: {
        id: (0, _utils.validateType)("Identifier"),
        typeParameters: (0, _utils.validateOptionalType)("TypeParameterDeclaration"),
        supertype: (0, _utils.validateOptionalType)("FlowType"),
        impltype: (0, _utils.validateType)("FlowType")
      }
    });
    defineType("QualifiedTypeIdentifier", {
      visitor: ["qualification", "id"],
      builder: ["id", "qualification"],
      fields: {
        id: (0, _utils.validateType)("Identifier"),
        qualification: (0, _utils.validateType)("Identifier", "QualifiedTypeIdentifier")
      }
    });
    defineType("StringLiteralTypeAnnotation", {
      builder: ["value"],
      aliases: ["FlowType"],
      fields: {
        value: (0, _utils.validate)((0, _utils.assertValueType)("string"))
      }
    });
    defineType("StringTypeAnnotation", {
      aliases: ["FlowType", "FlowBaseAnnotation"]
    });
    defineType("SymbolTypeAnnotation", {
      aliases: ["FlowType", "FlowBaseAnnotation"]
    });
    defineType("ThisTypeAnnotation", {
      aliases: ["FlowType", "FlowBaseAnnotation"]
    });
    defineType("TupleTypeAnnotation", {
      visitor: ["types"],
      aliases: ["FlowType"],
      fields: {
        types: (0, _utils.validate)((0, _utils.arrayOfType)("FlowType"))
      }
    });
    defineType("TypeofTypeAnnotation", {
      visitor: ["argument"],
      aliases: ["FlowType"],
      fields: {
        argument: (0, _utils.validateType)("FlowType")
      }
    });
    defineType("TypeAlias", {
      visitor: ["id", "typeParameters", "right"],
      aliases: ["FlowDeclaration", "Statement", "Declaration"],
      fields: {
        id: (0, _utils.validateType)("Identifier"),
        typeParameters: (0, _utils.validateOptionalType)("TypeParameterDeclaration"),
        right: (0, _utils.validateType)("FlowType")
      }
    });
    defineType("TypeAnnotation", {
      visitor: ["typeAnnotation"],
      fields: {
        typeAnnotation: (0, _utils.validateType)("FlowType")
      }
    });
    defineType("TypeCastExpression", {
      visitor: ["expression", "typeAnnotation"],
      aliases: ["ExpressionWrapper", "Expression"],
      fields: {
        expression: (0, _utils.validateType)("Expression"),
        typeAnnotation: (0, _utils.validateType)("TypeAnnotation")
      }
    });
    defineType("TypeParameter", {
      visitor: ["bound", "default", "variance"],
      fields: {
        name: (0, _utils.validate)((0, _utils.assertValueType)("string")),
        bound: (0, _utils.validateOptionalType)("TypeAnnotation"),
        default: (0, _utils.validateOptionalType)("FlowType"),
        variance: (0, _utils.validateOptionalType)("Variance")
      }
    });
    defineType("TypeParameterDeclaration", {
      visitor: ["params"],
      fields: {
        params: (0, _utils.validate)((0, _utils.arrayOfType)("TypeParameter"))
      }
    });
    defineType("TypeParameterInstantiation", {
      visitor: ["params"],
      fields: {
        params: (0, _utils.validate)((0, _utils.arrayOfType)("FlowType"))
      }
    });
    defineType("UnionTypeAnnotation", {
      visitor: ["types"],
      aliases: ["FlowType"],
      fields: {
        types: (0, _utils.validate)((0, _utils.arrayOfType)("FlowType"))
      }
    });
    defineType("Variance", {
      builder: ["kind"],
      fields: {
        kind: (0, _utils.validate)((0, _utils.assertOneOf)("minus", "plus"))
      }
    });
    defineType("VoidTypeAnnotation", {
      aliases: ["FlowType", "FlowBaseAnnotation"]
    });
    defineType("EnumDeclaration", {
      aliases: ["Statement", "Declaration"],
      visitor: ["id", "body"],
      fields: {
        id: (0, _utils.validateType)("Identifier"),
        body: (0, _utils.validateType)("EnumBooleanBody", "EnumNumberBody", "EnumStringBody", "EnumSymbolBody")
      }
    });
    defineType("EnumBooleanBody", {
      aliases: ["EnumBody"],
      visitor: ["members"],
      fields: {
        explicitType: (0, _utils.validate)((0, _utils.assertValueType)("boolean")),
        members: (0, _utils.validateArrayOfType)("EnumBooleanMember"),
        hasUnknownMembers: (0, _utils.validate)((0, _utils.assertValueType)("boolean"))
      }
    });
    defineType("EnumNumberBody", {
      aliases: ["EnumBody"],
      visitor: ["members"],
      fields: {
        explicitType: (0, _utils.validate)((0, _utils.assertValueType)("boolean")),
        members: (0, _utils.validateArrayOfType)("EnumNumberMember"),
        hasUnknownMembers: (0, _utils.validate)((0, _utils.assertValueType)("boolean"))
      }
    });
    defineType("EnumStringBody", {
      aliases: ["EnumBody"],
      visitor: ["members"],
      fields: {
        explicitType: (0, _utils.validate)((0, _utils.assertValueType)("boolean")),
        members: (0, _utils.validateArrayOfType)("EnumStringMember", "EnumDefaultedMember"),
        hasUnknownMembers: (0, _utils.validate)((0, _utils.assertValueType)("boolean"))
      }
    });
    defineType("EnumSymbolBody", {
      aliases: ["EnumBody"],
      visitor: ["members"],
      fields: {
        members: (0, _utils.validateArrayOfType)("EnumDefaultedMember"),
        hasUnknownMembers: (0, _utils.validate)((0, _utils.assertValueType)("boolean"))
      }
    });
    defineType("EnumBooleanMember", {
      aliases: ["EnumMember"],
      builder: ["id"],
      visitor: ["id", "init"],
      fields: {
        id: (0, _utils.validateType)("Identifier"),
        init: (0, _utils.validateType)("BooleanLiteral")
      }
    });
    defineType("EnumNumberMember", {
      aliases: ["EnumMember"],
      visitor: ["id", "init"],
      fields: {
        id: (0, _utils.validateType)("Identifier"),
        init: (0, _utils.validateType)("NumericLiteral")
      }
    });
    defineType("EnumStringMember", {
      aliases: ["EnumMember"],
      visitor: ["id", "init"],
      fields: {
        id: (0, _utils.validateType)("Identifier"),
        init: (0, _utils.validateType)("StringLiteral")
      }
    });
    defineType("EnumDefaultedMember", {
      aliases: ["EnumMember"],
      visitor: ["id"],
      fields: {
        id: (0, _utils.validateType)("Identifier")
      }
    });
    defineType("IndexedAccessType", {
      visitor: ["objectType", "indexType"],
      aliases: ["FlowType"],
      fields: {
        objectType: (0, _utils.validateType)("FlowType"),
        indexType: (0, _utils.validateType)("FlowType")
      }
    });
    defineType("OptionalIndexedAccessType", {
      visitor: ["objectType", "indexType"],
      aliases: ["FlowType"],
      fields: {
        objectType: (0, _utils.validateType)("FlowType"),
        indexType: (0, _utils.validateType)("FlowType"),
        optional: (0, _utils.validate)((0, _utils.assertValueType)("boolean"))
      }
    });
  }
});

// node_modules/@babel/types/lib/definitions/jsx.js
var require_jsx = __commonJS({
  "node_modules/@babel/types/lib/definitions/jsx.js"() {
    "use strict";
    var _utils = require_utils();
    var defineType = (0, _utils.defineAliasedType)("JSX");
    defineType("JSXAttribute", {
      visitor: ["name", "value"],
      aliases: ["Immutable"],
      fields: {
        name: {
          validate: (0, _utils.assertNodeType)("JSXIdentifier", "JSXNamespacedName")
        },
        value: {
          optional: true,
          validate: (0, _utils.assertNodeType)("JSXElement", "JSXFragment", "StringLiteral", "JSXExpressionContainer")
        }
      }
    });
    defineType("JSXClosingElement", {
      visitor: ["name"],
      aliases: ["Immutable"],
      fields: {
        name: {
          validate: (0, _utils.assertNodeType)("JSXIdentifier", "JSXMemberExpression", "JSXNamespacedName")
        }
      }
    });
    defineType("JSXElement", {
      builder: ["openingElement", "closingElement", "children", "selfClosing"],
      visitor: ["openingElement", "children", "closingElement"],
      aliases: ["Immutable", "Expression"],
      fields: Object.assign({
        openingElement: {
          validate: (0, _utils.assertNodeType)("JSXOpeningElement")
        },
        closingElement: {
          optional: true,
          validate: (0, _utils.assertNodeType)("JSXClosingElement")
        },
        children: (0, _utils.validateArrayOfType)("JSXText", "JSXExpressionContainer", "JSXSpreadChild", "JSXElement", "JSXFragment")
      }, {
        selfClosing: {
          validate: (0, _utils.assertValueType)("boolean"),
          optional: true
        }
      })
    });
    defineType("JSXEmptyExpression", {});
    defineType("JSXExpressionContainer", {
      visitor: ["expression"],
      aliases: ["Immutable"],
      fields: {
        expression: {
          validate: (0, _utils.assertNodeType)("Expression", "JSXEmptyExpression")
        }
      }
    });
    defineType("JSXSpreadChild", {
      visitor: ["expression"],
      aliases: ["Immutable"],
      fields: {
        expression: {
          validate: (0, _utils.assertNodeType)("Expression")
        }
      }
    });
    defineType("JSXIdentifier", {
      builder: ["name"],
      fields: {
        name: {
          validate: (0, _utils.assertValueType)("string")
        }
      }
    });
    defineType("JSXMemberExpression", {
      visitor: ["object", "property"],
      fields: {
        object: {
          validate: (0, _utils.assertNodeType)("JSXMemberExpression", "JSXIdentifier")
        },
        property: {
          validate: (0, _utils.assertNodeType)("JSXIdentifier")
        }
      }
    });
    defineType("JSXNamespacedName", {
      visitor: ["namespace", "name"],
      fields: {
        namespace: {
          validate: (0, _utils.assertNodeType)("JSXIdentifier")
        },
        name: {
          validate: (0, _utils.assertNodeType)("JSXIdentifier")
        }
      }
    });
    defineType("JSXOpeningElement", {
      builder: ["name", "attributes", "selfClosing"],
      visitor: ["name", "typeParameters", "typeArguments", "attributes"],
      aliases: ["Immutable"],
      fields: Object.assign({
        name: {
          validate: (0, _utils.assertNodeType)("JSXIdentifier", "JSXMemberExpression", "JSXNamespacedName")
        },
        selfClosing: {
          default: false
        },
        attributes: (0, _utils.validateArrayOfType)("JSXAttribute", "JSXSpreadAttribute"),
        typeArguments: {
          validate: (0, _utils.assertNodeType)("TypeParameterInstantiation"),
          optional: true
        }
      }, {
        typeParameters: {
          validate: (0, _utils.assertNodeType)("TSTypeParameterInstantiation"),
          optional: true
        }
      })
    });
    defineType("JSXSpreadAttribute", {
      visitor: ["argument"],
      fields: {
        argument: {
          validate: (0, _utils.assertNodeType)("Expression")
        }
      }
    });
    defineType("JSXText", {
      aliases: ["Immutable"],
      builder: ["value"],
      fields: {
        value: {
          validate: (0, _utils.assertValueType)("string")
        }
      }
    });
    defineType("JSXFragment", {
      builder: ["openingFragment", "closingFragment", "children"],
      visitor: ["openingFragment", "children", "closingFragment"],
      aliases: ["Immutable", "Expression"],
      fields: {
        openingFragment: {
          validate: (0, _utils.assertNodeType)("JSXOpeningFragment")
        },
        closingFragment: {
          validate: (0, _utils.assertNodeType)("JSXClosingFragment")
        },
        children: (0, _utils.validateArrayOfType)("JSXText", "JSXExpressionContainer", "JSXSpreadChild", "JSXElement", "JSXFragment")
      }
    });
    defineType("JSXOpeningFragment", {
      aliases: ["Immutable"]
    });
    defineType("JSXClosingFragment", {
      aliases: ["Immutable"]
    });
  }
});

// node_modules/@babel/types/lib/definitions/placeholders.js
var require_placeholders = __commonJS({
  "node_modules/@babel/types/lib/definitions/placeholders.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.PLACEHOLDERS_FLIPPED_ALIAS = exports2.PLACEHOLDERS_ALIAS = exports2.PLACEHOLDERS = void 0;
    var _utils = require_utils();
    var PLACEHOLDERS = exports2.PLACEHOLDERS = ["Identifier", "StringLiteral", "Expression", "Statement", "Declaration", "BlockStatement", "ClassBody", "Pattern"];
    var PLACEHOLDERS_ALIAS = exports2.PLACEHOLDERS_ALIAS = {
      Declaration: ["Statement"],
      Pattern: ["PatternLike", "LVal"]
    };
    for (const type of PLACEHOLDERS) {
      const alias = _utils.ALIAS_KEYS[type];
      if (alias != null && alias.length) PLACEHOLDERS_ALIAS[type] = alias;
    }
    var PLACEHOLDERS_FLIPPED_ALIAS = exports2.PLACEHOLDERS_FLIPPED_ALIAS = {};
    Object.keys(PLACEHOLDERS_ALIAS).forEach((type) => {
      PLACEHOLDERS_ALIAS[type].forEach((alias) => {
        if (!hasOwnProperty.call(PLACEHOLDERS_FLIPPED_ALIAS, alias)) {
          PLACEHOLDERS_FLIPPED_ALIAS[alias] = [];
        }
        PLACEHOLDERS_FLIPPED_ALIAS[alias].push(type);
      });
    });
  }
});

// node_modules/@babel/types/lib/definitions/misc.js
var require_misc = __commonJS({
  "node_modules/@babel/types/lib/definitions/misc.js"() {
    "use strict";
    var _utils = require_utils();
    var _placeholders = require_placeholders();
    var _core = require_core();
    var defineType = (0, _utils.defineAliasedType)("Miscellaneous");
    defineType("Noop", {
      visitor: []
    });
    defineType("Placeholder", {
      visitor: [],
      builder: ["expectedNode", "name"],
      fields: Object.assign({
        name: {
          validate: (0, _utils.assertNodeType)("Identifier")
        },
        expectedNode: {
          validate: (0, _utils.assertOneOf)(..._placeholders.PLACEHOLDERS)
        }
      }, (0, _core.patternLikeCommon)())
    });
    defineType("V8IntrinsicIdentifier", {
      builder: ["name"],
      fields: {
        name: {
          validate: (0, _utils.assertValueType)("string")
        }
      }
    });
  }
});

// node_modules/@babel/types/lib/definitions/experimental.js
var require_experimental = __commonJS({
  "node_modules/@babel/types/lib/definitions/experimental.js"() {
    "use strict";
    var _utils = require_utils();
    (0, _utils.default)("ArgumentPlaceholder", {});
    (0, _utils.default)("BindExpression", {
      visitor: ["object", "callee"],
      aliases: ["Expression"],
      fields: !process.env.BABEL_TYPES_8_BREAKING ? {
        object: {
          validate: Object.assign(() => {
          }, {
            oneOfNodeTypes: ["Expression"]
          })
        },
        callee: {
          validate: Object.assign(() => {
          }, {
            oneOfNodeTypes: ["Expression"]
          })
        }
      } : {
        object: {
          validate: (0, _utils.assertNodeType)("Expression")
        },
        callee: {
          validate: (0, _utils.assertNodeType)("Expression")
        }
      }
    });
    (0, _utils.default)("Decorator", {
      visitor: ["expression"],
      fields: {
        expression: {
          validate: (0, _utils.assertNodeType)("Expression")
        }
      }
    });
    (0, _utils.default)("DoExpression", {
      visitor: ["body"],
      builder: ["body", "async"],
      aliases: ["Expression"],
      fields: {
        body: {
          validate: (0, _utils.assertNodeType)("BlockStatement")
        },
        async: {
          validate: (0, _utils.assertValueType)("boolean"),
          default: false
        }
      }
    });
    (0, _utils.default)("ExportDefaultSpecifier", {
      visitor: ["exported"],
      aliases: ["ModuleSpecifier"],
      fields: {
        exported: {
          validate: (0, _utils.assertNodeType)("Identifier")
        }
      }
    });
    (0, _utils.default)("RecordExpression", {
      visitor: ["properties"],
      aliases: ["Expression"],
      fields: {
        properties: (0, _utils.validateArrayOfType)("ObjectProperty", "SpreadElement")
      }
    });
    (0, _utils.default)("TupleExpression", {
      fields: {
        elements: {
          validate: (0, _utils.arrayOfType)("Expression", "SpreadElement"),
          default: []
        }
      },
      visitor: ["elements"],
      aliases: ["Expression"]
    });
    (0, _utils.default)("DecimalLiteral", {
      builder: ["value"],
      fields: {
        value: {
          validate: (0, _utils.assertValueType)("string")
        }
      },
      aliases: ["Expression", "Pureish", "Literal", "Immutable"]
    });
    (0, _utils.default)("ModuleExpression", {
      visitor: ["body"],
      fields: {
        body: {
          validate: (0, _utils.assertNodeType)("Program")
        }
      },
      aliases: ["Expression"]
    });
    (0, _utils.default)("TopicReference", {
      aliases: ["Expression"]
    });
    (0, _utils.default)("PipelineTopicExpression", {
      builder: ["expression"],
      visitor: ["expression"],
      fields: {
        expression: {
          validate: (0, _utils.assertNodeType)("Expression")
        }
      },
      aliases: ["Expression"]
    });
    (0, _utils.default)("PipelineBareFunction", {
      builder: ["callee"],
      visitor: ["callee"],
      fields: {
        callee: {
          validate: (0, _utils.assertNodeType)("Expression")
        }
      },
      aliases: ["Expression"]
    });
    (0, _utils.default)("PipelinePrimaryTopicReference", {
      aliases: ["Expression"]
    });
    (0, _utils.default)("VoidPattern", {
      aliases: ["Pattern", "PatternLike", "FunctionParameter"]
    });
  }
});

// node_modules/@babel/types/lib/definitions/typescript.js
var require_typescript = __commonJS({
  "node_modules/@babel/types/lib/definitions/typescript.js"() {
    "use strict";
    var _utils = require_utils();
    var _core = require_core();
    var _is = require_is();
    var defineType = (0, _utils.defineAliasedType)("TypeScript");
    var bool = (0, _utils.assertValueType)("boolean");
    var tSFunctionTypeAnnotationCommon = () => ({
      returnType: {
        validate: (0, _utils.assertNodeType)("TSTypeAnnotation", "Noop"),
        optional: true
      },
      typeParameters: {
        validate: (0, _utils.assertNodeType)("TSTypeParameterDeclaration", "Noop"),
        optional: true
      }
    });
    defineType("TSParameterProperty", {
      aliases: ["LVal"],
      visitor: ["parameter"],
      fields: {
        accessibility: {
          validate: (0, _utils.assertOneOf)("public", "private", "protected"),
          optional: true
        },
        readonly: {
          validate: (0, _utils.assertValueType)("boolean"),
          optional: true
        },
        parameter: {
          validate: (0, _utils.assertNodeType)("Identifier", "AssignmentPattern")
        },
        override: {
          validate: (0, _utils.assertValueType)("boolean"),
          optional: true
        },
        decorators: {
          validate: (0, _utils.arrayOfType)("Decorator"),
          optional: true
        }
      }
    });
    defineType("TSDeclareFunction", {
      aliases: ["Statement", "Declaration"],
      visitor: ["id", "typeParameters", "params", "returnType"],
      fields: Object.assign({}, (0, _core.functionDeclarationCommon)(), tSFunctionTypeAnnotationCommon())
    });
    defineType("TSDeclareMethod", Object.assign({
      visitor: ["decorators", "key", "typeParameters", "params", "returnType"]
    }, (0, _core.classMethodOrPropertyUnionShapeCommon)(), {
      fields: Object.assign({}, (0, _core.classMethodOrDeclareMethodCommon)(), tSFunctionTypeAnnotationCommon())
    }));
    defineType("TSQualifiedName", {
      aliases: ["TSEntityName"],
      visitor: ["left", "right"],
      fields: {
        left: (0, _utils.validateType)("TSEntityName"),
        right: (0, _utils.validateType)("Identifier")
      }
    });
    var signatureDeclarationCommon = () => ({
      typeParameters: (0, _utils.validateOptionalType)("TSTypeParameterDeclaration"),
      ["parameters"]: (0, _utils.validateArrayOfType)("ArrayPattern", "Identifier", "ObjectPattern", "RestElement"),
      ["typeAnnotation"]: (0, _utils.validateOptionalType)("TSTypeAnnotation")
    });
    var callConstructSignatureDeclaration = {
      aliases: ["TSTypeElement"],
      visitor: ["typeParameters", "parameters", "typeAnnotation"],
      fields: signatureDeclarationCommon()
    };
    defineType("TSCallSignatureDeclaration", callConstructSignatureDeclaration);
    defineType("TSConstructSignatureDeclaration", callConstructSignatureDeclaration);
    var namedTypeElementCommon = () => ({
      key: (0, _utils.validateType)("Expression"),
      computed: {
        default: false
      },
      optional: (0, _utils.validateOptional)(bool)
    });
    defineType("TSPropertySignature", {
      aliases: ["TSTypeElement"],
      visitor: ["key", "typeAnnotation"],
      fields: Object.assign({}, namedTypeElementCommon(), {
        readonly: (0, _utils.validateOptional)(bool),
        typeAnnotation: (0, _utils.validateOptionalType)("TSTypeAnnotation"),
        kind: {
          optional: true,
          validate: (0, _utils.assertOneOf)("get", "set")
        }
      })
    });
    defineType("TSMethodSignature", {
      aliases: ["TSTypeElement"],
      visitor: ["key", "typeParameters", "parameters", "typeAnnotation"],
      fields: Object.assign({}, signatureDeclarationCommon(), namedTypeElementCommon(), {
        kind: {
          validate: (0, _utils.assertOneOf)("method", "get", "set")
        }
      })
    });
    defineType("TSIndexSignature", {
      aliases: ["TSTypeElement"],
      visitor: ["parameters", "typeAnnotation"],
      fields: {
        readonly: (0, _utils.validateOptional)(bool),
        static: (0, _utils.validateOptional)(bool),
        parameters: (0, _utils.validateArrayOfType)("Identifier"),
        typeAnnotation: (0, _utils.validateOptionalType)("TSTypeAnnotation")
      }
    });
    var tsKeywordTypes = ["TSAnyKeyword", "TSBooleanKeyword", "TSBigIntKeyword", "TSIntrinsicKeyword", "TSNeverKeyword", "TSNullKeyword", "TSNumberKeyword", "TSObjectKeyword", "TSStringKeyword", "TSSymbolKeyword", "TSUndefinedKeyword", "TSUnknownKeyword", "TSVoidKeyword"];
    for (const type of tsKeywordTypes) {
      defineType(type, {
        aliases: ["TSType", "TSBaseType"],
        visitor: [],
        fields: {}
      });
    }
    defineType("TSThisType", {
      aliases: ["TSType", "TSBaseType"],
      visitor: [],
      fields: {}
    });
    var fnOrCtrBase = {
      aliases: ["TSType"],
      visitor: ["typeParameters", "parameters", "typeAnnotation"]
    };
    defineType("TSFunctionType", Object.assign({}, fnOrCtrBase, {
      fields: signatureDeclarationCommon()
    }));
    defineType("TSConstructorType", Object.assign({}, fnOrCtrBase, {
      fields: Object.assign({}, signatureDeclarationCommon(), {
        abstract: (0, _utils.validateOptional)(bool)
      })
    }));
    defineType("TSTypeReference", {
      aliases: ["TSType"],
      visitor: ["typeName", "typeParameters"],
      fields: {
        typeName: (0, _utils.validateType)("TSEntityName"),
        ["typeParameters"]: (0, _utils.validateOptionalType)("TSTypeParameterInstantiation")
      }
    });
    defineType("TSTypePredicate", {
      aliases: ["TSType"],
      visitor: ["parameterName", "typeAnnotation"],
      builder: ["parameterName", "typeAnnotation", "asserts"],
      fields: {
        parameterName: (0, _utils.validateType)("Identifier", "TSThisType"),
        typeAnnotation: (0, _utils.validateOptionalType)("TSTypeAnnotation"),
        asserts: (0, _utils.validateOptional)(bool)
      }
    });
    defineType("TSTypeQuery", {
      aliases: ["TSType"],
      visitor: ["exprName", "typeParameters"],
      fields: {
        exprName: (0, _utils.validateType)("TSEntityName", "TSImportType"),
        ["typeParameters"]: (0, _utils.validateOptionalType)("TSTypeParameterInstantiation")
      }
    });
    defineType("TSTypeLiteral", {
      aliases: ["TSType"],
      visitor: ["members"],
      fields: {
        members: (0, _utils.validateArrayOfType)("TSTypeElement")
      }
    });
    defineType("TSArrayType", {
      aliases: ["TSType"],
      visitor: ["elementType"],
      fields: {
        elementType: (0, _utils.validateType)("TSType")
      }
    });
    defineType("TSTupleType", {
      aliases: ["TSType"],
      visitor: ["elementTypes"],
      fields: {
        elementTypes: (0, _utils.validateArrayOfType)("TSType", "TSNamedTupleMember")
      }
    });
    defineType("TSOptionalType", {
      aliases: ["TSType"],
      visitor: ["typeAnnotation"],
      fields: {
        typeAnnotation: (0, _utils.validateType)("TSType")
      }
    });
    defineType("TSRestType", {
      aliases: ["TSType"],
      visitor: ["typeAnnotation"],
      fields: {
        typeAnnotation: (0, _utils.validateType)("TSType")
      }
    });
    defineType("TSNamedTupleMember", {
      visitor: ["label", "elementType"],
      builder: ["label", "elementType", "optional"],
      fields: {
        label: (0, _utils.validateType)("Identifier"),
        optional: {
          validate: bool,
          default: false
        },
        elementType: (0, _utils.validateType)("TSType")
      }
    });
    var unionOrIntersection = {
      aliases: ["TSType"],
      visitor: ["types"],
      fields: {
        types: (0, _utils.validateArrayOfType)("TSType")
      }
    };
    defineType("TSUnionType", unionOrIntersection);
    defineType("TSIntersectionType", unionOrIntersection);
    defineType("TSConditionalType", {
      aliases: ["TSType"],
      visitor: ["checkType", "extendsType", "trueType", "falseType"],
      fields: {
        checkType: (0, _utils.validateType)("TSType"),
        extendsType: (0, _utils.validateType)("TSType"),
        trueType: (0, _utils.validateType)("TSType"),
        falseType: (0, _utils.validateType)("TSType")
      }
    });
    defineType("TSInferType", {
      aliases: ["TSType"],
      visitor: ["typeParameter"],
      fields: {
        typeParameter: (0, _utils.validateType)("TSTypeParameter")
      }
    });
    defineType("TSParenthesizedType", {
      aliases: ["TSType"],
      visitor: ["typeAnnotation"],
      fields: {
        typeAnnotation: (0, _utils.validateType)("TSType")
      }
    });
    defineType("TSTypeOperator", {
      aliases: ["TSType"],
      visitor: ["typeAnnotation"],
      builder: ["typeAnnotation", "operator"],
      fields: {
        operator: {
          validate: (0, _utils.assertValueType)("string"),
          default: "keyof"
        },
        typeAnnotation: (0, _utils.validateType)("TSType")
      }
    });
    defineType("TSIndexedAccessType", {
      aliases: ["TSType"],
      visitor: ["objectType", "indexType"],
      fields: {
        objectType: (0, _utils.validateType)("TSType"),
        indexType: (0, _utils.validateType)("TSType")
      }
    });
    defineType("TSMappedType", {
      aliases: ["TSType"],
      visitor: ["typeParameter", "nameType", "typeAnnotation"],
      builder: ["typeParameter", "typeAnnotation", "nameType"],
      fields: Object.assign({}, {
        typeParameter: (0, _utils.validateType)("TSTypeParameter")
      }, {
        readonly: (0, _utils.validateOptional)((0, _utils.assertOneOf)(true, false, "+", "-")),
        optional: (0, _utils.validateOptional)((0, _utils.assertOneOf)(true, false, "+", "-")),
        typeAnnotation: (0, _utils.validateOptionalType)("TSType"),
        nameType: (0, _utils.validateOptionalType)("TSType")
      })
    });
    defineType("TSTemplateLiteralType", {
      aliases: ["TSType", "TSBaseType"],
      visitor: ["quasis", "types"],
      fields: {
        quasis: (0, _utils.validateArrayOfType)("TemplateElement"),
        types: {
          validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("TSType")), function(node, key, val) {
            if (node.quasis.length !== val.length + 1) {
              throw new TypeError(`Number of ${node.type} quasis should be exactly one more than the number of types.
Expected ${val.length + 1} quasis but got ${node.quasis.length}`);
            }
          })
        }
      }
    });
    defineType("TSLiteralType", {
      aliases: ["TSType", "TSBaseType"],
      visitor: ["literal"],
      fields: {
        literal: {
          validate: (function() {
            const unaryExpression = (0, _utils.assertNodeType)("NumericLiteral", "BigIntLiteral");
            const unaryOperator = (0, _utils.assertOneOf)("-");
            const literal = (0, _utils.assertNodeType)("NumericLiteral", "StringLiteral", "BooleanLiteral", "BigIntLiteral", "TemplateLiteral");
            const validator = function validator2(parent, key, node) {
              if ((0, _is.default)("UnaryExpression", node)) {
                unaryOperator(node, "operator", node.operator);
                unaryExpression(node, "argument", node.argument);
              } else {
                literal(parent, key, node);
              }
            };
            validator.oneOfNodeTypes = ["NumericLiteral", "StringLiteral", "BooleanLiteral", "BigIntLiteral", "TemplateLiteral", "UnaryExpression"];
            return validator;
          })()
        }
      }
    });
    defineType("TSExpressionWithTypeArguments", {
      aliases: ["TSType"],
      visitor: ["expression", "typeParameters"],
      fields: {
        expression: (0, _utils.validateType)("TSEntityName"),
        typeParameters: (0, _utils.validateOptionalType)("TSTypeParameterInstantiation")
      }
    });
    defineType("TSInterfaceDeclaration", {
      aliases: ["Statement", "Declaration"],
      visitor: ["id", "typeParameters", "extends", "body"],
      fields: {
        declare: (0, _utils.validateOptional)(bool),
        id: (0, _utils.validateType)("Identifier"),
        typeParameters: (0, _utils.validateOptionalType)("TSTypeParameterDeclaration"),
        extends: (0, _utils.validateOptional)((0, _utils.arrayOfType)("TSExpressionWithTypeArguments")),
        body: (0, _utils.validateType)("TSInterfaceBody")
      }
    });
    defineType("TSInterfaceBody", {
      visitor: ["body"],
      fields: {
        body: (0, _utils.validateArrayOfType)("TSTypeElement")
      }
    });
    defineType("TSTypeAliasDeclaration", {
      aliases: ["Statement", "Declaration"],
      visitor: ["id", "typeParameters", "typeAnnotation"],
      fields: {
        declare: (0, _utils.validateOptional)(bool),
        id: (0, _utils.validateType)("Identifier"),
        typeParameters: (0, _utils.validateOptionalType)("TSTypeParameterDeclaration"),
        typeAnnotation: (0, _utils.validateType)("TSType")
      }
    });
    defineType("TSInstantiationExpression", {
      aliases: ["Expression"],
      visitor: ["expression", "typeParameters"],
      fields: {
        expression: (0, _utils.validateType)("Expression"),
        ["typeParameters"]: (0, _utils.validateOptionalType)("TSTypeParameterInstantiation")
      }
    });
    var TSTypeExpression = {
      aliases: ["Expression", "LVal", "PatternLike"],
      visitor: ["expression", "typeAnnotation"],
      fields: {
        expression: (0, _utils.validateType)("Expression"),
        typeAnnotation: (0, _utils.validateType)("TSType")
      }
    };
    defineType("TSAsExpression", TSTypeExpression);
    defineType("TSSatisfiesExpression", TSTypeExpression);
    defineType("TSTypeAssertion", {
      aliases: ["Expression", "LVal", "PatternLike"],
      visitor: ["typeAnnotation", "expression"],
      fields: {
        typeAnnotation: (0, _utils.validateType)("TSType"),
        expression: (0, _utils.validateType)("Expression")
      }
    });
    defineType("TSEnumBody", {
      visitor: ["members"],
      fields: {
        members: (0, _utils.validateArrayOfType)("TSEnumMember")
      }
    });
    defineType("TSEnumDeclaration", {
      aliases: ["Statement", "Declaration"],
      visitor: ["id", "members"],
      fields: {
        declare: (0, _utils.validateOptional)(bool),
        const: (0, _utils.validateOptional)(bool),
        id: (0, _utils.validateType)("Identifier"),
        members: (0, _utils.validateArrayOfType)("TSEnumMember"),
        initializer: (0, _utils.validateOptionalType)("Expression"),
        body: (0, _utils.validateOptionalType)("TSEnumBody")
      }
    });
    defineType("TSEnumMember", {
      visitor: ["id", "initializer"],
      fields: {
        id: (0, _utils.validateType)("Identifier", "StringLiteral"),
        initializer: (0, _utils.validateOptionalType)("Expression")
      }
    });
    defineType("TSModuleDeclaration", {
      aliases: ["Statement", "Declaration"],
      visitor: ["id", "body"],
      fields: Object.assign({
        kind: {
          validate: (0, _utils.assertOneOf)("global", "module", "namespace")
        },
        declare: (0, _utils.validateOptional)(bool)
      }, {
        global: (0, _utils.validateOptional)(bool)
      }, {
        id: (0, _utils.validateType)("Identifier", "StringLiteral"),
        body: (0, _utils.validateType)("TSModuleBlock", "TSModuleDeclaration")
      })
    });
    defineType("TSModuleBlock", {
      aliases: ["Scopable", "Block", "BlockParent", "FunctionParent"],
      visitor: ["body"],
      fields: {
        body: (0, _utils.validateArrayOfType)("Statement")
      }
    });
    defineType("TSImportType", {
      aliases: ["TSType"],
      builder: ["argument", "qualifier", "typeParameters"],
      visitor: ["argument", "options", "qualifier", "typeParameters"],
      fields: Object.assign({}, {
        argument: (0, _utils.validateType)("StringLiteral")
      }, {
        qualifier: (0, _utils.validateOptionalType)("TSEntityName")
      }, {
        typeParameters: (0, _utils.validateOptionalType)("TSTypeParameterInstantiation")
      }, {
        options: {
          validate: (0, _utils.assertNodeType)("ObjectExpression"),
          optional: true
        }
      })
    });
    defineType("TSImportEqualsDeclaration", {
      aliases: ["Statement", "Declaration"],
      visitor: ["id", "moduleReference"],
      fields: Object.assign({}, {
        isExport: (0, _utils.validate)(bool)
      }, {
        id: (0, _utils.validateType)("Identifier"),
        moduleReference: (0, _utils.validateType)("TSEntityName", "TSExternalModuleReference"),
        importKind: {
          validate: (0, _utils.assertOneOf)("type", "value"),
          optional: true
        }
      })
    });
    defineType("TSExternalModuleReference", {
      visitor: ["expression"],
      fields: {
        expression: (0, _utils.validateType)("StringLiteral")
      }
    });
    defineType("TSNonNullExpression", {
      aliases: ["Expression", "LVal", "PatternLike"],
      visitor: ["expression"],
      fields: {
        expression: (0, _utils.validateType)("Expression")
      }
    });
    defineType("TSExportAssignment", {
      aliases: ["Statement"],
      visitor: ["expression"],
      fields: {
        expression: (0, _utils.validateType)("Expression")
      }
    });
    defineType("TSNamespaceExportDeclaration", {
      aliases: ["Statement"],
      visitor: ["id"],
      fields: {
        id: (0, _utils.validateType)("Identifier")
      }
    });
    defineType("TSTypeAnnotation", {
      visitor: ["typeAnnotation"],
      fields: {
        typeAnnotation: {
          validate: (0, _utils.assertNodeType)("TSType")
        }
      }
    });
    defineType("TSTypeParameterInstantiation", {
      visitor: ["params"],
      fields: {
        params: (0, _utils.validateArrayOfType)("TSType")
      }
    });
    defineType("TSTypeParameterDeclaration", {
      visitor: ["params"],
      fields: {
        params: (0, _utils.validateArrayOfType)("TSTypeParameter")
      }
    });
    defineType("TSTypeParameter", {
      builder: ["constraint", "default", "name"],
      visitor: ["constraint", "default"],
      fields: {
        name: {
          validate: (0, _utils.assertValueType)("string")
        },
        in: {
          validate: (0, _utils.assertValueType)("boolean"),
          optional: true
        },
        out: {
          validate: (0, _utils.assertValueType)("boolean"),
          optional: true
        },
        const: {
          validate: (0, _utils.assertValueType)("boolean"),
          optional: true
        },
        constraint: {
          validate: (0, _utils.assertNodeType)("TSType"),
          optional: true
        },
        default: {
          validate: (0, _utils.assertNodeType)("TSType"),
          optional: true
        }
      }
    });
  }
});

// node_modules/@babel/types/lib/definitions/deprecated-aliases.js
var require_deprecated_aliases = __commonJS({
  "node_modules/@babel/types/lib/definitions/deprecated-aliases.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.DEPRECATED_ALIASES = void 0;
    var DEPRECATED_ALIASES = exports2.DEPRECATED_ALIASES = {
      ModuleDeclaration: "ImportOrExportDeclaration"
    };
  }
});

// node_modules/@babel/types/lib/definitions/index.js
var require_definitions = __commonJS({
  "node_modules/@babel/types/lib/definitions/index.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    Object.defineProperty(exports2, "ALIAS_KEYS", {
      enumerable: true,
      get: function() {
        return _utils.ALIAS_KEYS;
      }
    });
    Object.defineProperty(exports2, "BUILDER_KEYS", {
      enumerable: true,
      get: function() {
        return _utils.BUILDER_KEYS;
      }
    });
    Object.defineProperty(exports2, "DEPRECATED_ALIASES", {
      enumerable: true,
      get: function() {
        return _deprecatedAliases.DEPRECATED_ALIASES;
      }
    });
    Object.defineProperty(exports2, "DEPRECATED_KEYS", {
      enumerable: true,
      get: function() {
        return _utils.DEPRECATED_KEYS;
      }
    });
    Object.defineProperty(exports2, "FLIPPED_ALIAS_KEYS", {
      enumerable: true,
      get: function() {
        return _utils.FLIPPED_ALIAS_KEYS;
      }
    });
    Object.defineProperty(exports2, "NODE_FIELDS", {
      enumerable: true,
      get: function() {
        return _utils.NODE_FIELDS;
      }
    });
    Object.defineProperty(exports2, "NODE_PARENT_VALIDATIONS", {
      enumerable: true,
      get: function() {
        return _utils.NODE_PARENT_VALIDATIONS;
      }
    });
    Object.defineProperty(exports2, "NODE_UNION_SHAPES__PRIVATE", {
      enumerable: true,
      get: function() {
        return _utils.NODE_UNION_SHAPES__PRIVATE;
      }
    });
    Object.defineProperty(exports2, "PLACEHOLDERS", {
      enumerable: true,
      get: function() {
        return _placeholders.PLACEHOLDERS;
      }
    });
    Object.defineProperty(exports2, "PLACEHOLDERS_ALIAS", {
      enumerable: true,
      get: function() {
        return _placeholders.PLACEHOLDERS_ALIAS;
      }
    });
    Object.defineProperty(exports2, "PLACEHOLDERS_FLIPPED_ALIAS", {
      enumerable: true,
      get: function() {
        return _placeholders.PLACEHOLDERS_FLIPPED_ALIAS;
      }
    });
    exports2.TYPES = void 0;
    Object.defineProperty(exports2, "VISITOR_KEYS", {
      enumerable: true,
      get: function() {
        return _utils.VISITOR_KEYS;
      }
    });
    require_core();
    require_flow();
    require_jsx();
    require_misc();
    require_experimental();
    require_typescript();
    var _utils = require_utils();
    var _placeholders = require_placeholders();
    var _deprecatedAliases = require_deprecated_aliases();
    Object.keys(_deprecatedAliases.DEPRECATED_ALIASES).forEach((deprecatedAlias) => {
      _utils.FLIPPED_ALIAS_KEYS[deprecatedAlias] = _utils.FLIPPED_ALIAS_KEYS[_deprecatedAliases.DEPRECATED_ALIASES[deprecatedAlias]];
    });
    for (const {
      types: types2,
      set
    } of _utils.allExpandedTypes) {
      for (const type of types2) {
        const aliases = _utils.FLIPPED_ALIAS_KEYS[type];
        if (aliases) {
          aliases.forEach(set.add, set);
        } else {
          set.add(type);
        }
      }
    }
    var TYPES = exports2.TYPES = [].concat(Object.keys(_utils.VISITOR_KEYS), Object.keys(_utils.FLIPPED_ALIAS_KEYS), Object.keys(_utils.DEPRECATED_KEYS));
  }
});

// node_modules/@babel/types/lib/validators/validate.js
var require_validate = __commonJS({
  "node_modules/@babel/types/lib/validators/validate.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = validate;
    exports2.validateChild = validateChild;
    exports2.validateField = validateField;
    exports2.validateInternal = validateInternal;
    var _index = require_definitions();
    function validate(node, key, val) {
      if (!node) return;
      const fields = _index.NODE_FIELDS[node.type];
      if (!fields) return;
      const field = fields[key];
      validateField(node, key, val, field);
      validateChild(node, key, val);
    }
    function validateInternal(field, node, key, val, maybeNode) {
      if (!(field != null && field.validate)) return;
      if (field.optional && val == null) return;
      field.validate(node, key, val);
      if (maybeNode) {
        var _NODE_PARENT_VALIDATI;
        const type = val.type;
        if (type == null) return;
        (_NODE_PARENT_VALIDATI = _index.NODE_PARENT_VALIDATIONS[type]) == null || _NODE_PARENT_VALIDATI.call(_index.NODE_PARENT_VALIDATIONS, node, key, val);
      }
    }
    function validateField(node, key, val, field) {
      if (!(field != null && field.validate)) return;
      if (field.optional && val == null) return;
      field.validate(node, key, val);
    }
    function validateChild(node, key, val) {
      var _NODE_PARENT_VALIDATI2;
      const type = val == null ? void 0 : val.type;
      if (type == null) return;
      (_NODE_PARENT_VALIDATI2 = _index.NODE_PARENT_VALIDATIONS[type]) == null || _NODE_PARENT_VALIDATI2.call(_index.NODE_PARENT_VALIDATIONS, node, key, val);
    }
  }
});

// node_modules/@babel/types/lib/builders/generated/lowercase.js
var require_lowercase = __commonJS({
  "node_modules/@babel/types/lib/builders/generated/lowercase.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.anyTypeAnnotation = anyTypeAnnotation;
    exports2.argumentPlaceholder = argumentPlaceholder;
    exports2.arrayExpression = arrayExpression;
    exports2.arrayPattern = arrayPattern;
    exports2.arrayTypeAnnotation = arrayTypeAnnotation;
    exports2.arrowFunctionExpression = arrowFunctionExpression;
    exports2.assignmentExpression = assignmentExpression;
    exports2.assignmentPattern = assignmentPattern;
    exports2.awaitExpression = awaitExpression;
    exports2.bigIntLiteral = bigIntLiteral;
    exports2.binaryExpression = binaryExpression;
    exports2.bindExpression = bindExpression;
    exports2.blockStatement = blockStatement;
    exports2.booleanLiteral = booleanLiteral;
    exports2.booleanLiteralTypeAnnotation = booleanLiteralTypeAnnotation;
    exports2.booleanTypeAnnotation = booleanTypeAnnotation;
    exports2.breakStatement = breakStatement;
    exports2.callExpression = callExpression;
    exports2.catchClause = catchClause;
    exports2.classAccessorProperty = classAccessorProperty;
    exports2.classBody = classBody;
    exports2.classDeclaration = classDeclaration;
    exports2.classExpression = classExpression;
    exports2.classImplements = classImplements;
    exports2.classMethod = classMethod;
    exports2.classPrivateMethod = classPrivateMethod;
    exports2.classPrivateProperty = classPrivateProperty;
    exports2.classProperty = classProperty;
    exports2.conditionalExpression = conditionalExpression;
    exports2.continueStatement = continueStatement;
    exports2.debuggerStatement = debuggerStatement;
    exports2.decimalLiteral = decimalLiteral;
    exports2.declareClass = declareClass;
    exports2.declareExportAllDeclaration = declareExportAllDeclaration;
    exports2.declareExportDeclaration = declareExportDeclaration;
    exports2.declareFunction = declareFunction;
    exports2.declareInterface = declareInterface;
    exports2.declareModule = declareModule;
    exports2.declareModuleExports = declareModuleExports;
    exports2.declareOpaqueType = declareOpaqueType;
    exports2.declareTypeAlias = declareTypeAlias;
    exports2.declareVariable = declareVariable;
    exports2.declaredPredicate = declaredPredicate;
    exports2.decorator = decorator;
    exports2.directive = directive;
    exports2.directiveLiteral = directiveLiteral;
    exports2.doExpression = doExpression;
    exports2.doWhileStatement = doWhileStatement;
    exports2.emptyStatement = emptyStatement;
    exports2.emptyTypeAnnotation = emptyTypeAnnotation;
    exports2.enumBooleanBody = enumBooleanBody;
    exports2.enumBooleanMember = enumBooleanMember;
    exports2.enumDeclaration = enumDeclaration;
    exports2.enumDefaultedMember = enumDefaultedMember;
    exports2.enumNumberBody = enumNumberBody;
    exports2.enumNumberMember = enumNumberMember;
    exports2.enumStringBody = enumStringBody;
    exports2.enumStringMember = enumStringMember;
    exports2.enumSymbolBody = enumSymbolBody;
    exports2.existsTypeAnnotation = existsTypeAnnotation;
    exports2.exportAllDeclaration = exportAllDeclaration;
    exports2.exportDefaultDeclaration = exportDefaultDeclaration;
    exports2.exportDefaultSpecifier = exportDefaultSpecifier;
    exports2.exportNamedDeclaration = exportNamedDeclaration;
    exports2.exportNamespaceSpecifier = exportNamespaceSpecifier;
    exports2.exportSpecifier = exportSpecifier;
    exports2.expressionStatement = expressionStatement;
    exports2.file = file;
    exports2.forInStatement = forInStatement;
    exports2.forOfStatement = forOfStatement;
    exports2.forStatement = forStatement;
    exports2.functionDeclaration = functionDeclaration;
    exports2.functionExpression = functionExpression;
    exports2.functionTypeAnnotation = functionTypeAnnotation;
    exports2.functionTypeParam = functionTypeParam;
    exports2.genericTypeAnnotation = genericTypeAnnotation;
    exports2.identifier = identifier;
    exports2.ifStatement = ifStatement;
    exports2.import = _import;
    exports2.importAttribute = importAttribute;
    exports2.importDeclaration = importDeclaration;
    exports2.importDefaultSpecifier = importDefaultSpecifier;
    exports2.importExpression = importExpression;
    exports2.importNamespaceSpecifier = importNamespaceSpecifier;
    exports2.importSpecifier = importSpecifier;
    exports2.indexedAccessType = indexedAccessType;
    exports2.inferredPredicate = inferredPredicate;
    exports2.interfaceDeclaration = interfaceDeclaration;
    exports2.interfaceExtends = interfaceExtends;
    exports2.interfaceTypeAnnotation = interfaceTypeAnnotation;
    exports2.interpreterDirective = interpreterDirective;
    exports2.intersectionTypeAnnotation = intersectionTypeAnnotation;
    exports2.jSXAttribute = exports2.jsxAttribute = jsxAttribute;
    exports2.jSXClosingElement = exports2.jsxClosingElement = jsxClosingElement;
    exports2.jSXClosingFragment = exports2.jsxClosingFragment = jsxClosingFragment;
    exports2.jSXElement = exports2.jsxElement = jsxElement;
    exports2.jSXEmptyExpression = exports2.jsxEmptyExpression = jsxEmptyExpression;
    exports2.jSXExpressionContainer = exports2.jsxExpressionContainer = jsxExpressionContainer;
    exports2.jSXFragment = exports2.jsxFragment = jsxFragment;
    exports2.jSXIdentifier = exports2.jsxIdentifier = jsxIdentifier;
    exports2.jSXMemberExpression = exports2.jsxMemberExpression = jsxMemberExpression;
    exports2.jSXNamespacedName = exports2.jsxNamespacedName = jsxNamespacedName;
    exports2.jSXOpeningElement = exports2.jsxOpeningElement = jsxOpeningElement;
    exports2.jSXOpeningFragment = exports2.jsxOpeningFragment = jsxOpeningFragment;
    exports2.jSXSpreadAttribute = exports2.jsxSpreadAttribute = jsxSpreadAttribute;
    exports2.jSXSpreadChild = exports2.jsxSpreadChild = jsxSpreadChild;
    exports2.jSXText = exports2.jsxText = jsxText;
    exports2.labeledStatement = labeledStatement;
    exports2.logicalExpression = logicalExpression;
    exports2.memberExpression = memberExpression;
    exports2.metaProperty = metaProperty;
    exports2.mixedTypeAnnotation = mixedTypeAnnotation;
    exports2.moduleExpression = moduleExpression;
    exports2.newExpression = newExpression;
    exports2.noop = noop;
    exports2.nullLiteral = nullLiteral;
    exports2.nullLiteralTypeAnnotation = nullLiteralTypeAnnotation;
    exports2.nullableTypeAnnotation = nullableTypeAnnotation;
    exports2.numberLiteral = NumberLiteral;
    exports2.numberLiteralTypeAnnotation = numberLiteralTypeAnnotation;
    exports2.numberTypeAnnotation = numberTypeAnnotation;
    exports2.numericLiteral = numericLiteral;
    exports2.objectExpression = objectExpression;
    exports2.objectMethod = objectMethod;
    exports2.objectPattern = objectPattern;
    exports2.objectProperty = objectProperty;
    exports2.objectTypeAnnotation = objectTypeAnnotation;
    exports2.objectTypeCallProperty = objectTypeCallProperty;
    exports2.objectTypeIndexer = objectTypeIndexer;
    exports2.objectTypeInternalSlot = objectTypeInternalSlot;
    exports2.objectTypeProperty = objectTypeProperty;
    exports2.objectTypeSpreadProperty = objectTypeSpreadProperty;
    exports2.opaqueType = opaqueType;
    exports2.optionalCallExpression = optionalCallExpression;
    exports2.optionalIndexedAccessType = optionalIndexedAccessType;
    exports2.optionalMemberExpression = optionalMemberExpression;
    exports2.parenthesizedExpression = parenthesizedExpression;
    exports2.pipelineBareFunction = pipelineBareFunction;
    exports2.pipelinePrimaryTopicReference = pipelinePrimaryTopicReference;
    exports2.pipelineTopicExpression = pipelineTopicExpression;
    exports2.placeholder = placeholder;
    exports2.privateName = privateName;
    exports2.program = program;
    exports2.qualifiedTypeIdentifier = qualifiedTypeIdentifier;
    exports2.recordExpression = recordExpression;
    exports2.regExpLiteral = regExpLiteral;
    exports2.regexLiteral = RegexLiteral;
    exports2.restElement = restElement;
    exports2.restProperty = RestProperty;
    exports2.returnStatement = returnStatement;
    exports2.sequenceExpression = sequenceExpression;
    exports2.spreadElement = spreadElement;
    exports2.spreadProperty = SpreadProperty;
    exports2.staticBlock = staticBlock;
    exports2.stringLiteral = stringLiteral;
    exports2.stringLiteralTypeAnnotation = stringLiteralTypeAnnotation;
    exports2.stringTypeAnnotation = stringTypeAnnotation;
    exports2.super = _super;
    exports2.switchCase = switchCase;
    exports2.switchStatement = switchStatement;
    exports2.symbolTypeAnnotation = symbolTypeAnnotation;
    exports2.taggedTemplateExpression = taggedTemplateExpression;
    exports2.templateElement = templateElement;
    exports2.templateLiteral = templateLiteral;
    exports2.thisExpression = thisExpression;
    exports2.thisTypeAnnotation = thisTypeAnnotation;
    exports2.throwStatement = throwStatement;
    exports2.topicReference = topicReference;
    exports2.tryStatement = tryStatement;
    exports2.tSAnyKeyword = exports2.tsAnyKeyword = tsAnyKeyword;
    exports2.tSArrayType = exports2.tsArrayType = tsArrayType;
    exports2.tSAsExpression = exports2.tsAsExpression = tsAsExpression;
    exports2.tSBigIntKeyword = exports2.tsBigIntKeyword = tsBigIntKeyword;
    exports2.tSBooleanKeyword = exports2.tsBooleanKeyword = tsBooleanKeyword;
    exports2.tSCallSignatureDeclaration = exports2.tsCallSignatureDeclaration = tsCallSignatureDeclaration;
    exports2.tSConditionalType = exports2.tsConditionalType = tsConditionalType;
    exports2.tSConstructSignatureDeclaration = exports2.tsConstructSignatureDeclaration = tsConstructSignatureDeclaration;
    exports2.tSConstructorType = exports2.tsConstructorType = tsConstructorType;
    exports2.tSDeclareFunction = exports2.tsDeclareFunction = tsDeclareFunction;
    exports2.tSDeclareMethod = exports2.tsDeclareMethod = tsDeclareMethod;
    exports2.tSEnumBody = exports2.tsEnumBody = tsEnumBody;
    exports2.tSEnumDeclaration = exports2.tsEnumDeclaration = tsEnumDeclaration;
    exports2.tSEnumMember = exports2.tsEnumMember = tsEnumMember;
    exports2.tSExportAssignment = exports2.tsExportAssignment = tsExportAssignment;
    exports2.tSExpressionWithTypeArguments = exports2.tsExpressionWithTypeArguments = tsExpressionWithTypeArguments;
    exports2.tSExternalModuleReference = exports2.tsExternalModuleReference = tsExternalModuleReference;
    exports2.tSFunctionType = exports2.tsFunctionType = tsFunctionType;
    exports2.tSImportEqualsDeclaration = exports2.tsImportEqualsDeclaration = tsImportEqualsDeclaration;
    exports2.tSImportType = exports2.tsImportType = tsImportType;
    exports2.tSIndexSignature = exports2.tsIndexSignature = tsIndexSignature;
    exports2.tSIndexedAccessType = exports2.tsIndexedAccessType = tsIndexedAccessType;
    exports2.tSInferType = exports2.tsInferType = tsInferType;
    exports2.tSInstantiationExpression = exports2.tsInstantiationExpression = tsInstantiationExpression;
    exports2.tSInterfaceBody = exports2.tsInterfaceBody = tsInterfaceBody;
    exports2.tSInterfaceDeclaration = exports2.tsInterfaceDeclaration = tsInterfaceDeclaration;
    exports2.tSIntersectionType = exports2.tsIntersectionType = tsIntersectionType;
    exports2.tSIntrinsicKeyword = exports2.tsIntrinsicKeyword = tsIntrinsicKeyword;
    exports2.tSLiteralType = exports2.tsLiteralType = tsLiteralType;
    exports2.tSMappedType = exports2.tsMappedType = tsMappedType;
    exports2.tSMethodSignature = exports2.tsMethodSignature = tsMethodSignature;
    exports2.tSModuleBlock = exports2.tsModuleBlock = tsModuleBlock;
    exports2.tSModuleDeclaration = exports2.tsModuleDeclaration = tsModuleDeclaration;
    exports2.tSNamedTupleMember = exports2.tsNamedTupleMember = tsNamedTupleMember;
    exports2.tSNamespaceExportDeclaration = exports2.tsNamespaceExportDeclaration = tsNamespaceExportDeclaration;
    exports2.tSNeverKeyword = exports2.tsNeverKeyword = tsNeverKeyword;
    exports2.tSNonNullExpression = exports2.tsNonNullExpression = tsNonNullExpression;
    exports2.tSNullKeyword = exports2.tsNullKeyword = tsNullKeyword;
    exports2.tSNumberKeyword = exports2.tsNumberKeyword = tsNumberKeyword;
    exports2.tSObjectKeyword = exports2.tsObjectKeyword = tsObjectKeyword;
    exports2.tSOptionalType = exports2.tsOptionalType = tsOptionalType;
    exports2.tSParameterProperty = exports2.tsParameterProperty = tsParameterProperty;
    exports2.tSParenthesizedType = exports2.tsParenthesizedType = tsParenthesizedType;
    exports2.tSPropertySignature = exports2.tsPropertySignature = tsPropertySignature;
    exports2.tSQualifiedName = exports2.tsQualifiedName = tsQualifiedName;
    exports2.tSRestType = exports2.tsRestType = tsRestType;
    exports2.tSSatisfiesExpression = exports2.tsSatisfiesExpression = tsSatisfiesExpression;
    exports2.tSStringKeyword = exports2.tsStringKeyword = tsStringKeyword;
    exports2.tSSymbolKeyword = exports2.tsSymbolKeyword = tsSymbolKeyword;
    exports2.tSTemplateLiteralType = exports2.tsTemplateLiteralType = tsTemplateLiteralType;
    exports2.tSThisType = exports2.tsThisType = tsThisType;
    exports2.tSTupleType = exports2.tsTupleType = tsTupleType;
    exports2.tSTypeAliasDeclaration = exports2.tsTypeAliasDeclaration = tsTypeAliasDeclaration;
    exports2.tSTypeAnnotation = exports2.tsTypeAnnotation = tsTypeAnnotation;
    exports2.tSTypeAssertion = exports2.tsTypeAssertion = tsTypeAssertion;
    exports2.tSTypeLiteral = exports2.tsTypeLiteral = tsTypeLiteral;
    exports2.tSTypeOperator = exports2.tsTypeOperator = tsTypeOperator;
    exports2.tSTypeParameter = exports2.tsTypeParameter = tsTypeParameter;
    exports2.tSTypeParameterDeclaration = exports2.tsTypeParameterDeclaration = tsTypeParameterDeclaration;
    exports2.tSTypeParameterInstantiation = exports2.tsTypeParameterInstantiation = tsTypeParameterInstantiation;
    exports2.tSTypePredicate = exports2.tsTypePredicate = tsTypePredicate;
    exports2.tSTypeQuery = exports2.tsTypeQuery = tsTypeQuery;
    exports2.tSTypeReference = exports2.tsTypeReference = tsTypeReference;
    exports2.tSUndefinedKeyword = exports2.tsUndefinedKeyword = tsUndefinedKeyword;
    exports2.tSUnionType = exports2.tsUnionType = tsUnionType;
    exports2.tSUnknownKeyword = exports2.tsUnknownKeyword = tsUnknownKeyword;
    exports2.tSVoidKeyword = exports2.tsVoidKeyword = tsVoidKeyword;
    exports2.tupleExpression = tupleExpression;
    exports2.tupleTypeAnnotation = tupleTypeAnnotation;
    exports2.typeAlias = typeAlias;
    exports2.typeAnnotation = typeAnnotation;
    exports2.typeCastExpression = typeCastExpression;
    exports2.typeParameter = typeParameter;
    exports2.typeParameterDeclaration = typeParameterDeclaration;
    exports2.typeParameterInstantiation = typeParameterInstantiation;
    exports2.typeofTypeAnnotation = typeofTypeAnnotation;
    exports2.unaryExpression = unaryExpression;
    exports2.unionTypeAnnotation = unionTypeAnnotation;
    exports2.updateExpression = updateExpression;
    exports2.v8IntrinsicIdentifier = v8IntrinsicIdentifier;
    exports2.variableDeclaration = variableDeclaration;
    exports2.variableDeclarator = variableDeclarator;
    exports2.variance = variance;
    exports2.voidPattern = voidPattern;
    exports2.voidTypeAnnotation = voidTypeAnnotation;
    exports2.whileStatement = whileStatement;
    exports2.withStatement = withStatement;
    exports2.yieldExpression = yieldExpression;
    var _validate = require_validate();
    var _deprecationWarning = require_deprecationWarning();
    var utils = require_utils();
    var {
      validateInternal: validate
    } = _validate;
    var {
      NODE_FIELDS
    } = utils;
    function bigIntLiteral(value2) {
      if (typeof value2 === "bigint") {
        value2 = value2.toString();
      }
      const node = {
        type: "BigIntLiteral",
        value: value2
      };
      const defs = NODE_FIELDS.BigIntLiteral;
      validate(defs.value, node, "value", value2);
      return node;
    }
    function arrayExpression(elements = []) {
      const node = {
        type: "ArrayExpression",
        elements
      };
      const defs = NODE_FIELDS.ArrayExpression;
      validate(defs.elements, node, "elements", elements, 1);
      return node;
    }
    function assignmentExpression(operator, left, right) {
      const node = {
        type: "AssignmentExpression",
        operator,
        left,
        right
      };
      const defs = NODE_FIELDS.AssignmentExpression;
      validate(defs.operator, node, "operator", operator);
      validate(defs.left, node, "left", left, 1);
      validate(defs.right, node, "right", right, 1);
      return node;
    }
    function binaryExpression(operator, left, right) {
      const node = {
        type: "BinaryExpression",
        operator,
        left,
        right
      };
      const defs = NODE_FIELDS.BinaryExpression;
      validate(defs.operator, node, "operator", operator);
      validate(defs.left, node, "left", left, 1);
      validate(defs.right, node, "right", right, 1);
      return node;
    }
    function interpreterDirective(value2) {
      const node = {
        type: "InterpreterDirective",
        value: value2
      };
      const defs = NODE_FIELDS.InterpreterDirective;
      validate(defs.value, node, "value", value2);
      return node;
    }
    function directive(value2) {
      const node = {
        type: "Directive",
        value: value2
      };
      const defs = NODE_FIELDS.Directive;
      validate(defs.value, node, "value", value2, 1);
      return node;
    }
    function directiveLiteral(value2) {
      const node = {
        type: "DirectiveLiteral",
        value: value2
      };
      const defs = NODE_FIELDS.DirectiveLiteral;
      validate(defs.value, node, "value", value2);
      return node;
    }
    function blockStatement(body, directives = []) {
      const node = {
        type: "BlockStatement",
        body,
        directives
      };
      const defs = NODE_FIELDS.BlockStatement;
      validate(defs.body, node, "body", body, 1);
      validate(defs.directives, node, "directives", directives, 1);
      return node;
    }
    function breakStatement(label = null) {
      const node = {
        type: "BreakStatement",
        label
      };
      const defs = NODE_FIELDS.BreakStatement;
      validate(defs.label, node, "label", label, 1);
      return node;
    }
    function callExpression(callee, _arguments) {
      const node = {
        type: "CallExpression",
        callee,
        arguments: _arguments
      };
      const defs = NODE_FIELDS.CallExpression;
      validate(defs.callee, node, "callee", callee, 1);
      validate(defs.arguments, node, "arguments", _arguments, 1);
      return node;
    }
    function catchClause(param = null, body) {
      const node = {
        type: "CatchClause",
        param,
        body
      };
      const defs = NODE_FIELDS.CatchClause;
      validate(defs.param, node, "param", param, 1);
      validate(defs.body, node, "body", body, 1);
      return node;
    }
    function conditionalExpression(test, consequent, alternate) {
      const node = {
        type: "ConditionalExpression",
        test,
        consequent,
        alternate
      };
      const defs = NODE_FIELDS.ConditionalExpression;
      validate(defs.test, node, "test", test, 1);
      validate(defs.consequent, node, "consequent", consequent, 1);
      validate(defs.alternate, node, "alternate", alternate, 1);
      return node;
    }
    function continueStatement(label = null) {
      const node = {
        type: "ContinueStatement",
        label
      };
      const defs = NODE_FIELDS.ContinueStatement;
      validate(defs.label, node, "label", label, 1);
      return node;
    }
    function debuggerStatement() {
      return {
        type: "DebuggerStatement"
      };
    }
    function doWhileStatement(test, body) {
      const node = {
        type: "DoWhileStatement",
        test,
        body
      };
      const defs = NODE_FIELDS.DoWhileStatement;
      validate(defs.test, node, "test", test, 1);
      validate(defs.body, node, "body", body, 1);
      return node;
    }
    function emptyStatement() {
      return {
        type: "EmptyStatement"
      };
    }
    function expressionStatement(expression) {
      const node = {
        type: "ExpressionStatement",
        expression
      };
      const defs = NODE_FIELDS.ExpressionStatement;
      validate(defs.expression, node, "expression", expression, 1);
      return node;
    }
    function file(program2, comments = null, tokens = null) {
      const node = {
        type: "File",
        program: program2,
        comments,
        tokens
      };
      const defs = NODE_FIELDS.File;
      validate(defs.program, node, "program", program2, 1);
      validate(defs.comments, node, "comments", comments, 1);
      validate(defs.tokens, node, "tokens", tokens);
      return node;
    }
    function forInStatement(left, right, body) {
      const node = {
        type: "ForInStatement",
        left,
        right,
        body
      };
      const defs = NODE_FIELDS.ForInStatement;
      validate(defs.left, node, "left", left, 1);
      validate(defs.right, node, "right", right, 1);
      validate(defs.body, node, "body", body, 1);
      return node;
    }
    function forStatement(init = null, test = null, update = null, body) {
      const node = {
        type: "ForStatement",
        init,
        test,
        update,
        body
      };
      const defs = NODE_FIELDS.ForStatement;
      validate(defs.init, node, "init", init, 1);
      validate(defs.test, node, "test", test, 1);
      validate(defs.update, node, "update", update, 1);
      validate(defs.body, node, "body", body, 1);
      return node;
    }
    function functionDeclaration(id = null, params, body, generator = false, async = false) {
      const node = {
        type: "FunctionDeclaration",
        id,
        params,
        body,
        generator,
        async
      };
      const defs = NODE_FIELDS.FunctionDeclaration;
      validate(defs.id, node, "id", id, 1);
      validate(defs.params, node, "params", params, 1);
      validate(defs.body, node, "body", body, 1);
      validate(defs.generator, node, "generator", generator);
      validate(defs.async, node, "async", async);
      return node;
    }
    function functionExpression(id = null, params, body, generator = false, async = false) {
      const node = {
        type: "FunctionExpression",
        id,
        params,
        body,
        generator,
        async
      };
      const defs = NODE_FIELDS.FunctionExpression;
      validate(defs.id, node, "id", id, 1);
      validate(defs.params, node, "params", params, 1);
      validate(defs.body, node, "body", body, 1);
      validate(defs.generator, node, "generator", generator);
      validate(defs.async, node, "async", async);
      return node;
    }
    function identifier(name) {
      const node = {
        type: "Identifier",
        name
      };
      const defs = NODE_FIELDS.Identifier;
      validate(defs.name, node, "name", name);
      return node;
    }
    function ifStatement(test, consequent, alternate = null) {
      const node = {
        type: "IfStatement",
        test,
        consequent,
        alternate
      };
      const defs = NODE_FIELDS.IfStatement;
      validate(defs.test, node, "test", test, 1);
      validate(defs.consequent, node, "consequent", consequent, 1);
      validate(defs.alternate, node, "alternate", alternate, 1);
      return node;
    }
    function labeledStatement(label, body) {
      const node = {
        type: "LabeledStatement",
        label,
        body
      };
      const defs = NODE_FIELDS.LabeledStatement;
      validate(defs.label, node, "label", label, 1);
      validate(defs.body, node, "body", body, 1);
      return node;
    }
    function stringLiteral(value2) {
      const node = {
        type: "StringLiteral",
        value: value2
      };
      const defs = NODE_FIELDS.StringLiteral;
      validate(defs.value, node, "value", value2);
      return node;
    }
    function numericLiteral(value2) {
      const node = {
        type: "NumericLiteral",
        value: value2
      };
      const defs = NODE_FIELDS.NumericLiteral;
      validate(defs.value, node, "value", value2);
      return node;
    }
    function nullLiteral() {
      return {
        type: "NullLiteral"
      };
    }
    function booleanLiteral(value2) {
      const node = {
        type: "BooleanLiteral",
        value: value2
      };
      const defs = NODE_FIELDS.BooleanLiteral;
      validate(defs.value, node, "value", value2);
      return node;
    }
    function regExpLiteral(pattern, flags = "") {
      const node = {
        type: "RegExpLiteral",
        pattern,
        flags
      };
      const defs = NODE_FIELDS.RegExpLiteral;
      validate(defs.pattern, node, "pattern", pattern);
      validate(defs.flags, node, "flags", flags);
      return node;
    }
    function logicalExpression(operator, left, right) {
      const node = {
        type: "LogicalExpression",
        operator,
        left,
        right
      };
      const defs = NODE_FIELDS.LogicalExpression;
      validate(defs.operator, node, "operator", operator);
      validate(defs.left, node, "left", left, 1);
      validate(defs.right, node, "right", right, 1);
      return node;
    }
    function memberExpression(object, property, computed = false, optional = null) {
      const node = {
        type: "MemberExpression",
        object,
        property,
        computed,
        optional
      };
      const defs = NODE_FIELDS.MemberExpression;
      validate(defs.object, node, "object", object, 1);
      validate(defs.property, node, "property", property, 1);
      validate(defs.computed, node, "computed", computed);
      validate(defs.optional, node, "optional", optional);
      return node;
    }
    function newExpression(callee, _arguments) {
      const node = {
        type: "NewExpression",
        callee,
        arguments: _arguments
      };
      const defs = NODE_FIELDS.NewExpression;
      validate(defs.callee, node, "callee", callee, 1);
      validate(defs.arguments, node, "arguments", _arguments, 1);
      return node;
    }
    function program(body, directives = [], sourceType = "script", interpreter = null) {
      const node = {
        type: "Program",
        body,
        directives,
        sourceType,
        interpreter
      };
      const defs = NODE_FIELDS.Program;
      validate(defs.body, node, "body", body, 1);
      validate(defs.directives, node, "directives", directives, 1);
      validate(defs.sourceType, node, "sourceType", sourceType);
      validate(defs.interpreter, node, "interpreter", interpreter, 1);
      return node;
    }
    function objectExpression(properties) {
      const node = {
        type: "ObjectExpression",
        properties
      };
      const defs = NODE_FIELDS.ObjectExpression;
      validate(defs.properties, node, "properties", properties, 1);
      return node;
    }
    function objectMethod(kind = "method", key, params, body, computed = false, generator = false, async = false) {
      const node = {
        type: "ObjectMethod",
        kind,
        key,
        params,
        body,
        computed,
        generator,
        async
      };
      const defs = NODE_FIELDS.ObjectMethod;
      validate(defs.kind, node, "kind", kind);
      validate(defs.key, node, "key", key, 1);
      validate(defs.params, node, "params", params, 1);
      validate(defs.body, node, "body", body, 1);
      validate(defs.computed, node, "computed", computed);
      validate(defs.generator, node, "generator", generator);
      validate(defs.async, node, "async", async);
      return node;
    }
    function objectProperty(key, value2, computed = false, shorthand = false, decorators = null) {
      const node = {
        type: "ObjectProperty",
        key,
        value: value2,
        computed,
        shorthand,
        decorators
      };
      const defs = NODE_FIELDS.ObjectProperty;
      validate(defs.key, node, "key", key, 1);
      validate(defs.value, node, "value", value2, 1);
      validate(defs.computed, node, "computed", computed);
      validate(defs.shorthand, node, "shorthand", shorthand);
      validate(defs.decorators, node, "decorators", decorators, 1);
      return node;
    }
    function restElement(argument) {
      const node = {
        type: "RestElement",
        argument
      };
      const defs = NODE_FIELDS.RestElement;
      validate(defs.argument, node, "argument", argument, 1);
      return node;
    }
    function returnStatement(argument = null) {
      const node = {
        type: "ReturnStatement",
        argument
      };
      const defs = NODE_FIELDS.ReturnStatement;
      validate(defs.argument, node, "argument", argument, 1);
      return node;
    }
    function sequenceExpression(expressions) {
      const node = {
        type: "SequenceExpression",
        expressions
      };
      const defs = NODE_FIELDS.SequenceExpression;
      validate(defs.expressions, node, "expressions", expressions, 1);
      return node;
    }
    function parenthesizedExpression(expression) {
      const node = {
        type: "ParenthesizedExpression",
        expression
      };
      const defs = NODE_FIELDS.ParenthesizedExpression;
      validate(defs.expression, node, "expression", expression, 1);
      return node;
    }
    function switchCase(test = null, consequent) {
      const node = {
        type: "SwitchCase",
        test,
        consequent
      };
      const defs = NODE_FIELDS.SwitchCase;
      validate(defs.test, node, "test", test, 1);
      validate(defs.consequent, node, "consequent", consequent, 1);
      return node;
    }
    function switchStatement(discriminant, cases) {
      const node = {
        type: "SwitchStatement",
        discriminant,
        cases
      };
      const defs = NODE_FIELDS.SwitchStatement;
      validate(defs.discriminant, node, "discriminant", discriminant, 1);
      validate(defs.cases, node, "cases", cases, 1);
      return node;
    }
    function thisExpression() {
      return {
        type: "ThisExpression"
      };
    }
    function throwStatement(argument) {
      const node = {
        type: "ThrowStatement",
        argument
      };
      const defs = NODE_FIELDS.ThrowStatement;
      validate(defs.argument, node, "argument", argument, 1);
      return node;
    }
    function tryStatement(block, handler = null, finalizer = null) {
      const node = {
        type: "TryStatement",
        block,
        handler,
        finalizer
      };
      const defs = NODE_FIELDS.TryStatement;
      validate(defs.block, node, "block", block, 1);
      validate(defs.handler, node, "handler", handler, 1);
      validate(defs.finalizer, node, "finalizer", finalizer, 1);
      return node;
    }
    function unaryExpression(operator, argument, prefix = true) {
      const node = {
        type: "UnaryExpression",
        operator,
        argument,
        prefix
      };
      const defs = NODE_FIELDS.UnaryExpression;
      validate(defs.operator, node, "operator", operator);
      validate(defs.argument, node, "argument", argument, 1);
      validate(defs.prefix, node, "prefix", prefix);
      return node;
    }
    function updateExpression(operator, argument, prefix = false) {
      const node = {
        type: "UpdateExpression",
        operator,
        argument,
        prefix
      };
      const defs = NODE_FIELDS.UpdateExpression;
      validate(defs.operator, node, "operator", operator);
      validate(defs.argument, node, "argument", argument, 1);
      validate(defs.prefix, node, "prefix", prefix);
      return node;
    }
    function variableDeclaration(kind, declarations) {
      const node = {
        type: "VariableDeclaration",
        kind,
        declarations
      };
      const defs = NODE_FIELDS.VariableDeclaration;
      validate(defs.kind, node, "kind", kind);
      validate(defs.declarations, node, "declarations", declarations, 1);
      return node;
    }
    function variableDeclarator(id, init = null) {
      const node = {
        type: "VariableDeclarator",
        id,
        init
      };
      const defs = NODE_FIELDS.VariableDeclarator;
      validate(defs.id, node, "id", id, 1);
      validate(defs.init, node, "init", init, 1);
      return node;
    }
    function whileStatement(test, body) {
      const node = {
        type: "WhileStatement",
        test,
        body
      };
      const defs = NODE_FIELDS.WhileStatement;
      validate(defs.test, node, "test", test, 1);
      validate(defs.body, node, "body", body, 1);
      return node;
    }
    function withStatement(object, body) {
      const node = {
        type: "WithStatement",
        object,
        body
      };
      const defs = NODE_FIELDS.WithStatement;
      validate(defs.object, node, "object", object, 1);
      validate(defs.body, node, "body", body, 1);
      return node;
    }
    function assignmentPattern(left, right) {
      const node = {
        type: "AssignmentPattern",
        left,
        right
      };
      const defs = NODE_FIELDS.AssignmentPattern;
      validate(defs.left, node, "left", left, 1);
      validate(defs.right, node, "right", right, 1);
      return node;
    }
    function arrayPattern(elements) {
      const node = {
        type: "ArrayPattern",
        elements
      };
      const defs = NODE_FIELDS.ArrayPattern;
      validate(defs.elements, node, "elements", elements, 1);
      return node;
    }
    function arrowFunctionExpression(params, body, async = false) {
      const node = {
        type: "ArrowFunctionExpression",
        params,
        body,
        async,
        expression: null
      };
      const defs = NODE_FIELDS.ArrowFunctionExpression;
      validate(defs.params, node, "params", params, 1);
      validate(defs.body, node, "body", body, 1);
      validate(defs.async, node, "async", async);
      return node;
    }
    function classBody(body) {
      const node = {
        type: "ClassBody",
        body
      };
      const defs = NODE_FIELDS.ClassBody;
      validate(defs.body, node, "body", body, 1);
      return node;
    }
    function classExpression(id = null, superClass = null, body, decorators = null) {
      const node = {
        type: "ClassExpression",
        id,
        superClass,
        body,
        decorators
      };
      const defs = NODE_FIELDS.ClassExpression;
      validate(defs.id, node, "id", id, 1);
      validate(defs.superClass, node, "superClass", superClass, 1);
      validate(defs.body, node, "body", body, 1);
      validate(defs.decorators, node, "decorators", decorators, 1);
      return node;
    }
    function classDeclaration(id = null, superClass = null, body, decorators = null) {
      const node = {
        type: "ClassDeclaration",
        id,
        superClass,
        body,
        decorators
      };
      const defs = NODE_FIELDS.ClassDeclaration;
      validate(defs.id, node, "id", id, 1);
      validate(defs.superClass, node, "superClass", superClass, 1);
      validate(defs.body, node, "body", body, 1);
      validate(defs.decorators, node, "decorators", decorators, 1);
      return node;
    }
    function exportAllDeclaration(source, attributes = null) {
      const node = {
        type: "ExportAllDeclaration",
        source,
        attributes
      };
      const defs = NODE_FIELDS.ExportAllDeclaration;
      validate(defs.source, node, "source", source, 1);
      validate(defs.attributes, node, "attributes", attributes, 1);
      return node;
    }
    function exportDefaultDeclaration(declaration) {
      const node = {
        type: "ExportDefaultDeclaration",
        declaration
      };
      const defs = NODE_FIELDS.ExportDefaultDeclaration;
      validate(defs.declaration, node, "declaration", declaration, 1);
      return node;
    }
    function exportNamedDeclaration(declaration = null, specifiers = [], source = null, attributes = null) {
      const node = {
        type: "ExportNamedDeclaration",
        declaration,
        specifiers,
        source,
        attributes
      };
      const defs = NODE_FIELDS.ExportNamedDeclaration;
      validate(defs.declaration, node, "declaration", declaration, 1);
      validate(defs.specifiers, node, "specifiers", specifiers, 1);
      validate(defs.source, node, "source", source, 1);
      validate(defs.attributes, node, "attributes", attributes, 1);
      return node;
    }
    function exportSpecifier(local, exported) {
      const node = {
        type: "ExportSpecifier",
        local,
        exported
      };
      const defs = NODE_FIELDS.ExportSpecifier;
      validate(defs.local, node, "local", local, 1);
      validate(defs.exported, node, "exported", exported, 1);
      return node;
    }
    function forOfStatement(left, right, body, _await = false) {
      const node = {
        type: "ForOfStatement",
        left,
        right,
        body,
        await: _await
      };
      const defs = NODE_FIELDS.ForOfStatement;
      validate(defs.left, node, "left", left, 1);
      validate(defs.right, node, "right", right, 1);
      validate(defs.body, node, "body", body, 1);
      validate(defs.await, node, "await", _await);
      return node;
    }
    function importDeclaration(specifiers, source, attributes = null) {
      const node = {
        type: "ImportDeclaration",
        specifiers,
        source,
        attributes
      };
      const defs = NODE_FIELDS.ImportDeclaration;
      validate(defs.specifiers, node, "specifiers", specifiers, 1);
      validate(defs.source, node, "source", source, 1);
      validate(defs.attributes, node, "attributes", attributes, 1);
      return node;
    }
    function importDefaultSpecifier(local) {
      const node = {
        type: "ImportDefaultSpecifier",
        local
      };
      const defs = NODE_FIELDS.ImportDefaultSpecifier;
      validate(defs.local, node, "local", local, 1);
      return node;
    }
    function importNamespaceSpecifier(local) {
      const node = {
        type: "ImportNamespaceSpecifier",
        local
      };
      const defs = NODE_FIELDS.ImportNamespaceSpecifier;
      validate(defs.local, node, "local", local, 1);
      return node;
    }
    function importSpecifier(local, imported) {
      const node = {
        type: "ImportSpecifier",
        local,
        imported
      };
      const defs = NODE_FIELDS.ImportSpecifier;
      validate(defs.local, node, "local", local, 1);
      validate(defs.imported, node, "imported", imported, 1);
      return node;
    }
    function importExpression(source, options = null) {
      const node = {
        type: "ImportExpression",
        source,
        options
      };
      const defs = NODE_FIELDS.ImportExpression;
      validate(defs.source, node, "source", source, 1);
      validate(defs.options, node, "options", options, 1);
      return node;
    }
    function metaProperty(meta, property) {
      const node = {
        type: "MetaProperty",
        meta,
        property
      };
      const defs = NODE_FIELDS.MetaProperty;
      validate(defs.meta, node, "meta", meta, 1);
      validate(defs.property, node, "property", property, 1);
      return node;
    }
    function classMethod(kind = "method", key, params, body, computed = false, _static = false, generator = false, async = false) {
      const node = {
        type: "ClassMethod",
        kind,
        key,
        params,
        body,
        computed,
        static: _static,
        generator,
        async
      };
      const defs = NODE_FIELDS.ClassMethod;
      validate(defs.kind, node, "kind", kind);
      validate(defs.key, node, "key", key, 1);
      validate(defs.params, node, "params", params, 1);
      validate(defs.body, node, "body", body, 1);
      validate(defs.computed, node, "computed", computed);
      validate(defs.static, node, "static", _static);
      validate(defs.generator, node, "generator", generator);
      validate(defs.async, node, "async", async);
      return node;
    }
    function objectPattern(properties) {
      const node = {
        type: "ObjectPattern",
        properties
      };
      const defs = NODE_FIELDS.ObjectPattern;
      validate(defs.properties, node, "properties", properties, 1);
      return node;
    }
    function spreadElement(argument) {
      const node = {
        type: "SpreadElement",
        argument
      };
      const defs = NODE_FIELDS.SpreadElement;
      validate(defs.argument, node, "argument", argument, 1);
      return node;
    }
    function _super() {
      return {
        type: "Super"
      };
    }
    function taggedTemplateExpression(tag, quasi) {
      const node = {
        type: "TaggedTemplateExpression",
        tag,
        quasi
      };
      const defs = NODE_FIELDS.TaggedTemplateExpression;
      validate(defs.tag, node, "tag", tag, 1);
      validate(defs.quasi, node, "quasi", quasi, 1);
      return node;
    }
    function templateElement(value2, tail = false) {
      const node = {
        type: "TemplateElement",
        value: value2,
        tail
      };
      const defs = NODE_FIELDS.TemplateElement;
      validate(defs.value, node, "value", value2);
      validate(defs.tail, node, "tail", tail);
      return node;
    }
    function templateLiteral(quasis, expressions) {
      const node = {
        type: "TemplateLiteral",
        quasis,
        expressions
      };
      const defs = NODE_FIELDS.TemplateLiteral;
      validate(defs.quasis, node, "quasis", quasis, 1);
      validate(defs.expressions, node, "expressions", expressions, 1);
      return node;
    }
    function yieldExpression(argument = null, delegate = false) {
      const node = {
        type: "YieldExpression",
        argument,
        delegate
      };
      const defs = NODE_FIELDS.YieldExpression;
      validate(defs.argument, node, "argument", argument, 1);
      validate(defs.delegate, node, "delegate", delegate);
      return node;
    }
    function awaitExpression(argument) {
      const node = {
        type: "AwaitExpression",
        argument
      };
      const defs = NODE_FIELDS.AwaitExpression;
      validate(defs.argument, node, "argument", argument, 1);
      return node;
    }
    function _import() {
      return {
        type: "Import"
      };
    }
    function exportNamespaceSpecifier(exported) {
      const node = {
        type: "ExportNamespaceSpecifier",
        exported
      };
      const defs = NODE_FIELDS.ExportNamespaceSpecifier;
      validate(defs.exported, node, "exported", exported, 1);
      return node;
    }
    function optionalMemberExpression(object, property, computed = false, optional) {
      const node = {
        type: "OptionalMemberExpression",
        object,
        property,
        computed,
        optional
      };
      const defs = NODE_FIELDS.OptionalMemberExpression;
      validate(defs.object, node, "object", object, 1);
      validate(defs.property, node, "property", property, 1);
      validate(defs.computed, node, "computed", computed);
      validate(defs.optional, node, "optional", optional);
      return node;
    }
    function optionalCallExpression(callee, _arguments, optional) {
      const node = {
        type: "OptionalCallExpression",
        callee,
        arguments: _arguments,
        optional
      };
      const defs = NODE_FIELDS.OptionalCallExpression;
      validate(defs.callee, node, "callee", callee, 1);
      validate(defs.arguments, node, "arguments", _arguments, 1);
      validate(defs.optional, node, "optional", optional);
      return node;
    }
    function classProperty(key, value2 = null, typeAnnotation2 = null, decorators = null, computed = false, _static = false) {
      const node = {
        type: "ClassProperty",
        key,
        value: value2,
        typeAnnotation: typeAnnotation2,
        decorators,
        computed,
        static: _static
      };
      const defs = NODE_FIELDS.ClassProperty;
      validate(defs.key, node, "key", key, 1);
      validate(defs.value, node, "value", value2, 1);
      validate(defs.typeAnnotation, node, "typeAnnotation", typeAnnotation2, 1);
      validate(defs.decorators, node, "decorators", decorators, 1);
      validate(defs.computed, node, "computed", computed);
      validate(defs.static, node, "static", _static);
      return node;
    }
    function classAccessorProperty(key, value2 = null, typeAnnotation2 = null, decorators = null, computed = false, _static = false) {
      const node = {
        type: "ClassAccessorProperty",
        key,
        value: value2,
        typeAnnotation: typeAnnotation2,
        decorators,
        computed,
        static: _static
      };
      const defs = NODE_FIELDS.ClassAccessorProperty;
      validate(defs.key, node, "key", key, 1);
      validate(defs.value, node, "value", value2, 1);
      validate(defs.typeAnnotation, node, "typeAnnotation", typeAnnotation2, 1);
      validate(defs.decorators, node, "decorators", decorators, 1);
      validate(defs.computed, node, "computed", computed);
      validate(defs.static, node, "static", _static);
      return node;
    }
    function classPrivateProperty(key, value2 = null, decorators = null, _static = false) {
      const node = {
        type: "ClassPrivateProperty",
        key,
        value: value2,
        decorators,
        static: _static
      };
      const defs = NODE_FIELDS.ClassPrivateProperty;
      validate(defs.key, node, "key", key, 1);
      validate(defs.value, node, "value", value2, 1);
      validate(defs.decorators, node, "decorators", decorators, 1);
      validate(defs.static, node, "static", _static);
      return node;
    }
    function classPrivateMethod(kind = "method", key, params, body, _static = false) {
      const node = {
        type: "ClassPrivateMethod",
        kind,
        key,
        params,
        body,
        static: _static
      };
      const defs = NODE_FIELDS.ClassPrivateMethod;
      validate(defs.kind, node, "kind", kind);
      validate(defs.key, node, "key", key, 1);
      validate(defs.params, node, "params", params, 1);
      validate(defs.body, node, "body", body, 1);
      validate(defs.static, node, "static", _static);
      return node;
    }
    function privateName(id) {
      const node = {
        type: "PrivateName",
        id
      };
      const defs = NODE_FIELDS.PrivateName;
      validate(defs.id, node, "id", id, 1);
      return node;
    }
    function staticBlock(body) {
      const node = {
        type: "StaticBlock",
        body
      };
      const defs = NODE_FIELDS.StaticBlock;
      validate(defs.body, node, "body", body, 1);
      return node;
    }
    function importAttribute(key, value2) {
      const node = {
        type: "ImportAttribute",
        key,
        value: value2
      };
      const defs = NODE_FIELDS.ImportAttribute;
      validate(defs.key, node, "key", key, 1);
      validate(defs.value, node, "value", value2, 1);
      return node;
    }
    function anyTypeAnnotation() {
      return {
        type: "AnyTypeAnnotation"
      };
    }
    function arrayTypeAnnotation(elementType) {
      const node = {
        type: "ArrayTypeAnnotation",
        elementType
      };
      const defs = NODE_FIELDS.ArrayTypeAnnotation;
      validate(defs.elementType, node, "elementType", elementType, 1);
      return node;
    }
    function booleanTypeAnnotation() {
      return {
        type: "BooleanTypeAnnotation"
      };
    }
    function booleanLiteralTypeAnnotation(value2) {
      const node = {
        type: "BooleanLiteralTypeAnnotation",
        value: value2
      };
      const defs = NODE_FIELDS.BooleanLiteralTypeAnnotation;
      validate(defs.value, node, "value", value2);
      return node;
    }
    function nullLiteralTypeAnnotation() {
      return {
        type: "NullLiteralTypeAnnotation"
      };
    }
    function classImplements(id, typeParameters = null) {
      const node = {
        type: "ClassImplements",
        id,
        typeParameters
      };
      const defs = NODE_FIELDS.ClassImplements;
      validate(defs.id, node, "id", id, 1);
      validate(defs.typeParameters, node, "typeParameters", typeParameters, 1);
      return node;
    }
    function declareClass(id, typeParameters = null, _extends = null, body) {
      const node = {
        type: "DeclareClass",
        id,
        typeParameters,
        extends: _extends,
        body
      };
      const defs = NODE_FIELDS.DeclareClass;
      validate(defs.id, node, "id", id, 1);
      validate(defs.typeParameters, node, "typeParameters", typeParameters, 1);
      validate(defs.extends, node, "extends", _extends, 1);
      validate(defs.body, node, "body", body, 1);
      return node;
    }
    function declareFunction(id) {
      const node = {
        type: "DeclareFunction",
        id
      };
      const defs = NODE_FIELDS.DeclareFunction;
      validate(defs.id, node, "id", id, 1);
      return node;
    }
    function declareInterface(id, typeParameters = null, _extends = null, body) {
      const node = {
        type: "DeclareInterface",
        id,
        typeParameters,
        extends: _extends,
        body
      };
      const defs = NODE_FIELDS.DeclareInterface;
      validate(defs.id, node, "id", id, 1);
      validate(defs.typeParameters, node, "typeParameters", typeParameters, 1);
      validate(defs.extends, node, "extends", _extends, 1);
      validate(defs.body, node, "body", body, 1);
      return node;
    }
    function declareModule(id, body, kind = null) {
      const node = {
        type: "DeclareModule",
        id,
        body,
        kind
      };
      const defs = NODE_FIELDS.DeclareModule;
      validate(defs.id, node, "id", id, 1);
      validate(defs.body, node, "body", body, 1);
      validate(defs.kind, node, "kind", kind);
      return node;
    }
    function declareModuleExports(typeAnnotation2) {
      const node = {
        type: "DeclareModuleExports",
        typeAnnotation: typeAnnotation2
      };
      const defs = NODE_FIELDS.DeclareModuleExports;
      validate(defs.typeAnnotation, node, "typeAnnotation", typeAnnotation2, 1);
      return node;
    }
    function declareTypeAlias(id, typeParameters = null, right) {
      const node = {
        type: "DeclareTypeAlias",
        id,
        typeParameters,
        right
      };
      const defs = NODE_FIELDS.DeclareTypeAlias;
      validate(defs.id, node, "id", id, 1);
      validate(defs.typeParameters, node, "typeParameters", typeParameters, 1);
      validate(defs.right, node, "right", right, 1);
      return node;
    }
    function declareOpaqueType(id, typeParameters = null, supertype = null) {
      const node = {
        type: "DeclareOpaqueType",
        id,
        typeParameters,
        supertype
      };
      const defs = NODE_FIELDS.DeclareOpaqueType;
      validate(defs.id, node, "id", id, 1);
      validate(defs.typeParameters, node, "typeParameters", typeParameters, 1);
      validate(defs.supertype, node, "supertype", supertype, 1);
      return node;
    }
    function declareVariable(id) {
      const node = {
        type: "DeclareVariable",
        id
      };
      const defs = NODE_FIELDS.DeclareVariable;
      validate(defs.id, node, "id", id, 1);
      return node;
    }
    function declareExportDeclaration(declaration = null, specifiers = null, source = null, attributes = null) {
      const node = {
        type: "DeclareExportDeclaration",
        declaration,
        specifiers,
        source,
        attributes
      };
      const defs = NODE_FIELDS.DeclareExportDeclaration;
      validate(defs.declaration, node, "declaration", declaration, 1);
      validate(defs.specifiers, node, "specifiers", specifiers, 1);
      validate(defs.source, node, "source", source, 1);
      validate(defs.attributes, node, "attributes", attributes, 1);
      return node;
    }
    function declareExportAllDeclaration(source, attributes = null) {
      const node = {
        type: "DeclareExportAllDeclaration",
        source,
        attributes
      };
      const defs = NODE_FIELDS.DeclareExportAllDeclaration;
      validate(defs.source, node, "source", source, 1);
      validate(defs.attributes, node, "attributes", attributes, 1);
      return node;
    }
    function declaredPredicate(value2) {
      const node = {
        type: "DeclaredPredicate",
        value: value2
      };
      const defs = NODE_FIELDS.DeclaredPredicate;
      validate(defs.value, node, "value", value2, 1);
      return node;
    }
    function existsTypeAnnotation() {
      return {
        type: "ExistsTypeAnnotation"
      };
    }
    function functionTypeAnnotation(typeParameters = null, params, rest = null, returnType) {
      const node = {
        type: "FunctionTypeAnnotation",
        typeParameters,
        params,
        rest,
        returnType
      };
      const defs = NODE_FIELDS.FunctionTypeAnnotation;
      validate(defs.typeParameters, node, "typeParameters", typeParameters, 1);
      validate(defs.params, node, "params", params, 1);
      validate(defs.rest, node, "rest", rest, 1);
      validate(defs.returnType, node, "returnType", returnType, 1);
      return node;
    }
    function functionTypeParam(name = null, typeAnnotation2) {
      const node = {
        type: "FunctionTypeParam",
        name,
        typeAnnotation: typeAnnotation2
      };
      const defs = NODE_FIELDS.FunctionTypeParam;
      validate(defs.name, node, "name", name, 1);
      validate(defs.typeAnnotation, node, "typeAnnotation", typeAnnotation2, 1);
      return node;
    }
    function genericTypeAnnotation(id, typeParameters = null) {
      const node = {
        type: "GenericTypeAnnotation",
        id,
        typeParameters
      };
      const defs = NODE_FIELDS.GenericTypeAnnotation;
      validate(defs.id, node, "id", id, 1);
      validate(defs.typeParameters, node, "typeParameters", typeParameters, 1);
      return node;
    }
    function inferredPredicate() {
      return {
        type: "InferredPredicate"
      };
    }
    function interfaceExtends(id, typeParameters = null) {
      const node = {
        type: "InterfaceExtends",
        id,
        typeParameters
      };
      const defs = NODE_FIELDS.InterfaceExtends;
      validate(defs.id, node, "id", id, 1);
      validate(defs.typeParameters, node, "typeParameters", typeParameters, 1);
      return node;
    }
    function interfaceDeclaration(id, typeParameters = null, _extends = null, body) {
      const node = {
        type: "InterfaceDeclaration",
        id,
        typeParameters,
        extends: _extends,
        body
      };
      const defs = NODE_FIELDS.InterfaceDeclaration;
      validate(defs.id, node, "id", id, 1);
      validate(defs.typeParameters, node, "typeParameters", typeParameters, 1);
      validate(defs.extends, node, "extends", _extends, 1);
      validate(defs.body, node, "body", body, 1);
      return node;
    }
    function interfaceTypeAnnotation(_extends = null, body) {
      const node = {
        type: "InterfaceTypeAnnotation",
        extends: _extends,
        body
      };
      const defs = NODE_FIELDS.InterfaceTypeAnnotation;
      validate(defs.extends, node, "extends", _extends, 1);
      validate(defs.body, node, "body", body, 1);
      return node;
    }
    function intersectionTypeAnnotation(types2) {
      const node = {
        type: "IntersectionTypeAnnotation",
        types: types2
      };
      const defs = NODE_FIELDS.IntersectionTypeAnnotation;
      validate(defs.types, node, "types", types2, 1);
      return node;
    }
    function mixedTypeAnnotation() {
      return {
        type: "MixedTypeAnnotation"
      };
    }
    function emptyTypeAnnotation() {
      return {
        type: "EmptyTypeAnnotation"
      };
    }
    function nullableTypeAnnotation(typeAnnotation2) {
      const node = {
        type: "NullableTypeAnnotation",
        typeAnnotation: typeAnnotation2
      };
      const defs = NODE_FIELDS.NullableTypeAnnotation;
      validate(defs.typeAnnotation, node, "typeAnnotation", typeAnnotation2, 1);
      return node;
    }
    function numberLiteralTypeAnnotation(value2) {
      const node = {
        type: "NumberLiteralTypeAnnotation",
        value: value2
      };
      const defs = NODE_FIELDS.NumberLiteralTypeAnnotation;
      validate(defs.value, node, "value", value2);
      return node;
    }
    function numberTypeAnnotation() {
      return {
        type: "NumberTypeAnnotation"
      };
    }
    function objectTypeAnnotation(properties, indexers = [], callProperties = [], internalSlots = [], exact = false) {
      const node = {
        type: "ObjectTypeAnnotation",
        properties,
        indexers,
        callProperties,
        internalSlots,
        exact
      };
      const defs = NODE_FIELDS.ObjectTypeAnnotation;
      validate(defs.properties, node, "properties", properties, 1);
      validate(defs.indexers, node, "indexers", indexers, 1);
      validate(defs.callProperties, node, "callProperties", callProperties, 1);
      validate(defs.internalSlots, node, "internalSlots", internalSlots, 1);
      validate(defs.exact, node, "exact", exact);
      return node;
    }
    function objectTypeInternalSlot(id, value2, optional, _static, method) {
      const node = {
        type: "ObjectTypeInternalSlot",
        id,
        value: value2,
        optional,
        static: _static,
        method
      };
      const defs = NODE_FIELDS.ObjectTypeInternalSlot;
      validate(defs.id, node, "id", id, 1);
      validate(defs.value, node, "value", value2, 1);
      validate(defs.optional, node, "optional", optional);
      validate(defs.static, node, "static", _static);
      validate(defs.method, node, "method", method);
      return node;
    }
    function objectTypeCallProperty(value2) {
      const node = {
        type: "ObjectTypeCallProperty",
        value: value2,
        static: null
      };
      const defs = NODE_FIELDS.ObjectTypeCallProperty;
      validate(defs.value, node, "value", value2, 1);
      return node;
    }
    function objectTypeIndexer(id = null, key, value2, variance2 = null) {
      const node = {
        type: "ObjectTypeIndexer",
        id,
        key,
        value: value2,
        variance: variance2,
        static: null
      };
      const defs = NODE_FIELDS.ObjectTypeIndexer;
      validate(defs.id, node, "id", id, 1);
      validate(defs.key, node, "key", key, 1);
      validate(defs.value, node, "value", value2, 1);
      validate(defs.variance, node, "variance", variance2, 1);
      return node;
    }
    function objectTypeProperty(key, value2, variance2 = null) {
      const node = {
        type: "ObjectTypeProperty",
        key,
        value: value2,
        variance: variance2,
        kind: null,
        method: null,
        optional: null,
        proto: null,
        static: null
      };
      const defs = NODE_FIELDS.ObjectTypeProperty;
      validate(defs.key, node, "key", key, 1);
      validate(defs.value, node, "value", value2, 1);
      validate(defs.variance, node, "variance", variance2, 1);
      return node;
    }
    function objectTypeSpreadProperty(argument) {
      const node = {
        type: "ObjectTypeSpreadProperty",
        argument
      };
      const defs = NODE_FIELDS.ObjectTypeSpreadProperty;
      validate(defs.argument, node, "argument", argument, 1);
      return node;
    }
    function opaqueType(id, typeParameters = null, supertype = null, impltype) {
      const node = {
        type: "OpaqueType",
        id,
        typeParameters,
        supertype,
        impltype
      };
      const defs = NODE_FIELDS.OpaqueType;
      validate(defs.id, node, "id", id, 1);
      validate(defs.typeParameters, node, "typeParameters", typeParameters, 1);
      validate(defs.supertype, node, "supertype", supertype, 1);
      validate(defs.impltype, node, "impltype", impltype, 1);
      return node;
    }
    function qualifiedTypeIdentifier(id, qualification) {
      const node = {
        type: "QualifiedTypeIdentifier",
        id,
        qualification
      };
      const defs = NODE_FIELDS.QualifiedTypeIdentifier;
      validate(defs.id, node, "id", id, 1);
      validate(defs.qualification, node, "qualification", qualification, 1);
      return node;
    }
    function stringLiteralTypeAnnotation(value2) {
      const node = {
        type: "StringLiteralTypeAnnotation",
        value: value2
      };
      const defs = NODE_FIELDS.StringLiteralTypeAnnotation;
      validate(defs.value, node, "value", value2);
      return node;
    }
    function stringTypeAnnotation() {
      return {
        type: "StringTypeAnnotation"
      };
    }
    function symbolTypeAnnotation() {
      return {
        type: "SymbolTypeAnnotation"
      };
    }
    function thisTypeAnnotation() {
      return {
        type: "ThisTypeAnnotation"
      };
    }
    function tupleTypeAnnotation(types2) {
      const node = {
        type: "TupleTypeAnnotation",
        types: types2
      };
      const defs = NODE_FIELDS.TupleTypeAnnotation;
      validate(defs.types, node, "types", types2, 1);
      return node;
    }
    function typeofTypeAnnotation(argument) {
      const node = {
        type: "TypeofTypeAnnotation",
        argument
      };
      const defs = NODE_FIELDS.TypeofTypeAnnotation;
      validate(defs.argument, node, "argument", argument, 1);
      return node;
    }
    function typeAlias(id, typeParameters = null, right) {
      const node = {
        type: "TypeAlias",
        id,
        typeParameters,
        right
      };
      const defs = NODE_FIELDS.TypeAlias;
      validate(defs.id, node, "id", id, 1);
      validate(defs.typeParameters, node, "typeParameters", typeParameters, 1);
      validate(defs.right, node, "right", right, 1);
      return node;
    }
    function typeAnnotation(typeAnnotation2) {
      const node = {
        type: "TypeAnnotation",
        typeAnnotation: typeAnnotation2
      };
      const defs = NODE_FIELDS.TypeAnnotation;
      validate(defs.typeAnnotation, node, "typeAnnotation", typeAnnotation2, 1);
      return node;
    }
    function typeCastExpression(expression, typeAnnotation2) {
      const node = {
        type: "TypeCastExpression",
        expression,
        typeAnnotation: typeAnnotation2
      };
      const defs = NODE_FIELDS.TypeCastExpression;
      validate(defs.expression, node, "expression", expression, 1);
      validate(defs.typeAnnotation, node, "typeAnnotation", typeAnnotation2, 1);
      return node;
    }
    function typeParameter(bound = null, _default = null, variance2 = null) {
      const node = {
        type: "TypeParameter",
        bound,
        default: _default,
        variance: variance2,
        name: null
      };
      const defs = NODE_FIELDS.TypeParameter;
      validate(defs.bound, node, "bound", bound, 1);
      validate(defs.default, node, "default", _default, 1);
      validate(defs.variance, node, "variance", variance2, 1);
      return node;
    }
    function typeParameterDeclaration(params) {
      const node = {
        type: "TypeParameterDeclaration",
        params
      };
      const defs = NODE_FIELDS.TypeParameterDeclaration;
      validate(defs.params, node, "params", params, 1);
      return node;
    }
    function typeParameterInstantiation(params) {
      const node = {
        type: "TypeParameterInstantiation",
        params
      };
      const defs = NODE_FIELDS.TypeParameterInstantiation;
      validate(defs.params, node, "params", params, 1);
      return node;
    }
    function unionTypeAnnotation(types2) {
      const node = {
        type: "UnionTypeAnnotation",
        types: types2
      };
      const defs = NODE_FIELDS.UnionTypeAnnotation;
      validate(defs.types, node, "types", types2, 1);
      return node;
    }
    function variance(kind) {
      const node = {
        type: "Variance",
        kind
      };
      const defs = NODE_FIELDS.Variance;
      validate(defs.kind, node, "kind", kind);
      return node;
    }
    function voidTypeAnnotation() {
      return {
        type: "VoidTypeAnnotation"
      };
    }
    function enumDeclaration(id, body) {
      const node = {
        type: "EnumDeclaration",
        id,
        body
      };
      const defs = NODE_FIELDS.EnumDeclaration;
      validate(defs.id, node, "id", id, 1);
      validate(defs.body, node, "body", body, 1);
      return node;
    }
    function enumBooleanBody(members) {
      const node = {
        type: "EnumBooleanBody",
        members,
        explicitType: null,
        hasUnknownMembers: null
      };
      const defs = NODE_FIELDS.EnumBooleanBody;
      validate(defs.members, node, "members", members, 1);
      return node;
    }
    function enumNumberBody(members) {
      const node = {
        type: "EnumNumberBody",
        members,
        explicitType: null,
        hasUnknownMembers: null
      };
      const defs = NODE_FIELDS.EnumNumberBody;
      validate(defs.members, node, "members", members, 1);
      return node;
    }
    function enumStringBody(members) {
      const node = {
        type: "EnumStringBody",
        members,
        explicitType: null,
        hasUnknownMembers: null
      };
      const defs = NODE_FIELDS.EnumStringBody;
      validate(defs.members, node, "members", members, 1);
      return node;
    }
    function enumSymbolBody(members) {
      const node = {
        type: "EnumSymbolBody",
        members,
        hasUnknownMembers: null
      };
      const defs = NODE_FIELDS.EnumSymbolBody;
      validate(defs.members, node, "members", members, 1);
      return node;
    }
    function enumBooleanMember(id) {
      const node = {
        type: "EnumBooleanMember",
        id,
        init: null
      };
      const defs = NODE_FIELDS.EnumBooleanMember;
      validate(defs.id, node, "id", id, 1);
      return node;
    }
    function enumNumberMember(id, init) {
      const node = {
        type: "EnumNumberMember",
        id,
        init
      };
      const defs = NODE_FIELDS.EnumNumberMember;
      validate(defs.id, node, "id", id, 1);
      validate(defs.init, node, "init", init, 1);
      return node;
    }
    function enumStringMember(id, init) {
      const node = {
        type: "EnumStringMember",
        id,
        init
      };
      const defs = NODE_FIELDS.EnumStringMember;
      validate(defs.id, node, "id", id, 1);
      validate(defs.init, node, "init", init, 1);
      return node;
    }
    function enumDefaultedMember(id) {
      const node = {
        type: "EnumDefaultedMember",
        id
      };
      const defs = NODE_FIELDS.EnumDefaultedMember;
      validate(defs.id, node, "id", id, 1);
      return node;
    }
    function indexedAccessType(objectType, indexType) {
      const node = {
        type: "IndexedAccessType",
        objectType,
        indexType
      };
      const defs = NODE_FIELDS.IndexedAccessType;
      validate(defs.objectType, node, "objectType", objectType, 1);
      validate(defs.indexType, node, "indexType", indexType, 1);
      return node;
    }
    function optionalIndexedAccessType(objectType, indexType) {
      const node = {
        type: "OptionalIndexedAccessType",
        objectType,
        indexType,
        optional: null
      };
      const defs = NODE_FIELDS.OptionalIndexedAccessType;
      validate(defs.objectType, node, "objectType", objectType, 1);
      validate(defs.indexType, node, "indexType", indexType, 1);
      return node;
    }
    function jsxAttribute(name, value2 = null) {
      const node = {
        type: "JSXAttribute",
        name,
        value: value2
      };
      const defs = NODE_FIELDS.JSXAttribute;
      validate(defs.name, node, "name", name, 1);
      validate(defs.value, node, "value", value2, 1);
      return node;
    }
    function jsxClosingElement(name) {
      const node = {
        type: "JSXClosingElement",
        name
      };
      const defs = NODE_FIELDS.JSXClosingElement;
      validate(defs.name, node, "name", name, 1);
      return node;
    }
    function jsxElement(openingElement, closingElement = null, children, selfClosing = null) {
      const node = {
        type: "JSXElement",
        openingElement,
        closingElement,
        children,
        selfClosing
      };
      const defs = NODE_FIELDS.JSXElement;
      validate(defs.openingElement, node, "openingElement", openingElement, 1);
      validate(defs.closingElement, node, "closingElement", closingElement, 1);
      validate(defs.children, node, "children", children, 1);
      validate(defs.selfClosing, node, "selfClosing", selfClosing);
      return node;
    }
    function jsxEmptyExpression() {
      return {
        type: "JSXEmptyExpression"
      };
    }
    function jsxExpressionContainer(expression) {
      const node = {
        type: "JSXExpressionContainer",
        expression
      };
      const defs = NODE_FIELDS.JSXExpressionContainer;
      validate(defs.expression, node, "expression", expression, 1);
      return node;
    }
    function jsxSpreadChild(expression) {
      const node = {
        type: "JSXSpreadChild",
        expression
      };
      const defs = NODE_FIELDS.JSXSpreadChild;
      validate(defs.expression, node, "expression", expression, 1);
      return node;
    }
    function jsxIdentifier(name) {
      const node = {
        type: "JSXIdentifier",
        name
      };
      const defs = NODE_FIELDS.JSXIdentifier;
      validate(defs.name, node, "name", name);
      return node;
    }
    function jsxMemberExpression(object, property) {
      const node = {
        type: "JSXMemberExpression",
        object,
        property
      };
      const defs = NODE_FIELDS.JSXMemberExpression;
      validate(defs.object, node, "object", object, 1);
      validate(defs.property, node, "property", property, 1);
      return node;
    }
    function jsxNamespacedName(namespace, name) {
      const node = {
        type: "JSXNamespacedName",
        namespace,
        name
      };
      const defs = NODE_FIELDS.JSXNamespacedName;
      validate(defs.namespace, node, "namespace", namespace, 1);
      validate(defs.name, node, "name", name, 1);
      return node;
    }
    function jsxOpeningElement(name, attributes, selfClosing = false) {
      const node = {
        type: "JSXOpeningElement",
        name,
        attributes,
        selfClosing
      };
      const defs = NODE_FIELDS.JSXOpeningElement;
      validate(defs.name, node, "name", name, 1);
      validate(defs.attributes, node, "attributes", attributes, 1);
      validate(defs.selfClosing, node, "selfClosing", selfClosing);
      return node;
    }
    function jsxSpreadAttribute(argument) {
      const node = {
        type: "JSXSpreadAttribute",
        argument
      };
      const defs = NODE_FIELDS.JSXSpreadAttribute;
      validate(defs.argument, node, "argument", argument, 1);
      return node;
    }
    function jsxText(value2) {
      const node = {
        type: "JSXText",
        value: value2
      };
      const defs = NODE_FIELDS.JSXText;
      validate(defs.value, node, "value", value2);
      return node;
    }
    function jsxFragment(openingFragment, closingFragment, children) {
      const node = {
        type: "JSXFragment",
        openingFragment,
        closingFragment,
        children
      };
      const defs = NODE_FIELDS.JSXFragment;
      validate(defs.openingFragment, node, "openingFragment", openingFragment, 1);
      validate(defs.closingFragment, node, "closingFragment", closingFragment, 1);
      validate(defs.children, node, "children", children, 1);
      return node;
    }
    function jsxOpeningFragment() {
      return {
        type: "JSXOpeningFragment"
      };
    }
    function jsxClosingFragment() {
      return {
        type: "JSXClosingFragment"
      };
    }
    function noop() {
      return {
        type: "Noop"
      };
    }
    function placeholder(expectedNode, name) {
      const node = {
        type: "Placeholder",
        expectedNode,
        name
      };
      const defs = NODE_FIELDS.Placeholder;
      validate(defs.expectedNode, node, "expectedNode", expectedNode);
      validate(defs.name, node, "name", name, 1);
      return node;
    }
    function v8IntrinsicIdentifier(name) {
      const node = {
        type: "V8IntrinsicIdentifier",
        name
      };
      const defs = NODE_FIELDS.V8IntrinsicIdentifier;
      validate(defs.name, node, "name", name);
      return node;
    }
    function argumentPlaceholder() {
      return {
        type: "ArgumentPlaceholder"
      };
    }
    function bindExpression(object, callee) {
      const node = {
        type: "BindExpression",
        object,
        callee
      };
      const defs = NODE_FIELDS.BindExpression;
      validate(defs.object, node, "object", object, 1);
      validate(defs.callee, node, "callee", callee, 1);
      return node;
    }
    function decorator(expression) {
      const node = {
        type: "Decorator",
        expression
      };
      const defs = NODE_FIELDS.Decorator;
      validate(defs.expression, node, "expression", expression, 1);
      return node;
    }
    function doExpression(body, async = false) {
      const node = {
        type: "DoExpression",
        body,
        async
      };
      const defs = NODE_FIELDS.DoExpression;
      validate(defs.body, node, "body", body, 1);
      validate(defs.async, node, "async", async);
      return node;
    }
    function exportDefaultSpecifier(exported) {
      const node = {
        type: "ExportDefaultSpecifier",
        exported
      };
      const defs = NODE_FIELDS.ExportDefaultSpecifier;
      validate(defs.exported, node, "exported", exported, 1);
      return node;
    }
    function recordExpression(properties) {
      const node = {
        type: "RecordExpression",
        properties
      };
      const defs = NODE_FIELDS.RecordExpression;
      validate(defs.properties, node, "properties", properties, 1);
      return node;
    }
    function tupleExpression(elements = []) {
      const node = {
        type: "TupleExpression",
        elements
      };
      const defs = NODE_FIELDS.TupleExpression;
      validate(defs.elements, node, "elements", elements, 1);
      return node;
    }
    function decimalLiteral(value2) {
      const node = {
        type: "DecimalLiteral",
        value: value2
      };
      const defs = NODE_FIELDS.DecimalLiteral;
      validate(defs.value, node, "value", value2);
      return node;
    }
    function moduleExpression(body) {
      const node = {
        type: "ModuleExpression",
        body
      };
      const defs = NODE_FIELDS.ModuleExpression;
      validate(defs.body, node, "body", body, 1);
      return node;
    }
    function topicReference() {
      return {
        type: "TopicReference"
      };
    }
    function pipelineTopicExpression(expression) {
      const node = {
        type: "PipelineTopicExpression",
        expression
      };
      const defs = NODE_FIELDS.PipelineTopicExpression;
      validate(defs.expression, node, "expression", expression, 1);
      return node;
    }
    function pipelineBareFunction(callee) {
      const node = {
        type: "PipelineBareFunction",
        callee
      };
      const defs = NODE_FIELDS.PipelineBareFunction;
      validate(defs.callee, node, "callee", callee, 1);
      return node;
    }
    function pipelinePrimaryTopicReference() {
      return {
        type: "PipelinePrimaryTopicReference"
      };
    }
    function voidPattern() {
      return {
        type: "VoidPattern"
      };
    }
    function tsParameterProperty(parameter) {
      const node = {
        type: "TSParameterProperty",
        parameter
      };
      const defs = NODE_FIELDS.TSParameterProperty;
      validate(defs.parameter, node, "parameter", parameter, 1);
      return node;
    }
    function tsDeclareFunction(id = null, typeParameters = null, params, returnType = null) {
      const node = {
        type: "TSDeclareFunction",
        id,
        typeParameters,
        params,
        returnType
      };
      const defs = NODE_FIELDS.TSDeclareFunction;
      validate(defs.id, node, "id", id, 1);
      validate(defs.typeParameters, node, "typeParameters", typeParameters, 1);
      validate(defs.params, node, "params", params, 1);
      validate(defs.returnType, node, "returnType", returnType, 1);
      return node;
    }
    function tsDeclareMethod(decorators = null, key, typeParameters = null, params, returnType = null) {
      const node = {
        type: "TSDeclareMethod",
        decorators,
        key,
        typeParameters,
        params,
        returnType
      };
      const defs = NODE_FIELDS.TSDeclareMethod;
      validate(defs.decorators, node, "decorators", decorators, 1);
      validate(defs.key, node, "key", key, 1);
      validate(defs.typeParameters, node, "typeParameters", typeParameters, 1);
      validate(defs.params, node, "params", params, 1);
      validate(defs.returnType, node, "returnType", returnType, 1);
      return node;
    }
    function tsQualifiedName(left, right) {
      const node = {
        type: "TSQualifiedName",
        left,
        right
      };
      const defs = NODE_FIELDS.TSQualifiedName;
      validate(defs.left, node, "left", left, 1);
      validate(defs.right, node, "right", right, 1);
      return node;
    }
    function tsCallSignatureDeclaration(typeParameters = null, parameters, typeAnnotation2 = null) {
      const node = {
        type: "TSCallSignatureDeclaration",
        typeParameters,
        parameters,
        typeAnnotation: typeAnnotation2
      };
      const defs = NODE_FIELDS.TSCallSignatureDeclaration;
      validate(defs.typeParameters, node, "typeParameters", typeParameters, 1);
      validate(defs.parameters, node, "parameters", parameters, 1);
      validate(defs.typeAnnotation, node, "typeAnnotation", typeAnnotation2, 1);
      return node;
    }
    function tsConstructSignatureDeclaration(typeParameters = null, parameters, typeAnnotation2 = null) {
      const node = {
        type: "TSConstructSignatureDeclaration",
        typeParameters,
        parameters,
        typeAnnotation: typeAnnotation2
      };
      const defs = NODE_FIELDS.TSConstructSignatureDeclaration;
      validate(defs.typeParameters, node, "typeParameters", typeParameters, 1);
      validate(defs.parameters, node, "parameters", parameters, 1);
      validate(defs.typeAnnotation, node, "typeAnnotation", typeAnnotation2, 1);
      return node;
    }
    function tsPropertySignature(key, typeAnnotation2 = null) {
      const node = {
        type: "TSPropertySignature",
        key,
        typeAnnotation: typeAnnotation2
      };
      const defs = NODE_FIELDS.TSPropertySignature;
      validate(defs.key, node, "key", key, 1);
      validate(defs.typeAnnotation, node, "typeAnnotation", typeAnnotation2, 1);
      return node;
    }
    function tsMethodSignature(key, typeParameters = null, parameters, typeAnnotation2 = null) {
      const node = {
        type: "TSMethodSignature",
        key,
        typeParameters,
        parameters,
        typeAnnotation: typeAnnotation2,
        kind: null
      };
      const defs = NODE_FIELDS.TSMethodSignature;
      validate(defs.key, node, "key", key, 1);
      validate(defs.typeParameters, node, "typeParameters", typeParameters, 1);
      validate(defs.parameters, node, "parameters", parameters, 1);
      validate(defs.typeAnnotation, node, "typeAnnotation", typeAnnotation2, 1);
      return node;
    }
    function tsIndexSignature(parameters, typeAnnotation2 = null) {
      const node = {
        type: "TSIndexSignature",
        parameters,
        typeAnnotation: typeAnnotation2
      };
      const defs = NODE_FIELDS.TSIndexSignature;
      validate(defs.parameters, node, "parameters", parameters, 1);
      validate(defs.typeAnnotation, node, "typeAnnotation", typeAnnotation2, 1);
      return node;
    }
    function tsAnyKeyword() {
      return {
        type: "TSAnyKeyword"
      };
    }
    function tsBooleanKeyword() {
      return {
        type: "TSBooleanKeyword"
      };
    }
    function tsBigIntKeyword() {
      return {
        type: "TSBigIntKeyword"
      };
    }
    function tsIntrinsicKeyword() {
      return {
        type: "TSIntrinsicKeyword"
      };
    }
    function tsNeverKeyword() {
      return {
        type: "TSNeverKeyword"
      };
    }
    function tsNullKeyword() {
      return {
        type: "TSNullKeyword"
      };
    }
    function tsNumberKeyword() {
      return {
        type: "TSNumberKeyword"
      };
    }
    function tsObjectKeyword() {
      return {
        type: "TSObjectKeyword"
      };
    }
    function tsStringKeyword() {
      return {
        type: "TSStringKeyword"
      };
    }
    function tsSymbolKeyword() {
      return {
        type: "TSSymbolKeyword"
      };
    }
    function tsUndefinedKeyword() {
      return {
        type: "TSUndefinedKeyword"
      };
    }
    function tsUnknownKeyword() {
      return {
        type: "TSUnknownKeyword"
      };
    }
    function tsVoidKeyword() {
      return {
        type: "TSVoidKeyword"
      };
    }
    function tsThisType() {
      return {
        type: "TSThisType"
      };
    }
    function tsFunctionType(typeParameters = null, parameters, typeAnnotation2 = null) {
      const node = {
        type: "TSFunctionType",
        typeParameters,
        parameters,
        typeAnnotation: typeAnnotation2
      };
      const defs = NODE_FIELDS.TSFunctionType;
      validate(defs.typeParameters, node, "typeParameters", typeParameters, 1);
      validate(defs.parameters, node, "parameters", parameters, 1);
      validate(defs.typeAnnotation, node, "typeAnnotation", typeAnnotation2, 1);
      return node;
    }
    function tsConstructorType(typeParameters = null, parameters, typeAnnotation2 = null) {
      const node = {
        type: "TSConstructorType",
        typeParameters,
        parameters,
        typeAnnotation: typeAnnotation2
      };
      const defs = NODE_FIELDS.TSConstructorType;
      validate(defs.typeParameters, node, "typeParameters", typeParameters, 1);
      validate(defs.parameters, node, "parameters", parameters, 1);
      validate(defs.typeAnnotation, node, "typeAnnotation", typeAnnotation2, 1);
      return node;
    }
    function tsTypeReference(typeName, typeParameters = null) {
      const node = {
        type: "TSTypeReference",
        typeName,
        typeParameters
      };
      const defs = NODE_FIELDS.TSTypeReference;
      validate(defs.typeName, node, "typeName", typeName, 1);
      validate(defs.typeParameters, node, "typeParameters", typeParameters, 1);
      return node;
    }
    function tsTypePredicate(parameterName, typeAnnotation2 = null, asserts = null) {
      const node = {
        type: "TSTypePredicate",
        parameterName,
        typeAnnotation: typeAnnotation2,
        asserts
      };
      const defs = NODE_FIELDS.TSTypePredicate;
      validate(defs.parameterName, node, "parameterName", parameterName, 1);
      validate(defs.typeAnnotation, node, "typeAnnotation", typeAnnotation2, 1);
      validate(defs.asserts, node, "asserts", asserts);
      return node;
    }
    function tsTypeQuery(exprName, typeParameters = null) {
      const node = {
        type: "TSTypeQuery",
        exprName,
        typeParameters
      };
      const defs = NODE_FIELDS.TSTypeQuery;
      validate(defs.exprName, node, "exprName", exprName, 1);
      validate(defs.typeParameters, node, "typeParameters", typeParameters, 1);
      return node;
    }
    function tsTypeLiteral(members) {
      const node = {
        type: "TSTypeLiteral",
        members
      };
      const defs = NODE_FIELDS.TSTypeLiteral;
      validate(defs.members, node, "members", members, 1);
      return node;
    }
    function tsArrayType(elementType) {
      const node = {
        type: "TSArrayType",
        elementType
      };
      const defs = NODE_FIELDS.TSArrayType;
      validate(defs.elementType, node, "elementType", elementType, 1);
      return node;
    }
    function tsTupleType(elementTypes) {
      const node = {
        type: "TSTupleType",
        elementTypes
      };
      const defs = NODE_FIELDS.TSTupleType;
      validate(defs.elementTypes, node, "elementTypes", elementTypes, 1);
      return node;
    }
    function tsOptionalType(typeAnnotation2) {
      const node = {
        type: "TSOptionalType",
        typeAnnotation: typeAnnotation2
      };
      const defs = NODE_FIELDS.TSOptionalType;
      validate(defs.typeAnnotation, node, "typeAnnotation", typeAnnotation2, 1);
      return node;
    }
    function tsRestType(typeAnnotation2) {
      const node = {
        type: "TSRestType",
        typeAnnotation: typeAnnotation2
      };
      const defs = NODE_FIELDS.TSRestType;
      validate(defs.typeAnnotation, node, "typeAnnotation", typeAnnotation2, 1);
      return node;
    }
    function tsNamedTupleMember(label, elementType, optional = false) {
      const node = {
        type: "TSNamedTupleMember",
        label,
        elementType,
        optional
      };
      const defs = NODE_FIELDS.TSNamedTupleMember;
      validate(defs.label, node, "label", label, 1);
      validate(defs.elementType, node, "elementType", elementType, 1);
      validate(defs.optional, node, "optional", optional);
      return node;
    }
    function tsUnionType(types2) {
      const node = {
        type: "TSUnionType",
        types: types2
      };
      const defs = NODE_FIELDS.TSUnionType;
      validate(defs.types, node, "types", types2, 1);
      return node;
    }
    function tsIntersectionType(types2) {
      const node = {
        type: "TSIntersectionType",
        types: types2
      };
      const defs = NODE_FIELDS.TSIntersectionType;
      validate(defs.types, node, "types", types2, 1);
      return node;
    }
    function tsConditionalType(checkType, extendsType, trueType, falseType) {
      const node = {
        type: "TSConditionalType",
        checkType,
        extendsType,
        trueType,
        falseType
      };
      const defs = NODE_FIELDS.TSConditionalType;
      validate(defs.checkType, node, "checkType", checkType, 1);
      validate(defs.extendsType, node, "extendsType", extendsType, 1);
      validate(defs.trueType, node, "trueType", trueType, 1);
      validate(defs.falseType, node, "falseType", falseType, 1);
      return node;
    }
    function tsInferType(typeParameter2) {
      const node = {
        type: "TSInferType",
        typeParameter: typeParameter2
      };
      const defs = NODE_FIELDS.TSInferType;
      validate(defs.typeParameter, node, "typeParameter", typeParameter2, 1);
      return node;
    }
    function tsParenthesizedType(typeAnnotation2) {
      const node = {
        type: "TSParenthesizedType",
        typeAnnotation: typeAnnotation2
      };
      const defs = NODE_FIELDS.TSParenthesizedType;
      validate(defs.typeAnnotation, node, "typeAnnotation", typeAnnotation2, 1);
      return node;
    }
    function tsTypeOperator(typeAnnotation2, operator = "keyof") {
      const node = {
        type: "TSTypeOperator",
        typeAnnotation: typeAnnotation2,
        operator
      };
      const defs = NODE_FIELDS.TSTypeOperator;
      validate(defs.typeAnnotation, node, "typeAnnotation", typeAnnotation2, 1);
      validate(defs.operator, node, "operator", operator);
      return node;
    }
    function tsIndexedAccessType(objectType, indexType) {
      const node = {
        type: "TSIndexedAccessType",
        objectType,
        indexType
      };
      const defs = NODE_FIELDS.TSIndexedAccessType;
      validate(defs.objectType, node, "objectType", objectType, 1);
      validate(defs.indexType, node, "indexType", indexType, 1);
      return node;
    }
    function tsMappedType(typeParameter2, typeAnnotation2 = null, nameType = null) {
      const node = {
        type: "TSMappedType",
        typeParameter: typeParameter2,
        typeAnnotation: typeAnnotation2,
        nameType
      };
      const defs = NODE_FIELDS.TSMappedType;
      validate(defs.typeParameter, node, "typeParameter", typeParameter2, 1);
      validate(defs.typeAnnotation, node, "typeAnnotation", typeAnnotation2, 1);
      validate(defs.nameType, node, "nameType", nameType, 1);
      return node;
    }
    function tsTemplateLiteralType(quasis, types2) {
      const node = {
        type: "TSTemplateLiteralType",
        quasis,
        types: types2
      };
      const defs = NODE_FIELDS.TSTemplateLiteralType;
      validate(defs.quasis, node, "quasis", quasis, 1);
      validate(defs.types, node, "types", types2, 1);
      return node;
    }
    function tsLiteralType(literal) {
      const node = {
        type: "TSLiteralType",
        literal
      };
      const defs = NODE_FIELDS.TSLiteralType;
      validate(defs.literal, node, "literal", literal, 1);
      return node;
    }
    function tsExpressionWithTypeArguments(expression, typeParameters = null) {
      const node = {
        type: "TSExpressionWithTypeArguments",
        expression,
        typeParameters
      };
      const defs = NODE_FIELDS.TSExpressionWithTypeArguments;
      validate(defs.expression, node, "expression", expression, 1);
      validate(defs.typeParameters, node, "typeParameters", typeParameters, 1);
      return node;
    }
    function tsInterfaceDeclaration(id, typeParameters = null, _extends = null, body) {
      const node = {
        type: "TSInterfaceDeclaration",
        id,
        typeParameters,
        extends: _extends,
        body
      };
      const defs = NODE_FIELDS.TSInterfaceDeclaration;
      validate(defs.id, node, "id", id, 1);
      validate(defs.typeParameters, node, "typeParameters", typeParameters, 1);
      validate(defs.extends, node, "extends", _extends, 1);
      validate(defs.body, node, "body", body, 1);
      return node;
    }
    function tsInterfaceBody(body) {
      const node = {
        type: "TSInterfaceBody",
        body
      };
      const defs = NODE_FIELDS.TSInterfaceBody;
      validate(defs.body, node, "body", body, 1);
      return node;
    }
    function tsTypeAliasDeclaration(id, typeParameters = null, typeAnnotation2) {
      const node = {
        type: "TSTypeAliasDeclaration",
        id,
        typeParameters,
        typeAnnotation: typeAnnotation2
      };
      const defs = NODE_FIELDS.TSTypeAliasDeclaration;
      validate(defs.id, node, "id", id, 1);
      validate(defs.typeParameters, node, "typeParameters", typeParameters, 1);
      validate(defs.typeAnnotation, node, "typeAnnotation", typeAnnotation2, 1);
      return node;
    }
    function tsInstantiationExpression(expression, typeParameters = null) {
      const node = {
        type: "TSInstantiationExpression",
        expression,
        typeParameters
      };
      const defs = NODE_FIELDS.TSInstantiationExpression;
      validate(defs.expression, node, "expression", expression, 1);
      validate(defs.typeParameters, node, "typeParameters", typeParameters, 1);
      return node;
    }
    function tsAsExpression(expression, typeAnnotation2) {
      const node = {
        type: "TSAsExpression",
        expression,
        typeAnnotation: typeAnnotation2
      };
      const defs = NODE_FIELDS.TSAsExpression;
      validate(defs.expression, node, "expression", expression, 1);
      validate(defs.typeAnnotation, node, "typeAnnotation", typeAnnotation2, 1);
      return node;
    }
    function tsSatisfiesExpression(expression, typeAnnotation2) {
      const node = {
        type: "TSSatisfiesExpression",
        expression,
        typeAnnotation: typeAnnotation2
      };
      const defs = NODE_FIELDS.TSSatisfiesExpression;
      validate(defs.expression, node, "expression", expression, 1);
      validate(defs.typeAnnotation, node, "typeAnnotation", typeAnnotation2, 1);
      return node;
    }
    function tsTypeAssertion(typeAnnotation2, expression) {
      const node = {
        type: "TSTypeAssertion",
        typeAnnotation: typeAnnotation2,
        expression
      };
      const defs = NODE_FIELDS.TSTypeAssertion;
      validate(defs.typeAnnotation, node, "typeAnnotation", typeAnnotation2, 1);
      validate(defs.expression, node, "expression", expression, 1);
      return node;
    }
    function tsEnumBody(members) {
      const node = {
        type: "TSEnumBody",
        members
      };
      const defs = NODE_FIELDS.TSEnumBody;
      validate(defs.members, node, "members", members, 1);
      return node;
    }
    function tsEnumDeclaration(id, members) {
      const node = {
        type: "TSEnumDeclaration",
        id,
        members
      };
      const defs = NODE_FIELDS.TSEnumDeclaration;
      validate(defs.id, node, "id", id, 1);
      validate(defs.members, node, "members", members, 1);
      return node;
    }
    function tsEnumMember(id, initializer = null) {
      const node = {
        type: "TSEnumMember",
        id,
        initializer
      };
      const defs = NODE_FIELDS.TSEnumMember;
      validate(defs.id, node, "id", id, 1);
      validate(defs.initializer, node, "initializer", initializer, 1);
      return node;
    }
    function tsModuleDeclaration(id, body) {
      const node = {
        type: "TSModuleDeclaration",
        id,
        body,
        kind: null
      };
      const defs = NODE_FIELDS.TSModuleDeclaration;
      validate(defs.id, node, "id", id, 1);
      validate(defs.body, node, "body", body, 1);
      return node;
    }
    function tsModuleBlock(body) {
      const node = {
        type: "TSModuleBlock",
        body
      };
      const defs = NODE_FIELDS.TSModuleBlock;
      validate(defs.body, node, "body", body, 1);
      return node;
    }
    function tsImportType(argument, qualifier = null, typeParameters = null) {
      const node = {
        type: "TSImportType",
        argument,
        qualifier,
        typeParameters
      };
      const defs = NODE_FIELDS.TSImportType;
      validate(defs.argument, node, "argument", argument, 1);
      validate(defs.qualifier, node, "qualifier", qualifier, 1);
      validate(defs.typeParameters, node, "typeParameters", typeParameters, 1);
      return node;
    }
    function tsImportEqualsDeclaration(id, moduleReference) {
      const node = {
        type: "TSImportEqualsDeclaration",
        id,
        moduleReference,
        isExport: null
      };
      const defs = NODE_FIELDS.TSImportEqualsDeclaration;
      validate(defs.id, node, "id", id, 1);
      validate(defs.moduleReference, node, "moduleReference", moduleReference, 1);
      return node;
    }
    function tsExternalModuleReference(expression) {
      const node = {
        type: "TSExternalModuleReference",
        expression
      };
      const defs = NODE_FIELDS.TSExternalModuleReference;
      validate(defs.expression, node, "expression", expression, 1);
      return node;
    }
    function tsNonNullExpression(expression) {
      const node = {
        type: "TSNonNullExpression",
        expression
      };
      const defs = NODE_FIELDS.TSNonNullExpression;
      validate(defs.expression, node, "expression", expression, 1);
      return node;
    }
    function tsExportAssignment(expression) {
      const node = {
        type: "TSExportAssignment",
        expression
      };
      const defs = NODE_FIELDS.TSExportAssignment;
      validate(defs.expression, node, "expression", expression, 1);
      return node;
    }
    function tsNamespaceExportDeclaration(id) {
      const node = {
        type: "TSNamespaceExportDeclaration",
        id
      };
      const defs = NODE_FIELDS.TSNamespaceExportDeclaration;
      validate(defs.id, node, "id", id, 1);
      return node;
    }
    function tsTypeAnnotation(typeAnnotation2) {
      const node = {
        type: "TSTypeAnnotation",
        typeAnnotation: typeAnnotation2
      };
      const defs = NODE_FIELDS.TSTypeAnnotation;
      validate(defs.typeAnnotation, node, "typeAnnotation", typeAnnotation2, 1);
      return node;
    }
    function tsTypeParameterInstantiation(params) {
      const node = {
        type: "TSTypeParameterInstantiation",
        params
      };
      const defs = NODE_FIELDS.TSTypeParameterInstantiation;
      validate(defs.params, node, "params", params, 1);
      return node;
    }
    function tsTypeParameterDeclaration(params) {
      const node = {
        type: "TSTypeParameterDeclaration",
        params
      };
      const defs = NODE_FIELDS.TSTypeParameterDeclaration;
      validate(defs.params, node, "params", params, 1);
      return node;
    }
    function tsTypeParameter(constraint = null, _default = null, name) {
      const node = {
        type: "TSTypeParameter",
        constraint,
        default: _default,
        name
      };
      const defs = NODE_FIELDS.TSTypeParameter;
      validate(defs.constraint, node, "constraint", constraint, 1);
      validate(defs.default, node, "default", _default, 1);
      validate(defs.name, node, "name", name);
      return node;
    }
    function NumberLiteral(value2) {
      (0, _deprecationWarning.default)("NumberLiteral", "NumericLiteral", "The node type ");
      return numericLiteral(value2);
    }
    function RegexLiteral(pattern, flags = "") {
      (0, _deprecationWarning.default)("RegexLiteral", "RegExpLiteral", "The node type ");
      return regExpLiteral(pattern, flags);
    }
    function RestProperty(argument) {
      (0, _deprecationWarning.default)("RestProperty", "RestElement", "The node type ");
      return restElement(argument);
    }
    function SpreadProperty(argument) {
      (0, _deprecationWarning.default)("SpreadProperty", "SpreadElement", "The node type ");
      return spreadElement(argument);
    }
  }
});

// node_modules/@babel/types/lib/builders/generated/uppercase.js
var require_uppercase = __commonJS({
  "node_modules/@babel/types/lib/builders/generated/uppercase.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.JSXIdentifier = exports2.JSXFragment = exports2.JSXExpressionContainer = exports2.JSXEmptyExpression = exports2.JSXElement = exports2.JSXClosingFragment = exports2.JSXClosingElement = exports2.JSXAttribute = exports2.IntersectionTypeAnnotation = exports2.InterpreterDirective = exports2.InterfaceTypeAnnotation = exports2.InterfaceExtends = exports2.InterfaceDeclaration = exports2.InferredPredicate = exports2.IndexedAccessType = exports2.ImportSpecifier = exports2.ImportNamespaceSpecifier = exports2.ImportExpression = exports2.ImportDefaultSpecifier = exports2.ImportDeclaration = exports2.ImportAttribute = exports2.Import = exports2.IfStatement = exports2.Identifier = exports2.GenericTypeAnnotation = exports2.FunctionTypeParam = exports2.FunctionTypeAnnotation = exports2.FunctionExpression = exports2.FunctionDeclaration = exports2.ForStatement = exports2.ForOfStatement = exports2.ForInStatement = exports2.File = exports2.ExpressionStatement = exports2.ExportSpecifier = exports2.ExportNamespaceSpecifier = exports2.ExportNamedDeclaration = exports2.ExportDefaultSpecifier = exports2.ExportDefaultDeclaration = exports2.ExportAllDeclaration = exports2.ExistsTypeAnnotation = exports2.EnumSymbolBody = exports2.EnumStringMember = exports2.EnumStringBody = exports2.EnumNumberMember = exports2.EnumNumberBody = exports2.EnumDefaultedMember = exports2.EnumDeclaration = exports2.EnumBooleanMember = exports2.EnumBooleanBody = exports2.EmptyTypeAnnotation = exports2.EmptyStatement = exports2.DoWhileStatement = exports2.DoExpression = exports2.DirectiveLiteral = exports2.Directive = exports2.Decorator = exports2.DeclaredPredicate = exports2.DeclareVariable = exports2.DeclareTypeAlias = exports2.DeclareOpaqueType = exports2.DeclareModuleExports = exports2.DeclareModule = exports2.DeclareInterface = exports2.DeclareFunction = exports2.DeclareExportDeclaration = exports2.DeclareExportAllDeclaration = exports2.DeclareClass = exports2.DecimalLiteral = exports2.DebuggerStatement = exports2.ContinueStatement = exports2.ConditionalExpression = exports2.ClassProperty = exports2.ClassPrivateProperty = exports2.ClassPrivateMethod = exports2.ClassMethod = exports2.ClassImplements = exports2.ClassExpression = exports2.ClassDeclaration = exports2.ClassBody = exports2.ClassAccessorProperty = exports2.CatchClause = exports2.CallExpression = exports2.BreakStatement = exports2.BooleanTypeAnnotation = exports2.BooleanLiteralTypeAnnotation = exports2.BooleanLiteral = exports2.BlockStatement = exports2.BindExpression = exports2.BinaryExpression = exports2.BigIntLiteral = exports2.AwaitExpression = exports2.AssignmentPattern = exports2.AssignmentExpression = exports2.ArrowFunctionExpression = exports2.ArrayTypeAnnotation = exports2.ArrayPattern = exports2.ArrayExpression = exports2.ArgumentPlaceholder = exports2.AnyTypeAnnotation = void 0;
    exports2.TSNumberKeyword = exports2.TSNullKeyword = exports2.TSNonNullExpression = exports2.TSNeverKeyword = exports2.TSNamespaceExportDeclaration = exports2.TSNamedTupleMember = exports2.TSModuleDeclaration = exports2.TSModuleBlock = exports2.TSMethodSignature = exports2.TSMappedType = exports2.TSLiteralType = exports2.TSIntrinsicKeyword = exports2.TSIntersectionType = exports2.TSInterfaceDeclaration = exports2.TSInterfaceBody = exports2.TSInstantiationExpression = exports2.TSInferType = exports2.TSIndexedAccessType = exports2.TSIndexSignature = exports2.TSImportType = exports2.TSImportEqualsDeclaration = exports2.TSFunctionType = exports2.TSExternalModuleReference = exports2.TSExpressionWithTypeArguments = exports2.TSExportAssignment = exports2.TSEnumMember = exports2.TSEnumDeclaration = exports2.TSEnumBody = exports2.TSDeclareMethod = exports2.TSDeclareFunction = exports2.TSConstructorType = exports2.TSConstructSignatureDeclaration = exports2.TSConditionalType = exports2.TSCallSignatureDeclaration = exports2.TSBooleanKeyword = exports2.TSBigIntKeyword = exports2.TSAsExpression = exports2.TSArrayType = exports2.TSAnyKeyword = exports2.SymbolTypeAnnotation = exports2.SwitchStatement = exports2.SwitchCase = exports2.Super = exports2.StringTypeAnnotation = exports2.StringLiteralTypeAnnotation = exports2.StringLiteral = exports2.StaticBlock = exports2.SpreadProperty = exports2.SpreadElement = exports2.SequenceExpression = exports2.ReturnStatement = exports2.RestProperty = exports2.RestElement = exports2.RegexLiteral = exports2.RegExpLiteral = exports2.RecordExpression = exports2.QualifiedTypeIdentifier = exports2.Program = exports2.PrivateName = exports2.Placeholder = exports2.PipelineTopicExpression = exports2.PipelinePrimaryTopicReference = exports2.PipelineBareFunction = exports2.ParenthesizedExpression = exports2.OptionalMemberExpression = exports2.OptionalIndexedAccessType = exports2.OptionalCallExpression = exports2.OpaqueType = exports2.ObjectTypeSpreadProperty = exports2.ObjectTypeProperty = exports2.ObjectTypeInternalSlot = exports2.ObjectTypeIndexer = exports2.ObjectTypeCallProperty = exports2.ObjectTypeAnnotation = exports2.ObjectProperty = exports2.ObjectPattern = exports2.ObjectMethod = exports2.ObjectExpression = exports2.NumericLiteral = exports2.NumberTypeAnnotation = exports2.NumberLiteralTypeAnnotation = exports2.NumberLiteral = exports2.NullableTypeAnnotation = exports2.NullLiteralTypeAnnotation = exports2.NullLiteral = exports2.Noop = exports2.NewExpression = exports2.ModuleExpression = exports2.MixedTypeAnnotation = exports2.MetaProperty = exports2.MemberExpression = exports2.LogicalExpression = exports2.LabeledStatement = exports2.JSXText = exports2.JSXSpreadChild = exports2.JSXSpreadAttribute = exports2.JSXOpeningFragment = exports2.JSXOpeningElement = exports2.JSXNamespacedName = exports2.JSXMemberExpression = void 0;
    exports2.YieldExpression = exports2.WithStatement = exports2.WhileStatement = exports2.VoidTypeAnnotation = exports2.VoidPattern = exports2.Variance = exports2.VariableDeclarator = exports2.VariableDeclaration = exports2.V8IntrinsicIdentifier = exports2.UpdateExpression = exports2.UnionTypeAnnotation = exports2.UnaryExpression = exports2.TypeofTypeAnnotation = exports2.TypeParameterInstantiation = exports2.TypeParameterDeclaration = exports2.TypeParameter = exports2.TypeCastExpression = exports2.TypeAnnotation = exports2.TypeAlias = exports2.TupleTypeAnnotation = exports2.TupleExpression = exports2.TryStatement = exports2.TopicReference = exports2.ThrowStatement = exports2.ThisTypeAnnotation = exports2.ThisExpression = exports2.TemplateLiteral = exports2.TemplateElement = exports2.TaggedTemplateExpression = exports2.TSVoidKeyword = exports2.TSUnknownKeyword = exports2.TSUnionType = exports2.TSUndefinedKeyword = exports2.TSTypeReference = exports2.TSTypeQuery = exports2.TSTypePredicate = exports2.TSTypeParameterInstantiation = exports2.TSTypeParameterDeclaration = exports2.TSTypeParameter = exports2.TSTypeOperator = exports2.TSTypeLiteral = exports2.TSTypeAssertion = exports2.TSTypeAnnotation = exports2.TSTypeAliasDeclaration = exports2.TSTupleType = exports2.TSThisType = exports2.TSTemplateLiteralType = exports2.TSSymbolKeyword = exports2.TSStringKeyword = exports2.TSSatisfiesExpression = exports2.TSRestType = exports2.TSQualifiedName = exports2.TSPropertySignature = exports2.TSParenthesizedType = exports2.TSParameterProperty = exports2.TSOptionalType = exports2.TSObjectKeyword = void 0;
    var b = require_lowercase();
    var _deprecationWarning = require_deprecationWarning();
    function alias(lowercase) {
      return b[lowercase];
    }
    var ArrayExpression = exports2.ArrayExpression = alias("arrayExpression");
    var AssignmentExpression = exports2.AssignmentExpression = alias("assignmentExpression");
    var BinaryExpression = exports2.BinaryExpression = alias("binaryExpression");
    var InterpreterDirective = exports2.InterpreterDirective = alias("interpreterDirective");
    var Directive = exports2.Directive = alias("directive");
    var DirectiveLiteral = exports2.DirectiveLiteral = alias("directiveLiteral");
    var BlockStatement = exports2.BlockStatement = alias("blockStatement");
    var BreakStatement = exports2.BreakStatement = alias("breakStatement");
    var CallExpression = exports2.CallExpression = alias("callExpression");
    var CatchClause = exports2.CatchClause = alias("catchClause");
    var ConditionalExpression = exports2.ConditionalExpression = alias("conditionalExpression");
    var ContinueStatement = exports2.ContinueStatement = alias("continueStatement");
    var DebuggerStatement = exports2.DebuggerStatement = alias("debuggerStatement");
    var DoWhileStatement = exports2.DoWhileStatement = alias("doWhileStatement");
    var EmptyStatement = exports2.EmptyStatement = alias("emptyStatement");
    var ExpressionStatement = exports2.ExpressionStatement = alias("expressionStatement");
    var File = exports2.File = alias("file");
    var ForInStatement = exports2.ForInStatement = alias("forInStatement");
    var ForStatement = exports2.ForStatement = alias("forStatement");
    var FunctionDeclaration = exports2.FunctionDeclaration = alias("functionDeclaration");
    var FunctionExpression = exports2.FunctionExpression = alias("functionExpression");
    var Identifier = exports2.Identifier = alias("identifier");
    var IfStatement = exports2.IfStatement = alias("ifStatement");
    var LabeledStatement = exports2.LabeledStatement = alias("labeledStatement");
    var StringLiteral = exports2.StringLiteral = alias("stringLiteral");
    var NumericLiteral = exports2.NumericLiteral = alias("numericLiteral");
    var NullLiteral = exports2.NullLiteral = alias("nullLiteral");
    var BooleanLiteral = exports2.BooleanLiteral = alias("booleanLiteral");
    var RegExpLiteral = exports2.RegExpLiteral = alias("regExpLiteral");
    var LogicalExpression = exports2.LogicalExpression = alias("logicalExpression");
    var MemberExpression = exports2.MemberExpression = alias("memberExpression");
    var NewExpression = exports2.NewExpression = alias("newExpression");
    var Program = exports2.Program = alias("program");
    var ObjectExpression = exports2.ObjectExpression = alias("objectExpression");
    var ObjectMethod = exports2.ObjectMethod = alias("objectMethod");
    var ObjectProperty = exports2.ObjectProperty = alias("objectProperty");
    var RestElement = exports2.RestElement = alias("restElement");
    var ReturnStatement = exports2.ReturnStatement = alias("returnStatement");
    var SequenceExpression = exports2.SequenceExpression = alias("sequenceExpression");
    var ParenthesizedExpression = exports2.ParenthesizedExpression = alias("parenthesizedExpression");
    var SwitchCase = exports2.SwitchCase = alias("switchCase");
    var SwitchStatement = exports2.SwitchStatement = alias("switchStatement");
    var ThisExpression = exports2.ThisExpression = alias("thisExpression");
    var ThrowStatement = exports2.ThrowStatement = alias("throwStatement");
    var TryStatement = exports2.TryStatement = alias("tryStatement");
    var UnaryExpression = exports2.UnaryExpression = alias("unaryExpression");
    var UpdateExpression = exports2.UpdateExpression = alias("updateExpression");
    var VariableDeclaration = exports2.VariableDeclaration = alias("variableDeclaration");
    var VariableDeclarator = exports2.VariableDeclarator = alias("variableDeclarator");
    var WhileStatement = exports2.WhileStatement = alias("whileStatement");
    var WithStatement = exports2.WithStatement = alias("withStatement");
    var AssignmentPattern = exports2.AssignmentPattern = alias("assignmentPattern");
    var ArrayPattern = exports2.ArrayPattern = alias("arrayPattern");
    var ArrowFunctionExpression = exports2.ArrowFunctionExpression = alias("arrowFunctionExpression");
    var ClassBody = exports2.ClassBody = alias("classBody");
    var ClassExpression = exports2.ClassExpression = alias("classExpression");
    var ClassDeclaration = exports2.ClassDeclaration = alias("classDeclaration");
    var ExportAllDeclaration = exports2.ExportAllDeclaration = alias("exportAllDeclaration");
    var ExportDefaultDeclaration = exports2.ExportDefaultDeclaration = alias("exportDefaultDeclaration");
    var ExportNamedDeclaration = exports2.ExportNamedDeclaration = alias("exportNamedDeclaration");
    var ExportSpecifier = exports2.ExportSpecifier = alias("exportSpecifier");
    var ForOfStatement = exports2.ForOfStatement = alias("forOfStatement");
    var ImportDeclaration = exports2.ImportDeclaration = alias("importDeclaration");
    var ImportDefaultSpecifier = exports2.ImportDefaultSpecifier = alias("importDefaultSpecifier");
    var ImportNamespaceSpecifier = exports2.ImportNamespaceSpecifier = alias("importNamespaceSpecifier");
    var ImportSpecifier = exports2.ImportSpecifier = alias("importSpecifier");
    var ImportExpression = exports2.ImportExpression = alias("importExpression");
    var MetaProperty = exports2.MetaProperty = alias("metaProperty");
    var ClassMethod = exports2.ClassMethod = alias("classMethod");
    var ObjectPattern = exports2.ObjectPattern = alias("objectPattern");
    var SpreadElement = exports2.SpreadElement = alias("spreadElement");
    var Super = exports2.Super = alias("super");
    var TaggedTemplateExpression = exports2.TaggedTemplateExpression = alias("taggedTemplateExpression");
    var TemplateElement = exports2.TemplateElement = alias("templateElement");
    var TemplateLiteral = exports2.TemplateLiteral = alias("templateLiteral");
    var YieldExpression = exports2.YieldExpression = alias("yieldExpression");
    var AwaitExpression = exports2.AwaitExpression = alias("awaitExpression");
    var Import = exports2.Import = alias("import");
    var BigIntLiteral = exports2.BigIntLiteral = alias("bigIntLiteral");
    var ExportNamespaceSpecifier = exports2.ExportNamespaceSpecifier = alias("exportNamespaceSpecifier");
    var OptionalMemberExpression = exports2.OptionalMemberExpression = alias("optionalMemberExpression");
    var OptionalCallExpression = exports2.OptionalCallExpression = alias("optionalCallExpression");
    var ClassProperty = exports2.ClassProperty = alias("classProperty");
    var ClassAccessorProperty = exports2.ClassAccessorProperty = alias("classAccessorProperty");
    var ClassPrivateProperty = exports2.ClassPrivateProperty = alias("classPrivateProperty");
    var ClassPrivateMethod = exports2.ClassPrivateMethod = alias("classPrivateMethod");
    var PrivateName = exports2.PrivateName = alias("privateName");
    var StaticBlock = exports2.StaticBlock = alias("staticBlock");
    var ImportAttribute = exports2.ImportAttribute = alias("importAttribute");
    var AnyTypeAnnotation = exports2.AnyTypeAnnotation = alias("anyTypeAnnotation");
    var ArrayTypeAnnotation = exports2.ArrayTypeAnnotation = alias("arrayTypeAnnotation");
    var BooleanTypeAnnotation = exports2.BooleanTypeAnnotation = alias("booleanTypeAnnotation");
    var BooleanLiteralTypeAnnotation = exports2.BooleanLiteralTypeAnnotation = alias("booleanLiteralTypeAnnotation");
    var NullLiteralTypeAnnotation = exports2.NullLiteralTypeAnnotation = alias("nullLiteralTypeAnnotation");
    var ClassImplements = exports2.ClassImplements = alias("classImplements");
    var DeclareClass = exports2.DeclareClass = alias("declareClass");
    var DeclareFunction = exports2.DeclareFunction = alias("declareFunction");
    var DeclareInterface = exports2.DeclareInterface = alias("declareInterface");
    var DeclareModule = exports2.DeclareModule = alias("declareModule");
    var DeclareModuleExports = exports2.DeclareModuleExports = alias("declareModuleExports");
    var DeclareTypeAlias = exports2.DeclareTypeAlias = alias("declareTypeAlias");
    var DeclareOpaqueType = exports2.DeclareOpaqueType = alias("declareOpaqueType");
    var DeclareVariable = exports2.DeclareVariable = alias("declareVariable");
    var DeclareExportDeclaration = exports2.DeclareExportDeclaration = alias("declareExportDeclaration");
    var DeclareExportAllDeclaration = exports2.DeclareExportAllDeclaration = alias("declareExportAllDeclaration");
    var DeclaredPredicate = exports2.DeclaredPredicate = alias("declaredPredicate");
    var ExistsTypeAnnotation = exports2.ExistsTypeAnnotation = alias("existsTypeAnnotation");
    var FunctionTypeAnnotation = exports2.FunctionTypeAnnotation = alias("functionTypeAnnotation");
    var FunctionTypeParam = exports2.FunctionTypeParam = alias("functionTypeParam");
    var GenericTypeAnnotation = exports2.GenericTypeAnnotation = alias("genericTypeAnnotation");
    var InferredPredicate = exports2.InferredPredicate = alias("inferredPredicate");
    var InterfaceExtends = exports2.InterfaceExtends = alias("interfaceExtends");
    var InterfaceDeclaration = exports2.InterfaceDeclaration = alias("interfaceDeclaration");
    var InterfaceTypeAnnotation = exports2.InterfaceTypeAnnotation = alias("interfaceTypeAnnotation");
    var IntersectionTypeAnnotation = exports2.IntersectionTypeAnnotation = alias("intersectionTypeAnnotation");
    var MixedTypeAnnotation = exports2.MixedTypeAnnotation = alias("mixedTypeAnnotation");
    var EmptyTypeAnnotation = exports2.EmptyTypeAnnotation = alias("emptyTypeAnnotation");
    var NullableTypeAnnotation = exports2.NullableTypeAnnotation = alias("nullableTypeAnnotation");
    var NumberLiteralTypeAnnotation = exports2.NumberLiteralTypeAnnotation = alias("numberLiteralTypeAnnotation");
    var NumberTypeAnnotation = exports2.NumberTypeAnnotation = alias("numberTypeAnnotation");
    var ObjectTypeAnnotation = exports2.ObjectTypeAnnotation = alias("objectTypeAnnotation");
    var ObjectTypeInternalSlot = exports2.ObjectTypeInternalSlot = alias("objectTypeInternalSlot");
    var ObjectTypeCallProperty = exports2.ObjectTypeCallProperty = alias("objectTypeCallProperty");
    var ObjectTypeIndexer = exports2.ObjectTypeIndexer = alias("objectTypeIndexer");
    var ObjectTypeProperty = exports2.ObjectTypeProperty = alias("objectTypeProperty");
    var ObjectTypeSpreadProperty = exports2.ObjectTypeSpreadProperty = alias("objectTypeSpreadProperty");
    var OpaqueType = exports2.OpaqueType = alias("opaqueType");
    var QualifiedTypeIdentifier = exports2.QualifiedTypeIdentifier = alias("qualifiedTypeIdentifier");
    var StringLiteralTypeAnnotation = exports2.StringLiteralTypeAnnotation = alias("stringLiteralTypeAnnotation");
    var StringTypeAnnotation = exports2.StringTypeAnnotation = alias("stringTypeAnnotation");
    var SymbolTypeAnnotation = exports2.SymbolTypeAnnotation = alias("symbolTypeAnnotation");
    var ThisTypeAnnotation = exports2.ThisTypeAnnotation = alias("thisTypeAnnotation");
    var TupleTypeAnnotation = exports2.TupleTypeAnnotation = alias("tupleTypeAnnotation");
    var TypeofTypeAnnotation = exports2.TypeofTypeAnnotation = alias("typeofTypeAnnotation");
    var TypeAlias = exports2.TypeAlias = alias("typeAlias");
    var TypeAnnotation = exports2.TypeAnnotation = alias("typeAnnotation");
    var TypeCastExpression = exports2.TypeCastExpression = alias("typeCastExpression");
    var TypeParameter = exports2.TypeParameter = alias("typeParameter");
    var TypeParameterDeclaration = exports2.TypeParameterDeclaration = alias("typeParameterDeclaration");
    var TypeParameterInstantiation = exports2.TypeParameterInstantiation = alias("typeParameterInstantiation");
    var UnionTypeAnnotation = exports2.UnionTypeAnnotation = alias("unionTypeAnnotation");
    var Variance = exports2.Variance = alias("variance");
    var VoidTypeAnnotation = exports2.VoidTypeAnnotation = alias("voidTypeAnnotation");
    var EnumDeclaration = exports2.EnumDeclaration = alias("enumDeclaration");
    var EnumBooleanBody = exports2.EnumBooleanBody = alias("enumBooleanBody");
    var EnumNumberBody = exports2.EnumNumberBody = alias("enumNumberBody");
    var EnumStringBody = exports2.EnumStringBody = alias("enumStringBody");
    var EnumSymbolBody = exports2.EnumSymbolBody = alias("enumSymbolBody");
    var EnumBooleanMember = exports2.EnumBooleanMember = alias("enumBooleanMember");
    var EnumNumberMember = exports2.EnumNumberMember = alias("enumNumberMember");
    var EnumStringMember = exports2.EnumStringMember = alias("enumStringMember");
    var EnumDefaultedMember = exports2.EnumDefaultedMember = alias("enumDefaultedMember");
    var IndexedAccessType = exports2.IndexedAccessType = alias("indexedAccessType");
    var OptionalIndexedAccessType = exports2.OptionalIndexedAccessType = alias("optionalIndexedAccessType");
    var JSXAttribute = exports2.JSXAttribute = alias("jsxAttribute");
    var JSXClosingElement = exports2.JSXClosingElement = alias("jsxClosingElement");
    var JSXElement = exports2.JSXElement = alias("jsxElement");
    var JSXEmptyExpression = exports2.JSXEmptyExpression = alias("jsxEmptyExpression");
    var JSXExpressionContainer = exports2.JSXExpressionContainer = alias("jsxExpressionContainer");
    var JSXSpreadChild = exports2.JSXSpreadChild = alias("jsxSpreadChild");
    var JSXIdentifier = exports2.JSXIdentifier = alias("jsxIdentifier");
    var JSXMemberExpression = exports2.JSXMemberExpression = alias("jsxMemberExpression");
    var JSXNamespacedName = exports2.JSXNamespacedName = alias("jsxNamespacedName");
    var JSXOpeningElement = exports2.JSXOpeningElement = alias("jsxOpeningElement");
    var JSXSpreadAttribute = exports2.JSXSpreadAttribute = alias("jsxSpreadAttribute");
    var JSXText = exports2.JSXText = alias("jsxText");
    var JSXFragment = exports2.JSXFragment = alias("jsxFragment");
    var JSXOpeningFragment = exports2.JSXOpeningFragment = alias("jsxOpeningFragment");
    var JSXClosingFragment = exports2.JSXClosingFragment = alias("jsxClosingFragment");
    var Noop = exports2.Noop = alias("noop");
    var Placeholder = exports2.Placeholder = alias("placeholder");
    var V8IntrinsicIdentifier = exports2.V8IntrinsicIdentifier = alias("v8IntrinsicIdentifier");
    var ArgumentPlaceholder = exports2.ArgumentPlaceholder = alias("argumentPlaceholder");
    var BindExpression = exports2.BindExpression = alias("bindExpression");
    var Decorator = exports2.Decorator = alias("decorator");
    var DoExpression = exports2.DoExpression = alias("doExpression");
    var ExportDefaultSpecifier = exports2.ExportDefaultSpecifier = alias("exportDefaultSpecifier");
    var RecordExpression = exports2.RecordExpression = alias("recordExpression");
    var TupleExpression = exports2.TupleExpression = alias("tupleExpression");
    var DecimalLiteral = exports2.DecimalLiteral = alias("decimalLiteral");
    var ModuleExpression = exports2.ModuleExpression = alias("moduleExpression");
    var TopicReference = exports2.TopicReference = alias("topicReference");
    var PipelineTopicExpression = exports2.PipelineTopicExpression = alias("pipelineTopicExpression");
    var PipelineBareFunction = exports2.PipelineBareFunction = alias("pipelineBareFunction");
    var PipelinePrimaryTopicReference = exports2.PipelinePrimaryTopicReference = alias("pipelinePrimaryTopicReference");
    var VoidPattern = exports2.VoidPattern = alias("voidPattern");
    var TSParameterProperty = exports2.TSParameterProperty = alias("tsParameterProperty");
    var TSDeclareFunction = exports2.TSDeclareFunction = alias("tsDeclareFunction");
    var TSDeclareMethod = exports2.TSDeclareMethod = alias("tsDeclareMethod");
    var TSQualifiedName = exports2.TSQualifiedName = alias("tsQualifiedName");
    var TSCallSignatureDeclaration = exports2.TSCallSignatureDeclaration = alias("tsCallSignatureDeclaration");
    var TSConstructSignatureDeclaration = exports2.TSConstructSignatureDeclaration = alias("tsConstructSignatureDeclaration");
    var TSPropertySignature = exports2.TSPropertySignature = alias("tsPropertySignature");
    var TSMethodSignature = exports2.TSMethodSignature = alias("tsMethodSignature");
    var TSIndexSignature = exports2.TSIndexSignature = alias("tsIndexSignature");
    var TSAnyKeyword = exports2.TSAnyKeyword = alias("tsAnyKeyword");
    var TSBooleanKeyword = exports2.TSBooleanKeyword = alias("tsBooleanKeyword");
    var TSBigIntKeyword = exports2.TSBigIntKeyword = alias("tsBigIntKeyword");
    var TSIntrinsicKeyword = exports2.TSIntrinsicKeyword = alias("tsIntrinsicKeyword");
    var TSNeverKeyword = exports2.TSNeverKeyword = alias("tsNeverKeyword");
    var TSNullKeyword = exports2.TSNullKeyword = alias("tsNullKeyword");
    var TSNumberKeyword = exports2.TSNumberKeyword = alias("tsNumberKeyword");
    var TSObjectKeyword = exports2.TSObjectKeyword = alias("tsObjectKeyword");
    var TSStringKeyword = exports2.TSStringKeyword = alias("tsStringKeyword");
    var TSSymbolKeyword = exports2.TSSymbolKeyword = alias("tsSymbolKeyword");
    var TSUndefinedKeyword = exports2.TSUndefinedKeyword = alias("tsUndefinedKeyword");
    var TSUnknownKeyword = exports2.TSUnknownKeyword = alias("tsUnknownKeyword");
    var TSVoidKeyword = exports2.TSVoidKeyword = alias("tsVoidKeyword");
    var TSThisType = exports2.TSThisType = alias("tsThisType");
    var TSFunctionType = exports2.TSFunctionType = alias("tsFunctionType");
    var TSConstructorType = exports2.TSConstructorType = alias("tsConstructorType");
    var TSTypeReference = exports2.TSTypeReference = alias("tsTypeReference");
    var TSTypePredicate = exports2.TSTypePredicate = alias("tsTypePredicate");
    var TSTypeQuery = exports2.TSTypeQuery = alias("tsTypeQuery");
    var TSTypeLiteral = exports2.TSTypeLiteral = alias("tsTypeLiteral");
    var TSArrayType = exports2.TSArrayType = alias("tsArrayType");
    var TSTupleType = exports2.TSTupleType = alias("tsTupleType");
    var TSOptionalType = exports2.TSOptionalType = alias("tsOptionalType");
    var TSRestType = exports2.TSRestType = alias("tsRestType");
    var TSNamedTupleMember = exports2.TSNamedTupleMember = alias("tsNamedTupleMember");
    var TSUnionType = exports2.TSUnionType = alias("tsUnionType");
    var TSIntersectionType = exports2.TSIntersectionType = alias("tsIntersectionType");
    var TSConditionalType = exports2.TSConditionalType = alias("tsConditionalType");
    var TSInferType = exports2.TSInferType = alias("tsInferType");
    var TSParenthesizedType = exports2.TSParenthesizedType = alias("tsParenthesizedType");
    var TSTypeOperator = exports2.TSTypeOperator = alias("tsTypeOperator");
    var TSIndexedAccessType = exports2.TSIndexedAccessType = alias("tsIndexedAccessType");
    var TSMappedType = exports2.TSMappedType = alias("tsMappedType");
    var TSTemplateLiteralType = exports2.TSTemplateLiteralType = alias("tsTemplateLiteralType");
    var TSLiteralType = exports2.TSLiteralType = alias("tsLiteralType");
    var TSExpressionWithTypeArguments = exports2.TSExpressionWithTypeArguments = alias("tsExpressionWithTypeArguments");
    var TSInterfaceDeclaration = exports2.TSInterfaceDeclaration = alias("tsInterfaceDeclaration");
    var TSInterfaceBody = exports2.TSInterfaceBody = alias("tsInterfaceBody");
    var TSTypeAliasDeclaration = exports2.TSTypeAliasDeclaration = alias("tsTypeAliasDeclaration");
    var TSInstantiationExpression = exports2.TSInstantiationExpression = alias("tsInstantiationExpression");
    var TSAsExpression = exports2.TSAsExpression = alias("tsAsExpression");
    var TSSatisfiesExpression = exports2.TSSatisfiesExpression = alias("tsSatisfiesExpression");
    var TSTypeAssertion = exports2.TSTypeAssertion = alias("tsTypeAssertion");
    var TSEnumBody = exports2.TSEnumBody = alias("tsEnumBody");
    var TSEnumDeclaration = exports2.TSEnumDeclaration = alias("tsEnumDeclaration");
    var TSEnumMember = exports2.TSEnumMember = alias("tsEnumMember");
    var TSModuleDeclaration = exports2.TSModuleDeclaration = alias("tsModuleDeclaration");
    var TSModuleBlock = exports2.TSModuleBlock = alias("tsModuleBlock");
    var TSImportType = exports2.TSImportType = alias("tsImportType");
    var TSImportEqualsDeclaration = exports2.TSImportEqualsDeclaration = alias("tsImportEqualsDeclaration");
    var TSExternalModuleReference = exports2.TSExternalModuleReference = alias("tsExternalModuleReference");
    var TSNonNullExpression = exports2.TSNonNullExpression = alias("tsNonNullExpression");
    var TSExportAssignment = exports2.TSExportAssignment = alias("tsExportAssignment");
    var TSNamespaceExportDeclaration = exports2.TSNamespaceExportDeclaration = alias("tsNamespaceExportDeclaration");
    var TSTypeAnnotation = exports2.TSTypeAnnotation = alias("tsTypeAnnotation");
    var TSTypeParameterInstantiation = exports2.TSTypeParameterInstantiation = alias("tsTypeParameterInstantiation");
    var TSTypeParameterDeclaration = exports2.TSTypeParameterDeclaration = alias("tsTypeParameterDeclaration");
    var TSTypeParameter = exports2.TSTypeParameter = alias("tsTypeParameter");
    var NumberLiteral = exports2.NumberLiteral = b.numberLiteral;
    var RegexLiteral = exports2.RegexLiteral = b.regexLiteral;
    var RestProperty = exports2.RestProperty = b.restProperty;
    var SpreadProperty = exports2.SpreadProperty = b.spreadProperty;
  }
});

// node_modules/@babel/types/lib/builders/generated/index.js
var require_generated2 = __commonJS({
  "node_modules/@babel/types/lib/builders/generated/index.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    var _lowercase = require_lowercase();
    Object.keys(_lowercase).forEach(function(key) {
      if (key === "default" || key === "__esModule") return;
      if (key in exports2 && exports2[key] === _lowercase[key]) return;
      Object.defineProperty(exports2, key, {
        enumerable: true,
        get: function() {
          return _lowercase[key];
        }
      });
    });
    var _uppercase = require_uppercase();
    Object.keys(_uppercase).forEach(function(key) {
      if (key === "default" || key === "__esModule") return;
      if (key in exports2 && exports2[key] === _uppercase[key]) return;
      Object.defineProperty(exports2, key, {
        enumerable: true,
        get: function() {
          return _uppercase[key];
        }
      });
    });
  }
});

// node_modules/@babel/types/lib/utils/react/cleanJSXElementLiteralChild.js
var require_cleanJSXElementLiteralChild = __commonJS({
  "node_modules/@babel/types/lib/utils/react/cleanJSXElementLiteralChild.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = cleanJSXElementLiteralChild;
    var _index = require_generated2();
    var _index2 = require_lib3();
    function cleanJSXElementLiteralChild(child, args) {
      const lines = child.value.split(/\r\n|\n|\r/);
      let lastNonEmptyLine = 0;
      for (let i = 0; i < lines.length; i++) {
        if (/[^ \t]/.exec(lines[i])) {
          lastNonEmptyLine = i;
        }
      }
      let str = "";
      for (let i = 0; i < lines.length; i++) {
        const line = lines[i];
        const isFirstLine = i === 0;
        const isLastLine = i === lines.length - 1;
        const isLastNonEmptyLine = i === lastNonEmptyLine;
        let trimmedLine = line.replace(/\t/g, " ");
        if (!isFirstLine) {
          trimmedLine = trimmedLine.replace(/^ +/, "");
        }
        if (!isLastLine) {
          trimmedLine = trimmedLine.replace(/ +$/, "");
        }
        if (trimmedLine) {
          if (!isLastNonEmptyLine) {
            trimmedLine += " ";
          }
          str += trimmedLine;
        }
      }
      if (str) args.push((0, _index2.inherits)((0, _index.stringLiteral)(str), child));
    }
  }
});

// node_modules/@babel/types/lib/builders/react/buildChildren.js
var require_buildChildren = __commonJS({
  "node_modules/@babel/types/lib/builders/react/buildChildren.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = buildChildren;
    var _index = require_generated();
    var _cleanJSXElementLiteralChild = require_cleanJSXElementLiteralChild();
    function buildChildren(node) {
      const elements = [];
      for (let i = 0; i < node.children.length; i++) {
        let child = node.children[i];
        if ((0, _index.isJSXText)(child)) {
          (0, _cleanJSXElementLiteralChild.default)(child, elements);
          continue;
        }
        if ((0, _index.isJSXExpressionContainer)(child)) child = child.expression;
        if ((0, _index.isJSXEmptyExpression)(child)) continue;
        elements.push(child);
      }
      return elements;
    }
  }
});

// node_modules/@babel/types/lib/validators/isNode.js
var require_isNode = __commonJS({
  "node_modules/@babel/types/lib/validators/isNode.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = isNode;
    var _index = require_definitions();
    function isNode(node) {
      return !!(node && _index.VISITOR_KEYS[node.type]);
    }
  }
});

// node_modules/@babel/types/lib/asserts/assertNode.js
var require_assertNode = __commonJS({
  "node_modules/@babel/types/lib/asserts/assertNode.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = assertNode;
    var _isNode = require_isNode();
    function assertNode(node) {
      if (!(0, _isNode.default)(node)) {
        var _node$type;
        const type = (_node$type = node == null ? void 0 : node.type) != null ? _node$type : JSON.stringify(node);
        throw new TypeError(`Not a valid node of type "${type}"`);
      }
    }
  }
});

// node_modules/@babel/types/lib/asserts/generated/index.js
var require_generated3 = __commonJS({
  "node_modules/@babel/types/lib/asserts/generated/index.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.assertAccessor = assertAccessor;
    exports2.assertAnyTypeAnnotation = assertAnyTypeAnnotation;
    exports2.assertArgumentPlaceholder = assertArgumentPlaceholder;
    exports2.assertArrayExpression = assertArrayExpression;
    exports2.assertArrayPattern = assertArrayPattern;
    exports2.assertArrayTypeAnnotation = assertArrayTypeAnnotation;
    exports2.assertArrowFunctionExpression = assertArrowFunctionExpression;
    exports2.assertAssignmentExpression = assertAssignmentExpression;
    exports2.assertAssignmentPattern = assertAssignmentPattern;
    exports2.assertAwaitExpression = assertAwaitExpression;
    exports2.assertBigIntLiteral = assertBigIntLiteral;
    exports2.assertBinary = assertBinary;
    exports2.assertBinaryExpression = assertBinaryExpression;
    exports2.assertBindExpression = assertBindExpression;
    exports2.assertBlock = assertBlock;
    exports2.assertBlockParent = assertBlockParent;
    exports2.assertBlockStatement = assertBlockStatement;
    exports2.assertBooleanLiteral = assertBooleanLiteral;
    exports2.assertBooleanLiteralTypeAnnotation = assertBooleanLiteralTypeAnnotation;
    exports2.assertBooleanTypeAnnotation = assertBooleanTypeAnnotation;
    exports2.assertBreakStatement = assertBreakStatement;
    exports2.assertCallExpression = assertCallExpression;
    exports2.assertCatchClause = assertCatchClause;
    exports2.assertClass = assertClass;
    exports2.assertClassAccessorProperty = assertClassAccessorProperty;
    exports2.assertClassBody = assertClassBody;
    exports2.assertClassDeclaration = assertClassDeclaration;
    exports2.assertClassExpression = assertClassExpression;
    exports2.assertClassImplements = assertClassImplements;
    exports2.assertClassMethod = assertClassMethod;
    exports2.assertClassPrivateMethod = assertClassPrivateMethod;
    exports2.assertClassPrivateProperty = assertClassPrivateProperty;
    exports2.assertClassProperty = assertClassProperty;
    exports2.assertCompletionStatement = assertCompletionStatement;
    exports2.assertConditional = assertConditional;
    exports2.assertConditionalExpression = assertConditionalExpression;
    exports2.assertContinueStatement = assertContinueStatement;
    exports2.assertDebuggerStatement = assertDebuggerStatement;
    exports2.assertDecimalLiteral = assertDecimalLiteral;
    exports2.assertDeclaration = assertDeclaration;
    exports2.assertDeclareClass = assertDeclareClass;
    exports2.assertDeclareExportAllDeclaration = assertDeclareExportAllDeclaration;
    exports2.assertDeclareExportDeclaration = assertDeclareExportDeclaration;
    exports2.assertDeclareFunction = assertDeclareFunction;
    exports2.assertDeclareInterface = assertDeclareInterface;
    exports2.assertDeclareModule = assertDeclareModule;
    exports2.assertDeclareModuleExports = assertDeclareModuleExports;
    exports2.assertDeclareOpaqueType = assertDeclareOpaqueType;
    exports2.assertDeclareTypeAlias = assertDeclareTypeAlias;
    exports2.assertDeclareVariable = assertDeclareVariable;
    exports2.assertDeclaredPredicate = assertDeclaredPredicate;
    exports2.assertDecorator = assertDecorator;
    exports2.assertDirective = assertDirective;
    exports2.assertDirectiveLiteral = assertDirectiveLiteral;
    exports2.assertDoExpression = assertDoExpression;
    exports2.assertDoWhileStatement = assertDoWhileStatement;
    exports2.assertEmptyStatement = assertEmptyStatement;
    exports2.assertEmptyTypeAnnotation = assertEmptyTypeAnnotation;
    exports2.assertEnumBody = assertEnumBody;
    exports2.assertEnumBooleanBody = assertEnumBooleanBody;
    exports2.assertEnumBooleanMember = assertEnumBooleanMember;
    exports2.assertEnumDeclaration = assertEnumDeclaration;
    exports2.assertEnumDefaultedMember = assertEnumDefaultedMember;
    exports2.assertEnumMember = assertEnumMember;
    exports2.assertEnumNumberBody = assertEnumNumberBody;
    exports2.assertEnumNumberMember = assertEnumNumberMember;
    exports2.assertEnumStringBody = assertEnumStringBody;
    exports2.assertEnumStringMember = assertEnumStringMember;
    exports2.assertEnumSymbolBody = assertEnumSymbolBody;
    exports2.assertExistsTypeAnnotation = assertExistsTypeAnnotation;
    exports2.assertExportAllDeclaration = assertExportAllDeclaration;
    exports2.assertExportDeclaration = assertExportDeclaration;
    exports2.assertExportDefaultDeclaration = assertExportDefaultDeclaration;
    exports2.assertExportDefaultSpecifier = assertExportDefaultSpecifier;
    exports2.assertExportNamedDeclaration = assertExportNamedDeclaration;
    exports2.assertExportNamespaceSpecifier = assertExportNamespaceSpecifier;
    exports2.assertExportSpecifier = assertExportSpecifier;
    exports2.assertExpression = assertExpression;
    exports2.assertExpressionStatement = assertExpressionStatement;
    exports2.assertExpressionWrapper = assertExpressionWrapper;
    exports2.assertFile = assertFile;
    exports2.assertFlow = assertFlow;
    exports2.assertFlowBaseAnnotation = assertFlowBaseAnnotation;
    exports2.assertFlowDeclaration = assertFlowDeclaration;
    exports2.assertFlowPredicate = assertFlowPredicate;
    exports2.assertFlowType = assertFlowType;
    exports2.assertFor = assertFor;
    exports2.assertForInStatement = assertForInStatement;
    exports2.assertForOfStatement = assertForOfStatement;
    exports2.assertForStatement = assertForStatement;
    exports2.assertForXStatement = assertForXStatement;
    exports2.assertFunction = assertFunction;
    exports2.assertFunctionDeclaration = assertFunctionDeclaration;
    exports2.assertFunctionExpression = assertFunctionExpression;
    exports2.assertFunctionParameter = assertFunctionParameter;
    exports2.assertFunctionParent = assertFunctionParent;
    exports2.assertFunctionTypeAnnotation = assertFunctionTypeAnnotation;
    exports2.assertFunctionTypeParam = assertFunctionTypeParam;
    exports2.assertGenericTypeAnnotation = assertGenericTypeAnnotation;
    exports2.assertIdentifier = assertIdentifier;
    exports2.assertIfStatement = assertIfStatement;
    exports2.assertImmutable = assertImmutable;
    exports2.assertImport = assertImport;
    exports2.assertImportAttribute = assertImportAttribute;
    exports2.assertImportDeclaration = assertImportDeclaration;
    exports2.assertImportDefaultSpecifier = assertImportDefaultSpecifier;
    exports2.assertImportExpression = assertImportExpression;
    exports2.assertImportNamespaceSpecifier = assertImportNamespaceSpecifier;
    exports2.assertImportOrExportDeclaration = assertImportOrExportDeclaration;
    exports2.assertImportSpecifier = assertImportSpecifier;
    exports2.assertIndexedAccessType = assertIndexedAccessType;
    exports2.assertInferredPredicate = assertInferredPredicate;
    exports2.assertInterfaceDeclaration = assertInterfaceDeclaration;
    exports2.assertInterfaceExtends = assertInterfaceExtends;
    exports2.assertInterfaceTypeAnnotation = assertInterfaceTypeAnnotation;
    exports2.assertInterpreterDirective = assertInterpreterDirective;
    exports2.assertIntersectionTypeAnnotation = assertIntersectionTypeAnnotation;
    exports2.assertJSX = assertJSX;
    exports2.assertJSXAttribute = assertJSXAttribute;
    exports2.assertJSXClosingElement = assertJSXClosingElement;
    exports2.assertJSXClosingFragment = assertJSXClosingFragment;
    exports2.assertJSXElement = assertJSXElement;
    exports2.assertJSXEmptyExpression = assertJSXEmptyExpression;
    exports2.assertJSXExpressionContainer = assertJSXExpressionContainer;
    exports2.assertJSXFragment = assertJSXFragment;
    exports2.assertJSXIdentifier = assertJSXIdentifier;
    exports2.assertJSXMemberExpression = assertJSXMemberExpression;
    exports2.assertJSXNamespacedName = assertJSXNamespacedName;
    exports2.assertJSXOpeningElement = assertJSXOpeningElement;
    exports2.assertJSXOpeningFragment = assertJSXOpeningFragment;
    exports2.assertJSXSpreadAttribute = assertJSXSpreadAttribute;
    exports2.assertJSXSpreadChild = assertJSXSpreadChild;
    exports2.assertJSXText = assertJSXText;
    exports2.assertLVal = assertLVal;
    exports2.assertLabeledStatement = assertLabeledStatement;
    exports2.assertLiteral = assertLiteral;
    exports2.assertLogicalExpression = assertLogicalExpression;
    exports2.assertLoop = assertLoop;
    exports2.assertMemberExpression = assertMemberExpression;
    exports2.assertMetaProperty = assertMetaProperty;
    exports2.assertMethod = assertMethod;
    exports2.assertMiscellaneous = assertMiscellaneous;
    exports2.assertMixedTypeAnnotation = assertMixedTypeAnnotation;
    exports2.assertModuleDeclaration = assertModuleDeclaration;
    exports2.assertModuleExpression = assertModuleExpression;
    exports2.assertModuleSpecifier = assertModuleSpecifier;
    exports2.assertNewExpression = assertNewExpression;
    exports2.assertNoop = assertNoop;
    exports2.assertNullLiteral = assertNullLiteral;
    exports2.assertNullLiteralTypeAnnotation = assertNullLiteralTypeAnnotation;
    exports2.assertNullableTypeAnnotation = assertNullableTypeAnnotation;
    exports2.assertNumberLiteral = assertNumberLiteral;
    exports2.assertNumberLiteralTypeAnnotation = assertNumberLiteralTypeAnnotation;
    exports2.assertNumberTypeAnnotation = assertNumberTypeAnnotation;
    exports2.assertNumericLiteral = assertNumericLiteral;
    exports2.assertObjectExpression = assertObjectExpression;
    exports2.assertObjectMember = assertObjectMember;
    exports2.assertObjectMethod = assertObjectMethod;
    exports2.assertObjectPattern = assertObjectPattern;
    exports2.assertObjectProperty = assertObjectProperty;
    exports2.assertObjectTypeAnnotation = assertObjectTypeAnnotation;
    exports2.assertObjectTypeCallProperty = assertObjectTypeCallProperty;
    exports2.assertObjectTypeIndexer = assertObjectTypeIndexer;
    exports2.assertObjectTypeInternalSlot = assertObjectTypeInternalSlot;
    exports2.assertObjectTypeProperty = assertObjectTypeProperty;
    exports2.assertObjectTypeSpreadProperty = assertObjectTypeSpreadProperty;
    exports2.assertOpaqueType = assertOpaqueType;
    exports2.assertOptionalCallExpression = assertOptionalCallExpression;
    exports2.assertOptionalIndexedAccessType = assertOptionalIndexedAccessType;
    exports2.assertOptionalMemberExpression = assertOptionalMemberExpression;
    exports2.assertParenthesizedExpression = assertParenthesizedExpression;
    exports2.assertPattern = assertPattern;
    exports2.assertPatternLike = assertPatternLike;
    exports2.assertPipelineBareFunction = assertPipelineBareFunction;
    exports2.assertPipelinePrimaryTopicReference = assertPipelinePrimaryTopicReference;
    exports2.assertPipelineTopicExpression = assertPipelineTopicExpression;
    exports2.assertPlaceholder = assertPlaceholder;
    exports2.assertPrivate = assertPrivate;
    exports2.assertPrivateName = assertPrivateName;
    exports2.assertProgram = assertProgram;
    exports2.assertProperty = assertProperty;
    exports2.assertPureish = assertPureish;
    exports2.assertQualifiedTypeIdentifier = assertQualifiedTypeIdentifier;
    exports2.assertRecordExpression = assertRecordExpression;
    exports2.assertRegExpLiteral = assertRegExpLiteral;
    exports2.assertRegexLiteral = assertRegexLiteral;
    exports2.assertRestElement = assertRestElement;
    exports2.assertRestProperty = assertRestProperty;
    exports2.assertReturnStatement = assertReturnStatement;
    exports2.assertScopable = assertScopable;
    exports2.assertSequenceExpression = assertSequenceExpression;
    exports2.assertSpreadElement = assertSpreadElement;
    exports2.assertSpreadProperty = assertSpreadProperty;
    exports2.assertStandardized = assertStandardized;
    exports2.assertStatement = assertStatement;
    exports2.assertStaticBlock = assertStaticBlock;
    exports2.assertStringLiteral = assertStringLiteral;
    exports2.assertStringLiteralTypeAnnotation = assertStringLiteralTypeAnnotation;
    exports2.assertStringTypeAnnotation = assertStringTypeAnnotation;
    exports2.assertSuper = assertSuper;
    exports2.assertSwitchCase = assertSwitchCase;
    exports2.assertSwitchStatement = assertSwitchStatement;
    exports2.assertSymbolTypeAnnotation = assertSymbolTypeAnnotation;
    exports2.assertTSAnyKeyword = assertTSAnyKeyword;
    exports2.assertTSArrayType = assertTSArrayType;
    exports2.assertTSAsExpression = assertTSAsExpression;
    exports2.assertTSBaseType = assertTSBaseType;
    exports2.assertTSBigIntKeyword = assertTSBigIntKeyword;
    exports2.assertTSBooleanKeyword = assertTSBooleanKeyword;
    exports2.assertTSCallSignatureDeclaration = assertTSCallSignatureDeclaration;
    exports2.assertTSConditionalType = assertTSConditionalType;
    exports2.assertTSConstructSignatureDeclaration = assertTSConstructSignatureDeclaration;
    exports2.assertTSConstructorType = assertTSConstructorType;
    exports2.assertTSDeclareFunction = assertTSDeclareFunction;
    exports2.assertTSDeclareMethod = assertTSDeclareMethod;
    exports2.assertTSEntityName = assertTSEntityName;
    exports2.assertTSEnumBody = assertTSEnumBody;
    exports2.assertTSEnumDeclaration = assertTSEnumDeclaration;
    exports2.assertTSEnumMember = assertTSEnumMember;
    exports2.assertTSExportAssignment = assertTSExportAssignment;
    exports2.assertTSExpressionWithTypeArguments = assertTSExpressionWithTypeArguments;
    exports2.assertTSExternalModuleReference = assertTSExternalModuleReference;
    exports2.assertTSFunctionType = assertTSFunctionType;
    exports2.assertTSImportEqualsDeclaration = assertTSImportEqualsDeclaration;
    exports2.assertTSImportType = assertTSImportType;
    exports2.assertTSIndexSignature = assertTSIndexSignature;
    exports2.assertTSIndexedAccessType = assertTSIndexedAccessType;
    exports2.assertTSInferType = assertTSInferType;
    exports2.assertTSInstantiationExpression = assertTSInstantiationExpression;
    exports2.assertTSInterfaceBody = assertTSInterfaceBody;
    exports2.assertTSInterfaceDeclaration = assertTSInterfaceDeclaration;
    exports2.assertTSIntersectionType = assertTSIntersectionType;
    exports2.assertTSIntrinsicKeyword = assertTSIntrinsicKeyword;
    exports2.assertTSLiteralType = assertTSLiteralType;
    exports2.assertTSMappedType = assertTSMappedType;
    exports2.assertTSMethodSignature = assertTSMethodSignature;
    exports2.assertTSModuleBlock = assertTSModuleBlock;
    exports2.assertTSModuleDeclaration = assertTSModuleDeclaration;
    exports2.assertTSNamedTupleMember = assertTSNamedTupleMember;
    exports2.assertTSNamespaceExportDeclaration = assertTSNamespaceExportDeclaration;
    exports2.assertTSNeverKeyword = assertTSNeverKeyword;
    exports2.assertTSNonNullExpression = assertTSNonNullExpression;
    exports2.assertTSNullKeyword = assertTSNullKeyword;
    exports2.assertTSNumberKeyword = assertTSNumberKeyword;
    exports2.assertTSObjectKeyword = assertTSObjectKeyword;
    exports2.assertTSOptionalType = assertTSOptionalType;
    exports2.assertTSParameterProperty = assertTSParameterProperty;
    exports2.assertTSParenthesizedType = assertTSParenthesizedType;
    exports2.assertTSPropertySignature = assertTSPropertySignature;
    exports2.assertTSQualifiedName = assertTSQualifiedName;
    exports2.assertTSRestType = assertTSRestType;
    exports2.assertTSSatisfiesExpression = assertTSSatisfiesExpression;
    exports2.assertTSStringKeyword = assertTSStringKeyword;
    exports2.assertTSSymbolKeyword = assertTSSymbolKeyword;
    exports2.assertTSTemplateLiteralType = assertTSTemplateLiteralType;
    exports2.assertTSThisType = assertTSThisType;
    exports2.assertTSTupleType = assertTSTupleType;
    exports2.assertTSType = assertTSType;
    exports2.assertTSTypeAliasDeclaration = assertTSTypeAliasDeclaration;
    exports2.assertTSTypeAnnotation = assertTSTypeAnnotation;
    exports2.assertTSTypeAssertion = assertTSTypeAssertion;
    exports2.assertTSTypeElement = assertTSTypeElement;
    exports2.assertTSTypeLiteral = assertTSTypeLiteral;
    exports2.assertTSTypeOperator = assertTSTypeOperator;
    exports2.assertTSTypeParameter = assertTSTypeParameter;
    exports2.assertTSTypeParameterDeclaration = assertTSTypeParameterDeclaration;
    exports2.assertTSTypeParameterInstantiation = assertTSTypeParameterInstantiation;
    exports2.assertTSTypePredicate = assertTSTypePredicate;
    exports2.assertTSTypeQuery = assertTSTypeQuery;
    exports2.assertTSTypeReference = assertTSTypeReference;
    exports2.assertTSUndefinedKeyword = assertTSUndefinedKeyword;
    exports2.assertTSUnionType = assertTSUnionType;
    exports2.assertTSUnknownKeyword = assertTSUnknownKeyword;
    exports2.assertTSVoidKeyword = assertTSVoidKeyword;
    exports2.assertTaggedTemplateExpression = assertTaggedTemplateExpression;
    exports2.assertTemplateElement = assertTemplateElement;
    exports2.assertTemplateLiteral = assertTemplateLiteral;
    exports2.assertTerminatorless = assertTerminatorless;
    exports2.assertThisExpression = assertThisExpression;
    exports2.assertThisTypeAnnotation = assertThisTypeAnnotation;
    exports2.assertThrowStatement = assertThrowStatement;
    exports2.assertTopicReference = assertTopicReference;
    exports2.assertTryStatement = assertTryStatement;
    exports2.assertTupleExpression = assertTupleExpression;
    exports2.assertTupleTypeAnnotation = assertTupleTypeAnnotation;
    exports2.assertTypeAlias = assertTypeAlias;
    exports2.assertTypeAnnotation = assertTypeAnnotation;
    exports2.assertTypeCastExpression = assertTypeCastExpression;
    exports2.assertTypeParameter = assertTypeParameter;
    exports2.assertTypeParameterDeclaration = assertTypeParameterDeclaration;
    exports2.assertTypeParameterInstantiation = assertTypeParameterInstantiation;
    exports2.assertTypeScript = assertTypeScript;
    exports2.assertTypeofTypeAnnotation = assertTypeofTypeAnnotation;
    exports2.assertUnaryExpression = assertUnaryExpression;
    exports2.assertUnaryLike = assertUnaryLike;
    exports2.assertUnionTypeAnnotation = assertUnionTypeAnnotation;
    exports2.assertUpdateExpression = assertUpdateExpression;
    exports2.assertUserWhitespacable = assertUserWhitespacable;
    exports2.assertV8IntrinsicIdentifier = assertV8IntrinsicIdentifier;
    exports2.assertVariableDeclaration = assertVariableDeclaration;
    exports2.assertVariableDeclarator = assertVariableDeclarator;
    exports2.assertVariance = assertVariance;
    exports2.assertVoidPattern = assertVoidPattern;
    exports2.assertVoidTypeAnnotation = assertVoidTypeAnnotation;
    exports2.assertWhile = assertWhile;
    exports2.assertWhileStatement = assertWhileStatement;
    exports2.assertWithStatement = assertWithStatement;
    exports2.assertYieldExpression = assertYieldExpression;
    var _is = require_is();
    var _deprecationWarning = require_deprecationWarning();
    function assert(type, node, opts) {
      if (!(0, _is.default)(type, node, opts)) {
        throw new Error(`Expected type "${type}" with option ${JSON.stringify(opts)}, but instead got "${node.type}".`);
      }
    }
    function assertArrayExpression(node, opts) {
      assert("ArrayExpression", node, opts);
    }
    function assertAssignmentExpression(node, opts) {
      assert("AssignmentExpression", node, opts);
    }
    function assertBinaryExpression(node, opts) {
      assert("BinaryExpression", node, opts);
    }
    function assertInterpreterDirective(node, opts) {
      assert("InterpreterDirective", node, opts);
    }
    function assertDirective(node, opts) {
      assert("Directive", node, opts);
    }
    function assertDirectiveLiteral(node, opts) {
      assert("DirectiveLiteral", node, opts);
    }
    function assertBlockStatement(node, opts) {
      assert("BlockStatement", node, opts);
    }
    function assertBreakStatement(node, opts) {
      assert("BreakStatement", node, opts);
    }
    function assertCallExpression(node, opts) {
      assert("CallExpression", node, opts);
    }
    function assertCatchClause(node, opts) {
      assert("CatchClause", node, opts);
    }
    function assertConditionalExpression(node, opts) {
      assert("ConditionalExpression", node, opts);
    }
    function assertContinueStatement(node, opts) {
      assert("ContinueStatement", node, opts);
    }
    function assertDebuggerStatement(node, opts) {
      assert("DebuggerStatement", node, opts);
    }
    function assertDoWhileStatement(node, opts) {
      assert("DoWhileStatement", node, opts);
    }
    function assertEmptyStatement(node, opts) {
      assert("EmptyStatement", node, opts);
    }
    function assertExpressionStatement(node, opts) {
      assert("ExpressionStatement", node, opts);
    }
    function assertFile(node, opts) {
      assert("File", node, opts);
    }
    function assertForInStatement(node, opts) {
      assert("ForInStatement", node, opts);
    }
    function assertForStatement(node, opts) {
      assert("ForStatement", node, opts);
    }
    function assertFunctionDeclaration(node, opts) {
      assert("FunctionDeclaration", node, opts);
    }
    function assertFunctionExpression(node, opts) {
      assert("FunctionExpression", node, opts);
    }
    function assertIdentifier(node, opts) {
      assert("Identifier", node, opts);
    }
    function assertIfStatement(node, opts) {
      assert("IfStatement", node, opts);
    }
    function assertLabeledStatement(node, opts) {
      assert("LabeledStatement", node, opts);
    }
    function assertStringLiteral(node, opts) {
      assert("StringLiteral", node, opts);
    }
    function assertNumericLiteral(node, opts) {
      assert("NumericLiteral", node, opts);
    }
    function assertNullLiteral(node, opts) {
      assert("NullLiteral", node, opts);
    }
    function assertBooleanLiteral(node, opts) {
      assert("BooleanLiteral", node, opts);
    }
    function assertRegExpLiteral(node, opts) {
      assert("RegExpLiteral", node, opts);
    }
    function assertLogicalExpression(node, opts) {
      assert("LogicalExpression", node, opts);
    }
    function assertMemberExpression(node, opts) {
      assert("MemberExpression", node, opts);
    }
    function assertNewExpression(node, opts) {
      assert("NewExpression", node, opts);
    }
    function assertProgram(node, opts) {
      assert("Program", node, opts);
    }
    function assertObjectExpression(node, opts) {
      assert("ObjectExpression", node, opts);
    }
    function assertObjectMethod(node, opts) {
      assert("ObjectMethod", node, opts);
    }
    function assertObjectProperty(node, opts) {
      assert("ObjectProperty", node, opts);
    }
    function assertRestElement(node, opts) {
      assert("RestElement", node, opts);
    }
    function assertReturnStatement(node, opts) {
      assert("ReturnStatement", node, opts);
    }
    function assertSequenceExpression(node, opts) {
      assert("SequenceExpression", node, opts);
    }
    function assertParenthesizedExpression(node, opts) {
      assert("ParenthesizedExpression", node, opts);
    }
    function assertSwitchCase(node, opts) {
      assert("SwitchCase", node, opts);
    }
    function assertSwitchStatement(node, opts) {
      assert("SwitchStatement", node, opts);
    }
    function assertThisExpression(node, opts) {
      assert("ThisExpression", node, opts);
    }
    function assertThrowStatement(node, opts) {
      assert("ThrowStatement", node, opts);
    }
    function assertTryStatement(node, opts) {
      assert("TryStatement", node, opts);
    }
    function assertUnaryExpression(node, opts) {
      assert("UnaryExpression", node, opts);
    }
    function assertUpdateExpression(node, opts) {
      assert("UpdateExpression", node, opts);
    }
    function assertVariableDeclaration(node, opts) {
      assert("VariableDeclaration", node, opts);
    }
    function assertVariableDeclarator(node, opts) {
      assert("VariableDeclarator", node, opts);
    }
    function assertWhileStatement(node, opts) {
      assert("WhileStatement", node, opts);
    }
    function assertWithStatement(node, opts) {
      assert("WithStatement", node, opts);
    }
    function assertAssignmentPattern(node, opts) {
      assert("AssignmentPattern", node, opts);
    }
    function assertArrayPattern(node, opts) {
      assert("ArrayPattern", node, opts);
    }
    function assertArrowFunctionExpression(node, opts) {
      assert("ArrowFunctionExpression", node, opts);
    }
    function assertClassBody(node, opts) {
      assert("ClassBody", node, opts);
    }
    function assertClassExpression(node, opts) {
      assert("ClassExpression", node, opts);
    }
    function assertClassDeclaration(node, opts) {
      assert("ClassDeclaration", node, opts);
    }
    function assertExportAllDeclaration(node, opts) {
      assert("ExportAllDeclaration", node, opts);
    }
    function assertExportDefaultDeclaration(node, opts) {
      assert("ExportDefaultDeclaration", node, opts);
    }
    function assertExportNamedDeclaration(node, opts) {
      assert("ExportNamedDeclaration", node, opts);
    }
    function assertExportSpecifier(node, opts) {
      assert("ExportSpecifier", node, opts);
    }
    function assertForOfStatement(node, opts) {
      assert("ForOfStatement", node, opts);
    }
    function assertImportDeclaration(node, opts) {
      assert("ImportDeclaration", node, opts);
    }
    function assertImportDefaultSpecifier(node, opts) {
      assert("ImportDefaultSpecifier", node, opts);
    }
    function assertImportNamespaceSpecifier(node, opts) {
      assert("ImportNamespaceSpecifier", node, opts);
    }
    function assertImportSpecifier(node, opts) {
      assert("ImportSpecifier", node, opts);
    }
    function assertImportExpression(node, opts) {
      assert("ImportExpression", node, opts);
    }
    function assertMetaProperty(node, opts) {
      assert("MetaProperty", node, opts);
    }
    function assertClassMethod(node, opts) {
      assert("ClassMethod", node, opts);
    }
    function assertObjectPattern(node, opts) {
      assert("ObjectPattern", node, opts);
    }
    function assertSpreadElement(node, opts) {
      assert("SpreadElement", node, opts);
    }
    function assertSuper(node, opts) {
      assert("Super", node, opts);
    }
    function assertTaggedTemplateExpression(node, opts) {
      assert("TaggedTemplateExpression", node, opts);
    }
    function assertTemplateElement(node, opts) {
      assert("TemplateElement", node, opts);
    }
    function assertTemplateLiteral(node, opts) {
      assert("TemplateLiteral", node, opts);
    }
    function assertYieldExpression(node, opts) {
      assert("YieldExpression", node, opts);
    }
    function assertAwaitExpression(node, opts) {
      assert("AwaitExpression", node, opts);
    }
    function assertImport(node, opts) {
      assert("Import", node, opts);
    }
    function assertBigIntLiteral(node, opts) {
      assert("BigIntLiteral", node, opts);
    }
    function assertExportNamespaceSpecifier(node, opts) {
      assert("ExportNamespaceSpecifier", node, opts);
    }
    function assertOptionalMemberExpression(node, opts) {
      assert("OptionalMemberExpression", node, opts);
    }
    function assertOptionalCallExpression(node, opts) {
      assert("OptionalCallExpression", node, opts);
    }
    function assertClassProperty(node, opts) {
      assert("ClassProperty", node, opts);
    }
    function assertClassAccessorProperty(node, opts) {
      assert("ClassAccessorProperty", node, opts);
    }
    function assertClassPrivateProperty(node, opts) {
      assert("ClassPrivateProperty", node, opts);
    }
    function assertClassPrivateMethod(node, opts) {
      assert("ClassPrivateMethod", node, opts);
    }
    function assertPrivateName(node, opts) {
      assert("PrivateName", node, opts);
    }
    function assertStaticBlock(node, opts) {
      assert("StaticBlock", node, opts);
    }
    function assertImportAttribute(node, opts) {
      assert("ImportAttribute", node, opts);
    }
    function assertAnyTypeAnnotation(node, opts) {
      assert("AnyTypeAnnotation", node, opts);
    }
    function assertArrayTypeAnnotation(node, opts) {
      assert("ArrayTypeAnnotation", node, opts);
    }
    function assertBooleanTypeAnnotation(node, opts) {
      assert("BooleanTypeAnnotation", node, opts);
    }
    function assertBooleanLiteralTypeAnnotation(node, opts) {
      assert("BooleanLiteralTypeAnnotation", node, opts);
    }
    function assertNullLiteralTypeAnnotation(node, opts) {
      assert("NullLiteralTypeAnnotation", node, opts);
    }
    function assertClassImplements(node, opts) {
      assert("ClassImplements", node, opts);
    }
    function assertDeclareClass(node, opts) {
      assert("DeclareClass", node, opts);
    }
    function assertDeclareFunction(node, opts) {
      assert("DeclareFunction", node, opts);
    }
    function assertDeclareInterface(node, opts) {
      assert("DeclareInterface", node, opts);
    }
    function assertDeclareModule(node, opts) {
      assert("DeclareModule", node, opts);
    }
    function assertDeclareModuleExports(node, opts) {
      assert("DeclareModuleExports", node, opts);
    }
    function assertDeclareTypeAlias(node, opts) {
      assert("DeclareTypeAlias", node, opts);
    }
    function assertDeclareOpaqueType(node, opts) {
      assert("DeclareOpaqueType", node, opts);
    }
    function assertDeclareVariable(node, opts) {
      assert("DeclareVariable", node, opts);
    }
    function assertDeclareExportDeclaration(node, opts) {
      assert("DeclareExportDeclaration", node, opts);
    }
    function assertDeclareExportAllDeclaration(node, opts) {
      assert("DeclareExportAllDeclaration", node, opts);
    }
    function assertDeclaredPredicate(node, opts) {
      assert("DeclaredPredicate", node, opts);
    }
    function assertExistsTypeAnnotation(node, opts) {
      assert("ExistsTypeAnnotation", node, opts);
    }
    function assertFunctionTypeAnnotation(node, opts) {
      assert("FunctionTypeAnnotation", node, opts);
    }
    function assertFunctionTypeParam(node, opts) {
      assert("FunctionTypeParam", node, opts);
    }
    function assertGenericTypeAnnotation(node, opts) {
      assert("GenericTypeAnnotation", node, opts);
    }
    function assertInferredPredicate(node, opts) {
      assert("InferredPredicate", node, opts);
    }
    function assertInterfaceExtends(node, opts) {
      assert("InterfaceExtends", node, opts);
    }
    function assertInterfaceDeclaration(node, opts) {
      assert("InterfaceDeclaration", node, opts);
    }
    function assertInterfaceTypeAnnotation(node, opts) {
      assert("InterfaceTypeAnnotation", node, opts);
    }
    function assertIntersectionTypeAnnotation(node, opts) {
      assert("IntersectionTypeAnnotation", node, opts);
    }
    function assertMixedTypeAnnotation(node, opts) {
      assert("MixedTypeAnnotation", node, opts);
    }
    function assertEmptyTypeAnnotation(node, opts) {
      assert("EmptyTypeAnnotation", node, opts);
    }
    function assertNullableTypeAnnotation(node, opts) {
      assert("NullableTypeAnnotation", node, opts);
    }
    function assertNumberLiteralTypeAnnotation(node, opts) {
      assert("NumberLiteralTypeAnnotation", node, opts);
    }
    function assertNumberTypeAnnotation(node, opts) {
      assert("NumberTypeAnnotation", node, opts);
    }
    function assertObjectTypeAnnotation(node, opts) {
      assert("ObjectTypeAnnotation", node, opts);
    }
    function assertObjectTypeInternalSlot(node, opts) {
      assert("ObjectTypeInternalSlot", node, opts);
    }
    function assertObjectTypeCallProperty(node, opts) {
      assert("ObjectTypeCallProperty", node, opts);
    }
    function assertObjectTypeIndexer(node, opts) {
      assert("ObjectTypeIndexer", node, opts);
    }
    function assertObjectTypeProperty(node, opts) {
      assert("ObjectTypeProperty", node, opts);
    }
    function assertObjectTypeSpreadProperty(node, opts) {
      assert("ObjectTypeSpreadProperty", node, opts);
    }
    function assertOpaqueType(node, opts) {
      assert("OpaqueType", node, opts);
    }
    function assertQualifiedTypeIdentifier(node, opts) {
      assert("QualifiedTypeIdentifier", node, opts);
    }
    function assertStringLiteralTypeAnnotation(node, opts) {
      assert("StringLiteralTypeAnnotation", node, opts);
    }
    function assertStringTypeAnnotation(node, opts) {
      assert("StringTypeAnnotation", node, opts);
    }
    function assertSymbolTypeAnnotation(node, opts) {
      assert("SymbolTypeAnnotation", node, opts);
    }
    function assertThisTypeAnnotation(node, opts) {
      assert("ThisTypeAnnotation", node, opts);
    }
    function assertTupleTypeAnnotation(node, opts) {
      assert("TupleTypeAnnotation", node, opts);
    }
    function assertTypeofTypeAnnotation(node, opts) {
      assert("TypeofTypeAnnotation", node, opts);
    }
    function assertTypeAlias(node, opts) {
      assert("TypeAlias", node, opts);
    }
    function assertTypeAnnotation(node, opts) {
      assert("TypeAnnotation", node, opts);
    }
    function assertTypeCastExpression(node, opts) {
      assert("TypeCastExpression", node, opts);
    }
    function assertTypeParameter(node, opts) {
      assert("TypeParameter", node, opts);
    }
    function assertTypeParameterDeclaration(node, opts) {
      assert("TypeParameterDeclaration", node, opts);
    }
    function assertTypeParameterInstantiation(node, opts) {
      assert("TypeParameterInstantiation", node, opts);
    }
    function assertUnionTypeAnnotation(node, opts) {
      assert("UnionTypeAnnotation", node, opts);
    }
    function assertVariance(node, opts) {
      assert("Variance", node, opts);
    }
    function assertVoidTypeAnnotation(node, opts) {
      assert("VoidTypeAnnotation", node, opts);
    }
    function assertEnumDeclaration(node, opts) {
      assert("EnumDeclaration", node, opts);
    }
    function assertEnumBooleanBody(node, opts) {
      assert("EnumBooleanBody", node, opts);
    }
    function assertEnumNumberBody(node, opts) {
      assert("EnumNumberBody", node, opts);
    }
    function assertEnumStringBody(node, opts) {
      assert("EnumStringBody", node, opts);
    }
    function assertEnumSymbolBody(node, opts) {
      assert("EnumSymbolBody", node, opts);
    }
    function assertEnumBooleanMember(node, opts) {
      assert("EnumBooleanMember", node, opts);
    }
    function assertEnumNumberMember(node, opts) {
      assert("EnumNumberMember", node, opts);
    }
    function assertEnumStringMember(node, opts) {
      assert("EnumStringMember", node, opts);
    }
    function assertEnumDefaultedMember(node, opts) {
      assert("EnumDefaultedMember", node, opts);
    }
    function assertIndexedAccessType(node, opts) {
      assert("IndexedAccessType", node, opts);
    }
    function assertOptionalIndexedAccessType(node, opts) {
      assert("OptionalIndexedAccessType", node, opts);
    }
    function assertJSXAttribute(node, opts) {
      assert("JSXAttribute", node, opts);
    }
    function assertJSXClosingElement(node, opts) {
      assert("JSXClosingElement", node, opts);
    }
    function assertJSXElement(node, opts) {
      assert("JSXElement", node, opts);
    }
    function assertJSXEmptyExpression(node, opts) {
      assert("JSXEmptyExpression", node, opts);
    }
    function assertJSXExpressionContainer(node, opts) {
      assert("JSXExpressionContainer", node, opts);
    }
    function assertJSXSpreadChild(node, opts) {
      assert("JSXSpreadChild", node, opts);
    }
    function assertJSXIdentifier(node, opts) {
      assert("JSXIdentifier", node, opts);
    }
    function assertJSXMemberExpression(node, opts) {
      assert("JSXMemberExpression", node, opts);
    }
    function assertJSXNamespacedName(node, opts) {
      assert("JSXNamespacedName", node, opts);
    }
    function assertJSXOpeningElement(node, opts) {
      assert("JSXOpeningElement", node, opts);
    }
    function assertJSXSpreadAttribute(node, opts) {
      assert("JSXSpreadAttribute", node, opts);
    }
    function assertJSXText(node, opts) {
      assert("JSXText", node, opts);
    }
    function assertJSXFragment(node, opts) {
      assert("JSXFragment", node, opts);
    }
    function assertJSXOpeningFragment(node, opts) {
      assert("JSXOpeningFragment", node, opts);
    }
    function assertJSXClosingFragment(node, opts) {
      assert("JSXClosingFragment", node, opts);
    }
    function assertNoop(node, opts) {
      assert("Noop", node, opts);
    }
    function assertPlaceholder(node, opts) {
      assert("Placeholder", node, opts);
    }
    function assertV8IntrinsicIdentifier(node, opts) {
      assert("V8IntrinsicIdentifier", node, opts);
    }
    function assertArgumentPlaceholder(node, opts) {
      assert("ArgumentPlaceholder", node, opts);
    }
    function assertBindExpression(node, opts) {
      assert("BindExpression", node, opts);
    }
    function assertDecorator(node, opts) {
      assert("Decorator", node, opts);
    }
    function assertDoExpression(node, opts) {
      assert("DoExpression", node, opts);
    }
    function assertExportDefaultSpecifier(node, opts) {
      assert("ExportDefaultSpecifier", node, opts);
    }
    function assertRecordExpression(node, opts) {
      assert("RecordExpression", node, opts);
    }
    function assertTupleExpression(node, opts) {
      assert("TupleExpression", node, opts);
    }
    function assertDecimalLiteral(node, opts) {
      assert("DecimalLiteral", node, opts);
    }
    function assertModuleExpression(node, opts) {
      assert("ModuleExpression", node, opts);
    }
    function assertTopicReference(node, opts) {
      assert("TopicReference", node, opts);
    }
    function assertPipelineTopicExpression(node, opts) {
      assert("PipelineTopicExpression", node, opts);
    }
    function assertPipelineBareFunction(node, opts) {
      assert("PipelineBareFunction", node, opts);
    }
    function assertPipelinePrimaryTopicReference(node, opts) {
      assert("PipelinePrimaryTopicReference", node, opts);
    }
    function assertVoidPattern(node, opts) {
      assert("VoidPattern", node, opts);
    }
    function assertTSParameterProperty(node, opts) {
      assert("TSParameterProperty", node, opts);
    }
    function assertTSDeclareFunction(node, opts) {
      assert("TSDeclareFunction", node, opts);
    }
    function assertTSDeclareMethod(node, opts) {
      assert("TSDeclareMethod", node, opts);
    }
    function assertTSQualifiedName(node, opts) {
      assert("TSQualifiedName", node, opts);
    }
    function assertTSCallSignatureDeclaration(node, opts) {
      assert("TSCallSignatureDeclaration", node, opts);
    }
    function assertTSConstructSignatureDeclaration(node, opts) {
      assert("TSConstructSignatureDeclaration", node, opts);
    }
    function assertTSPropertySignature(node, opts) {
      assert("TSPropertySignature", node, opts);
    }
    function assertTSMethodSignature(node, opts) {
      assert("TSMethodSignature", node, opts);
    }
    function assertTSIndexSignature(node, opts) {
      assert("TSIndexSignature", node, opts);
    }
    function assertTSAnyKeyword(node, opts) {
      assert("TSAnyKeyword", node, opts);
    }
    function assertTSBooleanKeyword(node, opts) {
      assert("TSBooleanKeyword", node, opts);
    }
    function assertTSBigIntKeyword(node, opts) {
      assert("TSBigIntKeyword", node, opts);
    }
    function assertTSIntrinsicKeyword(node, opts) {
      assert("TSIntrinsicKeyword", node, opts);
    }
    function assertTSNeverKeyword(node, opts) {
      assert("TSNeverKeyword", node, opts);
    }
    function assertTSNullKeyword(node, opts) {
      assert("TSNullKeyword", node, opts);
    }
    function assertTSNumberKeyword(node, opts) {
      assert("TSNumberKeyword", node, opts);
    }
    function assertTSObjectKeyword(node, opts) {
      assert("TSObjectKeyword", node, opts);
    }
    function assertTSStringKeyword(node, opts) {
      assert("TSStringKeyword", node, opts);
    }
    function assertTSSymbolKeyword(node, opts) {
      assert("TSSymbolKeyword", node, opts);
    }
    function assertTSUndefinedKeyword(node, opts) {
      assert("TSUndefinedKeyword", node, opts);
    }
    function assertTSUnknownKeyword(node, opts) {
      assert("TSUnknownKeyword", node, opts);
    }
    function assertTSVoidKeyword(node, opts) {
      assert("TSVoidKeyword", node, opts);
    }
    function assertTSThisType(node, opts) {
      assert("TSThisType", node, opts);
    }
    function assertTSFunctionType(node, opts) {
      assert("TSFunctionType", node, opts);
    }
    function assertTSConstructorType(node, opts) {
      assert("TSConstructorType", node, opts);
    }
    function assertTSTypeReference(node, opts) {
      assert("TSTypeReference", node, opts);
    }
    function assertTSTypePredicate(node, opts) {
      assert("TSTypePredicate", node, opts);
    }
    function assertTSTypeQuery(node, opts) {
      assert("TSTypeQuery", node, opts);
    }
    function assertTSTypeLiteral(node, opts) {
      assert("TSTypeLiteral", node, opts);
    }
    function assertTSArrayType(node, opts) {
      assert("TSArrayType", node, opts);
    }
    function assertTSTupleType(node, opts) {
      assert("TSTupleType", node, opts);
    }
    function assertTSOptionalType(node, opts) {
      assert("TSOptionalType", node, opts);
    }
    function assertTSRestType(node, opts) {
      assert("TSRestType", node, opts);
    }
    function assertTSNamedTupleMember(node, opts) {
      assert("TSNamedTupleMember", node, opts);
    }
    function assertTSUnionType(node, opts) {
      assert("TSUnionType", node, opts);
    }
    function assertTSIntersectionType(node, opts) {
      assert("TSIntersectionType", node, opts);
    }
    function assertTSConditionalType(node, opts) {
      assert("TSConditionalType", node, opts);
    }
    function assertTSInferType(node, opts) {
      assert("TSInferType", node, opts);
    }
    function assertTSParenthesizedType(node, opts) {
      assert("TSParenthesizedType", node, opts);
    }
    function assertTSTypeOperator(node, opts) {
      assert("TSTypeOperator", node, opts);
    }
    function assertTSIndexedAccessType(node, opts) {
      assert("TSIndexedAccessType", node, opts);
    }
    function assertTSMappedType(node, opts) {
      assert("TSMappedType", node, opts);
    }
    function assertTSTemplateLiteralType(node, opts) {
      assert("TSTemplateLiteralType", node, opts);
    }
    function assertTSLiteralType(node, opts) {
      assert("TSLiteralType", node, opts);
    }
    function assertTSExpressionWithTypeArguments(node, opts) {
      assert("TSExpressionWithTypeArguments", node, opts);
    }
    function assertTSInterfaceDeclaration(node, opts) {
      assert("TSInterfaceDeclaration", node, opts);
    }
    function assertTSInterfaceBody(node, opts) {
      assert("TSInterfaceBody", node, opts);
    }
    function assertTSTypeAliasDeclaration(node, opts) {
      assert("TSTypeAliasDeclaration", node, opts);
    }
    function assertTSInstantiationExpression(node, opts) {
      assert("TSInstantiationExpression", node, opts);
    }
    function assertTSAsExpression(node, opts) {
      assert("TSAsExpression", node, opts);
    }
    function assertTSSatisfiesExpression(node, opts) {
      assert("TSSatisfiesExpression", node, opts);
    }
    function assertTSTypeAssertion(node, opts) {
      assert("TSTypeAssertion", node, opts);
    }
    function assertTSEnumBody(node, opts) {
      assert("TSEnumBody", node, opts);
    }
    function assertTSEnumDeclaration(node, opts) {
      assert("TSEnumDeclaration", node, opts);
    }
    function assertTSEnumMember(node, opts) {
      assert("TSEnumMember", node, opts);
    }
    function assertTSModuleDeclaration(node, opts) {
      assert("TSModuleDeclaration", node, opts);
    }
    function assertTSModuleBlock(node, opts) {
      assert("TSModuleBlock", node, opts);
    }
    function assertTSImportType(node, opts) {
      assert("TSImportType", node, opts);
    }
    function assertTSImportEqualsDeclaration(node, opts) {
      assert("TSImportEqualsDeclaration", node, opts);
    }
    function assertTSExternalModuleReference(node, opts) {
      assert("TSExternalModuleReference", node, opts);
    }
    function assertTSNonNullExpression(node, opts) {
      assert("TSNonNullExpression", node, opts);
    }
    function assertTSExportAssignment(node, opts) {
      assert("TSExportAssignment", node, opts);
    }
    function assertTSNamespaceExportDeclaration(node, opts) {
      assert("TSNamespaceExportDeclaration", node, opts);
    }
    function assertTSTypeAnnotation(node, opts) {
      assert("TSTypeAnnotation", node, opts);
    }
    function assertTSTypeParameterInstantiation(node, opts) {
      assert("TSTypeParameterInstantiation", node, opts);
    }
    function assertTSTypeParameterDeclaration(node, opts) {
      assert("TSTypeParameterDeclaration", node, opts);
    }
    function assertTSTypeParameter(node, opts) {
      assert("TSTypeParameter", node, opts);
    }
    function assertStandardized(node, opts) {
      assert("Standardized", node, opts);
    }
    function assertExpression(node, opts) {
      assert("Expression", node, opts);
    }
    function assertBinary(node, opts) {
      assert("Binary", node, opts);
    }
    function assertScopable(node, opts) {
      assert("Scopable", node, opts);
    }
    function assertBlockParent(node, opts) {
      assert("BlockParent", node, opts);
    }
    function assertBlock(node, opts) {
      assert("Block", node, opts);
    }
    function assertStatement(node, opts) {
      assert("Statement", node, opts);
    }
    function assertTerminatorless(node, opts) {
      assert("Terminatorless", node, opts);
    }
    function assertCompletionStatement(node, opts) {
      assert("CompletionStatement", node, opts);
    }
    function assertConditional(node, opts) {
      assert("Conditional", node, opts);
    }
    function assertLoop(node, opts) {
      assert("Loop", node, opts);
    }
    function assertWhile(node, opts) {
      assert("While", node, opts);
    }
    function assertExpressionWrapper(node, opts) {
      assert("ExpressionWrapper", node, opts);
    }
    function assertFor(node, opts) {
      assert("For", node, opts);
    }
    function assertForXStatement(node, opts) {
      assert("ForXStatement", node, opts);
    }
    function assertFunction(node, opts) {
      assert("Function", node, opts);
    }
    function assertFunctionParent(node, opts) {
      assert("FunctionParent", node, opts);
    }
    function assertPureish(node, opts) {
      assert("Pureish", node, opts);
    }
    function assertDeclaration(node, opts) {
      assert("Declaration", node, opts);
    }
    function assertFunctionParameter(node, opts) {
      assert("FunctionParameter", node, opts);
    }
    function assertPatternLike(node, opts) {
      assert("PatternLike", node, opts);
    }
    function assertLVal(node, opts) {
      assert("LVal", node, opts);
    }
    function assertTSEntityName(node, opts) {
      assert("TSEntityName", node, opts);
    }
    function assertLiteral(node, opts) {
      assert("Literal", node, opts);
    }
    function assertImmutable(node, opts) {
      assert("Immutable", node, opts);
    }
    function assertUserWhitespacable(node, opts) {
      assert("UserWhitespacable", node, opts);
    }
    function assertMethod(node, opts) {
      assert("Method", node, opts);
    }
    function assertObjectMember(node, opts) {
      assert("ObjectMember", node, opts);
    }
    function assertProperty(node, opts) {
      assert("Property", node, opts);
    }
    function assertUnaryLike(node, opts) {
      assert("UnaryLike", node, opts);
    }
    function assertPattern(node, opts) {
      assert("Pattern", node, opts);
    }
    function assertClass(node, opts) {
      assert("Class", node, opts);
    }
    function assertImportOrExportDeclaration(node, opts) {
      assert("ImportOrExportDeclaration", node, opts);
    }
    function assertExportDeclaration(node, opts) {
      assert("ExportDeclaration", node, opts);
    }
    function assertModuleSpecifier(node, opts) {
      assert("ModuleSpecifier", node, opts);
    }
    function assertAccessor(node, opts) {
      assert("Accessor", node, opts);
    }
    function assertPrivate(node, opts) {
      assert("Private", node, opts);
    }
    function assertFlow(node, opts) {
      assert("Flow", node, opts);
    }
    function assertFlowType(node, opts) {
      assert("FlowType", node, opts);
    }
    function assertFlowBaseAnnotation(node, opts) {
      assert("FlowBaseAnnotation", node, opts);
    }
    function assertFlowDeclaration(node, opts) {
      assert("FlowDeclaration", node, opts);
    }
    function assertFlowPredicate(node, opts) {
      assert("FlowPredicate", node, opts);
    }
    function assertEnumBody(node, opts) {
      assert("EnumBody", node, opts);
    }
    function assertEnumMember(node, opts) {
      assert("EnumMember", node, opts);
    }
    function assertJSX(node, opts) {
      assert("JSX", node, opts);
    }
    function assertMiscellaneous(node, opts) {
      assert("Miscellaneous", node, opts);
    }
    function assertTypeScript(node, opts) {
      assert("TypeScript", node, opts);
    }
    function assertTSTypeElement(node, opts) {
      assert("TSTypeElement", node, opts);
    }
    function assertTSType(node, opts) {
      assert("TSType", node, opts);
    }
    function assertTSBaseType(node, opts) {
      assert("TSBaseType", node, opts);
    }
    function assertNumberLiteral(node, opts) {
      (0, _deprecationWarning.default)("assertNumberLiteral", "assertNumericLiteral");
      assert("NumberLiteral", node, opts);
    }
    function assertRegexLiteral(node, opts) {
      (0, _deprecationWarning.default)("assertRegexLiteral", "assertRegExpLiteral");
      assert("RegexLiteral", node, opts);
    }
    function assertRestProperty(node, opts) {
      (0, _deprecationWarning.default)("assertRestProperty", "assertRestElement");
      assert("RestProperty", node, opts);
    }
    function assertSpreadProperty(node, opts) {
      (0, _deprecationWarning.default)("assertSpreadProperty", "assertSpreadElement");
      assert("SpreadProperty", node, opts);
    }
    function assertModuleDeclaration(node, opts) {
      (0, _deprecationWarning.default)("assertModuleDeclaration", "assertImportOrExportDeclaration");
      assert("ModuleDeclaration", node, opts);
    }
  }
});

// node_modules/@babel/types/lib/builders/flow/createTypeAnnotationBasedOnTypeof.js
var require_createTypeAnnotationBasedOnTypeof = __commonJS({
  "node_modules/@babel/types/lib/builders/flow/createTypeAnnotationBasedOnTypeof.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = void 0;
    var _index = require_generated2();
    var _default = exports2.default = createTypeAnnotationBasedOnTypeof;
    function createTypeAnnotationBasedOnTypeof(type) {
      switch (type) {
        case "string":
          return (0, _index.stringTypeAnnotation)();
        case "number":
          return (0, _index.numberTypeAnnotation)();
        case "undefined":
          return (0, _index.voidTypeAnnotation)();
        case "boolean":
          return (0, _index.booleanTypeAnnotation)();
        case "function":
          return (0, _index.genericTypeAnnotation)((0, _index.identifier)("Function"));
        case "object":
          return (0, _index.genericTypeAnnotation)((0, _index.identifier)("Object"));
        case "symbol":
          return (0, _index.genericTypeAnnotation)((0, _index.identifier)("Symbol"));
        case "bigint":
          return (0, _index.anyTypeAnnotation)();
      }
      throw new Error("Invalid typeof value: " + type);
    }
  }
});

// node_modules/@babel/types/lib/modifications/flow/removeTypeDuplicates.js
var require_removeTypeDuplicates = __commonJS({
  "node_modules/@babel/types/lib/modifications/flow/removeTypeDuplicates.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = removeTypeDuplicates;
    var _index = require_generated();
    function getQualifiedName(node) {
      return (0, _index.isIdentifier)(node) ? node.name : `${node.id.name}.${getQualifiedName(node.qualification)}`;
    }
    function removeTypeDuplicates(nodesIn) {
      const nodes = Array.from(nodesIn);
      const generics = /* @__PURE__ */ new Map();
      const bases = /* @__PURE__ */ new Map();
      const typeGroups = /* @__PURE__ */ new Set();
      const types2 = [];
      for (let i = 0; i < nodes.length; i++) {
        const node = nodes[i];
        if (!node) continue;
        if (types2.includes(node)) {
          continue;
        }
        if ((0, _index.isAnyTypeAnnotation)(node)) {
          return [node];
        }
        if ((0, _index.isFlowBaseAnnotation)(node)) {
          bases.set(node.type, node);
          continue;
        }
        if ((0, _index.isUnionTypeAnnotation)(node)) {
          if (!typeGroups.has(node.types)) {
            nodes.push(...node.types);
            typeGroups.add(node.types);
          }
          continue;
        }
        if ((0, _index.isGenericTypeAnnotation)(node)) {
          const name = getQualifiedName(node.id);
          if (generics.has(name)) {
            let existing = generics.get(name);
            if (existing.typeParameters) {
              if (node.typeParameters) {
                existing.typeParameters.params.push(...node.typeParameters.params);
                existing.typeParameters.params = removeTypeDuplicates(existing.typeParameters.params);
              }
            } else {
              existing = node.typeParameters;
            }
          } else {
            generics.set(name, node);
          }
          continue;
        }
        types2.push(node);
      }
      for (const [, baseType] of bases) {
        types2.push(baseType);
      }
      for (const [, genericName] of generics) {
        types2.push(genericName);
      }
      return types2;
    }
  }
});

// node_modules/@babel/types/lib/builders/flow/createFlowUnionType.js
var require_createFlowUnionType = __commonJS({
  "node_modules/@babel/types/lib/builders/flow/createFlowUnionType.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = createFlowUnionType;
    var _index = require_generated2();
    var _removeTypeDuplicates = require_removeTypeDuplicates();
    function createFlowUnionType(types2) {
      const flattened = (0, _removeTypeDuplicates.default)(types2);
      if (flattened.length === 1) {
        return flattened[0];
      } else {
        return (0, _index.unionTypeAnnotation)(flattened);
      }
    }
  }
});

// node_modules/@babel/types/lib/modifications/typescript/removeTypeDuplicates.js
var require_removeTypeDuplicates2 = __commonJS({
  "node_modules/@babel/types/lib/modifications/typescript/removeTypeDuplicates.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = removeTypeDuplicates;
    var _index = require_generated();
    function getQualifiedName(node) {
      return (0, _index.isIdentifier)(node) ? node.name : (0, _index.isThisExpression)(node) ? "this" : `${node.right.name}.${getQualifiedName(node.left)}`;
    }
    function removeTypeDuplicates(nodesIn) {
      const nodes = Array.from(nodesIn);
      const generics = /* @__PURE__ */ new Map();
      const bases = /* @__PURE__ */ new Map();
      const typeGroups = /* @__PURE__ */ new Set();
      const types2 = [];
      for (let i = 0; i < nodes.length; i++) {
        const node = nodes[i];
        if (!node) continue;
        if (types2.includes(node)) {
          continue;
        }
        if ((0, _index.isTSAnyKeyword)(node)) {
          return [node];
        }
        if ((0, _index.isTSBaseType)(node)) {
          bases.set(node.type, node);
          continue;
        }
        if ((0, _index.isTSUnionType)(node)) {
          if (!typeGroups.has(node.types)) {
            nodes.push(...node.types);
            typeGroups.add(node.types);
          }
          continue;
        }
        const typeArgumentsKey = "typeParameters";
        if ((0, _index.isTSTypeReference)(node) && node[typeArgumentsKey]) {
          const typeArguments = node[typeArgumentsKey];
          const name = getQualifiedName(node.typeName);
          if (generics.has(name)) {
            let existing = generics.get(name);
            const existingTypeArguments = existing[typeArgumentsKey];
            if (existingTypeArguments) {
              existingTypeArguments.params.push(...typeArguments.params);
              existingTypeArguments.params = removeTypeDuplicates(existingTypeArguments.params);
            } else {
              existing = typeArguments;
            }
          } else {
            generics.set(name, node);
          }
          continue;
        }
        types2.push(node);
      }
      for (const [, baseType] of bases) {
        types2.push(baseType);
      }
      for (const [, genericName] of generics) {
        types2.push(genericName);
      }
      return types2;
    }
  }
});

// node_modules/@babel/types/lib/builders/typescript/createTSUnionType.js
var require_createTSUnionType = __commonJS({
  "node_modules/@babel/types/lib/builders/typescript/createTSUnionType.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = createTSUnionType;
    var _index = require_generated2();
    var _removeTypeDuplicates = require_removeTypeDuplicates2();
    var _index2 = require_generated();
    function createTSUnionType(typeAnnotations) {
      const types2 = typeAnnotations.map((type) => {
        return (0, _index2.isTSTypeAnnotation)(type) ? type.typeAnnotation : type;
      });
      const flattened = (0, _removeTypeDuplicates.default)(types2);
      if (flattened.length === 1) {
        return flattened[0];
      } else {
        return (0, _index.tsUnionType)(flattened);
      }
    }
  }
});

// node_modules/@babel/types/lib/builders/productions.js
var require_productions = __commonJS({
  "node_modules/@babel/types/lib/builders/productions.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.buildUndefinedNode = buildUndefinedNode;
    var _index = require_generated2();
    function buildUndefinedNode() {
      return (0, _index.unaryExpression)("void", (0, _index.numericLiteral)(0), true);
    }
  }
});

// node_modules/@babel/types/lib/clone/cloneNode.js
var require_cloneNode = __commonJS({
  "node_modules/@babel/types/lib/clone/cloneNode.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = cloneNode;
    var _index = require_definitions();
    var _index2 = require_generated();
    var {
      hasOwn
    } = {
      hasOwn: Function.call.bind(Object.prototype.hasOwnProperty)
    };
    function cloneIfNode(obj, deep, withoutLoc, commentsCache) {
      if (obj && typeof obj.type === "string") {
        return cloneNodeInternal(obj, deep, withoutLoc, commentsCache);
      }
      return obj;
    }
    function cloneIfNodeOrArray(obj, deep, withoutLoc, commentsCache) {
      if (Array.isArray(obj)) {
        return obj.map((node) => cloneIfNode(node, deep, withoutLoc, commentsCache));
      }
      return cloneIfNode(obj, deep, withoutLoc, commentsCache);
    }
    function cloneNode(node, deep = true, withoutLoc = false) {
      return cloneNodeInternal(node, deep, withoutLoc, /* @__PURE__ */ new Map());
    }
    function cloneNodeInternal(node, deep = true, withoutLoc = false, commentsCache) {
      if (!node) return node;
      const {
        type
      } = node;
      const newNode = {
        type: node.type
      };
      if ((0, _index2.isIdentifier)(node)) {
        newNode.name = node.name;
        if (hasOwn(node, "optional") && typeof node.optional === "boolean") {
          newNode.optional = node.optional;
        }
        if (hasOwn(node, "typeAnnotation")) {
          newNode.typeAnnotation = deep ? cloneIfNodeOrArray(node.typeAnnotation, true, withoutLoc, commentsCache) : node.typeAnnotation;
        }
        if (hasOwn(node, "decorators")) {
          newNode.decorators = deep ? cloneIfNodeOrArray(node.decorators, true, withoutLoc, commentsCache) : node.decorators;
        }
      } else if (!hasOwn(_index.NODE_FIELDS, type)) {
        throw new Error(`Unknown node type: "${type}"`);
      } else {
        for (const field of Object.keys(_index.NODE_FIELDS[type])) {
          if (hasOwn(node, field)) {
            if (deep) {
              newNode[field] = (0, _index2.isFile)(node) && field === "comments" ? maybeCloneComments(node.comments, deep, withoutLoc, commentsCache) : cloneIfNodeOrArray(node[field], true, withoutLoc, commentsCache);
            } else {
              newNode[field] = node[field];
            }
          }
        }
      }
      if (hasOwn(node, "loc")) {
        if (withoutLoc) {
          newNode.loc = null;
        } else {
          newNode.loc = node.loc;
        }
      }
      if (hasOwn(node, "leadingComments")) {
        newNode.leadingComments = maybeCloneComments(node.leadingComments, deep, withoutLoc, commentsCache);
      }
      if (hasOwn(node, "innerComments")) {
        newNode.innerComments = maybeCloneComments(node.innerComments, deep, withoutLoc, commentsCache);
      }
      if (hasOwn(node, "trailingComments")) {
        newNode.trailingComments = maybeCloneComments(node.trailingComments, deep, withoutLoc, commentsCache);
      }
      if (hasOwn(node, "extra")) {
        newNode.extra = Object.assign({}, node.extra);
      }
      return newNode;
    }
    function maybeCloneComments(comments, deep, withoutLoc, commentsCache) {
      if (!comments || !deep) {
        return comments;
      }
      return comments.map((comment) => {
        const cache = commentsCache.get(comment);
        if (cache) return cache;
        const {
          type,
          value: value2,
          loc
        } = comment;
        const ret = {
          type,
          value: value2,
          loc
        };
        if (withoutLoc) {
          ret.loc = null;
        }
        commentsCache.set(comment, ret);
        return ret;
      });
    }
  }
});

// node_modules/@babel/types/lib/clone/clone.js
var require_clone = __commonJS({
  "node_modules/@babel/types/lib/clone/clone.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = clone;
    var _cloneNode = require_cloneNode();
    function clone(node) {
      return (0, _cloneNode.default)(node, false);
    }
  }
});

// node_modules/@babel/types/lib/clone/cloneDeep.js
var require_cloneDeep = __commonJS({
  "node_modules/@babel/types/lib/clone/cloneDeep.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = cloneDeep;
    var _cloneNode = require_cloneNode();
    function cloneDeep(node) {
      return (0, _cloneNode.default)(node);
    }
  }
});

// node_modules/@babel/types/lib/clone/cloneDeepWithoutLoc.js
var require_cloneDeepWithoutLoc = __commonJS({
  "node_modules/@babel/types/lib/clone/cloneDeepWithoutLoc.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = cloneDeepWithoutLoc;
    var _cloneNode = require_cloneNode();
    function cloneDeepWithoutLoc(node) {
      return (0, _cloneNode.default)(node, true, true);
    }
  }
});

// node_modules/@babel/types/lib/clone/cloneWithoutLoc.js
var require_cloneWithoutLoc = __commonJS({
  "node_modules/@babel/types/lib/clone/cloneWithoutLoc.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = cloneWithoutLoc;
    var _cloneNode = require_cloneNode();
    function cloneWithoutLoc(node) {
      return (0, _cloneNode.default)(node, false, true);
    }
  }
});

// node_modules/@babel/types/lib/comments/addComments.js
var require_addComments = __commonJS({
  "node_modules/@babel/types/lib/comments/addComments.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = addComments;
    function addComments(node, type, comments) {
      if (!comments || !node) return node;
      const key = `${type}Comments`;
      if (node[key]) {
        if (type === "leading") {
          node[key] = comments.concat(node[key]);
        } else {
          node[key].push(...comments);
        }
      } else {
        node[key] = comments;
      }
      return node;
    }
  }
});

// node_modules/@babel/types/lib/comments/addComment.js
var require_addComment = __commonJS({
  "node_modules/@babel/types/lib/comments/addComment.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = addComment;
    var _addComments = require_addComments();
    function addComment(node, type, content, line) {
      return (0, _addComments.default)(node, type, [{
        type: line ? "CommentLine" : "CommentBlock",
        value: content
      }]);
    }
  }
});

// node_modules/@babel/types/lib/utils/inherit.js
var require_inherit = __commonJS({
  "node_modules/@babel/types/lib/utils/inherit.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = inherit;
    function inherit(key, child, parent) {
      if (child && parent) {
        child[key] = Array.from(new Set([].concat(child[key], parent[key]).filter(Boolean)));
      }
    }
  }
});

// node_modules/@babel/types/lib/comments/inheritInnerComments.js
var require_inheritInnerComments = __commonJS({
  "node_modules/@babel/types/lib/comments/inheritInnerComments.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = inheritInnerComments;
    var _inherit = require_inherit();
    function inheritInnerComments(child, parent) {
      (0, _inherit.default)("innerComments", child, parent);
    }
  }
});

// node_modules/@babel/types/lib/comments/inheritLeadingComments.js
var require_inheritLeadingComments = __commonJS({
  "node_modules/@babel/types/lib/comments/inheritLeadingComments.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = inheritLeadingComments;
    var _inherit = require_inherit();
    function inheritLeadingComments(child, parent) {
      (0, _inherit.default)("leadingComments", child, parent);
    }
  }
});

// node_modules/@babel/types/lib/comments/inheritTrailingComments.js
var require_inheritTrailingComments = __commonJS({
  "node_modules/@babel/types/lib/comments/inheritTrailingComments.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = inheritTrailingComments;
    var _inherit = require_inherit();
    function inheritTrailingComments(child, parent) {
      (0, _inherit.default)("trailingComments", child, parent);
    }
  }
});

// node_modules/@babel/types/lib/comments/inheritsComments.js
var require_inheritsComments = __commonJS({
  "node_modules/@babel/types/lib/comments/inheritsComments.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = inheritsComments;
    var _inheritTrailingComments = require_inheritTrailingComments();
    var _inheritLeadingComments = require_inheritLeadingComments();
    var _inheritInnerComments = require_inheritInnerComments();
    function inheritsComments(child, parent) {
      (0, _inheritTrailingComments.default)(child, parent);
      (0, _inheritLeadingComments.default)(child, parent);
      (0, _inheritInnerComments.default)(child, parent);
      return child;
    }
  }
});

// node_modules/@babel/types/lib/comments/removeComments.js
var require_removeComments = __commonJS({
  "node_modules/@babel/types/lib/comments/removeComments.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = removeComments;
    var _index = require_constants();
    function removeComments(node) {
      _index.COMMENT_KEYS.forEach((key) => {
        node[key] = null;
      });
      return node;
    }
  }
});

// node_modules/@babel/types/lib/constants/generated/index.js
var require_generated4 = __commonJS({
  "node_modules/@babel/types/lib/constants/generated/index.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.WHILE_TYPES = exports2.USERWHITESPACABLE_TYPES = exports2.UNARYLIKE_TYPES = exports2.TYPESCRIPT_TYPES = exports2.TSTYPE_TYPES = exports2.TSTYPEELEMENT_TYPES = exports2.TSENTITYNAME_TYPES = exports2.TSBASETYPE_TYPES = exports2.TERMINATORLESS_TYPES = exports2.STATEMENT_TYPES = exports2.STANDARDIZED_TYPES = exports2.SCOPABLE_TYPES = exports2.PUREISH_TYPES = exports2.PROPERTY_TYPES = exports2.PRIVATE_TYPES = exports2.PATTERN_TYPES = exports2.PATTERNLIKE_TYPES = exports2.OBJECTMEMBER_TYPES = exports2.MODULESPECIFIER_TYPES = exports2.MODULEDECLARATION_TYPES = exports2.MISCELLANEOUS_TYPES = exports2.METHOD_TYPES = exports2.LVAL_TYPES = exports2.LOOP_TYPES = exports2.LITERAL_TYPES = exports2.JSX_TYPES = exports2.IMPORTOREXPORTDECLARATION_TYPES = exports2.IMMUTABLE_TYPES = exports2.FUNCTION_TYPES = exports2.FUNCTIONPARENT_TYPES = exports2.FUNCTIONPARAMETER_TYPES = exports2.FOR_TYPES = exports2.FORXSTATEMENT_TYPES = exports2.FLOW_TYPES = exports2.FLOWTYPE_TYPES = exports2.FLOWPREDICATE_TYPES = exports2.FLOWDECLARATION_TYPES = exports2.FLOWBASEANNOTATION_TYPES = exports2.EXPRESSION_TYPES = exports2.EXPRESSIONWRAPPER_TYPES = exports2.EXPORTDECLARATION_TYPES = exports2.ENUMMEMBER_TYPES = exports2.ENUMBODY_TYPES = exports2.DECLARATION_TYPES = exports2.CONDITIONAL_TYPES = exports2.COMPLETIONSTATEMENT_TYPES = exports2.CLASS_TYPES = exports2.BLOCK_TYPES = exports2.BLOCKPARENT_TYPES = exports2.BINARY_TYPES = exports2.ACCESSOR_TYPES = void 0;
    var _index = require_definitions();
    var STANDARDIZED_TYPES = exports2.STANDARDIZED_TYPES = _index.FLIPPED_ALIAS_KEYS["Standardized"];
    var EXPRESSION_TYPES = exports2.EXPRESSION_TYPES = _index.FLIPPED_ALIAS_KEYS["Expression"];
    var BINARY_TYPES = exports2.BINARY_TYPES = _index.FLIPPED_ALIAS_KEYS["Binary"];
    var SCOPABLE_TYPES = exports2.SCOPABLE_TYPES = _index.FLIPPED_ALIAS_KEYS["Scopable"];
    var BLOCKPARENT_TYPES = exports2.BLOCKPARENT_TYPES = _index.FLIPPED_ALIAS_KEYS["BlockParent"];
    var BLOCK_TYPES = exports2.BLOCK_TYPES = _index.FLIPPED_ALIAS_KEYS["Block"];
    var STATEMENT_TYPES = exports2.STATEMENT_TYPES = _index.FLIPPED_ALIAS_KEYS["Statement"];
    var TERMINATORLESS_TYPES = exports2.TERMINATORLESS_TYPES = _index.FLIPPED_ALIAS_KEYS["Terminatorless"];
    var COMPLETIONSTATEMENT_TYPES = exports2.COMPLETIONSTATEMENT_TYPES = _index.FLIPPED_ALIAS_KEYS["CompletionStatement"];
    var CONDITIONAL_TYPES = exports2.CONDITIONAL_TYPES = _index.FLIPPED_ALIAS_KEYS["Conditional"];
    var LOOP_TYPES = exports2.LOOP_TYPES = _index.FLIPPED_ALIAS_KEYS["Loop"];
    var WHILE_TYPES = exports2.WHILE_TYPES = _index.FLIPPED_ALIAS_KEYS["While"];
    var EXPRESSIONWRAPPER_TYPES = exports2.EXPRESSIONWRAPPER_TYPES = _index.FLIPPED_ALIAS_KEYS["ExpressionWrapper"];
    var FOR_TYPES = exports2.FOR_TYPES = _index.FLIPPED_ALIAS_KEYS["For"];
    var FORXSTATEMENT_TYPES = exports2.FORXSTATEMENT_TYPES = _index.FLIPPED_ALIAS_KEYS["ForXStatement"];
    var FUNCTION_TYPES = exports2.FUNCTION_TYPES = _index.FLIPPED_ALIAS_KEYS["Function"];
    var FUNCTIONPARENT_TYPES = exports2.FUNCTIONPARENT_TYPES = _index.FLIPPED_ALIAS_KEYS["FunctionParent"];
    var PUREISH_TYPES = exports2.PUREISH_TYPES = _index.FLIPPED_ALIAS_KEYS["Pureish"];
    var DECLARATION_TYPES = exports2.DECLARATION_TYPES = _index.FLIPPED_ALIAS_KEYS["Declaration"];
    var FUNCTIONPARAMETER_TYPES = exports2.FUNCTIONPARAMETER_TYPES = _index.FLIPPED_ALIAS_KEYS["FunctionParameter"];
    var PATTERNLIKE_TYPES = exports2.PATTERNLIKE_TYPES = _index.FLIPPED_ALIAS_KEYS["PatternLike"];
    var LVAL_TYPES = exports2.LVAL_TYPES = _index.FLIPPED_ALIAS_KEYS["LVal"];
    var TSENTITYNAME_TYPES = exports2.TSENTITYNAME_TYPES = _index.FLIPPED_ALIAS_KEYS["TSEntityName"];
    var LITERAL_TYPES = exports2.LITERAL_TYPES = _index.FLIPPED_ALIAS_KEYS["Literal"];
    var IMMUTABLE_TYPES = exports2.IMMUTABLE_TYPES = _index.FLIPPED_ALIAS_KEYS["Immutable"];
    var USERWHITESPACABLE_TYPES = exports2.USERWHITESPACABLE_TYPES = _index.FLIPPED_ALIAS_KEYS["UserWhitespacable"];
    var METHOD_TYPES = exports2.METHOD_TYPES = _index.FLIPPED_ALIAS_KEYS["Method"];
    var OBJECTMEMBER_TYPES = exports2.OBJECTMEMBER_TYPES = _index.FLIPPED_ALIAS_KEYS["ObjectMember"];
    var PROPERTY_TYPES = exports2.PROPERTY_TYPES = _index.FLIPPED_ALIAS_KEYS["Property"];
    var UNARYLIKE_TYPES = exports2.UNARYLIKE_TYPES = _index.FLIPPED_ALIAS_KEYS["UnaryLike"];
    var PATTERN_TYPES = exports2.PATTERN_TYPES = _index.FLIPPED_ALIAS_KEYS["Pattern"];
    var CLASS_TYPES = exports2.CLASS_TYPES = _index.FLIPPED_ALIAS_KEYS["Class"];
    var IMPORTOREXPORTDECLARATION_TYPES = exports2.IMPORTOREXPORTDECLARATION_TYPES = _index.FLIPPED_ALIAS_KEYS["ImportOrExportDeclaration"];
    var EXPORTDECLARATION_TYPES = exports2.EXPORTDECLARATION_TYPES = _index.FLIPPED_ALIAS_KEYS["ExportDeclaration"];
    var MODULESPECIFIER_TYPES = exports2.MODULESPECIFIER_TYPES = _index.FLIPPED_ALIAS_KEYS["ModuleSpecifier"];
    var ACCESSOR_TYPES = exports2.ACCESSOR_TYPES = _index.FLIPPED_ALIAS_KEYS["Accessor"];
    var PRIVATE_TYPES = exports2.PRIVATE_TYPES = _index.FLIPPED_ALIAS_KEYS["Private"];
    var FLOW_TYPES = exports2.FLOW_TYPES = _index.FLIPPED_ALIAS_KEYS["Flow"];
    var FLOWTYPE_TYPES = exports2.FLOWTYPE_TYPES = _index.FLIPPED_ALIAS_KEYS["FlowType"];
    var FLOWBASEANNOTATION_TYPES = exports2.FLOWBASEANNOTATION_TYPES = _index.FLIPPED_ALIAS_KEYS["FlowBaseAnnotation"];
    var FLOWDECLARATION_TYPES = exports2.FLOWDECLARATION_TYPES = _index.FLIPPED_ALIAS_KEYS["FlowDeclaration"];
    var FLOWPREDICATE_TYPES = exports2.FLOWPREDICATE_TYPES = _index.FLIPPED_ALIAS_KEYS["FlowPredicate"];
    var ENUMBODY_TYPES = exports2.ENUMBODY_TYPES = _index.FLIPPED_ALIAS_KEYS["EnumBody"];
    var ENUMMEMBER_TYPES = exports2.ENUMMEMBER_TYPES = _index.FLIPPED_ALIAS_KEYS["EnumMember"];
    var JSX_TYPES = exports2.JSX_TYPES = _index.FLIPPED_ALIAS_KEYS["JSX"];
    var MISCELLANEOUS_TYPES = exports2.MISCELLANEOUS_TYPES = _index.FLIPPED_ALIAS_KEYS["Miscellaneous"];
    var TYPESCRIPT_TYPES = exports2.TYPESCRIPT_TYPES = _index.FLIPPED_ALIAS_KEYS["TypeScript"];
    var TSTYPEELEMENT_TYPES = exports2.TSTYPEELEMENT_TYPES = _index.FLIPPED_ALIAS_KEYS["TSTypeElement"];
    var TSTYPE_TYPES = exports2.TSTYPE_TYPES = _index.FLIPPED_ALIAS_KEYS["TSType"];
    var TSBASETYPE_TYPES = exports2.TSBASETYPE_TYPES = _index.FLIPPED_ALIAS_KEYS["TSBaseType"];
    var MODULEDECLARATION_TYPES = exports2.MODULEDECLARATION_TYPES = IMPORTOREXPORTDECLARATION_TYPES;
  }
});

// node_modules/@babel/types/lib/converters/toBlock.js
var require_toBlock = __commonJS({
  "node_modules/@babel/types/lib/converters/toBlock.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = toBlock;
    var _index = require_generated();
    var _index2 = require_generated2();
    function toBlock(node, parent) {
      if ((0, _index.isBlockStatement)(node)) {
        return node;
      }
      let blockNodes = [];
      if ((0, _index.isEmptyStatement)(node)) {
        blockNodes = [];
      } else {
        if (!(0, _index.isStatement)(node)) {
          if ((0, _index.isFunction)(parent)) {
            node = (0, _index2.returnStatement)(node);
          } else {
            node = (0, _index2.expressionStatement)(node);
          }
        }
        blockNodes = [node];
      }
      return (0, _index2.blockStatement)(blockNodes);
    }
  }
});

// node_modules/@babel/types/lib/converters/ensureBlock.js
var require_ensureBlock = __commonJS({
  "node_modules/@babel/types/lib/converters/ensureBlock.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = ensureBlock;
    var _toBlock = require_toBlock();
    function ensureBlock(node, key = "body") {
      const result = (0, _toBlock.default)(node[key], node);
      node[key] = result;
      return result;
    }
  }
});

// node_modules/@babel/types/lib/converters/toIdentifier.js
var require_toIdentifier = __commonJS({
  "node_modules/@babel/types/lib/converters/toIdentifier.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = toIdentifier;
    var _isValidIdentifier = require_isValidIdentifier();
    var _helperValidatorIdentifier = require_lib();
    function toIdentifier(input) {
      input = input + "";
      let name = "";
      for (const c of input) {
        name += (0, _helperValidatorIdentifier.isIdentifierChar)(c.codePointAt(0)) ? c : "-";
      }
      name = name.replace(/^[-0-9]+/, "");
      name = name.replace(/[-\s]+(.)?/g, function(match, c) {
        return c ? c.toUpperCase() : "";
      });
      if (!(0, _isValidIdentifier.default)(name)) {
        name = `_${name}`;
      }
      return name || "_";
    }
  }
});

// node_modules/@babel/types/lib/converters/toBindingIdentifierName.js
var require_toBindingIdentifierName = __commonJS({
  "node_modules/@babel/types/lib/converters/toBindingIdentifierName.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = toBindingIdentifierName;
    var _toIdentifier = require_toIdentifier();
    function toBindingIdentifierName(name) {
      name = (0, _toIdentifier.default)(name);
      if (name === "eval" || name === "arguments") name = "_" + name;
      return name;
    }
  }
});

// node_modules/@babel/types/lib/converters/toComputedKey.js
var require_toComputedKey = __commonJS({
  "node_modules/@babel/types/lib/converters/toComputedKey.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = toComputedKey;
    var _index = require_generated();
    var _index2 = require_generated2();
    function toComputedKey(node, key = node.key || node.property) {
      if (!node.computed && (0, _index.isIdentifier)(key)) key = (0, _index2.stringLiteral)(key.name);
      return key;
    }
  }
});

// node_modules/@babel/types/lib/converters/toExpression.js
var require_toExpression = __commonJS({
  "node_modules/@babel/types/lib/converters/toExpression.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = void 0;
    var _index = require_generated();
    var _default = exports2.default = toExpression;
    function toExpression(node) {
      if ((0, _index.isExpressionStatement)(node)) {
        node = node.expression;
      }
      if ((0, _index.isExpression)(node)) {
        return node;
      }
      if ((0, _index.isClass)(node)) {
        node.type = "ClassExpression";
        node.abstract = false;
      } else if ((0, _index.isFunction)(node)) {
        node.type = "FunctionExpression";
      }
      if (!(0, _index.isExpression)(node)) {
        throw new Error(`cannot turn ${node.type} to an expression`);
      }
      return node;
    }
  }
});

// node_modules/@babel/types/lib/traverse/traverseFast.js
var require_traverseFast = __commonJS({
  "node_modules/@babel/types/lib/traverse/traverseFast.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = traverseFast;
    var _index = require_definitions();
    var _skip = Symbol();
    var _stop = Symbol();
    function traverseFast(node, enter, opts) {
      if (!node) return false;
      const keys = _index.VISITOR_KEYS[node.type];
      if (!keys) return false;
      opts = opts || {};
      const ret = enter(node, opts);
      if (ret !== void 0) {
        switch (ret) {
          case _skip:
            return false;
          case _stop:
            return true;
        }
      }
      for (const key of keys) {
        const subNode = node[key];
        if (!subNode) continue;
        if (Array.isArray(subNode)) {
          for (const node2 of subNode) {
            if (traverseFast(node2, enter, opts)) return true;
          }
        } else {
          if (traverseFast(subNode, enter, opts)) return true;
        }
      }
      return false;
    }
    traverseFast.skip = _skip;
    traverseFast.stop = _stop;
  }
});

// node_modules/@babel/types/lib/modifications/removeProperties.js
var require_removeProperties = __commonJS({
  "node_modules/@babel/types/lib/modifications/removeProperties.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = removeProperties;
    var _index = require_constants();
    var CLEAR_KEYS = ["tokens", "start", "end", "loc", "raw", "rawValue"];
    var CLEAR_KEYS_PLUS_COMMENTS = [..._index.COMMENT_KEYS, "comments", ...CLEAR_KEYS];
    function removeProperties(node, opts = {}) {
      const map = opts.preserveComments ? CLEAR_KEYS : CLEAR_KEYS_PLUS_COMMENTS;
      for (const key of map) {
        if (node[key] != null) node[key] = void 0;
      }
      for (const key of Object.keys(node)) {
        if (key.startsWith("_") && node[key] != null) node[key] = void 0;
      }
      const symbols = Object.getOwnPropertySymbols(node);
      for (const sym of symbols) {
        node[sym] = null;
      }
    }
  }
});

// node_modules/@babel/types/lib/modifications/removePropertiesDeep.js
var require_removePropertiesDeep = __commonJS({
  "node_modules/@babel/types/lib/modifications/removePropertiesDeep.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = removePropertiesDeep;
    var _traverseFast = require_traverseFast();
    var _removeProperties = require_removeProperties();
    function removePropertiesDeep(tree, opts) {
      (0, _traverseFast.default)(tree, _removeProperties.default, opts);
      return tree;
    }
  }
});

// node_modules/@babel/types/lib/converters/toKeyAlias.js
var require_toKeyAlias = __commonJS({
  "node_modules/@babel/types/lib/converters/toKeyAlias.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = toKeyAlias;
    var _index = require_generated();
    var _cloneNode = require_cloneNode();
    var _removePropertiesDeep = require_removePropertiesDeep();
    function toKeyAlias(node, key = node.key) {
      let alias;
      if (node.kind === "method") {
        return toKeyAlias.increment() + "";
      } else if ((0, _index.isIdentifier)(key)) {
        alias = key.name;
      } else if ((0, _index.isStringLiteral)(key)) {
        alias = JSON.stringify(key.value);
      } else {
        alias = JSON.stringify((0, _removePropertiesDeep.default)((0, _cloneNode.default)(key)));
      }
      if (node.computed) {
        alias = `[${alias}]`;
      }
      if (node.static) {
        alias = `static:${alias}`;
      }
      return alias;
    }
    toKeyAlias.uid = 0;
    toKeyAlias.increment = function() {
      if (toKeyAlias.uid >= Number.MAX_SAFE_INTEGER) {
        return toKeyAlias.uid = 0;
      } else {
        return toKeyAlias.uid++;
      }
    };
  }
});

// node_modules/@babel/types/lib/converters/toStatement.js
var require_toStatement = __commonJS({
  "node_modules/@babel/types/lib/converters/toStatement.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = void 0;
    var _index = require_generated();
    var _index2 = require_generated2();
    var _default = exports2.default = toStatement;
    function toStatement(node, ignore) {
      if ((0, _index.isStatement)(node)) {
        return node;
      }
      let mustHaveId = false;
      let newType;
      if ((0, _index.isClass)(node)) {
        mustHaveId = true;
        newType = "ClassDeclaration";
      } else if ((0, _index.isFunction)(node)) {
        mustHaveId = true;
        newType = "FunctionDeclaration";
      } else if ((0, _index.isAssignmentExpression)(node)) {
        return (0, _index2.expressionStatement)(node);
      }
      if (mustHaveId && !node.id) {
        newType = false;
      }
      if (!newType) {
        if (ignore) {
          return false;
        } else {
          throw new Error(`cannot turn ${node.type} to a statement`);
        }
      }
      node.type = newType;
      return node;
    }
  }
});

// node_modules/@babel/types/lib/converters/valueToNode.js
var require_valueToNode = __commonJS({
  "node_modules/@babel/types/lib/converters/valueToNode.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = void 0;
    var _isValidIdentifier = require_isValidIdentifier();
    var _index = require_generated2();
    var _default = exports2.default = valueToNode;
    var objectToString = Function.call.bind(Object.prototype.toString);
    function isRegExp(value2) {
      return objectToString(value2) === "[object RegExp]";
    }
    function isPlainObject(value2) {
      if (typeof value2 !== "object" || value2 === null || Object.prototype.toString.call(value2) !== "[object Object]") {
        return false;
      }
      const proto = Object.getPrototypeOf(value2);
      return proto === null || Object.getPrototypeOf(proto) === null;
    }
    function valueToNode(value2) {
      if (value2 === void 0) {
        return (0, _index.identifier)("undefined");
      }
      if (value2 === true || value2 === false) {
        return (0, _index.booleanLiteral)(value2);
      }
      if (value2 === null) {
        return (0, _index.nullLiteral)();
      }
      if (typeof value2 === "string") {
        return (0, _index.stringLiteral)(value2);
      }
      if (typeof value2 === "number") {
        let result;
        if (Number.isFinite(value2)) {
          result = (0, _index.numericLiteral)(Math.abs(value2));
        } else {
          let numerator;
          if (Number.isNaN(value2)) {
            numerator = (0, _index.numericLiteral)(0);
          } else {
            numerator = (0, _index.numericLiteral)(1);
          }
          result = (0, _index.binaryExpression)("/", numerator, (0, _index.numericLiteral)(0));
        }
        if (value2 < 0 || Object.is(value2, -0)) {
          result = (0, _index.unaryExpression)("-", result);
        }
        return result;
      }
      if (typeof value2 === "bigint") {
        if (value2 < 0) {
          return (0, _index.unaryExpression)("-", (0, _index.bigIntLiteral)(-value2));
        } else {
          return (0, _index.bigIntLiteral)(value2);
        }
      }
      if (isRegExp(value2)) {
        const pattern = value2.source;
        const flags = /\/([a-z]*)$/.exec(value2.toString())[1];
        return (0, _index.regExpLiteral)(pattern, flags);
      }
      if (Array.isArray(value2)) {
        return (0, _index.arrayExpression)(value2.map(valueToNode));
      }
      if (isPlainObject(value2)) {
        const props = [];
        for (const key of Object.keys(value2)) {
          let nodeKey, computed = false;
          if ((0, _isValidIdentifier.default)(key)) {
            if (key === "__proto__") {
              computed = true;
              nodeKey = (0, _index.stringLiteral)(key);
            } else {
              nodeKey = (0, _index.identifier)(key);
            }
          } else {
            nodeKey = (0, _index.stringLiteral)(key);
          }
          props.push((0, _index.objectProperty)(nodeKey, valueToNode(value2[key]), computed));
        }
        return (0, _index.objectExpression)(props);
      }
      throw new Error("don't know how to turn this value into a node");
    }
  }
});

// node_modules/@babel/types/lib/modifications/appendToMemberExpression.js
var require_appendToMemberExpression = __commonJS({
  "node_modules/@babel/types/lib/modifications/appendToMemberExpression.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = appendToMemberExpression;
    var _index = require_generated2();
    function appendToMemberExpression(member, append, computed = false) {
      member.object = (0, _index.memberExpression)(member.object, member.property, member.computed);
      member.property = append;
      member.computed = !!computed;
      return member;
    }
  }
});

// node_modules/@babel/types/lib/modifications/inherits.js
var require_inherits = __commonJS({
  "node_modules/@babel/types/lib/modifications/inherits.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = inherits;
    var _index = require_constants();
    var _inheritsComments = require_inheritsComments();
    function inherits(child, parent) {
      if (!child || !parent) return child;
      for (const key of _index.INHERIT_KEYS.optional) {
        if (child[key] == null) {
          child[key] = parent[key];
        }
      }
      for (const key of Object.keys(parent)) {
        if (key.startsWith("_") && key !== "__clone") {
          child[key] = parent[key];
        }
      }
      for (const key of _index.INHERIT_KEYS.force) {
        child[key] = parent[key];
      }
      (0, _inheritsComments.default)(child, parent);
      return child;
    }
  }
});

// node_modules/@babel/types/lib/modifications/prependToMemberExpression.js
var require_prependToMemberExpression = __commonJS({
  "node_modules/@babel/types/lib/modifications/prependToMemberExpression.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = prependToMemberExpression;
    var _index = require_generated2();
    var _index2 = require_lib3();
    function prependToMemberExpression(member, prepend) {
      if ((0, _index2.isSuper)(member.object)) {
        throw new Error("Cannot prepend node to super property access (`super.foo`).");
      }
      member.object = (0, _index.memberExpression)(prepend, member.object);
      return member;
    }
  }
});

// node_modules/@babel/types/lib/retrievers/getAssignmentIdentifiers.js
var require_getAssignmentIdentifiers = __commonJS({
  "node_modules/@babel/types/lib/retrievers/getAssignmentIdentifiers.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = getAssignmentIdentifiers;
    function getAssignmentIdentifiers(node) {
      const search = [].concat(node);
      const ids = /* @__PURE__ */ Object.create(null);
      while (search.length) {
        const id = search.pop();
        if (!id) continue;
        switch (id.type) {
          case "ArrayPattern":
            search.push(...id.elements);
            break;
          case "AssignmentExpression":
          case "AssignmentPattern":
          case "ForInStatement":
          case "ForOfStatement":
            search.push(id.left);
            break;
          case "ObjectPattern":
            search.push(...id.properties);
            break;
          case "ObjectProperty":
            search.push(id.value);
            break;
          case "RestElement":
          case "UpdateExpression":
            search.push(id.argument);
            break;
          case "UnaryExpression":
            if (id.operator === "delete") {
              search.push(id.argument);
            }
            break;
          case "Identifier":
            ids[id.name] = id;
            break;
          default:
            break;
        }
      }
      return ids;
    }
  }
});

// node_modules/@babel/types/lib/retrievers/getBindingIdentifiers.js
var require_getBindingIdentifiers = __commonJS({
  "node_modules/@babel/types/lib/retrievers/getBindingIdentifiers.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = getBindingIdentifiers;
    var _index = require_generated();
    function getBindingIdentifiers(node, duplicates, outerOnly, newBindingsOnly) {
      const search = [].concat(node);
      const ids = /* @__PURE__ */ Object.create(null);
      while (search.length) {
        const id = search.shift();
        if (!id) continue;
        if (newBindingsOnly && ((0, _index.isAssignmentExpression)(id) || (0, _index.isUnaryExpression)(id) || (0, _index.isUpdateExpression)(id))) {
          continue;
        }
        if ((0, _index.isIdentifier)(id)) {
          if (duplicates) {
            const _ids = ids[id.name] = ids[id.name] || [];
            _ids.push(id);
          } else {
            ids[id.name] = id;
          }
          continue;
        }
        if ((0, _index.isExportDeclaration)(id) && !(0, _index.isExportAllDeclaration)(id)) {
          if ((0, _index.isDeclaration)(id.declaration)) {
            search.push(id.declaration);
          }
          continue;
        }
        if (outerOnly) {
          if ((0, _index.isFunctionDeclaration)(id)) {
            search.push(id.id);
            continue;
          }
          if ((0, _index.isFunctionExpression)(id)) {
            continue;
          }
        }
        const keys2 = getBindingIdentifiers.keys[id.type];
        if (keys2) {
          for (let i = 0; i < keys2.length; i++) {
            const key = keys2[i];
            const nodes = id[key];
            if (nodes) {
              if (Array.isArray(nodes)) {
                search.push(...nodes);
              } else {
                search.push(nodes);
              }
            }
          }
        }
      }
      return ids;
    }
    var keys = {
      DeclareClass: ["id"],
      DeclareFunction: ["id"],
      DeclareModule: ["id"],
      DeclareVariable: ["id"],
      DeclareInterface: ["id"],
      DeclareTypeAlias: ["id"],
      DeclareOpaqueType: ["id"],
      InterfaceDeclaration: ["id"],
      TypeAlias: ["id"],
      OpaqueType: ["id"],
      CatchClause: ["param"],
      LabeledStatement: ["label"],
      UnaryExpression: ["argument"],
      AssignmentExpression: ["left"],
      ImportSpecifier: ["local"],
      ImportNamespaceSpecifier: ["local"],
      ImportDefaultSpecifier: ["local"],
      ImportDeclaration: ["specifiers"],
      TSImportEqualsDeclaration: ["id"],
      ExportSpecifier: ["exported"],
      ExportNamespaceSpecifier: ["exported"],
      ExportDefaultSpecifier: ["exported"],
      FunctionDeclaration: ["id", "params"],
      FunctionExpression: ["id", "params"],
      ArrowFunctionExpression: ["params"],
      ObjectMethod: ["params"],
      ClassMethod: ["params"],
      ClassPrivateMethod: ["params"],
      ForInStatement: ["left"],
      ForOfStatement: ["left"],
      ClassDeclaration: ["id"],
      ClassExpression: ["id"],
      RestElement: ["argument"],
      UpdateExpression: ["argument"],
      ObjectProperty: ["value"],
      AssignmentPattern: ["left"],
      ArrayPattern: ["elements"],
      ObjectPattern: ["properties"],
      VariableDeclaration: ["declarations"],
      VariableDeclarator: ["id"]
    };
    getBindingIdentifiers.keys = keys;
  }
});

// node_modules/@babel/types/lib/retrievers/getOuterBindingIdentifiers.js
var require_getOuterBindingIdentifiers = __commonJS({
  "node_modules/@babel/types/lib/retrievers/getOuterBindingIdentifiers.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = void 0;
    var _getBindingIdentifiers = require_getBindingIdentifiers();
    var _default = exports2.default = getOuterBindingIdentifiers;
    function getOuterBindingIdentifiers(node, duplicates) {
      return (0, _getBindingIdentifiers.default)(node, duplicates, true);
    }
  }
});

// node_modules/@babel/types/lib/retrievers/getFunctionName.js
var require_getFunctionName = __commonJS({
  "node_modules/@babel/types/lib/retrievers/getFunctionName.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = getFunctionName;
    var _index = require_generated();
    function getNameFromLiteralId(id) {
      if ((0, _index.isNullLiteral)(id)) {
        return "null";
      }
      if ((0, _index.isRegExpLiteral)(id)) {
        return `/${id.pattern}/${id.flags}`;
      }
      if ((0, _index.isTemplateLiteral)(id)) {
        return id.quasis.map((quasi) => quasi.value.raw).join("");
      }
      if (id.value !== void 0) {
        return String(id.value);
      }
      return null;
    }
    function getObjectMemberKey(node) {
      if (!node.computed || (0, _index.isLiteral)(node.key)) {
        return node.key;
      }
    }
    function getFunctionName(node, parent) {
      if ("id" in node && node.id) {
        return {
          name: node.id.name,
          originalNode: node.id
        };
      }
      let prefix = "";
      let id;
      if ((0, _index.isObjectProperty)(parent, {
        value: node
      })) {
        id = getObjectMemberKey(parent);
      } else if ((0, _index.isObjectMethod)(node) || (0, _index.isClassMethod)(node)) {
        id = getObjectMemberKey(node);
        if (node.kind === "get") prefix = "get ";
        else if (node.kind === "set") prefix = "set ";
      } else if ((0, _index.isVariableDeclarator)(parent, {
        init: node
      })) {
        id = parent.id;
      } else if ((0, _index.isAssignmentExpression)(parent, {
        operator: "=",
        right: node
      })) {
        id = parent.left;
      }
      if (!id) return null;
      const name = (0, _index.isLiteral)(id) ? getNameFromLiteralId(id) : (0, _index.isIdentifier)(id) ? id.name : (0, _index.isPrivateName)(id) ? id.id.name : null;
      if (name == null) return null;
      return {
        name: prefix + name,
        originalNode: id
      };
    }
  }
});

// node_modules/@babel/types/lib/traverse/traverse.js
var require_traverse = __commonJS({
  "node_modules/@babel/types/lib/traverse/traverse.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = traverse2;
    var _index = require_definitions();
    function traverse2(node, handlers, state) {
      if (typeof handlers === "function") {
        handlers = {
          enter: handlers
        };
      }
      const {
        enter,
        exit
      } = handlers;
      traverseSimpleImpl(node, enter, exit, state, []);
    }
    function traverseSimpleImpl(node, enter, exit, state, ancestors) {
      const keys = _index.VISITOR_KEYS[node.type];
      if (!keys) return;
      if (enter) enter(node, ancestors, state);
      for (const key of keys) {
        const subNode = node[key];
        if (Array.isArray(subNode)) {
          for (let i = 0; i < subNode.length; i++) {
            const child = subNode[i];
            if (!child) continue;
            ancestors.push({
              node,
              key,
              index: i
            });
            traverseSimpleImpl(child, enter, exit, state, ancestors);
            ancestors.pop();
          }
        } else if (subNode) {
          ancestors.push({
            node,
            key
          });
          traverseSimpleImpl(subNode, enter, exit, state, ancestors);
          ancestors.pop();
        }
      }
      if (exit) exit(node, ancestors, state);
    }
  }
});

// node_modules/@babel/types/lib/validators/isBinding.js
var require_isBinding = __commonJS({
  "node_modules/@babel/types/lib/validators/isBinding.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = isBinding;
    var _getBindingIdentifiers = require_getBindingIdentifiers();
    function isBinding(node, parent, grandparent) {
      if (grandparent && node.type === "Identifier" && parent.type === "ObjectProperty" && grandparent.type === "ObjectExpression") {
        return false;
      }
      const keys = _getBindingIdentifiers.default.keys[parent.type];
      if (keys) {
        for (let i = 0; i < keys.length; i++) {
          const key = keys[i];
          const val = parent[key];
          if (Array.isArray(val)) {
            if (val.includes(node)) return true;
          } else {
            if (val === node) return true;
          }
        }
      }
      return false;
    }
  }
});

// node_modules/@babel/types/lib/validators/isLet.js
var require_isLet = __commonJS({
  "node_modules/@babel/types/lib/validators/isLet.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = isLet;
    var _index = require_generated();
    var BLOCK_SCOPED_SYMBOL = Symbol.for("var used to be block scoped");
    function isLet(node) {
      return (0, _index.isVariableDeclaration)(node) && (node.kind !== "var" || node[BLOCK_SCOPED_SYMBOL]);
    }
  }
});

// node_modules/@babel/types/lib/validators/isBlockScoped.js
var require_isBlockScoped = __commonJS({
  "node_modules/@babel/types/lib/validators/isBlockScoped.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = isBlockScoped;
    var _index = require_generated();
    var _isLet = require_isLet();
    function isBlockScoped(node) {
      return (0, _index.isFunctionDeclaration)(node) || (0, _index.isClassDeclaration)(node) || (0, _isLet.default)(node);
    }
  }
});

// node_modules/@babel/types/lib/validators/isImmutable.js
var require_isImmutable = __commonJS({
  "node_modules/@babel/types/lib/validators/isImmutable.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = isImmutable;
    var _isType = require_isType();
    var _index = require_generated();
    function isImmutable(node) {
      if ((0, _isType.default)(node.type, "Immutable")) return true;
      if ((0, _index.isIdentifier)(node)) {
        if (node.name === "undefined") {
          return true;
        } else {
          return false;
        }
      }
      return false;
    }
  }
});

// node_modules/@babel/types/lib/validators/isNodesEquivalent.js
var require_isNodesEquivalent = __commonJS({
  "node_modules/@babel/types/lib/validators/isNodesEquivalent.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = isNodesEquivalent;
    var _index = require_definitions();
    function isNodesEquivalent(a, b) {
      if (typeof a !== "object" || typeof b !== "object" || a == null || b == null) {
        return a === b;
      }
      if (a.type !== b.type) {
        return false;
      }
      const fields = Object.keys(_index.NODE_FIELDS[a.type] || a.type);
      const visitorKeys = _index.VISITOR_KEYS[a.type];
      for (const field of fields) {
        const val_a = a[field];
        const val_b = b[field];
        if (typeof val_a !== typeof val_b) {
          return false;
        }
        if (val_a == null && val_b == null) {
          continue;
        } else if (val_a == null || val_b == null) {
          return false;
        }
        if (Array.isArray(val_a)) {
          if (!Array.isArray(val_b)) {
            return false;
          }
          if (val_a.length !== val_b.length) {
            return false;
          }
          for (let i = 0; i < val_a.length; i++) {
            if (!isNodesEquivalent(val_a[i], val_b[i])) {
              return false;
            }
          }
          continue;
        }
        if (typeof val_a === "object" && !(visitorKeys != null && visitorKeys.includes(field))) {
          for (const key of Object.keys(val_a)) {
            if (val_a[key] !== val_b[key]) {
              return false;
            }
          }
          continue;
        }
        if (!isNodesEquivalent(val_a, val_b)) {
          return false;
        }
      }
      return true;
    }
  }
});

// node_modules/@babel/types/lib/validators/isReferenced.js
var require_isReferenced = __commonJS({
  "node_modules/@babel/types/lib/validators/isReferenced.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = isReferenced;
    function isReferenced(node, parent, grandparent) {
      switch (parent.type) {
        case "MemberExpression":
        case "OptionalMemberExpression":
          if (parent.property === node) {
            return !!parent.computed;
          }
          return parent.object === node;
        case "JSXMemberExpression":
          return parent.object === node;
        case "VariableDeclarator":
          return parent.init === node;
        case "ArrowFunctionExpression":
          return parent.body === node;
        case "PrivateName":
          return false;
        case "ClassMethod":
        case "ClassPrivateMethod":
        case "ObjectMethod":
          if (parent.key === node) {
            return !!parent.computed;
          }
          return false;
        case "ObjectProperty":
          if (parent.key === node) {
            return !!parent.computed;
          }
          return (grandparent == null ? void 0 : grandparent.type) !== "ObjectPattern";
        case "ClassProperty":
        case "ClassAccessorProperty":
          if (parent.key === node) {
            return !!parent.computed;
          }
          return true;
        case "ClassPrivateProperty":
          return parent.key !== node;
        case "ClassDeclaration":
        case "ClassExpression":
          return parent.superClass === node;
        case "AssignmentExpression":
          return parent.right === node;
        case "AssignmentPattern":
          return parent.right === node;
        case "LabeledStatement":
          return false;
        case "CatchClause":
          return false;
        case "RestElement":
          return false;
        case "BreakStatement":
        case "ContinueStatement":
          return false;
        case "FunctionDeclaration":
        case "FunctionExpression":
          return false;
        case "ExportNamespaceSpecifier":
        case "ExportDefaultSpecifier":
          return false;
        case "ExportSpecifier":
          if (grandparent != null && grandparent.source) {
            return false;
          }
          return parent.local === node;
        case "ImportDefaultSpecifier":
        case "ImportNamespaceSpecifier":
        case "ImportSpecifier":
          return false;
        case "ImportAttribute":
          return false;
        case "JSXAttribute":
          return false;
        case "ObjectPattern":
        case "ArrayPattern":
          return false;
        case "MetaProperty":
          return false;
        case "ObjectTypeProperty":
          return parent.key !== node;
        case "TSEnumMember":
          return parent.id !== node;
        case "TSPropertySignature":
          if (parent.key === node) {
            return !!parent.computed;
          }
          return true;
      }
      return true;
    }
  }
});

// node_modules/@babel/types/lib/validators/isScope.js
var require_isScope = __commonJS({
  "node_modules/@babel/types/lib/validators/isScope.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = isScope;
    var _index = require_generated();
    function isScope(node, parent) {
      if ((0, _index.isBlockStatement)(node) && ((0, _index.isFunction)(parent) || (0, _index.isCatchClause)(parent))) {
        return false;
      }
      if ((0, _index.isPattern)(node) && ((0, _index.isFunction)(parent) || (0, _index.isCatchClause)(parent))) {
        return true;
      }
      return (0, _index.isScopable)(node);
    }
  }
});

// node_modules/@babel/types/lib/validators/isSpecifierDefault.js
var require_isSpecifierDefault = __commonJS({
  "node_modules/@babel/types/lib/validators/isSpecifierDefault.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = isSpecifierDefault;
    var _index = require_generated();
    function isSpecifierDefault(specifier) {
      return (0, _index.isImportDefaultSpecifier)(specifier) || (0, _index.isIdentifier)(specifier.imported || specifier.exported, {
        name: "default"
      });
    }
  }
});

// node_modules/@babel/types/lib/validators/isValidES3Identifier.js
var require_isValidES3Identifier = __commonJS({
  "node_modules/@babel/types/lib/validators/isValidES3Identifier.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = isValidES3Identifier;
    var _isValidIdentifier = require_isValidIdentifier();
    var RESERVED_WORDS_ES3_ONLY = /* @__PURE__ */ new Set(["abstract", "boolean", "byte", "char", "double", "enum", "final", "float", "goto", "implements", "int", "interface", "long", "native", "package", "private", "protected", "public", "short", "static", "synchronized", "throws", "transient", "volatile"]);
    function isValidES3Identifier(name) {
      return (0, _isValidIdentifier.default)(name) && !RESERVED_WORDS_ES3_ONLY.has(name);
    }
  }
});

// node_modules/@babel/types/lib/validators/isVar.js
var require_isVar = __commonJS({
  "node_modules/@babel/types/lib/validators/isVar.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = isVar;
    var _index = require_generated();
    var BLOCK_SCOPED_SYMBOL = Symbol.for("var used to be block scoped");
    function isVar(node) {
      return (0, _index.isVariableDeclaration)(node, {
        kind: "var"
      }) && !node[BLOCK_SCOPED_SYMBOL];
    }
  }
});

// node_modules/@babel/types/lib/converters/gatherSequenceExpressions.js
var require_gatherSequenceExpressions = __commonJS({
  "node_modules/@babel/types/lib/converters/gatherSequenceExpressions.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = gatherSequenceExpressions;
    var _getBindingIdentifiers = require_getBindingIdentifiers();
    var _index = require_generated();
    var _index2 = require_generated2();
    var _productions = require_productions();
    var _cloneNode = require_cloneNode();
    function gatherSequenceExpressions(nodes, declars) {
      const exprs = [];
      let ensureLastUndefined = true;
      for (const node of nodes) {
        if (!(0, _index.isEmptyStatement)(node)) {
          ensureLastUndefined = false;
        }
        if ((0, _index.isExpression)(node)) {
          exprs.push(node);
        } else if ((0, _index.isExpressionStatement)(node)) {
          exprs.push(node.expression);
        } else if ((0, _index.isVariableDeclaration)(node)) {
          if (node.kind !== "var") return;
          for (const declar of node.declarations) {
            const bindings = (0, _getBindingIdentifiers.default)(declar);
            for (const key of Object.keys(bindings)) {
              declars.push({
                kind: node.kind,
                id: (0, _cloneNode.default)(bindings[key])
              });
            }
            if (declar.init) {
              exprs.push((0, _index2.assignmentExpression)("=", declar.id, declar.init));
            }
          }
          ensureLastUndefined = true;
        } else if ((0, _index.isIfStatement)(node)) {
          const consequent = node.consequent ? gatherSequenceExpressions([node.consequent], declars) : (0, _productions.buildUndefinedNode)();
          const alternate = node.alternate ? gatherSequenceExpressions([node.alternate], declars) : (0, _productions.buildUndefinedNode)();
          if (!consequent || !alternate) return;
          exprs.push((0, _index2.conditionalExpression)(node.test, consequent, alternate));
        } else if ((0, _index.isBlockStatement)(node)) {
          const body = gatherSequenceExpressions(node.body, declars);
          if (!body) return;
          exprs.push(body);
        } else if ((0, _index.isEmptyStatement)(node)) {
          if (nodes.indexOf(node) === 0) {
            ensureLastUndefined = true;
          }
        } else {
          return;
        }
      }
      if (ensureLastUndefined) {
        exprs.push((0, _productions.buildUndefinedNode)());
      }
      if (exprs.length === 1) {
        return exprs[0];
      } else {
        return (0, _index2.sequenceExpression)(exprs);
      }
    }
  }
});

// node_modules/@babel/types/lib/converters/toSequenceExpression.js
var require_toSequenceExpression = __commonJS({
  "node_modules/@babel/types/lib/converters/toSequenceExpression.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = toSequenceExpression;
    var _gatherSequenceExpressions = require_gatherSequenceExpressions();
    function toSequenceExpression(nodes, scope) {
      if (!(nodes != null && nodes.length)) return;
      const declars = [];
      const result = (0, _gatherSequenceExpressions.default)(nodes, declars);
      if (!result) return;
      for (const declar of declars) {
        scope.push(declar);
      }
      return result;
    }
  }
});

// node_modules/@babel/types/lib/index.js
var require_lib3 = __commonJS({
  "node_modules/@babel/types/lib/index.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    var _exportNames = {
      react: true,
      assertNode: true,
      createTypeAnnotationBasedOnTypeof: true,
      createUnionTypeAnnotation: true,
      createFlowUnionType: true,
      createTSUnionType: true,
      cloneNode: true,
      clone: true,
      cloneDeep: true,
      cloneDeepWithoutLoc: true,
      cloneWithoutLoc: true,
      addComment: true,
      addComments: true,
      inheritInnerComments: true,
      inheritLeadingComments: true,
      inheritsComments: true,
      inheritTrailingComments: true,
      removeComments: true,
      ensureBlock: true,
      toBindingIdentifierName: true,
      toBlock: true,
      toComputedKey: true,
      toExpression: true,
      toIdentifier: true,
      toKeyAlias: true,
      toStatement: true,
      valueToNode: true,
      appendToMemberExpression: true,
      inherits: true,
      prependToMemberExpression: true,
      removeProperties: true,
      removePropertiesDeep: true,
      removeTypeDuplicates: true,
      getAssignmentIdentifiers: true,
      getBindingIdentifiers: true,
      getOuterBindingIdentifiers: true,
      getFunctionName: true,
      traverse: true,
      traverseFast: true,
      shallowEqual: true,
      is: true,
      isBinding: true,
      isBlockScoped: true,
      isImmutable: true,
      isLet: true,
      isNode: true,
      isNodesEquivalent: true,
      isPlaceholderType: true,
      isReferenced: true,
      isScope: true,
      isSpecifierDefault: true,
      isType: true,
      isValidES3Identifier: true,
      isValidIdentifier: true,
      isVar: true,
      matchesPattern: true,
      validate: true,
      buildMatchMemberExpression: true,
      __internal__deprecationWarning: true
    };
    Object.defineProperty(exports2, "__internal__deprecationWarning", {
      enumerable: true,
      get: function() {
        return _deprecationWarning.default;
      }
    });
    Object.defineProperty(exports2, "addComment", {
      enumerable: true,
      get: function() {
        return _addComment.default;
      }
    });
    Object.defineProperty(exports2, "addComments", {
      enumerable: true,
      get: function() {
        return _addComments.default;
      }
    });
    Object.defineProperty(exports2, "appendToMemberExpression", {
      enumerable: true,
      get: function() {
        return _appendToMemberExpression.default;
      }
    });
    Object.defineProperty(exports2, "assertNode", {
      enumerable: true,
      get: function() {
        return _assertNode.default;
      }
    });
    Object.defineProperty(exports2, "buildMatchMemberExpression", {
      enumerable: true,
      get: function() {
        return _buildMatchMemberExpression.default;
      }
    });
    Object.defineProperty(exports2, "clone", {
      enumerable: true,
      get: function() {
        return _clone.default;
      }
    });
    Object.defineProperty(exports2, "cloneDeep", {
      enumerable: true,
      get: function() {
        return _cloneDeep.default;
      }
    });
    Object.defineProperty(exports2, "cloneDeepWithoutLoc", {
      enumerable: true,
      get: function() {
        return _cloneDeepWithoutLoc.default;
      }
    });
    Object.defineProperty(exports2, "cloneNode", {
      enumerable: true,
      get: function() {
        return _cloneNode.default;
      }
    });
    Object.defineProperty(exports2, "cloneWithoutLoc", {
      enumerable: true,
      get: function() {
        return _cloneWithoutLoc.default;
      }
    });
    Object.defineProperty(exports2, "createFlowUnionType", {
      enumerable: true,
      get: function() {
        return _createFlowUnionType.default;
      }
    });
    Object.defineProperty(exports2, "createTSUnionType", {
      enumerable: true,
      get: function() {
        return _createTSUnionType.default;
      }
    });
    Object.defineProperty(exports2, "createTypeAnnotationBasedOnTypeof", {
      enumerable: true,
      get: function() {
        return _createTypeAnnotationBasedOnTypeof.default;
      }
    });
    Object.defineProperty(exports2, "createUnionTypeAnnotation", {
      enumerable: true,
      get: function() {
        return _createFlowUnionType.default;
      }
    });
    Object.defineProperty(exports2, "ensureBlock", {
      enumerable: true,
      get: function() {
        return _ensureBlock.default;
      }
    });
    Object.defineProperty(exports2, "getAssignmentIdentifiers", {
      enumerable: true,
      get: function() {
        return _getAssignmentIdentifiers.default;
      }
    });
    Object.defineProperty(exports2, "getBindingIdentifiers", {
      enumerable: true,
      get: function() {
        return _getBindingIdentifiers.default;
      }
    });
    Object.defineProperty(exports2, "getFunctionName", {
      enumerable: true,
      get: function() {
        return _getFunctionName.default;
      }
    });
    Object.defineProperty(exports2, "getOuterBindingIdentifiers", {
      enumerable: true,
      get: function() {
        return _getOuterBindingIdentifiers.default;
      }
    });
    Object.defineProperty(exports2, "inheritInnerComments", {
      enumerable: true,
      get: function() {
        return _inheritInnerComments.default;
      }
    });
    Object.defineProperty(exports2, "inheritLeadingComments", {
      enumerable: true,
      get: function() {
        return _inheritLeadingComments.default;
      }
    });
    Object.defineProperty(exports2, "inheritTrailingComments", {
      enumerable: true,
      get: function() {
        return _inheritTrailingComments.default;
      }
    });
    Object.defineProperty(exports2, "inherits", {
      enumerable: true,
      get: function() {
        return _inherits.default;
      }
    });
    Object.defineProperty(exports2, "inheritsComments", {
      enumerable: true,
      get: function() {
        return _inheritsComments.default;
      }
    });
    Object.defineProperty(exports2, "is", {
      enumerable: true,
      get: function() {
        return _is.default;
      }
    });
    Object.defineProperty(exports2, "isBinding", {
      enumerable: true,
      get: function() {
        return _isBinding.default;
      }
    });
    Object.defineProperty(exports2, "isBlockScoped", {
      enumerable: true,
      get: function() {
        return _isBlockScoped.default;
      }
    });
    Object.defineProperty(exports2, "isImmutable", {
      enumerable: true,
      get: function() {
        return _isImmutable.default;
      }
    });
    Object.defineProperty(exports2, "isLet", {
      enumerable: true,
      get: function() {
        return _isLet.default;
      }
    });
    Object.defineProperty(exports2, "isNode", {
      enumerable: true,
      get: function() {
        return _isNode.default;
      }
    });
    Object.defineProperty(exports2, "isNodesEquivalent", {
      enumerable: true,
      get: function() {
        return _isNodesEquivalent.default;
      }
    });
    Object.defineProperty(exports2, "isPlaceholderType", {
      enumerable: true,
      get: function() {
        return _isPlaceholderType.default;
      }
    });
    Object.defineProperty(exports2, "isReferenced", {
      enumerable: true,
      get: function() {
        return _isReferenced.default;
      }
    });
    Object.defineProperty(exports2, "isScope", {
      enumerable: true,
      get: function() {
        return _isScope.default;
      }
    });
    Object.defineProperty(exports2, "isSpecifierDefault", {
      enumerable: true,
      get: function() {
        return _isSpecifierDefault.default;
      }
    });
    Object.defineProperty(exports2, "isType", {
      enumerable: true,
      get: function() {
        return _isType.default;
      }
    });
    Object.defineProperty(exports2, "isValidES3Identifier", {
      enumerable: true,
      get: function() {
        return _isValidES3Identifier.default;
      }
    });
    Object.defineProperty(exports2, "isValidIdentifier", {
      enumerable: true,
      get: function() {
        return _isValidIdentifier.default;
      }
    });
    Object.defineProperty(exports2, "isVar", {
      enumerable: true,
      get: function() {
        return _isVar.default;
      }
    });
    Object.defineProperty(exports2, "matchesPattern", {
      enumerable: true,
      get: function() {
        return _matchesPattern.default;
      }
    });
    Object.defineProperty(exports2, "prependToMemberExpression", {
      enumerable: true,
      get: function() {
        return _prependToMemberExpression.default;
      }
    });
    exports2.react = void 0;
    Object.defineProperty(exports2, "removeComments", {
      enumerable: true,
      get: function() {
        return _removeComments.default;
      }
    });
    Object.defineProperty(exports2, "removeProperties", {
      enumerable: true,
      get: function() {
        return _removeProperties.default;
      }
    });
    Object.defineProperty(exports2, "removePropertiesDeep", {
      enumerable: true,
      get: function() {
        return _removePropertiesDeep.default;
      }
    });
    Object.defineProperty(exports2, "removeTypeDuplicates", {
      enumerable: true,
      get: function() {
        return _removeTypeDuplicates.default;
      }
    });
    Object.defineProperty(exports2, "shallowEqual", {
      enumerable: true,
      get: function() {
        return _shallowEqual.default;
      }
    });
    Object.defineProperty(exports2, "toBindingIdentifierName", {
      enumerable: true,
      get: function() {
        return _toBindingIdentifierName.default;
      }
    });
    Object.defineProperty(exports2, "toBlock", {
      enumerable: true,
      get: function() {
        return _toBlock.default;
      }
    });
    Object.defineProperty(exports2, "toComputedKey", {
      enumerable: true,
      get: function() {
        return _toComputedKey.default;
      }
    });
    Object.defineProperty(exports2, "toExpression", {
      enumerable: true,
      get: function() {
        return _toExpression.default;
      }
    });
    Object.defineProperty(exports2, "toIdentifier", {
      enumerable: true,
      get: function() {
        return _toIdentifier.default;
      }
    });
    Object.defineProperty(exports2, "toKeyAlias", {
      enumerable: true,
      get: function() {
        return _toKeyAlias.default;
      }
    });
    Object.defineProperty(exports2, "toStatement", {
      enumerable: true,
      get: function() {
        return _toStatement.default;
      }
    });
    Object.defineProperty(exports2, "traverse", {
      enumerable: true,
      get: function() {
        return _traverse.default;
      }
    });
    Object.defineProperty(exports2, "traverseFast", {
      enumerable: true,
      get: function() {
        return _traverseFast.default;
      }
    });
    Object.defineProperty(exports2, "validate", {
      enumerable: true,
      get: function() {
        return _validate.default;
      }
    });
    Object.defineProperty(exports2, "valueToNode", {
      enumerable: true,
      get: function() {
        return _valueToNode.default;
      }
    });
    var _isReactComponent = require_isReactComponent();
    var _isCompatTag = require_isCompatTag();
    var _buildChildren = require_buildChildren();
    var _assertNode = require_assertNode();
    var _index = require_generated3();
    Object.keys(_index).forEach(function(key) {
      if (key === "default" || key === "__esModule") return;
      if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
      if (key in exports2 && exports2[key] === _index[key]) return;
      Object.defineProperty(exports2, key, {
        enumerable: true,
        get: function() {
          return _index[key];
        }
      });
    });
    var _createTypeAnnotationBasedOnTypeof = require_createTypeAnnotationBasedOnTypeof();
    var _createFlowUnionType = require_createFlowUnionType();
    var _createTSUnionType = require_createTSUnionType();
    var _productions = require_productions();
    Object.keys(_productions).forEach(function(key) {
      if (key === "default" || key === "__esModule") return;
      if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
      if (key in exports2 && exports2[key] === _productions[key]) return;
      Object.defineProperty(exports2, key, {
        enumerable: true,
        get: function() {
          return _productions[key];
        }
      });
    });
    var _index2 = require_generated2();
    Object.keys(_index2).forEach(function(key) {
      if (key === "default" || key === "__esModule") return;
      if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
      if (key in exports2 && exports2[key] === _index2[key]) return;
      Object.defineProperty(exports2, key, {
        enumerable: true,
        get: function() {
          return _index2[key];
        }
      });
    });
    var _cloneNode = require_cloneNode();
    var _clone = require_clone();
    var _cloneDeep = require_cloneDeep();
    var _cloneDeepWithoutLoc = require_cloneDeepWithoutLoc();
    var _cloneWithoutLoc = require_cloneWithoutLoc();
    var _addComment = require_addComment();
    var _addComments = require_addComments();
    var _inheritInnerComments = require_inheritInnerComments();
    var _inheritLeadingComments = require_inheritLeadingComments();
    var _inheritsComments = require_inheritsComments();
    var _inheritTrailingComments = require_inheritTrailingComments();
    var _removeComments = require_removeComments();
    var _index3 = require_generated4();
    Object.keys(_index3).forEach(function(key) {
      if (key === "default" || key === "__esModule") return;
      if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
      if (key in exports2 && exports2[key] === _index3[key]) return;
      Object.defineProperty(exports2, key, {
        enumerable: true,
        get: function() {
          return _index3[key];
        }
      });
    });
    var _index4 = require_constants();
    Object.keys(_index4).forEach(function(key) {
      if (key === "default" || key === "__esModule") return;
      if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
      if (key in exports2 && exports2[key] === _index4[key]) return;
      Object.defineProperty(exports2, key, {
        enumerable: true,
        get: function() {
          return _index4[key];
        }
      });
    });
    var _ensureBlock = require_ensureBlock();
    var _toBindingIdentifierName = require_toBindingIdentifierName();
    var _toBlock = require_toBlock();
    var _toComputedKey = require_toComputedKey();
    var _toExpression = require_toExpression();
    var _toIdentifier = require_toIdentifier();
    var _toKeyAlias = require_toKeyAlias();
    var _toStatement = require_toStatement();
    var _valueToNode = require_valueToNode();
    var _index5 = require_definitions();
    Object.keys(_index5).forEach(function(key) {
      if (key === "default" || key === "__esModule") return;
      if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
      if (key in exports2 && exports2[key] === _index5[key]) return;
      Object.defineProperty(exports2, key, {
        enumerable: true,
        get: function() {
          return _index5[key];
        }
      });
    });
    var _appendToMemberExpression = require_appendToMemberExpression();
    var _inherits = require_inherits();
    var _prependToMemberExpression = require_prependToMemberExpression();
    var _removeProperties = require_removeProperties();
    var _removePropertiesDeep = require_removePropertiesDeep();
    var _removeTypeDuplicates = require_removeTypeDuplicates();
    var _getAssignmentIdentifiers = require_getAssignmentIdentifiers();
    var _getBindingIdentifiers = require_getBindingIdentifiers();
    var _getOuterBindingIdentifiers = require_getOuterBindingIdentifiers();
    var _getFunctionName = require_getFunctionName();
    var _traverse = require_traverse();
    Object.keys(_traverse).forEach(function(key) {
      if (key === "default" || key === "__esModule") return;
      if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
      if (key in exports2 && exports2[key] === _traverse[key]) return;
      Object.defineProperty(exports2, key, {
        enumerable: true,
        get: function() {
          return _traverse[key];
        }
      });
    });
    var _traverseFast = require_traverseFast();
    var _shallowEqual = require_shallowEqual();
    var _is = require_is();
    var _isBinding = require_isBinding();
    var _isBlockScoped = require_isBlockScoped();
    var _isImmutable = require_isImmutable();
    var _isLet = require_isLet();
    var _isNode = require_isNode();
    var _isNodesEquivalent = require_isNodesEquivalent();
    var _isPlaceholderType = require_isPlaceholderType();
    var _isReferenced = require_isReferenced();
    var _isScope = require_isScope();
    var _isSpecifierDefault = require_isSpecifierDefault();
    var _isType = require_isType();
    var _isValidES3Identifier = require_isValidES3Identifier();
    var _isValidIdentifier = require_isValidIdentifier();
    var _isVar = require_isVar();
    var _matchesPattern = require_matchesPattern();
    var _validate = require_validate();
    var _buildMatchMemberExpression = require_buildMatchMemberExpression();
    var _index6 = require_generated();
    Object.keys(_index6).forEach(function(key) {
      if (key === "default" || key === "__esModule") return;
      if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
      if (key in exports2 && exports2[key] === _index6[key]) return;
      Object.defineProperty(exports2, key, {
        enumerable: true,
        get: function() {
          return _index6[key];
        }
      });
    });
    var _deprecationWarning = require_deprecationWarning();
    var _toSequenceExpression = require_toSequenceExpression();
    var react = exports2.react = {
      isReactComponent: _isReactComponent.default,
      isCompatTag: _isCompatTag.default,
      buildChildren: _buildChildren.default
    };
    exports2.toSequenceExpression = _toSequenceExpression.default;
    if (process.env.BABEL_TYPES_8_BREAKING) {
      console.warn("BABEL_TYPES_8_BREAKING is not supported anymore. Use the latest Babel 8.0.0 pre-release instead!");
    }
  }
});

// node_modules/@babel/template/lib/formatters.js
var require_formatters = __commonJS({
  "node_modules/@babel/template/lib/formatters.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.statements = exports2.statement = exports2.smart = exports2.program = exports2.expression = void 0;
    var _t = require_lib3();
    var {
      assertExpressionStatement
    } = _t;
    function makeStatementFormatter(fn) {
      return {
        code: (str) => `/* @babel/template */;
${str}`,
        validate: () => {
        },
        unwrap: (ast) => {
          return fn(ast.program.body.slice(1));
        }
      };
    }
    var smart = exports2.smart = makeStatementFormatter((body) => {
      if (body.length > 1) {
        return body;
      } else {
        return body[0];
      }
    });
    var statements = exports2.statements = makeStatementFormatter((body) => body);
    var statement = exports2.statement = makeStatementFormatter((body) => {
      if (body.length === 0) {
        throw new Error("Found nothing to return.");
      }
      if (body.length > 1) {
        throw new Error("Found multiple statements but wanted one");
      }
      return body[0];
    });
    var expression = exports2.expression = {
      code: (str) => `(
${str}
)`,
      validate: (ast) => {
        if (ast.program.body.length > 1) {
          throw new Error("Found multiple statements but wanted one");
        }
        if (expression.unwrap(ast).start === 0) {
          throw new Error("Parse result included parens.");
        }
      },
      unwrap: ({
        program: program2
      }) => {
        const [stmt] = program2.body;
        assertExpressionStatement(stmt);
        return stmt.expression;
      }
    };
    var program = exports2.program = {
      code: (str) => str,
      validate: () => {
      },
      unwrap: (ast) => ast.program
    };
  }
});

// node_modules/@babel/template/lib/options.js
var require_options = __commonJS({
  "node_modules/@babel/template/lib/options.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.merge = merge;
    exports2.normalizeReplacements = normalizeReplacements;
    exports2.validate = validate;
    var _excluded = ["placeholderWhitelist", "placeholderPattern", "preserveComments", "syntacticPlaceholders"];
    function _objectWithoutPropertiesLoose(r, e) {
      if (null == r) return {};
      var t = {};
      for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
        if (-1 !== e.indexOf(n)) continue;
        t[n] = r[n];
      }
      return t;
    }
    function merge(a, b) {
      const {
        placeholderWhitelist = a.placeholderWhitelist,
        placeholderPattern = a.placeholderPattern,
        preserveComments = a.preserveComments,
        syntacticPlaceholders = a.syntacticPlaceholders
      } = b;
      return {
        parser: Object.assign({}, a.parser, b.parser),
        placeholderWhitelist,
        placeholderPattern,
        preserveComments,
        syntacticPlaceholders
      };
    }
    function validate(opts) {
      if (opts != null && typeof opts !== "object") {
        throw new Error("Unknown template options.");
      }
      const _ref = opts || {}, {
        placeholderWhitelist,
        placeholderPattern,
        preserveComments,
        syntacticPlaceholders
      } = _ref, parser = _objectWithoutPropertiesLoose(_ref, _excluded);
      if (placeholderWhitelist != null && !(placeholderWhitelist instanceof Set)) {
        throw new Error("'.placeholderWhitelist' must be a Set, null, or undefined");
      }
      if (placeholderPattern != null && !(placeholderPattern instanceof RegExp) && placeholderPattern !== false) {
        throw new Error("'.placeholderPattern' must be a RegExp, false, null, or undefined");
      }
      if (preserveComments != null && typeof preserveComments !== "boolean") {
        throw new Error("'.preserveComments' must be a boolean, null, or undefined");
      }
      if (syntacticPlaceholders != null && typeof syntacticPlaceholders !== "boolean") {
        throw new Error("'.syntacticPlaceholders' must be a boolean, null, or undefined");
      }
      if (syntacticPlaceholders === true && (placeholderWhitelist != null || placeholderPattern != null)) {
        throw new Error("'.placeholderWhitelist' and '.placeholderPattern' aren't compatible with '.syntacticPlaceholders: true'");
      }
      return {
        parser,
        placeholderWhitelist: placeholderWhitelist || void 0,
        placeholderPattern: placeholderPattern == null ? void 0 : placeholderPattern,
        preserveComments: preserveComments == null ? void 0 : preserveComments,
        syntacticPlaceholders: syntacticPlaceholders == null ? void 0 : syntacticPlaceholders
      };
    }
    function normalizeReplacements(replacements) {
      if (Array.isArray(replacements)) {
        return replacements.reduce((acc, replacement, i) => {
          acc["$" + i] = replacement;
          return acc;
        }, {});
      } else if (typeof replacements === "object" || replacements == null) {
        return replacements || void 0;
      }
      throw new Error("Template replacements must be an array, object, null, or undefined");
    }
  }
});

// node_modules/@babel/parser/lib/index.js
var require_lib4 = __commonJS({
  "node_modules/@babel/parser/lib/index.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    function _objectWithoutPropertiesLoose(r, e) {
      if (null == r) return {};
      var t = {};
      for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
        if (-1 !== e.indexOf(n)) continue;
        t[n] = r[n];
      }
      return t;
    }
    var Position = class {
      constructor(line, col, index) {
        this.line = void 0;
        this.column = void 0;
        this.index = void 0;
        this.line = line;
        this.column = col;
        this.index = index;
      }
    };
    var SourceLocation = class {
      constructor(start, end) {
        this.start = void 0;
        this.end = void 0;
        this.filename = void 0;
        this.identifierName = void 0;
        this.start = start;
        this.end = end;
      }
    };
    function createPositionWithColumnOffset(position, columnOffset) {
      const {
        line,
        column,
        index
      } = position;
      return new Position(line, column + columnOffset, index + columnOffset);
    }
    var code = "BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED";
    var ModuleErrors = {
      ImportMetaOutsideModule: {
        message: `import.meta may appear only with 'sourceType: "module"'`,
        code
      },
      ImportOutsideModule: {
        message: `'import' and 'export' may appear only with 'sourceType: "module"'`,
        code
      }
    };
    var NodeDescriptions = {
      ArrayPattern: "array destructuring pattern",
      AssignmentExpression: "assignment expression",
      AssignmentPattern: "assignment expression",
      ArrowFunctionExpression: "arrow function expression",
      ConditionalExpression: "conditional expression",
      CatchClause: "catch clause",
      ForOfStatement: "for-of statement",
      ForInStatement: "for-in statement",
      ForStatement: "for-loop",
      FormalParameters: "function parameter list",
      Identifier: "identifier",
      ImportSpecifier: "import specifier",
      ImportDefaultSpecifier: "import default specifier",
      ImportNamespaceSpecifier: "import namespace specifier",
      ObjectPattern: "object destructuring pattern",
      ParenthesizedExpression: "parenthesized expression",
      RestElement: "rest element",
      UpdateExpression: {
        true: "prefix operation",
        false: "postfix operation"
      },
      VariableDeclarator: "variable declaration",
      YieldExpression: "yield expression"
    };
    var toNodeDescription = (node) => node.type === "UpdateExpression" ? NodeDescriptions.UpdateExpression[`${node.prefix}`] : NodeDescriptions[node.type];
    var StandardErrors = {
      AccessorIsGenerator: ({
        kind
      }) => `A ${kind}ter cannot be a generator.`,
      ArgumentsInClass: "'arguments' is only allowed in functions and class methods.",
      AsyncFunctionInSingleStatementContext: "Async functions can only be declared at the top level or inside a block.",
      AwaitBindingIdentifier: "Can not use 'await' as identifier inside an async function.",
      AwaitBindingIdentifierInStaticBlock: "Can not use 'await' as identifier inside a static block.",
      AwaitExpressionFormalParameter: "'await' is not allowed in async function parameters.",
      AwaitUsingNotInAsyncContext: "'await using' is only allowed within async functions and at the top levels of modules.",
      AwaitNotInAsyncContext: "'await' is only allowed within async functions and at the top levels of modules.",
      BadGetterArity: "A 'get' accessor must not have any formal parameters.",
      BadSetterArity: "A 'set' accessor must have exactly one formal parameter.",
      BadSetterRestParameter: "A 'set' accessor function argument must not be a rest parameter.",
      ConstructorClassField: "Classes may not have a field named 'constructor'.",
      ConstructorClassPrivateField: "Classes may not have a private field named '#constructor'.",
      ConstructorIsAccessor: "Class constructor may not be an accessor.",
      ConstructorIsAsync: "Constructor can't be an async function.",
      ConstructorIsGenerator: "Constructor can't be a generator.",
      DeclarationMissingInitializer: ({
        kind
      }) => `Missing initializer in ${kind} declaration.`,
      DecoratorArgumentsOutsideParentheses: "Decorator arguments must be moved inside parentheses: use '@(decorator(args))' instead of '@(decorator)(args)'.",
      DecoratorBeforeExport: "Decorators must be placed *before* the 'export' keyword. Remove the 'decoratorsBeforeExport: true' option to use the 'export @decorator class {}' syntax.",
      DecoratorsBeforeAfterExport: "Decorators can be placed *either* before or after the 'export' keyword, but not in both locations at the same time.",
      DecoratorConstructor: "Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?",
      DecoratorExportClass: "Decorators must be placed *after* the 'export' keyword. Remove the 'decoratorsBeforeExport: false' option to use the '@decorator export class {}' syntax.",
      DecoratorSemicolon: "Decorators must not be followed by a semicolon.",
      DecoratorStaticBlock: "Decorators can't be used with a static block.",
      DeferImportRequiresNamespace: 'Only `import defer * as x from "./module"` is valid.',
      DeletePrivateField: "Deleting a private field is not allowed.",
      DestructureNamedImport: "ES2015 named imports do not destructure. Use another statement for destructuring after the import.",
      DuplicateConstructor: "Duplicate constructor in the same class.",
      DuplicateDefaultExport: "Only one default export allowed per module.",
      DuplicateExport: ({
        exportName
      }) => `\`${exportName}\` has already been exported. Exported identifiers must be unique.`,
      DuplicateProto: "Redefinition of __proto__ property.",
      DuplicateRegExpFlags: "Duplicate regular expression flag.",
      ElementAfterRest: "Rest element must be last element.",
      EscapedCharNotAnIdentifier: "Invalid Unicode escape.",
      ExportBindingIsString: ({
        localName,
        exportName
      }) => `A string literal cannot be used as an exported binding without \`from\`.
- Did you mean \`export { '${localName}' as '${exportName}' } from 'some-module'\`?`,
      ExportDefaultFromAsIdentifier: "'from' is not allowed as an identifier after 'export default'.",
      ForInOfLoopInitializer: ({
        type
      }) => `'${type === "ForInStatement" ? "for-in" : "for-of"}' loop variable declaration may not have an initializer.`,
      ForInUsing: "For-in loop may not start with 'using' declaration.",
      ForOfAsync: "The left-hand side of a for-of loop may not be 'async'.",
      ForOfLet: "The left-hand side of a for-of loop may not start with 'let'.",
      GeneratorInSingleStatementContext: "Generators can only be declared at the top level or inside a block.",
      IllegalBreakContinue: ({
        type
      }) => `Unsyntactic ${type === "BreakStatement" ? "break" : "continue"}.`,
      IllegalLanguageModeDirective: "Illegal 'use strict' directive in function with non-simple parameter list.",
      IllegalReturn: "'return' outside of function.",
      ImportAttributesUseAssert: "The `assert` keyword in import attributes is deprecated and it has been replaced by the `with` keyword. You can enable the `deprecatedImportAssert` parser plugin to suppress this error.",
      ImportBindingIsString: ({
        importName
      }) => `A string literal cannot be used as an imported binding.
- Did you mean \`import { "${importName}" as foo }\`?`,
      ImportCallArity: `\`import()\` requires exactly one or two arguments.`,
      ImportCallNotNewExpression: "Cannot use new with import(...).",
      ImportCallSpreadArgument: "`...` is not allowed in `import()`.",
      ImportJSONBindingNotDefault: "A JSON module can only be imported with `default`.",
      ImportReflectionHasAssertion: "`import module x` cannot have assertions.",
      ImportReflectionNotBinding: 'Only `import module x from "./module"` is valid.',
      IncompatibleRegExpUVFlags: "The 'u' and 'v' regular expression flags cannot be enabled at the same time.",
      InvalidBigIntLiteral: "Invalid BigIntLiteral.",
      InvalidCodePoint: "Code point out of bounds.",
      InvalidCoverDiscardElement: "'void' must be followed by an expression when not used in a binding position.",
      InvalidCoverInitializedName: "Invalid shorthand property initializer.",
      InvalidDecimal: "Invalid decimal.",
      InvalidDigit: ({
        radix
      }) => `Expected number in radix ${radix}.`,
      InvalidEscapeSequence: "Bad character escape sequence.",
      InvalidEscapeSequenceTemplate: "Invalid escape sequence in template.",
      InvalidEscapedReservedWord: ({
        reservedWord
      }) => `Escape sequence in keyword ${reservedWord}.`,
      InvalidIdentifier: ({
        identifierName
      }) => `Invalid identifier ${identifierName}.`,
      InvalidLhs: ({
        ancestor
      }) => `Invalid left-hand side in ${toNodeDescription(ancestor)}.`,
      InvalidLhsBinding: ({
        ancestor
      }) => `Binding invalid left-hand side in ${toNodeDescription(ancestor)}.`,
      InvalidLhsOptionalChaining: ({
        ancestor
      }) => `Invalid optional chaining in the left-hand side of ${toNodeDescription(ancestor)}.`,
      InvalidNumber: "Invalid number.",
      InvalidOrMissingExponent: "Floating-point numbers require a valid exponent after the 'e'.",
      InvalidOrUnexpectedToken: ({
        unexpected
      }) => `Unexpected character '${unexpected}'.`,
      InvalidParenthesizedAssignment: "Invalid parenthesized assignment pattern.",
      InvalidPrivateFieldResolution: ({
        identifierName
      }) => `Private name #${identifierName} is not defined.`,
      InvalidPropertyBindingPattern: "Binding member expression.",
      InvalidRecordProperty: "Only properties and spread elements are allowed in record definitions.",
      InvalidRestAssignmentPattern: "Invalid rest operator's argument.",
      LabelRedeclaration: ({
        labelName
      }) => `Label '${labelName}' is already declared.`,
      LetInLexicalBinding: "'let' is disallowed as a lexically bound name.",
      LineTerminatorBeforeArrow: "No line break is allowed before '=>'.",
      MalformedRegExpFlags: "Invalid regular expression flag.",
      MissingClassName: "A class name is required.",
      MissingEqInAssignment: "Only '=' operator can be used for specifying default value.",
      MissingSemicolon: "Missing semicolon.",
      MissingPlugin: ({
        missingPlugin
      }) => `This experimental syntax requires enabling the parser plugin: ${missingPlugin.map((name) => JSON.stringify(name)).join(", ")}.`,
      MissingOneOfPlugins: ({
        missingPlugin
      }) => `This experimental syntax requires enabling one of the following parser plugin(s): ${missingPlugin.map((name) => JSON.stringify(name)).join(", ")}.`,
      MissingUnicodeEscape: "Expecting Unicode escape sequence \\uXXXX.",
      MixingCoalesceWithLogical: "Nullish coalescing operator(??) requires parens when mixing with logical operators.",
      ModuleAttributeDifferentFromType: "The only accepted module attribute is `type`.",
      ModuleAttributeInvalidValue: "Only string literals are allowed as module attribute values.",
      ModuleAttributesWithDuplicateKeys: ({
        key
      }) => `Duplicate key "${key}" is not allowed in module attributes.`,
      ModuleExportNameHasLoneSurrogate: ({
        surrogateCharCode
      }) => `An export name cannot include a lone surrogate, found '\\u${surrogateCharCode.toString(16)}'.`,
      ModuleExportUndefined: ({
        localName
      }) => `Export '${localName}' is not defined.`,
      MultipleDefaultsInSwitch: "Multiple default clauses.",
      NewlineAfterThrow: "Illegal newline after throw.",
      NoCatchOrFinally: "Missing catch or finally clause.",
      NumberIdentifier: "Identifier directly after number.",
      NumericSeparatorInEscapeSequence: "Numeric separators are not allowed inside unicode escape sequences or hex escape sequences.",
      ObsoleteAwaitStar: "'await*' has been removed from the async functions proposal. Use Promise.all() instead.",
      OptionalChainingNoNew: "Constructors in/after an Optional Chain are not allowed.",
      OptionalChainingNoTemplate: "Tagged Template Literals are not allowed in optionalChain.",
      OverrideOnConstructor: "'override' modifier cannot appear on a constructor declaration.",
      ParamDupe: "Argument name clash.",
      PatternHasAccessor: "Object pattern can't contain getter or setter.",
      PatternHasMethod: "Object pattern can't contain methods.",
      PrivateInExpectedIn: ({
        identifierName
      }) => `Private names are only allowed in property accesses (\`obj.#${identifierName}\`) or in \`in\` expressions (\`#${identifierName} in obj\`).`,
      PrivateNameRedeclaration: ({
        identifierName
      }) => `Duplicate private name #${identifierName}.`,
      RecordExpressionBarIncorrectEndSyntaxType: "Record expressions ending with '|}' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",
      RecordExpressionBarIncorrectStartSyntaxType: "Record expressions starting with '{|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",
      RecordExpressionHashIncorrectStartSyntaxType: "Record expressions starting with '#{' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.",
      RecordNoProto: "'__proto__' is not allowed in Record expressions.",
      RestTrailingComma: "Unexpected trailing comma after rest element.",
      SloppyFunction: "In non-strict mode code, functions can only be declared at top level or inside a block.",
      SloppyFunctionAnnexB: "In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement.",
      SourcePhaseImportRequiresDefault: 'Only `import source x from "./module"` is valid.',
      StaticPrototype: "Classes may not have static property named prototype.",
      SuperNotAllowed: "`super()` is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class?",
      SuperPrivateField: "Private fields can't be accessed on super.",
      TrailingDecorator: "Decorators must be attached to a class element.",
      TupleExpressionBarIncorrectEndSyntaxType: "Tuple expressions ending with '|]' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",
      TupleExpressionBarIncorrectStartSyntaxType: "Tuple expressions starting with '[|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",
      TupleExpressionHashIncorrectStartSyntaxType: "Tuple expressions starting with '#[' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.",
      UnexpectedArgumentPlaceholder: "Unexpected argument placeholder.",
      UnexpectedAwaitAfterPipelineBody: 'Unexpected "await" after pipeline body; await must have parentheses in minimal proposal.',
      UnexpectedDigitAfterHash: "Unexpected digit after hash token.",
      UnexpectedImportExport: "'import' and 'export' may only appear at the top level.",
      UnexpectedKeyword: ({
        keyword
      }) => `Unexpected keyword '${keyword}'.`,
      UnexpectedLeadingDecorator: "Leading decorators must be attached to a class declaration.",
      UnexpectedLexicalDeclaration: "Lexical declaration cannot appear in a single-statement context.",
      UnexpectedNewTarget: "`new.target` can only be used in functions or class properties.",
      UnexpectedNumericSeparator: "A numeric separator is only allowed between two digits.",
      UnexpectedPrivateField: "Unexpected private name.",
      UnexpectedReservedWord: ({
        reservedWord
      }) => `Unexpected reserved word '${reservedWord}'.`,
      UnexpectedSuper: "'super' is only allowed in object methods and classes.",
      UnexpectedToken: ({
        expected,
        unexpected
      }) => `Unexpected token${unexpected ? ` '${unexpected}'.` : ""}${expected ? `, expected "${expected}"` : ""}`,
      UnexpectedTokenUnaryExponentiation: "Illegal expression. Wrap left hand side or entire exponentiation in parentheses.",
      UnexpectedUsingDeclaration: "Using declaration cannot appear in the top level when source type is `script` or in the bare case statement.",
      UnexpectedVoidPattern: "Unexpected void binding.",
      UnsupportedBind: "Binding should be performed on object property.",
      UnsupportedDecoratorExport: "A decorated export must export a class declaration.",
      UnsupportedDefaultExport: "Only expressions, functions or classes are allowed as the `default` export.",
      UnsupportedImport: "`import` can only be used in `import()` or `import.meta`.",
      UnsupportedMetaProperty: ({
        target,
        onlyValidPropertyName
      }) => `The only valid meta property for ${target} is ${target}.${onlyValidPropertyName}.`,
      UnsupportedParameterDecorator: "Decorators cannot be used to decorate parameters.",
      UnsupportedPropertyDecorator: "Decorators cannot be used to decorate object literal properties.",
      UnsupportedSuper: "'super' can only be used with function calls (i.e. super()) or in property accesses (i.e. super.prop or super[prop]).",
      UnterminatedComment: "Unterminated comment.",
      UnterminatedRegExp: "Unterminated regular expression.",
      UnterminatedString: "Unterminated string constant.",
      UnterminatedTemplate: "Unterminated template.",
      UsingDeclarationExport: "Using declaration cannot be exported.",
      UsingDeclarationHasBindingPattern: "Using declaration cannot have destructuring patterns.",
      VarRedeclaration: ({
        identifierName
      }) => `Identifier '${identifierName}' has already been declared.`,
      VoidPatternCatchClauseParam: "A void binding can not be the catch clause parameter. Use `try { ... } catch { ... }` if you want to discard the caught error.",
      VoidPatternInitializer: "A void binding may not have an initializer.",
      YieldBindingIdentifier: "Can not use 'yield' as identifier inside a generator.",
      YieldInParameter: "Yield expression is not allowed in formal parameters.",
      YieldNotInGeneratorFunction: "'yield' is only allowed within generator functions.",
      ZeroDigitNumericSeparator: "Numeric separator can not be used after leading 0."
    };
    var StrictModeErrors = {
      StrictDelete: "Deleting local variable in strict mode.",
      StrictEvalArguments: ({
        referenceName
      }) => `Assigning to '${referenceName}' in strict mode.`,
      StrictEvalArgumentsBinding: ({
        bindingName
      }) => `Binding '${bindingName}' in strict mode.`,
      StrictFunction: "In strict mode code, functions can only be declared at top level or inside a block.",
      StrictNumericEscape: "The only valid numeric escape in strict mode is '\\0'.",
      StrictOctalLiteral: "Legacy octal literals are not allowed in strict mode.",
      StrictWith: "'with' in strict mode."
    };
    var ParseExpressionErrors = {
      ParseExpressionEmptyInput: "Unexpected parseExpression() input: The input is empty or contains only comments.",
      ParseExpressionExpectsEOF: ({
        unexpected
      }) => `Unexpected parseExpression() input: The input should contain exactly one expression, but the first expression is followed by the unexpected character \`${String.fromCodePoint(unexpected)}\`.`
    };
    var UnparenthesizedPipeBodyDescriptions = /* @__PURE__ */ new Set(["ArrowFunctionExpression", "AssignmentExpression", "ConditionalExpression", "YieldExpression"]);
    var PipelineOperatorErrors = Object.assign({
      PipeBodyIsTighter: "Unexpected yield after pipeline body; any yield expression acting as Hack-style pipe body must be parenthesized due to its loose operator precedence.",
      PipeTopicRequiresHackPipes: 'Topic reference is used, but the pipelineOperator plugin was not passed a "proposal": "hack" or "smart" option.',
      PipeTopicUnbound: "Topic reference is unbound; it must be inside a pipe body.",
      PipeTopicUnconfiguredToken: ({
        token
      }) => `Invalid topic token ${token}. In order to use ${token} as a topic reference, the pipelineOperator plugin must be configured with { "proposal": "hack", "topicToken": "${token}" }.`,
      PipeTopicUnused: "Hack-style pipe body does not contain a topic reference; Hack-style pipes must use topic at least once.",
      PipeUnparenthesizedBody: ({
        type
      }) => `Hack-style pipe body cannot be an unparenthesized ${toNodeDescription({
        type
      })}; please wrap it in parentheses.`
    }, {
      PipelineBodyNoArrow: 'Unexpected arrow "=>" after pipeline body; arrow function in pipeline body must be parenthesized.',
      PipelineBodySequenceExpression: "Pipeline body may not be a comma-separated sequence expression.",
      PipelineHeadSequenceExpression: "Pipeline head should not be a comma-separated sequence expression.",
      PipelineTopicUnused: "Pipeline is in topic style but does not use topic reference.",
      PrimaryTopicNotAllowed: "Topic reference was used in a lexical context without topic binding.",
      PrimaryTopicRequiresSmartPipeline: 'Topic reference is used, but the pipelineOperator plugin was not passed a "proposal": "hack" or "smart" option.'
    });
    var _excluded = ["message"];
    function defineHidden(obj, key, value2) {
      Object.defineProperty(obj, key, {
        enumerable: false,
        configurable: true,
        value: value2
      });
    }
    function toParseErrorConstructor({
      toMessage,
      code: code2,
      reasonCode,
      syntaxPlugin
    }) {
      const hasMissingPlugin = reasonCode === "MissingPlugin" || reasonCode === "MissingOneOfPlugins";
      const oldReasonCodes = {
        AccessorCannotDeclareThisParameter: "AccesorCannotDeclareThisParameter",
        AccessorCannotHaveTypeParameters: "AccesorCannotHaveTypeParameters",
        ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference: "ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference",
        SetAccessorCannotHaveOptionalParameter: "SetAccesorCannotHaveOptionalParameter",
        SetAccessorCannotHaveRestParameter: "SetAccesorCannotHaveRestParameter",
        SetAccessorCannotHaveReturnType: "SetAccesorCannotHaveReturnType"
      };
      if (oldReasonCodes[reasonCode]) {
        reasonCode = oldReasonCodes[reasonCode];
      }
      return function constructor(loc, details) {
        const error = new SyntaxError();
        error.code = code2;
        error.reasonCode = reasonCode;
        error.loc = loc;
        error.pos = loc.index;
        error.syntaxPlugin = syntaxPlugin;
        if (hasMissingPlugin) {
          error.missingPlugin = details.missingPlugin;
        }
        defineHidden(error, "clone", function clone(overrides = {}) {
          var _overrides$loc;
          const {
            line,
            column,
            index
          } = (_overrides$loc = overrides.loc) != null ? _overrides$loc : loc;
          return constructor(new Position(line, column, index), Object.assign({}, details, overrides.details));
        });
        defineHidden(error, "details", details);
        Object.defineProperty(error, "message", {
          configurable: true,
          get() {
            const message = `${toMessage(details)} (${loc.line}:${loc.column})`;
            this.message = message;
            return message;
          },
          set(value2) {
            Object.defineProperty(this, "message", {
              value: value2,
              writable: true
            });
          }
        });
        return error;
      };
    }
    function ParseErrorEnum(argument, syntaxPlugin) {
      if (Array.isArray(argument)) {
        return (parseErrorTemplates) => ParseErrorEnum(parseErrorTemplates, argument[0]);
      }
      const ParseErrorConstructors = {};
      for (const reasonCode of Object.keys(argument)) {
        const template = argument[reasonCode];
        const _ref = typeof template === "string" ? {
          message: () => template
        } : typeof template === "function" ? {
          message: template
        } : template, {
          message
        } = _ref, rest = _objectWithoutPropertiesLoose(_ref, _excluded);
        const toMessage = typeof message === "string" ? () => message : message;
        ParseErrorConstructors[reasonCode] = toParseErrorConstructor(Object.assign({
          code: "BABEL_PARSER_SYNTAX_ERROR",
          reasonCode,
          toMessage
        }, syntaxPlugin ? {
          syntaxPlugin
        } : {}, rest));
      }
      return ParseErrorConstructors;
    }
    var Errors = Object.assign({}, ParseErrorEnum(ModuleErrors), ParseErrorEnum(StandardErrors), ParseErrorEnum(StrictModeErrors), ParseErrorEnum(ParseExpressionErrors), ParseErrorEnum`pipelineOperator`(PipelineOperatorErrors));
    function createDefaultOptions() {
      return {
        sourceType: "script",
        sourceFilename: void 0,
        startIndex: 0,
        startColumn: 0,
        startLine: 1,
        allowAwaitOutsideFunction: false,
        allowReturnOutsideFunction: false,
        allowNewTargetOutsideFunction: false,
        allowImportExportEverywhere: false,
        allowSuperOutsideMethod: false,
        allowUndeclaredExports: false,
        allowYieldOutsideFunction: false,
        plugins: [],
        strictMode: void 0,
        ranges: false,
        tokens: false,
        createImportExpressions: false,
        createParenthesizedExpressions: false,
        errorRecovery: false,
        attachComment: true,
        annexB: true
      };
    }
    function getOptions(opts) {
      const options = createDefaultOptions();
      if (opts == null) {
        return options;
      }
      if (opts.annexB != null && opts.annexB !== false) {
        throw new Error("The `annexB` option can only be set to `false`.");
      }
      for (const key of Object.keys(options)) {
        if (opts[key] != null) options[key] = opts[key];
      }
      if (options.startLine === 1) {
        if (opts.startIndex == null && options.startColumn > 0) {
          options.startIndex = options.startColumn;
        } else if (opts.startColumn == null && options.startIndex > 0) {
          options.startColumn = options.startIndex;
        }
      } else if (opts.startColumn == null || opts.startIndex == null) {
        if (opts.startIndex != null) {
          throw new Error("With a `startLine > 1` you must also specify `startIndex` and `startColumn`.");
        }
      }
      if (options.sourceType === "commonjs") {
        if (opts.allowAwaitOutsideFunction != null) {
          throw new Error("The `allowAwaitOutsideFunction` option cannot be used with `sourceType: 'commonjs'`.");
        }
        if (opts.allowReturnOutsideFunction != null) {
          throw new Error("`sourceType: 'commonjs'` implies `allowReturnOutsideFunction: true`, please remove the `allowReturnOutsideFunction` option or use `sourceType: 'script'`.");
        }
        if (opts.allowNewTargetOutsideFunction != null) {
          throw new Error("`sourceType: 'commonjs'` implies `allowNewTargetOutsideFunction: true`, please remove the `allowNewTargetOutsideFunction` option or use `sourceType: 'script'`.");
        }
      }
      return options;
    }
    var {
      defineProperty
    } = Object;
    var toUnenumerable = (object, key) => {
      if (object) {
        defineProperty(object, key, {
          enumerable: false,
          value: object[key]
        });
      }
    };
    function toESTreeLocation(node) {
      toUnenumerable(node.loc.start, "index");
      toUnenumerable(node.loc.end, "index");
      return node;
    }
    var estree = (superClass) => class ESTreeParserMixin extends superClass {
      parse() {
        const file = toESTreeLocation(super.parse());
        if (this.optionFlags & 256) {
          file.tokens = file.tokens.map(toESTreeLocation);
        }
        return file;
      }
      parseRegExpLiteral({
        pattern,
        flags
      }) {
        let regex = null;
        try {
          regex = new RegExp(pattern, flags);
        } catch (_) {
        }
        const node = this.estreeParseLiteral(regex);
        node.regex = {
          pattern,
          flags
        };
        return node;
      }
      parseBigIntLiteral(value2) {
        let bigInt;
        try {
          bigInt = BigInt(value2);
        } catch (_unused) {
          bigInt = null;
        }
        const node = this.estreeParseLiteral(bigInt);
        node.bigint = String(node.value || value2);
        return node;
      }
      parseDecimalLiteral(value2) {
        const decimal = null;
        const node = this.estreeParseLiteral(decimal);
        node.decimal = String(node.value || value2);
        return node;
      }
      estreeParseLiteral(value2) {
        return this.parseLiteral(value2, "Literal");
      }
      parseStringLiteral(value2) {
        return this.estreeParseLiteral(value2);
      }
      parseNumericLiteral(value2) {
        return this.estreeParseLiteral(value2);
      }
      parseNullLiteral() {
        return this.estreeParseLiteral(null);
      }
      parseBooleanLiteral(value2) {
        return this.estreeParseLiteral(value2);
      }
      estreeParseChainExpression(node, endLoc) {
        const chain = this.startNodeAtNode(node);
        chain.expression = node;
        return this.finishNodeAt(chain, "ChainExpression", endLoc);
      }
      directiveToStmt(directive) {
        const expression = directive.value;
        delete directive.value;
        this.castNodeTo(expression, "Literal");
        expression.raw = expression.extra.raw;
        expression.value = expression.extra.expressionValue;
        const stmt = this.castNodeTo(directive, "ExpressionStatement");
        stmt.expression = expression;
        stmt.directive = expression.extra.rawValue;
        delete expression.extra;
        return stmt;
      }
      fillOptionalPropertiesForTSESLint(node) {
      }
      cloneEstreeStringLiteral(node) {
        const {
          start,
          end,
          loc,
          range,
          raw,
          value: value2
        } = node;
        const cloned = Object.create(node.constructor.prototype);
        cloned.type = "Literal";
        cloned.start = start;
        cloned.end = end;
        cloned.loc = loc;
        cloned.range = range;
        cloned.raw = raw;
        cloned.value = value2;
        return cloned;
      }
      initFunction(node, isAsync) {
        super.initFunction(node, isAsync);
        node.expression = false;
      }
      checkDeclaration(node) {
        if (node != null && this.isObjectProperty(node)) {
          this.checkDeclaration(node.value);
        } else {
          super.checkDeclaration(node);
        }
      }
      getObjectOrClassMethodParams(method) {
        return method.value.params;
      }
      isValidDirective(stmt) {
        var _stmt$expression$extr;
        return stmt.type === "ExpressionStatement" && stmt.expression.type === "Literal" && typeof stmt.expression.value === "string" && !((_stmt$expression$extr = stmt.expression.extra) != null && _stmt$expression$extr.parenthesized);
      }
      parseBlockBody(node, allowDirectives, topLevel, end, afterBlockParse) {
        super.parseBlockBody(node, allowDirectives, topLevel, end, afterBlockParse);
        const directiveStatements = node.directives.map((d) => this.directiveToStmt(d));
        node.body = directiveStatements.concat(node.body);
        delete node.directives;
      }
      parsePrivateName() {
        const node = super.parsePrivateName();
        if (!this.getPluginOption("estree", "classFeatures")) {
          return node;
        }
        return this.convertPrivateNameToPrivateIdentifier(node);
      }
      convertPrivateNameToPrivateIdentifier(node) {
        const name = super.getPrivateNameSV(node);
        delete node.id;
        node.name = name;
        return this.castNodeTo(node, "PrivateIdentifier");
      }
      isPrivateName(node) {
        if (!this.getPluginOption("estree", "classFeatures")) {
          return super.isPrivateName(node);
        }
        return node.type === "PrivateIdentifier";
      }
      getPrivateNameSV(node) {
        if (!this.getPluginOption("estree", "classFeatures")) {
          return super.getPrivateNameSV(node);
        }
        return node.name;
      }
      parseLiteral(value2, type) {
        const node = super.parseLiteral(value2, type);
        node.raw = node.extra.raw;
        delete node.extra;
        return node;
      }
      parseFunctionBody(node, allowExpression, isMethod = false) {
        super.parseFunctionBody(node, allowExpression, isMethod);
        node.expression = node.body.type !== "BlockStatement";
      }
      parseMethod(node, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope = false) {
        let funcNode = this.startNode();
        funcNode.kind = node.kind;
        funcNode = super.parseMethod(funcNode, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope);
        delete funcNode.kind;
        const {
          typeParameters
        } = node;
        if (typeParameters) {
          delete node.typeParameters;
          funcNode.typeParameters = typeParameters;
          this.resetStartLocationFromNode(funcNode, typeParameters);
        }
        const valueNode = this.castNodeTo(funcNode, "FunctionExpression");
        node.value = valueNode;
        if (type === "ClassPrivateMethod") {
          node.computed = false;
        }
        if (type === "ObjectMethod") {
          if (node.kind === "method") {
            node.kind = "init";
          }
          node.shorthand = false;
          return this.finishNode(node, "Property");
        } else {
          return this.finishNode(node, "MethodDefinition");
        }
      }
      nameIsConstructor(key) {
        if (key.type === "Literal") return key.value === "constructor";
        return super.nameIsConstructor(key);
      }
      parseClassProperty(...args) {
        const propertyNode = super.parseClassProperty(...args);
        if (!this.getPluginOption("estree", "classFeatures")) {
          return propertyNode;
        }
        this.castNodeTo(propertyNode, "PropertyDefinition");
        return propertyNode;
      }
      parseClassPrivateProperty(...args) {
        const propertyNode = super.parseClassPrivateProperty(...args);
        if (!this.getPluginOption("estree", "classFeatures")) {
          return propertyNode;
        }
        this.castNodeTo(propertyNode, "PropertyDefinition");
        propertyNode.computed = false;
        return propertyNode;
      }
      parseClassAccessorProperty(node) {
        const accessorPropertyNode = super.parseClassAccessorProperty(node);
        if (!this.getPluginOption("estree", "classFeatures")) {
          return accessorPropertyNode;
        }
        if (accessorPropertyNode.abstract && this.hasPlugin("typescript")) {
          delete accessorPropertyNode.abstract;
          this.castNodeTo(accessorPropertyNode, "TSAbstractAccessorProperty");
        } else {
          this.castNodeTo(accessorPropertyNode, "AccessorProperty");
        }
        return accessorPropertyNode;
      }
      parseObjectProperty(prop, startLoc, isPattern, refExpressionErrors) {
        const node = super.parseObjectProperty(prop, startLoc, isPattern, refExpressionErrors);
        if (node) {
          node.kind = "init";
          this.castNodeTo(node, "Property");
        }
        return node;
      }
      finishObjectProperty(node) {
        node.kind = "init";
        return this.finishNode(node, "Property");
      }
      isValidLVal(type, disallowCallExpression, isUnparenthesizedInAssign, binding) {
        return type === "Property" ? "value" : super.isValidLVal(type, disallowCallExpression, isUnparenthesizedInAssign, binding);
      }
      isAssignable(node, isBinding) {
        if (node != null && this.isObjectProperty(node)) {
          return this.isAssignable(node.value, isBinding);
        }
        return super.isAssignable(node, isBinding);
      }
      toAssignable(node, isLHS = false) {
        if (node != null && this.isObjectProperty(node)) {
          const {
            key,
            value: value2
          } = node;
          if (this.isPrivateName(key)) {
            this.classScope.usePrivateName(this.getPrivateNameSV(key), key.loc.start);
          }
          this.toAssignable(value2, isLHS);
        } else {
          super.toAssignable(node, isLHS);
        }
      }
      toAssignableObjectExpressionProp(prop, isLast, isLHS) {
        if (prop.type === "Property" && (prop.kind === "get" || prop.kind === "set")) {
          this.raise(Errors.PatternHasAccessor, prop.key);
        } else if (prop.type === "Property" && prop.method) {
          this.raise(Errors.PatternHasMethod, prop.key);
        } else {
          super.toAssignableObjectExpressionProp(prop, isLast, isLHS);
        }
      }
      finishCallExpression(unfinished, optional) {
        const node = super.finishCallExpression(unfinished, optional);
        if (node.callee.type === "Import") {
          var _ref, _ref2;
          this.castNodeTo(node, "ImportExpression");
          node.source = node.arguments[0];
          node.options = (_ref = node.arguments[1]) != null ? _ref : null;
          node.attributes = (_ref2 = node.arguments[1]) != null ? _ref2 : null;
          delete node.arguments;
          delete node.callee;
        } else if (node.type === "OptionalCallExpression") {
          this.castNodeTo(node, "CallExpression");
        } else {
          node.optional = false;
        }
        return node;
      }
      toReferencedArguments(node) {
        if (node.type === "ImportExpression") {
          return;
        }
        super.toReferencedArguments(node);
      }
      parseExport(unfinished, decorators) {
        const exportStartLoc = this.state.lastTokStartLoc;
        const node = super.parseExport(unfinished, decorators);
        switch (node.type) {
          case "ExportAllDeclaration":
            node.exported = null;
            break;
          case "ExportNamedDeclaration":
            if (node.specifiers.length === 1 && node.specifiers[0].type === "ExportNamespaceSpecifier") {
              this.castNodeTo(node, "ExportAllDeclaration");
              node.exported = node.specifiers[0].exported;
              delete node.specifiers;
            }
          case "ExportDefaultDeclaration":
            {
              var _declaration$decorato;
              const {
                declaration
              } = node;
              if ((declaration == null ? void 0 : declaration.type) === "ClassDeclaration" && ((_declaration$decorato = declaration.decorators) == null ? void 0 : _declaration$decorato.length) > 0 && declaration.start === node.start) {
                this.resetStartLocation(node, exportStartLoc);
              }
            }
            break;
        }
        return node;
      }
      stopParseSubscript(base, state) {
        const node = super.stopParseSubscript(base, state);
        if (state.optionalChainMember) {
          return this.estreeParseChainExpression(node, base.loc.end);
        }
        return node;
      }
      parseMember(base, startLoc, state, computed, optional) {
        const node = super.parseMember(base, startLoc, state, computed, optional);
        if (node.type === "OptionalMemberExpression") {
          this.castNodeTo(node, "MemberExpression");
        } else {
          node.optional = false;
        }
        return node;
      }
      isOptionalMemberExpression(node) {
        if (node.type === "ChainExpression") {
          return node.expression.type === "MemberExpression";
        }
        return super.isOptionalMemberExpression(node);
      }
      hasPropertyAsPrivateName(node) {
        if (node.type === "ChainExpression") {
          node = node.expression;
        }
        return super.hasPropertyAsPrivateName(node);
      }
      isObjectProperty(node) {
        return node.type === "Property" && node.kind === "init" && !node.method;
      }
      isObjectMethod(node) {
        return node.type === "Property" && (node.method || node.kind === "get" || node.kind === "set");
      }
      castNodeTo(node, type) {
        const result = super.castNodeTo(node, type);
        this.fillOptionalPropertiesForTSESLint(result);
        return result;
      }
      cloneIdentifier(node) {
        const cloned = super.cloneIdentifier(node);
        this.fillOptionalPropertiesForTSESLint(cloned);
        return cloned;
      }
      cloneStringLiteral(node) {
        if (node.type === "Literal") {
          return this.cloneEstreeStringLiteral(node);
        }
        return super.cloneStringLiteral(node);
      }
      finishNodeAt(node, type, endLoc) {
        return toESTreeLocation(super.finishNodeAt(node, type, endLoc));
      }
      finishNode(node, type) {
        const result = super.finishNode(node, type);
        this.fillOptionalPropertiesForTSESLint(result);
        return result;
      }
      resetStartLocation(node, startLoc) {
        super.resetStartLocation(node, startLoc);
        toESTreeLocation(node);
      }
      resetEndLocation(node, endLoc = this.state.lastTokEndLoc) {
        super.resetEndLocation(node, endLoc);
        toESTreeLocation(node);
      }
    };
    var TokContext = class {
      constructor(token, preserveSpace) {
        this.token = void 0;
        this.preserveSpace = void 0;
        this.token = token;
        this.preserveSpace = !!preserveSpace;
      }
    };
    var types2 = {
      brace: new TokContext("{"),
      j_oTag: new TokContext("<tag"),
      j_cTag: new TokContext("</tag"),
      j_expr: new TokContext("<tag>...</tag>", true)
    };
    types2.template = new TokContext("`", true);
    var beforeExpr = true;
    var startsExpr = true;
    var isLoop = true;
    var isAssign = true;
    var prefix = true;
    var postfix = true;
    var ExportedTokenType = class {
      constructor(label, conf = {}) {
        this.label = void 0;
        this.keyword = void 0;
        this.beforeExpr = void 0;
        this.startsExpr = void 0;
        this.rightAssociative = void 0;
        this.isLoop = void 0;
        this.isAssign = void 0;
        this.prefix = void 0;
        this.postfix = void 0;
        this.binop = void 0;
        this.label = label;
        this.keyword = conf.keyword;
        this.beforeExpr = !!conf.beforeExpr;
        this.startsExpr = !!conf.startsExpr;
        this.rightAssociative = !!conf.rightAssociative;
        this.isLoop = !!conf.isLoop;
        this.isAssign = !!conf.isAssign;
        this.prefix = !!conf.prefix;
        this.postfix = !!conf.postfix;
        this.binop = conf.binop != null ? conf.binop : null;
        this.updateContext = null;
      }
    };
    var keywords$1 = /* @__PURE__ */ new Map();
    function createKeyword(name, options = {}) {
      options.keyword = name;
      const token = createToken(name, options);
      keywords$1.set(name, token);
      return token;
    }
    function createBinop(name, binop) {
      return createToken(name, {
        beforeExpr,
        binop
      });
    }
    var tokenTypeCounter = -1;
    var tokenTypes = [];
    var tokenLabels = [];
    var tokenBinops = [];
    var tokenBeforeExprs = [];
    var tokenStartsExprs = [];
    var tokenPrefixes = [];
    function createToken(name, options = {}) {
      var _options$binop, _options$beforeExpr, _options$startsExpr, _options$prefix;
      ++tokenTypeCounter;
      tokenLabels.push(name);
      tokenBinops.push((_options$binop = options.binop) != null ? _options$binop : -1);
      tokenBeforeExprs.push((_options$beforeExpr = options.beforeExpr) != null ? _options$beforeExpr : false);
      tokenStartsExprs.push((_options$startsExpr = options.startsExpr) != null ? _options$startsExpr : false);
      tokenPrefixes.push((_options$prefix = options.prefix) != null ? _options$prefix : false);
      tokenTypes.push(new ExportedTokenType(name, options));
      return tokenTypeCounter;
    }
    function createKeywordLike(name, options = {}) {
      var _options$binop2, _options$beforeExpr2, _options$startsExpr2, _options$prefix2;
      ++tokenTypeCounter;
      keywords$1.set(name, tokenTypeCounter);
      tokenLabels.push(name);
      tokenBinops.push((_options$binop2 = options.binop) != null ? _options$binop2 : -1);
      tokenBeforeExprs.push((_options$beforeExpr2 = options.beforeExpr) != null ? _options$beforeExpr2 : false);
      tokenStartsExprs.push((_options$startsExpr2 = options.startsExpr) != null ? _options$startsExpr2 : false);
      tokenPrefixes.push((_options$prefix2 = options.prefix) != null ? _options$prefix2 : false);
      tokenTypes.push(new ExportedTokenType("name", options));
      return tokenTypeCounter;
    }
    var tt = {
      bracketL: createToken("[", {
        beforeExpr,
        startsExpr
      }),
      bracketHashL: createToken("#[", {
        beforeExpr,
        startsExpr
      }),
      bracketBarL: createToken("[|", {
        beforeExpr,
        startsExpr
      }),
      bracketR: createToken("]"),
      bracketBarR: createToken("|]"),
      braceL: createToken("{", {
        beforeExpr,
        startsExpr
      }),
      braceBarL: createToken("{|", {
        beforeExpr,
        startsExpr
      }),
      braceHashL: createToken("#{", {
        beforeExpr,
        startsExpr
      }),
      braceR: createToken("}"),
      braceBarR: createToken("|}"),
      parenL: createToken("(", {
        beforeExpr,
        startsExpr
      }),
      parenR: createToken(")"),
      comma: createToken(",", {
        beforeExpr
      }),
      semi: createToken(";", {
        beforeExpr
      }),
      colon: createToken(":", {
        beforeExpr
      }),
      doubleColon: createToken("::", {
        beforeExpr
      }),
      dot: createToken("."),
      question: createToken("?", {
        beforeExpr
      }),
      questionDot: createToken("?."),
      arrow: createToken("=>", {
        beforeExpr
      }),
      template: createToken("template"),
      ellipsis: createToken("...", {
        beforeExpr
      }),
      backQuote: createToken("`", {
        startsExpr
      }),
      dollarBraceL: createToken("${", {
        beforeExpr,
        startsExpr
      }),
      templateTail: createToken("...`", {
        startsExpr
      }),
      templateNonTail: createToken("...${", {
        beforeExpr,
        startsExpr
      }),
      at: createToken("@"),
      hash: createToken("#", {
        startsExpr
      }),
      interpreterDirective: createToken("#!..."),
      eq: createToken("=", {
        beforeExpr,
        isAssign
      }),
      assign: createToken("_=", {
        beforeExpr,
        isAssign
      }),
      slashAssign: createToken("_=", {
        beforeExpr,
        isAssign
      }),
      xorAssign: createToken("_=", {
        beforeExpr,
        isAssign
      }),
      moduloAssign: createToken("_=", {
        beforeExpr,
        isAssign
      }),
      incDec: createToken("++/--", {
        prefix,
        postfix,
        startsExpr
      }),
      bang: createToken("!", {
        beforeExpr,
        prefix,
        startsExpr
      }),
      tilde: createToken("~", {
        beforeExpr,
        prefix,
        startsExpr
      }),
      doubleCaret: createToken("^^", {
        startsExpr
      }),
      doubleAt: createToken("@@", {
        startsExpr
      }),
      pipeline: createBinop("|>", 0),
      nullishCoalescing: createBinop("??", 1),
      logicalOR: createBinop("||", 1),
      logicalAND: createBinop("&&", 2),
      bitwiseOR: createBinop("|", 3),
      bitwiseXOR: createBinop("^", 4),
      bitwiseAND: createBinop("&", 5),
      equality: createBinop("==/!=/===/!==", 6),
      lt: createBinop("</>/<=/>=", 7),
      gt: createBinop("</>/<=/>=", 7),
      relational: createBinop("</>/<=/>=", 7),
      bitShift: createBinop("<</>>/>>>", 8),
      bitShiftL: createBinop("<</>>/>>>", 8),
      bitShiftR: createBinop("<</>>/>>>", 8),
      plusMin: createToken("+/-", {
        beforeExpr,
        binop: 9,
        prefix,
        startsExpr
      }),
      modulo: createToken("%", {
        binop: 10,
        startsExpr
      }),
      star: createToken("*", {
        binop: 10
      }),
      slash: createBinop("/", 10),
      exponent: createToken("**", {
        beforeExpr,
        binop: 11,
        rightAssociative: true
      }),
      _in: createKeyword("in", {
        beforeExpr,
        binop: 7
      }),
      _instanceof: createKeyword("instanceof", {
        beforeExpr,
        binop: 7
      }),
      _break: createKeyword("break"),
      _case: createKeyword("case", {
        beforeExpr
      }),
      _catch: createKeyword("catch"),
      _continue: createKeyword("continue"),
      _debugger: createKeyword("debugger"),
      _default: createKeyword("default", {
        beforeExpr
      }),
      _else: createKeyword("else", {
        beforeExpr
      }),
      _finally: createKeyword("finally"),
      _function: createKeyword("function", {
        startsExpr
      }),
      _if: createKeyword("if"),
      _return: createKeyword("return", {
        beforeExpr
      }),
      _switch: createKeyword("switch"),
      _throw: createKeyword("throw", {
        beforeExpr,
        prefix,
        startsExpr
      }),
      _try: createKeyword("try"),
      _var: createKeyword("var"),
      _const: createKeyword("const"),
      _with: createKeyword("with"),
      _new: createKeyword("new", {
        beforeExpr,
        startsExpr
      }),
      _this: createKeyword("this", {
        startsExpr
      }),
      _super: createKeyword("super", {
        startsExpr
      }),
      _class: createKeyword("class", {
        startsExpr
      }),
      _extends: createKeyword("extends", {
        beforeExpr
      }),
      _export: createKeyword("export"),
      _import: createKeyword("import", {
        startsExpr
      }),
      _null: createKeyword("null", {
        startsExpr
      }),
      _true: createKeyword("true", {
        startsExpr
      }),
      _false: createKeyword("false", {
        startsExpr
      }),
      _typeof: createKeyword("typeof", {
        beforeExpr,
        prefix,
        startsExpr
      }),
      _void: createKeyword("void", {
        beforeExpr,
        prefix,
        startsExpr
      }),
      _delete: createKeyword("delete", {
        beforeExpr,
        prefix,
        startsExpr
      }),
      _do: createKeyword("do", {
        isLoop,
        beforeExpr
      }),
      _for: createKeyword("for", {
        isLoop
      }),
      _while: createKeyword("while", {
        isLoop
      }),
      _as: createKeywordLike("as", {
        startsExpr
      }),
      _assert: createKeywordLike("assert", {
        startsExpr
      }),
      _async: createKeywordLike("async", {
        startsExpr
      }),
      _await: createKeywordLike("await", {
        startsExpr
      }),
      _defer: createKeywordLike("defer", {
        startsExpr
      }),
      _from: createKeywordLike("from", {
        startsExpr
      }),
      _get: createKeywordLike("get", {
        startsExpr
      }),
      _let: createKeywordLike("let", {
        startsExpr
      }),
      _meta: createKeywordLike("meta", {
        startsExpr
      }),
      _of: createKeywordLike("of", {
        startsExpr
      }),
      _sent: createKeywordLike("sent", {
        startsExpr
      }),
      _set: createKeywordLike("set", {
        startsExpr
      }),
      _source: createKeywordLike("source", {
        startsExpr
      }),
      _static: createKeywordLike("static", {
        startsExpr
      }),
      _using: createKeywordLike("using", {
        startsExpr
      }),
      _yield: createKeywordLike("yield", {
        startsExpr
      }),
      _asserts: createKeywordLike("asserts", {
        startsExpr
      }),
      _checks: createKeywordLike("checks", {
        startsExpr
      }),
      _exports: createKeywordLike("exports", {
        startsExpr
      }),
      _global: createKeywordLike("global", {
        startsExpr
      }),
      _implements: createKeywordLike("implements", {
        startsExpr
      }),
      _intrinsic: createKeywordLike("intrinsic", {
        startsExpr
      }),
      _infer: createKeywordLike("infer", {
        startsExpr
      }),
      _is: createKeywordLike("is", {
        startsExpr
      }),
      _mixins: createKeywordLike("mixins", {
        startsExpr
      }),
      _proto: createKeywordLike("proto", {
        startsExpr
      }),
      _require: createKeywordLike("require", {
        startsExpr
      }),
      _satisfies: createKeywordLike("satisfies", {
        startsExpr
      }),
      _keyof: createKeywordLike("keyof", {
        startsExpr
      }),
      _readonly: createKeywordLike("readonly", {
        startsExpr
      }),
      _unique: createKeywordLike("unique", {
        startsExpr
      }),
      _abstract: createKeywordLike("abstract", {
        startsExpr
      }),
      _declare: createKeywordLike("declare", {
        startsExpr
      }),
      _enum: createKeywordLike("enum", {
        startsExpr
      }),
      _module: createKeywordLike("module", {
        startsExpr
      }),
      _namespace: createKeywordLike("namespace", {
        startsExpr
      }),
      _interface: createKeywordLike("interface", {
        startsExpr
      }),
      _type: createKeywordLike("type", {
        startsExpr
      }),
      _opaque: createKeywordLike("opaque", {
        startsExpr
      }),
      name: createToken("name", {
        startsExpr
      }),
      placeholder: createToken("%%", {
        startsExpr
      }),
      string: createToken("string", {
        startsExpr
      }),
      num: createToken("num", {
        startsExpr
      }),
      bigint: createToken("bigint", {
        startsExpr
      }),
      decimal: createToken("decimal", {
        startsExpr
      }),
      regexp: createToken("regexp", {
        startsExpr
      }),
      privateName: createToken("#name", {
        startsExpr
      }),
      eof: createToken("eof"),
      jsxName: createToken("jsxName"),
      jsxText: createToken("jsxText", {
        beforeExpr
      }),
      jsxTagStart: createToken("jsxTagStart", {
        startsExpr
      }),
      jsxTagEnd: createToken("jsxTagEnd")
    };
    function tokenIsIdentifier(token) {
      return token >= 93 && token <= 133;
    }
    function tokenKeywordOrIdentifierIsKeyword(token) {
      return token <= 92;
    }
    function tokenIsKeywordOrIdentifier(token) {
      return token >= 58 && token <= 133;
    }
    function tokenIsLiteralPropertyName(token) {
      return token >= 58 && token <= 137;
    }
    function tokenComesBeforeExpression(token) {
      return tokenBeforeExprs[token];
    }
    function tokenCanStartExpression(token) {
      return tokenStartsExprs[token];
    }
    function tokenIsAssignment(token) {
      return token >= 29 && token <= 33;
    }
    function tokenIsFlowInterfaceOrTypeOrOpaque(token) {
      return token >= 129 && token <= 131;
    }
    function tokenIsLoop(token) {
      return token >= 90 && token <= 92;
    }
    function tokenIsKeyword(token) {
      return token >= 58 && token <= 92;
    }
    function tokenIsOperator(token) {
      return token >= 39 && token <= 59;
    }
    function tokenIsPostfix(token) {
      return token === 34;
    }
    function tokenIsPrefix(token) {
      return tokenPrefixes[token];
    }
    function tokenIsTSTypeOperator(token) {
      return token >= 121 && token <= 123;
    }
    function tokenIsTSDeclarationStart(token) {
      return token >= 124 && token <= 130;
    }
    function tokenLabelName(token) {
      return tokenLabels[token];
    }
    function tokenOperatorPrecedence(token) {
      return tokenBinops[token];
    }
    function tokenIsRightAssociative(token) {
      return token === 57;
    }
    function tokenIsTemplate(token) {
      return token >= 24 && token <= 25;
    }
    function getExportedToken(token) {
      return tokenTypes[token];
    }
    tokenTypes[8].updateContext = (context) => {
      context.pop();
    };
    tokenTypes[5].updateContext = tokenTypes[7].updateContext = tokenTypes[23].updateContext = (context) => {
      context.push(types2.brace);
    };
    tokenTypes[22].updateContext = (context) => {
      if (context[context.length - 1] === types2.template) {
        context.pop();
      } else {
        context.push(types2.template);
      }
    };
    tokenTypes[143].updateContext = (context) => {
      context.push(types2.j_expr, types2.j_oTag);
    };
    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\u0870-\u0887\u0889-\u088F\u08A0-\u08C9\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\u0C5C\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDC-\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-\u1711\u171F-\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-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C8A\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-\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-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7DC\uA7F1-\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 = "\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\u0897-\u089F\u08CA-\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\u0C3C\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\u0CF3\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-\u0ECE\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-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1ADD\u1AE0-\u1AEB\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-\u1DFF\u200C\u200D\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\u30FB\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\uFF65";
    var nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]");
    var nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]");
    nonASCIIidentifierStartChars = nonASCIIidentifierChars = null;
    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, 13, 10, 2, 14, 2, 6, 2, 1, 2, 10, 2, 14, 2, 6, 2, 1, 4, 51, 13, 310, 10, 21, 11, 7, 25, 5, 2, 41, 2, 8, 70, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 7, 25, 39, 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, 39, 27, 10, 22, 251, 41, 7, 1, 17, 5, 57, 28, 11, 0, 9, 21, 43, 17, 47, 20, 28, 22, 13, 52, 58, 1, 3, 0, 14, 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, 20, 1, 64, 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, 31, 9, 2, 0, 3, 0, 2, 37, 2, 0, 26, 0, 2, 0, 45, 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, 38, 6, 186, 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, 19, 72, 200, 32, 32, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 24, 43, 261, 18, 16, 0, 2, 12, 2, 33, 125, 0, 80, 921, 103, 110, 18, 195, 2637, 96, 16, 1071, 18, 5, 26, 3994, 6, 582, 6842, 29, 1763, 568, 8, 30, 18, 78, 18, 29, 19, 47, 17, 3, 32, 20, 6, 18, 433, 44, 212, 63, 33, 24, 3, 24, 45, 74, 6, 0, 67, 12, 65, 1, 2, 0, 15, 4, 10, 7381, 42, 31, 98, 114, 8702, 3, 2, 6, 2, 1, 2, 290, 16, 0, 30, 2, 3, 0, 15, 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, 1845, 30, 7, 5, 262, 61, 147, 44, 11, 6, 17, 0, 322, 29, 19, 43, 485, 27, 229, 29, 3, 0, 208, 30, 2, 2, 2, 1, 2, 6, 3, 4, 10, 1, 225, 6, 2, 3, 2, 1, 2, 14, 2, 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, 42719, 33, 4381, 3, 5773, 3, 7472, 16, 621, 2467, 541, 1507, 4938, 6, 8489];
    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, 7, 9, 32, 4, 318, 1, 78, 5, 71, 10, 50, 3, 123, 2, 54, 14, 32, 10, 3, 1, 11, 3, 46, 10, 8, 0, 46, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 3, 0, 158, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 68, 8, 2, 0, 3, 0, 2, 3, 2, 4, 2, 0, 15, 1, 83, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 7, 19, 58, 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, 199, 7, 137, 9, 54, 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, 55, 9, 266, 3, 10, 1, 2, 0, 49, 6, 4, 4, 14, 10, 5350, 0, 7, 14, 11465, 27, 2343, 9, 87, 9, 39, 4, 60, 6, 26, 9, 535, 9, 470, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 4178, 9, 519, 45, 3, 22, 543, 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, 101, 0, 161, 6, 10, 9, 357, 0, 62, 13, 499, 13, 245, 1, 2, 9, 233, 0, 3, 0, 8, 1, 6, 0, 475, 6, 110, 6, 6, 9, 4759, 9, 787719, 239];
    function isInAstralSet(code2, set) {
      let pos = 65536;
      for (let i = 0, length = set.length; i < length; i += 2) {
        pos += set[i];
        if (pos > code2) return false;
        pos += set[i + 1];
        if (pos >= code2) return true;
      }
      return false;
    }
    function isIdentifierStart(code2) {
      if (code2 < 65) return code2 === 36;
      if (code2 <= 90) return true;
      if (code2 < 97) return code2 === 95;
      if (code2 <= 122) return true;
      if (code2 <= 65535) {
        return code2 >= 170 && nonASCIIidentifierStart.test(String.fromCharCode(code2));
      }
      return isInAstralSet(code2, astralIdentifierStartCodes);
    }
    function isIdentifierChar(code2) {
      if (code2 < 48) return code2 === 36;
      if (code2 < 58) return true;
      if (code2 < 65) return false;
      if (code2 <= 90) return true;
      if (code2 < 97) return code2 === 95;
      if (code2 <= 122) return true;
      if (code2 <= 65535) {
        return code2 >= 170 && nonASCIIidentifier.test(String.fromCharCode(code2));
      }
      return isInAstralSet(code2, astralIdentifierStartCodes) || isInAstralSet(code2, astralIdentifierCodes);
    }
    var reservedWords = {
      keyword: ["break", "case", "catch", "continue", "debugger", "default", "do", "else", "finally", "for", "function", "if", "return", "switch", "throw", "try", "var", "const", "while", "with", "new", "this", "super", "class", "extends", "export", "import", "null", "true", "false", "in", "instanceof", "typeof", "void", "delete"],
      strict: ["implements", "interface", "let", "package", "private", "protected", "public", "static", "yield"],
      strictBind: ["eval", "arguments"]
    };
    var keywords = new Set(reservedWords.keyword);
    var reservedWordsStrictSet = new Set(reservedWords.strict);
    var reservedWordsStrictBindSet = new Set(reservedWords.strictBind);
    function isReservedWord(word, inModule) {
      return inModule && word === "await" || word === "enum";
    }
    function isStrictReservedWord(word, inModule) {
      return isReservedWord(word, inModule) || reservedWordsStrictSet.has(word);
    }
    function isStrictBindOnlyReservedWord(word) {
      return reservedWordsStrictBindSet.has(word);
    }
    function isStrictBindReservedWord(word, inModule) {
      return isStrictReservedWord(word, inModule) || isStrictBindOnlyReservedWord(word);
    }
    function isKeyword(word) {
      return keywords.has(word);
    }
    function isIteratorStart(current, next, next2) {
      return current === 64 && next === 64 && isIdentifierStart(next2);
    }
    var reservedWordLikeSet = /* @__PURE__ */ new Set(["break", "case", "catch", "continue", "debugger", "default", "do", "else", "finally", "for", "function", "if", "return", "switch", "throw", "try", "var", "const", "while", "with", "new", "this", "super", "class", "extends", "export", "import", "null", "true", "false", "in", "instanceof", "typeof", "void", "delete", "implements", "interface", "let", "package", "private", "protected", "public", "static", "yield", "eval", "arguments", "enum", "await"]);
    function canBeReservedWord(word) {
      return reservedWordLikeSet.has(word);
    }
    var Scope = class {
      constructor(flags) {
        this.flags = 0;
        this.names = /* @__PURE__ */ new Map();
        this.firstLexicalName = "";
        this.flags = flags;
      }
    };
    var ScopeHandler = class {
      constructor(parser, inModule) {
        this.parser = void 0;
        this.scopeStack = [];
        this.inModule = void 0;
        this.undefinedExports = /* @__PURE__ */ new Map();
        this.parser = parser;
        this.inModule = inModule;
      }
      get inTopLevel() {
        return (this.currentScope().flags & 1) > 0;
      }
      get inFunction() {
        return (this.currentVarScopeFlags() & 2) > 0;
      }
      get allowSuper() {
        return (this.currentThisScopeFlags() & 16) > 0;
      }
      get allowDirectSuper() {
        return (this.currentThisScopeFlags() & 32) > 0;
      }
      get allowNewTarget() {
        return (this.currentThisScopeFlags() & 512) > 0;
      }
      get inClass() {
        return (this.currentThisScopeFlags() & 64) > 0;
      }
      get inClassAndNotInNonArrowFunction() {
        const flags = this.currentThisScopeFlags();
        return (flags & 64) > 0 && (flags & 2) === 0;
      }
      get inStaticBlock() {
        for (let i = this.scopeStack.length - 1; ; i--) {
          const {
            flags
          } = this.scopeStack[i];
          if (flags & 128) {
            return true;
          }
          if (flags & (1667 | 64)) {
            return false;
          }
        }
      }
      get inNonArrowFunction() {
        return (this.currentThisScopeFlags() & 2) > 0;
      }
      get inBareCaseStatement() {
        return (this.currentScope().flags & 256) > 0;
      }
      get treatFunctionsAsVar() {
        return this.treatFunctionsAsVarInScope(this.currentScope());
      }
      createScope(flags) {
        return new Scope(flags);
      }
      enter(flags) {
        this.scopeStack.push(this.createScope(flags));
      }
      exit() {
        const scope = this.scopeStack.pop();
        return scope.flags;
      }
      treatFunctionsAsVarInScope(scope) {
        return !!(scope.flags & (2 | 128) || !this.parser.inModule && scope.flags & 1);
      }
      declareName(name, bindingType, loc) {
        let scope = this.currentScope();
        if (bindingType & 8 || bindingType & 16) {
          this.checkRedeclarationInScope(scope, name, bindingType, loc);
          let type = scope.names.get(name) || 0;
          if (bindingType & 16) {
            type = type | 4;
          } else {
            if (!scope.firstLexicalName) {
              scope.firstLexicalName = name;
            }
            type = type | 2;
          }
          scope.names.set(name, type);
          if (bindingType & 8) {
            this.maybeExportDefined(scope, name);
          }
        } else if (bindingType & 4) {
          for (let i = this.scopeStack.length - 1; i >= 0; --i) {
            scope = this.scopeStack[i];
            this.checkRedeclarationInScope(scope, name, bindingType, loc);
            scope.names.set(name, (scope.names.get(name) || 0) | 1);
            this.maybeExportDefined(scope, name);
            if (scope.flags & 1667) break;
          }
        }
        if (this.parser.inModule && scope.flags & 1) {
          this.undefinedExports.delete(name);
        }
      }
      maybeExportDefined(scope, name) {
        if (this.parser.inModule && scope.flags & 1) {
          this.undefinedExports.delete(name);
        }
      }
      checkRedeclarationInScope(scope, name, bindingType, loc) {
        if (this.isRedeclaredInScope(scope, name, bindingType)) {
          this.parser.raise(Errors.VarRedeclaration, loc, {
            identifierName: name
          });
        }
      }
      isRedeclaredInScope(scope, name, bindingType) {
        if (!(bindingType & 1)) return false;
        if (bindingType & 8) {
          return scope.names.has(name);
        }
        const type = scope.names.get(name) || 0;
        if (bindingType & 16) {
          return (type & 2) > 0 || !this.treatFunctionsAsVarInScope(scope) && (type & 1) > 0;
        }
        return (type & 2) > 0 && !(scope.flags & 8 && scope.firstLexicalName === name) || !this.treatFunctionsAsVarInScope(scope) && (type & 4) > 0;
      }
      checkLocalExport(id) {
        const {
          name
        } = id;
        const topLevelScope = this.scopeStack[0];
        if (!topLevelScope.names.has(name)) {
          this.undefinedExports.set(name, id.loc.start);
        }
      }
      currentScope() {
        return this.scopeStack[this.scopeStack.length - 1];
      }
      currentVarScopeFlags() {
        for (let i = this.scopeStack.length - 1; ; i--) {
          const {
            flags
          } = this.scopeStack[i];
          if (flags & 1667) {
            return flags;
          }
        }
      }
      currentThisScopeFlags() {
        for (let i = this.scopeStack.length - 1; ; i--) {
          const {
            flags
          } = this.scopeStack[i];
          if (flags & (1667 | 64) && !(flags & 4)) {
            return flags;
          }
        }
      }
    };
    var FlowScope = class extends Scope {
      constructor(...args) {
        super(...args);
        this.declareFunctions = /* @__PURE__ */ new Set();
      }
    };
    var FlowScopeHandler = class extends ScopeHandler {
      createScope(flags) {
        return new FlowScope(flags);
      }
      declareName(name, bindingType, loc) {
        const scope = this.currentScope();
        if (bindingType & 2048) {
          this.checkRedeclarationInScope(scope, name, bindingType, loc);
          this.maybeExportDefined(scope, name);
          scope.declareFunctions.add(name);
          return;
        }
        super.declareName(name, bindingType, loc);
      }
      isRedeclaredInScope(scope, name, bindingType) {
        if (super.isRedeclaredInScope(scope, name, bindingType)) return true;
        if (bindingType & 2048 && !scope.declareFunctions.has(name)) {
          const type = scope.names.get(name);
          return (type & 4) > 0 || (type & 2) > 0;
        }
        return false;
      }
      checkLocalExport(id) {
        if (!this.scopeStack[0].declareFunctions.has(id.name)) {
          super.checkLocalExport(id);
        }
      }
    };
    var reservedTypes = /* @__PURE__ */ new Set(["_", "any", "bool", "boolean", "empty", "extends", "false", "interface", "mixed", "null", "number", "static", "string", "true", "typeof", "void"]);
    var FlowErrors = ParseErrorEnum`flow`({
      AmbiguousConditionalArrow: "Ambiguous expression: wrap the arrow functions in parentheses to disambiguate.",
      AmbiguousDeclareModuleKind: "Found both `declare module.exports` and `declare export` in the same module. Modules can only have 1 since they are either an ES module or they are a CommonJS module.",
      AssignReservedType: ({
        reservedType
      }) => `Cannot overwrite reserved type ${reservedType}.`,
      DeclareClassElement: "The `declare` modifier can only appear on class fields.",
      DeclareClassFieldInitializer: "Initializers are not allowed in fields with the `declare` modifier.",
      DuplicateDeclareModuleExports: "Duplicate `declare module.exports` statement.",
      EnumBooleanMemberNotInitialized: ({
        memberName,
        enumName
      }) => `Boolean enum members need to be initialized. Use either \`${memberName} = true,\` or \`${memberName} = false,\` in enum \`${enumName}\`.`,
      EnumDuplicateMemberName: ({
        memberName,
        enumName
      }) => `Enum member names need to be unique, but the name \`${memberName}\` has already been used before in enum \`${enumName}\`.`,
      EnumInconsistentMemberValues: ({
        enumName
      }) => `Enum \`${enumName}\` has inconsistent member initializers. Either use no initializers, or consistently use literals (either booleans, numbers, or strings) for all member initializers.`,
      EnumInvalidExplicitType: ({
        invalidEnumType,
        enumName
      }) => `Enum type \`${invalidEnumType}\` is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${enumName}\`.`,
      EnumInvalidExplicitTypeUnknownSupplied: ({
        enumName
      }) => `Supplied enum type is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${enumName}\`.`,
      EnumInvalidMemberInitializerPrimaryType: ({
        enumName,
        memberName,
        explicitType
      }) => `Enum \`${enumName}\` has type \`${explicitType}\`, so the initializer of \`${memberName}\` needs to be a ${explicitType} literal.`,
      EnumInvalidMemberInitializerSymbolType: ({
        enumName,
        memberName
      }) => `Symbol enum members cannot be initialized. Use \`${memberName},\` in enum \`${enumName}\`.`,
      EnumInvalidMemberInitializerUnknownType: ({
        enumName,
        memberName
      }) => `The enum member initializer for \`${memberName}\` needs to be a literal (either a boolean, number, or string) in enum \`${enumName}\`.`,
      EnumInvalidMemberName: ({
        enumName,
        memberName,
        suggestion
      }) => `Enum member names cannot start with lowercase 'a' through 'z'. Instead of using \`${memberName}\`, consider using \`${suggestion}\`, in enum \`${enumName}\`.`,
      EnumNumberMemberNotInitialized: ({
        enumName,
        memberName
      }) => `Number enum members need to be initialized, e.g. \`${memberName} = 1\` in enum \`${enumName}\`.`,
      EnumStringMemberInconsistentlyInitialized: ({
        enumName
      }) => `String enum members need to consistently either all use initializers, or use no initializers, in enum \`${enumName}\`.`,
      GetterMayNotHaveThisParam: "A getter cannot have a `this` parameter.",
      ImportReflectionHasImportType: "An `import module` declaration can not use `type` or `typeof` keyword.",
      ImportTypeShorthandOnlyInPureImport: "The `type` and `typeof` keywords on named imports can only be used on regular `import` statements. It cannot be used with `import type` or `import typeof` statements.",
      InexactInsideExact: "Explicit inexact syntax cannot appear inside an explicit exact object type.",
      InexactInsideNonObject: "Explicit inexact syntax cannot appear in class or interface definitions.",
      InexactVariance: "Explicit inexact syntax cannot have variance.",
      InvalidNonTypeImportInDeclareModule: "Imports within a `declare module` body must always be `import type` or `import typeof`.",
      MissingTypeParamDefault: "Type parameter declaration needs a default, since a preceding type parameter declaration has a default.",
      NestedDeclareModule: "`declare module` cannot be used inside another `declare module`.",
      NestedFlowComment: "Cannot have a flow comment inside another flow comment.",
      PatternIsOptional: Object.assign({
        message: "A binding pattern parameter cannot be optional in an implementation signature."
      }, {
        reasonCode: "OptionalBindingPattern"
      }),
      SetterMayNotHaveThisParam: "A setter cannot have a `this` parameter.",
      SpreadVariance: "Spread properties cannot have variance.",
      ThisParamAnnotationRequired: "A type annotation is required for the `this` parameter.",
      ThisParamBannedInConstructor: "Constructors cannot have a `this` parameter; constructors don't bind `this` like other functions.",
      ThisParamMayNotBeOptional: "The `this` parameter cannot be optional.",
      ThisParamMustBeFirst: "The `this` parameter must be the first function parameter.",
      ThisParamNoDefault: "The `this` parameter may not have a default value.",
      TypeBeforeInitializer: "Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.",
      TypeCastInPattern: "The type cast expression is expected to be wrapped with parenthesis.",
      UnexpectedExplicitInexactInObject: "Explicit inexact syntax must appear at the end of an inexact object.",
      UnexpectedReservedType: ({
        reservedType
      }) => `Unexpected reserved type ${reservedType}.`,
      UnexpectedReservedUnderscore: "`_` is only allowed as a type argument to call or new.",
      UnexpectedSpaceBetweenModuloChecks: "Spaces between `%` and `checks` are not allowed here.",
      UnexpectedSpreadType: "Spread operator cannot appear in class or interface definitions.",
      UnexpectedSubtractionOperand: 'Unexpected token, expected "number" or "bigint".',
      UnexpectedTokenAfterTypeParameter: "Expected an arrow function after this type parameter declaration.",
      UnexpectedTypeParameterBeforeAsyncArrowFunction: "Type parameters must come after the async keyword, e.g. instead of `<T> async () => {}`, use `async <T>() => {}`.",
      UnsupportedDeclareExportKind: ({
        unsupportedExportKind,
        suggestion
      }) => `\`declare export ${unsupportedExportKind}\` is not supported. Use \`${suggestion}\` instead.`,
      UnsupportedStatementInDeclareModule: "Only declares and type imports are allowed inside declare module.",
      UnterminatedFlowComment: "Unterminated flow-comment."
    });
    function isEsModuleType(bodyElement) {
      return bodyElement.type === "DeclareExportAllDeclaration" || bodyElement.type === "DeclareExportDeclaration" && (!bodyElement.declaration || bodyElement.declaration.type !== "TypeAlias" && bodyElement.declaration.type !== "InterfaceDeclaration");
    }
    function hasTypeImportKind(node) {
      return node.importKind === "type" || node.importKind === "typeof";
    }
    var exportSuggestions = {
      const: "declare export var",
      let: "declare export var",
      type: "export type",
      interface: "export interface"
    };
    function partition(list, test) {
      const list1 = [];
      const list2 = [];
      for (let i = 0; i < list.length; i++) {
        (test(list[i], i, list) ? list1 : list2).push(list[i]);
      }
      return [list1, list2];
    }
    var FLOW_PRAGMA_REGEX = /\*?\s*@((?:no)?flow)\b/;
    var flow = (superClass) => class FlowParserMixin extends superClass {
      constructor(...args) {
        super(...args);
        this.flowPragma = void 0;
      }
      getScopeHandler() {
        return FlowScopeHandler;
      }
      shouldParseTypes() {
        return this.getPluginOption("flow", "all") || this.flowPragma === "flow";
      }
      finishToken(type, val) {
        if (type !== 134 && type !== 13 && type !== 28) {
          if (this.flowPragma === void 0) {
            this.flowPragma = null;
          }
        }
        super.finishToken(type, val);
      }
      addComment(comment) {
        if (this.flowPragma === void 0) {
          const matches = FLOW_PRAGMA_REGEX.exec(comment.value);
          if (!matches) ;
          else if (matches[1] === "flow") {
            this.flowPragma = "flow";
          } else if (matches[1] === "noflow") {
            this.flowPragma = "noflow";
          } else {
            throw new Error("Unexpected flow pragma");
          }
        }
        super.addComment(comment);
      }
      flowParseTypeInitialiser(tok) {
        const oldInType = this.state.inType;
        this.state.inType = true;
        this.expect(tok || 14);
        const type = this.flowParseType();
        this.state.inType = oldInType;
        return type;
      }
      flowParsePredicate() {
        const node = this.startNode();
        const moduloLoc = this.state.startLoc;
        this.next();
        this.expectContextual(110);
        if (this.state.lastTokStartLoc.index > moduloLoc.index + 1) {
          this.raise(FlowErrors.UnexpectedSpaceBetweenModuloChecks, moduloLoc);
        }
        if (this.eat(10)) {
          node.value = super.parseExpression();
          this.expect(11);
          return this.finishNode(node, "DeclaredPredicate");
        } else {
          return this.finishNode(node, "InferredPredicate");
        }
      }
      flowParseTypeAndPredicateInitialiser() {
        const oldInType = this.state.inType;
        this.state.inType = true;
        this.expect(14);
        let type = null;
        let predicate = null;
        if (this.match(54)) {
          this.state.inType = oldInType;
          predicate = this.flowParsePredicate();
        } else {
          type = this.flowParseType();
          this.state.inType = oldInType;
          if (this.match(54)) {
            predicate = this.flowParsePredicate();
          }
        }
        return [type, predicate];
      }
      flowParseDeclareClass(node) {
        this.next();
        this.flowParseInterfaceish(node, true);
        return this.finishNode(node, "DeclareClass");
      }
      flowParseDeclareFunction(node) {
        this.next();
        const id = node.id = this.parseIdentifier();
        const typeNode = this.startNode();
        const typeContainer = this.startNode();
        if (this.match(47)) {
          typeNode.typeParameters = this.flowParseTypeParameterDeclaration();
        } else {
          typeNode.typeParameters = null;
        }
        this.expect(10);
        const tmp = this.flowParseFunctionTypeParams();
        typeNode.params = tmp.params;
        typeNode.rest = tmp.rest;
        typeNode.this = tmp._this;
        this.expect(11);
        [typeNode.returnType, node.predicate] = this.flowParseTypeAndPredicateInitialiser();
        typeContainer.typeAnnotation = this.finishNode(typeNode, "FunctionTypeAnnotation");
        id.typeAnnotation = this.finishNode(typeContainer, "TypeAnnotation");
        this.resetEndLocation(id);
        this.semicolon();
        this.scope.declareName(node.id.name, 2048, node.id.loc.start);
        return this.finishNode(node, "DeclareFunction");
      }
      flowParseDeclare(node, insideModule) {
        if (this.match(80)) {
          return this.flowParseDeclareClass(node);
        } else if (this.match(68)) {
          return this.flowParseDeclareFunction(node);
        } else if (this.match(74)) {
          return this.flowParseDeclareVariable(node);
        } else if (this.eatContextual(127)) {
          if (this.match(16)) {
            return this.flowParseDeclareModuleExports(node);
          } else {
            if (insideModule) {
              this.raise(FlowErrors.NestedDeclareModule, this.state.lastTokStartLoc);
            }
            return this.flowParseDeclareModule(node);
          }
        } else if (this.isContextual(130)) {
          return this.flowParseDeclareTypeAlias(node);
        } else if (this.isContextual(131)) {
          return this.flowParseDeclareOpaqueType(node);
        } else if (this.isContextual(129)) {
          return this.flowParseDeclareInterface(node);
        } else if (this.match(82)) {
          return this.flowParseDeclareExportDeclaration(node, insideModule);
        }
        throw this.unexpected();
      }
      flowParseDeclareVariable(node) {
        this.next();
        node.id = this.flowParseTypeAnnotatableIdentifier(true);
        this.scope.declareName(node.id.name, 5, node.id.loc.start);
        this.semicolon();
        return this.finishNode(node, "DeclareVariable");
      }
      flowParseDeclareModule(node) {
        this.scope.enter(0);
        if (this.match(134)) {
          node.id = super.parseExprAtom();
        } else {
          node.id = this.parseIdentifier();
        }
        const bodyNode = node.body = this.startNode();
        const body = bodyNode.body = [];
        this.expect(5);
        while (!this.match(8)) {
          const bodyNode2 = this.startNode();
          if (this.match(83)) {
            this.next();
            if (!this.isContextual(130) && !this.match(87)) {
              this.raise(FlowErrors.InvalidNonTypeImportInDeclareModule, this.state.lastTokStartLoc);
            }
            body.push(super.parseImport(bodyNode2));
          } else {
            this.expectContextual(125, FlowErrors.UnsupportedStatementInDeclareModule);
            body.push(this.flowParseDeclare(bodyNode2, true));
          }
        }
        this.scope.exit();
        this.expect(8);
        this.finishNode(bodyNode, "BlockStatement");
        let kind = null;
        let hasModuleExport = false;
        body.forEach((bodyElement) => {
          if (isEsModuleType(bodyElement)) {
            if (kind === "CommonJS") {
              this.raise(FlowErrors.AmbiguousDeclareModuleKind, bodyElement);
            }
            kind = "ES";
          } else if (bodyElement.type === "DeclareModuleExports") {
            if (hasModuleExport) {
              this.raise(FlowErrors.DuplicateDeclareModuleExports, bodyElement);
            }
            if (kind === "ES") {
              this.raise(FlowErrors.AmbiguousDeclareModuleKind, bodyElement);
            }
            kind = "CommonJS";
            hasModuleExport = true;
          }
        });
        node.kind = kind || "CommonJS";
        return this.finishNode(node, "DeclareModule");
      }
      flowParseDeclareExportDeclaration(node, insideModule) {
        this.expect(82);
        if (this.eat(65)) {
          if (this.match(68) || this.match(80)) {
            node.declaration = this.flowParseDeclare(this.startNode());
          } else {
            node.declaration = this.flowParseType();
            this.semicolon();
          }
          node.default = true;
          return this.finishNode(node, "DeclareExportDeclaration");
        } else {
          if (this.match(75) || this.isLet() || (this.isContextual(130) || this.isContextual(129)) && !insideModule) {
            const label = this.state.value;
            throw this.raise(FlowErrors.UnsupportedDeclareExportKind, this.state.startLoc, {
              unsupportedExportKind: label,
              suggestion: exportSuggestions[label]
            });
          }
          if (this.match(74) || this.match(68) || this.match(80) || this.isContextual(131)) {
            node.declaration = this.flowParseDeclare(this.startNode());
            node.default = false;
            return this.finishNode(node, "DeclareExportDeclaration");
          } else if (this.match(55) || this.match(5) || this.isContextual(129) || this.isContextual(130) || this.isContextual(131)) {
            node = this.parseExport(node, null);
            if (node.type === "ExportNamedDeclaration") {
              node.default = false;
              delete node.exportKind;
              return this.castNodeTo(node, "DeclareExportDeclaration");
            } else {
              return this.castNodeTo(node, "DeclareExportAllDeclaration");
            }
          }
        }
        throw this.unexpected();
      }
      flowParseDeclareModuleExports(node) {
        this.next();
        this.expectContextual(111);
        node.typeAnnotation = this.flowParseTypeAnnotation();
        this.semicolon();
        return this.finishNode(node, "DeclareModuleExports");
      }
      flowParseDeclareTypeAlias(node) {
        this.next();
        const finished = this.flowParseTypeAlias(node);
        this.castNodeTo(finished, "DeclareTypeAlias");
        return finished;
      }
      flowParseDeclareOpaqueType(node) {
        this.next();
        const finished = this.flowParseOpaqueType(node, true);
        this.castNodeTo(finished, "DeclareOpaqueType");
        return finished;
      }
      flowParseDeclareInterface(node) {
        this.next();
        this.flowParseInterfaceish(node, false);
        return this.finishNode(node, "DeclareInterface");
      }
      flowParseInterfaceish(node, isClass) {
        node.id = this.flowParseRestrictedIdentifier(!isClass, true);
        this.scope.declareName(node.id.name, isClass ? 17 : 8201, node.id.loc.start);
        if (this.match(47)) {
          node.typeParameters = this.flowParseTypeParameterDeclaration();
        } else {
          node.typeParameters = null;
        }
        node.extends = [];
        if (this.eat(81)) {
          do {
            node.extends.push(this.flowParseInterfaceExtends());
          } while (!isClass && this.eat(12));
        }
        if (isClass) {
          node.implements = [];
          node.mixins = [];
          if (this.eatContextual(117)) {
            do {
              node.mixins.push(this.flowParseInterfaceExtends());
            } while (this.eat(12));
          }
          if (this.eatContextual(113)) {
            do {
              node.implements.push(this.flowParseInterfaceExtends());
            } while (this.eat(12));
          }
        }
        node.body = this.flowParseObjectType({
          allowStatic: isClass,
          allowExact: false,
          allowSpread: false,
          allowProto: isClass,
          allowInexact: false
        });
      }
      flowParseInterfaceExtends() {
        const node = this.startNode();
        node.id = this.flowParseQualifiedTypeIdentifier();
        if (this.match(47)) {
          node.typeParameters = this.flowParseTypeParameterInstantiation();
        } else {
          node.typeParameters = null;
        }
        return this.finishNode(node, "InterfaceExtends");
      }
      flowParseInterface(node) {
        this.flowParseInterfaceish(node, false);
        return this.finishNode(node, "InterfaceDeclaration");
      }
      checkNotUnderscore(word) {
        if (word === "_") {
          this.raise(FlowErrors.UnexpectedReservedUnderscore, this.state.startLoc);
        }
      }
      checkReservedType(word, startLoc, declaration) {
        if (!reservedTypes.has(word)) return;
        this.raise(declaration ? FlowErrors.AssignReservedType : FlowErrors.UnexpectedReservedType, startLoc, {
          reservedType: word
        });
      }
      flowParseRestrictedIdentifier(liberal, declaration) {
        this.checkReservedType(this.state.value, this.state.startLoc, declaration);
        return this.parseIdentifier(liberal);
      }
      flowParseTypeAlias(node) {
        node.id = this.flowParseRestrictedIdentifier(false, true);
        this.scope.declareName(node.id.name, 8201, node.id.loc.start);
        if (this.match(47)) {
          node.typeParameters = this.flowParseTypeParameterDeclaration();
        } else {
          node.typeParameters = null;
        }
        node.right = this.flowParseTypeInitialiser(29);
        this.semicolon();
        return this.finishNode(node, "TypeAlias");
      }
      flowParseOpaqueType(node, declare2) {
        this.expectContextual(130);
        node.id = this.flowParseRestrictedIdentifier(true, true);
        this.scope.declareName(node.id.name, 8201, node.id.loc.start);
        if (this.match(47)) {
          node.typeParameters = this.flowParseTypeParameterDeclaration();
        } else {
          node.typeParameters = null;
        }
        node.supertype = null;
        if (this.match(14)) {
          node.supertype = this.flowParseTypeInitialiser(14);
        }
        node.impltype = null;
        if (!declare2) {
          node.impltype = this.flowParseTypeInitialiser(29);
        }
        this.semicolon();
        return this.finishNode(node, "OpaqueType");
      }
      flowParseTypeParameter(requireDefault = false) {
        const nodeStartLoc = this.state.startLoc;
        const node = this.startNode();
        const variance = this.flowParseVariance();
        const ident = this.flowParseTypeAnnotatableIdentifier();
        node.name = ident.name;
        node.variance = variance;
        node.bound = ident.typeAnnotation;
        if (this.match(29)) {
          this.eat(29);
          node.default = this.flowParseType();
        } else {
          if (requireDefault) {
            this.raise(FlowErrors.MissingTypeParamDefault, nodeStartLoc);
          }
        }
        return this.finishNode(node, "TypeParameter");
      }
      flowParseTypeParameterDeclaration() {
        const oldInType = this.state.inType;
        const node = this.startNode();
        node.params = [];
        this.state.inType = true;
        if (this.match(47) || this.match(143)) {
          this.next();
        } else {
          this.unexpected();
        }
        let defaultRequired = false;
        do {
          const typeParameter = this.flowParseTypeParameter(defaultRequired);
          node.params.push(typeParameter);
          if (typeParameter.default) {
            defaultRequired = true;
          }
          if (!this.match(48)) {
            this.expect(12);
          }
        } while (!this.match(48));
        this.expect(48);
        this.state.inType = oldInType;
        return this.finishNode(node, "TypeParameterDeclaration");
      }
      flowInTopLevelContext(cb) {
        if (this.curContext() !== types2.brace) {
          const oldContext = this.state.context;
          this.state.context = [oldContext[0]];
          try {
            return cb();
          } finally {
            this.state.context = oldContext;
          }
        } else {
          return cb();
        }
      }
      flowParseTypeParameterInstantiationInExpression() {
        if (this.reScan_lt() !== 47) return;
        return this.flowParseTypeParameterInstantiation();
      }
      flowParseTypeParameterInstantiation() {
        const node = this.startNode();
        const oldInType = this.state.inType;
        this.state.inType = true;
        node.params = [];
        this.flowInTopLevelContext(() => {
          this.expect(47);
          const oldNoAnonFunctionType = this.state.noAnonFunctionType;
          this.state.noAnonFunctionType = false;
          while (!this.match(48)) {
            node.params.push(this.flowParseType());
            if (!this.match(48)) {
              this.expect(12);
            }
          }
          this.state.noAnonFunctionType = oldNoAnonFunctionType;
        });
        this.state.inType = oldInType;
        if (!this.state.inType && this.curContext() === types2.brace) {
          this.reScan_lt_gt();
        }
        this.expect(48);
        return this.finishNode(node, "TypeParameterInstantiation");
      }
      flowParseTypeParameterInstantiationCallOrNew() {
        if (this.reScan_lt() !== 47) return null;
        const node = this.startNode();
        const oldInType = this.state.inType;
        node.params = [];
        this.state.inType = true;
        this.expect(47);
        while (!this.match(48)) {
          node.params.push(this.flowParseTypeOrImplicitInstantiation());
          if (!this.match(48)) {
            this.expect(12);
          }
        }
        this.expect(48);
        this.state.inType = oldInType;
        return this.finishNode(node, "TypeParameterInstantiation");
      }
      flowParseInterfaceType() {
        const node = this.startNode();
        this.expectContextual(129);
        node.extends = [];
        if (this.eat(81)) {
          do {
            node.extends.push(this.flowParseInterfaceExtends());
          } while (this.eat(12));
        }
        node.body = this.flowParseObjectType({
          allowStatic: false,
          allowExact: false,
          allowSpread: false,
          allowProto: false,
          allowInexact: false
        });
        return this.finishNode(node, "InterfaceTypeAnnotation");
      }
      flowParseObjectPropertyKey() {
        return this.match(135) || this.match(134) ? super.parseExprAtom() : this.parseIdentifier(true);
      }
      flowParseObjectTypeIndexer(node, isStatic, variance) {
        node.static = isStatic;
        if (this.lookahead().type === 14) {
          node.id = this.flowParseObjectPropertyKey();
          node.key = this.flowParseTypeInitialiser();
        } else {
          node.id = null;
          node.key = this.flowParseType();
        }
        this.expect(3);
        node.value = this.flowParseTypeInitialiser();
        node.variance = variance;
        return this.finishNode(node, "ObjectTypeIndexer");
      }
      flowParseObjectTypeInternalSlot(node, isStatic) {
        node.static = isStatic;
        node.id = this.flowParseObjectPropertyKey();
        this.expect(3);
        this.expect(3);
        if (this.match(47) || this.match(10)) {
          node.method = true;
          node.optional = false;
          node.value = this.flowParseObjectTypeMethodish(this.startNodeAt(node.loc.start));
        } else {
          node.method = false;
          if (this.eat(17)) {
            node.optional = true;
          }
          node.value = this.flowParseTypeInitialiser();
        }
        return this.finishNode(node, "ObjectTypeInternalSlot");
      }
      flowParseObjectTypeMethodish(node) {
        node.params = [];
        node.rest = null;
        node.typeParameters = null;
        node.this = null;
        if (this.match(47)) {
          node.typeParameters = this.flowParseTypeParameterDeclaration();
        }
        this.expect(10);
        if (this.match(78)) {
          node.this = this.flowParseFunctionTypeParam(true);
          node.this.name = null;
          if (!this.match(11)) {
            this.expect(12);
          }
        }
        while (!this.match(11) && !this.match(21)) {
          node.params.push(this.flowParseFunctionTypeParam(false));
          if (!this.match(11)) {
            this.expect(12);
          }
        }
        if (this.eat(21)) {
          node.rest = this.flowParseFunctionTypeParam(false);
        }
        this.expect(11);
        node.returnType = this.flowParseTypeInitialiser();
        return this.finishNode(node, "FunctionTypeAnnotation");
      }
      flowParseObjectTypeCallProperty(node, isStatic) {
        const valueNode = this.startNode();
        node.static = isStatic;
        node.value = this.flowParseObjectTypeMethodish(valueNode);
        return this.finishNode(node, "ObjectTypeCallProperty");
      }
      flowParseObjectType({
        allowStatic,
        allowExact,
        allowSpread,
        allowProto,
        allowInexact
      }) {
        const oldInType = this.state.inType;
        this.state.inType = true;
        const nodeStart = this.startNode();
        nodeStart.callProperties = [];
        nodeStart.properties = [];
        nodeStart.indexers = [];
        nodeStart.internalSlots = [];
        let endDelim;
        let exact;
        let inexact = false;
        if (allowExact && this.match(6)) {
          this.expect(6);
          endDelim = 9;
          exact = true;
        } else {
          this.expect(5);
          endDelim = 8;
          exact = false;
        }
        nodeStart.exact = exact;
        while (!this.match(endDelim)) {
          let isStatic = false;
          let protoStartLoc = null;
          let inexactStartLoc = null;
          const node = this.startNode();
          if (allowProto && this.isContextual(118)) {
            const lookahead = this.lookahead();
            if (lookahead.type !== 14 && lookahead.type !== 17) {
              this.next();
              protoStartLoc = this.state.startLoc;
              allowStatic = false;
            }
          }
          if (allowStatic && this.isContextual(106)) {
            const lookahead = this.lookahead();
            if (lookahead.type !== 14 && lookahead.type !== 17) {
              this.next();
              isStatic = true;
            }
          }
          const variance = this.flowParseVariance();
          if (this.eat(0)) {
            if (protoStartLoc != null) {
              this.unexpected(protoStartLoc);
            }
            if (this.eat(0)) {
              if (variance) {
                this.unexpected(variance.loc.start);
              }
              nodeStart.internalSlots.push(this.flowParseObjectTypeInternalSlot(node, isStatic));
            } else {
              nodeStart.indexers.push(this.flowParseObjectTypeIndexer(node, isStatic, variance));
            }
          } else if (this.match(10) || this.match(47)) {
            if (protoStartLoc != null) {
              this.unexpected(protoStartLoc);
            }
            if (variance) {
              this.unexpected(variance.loc.start);
            }
            nodeStart.callProperties.push(this.flowParseObjectTypeCallProperty(node, isStatic));
          } else {
            let kind = "init";
            if (this.isContextual(99) || this.isContextual(104)) {
              const lookahead = this.lookahead();
              if (tokenIsLiteralPropertyName(lookahead.type)) {
                kind = this.state.value;
                this.next();
              }
            }
            const propOrInexact = this.flowParseObjectTypeProperty(node, isStatic, protoStartLoc, variance, kind, allowSpread, allowInexact != null ? allowInexact : !exact);
            if (propOrInexact === null) {
              inexact = true;
              inexactStartLoc = this.state.lastTokStartLoc;
            } else {
              nodeStart.properties.push(propOrInexact);
            }
          }
          this.flowObjectTypeSemicolon();
          if (inexactStartLoc && !this.match(8) && !this.match(9)) {
            this.raise(FlowErrors.UnexpectedExplicitInexactInObject, inexactStartLoc);
          }
        }
        this.expect(endDelim);
        if (allowSpread) {
          nodeStart.inexact = inexact;
        }
        const out = this.finishNode(nodeStart, "ObjectTypeAnnotation");
        this.state.inType = oldInType;
        return out;
      }
      flowParseObjectTypeProperty(node, isStatic, protoStartLoc, variance, kind, allowSpread, allowInexact) {
        if (this.eat(21)) {
          const isInexactToken = this.match(12) || this.match(13) || this.match(8) || this.match(9);
          if (isInexactToken) {
            if (!allowSpread) {
              this.raise(FlowErrors.InexactInsideNonObject, this.state.lastTokStartLoc);
            } else if (!allowInexact) {
              this.raise(FlowErrors.InexactInsideExact, this.state.lastTokStartLoc);
            }
            if (variance) {
              this.raise(FlowErrors.InexactVariance, variance);
            }
            return null;
          }
          if (!allowSpread) {
            this.raise(FlowErrors.UnexpectedSpreadType, this.state.lastTokStartLoc);
          }
          if (protoStartLoc != null) {
            this.unexpected(protoStartLoc);
          }
          if (variance) {
            this.raise(FlowErrors.SpreadVariance, variance);
          }
          node.argument = this.flowParseType();
          return this.finishNode(node, "ObjectTypeSpreadProperty");
        } else {
          node.key = this.flowParseObjectPropertyKey();
          node.static = isStatic;
          node.proto = protoStartLoc != null;
          node.kind = kind;
          let optional = false;
          if (this.match(47) || this.match(10)) {
            node.method = true;
            if (protoStartLoc != null) {
              this.unexpected(protoStartLoc);
            }
            if (variance) {
              this.unexpected(variance.loc.start);
            }
            node.value = this.flowParseObjectTypeMethodish(this.startNodeAt(node.loc.start));
            if (kind === "get" || kind === "set") {
              this.flowCheckGetterSetterParams(node);
            }
            if (!allowSpread && node.key.name === "constructor" && node.value.this) {
              this.raise(FlowErrors.ThisParamBannedInConstructor, node.value.this);
            }
          } else {
            if (kind !== "init") this.unexpected();
            node.method = false;
            if (this.eat(17)) {
              optional = true;
            }
            node.value = this.flowParseTypeInitialiser();
            node.variance = variance;
          }
          node.optional = optional;
          return this.finishNode(node, "ObjectTypeProperty");
        }
      }
      flowCheckGetterSetterParams(property) {
        const paramCount = property.kind === "get" ? 0 : 1;
        const length = property.value.params.length + (property.value.rest ? 1 : 0);
        if (property.value.this) {
          this.raise(property.kind === "get" ? FlowErrors.GetterMayNotHaveThisParam : FlowErrors.SetterMayNotHaveThisParam, property.value.this);
        }
        if (length !== paramCount) {
          this.raise(property.kind === "get" ? Errors.BadGetterArity : Errors.BadSetterArity, property);
        }
        if (property.kind === "set" && property.value.rest) {
          this.raise(Errors.BadSetterRestParameter, property);
        }
      }
      flowObjectTypeSemicolon() {
        if (!this.eat(13) && !this.eat(12) && !this.match(8) && !this.match(9)) {
          this.unexpected();
        }
      }
      flowParseQualifiedTypeIdentifier(startLoc, id) {
        startLoc != null ? startLoc : startLoc = this.state.startLoc;
        let node = id || this.flowParseRestrictedIdentifier(true);
        while (this.eat(16)) {
          const node2 = this.startNodeAt(startLoc);
          node2.qualification = node;
          node2.id = this.flowParseRestrictedIdentifier(true);
          node = this.finishNode(node2, "QualifiedTypeIdentifier");
        }
        return node;
      }
      flowParseGenericType(startLoc, id) {
        const node = this.startNodeAt(startLoc);
        node.typeParameters = null;
        node.id = this.flowParseQualifiedTypeIdentifier(startLoc, id);
        if (this.match(47)) {
          node.typeParameters = this.flowParseTypeParameterInstantiation();
        }
        return this.finishNode(node, "GenericTypeAnnotation");
      }
      flowParseTypeofType() {
        const node = this.startNode();
        this.expect(87);
        node.argument = this.flowParsePrimaryType();
        return this.finishNode(node, "TypeofTypeAnnotation");
      }
      flowParseTupleType() {
        const node = this.startNode();
        node.types = [];
        this.expect(0);
        while (this.state.pos < this.length && !this.match(3)) {
          node.types.push(this.flowParseType());
          if (this.match(3)) break;
          this.expect(12);
        }
        this.expect(3);
        return this.finishNode(node, "TupleTypeAnnotation");
      }
      flowParseFunctionTypeParam(first) {
        let name = null;
        let optional = false;
        let typeAnnotation = null;
        const node = this.startNode();
        const lh = this.lookahead();
        const isThis = this.state.type === 78;
        if (lh.type === 14 || lh.type === 17) {
          if (isThis && !first) {
            this.raise(FlowErrors.ThisParamMustBeFirst, node);
          }
          name = this.parseIdentifier(isThis);
          if (this.eat(17)) {
            optional = true;
            if (isThis) {
              this.raise(FlowErrors.ThisParamMayNotBeOptional, node);
            }
          }
          typeAnnotation = this.flowParseTypeInitialiser();
        } else {
          typeAnnotation = this.flowParseType();
        }
        node.name = name;
        node.optional = optional;
        node.typeAnnotation = typeAnnotation;
        return this.finishNode(node, "FunctionTypeParam");
      }
      reinterpretTypeAsFunctionTypeParam(type) {
        const node = this.startNodeAt(type.loc.start);
        node.name = null;
        node.optional = false;
        node.typeAnnotation = type;
        return this.finishNode(node, "FunctionTypeParam");
      }
      flowParseFunctionTypeParams(params = []) {
        let rest = null;
        let _this = null;
        if (this.match(78)) {
          _this = this.flowParseFunctionTypeParam(true);
          _this.name = null;
          if (!this.match(11)) {
            this.expect(12);
          }
        }
        while (!this.match(11) && !this.match(21)) {
          params.push(this.flowParseFunctionTypeParam(false));
          if (!this.match(11)) {
            this.expect(12);
          }
        }
        if (this.eat(21)) {
          rest = this.flowParseFunctionTypeParam(false);
        }
        return {
          params,
          rest,
          _this
        };
      }
      flowIdentToTypeAnnotation(startLoc, node, id) {
        switch (id.name) {
          case "any":
            return this.finishNode(node, "AnyTypeAnnotation");
          case "bool":
          case "boolean":
            return this.finishNode(node, "BooleanTypeAnnotation");
          case "mixed":
            return this.finishNode(node, "MixedTypeAnnotation");
          case "empty":
            return this.finishNode(node, "EmptyTypeAnnotation");
          case "number":
            return this.finishNode(node, "NumberTypeAnnotation");
          case "string":
            return this.finishNode(node, "StringTypeAnnotation");
          case "symbol":
            return this.finishNode(node, "SymbolTypeAnnotation");
          default:
            this.checkNotUnderscore(id.name);
            return this.flowParseGenericType(startLoc, id);
        }
      }
      flowParsePrimaryType() {
        const startLoc = this.state.startLoc;
        const node = this.startNode();
        let tmp;
        let type;
        let isGroupedType = false;
        const oldNoAnonFunctionType = this.state.noAnonFunctionType;
        switch (this.state.type) {
          case 5:
            return this.flowParseObjectType({
              allowStatic: false,
              allowExact: false,
              allowSpread: true,
              allowProto: false,
              allowInexact: true
            });
          case 6:
            return this.flowParseObjectType({
              allowStatic: false,
              allowExact: true,
              allowSpread: true,
              allowProto: false,
              allowInexact: false
            });
          case 0:
            this.state.noAnonFunctionType = false;
            type = this.flowParseTupleType();
            this.state.noAnonFunctionType = oldNoAnonFunctionType;
            return type;
          case 47: {
            const node2 = this.startNode();
            node2.typeParameters = this.flowParseTypeParameterDeclaration();
            this.expect(10);
            tmp = this.flowParseFunctionTypeParams();
            node2.params = tmp.params;
            node2.rest = tmp.rest;
            node2.this = tmp._this;
            this.expect(11);
            this.expect(19);
            node2.returnType = this.flowParseType();
            return this.finishNode(node2, "FunctionTypeAnnotation");
          }
          case 10: {
            const node2 = this.startNode();
            this.next();
            if (!this.match(11) && !this.match(21)) {
              if (tokenIsIdentifier(this.state.type) || this.match(78)) {
                const token = this.lookahead().type;
                isGroupedType = token !== 17 && token !== 14;
              } else {
                isGroupedType = true;
              }
            }
            if (isGroupedType) {
              this.state.noAnonFunctionType = false;
              type = this.flowParseType();
              this.state.noAnonFunctionType = oldNoAnonFunctionType;
              if (this.state.noAnonFunctionType || !(this.match(12) || this.match(11) && this.lookahead().type === 19)) {
                this.expect(11);
                return type;
              } else {
                this.eat(12);
              }
            }
            if (type) {
              tmp = this.flowParseFunctionTypeParams([this.reinterpretTypeAsFunctionTypeParam(type)]);
            } else {
              tmp = this.flowParseFunctionTypeParams();
            }
            node2.params = tmp.params;
            node2.rest = tmp.rest;
            node2.this = tmp._this;
            this.expect(11);
            this.expect(19);
            node2.returnType = this.flowParseType();
            node2.typeParameters = null;
            return this.finishNode(node2, "FunctionTypeAnnotation");
          }
          case 134:
            return this.parseLiteral(this.state.value, "StringLiteralTypeAnnotation");
          case 85:
          case 86:
            node.value = this.match(85);
            this.next();
            return this.finishNode(node, "BooleanLiteralTypeAnnotation");
          case 53:
            if (this.state.value === "-") {
              this.next();
              if (this.match(135)) {
                return this.parseLiteralAtNode(-this.state.value, "NumberLiteralTypeAnnotation", node);
              }
              if (this.match(136)) {
                return this.parseLiteralAtNode(-this.state.value, "BigIntLiteralTypeAnnotation", node);
              }
              throw this.raise(FlowErrors.UnexpectedSubtractionOperand, this.state.startLoc);
            }
            throw this.unexpected();
          case 135:
            return this.parseLiteral(this.state.value, "NumberLiteralTypeAnnotation");
          case 136:
            return this.parseLiteral(this.state.value, "BigIntLiteralTypeAnnotation");
          case 88:
            this.next();
            return this.finishNode(node, "VoidTypeAnnotation");
          case 84:
            this.next();
            return this.finishNode(node, "NullLiteralTypeAnnotation");
          case 78:
            this.next();
            return this.finishNode(node, "ThisTypeAnnotation");
          case 55:
            this.next();
            return this.finishNode(node, "ExistsTypeAnnotation");
          case 87:
            return this.flowParseTypeofType();
          default:
            if (tokenIsKeyword(this.state.type)) {
              const label = tokenLabelName(this.state.type);
              this.next();
              return super.createIdentifier(node, label);
            } else if (tokenIsIdentifier(this.state.type)) {
              if (this.isContextual(129)) {
                return this.flowParseInterfaceType();
              }
              return this.flowIdentToTypeAnnotation(startLoc, node, this.parseIdentifier());
            }
        }
        throw this.unexpected();
      }
      flowParsePostfixType() {
        const startLoc = this.state.startLoc;
        let type = this.flowParsePrimaryType();
        let seenOptionalIndexedAccess = false;
        while ((this.match(0) || this.match(18)) && !this.canInsertSemicolon()) {
          const node = this.startNodeAt(startLoc);
          const optional = this.eat(18);
          seenOptionalIndexedAccess = seenOptionalIndexedAccess || optional;
          this.expect(0);
          if (!optional && this.match(3)) {
            node.elementType = type;
            this.next();
            type = this.finishNode(node, "ArrayTypeAnnotation");
          } else {
            node.objectType = type;
            node.indexType = this.flowParseType();
            this.expect(3);
            if (seenOptionalIndexedAccess) {
              node.optional = optional;
              type = this.finishNode(node, "OptionalIndexedAccessType");
            } else {
              type = this.finishNode(node, "IndexedAccessType");
            }
          }
        }
        return type;
      }
      flowParsePrefixType() {
        const node = this.startNode();
        if (this.eat(17)) {
          node.typeAnnotation = this.flowParsePrefixType();
          return this.finishNode(node, "NullableTypeAnnotation");
        } else {
          return this.flowParsePostfixType();
        }
      }
      flowParseAnonFunctionWithoutParens() {
        const param = this.flowParsePrefixType();
        if (!this.state.noAnonFunctionType && this.eat(19)) {
          const node = this.startNodeAt(param.loc.start);
          node.params = [this.reinterpretTypeAsFunctionTypeParam(param)];
          node.rest = null;
          node.this = null;
          node.returnType = this.flowParseType();
          node.typeParameters = null;
          return this.finishNode(node, "FunctionTypeAnnotation");
        }
        return param;
      }
      flowParseIntersectionType() {
        const node = this.startNode();
        this.eat(45);
        const type = this.flowParseAnonFunctionWithoutParens();
        node.types = [type];
        while (this.eat(45)) {
          node.types.push(this.flowParseAnonFunctionWithoutParens());
        }
        return node.types.length === 1 ? type : this.finishNode(node, "IntersectionTypeAnnotation");
      }
      flowParseUnionType() {
        const node = this.startNode();
        this.eat(43);
        const type = this.flowParseIntersectionType();
        node.types = [type];
        while (this.eat(43)) {
          node.types.push(this.flowParseIntersectionType());
        }
        return node.types.length === 1 ? type : this.finishNode(node, "UnionTypeAnnotation");
      }
      flowParseType() {
        const oldInType = this.state.inType;
        this.state.inType = true;
        const type = this.flowParseUnionType();
        this.state.inType = oldInType;
        return type;
      }
      flowParseTypeOrImplicitInstantiation() {
        if (this.state.type === 132 && this.state.value === "_") {
          const startLoc = this.state.startLoc;
          const node = this.parseIdentifier();
          return this.flowParseGenericType(startLoc, node);
        } else {
          return this.flowParseType();
        }
      }
      flowParseTypeAnnotation() {
        const node = this.startNode();
        node.typeAnnotation = this.flowParseTypeInitialiser();
        return this.finishNode(node, "TypeAnnotation");
      }
      flowParseTypeAnnotatableIdentifier(allowPrimitiveOverride) {
        const ident = allowPrimitiveOverride ? this.parseIdentifier() : this.flowParseRestrictedIdentifier();
        if (this.match(14)) {
          ident.typeAnnotation = this.flowParseTypeAnnotation();
          this.resetEndLocation(ident);
        }
        return ident;
      }
      typeCastToParameter(node) {
        node.expression.typeAnnotation = node.typeAnnotation;
        this.resetEndLocation(node.expression, node.typeAnnotation.loc.end);
        return node.expression;
      }
      flowParseVariance() {
        let variance = null;
        if (this.match(53)) {
          variance = this.startNode();
          if (this.state.value === "+") {
            variance.kind = "plus";
          } else {
            variance.kind = "minus";
          }
          this.next();
          return this.finishNode(variance, "Variance");
        }
        return variance;
      }
      parseFunctionBody(node, allowExpressionBody, isMethod = false) {
        if (allowExpressionBody) {
          this.forwardNoArrowParamsConversionAt(node, () => super.parseFunctionBody(node, true, isMethod));
          return;
        }
        super.parseFunctionBody(node, false, isMethod);
      }
      parseFunctionBodyAndFinish(node, type, isMethod = false) {
        if (this.match(14)) {
          const typeNode = this.startNode();
          [typeNode.typeAnnotation, node.predicate] = this.flowParseTypeAndPredicateInitialiser();
          node.returnType = typeNode.typeAnnotation ? this.finishNode(typeNode, "TypeAnnotation") : null;
        }
        return super.parseFunctionBodyAndFinish(node, type, isMethod);
      }
      parseStatementLike(flags) {
        if (this.state.strict && this.isContextual(129)) {
          const lookahead = this.lookahead();
          if (tokenIsKeywordOrIdentifier(lookahead.type)) {
            const node = this.startNode();
            this.next();
            return this.flowParseInterface(node);
          }
        } else if (this.isContextual(126)) {
          const node = this.startNode();
          this.next();
          return this.flowParseEnumDeclaration(node);
        }
        const stmt = super.parseStatementLike(flags);
        if (this.flowPragma === void 0 && !this.isValidDirective(stmt)) {
          this.flowPragma = null;
        }
        return stmt;
      }
      parseExpressionStatement(node, expr, decorators) {
        if (expr.type === "Identifier") {
          if (expr.name === "declare") {
            if (this.match(80) || tokenIsIdentifier(this.state.type) || this.match(68) || this.match(74) || this.match(82)) {
              return this.flowParseDeclare(node);
            }
          } else if (tokenIsIdentifier(this.state.type)) {
            if (expr.name === "interface") {
              return this.flowParseInterface(node);
            } else if (expr.name === "type") {
              return this.flowParseTypeAlias(node);
            } else if (expr.name === "opaque") {
              return this.flowParseOpaqueType(node, false);
            }
          }
        }
        return super.parseExpressionStatement(node, expr, decorators);
      }
      shouldParseExportDeclaration() {
        const {
          type
        } = this.state;
        if (type === 126 || tokenIsFlowInterfaceOrTypeOrOpaque(type)) {
          return !this.state.containsEsc;
        }
        return super.shouldParseExportDeclaration();
      }
      isExportDefaultSpecifier() {
        const {
          type
        } = this.state;
        if (type === 126 || tokenIsFlowInterfaceOrTypeOrOpaque(type)) {
          return this.state.containsEsc;
        }
        return super.isExportDefaultSpecifier();
      }
      parseExportDefaultExpression() {
        if (this.isContextual(126)) {
          const node = this.startNode();
          this.next();
          return this.flowParseEnumDeclaration(node);
        }
        return super.parseExportDefaultExpression();
      }
      parseConditional(expr, startLoc, refExpressionErrors) {
        if (!this.match(17)) return expr;
        if (this.state.maybeInArrowParameters) {
          const nextCh = this.lookaheadCharCode();
          if (nextCh === 44 || nextCh === 61 || nextCh === 58 || nextCh === 41) {
            this.setOptionalParametersError(refExpressionErrors);
            return expr;
          }
        }
        this.expect(17);
        const state = this.state.clone();
        const originalNoArrowAt = this.state.noArrowAt;
        const node = this.startNodeAt(startLoc);
        let {
          consequent,
          failed
        } = this.tryParseConditionalConsequent();
        let [valid, invalid] = this.getArrowLikeExpressions(consequent);
        if (failed || invalid.length > 0) {
          const noArrowAt = [...originalNoArrowAt];
          if (invalid.length > 0) {
            this.state = state;
            this.state.noArrowAt = noArrowAt;
            for (let i = 0; i < invalid.length; i++) {
              noArrowAt.push(invalid[i].start);
            }
            ({
              consequent,
              failed
            } = this.tryParseConditionalConsequent());
            [valid, invalid] = this.getArrowLikeExpressions(consequent);
          }
          if (failed && valid.length > 1) {
            this.raise(FlowErrors.AmbiguousConditionalArrow, state.startLoc);
          }
          if (failed && valid.length === 1) {
            this.state = state;
            noArrowAt.push(valid[0].start);
            this.state.noArrowAt = noArrowAt;
            ({
              consequent,
              failed
            } = this.tryParseConditionalConsequent());
          }
        }
        this.getArrowLikeExpressions(consequent, true);
        this.state.noArrowAt = originalNoArrowAt;
        this.expect(14);
        node.test = expr;
        node.consequent = consequent;
        node.alternate = this.forwardNoArrowParamsConversionAt(node, () => this.parseMaybeAssign(void 0, void 0));
        return this.finishNode(node, "ConditionalExpression");
      }
      tryParseConditionalConsequent() {
        this.state.noArrowParamsConversionAt.push(this.state.start);
        const consequent = this.parseMaybeAssignAllowIn();
        const failed = !this.match(14);
        this.state.noArrowParamsConversionAt.pop();
        return {
          consequent,
          failed
        };
      }
      getArrowLikeExpressions(node, disallowInvalid) {
        const stack = [node];
        const arrows = [];
        while (stack.length !== 0) {
          const node2 = stack.pop();
          if (node2.type === "ArrowFunctionExpression" && node2.body.type !== "BlockStatement") {
            if (node2.typeParameters || !node2.returnType) {
              this.finishArrowValidation(node2);
            } else {
              arrows.push(node2);
            }
            stack.push(node2.body);
          } else if (node2.type === "ConditionalExpression") {
            stack.push(node2.consequent);
            stack.push(node2.alternate);
          }
        }
        if (disallowInvalid) {
          arrows.forEach((node2) => this.finishArrowValidation(node2));
          return [arrows, []];
        }
        return partition(arrows, (node2) => node2.params.every((param) => this.isAssignable(param, true)));
      }
      finishArrowValidation(node) {
        var _node$extra;
        this.toAssignableList(node.params, (_node$extra = node.extra) == null ? void 0 : _node$extra.trailingCommaLoc, false);
        this.scope.enter(514 | 4);
        super.checkParams(node, false, true);
        this.scope.exit();
      }
      forwardNoArrowParamsConversionAt(node, parse3) {
        let result;
        if (this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(node.start))) {
          this.state.noArrowParamsConversionAt.push(this.state.start);
          result = parse3();
          this.state.noArrowParamsConversionAt.pop();
        } else {
          result = parse3();
        }
        return result;
      }
      parseParenItem(node, startLoc) {
        const newNode = super.parseParenItem(node, startLoc);
        if (this.eat(17)) {
          newNode.optional = true;
          this.resetEndLocation(node);
        }
        if (this.match(14)) {
          const typeCastNode = this.startNodeAt(startLoc);
          typeCastNode.expression = newNode;
          typeCastNode.typeAnnotation = this.flowParseTypeAnnotation();
          return this.finishNode(typeCastNode, "TypeCastExpression");
        }
        return newNode;
      }
      assertModuleNodeAllowed(node) {
        if (node.type === "ImportDeclaration" && (node.importKind === "type" || node.importKind === "typeof") || node.type === "ExportNamedDeclaration" && node.exportKind === "type" || node.type === "ExportAllDeclaration" && node.exportKind === "type") {
          return;
        }
        super.assertModuleNodeAllowed(node);
      }
      parseExportDeclaration(node) {
        if (this.isContextual(130)) {
          node.exportKind = "type";
          const declarationNode = this.startNode();
          this.next();
          if (this.match(5)) {
            node.specifiers = this.parseExportSpecifiers(true);
            super.parseExportFrom(node);
            return null;
          } else {
            return this.flowParseTypeAlias(declarationNode);
          }
        } else if (this.isContextual(131)) {
          node.exportKind = "type";
          const declarationNode = this.startNode();
          this.next();
          return this.flowParseOpaqueType(declarationNode, false);
        } else if (this.isContextual(129)) {
          node.exportKind = "type";
          const declarationNode = this.startNode();
          this.next();
          return this.flowParseInterface(declarationNode);
        } else if (this.isContextual(126)) {
          node.exportKind = "value";
          const declarationNode = this.startNode();
          this.next();
          return this.flowParseEnumDeclaration(declarationNode);
        } else {
          return super.parseExportDeclaration(node);
        }
      }
      eatExportStar(node) {
        if (super.eatExportStar(node)) return true;
        if (this.isContextual(130) && this.lookahead().type === 55) {
          node.exportKind = "type";
          this.next();
          this.next();
          return true;
        }
        return false;
      }
      maybeParseExportNamespaceSpecifier(node) {
        const {
          startLoc
        } = this.state;
        const hasNamespace = super.maybeParseExportNamespaceSpecifier(node);
        if (hasNamespace && node.exportKind === "type") {
          this.unexpected(startLoc);
        }
        return hasNamespace;
      }
      parseClassId(node, isStatement, optionalId) {
        super.parseClassId(node, isStatement, optionalId);
        if (this.match(47)) {
          node.typeParameters = this.flowParseTypeParameterDeclaration();
        }
      }
      parseClassMember(classBody, member, state) {
        const {
          startLoc
        } = this.state;
        if (this.isContextual(125)) {
          if (super.parseClassMemberFromModifier(classBody, member)) {
            return;
          }
          member.declare = true;
        }
        super.parseClassMember(classBody, member, state);
        if (member.declare) {
          if (member.type !== "ClassProperty" && member.type !== "ClassPrivateProperty" && member.type !== "PropertyDefinition") {
            this.raise(FlowErrors.DeclareClassElement, startLoc);
          } else if (member.value) {
            this.raise(FlowErrors.DeclareClassFieldInitializer, member.value);
          }
        }
      }
      isIterator(word) {
        return word === "iterator" || word === "asyncIterator";
      }
      readIterator() {
        const word = super.readWord1();
        const fullWord = "@@" + word;
        if (!this.isIterator(word) || !this.state.inType) {
          this.raise(Errors.InvalidIdentifier, this.state.curPosition(), {
            identifierName: fullWord
          });
        }
        this.finishToken(132, fullWord);
      }
      getTokenFromCode(code2) {
        const next = this.input.charCodeAt(this.state.pos + 1);
        if (code2 === 123 && next === 124) {
          this.finishOp(6, 2);
        } else if (this.state.inType && (code2 === 62 || code2 === 60)) {
          this.finishOp(code2 === 62 ? 48 : 47, 1);
        } else if (this.state.inType && code2 === 63) {
          if (next === 46) {
            this.finishOp(18, 2);
          } else {
            this.finishOp(17, 1);
          }
        } else if (isIteratorStart(code2, next, this.input.charCodeAt(this.state.pos + 2))) {
          this.state.pos += 2;
          this.readIterator();
        } else {
          super.getTokenFromCode(code2);
        }
      }
      isAssignable(node, isBinding) {
        if (node.type === "TypeCastExpression") {
          return this.isAssignable(node.expression, isBinding);
        } else {
          return super.isAssignable(node, isBinding);
        }
      }
      toAssignable(node, isLHS = false) {
        if (!isLHS && node.type === "AssignmentExpression" && node.left.type === "TypeCastExpression") {
          node.left = this.typeCastToParameter(node.left);
        }
        super.toAssignable(node, isLHS);
      }
      toAssignableList(exprList, trailingCommaLoc, isLHS) {
        for (let i = 0; i < exprList.length; i++) {
          const expr = exprList[i];
          if ((expr == null ? void 0 : expr.type) === "TypeCastExpression") {
            exprList[i] = this.typeCastToParameter(expr);
          }
        }
        super.toAssignableList(exprList, trailingCommaLoc, isLHS);
      }
      toReferencedList(exprList, isParenthesizedExpr) {
        for (let i = 0; i < exprList.length; i++) {
          var _expr$extra;
          const expr = exprList[i];
          if (expr && expr.type === "TypeCastExpression" && !((_expr$extra = expr.extra) != null && _expr$extra.parenthesized) && (exprList.length > 1 || !isParenthesizedExpr)) {
            this.raise(FlowErrors.TypeCastInPattern, expr.typeAnnotation);
          }
        }
        return exprList;
      }
      parseArrayLike(close, isTuple, refExpressionErrors) {
        const node = super.parseArrayLike(close, isTuple, refExpressionErrors);
        if (refExpressionErrors != null && !this.state.maybeInArrowParameters) {
          this.toReferencedList(node.elements);
        }
        return node;
      }
      isValidLVal(type, disallowCallExpression, isParenthesized, binding) {
        return type === "TypeCastExpression" || super.isValidLVal(type, disallowCallExpression, isParenthesized, binding);
      }
      parseClassProperty(node) {
        if (this.match(14)) {
          node.typeAnnotation = this.flowParseTypeAnnotation();
        }
        return super.parseClassProperty(node);
      }
      parseClassPrivateProperty(node) {
        if (this.match(14)) {
          node.typeAnnotation = this.flowParseTypeAnnotation();
        }
        return super.parseClassPrivateProperty(node);
      }
      isClassMethod() {
        return this.match(47) || super.isClassMethod();
      }
      isClassProperty() {
        return this.match(14) || super.isClassProperty();
      }
      isNonstaticConstructor(method) {
        return !this.match(14) && super.isNonstaticConstructor(method);
      }
      pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) {
        if (method.variance) {
          this.unexpected(method.variance.loc.start);
        }
        delete method.variance;
        if (this.match(47)) {
          method.typeParameters = this.flowParseTypeParameterDeclaration();
        }
        super.pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper);
        if (method.params && isConstructor) {
          const params = method.params;
          if (params.length > 0 && this.isThisParam(params[0])) {
            this.raise(FlowErrors.ThisParamBannedInConstructor, method);
          }
        } else if (method.type === "MethodDefinition" && isConstructor && method.value.params) {
          const params = method.value.params;
          if (params.length > 0 && this.isThisParam(params[0])) {
            this.raise(FlowErrors.ThisParamBannedInConstructor, method);
          }
        }
      }
      pushClassPrivateMethod(classBody, method, isGenerator, isAsync) {
        if (method.variance) {
          this.unexpected(method.variance.loc.start);
        }
        delete method.variance;
        if (this.match(47)) {
          method.typeParameters = this.flowParseTypeParameterDeclaration();
        }
        super.pushClassPrivateMethod(classBody, method, isGenerator, isAsync);
      }
      parseClassSuper(node) {
        super.parseClassSuper(node);
        if (node.superClass && (this.match(47) || this.match(51))) {
          node.superTypeParameters = this.flowParseTypeParameterInstantiationInExpression();
        }
        if (this.isContextual(113)) {
          this.next();
          const implemented = node.implements = [];
          do {
            const node2 = this.startNode();
            node2.id = this.flowParseRestrictedIdentifier(true);
            if (this.match(47)) {
              node2.typeParameters = this.flowParseTypeParameterInstantiation();
            } else {
              node2.typeParameters = null;
            }
            implemented.push(this.finishNode(node2, "ClassImplements"));
          } while (this.eat(12));
        }
      }
      checkGetterSetterParams(method) {
        super.checkGetterSetterParams(method);
        const params = this.getObjectOrClassMethodParams(method);
        if (params.length > 0) {
          const param = params[0];
          if (this.isThisParam(param) && method.kind === "get") {
            this.raise(FlowErrors.GetterMayNotHaveThisParam, param);
          } else if (this.isThisParam(param)) {
            this.raise(FlowErrors.SetterMayNotHaveThisParam, param);
          }
        }
      }
      parsePropertyNamePrefixOperator(node) {
        node.variance = this.flowParseVariance();
      }
      parseObjPropValue(prop, startLoc, isGenerator, isAsync, isPattern, isAccessor, refExpressionErrors) {
        if (prop.variance) {
          this.unexpected(prop.variance.loc.start);
        }
        delete prop.variance;
        let typeParameters;
        if (this.match(47) && !isAccessor) {
          typeParameters = this.flowParseTypeParameterDeclaration();
          if (!this.match(10)) this.unexpected();
        }
        const result = super.parseObjPropValue(prop, startLoc, isGenerator, isAsync, isPattern, isAccessor, refExpressionErrors);
        if (typeParameters) {
          (result.value || result).typeParameters = typeParameters;
        }
        return result;
      }
      parseFunctionParamType(param) {
        if (this.eat(17)) {
          if (param.type !== "Identifier") {
            this.raise(FlowErrors.PatternIsOptional, param);
          }
          if (this.isThisParam(param)) {
            this.raise(FlowErrors.ThisParamMayNotBeOptional, param);
          }
          param.optional = true;
        }
        if (this.match(14)) {
          param.typeAnnotation = this.flowParseTypeAnnotation();
        } else if (this.isThisParam(param)) {
          this.raise(FlowErrors.ThisParamAnnotationRequired, param);
        }
        if (this.match(29) && this.isThisParam(param)) {
          this.raise(FlowErrors.ThisParamNoDefault, param);
        }
        this.resetEndLocation(param);
        return param;
      }
      parseMaybeDefault(startLoc, left) {
        const node = super.parseMaybeDefault(startLoc, left);
        if (node.type === "AssignmentPattern" && node.typeAnnotation && node.right.start < node.typeAnnotation.start) {
          this.raise(FlowErrors.TypeBeforeInitializer, node.typeAnnotation);
        }
        return node;
      }
      checkImportReflection(node) {
        super.checkImportReflection(node);
        if (node.module && node.importKind !== "value") {
          this.raise(FlowErrors.ImportReflectionHasImportType, node.specifiers[0].loc.start);
        }
      }
      parseImportSpecifierLocal(node, specifier, type) {
        specifier.local = hasTypeImportKind(node) ? this.flowParseRestrictedIdentifier(true, true) : this.parseIdentifier();
        node.specifiers.push(this.finishImportSpecifier(specifier, type));
      }
      isPotentialImportPhase(isExport) {
        if (super.isPotentialImportPhase(isExport)) return true;
        if (this.isContextual(130)) {
          if (!isExport) return true;
          const ch = this.lookaheadCharCode();
          return ch === 123 || ch === 42;
        }
        return !isExport && this.isContextual(87);
      }
      applyImportPhase(node, isExport, phase, loc) {
        super.applyImportPhase(node, isExport, phase, loc);
        if (isExport) {
          if (!phase && this.match(65)) {
            return;
          }
          node.exportKind = phase === "type" ? phase : "value";
        } else {
          if (phase === "type" && this.match(55)) this.unexpected();
          node.importKind = phase === "type" || phase === "typeof" ? phase : "value";
        }
      }
      parseImportSpecifier(specifier, importedIsString, isInTypeOnlyImport, isMaybeTypeOnly, bindingType) {
        const firstIdent = specifier.imported;
        let specifierTypeKind = null;
        if (firstIdent.type === "Identifier") {
          if (firstIdent.name === "type") {
            specifierTypeKind = "type";
          } else if (firstIdent.name === "typeof") {
            specifierTypeKind = "typeof";
          }
        }
        let isBinding = false;
        if (this.isContextual(93) && !this.isLookaheadContextual("as")) {
          const as_ident = this.parseIdentifier(true);
          if (specifierTypeKind !== null && !tokenIsKeywordOrIdentifier(this.state.type)) {
            specifier.imported = as_ident;
            specifier.importKind = specifierTypeKind;
            specifier.local = this.cloneIdentifier(as_ident);
          } else {
            specifier.imported = firstIdent;
            specifier.importKind = null;
            specifier.local = this.parseIdentifier();
          }
        } else {
          if (specifierTypeKind !== null && tokenIsKeywordOrIdentifier(this.state.type)) {
            specifier.imported = this.parseIdentifier(true);
            specifier.importKind = specifierTypeKind;
          } else {
            if (importedIsString) {
              throw this.raise(Errors.ImportBindingIsString, specifier, {
                importName: firstIdent.value
              });
            }
            specifier.imported = firstIdent;
            specifier.importKind = null;
          }
          if (this.eatContextual(93)) {
            specifier.local = this.parseIdentifier();
          } else {
            isBinding = true;
            specifier.local = this.cloneIdentifier(specifier.imported);
          }
        }
        const specifierIsTypeImport = hasTypeImportKind(specifier);
        if (isInTypeOnlyImport && specifierIsTypeImport) {
          this.raise(FlowErrors.ImportTypeShorthandOnlyInPureImport, specifier);
        }
        if (isInTypeOnlyImport || specifierIsTypeImport) {
          this.checkReservedType(specifier.local.name, specifier.local.loc.start, true);
        }
        if (isBinding && !isInTypeOnlyImport && !specifierIsTypeImport) {
          this.checkReservedWord(specifier.local.name, specifier.loc.start, true, true);
        }
        return this.finishImportSpecifier(specifier, "ImportSpecifier");
      }
      parseBindingAtom() {
        switch (this.state.type) {
          case 78:
            return this.parseIdentifier(true);
          default:
            return super.parseBindingAtom();
        }
      }
      parseFunctionParams(node, isConstructor) {
        const kind = node.kind;
        if (kind !== "get" && kind !== "set" && this.match(47)) {
          node.typeParameters = this.flowParseTypeParameterDeclaration();
        }
        super.parseFunctionParams(node, isConstructor);
      }
      parseVarId(decl, kind) {
        super.parseVarId(decl, kind);
        if (this.match(14)) {
          decl.id.typeAnnotation = this.flowParseTypeAnnotation();
          this.resetEndLocation(decl.id);
        }
      }
      parseAsyncArrowFromCallExpression(node, call) {
        if (this.match(14)) {
          const oldNoAnonFunctionType = this.state.noAnonFunctionType;
          this.state.noAnonFunctionType = true;
          node.returnType = this.flowParseTypeAnnotation();
          this.state.noAnonFunctionType = oldNoAnonFunctionType;
        }
        return super.parseAsyncArrowFromCallExpression(node, call);
      }
      shouldParseAsyncArrow() {
        return this.match(14) || super.shouldParseAsyncArrow();
      }
      parseMaybeAssign(refExpressionErrors, afterLeftParse) {
        var _jsx;
        let state = null;
        let jsx2;
        if (this.hasPlugin("jsx") && (this.match(143) || this.match(47))) {
          state = this.state.clone();
          jsx2 = this.tryParse(() => super.parseMaybeAssign(refExpressionErrors, afterLeftParse), state);
          if (!jsx2.error) return jsx2.node;
          const {
            context
          } = this.state;
          const currentContext = context[context.length - 1];
          if (currentContext === types2.j_oTag || currentContext === types2.j_expr) {
            context.pop();
          }
        }
        if ((_jsx = jsx2) != null && _jsx.error || this.match(47)) {
          var _jsx2, _jsx3;
          state = state || this.state.clone();
          let typeParameters;
          const arrow = this.tryParse((abort) => {
            var _arrowExpression$extr;
            typeParameters = this.flowParseTypeParameterDeclaration();
            const arrowExpression2 = this.forwardNoArrowParamsConversionAt(typeParameters, () => {
              const result = super.parseMaybeAssign(refExpressionErrors, afterLeftParse);
              this.resetStartLocationFromNode(result, typeParameters);
              return result;
            });
            if ((_arrowExpression$extr = arrowExpression2.extra) != null && _arrowExpression$extr.parenthesized) abort();
            const expr = this.maybeUnwrapTypeCastExpression(arrowExpression2);
            if (expr.type !== "ArrowFunctionExpression") abort();
            expr.typeParameters = typeParameters;
            this.resetStartLocationFromNode(expr, typeParameters);
            return arrowExpression2;
          }, state);
          let arrowExpression = null;
          if (arrow.node && this.maybeUnwrapTypeCastExpression(arrow.node).type === "ArrowFunctionExpression") {
            if (!arrow.error && !arrow.aborted) {
              if (arrow.node.async) {
                this.raise(FlowErrors.UnexpectedTypeParameterBeforeAsyncArrowFunction, typeParameters);
              }
              return arrow.node;
            }
            arrowExpression = arrow.node;
          }
          if ((_jsx2 = jsx2) != null && _jsx2.node) {
            this.state = jsx2.failState;
            return jsx2.node;
          }
          if (arrowExpression) {
            this.state = arrow.failState;
            return arrowExpression;
          }
          if ((_jsx3 = jsx2) != null && _jsx3.thrown) throw jsx2.error;
          if (arrow.thrown) throw arrow.error;
          throw this.raise(FlowErrors.UnexpectedTokenAfterTypeParameter, typeParameters);
        }
        return super.parseMaybeAssign(refExpressionErrors, afterLeftParse);
      }
      parseArrow(node) {
        if (this.match(14)) {
          const result = this.tryParse(() => {
            const oldNoAnonFunctionType = this.state.noAnonFunctionType;
            this.state.noAnonFunctionType = true;
            const typeNode = this.startNode();
            [typeNode.typeAnnotation, node.predicate] = this.flowParseTypeAndPredicateInitialiser();
            this.state.noAnonFunctionType = oldNoAnonFunctionType;
            if (this.canInsertSemicolon()) this.unexpected();
            if (!this.match(19)) this.unexpected();
            return typeNode;
          });
          if (result.thrown) return null;
          if (result.error) this.state = result.failState;
          node.returnType = result.node.typeAnnotation ? this.finishNode(result.node, "TypeAnnotation") : null;
        }
        return super.parseArrow(node);
      }
      shouldParseArrow(params) {
        return this.match(14) || super.shouldParseArrow(params);
      }
      setArrowFunctionParameters(node, params) {
        if (this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(node.start))) {
          node.params = params;
        } else {
          super.setArrowFunctionParameters(node, params);
        }
      }
      checkParams(node, allowDuplicates, isArrowFunction, strictModeChanged = true) {
        if (isArrowFunction && this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(node.start))) {
          return;
        }
        for (let i = 0; i < node.params.length; i++) {
          if (this.isThisParam(node.params[i]) && i > 0) {
            this.raise(FlowErrors.ThisParamMustBeFirst, node.params[i]);
          }
        }
        super.checkParams(node, allowDuplicates, isArrowFunction, strictModeChanged);
      }
      parseParenAndDistinguishExpression(canBeArrow) {
        return super.parseParenAndDistinguishExpression(canBeArrow && !this.state.noArrowAt.includes(this.sourceToOffsetPos(this.state.start)));
      }
      parseSubscripts(base, startLoc, noCalls) {
        if (base.type === "Identifier" && base.name === "async" && this.state.noArrowAt.includes(startLoc.index)) {
          this.next();
          const node = this.startNodeAt(startLoc);
          node.callee = base;
          node.arguments = super.parseCallExpressionArguments();
          base = this.finishNode(node, "CallExpression");
        } else if (base.type === "Identifier" && base.name === "async" && this.match(47)) {
          const state = this.state.clone();
          const arrow = this.tryParse((abort) => this.parseAsyncArrowWithTypeParameters(startLoc) || abort(), state);
          if (!arrow.error && !arrow.aborted) return arrow.node;
          const result = this.tryParse(() => super.parseSubscripts(base, startLoc, noCalls), state);
          if (result.node && !result.error) return result.node;
          if (arrow.node) {
            this.state = arrow.failState;
            return arrow.node;
          }
          if (result.node) {
            this.state = result.failState;
            return result.node;
          }
          throw arrow.error || result.error;
        }
        return super.parseSubscripts(base, startLoc, noCalls);
      }
      parseSubscript(base, startLoc, noCalls, subscriptState) {
        if (this.match(18) && this.isLookaheadToken_lt()) {
          subscriptState.optionalChainMember = true;
          if (noCalls) {
            subscriptState.stop = true;
            return base;
          }
          this.next();
          const node = this.startNodeAt(startLoc);
          node.callee = base;
          node.typeArguments = this.flowParseTypeParameterInstantiationInExpression();
          this.expect(10);
          node.arguments = this.parseCallExpressionArguments();
          node.optional = true;
          return this.finishCallExpression(node, true);
        } else if (!noCalls && this.shouldParseTypes() && (this.match(47) || this.match(51))) {
          const node = this.startNodeAt(startLoc);
          node.callee = base;
          const result = this.tryParse(() => {
            node.typeArguments = this.flowParseTypeParameterInstantiationCallOrNew();
            this.expect(10);
            node.arguments = super.parseCallExpressionArguments();
            if (subscriptState.optionalChainMember) {
              node.optional = false;
            }
            return this.finishCallExpression(node, subscriptState.optionalChainMember);
          });
          if (result.node) {
            if (result.error) this.state = result.failState;
            return result.node;
          }
        }
        return super.parseSubscript(base, startLoc, noCalls, subscriptState);
      }
      parseNewCallee(node) {
        super.parseNewCallee(node);
        let targs = null;
        if (this.shouldParseTypes() && this.match(47)) {
          targs = this.tryParse(() => this.flowParseTypeParameterInstantiationCallOrNew()).node;
        }
        node.typeArguments = targs;
      }
      parseAsyncArrowWithTypeParameters(startLoc) {
        const node = this.startNodeAt(startLoc);
        this.parseFunctionParams(node, false);
        if (!this.parseArrow(node)) return;
        return super.parseArrowExpression(node, void 0, true);
      }
      readToken_mult_modulo(code2) {
        const next = this.input.charCodeAt(this.state.pos + 1);
        if (code2 === 42 && next === 47 && this.state.hasFlowComment) {
          this.state.hasFlowComment = false;
          this.state.pos += 2;
          this.nextToken();
          return;
        }
        super.readToken_mult_modulo(code2);
      }
      readToken_pipe_amp(code2) {
        const next = this.input.charCodeAt(this.state.pos + 1);
        if (code2 === 124 && next === 125) {
          this.finishOp(9, 2);
          return;
        }
        super.readToken_pipe_amp(code2);
      }
      parseTopLevel(file, program) {
        const fileNode = super.parseTopLevel(file, program);
        if (this.state.hasFlowComment) {
          this.raise(FlowErrors.UnterminatedFlowComment, this.state.curPosition());
        }
        return fileNode;
      }
      skipBlockComment() {
        if (this.hasPlugin("flowComments") && this.skipFlowComment()) {
          if (this.state.hasFlowComment) {
            throw this.raise(FlowErrors.NestedFlowComment, this.state.startLoc);
          }
          this.hasFlowCommentCompletion();
          const commentSkip = this.skipFlowComment();
          if (commentSkip) {
            this.state.pos += commentSkip;
            this.state.hasFlowComment = true;
          }
          return;
        }
        return super.skipBlockComment(this.state.hasFlowComment ? "*-/" : "*/");
      }
      skipFlowComment() {
        const {
          pos
        } = this.state;
        let shiftToFirstNonWhiteSpace = 2;
        while ([32, 9].includes(this.input.charCodeAt(pos + shiftToFirstNonWhiteSpace))) {
          shiftToFirstNonWhiteSpace++;
        }
        const ch2 = this.input.charCodeAt(shiftToFirstNonWhiteSpace + pos);
        const ch3 = this.input.charCodeAt(shiftToFirstNonWhiteSpace + pos + 1);
        if (ch2 === 58 && ch3 === 58) {
          return shiftToFirstNonWhiteSpace + 2;
        }
        if (this.input.slice(shiftToFirstNonWhiteSpace + pos, shiftToFirstNonWhiteSpace + pos + 12) === "flow-include") {
          return shiftToFirstNonWhiteSpace + 12;
        }
        if (ch2 === 58 && ch3 !== 58) {
          return shiftToFirstNonWhiteSpace;
        }
        return false;
      }
      hasFlowCommentCompletion() {
        const end = this.input.indexOf("*/", this.state.pos);
        if (end === -1) {
          throw this.raise(Errors.UnterminatedComment, this.state.curPosition());
        }
      }
      flowEnumErrorBooleanMemberNotInitialized(loc, {
        enumName,
        memberName
      }) {
        this.raise(FlowErrors.EnumBooleanMemberNotInitialized, loc, {
          memberName,
          enumName
        });
      }
      flowEnumErrorInvalidMemberInitializer(loc, enumContext) {
        return this.raise(!enumContext.explicitType ? FlowErrors.EnumInvalidMemberInitializerUnknownType : enumContext.explicitType === "symbol" ? FlowErrors.EnumInvalidMemberInitializerSymbolType : FlowErrors.EnumInvalidMemberInitializerPrimaryType, loc, enumContext);
      }
      flowEnumErrorNumberMemberNotInitialized(loc, details) {
        this.raise(FlowErrors.EnumNumberMemberNotInitialized, loc, details);
      }
      flowEnumErrorStringMemberInconsistentlyInitialized(node, details) {
        this.raise(FlowErrors.EnumStringMemberInconsistentlyInitialized, node, details);
      }
      flowEnumMemberInit() {
        const startLoc = this.state.startLoc;
        const endOfInit = () => this.match(12) || this.match(8);
        switch (this.state.type) {
          case 135: {
            const literal = this.parseNumericLiteral(this.state.value);
            if (endOfInit()) {
              return {
                type: "number",
                loc: literal.loc.start,
                value: literal
              };
            }
            return {
              type: "invalid",
              loc: startLoc
            };
          }
          case 134: {
            const literal = this.parseStringLiteral(this.state.value);
            if (endOfInit()) {
              return {
                type: "string",
                loc: literal.loc.start,
                value: literal
              };
            }
            return {
              type: "invalid",
              loc: startLoc
            };
          }
          case 85:
          case 86: {
            const literal = this.parseBooleanLiteral(this.match(85));
            if (endOfInit()) {
              return {
                type: "boolean",
                loc: literal.loc.start,
                value: literal
              };
            }
            return {
              type: "invalid",
              loc: startLoc
            };
          }
          default:
            return {
              type: "invalid",
              loc: startLoc
            };
        }
      }
      flowEnumMemberRaw() {
        const loc = this.state.startLoc;
        const id = this.parseIdentifier(true);
        const init = this.eat(29) ? this.flowEnumMemberInit() : {
          type: "none",
          loc
        };
        return {
          id,
          init
        };
      }
      flowEnumCheckExplicitTypeMismatch(loc, context, expectedType) {
        const {
          explicitType
        } = context;
        if (explicitType === null) {
          return;
        }
        if (explicitType !== expectedType) {
          this.flowEnumErrorInvalidMemberInitializer(loc, context);
        }
      }
      flowEnumMembers({
        enumName,
        explicitType
      }) {
        const seenNames = /* @__PURE__ */ new Set();
        const members = {
          booleanMembers: [],
          numberMembers: [],
          stringMembers: [],
          defaultedMembers: []
        };
        let hasUnknownMembers = false;
        while (!this.match(8)) {
          if (this.eat(21)) {
            hasUnknownMembers = true;
            break;
          }
          const memberNode = this.startNode();
          const {
            id,
            init
          } = this.flowEnumMemberRaw();
          const memberName = id.name;
          if (memberName === "") {
            continue;
          }
          if (/^[a-z]/.test(memberName)) {
            this.raise(FlowErrors.EnumInvalidMemberName, id, {
              memberName,
              suggestion: memberName[0].toUpperCase() + memberName.slice(1),
              enumName
            });
          }
          if (seenNames.has(memberName)) {
            this.raise(FlowErrors.EnumDuplicateMemberName, id, {
              memberName,
              enumName
            });
          }
          seenNames.add(memberName);
          const context = {
            enumName,
            explicitType,
            memberName
          };
          memberNode.id = id;
          switch (init.type) {
            case "boolean": {
              this.flowEnumCheckExplicitTypeMismatch(init.loc, context, "boolean");
              memberNode.init = init.value;
              members.booleanMembers.push(this.finishNode(memberNode, "EnumBooleanMember"));
              break;
            }
            case "number": {
              this.flowEnumCheckExplicitTypeMismatch(init.loc, context, "number");
              memberNode.init = init.value;
              members.numberMembers.push(this.finishNode(memberNode, "EnumNumberMember"));
              break;
            }
            case "string": {
              this.flowEnumCheckExplicitTypeMismatch(init.loc, context, "string");
              memberNode.init = init.value;
              members.stringMembers.push(this.finishNode(memberNode, "EnumStringMember"));
              break;
            }
            case "invalid": {
              throw this.flowEnumErrorInvalidMemberInitializer(init.loc, context);
            }
            case "none": {
              switch (explicitType) {
                case "boolean":
                  this.flowEnumErrorBooleanMemberNotInitialized(init.loc, context);
                  break;
                case "number":
                  this.flowEnumErrorNumberMemberNotInitialized(init.loc, context);
                  break;
                default:
                  members.defaultedMembers.push(this.finishNode(memberNode, "EnumDefaultedMember"));
              }
            }
          }
          if (!this.match(8)) {
            this.expect(12);
          }
        }
        return {
          members,
          hasUnknownMembers
        };
      }
      flowEnumStringMembers(initializedMembers, defaultedMembers, {
        enumName
      }) {
        if (initializedMembers.length === 0) {
          return defaultedMembers;
        } else if (defaultedMembers.length === 0) {
          return initializedMembers;
        } else if (defaultedMembers.length > initializedMembers.length) {
          for (const member of initializedMembers) {
            this.flowEnumErrorStringMemberInconsistentlyInitialized(member, {
              enumName
            });
          }
          return defaultedMembers;
        } else {
          for (const member of defaultedMembers) {
            this.flowEnumErrorStringMemberInconsistentlyInitialized(member, {
              enumName
            });
          }
          return initializedMembers;
        }
      }
      flowEnumParseExplicitType({
        enumName
      }) {
        if (!this.eatContextual(102)) return null;
        if (!tokenIsIdentifier(this.state.type)) {
          throw this.raise(FlowErrors.EnumInvalidExplicitTypeUnknownSupplied, this.state.startLoc, {
            enumName
          });
        }
        const {
          value: value2
        } = this.state;
        this.next();
        if (value2 !== "boolean" && value2 !== "number" && value2 !== "string" && value2 !== "symbol") {
          this.raise(FlowErrors.EnumInvalidExplicitType, this.state.startLoc, {
            enumName,
            invalidEnumType: value2
          });
        }
        return value2;
      }
      flowEnumBody(node, id) {
        const enumName = id.name;
        const nameLoc = id.loc.start;
        const explicitType = this.flowEnumParseExplicitType({
          enumName
        });
        this.expect(5);
        const {
          members,
          hasUnknownMembers
        } = this.flowEnumMembers({
          enumName,
          explicitType
        });
        node.hasUnknownMembers = hasUnknownMembers;
        switch (explicitType) {
          case "boolean":
            node.explicitType = true;
            node.members = members.booleanMembers;
            this.expect(8);
            return this.finishNode(node, "EnumBooleanBody");
          case "number":
            node.explicitType = true;
            node.members = members.numberMembers;
            this.expect(8);
            return this.finishNode(node, "EnumNumberBody");
          case "string":
            node.explicitType = true;
            node.members = this.flowEnumStringMembers(members.stringMembers, members.defaultedMembers, {
              enumName
            });
            this.expect(8);
            return this.finishNode(node, "EnumStringBody");
          case "symbol":
            node.members = members.defaultedMembers;
            this.expect(8);
            return this.finishNode(node, "EnumSymbolBody");
          default: {
            const empty = () => {
              node.members = [];
              this.expect(8);
              return this.finishNode(node, "EnumStringBody");
            };
            node.explicitType = false;
            const boolsLen = members.booleanMembers.length;
            const numsLen = members.numberMembers.length;
            const strsLen = members.stringMembers.length;
            const defaultedLen = members.defaultedMembers.length;
            if (!boolsLen && !numsLen && !strsLen && !defaultedLen) {
              return empty();
            } else if (!boolsLen && !numsLen) {
              node.members = this.flowEnumStringMembers(members.stringMembers, members.defaultedMembers, {
                enumName
              });
              this.expect(8);
              return this.finishNode(node, "EnumStringBody");
            } else if (!numsLen && !strsLen && boolsLen >= defaultedLen) {
              for (const member of members.defaultedMembers) {
                this.flowEnumErrorBooleanMemberNotInitialized(member.loc.start, {
                  enumName,
                  memberName: member.id.name
                });
              }
              node.members = members.booleanMembers;
              this.expect(8);
              return this.finishNode(node, "EnumBooleanBody");
            } else if (!boolsLen && !strsLen && numsLen >= defaultedLen) {
              for (const member of members.defaultedMembers) {
                this.flowEnumErrorNumberMemberNotInitialized(member.loc.start, {
                  enumName,
                  memberName: member.id.name
                });
              }
              node.members = members.numberMembers;
              this.expect(8);
              return this.finishNode(node, "EnumNumberBody");
            } else {
              this.raise(FlowErrors.EnumInconsistentMemberValues, nameLoc, {
                enumName
              });
              return empty();
            }
          }
        }
      }
      flowParseEnumDeclaration(node) {
        const id = this.parseIdentifier();
        node.id = id;
        node.body = this.flowEnumBody(this.startNode(), id);
        return this.finishNode(node, "EnumDeclaration");
      }
      jsxParseOpeningElementAfterName(node) {
        if (this.shouldParseTypes()) {
          if (this.match(47) || this.match(51)) {
            node.typeArguments = this.flowParseTypeParameterInstantiationInExpression();
          }
        }
        return super.jsxParseOpeningElementAfterName(node);
      }
      isLookaheadToken_lt() {
        const next = this.nextTokenStart();
        if (this.input.charCodeAt(next) === 60) {
          const afterNext = this.input.charCodeAt(next + 1);
          return afterNext !== 60 && afterNext !== 61;
        }
        return false;
      }
      reScan_lt_gt() {
        const {
          type
        } = this.state;
        if (type === 47) {
          this.state.pos -= 1;
          this.readToken_lt();
        } else if (type === 48) {
          this.state.pos -= 1;
          this.readToken_gt();
        }
      }
      reScan_lt() {
        const {
          type
        } = this.state;
        if (type === 51) {
          this.state.pos -= 2;
          this.finishOp(47, 1);
          return 47;
        }
        return type;
      }
      maybeUnwrapTypeCastExpression(node) {
        return node.type === "TypeCastExpression" ? node.expression : node;
      }
    };
    var entities = {
      __proto__: null,
      quot: '"',
      amp: "&",
      apos: "'",
      lt: "<",
      gt: ">",
      nbsp: "\xA0",
      iexcl: "\xA1",
      cent: "\xA2",
      pound: "\xA3",
      curren: "\xA4",
      yen: "\xA5",
      brvbar: "\xA6",
      sect: "\xA7",
      uml: "\xA8",
      copy: "\xA9",
      ordf: "\xAA",
      laquo: "\xAB",
      not: "\xAC",
      shy: "\xAD",
      reg: "\xAE",
      macr: "\xAF",
      deg: "\xB0",
      plusmn: "\xB1",
      sup2: "\xB2",
      sup3: "\xB3",
      acute: "\xB4",
      micro: "\xB5",
      para: "\xB6",
      middot: "\xB7",
      cedil: "\xB8",
      sup1: "\xB9",
      ordm: "\xBA",
      raquo: "\xBB",
      frac14: "\xBC",
      frac12: "\xBD",
      frac34: "\xBE",
      iquest: "\xBF",
      Agrave: "\xC0",
      Aacute: "\xC1",
      Acirc: "\xC2",
      Atilde: "\xC3",
      Auml: "\xC4",
      Aring: "\xC5",
      AElig: "\xC6",
      Ccedil: "\xC7",
      Egrave: "\xC8",
      Eacute: "\xC9",
      Ecirc: "\xCA",
      Euml: "\xCB",
      Igrave: "\xCC",
      Iacute: "\xCD",
      Icirc: "\xCE",
      Iuml: "\xCF",
      ETH: "\xD0",
      Ntilde: "\xD1",
      Ograve: "\xD2",
      Oacute: "\xD3",
      Ocirc: "\xD4",
      Otilde: "\xD5",
      Ouml: "\xD6",
      times: "\xD7",
      Oslash: "\xD8",
      Ugrave: "\xD9",
      Uacute: "\xDA",
      Ucirc: "\xDB",
      Uuml: "\xDC",
      Yacute: "\xDD",
      THORN: "\xDE",
      szlig: "\xDF",
      agrave: "\xE0",
      aacute: "\xE1",
      acirc: "\xE2",
      atilde: "\xE3",
      auml: "\xE4",
      aring: "\xE5",
      aelig: "\xE6",
      ccedil: "\xE7",
      egrave: "\xE8",
      eacute: "\xE9",
      ecirc: "\xEA",
      euml: "\xEB",
      igrave: "\xEC",
      iacute: "\xED",
      icirc: "\xEE",
      iuml: "\xEF",
      eth: "\xF0",
      ntilde: "\xF1",
      ograve: "\xF2",
      oacute: "\xF3",
      ocirc: "\xF4",
      otilde: "\xF5",
      ouml: "\xF6",
      divide: "\xF7",
      oslash: "\xF8",
      ugrave: "\xF9",
      uacute: "\xFA",
      ucirc: "\xFB",
      uuml: "\xFC",
      yacute: "\xFD",
      thorn: "\xFE",
      yuml: "\xFF",
      OElig: "\u0152",
      oelig: "\u0153",
      Scaron: "\u0160",
      scaron: "\u0161",
      Yuml: "\u0178",
      fnof: "\u0192",
      circ: "\u02C6",
      tilde: "\u02DC",
      Alpha: "\u0391",
      Beta: "\u0392",
      Gamma: "\u0393",
      Delta: "\u0394",
      Epsilon: "\u0395",
      Zeta: "\u0396",
      Eta: "\u0397",
      Theta: "\u0398",
      Iota: "\u0399",
      Kappa: "\u039A",
      Lambda: "\u039B",
      Mu: "\u039C",
      Nu: "\u039D",
      Xi: "\u039E",
      Omicron: "\u039F",
      Pi: "\u03A0",
      Rho: "\u03A1",
      Sigma: "\u03A3",
      Tau: "\u03A4",
      Upsilon: "\u03A5",
      Phi: "\u03A6",
      Chi: "\u03A7",
      Psi: "\u03A8",
      Omega: "\u03A9",
      alpha: "\u03B1",
      beta: "\u03B2",
      gamma: "\u03B3",
      delta: "\u03B4",
      epsilon: "\u03B5",
      zeta: "\u03B6",
      eta: "\u03B7",
      theta: "\u03B8",
      iota: "\u03B9",
      kappa: "\u03BA",
      lambda: "\u03BB",
      mu: "\u03BC",
      nu: "\u03BD",
      xi: "\u03BE",
      omicron: "\u03BF",
      pi: "\u03C0",
      rho: "\u03C1",
      sigmaf: "\u03C2",
      sigma: "\u03C3",
      tau: "\u03C4",
      upsilon: "\u03C5",
      phi: "\u03C6",
      chi: "\u03C7",
      psi: "\u03C8",
      omega: "\u03C9",
      thetasym: "\u03D1",
      upsih: "\u03D2",
      piv: "\u03D6",
      ensp: "\u2002",
      emsp: "\u2003",
      thinsp: "\u2009",
      zwnj: "\u200C",
      zwj: "\u200D",
      lrm: "\u200E",
      rlm: "\u200F",
      ndash: "\u2013",
      mdash: "\u2014",
      lsquo: "\u2018",
      rsquo: "\u2019",
      sbquo: "\u201A",
      ldquo: "\u201C",
      rdquo: "\u201D",
      bdquo: "\u201E",
      dagger: "\u2020",
      Dagger: "\u2021",
      bull: "\u2022",
      hellip: "\u2026",
      permil: "\u2030",
      prime: "\u2032",
      Prime: "\u2033",
      lsaquo: "\u2039",
      rsaquo: "\u203A",
      oline: "\u203E",
      frasl: "\u2044",
      euro: "\u20AC",
      image: "\u2111",
      weierp: "\u2118",
      real: "\u211C",
      trade: "\u2122",
      alefsym: "\u2135",
      larr: "\u2190",
      uarr: "\u2191",
      rarr: "\u2192",
      darr: "\u2193",
      harr: "\u2194",
      crarr: "\u21B5",
      lArr: "\u21D0",
      uArr: "\u21D1",
      rArr: "\u21D2",
      dArr: "\u21D3",
      hArr: "\u21D4",
      forall: "\u2200",
      part: "\u2202",
      exist: "\u2203",
      empty: "\u2205",
      nabla: "\u2207",
      isin: "\u2208",
      notin: "\u2209",
      ni: "\u220B",
      prod: "\u220F",
      sum: "\u2211",
      minus: "\u2212",
      lowast: "\u2217",
      radic: "\u221A",
      prop: "\u221D",
      infin: "\u221E",
      ang: "\u2220",
      and: "\u2227",
      or: "\u2228",
      cap: "\u2229",
      cup: "\u222A",
      int: "\u222B",
      there4: "\u2234",
      sim: "\u223C",
      cong: "\u2245",
      asymp: "\u2248",
      ne: "\u2260",
      equiv: "\u2261",
      le: "\u2264",
      ge: "\u2265",
      sub: "\u2282",
      sup: "\u2283",
      nsub: "\u2284",
      sube: "\u2286",
      supe: "\u2287",
      oplus: "\u2295",
      otimes: "\u2297",
      perp: "\u22A5",
      sdot: "\u22C5",
      lceil: "\u2308",
      rceil: "\u2309",
      lfloor: "\u230A",
      rfloor: "\u230B",
      lang: "\u2329",
      rang: "\u232A",
      loz: "\u25CA",
      spades: "\u2660",
      clubs: "\u2663",
      hearts: "\u2665",
      diams: "\u2666"
    };
    var lineBreak = /\r\n|[\r\n\u2028\u2029]/;
    var lineBreakG = new RegExp(lineBreak.source, "g");
    function isNewLine(code2) {
      switch (code2) {
        case 10:
        case 13:
        case 8232:
        case 8233:
          return true;
        default:
          return false;
      }
    }
    function hasNewLine(input, start, end) {
      for (let i = start; i < end; i++) {
        if (isNewLine(input.charCodeAt(i))) {
          return true;
        }
      }
      return false;
    }
    var skipWhiteSpace = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g;
    var skipWhiteSpaceInLine = /(?:[^\S\n\r\u2028\u2029]|\/\/.*|\/\*.*?\*\/)*/g;
    function isWhitespace(code2) {
      switch (code2) {
        case 9:
        case 11:
        case 12:
        case 32:
        case 160:
        case 5760:
        case 8192:
        case 8193:
        case 8194:
        case 8195:
        case 8196:
        case 8197:
        case 8198:
        case 8199:
        case 8200:
        case 8201:
        case 8202:
        case 8239:
        case 8287:
        case 12288:
        case 65279:
          return true;
        default:
          return false;
      }
    }
    var JsxErrors = ParseErrorEnum`jsx`({
      AttributeIsEmpty: "JSX attributes must only be assigned a non-empty expression.",
      MissingClosingTagElement: ({
        openingTagName
      }) => `Expected corresponding JSX closing tag for <${openingTagName}>.`,
      MissingClosingTagFragment: "Expected corresponding JSX closing tag for <>.",
      UnexpectedSequenceExpression: "Sequence expressions cannot be directly nested inside JSX. Did you mean to wrap it in parentheses (...)?",
      UnexpectedToken: ({
        unexpected,
        HTMLEntity
      }) => `Unexpected token \`${unexpected}\`. Did you mean \`${HTMLEntity}\` or \`{'${unexpected}'}\`?`,
      UnsupportedJsxValue: "JSX value should be either an expression or a quoted JSX text.",
      UnterminatedJsxContent: "Unterminated JSX contents.",
      UnwrappedAdjacentJSXElements: "Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment <>...</>?"
    });
    function isFragment(object) {
      return object ? object.type === "JSXOpeningFragment" || object.type === "JSXClosingFragment" : false;
    }
    function getQualifiedJSXName(object) {
      if (object.type === "JSXIdentifier") {
        return object.name;
      }
      if (object.type === "JSXNamespacedName") {
        return object.namespace.name + ":" + object.name.name;
      }
      if (object.type === "JSXMemberExpression") {
        return getQualifiedJSXName(object.object) + "." + getQualifiedJSXName(object.property);
      }
      throw new Error("Node had unexpected type: " + object.type);
    }
    var jsx = (superClass) => class JSXParserMixin extends superClass {
      jsxReadToken() {
        let out = "";
        let chunkStart = this.state.pos;
        for (; ; ) {
          if (this.state.pos >= this.length) {
            throw this.raise(JsxErrors.UnterminatedJsxContent, this.state.startLoc);
          }
          const ch = this.input.charCodeAt(this.state.pos);
          switch (ch) {
            case 60:
            case 123:
              if (this.state.pos === this.state.start) {
                if (ch === 60 && this.state.canStartJSXElement) {
                  ++this.state.pos;
                  this.finishToken(143);
                } else {
                  super.getTokenFromCode(ch);
                }
                return;
              }
              out += this.input.slice(chunkStart, this.state.pos);
              this.finishToken(142, out);
              return;
            case 38:
              out += this.input.slice(chunkStart, this.state.pos);
              out += this.jsxReadEntity();
              chunkStart = this.state.pos;
              break;
            case 62:
            case 125:
            default:
              if (isNewLine(ch)) {
                out += this.input.slice(chunkStart, this.state.pos);
                out += this.jsxReadNewLine(true);
                chunkStart = this.state.pos;
              } else {
                ++this.state.pos;
              }
          }
        }
      }
      jsxReadNewLine(normalizeCRLF) {
        const ch = this.input.charCodeAt(this.state.pos);
        let out;
        ++this.state.pos;
        if (ch === 13 && this.input.charCodeAt(this.state.pos) === 10) {
          ++this.state.pos;
          out = normalizeCRLF ? "\n" : "\r\n";
        } else {
          out = String.fromCharCode(ch);
        }
        ++this.state.curLine;
        this.state.lineStart = this.state.pos;
        return out;
      }
      jsxReadString(quote) {
        let out = "";
        let chunkStart = ++this.state.pos;
        for (; ; ) {
          if (this.state.pos >= this.length) {
            throw this.raise(Errors.UnterminatedString, this.state.startLoc);
          }
          const ch = this.input.charCodeAt(this.state.pos);
          if (ch === quote) break;
          if (ch === 38) {
            out += this.input.slice(chunkStart, this.state.pos);
            out += this.jsxReadEntity();
            chunkStart = this.state.pos;
          } else if (isNewLine(ch)) {
            out += this.input.slice(chunkStart, this.state.pos);
            out += this.jsxReadNewLine(false);
            chunkStart = this.state.pos;
          } else {
            ++this.state.pos;
          }
        }
        out += this.input.slice(chunkStart, this.state.pos++);
        this.finishToken(134, out);
      }
      jsxReadEntity() {
        const startPos = ++this.state.pos;
        if (this.codePointAtPos(this.state.pos) === 35) {
          ++this.state.pos;
          let radix = 10;
          if (this.codePointAtPos(this.state.pos) === 120) {
            radix = 16;
            ++this.state.pos;
          }
          const codePoint = this.readInt(radix, void 0, false, "bail");
          if (codePoint !== null && this.codePointAtPos(this.state.pos) === 59) {
            ++this.state.pos;
            return String.fromCodePoint(codePoint);
          }
        } else {
          let count = 0;
          let semi = false;
          while (count++ < 10 && this.state.pos < this.length && !(semi = this.codePointAtPos(this.state.pos) === 59)) {
            ++this.state.pos;
          }
          if (semi) {
            const desc = this.input.slice(startPos, this.state.pos);
            const entity = entities[desc];
            ++this.state.pos;
            if (entity) {
              return entity;
            }
          }
        }
        this.state.pos = startPos;
        return "&";
      }
      jsxReadWord() {
        let ch;
        const start = this.state.pos;
        do {
          ch = this.input.charCodeAt(++this.state.pos);
        } while (isIdentifierChar(ch) || ch === 45);
        this.finishToken(141, this.input.slice(start, this.state.pos));
      }
      jsxParseIdentifier() {
        const node = this.startNode();
        if (this.match(141)) {
          node.name = this.state.value;
        } else if (tokenIsKeyword(this.state.type)) {
          node.name = tokenLabelName(this.state.type);
        } else {
          this.unexpected();
        }
        this.next();
        return this.finishNode(node, "JSXIdentifier");
      }
      jsxParseNamespacedName() {
        const startLoc = this.state.startLoc;
        const name = this.jsxParseIdentifier();
        if (!this.eat(14)) return name;
        const node = this.startNodeAt(startLoc);
        node.namespace = name;
        node.name = this.jsxParseIdentifier();
        return this.finishNode(node, "JSXNamespacedName");
      }
      jsxParseElementName() {
        const startLoc = this.state.startLoc;
        let node = this.jsxParseNamespacedName();
        if (node.type === "JSXNamespacedName") {
          return node;
        }
        while (this.eat(16)) {
          const newNode = this.startNodeAt(startLoc);
          newNode.object = node;
          newNode.property = this.jsxParseIdentifier();
          node = this.finishNode(newNode, "JSXMemberExpression");
        }
        return node;
      }
      jsxParseAttributeValue() {
        let node;
        switch (this.state.type) {
          case 5:
            node = this.startNode();
            this.setContext(types2.brace);
            this.next();
            node = this.jsxParseExpressionContainer(node, types2.j_oTag);
            if (node.expression.type === "JSXEmptyExpression") {
              this.raise(JsxErrors.AttributeIsEmpty, node);
            }
            return node;
          case 143:
          case 134:
            return this.parseExprAtom();
          default:
            throw this.raise(JsxErrors.UnsupportedJsxValue, this.state.startLoc);
        }
      }
      jsxParseEmptyExpression() {
        const node = this.startNodeAt(this.state.lastTokEndLoc);
        return this.finishNodeAt(node, "JSXEmptyExpression", this.state.startLoc);
      }
      jsxParseSpreadChild(node) {
        this.next();
        node.expression = this.parseExpression();
        this.setContext(types2.j_expr);
        this.state.canStartJSXElement = true;
        this.expect(8);
        return this.finishNode(node, "JSXSpreadChild");
      }
      jsxParseExpressionContainer(node, previousContext) {
        if (this.match(8)) {
          node.expression = this.jsxParseEmptyExpression();
        } else {
          const expression = this.parseExpression();
          node.expression = expression;
        }
        this.setContext(previousContext);
        this.state.canStartJSXElement = true;
        this.expect(8);
        return this.finishNode(node, "JSXExpressionContainer");
      }
      jsxParseAttribute() {
        const node = this.startNode();
        if (this.match(5)) {
          this.setContext(types2.brace);
          this.next();
          this.expect(21);
          node.argument = this.parseMaybeAssignAllowIn();
          this.setContext(types2.j_oTag);
          this.state.canStartJSXElement = true;
          this.expect(8);
          return this.finishNode(node, "JSXSpreadAttribute");
        }
        node.name = this.jsxParseNamespacedName();
        node.value = this.eat(29) ? this.jsxParseAttributeValue() : null;
        return this.finishNode(node, "JSXAttribute");
      }
      jsxParseOpeningElementAt(startLoc) {
        const node = this.startNodeAt(startLoc);
        if (this.eat(144)) {
          return this.finishNode(node, "JSXOpeningFragment");
        }
        node.name = this.jsxParseElementName();
        return this.jsxParseOpeningElementAfterName(node);
      }
      jsxParseOpeningElementAfterName(node) {
        const attributes = [];
        while (!this.match(56) && !this.match(144)) {
          attributes.push(this.jsxParseAttribute());
        }
        node.attributes = attributes;
        node.selfClosing = this.eat(56);
        this.expect(144);
        return this.finishNode(node, "JSXOpeningElement");
      }
      jsxParseClosingElementAt(startLoc) {
        const node = this.startNodeAt(startLoc);
        if (this.eat(144)) {
          return this.finishNode(node, "JSXClosingFragment");
        }
        node.name = this.jsxParseElementName();
        this.expect(144);
        return this.finishNode(node, "JSXClosingElement");
      }
      jsxParseElementAt(startLoc) {
        const node = this.startNodeAt(startLoc);
        const children = [];
        const openingElement = this.jsxParseOpeningElementAt(startLoc);
        let closingElement = null;
        if (!openingElement.selfClosing) {
          contents: for (; ; ) {
            switch (this.state.type) {
              case 143:
                startLoc = this.state.startLoc;
                this.next();
                if (this.eat(56)) {
                  closingElement = this.jsxParseClosingElementAt(startLoc);
                  break contents;
                }
                children.push(this.jsxParseElementAt(startLoc));
                break;
              case 142:
                children.push(this.parseLiteral(this.state.value, "JSXText"));
                break;
              case 5: {
                const node2 = this.startNode();
                this.setContext(types2.brace);
                this.next();
                if (this.match(21)) {
                  children.push(this.jsxParseSpreadChild(node2));
                } else {
                  children.push(this.jsxParseExpressionContainer(node2, types2.j_expr));
                }
                break;
              }
              default:
                this.unexpected();
            }
          }
          if (isFragment(openingElement) && !isFragment(closingElement) && closingElement !== null) {
            this.raise(JsxErrors.MissingClosingTagFragment, closingElement);
          } else if (!isFragment(openingElement) && isFragment(closingElement)) {
            this.raise(JsxErrors.MissingClosingTagElement, closingElement, {
              openingTagName: getQualifiedJSXName(openingElement.name)
            });
          } else if (!isFragment(openingElement) && !isFragment(closingElement)) {
            if (getQualifiedJSXName(closingElement.name) !== getQualifiedJSXName(openingElement.name)) {
              this.raise(JsxErrors.MissingClosingTagElement, closingElement, {
                openingTagName: getQualifiedJSXName(openingElement.name)
              });
            }
          }
        }
        if (isFragment(openingElement)) {
          node.openingFragment = openingElement;
          node.closingFragment = closingElement;
        } else {
          node.openingElement = openingElement;
          node.closingElement = closingElement;
        }
        node.children = children;
        if (this.match(47)) {
          throw this.raise(JsxErrors.UnwrappedAdjacentJSXElements, this.state.startLoc);
        }
        return isFragment(openingElement) ? this.finishNode(node, "JSXFragment") : this.finishNode(node, "JSXElement");
      }
      jsxParseElement() {
        const startLoc = this.state.startLoc;
        this.next();
        return this.jsxParseElementAt(startLoc);
      }
      setContext(newContext) {
        const {
          context
        } = this.state;
        context[context.length - 1] = newContext;
      }
      parseExprAtom(refExpressionErrors) {
        if (this.match(143)) {
          return this.jsxParseElement();
        } else if (this.match(47) && this.input.charCodeAt(this.state.pos) !== 33) {
          this.replaceToken(143);
          return this.jsxParseElement();
        } else {
          return super.parseExprAtom(refExpressionErrors);
        }
      }
      skipSpace() {
        const curContext = this.curContext();
        if (!curContext.preserveSpace) super.skipSpace();
      }
      getTokenFromCode(code2) {
        const context = this.curContext();
        if (context === types2.j_expr) {
          this.jsxReadToken();
          return;
        }
        if (context === types2.j_oTag || context === types2.j_cTag) {
          if (isIdentifierStart(code2)) {
            this.jsxReadWord();
            return;
          }
          if (code2 === 62) {
            ++this.state.pos;
            this.finishToken(144);
            return;
          }
          if ((code2 === 34 || code2 === 39) && context === types2.j_oTag) {
            this.jsxReadString(code2);
            return;
          }
        }
        if (code2 === 60 && this.state.canStartJSXElement && this.input.charCodeAt(this.state.pos + 1) !== 33) {
          ++this.state.pos;
          this.finishToken(143);
          return;
        }
        super.getTokenFromCode(code2);
      }
      updateContext(prevType) {
        const {
          context,
          type
        } = this.state;
        if (type === 56 && prevType === 143) {
          context.splice(-2, 2, types2.j_cTag);
          this.state.canStartJSXElement = false;
        } else if (type === 143) {
          context.push(types2.j_oTag);
        } else if (type === 144) {
          const out = context[context.length - 1];
          if (out === types2.j_oTag && prevType === 56 || out === types2.j_cTag) {
            context.pop();
            this.state.canStartJSXElement = context[context.length - 1] === types2.j_expr;
          } else {
            this.setContext(types2.j_expr);
            this.state.canStartJSXElement = true;
          }
        } else {
          this.state.canStartJSXElement = tokenComesBeforeExpression(type);
        }
      }
    };
    var TypeScriptScope = class extends Scope {
      constructor(...args) {
        super(...args);
        this.tsNames = /* @__PURE__ */ new Map();
      }
    };
    var TypeScriptScopeHandler = class extends ScopeHandler {
      constructor(...args) {
        super(...args);
        this.importsStack = [];
      }
      createScope(flags) {
        this.importsStack.push(/* @__PURE__ */ new Set());
        return new TypeScriptScope(flags);
      }
      enter(flags) {
        if (flags === 1024) {
          this.importsStack.push(/* @__PURE__ */ new Set());
        }
        super.enter(flags);
      }
      exit() {
        const flags = super.exit();
        if (flags === 1024) {
          this.importsStack.pop();
        }
        return flags;
      }
      hasImport(name, allowShadow) {
        const len = this.importsStack.length;
        if (this.importsStack[len - 1].has(name)) {
          return true;
        }
        if (!allowShadow && len > 1) {
          for (let i = 0; i < len - 1; i++) {
            if (this.importsStack[i].has(name)) return true;
          }
        }
        return false;
      }
      declareName(name, bindingType, loc) {
        if (bindingType & 4096) {
          if (this.hasImport(name, true)) {
            this.parser.raise(Errors.VarRedeclaration, loc, {
              identifierName: name
            });
          }
          this.importsStack[this.importsStack.length - 1].add(name);
          return;
        }
        const scope = this.currentScope();
        let type = scope.tsNames.get(name) || 0;
        if (bindingType & 1024) {
          this.maybeExportDefined(scope, name);
          scope.tsNames.set(name, type | 16);
          return;
        }
        super.declareName(name, bindingType, loc);
        if (bindingType & 2) {
          if (!(bindingType & 1)) {
            this.checkRedeclarationInScope(scope, name, bindingType, loc);
            this.maybeExportDefined(scope, name);
          }
          type = type | 1;
        }
        if (bindingType & 256) {
          type = type | 2;
        }
        if (bindingType & 512) {
          type = type | 4;
        }
        if (bindingType & 128) {
          type = type | 8;
        }
        if (type) scope.tsNames.set(name, type);
      }
      isRedeclaredInScope(scope, name, bindingType) {
        const type = scope.tsNames.get(name);
        if ((type & 2) > 0) {
          if (bindingType & 256) {
            const isConst = !!(bindingType & 512);
            const wasConst = (type & 4) > 0;
            return isConst !== wasConst;
          }
          return true;
        }
        if (bindingType & 128 && (type & 8) > 0) {
          if (scope.names.get(name) & 2) {
            return !!(bindingType & 1);
          } else {
            return false;
          }
        }
        if (bindingType & 2 && (type & 1) > 0) {
          return true;
        }
        return super.isRedeclaredInScope(scope, name, bindingType);
      }
      checkLocalExport(id) {
        const {
          name
        } = id;
        if (this.hasImport(name)) return;
        const len = this.scopeStack.length;
        for (let i = len - 1; i >= 0; i--) {
          const scope = this.scopeStack[i];
          const type = scope.tsNames.get(name);
          if ((type & 1) > 0 || (type & 16) > 0) {
            return;
          }
        }
        super.checkLocalExport(id);
      }
    };
    var ProductionParameterHandler = class {
      constructor() {
        this.stacks = [];
      }
      enter(flags) {
        this.stacks.push(flags);
      }
      exit() {
        this.stacks.pop();
      }
      currentFlags() {
        return this.stacks[this.stacks.length - 1];
      }
      get hasAwait() {
        return (this.currentFlags() & 2) > 0;
      }
      get hasYield() {
        return (this.currentFlags() & 1) > 0;
      }
      get hasReturn() {
        return (this.currentFlags() & 4) > 0;
      }
      get hasIn() {
        return (this.currentFlags() & 8) > 0;
      }
    };
    function functionFlags(isAsync, isGenerator) {
      return (isAsync ? 2 : 0) | (isGenerator ? 1 : 0);
    }
    var BaseParser = class {
      constructor() {
        this.sawUnambiguousESM = false;
        this.ambiguousScriptDifferentAst = false;
      }
      sourceToOffsetPos(sourcePos) {
        return sourcePos + this.startIndex;
      }
      offsetToSourcePos(offsetPos) {
        return offsetPos - this.startIndex;
      }
      hasPlugin(pluginConfig) {
        if (typeof pluginConfig === "string") {
          return this.plugins.has(pluginConfig);
        } else {
          const [pluginName, pluginOptions] = pluginConfig;
          if (!this.hasPlugin(pluginName)) {
            return false;
          }
          const actualOptions = this.plugins.get(pluginName);
          for (const key of Object.keys(pluginOptions)) {
            if ((actualOptions == null ? void 0 : actualOptions[key]) !== pluginOptions[key]) {
              return false;
            }
          }
          return true;
        }
      }
      getPluginOption(plugin, name) {
        var _this$plugins$get;
        return (_this$plugins$get = this.plugins.get(plugin)) == null ? void 0 : _this$plugins$get[name];
      }
    };
    function setTrailingComments(node, comments) {
      if (node.trailingComments === void 0) {
        node.trailingComments = comments;
      } else {
        node.trailingComments.unshift(...comments);
      }
    }
    function setLeadingComments(node, comments) {
      if (node.leadingComments === void 0) {
        node.leadingComments = comments;
      } else {
        node.leadingComments.unshift(...comments);
      }
    }
    function setInnerComments(node, comments) {
      if (node.innerComments === void 0) {
        node.innerComments = comments;
      } else {
        node.innerComments.unshift(...comments);
      }
    }
    function adjustInnerComments(node, elements, commentWS) {
      let lastElement = null;
      let i = elements.length;
      while (lastElement === null && i > 0) {
        lastElement = elements[--i];
      }
      if (lastElement === null || lastElement.start > commentWS.start) {
        setInnerComments(node, commentWS.comments);
      } else {
        setTrailingComments(lastElement, commentWS.comments);
      }
    }
    var CommentsParser = class extends BaseParser {
      addComment(comment) {
        if (this.filename) comment.loc.filename = this.filename;
        const {
          commentsLen
        } = this.state;
        if (this.comments.length !== commentsLen) {
          this.comments.length = commentsLen;
        }
        this.comments.push(comment);
        this.state.commentsLen++;
      }
      processComment(node) {
        const {
          commentStack
        } = this.state;
        const commentStackLength = commentStack.length;
        if (commentStackLength === 0) return;
        let i = commentStackLength - 1;
        const lastCommentWS = commentStack[i];
        if (lastCommentWS.start === node.end) {
          lastCommentWS.leadingNode = node;
          i--;
        }
        const {
          start: nodeStart
        } = node;
        for (; i >= 0; i--) {
          const commentWS = commentStack[i];
          const commentEnd = commentWS.end;
          if (commentEnd > nodeStart) {
            commentWS.containingNode = node;
            this.finalizeComment(commentWS);
            commentStack.splice(i, 1);
          } else {
            if (commentEnd === nodeStart) {
              commentWS.trailingNode = node;
            }
            break;
          }
        }
      }
      finalizeComment(commentWS) {
        var _node$options;
        const {
          comments
        } = commentWS;
        if (commentWS.leadingNode !== null || commentWS.trailingNode !== null) {
          if (commentWS.leadingNode !== null) {
            setTrailingComments(commentWS.leadingNode, comments);
          }
          if (commentWS.trailingNode !== null) {
            setLeadingComments(commentWS.trailingNode, comments);
          }
        } else {
          const node = commentWS.containingNode;
          const commentStart = commentWS.start;
          if (this.input.charCodeAt(this.offsetToSourcePos(commentStart) - 1) === 44) {
            switch (node.type) {
              case "ObjectExpression":
              case "ObjectPattern":
                adjustInnerComments(node, node.properties, commentWS);
                break;
              case "CallExpression":
              case "OptionalCallExpression":
                adjustInnerComments(node, node.arguments, commentWS);
                break;
              case "ImportExpression":
                adjustInnerComments(node, [node.source, (_node$options = node.options) != null ? _node$options : null], commentWS);
                break;
              case "FunctionDeclaration":
              case "FunctionExpression":
              case "ArrowFunctionExpression":
              case "ObjectMethod":
              case "ClassMethod":
              case "ClassPrivateMethod":
                adjustInnerComments(node, node.params, commentWS);
                break;
              case "ArrayExpression":
              case "ArrayPattern":
                adjustInnerComments(node, node.elements, commentWS);
                break;
              case "ExportNamedDeclaration":
              case "ImportDeclaration":
                adjustInnerComments(node, node.specifiers, commentWS);
                break;
              case "TSEnumDeclaration":
                adjustInnerComments(node, node.members, commentWS);
                break;
              case "TSEnumBody":
                adjustInnerComments(node, node.members, commentWS);
                break;
              default: {
                if (node.type === "RecordExpression") {
                  adjustInnerComments(node, node.properties, commentWS);
                  break;
                }
                if (node.type === "TupleExpression") {
                  adjustInnerComments(node, node.elements, commentWS);
                  break;
                }
                setInnerComments(node, comments);
              }
            }
          } else {
            setInnerComments(node, comments);
          }
        }
      }
      finalizeRemainingComments() {
        const {
          commentStack
        } = this.state;
        for (let i = commentStack.length - 1; i >= 0; i--) {
          this.finalizeComment(commentStack[i]);
        }
        this.state.commentStack = [];
      }
      resetPreviousNodeTrailingComments(node) {
        const {
          commentStack
        } = this.state;
        const {
          length
        } = commentStack;
        if (length === 0) return;
        const commentWS = commentStack[length - 1];
        if (commentWS.leadingNode === node) {
          commentWS.leadingNode = null;
        }
      }
      takeSurroundingComments(node, start, end) {
        const {
          commentStack
        } = this.state;
        const commentStackLength = commentStack.length;
        if (commentStackLength === 0) return;
        let i = commentStackLength - 1;
        for (; i >= 0; i--) {
          const commentWS = commentStack[i];
          const commentEnd = commentWS.end;
          const commentStart = commentWS.start;
          if (commentStart === end) {
            commentWS.leadingNode = node;
          } else if (commentEnd === start) {
            commentWS.trailingNode = node;
          } else if (commentEnd < start) {
            break;
          }
        }
      }
    };
    var State = class _State {
      constructor() {
        this.flags = 1024;
        this.startIndex = void 0;
        this.curLine = void 0;
        this.lineStart = void 0;
        this.startLoc = void 0;
        this.endLoc = void 0;
        this.errors = [];
        this.potentialArrowAt = -1;
        this.noArrowAt = [];
        this.noArrowParamsConversionAt = [];
        this.topicContext = {
          maxNumOfResolvableTopics: 0,
          maxTopicIndex: null
        };
        this.labels = [];
        this.commentsLen = 0;
        this.commentStack = [];
        this.pos = 0;
        this.type = 140;
        this.value = null;
        this.start = 0;
        this.end = 0;
        this.lastTokEndLoc = null;
        this.lastTokStartLoc = null;
        this.context = [types2.brace];
        this.firstInvalidTemplateEscapePos = null;
        this.strictErrors = /* @__PURE__ */ new Map();
        this.tokensLength = 0;
      }
      get strict() {
        return (this.flags & 1) > 0;
      }
      set strict(v) {
        if (v) this.flags |= 1;
        else this.flags &= -2;
      }
      init({
        strictMode,
        sourceType,
        startIndex,
        startLine,
        startColumn
      }) {
        this.strict = strictMode === false ? false : strictMode === true ? true : sourceType === "module";
        this.startIndex = startIndex;
        this.curLine = startLine;
        this.lineStart = -startColumn;
        this.startLoc = this.endLoc = new Position(startLine, startColumn, startIndex);
      }
      get maybeInArrowParameters() {
        return (this.flags & 2) > 0;
      }
      set maybeInArrowParameters(v) {
        if (v) this.flags |= 2;
        else this.flags &= -3;
      }
      get inType() {
        return (this.flags & 4) > 0;
      }
      set inType(v) {
        if (v) this.flags |= 4;
        else this.flags &= -5;
      }
      get noAnonFunctionType() {
        return (this.flags & 8) > 0;
      }
      set noAnonFunctionType(v) {
        if (v) this.flags |= 8;
        else this.flags &= -9;
      }
      get hasFlowComment() {
        return (this.flags & 16) > 0;
      }
      set hasFlowComment(v) {
        if (v) this.flags |= 16;
        else this.flags &= -17;
      }
      get isAmbientContext() {
        return (this.flags & 32) > 0;
      }
      set isAmbientContext(v) {
        if (v) this.flags |= 32;
        else this.flags &= -33;
      }
      get inAbstractClass() {
        return (this.flags & 64) > 0;
      }
      set inAbstractClass(v) {
        if (v) this.flags |= 64;
        else this.flags &= -65;
      }
      get inDisallowConditionalTypesContext() {
        return (this.flags & 128) > 0;
      }
      set inDisallowConditionalTypesContext(v) {
        if (v) this.flags |= 128;
        else this.flags &= -129;
      }
      get soloAwait() {
        return (this.flags & 256) > 0;
      }
      set soloAwait(v) {
        if (v) this.flags |= 256;
        else this.flags &= -257;
      }
      get inFSharpPipelineDirectBody() {
        return (this.flags & 512) > 0;
      }
      set inFSharpPipelineDirectBody(v) {
        if (v) this.flags |= 512;
        else this.flags &= -513;
      }
      get canStartJSXElement() {
        return (this.flags & 1024) > 0;
      }
      set canStartJSXElement(v) {
        if (v) this.flags |= 1024;
        else this.flags &= -1025;
      }
      get containsEsc() {
        return (this.flags & 2048) > 0;
      }
      set containsEsc(v) {
        if (v) this.flags |= 2048;
        else this.flags &= -2049;
      }
      get hasTopLevelAwait() {
        return (this.flags & 4096) > 0;
      }
      set hasTopLevelAwait(v) {
        if (v) this.flags |= 4096;
        else this.flags &= -4097;
      }
      curPosition() {
        return new Position(this.curLine, this.pos - this.lineStart, this.pos + this.startIndex);
      }
      clone() {
        const state = new _State();
        state.flags = this.flags;
        state.startIndex = this.startIndex;
        state.curLine = this.curLine;
        state.lineStart = this.lineStart;
        state.startLoc = this.startLoc;
        state.endLoc = this.endLoc;
        state.errors = this.errors.slice();
        state.potentialArrowAt = this.potentialArrowAt;
        state.noArrowAt = this.noArrowAt.slice();
        state.noArrowParamsConversionAt = this.noArrowParamsConversionAt.slice();
        state.topicContext = this.topicContext;
        state.labels = this.labels.slice();
        state.commentsLen = this.commentsLen;
        state.commentStack = this.commentStack.slice();
        state.pos = this.pos;
        state.type = this.type;
        state.value = this.value;
        state.start = this.start;
        state.end = this.end;
        state.lastTokEndLoc = this.lastTokEndLoc;
        state.lastTokStartLoc = this.lastTokStartLoc;
        state.context = this.context.slice();
        state.firstInvalidTemplateEscapePos = this.firstInvalidTemplateEscapePos;
        state.strictErrors = this.strictErrors;
        state.tokensLength = this.tokensLength;
        return state;
      }
    };
    var _isDigit = function isDigit(code2) {
      return code2 >= 48 && code2 <= 57;
    };
    var forbiddenNumericSeparatorSiblings = {
      decBinOct: /* @__PURE__ */ new Set([46, 66, 69, 79, 95, 98, 101, 111]),
      hex: /* @__PURE__ */ new Set([46, 88, 95, 120])
    };
    var isAllowedNumericSeparatorSibling = {
      bin: (ch) => ch === 48 || ch === 49,
      oct: (ch) => ch >= 48 && ch <= 55,
      dec: (ch) => ch >= 48 && ch <= 57,
      hex: (ch) => ch >= 48 && ch <= 57 || ch >= 65 && ch <= 70 || ch >= 97 && ch <= 102
    };
    function readStringContents(type, input, pos, lineStart, curLine, errors) {
      const initialPos = pos;
      const initialLineStart = lineStart;
      const initialCurLine = curLine;
      let out = "";
      let firstInvalidLoc = null;
      let chunkStart = pos;
      const {
        length
      } = input;
      for (; ; ) {
        if (pos >= length) {
          errors.unterminated(initialPos, initialLineStart, initialCurLine);
          out += input.slice(chunkStart, pos);
          break;
        }
        const ch = input.charCodeAt(pos);
        if (isStringEnd(type, ch, input, pos)) {
          out += input.slice(chunkStart, pos);
          break;
        }
        if (ch === 92) {
          out += input.slice(chunkStart, pos);
          const res = readEscapedChar(input, pos, lineStart, curLine, type === "template", errors);
          if (res.ch === null && !firstInvalidLoc) {
            firstInvalidLoc = {
              pos,
              lineStart,
              curLine
            };
          } else {
            out += res.ch;
          }
          ({
            pos,
            lineStart,
            curLine
          } = res);
          chunkStart = pos;
        } else if (ch === 8232 || ch === 8233) {
          ++pos;
          ++curLine;
          lineStart = pos;
        } else if (ch === 10 || ch === 13) {
          if (type === "template") {
            out += input.slice(chunkStart, pos) + "\n";
            ++pos;
            if (ch === 13 && input.charCodeAt(pos) === 10) {
              ++pos;
            }
            ++curLine;
            chunkStart = lineStart = pos;
          } else {
            errors.unterminated(initialPos, initialLineStart, initialCurLine);
          }
        } else {
          ++pos;
        }
      }
      return {
        pos,
        str: out,
        firstInvalidLoc,
        lineStart,
        curLine,
        containsInvalid: !!firstInvalidLoc
      };
    }
    function isStringEnd(type, ch, input, pos) {
      if (type === "template") {
        return ch === 96 || ch === 36 && input.charCodeAt(pos + 1) === 123;
      }
      return ch === (type === "double" ? 34 : 39);
    }
    function readEscapedChar(input, pos, lineStart, curLine, inTemplate, errors) {
      const throwOnInvalid = !inTemplate;
      pos++;
      const res = (ch2) => ({
        pos,
        ch: ch2,
        lineStart,
        curLine
      });
      const ch = input.charCodeAt(pos++);
      switch (ch) {
        case 110:
          return res("\n");
        case 114:
          return res("\r");
        case 120: {
          let code2;
          ({
            code: code2,
            pos
          } = readHexChar(input, pos, lineStart, curLine, 2, false, throwOnInvalid, errors));
          return res(code2 === null ? null : String.fromCharCode(code2));
        }
        case 117: {
          let code2;
          ({
            code: code2,
            pos
          } = readCodePoint(input, pos, lineStart, curLine, throwOnInvalid, errors));
          return res(code2 === null ? null : String.fromCodePoint(code2));
        }
        case 116:
          return res("	");
        case 98:
          return res("\b");
        case 118:
          return res("\v");
        case 102:
          return res("\f");
        case 13:
          if (input.charCodeAt(pos) === 10) {
            ++pos;
          }
        case 10:
          lineStart = pos;
          ++curLine;
        case 8232:
        case 8233:
          return res("");
        case 56:
        case 57:
          if (inTemplate) {
            return res(null);
          } else {
            errors.strictNumericEscape(pos - 1, lineStart, curLine);
          }
        default:
          if (ch >= 48 && ch <= 55) {
            const startPos = pos - 1;
            const match = /^[0-7]+/.exec(input.slice(startPos, pos + 2));
            let octalStr = match[0];
            let octal = parseInt(octalStr, 8);
            if (octal > 255) {
              octalStr = octalStr.slice(0, -1);
              octal = parseInt(octalStr, 8);
            }
            pos += octalStr.length - 1;
            const next = input.charCodeAt(pos);
            if (octalStr !== "0" || next === 56 || next === 57) {
              if (inTemplate) {
                return res(null);
              } else {
                errors.strictNumericEscape(startPos, lineStart, curLine);
              }
            }
            return res(String.fromCharCode(octal));
          }
          return res(String.fromCharCode(ch));
      }
    }
    function readHexChar(input, pos, lineStart, curLine, len, forceLen, throwOnInvalid, errors) {
      const initialPos = pos;
      let n;
      ({
        n,
        pos
      } = readInt(input, pos, lineStart, curLine, 16, len, forceLen, false, errors, !throwOnInvalid));
      if (n === null) {
        if (throwOnInvalid) {
          errors.invalidEscapeSequence(initialPos, lineStart, curLine);
        } else {
          pos = initialPos - 1;
        }
      }
      return {
        code: n,
        pos
      };
    }
    function readInt(input, pos, lineStart, curLine, radix, len, forceLen, allowNumSeparator, errors, bailOnError) {
      const start = pos;
      const forbiddenSiblings = radix === 16 ? forbiddenNumericSeparatorSiblings.hex : forbiddenNumericSeparatorSiblings.decBinOct;
      const isAllowedSibling = radix === 16 ? isAllowedNumericSeparatorSibling.hex : radix === 10 ? isAllowedNumericSeparatorSibling.dec : radix === 8 ? isAllowedNumericSeparatorSibling.oct : isAllowedNumericSeparatorSibling.bin;
      let invalid = false;
      let total = 0;
      for (let i = 0, e = len == null ? Infinity : len; i < e; ++i) {
        const code2 = input.charCodeAt(pos);
        let val;
        if (code2 === 95 && allowNumSeparator !== "bail") {
          const prev = input.charCodeAt(pos - 1);
          const next = input.charCodeAt(pos + 1);
          if (!allowNumSeparator) {
            if (bailOnError) return {
              n: null,
              pos
            };
            errors.numericSeparatorInEscapeSequence(pos, lineStart, curLine);
          } else if (Number.isNaN(next) || !isAllowedSibling(next) || forbiddenSiblings.has(prev) || forbiddenSiblings.has(next)) {
            if (bailOnError) return {
              n: null,
              pos
            };
            errors.unexpectedNumericSeparator(pos, lineStart, curLine);
          }
          ++pos;
          continue;
        }
        if (code2 >= 97) {
          val = code2 - 97 + 10;
        } else if (code2 >= 65) {
          val = code2 - 65 + 10;
        } else if (_isDigit(code2)) {
          val = code2 - 48;
        } else {
          val = Infinity;
        }
        if (val >= radix) {
          if (val <= 9 && bailOnError) {
            return {
              n: null,
              pos
            };
          } else if (val <= 9 && errors.invalidDigit(pos, lineStart, curLine, radix)) {
            val = 0;
          } else if (forceLen) {
            val = 0;
            invalid = true;
          } else {
            break;
          }
        }
        ++pos;
        total = total * radix + val;
      }
      if (pos === start || len != null && pos - start !== len || invalid) {
        return {
          n: null,
          pos
        };
      }
      return {
        n: total,
        pos
      };
    }
    function readCodePoint(input, pos, lineStart, curLine, throwOnInvalid, errors) {
      const ch = input.charCodeAt(pos);
      let code2;
      if (ch === 123) {
        ++pos;
        ({
          code: code2,
          pos
        } = readHexChar(input, pos, lineStart, curLine, input.indexOf("}", pos) - pos, true, throwOnInvalid, errors));
        ++pos;
        if (code2 !== null && code2 > 1114111) {
          if (throwOnInvalid) {
            errors.invalidCodePoint(pos, lineStart, curLine);
          } else {
            return {
              code: null,
              pos
            };
          }
        }
      } else {
        ({
          code: code2,
          pos
        } = readHexChar(input, pos, lineStart, curLine, 4, false, throwOnInvalid, errors));
      }
      return {
        code: code2,
        pos
      };
    }
    function buildPosition(pos, lineStart, curLine) {
      return new Position(curLine, pos - lineStart, pos);
    }
    var VALID_REGEX_FLAGS = /* @__PURE__ */ new Set([103, 109, 115, 105, 121, 117, 100, 118]);
    var Token = class {
      constructor(state) {
        const startIndex = state.startIndex || 0;
        this.type = state.type;
        this.value = state.value;
        this.start = startIndex + state.start;
        this.end = startIndex + state.end;
        this.loc = new SourceLocation(state.startLoc, state.endLoc);
      }
    };
    var Tokenizer = class extends CommentsParser {
      constructor(options, input) {
        super();
        this.isLookahead = void 0;
        this.tokens = [];
        this.errorHandlers_readInt = {
          invalidDigit: (pos, lineStart, curLine, radix) => {
            if (!(this.optionFlags & 2048)) return false;
            this.raise(Errors.InvalidDigit, buildPosition(pos, lineStart, curLine), {
              radix
            });
            return true;
          },
          numericSeparatorInEscapeSequence: this.errorBuilder(Errors.NumericSeparatorInEscapeSequence),
          unexpectedNumericSeparator: this.errorBuilder(Errors.UnexpectedNumericSeparator)
        };
        this.errorHandlers_readCodePoint = Object.assign({}, this.errorHandlers_readInt, {
          invalidEscapeSequence: this.errorBuilder(Errors.InvalidEscapeSequence),
          invalidCodePoint: this.errorBuilder(Errors.InvalidCodePoint)
        });
        this.errorHandlers_readStringContents_string = Object.assign({}, this.errorHandlers_readCodePoint, {
          strictNumericEscape: (pos, lineStart, curLine) => {
            this.recordStrictModeErrors(Errors.StrictNumericEscape, buildPosition(pos, lineStart, curLine));
          },
          unterminated: (pos, lineStart, curLine) => {
            throw this.raise(Errors.UnterminatedString, buildPosition(pos - 1, lineStart, curLine));
          }
        });
        this.errorHandlers_readStringContents_template = Object.assign({}, this.errorHandlers_readCodePoint, {
          strictNumericEscape: this.errorBuilder(Errors.StrictNumericEscape),
          unterminated: (pos, lineStart, curLine) => {
            throw this.raise(Errors.UnterminatedTemplate, buildPosition(pos, lineStart, curLine));
          }
        });
        this.state = new State();
        this.state.init(options);
        this.input = input;
        this.length = input.length;
        this.comments = [];
        this.isLookahead = false;
      }
      pushToken(token) {
        this.tokens.length = this.state.tokensLength;
        this.tokens.push(token);
        ++this.state.tokensLength;
      }
      next() {
        this.checkKeywordEscapes();
        if (this.optionFlags & 256) {
          this.pushToken(new Token(this.state));
        }
        this.state.lastTokEndLoc = this.state.endLoc;
        this.state.lastTokStartLoc = this.state.startLoc;
        this.nextToken();
      }
      eat(type) {
        if (this.match(type)) {
          this.next();
          return true;
        } else {
          return false;
        }
      }
      match(type) {
        return this.state.type === type;
      }
      createLookaheadState(state) {
        return {
          pos: state.pos,
          value: null,
          type: state.type,
          start: state.start,
          end: state.end,
          context: [this.curContext()],
          inType: state.inType,
          startLoc: state.startLoc,
          lastTokEndLoc: state.lastTokEndLoc,
          curLine: state.curLine,
          lineStart: state.lineStart,
          curPosition: state.curPosition
        };
      }
      lookahead() {
        const old = this.state;
        this.state = this.createLookaheadState(old);
        this.isLookahead = true;
        this.nextToken();
        this.isLookahead = false;
        const curr = this.state;
        this.state = old;
        return curr;
      }
      nextTokenStart() {
        return this.nextTokenStartSince(this.state.pos);
      }
      nextTokenStartSince(pos) {
        skipWhiteSpace.lastIndex = pos;
        return skipWhiteSpace.test(this.input) ? skipWhiteSpace.lastIndex : pos;
      }
      lookaheadCharCode() {
        return this.lookaheadCharCodeSince(this.state.pos);
      }
      lookaheadCharCodeSince(pos) {
        return this.input.charCodeAt(this.nextTokenStartSince(pos));
      }
      nextTokenInLineStart() {
        return this.nextTokenInLineStartSince(this.state.pos);
      }
      nextTokenInLineStartSince(pos) {
        skipWhiteSpaceInLine.lastIndex = pos;
        return skipWhiteSpaceInLine.test(this.input) ? skipWhiteSpaceInLine.lastIndex : pos;
      }
      lookaheadInLineCharCode() {
        return this.input.charCodeAt(this.nextTokenInLineStart());
      }
      codePointAtPos(pos) {
        let cp = this.input.charCodeAt(pos);
        if ((cp & 64512) === 55296 && ++pos < this.input.length) {
          const trail = this.input.charCodeAt(pos);
          if ((trail & 64512) === 56320) {
            cp = 65536 + ((cp & 1023) << 10) + (trail & 1023);
          }
        }
        return cp;
      }
      setStrict(strict) {
        this.state.strict = strict;
        if (strict) {
          this.state.strictErrors.forEach(([toParseError, at]) => this.raise(toParseError, at));
          this.state.strictErrors.clear();
        }
      }
      curContext() {
        return this.state.context[this.state.context.length - 1];
      }
      nextToken() {
        this.skipSpace();
        this.state.start = this.state.pos;
        if (!this.isLookahead) this.state.startLoc = this.state.curPosition();
        if (this.state.pos >= this.length) {
          this.finishToken(140);
          return;
        }
        this.getTokenFromCode(this.codePointAtPos(this.state.pos));
      }
      skipBlockComment(commentEnd) {
        let startLoc;
        if (!this.isLookahead) startLoc = this.state.curPosition();
        const start = this.state.pos;
        const end = this.input.indexOf(commentEnd, start + 2);
        if (end === -1) {
          throw this.raise(Errors.UnterminatedComment, this.state.curPosition());
        }
        this.state.pos = end + commentEnd.length;
        lineBreakG.lastIndex = start + 2;
        while (lineBreakG.test(this.input) && lineBreakG.lastIndex <= end) {
          ++this.state.curLine;
          this.state.lineStart = lineBreakG.lastIndex;
        }
        if (this.isLookahead) return;
        const comment = {
          type: "CommentBlock",
          value: this.input.slice(start + 2, end),
          start: this.sourceToOffsetPos(start),
          end: this.sourceToOffsetPos(end + commentEnd.length),
          loc: new SourceLocation(startLoc, this.state.curPosition())
        };
        if (this.optionFlags & 256) this.pushToken(comment);
        return comment;
      }
      skipLineComment(startSkip) {
        const start = this.state.pos;
        let startLoc;
        if (!this.isLookahead) startLoc = this.state.curPosition();
        let ch = this.input.charCodeAt(this.state.pos += startSkip);
        if (this.state.pos < this.length) {
          while (!isNewLine(ch) && ++this.state.pos < this.length) {
            ch = this.input.charCodeAt(this.state.pos);
          }
        }
        if (this.isLookahead) return;
        const end = this.state.pos;
        const value2 = this.input.slice(start + startSkip, end);
        const comment = {
          type: "CommentLine",
          value: value2,
          start: this.sourceToOffsetPos(start),
          end: this.sourceToOffsetPos(end),
          loc: new SourceLocation(startLoc, this.state.curPosition())
        };
        if (this.optionFlags & 256) this.pushToken(comment);
        return comment;
      }
      skipSpace() {
        const spaceStart = this.state.pos;
        const comments = this.optionFlags & 4096 ? [] : null;
        loop: while (this.state.pos < this.length) {
          const ch = this.input.charCodeAt(this.state.pos);
          switch (ch) {
            case 32:
            case 160:
            case 9:
              ++this.state.pos;
              break;
            case 13:
              if (this.input.charCodeAt(this.state.pos + 1) === 10) {
                ++this.state.pos;
              }
            case 10:
            case 8232:
            case 8233:
              ++this.state.pos;
              ++this.state.curLine;
              this.state.lineStart = this.state.pos;
              break;
            case 47:
              switch (this.input.charCodeAt(this.state.pos + 1)) {
                case 42: {
                  const comment = this.skipBlockComment("*/");
                  if (comment !== void 0) {
                    this.addComment(comment);
                    comments == null || comments.push(comment);
                  }
                  break;
                }
                case 47: {
                  const comment = this.skipLineComment(2);
                  if (comment !== void 0) {
                    this.addComment(comment);
                    comments == null || comments.push(comment);
                  }
                  break;
                }
                default:
                  break loop;
              }
              break;
            default:
              if (isWhitespace(ch)) {
                ++this.state.pos;
              } else if (ch === 45 && !this.inModule && this.optionFlags & 8192) {
                const pos = this.state.pos;
                if (this.input.charCodeAt(pos + 1) === 45 && this.input.charCodeAt(pos + 2) === 62 && (spaceStart === 0 || this.state.lineStart > spaceStart)) {
                  const comment = this.skipLineComment(3);
                  if (comment !== void 0) {
                    this.addComment(comment);
                    comments == null || comments.push(comment);
                  }
                } else {
                  break loop;
                }
              } else if (ch === 60 && !this.inModule && this.optionFlags & 8192) {
                const pos = this.state.pos;
                if (this.input.charCodeAt(pos + 1) === 33 && this.input.charCodeAt(pos + 2) === 45 && this.input.charCodeAt(pos + 3) === 45) {
                  const comment = this.skipLineComment(4);
                  if (comment !== void 0) {
                    this.addComment(comment);
                    comments == null || comments.push(comment);
                  }
                } else {
                  break loop;
                }
              } else {
                break loop;
              }
          }
        }
        if ((comments == null ? void 0 : comments.length) > 0) {
          const end = this.state.pos;
          const commentWhitespace = {
            start: this.sourceToOffsetPos(spaceStart),
            end: this.sourceToOffsetPos(end),
            comments,
            leadingNode: null,
            trailingNode: null,
            containingNode: null
          };
          this.state.commentStack.push(commentWhitespace);
        }
      }
      finishToken(type, val) {
        this.state.end = this.state.pos;
        this.state.endLoc = this.state.curPosition();
        const prevType = this.state.type;
        this.state.type = type;
        this.state.value = val;
        if (!this.isLookahead) {
          this.updateContext(prevType);
        }
      }
      replaceToken(type) {
        this.state.type = type;
        this.updateContext();
      }
      readToken_numberSign() {
        if (this.state.pos === 0 && this.readToken_interpreter()) {
          return;
        }
        const nextPos = this.state.pos + 1;
        const next = this.codePointAtPos(nextPos);
        if (next >= 48 && next <= 57) {
          throw this.raise(Errors.UnexpectedDigitAfterHash, this.state.curPosition());
        }
        if (next === 123 || next === 91 && this.hasPlugin("recordAndTuple")) {
          this.expectPlugin("recordAndTuple");
          if (this.getPluginOption("recordAndTuple", "syntaxType") === "bar") {
            throw this.raise(next === 123 ? Errors.RecordExpressionHashIncorrectStartSyntaxType : Errors.TupleExpressionHashIncorrectStartSyntaxType, this.state.curPosition());
          }
          this.state.pos += 2;
          if (next === 123) {
            this.finishToken(7);
          } else {
            this.finishToken(1);
          }
        } else if (isIdentifierStart(next)) {
          ++this.state.pos;
          this.finishToken(139, this.readWord1(next));
        } else if (next === 92) {
          ++this.state.pos;
          this.finishToken(139, this.readWord1());
        } else {
          this.finishOp(27, 1);
        }
      }
      readToken_dot() {
        const next = this.input.charCodeAt(this.state.pos + 1);
        if (next >= 48 && next <= 57) {
          this.readNumber(true);
          return;
        }
        if (next === 46 && this.input.charCodeAt(this.state.pos + 2) === 46) {
          this.state.pos += 3;
          this.finishToken(21);
        } else {
          ++this.state.pos;
          this.finishToken(16);
        }
      }
      readToken_slash() {
        const next = this.input.charCodeAt(this.state.pos + 1);
        if (next === 61) {
          this.finishOp(31, 2);
        } else {
          this.finishOp(56, 1);
        }
      }
      readToken_interpreter() {
        if (this.state.pos !== 0 || this.length < 2) return false;
        let ch = this.input.charCodeAt(this.state.pos + 1);
        if (ch !== 33) return false;
        const start = this.state.pos;
        this.state.pos += 1;
        while (!isNewLine(ch) && ++this.state.pos < this.length) {
          ch = this.input.charCodeAt(this.state.pos);
        }
        const value2 = this.input.slice(start + 2, this.state.pos);
        this.finishToken(28, value2);
        return true;
      }
      readToken_mult_modulo(code2) {
        let type = code2 === 42 ? 55 : 54;
        let width = 1;
        let next = this.input.charCodeAt(this.state.pos + 1);
        if (code2 === 42 && next === 42) {
          width++;
          next = this.input.charCodeAt(this.state.pos + 2);
          type = 57;
        }
        if (next === 61 && !this.state.inType) {
          width++;
          type = code2 === 37 ? 33 : 30;
        }
        this.finishOp(type, width);
      }
      readToken_pipe_amp(code2) {
        const next = this.input.charCodeAt(this.state.pos + 1);
        if (next === code2) {
          if (this.input.charCodeAt(this.state.pos + 2) === 61) {
            this.finishOp(30, 3);
          } else {
            this.finishOp(code2 === 124 ? 41 : 42, 2);
          }
          return;
        }
        if (code2 === 124) {
          if (next === 62) {
            this.finishOp(39, 2);
            return;
          }
          if (this.hasPlugin("recordAndTuple") && next === 125) {
            if (this.getPluginOption("recordAndTuple", "syntaxType") !== "bar") {
              throw this.raise(Errors.RecordExpressionBarIncorrectEndSyntaxType, this.state.curPosition());
            }
            this.state.pos += 2;
            this.finishToken(9);
            return;
          }
          if (this.hasPlugin("recordAndTuple") && next === 93) {
            if (this.getPluginOption("recordAndTuple", "syntaxType") !== "bar") {
              throw this.raise(Errors.TupleExpressionBarIncorrectEndSyntaxType, this.state.curPosition());
            }
            this.state.pos += 2;
            this.finishToken(4);
            return;
          }
        }
        if (next === 61) {
          this.finishOp(30, 2);
          return;
        }
        this.finishOp(code2 === 124 ? 43 : 45, 1);
      }
      readToken_caret() {
        const next = this.input.charCodeAt(this.state.pos + 1);
        if (next === 61 && !this.state.inType) {
          this.finishOp(32, 2);
        } else if (next === 94 && this.hasPlugin(["pipelineOperator", {
          proposal: "hack",
          topicToken: "^^"
        }])) {
          this.finishOp(37, 2);
          const lookaheadCh = this.input.codePointAt(this.state.pos);
          if (lookaheadCh === 94) {
            this.unexpected();
          }
        } else {
          this.finishOp(44, 1);
        }
      }
      readToken_atSign() {
        const next = this.input.charCodeAt(this.state.pos + 1);
        if (next === 64 && this.hasPlugin(["pipelineOperator", {
          proposal: "hack",
          topicToken: "@@"
        }])) {
          this.finishOp(38, 2);
        } else {
          this.finishOp(26, 1);
        }
      }
      readToken_plus_min(code2) {
        const next = this.input.charCodeAt(this.state.pos + 1);
        if (next === code2) {
          this.finishOp(34, 2);
          return;
        }
        if (next === 61) {
          this.finishOp(30, 2);
        } else {
          this.finishOp(53, 1);
        }
      }
      readToken_lt() {
        const {
          pos
        } = this.state;
        const next = this.input.charCodeAt(pos + 1);
        if (next === 60) {
          if (this.input.charCodeAt(pos + 2) === 61) {
            this.finishOp(30, 3);
            return;
          }
          this.finishOp(51, 2);
          return;
        }
        if (next === 61) {
          this.finishOp(49, 2);
          return;
        }
        this.finishOp(47, 1);
      }
      readToken_gt() {
        const {
          pos
        } = this.state;
        const next = this.input.charCodeAt(pos + 1);
        if (next === 62) {
          const size = this.input.charCodeAt(pos + 2) === 62 ? 3 : 2;
          if (this.input.charCodeAt(pos + size) === 61) {
            this.finishOp(30, size + 1);
            return;
          }
          this.finishOp(52, size);
          return;
        }
        if (next === 61) {
          this.finishOp(49, 2);
          return;
        }
        this.finishOp(48, 1);
      }
      readToken_eq_excl(code2) {
        const next = this.input.charCodeAt(this.state.pos + 1);
        if (next === 61) {
          this.finishOp(46, this.input.charCodeAt(this.state.pos + 2) === 61 ? 3 : 2);
          return;
        }
        if (code2 === 61 && next === 62) {
          this.state.pos += 2;
          this.finishToken(19);
          return;
        }
        this.finishOp(code2 === 61 ? 29 : 35, 1);
      }
      readToken_question() {
        const next = this.input.charCodeAt(this.state.pos + 1);
        const next2 = this.input.charCodeAt(this.state.pos + 2);
        if (next === 63) {
          if (next2 === 61) {
            this.finishOp(30, 3);
          } else {
            this.finishOp(40, 2);
          }
        } else if (next === 46 && !(next2 >= 48 && next2 <= 57)) {
          this.state.pos += 2;
          this.finishToken(18);
        } else {
          ++this.state.pos;
          this.finishToken(17);
        }
      }
      getTokenFromCode(code2) {
        switch (code2) {
          case 46:
            this.readToken_dot();
            return;
          case 40:
            ++this.state.pos;
            this.finishToken(10);
            return;
          case 41:
            ++this.state.pos;
            this.finishToken(11);
            return;
          case 59:
            ++this.state.pos;
            this.finishToken(13);
            return;
          case 44:
            ++this.state.pos;
            this.finishToken(12);
            return;
          case 91:
            if (this.hasPlugin("recordAndTuple") && this.input.charCodeAt(this.state.pos + 1) === 124) {
              if (this.getPluginOption("recordAndTuple", "syntaxType") !== "bar") {
                throw this.raise(Errors.TupleExpressionBarIncorrectStartSyntaxType, this.state.curPosition());
              }
              this.state.pos += 2;
              this.finishToken(2);
            } else {
              ++this.state.pos;
              this.finishToken(0);
            }
            return;
          case 93:
            ++this.state.pos;
            this.finishToken(3);
            return;
          case 123:
            if (this.hasPlugin("recordAndTuple") && this.input.charCodeAt(this.state.pos + 1) === 124) {
              if (this.getPluginOption("recordAndTuple", "syntaxType") !== "bar") {
                throw this.raise(Errors.RecordExpressionBarIncorrectStartSyntaxType, this.state.curPosition());
              }
              this.state.pos += 2;
              this.finishToken(6);
            } else {
              ++this.state.pos;
              this.finishToken(5);
            }
            return;
          case 125:
            ++this.state.pos;
            this.finishToken(8);
            return;
          case 58:
            if (this.hasPlugin("functionBind") && this.input.charCodeAt(this.state.pos + 1) === 58) {
              this.finishOp(15, 2);
            } else {
              ++this.state.pos;
              this.finishToken(14);
            }
            return;
          case 63:
            this.readToken_question();
            return;
          case 96:
            this.readTemplateToken();
            return;
          case 48: {
            const next = this.input.charCodeAt(this.state.pos + 1);
            if (next === 120 || next === 88) {
              this.readRadixNumber(16);
              return;
            }
            if (next === 111 || next === 79) {
              this.readRadixNumber(8);
              return;
            }
            if (next === 98 || next === 66) {
              this.readRadixNumber(2);
              return;
            }
          }
          case 49:
          case 50:
          case 51:
          case 52:
          case 53:
          case 54:
          case 55:
          case 56:
          case 57:
            this.readNumber(false);
            return;
          case 34:
          case 39:
            this.readString(code2);
            return;
          case 47:
            this.readToken_slash();
            return;
          case 37:
          case 42:
            this.readToken_mult_modulo(code2);
            return;
          case 124:
          case 38:
            this.readToken_pipe_amp(code2);
            return;
          case 94:
            this.readToken_caret();
            return;
          case 43:
          case 45:
            this.readToken_plus_min(code2);
            return;
          case 60:
            this.readToken_lt();
            return;
          case 62:
            this.readToken_gt();
            return;
          case 61:
          case 33:
            this.readToken_eq_excl(code2);
            return;
          case 126:
            this.finishOp(36, 1);
            return;
          case 64:
            this.readToken_atSign();
            return;
          case 35:
            this.readToken_numberSign();
            return;
          case 92:
            this.readWord();
            return;
          default:
            if (isIdentifierStart(code2)) {
              this.readWord(code2);
              return;
            }
        }
        throw this.raise(Errors.InvalidOrUnexpectedToken, this.state.curPosition(), {
          unexpected: String.fromCodePoint(code2)
        });
      }
      finishOp(type, size) {
        const str = this.input.slice(this.state.pos, this.state.pos + size);
        this.state.pos += size;
        this.finishToken(type, str);
      }
      readRegexp() {
        const startLoc = this.state.startLoc;
        const start = this.state.start + 1;
        let escaped, inClass;
        let {
          pos
        } = this.state;
        for (; ; ++pos) {
          if (pos >= this.length) {
            throw this.raise(Errors.UnterminatedRegExp, createPositionWithColumnOffset(startLoc, 1));
          }
          const ch = this.input.charCodeAt(pos);
          if (isNewLine(ch)) {
            throw this.raise(Errors.UnterminatedRegExp, createPositionWithColumnOffset(startLoc, 1));
          }
          if (escaped) {
            escaped = false;
          } else {
            if (ch === 91) {
              inClass = true;
            } else if (ch === 93 && inClass) {
              inClass = false;
            } else if (ch === 47 && !inClass) {
              break;
            }
            escaped = ch === 92;
          }
        }
        const content = this.input.slice(start, pos);
        ++pos;
        let mods = "";
        const nextPos = () => createPositionWithColumnOffset(startLoc, pos + 2 - start);
        while (pos < this.length) {
          const cp = this.codePointAtPos(pos);
          const char = String.fromCharCode(cp);
          if (VALID_REGEX_FLAGS.has(cp)) {
            if (cp === 118) {
              if (mods.includes("u")) {
                this.raise(Errors.IncompatibleRegExpUVFlags, nextPos());
              }
            } else if (cp === 117) {
              if (mods.includes("v")) {
                this.raise(Errors.IncompatibleRegExpUVFlags, nextPos());
              }
            }
            if (mods.includes(char)) {
              this.raise(Errors.DuplicateRegExpFlags, nextPos());
            }
          } else if (isIdentifierChar(cp) || cp === 92) {
            this.raise(Errors.MalformedRegExpFlags, nextPos());
          } else {
            break;
          }
          ++pos;
          mods += char;
        }
        this.state.pos = pos;
        this.finishToken(138, {
          pattern: content,
          flags: mods
        });
      }
      readInt(radix, len, forceLen = false, allowNumSeparator = true) {
        const {
          n,
          pos
        } = readInt(this.input, this.state.pos, this.state.lineStart, this.state.curLine, radix, len, forceLen, allowNumSeparator, this.errorHandlers_readInt, false);
        this.state.pos = pos;
        return n;
      }
      readRadixNumber(radix) {
        const start = this.state.pos;
        const startLoc = this.state.curPosition();
        let isBigInt = false;
        this.state.pos += 2;
        const val = this.readInt(radix);
        if (val == null) {
          this.raise(Errors.InvalidDigit, createPositionWithColumnOffset(startLoc, 2), {
            radix
          });
        }
        const next = this.input.charCodeAt(this.state.pos);
        if (next === 110) {
          ++this.state.pos;
          isBigInt = true;
        } else if (next === 109) {
          throw this.raise(Errors.InvalidDecimal, startLoc);
        }
        if (isIdentifierStart(this.codePointAtPos(this.state.pos))) {
          throw this.raise(Errors.NumberIdentifier, this.state.curPosition());
        }
        if (isBigInt) {
          const str = this.input.slice(start, this.state.pos).replace(/[_n]/g, "");
          this.finishToken(136, str);
          return;
        }
        this.finishToken(135, val);
      }
      readNumber(startsWithDot) {
        const start = this.state.pos;
        const startLoc = this.state.curPosition();
        let isFloat = false;
        let isBigInt = false;
        let hasExponent = false;
        let isOctal = false;
        if (!startsWithDot && this.readInt(10) === null) {
          this.raise(Errors.InvalidNumber, this.state.curPosition());
        }
        const hasLeadingZero = this.state.pos - start >= 2 && this.input.charCodeAt(start) === 48;
        if (hasLeadingZero) {
          const integer = this.input.slice(start, this.state.pos);
          this.recordStrictModeErrors(Errors.StrictOctalLiteral, startLoc);
          if (!this.state.strict) {
            const underscorePos = integer.indexOf("_");
            if (underscorePos > 0) {
              this.raise(Errors.ZeroDigitNumericSeparator, createPositionWithColumnOffset(startLoc, underscorePos));
            }
          }
          isOctal = hasLeadingZero && !/[89]/.test(integer);
        }
        let next = this.input.charCodeAt(this.state.pos);
        if (next === 46 && !isOctal) {
          ++this.state.pos;
          this.readInt(10);
          isFloat = true;
          next = this.input.charCodeAt(this.state.pos);
        }
        if ((next === 69 || next === 101) && !isOctal) {
          next = this.input.charCodeAt(++this.state.pos);
          if (next === 43 || next === 45) {
            ++this.state.pos;
          }
          if (this.readInt(10) === null) {
            this.raise(Errors.InvalidOrMissingExponent, startLoc);
          }
          isFloat = true;
          hasExponent = true;
          next = this.input.charCodeAt(this.state.pos);
        }
        if (next === 110) {
          if (isFloat || hasLeadingZero) {
            this.raise(Errors.InvalidBigIntLiteral, startLoc);
          }
          ++this.state.pos;
          isBigInt = true;
        }
        if (next === 109) {
          this.expectPlugin("decimal", this.state.curPosition());
          if (hasExponent || hasLeadingZero) {
            this.raise(Errors.InvalidDecimal, startLoc);
          }
          ++this.state.pos;
          var isDecimal = true;
        }
        if (isIdentifierStart(this.codePointAtPos(this.state.pos))) {
          throw this.raise(Errors.NumberIdentifier, this.state.curPosition());
        }
        const str = this.input.slice(start, this.state.pos).replace(/[_mn]/g, "");
        if (isBigInt) {
          this.finishToken(136, str);
          return;
        }
        if (isDecimal) {
          this.finishToken(137, str);
          return;
        }
        const val = isOctal ? parseInt(str, 8) : parseFloat(str);
        this.finishToken(135, val);
      }
      readCodePoint(throwOnInvalid) {
        const {
          code: code2,
          pos
        } = readCodePoint(this.input, this.state.pos, this.state.lineStart, this.state.curLine, throwOnInvalid, this.errorHandlers_readCodePoint);
        this.state.pos = pos;
        return code2;
      }
      readString(quote) {
        const {
          str,
          pos,
          curLine,
          lineStart
        } = readStringContents(quote === 34 ? "double" : "single", this.input, this.state.pos + 1, this.state.lineStart, this.state.curLine, this.errorHandlers_readStringContents_string);
        this.state.pos = pos + 1;
        this.state.lineStart = lineStart;
        this.state.curLine = curLine;
        this.finishToken(134, str);
      }
      readTemplateContinuation() {
        if (!this.match(8)) {
          this.unexpected(null, 8);
        }
        this.state.pos--;
        this.readTemplateToken();
      }
      readTemplateToken() {
        const opening = this.input[this.state.pos];
        const {
          str,
          firstInvalidLoc,
          pos,
          curLine,
          lineStart
        } = readStringContents("template", this.input, this.state.pos + 1, this.state.lineStart, this.state.curLine, this.errorHandlers_readStringContents_template);
        this.state.pos = pos + 1;
        this.state.lineStart = lineStart;
        this.state.curLine = curLine;
        if (firstInvalidLoc) {
          this.state.firstInvalidTemplateEscapePos = new Position(firstInvalidLoc.curLine, firstInvalidLoc.pos - firstInvalidLoc.lineStart, this.sourceToOffsetPos(firstInvalidLoc.pos));
        }
        if (this.input.codePointAt(pos) === 96) {
          this.finishToken(24, firstInvalidLoc ? null : opening + str + "`");
        } else {
          this.state.pos++;
          this.finishToken(25, firstInvalidLoc ? null : opening + str + "${");
        }
      }
      recordStrictModeErrors(toParseError, at) {
        const index = at.index;
        if (this.state.strict && !this.state.strictErrors.has(index)) {
          this.raise(toParseError, at);
        } else {
          this.state.strictErrors.set(index, [toParseError, at]);
        }
      }
      readWord1(firstCode) {
        this.state.containsEsc = false;
        let word = "";
        const start = this.state.pos;
        let chunkStart = this.state.pos;
        if (firstCode !== void 0) {
          this.state.pos += firstCode <= 65535 ? 1 : 2;
        }
        while (this.state.pos < this.length) {
          const ch = this.codePointAtPos(this.state.pos);
          if (isIdentifierChar(ch)) {
            this.state.pos += ch <= 65535 ? 1 : 2;
          } else if (ch === 92) {
            this.state.containsEsc = true;
            word += this.input.slice(chunkStart, this.state.pos);
            const escStart = this.state.curPosition();
            const identifierCheck = this.state.pos === start ? isIdentifierStart : isIdentifierChar;
            if (this.input.charCodeAt(++this.state.pos) !== 117) {
              this.raise(Errors.MissingUnicodeEscape, this.state.curPosition());
              chunkStart = this.state.pos - 1;
              continue;
            }
            ++this.state.pos;
            const esc = this.readCodePoint(true);
            if (esc !== null) {
              if (!identifierCheck(esc)) {
                this.raise(Errors.EscapedCharNotAnIdentifier, escStart);
              }
              word += String.fromCodePoint(esc);
            }
            chunkStart = this.state.pos;
          } else {
            break;
          }
        }
        return word + this.input.slice(chunkStart, this.state.pos);
      }
      readWord(firstCode) {
        const word = this.readWord1(firstCode);
        const type = keywords$1.get(word);
        if (type !== void 0) {
          this.finishToken(type, tokenLabelName(type));
        } else {
          this.finishToken(132, word);
        }
      }
      checkKeywordEscapes() {
        const {
          type
        } = this.state;
        if (tokenIsKeyword(type) && this.state.containsEsc) {
          this.raise(Errors.InvalidEscapedReservedWord, this.state.startLoc, {
            reservedWord: tokenLabelName(type)
          });
        }
      }
      raise(toParseError, at, details = {}) {
        const loc = at instanceof Position ? at : at.loc.start;
        const error = toParseError(loc, details);
        if (!(this.optionFlags & 2048)) throw error;
        if (!this.isLookahead) this.state.errors.push(error);
        return error;
      }
      raiseOverwrite(toParseError, at, details = {}) {
        const loc = at instanceof Position ? at : at.loc.start;
        const pos = loc.index;
        const errors = this.state.errors;
        for (let i = errors.length - 1; i >= 0; i--) {
          const error = errors[i];
          if (error.loc.index === pos) {
            return errors[i] = toParseError(loc, details);
          }
          if (error.loc.index < pos) break;
        }
        return this.raise(toParseError, at, details);
      }
      updateContext(prevType) {
      }
      unexpected(loc, type) {
        throw this.raise(Errors.UnexpectedToken, loc != null ? loc : this.state.startLoc, {
          expected: type ? tokenLabelName(type) : null
        });
      }
      expectPlugin(pluginName, loc) {
        if (this.hasPlugin(pluginName)) {
          return true;
        }
        throw this.raise(Errors.MissingPlugin, loc != null ? loc : this.state.startLoc, {
          missingPlugin: [pluginName]
        });
      }
      expectOnePlugin(pluginNames) {
        if (!pluginNames.some((name) => this.hasPlugin(name))) {
          throw this.raise(Errors.MissingOneOfPlugins, this.state.startLoc, {
            missingPlugin: pluginNames
          });
        }
      }
      errorBuilder(error) {
        return (pos, lineStart, curLine) => {
          this.raise(error, buildPosition(pos, lineStart, curLine));
        };
      }
    };
    var ClassScope = class {
      constructor() {
        this.privateNames = /* @__PURE__ */ new Set();
        this.loneAccessors = /* @__PURE__ */ new Map();
        this.undefinedPrivateNames = /* @__PURE__ */ new Map();
      }
    };
    var ClassScopeHandler = class {
      constructor(parser) {
        this.parser = void 0;
        this.stack = [];
        this.undefinedPrivateNames = /* @__PURE__ */ new Map();
        this.parser = parser;
      }
      current() {
        return this.stack[this.stack.length - 1];
      }
      enter() {
        this.stack.push(new ClassScope());
      }
      exit() {
        const oldClassScope = this.stack.pop();
        const current = this.current();
        for (const [name, loc] of Array.from(oldClassScope.undefinedPrivateNames)) {
          if (current) {
            if (!current.undefinedPrivateNames.has(name)) {
              current.undefinedPrivateNames.set(name, loc);
            }
          } else {
            this.parser.raise(Errors.InvalidPrivateFieldResolution, loc, {
              identifierName: name
            });
          }
        }
      }
      declarePrivateName(name, elementType, loc) {
        const {
          privateNames,
          loneAccessors,
          undefinedPrivateNames
        } = this.current();
        let redefined = privateNames.has(name);
        if (elementType & 3) {
          const accessor = redefined && loneAccessors.get(name);
          if (accessor) {
            const oldStatic = accessor & 4;
            const newStatic = elementType & 4;
            const oldKind = accessor & 3;
            const newKind = elementType & 3;
            redefined = oldKind === newKind || oldStatic !== newStatic;
            if (!redefined) loneAccessors.delete(name);
          } else if (!redefined) {
            loneAccessors.set(name, elementType);
          }
        }
        if (redefined) {
          this.parser.raise(Errors.PrivateNameRedeclaration, loc, {
            identifierName: name
          });
        }
        privateNames.add(name);
        undefinedPrivateNames.delete(name);
      }
      usePrivateName(name, loc) {
        let classScope;
        for (classScope of this.stack) {
          if (classScope.privateNames.has(name)) return;
        }
        if (classScope) {
          classScope.undefinedPrivateNames.set(name, loc);
        } else {
          this.parser.raise(Errors.InvalidPrivateFieldResolution, loc, {
            identifierName: name
          });
        }
      }
    };
    var ExpressionScope = class {
      constructor(type = 0) {
        this.type = type;
      }
      canBeArrowParameterDeclaration() {
        return this.type === 2 || this.type === 1;
      }
      isCertainlyParameterDeclaration() {
        return this.type === 3;
      }
    };
    var ArrowHeadParsingScope = class extends ExpressionScope {
      constructor(type) {
        super(type);
        this.declarationErrors = /* @__PURE__ */ new Map();
      }
      recordDeclarationError(ParsingErrorClass, at) {
        const index = at.index;
        this.declarationErrors.set(index, [ParsingErrorClass, at]);
      }
      clearDeclarationError(index) {
        this.declarationErrors.delete(index);
      }
      iterateErrors(iterator) {
        this.declarationErrors.forEach(iterator);
      }
    };
    var ExpressionScopeHandler = class {
      constructor(parser) {
        this.parser = void 0;
        this.stack = [new ExpressionScope()];
        this.parser = parser;
      }
      enter(scope) {
        this.stack.push(scope);
      }
      exit() {
        this.stack.pop();
      }
      recordParameterInitializerError(toParseError, node) {
        const origin = node.loc.start;
        const {
          stack
        } = this;
        let i = stack.length - 1;
        let scope = stack[i];
        while (!scope.isCertainlyParameterDeclaration()) {
          if (scope.canBeArrowParameterDeclaration()) {
            scope.recordDeclarationError(toParseError, origin);
          } else {
            return;
          }
          scope = stack[--i];
        }
        this.parser.raise(toParseError, origin);
      }
      recordArrowParameterBindingError(error, node) {
        const {
          stack
        } = this;
        const scope = stack[stack.length - 1];
        const origin = node.loc.start;
        if (scope.isCertainlyParameterDeclaration()) {
          this.parser.raise(error, origin);
        } else if (scope.canBeArrowParameterDeclaration()) {
          scope.recordDeclarationError(error, origin);
        } else {
          return;
        }
      }
      recordAsyncArrowParametersError(at) {
        const {
          stack
        } = this;
        let i = stack.length - 1;
        let scope = stack[i];
        while (scope.canBeArrowParameterDeclaration()) {
          if (scope.type === 2) {
            scope.recordDeclarationError(Errors.AwaitBindingIdentifier, at);
          }
          scope = stack[--i];
        }
      }
      validateAsPattern() {
        const {
          stack
        } = this;
        const currentScope = stack[stack.length - 1];
        if (!currentScope.canBeArrowParameterDeclaration()) return;
        currentScope.iterateErrors(([toParseError, loc]) => {
          this.parser.raise(toParseError, loc);
          let i = stack.length - 2;
          let scope = stack[i];
          while (scope.canBeArrowParameterDeclaration()) {
            scope.clearDeclarationError(loc.index);
            scope = stack[--i];
          }
        });
      }
    };
    function newParameterDeclarationScope() {
      return new ExpressionScope(3);
    }
    function newArrowHeadScope() {
      return new ArrowHeadParsingScope(1);
    }
    function newAsyncArrowScope() {
      return new ArrowHeadParsingScope(2);
    }
    function newExpressionScope() {
      return new ExpressionScope();
    }
    var UtilParser = class extends Tokenizer {
      addExtra(node, key, value2, enumerable = true) {
        if (!node) return;
        let {
          extra
        } = node;
        if (extra == null) {
          extra = {};
          node.extra = extra;
        }
        if (enumerable) {
          extra[key] = value2;
        } else {
          Object.defineProperty(extra, key, {
            enumerable,
            value: value2
          });
        }
      }
      isContextual(token) {
        return this.state.type === token && !this.state.containsEsc;
      }
      isUnparsedContextual(nameStart, name) {
        if (this.input.startsWith(name, nameStart)) {
          const nextCh = this.input.charCodeAt(nameStart + name.length);
          return !(isIdentifierChar(nextCh) || (nextCh & 64512) === 55296);
        }
        return false;
      }
      isLookaheadContextual(name) {
        const next = this.nextTokenStart();
        return this.isUnparsedContextual(next, name);
      }
      eatContextual(token) {
        if (this.isContextual(token)) {
          this.next();
          return true;
        }
        return false;
      }
      expectContextual(token, toParseError) {
        if (!this.eatContextual(token)) {
          if (toParseError != null) {
            throw this.raise(toParseError, this.state.startLoc);
          }
          this.unexpected(null, token);
        }
      }
      canInsertSemicolon() {
        return this.match(140) || this.match(8) || this.hasPrecedingLineBreak();
      }
      hasPrecedingLineBreak() {
        return hasNewLine(this.input, this.offsetToSourcePos(this.state.lastTokEndLoc.index), this.state.start);
      }
      hasFollowingLineBreak() {
        return hasNewLine(this.input, this.state.end, this.nextTokenStart());
      }
      isLineTerminator() {
        return this.eat(13) || this.canInsertSemicolon();
      }
      semicolon(allowAsi = true) {
        if (allowAsi ? this.isLineTerminator() : this.eat(13)) return;
        this.raise(Errors.MissingSemicolon, this.state.lastTokEndLoc);
      }
      expect(type, loc) {
        if (!this.eat(type)) {
          this.unexpected(loc, type);
        }
      }
      tryParse(fn, oldState = this.state.clone()) {
        const abortSignal = {
          node: null
        };
        try {
          const node = fn((node2 = null) => {
            abortSignal.node = node2;
            throw abortSignal;
          });
          if (this.state.errors.length > oldState.errors.length) {
            const failState = this.state;
            this.state = oldState;
            this.state.tokensLength = failState.tokensLength;
            return {
              node,
              error: failState.errors[oldState.errors.length],
              thrown: false,
              aborted: false,
              failState
            };
          }
          return {
            node,
            error: null,
            thrown: false,
            aborted: false,
            failState: null
          };
        } catch (error) {
          const failState = this.state;
          this.state = oldState;
          if (error instanceof SyntaxError) {
            return {
              node: null,
              error,
              thrown: true,
              aborted: false,
              failState
            };
          }
          if (error === abortSignal) {
            return {
              node: abortSignal.node,
              error: null,
              thrown: false,
              aborted: true,
              failState
            };
          }
          throw error;
        }
      }
      checkExpressionErrors(refExpressionErrors, andThrow) {
        if (!refExpressionErrors) return false;
        const {
          shorthandAssignLoc,
          doubleProtoLoc,
          privateKeyLoc,
          optionalParametersLoc,
          voidPatternLoc
        } = refExpressionErrors;
        const hasErrors = !!shorthandAssignLoc || !!doubleProtoLoc || !!optionalParametersLoc || !!privateKeyLoc || !!voidPatternLoc;
        if (!andThrow) {
          return hasErrors;
        }
        if (shorthandAssignLoc != null) {
          this.raise(Errors.InvalidCoverInitializedName, shorthandAssignLoc);
        }
        if (doubleProtoLoc != null) {
          this.raise(Errors.DuplicateProto, doubleProtoLoc);
        }
        if (privateKeyLoc != null) {
          this.raise(Errors.UnexpectedPrivateField, privateKeyLoc);
        }
        if (optionalParametersLoc != null) {
          this.unexpected(optionalParametersLoc);
        }
        if (voidPatternLoc != null) {
          this.raise(Errors.InvalidCoverDiscardElement, voidPatternLoc);
        }
      }
      isLiteralPropertyName() {
        return tokenIsLiteralPropertyName(this.state.type);
      }
      isPrivateName(node) {
        return node.type === "PrivateName";
      }
      getPrivateNameSV(node) {
        return node.id.name;
      }
      hasPropertyAsPrivateName(node) {
        return (node.type === "MemberExpression" || node.type === "OptionalMemberExpression") && this.isPrivateName(node.property);
      }
      isObjectProperty(node) {
        return node.type === "ObjectProperty";
      }
      isObjectMethod(node) {
        return node.type === "ObjectMethod";
      }
      initializeScopes(inModule = this.options.sourceType === "module") {
        const oldLabels = this.state.labels;
        this.state.labels = [];
        const oldExportedIdentifiers = this.exportedIdentifiers;
        this.exportedIdentifiers = /* @__PURE__ */ new Set();
        const oldInModule = this.inModule;
        this.inModule = inModule;
        const oldScope = this.scope;
        const ScopeHandler2 = this.getScopeHandler();
        this.scope = new ScopeHandler2(this, inModule);
        const oldProdParam = this.prodParam;
        this.prodParam = new ProductionParameterHandler();
        const oldClassScope = this.classScope;
        this.classScope = new ClassScopeHandler(this);
        const oldExpressionScope = this.expressionScope;
        this.expressionScope = new ExpressionScopeHandler(this);
        return () => {
          this.state.labels = oldLabels;
          this.exportedIdentifiers = oldExportedIdentifiers;
          this.inModule = oldInModule;
          this.scope = oldScope;
          this.prodParam = oldProdParam;
          this.classScope = oldClassScope;
          this.expressionScope = oldExpressionScope;
        };
      }
      enterInitialScopes() {
        let paramFlags = 0;
        if (this.inModule || this.optionFlags & 1) {
          paramFlags |= 2;
        }
        if (this.optionFlags & 32) {
          paramFlags |= 1;
        }
        const isCommonJS = !this.inModule && this.options.sourceType === "commonjs";
        if (isCommonJS || this.optionFlags & 2) {
          paramFlags |= 4;
        }
        this.prodParam.enter(paramFlags);
        let scopeFlags = isCommonJS ? 514 : 1;
        if (this.optionFlags & 4) {
          scopeFlags |= 512;
        }
        this.scope.enter(scopeFlags);
      }
      checkDestructuringPrivate(refExpressionErrors) {
        const {
          privateKeyLoc
        } = refExpressionErrors;
        if (privateKeyLoc !== null) {
          this.expectPlugin("destructuringPrivate", privateKeyLoc);
        }
      }
    };
    var ExpressionErrors = class {
      constructor() {
        this.shorthandAssignLoc = null;
        this.doubleProtoLoc = null;
        this.privateKeyLoc = null;
        this.optionalParametersLoc = null;
        this.voidPatternLoc = null;
      }
    };
    var Node = class {
      constructor(parser, pos, loc) {
        this.type = "";
        this.start = pos;
        this.end = 0;
        this.loc = new SourceLocation(loc);
        if ((parser == null ? void 0 : parser.optionFlags) & 128) this.range = [pos, 0];
        if (parser != null && parser.filename) this.loc.filename = parser.filename;
      }
    };
    var NodePrototype = Node.prototype;
    NodePrototype.__clone = function() {
      const newNode = new Node(void 0, this.start, this.loc.start);
      const keys = Object.keys(this);
      for (let i = 0, length = keys.length; i < length; i++) {
        const key = keys[i];
        if (key !== "leadingComments" && key !== "trailingComments" && key !== "innerComments") {
          newNode[key] = this[key];
        }
      }
      return newNode;
    };
    var NodeUtils = class extends UtilParser {
      startNode() {
        const loc = this.state.startLoc;
        return new Node(this, loc.index, loc);
      }
      startNodeAt(loc) {
        return new Node(this, loc.index, loc);
      }
      startNodeAtNode(type) {
        return this.startNodeAt(type.loc.start);
      }
      finishNode(node, type) {
        return this.finishNodeAt(node, type, this.state.lastTokEndLoc);
      }
      finishNodeAt(node, type, endLoc) {
        node.type = type;
        node.end = endLoc.index;
        node.loc.end = endLoc;
        if (this.optionFlags & 128) node.range[1] = endLoc.index;
        if (this.optionFlags & 4096) {
          this.processComment(node);
        }
        return node;
      }
      resetStartLocation(node, startLoc) {
        node.start = startLoc.index;
        node.loc.start = startLoc;
        if (this.optionFlags & 128) node.range[0] = startLoc.index;
      }
      resetEndLocation(node, endLoc = this.state.lastTokEndLoc) {
        node.end = endLoc.index;
        node.loc.end = endLoc;
        if (this.optionFlags & 128) node.range[1] = endLoc.index;
      }
      resetStartLocationFromNode(node, locationNode) {
        this.resetStartLocation(node, locationNode.loc.start);
      }
      castNodeTo(node, type) {
        node.type = type;
        return node;
      }
      cloneIdentifier(node) {
        const {
          type,
          start,
          end,
          loc,
          range,
          name
        } = node;
        const cloned = Object.create(NodePrototype);
        cloned.type = type;
        cloned.start = start;
        cloned.end = end;
        cloned.loc = loc;
        cloned.range = range;
        cloned.name = name;
        if (node.extra) cloned.extra = node.extra;
        return cloned;
      }
      cloneStringLiteral(node) {
        const {
          type,
          start,
          end,
          loc,
          range,
          extra
        } = node;
        const cloned = Object.create(NodePrototype);
        cloned.type = type;
        cloned.start = start;
        cloned.end = end;
        cloned.loc = loc;
        cloned.range = range;
        cloned.extra = extra;
        cloned.value = node.value;
        return cloned;
      }
    };
    var unwrapParenthesizedExpression = (node) => {
      return node.type === "ParenthesizedExpression" ? unwrapParenthesizedExpression(node.expression) : node;
    };
    var LValParser = class extends NodeUtils {
      toAssignable(node, isLHS = false) {
        var _node$extra, _node$extra3;
        let parenthesized = void 0;
        if (node.type === "ParenthesizedExpression" || (_node$extra = node.extra) != null && _node$extra.parenthesized) {
          parenthesized = unwrapParenthesizedExpression(node);
          if (isLHS) {
            if (parenthesized.type === "Identifier") {
              this.expressionScope.recordArrowParameterBindingError(Errors.InvalidParenthesizedAssignment, node);
            } else if (parenthesized.type !== "CallExpression" && parenthesized.type !== "MemberExpression" && !this.isOptionalMemberExpression(parenthesized)) {
              this.raise(Errors.InvalidParenthesizedAssignment, node);
            }
          } else {
            this.raise(Errors.InvalidParenthesizedAssignment, node);
          }
        }
        switch (node.type) {
          case "Identifier":
          case "ObjectPattern":
          case "ArrayPattern":
          case "AssignmentPattern":
          case "RestElement":
          case "VoidPattern":
            break;
          case "ObjectExpression":
            this.castNodeTo(node, "ObjectPattern");
            for (let i = 0, length = node.properties.length, last = length - 1; i < length; i++) {
              var _node$extra2;
              const prop = node.properties[i];
              const isLast = i === last;
              this.toAssignableObjectExpressionProp(prop, isLast, isLHS);
              if (isLast && prop.type === "RestElement" && (_node$extra2 = node.extra) != null && _node$extra2.trailingCommaLoc) {
                this.raise(Errors.RestTrailingComma, node.extra.trailingCommaLoc);
              }
            }
            break;
          case "ObjectProperty": {
            const {
              key,
              value: value2
            } = node;
            if (this.isPrivateName(key)) {
              this.classScope.usePrivateName(this.getPrivateNameSV(key), key.loc.start);
            }
            this.toAssignable(value2, isLHS);
            break;
          }
          case "SpreadElement": {
            throw new Error("Internal @babel/parser error (this is a bug, please report it). SpreadElement should be converted by .toAssignable's caller.");
          }
          case "ArrayExpression":
            this.castNodeTo(node, "ArrayPattern");
            this.toAssignableList(node.elements, (_node$extra3 = node.extra) == null ? void 0 : _node$extra3.trailingCommaLoc, isLHS);
            break;
          case "AssignmentExpression":
            if (node.operator !== "=") {
              this.raise(Errors.MissingEqInAssignment, node.left.loc.end);
            }
            this.castNodeTo(node, "AssignmentPattern");
            delete node.operator;
            if (node.left.type === "VoidPattern") {
              this.raise(Errors.VoidPatternInitializer, node.left);
            }
            this.toAssignable(node.left, isLHS);
            break;
          case "ParenthesizedExpression":
            this.toAssignable(parenthesized, isLHS);
            break;
        }
      }
      toAssignableObjectExpressionProp(prop, isLast, isLHS) {
        if (prop.type === "ObjectMethod") {
          this.raise(prop.kind === "get" || prop.kind === "set" ? Errors.PatternHasAccessor : Errors.PatternHasMethod, prop.key);
        } else if (prop.type === "SpreadElement") {
          this.castNodeTo(prop, "RestElement");
          const arg = prop.argument;
          this.checkToRestConversion(arg, false);
          this.toAssignable(arg, isLHS);
          if (!isLast) {
            this.raise(Errors.RestTrailingComma, prop);
          }
        } else {
          this.toAssignable(prop, isLHS);
        }
      }
      toAssignableList(exprList, trailingCommaLoc, isLHS) {
        const end = exprList.length - 1;
        for (let i = 0; i <= end; i++) {
          const elt = exprList[i];
          if (!elt) continue;
          this.toAssignableListItem(exprList, i, isLHS);
          if (elt.type === "RestElement") {
            if (i < end) {
              this.raise(Errors.RestTrailingComma, elt);
            } else if (trailingCommaLoc) {
              this.raise(Errors.RestTrailingComma, trailingCommaLoc);
            }
          }
        }
      }
      toAssignableListItem(exprList, index, isLHS) {
        const node = exprList[index];
        if (node.type === "SpreadElement") {
          this.castNodeTo(node, "RestElement");
          const arg = node.argument;
          this.checkToRestConversion(arg, true);
          this.toAssignable(arg, isLHS);
        } else {
          this.toAssignable(node, isLHS);
        }
      }
      isAssignable(node, isBinding) {
        switch (node.type) {
          case "Identifier":
          case "ObjectPattern":
          case "ArrayPattern":
          case "AssignmentPattern":
          case "RestElement":
          case "VoidPattern":
            return true;
          case "ObjectExpression": {
            const last = node.properties.length - 1;
            return node.properties.every((prop, i) => {
              return prop.type !== "ObjectMethod" && (i === last || prop.type !== "SpreadElement") && this.isAssignable(prop);
            });
          }
          case "ObjectProperty":
            return this.isAssignable(node.value);
          case "SpreadElement":
            return this.isAssignable(node.argument);
          case "ArrayExpression":
            return node.elements.every((element) => element === null || this.isAssignable(element));
          case "AssignmentExpression":
            return node.operator === "=";
          case "ParenthesizedExpression":
            return this.isAssignable(node.expression);
          case "MemberExpression":
          case "OptionalMemberExpression":
            return !isBinding;
          default:
            return false;
        }
      }
      toReferencedList(exprList, isParenthesizedExpr) {
        return exprList;
      }
      toReferencedListDeep(exprList, isParenthesizedExpr) {
        this.toReferencedList(exprList, isParenthesizedExpr);
        for (const expr of exprList) {
          if ((expr == null ? void 0 : expr.type) === "ArrayExpression") {
            this.toReferencedListDeep(expr.elements);
          }
        }
      }
      parseSpread(refExpressionErrors) {
        const node = this.startNode();
        this.next();
        node.argument = this.parseMaybeAssignAllowIn(refExpressionErrors, void 0);
        return this.finishNode(node, "SpreadElement");
      }
      parseRestBinding() {
        const node = this.startNode();
        this.next();
        const argument = this.parseBindingAtom();
        if (argument.type === "VoidPattern") {
          this.raise(Errors.UnexpectedVoidPattern, argument);
        }
        node.argument = argument;
        return this.finishNode(node, "RestElement");
      }
      parseBindingAtom() {
        switch (this.state.type) {
          case 0: {
            const node = this.startNode();
            this.next();
            node.elements = this.parseBindingList(3, 93, 1);
            return this.finishNode(node, "ArrayPattern");
          }
          case 5:
            return this.parseObjectLike(8, true);
          case 88:
            return this.parseVoidPattern(null);
        }
        return this.parseIdentifier();
      }
      parseBindingList(close, closeCharCode, flags) {
        const allowEmpty = flags & 1;
        const elts = [];
        let first = true;
        while (!this.eat(close)) {
          if (first) {
            first = false;
          } else {
            this.expect(12);
          }
          if (allowEmpty && this.match(12)) {
            elts.push(null);
          } else if (this.eat(close)) {
            break;
          } else if (this.match(21)) {
            let rest = this.parseRestBinding();
            if (this.hasPlugin("flow") || flags & 2) {
              rest = this.parseFunctionParamType(rest);
            }
            elts.push(rest);
            if (!this.checkCommaAfterRest(closeCharCode)) {
              this.expect(close);
              break;
            }
          } else {
            const decorators = [];
            if (flags & 2) {
              if (this.match(26) && this.hasPlugin("decorators")) {
                this.raise(Errors.UnsupportedParameterDecorator, this.state.startLoc);
              }
              while (this.match(26)) {
                decorators.push(this.parseDecorator());
              }
            }
            elts.push(this.parseBindingElement(flags, decorators));
          }
        }
        return elts;
      }
      parseBindingRestProperty(prop) {
        this.next();
        if (this.hasPlugin("discardBinding") && this.match(88)) {
          prop.argument = this.parseVoidPattern(null);
          this.raise(Errors.UnexpectedVoidPattern, prop.argument);
        } else {
          prop.argument = this.parseIdentifier();
        }
        this.checkCommaAfterRest(125);
        return this.finishNode(prop, "RestElement");
      }
      parseBindingProperty() {
        const {
          type,
          startLoc
        } = this.state;
        if (type === 21) {
          return this.parseBindingRestProperty(this.startNode());
        }
        const prop = this.startNode();
        if (type === 139) {
          this.expectPlugin("destructuringPrivate", startLoc);
          this.classScope.usePrivateName(this.state.value, startLoc);
          prop.key = this.parsePrivateName();
        } else {
          this.parsePropertyName(prop);
        }
        prop.method = false;
        return this.parseObjPropValue(prop, startLoc, false, false, true, false);
      }
      parseBindingElement(flags, decorators) {
        const left = this.parseMaybeDefault();
        if (this.hasPlugin("flow") || flags & 2) {
          this.parseFunctionParamType(left);
        }
        if (decorators.length) {
          left.decorators = decorators;
          this.resetStartLocationFromNode(left, decorators[0]);
        }
        const elt = this.parseMaybeDefault(left.loc.start, left);
        return elt;
      }
      parseFunctionParamType(param) {
        return param;
      }
      parseMaybeDefault(startLoc, left) {
        startLoc != null ? startLoc : startLoc = this.state.startLoc;
        left = left != null ? left : this.parseBindingAtom();
        if (!this.eat(29)) return left;
        const node = this.startNodeAt(startLoc);
        if (left.type === "VoidPattern") {
          this.raise(Errors.VoidPatternInitializer, left);
        }
        node.left = left;
        node.right = this.parseMaybeAssignAllowIn();
        return this.finishNode(node, "AssignmentPattern");
      }
      isValidLVal(type, disallowCallExpression, isUnparenthesizedInAssign, binding) {
        switch (type) {
          case "AssignmentPattern":
            return "left";
          case "RestElement":
            return "argument";
          case "ObjectProperty":
            return "value";
          case "ParenthesizedExpression":
            return "expression";
          case "ArrayPattern":
            return "elements";
          case "ObjectPattern":
            return "properties";
          case "VoidPattern":
            return true;
          case "CallExpression":
            if (!disallowCallExpression && !this.state.strict && this.optionFlags & 8192) {
              return true;
            }
        }
        return false;
      }
      isOptionalMemberExpression(expression) {
        return expression.type === "OptionalMemberExpression";
      }
      checkLVal(expression, ancestor, binding = 64, checkClashes = false, strictModeChanged = false, hasParenthesizedAncestor = false, disallowCallExpression = false) {
        var _expression$extra;
        const type = expression.type;
        if (this.isObjectMethod(expression)) return;
        const isOptionalMemberExpression = this.isOptionalMemberExpression(expression);
        if (isOptionalMemberExpression || type === "MemberExpression") {
          if (isOptionalMemberExpression) {
            this.expectPlugin("optionalChainingAssign", expression.loc.start);
            if (ancestor.type !== "AssignmentExpression") {
              this.raise(Errors.InvalidLhsOptionalChaining, expression, {
                ancestor
              });
            }
          }
          if (binding !== 64) {
            this.raise(Errors.InvalidPropertyBindingPattern, expression);
          }
          return;
        }
        if (type === "Identifier") {
          this.checkIdentifier(expression, binding, strictModeChanged);
          const {
            name
          } = expression;
          if (checkClashes) {
            if (checkClashes.has(name)) {
              this.raise(Errors.ParamDupe, expression);
            } else {
              checkClashes.add(name);
            }
          }
          return;
        } else if (type === "VoidPattern" && ancestor.type === "CatchClause") {
          this.raise(Errors.VoidPatternCatchClauseParam, expression);
        }
        const unwrappedExpression = unwrapParenthesizedExpression(expression);
        disallowCallExpression || (disallowCallExpression = unwrappedExpression.type === "CallExpression" && (unwrappedExpression.callee.type === "Import" || unwrappedExpression.callee.type === "Super"));
        const validity = this.isValidLVal(type, disallowCallExpression, !(hasParenthesizedAncestor || (_expression$extra = expression.extra) != null && _expression$extra.parenthesized) && ancestor.type === "AssignmentExpression", binding);
        if (validity === true) return;
        if (validity === false) {
          const ParseErrorClass = binding === 64 ? Errors.InvalidLhs : Errors.InvalidLhsBinding;
          this.raise(ParseErrorClass, expression, {
            ancestor
          });
          return;
        }
        let key, isParenthesizedExpression;
        if (typeof validity === "string") {
          key = validity;
          isParenthesizedExpression = type === "ParenthesizedExpression";
        } else {
          [key, isParenthesizedExpression] = validity;
        }
        const nextAncestor = type === "ArrayPattern" || type === "ObjectPattern" ? {
          type
        } : ancestor;
        const val = expression[key];
        if (Array.isArray(val)) {
          for (const child of val) {
            if (child) {
              this.checkLVal(child, nextAncestor, binding, checkClashes, strictModeChanged, isParenthesizedExpression, true);
            }
          }
        } else if (val) {
          this.checkLVal(val, nextAncestor, binding, checkClashes, strictModeChanged, isParenthesizedExpression, disallowCallExpression);
        }
      }
      checkIdentifier(at, bindingType, strictModeChanged = false) {
        if (this.state.strict && (strictModeChanged ? isStrictBindReservedWord(at.name, this.inModule) : isStrictBindOnlyReservedWord(at.name))) {
          if (bindingType === 64) {
            this.raise(Errors.StrictEvalArguments, at, {
              referenceName: at.name
            });
          } else {
            this.raise(Errors.StrictEvalArgumentsBinding, at, {
              bindingName: at.name
            });
          }
        }
        if (bindingType & 8192 && at.name === "let") {
          this.raise(Errors.LetInLexicalBinding, at);
        }
        if (!(bindingType & 64)) {
          this.declareNameFromIdentifier(at, bindingType);
        }
      }
      declareNameFromIdentifier(identifier, binding) {
        this.scope.declareName(identifier.name, binding, identifier.loc.start);
      }
      checkToRestConversion(node, allowPattern) {
        switch (node.type) {
          case "ParenthesizedExpression":
            this.checkToRestConversion(node.expression, allowPattern);
            break;
          case "Identifier":
          case "MemberExpression":
            break;
          case "ArrayExpression":
          case "ObjectExpression":
            if (allowPattern) break;
          default:
            this.raise(Errors.InvalidRestAssignmentPattern, node);
        }
      }
      checkCommaAfterRest(close) {
        if (!this.match(12)) {
          return false;
        }
        this.raise(this.lookaheadCharCode() === close ? Errors.RestTrailingComma : Errors.ElementAfterRest, this.state.startLoc);
        return true;
      }
    };
    var keywordAndTSRelationalOperator = /in(?:stanceof)?|as|satisfies/y;
    function nonNull(x) {
      if (x == null) {
        throw new Error(`Unexpected ${x} value.`);
      }
      return x;
    }
    function assert(x) {
      if (!x) {
        throw new Error("Assert fail");
      }
    }
    var TSErrors = ParseErrorEnum`typescript`({
      AbstractMethodHasImplementation: ({
        methodName
      }) => `Method '${methodName}' cannot have an implementation because it is marked abstract.`,
      AbstractPropertyHasInitializer: ({
        propertyName
      }) => `Property '${propertyName}' cannot have an initializer because it is marked abstract.`,
      AccessorCannotBeOptional: "An 'accessor' property cannot be declared optional.",
      AccessorCannotDeclareThisParameter: "'get' and 'set' accessors cannot declare 'this' parameters.",
      AccessorCannotHaveTypeParameters: "An accessor cannot have type parameters.",
      ClassMethodHasDeclare: "Class methods cannot have the 'declare' modifier.",
      ClassMethodHasReadonly: "Class methods cannot have the 'readonly' modifier.",
      ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference: "A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference.",
      ConstructorHasTypeParameters: "Type parameters cannot appear on a constructor declaration.",
      DeclareAccessor: ({
        kind
      }) => `'declare' is not allowed in ${kind}ters.`,
      DeclareClassFieldHasInitializer: "Initializers are not allowed in ambient contexts.",
      DeclareFunctionHasImplementation: "An implementation cannot be declared in ambient contexts.",
      DuplicateAccessibilityModifier: ({
        modifier
      }) => `Accessibility modifier already seen: '${modifier}'.`,
      DuplicateModifier: ({
        modifier
      }) => `Duplicate modifier: '${modifier}'.`,
      EmptyHeritageClauseType: ({
        token
      }) => `'${token}' list cannot be empty.`,
      EmptyTypeArguments: "Type argument list cannot be empty.",
      EmptyTypeParameters: "Type parameter list cannot be empty.",
      ExpectedAmbientAfterExportDeclare: "'export declare' must be followed by an ambient declaration.",
      ImportAliasHasImportType: "An import alias can not use 'import type'.",
      ImportReflectionHasImportType: "An `import module` declaration can not use `type` modifier",
      IncompatibleModifiers: ({
        modifiers
      }) => `'${modifiers[0]}' modifier cannot be used with '${modifiers[1]}' modifier.`,
      IndexSignatureHasAbstract: "Index signatures cannot have the 'abstract' modifier.",
      IndexSignatureHasAccessibility: ({
        modifier
      }) => `Index signatures cannot have an accessibility modifier ('${modifier}').`,
      IndexSignatureHasDeclare: "Index signatures cannot have the 'declare' modifier.",
      IndexSignatureHasOverride: "'override' modifier cannot appear on an index signature.",
      IndexSignatureHasStatic: "Index signatures cannot have the 'static' modifier.",
      InitializerNotAllowedInAmbientContext: "Initializers are not allowed in ambient contexts.",
      InvalidHeritageClauseType: ({
        token
      }) => `'${token}' list can only include identifiers or qualified-names with optional type arguments.`,
      InvalidModifierOnAwaitUsingDeclaration: (modifier) => `'${modifier}' modifier cannot appear on an await using declaration.`,
      InvalidModifierOnTypeMember: ({
        modifier
      }) => `'${modifier}' modifier cannot appear on a type member.`,
      InvalidModifierOnTypeParameter: ({
        modifier
      }) => `'${modifier}' modifier cannot appear on a type parameter.`,
      InvalidModifierOnTypeParameterPositions: ({
        modifier
      }) => `'${modifier}' modifier can only appear on a type parameter of a class, interface or type alias.`,
      InvalidModifierOnUsingDeclaration: (modifier) => `'${modifier}' modifier cannot appear on a using declaration.`,
      InvalidModifiersOrder: ({
        orderedModifiers
      }) => `'${orderedModifiers[0]}' modifier must precede '${orderedModifiers[1]}' modifier.`,
      InvalidPropertyAccessAfterInstantiationExpression: "Invalid property access after an instantiation expression. You can either wrap the instantiation expression in parentheses, or delete the type arguments.",
      InvalidTupleMemberLabel: "Tuple members must be labeled with a simple identifier.",
      MissingInterfaceName: "'interface' declarations must be followed by an identifier.",
      NonAbstractClassHasAbstractMethod: "Abstract methods can only appear within an abstract class.",
      NonClassMethodPropertyHasAbstractModifier: "'abstract' modifier can only appear on a class, method, or property declaration.",
      OptionalTypeBeforeRequired: "A required element cannot follow an optional element.",
      OverrideNotInSubClass: "This member cannot have an 'override' modifier because its containing class does not extend another class.",
      PatternIsOptional: "A binding pattern parameter cannot be optional in an implementation signature.",
      PrivateElementHasAbstract: "Private elements cannot have the 'abstract' modifier.",
      PrivateElementHasAccessibility: ({
        modifier
      }) => `Private elements cannot have an accessibility modifier ('${modifier}').`,
      ReadonlyForMethodSignature: "'readonly' modifier can only appear on a property declaration or index signature.",
      ReservedArrowTypeParam: "This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma, as in `<T,>() => ...`.",
      ReservedTypeAssertion: "This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead.",
      SetAccessorCannotHaveOptionalParameter: "A 'set' accessor cannot have an optional parameter.",
      SetAccessorCannotHaveRestParameter: "A 'set' accessor cannot have rest parameter.",
      SetAccessorCannotHaveReturnType: "A 'set' accessor cannot have a return type annotation.",
      SingleTypeParameterWithoutTrailingComma: ({
        typeParameterName
      }) => `Single type parameter ${typeParameterName} should have a trailing comma. Example usage: <${typeParameterName},>.`,
      StaticBlockCannotHaveModifier: "Static class blocks cannot have any modifier.",
      TupleOptionalAfterType: "A labeled tuple optional element must be declared using a question mark after the name and before the colon (`name?: type`), rather than after the type (`name: type?`).",
      TypeAnnotationAfterAssign: "Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.",
      TypeImportCannotSpecifyDefaultAndNamed: "A type-only import can specify a default import or named bindings, but not both.",
      TypeModifierIsUsedInTypeExports: "The 'type' modifier cannot be used on a named export when 'export type' is used on its export statement.",
      TypeModifierIsUsedInTypeImports: "The 'type' modifier cannot be used on a named import when 'import type' is used on its import statement.",
      UnexpectedParameterModifier: "A parameter property is only allowed in a constructor implementation.",
      UnexpectedReadonly: "'readonly' type modifier is only permitted on array and tuple literal types.",
      UnexpectedTypeAnnotation: "Did not expect a type annotation here.",
      UnexpectedTypeCastInParameter: "Unexpected type cast in parameter position.",
      UnsupportedImportTypeArgument: "Argument in a type import must be a string literal.",
      UnsupportedParameterPropertyKind: "A parameter property may not be declared using a binding pattern.",
      UnsupportedSignatureParameterKind: ({
        type
      }) => `Name in a signature must be an Identifier, ObjectPattern or ArrayPattern, instead got ${type}.`,
      UsingDeclarationInAmbientContext: (kind) => `'${kind}' declarations are not allowed in ambient contexts.`
    });
    function keywordTypeFromName(value2) {
      switch (value2) {
        case "any":
          return "TSAnyKeyword";
        case "boolean":
          return "TSBooleanKeyword";
        case "bigint":
          return "TSBigIntKeyword";
        case "never":
          return "TSNeverKeyword";
        case "number":
          return "TSNumberKeyword";
        case "object":
          return "TSObjectKeyword";
        case "string":
          return "TSStringKeyword";
        case "symbol":
          return "TSSymbolKeyword";
        case "undefined":
          return "TSUndefinedKeyword";
        case "unknown":
          return "TSUnknownKeyword";
        default:
          return void 0;
      }
    }
    function tsIsAccessModifier(modifier) {
      return modifier === "private" || modifier === "public" || modifier === "protected";
    }
    function tsIsVarianceAnnotations(modifier) {
      return modifier === "in" || modifier === "out";
    }
    var typescript = (superClass) => class TypeScriptParserMixin extends superClass {
      constructor(...args) {
        super(...args);
        this.tsParseInOutModifiers = this.tsParseModifiers.bind(this, {
          allowedModifiers: ["in", "out"],
          disallowedModifiers: ["const", "public", "private", "protected", "readonly", "declare", "abstract", "override"],
          errorTemplate: TSErrors.InvalidModifierOnTypeParameter
        });
        this.tsParseConstModifier = this.tsParseModifiers.bind(this, {
          allowedModifiers: ["const"],
          disallowedModifiers: ["in", "out"],
          errorTemplate: TSErrors.InvalidModifierOnTypeParameterPositions
        });
        this.tsParseInOutConstModifiers = this.tsParseModifiers.bind(this, {
          allowedModifiers: ["in", "out", "const"],
          disallowedModifiers: ["public", "private", "protected", "readonly", "declare", "abstract", "override"],
          errorTemplate: TSErrors.InvalidModifierOnTypeParameter
        });
      }
      getScopeHandler() {
        return TypeScriptScopeHandler;
      }
      tsIsIdentifier() {
        return tokenIsIdentifier(this.state.type);
      }
      tsTokenCanFollowModifier() {
        return this.match(0) || this.match(5) || this.match(55) || this.match(21) || this.match(139) || this.isLiteralPropertyName();
      }
      tsNextTokenOnSameLineAndCanFollowModifier() {
        this.next();
        if (this.hasPrecedingLineBreak()) {
          return false;
        }
        return this.tsTokenCanFollowModifier();
      }
      tsNextTokenCanFollowModifier() {
        if (this.match(106)) {
          this.next();
          return this.tsTokenCanFollowModifier();
        }
        return this.tsNextTokenOnSameLineAndCanFollowModifier();
      }
      tsParseModifier(allowedModifiers, stopOnStartOfClassStaticBlock, hasSeenStaticModifier) {
        if (!tokenIsIdentifier(this.state.type) && this.state.type !== 58 && this.state.type !== 75) {
          return void 0;
        }
        const modifier = this.state.value;
        if (allowedModifiers.includes(modifier)) {
          if (hasSeenStaticModifier && this.match(106)) {
            return void 0;
          }
          if (stopOnStartOfClassStaticBlock && this.tsIsStartOfStaticBlocks()) {
            return void 0;
          }
          if (this.tsTryParse(this.tsNextTokenCanFollowModifier.bind(this))) {
            return modifier;
          }
        }
        return void 0;
      }
      tsParseModifiers({
        allowedModifiers,
        disallowedModifiers,
        stopOnStartOfClassStaticBlock,
        errorTemplate = TSErrors.InvalidModifierOnTypeMember
      }, modified) {
        const enforceOrder = (loc, modifier, before, after) => {
          if (modifier === before && modified[after]) {
            this.raise(TSErrors.InvalidModifiersOrder, loc, {
              orderedModifiers: [before, after]
            });
          }
        };
        const incompatible = (loc, modifier, mod1, mod2) => {
          if (modified[mod1] && modifier === mod2 || modified[mod2] && modifier === mod1) {
            this.raise(TSErrors.IncompatibleModifiers, loc, {
              modifiers: [mod1, mod2]
            });
          }
        };
        for (; ; ) {
          const {
            startLoc
          } = this.state;
          const modifier = this.tsParseModifier(allowedModifiers.concat(disallowedModifiers != null ? disallowedModifiers : []), stopOnStartOfClassStaticBlock, modified.static);
          if (!modifier) break;
          if (tsIsAccessModifier(modifier)) {
            if (modified.accessibility) {
              this.raise(TSErrors.DuplicateAccessibilityModifier, startLoc, {
                modifier
              });
            } else {
              enforceOrder(startLoc, modifier, modifier, "override");
              enforceOrder(startLoc, modifier, modifier, "static");
              enforceOrder(startLoc, modifier, modifier, "readonly");
              modified.accessibility = modifier;
            }
          } else if (tsIsVarianceAnnotations(modifier)) {
            if (modified[modifier]) {
              this.raise(TSErrors.DuplicateModifier, startLoc, {
                modifier
              });
            }
            modified[modifier] = true;
            enforceOrder(startLoc, modifier, "in", "out");
          } else {
            if (hasOwnProperty.call(modified, modifier)) {
              this.raise(TSErrors.DuplicateModifier, startLoc, {
                modifier
              });
            } else {
              enforceOrder(startLoc, modifier, "static", "readonly");
              enforceOrder(startLoc, modifier, "static", "override");
              enforceOrder(startLoc, modifier, "override", "readonly");
              enforceOrder(startLoc, modifier, "abstract", "override");
              incompatible(startLoc, modifier, "declare", "override");
              incompatible(startLoc, modifier, "static", "abstract");
            }
            modified[modifier] = true;
          }
          if (disallowedModifiers != null && disallowedModifiers.includes(modifier)) {
            this.raise(errorTemplate, startLoc, {
              modifier
            });
          }
        }
      }
      tsIsListTerminator(kind) {
        switch (kind) {
          case "EnumMembers":
          case "TypeMembers":
            return this.match(8);
          case "HeritageClauseElement":
            return this.match(5);
          case "TupleElementTypes":
            return this.match(3);
          case "TypeParametersOrArguments":
            return this.match(48);
        }
      }
      tsParseList(kind, parseElement) {
        const result = [];
        while (!this.tsIsListTerminator(kind)) {
          result.push(parseElement());
        }
        return result;
      }
      tsParseDelimitedList(kind, parseElement, refTrailingCommaPos) {
        return nonNull(this.tsParseDelimitedListWorker(kind, parseElement, true, refTrailingCommaPos));
      }
      tsParseDelimitedListWorker(kind, parseElement, expectSuccess, refTrailingCommaPos) {
        const result = [];
        let trailingCommaPos = -1;
        for (; ; ) {
          if (this.tsIsListTerminator(kind)) {
            break;
          }
          trailingCommaPos = -1;
          const element = parseElement();
          if (element == null) {
            return void 0;
          }
          result.push(element);
          if (this.eat(12)) {
            trailingCommaPos = this.state.lastTokStartLoc.index;
            continue;
          }
          if (this.tsIsListTerminator(kind)) {
            break;
          }
          if (expectSuccess) {
            this.expect(12);
          }
          return void 0;
        }
        if (refTrailingCommaPos) {
          refTrailingCommaPos.value = trailingCommaPos;
        }
        return result;
      }
      tsParseBracketedList(kind, parseElement, bracket, skipFirstToken, refTrailingCommaPos) {
        if (!skipFirstToken) {
          if (bracket) {
            this.expect(0);
          } else {
            this.expect(47);
          }
        }
        const result = this.tsParseDelimitedList(kind, parseElement, refTrailingCommaPos);
        if (bracket) {
          this.expect(3);
        } else {
          this.expect(48);
        }
        return result;
      }
      tsParseImportType() {
        const node = this.startNode();
        this.expect(83);
        this.expect(10);
        if (!this.match(134)) {
          this.raise(TSErrors.UnsupportedImportTypeArgument, this.state.startLoc);
          node.argument = super.parseExprAtom();
        } else {
          node.argument = this.parseStringLiteral(this.state.value);
        }
        if (this.eat(12)) {
          node.options = this.tsParseImportTypeOptions();
        } else {
          node.options = null;
        }
        this.expect(11);
        if (this.eat(16)) {
          node.qualifier = this.tsParseEntityName(1 | 2);
        }
        if (this.match(47)) {
          node.typeParameters = this.tsParseTypeArguments();
        }
        return this.finishNode(node, "TSImportType");
      }
      tsParseImportTypeOptions() {
        const node = this.startNode();
        this.expect(5);
        const withProperty = this.startNode();
        if (this.isContextual(76)) {
          withProperty.method = false;
          withProperty.key = this.parseIdentifier(true);
          withProperty.computed = false;
          withProperty.shorthand = false;
        } else {
          this.unexpected(null, 76);
        }
        this.expect(14);
        withProperty.value = this.tsParseImportTypeWithPropertyValue();
        node.properties = [this.finishObjectProperty(withProperty)];
        this.eat(12);
        this.expect(8);
        return this.finishNode(node, "ObjectExpression");
      }
      tsParseImportTypeWithPropertyValue() {
        const node = this.startNode();
        const properties = [];
        this.expect(5);
        while (!this.match(8)) {
          const type = this.state.type;
          if (tokenIsIdentifier(type) || type === 134) {
            properties.push(super.parsePropertyDefinition(null));
          } else {
            this.unexpected();
          }
          this.eat(12);
        }
        node.properties = properties;
        this.next();
        return this.finishNode(node, "ObjectExpression");
      }
      tsParseEntityName(flags) {
        let entity;
        if (flags & 1 && this.match(78)) {
          if (flags & 2) {
            entity = this.parseIdentifier(true);
          } else {
            const node = this.startNode();
            this.next();
            entity = this.finishNode(node, "ThisExpression");
          }
        } else {
          entity = this.parseIdentifier(!!(flags & 1));
        }
        while (this.eat(16)) {
          const node = this.startNodeAtNode(entity);
          node.left = entity;
          node.right = this.parseIdentifier(!!(flags & 1));
          entity = this.finishNode(node, "TSQualifiedName");
        }
        return entity;
      }
      tsParseTypeReference() {
        const node = this.startNode();
        node.typeName = this.tsParseEntityName(1);
        if (!this.hasPrecedingLineBreak() && this.match(47)) {
          node.typeParameters = this.tsParseTypeArguments();
        }
        return this.finishNode(node, "TSTypeReference");
      }
      tsParseThisTypePredicate(lhs) {
        this.next();
        const node = this.startNodeAtNode(lhs);
        node.parameterName = lhs;
        node.typeAnnotation = this.tsParseTypeAnnotation(false);
        node.asserts = false;
        return this.finishNode(node, "TSTypePredicate");
      }
      tsParseThisTypeNode() {
        const node = this.startNode();
        this.next();
        return this.finishNode(node, "TSThisType");
      }
      tsParseTypeQuery() {
        const node = this.startNode();
        this.expect(87);
        if (this.match(83)) {
          node.exprName = this.tsParseImportType();
        } else {
          node.exprName = this.tsParseEntityName(1 | 2);
        }
        if (!this.hasPrecedingLineBreak() && this.match(47)) {
          node.typeParameters = this.tsParseTypeArguments();
        }
        return this.finishNode(node, "TSTypeQuery");
      }
      tsParseTypeParameter(parseModifiers) {
        const node = this.startNode();
        parseModifiers(node);
        node.name = this.tsParseTypeParameterName();
        node.constraint = this.tsEatThenParseType(81);
        node.default = this.tsEatThenParseType(29);
        return this.finishNode(node, "TSTypeParameter");
      }
      tsTryParseTypeParameters(parseModifiers) {
        if (this.match(47)) {
          return this.tsParseTypeParameters(parseModifiers);
        }
      }
      tsParseTypeParameters(parseModifiers) {
        const node = this.startNode();
        if (this.match(47) || this.match(143)) {
          this.next();
        } else {
          this.unexpected();
        }
        const refTrailingCommaPos = {
          value: -1
        };
        node.params = this.tsParseBracketedList("TypeParametersOrArguments", this.tsParseTypeParameter.bind(this, parseModifiers), false, true, refTrailingCommaPos);
        if (node.params.length === 0) {
          this.raise(TSErrors.EmptyTypeParameters, node);
        }
        if (refTrailingCommaPos.value !== -1) {
          this.addExtra(node, "trailingComma", refTrailingCommaPos.value);
        }
        return this.finishNode(node, "TSTypeParameterDeclaration");
      }
      tsFillSignature(returnToken, signature) {
        const returnTokenRequired = returnToken === 19;
        const paramsKey = "parameters";
        const returnTypeKey = "typeAnnotation";
        signature.typeParameters = this.tsTryParseTypeParameters(this.tsParseConstModifier);
        this.expect(10);
        signature[paramsKey] = this.tsParseBindingListForSignature();
        if (returnTokenRequired) {
          signature[returnTypeKey] = this.tsParseTypeOrTypePredicateAnnotation(returnToken);
        } else if (this.match(returnToken)) {
          signature[returnTypeKey] = this.tsParseTypeOrTypePredicateAnnotation(returnToken);
        }
      }
      tsParseBindingListForSignature() {
        const list = super.parseBindingList(11, 41, 2);
        for (const pattern of list) {
          const {
            type
          } = pattern;
          if (type === "AssignmentPattern" || type === "TSParameterProperty") {
            this.raise(TSErrors.UnsupportedSignatureParameterKind, pattern, {
              type
            });
          }
        }
        return list;
      }
      tsParseTypeMemberSemicolon() {
        if (!this.eat(12) && !this.isLineTerminator()) {
          this.expect(13);
        }
      }
      tsParseSignatureMember(kind, node) {
        this.tsFillSignature(14, node);
        this.tsParseTypeMemberSemicolon();
        return this.finishNode(node, kind);
      }
      tsIsUnambiguouslyIndexSignature() {
        this.next();
        if (tokenIsIdentifier(this.state.type)) {
          this.next();
          return this.match(14);
        }
        return false;
      }
      tsTryParseIndexSignature(node) {
        if (!(this.match(0) && this.tsLookAhead(this.tsIsUnambiguouslyIndexSignature.bind(this)))) {
          return;
        }
        this.expect(0);
        const id = this.parseIdentifier();
        id.typeAnnotation = this.tsParseTypeAnnotation();
        this.resetEndLocation(id);
        this.expect(3);
        node.parameters = [id];
        const type = this.tsTryParseTypeAnnotation();
        if (type) node.typeAnnotation = type;
        this.tsParseTypeMemberSemicolon();
        return this.finishNode(node, "TSIndexSignature");
      }
      tsParsePropertyOrMethodSignature(node, readonly) {
        if (this.eat(17)) node.optional = true;
        if (this.match(10) || this.match(47)) {
          if (readonly) {
            this.raise(TSErrors.ReadonlyForMethodSignature, node);
          }
          const method = node;
          if (method.kind && this.match(47)) {
            this.raise(TSErrors.AccessorCannotHaveTypeParameters, this.state.curPosition());
          }
          this.tsFillSignature(14, method);
          this.tsParseTypeMemberSemicolon();
          const paramsKey = "parameters";
          const returnTypeKey = "typeAnnotation";
          if (method.kind === "get") {
            if (method[paramsKey].length > 0) {
              this.raise(Errors.BadGetterArity, this.state.curPosition());
              if (this.isThisParam(method[paramsKey][0])) {
                this.raise(TSErrors.AccessorCannotDeclareThisParameter, this.state.curPosition());
              }
            }
          } else if (method.kind === "set") {
            if (method[paramsKey].length !== 1) {
              this.raise(Errors.BadSetterArity, this.state.curPosition());
            } else {
              const firstParameter = method[paramsKey][0];
              if (this.isThisParam(firstParameter)) {
                this.raise(TSErrors.AccessorCannotDeclareThisParameter, this.state.curPosition());
              }
              if (firstParameter.type === "Identifier" && firstParameter.optional) {
                this.raise(TSErrors.SetAccessorCannotHaveOptionalParameter, this.state.curPosition());
              }
              if (firstParameter.type === "RestElement") {
                this.raise(TSErrors.SetAccessorCannotHaveRestParameter, this.state.curPosition());
              }
            }
            if (method[returnTypeKey]) {
              this.raise(TSErrors.SetAccessorCannotHaveReturnType, method[returnTypeKey]);
            }
          } else {
            method.kind = "method";
          }
          return this.finishNode(method, "TSMethodSignature");
        } else {
          const property = node;
          if (readonly) property.readonly = true;
          const type = this.tsTryParseTypeAnnotation();
          if (type) property.typeAnnotation = type;
          this.tsParseTypeMemberSemicolon();
          return this.finishNode(property, "TSPropertySignature");
        }
      }
      tsParseTypeMember() {
        const node = this.startNode();
        if (this.match(10) || this.match(47)) {
          return this.tsParseSignatureMember("TSCallSignatureDeclaration", node);
        }
        if (this.match(77)) {
          const id = this.startNode();
          this.next();
          if (this.match(10) || this.match(47)) {
            return this.tsParseSignatureMember("TSConstructSignatureDeclaration", node);
          } else {
            node.key = this.createIdentifier(id, "new");
            return this.tsParsePropertyOrMethodSignature(node, false);
          }
        }
        this.tsParseModifiers({
          allowedModifiers: ["readonly"],
          disallowedModifiers: ["declare", "abstract", "private", "protected", "public", "static", "override"]
        }, node);
        const idx = this.tsTryParseIndexSignature(node);
        if (idx) {
          return idx;
        }
        super.parsePropertyName(node);
        if (!node.computed && node.key.type === "Identifier" && (node.key.name === "get" || node.key.name === "set") && this.tsTokenCanFollowModifier()) {
          node.kind = node.key.name;
          super.parsePropertyName(node);
          if (!this.match(10) && !this.match(47)) {
            this.unexpected(null, 10);
          }
        }
        return this.tsParsePropertyOrMethodSignature(node, !!node.readonly);
      }
      tsParseTypeLiteral() {
        const node = this.startNode();
        node.members = this.tsParseObjectTypeMembers();
        return this.finishNode(node, "TSTypeLiteral");
      }
      tsParseObjectTypeMembers() {
        this.expect(5);
        const members = this.tsParseList("TypeMembers", this.tsParseTypeMember.bind(this));
        this.expect(8);
        return members;
      }
      tsIsStartOfMappedType() {
        this.next();
        if (this.eat(53)) {
          return this.isContextual(122);
        }
        if (this.isContextual(122)) {
          this.next();
        }
        if (!this.match(0)) {
          return false;
        }
        this.next();
        if (!this.tsIsIdentifier()) {
          return false;
        }
        this.next();
        return this.match(58);
      }
      tsParseMappedType() {
        const node = this.startNode();
        this.expect(5);
        if (this.match(53)) {
          node.readonly = this.state.value;
          this.next();
          this.expectContextual(122);
        } else if (this.eatContextual(122)) {
          node.readonly = true;
        }
        this.expect(0);
        const typeParameter = this.startNode();
        typeParameter.name = this.tsParseTypeParameterName();
        typeParameter.constraint = this.tsExpectThenParseType(58);
        node.typeParameter = this.finishNode(typeParameter, "TSTypeParameter");
        node.nameType = this.eatContextual(93) ? this.tsParseType() : null;
        this.expect(3);
        if (this.match(53)) {
          node.optional = this.state.value;
          this.next();
          this.expect(17);
        } else if (this.eat(17)) {
          node.optional = true;
        }
        node.typeAnnotation = this.tsTryParseType();
        this.semicolon();
        this.expect(8);
        return this.finishNode(node, "TSMappedType");
      }
      tsParseTupleType() {
        const node = this.startNode();
        node.elementTypes = this.tsParseBracketedList("TupleElementTypes", this.tsParseTupleElementType.bind(this), true, false);
        let seenOptionalElement = false;
        node.elementTypes.forEach((elementNode) => {
          const {
            type
          } = elementNode;
          if (seenOptionalElement && type !== "TSRestType" && type !== "TSOptionalType" && !(type === "TSNamedTupleMember" && elementNode.optional)) {
            this.raise(TSErrors.OptionalTypeBeforeRequired, elementNode);
          }
          seenOptionalElement || (seenOptionalElement = type === "TSNamedTupleMember" && elementNode.optional || type === "TSOptionalType");
        });
        return this.finishNode(node, "TSTupleType");
      }
      tsParseTupleElementType() {
        const restStartLoc = this.state.startLoc;
        const rest = this.eat(21);
        const {
          startLoc
        } = this.state;
        let labeled;
        let label;
        let optional;
        let type;
        const isWord = tokenIsKeywordOrIdentifier(this.state.type);
        const chAfterWord = isWord ? this.lookaheadCharCode() : null;
        if (chAfterWord === 58) {
          labeled = true;
          optional = false;
          label = this.parseIdentifier(true);
          this.expect(14);
          type = this.tsParseType();
        } else if (chAfterWord === 63) {
          optional = true;
          const wordName = this.state.value;
          const typeOrLabel = this.tsParseNonArrayType();
          if (this.lookaheadCharCode() === 58) {
            labeled = true;
            label = this.createIdentifier(this.startNodeAt(startLoc), wordName);
            this.expect(17);
            this.expect(14);
            type = this.tsParseType();
          } else {
            labeled = false;
            type = typeOrLabel;
            this.expect(17);
          }
        } else {
          type = this.tsParseType();
          optional = this.eat(17);
          labeled = this.eat(14);
        }
        if (labeled) {
          let labeledNode;
          if (label) {
            labeledNode = this.startNodeAt(startLoc);
            labeledNode.optional = optional;
            labeledNode.label = label;
            labeledNode.elementType = type;
            if (this.eat(17)) {
              labeledNode.optional = true;
              this.raise(TSErrors.TupleOptionalAfterType, this.state.lastTokStartLoc);
            }
          } else {
            labeledNode = this.startNodeAt(startLoc);
            labeledNode.optional = optional;
            this.raise(TSErrors.InvalidTupleMemberLabel, type);
            labeledNode.label = type;
            labeledNode.elementType = this.tsParseType();
          }
          type = this.finishNode(labeledNode, "TSNamedTupleMember");
        } else if (optional) {
          const optionalTypeNode = this.startNodeAt(startLoc);
          optionalTypeNode.typeAnnotation = type;
          type = this.finishNode(optionalTypeNode, "TSOptionalType");
        }
        if (rest) {
          const restNode = this.startNodeAt(restStartLoc);
          restNode.typeAnnotation = type;
          type = this.finishNode(restNode, "TSRestType");
        }
        return type;
      }
      tsParseParenthesizedType() {
        const node = this.startNode();
        this.expect(10);
        node.typeAnnotation = this.tsParseType();
        this.expect(11);
        return this.finishNode(node, "TSParenthesizedType");
      }
      tsParseFunctionOrConstructorType(type, abstract) {
        const node = this.startNode();
        if (type === "TSConstructorType") {
          node.abstract = !!abstract;
          if (abstract) this.next();
          this.next();
        }
        this.tsInAllowConditionalTypesContext(() => this.tsFillSignature(19, node));
        return this.finishNode(node, type);
      }
      tsParseLiteralTypeNode() {
        const node = this.startNode();
        switch (this.state.type) {
          case 135:
          case 136:
          case 134:
          case 85:
          case 86:
            node.literal = super.parseExprAtom();
            break;
          default:
            this.unexpected();
        }
        return this.finishNode(node, "TSLiteralType");
      }
      tsParseTemplateLiteralType() {
        const node = this.startNode();
        node.literal = super.parseTemplate(false);
        return this.finishNode(node, "TSLiteralType");
      }
      parseTemplateSubstitution() {
        if (this.state.inType) return this.tsParseType();
        return super.parseTemplateSubstitution();
      }
      tsParseThisTypeOrThisTypePredicate() {
        const thisKeyword = this.tsParseThisTypeNode();
        if (this.isContextual(116) && !this.hasPrecedingLineBreak()) {
          return this.tsParseThisTypePredicate(thisKeyword);
        } else {
          return thisKeyword;
        }
      }
      tsParseNonArrayType() {
        switch (this.state.type) {
          case 134:
          case 135:
          case 136:
          case 85:
          case 86:
            return this.tsParseLiteralTypeNode();
          case 53:
            if (this.state.value === "-") {
              const node = this.startNode();
              const nextToken = this.lookahead();
              if (nextToken.type !== 135 && nextToken.type !== 136) {
                this.unexpected();
              }
              node.literal = this.parseMaybeUnary();
              return this.finishNode(node, "TSLiteralType");
            }
            break;
          case 78:
            return this.tsParseThisTypeOrThisTypePredicate();
          case 87:
            return this.tsParseTypeQuery();
          case 83:
            return this.tsParseImportType();
          case 5:
            return this.tsLookAhead(this.tsIsStartOfMappedType.bind(this)) ? this.tsParseMappedType() : this.tsParseTypeLiteral();
          case 0:
            return this.tsParseTupleType();
          case 10:
            return this.tsParseParenthesizedType();
          case 25:
          case 24:
            return this.tsParseTemplateLiteralType();
          default: {
            const {
              type
            } = this.state;
            if (tokenIsIdentifier(type) || type === 88 || type === 84) {
              const nodeType = type === 88 ? "TSVoidKeyword" : type === 84 ? "TSNullKeyword" : keywordTypeFromName(this.state.value);
              if (nodeType !== void 0 && this.lookaheadCharCode() !== 46) {
                const node = this.startNode();
                this.next();
                return this.finishNode(node, nodeType);
              }
              return this.tsParseTypeReference();
            }
          }
        }
        throw this.unexpected();
      }
      tsParseArrayTypeOrHigher() {
        const {
          startLoc
        } = this.state;
        let type = this.tsParseNonArrayType();
        while (!this.hasPrecedingLineBreak() && this.eat(0)) {
          if (this.match(3)) {
            const node = this.startNodeAt(startLoc);
            node.elementType = type;
            this.expect(3);
            type = this.finishNode(node, "TSArrayType");
          } else {
            const node = this.startNodeAt(startLoc);
            node.objectType = type;
            node.indexType = this.tsParseType();
            this.expect(3);
            type = this.finishNode(node, "TSIndexedAccessType");
          }
        }
        return type;
      }
      tsParseTypeOperator() {
        const node = this.startNode();
        const operator = this.state.value;
        this.next();
        node.operator = operator;
        node.typeAnnotation = this.tsParseTypeOperatorOrHigher();
        if (operator === "readonly") {
          this.tsCheckTypeAnnotationForReadOnly(node);
        }
        return this.finishNode(node, "TSTypeOperator");
      }
      tsCheckTypeAnnotationForReadOnly(node) {
        switch (node.typeAnnotation.type) {
          case "TSTupleType":
          case "TSArrayType":
            return;
          default:
            this.raise(TSErrors.UnexpectedReadonly, node);
        }
      }
      tsParseInferType() {
        const node = this.startNode();
        this.expectContextual(115);
        const typeParameter = this.startNode();
        typeParameter.name = this.tsParseTypeParameterName();
        typeParameter.constraint = this.tsTryParse(() => this.tsParseConstraintForInferType());
        node.typeParameter = this.finishNode(typeParameter, "TSTypeParameter");
        return this.finishNode(node, "TSInferType");
      }
      tsParseConstraintForInferType() {
        if (this.eat(81)) {
          const constraint = this.tsInDisallowConditionalTypesContext(() => this.tsParseType());
          if (this.state.inDisallowConditionalTypesContext || !this.match(17)) {
            return constraint;
          }
        }
      }
      tsParseTypeOperatorOrHigher() {
        const isTypeOperator = tokenIsTSTypeOperator(this.state.type) && !this.state.containsEsc;
        return isTypeOperator ? this.tsParseTypeOperator() : this.isContextual(115) ? this.tsParseInferType() : this.tsInAllowConditionalTypesContext(() => this.tsParseArrayTypeOrHigher());
      }
      tsParseUnionOrIntersectionType(kind, parseConstituentType, operator) {
        const node = this.startNode();
        const hasLeadingOperator = this.eat(operator);
        const types3 = [];
        do {
          types3.push(parseConstituentType());
        } while (this.eat(operator));
        if (types3.length === 1 && !hasLeadingOperator) {
          return types3[0];
        }
        node.types = types3;
        return this.finishNode(node, kind);
      }
      tsParseIntersectionTypeOrHigher() {
        return this.tsParseUnionOrIntersectionType("TSIntersectionType", this.tsParseTypeOperatorOrHigher.bind(this), 45);
      }
      tsParseUnionTypeOrHigher() {
        return this.tsParseUnionOrIntersectionType("TSUnionType", this.tsParseIntersectionTypeOrHigher.bind(this), 43);
      }
      tsIsStartOfFunctionType() {
        if (this.match(47)) {
          return true;
        }
        return this.match(10) && this.tsLookAhead(this.tsIsUnambiguouslyStartOfFunctionType.bind(this));
      }
      tsSkipParameterStart() {
        if (tokenIsIdentifier(this.state.type) || this.match(78)) {
          this.next();
          return true;
        }
        if (this.match(5)) {
          const {
            errors
          } = this.state;
          const previousErrorCount = errors.length;
          try {
            this.parseObjectLike(8, true);
            return errors.length === previousErrorCount;
          } catch (_unused) {
            return false;
          }
        }
        if (this.match(0)) {
          this.next();
          const {
            errors
          } = this.state;
          const previousErrorCount = errors.length;
          try {
            super.parseBindingList(3, 93, 1);
            return errors.length === previousErrorCount;
          } catch (_unused2) {
            return false;
          }
        }
        return false;
      }
      tsIsUnambiguouslyStartOfFunctionType() {
        this.next();
        if (this.match(11) || this.match(21)) {
          return true;
        }
        if (this.tsSkipParameterStart()) {
          if (this.match(14) || this.match(12) || this.match(17) || this.match(29)) {
            return true;
          }
          if (this.match(11)) {
            this.next();
            if (this.match(19)) {
              return true;
            }
          }
        }
        return false;
      }
      tsParseTypeOrTypePredicateAnnotation(returnToken) {
        return this.tsInType(() => {
          const t = this.startNode();
          this.expect(returnToken);
          const node = this.startNode();
          const asserts = !!this.tsTryParse(this.tsParseTypePredicateAsserts.bind(this));
          if (asserts && this.match(78)) {
            let thisTypePredicate = this.tsParseThisTypeOrThisTypePredicate();
            if (thisTypePredicate.type === "TSThisType") {
              node.parameterName = thisTypePredicate;
              node.asserts = true;
              node.typeAnnotation = null;
              thisTypePredicate = this.finishNode(node, "TSTypePredicate");
            } else {
              this.resetStartLocationFromNode(thisTypePredicate, node);
              thisTypePredicate.asserts = true;
            }
            t.typeAnnotation = thisTypePredicate;
            return this.finishNode(t, "TSTypeAnnotation");
          }
          const typePredicateVariable = this.tsIsIdentifier() && this.tsTryParse(this.tsParseTypePredicatePrefix.bind(this));
          if (!typePredicateVariable) {
            if (!asserts) {
              return this.tsParseTypeAnnotation(false, t);
            }
            node.parameterName = this.parseIdentifier();
            node.asserts = asserts;
            node.typeAnnotation = null;
            t.typeAnnotation = this.finishNode(node, "TSTypePredicate");
            return this.finishNode(t, "TSTypeAnnotation");
          }
          const type = this.tsParseTypeAnnotation(false);
          node.parameterName = typePredicateVariable;
          node.typeAnnotation = type;
          node.asserts = asserts;
          t.typeAnnotation = this.finishNode(node, "TSTypePredicate");
          return this.finishNode(t, "TSTypeAnnotation");
        });
      }
      tsTryParseTypeOrTypePredicateAnnotation() {
        if (this.match(14)) {
          return this.tsParseTypeOrTypePredicateAnnotation(14);
        }
      }
      tsTryParseTypeAnnotation() {
        if (this.match(14)) {
          return this.tsParseTypeAnnotation();
        }
      }
      tsTryParseType() {
        return this.tsEatThenParseType(14);
      }
      tsParseTypePredicatePrefix() {
        const id = this.parseIdentifier();
        if (this.isContextual(116) && !this.hasPrecedingLineBreak()) {
          this.next();
          return id;
        }
      }
      tsParseTypePredicateAsserts() {
        if (this.state.type !== 109) {
          return false;
        }
        const containsEsc = this.state.containsEsc;
        this.next();
        if (!tokenIsIdentifier(this.state.type) && !this.match(78)) {
          return false;
        }
        if (containsEsc) {
          this.raise(Errors.InvalidEscapedReservedWord, this.state.lastTokStartLoc, {
            reservedWord: "asserts"
          });
        }
        return true;
      }
      tsParseTypeAnnotation(eatColon = true, t = this.startNode()) {
        this.tsInType(() => {
          if (eatColon) this.expect(14);
          t.typeAnnotation = this.tsParseType();
        });
        return this.finishNode(t, "TSTypeAnnotation");
      }
      tsParseType() {
        assert(this.state.inType);
        const type = this.tsParseNonConditionalType();
        if (this.state.inDisallowConditionalTypesContext || this.hasPrecedingLineBreak() || !this.eat(81)) {
          return type;
        }
        const node = this.startNodeAtNode(type);
        node.checkType = type;
        node.extendsType = this.tsInDisallowConditionalTypesContext(() => this.tsParseNonConditionalType());
        this.expect(17);
        node.trueType = this.tsInAllowConditionalTypesContext(() => this.tsParseType());
        this.expect(14);
        node.falseType = this.tsInAllowConditionalTypesContext(() => this.tsParseType());
        return this.finishNode(node, "TSConditionalType");
      }
      isAbstractConstructorSignature() {
        return this.isContextual(124) && this.isLookaheadContextual("new");
      }
      tsParseNonConditionalType() {
        if (this.tsIsStartOfFunctionType()) {
          return this.tsParseFunctionOrConstructorType("TSFunctionType");
        }
        if (this.match(77)) {
          return this.tsParseFunctionOrConstructorType("TSConstructorType");
        } else if (this.isAbstractConstructorSignature()) {
          return this.tsParseFunctionOrConstructorType("TSConstructorType", true);
        }
        return this.tsParseUnionTypeOrHigher();
      }
      tsParseTypeAssertion() {
        if (this.getPluginOption("typescript", "disallowAmbiguousJSXLike")) {
          this.raise(TSErrors.ReservedTypeAssertion, this.state.startLoc);
        }
        const node = this.startNode();
        node.typeAnnotation = this.tsInType(() => {
          this.next();
          return this.match(75) ? this.tsParseTypeReference() : this.tsParseType();
        });
        this.expect(48);
        node.expression = this.parseMaybeUnary();
        return this.finishNode(node, "TSTypeAssertion");
      }
      tsParseHeritageClause(token) {
        const originalStartLoc = this.state.startLoc;
        const delimitedList = this.tsParseDelimitedList("HeritageClauseElement", () => {
          const node = this.startNode();
          node.expression = this.tsParseEntityName(1 | 2);
          if (this.match(47)) {
            node.typeParameters = this.tsParseTypeArguments();
          }
          return this.finishNode(node, "TSExpressionWithTypeArguments");
        });
        if (!delimitedList.length) {
          this.raise(TSErrors.EmptyHeritageClauseType, originalStartLoc, {
            token
          });
        }
        return delimitedList;
      }
      tsParseInterfaceDeclaration(node, properties = {}) {
        if (this.hasFollowingLineBreak()) return null;
        this.expectContextual(129);
        if (properties.declare) node.declare = true;
        if (tokenIsIdentifier(this.state.type)) {
          node.id = this.parseIdentifier();
          this.checkIdentifier(node.id, 130);
        } else {
          node.id = null;
          this.raise(TSErrors.MissingInterfaceName, this.state.startLoc);
        }
        node.typeParameters = this.tsTryParseTypeParameters(this.tsParseInOutConstModifiers);
        if (this.eat(81)) {
          node.extends = this.tsParseHeritageClause("extends");
        }
        const body = this.startNode();
        body.body = this.tsInType(this.tsParseObjectTypeMembers.bind(this));
        node.body = this.finishNode(body, "TSInterfaceBody");
        return this.finishNode(node, "TSInterfaceDeclaration");
      }
      tsParseTypeAliasDeclaration(node) {
        node.id = this.parseIdentifier();
        this.checkIdentifier(node.id, 2);
        node.typeAnnotation = this.tsInType(() => {
          node.typeParameters = this.tsTryParseTypeParameters(this.tsParseInOutModifiers);
          this.expect(29);
          if (this.isContextual(114) && this.lookaheadCharCode() !== 46) {
            const node2 = this.startNode();
            this.next();
            return this.finishNode(node2, "TSIntrinsicKeyword");
          }
          return this.tsParseType();
        });
        this.semicolon();
        return this.finishNode(node, "TSTypeAliasDeclaration");
      }
      tsInTopLevelContext(cb) {
        if (this.curContext() !== types2.brace) {
          const oldContext = this.state.context;
          this.state.context = [oldContext[0]];
          try {
            return cb();
          } finally {
            this.state.context = oldContext;
          }
        } else {
          return cb();
        }
      }
      tsInType(cb) {
        const oldInType = this.state.inType;
        this.state.inType = true;
        try {
          return cb();
        } finally {
          this.state.inType = oldInType;
        }
      }
      tsInDisallowConditionalTypesContext(cb) {
        const oldInDisallowConditionalTypesContext = this.state.inDisallowConditionalTypesContext;
        this.state.inDisallowConditionalTypesContext = true;
        try {
          return cb();
        } finally {
          this.state.inDisallowConditionalTypesContext = oldInDisallowConditionalTypesContext;
        }
      }
      tsInAllowConditionalTypesContext(cb) {
        const oldInDisallowConditionalTypesContext = this.state.inDisallowConditionalTypesContext;
        this.state.inDisallowConditionalTypesContext = false;
        try {
          return cb();
        } finally {
          this.state.inDisallowConditionalTypesContext = oldInDisallowConditionalTypesContext;
        }
      }
      tsEatThenParseType(token) {
        if (this.match(token)) {
          return this.tsNextThenParseType();
        }
      }
      tsExpectThenParseType(token) {
        return this.tsInType(() => {
          this.expect(token);
          return this.tsParseType();
        });
      }
      tsNextThenParseType() {
        return this.tsInType(() => {
          this.next();
          return this.tsParseType();
        });
      }
      tsParseEnumMember() {
        const node = this.startNode();
        node.id = this.match(134) ? super.parseStringLiteral(this.state.value) : this.parseIdentifier(true);
        if (this.eat(29)) {
          node.initializer = super.parseMaybeAssignAllowIn();
        }
        return this.finishNode(node, "TSEnumMember");
      }
      tsParseEnumDeclaration(node, properties = {}) {
        if (properties.const) node.const = true;
        if (properties.declare) node.declare = true;
        this.expectContextual(126);
        node.id = this.parseIdentifier();
        this.checkIdentifier(node.id, node.const ? 8971 : 8459);
        this.expect(5);
        node.members = this.tsParseDelimitedList("EnumMembers", this.tsParseEnumMember.bind(this));
        this.expect(8);
        return this.finishNode(node, "TSEnumDeclaration");
      }
      tsParseEnumBody() {
        const node = this.startNode();
        this.expect(5);
        node.members = this.tsParseDelimitedList("EnumMembers", this.tsParseEnumMember.bind(this));
        this.expect(8);
        return this.finishNode(node, "TSEnumBody");
      }
      tsParseModuleBlock() {
        const node = this.startNode();
        this.scope.enter(0);
        this.expect(5);
        super.parseBlockOrModuleBlockBody(node.body = [], void 0, true, 8);
        this.scope.exit();
        return this.finishNode(node, "TSModuleBlock");
      }
      tsParseModuleOrNamespaceDeclaration(node, nested = false) {
        node.id = this.parseIdentifier();
        if (!nested) {
          this.checkIdentifier(node.id, 1024);
        }
        if (this.eat(16)) {
          const inner = this.startNode();
          this.tsParseModuleOrNamespaceDeclaration(inner, true);
          node.body = inner;
        } else {
          this.scope.enter(1024);
          this.prodParam.enter(0);
          node.body = this.tsParseModuleBlock();
          this.prodParam.exit();
          this.scope.exit();
        }
        return this.finishNode(node, "TSModuleDeclaration");
      }
      tsParseAmbientExternalModuleDeclaration(node) {
        if (this.isContextual(112)) {
          node.kind = "global";
          node.global = true;
          node.id = this.parseIdentifier();
        } else if (this.match(134)) {
          node.kind = "module";
          node.id = super.parseStringLiteral(this.state.value);
        } else {
          this.unexpected();
        }
        if (this.match(5)) {
          this.scope.enter(1024);
          this.prodParam.enter(0);
          node.body = this.tsParseModuleBlock();
          this.prodParam.exit();
          this.scope.exit();
        } else {
          this.semicolon();
        }
        return this.finishNode(node, "TSModuleDeclaration");
      }
      tsParseImportEqualsDeclaration(node, maybeDefaultIdentifier, isExport) {
        node.isExport = isExport || false;
        node.id = maybeDefaultIdentifier || this.parseIdentifier();
        this.checkIdentifier(node.id, 4096);
        this.expect(29);
        const moduleReference = this.tsParseModuleReference();
        if (node.importKind === "type" && moduleReference.type !== "TSExternalModuleReference") {
          this.raise(TSErrors.ImportAliasHasImportType, moduleReference);
        }
        node.moduleReference = moduleReference;
        this.semicolon();
        return this.finishNode(node, "TSImportEqualsDeclaration");
      }
      tsIsExternalModuleReference() {
        return this.isContextual(119) && this.lookaheadCharCode() === 40;
      }
      tsParseModuleReference() {
        return this.tsIsExternalModuleReference() ? this.tsParseExternalModuleReference() : this.tsParseEntityName(0);
      }
      tsParseExternalModuleReference() {
        const node = this.startNode();
        this.expectContextual(119);
        this.expect(10);
        if (!this.match(134)) {
          this.unexpected();
        }
        node.expression = super.parseExprAtom();
        this.expect(11);
        this.sawUnambiguousESM = true;
        return this.finishNode(node, "TSExternalModuleReference");
      }
      tsLookAhead(f) {
        const state = this.state.clone();
        const res = f();
        this.state = state;
        return res;
      }
      tsTryParseAndCatch(f) {
        const result = this.tryParse((abort) => f() || abort());
        if (result.aborted || !result.node) return;
        if (result.error) this.state = result.failState;
        return result.node;
      }
      tsTryParse(f) {
        const state = this.state.clone();
        const result = f();
        if (result !== void 0 && result !== false) {
          return result;
        }
        this.state = state;
      }
      tsTryParseDeclare(node) {
        if (this.isLineTerminator()) {
          return;
        }
        const startType = this.state.type;
        return this.tsInAmbientContext(() => {
          switch (startType) {
            case 68:
              node.declare = true;
              return super.parseFunctionStatement(node, false, false);
            case 80:
              node.declare = true;
              return this.parseClass(node, true, false);
            case 126:
              return this.tsParseEnumDeclaration(node, {
                declare: true
              });
            case 112:
              return this.tsParseAmbientExternalModuleDeclaration(node);
            case 100:
              if (this.state.containsEsc) {
                return;
              }
            case 75:
            case 74:
              if (!this.match(75) || !this.isLookaheadContextual("enum")) {
                node.declare = true;
                return this.parseVarStatement(node, this.state.value, true);
              }
              this.expect(75);
              return this.tsParseEnumDeclaration(node, {
                const: true,
                declare: true
              });
            case 107:
              if (this.isUsing()) {
                this.raise(TSErrors.InvalidModifierOnUsingDeclaration, this.state.startLoc, "declare");
                node.declare = true;
                return this.parseVarStatement(node, "using", true);
              }
              break;
            case 96:
              if (this.isAwaitUsing()) {
                this.raise(TSErrors.InvalidModifierOnAwaitUsingDeclaration, this.state.startLoc, "declare");
                node.declare = true;
                this.next();
                return this.parseVarStatement(node, "await using", true);
              }
              break;
            case 129: {
              const result = this.tsParseInterfaceDeclaration(node, {
                declare: true
              });
              if (result) return result;
            }
            default:
              if (tokenIsIdentifier(startType)) {
                return this.tsParseDeclaration(node, this.state.type, true, null);
              }
          }
        });
      }
      tsTryParseExportDeclaration() {
        return this.tsParseDeclaration(this.startNode(), this.state.type, true, null);
      }
      tsParseDeclaration(node, type, next, decorators) {
        switch (type) {
          case 124:
            if (this.tsCheckLineTerminator(next) && (this.match(80) || tokenIsIdentifier(this.state.type))) {
              return this.tsParseAbstractDeclaration(node, decorators);
            }
            break;
          case 127:
            if (this.tsCheckLineTerminator(next)) {
              if (this.match(134)) {
                return this.tsParseAmbientExternalModuleDeclaration(node);
              } else if (tokenIsIdentifier(this.state.type)) {
                node.kind = "module";
                return this.tsParseModuleOrNamespaceDeclaration(node);
              }
            }
            break;
          case 128:
            if (this.tsCheckLineTerminator(next) && tokenIsIdentifier(this.state.type)) {
              node.kind = "namespace";
              return this.tsParseModuleOrNamespaceDeclaration(node);
            }
            break;
          case 130:
            if (this.tsCheckLineTerminator(next) && tokenIsIdentifier(this.state.type)) {
              return this.tsParseTypeAliasDeclaration(node);
            }
            break;
        }
      }
      tsCheckLineTerminator(next) {
        if (next) {
          if (this.hasFollowingLineBreak()) return false;
          this.next();
          return true;
        }
        return !this.isLineTerminator();
      }
      tsTryParseGenericAsyncArrowFunction(startLoc) {
        if (!this.match(47)) return;
        const oldMaybeInArrowParameters = this.state.maybeInArrowParameters;
        this.state.maybeInArrowParameters = true;
        const res = this.tsTryParseAndCatch(() => {
          const node = this.startNodeAt(startLoc);
          node.typeParameters = this.tsParseTypeParameters(this.tsParseConstModifier);
          super.parseFunctionParams(node);
          node.returnType = this.tsTryParseTypeOrTypePredicateAnnotation();
          this.expect(19);
          return node;
        });
        this.state.maybeInArrowParameters = oldMaybeInArrowParameters;
        if (!res) return;
        return super.parseArrowExpression(res, null, true);
      }
      tsParseTypeArgumentsInExpression() {
        if (this.reScan_lt() !== 47) return;
        return this.tsParseTypeArguments();
      }
      tsParseTypeArguments() {
        const node = this.startNode();
        node.params = this.tsInType(() => this.tsInTopLevelContext(() => {
          this.expect(47);
          return this.tsParseDelimitedList("TypeParametersOrArguments", this.tsParseType.bind(this));
        }));
        if (node.params.length === 0) {
          this.raise(TSErrors.EmptyTypeArguments, node);
        } else if (!this.state.inType && this.curContext() === types2.brace) {
          this.reScan_lt_gt();
        }
        this.expect(48);
        return this.finishNode(node, "TSTypeParameterInstantiation");
      }
      tsIsDeclarationStart() {
        return tokenIsTSDeclarationStart(this.state.type);
      }
      isExportDefaultSpecifier() {
        if (this.tsIsDeclarationStart()) return false;
        return super.isExportDefaultSpecifier();
      }
      parseBindingElement(flags, decorators) {
        const startLoc = decorators.length ? decorators[0].loc.start : this.state.startLoc;
        const modified = {};
        this.tsParseModifiers({
          allowedModifiers: ["public", "private", "protected", "override", "readonly"]
        }, modified);
        const accessibility = modified.accessibility;
        const override = modified.override;
        const readonly = modified.readonly;
        if (!(flags & 4) && (accessibility || readonly || override)) {
          this.raise(TSErrors.UnexpectedParameterModifier, startLoc);
        }
        const left = this.parseMaybeDefault();
        if (flags & 2) {
          this.parseFunctionParamType(left);
        }
        const elt = this.parseMaybeDefault(left.loc.start, left);
        if (accessibility || readonly || override) {
          const pp = this.startNodeAt(startLoc);
          if (decorators.length) {
            pp.decorators = decorators;
          }
          if (accessibility) pp.accessibility = accessibility;
          if (readonly) pp.readonly = readonly;
          if (override) pp.override = override;
          if (elt.type !== "Identifier" && elt.type !== "AssignmentPattern") {
            this.raise(TSErrors.UnsupportedParameterPropertyKind, pp);
          }
          pp.parameter = elt;
          return this.finishNode(pp, "TSParameterProperty");
        }
        if (decorators.length) {
          left.decorators = decorators;
        }
        return elt;
      }
      isSimpleParameter(node) {
        return node.type === "TSParameterProperty" && super.isSimpleParameter(node.parameter) || super.isSimpleParameter(node);
      }
      tsDisallowOptionalPattern(node) {
        for (const param of node.params) {
          if (param.type !== "Identifier" && param.optional && !this.state.isAmbientContext) {
            this.raise(TSErrors.PatternIsOptional, param);
          }
        }
      }
      setArrowFunctionParameters(node, params, trailingCommaLoc) {
        super.setArrowFunctionParameters(node, params, trailingCommaLoc);
        this.tsDisallowOptionalPattern(node);
      }
      parseFunctionBodyAndFinish(node, type, isMethod = false) {
        if (this.match(14)) {
          node.returnType = this.tsParseTypeOrTypePredicateAnnotation(14);
        }
        const bodilessType = type === "FunctionDeclaration" ? "TSDeclareFunction" : type === "ClassMethod" || type === "ClassPrivateMethod" ? "TSDeclareMethod" : void 0;
        if (bodilessType && !this.match(5) && this.isLineTerminator()) {
          return this.finishNode(node, bodilessType);
        }
        if (bodilessType === "TSDeclareFunction" && this.state.isAmbientContext) {
          this.raise(TSErrors.DeclareFunctionHasImplementation, node);
          if (node.declare) {
            return super.parseFunctionBodyAndFinish(node, bodilessType, isMethod);
          }
        }
        this.tsDisallowOptionalPattern(node);
        return super.parseFunctionBodyAndFinish(node, type, isMethod);
      }
      registerFunctionStatementId(node) {
        if (!node.body && node.id) {
          this.checkIdentifier(node.id, 1024);
        } else {
          super.registerFunctionStatementId(node);
        }
      }
      tsCheckForInvalidTypeCasts(items) {
        items.forEach((node) => {
          if ((node == null ? void 0 : node.type) === "TSTypeCastExpression") {
            this.raise(TSErrors.UnexpectedTypeAnnotation, node.typeAnnotation);
          }
        });
      }
      toReferencedList(exprList, isInParens) {
        this.tsCheckForInvalidTypeCasts(exprList);
        return exprList;
      }
      parseArrayLike(close, isTuple, refExpressionErrors) {
        const node = super.parseArrayLike(close, isTuple, refExpressionErrors);
        if (node.type === "ArrayExpression") {
          this.tsCheckForInvalidTypeCasts(node.elements);
        }
        return node;
      }
      parseSubscript(base, startLoc, noCalls, state) {
        if (!this.hasPrecedingLineBreak() && this.match(35)) {
          this.state.canStartJSXElement = false;
          this.next();
          const nonNullExpression = this.startNodeAt(startLoc);
          nonNullExpression.expression = base;
          return this.finishNode(nonNullExpression, "TSNonNullExpression");
        }
        let isOptionalCall = false;
        if (this.match(18) && this.lookaheadCharCode() === 60) {
          if (noCalls) {
            state.stop = true;
            return base;
          }
          state.optionalChainMember = isOptionalCall = true;
          this.next();
        }
        if (this.match(47) || this.match(51)) {
          let missingParenErrorLoc;
          const result = this.tsTryParseAndCatch(() => {
            if (!noCalls && this.atPossibleAsyncArrow(base)) {
              const asyncArrowFn = this.tsTryParseGenericAsyncArrowFunction(startLoc);
              if (asyncArrowFn) {
                state.stop = true;
                return asyncArrowFn;
              }
            }
            const typeArguments = this.tsParseTypeArgumentsInExpression();
            if (!typeArguments) return;
            if (isOptionalCall && !this.match(10)) {
              missingParenErrorLoc = this.state.curPosition();
              return;
            }
            if (tokenIsTemplate(this.state.type)) {
              const result2 = super.parseTaggedTemplateExpression(base, startLoc, state);
              result2.typeParameters = typeArguments;
              return result2;
            }
            if (!noCalls && this.eat(10)) {
              const node2 = this.startNodeAt(startLoc);
              node2.callee = base;
              node2.arguments = this.parseCallExpressionArguments();
              this.tsCheckForInvalidTypeCasts(node2.arguments);
              node2.typeParameters = typeArguments;
              if (state.optionalChainMember) {
                node2.optional = isOptionalCall;
              }
              return this.finishCallExpression(node2, state.optionalChainMember);
            }
            const tokenType = this.state.type;
            if (tokenType === 48 || tokenType === 52 || tokenType !== 10 && tokenType !== 93 && tokenType !== 120 && tokenCanStartExpression(tokenType) && !this.hasPrecedingLineBreak()) {
              return;
            }
            const node = this.startNodeAt(startLoc);
            node.expression = base;
            node.typeParameters = typeArguments;
            return this.finishNode(node, "TSInstantiationExpression");
          });
          if (missingParenErrorLoc) {
            this.unexpected(missingParenErrorLoc, 10);
          }
          if (result) {
            if (result.type === "TSInstantiationExpression") {
              if (this.match(16) || this.match(18) && this.lookaheadCharCode() !== 40) {
                this.raise(TSErrors.InvalidPropertyAccessAfterInstantiationExpression, this.state.startLoc);
              }
              if (!this.match(16) && !this.match(18)) {
                result.expression = super.stopParseSubscript(base, state);
              }
            }
            return result;
          }
        }
        return super.parseSubscript(base, startLoc, noCalls, state);
      }
      parseNewCallee(node) {
        var _callee$extra;
        super.parseNewCallee(node);
        const {
          callee
        } = node;
        if (callee.type === "TSInstantiationExpression" && !((_callee$extra = callee.extra) != null && _callee$extra.parenthesized)) {
          node.typeParameters = callee.typeParameters;
          node.callee = callee.expression;
        }
      }
      parseExprOp(left, leftStartLoc, minPrec) {
        let isSatisfies;
        if (tokenOperatorPrecedence(58) > minPrec && !this.hasPrecedingLineBreak() && (this.isContextual(93) || (isSatisfies = this.isContextual(120)))) {
          const node = this.startNodeAt(leftStartLoc);
          node.expression = left;
          node.typeAnnotation = this.tsInType(() => {
            this.next();
            if (this.match(75)) {
              if (isSatisfies) {
                this.raise(Errors.UnexpectedKeyword, this.state.startLoc, {
                  keyword: "const"
                });
              }
              return this.tsParseTypeReference();
            }
            return this.tsParseType();
          });
          this.finishNode(node, isSatisfies ? "TSSatisfiesExpression" : "TSAsExpression");
          this.reScan_lt_gt();
          return this.parseExprOp(node, leftStartLoc, minPrec);
        }
        return super.parseExprOp(left, leftStartLoc, minPrec);
      }
      checkReservedWord(word, startLoc, checkKeywords, isBinding) {
        if (!this.state.isAmbientContext) {
          super.checkReservedWord(word, startLoc, checkKeywords, isBinding);
        }
      }
      checkImportReflection(node) {
        super.checkImportReflection(node);
        if (node.module && node.importKind !== "value") {
          this.raise(TSErrors.ImportReflectionHasImportType, node.specifiers[0].loc.start);
        }
      }
      checkDuplicateExports() {
      }
      isPotentialImportPhase(isExport) {
        if (super.isPotentialImportPhase(isExport)) return true;
        if (this.isContextual(130)) {
          const ch = this.lookaheadCharCode();
          return isExport ? ch === 123 || ch === 42 : ch !== 61;
        }
        return !isExport && this.isContextual(87);
      }
      applyImportPhase(node, isExport, phase, loc) {
        super.applyImportPhase(node, isExport, phase, loc);
        if (isExport) {
          node.exportKind = phase === "type" ? "type" : "value";
        } else {
          node.importKind = phase === "type" || phase === "typeof" ? phase : "value";
        }
      }
      parseImport(node) {
        if (this.match(134)) {
          node.importKind = "value";
          return super.parseImport(node);
        }
        let importNode;
        if (tokenIsIdentifier(this.state.type) && this.lookaheadCharCode() === 61) {
          node.importKind = "value";
          return this.tsParseImportEqualsDeclaration(node);
        } else if (this.isContextual(130)) {
          const maybeDefaultIdentifier = this.parseMaybeImportPhase(node, false);
          if (this.lookaheadCharCode() === 61) {
            return this.tsParseImportEqualsDeclaration(node, maybeDefaultIdentifier);
          } else {
            importNode = super.parseImportSpecifiersAndAfter(node, maybeDefaultIdentifier);
          }
        } else {
          importNode = super.parseImport(node);
        }
        if (importNode.importKind === "type" && importNode.specifiers.length > 1 && importNode.specifiers[0].type === "ImportDefaultSpecifier") {
          this.raise(TSErrors.TypeImportCannotSpecifyDefaultAndNamed, importNode);
        }
        return importNode;
      }
      parseExport(node, decorators) {
        if (this.match(83)) {
          const nodeImportEquals = node;
          this.next();
          let maybeDefaultIdentifier = null;
          if (this.isContextual(130) && this.isPotentialImportPhase(false)) {
            maybeDefaultIdentifier = this.parseMaybeImportPhase(nodeImportEquals, false);
          } else {
            nodeImportEquals.importKind = "value";
          }
          const declaration = this.tsParseImportEqualsDeclaration(nodeImportEquals, maybeDefaultIdentifier, true);
          return declaration;
        } else if (this.eat(29)) {
          const assign = node;
          assign.expression = super.parseExpression();
          this.semicolon();
          this.sawUnambiguousESM = true;
          return this.finishNode(assign, "TSExportAssignment");
        } else if (this.eatContextual(93)) {
          const decl = node;
          this.expectContextual(128);
          decl.id = this.parseIdentifier();
          this.semicolon();
          return this.finishNode(decl, "TSNamespaceExportDeclaration");
        } else {
          return super.parseExport(node, decorators);
        }
      }
      isAbstractClass() {
        return this.isContextual(124) && this.isLookaheadContextual("class");
      }
      parseExportDefaultExpression() {
        if (this.isAbstractClass()) {
          const cls = this.startNode();
          this.next();
          cls.abstract = true;
          return this.parseClass(cls, true, true);
        }
        if (this.match(129)) {
          const result = this.tsParseInterfaceDeclaration(this.startNode());
          if (result) return result;
        }
        return super.parseExportDefaultExpression();
      }
      parseVarStatement(node, kind, allowMissingInitializer = false) {
        const {
          isAmbientContext
        } = this.state;
        const declaration = super.parseVarStatement(node, kind, allowMissingInitializer || isAmbientContext);
        if (!isAmbientContext) return declaration;
        if (!node.declare && (kind === "using" || kind === "await using")) {
          this.raiseOverwrite(TSErrors.UsingDeclarationInAmbientContext, node, kind);
          return declaration;
        }
        for (const {
          id,
          init
        } of declaration.declarations) {
          if (!init) continue;
          if (kind === "var" || kind === "let" || !!id.typeAnnotation) {
            this.raise(TSErrors.InitializerNotAllowedInAmbientContext, init);
          } else if (!isValidAmbientConstInitializer(init, this.hasPlugin("estree"))) {
            this.raise(TSErrors.ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference, init);
          }
        }
        return declaration;
      }
      parseStatementContent(flags, decorators) {
        if (!this.state.containsEsc) {
          switch (this.state.type) {
            case 75: {
              if (this.isLookaheadContextual("enum")) {
                const node = this.startNode();
                this.expect(75);
                return this.tsParseEnumDeclaration(node, {
                  const: true
                });
              }
              break;
            }
            case 124:
            case 125: {
              if (this.nextTokenIsIdentifierAndNotTSRelationalOperatorOnSameLine()) {
                const token = this.state.type;
                const node = this.startNode();
                this.next();
                const declaration = token === 125 ? this.tsTryParseDeclare(node) : this.tsParseAbstractDeclaration(node, decorators);
                if (declaration) {
                  if (token === 125) {
                    declaration.declare = true;
                  }
                  return declaration;
                } else {
                  node.expression = this.createIdentifier(this.startNodeAt(node.loc.start), token === 125 ? "declare" : "abstract");
                  this.semicolon(false);
                  return this.finishNode(node, "ExpressionStatement");
                }
              }
              break;
            }
            case 126:
              return this.tsParseEnumDeclaration(this.startNode());
            case 112: {
              const nextCh = this.lookaheadCharCode();
              if (nextCh === 123) {
                const node = this.startNode();
                return this.tsParseAmbientExternalModuleDeclaration(node);
              }
              break;
            }
            case 129: {
              const result = this.tsParseInterfaceDeclaration(this.startNode());
              if (result) return result;
              break;
            }
            case 127: {
              if (this.nextTokenIsIdentifierOrStringLiteralOnSameLine()) {
                const node = this.startNode();
                this.next();
                return this.tsParseDeclaration(node, 127, false, decorators);
              }
              break;
            }
            case 128: {
              if (this.nextTokenIsIdentifierOnSameLine()) {
                const node = this.startNode();
                this.next();
                return this.tsParseDeclaration(node, 128, false, decorators);
              }
              break;
            }
            case 130: {
              if (this.nextTokenIsIdentifierOnSameLine()) {
                const node = this.startNode();
                this.next();
                return this.tsParseTypeAliasDeclaration(node);
              }
              break;
            }
          }
        }
        return super.parseStatementContent(flags, decorators);
      }
      parseAccessModifier() {
        return this.tsParseModifier(["public", "protected", "private"]);
      }
      tsHasSomeModifiers(member, modifiers) {
        return modifiers.some((modifier) => {
          if (tsIsAccessModifier(modifier)) {
            return member.accessibility === modifier;
          }
          return !!member[modifier];
        });
      }
      tsIsStartOfStaticBlocks() {
        return this.isContextual(106) && this.lookaheadCharCode() === 123;
      }
      parseClassMember(classBody, member, state) {
        const modifiers = ["declare", "private", "public", "protected", "override", "abstract", "readonly", "static"];
        this.tsParseModifiers({
          allowedModifiers: modifiers,
          disallowedModifiers: ["in", "out"],
          stopOnStartOfClassStaticBlock: true,
          errorTemplate: TSErrors.InvalidModifierOnTypeParameterPositions
        }, member);
        const callParseClassMemberWithIsStatic = () => {
          if (this.tsIsStartOfStaticBlocks()) {
            this.next();
            this.next();
            if (this.tsHasSomeModifiers(member, modifiers)) {
              this.raise(TSErrors.StaticBlockCannotHaveModifier, this.state.curPosition());
            }
            super.parseClassStaticBlock(classBody, member);
          } else {
            this.parseClassMemberWithIsStatic(classBody, member, state, !!member.static);
          }
        };
        if (member.declare) {
          this.tsInAmbientContext(callParseClassMemberWithIsStatic);
        } else {
          callParseClassMemberWithIsStatic();
        }
      }
      parseClassMemberWithIsStatic(classBody, member, state, isStatic) {
        const idx = this.tsTryParseIndexSignature(member);
        if (idx) {
          classBody.body.push(idx);
          if (member.abstract) {
            this.raise(TSErrors.IndexSignatureHasAbstract, member);
          }
          if (member.accessibility) {
            this.raise(TSErrors.IndexSignatureHasAccessibility, member, {
              modifier: member.accessibility
            });
          }
          if (member.declare) {
            this.raise(TSErrors.IndexSignatureHasDeclare, member);
          }
          if (member.override) {
            this.raise(TSErrors.IndexSignatureHasOverride, member);
          }
          return;
        }
        if (!this.state.inAbstractClass && member.abstract) {
          this.raise(TSErrors.NonAbstractClassHasAbstractMethod, member);
        }
        if (member.override) {
          if (!state.hadSuperClass) {
            this.raise(TSErrors.OverrideNotInSubClass, member);
          }
        }
        super.parseClassMemberWithIsStatic(classBody, member, state, isStatic);
      }
      parsePostMemberNameModifiers(methodOrProp) {
        const optional = this.eat(17);
        if (optional) methodOrProp.optional = true;
        if (methodOrProp.readonly && this.match(10)) {
          this.raise(TSErrors.ClassMethodHasReadonly, methodOrProp);
        }
        if (methodOrProp.declare && this.match(10)) {
          this.raise(TSErrors.ClassMethodHasDeclare, methodOrProp);
        }
      }
      shouldParseExportDeclaration() {
        if (this.tsIsDeclarationStart()) return true;
        return super.shouldParseExportDeclaration();
      }
      parseConditional(expr, startLoc, refExpressionErrors) {
        if (!this.match(17)) return expr;
        if (this.state.maybeInArrowParameters) {
          const nextCh = this.lookaheadCharCode();
          if (nextCh === 44 || nextCh === 61 || nextCh === 58 || nextCh === 41) {
            this.setOptionalParametersError(refExpressionErrors);
            return expr;
          }
        }
        return super.parseConditional(expr, startLoc, refExpressionErrors);
      }
      parseParenItem(node, startLoc) {
        const newNode = super.parseParenItem(node, startLoc);
        if (this.eat(17)) {
          newNode.optional = true;
          this.resetEndLocation(node);
        }
        if (this.match(14)) {
          const typeCastNode = this.startNodeAt(startLoc);
          typeCastNode.expression = node;
          typeCastNode.typeAnnotation = this.tsParseTypeAnnotation();
          return this.finishNode(typeCastNode, "TSTypeCastExpression");
        }
        return node;
      }
      parseExportDeclaration(node) {
        if (!this.state.isAmbientContext && this.isContextual(125)) {
          return this.tsInAmbientContext(() => this.parseExportDeclaration(node));
        }
        const startLoc = this.state.startLoc;
        const isDeclare = this.eatContextual(125);
        if (isDeclare && (this.isContextual(125) || !this.shouldParseExportDeclaration())) {
          throw this.raise(TSErrors.ExpectedAmbientAfterExportDeclare, this.state.startLoc);
        }
        const isIdentifier = tokenIsIdentifier(this.state.type);
        const declaration = isIdentifier && this.tsTryParseExportDeclaration() || super.parseExportDeclaration(node);
        if (!declaration) return null;
        if (declaration.type === "TSInterfaceDeclaration" || declaration.type === "TSTypeAliasDeclaration" || isDeclare) {
          node.exportKind = "type";
        }
        if (isDeclare && declaration.type !== "TSImportEqualsDeclaration") {
          this.resetStartLocation(declaration, startLoc);
          declaration.declare = true;
        }
        return declaration;
      }
      parseClassId(node, isStatement, optionalId, bindingType) {
        if ((!isStatement || optionalId) && this.isContextual(113)) {
          return;
        }
        super.parseClassId(node, isStatement, optionalId, node.declare ? 1024 : 8331);
        const typeParameters = this.tsTryParseTypeParameters(this.tsParseInOutConstModifiers);
        if (typeParameters) node.typeParameters = typeParameters;
      }
      parseClassPropertyAnnotation(node) {
        if (!node.optional) {
          if (this.eat(35)) {
            node.definite = true;
          } else if (this.eat(17)) {
            node.optional = true;
          }
        }
        const type = this.tsTryParseTypeAnnotation();
        if (type) node.typeAnnotation = type;
      }
      parseClassProperty(node) {
        this.parseClassPropertyAnnotation(node);
        if (this.state.isAmbientContext && !(node.readonly && !node.typeAnnotation) && this.match(29)) {
          this.raise(TSErrors.DeclareClassFieldHasInitializer, this.state.startLoc);
        }
        if (node.abstract && this.match(29)) {
          const {
            key
          } = node;
          this.raise(TSErrors.AbstractPropertyHasInitializer, this.state.startLoc, {
            propertyName: key.type === "Identifier" && !node.computed ? key.name : `[${this.input.slice(this.offsetToSourcePos(key.start), this.offsetToSourcePos(key.end))}]`
          });
        }
        return super.parseClassProperty(node);
      }
      parseClassPrivateProperty(node) {
        if (node.abstract) {
          this.raise(TSErrors.PrivateElementHasAbstract, node);
        }
        if (node.accessibility) {
          this.raise(TSErrors.PrivateElementHasAccessibility, node, {
            modifier: node.accessibility
          });
        }
        this.parseClassPropertyAnnotation(node);
        return super.parseClassPrivateProperty(node);
      }
      parseClassAccessorProperty(node) {
        this.parseClassPropertyAnnotation(node);
        if (node.optional) {
          this.raise(TSErrors.AccessorCannotBeOptional, node);
        }
        return super.parseClassAccessorProperty(node);
      }
      pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) {
        const typeParameters = this.tsTryParseTypeParameters(this.tsParseConstModifier);
        if (typeParameters && isConstructor) {
          this.raise(TSErrors.ConstructorHasTypeParameters, typeParameters);
        }
        const {
          declare: declare2 = false,
          kind
        } = method;
        if (declare2 && (kind === "get" || kind === "set")) {
          this.raise(TSErrors.DeclareAccessor, method, {
            kind
          });
        }
        if (typeParameters) method.typeParameters = typeParameters;
        super.pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper);
      }
      pushClassPrivateMethod(classBody, method, isGenerator, isAsync) {
        const typeParameters = this.tsTryParseTypeParameters(this.tsParseConstModifier);
        if (typeParameters) method.typeParameters = typeParameters;
        super.pushClassPrivateMethod(classBody, method, isGenerator, isAsync);
      }
      declareClassPrivateMethodInScope(node, kind) {
        if (node.type === "TSDeclareMethod") return;
        if (node.type === "MethodDefinition" && node.value.body == null) {
          return;
        }
        super.declareClassPrivateMethodInScope(node, kind);
      }
      parseClassSuper(node) {
        super.parseClassSuper(node);
        if (node.superClass) {
          if (node.superClass.type === "TSInstantiationExpression") {
            const tsInstantiationExpression = node.superClass;
            const superClass2 = tsInstantiationExpression.expression;
            this.takeSurroundingComments(superClass2, superClass2.start, superClass2.end);
            const superTypeArguments = tsInstantiationExpression.typeParameters;
            this.takeSurroundingComments(superTypeArguments, superTypeArguments.start, superTypeArguments.end);
            node.superClass = superClass2;
            node.superTypeParameters = superTypeArguments;
          } else if (this.match(47) || this.match(51)) {
            node.superTypeParameters = this.tsParseTypeArgumentsInExpression();
          }
        }
        if (this.eatContextual(113)) {
          node.implements = this.tsParseHeritageClause("implements");
        }
      }
      parseObjPropValue(prop, startLoc, isGenerator, isAsync, isPattern, isAccessor, refExpressionErrors) {
        const typeParameters = this.tsTryParseTypeParameters(this.tsParseConstModifier);
        if (typeParameters) prop.typeParameters = typeParameters;
        return super.parseObjPropValue(prop, startLoc, isGenerator, isAsync, isPattern, isAccessor, refExpressionErrors);
      }
      parseFunctionParams(node, isConstructor) {
        const typeParameters = this.tsTryParseTypeParameters(this.tsParseConstModifier);
        if (typeParameters) node.typeParameters = typeParameters;
        super.parseFunctionParams(node, isConstructor);
      }
      parseVarId(decl, kind) {
        super.parseVarId(decl, kind);
        if (decl.id.type === "Identifier" && !this.hasPrecedingLineBreak() && this.eat(35)) {
          decl.definite = true;
        }
        const type = this.tsTryParseTypeAnnotation();
        if (type) {
          decl.id.typeAnnotation = type;
          this.resetEndLocation(decl.id);
        }
      }
      parseAsyncArrowFromCallExpression(node, call) {
        if (this.match(14)) {
          node.returnType = this.tsParseTypeAnnotation();
        }
        return super.parseAsyncArrowFromCallExpression(node, call);
      }
      parseMaybeAssign(refExpressionErrors, afterLeftParse) {
        var _jsx, _jsx2, _typeCast, _jsx3, _typeCast2;
        let state;
        let jsx2;
        let typeCast;
        if (this.hasPlugin("jsx") && (this.match(143) || this.match(47))) {
          state = this.state.clone();
          jsx2 = this.tryParse(() => super.parseMaybeAssign(refExpressionErrors, afterLeftParse), state);
          if (!jsx2.error) return jsx2.node;
          const {
            context
          } = this.state;
          const currentContext = context[context.length - 1];
          if (currentContext === types2.j_oTag || currentContext === types2.j_expr) {
            context.pop();
          }
        }
        if (!((_jsx = jsx2) != null && _jsx.error) && !this.match(47)) {
          return super.parseMaybeAssign(refExpressionErrors, afterLeftParse);
        }
        if (!state || state === this.state) state = this.state.clone();
        let typeParameters;
        const arrow = this.tryParse((abort) => {
          var _expr$extra, _typeParameters;
          typeParameters = this.tsParseTypeParameters(this.tsParseConstModifier);
          const expr = super.parseMaybeAssign(refExpressionErrors, afterLeftParse);
          if (expr.type !== "ArrowFunctionExpression" || (_expr$extra = expr.extra) != null && _expr$extra.parenthesized) {
            abort();
          }
          if (((_typeParameters = typeParameters) == null ? void 0 : _typeParameters.params.length) !== 0) {
            this.resetStartLocationFromNode(expr, typeParameters);
          }
          expr.typeParameters = typeParameters;
          return expr;
        }, state);
        if (!arrow.error && !arrow.aborted) {
          if (typeParameters) this.reportReservedArrowTypeParam(typeParameters);
          return arrow.node;
        }
        if (!jsx2) {
          assert(!this.hasPlugin("jsx"));
          typeCast = this.tryParse(() => super.parseMaybeAssign(refExpressionErrors, afterLeftParse), state);
          if (!typeCast.error) return typeCast.node;
        }
        if ((_jsx2 = jsx2) != null && _jsx2.node) {
          this.state = jsx2.failState;
          return jsx2.node;
        }
        if (arrow.node) {
          this.state = arrow.failState;
          if (typeParameters) this.reportReservedArrowTypeParam(typeParameters);
          return arrow.node;
        }
        if ((_typeCast = typeCast) != null && _typeCast.node) {
          this.state = typeCast.failState;
          return typeCast.node;
        }
        throw ((_jsx3 = jsx2) == null ? void 0 : _jsx3.error) || arrow.error || ((_typeCast2 = typeCast) == null ? void 0 : _typeCast2.error);
      }
      reportReservedArrowTypeParam(node) {
        var _node$extra2;
        if (node.params.length === 1 && !node.params[0].constraint && !((_node$extra2 = node.extra) != null && _node$extra2.trailingComma) && this.getPluginOption("typescript", "disallowAmbiguousJSXLike")) {
          this.raise(TSErrors.ReservedArrowTypeParam, node);
        }
      }
      parseMaybeUnary(refExpressionErrors, sawUnary) {
        if (!this.hasPlugin("jsx") && this.match(47)) {
          return this.tsParseTypeAssertion();
        }
        return super.parseMaybeUnary(refExpressionErrors, sawUnary);
      }
      parseArrow(node) {
        if (this.match(14)) {
          const result = this.tryParse((abort) => {
            const returnType = this.tsParseTypeOrTypePredicateAnnotation(14);
            if (this.canInsertSemicolon() || !this.match(19)) abort();
            return returnType;
          });
          if (result.aborted) return;
          if (!result.thrown) {
            if (result.error) this.state = result.failState;
            node.returnType = result.node;
          }
        }
        return super.parseArrow(node);
      }
      parseFunctionParamType(param) {
        if (this.eat(17)) {
          param.optional = true;
        }
        const type = this.tsTryParseTypeAnnotation();
        if (type) param.typeAnnotation = type;
        this.resetEndLocation(param);
        return param;
      }
      isAssignable(node, isBinding) {
        switch (node.type) {
          case "TSTypeCastExpression":
            return this.isAssignable(node.expression, isBinding);
          case "TSParameterProperty":
            return true;
          default:
            return super.isAssignable(node, isBinding);
        }
      }
      toAssignable(node, isLHS = false) {
        switch (node.type) {
          case "ParenthesizedExpression":
            this.toAssignableParenthesizedExpression(node, isLHS);
            break;
          case "TSAsExpression":
          case "TSSatisfiesExpression":
          case "TSNonNullExpression":
          case "TSTypeAssertion":
            if (isLHS) {
              this.expressionScope.recordArrowParameterBindingError(TSErrors.UnexpectedTypeCastInParameter, node);
            } else {
              this.raise(TSErrors.UnexpectedTypeCastInParameter, node);
            }
            this.toAssignable(node.expression, isLHS);
            break;
          case "AssignmentExpression":
            if (!isLHS && node.left.type === "TSTypeCastExpression") {
              node.left = this.typeCastToParameter(node.left);
            }
          default:
            super.toAssignable(node, isLHS);
        }
      }
      toAssignableParenthesizedExpression(node, isLHS) {
        switch (node.expression.type) {
          case "TSAsExpression":
          case "TSSatisfiesExpression":
          case "TSNonNullExpression":
          case "TSTypeAssertion":
          case "ParenthesizedExpression":
            this.toAssignable(node.expression, isLHS);
            break;
          default:
            super.toAssignable(node, isLHS);
        }
      }
      checkToRestConversion(node, allowPattern) {
        switch (node.type) {
          case "TSAsExpression":
          case "TSSatisfiesExpression":
          case "TSTypeAssertion":
          case "TSNonNullExpression":
            this.checkToRestConversion(node.expression, false);
            break;
          default:
            super.checkToRestConversion(node, allowPattern);
        }
      }
      isValidLVal(type, disallowCallExpression, isUnparenthesizedInAssign, binding) {
        switch (type) {
          case "TSTypeCastExpression":
            return true;
          case "TSParameterProperty":
            return "parameter";
          case "TSNonNullExpression":
            return "expression";
          case "TSAsExpression":
          case "TSSatisfiesExpression":
          case "TSTypeAssertion":
            return (binding !== 64 || !isUnparenthesizedInAssign) && ["expression", true];
          default:
            return super.isValidLVal(type, disallowCallExpression, isUnparenthesizedInAssign, binding);
        }
      }
      parseBindingAtom() {
        if (this.state.type === 78) {
          return this.parseIdentifier(true);
        }
        return super.parseBindingAtom();
      }
      parseMaybeDecoratorArguments(expr, startLoc) {
        if (this.match(47) || this.match(51)) {
          const typeArguments = this.tsParseTypeArgumentsInExpression();
          if (this.match(10)) {
            const call = super.parseMaybeDecoratorArguments(expr, startLoc);
            call.typeParameters = typeArguments;
            return call;
          }
          this.unexpected(null, 10);
        }
        return super.parseMaybeDecoratorArguments(expr, startLoc);
      }
      checkCommaAfterRest(close) {
        if (this.state.isAmbientContext && this.match(12) && this.lookaheadCharCode() === close) {
          this.next();
          return false;
        }
        return super.checkCommaAfterRest(close);
      }
      isClassMethod() {
        return this.match(47) || super.isClassMethod();
      }
      isClassProperty() {
        return this.match(35) || this.match(14) || super.isClassProperty();
      }
      parseMaybeDefault(startLoc, left) {
        const node = super.parseMaybeDefault(startLoc, left);
        if (node.type === "AssignmentPattern" && node.typeAnnotation && node.right.start < node.typeAnnotation.start) {
          this.raise(TSErrors.TypeAnnotationAfterAssign, node.typeAnnotation);
        }
        return node;
      }
      getTokenFromCode(code2) {
        if (this.state.inType) {
          if (code2 === 62) {
            this.finishOp(48, 1);
            return;
          }
          if (code2 === 60) {
            this.finishOp(47, 1);
            return;
          }
        }
        super.getTokenFromCode(code2);
      }
      reScan_lt_gt() {
        const {
          type
        } = this.state;
        if (type === 47) {
          this.state.pos -= 1;
          this.readToken_lt();
        } else if (type === 48) {
          this.state.pos -= 1;
          this.readToken_gt();
        }
      }
      reScan_lt() {
        const {
          type
        } = this.state;
        if (type === 51) {
          this.state.pos -= 2;
          this.finishOp(47, 1);
          return 47;
        }
        return type;
      }
      toAssignableListItem(exprList, index, isLHS) {
        const node = exprList[index];
        if (node.type === "TSTypeCastExpression") {
          exprList[index] = this.typeCastToParameter(node);
        }
        super.toAssignableListItem(exprList, index, isLHS);
      }
      typeCastToParameter(node) {
        node.expression.typeAnnotation = node.typeAnnotation;
        this.resetEndLocation(node.expression, node.typeAnnotation.loc.end);
        return node.expression;
      }
      shouldParseArrow(params) {
        if (this.match(14)) {
          return params.every((expr) => this.isAssignable(expr, true));
        }
        return super.shouldParseArrow(params);
      }
      shouldParseAsyncArrow() {
        return this.match(14) || super.shouldParseAsyncArrow();
      }
      canHaveLeadingDecorator() {
        return super.canHaveLeadingDecorator() || this.isAbstractClass();
      }
      jsxParseOpeningElementAfterName(node) {
        if (this.match(47) || this.match(51)) {
          const typeArguments = this.tsTryParseAndCatch(() => this.tsParseTypeArgumentsInExpression());
          if (typeArguments) {
            node.typeParameters = typeArguments;
          }
        }
        return super.jsxParseOpeningElementAfterName(node);
      }
      getGetterSetterExpectedParamCount(method) {
        const baseCount = super.getGetterSetterExpectedParamCount(method);
        const params = this.getObjectOrClassMethodParams(method);
        const firstParam = params[0];
        const hasContextParam = firstParam && this.isThisParam(firstParam);
        return hasContextParam ? baseCount + 1 : baseCount;
      }
      parseCatchClauseParam() {
        const param = super.parseCatchClauseParam();
        const type = this.tsTryParseTypeAnnotation();
        if (type) {
          param.typeAnnotation = type;
          this.resetEndLocation(param);
        }
        return param;
      }
      tsInAmbientContext(cb) {
        const {
          isAmbientContext: oldIsAmbientContext,
          strict: oldStrict
        } = this.state;
        this.state.isAmbientContext = true;
        this.state.strict = false;
        try {
          return cb();
        } finally {
          this.state.isAmbientContext = oldIsAmbientContext;
          this.state.strict = oldStrict;
        }
      }
      parseClass(node, isStatement, optionalId) {
        const oldInAbstractClass = this.state.inAbstractClass;
        this.state.inAbstractClass = !!node.abstract;
        try {
          return super.parseClass(node, isStatement, optionalId);
        } finally {
          this.state.inAbstractClass = oldInAbstractClass;
        }
      }
      tsParseAbstractDeclaration(node, decorators) {
        if (this.match(80)) {
          node.abstract = true;
          return this.maybeTakeDecorators(decorators, this.parseClass(node, true, false));
        } else if (this.isContextual(129)) {
          if (!this.hasFollowingLineBreak()) {
            node.abstract = true;
            this.raise(TSErrors.NonClassMethodPropertyHasAbstractModifier, node);
            return this.tsParseInterfaceDeclaration(node);
          } else {
            return null;
          }
        }
        throw this.unexpected(null, 80);
      }
      parseMethod(node, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope) {
        const method = super.parseMethod(node, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope);
        if (method.abstract || method.type === "TSAbstractMethodDefinition") {
          const hasEstreePlugin = this.hasPlugin("estree");
          const methodFn = hasEstreePlugin ? method.value : method;
          if (methodFn.body) {
            const {
              key
            } = method;
            this.raise(TSErrors.AbstractMethodHasImplementation, method, {
              methodName: key.type === "Identifier" && !method.computed ? key.name : `[${this.input.slice(this.offsetToSourcePos(key.start), this.offsetToSourcePos(key.end))}]`
            });
          }
        }
        return method;
      }
      tsParseTypeParameterName() {
        const typeName = this.parseIdentifier();
        return typeName.name;
      }
      shouldParseAsAmbientContext() {
        return !!this.getPluginOption("typescript", "dts");
      }
      parse() {
        if (this.shouldParseAsAmbientContext()) {
          this.state.isAmbientContext = true;
        }
        return super.parse();
      }
      getExpression() {
        if (this.shouldParseAsAmbientContext()) {
          this.state.isAmbientContext = true;
        }
        return super.getExpression();
      }
      parseExportSpecifier(node, isString, isInTypeExport, isMaybeTypeOnly) {
        if (!isString && isMaybeTypeOnly) {
          this.parseTypeOnlyImportExportSpecifier(node, false, isInTypeExport);
          return this.finishNode(node, "ExportSpecifier");
        }
        node.exportKind = "value";
        return super.parseExportSpecifier(node, isString, isInTypeExport, isMaybeTypeOnly);
      }
      parseImportSpecifier(specifier, importedIsString, isInTypeOnlyImport, isMaybeTypeOnly, bindingType) {
        if (!importedIsString && isMaybeTypeOnly) {
          this.parseTypeOnlyImportExportSpecifier(specifier, true, isInTypeOnlyImport);
          return this.finishNode(specifier, "ImportSpecifier");
        }
        specifier.importKind = "value";
        return super.parseImportSpecifier(specifier, importedIsString, isInTypeOnlyImport, isMaybeTypeOnly, isInTypeOnlyImport ? 4098 : 4096);
      }
      parseTypeOnlyImportExportSpecifier(node, isImport, isInTypeOnlyImportExport) {
        const leftOfAsKey = isImport ? "imported" : "local";
        const rightOfAsKey = isImport ? "local" : "exported";
        let leftOfAs = node[leftOfAsKey];
        let rightOfAs;
        let hasTypeSpecifier = false;
        let canParseAsKeyword = true;
        const loc = leftOfAs.loc.start;
        if (this.isContextual(93)) {
          const firstAs = this.parseIdentifier();
          if (this.isContextual(93)) {
            const secondAs = this.parseIdentifier();
            if (tokenIsKeywordOrIdentifier(this.state.type)) {
              hasTypeSpecifier = true;
              leftOfAs = firstAs;
              rightOfAs = isImport ? this.parseIdentifier() : this.parseModuleExportName();
              canParseAsKeyword = false;
            } else {
              rightOfAs = secondAs;
              canParseAsKeyword = false;
            }
          } else if (tokenIsKeywordOrIdentifier(this.state.type)) {
            canParseAsKeyword = false;
            rightOfAs = isImport ? this.parseIdentifier() : this.parseModuleExportName();
          } else {
            hasTypeSpecifier = true;
            leftOfAs = firstAs;
          }
        } else if (tokenIsKeywordOrIdentifier(this.state.type)) {
          hasTypeSpecifier = true;
          if (isImport) {
            leftOfAs = this.parseIdentifier(true);
            if (!this.isContextual(93)) {
              this.checkReservedWord(leftOfAs.name, leftOfAs.loc.start, true, true);
            }
          } else {
            leftOfAs = this.parseModuleExportName();
          }
        }
        if (hasTypeSpecifier && isInTypeOnlyImportExport) {
          this.raise(isImport ? TSErrors.TypeModifierIsUsedInTypeImports : TSErrors.TypeModifierIsUsedInTypeExports, loc);
        }
        node[leftOfAsKey] = leftOfAs;
        node[rightOfAsKey] = rightOfAs;
        const kindKey = isImport ? "importKind" : "exportKind";
        node[kindKey] = hasTypeSpecifier ? "type" : "value";
        if (canParseAsKeyword && this.eatContextual(93)) {
          node[rightOfAsKey] = isImport ? this.parseIdentifier() : this.parseModuleExportName();
        }
        if (!node[rightOfAsKey]) {
          node[rightOfAsKey] = this.cloneIdentifier(node[leftOfAsKey]);
        }
        if (isImport) {
          this.checkIdentifier(node[rightOfAsKey], hasTypeSpecifier ? 4098 : 4096);
        }
      }
      fillOptionalPropertiesForTSESLint(node) {
        var _node$directive, _node$decorators, _node$optional, _node$typeAnnotation, _node$accessibility, _node$decorators2, _node$override, _node$readonly, _node$static, _node$declare, _node$returnType, _node$typeParameters, _node$optional2, _node$optional3, _node$accessibility2, _node$readonly2, _node$static2, _node$declare2, _node$definite, _node$readonly3, _node$typeAnnotation2, _node$accessibility3, _node$decorators3, _node$override2, _node$optional4, _node$id, _node$abstract, _node$declare3, _node$decorators4, _node$implements, _node$superTypeArgume, _node$typeParameters2, _node$declare4, _node$definite2, _node$const, _node$declare5, _node$computed, _node$qualifier, _node$options, _node$declare6, _node$extends, _node$optional5, _node$readonly4, _node$declare7, _node$global, _node$const2, _node$in, _node$out;
        switch (node.type) {
          case "ExpressionStatement":
            (_node$directive = node.directive) != null ? _node$directive : node.directive = void 0;
            return;
          case "RestElement":
            node.value = void 0;
          case "Identifier":
          case "ArrayPattern":
          case "AssignmentPattern":
          case "ObjectPattern":
            (_node$decorators = node.decorators) != null ? _node$decorators : node.decorators = [];
            (_node$optional = node.optional) != null ? _node$optional : node.optional = false;
            (_node$typeAnnotation = node.typeAnnotation) != null ? _node$typeAnnotation : node.typeAnnotation = void 0;
            return;
          case "TSParameterProperty":
            (_node$accessibility = node.accessibility) != null ? _node$accessibility : node.accessibility = void 0;
            (_node$decorators2 = node.decorators) != null ? _node$decorators2 : node.decorators = [];
            (_node$override = node.override) != null ? _node$override : node.override = false;
            (_node$readonly = node.readonly) != null ? _node$readonly : node.readonly = false;
            (_node$static = node.static) != null ? _node$static : node.static = false;
            return;
          case "TSEmptyBodyFunctionExpression":
            node.body = null;
          case "TSDeclareFunction":
          case "FunctionDeclaration":
          case "FunctionExpression":
          case "ClassMethod":
          case "ClassPrivateMethod":
            (_node$declare = node.declare) != null ? _node$declare : node.declare = false;
            (_node$returnType = node.returnType) != null ? _node$returnType : node.returnType = void 0;
            (_node$typeParameters = node.typeParameters) != null ? _node$typeParameters : node.typeParameters = void 0;
            return;
          case "Property":
            (_node$optional2 = node.optional) != null ? _node$optional2 : node.optional = false;
            return;
          case "TSMethodSignature":
          case "TSPropertySignature":
            (_node$optional3 = node.optional) != null ? _node$optional3 : node.optional = false;
          case "TSIndexSignature":
            (_node$accessibility2 = node.accessibility) != null ? _node$accessibility2 : node.accessibility = void 0;
            (_node$readonly2 = node.readonly) != null ? _node$readonly2 : node.readonly = false;
            (_node$static2 = node.static) != null ? _node$static2 : node.static = false;
            return;
          case "TSAbstractPropertyDefinition":
          case "PropertyDefinition":
          case "TSAbstractAccessorProperty":
          case "AccessorProperty":
            (_node$declare2 = node.declare) != null ? _node$declare2 : node.declare = false;
            (_node$definite = node.definite) != null ? _node$definite : node.definite = false;
            (_node$readonly3 = node.readonly) != null ? _node$readonly3 : node.readonly = false;
            (_node$typeAnnotation2 = node.typeAnnotation) != null ? _node$typeAnnotation2 : node.typeAnnotation = void 0;
          case "TSAbstractMethodDefinition":
          case "MethodDefinition":
            (_node$accessibility3 = node.accessibility) != null ? _node$accessibility3 : node.accessibility = void 0;
            (_node$decorators3 = node.decorators) != null ? _node$decorators3 : node.decorators = [];
            (_node$override2 = node.override) != null ? _node$override2 : node.override = false;
            (_node$optional4 = node.optional) != null ? _node$optional4 : node.optional = false;
            return;
          case "ClassExpression":
            (_node$id = node.id) != null ? _node$id : node.id = null;
          case "ClassDeclaration":
            (_node$abstract = node.abstract) != null ? _node$abstract : node.abstract = false;
            (_node$declare3 = node.declare) != null ? _node$declare3 : node.declare = false;
            (_node$decorators4 = node.decorators) != null ? _node$decorators4 : node.decorators = [];
            (_node$implements = node.implements) != null ? _node$implements : node.implements = [];
            (_node$superTypeArgume = node.superTypeArguments) != null ? _node$superTypeArgume : node.superTypeArguments = void 0;
            (_node$typeParameters2 = node.typeParameters) != null ? _node$typeParameters2 : node.typeParameters = void 0;
            return;
          case "TSTypeAliasDeclaration":
          case "VariableDeclaration":
            (_node$declare4 = node.declare) != null ? _node$declare4 : node.declare = false;
            return;
          case "VariableDeclarator":
            (_node$definite2 = node.definite) != null ? _node$definite2 : node.definite = false;
            return;
          case "TSEnumDeclaration":
            (_node$const = node.const) != null ? _node$const : node.const = false;
            (_node$declare5 = node.declare) != null ? _node$declare5 : node.declare = false;
            return;
          case "TSEnumMember":
            (_node$computed = node.computed) != null ? _node$computed : node.computed = false;
            return;
          case "TSImportType":
            (_node$qualifier = node.qualifier) != null ? _node$qualifier : node.qualifier = null;
            (_node$options = node.options) != null ? _node$options : node.options = null;
            return;
          case "TSInterfaceDeclaration":
            (_node$declare6 = node.declare) != null ? _node$declare6 : node.declare = false;
            (_node$extends = node.extends) != null ? _node$extends : node.extends = [];
            return;
          case "TSMappedType":
            (_node$optional5 = node.optional) != null ? _node$optional5 : node.optional = false;
            (_node$readonly4 = node.readonly) != null ? _node$readonly4 : node.readonly = void 0;
            return;
          case "TSModuleDeclaration":
            (_node$declare7 = node.declare) != null ? _node$declare7 : node.declare = false;
            (_node$global = node.global) != null ? _node$global : node.global = node.kind === "global";
            return;
          case "TSTypeParameter":
            (_node$const2 = node.const) != null ? _node$const2 : node.const = false;
            (_node$in = node.in) != null ? _node$in : node.in = false;
            (_node$out = node.out) != null ? _node$out : node.out = false;
            return;
        }
      }
      chStartsBindingIdentifierAndNotRelationalOperator(ch, pos) {
        if (isIdentifierStart(ch)) {
          keywordAndTSRelationalOperator.lastIndex = pos;
          if (keywordAndTSRelationalOperator.test(this.input)) {
            const endCh = this.codePointAtPos(keywordAndTSRelationalOperator.lastIndex);
            if (!isIdentifierChar(endCh) && endCh !== 92) {
              return false;
            }
          }
          return true;
        } else if (ch === 92) {
          return true;
        } else {
          return false;
        }
      }
      nextTokenIsIdentifierAndNotTSRelationalOperatorOnSameLine() {
        const next = this.nextTokenInLineStart();
        const nextCh = this.codePointAtPos(next);
        return this.chStartsBindingIdentifierAndNotRelationalOperator(nextCh, next);
      }
      nextTokenIsIdentifierOrStringLiteralOnSameLine() {
        const next = this.nextTokenInLineStart();
        const nextCh = this.codePointAtPos(next);
        return this.chStartsBindingIdentifier(nextCh, next) || nextCh === 34 || nextCh === 39;
      }
    };
    function isPossiblyLiteralEnum(expression) {
      if (expression.type !== "MemberExpression") return false;
      const {
        computed,
        property
      } = expression;
      if (computed && property.type !== "StringLiteral" && (property.type !== "TemplateLiteral" || property.expressions.length > 0)) {
        return false;
      }
      return isUncomputedMemberExpressionChain(expression.object);
    }
    function isValidAmbientConstInitializer(expression, estree2) {
      var _expression$extra;
      const {
        type
      } = expression;
      if ((_expression$extra = expression.extra) != null && _expression$extra.parenthesized) {
        return false;
      }
      if (estree2) {
        if (type === "Literal") {
          const {
            value: value2
          } = expression;
          if (typeof value2 === "string" || typeof value2 === "boolean") {
            return true;
          }
        }
      } else {
        if (type === "StringLiteral" || type === "BooleanLiteral") {
          return true;
        }
      }
      if (isNumber(expression, estree2) || isNegativeNumber(expression, estree2)) {
        return true;
      }
      if (type === "TemplateLiteral" && expression.expressions.length === 0) {
        return true;
      }
      if (isPossiblyLiteralEnum(expression)) {
        return true;
      }
      return false;
    }
    function isNumber(expression, estree2) {
      if (estree2) {
        return expression.type === "Literal" && (typeof expression.value === "number" || "bigint" in expression);
      }
      return expression.type === "NumericLiteral" || expression.type === "BigIntLiteral";
    }
    function isNegativeNumber(expression, estree2) {
      if (expression.type === "UnaryExpression") {
        const {
          operator,
          argument
        } = expression;
        if (operator === "-" && isNumber(argument, estree2)) {
          return true;
        }
      }
      return false;
    }
    function isUncomputedMemberExpressionChain(expression) {
      if (expression.type === "Identifier") return true;
      if (expression.type !== "MemberExpression" || expression.computed) {
        return false;
      }
      return isUncomputedMemberExpressionChain(expression.object);
    }
    var PlaceholderErrors = ParseErrorEnum`placeholders`({
      ClassNameIsRequired: "A class name is required.",
      UnexpectedSpace: "Unexpected space in placeholder."
    });
    var placeholders = (superClass) => class PlaceholdersParserMixin extends superClass {
      parsePlaceholder(expectedNode) {
        if (this.match(133)) {
          const node = this.startNode();
          this.next();
          this.assertNoSpace();
          node.name = super.parseIdentifier(true);
          this.assertNoSpace();
          this.expect(133);
          return this.finishPlaceholder(node, expectedNode);
        }
      }
      finishPlaceholder(node, expectedNode) {
        let placeholder = node;
        if (!placeholder.expectedNode || !placeholder.type) {
          placeholder = this.finishNode(placeholder, "Placeholder");
        }
        placeholder.expectedNode = expectedNode;
        return placeholder;
      }
      getTokenFromCode(code2) {
        if (code2 === 37 && this.input.charCodeAt(this.state.pos + 1) === 37) {
          this.finishOp(133, 2);
        } else {
          super.getTokenFromCode(code2);
        }
      }
      parseExprAtom(refExpressionErrors) {
        return this.parsePlaceholder("Expression") || super.parseExprAtom(refExpressionErrors);
      }
      parseIdentifier(liberal) {
        return this.parsePlaceholder("Identifier") || super.parseIdentifier(liberal);
      }
      checkReservedWord(word, startLoc, checkKeywords, isBinding) {
        if (word !== void 0) {
          super.checkReservedWord(word, startLoc, checkKeywords, isBinding);
        }
      }
      cloneIdentifier(node) {
        const cloned = super.cloneIdentifier(node);
        if (cloned.type === "Placeholder") {
          cloned.expectedNode = node.expectedNode;
        }
        return cloned;
      }
      cloneStringLiteral(node) {
        if (node.type === "Placeholder") {
          return this.cloneIdentifier(node);
        }
        return super.cloneStringLiteral(node);
      }
      parseBindingAtom() {
        return this.parsePlaceholder("Pattern") || super.parseBindingAtom();
      }
      isValidLVal(type, disallowCallExpression, isParenthesized, binding) {
        return type === "Placeholder" || super.isValidLVal(type, disallowCallExpression, isParenthesized, binding);
      }
      toAssignable(node, isLHS) {
        if (node && node.type === "Placeholder" && node.expectedNode === "Expression") {
          node.expectedNode = "Pattern";
        } else {
          super.toAssignable(node, isLHS);
        }
      }
      chStartsBindingIdentifier(ch, pos) {
        if (super.chStartsBindingIdentifier(ch, pos)) {
          return true;
        }
        const next = this.nextTokenStart();
        if (this.input.charCodeAt(next) === 37 && this.input.charCodeAt(next + 1) === 37) {
          return true;
        }
        return false;
      }
      verifyBreakContinue(node, isBreak) {
        var _node$label;
        if (((_node$label = node.label) == null ? void 0 : _node$label.type) === "Placeholder") return;
        super.verifyBreakContinue(node, isBreak);
      }
      parseExpressionStatement(node, expr) {
        var _expr$extra;
        if (expr.type !== "Placeholder" || (_expr$extra = expr.extra) != null && _expr$extra.parenthesized) {
          return super.parseExpressionStatement(node, expr);
        }
        if (this.match(14)) {
          const stmt = node;
          stmt.label = this.finishPlaceholder(expr, "Identifier");
          this.next();
          stmt.body = super.parseStatementOrSloppyAnnexBFunctionDeclaration();
          return this.finishNode(stmt, "LabeledStatement");
        }
        this.semicolon();
        const stmtPlaceholder = node;
        stmtPlaceholder.name = expr.name;
        return this.finishPlaceholder(stmtPlaceholder, "Statement");
      }
      parseBlock(allowDirectives, createNewLexicalScope, afterBlockParse) {
        return this.parsePlaceholder("BlockStatement") || super.parseBlock(allowDirectives, createNewLexicalScope, afterBlockParse);
      }
      parseFunctionId(requireId) {
        return this.parsePlaceholder("Identifier") || super.parseFunctionId(requireId);
      }
      parseClass(node, isStatement, optionalId) {
        const type = isStatement ? "ClassDeclaration" : "ClassExpression";
        this.next();
        const oldStrict = this.state.strict;
        const placeholder = this.parsePlaceholder("Identifier");
        if (placeholder) {
          if (this.match(81) || this.match(133) || this.match(5)) {
            node.id = placeholder;
          } else if (optionalId || !isStatement) {
            node.id = null;
            node.body = this.finishPlaceholder(placeholder, "ClassBody");
            return this.finishNode(node, type);
          } else {
            throw this.raise(PlaceholderErrors.ClassNameIsRequired, this.state.startLoc);
          }
        } else {
          this.parseClassId(node, isStatement, optionalId);
        }
        super.parseClassSuper(node);
        node.body = this.parsePlaceholder("ClassBody") || super.parseClassBody(!!node.superClass, oldStrict);
        return this.finishNode(node, type);
      }
      parseExport(node, decorators) {
        const placeholder = this.parsePlaceholder("Identifier");
        if (!placeholder) return super.parseExport(node, decorators);
        const node2 = node;
        if (!this.isContextual(98) && !this.match(12)) {
          node2.specifiers = [];
          node2.source = null;
          node2.declaration = this.finishPlaceholder(placeholder, "Declaration");
          return this.finishNode(node2, "ExportNamedDeclaration");
        }
        this.expectPlugin("exportDefaultFrom");
        const specifier = this.startNode();
        specifier.exported = placeholder;
        node2.specifiers = [this.finishNode(specifier, "ExportDefaultSpecifier")];
        return super.parseExport(node2, decorators);
      }
      isExportDefaultSpecifier() {
        if (this.match(65)) {
          const next = this.nextTokenStart();
          if (this.isUnparsedContextual(next, "from")) {
            if (this.input.startsWith(tokenLabelName(133), this.nextTokenStartSince(next + 4))) {
              return true;
            }
          }
        }
        return super.isExportDefaultSpecifier();
      }
      maybeParseExportDefaultSpecifier(node, maybeDefaultIdentifier) {
        var _specifiers;
        if ((_specifiers = node.specifiers) != null && _specifiers.length) {
          return true;
        }
        return super.maybeParseExportDefaultSpecifier(node, maybeDefaultIdentifier);
      }
      checkExport(node) {
        const {
          specifiers
        } = node;
        if (specifiers != null && specifiers.length) {
          node.specifiers = specifiers.filter((node2) => node2.exported.type === "Placeholder");
        }
        super.checkExport(node);
        node.specifiers = specifiers;
      }
      parseImport(node) {
        const placeholder = this.parsePlaceholder("Identifier");
        if (!placeholder) return super.parseImport(node);
        node.specifiers = [];
        if (!this.isContextual(98) && !this.match(12)) {
          node.source = this.finishPlaceholder(placeholder, "StringLiteral");
          this.semicolon();
          return this.finishNode(node, "ImportDeclaration");
        }
        const specifier = this.startNodeAtNode(placeholder);
        specifier.local = placeholder;
        node.specifiers.push(this.finishNode(specifier, "ImportDefaultSpecifier"));
        if (this.eat(12)) {
          const hasStarImport = this.maybeParseStarImportSpecifier(node);
          if (!hasStarImport) this.parseNamedImportSpecifiers(node);
        }
        this.expectContextual(98);
        node.source = this.parseImportSource();
        this.semicolon();
        return this.finishNode(node, "ImportDeclaration");
      }
      parseImportSource() {
        return this.parsePlaceholder("StringLiteral") || super.parseImportSource();
      }
      assertNoSpace() {
        if (this.state.start > this.offsetToSourcePos(this.state.lastTokEndLoc.index)) {
          this.raise(PlaceholderErrors.UnexpectedSpace, this.state.lastTokEndLoc);
        }
      }
    };
    var v8intrinsic = (superClass) => class V8IntrinsicMixin extends superClass {
      parseV8Intrinsic() {
        if (this.match(54)) {
          const v8IntrinsicStartLoc = this.state.startLoc;
          const node = this.startNode();
          this.next();
          if (tokenIsIdentifier(this.state.type)) {
            const name = this.parseIdentifierName();
            const identifier = this.createIdentifier(node, name);
            this.castNodeTo(identifier, "V8IntrinsicIdentifier");
            if (this.match(10)) {
              return identifier;
            }
          }
          this.unexpected(v8IntrinsicStartLoc);
        }
      }
      parseExprAtom(refExpressionErrors) {
        return this.parseV8Intrinsic() || super.parseExprAtom(refExpressionErrors);
      }
    };
    var PIPELINE_PROPOSALS = ["minimal", "fsharp", "hack", "smart"];
    var TOPIC_TOKENS = ["^^", "@@", "^", "%", "#"];
    function validatePlugins(pluginsMap) {
      if (pluginsMap.has("decorators")) {
        if (pluginsMap.has("decorators-legacy")) {
          throw new Error("Cannot use the decorators and decorators-legacy plugin together");
        }
        const decoratorsBeforeExport = pluginsMap.get("decorators").decoratorsBeforeExport;
        if (decoratorsBeforeExport != null && typeof decoratorsBeforeExport !== "boolean") {
          throw new Error("'decoratorsBeforeExport' must be a boolean, if specified.");
        }
        const allowCallParenthesized = pluginsMap.get("decorators").allowCallParenthesized;
        if (allowCallParenthesized != null && typeof allowCallParenthesized !== "boolean") {
          throw new Error("'allowCallParenthesized' must be a boolean.");
        }
      }
      if (pluginsMap.has("flow") && pluginsMap.has("typescript")) {
        throw new Error("Cannot combine flow and typescript plugins.");
      }
      if (pluginsMap.has("placeholders") && pluginsMap.has("v8intrinsic")) {
        throw new Error("Cannot combine placeholders and v8intrinsic plugins.");
      }
      if (pluginsMap.has("pipelineOperator")) {
        var _pluginsMap$get2;
        const proposal = pluginsMap.get("pipelineOperator").proposal;
        if (!PIPELINE_PROPOSALS.includes(proposal)) {
          const proposalList = PIPELINE_PROPOSALS.map((p) => `"${p}"`).join(", ");
          throw new Error(`"pipelineOperator" requires "proposal" option whose value must be one of: ${proposalList}.`);
        }
        if (proposal === "hack") {
          var _pluginsMap$get;
          if (pluginsMap.has("placeholders")) {
            throw new Error("Cannot combine placeholders plugin and Hack-style pipes.");
          }
          if (pluginsMap.has("v8intrinsic")) {
            throw new Error("Cannot combine v8intrinsic plugin and Hack-style pipes.");
          }
          const topicToken = pluginsMap.get("pipelineOperator").topicToken;
          if (!TOPIC_TOKENS.includes(topicToken)) {
            const tokenList = TOPIC_TOKENS.map((t) => `"${t}"`).join(", ");
            throw new Error(`"pipelineOperator" in "proposal": "hack" mode also requires a "topicToken" option whose value must be one of: ${tokenList}.`);
          }
          if (topicToken === "#" && ((_pluginsMap$get = pluginsMap.get("recordAndTuple")) == null ? void 0 : _pluginsMap$get.syntaxType) === "hash") {
            throw new Error(`Plugin conflict between \`["pipelineOperator", { proposal: "hack", topicToken: "#" }]\` and \`${JSON.stringify(["recordAndTuple", pluginsMap.get("recordAndTuple")])}\`.`);
          }
        } else if (proposal === "smart" && ((_pluginsMap$get2 = pluginsMap.get("recordAndTuple")) == null ? void 0 : _pluginsMap$get2.syntaxType) === "hash") {
          throw new Error(`Plugin conflict between \`["pipelineOperator", { proposal: "smart" }]\` and \`${JSON.stringify(["recordAndTuple", pluginsMap.get("recordAndTuple")])}\`.`);
        }
      }
      if (pluginsMap.has("moduleAttributes")) {
        if (pluginsMap.has("deprecatedImportAssert") || pluginsMap.has("importAssertions")) {
          throw new Error("Cannot combine importAssertions, deprecatedImportAssert and moduleAttributes plugins.");
        }
        const moduleAttributesVersionPluginOption = pluginsMap.get("moduleAttributes").version;
        if (moduleAttributesVersionPluginOption !== "may-2020") {
          throw new Error("The 'moduleAttributes' plugin requires a 'version' option, representing the last proposal update. Currently, the only supported value is 'may-2020'.");
        }
      }
      if (pluginsMap.has("importAssertions")) {
        if (pluginsMap.has("deprecatedImportAssert")) {
          throw new Error("Cannot combine importAssertions and deprecatedImportAssert plugins.");
        }
      }
      if (pluginsMap.has("deprecatedImportAssert")) ;
      else if (pluginsMap.has("importAttributes") && pluginsMap.get("importAttributes").deprecatedAssertSyntax) {
        pluginsMap.set("deprecatedImportAssert", {});
      }
      if (pluginsMap.has("recordAndTuple")) {
        const syntaxType = pluginsMap.get("recordAndTuple").syntaxType;
        if (syntaxType != null) {
          const RECORD_AND_TUPLE_SYNTAX_TYPES = ["hash", "bar"];
          if (!RECORD_AND_TUPLE_SYNTAX_TYPES.includes(syntaxType)) {
            throw new Error("The 'syntaxType' option of the 'recordAndTuple' plugin must be one of: " + RECORD_AND_TUPLE_SYNTAX_TYPES.map((p) => `'${p}'`).join(", "));
          }
        }
      }
      if (pluginsMap.has("asyncDoExpressions") && !pluginsMap.has("doExpressions")) {
        const error = new Error("'asyncDoExpressions' requires 'doExpressions', please add 'doExpressions' to parser plugins.");
        error.missingPlugins = "doExpressions";
        throw error;
      }
      if (pluginsMap.has("optionalChainingAssign") && pluginsMap.get("optionalChainingAssign").version !== "2023-07") {
        throw new Error("The 'optionalChainingAssign' plugin requires a 'version' option, representing the last proposal update. Currently, the only supported value is '2023-07'.");
      }
      if (pluginsMap.has("discardBinding") && pluginsMap.get("discardBinding").syntaxType !== "void") {
        throw new Error("The 'discardBinding' plugin requires a 'syntaxType' option. Currently the only supported value is 'void'.");
      }
    }
    var mixinPlugins = {
      estree,
      jsx,
      flow,
      typescript,
      v8intrinsic,
      placeholders
    };
    var mixinPluginNames = Object.keys(mixinPlugins);
    var ExpressionParser = class extends LValParser {
      checkProto(prop, isRecord, sawProto, refExpressionErrors) {
        if (prop.type === "SpreadElement" || this.isObjectMethod(prop) || prop.computed || prop.shorthand) {
          return sawProto;
        }
        const key = prop.key;
        const name = key.type === "Identifier" ? key.name : key.value;
        if (name === "__proto__") {
          if (isRecord) {
            this.raise(Errors.RecordNoProto, key);
            return true;
          }
          if (sawProto) {
            if (refExpressionErrors) {
              if (refExpressionErrors.doubleProtoLoc === null) {
                refExpressionErrors.doubleProtoLoc = key.loc.start;
              }
            } else {
              this.raise(Errors.DuplicateProto, key);
            }
          }
          return true;
        }
        return sawProto;
      }
      shouldExitDescending(expr, potentialArrowAt) {
        return expr.type === "ArrowFunctionExpression" && this.offsetToSourcePos(expr.start) === potentialArrowAt;
      }
      getExpression() {
        this.enterInitialScopes();
        this.nextToken();
        if (this.match(140)) {
          throw this.raise(Errors.ParseExpressionEmptyInput, this.state.startLoc);
        }
        const expr = this.parseExpression();
        if (!this.match(140)) {
          throw this.raise(Errors.ParseExpressionExpectsEOF, this.state.startLoc, {
            unexpected: this.input.codePointAt(this.state.start)
          });
        }
        this.finalizeRemainingComments();
        expr.comments = this.comments;
        expr.errors = this.state.errors;
        if (this.optionFlags & 256) {
          expr.tokens = this.tokens;
        }
        return expr;
      }
      parseExpression(disallowIn, refExpressionErrors) {
        if (disallowIn) {
          return this.disallowInAnd(() => this.parseExpressionBase(refExpressionErrors));
        }
        return this.allowInAnd(() => this.parseExpressionBase(refExpressionErrors));
      }
      parseExpressionBase(refExpressionErrors) {
        const startLoc = this.state.startLoc;
        const expr = this.parseMaybeAssign(refExpressionErrors);
        if (this.match(12)) {
          const node = this.startNodeAt(startLoc);
          node.expressions = [expr];
          while (this.eat(12)) {
            node.expressions.push(this.parseMaybeAssign(refExpressionErrors));
          }
          this.toReferencedList(node.expressions);
          return this.finishNode(node, "SequenceExpression");
        }
        return expr;
      }
      parseMaybeAssignDisallowIn(refExpressionErrors, afterLeftParse) {
        return this.disallowInAnd(() => this.parseMaybeAssign(refExpressionErrors, afterLeftParse));
      }
      parseMaybeAssignAllowIn(refExpressionErrors, afterLeftParse) {
        return this.allowInAnd(() => this.parseMaybeAssign(refExpressionErrors, afterLeftParse));
      }
      setOptionalParametersError(refExpressionErrors) {
        refExpressionErrors.optionalParametersLoc = this.state.startLoc;
      }
      parseMaybeAssign(refExpressionErrors, afterLeftParse) {
        const startLoc = this.state.startLoc;
        const isYield = this.isContextual(108);
        if (isYield) {
          if (this.prodParam.hasYield) {
            this.next();
            let left2 = this.parseYield(startLoc);
            if (afterLeftParse) {
              left2 = afterLeftParse.call(this, left2, startLoc);
            }
            return left2;
          }
        }
        let ownExpressionErrors;
        if (refExpressionErrors) {
          ownExpressionErrors = false;
        } else {
          refExpressionErrors = new ExpressionErrors();
          ownExpressionErrors = true;
        }
        const {
          type
        } = this.state;
        if (type === 10 || tokenIsIdentifier(type)) {
          this.state.potentialArrowAt = this.state.start;
        }
        let left = this.parseMaybeConditional(refExpressionErrors);
        if (afterLeftParse) {
          left = afterLeftParse.call(this, left, startLoc);
        }
        if (tokenIsAssignment(this.state.type)) {
          const node = this.startNodeAt(startLoc);
          const operator = this.state.value;
          node.operator = operator;
          if (this.match(29)) {
            this.toAssignable(left, true);
            node.left = left;
            const startIndex = startLoc.index;
            if (refExpressionErrors.doubleProtoLoc != null && refExpressionErrors.doubleProtoLoc.index >= startIndex) {
              refExpressionErrors.doubleProtoLoc = null;
            }
            if (refExpressionErrors.shorthandAssignLoc != null && refExpressionErrors.shorthandAssignLoc.index >= startIndex) {
              refExpressionErrors.shorthandAssignLoc = null;
            }
            if (refExpressionErrors.privateKeyLoc != null && refExpressionErrors.privateKeyLoc.index >= startIndex) {
              this.checkDestructuringPrivate(refExpressionErrors);
              refExpressionErrors.privateKeyLoc = null;
            }
            if (refExpressionErrors.voidPatternLoc != null && refExpressionErrors.voidPatternLoc.index >= startIndex) {
              refExpressionErrors.voidPatternLoc = null;
            }
          } else {
            node.left = left;
          }
          this.next();
          node.right = this.parseMaybeAssign();
          this.checkLVal(left, this.finishNode(node, "AssignmentExpression"), void 0, void 0, void 0, void 0, operator === "||=" || operator === "&&=" || operator === "??=");
          return node;
        } else if (ownExpressionErrors) {
          this.checkExpressionErrors(refExpressionErrors, true);
        }
        if (isYield) {
          const {
            type: type2
          } = this.state;
          const startsExpr2 = this.hasPlugin("v8intrinsic") ? tokenCanStartExpression(type2) : tokenCanStartExpression(type2) && !this.match(54);
          if (startsExpr2 && !this.isAmbiguousPrefixOrIdentifier()) {
            this.raiseOverwrite(Errors.YieldNotInGeneratorFunction, startLoc);
            return this.parseYield(startLoc);
          }
        }
        return left;
      }
      parseMaybeConditional(refExpressionErrors) {
        const startLoc = this.state.startLoc;
        const potentialArrowAt = this.state.potentialArrowAt;
        const expr = this.parseExprOps(refExpressionErrors);
        if (this.shouldExitDescending(expr, potentialArrowAt)) {
          return expr;
        }
        return this.parseConditional(expr, startLoc, refExpressionErrors);
      }
      parseConditional(expr, startLoc, refExpressionErrors) {
        if (this.eat(17)) {
          const node = this.startNodeAt(startLoc);
          node.test = expr;
          node.consequent = this.parseMaybeAssignAllowIn();
          this.expect(14);
          node.alternate = this.parseMaybeAssign();
          return this.finishNode(node, "ConditionalExpression");
        }
        return expr;
      }
      parseMaybeUnaryOrPrivate(refExpressionErrors) {
        return this.match(139) ? this.parsePrivateName() : this.parseMaybeUnary(refExpressionErrors);
      }
      parseExprOps(refExpressionErrors) {
        const startLoc = this.state.startLoc;
        const potentialArrowAt = this.state.potentialArrowAt;
        const expr = this.parseMaybeUnaryOrPrivate(refExpressionErrors);
        if (this.shouldExitDescending(expr, potentialArrowAt)) {
          return expr;
        }
        return this.parseExprOp(expr, startLoc, -1);
      }
      parseExprOp(left, leftStartLoc, minPrec) {
        if (this.isPrivateName(left)) {
          const value2 = this.getPrivateNameSV(left);
          if (minPrec >= tokenOperatorPrecedence(58) || !this.prodParam.hasIn || !this.match(58)) {
            this.raise(Errors.PrivateInExpectedIn, left, {
              identifierName: value2
            });
          }
          this.classScope.usePrivateName(value2, left.loc.start);
        }
        const op = this.state.type;
        if (tokenIsOperator(op) && (this.prodParam.hasIn || !this.match(58))) {
          let prec = tokenOperatorPrecedence(op);
          if (prec > minPrec) {
            if (op === 39) {
              this.expectPlugin("pipelineOperator");
              if (this.state.inFSharpPipelineDirectBody) {
                return left;
              }
              this.checkPipelineAtInfixOperator(left, leftStartLoc);
            }
            const node = this.startNodeAt(leftStartLoc);
            node.left = left;
            node.operator = this.state.value;
            const logical = op === 41 || op === 42;
            const coalesce = op === 40;
            if (coalesce) {
              prec = tokenOperatorPrecedence(42);
            }
            this.next();
            if (op === 39 && this.hasPlugin(["pipelineOperator", {
              proposal: "minimal"
            }])) {
              if (this.state.type === 96 && this.prodParam.hasAwait) {
                throw this.raise(Errors.UnexpectedAwaitAfterPipelineBody, this.state.startLoc);
              }
            }
            node.right = this.parseExprOpRightExpr(op, prec);
            const finishedNode = this.finishNode(node, logical || coalesce ? "LogicalExpression" : "BinaryExpression");
            const nextOp = this.state.type;
            if (coalesce && (nextOp === 41 || nextOp === 42) || logical && nextOp === 40) {
              throw this.raise(Errors.MixingCoalesceWithLogical, this.state.startLoc);
            }
            return this.parseExprOp(finishedNode, leftStartLoc, minPrec);
          }
        }
        return left;
      }
      parseExprOpRightExpr(op, prec) {
        const startLoc = this.state.startLoc;
        switch (op) {
          case 39:
            switch (this.getPluginOption("pipelineOperator", "proposal")) {
              case "hack":
                return this.withTopicBindingContext(() => {
                  return this.parseHackPipeBody();
                });
              case "fsharp":
                return this.withSoloAwaitPermittingContext(() => {
                  return this.parseFSharpPipelineBody(prec);
                });
            }
            if (this.getPluginOption("pipelineOperator", "proposal") === "smart") {
              return this.withTopicBindingContext(() => {
                if (this.prodParam.hasYield && this.isContextual(108)) {
                  throw this.raise(Errors.PipeBodyIsTighter, this.state.startLoc);
                }
                return this.parseSmartPipelineBodyInStyle(this.parseExprOpBaseRightExpr(op, prec), startLoc);
              });
            }
          default:
            return this.parseExprOpBaseRightExpr(op, prec);
        }
      }
      parseExprOpBaseRightExpr(op, prec) {
        const startLoc = this.state.startLoc;
        return this.parseExprOp(this.parseMaybeUnaryOrPrivate(), startLoc, tokenIsRightAssociative(op) ? prec - 1 : prec);
      }
      parseHackPipeBody() {
        var _body$extra;
        const {
          startLoc
        } = this.state;
        const body = this.parseMaybeAssign();
        const requiredParentheses = UnparenthesizedPipeBodyDescriptions.has(body.type);
        if (requiredParentheses && !((_body$extra = body.extra) != null && _body$extra.parenthesized)) {
          this.raise(Errors.PipeUnparenthesizedBody, startLoc, {
            type: body.type
          });
        }
        if (!this.topicReferenceWasUsedInCurrentContext()) {
          this.raise(Errors.PipeTopicUnused, startLoc);
        }
        return body;
      }
      checkExponentialAfterUnary(node) {
        if (this.match(57)) {
          this.raise(Errors.UnexpectedTokenUnaryExponentiation, node.argument);
        }
      }
      parseMaybeUnary(refExpressionErrors, sawUnary) {
        const startLoc = this.state.startLoc;
        const isAwait = this.isContextual(96);
        if (isAwait && this.recordAwaitIfAllowed()) {
          this.next();
          const expr2 = this.parseAwait(startLoc);
          if (!sawUnary) this.checkExponentialAfterUnary(expr2);
          return expr2;
        }
        const update = this.match(34);
        const node = this.startNode();
        if (tokenIsPrefix(this.state.type)) {
          node.operator = this.state.value;
          node.prefix = true;
          if (this.match(72)) {
            this.expectPlugin("throwExpressions");
          }
          const isDelete = this.match(89);
          this.next();
          node.argument = this.parseMaybeUnary(null, true);
          this.checkExpressionErrors(refExpressionErrors, true);
          if (this.state.strict && isDelete) {
            const arg = node.argument;
            if (arg.type === "Identifier") {
              this.raise(Errors.StrictDelete, node);
            } else if (this.hasPropertyAsPrivateName(arg)) {
              this.raise(Errors.DeletePrivateField, node);
            }
          }
          if (!update) {
            if (!sawUnary) {
              this.checkExponentialAfterUnary(node);
            }
            return this.finishNode(node, "UnaryExpression");
          }
        }
        const expr = this.parseUpdate(node, update, refExpressionErrors);
        if (isAwait) {
          const {
            type
          } = this.state;
          const startsExpr2 = this.hasPlugin("v8intrinsic") ? tokenCanStartExpression(type) : tokenCanStartExpression(type) && !this.match(54);
          if (startsExpr2 && !this.isAmbiguousPrefixOrIdentifier()) {
            this.raiseOverwrite(Errors.AwaitNotInAsyncContext, startLoc);
            return this.parseAwait(startLoc);
          }
        }
        return expr;
      }
      parseUpdate(node, update, refExpressionErrors) {
        if (update) {
          const updateExpressionNode = node;
          this.checkLVal(updateExpressionNode.argument, this.finishNode(updateExpressionNode, "UpdateExpression"));
          return node;
        }
        const startLoc = this.state.startLoc;
        let expr = this.parseExprSubscripts(refExpressionErrors);
        if (this.checkExpressionErrors(refExpressionErrors, false)) return expr;
        while (tokenIsPostfix(this.state.type) && !this.canInsertSemicolon()) {
          const node2 = this.startNodeAt(startLoc);
          node2.operator = this.state.value;
          node2.prefix = false;
          node2.argument = expr;
          this.next();
          this.checkLVal(expr, expr = this.finishNode(node2, "UpdateExpression"));
        }
        return expr;
      }
      parseExprSubscripts(refExpressionErrors) {
        const startLoc = this.state.startLoc;
        const potentialArrowAt = this.state.potentialArrowAt;
        const expr = this.parseExprAtom(refExpressionErrors);
        if (this.shouldExitDescending(expr, potentialArrowAt)) {
          return expr;
        }
        return this.parseSubscripts(expr, startLoc);
      }
      parseSubscripts(base, startLoc, noCalls) {
        const state = {
          optionalChainMember: false,
          maybeAsyncArrow: this.atPossibleAsyncArrow(base),
          stop: false
        };
        do {
          base = this.parseSubscript(base, startLoc, noCalls, state);
          state.maybeAsyncArrow = false;
        } while (!state.stop);
        return base;
      }
      parseSubscript(base, startLoc, noCalls, state) {
        const {
          type
        } = this.state;
        if (!noCalls && type === 15) {
          return this.parseBind(base, startLoc, noCalls, state);
        } else if (tokenIsTemplate(type)) {
          return this.parseTaggedTemplateExpression(base, startLoc, state);
        }
        let optional = false;
        if (type === 18) {
          if (noCalls) {
            this.raise(Errors.OptionalChainingNoNew, this.state.startLoc);
            if (this.lookaheadCharCode() === 40) {
              return this.stopParseSubscript(base, state);
            }
          }
          state.optionalChainMember = optional = true;
          this.next();
        }
        if (!noCalls && this.match(10)) {
          return this.parseCoverCallAndAsyncArrowHead(base, startLoc, state, optional);
        } else {
          const computed = this.eat(0);
          if (computed || optional || this.eat(16)) {
            return this.parseMember(base, startLoc, state, computed, optional);
          } else {
            return this.stopParseSubscript(base, state);
          }
        }
      }
      stopParseSubscript(base, state) {
        state.stop = true;
        return base;
      }
      parseMember(base, startLoc, state, computed, optional) {
        const node = this.startNodeAt(startLoc);
        node.object = base;
        node.computed = computed;
        if (computed) {
          node.property = this.parseExpression();
          this.expect(3);
        } else if (this.match(139)) {
          if (base.type === "Super") {
            this.raise(Errors.SuperPrivateField, startLoc);
          }
          this.classScope.usePrivateName(this.state.value, this.state.startLoc);
          node.property = this.parsePrivateName();
        } else {
          node.property = this.parseIdentifier(true);
        }
        if (state.optionalChainMember) {
          node.optional = optional;
          return this.finishNode(node, "OptionalMemberExpression");
        } else {
          return this.finishNode(node, "MemberExpression");
        }
      }
      parseBind(base, startLoc, noCalls, state) {
        const node = this.startNodeAt(startLoc);
        node.object = base;
        this.next();
        node.callee = this.parseNoCallExpr();
        state.stop = true;
        return this.parseSubscripts(this.finishNode(node, "BindExpression"), startLoc, noCalls);
      }
      parseCoverCallAndAsyncArrowHead(base, startLoc, state, optional) {
        const oldMaybeInArrowParameters = this.state.maybeInArrowParameters;
        let refExpressionErrors = null;
        this.state.maybeInArrowParameters = true;
        this.next();
        const node = this.startNodeAt(startLoc);
        node.callee = base;
        const {
          maybeAsyncArrow,
          optionalChainMember
        } = state;
        if (maybeAsyncArrow) {
          this.expressionScope.enter(newAsyncArrowScope());
          refExpressionErrors = new ExpressionErrors();
        }
        if (optionalChainMember) {
          node.optional = optional;
        }
        if (optional) {
          node.arguments = this.parseCallExpressionArguments();
        } else {
          node.arguments = this.parseCallExpressionArguments(base.type !== "Super", node, refExpressionErrors);
        }
        let finishedNode = this.finishCallExpression(node, optionalChainMember);
        if (maybeAsyncArrow && this.shouldParseAsyncArrow() && !optional) {
          state.stop = true;
          this.checkDestructuringPrivate(refExpressionErrors);
          this.expressionScope.validateAsPattern();
          this.expressionScope.exit();
          finishedNode = this.parseAsyncArrowFromCallExpression(this.startNodeAt(startLoc), finishedNode);
        } else {
          if (maybeAsyncArrow) {
            this.checkExpressionErrors(refExpressionErrors, true);
            this.expressionScope.exit();
          }
          this.toReferencedArguments(finishedNode);
        }
        this.state.maybeInArrowParameters = oldMaybeInArrowParameters;
        return finishedNode;
      }
      toReferencedArguments(node, isParenthesizedExpr) {
        this.toReferencedListDeep(node.arguments, isParenthesizedExpr);
      }
      parseTaggedTemplateExpression(base, startLoc, state) {
        const node = this.startNodeAt(startLoc);
        node.tag = base;
        node.quasi = this.parseTemplate(true);
        if (state.optionalChainMember) {
          this.raise(Errors.OptionalChainingNoTemplate, startLoc);
        }
        return this.finishNode(node, "TaggedTemplateExpression");
      }
      atPossibleAsyncArrow(base) {
        return base.type === "Identifier" && base.name === "async" && this.state.lastTokEndLoc.index === base.end && !this.canInsertSemicolon() && base.end - base.start === 5 && this.offsetToSourcePos(base.start) === this.state.potentialArrowAt;
      }
      finishCallExpression(node, optional) {
        if (node.callee.type === "Import") {
          if (node.arguments.length === 0 || node.arguments.length > 2) {
            this.raise(Errors.ImportCallArity, node);
          } else {
            for (const arg of node.arguments) {
              if (arg.type === "SpreadElement") {
                this.raise(Errors.ImportCallSpreadArgument, arg);
              }
            }
          }
        }
        return this.finishNode(node, optional ? "OptionalCallExpression" : "CallExpression");
      }
      parseCallExpressionArguments(allowPlaceholder, nodeForExtra, refExpressionErrors) {
        const elts = [];
        let first = true;
        const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody;
        this.state.inFSharpPipelineDirectBody = false;
        while (!this.eat(11)) {
          if (first) {
            first = false;
          } else {
            this.expect(12);
            if (this.match(11)) {
              if (nodeForExtra) {
                this.addTrailingCommaExtraToNode(nodeForExtra);
              }
              this.next();
              break;
            }
          }
          elts.push(this.parseExprListItem(11, false, refExpressionErrors, allowPlaceholder));
        }
        this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody;
        return elts;
      }
      shouldParseAsyncArrow() {
        return this.match(19) && !this.canInsertSemicolon();
      }
      parseAsyncArrowFromCallExpression(node, call) {
        var _call$extra;
        this.resetPreviousNodeTrailingComments(call);
        this.expect(19);
        this.parseArrowExpression(node, call.arguments, true, (_call$extra = call.extra) == null ? void 0 : _call$extra.trailingCommaLoc);
        if (call.innerComments) {
          setInnerComments(node, call.innerComments);
        }
        if (call.callee.trailingComments) {
          setInnerComments(node, call.callee.trailingComments);
        }
        return node;
      }
      parseNoCallExpr() {
        const startLoc = this.state.startLoc;
        return this.parseSubscripts(this.parseExprAtom(), startLoc, true);
      }
      parseExprAtom(refExpressionErrors) {
        let node;
        let decorators = null;
        const {
          type
        } = this.state;
        switch (type) {
          case 79:
            return this.parseSuper();
          case 83:
            node = this.startNode();
            this.next();
            if (this.match(16)) {
              return this.parseImportMetaPropertyOrPhaseCall(node);
            }
            if (this.match(10)) {
              if (this.optionFlags & 512) {
                return this.parseImportCall(node);
              } else {
                return this.finishNode(node, "Import");
              }
            } else {
              this.raise(Errors.UnsupportedImport, this.state.lastTokStartLoc);
              return this.finishNode(node, "Import");
            }
          case 78:
            node = this.startNode();
            this.next();
            return this.finishNode(node, "ThisExpression");
          case 90: {
            return this.parseDo(this.startNode(), false);
          }
          case 56:
          case 31: {
            this.readRegexp();
            return this.parseRegExpLiteral(this.state.value);
          }
          case 135:
            return this.parseNumericLiteral(this.state.value);
          case 136:
            return this.parseBigIntLiteral(this.state.value);
          case 134:
            return this.parseStringLiteral(this.state.value);
          case 84:
            return this.parseNullLiteral();
          case 85:
            return this.parseBooleanLiteral(true);
          case 86:
            return this.parseBooleanLiteral(false);
          case 10: {
            const canBeArrow = this.state.potentialArrowAt === this.state.start;
            return this.parseParenAndDistinguishExpression(canBeArrow);
          }
          case 0: {
            return this.parseArrayLike(3, false, refExpressionErrors);
          }
          case 5: {
            return this.parseObjectLike(8, false, false, refExpressionErrors);
          }
          case 68:
            return this.parseFunctionOrFunctionSent();
          case 26:
            decorators = this.parseDecorators();
          case 80:
            return this.parseClass(this.maybeTakeDecorators(decorators, this.startNode()), false);
          case 77:
            return this.parseNewOrNewTarget();
          case 25:
          case 24:
            return this.parseTemplate(false);
          case 15: {
            node = this.startNode();
            this.next();
            node.object = null;
            const callee = node.callee = this.parseNoCallExpr();
            if (callee.type === "MemberExpression") {
              return this.finishNode(node, "BindExpression");
            } else {
              throw this.raise(Errors.UnsupportedBind, callee);
            }
          }
          case 139: {
            this.raise(Errors.PrivateInExpectedIn, this.state.startLoc, {
              identifierName: this.state.value
            });
            return this.parsePrivateName();
          }
          case 33: {
            return this.parseTopicReferenceThenEqualsSign(54, "%");
          }
          case 32: {
            return this.parseTopicReferenceThenEqualsSign(44, "^");
          }
          case 37:
          case 38: {
            return this.parseTopicReference("hack");
          }
          case 44:
          case 54:
          case 27: {
            const pipeProposal = this.getPluginOption("pipelineOperator", "proposal");
            if (pipeProposal) {
              return this.parseTopicReference(pipeProposal);
            }
            throw this.unexpected();
          }
          case 47: {
            const lookaheadCh = this.input.codePointAt(this.nextTokenStart());
            if (isIdentifierStart(lookaheadCh) || lookaheadCh === 62) {
              throw this.expectOnePlugin(["jsx", "flow", "typescript"]);
            }
            throw this.unexpected();
          }
          default:
            if (type === 137) {
              return this.parseDecimalLiteral(this.state.value);
            } else if (type === 2 || type === 1) {
              return this.parseArrayLike(this.state.type === 2 ? 4 : 3, true);
            } else if (type === 6 || type === 7) {
              return this.parseObjectLike(this.state.type === 6 ? 9 : 8, false, true);
            }
            if (tokenIsIdentifier(type)) {
              if (this.isContextual(127) && this.lookaheadInLineCharCode() === 123) {
                return this.parseModuleExpression();
              }
              const canBeArrow = this.state.potentialArrowAt === this.state.start;
              const containsEsc = this.state.containsEsc;
              const id = this.parseIdentifier();
              if (!containsEsc && id.name === "async" && !this.canInsertSemicolon()) {
                const {
                  type: type2
                } = this.state;
                if (type2 === 68) {
                  this.resetPreviousNodeTrailingComments(id);
                  this.next();
                  return this.parseAsyncFunctionExpression(this.startNodeAtNode(id));
                } else if (tokenIsIdentifier(type2)) {
                  if (canBeArrow && this.lookaheadCharCode() === 61) {
                    return this.parseAsyncArrowUnaryFunction(this.startNodeAtNode(id));
                  } else {
                    return id;
                  }
                } else if (type2 === 90) {
                  this.resetPreviousNodeTrailingComments(id);
                  return this.parseDo(this.startNodeAtNode(id), true);
                }
              }
              if (canBeArrow && this.match(19) && !this.canInsertSemicolon()) {
                this.next();
                return this.parseArrowExpression(this.startNodeAtNode(id), [id], false);
              }
              return id;
            } else {
              throw this.unexpected();
            }
        }
      }
      parseTopicReferenceThenEqualsSign(topicTokenType, topicTokenValue) {
        const pipeProposal = this.getPluginOption("pipelineOperator", "proposal");
        if (pipeProposal) {
          this.state.type = topicTokenType;
          this.state.value = topicTokenValue;
          this.state.pos--;
          this.state.end--;
          this.state.endLoc = createPositionWithColumnOffset(this.state.endLoc, -1);
          return this.parseTopicReference(pipeProposal);
        }
        throw this.unexpected();
      }
      parseTopicReference(pipeProposal) {
        const node = this.startNode();
        const startLoc = this.state.startLoc;
        const tokenType = this.state.type;
        this.next();
        return this.finishTopicReference(node, startLoc, pipeProposal, tokenType);
      }
      finishTopicReference(node, startLoc, pipeProposal, tokenType) {
        if (this.testTopicReferenceConfiguration(pipeProposal, startLoc, tokenType)) {
          if (pipeProposal === "hack") {
            if (!this.topicReferenceIsAllowedInCurrentContext()) {
              this.raise(Errors.PipeTopicUnbound, startLoc);
            }
            this.registerTopicReference();
            return this.finishNode(node, "TopicReference");
          } else {
            if (!this.topicReferenceIsAllowedInCurrentContext()) {
              this.raise(Errors.PrimaryTopicNotAllowed, startLoc);
            }
            this.registerTopicReference();
            return this.finishNode(node, "PipelinePrimaryTopicReference");
          }
        } else {
          throw this.raise(Errors.PipeTopicUnconfiguredToken, startLoc, {
            token: tokenLabelName(tokenType)
          });
        }
      }
      testTopicReferenceConfiguration(pipeProposal, startLoc, tokenType) {
        switch (pipeProposal) {
          case "hack": {
            return this.hasPlugin(["pipelineOperator", {
              topicToken: tokenLabelName(tokenType)
            }]);
          }
          case "smart":
            return tokenType === 27;
          default:
            throw this.raise(Errors.PipeTopicRequiresHackPipes, startLoc);
        }
      }
      parseAsyncArrowUnaryFunction(node) {
        this.prodParam.enter(functionFlags(true, this.prodParam.hasYield));
        const params = [this.parseIdentifier()];
        this.prodParam.exit();
        if (this.hasPrecedingLineBreak()) {
          this.raise(Errors.LineTerminatorBeforeArrow, this.state.curPosition());
        }
        this.expect(19);
        return this.parseArrowExpression(node, params, true);
      }
      parseDo(node, isAsync) {
        this.expectPlugin("doExpressions");
        if (isAsync) {
          this.expectPlugin("asyncDoExpressions");
        }
        node.async = isAsync;
        this.next();
        const oldLabels = this.state.labels;
        this.state.labels = [];
        if (isAsync) {
          this.prodParam.enter(2);
          node.body = this.parseBlock();
          this.prodParam.exit();
        } else {
          node.body = this.parseBlock();
        }
        this.state.labels = oldLabels;
        return this.finishNode(node, "DoExpression");
      }
      parseSuper() {
        const node = this.startNode();
        this.next();
        if (this.match(10) && !this.scope.allowDirectSuper) {
          if (!(this.optionFlags & 16)) {
            this.raise(Errors.SuperNotAllowed, node);
          }
        } else if (!this.scope.allowSuper) {
          if (!(this.optionFlags & 16)) {
            this.raise(Errors.UnexpectedSuper, node);
          }
        }
        if (!this.match(10) && !this.match(0) && !this.match(16)) {
          this.raise(Errors.UnsupportedSuper, node);
        }
        return this.finishNode(node, "Super");
      }
      parsePrivateName() {
        const node = this.startNode();
        const id = this.startNodeAt(createPositionWithColumnOffset(this.state.startLoc, 1));
        const name = this.state.value;
        this.next();
        node.id = this.createIdentifier(id, name);
        return this.finishNode(node, "PrivateName");
      }
      parseFunctionOrFunctionSent() {
        const node = this.startNode();
        this.next();
        if (this.prodParam.hasYield && this.match(16)) {
          const meta = this.createIdentifier(this.startNodeAtNode(node), "function");
          this.next();
          if (this.match(103)) {
            this.expectPlugin("functionSent");
          } else if (!this.hasPlugin("functionSent")) {
            this.unexpected();
          }
          return this.parseMetaProperty(node, meta, "sent");
        }
        return this.parseFunction(node);
      }
      parseMetaProperty(node, meta, propertyName) {
        node.meta = meta;
        const containsEsc = this.state.containsEsc;
        node.property = this.parseIdentifier(true);
        if (node.property.name !== propertyName || containsEsc) {
          this.raise(Errors.UnsupportedMetaProperty, node.property, {
            target: meta.name,
            onlyValidPropertyName: propertyName
          });
        }
        return this.finishNode(node, "MetaProperty");
      }
      parseImportMetaPropertyOrPhaseCall(node) {
        this.next();
        if (this.isContextual(105) || this.isContextual(97)) {
          const isSource = this.isContextual(105);
          this.expectPlugin(isSource ? "sourcePhaseImports" : "deferredImportEvaluation");
          this.next();
          node.phase = isSource ? "source" : "defer";
          return this.parseImportCall(node);
        } else {
          const id = this.createIdentifierAt(this.startNodeAtNode(node), "import", this.state.lastTokStartLoc);
          if (this.isContextual(101)) {
            if (!this.inModule) {
              this.raise(Errors.ImportMetaOutsideModule, id);
            }
            this.sawUnambiguousESM = true;
          }
          return this.parseMetaProperty(node, id, "meta");
        }
      }
      parseLiteralAtNode(value2, type, node) {
        this.addExtra(node, "rawValue", value2);
        this.addExtra(node, "raw", this.input.slice(this.offsetToSourcePos(node.start), this.state.end));
        node.value = value2;
        this.next();
        return this.finishNode(node, type);
      }
      parseLiteral(value2, type) {
        const node = this.startNode();
        return this.parseLiteralAtNode(value2, type, node);
      }
      parseStringLiteral(value2) {
        return this.parseLiteral(value2, "StringLiteral");
      }
      parseNumericLiteral(value2) {
        return this.parseLiteral(value2, "NumericLiteral");
      }
      parseBigIntLiteral(value2) {
        return this.parseLiteral(value2, "BigIntLiteral");
      }
      parseDecimalLiteral(value2) {
        return this.parseLiteral(value2, "DecimalLiteral");
      }
      parseRegExpLiteral(value2) {
        const node = this.startNode();
        this.addExtra(node, "raw", this.input.slice(this.offsetToSourcePos(node.start), this.state.end));
        node.pattern = value2.pattern;
        node.flags = value2.flags;
        this.next();
        return this.finishNode(node, "RegExpLiteral");
      }
      parseBooleanLiteral(value2) {
        const node = this.startNode();
        node.value = value2;
        this.next();
        return this.finishNode(node, "BooleanLiteral");
      }
      parseNullLiteral() {
        const node = this.startNode();
        this.next();
        return this.finishNode(node, "NullLiteral");
      }
      parseParenAndDistinguishExpression(canBeArrow) {
        const startLoc = this.state.startLoc;
        let val;
        this.next();
        this.expressionScope.enter(newArrowHeadScope());
        const oldMaybeInArrowParameters = this.state.maybeInArrowParameters;
        const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody;
        this.state.maybeInArrowParameters = true;
        this.state.inFSharpPipelineDirectBody = false;
        const innerStartLoc = this.state.startLoc;
        const exprList = [];
        const refExpressionErrors = new ExpressionErrors();
        let first = true;
        let spreadStartLoc;
        let optionalCommaStartLoc;
        while (!this.match(11)) {
          if (first) {
            first = false;
          } else {
            this.expect(12, refExpressionErrors.optionalParametersLoc === null ? null : refExpressionErrors.optionalParametersLoc);
            if (this.match(11)) {
              optionalCommaStartLoc = this.state.startLoc;
              break;
            }
          }
          if (this.match(21)) {
            const spreadNodeStartLoc = this.state.startLoc;
            spreadStartLoc = this.state.startLoc;
            exprList.push(this.parseParenItem(this.parseRestBinding(), spreadNodeStartLoc));
            if (!this.checkCommaAfterRest(41)) {
              break;
            }
          } else {
            exprList.push(this.parseMaybeAssignAllowInOrVoidPattern(11, refExpressionErrors, this.parseParenItem));
          }
        }
        const innerEndLoc = this.state.lastTokEndLoc;
        this.expect(11);
        this.state.maybeInArrowParameters = oldMaybeInArrowParameters;
        this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody;
        let arrowNode = this.startNodeAt(startLoc);
        if (canBeArrow && this.shouldParseArrow(exprList) && (arrowNode = this.parseArrow(arrowNode))) {
          this.checkDestructuringPrivate(refExpressionErrors);
          this.expressionScope.validateAsPattern();
          this.expressionScope.exit();
          this.parseArrowExpression(arrowNode, exprList, false);
          return arrowNode;
        }
        this.expressionScope.exit();
        if (!exprList.length) {
          this.unexpected(this.state.lastTokStartLoc);
        }
        if (optionalCommaStartLoc) this.unexpected(optionalCommaStartLoc);
        if (spreadStartLoc) this.unexpected(spreadStartLoc);
        this.checkExpressionErrors(refExpressionErrors, true);
        this.toReferencedListDeep(exprList, true);
        if (exprList.length > 1) {
          val = this.startNodeAt(innerStartLoc);
          val.expressions = exprList;
          this.finishNode(val, "SequenceExpression");
          this.resetEndLocation(val, innerEndLoc);
        } else {
          val = exprList[0];
        }
        return this.wrapParenthesis(startLoc, val);
      }
      wrapParenthesis(startLoc, expression) {
        if (!(this.optionFlags & 1024)) {
          this.addExtra(expression, "parenthesized", true);
          this.addExtra(expression, "parenStart", startLoc.index);
          this.takeSurroundingComments(expression, startLoc.index, this.state.lastTokEndLoc.index);
          return expression;
        }
        const parenExpression = this.startNodeAt(startLoc);
        parenExpression.expression = expression;
        return this.finishNode(parenExpression, "ParenthesizedExpression");
      }
      shouldParseArrow(params) {
        return !this.canInsertSemicolon();
      }
      parseArrow(node) {
        if (this.eat(19)) {
          return node;
        }
      }
      parseParenItem(node, startLoc) {
        return node;
      }
      parseNewOrNewTarget() {
        const node = this.startNode();
        this.next();
        if (this.match(16)) {
          const meta = this.createIdentifier(this.startNodeAtNode(node), "new");
          this.next();
          const metaProp = this.parseMetaProperty(node, meta, "target");
          if (!this.scope.allowNewTarget) {
            this.raise(Errors.UnexpectedNewTarget, metaProp);
          }
          return metaProp;
        }
        return this.parseNew(node);
      }
      parseNew(node) {
        this.parseNewCallee(node);
        if (this.eat(10)) {
          const args = this.parseExprList(11);
          this.toReferencedList(args);
          node.arguments = args;
        } else {
          node.arguments = [];
        }
        return this.finishNode(node, "NewExpression");
      }
      parseNewCallee(node) {
        const isImport = this.match(83);
        const callee = this.parseNoCallExpr();
        node.callee = callee;
        if (isImport && (callee.type === "Import" || callee.type === "ImportExpression")) {
          this.raise(Errors.ImportCallNotNewExpression, callee);
        }
      }
      parseTemplateElement(isTagged) {
        const {
          start,
          startLoc,
          end,
          value: value2
        } = this.state;
        const elemStart = start + 1;
        const elem = this.startNodeAt(createPositionWithColumnOffset(startLoc, 1));
        if (value2 === null) {
          if (!isTagged) {
            this.raise(Errors.InvalidEscapeSequenceTemplate, createPositionWithColumnOffset(this.state.firstInvalidTemplateEscapePos, 1));
          }
        }
        const isTail = this.match(24);
        const endOffset = isTail ? -1 : -2;
        const elemEnd = end + endOffset;
        elem.value = {
          raw: this.input.slice(elemStart, elemEnd).replace(/\r\n?/g, "\n"),
          cooked: value2 === null ? null : value2.slice(1, endOffset)
        };
        elem.tail = isTail;
        this.next();
        const finishedNode = this.finishNode(elem, "TemplateElement");
        this.resetEndLocation(finishedNode, createPositionWithColumnOffset(this.state.lastTokEndLoc, endOffset));
        return finishedNode;
      }
      parseTemplate(isTagged) {
        const node = this.startNode();
        let curElt = this.parseTemplateElement(isTagged);
        const quasis = [curElt];
        const substitutions = [];
        while (!curElt.tail) {
          substitutions.push(this.parseTemplateSubstitution());
          this.readTemplateContinuation();
          quasis.push(curElt = this.parseTemplateElement(isTagged));
        }
        node.expressions = substitutions;
        node.quasis = quasis;
        return this.finishNode(node, "TemplateLiteral");
      }
      parseTemplateSubstitution() {
        return this.parseExpression();
      }
      parseObjectLike(close, isPattern, isRecord, refExpressionErrors) {
        if (isRecord) {
          this.expectPlugin("recordAndTuple");
        }
        const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody;
        this.state.inFSharpPipelineDirectBody = false;
        let sawProto = false;
        let first = true;
        const node = this.startNode();
        node.properties = [];
        this.next();
        while (!this.match(close)) {
          if (first) {
            first = false;
          } else {
            this.expect(12);
            if (this.match(close)) {
              this.addTrailingCommaExtraToNode(node);
              break;
            }
          }
          let prop;
          if (isPattern) {
            prop = this.parseBindingProperty();
          } else {
            prop = this.parsePropertyDefinition(refExpressionErrors);
            sawProto = this.checkProto(prop, isRecord, sawProto, refExpressionErrors);
          }
          if (isRecord && !this.isObjectProperty(prop) && prop.type !== "SpreadElement") {
            this.raise(Errors.InvalidRecordProperty, prop);
          }
          if (prop.shorthand) {
            this.addExtra(prop, "shorthand", true);
          }
          node.properties.push(prop);
        }
        this.next();
        this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody;
        let type = "ObjectExpression";
        if (isPattern) {
          type = "ObjectPattern";
        } else if (isRecord) {
          type = "RecordExpression";
        }
        return this.finishNode(node, type);
      }
      addTrailingCommaExtraToNode(node) {
        this.addExtra(node, "trailingComma", this.state.lastTokStartLoc.index);
        this.addExtra(node, "trailingCommaLoc", this.state.lastTokStartLoc, false);
      }
      maybeAsyncOrAccessorProp(prop) {
        return !prop.computed && prop.key.type === "Identifier" && (this.isLiteralPropertyName() || this.match(0) || this.match(55));
      }
      parsePropertyDefinition(refExpressionErrors) {
        let decorators = [];
        if (this.match(26)) {
          if (this.hasPlugin("decorators")) {
            this.raise(Errors.UnsupportedPropertyDecorator, this.state.startLoc);
          }
          while (this.match(26)) {
            decorators.push(this.parseDecorator());
          }
        }
        const prop = this.startNode();
        let isAsync = false;
        let isAccessor = false;
        let startLoc;
        if (this.match(21)) {
          if (decorators.length) this.unexpected();
          return this.parseSpread();
        }
        if (decorators.length) {
          prop.decorators = decorators;
          decorators = [];
        }
        prop.method = false;
        if (refExpressionErrors) {
          startLoc = this.state.startLoc;
        }
        let isGenerator = this.eat(55);
        this.parsePropertyNamePrefixOperator(prop);
        const containsEsc = this.state.containsEsc;
        this.parsePropertyName(prop, refExpressionErrors);
        if (!isGenerator && !containsEsc && this.maybeAsyncOrAccessorProp(prop)) {
          const {
            key
          } = prop;
          const keyName = key.name;
          if (keyName === "async" && !this.hasPrecedingLineBreak()) {
            isAsync = true;
            this.resetPreviousNodeTrailingComments(key);
            isGenerator = this.eat(55);
            this.parsePropertyName(prop);
          }
          if (keyName === "get" || keyName === "set") {
            isAccessor = true;
            this.resetPreviousNodeTrailingComments(key);
            prop.kind = keyName;
            if (this.match(55)) {
              isGenerator = true;
              this.raise(Errors.AccessorIsGenerator, this.state.curPosition(), {
                kind: keyName
              });
              this.next();
            }
            this.parsePropertyName(prop);
          }
        }
        return this.parseObjPropValue(prop, startLoc, isGenerator, isAsync, false, isAccessor, refExpressionErrors);
      }
      getGetterSetterExpectedParamCount(method) {
        return method.kind === "get" ? 0 : 1;
      }
      getObjectOrClassMethodParams(method) {
        return method.params;
      }
      checkGetterSetterParams(method) {
        var _params;
        const paramCount = this.getGetterSetterExpectedParamCount(method);
        const params = this.getObjectOrClassMethodParams(method);
        if (params.length !== paramCount) {
          this.raise(method.kind === "get" ? Errors.BadGetterArity : Errors.BadSetterArity, method);
        }
        if (method.kind === "set" && ((_params = params[params.length - 1]) == null ? void 0 : _params.type) === "RestElement") {
          this.raise(Errors.BadSetterRestParameter, method);
        }
      }
      parseObjectMethod(prop, isGenerator, isAsync, isPattern, isAccessor) {
        if (isAccessor) {
          const finishedProp = this.parseMethod(prop, isGenerator, false, false, false, "ObjectMethod");
          this.checkGetterSetterParams(finishedProp);
          return finishedProp;
        }
        if (isAsync || isGenerator || this.match(10)) {
          if (isPattern) this.unexpected();
          prop.kind = "method";
          prop.method = true;
          return this.parseMethod(prop, isGenerator, isAsync, false, false, "ObjectMethod");
        }
      }
      parseObjectProperty(prop, startLoc, isPattern, refExpressionErrors) {
        prop.shorthand = false;
        if (this.eat(14)) {
          prop.value = isPattern ? this.parseMaybeDefault(this.state.startLoc) : this.parseMaybeAssignAllowInOrVoidPattern(8, refExpressionErrors);
          return this.finishObjectProperty(prop);
        }
        if (!prop.computed && prop.key.type === "Identifier") {
          this.checkReservedWord(prop.key.name, prop.key.loc.start, true, false);
          if (isPattern) {
            prop.value = this.parseMaybeDefault(startLoc, this.cloneIdentifier(prop.key));
          } else if (this.match(29)) {
            const shorthandAssignLoc = this.state.startLoc;
            if (refExpressionErrors != null) {
              if (refExpressionErrors.shorthandAssignLoc === null) {
                refExpressionErrors.shorthandAssignLoc = shorthandAssignLoc;
              }
            } else {
              this.raise(Errors.InvalidCoverInitializedName, shorthandAssignLoc);
            }
            prop.value = this.parseMaybeDefault(startLoc, this.cloneIdentifier(prop.key));
          } else {
            prop.value = this.cloneIdentifier(prop.key);
          }
          prop.shorthand = true;
          return this.finishObjectProperty(prop);
        }
      }
      finishObjectProperty(node) {
        return this.finishNode(node, "ObjectProperty");
      }
      parseObjPropValue(prop, startLoc, isGenerator, isAsync, isPattern, isAccessor, refExpressionErrors) {
        const node = this.parseObjectMethod(prop, isGenerator, isAsync, isPattern, isAccessor) || this.parseObjectProperty(prop, startLoc, isPattern, refExpressionErrors);
        if (!node) this.unexpected();
        return node;
      }
      parsePropertyName(prop, refExpressionErrors) {
        if (this.eat(0)) {
          prop.computed = true;
          prop.key = this.parseMaybeAssignAllowIn();
          this.expect(3);
        } else {
          const {
            type,
            value: value2
          } = this.state;
          let key;
          if (tokenIsKeywordOrIdentifier(type)) {
            key = this.parseIdentifier(true);
          } else {
            switch (type) {
              case 135:
                key = this.parseNumericLiteral(value2);
                break;
              case 134:
                key = this.parseStringLiteral(value2);
                break;
              case 136:
                key = this.parseBigIntLiteral(value2);
                break;
              case 139: {
                const privateKeyLoc = this.state.startLoc;
                if (refExpressionErrors != null) {
                  if (refExpressionErrors.privateKeyLoc === null) {
                    refExpressionErrors.privateKeyLoc = privateKeyLoc;
                  }
                } else {
                  this.raise(Errors.UnexpectedPrivateField, privateKeyLoc);
                }
                key = this.parsePrivateName();
                break;
              }
              default:
                if (type === 137) {
                  key = this.parseDecimalLiteral(value2);
                  break;
                }
                this.unexpected();
            }
          }
          prop.key = key;
          if (type !== 139) {
            prop.computed = false;
          }
        }
      }
      initFunction(node, isAsync) {
        node.id = null;
        node.generator = false;
        node.async = isAsync;
      }
      parseMethod(node, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope = false) {
        this.initFunction(node, isAsync);
        node.generator = isGenerator;
        this.scope.enter(514 | 16 | (inClassScope ? 576 : 0) | (allowDirectSuper ? 32 : 0));
        this.prodParam.enter(functionFlags(isAsync, node.generator));
        this.parseFunctionParams(node, isConstructor);
        const finishedNode = this.parseFunctionBodyAndFinish(node, type, true);
        this.prodParam.exit();
        this.scope.exit();
        return finishedNode;
      }
      parseArrayLike(close, isTuple, refExpressionErrors) {
        if (isTuple) {
          this.expectPlugin("recordAndTuple");
        }
        const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody;
        this.state.inFSharpPipelineDirectBody = false;
        const node = this.startNode();
        this.next();
        node.elements = this.parseExprList(close, !isTuple, refExpressionErrors, node);
        this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody;
        return this.finishNode(node, isTuple ? "TupleExpression" : "ArrayExpression");
      }
      parseArrowExpression(node, params, isAsync, trailingCommaLoc) {
        this.scope.enter(514 | 4);
        let flags = functionFlags(isAsync, false);
        if (!this.match(5) && this.prodParam.hasIn) {
          flags |= 8;
        }
        this.prodParam.enter(flags);
        this.initFunction(node, isAsync);
        const oldMaybeInArrowParameters = this.state.maybeInArrowParameters;
        if (params) {
          this.state.maybeInArrowParameters = true;
          this.setArrowFunctionParameters(node, params, trailingCommaLoc);
        }
        this.state.maybeInArrowParameters = false;
        this.parseFunctionBody(node, true);
        this.prodParam.exit();
        this.scope.exit();
        this.state.maybeInArrowParameters = oldMaybeInArrowParameters;
        return this.finishNode(node, "ArrowFunctionExpression");
      }
      setArrowFunctionParameters(node, params, trailingCommaLoc) {
        this.toAssignableList(params, trailingCommaLoc, false);
        node.params = params;
      }
      parseFunctionBodyAndFinish(node, type, isMethod = false) {
        this.parseFunctionBody(node, false, isMethod);
        return this.finishNode(node, type);
      }
      parseFunctionBody(node, allowExpression, isMethod = false) {
        const isExpression = allowExpression && !this.match(5);
        this.expressionScope.enter(newExpressionScope());
        if (isExpression) {
          node.body = this.parseMaybeAssign();
          this.checkParams(node, false, allowExpression, false);
        } else {
          const oldStrict = this.state.strict;
          const oldLabels = this.state.labels;
          this.state.labels = [];
          this.prodParam.enter(this.prodParam.currentFlags() | 4);
          node.body = this.parseBlock(true, false, (hasStrictModeDirective) => {
            const nonSimple = !this.isSimpleParamList(node.params);
            if (hasStrictModeDirective && nonSimple) {
              this.raise(Errors.IllegalLanguageModeDirective, (node.kind === "method" || node.kind === "constructor") && !!node.key ? node.key.loc.end : node);
            }
            const strictModeChanged = !oldStrict && this.state.strict;
            this.checkParams(node, !this.state.strict && !allowExpression && !isMethod && !nonSimple, allowExpression, strictModeChanged);
            if (this.state.strict && node.id) {
              this.checkIdentifier(node.id, 65, strictModeChanged);
            }
          });
          this.prodParam.exit();
          this.state.labels = oldLabels;
        }
        this.expressionScope.exit();
      }
      isSimpleParameter(node) {
        return node.type === "Identifier";
      }
      isSimpleParamList(params) {
        for (let i = 0, len = params.length; i < len; i++) {
          if (!this.isSimpleParameter(params[i])) return false;
        }
        return true;
      }
      checkParams(node, allowDuplicates, isArrowFunction, strictModeChanged = true) {
        const checkClashes = !allowDuplicates && /* @__PURE__ */ new Set();
        const formalParameters = {
          type: "FormalParameters"
        };
        for (const param of node.params) {
          this.checkLVal(param, formalParameters, 5, checkClashes, strictModeChanged);
        }
      }
      parseExprList(close, allowEmpty, refExpressionErrors, nodeForExtra) {
        const elts = [];
        let first = true;
        while (!this.eat(close)) {
          if (first) {
            first = false;
          } else {
            this.expect(12);
            if (this.match(close)) {
              if (nodeForExtra) {
                this.addTrailingCommaExtraToNode(nodeForExtra);
              }
              this.next();
              break;
            }
          }
          elts.push(this.parseExprListItem(close, allowEmpty, refExpressionErrors));
        }
        return elts;
      }
      parseExprListItem(close, allowEmpty, refExpressionErrors, allowPlaceholder) {
        let elt;
        if (this.match(12)) {
          if (!allowEmpty) {
            this.raise(Errors.UnexpectedToken, this.state.curPosition(), {
              unexpected: ","
            });
          }
          elt = null;
        } else if (this.match(21)) {
          const spreadNodeStartLoc = this.state.startLoc;
          elt = this.parseParenItem(this.parseSpread(refExpressionErrors), spreadNodeStartLoc);
        } else if (this.match(17)) {
          this.expectPlugin("partialApplication");
          if (!allowPlaceholder) {
            this.raise(Errors.UnexpectedArgumentPlaceholder, this.state.startLoc);
          }
          const node = this.startNode();
          this.next();
          elt = this.finishNode(node, "ArgumentPlaceholder");
        } else {
          elt = this.parseMaybeAssignAllowInOrVoidPattern(close, refExpressionErrors, this.parseParenItem);
        }
        return elt;
      }
      parseIdentifier(liberal) {
        const node = this.startNode();
        const name = this.parseIdentifierName(liberal);
        return this.createIdentifier(node, name);
      }
      createIdentifier(node, name) {
        node.name = name;
        node.loc.identifierName = name;
        return this.finishNode(node, "Identifier");
      }
      createIdentifierAt(node, name, endLoc) {
        node.name = name;
        node.loc.identifierName = name;
        return this.finishNodeAt(node, "Identifier", endLoc);
      }
      parseIdentifierName(liberal) {
        let name;
        const {
          startLoc,
          type
        } = this.state;
        if (tokenIsKeywordOrIdentifier(type)) {
          name = this.state.value;
        } else {
          this.unexpected();
        }
        const tokenIsKeyword2 = tokenKeywordOrIdentifierIsKeyword(type);
        if (liberal) {
          if (tokenIsKeyword2) {
            this.replaceToken(132);
          }
        } else {
          this.checkReservedWord(name, startLoc, tokenIsKeyword2, false);
        }
        this.next();
        return name;
      }
      checkReservedWord(word, startLoc, checkKeywords, isBinding) {
        if (word.length > 10) {
          return;
        }
        if (!canBeReservedWord(word)) {
          return;
        }
        if (checkKeywords && isKeyword(word)) {
          this.raise(Errors.UnexpectedKeyword, startLoc, {
            keyword: word
          });
          return;
        }
        const reservedTest = !this.state.strict ? isReservedWord : isBinding ? isStrictBindReservedWord : isStrictReservedWord;
        if (reservedTest(word, this.inModule)) {
          this.raise(Errors.UnexpectedReservedWord, startLoc, {
            reservedWord: word
          });
          return;
        } else if (word === "yield") {
          if (this.prodParam.hasYield) {
            this.raise(Errors.YieldBindingIdentifier, startLoc);
            return;
          }
        } else if (word === "await") {
          if (this.prodParam.hasAwait) {
            this.raise(Errors.AwaitBindingIdentifier, startLoc);
            return;
          }
          if (this.scope.inStaticBlock) {
            this.raise(Errors.AwaitBindingIdentifierInStaticBlock, startLoc);
            return;
          }
          this.expressionScope.recordAsyncArrowParametersError(startLoc);
        } else if (word === "arguments") {
          if (this.scope.inClassAndNotInNonArrowFunction) {
            this.raise(Errors.ArgumentsInClass, startLoc);
            return;
          }
        }
      }
      recordAwaitIfAllowed() {
        const isAwaitAllowed = this.prodParam.hasAwait;
        if (isAwaitAllowed && !this.scope.inFunction) {
          this.state.hasTopLevelAwait = true;
        }
        return isAwaitAllowed;
      }
      parseAwait(startLoc) {
        const node = this.startNodeAt(startLoc);
        this.expressionScope.recordParameterInitializerError(Errors.AwaitExpressionFormalParameter, node);
        if (this.eat(55)) {
          this.raise(Errors.ObsoleteAwaitStar, node);
        }
        if (!this.scope.inFunction && !(this.optionFlags & 1)) {
          if (this.isAmbiguousPrefixOrIdentifier()) {
            this.ambiguousScriptDifferentAst = true;
          } else {
            this.sawUnambiguousESM = true;
          }
        }
        if (!this.state.soloAwait) {
          node.argument = this.parseMaybeUnary(null, true);
        }
        return this.finishNode(node, "AwaitExpression");
      }
      isAmbiguousPrefixOrIdentifier() {
        if (this.hasPrecedingLineBreak()) return true;
        const {
          type
        } = this.state;
        return type === 53 || type === 10 || type === 0 || tokenIsTemplate(type) || type === 102 && !this.state.containsEsc || type === 138 || type === 56 || this.hasPlugin("v8intrinsic") && type === 54;
      }
      parseYield(startLoc) {
        const node = this.startNodeAt(startLoc);
        this.expressionScope.recordParameterInitializerError(Errors.YieldInParameter, node);
        let delegating = false;
        let argument = null;
        if (!this.hasPrecedingLineBreak()) {
          delegating = this.eat(55);
          switch (this.state.type) {
            case 13:
            case 140:
            case 8:
            case 11:
            case 3:
            case 9:
            case 14:
            case 12:
              if (!delegating) break;
            default:
              argument = this.parseMaybeAssign();
          }
        }
        node.delegate = delegating;
        node.argument = argument;
        return this.finishNode(node, "YieldExpression");
      }
      parseImportCall(node) {
        this.next();
        node.source = this.parseMaybeAssignAllowIn();
        node.options = null;
        if (this.eat(12)) {
          if (!this.match(11)) {
            node.options = this.parseMaybeAssignAllowIn();
            if (this.eat(12)) {
              this.addTrailingCommaExtraToNode(node.options);
              if (!this.match(11)) {
                do {
                  this.parseMaybeAssignAllowIn();
                } while (this.eat(12) && !this.match(11));
                this.raise(Errors.ImportCallArity, node);
              }
            }
          } else {
            this.addTrailingCommaExtraToNode(node.source);
          }
        }
        this.expect(11);
        return this.finishNode(node, "ImportExpression");
      }
      checkPipelineAtInfixOperator(left, leftStartLoc) {
        if (this.hasPlugin(["pipelineOperator", {
          proposal: "smart"
        }])) {
          if (left.type === "SequenceExpression") {
            this.raise(Errors.PipelineHeadSequenceExpression, leftStartLoc);
          }
        }
      }
      parseSmartPipelineBodyInStyle(childExpr, startLoc) {
        if (this.isSimpleReference(childExpr)) {
          const bodyNode = this.startNodeAt(startLoc);
          bodyNode.callee = childExpr;
          return this.finishNode(bodyNode, "PipelineBareFunction");
        } else {
          const bodyNode = this.startNodeAt(startLoc);
          this.checkSmartPipeTopicBodyEarlyErrors(startLoc);
          bodyNode.expression = childExpr;
          return this.finishNode(bodyNode, "PipelineTopicExpression");
        }
      }
      isSimpleReference(expression) {
        switch (expression.type) {
          case "MemberExpression":
            return !expression.computed && this.isSimpleReference(expression.object);
          case "Identifier":
            return true;
          default:
            return false;
        }
      }
      checkSmartPipeTopicBodyEarlyErrors(startLoc) {
        if (this.match(19)) {
          throw this.raise(Errors.PipelineBodyNoArrow, this.state.startLoc);
        }
        if (!this.topicReferenceWasUsedInCurrentContext()) {
          this.raise(Errors.PipelineTopicUnused, startLoc);
        }
      }
      withTopicBindingContext(callback) {
        const outerContextTopicState = this.state.topicContext;
        this.state.topicContext = {
          maxNumOfResolvableTopics: 1,
          maxTopicIndex: null
        };
        try {
          return callback();
        } finally {
          this.state.topicContext = outerContextTopicState;
        }
      }
      withSmartMixTopicForbiddingContext(callback) {
        if (this.hasPlugin(["pipelineOperator", {
          proposal: "smart"
        }])) {
          const outerContextTopicState = this.state.topicContext;
          this.state.topicContext = {
            maxNumOfResolvableTopics: 0,
            maxTopicIndex: null
          };
          try {
            return callback();
          } finally {
            this.state.topicContext = outerContextTopicState;
          }
        } else {
          return callback();
        }
      }
      withSoloAwaitPermittingContext(callback) {
        const outerContextSoloAwaitState = this.state.soloAwait;
        this.state.soloAwait = true;
        try {
          return callback();
        } finally {
          this.state.soloAwait = outerContextSoloAwaitState;
        }
      }
      allowInAnd(callback) {
        const flags = this.prodParam.currentFlags();
        const prodParamToSet = 8 & ~flags;
        if (prodParamToSet) {
          this.prodParam.enter(flags | 8);
          try {
            return callback();
          } finally {
            this.prodParam.exit();
          }
        }
        return callback();
      }
      disallowInAnd(callback) {
        const flags = this.prodParam.currentFlags();
        const prodParamToClear = 8 & flags;
        if (prodParamToClear) {
          this.prodParam.enter(flags & ~8);
          try {
            return callback();
          } finally {
            this.prodParam.exit();
          }
        }
        return callback();
      }
      registerTopicReference() {
        this.state.topicContext.maxTopicIndex = 0;
      }
      topicReferenceIsAllowedInCurrentContext() {
        return this.state.topicContext.maxNumOfResolvableTopics >= 1;
      }
      topicReferenceWasUsedInCurrentContext() {
        return this.state.topicContext.maxTopicIndex != null && this.state.topicContext.maxTopicIndex >= 0;
      }
      parseFSharpPipelineBody(prec) {
        const startLoc = this.state.startLoc;
        this.state.potentialArrowAt = this.state.start;
        const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody;
        this.state.inFSharpPipelineDirectBody = true;
        const ret = this.parseExprOp(this.parseMaybeUnaryOrPrivate(), startLoc, prec);
        this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody;
        return ret;
      }
      parseModuleExpression() {
        this.expectPlugin("moduleBlocks");
        const node = this.startNode();
        this.next();
        if (!this.match(5)) {
          this.unexpected(null, 5);
        }
        const program = this.startNodeAt(this.state.endLoc);
        this.next();
        const revertScopes = this.initializeScopes(true);
        this.enterInitialScopes();
        try {
          node.body = this.parseProgram(program, 8, "module");
        } finally {
          revertScopes();
        }
        return this.finishNode(node, "ModuleExpression");
      }
      parseVoidPattern(refExpressionErrors) {
        this.expectPlugin("discardBinding");
        const node = this.startNode();
        if (refExpressionErrors != null) {
          refExpressionErrors.voidPatternLoc = this.state.startLoc;
        }
        this.next();
        return this.finishNode(node, "VoidPattern");
      }
      parseMaybeAssignAllowInOrVoidPattern(close, refExpressionErrors, afterLeftParse) {
        if (refExpressionErrors != null && this.match(88)) {
          const nextCode = this.lookaheadCharCode();
          if (nextCode === 44 || nextCode === (close === 3 ? 93 : close === 8 ? 125 : 41) || nextCode === 61) {
            return this.parseMaybeDefault(this.state.startLoc, this.parseVoidPattern(refExpressionErrors));
          }
        }
        return this.parseMaybeAssignAllowIn(refExpressionErrors, afterLeftParse);
      }
      parsePropertyNamePrefixOperator(prop) {
      }
    };
    var loopLabel = {
      kind: 1
    };
    var switchLabel = {
      kind: 2
    };
    var loneSurrogate = /[\uD800-\uDFFF]/u;
    var keywordRelationalOperator = /in(?:stanceof)?/y;
    function babel7CompatTokens(tokens, input, startIndex) {
      for (let i = 0; i < tokens.length; i++) {
        const token = tokens[i];
        const {
          type
        } = token;
        if (typeof type === "number") {
          if (type === 139) {
            const {
              loc,
              start,
              value: value2,
              end
            } = token;
            const hashEndPos = start + 1;
            const hashEndLoc = createPositionWithColumnOffset(loc.start, 1);
            tokens.splice(i, 1, new Token({
              type: getExportedToken(27),
              value: "#",
              start,
              end: hashEndPos,
              startLoc: loc.start,
              endLoc: hashEndLoc
            }), new Token({
              type: getExportedToken(132),
              value: value2,
              start: hashEndPos,
              end,
              startLoc: hashEndLoc,
              endLoc: loc.end
            }));
            i++;
            continue;
          }
          if (tokenIsTemplate(type)) {
            const {
              loc,
              start,
              value: value2,
              end
            } = token;
            const backquoteEnd = start + 1;
            const backquoteEndLoc = createPositionWithColumnOffset(loc.start, 1);
            let startToken;
            if (input.charCodeAt(start - startIndex) === 96) {
              startToken = new Token({
                type: getExportedToken(22),
                value: "`",
                start,
                end: backquoteEnd,
                startLoc: loc.start,
                endLoc: backquoteEndLoc
              });
            } else {
              startToken = new Token({
                type: getExportedToken(8),
                value: "}",
                start,
                end: backquoteEnd,
                startLoc: loc.start,
                endLoc: backquoteEndLoc
              });
            }
            let templateValue, templateElementEnd, templateElementEndLoc, endToken;
            if (type === 24) {
              templateElementEnd = end - 1;
              templateElementEndLoc = createPositionWithColumnOffset(loc.end, -1);
              templateValue = value2 === null ? null : value2.slice(1, -1);
              endToken = new Token({
                type: getExportedToken(22),
                value: "`",
                start: templateElementEnd,
                end,
                startLoc: templateElementEndLoc,
                endLoc: loc.end
              });
            } else {
              templateElementEnd = end - 2;
              templateElementEndLoc = createPositionWithColumnOffset(loc.end, -2);
              templateValue = value2 === null ? null : value2.slice(1, -2);
              endToken = new Token({
                type: getExportedToken(23),
                value: "${",
                start: templateElementEnd,
                end,
                startLoc: templateElementEndLoc,
                endLoc: loc.end
              });
            }
            tokens.splice(i, 1, startToken, new Token({
              type: getExportedToken(20),
              value: templateValue,
              start: backquoteEnd,
              end: templateElementEnd,
              startLoc: backquoteEndLoc,
              endLoc: templateElementEndLoc
            }), endToken);
            i += 2;
            continue;
          }
          token.type = getExportedToken(type);
        }
      }
      return tokens;
    }
    var StatementParser = class extends ExpressionParser {
      parseTopLevel(file, program) {
        file.program = this.parseProgram(program, 140, this.options.sourceType === "module" ? "module" : "script");
        file.comments = this.comments;
        if (this.optionFlags & 256) {
          file.tokens = babel7CompatTokens(this.tokens, this.input, this.startIndex);
        }
        return this.finishNode(file, "File");
      }
      parseProgram(program, end, sourceType) {
        program.sourceType = sourceType;
        program.interpreter = this.parseInterpreterDirective();
        this.parseBlockBody(program, true, true, end);
        if (this.inModule) {
          if (!(this.optionFlags & 64) && this.scope.undefinedExports.size > 0) {
            for (const [localName, at] of Array.from(this.scope.undefinedExports)) {
              this.raise(Errors.ModuleExportUndefined, at, {
                localName
              });
            }
          }
          this.addExtra(program, "topLevelAwait", this.state.hasTopLevelAwait);
        }
        let finishedProgram;
        if (end === 140) {
          finishedProgram = this.finishNode(program, "Program");
        } else {
          finishedProgram = this.finishNodeAt(program, "Program", createPositionWithColumnOffset(this.state.startLoc, -1));
        }
        return finishedProgram;
      }
      stmtToDirective(stmt) {
        const directive = this.castNodeTo(stmt, "Directive");
        const directiveLiteral = this.castNodeTo(stmt.expression, "DirectiveLiteral");
        const expressionValue = directiveLiteral.value;
        const raw = this.input.slice(this.offsetToSourcePos(directiveLiteral.start), this.offsetToSourcePos(directiveLiteral.end));
        const val = directiveLiteral.value = raw.slice(1, -1);
        this.addExtra(directiveLiteral, "raw", raw);
        this.addExtra(directiveLiteral, "rawValue", val);
        this.addExtra(directiveLiteral, "expressionValue", expressionValue);
        directive.value = directiveLiteral;
        delete stmt.expression;
        return directive;
      }
      parseInterpreterDirective() {
        if (!this.match(28)) {
          return null;
        }
        const node = this.startNode();
        node.value = this.state.value;
        this.next();
        return this.finishNode(node, "InterpreterDirective");
      }
      isLet() {
        if (!this.isContextual(100)) {
          return false;
        }
        return this.hasFollowingBindingAtom();
      }
      isUsing() {
        if (!this.isContextual(107)) {
          return false;
        }
        return this.nextTokenIsIdentifierOnSameLine();
      }
      isForUsing() {
        if (!this.isContextual(107)) {
          return false;
        }
        const next = this.nextTokenInLineStart();
        const nextCh = this.codePointAtPos(next);
        if (this.isUnparsedContextual(next, "of")) {
          const nextCharAfterOf = this.lookaheadCharCodeSince(next + 2);
          if (nextCharAfterOf !== 61 && nextCharAfterOf !== 58 && nextCharAfterOf !== 59) {
            return false;
          }
        }
        if (this.chStartsBindingIdentifier(nextCh, next) || this.isUnparsedContextual(next, "void")) {
          return true;
        }
        return false;
      }
      nextTokenIsIdentifierOnSameLine() {
        const next = this.nextTokenInLineStart();
        const nextCh = this.codePointAtPos(next);
        return this.chStartsBindingIdentifier(nextCh, next);
      }
      isAwaitUsing() {
        if (!this.isContextual(96)) {
          return false;
        }
        let next = this.nextTokenInLineStart();
        if (this.isUnparsedContextual(next, "using")) {
          next = this.nextTokenInLineStartSince(next + 5);
          const nextCh = this.codePointAtPos(next);
          if (this.chStartsBindingIdentifier(nextCh, next)) {
            return true;
          }
        }
        return false;
      }
      chStartsBindingIdentifier(ch, pos) {
        if (isIdentifierStart(ch)) {
          keywordRelationalOperator.lastIndex = pos;
          if (keywordRelationalOperator.test(this.input)) {
            const endCh = this.codePointAtPos(keywordRelationalOperator.lastIndex);
            if (!isIdentifierChar(endCh) && endCh !== 92) {
              return false;
            }
          }
          return true;
        } else if (ch === 92) {
          return true;
        } else {
          return false;
        }
      }
      chStartsBindingPattern(ch) {
        return ch === 91 || ch === 123;
      }
      hasFollowingBindingAtom() {
        const next = this.nextTokenStart();
        const nextCh = this.codePointAtPos(next);
        return this.chStartsBindingPattern(nextCh) || this.chStartsBindingIdentifier(nextCh, next);
      }
      hasInLineFollowingBindingIdentifierOrBrace() {
        const next = this.nextTokenInLineStart();
        const nextCh = this.codePointAtPos(next);
        return nextCh === 123 || this.chStartsBindingIdentifier(nextCh, next);
      }
      allowsUsing() {
        return (this.scope.inModule || !this.scope.inTopLevel) && !this.scope.inBareCaseStatement;
      }
      parseModuleItem() {
        return this.parseStatementLike(1 | 2 | 4 | 8);
      }
      parseStatementListItem() {
        return this.parseStatementLike(2 | 4 | (!this.options.annexB || this.state.strict ? 0 : 8));
      }
      parseStatementOrSloppyAnnexBFunctionDeclaration(allowLabeledFunction = false) {
        let flags = 0;
        if (this.options.annexB && !this.state.strict) {
          flags |= 4;
          if (allowLabeledFunction) {
            flags |= 8;
          }
        }
        return this.parseStatementLike(flags);
      }
      parseStatement() {
        return this.parseStatementLike(0);
      }
      parseStatementLike(flags) {
        let decorators = null;
        if (this.match(26)) {
          decorators = this.parseDecorators(true);
        }
        return this.parseStatementContent(flags, decorators);
      }
      parseStatementContent(flags, decorators) {
        const startType = this.state.type;
        const node = this.startNode();
        const allowDeclaration = !!(flags & 2);
        const allowFunctionDeclaration = !!(flags & 4);
        const topLevel = flags & 1;
        switch (startType) {
          case 60:
            return this.parseBreakContinueStatement(node, true);
          case 63:
            return this.parseBreakContinueStatement(node, false);
          case 64:
            return this.parseDebuggerStatement(node);
          case 90:
            return this.parseDoWhileStatement(node);
          case 91:
            return this.parseForStatement(node);
          case 68:
            if (this.lookaheadCharCode() === 46) break;
            if (!allowFunctionDeclaration) {
              this.raise(this.state.strict ? Errors.StrictFunction : this.options.annexB ? Errors.SloppyFunctionAnnexB : Errors.SloppyFunction, this.state.startLoc);
            }
            return this.parseFunctionStatement(node, false, !allowDeclaration && allowFunctionDeclaration);
          case 80:
            if (!allowDeclaration) this.unexpected();
            return this.parseClass(this.maybeTakeDecorators(decorators, node), true);
          case 69:
            return this.parseIfStatement(node);
          case 70:
            return this.parseReturnStatement(node);
          case 71:
            return this.parseSwitchStatement(node);
          case 72:
            return this.parseThrowStatement(node);
          case 73:
            return this.parseTryStatement(node);
          case 96:
            if (this.isAwaitUsing()) {
              if (!this.allowsUsing()) {
                this.raise(Errors.UnexpectedUsingDeclaration, node);
              } else if (!allowDeclaration) {
                this.raise(Errors.UnexpectedLexicalDeclaration, node);
              } else if (!this.recordAwaitIfAllowed()) {
                this.raise(Errors.AwaitUsingNotInAsyncContext, node);
              }
              this.next();
              return this.parseVarStatement(node, "await using");
            }
            break;
          case 107:
            if (this.state.containsEsc || !this.hasInLineFollowingBindingIdentifierOrBrace()) {
              break;
            }
            if (!this.allowsUsing()) {
              this.raise(Errors.UnexpectedUsingDeclaration, this.state.startLoc);
            } else if (!allowDeclaration) {
              this.raise(Errors.UnexpectedLexicalDeclaration, this.state.startLoc);
            }
            return this.parseVarStatement(node, "using");
          case 100: {
            if (this.state.containsEsc) {
              break;
            }
            const next = this.nextTokenStart();
            const nextCh = this.codePointAtPos(next);
            if (nextCh !== 91) {
              if (!allowDeclaration && this.hasFollowingLineBreak()) break;
              if (!this.chStartsBindingIdentifier(nextCh, next) && nextCh !== 123) {
                break;
              }
            }
          }
          case 75: {
            if (!allowDeclaration) {
              this.raise(Errors.UnexpectedLexicalDeclaration, this.state.startLoc);
            }
          }
          case 74: {
            const kind = this.state.value;
            return this.parseVarStatement(node, kind);
          }
          case 92:
            return this.parseWhileStatement(node);
          case 76:
            return this.parseWithStatement(node);
          case 5:
            return this.parseBlock();
          case 13:
            return this.parseEmptyStatement(node);
          case 83: {
            const nextTokenCharCode = this.lookaheadCharCode();
            if (nextTokenCharCode === 40 || nextTokenCharCode === 46) {
              break;
            }
          }
          case 82: {
            if (!(this.optionFlags & 8) && !topLevel) {
              this.raise(Errors.UnexpectedImportExport, this.state.startLoc);
            }
            this.next();
            let result;
            if (startType === 83) {
              result = this.parseImport(node);
            } else {
              result = this.parseExport(node, decorators);
            }
            this.assertModuleNodeAllowed(result);
            return result;
          }
          default: {
            if (this.isAsyncFunction()) {
              if (!allowDeclaration) {
                this.raise(Errors.AsyncFunctionInSingleStatementContext, this.state.startLoc);
              }
              this.next();
              return this.parseFunctionStatement(node, true, !allowDeclaration && allowFunctionDeclaration);
            }
          }
        }
        const maybeName = this.state.value;
        const expr = this.parseExpression();
        if (tokenIsIdentifier(startType) && expr.type === "Identifier" && this.eat(14)) {
          return this.parseLabeledStatement(node, maybeName, expr, flags);
        } else {
          return this.parseExpressionStatement(node, expr, decorators);
        }
      }
      assertModuleNodeAllowed(node) {
        if (!(this.optionFlags & 8) && !this.inModule) {
          this.raise(Errors.ImportOutsideModule, node);
        }
      }
      decoratorsEnabledBeforeExport() {
        if (this.hasPlugin("decorators-legacy")) return true;
        return this.hasPlugin("decorators") && this.getPluginOption("decorators", "decoratorsBeforeExport") !== false;
      }
      maybeTakeDecorators(maybeDecorators, classNode, exportNode) {
        if (maybeDecorators) {
          var _classNode$decorators;
          if ((_classNode$decorators = classNode.decorators) != null && _classNode$decorators.length) {
            if (typeof this.getPluginOption("decorators", "decoratorsBeforeExport") !== "boolean") {
              this.raise(Errors.DecoratorsBeforeAfterExport, classNode.decorators[0]);
            }
            classNode.decorators.unshift(...maybeDecorators);
          } else {
            classNode.decorators = maybeDecorators;
          }
          this.resetStartLocationFromNode(classNode, maybeDecorators[0]);
          if (exportNode) this.resetStartLocationFromNode(exportNode, classNode);
        }
        return classNode;
      }
      canHaveLeadingDecorator() {
        return this.match(80);
      }
      parseDecorators(allowExport) {
        const decorators = [];
        do {
          decorators.push(this.parseDecorator());
        } while (this.match(26));
        if (this.match(82)) {
          if (!allowExport) {
            this.unexpected();
          }
          if (!this.decoratorsEnabledBeforeExport()) {
            this.raise(Errors.DecoratorExportClass, this.state.startLoc);
          }
        } else if (!this.canHaveLeadingDecorator()) {
          throw this.raise(Errors.UnexpectedLeadingDecorator, this.state.startLoc);
        }
        return decorators;
      }
      parseDecorator() {
        this.expectOnePlugin(["decorators", "decorators-legacy"]);
        const node = this.startNode();
        this.next();
        if (this.hasPlugin("decorators")) {
          const startLoc = this.state.startLoc;
          let expr;
          if (this.match(10)) {
            const startLoc2 = this.state.startLoc;
            this.next();
            expr = this.parseExpression();
            this.expect(11);
            expr = this.wrapParenthesis(startLoc2, expr);
            const paramsStartLoc = this.state.startLoc;
            node.expression = this.parseMaybeDecoratorArguments(expr, startLoc2);
            if (this.getPluginOption("decorators", "allowCallParenthesized") === false && node.expression !== expr) {
              this.raise(Errors.DecoratorArgumentsOutsideParentheses, paramsStartLoc);
            }
          } else {
            expr = this.parseIdentifier(false);
            while (this.eat(16)) {
              const node2 = this.startNodeAt(startLoc);
              node2.object = expr;
              if (this.match(139)) {
                this.classScope.usePrivateName(this.state.value, this.state.startLoc);
                node2.property = this.parsePrivateName();
              } else {
                node2.property = this.parseIdentifier(true);
              }
              node2.computed = false;
              expr = this.finishNode(node2, "MemberExpression");
            }
            node.expression = this.parseMaybeDecoratorArguments(expr, startLoc);
          }
        } else {
          node.expression = this.parseExprSubscripts();
        }
        return this.finishNode(node, "Decorator");
      }
      parseMaybeDecoratorArguments(expr, startLoc) {
        if (this.eat(10)) {
          const node = this.startNodeAt(startLoc);
          node.callee = expr;
          node.arguments = this.parseCallExpressionArguments();
          this.toReferencedList(node.arguments);
          return this.finishNode(node, "CallExpression");
        }
        return expr;
      }
      parseBreakContinueStatement(node, isBreak) {
        this.next();
        if (this.isLineTerminator()) {
          node.label = null;
        } else {
          node.label = this.parseIdentifier();
          this.semicolon();
        }
        this.verifyBreakContinue(node, isBreak);
        return this.finishNode(node, isBreak ? "BreakStatement" : "ContinueStatement");
      }
      verifyBreakContinue(node, isBreak) {
        let i;
        for (i = 0; i < this.state.labels.length; ++i) {
          const lab = this.state.labels[i];
          if (node.label == null || lab.name === node.label.name) {
            if (lab.kind != null && (isBreak || lab.kind === 1)) {
              break;
            }
            if (node.label && isBreak) break;
          }
        }
        if (i === this.state.labels.length) {
          const type = isBreak ? "BreakStatement" : "ContinueStatement";
          this.raise(Errors.IllegalBreakContinue, node, {
            type
          });
        }
      }
      parseDebuggerStatement(node) {
        this.next();
        this.semicolon();
        return this.finishNode(node, "DebuggerStatement");
      }
      parseHeaderExpression() {
        this.expect(10);
        const val = this.parseExpression();
        this.expect(11);
        return val;
      }
      parseDoWhileStatement(node) {
        this.next();
        this.state.labels.push(loopLabel);
        node.body = this.withSmartMixTopicForbiddingContext(() => this.parseStatement());
        this.state.labels.pop();
        this.expect(92);
        node.test = this.parseHeaderExpression();
        this.eat(13);
        return this.finishNode(node, "DoWhileStatement");
      }
      parseForStatement(node) {
        this.next();
        this.state.labels.push(loopLabel);
        let awaitAt = null;
        if (this.isContextual(96) && this.recordAwaitIfAllowed()) {
          awaitAt = this.state.startLoc;
          this.next();
        }
        this.scope.enter(0);
        this.expect(10);
        if (this.match(13)) {
          if (awaitAt !== null) {
            this.unexpected(awaitAt);
          }
          return this.parseFor(node, null);
        }
        const startsWithLet = this.isContextual(100);
        {
          const startsWithAwaitUsing = this.isAwaitUsing();
          const starsWithUsingDeclaration = startsWithAwaitUsing || this.isForUsing();
          const isLetOrUsing = startsWithLet && this.hasFollowingBindingAtom() || starsWithUsingDeclaration;
          if (this.match(74) || this.match(75) || isLetOrUsing) {
            const initNode = this.startNode();
            let kind;
            if (startsWithAwaitUsing) {
              kind = "await using";
              if (!this.recordAwaitIfAllowed()) {
                this.raise(Errors.AwaitUsingNotInAsyncContext, this.state.startLoc);
              }
              this.next();
            } else {
              kind = this.state.value;
            }
            this.next();
            this.parseVar(initNode, true, kind);
            const init2 = this.finishNode(initNode, "VariableDeclaration");
            const isForIn = this.match(58);
            if (isForIn && starsWithUsingDeclaration) {
              this.raise(Errors.ForInUsing, init2);
            }
            if ((isForIn || this.isContextual(102)) && init2.declarations.length === 1) {
              return this.parseForIn(node, init2, awaitAt);
            }
            if (awaitAt !== null) {
              this.unexpected(awaitAt);
            }
            return this.parseFor(node, init2);
          }
        }
        const startsWithAsync = this.isContextual(95);
        const refExpressionErrors = new ExpressionErrors();
        const init = this.parseExpression(true, refExpressionErrors);
        const isForOf = this.isContextual(102);
        if (isForOf) {
          if (startsWithLet) {
            this.raise(Errors.ForOfLet, init);
          }
          if (awaitAt === null && startsWithAsync && init.type === "Identifier") {
            this.raise(Errors.ForOfAsync, init);
          }
        }
        if (isForOf || this.match(58)) {
          this.checkDestructuringPrivate(refExpressionErrors);
          this.toAssignable(init, true);
          const type = isForOf ? "ForOfStatement" : "ForInStatement";
          this.checkLVal(init, {
            type
          });
          return this.parseForIn(node, init, awaitAt);
        } else {
          this.checkExpressionErrors(refExpressionErrors, true);
        }
        if (awaitAt !== null) {
          this.unexpected(awaitAt);
        }
        return this.parseFor(node, init);
      }
      parseFunctionStatement(node, isAsync, isHangingDeclaration) {
        this.next();
        return this.parseFunction(node, 1 | (isHangingDeclaration ? 2 : 0) | (isAsync ? 8 : 0));
      }
      parseIfStatement(node) {
        this.next();
        node.test = this.parseHeaderExpression();
        node.consequent = this.parseStatementOrSloppyAnnexBFunctionDeclaration();
        node.alternate = this.eat(66) ? this.parseStatementOrSloppyAnnexBFunctionDeclaration() : null;
        return this.finishNode(node, "IfStatement");
      }
      parseReturnStatement(node) {
        if (!this.prodParam.hasReturn) {
          this.raise(Errors.IllegalReturn, this.state.startLoc);
        }
        this.next();
        if (this.isLineTerminator()) {
          node.argument = null;
        } else {
          node.argument = this.parseExpression();
          this.semicolon();
        }
        return this.finishNode(node, "ReturnStatement");
      }
      parseSwitchStatement(node) {
        this.next();
        node.discriminant = this.parseHeaderExpression();
        const cases = node.cases = [];
        this.expect(5);
        this.state.labels.push(switchLabel);
        this.scope.enter(256);
        let cur;
        for (let sawDefault; !this.match(8); ) {
          if (this.match(61) || this.match(65)) {
            const isCase = this.match(61);
            if (cur) this.finishNode(cur, "SwitchCase");
            cases.push(cur = this.startNode());
            cur.consequent = [];
            this.next();
            if (isCase) {
              cur.test = this.parseExpression();
            } else {
              if (sawDefault) {
                this.raise(Errors.MultipleDefaultsInSwitch, this.state.lastTokStartLoc);
              }
              sawDefault = true;
              cur.test = null;
            }
            this.expect(14);
          } else {
            if (cur) {
              cur.consequent.push(this.parseStatementListItem());
            } else {
              this.unexpected();
            }
          }
        }
        this.scope.exit();
        if (cur) this.finishNode(cur, "SwitchCase");
        this.next();
        this.state.labels.pop();
        return this.finishNode(node, "SwitchStatement");
      }
      parseThrowStatement(node) {
        this.next();
        if (this.hasPrecedingLineBreak()) {
          this.raise(Errors.NewlineAfterThrow, this.state.lastTokEndLoc);
        }
        node.argument = this.parseExpression();
        this.semicolon();
        return this.finishNode(node, "ThrowStatement");
      }
      parseCatchClauseParam() {
        const param = this.parseBindingAtom();
        this.scope.enter(this.options.annexB && param.type === "Identifier" ? 8 : 0);
        this.checkLVal(param, {
          type: "CatchClause"
        }, 9);
        return param;
      }
      parseTryStatement(node) {
        this.next();
        node.block = this.parseBlock();
        node.handler = null;
        if (this.match(62)) {
          const clause = this.startNode();
          this.next();
          if (this.match(10)) {
            this.expect(10);
            clause.param = this.parseCatchClauseParam();
            this.expect(11);
          } else {
            clause.param = null;
            this.scope.enter(0);
          }
          clause.body = this.withSmartMixTopicForbiddingContext(() => this.parseBlock(false, false));
          this.scope.exit();
          node.handler = this.finishNode(clause, "CatchClause");
        }
        node.finalizer = this.eat(67) ? this.parseBlock() : null;
        if (!node.handler && !node.finalizer) {
          this.raise(Errors.NoCatchOrFinally, node);
        }
        return this.finishNode(node, "TryStatement");
      }
      parseVarStatement(node, kind, allowMissingInitializer = false) {
        this.next();
        this.parseVar(node, false, kind, allowMissingInitializer);
        this.semicolon();
        return this.finishNode(node, "VariableDeclaration");
      }
      parseWhileStatement(node) {
        this.next();
        node.test = this.parseHeaderExpression();
        this.state.labels.push(loopLabel);
        node.body = this.withSmartMixTopicForbiddingContext(() => this.parseStatement());
        this.state.labels.pop();
        return this.finishNode(node, "WhileStatement");
      }
      parseWithStatement(node) {
        if (this.state.strict) {
          this.raise(Errors.StrictWith, this.state.startLoc);
        }
        this.next();
        node.object = this.parseHeaderExpression();
        node.body = this.withSmartMixTopicForbiddingContext(() => this.parseStatement());
        return this.finishNode(node, "WithStatement");
      }
      parseEmptyStatement(node) {
        this.next();
        return this.finishNode(node, "EmptyStatement");
      }
      parseLabeledStatement(node, maybeName, expr, flags) {
        for (const label of this.state.labels) {
          if (label.name === maybeName) {
            this.raise(Errors.LabelRedeclaration, expr, {
              labelName: maybeName
            });
          }
        }
        const kind = tokenIsLoop(this.state.type) ? 1 : this.match(71) ? 2 : null;
        for (let i = this.state.labels.length - 1; i >= 0; i--) {
          const label = this.state.labels[i];
          if (label.statementStart === node.start) {
            label.statementStart = this.sourceToOffsetPos(this.state.start);
            label.kind = kind;
          } else {
            break;
          }
        }
        this.state.labels.push({
          name: maybeName,
          kind,
          statementStart: this.sourceToOffsetPos(this.state.start)
        });
        node.body = flags & 8 ? this.parseStatementOrSloppyAnnexBFunctionDeclaration(true) : this.parseStatement();
        this.state.labels.pop();
        node.label = expr;
        return this.finishNode(node, "LabeledStatement");
      }
      parseExpressionStatement(node, expr, decorators) {
        node.expression = expr;
        this.semicolon();
        return this.finishNode(node, "ExpressionStatement");
      }
      parseBlock(allowDirectives = false, createNewLexicalScope = true, afterBlockParse) {
        const node = this.startNode();
        if (allowDirectives) {
          this.state.strictErrors.clear();
        }
        this.expect(5);
        if (createNewLexicalScope) {
          this.scope.enter(0);
        }
        this.parseBlockBody(node, allowDirectives, false, 8, afterBlockParse);
        if (createNewLexicalScope) {
          this.scope.exit();
        }
        return this.finishNode(node, "BlockStatement");
      }
      isValidDirective(stmt) {
        return stmt.type === "ExpressionStatement" && stmt.expression.type === "StringLiteral" && !stmt.expression.extra.parenthesized;
      }
      parseBlockBody(node, allowDirectives, topLevel, end, afterBlockParse) {
        const body = node.body = [];
        const directives = node.directives = [];
        this.parseBlockOrModuleBlockBody(body, allowDirectives ? directives : void 0, topLevel, end, afterBlockParse);
      }
      parseBlockOrModuleBlockBody(body, directives, topLevel, end, afterBlockParse) {
        const oldStrict = this.state.strict;
        let hasStrictModeDirective = false;
        let parsedNonDirective = false;
        while (!this.match(end)) {
          const stmt = topLevel ? this.parseModuleItem() : this.parseStatementListItem();
          if (directives && !parsedNonDirective) {
            if (this.isValidDirective(stmt)) {
              const directive = this.stmtToDirective(stmt);
              directives.push(directive);
              if (!hasStrictModeDirective && directive.value.value === "use strict") {
                hasStrictModeDirective = true;
                this.setStrict(true);
              }
              continue;
            }
            parsedNonDirective = true;
            this.state.strictErrors.clear();
          }
          body.push(stmt);
        }
        afterBlockParse == null || afterBlockParse.call(this, hasStrictModeDirective);
        if (!oldStrict) {
          this.setStrict(false);
        }
        this.next();
      }
      parseFor(node, init) {
        node.init = init;
        this.semicolon(false);
        node.test = this.match(13) ? null : this.parseExpression();
        this.semicolon(false);
        node.update = this.match(11) ? null : this.parseExpression();
        this.expect(11);
        node.body = this.withSmartMixTopicForbiddingContext(() => this.parseStatement());
        this.scope.exit();
        this.state.labels.pop();
        return this.finishNode(node, "ForStatement");
      }
      parseForIn(node, init, awaitAt) {
        const isForIn = this.match(58);
        this.next();
        if (isForIn) {
          if (awaitAt !== null) this.unexpected(awaitAt);
        } else {
          node.await = awaitAt !== null;
        }
        if (init.type === "VariableDeclaration" && init.declarations[0].init != null && (!isForIn || !this.options.annexB || this.state.strict || init.kind !== "var" || init.declarations[0].id.type !== "Identifier")) {
          this.raise(Errors.ForInOfLoopInitializer, init, {
            type: isForIn ? "ForInStatement" : "ForOfStatement"
          });
        }
        if (init.type === "AssignmentPattern") {
          this.raise(Errors.InvalidLhs, init, {
            ancestor: {
              type: "ForStatement"
            }
          });
        }
        node.left = init;
        node.right = isForIn ? this.parseExpression() : this.parseMaybeAssignAllowIn();
        this.expect(11);
        node.body = this.withSmartMixTopicForbiddingContext(() => this.parseStatement());
        this.scope.exit();
        this.state.labels.pop();
        return this.finishNode(node, isForIn ? "ForInStatement" : "ForOfStatement");
      }
      parseVar(node, isFor, kind, allowMissingInitializer = false) {
        const declarations = node.declarations = [];
        node.kind = kind;
        for (; ; ) {
          const decl = this.startNode();
          this.parseVarId(decl, kind);
          decl.init = !this.eat(29) ? null : isFor ? this.parseMaybeAssignDisallowIn() : this.parseMaybeAssignAllowIn();
          if (decl.init === null && !allowMissingInitializer) {
            if (decl.id.type !== "Identifier" && !(isFor && (this.match(58) || this.isContextual(102)))) {
              this.raise(Errors.DeclarationMissingInitializer, this.state.lastTokEndLoc, {
                kind: "destructuring"
              });
            } else if ((kind === "const" || kind === "using" || kind === "await using") && !(this.match(58) || this.isContextual(102))) {
              this.raise(Errors.DeclarationMissingInitializer, this.state.lastTokEndLoc, {
                kind
              });
            }
          }
          declarations.push(this.finishNode(decl, "VariableDeclarator"));
          if (!this.eat(12)) break;
        }
        return node;
      }
      parseVarId(decl, kind) {
        const id = this.parseBindingAtom();
        if (kind === "using" || kind === "await using") {
          if (id.type === "ArrayPattern" || id.type === "ObjectPattern") {
            this.raise(Errors.UsingDeclarationHasBindingPattern, id.loc.start);
          }
        } else {
          if (id.type === "VoidPattern") {
            this.raise(Errors.UnexpectedVoidPattern, id.loc.start);
          }
        }
        this.checkLVal(id, {
          type: "VariableDeclarator"
        }, kind === "var" ? 5 : 8201);
        decl.id = id;
      }
      parseAsyncFunctionExpression(node) {
        return this.parseFunction(node, 8);
      }
      parseFunction(node, flags = 0) {
        const hangingDeclaration = flags & 2;
        const isDeclaration = !!(flags & 1);
        const requireId = isDeclaration && !(flags & 4);
        const isAsync = !!(flags & 8);
        this.initFunction(node, isAsync);
        if (this.match(55)) {
          if (hangingDeclaration) {
            this.raise(Errors.GeneratorInSingleStatementContext, this.state.startLoc);
          }
          this.next();
          node.generator = true;
        }
        if (isDeclaration) {
          node.id = this.parseFunctionId(requireId);
        }
        const oldMaybeInArrowParameters = this.state.maybeInArrowParameters;
        this.state.maybeInArrowParameters = false;
        this.scope.enter(514);
        this.prodParam.enter(functionFlags(isAsync, node.generator));
        if (!isDeclaration) {
          node.id = this.parseFunctionId();
        }
        this.parseFunctionParams(node, false);
        this.withSmartMixTopicForbiddingContext(() => {
          this.parseFunctionBodyAndFinish(node, isDeclaration ? "FunctionDeclaration" : "FunctionExpression");
        });
        this.prodParam.exit();
        this.scope.exit();
        if (isDeclaration && !hangingDeclaration) {
          this.registerFunctionStatementId(node);
        }
        this.state.maybeInArrowParameters = oldMaybeInArrowParameters;
        return node;
      }
      parseFunctionId(requireId) {
        return requireId || tokenIsIdentifier(this.state.type) ? this.parseIdentifier() : null;
      }
      parseFunctionParams(node, isConstructor) {
        this.expect(10);
        this.expressionScope.enter(newParameterDeclarationScope());
        node.params = this.parseBindingList(11, 41, 2 | (isConstructor ? 4 : 0));
        this.expressionScope.exit();
      }
      registerFunctionStatementId(node) {
        if (!node.id) return;
        this.scope.declareName(node.id.name, !this.options.annexB || this.state.strict || node.generator || node.async ? this.scope.treatFunctionsAsVar ? 5 : 8201 : 17, node.id.loc.start);
      }
      parseClass(node, isStatement, optionalId) {
        this.next();
        const oldStrict = this.state.strict;
        this.state.strict = true;
        this.parseClassId(node, isStatement, optionalId);
        this.parseClassSuper(node);
        node.body = this.parseClassBody(!!node.superClass, oldStrict);
        return this.finishNode(node, isStatement ? "ClassDeclaration" : "ClassExpression");
      }
      isClassProperty() {
        return this.match(29) || this.match(13) || this.match(8);
      }
      isClassMethod() {
        return this.match(10);
      }
      nameIsConstructor(key) {
        return key.type === "Identifier" && key.name === "constructor" || key.type === "StringLiteral" && key.value === "constructor";
      }
      isNonstaticConstructor(method) {
        return !method.computed && !method.static && this.nameIsConstructor(method.key);
      }
      parseClassBody(hadSuperClass, oldStrict) {
        this.classScope.enter();
        const state = {
          hadConstructor: false,
          hadSuperClass
        };
        let decorators = [];
        const classBody = this.startNode();
        classBody.body = [];
        this.expect(5);
        this.withSmartMixTopicForbiddingContext(() => {
          while (!this.match(8)) {
            if (this.eat(13)) {
              if (decorators.length > 0) {
                throw this.raise(Errors.DecoratorSemicolon, this.state.lastTokEndLoc);
              }
              continue;
            }
            if (this.match(26)) {
              decorators.push(this.parseDecorator());
              continue;
            }
            const member = this.startNode();
            if (decorators.length) {
              member.decorators = decorators;
              this.resetStartLocationFromNode(member, decorators[0]);
              decorators = [];
            }
            this.parseClassMember(classBody, member, state);
            if (member.kind === "constructor" && member.decorators && member.decorators.length > 0) {
              this.raise(Errors.DecoratorConstructor, member);
            }
          }
        });
        this.state.strict = oldStrict;
        this.next();
        if (decorators.length) {
          throw this.raise(Errors.TrailingDecorator, this.state.startLoc);
        }
        this.classScope.exit();
        return this.finishNode(classBody, "ClassBody");
      }
      parseClassMemberFromModifier(classBody, member) {
        const key = this.parseIdentifier(true);
        if (this.isClassMethod()) {
          const method = member;
          method.kind = "method";
          method.computed = false;
          method.key = key;
          method.static = false;
          this.pushClassMethod(classBody, method, false, false, false, false);
          return true;
        } else if (this.isClassProperty()) {
          const prop = member;
          prop.computed = false;
          prop.key = key;
          prop.static = false;
          classBody.body.push(this.parseClassProperty(prop));
          return true;
        }
        this.resetPreviousNodeTrailingComments(key);
        return false;
      }
      parseClassMember(classBody, member, state) {
        const isStatic = this.isContextual(106);
        if (isStatic) {
          if (this.parseClassMemberFromModifier(classBody, member)) {
            return;
          }
          if (this.eat(5)) {
            this.parseClassStaticBlock(classBody, member);
            return;
          }
        }
        this.parseClassMemberWithIsStatic(classBody, member, state, isStatic);
      }
      parseClassMemberWithIsStatic(classBody, member, state, isStatic) {
        const publicMethod = member;
        const privateMethod = member;
        const publicProp = member;
        const privateProp = member;
        const accessorProp = member;
        const method = publicMethod;
        const publicMember = publicMethod;
        member.static = isStatic;
        this.parsePropertyNamePrefixOperator(member);
        if (this.eat(55)) {
          method.kind = "method";
          const isPrivateName = this.match(139);
          this.parseClassElementName(method);
          this.parsePostMemberNameModifiers(method);
          if (isPrivateName) {
            this.pushClassPrivateMethod(classBody, privateMethod, true, false);
            return;
          }
          if (this.isNonstaticConstructor(publicMethod)) {
            this.raise(Errors.ConstructorIsGenerator, publicMethod.key);
          }
          this.pushClassMethod(classBody, publicMethod, true, false, false, false);
          return;
        }
        const isContextual = !this.state.containsEsc && tokenIsIdentifier(this.state.type);
        const key = this.parseClassElementName(member);
        const maybeContextualKw = isContextual ? key.name : null;
        const isPrivate = this.isPrivateName(key);
        const maybeQuestionTokenStartLoc = this.state.startLoc;
        this.parsePostMemberNameModifiers(publicMember);
        if (this.isClassMethod()) {
          method.kind = "method";
          if (isPrivate) {
            this.pushClassPrivateMethod(classBody, privateMethod, false, false);
            return;
          }
          const isConstructor = this.isNonstaticConstructor(publicMethod);
          let allowsDirectSuper = false;
          if (isConstructor) {
            publicMethod.kind = "constructor";
            if (state.hadConstructor && !this.hasPlugin("typescript")) {
              this.raise(Errors.DuplicateConstructor, key);
            }
            if (isConstructor && this.hasPlugin("typescript") && member.override) {
              this.raise(Errors.OverrideOnConstructor, key);
            }
            state.hadConstructor = true;
            allowsDirectSuper = state.hadSuperClass;
          }
          this.pushClassMethod(classBody, publicMethod, false, false, isConstructor, allowsDirectSuper);
        } else if (this.isClassProperty()) {
          if (isPrivate) {
            this.pushClassPrivateProperty(classBody, privateProp);
          } else {
            this.pushClassProperty(classBody, publicProp);
          }
        } else if (maybeContextualKw === "async" && !this.isLineTerminator()) {
          this.resetPreviousNodeTrailingComments(key);
          const isGenerator = this.eat(55);
          if (publicMember.optional) {
            this.unexpected(maybeQuestionTokenStartLoc);
          }
          method.kind = "method";
          const isPrivate2 = this.match(139);
          this.parseClassElementName(method);
          this.parsePostMemberNameModifiers(publicMember);
          if (isPrivate2) {
            this.pushClassPrivateMethod(classBody, privateMethod, isGenerator, true);
          } else {
            if (this.isNonstaticConstructor(publicMethod)) {
              this.raise(Errors.ConstructorIsAsync, publicMethod.key);
            }
            this.pushClassMethod(classBody, publicMethod, isGenerator, true, false, false);
          }
        } else if ((maybeContextualKw === "get" || maybeContextualKw === "set") && !(this.match(55) && this.isLineTerminator())) {
          this.resetPreviousNodeTrailingComments(key);
          method.kind = maybeContextualKw;
          const isPrivate2 = this.match(139);
          this.parseClassElementName(publicMethod);
          if (isPrivate2) {
            this.pushClassPrivateMethod(classBody, privateMethod, false, false);
          } else {
            if (this.isNonstaticConstructor(publicMethod)) {
              this.raise(Errors.ConstructorIsAccessor, publicMethod.key);
            }
            this.pushClassMethod(classBody, publicMethod, false, false, false, false);
          }
          this.checkGetterSetterParams(publicMethod);
        } else if (maybeContextualKw === "accessor" && !this.isLineTerminator()) {
          this.expectPlugin("decoratorAutoAccessors");
          this.resetPreviousNodeTrailingComments(key);
          const isPrivate2 = this.match(139);
          this.parseClassElementName(publicProp);
          this.pushClassAccessorProperty(classBody, accessorProp, isPrivate2);
        } else if (this.isLineTerminator()) {
          if (isPrivate) {
            this.pushClassPrivateProperty(classBody, privateProp);
          } else {
            this.pushClassProperty(classBody, publicProp);
          }
        } else {
          this.unexpected();
        }
      }
      parseClassElementName(member) {
        const {
          type,
          value: value2
        } = this.state;
        if ((type === 132 || type === 134) && member.static && value2 === "prototype") {
          this.raise(Errors.StaticPrototype, this.state.startLoc);
        }
        if (type === 139) {
          if (value2 === "constructor") {
            this.raise(Errors.ConstructorClassPrivateField, this.state.startLoc);
          }
          const key = this.parsePrivateName();
          member.key = key;
          return key;
        }
        this.parsePropertyName(member);
        return member.key;
      }
      parseClassStaticBlock(classBody, member) {
        var _member$decorators;
        this.scope.enter(576 | 128 | 16);
        const oldLabels = this.state.labels;
        this.state.labels = [];
        this.prodParam.enter(0);
        const body = member.body = [];
        this.parseBlockOrModuleBlockBody(body, void 0, false, 8);
        this.prodParam.exit();
        this.scope.exit();
        this.state.labels = oldLabels;
        classBody.body.push(this.finishNode(member, "StaticBlock"));
        if ((_member$decorators = member.decorators) != null && _member$decorators.length) {
          this.raise(Errors.DecoratorStaticBlock, member);
        }
      }
      pushClassProperty(classBody, prop) {
        if (!prop.computed && this.nameIsConstructor(prop.key)) {
          this.raise(Errors.ConstructorClassField, prop.key);
        }
        classBody.body.push(this.parseClassProperty(prop));
      }
      pushClassPrivateProperty(classBody, prop) {
        const node = this.parseClassPrivateProperty(prop);
        classBody.body.push(node);
        this.classScope.declarePrivateName(this.getPrivateNameSV(node.key), 0, node.key.loc.start);
      }
      pushClassAccessorProperty(classBody, prop, isPrivate) {
        if (!isPrivate && !prop.computed && this.nameIsConstructor(prop.key)) {
          this.raise(Errors.ConstructorClassField, prop.key);
        }
        const node = this.parseClassAccessorProperty(prop);
        classBody.body.push(node);
        if (isPrivate) {
          this.classScope.declarePrivateName(this.getPrivateNameSV(node.key), 0, node.key.loc.start);
        }
      }
      pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) {
        classBody.body.push(this.parseMethod(method, isGenerator, isAsync, isConstructor, allowsDirectSuper, "ClassMethod", true));
      }
      pushClassPrivateMethod(classBody, method, isGenerator, isAsync) {
        const node = this.parseMethod(method, isGenerator, isAsync, false, false, "ClassPrivateMethod", true);
        classBody.body.push(node);
        const kind = node.kind === "get" ? node.static ? 6 : 2 : node.kind === "set" ? node.static ? 5 : 1 : 0;
        this.declareClassPrivateMethodInScope(node, kind);
      }
      declareClassPrivateMethodInScope(node, kind) {
        this.classScope.declarePrivateName(this.getPrivateNameSV(node.key), kind, node.key.loc.start);
      }
      parsePostMemberNameModifiers(methodOrProp) {
      }
      parseClassPrivateProperty(node) {
        this.parseInitializer(node);
        this.semicolon();
        return this.finishNode(node, "ClassPrivateProperty");
      }
      parseClassProperty(node) {
        this.parseInitializer(node);
        this.semicolon();
        return this.finishNode(node, "ClassProperty");
      }
      parseClassAccessorProperty(node) {
        this.parseInitializer(node);
        this.semicolon();
        return this.finishNode(node, "ClassAccessorProperty");
      }
      parseInitializer(node) {
        this.scope.enter(576 | 16);
        this.expressionScope.enter(newExpressionScope());
        this.prodParam.enter(0);
        node.value = this.eat(29) ? this.parseMaybeAssignAllowIn() : null;
        this.expressionScope.exit();
        this.prodParam.exit();
        this.scope.exit();
      }
      parseClassId(node, isStatement, optionalId, bindingType = 8331) {
        if (tokenIsIdentifier(this.state.type)) {
          node.id = this.parseIdentifier();
          if (isStatement) {
            this.declareNameFromIdentifier(node.id, bindingType);
          }
        } else {
          if (optionalId || !isStatement) {
            node.id = null;
          } else {
            throw this.raise(Errors.MissingClassName, this.state.startLoc);
          }
        }
      }
      parseClassSuper(node) {
        node.superClass = this.eat(81) ? this.parseExprSubscripts() : null;
      }
      parseExport(node, decorators) {
        const maybeDefaultIdentifier = this.parseMaybeImportPhase(node, true);
        const hasDefault = this.maybeParseExportDefaultSpecifier(node, maybeDefaultIdentifier);
        const parseAfterDefault = !hasDefault || this.eat(12);
        const hasStar = parseAfterDefault && this.eatExportStar(node);
        const hasNamespace = hasStar && this.maybeParseExportNamespaceSpecifier(node);
        const parseAfterNamespace = parseAfterDefault && (!hasNamespace || this.eat(12));
        const isFromRequired = hasDefault || hasStar;
        if (hasStar && !hasNamespace) {
          if (hasDefault) this.unexpected();
          if (decorators) {
            throw this.raise(Errors.UnsupportedDecoratorExport, node);
          }
          this.parseExportFrom(node, true);
          this.sawUnambiguousESM = true;
          return this.finishNode(node, "ExportAllDeclaration");
        }
        const hasSpecifiers = this.maybeParseExportNamedSpecifiers(node);
        if (hasDefault && parseAfterDefault && !hasStar && !hasSpecifiers) {
          this.unexpected(null, 5);
        }
        if (hasNamespace && parseAfterNamespace) {
          this.unexpected(null, 98);
        }
        let hasDeclaration;
        if (isFromRequired || hasSpecifiers) {
          hasDeclaration = false;
          if (decorators) {
            throw this.raise(Errors.UnsupportedDecoratorExport, node);
          }
          this.parseExportFrom(node, isFromRequired);
        } else {
          hasDeclaration = this.maybeParseExportDeclaration(node);
        }
        if (isFromRequired || hasSpecifiers || hasDeclaration) {
          var _node2$declaration;
          const node2 = node;
          this.checkExport(node2, true, false, !!node2.source);
          if (((_node2$declaration = node2.declaration) == null ? void 0 : _node2$declaration.type) === "ClassDeclaration") {
            this.maybeTakeDecorators(decorators, node2.declaration, node2);
          } else if (decorators) {
            throw this.raise(Errors.UnsupportedDecoratorExport, node);
          }
          this.sawUnambiguousESM = true;
          return this.finishNode(node2, "ExportNamedDeclaration");
        }
        if (this.eat(65)) {
          const node2 = node;
          const decl = this.parseExportDefaultExpression();
          node2.declaration = decl;
          if (decl.type === "ClassDeclaration") {
            this.maybeTakeDecorators(decorators, decl, node2);
          } else if (decorators) {
            throw this.raise(Errors.UnsupportedDecoratorExport, node);
          }
          this.checkExport(node2, true, true);
          this.sawUnambiguousESM = true;
          return this.finishNode(node2, "ExportDefaultDeclaration");
        }
        throw this.unexpected(null, 5);
      }
      eatExportStar(node) {
        return this.eat(55);
      }
      maybeParseExportDefaultSpecifier(node, maybeDefaultIdentifier) {
        if (maybeDefaultIdentifier || this.isExportDefaultSpecifier()) {
          this.expectPlugin("exportDefaultFrom", maybeDefaultIdentifier == null ? void 0 : maybeDefaultIdentifier.loc.start);
          const id = maybeDefaultIdentifier || this.parseIdentifier(true);
          const specifier = this.startNodeAtNode(id);
          specifier.exported = id;
          node.specifiers = [this.finishNode(specifier, "ExportDefaultSpecifier")];
          return true;
        }
        return false;
      }
      maybeParseExportNamespaceSpecifier(node) {
        if (this.isContextual(93)) {
          var _ref, _ref$specifiers;
          (_ref$specifiers = (_ref = node).specifiers) != null ? _ref$specifiers : _ref.specifiers = [];
          const specifier = this.startNodeAt(this.state.lastTokStartLoc);
          this.next();
          specifier.exported = this.parseModuleExportName();
          node.specifiers.push(this.finishNode(specifier, "ExportNamespaceSpecifier"));
          return true;
        }
        return false;
      }
      maybeParseExportNamedSpecifiers(node) {
        if (this.match(5)) {
          const node2 = node;
          if (!node2.specifiers) node2.specifiers = [];
          const isTypeExport = node2.exportKind === "type";
          node2.specifiers.push(...this.parseExportSpecifiers(isTypeExport));
          node2.source = null;
          if (this.hasPlugin("importAssertions")) {
            node2.assertions = [];
          } else {
            node2.attributes = [];
          }
          node2.declaration = null;
          return true;
        }
        return false;
      }
      maybeParseExportDeclaration(node) {
        if (this.shouldParseExportDeclaration()) {
          node.specifiers = [];
          node.source = null;
          if (this.hasPlugin("importAssertions")) {
            node.assertions = [];
          } else {
            node.attributes = [];
          }
          node.declaration = this.parseExportDeclaration(node);
          return true;
        }
        return false;
      }
      isAsyncFunction() {
        if (!this.isContextual(95)) return false;
        const next = this.nextTokenInLineStart();
        return this.isUnparsedContextual(next, "function");
      }
      parseExportDefaultExpression() {
        const expr = this.startNode();
        if (this.match(68)) {
          this.next();
          return this.parseFunction(expr, 1 | 4);
        } else if (this.isAsyncFunction()) {
          this.next();
          this.next();
          return this.parseFunction(expr, 1 | 4 | 8);
        }
        if (this.match(80)) {
          return this.parseClass(expr, true, true);
        }
        if (this.match(26)) {
          if (this.hasPlugin("decorators") && this.getPluginOption("decorators", "decoratorsBeforeExport") === true) {
            this.raise(Errors.DecoratorBeforeExport, this.state.startLoc);
          }
          return this.parseClass(this.maybeTakeDecorators(this.parseDecorators(false), this.startNode()), true, true);
        }
        if (this.match(75) || this.match(74) || this.isLet() || this.isUsing() || this.isAwaitUsing()) {
          throw this.raise(Errors.UnsupportedDefaultExport, this.state.startLoc);
        }
        const res = this.parseMaybeAssignAllowIn();
        this.semicolon();
        return res;
      }
      parseExportDeclaration(node) {
        if (this.match(80)) {
          const node2 = this.parseClass(this.startNode(), true, false);
          return node2;
        }
        return this.parseStatementListItem();
      }
      isExportDefaultSpecifier() {
        const {
          type
        } = this.state;
        if (tokenIsIdentifier(type)) {
          if (type === 95 && !this.state.containsEsc || type === 100) {
            return false;
          }
          if ((type === 130 || type === 129) && !this.state.containsEsc) {
            const next2 = this.nextTokenStart();
            const nextChar = this.input.charCodeAt(next2);
            if (nextChar === 123 || this.chStartsBindingIdentifier(nextChar, next2) && !this.input.startsWith("from", next2)) {
              this.expectOnePlugin(["flow", "typescript"]);
              return false;
            }
          }
        } else if (!this.match(65)) {
          return false;
        }
        const next = this.nextTokenStart();
        const hasFrom = this.isUnparsedContextual(next, "from");
        if (this.input.charCodeAt(next) === 44 || tokenIsIdentifier(this.state.type) && hasFrom) {
          return true;
        }
        if (this.match(65) && hasFrom) {
          const nextAfterFrom = this.input.charCodeAt(this.nextTokenStartSince(next + 4));
          return nextAfterFrom === 34 || nextAfterFrom === 39;
        }
        return false;
      }
      parseExportFrom(node, expect) {
        if (this.eatContextual(98)) {
          node.source = this.parseImportSource();
          this.checkExport(node);
          this.maybeParseImportAttributes(node);
          this.checkJSONModuleImport(node);
        } else if (expect) {
          this.unexpected();
        }
        this.semicolon();
      }
      shouldParseExportDeclaration() {
        const {
          type
        } = this.state;
        if (type === 26) {
          this.expectOnePlugin(["decorators", "decorators-legacy"]);
          if (this.hasPlugin("decorators")) {
            if (this.getPluginOption("decorators", "decoratorsBeforeExport") === true) {
              this.raise(Errors.DecoratorBeforeExport, this.state.startLoc);
            }
            return true;
          }
        }
        if (this.isUsing()) {
          this.raise(Errors.UsingDeclarationExport, this.state.startLoc);
          return true;
        }
        if (this.isAwaitUsing()) {
          this.raise(Errors.UsingDeclarationExport, this.state.startLoc);
          return true;
        }
        return type === 74 || type === 75 || type === 68 || type === 80 || this.isLet() || this.isAsyncFunction();
      }
      checkExport(node, checkNames, isDefault, isFrom) {
        if (checkNames) {
          var _node$specifiers;
          if (isDefault) {
            this.checkDuplicateExports(node, "default");
            if (this.hasPlugin("exportDefaultFrom")) {
              var _declaration$extra;
              const declaration = node.declaration;
              if (declaration.type === "Identifier" && declaration.name === "from" && declaration.end - declaration.start === 4 && !((_declaration$extra = declaration.extra) != null && _declaration$extra.parenthesized)) {
                this.raise(Errors.ExportDefaultFromAsIdentifier, declaration);
              }
            }
          } else if ((_node$specifiers = node.specifiers) != null && _node$specifiers.length) {
            for (const specifier of node.specifiers) {
              const {
                exported
              } = specifier;
              const exportName = exported.type === "Identifier" ? exported.name : exported.value;
              this.checkDuplicateExports(specifier, exportName);
              if (!isFrom && specifier.local) {
                const {
                  local
                } = specifier;
                if (local.type !== "Identifier") {
                  this.raise(Errors.ExportBindingIsString, specifier, {
                    localName: local.value,
                    exportName
                  });
                } else {
                  this.checkReservedWord(local.name, local.loc.start, true, false);
                  this.scope.checkLocalExport(local);
                }
              }
            }
          } else if (node.declaration) {
            const decl = node.declaration;
            if (decl.type === "FunctionDeclaration" || decl.type === "ClassDeclaration") {
              const {
                id
              } = decl;
              if (!id) throw new Error("Assertion failure");
              this.checkDuplicateExports(node, id.name);
            } else if (decl.type === "VariableDeclaration") {
              for (const declaration of decl.declarations) {
                this.checkDeclaration(declaration.id);
              }
            }
          }
        }
      }
      checkDeclaration(node) {
        if (node.type === "Identifier") {
          this.checkDuplicateExports(node, node.name);
        } else if (node.type === "ObjectPattern") {
          for (const prop of node.properties) {
            this.checkDeclaration(prop);
          }
        } else if (node.type === "ArrayPattern") {
          for (const elem of node.elements) {
            if (elem) {
              this.checkDeclaration(elem);
            }
          }
        } else if (node.type === "ObjectProperty") {
          this.checkDeclaration(node.value);
        } else if (node.type === "RestElement") {
          this.checkDeclaration(node.argument);
        } else if (node.type === "AssignmentPattern") {
          this.checkDeclaration(node.left);
        }
      }
      checkDuplicateExports(node, exportName) {
        if (this.exportedIdentifiers.has(exportName)) {
          if (exportName === "default") {
            this.raise(Errors.DuplicateDefaultExport, node);
          } else {
            this.raise(Errors.DuplicateExport, node, {
              exportName
            });
          }
        }
        this.exportedIdentifiers.add(exportName);
      }
      parseExportSpecifiers(isInTypeExport) {
        const nodes = [];
        let first = true;
        this.expect(5);
        while (!this.eat(8)) {
          if (first) {
            first = false;
          } else {
            this.expect(12);
            if (this.eat(8)) break;
          }
          const isMaybeTypeOnly = this.isContextual(130);
          const isString = this.match(134);
          const node = this.startNode();
          node.local = this.parseModuleExportName();
          nodes.push(this.parseExportSpecifier(node, isString, isInTypeExport, isMaybeTypeOnly));
        }
        return nodes;
      }
      parseExportSpecifier(node, isString, isInTypeExport, isMaybeTypeOnly) {
        if (this.eatContextual(93)) {
          node.exported = this.parseModuleExportName();
        } else if (isString) {
          node.exported = this.cloneStringLiteral(node.local);
        } else if (!node.exported) {
          node.exported = this.cloneIdentifier(node.local);
        }
        return this.finishNode(node, "ExportSpecifier");
      }
      parseModuleExportName() {
        if (this.match(134)) {
          const result = this.parseStringLiteral(this.state.value);
          const surrogate = loneSurrogate.exec(result.value);
          if (surrogate) {
            this.raise(Errors.ModuleExportNameHasLoneSurrogate, result, {
              surrogateCharCode: surrogate[0].charCodeAt(0)
            });
          }
          return result;
        }
        return this.parseIdentifier(true);
      }
      isJSONModuleImport(node) {
        if (node.assertions != null) {
          return node.assertions.some(({
            key,
            value: value2
          }) => {
            return value2.value === "json" && (key.type === "Identifier" ? key.name === "type" : key.value === "type");
          });
        }
        return false;
      }
      checkImportReflection(node) {
        const {
          specifiers
        } = node;
        const singleBindingType = specifiers.length === 1 ? specifiers[0].type : null;
        if (node.phase === "source") {
          if (singleBindingType !== "ImportDefaultSpecifier") {
            this.raise(Errors.SourcePhaseImportRequiresDefault, specifiers[0].loc.start);
          }
        } else if (node.phase === "defer") {
          if (singleBindingType !== "ImportNamespaceSpecifier") {
            this.raise(Errors.DeferImportRequiresNamespace, specifiers[0].loc.start);
          }
        } else if (node.module) {
          var _node$assertions;
          if (singleBindingType !== "ImportDefaultSpecifier") {
            this.raise(Errors.ImportReflectionNotBinding, specifiers[0].loc.start);
          }
          if (((_node$assertions = node.assertions) == null ? void 0 : _node$assertions.length) > 0) {
            this.raise(Errors.ImportReflectionHasAssertion, specifiers[0].loc.start);
          }
        }
      }
      checkJSONModuleImport(node) {
        if (this.isJSONModuleImport(node) && node.type !== "ExportAllDeclaration") {
          const {
            specifiers
          } = node;
          if (specifiers != null) {
            const nonDefaultNamedSpecifier = specifiers.find((specifier) => {
              let imported;
              if (specifier.type === "ExportSpecifier") {
                imported = specifier.local;
              } else if (specifier.type === "ImportSpecifier") {
                imported = specifier.imported;
              }
              if (imported !== void 0) {
                return imported.type === "Identifier" ? imported.name !== "default" : imported.value !== "default";
              }
            });
            if (nonDefaultNamedSpecifier !== void 0) {
              this.raise(Errors.ImportJSONBindingNotDefault, nonDefaultNamedSpecifier.loc.start);
            }
          }
        }
      }
      isPotentialImportPhase(isExport) {
        if (isExport) return false;
        return this.isContextual(105) || this.isContextual(97) || this.isContextual(127);
      }
      applyImportPhase(node, isExport, phase, loc) {
        if (isExport) {
          return;
        }
        if (phase === "module") {
          this.expectPlugin("importReflection", loc);
          node.module = true;
        } else if (this.hasPlugin("importReflection")) {
          node.module = false;
        }
        if (phase === "source") {
          this.expectPlugin("sourcePhaseImports", loc);
          node.phase = "source";
        } else if (phase === "defer") {
          this.expectPlugin("deferredImportEvaluation", loc);
          node.phase = "defer";
        } else if (this.hasPlugin("sourcePhaseImports")) {
          node.phase = null;
        }
      }
      parseMaybeImportPhase(node, isExport) {
        if (!this.isPotentialImportPhase(isExport)) {
          this.applyImportPhase(node, isExport, null);
          return null;
        }
        const phaseIdentifier = this.startNode();
        const phaseIdentifierName = this.parseIdentifierName(true);
        const {
          type
        } = this.state;
        const isImportPhase = tokenIsKeywordOrIdentifier(type) ? type !== 98 || this.lookaheadCharCode() === 102 : type !== 12;
        if (isImportPhase) {
          this.applyImportPhase(node, isExport, phaseIdentifierName, phaseIdentifier.loc.start);
          return null;
        } else {
          this.applyImportPhase(node, isExport, null);
          return this.createIdentifier(phaseIdentifier, phaseIdentifierName);
        }
      }
      isPrecedingIdImportPhase(phase) {
        const {
          type
        } = this.state;
        return tokenIsIdentifier(type) ? type !== 98 || this.lookaheadCharCode() === 102 : type !== 12;
      }
      parseImport(node) {
        if (this.match(134)) {
          return this.parseImportSourceAndAttributes(node);
        }
        return this.parseImportSpecifiersAndAfter(node, this.parseMaybeImportPhase(node, false));
      }
      parseImportSpecifiersAndAfter(node, maybeDefaultIdentifier) {
        node.specifiers = [];
        const hasDefault = this.maybeParseDefaultImportSpecifier(node, maybeDefaultIdentifier);
        const parseNext = !hasDefault || this.eat(12);
        const hasStar = parseNext && this.maybeParseStarImportSpecifier(node);
        if (parseNext && !hasStar) this.parseNamedImportSpecifiers(node);
        this.expectContextual(98);
        return this.parseImportSourceAndAttributes(node);
      }
      parseImportSourceAndAttributes(node) {
        var _node$specifiers2;
        (_node$specifiers2 = node.specifiers) != null ? _node$specifiers2 : node.specifiers = [];
        node.source = this.parseImportSource();
        this.maybeParseImportAttributes(node);
        this.checkImportReflection(node);
        this.checkJSONModuleImport(node);
        this.semicolon();
        this.sawUnambiguousESM = true;
        return this.finishNode(node, "ImportDeclaration");
      }
      parseImportSource() {
        if (!this.match(134)) this.unexpected();
        return this.parseExprAtom();
      }
      parseImportSpecifierLocal(node, specifier, type) {
        specifier.local = this.parseIdentifier();
        node.specifiers.push(this.finishImportSpecifier(specifier, type));
      }
      finishImportSpecifier(specifier, type, bindingType = 8201) {
        this.checkLVal(specifier.local, {
          type
        }, bindingType);
        return this.finishNode(specifier, type);
      }
      parseImportAttributes() {
        this.expect(5);
        const attrs = [];
        const attrNames = /* @__PURE__ */ new Set();
        do {
          if (this.match(8)) {
            break;
          }
          const node = this.startNode();
          const keyName = this.state.value;
          if (attrNames.has(keyName)) {
            this.raise(Errors.ModuleAttributesWithDuplicateKeys, this.state.startLoc, {
              key: keyName
            });
          }
          attrNames.add(keyName);
          if (this.match(134)) {
            node.key = this.parseStringLiteral(keyName);
          } else {
            node.key = this.parseIdentifier(true);
          }
          this.expect(14);
          if (!this.match(134)) {
            throw this.raise(Errors.ModuleAttributeInvalidValue, this.state.startLoc);
          }
          node.value = this.parseStringLiteral(this.state.value);
          attrs.push(this.finishNode(node, "ImportAttribute"));
        } while (this.eat(12));
        this.expect(8);
        return attrs;
      }
      parseModuleAttributes() {
        const attrs = [];
        const attributes = /* @__PURE__ */ new Set();
        do {
          const node = this.startNode();
          node.key = this.parseIdentifier(true);
          if (node.key.name !== "type") {
            this.raise(Errors.ModuleAttributeDifferentFromType, node.key);
          }
          if (attributes.has(node.key.name)) {
            this.raise(Errors.ModuleAttributesWithDuplicateKeys, node.key, {
              key: node.key.name
            });
          }
          attributes.add(node.key.name);
          this.expect(14);
          if (!this.match(134)) {
            throw this.raise(Errors.ModuleAttributeInvalidValue, this.state.startLoc);
          }
          node.value = this.parseStringLiteral(this.state.value);
          attrs.push(this.finishNode(node, "ImportAttribute"));
        } while (this.eat(12));
        return attrs;
      }
      maybeParseImportAttributes(node) {
        let attributes;
        var useWith = false;
        if (this.match(76)) {
          if (this.hasPrecedingLineBreak() && this.lookaheadCharCode() === 40) {
            return;
          }
          this.next();
          if (this.hasPlugin("moduleAttributes")) {
            attributes = this.parseModuleAttributes();
            this.addExtra(node, "deprecatedWithLegacySyntax", true);
          } else {
            attributes = this.parseImportAttributes();
          }
          useWith = true;
        } else if (this.isContextual(94) && !this.hasPrecedingLineBreak()) {
          if (!this.hasPlugin("deprecatedImportAssert") && !this.hasPlugin("importAssertions")) {
            this.raise(Errors.ImportAttributesUseAssert, this.state.startLoc);
          }
          if (!this.hasPlugin("importAssertions")) {
            this.addExtra(node, "deprecatedAssertSyntax", true);
          }
          this.next();
          attributes = this.parseImportAttributes();
        } else {
          attributes = [];
        }
        if (!useWith && this.hasPlugin("importAssertions")) {
          node.assertions = attributes;
        } else {
          node.attributes = attributes;
        }
      }
      maybeParseDefaultImportSpecifier(node, maybeDefaultIdentifier) {
        if (maybeDefaultIdentifier) {
          const specifier = this.startNodeAtNode(maybeDefaultIdentifier);
          specifier.local = maybeDefaultIdentifier;
          node.specifiers.push(this.finishImportSpecifier(specifier, "ImportDefaultSpecifier"));
          return true;
        } else if (tokenIsKeywordOrIdentifier(this.state.type)) {
          this.parseImportSpecifierLocal(node, this.startNode(), "ImportDefaultSpecifier");
          return true;
        }
        return false;
      }
      maybeParseStarImportSpecifier(node) {
        if (this.match(55)) {
          const specifier = this.startNode();
          this.next();
          this.expectContextual(93);
          this.parseImportSpecifierLocal(node, specifier, "ImportNamespaceSpecifier");
          return true;
        }
        return false;
      }
      parseNamedImportSpecifiers(node) {
        let first = true;
        this.expect(5);
        while (!this.eat(8)) {
          if (first) {
            first = false;
          } else {
            if (this.eat(14)) {
              throw this.raise(Errors.DestructureNamedImport, this.state.startLoc);
            }
            this.expect(12);
            if (this.eat(8)) break;
          }
          const specifier = this.startNode();
          const importedIsString = this.match(134);
          const isMaybeTypeOnly = this.isContextual(130);
          specifier.imported = this.parseModuleExportName();
          const importSpecifier = this.parseImportSpecifier(specifier, importedIsString, node.importKind === "type" || node.importKind === "typeof", isMaybeTypeOnly, void 0);
          node.specifiers.push(importSpecifier);
        }
      }
      parseImportSpecifier(specifier, importedIsString, isInTypeOnlyImport, isMaybeTypeOnly, bindingType) {
        if (this.eatContextual(93)) {
          specifier.local = this.parseIdentifier();
        } else {
          const {
            imported
          } = specifier;
          if (importedIsString) {
            throw this.raise(Errors.ImportBindingIsString, specifier, {
              importName: imported.value
            });
          }
          this.checkReservedWord(imported.name, specifier.loc.start, true, true);
          if (!specifier.local) {
            specifier.local = this.cloneIdentifier(imported);
          }
        }
        return this.finishImportSpecifier(specifier, "ImportSpecifier", bindingType);
      }
      isThisParam(param) {
        return param.type === "Identifier" && param.name === "this";
      }
    };
    var Parser = class extends StatementParser {
      constructor(options, input, pluginsMap) {
        const normalizedOptions = getOptions(options);
        super(normalizedOptions, input);
        this.options = normalizedOptions;
        this.initializeScopes();
        this.plugins = pluginsMap;
        this.filename = normalizedOptions.sourceFilename;
        this.startIndex = normalizedOptions.startIndex;
        let optionFlags = 0;
        if (normalizedOptions.allowAwaitOutsideFunction) {
          optionFlags |= 1;
        }
        if (normalizedOptions.allowReturnOutsideFunction) {
          optionFlags |= 2;
        }
        if (normalizedOptions.allowImportExportEverywhere) {
          optionFlags |= 8;
        }
        if (normalizedOptions.allowSuperOutsideMethod) {
          optionFlags |= 16;
        }
        if (normalizedOptions.allowUndeclaredExports) {
          optionFlags |= 64;
        }
        if (normalizedOptions.allowNewTargetOutsideFunction) {
          optionFlags |= 4;
        }
        if (normalizedOptions.allowYieldOutsideFunction) {
          optionFlags |= 32;
        }
        if (normalizedOptions.ranges) {
          optionFlags |= 128;
        }
        if (normalizedOptions.tokens) {
          optionFlags |= 256;
        }
        if (normalizedOptions.createImportExpressions) {
          optionFlags |= 512;
        }
        if (normalizedOptions.createParenthesizedExpressions) {
          optionFlags |= 1024;
        }
        if (normalizedOptions.errorRecovery) {
          optionFlags |= 2048;
        }
        if (normalizedOptions.attachComment) {
          optionFlags |= 4096;
        }
        if (normalizedOptions.annexB) {
          optionFlags |= 8192;
        }
        this.optionFlags = optionFlags;
      }
      getScopeHandler() {
        return ScopeHandler;
      }
      parse() {
        this.enterInitialScopes();
        const file = this.startNode();
        const program = this.startNode();
        this.nextToken();
        file.errors = null;
        const result = this.parseTopLevel(file, program);
        result.errors = this.state.errors;
        result.comments.length = this.state.commentsLen;
        return result;
      }
    };
    function parse2(input, options) {
      var _options;
      if (((_options = options) == null ? void 0 : _options.sourceType) === "unambiguous") {
        options = Object.assign({}, options);
        try {
          options.sourceType = "module";
          const parser = getParser(options, input);
          const ast = parser.parse();
          if (parser.sawUnambiguousESM) {
            return ast;
          }
          if (parser.ambiguousScriptDifferentAst) {
            try {
              options.sourceType = "script";
              return getParser(options, input).parse();
            } catch (_unused) {
            }
          } else {
            ast.program.sourceType = "script";
          }
          return ast;
        } catch (moduleError) {
          try {
            options.sourceType = "script";
            return getParser(options, input).parse();
          } catch (_unused2) {
          }
          throw moduleError;
        }
      } else {
        return getParser(options, input).parse();
      }
    }
    function parseExpression(input, options) {
      const parser = getParser(options, input);
      if (parser.options.strictMode) {
        parser.state.strict = true;
      }
      return parser.getExpression();
    }
    function generateExportedTokenTypes(internalTokenTypes) {
      const tokenTypes2 = {};
      for (const typeName of Object.keys(internalTokenTypes)) {
        tokenTypes2[typeName] = getExportedToken(internalTokenTypes[typeName]);
      }
      return tokenTypes2;
    }
    var tokTypes = generateExportedTokenTypes(tt);
    function getParser(options, input) {
      let cls = Parser;
      const pluginsMap = /* @__PURE__ */ new Map();
      if (options != null && options.plugins) {
        for (const plugin of options.plugins) {
          let name, opts;
          if (typeof plugin === "string") {
            name = plugin;
          } else {
            [name, opts] = plugin;
          }
          if (!pluginsMap.has(name)) {
            pluginsMap.set(name, opts || {});
          }
        }
        validatePlugins(pluginsMap);
        cls = getParserClass(pluginsMap);
      }
      return new cls(options, input, pluginsMap);
    }
    var parserClassCache = /* @__PURE__ */ new Map();
    function getParserClass(pluginsMap) {
      const pluginList = [];
      for (const name of mixinPluginNames) {
        if (pluginsMap.has(name)) {
          pluginList.push(name);
        }
      }
      const key = pluginList.join("|");
      let cls = parserClassCache.get(key);
      if (!cls) {
        cls = Parser;
        for (const plugin of pluginList) {
          cls = mixinPlugins[plugin](cls);
        }
        parserClassCache.set(key, cls);
      }
      return cls;
    }
    exports2.parse = parse2;
    exports2.parseExpression = parseExpression;
    exports2.tokTypes = tokTypes;
  }
});

// node_modules/picocolors/picocolors.js
var require_picocolors = __commonJS({
  "node_modules/picocolors/picocolors.js"(exports2, module2) {
    var p = process || {};
    var argv = p.argv || [];
    var env = p.env || {};
    var isColorSupported = !(!!env.NO_COLOR || argv.includes("--no-color")) && (!!env.FORCE_COLOR || argv.includes("--color") || p.platform === "win32" || (p.stdout || {}).isTTY && env.TERM !== "dumb" || !!env.CI);
    var formatter = (open, close, replace = open) => (input) => {
      let string = "" + input, index = string.indexOf(close, open.length);
      return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
    };
    var replaceClose = (string, close, replace, index) => {
      let result = "", cursor = 0;
      do {
        result += string.substring(cursor, index) + replace;
        cursor = index + close.length;
        index = string.indexOf(close, cursor);
      } while (~index);
      return result + string.substring(cursor);
    };
    var createColors = (enabled = isColorSupported) => {
      let f = enabled ? formatter : () => String;
      return {
        isColorSupported: enabled,
        reset: f("\x1B[0m", "\x1B[0m"),
        bold: f("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"),
        dim: f("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"),
        italic: f("\x1B[3m", "\x1B[23m"),
        underline: f("\x1B[4m", "\x1B[24m"),
        inverse: f("\x1B[7m", "\x1B[27m"),
        hidden: f("\x1B[8m", "\x1B[28m"),
        strikethrough: f("\x1B[9m", "\x1B[29m"),
        black: f("\x1B[30m", "\x1B[39m"),
        red: f("\x1B[31m", "\x1B[39m"),
        green: f("\x1B[32m", "\x1B[39m"),
        yellow: f("\x1B[33m", "\x1B[39m"),
        blue: f("\x1B[34m", "\x1B[39m"),
        magenta: f("\x1B[35m", "\x1B[39m"),
        cyan: f("\x1B[36m", "\x1B[39m"),
        white: f("\x1B[37m", "\x1B[39m"),
        gray: f("\x1B[90m", "\x1B[39m"),
        bgBlack: f("\x1B[40m", "\x1B[49m"),
        bgRed: f("\x1B[41m", "\x1B[49m"),
        bgGreen: f("\x1B[42m", "\x1B[49m"),
        bgYellow: f("\x1B[43m", "\x1B[49m"),
        bgBlue: f("\x1B[44m", "\x1B[49m"),
        bgMagenta: f("\x1B[45m", "\x1B[49m"),
        bgCyan: f("\x1B[46m", "\x1B[49m"),
        bgWhite: f("\x1B[47m", "\x1B[49m"),
        blackBright: f("\x1B[90m", "\x1B[39m"),
        redBright: f("\x1B[91m", "\x1B[39m"),
        greenBright: f("\x1B[92m", "\x1B[39m"),
        yellowBright: f("\x1B[93m", "\x1B[39m"),
        blueBright: f("\x1B[94m", "\x1B[39m"),
        magentaBright: f("\x1B[95m", "\x1B[39m"),
        cyanBright: f("\x1B[96m", "\x1B[39m"),
        whiteBright: f("\x1B[97m", "\x1B[39m"),
        bgBlackBright: f("\x1B[100m", "\x1B[49m"),
        bgRedBright: f("\x1B[101m", "\x1B[49m"),
        bgGreenBright: f("\x1B[102m", "\x1B[49m"),
        bgYellowBright: f("\x1B[103m", "\x1B[49m"),
        bgBlueBright: f("\x1B[104m", "\x1B[49m"),
        bgMagentaBright: f("\x1B[105m", "\x1B[49m"),
        bgCyanBright: f("\x1B[106m", "\x1B[49m"),
        bgWhiteBright: f("\x1B[107m", "\x1B[49m")
      };
    };
    module2.exports = createColors();
    module2.exports.createColors = createColors;
  }
});

// node_modules/js-tokens/index.js
var require_js_tokens = __commonJS({
  "node_modules/js-tokens/index.js"(exports2) {
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = /((['"])(?:(?!\2|\\).|\\(?:\r\n|[\s\S]))*(\2)?|`(?:[^`\\$]|\\[\s\S]|\$(?!\{)|\$\{(?:[^{}]|\{[^}]*\}?)*\}?)*(`)?)|(\/\/.*)|(\/\*(?:[^*]|\*(?!\/))*(\*\/)?)|(\/(?!\*)(?:\[(?:(?![\]\\]).|\\.)*\]|(?![\/\]\\]).|\\.)+\/(?:(?!\s*(?:\b|[\u0080-\uFFFF$\\'"~({]|[+\-!](?!=)|\.?\d))|[gmiyus]{1,6}\b(?![\u0080-\uFFFF$\\]|\s*(?:[+\-*%&|^<>!=?({]|\/(?![\/*])))))|(0[xX][\da-fA-F]+|0[oO][0-7]+|0[bB][01]+|(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?)|((?!\d)(?:(?!\s)[$\w\u0080-\uFFFF]|\\u[\da-fA-F]{4}|\\u\{[\da-fA-F]+\})+)|(--|\+\+|&&|\|\||=>|\.{3}|(?:[+\-\/%&|^]|\*{1,2}|<{1,2}|>{1,3}|!=?|={1,2})=?|[?~.,:;[\](){}])|(\s+)|(^$|[\s\S])/g;
    exports2.matchToToken = function(match) {
      var token = { type: "invalid", value: match[0], closed: void 0 };
      if (match[1]) token.type = "string", token.closed = !!(match[3] || match[4]);
      else if (match[5]) token.type = "comment";
      else if (match[6]) token.type = "comment", token.closed = !!match[7];
      else if (match[8]) token.type = "regex";
      else if (match[9]) token.type = "number";
      else if (match[10]) token.type = "name";
      else if (match[11]) token.type = "punctuator";
      else if (match[12]) token.type = "whitespace";
      return token;
    };
  }
});

// node_modules/@babel/code-frame/lib/index.js
var require_lib5 = __commonJS({
  "node_modules/@babel/code-frame/lib/index.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    var picocolors = require_picocolors();
    var jsTokens = require_js_tokens();
    var helperValidatorIdentifier = require_lib();
    function isColorSupported() {
      return typeof process === "object" && (process.env.FORCE_COLOR === "0" || process.env.FORCE_COLOR === "false") ? false : picocolors.isColorSupported;
    }
    var compose = (f, g) => (v) => f(g(v));
    function buildDefs(colors) {
      return {
        keyword: colors.cyan,
        capitalized: colors.yellow,
        jsxIdentifier: colors.yellow,
        punctuator: colors.yellow,
        number: colors.magenta,
        string: colors.green,
        regex: colors.magenta,
        comment: colors.gray,
        invalid: compose(compose(colors.white, colors.bgRed), colors.bold),
        gutter: colors.gray,
        marker: compose(colors.red, colors.bold),
        message: compose(colors.red, colors.bold),
        reset: colors.reset
      };
    }
    var defsOn = buildDefs(picocolors.createColors(true));
    var defsOff = buildDefs(picocolors.createColors(false));
    function getDefs(enabled) {
      return enabled ? defsOn : defsOff;
    }
    var sometimesKeywords = /* @__PURE__ */ new Set(["as", "async", "from", "get", "of", "set"]);
    var NEWLINE$1 = /\r\n|[\n\r\u2028\u2029]/;
    var BRACKET = /^[()[\]{}]$/;
    var tokenize;
    var JSX_TAG = /^[a-z][\w-]*$/i;
    var getTokenType = function(token, offset, text) {
      if (token.type === "name") {
        const tokenValue = token.value;
        if (helperValidatorIdentifier.isKeyword(tokenValue) || helperValidatorIdentifier.isStrictReservedWord(tokenValue, true) || sometimesKeywords.has(tokenValue)) {
          return "keyword";
        }
        if (JSX_TAG.test(tokenValue) && (text[offset - 1] === "<" || text.slice(offset - 2, offset) === "</")) {
          return "jsxIdentifier";
        }
        const firstChar = String.fromCodePoint(tokenValue.codePointAt(0));
        if (firstChar !== firstChar.toLowerCase()) {
          return "capitalized";
        }
      }
      if (token.type === "punctuator" && BRACKET.test(token.value)) {
        return "bracket";
      }
      if (token.type === "invalid" && (token.value === "@" || token.value === "#")) {
        return "punctuator";
      }
      return token.type;
    };
    tokenize = function* (text) {
      let match;
      while (match = jsTokens.default.exec(text)) {
        const token = jsTokens.matchToToken(match);
        yield {
          type: getTokenType(token, match.index, text),
          value: token.value
        };
      }
    };
    function highlight(text) {
      if (text === "") return "";
      const defs = getDefs(true);
      let highlighted = "";
      for (const {
        type,
        value: value2
      } of tokenize(text)) {
        if (type in defs) {
          highlighted += value2.split(NEWLINE$1).map((str) => defs[type](str)).join("\n");
        } else {
          highlighted += value2;
        }
      }
      return highlighted;
    }
    var deprecationWarningShown = false;
    var NEWLINE = /\r\n|[\n\r\u2028\u2029]/;
    function getMarkerLines(loc, source, opts, startLineBaseZero) {
      const startLoc = Object.assign({
        column: 0,
        line: -1
      }, loc.start);
      const endLoc = Object.assign({}, startLoc, loc.end);
      const {
        linesAbove = 2,
        linesBelow = 3
      } = opts || {};
      const startLine = startLoc.line - startLineBaseZero;
      const startColumn = startLoc.column;
      const endLine = endLoc.line - startLineBaseZero;
      const endColumn = endLoc.column;
      let start = Math.max(startLine - (linesAbove + 1), 0);
      let end = Math.min(source.length, endLine + linesBelow);
      if (startLine === -1) {
        start = 0;
      }
      if (endLine === -1) {
        end = source.length;
      }
      const lineDiff = endLine - startLine;
      const markerLines = {};
      if (lineDiff) {
        for (let i = 0; i <= lineDiff; i++) {
          const lineNumber = i + startLine;
          if (!startColumn) {
            markerLines[lineNumber] = true;
          } else if (i === 0) {
            const sourceLength = source[lineNumber - 1].length;
            markerLines[lineNumber] = [startColumn, sourceLength - startColumn + 1];
          } else if (i === lineDiff) {
            markerLines[lineNumber] = [0, endColumn];
          } else {
            const sourceLength = source[lineNumber - i].length;
            markerLines[lineNumber] = [0, sourceLength];
          }
        }
      } else {
        if (startColumn === endColumn) {
          if (startColumn) {
            markerLines[startLine] = [startColumn, 0];
          } else {
            markerLines[startLine] = true;
          }
        } else {
          markerLines[startLine] = [startColumn, endColumn - startColumn];
        }
      }
      return {
        start,
        end,
        markerLines
      };
    }
    function codeFrameColumns2(rawLines, loc, opts = {}) {
      const shouldHighlight = opts.forceColor || isColorSupported() && opts.highlightCode;
      const startLineBaseZero = (opts.startLine || 1) - 1;
      const defs = getDefs(shouldHighlight);
      const lines = rawLines.split(NEWLINE);
      const {
        start,
        end,
        markerLines
      } = getMarkerLines(loc, lines, opts, startLineBaseZero);
      const hasColumns = loc.start && typeof loc.start.column === "number";
      const numberMaxWidth = String(end + startLineBaseZero).length;
      const highlightedLines = shouldHighlight ? highlight(rawLines) : rawLines;
      let frame = highlightedLines.split(NEWLINE, end).slice(start, end).map((line, index2) => {
        const number = start + 1 + index2;
        const paddedNumber = ` ${number + startLineBaseZero}`.slice(-numberMaxWidth);
        const gutter = ` ${paddedNumber} |`;
        const hasMarker = markerLines[number];
        const lastMarkerLine = !markerLines[number + 1];
        if (hasMarker) {
          let markerLine = "";
          if (Array.isArray(hasMarker)) {
            const markerSpacing = line.slice(0, Math.max(hasMarker[0] - 1, 0)).replace(/[^\t]/g, " ");
            const numberOfMarkers = hasMarker[1] || 1;
            markerLine = ["\n ", defs.gutter(gutter.replace(/\d/g, " ")), " ", markerSpacing, defs.marker("^").repeat(numberOfMarkers)].join("");
            if (lastMarkerLine && opts.message) {
              markerLine += " " + defs.message(opts.message);
            }
          }
          return [defs.marker(">"), defs.gutter(gutter), line.length > 0 ? ` ${line}` : "", markerLine].join("");
        } else {
          return ` ${defs.gutter(gutter)}${line.length > 0 ? ` ${line}` : ""}`;
        }
      }).join("\n");
      if (opts.message && !hasColumns) {
        frame = `${" ".repeat(numberMaxWidth + 1)}${opts.message}
${frame}`;
      }
      if (shouldHighlight) {
        return defs.reset(frame);
      } else {
        return frame;
      }
    }
    function index(rawLines, lineNumber, colNumber, opts = {}) {
      if (!deprecationWarningShown) {
        deprecationWarningShown = true;
        const message = "Passing lineNumber and colNumber is deprecated to @babel/code-frame. Please use `codeFrameColumns`.";
        if (process.emitWarning) {
          process.emitWarning(message, "DeprecationWarning");
        } else {
          const deprecationError = new Error(message);
          deprecationError.name = "DeprecationWarning";
          console.warn(new Error(message));
        }
      }
      colNumber = Math.max(colNumber, 0);
      const location = {
        start: {
          column: colNumber,
          line: lineNumber
        }
      };
      return codeFrameColumns2(rawLines, location, opts);
    }
    exports2.codeFrameColumns = codeFrameColumns2;
    exports2.default = index;
    exports2.highlight = highlight;
  }
});

// node_modules/@babel/template/lib/parse.js
var require_parse = __commonJS({
  "node_modules/@babel/template/lib/parse.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = parseAndBuildMetadata;
    var _t = require_lib3();
    var _parser = require_lib4();
    var _codeFrame = require_lib5();
    var {
      isCallExpression,
      isExpressionStatement,
      isFunction,
      isIdentifier,
      isJSXIdentifier,
      isNewExpression,
      isPlaceholder,
      isStatement,
      isStringLiteral,
      removePropertiesDeep,
      traverse: traverse2
    } = _t;
    var PATTERN = /^[_$A-Z0-9]+$/;
    function parseAndBuildMetadata(formatter, code, opts) {
      const {
        placeholderWhitelist,
        placeholderPattern,
        preserveComments,
        syntacticPlaceholders
      } = opts;
      const ast = parseWithCodeFrame(code, opts.parser, syntacticPlaceholders);
      removePropertiesDeep(ast, {
        preserveComments
      });
      formatter.validate(ast);
      const state = {
        syntactic: {
          placeholders: [],
          placeholderNames: /* @__PURE__ */ new Set()
        },
        legacy: {
          placeholders: [],
          placeholderNames: /* @__PURE__ */ new Set()
        },
        placeholderWhitelist,
        placeholderPattern,
        syntacticPlaceholders
      };
      traverse2(ast, placeholderVisitorHandler, state);
      return Object.assign({
        ast
      }, state.syntactic.placeholders.length ? state.syntactic : state.legacy);
    }
    function placeholderVisitorHandler(node, ancestors, state) {
      var _state$placeholderWhi;
      let name;
      let hasSyntacticPlaceholders = state.syntactic.placeholders.length > 0;
      if (isPlaceholder(node)) {
        if (state.syntacticPlaceholders === false) {
          throw new Error("%%foo%%-style placeholders can't be used when '.syntacticPlaceholders' is false.");
        }
        name = node.name.name;
        hasSyntacticPlaceholders = true;
      } else if (hasSyntacticPlaceholders || state.syntacticPlaceholders) {
        return;
      } else if (isIdentifier(node) || isJSXIdentifier(node)) {
        name = node.name;
      } else if (isStringLiteral(node)) {
        name = node.value;
      } else {
        return;
      }
      if (hasSyntacticPlaceholders && (state.placeholderPattern != null || state.placeholderWhitelist != null)) {
        throw new Error("'.placeholderWhitelist' and '.placeholderPattern' aren't compatible with '.syntacticPlaceholders: true'");
      }
      if (!hasSyntacticPlaceholders && (state.placeholderPattern === false || !(state.placeholderPattern || PATTERN).test(name)) && !((_state$placeholderWhi = state.placeholderWhitelist) != null && _state$placeholderWhi.has(name))) {
        return;
      }
      ancestors = ancestors.slice();
      const {
        node: parent,
        key
      } = ancestors[ancestors.length - 1];
      let type;
      if (isStringLiteral(node) || isPlaceholder(node, {
        expectedNode: "StringLiteral"
      })) {
        type = "string";
      } else if (isNewExpression(parent) && key === "arguments" || isCallExpression(parent) && key === "arguments" || isFunction(parent) && key === "params") {
        type = "param";
      } else if (isExpressionStatement(parent) && !isPlaceholder(node)) {
        type = "statement";
        ancestors = ancestors.slice(0, -1);
      } else if (isStatement(node) && isPlaceholder(node)) {
        type = "statement";
      } else {
        type = "other";
      }
      const {
        placeholders,
        placeholderNames
      } = !hasSyntacticPlaceholders ? state.legacy : state.syntactic;
      placeholders.push({
        name,
        type,
        resolve: (ast) => resolveAncestors(ast, ancestors),
        isDuplicate: placeholderNames.has(name)
      });
      placeholderNames.add(name);
    }
    function resolveAncestors(ast, ancestors) {
      let parent = ast;
      for (let i = 0; i < ancestors.length - 1; i++) {
        const {
          key: key2,
          index: index2
        } = ancestors[i];
        if (index2 === void 0) {
          parent = parent[key2];
        } else {
          parent = parent[key2][index2];
        }
      }
      const {
        key,
        index
      } = ancestors[ancestors.length - 1];
      return {
        parent,
        key,
        index
      };
    }
    function parseWithCodeFrame(code, parserOpts, syntacticPlaceholders) {
      const plugins = (parserOpts.plugins || []).slice();
      if (syntacticPlaceholders !== false) {
        plugins.push("placeholders");
      }
      parserOpts = Object.assign({
        allowAwaitOutsideFunction: true,
        allowReturnOutsideFunction: true,
        allowNewTargetOutsideFunction: true,
        allowSuperOutsideMethod: true,
        allowYieldOutsideFunction: true,
        sourceType: "module"
      }, parserOpts, {
        plugins
      });
      try {
        return (0, _parser.parse)(code, parserOpts);
      } catch (err) {
        const loc = err.loc;
        if (loc) {
          err.message += "\n" + (0, _codeFrame.codeFrameColumns)(code, {
            start: loc
          });
          err.code = "BABEL_TEMPLATE_PARSE_ERROR";
        }
        throw err;
      }
    }
  }
});

// node_modules/@babel/template/lib/populate.js
var require_populate = __commonJS({
  "node_modules/@babel/template/lib/populate.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = populatePlaceholders;
    var _t = require_lib3();
    var {
      blockStatement,
      cloneNode,
      emptyStatement,
      expressionStatement,
      identifier,
      isStatement,
      isStringLiteral,
      stringLiteral,
      validate
    } = _t;
    function populatePlaceholders(metadata, replacements) {
      const ast = cloneNode(metadata.ast);
      if (replacements) {
        metadata.placeholders.forEach((placeholder) => {
          if (!hasOwnProperty.call(replacements, placeholder.name)) {
            const placeholderName = placeholder.name;
            throw new Error(`Error: No substitution given for "${placeholderName}". If this is not meant to be a
            placeholder you may want to consider passing one of the following options to @babel/template:
            - { placeholderPattern: false, placeholderWhitelist: new Set(['${placeholderName}'])}
            - { placeholderPattern: /^${placeholderName}$/ }`);
          }
        });
        Object.keys(replacements).forEach((key) => {
          if (!metadata.placeholderNames.has(key)) {
            throw new Error(`Unknown substitution "${key}" given`);
          }
        });
      }
      metadata.placeholders.slice().reverse().forEach((placeholder) => {
        try {
          var _ref;
          applyReplacement(placeholder, ast, (_ref = replacements && replacements[placeholder.name]) != null ? _ref : null);
        } catch (e) {
          e.message = `@babel/template placeholder "${placeholder.name}": ${e.message}`;
          throw e;
        }
      });
      return ast;
    }
    function applyReplacement(placeholder, ast, replacement) {
      if (placeholder.isDuplicate) {
        if (Array.isArray(replacement)) {
          replacement = replacement.map((node) => cloneNode(node));
        } else if (typeof replacement === "object") {
          replacement = cloneNode(replacement);
        }
      }
      const {
        parent,
        key,
        index
      } = placeholder.resolve(ast);
      if (placeholder.type === "string") {
        if (typeof replacement === "string") {
          replacement = stringLiteral(replacement);
        }
        if (!replacement || !isStringLiteral(replacement)) {
          throw new Error("Expected string substitution");
        }
      } else if (placeholder.type === "statement") {
        if (index === void 0) {
          if (!replacement) {
            replacement = emptyStatement();
          } else if (Array.isArray(replacement)) {
            replacement = blockStatement(replacement);
          } else if (typeof replacement === "string") {
            replacement = expressionStatement(identifier(replacement));
          } else if (!isStatement(replacement)) {
            replacement = expressionStatement(replacement);
          }
        } else {
          if (replacement && !Array.isArray(replacement)) {
            if (typeof replacement === "string") {
              replacement = identifier(replacement);
            }
            if (!isStatement(replacement)) {
              replacement = expressionStatement(replacement);
            }
          }
        }
      } else if (placeholder.type === "param") {
        if (typeof replacement === "string") {
          replacement = identifier(replacement);
        }
        if (index === void 0) throw new Error("Assertion failure.");
      } else {
        if (typeof replacement === "string") {
          replacement = identifier(replacement);
        }
        if (Array.isArray(replacement)) {
          throw new Error("Cannot replace single expression with an array.");
        }
      }
      function set(parent2, key2, value2) {
        const node = parent2[key2];
        parent2[key2] = value2;
        if (node.type === "Identifier" || node.type === "Placeholder") {
          if (node.typeAnnotation) {
            value2.typeAnnotation = node.typeAnnotation;
          }
          if (node.optional) {
            value2.optional = node.optional;
          }
          if (node.decorators) {
            value2.decorators = node.decorators;
          }
        }
      }
      if (index === void 0) {
        validate(parent, key, replacement);
        set(parent, key, replacement);
      } else {
        const items = parent[key].slice();
        if (placeholder.type === "statement" || placeholder.type === "param") {
          if (replacement == null) {
            items.splice(index, 1);
          } else if (Array.isArray(replacement)) {
            items.splice(index, 1, ...replacement);
          } else {
            set(items, index, replacement);
          }
        } else {
          set(items, index, replacement);
        }
        validate(parent, key, items);
        parent[key] = items;
      }
    }
  }
});

// node_modules/@babel/template/lib/string.js
var require_string = __commonJS({
  "node_modules/@babel/template/lib/string.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = stringTemplate;
    var _options = require_options();
    var _parse = require_parse();
    var _populate = require_populate();
    function stringTemplate(formatter, code, opts) {
      code = formatter.code(code);
      let metadata;
      return (arg) => {
        const replacements = (0, _options.normalizeReplacements)(arg);
        if (!metadata) metadata = (0, _parse.default)(formatter, code, opts);
        return formatter.unwrap((0, _populate.default)(metadata, replacements));
      };
    }
  }
});

// node_modules/@babel/template/lib/literal.js
var require_literal = __commonJS({
  "node_modules/@babel/template/lib/literal.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = literalTemplate;
    var _options = require_options();
    var _parse = require_parse();
    var _populate = require_populate();
    function literalTemplate(formatter, tpl, opts) {
      const {
        metadata,
        names
      } = buildLiteralData(formatter, tpl, opts);
      return (arg) => {
        const defaultReplacements = {};
        arg.forEach((replacement, i) => {
          defaultReplacements[names[i]] = replacement;
        });
        return (arg2) => {
          const replacements = (0, _options.normalizeReplacements)(arg2);
          if (replacements) {
            Object.keys(replacements).forEach((key) => {
              if (hasOwnProperty.call(defaultReplacements, key)) {
                throw new Error("Unexpected replacement overlap.");
              }
            });
          }
          return formatter.unwrap((0, _populate.default)(metadata, replacements ? Object.assign(replacements, defaultReplacements) : defaultReplacements));
        };
      };
    }
    function buildLiteralData(formatter, tpl, opts) {
      let prefix = "BABEL_TPL$";
      const raw = tpl.join("");
      do {
        prefix = "$$" + prefix;
      } while (raw.includes(prefix));
      const {
        names,
        code
      } = buildTemplateCode(tpl, prefix);
      const metadata = (0, _parse.default)(formatter, formatter.code(code), {
        parser: opts.parser,
        placeholderWhitelist: new Set(names.concat(opts.placeholderWhitelist ? Array.from(opts.placeholderWhitelist) : [])),
        placeholderPattern: opts.placeholderPattern,
        preserveComments: opts.preserveComments,
        syntacticPlaceholders: opts.syntacticPlaceholders
      });
      return {
        metadata,
        names
      };
    }
    function buildTemplateCode(tpl, prefix) {
      const names = [];
      let code = tpl[0];
      for (let i = 1; i < tpl.length; i++) {
        const value2 = `${prefix}${i - 1}`;
        names.push(value2);
        code += value2 + tpl[i];
      }
      return {
        names,
        code
      };
    }
  }
});

// node_modules/@babel/template/lib/builder.js
var require_builder = __commonJS({
  "node_modules/@babel/template/lib/builder.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = createTemplateBuilder;
    var _options = require_options();
    var _string = require_string();
    var _literal = require_literal();
    var NO_PLACEHOLDER = (0, _options.validate)({
      placeholderPattern: false
    });
    function createTemplateBuilder(formatter, defaultOpts) {
      const templateFnCache = /* @__PURE__ */ new WeakMap();
      const templateAstCache = /* @__PURE__ */ new WeakMap();
      const cachedOpts = defaultOpts || (0, _options.validate)(null);
      return Object.assign((tpl, ...args) => {
        if (typeof tpl === "string") {
          if (args.length > 1) throw new Error("Unexpected extra params.");
          return extendedTrace((0, _string.default)(formatter, tpl, (0, _options.merge)(cachedOpts, (0, _options.validate)(args[0]))));
        } else if (Array.isArray(tpl)) {
          let builder = templateFnCache.get(tpl);
          if (!builder) {
            builder = (0, _literal.default)(formatter, tpl, cachedOpts);
            templateFnCache.set(tpl, builder);
          }
          return extendedTrace(builder(args));
        } else if (typeof tpl === "object" && tpl) {
          if (args.length > 0) throw new Error("Unexpected extra params.");
          return createTemplateBuilder(formatter, (0, _options.merge)(cachedOpts, (0, _options.validate)(tpl)));
        }
        throw new Error(`Unexpected template param ${typeof tpl}`);
      }, {
        ast: (tpl, ...args) => {
          if (typeof tpl === "string") {
            if (args.length > 1) throw new Error("Unexpected extra params.");
            return (0, _string.default)(formatter, tpl, (0, _options.merge)((0, _options.merge)(cachedOpts, (0, _options.validate)(args[0])), NO_PLACEHOLDER))();
          } else if (Array.isArray(tpl)) {
            let builder = templateAstCache.get(tpl);
            if (!builder) {
              builder = (0, _literal.default)(formatter, tpl, (0, _options.merge)(cachedOpts, NO_PLACEHOLDER));
              templateAstCache.set(tpl, builder);
            }
            return builder(args)();
          }
          throw new Error(`Unexpected template param ${typeof tpl}`);
        }
      });
    }
    function extendedTrace(fn) {
      let rootStack = "";
      try {
        throw new Error();
      } catch (error) {
        if (error.stack) {
          rootStack = error.stack.split("\n").slice(3).join("\n");
        }
      }
      return (arg) => {
        try {
          return fn(arg);
        } catch (err) {
          err.stack += `
    =============
${rootStack}`;
          throw err;
        }
      };
    }
  }
});

// node_modules/@babel/template/lib/index.js
var require_lib6 = __commonJS({
  "node_modules/@babel/template/lib/index.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.statements = exports2.statement = exports2.smart = exports2.program = exports2.expression = exports2.default = void 0;
    var formatters = require_formatters();
    var _builder = require_builder();
    var smart = exports2.smart = (0, _builder.default)(formatters.smart);
    var statement = exports2.statement = (0, _builder.default)(formatters.statement);
    var statements = exports2.statements = (0, _builder.default)(formatters.statements);
    var expression = exports2.expression = (0, _builder.default)(formatters.expression);
    var program = exports2.program = (0, _builder.default)(formatters.program);
    var _default = exports2.default = Object.assign(smart.bind(void 0), {
      smart,
      statement,
      statements,
      expression,
      program,
      ast: smart.ast
    });
  }
});

// node_modules/@babel/helpers/lib/helpers-generated.js
var require_helpers_generated = __commonJS({
  "node_modules/@babel/helpers/lib/helpers-generated.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = void 0;
    var _template = require_lib6();
    function helper(minVersion, source, metadata) {
      return Object.freeze({
        minVersion,
        ast: () => _template.default.program.ast(source, {
          preserveComments: true
        }),
        metadata
      });
    }
    var helpers = exports2.default = {
      __proto__: null,
      OverloadYield: helper("7.18.14", "function _OverloadYield(e,d){this.v=e,this.k=d}", {
        globals: [],
        locals: {
          _OverloadYield: ["body.0.id"]
        },
        exportBindingAssignments: [],
        exportName: "_OverloadYield",
        dependencies: {},
        internal: false
      }),
      applyDecoratedDescriptor: helper("7.0.0-beta.0", 'function _applyDecoratedDescriptor(i,e,r,n,l){var a={};return Object.keys(n).forEach((function(i){a[i]=n[i]})),a.enumerable=!!a.enumerable,a.configurable=!!a.configurable,("value"in a||a.initializer)&&(a.writable=!0),a=r.slice().reverse().reduce((function(r,n){return n(i,e,r)||r}),a),l&&void 0!==a.initializer&&(a.value=a.initializer?a.initializer.call(l):void 0,a.initializer=void 0),void 0===a.initializer?(Object.defineProperty(i,e,a),null):a}', {
        globals: ["Object"],
        locals: {
          _applyDecoratedDescriptor: ["body.0.id"]
        },
        exportBindingAssignments: [],
        exportName: "_applyDecoratedDescriptor",
        dependencies: {},
        internal: false
      }),
      applyDecs2311: helper("7.24.0", 'function applyDecs2311(e,t,n,r,o,i){var a,c,u,s,f,l,p,d=Symbol.metadata||Symbol.for("Symbol.metadata"),m=Object.defineProperty,h=Object.create,y=[h(null),h(null)],v=t.length;function g(t,n,r){return function(o,i){n&&(i=o,o=e);for(var a=0;a<t.length;a++)i=t[a].apply(o,r?[i]:[]);return r?i:o}}function b(e,t,n,r){if("function"!=typeof e&&(r||void 0!==e))throw new TypeError(t+" must "+(n||"be")+" a function"+(r?"":" or undefined"));return e}function applyDec(e,t,n,r,o,i,u,s,f,l,p){function d(e){if(!p(e))throw new TypeError("Attempted to access private element on non-instance")}var h=[].concat(t[0]),v=t[3],w=!u,D=1===o,S=3===o,j=4===o,E=2===o;function I(t,n,r){return function(o,i){return n&&(i=o,o=e),r&&r(o),P[t].call(o,i)}}if(!w){var P={},k=[],F=S?"get":j||D?"set":"value";if(f?(l||D?P={get:setFunctionName((function(){return v(this)}),r,"get"),set:function(e){t[4](this,e)}}:P[F]=v,l||setFunctionName(P[F],r,E?"":F)):l||(P=Object.getOwnPropertyDescriptor(e,r)),!l&&!f){if((c=y[+s][r])&&7!=(c^o))throw Error("Decorating two elements with the same name ("+P[F].name+") is not supported yet");y[+s][r]=o<3?1:o}}for(var N=e,O=h.length-1;O>=0;O-=n?2:1){var T=b(h[O],"A decorator","be",!0),z=n?h[O-1]:void 0,A={},H={kind:["field","accessor","method","getter","setter","class"][o],name:r,metadata:a,addInitializer:function(e,t){if(e.v)throw new TypeError("attempted to call addInitializer after decoration was finished");b(t,"An initializer","be",!0),i.push(t)}.bind(null,A)};if(w)c=T.call(z,N,H),A.v=1,b(c,"class decorators","return")&&(N=c);else if(H.static=s,H.private=f,c=H.access={has:f?p.bind():function(e){return r in e}},j||(c.get=f?E?function(e){return d(e),P.value}:I("get",0,d):function(e){return e[r]}),E||S||(c.set=f?I("set",0,d):function(e,t){e[r]=t}),N=T.call(z,D?{get:P.get,set:P.set}:P[F],H),A.v=1,D){if("object"==typeof N&&N)(c=b(N.get,"accessor.get"))&&(P.get=c),(c=b(N.set,"accessor.set"))&&(P.set=c),(c=b(N.init,"accessor.init"))&&k.unshift(c);else if(void 0!==N)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else b(N,(l?"field":"method")+" decorators","return")&&(l?k.unshift(N):P[F]=N)}return o<2&&u.push(g(k,s,1),g(i,s,0)),l||w||(f?D?u.splice(-1,0,I("get",s),I("set",s)):u.push(E?P[F]:b.call.bind(P[F])):m(e,r,P)),N}function w(e){return m(e,d,{configurable:!0,enumerable:!0,value:a})}return void 0!==i&&(a=i[d]),a=h(null==a?null:a),f=[],l=function(e){e&&f.push(g(e))},p=function(t,r){for(var i=0;i<n.length;i++){var a=n[i],c=a[1],l=7&c;if((8&c)==t&&!l==r){var p=a[2],d=!!a[3],m=16&c;applyDec(t?e:e.prototype,a,m,d?"#"+p:toPropertyKey(p),l,l<2?[]:t?s=s||[]:u=u||[],f,!!t,d,r,t&&d?function(t){return checkInRHS(t)===e}:o)}}},p(8,0),p(0,0),p(8,1),p(0,1),l(u),l(s),c=f,v||w(e),{e:c,get c(){var n=[];return v&&[w(e=applyDec(e,[t],r,e.name,5,n)),g(n,1)]}}}', {
        globals: ["Symbol", "Object", "TypeError", "Error"],
        locals: {
          applyDecs2311: ["body.0.id"]
        },
        exportBindingAssignments: [],
        exportName: "applyDecs2311",
        dependencies: {
          checkInRHS: ["body.0.body.body.5.argument.expressions.4.right.body.body.0.body.body.1.consequent.body.1.expression.arguments.10.consequent.body.body.0.argument.left.callee"],
          setFunctionName: ["body.0.body.body.3.body.body.3.consequent.body.1.test.expressions.0.consequent.expressions.0.consequent.right.properties.0.value.callee", "body.0.body.body.3.body.body.3.consequent.body.1.test.expressions.0.consequent.expressions.1.right.callee"],
          toPropertyKey: ["body.0.body.body.5.argument.expressions.4.right.body.body.0.body.body.1.consequent.body.1.expression.arguments.3.alternate.callee"]
        },
        internal: false
      }),
      arrayLikeToArray: helper("7.9.0", "function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}", {
        globals: ["Array"],
        locals: {
          _arrayLikeToArray: ["body.0.id"]
        },
        exportBindingAssignments: [],
        exportName: "_arrayLikeToArray",
        dependencies: {},
        internal: false
      }),
      arrayWithHoles: helper("7.0.0-beta.0", "function _arrayWithHoles(r){if(Array.isArray(r))return r}", {
        globals: ["Array"],
        locals: {
          _arrayWithHoles: ["body.0.id"]
        },
        exportBindingAssignments: [],
        exportName: "_arrayWithHoles",
        dependencies: {},
        internal: false
      }),
      arrayWithoutHoles: helper("7.0.0-beta.0", "function _arrayWithoutHoles(r){if(Array.isArray(r))return arrayLikeToArray(r)}", {
        globals: ["Array"],
        locals: {
          _arrayWithoutHoles: ["body.0.id"]
        },
        exportBindingAssignments: [],
        exportName: "_arrayWithoutHoles",
        dependencies: {
          arrayLikeToArray: ["body.0.body.body.0.consequent.argument.callee"]
        },
        internal: false
      }),
      assertClassBrand: helper("7.24.0", 'function _assertClassBrand(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}', {
        globals: ["TypeError"],
        locals: {
          _assertClassBrand: ["body.0.id"]
        },
        exportBindingAssignments: [],
        exportName: "_assertClassBrand",
        dependencies: {},
        internal: false
      }),
      assertThisInitialized: helper("7.0.0-beta.0", `function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}`, {
        globals: ["ReferenceError"],
        locals: {
          _assertThisInitialized: ["body.0.id"]
        },
        exportBindingAssignments: [],
        exportName: "_assertThisInitialized",
        dependencies: {},
        internal: false
      }),
      asyncGeneratorDelegate: helper("7.0.0-beta.0", 'function _asyncGeneratorDelegate(t){var e={},n=!1;function pump(e,r){return n=!0,r=new Promise((function(n){n(t[e](r))})),{done:!1,value:new OverloadYield(r,1)}}return e["undefined"!=typeof Symbol&&Symbol.iterator||"@@iterator"]=function(){return this},e.next=function(t){return n?(n=!1,t):pump("next",t)},"function"==typeof t.throw&&(e.throw=function(t){if(n)throw n=!1,t;return pump("throw",t)}),"function"==typeof t.return&&(e.return=function(t){return n?(n=!1,t):pump("return",t)}),e}', {
        globals: ["Promise", "Symbol"],
        locals: {
          _asyncGeneratorDelegate: ["body.0.id"]
        },
        exportBindingAssignments: [],
        exportName: "_asyncGeneratorDelegate",
        dependencies: {
          OverloadYield: ["body.0.body.body.1.body.body.0.argument.expressions.2.properties.1.value.callee"]
        },
        internal: false
      }),
      asyncIterator: helper("7.15.9", 'function _asyncIterator(r){var n,t,o,e=2;for("undefined"!=typeof Symbol&&(t=Symbol.asyncIterator,o=Symbol.iterator);e--;){if(t&&null!=(n=r[t]))return n.call(r);if(o&&null!=(n=r[o]))return new AsyncFromSyncIterator(n.call(r));t="@@asyncIterator",o="@@iterator"}throw new TypeError("Object is not async iterable")}function AsyncFromSyncIterator(r){function AsyncFromSyncIteratorContinuation(r){if(Object(r)!==r)return Promise.reject(new TypeError(r+" is not an object."));var n=r.done;return Promise.resolve(r.value).then((function(r){return{value:r,done:n}}))}return AsyncFromSyncIterator=function(r){this.s=r,this.n=r.next},AsyncFromSyncIterator.prototype={s:null,n:null,next:function(){return AsyncFromSyncIteratorContinuation(this.n.apply(this.s,arguments))},return:function(r){var n=this.s.return;return void 0===n?Promise.resolve({value:r,done:!0}):AsyncFromSyncIteratorContinuation(n.apply(this.s,arguments))},throw:function(r){var n=this.s.return;return void 0===n?Promise.reject(r):AsyncFromSyncIteratorContinuation(n.apply(this.s,arguments))}},new AsyncFromSyncIterator(r)}', {
        globals: ["Symbol", "TypeError", "Object", "Promise"],
        locals: {
          _asyncIterator: ["body.0.id"],
          AsyncFromSyncIterator: ["body.1.id", "body.0.body.body.1.body.body.1.consequent.argument.callee", "body.1.body.body.1.argument.expressions.1.left.object", "body.1.body.body.1.argument.expressions.2.callee", "body.1.body.body.1.argument.expressions.0.left"]
        },
        exportBindingAssignments: [],
        exportName: "_asyncIterator",
        dependencies: {},
        internal: false
      }),
      asyncToGenerator: helper("7.0.0-beta.0", 'function asyncGeneratorStep(n,t,e,r,o,a,c){try{var i=n[a](c),u=i.value}catch(n){return void e(n)}i.done?t(u):Promise.resolve(u).then(r,o)}function _asyncToGenerator(n){return function(){var t=this,e=arguments;return new Promise((function(r,o){var a=n.apply(t,e);function _next(n){asyncGeneratorStep(a,r,o,_next,_throw,"next",n)}function _throw(n){asyncGeneratorStep(a,r,o,_next,_throw,"throw",n)}_next(void 0)}))}}', {
        globals: ["Promise"],
        locals: {
          asyncGeneratorStep: ["body.0.id", "body.1.body.body.0.argument.body.body.1.argument.arguments.0.body.body.1.body.body.0.expression.callee", "body.1.body.body.0.argument.body.body.1.argument.arguments.0.body.body.2.body.body.0.expression.callee"],
          _asyncToGenerator: ["body.1.id"]
        },
        exportBindingAssignments: [],
        exportName: "_asyncToGenerator",
        dependencies: {},
        internal: false
      }),
      awaitAsyncGenerator: helper("7.0.0-beta.0", "function _awaitAsyncGenerator(e){return new OverloadYield(e,0)}", {
        globals: [],
        locals: {
          _awaitAsyncGenerator: ["body.0.id"]
        },
        exportBindingAssignments: [],
        exportName: "_awaitAsyncGenerator",
        dependencies: {
          OverloadYield: ["body.0.body.body.0.argument.callee"]
        },
        internal: false
      }),
      callSuper: helper("7.23.8", "function _callSuper(t,o,e){return o=getPrototypeOf(o),possibleConstructorReturn(t,isNativeReflectConstruct()?Reflect.construct(o,e||[],getPrototypeOf(t).constructor):o.apply(t,e))}", {
        globals: ["Reflect"],
        locals: {
          _callSuper: ["body.0.id"]
        },
        exportBindingAssignments: [],
        exportName: "_callSuper",
        dependencies: {
          getPrototypeOf: ["body.0.body.body.0.argument.expressions.0.right.callee", "body.0.body.body.0.argument.expressions.1.arguments.1.consequent.arguments.2.object.callee"],
          isNativeReflectConstruct: ["body.0.body.body.0.argument.expressions.1.arguments.1.test.callee"],
          possibleConstructorReturn: ["body.0.body.body.0.argument.expressions.1.callee"]
        },
        internal: false
      }),
      checkInRHS: helper("7.20.5", `function _checkInRHS(e){if(Object(e)!==e)throw TypeError("right-hand side of 'in' should be an object, got "+(null!==e?typeof e:"null"));return e}`, {
        globals: ["Object", "TypeError"],
        locals: {
          _checkInRHS: ["body.0.id"]
        },
        exportBindingAssignments: [],
        exportName: "_checkInRHS",
        dependencies: {},
        internal: false
      }),
      checkPrivateRedeclaration: helper("7.14.1", 'function _checkPrivateRedeclaration(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}', {
        globals: ["TypeError"],
        locals: {
          _checkPrivateRedeclaration: ["body.0.id"]
        },
        exportBindingAssignments: [],
        exportName: "_checkPrivateRedeclaration",
        dependencies: {},
        internal: false
      }),
      classCallCheck: helper("7.0.0-beta.0", 'function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}', {
        globals: ["TypeError"],
        locals: {
          _classCallCheck: ["body.0.id"]
        },
        exportBindingAssignments: [],
        exportName: "_classCallCheck",
        dependencies: {},
        internal: false
      }),
      classNameTDZError: helper("7.0.0-beta.0", `function _classNameTDZError(e){throw new ReferenceError('Class "'+e+'" cannot be referenced in computed property keys.')}`, {
        globals: ["ReferenceError"],
        locals: {
          _classNameTDZError: ["body.0.id"]
        },
        exportBindingAssignments: [],
        exportName: "_classNameTDZError",
        dependencies: {},
        internal: false
      }),
      classPrivateFieldGet2: helper("7.24.0", "function _classPrivateFieldGet2(s,a){return s.get(assertClassBrand(s,a))}", {
        globals: [],
        locals: {
          _classPrivateFieldGet2: ["body.0.id"]
        },
        exportBindingAssignments: [],
        exportName: "_classPrivateFieldGet2",
        dependencies: {
          assertClassBrand: ["body.0.body.body.0.argument.arguments.0.callee"]
        },
        internal: false
      }),
      classPrivateFieldInitSpec: helper("7.14.1", "function _classPrivateFieldInitSpec(e,t,a){checkPrivateRedeclaration(e,t),t.set(e,a)}", {
        globals: [],
        locals: {
          _classPrivateFieldInitSpec: ["body.0.id"]
        },
        exportBindingAssignments: [],
        exportName: "_classPrivateFieldInitSpec",
        dependencies: {
          checkPrivateRedeclaration: ["body.0.body.body.0.expression.expressions.0.callee"]
        },
        internal: false
      }),
      classPrivateFieldLooseBase: helper("7.0.0-beta.0", 'function _classPrivateFieldBase(e,t){if(!{}.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}', {
        globals: ["TypeError"],
        locals: {
          _classPrivateFieldBase: ["body.0.id"]
        },
        exportBindingAssignments: [],
        exportName: "_classPrivateFieldBase",
        dependencies: {},
        internal: false
      }),
      classPrivateFieldLooseKey: helper("7.0.0-beta.0", 'var id=0;function _classPrivateFieldKey(e){return"__private_"+id+++"_"+e}', {
        globals: [],
        locals: {
          id: ["body.0.declarations.0.id", "body.1.body.body.0.argument.left.left.right.argument", "body.1.body.body.0.argument.left.left.right.argument"],
          _classPrivateFieldKey: ["body.1.id"]
        },
        exportBindingAssignments: [],
        exportName: "_classPrivateFieldKey",
        dependencies: {},
        internal: false
      }),
      classPrivateFieldSet2: helper("7.24.0", "function _classPrivateFieldSet2(s,a,r){return s.set(assertClassBrand(s,a),r),r}", {
        globals: [],
        locals: {
          _classPrivateFieldSet2: ["body.0.id"]
        },
        exportBindingAssignments: [],
        exportName: "_classPrivateFieldSet2",
        dependencies: {
          assertClassBrand: ["body.0.body.body.0.argument.expressions.0.arguments.0.callee"]
        },
        internal: false
      }),
      classPrivateGetter: helper("7.24.0", "function _classPrivateGetter(s,r,a){return a(assertClassBrand(s,r))}", {
        globals: [],
        locals: {
          _classPrivateGetter: ["body.0.id"]
        },
        exportBindingAssignments: [],
        exportName: "_classPrivateGetter",
        dependencies: {
          assertClassBrand: ["body.0.body.body.0.argument.arguments.0.callee"]
        },
        internal: false
      }),
      classPrivateMethodInitSpec: helper("7.14.1", "function _classPrivateMethodInitSpec(e,a){checkPrivateRedeclaration(e,a),a.add(e)}", {
        globals: [],
        locals: {
          _classPrivateMethodInitSpec: ["body.0.id"]
        },
        exportBindingAssignments: [],
        exportName: "_classPrivateMethodInitSpec",
        dependencies: {
          checkPrivateRedeclaration: ["body.0.body.body.0.expression.expressions.0.callee"]
        },
        internal: false
      }),
      classPrivateSetter: helper("7.24.0", "function _classPrivateSetter(s,r,a,t){return r(assertClassBrand(s,a),t),t}", {
        globals: [],
        locals: {
          _classPrivateSetter: ["body.0.id"]
        },
        exportBindingAssignments: [],
        exportName: "_classPrivateSetter",
        dependencies: {
          assertClassBrand: ["body.0.body.body.0.argument.expressions.0.arguments.0.callee"]
        },
        internal: false
      }),
      classStaticPrivateMethodGet: helper("7.3.2", "function _classStaticPrivateMethodGet(s,a,t){return assertClassBrand(a,s),t}", {
        globals: [],
        locals: {
          _classStaticPrivateMethodGet: ["body.0.id"]
        },
        exportBindingAssignments: [],
        exportName: "_classStaticPrivateMethodGet",
        dependencies: {
          assertClassBrand: ["body.0.body.body.0.argument.expressions.0.callee"]
        },
        internal: false
      }),
      construct: helper("7.0.0-beta.0", "function _construct(t,e,r){if(isNativeReflectConstruct())return Reflect.construct.apply(null,arguments);var o=[null];o.push.apply(o,e);var p=new(t.bind.apply(t,o));return r&&setPrototypeOf(p,r.prototype),p}", {
        globals: ["Reflect"],
        locals: {
          _construct: ["body.0.id"]
        },
        exportBindingAssignments: [],
        exportName: "_construct",
        dependencies: {
          isNativeReflectConstruct: ["body.0.body.body.0.test.callee"],
          setPrototypeOf: ["body.0.body.body.4.argument.expressions.0.right.callee"]
        },
        internal: false
      }),
      createClass: helper("7.0.0-beta.0", 'function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}', {
        globals: ["Object"],
        locals: {
          _defineProperties: ["body.0.id", "body.1.body.body.0.argument.expressions.0.right.callee", "body.1.body.body.0.argument.expressions.1.right.callee"],
          _createClass: ["body.1.id"]
        },
        exportBindingAssignments: [],
        exportName: "_createClass",
        dependencies: {
          toPropertyKey: ["body.0.body.body.0.body.body.1.expression.expressions.3.arguments.1.callee"]
        },
        internal: false
      }),
      createForOfIteratorHelper: helper("7.9.0", 'function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var n=0,F=function(){};return{s:F,n:function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]}},e:function(r){throw r},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function(){t=t.call(r)},n:function(){var r=t.next();return a=r.done,r},e:function(r){u=!0,o=r},f:function(){try{a||null==t.return||t.return()}finally{if(u)throw o}}}}', {
        globals: ["Symbol", "Array", "TypeError"],
        locals: {
          _createForOfIteratorHelper: ["body.0.id"]
        },
        exportBindingAssignments: [],
        exportName: "_createForOfIteratorHelper",
        dependencies: {
          unsupportedIterableToArray: ["body.0.body.body.1.consequent.body.0.test.left.right.right.callee"]
        },
        internal: false
      }),
      createForOfIteratorHelperLoose: helper("7.9.0", 'function _createForOfIteratorHelperLoose(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(t)return(t=t.call(r)).next.bind(t);if(Array.isArray(r)||(t=unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var o=0;return function(){return o>=r.length?{done:!0}:{done:!1,value:r[o++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}', {
        globals: ["Symbol", "Array", "TypeError"],
        locals: {
          _createForOfIteratorHelperLoose: ["body.0.id"]
        },
        exportBindingAssignments: [],
        exportName: "_createForOfIteratorHelperLoose",
        dependencies: {
          unsupportedIterableToArray: ["body.0.body.body.2.test.left.right.right.callee"]
        },
        internal: false
      }),
      createSuper: helper("7.9.0", "function _createSuper(t){var r=isNativeReflectConstruct();return function(){var e,o=getPrototypeOf(t);if(r){var s=getPrototypeOf(this).constructor;e=Reflect.construct(o,arguments,s)}else e=o.apply(this,arguments);return possibleConstructorReturn(this,e)}}", {
        globals: ["Reflect"],
        locals: {
          _createSuper: ["body.0.id"]
        },
        exportBindingAssignments: [],
        exportName: "_createSuper",
        dependencies: {
          getPrototypeOf: ["body.0.body.body.1.argument.body.body.0.declarations.1.init.callee", "body.0.body.body.1.argument.body.body.1.consequent.body.0.declarations.0.init.object.callee"],
          isNativeReflectConstruct: ["body.0.body.body.0.declarations.0.init.callee"],
          possibleConstructorReturn: ["body.0.body.body.1.argument.body.body.2.argument.callee"]
        },
        internal: false
      }),
      decorate: helper("7.1.5", `function _decorate(e,r,t,i){var o=_getDecoratorsApi();if(i)for(var n=0;n<i.length;n++)o=i[n](o);var s=r((function(e){o.initializeInstanceElements(e,a.elements)}),t),a=o.decorateClass(_coalesceClassElements(s.d.map(_createElementDescriptor)),e);return o.initializeClassElements(s.F,a.elements),o.runClassFinishers(s.F,a.finishers)}function _getDecoratorsApi(){_getDecoratorsApi=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,r){["method","field"].forEach((function(t){r.forEach((function(r){r.kind===t&&"own"===r.placement&&this.defineClassElement(e,r)}),this)}),this)},initializeClassElements:function(e,r){var t=e.prototype;["method","field"].forEach((function(i){r.forEach((function(r){var o=r.placement;if(r.kind===i&&("static"===o||"prototype"===o)){var n="static"===o?e:t;this.defineClassElement(n,r)}}),this)}),this)},defineClassElement:function(e,r){var t=r.descriptor;if("field"===r.kind){var i=r.initializer;t={enumerable:t.enumerable,writable:t.writable,configurable:t.configurable,value:void 0===i?void 0:i.call(e)}}Object.defineProperty(e,r.key,t)},decorateClass:function(e,r){var t=[],i=[],o={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,o)}),this),e.forEach((function(e){if(!_hasDecorators(e))return t.push(e);var r=this.decorateElement(e,o);t.push(r.element),t.push.apply(t,r.extras),i.push.apply(i,r.finishers)}),this),!r)return{elements:t,finishers:i};var n=this.decorateConstructor(t,r);return i.push.apply(i,n.finishers),n.finishers=i,n},addElementPlacement:function(e,r,t){var i=r[e.placement];if(!t&&-1!==i.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");i.push(e.key)},decorateElement:function(e,r){for(var t=[],i=[],o=e.decorators,n=o.length-1;n>=0;n--){var s=r[e.placement];s.splice(s.indexOf(e.key),1);var a=this.fromElementDescriptor(e),l=this.toElementFinisherExtras((0,o[n])(a)||a);e=l.element,this.addElementPlacement(e,r),l.finisher&&i.push(l.finisher);var c=l.extras;if(c){for(var p=0;p<c.length;p++)this.addElementPlacement(c[p],r);t.push.apply(t,c)}}return{element:e,finishers:i,extras:t}},decorateConstructor:function(e,r){for(var t=[],i=r.length-1;i>=0;i--){var o=this.fromClassDescriptor(e),n=this.toClassDescriptor((0,r[i])(o)||o);if(void 0!==n.finisher&&t.push(n.finisher),void 0!==n.elements){e=n.elements;for(var s=0;s<e.length-1;s++)for(var a=s+1;a<e.length;a++)if(e[s].key===e[a].key&&e[s].placement===e[a].placement)throw new TypeError("Duplicated element ("+e[s].key+")")}}return{elements:e,finishers:t}},fromElementDescriptor:function(e){var r={kind:e.kind,key:e.key,placement:e.placement,descriptor:e.descriptor};return Object.defineProperty(r,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),"field"===e.kind&&(r.initializer=e.initializer),r},toElementDescriptors:function(e){if(void 0!==e)return toArray(e).map((function(e){var r=this.toElementDescriptor(e);return this.disallowProperty(e,"finisher","An element descriptor"),this.disallowProperty(e,"extras","An element descriptor"),r}),this)},toElementDescriptor:function(e){var r=e.kind+"";if("method"!==r&&"field"!==r)throw new TypeError('An element descriptor\\'s .kind property must be either "method" or "field", but a decorator created an element descriptor with .kind "'+r+'"');var t=toPropertyKey(e.key),i=e.placement+"";if("static"!==i&&"prototype"!==i&&"own"!==i)throw new TypeError('An element descriptor\\'s .placement property must be one of "static", "prototype" or "own", but a decorator created an element descriptor with .placement "'+i+'"');var o=e.descriptor;this.disallowProperty(e,"elements","An element descriptor");var n={kind:r,key:t,placement:i,descriptor:Object.assign({},o)};return"field"!==r?this.disallowProperty(e,"initializer","A method descriptor"):(this.disallowProperty(o,"get","The property descriptor of a field descriptor"),this.disallowProperty(o,"set","The property descriptor of a field descriptor"),this.disallowProperty(o,"value","The property descriptor of a field descriptor"),n.initializer=e.initializer),n},toElementFinisherExtras:function(e){return{element:this.toElementDescriptor(e),finisher:_optionalCallableProperty(e,"finisher"),extras:this.toElementDescriptors(e.extras)}},fromClassDescriptor:function(e){var r={kind:"class",elements:e.map(this.fromElementDescriptor,this)};return Object.defineProperty(r,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),r},toClassDescriptor:function(e){var r=e.kind+"";if("class"!==r)throw new TypeError('A class descriptor\\'s .kind property must be "class", but a decorator created a class descriptor with .kind "'+r+'"');this.disallowProperty(e,"key","A class descriptor"),this.disallowProperty(e,"placement","A class descriptor"),this.disallowProperty(e,"descriptor","A class descriptor"),this.disallowProperty(e,"initializer","A class descriptor"),this.disallowProperty(e,"extras","A class descriptor");var t=_optionalCallableProperty(e,"finisher");return{elements:this.toElementDescriptors(e.elements),finisher:t}},runClassFinishers:function(e,r){for(var t=0;t<r.length;t++){var i=(0,r[t])(e);if(void 0!==i){if("function"!=typeof i)throw new TypeError("Finishers must return a constructor.");e=i}}return e},disallowProperty:function(e,r,t){if(void 0!==e[r])throw new TypeError(t+" can't have a ."+r+" property.")}};return e}function _createElementDescriptor(e){var r,t=toPropertyKey(e.key);"method"===e.kind?r={value:e.value,writable:!0,configurable:!0,enumerable:!1}:"get"===e.kind?r={get:e.value,configurable:!0,enumerable:!1}:"set"===e.kind?r={set:e.value,configurable:!0,enumerable:!1}:"field"===e.kind&&(r={configurable:!0,writable:!0,enumerable:!0});var i={kind:"field"===e.kind?"field":"method",key:t,placement:e.static?"static":"field"===e.kind?"own":"prototype",descriptor:r};return e.decorators&&(i.decorators=e.decorators),"field"===e.kind&&(i.initializer=e.value),i}function _coalesceGetterSetter(e,r){void 0!==e.descriptor.get?r.descriptor.get=e.descriptor.get:r.descriptor.set=e.descriptor.set}function _coalesceClassElements(e){for(var r=[],isSameElement=function(e){return"method"===e.kind&&e.key===o.key&&e.placement===o.placement},t=0;t<e.length;t++){var i,o=e[t];if("method"===o.kind&&(i=r.find(isSameElement)))if(_isDataDescriptor(o.descriptor)||_isDataDescriptor(i.descriptor)){if(_hasDecorators(o)||_hasDecorators(i))throw new ReferenceError("Duplicated methods ("+o.key+") can't be decorated.");i.descriptor=o.descriptor}else{if(_hasDecorators(o)){if(_hasDecorators(i))throw new ReferenceError("Decorators can't be placed on different accessors with for the same property ("+o.key+").");i.decorators=o.decorators}_coalesceGetterSetter(o,i)}else r.push(o)}return r}function _hasDecorators(e){return e.decorators&&e.decorators.length}function _isDataDescriptor(e){return void 0!==e&&!(void 0===e.value&&void 0===e.writable)}function _optionalCallableProperty(e,r){var t=e[r];if(void 0!==t&&"function"!=typeof t)throw new TypeError("Expected '"+r+"' to be a function");return t}`, {
        globals: ["Object", "TypeError", "Symbol", "ReferenceError"],
        locals: {
          _decorate: ["body.0.id"],
          _getDecoratorsApi: ["body.1.id", "body.0.body.body.0.declarations.0.init.callee", "body.1.body.body.0.expression.left"],
          _createElementDescriptor: ["body.2.id", "body.0.body.body.2.declarations.1.init.arguments.0.arguments.0.arguments.0"],
          _coalesceGetterSetter: ["body.3.id", "body.4.body.body.0.body.body.1.consequent.alternate.body.1.expression.callee"],
          _coalesceClassElements: ["body.4.id", "body.0.body.body.2.declarations.1.init.arguments.0.callee"],
          _hasDecorators: ["body.5.id", "body.1.body.body.1.declarations.0.init.properties.4.value.body.body.1.test.expressions.1.arguments.0.body.body.0.test.argument.callee", "body.4.body.body.0.body.body.1.consequent.consequent.body.0.test.left.callee", "body.4.body.body.0.body.body.1.consequent.consequent.body.0.test.right.callee", "body.4.body.body.0.body.body.1.consequent.alternate.body.0.test.callee", "body.4.body.body.0.body.body.1.consequent.alternate.body.0.consequent.body.0.test.callee"],
          _isDataDescriptor: ["body.6.id", "body.4.body.body.0.body.body.1.consequent.test.left.callee", "body.4.body.body.0.body.body.1.consequent.test.right.callee"],
          _optionalCallableProperty: ["body.7.id", "body.1.body.body.1.declarations.0.init.properties.11.value.body.body.0.argument.properties.1.value.callee", "body.1.body.body.1.declarations.0.init.properties.13.value.body.body.3.declarations.0.init.callee"]
        },
        exportBindingAssignments: [],
        exportName: "_decorate",
        dependencies: {
          toArray: ["body.1.body.body.1.declarations.0.init.properties.9.value.body.body.0.consequent.argument.callee.object.callee"],
          toPropertyKey: ["body.1.body.body.1.declarations.0.init.properties.10.value.body.body.2.declarations.0.init.callee", "body.2.body.body.0.declarations.1.init.callee"]
        },
        internal: false
      }),
      defaults: helper("7.0.0-beta.0", "function _defaults(e,r){for(var t=Object.getOwnPropertyNames(r),o=0;o<t.length;o++){var n=t[o],a=Object.getOwnPropertyDescriptor(r,n);a&&a.configurable&&void 0===e[n]&&Object.defineProperty(e,n,a)}return e}", {
        globals: ["Object"],
        locals: {
          _defaults: ["body.0.id"]
        },
        exportBindingAssignments: [],
        exportName: "_defaults",
        dependencies: {},
        internal: false
      }),
      defineAccessor: helper("7.20.7", "function _defineAccessor(e,r,n,t){var c={configurable:!0,enumerable:!0};return c[e]=t,Object.defineProperty(r,n,c)}", {
        globals: ["Object"],
        locals: {
          _defineAccessor: ["body.0.id"]
        },
        exportBindingAssignments: [],
        exportName: "_defineAccessor",
        dependencies: {},
        internal: false
      }),
      defineProperty: helper("7.0.0-beta.0", "function _defineProperty(e,r,t){return(r=toPropertyKey(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}", {
        globals: ["Object"],
        locals: {
          _defineProperty: ["body.0.id"]
        },
        exportBindingAssignments: [],
        exportName: "_defineProperty",
        dependencies: {
          toPropertyKey: ["body.0.body.body.0.argument.expressions.0.test.left.right.callee"]
        },
        internal: false
      }),
      extends: helper("7.0.0-beta.0", "function _extends(){return _extends=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)({}).hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},_extends.apply(null,arguments)}", {
        globals: ["Object"],
        locals: {
          _extends: ["body.0.id", "body.0.body.body.0.argument.expressions.1.callee.object", "body.0.body.body.0.argument.expressions.0.left"]
        },
        exportBindingAssignments: ["body.0.body.body.0.argument.expressions.0"],
        exportName: "_extends",
        dependencies: {},
        internal: false
      }),
      get: helper("7.0.0-beta.0", 'function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var p=superPropBase(e,t);if(p){var n=Object.getOwnPropertyDescriptor(p,t);return n.get?n.get.call(arguments.length<3?e:r):n.value}},_get.apply(null,arguments)}', {
        globals: ["Reflect", "Object"],
        locals: {
          _get: ["body.0.id", "body.0.body.body.0.argument.expressions.1.callee.object", "body.0.body.body.0.argument.expressions.0.left"]
        },
        exportBindingAssignments: ["body.0.body.body.0.argument.expressions.0"],
        exportName: "_get",
        dependencies: {
          superPropBase: ["body.0.body.body.0.argument.expressions.0.right.alternate.body.body.0.declarations.0.init.callee"]
        },
        internal: false
      }),
      getPrototypeOf: helper("7.0.0-beta.0", "function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_getPrototypeOf(t)}", {
        globals: ["Object"],
        locals: {
          _getPrototypeOf: ["body.0.id", "body.0.body.body.0.argument.expressions.1.callee", "body.0.body.body.0.argument.expressions.0.left"]
        },
        exportBindingAssignments: ["body.0.body.body.0.argument.expressions.0"],
        exportName: "_getPrototypeOf",
        dependencies: {},
        internal: false
      }),
      identity: helper("7.17.0", "function _identity(t){return t}", {
        globals: [],
        locals: {
          _identity: ["body.0.id"]
        },
        exportBindingAssignments: [],
        exportName: "_identity",
        dependencies: {},
        internal: false
      }),
      importDeferProxy: helper("7.23.0", "function _importDeferProxy(e){var t=null,constValue=function(e){return function(){return e}},proxy=function(r){return function(n,o,f){return null===t&&(t=e()),r(t,o,f)}};return new Proxy({},{defineProperty:constValue(!1),deleteProperty:constValue(!1),get:proxy(Reflect.get),getOwnPropertyDescriptor:proxy(Reflect.getOwnPropertyDescriptor),getPrototypeOf:constValue(null),isExtensible:constValue(!1),has:proxy(Reflect.has),ownKeys:proxy(Reflect.ownKeys),preventExtensions:constValue(!0),set:constValue(!1),setPrototypeOf:constValue(!1)})}", {
        globals: ["Proxy", "Reflect"],
        locals: {
          _importDeferProxy: ["body.0.id"]
        },
        exportBindingAssignments: [],
        exportName: "_importDeferProxy",
        dependencies: {},
        internal: false
      }),
      inherits: helper("7.0.0-beta.0", 'function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&setPrototypeOf(t,e)}', {
        globals: ["TypeError", "Object"],
        locals: {
          _inherits: ["body.0.id"]
        },
        exportBindingAssignments: [],
        exportName: "_inherits",
        dependencies: {
          setPrototypeOf: ["body.0.body.body.1.expression.expressions.2.right.callee"]
        },
        internal: false
      }),
      inheritsLoose: helper("7.0.0-beta.0", "function _inheritsLoose(t,o){t.prototype=Object.create(o.prototype),t.prototype.constructor=t,setPrototypeOf(t,o)}", {
        globals: ["Object"],
        locals: {
          _inheritsLoose: ["body.0.id"]
        },
        exportBindingAssignments: [],
        exportName: "_inheritsLoose",
        dependencies: {
          setPrototypeOf: ["body.0.body.body.0.expression.expressions.2.callee"]
        },
        internal: false
      }),
      initializerDefineProperty: helper("7.0.0-beta.0", "function _initializerDefineProperty(e,i,r,l){r&&Object.defineProperty(e,i,{enumerable:r.enumerable,configurable:r.configurable,writable:r.writable,value:r.initializer?r.initializer.call(l):void 0})}", {
        globals: ["Object"],
        locals: {
          _initializerDefineProperty: ["body.0.id"]
        },
        exportBindingAssignments: [],
        exportName: "_initializerDefineProperty",
        dependencies: {},
        internal: false
      }),
      initializerWarningHelper: helper("7.0.0-beta.0", 'function _initializerWarningHelper(r,e){throw Error("Decorating class property failed. Please ensure that transform-class-properties is enabled and runs after the decorators transform.")}', {
        globals: ["Error"],
        locals: {
          _initializerWarningHelper: ["body.0.id"]
        },
        exportBindingAssignments: [],
        exportName: "_initializerWarningHelper",
        dependencies: {},
        internal: false
      }),
      instanceof: helper("7.0.0-beta.0", 'function _instanceof(n,e){return null!=e&&"undefined"!=typeof Symbol&&e[Symbol.hasInstance]?!!e[Symbol.hasInstance](n):n instanceof e}', {
        globals: ["Symbol"],
        locals: {
          _instanceof: ["body.0.id"]
        },
        exportBindingAssignments: [],
        exportName: "_instanceof",
        dependencies: {},
        internal: false
      }),
      interopRequireDefault: helper("7.0.0-beta.0", "function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}", {
        globals: [],
        locals: {
          _interopRequireDefault: ["body.0.id"]
        },
        exportBindingAssignments: [],
        exportName: "_interopRequireDefault",
        dependencies: {},
        internal: false
      }),
      interopRequireWildcard: helper("7.14.0", 'function _interopRequireWildcard(e,t){if("function"==typeof WeakMap)var r=new WeakMap,n=new WeakMap;return(_interopRequireWildcard=function(e,t){if(!t&&e&&e.__esModule)return e;var o,i,f={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return f;if(o=t?n:r){if(o.has(e))return o.get(e);o.set(e,f)}for(const t in e)"default"!==t&&{}.hasOwnProperty.call(e,t)&&((i=(o=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,t))&&(i.get||i.set)?o(f,t,i):f[t]=e[t]);return f})(e,t)}', {
        globals: ["WeakMap", "Object"],
        locals: {
          _interopRequireWildcard: ["body.0.id", "body.0.body.body.1.argument.callee.left"]
        },
        exportBindingAssignments: ["body.0.body.body.1.argument.callee"],
        exportName: "_interopRequireWildcard",
        dependencies: {},
        internal: false
      }),
      isNativeFunction: helper("7.0.0-beta.0", 'function _isNativeFunction(t){try{return-1!==Function.toString.call(t).indexOf("[native code]")}catch(n){return"function"==typeof t}}', {
        globals: ["Function"],
        locals: {
          _isNativeFunction: ["body.0.id"]
        },
        exportBindingAssignments: [],
        exportName: "_isNativeFunction",
        dependencies: {},
        internal: false
      }),
      isNativeReflectConstruct: helper("7.9.0", "function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(_isNativeReflectConstruct=function(){return!!t})()}", {
        globals: ["Boolean", "Reflect"],
        locals: {
          _isNativeReflectConstruct: ["body.0.id", "body.0.body.body.1.argument.callee.left"]
        },
        exportBindingAssignments: ["body.0.body.body.1.argument.callee"],
        exportName: "_isNativeReflectConstruct",
        dependencies: {},
        internal: false
      }),
      iterableToArray: helper("7.0.0-beta.0", 'function _iterableToArray(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r)}', {
        globals: ["Symbol", "Array"],
        locals: {
          _iterableToArray: ["body.0.id"]
        },
        exportBindingAssignments: [],
        exportName: "_iterableToArray",
        dependencies: {},
        internal: false
      }),
      iterableToArrayLimit: helper("7.0.0-beta.0", 'function _iterableToArrayLimit(r,l){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var e,n,i,u,a=[],f=!0,o=!1;try{if(i=(t=t.call(r)).next,0===l){if(Object(t)!==t)return;f=!1}else for(;!(f=(e=i.call(t)).done)&&(a.push(e.value),a.length!==l);f=!0);}catch(r){o=!0,n=r}finally{try{if(!f&&null!=t.return&&(u=t.return(),Object(u)!==u))return}finally{if(o)throw n}}return a}}', {
        globals: ["Symbol", "Object"],
        locals: {
          _iterableToArrayLimit: ["body.0.id"]
        },
        exportBindingAssignments: [],
        exportName: "_iterableToArrayLimit",
        dependencies: {},
        internal: false
      }),
      jsx: helper("7.0.0-beta.0", 'var REACT_ELEMENT_TYPE;function _createRawReactElement(e,r,E,l){REACT_ELEMENT_TYPE||(REACT_ELEMENT_TYPE="function"==typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103);var o=e&&e.defaultProps,n=arguments.length-3;if(r||0===n||(r={children:void 0}),1===n)r.children=l;else if(n>1){for(var t=Array(n),f=0;f<n;f++)t[f]=arguments[f+3];r.children=t}if(r&&o)for(var i in o)void 0===r[i]&&(r[i]=o[i]);else r||(r=o||{});return{$$typeof:REACT_ELEMENT_TYPE,type:e,key:void 0===E?null:""+E,ref:null,props:r,_owner:null}}', {
        globals: ["Symbol", "Array"],
        locals: {
          REACT_ELEMENT_TYPE: ["body.0.declarations.0.id", "body.1.body.body.0.expression.left", "body.1.body.body.4.argument.properties.0.value", "body.1.body.body.0.expression.right.left"],
          _createRawReactElement: ["body.1.id"]
        },
        exportBindingAssignments: [],
        exportName: "_createRawReactElement",
        dependencies: {},
        internal: false
      }),
      maybeArrayLike: helper("7.9.0", 'function _maybeArrayLike(r,a,e){if(a&&!Array.isArray(a)&&"number"==typeof a.length){var y=a.length;return arrayLikeToArray(a,void 0!==e&&e<y?e:y)}return r(a,e)}', {
        globals: ["Array"],
        locals: {
          _maybeArrayLike: ["body.0.id"]
        },
        exportBindingAssignments: [],
        exportName: "_maybeArrayLike",
        dependencies: {
          arrayLikeToArray: ["body.0.body.body.0.consequent.body.1.argument.callee"]
        },
        internal: false
      }),
      newArrowCheck: helper("7.0.0-beta.0", 'function _newArrowCheck(n,r){if(n!==r)throw new TypeError("Cannot instantiate an arrow function")}', {
        globals: ["TypeError"],
        locals: {
          _newArrowCheck: ["body.0.id"]
        },
        exportBindingAssignments: [],
        exportName: "_newArrowCheck",
        dependencies: {},
        internal: false
      }),
      nonIterableRest: helper("7.0.0-beta.0", 'function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}', {
        globals: ["TypeError"],
        locals: {
          _nonIterableRest: ["body.0.id"]
        },
        exportBindingAssignments: [],
        exportName: "_nonIterableRest",
        dependencies: {},
        internal: false
      }),
      nonIterableSpread: helper("7.0.0-beta.0", 'function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}', {
        globals: ["TypeError"],
        locals: {
          _nonIterableSpread: ["body.0.id"]
        },
        exportBindingAssignments: [],
        exportName: "_nonIterableSpread",
        dependencies: {},
        internal: false
      }),
      nullishReceiverError: helper("7.22.6", 'function _nullishReceiverError(r){throw new TypeError("Cannot set property of null or undefined.")}', {
        globals: ["TypeError"],
        locals: {
          _nullishReceiverError: ["body.0.id"]
        },
        exportBindingAssignments: [],
        exportName: "_nullishReceiverError",
        dependencies: {},
        internal: false
      }),
      objectDestructuringEmpty: helper("7.0.0-beta.0", 'function _objectDestructuringEmpty(t){if(null==t)throw new TypeError("Cannot destructure "+t)}', {
        globals: ["TypeError"],
        locals: {
          _objectDestructuringEmpty: ["body.0.id"]
        },
        exportBindingAssignments: [],
        exportName: "_objectDestructuringEmpty",
        dependencies: {},
        internal: false
      }),
      objectSpread2: helper("7.5.0", "function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,o)}return t}function _objectSpread2(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?ownKeys(Object(t),!0).forEach((function(r){defineProperty(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}", {
        globals: ["Object"],
        locals: {
          ownKeys: ["body.0.id", "body.1.body.body.0.body.body.1.expression.consequent.callee.object.callee", "body.1.body.body.0.body.body.1.expression.alternate.alternate.callee.object.callee"],
          _objectSpread2: ["body.1.id"]
        },
        exportBindingAssignments: [],
        exportName: "_objectSpread2",
        dependencies: {
          defineProperty: ["body.1.body.body.0.body.body.1.expression.consequent.arguments.0.body.body.0.expression.callee"]
        },
        internal: false
      }),
      objectWithoutProperties: helper("7.0.0-beta.0", "function _objectWithoutProperties(e,t){if(null==e)return{};var o,r,i=objectWithoutPropertiesLoose(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(r=0;r<n.length;r++)o=n[r],-1===t.indexOf(o)&&{}.propertyIsEnumerable.call(e,o)&&(i[o]=e[o])}return i}", {
        globals: ["Object"],
        locals: {
          _objectWithoutProperties: ["body.0.id"]
        },
        exportBindingAssignments: [],
        exportName: "_objectWithoutProperties",
        dependencies: {
          objectWithoutPropertiesLoose: ["body.0.body.body.1.declarations.2.init.callee"]
        },
        internal: false
      }),
      objectWithoutPropertiesLoose: helper("7.0.0-beta.0", "function _objectWithoutPropertiesLoose(r,e){if(null==r)return{};var t={};for(var n in r)if({}.hasOwnProperty.call(r,n)){if(-1!==e.indexOf(n))continue;t[n]=r[n]}return t}", {
        globals: [],
        locals: {
          _objectWithoutPropertiesLoose: ["body.0.id"]
        },
        exportBindingAssignments: [],
        exportName: "_objectWithoutPropertiesLoose",
        dependencies: {},
        internal: false
      }),
      possibleConstructorReturn: helper("7.0.0-beta.0", 'function _possibleConstructorReturn(t,e){if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return assertThisInitialized(t)}', {
        globals: ["TypeError"],
        locals: {
          _possibleConstructorReturn: ["body.0.id"]
        },
        exportBindingAssignments: [],
        exportName: "_possibleConstructorReturn",
        dependencies: {
          assertThisInitialized: ["body.0.body.body.2.argument.callee"]
        },
        internal: false
      }),
      readOnlyError: helper("7.0.0-beta.0", `function _readOnlyError(r){throw new TypeError('"'+r+'" is read-only')}`, {
        globals: ["TypeError"],
        locals: {
          _readOnlyError: ["body.0.id"]
        },
        exportBindingAssignments: [],
        exportName: "_readOnlyError",
        dependencies: {},
        internal: false
      }),
      regenerator: helper("7.27.0", `function _regenerator(){
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var c=n&&n.prototype instanceof Generator?n:Generator,u=Object.create(c.prototype);return define(u,"_invoke",function(r,n,o){var i,c,u,f=0,p=o||[],y=!1,G={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(t,r){return i=t,c=0,u=e,G.n=r,a}};function d(r,n){for(c=r,u=n,t=0;!y&&f&&!o&&t<p.length;t++){var o,i=p[t],d=G.p,l=i[2];r>3?(o=l===n)&&(u=i[(c=i[4])?5:(c=3,3)],i[4]=i[5]=e):i[0]<=d&&((o=r<2&&d<i[1])?(c=0,G.v=n,G.n=i[1]):d<l&&(o=r<3||i[0]>n||n>l)&&(i[4]=r,i[5]=n,G.n=l,c=0))}if(o||r>1)return a;throw y=!0,n}return function(o,p,l){if(f>1)throw TypeError("Generator is already running");for(y&&1===p&&d(p,l),c=p,u=l;(t=c<2?e:u)||!y;){i||(c?c<3?(c>1&&(G.n=-1),d(c,u)):G.n=u:G.v=u);try{if(f=2,i){if(c||(o="next"),t=i[o]){if(!(t=t.call(i,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,c<2&&(c=0)}else 1===c&&(t=i.return)&&t.call(i),c<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),c=1);i=e}else if((t=(y=G.n<0)?u:r.call(n,G))!==a)break}catch(t){i=e,c=1,u=t}finally{f=1}}return{value:t,done:y}}}(r,o,i),!0),u}var a={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}t=Object.getPrototypeOf;var c=[][n]?t(t([][n]())):(define(t={},n,(function(){return this})),t),u=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(c);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,GeneratorFunctionPrototype):(e.__proto__=GeneratorFunctionPrototype,define(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return GeneratorFunction.prototype=GeneratorFunctionPrototype,define(u,"constructor",GeneratorFunctionPrototype),define(GeneratorFunctionPrototype,"constructor",GeneratorFunction),GeneratorFunction.displayName="GeneratorFunction",define(GeneratorFunctionPrototype,o,"GeneratorFunction"),define(u),define(u,o,"Generator"),define(u,n,(function(){return this})),define(u,"toString",(function(){return"[object Generator]"})),(_regenerator=function(){return{w:i,m:f}})()}`, {
        globals: ["Symbol", "Object", "TypeError"],
        locals: {
          _regenerator: ["body.0.id", "body.0.body.body.9.argument.expressions.9.callee.left"]
        },
        exportBindingAssignments: ["body.0.body.body.9.argument.expressions.9.callee"],
        exportName: "_regenerator",
        dependencies: {
          regeneratorDefine: ["body.0.body.body.1.body.body.1.argument.expressions.0.callee", "body.0.body.body.7.declarations.0.init.alternate.expressions.0.callee", "body.0.body.body.8.body.body.0.argument.expressions.0.alternate.expressions.1.callee", "body.0.body.body.9.argument.expressions.1.callee", "body.0.body.body.9.argument.expressions.2.callee", "body.0.body.body.9.argument.expressions.4.callee", "body.0.body.body.9.argument.expressions.5.callee", "body.0.body.body.9.argument.expressions.6.callee", "body.0.body.body.9.argument.expressions.7.callee", "body.0.body.body.9.argument.expressions.8.callee"]
        },
        internal: false
      }),
      regeneratorAsync: helper("7.27.0", "function _regeneratorAsync(n,e,r,t,o){var a=asyncGen(n,e,r,t,o);return a.next().then((function(n){return n.done?n.value:a.next()}))}", {
        globals: [],
        locals: {
          _regeneratorAsync: ["body.0.id"]
        },
        exportBindingAssignments: [],
        exportName: "_regeneratorAsync",
        dependencies: {
          regeneratorAsyncGen: ["body.0.body.body.0.declarations.0.init.callee"]
        },
        internal: false
      }),
      regeneratorAsyncGen: helper("7.27.0", "function _regeneratorAsyncGen(r,e,t,o,n){return new regeneratorAsyncIterator(regenerator().w(r,e,t,o),n||Promise)}", {
        globals: ["Promise"],
        locals: {
          _regeneratorAsyncGen: ["body.0.id"]
        },
        exportBindingAssignments: [],
        exportName: "_regeneratorAsyncGen",
        dependencies: {
          regenerator: ["body.0.body.body.0.argument.arguments.0.callee.object.callee"],
          regeneratorAsyncIterator: ["body.0.body.body.0.argument.callee"]
        },
        internal: false
      }),
      regeneratorAsyncIterator: helper("7.27.0", 'function AsyncIterator(t,e){function n(r,o,i,f){try{var c=t[r](o),u=c.value;return u instanceof OverloadYield?e.resolve(u.v).then((function(t){n("next",t,i,f)}),(function(t){n("throw",t,i,f)})):e.resolve(u).then((function(t){c.value=t,i(c)}),(function(t){return n("throw",t,i,f)}))}catch(t){f(t)}}var r;this.next||(define(AsyncIterator.prototype),define(AsyncIterator.prototype,"function"==typeof Symbol&&Symbol.asyncIterator||"@asyncIterator",(function(){return this}))),define(this,"_invoke",(function(t,o,i){function f(){return new e((function(e,r){n(t,i,e,r)}))}return r=r?r.then(f,f):f()}),!0)}', {
        globals: ["Symbol"],
        locals: {
          AsyncIterator: ["body.0.id", "body.0.body.body.2.expression.expressions.0.right.expressions.0.arguments.0.object", "body.0.body.body.2.expression.expressions.0.right.expressions.1.arguments.0.object"]
        },
        exportBindingAssignments: [],
        exportName: "AsyncIterator",
        dependencies: {
          OverloadYield: ["body.0.body.body.0.body.body.0.block.body.1.argument.test.right"],
          regeneratorDefine: ["body.0.body.body.2.expression.expressions.0.right.expressions.0.callee", "body.0.body.body.2.expression.expressions.0.right.expressions.1.callee", "body.0.body.body.2.expression.expressions.1.callee"]
        },
        internal: true
      }),
      regeneratorDefine: helper("7.27.0", 'function regeneratorDefine(e,r,n,t){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}regeneratorDefine=function(e,r,n,t){function o(r,n){regeneratorDefine(e,r,(function(e){return this._invoke(r,n,e)}))}r?i?i(e,r,{value:n,enumerable:!t,configurable:!t,writable:!t}):e[r]=n:(o("next",0),o("throw",1),o("return",2))},regeneratorDefine(e,r,n,t)}', {
        globals: ["Object"],
        locals: {
          regeneratorDefine: ["body.0.id", "body.0.body.body.2.expression.expressions.0.right.body.body.0.body.body.0.expression.callee", "body.0.body.body.2.expression.expressions.1.callee", "body.0.body.body.2.expression.expressions.0.left"]
        },
        exportBindingAssignments: ["body.0.body.body.2.expression.expressions.0"],
        exportName: "regeneratorDefine",
        dependencies: {},
        internal: true
      }),
      regeneratorKeys: helper("7.27.0", "function _regeneratorKeys(e){var n=Object(e),r=[];for(var t in n)r.unshift(t);return function e(){for(;r.length;)if((t=r.pop())in n)return e.value=t,e.done=!1,e;return e.done=!0,e}}", {
        globals: ["Object"],
        locals: {
          _regeneratorKeys: ["body.0.id"]
        },
        exportBindingAssignments: [],
        exportName: "_regeneratorKeys",
        dependencies: {},
        internal: false
      }),
      regeneratorValues: helper("7.18.0", 'function _regeneratorValues(e){if(null!=e){var t=e["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],r=0;if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}}}throw new TypeError(typeof e+" is not iterable")}', {
        globals: ["Symbol", "isNaN", "TypeError"],
        locals: {
          _regeneratorValues: ["body.0.id"]
        },
        exportBindingAssignments: [],
        exportName: "_regeneratorValues",
        dependencies: {},
        internal: false
      }),
      set: helper("7.0.0-beta.0", 'function set(e,r,t,o){return set="undefined"!=typeof Reflect&&Reflect.set?Reflect.set:function(e,r,t,o){var f,i=superPropBase(e,r);if(i){if((f=Object.getOwnPropertyDescriptor(i,r)).set)return f.set.call(o,t),!0;if(!f.writable)return!1}if(f=Object.getOwnPropertyDescriptor(o,r)){if(!f.writable)return!1;f.value=t,Object.defineProperty(o,r,f)}else defineProperty(o,r,t);return!0},set(e,r,t,o)}function _set(e,r,t,o,f){if(!set(e,r,t,o||e)&&f)throw new TypeError("failed to set property");return t}', {
        globals: ["Reflect", "Object", "TypeError"],
        locals: {
          set: ["body.0.id", "body.0.body.body.0.argument.expressions.1.callee", "body.1.body.body.0.test.left.argument.callee", "body.0.body.body.0.argument.expressions.0.left"],
          _set: ["body.1.id"]
        },
        exportBindingAssignments: [],
        exportName: "_set",
        dependencies: {
          superPropBase: ["body.0.body.body.0.argument.expressions.0.right.alternate.body.body.0.declarations.1.init.callee"],
          defineProperty: ["body.0.body.body.0.argument.expressions.0.right.alternate.body.body.2.alternate.expression.callee"]
        },
        internal: false
      }),
      setFunctionName: helper("7.23.6", 'function setFunctionName(e,t,n){"symbol"==typeof t&&(t=(t=t.description)?"["+t+"]":"");try{Object.defineProperty(e,"name",{configurable:!0,value:n?n+" "+t:t})}catch(e){}return e}', {
        globals: ["Object"],
        locals: {
          setFunctionName: ["body.0.id"]
        },
        exportBindingAssignments: [],
        exportName: "setFunctionName",
        dependencies: {},
        internal: false
      }),
      setPrototypeOf: helper("7.0.0-beta.0", "function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_setPrototypeOf(t,e)}", {
        globals: ["Object"],
        locals: {
          _setPrototypeOf: ["body.0.id", "body.0.body.body.0.argument.expressions.1.callee", "body.0.body.body.0.argument.expressions.0.left"]
        },
        exportBindingAssignments: ["body.0.body.body.0.argument.expressions.0"],
        exportName: "_setPrototypeOf",
        dependencies: {},
        internal: false
      }),
      skipFirstGeneratorNext: helper("7.0.0-beta.0", "function _skipFirstGeneratorNext(t){return function(){var r=t.apply(this,arguments);return r.next(),r}}", {
        globals: [],
        locals: {
          _skipFirstGeneratorNext: ["body.0.id"]
        },
        exportBindingAssignments: [],
        exportName: "_skipFirstGeneratorNext",
        dependencies: {},
        internal: false
      }),
      slicedToArray: helper("7.0.0-beta.0", "function _slicedToArray(r,e){return arrayWithHoles(r)||iterableToArrayLimit(r,e)||unsupportedIterableToArray(r,e)||nonIterableRest()}", {
        globals: [],
        locals: {
          _slicedToArray: ["body.0.id"]
        },
        exportBindingAssignments: [],
        exportName: "_slicedToArray",
        dependencies: {
          arrayWithHoles: ["body.0.body.body.0.argument.left.left.left.callee"],
          iterableToArrayLimit: ["body.0.body.body.0.argument.left.left.right.callee"],
          unsupportedIterableToArray: ["body.0.body.body.0.argument.left.right.callee"],
          nonIterableRest: ["body.0.body.body.0.argument.right.callee"]
        },
        internal: false
      }),
      superPropBase: helper("7.0.0-beta.0", "function _superPropBase(t,o){for(;!{}.hasOwnProperty.call(t,o)&&null!==(t=getPrototypeOf(t)););return t}", {
        globals: [],
        locals: {
          _superPropBase: ["body.0.id"]
        },
        exportBindingAssignments: [],
        exportName: "_superPropBase",
        dependencies: {
          getPrototypeOf: ["body.0.body.body.0.test.right.right.right.callee"]
        },
        internal: false
      }),
      superPropGet: helper("7.25.0", 'function _superPropGet(t,o,e,r){var p=get(getPrototypeOf(1&r?t.prototype:t),o,e);return 2&r&&"function"==typeof p?function(t){return p.apply(e,t)}:p}', {
        globals: [],
        locals: {
          _superPropGet: ["body.0.id"]
        },
        exportBindingAssignments: [],
        exportName: "_superPropGet",
        dependencies: {
          get: ["body.0.body.body.0.declarations.0.init.callee"],
          getPrototypeOf: ["body.0.body.body.0.declarations.0.init.arguments.0.callee"]
        },
        internal: false
      }),
      superPropSet: helper("7.25.0", "function _superPropSet(t,e,o,r,p,f){return set(getPrototypeOf(f?t.prototype:t),e,o,r,p)}", {
        globals: [],
        locals: {
          _superPropSet: ["body.0.id"]
        },
        exportBindingAssignments: [],
        exportName: "_superPropSet",
        dependencies: {
          set: ["body.0.body.body.0.argument.callee"],
          getPrototypeOf: ["body.0.body.body.0.argument.arguments.0.callee"]
        },
        internal: false
      }),
      taggedTemplateLiteral: helper("7.0.0-beta.0", "function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}", {
        globals: ["Object"],
        locals: {
          _taggedTemplateLiteral: ["body.0.id"]
        },
        exportBindingAssignments: [],
        exportName: "_taggedTemplateLiteral",
        dependencies: {},
        internal: false
      }),
      taggedTemplateLiteralLoose: helper("7.0.0-beta.0", "function _taggedTemplateLiteralLoose(e,t){return t||(t=e.slice(0)),e.raw=t,e}", {
        globals: [],
        locals: {
          _taggedTemplateLiteralLoose: ["body.0.id"]
        },
        exportBindingAssignments: [],
        exportName: "_taggedTemplateLiteralLoose",
        dependencies: {},
        internal: false
      }),
      tdz: helper("7.5.5", 'function _tdzError(e){throw new ReferenceError(e+" is not defined - temporal dead zone")}', {
        globals: ["ReferenceError"],
        locals: {
          _tdzError: ["body.0.id"]
        },
        exportBindingAssignments: [],
        exportName: "_tdzError",
        dependencies: {},
        internal: false
      }),
      temporalRef: helper("7.0.0-beta.0", "function _temporalRef(r,e){return r===undef?err(e):r}", {
        globals: [],
        locals: {
          _temporalRef: ["body.0.id"]
        },
        exportBindingAssignments: [],
        exportName: "_temporalRef",
        dependencies: {
          temporalUndefined: ["body.0.body.body.0.argument.test.right"],
          tdz: ["body.0.body.body.0.argument.consequent.callee"]
        },
        internal: false
      }),
      temporalUndefined: helper("7.0.0-beta.0", "function _temporalUndefined(){}", {
        globals: [],
        locals: {
          _temporalUndefined: ["body.0.id"]
        },
        exportBindingAssignments: [],
        exportName: "_temporalUndefined",
        dependencies: {},
        internal: false
      }),
      toArray: helper("7.0.0-beta.0", "function _toArray(r){return arrayWithHoles(r)||iterableToArray(r)||unsupportedIterableToArray(r)||nonIterableRest()}", {
        globals: [],
        locals: {
          _toArray: ["body.0.id"]
        },
        exportBindingAssignments: [],
        exportName: "_toArray",
        dependencies: {
          arrayWithHoles: ["body.0.body.body.0.argument.left.left.left.callee"],
          iterableToArray: ["body.0.body.body.0.argument.left.left.right.callee"],
          unsupportedIterableToArray: ["body.0.body.body.0.argument.left.right.callee"],
          nonIterableRest: ["body.0.body.body.0.argument.right.callee"]
        },
        internal: false
      }),
      toConsumableArray: helper("7.0.0-beta.0", "function _toConsumableArray(r){return arrayWithoutHoles(r)||iterableToArray(r)||unsupportedIterableToArray(r)||nonIterableSpread()}", {
        globals: [],
        locals: {
          _toConsumableArray: ["body.0.id"]
        },
        exportBindingAssignments: [],
        exportName: "_toConsumableArray",
        dependencies: {
          arrayWithoutHoles: ["body.0.body.body.0.argument.left.left.left.callee"],
          iterableToArray: ["body.0.body.body.0.argument.left.left.right.callee"],
          unsupportedIterableToArray: ["body.0.body.body.0.argument.left.right.callee"],
          nonIterableSpread: ["body.0.body.body.0.argument.right.callee"]
        },
        internal: false
      }),
      toPrimitive: helper("7.1.5", 'function toPrimitive(t,r){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}', {
        globals: ["Symbol", "TypeError", "String", "Number"],
        locals: {
          toPrimitive: ["body.0.id"]
        },
        exportBindingAssignments: [],
        exportName: "toPrimitive",
        dependencies: {},
        internal: false
      }),
      toPropertyKey: helper("7.1.5", 'function toPropertyKey(t){var i=toPrimitive(t,"string");return"symbol"==typeof i?i:i+""}', {
        globals: [],
        locals: {
          toPropertyKey: ["body.0.id"]
        },
        exportBindingAssignments: [],
        exportName: "toPropertyKey",
        dependencies: {
          toPrimitive: ["body.0.body.body.0.declarations.0.init.callee"]
        },
        internal: false
      }),
      toSetter: helper("7.24.0", 'function _toSetter(t,e,n){e||(e=[]);var r=e.length++;return Object.defineProperty({},"_",{set:function(o){e[r]=o,t.apply(n,e)}})}', {
        globals: ["Object"],
        locals: {
          _toSetter: ["body.0.id"]
        },
        exportBindingAssignments: [],
        exportName: "_toSetter",
        dependencies: {},
        internal: false
      }),
      tsRewriteRelativeImportExtensions: helper("7.27.0", 'function tsRewriteRelativeImportExtensions(t,e){return"string"==typeof t&&/^\\.\\.?\\//.test(t)?t.replace(/\\.(tsx)$|((?:\\.d)?)((?:\\.[^./]+)?)\\.([cm]?)ts$/i,(function(t,s,r,n,o){return s?e?".jsx":".js":!r||n&&o?r+n+"."+o.toLowerCase()+"js":t})):t}', {
        globals: [],
        locals: {
          tsRewriteRelativeImportExtensions: ["body.0.id"]
        },
        exportBindingAssignments: [],
        exportName: "tsRewriteRelativeImportExtensions",
        dependencies: {},
        internal: false
      }),
      typeof: helper("7.0.0-beta.0", 'function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}', {
        globals: ["Symbol"],
        locals: {
          _typeof: ["body.0.id", "body.0.body.body.0.argument.expressions.1.callee", "body.0.body.body.0.argument.expressions.0.left"]
        },
        exportBindingAssignments: ["body.0.body.body.0.argument.expressions.0"],
        exportName: "_typeof",
        dependencies: {},
        internal: false
      }),
      unsupportedIterableToArray: helper("7.9.0", 'function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?arrayLikeToArray(r,a):void 0}}', {
        globals: ["Array"],
        locals: {
          _unsupportedIterableToArray: ["body.0.id"]
        },
        exportBindingAssignments: [],
        exportName: "_unsupportedIterableToArray",
        dependencies: {
          arrayLikeToArray: ["body.0.body.body.0.consequent.body.0.consequent.argument.callee", "body.0.body.body.0.consequent.body.2.argument.expressions.1.alternate.consequent.callee"]
        },
        internal: false
      }),
      usingCtx: helper("7.23.9", 'function _usingCtx(){var r="function"==typeof SuppressedError?SuppressedError:function(r,e){var n=Error();return n.name="SuppressedError",n.error=r,n.suppressed=e,n},e={},n=[];function using(r,e){if(null!=e){if(Object(e)!==e)throw new TypeError("using declarations can only be used with objects, functions, null, or undefined.");if(r)var o=e[Symbol.asyncDispose||Symbol.for("Symbol.asyncDispose")];if(void 0===o&&(o=e[Symbol.dispose||Symbol.for("Symbol.dispose")],r))var t=o;if("function"!=typeof o)throw new TypeError("Object is not disposable.");t&&(o=function(){try{t.call(e)}catch(r){return Promise.reject(r)}}),n.push({v:e,d:o,a:r})}else r&&n.push({d:e,a:r});return e}return{e:e,u:using.bind(null,!1),a:using.bind(null,!0),d:function(){var o,t=this.e,s=0;function next(){for(;o=n.pop();)try{if(!o.a&&1===s)return s=0,n.push(o),Promise.resolve().then(next);if(o.d){var r=o.d.call(o.v);if(o.a)return s|=2,Promise.resolve(r).then(next,err)}else s|=1}catch(r){return err(r)}if(1===s)return t!==e?Promise.reject(t):Promise.resolve();if(t!==e)throw t}function err(n){return t=t!==e?new r(n,t):n,next()}return next()}}}', {
        globals: ["SuppressedError", "Error", "Object", "TypeError", "Symbol", "Promise"],
        locals: {
          _usingCtx: ["body.0.id"]
        },
        exportBindingAssignments: [],
        exportName: "_usingCtx",
        dependencies: {},
        internal: false
      }),
      wrapAsyncGenerator: helper("7.0.0-beta.0", 'function _wrapAsyncGenerator(e){return function(){return new AsyncGenerator(e.apply(this,arguments))}}function AsyncGenerator(e){var r,t;function resume(r,t){try{var n=e[r](t),o=n.value,u=o instanceof OverloadYield;Promise.resolve(u?o.v:o).then((function(t){if(u){var i="return"===r?"return":"next";if(!o.k||t.done)return resume(i,t);t=e[i](t).value}settle(n.done?"return":"normal",t)}),(function(e){resume("throw",e)}))}catch(e){settle("throw",e)}}function settle(e,n){switch(e){case"return":r.resolve({value:n,done:!0});break;case"throw":r.reject(n);break;default:r.resolve({value:n,done:!1})}(r=r.next)?resume(r.key,r.arg):t=null}this._invoke=function(e,n){return new Promise((function(o,u){var i={key:e,arg:n,resolve:o,reject:u,next:null};t?t=t.next=i:(r=t=i,resume(e,n))}))},"function"!=typeof e.return&&(this.return=void 0)}AsyncGenerator.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},AsyncGenerator.prototype.next=function(e){return this._invoke("next",e)},AsyncGenerator.prototype.throw=function(e){return this._invoke("throw",e)},AsyncGenerator.prototype.return=function(e){return this._invoke("return",e)};', {
        globals: ["Promise", "Symbol"],
        locals: {
          _wrapAsyncGenerator: ["body.0.id"],
          AsyncGenerator: ["body.1.id", "body.0.body.body.0.argument.body.body.0.argument.callee", "body.2.expression.expressions.0.left.object.object", "body.2.expression.expressions.1.left.object.object", "body.2.expression.expressions.2.left.object.object", "body.2.expression.expressions.3.left.object.object"]
        },
        exportBindingAssignments: [],
        exportName: "_wrapAsyncGenerator",
        dependencies: {
          OverloadYield: ["body.1.body.body.1.body.body.0.block.body.0.declarations.2.init.right"]
        },
        internal: false
      }),
      wrapNativeSuper: helper("7.0.0-beta.0", 'function _wrapNativeSuper(t){var r="function"==typeof Map?new Map:void 0;return _wrapNativeSuper=function(t){if(null===t||!isNativeFunction(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==r){if(r.has(t))return r.get(t);r.set(t,Wrapper)}function Wrapper(){return construct(t,arguments,getPrototypeOf(this).constructor)}return Wrapper.prototype=Object.create(t.prototype,{constructor:{value:Wrapper,enumerable:!1,writable:!0,configurable:!0}}),setPrototypeOf(Wrapper,t)},_wrapNativeSuper(t)}', {
        globals: ["Map", "TypeError", "Object"],
        locals: {
          _wrapNativeSuper: ["body.0.id", "body.0.body.body.1.argument.expressions.1.callee", "body.0.body.body.1.argument.expressions.0.left"]
        },
        exportBindingAssignments: ["body.0.body.body.1.argument.expressions.0"],
        exportName: "_wrapNativeSuper",
        dependencies: {
          getPrototypeOf: ["body.0.body.body.1.argument.expressions.0.right.body.body.3.body.body.0.argument.arguments.2.object.callee"],
          setPrototypeOf: ["body.0.body.body.1.argument.expressions.0.right.body.body.4.argument.expressions.1.callee"],
          isNativeFunction: ["body.0.body.body.1.argument.expressions.0.right.body.body.0.test.right.argument.callee"],
          construct: ["body.0.body.body.1.argument.expressions.0.right.body.body.3.body.body.0.argument.callee"]
        },
        internal: false
      }),
      wrapRegExp: helper("7.19.0", 'function _wrapRegExp(){_wrapRegExp=function(e,r){return new BabelRegExp(e,void 0,r)};var e=RegExp.prototype,r=new WeakMap;function BabelRegExp(e,t,p){var o=RegExp(e,t);return r.set(o,p||r.get(e)),setPrototypeOf(o,BabelRegExp.prototype)}function buildGroups(e,t){var p=r.get(t);return Object.keys(p).reduce((function(r,t){var o=p[t];if("number"==typeof o)r[t]=e[o];else{for(var i=0;void 0===e[o[i]]&&i+1<o.length;)i++;r[t]=e[o[i]]}return r}),Object.create(null))}return inherits(BabelRegExp,RegExp),BabelRegExp.prototype.exec=function(r){var t=e.exec.call(this,r);if(t){t.groups=buildGroups(t,this);var p=t.indices;p&&(p.groups=buildGroups(p,this))}return t},BabelRegExp.prototype[Symbol.replace]=function(t,p){if("string"==typeof p){var o=r.get(this);return e[Symbol.replace].call(this,t,p.replace(/\\$<([^>]+)(>|$)/g,(function(e,r,t){if(""===t)return e;var p=o[r];return Array.isArray(p)?"$"+p.join("$"):"number"==typeof p?"$"+p:""})))}if("function"==typeof p){var i=this;return e[Symbol.replace].call(this,t,(function(){var e=arguments;return"object"!=typeof e[e.length-1]&&(e=[].slice.call(e)).push(buildGroups(e,i)),p.apply(this,e)}))}return e[Symbol.replace].call(this,t,p)},_wrapRegExp.apply(this,arguments)}', {
        globals: ["RegExp", "WeakMap", "Object", "Symbol", "Array"],
        locals: {
          _wrapRegExp: ["body.0.id", "body.0.body.body.4.argument.expressions.3.callee.object", "body.0.body.body.0.expression.left"]
        },
        exportBindingAssignments: ["body.0.body.body.0.expression"],
        exportName: "_wrapRegExp",
        dependencies: {
          setPrototypeOf: ["body.0.body.body.2.body.body.1.argument.expressions.1.callee"],
          inherits: ["body.0.body.body.4.argument.expressions.0.callee"]
        },
        internal: false
      }),
      writeOnlyError: helper("7.12.13", `function _writeOnlyError(r){throw new TypeError('"'+r+'" is write-only')}`, {
        globals: ["TypeError"],
        locals: {
          _writeOnlyError: ["body.0.id"]
        },
        exportBindingAssignments: [],
        exportName: "_writeOnlyError",
        dependencies: {},
        internal: false
      })
    };
    {
      Object.assign(helpers, {
        AwaitValue: helper("7.0.0-beta.0", "function _AwaitValue(t){this.wrapped=t}", {
          globals: [],
          locals: {
            _AwaitValue: ["body.0.id"]
          },
          exportBindingAssignments: [],
          exportName: "_AwaitValue",
          dependencies: {},
          internal: false
        }),
        applyDecs: helper("7.17.8", 'function old_createMetadataMethodsForProperty(e,t,a,r){return{getMetadata:function(o){old_assertNotFinished(r,"getMetadata"),old_assertMetadataKey(o);var i=e[o];if(void 0!==i)if(1===t){var n=i.public;if(void 0!==n)return n[a]}else if(2===t){var l=i.private;if(void 0!==l)return l.get(a)}else if(Object.hasOwnProperty.call(i,"constructor"))return i.constructor},setMetadata:function(o,i){old_assertNotFinished(r,"setMetadata"),old_assertMetadataKey(o);var n=e[o];if(void 0===n&&(n=e[o]={}),1===t){var l=n.public;void 0===l&&(l=n.public={}),l[a]=i}else if(2===t){var s=n.priv;void 0===s&&(s=n.private=new Map),s.set(a,i)}else n.constructor=i}}}function old_convertMetadataMapToFinal(e,t){var a=e[Symbol.metadata||Symbol.for("Symbol.metadata")],r=Object.getOwnPropertySymbols(t);if(0!==r.length){for(var o=0;o<r.length;o++){var i=r[o],n=t[i],l=a?a[i]:null,s=n.public,c=l?l.public:null;s&&c&&Object.setPrototypeOf(s,c);var d=n.private;if(d){var u=Array.from(d.values()),f=l?l.private:null;f&&(u=u.concat(f)),n.private=u}l&&Object.setPrototypeOf(n,l)}a&&Object.setPrototypeOf(t,a),e[Symbol.metadata||Symbol.for("Symbol.metadata")]=t}}function old_createAddInitializerMethod(e,t){return function(a){old_assertNotFinished(t,"addInitializer"),old_assertCallable(a,"An initializer"),e.push(a)}}function old_memberDec(e,t,a,r,o,i,n,l,s){var c;switch(i){case 1:c="accessor";break;case 2:c="method";break;case 3:c="getter";break;case 4:c="setter";break;default:c="field"}var d,u,f={kind:c,name:l?"#"+t:toPropertyKey(t),isStatic:n,isPrivate:l},p={v:!1};if(0!==i&&(f.addInitializer=old_createAddInitializerMethod(o,p)),l){d=2,u=Symbol(t);var v={};0===i?(v.get=a.get,v.set=a.set):2===i?v.get=function(){return a.value}:(1!==i&&3!==i||(v.get=function(){return a.get.call(this)}),1!==i&&4!==i||(v.set=function(e){a.set.call(this,e)})),f.access=v}else d=1,u=t;try{return e(s,Object.assign(f,old_createMetadataMethodsForProperty(r,d,u,p)))}finally{p.v=!0}}function old_assertNotFinished(e,t){if(e.v)throw Error("attempted to call "+t+" after decoration was finished")}function old_assertMetadataKey(e){if("symbol"!=typeof e)throw new TypeError("Metadata keys must be symbols, received: "+e)}function old_assertCallable(e,t){if("function"!=typeof e)throw new TypeError(t+" must be a function")}function old_assertValidReturnValue(e,t){var a=typeof t;if(1===e){if("object"!==a||null===t)throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");void 0!==t.get&&old_assertCallable(t.get,"accessor.get"),void 0!==t.set&&old_assertCallable(t.set,"accessor.set"),void 0!==t.init&&old_assertCallable(t.init,"accessor.init"),void 0!==t.initializer&&old_assertCallable(t.initializer,"accessor.initializer")}else if("function"!==a)throw new TypeError((0===e?"field":10===e?"class":"method")+" decorators must return a function or void 0")}function old_getInit(e){var t;return null==(t=e.init)&&(t=e.initializer)&&void 0!==console&&console.warn(".initializer has been renamed to .init as of March 2022"),t}function old_applyMemberDec(e,t,a,r,o,i,n,l,s){var c,d,u,f,p,v,y,h=a[0];if(n?(0===o||1===o?(c={get:a[3],set:a[4]},u="get"):3===o?(c={get:a[3]},u="get"):4===o?(c={set:a[3]},u="set"):c={value:a[3]},0!==o&&(1===o&&setFunctionName(a[4],"#"+r,"set"),setFunctionName(a[3],"#"+r,u))):0!==o&&(c=Object.getOwnPropertyDescriptor(t,r)),1===o?f={get:c.get,set:c.set}:2===o?f=c.value:3===o?f=c.get:4===o&&(f=c.set),"function"==typeof h)void 0!==(p=old_memberDec(h,r,c,l,s,o,i,n,f))&&(old_assertValidReturnValue(o,p),0===o?d=p:1===o?(d=old_getInit(p),v=p.get||f.get,y=p.set||f.set,f={get:v,set:y}):f=p);else for(var m=h.length-1;m>=0;m--){var b;void 0!==(p=old_memberDec(h[m],r,c,l,s,o,i,n,f))&&(old_assertValidReturnValue(o,p),0===o?b=p:1===o?(b=old_getInit(p),v=p.get||f.get,y=p.set||f.set,f={get:v,set:y}):f=p,void 0!==b&&(void 0===d?d=b:"function"==typeof d?d=[d,b]:d.push(b)))}if(0===o||1===o){if(void 0===d)d=function(e,t){return t};else if("function"!=typeof d){var g=d;d=function(e,t){for(var a=t,r=0;r<g.length;r++)a=g[r].call(e,a);return a}}else{var _=d;d=function(e,t){return _.call(e,t)}}e.push(d)}0!==o&&(1===o?(c.get=f.get,c.set=f.set):2===o?c.value=f:3===o?c.get=f:4===o&&(c.set=f),n?1===o?(e.push((function(e,t){return f.get.call(e,t)})),e.push((function(e,t){return f.set.call(e,t)}))):2===o?e.push(f):e.push((function(e,t){return f.call(e,t)})):Object.defineProperty(t,r,c))}function old_applyMemberDecs(e,t,a,r,o){for(var i,n,l=new Map,s=new Map,c=0;c<o.length;c++){var d=o[c];if(Array.isArray(d)){var u,f,p,v=d[1],y=d[2],h=d.length>3,m=v>=5;if(m?(u=t,f=r,0!=(v-=5)&&(p=n=n||[])):(u=t.prototype,f=a,0!==v&&(p=i=i||[])),0!==v&&!h){var b=m?s:l,g=b.get(y)||0;if(!0===g||3===g&&4!==v||4===g&&3!==v)throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: "+y);!g&&v>2?b.set(y,v):b.set(y,!0)}old_applyMemberDec(e,u,d,y,v,m,h,f,p)}}old_pushInitializers(e,i),old_pushInitializers(e,n)}function old_pushInitializers(e,t){t&&e.push((function(e){for(var a=0;a<t.length;a++)t[a].call(e);return e}))}function old_applyClassDecs(e,t,a,r){if(r.length>0){for(var o=[],i=t,n=t.name,l=r.length-1;l>=0;l--){var s={v:!1};try{var c=Object.assign({kind:"class",name:n,addInitializer:old_createAddInitializerMethod(o,s)},old_createMetadataMethodsForProperty(a,0,n,s)),d=r[l](i,c)}finally{s.v=!0}void 0!==d&&(old_assertValidReturnValue(10,d),i=d)}e.push(i,(function(){for(var e=0;e<o.length;e++)o[e].call(i)}))}}function applyDecs(e,t,a){var r=[],o={},i={};return old_applyMemberDecs(r,e,i,o,t),old_convertMetadataMapToFinal(e.prototype,i),old_applyClassDecs(r,e,o,a),old_convertMetadataMapToFinal(e,o),r}', {
          globals: ["Object", "Map", "Symbol", "Array", "Error", "TypeError", "console"],
          locals: {
            old_createMetadataMethodsForProperty: ["body.0.id", "body.3.body.body.4.block.body.0.argument.arguments.1.arguments.1.callee", "body.12.body.body.0.consequent.body.0.body.body.1.block.body.0.declarations.0.init.arguments.1.callee"],
            old_convertMetadataMapToFinal: ["body.1.id", "body.13.body.body.1.argument.expressions.1.callee", "body.13.body.body.1.argument.expressions.3.callee"],
            old_createAddInitializerMethod: ["body.2.id", "body.3.body.body.3.test.expressions.0.right.right.callee", "body.12.body.body.0.consequent.body.0.body.body.1.block.body.0.declarations.0.init.arguments.0.properties.2.value.callee"],
            old_memberDec: ["body.3.id", "body.9.body.body.1.consequent.expression.left.right.right.callee", "body.9.body.body.1.alternate.body.body.1.expression.left.right.right.callee"],
            old_assertNotFinished: ["body.4.id", "body.0.body.body.0.argument.properties.0.value.body.body.0.expression.expressions.0.callee", "body.0.body.body.0.argument.properties.1.value.body.body.0.expression.expressions.0.callee", "body.2.body.body.0.argument.body.body.0.expression.expressions.0.callee"],
            old_assertMetadataKey: ["body.5.id", "body.0.body.body.0.argument.properties.0.value.body.body.0.expression.expressions.1.callee", "body.0.body.body.0.argument.properties.1.value.body.body.0.expression.expressions.1.callee"],
            old_assertCallable: ["body.6.id", "body.2.body.body.0.argument.body.body.0.expression.expressions.1.callee", "body.7.body.body.1.consequent.body.1.expression.expressions.0.right.callee", "body.7.body.body.1.consequent.body.1.expression.expressions.1.right.callee", "body.7.body.body.1.consequent.body.1.expression.expressions.2.right.callee", "body.7.body.body.1.consequent.body.1.expression.expressions.3.right.callee"],
            old_assertValidReturnValue: ["body.7.id", "body.9.body.body.1.consequent.expression.right.expressions.0.callee", "body.9.body.body.1.alternate.body.body.1.expression.right.expressions.0.callee", "body.12.body.body.0.consequent.body.0.body.body.2.expression.right.expressions.0.callee"],
            old_getInit: ["body.8.id", "body.9.body.body.1.consequent.expression.right.expressions.1.alternate.consequent.expressions.0.right.callee", "body.9.body.body.1.alternate.body.body.1.expression.right.expressions.1.alternate.consequent.expressions.0.right.callee"],
            old_applyMemberDec: ["body.9.id", "body.10.body.body.0.body.body.1.consequent.body.2.expression.callee"],
            old_applyMemberDecs: ["body.10.id", "body.13.body.body.1.argument.expressions.0.callee"],
            old_pushInitializers: ["body.11.id", "body.10.body.body.1.expression.expressions.0.callee", "body.10.body.body.1.expression.expressions.1.callee"],
            old_applyClassDecs: ["body.12.id", "body.13.body.body.1.argument.expressions.2.callee"],
            applyDecs: ["body.13.id"]
          },
          exportBindingAssignments: [],
          exportName: "applyDecs",
          dependencies: {
            setFunctionName: ["body.9.body.body.1.test.expressions.0.consequent.expressions.1.right.expressions.0.right.callee", "body.9.body.body.1.test.expressions.0.consequent.expressions.1.right.expressions.1.callee"],
            toPropertyKey: ["body.3.body.body.2.declarations.2.init.properties.1.value.alternate.callee"]
          },
          internal: false
        }),
        applyDecs2203: helper("7.19.0", 'function applyDecs2203Factory(){function createAddInitializerMethod(e,t){return function(r){!function(e,t){if(e.v)throw Error("attempted to call addInitializer after decoration was finished")}(t),assertCallable(r,"An initializer"),e.push(r)}}function memberDec(e,t,r,a,n,i,s,o){var c;switch(n){case 1:c="accessor";break;case 2:c="method";break;case 3:c="getter";break;case 4:c="setter";break;default:c="field"}var l,u,f={kind:c,name:s?"#"+t:t,static:i,private:s},p={v:!1};0!==n&&(f.addInitializer=createAddInitializerMethod(a,p)),0===n?s?(l=r.get,u=r.set):(l=function(){return this[t]},u=function(e){this[t]=e}):2===n?l=function(){return r.value}:(1!==n&&3!==n||(l=function(){return r.get.call(this)}),1!==n&&4!==n||(u=function(e){r.set.call(this,e)})),f.access=l&&u?{get:l,set:u}:l?{get:l}:{set:u};try{return e(o,f)}finally{p.v=!0}}function assertCallable(e,t){if("function"!=typeof e)throw new TypeError(t+" must be a function")}function assertValidReturnValue(e,t){var r=typeof t;if(1===e){if("object"!==r||null===t)throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");void 0!==t.get&&assertCallable(t.get,"accessor.get"),void 0!==t.set&&assertCallable(t.set,"accessor.set"),void 0!==t.init&&assertCallable(t.init,"accessor.init")}else if("function"!==r)throw new TypeError((0===e?"field":10===e?"class":"method")+" decorators must return a function or void 0")}function applyMemberDec(e,t,r,a,n,i,s,o){var c,l,u,f,p,d,h=r[0];if(s?c=0===n||1===n?{get:r[3],set:r[4]}:3===n?{get:r[3]}:4===n?{set:r[3]}:{value:r[3]}:0!==n&&(c=Object.getOwnPropertyDescriptor(t,a)),1===n?u={get:c.get,set:c.set}:2===n?u=c.value:3===n?u=c.get:4===n&&(u=c.set),"function"==typeof h)void 0!==(f=memberDec(h,a,c,o,n,i,s,u))&&(assertValidReturnValue(n,f),0===n?l=f:1===n?(l=f.init,p=f.get||u.get,d=f.set||u.set,u={get:p,set:d}):u=f);else for(var v=h.length-1;v>=0;v--){var g;void 0!==(f=memberDec(h[v],a,c,o,n,i,s,u))&&(assertValidReturnValue(n,f),0===n?g=f:1===n?(g=f.init,p=f.get||u.get,d=f.set||u.set,u={get:p,set:d}):u=f,void 0!==g&&(void 0===l?l=g:"function"==typeof l?l=[l,g]:l.push(g)))}if(0===n||1===n){if(void 0===l)l=function(e,t){return t};else if("function"!=typeof l){var y=l;l=function(e,t){for(var r=t,a=0;a<y.length;a++)r=y[a].call(e,r);return r}}else{var m=l;l=function(e,t){return m.call(e,t)}}e.push(l)}0!==n&&(1===n?(c.get=u.get,c.set=u.set):2===n?c.value=u:3===n?c.get=u:4===n&&(c.set=u),s?1===n?(e.push((function(e,t){return u.get.call(e,t)})),e.push((function(e,t){return u.set.call(e,t)}))):2===n?e.push(u):e.push((function(e,t){return u.call(e,t)})):Object.defineProperty(t,a,c))}function pushInitializers(e,t){t&&e.push((function(e){for(var r=0;r<t.length;r++)t[r].call(e);return e}))}return function(e,t,r){var a=[];return function(e,t,r){for(var a,n,i=new Map,s=new Map,o=0;o<r.length;o++){var c=r[o];if(Array.isArray(c)){var l,u,f=c[1],p=c[2],d=c.length>3,h=f>=5;if(h?(l=t,0!=(f-=5)&&(u=n=n||[])):(l=t.prototype,0!==f&&(u=a=a||[])),0!==f&&!d){var v=h?s:i,g=v.get(p)||0;if(!0===g||3===g&&4!==f||4===g&&3!==f)throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: "+p);!g&&f>2?v.set(p,f):v.set(p,!0)}applyMemberDec(e,l,c,p,f,h,d,u)}}pushInitializers(e,a),pushInitializers(e,n)}(a,e,t),function(e,t,r){if(r.length>0){for(var a=[],n=t,i=t.name,s=r.length-1;s>=0;s--){var o={v:!1};try{var c=r[s](n,{kind:"class",name:i,addInitializer:createAddInitializerMethod(a,o)})}finally{o.v=!0}void 0!==c&&(assertValidReturnValue(10,c),n=c)}e.push(n,(function(){for(var e=0;e<a.length;e++)a[e].call(n)}))}}(a,e,r),a}}var applyDecs2203Impl;function applyDecs2203(e,t,r){return(applyDecs2203Impl=applyDecs2203Impl||applyDecs2203Factory())(e,t,r)}', {
          globals: ["Error", "TypeError", "Object", "Map", "Array"],
          locals: {
            applyDecs2203Factory: ["body.0.id", "body.2.body.body.0.argument.callee.right.right.callee"],
            applyDecs2203Impl: ["body.1.declarations.0.id", "body.2.body.body.0.argument.callee.right.left", "body.2.body.body.0.argument.callee.left"],
            applyDecs2203: ["body.2.id"]
          },
          exportBindingAssignments: [],
          exportName: "applyDecs2203",
          dependencies: {},
          internal: false
        }),
        applyDecs2203R: helper("7.20.0", 'function applyDecs2203RFactory(){function createAddInitializerMethod(e,t){return function(r){!function(e,t){if(e.v)throw Error("attempted to call addInitializer after decoration was finished")}(t),assertCallable(r,"An initializer"),e.push(r)}}function memberDec(e,t,r,n,a,i,o,s){var c;switch(a){case 1:c="accessor";break;case 2:c="method";break;case 3:c="getter";break;case 4:c="setter";break;default:c="field"}var l,u,f={kind:c,name:o?"#"+t:toPropertyKey(t),static:i,private:o},p={v:!1};0!==a&&(f.addInitializer=createAddInitializerMethod(n,p)),0===a?o?(l=r.get,u=r.set):(l=function(){return this[t]},u=function(e){this[t]=e}):2===a?l=function(){return r.value}:(1!==a&&3!==a||(l=function(){return r.get.call(this)}),1!==a&&4!==a||(u=function(e){r.set.call(this,e)})),f.access=l&&u?{get:l,set:u}:l?{get:l}:{set:u};try{return e(s,f)}finally{p.v=!0}}function assertCallable(e,t){if("function"!=typeof e)throw new TypeError(t+" must be a function")}function assertValidReturnValue(e,t){var r=typeof t;if(1===e){if("object"!==r||null===t)throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");void 0!==t.get&&assertCallable(t.get,"accessor.get"),void 0!==t.set&&assertCallable(t.set,"accessor.set"),void 0!==t.init&&assertCallable(t.init,"accessor.init")}else if("function"!==r)throw new TypeError((0===e?"field":10===e?"class":"method")+" decorators must return a function or void 0")}function applyMemberDec(e,t,r,n,a,i,o,s){var c,l,u,f,p,d,h,v=r[0];if(o?(0===a||1===a?(c={get:r[3],set:r[4]},u="get"):3===a?(c={get:r[3]},u="get"):4===a?(c={set:r[3]},u="set"):c={value:r[3]},0!==a&&(1===a&&setFunctionName(r[4],"#"+n,"set"),setFunctionName(r[3],"#"+n,u))):0!==a&&(c=Object.getOwnPropertyDescriptor(t,n)),1===a?f={get:c.get,set:c.set}:2===a?f=c.value:3===a?f=c.get:4===a&&(f=c.set),"function"==typeof v)void 0!==(p=memberDec(v,n,c,s,a,i,o,f))&&(assertValidReturnValue(a,p),0===a?l=p:1===a?(l=p.init,d=p.get||f.get,h=p.set||f.set,f={get:d,set:h}):f=p);else for(var g=v.length-1;g>=0;g--){var y;void 0!==(p=memberDec(v[g],n,c,s,a,i,o,f))&&(assertValidReturnValue(a,p),0===a?y=p:1===a?(y=p.init,d=p.get||f.get,h=p.set||f.set,f={get:d,set:h}):f=p,void 0!==y&&(void 0===l?l=y:"function"==typeof l?l=[l,y]:l.push(y)))}if(0===a||1===a){if(void 0===l)l=function(e,t){return t};else if("function"!=typeof l){var m=l;l=function(e,t){for(var r=t,n=0;n<m.length;n++)r=m[n].call(e,r);return r}}else{var b=l;l=function(e,t){return b.call(e,t)}}e.push(l)}0!==a&&(1===a?(c.get=f.get,c.set=f.set):2===a?c.value=f:3===a?c.get=f:4===a&&(c.set=f),o?1===a?(e.push((function(e,t){return f.get.call(e,t)})),e.push((function(e,t){return f.set.call(e,t)}))):2===a?e.push(f):e.push((function(e,t){return f.call(e,t)})):Object.defineProperty(t,n,c))}function applyMemberDecs(e,t){for(var r,n,a=[],i=new Map,o=new Map,s=0;s<t.length;s++){var c=t[s];if(Array.isArray(c)){var l,u,f=c[1],p=c[2],d=c.length>3,h=f>=5;if(h?(l=e,0!=(f-=5)&&(u=n=n||[])):(l=e.prototype,0!==f&&(u=r=r||[])),0!==f&&!d){var v=h?o:i,g=v.get(p)||0;if(!0===g||3===g&&4!==f||4===g&&3!==f)throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: "+p);!g&&f>2?v.set(p,f):v.set(p,!0)}applyMemberDec(a,l,c,p,f,h,d,u)}}return pushInitializers(a,r),pushInitializers(a,n),a}function pushInitializers(e,t){t&&e.push((function(e){for(var r=0;r<t.length;r++)t[r].call(e);return e}))}return function(e,t,r){return{e:applyMemberDecs(e,t),get c(){return function(e,t){if(t.length>0){for(var r=[],n=e,a=e.name,i=t.length-1;i>=0;i--){var o={v:!1};try{var s=t[i](n,{kind:"class",name:a,addInitializer:createAddInitializerMethod(r,o)})}finally{o.v=!0}void 0!==s&&(assertValidReturnValue(10,s),n=s)}return[n,function(){for(var e=0;e<r.length;e++)r[e].call(n)}]}}(e,r)}}}}function applyDecs2203R(e,t,r){return(applyDecs2203R=applyDecs2203RFactory())(e,t,r)}', {
          globals: ["Error", "TypeError", "Object", "Map", "Array"],
          locals: {
            applyDecs2203RFactory: ["body.0.id", "body.1.body.body.0.argument.callee.right.callee"],
            applyDecs2203R: ["body.1.id", "body.1.body.body.0.argument.callee.left"]
          },
          exportBindingAssignments: ["body.1.body.body.0.argument.callee"],
          exportName: "applyDecs2203R",
          dependencies: {
            setFunctionName: ["body.0.body.body.4.body.body.1.test.expressions.0.consequent.expressions.1.right.expressions.0.right.callee", "body.0.body.body.4.body.body.1.test.expressions.0.consequent.expressions.1.right.expressions.1.callee"],
            toPropertyKey: ["body.0.body.body.1.body.body.2.declarations.2.init.properties.1.value.alternate.callee"]
          },
          internal: false
        }),
        applyDecs2301: helper("7.21.0", 'function applyDecs2301Factory(){function createAddInitializerMethod(e,t){return function(r){!function(e,t){if(e.v)throw Error("attempted to call addInitializer after decoration was finished")}(t),assertCallable(r,"An initializer"),e.push(r)}}function assertInstanceIfPrivate(e,t){if(!e(t))throw new TypeError("Attempted to access private element on non-instance")}function memberDec(e,t,r,n,a,i,s,o,c){var u;switch(a){case 1:u="accessor";break;case 2:u="method";break;case 3:u="getter";break;case 4:u="setter";break;default:u="field"}var l,f,p={kind:u,name:s?"#"+t:toPropertyKey(t),static:i,private:s},d={v:!1};if(0!==a&&(p.addInitializer=createAddInitializerMethod(n,d)),s||0!==a&&2!==a)if(2===a)l=function(e){return assertInstanceIfPrivate(c,e),r.value};else{var h=0===a||1===a;(h||3===a)&&(l=s?function(e){return assertInstanceIfPrivate(c,e),r.get.call(e)}:function(e){return r.get.call(e)}),(h||4===a)&&(f=s?function(e,t){assertInstanceIfPrivate(c,e),r.set.call(e,t)}:function(e,t){r.set.call(e,t)})}else l=function(e){return e[t]},0===a&&(f=function(e,r){e[t]=r});var v=s?c.bind():function(e){return t in e};p.access=l&&f?{get:l,set:f,has:v}:l?{get:l,has:v}:{set:f,has:v};try{return e(o,p)}finally{d.v=!0}}function assertCallable(e,t){if("function"!=typeof e)throw new TypeError(t+" must be a function")}function assertValidReturnValue(e,t){var r=typeof t;if(1===e){if("object"!==r||null===t)throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");void 0!==t.get&&assertCallable(t.get,"accessor.get"),void 0!==t.set&&assertCallable(t.set,"accessor.set"),void 0!==t.init&&assertCallable(t.init,"accessor.init")}else if("function"!==r)throw new TypeError((0===e?"field":10===e?"class":"method")+" decorators must return a function or void 0")}function curryThis2(e){return function(t){e(this,t)}}function applyMemberDec(e,t,r,n,a,i,s,o,c){var u,l,f,p,d,h,v,y,g=r[0];if(s?(0===a||1===a?(u={get:(d=r[3],function(){return d(this)}),set:curryThis2(r[4])},f="get"):3===a?(u={get:r[3]},f="get"):4===a?(u={set:r[3]},f="set"):u={value:r[3]},0!==a&&(1===a&&setFunctionName(u.set,"#"+n,"set"),setFunctionName(u[f||"value"],"#"+n,f))):0!==a&&(u=Object.getOwnPropertyDescriptor(t,n)),1===a?p={get:u.get,set:u.set}:2===a?p=u.value:3===a?p=u.get:4===a&&(p=u.set),"function"==typeof g)void 0!==(h=memberDec(g,n,u,o,a,i,s,p,c))&&(assertValidReturnValue(a,h),0===a?l=h:1===a?(l=h.init,v=h.get||p.get,y=h.set||p.set,p={get:v,set:y}):p=h);else for(var m=g.length-1;m>=0;m--){var b;void 0!==(h=memberDec(g[m],n,u,o,a,i,s,p,c))&&(assertValidReturnValue(a,h),0===a?b=h:1===a?(b=h.init,v=h.get||p.get,y=h.set||p.set,p={get:v,set:y}):p=h,void 0!==b&&(void 0===l?l=b:"function"==typeof l?l=[l,b]:l.push(b)))}if(0===a||1===a){if(void 0===l)l=function(e,t){return t};else if("function"!=typeof l){var I=l;l=function(e,t){for(var r=t,n=0;n<I.length;n++)r=I[n].call(e,r);return r}}else{var w=l;l=function(e,t){return w.call(e,t)}}e.push(l)}0!==a&&(1===a?(u.get=p.get,u.set=p.set):2===a?u.value=p:3===a?u.get=p:4===a&&(u.set=p),s?1===a?(e.push((function(e,t){return p.get.call(e,t)})),e.push((function(e,t){return p.set.call(e,t)}))):2===a?e.push(p):e.push((function(e,t){return p.call(e,t)})):Object.defineProperty(t,n,u))}function applyMemberDecs(e,t,r){for(var n,a,i,s=[],o=new Map,c=new Map,u=0;u<t.length;u++){var l=t[u];if(Array.isArray(l)){var f,p,d=l[1],h=l[2],v=l.length>3,y=d>=5,g=r;if(y?(f=e,0!=(d-=5)&&(p=a=a||[]),v&&!i&&(i=function(t){return checkInRHS(t)===e}),g=i):(f=e.prototype,0!==d&&(p=n=n||[])),0!==d&&!v){var m=y?c:o,b=m.get(h)||0;if(!0===b||3===b&&4!==d||4===b&&3!==d)throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: "+h);!b&&d>2?m.set(h,d):m.set(h,!0)}applyMemberDec(s,f,l,h,d,y,v,p,g)}}return pushInitializers(s,n),pushInitializers(s,a),s}function pushInitializers(e,t){t&&e.push((function(e){for(var r=0;r<t.length;r++)t[r].call(e);return e}))}return function(e,t,r,n){return{e:applyMemberDecs(e,t,n),get c(){return function(e,t){if(t.length>0){for(var r=[],n=e,a=e.name,i=t.length-1;i>=0;i--){var s={v:!1};try{var o=t[i](n,{kind:"class",name:a,addInitializer:createAddInitializerMethod(r,s)})}finally{s.v=!0}void 0!==o&&(assertValidReturnValue(10,o),n=o)}return[n,function(){for(var e=0;e<r.length;e++)r[e].call(n)}]}}(e,r)}}}}function applyDecs2301(e,t,r,n){return(applyDecs2301=applyDecs2301Factory())(e,t,r,n)}', {
          globals: ["Error", "TypeError", "Object", "Map", "Array"],
          locals: {
            applyDecs2301Factory: ["body.0.id", "body.1.body.body.0.argument.callee.right.callee"],
            applyDecs2301: ["body.1.id", "body.1.body.body.0.argument.callee.left"]
          },
          exportBindingAssignments: ["body.1.body.body.0.argument.callee"],
          exportName: "applyDecs2301",
          dependencies: {
            checkInRHS: ["body.0.body.body.7.body.body.0.body.body.1.consequent.body.1.test.expressions.0.consequent.expressions.2.right.right.body.body.0.argument.left.callee"],
            setFunctionName: ["body.0.body.body.6.body.body.1.test.expressions.0.consequent.expressions.1.right.expressions.0.right.callee", "body.0.body.body.6.body.body.1.test.expressions.0.consequent.expressions.1.right.expressions.1.callee"],
            toPropertyKey: ["body.0.body.body.2.body.body.2.declarations.2.init.properties.1.value.alternate.callee"]
          },
          internal: false
        }),
        applyDecs2305: helper("7.21.0", 'function applyDecs2305(e,t,r,n,o,a){function i(e,t,r){return function(n,o){return r&&r(n),e[t].call(n,o)}}function c(e,t){for(var r=0;r<e.length;r++)e[r].call(t);return t}function s(e,t,r,n){if("function"!=typeof e&&(n||void 0!==e))throw new TypeError(t+" must "+(r||"be")+" a function"+(n?"":" or undefined"));return e}function applyDec(e,t,r,n,o,a,c,u,l,f,p,d,h){function m(e){if(!h(e))throw new TypeError("Attempted to access private element on non-instance")}var y,v=t[0],g=t[3],b=!u;if(!b){r||Array.isArray(v)||(v=[v]);var w={},S=[],A=3===o?"get":4===o||d?"set":"value";f?(p||d?w={get:setFunctionName((function(){return g(this)}),n,"get"),set:function(e){t[4](this,e)}}:w[A]=g,p||setFunctionName(w[A],n,2===o?"":A)):p||(w=Object.getOwnPropertyDescriptor(e,n))}for(var P=e,j=v.length-1;j>=0;j-=r?2:1){var D=v[j],E=r?v[j-1]:void 0,I={},O={kind:["field","accessor","method","getter","setter","class"][o],name:n,metadata:a,addInitializer:function(e,t){if(e.v)throw Error("attempted to call addInitializer after decoration was finished");s(t,"An initializer","be",!0),c.push(t)}.bind(null,I)};try{if(b)(y=s(D.call(E,P,O),"class decorators","return"))&&(P=y);else{var k,F;O.static=l,O.private=f,f?2===o?k=function(e){return m(e),w.value}:(o<4&&(k=i(w,"get",m)),3!==o&&(F=i(w,"set",m))):(k=function(e){return e[n]},(o<2||4===o)&&(F=function(e,t){e[n]=t}));var N=O.access={has:f?h.bind():function(e){return n in e}};if(k&&(N.get=k),F&&(N.set=F),P=D.call(E,d?{get:w.get,set:w.set}:w[A],O),d){if("object"==typeof P&&P)(y=s(P.get,"accessor.get"))&&(w.get=y),(y=s(P.set,"accessor.set"))&&(w.set=y),(y=s(P.init,"accessor.init"))&&S.push(y);else if(void 0!==P)throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0")}else s(P,(p?"field":"method")+" decorators","return")&&(p?S.push(P):w[A]=P)}}finally{I.v=!0}}return(p||d)&&u.push((function(e,t){for(var r=S.length-1;r>=0;r--)t=S[r].call(e,t);return t})),p||b||(f?d?u.push(i(w,"get"),i(w,"set")):u.push(2===o?w[A]:i.call.bind(w[A])):Object.defineProperty(e,n,w)),P}function u(e,t){return Object.defineProperty(e,Symbol.metadata||Symbol.for("Symbol.metadata"),{configurable:!0,enumerable:!0,value:t})}if(arguments.length>=6)var l=a[Symbol.metadata||Symbol.for("Symbol.metadata")];var f=Object.create(null==l?null:l),p=function(e,t,r,n){var o,a,i=[],s=function(t){return checkInRHS(t)===e},u=new Map;function l(e){e&&i.push(c.bind(null,e))}for(var f=0;f<t.length;f++){var p=t[f];if(Array.isArray(p)){var d=p[1],h=p[2],m=p.length>3,y=16&d,v=!!(8&d),g=0==(d&=7),b=h+"/"+v;if(!g&&!m){var w=u.get(b);if(!0===w||3===w&&4!==d||4===w&&3!==d)throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: "+h);u.set(b,!(d>2)||d)}applyDec(v?e:e.prototype,p,y,m?"#"+h:toPropertyKey(h),d,n,v?a=a||[]:o=o||[],i,v,m,g,1===d,v&&m?s:r)}}return l(o),l(a),i}(e,t,o,f);return r.length||u(e,f),{e:p,get c(){var t=[];return r.length&&[u(applyDec(e,[r],n,e.name,5,f,t),f),c.bind(null,t,e)]}}}', {
          globals: ["TypeError", "Array", "Object", "Error", "Symbol", "Map"],
          locals: {
            applyDecs2305: ["body.0.id"]
          },
          exportBindingAssignments: [],
          exportName: "applyDecs2305",
          dependencies: {
            checkInRHS: ["body.0.body.body.6.declarations.1.init.callee.body.body.0.declarations.3.init.body.body.0.argument.left.callee"],
            setFunctionName: ["body.0.body.body.3.body.body.2.consequent.body.2.expression.consequent.expressions.0.consequent.right.properties.0.value.callee", "body.0.body.body.3.body.body.2.consequent.body.2.expression.consequent.expressions.1.right.callee"],
            toPropertyKey: ["body.0.body.body.6.declarations.1.init.callee.body.body.2.body.body.1.consequent.body.2.expression.arguments.3.alternate.callee"]
          },
          internal: false
        }),
        classApplyDescriptorDestructureSet: helper("7.13.10", 'function _classApplyDescriptorDestructureSet(e,t){if(t.set)return"__destrObj"in t||(t.__destrObj={set value(r){t.set.call(e,r)}}),t.__destrObj;if(!t.writable)throw new TypeError("attempted to set read only private field");return t}', {
          globals: ["TypeError"],
          locals: {
            _classApplyDescriptorDestructureSet: ["body.0.id"]
          },
          exportBindingAssignments: [],
          exportName: "_classApplyDescriptorDestructureSet",
          dependencies: {},
          internal: false
        }),
        classApplyDescriptorGet: helper("7.13.10", "function _classApplyDescriptorGet(e,t){return t.get?t.get.call(e):t.value}", {
          globals: [],
          locals: {
            _classApplyDescriptorGet: ["body.0.id"]
          },
          exportBindingAssignments: [],
          exportName: "_classApplyDescriptorGet",
          dependencies: {},
          internal: false
        }),
        classApplyDescriptorSet: helper("7.13.10", 'function _classApplyDescriptorSet(e,t,l){if(t.set)t.set.call(e,l);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=l}}', {
          globals: ["TypeError"],
          locals: {
            _classApplyDescriptorSet: ["body.0.id"]
          },
          exportBindingAssignments: [],
          exportName: "_classApplyDescriptorSet",
          dependencies: {},
          internal: false
        }),
        classCheckPrivateStaticAccess: helper("7.13.10", "function _classCheckPrivateStaticAccess(s,a,r){return assertClassBrand(a,s,r)}", {
          globals: [],
          locals: {
            _classCheckPrivateStaticAccess: ["body.0.id"]
          },
          exportBindingAssignments: [],
          exportName: "_classCheckPrivateStaticAccess",
          dependencies: {
            assertClassBrand: ["body.0.body.body.0.argument.callee"]
          },
          internal: false
        }),
        classCheckPrivateStaticFieldDescriptor: helper("7.13.10", 'function _classCheckPrivateStaticFieldDescriptor(t,e){if(void 0===t)throw new TypeError("attempted to "+e+" private static field before its declaration")}', {
          globals: ["TypeError"],
          locals: {
            _classCheckPrivateStaticFieldDescriptor: ["body.0.id"]
          },
          exportBindingAssignments: [],
          exportName: "_classCheckPrivateStaticFieldDescriptor",
          dependencies: {},
          internal: false
        }),
        classExtractFieldDescriptor: helper("7.13.10", "function _classExtractFieldDescriptor(e,t){return classPrivateFieldGet2(t,e)}", {
          globals: [],
          locals: {
            _classExtractFieldDescriptor: ["body.0.id"]
          },
          exportBindingAssignments: [],
          exportName: "_classExtractFieldDescriptor",
          dependencies: {
            classPrivateFieldGet2: ["body.0.body.body.0.argument.callee"]
          },
          internal: false
        }),
        classPrivateFieldDestructureSet: helper("7.4.4", "function _classPrivateFieldDestructureSet(e,t){var r=classPrivateFieldGet2(t,e);return classApplyDescriptorDestructureSet(e,r)}", {
          globals: [],
          locals: {
            _classPrivateFieldDestructureSet: ["body.0.id"]
          },
          exportBindingAssignments: [],
          exportName: "_classPrivateFieldDestructureSet",
          dependencies: {
            classApplyDescriptorDestructureSet: ["body.0.body.body.1.argument.callee"],
            classPrivateFieldGet2: ["body.0.body.body.0.declarations.0.init.callee"]
          },
          internal: false
        }),
        classPrivateFieldGet: helper("7.0.0-beta.0", "function _classPrivateFieldGet(e,t){var r=classPrivateFieldGet2(t,e);return classApplyDescriptorGet(e,r)}", {
          globals: [],
          locals: {
            _classPrivateFieldGet: ["body.0.id"]
          },
          exportBindingAssignments: [],
          exportName: "_classPrivateFieldGet",
          dependencies: {
            classApplyDescriptorGet: ["body.0.body.body.1.argument.callee"],
            classPrivateFieldGet2: ["body.0.body.body.0.declarations.0.init.callee"]
          },
          internal: false
        }),
        classPrivateFieldSet: helper("7.0.0-beta.0", "function _classPrivateFieldSet(e,t,r){var s=classPrivateFieldGet2(t,e);return classApplyDescriptorSet(e,s,r),r}", {
          globals: [],
          locals: {
            _classPrivateFieldSet: ["body.0.id"]
          },
          exportBindingAssignments: [],
          exportName: "_classPrivateFieldSet",
          dependencies: {
            classApplyDescriptorSet: ["body.0.body.body.1.argument.expressions.0.callee"],
            classPrivateFieldGet2: ["body.0.body.body.0.declarations.0.init.callee"]
          },
          internal: false
        }),
        classPrivateMethodGet: helper("7.1.6", "function _classPrivateMethodGet(s,a,r){return assertClassBrand(a,s),r}", {
          globals: [],
          locals: {
            _classPrivateMethodGet: ["body.0.id"]
          },
          exportBindingAssignments: [],
          exportName: "_classPrivateMethodGet",
          dependencies: {
            assertClassBrand: ["body.0.body.body.0.argument.expressions.0.callee"]
          },
          internal: false
        }),
        classPrivateMethodSet: helper("7.1.6", 'function _classPrivateMethodSet(){throw new TypeError("attempted to reassign private method")}', {
          globals: ["TypeError"],
          locals: {
            _classPrivateMethodSet: ["body.0.id"]
          },
          exportBindingAssignments: [],
          exportName: "_classPrivateMethodSet",
          dependencies: {},
          internal: false
        }),
        classStaticPrivateFieldDestructureSet: helper("7.13.10", 'function _classStaticPrivateFieldDestructureSet(t,r,s){return assertClassBrand(r,t),classCheckPrivateStaticFieldDescriptor(s,"set"),classApplyDescriptorDestructureSet(t,s)}', {
          globals: [],
          locals: {
            _classStaticPrivateFieldDestructureSet: ["body.0.id"]
          },
          exportBindingAssignments: [],
          exportName: "_classStaticPrivateFieldDestructureSet",
          dependencies: {
            classApplyDescriptorDestructureSet: ["body.0.body.body.0.argument.expressions.2.callee"],
            assertClassBrand: ["body.0.body.body.0.argument.expressions.0.callee"],
            classCheckPrivateStaticFieldDescriptor: ["body.0.body.body.0.argument.expressions.1.callee"]
          },
          internal: false
        }),
        classStaticPrivateFieldSpecGet: helper("7.0.2", 'function _classStaticPrivateFieldSpecGet(t,s,r){return assertClassBrand(s,t),classCheckPrivateStaticFieldDescriptor(r,"get"),classApplyDescriptorGet(t,r)}', {
          globals: [],
          locals: {
            _classStaticPrivateFieldSpecGet: ["body.0.id"]
          },
          exportBindingAssignments: [],
          exportName: "_classStaticPrivateFieldSpecGet",
          dependencies: {
            classApplyDescriptorGet: ["body.0.body.body.0.argument.expressions.2.callee"],
            assertClassBrand: ["body.0.body.body.0.argument.expressions.0.callee"],
            classCheckPrivateStaticFieldDescriptor: ["body.0.body.body.0.argument.expressions.1.callee"]
          },
          internal: false
        }),
        classStaticPrivateFieldSpecSet: helper("7.0.2", 'function _classStaticPrivateFieldSpecSet(s,t,r,e){return assertClassBrand(t,s),classCheckPrivateStaticFieldDescriptor(r,"set"),classApplyDescriptorSet(s,r,e),e}', {
          globals: [],
          locals: {
            _classStaticPrivateFieldSpecSet: ["body.0.id"]
          },
          exportBindingAssignments: [],
          exportName: "_classStaticPrivateFieldSpecSet",
          dependencies: {
            classApplyDescriptorSet: ["body.0.body.body.0.argument.expressions.2.callee"],
            assertClassBrand: ["body.0.body.body.0.argument.expressions.0.callee"],
            classCheckPrivateStaticFieldDescriptor: ["body.0.body.body.0.argument.expressions.1.callee"]
          },
          internal: false
        }),
        classStaticPrivateMethodSet: helper("7.3.2", 'function _classStaticPrivateMethodSet(){throw new TypeError("attempted to set read only static private field")}', {
          globals: ["TypeError"],
          locals: {
            _classStaticPrivateMethodSet: ["body.0.id"]
          },
          exportBindingAssignments: [],
          exportName: "_classStaticPrivateMethodSet",
          dependencies: {},
          internal: false
        }),
        defineEnumerableProperties: helper("7.0.0-beta.0", 'function _defineEnumerableProperties(e,r){for(var t in r){var n=r[t];n.configurable=n.enumerable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,t,n)}if(Object.getOwnPropertySymbols)for(var a=Object.getOwnPropertySymbols(r),b=0;b<a.length;b++){var i=a[b];(n=r[i]).configurable=n.enumerable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,i,n)}return e}', {
          globals: ["Object"],
          locals: {
            _defineEnumerableProperties: ["body.0.id"]
          },
          exportBindingAssignments: [],
          exportName: "_defineEnumerableProperties",
          dependencies: {},
          internal: false
        }),
        dispose: helper("7.22.0", 'function dispose_SuppressedError(r,e){return"undefined"!=typeof SuppressedError?dispose_SuppressedError=SuppressedError:(dispose_SuppressedError=function(r,e){this.suppressed=e,this.error=r,this.stack=Error().stack},dispose_SuppressedError.prototype=Object.create(Error.prototype,{constructor:{value:dispose_SuppressedError,writable:!0,configurable:!0}})),new dispose_SuppressedError(r,e)}function _dispose(r,e,s){function next(){for(;r.length>0;)try{var o=r.pop(),p=o.d.call(o.v);if(o.a)return Promise.resolve(p).then(next,err)}catch(r){return err(r)}if(s)throw e}function err(r){return e=s?new dispose_SuppressedError(e,r):r,s=!0,next()}return next()}', {
          globals: ["SuppressedError", "Error", "Object", "Promise"],
          locals: {
            dispose_SuppressedError: ["body.0.id", "body.0.body.body.0.argument.expressions.0.alternate.expressions.1.left.object", "body.0.body.body.0.argument.expressions.0.alternate.expressions.1.right.arguments.1.properties.0.value.properties.0.value", "body.0.body.body.0.argument.expressions.1.callee", "body.1.body.body.1.body.body.0.argument.expressions.0.right.consequent.callee", "body.0.body.body.0.argument.expressions.0.consequent.left", "body.0.body.body.0.argument.expressions.0.alternate.expressions.0.left"],
            _dispose: ["body.1.id"]
          },
          exportBindingAssignments: [],
          exportName: "_dispose",
          dependencies: {},
          internal: false
        }),
        objectSpread: helper("7.0.0-beta.0", 'function _objectSpread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?Object(arguments[r]):{},o=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&o.push.apply(o,Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),o.forEach((function(r){defineProperty(e,r,t[r])}))}return e}', {
          globals: ["Object"],
          locals: {
            _objectSpread: ["body.0.id"]
          },
          exportBindingAssignments: [],
          exportName: "_objectSpread",
          dependencies: {
            defineProperty: ["body.0.body.body.0.body.body.1.expression.expressions.1.arguments.0.body.body.0.expression.callee"]
          },
          internal: false
        }),
        regeneratorRuntime: helper("7.18.0", 'function _regeneratorRuntime(){"use strict";var r=regenerator(),e=r.m(_regeneratorRuntime),t=(Object.getPrototypeOf?Object.getPrototypeOf(e):e.__proto__).constructor;function n(r){var e="function"==typeof r&&r.constructor;return!!e&&(e===t||"GeneratorFunction"===(e.displayName||e.name))}var o={throw:1,return:2,break:3,continue:3};function a(r){var e,t;return function(n){e||(e={stop:function(){return t(n.a,2)},catch:function(){return n.v},abrupt:function(r,e){return t(n.a,o[r],e)},delegateYield:function(r,o,a){return e.resultName=o,t(n.d,values(r),a)},finish:function(r){return t(n.f,r)}},t=function(r,t,o){n.p=e.prev,n.n=e.next;try{return r(t,o)}finally{e.next=n.n}}),e.resultName&&(e[e.resultName]=n.v,e.resultName=void 0),e.sent=n.v,e.next=n.n;try{return r.call(this,e)}finally{n.p=e.prev,n.n=e.next}}}return(_regeneratorRuntime=function(){return{wrap:function(e,t,n,o){return r.w(a(e),t,n,o&&o.reverse())},isGeneratorFunction:n,mark:r.m,awrap:function(r,e){return new OverloadYield(r,e)},AsyncIterator:AsyncIterator,async:function(r,e,t,o,u){return(n(e)?asyncGen:async)(a(r),e,t,o,u)},keys:keys,values:values}})()}', {
          globals: ["Object"],
          locals: {
            _regeneratorRuntime: ["body.0.id", "body.0.body.body.0.declarations.1.init.arguments.0", "body.0.body.body.4.argument.callee.left"]
          },
          exportBindingAssignments: ["body.0.body.body.4.argument.callee"],
          exportName: "_regeneratorRuntime",
          dependencies: {
            OverloadYield: ["body.0.body.body.4.argument.callee.right.body.body.0.argument.properties.3.value.body.body.0.argument.callee"],
            regenerator: ["body.0.body.body.0.declarations.0.init.callee"],
            regeneratorAsync: ["body.0.body.body.4.argument.callee.right.body.body.0.argument.properties.5.value.body.body.0.argument.callee.alternate"],
            regeneratorAsyncGen: ["body.0.body.body.4.argument.callee.right.body.body.0.argument.properties.5.value.body.body.0.argument.callee.consequent"],
            regeneratorAsyncIterator: ["body.0.body.body.4.argument.callee.right.body.body.0.argument.properties.4.value"],
            regeneratorKeys: ["body.0.body.body.4.argument.callee.right.body.body.0.argument.properties.6.value"],
            regeneratorValues: ["body.0.body.body.3.body.body.1.argument.body.body.0.expression.expressions.0.right.expressions.0.right.properties.3.value.body.body.0.argument.expressions.1.arguments.1.callee", "body.0.body.body.4.argument.callee.right.body.body.0.argument.properties.7.value"]
          },
          internal: false
        }),
        using: helper("7.22.0", 'function _using(o,n,e){if(null==n)return n;if(Object(n)!==n)throw new TypeError("using declarations can only be used with objects, functions, null, or undefined.");if(e)var r=n[Symbol.asyncDispose||Symbol.for("Symbol.asyncDispose")];if(null==r&&(r=n[Symbol.dispose||Symbol.for("Symbol.dispose")]),"function"!=typeof r)throw new TypeError("Property [Symbol.dispose] is not a function.");return o.push({v:n,d:r,a:e}),n}', {
          globals: ["Object", "TypeError", "Symbol"],
          locals: {
            _using: ["body.0.id"]
          },
          exportBindingAssignments: [],
          exportName: "_using",
          dependencies: {},
          internal: false
        })
      });
    }
  }
});

// node_modules/@babel/helpers/lib/index.js
var require_lib7 = __commonJS({
  "node_modules/@babel/helpers/lib/index.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = void 0;
    exports2.get = get;
    exports2.getDependencies = getDependencies;
    exports2.isInternal = isInternal;
    exports2.list = void 0;
    exports2.minVersion = minVersion;
    var _t = require_lib3();
    var _helpersGenerated = require_helpers_generated();
    var {
      cloneNode,
      identifier
    } = _t;
    function deep(obj, path, value2) {
      try {
        const parts = path.split(".");
        let last = parts.shift();
        while (parts.length > 0) {
          obj = obj[last];
          last = parts.shift();
        }
        if (arguments.length > 2) {
          obj[last] = value2;
        } else {
          return obj[last];
        }
      } catch (e) {
        e.message += ` (when accessing ${path})`;
        throw e;
      }
    }
    function permuteHelperAST(ast, metadata, bindingName, localBindings, getDependency, adjustAst) {
      const {
        locals,
        dependencies,
        exportBindingAssignments,
        exportName
      } = metadata;
      const bindings = new Set(localBindings || []);
      if (bindingName) bindings.add(bindingName);
      for (const [name, paths] of (Object.entries || ((o) => Object.keys(o).map((k) => [k, o[k]])))(locals)) {
        let newName = name;
        if (bindingName && name === exportName) {
          newName = bindingName;
        } else {
          while (bindings.has(newName)) newName = "_" + newName;
        }
        if (newName !== name) {
          for (const path of paths) {
            deep(ast, path, identifier(newName));
          }
        }
      }
      for (const [name, paths] of (Object.entries || ((o) => Object.keys(o).map((k) => [k, o[k]])))(dependencies)) {
        const ref = typeof getDependency === "function" && getDependency(name) || identifier(name);
        for (const path of paths) {
          deep(ast, path, cloneNode(ref));
        }
      }
      adjustAst == null || adjustAst(ast, exportName, (map) => {
        exportBindingAssignments.forEach((p) => deep(ast, p, map(deep(ast, p))));
      });
    }
    var helperData = /* @__PURE__ */ Object.create(null);
    function loadHelper(name) {
      if (!helperData[name]) {
        const helper = _helpersGenerated.default[name];
        if (!helper) {
          throw Object.assign(new ReferenceError(`Unknown helper ${name}`), {
            code: "BABEL_HELPER_UNKNOWN",
            helper: name
          });
        }
        helperData[name] = {
          minVersion: helper.minVersion,
          build(getDependency, bindingName, localBindings, adjustAst) {
            const ast = helper.ast();
            permuteHelperAST(ast, helper.metadata, bindingName, localBindings, getDependency, adjustAst);
            return {
              nodes: ast.body,
              globals: helper.metadata.globals
            };
          },
          getDependencies() {
            return Object.keys(helper.metadata.dependencies);
          }
        };
      }
      return helperData[name];
    }
    function get(name, getDependency, bindingName, localBindings, adjustAst) {
      {
        if (typeof bindingName === "object") {
          const id = bindingName;
          if ((id == null ? void 0 : id.type) === "Identifier") {
            bindingName = id.name;
          } else {
            bindingName = void 0;
          }
        }
      }
      return loadHelper(name).build(getDependency, bindingName, localBindings, adjustAst);
    }
    function minVersion(name) {
      return loadHelper(name).minVersion;
    }
    function getDependencies(name) {
      return loadHelper(name).getDependencies();
    }
    function isInternal(name) {
      var _helpers$name;
      return (_helpers$name = _helpersGenerated.default[name]) == null ? void 0 : _helpers$name.metadata.internal;
    }
    {
      exports2.ensure = (name) => {
        loadHelper(name);
      };
    }
    var list = exports2.list = Object.keys(_helpersGenerated.default).map((name) => name.replace(/^_/, ""));
    var _default = exports2.default = get;
  }
});

// node_modules/@babel/traverse/lib/path/lib/virtual-types.js
var require_virtual_types = __commonJS({
  "node_modules/@babel/traverse/lib/path/lib/virtual-types.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.Var = exports2.User = exports2.Statement = exports2.SpreadProperty = exports2.Scope = exports2.RestProperty = exports2.ReferencedMemberExpression = exports2.ReferencedIdentifier = exports2.Referenced = exports2.Pure = exports2.NumericLiteralTypeAnnotation = exports2.Generated = exports2.ForAwaitStatement = exports2.Flow = exports2.Expression = exports2.ExistentialTypeParam = exports2.BlockScoped = exports2.BindingIdentifier = void 0;
    var ReferencedIdentifier = exports2.ReferencedIdentifier = ["Identifier", "JSXIdentifier"];
    var ReferencedMemberExpression = exports2.ReferencedMemberExpression = ["MemberExpression"];
    var BindingIdentifier = exports2.BindingIdentifier = ["Identifier"];
    var Statement = exports2.Statement = ["Statement"];
    var Expression = exports2.Expression = ["Expression"];
    var Scope = exports2.Scope = ["Scopable", "Pattern"];
    var Referenced = exports2.Referenced = null;
    var BlockScoped = exports2.BlockScoped = ["FunctionDeclaration", "ClassDeclaration", "VariableDeclaration"];
    var Var = exports2.Var = ["VariableDeclaration"];
    var User = exports2.User = null;
    var Generated = exports2.Generated = null;
    var Pure = exports2.Pure = null;
    var Flow = exports2.Flow = ["Flow", "ImportDeclaration", "ExportDeclaration", "ImportSpecifier"];
    var RestProperty = exports2.RestProperty = ["RestElement"];
    var SpreadProperty = exports2.SpreadProperty = ["RestElement"];
    var ExistentialTypeParam = exports2.ExistentialTypeParam = ["ExistsTypeAnnotation"];
    var NumericLiteralTypeAnnotation = exports2.NumericLiteralTypeAnnotation = ["NumberLiteralTypeAnnotation"];
    var ForAwaitStatement = exports2.ForAwaitStatement = ["ForOfStatement"];
  }
});

// node_modules/ms/index.js
var require_ms = __commonJS({
  "node_modules/ms/index.js"(exports2, module2) {
    var s = 1e3;
    var m = s * 60;
    var h = m * 60;
    var d = h * 24;
    var w = d * 7;
    var y = d * 365.25;
    module2.exports = function(val, options) {
      options = options || {};
      var type = typeof val;
      if (type === "string" && val.length > 0) {
        return parse2(val);
      } else if (type === "number" && isFinite(val)) {
        return options.long ? fmtLong(val) : fmtShort(val);
      }
      throw new Error(
        "val is not a non-empty string or a valid number. val=" + JSON.stringify(val)
      );
    };
    function parse2(str) {
      str = String(str);
      if (str.length > 100) {
        return;
      }
      var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
        str
      );
      if (!match) {
        return;
      }
      var n = parseFloat(match[1]);
      var type = (match[2] || "ms").toLowerCase();
      switch (type) {
        case "years":
        case "year":
        case "yrs":
        case "yr":
        case "y":
          return n * y;
        case "weeks":
        case "week":
        case "w":
          return n * w;
        case "days":
        case "day":
        case "d":
          return n * d;
        case "hours":
        case "hour":
        case "hrs":
        case "hr":
        case "h":
          return n * h;
        case "minutes":
        case "minute":
        case "mins":
        case "min":
        case "m":
          return n * m;
        case "seconds":
        case "second":
        case "secs":
        case "sec":
        case "s":
          return n * s;
        case "milliseconds":
        case "millisecond":
        case "msecs":
        case "msec":
        case "ms":
          return n;
        default:
          return void 0;
      }
    }
    function fmtShort(ms) {
      var msAbs = Math.abs(ms);
      if (msAbs >= d) {
        return Math.round(ms / d) + "d";
      }
      if (msAbs >= h) {
        return Math.round(ms / h) + "h";
      }
      if (msAbs >= m) {
        return Math.round(ms / m) + "m";
      }
      if (msAbs >= s) {
        return Math.round(ms / s) + "s";
      }
      return ms + "ms";
    }
    function fmtLong(ms) {
      var msAbs = Math.abs(ms);
      if (msAbs >= d) {
        return plural(ms, msAbs, d, "day");
      }
      if (msAbs >= h) {
        return plural(ms, msAbs, h, "hour");
      }
      if (msAbs >= m) {
        return plural(ms, msAbs, m, "minute");
      }
      if (msAbs >= s) {
        return plural(ms, msAbs, s, "second");
      }
      return ms + " ms";
    }
    function plural(ms, msAbs, n, name) {
      var isPlural = msAbs >= n * 1.5;
      return Math.round(ms / n) + " " + name + (isPlural ? "s" : "");
    }
  }
});

// node_modules/debug/src/common.js
var require_common = __commonJS({
  "node_modules/debug/src/common.js"(exports2, module2) {
    function setup(env) {
      createDebug.debug = createDebug;
      createDebug.default = createDebug;
      createDebug.coerce = coerce;
      createDebug.disable = disable;
      createDebug.enable = enable;
      createDebug.enabled = enabled;
      createDebug.humanize = require_ms();
      createDebug.destroy = destroy;
      Object.keys(env).forEach((key) => {
        createDebug[key] = env[key];
      });
      createDebug.names = [];
      createDebug.skips = [];
      createDebug.formatters = {};
      function selectColor(namespace) {
        let hash = 0;
        for (let i = 0; i < namespace.length; i++) {
          hash = (hash << 5) - hash + namespace.charCodeAt(i);
          hash |= 0;
        }
        return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
      }
      createDebug.selectColor = selectColor;
      function createDebug(namespace) {
        let prevTime;
        let enableOverride = null;
        let namespacesCache;
        let enabledCache;
        function debug(...args) {
          if (!debug.enabled) {
            return;
          }
          const self2 = debug;
          const curr = Number(/* @__PURE__ */ new Date());
          const ms = curr - (prevTime || curr);
          self2.diff = ms;
          self2.prev = prevTime;
          self2.curr = curr;
          prevTime = curr;
          args[0] = createDebug.coerce(args[0]);
          if (typeof args[0] !== "string") {
            args.unshift("%O");
          }
          let index = 0;
          args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {
            if (match === "%%") {
              return "%";
            }
            index++;
            const formatter = createDebug.formatters[format];
            if (typeof formatter === "function") {
              const val = args[index];
              match = formatter.call(self2, val);
              args.splice(index, 1);
              index--;
            }
            return match;
          });
          createDebug.formatArgs.call(self2, args);
          const logFn = self2.log || createDebug.log;
          logFn.apply(self2, args);
        }
        debug.namespace = namespace;
        debug.useColors = createDebug.useColors();
        debug.color = createDebug.selectColor(namespace);
        debug.extend = extend;
        debug.destroy = createDebug.destroy;
        Object.defineProperty(debug, "enabled", {
          enumerable: true,
          configurable: false,
          get: () => {
            if (enableOverride !== null) {
              return enableOverride;
            }
            if (namespacesCache !== createDebug.namespaces) {
              namespacesCache = createDebug.namespaces;
              enabledCache = createDebug.enabled(namespace);
            }
            return enabledCache;
          },
          set: (v) => {
            enableOverride = v;
          }
        });
        if (typeof createDebug.init === "function") {
          createDebug.init(debug);
        }
        return debug;
      }
      function extend(namespace, delimiter) {
        const newDebug = createDebug(this.namespace + (typeof delimiter === "undefined" ? ":" : delimiter) + namespace);
        newDebug.log = this.log;
        return newDebug;
      }
      function enable(namespaces) {
        createDebug.save(namespaces);
        createDebug.namespaces = namespaces;
        createDebug.names = [];
        createDebug.skips = [];
        const split = (typeof namespaces === "string" ? namespaces : "").trim().replace(/\s+/g, ",").split(",").filter(Boolean);
        for (const ns of split) {
          if (ns[0] === "-") {
            createDebug.skips.push(ns.slice(1));
          } else {
            createDebug.names.push(ns);
          }
        }
      }
      function matchesTemplate(search, template) {
        let searchIndex = 0;
        let templateIndex = 0;
        let starIndex = -1;
        let matchIndex = 0;
        while (searchIndex < search.length) {
          if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === "*")) {
            if (template[templateIndex] === "*") {
              starIndex = templateIndex;
              matchIndex = searchIndex;
              templateIndex++;
            } else {
              searchIndex++;
              templateIndex++;
            }
          } else if (starIndex !== -1) {
            templateIndex = starIndex + 1;
            matchIndex++;
            searchIndex = matchIndex;
          } else {
            return false;
          }
        }
        while (templateIndex < template.length && template[templateIndex] === "*") {
          templateIndex++;
        }
        return templateIndex === template.length;
      }
      function disable() {
        const namespaces = [
          ...createDebug.names,
          ...createDebug.skips.map((namespace) => "-" + namespace)
        ].join(",");
        createDebug.enable("");
        return namespaces;
      }
      function enabled(name) {
        for (const skip of createDebug.skips) {
          if (matchesTemplate(name, skip)) {
            return false;
          }
        }
        for (const ns of createDebug.names) {
          if (matchesTemplate(name, ns)) {
            return true;
          }
        }
        return false;
      }
      function coerce(val) {
        if (val instanceof Error) {
          return val.stack || val.message;
        }
        return val;
      }
      function destroy() {
        console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
      }
      createDebug.enable(createDebug.load());
      return createDebug;
    }
    module2.exports = setup;
  }
});

// node_modules/debug/src/browser.js
var require_browser = __commonJS({
  "node_modules/debug/src/browser.js"(exports2, module2) {
    exports2.formatArgs = formatArgs;
    exports2.save = save;
    exports2.load = load;
    exports2.useColors = useColors;
    exports2.storage = localstorage();
    exports2.destroy = /* @__PURE__ */ (() => {
      let warned = false;
      return () => {
        if (!warned) {
          warned = true;
          console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
        }
      };
    })();
    exports2.colors = [
      "#0000CC",
      "#0000FF",
      "#0033CC",
      "#0033FF",
      "#0066CC",
      "#0066FF",
      "#0099CC",
      "#0099FF",
      "#00CC00",
      "#00CC33",
      "#00CC66",
      "#00CC99",
      "#00CCCC",
      "#00CCFF",
      "#3300CC",
      "#3300FF",
      "#3333CC",
      "#3333FF",
      "#3366CC",
      "#3366FF",
      "#3399CC",
      "#3399FF",
      "#33CC00",
      "#33CC33",
      "#33CC66",
      "#33CC99",
      "#33CCCC",
      "#33CCFF",
      "#6600CC",
      "#6600FF",
      "#6633CC",
      "#6633FF",
      "#66CC00",
      "#66CC33",
      "#9900CC",
      "#9900FF",
      "#9933CC",
      "#9933FF",
      "#99CC00",
      "#99CC33",
      "#CC0000",
      "#CC0033",
      "#CC0066",
      "#CC0099",
      "#CC00CC",
      "#CC00FF",
      "#CC3300",
      "#CC3333",
      "#CC3366",
      "#CC3399",
      "#CC33CC",
      "#CC33FF",
      "#CC6600",
      "#CC6633",
      "#CC9900",
      "#CC9933",
      "#CCCC00",
      "#CCCC33",
      "#FF0000",
      "#FF0033",
      "#FF0066",
      "#FF0099",
      "#FF00CC",
      "#FF00FF",
      "#FF3300",
      "#FF3333",
      "#FF3366",
      "#FF3399",
      "#FF33CC",
      "#FF33FF",
      "#FF6600",
      "#FF6633",
      "#FF9900",
      "#FF9933",
      "#FFCC00",
      "#FFCC33"
    ];
    function useColors() {
      if (typeof window !== "undefined" && window.process && (window.process.type === "renderer" || window.process.__nwjs)) {
        return true;
      }
      if (typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
        return false;
      }
      let m;
      return typeof document !== "undefined" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773
      typeof window !== "undefined" && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31?
      // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
      typeof navigator !== "undefined" && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(m[1], 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker
      typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
    }
    function formatArgs(args) {
      args[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + args[0] + (this.useColors ? "%c " : " ") + "+" + module2.exports.humanize(this.diff);
      if (!this.useColors) {
        return;
      }
      const c = "color: " + this.color;
      args.splice(1, 0, c, "color: inherit");
      let index = 0;
      let lastC = 0;
      args[0].replace(/%[a-zA-Z%]/g, (match) => {
        if (match === "%%") {
          return;
        }
        index++;
        if (match === "%c") {
          lastC = index;
        }
      });
      args.splice(lastC, 0, c);
    }
    exports2.log = console.debug || console.log || (() => {
    });
    function save(namespaces) {
      try {
        if (namespaces) {
          exports2.storage.setItem("debug", namespaces);
        } else {
          exports2.storage.removeItem("debug");
        }
      } catch (error) {
      }
    }
    function load() {
      let r;
      try {
        r = exports2.storage.getItem("debug") || exports2.storage.getItem("DEBUG");
      } catch (error) {
      }
      if (!r && typeof process !== "undefined" && "env" in process) {
        r = process.env.DEBUG;
      }
      return r;
    }
    function localstorage() {
      try {
        return localStorage;
      } catch (error) {
      }
    }
    module2.exports = require_common()(exports2);
    var { formatters } = module2.exports;
    formatters.j = function(v) {
      try {
        return JSON.stringify(v);
      } catch (error) {
        return "[UnexpectedJSONParseError]: " + error.message;
      }
    };
  }
});

// node_modules/has-flag/index.js
var require_has_flag = __commonJS({
  "node_modules/has-flag/index.js"(exports2, module2) {
    "use strict";
    module2.exports = (flag, argv = process.argv) => {
      const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
      const position = argv.indexOf(prefix + flag);
      const terminatorPosition = argv.indexOf("--");
      return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
    };
  }
});

// node_modules/supports-color/index.js
var require_supports_color = __commonJS({
  "node_modules/supports-color/index.js"(exports2, module2) {
    "use strict";
    var os = require("os");
    var tty = require("tty");
    var hasFlag = require_has_flag();
    var { env } = process;
    var flagForceColor;
    if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
      flagForceColor = 0;
    } else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
      flagForceColor = 1;
    }
    function envForceColor() {
      if ("FORCE_COLOR" in env) {
        if (env.FORCE_COLOR === "true") {
          return 1;
        }
        if (env.FORCE_COLOR === "false") {
          return 0;
        }
        return env.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);
      }
    }
    function translateLevel(level) {
      if (level === 0) {
        return false;
      }
      return {
        level,
        hasBasic: true,
        has256: level >= 2,
        has16m: level >= 3
      };
    }
    function supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
      const noFlagForceColor = envForceColor();
      if (noFlagForceColor !== void 0) {
        flagForceColor = noFlagForceColor;
      }
      const forceColor = sniffFlags ? flagForceColor : noFlagForceColor;
      if (forceColor === 0) {
        return 0;
      }
      if (sniffFlags) {
        if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
          return 3;
        }
        if (hasFlag("color=256")) {
          return 2;
        }
      }
      if (haveStream && !streamIsTTY && forceColor === void 0) {
        return 0;
      }
      const min = forceColor || 0;
      if (env.TERM === "dumb") {
        return min;
      }
      if (process.platform === "win32") {
        const osRelease = os.release().split(".");
        if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
          return Number(osRelease[2]) >= 14931 ? 3 : 2;
        }
        return 1;
      }
      if ("CI" in env) {
        if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "GITHUB_ACTIONS", "BUILDKITE", "DRONE"].some((sign) => sign in env) || env.CI_NAME === "codeship") {
          return 1;
        }
        return min;
      }
      if ("TEAMCITY_VERSION" in env) {
        return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
      }
      if (env.COLORTERM === "truecolor") {
        return 3;
      }
      if ("TERM_PROGRAM" in env) {
        const version = Number.parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
        switch (env.TERM_PROGRAM) {
          case "iTerm.app":
            return version >= 3 ? 3 : 2;
          case "Apple_Terminal":
            return 2;
        }
      }
      if (/-256(color)?$/i.test(env.TERM)) {
        return 2;
      }
      if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
        return 1;
      }
      if ("COLORTERM" in env) {
        return 1;
      }
      return min;
    }
    function getSupportLevel(stream, options = {}) {
      const level = supportsColor(stream, {
        streamIsTTY: stream && stream.isTTY,
        ...options
      });
      return translateLevel(level);
    }
    module2.exports = {
      supportsColor: getSupportLevel,
      stdout: getSupportLevel({ isTTY: tty.isatty(1) }),
      stderr: getSupportLevel({ isTTY: tty.isatty(2) })
    };
  }
});

// node_modules/debug/src/node.js
var require_node = __commonJS({
  "node_modules/debug/src/node.js"(exports2, module2) {
    var tty = require("tty");
    var util = require("util");
    exports2.init = init;
    exports2.log = log;
    exports2.formatArgs = formatArgs;
    exports2.save = save;
    exports2.load = load;
    exports2.useColors = useColors;
    exports2.destroy = util.deprecate(
      () => {
      },
      "Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."
    );
    exports2.colors = [6, 2, 3, 4, 5, 1];
    try {
      const supportsColor = require_supports_color();
      if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {
        exports2.colors = [
          20,
          21,
          26,
          27,
          32,
          33,
          38,
          39,
          40,
          41,
          42,
          43,
          44,
          45,
          56,
          57,
          62,
          63,
          68,
          69,
          74,
          75,
          76,
          77,
          78,
          79,
          80,
          81,
          92,
          93,
          98,
          99,
          112,
          113,
          128,
          129,
          134,
          135,
          148,
          149,
          160,
          161,
          162,
          163,
          164,
          165,
          166,
          167,
          168,
          169,
          170,
          171,
          172,
          173,
          178,
          179,
          184,
          185,
          196,
          197,
          198,
          199,
          200,
          201,
          202,
          203,
          204,
          205,
          206,
          207,
          208,
          209,
          214,
          215,
          220,
          221
        ];
      }
    } catch (error) {
    }
    exports2.inspectOpts = Object.keys(process.env).filter((key) => {
      return /^debug_/i.test(key);
    }).reduce((obj, key) => {
      const prop = key.substring(6).toLowerCase().replace(/_([a-z])/g, (_, k) => {
        return k.toUpperCase();
      });
      let val = process.env[key];
      if (/^(yes|on|true|enabled)$/i.test(val)) {
        val = true;
      } else if (/^(no|off|false|disabled)$/i.test(val)) {
        val = false;
      } else if (val === "null") {
        val = null;
      } else {
        val = Number(val);
      }
      obj[prop] = val;
      return obj;
    }, {});
    function useColors() {
      return "colors" in exports2.inspectOpts ? Boolean(exports2.inspectOpts.colors) : tty.isatty(process.stderr.fd);
    }
    function formatArgs(args) {
      const { namespace: name, useColors: useColors2 } = this;
      if (useColors2) {
        const c = this.color;
        const colorCode = "\x1B[3" + (c < 8 ? c : "8;5;" + c);
        const prefix = `  ${colorCode};1m${name} \x1B[0m`;
        args[0] = prefix + args[0].split("\n").join("\n" + prefix);
        args.push(colorCode + "m+" + module2.exports.humanize(this.diff) + "\x1B[0m");
      } else {
        args[0] = getDate() + name + " " + args[0];
      }
    }
    function getDate() {
      if (exports2.inspectOpts.hideDate) {
        return "";
      }
      return (/* @__PURE__ */ new Date()).toISOString() + " ";
    }
    function log(...args) {
      return process.stderr.write(util.formatWithOptions(exports2.inspectOpts, ...args) + "\n");
    }
    function save(namespaces) {
      if (namespaces) {
        process.env.DEBUG = namespaces;
      } else {
        delete process.env.DEBUG;
      }
    }
    function load() {
      return process.env.DEBUG;
    }
    function init(debug) {
      debug.inspectOpts = {};
      const keys = Object.keys(exports2.inspectOpts);
      for (let i = 0; i < keys.length; i++) {
        debug.inspectOpts[keys[i]] = exports2.inspectOpts[keys[i]];
      }
    }
    module2.exports = require_common()(exports2);
    var { formatters } = module2.exports;
    formatters.o = function(v) {
      this.inspectOpts.colors = this.useColors;
      return util.inspect(v, this.inspectOpts).split("\n").map((str) => str.trim()).join(" ");
    };
    formatters.O = function(v) {
      this.inspectOpts.colors = this.useColors;
      return util.inspect(v, this.inspectOpts);
    };
  }
});

// node_modules/debug/src/index.js
var require_src = __commonJS({
  "node_modules/debug/src/index.js"(exports2, module2) {
    if (typeof process === "undefined" || process.type === "renderer" || process.browser === true || process.__nwjs) {
      module2.exports = require_browser();
    } else {
      module2.exports = require_node();
    }
  }
});

// node_modules/@babel/traverse/lib/path/lib/virtual-types-validator.js
var require_virtual_types_validator = __commonJS({
  "node_modules/@babel/traverse/lib/path/lib/virtual-types-validator.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.isBindingIdentifier = isBindingIdentifier;
    exports2.isBlockScoped = isBlockScoped;
    exports2.isExpression = isExpression;
    exports2.isFlow = isFlow;
    exports2.isForAwaitStatement = isForAwaitStatement;
    exports2.isGenerated = isGenerated;
    exports2.isPure = isPure;
    exports2.isReferenced = isReferenced;
    exports2.isReferencedIdentifier = isReferencedIdentifier;
    exports2.isReferencedMemberExpression = isReferencedMemberExpression;
    exports2.isRestProperty = isRestProperty;
    exports2.isScope = isScope;
    exports2.isSpreadProperty = isSpreadProperty;
    exports2.isStatement = isStatement;
    exports2.isUser = isUser;
    exports2.isVar = isVar;
    var _t = require_lib3();
    var {
      isBinding,
      isBlockScoped: nodeIsBlockScoped,
      isExportDeclaration,
      isExpression: nodeIsExpression,
      isFlow: nodeIsFlow,
      isForStatement,
      isForXStatement,
      isIdentifier,
      isImportDeclaration,
      isImportSpecifier,
      isJSXIdentifier,
      isJSXMemberExpression,
      isMemberExpression,
      isRestElement: nodeIsRestElement,
      isReferenced: nodeIsReferenced,
      isScope: nodeIsScope,
      isStatement: nodeIsStatement,
      isVar: nodeIsVar,
      isVariableDeclaration,
      react,
      isForOfStatement
    } = _t;
    var {
      isCompatTag
    } = react;
    function isReferencedIdentifier(opts) {
      const {
        node,
        parent
      } = this;
      if (isIdentifier(node, opts)) {
        return nodeIsReferenced(node, parent, this.parentPath.parent);
      } else if (isJSXIdentifier(node, opts)) {
        if (!isJSXMemberExpression(parent) && isCompatTag(node.name)) return false;
        return nodeIsReferenced(node, parent, this.parentPath.parent);
      } else {
        return false;
      }
    }
    function isReferencedMemberExpression() {
      const {
        node,
        parent
      } = this;
      return isMemberExpression(node) && nodeIsReferenced(node, parent);
    }
    function isBindingIdentifier() {
      const {
        node,
        parent
      } = this;
      const grandparent = this.parentPath.parent;
      return isIdentifier(node) && isBinding(node, parent, grandparent);
    }
    function isStatement() {
      const {
        node,
        parent
      } = this;
      if (nodeIsStatement(node)) {
        if (isVariableDeclaration(node)) {
          if (isForXStatement(parent, {
            left: node
          })) return false;
          if (isForStatement(parent, {
            init: node
          })) return false;
        }
        return true;
      } else {
        return false;
      }
    }
    function isExpression() {
      if (this.isIdentifier()) {
        return this.isReferencedIdentifier();
      } else {
        return nodeIsExpression(this.node);
      }
    }
    function isScope() {
      return nodeIsScope(this.node, this.parent);
    }
    function isReferenced() {
      return nodeIsReferenced(this.node, this.parent);
    }
    function isBlockScoped() {
      return nodeIsBlockScoped(this.node);
    }
    function isVar() {
      return nodeIsVar(this.node);
    }
    function isUser() {
      var _this$node;
      return !!((_this$node = this.node) != null && _this$node.loc);
    }
    function isGenerated() {
      return !this.isUser();
    }
    function isPure(constantsOnly) {
      return this.scope.isPure(this.node, constantsOnly);
    }
    function isFlow() {
      const {
        node
      } = this;
      if (nodeIsFlow(node)) {
        return true;
      } else if (isImportDeclaration(node)) {
        return node.importKind === "type" || node.importKind === "typeof";
      } else if (isExportDeclaration(node)) {
        return node.exportKind === "type";
      } else if (isImportSpecifier(node)) {
        return node.importKind === "type" || node.importKind === "typeof";
      } else {
        return false;
      }
    }
    function isRestProperty() {
      var _this$parentPath;
      return nodeIsRestElement(this.node) && ((_this$parentPath = this.parentPath) == null ? void 0 : _this$parentPath.isObjectPattern());
    }
    function isSpreadProperty() {
      var _this$parentPath2;
      return nodeIsRestElement(this.node) && ((_this$parentPath2 = this.parentPath) == null ? void 0 : _this$parentPath2.isObjectExpression());
    }
    function isForAwaitStatement() {
      return isForOfStatement(this.node, {
        await: true
      });
    }
    exports2.isExistentialTypeParam = function isExistentialTypeParam() {
      throw new Error("`path.isExistentialTypeParam` has been renamed to `path.isExistsTypeAnnotation()` in Babel 7.");
    };
    exports2.isNumericLiteralTypeAnnotation = function isNumericLiteralTypeAnnotation() {
      throw new Error("`path.isNumericLiteralTypeAnnotation()` has been renamed to `path.isNumberLiteralTypeAnnotation()` in Babel 7.");
    };
  }
});

// node_modules/@babel/traverse/lib/visitors.js
var require_visitors = __commonJS({
  "node_modules/@babel/traverse/lib/visitors.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.environmentVisitor = environmentVisitor;
    exports2.explode = explode$1;
    exports2.isExplodedVisitor = isExplodedVisitor;
    exports2.merge = merge;
    exports2.verify = verify$1;
    var virtualTypes = require_virtual_types();
    var virtualTypesValidators = require_virtual_types_validator();
    var _t = require_lib3();
    var _context = require_context2();
    var {
      DEPRECATED_KEYS,
      DEPRECATED_ALIASES,
      FLIPPED_ALIAS_KEYS,
      TYPES,
      __internal__deprecationWarning: deprecationWarning
    } = _t;
    function isVirtualType(type) {
      return type in virtualTypes;
    }
    function isExplodedVisitor(visitor) {
      return visitor == null ? void 0 : visitor._exploded;
    }
    function explode$1(visitor) {
      if (isExplodedVisitor(visitor)) return visitor;
      visitor._exploded = true;
      for (const nodeType of Object.keys(visitor)) {
        if (shouldIgnoreKey(nodeType)) continue;
        const parts = nodeType.split("|");
        if (parts.length === 1) continue;
        const fns = visitor[nodeType];
        delete visitor[nodeType];
        for (const part of parts) {
          visitor[part] = fns;
        }
      }
      verify$1(visitor);
      delete visitor.__esModule;
      ensureEntranceObjects(visitor);
      ensureCallbackArrays(visitor);
      for (const nodeType of Object.keys(visitor)) {
        if (shouldIgnoreKey(nodeType)) continue;
        if (!isVirtualType(nodeType)) continue;
        const fns = visitor[nodeType];
        for (const type of Object.keys(fns)) {
          fns[type] = wrapCheck(nodeType, fns[type]);
        }
        delete visitor[nodeType];
        const types2 = virtualTypes[nodeType];
        if (types2 !== null) {
          for (const type of types2) {
            var _visitor$type;
            (_visitor$type = visitor[type]) != null ? _visitor$type : visitor[type] = {};
            mergePair(visitor[type], fns);
          }
        } else {
          mergePair(visitor, fns);
        }
      }
      for (const nodeType of Object.keys(visitor)) {
        if (shouldIgnoreKey(nodeType)) continue;
        let aliases = FLIPPED_ALIAS_KEYS[nodeType];
        if (nodeType in DEPRECATED_KEYS) {
          const deprecatedKey = DEPRECATED_KEYS[nodeType];
          deprecationWarning(nodeType, deprecatedKey, "Visitor ");
          aliases = [deprecatedKey];
        } else if (nodeType in DEPRECATED_ALIASES) {
          const deprecatedAlias = DEPRECATED_ALIASES[nodeType];
          deprecationWarning(nodeType, deprecatedAlias, "Visitor ");
          aliases = FLIPPED_ALIAS_KEYS[deprecatedAlias];
        }
        if (!aliases) continue;
        const fns = visitor[nodeType];
        delete visitor[nodeType];
        for (const alias of aliases) {
          const existing = visitor[alias];
          if (existing) {
            mergePair(existing, fns);
          } else {
            visitor[alias] = Object.assign({}, fns);
          }
        }
      }
      for (const nodeType of Object.keys(visitor)) {
        if (shouldIgnoreKey(nodeType)) continue;
        ensureCallbackArrays(visitor[nodeType]);
      }
      return visitor;
    }
    function verify$1(visitor) {
      if (visitor._verified) return;
      if (typeof visitor === "function") {
        throw new Error("You passed `traverse()` a function when it expected a visitor object, are you sure you didn't mean `{ enter: Function }`?");
      }
      for (const nodeType of Object.keys(visitor)) {
        if (nodeType === "enter" || nodeType === "exit") {
          validateVisitorMethods(nodeType, visitor[nodeType]);
        }
        if (shouldIgnoreKey(nodeType)) continue;
        if (!TYPES.includes(nodeType)) {
          throw new Error(`You gave us a visitor for the node type ${nodeType} but it's not a valid type in @babel/traverse ${"7.29.0"}`);
        }
        const visitors = visitor[nodeType];
        if (typeof visitors === "object") {
          for (const visitorKey of Object.keys(visitors)) {
            if (visitorKey === "enter" || visitorKey === "exit") {
              validateVisitorMethods(`${nodeType}.${visitorKey}`, visitors[visitorKey]);
            } else {
              throw new Error(`You passed \`traverse()\` a visitor object with the property ${nodeType} that has the invalid property ${visitorKey}`);
            }
          }
        }
      }
      visitor._verified = true;
    }
    function validateVisitorMethods(path, val) {
      const fns = [].concat(val);
      for (const fn of fns) {
        if (typeof fn !== "function") {
          throw new TypeError(`Non-function found defined in ${path} with type ${typeof fn}`);
        }
      }
    }
    function merge(visitors, states = [], wrapper) {
      const mergedVisitor = {
        _verified: true,
        _exploded: true
      };
      Object.defineProperty(mergedVisitor, "_exploded", {
        enumerable: false
      });
      Object.defineProperty(mergedVisitor, "_verified", {
        enumerable: false
      });
      for (let i = 0; i < visitors.length; i++) {
        const visitor = explode$1(visitors[i]);
        const state = states[i];
        let topVisitor = visitor;
        if (state || wrapper) {
          topVisitor = wrapWithStateOrWrapper(topVisitor, state, wrapper);
        }
        mergePair(mergedVisitor, topVisitor);
        for (const key of Object.keys(visitor)) {
          if (shouldIgnoreKey(key)) continue;
          let typeVisitor = visitor[key];
          if (state || wrapper) {
            typeVisitor = wrapWithStateOrWrapper(typeVisitor, state, wrapper);
          }
          const nodeVisitor = mergedVisitor[key] || (mergedVisitor[key] = {});
          mergePair(nodeVisitor, typeVisitor);
        }
      }
      return mergedVisitor;
    }
    function wrapWithStateOrWrapper(oldVisitor, state, wrapper) {
      const newVisitor = {};
      for (const phase of ["enter", "exit"]) {
        let fns = oldVisitor[phase];
        if (!Array.isArray(fns)) continue;
        fns = fns.map(function(fn) {
          let newFn = fn;
          if (state) {
            newFn = function(path) {
              fn.call(state, path, state);
            };
          }
          if (wrapper) {
            newFn = wrapper(state == null ? void 0 : state.key, phase, newFn);
          }
          if (newFn !== fn) {
            newFn.toString = () => fn.toString();
          }
          return newFn;
        });
        newVisitor[phase] = fns;
      }
      return newVisitor;
    }
    function ensureEntranceObjects(obj) {
      for (const key of Object.keys(obj)) {
        if (shouldIgnoreKey(key)) continue;
        const fns = obj[key];
        if (typeof fns === "function") {
          obj[key] = {
            enter: fns
          };
        }
      }
    }
    function ensureCallbackArrays(obj) {
      if (obj.enter && !Array.isArray(obj.enter)) obj.enter = [obj.enter];
      if (obj.exit && !Array.isArray(obj.exit)) obj.exit = [obj.exit];
    }
    function wrapCheck(nodeType, fn) {
      const fnKey = `is${nodeType}`;
      const validator = virtualTypesValidators[fnKey];
      const newFn = function(path) {
        if (validator.call(path)) {
          return fn.apply(this, arguments);
        }
      };
      newFn.toString = () => fn.toString();
      return newFn;
    }
    function shouldIgnoreKey(key) {
      if (key.startsWith("_")) return true;
      if (key === "enter" || key === "exit" || key === "shouldSkip") return true;
      if (key === "denylist" || key === "noScope" || key === "skipKeys") {
        return true;
      }
      if (key === "blacklist") {
        return true;
      }
      return false;
    }
    function mergePair(dest, src) {
      for (const phase of ["enter", "exit"]) {
        if (!src[phase]) continue;
        dest[phase] = [].concat(dest[phase] || [], src[phase]);
      }
    }
    var _environmentVisitor = {
      FunctionParent(path) {
        if (path.isArrowFunctionExpression()) return;
        path.skip();
        if (path.isMethod()) {
          if (!path.requeueComputedKeyAndDecorators) {
            _context.requeueComputedKeyAndDecorators.call(path);
          } else {
            path.requeueComputedKeyAndDecorators();
          }
        }
      },
      Property(path) {
        if (path.isObjectProperty()) return;
        path.skip();
        if (!path.requeueComputedKeyAndDecorators) {
          _context.requeueComputedKeyAndDecorators.call(path);
        } else {
          path.requeueComputedKeyAndDecorators();
        }
      }
    };
    function environmentVisitor(visitor) {
      return merge([_environmentVisitor, visitor]);
    }
  }
});

// node_modules/@babel/traverse/lib/scope/lib/renamer.js
var require_renamer = __commonJS({
  "node_modules/@babel/traverse/lib/scope/lib/renamer.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = void 0;
    var t = require_lib3();
    var _t = t;
    var _traverseNode = require_traverse_node();
    var _visitors = require_visitors();
    var _context = require_context2();
    var {
      getAssignmentIdentifiers
    } = _t;
    var renameVisitor = {
      ReferencedIdentifier({
        node
      }, state) {
        if (node.name === state.oldName) {
          node.name = state.newName;
        }
      },
      Scope(path, state) {
        if (!path.scope.bindingIdentifierEquals(state.oldName, state.binding.identifier)) {
          path.skip();
          if (path.isMethod()) {
            if (!path.requeueComputedKeyAndDecorators) {
              _context.requeueComputedKeyAndDecorators.call(path);
            } else {
              path.requeueComputedKeyAndDecorators();
            }
          }
          if (path.isSwitchStatement()) {
            path.context.maybeQueue(path.get("discriminant"));
          }
        }
      },
      ObjectProperty({
        node,
        scope
      }, state) {
        const {
          name
        } = node.key;
        if (node.shorthand && (name === state.oldName || name === state.newName) && scope.getBindingIdentifier(name) === state.binding.identifier) {
          var _node$extra;
          node.shorthand = false;
          if ((_node$extra = node.extra) != null && _node$extra.shorthand) node.extra.shorthand = false;
        }
      },
      "AssignmentExpression|Declaration|VariableDeclarator"(path, state) {
        if (path.isVariableDeclaration()) return;
        const ids = path.isAssignmentExpression() ? getAssignmentIdentifiers(path.node) : path.getOuterBindingIdentifiers();
        for (const name in ids) {
          if (name === state.oldName) ids[name].name = state.newName;
        }
      }
    };
    var Renamer = class {
      constructor(binding, oldName, newName) {
        this.newName = newName;
        this.oldName = oldName;
        this.binding = binding;
      }
      maybeConvertFromExportDeclaration(parentDeclar) {
        const maybeExportDeclar = parentDeclar.parentPath;
        if (!maybeExportDeclar.isExportDeclaration()) {
          return;
        }
        if (maybeExportDeclar.isExportDefaultDeclaration()) {
          const {
            declaration
          } = maybeExportDeclar.node;
          if (t.isDeclaration(declaration) && !declaration.id) {
            return;
          }
        }
        if (maybeExportDeclar.isExportAllDeclaration()) {
          return;
        }
        maybeExportDeclar.splitExportDeclaration();
      }
      maybeConvertFromClassFunctionDeclaration(path) {
        return path;
      }
      maybeConvertFromClassFunctionExpression(path) {
        return path;
      }
      rename() {
        const {
          binding,
          oldName,
          newName
        } = this;
        const {
          scope,
          path
        } = binding;
        const parentDeclar = path.find((path2) => path2.isDeclaration() || path2.isFunctionExpression() || path2.isClassExpression());
        if (parentDeclar) {
          const bindingIds = parentDeclar.getOuterBindingIdentifiers();
          if (bindingIds[oldName] === binding.identifier) {
            this.maybeConvertFromExportDeclaration(parentDeclar);
          }
        }
        const blockToTraverse = arguments[0] || scope.block;
        const skipKeys = {
          discriminant: true
        };
        if (t.isMethod(blockToTraverse)) {
          if (blockToTraverse.computed) {
            skipKeys.key = true;
          }
          if (!t.isObjectMethod(blockToTraverse)) {
            skipKeys.decorators = true;
          }
        }
        (0, _traverseNode.traverseNode)(blockToTraverse, (0, _visitors.explode)(renameVisitor), scope, this, scope.path, skipKeys);
        if (!arguments[0]) {
          scope.removeOwnBinding(oldName);
          scope.bindings[newName] = binding;
          this.binding.identifier.name = newName;
        }
        if (parentDeclar) {
          this.maybeConvertFromClassFunctionDeclaration(path);
          this.maybeConvertFromClassFunctionExpression(path);
        }
      }
    };
    exports2.default = Renamer;
  }
});

// node_modules/@babel/traverse/lib/scope/traverseForScope.js
var require_traverseForScope = __commonJS({
  "node_modules/@babel/traverse/lib/scope/traverseForScope.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = traverseForScope;
    var _t = require_lib3();
    var _index = require_lib9();
    var _visitors = require_visitors();
    var _context = require_context2();
    var {
      VISITOR_KEYS
    } = _t;
    function traverseForScope(path, visitors, state) {
      const exploded = (0, _visitors.explode)(visitors);
      if (exploded.enter || exploded.exit) {
        throw new Error("Should not be used with enter/exit visitors.");
      }
      _traverse(path.parentPath, path.parent, path.node, path.container, path.key, path.listKey, path.hub, path);
      function _traverse(parentPath, parent, node, container, key, listKey, hub, inPath) {
        if (!node) {
          return;
        }
        const path2 = inPath || _index.NodePath.get({
          hub,
          parentPath,
          parent,
          container,
          listKey,
          key
        });
        _context._forceSetScope.call(path2);
        const visitor = exploded[node.type];
        if (visitor != null && visitor.enter) {
          for (const visit of visitor.enter) {
            visit.call(state, path2, state);
          }
        }
        if (path2.shouldSkip) {
          return;
        }
        const keys = VISITOR_KEYS[node.type];
        if (!(keys != null && keys.length)) {
          return;
        }
        for (const key2 of keys) {
          const prop = node[key2];
          if (!prop) continue;
          if (Array.isArray(prop)) {
            for (let i = 0; i < prop.length; i++) {
              const value2 = prop[i];
              _traverse(path2, node, value2, prop, i, key2);
            }
          } else {
            _traverse(path2, node, prop, node, key2, null);
          }
        }
        if (visitor != null && visitor.exit) {
          for (const visit of visitor.exit) {
            visit.call(state, path2, state);
          }
        }
      }
    }
  }
});

// node_modules/@babel/traverse/lib/scope/binding.js
var require_binding = __commonJS({
  "node_modules/@babel/traverse/lib/scope/binding.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = void 0;
    var Binding = class {
      constructor({
        identifier,
        scope,
        path,
        kind
      }) {
        this.identifier = void 0;
        this.scope = void 0;
        this.path = void 0;
        this.kind = void 0;
        this.constantViolations = [];
        this.constant = true;
        this.referencePaths = [];
        this.referenced = false;
        this.references = 0;
        this.identifier = identifier;
        this.scope = scope;
        this.path = path;
        this.kind = kind;
        if ((kind === "var" || kind === "hoisted") && isInitInLoop(path)) {
          this.reassign(path);
        }
        this.clearValue();
      }
      deoptValue() {
        this.clearValue();
        this.hasDeoptedValue = true;
      }
      setValue(value2) {
        if (this.hasDeoptedValue) return;
        this.hasValue = true;
        this.value = value2;
      }
      clearValue() {
        this.hasDeoptedValue = false;
        this.hasValue = false;
        this.value = null;
      }
      reassign(path) {
        this.constant = false;
        if (this.constantViolations.includes(path)) {
          return;
        }
        this.constantViolations.push(path);
      }
      reference(path) {
        if (this.referencePaths.includes(path)) {
          return;
        }
        this.referenced = true;
        this.references++;
        this.referencePaths.push(path);
      }
      dereference() {
        this.references--;
        this.referenced = !!this.references;
      }
    };
    exports2.default = Binding;
    function isInitInLoop(path) {
      const isFunctionDeclarationOrHasInit = !path.isVariableDeclarator() || path.node.init;
      for (let {
        parentPath,
        key
      } = path; parentPath; {
        parentPath,
        key
      } = parentPath) {
        if (parentPath.isFunctionParent()) return false;
        if (key === "left" && parentPath.isForXStatement() || isFunctionDeclarationOrHasInit && key === "body" && parentPath.isLoop()) {
          return true;
        }
      }
      return false;
    }
  }
});

// node_modules/@babel/traverse/lib/cache.js
var require_cache = __commonJS({
  "node_modules/@babel/traverse/lib/cache.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.clear = clear;
    exports2.clearPath = clearPath;
    exports2.clearScope = clearScope;
    exports2.getCachedPaths = getCachedPaths;
    exports2.getOrCreateCachedPaths = getOrCreateCachedPaths;
    exports2.scope = exports2.path = void 0;
    var pathsCache = exports2.path = /* @__PURE__ */ new WeakMap();
    var scope = exports2.scope = /* @__PURE__ */ new WeakMap();
    function clear() {
      clearPath();
      clearScope();
    }
    function clearPath() {
      exports2.path = pathsCache = /* @__PURE__ */ new WeakMap();
    }
    function clearScope() {
      exports2.scope = scope = /* @__PURE__ */ new WeakMap();
    }
    function getCachedPaths(path) {
      const {
        parent,
        parentPath
      } = path;
      return pathsCache.get(parent);
    }
    function getOrCreateCachedPaths(node, parentPath) {
      let paths = pathsCache.get(node);
      if (!paths) pathsCache.set(node, paths = /* @__PURE__ */ new Map());
      return paths;
    }
  }
});

// node_modules/@babel/helper-globals/data/builtin-lower.json
var require_builtin_lower = __commonJS({
  "node_modules/@babel/helper-globals/data/builtin-lower.json"(exports2, module2) {
    module2.exports = [
      "decodeURI",
      "decodeURIComponent",
      "encodeURI",
      "encodeURIComponent",
      "escape",
      "eval",
      "globalThis",
      "isFinite",
      "isNaN",
      "parseFloat",
      "parseInt",
      "undefined",
      "unescape"
    ];
  }
});

// node_modules/@babel/helper-globals/data/builtin-upper.json
var require_builtin_upper = __commonJS({
  "node_modules/@babel/helper-globals/data/builtin-upper.json"(exports2, module2) {
    module2.exports = [
      "AggregateError",
      "Array",
      "ArrayBuffer",
      "Atomics",
      "BigInt",
      "BigInt64Array",
      "BigUint64Array",
      "Boolean",
      "DataView",
      "Date",
      "Error",
      "EvalError",
      "FinalizationRegistry",
      "Float16Array",
      "Float32Array",
      "Float64Array",
      "Function",
      "Infinity",
      "Int16Array",
      "Int32Array",
      "Int8Array",
      "Intl",
      "Iterator",
      "JSON",
      "Map",
      "Math",
      "NaN",
      "Number",
      "Object",
      "Promise",
      "Proxy",
      "RangeError",
      "ReferenceError",
      "Reflect",
      "RegExp",
      "Set",
      "SharedArrayBuffer",
      "String",
      "Symbol",
      "SyntaxError",
      "TypeError",
      "Uint16Array",
      "Uint32Array",
      "Uint8Array",
      "Uint8ClampedArray",
      "URIError",
      "WeakMap",
      "WeakRef",
      "WeakSet"
    ];
  }
});

// node_modules/@babel/traverse/lib/scope/index.js
var require_scope = __commonJS({
  "node_modules/@babel/traverse/lib/scope/index.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = void 0;
    var _renamer = require_renamer();
    var _index = require_lib9();
    var _traverseForScope = require_traverseForScope();
    var _binding = require_binding();
    var _t = require_lib3();
    var t = _t;
    var _cache = require_cache();
    var globalsBuiltinLower = require_builtin_lower();
    var globalsBuiltinUpper = require_builtin_upper();
    var {
      assignmentExpression,
      callExpression,
      cloneNode,
      getBindingIdentifiers,
      identifier,
      isArrayExpression,
      isBinary,
      isCallExpression,
      isClass,
      isClassBody,
      isClassDeclaration,
      isExportAllDeclaration,
      isExportDefaultDeclaration,
      isExportNamedDeclaration,
      isFunctionDeclaration,
      isIdentifier,
      isImportDeclaration,
      isLiteral,
      isMemberExpression,
      isMethod,
      isModuleSpecifier,
      isNullLiteral,
      isObjectExpression,
      isProperty,
      isPureish,
      isRegExpLiteral,
      isSuper,
      isTaggedTemplateExpression,
      isTemplateLiteral,
      isThisExpression,
      isUnaryExpression,
      isVariableDeclaration,
      expressionStatement,
      matchesPattern,
      memberExpression,
      numericLiteral,
      toIdentifier,
      variableDeclaration,
      variableDeclarator,
      isObjectProperty,
      isTopicReference,
      isMetaProperty,
      isPrivateName,
      isExportDeclaration,
      buildUndefinedNode,
      sequenceExpression
    } = _t;
    function gatherNodeParts(node, parts) {
      switch (node == null ? void 0 : node.type) {
        default:
          if (isImportDeclaration(node) || isExportDeclaration(node)) {
            var _node$specifiers;
            if ((isExportAllDeclaration(node) || isExportNamedDeclaration(node) || isImportDeclaration(node)) && node.source) {
              gatherNodeParts(node.source, parts);
            } else if ((isExportNamedDeclaration(node) || isImportDeclaration(node)) && (_node$specifiers = node.specifiers) != null && _node$specifiers.length) {
              for (const e of node.specifiers) gatherNodeParts(e, parts);
            } else if ((isExportDefaultDeclaration(node) || isExportNamedDeclaration(node)) && node.declaration) {
              gatherNodeParts(node.declaration, parts);
            }
          } else if (isModuleSpecifier(node)) {
            gatherNodeParts(node.local, parts);
          } else if (isLiteral(node) && !isNullLiteral(node) && !isRegExpLiteral(node) && !isTemplateLiteral(node)) {
            parts.push(node.value);
          }
          break;
        case "MemberExpression":
        case "OptionalMemberExpression":
        case "JSXMemberExpression":
          gatherNodeParts(node.object, parts);
          gatherNodeParts(node.property, parts);
          break;
        case "Identifier":
        case "JSXIdentifier":
          parts.push(node.name);
          break;
        case "CallExpression":
        case "OptionalCallExpression":
        case "NewExpression":
          gatherNodeParts(node.callee, parts);
          break;
        case "ObjectExpression":
        case "ObjectPattern":
          for (const e of node.properties) {
            gatherNodeParts(e, parts);
          }
          break;
        case "SpreadElement":
        case "RestElement":
          gatherNodeParts(node.argument, parts);
          break;
        case "ObjectProperty":
        case "ObjectMethod":
        case "ClassProperty":
        case "ClassMethod":
        case "ClassPrivateProperty":
        case "ClassPrivateMethod":
          gatherNodeParts(node.key, parts);
          break;
        case "ThisExpression":
          parts.push("this");
          break;
        case "Super":
          parts.push("super");
          break;
        case "Import":
        case "ImportExpression":
          parts.push("import");
          break;
        case "DoExpression":
          parts.push("do");
          break;
        case "YieldExpression":
          parts.push("yield");
          gatherNodeParts(node.argument, parts);
          break;
        case "AwaitExpression":
          parts.push("await");
          gatherNodeParts(node.argument, parts);
          break;
        case "AssignmentExpression":
          gatherNodeParts(node.left, parts);
          break;
        case "VariableDeclarator":
          gatherNodeParts(node.id, parts);
          break;
        case "FunctionExpression":
        case "FunctionDeclaration":
        case "ClassExpression":
        case "ClassDeclaration":
          gatherNodeParts(node.id, parts);
          break;
        case "PrivateName":
          gatherNodeParts(node.id, parts);
          break;
        case "ParenthesizedExpression":
          gatherNodeParts(node.expression, parts);
          break;
        case "UnaryExpression":
        case "UpdateExpression":
          gatherNodeParts(node.argument, parts);
          break;
        case "MetaProperty":
          gatherNodeParts(node.meta, parts);
          gatherNodeParts(node.property, parts);
          break;
        case "JSXElement":
          gatherNodeParts(node.openingElement, parts);
          break;
        case "JSXOpeningElement":
          gatherNodeParts(node.name, parts);
          break;
        case "JSXFragment":
          gatherNodeParts(node.openingFragment, parts);
          break;
        case "JSXOpeningFragment":
          parts.push("Fragment");
          break;
        case "JSXNamespacedName":
          gatherNodeParts(node.namespace, parts);
          gatherNodeParts(node.name, parts);
          break;
      }
    }
    function resetScope(scope) {
      scope.references = /* @__PURE__ */ Object.create(null);
      scope.uids = /* @__PURE__ */ Object.create(null);
      scope.bindings = /* @__PURE__ */ Object.create(null);
      scope.globals = /* @__PURE__ */ Object.create(null);
    }
    function isAnonymousFunctionExpression(path) {
      return path.isFunctionExpression() && !path.node.id || path.isArrowFunctionExpression();
    }
    var NOT_LOCAL_BINDING = Symbol.for("should not be considered a local binding");
    var collectorVisitor = {
      ForStatement(path) {
        const declar = path.get("init");
        if (declar.isVar()) {
          const {
            scope
          } = path;
          const parentScope = scope.getFunctionParent() || scope.getProgramParent();
          parentScope.registerBinding("var", declar);
        }
      },
      Declaration(path) {
        if (path.isBlockScoped()) return;
        if (path.isImportDeclaration()) return;
        if (path.isExportDeclaration()) return;
        const parent = path.scope.getFunctionParent() || path.scope.getProgramParent();
        parent.registerDeclaration(path);
      },
      ImportDeclaration(path) {
        const parent = path.scope.getBlockParent();
        parent.registerDeclaration(path);
      },
      TSImportEqualsDeclaration(path) {
        const parent = path.scope.getBlockParent();
        parent.registerDeclaration(path);
      },
      ReferencedIdentifier(path, state) {
        if (t.isTSQualifiedName(path.parent) && path.parent.right === path.node) {
          return;
        }
        if (path.parentPath.isTSImportEqualsDeclaration()) return;
        state.references.push(path);
      },
      ForXStatement(path, state) {
        const left = path.get("left");
        if (left.isPattern() || left.isIdentifier()) {
          state.constantViolations.push(path);
        } else if (left.isVar()) {
          const {
            scope
          } = path;
          const parentScope = scope.getFunctionParent() || scope.getProgramParent();
          parentScope.registerBinding("var", left);
        }
      },
      ExportDeclaration: {
        exit(path) {
          const {
            node,
            scope
          } = path;
          if (isExportAllDeclaration(node)) return;
          const declar = node.declaration;
          if (isClassDeclaration(declar) || isFunctionDeclaration(declar)) {
            const id = declar.id;
            if (!id) return;
            const binding = scope.getBinding(id.name);
            binding == null || binding.reference(path);
          } else if (isVariableDeclaration(declar)) {
            for (const decl of declar.declarations) {
              for (const name of Object.keys(getBindingIdentifiers(decl))) {
                const binding = scope.getBinding(name);
                binding == null || binding.reference(path);
              }
            }
          }
        }
      },
      LabeledStatement(path) {
        path.scope.getBlockParent().registerDeclaration(path);
      },
      AssignmentExpression(path, state) {
        state.assignments.push(path);
      },
      UpdateExpression(path, state) {
        state.constantViolations.push(path);
      },
      UnaryExpression(path, state) {
        if (path.node.operator === "delete") {
          state.constantViolations.push(path);
        }
      },
      BlockScoped(path) {
        let scope = path.scope;
        if (scope.path === path) scope = scope.parent;
        const parent = scope.getBlockParent();
        parent.registerDeclaration(path);
        if (path.isClassDeclaration() && path.node.id) {
          const id = path.node.id;
          const name = id.name;
          path.scope.bindings[name] = path.scope.parent.getBinding(name);
        }
      },
      CatchClause(path) {
        path.scope.registerBinding("let", path);
      },
      Function(path) {
        const params = path.get("params");
        for (const param of params) {
          path.scope.registerBinding("param", param);
        }
        if (path.isFunctionExpression() && path.node.id && !path.node.id[NOT_LOCAL_BINDING]) {
          path.scope.registerBinding("local", path.get("id"), path);
        }
      },
      ClassExpression(path) {
        if (path.node.id && !path.node.id[NOT_LOCAL_BINDING]) {
          path.scope.registerBinding("local", path.get("id"), path);
        }
      },
      TSTypeAnnotation(path) {
        path.skip();
      }
    };
    var scopeVisitor;
    var uid = 0;
    var Scope = class _Scope {
      constructor(path) {
        this.uid = void 0;
        this.path = void 0;
        this.block = void 0;
        this.inited = void 0;
        this.labels = void 0;
        this.bindings = void 0;
        this.referencesSet = void 0;
        this.globals = void 0;
        this.uidsSet = void 0;
        this.data = void 0;
        this.crawling = void 0;
        const {
          node
        } = path;
        const cached = _cache.scope.get(node);
        if ((cached == null ? void 0 : cached.path) === path) {
          return cached;
        }
        _cache.scope.set(node, this);
        this.uid = uid++;
        this.block = node;
        this.path = path;
        this.labels = /* @__PURE__ */ new Map();
        this.inited = false;
        Object.defineProperties(this, {
          references: {
            enumerable: true,
            configurable: true,
            writable: true,
            value: /* @__PURE__ */ Object.create(null)
          },
          uids: {
            enumerable: true,
            configurable: true,
            writable: true,
            value: /* @__PURE__ */ Object.create(null)
          }
        });
      }
      get parent() {
        var _parent;
        let parent, path = this.path;
        do {
          var _path;
          const shouldSkip = path.key === "key" || path.listKey === "decorators";
          path = path.parentPath;
          if (shouldSkip && path.isMethod()) path = path.parentPath;
          if ((_path = path) != null && _path.isScope()) parent = path;
        } while (path && !parent);
        return (_parent = parent) == null ? void 0 : _parent.scope;
      }
      get references() {
        throw new Error("Scope#references is not available in Babel 8. Use Scope#referencesSet instead.");
      }
      get uids() {
        throw new Error("Scope#uids is not available in Babel 8. Use Scope#uidsSet instead.");
      }
      generateDeclaredUidIdentifier(name) {
        const id = this.generateUidIdentifier(name);
        this.push({
          id
        });
        return cloneNode(id);
      }
      generateUidIdentifier(name) {
        return identifier(this.generateUid(name));
      }
      generateUid(name = "temp") {
        name = toIdentifier(name).replace(/^_+/, "").replace(/\d+$/g, "");
        let uid2;
        let i = 0;
        do {
          uid2 = `_${name}`;
          if (i >= 11) uid2 += i - 1;
          else if (i >= 9) uid2 += i - 9;
          else if (i >= 1) uid2 += i + 1;
          i++;
        } while (this.hasLabel(uid2) || this.hasBinding(uid2) || this.hasGlobal(uid2) || this.hasReference(uid2));
        const program = this.getProgramParent();
        program.references[uid2] = true;
        program.uids[uid2] = true;
        return uid2;
      }
      generateUidBasedOnNode(node, defaultName) {
        const parts = [];
        gatherNodeParts(node, parts);
        let id = parts.join("$");
        id = id.replace(/^_/, "") || defaultName || "ref";
        return this.generateUid(id.slice(0, 20));
      }
      generateUidIdentifierBasedOnNode(node, defaultName) {
        return identifier(this.generateUidBasedOnNode(node, defaultName));
      }
      isStatic(node) {
        if (isThisExpression(node) || isSuper(node) || isTopicReference(node)) {
          return true;
        }
        if (isIdentifier(node)) {
          const binding = this.getBinding(node.name);
          if (binding) {
            return binding.constant;
          } else {
            return this.hasBinding(node.name);
          }
        }
        return false;
      }
      maybeGenerateMemoised(node, dontPush) {
        if (this.isStatic(node)) {
          return null;
        } else {
          const id = this.generateUidIdentifierBasedOnNode(node);
          if (!dontPush) {
            this.push({
              id
            });
            return cloneNode(id);
          }
          return id;
        }
      }
      checkBlockScopedCollisions(local, kind, name, id) {
        if (kind === "param") return;
        if (local.kind === "local") return;
        const duplicate = kind === "let" || local.kind === "let" || local.kind === "const" || local.kind === "module" || local.kind === "param" && kind === "const";
        if (duplicate) {
          throw this.path.hub.buildError(id, `Duplicate declaration "${name}"`, TypeError);
        }
      }
      rename(oldName, newName) {
        const binding = this.getBinding(oldName);
        if (binding) {
          newName || (newName = this.generateUidIdentifier(oldName).name);
          const renamer = new _renamer.default(binding, oldName, newName);
          renamer.rename(arguments[2]);
        }
      }
      dump() {
        const sep = "-".repeat(60);
        console.log(sep);
        let scope = this;
        do {
          console.log("#", scope.block.type);
          for (const name of Object.keys(scope.bindings)) {
            const binding = scope.bindings[name];
            console.log(" -", name, {
              constant: binding.constant,
              references: binding.references,
              violations: binding.constantViolations.length,
              kind: binding.kind
            });
          }
        } while (scope = scope.parent);
        console.log(sep);
      }
      hasLabel(name) {
        return !!this.getLabel(name);
      }
      getLabel(name) {
        return this.labels.get(name);
      }
      registerLabel(path) {
        this.labels.set(path.node.label.name, path);
      }
      registerDeclaration(path) {
        if (path.isLabeledStatement()) {
          this.registerLabel(path);
        } else if (path.isFunctionDeclaration()) {
          this.registerBinding("hoisted", path.get("id"), path);
        } else if (path.isVariableDeclaration()) {
          const declarations = path.get("declarations");
          const {
            kind
          } = path.node;
          for (const declar of declarations) {
            this.registerBinding(kind === "using" || kind === "await using" ? "const" : kind, declar);
          }
        } else if (path.isClassDeclaration()) {
          if (path.node.declare) return;
          this.registerBinding("let", path);
        } else if (path.isImportDeclaration()) {
          const isTypeDeclaration = path.node.importKind === "type" || path.node.importKind === "typeof";
          const specifiers = path.get("specifiers");
          for (const specifier of specifiers) {
            const isTypeSpecifier = isTypeDeclaration || specifier.isImportSpecifier() && (specifier.node.importKind === "type" || specifier.node.importKind === "typeof");
            this.registerBinding(isTypeSpecifier ? "unknown" : "module", specifier);
          }
        } else if (path.isExportDeclaration()) {
          const declar = path.get("declaration");
          if (declar.isClassDeclaration() || declar.isFunctionDeclaration() || declar.isVariableDeclaration()) {
            this.registerDeclaration(declar);
          }
        } else {
          this.registerBinding("unknown", path);
        }
      }
      buildUndefinedNode() {
        return buildUndefinedNode();
      }
      registerConstantViolation(path) {
        const ids = path.getAssignmentIdentifiers();
        for (const name of Object.keys(ids)) {
          var _this$getBinding;
          (_this$getBinding = this.getBinding(name)) == null || _this$getBinding.reassign(path);
        }
      }
      registerBinding(kind, path, bindingPath = path) {
        if (!kind) throw new ReferenceError("no `kind`");
        if (path.isVariableDeclaration()) {
          const declarators = path.get("declarations");
          for (const declar of declarators) {
            this.registerBinding(kind, declar);
          }
          return;
        }
        const parent = this.getProgramParent();
        const ids = path.getOuterBindingIdentifiers(true);
        for (const name of Object.keys(ids)) {
          parent.references[name] = true;
          for (const id of ids[name]) {
            const local = this.getOwnBinding(name);
            if (local) {
              if (local.identifier === id) continue;
              this.checkBlockScopedCollisions(local, kind, name, id);
            }
            if (local) {
              local.reassign(bindingPath);
            } else {
              this.bindings[name] = new _binding.default({
                identifier: id,
                scope: this,
                path: bindingPath,
                kind
              });
            }
          }
        }
      }
      addGlobal(node) {
        this.globals[node.name] = node;
      }
      hasUid(name) {
        let scope = this;
        do {
          if (scope.uids[name]) return true;
        } while (scope = scope.parent);
        return false;
      }
      hasGlobal(name) {
        let scope = this;
        do {
          if (scope.globals[name]) return true;
        } while (scope = scope.parent);
        return false;
      }
      hasReference(name) {
        return !!this.getProgramParent().references[name];
      }
      isPure(node, constantsOnly) {
        if (isIdentifier(node)) {
          const binding = this.getBinding(node.name);
          if (!binding) return false;
          if (constantsOnly) return binding.constant;
          return true;
        } else if (isThisExpression(node) || isMetaProperty(node) || isTopicReference(node) || isPrivateName(node)) {
          return true;
        } else if (isClass(node)) {
          var _node$decorators;
          if (node.superClass && !this.isPure(node.superClass, constantsOnly)) {
            return false;
          }
          if (((_node$decorators = node.decorators) == null ? void 0 : _node$decorators.length) > 0) {
            return false;
          }
          return this.isPure(node.body, constantsOnly);
        } else if (isClassBody(node)) {
          for (const method of node.body) {
            if (!this.isPure(method, constantsOnly)) return false;
          }
          return true;
        } else if (isBinary(node)) {
          return this.isPure(node.left, constantsOnly) && this.isPure(node.right, constantsOnly);
        } else if (isArrayExpression(node) || (node == null ? void 0 : node.type) === "TupleExpression") {
          for (const elem of node.elements) {
            if (elem !== null && !this.isPure(elem, constantsOnly)) return false;
          }
          return true;
        } else if (isObjectExpression(node) || (node == null ? void 0 : node.type) === "RecordExpression") {
          for (const prop of node.properties) {
            if (!this.isPure(prop, constantsOnly)) return false;
          }
          return true;
        } else if (isMethod(node)) {
          var _node$decorators2;
          if (node.computed && !this.isPure(node.key, constantsOnly)) return false;
          if (((_node$decorators2 = node.decorators) == null ? void 0 : _node$decorators2.length) > 0) {
            return false;
          }
          return true;
        } else if (isProperty(node)) {
          var _node$decorators3;
          if (node.computed && !this.isPure(node.key, constantsOnly)) return false;
          if (((_node$decorators3 = node.decorators) == null ? void 0 : _node$decorators3.length) > 0) {
            return false;
          }
          if (isObjectProperty(node) || node.static) {
            if (node.value !== null && !this.isPure(node.value, constantsOnly)) {
              return false;
            }
          }
          return true;
        } else if (isUnaryExpression(node)) {
          return this.isPure(node.argument, constantsOnly);
        } else if (isTemplateLiteral(node)) {
          for (const expression of node.expressions) {
            if (!this.isPure(expression, constantsOnly)) return false;
          }
          return true;
        } else if (isTaggedTemplateExpression(node)) {
          return matchesPattern(node.tag, "String.raw") && !this.hasBinding("String", {
            noGlobals: true
          }) && this.isPure(node.quasi, constantsOnly);
        } else if (isMemberExpression(node)) {
          return !node.computed && isIdentifier(node.object) && node.object.name === "Symbol" && isIdentifier(node.property) && node.property.name !== "for" && !this.hasBinding("Symbol", {
            noGlobals: true
          });
        } else if (isCallExpression(node)) {
          return matchesPattern(node.callee, "Symbol.for") && !this.hasBinding("Symbol", {
            noGlobals: true
          }) && node.arguments.length === 1 && t.isStringLiteral(node.arguments[0]);
        } else {
          return isPureish(node);
        }
      }
      setData(key, val) {
        return this.data[key] = val;
      }
      getData(key) {
        let scope = this;
        do {
          const data = scope.data[key];
          if (data != null) return data;
        } while (scope = scope.parent);
      }
      removeData(key) {
        let scope = this;
        do {
          const data = scope.data[key];
          if (data != null) scope.data[key] = null;
        } while (scope = scope.parent);
      }
      init() {
        if (!this.inited) {
          this.inited = true;
          this.crawl();
        }
      }
      crawl() {
        const path = this.path;
        resetScope(this);
        this.data = /* @__PURE__ */ Object.create(null);
        let scope = this;
        do {
          if (scope.crawling) return;
          if (scope.path.isProgram()) {
            break;
          }
        } while (scope = scope.parent);
        const programParent = scope;
        const state = {
          references: [],
          constantViolations: [],
          assignments: []
        };
        this.crawling = true;
        scopeVisitor || (scopeVisitor = _index.default.visitors.merge([{
          Scope(path2) {
            resetScope(path2.scope);
          }
        }, collectorVisitor]));
        if (path.type !== "Program") {
          const typeVisitors = scopeVisitor[path.type];
          if (typeVisitors) {
            for (const visit of typeVisitors.enter) {
              visit.call(state, path, state);
            }
          }
        }
        path.traverse(scopeVisitor, state);
        this.crawling = false;
        for (const path2 of state.assignments) {
          const ids = path2.getAssignmentIdentifiers();
          for (const name of Object.keys(ids)) {
            if (path2.scope.getBinding(name)) continue;
            programParent.addGlobal(ids[name]);
          }
          path2.scope.registerConstantViolation(path2);
        }
        for (const ref of state.references) {
          const binding = ref.scope.getBinding(ref.node.name);
          if (binding) {
            binding.reference(ref);
          } else {
            programParent.addGlobal(ref.node);
          }
        }
        for (const path2 of state.constantViolations) {
          path2.scope.registerConstantViolation(path2);
        }
      }
      push(opts) {
        let path = this.path;
        if (path.isPattern()) {
          path = this.getPatternParent().path;
        } else if (!path.isBlockStatement() && !path.isProgram()) {
          path = this.getBlockParent().path;
        }
        if (path.isSwitchStatement()) {
          path = (this.getFunctionParent() || this.getProgramParent()).path;
        }
        const {
          init,
          unique,
          kind = "var",
          id
        } = opts;
        if (!init && !unique && (kind === "var" || kind === "let") && isAnonymousFunctionExpression(path) && isCallExpression(path.parent, {
          callee: path.node
        }) && path.parent.arguments.length <= path.node.params.length && isIdentifier(id)) {
          path.pushContainer("params", id);
          path.scope.registerBinding("param", path.get("params")[path.node.params.length - 1]);
          return;
        }
        if (path.isLoop() || path.isCatchClause() || path.isFunction()) {
          path.ensureBlock();
          path = path.get("body");
        }
        const blockHoist = opts._blockHoist == null ? 2 : opts._blockHoist;
        const dataKey = `declaration:${kind}:${blockHoist}`;
        let declarPath = !unique && path.getData(dataKey);
        if (!declarPath) {
          const declar = variableDeclaration(kind, []);
          declar._blockHoist = blockHoist;
          [declarPath] = path.unshiftContainer("body", [declar]);
          if (!unique) path.setData(dataKey, declarPath);
        }
        const declarator = variableDeclarator(id, init);
        const len = declarPath.node.declarations.push(declarator);
        path.scope.registerBinding(kind, declarPath.get("declarations")[len - 1]);
      }
      getProgramParent() {
        let scope = this;
        do {
          if (scope.path.isProgram()) {
            return scope;
          }
        } while (scope = scope.parent);
        throw new Error("Couldn't find a Program");
      }
      getFunctionParent() {
        let scope = this;
        do {
          if (scope.path.isFunctionParent()) {
            return scope;
          }
        } while (scope = scope.parent);
        return null;
      }
      getBlockParent() {
        let scope = this;
        do {
          if (scope.path.isBlockParent()) {
            return scope;
          }
        } while (scope = scope.parent);
        throw new Error("We couldn't find a BlockStatement, For, Switch, Function, Loop or Program...");
      }
      getPatternParent() {
        let scope = this;
        do {
          if (!scope.path.isPattern()) {
            return scope.getBlockParent();
          }
        } while (scope = scope.parent.parent);
        throw new Error("We couldn't find a BlockStatement, For, Switch, Function, Loop or Program...");
      }
      getAllBindings() {
        const ids = /* @__PURE__ */ Object.create(null);
        let scope = this;
        do {
          for (const key of Object.keys(scope.bindings)) {
            if (key in ids === false) {
              ids[key] = scope.bindings[key];
            }
          }
          scope = scope.parent;
        } while (scope);
        return ids;
      }
      bindingIdentifierEquals(name, node) {
        return this.getBindingIdentifier(name) === node;
      }
      getBinding(name) {
        let scope = this;
        let previousPath;
        do {
          const binding = scope.getOwnBinding(name);
          if (binding) {
            var _previousPath;
            if ((_previousPath = previousPath) != null && _previousPath.isPattern() && binding.kind !== "param" && binding.kind !== "local") {
            } else {
              return binding;
            }
          } else if (!binding && name === "arguments" && scope.path.isFunction() && !scope.path.isArrowFunctionExpression()) {
            break;
          }
          previousPath = scope.path;
        } while (scope = scope.parent);
      }
      getOwnBinding(name) {
        return this.bindings[name];
      }
      getBindingIdentifier(name) {
        var _this$getBinding2;
        return (_this$getBinding2 = this.getBinding(name)) == null ? void 0 : _this$getBinding2.identifier;
      }
      getOwnBindingIdentifier(name) {
        const binding = this.bindings[name];
        return binding == null ? void 0 : binding.identifier;
      }
      hasOwnBinding(name) {
        return !!this.getOwnBinding(name);
      }
      hasBinding(name, opts) {
        if (!name) return false;
        let noGlobals;
        let noUids;
        let upToScope;
        if (typeof opts === "object") {
          noGlobals = opts.noGlobals;
          noUids = opts.noUids;
          upToScope = opts.upToScope;
        } else if (typeof opts === "boolean") {
          noGlobals = opts;
        }
        let scope = this;
        do {
          if (upToScope === scope) {
            break;
          }
          if (scope.hasOwnBinding(name)) {
            return true;
          }
        } while (scope = scope.parent);
        if (!noUids && this.hasUid(name)) return true;
        if (!noGlobals && _Scope.globals.includes(name)) return true;
        if (!noGlobals && _Scope.contextVariables.includes(name)) return true;
        return false;
      }
      parentHasBinding(name, opts) {
        var _this$parent;
        return (_this$parent = this.parent) == null ? void 0 : _this$parent.hasBinding(name, opts);
      }
      moveBindingTo(name, scope) {
        const info = this.getBinding(name);
        if (info) {
          info.scope.removeOwnBinding(name);
          info.scope = scope;
          scope.bindings[name] = info;
        }
      }
      removeOwnBinding(name) {
        delete this.bindings[name];
      }
      removeBinding(name) {
        var _this$getBinding3;
        (_this$getBinding3 = this.getBinding(name)) == null || _this$getBinding3.scope.removeOwnBinding(name);
        let scope = this;
        do {
          if (scope.uids[name]) {
            scope.uids[name] = false;
          }
        } while (scope = scope.parent);
      }
      hoistVariables(emit = (id) => this.push({
        id
      })) {
        this.crawl();
        const seen = /* @__PURE__ */ new Set();
        for (const name of Object.keys(this.bindings)) {
          const binding = this.bindings[name];
          if (!binding) continue;
          const {
            path
          } = binding;
          if (!path.isVariableDeclarator()) continue;
          const {
            parent,
            parentPath
          } = path;
          if (parent.kind !== "var" || seen.has(parent)) continue;
          seen.add(path.parent);
          let firstId;
          const init = [];
          for (const decl of parent.declarations) {
            firstId != null ? firstId : firstId = decl.id;
            if (decl.init) {
              init.push(assignmentExpression("=", decl.id, decl.init));
            }
            const ids = Object.keys(getBindingIdentifiers(decl, false, true, true));
            for (const name2 of ids) {
              emit(identifier(name2), decl.init != null);
            }
          }
          if (parentPath.parentPath.isForXStatement({
            left: parent
          })) {
            parentPath.replaceWith(firstId);
          } else if (init.length === 0) {
            parentPath.remove();
          } else {
            const expr = init.length === 1 ? init[0] : sequenceExpression(init);
            if (parentPath.parentPath.isForStatement({
              init: parent
            })) {
              parentPath.replaceWith(expr);
            } else {
              parentPath.replaceWith(expressionStatement(expr));
            }
          }
        }
      }
    };
    exports2.default = Scope;
    Scope.globals = [...globalsBuiltinLower, ...globalsBuiltinUpper];
    Scope.contextVariables = ["arguments", "undefined", "Infinity", "NaN"];
    Scope.prototype._renameFromMap = function _renameFromMap(map, oldName, newName, value2) {
      if (map[oldName]) {
        map[newName] = value2;
        map[oldName] = null;
      }
    };
    Scope.prototype.traverse = function(node, opts, state) {
      (0, _index.default)(node, opts, this, state, this.path);
    };
    Scope.prototype._generateUid = function _generateUid(name, i) {
      let id = name;
      if (i > 1) id += i;
      return `_${id}`;
    };
    Scope.prototype.toArray = function toArray(node, i, arrayLikeIsIterable) {
      if (isIdentifier(node)) {
        const binding = this.getBinding(node.name);
        if (binding != null && binding.constant && binding.path.isGenericType("Array")) {
          return node;
        }
      }
      if (isArrayExpression(node)) {
        return node;
      }
      if (isIdentifier(node, {
        name: "arguments"
      })) {
        return callExpression(memberExpression(memberExpression(memberExpression(identifier("Array"), identifier("prototype")), identifier("slice")), identifier("call")), [node]);
      }
      let helperName;
      const args = [node];
      if (i === true) {
        helperName = "toConsumableArray";
      } else if (typeof i === "number") {
        args.push(numericLiteral(i));
        helperName = "slicedToArray";
      } else {
        helperName = "toArray";
      }
      if (arrayLikeIsIterable) {
        args.unshift(this.path.hub.addHelper(helperName));
        helperName = "maybeArrayLike";
      }
      return callExpression(this.path.hub.addHelper(helperName), args);
    };
    Scope.prototype.getAllBindingsOfKind = function getAllBindingsOfKind(...kinds) {
      const ids = /* @__PURE__ */ Object.create(null);
      for (const kind of kinds) {
        let scope = this;
        do {
          for (const name of Object.keys(scope.bindings)) {
            const binding = scope.bindings[name];
            if (binding.kind === kind) ids[name] = binding;
          }
          scope = scope.parent;
        } while (scope);
      }
      return ids;
    };
    Object.defineProperties(Scope.prototype, {
      parentBlock: {
        configurable: true,
        enumerable: true,
        get() {
          return this.path.parent;
        }
      },
      hub: {
        configurable: true,
        enumerable: true,
        get() {
          return this.path.hub;
        }
      }
    });
  }
});

// node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.js
var require_sourcemap_codec_umd = __commonJS({
  "node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.js"(exports2, module2) {
    (function(global2, factory) {
      if (typeof exports2 === "object" && typeof module2 !== "undefined") {
        factory(module2);
        module2.exports = def(module2);
      } else if (typeof define === "function" && define.amd) {
        define(["module"], function(mod) {
          factory.apply(this, arguments);
          mod.exports = def(mod);
        });
      } else {
        const mod = { exports: {} };
        factory(mod);
        global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self;
        global2.sourcemapCodec = def(mod);
      }
      function def(m) {
        return "default" in m.exports ? m.exports.default : m.exports;
      }
    })(exports2, (function(module3) {
      "use strict";
      var __defProp2 = Object.defineProperty;
      var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
      var __getOwnPropNames2 = Object.getOwnPropertyNames;
      var __hasOwnProp2 = Object.prototype.hasOwnProperty;
      var __export2 = (target, all) => {
        for (var name in all)
          __defProp2(target, name, { get: all[name], enumerable: true });
      };
      var __copyProps2 = (to, from, except, desc) => {
        if (from && typeof from === "object" || typeof from === "function") {
          for (let key of __getOwnPropNames2(from))
            if (!__hasOwnProp2.call(to, key) && key !== except)
              __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
        }
        return to;
      };
      var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
      var sourcemap_codec_exports = {};
      __export2(sourcemap_codec_exports, {
        decode: () => decode,
        decodeGeneratedRanges: () => decodeGeneratedRanges,
        decodeOriginalScopes: () => decodeOriginalScopes,
        encode: () => encode,
        encodeGeneratedRanges: () => encodeGeneratedRanges,
        encodeOriginalScopes: () => encodeOriginalScopes
      });
      module3.exports = __toCommonJS2(sourcemap_codec_exports);
      var comma = ",".charCodeAt(0);
      var semicolon = ";".charCodeAt(0);
      var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
      var intToChar = new Uint8Array(64);
      var charToInt = new Uint8Array(128);
      for (let i = 0; i < chars.length; i++) {
        const c = chars.charCodeAt(i);
        intToChar[i] = c;
        charToInt[c] = i;
      }
      function decodeInteger(reader, relative) {
        let value2 = 0;
        let shift = 0;
        let integer = 0;
        do {
          const c = reader.next();
          integer = charToInt[c];
          value2 |= (integer & 31) << shift;
          shift += 5;
        } while (integer & 32);
        const shouldNegate = value2 & 1;
        value2 >>>= 1;
        if (shouldNegate) {
          value2 = -2147483648 | -value2;
        }
        return relative + value2;
      }
      function encodeInteger(builder, num, relative) {
        let delta = num - relative;
        delta = delta < 0 ? -delta << 1 | 1 : delta << 1;
        do {
          let clamped = delta & 31;
          delta >>>= 5;
          if (delta > 0) clamped |= 32;
          builder.write(intToChar[clamped]);
        } while (delta > 0);
        return num;
      }
      function hasMoreVlq(reader, max) {
        if (reader.pos >= max) return false;
        return reader.peek() !== comma;
      }
      var bufLength = 1024 * 16;
      var td = typeof TextDecoder !== "undefined" ? /* @__PURE__ */ new TextDecoder() : typeof Buffer !== "undefined" ? {
        decode(buf) {
          const out = Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength);
          return out.toString();
        }
      } : {
        decode(buf) {
          let out = "";
          for (let i = 0; i < buf.length; i++) {
            out += String.fromCharCode(buf[i]);
          }
          return out;
        }
      };
      var StringWriter = class {
        constructor() {
          this.pos = 0;
          this.out = "";
          this.buffer = new Uint8Array(bufLength);
        }
        write(v) {
          const { buffer } = this;
          buffer[this.pos++] = v;
          if (this.pos === bufLength) {
            this.out += td.decode(buffer);
            this.pos = 0;
          }
        }
        flush() {
          const { buffer, out, pos } = this;
          return pos > 0 ? out + td.decode(buffer.subarray(0, pos)) : out;
        }
      };
      var StringReader = class {
        constructor(buffer) {
          this.pos = 0;
          this.buffer = buffer;
        }
        next() {
          return this.buffer.charCodeAt(this.pos++);
        }
        peek() {
          return this.buffer.charCodeAt(this.pos);
        }
        indexOf(char) {
          const { buffer, pos } = this;
          const idx = buffer.indexOf(char, pos);
          return idx === -1 ? buffer.length : idx;
        }
      };
      var EMPTY = [];
      function decodeOriginalScopes(input) {
        const { length } = input;
        const reader = new StringReader(input);
        const scopes = [];
        const stack = [];
        let line = 0;
        for (; reader.pos < length; reader.pos++) {
          line = decodeInteger(reader, line);
          const column = decodeInteger(reader, 0);
          if (!hasMoreVlq(reader, length)) {
            const last = stack.pop();
            last[2] = line;
            last[3] = column;
            continue;
          }
          const kind = decodeInteger(reader, 0);
          const fields = decodeInteger(reader, 0);
          const hasName = fields & 1;
          const scope = hasName ? [line, column, 0, 0, kind, decodeInteger(reader, 0)] : [line, column, 0, 0, kind];
          let vars = EMPTY;
          if (hasMoreVlq(reader, length)) {
            vars = [];
            do {
              const varsIndex = decodeInteger(reader, 0);
              vars.push(varsIndex);
            } while (hasMoreVlq(reader, length));
          }
          scope.vars = vars;
          scopes.push(scope);
          stack.push(scope);
        }
        return scopes;
      }
      function encodeOriginalScopes(scopes) {
        const writer = new StringWriter();
        for (let i = 0; i < scopes.length; ) {
          i = _encodeOriginalScopes(scopes, i, writer, [0]);
        }
        return writer.flush();
      }
      function _encodeOriginalScopes(scopes, index, writer, state) {
        const scope = scopes[index];
        const { 0: startLine, 1: startColumn, 2: endLine, 3: endColumn, 4: kind, vars } = scope;
        if (index > 0) writer.write(comma);
        state[0] = encodeInteger(writer, startLine, state[0]);
        encodeInteger(writer, startColumn, 0);
        encodeInteger(writer, kind, 0);
        const fields = scope.length === 6 ? 1 : 0;
        encodeInteger(writer, fields, 0);
        if (scope.length === 6) encodeInteger(writer, scope[5], 0);
        for (const v of vars) {
          encodeInteger(writer, v, 0);
        }
        for (index++; index < scopes.length; ) {
          const next = scopes[index];
          const { 0: l, 1: c } = next;
          if (l > endLine || l === endLine && c >= endColumn) {
            break;
          }
          index = _encodeOriginalScopes(scopes, index, writer, state);
        }
        writer.write(comma);
        state[0] = encodeInteger(writer, endLine, state[0]);
        encodeInteger(writer, endColumn, 0);
        return index;
      }
      function decodeGeneratedRanges(input) {
        const { length } = input;
        const reader = new StringReader(input);
        const ranges = [];
        const stack = [];
        let genLine = 0;
        let definitionSourcesIndex = 0;
        let definitionScopeIndex = 0;
        let callsiteSourcesIndex = 0;
        let callsiteLine = 0;
        let callsiteColumn = 0;
        let bindingLine = 0;
        let bindingColumn = 0;
        do {
          const semi = reader.indexOf(";");
          let genColumn = 0;
          for (; reader.pos < semi; reader.pos++) {
            genColumn = decodeInteger(reader, genColumn);
            if (!hasMoreVlq(reader, semi)) {
              const last = stack.pop();
              last[2] = genLine;
              last[3] = genColumn;
              continue;
            }
            const fields = decodeInteger(reader, 0);
            const hasDefinition = fields & 1;
            const hasCallsite = fields & 2;
            const hasScope = fields & 4;
            let callsite = null;
            let bindings = EMPTY;
            let range;
            if (hasDefinition) {
              const defSourcesIndex = decodeInteger(reader, definitionSourcesIndex);
              definitionScopeIndex = decodeInteger(
                reader,
                definitionSourcesIndex === defSourcesIndex ? definitionScopeIndex : 0
              );
              definitionSourcesIndex = defSourcesIndex;
              range = [genLine, genColumn, 0, 0, defSourcesIndex, definitionScopeIndex];
            } else {
              range = [genLine, genColumn, 0, 0];
            }
            range.isScope = !!hasScope;
            if (hasCallsite) {
              const prevCsi = callsiteSourcesIndex;
              const prevLine = callsiteLine;
              callsiteSourcesIndex = decodeInteger(reader, callsiteSourcesIndex);
              const sameSource = prevCsi === callsiteSourcesIndex;
              callsiteLine = decodeInteger(reader, sameSource ? callsiteLine : 0);
              callsiteColumn = decodeInteger(
                reader,
                sameSource && prevLine === callsiteLine ? callsiteColumn : 0
              );
              callsite = [callsiteSourcesIndex, callsiteLine, callsiteColumn];
            }
            range.callsite = callsite;
            if (hasMoreVlq(reader, semi)) {
              bindings = [];
              do {
                bindingLine = genLine;
                bindingColumn = genColumn;
                const expressionsCount = decodeInteger(reader, 0);
                let expressionRanges;
                if (expressionsCount < -1) {
                  expressionRanges = [[decodeInteger(reader, 0)]];
                  for (let i = -1; i > expressionsCount; i--) {
                    const prevBl = bindingLine;
                    bindingLine = decodeInteger(reader, bindingLine);
                    bindingColumn = decodeInteger(reader, bindingLine === prevBl ? bindingColumn : 0);
                    const expression = decodeInteger(reader, 0);
                    expressionRanges.push([expression, bindingLine, bindingColumn]);
                  }
                } else {
                  expressionRanges = [[expressionsCount]];
                }
                bindings.push(expressionRanges);
              } while (hasMoreVlq(reader, semi));
            }
            range.bindings = bindings;
            ranges.push(range);
            stack.push(range);
          }
          genLine++;
          reader.pos = semi + 1;
        } while (reader.pos < length);
        return ranges;
      }
      function encodeGeneratedRanges(ranges) {
        if (ranges.length === 0) return "";
        const writer = new StringWriter();
        for (let i = 0; i < ranges.length; ) {
          i = _encodeGeneratedRanges(ranges, i, writer, [0, 0, 0, 0, 0, 0, 0]);
        }
        return writer.flush();
      }
      function _encodeGeneratedRanges(ranges, index, writer, state) {
        const range = ranges[index];
        const {
          0: startLine,
          1: startColumn,
          2: endLine,
          3: endColumn,
          isScope,
          callsite,
          bindings
        } = range;
        if (state[0] < startLine) {
          catchupLine(writer, state[0], startLine);
          state[0] = startLine;
          state[1] = 0;
        } else if (index > 0) {
          writer.write(comma);
        }
        state[1] = encodeInteger(writer, range[1], state[1]);
        const fields = (range.length === 6 ? 1 : 0) | (callsite ? 2 : 0) | (isScope ? 4 : 0);
        encodeInteger(writer, fields, 0);
        if (range.length === 6) {
          const { 4: sourcesIndex, 5: scopesIndex } = range;
          if (sourcesIndex !== state[2]) {
            state[3] = 0;
          }
          state[2] = encodeInteger(writer, sourcesIndex, state[2]);
          state[3] = encodeInteger(writer, scopesIndex, state[3]);
        }
        if (callsite) {
          const { 0: sourcesIndex, 1: callLine, 2: callColumn } = range.callsite;
          if (sourcesIndex !== state[4]) {
            state[5] = 0;
            state[6] = 0;
          } else if (callLine !== state[5]) {
            state[6] = 0;
          }
          state[4] = encodeInteger(writer, sourcesIndex, state[4]);
          state[5] = encodeInteger(writer, callLine, state[5]);
          state[6] = encodeInteger(writer, callColumn, state[6]);
        }
        if (bindings) {
          for (const binding of bindings) {
            if (binding.length > 1) encodeInteger(writer, -binding.length, 0);
            const expression = binding[0][0];
            encodeInteger(writer, expression, 0);
            let bindingStartLine = startLine;
            let bindingStartColumn = startColumn;
            for (let i = 1; i < binding.length; i++) {
              const expRange = binding[i];
              bindingStartLine = encodeInteger(writer, expRange[1], bindingStartLine);
              bindingStartColumn = encodeInteger(writer, expRange[2], bindingStartColumn);
              encodeInteger(writer, expRange[0], 0);
            }
          }
        }
        for (index++; index < ranges.length; ) {
          const next = ranges[index];
          const { 0: l, 1: c } = next;
          if (l > endLine || l === endLine && c >= endColumn) {
            break;
          }
          index = _encodeGeneratedRanges(ranges, index, writer, state);
        }
        if (state[0] < endLine) {
          catchupLine(writer, state[0], endLine);
          state[0] = endLine;
          state[1] = 0;
        } else {
          writer.write(comma);
        }
        state[1] = encodeInteger(writer, endColumn, state[1]);
        return index;
      }
      function catchupLine(writer, lastLine, line) {
        do {
          writer.write(semicolon);
        } while (++lastLine < line);
      }
      function decode(mappings) {
        const { length } = mappings;
        const reader = new StringReader(mappings);
        const decoded = [];
        let genColumn = 0;
        let sourcesIndex = 0;
        let sourceLine = 0;
        let sourceColumn = 0;
        let namesIndex = 0;
        do {
          const semi = reader.indexOf(";");
          const line = [];
          let sorted = true;
          let lastCol = 0;
          genColumn = 0;
          while (reader.pos < semi) {
            let seg;
            genColumn = decodeInteger(reader, genColumn);
            if (genColumn < lastCol) sorted = false;
            lastCol = genColumn;
            if (hasMoreVlq(reader, semi)) {
              sourcesIndex = decodeInteger(reader, sourcesIndex);
              sourceLine = decodeInteger(reader, sourceLine);
              sourceColumn = decodeInteger(reader, sourceColumn);
              if (hasMoreVlq(reader, semi)) {
                namesIndex = decodeInteger(reader, namesIndex);
                seg = [genColumn, sourcesIndex, sourceLine, sourceColumn, namesIndex];
              } else {
                seg = [genColumn, sourcesIndex, sourceLine, sourceColumn];
              }
            } else {
              seg = [genColumn];
            }
            line.push(seg);
            reader.pos++;
          }
          if (!sorted) sort(line);
          decoded.push(line);
          reader.pos = semi + 1;
        } while (reader.pos <= length);
        return decoded;
      }
      function sort(line) {
        line.sort(sortComparator);
      }
      function sortComparator(a, b) {
        return a[0] - b[0];
      }
      function encode(decoded) {
        const writer = new StringWriter();
        let sourcesIndex = 0;
        let sourceLine = 0;
        let sourceColumn = 0;
        let namesIndex = 0;
        for (let i = 0; i < decoded.length; i++) {
          const line = decoded[i];
          if (i > 0) writer.write(semicolon);
          if (line.length === 0) continue;
          let genColumn = 0;
          for (let j = 0; j < line.length; j++) {
            const segment = line[j];
            if (j > 0) writer.write(comma);
            genColumn = encodeInteger(writer, segment[0], genColumn);
            if (segment.length === 1) continue;
            sourcesIndex = encodeInteger(writer, segment[1], sourcesIndex);
            sourceLine = encodeInteger(writer, segment[2], sourceLine);
            sourceColumn = encodeInteger(writer, segment[3], sourceColumn);
            if (segment.length === 4) continue;
            namesIndex = encodeInteger(writer, segment[4], namesIndex);
          }
        }
        return writer.flush();
      }
    }));
  }
});

// node_modules/@jridgewell/resolve-uri/dist/resolve-uri.umd.js
var require_resolve_uri_umd = __commonJS({
  "node_modules/@jridgewell/resolve-uri/dist/resolve-uri.umd.js"(exports2, module2) {
    (function(global2, factory) {
      typeof exports2 === "object" && typeof module2 !== "undefined" ? module2.exports = factory() : typeof define === "function" && define.amd ? define(factory) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, global2.resolveURI = factory());
    })(exports2, (function() {
      "use strict";
      const schemeRegex = /^[\w+.-]+:\/\//;
      const urlRegex = /^([\w+.-]+:)\/\/([^@/#?]*@)?([^:/#?]*)(:\d+)?(\/[^#?]*)?(\?[^#]*)?(#.*)?/;
      const fileRegex = /^file:(?:\/\/((?![a-z]:)[^/#?]*)?)?(\/?[^#?]*)(\?[^#]*)?(#.*)?/i;
      function isAbsoluteUrl(input) {
        return schemeRegex.test(input);
      }
      function isSchemeRelativeUrl(input) {
        return input.startsWith("//");
      }
      function isAbsolutePath(input) {
        return input.startsWith("/");
      }
      function isFileUrl(input) {
        return input.startsWith("file:");
      }
      function isRelative(input) {
        return /^[.?#]/.test(input);
      }
      function parseAbsoluteUrl(input) {
        const match = urlRegex.exec(input);
        return makeUrl(match[1], match[2] || "", match[3], match[4] || "", match[5] || "/", match[6] || "", match[7] || "");
      }
      function parseFileUrl(input) {
        const match = fileRegex.exec(input);
        const path = match[2];
        return makeUrl("file:", "", match[1] || "", "", isAbsolutePath(path) ? path : "/" + path, match[3] || "", match[4] || "");
      }
      function makeUrl(scheme, user, host, port, path, query, hash) {
        return {
          scheme,
          user,
          host,
          port,
          path,
          query,
          hash,
          type: 7
        };
      }
      function parseUrl(input) {
        if (isSchemeRelativeUrl(input)) {
          const url2 = parseAbsoluteUrl("http:" + input);
          url2.scheme = "";
          url2.type = 6;
          return url2;
        }
        if (isAbsolutePath(input)) {
          const url2 = parseAbsoluteUrl("http://foo.com" + input);
          url2.scheme = "";
          url2.host = "";
          url2.type = 5;
          return url2;
        }
        if (isFileUrl(input))
          return parseFileUrl(input);
        if (isAbsoluteUrl(input))
          return parseAbsoluteUrl(input);
        const url = parseAbsoluteUrl("http://foo.com/" + input);
        url.scheme = "";
        url.host = "";
        url.type = input ? input.startsWith("?") ? 3 : input.startsWith("#") ? 2 : 4 : 1;
        return url;
      }
      function stripPathFilename(path) {
        if (path.endsWith("/.."))
          return path;
        const index = path.lastIndexOf("/");
        return path.slice(0, index + 1);
      }
      function mergePaths(url, base) {
        normalizePath(base, base.type);
        if (url.path === "/") {
          url.path = base.path;
        } else {
          url.path = stripPathFilename(base.path) + url.path;
        }
      }
      function normalizePath(url, type) {
        const rel = type <= 4;
        const pieces = url.path.split("/");
        let pointer = 1;
        let positive = 0;
        let addTrailingSlash = false;
        for (let i = 1; i < pieces.length; i++) {
          const piece = pieces[i];
          if (!piece) {
            addTrailingSlash = true;
            continue;
          }
          addTrailingSlash = false;
          if (piece === ".")
            continue;
          if (piece === "..") {
            if (positive) {
              addTrailingSlash = true;
              positive--;
              pointer--;
            } else if (rel) {
              pieces[pointer++] = piece;
            }
            continue;
          }
          pieces[pointer++] = piece;
          positive++;
        }
        let path = "";
        for (let i = 1; i < pointer; i++) {
          path += "/" + pieces[i];
        }
        if (!path || addTrailingSlash && !path.endsWith("/..")) {
          path += "/";
        }
        url.path = path;
      }
      function resolve(input, base) {
        if (!input && !base)
          return "";
        const url = parseUrl(input);
        let inputType = url.type;
        if (base && inputType !== 7) {
          const baseUrl = parseUrl(base);
          const baseType = baseUrl.type;
          switch (inputType) {
            case 1:
              url.hash = baseUrl.hash;
            // fall through
            case 2:
              url.query = baseUrl.query;
            // fall through
            case 3:
            case 4:
              mergePaths(url, baseUrl);
            // fall through
            case 5:
              url.user = baseUrl.user;
              url.host = baseUrl.host;
              url.port = baseUrl.port;
            // fall through
            case 6:
              url.scheme = baseUrl.scheme;
          }
          if (baseType > inputType)
            inputType = baseType;
        }
        normalizePath(url, inputType);
        const queryHash = url.query + url.hash;
        switch (inputType) {
          // This is impossible, because of the empty checks at the start of the function.
          // case UrlType.Empty:
          case 2:
          case 3:
            return queryHash;
          case 4: {
            const path = url.path.slice(1);
            if (!path)
              return queryHash || ".";
            if (isRelative(base || input) && !isRelative(path)) {
              return "./" + path + queryHash;
            }
            return path + queryHash;
          }
          case 5:
            return url.path + queryHash;
          default:
            return url.scheme + "//" + url.user + url.host + url.port + url.path + queryHash;
        }
      }
      return resolve;
    }));
  }
});

// node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js
var require_trace_mapping_umd = __commonJS({
  "node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js"(exports2, module2) {
    (function(global2, factory) {
      if (typeof exports2 === "object" && typeof module2 !== "undefined") {
        factory(module2, require_resolve_uri_umd(), require_sourcemap_codec_umd());
        module2.exports = def(module2);
      } else if (typeof define === "function" && define.amd) {
        define(["module", "@jridgewell/resolve-uri", "@jridgewell/sourcemap-codec"], function(mod) {
          factory.apply(this, arguments);
          mod.exports = def(mod);
        });
      } else {
        const mod = { exports: {} };
        factory(mod, global2.resolveURI, global2.sourcemapCodec);
        global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self;
        global2.traceMapping = def(mod);
      }
      function def(m) {
        return "default" in m.exports ? m.exports.default : m.exports;
      }
    })(exports2, (function(module3, require_resolveURI, require_sourcemapCodec) {
      "use strict";
      var __create2 = Object.create;
      var __defProp2 = Object.defineProperty;
      var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
      var __getOwnPropNames2 = Object.getOwnPropertyNames;
      var __getProtoOf2 = Object.getPrototypeOf;
      var __hasOwnProp2 = Object.prototype.hasOwnProperty;
      var __commonJS2 = (cb, mod) => function __require() {
        return mod || (0, cb[__getOwnPropNames2(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
      };
      var __export2 = (target, all) => {
        for (var name in all)
          __defProp2(target, name, { get: all[name], enumerable: true });
      };
      var __copyProps2 = (to, from, except, desc) => {
        if (from && typeof from === "object" || typeof from === "function") {
          for (let key of __getOwnPropNames2(from))
            if (!__hasOwnProp2.call(to, key) && key !== except)
              __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
        }
        return to;
      };
      var __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2(
        // If the importer is in node compatibility mode or this is not an ESM
        // file that has been converted to a CommonJS file using a Babel-
        // compatible transform (i.e. "__esModule" has not been set), then set
        // "default" to the CommonJS "module.exports" for node compatibility.
        isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: true }) : target,
        mod
      ));
      var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
      var require_sourcemap_codec = __commonJS2({
        "umd:@jridgewell/sourcemap-codec"(exports3, module22) {
          module22.exports = require_sourcemapCodec;
        }
      });
      var require_resolve_uri = __commonJS2({
        "umd:@jridgewell/resolve-uri"(exports3, module22) {
          module22.exports = require_resolveURI;
        }
      });
      var trace_mapping_exports = {};
      __export2(trace_mapping_exports, {
        AnyMap: () => FlattenMap,
        FlattenMap: () => FlattenMap,
        GREATEST_LOWER_BOUND: () => GREATEST_LOWER_BOUND,
        LEAST_UPPER_BOUND: () => LEAST_UPPER_BOUND,
        TraceMap: () => TraceMap,
        allGeneratedPositionsFor: () => allGeneratedPositionsFor,
        decodedMap: () => decodedMap,
        decodedMappings: () => decodedMappings,
        eachMapping: () => eachMapping,
        encodedMap: () => encodedMap,
        encodedMappings: () => encodedMappings,
        generatedPositionFor: () => generatedPositionFor,
        isIgnored: () => isIgnored,
        originalPositionFor: () => originalPositionFor,
        presortedDecodedMap: () => presortedDecodedMap,
        sourceContentFor: () => sourceContentFor,
        traceSegment: () => traceSegment
      });
      module3.exports = __toCommonJS2(trace_mapping_exports);
      var import_sourcemap_codec = __toESM2(require_sourcemap_codec());
      var import_resolve_uri = __toESM2(require_resolve_uri());
      function stripFilename(path) {
        if (!path) return "";
        const index = path.lastIndexOf("/");
        return path.slice(0, index + 1);
      }
      function resolver(mapUrl, sourceRoot) {
        const from = stripFilename(mapUrl);
        const prefix = sourceRoot ? sourceRoot + "/" : "";
        return (source) => (0, import_resolve_uri.default)(prefix + (source || ""), from);
      }
      var COLUMN = 0;
      var SOURCES_INDEX = 1;
      var SOURCE_LINE = 2;
      var SOURCE_COLUMN = 3;
      var NAMES_INDEX = 4;
      var REV_GENERATED_LINE = 1;
      var REV_GENERATED_COLUMN = 2;
      function maybeSort(mappings, owned) {
        const unsortedIndex = nextUnsortedSegmentLine(mappings, 0);
        if (unsortedIndex === mappings.length) return mappings;
        if (!owned) mappings = mappings.slice();
        for (let i = unsortedIndex; i < mappings.length; i = nextUnsortedSegmentLine(mappings, i + 1)) {
          mappings[i] = sortSegments(mappings[i], owned);
        }
        return mappings;
      }
      function nextUnsortedSegmentLine(mappings, start) {
        for (let i = start; i < mappings.length; i++) {
          if (!isSorted(mappings[i])) return i;
        }
        return mappings.length;
      }
      function isSorted(line) {
        for (let j = 1; j < line.length; j++) {
          if (line[j][COLUMN] < line[j - 1][COLUMN]) {
            return false;
          }
        }
        return true;
      }
      function sortSegments(line, owned) {
        if (!owned) line = line.slice();
        return line.sort(sortComparator);
      }
      function sortComparator(a, b) {
        return a[COLUMN] - b[COLUMN];
      }
      var found = false;
      function binarySearch(haystack, needle, low, high) {
        while (low <= high) {
          const mid = low + (high - low >> 1);
          const cmp = haystack[mid][COLUMN] - needle;
          if (cmp === 0) {
            found = true;
            return mid;
          }
          if (cmp < 0) {
            low = mid + 1;
          } else {
            high = mid - 1;
          }
        }
        found = false;
        return low - 1;
      }
      function upperBound(haystack, needle, index) {
        for (let i = index + 1; i < haystack.length; index = i++) {
          if (haystack[i][COLUMN] !== needle) break;
        }
        return index;
      }
      function lowerBound(haystack, needle, index) {
        for (let i = index - 1; i >= 0; index = i--) {
          if (haystack[i][COLUMN] !== needle) break;
        }
        return index;
      }
      function memoizedState() {
        return {
          lastKey: -1,
          lastNeedle: -1,
          lastIndex: -1
        };
      }
      function memoizedBinarySearch(haystack, needle, state, key) {
        const { lastKey, lastNeedle, lastIndex } = state;
        let low = 0;
        let high = haystack.length - 1;
        if (key === lastKey) {
          if (needle === lastNeedle) {
            found = lastIndex !== -1 && haystack[lastIndex][COLUMN] === needle;
            return lastIndex;
          }
          if (needle >= lastNeedle) {
            low = lastIndex === -1 ? 0 : lastIndex;
          } else {
            high = lastIndex;
          }
        }
        state.lastKey = key;
        state.lastNeedle = needle;
        return state.lastIndex = binarySearch(haystack, needle, low, high);
      }
      function buildBySources(decoded, memos) {
        const sources = memos.map(buildNullArray);
        for (let i = 0; i < decoded.length; i++) {
          const line = decoded[i];
          for (let j = 0; j < line.length; j++) {
            const seg = line[j];
            if (seg.length === 1) continue;
            const sourceIndex2 = seg[SOURCES_INDEX];
            const sourceLine = seg[SOURCE_LINE];
            const sourceColumn = seg[SOURCE_COLUMN];
            const originalSource = sources[sourceIndex2];
            const originalLine = originalSource[sourceLine] || (originalSource[sourceLine] = []);
            const memo = memos[sourceIndex2];
            let index = upperBound(
              originalLine,
              sourceColumn,
              memoizedBinarySearch(originalLine, sourceColumn, memo, sourceLine)
            );
            memo.lastIndex = ++index;
            insert(originalLine, index, [sourceColumn, i, seg[COLUMN]]);
          }
        }
        return sources;
      }
      function insert(array, index, value2) {
        for (let i = array.length; i > index; i--) {
          array[i] = array[i - 1];
        }
        array[index] = value2;
      }
      function buildNullArray() {
        return { __proto__: null };
      }
      function parse2(map) {
        return typeof map === "string" ? JSON.parse(map) : map;
      }
      var FlattenMap = function(map, mapUrl) {
        const parsed = parse2(map);
        if (!("sections" in parsed)) {
          return new TraceMap(parsed, mapUrl);
        }
        const mappings = [];
        const sources = [];
        const sourcesContent = [];
        const names = [];
        const ignoreList = [];
        recurse(
          parsed,
          mapUrl,
          mappings,
          sources,
          sourcesContent,
          names,
          ignoreList,
          0,
          0,
          Infinity,
          Infinity
        );
        const joined = {
          version: 3,
          file: parsed.file,
          names,
          sources,
          sourcesContent,
          mappings,
          ignoreList
        };
        return presortedDecodedMap(joined);
      };
      function recurse(input, mapUrl, mappings, sources, sourcesContent, names, ignoreList, lineOffset, columnOffset, stopLine, stopColumn) {
        const { sections } = input;
        for (let i = 0; i < sections.length; i++) {
          const { map, offset } = sections[i];
          let sl = stopLine;
          let sc = stopColumn;
          if (i + 1 < sections.length) {
            const nextOffset = sections[i + 1].offset;
            sl = Math.min(stopLine, lineOffset + nextOffset.line);
            if (sl === stopLine) {
              sc = Math.min(stopColumn, columnOffset + nextOffset.column);
            } else if (sl < stopLine) {
              sc = columnOffset + nextOffset.column;
            }
          }
          addSection(
            map,
            mapUrl,
            mappings,
            sources,
            sourcesContent,
            names,
            ignoreList,
            lineOffset + offset.line,
            columnOffset + offset.column,
            sl,
            sc
          );
        }
      }
      function addSection(input, mapUrl, mappings, sources, sourcesContent, names, ignoreList, lineOffset, columnOffset, stopLine, stopColumn) {
        const parsed = parse2(input);
        if ("sections" in parsed) return recurse(...arguments);
        const map = new TraceMap(parsed, mapUrl);
        const sourcesOffset = sources.length;
        const namesOffset = names.length;
        const decoded = decodedMappings(map);
        const { resolvedSources, sourcesContent: contents, ignoreList: ignores } = map;
        append(sources, resolvedSources);
        append(names, map.names);
        if (contents) append(sourcesContent, contents);
        else for (let i = 0; i < resolvedSources.length; i++) sourcesContent.push(null);
        if (ignores) for (let i = 0; i < ignores.length; i++) ignoreList.push(ignores[i] + sourcesOffset);
        for (let i = 0; i < decoded.length; i++) {
          const lineI = lineOffset + i;
          if (lineI > stopLine) return;
          const out = getLine(mappings, lineI);
          const cOffset = i === 0 ? columnOffset : 0;
          const line = decoded[i];
          for (let j = 0; j < line.length; j++) {
            const seg = line[j];
            const column = cOffset + seg[COLUMN];
            if (lineI === stopLine && column >= stopColumn) return;
            if (seg.length === 1) {
              out.push([column]);
              continue;
            }
            const sourcesIndex = sourcesOffset + seg[SOURCES_INDEX];
            const sourceLine = seg[SOURCE_LINE];
            const sourceColumn = seg[SOURCE_COLUMN];
            out.push(
              seg.length === 4 ? [column, sourcesIndex, sourceLine, sourceColumn] : [column, sourcesIndex, sourceLine, sourceColumn, namesOffset + seg[NAMES_INDEX]]
            );
          }
        }
      }
      function append(arr, other) {
        for (let i = 0; i < other.length; i++) arr.push(other[i]);
      }
      function getLine(arr, index) {
        for (let i = arr.length; i <= index; i++) arr[i] = [];
        return arr[index];
      }
      var LINE_GTR_ZERO = "`line` must be greater than 0 (lines start at line 1)";
      var COL_GTR_EQ_ZERO = "`column` must be greater than or equal to 0 (columns start at column 0)";
      var LEAST_UPPER_BOUND = -1;
      var GREATEST_LOWER_BOUND = 1;
      var TraceMap = class {
        constructor(map, mapUrl) {
          const isString = typeof map === "string";
          if (!isString && map._decodedMemo) return map;
          const parsed = parse2(map);
          const { version, file, names, sourceRoot, sources, sourcesContent } = parsed;
          this.version = version;
          this.file = file;
          this.names = names || [];
          this.sourceRoot = sourceRoot;
          this.sources = sources;
          this.sourcesContent = sourcesContent;
          this.ignoreList = parsed.ignoreList || parsed.x_google_ignoreList || void 0;
          const resolve = resolver(mapUrl, sourceRoot);
          this.resolvedSources = sources.map(resolve);
          const { mappings } = parsed;
          if (typeof mappings === "string") {
            this._encoded = mappings;
            this._decoded = void 0;
          } else if (Array.isArray(mappings)) {
            this._encoded = void 0;
            this._decoded = maybeSort(mappings, isString);
          } else if (parsed.sections) {
            throw new Error(`TraceMap passed sectioned source map, please use FlattenMap export instead`);
          } else {
            throw new Error(`invalid source map: ${JSON.stringify(parsed)}`);
          }
          this._decodedMemo = memoizedState();
          this._bySources = void 0;
          this._bySourceMemos = void 0;
        }
      };
      function cast(map) {
        return map;
      }
      function encodedMappings(map) {
        var _a, _b;
        return (_b = (_a = cast(map))._encoded) != null ? _b : _a._encoded = (0, import_sourcemap_codec.encode)(cast(map)._decoded);
      }
      function decodedMappings(map) {
        var _a;
        return (_a = cast(map))._decoded || (_a._decoded = (0, import_sourcemap_codec.decode)(cast(map)._encoded));
      }
      function traceSegment(map, line, column) {
        const decoded = decodedMappings(map);
        if (line >= decoded.length) return null;
        const segments = decoded[line];
        const index = traceSegmentInternal(
          segments,
          cast(map)._decodedMemo,
          line,
          column,
          GREATEST_LOWER_BOUND
        );
        return index === -1 ? null : segments[index];
      }
      function originalPositionFor(map, needle) {
        let { line, column, bias } = needle;
        line--;
        if (line < 0) throw new Error(LINE_GTR_ZERO);
        if (column < 0) throw new Error(COL_GTR_EQ_ZERO);
        const decoded = decodedMappings(map);
        if (line >= decoded.length) return OMapping(null, null, null, null);
        const segments = decoded[line];
        const index = traceSegmentInternal(
          segments,
          cast(map)._decodedMemo,
          line,
          column,
          bias || GREATEST_LOWER_BOUND
        );
        if (index === -1) return OMapping(null, null, null, null);
        const segment = segments[index];
        if (segment.length === 1) return OMapping(null, null, null, null);
        const { names, resolvedSources } = map;
        return OMapping(
          resolvedSources[segment[SOURCES_INDEX]],
          segment[SOURCE_LINE] + 1,
          segment[SOURCE_COLUMN],
          segment.length === 5 ? names[segment[NAMES_INDEX]] : null
        );
      }
      function generatedPositionFor(map, needle) {
        const { source, line, column, bias } = needle;
        return generatedPosition(map, source, line, column, bias || GREATEST_LOWER_BOUND, false);
      }
      function allGeneratedPositionsFor(map, needle) {
        const { source, line, column, bias } = needle;
        return generatedPosition(map, source, line, column, bias || LEAST_UPPER_BOUND, true);
      }
      function eachMapping(map, cb) {
        const decoded = decodedMappings(map);
        const { names, resolvedSources } = map;
        for (let i = 0; i < decoded.length; i++) {
          const line = decoded[i];
          for (let j = 0; j < line.length; j++) {
            const seg = line[j];
            const generatedLine = i + 1;
            const generatedColumn = seg[0];
            let source = null;
            let originalLine = null;
            let originalColumn = null;
            let name = null;
            if (seg.length !== 1) {
              source = resolvedSources[seg[1]];
              originalLine = seg[2] + 1;
              originalColumn = seg[3];
            }
            if (seg.length === 5) name = names[seg[4]];
            cb({
              generatedLine,
              generatedColumn,
              source,
              originalLine,
              originalColumn,
              name
            });
          }
        }
      }
      function sourceIndex(map, source) {
        const { sources, resolvedSources } = map;
        let index = sources.indexOf(source);
        if (index === -1) index = resolvedSources.indexOf(source);
        return index;
      }
      function sourceContentFor(map, source) {
        const { sourcesContent } = map;
        if (sourcesContent == null) return null;
        const index = sourceIndex(map, source);
        return index === -1 ? null : sourcesContent[index];
      }
      function isIgnored(map, source) {
        const { ignoreList } = map;
        if (ignoreList == null) return false;
        const index = sourceIndex(map, source);
        return index === -1 ? false : ignoreList.includes(index);
      }
      function presortedDecodedMap(map, mapUrl) {
        const tracer = new TraceMap(clone(map, []), mapUrl);
        cast(tracer)._decoded = map.mappings;
        return tracer;
      }
      function decodedMap(map) {
        return clone(map, decodedMappings(map));
      }
      function encodedMap(map) {
        return clone(map, encodedMappings(map));
      }
      function clone(map, mappings) {
        return {
          version: map.version,
          file: map.file,
          names: map.names,
          sourceRoot: map.sourceRoot,
          sources: map.sources,
          sourcesContent: map.sourcesContent,
          mappings,
          ignoreList: map.ignoreList || map.x_google_ignoreList
        };
      }
      function OMapping(source, line, column, name) {
        return { source, line, column, name };
      }
      function GMapping(line, column) {
        return { line, column };
      }
      function traceSegmentInternal(segments, memo, line, column, bias) {
        let index = memoizedBinarySearch(segments, column, memo, line);
        if (found) {
          index = (bias === LEAST_UPPER_BOUND ? upperBound : lowerBound)(segments, column, index);
        } else if (bias === LEAST_UPPER_BOUND) index++;
        if (index === -1 || index === segments.length) return -1;
        return index;
      }
      function sliceGeneratedPositions(segments, memo, line, column, bias) {
        let min = traceSegmentInternal(segments, memo, line, column, GREATEST_LOWER_BOUND);
        if (!found && bias === LEAST_UPPER_BOUND) min++;
        if (min === -1 || min === segments.length) return [];
        const matchedColumn = found ? column : segments[min][COLUMN];
        if (!found) min = lowerBound(segments, matchedColumn, min);
        const max = upperBound(segments, matchedColumn, min);
        const result = [];
        for (; min <= max; min++) {
          const segment = segments[min];
          result.push(GMapping(segment[REV_GENERATED_LINE] + 1, segment[REV_GENERATED_COLUMN]));
        }
        return result;
      }
      function generatedPosition(map, source, line, column, bias, all) {
        var _a;
        line--;
        if (line < 0) throw new Error(LINE_GTR_ZERO);
        if (column < 0) throw new Error(COL_GTR_EQ_ZERO);
        const { sources, resolvedSources } = map;
        let sourceIndex2 = sources.indexOf(source);
        if (sourceIndex2 === -1) sourceIndex2 = resolvedSources.indexOf(source);
        if (sourceIndex2 === -1) return all ? [] : GMapping(null, null);
        const generated = (_a = cast(map))._bySources || (_a._bySources = buildBySources(
          decodedMappings(map),
          cast(map)._bySourceMemos = sources.map(memoizedState)
        ));
        const segments = generated[sourceIndex2][line];
        if (segments == null) return all ? [] : GMapping(null, null);
        const memo = cast(map)._bySourceMemos[sourceIndex2];
        if (all) return sliceGeneratedPositions(segments, memo, line, column, bias);
        const index = traceSegmentInternal(segments, memo, line, column, bias);
        if (index === -1) return GMapping(null, null);
        const segment = segments[index];
        return GMapping(segment[REV_GENERATED_LINE] + 1, segment[REV_GENERATED_COLUMN]);
      }
    }));
  }
});

// node_modules/@jridgewell/gen-mapping/dist/gen-mapping.umd.js
var require_gen_mapping_umd = __commonJS({
  "node_modules/@jridgewell/gen-mapping/dist/gen-mapping.umd.js"(exports2, module2) {
    (function(global2, factory) {
      if (typeof exports2 === "object" && typeof module2 !== "undefined") {
        factory(module2, require_sourcemap_codec_umd(), require_trace_mapping_umd());
        module2.exports = def(module2);
      } else if (typeof define === "function" && define.amd) {
        define(["module", "@jridgewell/sourcemap-codec", "@jridgewell/trace-mapping"], function(mod) {
          factory.apply(this, arguments);
          mod.exports = def(mod);
        });
      } else {
        const mod = { exports: {} };
        factory(mod, global2.sourcemapCodec, global2.traceMapping);
        global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self;
        global2.genMapping = def(mod);
      }
      function def(m) {
        return "default" in m.exports ? m.exports.default : m.exports;
      }
    })(exports2, (function(module3, require_sourcemapCodec, require_traceMapping) {
      "use strict";
      var __create2 = Object.create;
      var __defProp2 = Object.defineProperty;
      var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
      var __getOwnPropNames2 = Object.getOwnPropertyNames;
      var __getProtoOf2 = Object.getPrototypeOf;
      var __hasOwnProp2 = Object.prototype.hasOwnProperty;
      var __commonJS2 = (cb, mod) => function __require() {
        return mod || (0, cb[__getOwnPropNames2(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
      };
      var __export2 = (target, all) => {
        for (var name in all)
          __defProp2(target, name, { get: all[name], enumerable: true });
      };
      var __copyProps2 = (to, from, except, desc) => {
        if (from && typeof from === "object" || typeof from === "function") {
          for (let key of __getOwnPropNames2(from))
            if (!__hasOwnProp2.call(to, key) && key !== except)
              __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
        }
        return to;
      };
      var __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2(
        // If the importer is in node compatibility mode or this is not an ESM
        // file that has been converted to a CommonJS file using a Babel-
        // compatible transform (i.e. "__esModule" has not been set), then set
        // "default" to the CommonJS "module.exports" for node compatibility.
        isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: true }) : target,
        mod
      ));
      var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
      var require_sourcemap_codec = __commonJS2({
        "umd:@jridgewell/sourcemap-codec"(exports3, module22) {
          module22.exports = require_sourcemapCodec;
        }
      });
      var require_trace_mapping = __commonJS2({
        "umd:@jridgewell/trace-mapping"(exports3, module22) {
          module22.exports = require_traceMapping;
        }
      });
      var gen_mapping_exports = {};
      __export2(gen_mapping_exports, {
        GenMapping: () => GenMapping,
        addMapping: () => addMapping,
        addSegment: () => addSegment,
        allMappings: () => allMappings,
        fromMap: () => fromMap,
        maybeAddMapping: () => maybeAddMapping,
        maybeAddSegment: () => maybeAddSegment,
        setIgnore: () => setIgnore,
        setSourceContent: () => setSourceContent,
        toDecodedMap: () => toDecodedMap,
        toEncodedMap: () => toEncodedMap
      });
      module3.exports = __toCommonJS2(gen_mapping_exports);
      var SetArray = class {
        constructor() {
          this._indexes = { __proto__: null };
          this.array = [];
        }
      };
      function cast(set) {
        return set;
      }
      function get(setarr, key) {
        return cast(setarr)._indexes[key];
      }
      function put(setarr, key) {
        const index = get(setarr, key);
        if (index !== void 0) return index;
        const { array, _indexes: indexes } = cast(setarr);
        const length = array.push(key);
        return indexes[key] = length - 1;
      }
      function remove(setarr, key) {
        const index = get(setarr, key);
        if (index === void 0) return;
        const { array, _indexes: indexes } = cast(setarr);
        for (let i = index + 1; i < array.length; i++) {
          const k = array[i];
          array[i - 1] = k;
          indexes[k]--;
        }
        indexes[key] = void 0;
        array.pop();
      }
      var import_sourcemap_codec = __toESM2(require_sourcemap_codec());
      var import_trace_mapping = __toESM2(require_trace_mapping());
      var COLUMN = 0;
      var SOURCES_INDEX = 1;
      var SOURCE_LINE = 2;
      var SOURCE_COLUMN = 3;
      var NAMES_INDEX = 4;
      var NO_NAME = -1;
      var GenMapping = class {
        constructor({ file, sourceRoot } = {}) {
          this._names = new SetArray();
          this._sources = new SetArray();
          this._sourcesContent = [];
          this._mappings = [];
          this.file = file;
          this.sourceRoot = sourceRoot;
          this._ignoreList = new SetArray();
        }
      };
      function cast2(map) {
        return map;
      }
      function addSegment(map, genLine, genColumn, source, sourceLine, sourceColumn, name, content) {
        return addSegmentInternal(
          false,
          map,
          genLine,
          genColumn,
          source,
          sourceLine,
          sourceColumn,
          name,
          content
        );
      }
      function addMapping(map, mapping) {
        return addMappingInternal(false, map, mapping);
      }
      var maybeAddSegment = (map, genLine, genColumn, source, sourceLine, sourceColumn, name, content) => {
        return addSegmentInternal(
          true,
          map,
          genLine,
          genColumn,
          source,
          sourceLine,
          sourceColumn,
          name,
          content
        );
      };
      var maybeAddMapping = (map, mapping) => {
        return addMappingInternal(true, map, mapping);
      };
      function setSourceContent(map, source, content) {
        const {
          _sources: sources,
          _sourcesContent: sourcesContent
          // _originalScopes: originalScopes,
        } = cast2(map);
        const index = put(sources, source);
        sourcesContent[index] = content;
      }
      function setIgnore(map, source, ignore = true) {
        const {
          _sources: sources,
          _sourcesContent: sourcesContent,
          _ignoreList: ignoreList
          // _originalScopes: originalScopes,
        } = cast2(map);
        const index = put(sources, source);
        if (index === sourcesContent.length) sourcesContent[index] = null;
        if (ignore) put(ignoreList, index);
        else remove(ignoreList, index);
      }
      function toDecodedMap(map) {
        const {
          _mappings: mappings,
          _sources: sources,
          _sourcesContent: sourcesContent,
          _names: names,
          _ignoreList: ignoreList
          // _originalScopes: originalScopes,
          // _generatedRanges: generatedRanges,
        } = cast2(map);
        removeEmptyFinalLines(mappings);
        return {
          version: 3,
          file: map.file || void 0,
          names: names.array,
          sourceRoot: map.sourceRoot || void 0,
          sources: sources.array,
          sourcesContent,
          mappings,
          // originalScopes,
          // generatedRanges,
          ignoreList: ignoreList.array
        };
      }
      function toEncodedMap(map) {
        const decoded = toDecodedMap(map);
        return Object.assign({}, decoded, {
          // originalScopes: decoded.originalScopes.map((os) => encodeOriginalScopes(os)),
          // generatedRanges: encodeGeneratedRanges(decoded.generatedRanges as GeneratedRange[]),
          mappings: (0, import_sourcemap_codec.encode)(decoded.mappings)
        });
      }
      function fromMap(input) {
        const map = new import_trace_mapping.TraceMap(input);
        const gen = new GenMapping({ file: map.file, sourceRoot: map.sourceRoot });
        putAll(cast2(gen)._names, map.names);
        putAll(cast2(gen)._sources, map.sources);
        cast2(gen)._sourcesContent = map.sourcesContent || map.sources.map(() => null);
        cast2(gen)._mappings = (0, import_trace_mapping.decodedMappings)(map);
        if (map.ignoreList) putAll(cast2(gen)._ignoreList, map.ignoreList);
        return gen;
      }
      function allMappings(map) {
        const out = [];
        const { _mappings: mappings, _sources: sources, _names: names } = cast2(map);
        for (let i = 0; i < mappings.length; i++) {
          const line = mappings[i];
          for (let j = 0; j < line.length; j++) {
            const seg = line[j];
            const generated = { line: i + 1, column: seg[COLUMN] };
            let source = void 0;
            let original = void 0;
            let name = void 0;
            if (seg.length !== 1) {
              source = sources.array[seg[SOURCES_INDEX]];
              original = { line: seg[SOURCE_LINE] + 1, column: seg[SOURCE_COLUMN] };
              if (seg.length === 5) name = names.array[seg[NAMES_INDEX]];
            }
            out.push({ generated, source, original, name });
          }
        }
        return out;
      }
      function addSegmentInternal(skipable, map, genLine, genColumn, source, sourceLine, sourceColumn, name, content) {
        const {
          _mappings: mappings,
          _sources: sources,
          _sourcesContent: sourcesContent,
          _names: names
          // _originalScopes: originalScopes,
        } = cast2(map);
        const line = getIndex(mappings, genLine);
        const index = getColumnIndex(line, genColumn);
        if (!source) {
          if (skipable && skipSourceless(line, index)) return;
          return insert(line, index, [genColumn]);
        }
        assert(sourceLine);
        assert(sourceColumn);
        const sourcesIndex = put(sources, source);
        const namesIndex = name ? put(names, name) : NO_NAME;
        if (sourcesIndex === sourcesContent.length) sourcesContent[sourcesIndex] = content != null ? content : null;
        if (skipable && skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIndex)) {
          return;
        }
        return insert(
          line,
          index,
          name ? [genColumn, sourcesIndex, sourceLine, sourceColumn, namesIndex] : [genColumn, sourcesIndex, sourceLine, sourceColumn]
        );
      }
      function assert(_val) {
      }
      function getIndex(arr, index) {
        for (let i = arr.length; i <= index; i++) {
          arr[i] = [];
        }
        return arr[index];
      }
      function getColumnIndex(line, genColumn) {
        let index = line.length;
        for (let i = index - 1; i >= 0; index = i--) {
          const current = line[i];
          if (genColumn >= current[COLUMN]) break;
        }
        return index;
      }
      function insert(array, index, value2) {
        for (let i = array.length; i > index; i--) {
          array[i] = array[i - 1];
        }
        array[index] = value2;
      }
      function removeEmptyFinalLines(mappings) {
        const { length } = mappings;
        let len = length;
        for (let i = len - 1; i >= 0; len = i, i--) {
          if (mappings[i].length > 0) break;
        }
        if (len < length) mappings.length = len;
      }
      function putAll(setarr, array) {
        for (let i = 0; i < array.length; i++) put(setarr, array[i]);
      }
      function skipSourceless(line, index) {
        if (index === 0) return true;
        const prev = line[index - 1];
        return prev.length === 1;
      }
      function skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIndex) {
        if (index === 0) return false;
        const prev = line[index - 1];
        if (prev.length === 1) return false;
        return sourcesIndex === prev[SOURCES_INDEX] && sourceLine === prev[SOURCE_LINE] && sourceColumn === prev[SOURCE_COLUMN] && namesIndex === (prev.length === 5 ? prev[NAMES_INDEX] : NO_NAME);
      }
      function addMappingInternal(skipable, map, mapping) {
        const { generated, source, original, name, content } = mapping;
        if (!source) {
          return addSegmentInternal(
            skipable,
            map,
            generated.line - 1,
            generated.column,
            null,
            null,
            null,
            null,
            null
          );
        }
        assert(original);
        return addSegmentInternal(
          skipable,
          map,
          generated.line - 1,
          generated.column,
          source,
          original.line - 1,
          original.column,
          name,
          content
        );
      }
    }));
  }
});

// node_modules/@babel/generator/lib/source-map.js
var require_source_map = __commonJS({
  "node_modules/@babel/generator/lib/source-map.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = void 0;
    var _genMapping = require_gen_mapping_umd();
    var _traceMapping = require_trace_mapping_umd();
    var SourceMap = class {
      constructor(opts, code) {
        var _opts$sourceFileName;
        this._map = void 0;
        this._rawMappings = void 0;
        this._sourceFileName = void 0;
        this._lastGenLine = 0;
        this._lastSourceLine = 0;
        this._lastSourceColumn = 0;
        this._inputMap = null;
        const map = this._map = new _genMapping.GenMapping({
          sourceRoot: opts.sourceRoot
        });
        this._sourceFileName = (_opts$sourceFileName = opts.sourceFileName) == null ? void 0 : _opts$sourceFileName.replace(/\\/g, "/");
        this._rawMappings = void 0;
        if (opts.inputSourceMap) {
          this._inputMap = new _traceMapping.TraceMap(opts.inputSourceMap);
          const resolvedSources = this._inputMap.resolvedSources;
          if (resolvedSources.length) {
            for (let i = 0; i < resolvedSources.length; i++) {
              var _this$_inputMap$sourc;
              (0, _genMapping.setSourceContent)(map, resolvedSources[i], (_this$_inputMap$sourc = this._inputMap.sourcesContent) == null ? void 0 : _this$_inputMap$sourc[i]);
            }
          }
        }
        if (typeof code === "string" && !opts.inputSourceMap) {
          (0, _genMapping.setSourceContent)(map, this._sourceFileName, code);
        } else if (typeof code === "object") {
          for (const sourceFileName of Object.keys(code)) {
            (0, _genMapping.setSourceContent)(map, sourceFileName.replace(/\\/g, "/"), code[sourceFileName]);
          }
        }
      }
      get() {
        return (0, _genMapping.toEncodedMap)(this._map);
      }
      getDecoded() {
        return (0, _genMapping.toDecodedMap)(this._map);
      }
      getRawMappings() {
        return this._rawMappings || (this._rawMappings = (0, _genMapping.allMappings)(this._map));
      }
      mark(generated, line, column, identifierName, identifierNamePos, filename) {
        var _originalMapping;
        this._rawMappings = void 0;
        let originalMapping;
        if (line != null) {
          if (this._inputMap) {
            originalMapping = (0, _traceMapping.originalPositionFor)(this._inputMap, {
              line,
              column
            });
            if (!originalMapping.name && identifierNamePos) {
              const originalIdentifierMapping = (0, _traceMapping.originalPositionFor)(this._inputMap, identifierNamePos);
              if (originalIdentifierMapping.name) {
                identifierName = originalIdentifierMapping.name;
              }
            }
          } else {
            originalMapping = {
              name: null,
              source: (filename == null ? void 0 : filename.replace(/\\/g, "/")) || this._sourceFileName,
              line,
              column
            };
          }
        }
        (0, _genMapping.maybeAddMapping)(this._map, {
          name: identifierName,
          generated,
          source: (_originalMapping = originalMapping) == null ? void 0 : _originalMapping.source,
          original: originalMapping
        });
      }
    };
    exports2.default = SourceMap;
  }
});

// node_modules/@babel/generator/lib/buffer.js
var require_buffer = __commonJS({
  "node_modules/@babel/generator/lib/buffer.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = void 0;
    var spaceIndents = [];
    for (let i = 0; i < 32; i++) {
      spaceIndents.push(" ".repeat(i * 2));
    }
    var Buffer2 = class {
      constructor(map, indentChar) {
        this._map = null;
        this._buf = "";
        this._str = "";
        this._appendCount = 0;
        this._last = 0;
        this._canMarkIdName = true;
        this._indentChar = "";
        this._queuedChar = 0;
        this._position = {
          line: 1,
          column: 0
        };
        this._sourcePosition = {
          identifierName: void 0,
          identifierNamePos: void 0,
          line: void 0,
          column: void 0,
          filename: void 0
        };
        this._map = map;
        this._indentChar = indentChar;
      }
      get() {
        const {
          _map,
          _last
        } = this;
        if (this._queuedChar !== 32) {
          this._flush();
        }
        const code = _last === 10 ? (this._buf + this._str).trimRight() : this._buf + this._str;
        if (_map === null) {
          return {
            code,
            decodedMap: void 0,
            map: null,
            rawMappings: void 0
          };
        }
        const result = {
          code,
          decodedMap: _map.getDecoded(),
          get __mergedMap() {
            return this.map;
          },
          get map() {
            const resultMap = _map.get();
            result.map = resultMap;
            return resultMap;
          },
          set map(value2) {
            Object.defineProperty(result, "map", {
              value: value2,
              writable: true
            });
          },
          get rawMappings() {
            const mappings = _map.getRawMappings();
            result.rawMappings = mappings;
            return mappings;
          },
          set rawMappings(value2) {
            Object.defineProperty(result, "rawMappings", {
              value: value2,
              writable: true
            });
          }
        };
        return result;
      }
      append(str, maybeNewline) {
        this._flush();
        this._append(str, maybeNewline);
      }
      appendChar(char) {
        this._flush();
        this._appendChar(char, 1, true);
      }
      queue(char) {
        this._flush();
        this._queuedChar = char;
      }
      _flush() {
        const queuedChar = this._queuedChar;
        if (queuedChar !== 0) {
          this._appendChar(queuedChar, 1, true);
          this._queuedChar = 0;
        }
      }
      _appendChar(char, repeat, useSourcePos) {
        this._last = char;
        if (char === -1) {
          const indent = repeat >= 64 ? this._indentChar.repeat(repeat) : spaceIndents[repeat / 2];
          this._str += indent;
        } else {
          this._str += repeat > 1 ? String.fromCharCode(char).repeat(repeat) : String.fromCharCode(char);
        }
        const isSpace = char === 32;
        const position = this._position;
        if (char !== 10) {
          if (this._map) {
            const sourcePos = this._sourcePosition;
            if (useSourcePos && sourcePos) {
              this._map.mark(position, sourcePos.line, sourcePos.column, isSpace ? void 0 : sourcePos.identifierName, isSpace ? void 0 : sourcePos.identifierNamePos, sourcePos.filename);
              if (!isSpace && this._canMarkIdName) {
                sourcePos.identifierName = void 0;
                sourcePos.identifierNamePos = void 0;
              }
            } else {
              this._map.mark(position);
            }
          }
          position.column += repeat;
        } else {
          position.line++;
          position.column = 0;
        }
      }
      _append(str, maybeNewline) {
        const len = str.length;
        const position = this._position;
        const sourcePos = this._sourcePosition;
        this._last = -1;
        if (++this._appendCount > 4096) {
          +this._str;
          this._buf += this._str;
          this._str = str;
          this._appendCount = 0;
        } else {
          this._str += str;
        }
        const hasMap = this._map !== null;
        if (!maybeNewline && !hasMap) {
          position.column += len;
          return;
        }
        const {
          column,
          identifierName,
          identifierNamePos,
          filename
        } = sourcePos;
        let line = sourcePos.line;
        if ((identifierName != null || identifierNamePos != null) && this._canMarkIdName) {
          sourcePos.identifierName = void 0;
          sourcePos.identifierNamePos = void 0;
        }
        let i = str.indexOf("\n");
        let last = 0;
        if (hasMap && i !== 0) {
          this._map.mark(position, line, column, identifierName, identifierNamePos, filename);
        }
        while (i !== -1) {
          position.line++;
          position.column = 0;
          last = i + 1;
          if (last < len && line !== void 0) {
            line++;
            if (hasMap) {
              this._map.mark(position, line, 0, void 0, void 0, filename);
            }
          }
          i = str.indexOf("\n", last);
        }
        position.column += len - last;
      }
      removeLastSemicolon() {
        if (this._queuedChar === 59) {
          this._queuedChar = 0;
        }
      }
      getLastChar(checkQueue) {
        if (!checkQueue) {
          return this._last;
        }
        const queuedChar = this._queuedChar;
        return queuedChar !== 0 ? queuedChar : this._last;
      }
      getNewlineCount() {
        return this._queuedChar === 0 && this._last === 10 ? 1 : 0;
      }
      hasContent() {
        return this._last !== 0;
      }
      exactSource(loc, cb) {
        if (!this._map) {
          cb();
          return;
        }
        this.source("start", loc);
        const identifierName = loc.identifierName;
        const sourcePos = this._sourcePosition;
        if (identifierName != null) {
          this._canMarkIdName = false;
          sourcePos.identifierName = identifierName;
        }
        cb();
        if (identifierName != null) {
          this._canMarkIdName = true;
          sourcePos.identifierName = void 0;
          sourcePos.identifierNamePos = void 0;
        }
        this.source("end", loc);
      }
      source(prop, loc) {
        if (!this._map) return;
        this._normalizePosition(prop, loc, 0);
      }
      sourceWithOffset(prop, loc, columnOffset) {
        if (!this._map) return;
        this._normalizePosition(prop, loc, columnOffset);
      }
      _normalizePosition(prop, loc, columnOffset) {
        this._flush();
        const pos = loc[prop];
        const target = this._sourcePosition;
        if (pos) {
          target.line = pos.line;
          target.column = Math.max(pos.column + columnOffset, 0);
          target.filename = loc.filename;
        }
      }
      getCurrentColumn() {
        return this._position.column + (this._queuedChar ? 1 : 0);
      }
      getCurrentLine() {
        return this._position.line;
      }
    };
    exports2.default = Buffer2;
  }
});

// node_modules/@babel/generator/lib/node/parentheses.js
var require_parentheses = __commonJS({
  "node_modules/@babel/generator/lib/node/parentheses.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.AssignmentExpression = AssignmentExpression;
    exports2.BinaryExpression = BinaryExpression;
    exports2.ClassExpression = ClassExpression;
    exports2.ArrowFunctionExpression = exports2.ConditionalExpression = ConditionalExpression;
    exports2.DoExpression = DoExpression;
    exports2.FunctionExpression = FunctionExpression;
    exports2.FunctionTypeAnnotation = FunctionTypeAnnotation;
    exports2.Identifier = Identifier;
    exports2.LogicalExpression = LogicalExpression;
    exports2.NullableTypeAnnotation = NullableTypeAnnotation;
    exports2.ObjectExpression = ObjectExpression;
    exports2.OptionalIndexedAccessType = OptionalIndexedAccessType;
    exports2.OptionalCallExpression = exports2.OptionalMemberExpression = OptionalMemberExpression;
    exports2.SequenceExpression = SequenceExpression;
    exports2.TSSatisfiesExpression = exports2.TSAsExpression = TSAsExpression;
    exports2.TSConditionalType = TSConditionalType;
    exports2.TSConstructorType = exports2.TSFunctionType = TSFunctionType;
    exports2.TSInferType = TSInferType;
    exports2.TSInstantiationExpression = TSInstantiationExpression;
    exports2.TSIntersectionType = TSIntersectionType;
    exports2.SpreadElement = exports2.UnaryExpression = exports2.TSTypeAssertion = UnaryLike;
    exports2.TSTypeOperator = TSTypeOperator;
    exports2.TSUnionType = TSUnionType;
    exports2.IntersectionTypeAnnotation = exports2.UnionTypeAnnotation = UnionTypeAnnotation;
    exports2.UpdateExpression = UpdateExpression;
    exports2.AwaitExpression = exports2.YieldExpression = YieldExpression;
    var _t = require_lib3();
    var _index = require_node2();
    var {
      isMemberExpression,
      isOptionalMemberExpression,
      isYieldExpression,
      isStatement
    } = _t;
    var PRECEDENCE = /* @__PURE__ */ new Map([["||", 0], ["??", 1], ["&&", 2], ["|", 3], ["^", 4], ["&", 5], ["==", 6], ["===", 6], ["!=", 6], ["!==", 6], ["<", 7], [">", 7], ["<=", 7], [">=", 7], ["in", 7], ["instanceof", 7], [">>", 8], ["<<", 8], [">>>", 8], ["+", 9], ["-", 9], ["*", 10], ["/", 10], ["%", 10], ["**", 11]]);
    function isTSTypeExpression(nodeId) {
      return nodeId === 156 || nodeId === 201 || nodeId === 209;
    }
    var isClassExtendsClause = (node, parent, parentId) => {
      return (parentId === 21 || parentId === 22) && parent.superClass === node;
    };
    var hasPostfixPart = (node, parent, parentId) => {
      switch (parentId) {
        case 108:
        case 132:
          return parent.object === node;
        case 17:
        case 130:
        case 112:
          return parent.callee === node;
        case 222:
          return parent.tag === node;
        case 191:
          return true;
      }
      return false;
    };
    function NullableTypeAnnotation(node, parent, parentId) {
      return parentId === 4;
    }
    function FunctionTypeAnnotation(node, parent, parentId, tokenContext) {
      return parentId === 239 || parentId === 90 || parentId === 4 || (tokenContext & _index.TokenContext.arrowFlowReturnType) > 0;
    }
    function UpdateExpression(node, parent, parentId) {
      return hasPostfixPart(node, parent, parentId) || isClassExtendsClause(node, parent, parentId);
    }
    function needsParenBeforeExpressionBrace(tokenContext) {
      return (tokenContext & (_index.TokenContext.expressionStatement | _index.TokenContext.arrowBody)) > 0;
    }
    function ObjectExpression(node, parent, parentId, tokenContext) {
      return needsParenBeforeExpressionBrace(tokenContext);
    }
    function DoExpression(node, parent, parentId, tokenContext) {
      return (tokenContext & _index.TokenContext.expressionStatement) > 0 && !node.async;
    }
    function BinaryLike(node, parent, parentId, nodeType) {
      if (isClassExtendsClause(node, parent, parentId)) {
        return true;
      }
      if (hasPostfixPart(node, parent, parentId) || parentId === 238 || parentId === 145 || parentId === 8) {
        return true;
      }
      let parentPos;
      switch (parentId) {
        case 10:
        case 107:
          parentPos = PRECEDENCE.get(parent.operator);
          break;
        case 156:
        case 201:
          parentPos = 7;
      }
      if (parentPos !== void 0) {
        const nodePos = nodeType === 2 ? 7 : PRECEDENCE.get(node.operator);
        if (parentPos > nodePos) return true;
        if (parentPos === nodePos && parentId === 10 && (nodePos === 11 ? parent.left === node : parent.right === node)) {
          return true;
        }
        if (nodeType === 1 && parentId === 107 && (nodePos === 1 && parentPos !== 1 || parentPos === 1 && nodePos !== 1)) {
          return true;
        }
      }
      return false;
    }
    function UnionTypeAnnotation(node, parent, parentId) {
      switch (parentId) {
        case 4:
        case 115:
        case 90:
        case 239:
          return true;
      }
      return false;
    }
    function OptionalIndexedAccessType(node, parent, parentId) {
      return parentId === 84 && parent.objectType === node;
    }
    function TSAsExpression(node, parent, parentId) {
      if ((parentId === 6 || parentId === 7) && parent.left === node) {
        return true;
      }
      if (parentId === 10 && (parent.operator === "|" || parent.operator === "&") && node === parent.left) {
        return true;
      }
      return BinaryLike(node, parent, parentId, 2);
    }
    function TSConditionalType(node, parent, parentId) {
      switch (parentId) {
        case 155:
        case 195:
        case 211:
        case 212:
          return true;
        case 175:
          return parent.objectType === node;
        case 181:
        case 219:
          return parent.types[0] === node;
        case 161:
          return parent.checkType === node || parent.extendsType === node;
      }
      return false;
    }
    function TSUnionType(node, parent, parentId) {
      switch (parentId) {
        case 181:
        case 211:
        case 155:
        case 195:
          return true;
        case 175:
          return parent.objectType === node;
      }
      return false;
    }
    function TSIntersectionType(node, parent, parentId) {
      return parentId === 211 || TSTypeOperator(node, parent, parentId);
    }
    function TSInferType(node, parent, parentId) {
      if (TSTypeOperator(node, parent, parentId)) {
        return true;
      }
      if ((parentId === 181 || parentId === 219) && node.typeParameter.constraint && parent.types[0] === node) {
        return true;
      }
      return false;
    }
    function TSTypeOperator(node, parent, parentId) {
      switch (parentId) {
        case 155:
        case 195:
          return true;
        case 175:
          if (parent.objectType === node) {
            return true;
          }
      }
      return false;
    }
    function TSInstantiationExpression(node, parent, parentId) {
      switch (parentId) {
        case 17:
        case 130:
        case 112:
        case 177:
          return parent.typeParameters != null;
      }
      return false;
    }
    function TSFunctionType(node, parent, parentId) {
      if (TSUnionType(node, parent, parentId)) return true;
      return parentId === 219 || parentId === 161 && (parent.checkType === node || parent.extendsType === node);
    }
    function BinaryExpression(node, parent, parentId, tokenContext) {
      if (BinaryLike(node, parent, parentId, 0)) return true;
      return (tokenContext & _index.TokenContext.forInOrInitHeadAccumulate) > 0 && node.operator === "in";
    }
    function LogicalExpression(node, parent, parentId) {
      return BinaryLike(node, parent, parentId, 1);
    }
    function SequenceExpression(node, parent, parentId) {
      if (parentId === 144 || parentId === 133 || parentId === 108 && parent.property === node || parentId === 132 && parent.property === node || parentId === 224) {
        return false;
      }
      if (parentId === 21) {
        return true;
      }
      if (parentId === 68) {
        return parent.right === node;
      }
      if (parentId === 60) {
        return true;
      }
      return !isStatement(parent);
    }
    function YieldExpression(node, parent, parentId) {
      return parentId === 10 || parentId === 107 || parentId === 238 || parentId === 145 || hasPostfixPart(node, parent, parentId) || parentId === 8 && isYieldExpression(node) || parentId === 28 && node === parent.test || isClassExtendsClause(node, parent, parentId) || isTSTypeExpression(parentId);
    }
    function ClassExpression(node, parent, parentId, tokenContext) {
      return (tokenContext & (_index.TokenContext.expressionStatement | _index.TokenContext.exportDefault)) > 0;
    }
    function UnaryLike(node, parent, parentId) {
      return hasPostfixPart(node, parent, parentId) || parentId === 10 && parent.operator === "**" && parent.left === node || isClassExtendsClause(node, parent, parentId);
    }
    function FunctionExpression(node, parent, parentId, tokenContext) {
      return (tokenContext & (_index.TokenContext.expressionStatement | _index.TokenContext.exportDefault)) > 0;
    }
    function ConditionalExpression(node, parent, parentId) {
      switch (parentId) {
        case 238:
        case 145:
        case 10:
        case 107:
        case 8:
          return true;
        case 28:
          if (parent.test === node) {
            return true;
          }
      }
      if (isTSTypeExpression(parentId)) {
        return true;
      }
      return UnaryLike(node, parent, parentId);
    }
    function OptionalMemberExpression(node, parent, parentId) {
      switch (parentId) {
        case 17:
          return parent.callee === node;
        case 108:
          return parent.object === node;
      }
      return false;
    }
    function AssignmentExpression(node, parent, parentId, tokenContext) {
      if (needsParenBeforeExpressionBrace(tokenContext) && node.left.type === "ObjectPattern") {
        return true;
      }
      return ConditionalExpression(node, parent, parentId);
    }
    function Identifier(node, parent, parentId, tokenContext, getRawIdentifier) {
      var _node$extra;
      if (getRawIdentifier && getRawIdentifier(node) !== node.name) {
        return false;
      }
      if (parentId === 6 && (_node$extra = node.extra) != null && _node$extra.parenthesized && parent.left === node) {
        const rightType = parent.right.type;
        if ((rightType === "FunctionExpression" || rightType === "ClassExpression") && parent.right.id == null) {
          return true;
        }
      }
      if (tokenContext & _index.TokenContext.forOfHead || (parentId === 108 || parentId === 132) && tokenContext & (_index.TokenContext.expressionStatement | _index.TokenContext.forInitHead | _index.TokenContext.forInHead)) {
        if (node.name === "let") {
          const isFollowedByBracket = isMemberExpression(parent, {
            object: node,
            computed: true
          }) || isOptionalMemberExpression(parent, {
            object: node,
            computed: true,
            optional: false
          });
          if (isFollowedByBracket && tokenContext & (_index.TokenContext.expressionStatement | _index.TokenContext.forInitHead | _index.TokenContext.forInHead)) {
            return true;
          }
          return (tokenContext & _index.TokenContext.forOfHead) > 0;
        }
      }
      return parentId === 68 && parent.left === node && node.name === "async" && !parent.await;
    }
  }
});

// node_modules/@babel/generator/lib/generators/template-literals.js
var require_template_literals = __commonJS({
  "node_modules/@babel/generator/lib/generators/template-literals.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.TaggedTemplateExpression = TaggedTemplateExpression;
    exports2.TemplateElement = TemplateElement;
    exports2.TemplateLiteral = TemplateLiteral;
    exports2._printTemplate = _printTemplate;
    function TaggedTemplateExpression(node) {
      this.print(node.tag);
      this.print(node.typeParameters);
      this.print(node.quasi);
    }
    function TemplateElement() {
      throw new Error("TemplateElement printing is handled in TemplateLiteral");
    }
    function _printTemplate(node, substitutions) {
      const quasis = node.quasis;
      let partRaw = "`";
      for (let i = 0; i < quasis.length - 1; i++) {
        partRaw += quasis[i].value.raw;
        this.token(partRaw + "${", true);
        this.print(substitutions[i]);
        partRaw = "}";
        if (this.tokenMap) {
          const token = this.tokenMap.findMatching(node, "}", i);
          if (token) this._catchUpTo(token.loc.start);
        }
      }
      partRaw += quasis[quasis.length - 1].value.raw;
      this.token(partRaw + "`", true);
    }
    function TemplateLiteral(node) {
      _printTemplate.call(this, node, node.expressions);
    }
  }
});

// node_modules/@babel/generator/lib/generators/expressions.js
var require_expressions = __commonJS({
  "node_modules/@babel/generator/lib/generators/expressions.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.LogicalExpression = exports2.AssignmentExpression = AssignmentExpression;
    exports2.AssignmentPattern = AssignmentPattern;
    exports2.AwaitExpression = AwaitExpression;
    exports2.BinaryExpression = BinaryExpression;
    exports2.BindExpression = BindExpression;
    exports2.CallExpression = CallExpression;
    exports2.ConditionalExpression = ConditionalExpression;
    exports2.Decorator = Decorator;
    exports2.DoExpression = DoExpression;
    exports2.EmptyStatement = EmptyStatement;
    exports2.ExpressionStatement = ExpressionStatement;
    exports2.Import = Import;
    exports2.MemberExpression = MemberExpression;
    exports2.MetaProperty = MetaProperty;
    exports2.ModuleExpression = ModuleExpression;
    exports2.NewExpression = NewExpression;
    exports2.OptionalCallExpression = OptionalCallExpression;
    exports2.OptionalMemberExpression = OptionalMemberExpression;
    exports2.ParenthesizedExpression = ParenthesizedExpression;
    exports2.PrivateName = PrivateName;
    exports2.SequenceExpression = SequenceExpression;
    exports2.Super = Super;
    exports2.ThisExpression = ThisExpression;
    exports2.UnaryExpression = UnaryExpression;
    exports2.UpdateExpression = UpdateExpression;
    exports2.V8IntrinsicIdentifier = V8IntrinsicIdentifier;
    exports2.YieldExpression = YieldExpression;
    exports2._shouldPrintDecoratorsBeforeExport = _shouldPrintDecoratorsBeforeExport;
    var _t = require_lib3();
    var _index = require_node2();
    var {
      isCallExpression,
      isLiteral,
      isMemberExpression,
      isNewExpression,
      isPattern
    } = _t;
    function UnaryExpression(node) {
      const {
        operator
      } = node;
      const firstChar = operator.charCodeAt(0);
      if (firstChar >= 97 && firstChar <= 122) {
        this.word(operator);
        this.space();
      } else {
        this.tokenChar(firstChar);
      }
      this.print(node.argument);
    }
    function DoExpression(node) {
      if (node.async) {
        this.word("async", true);
        this.space();
      }
      this.word("do");
      this.space();
      this.print(node.body);
    }
    function ParenthesizedExpression(node) {
      this.tokenChar(40);
      const oldNoLineTerminatorAfterNode = this.enterDelimited();
      this.print(node.expression, void 0, true);
      this._noLineTerminatorAfterNode = oldNoLineTerminatorAfterNode;
      this.rightParens(node);
    }
    function UpdateExpression(node) {
      if (node.prefix) {
        this.token(node.operator, false, 0, true);
        this.print(node.argument);
      } else {
        this.print(node.argument, true);
        this.token(node.operator, false, 0, true);
      }
    }
    function ConditionalExpression(node) {
      this.print(node.test);
      this.space();
      this.tokenChar(63);
      this.space();
      this.print(node.consequent);
      this.space();
      this.tokenChar(58);
      this.space();
      this.print(node.alternate);
    }
    function NewExpression(node, parent) {
      this.word("new");
      this.space();
      this.print(node.callee);
      if (this.format.minified && node.arguments.length === 0 && !node.optional && !isCallExpression(parent, {
        callee: node
      }) && !isMemberExpression(parent) && !isNewExpression(parent)) {
        return;
      }
      this.print(node.typeArguments);
      this.print(node.typeParameters);
      if (node.optional) {
        this.token("?.");
      }
      if (node.arguments.length === 0 && this.tokenMap && !this.tokenMap.endMatches(node, ")")) {
        return;
      }
      this.tokenChar(40);
      const oldNoLineTerminatorAfterNode = this.enterDelimited();
      this.printList(node.arguments, this.shouldPrintTrailingComma(")"), void 0, void 0, void 0, true);
      this._noLineTerminatorAfterNode = oldNoLineTerminatorAfterNode;
      this.rightParens(node);
    }
    function SequenceExpression(node) {
      this.printList(node.expressions);
    }
    function ThisExpression() {
      this.word("this");
    }
    function Super() {
      this.word("super");
    }
    function _shouldPrintDecoratorsBeforeExport(node) {
      if (typeof this.format.decoratorsBeforeExport === "boolean") {
        return this.format.decoratorsBeforeExport;
      }
      return typeof node.start === "number" && node.start === node.declaration.start;
    }
    function Decorator(node) {
      this.tokenChar(64);
      const {
        expression
      } = node;
      this.print(expression);
      this.newline();
    }
    function OptionalMemberExpression(node) {
      let {
        computed
      } = node;
      const {
        optional,
        property
      } = node;
      this.print(node.object);
      if (!computed && isMemberExpression(property)) {
        throw new TypeError("Got a MemberExpression for MemberExpression property");
      }
      if (isLiteral(property) && typeof property.value === "number") {
        computed = true;
      }
      if (optional) {
        this.token("?.");
      }
      if (computed) {
        this.tokenChar(91);
        this.print(property);
        this.tokenChar(93);
      } else {
        if (!optional) {
          this.tokenChar(46);
        }
        this.print(property);
      }
    }
    function OptionalCallExpression(node) {
      this.print(node.callee);
      this.print(node.typeParameters);
      if (node.optional) {
        this.token("?.");
      }
      this.print(node.typeArguments);
      this.tokenChar(40);
      const oldNoLineTerminatorAfterNode = this.enterDelimited();
      this.printList(node.arguments, void 0, void 0, void 0, void 0, true);
      this._noLineTerminatorAfterNode = oldNoLineTerminatorAfterNode;
      this.rightParens(node);
    }
    function CallExpression(node) {
      this.print(node.callee);
      this.print(node.typeArguments);
      this.print(node.typeParameters);
      this.tokenChar(40);
      const oldNoLineTerminatorAfterNode = this.enterDelimited();
      this.printList(node.arguments, this.shouldPrintTrailingComma(")"), void 0, void 0, void 0, true);
      this._noLineTerminatorAfterNode = oldNoLineTerminatorAfterNode;
      this.rightParens(node);
    }
    function Import() {
      this.word("import");
    }
    function AwaitExpression(node) {
      this.word("await");
      this.space();
      this.print(node.argument);
    }
    function YieldExpression(node) {
      if (node.delegate) {
        this.word("yield", true);
        this.tokenChar(42);
        if (node.argument) {
          this.space();
          this.print(node.argument);
        }
      } else if (node.argument) {
        this.word("yield", true);
        this.space();
        this.print(node.argument);
      } else {
        this.word("yield");
      }
    }
    function EmptyStatement() {
      this.semicolon(true);
    }
    function ExpressionStatement(node) {
      this.tokenContext |= _index.TokenContext.expressionStatement;
      this.print(node.expression);
      this.semicolon();
    }
    function AssignmentPattern(node) {
      this.print(node.left);
      if (node.left.type === "Identifier" || isPattern(node.left)) {
        if (node.left.optional) this.tokenChar(63);
        this.print(node.left.typeAnnotation);
      }
      this.space();
      this.tokenChar(61);
      this.space();
      this.print(node.right);
    }
    function AssignmentExpression(node) {
      this.print(node.left);
      this.space();
      this.token(node.operator, false, 0, true);
      this.space();
      this.print(node.right);
    }
    function BinaryExpression(node) {
      this.print(node.left);
      this.space();
      const {
        operator
      } = node;
      if (operator.charCodeAt(0) === 105) {
        this.word(operator);
      } else {
        this.token(operator, false, 0, true);
        this.setLastChar(operator.charCodeAt(operator.length - 1));
      }
      this.space();
      this.print(node.right);
    }
    function BindExpression(node) {
      this.print(node.object);
      this.token("::");
      this.print(node.callee);
    }
    function MemberExpression(node) {
      this.print(node.object);
      if (!node.computed && isMemberExpression(node.property)) {
        throw new TypeError("Got a MemberExpression for MemberExpression property");
      }
      let computed = node.computed;
      if (isLiteral(node.property) && typeof node.property.value === "number") {
        computed = true;
      }
      if (computed) {
        const oldNoLineTerminatorAfterNode = this.enterDelimited();
        this.tokenChar(91);
        this.print(node.property, void 0, true);
        this.tokenChar(93);
        this._noLineTerminatorAfterNode = oldNoLineTerminatorAfterNode;
      } else {
        this.tokenChar(46);
        this.print(node.property);
      }
    }
    function MetaProperty(node) {
      this.print(node.meta);
      this.tokenChar(46);
      this.print(node.property);
    }
    function PrivateName(node) {
      this.tokenChar(35);
      this.print(node.id);
    }
    function V8IntrinsicIdentifier(node) {
      this.tokenChar(37);
      this.word(node.name);
    }
    function ModuleExpression(node) {
      this.word("module", true);
      this.space();
      this.tokenChar(123);
      this.indent();
      const {
        body
      } = node;
      if (body.body.length || body.directives.length) {
        this.newline();
      }
      this.print(body);
      this.dedent();
      this.rightBrace(node);
    }
  }
});

// node_modules/@babel/generator/lib/generators/statements.js
var require_statements = __commonJS({
  "node_modules/@babel/generator/lib/generators/statements.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.BreakStatement = BreakStatement;
    exports2.CatchClause = CatchClause;
    exports2.ContinueStatement = ContinueStatement;
    exports2.DebuggerStatement = DebuggerStatement;
    exports2.DoWhileStatement = DoWhileStatement;
    exports2.ForInStatement = ForInStatement;
    exports2.ForOfStatement = ForOfStatement;
    exports2.ForStatement = ForStatement;
    exports2.IfStatement = IfStatement;
    exports2.LabeledStatement = LabeledStatement;
    exports2.ReturnStatement = ReturnStatement;
    exports2.SwitchCase = SwitchCase;
    exports2.SwitchStatement = SwitchStatement;
    exports2.ThrowStatement = ThrowStatement;
    exports2.TryStatement = TryStatement;
    exports2.VariableDeclaration = VariableDeclaration;
    exports2.VariableDeclarator = VariableDeclarator;
    exports2.WhileStatement = WhileStatement;
    exports2.WithStatement = WithStatement;
    var _t = require_lib3();
    var _index = require_node2();
    var {
      isFor,
      isIfStatement,
      isStatement
    } = _t;
    function WithStatement(node) {
      this.word("with");
      this.space();
      this.tokenChar(40);
      this.print(node.object);
      this.tokenChar(41);
      this.printBlock(node.body);
    }
    function IfStatement(node) {
      this.word("if");
      this.space();
      this.tokenChar(40);
      this.print(node.test);
      this.tokenChar(41);
      this.space();
      const needsBlock = node.alternate && isIfStatement(getLastStatement(node.consequent));
      if (needsBlock) {
        this.tokenChar(123);
        this.newline();
        this.indent();
      }
      this.printAndIndentOnComments(node.consequent);
      if (needsBlock) {
        this.dedent();
        this.newline();
        this.tokenChar(125);
      }
      if (node.alternate) {
        if (this.endsWith(125)) this.space();
        this.word("else");
        this.space();
        this.printAndIndentOnComments(node.alternate);
      }
    }
    function getLastStatement(statement) {
      const {
        body
      } = statement;
      if (isStatement(body) === false) {
        return statement;
      }
      return getLastStatement(body);
    }
    function ForStatement(node) {
      this.word("for");
      this.space();
      this.tokenChar(40);
      this.tokenContext |= _index.TokenContext.forInitHead | _index.TokenContext.forInOrInitHeadAccumulate;
      this.print(node.init);
      this.tokenContext = _index.TokenContext.normal;
      this.tokenChar(59);
      if (node.test) {
        this.space();
        this.print(node.test);
      }
      this.tokenChar(59, 1);
      if (node.update) {
        this.space();
        this.print(node.update);
      }
      this.tokenChar(41);
      this.printBlock(node.body);
    }
    function WhileStatement(node) {
      this.word("while");
      this.space();
      this.tokenChar(40);
      this.print(node.test);
      this.tokenChar(41);
      this.printBlock(node.body);
    }
    function ForInStatement(node) {
      this.word("for");
      this.space();
      this.noIndentInnerCommentsHere();
      this.tokenChar(40);
      this.tokenContext |= _index.TokenContext.forInHead | _index.TokenContext.forInOrInitHeadAccumulate;
      this.print(node.left);
      this.tokenContext = _index.TokenContext.normal;
      this.space();
      this.word("in");
      this.space();
      this.print(node.right);
      this.tokenChar(41);
      this.printBlock(node.body);
    }
    function ForOfStatement(node) {
      this.word("for");
      this.space();
      if (node.await) {
        this.word("await");
        this.space();
      }
      this.noIndentInnerCommentsHere();
      this.tokenChar(40);
      this.tokenContext |= _index.TokenContext.forOfHead;
      this.print(node.left);
      this.space();
      this.word("of");
      this.space();
      this.print(node.right);
      this.tokenChar(41);
      this.printBlock(node.body);
    }
    function DoWhileStatement(node) {
      this.word("do");
      this.space();
      this.print(node.body);
      this.space();
      this.word("while");
      this.space();
      this.tokenChar(40);
      this.print(node.test);
      this.tokenChar(41);
      this.semicolon();
    }
    function printStatementAfterKeyword(printer, node) {
      if (node) {
        printer.space();
        printer.printTerminatorless(node);
      }
      printer.semicolon();
    }
    function BreakStatement(node) {
      this.word("break");
      printStatementAfterKeyword(this, node.label);
    }
    function ContinueStatement(node) {
      this.word("continue");
      printStatementAfterKeyword(this, node.label);
    }
    function ReturnStatement(node) {
      this.word("return");
      printStatementAfterKeyword(this, node.argument);
    }
    function ThrowStatement(node) {
      this.word("throw");
      printStatementAfterKeyword(this, node.argument);
    }
    function LabeledStatement(node) {
      this.print(node.label);
      this.tokenChar(58);
      this.space();
      this.print(node.body);
    }
    function TryStatement(node) {
      this.word("try");
      this.space();
      this.print(node.block);
      this.space();
      if (node.handlers) {
        this.print(node.handlers[0]);
      } else {
        this.print(node.handler);
      }
      if (node.finalizer) {
        this.space();
        this.word("finally");
        this.space();
        this.print(node.finalizer);
      }
    }
    function CatchClause(node) {
      this.word("catch");
      this.space();
      if (node.param) {
        this.tokenChar(40);
        this.print(node.param);
        this.print(node.param.typeAnnotation);
        this.tokenChar(41);
        this.space();
      }
      this.print(node.body);
    }
    function SwitchStatement(node) {
      this.word("switch");
      this.space();
      this.tokenChar(40);
      this.print(node.discriminant);
      this.tokenChar(41);
      this.space();
      this.tokenChar(123);
      this.printSequence(node.cases, true);
      this.rightBrace(node);
    }
    function SwitchCase(node) {
      if (node.test) {
        this.word("case");
        this.space();
        this.print(node.test);
        this.tokenChar(58);
      } else {
        this.word("default");
        this.tokenChar(58);
      }
      if (node.consequent.length) {
        this.newline();
        this.printSequence(node.consequent, true);
      }
    }
    function DebuggerStatement() {
      this.word("debugger");
      this.semicolon();
    }
    function commaSeparatorWithNewline(occurrenceCount) {
      this.tokenChar(44, occurrenceCount);
      this.newline();
    }
    function VariableDeclaration(node, parent) {
      if (node.declare) {
        this.word("declare");
        this.space();
      }
      const {
        kind
      } = node;
      switch (kind) {
        case "await using":
          this.word("await");
          this.space();
        case "using":
          this.word("using", true);
          break;
        default:
          this.word(kind);
      }
      this.space();
      let hasInits = false;
      if (!isFor(parent)) {
        for (const declar of node.declarations) {
          if (declar.init) {
            hasInits = true;
            break;
          }
        }
      }
      this.printList(node.declarations, void 0, void 0, node.declarations.length > 1, hasInits ? commaSeparatorWithNewline : void 0);
      if (parent != null) {
        switch (parent.type) {
          case "ForStatement":
            if (parent.init === node) {
              return;
            }
            break;
          case "ForInStatement":
          case "ForOfStatement":
            if (parent.left === node) {
              return;
            }
        }
      }
      this.semicolon();
    }
    function VariableDeclarator(node) {
      this.print(node.id);
      if (node.definite) this.tokenChar(33);
      this.print(node.id.typeAnnotation);
      if (node.init) {
        this.space();
        this.tokenChar(61);
        this.space();
        this.print(node.init);
      }
    }
  }
});

// node_modules/@babel/generator/lib/generators/methods.js
var require_methods = __commonJS({
  "node_modules/@babel/generator/lib/generators/methods.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.ArrowFunctionExpression = ArrowFunctionExpression;
    exports2.FunctionDeclaration = exports2.FunctionExpression = FunctionExpression;
    exports2._functionHead = _functionHead;
    exports2._methodHead = _methodHead;
    exports2._param = _param;
    exports2._parameters = _parameters;
    exports2._params = _params;
    exports2._predicate = _predicate;
    exports2._shouldPrintArrowParamsParens = _shouldPrintArrowParamsParens;
    var _t = require_lib3();
    var _index = require_node2();
    var {
      isIdentifier
    } = _t;
    function _params(node, noLineTerminator, idNode, parentNode) {
      this.print(node.typeParameters);
      if (idNode !== void 0 || parentNode !== void 0) {
        const nameInfo = _getFuncIdName.call(this, idNode, parentNode);
        if (nameInfo) {
          this.sourceIdentifierName(nameInfo.name, nameInfo.pos);
        }
      }
      this.tokenChar(40);
      _parameters.call(this, node.params, 41);
      this.print(node.returnType, noLineTerminator);
      this._noLineTerminator = noLineTerminator;
    }
    function _parameters(parameters, endToken) {
      const oldNoLineTerminatorAfterNode = this.enterDelimited();
      const trailingComma = this.shouldPrintTrailingComma(endToken);
      const paramLength = parameters.length;
      for (let i = 0; i < paramLength; i++) {
        _param.call(this, parameters[i]);
        if (trailingComma || i < paramLength - 1) {
          this.tokenChar(44, i);
          this.space();
        }
      }
      this.tokenChar(endToken);
      this._noLineTerminatorAfterNode = oldNoLineTerminatorAfterNode;
    }
    function _param(parameter) {
      this.printJoin(parameter.decorators, void 0, void 0, void 0, void 0, true);
      this.print(parameter, void 0, true);
      if (parameter.optional) {
        this.tokenChar(63);
      }
      this.print(parameter.typeAnnotation, void 0, true);
    }
    function _methodHead(node) {
      const kind = node.kind;
      const key = node.key;
      if (kind === "get" || kind === "set") {
        this.word(kind);
        this.space();
      }
      if (node.async) {
        this.word("async", true);
        this.space();
      }
      if (kind === "method" || kind === "init") {
        if (node.generator) {
          this.tokenChar(42);
        }
      }
      if (node.computed) {
        this.tokenChar(91);
        this.print(key);
        this.tokenChar(93);
      } else {
        this.print(key);
      }
      if (node.optional) {
        this.tokenChar(63);
      }
      if (this._buf._map) {
        _params.call(this, node, false, node.computed && node.key.type !== "StringLiteral" ? void 0 : node.key);
      } else {
        _params.call(this, node, false);
      }
    }
    function _predicate(node, noLineTerminatorAfter) {
      if (node.predicate) {
        if (!node.returnType) {
          this.tokenChar(58);
        }
        this.space();
        this.print(node.predicate, noLineTerminatorAfter);
      }
    }
    function _functionHead(node, parent, hasPredicate) {
      if (node.async) {
        this.word("async");
        if (!this.format.preserveFormat) {
          this._innerCommentsState = 0;
        }
        this.space();
      }
      this.word("function");
      if (node.generator) {
        if (!this.format.preserveFormat) {
          this._innerCommentsState = 0;
        }
        this.tokenChar(42);
      }
      this.space();
      if (node.id) {
        this.print(node.id);
      }
      if (this._buf._map) {
        _params.call(this, node, false, node.id, parent);
      } else {
        _params.call(this, node, false);
      }
      if (hasPredicate) {
        _predicate.call(this, node);
      }
    }
    function FunctionExpression(node, parent) {
      _functionHead.call(this, node, parent, true);
      this.space();
      this.print(node.body);
    }
    function ArrowFunctionExpression(node, parent) {
      if (node.async) {
        this.word("async", true);
        this.space();
      }
      if (_shouldPrintArrowParamsParens.call(this, node)) {
        _params.call(this, node, true, void 0, this._buf._map ? parent : void 0);
      } else {
        this.print(node.params[0], true);
      }
      _predicate.call(this, node, true);
      this.space();
      this.printInnerComments();
      this.token("=>");
      this.space();
      this.tokenContext |= _index.TokenContext.arrowBody;
      this.print(node.body);
    }
    function _shouldPrintArrowParamsParens(node) {
      var _firstParam$leadingCo, _firstParam$trailingC;
      if (node.params.length !== 1) return true;
      if (node.typeParameters || node.returnType || node.predicate) {
        return true;
      }
      const firstParam = node.params[0];
      if (!isIdentifier(firstParam) || firstParam.typeAnnotation || firstParam.optional || (_firstParam$leadingCo = firstParam.leadingComments) != null && _firstParam$leadingCo.length || (_firstParam$trailingC = firstParam.trailingComments) != null && _firstParam$trailingC.length) {
        return true;
      }
      if (this.tokenMap) {
        if (node.loc == null) return true;
        if (this.tokenMap.findMatching(node, "(") !== null) return true;
        const arrowToken = this.tokenMap.findMatching(node, "=>");
        if ((arrowToken == null ? void 0 : arrowToken.loc) == null) return true;
        return arrowToken.loc.start.line !== node.loc.start.line;
      }
      if (this.format.retainLines) return true;
      return false;
    }
    function _getFuncIdName(idNode, parent) {
      let id = idNode;
      if (!id && parent) {
        const parentType = parent.type;
        if (parentType === "VariableDeclarator") {
          id = parent.id;
        } else if (parentType === "AssignmentExpression" || parentType === "AssignmentPattern") {
          id = parent.left;
        } else if (parentType === "ObjectProperty" || parentType === "ClassProperty") {
          if (!parent.computed || parent.key.type === "StringLiteral") {
            id = parent.key;
          }
        } else if (parentType === "ClassPrivateProperty" || parentType === "ClassAccessorProperty") {
          id = parent.key;
        }
      }
      if (!id) return;
      let nameInfo;
      if (id.type === "Identifier") {
        var _id$loc, _id$loc2;
        nameInfo = {
          pos: (_id$loc = id.loc) == null ? void 0 : _id$loc.start,
          name: ((_id$loc2 = id.loc) == null ? void 0 : _id$loc2.identifierName) || id.name
        };
      } else if (id.type === "PrivateName") {
        var _id$loc3;
        nameInfo = {
          pos: (_id$loc3 = id.loc) == null ? void 0 : _id$loc3.start,
          name: "#" + id.id.name
        };
      } else if (id.type === "StringLiteral") {
        var _id$loc4;
        nameInfo = {
          pos: (_id$loc4 = id.loc) == null ? void 0 : _id$loc4.start,
          name: id.value
        };
      }
      return nameInfo;
    }
  }
});

// node_modules/@babel/generator/lib/generators/typescript.js
var require_typescript2 = __commonJS({
  "node_modules/@babel/generator/lib/generators/typescript.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.TSAnyKeyword = TSAnyKeyword;
    exports2.TSArrayType = TSArrayType;
    exports2.TSAsExpression = TSAsExpression;
    exports2.TSBigIntKeyword = TSBigIntKeyword;
    exports2.TSBooleanKeyword = TSBooleanKeyword;
    exports2.TSCallSignatureDeclaration = TSCallSignatureDeclaration;
    exports2.TSInterfaceHeritage = exports2.TSClassImplements = TSClassImplements;
    exports2.TSConditionalType = TSConditionalType;
    exports2.TSConstructSignatureDeclaration = TSConstructSignatureDeclaration;
    exports2.TSConstructorType = TSConstructorType;
    exports2.TSDeclareFunction = TSDeclareFunction;
    exports2.TSDeclareMethod = TSDeclareMethod;
    exports2.TSEnumBody = TSEnumBody;
    exports2.TSEnumDeclaration = TSEnumDeclaration;
    exports2.TSEnumMember = TSEnumMember;
    exports2.TSExportAssignment = TSExportAssignment;
    exports2.TSExternalModuleReference = TSExternalModuleReference;
    exports2.TSFunctionType = TSFunctionType;
    exports2.TSImportEqualsDeclaration = TSImportEqualsDeclaration;
    exports2.TSImportType = TSImportType;
    exports2.TSIndexSignature = TSIndexSignature;
    exports2.TSIndexedAccessType = TSIndexedAccessType;
    exports2.TSInferType = TSInferType;
    exports2.TSInstantiationExpression = TSInstantiationExpression;
    exports2.TSInterfaceBody = TSInterfaceBody;
    exports2.TSInterfaceDeclaration = TSInterfaceDeclaration;
    exports2.TSIntersectionType = TSIntersectionType;
    exports2.TSIntrinsicKeyword = TSIntrinsicKeyword;
    exports2.TSLiteralType = TSLiteralType;
    exports2.TSMappedType = TSMappedType;
    exports2.TSMethodSignature = TSMethodSignature;
    exports2.TSModuleBlock = TSModuleBlock;
    exports2.TSModuleDeclaration = TSModuleDeclaration;
    exports2.TSNamedTupleMember = TSNamedTupleMember;
    exports2.TSNamespaceExportDeclaration = TSNamespaceExportDeclaration;
    exports2.TSNeverKeyword = TSNeverKeyword;
    exports2.TSNonNullExpression = TSNonNullExpression;
    exports2.TSNullKeyword = TSNullKeyword;
    exports2.TSNumberKeyword = TSNumberKeyword;
    exports2.TSObjectKeyword = TSObjectKeyword;
    exports2.TSOptionalType = TSOptionalType;
    exports2.TSParameterProperty = TSParameterProperty;
    exports2.TSParenthesizedType = TSParenthesizedType;
    exports2.TSPropertySignature = TSPropertySignature;
    exports2.TSQualifiedName = TSQualifiedName;
    exports2.TSRestType = TSRestType;
    exports2.TSSatisfiesExpression = TSSatisfiesExpression;
    exports2.TSStringKeyword = TSStringKeyword;
    exports2.TSSymbolKeyword = TSSymbolKeyword;
    exports2.TSTemplateLiteralType = TSTemplateLiteralType;
    exports2.TSThisType = TSThisType;
    exports2.TSTupleType = TSTupleType;
    exports2.TSTypeAliasDeclaration = TSTypeAliasDeclaration;
    exports2.TSTypeAnnotation = TSTypeAnnotation;
    exports2.TSTypeAssertion = TSTypeAssertion;
    exports2.TSTypeLiteral = TSTypeLiteral;
    exports2.TSTypeOperator = TSTypeOperator;
    exports2.TSTypeParameter = TSTypeParameter;
    exports2.TSTypeParameterDeclaration = exports2.TSTypeParameterInstantiation = TSTypeParameterInstantiation;
    exports2.TSTypePredicate = TSTypePredicate;
    exports2.TSTypeQuery = TSTypeQuery;
    exports2.TSTypeReference = TSTypeReference;
    exports2.TSUndefinedKeyword = TSUndefinedKeyword;
    exports2.TSUnionType = TSUnionType;
    exports2.TSUnknownKeyword = TSUnknownKeyword;
    exports2.TSVoidKeyword = TSVoidKeyword;
    exports2._tsPrintClassMemberModifiers = _tsPrintClassMemberModifiers;
    var _methods = require_methods();
    var _classes = require_classes();
    var _templateLiterals = require_template_literals();
    function TSTypeAnnotation(node, parent) {
      this.token((parent.type === "TSFunctionType" || parent.type === "TSConstructorType") && parent.typeAnnotation === node ? "=>" : ":");
      this.space();
      if (node.optional) this.tokenChar(63);
      this.print(node.typeAnnotation);
    }
    function TSTypeParameterInstantiation(node, parent) {
      this.tokenChar(60);
      let printTrailingSeparator = parent.type === "ArrowFunctionExpression" && node.params.length === 1;
      if (this.tokenMap && node.start != null && node.end != null) {
        printTrailingSeparator && (printTrailingSeparator = !!this.tokenMap.find(node, (t) => this.tokenMap.matchesOriginal(t, ",")));
        printTrailingSeparator || (printTrailingSeparator = this.shouldPrintTrailingComma(">"));
      }
      this.printList(node.params, printTrailingSeparator);
      this.tokenChar(62);
    }
    function TSTypeParameter(node) {
      if (node.const) {
        this.word("const");
        this.space();
      }
      if (node.in) {
        this.word("in");
        this.space();
      }
      if (node.out) {
        this.word("out");
        this.space();
      }
      this.word(node.name);
      if (node.constraint) {
        this.space();
        this.word("extends");
        this.space();
        this.print(node.constraint);
      }
      if (node.default) {
        this.space();
        this.tokenChar(61);
        this.space();
        this.print(node.default);
      }
    }
    function TSParameterProperty(node) {
      if (node.accessibility) {
        this.word(node.accessibility);
        this.space();
      }
      if (node.readonly) {
        this.word("readonly");
        this.space();
      }
      _methods._param.call(this, node.parameter);
    }
    function TSDeclareFunction(node, parent) {
      if (node.declare) {
        this.word("declare");
        this.space();
      }
      _methods._functionHead.call(this, node, parent, false);
      this.semicolon();
    }
    function TSDeclareMethod(node) {
      _classes._classMethodHead.call(this, node);
      this.semicolon();
    }
    function TSQualifiedName(node) {
      this.print(node.left);
      this.tokenChar(46);
      this.print(node.right);
    }
    function TSCallSignatureDeclaration(node) {
      tsPrintSignatureDeclarationBase.call(this, node);
      maybePrintTrailingCommaOrSemicolon(this, node);
    }
    function maybePrintTrailingCommaOrSemicolon(printer, node) {
      if (!printer.tokenMap || !node.start || !node.end) {
        printer.semicolon();
        return;
      }
      if (printer.tokenMap.endMatches(node, ",")) {
        printer.token(",");
      } else if (printer.tokenMap.endMatches(node, ";")) {
        printer.semicolon();
      }
    }
    function TSConstructSignatureDeclaration(node) {
      this.word("new");
      this.space();
      tsPrintSignatureDeclarationBase.call(this, node);
      maybePrintTrailingCommaOrSemicolon(this, node);
    }
    function TSPropertySignature(node) {
      const {
        readonly
      } = node;
      if (readonly) {
        this.word("readonly");
        this.space();
      }
      tsPrintPropertyOrMethodName.call(this, node);
      this.print(node.typeAnnotation);
      maybePrintTrailingCommaOrSemicolon(this, node);
    }
    function tsPrintPropertyOrMethodName(node) {
      if (node.computed) {
        this.tokenChar(91);
      }
      this.print(node.key);
      if (node.computed) {
        this.tokenChar(93);
      }
      if (node.optional) {
        this.tokenChar(63);
      }
    }
    function TSMethodSignature(node) {
      const {
        kind
      } = node;
      if (kind === "set" || kind === "get") {
        this.word(kind);
        this.space();
      }
      tsPrintPropertyOrMethodName.call(this, node);
      tsPrintSignatureDeclarationBase.call(this, node);
      maybePrintTrailingCommaOrSemicolon(this, node);
    }
    function TSIndexSignature(node) {
      const {
        readonly,
        static: isStatic
      } = node;
      if (isStatic) {
        this.word("static");
        this.space();
      }
      if (readonly) {
        this.word("readonly");
        this.space();
      }
      this.tokenChar(91);
      _methods._parameters.call(this, node.parameters, 93);
      this.print(node.typeAnnotation);
      maybePrintTrailingCommaOrSemicolon(this, node);
    }
    function TSAnyKeyword() {
      this.word("any");
    }
    function TSBigIntKeyword() {
      this.word("bigint");
    }
    function TSUnknownKeyword() {
      this.word("unknown");
    }
    function TSNumberKeyword() {
      this.word("number");
    }
    function TSObjectKeyword() {
      this.word("object");
    }
    function TSBooleanKeyword() {
      this.word("boolean");
    }
    function TSStringKeyword() {
      this.word("string");
    }
    function TSSymbolKeyword() {
      this.word("symbol");
    }
    function TSVoidKeyword() {
      this.word("void");
    }
    function TSUndefinedKeyword() {
      this.word("undefined");
    }
    function TSNullKeyword() {
      this.word("null");
    }
    function TSNeverKeyword() {
      this.word("never");
    }
    function TSIntrinsicKeyword() {
      this.word("intrinsic");
    }
    function TSThisType() {
      this.word("this");
    }
    function TSFunctionType(node) {
      tsPrintFunctionOrConstructorType.call(this, node);
    }
    function TSConstructorType(node) {
      if (node.abstract) {
        this.word("abstract");
        this.space();
      }
      this.word("new");
      this.space();
      tsPrintFunctionOrConstructorType.call(this, node);
    }
    function tsPrintFunctionOrConstructorType(node) {
      const {
        typeParameters
      } = node;
      const parameters = node.parameters;
      this.print(typeParameters);
      this.tokenChar(40);
      _methods._parameters.call(this, parameters, 41);
      this.space();
      const returnType = node.typeAnnotation;
      this.print(returnType);
    }
    function TSTypeReference(node) {
      const typeArguments = node.typeParameters;
      this.print(node.typeName, !!typeArguments);
      this.print(typeArguments);
    }
    function TSTypePredicate(node) {
      if (node.asserts) {
        this.word("asserts");
        this.space();
      }
      this.print(node.parameterName);
      if (node.typeAnnotation) {
        this.space();
        this.word("is");
        this.space();
        this.print(node.typeAnnotation.typeAnnotation);
      }
    }
    function TSTypeQuery(node) {
      this.word("typeof");
      this.space();
      this.print(node.exprName);
      const typeArguments = node.typeParameters;
      if (typeArguments) {
        this.print(typeArguments);
      }
    }
    function TSTypeLiteral(node) {
      printBraced(this, node, () => this.printJoin(node.members, true, true, void 0, void 0, true));
    }
    function TSArrayType(node) {
      this.print(node.elementType, true);
      this.tokenChar(91);
      this.tokenChar(93);
    }
    function TSTupleType(node) {
      this.tokenChar(91);
      this.printList(node.elementTypes, this.shouldPrintTrailingComma("]"));
      this.tokenChar(93);
    }
    function TSOptionalType(node) {
      this.print(node.typeAnnotation);
      this.tokenChar(63);
    }
    function TSRestType(node) {
      this.token("...");
      this.print(node.typeAnnotation);
    }
    function TSNamedTupleMember(node) {
      this.print(node.label);
      if (node.optional) this.tokenChar(63);
      this.tokenChar(58);
      this.space();
      this.print(node.elementType);
    }
    function TSUnionType(node) {
      tsPrintUnionOrIntersectionType(this, node, "|");
    }
    function TSIntersectionType(node) {
      tsPrintUnionOrIntersectionType(this, node, "&");
    }
    function tsPrintUnionOrIntersectionType(printer, node, sep) {
      var _printer$tokenMap;
      let hasLeadingToken = 0;
      if ((_printer$tokenMap = printer.tokenMap) != null && _printer$tokenMap.startMatches(node, sep)) {
        hasLeadingToken = 1;
        printer.token(sep);
      }
      printer.printJoin(node.types, void 0, void 0, function(i) {
        this.space();
        this.token(sep, void 0, i + hasLeadingToken);
        this.space();
      });
    }
    function TSConditionalType(node) {
      this.print(node.checkType);
      this.space();
      this.word("extends");
      this.space();
      this.print(node.extendsType);
      this.space();
      this.tokenChar(63);
      this.space();
      this.print(node.trueType);
      this.space();
      this.tokenChar(58);
      this.space();
      this.print(node.falseType);
    }
    function TSInferType(node) {
      this.word("infer");
      this.print(node.typeParameter);
    }
    function TSParenthesizedType(node) {
      this.tokenChar(40);
      this.print(node.typeAnnotation);
      this.tokenChar(41);
    }
    function TSTypeOperator(node) {
      this.word(node.operator);
      this.space();
      this.print(node.typeAnnotation);
    }
    function TSIndexedAccessType(node) {
      this.print(node.objectType, true);
      this.tokenChar(91);
      this.print(node.indexType);
      this.tokenChar(93);
    }
    function TSMappedType(node) {
      const {
        nameType,
        optional,
        readonly,
        typeAnnotation
      } = node;
      this.tokenChar(123);
      const oldNoLineTerminatorAfterNode = this.enterDelimited();
      this.space();
      if (readonly) {
        tokenIfPlusMinus(this, readonly);
        this.word("readonly");
        this.space();
      }
      this.tokenChar(91);
      this.word(node.typeParameter.name);
      this.space();
      this.word("in");
      this.space();
      this.print(node.typeParameter.constraint, void 0, true);
      if (nameType) {
        this.space();
        this.word("as");
        this.space();
        this.print(nameType, void 0, true);
      }
      this.tokenChar(93);
      if (optional) {
        tokenIfPlusMinus(this, optional);
        this.tokenChar(63);
      }
      if (typeAnnotation) {
        this.tokenChar(58);
        this.space();
        this.print(typeAnnotation, void 0, true);
      }
      this.space();
      this._noLineTerminatorAfterNode = oldNoLineTerminatorAfterNode;
      this.tokenChar(125);
    }
    function tokenIfPlusMinus(self2, tok) {
      if (tok !== true) {
        self2.token(tok);
      }
    }
    function TSTemplateLiteralType(node) {
      _templateLiterals._printTemplate.call(this, node, node.types);
    }
    function TSLiteralType(node) {
      this.print(node.literal);
    }
    function TSClassImplements(node) {
      this.print(node.expression);
      this.print(node.typeArguments);
    }
    function TSInterfaceDeclaration(node) {
      const {
        declare: declare2,
        id,
        typeParameters,
        extends: extendz,
        body
      } = node;
      if (declare2) {
        this.word("declare");
        this.space();
      }
      this.word("interface");
      this.space();
      this.print(id);
      this.print(typeParameters);
      if (extendz != null && extendz.length) {
        this.space();
        this.word("extends");
        this.space();
        this.printList(extendz);
      }
      this.space();
      this.print(body);
    }
    function TSInterfaceBody(node) {
      printBraced(this, node, () => this.printJoin(node.body, true, true, void 0, void 0, true));
    }
    function TSTypeAliasDeclaration(node) {
      const {
        declare: declare2,
        id,
        typeParameters,
        typeAnnotation
      } = node;
      if (declare2) {
        this.word("declare");
        this.space();
      }
      this.word("type");
      this.space();
      this.print(id);
      this.print(typeParameters);
      this.space();
      this.tokenChar(61);
      this.space();
      this.print(typeAnnotation);
      this.semicolon();
    }
    function TSAsExpression(node) {
      const {
        expression,
        typeAnnotation
      } = node;
      this.print(expression, true);
      this.space();
      this.word("as");
      this.space();
      this.print(typeAnnotation);
    }
    function TSSatisfiesExpression(node) {
      const {
        expression,
        typeAnnotation
      } = node;
      this.print(expression, true);
      this.space();
      this.word("satisfies");
      this.space();
      this.print(typeAnnotation);
    }
    function TSTypeAssertion(node) {
      const {
        typeAnnotation,
        expression
      } = node;
      this.tokenChar(60);
      this.print(typeAnnotation);
      this.tokenChar(62);
      this.space();
      this.print(expression);
    }
    function TSInstantiationExpression(node) {
      this.print(node.expression);
      this.print(node.typeParameters);
    }
    function TSEnumDeclaration(node) {
      const {
        declare: declare2,
        const: isConst,
        id
      } = node;
      if (declare2) {
        this.word("declare");
        this.space();
      }
      if (isConst) {
        this.word("const");
        this.space();
      }
      this.word("enum");
      this.space();
      this.print(id);
      this.space();
      TSEnumBody.call(this, node);
    }
    function TSEnumBody(node) {
      printBraced(this, node, () => {
        var _this$shouldPrintTrai;
        return this.printList(node.members, (_this$shouldPrintTrai = this.shouldPrintTrailingComma("}")) != null ? _this$shouldPrintTrai : true, true, true, void 0, true);
      });
    }
    function TSEnumMember(node) {
      const {
        id,
        initializer
      } = node;
      this.print(id);
      if (initializer) {
        this.space();
        this.tokenChar(61);
        this.space();
        this.print(initializer);
      }
    }
    function TSModuleDeclaration(node) {
      const {
        declare: declare2,
        id,
        kind
      } = node;
      if (declare2) {
        this.word("declare");
        this.space();
      }
      if (!node.global) {
        this.word(kind != null ? kind : id.type === "Identifier" ? "namespace" : "module");
        this.space();
      }
      this.print(id);
      if (!node.body) {
        this.semicolon();
        return;
      }
      let body = node.body;
      while (body.type === "TSModuleDeclaration") {
        this.tokenChar(46);
        this.print(body.id);
        body = body.body;
      }
      this.space();
      this.print(body);
    }
    function TSModuleBlock(node) {
      printBraced(this, node, () => this.printSequence(node.body, true, true));
    }
    function TSImportType(node) {
      const {
        qualifier,
        options
      } = node;
      this.word("import");
      this.tokenChar(40);
      this.print(node.argument);
      if (options) {
        this.tokenChar(44);
        this.print(options);
      }
      this.tokenChar(41);
      if (qualifier) {
        this.tokenChar(46);
        this.print(qualifier);
      }
      const typeArguments = node.typeParameters;
      if (typeArguments) {
        this.print(typeArguments);
      }
    }
    function TSImportEqualsDeclaration(node) {
      const {
        id,
        moduleReference
      } = node;
      if (node.isExport) {
        this.word("export");
        this.space();
      }
      this.word("import");
      this.space();
      this.print(id);
      this.space();
      this.tokenChar(61);
      this.space();
      this.print(moduleReference);
      this.semicolon();
    }
    function TSExternalModuleReference(node) {
      this.token("require(");
      this.print(node.expression);
      this.tokenChar(41);
    }
    function TSNonNullExpression(node) {
      this.print(node.expression);
      this.tokenChar(33);
      this.setLastChar(33);
    }
    function TSExportAssignment(node) {
      this.word("export");
      this.space();
      this.tokenChar(61);
      this.space();
      this.print(node.expression);
      this.semicolon();
    }
    function TSNamespaceExportDeclaration(node) {
      this.word("export");
      this.space();
      this.word("as");
      this.space();
      this.word("namespace");
      this.space();
      this.print(node.id);
      this.semicolon();
    }
    function tsPrintSignatureDeclarationBase(node) {
      const {
        typeParameters
      } = node;
      const parameters = node.parameters;
      this.print(typeParameters);
      this.tokenChar(40);
      _methods._parameters.call(this, parameters, 41);
      const returnType = node.typeAnnotation;
      this.print(returnType);
    }
    function _tsPrintClassMemberModifiers(node) {
      const isPrivateField = node.type === "ClassPrivateProperty";
      const isPublicField = node.type === "ClassAccessorProperty" || node.type === "ClassProperty";
      printModifiersList(this, node, [isPublicField && node.declare && "declare", !isPrivateField && node.accessibility]);
      if (node.static) {
        this.word("static");
        this.space();
      }
      printModifiersList(this, node, [!isPrivateField && node.abstract && "abstract", !isPrivateField && node.override && "override", (isPublicField || isPrivateField) && node.readonly && "readonly"]);
    }
    function printBraced(printer, node, cb) {
      printer.token("{");
      const oldNoLineTerminatorAfterNode = printer.enterDelimited();
      cb();
      printer._noLineTerminatorAfterNode = oldNoLineTerminatorAfterNode;
      printer.rightBrace(node);
    }
    function printModifiersList(printer, node, modifiers) {
      var _printer$tokenMap2;
      const modifiersSet = /* @__PURE__ */ new Set();
      for (const modifier of modifiers) {
        if (modifier) modifiersSet.add(modifier);
      }
      (_printer$tokenMap2 = printer.tokenMap) == null || _printer$tokenMap2.find(node, (tok) => {
        if (modifiersSet.has(tok.value)) {
          printer.token(tok.value);
          printer.space();
          modifiersSet.delete(tok.value);
          return modifiersSet.size === 0;
        }
        return false;
      });
      for (const modifier of modifiersSet) {
        printer.word(modifier);
        printer.space();
      }
    }
  }
});

// node_modules/@babel/generator/lib/generators/modules.js
var require_modules = __commonJS({
  "node_modules/@babel/generator/lib/generators/modules.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.ExportAllDeclaration = ExportAllDeclaration;
    exports2.ExportDefaultDeclaration = ExportDefaultDeclaration;
    exports2.ExportDefaultSpecifier = ExportDefaultSpecifier;
    exports2.ExportNamedDeclaration = ExportNamedDeclaration;
    exports2.ExportNamespaceSpecifier = ExportNamespaceSpecifier;
    exports2.ExportSpecifier = ExportSpecifier;
    exports2.ImportAttribute = ImportAttribute;
    exports2.ImportDeclaration = ImportDeclaration;
    exports2.ImportDefaultSpecifier = ImportDefaultSpecifier;
    exports2.ImportExpression = ImportExpression;
    exports2.ImportNamespaceSpecifier = ImportNamespaceSpecifier;
    exports2.ImportSpecifier = ImportSpecifier;
    exports2._printAttributes = _printAttributes;
    var _t = require_lib3();
    var _index = require_node2();
    var _expressions = require_expressions();
    var {
      isClassDeclaration,
      isExportDefaultSpecifier,
      isExportNamespaceSpecifier,
      isImportDefaultSpecifier,
      isImportNamespaceSpecifier,
      isStatement
    } = _t;
    function ImportSpecifier(node) {
      if (node.importKind === "type" || node.importKind === "typeof") {
        this.word(node.importKind);
        this.space();
      }
      this.print(node.imported);
      if (node.local && node.local.name !== node.imported.name) {
        this.space();
        this.word("as");
        this.space();
        this.print(node.local);
      }
    }
    function ImportDefaultSpecifier(node) {
      this.print(node.local);
    }
    function ExportDefaultSpecifier(node) {
      this.print(node.exported);
    }
    function ExportSpecifier(node) {
      if (node.exportKind === "type") {
        this.word("type");
        this.space();
      }
      this.print(node.local);
      if (node.exported && node.local.name !== node.exported.name) {
        this.space();
        this.word("as");
        this.space();
        this.print(node.exported);
      }
    }
    function ExportNamespaceSpecifier(node) {
      this.tokenChar(42);
      this.space();
      this.word("as");
      this.space();
      this.print(node.exported);
    }
    var warningShown = false;
    function _printAttributes(node, hasPreviousBrace) {
      var _node$extra;
      const {
        attributes
      } = node;
      var {
        assertions
      } = node;
      const {
        importAttributesKeyword
      } = this.format;
      if (attributes && !importAttributesKeyword && node.extra && (node.extra.deprecatedAssertSyntax || node.extra.deprecatedWithLegacySyntax) && !warningShown) {
        warningShown = true;
        console.warn(`You are using import attributes, without specifying the desired output syntax.
Please specify the "importAttributesKeyword" generator option, whose value can be one of:
 - "with"        : \`import { a } from "b" with { type: "json" };\`
 - "assert"      : \`import { a } from "b" assert { type: "json" };\`
 - "with-legacy" : \`import { a } from "b" with type: "json";\`
`);
      }
      const useAssertKeyword = importAttributesKeyword === "assert" || !importAttributesKeyword && assertions;
      this.word(useAssertKeyword ? "assert" : "with");
      this.space();
      if (!useAssertKeyword && (importAttributesKeyword === "with-legacy" || !importAttributesKeyword && (_node$extra = node.extra) != null && _node$extra.deprecatedWithLegacySyntax)) {
        this.printList(attributes || assertions);
        return;
      }
      const occurrenceCount = hasPreviousBrace ? 1 : 0;
      this.token("{", void 0, occurrenceCount);
      this.space();
      this.printList(attributes || assertions, this.shouldPrintTrailingComma("}"));
      this.space();
      this.token("}", void 0, occurrenceCount);
    }
    function ExportAllDeclaration(node) {
      var _node$attributes, _node$assertions;
      this.word("export");
      this.space();
      if (node.exportKind === "type") {
        this.word("type");
        this.space();
      }
      this.tokenChar(42);
      this.space();
      this.word("from");
      this.space();
      if ((_node$attributes = node.attributes) != null && _node$attributes.length || (_node$assertions = node.assertions) != null && _node$assertions.length) {
        this.print(node.source, true);
        this.space();
        _printAttributes.call(this, node, false);
      } else {
        this.print(node.source);
      }
      this.semicolon();
    }
    function maybePrintDecoratorsBeforeExport(printer, node) {
      if (isClassDeclaration(node.declaration) && _expressions._shouldPrintDecoratorsBeforeExport.call(printer, node)) {
        printer.printJoin(node.declaration.decorators);
      }
    }
    function ExportNamedDeclaration(node) {
      maybePrintDecoratorsBeforeExport(this, node);
      this.word("export");
      this.space();
      if (node.declaration) {
        const declar = node.declaration;
        this.print(declar);
        if (!isStatement(declar)) this.semicolon();
      } else {
        if (node.exportKind === "type") {
          this.word("type");
          this.space();
        }
        const specifiers = node.specifiers.slice(0);
        let hasSpecial = false;
        for (; ; ) {
          const first = specifiers[0];
          if (isExportDefaultSpecifier(first) || isExportNamespaceSpecifier(first)) {
            hasSpecial = true;
            this.print(specifiers.shift());
            if (specifiers.length) {
              this.tokenChar(44);
              this.space();
            }
          } else {
            break;
          }
        }
        let hasBrace = false;
        if (specifiers.length || !specifiers.length && !hasSpecial) {
          hasBrace = true;
          this.tokenChar(123);
          if (specifiers.length) {
            this.space();
            this.printList(specifiers, this.shouldPrintTrailingComma("}"));
            this.space();
          }
          this.tokenChar(125);
        }
        if (node.source) {
          var _node$attributes2, _node$assertions2;
          this.space();
          this.word("from");
          this.space();
          if ((_node$attributes2 = node.attributes) != null && _node$attributes2.length || (_node$assertions2 = node.assertions) != null && _node$assertions2.length) {
            this.print(node.source, true);
            this.space();
            _printAttributes.call(this, node, hasBrace);
          } else {
            this.print(node.source);
          }
        }
        this.semicolon();
      }
    }
    function ExportDefaultDeclaration(node) {
      maybePrintDecoratorsBeforeExport(this, node);
      this.word("export");
      this.noIndentInnerCommentsHere();
      this.space();
      this.word("default");
      this.space();
      this.tokenContext |= _index.TokenContext.exportDefault;
      const declar = node.declaration;
      this.print(declar);
      if (!isStatement(declar)) this.semicolon();
    }
    function ImportDeclaration(node) {
      var _node$attributes3, _node$assertions3;
      this.word("import");
      this.space();
      const isTypeKind = node.importKind === "type" || node.importKind === "typeof";
      if (isTypeKind) {
        this.noIndentInnerCommentsHere();
        this.word(node.importKind);
        this.space();
      } else if (node.module) {
        this.noIndentInnerCommentsHere();
        this.word("module");
        this.space();
      } else if (node.phase) {
        this.noIndentInnerCommentsHere();
        this.word(node.phase);
        this.space();
      }
      const specifiers = node.specifiers.slice(0);
      const hasSpecifiers = !!specifiers.length;
      while (hasSpecifiers) {
        const first = specifiers[0];
        if (isImportDefaultSpecifier(first) || isImportNamespaceSpecifier(first)) {
          this.print(specifiers.shift());
          if (specifiers.length) {
            this.tokenChar(44);
            this.space();
          }
        } else {
          break;
        }
      }
      let hasBrace = false;
      if (specifiers.length) {
        hasBrace = true;
        this.tokenChar(123);
        this.space();
        this.printList(specifiers, this.shouldPrintTrailingComma("}"));
        this.space();
        this.tokenChar(125);
      } else if (isTypeKind && !hasSpecifiers) {
        hasBrace = true;
        this.tokenChar(123);
        this.tokenChar(125);
      }
      if (hasSpecifiers || isTypeKind) {
        this.space();
        this.word("from");
        this.space();
      }
      if ((_node$attributes3 = node.attributes) != null && _node$attributes3.length || (_node$assertions3 = node.assertions) != null && _node$assertions3.length) {
        this.print(node.source, true);
        this.space();
        _printAttributes.call(this, node, hasBrace);
      } else {
        this.print(node.source);
      }
      this.semicolon();
    }
    function ImportAttribute(node) {
      this.print(node.key);
      this.tokenChar(58);
      this.space();
      this.print(node.value);
    }
    function ImportNamespaceSpecifier(node) {
      this.tokenChar(42);
      this.space();
      this.word("as");
      this.space();
      this.print(node.local);
    }
    function ImportExpression(node) {
      this.word("import");
      if (node.phase) {
        this.tokenChar(46);
        this.word(node.phase);
      }
      this.tokenChar(40);
      const shouldPrintTrailingComma = this.shouldPrintTrailingComma(")");
      this.print(node.source);
      if (node.options != null) {
        this.tokenChar(44);
        this.space();
        this.print(node.options);
      }
      if (shouldPrintTrailingComma) {
        this.tokenChar(44);
      }
      this.rightParens(node);
    }
  }
});

// node_modules/jsesc/jsesc.js
var require_jsesc = __commonJS({
  "node_modules/jsesc/jsesc.js"(exports2, module2) {
    "use strict";
    var object = {};
    var hasOwnProperty2 = object.hasOwnProperty;
    var forOwn = (object2, callback) => {
      for (const key in object2) {
        if (hasOwnProperty2.call(object2, key)) {
          callback(key, object2[key]);
        }
      }
    };
    var extend = (destination, source) => {
      if (!source) {
        return destination;
      }
      forOwn(source, (key, value2) => {
        destination[key] = value2;
      });
      return destination;
    };
    var forEach = (array, callback) => {
      const length = array.length;
      let index = -1;
      while (++index < length) {
        callback(array[index]);
      }
    };
    var fourHexEscape = (hex) => {
      return "\\u" + ("0000" + hex).slice(-4);
    };
    var hexadecimal = (code, lowercase) => {
      let hexadecimal2 = code.toString(16);
      if (lowercase) return hexadecimal2;
      return hexadecimal2.toUpperCase();
    };
    var toString = object.toString;
    var isArray = Array.isArray;
    var isBuffer = (value2) => {
      return typeof Buffer === "function" && Buffer.isBuffer(value2);
    };
    var isObject = (value2) => {
      return toString.call(value2) == "[object Object]";
    };
    var isString = (value2) => {
      return typeof value2 == "string" || toString.call(value2) == "[object String]";
    };
    var isNumber = (value2) => {
      return typeof value2 == "number" || toString.call(value2) == "[object Number]";
    };
    var isBigInt = (value2) => {
      return typeof value2 == "bigint";
    };
    var isFunction = (value2) => {
      return typeof value2 == "function";
    };
    var isMap = (value2) => {
      return toString.call(value2) == "[object Map]";
    };
    var isSet = (value2) => {
      return toString.call(value2) == "[object Set]";
    };
    var singleEscapes = {
      "\\": "\\\\",
      "\b": "\\b",
      "\f": "\\f",
      "\n": "\\n",
      "\r": "\\r",
      "	": "\\t"
      // `\v` is omitted intentionally, because in IE < 9, '\v' == 'v'.
      // '\v': '\\x0B'
    };
    var regexSingleEscape = /[\\\b\f\n\r\t]/;
    var regexDigit = /[0-9]/;
    var regexWhitespace = /[\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/;
    var escapeEverythingRegex = /([\uD800-\uDBFF][\uDC00-\uDFFF])|([\uD800-\uDFFF])|(['"`])|[^]/g;
    var escapeNonAsciiRegex = /([\uD800-\uDBFF][\uDC00-\uDFFF])|([\uD800-\uDFFF])|(['"`])|[^ !#-&\(-\[\]-_a-~]/g;
    var jsesc = (argument, options) => {
      const increaseIndentation = () => {
        oldIndent = indent;
        ++options.indentLevel;
        indent = options.indent.repeat(options.indentLevel);
      };
      const defaults = {
        "escapeEverything": false,
        "minimal": false,
        "isScriptContext": false,
        "quotes": "single",
        "wrap": false,
        "es6": false,
        "json": false,
        "compact": true,
        "lowercaseHex": false,
        "numbers": "decimal",
        "indent": "	",
        "indentLevel": 0,
        "__inline1__": false,
        "__inline2__": false
      };
      const json = options && options.json;
      if (json) {
        defaults.quotes = "double";
        defaults.wrap = true;
      }
      options = extend(defaults, options);
      if (options.quotes != "single" && options.quotes != "double" && options.quotes != "backtick") {
        options.quotes = "single";
      }
      const quote = options.quotes == "double" ? '"' : options.quotes == "backtick" ? "`" : "'";
      const compact = options.compact;
      const lowercaseHex = options.lowercaseHex;
      let indent = options.indent.repeat(options.indentLevel);
      let oldIndent = "";
      const inline1 = options.__inline1__;
      const inline2 = options.__inline2__;
      const newLine = compact ? "" : "\n";
      let result;
      let isEmpty = true;
      const useBinNumbers = options.numbers == "binary";
      const useOctNumbers = options.numbers == "octal";
      const useDecNumbers = options.numbers == "decimal";
      const useHexNumbers = options.numbers == "hexadecimal";
      if (json && argument && isFunction(argument.toJSON)) {
        argument = argument.toJSON();
      }
      if (!isString(argument)) {
        if (isMap(argument)) {
          if (argument.size == 0) {
            return "new Map()";
          }
          if (!compact) {
            options.__inline1__ = true;
            options.__inline2__ = false;
          }
          return "new Map(" + jsesc(Array.from(argument), options) + ")";
        }
        if (isSet(argument)) {
          if (argument.size == 0) {
            return "new Set()";
          }
          return "new Set(" + jsesc(Array.from(argument), options) + ")";
        }
        if (isBuffer(argument)) {
          if (argument.length == 0) {
            return "Buffer.from([])";
          }
          return "Buffer.from(" + jsesc(Array.from(argument), options) + ")";
        }
        if (isArray(argument)) {
          result = [];
          options.wrap = true;
          if (inline1) {
            options.__inline1__ = false;
            options.__inline2__ = true;
          }
          if (!inline2) {
            increaseIndentation();
          }
          forEach(argument, (value2) => {
            isEmpty = false;
            if (inline2) {
              options.__inline2__ = false;
            }
            result.push(
              (compact || inline2 ? "" : indent) + jsesc(value2, options)
            );
          });
          if (isEmpty) {
            return "[]";
          }
          if (inline2) {
            return "[" + result.join(", ") + "]";
          }
          return "[" + newLine + result.join("," + newLine) + newLine + (compact ? "" : oldIndent) + "]";
        } else if (isNumber(argument) || isBigInt(argument)) {
          if (json) {
            return JSON.stringify(Number(argument));
          }
          let result2;
          if (useDecNumbers) {
            result2 = String(argument);
          } else if (useHexNumbers) {
            let hexadecimal2 = argument.toString(16);
            if (!lowercaseHex) {
              hexadecimal2 = hexadecimal2.toUpperCase();
            }
            result2 = "0x" + hexadecimal2;
          } else if (useBinNumbers) {
            result2 = "0b" + argument.toString(2);
          } else if (useOctNumbers) {
            result2 = "0o" + argument.toString(8);
          }
          if (isBigInt(argument)) {
            return result2 + "n";
          }
          return result2;
        } else if (isBigInt(argument)) {
          if (json) {
            return JSON.stringify(Number(argument));
          }
          return argument + "n";
        } else if (!isObject(argument)) {
          if (json) {
            return JSON.stringify(argument) || "null";
          }
          return String(argument);
        } else {
          result = [];
          options.wrap = true;
          increaseIndentation();
          forOwn(argument, (key, value2) => {
            isEmpty = false;
            result.push(
              (compact ? "" : indent) + jsesc(key, options) + ":" + (compact ? "" : " ") + jsesc(value2, options)
            );
          });
          if (isEmpty) {
            return "{}";
          }
          return "{" + newLine + result.join("," + newLine) + newLine + (compact ? "" : oldIndent) + "}";
        }
      }
      const regex = options.escapeEverything ? escapeEverythingRegex : escapeNonAsciiRegex;
      result = argument.replace(regex, (char, pair, lone, quoteChar, index, string) => {
        if (pair) {
          if (options.minimal) return pair;
          const first = pair.charCodeAt(0);
          const second = pair.charCodeAt(1);
          if (options.es6) {
            const codePoint = (first - 55296) * 1024 + second - 56320 + 65536;
            const hex2 = hexadecimal(codePoint, lowercaseHex);
            return "\\u{" + hex2 + "}";
          }
          return fourHexEscape(hexadecimal(first, lowercaseHex)) + fourHexEscape(hexadecimal(second, lowercaseHex));
        }
        if (lone) {
          return fourHexEscape(hexadecimal(lone.charCodeAt(0), lowercaseHex));
        }
        if (char == "\0" && !json && !regexDigit.test(string.charAt(index + 1))) {
          return "\\0";
        }
        if (quoteChar) {
          if (quoteChar == quote || options.escapeEverything) {
            return "\\" + quoteChar;
          }
          return quoteChar;
        }
        if (regexSingleEscape.test(char)) {
          return singleEscapes[char];
        }
        if (options.minimal && !regexWhitespace.test(char)) {
          return char;
        }
        const hex = hexadecimal(char.charCodeAt(0), lowercaseHex);
        if (json || hex.length > 2) {
          return fourHexEscape(hex);
        }
        return "\\x" + ("00" + hex).slice(-2);
      });
      if (quote == "`") {
        result = result.replace(/\$\{/g, "\\${");
      }
      if (options.isScriptContext) {
        result = result.replace(/<\/(script|style)/gi, "<\\/$1").replace(/<!--/g, json ? "\\u003C!--" : "\\x3C!--");
      }
      if (options.wrap) {
        result = quote + result + quote;
      }
      return result;
    };
    jsesc.version = "3.0.2";
    module2.exports = jsesc;
  }
});

// node_modules/@babel/generator/lib/generators/types.js
var require_types = __commonJS({
  "node_modules/@babel/generator/lib/generators/types.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.ArgumentPlaceholder = ArgumentPlaceholder;
    exports2.ArrayPattern = exports2.ArrayExpression = ArrayExpression;
    exports2.BigIntLiteral = BigIntLiteral;
    exports2.BooleanLiteral = BooleanLiteral;
    exports2.Identifier = Identifier;
    exports2.NullLiteral = NullLiteral;
    exports2.NumericLiteral = NumericLiteral;
    exports2.ObjectPattern = exports2.ObjectExpression = ObjectExpression;
    exports2.ObjectMethod = ObjectMethod;
    exports2.ObjectProperty = ObjectProperty;
    exports2.PipelineBareFunction = PipelineBareFunction;
    exports2.PipelinePrimaryTopicReference = PipelinePrimaryTopicReference;
    exports2.PipelineTopicExpression = PipelineTopicExpression;
    exports2.RegExpLiteral = RegExpLiteral;
    exports2.SpreadElement = exports2.RestElement = RestElement;
    exports2.StringLiteral = StringLiteral;
    exports2.TopicReference = TopicReference;
    exports2.VoidPattern = VoidPattern;
    exports2._getRawIdentifier = _getRawIdentifier;
    var _t = require_lib3();
    var _jsesc = require_jsesc();
    var _methods = require_methods();
    var {
      isAssignmentPattern,
      isIdentifier
    } = _t;
    var lastRawIdentResult = "";
    function _getRawIdentifier(node) {
      const {
        name
      } = node;
      const token = this.tokenMap.find(node, (tok) => tok.value === name);
      if (token) {
        lastRawIdentResult = this._originalCode.slice(token.start, token.end);
        return lastRawIdentResult;
      }
      return lastRawIdentResult = node.name;
    }
    function Identifier(node) {
      if (this._buf._map) {
        var _node$loc;
        this.sourceIdentifierName(((_node$loc = node.loc) == null ? void 0 : _node$loc.identifierName) || node.name);
      }
      this.word(this.tokenMap ? lastRawIdentResult : node.name);
    }
    function ArgumentPlaceholder() {
      this.tokenChar(63);
    }
    function RestElement(node) {
      this.token("...");
      this.print(node.argument);
    }
    function ObjectExpression(node) {
      const props = node.properties;
      this.tokenChar(123);
      if (props.length) {
        const oldNoLineTerminatorAfterNode = this.enterDelimited();
        this.space();
        this.printList(props, this.shouldPrintTrailingComma("}"), true, true, void 0, true);
        this.space();
        this._noLineTerminatorAfterNode = oldNoLineTerminatorAfterNode;
      }
      this.rightBrace(node);
    }
    function ObjectMethod(node) {
      this.printJoin(node.decorators);
      _methods._methodHead.call(this, node);
      this.space();
      this.print(node.body);
    }
    function ObjectProperty(node) {
      this.printJoin(node.decorators);
      if (node.computed) {
        this.tokenChar(91);
        this.print(node.key);
        this.tokenChar(93);
      } else {
        if (isAssignmentPattern(node.value) && isIdentifier(node.key) && node.key.name === node.value.left.name) {
          this.print(node.value);
          return;
        }
        this.print(node.key);
        if (node.shorthand && isIdentifier(node.key) && isIdentifier(node.value) && node.key.name === node.value.name) {
          return;
        }
      }
      this.tokenChar(58);
      this.space();
      this.print(node.value);
    }
    function ArrayExpression(node) {
      const elems = node.elements;
      const len = elems.length;
      this.tokenChar(91);
      const oldNoLineTerminatorAfterNode = this.enterDelimited();
      for (let i = 0; i < elems.length; i++) {
        const elem = elems[i];
        if (elem) {
          if (i > 0) this.space();
          this.print(elem, void 0, true);
          if (i < len - 1 || this.shouldPrintTrailingComma("]")) {
            this.tokenChar(44, i);
          }
        } else {
          this.tokenChar(44, i);
        }
      }
      this._noLineTerminatorAfterNode = oldNoLineTerminatorAfterNode;
      this.tokenChar(93);
    }
    function RegExpLiteral(node) {
      this.word(`/${node.pattern}/${node.flags}`, false);
    }
    function BooleanLiteral(node) {
      this.word(node.value ? "true" : "false");
    }
    function NullLiteral() {
      this.word("null");
    }
    function NumericLiteral(node) {
      const raw = this.getPossibleRaw(node);
      const opts = this.format.jsescOption;
      const value2 = node.value;
      const str = value2 + "";
      if (opts.numbers) {
        this.number(_jsesc(value2, opts), value2);
      } else if (raw == null) {
        this.number(str, value2);
      } else if (this.format.minified) {
        this.number(raw.length < str.length ? raw : str, value2);
      } else {
        this.number(raw, value2);
      }
    }
    function StringLiteral(node) {
      const raw = this.getPossibleRaw(node);
      if (!this.format.minified && raw !== void 0) {
        this.token(raw);
        return;
      }
      const val = _jsesc(node.value, this.format.jsescOption);
      this.token(val);
    }
    function BigIntLiteral(node) {
      const raw = this.getPossibleRaw(node);
      if (!this.format.minified && raw !== void 0) {
        this.word(raw);
        return;
      }
      this.word(node.value + "n");
    }
    var validTopicTokenSet = /* @__PURE__ */ new Set(["^^", "@@", "^", "%", "#"]);
    function TopicReference() {
      const {
        topicToken
      } = this.format;
      if (validTopicTokenSet.has(topicToken)) {
        this.token(topicToken);
      } else {
        const givenTopicTokenJSON = JSON.stringify(topicToken);
        const validTopics = Array.from(validTopicTokenSet, (v) => JSON.stringify(v));
        throw new Error(`The "topicToken" generator option must be one of ${validTopics.join(", ")} (${givenTopicTokenJSON} received instead).`);
      }
    }
    function PipelineTopicExpression(node) {
      this.print(node.expression);
    }
    function PipelineBareFunction(node) {
      this.print(node.callee);
    }
    function PipelinePrimaryTopicReference() {
      this.tokenChar(35);
    }
    function VoidPattern() {
      this.word("void");
    }
  }
});

// node_modules/@babel/generator/lib/generators/flow.js
var require_flow2 = __commonJS({
  "node_modules/@babel/generator/lib/generators/flow.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.AnyTypeAnnotation = AnyTypeAnnotation;
    exports2.ArrayTypeAnnotation = ArrayTypeAnnotation;
    exports2.BooleanLiteralTypeAnnotation = BooleanLiteralTypeAnnotation;
    exports2.BooleanTypeAnnotation = BooleanTypeAnnotation;
    exports2.DeclareClass = DeclareClass;
    exports2.DeclareExportAllDeclaration = DeclareExportAllDeclaration;
    exports2.DeclareExportDeclaration = DeclareExportDeclaration;
    exports2.DeclareFunction = DeclareFunction;
    exports2.DeclareInterface = DeclareInterface;
    exports2.DeclareModule = DeclareModule;
    exports2.DeclareModuleExports = DeclareModuleExports;
    exports2.DeclareOpaqueType = DeclareOpaqueType;
    exports2.DeclareTypeAlias = DeclareTypeAlias;
    exports2.DeclareVariable = DeclareVariable;
    exports2.DeclaredPredicate = DeclaredPredicate;
    exports2.EmptyTypeAnnotation = EmptyTypeAnnotation;
    exports2.EnumBooleanBody = EnumBooleanBody;
    exports2.EnumBooleanMember = EnumBooleanMember;
    exports2.EnumDeclaration = EnumDeclaration;
    exports2.EnumDefaultedMember = EnumDefaultedMember;
    exports2.EnumNumberBody = EnumNumberBody;
    exports2.EnumNumberMember = EnumNumberMember;
    exports2.EnumStringBody = EnumStringBody;
    exports2.EnumStringMember = EnumStringMember;
    exports2.EnumSymbolBody = EnumSymbolBody;
    exports2.ExistsTypeAnnotation = ExistsTypeAnnotation;
    exports2.FunctionTypeAnnotation = FunctionTypeAnnotation;
    exports2.FunctionTypeParam = FunctionTypeParam;
    exports2.IndexedAccessType = IndexedAccessType;
    exports2.InferredPredicate = InferredPredicate;
    exports2.InterfaceDeclaration = InterfaceDeclaration;
    exports2.GenericTypeAnnotation = exports2.ClassImplements = exports2.InterfaceExtends = InterfaceExtends;
    exports2.InterfaceTypeAnnotation = InterfaceTypeAnnotation;
    exports2.IntersectionTypeAnnotation = IntersectionTypeAnnotation;
    exports2.MixedTypeAnnotation = MixedTypeAnnotation;
    exports2.NullLiteralTypeAnnotation = NullLiteralTypeAnnotation;
    exports2.NullableTypeAnnotation = NullableTypeAnnotation;
    Object.defineProperty(exports2, "NumberLiteralTypeAnnotation", {
      enumerable: true,
      get: function() {
        return _types2.NumericLiteral;
      }
    });
    exports2.NumberTypeAnnotation = NumberTypeAnnotation;
    exports2.ObjectTypeAnnotation = ObjectTypeAnnotation;
    exports2.ObjectTypeCallProperty = ObjectTypeCallProperty;
    exports2.ObjectTypeIndexer = ObjectTypeIndexer;
    exports2.ObjectTypeInternalSlot = ObjectTypeInternalSlot;
    exports2.ObjectTypeProperty = ObjectTypeProperty;
    exports2.ObjectTypeSpreadProperty = ObjectTypeSpreadProperty;
    exports2.OpaqueType = OpaqueType;
    exports2.OptionalIndexedAccessType = OptionalIndexedAccessType;
    exports2.QualifiedTypeIdentifier = QualifiedTypeIdentifier;
    Object.defineProperty(exports2, "StringLiteralTypeAnnotation", {
      enumerable: true,
      get: function() {
        return _types2.StringLiteral;
      }
    });
    exports2.StringTypeAnnotation = StringTypeAnnotation;
    exports2.SymbolTypeAnnotation = SymbolTypeAnnotation;
    exports2.ThisTypeAnnotation = ThisTypeAnnotation;
    exports2.TupleTypeAnnotation = TupleTypeAnnotation;
    exports2.TypeAlias = TypeAlias;
    exports2.TypeAnnotation = TypeAnnotation;
    exports2.TypeCastExpression = TypeCastExpression;
    exports2.TypeParameter = TypeParameter;
    exports2.TypeParameterDeclaration = exports2.TypeParameterInstantiation = TypeParameterInstantiation;
    exports2.TypeofTypeAnnotation = TypeofTypeAnnotation;
    exports2.UnionTypeAnnotation = UnionTypeAnnotation;
    exports2.Variance = Variance;
    exports2.VoidTypeAnnotation = VoidTypeAnnotation;
    exports2._interfaceish = _interfaceish;
    exports2._variance = _variance;
    var _t = require_lib3();
    var _modules = require_modules();
    var _index = require_node2();
    var _types2 = require_types();
    var {
      isDeclareExportDeclaration,
      isStatement
    } = _t;
    function AnyTypeAnnotation() {
      this.word("any");
    }
    function ArrayTypeAnnotation(node) {
      this.print(node.elementType, true);
      this.tokenChar(91);
      this.tokenChar(93);
    }
    function BooleanTypeAnnotation() {
      this.word("boolean");
    }
    function BooleanLiteralTypeAnnotation(node) {
      this.word(node.value ? "true" : "false");
    }
    function NullLiteralTypeAnnotation() {
      this.word("null");
    }
    function DeclareClass(node, parent) {
      if (!isDeclareExportDeclaration(parent)) {
        this.word("declare");
        this.space();
      }
      this.word("class");
      this.space();
      _interfaceish.call(this, node);
    }
    function DeclareFunction(node, parent) {
      if (!isDeclareExportDeclaration(parent)) {
        this.word("declare");
        this.space();
      }
      this.word("function");
      this.space();
      this.print(node.id);
      this.print(node.id.typeAnnotation.typeAnnotation);
      if (node.predicate) {
        this.space();
        this.print(node.predicate);
      }
      this.semicolon();
    }
    function InferredPredicate() {
      this.tokenChar(37);
      this.word("checks");
    }
    function DeclaredPredicate(node) {
      this.tokenChar(37);
      this.word("checks");
      this.tokenChar(40);
      this.print(node.value);
      this.tokenChar(41);
    }
    function DeclareInterface(node) {
      this.word("declare");
      this.space();
      InterfaceDeclaration.call(this, node);
    }
    function DeclareModule(node) {
      this.word("declare");
      this.space();
      this.word("module");
      this.space();
      this.print(node.id);
      this.space();
      this.print(node.body);
    }
    function DeclareModuleExports(node) {
      this.word("declare");
      this.space();
      this.word("module");
      this.tokenChar(46);
      this.word("exports");
      this.print(node.typeAnnotation);
    }
    function DeclareTypeAlias(node) {
      this.word("declare");
      this.space();
      TypeAlias.call(this, node);
    }
    function DeclareOpaqueType(node, parent) {
      if (!isDeclareExportDeclaration(parent)) {
        this.word("declare");
        this.space();
      }
      OpaqueType.call(this, node);
    }
    function DeclareVariable(node, parent) {
      if (!isDeclareExportDeclaration(parent)) {
        this.word("declare");
        this.space();
      }
      this.word("var");
      this.space();
      this.print(node.id);
      this.print(node.id.typeAnnotation);
      this.semicolon();
    }
    function DeclareExportDeclaration(node) {
      this.word("declare");
      this.space();
      this.word("export");
      this.space();
      if (node.default) {
        this.word("default");
        this.space();
      }
      FlowExportDeclaration.call(this, node);
    }
    function DeclareExportAllDeclaration(node) {
      this.word("declare");
      this.space();
      _modules.ExportAllDeclaration.call(this, node);
    }
    function EnumDeclaration(node) {
      const {
        id,
        body
      } = node;
      this.word("enum");
      this.space();
      this.print(id);
      this.print(body);
    }
    function enumExplicitType(context, name, hasExplicitType) {
      if (hasExplicitType) {
        context.space();
        context.word("of");
        context.space();
        context.word(name);
      }
      context.space();
    }
    function enumBody(context, node) {
      const {
        members
      } = node;
      context.token("{");
      context.indent();
      context.newline();
      for (const member of members) {
        context.print(member);
        context.newline();
      }
      if (node.hasUnknownMembers) {
        context.token("...");
        context.newline();
      }
      context.dedent();
      context.token("}");
    }
    function EnumBooleanBody(node) {
      const {
        explicitType
      } = node;
      enumExplicitType(this, "boolean", explicitType);
      enumBody(this, node);
    }
    function EnumNumberBody(node) {
      const {
        explicitType
      } = node;
      enumExplicitType(this, "number", explicitType);
      enumBody(this, node);
    }
    function EnumStringBody(node) {
      const {
        explicitType
      } = node;
      enumExplicitType(this, "string", explicitType);
      enumBody(this, node);
    }
    function EnumSymbolBody(node) {
      enumExplicitType(this, "symbol", true);
      enumBody(this, node);
    }
    function EnumDefaultedMember(node) {
      const {
        id
      } = node;
      this.print(id);
      this.tokenChar(44);
    }
    function enumInitializedMember(context, node) {
      context.print(node.id);
      context.space();
      context.token("=");
      context.space();
      context.print(node.init);
      context.token(",");
    }
    function EnumBooleanMember(node) {
      enumInitializedMember(this, node);
    }
    function EnumNumberMember(node) {
      enumInitializedMember(this, node);
    }
    function EnumStringMember(node) {
      enumInitializedMember(this, node);
    }
    function FlowExportDeclaration(node) {
      if (node.declaration) {
        const declar = node.declaration;
        this.print(declar);
        if (!isStatement(declar)) this.semicolon();
      } else {
        this.tokenChar(123);
        if (node.specifiers.length) {
          this.space();
          this.printList(node.specifiers);
          this.space();
        }
        this.tokenChar(125);
        if (node.source) {
          this.space();
          this.word("from");
          this.space();
          this.print(node.source);
        }
        this.semicolon();
      }
    }
    function ExistsTypeAnnotation() {
      this.tokenChar(42);
    }
    function FunctionTypeAnnotation(node, parent) {
      this.print(node.typeParameters);
      this.tokenChar(40);
      if (node.this) {
        this.word("this");
        this.tokenChar(58);
        this.space();
        this.print(node.this.typeAnnotation);
        if (node.params.length || node.rest) {
          this.tokenChar(44);
          this.space();
        }
      }
      this.printList(node.params);
      if (node.rest) {
        if (node.params.length) {
          this.tokenChar(44);
          this.space();
        }
        this.token("...");
        this.print(node.rest);
      }
      this.tokenChar(41);
      const type = parent == null ? void 0 : parent.type;
      if (type != null && (type === "ObjectTypeCallProperty" || type === "ObjectTypeInternalSlot" || type === "DeclareFunction" || type === "ObjectTypeProperty" && parent.method)) {
        this.tokenChar(58);
      } else {
        this.space();
        this.token("=>");
      }
      this.space();
      this.print(node.returnType);
    }
    function FunctionTypeParam(node) {
      this.print(node.name);
      if (node.optional) this.tokenChar(63);
      if (node.name) {
        this.tokenChar(58);
        this.space();
      }
      this.print(node.typeAnnotation);
    }
    function InterfaceExtends(node) {
      this.print(node.id);
      this.print(node.typeParameters, true);
    }
    function _interfaceish(node) {
      var _node$extends;
      this.print(node.id);
      this.print(node.typeParameters);
      if ((_node$extends = node.extends) != null && _node$extends.length) {
        this.space();
        this.word("extends");
        this.space();
        this.printList(node.extends);
      }
      if (node.type === "DeclareClass") {
        var _node$mixins, _node$implements;
        if ((_node$mixins = node.mixins) != null && _node$mixins.length) {
          this.space();
          this.word("mixins");
          this.space();
          this.printList(node.mixins);
        }
        if ((_node$implements = node.implements) != null && _node$implements.length) {
          this.space();
          this.word("implements");
          this.space();
          this.printList(node.implements);
        }
      }
      this.space();
      this.print(node.body);
    }
    function _variance(node) {
      var _node$variance;
      const kind = (_node$variance = node.variance) == null ? void 0 : _node$variance.kind;
      if (kind != null) {
        if (kind === "plus") {
          this.tokenChar(43);
        } else if (kind === "minus") {
          this.tokenChar(45);
        }
      }
    }
    function InterfaceDeclaration(node) {
      this.word("interface");
      this.space();
      _interfaceish.call(this, node);
    }
    function andSeparator(occurrenceCount) {
      this.space();
      this.token("&", false, occurrenceCount);
      this.space();
    }
    function InterfaceTypeAnnotation(node) {
      var _node$extends2;
      this.word("interface");
      if ((_node$extends2 = node.extends) != null && _node$extends2.length) {
        this.space();
        this.word("extends");
        this.space();
        this.printList(node.extends);
      }
      this.space();
      this.print(node.body);
    }
    function IntersectionTypeAnnotation(node) {
      this.printJoin(node.types, void 0, void 0, andSeparator);
    }
    function MixedTypeAnnotation() {
      this.word("mixed");
    }
    function EmptyTypeAnnotation() {
      this.word("empty");
    }
    function NullableTypeAnnotation(node) {
      this.tokenChar(63);
      this.print(node.typeAnnotation);
    }
    function NumberTypeAnnotation() {
      this.word("number");
    }
    function StringTypeAnnotation() {
      this.word("string");
    }
    function ThisTypeAnnotation() {
      this.word("this");
    }
    function TupleTypeAnnotation(node) {
      this.tokenChar(91);
      this.printList(node.types);
      this.tokenChar(93);
    }
    function TypeofTypeAnnotation(node) {
      this.word("typeof");
      this.space();
      this.print(node.argument);
    }
    function TypeAlias(node) {
      this.word("type");
      this.space();
      this.print(node.id);
      this.print(node.typeParameters);
      this.space();
      this.tokenChar(61);
      this.space();
      this.print(node.right);
      this.semicolon();
    }
    function TypeAnnotation(node, parent) {
      this.tokenChar(58);
      this.space();
      if (parent.type === "ArrowFunctionExpression") {
        this.tokenContext |= _index.TokenContext.arrowFlowReturnType;
      } else if (node.optional) {
        this.tokenChar(63);
      }
      this.print(node.typeAnnotation);
    }
    function TypeParameterInstantiation(node) {
      this.tokenChar(60);
      this.printList(node.params);
      this.tokenChar(62);
    }
    function TypeParameter(node) {
      _variance.call(this, node);
      this.word(node.name);
      if (node.bound) {
        this.print(node.bound);
      }
      if (node.default) {
        this.space();
        this.tokenChar(61);
        this.space();
        this.print(node.default);
      }
    }
    function OpaqueType(node) {
      this.word("opaque");
      this.space();
      this.word("type");
      this.space();
      this.print(node.id);
      this.print(node.typeParameters);
      if (node.supertype) {
        this.tokenChar(58);
        this.space();
        this.print(node.supertype);
      }
      if (node.impltype) {
        this.space();
        this.tokenChar(61);
        this.space();
        this.print(node.impltype);
      }
      this.semicolon();
    }
    function ObjectTypeAnnotation(node) {
      if (node.exact) {
        this.token("{|");
      } else {
        this.tokenChar(123);
      }
      const props = [...node.properties, ...node.callProperties || [], ...node.indexers || [], ...node.internalSlots || []];
      if (props.length) {
        this.newline();
        this.space();
        this.printJoin(props, true, true, () => {
          if (props.length !== 1 || node.inexact) {
            this.tokenChar(44);
            this.space();
          }
        }, true);
        this.space();
      }
      if (node.inexact) {
        this.indent();
        this.token("...");
        if (props.length) {
          this.newline();
        }
        this.dedent();
      }
      if (node.exact) {
        this.token("|}");
      } else {
        this.tokenChar(125);
      }
    }
    function ObjectTypeInternalSlot(node) {
      if (node.static) {
        this.word("static");
        this.space();
      }
      this.tokenChar(91);
      this.tokenChar(91);
      this.print(node.id);
      this.tokenChar(93);
      this.tokenChar(93);
      if (node.optional) this.tokenChar(63);
      if (!node.method) {
        this.tokenChar(58);
        this.space();
      }
      this.print(node.value);
    }
    function ObjectTypeCallProperty(node) {
      if (node.static) {
        this.word("static");
        this.space();
      }
      this.print(node.value);
    }
    function ObjectTypeIndexer(node) {
      if (node.static) {
        this.word("static");
        this.space();
      }
      _variance.call(this, node);
      this.tokenChar(91);
      if (node.id) {
        this.print(node.id);
        this.tokenChar(58);
        this.space();
      }
      this.print(node.key);
      this.tokenChar(93);
      this.tokenChar(58);
      this.space();
      this.print(node.value);
    }
    function ObjectTypeProperty(node) {
      if (node.proto) {
        this.word("proto");
        this.space();
      }
      if (node.static) {
        this.word("static");
        this.space();
      }
      if (node.kind === "get" || node.kind === "set") {
        this.word(node.kind);
        this.space();
      }
      _variance.call(this, node);
      this.print(node.key);
      if (node.optional) this.tokenChar(63);
      if (!node.method) {
        this.tokenChar(58);
        this.space();
      }
      this.print(node.value);
    }
    function ObjectTypeSpreadProperty(node) {
      this.token("...");
      this.print(node.argument);
    }
    function QualifiedTypeIdentifier(node) {
      this.print(node.qualification);
      this.tokenChar(46);
      this.print(node.id);
    }
    function SymbolTypeAnnotation() {
      this.word("symbol");
    }
    function orSeparator(occurrenceCount) {
      this.space();
      this.token("|", false, occurrenceCount);
      this.space();
    }
    function UnionTypeAnnotation(node) {
      this.printJoin(node.types, void 0, void 0, orSeparator);
    }
    function TypeCastExpression(node) {
      this.tokenChar(40);
      this.print(node.expression);
      this.print(node.typeAnnotation);
      this.tokenChar(41);
    }
    function Variance(node) {
      if (node.kind === "plus") {
        this.tokenChar(43);
      } else {
        this.tokenChar(45);
      }
    }
    function VoidTypeAnnotation() {
      this.word("void");
    }
    function IndexedAccessType(node) {
      this.print(node.objectType, true);
      this.tokenChar(91);
      this.print(node.indexType);
      this.tokenChar(93);
    }
    function OptionalIndexedAccessType(node) {
      this.print(node.objectType);
      if (node.optional) {
        this.token("?.");
      }
      this.tokenChar(91);
      this.print(node.indexType);
      this.tokenChar(93);
    }
  }
});

// node_modules/@babel/generator/lib/generators/classes.js
var require_classes = __commonJS({
  "node_modules/@babel/generator/lib/generators/classes.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.ClassAccessorProperty = ClassAccessorProperty;
    exports2.ClassBody = ClassBody;
    exports2.ClassExpression = exports2.ClassDeclaration = ClassDeclaration;
    exports2.ClassMethod = ClassMethod;
    exports2.ClassPrivateMethod = ClassPrivateMethod;
    exports2.ClassPrivateProperty = ClassPrivateProperty;
    exports2.ClassProperty = ClassProperty;
    exports2.StaticBlock = StaticBlock;
    exports2._classMethodHead = _classMethodHead;
    var _t = require_lib3();
    var _expressions = require_expressions();
    var _typescript = require_typescript2();
    var _flow = require_flow2();
    var _methods = require_methods();
    var {
      isExportDefaultDeclaration,
      isExportNamedDeclaration
    } = _t;
    function ClassDeclaration(node, parent) {
      const inExport = isExportDefaultDeclaration(parent) || isExportNamedDeclaration(parent);
      if (!inExport || !_expressions._shouldPrintDecoratorsBeforeExport.call(this, parent)) {
        this.printJoin(node.decorators);
      }
      if (node.declare) {
        this.word("declare");
        this.space();
      }
      if (node.abstract) {
        this.word("abstract");
        this.space();
      }
      this.word("class");
      if (node.id) {
        this.space();
        this.print(node.id);
      }
      this.print(node.typeParameters);
      if (node.superClass) {
        this.space();
        this.word("extends");
        this.space();
        this.print(node.superClass);
        this.print(node.superTypeParameters);
      }
      if (node.implements) {
        this.space();
        this.word("implements");
        this.space();
        this.printList(node.implements);
      }
      this.space();
      this.print(node.body);
    }
    function ClassBody(node) {
      this.tokenChar(123);
      if (node.body.length === 0) {
        this.tokenChar(125);
      } else {
        const separator = classBodyEmptySemicolonsPrinter(this, node);
        separator == null || separator(-1);
        const oldNoLineTerminatorAfterNode = this.enterDelimited();
        this.printJoin(node.body, true, true, separator, true, true);
        this._noLineTerminatorAfterNode = oldNoLineTerminatorAfterNode;
        if (!this.endsWith(10)) this.newline();
        this.rightBrace(node);
      }
    }
    function classBodyEmptySemicolonsPrinter(printer, node) {
      if (!printer.tokenMap || node.start == null || node.end == null) {
        return null;
      }
      const indexes = printer.tokenMap.getIndexes(node);
      if (!indexes) return null;
      let k = 1;
      let occurrenceCount = 0;
      let nextLocIndex = 0;
      const advanceNextLocIndex = () => {
        while (nextLocIndex < node.body.length && node.body[nextLocIndex].start == null) {
          nextLocIndex++;
        }
      };
      advanceNextLocIndex();
      return (i) => {
        if (nextLocIndex <= i) {
          nextLocIndex = i + 1;
          advanceNextLocIndex();
        }
        const end = nextLocIndex === node.body.length ? node.end : node.body[nextLocIndex].start;
        let tok;
        while (k < indexes.length && printer.tokenMap.matchesOriginal(tok = printer._tokens[indexes[k]], ";") && tok.start < end) {
          printer.tokenChar(59, occurrenceCount++);
          k++;
        }
      };
    }
    function ClassProperty(node) {
      this.printJoin(node.decorators);
      if (!node.static && !this.format.preserveFormat) {
        var _node$key$loc;
        const endLine = (_node$key$loc = node.key.loc) == null || (_node$key$loc = _node$key$loc.end) == null ? void 0 : _node$key$loc.line;
        if (endLine) this.catchUp(endLine);
      }
      _typescript._tsPrintClassMemberModifiers.call(this, node);
      if (node.computed) {
        this.tokenChar(91);
        this.print(node.key);
        this.tokenChar(93);
      } else {
        _flow._variance.call(this, node);
        this.print(node.key);
      }
      if (node.optional) {
        this.tokenChar(63);
      }
      if (node.definite) {
        this.tokenChar(33);
      }
      this.print(node.typeAnnotation);
      if (node.value) {
        this.space();
        this.tokenChar(61);
        this.space();
        this.print(node.value);
      }
      this.semicolon();
    }
    function ClassAccessorProperty(node) {
      var _node$key$loc2;
      this.printJoin(node.decorators);
      const endLine = (_node$key$loc2 = node.key.loc) == null || (_node$key$loc2 = _node$key$loc2.end) == null ? void 0 : _node$key$loc2.line;
      if (endLine) this.catchUp(endLine);
      _typescript._tsPrintClassMemberModifiers.call(this, node);
      this.word("accessor", true);
      this.space();
      if (node.computed) {
        this.tokenChar(91);
        this.print(node.key);
        this.tokenChar(93);
      } else {
        _flow._variance.call(this, node);
        this.print(node.key);
      }
      if (node.optional) {
        this.tokenChar(63);
      }
      if (node.definite) {
        this.tokenChar(33);
      }
      this.print(node.typeAnnotation);
      if (node.value) {
        this.space();
        this.tokenChar(61);
        this.space();
        this.print(node.value);
      }
      this.semicolon();
    }
    function ClassPrivateProperty(node) {
      this.printJoin(node.decorators);
      _typescript._tsPrintClassMemberModifiers.call(this, node);
      this.print(node.key);
      if (node.optional) {
        this.tokenChar(63);
      }
      if (node.definite) {
        this.tokenChar(33);
      }
      this.print(node.typeAnnotation);
      if (node.value) {
        this.space();
        this.tokenChar(61);
        this.space();
        this.print(node.value);
      }
      this.semicolon();
    }
    function ClassMethod(node) {
      _classMethodHead.call(this, node);
      this.space();
      this.print(node.body);
    }
    function ClassPrivateMethod(node) {
      _classMethodHead.call(this, node);
      this.space();
      this.print(node.body);
    }
    function _classMethodHead(node) {
      this.printJoin(node.decorators);
      if (!this.format.preserveFormat) {
        var _node$key$loc3;
        const endLine = (_node$key$loc3 = node.key.loc) == null || (_node$key$loc3 = _node$key$loc3.end) == null ? void 0 : _node$key$loc3.line;
        if (endLine) this.catchUp(endLine);
      }
      _typescript._tsPrintClassMemberModifiers.call(this, node);
      _methods._methodHead.call(this, node);
    }
    function StaticBlock(node) {
      this.word("static");
      this.space();
      this.tokenChar(123);
      if (node.body.length === 0) {
        this.tokenChar(125);
      } else {
        this.newline();
        this.printSequence(node.body, true);
        this.rightBrace(node);
      }
    }
  }
});

// node_modules/@babel/generator/lib/generators/base.js
var require_base = __commonJS({
  "node_modules/@babel/generator/lib/generators/base.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.BlockStatement = BlockStatement;
    exports2.Directive = Directive;
    exports2.DirectiveLiteral = DirectiveLiteral;
    exports2.File = File;
    exports2.InterpreterDirective = InterpreterDirective;
    exports2.Placeholder = Placeholder;
    exports2.Program = Program;
    function File(node) {
      if (node.program) {
        this.print(node.program.interpreter);
      }
      this.print(node.program);
    }
    function Program(node) {
      var _node$directives;
      this.printInnerComments(false);
      const directivesLen = (_node$directives = node.directives) == null ? void 0 : _node$directives.length;
      if (directivesLen) {
        var _node$directives$trai;
        const newline = node.body.length ? 2 : 1;
        this.printSequence(node.directives, void 0, void 0, newline);
        if (!((_node$directives$trai = node.directives[directivesLen - 1].trailingComments) != null && _node$directives$trai.length)) {
          this.newline(newline);
        }
      }
      this.printSequence(node.body);
    }
    function BlockStatement(node) {
      var _node$directives2;
      this.tokenChar(123);
      const oldNoLineTerminatorAfterNode = this.enterDelimited();
      const directivesLen = (_node$directives2 = node.directives) == null ? void 0 : _node$directives2.length;
      if (directivesLen) {
        var _node$directives$trai2;
        const newline = node.body.length ? 2 : 1;
        this.printSequence(node.directives, true, true, newline);
        if (!((_node$directives$trai2 = node.directives[directivesLen - 1].trailingComments) != null && _node$directives$trai2.length)) {
          this.newline(newline);
        }
      }
      this.printSequence(node.body, true, true);
      this._noLineTerminatorAfterNode = oldNoLineTerminatorAfterNode;
      this.rightBrace(node);
    }
    function Directive(node) {
      this.print(node.value);
      this.semicolon();
    }
    var unescapedSingleQuoteRE = /(?:^|[^\\])(?:\\\\)*'/;
    var unescapedDoubleQuoteRE = /(?:^|[^\\])(?:\\\\)*"/;
    function DirectiveLiteral(node) {
      const raw = this.getPossibleRaw(node);
      if (!this.format.minified && raw !== void 0) {
        this.token(raw);
        return;
      }
      const {
        value: value2
      } = node;
      if (!unescapedDoubleQuoteRE.test(value2)) {
        this.token(`"${value2}"`);
      } else if (!unescapedSingleQuoteRE.test(value2)) {
        this.token(`'${value2}'`);
      } else {
        throw new Error("Malformed AST: it is not possible to print a directive containing both unescaped single and double quotes.");
      }
    }
    function InterpreterDirective(node) {
      this.token(`#!${node.value}`);
      this._newline();
    }
    function Placeholder(node) {
      this.token("%%");
      this.print(node.name);
      this.token("%%");
      if (node.expectedNode === "Statement") {
        this.semicolon();
      }
    }
  }
});

// node_modules/@babel/generator/lib/generators/jsx.js
var require_jsx2 = __commonJS({
  "node_modules/@babel/generator/lib/generators/jsx.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.JSXAttribute = JSXAttribute;
    exports2.JSXClosingElement = JSXClosingElement;
    exports2.JSXClosingFragment = JSXClosingFragment;
    exports2.JSXElement = JSXElement;
    exports2.JSXEmptyExpression = JSXEmptyExpression;
    exports2.JSXExpressionContainer = JSXExpressionContainer;
    exports2.JSXFragment = JSXFragment;
    exports2.JSXIdentifier = JSXIdentifier;
    exports2.JSXMemberExpression = JSXMemberExpression;
    exports2.JSXNamespacedName = JSXNamespacedName;
    exports2.JSXOpeningElement = JSXOpeningElement;
    exports2.JSXOpeningFragment = JSXOpeningFragment;
    exports2.JSXSpreadAttribute = JSXSpreadAttribute;
    exports2.JSXSpreadChild = JSXSpreadChild;
    exports2.JSXText = JSXText;
    function JSXAttribute(node) {
      this.print(node.name);
      if (node.value) {
        this.tokenChar(61);
        this.print(node.value);
      }
    }
    function JSXIdentifier(node) {
      this.word(node.name);
    }
    function JSXNamespacedName(node) {
      this.print(node.namespace);
      this.tokenChar(58);
      this.print(node.name);
    }
    function JSXMemberExpression(node) {
      this.print(node.object);
      this.tokenChar(46);
      this.print(node.property);
    }
    function JSXSpreadAttribute(node) {
      this.tokenChar(123);
      this.token("...");
      this.print(node.argument);
      this.rightBrace(node);
    }
    function JSXExpressionContainer(node) {
      this.tokenChar(123);
      this.print(node.expression);
      this.rightBrace(node);
    }
    function JSXSpreadChild(node) {
      this.tokenChar(123);
      this.token("...");
      this.print(node.expression);
      this.rightBrace(node);
    }
    function JSXText(node) {
      const raw = this.getPossibleRaw(node);
      if (raw !== void 0) {
        this.token(raw, true);
      } else {
        this.token(node.value, true);
      }
    }
    function JSXElement(node) {
      const open = node.openingElement;
      this.print(open);
      if (open.selfClosing) return;
      this.indent();
      for (const child of node.children) {
        this.print(child);
      }
      this.dedent();
      this.print(node.closingElement);
    }
    function spaceSeparator() {
      this.space();
    }
    function JSXOpeningElement(node) {
      this.tokenChar(60);
      this.print(node.name);
      if (node.typeArguments) {
        this.print(node.typeArguments);
      }
      this.print(node.typeParameters);
      if (node.attributes.length > 0) {
        this.space();
        this.printJoin(node.attributes, void 0, void 0, spaceSeparator);
      }
      if (node.selfClosing) {
        this.space();
        this.tokenChar(47);
      }
      this.tokenChar(62);
    }
    function JSXClosingElement(node) {
      this.tokenChar(60);
      this.tokenChar(47);
      this.print(node.name);
      this.tokenChar(62);
    }
    function JSXEmptyExpression() {
      this.printInnerComments();
    }
    function JSXFragment(node) {
      this.print(node.openingFragment);
      this.indent();
      for (const child of node.children) {
        this.print(child);
      }
      this.dedent();
      this.print(node.closingFragment);
    }
    function JSXOpeningFragment() {
      this.tokenChar(60);
      this.tokenChar(62);
    }
    function JSXClosingFragment() {
      this.token("</");
      this.tokenChar(62);
    }
  }
});

// node_modules/@babel/generator/lib/generators/index.js
var require_generators = __commonJS({
  "node_modules/@babel/generator/lib/generators/index.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    var _templateLiterals = require_template_literals();
    Object.keys(_templateLiterals).forEach(function(key) {
      if (key === "default" || key === "__esModule") return;
      if (key in exports2 && exports2[key] === _templateLiterals[key]) return;
      Object.defineProperty(exports2, key, {
        enumerable: true,
        get: function() {
          return _templateLiterals[key];
        }
      });
    });
    var _expressions = require_expressions();
    Object.keys(_expressions).forEach(function(key) {
      if (key === "default" || key === "__esModule") return;
      if (key in exports2 && exports2[key] === _expressions[key]) return;
      Object.defineProperty(exports2, key, {
        enumerable: true,
        get: function() {
          return _expressions[key];
        }
      });
    });
    var _statements = require_statements();
    Object.keys(_statements).forEach(function(key) {
      if (key === "default" || key === "__esModule") return;
      if (key in exports2 && exports2[key] === _statements[key]) return;
      Object.defineProperty(exports2, key, {
        enumerable: true,
        get: function() {
          return _statements[key];
        }
      });
    });
    var _classes = require_classes();
    Object.keys(_classes).forEach(function(key) {
      if (key === "default" || key === "__esModule") return;
      if (key in exports2 && exports2[key] === _classes[key]) return;
      Object.defineProperty(exports2, key, {
        enumerable: true,
        get: function() {
          return _classes[key];
        }
      });
    });
    var _methods = require_methods();
    Object.keys(_methods).forEach(function(key) {
      if (key === "default" || key === "__esModule") return;
      if (key in exports2 && exports2[key] === _methods[key]) return;
      Object.defineProperty(exports2, key, {
        enumerable: true,
        get: function() {
          return _methods[key];
        }
      });
    });
    var _modules = require_modules();
    Object.keys(_modules).forEach(function(key) {
      if (key === "default" || key === "__esModule") return;
      if (key in exports2 && exports2[key] === _modules[key]) return;
      Object.defineProperty(exports2, key, {
        enumerable: true,
        get: function() {
          return _modules[key];
        }
      });
    });
    var _types = require_types();
    Object.keys(_types).forEach(function(key) {
      if (key === "default" || key === "__esModule") return;
      if (key in exports2 && exports2[key] === _types[key]) return;
      Object.defineProperty(exports2, key, {
        enumerable: true,
        get: function() {
          return _types[key];
        }
      });
    });
    var _flow = require_flow2();
    Object.keys(_flow).forEach(function(key) {
      if (key === "default" || key === "__esModule") return;
      if (key in exports2 && exports2[key] === _flow[key]) return;
      Object.defineProperty(exports2, key, {
        enumerable: true,
        get: function() {
          return _flow[key];
        }
      });
    });
    var _base = require_base();
    Object.keys(_base).forEach(function(key) {
      if (key === "default" || key === "__esModule") return;
      if (key in exports2 && exports2[key] === _base[key]) return;
      Object.defineProperty(exports2, key, {
        enumerable: true,
        get: function() {
          return _base[key];
        }
      });
    });
    var _jsx = require_jsx2();
    Object.keys(_jsx).forEach(function(key) {
      if (key === "default" || key === "__esModule") return;
      if (key in exports2 && exports2[key] === _jsx[key]) return;
      Object.defineProperty(exports2, key, {
        enumerable: true,
        get: function() {
          return _jsx[key];
        }
      });
    });
    var _typescript = require_typescript2();
    Object.keys(_typescript).forEach(function(key) {
      if (key === "default" || key === "__esModule") return;
      if (key in exports2 && exports2[key] === _typescript[key]) return;
      Object.defineProperty(exports2, key, {
        enumerable: true,
        get: function() {
          return _typescript[key];
        }
      });
    });
  }
});

// node_modules/@babel/generator/lib/generators/deprecated.js
var require_deprecated = __commonJS({
  "node_modules/@babel/generator/lib/generators/deprecated.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.DecimalLiteral = DecimalLiteral;
    exports2.Noop = Noop;
    exports2.RecordExpression = RecordExpression;
    exports2.TSExpressionWithTypeArguments = TSExpressionWithTypeArguments;
    exports2.TupleExpression = TupleExpression;
    function Noop() {
    }
    function TSExpressionWithTypeArguments(node) {
      this.print(node.expression);
      this.print(node.typeParameters);
    }
    function DecimalLiteral(node) {
      const raw = this.getPossibleRaw(node);
      if (!this.format.minified && raw !== void 0) {
        this.word(raw);
        return;
      }
      this.word(node.value + "m");
    }
    function RecordExpression(node) {
      const props = node.properties;
      let startToken;
      let endToken;
      if (this.format.recordAndTupleSyntaxType === "bar") {
        startToken = "{|";
        endToken = "|}";
      } else if (this.format.recordAndTupleSyntaxType !== "hash" && this.format.recordAndTupleSyntaxType != null) {
        throw new Error(`The "recordAndTupleSyntaxType" generator option must be "bar" or "hash" (${JSON.stringify(this.format.recordAndTupleSyntaxType)} received).`);
      } else {
        startToken = "#{";
        endToken = "}";
      }
      this.token(startToken);
      if (props.length) {
        this.space();
        this.printList(props, this.shouldPrintTrailingComma(endToken), true, true);
        this.space();
      }
      this.token(endToken);
    }
    function TupleExpression(node) {
      const elems = node.elements;
      const len = elems.length;
      let startToken;
      let endToken;
      if (this.format.recordAndTupleSyntaxType === "bar") {
        startToken = "[|";
        endToken = "|]";
      } else if (this.format.recordAndTupleSyntaxType === "hash") {
        startToken = "#[";
        endToken = "]";
      } else {
        throw new Error(`${this.format.recordAndTupleSyntaxType} is not a valid recordAndTuple syntax type`);
      }
      this.token(startToken);
      for (let i = 0; i < elems.length; i++) {
        const elem = elems[i];
        if (elem) {
          if (i > 0) this.space();
          this.print(elem);
          if (i < len - 1 || this.shouldPrintTrailingComma(endToken)) {
            this.token(",", false, i);
          }
        }
      }
      this.token(endToken);
    }
  }
});

// node_modules/@babel/generator/lib/nodes.js
var require_nodes = __commonJS({
  "node_modules/@babel/generator/lib/nodes.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.generatorInfosMap = void 0;
    var generatorFunctions = require_generators();
    var deprecatedGeneratorFunctions = require_deprecated();
    var generatorInfosMap = exports2.generatorInfosMap = /* @__PURE__ */ new Map();
    var index = 0;
    for (const key of Object.keys(generatorFunctions).sort()) {
      if (key.startsWith("_")) continue;
      generatorInfosMap.set(key, [generatorFunctions[key], index++, void 0]);
    }
    for (const key of Object.keys(deprecatedGeneratorFunctions)) {
      generatorInfosMap.set(key, [deprecatedGeneratorFunctions[key], index++, void 0]);
    }
  }
});

// node_modules/@babel/generator/lib/node/index.js
var require_node2 = __commonJS({
  "node_modules/@babel/generator/lib/node/index.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.TokenContext = void 0;
    exports2.isLastChild = isLastChild;
    exports2.parentNeedsParens = parentNeedsParens;
    var parens = require_parentheses();
    var _t = require_lib3();
    var _nodes = require_nodes();
    var {
      VISITOR_KEYS
    } = _t;
    var TokenContext = exports2.TokenContext = {
      normal: 0,
      expressionStatement: 1,
      arrowBody: 2,
      exportDefault: 4,
      arrowFlowReturnType: 8,
      forInitHead: 16,
      forInHead: 32,
      forOfHead: 64,
      forInOrInitHeadAccumulate: 128,
      forInOrInitHeadAccumulatePassThroughMask: 128
    };
    for (const type of Object.keys(parens)) {
      const func = parens[type];
      if (_nodes.generatorInfosMap.has(type)) {
        _nodes.generatorInfosMap.get(type)[2] = func;
      }
    }
    function isOrHasCallExpression(node) {
      switch (node.type) {
        case "CallExpression":
          return true;
        case "MemberExpression":
          return isOrHasCallExpression(node.object);
      }
      return false;
    }
    function parentNeedsParens(node, parent, parentId) {
      switch (parentId) {
        case 112:
          if (parent.callee === node) {
            if (isOrHasCallExpression(node)) return true;
          }
          break;
        case 42:
          return !isDecoratorMemberExpression(node) && !(node.type === "CallExpression" && isDecoratorMemberExpression(node.callee)) && node.type !== "ParenthesizedExpression";
      }
      return false;
    }
    function isDecoratorMemberExpression(node) {
      switch (node.type) {
        case "Identifier":
          return true;
        case "MemberExpression":
          return !node.computed && node.property.type === "Identifier" && isDecoratorMemberExpression(node.object);
        default:
          return false;
      }
    }
    function isLastChild(parent, child) {
      const visitorKeys = VISITOR_KEYS[parent.type];
      for (let i = visitorKeys.length - 1; i >= 0; i--) {
        const val = parent[visitorKeys[i]];
        if (val === child) {
          return true;
        } else if (Array.isArray(val)) {
          let j = val.length - 1;
          while (j >= 0 && val[j] === null) j--;
          return j >= 0 && val[j] === child;
        } else if (val) {
          return false;
        }
      }
      return false;
    }
  }
});

// node_modules/@babel/generator/lib/token-map.js
var require_token_map = __commonJS({
  "node_modules/@babel/generator/lib/token-map.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.TokenMap = void 0;
    var _t = require_lib3();
    var {
      traverseFast,
      VISITOR_KEYS
    } = _t;
    var TokenMap = class {
      constructor(ast, tokens, source) {
        this._tokens = void 0;
        this._source = void 0;
        this._nodesToTokenIndexes = /* @__PURE__ */ new Map();
        this._nodesOccurrencesCountCache = /* @__PURE__ */ new Map();
        this._tokensCache = /* @__PURE__ */ new Map();
        this._tokens = tokens;
        this._source = source;
        traverseFast(ast, (node) => {
          const indexes = this._getTokensIndexesOfNode(node);
          if (indexes.length > 0) this._nodesToTokenIndexes.set(node, indexes);
        });
        this._tokensCache.clear();
      }
      has(node) {
        return this._nodesToTokenIndexes.has(node);
      }
      getIndexes(node) {
        return this._nodesToTokenIndexes.get(node);
      }
      find(node, condition) {
        const indexes = this._nodesToTokenIndexes.get(node);
        if (indexes) {
          for (let k = 0; k < indexes.length; k++) {
            const index = indexes[k];
            const tok = this._tokens[index];
            if (condition(tok, index)) return tok;
          }
        }
        return null;
      }
      findLastIndex(node, condition) {
        const indexes = this._nodesToTokenIndexes.get(node);
        if (indexes) {
          for (let k = indexes.length - 1; k >= 0; k--) {
            const index = indexes[k];
            const tok = this._tokens[index];
            if (condition(tok, index)) return index;
          }
        }
        return -1;
      }
      findMatching(node, test, occurrenceCount = 0) {
        const indexes = this._nodesToTokenIndexes.get(node);
        if (indexes) {
          if (typeof test === "number") {
            test = String.fromCharCode(test);
          }
          let i = 0;
          const count = occurrenceCount;
          if (count > 1) {
            const cache = this._nodesOccurrencesCountCache.get(node);
            if ((cache == null ? void 0 : cache.test) === test && cache.count < count) {
              i = cache.i + 1;
              occurrenceCount -= cache.count + 1;
            }
          }
          for (; i < indexes.length; i++) {
            const tok = this._tokens[indexes[i]];
            if (this.matchesOriginal(tok, test)) {
              if (occurrenceCount === 0) {
                if (count > 0) {
                  this._nodesOccurrencesCountCache.set(node, {
                    test,
                    count,
                    i
                  });
                }
                return tok;
              }
              occurrenceCount--;
            }
          }
        }
        return null;
      }
      matchesOriginal(token, test) {
        if (token.end - token.start !== test.length) return false;
        if (token.value != null) return token.value === test;
        return this._source.startsWith(test, token.start);
      }
      startMatches(node, test) {
        const indexes = this._nodesToTokenIndexes.get(node);
        if (!indexes) return false;
        const tok = this._tokens[indexes[0]];
        if (tok.start !== node.start) return false;
        return this.matchesOriginal(tok, test);
      }
      endMatches(node, test) {
        const indexes = this._nodesToTokenIndexes.get(node);
        if (!indexes) return false;
        const tok = this._tokens[indexes[indexes.length - 1]];
        if (tok.end !== node.end) return false;
        return this.matchesOriginal(tok, test);
      }
      _getTokensIndexesOfNode(node) {
        var _node$declaration;
        if (node.start == null || node.end == null) return [];
        const {
          first,
          last
        } = this._findTokensOfNode(node, 0, this._tokens.length - 1);
        let low = first;
        const children = childrenIterator(node);
        if ((node.type === "ExportNamedDeclaration" || node.type === "ExportDefaultDeclaration") && ((_node$declaration = node.declaration) == null ? void 0 : _node$declaration.type) === "ClassDeclaration") {
          children.next();
        }
        const indexes = [];
        for (const child of children) {
          if (child == null) continue;
          if (child.start == null || child.end == null) continue;
          const childTok = this._findTokensOfNode(child, low, last);
          const high = childTok.first;
          for (let k = low; k < high; k++) indexes.push(k);
          low = childTok.last + 1;
        }
        for (let k = low; k <= last; k++) indexes.push(k);
        return indexes;
      }
      _findTokensOfNode(node, low, high) {
        const cached = this._tokensCache.get(node);
        if (cached) return cached;
        const first = this._findFirstTokenOfNode(node.start, low, high);
        const last = this._findLastTokenOfNode(node.end, first, high);
        this._tokensCache.set(node, {
          first,
          last
        });
        return {
          first,
          last
        };
      }
      _findFirstTokenOfNode(start, low, high) {
        while (low <= high) {
          const mid = high + low >> 1;
          if (start < this._tokens[mid].start) {
            high = mid - 1;
          } else if (start > this._tokens[mid].start) {
            low = mid + 1;
          } else {
            return mid;
          }
        }
        return low;
      }
      _findLastTokenOfNode(end, low, high) {
        while (low <= high) {
          const mid = high + low >> 1;
          if (end < this._tokens[mid].end) {
            high = mid - 1;
          } else if (end > this._tokens[mid].end) {
            low = mid + 1;
          } else {
            return mid;
          }
        }
        return high;
      }
    };
    exports2.TokenMap = TokenMap;
    function* childrenIterator(node) {
      if (node.type === "TemplateLiteral") {
        yield node.quasis[0];
        for (let i = 1; i < node.quasis.length; i++) {
          yield node.expressions[i - 1];
          yield node.quasis[i];
        }
        return;
      }
      const keys = VISITOR_KEYS[node.type];
      for (const key of keys) {
        const child = node[key];
        if (!child) continue;
        if (Array.isArray(child)) {
          yield* child;
        } else {
          yield child;
        }
      }
    }
  }
});

// node_modules/@babel/generator/lib/printer.js
var require_printer = __commonJS({
  "node_modules/@babel/generator/lib/printer.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = void 0;
    var _buffer = require_buffer();
    var _index = require_node2();
    var _nodes = require_nodes();
    var _t = require_lib3();
    var _tokenMap = require_token_map();
    var _types2 = require_types();
    var {
      isExpression,
      isFunction,
      isStatement,
      isClassBody,
      isTSInterfaceBody,
      isTSEnumMember
    } = _t;
    var SCIENTIFIC_NOTATION = /e/i;
    var ZERO_DECIMAL_INTEGER = /\.0+$/;
    var HAS_NEWLINE = /[\n\r\u2028\u2029]/;
    var HAS_NEWLINE_OR_BlOCK_COMMENT_END = /[\n\r\u2028\u2029]|\*\//;
    function commentIsNewline(c) {
      return c.type === "CommentLine" || HAS_NEWLINE.test(c.value);
    }
    var Printer = class {
      constructor(format, map, tokens = null, originalCode = null) {
        this.tokenContext = _index.TokenContext.normal;
        this._tokens = null;
        this._originalCode = null;
        this._currentNode = null;
        this._currentTypeId = null;
        this._indent = 0;
        this._indentRepeat = 0;
        this._insideAux = false;
        this._noLineTerminator = false;
        this._noLineTerminatorAfterNode = null;
        this._printAuxAfterOnNextUserNode = false;
        this._printedComments = /* @__PURE__ */ new Set();
        this._lastCommentLine = 0;
        this._innerCommentsState = 0;
        this._flags = 0;
        this.tokenMap = null;
        this._boundGetRawIdentifier = null;
        this._printSemicolonBeforeNextNode = -1;
        this._printSemicolonBeforeNextToken = -1;
        this.format = format;
        this._tokens = tokens;
        this._originalCode = originalCode;
        this._indentRepeat = format.indent.style.length;
        this._inputMap = (map == null ? void 0 : map._inputMap) || null;
        this._buf = new _buffer.default(map, format.indent.style[0]);
        const {
          preserveFormat,
          compact,
          concise,
          retainLines,
          retainFunctionParens
        } = format;
        if (preserveFormat) {
          this._flags |= 1;
        }
        if (compact) {
          this._flags |= 2;
        }
        if (concise) {
          this._flags |= 4;
        }
        if (retainLines) {
          this._flags |= 8;
        }
        if (retainFunctionParens) {
          this._flags |= 16;
        }
        if (format.auxiliaryCommentBefore || format.auxiliaryCommentAfter) {
          this._flags |= 32;
        }
      }
      enterDelimited() {
        const oldNoLineTerminatorAfterNode = this._noLineTerminatorAfterNode;
        if (oldNoLineTerminatorAfterNode !== null) {
          this._noLineTerminatorAfterNode = null;
        }
        return oldNoLineTerminatorAfterNode;
      }
      generate(ast) {
        if (this.format.preserveFormat) {
          this.tokenMap = new _tokenMap.TokenMap(ast, this._tokens, this._originalCode);
          this._boundGetRawIdentifier = _types2._getRawIdentifier.bind(this);
        }
        this.print(ast);
        this._maybeAddAuxComment();
        return this._buf.get();
      }
      indent(flags = this._flags) {
        if (flags & (1 | 2 | 4)) {
          return;
        }
        this._indent += this._indentRepeat;
      }
      dedent(flags = this._flags) {
        if (flags & (1 | 2 | 4)) {
          return;
        }
        this._indent -= this._indentRepeat;
      }
      semicolon(force = false) {
        const flags = this._flags;
        if (flags & 32) {
          this._maybeAddAuxComment();
        }
        if (flags & 1) {
          const node = this._currentNode;
          if (node.start != null && node.end != null) {
            if (!this.tokenMap.endMatches(node, ";")) {
              this._printSemicolonBeforeNextNode = this._buf.getCurrentLine();
              return;
            }
            const indexes = this.tokenMap.getIndexes(this._currentNode);
            this._catchUpTo(this._tokens[indexes[indexes.length - 1]].loc.start);
          }
        }
        if (force) {
          this._appendChar(59);
        } else {
          this._queue(59);
        }
        this._noLineTerminator = false;
      }
      rightBrace(node) {
        if (this.format.minified) {
          this._buf.removeLastSemicolon();
        }
        this.sourceWithOffset("end", node.loc, -1);
        this.tokenChar(125);
      }
      rightParens(node) {
        this.sourceWithOffset("end", node.loc, -1);
        this.tokenChar(41);
      }
      space(force = false) {
        if (this._flags & (1 | 2)) {
          return;
        }
        if (force) {
          this._space();
        } else {
          const lastCp = this.getLastChar(true);
          if (lastCp !== 0 && lastCp !== 32 && lastCp !== 10) {
            this._space();
          }
        }
      }
      word(str, noLineTerminatorAfter = false) {
        this.tokenContext &= _index.TokenContext.forInOrInitHeadAccumulatePassThroughMask;
        this._maybePrintInnerComments(str);
        const flags = this._flags;
        if (flags & 32) {
          this._maybeAddAuxComment();
        }
        if (flags & 1) this._catchUpToCurrentToken(str);
        const lastChar = this.getLastChar();
        if (lastChar === -2 || lastChar === -3 || lastChar === 47 && str.charCodeAt(0) === 47) {
          this._space();
        }
        this._append(str, false);
        this.setLastChar(-3);
        this._noLineTerminator = noLineTerminatorAfter;
      }
      number(str, number) {
        function isNonDecimalLiteral(str2) {
          if (str2.length > 2 && str2.charCodeAt(0) === 48) {
            const secondChar = str2.charCodeAt(1);
            return secondChar === 98 || secondChar === 111 || secondChar === 120;
          }
          return false;
        }
        this.word(str);
        if (Number.isInteger(number) && !isNonDecimalLiteral(str) && !SCIENTIFIC_NOTATION.test(str) && !ZERO_DECIMAL_INTEGER.test(str) && str.charCodeAt(str.length - 1) !== 46) {
          this.setLastChar(-2);
        }
      }
      token(str, maybeNewline = false, occurrenceCount = 0, mayNeedSpace = false) {
        this.tokenContext &= _index.TokenContext.forInOrInitHeadAccumulatePassThroughMask;
        this._maybePrintInnerComments(str, occurrenceCount);
        const flags = this._flags;
        if (flags & 32) {
          this._maybeAddAuxComment();
        }
        if (flags & 1) {
          this._catchUpToCurrentToken(str, occurrenceCount);
        }
        if (mayNeedSpace) {
          const strFirst = str.charCodeAt(0);
          if ((strFirst === 45 && str === "--" || strFirst === 61) && this.getLastChar() === 33 || strFirst === 43 && this.getLastChar() === 43 || strFirst === 45 && this.getLastChar() === 45 || strFirst === 46 && this.getLastChar() === -2) {
            this._space();
          }
        }
        this._append(str, maybeNewline);
        this._noLineTerminator = false;
      }
      tokenChar(char, occurrenceCount = 0) {
        this.tokenContext &= _index.TokenContext.forInOrInitHeadAccumulatePassThroughMask;
        this._maybePrintInnerComments(char, occurrenceCount);
        const flags = this._flags;
        if (flags & 32) {
          this._maybeAddAuxComment();
        }
        if (flags & 1) {
          this._catchUpToCurrentToken(char, occurrenceCount);
        }
        if (char === 43 && this.getLastChar() === 43 || char === 45 && this.getLastChar() === 45 || char === 46 && this.getLastChar() === -2) {
          this._space();
        }
        this._appendChar(char);
        this._noLineTerminator = false;
      }
      newline(i = 1, flags = this._flags) {
        if (i <= 0) return;
        if (flags & (8 | 2)) {
          return;
        }
        if (flags & 4) {
          this.space();
          return;
        }
        if (i > 2) i = 2;
        i -= this._buf.getNewlineCount();
        for (let j = 0; j < i; j++) {
          this._newline();
        }
      }
      endsWith(char) {
        return this.getLastChar(true) === char;
      }
      getLastChar(checkQueue) {
        return this._buf.getLastChar(checkQueue);
      }
      setLastChar(char) {
        this._buf._last = char;
      }
      exactSource(loc, cb) {
        if (!loc) {
          cb();
          return;
        }
        this._catchUp("start", loc);
        this._buf.exactSource(loc, cb);
      }
      source(prop, loc) {
        if (!loc) return;
        this._catchUp(prop, loc);
        this._buf.source(prop, loc);
      }
      sourceWithOffset(prop, loc, columnOffset) {
        if (!loc || this.format.preserveFormat) return;
        this._catchUp(prop, loc);
        this._buf.sourceWithOffset(prop, loc, columnOffset);
      }
      sourceIdentifierName(identifierName, pos) {
        if (!this._buf._canMarkIdName) return;
        const sourcePosition = this._buf._sourcePosition;
        sourcePosition.identifierNamePos = pos;
        sourcePosition.identifierName = identifierName;
      }
      _space() {
        this._queue(32);
      }
      _newline() {
        if (this._buf._queuedChar === 32) this._buf._queuedChar = 0;
        this._appendChar(10, true);
      }
      _catchUpToCurrentToken(str, occurrenceCount = 0) {
        const token = this.tokenMap.findMatching(this._currentNode, str, occurrenceCount);
        if (token) this._catchUpTo(token.loc.start);
        if (this._printSemicolonBeforeNextToken !== -1 && this._printSemicolonBeforeNextToken === this._buf.getCurrentLine()) {
          this._appendChar(59, true);
        }
        this._printSemicolonBeforeNextToken = -1;
        this._printSemicolonBeforeNextNode = -1;
      }
      _append(str, maybeNewline) {
        this._maybeIndent();
        this._buf.append(str, maybeNewline);
      }
      _appendChar(char, noIndent) {
        if (!noIndent) {
          this._maybeIndent();
        }
        this._buf.appendChar(char);
      }
      _queue(char) {
        this._buf.queue(char);
        this.setLastChar(-1);
      }
      _maybeIndent() {
        const indent = this._shouldIndent();
        if (indent > 0) {
          this._buf._appendChar(-1, indent, false);
        }
      }
      _shouldIndent() {
        return this.endsWith(10) ? this._indent : 0;
      }
      catchUp(line) {
        if (!this.format.retainLines) return;
        const count = line - this._buf.getCurrentLine();
        for (let i = 0; i < count; i++) {
          this._newline();
        }
      }
      _catchUp(prop, loc) {
        const flags = this._flags;
        if ((flags & 1) === 0) {
          if (flags & 8 && loc != null && loc[prop]) {
            this.catchUp(loc[prop].line);
          }
          return;
        }
        const pos = loc == null ? void 0 : loc[prop];
        if (pos != null) this._catchUpTo(pos);
      }
      _catchUpTo({
        line,
        column,
        index
      }) {
        const count = line - this._buf.getCurrentLine();
        if (count > 0 && this._noLineTerminator) {
          return;
        }
        for (let i = 0; i < count; i++) {
          this._newline();
        }
        const spacesCount = count > 0 ? column : column - this._buf.getCurrentColumn();
        if (spacesCount > 0) {
          const spaces = this._originalCode ? this._originalCode.slice(index - spacesCount, index).replace(/[^\t\x0B\f \xA0\u1680\u2000-\u200A\u202F\u205F\u3000\uFEFF]/gu, " ") : " ".repeat(spacesCount);
          this._append(spaces, false);
          this.setLastChar(32);
        }
      }
      printTerminatorless(node) {
        this._noLineTerminator = true;
        this.print(node);
      }
      print(node, noLineTerminatorAfter = false, resetTokenContext = false, trailingCommentsLineOffset) {
        var _node$leadingComments, _node$leadingComments2;
        if (!node) return;
        this._innerCommentsState = 0;
        const {
          type,
          loc,
          extra
        } = node;
        const flags = this._flags;
        let changedFlags = false;
        if (node._compact) {
          this._flags |= 4;
          changedFlags = true;
        }
        const nodeInfo = _nodes.generatorInfosMap.get(type);
        if (nodeInfo === void 0) {
          throw new ReferenceError(`unknown node of type ${JSON.stringify(type)} with constructor ${JSON.stringify(node.constructor.name)}`);
        }
        const [printMethod, nodeId, needsParens] = nodeInfo;
        const parent = this._currentNode;
        const parentId = this._currentTypeId;
        this._currentNode = node;
        this._currentTypeId = nodeId;
        if (flags & 1) {
          this._printSemicolonBeforeNextToken = this._printSemicolonBeforeNextNode;
        }
        let oldInAux;
        if (flags & 32) {
          oldInAux = this._insideAux;
          this._insideAux = loc == null;
          this._maybeAddAuxComment(this._insideAux && !oldInAux);
        }
        let oldTokenContext = 0;
        if (resetTokenContext) {
          oldTokenContext = this.tokenContext;
          if (oldTokenContext & _index.TokenContext.forInOrInitHeadAccumulate) {
            this.tokenContext = 0;
          } else {
            oldTokenContext = 0;
          }
        }
        const parenthesized = extra != null && extra.parenthesized;
        let shouldPrintParens = parenthesized && flags & 1 || parenthesized && flags & 16 && nodeId === 71 || parent && ((0, _index.parentNeedsParens)(node, parent, parentId) || needsParens != null && needsParens(node, parent, parentId, this.tokenContext, flags & 1 ? this._boundGetRawIdentifier : void 0));
        if (!shouldPrintParens && parenthesized && (_node$leadingComments = node.leadingComments) != null && _node$leadingComments.length && node.leadingComments[0].type === "CommentBlock") {
          switch (parentId) {
            case 65:
            case 243:
            case 6:
            case 143:
              break;
            case 17:
            case 130:
            case 112:
              if (parent.callee !== node) break;
            default:
              shouldPrintParens = true;
          }
        }
        let indentParenthesized = false;
        if (!shouldPrintParens && this._noLineTerminator && ((_node$leadingComments2 = node.leadingComments) != null && _node$leadingComments2.some(commentIsNewline) || flags & 8 && loc && loc.start.line > this._buf.getCurrentLine())) {
          shouldPrintParens = true;
          indentParenthesized = true;
        }
        let oldNoLineTerminatorAfterNode;
        if (!shouldPrintParens) {
          noLineTerminatorAfter || (noLineTerminatorAfter = !!parent && this._noLineTerminatorAfterNode === parent && (0, _index.isLastChild)(parent, node));
          if (noLineTerminatorAfter) {
            var _node$trailingComment;
            if ((_node$trailingComment = node.trailingComments) != null && _node$trailingComment.some(commentIsNewline)) {
              if (isExpression(node)) shouldPrintParens = true;
            } else {
              oldNoLineTerminatorAfterNode = this._noLineTerminatorAfterNode;
              this._noLineTerminatorAfterNode = node;
            }
          }
        }
        if (shouldPrintParens) {
          this.tokenChar(40);
          if (indentParenthesized) this.indent();
          this._innerCommentsState = 0;
          if (!resetTokenContext) {
            oldTokenContext = this.tokenContext;
          }
          if (oldTokenContext & _index.TokenContext.forInOrInitHeadAccumulate) {
            this.tokenContext = 0;
          }
          oldNoLineTerminatorAfterNode = this._noLineTerminatorAfterNode;
          this._noLineTerminatorAfterNode = null;
        }
        this._printLeadingComments(node, parent);
        this.exactSource(nodeId === 139 || nodeId === 66 ? null : loc, printMethod.bind(this, node, parent));
        if (shouldPrintParens) {
          this._printTrailingComments(node, parent);
          if (indentParenthesized) {
            this.dedent();
            this.newline();
          }
          this.tokenChar(41);
          this._noLineTerminator = noLineTerminatorAfter;
        } else if (noLineTerminatorAfter && !this._noLineTerminator) {
          this._noLineTerminator = true;
          this._printTrailingComments(node, parent);
        } else {
          this._printTrailingComments(node, parent, trailingCommentsLineOffset);
        }
        if (oldTokenContext) this.tokenContext = oldTokenContext;
        this._currentNode = parent;
        this._currentTypeId = parentId;
        if (changedFlags) {
          this._flags = flags;
        }
        if (flags & 32) {
          this._insideAux = oldInAux;
        }
        if (oldNoLineTerminatorAfterNode != null) {
          this._noLineTerminatorAfterNode = oldNoLineTerminatorAfterNode;
        }
        this._innerCommentsState = 0;
      }
      _maybeAddAuxComment(enteredPositionlessNode) {
        if (enteredPositionlessNode) this._printAuxBeforeComment();
        if (!this._insideAux) this._printAuxAfterComment();
      }
      _printAuxBeforeComment() {
        if (this._printAuxAfterOnNextUserNode) return;
        this._printAuxAfterOnNextUserNode = true;
        const comment = this.format.auxiliaryCommentBefore;
        if (comment) {
          this._printComment({
            type: "CommentBlock",
            value: comment
          }, 0);
        }
      }
      _printAuxAfterComment() {
        if (!this._printAuxAfterOnNextUserNode) return;
        this._printAuxAfterOnNextUserNode = false;
        const comment = this.format.auxiliaryCommentAfter;
        if (comment) {
          this._printComment({
            type: "CommentBlock",
            value: comment
          }, 0);
        }
      }
      getPossibleRaw(node) {
        const extra = node.extra;
        if ((extra == null ? void 0 : extra.raw) != null && extra.rawValue != null && node.value === extra.rawValue) {
          return extra.raw;
        }
      }
      printJoin(nodes, statement, indent, separator, printTrailingSeparator, resetTokenContext, trailingCommentsLineOffset) {
        if (!(nodes != null && nodes.length)) return;
        const flags = this._flags;
        if (indent == null && flags & 8) {
          var _nodes$0$loc;
          const startLine = (_nodes$0$loc = nodes[0].loc) == null ? void 0 : _nodes$0$loc.start.line;
          if (startLine != null && startLine !== this._buf.getCurrentLine()) {
            indent = true;
          }
        }
        if (indent) this.indent(flags);
        const len = nodes.length;
        for (let i = 0; i < len; i++) {
          const node = nodes[i];
          if (!node) continue;
          if (statement && i === 0 && this._buf.hasContent()) {
            this.newline(1, flags);
          }
          this.print(node, false, resetTokenContext, trailingCommentsLineOffset || 0);
          if (separator != null) {
            if (i < len - 1) separator.call(this, i, false);
            else if (printTrailingSeparator) separator.call(this, i, true);
          }
          if (statement) {
            if (i + 1 === len) {
              this.newline(1, flags);
            } else {
              const lastCommentLine = this._lastCommentLine;
              if (lastCommentLine > 0) {
                var _nodes$loc;
                const offset = (((_nodes$loc = nodes[i + 1].loc) == null ? void 0 : _nodes$loc.start.line) || 0) - lastCommentLine;
                if (offset >= 0) {
                  this.newline(offset || 1, flags);
                  continue;
                }
              }
              this.newline(1, flags);
            }
          }
        }
        if (indent) this.dedent(flags);
      }
      printAndIndentOnComments(node) {
        const indent = node.leadingComments && node.leadingComments.length > 0;
        if (indent) this.indent();
        this.print(node);
        if (indent) this.dedent();
      }
      printBlock(body) {
        if (body.type !== "EmptyStatement") {
          this.space();
        }
        this.print(body);
      }
      _printTrailingComments(node, parent, lineOffset) {
        const {
          innerComments,
          trailingComments
        } = node;
        if (innerComments != null && innerComments.length) {
          this._printComments(2, innerComments, node, parent, lineOffset);
        }
        if (trailingComments != null && trailingComments.length) {
          this._printComments(2, trailingComments, node, parent, lineOffset);
        } else {
          this._lastCommentLine = 0;
        }
      }
      _printLeadingComments(node, parent) {
        const comments = node.leadingComments;
        if (!(comments != null && comments.length)) return;
        this._printComments(0, comments, node, parent);
      }
      _maybePrintInnerComments(nextTokenStr, nextTokenOccurrenceCount) {
        var _this$tokenMap;
        const state = this._innerCommentsState;
        switch (state & 3) {
          case 0:
            this._innerCommentsState = 1 | 4;
            return;
          case 1:
            this.printInnerComments((state & 4) > 0, (_this$tokenMap = this.tokenMap) == null ? void 0 : _this$tokenMap.findMatching(this._currentNode, nextTokenStr, nextTokenOccurrenceCount));
        }
      }
      printInnerComments(indent = true, nextToken) {
        const node = this._currentNode;
        const comments = node.innerComments;
        if (!(comments != null && comments.length)) {
          this._innerCommentsState = 2;
          return;
        }
        const hasSpace = this.endsWith(32);
        if (indent) this.indent();
        switch (this._printComments(1, comments, node, void 0, void 0, nextToken)) {
          case 2:
            this._innerCommentsState = 2;
          case 1:
            if (hasSpace) this.space();
        }
        if (indent) this.dedent();
      }
      noIndentInnerCommentsHere() {
        this._innerCommentsState &= ~4;
      }
      printSequence(nodes, indent, resetTokenContext, trailingCommentsLineOffset) {
        this.printJoin(nodes, true, indent != null ? indent : false, void 0, void 0, resetTokenContext, trailingCommentsLineOffset);
      }
      printList(items, printTrailingSeparator, statement, indent, separator, resetTokenContext) {
        this.printJoin(items, statement, indent, separator != null ? separator : commaSeparator, printTrailingSeparator, resetTokenContext);
      }
      shouldPrintTrailingComma(listEnd) {
        if (!this.tokenMap) return null;
        const listEndIndex = this.tokenMap.findLastIndex(this._currentNode, (token) => this.tokenMap.matchesOriginal(token, typeof listEnd === "number" ? String.fromCharCode(listEnd) : listEnd));
        if (listEndIndex <= 0) return null;
        return this.tokenMap.matchesOriginal(this._tokens[listEndIndex - 1], ",");
      }
      _shouldPrintComment(comment, nextToken) {
        if (comment.ignore) return 0;
        if (this._printedComments.has(comment)) return 0;
        if (this._noLineTerminator && HAS_NEWLINE_OR_BlOCK_COMMENT_END.test(comment.value)) {
          return 2;
        }
        if (nextToken && this.tokenMap) {
          const commentTok = this.tokenMap.find(this._currentNode, (token) => token.value === comment.value);
          if (commentTok && commentTok.start > nextToken.start) {
            return 2;
          }
        }
        this._printedComments.add(comment);
        if (!this.format.shouldPrintComment(comment.value)) {
          return 0;
        }
        return 1;
      }
      _printComment(comment, skipNewLines) {
        const noLineTerminator = this._noLineTerminator;
        const isBlockComment = comment.type === "CommentBlock";
        const printNewLines = isBlockComment && skipNewLines !== 1 && !noLineTerminator;
        if (printNewLines && this._buf.hasContent() && skipNewLines !== 2) {
          this.newline(1);
        }
        switch (this.getLastChar(true)) {
          case 47:
            this._space();
          case 91:
          case 123:
          case 40:
            break;
          default:
            this.space();
        }
        let val;
        if (isBlockComment) {
          val = `/*${comment.value}*/`;
          if (this.format.indent.adjustMultilineComment) {
            var _comment$loc;
            const offset = (_comment$loc = comment.loc) == null ? void 0 : _comment$loc.start.column;
            if (offset) {
              const newlineRegex = new RegExp("\\n\\s{1," + offset + "}", "g");
              val = val.replace(newlineRegex, "\n");
            }
            if (this._flags & 4) {
              val = val.replace(/\n(?!$)/g, `
`);
            } else {
              let indentSize = this.format.retainLines ? 0 : this._buf.getCurrentColumn();
              if (this._shouldIndent() || this.format.retainLines) {
                indentSize += this._indent;
              }
              val = val.replace(/\n(?!$)/g, `
${" ".repeat(indentSize)}`);
            }
          }
        } else if (!noLineTerminator) {
          val = `//${comment.value}`;
        } else {
          val = `/*${comment.value}*/`;
        }
        this.source("start", comment.loc);
        this._append(val, isBlockComment);
        if (!isBlockComment && !noLineTerminator) {
          this._newline();
        }
        if (printNewLines && skipNewLines !== 3) {
          this.newline(1);
        }
      }
      _printComments(type, comments, node, parent, lineOffset = 0, nextToken) {
        const nodeLoc = node.loc;
        const len = comments.length;
        let hasLoc = !!nodeLoc;
        const nodeStartLine = hasLoc ? nodeLoc.start.line : 0;
        const nodeEndLine = hasLoc ? nodeLoc.end.line : 0;
        let lastLine = 0;
        let leadingCommentNewline = 0;
        const {
          _noLineTerminator,
          _flags
        } = this;
        for (let i = 0; i < len; i++) {
          const comment = comments[i];
          const shouldPrint = this._shouldPrintComment(comment, nextToken);
          if (shouldPrint === 2) {
            return i === 0 ? 0 : 1;
          }
          if (hasLoc && comment.loc && shouldPrint === 1) {
            const commentStartLine = comment.loc.start.line;
            const commentEndLine = comment.loc.end.line;
            if (type === 0) {
              let offset = 0;
              if (i === 0) {
                if (this._buf.hasContent() && (comment.type === "CommentLine" || commentStartLine !== commentEndLine)) {
                  offset = leadingCommentNewline = 1;
                }
              } else {
                offset = commentStartLine - lastLine;
              }
              lastLine = commentEndLine;
              if (offset > 0 && !_noLineTerminator) {
                this.newline(offset, _flags);
              }
              this._printComment(comment, 1);
              if (i + 1 === len) {
                const count = Math.max(nodeStartLine - lastLine, leadingCommentNewline);
                if (count > 0 && !_noLineTerminator) {
                  this.newline(count, _flags);
                }
                lastLine = nodeStartLine;
              }
            } else if (type === 1) {
              const offset = commentStartLine - (i === 0 ? nodeStartLine : lastLine);
              lastLine = commentEndLine;
              if (offset > 0 && !_noLineTerminator) {
                this.newline(offset, _flags);
              }
              this._printComment(comment, 1);
              if (i + 1 === len) {
                const count = Math.min(1, nodeEndLine - lastLine);
                if (count > 0 && !_noLineTerminator) {
                  this.newline(count, _flags);
                }
                lastLine = nodeEndLine;
              }
            } else {
              const offset = commentStartLine - (i === 0 ? nodeEndLine - lineOffset : lastLine);
              lastLine = commentEndLine;
              if (offset > 0 && !_noLineTerminator) {
                this.newline(offset, _flags);
              }
              this._printComment(comment, 1);
            }
          } else {
            hasLoc = false;
            if (shouldPrint !== 1) {
              continue;
            }
            if (len === 1) {
              const singleLine = comment.loc ? comment.loc.start.line === comment.loc.end.line : !HAS_NEWLINE.test(comment.value);
              const shouldSkipNewline = singleLine && !isStatement(node) && !isClassBody(parent) && !isTSInterfaceBody(parent) && !isTSEnumMember(node);
              if (type === 0) {
                this._printComment(comment, shouldSkipNewline && node.type !== "ObjectExpression" || singleLine && isFunction(parent) && parent.body === node ? 1 : 0);
              } else if (shouldSkipNewline && type === 2) {
                this._printComment(comment, 1);
              } else {
                this._printComment(comment, 0);
              }
            } else if (type === 1 && !(node.type === "ObjectExpression" && node.properties.length > 1) && node.type !== "ClassBody" && node.type !== "TSInterfaceBody") {
              this._printComment(comment, i === 0 ? 2 : i === len - 1 ? 3 : 0);
            } else {
              this._printComment(comment, 0);
            }
          }
        }
        if (type === 2 && hasLoc && lastLine) {
          this._lastCommentLine = lastLine;
        }
        return 2;
      }
    };
    var _default = exports2.default = Printer;
    function commaSeparator(occurrenceCount, last) {
      this.tokenChar(44, occurrenceCount);
      if (!last) this.space();
    }
  }
});

// node_modules/@babel/generator/lib/index.js
var require_lib8 = __commonJS({
  "node_modules/@babel/generator/lib/index.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = void 0;
    exports2.generate = generate;
    var _sourceMap = require_source_map();
    var _printer = require_printer();
    function normalizeOptions(code, opts, ast) {
      var _opts$recordAndTupleS;
      if (opts.experimental_preserveFormat) {
        if (typeof code !== "string") {
          throw new Error("`experimental_preserveFormat` requires the original `code` to be passed to @babel/generator as a string");
        }
        if (!opts.retainLines) {
          throw new Error("`experimental_preserveFormat` requires `retainLines` to be set to `true`");
        }
        if (opts.compact && opts.compact !== "auto") {
          throw new Error("`experimental_preserveFormat` is not compatible with the `compact` option");
        }
        if (opts.minified) {
          throw new Error("`experimental_preserveFormat` is not compatible with the `minified` option");
        }
        if (opts.jsescOption) {
          throw new Error("`experimental_preserveFormat` is not compatible with the `jsescOption` option");
        }
        if (!Array.isArray(ast.tokens)) {
          throw new Error("`experimental_preserveFormat` requires the AST to have attached the token of the input code. Make sure to enable the `tokens: true` parser option.");
        }
      }
      const format = {
        auxiliaryCommentBefore: opts.auxiliaryCommentBefore,
        auxiliaryCommentAfter: opts.auxiliaryCommentAfter,
        shouldPrintComment: opts.shouldPrintComment,
        preserveFormat: opts.experimental_preserveFormat,
        retainLines: opts.retainLines,
        retainFunctionParens: opts.retainFunctionParens,
        comments: opts.comments == null || opts.comments,
        compact: opts.compact,
        minified: opts.minified,
        concise: opts.concise,
        indent: {
          adjustMultilineComment: true,
          style: "  "
        },
        jsescOption: Object.assign({
          quotes: "double",
          wrap: true,
          minimal: false
        }, opts.jsescOption),
        topicToken: opts.topicToken
      };
      format.decoratorsBeforeExport = opts.decoratorsBeforeExport;
      format.jsescOption.json = opts.jsonCompatibleStrings;
      format.recordAndTupleSyntaxType = (_opts$recordAndTupleS = opts.recordAndTupleSyntaxType) != null ? _opts$recordAndTupleS : "hash";
      format.importAttributesKeyword = opts.importAttributesKeyword;
      if (format.minified) {
        format.compact = true;
        format.shouldPrintComment = format.shouldPrintComment || (() => format.comments);
      } else {
        format.shouldPrintComment = format.shouldPrintComment || ((value2) => format.comments || value2.includes("@license") || value2.includes("@preserve"));
      }
      if (format.compact === "auto") {
        format.compact = typeof code === "string" && code.length > 5e5;
        if (format.compact) {
          console.error(`[BABEL] Note: The code generator has deoptimised the styling of ${opts.filename} as it exceeds the max of ${"500KB"}.`);
        }
      }
      if (format.compact || format.preserveFormat) {
        format.indent.adjustMultilineComment = false;
      }
      const {
        auxiliaryCommentBefore,
        auxiliaryCommentAfter,
        shouldPrintComment
      } = format;
      if (auxiliaryCommentBefore && !shouldPrintComment(auxiliaryCommentBefore)) {
        format.auxiliaryCommentBefore = void 0;
      }
      if (auxiliaryCommentAfter && !shouldPrintComment(auxiliaryCommentAfter)) {
        format.auxiliaryCommentAfter = void 0;
      }
      return format;
    }
    exports2.CodeGenerator = class CodeGenerator {
      constructor(ast, opts = {}, code) {
        this._ast = void 0;
        this._format = void 0;
        this._map = void 0;
        this._ast = ast;
        this._format = normalizeOptions(code, opts, ast);
        this._map = opts.sourceMaps ? new _sourceMap.default(opts, code) : null;
      }
      generate() {
        const printer = new _printer.default(this._format, this._map);
        return printer.generate(this._ast);
      }
    };
    function generate(ast, opts = {}, code) {
      const format = normalizeOptions(code, opts, ast);
      const map = opts.sourceMaps ? new _sourceMap.default(opts, code) : null;
      const printer = new _printer.default(format, map, ast.tokens, typeof code === "string" ? code : null);
      return printer.generate(ast);
    }
    var _default = exports2.default = generate;
  }
});

// node_modules/@babel/traverse/lib/path/ancestry.js
var require_ancestry = __commonJS({
  "node_modules/@babel/traverse/lib/path/ancestry.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.find = find;
    exports2.findParent = findParent;
    exports2.getAncestry = getAncestry;
    exports2.getDeepestCommonAncestorFrom = getDeepestCommonAncestorFrom;
    exports2.getEarliestCommonAncestorFrom = getEarliestCommonAncestorFrom;
    exports2.getFunctionParent = getFunctionParent;
    exports2.getStatementParent = getStatementParent;
    exports2.inType = inType;
    exports2.isAncestor = isAncestor;
    exports2.isDescendant = isDescendant;
    var _t = require_lib3();
    var {
      VISITOR_KEYS
    } = _t;
    function findParent(callback) {
      let path = this;
      while (path = path.parentPath) {
        if (callback(path)) return path;
      }
      return null;
    }
    function find(callback) {
      let path = this;
      do {
        if (callback(path)) return path;
      } while (path = path.parentPath);
      return null;
    }
    function getFunctionParent() {
      return this.findParent((p) => p.isFunction());
    }
    function getStatementParent() {
      let path = this;
      do {
        if (!path.parentPath || Array.isArray(path.container) && path.isStatement()) {
          break;
        } else {
          path = path.parentPath;
        }
      } while (path);
      if (path && (path.isProgram() || path.isFile())) {
        throw new Error("File/Program node, we can't possibly find a statement parent to this");
      }
      return path;
    }
    function getEarliestCommonAncestorFrom(paths) {
      return this.getDeepestCommonAncestorFrom(paths, function(deepest, i, ancestries) {
        let earliest;
        const keys = VISITOR_KEYS[deepest.type];
        for (const ancestry of ancestries) {
          const path = ancestry[i + 1];
          if (!earliest) {
            earliest = path;
            continue;
          }
          if (path.listKey && earliest.listKey === path.listKey) {
            if (path.key < earliest.key) {
              earliest = path;
              continue;
            }
          }
          const earliestKeyIndex = keys.indexOf(earliest.parentKey);
          const currentKeyIndex = keys.indexOf(path.parentKey);
          if (earliestKeyIndex > currentKeyIndex) {
            earliest = path;
          }
        }
        return earliest;
      });
    }
    function getDeepestCommonAncestorFrom(paths, filter) {
      if (!paths.length) {
        return this;
      }
      if (paths.length === 1) {
        return paths[0];
      }
      let minDepth = Infinity;
      let lastCommonIndex, lastCommon;
      const ancestries = paths.map((path) => {
        const ancestry = [];
        do {
          ancestry.unshift(path);
        } while ((path = path.parentPath) && path !== this);
        if (ancestry.length < minDepth) {
          minDepth = ancestry.length;
        }
        return ancestry;
      });
      const first = ancestries[0];
      depthLoop: for (let i = 0; i < minDepth; i++) {
        const shouldMatch = first[i];
        for (const ancestry of ancestries) {
          if (ancestry[i] !== shouldMatch) {
            break depthLoop;
          }
        }
        lastCommonIndex = i;
        lastCommon = shouldMatch;
      }
      if (lastCommon) {
        if (filter) {
          return filter(lastCommon, lastCommonIndex, ancestries);
        } else {
          return lastCommon;
        }
      } else {
        throw new Error("Couldn't find intersection");
      }
    }
    function getAncestry() {
      let path = this;
      const paths = [];
      do {
        paths.push(path);
      } while (path = path.parentPath);
      return paths;
    }
    function isAncestor(maybeDescendant) {
      return maybeDescendant.isDescendant(this);
    }
    function isDescendant(maybeAncestor) {
      return !!this.findParent((parent) => parent === maybeAncestor);
    }
    function inType(...candidateTypes) {
      let path = this;
      while (path) {
        if (candidateTypes.includes(path.node.type)) return true;
        path = path.parentPath;
      }
      return false;
    }
  }
});

// node_modules/@babel/traverse/lib/path/inference/util.js
var require_util = __commonJS({
  "node_modules/@babel/traverse/lib/path/inference/util.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.createUnionType = createUnionType;
    var _t = require_lib3();
    var {
      createFlowUnionType,
      createTSUnionType,
      createUnionTypeAnnotation,
      isFlowType,
      isTSType
    } = _t;
    function createUnionType(types2) {
      if (types2.every((v) => isFlowType(v))) {
        if (createFlowUnionType) {
          return createFlowUnionType(types2);
        }
        return createUnionTypeAnnotation(types2);
      } else if (types2.every((v) => isTSType(v))) {
        if (createTSUnionType) {
          return createTSUnionType(types2);
        }
      }
    }
  }
});

// node_modules/@babel/traverse/lib/path/inference/inferer-reference.js
var require_inferer_reference = __commonJS({
  "node_modules/@babel/traverse/lib/path/inference/inferer-reference.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = _default;
    var _t = require_lib3();
    var _util = require_util();
    var {
      BOOLEAN_NUMBER_BINARY_OPERATORS,
      createTypeAnnotationBasedOnTypeof,
      numberTypeAnnotation,
      voidTypeAnnotation
    } = _t;
    function _default(node) {
      if (!this.isReferenced()) return;
      const binding = this.scope.getBinding(node.name);
      if (binding) {
        if (binding.identifier.typeAnnotation) {
          return binding.identifier.typeAnnotation;
        } else {
          return getTypeAnnotationBindingConstantViolations(binding, this, node.name);
        }
      }
      if (node.name === "undefined") {
        return voidTypeAnnotation();
      } else if (node.name === "NaN" || node.name === "Infinity") {
        return numberTypeAnnotation();
      } else if (node.name === "arguments") {
      }
    }
    function getTypeAnnotationBindingConstantViolations(binding, path, name) {
      const types2 = [];
      const functionConstantViolations = [];
      let constantViolations = getConstantViolationsBefore(binding, path, functionConstantViolations);
      const testType = getConditionalAnnotation(binding, path, name);
      if (testType) {
        const testConstantViolations = getConstantViolationsBefore(binding, testType.ifStatement);
        constantViolations = constantViolations.filter((path2) => !testConstantViolations.includes(path2));
        types2.push(testType.typeAnnotation);
      }
      if (constantViolations.length) {
        constantViolations.push(...functionConstantViolations);
        for (const violation of constantViolations) {
          types2.push(violation.getTypeAnnotation());
        }
      }
      if (!types2.length) {
        return;
      }
      return (0, _util.createUnionType)(types2);
    }
    function getConstantViolationsBefore(binding, path, functions) {
      const violations = binding.constantViolations.slice();
      violations.unshift(binding.path);
      return violations.filter((violation) => {
        violation = violation.resolve();
        const status = violation._guessExecutionStatusRelativeTo(path);
        if (functions && status === "unknown") functions.push(violation);
        return status === "before";
      });
    }
    function inferAnnotationFromBinaryExpression(name, path) {
      const operator = path.node.operator;
      const right = path.get("right").resolve();
      const left = path.get("left").resolve();
      let target;
      if (left.isIdentifier({
        name
      })) {
        target = right;
      } else if (right.isIdentifier({
        name
      })) {
        target = left;
      }
      if (target) {
        if (operator === "===") {
          return target.getTypeAnnotation();
        }
        if (BOOLEAN_NUMBER_BINARY_OPERATORS.includes(operator)) {
          return numberTypeAnnotation();
        }
        return;
      }
      if (operator !== "===" && operator !== "==") return;
      let typeofPath;
      let typePath;
      if (left.isUnaryExpression({
        operator: "typeof"
      })) {
        typeofPath = left;
        typePath = right;
      } else if (right.isUnaryExpression({
        operator: "typeof"
      })) {
        typeofPath = right;
        typePath = left;
      }
      if (!typeofPath) return;
      if (!typeofPath.get("argument").isIdentifier({
        name
      })) return;
      typePath = typePath.resolve();
      if (!typePath.isLiteral()) return;
      const typeValue = typePath.node.value;
      if (typeof typeValue !== "string") return;
      return createTypeAnnotationBasedOnTypeof(typeValue);
    }
    function getParentConditionalPath(binding, path, name) {
      let parentPath;
      while (parentPath = path.parentPath) {
        if (parentPath.isIfStatement() || parentPath.isConditionalExpression()) {
          if (path.key === "test") {
            return;
          }
          return parentPath;
        }
        if (parentPath.isFunction()) {
          if (name == null || parentPath.parentPath.scope.getBinding(name) !== binding) return;
        }
        path = parentPath;
      }
    }
    function getConditionalAnnotation(binding, path, name) {
      const ifStatement = getParentConditionalPath(binding, path, name);
      if (!ifStatement) return;
      const test = ifStatement.get("test");
      const paths = [test];
      const types2 = [];
      for (let i = 0; i < paths.length; i++) {
        const path2 = paths[i];
        if (path2.isLogicalExpression()) {
          if (path2.node.operator === "&&") {
            paths.push(path2.get("left"));
            paths.push(path2.get("right"));
          }
        } else if (path2.isBinaryExpression()) {
          const type = inferAnnotationFromBinaryExpression(name, path2);
          if (type) types2.push(type);
        }
      }
      if (types2.length) {
        return {
          typeAnnotation: (0, _util.createUnionType)(types2),
          ifStatement
        };
      }
      return getConditionalAnnotation(binding, ifStatement, name);
    }
  }
});

// node_modules/@babel/traverse/lib/path/inference/inferers.js
var require_inferers = __commonJS({
  "node_modules/@babel/traverse/lib/path/inference/inferers.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.ArrayExpression = ArrayExpression;
    exports2.AssignmentExpression = AssignmentExpression;
    exports2.BinaryExpression = BinaryExpression;
    exports2.BooleanLiteral = BooleanLiteral;
    exports2.CallExpression = CallExpression;
    exports2.ConditionalExpression = ConditionalExpression;
    exports2.ClassDeclaration = exports2.ClassExpression = exports2.FunctionDeclaration = exports2.ArrowFunctionExpression = exports2.FunctionExpression = Func;
    Object.defineProperty(exports2, "Identifier", {
      enumerable: true,
      get: function() {
        return _infererReference.default;
      }
    });
    exports2.LogicalExpression = LogicalExpression;
    exports2.NewExpression = NewExpression;
    exports2.NullLiteral = NullLiteral;
    exports2.NumericLiteral = NumericLiteral;
    exports2.ObjectExpression = ObjectExpression;
    exports2.ParenthesizedExpression = ParenthesizedExpression;
    exports2.RegExpLiteral = RegExpLiteral;
    exports2.RestElement = RestElement;
    exports2.SequenceExpression = SequenceExpression;
    exports2.StringLiteral = StringLiteral;
    exports2.TSAsExpression = TSAsExpression;
    exports2.TSNonNullExpression = TSNonNullExpression;
    exports2.TaggedTemplateExpression = TaggedTemplateExpression;
    exports2.TemplateLiteral = TemplateLiteral;
    exports2.TypeCastExpression = TypeCastExpression;
    exports2.UnaryExpression = UnaryExpression;
    exports2.UpdateExpression = UpdateExpression;
    exports2.VariableDeclarator = VariableDeclarator;
    var _t = require_lib3();
    var _infererReference = require_inferer_reference();
    var _util = require_util();
    var {
      BOOLEAN_BINARY_OPERATORS,
      BOOLEAN_UNARY_OPERATORS,
      NUMBER_BINARY_OPERATORS,
      NUMBER_UNARY_OPERATORS,
      STRING_UNARY_OPERATORS,
      anyTypeAnnotation,
      arrayTypeAnnotation,
      booleanTypeAnnotation,
      buildMatchMemberExpression,
      genericTypeAnnotation,
      identifier,
      nullLiteralTypeAnnotation,
      numberTypeAnnotation,
      stringTypeAnnotation,
      tupleTypeAnnotation,
      unionTypeAnnotation,
      voidTypeAnnotation,
      isIdentifier
    } = _t;
    function VariableDeclarator() {
      if (!this.get("id").isIdentifier()) return;
      return this.get("init").getTypeAnnotation();
    }
    function TypeCastExpression(node) {
      return node.typeAnnotation;
    }
    TypeCastExpression.validParent = true;
    function TSAsExpression(node) {
      return node.typeAnnotation;
    }
    TSAsExpression.validParent = true;
    function TSNonNullExpression() {
      return this.get("expression").getTypeAnnotation();
    }
    function NewExpression(node) {
      if (node.callee.type === "Identifier") {
        return genericTypeAnnotation(node.callee);
      }
    }
    function TemplateLiteral() {
      return stringTypeAnnotation();
    }
    function UnaryExpression(node) {
      const operator = node.operator;
      if (operator === "void") {
        return voidTypeAnnotation();
      } else if (NUMBER_UNARY_OPERATORS.includes(operator)) {
        return numberTypeAnnotation();
      } else if (STRING_UNARY_OPERATORS.includes(operator)) {
        return stringTypeAnnotation();
      } else if (BOOLEAN_UNARY_OPERATORS.includes(operator)) {
        return booleanTypeAnnotation();
      }
    }
    function BinaryExpression(node) {
      const operator = node.operator;
      if (NUMBER_BINARY_OPERATORS.includes(operator)) {
        return numberTypeAnnotation();
      } else if (BOOLEAN_BINARY_OPERATORS.includes(operator)) {
        return booleanTypeAnnotation();
      } else if (operator === "+") {
        const right = this.get("right");
        const left = this.get("left");
        if (left.isBaseType("number") && right.isBaseType("number")) {
          return numberTypeAnnotation();
        } else if (left.isBaseType("string") || right.isBaseType("string")) {
          return stringTypeAnnotation();
        }
        return unionTypeAnnotation([stringTypeAnnotation(), numberTypeAnnotation()]);
      }
    }
    function LogicalExpression() {
      const argumentTypes = [this.get("left").getTypeAnnotation(), this.get("right").getTypeAnnotation()];
      return (0, _util.createUnionType)(argumentTypes);
    }
    function ConditionalExpression() {
      const argumentTypes = [this.get("consequent").getTypeAnnotation(), this.get("alternate").getTypeAnnotation()];
      return (0, _util.createUnionType)(argumentTypes);
    }
    function SequenceExpression() {
      return this.get("expressions").pop().getTypeAnnotation();
    }
    function ParenthesizedExpression() {
      return this.get("expression").getTypeAnnotation();
    }
    function AssignmentExpression() {
      return this.get("right").getTypeAnnotation();
    }
    function UpdateExpression(node) {
      const operator = node.operator;
      if (operator === "++" || operator === "--") {
        return numberTypeAnnotation();
      }
    }
    function StringLiteral() {
      return stringTypeAnnotation();
    }
    function NumericLiteral() {
      return numberTypeAnnotation();
    }
    function BooleanLiteral() {
      return booleanTypeAnnotation();
    }
    function NullLiteral() {
      return nullLiteralTypeAnnotation();
    }
    function RegExpLiteral() {
      return genericTypeAnnotation(identifier("RegExp"));
    }
    function ObjectExpression() {
      return genericTypeAnnotation(identifier("Object"));
    }
    function ArrayExpression() {
      return genericTypeAnnotation(identifier("Array"));
    }
    function RestElement() {
      return ArrayExpression();
    }
    RestElement.validParent = true;
    function Func() {
      return genericTypeAnnotation(identifier("Function"));
    }
    var isArrayFrom = buildMatchMemberExpression("Array.from");
    var isObjectKeys = buildMatchMemberExpression("Object.keys");
    var isObjectValues = buildMatchMemberExpression("Object.values");
    var isObjectEntries = buildMatchMemberExpression("Object.entries");
    function CallExpression() {
      const {
        callee
      } = this.node;
      if (isObjectKeys(callee)) {
        return arrayTypeAnnotation(stringTypeAnnotation());
      } else if (isArrayFrom(callee) || isObjectValues(callee) || isIdentifier(callee, {
        name: "Array"
      })) {
        return arrayTypeAnnotation(anyTypeAnnotation());
      } else if (isObjectEntries(callee)) {
        return arrayTypeAnnotation(tupleTypeAnnotation([stringTypeAnnotation(), anyTypeAnnotation()]));
      }
      return resolveCall(this.get("callee"));
    }
    function TaggedTemplateExpression() {
      return resolveCall(this.get("tag"));
    }
    function resolveCall(callee) {
      callee = callee.resolve();
      if (callee.isFunction()) {
        const {
          node
        } = callee;
        if (node.async) {
          if (node.generator) {
            return genericTypeAnnotation(identifier("AsyncIterator"));
          } else {
            return genericTypeAnnotation(identifier("Promise"));
          }
        } else {
          if (node.generator) {
            return genericTypeAnnotation(identifier("Iterator"));
          } else if (callee.node.returnType) {
            return callee.node.returnType;
          } else {
          }
        }
      }
    }
  }
});

// node_modules/@babel/traverse/lib/path/inference/index.js
var require_inference = __commonJS({
  "node_modules/@babel/traverse/lib/path/inference/index.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2._getTypeAnnotation = _getTypeAnnotation;
    exports2.baseTypeStrictlyMatches = baseTypeStrictlyMatches;
    exports2.couldBeBaseType = couldBeBaseType;
    exports2.getTypeAnnotation = getTypeAnnotation;
    exports2.isBaseType = isBaseType;
    exports2.isGenericType = isGenericType;
    var inferers = require_inferers();
    var _t = require_lib3();
    var {
      anyTypeAnnotation,
      isAnyTypeAnnotation,
      isArrayTypeAnnotation,
      isBooleanTypeAnnotation,
      isEmptyTypeAnnotation,
      isFlowBaseAnnotation,
      isGenericTypeAnnotation,
      isIdentifier,
      isMixedTypeAnnotation,
      isNumberTypeAnnotation,
      isStringTypeAnnotation,
      isTSArrayType,
      isTSTypeAnnotation,
      isTSTypeReference,
      isTupleTypeAnnotation,
      isTypeAnnotation,
      isUnionTypeAnnotation,
      isVoidTypeAnnotation,
      stringTypeAnnotation,
      voidTypeAnnotation
    } = _t;
    function getTypeAnnotation() {
      let type = this.getData("typeAnnotation");
      if (type != null) {
        return type;
      }
      type = _getTypeAnnotation.call(this) || anyTypeAnnotation();
      if (isTypeAnnotation(type) || isTSTypeAnnotation(type)) {
        type = type.typeAnnotation;
      }
      this.setData("typeAnnotation", type);
      return type;
    }
    var typeAnnotationInferringNodes = /* @__PURE__ */ new WeakSet();
    function _getTypeAnnotation() {
      const node = this.node;
      if (!node) {
        if (this.key === "init" && this.parentPath.isVariableDeclarator()) {
          const declar = this.parentPath.parentPath;
          const declarParent = declar.parentPath;
          if (declar.key === "left" && declarParent.isForInStatement()) {
            return stringTypeAnnotation();
          }
          if (declar.key === "left" && declarParent.isForOfStatement()) {
            return anyTypeAnnotation();
          }
          return voidTypeAnnotation();
        } else {
          return;
        }
      }
      if (node.typeAnnotation) {
        return node.typeAnnotation;
      }
      if (typeAnnotationInferringNodes.has(node)) {
        return;
      }
      typeAnnotationInferringNodes.add(node);
      try {
        var _inferer;
        let inferer = inferers[node.type];
        if (inferer) {
          return inferer.call(this, node);
        }
        inferer = inferers[this.parentPath.type];
        if ((_inferer = inferer) != null && _inferer.validParent) {
          return this.parentPath.getTypeAnnotation();
        }
      } finally {
        typeAnnotationInferringNodes.delete(node);
      }
    }
    function isBaseType(baseName, soft) {
      return _isBaseType(baseName, this.getTypeAnnotation(), soft);
    }
    function _isBaseType(baseName, type, soft) {
      if (baseName === "string") {
        return isStringTypeAnnotation(type);
      } else if (baseName === "number") {
        return isNumberTypeAnnotation(type);
      } else if (baseName === "boolean") {
        return isBooleanTypeAnnotation(type);
      } else if (baseName === "any") {
        return isAnyTypeAnnotation(type);
      } else if (baseName === "mixed") {
        return isMixedTypeAnnotation(type);
      } else if (baseName === "empty") {
        return isEmptyTypeAnnotation(type);
      } else if (baseName === "void") {
        return isVoidTypeAnnotation(type);
      } else {
        if (soft) {
          return false;
        } else {
          throw new Error(`Unknown base type ${baseName}`);
        }
      }
    }
    function couldBeBaseType(name) {
      const type = this.getTypeAnnotation();
      if (isAnyTypeAnnotation(type)) return true;
      if (isUnionTypeAnnotation(type)) {
        for (const type2 of type.types) {
          if (isAnyTypeAnnotation(type2) || _isBaseType(name, type2, true)) {
            return true;
          }
        }
        return false;
      } else {
        return _isBaseType(name, type, true);
      }
    }
    function baseTypeStrictlyMatches(rightArg) {
      const left = this.getTypeAnnotation();
      const right = rightArg.getTypeAnnotation();
      if (!isAnyTypeAnnotation(left) && isFlowBaseAnnotation(left)) {
        return right.type === left.type;
      }
      return false;
    }
    function isGenericType(genericName) {
      const type = this.getTypeAnnotation();
      if (genericName === "Array") {
        if (isTSArrayType(type) || isArrayTypeAnnotation(type) || isTupleTypeAnnotation(type)) {
          return true;
        }
      }
      return isGenericTypeAnnotation(type) && isIdentifier(type.id, {
        name: genericName
      }) || isTSTypeReference(type) && isIdentifier(type.typeName, {
        name: genericName
      });
    }
  }
});

// node_modules/@babel/traverse/lib/path/lib/removal-hooks.js
var require_removal_hooks = __commonJS({
  "node_modules/@babel/traverse/lib/path/lib/removal-hooks.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.hooks = void 0;
    var hooks = exports2.hooks = [function(self2, parent) {
      const removeParent = self2.key === "test" && (parent.isWhile() || parent.isSwitchCase()) || self2.key === "declaration" && parent.isExportDeclaration() || self2.key === "body" && parent.isLabeledStatement() || self2.listKey === "declarations" && parent.isVariableDeclaration() && parent.node.declarations.length === 1 || self2.key === "expression" && parent.isExpressionStatement();
      if (removeParent) {
        parent.remove();
        return true;
      }
    }, function(self2, parent) {
      if (parent.isSequenceExpression() && parent.node.expressions.length === 1) {
        parent.replaceWith(parent.node.expressions[0]);
        return true;
      }
    }, function(self2, parent) {
      if (parent.isBinary()) {
        if (self2.key === "left") {
          parent.replaceWith(parent.node.right);
        } else {
          parent.replaceWith(parent.node.left);
        }
        return true;
      }
    }, function(self2, parent) {
      if (parent.isIfStatement() && self2.key === "consequent" || self2.key === "body" && (parent.isLoop() || parent.isArrowFunctionExpression())) {
        self2.replaceWith({
          type: "BlockStatement",
          directives: [],
          body: []
        });
        return true;
      }
    }];
  }
});

// node_modules/@babel/traverse/lib/path/removal.js
var require_removal = __commonJS({
  "node_modules/@babel/traverse/lib/path/removal.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2._assertUnremoved = _assertUnremoved;
    exports2._callRemovalHooks = _callRemovalHooks;
    exports2._markRemoved = _markRemoved;
    exports2._remove = _remove;
    exports2._removeFromScope = _removeFromScope;
    exports2.remove = remove;
    var _removalHooks = require_removal_hooks();
    var _cache = require_cache();
    var _replacement = require_replacement();
    var _index = require_path();
    var t = require_lib3();
    var _modification = require_modification();
    var _context = require_context2();
    function remove() {
      var _this$opts;
      _assertUnremoved.call(this);
      _context.resync.call(this);
      if (_callRemovalHooks.call(this)) {
        _markRemoved.call(this);
        return;
      }
      if (!((_this$opts = this.opts) != null && _this$opts.noScope)) {
        _removeFromScope.call(this);
      }
      this.shareCommentsWithSiblings();
      _remove.call(this);
      _markRemoved.call(this);
    }
    function _removeFromScope() {
      const bindings = t.getBindingIdentifiers(this.node, false, false, true);
      Object.keys(bindings).forEach((name) => this.scope.removeBinding(name));
    }
    function _callRemovalHooks() {
      if (this.parentPath) {
        for (const fn of _removalHooks.hooks) {
          if (fn(this, this.parentPath)) return true;
        }
      }
    }
    function _remove() {
      if (Array.isArray(this.container)) {
        this.container.splice(this.key, 1);
        _modification.updateSiblingKeys.call(this, this.key, -1);
      } else {
        _replacement._replaceWith.call(this, null);
      }
    }
    function _markRemoved() {
      this._traverseFlags |= _index.SHOULD_SKIP | _index.REMOVED;
      if (this.parent) {
        var _getCachedPaths;
        (_getCachedPaths = (0, _cache.getCachedPaths)(this)) == null || _getCachedPaths.delete(this.node);
      }
      this.node = null;
    }
    function _assertUnremoved() {
      if (this.removed) {
        throw this.buildCodeFrameError("NodePath has been removed so is read-only.");
      }
    }
  }
});

// node_modules/@babel/traverse/lib/path/lib/hoister.js
var require_hoister = __commonJS({
  "node_modules/@babel/traverse/lib/path/lib/hoister.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = void 0;
    var _t = require_lib3();
    var _t2 = _t;
    var {
      react
    } = _t;
    var {
      cloneNode,
      jsxExpressionContainer,
      variableDeclaration,
      variableDeclarator
    } = _t2;
    var referenceVisitor = {
      ReferencedIdentifier(path, state) {
        if (path.isJSXIdentifier() && react.isCompatTag(path.node.name) && !path.parentPath.isJSXMemberExpression()) {
          return;
        }
        if (path.node.name === "this") {
          let scope = path.scope;
          do {
            if (scope.path.isFunction() && !scope.path.isArrowFunctionExpression()) {
              break;
            }
          } while (scope = scope.parent);
          if (scope) state.breakOnScopePaths.push(scope.path);
        }
        const binding = path.scope.getBinding(path.node.name);
        if (!binding) return;
        for (const violation of binding.constantViolations) {
          if (violation.scope !== binding.path.scope) {
            state.mutableBinding = true;
            path.stop();
            return;
          }
        }
        if (binding !== state.scope.getBinding(path.node.name)) return;
        state.bindings[path.node.name] = binding;
      }
    };
    var PathHoister = class {
      constructor(path, scope) {
        this.breakOnScopePaths = void 0;
        this.bindings = void 0;
        this.mutableBinding = void 0;
        this.scopes = void 0;
        this.scope = void 0;
        this.path = void 0;
        this.attachAfter = void 0;
        this.breakOnScopePaths = [];
        this.bindings = {};
        this.mutableBinding = false;
        this.scopes = [];
        this.scope = scope;
        this.path = path;
        this.attachAfter = false;
      }
      isCompatibleScope(scope) {
        for (const key of Object.keys(this.bindings)) {
          const binding = this.bindings[key];
          if (!scope.bindingIdentifierEquals(key, binding.identifier)) {
            return false;
          }
        }
        return true;
      }
      getCompatibleScopes() {
        let scope = this.path.scope;
        do {
          if (this.isCompatibleScope(scope)) {
            this.scopes.push(scope);
          } else {
            break;
          }
          if (this.breakOnScopePaths.includes(scope.path)) {
            break;
          }
        } while (scope = scope.parent);
      }
      getAttachmentPath() {
        let path = this._getAttachmentPath();
        if (!path) return;
        let targetScope = path.scope;
        if (targetScope.path === path) {
          targetScope = path.scope.parent;
        }
        if (targetScope.path.isProgram() || targetScope.path.isFunction()) {
          for (const name of Object.keys(this.bindings)) {
            if (!targetScope.hasOwnBinding(name)) continue;
            const binding = this.bindings[name];
            if (binding.kind === "param" || binding.path.parentKey === "params") {
              continue;
            }
            const bindingParentPath = this.getAttachmentParentForPath(binding.path);
            if (bindingParentPath.key >= path.key) {
              this.attachAfter = true;
              path = binding.path;
              for (const violationPath of binding.constantViolations) {
                if (this.getAttachmentParentForPath(violationPath).key > path.key) {
                  path = violationPath;
                }
              }
            }
          }
        }
        return path;
      }
      _getAttachmentPath() {
        const scopes = this.scopes;
        const scope = scopes.pop();
        if (!scope) return;
        if (scope.path.isFunction()) {
          if (this.hasOwnParamBindings(scope)) {
            if (this.scope === scope) return;
            const bodies = scope.path.get("body").get("body");
            for (let i = 0; i < bodies.length; i++) {
              if (bodies[i].node._blockHoist) continue;
              return bodies[i];
            }
          } else {
            return this.getNextScopeAttachmentParent();
          }
        } else if (scope.path.isProgram()) {
          return this.getNextScopeAttachmentParent();
        }
      }
      getNextScopeAttachmentParent() {
        const scope = this.scopes.pop();
        if (scope) return this.getAttachmentParentForPath(scope.path);
      }
      getAttachmentParentForPath(path) {
        do {
          if (!path.parentPath || Array.isArray(path.container) && path.isStatement()) {
            return path;
          }
        } while (path = path.parentPath);
        return path;
      }
      hasOwnParamBindings(scope) {
        for (const name of Object.keys(this.bindings)) {
          if (!scope.hasOwnBinding(name)) continue;
          const binding = this.bindings[name];
          if (binding.kind === "param" && binding.constant) return true;
        }
        return false;
      }
      run() {
        this.path.traverse(referenceVisitor, this);
        if (this.mutableBinding) return;
        this.getCompatibleScopes();
        const attachTo = this.getAttachmentPath();
        if (!attachTo) return;
        if (attachTo.getFunctionParent() === this.path.getFunctionParent()) return;
        let uid = attachTo.scope.generateUidIdentifier("ref");
        const declarator = variableDeclarator(uid, this.path.node);
        const insertFn = this.attachAfter ? "insertAfter" : "insertBefore";
        const [attached] = attachTo[insertFn]([attachTo.isVariableDeclarator() ? declarator : variableDeclaration("var", [declarator])]);
        const parent = this.path.parentPath;
        if (parent.isJSXElement() && this.path.container === parent.node.children) {
          uid = jsxExpressionContainer(uid);
        }
        this.path.replaceWith(cloneNode(uid));
        return attached.isVariableDeclarator() ? attached.get("init") : attached.get("declarations.0.init");
      }
    };
    exports2.default = PathHoister;
  }
});

// node_modules/@babel/traverse/lib/path/modification.js
var require_modification = __commonJS({
  "node_modules/@babel/traverse/lib/path/modification.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2._containerInsert = _containerInsert;
    exports2._containerInsertAfter = _containerInsertAfter;
    exports2._containerInsertBefore = _containerInsertBefore;
    exports2._verifyNodeList = _verifyNodeList;
    exports2.insertAfter = insertAfter;
    exports2.insertBefore = insertBefore;
    exports2.pushContainer = pushContainer;
    exports2.unshiftContainer = unshiftContainer;
    exports2.updateSiblingKeys = updateSiblingKeys;
    var _cache = require_cache();
    var _index = require_path();
    var _context = require_context2();
    var _removal = require_removal();
    var _t = require_lib3();
    var _hoister = require_hoister();
    var {
      arrowFunctionExpression,
      assertExpression,
      assignmentExpression,
      blockStatement,
      callExpression,
      cloneNode,
      expressionStatement,
      isAssignmentExpression,
      isCallExpression,
      isExportNamedDeclaration,
      isExpression,
      isIdentifier,
      isSequenceExpression,
      isSuper,
      thisExpression
    } = _t;
    function insertBefore(nodes_) {
      _removal._assertUnremoved.call(this);
      const nodes = _verifyNodeList.call(this, nodes_);
      const {
        parentPath,
        parent
      } = this;
      if (parentPath.isExpressionStatement() || parentPath.isLabeledStatement() || isExportNamedDeclaration(parent) || parentPath.isExportDefaultDeclaration() && this.isDeclaration()) {
        return parentPath.insertBefore(nodes);
      } else if (this.isNodeType("Expression") && !this.isJSXElement() || parentPath.isForStatement() && this.key === "init") {
        if (this.node) nodes.push(this.node);
        return this.replaceExpressionWithStatements(nodes);
      } else if (Array.isArray(this.container)) {
        return _containerInsertBefore.call(this, nodes);
      } else if (this.isStatementOrBlock()) {
        const node = this.node;
        const shouldInsertCurrentNode = node && (!this.isExpressionStatement() || node.expression != null);
        const [blockPath] = this.replaceWith(blockStatement(shouldInsertCurrentNode ? [node] : []));
        return blockPath.unshiftContainer("body", nodes);
      } else {
        throw new Error("We don't know what to do with this node type. We were previously a Statement but we can't fit in here?");
      }
    }
    function _containerInsert(from, nodes) {
      updateSiblingKeys.call(this, from, nodes.length);
      const paths = [];
      this.container.splice(from, 0, ...nodes);
      for (let i = 0; i < nodes.length; i++) {
        var _this$context;
        const to = from + i;
        const path = this.getSibling(to);
        paths.push(path);
        if ((_this$context = this.context) != null && _this$context.queue) {
          _context.pushContext.call(path, this.context);
        }
      }
      const contexts = _context._getQueueContexts.call(this);
      for (const path of paths) {
        _context.setScope.call(path);
        path.debug("Inserted.");
        for (const context of contexts) {
          context.maybeQueue(path, true);
        }
      }
      return paths;
    }
    function _containerInsertBefore(nodes) {
      return _containerInsert.call(this, this.key, nodes);
    }
    function _containerInsertAfter(nodes) {
      return _containerInsert.call(this, this.key + 1, nodes);
    }
    var last = (arr) => arr[arr.length - 1];
    function isHiddenInSequenceExpression(path) {
      return isSequenceExpression(path.parent) && (last(path.parent.expressions) !== path.node || isHiddenInSequenceExpression(path.parentPath));
    }
    function isAlmostConstantAssignment(node, scope) {
      if (!isAssignmentExpression(node) || !isIdentifier(node.left)) {
        return false;
      }
      const blockScope = scope.getBlockParent();
      return blockScope.hasOwnBinding(node.left.name) && blockScope.getOwnBinding(node.left.name).constantViolations.length <= 1;
    }
    function insertAfter(nodes_) {
      _removal._assertUnremoved.call(this);
      if (this.isSequenceExpression()) {
        return last(this.get("expressions")).insertAfter(nodes_);
      }
      const nodes = _verifyNodeList.call(this, nodes_);
      const {
        parentPath,
        parent
      } = this;
      if (parentPath.isExpressionStatement() || parentPath.isLabeledStatement() || isExportNamedDeclaration(parent) || parentPath.isExportDefaultDeclaration() && this.isDeclaration()) {
        return parentPath.insertAfter(nodes.map((node) => {
          return isExpression(node) ? expressionStatement(node) : node;
        }));
      } else if (this.isNodeType("Expression") && !this.isJSXElement() && !parentPath.isJSXElement() || parentPath.isForStatement() && this.key === "init") {
        const self2 = this;
        if (self2.node) {
          const node = self2.node;
          let {
            scope
          } = this;
          if (scope.path.isPattern()) {
            assertExpression(node);
            self2.replaceWith(callExpression(arrowFunctionExpression([], node), []));
            self2.get("callee.body").insertAfter(nodes);
            return [self2];
          }
          if (isHiddenInSequenceExpression(self2)) {
            nodes.unshift(node);
          } else if (isCallExpression(node) && isSuper(node.callee)) {
            nodes.unshift(node);
            nodes.push(thisExpression());
          } else if (isAlmostConstantAssignment(node, scope)) {
            nodes.unshift(node);
            nodes.push(cloneNode(node.left));
          } else if (scope.isPure(node, true)) {
            nodes.push(node);
          } else {
            if (parentPath.isMethod({
              computed: true,
              key: node
            })) {
              scope = scope.parent;
            }
            const temp = scope.generateDeclaredUidIdentifier();
            nodes.unshift(expressionStatement(assignmentExpression("=", cloneNode(temp), node)));
            nodes.push(expressionStatement(cloneNode(temp)));
          }
        }
        return this.replaceExpressionWithStatements(nodes);
      } else if (Array.isArray(this.container)) {
        return _containerInsertAfter.call(this, nodes);
      } else if (this.isStatementOrBlock()) {
        const node = this.node;
        const shouldInsertCurrentNode = node && (!this.isExpressionStatement() || node.expression != null);
        const [blockPath] = this.replaceWith(blockStatement(shouldInsertCurrentNode ? [node] : []));
        return blockPath.pushContainer("body", nodes);
      } else {
        throw new Error("We don't know what to do with this node type. We were previously a Statement but we can't fit in here?");
      }
    }
    function updateSiblingKeys(fromIndex, incrementBy) {
      if (!this.parent) return;
      const paths = (0, _cache.getCachedPaths)(this);
      if (!paths) return;
      for (const [, path] of paths) {
        if (typeof path.key === "number" && path.container === this.container && path.key >= fromIndex) {
          path.key += incrementBy;
        }
      }
    }
    function _verifyNodeList(nodes) {
      if (!nodes) {
        return [];
      }
      if (!Array.isArray(nodes)) {
        nodes = [nodes];
      }
      for (let i = 0; i < nodes.length; i++) {
        const node = nodes[i];
        let msg;
        if (!node) {
          msg = "has falsy node";
        } else if (typeof node !== "object") {
          msg = "contains a non-object node";
        } else if (!node.type) {
          msg = "without a type";
        } else if (node instanceof _index.default) {
          msg = "has a NodePath when it expected a raw object";
        }
        if (msg) {
          const type = Array.isArray(node) ? "array" : typeof node;
          throw new Error(`Node list ${msg} with the index of ${i} and type of ${type}`);
        }
      }
      return nodes;
    }
    function unshiftContainer(listKey, nodes) {
      _removal._assertUnremoved.call(this);
      const verifiedNodes = _verifyNodeList.call(this, nodes);
      const container = this.node[listKey];
      const path = _index.default.get({
        parentPath: this,
        parent: this.node,
        container,
        listKey,
        key: 0
      }).setContext(this.context);
      return _containerInsertBefore.call(path, verifiedNodes);
    }
    function pushContainer(listKey, nodes) {
      _removal._assertUnremoved.call(this);
      const verifiedNodes = _verifyNodeList.call(this, nodes);
      const container = this.node[listKey];
      const path = _index.default.get({
        parentPath: this,
        parent: this.node,
        container,
        listKey,
        key: container.length
      }).setContext(this.context);
      return path.replaceWithMultiple(verifiedNodes);
    }
    exports2.hoist = function hoist(scope = this.scope) {
      const hoister = new _hoister.default(this, scope);
      return hoister.run();
    };
  }
});

// node_modules/@babel/traverse/lib/path/replacement.js
var require_replacement = __commonJS({
  "node_modules/@babel/traverse/lib/path/replacement.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2._replaceWith = _replaceWith;
    exports2.replaceExpressionWithStatements = replaceExpressionWithStatements;
    exports2.replaceInline = replaceInline;
    exports2.replaceWith = replaceWith;
    exports2.replaceWithMultiple = replaceWithMultiple;
    exports2.replaceWithSourceString = replaceWithSourceString;
    var _codeFrame = require_lib5();
    var _index = require_lib9();
    var _index2 = require_path();
    var _cache = require_cache();
    var _modification = require_modification();
    var _parser = require_lib4();
    var _t = require_lib3();
    var _context = require_context2();
    var {
      FUNCTION_TYPES,
      arrowFunctionExpression,
      assignmentExpression,
      awaitExpression,
      blockStatement,
      buildUndefinedNode,
      callExpression,
      cloneNode,
      conditionalExpression,
      expressionStatement,
      getBindingIdentifiers,
      identifier,
      inheritLeadingComments,
      inheritTrailingComments,
      inheritsComments,
      isBlockStatement,
      isEmptyStatement,
      isExpression,
      isExpressionStatement,
      isIfStatement,
      isProgram,
      isStatement,
      isVariableDeclaration,
      removeComments,
      returnStatement,
      sequenceExpression,
      validate,
      yieldExpression
    } = _t;
    function replaceWithMultiple(nodes) {
      var _getCachedPaths;
      _context.resync.call(this);
      const verifiedNodes = _modification._verifyNodeList.call(this, nodes);
      inheritLeadingComments(verifiedNodes[0], this.node);
      inheritTrailingComments(verifiedNodes[verifiedNodes.length - 1], this.node);
      (_getCachedPaths = (0, _cache.getCachedPaths)(this)) == null || _getCachedPaths.delete(this.node);
      this.node = this.container[this.key] = null;
      const paths = this.insertAfter(nodes);
      if (this.node) {
        this.requeue();
      } else {
        this.remove();
      }
      return paths;
    }
    function replaceWithSourceString(replacement) {
      _context.resync.call(this);
      let ast;
      try {
        replacement = `(${replacement})`;
        ast = (0, _parser.parse)(replacement);
      } catch (err) {
        const loc = err.loc;
        if (loc) {
          err.message += " - make sure this is an expression.\n" + (0, _codeFrame.codeFrameColumns)(replacement, {
            start: {
              line: loc.line,
              column: loc.column + 1
            }
          });
          err.code = "BABEL_REPLACE_SOURCE_ERROR";
        }
        throw err;
      }
      const expressionAST = ast.program.body[0].expression;
      _index.default.removeProperties(expressionAST);
      return this.replaceWith(expressionAST);
    }
    function replaceWith(replacementPath) {
      _context.resync.call(this);
      if (this.removed) {
        throw new Error("You can't replace this node, we've already removed it");
      }
      let replacement = replacementPath instanceof _index2.default ? replacementPath.node : replacementPath;
      if (!replacement) {
        throw new Error("You passed `path.replaceWith()` a falsy node, use `path.remove()` instead");
      }
      if (this.node === replacement) {
        return [this];
      }
      if (this.isProgram() && !isProgram(replacement)) {
        throw new Error("You can only replace a Program root node with another Program node");
      }
      if (Array.isArray(replacement)) {
        throw new Error("Don't use `path.replaceWith()` with an array of nodes, use `path.replaceWithMultiple()`");
      }
      if (typeof replacement === "string") {
        throw new Error("Don't use `path.replaceWith()` with a source string, use `path.replaceWithSourceString()`");
      }
      let nodePath = "";
      if (this.isNodeType("Statement") && isExpression(replacement)) {
        if (!this.canHaveVariableDeclarationOrExpression() && !this.canSwapBetweenExpressionAndStatement(replacement) && !this.parentPath.isExportDefaultDeclaration()) {
          replacement = expressionStatement(replacement);
          nodePath = "expression";
        }
      }
      if (this.isNodeType("Expression") && isStatement(replacement)) {
        if (!this.canHaveVariableDeclarationOrExpression() && !this.canSwapBetweenExpressionAndStatement(replacement)) {
          return this.replaceExpressionWithStatements([replacement]);
        }
      }
      const oldNode = this.node;
      if (oldNode) {
        inheritsComments(replacement, oldNode);
        removeComments(oldNode);
      }
      _replaceWith.call(this, replacement);
      this.type = replacement.type;
      _context.setScope.call(this);
      this.requeue();
      return [nodePath ? this.get(nodePath) : this];
    }
    function _replaceWith(node) {
      var _getCachedPaths2;
      if (!this.container) {
        throw new ReferenceError("Container is falsy");
      }
      if (this.inList) {
        validate(this.parent, this.key, [node]);
      } else {
        validate(this.parent, this.key, node);
      }
      this.debug(`Replace with ${node == null ? void 0 : node.type}`);
      (_getCachedPaths2 = (0, _cache.getCachedPaths)(this)) == null || _getCachedPaths2.set(node, this).delete(this.node);
      this.node = node;
      this.container[this.key] = node;
    }
    function replaceExpressionWithStatements(nodes) {
      _context.resync.call(this);
      const declars = [];
      const nodesAsSingleExpression = gatherSequenceExpressions(nodes, declars);
      if (nodesAsSingleExpression) {
        for (const id of declars) this.scope.push({
          id
        });
        return this.replaceWith(nodesAsSingleExpression)[0].get("expressions");
      }
      const functionParent = this.getFunctionParent();
      const isParentAsync = functionParent == null ? void 0 : functionParent.node.async;
      const isParentGenerator = functionParent == null ? void 0 : functionParent.node.generator;
      const container = arrowFunctionExpression([], blockStatement(nodes));
      this.replaceWith(callExpression(container, []));
      const callee = this.get("callee");
      callee.get("body").scope.hoistVariables((id) => this.scope.push({
        id
      }));
      const completionRecords = callee.getCompletionRecords();
      for (const path of completionRecords) {
        if (!path.isExpressionStatement()) continue;
        const loop = path.findParent((path2) => path2.isLoop());
        if (loop) {
          let uid = loop.getData("expressionReplacementReturnUid");
          if (!uid) {
            uid = callee.scope.generateDeclaredUidIdentifier("ret");
            callee.get("body").pushContainer("body", returnStatement(cloneNode(uid)));
            loop.setData("expressionReplacementReturnUid", uid);
          } else {
            uid = identifier(uid.name);
          }
          path.get("expression").replaceWith(assignmentExpression("=", cloneNode(uid), path.node.expression));
        } else {
          path.replaceWith(returnStatement(path.node.expression));
        }
      }
      callee.arrowFunctionToExpression();
      const newCallee = callee;
      const needToAwaitFunction = isParentAsync && _index.default.hasType(newCallee.node.body, "AwaitExpression", FUNCTION_TYPES);
      const needToYieldFunction = isParentGenerator && _index.default.hasType(newCallee.node.body, "YieldExpression", FUNCTION_TYPES);
      if (needToAwaitFunction) {
        newCallee.set("async", true);
        if (!needToYieldFunction) {
          this.replaceWith(awaitExpression(this.node));
        }
      }
      if (needToYieldFunction) {
        newCallee.set("generator", true);
        this.replaceWith(yieldExpression(this.node, true));
      }
      return newCallee.get("body.body");
    }
    function gatherSequenceExpressions(nodes, declars) {
      const exprs = [];
      let ensureLastUndefined = true;
      for (const node of nodes) {
        if (!isEmptyStatement(node)) {
          ensureLastUndefined = false;
        }
        if (isExpression(node)) {
          exprs.push(node);
        } else if (isExpressionStatement(node)) {
          exprs.push(node.expression);
        } else if (isVariableDeclaration(node)) {
          if (node.kind !== "var") return;
          for (const declar of node.declarations) {
            const bindings = getBindingIdentifiers(declar);
            for (const key of Object.keys(bindings)) {
              declars.push(cloneNode(bindings[key]));
            }
            if (declar.init) {
              exprs.push(assignmentExpression("=", declar.id, declar.init));
            }
          }
          ensureLastUndefined = true;
        } else if (isIfStatement(node)) {
          const consequent = node.consequent ? gatherSequenceExpressions([node.consequent], declars) : buildUndefinedNode();
          const alternate = node.alternate ? gatherSequenceExpressions([node.alternate], declars) : buildUndefinedNode();
          if (!consequent || !alternate) return;
          exprs.push(conditionalExpression(node.test, consequent, alternate));
        } else if (isBlockStatement(node)) {
          const body = gatherSequenceExpressions(node.body, declars);
          if (!body) return;
          exprs.push(body);
        } else if (isEmptyStatement(node)) {
          if (nodes.indexOf(node) === 0) {
            ensureLastUndefined = true;
          }
        } else {
          return;
        }
      }
      if (ensureLastUndefined) exprs.push(buildUndefinedNode());
      if (exprs.length === 1) {
        return exprs[0];
      } else {
        return sequenceExpression(exprs);
      }
    }
    function replaceInline(nodes) {
      _context.resync.call(this);
      if (Array.isArray(nodes)) {
        if (Array.isArray(this.container)) {
          nodes = _modification._verifyNodeList.call(this, nodes);
          const paths = _modification._containerInsertAfter.call(this, nodes);
          this.remove();
          return paths;
        } else {
          return this.replaceWithMultiple(nodes);
        }
      } else {
        return this.replaceWith(nodes);
      }
    }
  }
});

// node_modules/@babel/traverse/lib/path/evaluation.js
var require_evaluation = __commonJS({
  "node_modules/@babel/traverse/lib/path/evaluation.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.evaluate = evaluate;
    exports2.evaluateTruthy = evaluateTruthy;
    var VALID_OBJECT_CALLEES = ["Number", "String", "Math"];
    var VALID_IDENTIFIER_CALLEES = ["isFinite", "isNaN", "parseFloat", "parseInt", "decodeURI", "decodeURIComponent", "encodeURI", "encodeURIComponent", null, null];
    var INVALID_METHODS = ["random"];
    function isValidObjectCallee(val) {
      return VALID_OBJECT_CALLEES.includes(val);
    }
    function isValidIdentifierCallee(val) {
      return VALID_IDENTIFIER_CALLEES.includes(val);
    }
    function isInvalidMethod(val) {
      return INVALID_METHODS.includes(val);
    }
    function evaluateTruthy() {
      const res = this.evaluate();
      if (res.confident) return !!res.value;
    }
    function deopt(path, state) {
      if (!state.confident) return;
      state.deoptPath = path;
      state.confident = false;
    }
    var Globals = /* @__PURE__ */ new Map([["undefined", void 0], ["Infinity", Infinity], ["NaN", NaN]]);
    function evaluateCached(path, state) {
      const {
        node
      } = path;
      const {
        seen
      } = state;
      if (seen.has(node)) {
        const existing = seen.get(node);
        if (existing.resolved) {
          return existing.value;
        } else {
          deopt(path, state);
          return;
        }
      } else {
        const item = {
          resolved: false
        };
        seen.set(node, item);
        const val = _evaluate(path, state);
        if (state.confident) {
          item.resolved = true;
          item.value = val;
        }
        return val;
      }
    }
    function _evaluate(path, state) {
      if (!state.confident) return;
      if (path.isSequenceExpression()) {
        const exprs = path.get("expressions");
        return evaluateCached(exprs[exprs.length - 1], state);
      }
      if (path.isStringLiteral() || path.isNumericLiteral() || path.isBooleanLiteral()) {
        return path.node.value;
      }
      if (path.isNullLiteral()) {
        return null;
      }
      if (path.isTemplateLiteral()) {
        return evaluateQuasis(path, path.node.quasis, state);
      }
      if (path.isTaggedTemplateExpression() && path.get("tag").isMemberExpression()) {
        const object = path.get("tag.object");
        const {
          node: {
            name
          }
        } = object;
        const property = path.get("tag.property");
        if (object.isIdentifier() && name === "String" && !path.scope.getBinding(name) && property.isIdentifier() && property.node.name === "raw") {
          return evaluateQuasis(path, path.node.quasi.quasis, state, true);
        }
      }
      if (path.isConditionalExpression()) {
        const testResult = evaluateCached(path.get("test"), state);
        if (!state.confident) return;
        if (testResult) {
          return evaluateCached(path.get("consequent"), state);
        } else {
          return evaluateCached(path.get("alternate"), state);
        }
      }
      if (path.isExpressionWrapper()) {
        return evaluateCached(path.get("expression"), state);
      }
      if (path.isMemberExpression() && !path.parentPath.isCallExpression({
        callee: path.node
      })) {
        const property = path.get("property");
        const object = path.get("object");
        if (object.isLiteral()) {
          const value2 = object.node.value;
          const type = typeof value2;
          let key = null;
          if (path.node.computed) {
            key = evaluateCached(property, state);
            if (!state.confident) return;
          } else if (property.isIdentifier()) {
            key = property.node.name;
          }
          if ((type === "number" || type === "string") && key != null && (typeof key === "number" || typeof key === "string")) {
            return value2[key];
          }
        }
      }
      if (path.isReferencedIdentifier()) {
        const binding = path.scope.getBinding(path.node.name);
        if (binding) {
          if (binding.constantViolations.length > 0 || path.node.start < binding.path.node.end) {
            deopt(binding.path, state);
            return;
          }
          const bindingPathScope = binding.path.scope;
          if (binding.kind === "var" && bindingPathScope !== binding.scope) {
            let hasUnsafeBlock = !bindingPathScope.path.parentPath.isBlockStatement();
            for (let scope = bindingPathScope.parent; scope; scope = scope.parent) {
              var _scope$path$parentPat;
              if (scope === path.scope) {
                if (hasUnsafeBlock) {
                  deopt(binding.path, state);
                  return;
                }
                break;
              }
              if ((_scope$path$parentPat = scope.path.parentPath) != null && _scope$path$parentPat.isBlockStatement()) {
                hasUnsafeBlock = true;
              }
            }
          }
          if (binding.hasValue) {
            return binding.value;
          }
        }
        const name = path.node.name;
        if (Globals.has(name)) {
          if (!binding) {
            return Globals.get(name);
          }
          deopt(binding.path, state);
          return;
        }
        if (!binding) {
          deopt(path, state);
          return;
        }
        const bindingPath = binding.path;
        if (!bindingPath.isVariableDeclarator()) {
          deopt(bindingPath, state);
          return;
        }
        const initPath = bindingPath.get("init");
        const value2 = evaluateCached(initPath, state);
        if (typeof value2 === "object" && value2 !== null && binding.references > 1) {
          deopt(initPath, state);
          return;
        }
        return value2;
      }
      if (path.isUnaryExpression({
        prefix: true
      })) {
        if (path.node.operator === "void") {
          return void 0;
        }
        const argument = path.get("argument");
        if (path.node.operator === "typeof" && (argument.isFunction() || argument.isClass())) {
          return "function";
        }
        const arg = evaluateCached(argument, state);
        if (!state.confident) return;
        switch (path.node.operator) {
          case "!":
            return !arg;
          case "+":
            return +arg;
          case "-":
            return -arg;
          case "~":
            return ~arg;
          case "typeof":
            return typeof arg;
        }
      }
      if (path.isArrayExpression()) {
        const arr = [];
        const elems = path.get("elements");
        for (const elem of elems) {
          const elemValue = elem.evaluate();
          if (elemValue.confident) {
            arr.push(elemValue.value);
          } else {
            deopt(elemValue.deopt, state);
            return;
          }
        }
        return arr;
      }
      if (path.isObjectExpression()) {
        const obj = {};
        const props = path.get("properties");
        for (const prop of props) {
          if (prop.isObjectMethod() || prop.isSpreadElement()) {
            deopt(prop, state);
            return;
          }
          const keyPath = prop.get("key");
          let key;
          if (prop.node.computed) {
            key = keyPath.evaluate();
            if (!key.confident) {
              deopt(key.deopt, state);
              return;
            }
            key = key.value;
          } else if (keyPath.isIdentifier()) {
            key = keyPath.node.name;
          } else {
            key = keyPath.node.value;
          }
          const valuePath = prop.get("value");
          let value2 = valuePath.evaluate();
          if (!value2.confident) {
            deopt(value2.deopt, state);
            return;
          }
          value2 = value2.value;
          obj[key] = value2;
        }
        return obj;
      }
      if (path.isLogicalExpression()) {
        const wasConfident = state.confident;
        const left = evaluateCached(path.get("left"), state);
        const leftConfident = state.confident;
        state.confident = wasConfident;
        const right = evaluateCached(path.get("right"), state);
        const rightConfident = state.confident;
        switch (path.node.operator) {
          case "||":
            state.confident = leftConfident && (!!left || rightConfident);
            if (!state.confident) return;
            return left || right;
          case "&&":
            state.confident = leftConfident && (!left || rightConfident);
            if (!state.confident) return;
            return left && right;
          case "??":
            state.confident = leftConfident && (left != null || rightConfident);
            if (!state.confident) return;
            return left != null ? left : right;
        }
      }
      if (path.isBinaryExpression()) {
        const left = evaluateCached(path.get("left"), state);
        if (!state.confident) return;
        const right = evaluateCached(path.get("right"), state);
        if (!state.confident) return;
        switch (path.node.operator) {
          case "-":
            return left - right;
          case "+":
            return left + right;
          case "/":
            return left / right;
          case "*":
            return left * right;
          case "%":
            return left % right;
          case "**":
            return Math.pow(left, right);
          case "<":
            return left < right;
          case ">":
            return left > right;
          case "<=":
            return left <= right;
          case ">=":
            return left >= right;
          case "==":
            return left == right;
          case "!=":
            return left != right;
          case "===":
            return left === right;
          case "!==":
            return left !== right;
          case "|":
            return left | right;
          case "&":
            return left & right;
          case "^":
            return left ^ right;
          case "<<":
            return left << right;
          case ">>":
            return left >> right;
          case ">>>":
            return left >>> right;
        }
      }
      if (path.isCallExpression()) {
        const callee = path.get("callee");
        let context;
        let func;
        if (callee.isIdentifier() && !path.scope.getBinding(callee.node.name) && (isValidObjectCallee(callee.node.name) || isValidIdentifierCallee(callee.node.name))) {
          func = global[callee.node.name];
        }
        if (callee.isMemberExpression()) {
          const object = callee.get("object");
          const property = callee.get("property");
          if (object.isIdentifier() && property.isIdentifier() && isValidObjectCallee(object.node.name) && !isInvalidMethod(property.node.name)) {
            context = global[object.node.name];
            const key = property.node.name;
            if (hasOwnProperty.call(context, key)) {
              func = context[key];
            }
          }
          if (object.isLiteral() && property.isIdentifier()) {
            const type = typeof object.node.value;
            if (type === "string" || type === "number") {
              context = object.node.value;
              func = context[property.node.name];
            }
          }
        }
        if (func) {
          const args = path.get("arguments").map((arg) => evaluateCached(arg, state));
          if (!state.confident) return;
          return func.apply(context, args);
        }
      }
      deopt(path, state);
    }
    function evaluateQuasis(path, quasis, state, raw = false) {
      let str = "";
      let i = 0;
      const exprs = path.isTemplateLiteral() ? path.get("expressions") : path.get("quasi.expressions");
      for (const elem of quasis) {
        if (!state.confident) break;
        str += raw ? elem.value.raw : elem.value.cooked;
        const expr = exprs[i++];
        if (expr) str += String(evaluateCached(expr, state));
      }
      if (!state.confident) return;
      return str;
    }
    function evaluate() {
      const state = {
        confident: true,
        deoptPath: null,
        seen: /* @__PURE__ */ new Map()
      };
      let value2 = evaluateCached(this, state);
      if (!state.confident) value2 = void 0;
      return {
        confident: state.confident,
        deopt: state.deoptPath,
        value: value2
      };
    }
  }
});

// node_modules/@babel/traverse/lib/path/conversion.js
var require_conversion = __commonJS({
  "node_modules/@babel/traverse/lib/path/conversion.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.arrowFunctionToExpression = arrowFunctionToExpression;
    exports2.ensureBlock = ensureBlock;
    exports2.ensureFunctionName = ensureFunctionName;
    exports2.splitExportDeclaration = splitExportDeclaration;
    exports2.toComputedKey = toComputedKey;
    exports2.unwrapFunctionEnvironment = unwrapFunctionEnvironment;
    var _t = require_lib3();
    var _template = require_lib6();
    var _visitors = require_visitors();
    var _context = require_context2();
    var {
      arrowFunctionExpression,
      assignmentExpression,
      binaryExpression,
      blockStatement,
      callExpression,
      conditionalExpression,
      expressionStatement,
      identifier,
      isIdentifier,
      jsxIdentifier,
      logicalExpression,
      LOGICAL_OPERATORS,
      memberExpression,
      metaProperty,
      numericLiteral,
      objectExpression,
      restElement,
      returnStatement,
      sequenceExpression,
      spreadElement,
      stringLiteral,
      super: _super,
      thisExpression,
      toExpression,
      unaryExpression,
      toBindingIdentifierName,
      isFunction,
      isAssignmentPattern,
      isRestElement,
      getFunctionName,
      cloneNode,
      variableDeclaration,
      variableDeclarator,
      exportNamedDeclaration,
      exportSpecifier,
      inherits
    } = _t;
    function toComputedKey() {
      let key;
      if (this.isMemberExpression()) {
        key = this.node.property;
      } else if (this.isProperty() || this.isMethod()) {
        key = this.node.key;
      } else {
        throw new ReferenceError("todo");
      }
      if (!this.node.computed) {
        if (isIdentifier(key)) key = stringLiteral(key.name);
      }
      return key;
    }
    function ensureBlock() {
      const body = this.get("body");
      const bodyNode = body.node;
      if (Array.isArray(body)) {
        throw new Error("Can't convert array path to a block statement");
      }
      if (!bodyNode) {
        throw new Error("Can't convert node without a body");
      }
      if (body.isBlockStatement()) {
        return bodyNode;
      }
      const statements = [];
      let stringPath = "body";
      let key;
      let listKey;
      if (body.isStatement()) {
        listKey = "body";
        key = 0;
        statements.push(body.node);
      } else {
        stringPath += ".body.0";
        if (this.isFunction()) {
          key = "argument";
          statements.push(returnStatement(body.node));
        } else {
          key = "expression";
          statements.push(expressionStatement(body.node));
        }
      }
      this.node.body = blockStatement(statements);
      const parentPath = this.get(stringPath);
      _context.setup.call(body, parentPath, listKey ? parentPath.node[listKey] : parentPath.node, listKey, key);
      return this.node;
    }
    exports2.arrowFunctionToShadowed = function() {
      if (!this.isArrowFunctionExpression()) return;
      this.arrowFunctionToExpression();
    };
    function unwrapFunctionEnvironment() {
      if (!this.isArrowFunctionExpression() && !this.isFunctionExpression() && !this.isFunctionDeclaration()) {
        throw this.buildCodeFrameError("Can only unwrap the environment of a function.");
      }
      hoistFunctionEnvironment(this);
    }
    function setType(path, type) {
      path.node.type = type;
    }
    function arrowFunctionToExpression({
      allowInsertArrow = true,
      allowInsertArrowWithRest = allowInsertArrow,
      noNewArrows = !((_arguments$) => (_arguments$ = arguments[0]) == null ? void 0 : _arguments$.specCompliant)()
    } = {}) {
      if (!this.isArrowFunctionExpression()) {
        throw this.buildCodeFrameError("Cannot convert non-arrow function to a function expression.");
      }
      let self2 = this;
      if (!noNewArrows) {
        var _self$ensureFunctionN;
        self2 = (_self$ensureFunctionN = self2.ensureFunctionName(false)) != null ? _self$ensureFunctionN : self2;
      }
      const {
        thisBinding,
        fnPath: fn
      } = hoistFunctionEnvironment(self2, noNewArrows, allowInsertArrow, allowInsertArrowWithRest);
      fn.ensureBlock();
      setType(fn, "FunctionExpression");
      if (!noNewArrows) {
        const checkBinding = thisBinding ? null : fn.scope.generateUidIdentifier("arrowCheckId");
        if (checkBinding) {
          fn.parentPath.scope.push({
            id: checkBinding,
            init: objectExpression([])
          });
        }
        fn.get("body").unshiftContainer("body", expressionStatement(callExpression(this.hub.addHelper("newArrowCheck"), [thisExpression(), checkBinding ? identifier(checkBinding.name) : identifier(thisBinding)])));
        fn.replaceWith(callExpression(memberExpression(fn.node, identifier("bind")), [checkBinding ? identifier(checkBinding.name) : thisExpression()]));
        return fn.get("callee.object");
      }
      return fn;
    }
    var getSuperCallsVisitor = (0, _visitors.environmentVisitor)({
      CallExpression(child, {
        allSuperCalls
      }) {
        if (!child.get("callee").isSuper()) return;
        allSuperCalls.push(child);
      }
    });
    function hoistFunctionEnvironment(fnPath, noNewArrows = true, allowInsertArrow = true, allowInsertArrowWithRest = true) {
      let arrowParent;
      let thisEnvFn = fnPath.findParent((p) => {
        if (p.isArrowFunctionExpression()) {
          arrowParent != null ? arrowParent : arrowParent = p;
          return false;
        }
        return p.isFunction() || p.isProgram() || p.isClassProperty({
          static: false
        }) || p.isClassPrivateProperty({
          static: false
        });
      });
      const inConstructor = thisEnvFn.isClassMethod({
        kind: "constructor"
      });
      if (thisEnvFn.isClassProperty() || thisEnvFn.isClassPrivateProperty()) {
        if (arrowParent) {
          thisEnvFn = arrowParent;
        } else if (allowInsertArrow) {
          fnPath.replaceWith(callExpression(arrowFunctionExpression([], toExpression(fnPath.node)), []));
          thisEnvFn = fnPath.get("callee");
          fnPath = thisEnvFn.get("body");
        } else {
          throw fnPath.buildCodeFrameError("Unable to transform arrow inside class property");
        }
      }
      const {
        thisPaths,
        argumentsPaths,
        newTargetPaths,
        superProps,
        superCalls
      } = getScopeInformation(fnPath);
      if (inConstructor && superCalls.length > 0) {
        if (!allowInsertArrow) {
          throw superCalls[0].buildCodeFrameError("When using '@babel/plugin-transform-arrow-functions', it's not possible to compile `super()` in an arrow function without compiling classes.\nPlease add '@babel/plugin-transform-classes' to your Babel configuration.");
        }
        if (!allowInsertArrowWithRest) {
          throw superCalls[0].buildCodeFrameError("When using '@babel/plugin-transform-parameters', it's not possible to compile `super()` in an arrow function with default or rest parameters without compiling classes.\nPlease add '@babel/plugin-transform-classes' to your Babel configuration.");
        }
        const allSuperCalls = [];
        thisEnvFn.traverse(getSuperCallsVisitor, {
          allSuperCalls
        });
        const superBinding = getSuperBinding(thisEnvFn);
        allSuperCalls.forEach((superCall) => {
          const callee = identifier(superBinding);
          callee.loc = superCall.node.callee.loc;
          superCall.get("callee").replaceWith(callee);
        });
      }
      if (argumentsPaths.length > 0) {
        const argumentsBinding = getBinding(thisEnvFn, "arguments", () => {
          const args = () => identifier("arguments");
          if (thisEnvFn.scope.path.isProgram()) {
            return conditionalExpression(binaryExpression("===", unaryExpression("typeof", args()), stringLiteral("undefined")), thisEnvFn.scope.buildUndefinedNode(), args());
          } else {
            return args();
          }
        });
        argumentsPaths.forEach((argumentsChild) => {
          const argsRef = identifier(argumentsBinding);
          argsRef.loc = argumentsChild.node.loc;
          argumentsChild.replaceWith(argsRef);
        });
      }
      if (newTargetPaths.length > 0) {
        const newTargetBinding = getBinding(thisEnvFn, "newtarget", () => metaProperty(identifier("new"), identifier("target")));
        newTargetPaths.forEach((targetChild) => {
          const targetRef = identifier(newTargetBinding);
          targetRef.loc = targetChild.node.loc;
          targetChild.replaceWith(targetRef);
        });
      }
      if (superProps.length > 0) {
        if (!allowInsertArrow) {
          throw superProps[0].buildCodeFrameError("When using '@babel/plugin-transform-arrow-functions', it's not possible to compile `super.prop` in an arrow function without compiling classes.\nPlease add '@babel/plugin-transform-classes' to your Babel configuration.");
        }
        const flatSuperProps = superProps.reduce((acc, superProp) => acc.concat(standardizeSuperProperty(superProp)), []);
        flatSuperProps.forEach((superProp) => {
          const key = superProp.node.computed ? "" : superProp.get("property").node.name;
          const superParentPath = superProp.parentPath;
          const isAssignment = superParentPath.isAssignmentExpression({
            left: superProp.node
          });
          const isCall = superParentPath.isCallExpression({
            callee: superProp.node
          });
          const isTaggedTemplate = superParentPath.isTaggedTemplateExpression({
            tag: superProp.node
          });
          const superBinding = getSuperPropBinding(thisEnvFn, isAssignment, key);
          const args = [];
          if (superProp.node.computed) {
            args.push(superProp.get("property").node);
          }
          if (isAssignment) {
            const value2 = superParentPath.node.right;
            args.push(value2);
          }
          const call = callExpression(identifier(superBinding), args);
          if (isCall) {
            superParentPath.unshiftContainer("arguments", thisExpression());
            superProp.replaceWith(memberExpression(call, identifier("call")));
            thisPaths.push(superParentPath.get("arguments.0"));
          } else if (isAssignment) {
            superParentPath.replaceWith(call);
          } else if (isTaggedTemplate) {
            superProp.replaceWith(callExpression(memberExpression(call, identifier("bind"), false), [thisExpression()]));
            thisPaths.push(superProp.get("arguments.0"));
          } else {
            superProp.replaceWith(call);
          }
        });
      }
      let thisBinding;
      if (thisPaths.length > 0 || !noNewArrows) {
        thisBinding = getThisBinding(thisEnvFn, inConstructor);
        if (noNewArrows || inConstructor && hasSuperClass(thisEnvFn)) {
          thisPaths.forEach((thisChild) => {
            const thisRef = thisChild.isJSX() ? jsxIdentifier(thisBinding) : identifier(thisBinding);
            thisRef.loc = thisChild.node.loc;
            thisChild.replaceWith(thisRef);
          });
          if (!noNewArrows) thisBinding = null;
        }
      }
      return {
        thisBinding,
        fnPath
      };
    }
    function isLogicalOp(op) {
      return LOGICAL_OPERATORS.includes(op);
    }
    function standardizeSuperProperty(superProp) {
      if (superProp.parentPath.isAssignmentExpression() && superProp.parentPath.node.operator !== "=") {
        const assignmentPath = superProp.parentPath;
        const op = assignmentPath.node.operator.slice(0, -1);
        const value2 = assignmentPath.node.right;
        const isLogicalAssignment = isLogicalOp(op);
        if (superProp.node.computed) {
          const tmp = superProp.scope.generateDeclaredUidIdentifier("tmp");
          const {
            object,
            property
          } = superProp.node;
          assignmentPath.get("left").replaceWith(memberExpression(object, assignmentExpression("=", tmp, property), true));
          assignmentPath.get("right").replaceWith(rightExpression(isLogicalAssignment ? "=" : op, memberExpression(object, identifier(tmp.name), true), value2));
        } else {
          const object = superProp.node.object;
          const property = superProp.node.property;
          assignmentPath.get("left").replaceWith(memberExpression(object, property));
          assignmentPath.get("right").replaceWith(rightExpression(isLogicalAssignment ? "=" : op, memberExpression(object, identifier(property.name)), value2));
        }
        if (isLogicalAssignment) {
          assignmentPath.replaceWith(logicalExpression(op, assignmentPath.node.left, assignmentPath.node.right));
        } else {
          assignmentPath.node.operator = "=";
        }
        return [assignmentPath.get("left"), assignmentPath.get("right").get("left")];
      } else if (superProp.parentPath.isUpdateExpression()) {
        const updateExpr = superProp.parentPath;
        const tmp = superProp.scope.generateDeclaredUidIdentifier("tmp");
        const computedKey = superProp.node.computed ? superProp.scope.generateDeclaredUidIdentifier("prop") : null;
        const parts = [assignmentExpression("=", tmp, memberExpression(superProp.node.object, computedKey ? assignmentExpression("=", computedKey, superProp.node.property) : superProp.node.property, superProp.node.computed)), assignmentExpression("=", memberExpression(superProp.node.object, computedKey ? identifier(computedKey.name) : superProp.node.property, superProp.node.computed), binaryExpression(superProp.parentPath.node.operator[0], identifier(tmp.name), numericLiteral(1)))];
        if (!superProp.parentPath.node.prefix) {
          parts.push(identifier(tmp.name));
        }
        updateExpr.replaceWith(sequenceExpression(parts));
        const left = updateExpr.get("expressions.0.right");
        const right = updateExpr.get("expressions.1.left");
        return [left, right];
      }
      return [superProp];
      function rightExpression(op, left, right) {
        if (op === "=") {
          return assignmentExpression("=", left, right);
        } else {
          return binaryExpression(op, left, right);
        }
      }
    }
    function hasSuperClass(thisEnvFn) {
      return thisEnvFn.isClassMethod() && !!thisEnvFn.parentPath.parentPath.node.superClass;
    }
    var assignSuperThisVisitor = (0, _visitors.environmentVisitor)({
      CallExpression(child, {
        supers,
        thisBinding
      }) {
        if (!child.get("callee").isSuper()) return;
        if (supers.has(child.node)) return;
        supers.add(child.node);
        child.replaceWithMultiple([child.node, assignmentExpression("=", identifier(thisBinding), identifier("this"))]);
      }
    });
    function getThisBinding(thisEnvFn, inConstructor) {
      return getBinding(thisEnvFn, "this", (thisBinding) => {
        if (!inConstructor || !hasSuperClass(thisEnvFn)) return thisExpression();
        thisEnvFn.traverse(assignSuperThisVisitor, {
          supers: /* @__PURE__ */ new WeakSet(),
          thisBinding
        });
      });
    }
    function getSuperBinding(thisEnvFn) {
      return getBinding(thisEnvFn, "supercall", () => {
        const argsBinding = thisEnvFn.scope.generateUidIdentifier("args");
        return arrowFunctionExpression([restElement(argsBinding)], callExpression(_super(), [spreadElement(identifier(argsBinding.name))]));
      });
    }
    function getSuperPropBinding(thisEnvFn, isAssignment, propName) {
      const op = isAssignment ? "set" : "get";
      return getBinding(thisEnvFn, `superprop_${op}:${propName || ""}`, () => {
        const argsList = [];
        let fnBody;
        if (propName) {
          fnBody = memberExpression(_super(), identifier(propName));
        } else {
          const method = thisEnvFn.scope.generateUidIdentifier("prop");
          argsList.unshift(method);
          fnBody = memberExpression(_super(), identifier(method.name), true);
        }
        if (isAssignment) {
          const valueIdent = thisEnvFn.scope.generateUidIdentifier("value");
          argsList.push(valueIdent);
          fnBody = assignmentExpression("=", fnBody, identifier(valueIdent.name));
        }
        return arrowFunctionExpression(argsList, fnBody);
      });
    }
    function getBinding(thisEnvFn, key, init) {
      const cacheKey = "binding:" + key;
      let data = thisEnvFn.getData(cacheKey);
      if (!data) {
        const id = thisEnvFn.scope.generateUidIdentifier(key);
        data = id.name;
        thisEnvFn.setData(cacheKey, data);
        thisEnvFn.scope.push({
          id,
          init: init(data)
        });
      }
      return data;
    }
    var getScopeInformationVisitor = (0, _visitors.environmentVisitor)({
      ThisExpression(child, {
        thisPaths
      }) {
        thisPaths.push(child);
      },
      JSXIdentifier(child, {
        thisPaths
      }) {
        if (child.node.name !== "this") return;
        if (!child.parentPath.isJSXMemberExpression({
          object: child.node
        }) && !child.parentPath.isJSXOpeningElement({
          name: child.node
        })) {
          return;
        }
        thisPaths.push(child);
      },
      CallExpression(child, {
        superCalls
      }) {
        if (child.get("callee").isSuper()) superCalls.push(child);
      },
      MemberExpression(child, {
        superProps
      }) {
        if (child.get("object").isSuper()) superProps.push(child);
      },
      Identifier(child, {
        argumentsPaths
      }) {
        if (!child.isReferencedIdentifier({
          name: "arguments"
        })) return;
        let curr = child.scope;
        do {
          if (curr.hasOwnBinding("arguments")) {
            curr.rename("arguments");
            return;
          }
          if (curr.path.isFunction() && !curr.path.isArrowFunctionExpression()) {
            break;
          }
        } while (curr = curr.parent);
        argumentsPaths.push(child);
      },
      MetaProperty(child, {
        newTargetPaths
      }) {
        if (!child.get("meta").isIdentifier({
          name: "new"
        })) return;
        if (!child.get("property").isIdentifier({
          name: "target"
        })) return;
        newTargetPaths.push(child);
      }
    });
    function getScopeInformation(fnPath) {
      const thisPaths = [];
      const argumentsPaths = [];
      const newTargetPaths = [];
      const superProps = [];
      const superCalls = [];
      fnPath.traverse(getScopeInformationVisitor, {
        thisPaths,
        argumentsPaths,
        newTargetPaths,
        superProps,
        superCalls
      });
      return {
        thisPaths,
        argumentsPaths,
        newTargetPaths,
        superProps,
        superCalls
      };
    }
    function splitExportDeclaration() {
      if (!this.isExportDeclaration() || this.isExportAllDeclaration()) {
        throw new Error("Only default and named export declarations can be split.");
      }
      if (this.isExportNamedDeclaration() && this.get("specifiers").length > 0) {
        throw new Error("It doesn't make sense to split exported specifiers.");
      }
      const declaration = this.get("declaration");
      if (this.isExportDefaultDeclaration()) {
        const standaloneDeclaration = declaration.isFunctionDeclaration() || declaration.isClassDeclaration();
        const exportExpr = declaration.isFunctionExpression() || declaration.isClassExpression();
        const scope = declaration.isScope() ? declaration.scope.parent : declaration.scope;
        let id = declaration.node.id;
        let needBindingRegistration = false;
        if (!id) {
          needBindingRegistration = true;
          id = scope.generateUidIdentifier("default");
          if (standaloneDeclaration || exportExpr) {
            declaration.node.id = cloneNode(id);
          }
        } else if (exportExpr && scope.hasBinding(id.name)) {
          needBindingRegistration = true;
          id = scope.generateUidIdentifier(id.name);
        }
        const updatedDeclaration = standaloneDeclaration ? declaration.node : variableDeclaration("var", [variableDeclarator(cloneNode(id), declaration.node)]);
        const updatedExportDeclaration = exportNamedDeclaration(null, [exportSpecifier(cloneNode(id), identifier("default"))]);
        this.insertAfter(updatedExportDeclaration);
        this.replaceWith(updatedDeclaration);
        if (needBindingRegistration) {
          scope.registerDeclaration(this);
        }
        return this;
      } else if (this.get("specifiers").length > 0) {
        throw new Error("It doesn't make sense to split exported specifiers.");
      }
      const bindingIdentifiers = declaration.getOuterBindingIdentifiers();
      const specifiers = Object.keys(bindingIdentifiers).map((name) => {
        return exportSpecifier(identifier(name), identifier(name));
      });
      const aliasDeclar = exportNamedDeclaration(null, specifiers);
      this.insertAfter(aliasDeclar);
      this.replaceWith(declaration.node);
      return this;
    }
    var refersOuterBindingVisitor = {
      "ReferencedIdentifier|BindingIdentifier"(path, state) {
        if (path.node.name !== state.name) return;
        state.needsRename = true;
        path.stop();
      },
      Scope(path, state) {
        if (path.scope.hasOwnBinding(state.name)) {
          path.skip();
        }
      }
    };
    function ensureFunctionName(supportUnicodeId) {
      if (this.node.id) return this;
      const res = getFunctionName(this.node, this.parent);
      if (res == null) return this;
      let {
        name
      } = res;
      if (!supportUnicodeId && /[\uD800-\uDFFF]/.test(name)) {
        return null;
      }
      if (name.startsWith("get ") || name.startsWith("set ")) {
        return null;
      }
      name = toBindingIdentifierName(name.replace(/[/ ]/g, "_"));
      const id = identifier(name);
      inherits(id, res.originalNode);
      const state = {
        needsRename: false,
        name
      };
      const {
        scope
      } = this;
      const binding = scope.getOwnBinding(name);
      if (binding) {
        if (binding.kind === "param") {
          state.needsRename = true;
        } else {
        }
      } else if (scope.parent.hasBinding(name) || scope.hasGlobal(name)) {
        this.traverse(refersOuterBindingVisitor, state);
      }
      if (!state.needsRename) {
        this.node.id = id;
        scope.getProgramParent().references[id.name] = true;
        return this;
      }
      if (scope.hasBinding(id.name) && !scope.hasGlobal(id.name)) {
        scope.rename(id.name);
        this.node.id = id;
        scope.getProgramParent().references[id.name] = true;
        return this;
      }
      if (!isFunction(this.node)) return null;
      const key = scope.generateUidIdentifier(id.name);
      const params = [];
      for (let i = 0, len = getFunctionArity(this.node); i < len; i++) {
        params.push(scope.generateUidIdentifier("x"));
      }
      const call = _template.default.expression.ast`
    (function (${key}) {
      function ${id}(${params}) {
        return ${cloneNode(key)}.apply(this, arguments);
      }

      ${cloneNode(id)}.toString = function () {
        return ${cloneNode(key)}.toString();
      }

      return ${cloneNode(id)};
    })(${toExpression(this.node)})
  `;
      return this.replaceWith(call)[0].get("arguments.0");
    }
    function getFunctionArity(node) {
      const count = node.params.findIndex((param) => isAssignmentPattern(param) || isRestElement(param));
      return count === -1 ? node.params.length : count;
    }
  }
});

// node_modules/@babel/traverse/lib/path/introspection.js
var require_introspection = __commonJS({
  "node_modules/@babel/traverse/lib/path/introspection.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2._guessExecutionStatusRelativeTo = _guessExecutionStatusRelativeTo;
    exports2._resolve = _resolve;
    exports2.canHaveVariableDeclarationOrExpression = canHaveVariableDeclarationOrExpression;
    exports2.canSwapBetweenExpressionAndStatement = canSwapBetweenExpressionAndStatement;
    exports2.getSource = getSource;
    exports2.isCompletionRecord = isCompletionRecord;
    exports2.isConstantExpression = isConstantExpression;
    exports2.isInStrictMode = isInStrictMode;
    exports2.isNodeType = isNodeType;
    exports2.isStatementOrBlock = isStatementOrBlock;
    exports2.isStatic = isStatic;
    exports2.matchesPattern = matchesPattern;
    exports2.referencesImport = referencesImport;
    exports2.resolve = resolve;
    exports2.willIMaybeExecuteBefore = willIMaybeExecuteBefore;
    var _t = require_lib3();
    var {
      STATEMENT_OR_BLOCK_KEYS,
      VISITOR_KEYS,
      isBlockStatement,
      isExpression,
      isIdentifier,
      isLiteral,
      isStringLiteral,
      isType,
      matchesPattern: _matchesPattern
    } = _t;
    function matchesPattern(pattern, allowPartial) {
      return _matchesPattern(this.node, pattern, allowPartial);
    }
    exports2.has = function has(key) {
      var _this$node;
      const val = (_this$node = this.node) == null ? void 0 : _this$node[key];
      if (val && Array.isArray(val)) {
        return !!val.length;
      } else {
        return !!val;
      }
    };
    function isStatic() {
      return this.scope.isStatic(this.node);
    }
    exports2.is = exports2.has;
    exports2.isnt = function isnt(key) {
      return !this.has(key);
    };
    exports2.equals = function equals(key, value2) {
      return this.node[key] === value2;
    };
    function isNodeType(type) {
      return isType(this.type, type);
    }
    function canHaveVariableDeclarationOrExpression() {
      return (this.key === "init" || this.key === "left") && this.parentPath.isFor();
    }
    function canSwapBetweenExpressionAndStatement(replacement) {
      if (this.key !== "body" || !this.parentPath.isArrowFunctionExpression()) {
        return false;
      }
      if (this.isExpression()) {
        return isBlockStatement(replacement);
      } else if (this.isBlockStatement()) {
        return isExpression(replacement);
      }
      return false;
    }
    function isCompletionRecord(allowInsideFunction) {
      let path = this;
      let first = true;
      do {
        const {
          type,
          container
        } = path;
        if (!first && (path.isFunction() || type === "StaticBlock")) {
          return !!allowInsideFunction;
        }
        first = false;
        if (Array.isArray(container) && path.key !== container.length - 1) {
          return false;
        }
      } while ((path = path.parentPath) && !path.isProgram() && !path.isDoExpression());
      return true;
    }
    function isStatementOrBlock() {
      if (this.parentPath.isLabeledStatement() || isBlockStatement(this.container)) {
        return false;
      } else {
        return STATEMENT_OR_BLOCK_KEYS.includes(this.key);
      }
    }
    function referencesImport(moduleSource, importName) {
      if (!this.isReferencedIdentifier()) {
        if (this.isJSXMemberExpression() && this.node.property.name === importName || (this.isMemberExpression() || this.isOptionalMemberExpression()) && (this.node.computed ? isStringLiteral(this.node.property, {
          value: importName
        }) : this.node.property.name === importName)) {
          const object = this.get("object");
          return object.isReferencedIdentifier() && object.referencesImport(moduleSource, "*");
        }
        return false;
      }
      const binding = this.scope.getBinding(this.node.name);
      if ((binding == null ? void 0 : binding.kind) !== "module") return false;
      const path = binding.path;
      const parent = path.parentPath;
      if (!parent.isImportDeclaration()) return false;
      if (parent.node.source.value === moduleSource) {
        if (!importName) return true;
      } else {
        return false;
      }
      if (path.isImportDefaultSpecifier() && importName === "default") {
        return true;
      }
      if (path.isImportNamespaceSpecifier() && importName === "*") {
        return true;
      }
      if (path.isImportSpecifier() && isIdentifier(path.node.imported, {
        name: importName
      })) {
        return true;
      }
      return false;
    }
    function getSource() {
      const node = this.node;
      if (node.end) {
        const code = this.hub.getCode();
        if (code) return code.slice(node.start, node.end);
      }
      return "";
    }
    function willIMaybeExecuteBefore(target) {
      return this._guessExecutionStatusRelativeTo(target) !== "after";
    }
    function getOuterFunction(path) {
      return path.isProgram() ? path : (path.parentPath.scope.getFunctionParent() || path.parentPath.scope.getProgramParent()).path;
    }
    function isExecutionUncertain(type, key) {
      switch (type) {
        case "LogicalExpression":
          return key === "right";
        case "ConditionalExpression":
        case "IfStatement":
          return key === "consequent" || key === "alternate";
        case "WhileStatement":
        case "DoWhileStatement":
        case "ForInStatement":
        case "ForOfStatement":
          return key === "body";
        case "ForStatement":
          return key === "body" || key === "update";
        case "SwitchStatement":
          return key === "cases";
        case "TryStatement":
          return key === "handler";
        case "AssignmentPattern":
          return key === "right";
        case "OptionalMemberExpression":
          return key === "property";
        case "OptionalCallExpression":
          return key === "arguments";
        default:
          return false;
      }
    }
    function isExecutionUncertainInList(paths, maxIndex) {
      for (let i = 0; i < maxIndex; i++) {
        const path = paths[i];
        if (isExecutionUncertain(path.parent.type, path.parentKey)) {
          return true;
        }
      }
      return false;
    }
    var SYMBOL_CHECKING = Symbol();
    function _guessExecutionStatusRelativeTo(target) {
      return _guessExecutionStatusRelativeToCached(this, target, /* @__PURE__ */ new Map());
    }
    function _guessExecutionStatusRelativeToCached(base, target, cache) {
      const funcParent = {
        this: getOuterFunction(base),
        target: getOuterFunction(target)
      };
      if (funcParent.target.node !== funcParent.this.node) {
        return _guessExecutionStatusRelativeToDifferentFunctionsCached(base, funcParent.target, cache);
      }
      const paths = {
        target: target.getAncestry(),
        this: base.getAncestry()
      };
      if (paths.target.includes(base)) return "after";
      if (paths.this.includes(target)) return "before";
      let commonPath;
      const commonIndex = {
        target: 0,
        this: 0
      };
      while (!commonPath && commonIndex.this < paths.this.length) {
        const path = paths.this[commonIndex.this];
        commonIndex.target = paths.target.indexOf(path);
        if (commonIndex.target >= 0) {
          commonPath = path;
        } else {
          commonIndex.this++;
        }
      }
      if (!commonPath) {
        throw new Error("Internal Babel error - The two compared nodes don't appear to belong to the same program.");
      }
      if (isExecutionUncertainInList(paths.this, commonIndex.this - 1) || isExecutionUncertainInList(paths.target, commonIndex.target - 1)) {
        return "unknown";
      }
      const divergence = {
        this: paths.this[commonIndex.this - 1],
        target: paths.target[commonIndex.target - 1]
      };
      if (divergence.target.listKey && divergence.this.listKey && divergence.target.container === divergence.this.container) {
        return divergence.target.key > divergence.this.key ? "before" : "after";
      }
      const keys = VISITOR_KEYS[commonPath.type];
      const keyPosition = {
        this: keys.indexOf(divergence.this.parentKey),
        target: keys.indexOf(divergence.target.parentKey)
      };
      return keyPosition.target > keyPosition.this ? "before" : "after";
    }
    function _guessExecutionStatusRelativeToDifferentFunctionsInternal(base, target, cache) {
      if (!target.isFunctionDeclaration()) {
        if (_guessExecutionStatusRelativeToCached(base, target, cache) === "before") {
          return "before";
        }
        return "unknown";
      } else if (target.parentPath.isExportDeclaration()) {
        return "unknown";
      }
      const binding = target.scope.getBinding(target.node.id.name);
      if (!binding.references) return "before";
      const referencePaths = binding.referencePaths;
      let allStatus;
      for (const path of referencePaths) {
        const childOfFunction = !!path.find((path2) => path2.node === target.node);
        if (childOfFunction) continue;
        if (path.key !== "callee" || !path.parentPath.isCallExpression()) {
          return "unknown";
        }
        const status = _guessExecutionStatusRelativeToCached(base, path, cache);
        if (allStatus && allStatus !== status) {
          return "unknown";
        } else {
          allStatus = status;
        }
      }
      return allStatus;
    }
    function _guessExecutionStatusRelativeToDifferentFunctionsCached(base, target, cache) {
      let nodeMap = cache.get(base.node);
      let cached;
      if (!nodeMap) {
        cache.set(base.node, nodeMap = /* @__PURE__ */ new Map());
      } else if (cached = nodeMap.get(target.node)) {
        if (cached === SYMBOL_CHECKING) {
          return "unknown";
        }
        return cached;
      }
      nodeMap.set(target.node, SYMBOL_CHECKING);
      const result = _guessExecutionStatusRelativeToDifferentFunctionsInternal(base, target, cache);
      nodeMap.set(target.node, result);
      return result;
    }
    function resolve(dangerous, resolved) {
      return _resolve.call(this, dangerous, resolved) || this;
    }
    function _resolve(dangerous, resolved) {
      var _resolved;
      if ((_resolved = resolved) != null && _resolved.includes(this)) return;
      resolved = resolved || [];
      resolved.push(this);
      if (this.isVariableDeclarator()) {
        if (this.get("id").isIdentifier()) {
          return this.get("init").resolve(dangerous, resolved);
        } else {
        }
      } else if (this.isReferencedIdentifier()) {
        const binding = this.scope.getBinding(this.node.name);
        if (!binding) return;
        if (!binding.constant) return;
        if (binding.kind === "module") return;
        if (binding.path !== this) {
          const ret = binding.path.resolve(dangerous, resolved);
          if (this.find((parent) => parent.node === ret.node)) return;
          return ret;
        }
      } else if (this.isTypeCastExpression()) {
        return this.get("expression").resolve(dangerous, resolved);
      } else if (dangerous && this.isMemberExpression()) {
        const targetKey = this.toComputedKey();
        if (!isLiteral(targetKey)) return;
        const targetName = targetKey.value;
        const target = this.get("object").resolve(dangerous, resolved);
        if (target.isObjectExpression()) {
          const props = target.get("properties");
          for (const prop of props) {
            if (!prop.isProperty()) continue;
            const key = prop.get("key");
            let match = prop.isnt("computed") && key.isIdentifier({
              name: targetName
            });
            match = match || key.isLiteral({
              value: targetName
            });
            if (match) return prop.get("value").resolve(dangerous, resolved);
          }
        } else if (target.isArrayExpression() && !isNaN(+targetName)) {
          const elems = target.get("elements");
          const elem = elems[targetName];
          if (elem) return elem.resolve(dangerous, resolved);
        }
      }
    }
    function isConstantExpression() {
      if (this.isIdentifier()) {
        const binding = this.scope.getBinding(this.node.name);
        if (!binding) return false;
        return binding.constant;
      }
      if (this.isLiteral()) {
        if (this.isRegExpLiteral()) {
          return false;
        }
        if (this.isTemplateLiteral()) {
          return this.get("expressions").every((expression) => expression.isConstantExpression());
        }
        return true;
      }
      if (this.isUnaryExpression()) {
        if (this.node.operator !== "void") {
          return false;
        }
        return this.get("argument").isConstantExpression();
      }
      if (this.isBinaryExpression()) {
        const {
          operator
        } = this.node;
        return operator !== "in" && operator !== "instanceof" && this.get("left").isConstantExpression() && this.get("right").isConstantExpression();
      }
      if (this.isMemberExpression()) {
        return !this.node.computed && this.get("object").isIdentifier({
          name: "Symbol"
        }) && !this.scope.hasBinding("Symbol", {
          noGlobals: true
        });
      }
      if (this.isCallExpression()) {
        return this.node.arguments.length === 1 && this.get("callee").matchesPattern("Symbol.for") && !this.scope.hasBinding("Symbol", {
          noGlobals: true
        }) && this.get("arguments")[0].isStringLiteral();
      }
      return false;
    }
    function isInStrictMode() {
      const start = this.isProgram() ? this : this.parentPath;
      const strictParent = start.find((path) => {
        if (path.isProgram({
          sourceType: "module"
        })) return true;
        if (path.isClass()) return true;
        if (path.isArrowFunctionExpression() && !path.get("body").isBlockStatement()) {
          return false;
        }
        let body;
        if (path.isFunction()) {
          body = path.node.body;
        } else if (path.isProgram()) {
          body = path.node;
        } else {
          return false;
        }
        for (const directive of body.directives) {
          if (directive.value.value === "use strict") {
            return true;
          }
        }
        return false;
      });
      return !!strictParent;
    }
  }
});

// node_modules/@babel/traverse/lib/path/family.js
var require_family = __commonJS({
  "node_modules/@babel/traverse/lib/path/family.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2._getKey = _getKey;
    exports2._getPattern = _getPattern;
    exports2.get = get;
    exports2.getAllNextSiblings = getAllNextSiblings;
    exports2.getAllPrevSiblings = getAllPrevSiblings;
    exports2.getAssignmentIdentifiers = getAssignmentIdentifiers;
    exports2.getBindingIdentifierPaths = getBindingIdentifierPaths;
    exports2.getBindingIdentifiers = getBindingIdentifiers;
    exports2.getCompletionRecords = getCompletionRecords;
    exports2.getNextSibling = getNextSibling;
    exports2.getOpposite = getOpposite;
    exports2.getOuterBindingIdentifierPaths = getOuterBindingIdentifierPaths;
    exports2.getOuterBindingIdentifiers = getOuterBindingIdentifiers;
    exports2.getPrevSibling = getPrevSibling;
    exports2.getSibling = getSibling;
    var _index = require_path();
    var _t = require_lib3();
    var {
      getAssignmentIdentifiers: _getAssignmentIdentifiers,
      getBindingIdentifiers: _getBindingIdentifiers,
      getOuterBindingIdentifiers: _getOuterBindingIdentifiers,
      numericLiteral,
      unaryExpression
    } = _t;
    var NORMAL_COMPLETION = 0;
    var BREAK_COMPLETION = 1;
    function NormalCompletion(path) {
      return {
        type: NORMAL_COMPLETION,
        path
      };
    }
    function BreakCompletion(path) {
      return {
        type: BREAK_COMPLETION,
        path
      };
    }
    function getOpposite() {
      if (this.key === "left") {
        return this.getSibling("right");
      } else if (this.key === "right") {
        return this.getSibling("left");
      }
      return null;
    }
    function addCompletionRecords(path, records, context) {
      if (path) {
        records.push(..._getCompletionRecords(path, context));
      }
      return records;
    }
    function completionRecordForSwitch(cases, records, context) {
      let lastNormalCompletions = [];
      for (let i = 0; i < cases.length; i++) {
        const casePath = cases[i];
        const caseCompletions = _getCompletionRecords(casePath, context);
        const normalCompletions = [];
        const breakCompletions = [];
        for (const c of caseCompletions) {
          if (c.type === NORMAL_COMPLETION) {
            normalCompletions.push(c);
          }
          if (c.type === BREAK_COMPLETION) {
            breakCompletions.push(c);
          }
        }
        if (normalCompletions.length) {
          lastNormalCompletions = normalCompletions;
        }
        records.push(...breakCompletions);
      }
      records.push(...lastNormalCompletions);
      return records;
    }
    function normalCompletionToBreak(completions) {
      completions.forEach((c) => {
        c.type = BREAK_COMPLETION;
      });
    }
    function replaceBreakStatementInBreakCompletion(completions, reachable) {
      completions.forEach((c) => {
        if (c.path.isBreakStatement({
          label: null
        })) {
          if (reachable) {
            c.path.replaceWith(unaryExpression("void", numericLiteral(0)));
          } else {
            c.path.remove();
          }
        }
      });
    }
    function getStatementListCompletion(paths, context) {
      const completions = [];
      if (context.canHaveBreak) {
        let lastNormalCompletions = [];
        for (let i = 0; i < paths.length; i++) {
          const path = paths[i];
          const newContext = Object.assign({}, context, {
            inCaseClause: false
          });
          if (path.isBlockStatement() && (context.inCaseClause || context.shouldPopulateBreak)) {
            newContext.shouldPopulateBreak = true;
          } else {
            newContext.shouldPopulateBreak = false;
          }
          const statementCompletions = _getCompletionRecords(path, newContext);
          if (statementCompletions.length > 0 && statementCompletions.every((c) => c.type === BREAK_COMPLETION)) {
            if (lastNormalCompletions.length > 0 && statementCompletions.every((c) => c.path.isBreakStatement({
              label: null
            }))) {
              normalCompletionToBreak(lastNormalCompletions);
              completions.push(...lastNormalCompletions);
              if (lastNormalCompletions.some((c) => c.path.isDeclaration())) {
                completions.push(...statementCompletions);
                if (!context.shouldPreserveBreak) {
                  replaceBreakStatementInBreakCompletion(statementCompletions, true);
                }
              }
              if (!context.shouldPreserveBreak) {
                replaceBreakStatementInBreakCompletion(statementCompletions, false);
              }
            } else {
              completions.push(...statementCompletions);
              if (!context.shouldPopulateBreak && !context.shouldPreserveBreak) {
                replaceBreakStatementInBreakCompletion(statementCompletions, true);
              }
            }
            break;
          }
          if (i === paths.length - 1) {
            completions.push(...statementCompletions);
          } else {
            lastNormalCompletions = [];
            for (let i2 = 0; i2 < statementCompletions.length; i2++) {
              const c = statementCompletions[i2];
              if (c.type === BREAK_COMPLETION) {
                completions.push(c);
              }
              if (c.type === NORMAL_COMPLETION) {
                lastNormalCompletions.push(c);
              }
            }
          }
        }
      } else if (paths.length) {
        for (let i = paths.length - 1; i >= 0; i--) {
          const pathCompletions = _getCompletionRecords(paths[i], context);
          if (pathCompletions.length > 1 || pathCompletions.length === 1 && !pathCompletions[0].path.isVariableDeclaration() && !pathCompletions[0].path.isEmptyStatement()) {
            completions.push(...pathCompletions);
            break;
          }
        }
      }
      return completions;
    }
    function _getCompletionRecords(path, context) {
      let records = [];
      if (path.isIfStatement()) {
        records = addCompletionRecords(path.get("consequent"), records, context);
        records = addCompletionRecords(path.get("alternate"), records, context);
      } else if (path.isDoExpression() || path.isFor() || path.isWhile() || path.isLabeledStatement()) {
        return addCompletionRecords(path.get("body"), records, context);
      } else if (path.isProgram() || path.isBlockStatement()) {
        return getStatementListCompletion(path.get("body"), context);
      } else if (path.isFunction()) {
        return _getCompletionRecords(path.get("body"), context);
      } else if (path.isTryStatement()) {
        records = addCompletionRecords(path.get("block"), records, context);
        records = addCompletionRecords(path.get("handler"), records, context);
      } else if (path.isCatchClause()) {
        return addCompletionRecords(path.get("body"), records, context);
      } else if (path.isSwitchStatement()) {
        return completionRecordForSwitch(path.get("cases"), records, context);
      } else if (path.isSwitchCase()) {
        return getStatementListCompletion(path.get("consequent"), {
          canHaveBreak: true,
          shouldPopulateBreak: false,
          inCaseClause: true,
          shouldPreserveBreak: context.shouldPreserveBreak
        });
      } else if (path.isBreakStatement()) {
        records.push(BreakCompletion(path));
      } else {
        records.push(NormalCompletion(path));
      }
      return records;
    }
    function getCompletionRecords(shouldPreserveBreak = false) {
      const records = _getCompletionRecords(this, {
        canHaveBreak: false,
        shouldPopulateBreak: false,
        inCaseClause: false,
        shouldPreserveBreak
      });
      return records.map((r) => r.path);
    }
    function getSibling(key) {
      return _index.default.get({
        parentPath: this.parentPath,
        parent: this.parent,
        container: this.container,
        listKey: this.listKey,
        key
      }).setContext(this.context);
    }
    function getPrevSibling() {
      return this.getSibling(this.key - 1);
    }
    function getNextSibling() {
      return this.getSibling(this.key + 1);
    }
    function getAllNextSiblings() {
      let _key = this.key;
      let sibling = this.getSibling(++_key);
      const siblings = [];
      while (sibling.node) {
        siblings.push(sibling);
        sibling = this.getSibling(++_key);
      }
      return siblings;
    }
    function getAllPrevSiblings() {
      let _key = this.key;
      let sibling = this.getSibling(--_key);
      const siblings = [];
      while (sibling.node) {
        siblings.push(sibling);
        sibling = this.getSibling(--_key);
      }
      return siblings;
    }
    function get(key, context = true) {
      if (context === true) context = this.context;
      const parts = key.split(".");
      if (parts.length === 1) {
        return _getKey.call(this, key, context);
      } else {
        return _getPattern.call(this, parts, context);
      }
    }
    function _getKey(key, context) {
      const node = this.node;
      const container = node[key];
      if (Array.isArray(container)) {
        return container.map((_, i) => {
          return _index.default.get({
            listKey: key,
            parentPath: this,
            parent: node,
            container,
            key: i
          }).setContext(context);
        });
      } else {
        return _index.default.get({
          parentPath: this,
          parent: node,
          container: node,
          key
        }).setContext(context);
      }
    }
    function _getPattern(parts, context) {
      let path = this;
      for (const part of parts) {
        if (part === ".") {
          path = path.parentPath;
        } else {
          if (Array.isArray(path)) {
            path = path[part];
          } else {
            path = path.get(part, context);
          }
        }
      }
      return path;
    }
    function getAssignmentIdentifiers() {
      return _getAssignmentIdentifiers(this.node);
    }
    function getBindingIdentifiers(duplicates) {
      return _getBindingIdentifiers(this.node, duplicates);
    }
    function getOuterBindingIdentifiers(duplicates) {
      return _getOuterBindingIdentifiers(this.node, duplicates);
    }
    function getBindingIdentifierPaths(duplicates = false, outerOnly = false) {
      const path = this;
      const search = [path];
      const ids = /* @__PURE__ */ Object.create(null);
      while (search.length) {
        const id = search.shift();
        if (!id) continue;
        if (!id.node) continue;
        const keys = _getBindingIdentifiers.keys[id.node.type];
        if (id.isIdentifier()) {
          if (duplicates) {
            const _ids = ids[id.node.name] = ids[id.node.name] || [];
            _ids.push(id);
          } else {
            ids[id.node.name] = id;
          }
          continue;
        }
        if (id.isExportDeclaration()) {
          const declaration = id.get("declaration");
          if (declaration.isDeclaration()) {
            search.push(declaration);
          }
          continue;
        }
        if (outerOnly) {
          if (id.isFunctionDeclaration()) {
            search.push(id.get("id"));
            continue;
          }
          if (id.isFunctionExpression()) {
            continue;
          }
        }
        if (keys) {
          for (let i = 0; i < keys.length; i++) {
            const key = keys[i];
            const child = id.get(key);
            if (Array.isArray(child)) {
              search.push(...child);
            } else if (child.node) {
              search.push(child);
            }
          }
        }
      }
      return ids;
    }
    function getOuterBindingIdentifierPaths(duplicates = false) {
      return this.getBindingIdentifierPaths(duplicates, true);
    }
  }
});

// node_modules/@babel/traverse/lib/path/comments.js
var require_comments = __commonJS({
  "node_modules/@babel/traverse/lib/path/comments.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.addComment = addComment;
    exports2.addComments = addComments;
    exports2.shareCommentsWithSiblings = shareCommentsWithSiblings;
    var _t = require_lib3();
    var {
      addComment: _addComment,
      addComments: _addComments
    } = _t;
    function shareCommentsWithSiblings() {
      if (typeof this.key === "string") return;
      const node = this.node;
      if (!node) return;
      const trailing = node.trailingComments;
      const leading = node.leadingComments;
      if (!trailing && !leading) return;
      const prev = this.getSibling(this.key - 1);
      const next = this.getSibling(this.key + 1);
      const hasPrev = Boolean(prev.node);
      const hasNext = Boolean(next.node);
      if (hasPrev) {
        if (leading) {
          prev.addComments("trailing", removeIfExisting(leading, prev.node.trailingComments));
        }
        if (trailing && !hasNext) prev.addComments("trailing", trailing);
      }
      if (hasNext) {
        if (trailing) {
          next.addComments("leading", removeIfExisting(trailing, next.node.leadingComments));
        }
        if (leading && !hasPrev) next.addComments("leading", leading);
      }
    }
    function removeIfExisting(list, toRemove) {
      if (!(toRemove != null && toRemove.length)) return list;
      const set = new Set(toRemove);
      return list.filter((el) => {
        return !set.has(el);
      });
    }
    function addComment(type, content, line) {
      _addComment(this.node, type, content, line);
    }
    function addComments(type, comments) {
      _addComments(this.node, type, comments);
    }
  }
});

// node_modules/@babel/traverse/lib/path/index.js
var require_path = __commonJS({
  "node_modules/@babel/traverse/lib/path/index.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = exports2.SHOULD_STOP = exports2.SHOULD_SKIP = exports2.REMOVED = void 0;
    var virtualTypes = require_virtual_types();
    var _debug = require_src();
    var _index = require_lib9();
    var _index2 = require_scope();
    var _t = require_lib3();
    var t = _t;
    var cache = require_cache();
    var _generator = require_lib8();
    var NodePath_ancestry = require_ancestry();
    var NodePath_inference = require_inference();
    var NodePath_replacement = require_replacement();
    var NodePath_evaluation = require_evaluation();
    var NodePath_conversion = require_conversion();
    var NodePath_introspection = require_introspection();
    var _context = require_context2();
    var NodePath_context = _context;
    var NodePath_removal = require_removal();
    var NodePath_modification = require_modification();
    var NodePath_family = require_family();
    var NodePath_comments = require_comments();
    var NodePath_virtual_types_validator = require_virtual_types_validator();
    var {
      validate
    } = _t;
    var debug = _debug("babel");
    var REMOVED = exports2.REMOVED = 1 << 0;
    var SHOULD_STOP = exports2.SHOULD_STOP = 1 << 1;
    var SHOULD_SKIP = exports2.SHOULD_SKIP = 1 << 2;
    var NodePath_Final = exports2.default = class NodePath {
      constructor(hub, parent) {
        this.contexts = [];
        this.state = null;
        this._traverseFlags = 0;
        this.skipKeys = null;
        this.parentPath = null;
        this.container = null;
        this.listKey = null;
        this.key = null;
        this.node = null;
        this.type = null;
        this._store = null;
        this.parent = parent;
        this.hub = hub;
        this.data = null;
        this.context = null;
        this.scope = null;
      }
      get removed() {
        return (this._traverseFlags & 1) > 0;
      }
      set removed(v) {
        if (v) this._traverseFlags |= 1;
        else this._traverseFlags &= -2;
      }
      get shouldStop() {
        return (this._traverseFlags & 2) > 0;
      }
      set shouldStop(v) {
        if (v) this._traverseFlags |= 2;
        else this._traverseFlags &= -3;
      }
      get shouldSkip() {
        return (this._traverseFlags & 4) > 0;
      }
      set shouldSkip(v) {
        if (v) this._traverseFlags |= 4;
        else this._traverseFlags &= -5;
      }
      static get({
        hub,
        parentPath,
        parent,
        container,
        listKey,
        key
      }) {
        if (!hub && parentPath) {
          hub = parentPath.hub;
        }
        if (!parent) {
          throw new Error("To get a node path the parent needs to exist");
        }
        const targetNode = container[key];
        const paths = cache.getOrCreateCachedPaths(parent, parentPath);
        let path = paths.get(targetNode);
        if (!path) {
          path = new NodePath(hub, parent);
          if (targetNode) paths.set(targetNode, path);
        }
        _context.setup.call(path, parentPath, container, listKey, key);
        return path;
      }
      getScope(scope) {
        return this.isScope() ? new _index2.default(this) : scope;
      }
      setData(key, val) {
        if (this.data == null) {
          this.data = /* @__PURE__ */ Object.create(null);
        }
        return this.data[key] = val;
      }
      getData(key, def) {
        if (this.data == null) {
          this.data = /* @__PURE__ */ Object.create(null);
        }
        let val = this.data[key];
        if (val === void 0 && def !== void 0) val = this.data[key] = def;
        return val;
      }
      hasNode() {
        return this.node != null;
      }
      buildCodeFrameError(msg, Error2 = SyntaxError) {
        return this.hub.buildError(this.node, msg, Error2);
      }
      traverse(visitor, state) {
        (0, _index.default)(this.node, visitor, this.scope, state, this);
      }
      set(key, node) {
        validate(this.node, key, node);
        this.node[key] = node;
      }
      getPathLocation() {
        const parts = [];
        let path = this;
        do {
          let key = path.key;
          if (path.inList) key = `${path.listKey}[${key}]`;
          parts.unshift(key);
        } while (path = path.parentPath);
        return parts.join(".");
      }
      debug(message) {
        if (!debug.enabled) return;
        debug(`${this.getPathLocation()} ${this.type}: ${message}`);
      }
      toString() {
        return (0, _generator.default)(this.node).code;
      }
      get inList() {
        return !!this.listKey;
      }
      set inList(inList) {
        if (!inList) {
          this.listKey = null;
        }
      }
      get parentKey() {
        return this.listKey || this.key;
      }
    };
    var methods = {
      findParent: NodePath_ancestry.findParent,
      find: NodePath_ancestry.find,
      getFunctionParent: NodePath_ancestry.getFunctionParent,
      getStatementParent: NodePath_ancestry.getStatementParent,
      getEarliestCommonAncestorFrom: NodePath_ancestry.getEarliestCommonAncestorFrom,
      getDeepestCommonAncestorFrom: NodePath_ancestry.getDeepestCommonAncestorFrom,
      getAncestry: NodePath_ancestry.getAncestry,
      isAncestor: NodePath_ancestry.isAncestor,
      isDescendant: NodePath_ancestry.isDescendant,
      inType: NodePath_ancestry.inType,
      getTypeAnnotation: NodePath_inference.getTypeAnnotation,
      isBaseType: NodePath_inference.isBaseType,
      couldBeBaseType: NodePath_inference.couldBeBaseType,
      baseTypeStrictlyMatches: NodePath_inference.baseTypeStrictlyMatches,
      isGenericType: NodePath_inference.isGenericType,
      replaceWithMultiple: NodePath_replacement.replaceWithMultiple,
      replaceWithSourceString: NodePath_replacement.replaceWithSourceString,
      replaceWith: NodePath_replacement.replaceWith,
      replaceExpressionWithStatements: NodePath_replacement.replaceExpressionWithStatements,
      replaceInline: NodePath_replacement.replaceInline,
      evaluateTruthy: NodePath_evaluation.evaluateTruthy,
      evaluate: NodePath_evaluation.evaluate,
      toComputedKey: NodePath_conversion.toComputedKey,
      ensureBlock: NodePath_conversion.ensureBlock,
      unwrapFunctionEnvironment: NodePath_conversion.unwrapFunctionEnvironment,
      arrowFunctionToExpression: NodePath_conversion.arrowFunctionToExpression,
      splitExportDeclaration: NodePath_conversion.splitExportDeclaration,
      ensureFunctionName: NodePath_conversion.ensureFunctionName,
      matchesPattern: NodePath_introspection.matchesPattern,
      isStatic: NodePath_introspection.isStatic,
      isNodeType: NodePath_introspection.isNodeType,
      canHaveVariableDeclarationOrExpression: NodePath_introspection.canHaveVariableDeclarationOrExpression,
      canSwapBetweenExpressionAndStatement: NodePath_introspection.canSwapBetweenExpressionAndStatement,
      isCompletionRecord: NodePath_introspection.isCompletionRecord,
      isStatementOrBlock: NodePath_introspection.isStatementOrBlock,
      referencesImport: NodePath_introspection.referencesImport,
      getSource: NodePath_introspection.getSource,
      willIMaybeExecuteBefore: NodePath_introspection.willIMaybeExecuteBefore,
      _guessExecutionStatusRelativeTo: NodePath_introspection._guessExecutionStatusRelativeTo,
      resolve: NodePath_introspection.resolve,
      isConstantExpression: NodePath_introspection.isConstantExpression,
      isInStrictMode: NodePath_introspection.isInStrictMode,
      isDenylisted: NodePath_context.isDenylisted,
      visit: NodePath_context.visit,
      skip: NodePath_context.skip,
      skipKey: NodePath_context.skipKey,
      stop: NodePath_context.stop,
      setContext: NodePath_context.setContext,
      requeue: NodePath_context.requeue,
      requeueComputedKeyAndDecorators: NodePath_context.requeueComputedKeyAndDecorators,
      remove: NodePath_removal.remove,
      insertBefore: NodePath_modification.insertBefore,
      insertAfter: NodePath_modification.insertAfter,
      unshiftContainer: NodePath_modification.unshiftContainer,
      pushContainer: NodePath_modification.pushContainer,
      getOpposite: NodePath_family.getOpposite,
      getCompletionRecords: NodePath_family.getCompletionRecords,
      getSibling: NodePath_family.getSibling,
      getPrevSibling: NodePath_family.getPrevSibling,
      getNextSibling: NodePath_family.getNextSibling,
      getAllNextSiblings: NodePath_family.getAllNextSiblings,
      getAllPrevSiblings: NodePath_family.getAllPrevSiblings,
      get: NodePath_family.get,
      getAssignmentIdentifiers: NodePath_family.getAssignmentIdentifiers,
      getBindingIdentifiers: NodePath_family.getBindingIdentifiers,
      getOuterBindingIdentifiers: NodePath_family.getOuterBindingIdentifiers,
      getBindingIdentifierPaths: NodePath_family.getBindingIdentifierPaths,
      getOuterBindingIdentifierPaths: NodePath_family.getOuterBindingIdentifierPaths,
      shareCommentsWithSiblings: NodePath_comments.shareCommentsWithSiblings,
      addComment: NodePath_comments.addComment,
      addComments: NodePath_comments.addComments
    };
    Object.assign(NodePath_Final.prototype, methods);
    NodePath_Final.prototype.arrowFunctionToShadowed = NodePath_conversion[String("arrowFunctionToShadowed")];
    Object.assign(NodePath_Final.prototype, {
      has: NodePath_introspection[String("has")],
      is: NodePath_introspection[String("is")],
      isnt: NodePath_introspection[String("isnt")],
      equals: NodePath_introspection[String("equals")],
      hoist: NodePath_modification[String("hoist")],
      updateSiblingKeys: NodePath_modification.updateSiblingKeys,
      call: NodePath_context.call,
      isBlacklisted: NodePath_context[String("isBlacklisted")],
      setScope: NodePath_context.setScope,
      resync: NodePath_context.resync,
      popContext: NodePath_context.popContext,
      pushContext: NodePath_context.pushContext,
      setup: NodePath_context.setup,
      setKey: NodePath_context.setKey
    });
    NodePath_Final.prototype._guessExecutionStatusRelativeToDifferentFunctions = NodePath_introspection._guessExecutionStatusRelativeTo;
    NodePath_Final.prototype._guessExecutionStatusRelativeToDifferentFunctions = NodePath_introspection._guessExecutionStatusRelativeTo;
    Object.assign(NodePath_Final.prototype, {
      _getTypeAnnotation: NodePath_inference._getTypeAnnotation,
      _replaceWith: NodePath_replacement._replaceWith,
      _resolve: NodePath_introspection._resolve,
      _call: NodePath_context._call,
      _resyncParent: NodePath_context._resyncParent,
      _resyncKey: NodePath_context._resyncKey,
      _resyncList: NodePath_context._resyncList,
      _resyncRemoved: NodePath_context._resyncRemoved,
      _getQueueContexts: NodePath_context._getQueueContexts,
      _removeFromScope: NodePath_removal._removeFromScope,
      _callRemovalHooks: NodePath_removal._callRemovalHooks,
      _remove: NodePath_removal._remove,
      _markRemoved: NodePath_removal._markRemoved,
      _assertUnremoved: NodePath_removal._assertUnremoved,
      _containerInsert: NodePath_modification._containerInsert,
      _containerInsertBefore: NodePath_modification._containerInsertBefore,
      _containerInsertAfter: NodePath_modification._containerInsertAfter,
      _verifyNodeList: NodePath_modification._verifyNodeList,
      _getKey: NodePath_family._getKey,
      _getPattern: NodePath_family._getPattern
    });
    for (const type of t.TYPES) {
      const typeKey = `is${type}`;
      const fn = t[typeKey];
      NodePath_Final.prototype[typeKey] = function(opts) {
        return fn(this.node, opts);
      };
      NodePath_Final.prototype[`assert${type}`] = function(opts) {
        if (!fn(this.node, opts)) {
          throw new TypeError(`Expected node path of type ${type}`);
        }
      };
    }
    Object.assign(NodePath_Final.prototype, NodePath_virtual_types_validator);
    for (const type of Object.keys(virtualTypes)) {
      if (type.startsWith("_")) continue;
      if (!t.TYPES.includes(type)) t.TYPES.push(type);
    }
  }
});

// node_modules/@babel/traverse/lib/hub.js
var require_hub = __commonJS({
  "node_modules/@babel/traverse/lib/hub.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = void 0;
    var Hub = class {
      getCode() {
      }
      getScope() {
      }
      addHelper() {
        throw new Error("Helpers are not supported by the default hub.");
      }
      buildError(node, msg, Error2 = TypeError) {
        return new Error2(msg);
      }
    };
    exports2.default = Hub;
  }
});

// node_modules/@babel/traverse/lib/context.js
var require_context = __commonJS({
  "node_modules/@babel/traverse/lib/context.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = void 0;
    var _index = require_path();
    var _t = require_lib3();
    var _context = require_context2();
    var _hub = require_hub();
    var {
      VISITOR_KEYS
    } = _t;
    var TraversalContext = class {
      constructor(scope, opts, state, parentPath) {
        this.queue = null;
        this.priorityQueue = null;
        this.parentPath = parentPath;
        this.scope = scope;
        this.state = state;
        this.opts = opts;
      }
      shouldVisit(node) {
        const opts = this.opts;
        if (opts.enter || opts.exit) return true;
        if (opts[node.type]) return true;
        const keys = VISITOR_KEYS[node.type];
        if (!(keys != null && keys.length)) return false;
        for (const key of keys) {
          if (node[key]) {
            return true;
          }
        }
        return false;
      }
      create(node, container, key, listKey) {
        const {
          parentPath
        } = this;
        const hub = parentPath == null ? node.type === "Program" || node.type === "File" ? new _hub.default() : void 0 : parentPath.hub;
        return _index.default.get({
          parentPath,
          parent: node,
          container,
          key,
          listKey,
          hub
        });
      }
      maybeQueue(path, notPriority) {
        if (this.queue) {
          if (notPriority) {
            this.queue.push(path);
          } else {
            this.priorityQueue.push(path);
          }
        }
      }
      visitMultiple(container, parent, listKey) {
        if (container.length === 0) return false;
        const queue = [];
        for (let key = 0; key < container.length; key++) {
          const node = container[key];
          if (node && this.shouldVisit(node)) {
            queue.push(this.create(parent, container, key, listKey));
          }
        }
        return this.visitQueue(queue);
      }
      visitSingle(node, key) {
        if (this.shouldVisit(node[key])) {
          return this.visitQueue([this.create(node, node, key)]);
        } else {
          return false;
        }
      }
      visitQueue(queue) {
        this.queue = queue;
        this.priorityQueue = [];
        const visited = /* @__PURE__ */ new WeakSet();
        let stop = false;
        let visitIndex = 0;
        for (; visitIndex < queue.length; ) {
          const path = queue[visitIndex];
          visitIndex++;
          _context.resync.call(path);
          if (path.contexts.length === 0 || path.contexts[path.contexts.length - 1] !== this) {
            _context.pushContext.call(path, this);
          }
          if (path.key === null) continue;
          const {
            node
          } = path;
          if (visited.has(node)) continue;
          if (node) visited.add(node);
          if (path.visit()) {
            stop = true;
            break;
          }
          if (this.priorityQueue.length) {
            stop = this.visitQueue(this.priorityQueue);
            this.priorityQueue = [];
            this.queue = queue;
            if (stop) break;
          }
        }
        for (let i = 0; i < visitIndex; i++) {
          _context.popContext.call(queue[i]);
        }
        this.queue = null;
        return stop;
      }
      visit(node, key) {
        const nodes = node[key];
        if (!nodes) return false;
        if (Array.isArray(nodes)) {
          return this.visitMultiple(nodes, node, key);
        } else {
          return this.visitSingle(node, key);
        }
      }
    };
    exports2.default = TraversalContext;
  }
});

// node_modules/@babel/traverse/lib/traverse-node.js
var require_traverse_node = __commonJS({
  "node_modules/@babel/traverse/lib/traverse-node.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.traverseNode = traverseNode;
    var _context = require_context();
    var _index = require_path();
    var _t = require_lib3();
    var _context2 = require_context2();
    var {
      VISITOR_KEYS
    } = _t;
    function traverseNode(node, opts, scope, state, path, skipKeys, visitSelf) {
      const keys = VISITOR_KEYS[node.type];
      if (!keys) return false;
      const context = new _context.default(scope, opts, state, path);
      if (visitSelf) {
        if (skipKeys != null && skipKeys[path.parentKey]) return false;
        return context.visitQueue([path]);
      }
      for (const key of keys) {
        if (skipKeys != null && skipKeys[key]) continue;
        if (context.visit(node, key)) {
          return true;
        }
      }
      return false;
    }
  }
});

// node_modules/@babel/traverse/lib/path/context.js
var require_context2 = __commonJS({
  "node_modules/@babel/traverse/lib/path/context.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2._call = _call;
    exports2._forceSetScope = _forceSetScope;
    exports2._getQueueContexts = _getQueueContexts;
    exports2._resyncKey = _resyncKey;
    exports2._resyncList = _resyncList;
    exports2._resyncParent = _resyncParent;
    exports2._resyncRemoved = _resyncRemoved;
    exports2.call = call;
    exports2.isDenylisted = isDenylisted;
    exports2.popContext = popContext;
    exports2.pushContext = pushContext;
    exports2.requeue = requeue;
    exports2.requeueComputedKeyAndDecorators = requeueComputedKeyAndDecorators;
    exports2.resync = resync;
    exports2.setContext = setContext;
    exports2.setKey = setKey;
    exports2.setScope = setScope;
    exports2.setup = setup;
    exports2.skip = skip;
    exports2.skipKey = skipKey;
    exports2.stop = stop;
    exports2.visit = visit;
    var _traverseNode = require_traverse_node();
    var _index = require_path();
    var _removal = require_removal();
    var t = require_lib3();
    function call(key) {
      const opts = this.opts;
      this.debug(key);
      if (this.node) {
        if (_call.call(this, opts[key])) return true;
      }
      if (this.node) {
        var _opts$this$node$type;
        return _call.call(this, (_opts$this$node$type = opts[this.node.type]) == null ? void 0 : _opts$this$node$type[key]);
      }
      return false;
    }
    function _call(fns) {
      if (!fns) return false;
      for (const fn of fns) {
        if (!fn) continue;
        const node = this.node;
        if (!node) return true;
        const ret = fn.call(this.state, this, this.state);
        if (ret && typeof ret === "object" && typeof ret.then === "function") {
          throw new Error(`You appear to be using a plugin with an async traversal visitor, which your current version of Babel does not support. If you're using a published plugin, you may need to upgrade your @babel/core version.`);
        }
        if (ret) {
          throw new Error(`Unexpected return value from visitor method ${fn}`);
        }
        if (this.node !== node) return true;
        if (this._traverseFlags > 0) return true;
      }
      return false;
    }
    function isDenylisted() {
      var _this$opts$denylist;
      const denylist = (_this$opts$denylist = this.opts.denylist) != null ? _this$opts$denylist : this.opts.blacklist;
      return denylist == null ? void 0 : denylist.includes(this.node.type);
    }
    exports2.isBlacklisted = isDenylisted;
    function restoreContext(path, context) {
      if (path.context !== context) {
        path.context = context;
        path.state = context.state;
        path.opts = context.opts;
      }
    }
    function visit() {
      var _this$opts$shouldSkip, _this$opts;
      if (!this.node) {
        return false;
      }
      if (this.isDenylisted()) {
        return false;
      }
      if ((_this$opts$shouldSkip = (_this$opts = this.opts).shouldSkip) != null && _this$opts$shouldSkip.call(_this$opts, this)) {
        return false;
      }
      const currentContext = this.context;
      if (this.shouldSkip || call.call(this, "enter")) {
        this.debug("Skip...");
        return this.shouldStop;
      }
      restoreContext(this, currentContext);
      this.debug("Recursing into...");
      this.shouldStop = (0, _traverseNode.traverseNode)(this.node, this.opts, this.scope, this.state, this, this.skipKeys);
      restoreContext(this, currentContext);
      call.call(this, "exit");
      return this.shouldStop;
    }
    function skip() {
      this.shouldSkip = true;
    }
    function skipKey(key) {
      if (this.skipKeys == null) {
        this.skipKeys = {};
      }
      this.skipKeys[key] = true;
    }
    function stop() {
      this._traverseFlags |= _index.SHOULD_SKIP | _index.SHOULD_STOP;
    }
    function _forceSetScope() {
      var _this$scope;
      let path = this.parentPath;
      if ((this.key === "key" || this.listKey === "decorators") && path.isMethod() || this.key === "discriminant" && path.isSwitchStatement()) {
        path = path.parentPath;
      }
      let target;
      while (path && !target) {
        target = path.scope;
        path = path.parentPath;
      }
      this.scope = this.getScope(target);
      (_this$scope = this.scope) == null || _this$scope.init();
    }
    function setScope() {
      var _this$opts2, _this$scope2;
      if ((_this$opts2 = this.opts) != null && _this$opts2.noScope) return;
      let path = this.parentPath;
      if ((this.key === "key" || this.listKey === "decorators") && path.isMethod() || this.key === "discriminant" && path.isSwitchStatement()) {
        path = path.parentPath;
      }
      let target;
      while (path && !target) {
        var _path$opts;
        if ((_path$opts = path.opts) != null && _path$opts.noScope) return;
        target = path.scope;
        path = path.parentPath;
      }
      this.scope = this.getScope(target);
      (_this$scope2 = this.scope) == null || _this$scope2.init();
    }
    function setContext(context) {
      if (this.skipKeys != null) {
        this.skipKeys = {};
      }
      this._traverseFlags = 0;
      if (context) {
        this.context = context;
        this.state = context.state;
        this.opts = context.opts;
      }
      setScope.call(this);
      return this;
    }
    function resync() {
      if (this.removed) return;
      _resyncParent.call(this);
      _resyncList.call(this);
      _resyncKey.call(this);
    }
    function _resyncParent() {
      if (this.parentPath) {
        this.parent = this.parentPath.node;
      }
    }
    function _resyncKey() {
      if (!this.container) return;
      if (this.node === this.container[this.key]) {
        return;
      }
      if (Array.isArray(this.container)) {
        for (let i = 0; i < this.container.length; i++) {
          if (this.container[i] === this.node) {
            setKey.call(this, i);
            return;
          }
        }
      } else {
        for (const key of Object.keys(this.container)) {
          if (this.container[key] === this.node) {
            setKey.call(this, key);
            return;
          }
        }
      }
      this.key = null;
    }
    function _resyncList() {
      if (!this.parent || !this.inList) return;
      const newContainer = this.parent[this.listKey];
      if (this.container === newContainer) return;
      this.container = newContainer || null;
    }
    function _resyncRemoved() {
      if (this.key == null || !this.container || this.container[this.key] !== this.node) {
        _removal._markRemoved.call(this);
      }
    }
    function popContext() {
      this.contexts.pop();
      if (this.contexts.length > 0) {
        this.setContext(this.contexts[this.contexts.length - 1]);
      } else {
        this.setContext(void 0);
      }
    }
    function pushContext(context) {
      this.contexts.push(context);
      this.setContext(context);
    }
    function setup(parentPath, container, listKey, key) {
      this.listKey = listKey;
      this.container = container;
      this.parentPath = parentPath || this.parentPath;
      setKey.call(this, key);
    }
    function setKey(key) {
      var _this$node;
      this.key = key;
      this.node = this.container[this.key];
      this.type = (_this$node = this.node) == null ? void 0 : _this$node.type;
    }
    function requeue(pathToQueue = this) {
      if (pathToQueue.removed) return;
      const contexts = this.contexts;
      for (const context of contexts) {
        context.maybeQueue(pathToQueue);
      }
    }
    function requeueComputedKeyAndDecorators() {
      const {
        context,
        node
      } = this;
      if (!t.isPrivate(node) && node.computed) {
        context.maybeQueue(this.get("key"));
      }
      if (node.decorators) {
        for (const decorator of this.get("decorators")) {
          context.maybeQueue(decorator);
        }
      }
    }
    function _getQueueContexts() {
      let path = this;
      let contexts = this.contexts;
      while (!contexts.length) {
        path = path.parentPath;
        if (!path) break;
        contexts = path.contexts;
      }
      return contexts;
    }
  }
});

// node_modules/@babel/traverse/lib/index.js
var require_lib9 = __commonJS({
  "node_modules/@babel/traverse/lib/index.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    Object.defineProperty(exports2, "Hub", {
      enumerable: true,
      get: function() {
        return _hub.default;
      }
    });
    Object.defineProperty(exports2, "NodePath", {
      enumerable: true,
      get: function() {
        return _index.default;
      }
    });
    Object.defineProperty(exports2, "Scope", {
      enumerable: true,
      get: function() {
        return _index2.default;
      }
    });
    exports2.visitors = exports2.default = void 0;
    require_context2();
    var visitors = require_visitors();
    exports2.visitors = visitors;
    var _t = require_lib3();
    var cache = require_cache();
    var _traverseNode = require_traverse_node();
    var _index = require_path();
    var _index2 = require_scope();
    var _hub = require_hub();
    var {
      VISITOR_KEYS,
      removeProperties,
      traverseFast
    } = _t;
    function traverse2(parent, opts = {}, scope, state, parentPath, visitSelf) {
      if (!parent) return;
      if (!opts.noScope && !scope) {
        if (parent.type !== "Program" && parent.type !== "File") {
          throw new Error(`You must pass a scope and parentPath unless traversing a Program/File. Instead of that you tried to traverse a ${parent.type} node without passing scope and parentPath.`);
        }
      }
      if (!parentPath && visitSelf) {
        throw new Error("visitSelf can only be used when providing a NodePath.");
      }
      if (!VISITOR_KEYS[parent.type]) {
        return;
      }
      visitors.explode(opts);
      (0, _traverseNode.traverseNode)(parent, opts, scope, state, parentPath, void 0, visitSelf);
    }
    var _default = exports2.default = traverse2;
    traverse2.visitors = visitors;
    traverse2.verify = visitors.verify;
    traverse2.explode = visitors.explode;
    traverse2.cheap = function(node, enter) {
      traverseFast(node, enter);
      return;
    };
    traverse2.node = function(node, opts, scope, state, path, skipKeys) {
      (0, _traverseNode.traverseNode)(node, opts, scope, state, path, skipKeys);
    };
    traverse2.clearNode = function(node, opts) {
      removeProperties(node, opts);
    };
    traverse2.removeProperties = function(tree, opts) {
      traverseFast(tree, traverse2.clearNode, opts);
      return tree;
    };
    traverse2.hasType = function(tree, type, denylistTypes) {
      if (denylistTypes != null && denylistTypes.includes(tree.type)) return false;
      if (tree.type === type) return true;
      return traverseFast(tree, function(node) {
        if (denylistTypes != null && denylistTypes.includes(node.type)) {
          return traverseFast.skip;
        }
        if (node.type === type) {
          return traverseFast.stop;
        }
      });
    };
    traverse2.cache = cache;
  }
});

// node_modules/@babel/core/node_modules/semver/semver.js
var require_semver = __commonJS({
  "node_modules/@babel/core/node_modules/semver/semver.js"(exports2, module2) {
    exports2 = module2.exports = SemVer;
    var debug;
    if (typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG)) {
      debug = function() {
        var args = Array.prototype.slice.call(arguments, 0);
        args.unshift("SEMVER");
        console.log.apply(console, args);
      };
    } else {
      debug = function() {
      };
    }
    exports2.SEMVER_SPEC_VERSION = "2.0.0";
    var MAX_LENGTH = 256;
    var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */
    9007199254740991;
    var MAX_SAFE_COMPONENT_LENGTH = 16;
    var MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6;
    var re = exports2.re = [];
    var safeRe = exports2.safeRe = [];
    var src = exports2.src = [];
    var t = exports2.tokens = {};
    var R = 0;
    function tok(n) {
      t[n] = R++;
    }
    var LETTERDASHNUMBER = "[a-zA-Z0-9-]";
    var safeRegexReplacements = [
      ["\\s", 1],
      ["\\d", MAX_LENGTH],
      [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH]
    ];
    function makeSafeRe(value2) {
      for (var i2 = 0; i2 < safeRegexReplacements.length; i2++) {
        var token = safeRegexReplacements[i2][0];
        var max = safeRegexReplacements[i2][1];
        value2 = value2.split(token + "*").join(token + "{0," + max + "}").split(token + "+").join(token + "{1," + max + "}");
      }
      return value2;
    }
    tok("NUMERICIDENTIFIER");
    src[t.NUMERICIDENTIFIER] = "0|[1-9]\\d*";
    tok("NUMERICIDENTIFIERLOOSE");
    src[t.NUMERICIDENTIFIERLOOSE] = "\\d+";
    tok("NONNUMERICIDENTIFIER");
    src[t.NONNUMERICIDENTIFIER] = "\\d*[a-zA-Z-]" + LETTERDASHNUMBER + "*";
    tok("MAINVERSION");
    src[t.MAINVERSION] = "(" + src[t.NUMERICIDENTIFIER] + ")\\.(" + src[t.NUMERICIDENTIFIER] + ")\\.(" + src[t.NUMERICIDENTIFIER] + ")";
    tok("MAINVERSIONLOOSE");
    src[t.MAINVERSIONLOOSE] = "(" + src[t.NUMERICIDENTIFIERLOOSE] + ")\\.(" + src[t.NUMERICIDENTIFIERLOOSE] + ")\\.(" + src[t.NUMERICIDENTIFIERLOOSE] + ")";
    tok("PRERELEASEIDENTIFIER");
    src[t.PRERELEASEIDENTIFIER] = "(?:" + src[t.NUMERICIDENTIFIER] + "|" + src[t.NONNUMERICIDENTIFIER] + ")";
    tok("PRERELEASEIDENTIFIERLOOSE");
    src[t.PRERELEASEIDENTIFIERLOOSE] = "(?:" + src[t.NUMERICIDENTIFIERLOOSE] + "|" + src[t.NONNUMERICIDENTIFIER] + ")";
    tok("PRERELEASE");
    src[t.PRERELEASE] = "(?:-(" + src[t.PRERELEASEIDENTIFIER] + "(?:\\." + src[t.PRERELEASEIDENTIFIER] + ")*))";
    tok("PRERELEASELOOSE");
    src[t.PRERELEASELOOSE] = "(?:-?(" + src[t.PRERELEASEIDENTIFIERLOOSE] + "(?:\\." + src[t.PRERELEASEIDENTIFIERLOOSE] + ")*))";
    tok("BUILDIDENTIFIER");
    src[t.BUILDIDENTIFIER] = LETTERDASHNUMBER + "+";
    tok("BUILD");
    src[t.BUILD] = "(?:\\+(" + src[t.BUILDIDENTIFIER] + "(?:\\." + src[t.BUILDIDENTIFIER] + ")*))";
    tok("FULL");
    tok("FULLPLAIN");
    src[t.FULLPLAIN] = "v?" + src[t.MAINVERSION] + src[t.PRERELEASE] + "?" + src[t.BUILD] + "?";
    src[t.FULL] = "^" + src[t.FULLPLAIN] + "$";
    tok("LOOSEPLAIN");
    src[t.LOOSEPLAIN] = "[v=\\s]*" + src[t.MAINVERSIONLOOSE] + src[t.PRERELEASELOOSE] + "?" + src[t.BUILD] + "?";
    tok("LOOSE");
    src[t.LOOSE] = "^" + src[t.LOOSEPLAIN] + "$";
    tok("GTLT");
    src[t.GTLT] = "((?:<|>)?=?)";
    tok("XRANGEIDENTIFIERLOOSE");
    src[t.XRANGEIDENTIFIERLOOSE] = src[t.NUMERICIDENTIFIERLOOSE] + "|x|X|\\*";
    tok("XRANGEIDENTIFIER");
    src[t.XRANGEIDENTIFIER] = src[t.NUMERICIDENTIFIER] + "|x|X|\\*";
    tok("XRANGEPLAIN");
    src[t.XRANGEPLAIN] = "[v=\\s]*(" + src[t.XRANGEIDENTIFIER] + ")(?:\\.(" + src[t.XRANGEIDENTIFIER] + ")(?:\\.(" + src[t.XRANGEIDENTIFIER] + ")(?:" + src[t.PRERELEASE] + ")?" + src[t.BUILD] + "?)?)?";
    tok("XRANGEPLAINLOOSE");
    src[t.XRANGEPLAINLOOSE] = "[v=\\s]*(" + src[t.XRANGEIDENTIFIERLOOSE] + ")(?:\\.(" + src[t.XRANGEIDENTIFIERLOOSE] + ")(?:\\.(" + src[t.XRANGEIDENTIFIERLOOSE] + ")(?:" + src[t.PRERELEASELOOSE] + ")?" + src[t.BUILD] + "?)?)?";
    tok("XRANGE");
    src[t.XRANGE] = "^" + src[t.GTLT] + "\\s*" + src[t.XRANGEPLAIN] + "$";
    tok("XRANGELOOSE");
    src[t.XRANGELOOSE] = "^" + src[t.GTLT] + "\\s*" + src[t.XRANGEPLAINLOOSE] + "$";
    tok("COERCE");
    src[t.COERCE] = "(^|[^\\d])(\\d{1," + MAX_SAFE_COMPONENT_LENGTH + "})(?:\\.(\\d{1," + MAX_SAFE_COMPONENT_LENGTH + "}))?(?:\\.(\\d{1," + MAX_SAFE_COMPONENT_LENGTH + "}))?(?:$|[^\\d])";
    tok("COERCERTL");
    re[t.COERCERTL] = new RegExp(src[t.COERCE], "g");
    safeRe[t.COERCERTL] = new RegExp(makeSafeRe(src[t.COERCE]), "g");
    tok("LONETILDE");
    src[t.LONETILDE] = "(?:~>?)";
    tok("TILDETRIM");
    src[t.TILDETRIM] = "(\\s*)" + src[t.LONETILDE] + "\\s+";
    re[t.TILDETRIM] = new RegExp(src[t.TILDETRIM], "g");
    safeRe[t.TILDETRIM] = new RegExp(makeSafeRe(src[t.TILDETRIM]), "g");
    var tildeTrimReplace = "$1~";
    tok("TILDE");
    src[t.TILDE] = "^" + src[t.LONETILDE] + src[t.XRANGEPLAIN] + "$";
    tok("TILDELOOSE");
    src[t.TILDELOOSE] = "^" + src[t.LONETILDE] + src[t.XRANGEPLAINLOOSE] + "$";
    tok("LONECARET");
    src[t.LONECARET] = "(?:\\^)";
    tok("CARETTRIM");
    src[t.CARETTRIM] = "(\\s*)" + src[t.LONECARET] + "\\s+";
    re[t.CARETTRIM] = new RegExp(src[t.CARETTRIM], "g");
    safeRe[t.CARETTRIM] = new RegExp(makeSafeRe(src[t.CARETTRIM]), "g");
    var caretTrimReplace = "$1^";
    tok("CARET");
    src[t.CARET] = "^" + src[t.LONECARET] + src[t.XRANGEPLAIN] + "$";
    tok("CARETLOOSE");
    src[t.CARETLOOSE] = "^" + src[t.LONECARET] + src[t.XRANGEPLAINLOOSE] + "$";
    tok("COMPARATORLOOSE");
    src[t.COMPARATORLOOSE] = "^" + src[t.GTLT] + "\\s*(" + src[t.LOOSEPLAIN] + ")$|^$";
    tok("COMPARATOR");
    src[t.COMPARATOR] = "^" + src[t.GTLT] + "\\s*(" + src[t.FULLPLAIN] + ")$|^$";
    tok("COMPARATORTRIM");
    src[t.COMPARATORTRIM] = "(\\s*)" + src[t.GTLT] + "\\s*(" + src[t.LOOSEPLAIN] + "|" + src[t.XRANGEPLAIN] + ")";
    re[t.COMPARATORTRIM] = new RegExp(src[t.COMPARATORTRIM], "g");
    safeRe[t.COMPARATORTRIM] = new RegExp(makeSafeRe(src[t.COMPARATORTRIM]), "g");
    var comparatorTrimReplace = "$1$2$3";
    tok("HYPHENRANGE");
    src[t.HYPHENRANGE] = "^\\s*(" + src[t.XRANGEPLAIN] + ")\\s+-\\s+(" + src[t.XRANGEPLAIN] + ")\\s*$";
    tok("HYPHENRANGELOOSE");
    src[t.HYPHENRANGELOOSE] = "^\\s*(" + src[t.XRANGEPLAINLOOSE] + ")\\s+-\\s+(" + src[t.XRANGEPLAINLOOSE] + ")\\s*$";
    tok("STAR");
    src[t.STAR] = "(<|>)?=?\\s*\\*";
    for (i = 0; i < R; i++) {
      debug(i, src[i]);
      if (!re[i]) {
        re[i] = new RegExp(src[i]);
        safeRe[i] = new RegExp(makeSafeRe(src[i]));
      }
    }
    var i;
    exports2.parse = parse2;
    function parse2(version, options) {
      if (!options || typeof options !== "object") {
        options = {
          loose: !!options,
          includePrerelease: false
        };
      }
      if (version instanceof SemVer) {
        return version;
      }
      if (typeof version !== "string") {
        return null;
      }
      if (version.length > MAX_LENGTH) {
        return null;
      }
      var r = options.loose ? safeRe[t.LOOSE] : safeRe[t.FULL];
      if (!r.test(version)) {
        return null;
      }
      try {
        return new SemVer(version, options);
      } catch (er) {
        return null;
      }
    }
    exports2.valid = valid;
    function valid(version, options) {
      var v = parse2(version, options);
      return v ? v.version : null;
    }
    exports2.clean = clean;
    function clean(version, options) {
      var s = parse2(version.trim().replace(/^[=v]+/, ""), options);
      return s ? s.version : null;
    }
    exports2.SemVer = SemVer;
    function SemVer(version, options) {
      if (!options || typeof options !== "object") {
        options = {
          loose: !!options,
          includePrerelease: false
        };
      }
      if (version instanceof SemVer) {
        if (version.loose === options.loose) {
          return version;
        } else {
          version = version.version;
        }
      } else if (typeof version !== "string") {
        throw new TypeError("Invalid Version: " + version);
      }
      if (version.length > MAX_LENGTH) {
        throw new TypeError("version is longer than " + MAX_LENGTH + " characters");
      }
      if (!(this instanceof SemVer)) {
        return new SemVer(version, options);
      }
      debug("SemVer", version, options);
      this.options = options;
      this.loose = !!options.loose;
      var m = version.trim().match(options.loose ? safeRe[t.LOOSE] : safeRe[t.FULL]);
      if (!m) {
        throw new TypeError("Invalid Version: " + version);
      }
      this.raw = version;
      this.major = +m[1];
      this.minor = +m[2];
      this.patch = +m[3];
      if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
        throw new TypeError("Invalid major version");
      }
      if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
        throw new TypeError("Invalid minor version");
      }
      if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
        throw new TypeError("Invalid patch version");
      }
      if (!m[4]) {
        this.prerelease = [];
      } else {
        this.prerelease = m[4].split(".").map(function(id) {
          if (/^[0-9]+$/.test(id)) {
            var num = +id;
            if (num >= 0 && num < MAX_SAFE_INTEGER) {
              return num;
            }
          }
          return id;
        });
      }
      this.build = m[5] ? m[5].split(".") : [];
      this.format();
    }
    SemVer.prototype.format = function() {
      this.version = this.major + "." + this.minor + "." + this.patch;
      if (this.prerelease.length) {
        this.version += "-" + this.prerelease.join(".");
      }
      return this.version;
    };
    SemVer.prototype.toString = function() {
      return this.version;
    };
    SemVer.prototype.compare = function(other) {
      debug("SemVer.compare", this.version, this.options, other);
      if (!(other instanceof SemVer)) {
        other = new SemVer(other, this.options);
      }
      return this.compareMain(other) || this.comparePre(other);
    };
    SemVer.prototype.compareMain = function(other) {
      if (!(other instanceof SemVer)) {
        other = new SemVer(other, this.options);
      }
      return compareIdentifiers(this.major, other.major) || compareIdentifiers(this.minor, other.minor) || compareIdentifiers(this.patch, other.patch);
    };
    SemVer.prototype.comparePre = function(other) {
      if (!(other instanceof SemVer)) {
        other = new SemVer(other, this.options);
      }
      if (this.prerelease.length && !other.prerelease.length) {
        return -1;
      } else if (!this.prerelease.length && other.prerelease.length) {
        return 1;
      } else if (!this.prerelease.length && !other.prerelease.length) {
        return 0;
      }
      var i2 = 0;
      do {
        var a = this.prerelease[i2];
        var b = other.prerelease[i2];
        debug("prerelease compare", i2, a, b);
        if (a === void 0 && b === void 0) {
          return 0;
        } else if (b === void 0) {
          return 1;
        } else if (a === void 0) {
          return -1;
        } else if (a === b) {
          continue;
        } else {
          return compareIdentifiers(a, b);
        }
      } while (++i2);
    };
    SemVer.prototype.compareBuild = function(other) {
      if (!(other instanceof SemVer)) {
        other = new SemVer(other, this.options);
      }
      var i2 = 0;
      do {
        var a = this.build[i2];
        var b = other.build[i2];
        debug("prerelease compare", i2, a, b);
        if (a === void 0 && b === void 0) {
          return 0;
        } else if (b === void 0) {
          return 1;
        } else if (a === void 0) {
          return -1;
        } else if (a === b) {
          continue;
        } else {
          return compareIdentifiers(a, b);
        }
      } while (++i2);
    };
    SemVer.prototype.inc = function(release, identifier) {
      switch (release) {
        case "premajor":
          this.prerelease.length = 0;
          this.patch = 0;
          this.minor = 0;
          this.major++;
          this.inc("pre", identifier);
          break;
        case "preminor":
          this.prerelease.length = 0;
          this.patch = 0;
          this.minor++;
          this.inc("pre", identifier);
          break;
        case "prepatch":
          this.prerelease.length = 0;
          this.inc("patch", identifier);
          this.inc("pre", identifier);
          break;
        // If the input is a non-prerelease version, this acts the same as
        // prepatch.
        case "prerelease":
          if (this.prerelease.length === 0) {
            this.inc("patch", identifier);
          }
          this.inc("pre", identifier);
          break;
        case "major":
          if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) {
            this.major++;
          }
          this.minor = 0;
          this.patch = 0;
          this.prerelease = [];
          break;
        case "minor":
          if (this.patch !== 0 || this.prerelease.length === 0) {
            this.minor++;
          }
          this.patch = 0;
          this.prerelease = [];
          break;
        case "patch":
          if (this.prerelease.length === 0) {
            this.patch++;
          }
          this.prerelease = [];
          break;
        // This probably shouldn't be used publicly.
        // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction.
        case "pre":
          if (this.prerelease.length === 0) {
            this.prerelease = [0];
          } else {
            var i2 = this.prerelease.length;
            while (--i2 >= 0) {
              if (typeof this.prerelease[i2] === "number") {
                this.prerelease[i2]++;
                i2 = -2;
              }
            }
            if (i2 === -1) {
              this.prerelease.push(0);
            }
          }
          if (identifier) {
            if (this.prerelease[0] === identifier) {
              if (isNaN(this.prerelease[1])) {
                this.prerelease = [identifier, 0];
              }
            } else {
              this.prerelease = [identifier, 0];
            }
          }
          break;
        default:
          throw new Error("invalid increment argument: " + release);
      }
      this.format();
      this.raw = this.version;
      return this;
    };
    exports2.inc = inc;
    function inc(version, release, loose, identifier) {
      if (typeof loose === "string") {
        identifier = loose;
        loose = void 0;
      }
      try {
        return new SemVer(version, loose).inc(release, identifier).version;
      } catch (er) {
        return null;
      }
    }
    exports2.diff = diff;
    function diff(version1, version2) {
      if (eq(version1, version2)) {
        return null;
      } else {
        var v1 = parse2(version1);
        var v2 = parse2(version2);
        var prefix = "";
        if (v1.prerelease.length || v2.prerelease.length) {
          prefix = "pre";
          var defaultResult = "prerelease";
        }
        for (var key in v1) {
          if (key === "major" || key === "minor" || key === "patch") {
            if (v1[key] !== v2[key]) {
              return prefix + key;
            }
          }
        }
        return defaultResult;
      }
    }
    exports2.compareIdentifiers = compareIdentifiers;
    var numeric = /^[0-9]+$/;
    function compareIdentifiers(a, b) {
      var anum = numeric.test(a);
      var bnum = numeric.test(b);
      if (anum && bnum) {
        a = +a;
        b = +b;
      }
      return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1;
    }
    exports2.rcompareIdentifiers = rcompareIdentifiers;
    function rcompareIdentifiers(a, b) {
      return compareIdentifiers(b, a);
    }
    exports2.major = major;
    function major(a, loose) {
      return new SemVer(a, loose).major;
    }
    exports2.minor = minor;
    function minor(a, loose) {
      return new SemVer(a, loose).minor;
    }
    exports2.patch = patch;
    function patch(a, loose) {
      return new SemVer(a, loose).patch;
    }
    exports2.compare = compare;
    function compare(a, b, loose) {
      return new SemVer(a, loose).compare(new SemVer(b, loose));
    }
    exports2.compareLoose = compareLoose;
    function compareLoose(a, b) {
      return compare(a, b, true);
    }
    exports2.compareBuild = compareBuild;
    function compareBuild(a, b, loose) {
      var versionA = new SemVer(a, loose);
      var versionB = new SemVer(b, loose);
      return versionA.compare(versionB) || versionA.compareBuild(versionB);
    }
    exports2.rcompare = rcompare;
    function rcompare(a, b, loose) {
      return compare(b, a, loose);
    }
    exports2.sort = sort;
    function sort(list, loose) {
      return list.sort(function(a, b) {
        return exports2.compareBuild(a, b, loose);
      });
    }
    exports2.rsort = rsort;
    function rsort(list, loose) {
      return list.sort(function(a, b) {
        return exports2.compareBuild(b, a, loose);
      });
    }
    exports2.gt = gt;
    function gt(a, b, loose) {
      return compare(a, b, loose) > 0;
    }
    exports2.lt = lt;
    function lt(a, b, loose) {
      return compare(a, b, loose) < 0;
    }
    exports2.eq = eq;
    function eq(a, b, loose) {
      return compare(a, b, loose) === 0;
    }
    exports2.neq = neq;
    function neq(a, b, loose) {
      return compare(a, b, loose) !== 0;
    }
    exports2.gte = gte;
    function gte(a, b, loose) {
      return compare(a, b, loose) >= 0;
    }
    exports2.lte = lte;
    function lte(a, b, loose) {
      return compare(a, b, loose) <= 0;
    }
    exports2.cmp = cmp;
    function cmp(a, op, b, loose) {
      switch (op) {
        case "===":
          if (typeof a === "object")
            a = a.version;
          if (typeof b === "object")
            b = b.version;
          return a === b;
        case "!==":
          if (typeof a === "object")
            a = a.version;
          if (typeof b === "object")
            b = b.version;
          return a !== b;
        case "":
        case "=":
        case "==":
          return eq(a, b, loose);
        case "!=":
          return neq(a, b, loose);
        case ">":
          return gt(a, b, loose);
        case ">=":
          return gte(a, b, loose);
        case "<":
          return lt(a, b, loose);
        case "<=":
          return lte(a, b, loose);
        default:
          throw new TypeError("Invalid operator: " + op);
      }
    }
    exports2.Comparator = Comparator;
    function Comparator(comp, options) {
      if (!options || typeof options !== "object") {
        options = {
          loose: !!options,
          includePrerelease: false
        };
      }
      if (comp instanceof Comparator) {
        if (comp.loose === !!options.loose) {
          return comp;
        } else {
          comp = comp.value;
        }
      }
      if (!(this instanceof Comparator)) {
        return new Comparator(comp, options);
      }
      comp = comp.trim().split(/\s+/).join(" ");
      debug("comparator", comp, options);
      this.options = options;
      this.loose = !!options.loose;
      this.parse(comp);
      if (this.semver === ANY) {
        this.value = "";
      } else {
        this.value = this.operator + this.semver.version;
      }
      debug("comp", this);
    }
    var ANY = {};
    Comparator.prototype.parse = function(comp) {
      var r = this.options.loose ? safeRe[t.COMPARATORLOOSE] : safeRe[t.COMPARATOR];
      var m = comp.match(r);
      if (!m) {
        throw new TypeError("Invalid comparator: " + comp);
      }
      this.operator = m[1] !== void 0 ? m[1] : "";
      if (this.operator === "=") {
        this.operator = "";
      }
      if (!m[2]) {
        this.semver = ANY;
      } else {
        this.semver = new SemVer(m[2], this.options.loose);
      }
    };
    Comparator.prototype.toString = function() {
      return this.value;
    };
    Comparator.prototype.test = function(version) {
      debug("Comparator.test", version, this.options.loose);
      if (this.semver === ANY || version === ANY) {
        return true;
      }
      if (typeof version === "string") {
        try {
          version = new SemVer(version, this.options);
        } catch (er) {
          return false;
        }
      }
      return cmp(version, this.operator, this.semver, this.options);
    };
    Comparator.prototype.intersects = function(comp, options) {
      if (!(comp instanceof Comparator)) {
        throw new TypeError("a Comparator is required");
      }
      if (!options || typeof options !== "object") {
        options = {
          loose: !!options,
          includePrerelease: false
        };
      }
      var rangeTmp;
      if (this.operator === "") {
        if (this.value === "") {
          return true;
        }
        rangeTmp = new Range(comp.value, options);
        return satisfies(this.value, rangeTmp, options);
      } else if (comp.operator === "") {
        if (comp.value === "") {
          return true;
        }
        rangeTmp = new Range(this.value, options);
        return satisfies(comp.semver, rangeTmp, options);
      }
      var sameDirectionIncreasing = (this.operator === ">=" || this.operator === ">") && (comp.operator === ">=" || comp.operator === ">");
      var sameDirectionDecreasing = (this.operator === "<=" || this.operator === "<") && (comp.operator === "<=" || comp.operator === "<");
      var sameSemVer = this.semver.version === comp.semver.version;
      var differentDirectionsInclusive = (this.operator === ">=" || this.operator === "<=") && (comp.operator === ">=" || comp.operator === "<=");
      var oppositeDirectionsLessThan = cmp(this.semver, "<", comp.semver, options) && ((this.operator === ">=" || this.operator === ">") && (comp.operator === "<=" || comp.operator === "<"));
      var oppositeDirectionsGreaterThan = cmp(this.semver, ">", comp.semver, options) && ((this.operator === "<=" || this.operator === "<") && (comp.operator === ">=" || comp.operator === ">"));
      return sameDirectionIncreasing || sameDirectionDecreasing || sameSemVer && differentDirectionsInclusive || oppositeDirectionsLessThan || oppositeDirectionsGreaterThan;
    };
    exports2.Range = Range;
    function Range(range, options) {
      if (!options || typeof options !== "object") {
        options = {
          loose: !!options,
          includePrerelease: false
        };
      }
      if (range instanceof Range) {
        if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) {
          return range;
        } else {
          return new Range(range.raw, options);
        }
      }
      if (range instanceof Comparator) {
        return new Range(range.value, options);
      }
      if (!(this instanceof Range)) {
        return new Range(range, options);
      }
      this.options = options;
      this.loose = !!options.loose;
      this.includePrerelease = !!options.includePrerelease;
      this.raw = range.trim().split(/\s+/).join(" ");
      this.set = this.raw.split("||").map(function(range2) {
        return this.parseRange(range2.trim());
      }, this).filter(function(c) {
        return c.length;
      });
      if (!this.set.length) {
        throw new TypeError("Invalid SemVer Range: " + this.raw);
      }
      this.format();
    }
    Range.prototype.format = function() {
      this.range = this.set.map(function(comps) {
        return comps.join(" ").trim();
      }).join("||").trim();
      return this.range;
    };
    Range.prototype.toString = function() {
      return this.range;
    };
    Range.prototype.parseRange = function(range) {
      var loose = this.options.loose;
      var hr = loose ? safeRe[t.HYPHENRANGELOOSE] : safeRe[t.HYPHENRANGE];
      range = range.replace(hr, hyphenReplace);
      debug("hyphen replace", range);
      range = range.replace(safeRe[t.COMPARATORTRIM], comparatorTrimReplace);
      debug("comparator trim", range, safeRe[t.COMPARATORTRIM]);
      range = range.replace(safeRe[t.TILDETRIM], tildeTrimReplace);
      range = range.replace(safeRe[t.CARETTRIM], caretTrimReplace);
      range = range.split(/\s+/).join(" ");
      var compRe = loose ? safeRe[t.COMPARATORLOOSE] : safeRe[t.COMPARATOR];
      var set = range.split(" ").map(function(comp) {
        return parseComparator(comp, this.options);
      }, this).join(" ").split(/\s+/);
      if (this.options.loose) {
        set = set.filter(function(comp) {
          return !!comp.match(compRe);
        });
      }
      set = set.map(function(comp) {
        return new Comparator(comp, this.options);
      }, this);
      return set;
    };
    Range.prototype.intersects = function(range, options) {
      if (!(range instanceof Range)) {
        throw new TypeError("a Range is required");
      }
      return this.set.some(function(thisComparators) {
        return isSatisfiable(thisComparators, options) && range.set.some(function(rangeComparators) {
          return isSatisfiable(rangeComparators, options) && thisComparators.every(function(thisComparator) {
            return rangeComparators.every(function(rangeComparator) {
              return thisComparator.intersects(rangeComparator, options);
            });
          });
        });
      });
    };
    function isSatisfiable(comparators, options) {
      var result = true;
      var remainingComparators = comparators.slice();
      var testComparator = remainingComparators.pop();
      while (result && remainingComparators.length) {
        result = remainingComparators.every(function(otherComparator) {
          return testComparator.intersects(otherComparator, options);
        });
        testComparator = remainingComparators.pop();
      }
      return result;
    }
    exports2.toComparators = toComparators;
    function toComparators(range, options) {
      return new Range(range, options).set.map(function(comp) {
        return comp.map(function(c) {
          return c.value;
        }).join(" ").trim().split(" ");
      });
    }
    function parseComparator(comp, options) {
      debug("comp", comp, options);
      comp = replaceCarets(comp, options);
      debug("caret", comp);
      comp = replaceTildes(comp, options);
      debug("tildes", comp);
      comp = replaceXRanges(comp, options);
      debug("xrange", comp);
      comp = replaceStars(comp, options);
      debug("stars", comp);
      return comp;
    }
    function isX(id) {
      return !id || id.toLowerCase() === "x" || id === "*";
    }
    function replaceTildes(comp, options) {
      return comp.trim().split(/\s+/).map(function(comp2) {
        return replaceTilde(comp2, options);
      }).join(" ");
    }
    function replaceTilde(comp, options) {
      var r = options.loose ? safeRe[t.TILDELOOSE] : safeRe[t.TILDE];
      return comp.replace(r, function(_, M, m, p, pr) {
        debug("tilde", comp, _, M, m, p, pr);
        var ret;
        if (isX(M)) {
          ret = "";
        } else if (isX(m)) {
          ret = ">=" + M + ".0.0 <" + (+M + 1) + ".0.0";
        } else if (isX(p)) {
          ret = ">=" + M + "." + m + ".0 <" + M + "." + (+m + 1) + ".0";
        } else if (pr) {
          debug("replaceTilde pr", pr);
          ret = ">=" + M + "." + m + "." + p + "-" + pr + " <" + M + "." + (+m + 1) + ".0";
        } else {
          ret = ">=" + M + "." + m + "." + p + " <" + M + "." + (+m + 1) + ".0";
        }
        debug("tilde return", ret);
        return ret;
      });
    }
    function replaceCarets(comp, options) {
      return comp.trim().split(/\s+/).map(function(comp2) {
        return replaceCaret(comp2, options);
      }).join(" ");
    }
    function replaceCaret(comp, options) {
      debug("caret", comp, options);
      var r = options.loose ? safeRe[t.CARETLOOSE] : safeRe[t.CARET];
      return comp.replace(r, function(_, M, m, p, pr) {
        debug("caret", comp, _, M, m, p, pr);
        var ret;
        if (isX(M)) {
          ret = "";
        } else if (isX(m)) {
          ret = ">=" + M + ".0.0 <" + (+M + 1) + ".0.0";
        } else if (isX(p)) {
          if (M === "0") {
            ret = ">=" + M + "." + m + ".0 <" + M + "." + (+m + 1) + ".0";
          } else {
            ret = ">=" + M + "." + m + ".0 <" + (+M + 1) + ".0.0";
          }
        } else if (pr) {
          debug("replaceCaret pr", pr);
          if (M === "0") {
            if (m === "0") {
              ret = ">=" + M + "." + m + "." + p + "-" + pr + " <" + M + "." + m + "." + (+p + 1);
            } else {
              ret = ">=" + M + "." + m + "." + p + "-" + pr + " <" + M + "." + (+m + 1) + ".0";
            }
          } else {
            ret = ">=" + M + "." + m + "." + p + "-" + pr + " <" + (+M + 1) + ".0.0";
          }
        } else {
          debug("no pr");
          if (M === "0") {
            if (m === "0") {
              ret = ">=" + M + "." + m + "." + p + " <" + M + "." + m + "." + (+p + 1);
            } else {
              ret = ">=" + M + "." + m + "." + p + " <" + M + "." + (+m + 1) + ".0";
            }
          } else {
            ret = ">=" + M + "." + m + "." + p + " <" + (+M + 1) + ".0.0";
          }
        }
        debug("caret return", ret);
        return ret;
      });
    }
    function replaceXRanges(comp, options) {
      debug("replaceXRanges", comp, options);
      return comp.split(/\s+/).map(function(comp2) {
        return replaceXRange(comp2, options);
      }).join(" ");
    }
    function replaceXRange(comp, options) {
      comp = comp.trim();
      var r = options.loose ? safeRe[t.XRANGELOOSE] : safeRe[t.XRANGE];
      return comp.replace(r, function(ret, gtlt, M, m, p, pr) {
        debug("xRange", comp, ret, gtlt, M, m, p, pr);
        var xM = isX(M);
        var xm = xM || isX(m);
        var xp = xm || isX(p);
        var anyX = xp;
        if (gtlt === "=" && anyX) {
          gtlt = "";
        }
        pr = options.includePrerelease ? "-0" : "";
        if (xM) {
          if (gtlt === ">" || gtlt === "<") {
            ret = "<0.0.0-0";
          } else {
            ret = "*";
          }
        } else if (gtlt && anyX) {
          if (xm) {
            m = 0;
          }
          p = 0;
          if (gtlt === ">") {
            gtlt = ">=";
            if (xm) {
              M = +M + 1;
              m = 0;
              p = 0;
            } else {
              m = +m + 1;
              p = 0;
            }
          } else if (gtlt === "<=") {
            gtlt = "<";
            if (xm) {
              M = +M + 1;
            } else {
              m = +m + 1;
            }
          }
          ret = gtlt + M + "." + m + "." + p + pr;
        } else if (xm) {
          ret = ">=" + M + ".0.0" + pr + " <" + (+M + 1) + ".0.0" + pr;
        } else if (xp) {
          ret = ">=" + M + "." + m + ".0" + pr + " <" + M + "." + (+m + 1) + ".0" + pr;
        }
        debug("xRange return", ret);
        return ret;
      });
    }
    function replaceStars(comp, options) {
      debug("replaceStars", comp, options);
      return comp.trim().replace(safeRe[t.STAR], "");
    }
    function hyphenReplace($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr, tb) {
      if (isX(fM)) {
        from = "";
      } else if (isX(fm)) {
        from = ">=" + fM + ".0.0";
      } else if (isX(fp)) {
        from = ">=" + fM + "." + fm + ".0";
      } else {
        from = ">=" + from;
      }
      if (isX(tM)) {
        to = "";
      } else if (isX(tm)) {
        to = "<" + (+tM + 1) + ".0.0";
      } else if (isX(tp)) {
        to = "<" + tM + "." + (+tm + 1) + ".0";
      } else if (tpr) {
        to = "<=" + tM + "." + tm + "." + tp + "-" + tpr;
      } else {
        to = "<=" + to;
      }
      return (from + " " + to).trim();
    }
    Range.prototype.test = function(version) {
      if (!version) {
        return false;
      }
      if (typeof version === "string") {
        try {
          version = new SemVer(version, this.options);
        } catch (er) {
          return false;
        }
      }
      for (var i2 = 0; i2 < this.set.length; i2++) {
        if (testSet(this.set[i2], version, this.options)) {
          return true;
        }
      }
      return false;
    };
    function testSet(set, version, options) {
      for (var i2 = 0; i2 < set.length; i2++) {
        if (!set[i2].test(version)) {
          return false;
        }
      }
      if (version.prerelease.length && !options.includePrerelease) {
        for (i2 = 0; i2 < set.length; i2++) {
          debug(set[i2].semver);
          if (set[i2].semver === ANY) {
            continue;
          }
          if (set[i2].semver.prerelease.length > 0) {
            var allowed = set[i2].semver;
            if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) {
              return true;
            }
          }
        }
        return false;
      }
      return true;
    }
    exports2.satisfies = satisfies;
    function satisfies(version, range, options) {
      try {
        range = new Range(range, options);
      } catch (er) {
        return false;
      }
      return range.test(version);
    }
    exports2.maxSatisfying = maxSatisfying;
    function maxSatisfying(versions, range, options) {
      var max = null;
      var maxSV = null;
      try {
        var rangeObj = new Range(range, options);
      } catch (er) {
        return null;
      }
      versions.forEach(function(v) {
        if (rangeObj.test(v)) {
          if (!max || maxSV.compare(v) === -1) {
            max = v;
            maxSV = new SemVer(max, options);
          }
        }
      });
      return max;
    }
    exports2.minSatisfying = minSatisfying;
    function minSatisfying(versions, range, options) {
      var min = null;
      var minSV = null;
      try {
        var rangeObj = new Range(range, options);
      } catch (er) {
        return null;
      }
      versions.forEach(function(v) {
        if (rangeObj.test(v)) {
          if (!min || minSV.compare(v) === 1) {
            min = v;
            minSV = new SemVer(min, options);
          }
        }
      });
      return min;
    }
    exports2.minVersion = minVersion;
    function minVersion(range, loose) {
      range = new Range(range, loose);
      var minver = new SemVer("0.0.0");
      if (range.test(minver)) {
        return minver;
      }
      minver = new SemVer("0.0.0-0");
      if (range.test(minver)) {
        return minver;
      }
      minver = null;
      for (var i2 = 0; i2 < range.set.length; ++i2) {
        var comparators = range.set[i2];
        comparators.forEach(function(comparator) {
          var compver = new SemVer(comparator.semver.version);
          switch (comparator.operator) {
            case ">":
              if (compver.prerelease.length === 0) {
                compver.patch++;
              } else {
                compver.prerelease.push(0);
              }
              compver.raw = compver.format();
            /* fallthrough */
            case "":
            case ">=":
              if (!minver || gt(minver, compver)) {
                minver = compver;
              }
              break;
            case "<":
            case "<=":
              break;
            /* istanbul ignore next */
            default:
              throw new Error("Unexpected operation: " + comparator.operator);
          }
        });
      }
      if (minver && range.test(minver)) {
        return minver;
      }
      return null;
    }
    exports2.validRange = validRange;
    function validRange(range, options) {
      try {
        return new Range(range, options).range || "*";
      } catch (er) {
        return null;
      }
    }
    exports2.ltr = ltr;
    function ltr(version, range, options) {
      return outside(version, range, "<", options);
    }
    exports2.gtr = gtr;
    function gtr(version, range, options) {
      return outside(version, range, ">", options);
    }
    exports2.outside = outside;
    function outside(version, range, hilo, options) {
      version = new SemVer(version, options);
      range = new Range(range, options);
      var gtfn, ltefn, ltfn, comp, ecomp;
      switch (hilo) {
        case ">":
          gtfn = gt;
          ltefn = lte;
          ltfn = lt;
          comp = ">";
          ecomp = ">=";
          break;
        case "<":
          gtfn = lt;
          ltefn = gte;
          ltfn = gt;
          comp = "<";
          ecomp = "<=";
          break;
        default:
          throw new TypeError('Must provide a hilo val of "<" or ">"');
      }
      if (satisfies(version, range, options)) {
        return false;
      }
      for (var i2 = 0; i2 < range.set.length; ++i2) {
        var comparators = range.set[i2];
        var high = null;
        var low = null;
        comparators.forEach(function(comparator) {
          if (comparator.semver === ANY) {
            comparator = new Comparator(">=0.0.0");
          }
          high = high || comparator;
          low = low || comparator;
          if (gtfn(comparator.semver, high.semver, options)) {
            high = comparator;
          } else if (ltfn(comparator.semver, low.semver, options)) {
            low = comparator;
          }
        });
        if (high.operator === comp || high.operator === ecomp) {
          return false;
        }
        if ((!low.operator || low.operator === comp) && ltefn(version, low.semver)) {
          return false;
        } else if (low.operator === ecomp && ltfn(version, low.semver)) {
          return false;
        }
      }
      return true;
    }
    exports2.prerelease = prerelease;
    function prerelease(version, options) {
      var parsed = parse2(version, options);
      return parsed && parsed.prerelease.length ? parsed.prerelease : null;
    }
    exports2.intersects = intersects;
    function intersects(r1, r2, options) {
      r1 = new Range(r1, options);
      r2 = new Range(r2, options);
      return r1.intersects(r2);
    }
    exports2.coerce = coerce;
    function coerce(version, options) {
      if (version instanceof SemVer) {
        return version;
      }
      if (typeof version === "number") {
        version = String(version);
      }
      if (typeof version !== "string") {
        return null;
      }
      options = options || {};
      var match = null;
      if (!options.rtl) {
        match = version.match(safeRe[t.COERCE]);
      } else {
        var next;
        while ((next = safeRe[t.COERCERTL].exec(version)) && (!match || match.index + match[0].length !== version.length)) {
          if (!match || next.index + next[0].length !== match.index + match[0].length) {
            match = next;
          }
          safeRe[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length;
        }
        safeRe[t.COERCERTL].lastIndex = -1;
      }
      if (match === null) {
        return null;
      }
      return parse2(match[2] + "." + (match[3] || "0") + "." + (match[4] || "0"), options);
    }
  }
});

// node_modules/@babel/helper-module-imports/lib/import-builder.js
var require_import_builder = __commonJS({
  "node_modules/@babel/helper-module-imports/lib/import-builder.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = void 0;
    var _assert = require("assert");
    var _t = require_lib3();
    var {
      callExpression,
      cloneNode,
      expressionStatement,
      identifier,
      importDeclaration,
      importDefaultSpecifier,
      importNamespaceSpecifier,
      importSpecifier,
      memberExpression,
      stringLiteral,
      variableDeclaration,
      variableDeclarator
    } = _t;
    var ImportBuilder = class {
      constructor(importedSource, scope, hub) {
        this._statements = [];
        this._resultName = null;
        this._importedSource = void 0;
        this._scope = scope;
        this._hub = hub;
        this._importedSource = importedSource;
      }
      done() {
        return {
          statements: this._statements,
          resultName: this._resultName
        };
      }
      import() {
        this._statements.push(importDeclaration([], stringLiteral(this._importedSource)));
        return this;
      }
      require() {
        this._statements.push(expressionStatement(callExpression(identifier("require"), [stringLiteral(this._importedSource)])));
        return this;
      }
      namespace(name = "namespace") {
        const local = this._scope.generateUidIdentifier(name);
        const statement = this._statements[this._statements.length - 1];
        _assert(statement.type === "ImportDeclaration");
        _assert(statement.specifiers.length === 0);
        statement.specifiers = [importNamespaceSpecifier(local)];
        this._resultName = cloneNode(local);
        return this;
      }
      default(name) {
        const id = this._scope.generateUidIdentifier(name);
        const statement = this._statements[this._statements.length - 1];
        _assert(statement.type === "ImportDeclaration");
        _assert(statement.specifiers.length === 0);
        statement.specifiers = [importDefaultSpecifier(id)];
        this._resultName = cloneNode(id);
        return this;
      }
      named(name, importName) {
        if (importName === "default") return this.default(name);
        const id = this._scope.generateUidIdentifier(name);
        const statement = this._statements[this._statements.length - 1];
        _assert(statement.type === "ImportDeclaration");
        _assert(statement.specifiers.length === 0);
        statement.specifiers = [importSpecifier(id, identifier(importName))];
        this._resultName = cloneNode(id);
        return this;
      }
      var(name) {
        const id = this._scope.generateUidIdentifier(name);
        let statement = this._statements[this._statements.length - 1];
        if (statement.type !== "ExpressionStatement") {
          _assert(this._resultName);
          statement = expressionStatement(this._resultName);
          this._statements.push(statement);
        }
        this._statements[this._statements.length - 1] = variableDeclaration("var", [variableDeclarator(id, statement.expression)]);
        this._resultName = cloneNode(id);
        return this;
      }
      defaultInterop() {
        return this._interop(this._hub.addHelper("interopRequireDefault"));
      }
      wildcardInterop() {
        return this._interop(this._hub.addHelper("interopRequireWildcard"));
      }
      _interop(callee) {
        const statement = this._statements[this._statements.length - 1];
        if (statement.type === "ExpressionStatement") {
          statement.expression = callExpression(callee, [statement.expression]);
        } else if (statement.type === "VariableDeclaration") {
          _assert(statement.declarations.length === 1);
          statement.declarations[0].init = callExpression(callee, [statement.declarations[0].init]);
        } else {
          _assert.fail("Unexpected type.");
        }
        return this;
      }
      prop(name) {
        const statement = this._statements[this._statements.length - 1];
        if (statement.type === "ExpressionStatement") {
          statement.expression = memberExpression(statement.expression, identifier(name));
        } else if (statement.type === "VariableDeclaration") {
          _assert(statement.declarations.length === 1);
          statement.declarations[0].init = memberExpression(statement.declarations[0].init, identifier(name));
        } else {
          _assert.fail("Unexpected type:" + statement.type);
        }
        return this;
      }
      read(name) {
        this._resultName = memberExpression(this._resultName, identifier(name));
      }
    };
    exports2.default = ImportBuilder;
  }
});

// node_modules/@babel/helper-module-imports/lib/is-module.js
var require_is_module = __commonJS({
  "node_modules/@babel/helper-module-imports/lib/is-module.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = isModule;
    function isModule(path) {
      return path.node.sourceType === "module";
    }
  }
});

// node_modules/@babel/helper-module-imports/lib/import-injector.js
var require_import_injector = __commonJS({
  "node_modules/@babel/helper-module-imports/lib/import-injector.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = void 0;
    var _assert = require("assert");
    var _t = require_lib3();
    var _importBuilder = require_import_builder();
    var _isModule = require_is_module();
    var {
      identifier,
      importSpecifier,
      numericLiteral,
      sequenceExpression,
      isImportDeclaration
    } = _t;
    var ImportInjector = class {
      constructor(path, importedSource, opts) {
        this._defaultOpts = {
          importedSource: null,
          importedType: "commonjs",
          importedInterop: "babel",
          importingInterop: "babel",
          ensureLiveReference: false,
          ensureNoContext: false,
          importPosition: "before"
        };
        const programPath = path.find((p) => p.isProgram());
        this._programPath = programPath;
        this._programScope = programPath.scope;
        this._hub = programPath.hub;
        this._defaultOpts = this._applyDefaults(importedSource, opts, true);
      }
      addDefault(importedSourceIn, opts) {
        return this.addNamed("default", importedSourceIn, opts);
      }
      addNamed(importName, importedSourceIn, opts) {
        _assert(typeof importName === "string");
        return this._generateImport(this._applyDefaults(importedSourceIn, opts), importName);
      }
      addNamespace(importedSourceIn, opts) {
        return this._generateImport(this._applyDefaults(importedSourceIn, opts), null);
      }
      addSideEffect(importedSourceIn, opts) {
        return this._generateImport(this._applyDefaults(importedSourceIn, opts), void 0);
      }
      _applyDefaults(importedSource, opts, isInit = false) {
        let newOpts;
        if (typeof importedSource === "string") {
          newOpts = Object.assign({}, this._defaultOpts, {
            importedSource
          }, opts);
        } else {
          _assert(!opts, "Unexpected secondary arguments.");
          newOpts = Object.assign({}, this._defaultOpts, importedSource);
        }
        if (!isInit && opts) {
          if (opts.nameHint !== void 0) newOpts.nameHint = opts.nameHint;
          if (opts.blockHoist !== void 0) newOpts.blockHoist = opts.blockHoist;
        }
        return newOpts;
      }
      _generateImport(opts, importName) {
        const isDefault = importName === "default";
        const isNamed = !!importName && !isDefault;
        const isNamespace = importName === null;
        const {
          importedSource,
          importedType,
          importedInterop,
          importingInterop,
          ensureLiveReference,
          ensureNoContext,
          nameHint,
          importPosition,
          blockHoist
        } = opts;
        let name = nameHint || importName;
        const isMod = (0, _isModule.default)(this._programPath);
        const isModuleForNode = isMod && importingInterop === "node";
        const isModuleForBabel = isMod && importingInterop === "babel";
        if (importPosition === "after" && !isMod) {
          throw new Error(`"importPosition": "after" is only supported in modules`);
        }
        const builder = new _importBuilder.default(importedSource, this._programScope, this._hub);
        if (importedType === "es6") {
          if (!isModuleForNode && !isModuleForBabel) {
            throw new Error("Cannot import an ES6 module from CommonJS");
          }
          builder.import();
          if (isNamespace) {
            builder.namespace(nameHint || importedSource);
          } else if (isDefault || isNamed) {
            builder.named(name, importName);
          }
        } else if (importedType !== "commonjs") {
          throw new Error(`Unexpected interopType "${importedType}"`);
        } else if (importedInterop === "babel") {
          if (isModuleForNode) {
            name = name !== "default" ? name : importedSource;
            const es6Default = `${importedSource}$es6Default`;
            builder.import();
            if (isNamespace) {
              builder.default(es6Default).var(name || importedSource).wildcardInterop();
            } else if (isDefault) {
              if (ensureLiveReference) {
                builder.default(es6Default).var(name || importedSource).defaultInterop().read("default");
              } else {
                builder.default(es6Default).var(name).defaultInterop().prop(importName);
              }
            } else if (isNamed) {
              builder.default(es6Default).read(importName);
            }
          } else if (isModuleForBabel) {
            builder.import();
            if (isNamespace) {
              builder.namespace(name || importedSource);
            } else if (isDefault || isNamed) {
              builder.named(name, importName);
            }
          } else {
            builder.require();
            if (isNamespace) {
              builder.var(name || importedSource).wildcardInterop();
            } else if ((isDefault || isNamed) && ensureLiveReference) {
              if (isDefault) {
                name = name !== "default" ? name : importedSource;
                builder.var(name).read(importName);
                builder.defaultInterop();
              } else {
                builder.var(importedSource).read(importName);
              }
            } else if (isDefault) {
              builder.var(name).defaultInterop().prop(importName);
            } else if (isNamed) {
              builder.var(name).prop(importName);
            }
          }
        } else if (importedInterop === "compiled") {
          if (isModuleForNode) {
            builder.import();
            if (isNamespace) {
              builder.default(name || importedSource);
            } else if (isDefault || isNamed) {
              builder.default(importedSource).read(name);
            }
          } else if (isModuleForBabel) {
            builder.import();
            if (isNamespace) {
              builder.namespace(name || importedSource);
            } else if (isDefault || isNamed) {
              builder.named(name, importName);
            }
          } else {
            builder.require();
            if (isNamespace) {
              builder.var(name || importedSource);
            } else if (isDefault || isNamed) {
              if (ensureLiveReference) {
                builder.var(importedSource).read(name);
              } else {
                builder.prop(importName).var(name);
              }
            }
          }
        } else if (importedInterop === "uncompiled") {
          if (isDefault && ensureLiveReference) {
            throw new Error("No live reference for commonjs default");
          }
          if (isModuleForNode) {
            builder.import();
            if (isNamespace) {
              builder.default(name || importedSource);
            } else if (isDefault) {
              builder.default(name);
            } else if (isNamed) {
              builder.default(importedSource).read(name);
            }
          } else if (isModuleForBabel) {
            builder.import();
            if (isNamespace) {
              builder.default(name || importedSource);
            } else if (isDefault) {
              builder.default(name);
            } else if (isNamed) {
              builder.named(name, importName);
            }
          } else {
            builder.require();
            if (isNamespace) {
              builder.var(name || importedSource);
            } else if (isDefault) {
              builder.var(name);
            } else if (isNamed) {
              if (ensureLiveReference) {
                builder.var(importedSource).read(name);
              } else {
                builder.var(name).prop(importName);
              }
            }
          }
        } else {
          throw new Error(`Unknown importedInterop "${importedInterop}".`);
        }
        const {
          statements,
          resultName
        } = builder.done();
        this._insertStatements(statements, importPosition, blockHoist);
        if ((isDefault || isNamed) && ensureNoContext && resultName.type !== "Identifier") {
          return sequenceExpression([numericLiteral(0), resultName]);
        }
        return resultName;
      }
      _insertStatements(statements, importPosition = "before", blockHoist = 3) {
        if (importPosition === "after") {
          if (this._insertStatementsAfter(statements)) return;
        } else {
          if (this._insertStatementsBefore(statements, blockHoist)) return;
        }
        this._programPath.unshiftContainer("body", statements);
      }
      _insertStatementsBefore(statements, blockHoist) {
        if (statements.length === 1 && isImportDeclaration(statements[0]) && isValueImport(statements[0])) {
          const firstImportDecl = this._programPath.get("body").find((p) => {
            return p.isImportDeclaration() && isValueImport(p.node);
          });
          if ((firstImportDecl == null ? void 0 : firstImportDecl.node.source.value) === statements[0].source.value && maybeAppendImportSpecifiers(firstImportDecl.node, statements[0])) {
            return true;
          }
        }
        statements.forEach((node) => {
          node._blockHoist = blockHoist;
        });
        const targetPath = this._programPath.get("body").find((p) => {
          const val = p.node._blockHoist;
          return Number.isFinite(val) && val < 4;
        });
        if (targetPath) {
          targetPath.insertBefore(statements);
          return true;
        }
        return false;
      }
      _insertStatementsAfter(statements) {
        const statementsSet = new Set(statements);
        const importDeclarations = /* @__PURE__ */ new Map();
        for (const statement of statements) {
          if (isImportDeclaration(statement) && isValueImport(statement)) {
            const source = statement.source.value;
            if (!importDeclarations.has(source)) importDeclarations.set(source, []);
            importDeclarations.get(source).push(statement);
          }
        }
        let lastImportPath = null;
        for (const bodyStmt of this._programPath.get("body")) {
          if (bodyStmt.isImportDeclaration() && isValueImport(bodyStmt.node)) {
            lastImportPath = bodyStmt;
            const source = bodyStmt.node.source.value;
            const newImports = importDeclarations.get(source);
            if (!newImports) continue;
            for (const decl of newImports) {
              if (!statementsSet.has(decl)) continue;
              if (maybeAppendImportSpecifiers(bodyStmt.node, decl)) {
                statementsSet.delete(decl);
              }
            }
          }
        }
        if (statementsSet.size === 0) return true;
        if (lastImportPath) lastImportPath.insertAfter(Array.from(statementsSet));
        return !!lastImportPath;
      }
    };
    exports2.default = ImportInjector;
    function isValueImport(node) {
      return node.importKind !== "type" && node.importKind !== "typeof";
    }
    function hasNamespaceImport(node) {
      return node.specifiers.length === 1 && node.specifiers[0].type === "ImportNamespaceSpecifier" || node.specifiers.length === 2 && node.specifiers[1].type === "ImportNamespaceSpecifier";
    }
    function hasDefaultImport(node) {
      return node.specifiers.length > 0 && node.specifiers[0].type === "ImportDefaultSpecifier";
    }
    function maybeAppendImportSpecifiers(target, source) {
      if (!target.specifiers.length) {
        target.specifiers = source.specifiers;
        return true;
      }
      if (!source.specifiers.length) return true;
      if (hasNamespaceImport(target) || hasNamespaceImport(source)) return false;
      if (hasDefaultImport(source)) {
        if (hasDefaultImport(target)) {
          source.specifiers[0] = importSpecifier(source.specifiers[0].local, identifier("default"));
        } else {
          target.specifiers.unshift(source.specifiers.shift());
        }
      }
      target.specifiers.push(...source.specifiers);
      return true;
    }
  }
});

// node_modules/@babel/helper-module-imports/lib/index.js
var require_lib10 = __commonJS({
  "node_modules/@babel/helper-module-imports/lib/index.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    Object.defineProperty(exports2, "ImportInjector", {
      enumerable: true,
      get: function() {
        return _importInjector.default;
      }
    });
    exports2.addDefault = addDefault;
    exports2.addNamed = addNamed;
    exports2.addNamespace = addNamespace;
    exports2.addSideEffect = addSideEffect;
    Object.defineProperty(exports2, "isModule", {
      enumerable: true,
      get: function() {
        return _isModule.default;
      }
    });
    var _importInjector = require_import_injector();
    var _isModule = require_is_module();
    function addDefault(path, importedSource, opts) {
      return new _importInjector.default(path).addDefault(importedSource, opts);
    }
    function addNamed(path, name, importedSource, opts) {
      return new _importInjector.default(path).addNamed(name, importedSource, opts);
    }
    function addNamespace(path, importedSource, opts) {
      return new _importInjector.default(path).addNamespace(importedSource, opts);
    }
    function addSideEffect(path, importedSource, opts) {
      return new _importInjector.default(path).addSideEffect(importedSource, opts);
    }
  }
});

// node_modules/@babel/helper-module-transforms/lib/rewrite-this.js
var require_rewrite_this = __commonJS({
  "node_modules/@babel/helper-module-transforms/lib/rewrite-this.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = rewriteThis;
    var _core = require_lib27();
    var _traverse = require_lib9();
    var rewriteThisVisitor;
    function rewriteThis(programPath) {
      if (!rewriteThisVisitor) {
        rewriteThisVisitor = _traverse.visitors.environmentVisitor({
          ThisExpression(path) {
            path.replaceWith(_core.types.unaryExpression("void", _core.types.numericLiteral(0), true));
          }
        });
        rewriteThisVisitor.noScope = true;
      }
      (0, _traverse.default)(programPath.node, rewriteThisVisitor);
    }
  }
});

// node_modules/@babel/helper-module-transforms/lib/rewrite-live-references.js
var require_rewrite_live_references = __commonJS({
  "node_modules/@babel/helper-module-transforms/lib/rewrite-live-references.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = rewriteLiveReferences;
    var _core = require_lib27();
    function isInType(path) {
      do {
        switch (path.parent.type) {
          case "TSTypeAnnotation":
          case "TSTypeAliasDeclaration":
          case "TSTypeReference":
          case "TypeAnnotation":
          case "TypeAlias":
            return true;
          case "ExportSpecifier":
            return path.parentPath.parent.exportKind === "type";
          default:
            if (path.parentPath.isStatement() || path.parentPath.isExpression()) {
              return false;
            }
        }
      } while (path = path.parentPath);
    }
    function rewriteLiveReferences(programPath, metadata, wrapReference) {
      const imported = /* @__PURE__ */ new Map();
      const exported = /* @__PURE__ */ new Map();
      const requeueInParent = (path) => {
        programPath.requeue(path);
      };
      for (const [source, data] of metadata.source) {
        for (const [localName, importName] of data.imports) {
          imported.set(localName, [source, importName, null]);
        }
        for (const localName of data.importsNamespace) {
          imported.set(localName, [source, null, localName]);
        }
      }
      for (const [local, data] of metadata.local) {
        let exportMeta = exported.get(local);
        if (!exportMeta) {
          exportMeta = [];
          exported.set(local, exportMeta);
        }
        exportMeta.push(...data.names);
      }
      const rewriteBindingInitVisitorState = {
        metadata,
        requeueInParent,
        scope: programPath.scope,
        exported
      };
      programPath.traverse(rewriteBindingInitVisitor, rewriteBindingInitVisitorState);
      const rewriteReferencesVisitorState = {
        seen: /* @__PURE__ */ new WeakSet(),
        metadata,
        requeueInParent,
        scope: programPath.scope,
        imported,
        exported,
        buildImportReference([source, importName, localName], identNode) {
          const meta = metadata.source.get(source);
          meta.referenced = true;
          if (localName) {
            if (meta.wrap) {
              var _wrapReference;
              identNode = (_wrapReference = wrapReference(identNode, meta.wrap)) != null ? _wrapReference : identNode;
            }
            return identNode;
          }
          let namespace = _core.types.identifier(meta.name);
          if (meta.wrap) {
            var _wrapReference2;
            namespace = (_wrapReference2 = wrapReference(namespace, meta.wrap)) != null ? _wrapReference2 : namespace;
          }
          if (importName === "default" && meta.interop === "node-default") {
            return namespace;
          }
          const computed = metadata.stringSpecifiers.has(importName);
          return _core.types.memberExpression(namespace, computed ? _core.types.stringLiteral(importName) : _core.types.identifier(importName), computed);
        }
      };
      programPath.traverse(rewriteReferencesVisitor, rewriteReferencesVisitorState);
    }
    var rewriteBindingInitVisitor = {
      Scope(path) {
        path.skip();
      },
      ClassDeclaration(path) {
        const {
          requeueInParent,
          exported,
          metadata
        } = this;
        const {
          id
        } = path.node;
        if (!id) throw new Error("Expected class to have a name");
        const localName = id.name;
        const exportNames = exported.get(localName) || [];
        if (exportNames.length > 0) {
          const statement = _core.types.expressionStatement(buildBindingExportAssignmentExpression(metadata, exportNames, _core.types.identifier(localName), path.scope));
          statement._blockHoist = path.node._blockHoist;
          requeueInParent(path.insertAfter(statement)[0]);
        }
      },
      VariableDeclaration(path) {
        const {
          requeueInParent,
          exported,
          metadata
        } = this;
        const isVar = path.node.kind === "var";
        for (const decl of path.get("declarations")) {
          const {
            id
          } = decl.node;
          let {
            init
          } = decl.node;
          if (_core.types.isIdentifier(id) && exported.has(id.name) && !_core.types.isArrowFunctionExpression(init) && (!_core.types.isFunctionExpression(init) || init.id) && (!_core.types.isClassExpression(init) || init.id)) {
            if (!init) {
              if (isVar) {
                continue;
              } else {
                init = path.scope.buildUndefinedNode();
              }
            }
            decl.node.init = buildBindingExportAssignmentExpression(metadata, exported.get(id.name), init, path.scope);
            requeueInParent(decl.get("init"));
          } else {
            for (const localName of Object.keys(decl.getOuterBindingIdentifiers())) {
              if (exported.has(localName)) {
                const statement = _core.types.expressionStatement(buildBindingExportAssignmentExpression(metadata, exported.get(localName), _core.types.identifier(localName), path.scope));
                statement._blockHoist = path.node._blockHoist;
                requeueInParent(path.insertAfter(statement)[0]);
              }
            }
          }
        }
      }
    };
    var buildBindingExportAssignmentExpression = (metadata, exportNames, localExpr, scope) => {
      const exportsObjectName = metadata.exportName;
      for (let currentScope = scope; currentScope != null; currentScope = currentScope.parent) {
        if (currentScope.hasOwnBinding(exportsObjectName)) {
          currentScope.rename(exportsObjectName);
        }
      }
      return (exportNames || []).reduce((expr, exportName) => {
        const {
          stringSpecifiers
        } = metadata;
        const computed = stringSpecifiers.has(exportName);
        return _core.types.assignmentExpression("=", _core.types.memberExpression(_core.types.identifier(exportsObjectName), computed ? _core.types.stringLiteral(exportName) : _core.types.identifier(exportName), computed), expr);
      }, localExpr);
    };
    var buildImportThrow = (localName) => {
      return _core.template.expression.ast`
    (function() {
      throw new Error('"' + '${localName}' + '" is read-only.');
    })()
  `;
    };
    var rewriteReferencesVisitor = {
      ReferencedIdentifier(path) {
        const {
          seen,
          buildImportReference,
          scope,
          imported,
          requeueInParent
        } = this;
        if (seen.has(path.node)) return;
        seen.add(path.node);
        const localName = path.node.name;
        const importData = imported.get(localName);
        if (importData) {
          if (isInType(path)) {
            throw path.buildCodeFrameError(`Cannot transform the imported binding "${localName}" since it's also used in a type annotation. Please strip type annotations using @babel/preset-typescript or @babel/preset-flow.`);
          }
          const localBinding = path.scope.getBinding(localName);
          const rootBinding = scope.getBinding(localName);
          if (rootBinding !== localBinding) return;
          const ref = buildImportReference(importData, path.node);
          ref.loc = path.node.loc;
          if ((path.parentPath.isCallExpression({
            callee: path.node
          }) || path.parentPath.isOptionalCallExpression({
            callee: path.node
          }) || path.parentPath.isTaggedTemplateExpression({
            tag: path.node
          })) && _core.types.isMemberExpression(ref)) {
            path.replaceWith(_core.types.sequenceExpression([_core.types.numericLiteral(0), ref]));
          } else if (path.isJSXIdentifier() && _core.types.isMemberExpression(ref)) {
            const {
              object,
              property
            } = ref;
            path.replaceWith(_core.types.jsxMemberExpression(_core.types.jsxIdentifier(object.name), _core.types.jsxIdentifier(property.name)));
          } else {
            path.replaceWith(ref);
          }
          requeueInParent(path);
          path.skip();
        }
      },
      UpdateExpression(path) {
        const {
          scope,
          seen,
          imported,
          exported,
          requeueInParent,
          buildImportReference
        } = this;
        if (seen.has(path.node)) return;
        seen.add(path.node);
        const arg = path.get("argument");
        if (arg.isMemberExpression()) return;
        const update = path.node;
        if (arg.isIdentifier()) {
          const localName = arg.node.name;
          if (scope.getBinding(localName) !== path.scope.getBinding(localName)) {
            return;
          }
          const exportedNames = exported.get(localName);
          const importData = imported.get(localName);
          if ((exportedNames == null ? void 0 : exportedNames.length) > 0 || importData) {
            if (importData) {
              path.replaceWith(_core.types.assignmentExpression(update.operator[0] + "=", buildImportReference(importData, arg.node), buildImportThrow(localName)));
            } else if (update.prefix) {
              path.replaceWith(buildBindingExportAssignmentExpression(this.metadata, exportedNames, _core.types.cloneNode(update), path.scope));
            } else {
              const ref = scope.generateDeclaredUidIdentifier(localName);
              path.replaceWith(_core.types.sequenceExpression([_core.types.assignmentExpression("=", _core.types.cloneNode(ref), _core.types.cloneNode(update)), buildBindingExportAssignmentExpression(this.metadata, exportedNames, _core.types.identifier(localName), path.scope), _core.types.cloneNode(ref)]));
            }
          }
        }
        requeueInParent(path);
        path.skip();
      },
      AssignmentExpression: {
        exit(path) {
          const {
            scope,
            seen,
            imported,
            exported,
            requeueInParent,
            buildImportReference
          } = this;
          if (seen.has(path.node)) return;
          seen.add(path.node);
          const left = path.get("left");
          if (left.isMemberExpression()) return;
          if (left.isIdentifier()) {
            const localName = left.node.name;
            if (scope.getBinding(localName) !== path.scope.getBinding(localName)) {
              return;
            }
            const exportedNames = exported.get(localName);
            const importData = imported.get(localName);
            if ((exportedNames == null ? void 0 : exportedNames.length) > 0 || importData) {
              const assignment = path.node;
              if (importData) {
                assignment.left = buildImportReference(importData, left.node);
                assignment.right = _core.types.sequenceExpression([assignment.right, buildImportThrow(localName)]);
              }
              const {
                operator
              } = assignment;
              let newExpr;
              if (operator === "=") {
                newExpr = assignment;
              } else if (operator === "&&=" || operator === "||=" || operator === "??=") {
                newExpr = _core.types.assignmentExpression("=", assignment.left, _core.types.logicalExpression(operator.slice(0, -1), _core.types.cloneNode(assignment.left), assignment.right));
              } else {
                newExpr = _core.types.assignmentExpression("=", assignment.left, _core.types.binaryExpression(operator.slice(0, -1), _core.types.cloneNode(assignment.left), assignment.right));
              }
              path.replaceWith(buildBindingExportAssignmentExpression(this.metadata, exportedNames, newExpr, path.scope));
              requeueInParent(path);
              path.skip();
            }
          } else {
            const ids = left.getOuterBindingIdentifiers();
            const programScopeIds = Object.keys(ids).filter((localName) => scope.getBinding(localName) === path.scope.getBinding(localName));
            const id = programScopeIds.find((localName) => imported.has(localName));
            if (id) {
              path.node.right = _core.types.sequenceExpression([path.node.right, buildImportThrow(id)]);
            }
            const items = [];
            programScopeIds.forEach((localName) => {
              const exportedNames = exported.get(localName) || [];
              if (exportedNames.length > 0) {
                items.push(buildBindingExportAssignmentExpression(this.metadata, exportedNames, _core.types.identifier(localName), path.scope));
              }
            });
            if (items.length > 0) {
              let node = _core.types.sequenceExpression(items);
              if (path.parentPath.isExpressionStatement()) {
                node = _core.types.expressionStatement(node);
                node._blockHoist = path.parentPath.node._blockHoist;
              }
              const statement = path.insertAfter(node)[0];
              requeueInParent(statement);
            }
          }
        }
      },
      ForXStatement(path) {
        const {
          scope,
          node
        } = path;
        const {
          left
        } = node;
        const {
          exported,
          imported,
          scope: programScope
        } = this;
        if (!_core.types.isVariableDeclaration(left)) {
          let didTransformExport = false, importConstViolationName;
          const loopBodyScope = path.get("body").scope;
          for (const name of Object.keys(_core.types.getOuterBindingIdentifiers(left))) {
            if (programScope.getBinding(name) === scope.getBinding(name)) {
              if (exported.has(name)) {
                didTransformExport = true;
                if (loopBodyScope.hasOwnBinding(name)) {
                  loopBodyScope.rename(name);
                }
              }
              if (imported.has(name) && !importConstViolationName) {
                importConstViolationName = name;
              }
            }
          }
          if (!didTransformExport && !importConstViolationName) {
            return;
          }
          path.ensureBlock();
          const bodyPath = path.get("body");
          const newLoopId = scope.generateUidIdentifierBasedOnNode(left);
          path.get("left").replaceWith(_core.types.variableDeclaration("let", [_core.types.variableDeclarator(_core.types.cloneNode(newLoopId))]));
          scope.registerDeclaration(path.get("left"));
          if (didTransformExport) {
            bodyPath.unshiftContainer("body", _core.types.expressionStatement(_core.types.assignmentExpression("=", left, newLoopId)));
          }
          if (importConstViolationName) {
            bodyPath.unshiftContainer("body", _core.types.expressionStatement(buildImportThrow(importConstViolationName)));
          }
        }
      }
    };
  }
});

// node_modules/@babel/helper-module-transforms/lib/normalize-and-load-metadata.js
var require_normalize_and_load_metadata = __commonJS({
  "node_modules/@babel/helper-module-transforms/lib/normalize-and-load-metadata.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = normalizeModuleAndLoadMetadata;
    exports2.hasExports = hasExports;
    exports2.isSideEffectImport = isSideEffectImport;
    exports2.validateImportInteropOption = validateImportInteropOption;
    var _path = require("path");
    var _helperValidatorIdentifier = require_lib();
    function hasExports(metadata) {
      return metadata.hasExports;
    }
    function isSideEffectImport(source) {
      return source.imports.size === 0 && source.importsNamespace.size === 0 && source.reexports.size === 0 && source.reexportNamespace.size === 0 && !source.reexportAll;
    }
    function validateImportInteropOption(importInterop) {
      if (typeof importInterop !== "function" && importInterop !== "none" && importInterop !== "babel" && importInterop !== "node") {
        throw new Error(`.importInterop must be one of "none", "babel", "node", or a function returning one of those values (received ${importInterop}).`);
      }
      return importInterop;
    }
    function resolveImportInterop(importInterop, source, filename) {
      if (typeof importInterop === "function") {
        return validateImportInteropOption(importInterop(source, filename));
      }
      return importInterop;
    }
    function normalizeModuleAndLoadMetadata(programPath, exportName, {
      importInterop,
      initializeReexports = false,
      getWrapperPayload,
      esNamespaceOnly = false,
      filename
    }) {
      if (!exportName) {
        exportName = programPath.scope.generateUidIdentifier("exports").name;
      }
      const stringSpecifiers = /* @__PURE__ */ new Set();
      nameAnonymousExports(programPath);
      const {
        local,
        sources,
        hasExports: hasExports2
      } = getModuleMetadata(programPath, {
        initializeReexports,
        getWrapperPayload
      }, stringSpecifiers);
      removeImportExportDeclarations(programPath);
      for (const [source, metadata] of sources) {
        const {
          importsNamespace,
          imports
        } = metadata;
        if (importsNamespace.size > 0 && imports.size === 0) {
          const [nameOfnamespace] = importsNamespace;
          metadata.name = nameOfnamespace;
        }
        const resolvedInterop = resolveImportInterop(importInterop, source, filename);
        if (resolvedInterop === "none") {
          metadata.interop = "none";
        } else if (resolvedInterop === "node" && metadata.interop === "namespace") {
          metadata.interop = "node-namespace";
        } else if (resolvedInterop === "node" && metadata.interop === "default") {
          metadata.interop = "node-default";
        } else if (esNamespaceOnly && metadata.interop === "namespace") {
          metadata.interop = "default";
        }
      }
      return {
        exportName,
        exportNameListName: null,
        hasExports: hasExports2,
        local,
        source: sources,
        stringSpecifiers
      };
    }
    function getExportSpecifierName(path, stringSpecifiers) {
      if (path.isIdentifier()) {
        return path.node.name;
      } else if (path.isStringLiteral()) {
        const stringValue = path.node.value;
        if (!(0, _helperValidatorIdentifier.isIdentifierName)(stringValue)) {
          stringSpecifiers.add(stringValue);
        }
        return stringValue;
      } else {
        throw new Error(`Expected export specifier to be either Identifier or StringLiteral, got ${path.node.type}`);
      }
    }
    function assertExportSpecifier(path) {
      if (path.isExportSpecifier()) {
        return;
      } else if (path.isExportNamespaceSpecifier()) {
        throw path.buildCodeFrameError("Export namespace should be first transformed by `@babel/plugin-transform-export-namespace-from`.");
      } else {
        throw path.buildCodeFrameError("Unexpected export specifier type");
      }
    }
    function getModuleMetadata(programPath, {
      getWrapperPayload,
      initializeReexports
    }, stringSpecifiers) {
      const localData = getLocalExportMetadata(programPath, initializeReexports, stringSpecifiers);
      const importNodes = /* @__PURE__ */ new Map();
      const sourceData = /* @__PURE__ */ new Map();
      const getData = (sourceNode, node) => {
        const source = sourceNode.value;
        let data = sourceData.get(source);
        if (!data) {
          data = {
            name: programPath.scope.generateUidIdentifier((0, _path.basename)(source, (0, _path.extname)(source))).name,
            interop: "none",
            loc: null,
            imports: /* @__PURE__ */ new Map(),
            importsNamespace: /* @__PURE__ */ new Set(),
            reexports: /* @__PURE__ */ new Map(),
            reexportNamespace: /* @__PURE__ */ new Set(),
            reexportAll: null,
            wrap: null,
            get lazy() {
              return this.wrap === "lazy";
            },
            referenced: false
          };
          sourceData.set(source, data);
          importNodes.set(source, [node]);
        } else {
          importNodes.get(source).push(node);
        }
        return data;
      };
      let hasExports2 = false;
      programPath.get("body").forEach((child) => {
        if (child.isImportDeclaration()) {
          const data = getData(child.node.source, child.node);
          if (!data.loc) data.loc = child.node.loc;
          child.get("specifiers").forEach((spec) => {
            if (spec.isImportDefaultSpecifier()) {
              const localName = spec.get("local").node.name;
              data.imports.set(localName, "default");
              const reexport = localData.get(localName);
              if (reexport) {
                localData.delete(localName);
                reexport.names.forEach((name) => {
                  data.reexports.set(name, "default");
                });
                data.referenced = true;
              }
            } else if (spec.isImportNamespaceSpecifier()) {
              const localName = spec.get("local").node.name;
              data.importsNamespace.add(localName);
              const reexport = localData.get(localName);
              if (reexport) {
                localData.delete(localName);
                reexport.names.forEach((name) => {
                  data.reexportNamespace.add(name);
                });
                data.referenced = true;
              }
            } else if (spec.isImportSpecifier()) {
              const importName = getExportSpecifierName(spec.get("imported"), stringSpecifiers);
              const localName = spec.get("local").node.name;
              data.imports.set(localName, importName);
              const reexport = localData.get(localName);
              if (reexport) {
                localData.delete(localName);
                reexport.names.forEach((name) => {
                  data.reexports.set(name, importName);
                });
                data.referenced = true;
              }
            }
          });
        } else if (child.isExportAllDeclaration()) {
          hasExports2 = true;
          const data = getData(child.node.source, child.node);
          if (!data.loc) data.loc = child.node.loc;
          data.reexportAll = {
            loc: child.node.loc
          };
          data.referenced = true;
        } else if (child.isExportNamedDeclaration() && child.node.source) {
          hasExports2 = true;
          const data = getData(child.node.source, child.node);
          if (!data.loc) data.loc = child.node.loc;
          child.get("specifiers").forEach((spec) => {
            assertExportSpecifier(spec);
            const importName = getExportSpecifierName(spec.get("local"), stringSpecifiers);
            const exportName = getExportSpecifierName(spec.get("exported"), stringSpecifiers);
            data.reexports.set(exportName, importName);
            data.referenced = true;
            if (exportName === "__esModule") {
              throw spec.get("exported").buildCodeFrameError('Illegal export "__esModule".');
            }
          });
        } else if (child.isExportNamedDeclaration() || child.isExportDefaultDeclaration()) {
          hasExports2 = true;
        }
      });
      for (const metadata of sourceData.values()) {
        let needsDefault = false;
        let needsNamed = false;
        if (metadata.importsNamespace.size > 0) {
          needsDefault = true;
          needsNamed = true;
        }
        if (metadata.reexportAll) {
          needsNamed = true;
        }
        for (const importName of metadata.imports.values()) {
          if (importName === "default") needsDefault = true;
          else needsNamed = true;
        }
        for (const importName of metadata.reexports.values()) {
          if (importName === "default") needsDefault = true;
          else needsNamed = true;
        }
        if (needsDefault && needsNamed) {
          metadata.interop = "namespace";
        } else if (needsDefault) {
          metadata.interop = "default";
        }
      }
      if (getWrapperPayload) {
        for (const [source, metadata] of sourceData) {
          metadata.wrap = getWrapperPayload(source, metadata, importNodes.get(source));
        }
      }
      return {
        hasExports: hasExports2,
        local: localData,
        sources: sourceData
      };
    }
    function getLocalExportMetadata(programPath, initializeReexports, stringSpecifiers) {
      const bindingKindLookup = /* @__PURE__ */ new Map();
      const programScope = programPath.scope;
      const programChildren = programPath.get("body");
      programChildren.forEach((child) => {
        let kind;
        if (child.isImportDeclaration()) {
          kind = "import";
        } else {
          if (child.isExportDefaultDeclaration()) {
            child = child.get("declaration");
          }
          if (child.isExportNamedDeclaration()) {
            if (child.node.declaration) {
              child = child.get("declaration");
            } else if (initializeReexports && child.node.source && child.get("source").isStringLiteral()) {
              child.get("specifiers").forEach((spec) => {
                assertExportSpecifier(spec);
                bindingKindLookup.set(spec.get("local").node.name, "block");
              });
              return;
            }
          }
          if (child.isFunctionDeclaration()) {
            kind = "hoisted";
          } else if (child.isClassDeclaration()) {
            kind = "block";
          } else if (child.isVariableDeclaration({
            kind: "var"
          })) {
            kind = "var";
          } else if (child.isVariableDeclaration()) {
            kind = "block";
          } else {
            return;
          }
        }
        Object.keys(child.getOuterBindingIdentifiers()).forEach((name) => {
          bindingKindLookup.set(name, kind);
        });
      });
      const localMetadata = /* @__PURE__ */ new Map();
      const getLocalMetadata = (idPath) => {
        const localName = idPath.node.name;
        let metadata = localMetadata.get(localName);
        if (!metadata) {
          var _bindingKindLookup$ge, _programScope$getBind;
          const kind = (_bindingKindLookup$ge = bindingKindLookup.get(localName)) != null ? _bindingKindLookup$ge : (_programScope$getBind = programScope.getBinding(localName)) == null ? void 0 : _programScope$getBind.kind;
          if (kind === void 0) {
            throw idPath.buildCodeFrameError(`Exporting local "${localName}", which is not declared.`);
          }
          metadata = {
            names: [],
            kind
          };
          localMetadata.set(localName, metadata);
        }
        return metadata;
      };
      programChildren.forEach((child) => {
        if (child.isExportNamedDeclaration() && (initializeReexports || !child.node.source)) {
          if (child.node.declaration) {
            const declaration = child.get("declaration");
            const ids = declaration.getOuterBindingIdentifierPaths();
            Object.keys(ids).forEach((name) => {
              if (name === "__esModule") {
                throw declaration.buildCodeFrameError('Illegal export "__esModule".');
              }
              getLocalMetadata(ids[name]).names.push(name);
            });
          } else {
            child.get("specifiers").forEach((spec) => {
              const local = spec.get("local");
              const exported = spec.get("exported");
              const localMetadata2 = getLocalMetadata(local);
              const exportName = getExportSpecifierName(exported, stringSpecifiers);
              if (exportName === "__esModule") {
                throw exported.buildCodeFrameError('Illegal export "__esModule".');
              }
              localMetadata2.names.push(exportName);
            });
          }
        } else if (child.isExportDefaultDeclaration()) {
          const declaration = child.get("declaration");
          if (declaration.isFunctionDeclaration() || declaration.isClassDeclaration()) {
            getLocalMetadata(declaration.get("id")).names.push("default");
          } else {
            throw declaration.buildCodeFrameError("Unexpected default expression export.");
          }
        }
      });
      return localMetadata;
    }
    function nameAnonymousExports(programPath) {
      programPath.get("body").forEach((child) => {
        var _child$splitExportDec;
        if (!child.isExportDefaultDeclaration()) return;
        (_child$splitExportDec = child.splitExportDeclaration) != null ? _child$splitExportDec : child.splitExportDeclaration = require_lib9().NodePath.prototype.splitExportDeclaration;
        child.splitExportDeclaration();
      });
    }
    function removeImportExportDeclarations(programPath) {
      programPath.get("body").forEach((child) => {
        if (child.isImportDeclaration()) {
          child.remove();
        } else if (child.isExportNamedDeclaration()) {
          if (child.node.declaration) {
            child.node.declaration._blockHoist = child.node._blockHoist;
            child.replaceWith(child.node.declaration);
          } else {
            child.remove();
          }
        } else if (child.isExportDefaultDeclaration()) {
          const declaration = child.get("declaration");
          if (declaration.isFunctionDeclaration() || declaration.isClassDeclaration()) {
            declaration._blockHoist = child.node._blockHoist;
            child.replaceWith(declaration);
          } else {
            throw declaration.buildCodeFrameError("Unexpected default expression export.");
          }
        } else if (child.isExportAllDeclaration()) {
          child.remove();
        }
      });
    }
  }
});

// node_modules/@babel/helper-module-transforms/lib/lazy-modules.js
var require_lazy_modules = __commonJS({
  "node_modules/@babel/helper-module-transforms/lib/lazy-modules.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.toGetWrapperPayload = toGetWrapperPayload;
    exports2.wrapReference = wrapReference;
    var _core = require_lib27();
    var _normalizeAndLoadMetadata = require_normalize_and_load_metadata();
    function toGetWrapperPayload(lazy) {
      return (source, metadata) => {
        if (lazy === false) return null;
        if ((0, _normalizeAndLoadMetadata.isSideEffectImport)(metadata) || metadata.reexportAll) return null;
        if (lazy === true) {
          return source.includes(".") ? null : "lazy";
        }
        if (Array.isArray(lazy)) {
          return !lazy.includes(source) ? null : "lazy";
        }
        if (typeof lazy === "function") {
          return lazy(source) ? "lazy" : null;
        }
        throw new Error(`.lazy must be a boolean, string array, or function`);
      };
    }
    function wrapReference(ref, payload) {
      if (payload === "lazy") return _core.types.callExpression(ref, []);
      return null;
    }
  }
});

// node_modules/@babel/helper-module-transforms/lib/dynamic-import.js
var require_dynamic_import = __commonJS({
  "node_modules/@babel/helper-module-transforms/lib/dynamic-import.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.buildDynamicImport = buildDynamicImport;
    var _core = require_lib27();
    exports2.getDynamicImportSource = function getDynamicImportSource(node) {
      const [source] = node.arguments;
      return _core.types.isStringLiteral(source) || _core.types.isTemplateLiteral(source) ? source : _core.template.expression.ast`\`\${${source}}\``;
    };
    function buildDynamicImport(node, deferToThen, wrapWithPromise, builder) {
      const specifier = _core.types.isCallExpression(node) ? node.arguments[0] : node.source;
      if (_core.types.isStringLiteral(specifier) || _core.types.isTemplateLiteral(specifier) && specifier.quasis.length === 0) {
        if (deferToThen) {
          return _core.template.expression.ast`
        Promise.resolve().then(() => ${builder(specifier)})
      `;
        } else return builder(specifier);
      }
      const specifierToString = _core.types.isTemplateLiteral(specifier) ? _core.types.identifier("specifier") : _core.types.templateLiteral([_core.types.templateElement({
        raw: ""
      }), _core.types.templateElement({
        raw: ""
      })], [_core.types.identifier("specifier")]);
      if (deferToThen) {
        return _core.template.expression.ast`
      (specifier =>
        new Promise(r => r(${specifierToString}))
          .then(s => ${builder(_core.types.identifier("s"))})
      )(${specifier})
    `;
      } else if (wrapWithPromise) {
        return _core.template.expression.ast`
      (specifier =>
        new Promise(r => r(${builder(specifierToString)}))
      )(${specifier})
    `;
      } else {
        return _core.template.expression.ast`
      (specifier => ${builder(specifierToString)})(${specifier})
    `;
      }
    }
  }
});

// node_modules/@babel/helper-module-transforms/lib/get-module-name.js
var require_get_module_name = __commonJS({
  "node_modules/@babel/helper-module-transforms/lib/get-module-name.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = getModuleName;
    var originalGetModuleName = getModuleName;
    exports2.default = getModuleName = function getModuleName2(rootOpts, pluginOpts) {
      var _pluginOpts$moduleId, _pluginOpts$moduleIds, _pluginOpts$getModule, _pluginOpts$moduleRoo;
      return originalGetModuleName(rootOpts, {
        moduleId: (_pluginOpts$moduleId = pluginOpts.moduleId) != null ? _pluginOpts$moduleId : rootOpts.moduleId,
        moduleIds: (_pluginOpts$moduleIds = pluginOpts.moduleIds) != null ? _pluginOpts$moduleIds : rootOpts.moduleIds,
        getModuleId: (_pluginOpts$getModule = pluginOpts.getModuleId) != null ? _pluginOpts$getModule : rootOpts.getModuleId,
        moduleRoot: (_pluginOpts$moduleRoo = pluginOpts.moduleRoot) != null ? _pluginOpts$moduleRoo : rootOpts.moduleRoot
      });
    };
    function getModuleName(rootOpts, pluginOpts) {
      const {
        filename,
        filenameRelative = filename,
        sourceRoot = pluginOpts.moduleRoot
      } = rootOpts;
      const {
        moduleId,
        moduleIds = !!moduleId,
        getModuleId,
        moduleRoot = sourceRoot
      } = pluginOpts;
      if (!moduleIds) return null;
      if (moduleId != null && !getModuleId) {
        return moduleId;
      }
      let moduleName = moduleRoot != null ? moduleRoot + "/" : "";
      if (filenameRelative) {
        const sourceRootReplacer = sourceRoot != null ? new RegExp("^" + sourceRoot + "/?") : "";
        moduleName += filenameRelative.replace(sourceRootReplacer, "").replace(/\.\w*$/, "");
      }
      moduleName = moduleName.replace(/\\/g, "/");
      if (getModuleId) {
        return getModuleId(moduleName) || moduleName;
      } else {
        return moduleName;
      }
    }
  }
});

// node_modules/@babel/helper-module-transforms/lib/index.js
var require_lib11 = __commonJS({
  "node_modules/@babel/helper-module-transforms/lib/index.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    Object.defineProperty(exports2, "buildDynamicImport", {
      enumerable: true,
      get: function() {
        return _dynamicImport.buildDynamicImport;
      }
    });
    exports2.buildNamespaceInitStatements = buildNamespaceInitStatements;
    exports2.ensureStatementsHoisted = ensureStatementsHoisted;
    Object.defineProperty(exports2, "getModuleName", {
      enumerable: true,
      get: function() {
        return _getModuleName.default;
      }
    });
    Object.defineProperty(exports2, "hasExports", {
      enumerable: true,
      get: function() {
        return _normalizeAndLoadMetadata.hasExports;
      }
    });
    Object.defineProperty(exports2, "isModule", {
      enumerable: true,
      get: function() {
        return _helperModuleImports.isModule;
      }
    });
    Object.defineProperty(exports2, "isSideEffectImport", {
      enumerable: true,
      get: function() {
        return _normalizeAndLoadMetadata.isSideEffectImport;
      }
    });
    exports2.rewriteModuleStatementsAndPrepareHeader = rewriteModuleStatementsAndPrepareHeader;
    Object.defineProperty(exports2, "rewriteThis", {
      enumerable: true,
      get: function() {
        return _rewriteThis.default;
      }
    });
    exports2.wrapInterop = wrapInterop;
    var _assert = require("assert");
    var _core = require_lib27();
    var _helperModuleImports = require_lib10();
    var _rewriteThis = require_rewrite_this();
    var _rewriteLiveReferences = require_rewrite_live_references();
    var _normalizeAndLoadMetadata = require_normalize_and_load_metadata();
    var Lazy = require_lazy_modules();
    var _dynamicImport = require_dynamic_import();
    var _getModuleName = require_get_module_name();
    exports2.getDynamicImportSource = require_dynamic_import().getDynamicImportSource;
    function rewriteModuleStatementsAndPrepareHeader(path, {
      exportName,
      strict,
      allowTopLevelThis,
      strictMode,
      noInterop,
      importInterop = noInterop ? "none" : "babel",
      lazy,
      getWrapperPayload = Lazy.toGetWrapperPayload(lazy != null ? lazy : false),
      wrapReference = Lazy.wrapReference,
      esNamespaceOnly,
      filename,
      constantReexports = arguments[1].loose,
      enumerableModuleMeta = arguments[1].loose,
      noIncompleteNsImportDetection
    }) {
      (0, _normalizeAndLoadMetadata.validateImportInteropOption)(importInterop);
      _assert((0, _helperModuleImports.isModule)(path), "Cannot process module statements in a script");
      path.node.sourceType = "script";
      const meta = (0, _normalizeAndLoadMetadata.default)(path, exportName, {
        importInterop,
        initializeReexports: constantReexports,
        getWrapperPayload,
        esNamespaceOnly,
        filename
      });
      if (!allowTopLevelThis) {
        (0, _rewriteThis.default)(path);
      }
      (0, _rewriteLiveReferences.default)(path, meta, wrapReference);
      if (strictMode !== false) {
        const hasStrict = path.node.directives.some((directive) => {
          return directive.value.value === "use strict";
        });
        if (!hasStrict) {
          path.unshiftContainer("directives", _core.types.directive(_core.types.directiveLiteral("use strict")));
        }
      }
      const headers = [];
      if ((0, _normalizeAndLoadMetadata.hasExports)(meta) && !strict) {
        headers.push(buildESModuleHeader(meta, enumerableModuleMeta));
      }
      const nameList = buildExportNameListDeclaration(path, meta);
      if (nameList) {
        meta.exportNameListName = nameList.name;
        headers.push(nameList.statement);
      }
      headers.push(...buildExportInitializationStatements(path, meta, wrapReference, constantReexports, noIncompleteNsImportDetection));
      return {
        meta,
        headers
      };
    }
    function ensureStatementsHoisted(statements) {
      statements.forEach((header) => {
        header._blockHoist = 3;
      });
    }
    function wrapInterop(programPath, expr, type) {
      if (type === "none") {
        return null;
      }
      if (type === "node-namespace") {
        return _core.types.callExpression(programPath.hub.addHelper("interopRequireWildcard"), [expr, _core.types.booleanLiteral(true)]);
      } else if (type === "node-default") {
        return null;
      }
      let helper;
      if (type === "default") {
        helper = "interopRequireDefault";
      } else if (type === "namespace") {
        helper = "interopRequireWildcard";
      } else {
        throw new Error(`Unknown interop: ${type}`);
      }
      return _core.types.callExpression(programPath.hub.addHelper(helper), [expr]);
    }
    function buildNamespaceInitStatements(metadata, sourceMetadata, constantReexports = false, wrapReference = Lazy.wrapReference) {
      var _wrapReference;
      const statements = [];
      const srcNamespaceId = _core.types.identifier(sourceMetadata.name);
      for (const localName of sourceMetadata.importsNamespace) {
        if (localName === sourceMetadata.name) continue;
        statements.push(_core.template.statement`var NAME = SOURCE;`({
          NAME: localName,
          SOURCE: _core.types.cloneNode(srcNamespaceId)
        }));
      }
      const srcNamespace = (_wrapReference = wrapReference(srcNamespaceId, sourceMetadata.wrap)) != null ? _wrapReference : srcNamespaceId;
      if (constantReexports) {
        statements.push(...buildReexportsFromMeta(metadata, sourceMetadata, true, wrapReference));
      }
      for (const exportName of sourceMetadata.reexportNamespace) {
        statements.push((!_core.types.isIdentifier(srcNamespace) ? _core.template.statement`
            Object.defineProperty(EXPORTS, "NAME", {
              enumerable: true,
              get: function() {
                return NAMESPACE;
              }
            });
          ` : _core.template.statement`EXPORTS.NAME = NAMESPACE;`)({
          EXPORTS: metadata.exportName,
          NAME: exportName,
          NAMESPACE: _core.types.cloneNode(srcNamespace)
        }));
      }
      if (sourceMetadata.reexportAll) {
        const statement = buildNamespaceReexport(metadata, _core.types.cloneNode(srcNamespace), constantReexports);
        statement.loc = sourceMetadata.reexportAll.loc;
        statements.push(statement);
      }
      return statements;
    }
    var ReexportTemplate = {
      constant: ({
        exports: exports3,
        exportName,
        namespaceImport
      }) => _core.template.statement.ast`
      ${exports3}.${exportName} = ${namespaceImport};
    `,
      constantComputed: ({
        exports: exports3,
        exportName,
        namespaceImport
      }) => _core.template.statement.ast`
      ${exports3}["${exportName}"] = ${namespaceImport};
    `,
      spec: ({
        exports: exports3,
        exportName,
        namespaceImport
      }) => _core.template.statement.ast`
      Object.defineProperty(${exports3}, "${exportName}", {
        enumerable: true,
        get: function() {
          return ${namespaceImport};
        },
      });
    `
    };
    function buildReexportsFromMeta(meta, metadata, constantReexports, wrapReference) {
      var _wrapReference2;
      let namespace = _core.types.identifier(metadata.name);
      namespace = (_wrapReference2 = wrapReference(namespace, metadata.wrap)) != null ? _wrapReference2 : namespace;
      const {
        stringSpecifiers
      } = meta;
      return Array.from(metadata.reexports, ([exportName, importName]) => {
        let namespaceImport = _core.types.cloneNode(namespace);
        if (importName === "default" && metadata.interop === "node-default") {
        } else if (stringSpecifiers.has(importName)) {
          namespaceImport = _core.types.memberExpression(namespaceImport, _core.types.stringLiteral(importName), true);
        } else {
          namespaceImport = _core.types.memberExpression(namespaceImport, _core.types.identifier(importName));
        }
        const astNodes = {
          exports: meta.exportName,
          exportName,
          namespaceImport
        };
        if (constantReexports || _core.types.isIdentifier(namespaceImport)) {
          if (stringSpecifiers.has(exportName)) {
            return ReexportTemplate.constantComputed(astNodes);
          } else {
            return ReexportTemplate.constant(astNodes);
          }
        } else {
          return ReexportTemplate.spec(astNodes);
        }
      });
    }
    function buildESModuleHeader(metadata, enumerableModuleMeta = false) {
      return (enumerableModuleMeta ? _core.template.statement`
        EXPORTS.__esModule = true;
      ` : _core.template.statement`
        Object.defineProperty(EXPORTS, "__esModule", {
          value: true,
        });
      `)({
        EXPORTS: metadata.exportName
      });
    }
    function buildNamespaceReexport(metadata, namespace, constantReexports) {
      return (constantReexports ? _core.template.statement`
        Object.keys(NAMESPACE).forEach(function(key) {
          if (key === "default" || key === "__esModule") return;
          VERIFY_NAME_LIST;
          if (key in EXPORTS && EXPORTS[key] === NAMESPACE[key]) return;

          EXPORTS[key] = NAMESPACE[key];
        });
      ` : _core.template.statement`
        Object.keys(NAMESPACE).forEach(function(key) {
          if (key === "default" || key === "__esModule") return;
          VERIFY_NAME_LIST;
          if (key in EXPORTS && EXPORTS[key] === NAMESPACE[key]) return;

          Object.defineProperty(EXPORTS, key, {
            enumerable: true,
            get: function() {
              return NAMESPACE[key];
            },
          });
        });
    `)({
        NAMESPACE: namespace,
        EXPORTS: metadata.exportName,
        VERIFY_NAME_LIST: metadata.exportNameListName ? (0, _core.template)`
            if (Object.prototype.hasOwnProperty.call(EXPORTS_LIST, key)) return;
          `({
          EXPORTS_LIST: metadata.exportNameListName
        }) : null
      });
    }
    function buildExportNameListDeclaration(programPath, metadata) {
      const exportedVars = /* @__PURE__ */ Object.create(null);
      for (const data of metadata.local.values()) {
        for (const name2 of data.names) {
          exportedVars[name2] = true;
        }
      }
      let hasReexport = false;
      for (const data of metadata.source.values()) {
        for (const exportName of data.reexports.keys()) {
          exportedVars[exportName] = true;
        }
        for (const exportName of data.reexportNamespace) {
          exportedVars[exportName] = true;
        }
        hasReexport = hasReexport || !!data.reexportAll;
      }
      if (!hasReexport || Object.keys(exportedVars).length === 0) return null;
      const name = programPath.scope.generateUidIdentifier("exportNames");
      delete exportedVars.default;
      return {
        name: name.name,
        statement: _core.types.variableDeclaration("var", [_core.types.variableDeclarator(name, _core.types.valueToNode(exportedVars))])
      };
    }
    function buildExportInitializationStatements(programPath, metadata, wrapReference, constantReexports = false, noIncompleteNsImportDetection = false) {
      const initStatements = [];
      for (const [localName, data] of metadata.local) {
        if (data.kind === "import") {
        } else if (data.kind === "hoisted") {
          initStatements.push([data.names[0], buildInitStatement(metadata, data.names, _core.types.identifier(localName))]);
        } else if (!noIncompleteNsImportDetection) {
          for (const exportName of data.names) {
            initStatements.push([exportName, null]);
          }
        }
      }
      for (const data of metadata.source.values()) {
        if (!constantReexports) {
          const reexportsStatements = buildReexportsFromMeta(metadata, data, false, wrapReference);
          const reexports = [...data.reexports.keys()];
          for (let i = 0; i < reexportsStatements.length; i++) {
            initStatements.push([reexports[i], reexportsStatements[i]]);
          }
        }
        if (!noIncompleteNsImportDetection) {
          for (const exportName of data.reexportNamespace) {
            initStatements.push([exportName, null]);
          }
        }
      }
      initStatements.sort(([a], [b]) => {
        if (a < b) return -1;
        if (b < a) return 1;
        return 0;
      });
      const results = [];
      if (noIncompleteNsImportDetection) {
        for (const [, initStatement] of initStatements) {
          results.push(initStatement);
        }
      } else {
        const chunkSize = 100;
        for (let i = 0; i < initStatements.length; i += chunkSize) {
          let uninitializedExportNames = [];
          for (let j = 0; j < chunkSize && i + j < initStatements.length; j++) {
            const [exportName, initStatement] = initStatements[i + j];
            if (initStatement !== null) {
              if (uninitializedExportNames.length > 0) {
                results.push(buildInitStatement(metadata, uninitializedExportNames, programPath.scope.buildUndefinedNode()));
                uninitializedExportNames = [];
              }
              results.push(initStatement);
            } else {
              uninitializedExportNames.push(exportName);
            }
          }
          if (uninitializedExportNames.length > 0) {
            results.push(buildInitStatement(metadata, uninitializedExportNames, programPath.scope.buildUndefinedNode()));
          }
        }
      }
      return results;
    }
    var InitTemplate = {
      computed: ({
        exports: exports3,
        name,
        value: value2
      }) => _core.template.expression.ast`${exports3}["${name}"] = ${value2}`,
      default: ({
        exports: exports3,
        name,
        value: value2
      }) => _core.template.expression.ast`${exports3}.${name} = ${value2}`,
      define: ({
        exports: exports3,
        name,
        value: value2
      }) => _core.template.expression.ast`
      Object.defineProperty(${exports3}, "${name}", {
        enumerable: true,
        value: void 0,
        writable: true
      })["${name}"] = ${value2}`
    };
    function buildInitStatement(metadata, exportNames, initExpr) {
      const {
        stringSpecifiers,
        exportName: exports3
      } = metadata;
      return _core.types.expressionStatement(exportNames.reduce((value2, name) => {
        const params = {
          exports: exports3,
          name,
          value: value2
        };
        if (name === "__proto__") {
          return InitTemplate.define(params);
        }
        if (stringSpecifiers.has(name)) {
          return InitTemplate.computed(params);
        }
        return InitTemplate.default(params);
      }, initExpr));
    }
  }
});

// node_modules/@babel/core/lib/transformation/file/babel-7-helpers.cjs
var require_babel_7_helpers = __commonJS({
  "node_modules/@babel/core/lib/transformation/file/babel-7-helpers.cjs"(exports2) {
    {
      exports2.getModuleName = () => require_lib11().getModuleName;
    }
  }
});

// node_modules/@babel/core/lib/transformation/file/file.js
var require_file = __commonJS({
  "node_modules/@babel/core/lib/transformation/file/file.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = void 0;
    function helpers() {
      const data = require_lib7();
      helpers = function() {
        return data;
      };
      return data;
    }
    function _traverse() {
      const data = require_lib9();
      _traverse = function() {
        return data;
      };
      return data;
    }
    function _codeFrame() {
      const data = require_lib5();
      _codeFrame = function() {
        return data;
      };
      return data;
    }
    function _t() {
      const data = require_lib3();
      _t = function() {
        return data;
      };
      return data;
    }
    function _semver() {
      const data = require_semver();
      _semver = function() {
        return data;
      };
      return data;
    }
    var _babel7Helpers = require_babel_7_helpers();
    var {
      cloneNode,
      interpreterDirective
    } = _t();
    var errorVisitor = {
      enter(path, state) {
        const loc = path.node.loc;
        if (loc) {
          state.loc = loc;
          path.stop();
        }
      }
    };
    var File = class {
      constructor(options, {
        code,
        ast,
        inputMap
      }) {
        this._map = /* @__PURE__ */ new Map();
        this.opts = void 0;
        this.declarations = {};
        this.path = void 0;
        this.ast = void 0;
        this.scope = void 0;
        this.metadata = {};
        this.code = "";
        this.inputMap = void 0;
        this.hub = {
          file: this,
          getCode: () => this.code,
          getScope: () => this.scope,
          addHelper: this.addHelper.bind(this),
          buildError: this.buildCodeFrameError.bind(this)
        };
        this.opts = options;
        this.code = code;
        this.ast = ast;
        this.inputMap = inputMap;
        this.path = _traverse().NodePath.get({
          hub: this.hub,
          parentPath: null,
          parent: this.ast,
          container: this.ast,
          key: "program"
        }).setContext();
        this.scope = this.path.scope;
      }
      get shebang() {
        const {
          interpreter
        } = this.path.node;
        return interpreter ? interpreter.value : "";
      }
      set shebang(value2) {
        if (value2) {
          this.path.get("interpreter").replaceWith(interpreterDirective(value2));
        } else {
          this.path.get("interpreter").remove();
        }
      }
      set(key, val) {
        {
          if (key === "helpersNamespace") {
            throw new Error("Babel 7.0.0-beta.56 has dropped support for the 'helpersNamespace' utility.If you are using @babel/plugin-external-helpers you will need to use a newer version than the one you currently have installed. If you have your own implementation, you'll want to explore using 'helperGenerator' alongside 'file.availableHelper()'.");
          }
        }
        this._map.set(key, val);
      }
      get(key) {
        return this._map.get(key);
      }
      has(key) {
        return this._map.has(key);
      }
      availableHelper(name, versionRange) {
        if (helpers().isInternal(name)) return false;
        let minVersion;
        try {
          minVersion = helpers().minVersion(name);
        } catch (err) {
          if (err.code !== "BABEL_HELPER_UNKNOWN") throw err;
          return false;
        }
        if (typeof versionRange !== "string") return true;
        if (_semver().valid(versionRange)) versionRange = `^${versionRange}`;
        {
          return !_semver().intersects(`<${minVersion}`, versionRange) && !_semver().intersects(`>=8.0.0`, versionRange);
        }
      }
      addHelper(name) {
        if (helpers().isInternal(name)) {
          throw new Error("Cannot use internal helper " + name);
        }
        return this._addHelper(name);
      }
      _addHelper(name) {
        const declar = this.declarations[name];
        if (declar) return cloneNode(declar);
        const generator = this.get("helperGenerator");
        if (generator) {
          const res = generator(name);
          if (res) return res;
        }
        helpers().minVersion(name);
        const uid = this.declarations[name] = this.scope.generateUidIdentifier(name);
        const dependencies = {};
        for (const dep of helpers().getDependencies(name)) {
          dependencies[dep] = this._addHelper(dep);
        }
        const {
          nodes,
          globals
        } = helpers().get(name, (dep) => dependencies[dep], uid.name, Object.keys(this.scope.getAllBindings()));
        globals.forEach((name2) => {
          if (this.path.scope.hasBinding(name2, true)) {
            this.path.scope.rename(name2);
          }
        });
        nodes.forEach((node) => {
          node._compact = true;
        });
        const added = this.path.unshiftContainer("body", nodes);
        for (const path of added) {
          if (path.isVariableDeclaration()) this.scope.registerDeclaration(path);
        }
        return uid;
      }
      buildCodeFrameError(node, msg, _Error = SyntaxError) {
        let loc = node == null ? void 0 : node.loc;
        if (!loc && node) {
          const state = {
            loc: null
          };
          (0, _traverse().default)(node, errorVisitor, this.scope, state);
          loc = state.loc;
          let txt = "This is an error on an internal node. Probably an internal error.";
          if (loc) txt += " Location has been estimated.";
          msg += ` (${txt})`;
        }
        if (loc) {
          const {
            highlightCode = true
          } = this.opts;
          msg += "\n" + (0, _codeFrame().codeFrameColumns)(this.code, {
            start: {
              line: loc.start.line,
              column: loc.start.column + 1
            },
            end: loc.end && loc.start.line === loc.end.line ? {
              line: loc.end.line,
              column: loc.end.column + 1
            } : void 0
          }, {
            highlightCode
          });
        }
        return new _Error(msg);
      }
    };
    exports2.default = File;
    {
      File.prototype.addImport = function addImport() {
        throw new Error("This API has been removed. If you're looking for this functionality in Babel 7, you should import the '@babel/helper-module-imports' module and use the functions exposed  from that module, such as 'addNamed' or 'addDefault'.");
      };
      File.prototype.addTemplateObject = function addTemplateObject() {
        throw new Error("This function has been moved into the template literal transform itself.");
      };
      {
        File.prototype.getModuleName = function getModuleName() {
          return _babel7Helpers.getModuleName()(this.opts, this.opts);
        };
      }
    }
  }
});

// node_modules/@babel/core/lib/tools/build-external-helpers.js
var require_build_external_helpers = __commonJS({
  "node_modules/@babel/core/lib/tools/build-external-helpers.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = _default;
    function helpers() {
      const data = require_lib7();
      helpers = function() {
        return data;
      };
      return data;
    }
    function _generator() {
      const data = require_lib8();
      _generator = function() {
        return data;
      };
      return data;
    }
    function _template() {
      const data = require_lib6();
      _template = function() {
        return data;
      };
      return data;
    }
    function _t() {
      const data = require_lib3();
      _t = function() {
        return data;
      };
      return data;
    }
    var {
      arrayExpression,
      assignmentExpression,
      binaryExpression,
      blockStatement,
      callExpression,
      cloneNode,
      conditionalExpression,
      exportNamedDeclaration,
      exportSpecifier,
      expressionStatement,
      functionExpression,
      identifier,
      memberExpression,
      objectExpression,
      program,
      stringLiteral,
      unaryExpression,
      variableDeclaration,
      variableDeclarator
    } = _t();
    var buildUmdWrapper = (replacements) => _template().default.statement`
    (function (root, factory) {
      if (typeof define === "function" && define.amd) {
        define(AMD_ARGUMENTS, factory);
      } else if (typeof exports === "object") {
        factory(COMMON_ARGUMENTS);
      } else {
        factory(BROWSER_ARGUMENTS);
      }
    })(UMD_ROOT, function (FACTORY_PARAMETERS) {
      FACTORY_BODY
    });
  `(replacements);
    function buildGlobal(allowlist) {
      const namespace = identifier("babelHelpers");
      const body = [];
      const container = functionExpression(null, [identifier("global")], blockStatement(body));
      const tree = program([expressionStatement(callExpression(container, [conditionalExpression(binaryExpression("===", unaryExpression("typeof", identifier("global")), stringLiteral("undefined")), identifier("self"), identifier("global"))]))]);
      body.push(variableDeclaration("var", [variableDeclarator(namespace, assignmentExpression("=", memberExpression(identifier("global"), namespace), objectExpression([])))]));
      buildHelpers(body, namespace, allowlist);
      return tree;
    }
    function buildModule(allowlist) {
      const body = [];
      const refs = buildHelpers(body, null, allowlist);
      body.unshift(exportNamedDeclaration(null, Object.keys(refs).map((name) => {
        return exportSpecifier(cloneNode(refs[name]), identifier(name));
      })));
      return program(body, [], "module");
    }
    function buildUmd(allowlist) {
      const namespace = identifier("babelHelpers");
      const body = [];
      body.push(variableDeclaration("var", [variableDeclarator(namespace, identifier("global"))]));
      buildHelpers(body, namespace, allowlist);
      return program([buildUmdWrapper({
        FACTORY_PARAMETERS: identifier("global"),
        BROWSER_ARGUMENTS: assignmentExpression("=", memberExpression(identifier("root"), namespace), objectExpression([])),
        COMMON_ARGUMENTS: identifier("exports"),
        AMD_ARGUMENTS: arrayExpression([stringLiteral("exports")]),
        FACTORY_BODY: body,
        UMD_ROOT: identifier("this")
      })]);
    }
    function buildVar(allowlist) {
      const namespace = identifier("babelHelpers");
      const body = [];
      body.push(variableDeclaration("var", [variableDeclarator(namespace, objectExpression([]))]));
      const tree = program(body);
      buildHelpers(body, namespace, allowlist);
      body.push(expressionStatement(namespace));
      return tree;
    }
    function buildHelpers(body, namespace, allowlist) {
      const getHelperReference = (name) => {
        return namespace ? memberExpression(namespace, identifier(name)) : identifier(`_${name}`);
      };
      const refs = {};
      helpers().list.forEach(function(name) {
        if (allowlist && !allowlist.includes(name)) return;
        const ref = refs[name] = getHelperReference(name);
        const {
          nodes
        } = helpers().get(name, getHelperReference, namespace ? null : `_${name}`, [], namespace ? (ast, exportName, mapExportBindingAssignments) => {
          mapExportBindingAssignments((node) => assignmentExpression("=", ref, node));
          ast.body.push(expressionStatement(assignmentExpression("=", ref, identifier(exportName))));
        } : null);
        body.push(...nodes);
      });
      return refs;
    }
    function _default(allowlist, outputType = "global") {
      let tree;
      const build = {
        global: buildGlobal,
        module: buildModule,
        umd: buildUmd,
        var: buildVar
      }[outputType];
      if (build) {
        tree = build(allowlist);
      } else {
        throw new Error(`Unsupported output type ${outputType}`);
      }
      return (0, _generator().default)(tree).code;
    }
  }
});

// node_modules/gensync/index.js
var require_gensync = __commonJS({
  "node_modules/gensync/index.js"(exports2, module2) {
    "use strict";
    var GENSYNC_START = Symbol.for("gensync:v1:start");
    var GENSYNC_SUSPEND = Symbol.for("gensync:v1:suspend");
    var GENSYNC_EXPECTED_START = "GENSYNC_EXPECTED_START";
    var GENSYNC_EXPECTED_SUSPEND = "GENSYNC_EXPECTED_SUSPEND";
    var GENSYNC_OPTIONS_ERROR = "GENSYNC_OPTIONS_ERROR";
    var GENSYNC_RACE_NONEMPTY = "GENSYNC_RACE_NONEMPTY";
    var GENSYNC_ERRBACK_NO_CALLBACK = "GENSYNC_ERRBACK_NO_CALLBACK";
    module2.exports = Object.assign(
      function gensync(optsOrFn) {
        let genFn = optsOrFn;
        if (typeof optsOrFn !== "function") {
          genFn = newGenerator(optsOrFn);
        } else {
          genFn = wrapGenerator(optsOrFn);
        }
        return Object.assign(genFn, makeFunctionAPI(genFn));
      },
      {
        all: buildOperation({
          name: "all",
          arity: 1,
          sync: function(args) {
            const items = Array.from(args[0]);
            return items.map((item) => evaluateSync(item));
          },
          async: function(args, resolve, reject) {
            const items = Array.from(args[0]);
            if (items.length === 0) {
              Promise.resolve().then(() => resolve([]));
              return;
            }
            let count = 0;
            const results = items.map(() => void 0);
            items.forEach((item, i) => {
              evaluateAsync(
                item,
                (val) => {
                  results[i] = val;
                  count += 1;
                  if (count === results.length) resolve(results);
                },
                reject
              );
            });
          }
        }),
        race: buildOperation({
          name: "race",
          arity: 1,
          sync: function(args) {
            const items = Array.from(args[0]);
            if (items.length === 0) {
              throw makeError("Must race at least 1 item", GENSYNC_RACE_NONEMPTY);
            }
            return evaluateSync(items[0]);
          },
          async: function(args, resolve, reject) {
            const items = Array.from(args[0]);
            if (items.length === 0) {
              throw makeError("Must race at least 1 item", GENSYNC_RACE_NONEMPTY);
            }
            for (const item of items) {
              evaluateAsync(item, resolve, reject);
            }
          }
        })
      }
    );
    function makeFunctionAPI(genFn) {
      const fns = {
        sync: function(...args) {
          return evaluateSync(genFn.apply(this, args));
        },
        async: function(...args) {
          return new Promise((resolve, reject) => {
            evaluateAsync(genFn.apply(this, args), resolve, reject);
          });
        },
        errback: function(...args) {
          const cb = args.pop();
          if (typeof cb !== "function") {
            throw makeError(
              "Asynchronous function called without callback",
              GENSYNC_ERRBACK_NO_CALLBACK
            );
          }
          let gen;
          try {
            gen = genFn.apply(this, args);
          } catch (err) {
            cb(err);
            return;
          }
          evaluateAsync(gen, (val) => cb(void 0, val), (err) => cb(err));
        }
      };
      return fns;
    }
    function assertTypeof(type, name, value2, allowUndefined) {
      if (typeof value2 === type || allowUndefined && typeof value2 === "undefined") {
        return;
      }
      let msg;
      if (allowUndefined) {
        msg = `Expected opts.${name} to be either a ${type}, or undefined.`;
      } else {
        msg = `Expected opts.${name} to be a ${type}.`;
      }
      throw makeError(msg, GENSYNC_OPTIONS_ERROR);
    }
    function makeError(msg, code) {
      return Object.assign(new Error(msg), { code });
    }
    function newGenerator({ name, arity, sync, async, errback }) {
      assertTypeof(
        "string",
        "name",
        name,
        true
        /* allowUndefined */
      );
      assertTypeof(
        "number",
        "arity",
        arity,
        true
        /* allowUndefined */
      );
      assertTypeof("function", "sync", sync);
      assertTypeof(
        "function",
        "async",
        async,
        true
        /* allowUndefined */
      );
      assertTypeof(
        "function",
        "errback",
        errback,
        true
        /* allowUndefined */
      );
      if (async && errback) {
        throw makeError(
          "Expected one of either opts.async or opts.errback, but got _both_.",
          GENSYNC_OPTIONS_ERROR
        );
      }
      if (typeof name !== "string") {
        let fnName;
        if (errback && errback.name && errback.name !== "errback") {
          fnName = errback.name;
        }
        if (async && async.name && async.name !== "async") {
          fnName = async.name.replace(/Async$/, "");
        }
        if (sync && sync.name && sync.name !== "sync") {
          fnName = sync.name.replace(/Sync$/, "");
        }
        if (typeof fnName === "string") {
          name = fnName;
        }
      }
      if (typeof arity !== "number") {
        arity = sync.length;
      }
      return buildOperation({
        name,
        arity,
        sync: function(args) {
          return sync.apply(this, args);
        },
        async: function(args, resolve, reject) {
          if (async) {
            async.apply(this, args).then(resolve, reject);
          } else if (errback) {
            errback.call(this, ...args, (err, value2) => {
              if (err == null) resolve(value2);
              else reject(err);
            });
          } else {
            resolve(sync.apply(this, args));
          }
        }
      });
    }
    function wrapGenerator(genFn) {
      return setFunctionMetadata(genFn.name, genFn.length, function(...args) {
        return genFn.apply(this, args);
      });
    }
    function buildOperation({ name, arity, sync, async }) {
      return setFunctionMetadata(name, arity, function* (...args) {
        const resume = yield GENSYNC_START;
        if (!resume) {
          const res = sync.call(this, args);
          return res;
        }
        let result;
        try {
          async.call(
            this,
            args,
            (value2) => {
              if (result) return;
              result = { value: value2 };
              resume();
            },
            (err) => {
              if (result) return;
              result = { err };
              resume();
            }
          );
        } catch (err) {
          result = { err };
          resume();
        }
        yield GENSYNC_SUSPEND;
        if (result.hasOwnProperty("err")) {
          throw result.err;
        }
        return result.value;
      });
    }
    function evaluateSync(gen) {
      let value2;
      while (!({ value: value2 } = gen.next()).done) {
        assertStart(value2, gen);
      }
      return value2;
    }
    function evaluateAsync(gen, resolve, reject) {
      (function step() {
        try {
          let value2;
          while (!({ value: value2 } = gen.next()).done) {
            assertStart(value2, gen);
            let sync = true;
            let didSyncResume = false;
            const out = gen.next(() => {
              if (sync) {
                didSyncResume = true;
              } else {
                step();
              }
            });
            sync = false;
            assertSuspend(out, gen);
            if (!didSyncResume) {
              return;
            }
          }
          return resolve(value2);
        } catch (err) {
          return reject(err);
        }
      })();
    }
    function assertStart(value2, gen) {
      if (value2 === GENSYNC_START) return;
      throwError(
        gen,
        makeError(
          `Got unexpected yielded value in gensync generator: ${JSON.stringify(
            value2
          )}. Did you perhaps mean to use 'yield*' instead of 'yield'?`,
          GENSYNC_EXPECTED_START
        )
      );
    }
    function assertSuspend({ value: value2, done }, gen) {
      if (!done && value2 === GENSYNC_SUSPEND) return;
      throwError(
        gen,
        makeError(
          done ? "Unexpected generator completion. If you get this, it is probably a gensync bug." : `Expected GENSYNC_SUSPEND, got ${JSON.stringify(
            value2
          )}. If you get this, it is probably a gensync bug.`,
          GENSYNC_EXPECTED_SUSPEND
        )
      );
    }
    function throwError(gen, err) {
      if (gen.throw) gen.throw(err);
      throw err;
    }
    function setFunctionMetadata(name, arity, fn) {
      if (typeof name === "string") {
        const nameDesc = Object.getOwnPropertyDescriptor(fn, "name");
        if (!nameDesc || nameDesc.configurable) {
          Object.defineProperty(
            fn,
            "name",
            Object.assign(nameDesc || {}, {
              configurable: true,
              value: name
            })
          );
        }
      }
      if (typeof arity === "number") {
        const lengthDesc = Object.getOwnPropertyDescriptor(fn, "length");
        if (!lengthDesc || lengthDesc.configurable) {
          Object.defineProperty(
            fn,
            "length",
            Object.assign(lengthDesc || {}, {
              configurable: true,
              value: arity
            })
          );
        }
      }
      return fn;
    }
  }
});

// node_modules/@babel/core/lib/gensync-utils/async.js
var require_async = __commonJS({
  "node_modules/@babel/core/lib/gensync-utils/async.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.forwardAsync = forwardAsync;
    exports2.isAsync = void 0;
    exports2.isThenable = isThenable;
    exports2.maybeAsync = maybeAsync;
    exports2.waitFor = exports2.onFirstPause = void 0;
    function _gensync() {
      const data = require_gensync();
      _gensync = function() {
        return data;
      };
      return data;
    }
    function asyncGeneratorStep(n, t, e, r, o, a, c) {
      try {
        var i = n[a](c), u = i.value;
      } catch (n2) {
        return void e(n2);
      }
      i.done ? t(u) : Promise.resolve(u).then(r, o);
    }
    function _asyncToGenerator(n) {
      return function() {
        var t = this, e = arguments;
        return new Promise(function(r, o) {
          var a = n.apply(t, e);
          function _next(n2) {
            asyncGeneratorStep(a, r, o, _next, _throw, "next", n2);
          }
          function _throw(n2) {
            asyncGeneratorStep(a, r, o, _next, _throw, "throw", n2);
          }
          _next(void 0);
        });
      };
    }
    var runGenerator = _gensync()(function* (item) {
      return yield* item;
    });
    var isAsync = exports2.isAsync = _gensync()({
      sync: () => false,
      errback: (cb) => cb(null, true)
    });
    function maybeAsync(fn, message) {
      return _gensync()({
        sync(...args) {
          const result = fn.apply(this, args);
          if (isThenable(result)) throw new Error(message);
          return result;
        },
        async(...args) {
          return Promise.resolve(fn.apply(this, args));
        }
      });
    }
    var withKind = _gensync()({
      sync: (cb) => cb("sync"),
      async: (function() {
        var _ref = _asyncToGenerator(function* (cb) {
          return cb("async");
        });
        return function async(_x) {
          return _ref.apply(this, arguments);
        };
      })()
    });
    function forwardAsync(action, cb) {
      const g = _gensync()(action);
      return withKind((kind) => {
        const adapted = g[kind];
        return cb(adapted);
      });
    }
    var onFirstPause = exports2.onFirstPause = _gensync()({
      name: "onFirstPause",
      arity: 2,
      sync: function(item) {
        return runGenerator.sync(item);
      },
      errback: function(item, firstPause, cb) {
        let completed = false;
        runGenerator.errback(item, (err, value2) => {
          completed = true;
          cb(err, value2);
        });
        if (!completed) {
          firstPause();
        }
      }
    });
    var waitFor = exports2.waitFor = _gensync()({
      sync: (x) => x,
      async: (function() {
        var _ref2 = _asyncToGenerator(function* (x) {
          return x;
        });
        return function async(_x2) {
          return _ref2.apply(this, arguments);
        };
      })()
    });
    function isThenable(val) {
      return !!val && (typeof val === "object" || typeof val === "function") && !!val.then && typeof val.then === "function";
    }
  }
});

// node_modules/@babel/core/lib/config/util.js
var require_util2 = __commonJS({
  "node_modules/@babel/core/lib/config/util.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.isIterableIterator = isIterableIterator;
    exports2.mergeOptions = mergeOptions;
    function mergeOptions(target, source) {
      for (const k of Object.keys(source)) {
        if ((k === "parserOpts" || k === "generatorOpts" || k === "assumptions") && source[k]) {
          const parserOpts = source[k];
          const targetObj = target[k] || (target[k] = {});
          mergeDefaultFields(targetObj, parserOpts);
        } else {
          const val = source[k];
          if (val !== void 0) target[k] = val;
        }
      }
    }
    function mergeDefaultFields(target, source) {
      for (const k of Object.keys(source)) {
        const val = source[k];
        if (val !== void 0) target[k] = val;
      }
    }
    function isIterableIterator(value2) {
      return !!value2 && typeof value2.next === "function" && typeof value2[Symbol.iterator] === "function";
    }
  }
});

// node_modules/@babel/core/lib/config/caching.js
var require_caching = __commonJS({
  "node_modules/@babel/core/lib/config/caching.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.assertSimpleType = assertSimpleType;
    exports2.makeStrongCache = makeStrongCache;
    exports2.makeStrongCacheSync = makeStrongCacheSync;
    exports2.makeWeakCache = makeWeakCache;
    exports2.makeWeakCacheSync = makeWeakCacheSync;
    function _gensync() {
      const data = require_gensync();
      _gensync = function() {
        return data;
      };
      return data;
    }
    var _async = require_async();
    var _util = require_util2();
    var synchronize = (gen) => {
      return _gensync()(gen).sync;
    };
    function* genTrue() {
      return true;
    }
    function makeWeakCache(handler) {
      return makeCachedFunction(WeakMap, handler);
    }
    function makeWeakCacheSync(handler) {
      return synchronize(makeWeakCache(handler));
    }
    function makeStrongCache(handler) {
      return makeCachedFunction(Map, handler);
    }
    function makeStrongCacheSync(handler) {
      return synchronize(makeStrongCache(handler));
    }
    function makeCachedFunction(CallCache, handler) {
      const callCacheSync = new CallCache();
      const callCacheAsync = new CallCache();
      const futureCache = new CallCache();
      return function* cachedFunction(arg, data) {
        const asyncContext = yield* (0, _async.isAsync)();
        const callCache = asyncContext ? callCacheAsync : callCacheSync;
        const cached = yield* getCachedValueOrWait(asyncContext, callCache, futureCache, arg, data);
        if (cached.valid) return cached.value;
        const cache = new CacheConfigurator(data);
        const handlerResult = handler(arg, cache);
        let finishLock;
        let value2;
        if ((0, _util.isIterableIterator)(handlerResult)) {
          value2 = yield* (0, _async.onFirstPause)(handlerResult, () => {
            finishLock = setupAsyncLocks(cache, futureCache, arg);
          });
        } else {
          value2 = handlerResult;
        }
        updateFunctionCache(callCache, cache, arg, value2);
        if (finishLock) {
          futureCache.delete(arg);
          finishLock.release(value2);
        }
        return value2;
      };
    }
    function* getCachedValue(cache, arg, data) {
      const cachedValue = cache.get(arg);
      if (cachedValue) {
        for (const {
          value: value2,
          valid
        } of cachedValue) {
          if (yield* valid(data)) return {
            valid: true,
            value: value2
          };
        }
      }
      return {
        valid: false,
        value: null
      };
    }
    function* getCachedValueOrWait(asyncContext, callCache, futureCache, arg, data) {
      const cached = yield* getCachedValue(callCache, arg, data);
      if (cached.valid) {
        return cached;
      }
      if (asyncContext) {
        const cached2 = yield* getCachedValue(futureCache, arg, data);
        if (cached2.valid) {
          const value2 = yield* (0, _async.waitFor)(cached2.value.promise);
          return {
            valid: true,
            value: value2
          };
        }
      }
      return {
        valid: false,
        value: null
      };
    }
    function setupAsyncLocks(config, futureCache, arg) {
      const finishLock = new Lock();
      updateFunctionCache(futureCache, config, arg, finishLock);
      return finishLock;
    }
    function updateFunctionCache(cache, config, arg, value2) {
      if (!config.configured()) config.forever();
      let cachedValue = cache.get(arg);
      config.deactivate();
      switch (config.mode()) {
        case "forever":
          cachedValue = [{
            value: value2,
            valid: genTrue
          }];
          cache.set(arg, cachedValue);
          break;
        case "invalidate":
          cachedValue = [{
            value: value2,
            valid: config.validator()
          }];
          cache.set(arg, cachedValue);
          break;
        case "valid":
          if (cachedValue) {
            cachedValue.push({
              value: value2,
              valid: config.validator()
            });
          } else {
            cachedValue = [{
              value: value2,
              valid: config.validator()
            }];
            cache.set(arg, cachedValue);
          }
      }
    }
    var CacheConfigurator = class {
      constructor(data) {
        this._active = true;
        this._never = false;
        this._forever = false;
        this._invalidate = false;
        this._configured = false;
        this._pairs = [];
        this._data = void 0;
        this._data = data;
      }
      simple() {
        return makeSimpleConfigurator(this);
      }
      mode() {
        if (this._never) return "never";
        if (this._forever) return "forever";
        if (this._invalidate) return "invalidate";
        return "valid";
      }
      forever() {
        if (!this._active) {
          throw new Error("Cannot change caching after evaluation has completed.");
        }
        if (this._never) {
          throw new Error("Caching has already been configured with .never()");
        }
        this._forever = true;
        this._configured = true;
      }
      never() {
        if (!this._active) {
          throw new Error("Cannot change caching after evaluation has completed.");
        }
        if (this._forever) {
          throw new Error("Caching has already been configured with .forever()");
        }
        this._never = true;
        this._configured = true;
      }
      using(handler) {
        if (!this._active) {
          throw new Error("Cannot change caching after evaluation has completed.");
        }
        if (this._never || this._forever) {
          throw new Error("Caching has already been configured with .never or .forever()");
        }
        this._configured = true;
        const key = handler(this._data);
        const fn = (0, _async.maybeAsync)(handler, `You appear to be using an async cache handler, but Babel has been called synchronously`);
        if ((0, _async.isThenable)(key)) {
          return key.then((key2) => {
            this._pairs.push([key2, fn]);
            return key2;
          });
        }
        this._pairs.push([key, fn]);
        return key;
      }
      invalidate(handler) {
        this._invalidate = true;
        return this.using(handler);
      }
      validator() {
        const pairs = this._pairs;
        return function* (data) {
          for (const [key, fn] of pairs) {
            if (key !== (yield* fn(data))) return false;
          }
          return true;
        };
      }
      deactivate() {
        this._active = false;
      }
      configured() {
        return this._configured;
      }
    };
    function makeSimpleConfigurator(cache) {
      function cacheFn(val) {
        if (typeof val === "boolean") {
          if (val) cache.forever();
          else cache.never();
          return;
        }
        return cache.using(() => assertSimpleType(val()));
      }
      cacheFn.forever = () => cache.forever();
      cacheFn.never = () => cache.never();
      cacheFn.using = (cb) => cache.using(() => assertSimpleType(cb()));
      cacheFn.invalidate = (cb) => cache.invalidate(() => assertSimpleType(cb()));
      return cacheFn;
    }
    function assertSimpleType(value2) {
      if ((0, _async.isThenable)(value2)) {
        throw new Error(`You appear to be using an async cache handler, which your current version of Babel does not support. We may add support for this in the future, but if you're on the most recent version of @babel/core and still seeing this error, then you'll need to synchronously handle your caching logic.`);
      }
      if (value2 != null && typeof value2 !== "string" && typeof value2 !== "boolean" && typeof value2 !== "number") {
        throw new Error("Cache keys must be either string, boolean, number, null, or undefined.");
      }
      return value2;
    }
    var Lock = class {
      constructor() {
        this.released = false;
        this.promise = void 0;
        this._resolve = void 0;
        this.promise = new Promise((resolve) => {
          this._resolve = resolve;
        });
      }
      release(value2) {
        this.released = true;
        this._resolve(value2);
      }
    };
  }
});

// node_modules/@babel/core/lib/gensync-utils/fs.js
var require_fs = __commonJS({
  "node_modules/@babel/core/lib/gensync-utils/fs.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.stat = exports2.readFile = void 0;
    function _fs() {
      const data = require("fs");
      _fs = function() {
        return data;
      };
      return data;
    }
    function _gensync() {
      const data = require_gensync();
      _gensync = function() {
        return data;
      };
      return data;
    }
    var readFile = exports2.readFile = _gensync()({
      sync: _fs().readFileSync,
      errback: _fs().readFile
    });
    var stat = exports2.stat = _gensync()({
      sync: _fs().statSync,
      errback: _fs().stat
    });
  }
});

// node_modules/@babel/core/lib/config/files/utils.js
var require_utils2 = __commonJS({
  "node_modules/@babel/core/lib/config/files/utils.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.makeStaticFileCache = makeStaticFileCache;
    var _caching = require_caching();
    var fs = require_fs();
    function _fs2() {
      const data = require("fs");
      _fs2 = function() {
        return data;
      };
      return data;
    }
    function makeStaticFileCache(fn) {
      return (0, _caching.makeStrongCache)(function* (filepath, cache) {
        const cached = cache.invalidate(() => fileMtime(filepath));
        if (cached === null) {
          return null;
        }
        return fn(filepath, yield* fs.readFile(filepath, "utf8"));
      });
    }
    function fileMtime(filepath) {
      if (!_fs2().existsSync(filepath)) return null;
      try {
        return +_fs2().statSync(filepath).mtime;
      } catch (e) {
        if (e.code !== "ENOENT" && e.code !== "ENOTDIR") throw e;
      }
      return null;
    }
  }
});

// node_modules/@babel/core/lib/errors/rewrite-stack-trace.js
var require_rewrite_stack_trace = __commonJS({
  "node_modules/@babel/core/lib/errors/rewrite-stack-trace.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.beginHiddenCallStack = beginHiddenCallStack;
    exports2.endHiddenCallStack = endHiddenCallStack;
    exports2.expectedError = expectedError;
    exports2.injectVirtualStackFrame = injectVirtualStackFrame;
    var _Object$getOwnPropert;
    var ErrorToString = Function.call.bind(Error.prototype.toString);
    var SUPPORTED = !!Error.captureStackTrace && ((_Object$getOwnPropert = Object.getOwnPropertyDescriptor(Error, "stackTraceLimit")) == null ? void 0 : _Object$getOwnPropert.writable) === true;
    var START_HIDING = "startHiding - secret - don't use this - v1";
    var STOP_HIDING = "stopHiding - secret - don't use this - v1";
    var expectedErrors = /* @__PURE__ */ new WeakSet();
    var virtualFrames = /* @__PURE__ */ new WeakMap();
    function CallSite(filename) {
      return /* @__PURE__ */ Object.create({
        isNative: () => false,
        isConstructor: () => false,
        isToplevel: () => true,
        getFileName: () => filename,
        getLineNumber: () => void 0,
        getColumnNumber: () => void 0,
        getFunctionName: () => void 0,
        getMethodName: () => void 0,
        getTypeName: () => void 0,
        toString: () => filename
      });
    }
    function injectVirtualStackFrame(error, filename) {
      if (!SUPPORTED) return;
      let frames = virtualFrames.get(error);
      if (!frames) virtualFrames.set(error, frames = []);
      frames.push(CallSite(filename));
      return error;
    }
    function expectedError(error) {
      if (!SUPPORTED) return;
      expectedErrors.add(error);
      return error;
    }
    function beginHiddenCallStack(fn) {
      if (!SUPPORTED) return fn;
      return Object.defineProperty(function(...args) {
        setupPrepareStackTrace();
        return fn(...args);
      }, "name", {
        value: STOP_HIDING
      });
    }
    function endHiddenCallStack(fn) {
      if (!SUPPORTED) return fn;
      return Object.defineProperty(function(...args) {
        return fn(...args);
      }, "name", {
        value: START_HIDING
      });
    }
    function setupPrepareStackTrace() {
      setupPrepareStackTrace = () => {
      };
      const {
        prepareStackTrace = defaultPrepareStackTrace
      } = Error;
      const MIN_STACK_TRACE_LIMIT = 50;
      Error.stackTraceLimit && (Error.stackTraceLimit = Math.max(Error.stackTraceLimit, MIN_STACK_TRACE_LIMIT));
      Error.prepareStackTrace = function stackTraceRewriter(err, trace) {
        let newTrace = [];
        const isExpected = expectedErrors.has(err);
        let status = isExpected ? "hiding" : "unknown";
        for (let i = 0; i < trace.length; i++) {
          const name = trace[i].getFunctionName();
          if (name === START_HIDING) {
            status = "hiding";
          } else if (name === STOP_HIDING) {
            if (status === "hiding") {
              status = "showing";
              if (virtualFrames.has(err)) {
                newTrace.unshift(...virtualFrames.get(err));
              }
            } else if (status === "unknown") {
              newTrace = trace;
              break;
            }
          } else if (status !== "hiding") {
            newTrace.push(trace[i]);
          }
        }
        return prepareStackTrace(err, newTrace);
      };
    }
    function defaultPrepareStackTrace(err, trace) {
      if (trace.length === 0) return ErrorToString(err);
      return `${ErrorToString(err)}
    at ${trace.join("\n    at ")}`;
    }
  }
});

// node_modules/@babel/core/lib/errors/config-error.js
var require_config_error = __commonJS({
  "node_modules/@babel/core/lib/errors/config-error.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = void 0;
    var _rewriteStackTrace = require_rewrite_stack_trace();
    var ConfigError = class extends Error {
      constructor(message, filename) {
        super(message);
        (0, _rewriteStackTrace.expectedError)(this);
        if (filename) (0, _rewriteStackTrace.injectVirtualStackFrame)(this, filename);
      }
    };
    exports2.default = ConfigError;
  }
});

// node_modules/@babel/core/lib/config/files/package.js
var require_package = __commonJS({
  "node_modules/@babel/core/lib/config/files/package.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.findPackageData = findPackageData;
    function _path() {
      const data = require("path");
      _path = function() {
        return data;
      };
      return data;
    }
    var _utils = require_utils2();
    var _configError = require_config_error();
    var PACKAGE_FILENAME = "package.json";
    var readConfigPackage = (0, _utils.makeStaticFileCache)((filepath, content) => {
      let options;
      try {
        options = JSON.parse(content);
      } catch (err) {
        throw new _configError.default(`Error while parsing JSON - ${err.message}`, filepath);
      }
      if (!options) throw new Error(`${filepath}: No config detected`);
      if (typeof options !== "object") {
        throw new _configError.default(`Config returned typeof ${typeof options}`, filepath);
      }
      if (Array.isArray(options)) {
        throw new _configError.default(`Expected config object but found array`, filepath);
      }
      return {
        filepath,
        dirname: _path().dirname(filepath),
        options
      };
    });
    function* findPackageData(filepath) {
      let pkg = null;
      const directories = [];
      let isPackage = true;
      let dirname = _path().dirname(filepath);
      while (!pkg && _path().basename(dirname) !== "node_modules") {
        directories.push(dirname);
        pkg = yield* readConfigPackage(_path().join(dirname, PACKAGE_FILENAME));
        const nextLoc = _path().dirname(dirname);
        if (dirname === nextLoc) {
          isPackage = false;
          break;
        }
        dirname = nextLoc;
      }
      return {
        filepath,
        directories,
        pkg,
        isPackage
      };
    }
  }
});

// node_modules/json5/lib/unicode.js
var require_unicode = __commonJS({
  "node_modules/json5/lib/unicode.js"(exports2, module2) {
    module2.exports.Space_Separator = /[\u1680\u2000-\u200A\u202F\u205F\u3000]/;
    module2.exports.ID_Start = /[\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\u0561-\u0587\u05D0-\u05EA\u05F0-\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-\u08BD\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\u0D05-\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\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\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-\u1877\u1880-\u1884\u1887-\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\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\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\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\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\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\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-\uAB65\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]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/;
    module2.exports.ID_Continue = /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\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\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\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\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/;
  }
});

// node_modules/json5/lib/util.js
var require_util3 = __commonJS({
  "node_modules/json5/lib/util.js"(exports2, module2) {
    var unicode = require_unicode();
    module2.exports = {
      isSpaceSeparator(c) {
        return typeof c === "string" && unicode.Space_Separator.test(c);
      },
      isIdStartChar(c) {
        return typeof c === "string" && (c >= "a" && c <= "z" || c >= "A" && c <= "Z" || c === "$" || c === "_" || unicode.ID_Start.test(c));
      },
      isIdContinueChar(c) {
        return typeof c === "string" && (c >= "a" && c <= "z" || c >= "A" && c <= "Z" || c >= "0" && c <= "9" || c === "$" || c === "_" || c === "\u200C" || c === "\u200D" || unicode.ID_Continue.test(c));
      },
      isDigit(c) {
        return typeof c === "string" && /[0-9]/.test(c);
      },
      isHexDigit(c) {
        return typeof c === "string" && /[0-9A-Fa-f]/.test(c);
      }
    };
  }
});

// node_modules/json5/lib/parse.js
var require_parse2 = __commonJS({
  "node_modules/json5/lib/parse.js"(exports2, module2) {
    var util = require_util3();
    var source;
    var parseState;
    var stack;
    var pos;
    var line;
    var column;
    var token;
    var key;
    var root;
    module2.exports = function parse2(text, reviver) {
      source = String(text);
      parseState = "start";
      stack = [];
      pos = 0;
      line = 1;
      column = 0;
      token = void 0;
      key = void 0;
      root = void 0;
      do {
        token = lex();
        parseStates[parseState]();
      } while (token.type !== "eof");
      if (typeof reviver === "function") {
        return internalize({ "": root }, "", reviver);
      }
      return root;
    };
    function internalize(holder, name, reviver) {
      const value2 = holder[name];
      if (value2 != null && typeof value2 === "object") {
        if (Array.isArray(value2)) {
          for (let i = 0; i < value2.length; i++) {
            const key2 = String(i);
            const replacement = internalize(value2, key2, reviver);
            if (replacement === void 0) {
              delete value2[key2];
            } else {
              Object.defineProperty(value2, key2, {
                value: replacement,
                writable: true,
                enumerable: true,
                configurable: true
              });
            }
          }
        } else {
          for (const key2 in value2) {
            const replacement = internalize(value2, key2, reviver);
            if (replacement === void 0) {
              delete value2[key2];
            } else {
              Object.defineProperty(value2, key2, {
                value: replacement,
                writable: true,
                enumerable: true,
                configurable: true
              });
            }
          }
        }
      }
      return reviver.call(holder, name, value2);
    }
    var lexState;
    var buffer;
    var doubleQuote;
    var sign;
    var c;
    function lex() {
      lexState = "default";
      buffer = "";
      doubleQuote = false;
      sign = 1;
      for (; ; ) {
        c = peek();
        const token2 = lexStates[lexState]();
        if (token2) {
          return token2;
        }
      }
    }
    function peek() {
      if (source[pos]) {
        return String.fromCodePoint(source.codePointAt(pos));
      }
    }
    function read() {
      const c2 = peek();
      if (c2 === "\n") {
        line++;
        column = 0;
      } else if (c2) {
        column += c2.length;
      } else {
        column++;
      }
      if (c2) {
        pos += c2.length;
      }
      return c2;
    }
    var lexStates = {
      default() {
        switch (c) {
          case "	":
          case "\v":
          case "\f":
          case " ":
          case "\xA0":
          case "\uFEFF":
          case "\n":
          case "\r":
          case "\u2028":
          case "\u2029":
            read();
            return;
          case "/":
            read();
            lexState = "comment";
            return;
          case void 0:
            read();
            return newToken("eof");
        }
        if (util.isSpaceSeparator(c)) {
          read();
          return;
        }
        return lexStates[parseState]();
      },
      comment() {
        switch (c) {
          case "*":
            read();
            lexState = "multiLineComment";
            return;
          case "/":
            read();
            lexState = "singleLineComment";
            return;
        }
        throw invalidChar(read());
      },
      multiLineComment() {
        switch (c) {
          case "*":
            read();
            lexState = "multiLineCommentAsterisk";
            return;
          case void 0:
            throw invalidChar(read());
        }
        read();
      },
      multiLineCommentAsterisk() {
        switch (c) {
          case "*":
            read();
            return;
          case "/":
            read();
            lexState = "default";
            return;
          case void 0:
            throw invalidChar(read());
        }
        read();
        lexState = "multiLineComment";
      },
      singleLineComment() {
        switch (c) {
          case "\n":
          case "\r":
          case "\u2028":
          case "\u2029":
            read();
            lexState = "default";
            return;
          case void 0:
            read();
            return newToken("eof");
        }
        read();
      },
      value() {
        switch (c) {
          case "{":
          case "[":
            return newToken("punctuator", read());
          case "n":
            read();
            literal("ull");
            return newToken("null", null);
          case "t":
            read();
            literal("rue");
            return newToken("boolean", true);
          case "f":
            read();
            literal("alse");
            return newToken("boolean", false);
          case "-":
          case "+":
            if (read() === "-") {
              sign = -1;
            }
            lexState = "sign";
            return;
          case ".":
            buffer = read();
            lexState = "decimalPointLeading";
            return;
          case "0":
            buffer = read();
            lexState = "zero";
            return;
          case "1":
          case "2":
          case "3":
          case "4":
          case "5":
          case "6":
          case "7":
          case "8":
          case "9":
            buffer = read();
            lexState = "decimalInteger";
            return;
          case "I":
            read();
            literal("nfinity");
            return newToken("numeric", Infinity);
          case "N":
            read();
            literal("aN");
            return newToken("numeric", NaN);
          case '"':
          case "'":
            doubleQuote = read() === '"';
            buffer = "";
            lexState = "string";
            return;
        }
        throw invalidChar(read());
      },
      identifierNameStartEscape() {
        if (c !== "u") {
          throw invalidChar(read());
        }
        read();
        const u = unicodeEscape();
        switch (u) {
          case "$":
          case "_":
            break;
          default:
            if (!util.isIdStartChar(u)) {
              throw invalidIdentifier();
            }
            break;
        }
        buffer += u;
        lexState = "identifierName";
      },
      identifierName() {
        switch (c) {
          case "$":
          case "_":
          case "\u200C":
          case "\u200D":
            buffer += read();
            return;
          case "\\":
            read();
            lexState = "identifierNameEscape";
            return;
        }
        if (util.isIdContinueChar(c)) {
          buffer += read();
          return;
        }
        return newToken("identifier", buffer);
      },
      identifierNameEscape() {
        if (c !== "u") {
          throw invalidChar(read());
        }
        read();
        const u = unicodeEscape();
        switch (u) {
          case "$":
          case "_":
          case "\u200C":
          case "\u200D":
            break;
          default:
            if (!util.isIdContinueChar(u)) {
              throw invalidIdentifier();
            }
            break;
        }
        buffer += u;
        lexState = "identifierName";
      },
      sign() {
        switch (c) {
          case ".":
            buffer = read();
            lexState = "decimalPointLeading";
            return;
          case "0":
            buffer = read();
            lexState = "zero";
            return;
          case "1":
          case "2":
          case "3":
          case "4":
          case "5":
          case "6":
          case "7":
          case "8":
          case "9":
            buffer = read();
            lexState = "decimalInteger";
            return;
          case "I":
            read();
            literal("nfinity");
            return newToken("numeric", sign * Infinity);
          case "N":
            read();
            literal("aN");
            return newToken("numeric", NaN);
        }
        throw invalidChar(read());
      },
      zero() {
        switch (c) {
          case ".":
            buffer += read();
            lexState = "decimalPoint";
            return;
          case "e":
          case "E":
            buffer += read();
            lexState = "decimalExponent";
            return;
          case "x":
          case "X":
            buffer += read();
            lexState = "hexadecimal";
            return;
        }
        return newToken("numeric", sign * 0);
      },
      decimalInteger() {
        switch (c) {
          case ".":
            buffer += read();
            lexState = "decimalPoint";
            return;
          case "e":
          case "E":
            buffer += read();
            lexState = "decimalExponent";
            return;
        }
        if (util.isDigit(c)) {
          buffer += read();
          return;
        }
        return newToken("numeric", sign * Number(buffer));
      },
      decimalPointLeading() {
        if (util.isDigit(c)) {
          buffer += read();
          lexState = "decimalFraction";
          return;
        }
        throw invalidChar(read());
      },
      decimalPoint() {
        switch (c) {
          case "e":
          case "E":
            buffer += read();
            lexState = "decimalExponent";
            return;
        }
        if (util.isDigit(c)) {
          buffer += read();
          lexState = "decimalFraction";
          return;
        }
        return newToken("numeric", sign * Number(buffer));
      },
      decimalFraction() {
        switch (c) {
          case "e":
          case "E":
            buffer += read();
            lexState = "decimalExponent";
            return;
        }
        if (util.isDigit(c)) {
          buffer += read();
          return;
        }
        return newToken("numeric", sign * Number(buffer));
      },
      decimalExponent() {
        switch (c) {
          case "+":
          case "-":
            buffer += read();
            lexState = "decimalExponentSign";
            return;
        }
        if (util.isDigit(c)) {
          buffer += read();
          lexState = "decimalExponentInteger";
          return;
        }
        throw invalidChar(read());
      },
      decimalExponentSign() {
        if (util.isDigit(c)) {
          buffer += read();
          lexState = "decimalExponentInteger";
          return;
        }
        throw invalidChar(read());
      },
      decimalExponentInteger() {
        if (util.isDigit(c)) {
          buffer += read();
          return;
        }
        return newToken("numeric", sign * Number(buffer));
      },
      hexadecimal() {
        if (util.isHexDigit(c)) {
          buffer += read();
          lexState = "hexadecimalInteger";
          return;
        }
        throw invalidChar(read());
      },
      hexadecimalInteger() {
        if (util.isHexDigit(c)) {
          buffer += read();
          return;
        }
        return newToken("numeric", sign * Number(buffer));
      },
      string() {
        switch (c) {
          case "\\":
            read();
            buffer += escape2();
            return;
          case '"':
            if (doubleQuote) {
              read();
              return newToken("string", buffer);
            }
            buffer += read();
            return;
          case "'":
            if (!doubleQuote) {
              read();
              return newToken("string", buffer);
            }
            buffer += read();
            return;
          case "\n":
          case "\r":
            throw invalidChar(read());
          case "\u2028":
          case "\u2029":
            separatorChar(c);
            break;
          case void 0:
            throw invalidChar(read());
        }
        buffer += read();
      },
      start() {
        switch (c) {
          case "{":
          case "[":
            return newToken("punctuator", read());
        }
        lexState = "value";
      },
      beforePropertyName() {
        switch (c) {
          case "$":
          case "_":
            buffer = read();
            lexState = "identifierName";
            return;
          case "\\":
            read();
            lexState = "identifierNameStartEscape";
            return;
          case "}":
            return newToken("punctuator", read());
          case '"':
          case "'":
            doubleQuote = read() === '"';
            lexState = "string";
            return;
        }
        if (util.isIdStartChar(c)) {
          buffer += read();
          lexState = "identifierName";
          return;
        }
        throw invalidChar(read());
      },
      afterPropertyName() {
        if (c === ":") {
          return newToken("punctuator", read());
        }
        throw invalidChar(read());
      },
      beforePropertyValue() {
        lexState = "value";
      },
      afterPropertyValue() {
        switch (c) {
          case ",":
          case "}":
            return newToken("punctuator", read());
        }
        throw invalidChar(read());
      },
      beforeArrayValue() {
        if (c === "]") {
          return newToken("punctuator", read());
        }
        lexState = "value";
      },
      afterArrayValue() {
        switch (c) {
          case ",":
          case "]":
            return newToken("punctuator", read());
        }
        throw invalidChar(read());
      },
      end() {
        throw invalidChar(read());
      }
    };
    function newToken(type, value2) {
      return {
        type,
        value: value2,
        line,
        column
      };
    }
    function literal(s) {
      for (const c2 of s) {
        const p = peek();
        if (p !== c2) {
          throw invalidChar(read());
        }
        read();
      }
    }
    function escape2() {
      const c2 = peek();
      switch (c2) {
        case "b":
          read();
          return "\b";
        case "f":
          read();
          return "\f";
        case "n":
          read();
          return "\n";
        case "r":
          read();
          return "\r";
        case "t":
          read();
          return "	";
        case "v":
          read();
          return "\v";
        case "0":
          read();
          if (util.isDigit(peek())) {
            throw invalidChar(read());
          }
          return "\0";
        case "x":
          read();
          return hexEscape();
        case "u":
          read();
          return unicodeEscape();
        case "\n":
        case "\u2028":
        case "\u2029":
          read();
          return "";
        case "\r":
          read();
          if (peek() === "\n") {
            read();
          }
          return "";
        case "1":
        case "2":
        case "3":
        case "4":
        case "5":
        case "6":
        case "7":
        case "8":
        case "9":
          throw invalidChar(read());
        case void 0:
          throw invalidChar(read());
      }
      return read();
    }
    function hexEscape() {
      let buffer2 = "";
      let c2 = peek();
      if (!util.isHexDigit(c2)) {
        throw invalidChar(read());
      }
      buffer2 += read();
      c2 = peek();
      if (!util.isHexDigit(c2)) {
        throw invalidChar(read());
      }
      buffer2 += read();
      return String.fromCodePoint(parseInt(buffer2, 16));
    }
    function unicodeEscape() {
      let buffer2 = "";
      let count = 4;
      while (count-- > 0) {
        const c2 = peek();
        if (!util.isHexDigit(c2)) {
          throw invalidChar(read());
        }
        buffer2 += read();
      }
      return String.fromCodePoint(parseInt(buffer2, 16));
    }
    var parseStates = {
      start() {
        if (token.type === "eof") {
          throw invalidEOF();
        }
        push();
      },
      beforePropertyName() {
        switch (token.type) {
          case "identifier":
          case "string":
            key = token.value;
            parseState = "afterPropertyName";
            return;
          case "punctuator":
            pop();
            return;
          case "eof":
            throw invalidEOF();
        }
      },
      afterPropertyName() {
        if (token.type === "eof") {
          throw invalidEOF();
        }
        parseState = "beforePropertyValue";
      },
      beforePropertyValue() {
        if (token.type === "eof") {
          throw invalidEOF();
        }
        push();
      },
      beforeArrayValue() {
        if (token.type === "eof") {
          throw invalidEOF();
        }
        if (token.type === "punctuator" && token.value === "]") {
          pop();
          return;
        }
        push();
      },
      afterPropertyValue() {
        if (token.type === "eof") {
          throw invalidEOF();
        }
        switch (token.value) {
          case ",":
            parseState = "beforePropertyName";
            return;
          case "}":
            pop();
        }
      },
      afterArrayValue() {
        if (token.type === "eof") {
          throw invalidEOF();
        }
        switch (token.value) {
          case ",":
            parseState = "beforeArrayValue";
            return;
          case "]":
            pop();
        }
      },
      end() {
      }
    };
    function push() {
      let value2;
      switch (token.type) {
        case "punctuator":
          switch (token.value) {
            case "{":
              value2 = {};
              break;
            case "[":
              value2 = [];
              break;
          }
          break;
        case "null":
        case "boolean":
        case "numeric":
        case "string":
          value2 = token.value;
          break;
      }
      if (root === void 0) {
        root = value2;
      } else {
        const parent = stack[stack.length - 1];
        if (Array.isArray(parent)) {
          parent.push(value2);
        } else {
          Object.defineProperty(parent, key, {
            value: value2,
            writable: true,
            enumerable: true,
            configurable: true
          });
        }
      }
      if (value2 !== null && typeof value2 === "object") {
        stack.push(value2);
        if (Array.isArray(value2)) {
          parseState = "beforeArrayValue";
        } else {
          parseState = "beforePropertyName";
        }
      } else {
        const current = stack[stack.length - 1];
        if (current == null) {
          parseState = "end";
        } else if (Array.isArray(current)) {
          parseState = "afterArrayValue";
        } else {
          parseState = "afterPropertyValue";
        }
      }
    }
    function pop() {
      stack.pop();
      const current = stack[stack.length - 1];
      if (current == null) {
        parseState = "end";
      } else if (Array.isArray(current)) {
        parseState = "afterArrayValue";
      } else {
        parseState = "afterPropertyValue";
      }
    }
    function invalidChar(c2) {
      if (c2 === void 0) {
        return syntaxError(`JSON5: invalid end of input at ${line}:${column}`);
      }
      return syntaxError(`JSON5: invalid character '${formatChar(c2)}' at ${line}:${column}`);
    }
    function invalidEOF() {
      return syntaxError(`JSON5: invalid end of input at ${line}:${column}`);
    }
    function invalidIdentifier() {
      column -= 5;
      return syntaxError(`JSON5: invalid identifier character at ${line}:${column}`);
    }
    function separatorChar(c2) {
      console.warn(`JSON5: '${formatChar(c2)}' in strings is not valid ECMAScript; consider escaping`);
    }
    function formatChar(c2) {
      const replacements = {
        "'": "\\'",
        '"': '\\"',
        "\\": "\\\\",
        "\b": "\\b",
        "\f": "\\f",
        "\n": "\\n",
        "\r": "\\r",
        "	": "\\t",
        "\v": "\\v",
        "\0": "\\0",
        "\u2028": "\\u2028",
        "\u2029": "\\u2029"
      };
      if (replacements[c2]) {
        return replacements[c2];
      }
      if (c2 < " ") {
        const hexString = c2.charCodeAt(0).toString(16);
        return "\\x" + ("00" + hexString).substring(hexString.length);
      }
      return c2;
    }
    function syntaxError(message) {
      const err = new SyntaxError(message);
      err.lineNumber = line;
      err.columnNumber = column;
      return err;
    }
  }
});

// node_modules/json5/lib/stringify.js
var require_stringify = __commonJS({
  "node_modules/json5/lib/stringify.js"(exports2, module2) {
    var util = require_util3();
    module2.exports = function stringify(value2, replacer, space) {
      const stack = [];
      let indent = "";
      let propertyList;
      let replacerFunc;
      let gap = "";
      let quote;
      if (replacer != null && typeof replacer === "object" && !Array.isArray(replacer)) {
        space = replacer.space;
        quote = replacer.quote;
        replacer = replacer.replacer;
      }
      if (typeof replacer === "function") {
        replacerFunc = replacer;
      } else if (Array.isArray(replacer)) {
        propertyList = [];
        for (const v of replacer) {
          let item;
          if (typeof v === "string") {
            item = v;
          } else if (typeof v === "number" || v instanceof String || v instanceof Number) {
            item = String(v);
          }
          if (item !== void 0 && propertyList.indexOf(item) < 0) {
            propertyList.push(item);
          }
        }
      }
      if (space instanceof Number) {
        space = Number(space);
      } else if (space instanceof String) {
        space = String(space);
      }
      if (typeof space === "number") {
        if (space > 0) {
          space = Math.min(10, Math.floor(space));
          gap = "          ".substr(0, space);
        }
      } else if (typeof space === "string") {
        gap = space.substr(0, 10);
      }
      return serializeProperty("", { "": value2 });
      function serializeProperty(key, holder) {
        let value3 = holder[key];
        if (value3 != null) {
          if (typeof value3.toJSON5 === "function") {
            value3 = value3.toJSON5(key);
          } else if (typeof value3.toJSON === "function") {
            value3 = value3.toJSON(key);
          }
        }
        if (replacerFunc) {
          value3 = replacerFunc.call(holder, key, value3);
        }
        if (value3 instanceof Number) {
          value3 = Number(value3);
        } else if (value3 instanceof String) {
          value3 = String(value3);
        } else if (value3 instanceof Boolean) {
          value3 = value3.valueOf();
        }
        switch (value3) {
          case null:
            return "null";
          case true:
            return "true";
          case false:
            return "false";
        }
        if (typeof value3 === "string") {
          return quoteString(value3, false);
        }
        if (typeof value3 === "number") {
          return String(value3);
        }
        if (typeof value3 === "object") {
          return Array.isArray(value3) ? serializeArray(value3) : serializeObject(value3);
        }
        return void 0;
      }
      function quoteString(value3) {
        const quotes = {
          "'": 0.1,
          '"': 0.2
        };
        const replacements = {
          "'": "\\'",
          '"': '\\"',
          "\\": "\\\\",
          "\b": "\\b",
          "\f": "\\f",
          "\n": "\\n",
          "\r": "\\r",
          "	": "\\t",
          "\v": "\\v",
          "\0": "\\0",
          "\u2028": "\\u2028",
          "\u2029": "\\u2029"
        };
        let product = "";
        for (let i = 0; i < value3.length; i++) {
          const c = value3[i];
          switch (c) {
            case "'":
            case '"':
              quotes[c]++;
              product += c;
              continue;
            case "\0":
              if (util.isDigit(value3[i + 1])) {
                product += "\\x00";
                continue;
              }
          }
          if (replacements[c]) {
            product += replacements[c];
            continue;
          }
          if (c < " ") {
            let hexString = c.charCodeAt(0).toString(16);
            product += "\\x" + ("00" + hexString).substring(hexString.length);
            continue;
          }
          product += c;
        }
        const quoteChar = quote || Object.keys(quotes).reduce((a, b) => quotes[a] < quotes[b] ? a : b);
        product = product.replace(new RegExp(quoteChar, "g"), replacements[quoteChar]);
        return quoteChar + product + quoteChar;
      }
      function serializeObject(value3) {
        if (stack.indexOf(value3) >= 0) {
          throw TypeError("Converting circular structure to JSON5");
        }
        stack.push(value3);
        let stepback = indent;
        indent = indent + gap;
        let keys = propertyList || Object.keys(value3);
        let partial = [];
        for (const key of keys) {
          const propertyString = serializeProperty(key, value3);
          if (propertyString !== void 0) {
            let member = serializeKey(key) + ":";
            if (gap !== "") {
              member += " ";
            }
            member += propertyString;
            partial.push(member);
          }
        }
        let final;
        if (partial.length === 0) {
          final = "{}";
        } else {
          let properties;
          if (gap === "") {
            properties = partial.join(",");
            final = "{" + properties + "}";
          } else {
            let separator = ",\n" + indent;
            properties = partial.join(separator);
            final = "{\n" + indent + properties + ",\n" + stepback + "}";
          }
        }
        stack.pop();
        indent = stepback;
        return final;
      }
      function serializeKey(key) {
        if (key.length === 0) {
          return quoteString(key, true);
        }
        const firstChar = String.fromCodePoint(key.codePointAt(0));
        if (!util.isIdStartChar(firstChar)) {
          return quoteString(key, true);
        }
        for (let i = firstChar.length; i < key.length; i++) {
          if (!util.isIdContinueChar(String.fromCodePoint(key.codePointAt(i)))) {
            return quoteString(key, true);
          }
        }
        return key;
      }
      function serializeArray(value3) {
        if (stack.indexOf(value3) >= 0) {
          throw TypeError("Converting circular structure to JSON5");
        }
        stack.push(value3);
        let stepback = indent;
        indent = indent + gap;
        let partial = [];
        for (let i = 0; i < value3.length; i++) {
          const propertyString = serializeProperty(String(i), value3);
          partial.push(propertyString !== void 0 ? propertyString : "null");
        }
        let final;
        if (partial.length === 0) {
          final = "[]";
        } else {
          if (gap === "") {
            let properties = partial.join(",");
            final = "[" + properties + "]";
          } else {
            let separator = ",\n" + indent;
            let properties = partial.join(separator);
            final = "[\n" + indent + properties + ",\n" + stepback + "]";
          }
        }
        stack.pop();
        indent = stepback;
        return final;
      }
    };
  }
});

// node_modules/json5/lib/index.js
var require_lib12 = __commonJS({
  "node_modules/json5/lib/index.js"(exports2, module2) {
    var parse2 = require_parse2();
    var stringify = require_stringify();
    var JSON5 = {
      parse: parse2,
      stringify
    };
    module2.exports = JSON5;
  }
});

// node_modules/@babel/core/lib/config/helpers/config-api.js
var require_config_api = __commonJS({
  "node_modules/@babel/core/lib/config/helpers/config-api.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.makeConfigAPI = makeConfigAPI;
    exports2.makePluginAPI = makePluginAPI;
    exports2.makePresetAPI = makePresetAPI;
    function _semver() {
      const data = require_semver();
      _semver = function() {
        return data;
      };
      return data;
    }
    var _index = require_lib27();
    var _caching = require_caching();
    function makeConfigAPI(cache) {
      const env = (value2) => cache.using((data) => {
        if (value2 === void 0) return data.envName;
        if (typeof value2 === "function") {
          return (0, _caching.assertSimpleType)(value2(data.envName));
        }
        return (Array.isArray(value2) ? value2 : [value2]).some((entry) => {
          if (typeof entry !== "string") {
            throw new Error("Unexpected non-string value");
          }
          return entry === data.envName;
        });
      });
      const caller = (cb) => cache.using((data) => (0, _caching.assertSimpleType)(cb(data.caller)));
      return {
        version: _index.version,
        cache: cache.simple(),
        env,
        async: () => false,
        caller,
        assertVersion
      };
    }
    function makePresetAPI(cache, externalDependencies) {
      const targets = () => JSON.parse(cache.using((data) => JSON.stringify(data.targets)));
      const addExternalDependency = (ref) => {
        externalDependencies.push(ref);
      };
      return Object.assign({}, makeConfigAPI(cache), {
        targets,
        addExternalDependency
      });
    }
    function makePluginAPI(cache, externalDependencies) {
      const assumption = (name) => cache.using((data) => data.assumptions[name]);
      return Object.assign({}, makePresetAPI(cache, externalDependencies), {
        assumption
      });
    }
    function assertVersion(range) {
      if (typeof range === "number") {
        if (!Number.isInteger(range)) {
          throw new Error("Expected string or integer value.");
        }
        range = `^${range}.0.0-0`;
      }
      if (typeof range !== "string") {
        throw new Error("Expected string or integer value.");
      }
      if (range === "*" || _semver().satisfies(_index.version, range)) return;
      const limit = Error.stackTraceLimit;
      if (typeof limit === "number" && limit < 25) {
        Error.stackTraceLimit = 25;
      }
      const err = new Error(`Requires Babel "${range}", but was loaded with "${_index.version}". If you are sure you have a compatible version of @babel/core, it is likely that something in your build process is loading the wrong version. Inspect the stack trace of this error to look for the first entry that doesn't mention "@babel/core" or "babel-core" to see what is calling Babel.`);
      if (typeof limit === "number") {
        Error.stackTraceLimit = limit;
      }
      throw Object.assign(err, {
        code: "BABEL_VERSION_UNSUPPORTED",
        version: _index.version,
        range
      });
    }
  }
});

// node_modules/@babel/core/lib/config/helpers/deep-array.js
var require_deep_array = __commonJS({
  "node_modules/@babel/core/lib/config/helpers/deep-array.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.finalize = finalize;
    exports2.flattenToSet = flattenToSet;
    function finalize(deepArr) {
      return Object.freeze(deepArr);
    }
    function flattenToSet(arr) {
      const result = /* @__PURE__ */ new Set();
      const stack = [arr];
      while (stack.length > 0) {
        for (const el of stack.pop()) {
          if (Array.isArray(el)) stack.push(el);
          else result.add(el);
        }
      }
      return result;
    }
  }
});

// node_modules/@babel/core/lib/config/plugin.js
var require_plugin = __commonJS({
  "node_modules/@babel/core/lib/config/plugin.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = void 0;
    var _deepArray = require_deep_array();
    var Plugin = class {
      constructor(plugin, options, key, externalDependencies = (0, _deepArray.finalize)([])) {
        this.key = void 0;
        this.manipulateOptions = void 0;
        this.post = void 0;
        this.pre = void 0;
        this.visitor = void 0;
        this.parserOverride = void 0;
        this.generatorOverride = void 0;
        this.options = void 0;
        this.externalDependencies = void 0;
        this.key = plugin.name || key;
        this.manipulateOptions = plugin.manipulateOptions;
        this.post = plugin.post;
        this.pre = plugin.pre;
        this.visitor = plugin.visitor || {};
        this.parserOverride = plugin.parserOverride;
        this.generatorOverride = plugin.generatorOverride;
        this.options = options;
        this.externalDependencies = externalDependencies;
      }
    };
    exports2.default = Plugin;
  }
});

// node_modules/@babel/core/lib/gensync-utils/functional.js
var require_functional = __commonJS({
  "node_modules/@babel/core/lib/gensync-utils/functional.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.once = once;
    var _async = require_async();
    function once(fn) {
      let result;
      let resultP;
      let promiseReferenced = false;
      return function* () {
        if (!result) {
          if (resultP) {
            promiseReferenced = true;
            return yield* (0, _async.waitFor)(resultP);
          }
          if (!(yield* (0, _async.isAsync)())) {
            try {
              result = {
                ok: true,
                value: yield* fn()
              };
            } catch (error) {
              result = {
                ok: false,
                value: error
              };
            }
          } else {
            let resolve, reject;
            resultP = new Promise((res, rej) => {
              resolve = res;
              reject = rej;
            });
            try {
              result = {
                ok: true,
                value: yield* fn()
              };
              resultP = null;
              if (promiseReferenced) resolve(result.value);
            } catch (error) {
              result = {
                ok: false,
                value: error
              };
              resultP = null;
              if (promiseReferenced) reject(error);
            }
          }
        }
        if (result.ok) return result.value;
        else throw result.value;
      };
    }
  }
});

// node_modules/node-releases/data/processed/envs.json
var require_envs = __commonJS({
  "node_modules/node-releases/data/processed/envs.json"(exports2, module2) {
    module2.exports = [{ name: "nodejs", version: "0.2.0", date: "2011-08-26", lts: false, security: false, v8: "2.3.8.0" }, { name: "nodejs", version: "0.3.0", date: "2011-08-26", lts: false, security: false, v8: "2.5.1.0" }, { name: "nodejs", version: "0.4.0", date: "2011-08-26", lts: false, security: false, v8: "3.1.2.0" }, { name: "nodejs", version: "0.5.0", date: "2011-08-26", lts: false, security: false, v8: "3.1.8.25" }, { name: "nodejs", version: "0.6.0", date: "2011-11-04", lts: false, security: false, v8: "3.6.6.6" }, { name: "nodejs", version: "0.7.0", date: "2012-01-17", lts: false, security: false, v8: "3.8.6.0" }, { name: "nodejs", version: "0.8.0", date: "2012-06-22", lts: false, security: false, v8: "3.11.10.10" }, { name: "nodejs", version: "0.9.0", date: "2012-07-20", lts: false, security: false, v8: "3.11.10.15" }, { name: "nodejs", version: "0.10.0", date: "2013-03-11", lts: false, security: false, v8: "3.14.5.8" }, { name: "nodejs", version: "0.11.0", date: "2013-03-28", lts: false, security: false, v8: "3.17.13.0" }, { name: "nodejs", version: "0.12.0", date: "2015-02-06", lts: false, security: false, v8: "3.28.73.0" }, { name: "nodejs", version: "4.0.0", date: "2015-09-08", lts: false, security: false, v8: "4.5.103.30" }, { name: "nodejs", version: "4.1.0", date: "2015-09-17", lts: false, security: false, v8: "4.5.103.33" }, { name: "nodejs", version: "4.2.0", date: "2015-10-12", lts: "Argon", security: false, v8: "4.5.103.35" }, { name: "nodejs", version: "4.3.0", date: "2016-02-09", lts: "Argon", security: false, v8: "4.5.103.35" }, { name: "nodejs", version: "4.4.0", date: "2016-03-08", lts: "Argon", security: false, v8: "4.5.103.35" }, { name: "nodejs", version: "4.5.0", date: "2016-08-16", lts: "Argon", security: false, v8: "4.5.103.37" }, { name: "nodejs", version: "4.6.0", date: "2016-09-27", lts: "Argon", security: true, v8: "4.5.103.37" }, { name: "nodejs", version: "4.7.0", date: "2016-12-06", lts: "Argon", security: false, v8: "4.5.103.43" }, { name: "nodejs", version: "4.8.0", date: "2017-02-21", lts: "Argon", security: false, v8: "4.5.103.45" }, { name: "nodejs", version: "4.9.0", date: "2018-03-28", lts: "Argon", security: true, v8: "4.5.103.53" }, { name: "nodejs", version: "5.0.0", date: "2015-10-29", lts: false, security: false, v8: "4.6.85.28" }, { name: "nodejs", version: "5.1.0", date: "2015-11-17", lts: false, security: false, v8: "4.6.85.31" }, { name: "nodejs", version: "5.2.0", date: "2015-12-09", lts: false, security: false, v8: "4.6.85.31" }, { name: "nodejs", version: "5.3.0", date: "2015-12-15", lts: false, security: false, v8: "4.6.85.31" }, { name: "nodejs", version: "5.4.0", date: "2016-01-06", lts: false, security: false, v8: "4.6.85.31" }, { name: "nodejs", version: "5.5.0", date: "2016-01-21", lts: false, security: false, v8: "4.6.85.31" }, { name: "nodejs", version: "5.6.0", date: "2016-02-09", lts: false, security: false, v8: "4.6.85.31" }, { name: "nodejs", version: "5.7.0", date: "2016-02-23", lts: false, security: false, v8: "4.6.85.31" }, { name: "nodejs", version: "5.8.0", date: "2016-03-09", lts: false, security: false, v8: "4.6.85.31" }, { name: "nodejs", version: "5.9.0", date: "2016-03-16", lts: false, security: false, v8: "4.6.85.31" }, { name: "nodejs", version: "5.10.0", date: "2016-04-01", lts: false, security: false, v8: "4.6.85.31" }, { name: "nodejs", version: "5.11.0", date: "2016-04-21", lts: false, security: false, v8: "4.6.85.31" }, { name: "nodejs", version: "5.12.0", date: "2016-06-23", lts: false, security: false, v8: "4.6.85.32" }, { name: "nodejs", version: "6.0.0", date: "2016-04-26", lts: false, security: false, v8: "5.0.71.35" }, { name: "nodejs", version: "6.1.0", date: "2016-05-05", lts: false, security: false, v8: "5.0.71.35" }, { name: "nodejs", version: "6.2.0", date: "2016-05-17", lts: false, security: false, v8: "5.0.71.47" }, { name: "nodejs", version: "6.3.0", date: "2016-07-06", lts: false, security: false, v8: "5.0.71.52" }, { name: "nodejs", version: "6.4.0", date: "2016-08-12", lts: false, security: false, v8: "5.0.71.60" }, { name: "nodejs", version: "6.5.0", date: "2016-08-26", lts: false, security: false, v8: "5.1.281.81" }, { name: "nodejs", version: "6.6.0", date: "2016-09-14", lts: false, security: false, v8: "5.1.281.83" }, { name: "nodejs", version: "6.7.0", date: "2016-09-27", lts: false, security: true, v8: "5.1.281.83" }, { name: "nodejs", version: "6.8.0", date: "2016-10-12", lts: false, security: false, v8: "5.1.281.84" }, { name: "nodejs", version: "6.9.0", date: "2016-10-18", lts: "Boron", security: false, v8: "5.1.281.84" }, { name: "nodejs", version: "6.10.0", date: "2017-02-21", lts: "Boron", security: false, v8: "5.1.281.93" }, { name: "nodejs", version: "6.11.0", date: "2017-06-06", lts: "Boron", security: false, v8: "5.1.281.102" }, { name: "nodejs", version: "6.12.0", date: "2017-11-06", lts: "Boron", security: false, v8: "5.1.281.108" }, { name: "nodejs", version: "6.13.0", date: "2018-02-10", lts: "Boron", security: false, v8: "5.1.281.111" }, { name: "nodejs", version: "6.14.0", date: "2018-03-28", lts: "Boron", security: true, v8: "5.1.281.111" }, { name: "nodejs", version: "6.15.0", date: "2018-11-27", lts: "Boron", security: true, v8: "5.1.281.111" }, { name: "nodejs", version: "6.16.0", date: "2018-12-26", lts: "Boron", security: false, v8: "5.1.281.111" }, { name: "nodejs", version: "6.17.0", date: "2019-02-28", lts: "Boron", security: true, v8: "5.1.281.111" }, { name: "nodejs", version: "7.0.0", date: "2016-10-25", lts: false, security: false, v8: "5.4.500.36" }, { name: "nodejs", version: "7.1.0", date: "2016-11-08", lts: false, security: false, v8: "5.4.500.36" }, { name: "nodejs", version: "7.2.0", date: "2016-11-22", lts: false, security: false, v8: "5.4.500.43" }, { name: "nodejs", version: "7.3.0", date: "2016-12-20", lts: false, security: false, v8: "5.4.500.45" }, { name: "nodejs", version: "7.4.0", date: "2017-01-04", lts: false, security: false, v8: "5.4.500.45" }, { name: "nodejs", version: "7.5.0", date: "2017-01-31", lts: false, security: false, v8: "5.4.500.48" }, { name: "nodejs", version: "7.6.0", date: "2017-02-21", lts: false, security: false, v8: "5.5.372.40" }, { name: "nodejs", version: "7.7.0", date: "2017-02-28", lts: false, security: false, v8: "5.5.372.41" }, { name: "nodejs", version: "7.8.0", date: "2017-03-29", lts: false, security: false, v8: "5.5.372.43" }, { name: "nodejs", version: "7.9.0", date: "2017-04-11", lts: false, security: false, v8: "5.5.372.43" }, { name: "nodejs", version: "7.10.0", date: "2017-05-02", lts: false, security: false, v8: "5.5.372.43" }, { name: "nodejs", version: "8.0.0", date: "2017-05-30", lts: false, security: false, v8: "5.8.283.41" }, { name: "nodejs", version: "8.1.0", date: "2017-06-08", lts: false, security: false, v8: "5.8.283.41" }, { name: "nodejs", version: "8.2.0", date: "2017-07-19", lts: false, security: false, v8: "5.8.283.41" }, { name: "nodejs", version: "8.3.0", date: "2017-08-08", lts: false, security: false, v8: "6.0.286.52" }, { name: "nodejs", version: "8.4.0", date: "2017-08-15", lts: false, security: false, v8: "6.0.286.52" }, { name: "nodejs", version: "8.5.0", date: "2017-09-12", lts: false, security: false, v8: "6.0.287.53" }, { name: "nodejs", version: "8.6.0", date: "2017-09-26", lts: false, security: false, v8: "6.0.287.53" }, { name: "nodejs", version: "8.7.0", date: "2017-10-11", lts: false, security: false, v8: "6.1.534.42" }, { name: "nodejs", version: "8.8.0", date: "2017-10-24", lts: false, security: false, v8: "6.1.534.42" }, { name: "nodejs", version: "8.9.0", date: "2017-10-31", lts: "Carbon", security: false, v8: "6.1.534.46" }, { name: "nodejs", version: "8.10.0", date: "2018-03-06", lts: "Carbon", security: false, v8: "6.2.414.50" }, { name: "nodejs", version: "8.11.0", date: "2018-03-28", lts: "Carbon", security: true, v8: "6.2.414.50" }, { name: "nodejs", version: "8.12.0", date: "2018-09-10", lts: "Carbon", security: false, v8: "6.2.414.66" }, { name: "nodejs", version: "8.13.0", date: "2018-11-20", lts: "Carbon", security: false, v8: "6.2.414.72" }, { name: "nodejs", version: "8.14.0", date: "2018-11-27", lts: "Carbon", security: true, v8: "6.2.414.72" }, { name: "nodejs", version: "8.15.0", date: "2018-12-26", lts: "Carbon", security: false, v8: "6.2.414.75" }, { name: "nodejs", version: "8.16.0", date: "2019-04-16", lts: "Carbon", security: false, v8: "6.2.414.77" }, { name: "nodejs", version: "8.17.0", date: "2019-12-17", lts: "Carbon", security: true, v8: "6.2.414.78" }, { name: "nodejs", version: "9.0.0", date: "2017-10-31", lts: false, security: false, v8: "6.2.414.32" }, { name: "nodejs", version: "9.1.0", date: "2017-11-07", lts: false, security: false, v8: "6.2.414.32" }, { name: "nodejs", version: "9.2.0", date: "2017-11-14", lts: false, security: false, v8: "6.2.414.44" }, { name: "nodejs", version: "9.3.0", date: "2017-12-12", lts: false, security: false, v8: "6.2.414.46" }, { name: "nodejs", version: "9.4.0", date: "2018-01-10", lts: false, security: false, v8: "6.2.414.46" }, { name: "nodejs", version: "9.5.0", date: "2018-01-31", lts: false, security: false, v8: "6.2.414.46" }, { name: "nodejs", version: "9.6.0", date: "2018-02-21", lts: false, security: false, v8: "6.2.414.46" }, { name: "nodejs", version: "9.7.0", date: "2018-03-01", lts: false, security: false, v8: "6.2.414.46" }, { name: "nodejs", version: "9.8.0", date: "2018-03-07", lts: false, security: false, v8: "6.2.414.46" }, { name: "nodejs", version: "9.9.0", date: "2018-03-21", lts: false, security: false, v8: "6.2.414.46" }, { name: "nodejs", version: "9.10.0", date: "2018-03-28", lts: false, security: true, v8: "6.2.414.46" }, { name: "nodejs", version: "9.11.0", date: "2018-04-04", lts: false, security: false, v8: "6.2.414.46" }, { name: "nodejs", version: "10.0.0", date: "2018-04-24", lts: false, security: false, v8: "6.6.346.24" }, { name: "nodejs", version: "10.1.0", date: "2018-05-08", lts: false, security: false, v8: "6.6.346.27" }, { name: "nodejs", version: "10.2.0", date: "2018-05-23", lts: false, security: false, v8: "6.6.346.32" }, { name: "nodejs", version: "10.3.0", date: "2018-05-29", lts: false, security: false, v8: "6.6.346.32" }, { name: "nodejs", version: "10.4.0", date: "2018-06-06", lts: false, security: false, v8: "6.7.288.43" }, { name: "nodejs", version: "10.5.0", date: "2018-06-20", lts: false, security: false, v8: "6.7.288.46" }, { name: "nodejs", version: "10.6.0", date: "2018-07-04", lts: false, security: false, v8: "6.7.288.46" }, { name: "nodejs", version: "10.7.0", date: "2018-07-18", lts: false, security: false, v8: "6.7.288.49" }, { name: "nodejs", version: "10.8.0", date: "2018-08-01", lts: false, security: false, v8: "6.7.288.49" }, { name: "nodejs", version: "10.9.0", date: "2018-08-15", lts: false, security: false, v8: "6.8.275.24" }, { name: "nodejs", version: "10.10.0", date: "2018-09-06", lts: false, security: false, v8: "6.8.275.30" }, { name: "nodejs", version: "10.11.0", date: "2018-09-19", lts: false, security: false, v8: "6.8.275.32" }, { name: "nodejs", version: "10.12.0", date: "2018-10-10", lts: false, security: false, v8: "6.8.275.32" }, { name: "nodejs", version: "10.13.0", date: "2018-10-30", lts: "Dubnium", security: false, v8: "6.8.275.32" }, { name: "nodejs", version: "10.14.0", date: "2018-11-27", lts: "Dubnium", security: true, v8: "6.8.275.32" }, { name: "nodejs", version: "10.15.0", date: "2018-12-26", lts: "Dubnium", security: false, v8: "6.8.275.32" }, { name: "nodejs", version: "10.16.0", date: "2019-05-28", lts: "Dubnium", security: false, v8: "6.8.275.32" }, { name: "nodejs", version: "10.17.0", date: "2019-10-22", lts: "Dubnium", security: false, v8: "6.8.275.32" }, { name: "nodejs", version: "10.18.0", date: "2019-12-17", lts: "Dubnium", security: true, v8: "6.8.275.32" }, { name: "nodejs", version: "10.19.0", date: "2020-02-05", lts: "Dubnium", security: true, v8: "6.8.275.32" }, { name: "nodejs", version: "10.20.0", date: "2020-03-26", lts: "Dubnium", security: false, v8: "6.8.275.32" }, { name: "nodejs", version: "10.21.0", date: "2020-06-02", lts: "Dubnium", security: true, v8: "6.8.275.32" }, { name: "nodejs", version: "10.22.0", date: "2020-07-21", lts: "Dubnium", security: false, v8: "6.8.275.32" }, { name: "nodejs", version: "10.23.0", date: "2020-10-27", lts: "Dubnium", security: false, v8: "6.8.275.32" }, { name: "nodejs", version: "10.24.0", date: "2021-02-23", lts: "Dubnium", security: true, v8: "6.8.275.32" }, { name: "nodejs", version: "11.0.0", date: "2018-10-23", lts: false, security: false, v8: "7.0.276.28" }, { name: "nodejs", version: "11.1.0", date: "2018-10-30", lts: false, security: false, v8: "7.0.276.32" }, { name: "nodejs", version: "11.2.0", date: "2018-11-15", lts: false, security: false, v8: "7.0.276.38" }, { name: "nodejs", version: "11.3.0", date: "2018-11-27", lts: false, security: true, v8: "7.0.276.38" }, { name: "nodejs", version: "11.4.0", date: "2018-12-07", lts: false, security: false, v8: "7.0.276.38" }, { name: "nodejs", version: "11.5.0", date: "2018-12-18", lts: false, security: false, v8: "7.0.276.38" }, { name: "nodejs", version: "11.6.0", date: "2018-12-26", lts: false, security: false, v8: "7.0.276.38" }, { name: "nodejs", version: "11.7.0", date: "2019-01-17", lts: false, security: false, v8: "7.0.276.38" }, { name: "nodejs", version: "11.8.0", date: "2019-01-24", lts: false, security: false, v8: "7.0.276.38" }, { name: "nodejs", version: "11.9.0", date: "2019-01-30", lts: false, security: false, v8: "7.0.276.38" }, { name: "nodejs", version: "11.10.0", date: "2019-02-14", lts: false, security: false, v8: "7.0.276.38" }, { name: "nodejs", version: "11.11.0", date: "2019-03-05", lts: false, security: false, v8: "7.0.276.38" }, { name: "nodejs", version: "11.12.0", date: "2019-03-14", lts: false, security: false, v8: "7.0.276.38" }, { name: "nodejs", version: "11.13.0", date: "2019-03-28", lts: false, security: false, v8: "7.0.276.38" }, { name: "nodejs", version: "11.14.0", date: "2019-04-10", lts: false, security: false, v8: "7.0.276.38" }, { name: "nodejs", version: "11.15.0", date: "2019-04-30", lts: false, security: false, v8: "7.0.276.38" }, { name: "nodejs", version: "12.0.0", date: "2019-04-23", lts: false, security: false, v8: "7.4.288.21" }, { name: "nodejs", version: "12.1.0", date: "2019-04-29", lts: false, security: false, v8: "7.4.288.21" }, { name: "nodejs", version: "12.2.0", date: "2019-05-07", lts: false, security: false, v8: "7.4.288.21" }, { name: "nodejs", version: "12.3.0", date: "2019-05-21", lts: false, security: false, v8: "7.4.288.27" }, { name: "nodejs", version: "12.4.0", date: "2019-06-04", lts: false, security: false, v8: "7.4.288.27" }, { name: "nodejs", version: "12.5.0", date: "2019-06-26", lts: false, security: false, v8: "7.5.288.22" }, { name: "nodejs", version: "12.6.0", date: "2019-07-03", lts: false, security: false, v8: "7.5.288.22" }, { name: "nodejs", version: "12.7.0", date: "2019-07-23", lts: false, security: false, v8: "7.5.288.22" }, { name: "nodejs", version: "12.8.0", date: "2019-08-06", lts: false, security: false, v8: "7.5.288.22" }, { name: "nodejs", version: "12.9.0", date: "2019-08-20", lts: false, security: false, v8: "7.6.303.29" }, { name: "nodejs", version: "12.10.0", date: "2019-09-04", lts: false, security: false, v8: "7.6.303.29" }, { name: "nodejs", version: "12.11.0", date: "2019-09-25", lts: false, security: false, v8: "7.7.299.11" }, { name: "nodejs", version: "12.12.0", date: "2019-10-11", lts: false, security: false, v8: "7.7.299.13" }, { name: "nodejs", version: "12.13.0", date: "2019-10-21", lts: "Erbium", security: false, v8: "7.7.299.13" }, { name: "nodejs", version: "12.14.0", date: "2019-12-17", lts: "Erbium", security: true, v8: "7.7.299.13" }, { name: "nodejs", version: "12.15.0", date: "2020-02-05", lts: "Erbium", security: true, v8: "7.7.299.13" }, { name: "nodejs", version: "12.16.0", date: "2020-02-11", lts: "Erbium", security: false, v8: "7.8.279.23" }, { name: "nodejs", version: "12.17.0", date: "2020-05-26", lts: "Erbium", security: false, v8: "7.8.279.23" }, { name: "nodejs", version: "12.18.0", date: "2020-06-02", lts: "Erbium", security: true, v8: "7.8.279.23" }, { name: "nodejs", version: "12.19.0", date: "2020-10-06", lts: "Erbium", security: false, v8: "7.8.279.23" }, { name: "nodejs", version: "12.20.0", date: "2020-11-24", lts: "Erbium", security: false, v8: "7.8.279.23" }, { name: "nodejs", version: "12.21.0", date: "2021-02-23", lts: "Erbium", security: true, v8: "7.8.279.23" }, { name: "nodejs", version: "12.22.0", date: "2021-03-30", lts: "Erbium", security: false, v8: "7.8.279.23" }, { name: "nodejs", version: "13.0.0", date: "2019-10-22", lts: false, security: false, v8: "7.8.279.17" }, { name: "nodejs", version: "13.1.0", date: "2019-11-05", lts: false, security: false, v8: "7.8.279.17" }, { name: "nodejs", version: "13.2.0", date: "2019-11-21", lts: false, security: false, v8: "7.9.317.23" }, { name: "nodejs", version: "13.3.0", date: "2019-12-03", lts: false, security: false, v8: "7.9.317.25" }, { name: "nodejs", version: "13.4.0", date: "2019-12-17", lts: false, security: true, v8: "7.9.317.25" }, { name: "nodejs", version: "13.5.0", date: "2019-12-18", lts: false, security: false, v8: "7.9.317.25" }, { name: "nodejs", version: "13.6.0", date: "2020-01-07", lts: false, security: false, v8: "7.9.317.25" }, { name: "nodejs", version: "13.7.0", date: "2020-01-21", lts: false, security: false, v8: "7.9.317.25" }, { name: "nodejs", version: "13.8.0", date: "2020-02-05", lts: false, security: true, v8: "7.9.317.25" }, { name: "nodejs", version: "13.9.0", date: "2020-02-18", lts: false, security: false, v8: "7.9.317.25" }, { name: "nodejs", version: "13.10.0", date: "2020-03-04", lts: false, security: false, v8: "7.9.317.25" }, { name: "nodejs", version: "13.11.0", date: "2020-03-12", lts: false, security: false, v8: "7.9.317.25" }, { name: "nodejs", version: "13.12.0", date: "2020-03-26", lts: false, security: false, v8: "7.9.317.25" }, { name: "nodejs", version: "13.13.0", date: "2020-04-14", lts: false, security: false, v8: "7.9.317.25" }, { name: "nodejs", version: "13.14.0", date: "2020-04-29", lts: false, security: false, v8: "7.9.317.25" }, { name: "nodejs", version: "14.0.0", date: "2020-04-21", lts: false, security: false, v8: "8.1.307.30" }, { name: "nodejs", version: "14.1.0", date: "2020-04-29", lts: false, security: false, v8: "8.1.307.31" }, { name: "nodejs", version: "14.2.0", date: "2020-05-05", lts: false, security: false, v8: "8.1.307.31" }, { name: "nodejs", version: "14.3.0", date: "2020-05-19", lts: false, security: false, v8: "8.1.307.31" }, { name: "nodejs", version: "14.4.0", date: "2020-06-02", lts: false, security: true, v8: "8.1.307.31" }, { name: "nodejs", version: "14.5.0", date: "2020-06-30", lts: false, security: false, v8: "8.3.110.9" }, { name: "nodejs", version: "14.6.0", date: "2020-07-20", lts: false, security: false, v8: "8.4.371.19" }, { name: "nodejs", version: "14.7.0", date: "2020-07-29", lts: false, security: false, v8: "8.4.371.19" }, { name: "nodejs", version: "14.8.0", date: "2020-08-11", lts: false, security: false, v8: "8.4.371.19" }, { name: "nodejs", version: "14.9.0", date: "2020-08-27", lts: false, security: false, v8: "8.4.371.19" }, { name: "nodejs", version: "14.10.0", date: "2020-09-08", lts: false, security: false, v8: "8.4.371.19" }, { name: "nodejs", version: "14.11.0", date: "2020-09-15", lts: false, security: true, v8: "8.4.371.19" }, { name: "nodejs", version: "14.12.0", date: "2020-09-22", lts: false, security: false, v8: "8.4.371.19" }, { name: "nodejs", version: "14.13.0", date: "2020-09-29", lts: false, security: false, v8: "8.4.371.19" }, { name: "nodejs", version: "14.14.0", date: "2020-10-15", lts: false, security: false, v8: "8.4.371.19" }, { name: "nodejs", version: "14.15.0", date: "2020-10-27", lts: "Fermium", security: false, v8: "8.4.371.19" }, { name: "nodejs", version: "14.16.0", date: "2021-02-23", lts: "Fermium", security: true, v8: "8.4.371.19" }, { name: "nodejs", version: "14.17.0", date: "2021-05-11", lts: "Fermium", security: false, v8: "8.4.371.23" }, { name: "nodejs", version: "14.18.0", date: "2021-09-28", lts: "Fermium", security: false, v8: "8.4.371.23" }, { name: "nodejs", version: "14.19.0", date: "2022-02-01", lts: "Fermium", security: false, v8: "8.4.371.23" }, { name: "nodejs", version: "14.20.0", date: "2022-07-07", lts: "Fermium", security: true, v8: "8.4.371.23" }, { name: "nodejs", version: "14.21.0", date: "2022-11-01", lts: "Fermium", security: false, v8: "8.4.371.23" }, { name: "nodejs", version: "15.0.0", date: "2020-10-20", lts: false, security: false, v8: "8.6.395.16" }, { name: "nodejs", version: "15.1.0", date: "2020-11-04", lts: false, security: false, v8: "8.6.395.17" }, { name: "nodejs", version: "15.2.0", date: "2020-11-10", lts: false, security: false, v8: "8.6.395.17" }, { name: "nodejs", version: "15.3.0", date: "2020-11-24", lts: false, security: false, v8: "8.6.395.17" }, { name: "nodejs", version: "15.4.0", date: "2020-12-09", lts: false, security: false, v8: "8.6.395.17" }, { name: "nodejs", version: "15.5.0", date: "2020-12-22", lts: false, security: false, v8: "8.6.395.17" }, { name: "nodejs", version: "15.6.0", date: "2021-01-14", lts: false, security: false, v8: "8.6.395.17" }, { name: "nodejs", version: "15.7.0", date: "2021-01-25", lts: false, security: false, v8: "8.6.395.17" }, { name: "nodejs", version: "15.8.0", date: "2021-02-02", lts: false, security: false, v8: "8.6.395.17" }, { name: "nodejs", version: "15.9.0", date: "2021-02-18", lts: false, security: false, v8: "8.6.395.17" }, { name: "nodejs", version: "15.10.0", date: "2021-02-23", lts: false, security: true, v8: "8.6.395.17" }, { name: "nodejs", version: "15.11.0", date: "2021-03-03", lts: false, security: false, v8: "8.6.395.17" }, { name: "nodejs", version: "15.12.0", date: "2021-03-17", lts: false, security: false, v8: "8.6.395.17" }, { name: "nodejs", version: "15.13.0", date: "2021-03-31", lts: false, security: false, v8: "8.6.395.17" }, { name: "nodejs", version: "15.14.0", date: "2021-04-06", lts: false, security: false, v8: "8.6.395.17" }, { name: "nodejs", version: "16.0.0", date: "2021-04-20", lts: false, security: false, v8: "9.0.257.17" }, { name: "nodejs", version: "16.1.0", date: "2021-05-04", lts: false, security: false, v8: "9.0.257.24" }, { name: "nodejs", version: "16.2.0", date: "2021-05-19", lts: false, security: false, v8: "9.0.257.25" }, { name: "nodejs", version: "16.3.0", date: "2021-06-03", lts: false, security: false, v8: "9.0.257.25" }, { name: "nodejs", version: "16.4.0", date: "2021-06-23", lts: false, security: false, v8: "9.1.269.36" }, { name: "nodejs", version: "16.5.0", date: "2021-07-14", lts: false, security: false, v8: "9.1.269.38" }, { name: "nodejs", version: "16.6.0", date: "2021-07-29", lts: false, security: true, v8: "9.2.230.21" }, { name: "nodejs", version: "16.7.0", date: "2021-08-18", lts: false, security: false, v8: "9.2.230.21" }, { name: "nodejs", version: "16.8.0", date: "2021-08-25", lts: false, security: false, v8: "9.2.230.21" }, { name: "nodejs", version: "16.9.0", date: "2021-09-07", lts: false, security: false, v8: "9.3.345.16" }, { name: "nodejs", version: "16.10.0", date: "2021-09-22", lts: false, security: false, v8: "9.3.345.19" }, { name: "nodejs", version: "16.11.0", date: "2021-10-08", lts: false, security: false, v8: "9.4.146.19" }, { name: "nodejs", version: "16.12.0", date: "2021-10-20", lts: false, security: false, v8: "9.4.146.19" }, { name: "nodejs", version: "16.13.0", date: "2021-10-26", lts: "Gallium", security: false, v8: "9.4.146.19" }, { name: "nodejs", version: "16.14.0", date: "2022-02-08", lts: "Gallium", security: false, v8: "9.4.146.24" }, { name: "nodejs", version: "16.15.0", date: "2022-04-26", lts: "Gallium", security: false, v8: "9.4.146.24" }, { name: "nodejs", version: "16.16.0", date: "2022-07-07", lts: "Gallium", security: true, v8: "9.4.146.24" }, { name: "nodejs", version: "16.17.0", date: "2022-08-16", lts: "Gallium", security: false, v8: "9.4.146.26" }, { name: "nodejs", version: "16.18.0", date: "2022-10-12", lts: "Gallium", security: false, v8: "9.4.146.26" }, { name: "nodejs", version: "16.19.0", date: "2022-12-13", lts: "Gallium", security: false, v8: "9.4.146.26" }, { name: "nodejs", version: "16.20.0", date: "2023-03-28", lts: "Gallium", security: false, v8: "9.4.146.26" }, { name: "nodejs", version: "17.0.0", date: "2021-10-19", lts: false, security: false, v8: "9.5.172.21" }, { name: "nodejs", version: "17.1.0", date: "2021-11-09", lts: false, security: false, v8: "9.5.172.25" }, { name: "nodejs", version: "17.2.0", date: "2021-11-30", lts: false, security: false, v8: "9.6.180.14" }, { name: "nodejs", version: "17.3.0", date: "2021-12-17", lts: false, security: false, v8: "9.6.180.15" }, { name: "nodejs", version: "17.4.0", date: "2022-01-18", lts: false, security: false, v8: "9.6.180.15" }, { name: "nodejs", version: "17.5.0", date: "2022-02-10", lts: false, security: false, v8: "9.6.180.15" }, { name: "nodejs", version: "17.6.0", date: "2022-02-22", lts: false, security: false, v8: "9.6.180.15" }, { name: "nodejs", version: "17.7.0", date: "2022-03-09", lts: false, security: false, v8: "9.6.180.15" }, { name: "nodejs", version: "17.8.0", date: "2022-03-22", lts: false, security: false, v8: "9.6.180.15" }, { name: "nodejs", version: "17.9.0", date: "2022-04-07", lts: false, security: false, v8: "9.6.180.15" }, { name: "nodejs", version: "18.0.0", date: "2022-04-18", lts: false, security: false, v8: "10.1.124.8" }, { name: "nodejs", version: "18.1.0", date: "2022-05-03", lts: false, security: false, v8: "10.1.124.8" }, { name: "nodejs", version: "18.2.0", date: "2022-05-17", lts: false, security: false, v8: "10.1.124.8" }, { name: "nodejs", version: "18.3.0", date: "2022-06-02", lts: false, security: false, v8: "10.2.154.4" }, { name: "nodejs", version: "18.4.0", date: "2022-06-16", lts: false, security: false, v8: "10.2.154.4" }, { name: "nodejs", version: "18.5.0", date: "2022-07-06", lts: false, security: true, v8: "10.2.154.4" }, { name: "nodejs", version: "18.6.0", date: "2022-07-13", lts: false, security: false, v8: "10.2.154.13" }, { name: "nodejs", version: "18.7.0", date: "2022-07-26", lts: false, security: false, v8: "10.2.154.13" }, { name: "nodejs", version: "18.8.0", date: "2022-08-24", lts: false, security: false, v8: "10.2.154.13" }, { name: "nodejs", version: "18.9.0", date: "2022-09-07", lts: false, security: false, v8: "10.2.154.15" }, { name: "nodejs", version: "18.10.0", date: "2022-09-28", lts: false, security: false, v8: "10.2.154.15" }, { name: "nodejs", version: "18.11.0", date: "2022-10-13", lts: false, security: false, v8: "10.2.154.15" }, { name: "nodejs", version: "18.12.0", date: "2022-10-25", lts: "Hydrogen", security: false, v8: "10.2.154.15" }, { name: "nodejs", version: "18.13.0", date: "2023-01-05", lts: "Hydrogen", security: false, v8: "10.2.154.23" }, { name: "nodejs", version: "18.14.0", date: "2023-02-01", lts: "Hydrogen", security: false, v8: "10.2.154.23" }, { name: "nodejs", version: "18.15.0", date: "2023-03-05", lts: "Hydrogen", security: false, v8: "10.2.154.26" }, { name: "nodejs", version: "18.16.0", date: "2023-04-12", lts: "Hydrogen", security: false, v8: "10.2.154.26" }, { name: "nodejs", version: "18.17.0", date: "2023-07-18", lts: "Hydrogen", security: false, v8: "10.2.154.26" }, { name: "nodejs", version: "18.18.0", date: "2023-09-18", lts: "Hydrogen", security: false, v8: "10.2.154.26" }, { name: "nodejs", version: "18.19.0", date: "2023-11-29", lts: "Hydrogen", security: false, v8: "10.2.154.26" }, { name: "nodejs", version: "18.20.0", date: "2024-03-26", lts: "Hydrogen", security: false, v8: "10.2.154.26" }, { name: "nodejs", version: "19.0.0", date: "2022-10-17", lts: false, security: false, v8: "10.7.193.13" }, { name: "nodejs", version: "19.1.0", date: "2022-11-14", lts: false, security: false, v8: "10.7.193.20" }, { name: "nodejs", version: "19.2.0", date: "2022-11-29", lts: false, security: false, v8: "10.8.168.20" }, { name: "nodejs", version: "19.3.0", date: "2022-12-14", lts: false, security: false, v8: "10.8.168.21" }, { name: "nodejs", version: "19.4.0", date: "2023-01-05", lts: false, security: false, v8: "10.8.168.25" }, { name: "nodejs", version: "19.5.0", date: "2023-01-24", lts: false, security: false, v8: "10.8.168.25" }, { name: "nodejs", version: "19.6.0", date: "2023-02-01", lts: false, security: false, v8: "10.8.168.25" }, { name: "nodejs", version: "19.7.0", date: "2023-02-21", lts: false, security: false, v8: "10.8.168.25" }, { name: "nodejs", version: "19.8.0", date: "2023-03-14", lts: false, security: false, v8: "10.8.168.25" }, { name: "nodejs", version: "19.9.0", date: "2023-04-10", lts: false, security: false, v8: "10.8.168.25" }, { name: "nodejs", version: "20.0.0", date: "2023-04-17", lts: false, security: false, v8: "11.3.244.4" }, { name: "nodejs", version: "20.1.0", date: "2023-05-03", lts: false, security: false, v8: "11.3.244.8" }, { name: "nodejs", version: "20.2.0", date: "2023-05-16", lts: false, security: false, v8: "11.3.244.8" }, { name: "nodejs", version: "20.3.0", date: "2023-06-08", lts: false, security: false, v8: "11.3.244.8" }, { name: "nodejs", version: "20.4.0", date: "2023-07-04", lts: false, security: false, v8: "11.3.244.8" }, { name: "nodejs", version: "20.5.0", date: "2023-07-19", lts: false, security: false, v8: "11.3.244.8" }, { name: "nodejs", version: "20.6.0", date: "2023-08-23", lts: false, security: false, v8: "11.3.244.8" }, { name: "nodejs", version: "20.7.0", date: "2023-09-18", lts: false, security: false, v8: "11.3.244.8" }, { name: "nodejs", version: "20.8.0", date: "2023-09-28", lts: false, security: false, v8: "11.3.244.8" }, { name: "nodejs", version: "20.9.0", date: "2023-10-24", lts: "Iron", security: false, v8: "11.3.244.8" }, { name: "nodejs", version: "20.10.0", date: "2023-11-22", lts: "Iron", security: false, v8: "11.3.244.8" }, { name: "nodejs", version: "20.11.0", date: "2024-01-09", lts: "Iron", security: false, v8: "11.3.244.8" }, { name: "nodejs", version: "20.12.0", date: "2024-03-26", lts: "Iron", security: false, v8: "11.3.244.8" }, { name: "nodejs", version: "20.13.0", date: "2024-05-07", lts: "Iron", security: false, v8: "11.3.244.8" }, { name: "nodejs", version: "20.14.0", date: "2024-05-28", lts: "Iron", security: false, v8: "11.3.244.8" }, { name: "nodejs", version: "20.15.0", date: "2024-06-20", lts: "Iron", security: false, v8: "11.3.244.8" }, { name: "nodejs", version: "20.16.0", date: "2024-07-24", lts: "Iron", security: false, v8: "11.3.244.8" }, { name: "nodejs", version: "20.17.0", date: "2024-08-21", lts: "Iron", security: false, v8: "11.3.244.8" }, { name: "nodejs", version: "20.18.0", date: "2024-10-03", lts: "Iron", security: false, v8: "11.3.244.8" }, { name: "nodejs", version: "21.0.0", date: "2023-10-17", lts: false, security: false, v8: "11.8.172.13" }, { name: "nodejs", version: "21.1.0", date: "2023-10-24", lts: false, security: false, v8: "11.8.172.15" }, { name: "nodejs", version: "21.2.0", date: "2023-11-14", lts: false, security: false, v8: "11.8.172.17" }, { name: "nodejs", version: "21.3.0", date: "2023-11-30", lts: false, security: false, v8: "11.8.172.17" }, { name: "nodejs", version: "21.4.0", date: "2023-12-05", lts: false, security: false, v8: "11.8.172.17" }, { name: "nodejs", version: "21.5.0", date: "2023-12-19", lts: false, security: false, v8: "11.8.172.17" }, { name: "nodejs", version: "21.6.0", date: "2024-01-14", lts: false, security: false, v8: "11.8.172.17" }, { name: "nodejs", version: "21.7.0", date: "2024-03-06", lts: false, security: false, v8: "11.8.172.17" }, { name: "nodejs", version: "22.0.0", date: "2024-04-24", lts: false, security: false, v8: "12.4.254.14" }, { name: "nodejs", version: "22.1.0", date: "2024-05-02", lts: false, security: false, v8: "12.4.254.14" }, { name: "nodejs", version: "22.2.0", date: "2024-05-15", lts: false, security: false, v8: "12.4.254.14" }, { name: "nodejs", version: "22.3.0", date: "2024-06-11", lts: false, security: false, v8: "12.4.254.20" }, { name: "nodejs", version: "22.4.0", date: "2024-07-02", lts: false, security: false, v8: "12.4.254.21" }, { name: "nodejs", version: "22.5.0", date: "2024-07-17", lts: false, security: false, v8: "12.4.254.21" }, { name: "nodejs", version: "22.6.0", date: "2024-08-06", lts: false, security: false, v8: "12.4.254.21" }, { name: "nodejs", version: "22.7.0", date: "2024-08-21", lts: false, security: false, v8: "12.4.254.21" }, { name: "nodejs", version: "22.8.0", date: "2024-09-03", lts: false, security: false, v8: "12.4.254.21" }, { name: "nodejs", version: "22.9.0", date: "2024-09-17", lts: false, security: false, v8: "12.4.254.21" }, { name: "nodejs", version: "22.10.0", date: "2024-10-16", lts: false, security: false, v8: "12.4.254.21" }, { name: "nodejs", version: "22.11.0", date: "2024-10-29", lts: "Jod", security: false, v8: "12.4.254.21" }, { name: "nodejs", version: "22.12.0", date: "2024-12-02", lts: "Jod", security: false, v8: "12.4.254.21" }, { name: "nodejs", version: "23.0.0", date: "2024-10-16", lts: false, security: false, v8: "12.9.202.26" }, { name: "nodejs", version: "23.1.0", date: "2024-10-24", lts: false, security: false, v8: "12.9.202.28" }, { name: "nodejs", version: "23.2.0", date: "2024-11-11", lts: false, security: false, v8: "12.9.202.28" }, { name: "nodejs", version: "23.3.0", date: "2024-11-20", lts: false, security: false, v8: "12.9.202.28" }];
  }
});

// node_modules/caniuse-lite/data/browsers.js
var require_browsers = __commonJS({
  "node_modules/caniuse-lite/data/browsers.js"(exports2, module2) {
    module2.exports = { A: "ie", B: "edge", C: "firefox", D: "chrome", E: "safari", F: "opera", G: "ios_saf", H: "op_mini", I: "android", J: "bb", K: "op_mob", L: "and_chr", M: "and_ff", N: "ie_mob", O: "and_uc", P: "samsung", Q: "and_qq", R: "baidu", S: "kaios" };
  }
});

// node_modules/caniuse-lite/dist/unpacker/browsers.js
var require_browsers2 = __commonJS({
  "node_modules/caniuse-lite/dist/unpacker/browsers.js"(exports2, module2) {
    module2.exports.browsers = require_browsers();
  }
});

// node_modules/caniuse-lite/data/browserVersions.js
var require_browserVersions = __commonJS({
  "node_modules/caniuse-lite/data/browserVersions.js"(exports2, module2) {
    module2.exports = { "0": "117", "1": "20", "2": "21", "3": "22", "4": "23", "5": "24", "6": "25", "7": "26", "8": "27", "9": "28", A: "10", B: "11", C: "12", D: "7", E: "8", F: "9", G: "15", H: "80", I: "139", J: "4", K: "6", L: "13", M: "14", N: "16", O: "17", P: "18", Q: "79", R: "81", S: "83", T: "84", U: "85", V: "86", W: "87", X: "88", Y: "89", Z: "90", a: "91", b: "92", c: "93", d: "94", e: "95", f: "96", g: "97", h: "98", i: "99", j: "100", k: "101", l: "102", m: "103", n: "104", o: "105", p: "106", q: "107", r: "108", s: "109", t: "110", u: "111", v: "112", w: "113", x: "114", y: "115", z: "116", AB: "118", BB: "119", CB: "120", DB: "121", EB: "122", FB: "123", GB: "124", HB: "125", IB: "126", JB: "127", KB: "128", LB: "129", MB: "130", NB: "131", OB: "132", PB: "133", QB: "134", RB: "135", SB: "136", TB: "137", UB: "138", VB: "5", WB: "19", XB: "29", YB: "30", ZB: "31", aB: "32", bB: "33", cB: "34", dB: "35", eB: "36", fB: "37", gB: "38", hB: "39", iB: "40", jB: "41", kB: "42", lB: "43", mB: "44", nB: "45", oB: "46", pB: "47", qB: "48", rB: "49", sB: "50", tB: "51", uB: "52", vB: "53", wB: "54", xB: "55", yB: "56", zB: "57", "0B": "58", "1B": "60", "2B": "62", "3B": "63", "4B": "64", "5B": "65", "6B": "66", "7B": "67", "8B": "68", "9B": "69", AC: "70", BC: "71", CC: "72", DC: "73", EC: "74", FC: "75", GC: "76", HC: "77", IC: "78", JC: "142", KC: "11.1", LC: "12.1", MC: "15.5", NC: "16.0", OC: "17.0", PC: "18.0", QC: "3", RC: "59", SC: "61", TC: "82", UC: "140", VC: "141", WC: "3.2", XC: "10.1", YC: "15.2-15.3", ZC: "15.4", aC: "16.1", bC: "16.2", cC: "16.3", dC: "16.4", eC: "16.5", fC: "17.1", gC: "17.2", hC: "17.3", iC: "17.4", jC: "17.5", kC: "18.1", lC: "18.2", mC: "18.3", nC: "18.4", oC: "18.5-18.6", pC: "26.0", qC: "11.5", rC: "4.2-4.3", sC: "5.5", tC: "2", uC: "143", vC: "144", wC: "145", xC: "3.5", yC: "3.6", zC: "3.1", "0C": "5.1", "1C": "6.1", "2C": "7.1", "3C": "9.1", "4C": "13.1", "5C": "14.1", "6C": "15.1", "7C": "15.6", "8C": "16.6", "9C": "17.6", AD: "TP", BD: "9.5-9.6", CD: "10.0-10.1", DD: "10.5", ED: "10.6", FD: "11.6", GD: "4.0-4.1", HD: "5.0-5.1", ID: "6.0-6.1", JD: "7.0-7.1", KD: "8.1-8.4", LD: "9.0-9.2", MD: "9.3", ND: "10.0-10.2", OD: "10.3", PD: "11.0-11.2", QD: "11.3-11.4", RD: "12.0-12.1", SD: "12.2-12.5", TD: "13.0-13.1", UD: "13.2", VD: "13.3", WD: "13.4-13.7", XD: "14.0-14.4", YD: "14.5-14.8", ZD: "15.0-15.1", aD: "15.6-15.8", bD: "16.6-16.7", cD: "17.6-17.7", dD: "all", eD: "2.1", fD: "2.2", gD: "2.3", hD: "4.1", iD: "4.4", jD: "4.4.3-4.4.4", kD: "5.0-5.4", lD: "6.2-6.4", mD: "7.2-7.4", nD: "8.2", oD: "9.2", pD: "11.1-11.2", qD: "12.0", rD: "13.0", sD: "14.0", tD: "15.0", uD: "19.0", vD: "14.9", wD: "13.52", xD: "2.5", yD: "3.0-3.1" };
  }
});

// node_modules/caniuse-lite/dist/unpacker/browserVersions.js
var require_browserVersions2 = __commonJS({
  "node_modules/caniuse-lite/dist/unpacker/browserVersions.js"(exports2, module2) {
    module2.exports.browserVersions = require_browserVersions();
  }
});

// node_modules/caniuse-lite/data/agents.js
var require_agents = __commonJS({
  "node_modules/caniuse-lite/data/agents.js"(exports2, module2) {
    module2.exports = { A: { A: { K: 0, D: 0, E: 0.0331526, F: 0.0248644, A: 828815e-8, B: 0.605035, sC: 0 }, B: "ms", C: ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "sC", "K", "D", "E", "F", "A", "B", "", "", ""], E: "IE", F: { sC: 962323200, K: 998870400, D: 1161129600, E: 1237420800, F: 1300060800, A: 1346716800, B: 1381968e3 } }, B: { A: { "0": 0, C: 0, L: 0, M: 0, G: 0, N: 0, O: 0, P: 0.04422, Q: 0, H: 0, R: 0, S: 0, T: 0, U: 0, V: 0, W: 0, X: 0, Y: 0, Z: 0, a: 0, b: 0.01206, c: 0, d: 0, e: 0, f: 0, g: 0, h: 0, i: 0, j: 0, k: 0, l: 0, m: 402e-5, n: 0, o: 0, p: 0, q: 0, r: 0, s: 0.0402, t: 0, u: 0, v: 0, w: 804e-5, x: 0.01206, y: 402e-5, z: 0, AB: 0, BB: 0, CB: 0.02814, DB: 804e-5, EB: 0.01206, FB: 402e-5, GB: 402e-5, HB: 402e-5, IB: 0.01206, JB: 0.01206, KB: 804e-5, LB: 0.0201, MB: 0.01206, NB: 0.02814, OB: 0.01608, PB: 0.01608, QB: 0.04824, RB: 0.02814, SB: 0.04824, TB: 0.21306, UB: 4.0602, I: 0.01206 }, B: "webkit", C: ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "C", "L", "M", "G", "N", "O", "P", "Q", "H", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "0", "AB", "BB", "CB", "DB", "EB", "FB", "GB", "HB", "IB", "JB", "KB", "LB", "MB", "NB", "OB", "PB", "QB", "RB", "SB", "TB", "UB", "I", "", "", ""], E: "Edge", F: { "0": 1694649600, C: 1438128e3, L: 1447286400, M: 1470096e3, G: 1491868800, N: 1508198400, O: 1525046400, P: 1542067200, Q: 1579046400, H: 1581033600, R: 1586736e3, S: 1590019200, T: 1594857600, U: 1598486400, V: 1602201600, W: 1605830400, X: 161136e4, Y: 1614816e3, Z: 1618358400, a: 1622073600, b: 1626912e3, c: 1630627200, d: 1632441600, e: 1634774400, f: 1637539200, g: 1641427200, h: 1643932800, i: 1646265600, j: 1649635200, k: 1651190400, l: 1653955200, m: 1655942400, n: 1659657600, o: 1661990400, p: 1664755200, q: 1666915200, r: 1670198400, s: 1673481600, t: 1675900800, u: 1678665600, v: 1680825600, w: 1683158400, x: 1685664e3, y: 1689897600, z: 1692576e3, AB: 1697155200, BB: 1698969600, CB: 1701993600, DB: 1706227200, EB: 1708732800, FB: 1711152e3, GB: 1713398400, HB: 1715990400, IB: 1718841600, JB: 1721865600, KB: 1724371200, LB: 1726704e3, MB: 1729123200, NB: 1731542400, OB: 1737417600, PB: 1740614400, QB: 1741219200, RB: 1743984e3, SB: 1746316800, TB: 1748476800, UB: 1750896e3, I: 1754611200 }, D: { C: "ms", L: "ms", M: "ms", G: "ms", N: "ms", O: "ms", P: "ms" } }, C: { A: { "0": 0, "1": 0, "2": 0, "3": 0, "4": 0, "5": 0, "6": 0, "7": 0, "8": 0, "9": 0, tC: 0, QC: 0, J: 0, VB: 0, K: 0, D: 0, E: 0, F: 0, A: 0, B: 0.04824, C: 0, L: 0, M: 0, G: 0, N: 0, O: 0, P: 0, WB: 0, XB: 0, YB: 0, ZB: 0, aB: 0, bB: 0, cB: 0, dB: 0, eB: 0, fB: 0, gB: 0, hB: 0, iB: 0, jB: 0, kB: 0, lB: 804e-5, mB: 0, nB: 402e-5, oB: 0, pB: 0, qB: 0, rB: 0, sB: 0, tB: 0, uB: 0.03216, vB: 0, wB: 0, xB: 0, yB: 0, zB: 0, "0B": 0, RC: 804e-5, "1B": 0, SC: 0, "2B": 0, "3B": 0, "4B": 0, "5B": 0, "6B": 0, "7B": 0, "8B": 0, "9B": 0, AC: 0.01206, BC: 0, CC: 0.01608, DC: 0, EC: 0, FC: 0, GC: 0, HC: 0, IC: 0.01206, Q: 0, H: 0, R: 0, TC: 0, S: 0, T: 0, U: 0, V: 0, W: 0, X: 0, Y: 0, Z: 0, a: 0, b: 0, c: 0, d: 0, e: 0, f: 0, g: 0, h: 0, i: 0, j: 0, k: 0, l: 0, m: 0, n: 0, o: 0, p: 0, q: 0, r: 0, s: 402e-5, t: 0, u: 0, v: 0, w: 402e-5, x: 0, y: 0.17286, z: 0, AB: 0.11658, BB: 0, CB: 0, DB: 0, EB: 0, FB: 0, GB: 0, HB: 0.01206, IB: 0.01206, JB: 402e-5, KB: 0.1005, LB: 804e-5, MB: 0, NB: 0, OB: 0, PB: 0.01206, QB: 804e-5, RB: 804e-5, SB: 0.01608, TB: 0.01206, UB: 0.01608, I: 0.09648, UC: 1.01304, VC: 0.31356, JC: 0, uC: 0, vC: 0, wC: 0, xC: 0, yC: 0 }, B: "moz", C: ["tC", "QC", "xC", "yC", "J", "VB", "K", "D", "E", "F", "A", "B", "C", "L", "M", "G", "N", "O", "P", "WB", "1", "2", "3", "4", "5", "6", "7", "8", "9", "XB", "YB", "ZB", "aB", "bB", "cB", "dB", "eB", "fB", "gB", "hB", "iB", "jB", "kB", "lB", "mB", "nB", "oB", "pB", "qB", "rB", "sB", "tB", "uB", "vB", "wB", "xB", "yB", "zB", "0B", "RC", "1B", "SC", "2B", "3B", "4B", "5B", "6B", "7B", "8B", "9B", "AC", "BC", "CC", "DC", "EC", "FC", "GC", "HC", "IC", "Q", "H", "R", "TC", "S", "T", "U", "V", "W", "X", "Y", "Z", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "0", "AB", "BB", "CB", "DB", "EB", "FB", "GB", "HB", "IB", "JB", "KB", "LB", "MB", "NB", "OB", "PB", "QB", "RB", "SB", "TB", "UB", "I", "UC", "VC", "JC", "uC", "vC", "wC"], E: "Firefox", F: { "0": 1693267200, "1": 1361232e3, "2": 1364860800, "3": 1368489600, "4": 1372118400, "5": 1375747200, "6": 1379376e3, "7": 1386633600, "8": 1391472e3, "9": 1395100800, tC: 1161648e3, QC: 1213660800, xC: 124632e4, yC: 1264032e3, J: 1300752e3, VB: 1308614400, K: 1313452800, D: 1317081600, E: 1317081600, F: 1320710400, A: 1324339200, B: 1327968e3, C: 1331596800, L: 1335225600, M: 1338854400, G: 1342483200, N: 1346112e3, O: 1349740800, P: 1353628800, WB: 1357603200, XB: 1398729600, YB: 1402358400, ZB: 1405987200, aB: 1409616e3, bB: 1413244800, cB: 1417392e3, dB: 1421107200, eB: 1424736e3, fB: 1428278400, gB: 1431475200, hB: 1435881600, iB: 1439251200, jB: 144288e4, kB: 1446508800, lB: 1450137600, mB: 1453852800, nB: 1457395200, oB: 1461628800, pB: 1465257600, qB: 1470096e3, rB: 1474329600, sB: 1479168e3, tB: 1485216e3, uB: 1488844800, vB: 149256e4, wB: 1497312e3, xB: 1502150400, yB: 1506556800, zB: 1510617600, "0B": 1516665600, RC: 1520985600, "1B": 1525824e3, SC: 1529971200, "2B": 1536105600, "3B": 1540252800, "4B": 1544486400, "5B": 154872e4, "6B": 1552953600, "7B": 1558396800, "8B": 1562630400, "9B": 1567468800, AC: 1571788800, BC: 1575331200, CC: 1578355200, DC: 1581379200, EC: 1583798400, FC: 1586304e3, GC: 1588636800, HC: 1591056e3, IC: 1593475200, Q: 1595894400, H: 1598313600, R: 1600732800, TC: 1603152e3, S: 1605571200, T: 1607990400, U: 1611619200, V: 1614038400, W: 1616457600, X: 1618790400, Y: 1622505600, Z: 1626134400, a: 1628553600, b: 1630972800, c: 1633392e3, d: 1635811200, e: 1638835200, f: 1641859200, g: 1644364800, h: 1646697600, i: 1649116800, j: 1651536e3, k: 1653955200, l: 1656374400, m: 1658793600, n: 1661212800, o: 1663632e3, p: 1666051200, q: 1668470400, r: 1670889600, s: 1673913600, t: 1676332800, u: 1678752e3, v: 1681171200, w: 1683590400, x: 1686009600, y: 1688428800, z: 1690848e3, AB: 1695686400, BB: 1698105600, CB: 1700524800, DB: 1702944e3, EB: 1705968e3, FB: 1708387200, GB: 1710806400, HB: 1713225600, IB: 1715644800, JB: 1718064e3, KB: 1720483200, LB: 1722902400, MB: 1725321600, NB: 1727740800, OB: 173016e4, PB: 1732579200, QB: 1736208e3, RB: 1738627200, SB: 1741046400, TB: 1743465600, UB: 1745884800, I: 1748304e3, UC: 1750723200, VC: 1753142400, JC: 1755561600, uC: null, vC: null, wC: null } }, D: { A: { "0": 0.09648, "1": 0, "2": 0, "3": 0, "4": 0, "5": 0, "6": 0, "7": 0, "8": 0, "9": 0, J: 0, VB: 0, K: 0, D: 0, E: 0, F: 0, A: 0, B: 0, C: 0, L: 0, M: 0, G: 0, N: 0, O: 0, P: 0, WB: 0, XB: 0, YB: 0, ZB: 0, aB: 0, bB: 0, cB: 0, dB: 0, eB: 0, fB: 0, gB: 0, hB: 804e-5, iB: 804e-5, jB: 804e-5, kB: 804e-5, lB: 804e-5, mB: 804e-5, nB: 0.01206, oB: 804e-5, pB: 804e-5, qB: 0.0201, rB: 0.01608, sB: 804e-5, tB: 804e-5, uB: 0.01206, vB: 804e-5, wB: 804e-5, xB: 804e-5, yB: 0.0201, zB: 804e-5, "0B": 804e-5, RC: 804e-5, "1B": 804e-5, SC: 0, "2B": 0, "3B": 0, "4B": 0, "5B": 0, "6B": 0.02412, "7B": 0, "8B": 402e-5, "9B": 0.01206, AC: 0.01608, BC: 0, CC: 0, DC: 402e-5, EC: 804e-5, FC: 402e-5, GC: 402e-5, HC: 0, IC: 804e-5, Q: 0.07236, H: 0.01206, R: 0.02412, S: 0.04824, T: 0, U: 804e-5, V: 0.01206, W: 0.03618, X: 804e-5, Y: 402e-5, Z: 804e-5, a: 0.02814, b: 804e-5, c: 804e-5, d: 804e-5, e: 402e-5, f: 804e-5, g: 0.0201, h: 0.04422, i: 0.01608, j: 804e-5, k: 0.02412, l: 0.0201, m: 0.0804, n: 0.03618, o: 0.03216, p: 0.01206, q: 0.01608, r: 0.03216, s: 0.7638, t: 0.01608, u: 0.02814, v: 4.78782, w: 0.05226, x: 0.04824, y: 0.0201, z: 0.06834, AB: 0.05226, BB: 0.04422, CB: 0.06834, DB: 0.06834, EB: 0.07236, FB: 0.07236, GB: 0.0603, HB: 0.41808, IB: 0.0603, JB: 0.03216, KB: 0.08442, LB: 0.06834, MB: 0.10854, NB: 0.49446, OB: 0.1407, PB: 0.13668, QB: 0.1206, RB: 0.21306, SB: 0.30552, TB: 3.23208, UB: 11.855, I: 0.0201, UC: 0.01608, VC: 0, JC: 0 }, B: "webkit", C: ["", "", "", "", "", "", "", "", "J", "VB", "K", "D", "E", "F", "A", "B", "C", "L", "M", "G", "N", "O", "P", "WB", "1", "2", "3", "4", "5", "6", "7", "8", "9", "XB", "YB", "ZB", "aB", "bB", "cB", "dB", "eB", "fB", "gB", "hB", "iB", "jB", "kB", "lB", "mB", "nB", "oB", "pB", "qB", "rB", "sB", "tB", "uB", "vB", "wB", "xB", "yB", "zB", "0B", "RC", "1B", "SC", "2B", "3B", "4B", "5B", "6B", "7B", "8B", "9B", "AC", "BC", "CC", "DC", "EC", "FC", "GC", "HC", "IC", "Q", "H", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "0", "AB", "BB", "CB", "DB", "EB", "FB", "GB", "HB", "IB", "JB", "KB", "LB", "MB", "NB", "OB", "PB", "QB", "RB", "SB", "TB", "UB", "I", "UC", "VC", "JC"], E: "Chrome", F: { "0": 1694476800, "1": 133704e4, "2": 1340668800, "3": 1343692800, "4": 1348531200, "5": 1352246400, "6": 1357862400, "7": 1361404800, "8": 1364428800, "9": 1369094400, J: 1264377600, VB: 1274745600, K: 1283385600, D: 1287619200, E: 1291248e3, F: 1296777600, A: 1299542400, B: 1303862400, C: 1307404800, L: 1312243200, M: 1316131200, G: 1316131200, N: 1319500800, O: 1323734400, P: 1328659200, WB: 1332892800, XB: 1374105600, YB: 1376956800, ZB: 1384214400, aB: 1389657600, bB: 1392940800, cB: 1397001600, dB: 1400544e3, eB: 1405468800, fB: 1409011200, gB: 141264e4, hB: 1416268800, iB: 1421798400, jB: 1425513600, kB: 1429401600, lB: 143208e4, mB: 1437523200, nB: 1441152e3, oB: 1444780800, pB: 1449014400, qB: 1453248e3, rB: 1456963200, sB: 1460592e3, tB: 1464134400, uB: 1469059200, vB: 1472601600, wB: 1476230400, xB: 1480550400, yB: 1485302400, zB: 1489017600, "0B": 149256e4, RC: 1496707200, "1B": 1500940800, SC: 1504569600, "2B": 1508198400, "3B": 1512518400, "4B": 1516752e3, "5B": 1520294400, "6B": 1523923200, "7B": 1527552e3, "8B": 1532390400, "9B": 1536019200, AC: 1539648e3, BC: 1543968e3, CC: 154872e4, DC: 1552348800, EC: 1555977600, FC: 1559606400, GC: 1564444800, HC: 1568073600, IC: 1571702400, Q: 1575936e3, H: 1580860800, R: 1586304e3, S: 1589846400, T: 1594684800, U: 1598313600, V: 1601942400, W: 1605571200, X: 1611014400, Y: 1614556800, Z: 1618272e3, a: 1621987200, b: 1626739200, c: 1630368e3, d: 1632268800, e: 1634601600, f: 1637020800, g: 1641340800, h: 1643673600, i: 1646092800, j: 1648512e3, k: 1650931200, l: 1653350400, m: 1655769600, n: 1659398400, o: 1661817600, p: 1664236800, q: 1666656e3, r: 166968e4, s: 1673308800, t: 1675728e3, u: 1678147200, v: 1680566400, w: 1682985600, x: 1685404800, y: 1689724800, z: 1692057600, AB: 1696896e3, BB: 1698710400, CB: 1701993600, DB: 1705968e3, EB: 1708387200, FB: 1710806400, GB: 1713225600, HB: 1715644800, IB: 1718064e3, JB: 1721174400, KB: 1724112e3, LB: 1726531200, MB: 1728950400, NB: 1731369600, OB: 1736812800, PB: 1738627200, QB: 1741046400, RB: 1743465600, SB: 1745884800, TB: 1748304e3, UB: 1750723200, I: 1754352e3, UC: null, VC: null, JC: null } }, E: { A: { J: 0, VB: 0, K: 0, D: 0, E: 0, F: 0, A: 0, B: 402e-5, C: 0, L: 804e-5, M: 0.01206, G: 0, zC: 0, WC: 0, "0C": 0, "1C": 0, "2C": 0, "3C": 0, XC: 0, KC: 402e-5, LC: 402e-5, "4C": 0.02814, "5C": 0.03216, "6C": 0.03216, YC: 0, ZC: 804e-5, MC: 804e-5, "7C": 0.11658, NC: 0.02412, aC: 0.01608, bC: 0.01206, cC: 0.02814, dC: 0.01206, eC: 0.01608, "8C": 0.16482, OC: 804e-5, fC: 0.11256, gC: 0.01206, hC: 0.01608, iC: 0.02814, jC: 0.04422, "9C": 0.1608, PC: 0.0201, kC: 0.03618, lC: 0.01608, mC: 0.0804, nC: 0.0603, oC: 1.37484, pC: 0.01206, AD: 0 }, B: "webkit", C: ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "zC", "WC", "J", "VB", "0C", "K", "1C", "D", "2C", "E", "F", "3C", "A", "XC", "B", "KC", "C", "LC", "L", "4C", "M", "5C", "G", "6C", "YC", "ZC", "MC", "7C", "NC", "aC", "bC", "cC", "dC", "eC", "8C", "OC", "fC", "gC", "hC", "iC", "jC", "9C", "PC", "kC", "lC", "mC", "nC", "oC", "pC", "AD", ""], E: "Safari", F: { zC: 1205798400, WC: 1226534400, J: 1244419200, VB: 1275868800, "0C": 131112e4, K: 1343174400, "1C": 13824e5, D: 13824e5, "2C": 1410998400, E: 1413417600, F: 1443657600, "3C": 1458518400, A: 1474329600, XC: 1490572800, B: 1505779200, KC: 1522281600, C: 1537142400, LC: 1553472e3, L: 1568851200, "4C": 1585008e3, M: 1600214400, "5C": 1619395200, G: 1632096e3, "6C": 1635292800, YC: 1639353600, ZC: 1647216e3, MC: 1652745600, "7C": 1658275200, NC: 1662940800, aC: 1666569600, bC: 1670889600, cC: 1674432e3, dC: 1679875200, eC: 1684368e3, "8C": 1690156800, OC: 1695686400, fC: 1698192e3, gC: 1702252800, hC: 1705881600, iC: 1709596800, jC: 1715558400, "9C": 1722211200, PC: 1726444800, kC: 1730073600, lC: 1733875200, mC: 1737936e3, nC: 1743379200, oC: 1747008e3, pC: null, AD: null } }, F: { A: { "0": 0, "1": 0, "2": 0, "3": 0, "4": 0, "5": 0, "6": 0, "7": 0, "8": 0, "9": 0, F: 0, B: 0, C: 0, G: 0, N: 0, O: 0, P: 0, WB: 0, XB: 0, YB: 0, ZB: 0, aB: 0, bB: 0, cB: 0, dB: 0, eB: 0, fB: 0, gB: 0, hB: 0, iB: 402e-5, jB: 0, kB: 0, lB: 0, mB: 0, nB: 0, oB: 804e-5, pB: 0, qB: 0, rB: 0, sB: 0, tB: 0, uB: 0, vB: 0, wB: 0, xB: 0, yB: 0, zB: 0, "0B": 0, "1B": 0, "2B": 0, "3B": 0, "4B": 0, "5B": 0, "6B": 0, "7B": 0, "8B": 0, "9B": 0, AC: 0, BC: 0, CC: 0, DC: 0, EC: 0, FC: 0, GC: 0, HC: 0, IC: 0, Q: 0, H: 0, R: 0, TC: 0, S: 0, T: 0, U: 0, V: 0, W: 0, X: 0, Y: 402e-5, Z: 0.05226, a: 0, b: 0, c: 0, d: 0, e: 0.02814, f: 0, g: 0, h: 0, i: 0, j: 0, k: 0, l: 0, m: 0, n: 0, o: 0, p: 0, q: 0, r: 0, s: 0, t: 0, u: 0, v: 0, w: 402e-5, x: 0, y: 0, z: 0, BD: 0, CD: 0, DD: 0, ED: 0, KC: 0, qC: 0, FD: 0, LC: 0 }, B: "webkit", C: ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "F", "BD", "CD", "DD", "ED", "B", "KC", "qC", "FD", "C", "LC", "G", "N", "O", "P", "WB", "1", "2", "3", "4", "5", "6", "7", "8", "9", "XB", "YB", "ZB", "aB", "bB", "cB", "dB", "eB", "fB", "gB", "hB", "iB", "jB", "kB", "lB", "mB", "nB", "oB", "pB", "qB", "rB", "sB", "tB", "uB", "vB", "wB", "xB", "yB", "zB", "0B", "1B", "2B", "3B", "4B", "5B", "6B", "7B", "8B", "9B", "AC", "BC", "CC", "DC", "EC", "FC", "GC", "HC", "IC", "Q", "H", "R", "TC", "S", "T", "U", "V", "W", "X", "Y", "Z", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "0", "", "", ""], E: "Opera", F: { "0": 1739404800, "1": 1393891200, "2": 1399334400, "3": 1401753600, "4": 1405987200, "5": 1409616e3, "6": 1413331200, "7": 1417132800, "8": 1422316800, "9": 1425945600, F: 1150761600, BD: 1223424e3, CD: 1251763200, DD: 1267488e3, ED: 1277942400, B: 1292457600, KC: 1302566400, qC: 1309219200, FD: 1323129600, C: 1323129600, LC: 1352073600, G: 1372723200, N: 1377561600, O: 1381104e3, P: 1386288e3, WB: 1390867200, XB: 1430179200, YB: 1433808e3, ZB: 1438646400, aB: 1442448e3, bB: 1445904e3, cB: 1449100800, dB: 1454371200, eB: 1457308800, fB: 146232e4, gB: 1465344e3, hB: 1470096e3, iB: 1474329600, jB: 1477267200, kB: 1481587200, lB: 1486425600, mB: 1490054400, nB: 1494374400, oB: 1498003200, pB: 1502236800, qB: 1506470400, rB: 1510099200, sB: 1515024e3, tB: 1517961600, uB: 1521676800, vB: 1525910400, wB: 1530144e3, xB: 1534982400, yB: 1537833600, zB: 1543363200, "0B": 1548201600, "1B": 1554768e3, "2B": 1561593600, "3B": 1566259200, "4B": 1570406400, "5B": 1573689600, "6B": 1578441600, "7B": 1583971200, "8B": 1587513600, "9B": 1592956800, AC: 1595894400, BC: 1600128e3, CC: 1603238400, DC: 161352e4, EC: 1612224e3, FC: 1616544e3, GC: 1619568e3, HC: 1623715200, IC: 1627948800, Q: 1631577600, H: 1633392e3, R: 1635984e3, TC: 1638403200, S: 1642550400, T: 1644969600, U: 1647993600, V: 1650412800, W: 1652745600, X: 1654646400, Y: 1657152e3, Z: 1660780800, a: 1663113600, b: 1668816e3, c: 1668643200, d: 1671062400, e: 1675209600, f: 1677024e3, g: 1679529600, h: 1681948800, i: 1684195200, j: 1687219200, k: 1690329600, l: 1692748800, m: 1696204800, n: 169992e4, o: 169992e4, p: 1702944e3, q: 1707264e3, r: 1710115200, s: 1711497600, t: 1716336e3, u: 1719273600, v: 1721088e3, w: 1724284800, x: 1727222400, y: 1732665600, z: 1736294400 }, D: { F: "o", B: "o", C: "o", BD: "o", CD: "o", DD: "o", ED: "o", KC: "o", qC: "o", FD: "o", LC: "o" } }, G: { A: { E: 0, WC: 0, GD: 0, rC: 13461e-7, HD: 0, ID: 673049e-8, JD: 403829e-8, KD: 0, LD: 26922e-7, MD: 0.0148071, ND: 13461e-7, OD: 0.0228837, PD: 0.200569, QD: 942269e-8, RD: 26922e-7, SD: 0.082112, TD: 0, UD: 26922e-7, VD: 26922e-7, WD: 0.013461, XD: 0.0578822, YD: 0.0309603, ZD: 0.026922, YC: 0.0215376, ZC: 0.0242298, MC: 0.0282681, aD: 0.371523, NC: 0.0498056, aC: 0.095573, bC: 0.0498056, cC: 0.0942269, dC: 0.0201915, eC: 0.0376907, bD: 0.477865, OC: 0.0242298, fC: 0.0457673, gC: 0.0336525, hC: 0.0498056, iC: 0.095573, jC: 0.173647, cD: 0.442866, PC: 0.111726, kC: 0.234221, lC: 0.126533, mC: 0.46575, nC: 0.301526, oC: 9.49672, pC: 0.0215376 }, B: "webkit", C: ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "WC", "GD", "rC", "HD", "ID", "JD", "E", "KD", "LD", "MD", "ND", "OD", "PD", "QD", "RD", "SD", "TD", "UD", "VD", "WD", "XD", "YD", "ZD", "YC", "ZC", "MC", "aD", "NC", "aC", "bC", "cC", "dC", "eC", "bD", "OC", "fC", "gC", "hC", "iC", "jC", "cD", "PC", "kC", "lC", "mC", "nC", "oC", "pC", "", ""], E: "Safari on iOS", F: { WC: 1270252800, GD: 1283904e3, rC: 1299628800, HD: 1331078400, ID: 1359331200, JD: 1394409600, E: 1410912e3, KD: 1413763200, LD: 1442361600, MD: 1458518400, ND: 1473724800, OD: 1490572800, PD: 1505779200, QD: 1522281600, RD: 1537142400, SD: 1553472e3, TD: 1568851200, UD: 1572220800, VD: 1580169600, WD: 1585008e3, XD: 1600214400, YD: 1619395200, ZD: 1632096e3, YC: 1639353600, ZC: 1647216e3, MC: 1652659200, aD: 1658275200, NC: 1662940800, aC: 1666569600, bC: 1670889600, cC: 1674432e3, dC: 1679875200, eC: 1684368e3, bD: 1690156800, OC: 1694995200, fC: 1698192e3, gC: 1702252800, hC: 1705881600, iC: 1709596800, jC: 1715558400, cD: 1722211200, PC: 1726444800, kC: 1730073600, lC: 1733875200, mC: 1737936e3, nC: 1743379200, oC: 1747008e3, pC: null } }, H: { A: { dD: 0.04 }, B: "o", C: ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "dD", "", "", ""], E: "Opera Mini", F: { dD: 1426464e3 } }, I: { A: { QC: 0, J: 0, I: 0.794067, eD: 0, fD: 0, gD: 0, hD: 159068e-9, rC: 159068e-9, iD: 0, jD: 636272e-9 }, B: "webkit", C: ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "eD", "fD", "gD", "QC", "J", "hD", "rC", "iD", "jD", "I", "", "", ""], E: "Android Browser", F: { eD: 1256515200, fD: 1274313600, gD: 1291593600, QC: 1298332800, J: 1318896e3, hD: 1341792e3, rC: 1374624e3, iD: 1386547200, jD: 1401667200, I: 1754352e3 } }, J: { A: { D: 0, A: 0 }, B: "webkit", C: ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "D", "A", "", "", ""], E: "Blackberry Browser", F: { D: 1325376e3, A: 1359504e3 } }, K: { A: { A: 0, B: 0, C: 0, H: 0.95866, KC: 0, qC: 0, LC: 0 }, B: "o", C: ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "A", "B", "KC", "qC", "C", "LC", "H", "", "", ""], E: "Opera Mobile", F: { A: 1287100800, B: 1300752e3, KC: 1314835200, qC: 1318291200, C: 1330300800, LC: 1349740800, H: 1709769600 }, D: { H: "webkit" } }, L: { A: { I: 43.5564 }, B: "webkit", C: ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "I", "", "", ""], E: "Chrome for Android", F: { I: 1754352e3 } }, M: { A: { JC: 0.3289 }, B: "moz", C: ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "JC", "", "", ""], E: "Firefox for Android", F: { JC: 1755648e3 } }, N: { A: { A: 0, B: 0 }, B: "ms", C: ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "A", "B", "", "", ""], E: "IE Mobile", F: { A: 1340150400, B: 1353456e3 } }, O: { A: { MC: 0.81328 }, B: "webkit", C: ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "MC", "", "", ""], E: "UC Browser for Android", F: { MC: 1710115200 }, D: { MC: "webkit" } }, P: { A: { "1": 0, "2": 0.0218021, "3": 0.0218021, "4": 0.0218021, "5": 0.0327031, "6": 0.0327031, "7": 0.0545052, "8": 0.0872083, "9": 1.80957, J: 0, kD: 0, lD: 0, mD: 0.010901, nD: 0, oD: 0, XC: 0, pD: 0, qD: 0, rD: 0, sD: 0, tD: 0, NC: 0, OC: 0, PC: 0, uD: 0 }, B: "webkit", C: ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "J", "kD", "lD", "mD", "nD", "oD", "XC", "pD", "qD", "rD", "sD", "tD", "NC", "OC", "PC", "uD", "1", "2", "3", "4", "5", "6", "7", "8", "9", "", "", ""], E: "Samsung Internet", F: { "1": 1677369600, "2": 1684454400, "3": 1689292800, "4": 1697587200, "5": 1711497600, "6": 1715126400, "7": 1717718400, "8": 1725667200, "9": 1746057600, J: 1461024e3, kD: 1481846400, lD: 1509408e3, mD: 1528329600, nD: 1546128e3, oD: 1554163200, XC: 1567900800, pD: 1582588800, qD: 1593475200, rD: 1605657600, sD: 1618531200, tD: 1629072e3, NC: 1640736e3, OC: 1651708800, PC: 1659657600, uD: 1667260800 } }, Q: { A: { vD: 0.18538 }, B: "webkit", C: ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "vD", "", "", ""], E: "QQ Browser", F: { vD: 1710288e3 } }, R: { A: { wD: 0 }, B: "webkit", C: ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "wD", "", "", ""], E: "Baidu Browser", F: { wD: 1710201600 } }, S: { A: { xD: 0.01196, yD: 0 }, B: "moz", C: ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "xD", "yD", "", "", ""], E: "KaiOS Browser", F: { xD: 1527811200, yD: 1631664e3 } } };
  }
});

// node_modules/caniuse-lite/dist/unpacker/agents.js
var require_agents2 = __commonJS({
  "node_modules/caniuse-lite/dist/unpacker/agents.js"(exports2, module2) {
    "use strict";
    var browsers = require_browsers2().browsers;
    var versions = require_browserVersions2().browserVersions;
    var agentsData = require_agents();
    function unpackBrowserVersions(versionsData) {
      return Object.keys(versionsData).reduce((usage, version) => {
        usage[versions[version]] = versionsData[version];
        return usage;
      }, {});
    }
    module2.exports.agents = Object.keys(agentsData).reduce((map, key) => {
      let versionsData = agentsData[key];
      map[browsers[key]] = Object.keys(versionsData).reduce((data, entry) => {
        if (entry === "A") {
          data.usage_global = unpackBrowserVersions(versionsData[entry]);
        } else if (entry === "C") {
          data.versions = versionsData[entry].reduce((list, version) => {
            if (version === "") {
              list.push(null);
            } else {
              list.push(versions[version]);
            }
            return list;
          }, []);
        } else if (entry === "D") {
          data.prefix_exceptions = unpackBrowserVersions(versionsData[entry]);
        } else if (entry === "E") {
          data.browser = versionsData[entry];
        } else if (entry === "F") {
          data.release_date = Object.keys(versionsData[entry]).reduce(
            (map2, key2) => {
              map2[versions[key2]] = versionsData[entry][key2];
              return map2;
            },
            {}
          );
        } else {
          data.prefix = versionsData[entry];
        }
        return data;
      }, {});
      return map;
    }, {});
  }
});

// node_modules/electron-to-chromium/versions.js
var require_versions = __commonJS({
  "node_modules/electron-to-chromium/versions.js"(exports2, module2) {
    module2.exports = {
      "0.20": "39",
      "0.21": "41",
      "0.22": "41",
      "0.23": "41",
      "0.24": "41",
      "0.25": "42",
      "0.26": "42",
      "0.27": "43",
      "0.28": "43",
      "0.29": "43",
      "0.30": "44",
      "0.31": "45",
      "0.32": "45",
      "0.33": "45",
      "0.34": "45",
      "0.35": "45",
      "0.36": "47",
      "0.37": "49",
      "1.0": "49",
      "1.1": "50",
      "1.2": "51",
      "1.3": "52",
      "1.4": "53",
      "1.5": "54",
      "1.6": "56",
      "1.7": "58",
      "1.8": "59",
      "2.0": "61",
      "2.1": "61",
      "3.0": "66",
      "3.1": "66",
      "4.0": "69",
      "4.1": "69",
      "4.2": "69",
      "5.0": "73",
      "6.0": "76",
      "6.1": "76",
      "7.0": "78",
      "7.1": "78",
      "7.2": "78",
      "7.3": "78",
      "8.0": "80",
      "8.1": "80",
      "8.2": "80",
      "8.3": "80",
      "8.4": "80",
      "8.5": "80",
      "9.0": "83",
      "9.1": "83",
      "9.2": "83",
      "9.3": "83",
      "9.4": "83",
      "10.0": "85",
      "10.1": "85",
      "10.2": "85",
      "10.3": "85",
      "10.4": "85",
      "11.0": "87",
      "11.1": "87",
      "11.2": "87",
      "11.3": "87",
      "11.4": "87",
      "11.5": "87",
      "12.0": "89",
      "12.1": "89",
      "12.2": "89",
      "13.0": "91",
      "13.1": "91",
      "13.2": "91",
      "13.3": "91",
      "13.4": "91",
      "13.5": "91",
      "13.6": "91",
      "14.0": "93",
      "14.1": "93",
      "14.2": "93",
      "15.0": "94",
      "15.1": "94",
      "15.2": "94",
      "15.3": "94",
      "15.4": "94",
      "15.5": "94",
      "16.0": "96",
      "16.1": "96",
      "16.2": "96",
      "17.0": "98",
      "17.1": "98",
      "17.2": "98",
      "17.3": "98",
      "17.4": "98",
      "18.0": "100",
      "18.1": "100",
      "18.2": "100",
      "18.3": "100",
      "19.0": "102",
      "19.1": "102",
      "20.0": "104",
      "20.1": "104",
      "20.2": "104",
      "20.3": "104",
      "21.0": "106",
      "21.1": "106",
      "21.2": "106",
      "21.3": "106",
      "21.4": "106",
      "22.0": "108",
      "22.1": "108",
      "22.2": "108",
      "22.3": "108",
      "23.0": "110",
      "23.1": "110",
      "23.2": "110",
      "23.3": "110",
      "24.0": "112",
      "24.1": "112",
      "24.2": "112",
      "24.3": "112",
      "24.4": "112",
      "24.5": "112",
      "24.6": "112",
      "24.7": "112",
      "24.8": "112",
      "25.0": "114",
      "25.1": "114",
      "25.2": "114",
      "25.3": "114",
      "25.4": "114",
      "25.5": "114",
      "25.6": "114",
      "25.7": "114",
      "25.8": "114",
      "25.9": "114",
      "26.0": "116",
      "26.1": "116",
      "26.2": "116",
      "26.3": "116",
      "26.4": "116",
      "26.5": "116",
      "26.6": "116",
      "27.0": "118",
      "27.1": "118",
      "27.2": "118",
      "27.3": "118",
      "28.0": "120",
      "28.1": "120",
      "28.2": "120",
      "28.3": "120",
      "29.0": "122",
      "29.1": "122",
      "29.2": "122",
      "29.3": "122",
      "29.4": "122",
      "30.0": "124",
      "30.1": "124",
      "30.2": "124",
      "30.3": "124",
      "30.4": "124",
      "30.5": "124",
      "31.0": "126",
      "31.1": "126",
      "31.2": "126",
      "31.3": "126",
      "31.4": "126",
      "31.5": "126",
      "31.6": "126",
      "31.7": "126",
      "32.0": "128",
      "32.1": "128",
      "32.2": "128",
      "32.3": "128",
      "33.0": "130",
      "33.1": "130",
      "33.2": "130",
      "33.3": "130",
      "33.4": "130",
      "34.0": "132",
      "34.1": "132",
      "34.2": "132",
      "34.3": "132",
      "34.4": "132",
      "34.5": "132",
      "35.0": "134",
      "35.1": "134",
      "35.2": "134",
      "35.3": "134",
      "35.4": "134",
      "35.5": "134",
      "35.6": "134",
      "35.7": "134",
      "36.0": "136",
      "36.1": "136",
      "36.2": "136",
      "36.3": "136",
      "36.4": "136",
      "36.5": "136",
      "36.6": "136",
      "36.7": "136",
      "36.8": "136",
      "37.0": "138",
      "37.1": "138",
      "37.2": "138",
      "37.3": "138",
      "37.4": "138",
      "38.0": "140",
      "39.0": "141"
    };
  }
});

// node_modules/node-releases/data/release-schedule/release-schedule.json
var require_release_schedule = __commonJS({
  "node_modules/node-releases/data/release-schedule/release-schedule.json"(exports2, module2) {
    module2.exports = { "v0.8": { start: "2012-06-25", end: "2014-07-31" }, "v0.10": { start: "2013-03-11", end: "2016-10-31" }, "v0.12": { start: "2015-02-06", end: "2016-12-31" }, v4: { start: "2015-09-08", lts: "2015-10-12", maintenance: "2017-04-01", end: "2018-04-30", codename: "Argon" }, v5: { start: "2015-10-29", maintenance: "2016-04-30", end: "2016-06-30" }, v6: { start: "2016-04-26", lts: "2016-10-18", maintenance: "2018-04-30", end: "2019-04-30", codename: "Boron" }, v7: { start: "2016-10-25", maintenance: "2017-04-30", end: "2017-06-30" }, v8: { start: "2017-05-30", lts: "2017-10-31", maintenance: "2019-01-01", end: "2019-12-31", codename: "Carbon" }, v9: { start: "2017-10-01", maintenance: "2018-04-01", end: "2018-06-30" }, v10: { start: "2018-04-24", lts: "2018-10-30", maintenance: "2020-05-19", end: "2021-04-30", codename: "Dubnium" }, v11: { start: "2018-10-23", maintenance: "2019-04-22", end: "2019-06-01" }, v12: { start: "2019-04-23", lts: "2019-10-21", maintenance: "2020-11-30", end: "2022-04-30", codename: "Erbium" }, v13: { start: "2019-10-22", maintenance: "2020-04-01", end: "2020-06-01" }, v14: { start: "2020-04-21", lts: "2020-10-27", maintenance: "2021-10-19", end: "2023-04-30", codename: "Fermium" }, v15: { start: "2020-10-20", maintenance: "2021-04-01", end: "2021-06-01" }, v16: { start: "2021-04-20", lts: "2021-10-26", maintenance: "2022-10-18", end: "2023-09-11", codename: "Gallium" }, v17: { start: "2021-10-19", maintenance: "2022-04-01", end: "2022-06-01" }, v18: { start: "2022-04-19", lts: "2022-10-25", maintenance: "2023-10-18", end: "2025-04-30", codename: "Hydrogen" }, v19: { start: "2022-10-18", maintenance: "2023-04-01", end: "2023-06-01" }, v20: { start: "2023-04-18", lts: "2023-10-24", maintenance: "2024-10-22", end: "2026-04-30", codename: "Iron" }, v21: { start: "2023-10-17", maintenance: "2024-04-01", end: "2024-06-01" }, v22: { start: "2024-04-24", lts: "2024-10-29", maintenance: "2025-10-21", end: "2027-04-30", codename: "Jod" }, v23: { start: "2024-10-16", maintenance: "2025-04-01", end: "2025-06-01" }, v24: { start: "2025-04-22", lts: "2025-10-28", maintenance: "2026-10-20", end: "2028-04-30", codename: "" } };
  }
});

// node_modules/browserslist/error.js
var require_error = __commonJS({
  "node_modules/browserslist/error.js"(exports2, module2) {
    function BrowserslistError(message) {
      this.name = "BrowserslistError";
      this.message = message;
      this.browserslist = true;
      if (Error.captureStackTrace) {
        Error.captureStackTrace(this, BrowserslistError);
      }
    }
    BrowserslistError.prototype = Error.prototype;
    module2.exports = BrowserslistError;
  }
});

// node_modules/caniuse-lite/dist/lib/statuses.js
var require_statuses = __commonJS({
  "node_modules/caniuse-lite/dist/lib/statuses.js"(exports2, module2) {
    module2.exports = {
      1: "ls",
      // WHATWG Living Standard
      2: "rec",
      // W3C Recommendation
      3: "pr",
      // W3C Proposed Recommendation
      4: "cr",
      // W3C Candidate Recommendation
      5: "wd",
      // W3C Working Draft
      6: "other",
      // Non-W3C, but reputable
      7: "unoff"
      // Unofficial, Editor's Draft or W3C "Note"
    };
  }
});

// node_modules/caniuse-lite/dist/lib/supported.js
var require_supported = __commonJS({
  "node_modules/caniuse-lite/dist/lib/supported.js"(exports2, module2) {
    module2.exports = {
      y: 1 << 0,
      n: 1 << 1,
      a: 1 << 2,
      p: 1 << 3,
      u: 1 << 4,
      x: 1 << 5,
      d: 1 << 6
    };
  }
});

// node_modules/caniuse-lite/dist/unpacker/feature.js
var require_feature = __commonJS({
  "node_modules/caniuse-lite/dist/unpacker/feature.js"(exports2, module2) {
    "use strict";
    var statuses = require_statuses();
    var supported = require_supported();
    var browsers = require_browsers2().browsers;
    var versions = require_browserVersions2().browserVersions;
    var MATH2LOG = Math.log(2);
    function unpackSupport(cipher) {
      let stats = Object.keys(supported).reduce((list, support) => {
        if (cipher & supported[support]) list.push(support);
        return list;
      }, []);
      let notes = cipher >> 7;
      let notesArray = [];
      while (notes) {
        let note = Math.floor(Math.log(notes) / MATH2LOG) + 1;
        notesArray.unshift(`#${note}`);
        notes -= Math.pow(2, note - 1);
      }
      return stats.concat(notesArray).join(" ");
    }
    function unpackFeature(packed) {
      let unpacked = {
        status: statuses[packed.B],
        title: packed.C,
        shown: packed.D
      };
      unpacked.stats = Object.keys(packed.A).reduce((browserStats, key) => {
        let browser = packed.A[key];
        browserStats[browsers[key]] = Object.keys(browser).reduce(
          (stats, support) => {
            let packedVersions = browser[support].split(" ");
            let unpacked2 = unpackSupport(support);
            packedVersions.forEach((v) => stats[versions[v]] = unpacked2);
            return stats;
          },
          {}
        );
        return browserStats;
      }, {});
      return unpacked;
    }
    module2.exports = unpackFeature;
    module2.exports.default = unpackFeature;
  }
});

// node_modules/caniuse-lite/dist/unpacker/region.js
var require_region = __commonJS({
  "node_modules/caniuse-lite/dist/unpacker/region.js"(exports2, module2) {
    "use strict";
    var browsers = require_browsers2().browsers;
    function unpackRegion(packed) {
      return Object.keys(packed).reduce((list, browser) => {
        let data = packed[browser];
        list[browsers[browser]] = Object.keys(data).reduce((memo, key) => {
          let stats = data[key];
          if (key === "_") {
            stats.split(" ").forEach((version) => memo[version] = null);
          } else {
            memo[key] = stats;
          }
          return memo;
        }, {});
        return list;
      }, {});
    }
    module2.exports = unpackRegion;
    module2.exports.default = unpackRegion;
  }
});

// node_modules/browserslist/node.js
var require_node3 = __commonJS({
  "node_modules/browserslist/node.js"(exports2, module2) {
    var feature = require_feature().default;
    var region = require_region().default;
    var fs = require("fs");
    var path = require("path");
    var BrowserslistError = require_error();
    var IS_SECTION = /^\s*\[(.+)]\s*$/;
    var CONFIG_PATTERN = /^browserslist-config-/;
    var SCOPED_CONFIG__PATTERN = /@[^/]+(?:\/[^/]+)?\/browserslist-config(?:-|$|\/)/;
    var FORMAT = "Browserslist config should be a string or an array of strings with browser queries";
    var PATHTYPE_UNKNOWN = "unknown";
    var PATHTYPE_DIR = "directory";
    var PATHTYPE_FILE = "file";
    var dataTimeChecked = false;
    var statCache = {};
    var configPathCache = {};
    var parseConfigCache = {};
    function checkExtend(name) {
      var use = " Use `dangerousExtend` option to disable.";
      if (!CONFIG_PATTERN.test(name) && !SCOPED_CONFIG__PATTERN.test(name)) {
        throw new BrowserslistError(
          "Browserslist config needs `browserslist-config-` prefix. " + use
        );
      }
      if (name.replace(/^@[^/]+\//, "").indexOf(".") !== -1) {
        throw new BrowserslistError(
          "`.` not allowed in Browserslist config name. " + use
        );
      }
      if (name.indexOf("node_modules") !== -1) {
        throw new BrowserslistError(
          "`node_modules` not allowed in Browserslist config." + use
        );
      }
    }
    function getPathType(filepath) {
      var stats;
      try {
        stats = fs.existsSync(filepath) && fs.statSync(filepath);
      } catch (err) {
        if (err.code !== "ENOENT" && err.code !== "EACCES" && err.code !== "ERR_ACCESS_DENIED") {
          throw err;
        }
      }
      if (stats && stats.isDirectory()) return PATHTYPE_DIR;
      if (stats && stats.isFile()) return PATHTYPE_FILE;
      return PATHTYPE_UNKNOWN;
    }
    function isFile(file) {
      return getPathType(file) === PATHTYPE_FILE;
    }
    function isDirectory(dir) {
      return getPathType(dir) === PATHTYPE_DIR;
    }
    function eachParent(file, callback, cache) {
      var loc = path.resolve(file);
      var pathsForCacheResult = [];
      var result;
      do {
        if (!pathInRoot(loc)) {
          break;
        }
        if (cache && loc in cache) {
          result = cache[loc];
          break;
        }
        pathsForCacheResult.push(loc);
        if (!isDirectory(loc)) {
          continue;
        }
        var locResult = callback(loc);
        if (typeof locResult !== "undefined") {
          result = locResult;
          break;
        }
      } while (loc !== (loc = path.dirname(loc)));
      if (cache && !process.env.BROWSERSLIST_DISABLE_CACHE) {
        pathsForCacheResult.forEach(function(cachePath) {
          cache[cachePath] = result;
        });
      }
      return result;
    }
    function pathInRoot(p) {
      if (!process.env.BROWSERSLIST_ROOT_PATH) return true;
      var rootPath = path.resolve(process.env.BROWSERSLIST_ROOT_PATH);
      if (path.relative(rootPath, p).substring(0, 2) === "..") {
        return false;
      }
      return true;
    }
    function check(section) {
      if (Array.isArray(section)) {
        for (var i = 0; i < section.length; i++) {
          if (typeof section[i] !== "string") {
            throw new BrowserslistError(FORMAT);
          }
        }
      } else if (typeof section !== "string") {
        throw new BrowserslistError(FORMAT);
      }
    }
    function pickEnv(config, opts) {
      if (typeof config !== "object") return config;
      var name;
      if (typeof opts.env === "string") {
        name = opts.env;
      } else if (process.env.BROWSERSLIST_ENV) {
        name = process.env.BROWSERSLIST_ENV;
      } else if (process.env.NODE_ENV) {
        name = process.env.NODE_ENV;
      } else {
        name = "production";
      }
      if (opts.throwOnMissing) {
        if (name && name !== "defaults" && !config[name]) {
          throw new BrowserslistError(
            "Missing config for Browserslist environment `" + name + "`"
          );
        }
      }
      return config[name] || config.defaults;
    }
    function parsePackage(file) {
      var text = fs.readFileSync(file).toString().replace(/^\uFEFF/m, "");
      var list;
      if (text.indexOf('"browserslist"') >= 0) {
        list = JSON.parse(text).browserslist;
      } else if (text.indexOf('"browserlist"') >= 0) {
        var config = JSON.parse(text);
        if (config.browserlist && !config.browserslist) {
          throw new BrowserslistError(
            "`browserlist` key instead of `browserslist` in " + file
          );
        }
      }
      if (Array.isArray(list) || typeof list === "string") {
        list = { defaults: list };
      }
      for (var i in list) {
        check(list[i]);
      }
      return list;
    }
    function parsePackageOrReadConfig(file) {
      if (file in parseConfigCache) {
        return parseConfigCache[file];
      }
      var isPackage = path.basename(file) === "package.json";
      var result = isPackage ? parsePackage(file) : module2.exports.readConfig(file);
      if (!process.env.BROWSERSLIST_DISABLE_CACHE) {
        parseConfigCache[file] = result;
      }
      return result;
    }
    function latestReleaseTime(agents) {
      var latest = 0;
      for (var name in agents) {
        var dates = agents[name].releaseDate || {};
        for (var key in dates) {
          if (latest < dates[key]) {
            latest = dates[key];
          }
        }
      }
      return latest * 1e3;
    }
    function getMonthsPassed(date) {
      var now = /* @__PURE__ */ new Date();
      var past = new Date(date);
      var years = now.getFullYear() - past.getFullYear();
      var months = now.getMonth() - past.getMonth();
      return years * 12 + months;
    }
    function normalizeStats(data, stats) {
      if (!data) {
        data = {};
      }
      if (stats && "dataByBrowser" in stats) {
        stats = stats.dataByBrowser;
      }
      if (typeof stats !== "object") return void 0;
      var normalized = {};
      for (var i in stats) {
        var versions = Object.keys(stats[i]);
        if (versions.length === 1 && data[i] && data[i].versions.length === 1) {
          var normal = data[i].versions[0];
          normalized[i] = {};
          normalized[i][normal] = stats[i][versions[0]];
        } else {
          normalized[i] = stats[i];
        }
      }
      return normalized;
    }
    function normalizeUsageData(usageData, data) {
      for (var browser in usageData) {
        var browserUsage = usageData[browser];
        if ("0" in browserUsage) {
          var versions = data[browser].versions;
          browserUsage[versions[versions.length - 1]] = browserUsage[0];
          delete browserUsage[0];
        }
      }
    }
    module2.exports = {
      loadQueries: function loadQueries(ctx, name) {
        if (!ctx.dangerousExtend && !process.env.BROWSERSLIST_DANGEROUS_EXTEND) {
          checkExtend(name);
        }
        var queries = require(require.resolve(name, { paths: [".", ctx.path] }));
        if (typeof queries === "object" && queries !== null && queries.__esModule) {
          queries = queries.default;
        }
        if (queries) {
          if (Array.isArray(queries)) {
            return queries;
          } else if (typeof queries === "object") {
            if (!queries.defaults) queries.defaults = [];
            return pickEnv(queries, ctx, name);
          }
        }
        throw new BrowserslistError(
          "`" + name + "` config exports not an array of queries or an object of envs"
        );
      },
      loadStat: function loadStat(ctx, name, data) {
        if (!ctx.dangerousExtend && !process.env.BROWSERSLIST_DANGEROUS_EXTEND) {
          checkExtend(name);
        }
        var stats = require(
          // Use forward slashes for module paths, also on Windows.
          require.resolve(path.posix.join(name, "browserslist-stats.json"), {
            paths: ["."]
          })
        );
        return normalizeStats(data, stats);
      },
      getStat: function getStat(opts, data) {
        var stats;
        if (opts.stats) {
          stats = opts.stats;
        } else if (process.env.BROWSERSLIST_STATS) {
          stats = process.env.BROWSERSLIST_STATS;
        } else if (opts.path && path.resolve && fs.existsSync) {
          stats = eachParent(
            opts.path,
            function(dir) {
              var file = path.join(dir, "browserslist-stats.json");
              return isFile(file) ? file : void 0;
            },
            statCache
          );
        }
        if (typeof stats === "string") {
          try {
            stats = JSON.parse(fs.readFileSync(stats));
          } catch (e) {
            throw new BrowserslistError("Can't read " + stats);
          }
        }
        return normalizeStats(data, stats);
      },
      loadConfig: function loadConfig(opts) {
        if (process.env.BROWSERSLIST) {
          return process.env.BROWSERSLIST;
        } else if (opts.config || process.env.BROWSERSLIST_CONFIG) {
          var file = opts.config || process.env.BROWSERSLIST_CONFIG;
          return pickEnv(parsePackageOrReadConfig(file), opts);
        } else if (opts.path) {
          return pickEnv(module2.exports.findConfig(opts.path), opts);
        } else {
          return void 0;
        }
      },
      loadCountry: function loadCountry(usage, country, data) {
        var code = country.replace(/[^\w-]/g, "");
        if (!usage[code]) {
          var compressed;
          try {
            compressed = require("caniuse-lite/data/regions/" + code + ".js");
          } catch (e) {
            throw new BrowserslistError("Unknown region name `" + code + "`.");
          }
          var usageData = region(compressed);
          normalizeUsageData(usageData, data);
          usage[country] = {};
          for (var i in usageData) {
            for (var j in usageData[i]) {
              usage[country][i + " " + j] = usageData[i][j];
            }
          }
        }
      },
      loadFeature: function loadFeature(features, name) {
        name = name.replace(/[^\w-]/g, "");
        if (features[name]) return;
        var compressed;
        try {
          compressed = require("caniuse-lite/data/features/" + name + ".js");
        } catch (e) {
          throw new BrowserslistError("Unknown feature name `" + name + "`.");
        }
        var stats = feature(compressed).stats;
        features[name] = {};
        for (var i in stats) {
          features[name][i] = {};
          for (var j in stats[i]) {
            features[name][i][j] = stats[i][j];
          }
        }
      },
      parseConfig: function parseConfig(string) {
        var result = { defaults: [] };
        var sections = ["defaults"];
        string.toString().replace(/#[^\n]*/g, "").split(/\n|,/).map(function(line) {
          return line.trim();
        }).filter(function(line) {
          return line !== "";
        }).forEach(function(line) {
          if (IS_SECTION.test(line)) {
            sections = line.match(IS_SECTION)[1].trim().split(" ");
            sections.forEach(function(section) {
              if (result[section]) {
                throw new BrowserslistError(
                  "Duplicate section " + section + " in Browserslist config"
                );
              }
              result[section] = [];
            });
          } else {
            sections.forEach(function(section) {
              result[section].push(line);
            });
          }
        });
        return result;
      },
      readConfig: function readConfig(file) {
        if (!isFile(file)) {
          throw new BrowserslistError("Can't read " + file + " config");
        }
        return module2.exports.parseConfig(fs.readFileSync(file));
      },
      findConfigFile: function findConfigFile(from) {
        return eachParent(
          from,
          function(dir) {
            var config = path.join(dir, "browserslist");
            var pkg = path.join(dir, "package.json");
            var rc = path.join(dir, ".browserslistrc");
            var pkgBrowserslist;
            if (isFile(pkg)) {
              try {
                pkgBrowserslist = parsePackage(pkg);
              } catch (e) {
                if (e.name === "BrowserslistError") throw e;
                console.warn(
                  "[Browserslist] Could not parse " + pkg + ". Ignoring it."
                );
              }
            }
            if (isFile(config) && pkgBrowserslist) {
              throw new BrowserslistError(
                dir + " contains both browserslist and package.json with browsers"
              );
            } else if (isFile(rc) && pkgBrowserslist) {
              throw new BrowserslistError(
                dir + " contains both .browserslistrc and package.json with browsers"
              );
            } else if (isFile(config) && isFile(rc)) {
              throw new BrowserslistError(
                dir + " contains both .browserslistrc and browserslist"
              );
            } else if (isFile(config)) {
              return config;
            } else if (isFile(rc)) {
              return rc;
            } else if (pkgBrowserslist) {
              return pkg;
            }
          },
          configPathCache
        );
      },
      findConfig: function findConfig(from) {
        var configFile = this.findConfigFile(from);
        return configFile ? parsePackageOrReadConfig(configFile) : void 0;
      },
      clearCaches: function clearCaches() {
        dataTimeChecked = false;
        statCache = {};
        configPathCache = {};
        parseConfigCache = {};
        this.cache = {};
      },
      oldDataWarning: function oldDataWarning(agentsObj) {
        if (dataTimeChecked) return;
        dataTimeChecked = true;
        if (process.env.BROWSERSLIST_IGNORE_OLD_DATA) return;
        var latest = latestReleaseTime(agentsObj);
        var monthsPassed = getMonthsPassed(latest);
        if (latest !== 0 && monthsPassed >= 6) {
          var months = monthsPassed + " " + (monthsPassed > 1 ? "months" : "month");
          console.warn(
            "Browserslist: browsers data (caniuse-lite) is " + months + " old. Please run:\n  npx update-browserslist-db@latest\n  Why you should do it regularly: https://github.com/browserslist/update-db#readme"
          );
        }
      },
      currentNode: function currentNode() {
        return "node " + process.versions.node;
      },
      env: process.env
    };
  }
});

// node_modules/browserslist/parse.js
var require_parse3 = __commonJS({
  "node_modules/browserslist/parse.js"(exports2, module2) {
    var AND_REGEXP = /^\s+and\s+(.*)/i;
    var OR_REGEXP = /^(?:,\s*|\s+or\s+)(.*)/i;
    function flatten(array) {
      if (!Array.isArray(array)) return [array];
      return array.reduce(function(a, b) {
        return a.concat(flatten(b));
      }, []);
    }
    function find(string, predicate) {
      for (var max = string.length, n = 1; n <= max; n++) {
        var parsed = string.substr(-n, n);
        if (predicate(parsed, n, max)) {
          return string.slice(0, -n);
        }
      }
      return "";
    }
    function matchQuery(all, query) {
      var node = { query };
      if (query.indexOf("not ") === 0) {
        node.not = true;
        query = query.slice(4);
      }
      for (var name in all) {
        var type = all[name];
        var match = query.match(type.regexp);
        if (match) {
          node.type = name;
          for (var i = 0; i < type.matches.length; i++) {
            node[type.matches[i]] = match[i + 1];
          }
          return node;
        }
      }
      node.type = "unknown";
      return node;
    }
    function matchBlock(all, string, qs) {
      var node;
      return find(string, function(parsed, n, max) {
        if (AND_REGEXP.test(parsed)) {
          node = matchQuery(all, parsed.match(AND_REGEXP)[1]);
          node.compose = "and";
          qs.unshift(node);
          return true;
        } else if (OR_REGEXP.test(parsed)) {
          node = matchQuery(all, parsed.match(OR_REGEXP)[1]);
          node.compose = "or";
          qs.unshift(node);
          return true;
        } else if (n === max) {
          node = matchQuery(all, parsed.trim());
          node.compose = "or";
          qs.unshift(node);
          return true;
        }
        return false;
      });
    }
    module2.exports = function parse2(all, queries) {
      if (!Array.isArray(queries)) queries = [queries];
      return flatten(
        queries.map(function(block) {
          var qs = [];
          do {
            block = matchBlock(all, block, qs);
          } while (block);
          return qs;
        })
      );
    };
  }
});

// node_modules/browserslist/index.js
var require_browserslist = __commonJS({
  "node_modules/browserslist/index.js"(exports2, module2) {
    var jsReleases = require_envs();
    var agents = require_agents2().agents;
    var e2c = require_versions();
    var jsEOL = require_release_schedule();
    var path = require("path");
    var BrowserslistError = require_error();
    var env = require_node3();
    var parseWithoutCache = require_parse3();
    var YEAR = 365.259641 * 24 * 60 * 60 * 1e3;
    var ANDROID_EVERGREEN_FIRST = "37";
    var OP_MOB_BLINK_FIRST = 14;
    function isVersionsMatch(versionA, versionB) {
      return (versionA + ".").indexOf(versionB + ".") === 0;
    }
    function isEolReleased(name) {
      var version = name.slice(1);
      return browserslist.nodeVersions.some(function(i) {
        return isVersionsMatch(i, version);
      });
    }
    function normalize(versions) {
      return versions.filter(function(version) {
        return typeof version === "string";
      });
    }
    function normalizeElectron(version) {
      var versionToUse = version;
      if (version.split(".").length === 3) {
        versionToUse = version.split(".").slice(0, -1).join(".");
      }
      return versionToUse;
    }
    function nameMapper(name) {
      return function mapName(version) {
        return name + " " + version;
      };
    }
    function getMajor(version) {
      return parseInt(version.split(".")[0]);
    }
    function getMajorVersions(released, number) {
      if (released.length === 0) return [];
      var majorVersions = uniq(released.map(getMajor));
      var minimum = majorVersions[majorVersions.length - number];
      if (!minimum) {
        return released;
      }
      var selected = [];
      for (var i = released.length - 1; i >= 0; i--) {
        if (minimum > getMajor(released[i])) break;
        selected.unshift(released[i]);
      }
      return selected;
    }
    function uniq(array) {
      var filtered = [];
      for (var i = 0; i < array.length; i++) {
        if (filtered.indexOf(array[i]) === -1) filtered.push(array[i]);
      }
      return filtered;
    }
    function fillUsage(result, name, data) {
      for (var i in data) {
        result[name + " " + i] = data[i];
      }
    }
    function generateFilter(sign, version) {
      version = parseFloat(version);
      if (sign === ">") {
        return function(v) {
          return parseLatestFloat(v) > version;
        };
      } else if (sign === ">=") {
        return function(v) {
          return parseLatestFloat(v) >= version;
        };
      } else if (sign === "<") {
        return function(v) {
          return parseFloat(v) < version;
        };
      } else {
        return function(v) {
          return parseFloat(v) <= version;
        };
      }
      function parseLatestFloat(v) {
        return parseFloat(v.split("-")[1] || v);
      }
    }
    function generateSemverFilter(sign, version) {
      version = version.split(".").map(parseSimpleInt);
      version[1] = version[1] || 0;
      version[2] = version[2] || 0;
      if (sign === ">") {
        return function(v) {
          v = v.split(".").map(parseSimpleInt);
          return compareSemver(v, version) > 0;
        };
      } else if (sign === ">=") {
        return function(v) {
          v = v.split(".").map(parseSimpleInt);
          return compareSemver(v, version) >= 0;
        };
      } else if (sign === "<") {
        return function(v) {
          v = v.split(".").map(parseSimpleInt);
          return compareSemver(version, v) > 0;
        };
      } else {
        return function(v) {
          v = v.split(".").map(parseSimpleInt);
          return compareSemver(version, v) >= 0;
        };
      }
    }
    function parseSimpleInt(x) {
      return parseInt(x);
    }
    function compare(a, b) {
      if (a < b) return -1;
      if (a > b) return 1;
      return 0;
    }
    function compareSemver(a, b) {
      return compare(parseInt(a[0]), parseInt(b[0])) || compare(parseInt(a[1] || "0"), parseInt(b[1] || "0")) || compare(parseInt(a[2] || "0"), parseInt(b[2] || "0"));
    }
    function semverFilterLoose(operator, range) {
      range = range.split(".").map(parseSimpleInt);
      if (typeof range[1] === "undefined") {
        range[1] = "x";
      }
      switch (operator) {
        case "<=":
          return function(version) {
            version = version.split(".").map(parseSimpleInt);
            return compareSemverLoose(version, range) <= 0;
          };
        case ">=":
        default:
          return function(version) {
            version = version.split(".").map(parseSimpleInt);
            return compareSemverLoose(version, range) >= 0;
          };
      }
    }
    function compareSemverLoose(version, range) {
      if (version[0] !== range[0]) {
        return version[0] < range[0] ? -1 : 1;
      }
      if (range[1] === "x") {
        return 0;
      }
      if (version[1] !== range[1]) {
        return version[1] < range[1] ? -1 : 1;
      }
      return 0;
    }
    function resolveVersion(data, version) {
      if (data.versions.indexOf(version) !== -1) {
        return version;
      } else if (browserslist.versionAliases[data.name][version]) {
        return browserslist.versionAliases[data.name][version];
      } else {
        return false;
      }
    }
    function normalizeVersion(data, version) {
      var resolved = resolveVersion(data, version);
      if (resolved) {
        return resolved;
      } else if (data.versions.length === 1) {
        return data.versions[0];
      } else {
        return false;
      }
    }
    function filterByYear(since, context) {
      since = since / 1e3;
      return Object.keys(agents).reduce(function(selected, name) {
        var data = byName(name, context);
        if (!data) return selected;
        var versions = Object.keys(data.releaseDate).filter(function(v) {
          var date = data.releaseDate[v];
          return date !== null && date >= since;
        });
        return selected.concat(versions.map(nameMapper(data.name)));
      }, []);
    }
    function cloneData(data) {
      return {
        name: data.name,
        versions: data.versions,
        released: data.released,
        releaseDate: data.releaseDate
      };
    }
    function byName(name, context) {
      name = name.toLowerCase();
      name = browserslist.aliases[name] || name;
      if (context.mobileToDesktop && browserslist.desktopNames[name]) {
        var desktop = browserslist.data[browserslist.desktopNames[name]];
        if (name === "android") {
          return normalizeAndroidData(cloneData(browserslist.data[name]), desktop);
        } else {
          var cloned = cloneData(desktop);
          cloned.name = name;
          return cloned;
        }
      }
      return browserslist.data[name];
    }
    function normalizeAndroidVersions(androidVersions, chromeVersions) {
      var iFirstEvergreen = chromeVersions.indexOf(ANDROID_EVERGREEN_FIRST);
      return androidVersions.filter(function(version) {
        return /^(?:[2-4]\.|[34]$)/.test(version);
      }).concat(chromeVersions.slice(iFirstEvergreen));
    }
    function copyObject(obj) {
      var copy = {};
      for (var key in obj) {
        copy[key] = obj[key];
      }
      return copy;
    }
    function normalizeAndroidData(android, chrome) {
      android.released = normalizeAndroidVersions(android.released, chrome.released);
      android.versions = normalizeAndroidVersions(android.versions, chrome.versions);
      android.releaseDate = copyObject(android.releaseDate);
      android.released.forEach(function(v) {
        if (android.releaseDate[v] === void 0) {
          android.releaseDate[v] = chrome.releaseDate[v];
        }
      });
      return android;
    }
    function checkName(name, context) {
      var data = byName(name, context);
      if (!data) throw new BrowserslistError("Unknown browser " + name);
      return data;
    }
    function unknownQuery(query) {
      return new BrowserslistError(
        "Unknown browser query `" + query + "`. Maybe you are using old Browserslist or made typo in query."
      );
    }
    function filterJumps(list, name, nVersions, context) {
      var jump = 1;
      switch (name) {
        case "android":
          if (context.mobileToDesktop) return list;
          var released = browserslist.data.chrome.released;
          jump = released.length - released.indexOf(ANDROID_EVERGREEN_FIRST);
          break;
        case "op_mob":
          var latest = browserslist.data.op_mob.released.slice(-1)[0];
          jump = getMajor(latest) - OP_MOB_BLINK_FIRST + 1;
          break;
        default:
          return list;
      }
      if (nVersions <= jump) {
        return list.slice(-1);
      }
      return list.slice(jump - 1 - nVersions);
    }
    function isSupported(flags, withPartial) {
      return typeof flags === "string" && (flags.indexOf("y") >= 0 || withPartial && flags.indexOf("a") >= 0);
    }
    function resolve(queries, context) {
      return parseQueries(queries).reduce(function(result, node, index) {
        if (node.not && index === 0) {
          throw new BrowserslistError(
            "Write any browsers query (for instance, `defaults`) before `" + node.query + "`"
          );
        }
        var type = QUERIES[node.type];
        var array = type.select.call(browserslist, context, node).map(function(j) {
          var parts = j.split(" ");
          if (parts[1] === "0") {
            return parts[0] + " " + byName(parts[0], context).versions[0];
          } else {
            return j;
          }
        });
        if (node.compose === "and") {
          if (node.not) {
            return result.filter(function(j) {
              return array.indexOf(j) === -1;
            });
          } else {
            return result.filter(function(j) {
              return array.indexOf(j) !== -1;
            });
          }
        } else {
          if (node.not) {
            var filter = {};
            array.forEach(function(j) {
              filter[j] = true;
            });
            return result.filter(function(j) {
              return !filter[j];
            });
          }
          return result.concat(array);
        }
      }, []);
    }
    function prepareOpts(opts) {
      if (typeof opts === "undefined") opts = {};
      if (typeof opts.path === "undefined") {
        opts.path = path.resolve ? path.resolve(".") : ".";
      }
      return opts;
    }
    function prepareQueries(queries, opts) {
      if (typeof queries === "undefined" || queries === null) {
        var config = browserslist.loadConfig(opts);
        if (config) {
          queries = config;
        } else {
          queries = browserslist.defaults;
        }
      }
      return queries;
    }
    function checkQueries(queries) {
      if (!(typeof queries === "string" || Array.isArray(queries))) {
        throw new BrowserslistError(
          "Browser queries must be an array or string. Got " + typeof queries + "."
        );
      }
    }
    var cache = {};
    var parseCache = {};
    function browserslist(queries, opts) {
      opts = prepareOpts(opts);
      queries = prepareQueries(queries, opts);
      checkQueries(queries);
      var needsPath = parseQueries(queries).some(function(node) {
        return QUERIES[node.type].needsPath;
      });
      var context = {
        ignoreUnknownVersions: opts.ignoreUnknownVersions,
        dangerousExtend: opts.dangerousExtend,
        mobileToDesktop: opts.mobileToDesktop,
        env: opts.env
      };
      if (needsPath) {
        context.path = opts.path;
      }
      env.oldDataWarning(browserslist.data);
      var stats = env.getStat(opts, browserslist.data);
      if (stats) {
        context.customUsage = {};
        for (var browser in stats) {
          fillUsage(context.customUsage, browser, stats[browser]);
        }
      }
      var cacheKey = JSON.stringify([queries, context]);
      if (cache[cacheKey]) return cache[cacheKey];
      var result = uniq(resolve(queries, context)).sort(function(name1, name2) {
        name1 = name1.split(" ");
        name2 = name2.split(" ");
        if (name1[0] === name2[0]) {
          var version1 = name1[1].split("-")[0];
          var version2 = name2[1].split("-")[0];
          return compareSemver(version2.split("."), version1.split("."));
        } else {
          return compare(name1[0], name2[0]);
        }
      });
      if (!env.env.BROWSERSLIST_DISABLE_CACHE) {
        cache[cacheKey] = result;
      }
      return result;
    }
    function parseQueries(queries) {
      var cacheKey = JSON.stringify(queries);
      if (cacheKey in parseCache) return parseCache[cacheKey];
      var result = parseWithoutCache(QUERIES, queries);
      if (!env.env.BROWSERSLIST_DISABLE_CACHE) {
        parseCache[cacheKey] = result;
      }
      return result;
    }
    function loadCustomUsage(context, config) {
      var stats = env.loadStat(context, config, browserslist.data);
      if (stats) {
        context.customUsage = {};
        for (var browser in stats) {
          fillUsage(context.customUsage, browser, stats[browser]);
        }
      }
      if (!context.customUsage) {
        throw new BrowserslistError("Custom usage statistics was not provided");
      }
      return context.customUsage;
    }
    browserslist.parse = function(queries, opts) {
      opts = prepareOpts(opts);
      queries = prepareQueries(queries, opts);
      checkQueries(queries);
      return parseQueries(queries);
    };
    browserslist.cache = {};
    browserslist.data = {};
    browserslist.usage = {
      global: {},
      custom: null
    };
    browserslist.defaults = ["> 0.5%", "last 2 versions", "Firefox ESR", "not dead"];
    browserslist.aliases = {
      fx: "firefox",
      ff: "firefox",
      ios: "ios_saf",
      explorer: "ie",
      blackberry: "bb",
      explorermobile: "ie_mob",
      operamini: "op_mini",
      operamobile: "op_mob",
      chromeandroid: "and_chr",
      firefoxandroid: "and_ff",
      ucandroid: "and_uc",
      qqandroid: "and_qq"
    };
    browserslist.desktopNames = {
      and_chr: "chrome",
      and_ff: "firefox",
      ie_mob: "ie",
      android: "chrome"
      // has extra processing logic
    };
    browserslist.versionAliases = {};
    browserslist.clearCaches = env.clearCaches;
    browserslist.parseConfig = env.parseConfig;
    browserslist.readConfig = env.readConfig;
    browserslist.findConfigFile = env.findConfigFile;
    browserslist.findConfig = env.findConfig;
    browserslist.loadConfig = env.loadConfig;
    browserslist.coverage = function(browsers, stats) {
      var data;
      if (typeof stats === "undefined") {
        data = browserslist.usage.global;
      } else if (stats === "my stats") {
        var opts = {};
        opts.path = path.resolve ? path.resolve(".") : ".";
        var customStats = env.getStat(opts);
        if (!customStats) {
          throw new BrowserslistError("Custom usage statistics was not provided");
        }
        data = {};
        for (var browser in customStats) {
          fillUsage(data, browser, customStats[browser]);
        }
      } else if (typeof stats === "string") {
        if (stats.length > 2) {
          stats = stats.toLowerCase();
        } else {
          stats = stats.toUpperCase();
        }
        env.loadCountry(browserslist.usage, stats, browserslist.data);
        data = browserslist.usage[stats];
      } else {
        if ("dataByBrowser" in stats) {
          stats = stats.dataByBrowser;
        }
        data = {};
        for (var name in stats) {
          for (var version in stats[name]) {
            data[name + " " + version] = stats[name][version];
          }
        }
      }
      return browsers.reduce(function(all, i) {
        var usage = data[i];
        if (usage === void 0) {
          usage = data[i.replace(/ \S+$/, " 0")];
        }
        return all + (usage || 0);
      }, 0);
    };
    function nodeQuery(context, node) {
      var matched = browserslist.nodeVersions.filter(function(i) {
        return isVersionsMatch(i, node.version);
      });
      if (matched.length === 0) {
        if (context.ignoreUnknownVersions) {
          return [];
        } else {
          throw new BrowserslistError(
            "Unknown version " + node.version + " of Node.js"
          );
        }
      }
      return ["node " + matched[matched.length - 1]];
    }
    function sinceQuery(context, node) {
      var year = parseInt(node.year);
      var month = parseInt(node.month || "01") - 1;
      var day = parseInt(node.day || "01");
      return filterByYear(Date.UTC(year, month, day, 0, 0, 0), context);
    }
    function coverQuery(context, node) {
      var coverage = parseFloat(node.coverage);
      var usage = browserslist.usage.global;
      if (node.place) {
        if (node.place.match(/^my\s+stats$/i)) {
          if (!context.customUsage) {
            throw new BrowserslistError("Custom usage statistics was not provided");
          }
          usage = context.customUsage;
        } else {
          var place;
          if (node.place.length === 2) {
            place = node.place.toUpperCase();
          } else {
            place = node.place.toLowerCase();
          }
          env.loadCountry(browserslist.usage, place, browserslist.data);
          usage = browserslist.usage[place];
        }
      } else if (node.config) {
        usage = loadCustomUsage(context, node.config);
      }
      var versions = Object.keys(usage).sort(function(a, b) {
        return usage[b] - usage[a];
      });
      var covered = 0;
      var result = [];
      var version;
      for (var i = 0; i < versions.length; i++) {
        version = versions[i];
        if (usage[version] === 0) break;
        covered += usage[version];
        result.push(version);
        if (covered >= coverage) break;
      }
      return result;
    }
    var QUERIES = {
      last_major_versions: {
        matches: ["versions"],
        regexp: /^last\s+(\d+)\s+major\s+versions?$/i,
        select: function(context, node) {
          return Object.keys(agents).reduce(function(selected, name) {
            var data = byName(name, context);
            if (!data) return selected;
            var list = getMajorVersions(data.released, node.versions);
            list = list.map(nameMapper(data.name));
            list = filterJumps(list, data.name, node.versions, context);
            return selected.concat(list);
          }, []);
        }
      },
      last_versions: {
        matches: ["versions"],
        regexp: /^last\s+(\d+)\s+versions?$/i,
        select: function(context, node) {
          return Object.keys(agents).reduce(function(selected, name) {
            var data = byName(name, context);
            if (!data) return selected;
            var list = data.released.slice(-node.versions);
            list = list.map(nameMapper(data.name));
            list = filterJumps(list, data.name, node.versions, context);
            return selected.concat(list);
          }, []);
        }
      },
      last_electron_major_versions: {
        matches: ["versions"],
        regexp: /^last\s+(\d+)\s+electron\s+major\s+versions?$/i,
        select: function(context, node) {
          var validVersions = getMajorVersions(Object.keys(e2c), node.versions);
          return validVersions.map(function(i) {
            return "chrome " + e2c[i];
          });
        }
      },
      last_node_major_versions: {
        matches: ["versions"],
        regexp: /^last\s+(\d+)\s+node\s+major\s+versions?$/i,
        select: function(context, node) {
          return getMajorVersions(browserslist.nodeVersions, node.versions).map(
            function(version) {
              return "node " + version;
            }
          );
        }
      },
      last_browser_major_versions: {
        matches: ["versions", "browser"],
        regexp: /^last\s+(\d+)\s+(\w+)\s+major\s+versions?$/i,
        select: function(context, node) {
          var data = checkName(node.browser, context);
          var validVersions = getMajorVersions(data.released, node.versions);
          var list = validVersions.map(nameMapper(data.name));
          list = filterJumps(list, data.name, node.versions, context);
          return list;
        }
      },
      last_electron_versions: {
        matches: ["versions"],
        regexp: /^last\s+(\d+)\s+electron\s+versions?$/i,
        select: function(context, node) {
          return Object.keys(e2c).slice(-node.versions).map(function(i) {
            return "chrome " + e2c[i];
          });
        }
      },
      last_node_versions: {
        matches: ["versions"],
        regexp: /^last\s+(\d+)\s+node\s+versions?$/i,
        select: function(context, node) {
          return browserslist.nodeVersions.slice(-node.versions).map(function(version) {
            return "node " + version;
          });
        }
      },
      last_browser_versions: {
        matches: ["versions", "browser"],
        regexp: /^last\s+(\d+)\s+(\w+)\s+versions?$/i,
        select: function(context, node) {
          var data = checkName(node.browser, context);
          var list = data.released.slice(-node.versions).map(nameMapper(data.name));
          list = filterJumps(list, data.name, node.versions, context);
          return list;
        }
      },
      unreleased_versions: {
        matches: [],
        regexp: /^unreleased\s+versions$/i,
        select: function(context) {
          return Object.keys(agents).reduce(function(selected, name) {
            var data = byName(name, context);
            if (!data) return selected;
            var list = data.versions.filter(function(v) {
              return data.released.indexOf(v) === -1;
            });
            list = list.map(nameMapper(data.name));
            return selected.concat(list);
          }, []);
        }
      },
      unreleased_electron_versions: {
        matches: [],
        regexp: /^unreleased\s+electron\s+versions?$/i,
        select: function() {
          return [];
        }
      },
      unreleased_browser_versions: {
        matches: ["browser"],
        regexp: /^unreleased\s+(\w+)\s+versions?$/i,
        select: function(context, node) {
          var data = checkName(node.browser, context);
          return data.versions.filter(function(v) {
            return data.released.indexOf(v) === -1;
          }).map(nameMapper(data.name));
        }
      },
      last_years: {
        matches: ["years"],
        regexp: /^last\s+((\d+\.)?\d+)\s+years?$/i,
        select: function(context, node) {
          return filterByYear(Date.now() - YEAR * node.years, context);
        }
      },
      since_y: {
        matches: ["year"],
        regexp: /^since (\d+)$/i,
        select: sinceQuery
      },
      since_y_m: {
        matches: ["year", "month"],
        regexp: /^since (\d+)-(\d+)$/i,
        select: sinceQuery
      },
      since_y_m_d: {
        matches: ["year", "month", "day"],
        regexp: /^since (\d+)-(\d+)-(\d+)$/i,
        select: sinceQuery
      },
      popularity: {
        matches: ["sign", "popularity"],
        regexp: /^(>=?|<=?)\s*(\d+|\d+\.\d+|\.\d+)%$/,
        select: function(context, node) {
          var popularity = parseFloat(node.popularity);
          var usage = browserslist.usage.global;
          return Object.keys(usage).reduce(function(result, version) {
            if (node.sign === ">") {
              if (usage[version] > popularity) {
                result.push(version);
              }
            } else if (node.sign === "<") {
              if (usage[version] < popularity) {
                result.push(version);
              }
            } else if (node.sign === "<=") {
              if (usage[version] <= popularity) {
                result.push(version);
              }
            } else if (usage[version] >= popularity) {
              result.push(version);
            }
            return result;
          }, []);
        }
      },
      popularity_in_my_stats: {
        matches: ["sign", "popularity"],
        regexp: /^(>=?|<=?)\s*(\d+|\d+\.\d+|\.\d+)%\s+in\s+my\s+stats$/,
        select: function(context, node) {
          var popularity = parseFloat(node.popularity);
          if (!context.customUsage) {
            throw new BrowserslistError("Custom usage statistics was not provided");
          }
          var usage = context.customUsage;
          return Object.keys(usage).reduce(function(result, version) {
            var percentage = usage[version];
            if (percentage == null) {
              return result;
            }
            if (node.sign === ">") {
              if (percentage > popularity) {
                result.push(version);
              }
            } else if (node.sign === "<") {
              if (percentage < popularity) {
                result.push(version);
              }
            } else if (node.sign === "<=") {
              if (percentage <= popularity) {
                result.push(version);
              }
            } else if (percentage >= popularity) {
              result.push(version);
            }
            return result;
          }, []);
        }
      },
      popularity_in_config_stats: {
        matches: ["sign", "popularity", "config"],
        regexp: /^(>=?|<=?)\s*(\d+|\d+\.\d+|\.\d+)%\s+in\s+(\S+)\s+stats$/,
        select: function(context, node) {
          var popularity = parseFloat(node.popularity);
          var usage = loadCustomUsage(context, node.config);
          return Object.keys(usage).reduce(function(result, version) {
            var percentage = usage[version];
            if (percentage == null) {
              return result;
            }
            if (node.sign === ">") {
              if (percentage > popularity) {
                result.push(version);
              }
            } else if (node.sign === "<") {
              if (percentage < popularity) {
                result.push(version);
              }
            } else if (node.sign === "<=") {
              if (percentage <= popularity) {
                result.push(version);
              }
            } else if (percentage >= popularity) {
              result.push(version);
            }
            return result;
          }, []);
        }
      },
      popularity_in_place: {
        matches: ["sign", "popularity", "place"],
        regexp: /^(>=?|<=?)\s*(\d+|\d+\.\d+|\.\d+)%\s+in\s+((alt-)?\w\w)$/,
        select: function(context, node) {
          var popularity = parseFloat(node.popularity);
          var place = node.place;
          if (place.length === 2) {
            place = place.toUpperCase();
          } else {
            place = place.toLowerCase();
          }
          env.loadCountry(browserslist.usage, place, browserslist.data);
          var usage = browserslist.usage[place];
          return Object.keys(usage).reduce(function(result, version) {
            var percentage = usage[version];
            if (percentage == null) {
              return result;
            }
            if (node.sign === ">") {
              if (percentage > popularity) {
                result.push(version);
              }
            } else if (node.sign === "<") {
              if (percentage < popularity) {
                result.push(version);
              }
            } else if (node.sign === "<=") {
              if (percentage <= popularity) {
                result.push(version);
              }
            } else if (percentage >= popularity) {
              result.push(version);
            }
            return result;
          }, []);
        }
      },
      cover: {
        matches: ["coverage"],
        regexp: /^cover\s+(\d+|\d+\.\d+|\.\d+)%$/i,
        select: coverQuery
      },
      cover_in: {
        matches: ["coverage", "place"],
        regexp: /^cover\s+(\d+|\d+\.\d+|\.\d+)%\s+in\s+(my\s+stats|(alt-)?\w\w)$/i,
        select: coverQuery
      },
      cover_config: {
        matches: ["coverage", "config"],
        regexp: /^cover\s+(\d+|\d+\.\d+|\.\d+)%\s+in\s+(\S+)\s+stats$/i,
        select: coverQuery
      },
      supports: {
        matches: ["supportType", "feature"],
        regexp: /^(?:(fully|partially)\s+)?supports\s+([\w-]+)$/,
        select: function(context, node) {
          env.loadFeature(browserslist.cache, node.feature);
          var withPartial = node.supportType !== "fully";
          var features = browserslist.cache[node.feature];
          var result = [];
          for (var name in features) {
            var data = byName(name, context);
            var iMax = data.released.length - 1;
            while (iMax >= 0) {
              if (data.released[iMax] in features[name]) break;
              iMax--;
            }
            var checkDesktop = context.mobileToDesktop && name in browserslist.desktopNames && isSupported(features[name][data.released[iMax]], withPartial);
            data.versions.forEach(function(version) {
              var flags = features[name][version];
              if (flags === void 0 && checkDesktop) {
                flags = features[browserslist.desktopNames[name]][version];
              }
              if (isSupported(flags, withPartial)) {
                result.push(name + " " + version);
              }
            });
          }
          return result;
        }
      },
      electron_range: {
        matches: ["from", "to"],
        regexp: /^electron\s+([\d.]+)\s*-\s*([\d.]+)$/i,
        select: function(context, node) {
          var fromToUse = normalizeElectron(node.from);
          var toToUse = normalizeElectron(node.to);
          var from = parseFloat(node.from);
          var to = parseFloat(node.to);
          if (!e2c[fromToUse]) {
            throw new BrowserslistError("Unknown version " + from + " of electron");
          }
          if (!e2c[toToUse]) {
            throw new BrowserslistError("Unknown version " + to + " of electron");
          }
          return Object.keys(e2c).filter(function(i) {
            var parsed = parseFloat(i);
            return parsed >= from && parsed <= to;
          }).map(function(i) {
            return "chrome " + e2c[i];
          });
        }
      },
      node_range: {
        matches: ["from", "to"],
        regexp: /^node\s+([\d.]+)\s*-\s*([\d.]+)$/i,
        select: function(context, node) {
          return browserslist.nodeVersions.filter(semverFilterLoose(">=", node.from)).filter(semverFilterLoose("<=", node.to)).map(function(v) {
            return "node " + v;
          });
        }
      },
      browser_range: {
        matches: ["browser", "from", "to"],
        regexp: /^(\w+)\s+([\d.]+)\s*-\s*([\d.]+)$/i,
        select: function(context, node) {
          var data = checkName(node.browser, context);
          var from = parseFloat(normalizeVersion(data, node.from) || node.from);
          var to = parseFloat(normalizeVersion(data, node.to) || node.to);
          function filter(v) {
            var parsed = parseFloat(v);
            return parsed >= from && parsed <= to;
          }
          return data.released.filter(filter).map(nameMapper(data.name));
        }
      },
      electron_ray: {
        matches: ["sign", "version"],
        regexp: /^electron\s*(>=?|<=?)\s*([\d.]+)$/i,
        select: function(context, node) {
          var versionToUse = normalizeElectron(node.version);
          return Object.keys(e2c).filter(generateFilter(node.sign, versionToUse)).map(function(i) {
            return "chrome " + e2c[i];
          });
        }
      },
      node_ray: {
        matches: ["sign", "version"],
        regexp: /^node\s*(>=?|<=?)\s*([\d.]+)$/i,
        select: function(context, node) {
          return browserslist.nodeVersions.filter(generateSemverFilter(node.sign, node.version)).map(function(v) {
            return "node " + v;
          });
        }
      },
      browser_ray: {
        matches: ["browser", "sign", "version"],
        regexp: /^(\w+)\s*(>=?|<=?)\s*([\d.]+)$/,
        select: function(context, node) {
          var version = node.version;
          var data = checkName(node.browser, context);
          var alias = browserslist.versionAliases[data.name][version];
          if (alias) version = alias;
          return data.released.filter(generateFilter(node.sign, version)).map(function(v) {
            return data.name + " " + v;
          });
        }
      },
      firefox_esr: {
        matches: [],
        regexp: /^(firefox|ff|fx)\s+esr$/i,
        select: function() {
          return ["firefox 128", "firefox 140"];
        }
      },
      opera_mini_all: {
        matches: [],
        regexp: /(operamini|op_mini)\s+all/i,
        select: function() {
          return ["op_mini all"];
        }
      },
      electron_version: {
        matches: ["version"],
        regexp: /^electron\s+([\d.]+)$/i,
        select: function(context, node) {
          var versionToUse = normalizeElectron(node.version);
          var chrome = e2c[versionToUse];
          if (!chrome) {
            throw new BrowserslistError(
              "Unknown version " + node.version + " of electron"
            );
          }
          return ["chrome " + chrome];
        }
      },
      node_major_version: {
        matches: ["version"],
        regexp: /^node\s+(\d+)$/i,
        select: nodeQuery
      },
      node_minor_version: {
        matches: ["version"],
        regexp: /^node\s+(\d+\.\d+)$/i,
        select: nodeQuery
      },
      node_patch_version: {
        matches: ["version"],
        regexp: /^node\s+(\d+\.\d+\.\d+)$/i,
        select: nodeQuery
      },
      current_node: {
        matches: [],
        regexp: /^current\s+node$/i,
        select: function(context) {
          return [env.currentNode(resolve, context)];
        }
      },
      maintained_node: {
        matches: [],
        regexp: /^maintained\s+node\s+versions$/i,
        select: function(context) {
          var now = Date.now();
          var queries = Object.keys(jsEOL).filter(function(key) {
            return now < Date.parse(jsEOL[key].end) && now > Date.parse(jsEOL[key].start) && isEolReleased(key);
          }).map(function(key) {
            return "node " + key.slice(1);
          });
          return resolve(queries, context);
        }
      },
      phantomjs_1_9: {
        matches: [],
        regexp: /^phantomjs\s+1.9$/i,
        select: function() {
          return ["safari 5"];
        }
      },
      phantomjs_2_1: {
        matches: [],
        regexp: /^phantomjs\s+2.1$/i,
        select: function() {
          return ["safari 6"];
        }
      },
      browser_version: {
        matches: ["browser", "version"],
        regexp: /^(\w+)\s+(tp|[\d.]+)$/i,
        select: function(context, node) {
          var version = node.version;
          if (/^tp$/i.test(version)) version = "TP";
          var data = checkName(node.browser, context);
          var alias = normalizeVersion(data, version);
          if (alias) {
            version = alias;
          } else {
            if (version.indexOf(".") === -1) {
              alias = version + ".0";
            } else {
              alias = version.replace(/\.0$/, "");
            }
            alias = normalizeVersion(data, alias);
            if (alias) {
              version = alias;
            } else if (context.ignoreUnknownVersions) {
              return [];
            } else {
              throw new BrowserslistError(
                "Unknown version " + version + " of " + node.browser
              );
            }
          }
          return [data.name + " " + version];
        }
      },
      browserslist_config: {
        matches: [],
        regexp: /^browserslist config$/i,
        needsPath: true,
        select: function(context) {
          return browserslist(void 0, context);
        }
      },
      extends: {
        matches: ["config"],
        regexp: /^extends (.+)$/i,
        needsPath: true,
        select: function(context, node) {
          return resolve(env.loadQueries(context, node.config), context);
        }
      },
      defaults: {
        matches: [],
        regexp: /^defaults$/i,
        select: function(context) {
          return resolve(browserslist.defaults, context);
        }
      },
      dead: {
        matches: [],
        regexp: /^dead$/i,
        select: function(context) {
          var dead = [
            "Baidu >= 0",
            "ie <= 11",
            "ie_mob <= 11",
            "bb <= 10",
            "op_mob <= 12.1",
            "samsung 4"
          ];
          return resolve(dead, context);
        }
      },
      unknown: {
        matches: [],
        regexp: /^(\w+)$/i,
        select: function(context, node) {
          if (byName(node.query, context)) {
            throw new BrowserslistError(
              "Specify versions in Browserslist query for browser " + node.query
            );
          } else {
            throw unknownQuery(node.query);
          }
        }
      }
    };
    (function() {
      for (var name in agents) {
        var browser = agents[name];
        browserslist.data[name] = {
          name,
          versions: normalize(agents[name].versions),
          released: normalize(agents[name].versions.slice(0, -3)),
          releaseDate: agents[name].release_date
        };
        fillUsage(browserslist.usage.global, name, browser.usage_global);
        browserslist.versionAliases[name] = {};
        for (var i = 0; i < browser.versions.length; i++) {
          var full = browser.versions[i];
          if (!full) continue;
          if (full.indexOf("-") !== -1) {
            var interval = full.split("-");
            for (var j = 0; j < interval.length; j++) {
              browserslist.versionAliases[name][interval[j]] = full;
            }
          }
        }
      }
      browserslist.nodeVersions = jsReleases.map(function(release) {
        return release.version;
      });
    })();
    module2.exports = browserslist;
  }
});

// node_modules/@babel/helper-validator-option/lib/find-suggestion.js
var require_find_suggestion = __commonJS({
  "node_modules/@babel/helper-validator-option/lib/find-suggestion.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.findSuggestion = findSuggestion;
    var {
      min
    } = Math;
    function levenshtein(a, b) {
      let t = [], u = [], i, j;
      const m = a.length, n = b.length;
      if (!m) {
        return n;
      }
      if (!n) {
        return m;
      }
      for (j = 0; j <= n; j++) {
        t[j] = j;
      }
      for (i = 1; i <= m; i++) {
        for (u = [i], j = 1; j <= n; j++) {
          u[j] = a[i - 1] === b[j - 1] ? t[j - 1] : min(t[j - 1], t[j], u[j - 1]) + 1;
        }
        t = u;
      }
      return u[n];
    }
    function findSuggestion(str, arr) {
      const distances = arr.map((el) => levenshtein(el, str));
      return arr[distances.indexOf(min(...distances))];
    }
  }
});

// node_modules/@babel/helper-validator-option/lib/validator.js
var require_validator = __commonJS({
  "node_modules/@babel/helper-validator-option/lib/validator.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.OptionValidator = void 0;
    var _findSuggestion = require_find_suggestion();
    var OptionValidator = class {
      constructor(descriptor) {
        this.descriptor = descriptor;
      }
      validateTopLevelOptions(options, TopLevelOptionShape) {
        const validOptionNames = Object.keys(TopLevelOptionShape);
        for (const option of Object.keys(options)) {
          if (!validOptionNames.includes(option)) {
            throw new Error(this.formatMessage(`'${option}' is not a valid top-level option.
- Did you mean '${(0, _findSuggestion.findSuggestion)(option, validOptionNames)}'?`));
          }
        }
      }
      validateBooleanOption(name, value2, defaultValue) {
        if (value2 === void 0) {
          return defaultValue;
        } else {
          this.invariant(typeof value2 === "boolean", `'${name}' option must be a boolean.`);
        }
        return value2;
      }
      validateStringOption(name, value2, defaultValue) {
        if (value2 === void 0) {
          return defaultValue;
        } else {
          this.invariant(typeof value2 === "string", `'${name}' option must be a string.`);
        }
        return value2;
      }
      invariant(condition, message) {
        if (!condition) {
          throw new Error(this.formatMessage(message));
        }
      }
      formatMessage(message) {
        return `${this.descriptor}: ${message}`;
      }
    };
    exports2.OptionValidator = OptionValidator;
  }
});

// node_modules/@babel/helper-validator-option/lib/index.js
var require_lib13 = __commonJS({
  "node_modules/@babel/helper-validator-option/lib/index.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    Object.defineProperty(exports2, "OptionValidator", {
      enumerable: true,
      get: function() {
        return _validator.OptionValidator;
      }
    });
    Object.defineProperty(exports2, "findSuggestion", {
      enumerable: true,
      get: function() {
        return _findSuggestion.findSuggestion;
      }
    });
    var _validator = require_validator();
    var _findSuggestion = require_find_suggestion();
  }
});

// node_modules/yallist/iterator.js
var require_iterator = __commonJS({
  "node_modules/yallist/iterator.js"(exports2, module2) {
    "use strict";
    module2.exports = function(Yallist) {
      Yallist.prototype[Symbol.iterator] = function* () {
        for (let walker = this.head; walker; walker = walker.next) {
          yield walker.value;
        }
      };
    };
  }
});

// node_modules/yallist/yallist.js
var require_yallist = __commonJS({
  "node_modules/yallist/yallist.js"(exports2, module2) {
    "use strict";
    module2.exports = Yallist;
    Yallist.Node = Node;
    Yallist.create = Yallist;
    function Yallist(list) {
      var self2 = this;
      if (!(self2 instanceof Yallist)) {
        self2 = new Yallist();
      }
      self2.tail = null;
      self2.head = null;
      self2.length = 0;
      if (list && typeof list.forEach === "function") {
        list.forEach(function(item) {
          self2.push(item);
        });
      } else if (arguments.length > 0) {
        for (var i = 0, l = arguments.length; i < l; i++) {
          self2.push(arguments[i]);
        }
      }
      return self2;
    }
    Yallist.prototype.removeNode = function(node) {
      if (node.list !== this) {
        throw new Error("removing node which does not belong to this list");
      }
      var next = node.next;
      var prev = node.prev;
      if (next) {
        next.prev = prev;
      }
      if (prev) {
        prev.next = next;
      }
      if (node === this.head) {
        this.head = next;
      }
      if (node === this.tail) {
        this.tail = prev;
      }
      node.list.length--;
      node.next = null;
      node.prev = null;
      node.list = null;
      return next;
    };
    Yallist.prototype.unshiftNode = function(node) {
      if (node === this.head) {
        return;
      }
      if (node.list) {
        node.list.removeNode(node);
      }
      var head = this.head;
      node.list = this;
      node.next = head;
      if (head) {
        head.prev = node;
      }
      this.head = node;
      if (!this.tail) {
        this.tail = node;
      }
      this.length++;
    };
    Yallist.prototype.pushNode = function(node) {
      if (node === this.tail) {
        return;
      }
      if (node.list) {
        node.list.removeNode(node);
      }
      var tail = this.tail;
      node.list = this;
      node.prev = tail;
      if (tail) {
        tail.next = node;
      }
      this.tail = node;
      if (!this.head) {
        this.head = node;
      }
      this.length++;
    };
    Yallist.prototype.push = function() {
      for (var i = 0, l = arguments.length; i < l; i++) {
        push(this, arguments[i]);
      }
      return this.length;
    };
    Yallist.prototype.unshift = function() {
      for (var i = 0, l = arguments.length; i < l; i++) {
        unshift(this, arguments[i]);
      }
      return this.length;
    };
    Yallist.prototype.pop = function() {
      if (!this.tail) {
        return void 0;
      }
      var res = this.tail.value;
      this.tail = this.tail.prev;
      if (this.tail) {
        this.tail.next = null;
      } else {
        this.head = null;
      }
      this.length--;
      return res;
    };
    Yallist.prototype.shift = function() {
      if (!this.head) {
        return void 0;
      }
      var res = this.head.value;
      this.head = this.head.next;
      if (this.head) {
        this.head.prev = null;
      } else {
        this.tail = null;
      }
      this.length--;
      return res;
    };
    Yallist.prototype.forEach = function(fn, thisp) {
      thisp = thisp || this;
      for (var walker = this.head, i = 0; walker !== null; i++) {
        fn.call(thisp, walker.value, i, this);
        walker = walker.next;
      }
    };
    Yallist.prototype.forEachReverse = function(fn, thisp) {
      thisp = thisp || this;
      for (var walker = this.tail, i = this.length - 1; walker !== null; i--) {
        fn.call(thisp, walker.value, i, this);
        walker = walker.prev;
      }
    };
    Yallist.prototype.get = function(n) {
      for (var i = 0, walker = this.head; walker !== null && i < n; i++) {
        walker = walker.next;
      }
      if (i === n && walker !== null) {
        return walker.value;
      }
    };
    Yallist.prototype.getReverse = function(n) {
      for (var i = 0, walker = this.tail; walker !== null && i < n; i++) {
        walker = walker.prev;
      }
      if (i === n && walker !== null) {
        return walker.value;
      }
    };
    Yallist.prototype.map = function(fn, thisp) {
      thisp = thisp || this;
      var res = new Yallist();
      for (var walker = this.head; walker !== null; ) {
        res.push(fn.call(thisp, walker.value, this));
        walker = walker.next;
      }
      return res;
    };
    Yallist.prototype.mapReverse = function(fn, thisp) {
      thisp = thisp || this;
      var res = new Yallist();
      for (var walker = this.tail; walker !== null; ) {
        res.push(fn.call(thisp, walker.value, this));
        walker = walker.prev;
      }
      return res;
    };
    Yallist.prototype.reduce = function(fn, initial) {
      var acc;
      var walker = this.head;
      if (arguments.length > 1) {
        acc = initial;
      } else if (this.head) {
        walker = this.head.next;
        acc = this.head.value;
      } else {
        throw new TypeError("Reduce of empty list with no initial value");
      }
      for (var i = 0; walker !== null; i++) {
        acc = fn(acc, walker.value, i);
        walker = walker.next;
      }
      return acc;
    };
    Yallist.prototype.reduceReverse = function(fn, initial) {
      var acc;
      var walker = this.tail;
      if (arguments.length > 1) {
        acc = initial;
      } else if (this.tail) {
        walker = this.tail.prev;
        acc = this.tail.value;
      } else {
        throw new TypeError("Reduce of empty list with no initial value");
      }
      for (var i = this.length - 1; walker !== null; i--) {
        acc = fn(acc, walker.value, i);
        walker = walker.prev;
      }
      return acc;
    };
    Yallist.prototype.toArray = function() {
      var arr = new Array(this.length);
      for (var i = 0, walker = this.head; walker !== null; i++) {
        arr[i] = walker.value;
        walker = walker.next;
      }
      return arr;
    };
    Yallist.prototype.toArrayReverse = function() {
      var arr = new Array(this.length);
      for (var i = 0, walker = this.tail; walker !== null; i++) {
        arr[i] = walker.value;
        walker = walker.prev;
      }
      return arr;
    };
    Yallist.prototype.slice = function(from, to) {
      to = to || this.length;
      if (to < 0) {
        to += this.length;
      }
      from = from || 0;
      if (from < 0) {
        from += this.length;
      }
      var ret = new Yallist();
      if (to < from || to < 0) {
        return ret;
      }
      if (from < 0) {
        from = 0;
      }
      if (to > this.length) {
        to = this.length;
      }
      for (var i = 0, walker = this.head; walker !== null && i < from; i++) {
        walker = walker.next;
      }
      for (; walker !== null && i < to; i++, walker = walker.next) {
        ret.push(walker.value);
      }
      return ret;
    };
    Yallist.prototype.sliceReverse = function(from, to) {
      to = to || this.length;
      if (to < 0) {
        to += this.length;
      }
      from = from || 0;
      if (from < 0) {
        from += this.length;
      }
      var ret = new Yallist();
      if (to < from || to < 0) {
        return ret;
      }
      if (from < 0) {
        from = 0;
      }
      if (to > this.length) {
        to = this.length;
      }
      for (var i = this.length, walker = this.tail; walker !== null && i > to; i--) {
        walker = walker.prev;
      }
      for (; walker !== null && i > from; i--, walker = walker.prev) {
        ret.push(walker.value);
      }
      return ret;
    };
    Yallist.prototype.splice = function(start, deleteCount) {
      if (start > this.length) {
        start = this.length - 1;
      }
      if (start < 0) {
        start = this.length + start;
      }
      for (var i = 0, walker = this.head; walker !== null && i < start; i++) {
        walker = walker.next;
      }
      var ret = [];
      for (var i = 0; walker && i < deleteCount; i++) {
        ret.push(walker.value);
        walker = this.removeNode(walker);
      }
      if (walker === null) {
        walker = this.tail;
      }
      if (walker !== this.head && walker !== this.tail) {
        walker = walker.prev;
      }
      for (var i = 2; i < arguments.length; i++) {
        walker = insert(this, walker, arguments[i]);
      }
      return ret;
    };
    Yallist.prototype.reverse = function() {
      var head = this.head;
      var tail = this.tail;
      for (var walker = head; walker !== null; walker = walker.prev) {
        var p = walker.prev;
        walker.prev = walker.next;
        walker.next = p;
      }
      this.head = tail;
      this.tail = head;
      return this;
    };
    function insert(self2, node, value2) {
      var inserted = node === self2.head ? new Node(value2, null, node, self2) : new Node(value2, node, node.next, self2);
      if (inserted.next === null) {
        self2.tail = inserted;
      }
      if (inserted.prev === null) {
        self2.head = inserted;
      }
      self2.length++;
      return inserted;
    }
    function push(self2, item) {
      self2.tail = new Node(item, self2.tail, null, self2);
      if (!self2.head) {
        self2.head = self2.tail;
      }
      self2.length++;
    }
    function unshift(self2, item) {
      self2.head = new Node(item, null, self2.head, self2);
      if (!self2.tail) {
        self2.tail = self2.head;
      }
      self2.length++;
    }
    function Node(value2, prev, next, list) {
      if (!(this instanceof Node)) {
        return new Node(value2, prev, next, list);
      }
      this.list = list;
      this.value = value2;
      if (prev) {
        prev.next = this;
        this.prev = prev;
      } else {
        this.prev = null;
      }
      if (next) {
        next.prev = this;
        this.next = next;
      } else {
        this.next = null;
      }
    }
    try {
      require_iterator()(Yallist);
    } catch (er) {
    }
  }
});

// node_modules/lru-cache/index.js
var require_lru_cache = __commonJS({
  "node_modules/lru-cache/index.js"(exports2, module2) {
    "use strict";
    var Yallist = require_yallist();
    var MAX = Symbol("max");
    var LENGTH = Symbol("length");
    var LENGTH_CALCULATOR = Symbol("lengthCalculator");
    var ALLOW_STALE = Symbol("allowStale");
    var MAX_AGE = Symbol("maxAge");
    var DISPOSE = Symbol("dispose");
    var NO_DISPOSE_ON_SET = Symbol("noDisposeOnSet");
    var LRU_LIST = Symbol("lruList");
    var CACHE = Symbol("cache");
    var UPDATE_AGE_ON_GET = Symbol("updateAgeOnGet");
    var naiveLength = () => 1;
    var LRUCache = class {
      constructor(options) {
        if (typeof options === "number")
          options = { max: options };
        if (!options)
          options = {};
        if (options.max && (typeof options.max !== "number" || options.max < 0))
          throw new TypeError("max must be a non-negative number");
        const max = this[MAX] = options.max || Infinity;
        const lc = options.length || naiveLength;
        this[LENGTH_CALCULATOR] = typeof lc !== "function" ? naiveLength : lc;
        this[ALLOW_STALE] = options.stale || false;
        if (options.maxAge && typeof options.maxAge !== "number")
          throw new TypeError("maxAge must be a number");
        this[MAX_AGE] = options.maxAge || 0;
        this[DISPOSE] = options.dispose;
        this[NO_DISPOSE_ON_SET] = options.noDisposeOnSet || false;
        this[UPDATE_AGE_ON_GET] = options.updateAgeOnGet || false;
        this.reset();
      }
      // resize the cache when the max changes.
      set max(mL) {
        if (typeof mL !== "number" || mL < 0)
          throw new TypeError("max must be a non-negative number");
        this[MAX] = mL || Infinity;
        trim(this);
      }
      get max() {
        return this[MAX];
      }
      set allowStale(allowStale) {
        this[ALLOW_STALE] = !!allowStale;
      }
      get allowStale() {
        return this[ALLOW_STALE];
      }
      set maxAge(mA) {
        if (typeof mA !== "number")
          throw new TypeError("maxAge must be a non-negative number");
        this[MAX_AGE] = mA;
        trim(this);
      }
      get maxAge() {
        return this[MAX_AGE];
      }
      // resize the cache when the lengthCalculator changes.
      set lengthCalculator(lC) {
        if (typeof lC !== "function")
          lC = naiveLength;
        if (lC !== this[LENGTH_CALCULATOR]) {
          this[LENGTH_CALCULATOR] = lC;
          this[LENGTH] = 0;
          this[LRU_LIST].forEach((hit) => {
            hit.length = this[LENGTH_CALCULATOR](hit.value, hit.key);
            this[LENGTH] += hit.length;
          });
        }
        trim(this);
      }
      get lengthCalculator() {
        return this[LENGTH_CALCULATOR];
      }
      get length() {
        return this[LENGTH];
      }
      get itemCount() {
        return this[LRU_LIST].length;
      }
      rforEach(fn, thisp) {
        thisp = thisp || this;
        for (let walker = this[LRU_LIST].tail; walker !== null; ) {
          const prev = walker.prev;
          forEachStep(this, fn, walker, thisp);
          walker = prev;
        }
      }
      forEach(fn, thisp) {
        thisp = thisp || this;
        for (let walker = this[LRU_LIST].head; walker !== null; ) {
          const next = walker.next;
          forEachStep(this, fn, walker, thisp);
          walker = next;
        }
      }
      keys() {
        return this[LRU_LIST].toArray().map((k) => k.key);
      }
      values() {
        return this[LRU_LIST].toArray().map((k) => k.value);
      }
      reset() {
        if (this[DISPOSE] && this[LRU_LIST] && this[LRU_LIST].length) {
          this[LRU_LIST].forEach((hit) => this[DISPOSE](hit.key, hit.value));
        }
        this[CACHE] = /* @__PURE__ */ new Map();
        this[LRU_LIST] = new Yallist();
        this[LENGTH] = 0;
      }
      dump() {
        return this[LRU_LIST].map((hit) => isStale(this, hit) ? false : {
          k: hit.key,
          v: hit.value,
          e: hit.now + (hit.maxAge || 0)
        }).toArray().filter((h) => h);
      }
      dumpLru() {
        return this[LRU_LIST];
      }
      set(key, value2, maxAge) {
        maxAge = maxAge || this[MAX_AGE];
        if (maxAge && typeof maxAge !== "number")
          throw new TypeError("maxAge must be a number");
        const now = maxAge ? Date.now() : 0;
        const len = this[LENGTH_CALCULATOR](value2, key);
        if (this[CACHE].has(key)) {
          if (len > this[MAX]) {
            del(this, this[CACHE].get(key));
            return false;
          }
          const node = this[CACHE].get(key);
          const item = node.value;
          if (this[DISPOSE]) {
            if (!this[NO_DISPOSE_ON_SET])
              this[DISPOSE](key, item.value);
          }
          item.now = now;
          item.maxAge = maxAge;
          item.value = value2;
          this[LENGTH] += len - item.length;
          item.length = len;
          this.get(key);
          trim(this);
          return true;
        }
        const hit = new Entry(key, value2, len, now, maxAge);
        if (hit.length > this[MAX]) {
          if (this[DISPOSE])
            this[DISPOSE](key, value2);
          return false;
        }
        this[LENGTH] += hit.length;
        this[LRU_LIST].unshift(hit);
        this[CACHE].set(key, this[LRU_LIST].head);
        trim(this);
        return true;
      }
      has(key) {
        if (!this[CACHE].has(key)) return false;
        const hit = this[CACHE].get(key).value;
        return !isStale(this, hit);
      }
      get(key) {
        return get(this, key, true);
      }
      peek(key) {
        return get(this, key, false);
      }
      pop() {
        const node = this[LRU_LIST].tail;
        if (!node)
          return null;
        del(this, node);
        return node.value;
      }
      del(key) {
        del(this, this[CACHE].get(key));
      }
      load(arr) {
        this.reset();
        const now = Date.now();
        for (let l = arr.length - 1; l >= 0; l--) {
          const hit = arr[l];
          const expiresAt = hit.e || 0;
          if (expiresAt === 0)
            this.set(hit.k, hit.v);
          else {
            const maxAge = expiresAt - now;
            if (maxAge > 0) {
              this.set(hit.k, hit.v, maxAge);
            }
          }
        }
      }
      prune() {
        this[CACHE].forEach((value2, key) => get(this, key, false));
      }
    };
    var get = (self2, key, doUse) => {
      const node = self2[CACHE].get(key);
      if (node) {
        const hit = node.value;
        if (isStale(self2, hit)) {
          del(self2, node);
          if (!self2[ALLOW_STALE])
            return void 0;
        } else {
          if (doUse) {
            if (self2[UPDATE_AGE_ON_GET])
              node.value.now = Date.now();
            self2[LRU_LIST].unshiftNode(node);
          }
        }
        return hit.value;
      }
    };
    var isStale = (self2, hit) => {
      if (!hit || !hit.maxAge && !self2[MAX_AGE])
        return false;
      const diff = Date.now() - hit.now;
      return hit.maxAge ? diff > hit.maxAge : self2[MAX_AGE] && diff > self2[MAX_AGE];
    };
    var trim = (self2) => {
      if (self2[LENGTH] > self2[MAX]) {
        for (let walker = self2[LRU_LIST].tail; self2[LENGTH] > self2[MAX] && walker !== null; ) {
          const prev = walker.prev;
          del(self2, walker);
          walker = prev;
        }
      }
    };
    var del = (self2, node) => {
      if (node) {
        const hit = node.value;
        if (self2[DISPOSE])
          self2[DISPOSE](hit.key, hit.value);
        self2[LENGTH] -= hit.length;
        self2[CACHE].delete(hit.key);
        self2[LRU_LIST].removeNode(node);
      }
    };
    var Entry = class {
      constructor(key, value2, length, now, maxAge) {
        this.key = key;
        this.value = value2;
        this.length = length;
        this.now = now;
        this.maxAge = maxAge || 0;
      }
    };
    var forEachStep = (self2, fn, node, thisp) => {
      let hit = node.value;
      if (isStale(self2, hit)) {
        del(self2, node);
        if (!self2[ALLOW_STALE])
          hit = void 0;
      }
      if (hit)
        fn.call(thisp, hit.value, hit.key, self2);
    };
    module2.exports = LRUCache;
  }
});

// node_modules/@babel/helper-compilation-targets/node_modules/semver/semver.js
var require_semver2 = __commonJS({
  "node_modules/@babel/helper-compilation-targets/node_modules/semver/semver.js"(exports2, module2) {
    exports2 = module2.exports = SemVer;
    var debug;
    if (typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG)) {
      debug = function() {
        var args = Array.prototype.slice.call(arguments, 0);
        args.unshift("SEMVER");
        console.log.apply(console, args);
      };
    } else {
      debug = function() {
      };
    }
    exports2.SEMVER_SPEC_VERSION = "2.0.0";
    var MAX_LENGTH = 256;
    var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */
    9007199254740991;
    var MAX_SAFE_COMPONENT_LENGTH = 16;
    var MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6;
    var re = exports2.re = [];
    var safeRe = exports2.safeRe = [];
    var src = exports2.src = [];
    var t = exports2.tokens = {};
    var R = 0;
    function tok(n) {
      t[n] = R++;
    }
    var LETTERDASHNUMBER = "[a-zA-Z0-9-]";
    var safeRegexReplacements = [
      ["\\s", 1],
      ["\\d", MAX_LENGTH],
      [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH]
    ];
    function makeSafeRe(value2) {
      for (var i2 = 0; i2 < safeRegexReplacements.length; i2++) {
        var token = safeRegexReplacements[i2][0];
        var max = safeRegexReplacements[i2][1];
        value2 = value2.split(token + "*").join(token + "{0," + max + "}").split(token + "+").join(token + "{1," + max + "}");
      }
      return value2;
    }
    tok("NUMERICIDENTIFIER");
    src[t.NUMERICIDENTIFIER] = "0|[1-9]\\d*";
    tok("NUMERICIDENTIFIERLOOSE");
    src[t.NUMERICIDENTIFIERLOOSE] = "\\d+";
    tok("NONNUMERICIDENTIFIER");
    src[t.NONNUMERICIDENTIFIER] = "\\d*[a-zA-Z-]" + LETTERDASHNUMBER + "*";
    tok("MAINVERSION");
    src[t.MAINVERSION] = "(" + src[t.NUMERICIDENTIFIER] + ")\\.(" + src[t.NUMERICIDENTIFIER] + ")\\.(" + src[t.NUMERICIDENTIFIER] + ")";
    tok("MAINVERSIONLOOSE");
    src[t.MAINVERSIONLOOSE] = "(" + src[t.NUMERICIDENTIFIERLOOSE] + ")\\.(" + src[t.NUMERICIDENTIFIERLOOSE] + ")\\.(" + src[t.NUMERICIDENTIFIERLOOSE] + ")";
    tok("PRERELEASEIDENTIFIER");
    src[t.PRERELEASEIDENTIFIER] = "(?:" + src[t.NUMERICIDENTIFIER] + "|" + src[t.NONNUMERICIDENTIFIER] + ")";
    tok("PRERELEASEIDENTIFIERLOOSE");
    src[t.PRERELEASEIDENTIFIERLOOSE] = "(?:" + src[t.NUMERICIDENTIFIERLOOSE] + "|" + src[t.NONNUMERICIDENTIFIER] + ")";
    tok("PRERELEASE");
    src[t.PRERELEASE] = "(?:-(" + src[t.PRERELEASEIDENTIFIER] + "(?:\\." + src[t.PRERELEASEIDENTIFIER] + ")*))";
    tok("PRERELEASELOOSE");
    src[t.PRERELEASELOOSE] = "(?:-?(" + src[t.PRERELEASEIDENTIFIERLOOSE] + "(?:\\." + src[t.PRERELEASEIDENTIFIERLOOSE] + ")*))";
    tok("BUILDIDENTIFIER");
    src[t.BUILDIDENTIFIER] = LETTERDASHNUMBER + "+";
    tok("BUILD");
    src[t.BUILD] = "(?:\\+(" + src[t.BUILDIDENTIFIER] + "(?:\\." + src[t.BUILDIDENTIFIER] + ")*))";
    tok("FULL");
    tok("FULLPLAIN");
    src[t.FULLPLAIN] = "v?" + src[t.MAINVERSION] + src[t.PRERELEASE] + "?" + src[t.BUILD] + "?";
    src[t.FULL] = "^" + src[t.FULLPLAIN] + "$";
    tok("LOOSEPLAIN");
    src[t.LOOSEPLAIN] = "[v=\\s]*" + src[t.MAINVERSIONLOOSE] + src[t.PRERELEASELOOSE] + "?" + src[t.BUILD] + "?";
    tok("LOOSE");
    src[t.LOOSE] = "^" + src[t.LOOSEPLAIN] + "$";
    tok("GTLT");
    src[t.GTLT] = "((?:<|>)?=?)";
    tok("XRANGEIDENTIFIERLOOSE");
    src[t.XRANGEIDENTIFIERLOOSE] = src[t.NUMERICIDENTIFIERLOOSE] + "|x|X|\\*";
    tok("XRANGEIDENTIFIER");
    src[t.XRANGEIDENTIFIER] = src[t.NUMERICIDENTIFIER] + "|x|X|\\*";
    tok("XRANGEPLAIN");
    src[t.XRANGEPLAIN] = "[v=\\s]*(" + src[t.XRANGEIDENTIFIER] + ")(?:\\.(" + src[t.XRANGEIDENTIFIER] + ")(?:\\.(" + src[t.XRANGEIDENTIFIER] + ")(?:" + src[t.PRERELEASE] + ")?" + src[t.BUILD] + "?)?)?";
    tok("XRANGEPLAINLOOSE");
    src[t.XRANGEPLAINLOOSE] = "[v=\\s]*(" + src[t.XRANGEIDENTIFIERLOOSE] + ")(?:\\.(" + src[t.XRANGEIDENTIFIERLOOSE] + ")(?:\\.(" + src[t.XRANGEIDENTIFIERLOOSE] + ")(?:" + src[t.PRERELEASELOOSE] + ")?" + src[t.BUILD] + "?)?)?";
    tok("XRANGE");
    src[t.XRANGE] = "^" + src[t.GTLT] + "\\s*" + src[t.XRANGEPLAIN] + "$";
    tok("XRANGELOOSE");
    src[t.XRANGELOOSE] = "^" + src[t.GTLT] + "\\s*" + src[t.XRANGEPLAINLOOSE] + "$";
    tok("COERCE");
    src[t.COERCE] = "(^|[^\\d])(\\d{1," + MAX_SAFE_COMPONENT_LENGTH + "})(?:\\.(\\d{1," + MAX_SAFE_COMPONENT_LENGTH + "}))?(?:\\.(\\d{1," + MAX_SAFE_COMPONENT_LENGTH + "}))?(?:$|[^\\d])";
    tok("COERCERTL");
    re[t.COERCERTL] = new RegExp(src[t.COERCE], "g");
    safeRe[t.COERCERTL] = new RegExp(makeSafeRe(src[t.COERCE]), "g");
    tok("LONETILDE");
    src[t.LONETILDE] = "(?:~>?)";
    tok("TILDETRIM");
    src[t.TILDETRIM] = "(\\s*)" + src[t.LONETILDE] + "\\s+";
    re[t.TILDETRIM] = new RegExp(src[t.TILDETRIM], "g");
    safeRe[t.TILDETRIM] = new RegExp(makeSafeRe(src[t.TILDETRIM]), "g");
    var tildeTrimReplace = "$1~";
    tok("TILDE");
    src[t.TILDE] = "^" + src[t.LONETILDE] + src[t.XRANGEPLAIN] + "$";
    tok("TILDELOOSE");
    src[t.TILDELOOSE] = "^" + src[t.LONETILDE] + src[t.XRANGEPLAINLOOSE] + "$";
    tok("LONECARET");
    src[t.LONECARET] = "(?:\\^)";
    tok("CARETTRIM");
    src[t.CARETTRIM] = "(\\s*)" + src[t.LONECARET] + "\\s+";
    re[t.CARETTRIM] = new RegExp(src[t.CARETTRIM], "g");
    safeRe[t.CARETTRIM] = new RegExp(makeSafeRe(src[t.CARETTRIM]), "g");
    var caretTrimReplace = "$1^";
    tok("CARET");
    src[t.CARET] = "^" + src[t.LONECARET] + src[t.XRANGEPLAIN] + "$";
    tok("CARETLOOSE");
    src[t.CARETLOOSE] = "^" + src[t.LONECARET] + src[t.XRANGEPLAINLOOSE] + "$";
    tok("COMPARATORLOOSE");
    src[t.COMPARATORLOOSE] = "^" + src[t.GTLT] + "\\s*(" + src[t.LOOSEPLAIN] + ")$|^$";
    tok("COMPARATOR");
    src[t.COMPARATOR] = "^" + src[t.GTLT] + "\\s*(" + src[t.FULLPLAIN] + ")$|^$";
    tok("COMPARATORTRIM");
    src[t.COMPARATORTRIM] = "(\\s*)" + src[t.GTLT] + "\\s*(" + src[t.LOOSEPLAIN] + "|" + src[t.XRANGEPLAIN] + ")";
    re[t.COMPARATORTRIM] = new RegExp(src[t.COMPARATORTRIM], "g");
    safeRe[t.COMPARATORTRIM] = new RegExp(makeSafeRe(src[t.COMPARATORTRIM]), "g");
    var comparatorTrimReplace = "$1$2$3";
    tok("HYPHENRANGE");
    src[t.HYPHENRANGE] = "^\\s*(" + src[t.XRANGEPLAIN] + ")\\s+-\\s+(" + src[t.XRANGEPLAIN] + ")\\s*$";
    tok("HYPHENRANGELOOSE");
    src[t.HYPHENRANGELOOSE] = "^\\s*(" + src[t.XRANGEPLAINLOOSE] + ")\\s+-\\s+(" + src[t.XRANGEPLAINLOOSE] + ")\\s*$";
    tok("STAR");
    src[t.STAR] = "(<|>)?=?\\s*\\*";
    for (i = 0; i < R; i++) {
      debug(i, src[i]);
      if (!re[i]) {
        re[i] = new RegExp(src[i]);
        safeRe[i] = new RegExp(makeSafeRe(src[i]));
      }
    }
    var i;
    exports2.parse = parse2;
    function parse2(version, options) {
      if (!options || typeof options !== "object") {
        options = {
          loose: !!options,
          includePrerelease: false
        };
      }
      if (version instanceof SemVer) {
        return version;
      }
      if (typeof version !== "string") {
        return null;
      }
      if (version.length > MAX_LENGTH) {
        return null;
      }
      var r = options.loose ? safeRe[t.LOOSE] : safeRe[t.FULL];
      if (!r.test(version)) {
        return null;
      }
      try {
        return new SemVer(version, options);
      } catch (er) {
        return null;
      }
    }
    exports2.valid = valid;
    function valid(version, options) {
      var v = parse2(version, options);
      return v ? v.version : null;
    }
    exports2.clean = clean;
    function clean(version, options) {
      var s = parse2(version.trim().replace(/^[=v]+/, ""), options);
      return s ? s.version : null;
    }
    exports2.SemVer = SemVer;
    function SemVer(version, options) {
      if (!options || typeof options !== "object") {
        options = {
          loose: !!options,
          includePrerelease: false
        };
      }
      if (version instanceof SemVer) {
        if (version.loose === options.loose) {
          return version;
        } else {
          version = version.version;
        }
      } else if (typeof version !== "string") {
        throw new TypeError("Invalid Version: " + version);
      }
      if (version.length > MAX_LENGTH) {
        throw new TypeError("version is longer than " + MAX_LENGTH + " characters");
      }
      if (!(this instanceof SemVer)) {
        return new SemVer(version, options);
      }
      debug("SemVer", version, options);
      this.options = options;
      this.loose = !!options.loose;
      var m = version.trim().match(options.loose ? safeRe[t.LOOSE] : safeRe[t.FULL]);
      if (!m) {
        throw new TypeError("Invalid Version: " + version);
      }
      this.raw = version;
      this.major = +m[1];
      this.minor = +m[2];
      this.patch = +m[3];
      if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
        throw new TypeError("Invalid major version");
      }
      if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
        throw new TypeError("Invalid minor version");
      }
      if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
        throw new TypeError("Invalid patch version");
      }
      if (!m[4]) {
        this.prerelease = [];
      } else {
        this.prerelease = m[4].split(".").map(function(id) {
          if (/^[0-9]+$/.test(id)) {
            var num = +id;
            if (num >= 0 && num < MAX_SAFE_INTEGER) {
              return num;
            }
          }
          return id;
        });
      }
      this.build = m[5] ? m[5].split(".") : [];
      this.format();
    }
    SemVer.prototype.format = function() {
      this.version = this.major + "." + this.minor + "." + this.patch;
      if (this.prerelease.length) {
        this.version += "-" + this.prerelease.join(".");
      }
      return this.version;
    };
    SemVer.prototype.toString = function() {
      return this.version;
    };
    SemVer.prototype.compare = function(other) {
      debug("SemVer.compare", this.version, this.options, other);
      if (!(other instanceof SemVer)) {
        other = new SemVer(other, this.options);
      }
      return this.compareMain(other) || this.comparePre(other);
    };
    SemVer.prototype.compareMain = function(other) {
      if (!(other instanceof SemVer)) {
        other = new SemVer(other, this.options);
      }
      return compareIdentifiers(this.major, other.major) || compareIdentifiers(this.minor, other.minor) || compareIdentifiers(this.patch, other.patch);
    };
    SemVer.prototype.comparePre = function(other) {
      if (!(other instanceof SemVer)) {
        other = new SemVer(other, this.options);
      }
      if (this.prerelease.length && !other.prerelease.length) {
        return -1;
      } else if (!this.prerelease.length && other.prerelease.length) {
        return 1;
      } else if (!this.prerelease.length && !other.prerelease.length) {
        return 0;
      }
      var i2 = 0;
      do {
        var a = this.prerelease[i2];
        var b = other.prerelease[i2];
        debug("prerelease compare", i2, a, b);
        if (a === void 0 && b === void 0) {
          return 0;
        } else if (b === void 0) {
          return 1;
        } else if (a === void 0) {
          return -1;
        } else if (a === b) {
          continue;
        } else {
          return compareIdentifiers(a, b);
        }
      } while (++i2);
    };
    SemVer.prototype.compareBuild = function(other) {
      if (!(other instanceof SemVer)) {
        other = new SemVer(other, this.options);
      }
      var i2 = 0;
      do {
        var a = this.build[i2];
        var b = other.build[i2];
        debug("prerelease compare", i2, a, b);
        if (a === void 0 && b === void 0) {
          return 0;
        } else if (b === void 0) {
          return 1;
        } else if (a === void 0) {
          return -1;
        } else if (a === b) {
          continue;
        } else {
          return compareIdentifiers(a, b);
        }
      } while (++i2);
    };
    SemVer.prototype.inc = function(release, identifier) {
      switch (release) {
        case "premajor":
          this.prerelease.length = 0;
          this.patch = 0;
          this.minor = 0;
          this.major++;
          this.inc("pre", identifier);
          break;
        case "preminor":
          this.prerelease.length = 0;
          this.patch = 0;
          this.minor++;
          this.inc("pre", identifier);
          break;
        case "prepatch":
          this.prerelease.length = 0;
          this.inc("patch", identifier);
          this.inc("pre", identifier);
          break;
        // If the input is a non-prerelease version, this acts the same as
        // prepatch.
        case "prerelease":
          if (this.prerelease.length === 0) {
            this.inc("patch", identifier);
          }
          this.inc("pre", identifier);
          break;
        case "major":
          if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) {
            this.major++;
          }
          this.minor = 0;
          this.patch = 0;
          this.prerelease = [];
          break;
        case "minor":
          if (this.patch !== 0 || this.prerelease.length === 0) {
            this.minor++;
          }
          this.patch = 0;
          this.prerelease = [];
          break;
        case "patch":
          if (this.prerelease.length === 0) {
            this.patch++;
          }
          this.prerelease = [];
          break;
        // This probably shouldn't be used publicly.
        // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction.
        case "pre":
          if (this.prerelease.length === 0) {
            this.prerelease = [0];
          } else {
            var i2 = this.prerelease.length;
            while (--i2 >= 0) {
              if (typeof this.prerelease[i2] === "number") {
                this.prerelease[i2]++;
                i2 = -2;
              }
            }
            if (i2 === -1) {
              this.prerelease.push(0);
            }
          }
          if (identifier) {
            if (this.prerelease[0] === identifier) {
              if (isNaN(this.prerelease[1])) {
                this.prerelease = [identifier, 0];
              }
            } else {
              this.prerelease = [identifier, 0];
            }
          }
          break;
        default:
          throw new Error("invalid increment argument: " + release);
      }
      this.format();
      this.raw = this.version;
      return this;
    };
    exports2.inc = inc;
    function inc(version, release, loose, identifier) {
      if (typeof loose === "string") {
        identifier = loose;
        loose = void 0;
      }
      try {
        return new SemVer(version, loose).inc(release, identifier).version;
      } catch (er) {
        return null;
      }
    }
    exports2.diff = diff;
    function diff(version1, version2) {
      if (eq(version1, version2)) {
        return null;
      } else {
        var v1 = parse2(version1);
        var v2 = parse2(version2);
        var prefix = "";
        if (v1.prerelease.length || v2.prerelease.length) {
          prefix = "pre";
          var defaultResult = "prerelease";
        }
        for (var key in v1) {
          if (key === "major" || key === "minor" || key === "patch") {
            if (v1[key] !== v2[key]) {
              return prefix + key;
            }
          }
        }
        return defaultResult;
      }
    }
    exports2.compareIdentifiers = compareIdentifiers;
    var numeric = /^[0-9]+$/;
    function compareIdentifiers(a, b) {
      var anum = numeric.test(a);
      var bnum = numeric.test(b);
      if (anum && bnum) {
        a = +a;
        b = +b;
      }
      return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1;
    }
    exports2.rcompareIdentifiers = rcompareIdentifiers;
    function rcompareIdentifiers(a, b) {
      return compareIdentifiers(b, a);
    }
    exports2.major = major;
    function major(a, loose) {
      return new SemVer(a, loose).major;
    }
    exports2.minor = minor;
    function minor(a, loose) {
      return new SemVer(a, loose).minor;
    }
    exports2.patch = patch;
    function patch(a, loose) {
      return new SemVer(a, loose).patch;
    }
    exports2.compare = compare;
    function compare(a, b, loose) {
      return new SemVer(a, loose).compare(new SemVer(b, loose));
    }
    exports2.compareLoose = compareLoose;
    function compareLoose(a, b) {
      return compare(a, b, true);
    }
    exports2.compareBuild = compareBuild;
    function compareBuild(a, b, loose) {
      var versionA = new SemVer(a, loose);
      var versionB = new SemVer(b, loose);
      return versionA.compare(versionB) || versionA.compareBuild(versionB);
    }
    exports2.rcompare = rcompare;
    function rcompare(a, b, loose) {
      return compare(b, a, loose);
    }
    exports2.sort = sort;
    function sort(list, loose) {
      return list.sort(function(a, b) {
        return exports2.compareBuild(a, b, loose);
      });
    }
    exports2.rsort = rsort;
    function rsort(list, loose) {
      return list.sort(function(a, b) {
        return exports2.compareBuild(b, a, loose);
      });
    }
    exports2.gt = gt;
    function gt(a, b, loose) {
      return compare(a, b, loose) > 0;
    }
    exports2.lt = lt;
    function lt(a, b, loose) {
      return compare(a, b, loose) < 0;
    }
    exports2.eq = eq;
    function eq(a, b, loose) {
      return compare(a, b, loose) === 0;
    }
    exports2.neq = neq;
    function neq(a, b, loose) {
      return compare(a, b, loose) !== 0;
    }
    exports2.gte = gte;
    function gte(a, b, loose) {
      return compare(a, b, loose) >= 0;
    }
    exports2.lte = lte;
    function lte(a, b, loose) {
      return compare(a, b, loose) <= 0;
    }
    exports2.cmp = cmp;
    function cmp(a, op, b, loose) {
      switch (op) {
        case "===":
          if (typeof a === "object")
            a = a.version;
          if (typeof b === "object")
            b = b.version;
          return a === b;
        case "!==":
          if (typeof a === "object")
            a = a.version;
          if (typeof b === "object")
            b = b.version;
          return a !== b;
        case "":
        case "=":
        case "==":
          return eq(a, b, loose);
        case "!=":
          return neq(a, b, loose);
        case ">":
          return gt(a, b, loose);
        case ">=":
          return gte(a, b, loose);
        case "<":
          return lt(a, b, loose);
        case "<=":
          return lte(a, b, loose);
        default:
          throw new TypeError("Invalid operator: " + op);
      }
    }
    exports2.Comparator = Comparator;
    function Comparator(comp, options) {
      if (!options || typeof options !== "object") {
        options = {
          loose: !!options,
          includePrerelease: false
        };
      }
      if (comp instanceof Comparator) {
        if (comp.loose === !!options.loose) {
          return comp;
        } else {
          comp = comp.value;
        }
      }
      if (!(this instanceof Comparator)) {
        return new Comparator(comp, options);
      }
      comp = comp.trim().split(/\s+/).join(" ");
      debug("comparator", comp, options);
      this.options = options;
      this.loose = !!options.loose;
      this.parse(comp);
      if (this.semver === ANY) {
        this.value = "";
      } else {
        this.value = this.operator + this.semver.version;
      }
      debug("comp", this);
    }
    var ANY = {};
    Comparator.prototype.parse = function(comp) {
      var r = this.options.loose ? safeRe[t.COMPARATORLOOSE] : safeRe[t.COMPARATOR];
      var m = comp.match(r);
      if (!m) {
        throw new TypeError("Invalid comparator: " + comp);
      }
      this.operator = m[1] !== void 0 ? m[1] : "";
      if (this.operator === "=") {
        this.operator = "";
      }
      if (!m[2]) {
        this.semver = ANY;
      } else {
        this.semver = new SemVer(m[2], this.options.loose);
      }
    };
    Comparator.prototype.toString = function() {
      return this.value;
    };
    Comparator.prototype.test = function(version) {
      debug("Comparator.test", version, this.options.loose);
      if (this.semver === ANY || version === ANY) {
        return true;
      }
      if (typeof version === "string") {
        try {
          version = new SemVer(version, this.options);
        } catch (er) {
          return false;
        }
      }
      return cmp(version, this.operator, this.semver, this.options);
    };
    Comparator.prototype.intersects = function(comp, options) {
      if (!(comp instanceof Comparator)) {
        throw new TypeError("a Comparator is required");
      }
      if (!options || typeof options !== "object") {
        options = {
          loose: !!options,
          includePrerelease: false
        };
      }
      var rangeTmp;
      if (this.operator === "") {
        if (this.value === "") {
          return true;
        }
        rangeTmp = new Range(comp.value, options);
        return satisfies(this.value, rangeTmp, options);
      } else if (comp.operator === "") {
        if (comp.value === "") {
          return true;
        }
        rangeTmp = new Range(this.value, options);
        return satisfies(comp.semver, rangeTmp, options);
      }
      var sameDirectionIncreasing = (this.operator === ">=" || this.operator === ">") && (comp.operator === ">=" || comp.operator === ">");
      var sameDirectionDecreasing = (this.operator === "<=" || this.operator === "<") && (comp.operator === "<=" || comp.operator === "<");
      var sameSemVer = this.semver.version === comp.semver.version;
      var differentDirectionsInclusive = (this.operator === ">=" || this.operator === "<=") && (comp.operator === ">=" || comp.operator === "<=");
      var oppositeDirectionsLessThan = cmp(this.semver, "<", comp.semver, options) && ((this.operator === ">=" || this.operator === ">") && (comp.operator === "<=" || comp.operator === "<"));
      var oppositeDirectionsGreaterThan = cmp(this.semver, ">", comp.semver, options) && ((this.operator === "<=" || this.operator === "<") && (comp.operator === ">=" || comp.operator === ">"));
      return sameDirectionIncreasing || sameDirectionDecreasing || sameSemVer && differentDirectionsInclusive || oppositeDirectionsLessThan || oppositeDirectionsGreaterThan;
    };
    exports2.Range = Range;
    function Range(range, options) {
      if (!options || typeof options !== "object") {
        options = {
          loose: !!options,
          includePrerelease: false
        };
      }
      if (range instanceof Range) {
        if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) {
          return range;
        } else {
          return new Range(range.raw, options);
        }
      }
      if (range instanceof Comparator) {
        return new Range(range.value, options);
      }
      if (!(this instanceof Range)) {
        return new Range(range, options);
      }
      this.options = options;
      this.loose = !!options.loose;
      this.includePrerelease = !!options.includePrerelease;
      this.raw = range.trim().split(/\s+/).join(" ");
      this.set = this.raw.split("||").map(function(range2) {
        return this.parseRange(range2.trim());
      }, this).filter(function(c) {
        return c.length;
      });
      if (!this.set.length) {
        throw new TypeError("Invalid SemVer Range: " + this.raw);
      }
      this.format();
    }
    Range.prototype.format = function() {
      this.range = this.set.map(function(comps) {
        return comps.join(" ").trim();
      }).join("||").trim();
      return this.range;
    };
    Range.prototype.toString = function() {
      return this.range;
    };
    Range.prototype.parseRange = function(range) {
      var loose = this.options.loose;
      var hr = loose ? safeRe[t.HYPHENRANGELOOSE] : safeRe[t.HYPHENRANGE];
      range = range.replace(hr, hyphenReplace);
      debug("hyphen replace", range);
      range = range.replace(safeRe[t.COMPARATORTRIM], comparatorTrimReplace);
      debug("comparator trim", range, safeRe[t.COMPARATORTRIM]);
      range = range.replace(safeRe[t.TILDETRIM], tildeTrimReplace);
      range = range.replace(safeRe[t.CARETTRIM], caretTrimReplace);
      range = range.split(/\s+/).join(" ");
      var compRe = loose ? safeRe[t.COMPARATORLOOSE] : safeRe[t.COMPARATOR];
      var set = range.split(" ").map(function(comp) {
        return parseComparator(comp, this.options);
      }, this).join(" ").split(/\s+/);
      if (this.options.loose) {
        set = set.filter(function(comp) {
          return !!comp.match(compRe);
        });
      }
      set = set.map(function(comp) {
        return new Comparator(comp, this.options);
      }, this);
      return set;
    };
    Range.prototype.intersects = function(range, options) {
      if (!(range instanceof Range)) {
        throw new TypeError("a Range is required");
      }
      return this.set.some(function(thisComparators) {
        return isSatisfiable(thisComparators, options) && range.set.some(function(rangeComparators) {
          return isSatisfiable(rangeComparators, options) && thisComparators.every(function(thisComparator) {
            return rangeComparators.every(function(rangeComparator) {
              return thisComparator.intersects(rangeComparator, options);
            });
          });
        });
      });
    };
    function isSatisfiable(comparators, options) {
      var result = true;
      var remainingComparators = comparators.slice();
      var testComparator = remainingComparators.pop();
      while (result && remainingComparators.length) {
        result = remainingComparators.every(function(otherComparator) {
          return testComparator.intersects(otherComparator, options);
        });
        testComparator = remainingComparators.pop();
      }
      return result;
    }
    exports2.toComparators = toComparators;
    function toComparators(range, options) {
      return new Range(range, options).set.map(function(comp) {
        return comp.map(function(c) {
          return c.value;
        }).join(" ").trim().split(" ");
      });
    }
    function parseComparator(comp, options) {
      debug("comp", comp, options);
      comp = replaceCarets(comp, options);
      debug("caret", comp);
      comp = replaceTildes(comp, options);
      debug("tildes", comp);
      comp = replaceXRanges(comp, options);
      debug("xrange", comp);
      comp = replaceStars(comp, options);
      debug("stars", comp);
      return comp;
    }
    function isX(id) {
      return !id || id.toLowerCase() === "x" || id === "*";
    }
    function replaceTildes(comp, options) {
      return comp.trim().split(/\s+/).map(function(comp2) {
        return replaceTilde(comp2, options);
      }).join(" ");
    }
    function replaceTilde(comp, options) {
      var r = options.loose ? safeRe[t.TILDELOOSE] : safeRe[t.TILDE];
      return comp.replace(r, function(_, M, m, p, pr) {
        debug("tilde", comp, _, M, m, p, pr);
        var ret;
        if (isX(M)) {
          ret = "";
        } else if (isX(m)) {
          ret = ">=" + M + ".0.0 <" + (+M + 1) + ".0.0";
        } else if (isX(p)) {
          ret = ">=" + M + "." + m + ".0 <" + M + "." + (+m + 1) + ".0";
        } else if (pr) {
          debug("replaceTilde pr", pr);
          ret = ">=" + M + "." + m + "." + p + "-" + pr + " <" + M + "." + (+m + 1) + ".0";
        } else {
          ret = ">=" + M + "." + m + "." + p + " <" + M + "." + (+m + 1) + ".0";
        }
        debug("tilde return", ret);
        return ret;
      });
    }
    function replaceCarets(comp, options) {
      return comp.trim().split(/\s+/).map(function(comp2) {
        return replaceCaret(comp2, options);
      }).join(" ");
    }
    function replaceCaret(comp, options) {
      debug("caret", comp, options);
      var r = options.loose ? safeRe[t.CARETLOOSE] : safeRe[t.CARET];
      return comp.replace(r, function(_, M, m, p, pr) {
        debug("caret", comp, _, M, m, p, pr);
        var ret;
        if (isX(M)) {
          ret = "";
        } else if (isX(m)) {
          ret = ">=" + M + ".0.0 <" + (+M + 1) + ".0.0";
        } else if (isX(p)) {
          if (M === "0") {
            ret = ">=" + M + "." + m + ".0 <" + M + "." + (+m + 1) + ".0";
          } else {
            ret = ">=" + M + "." + m + ".0 <" + (+M + 1) + ".0.0";
          }
        } else if (pr) {
          debug("replaceCaret pr", pr);
          if (M === "0") {
            if (m === "0") {
              ret = ">=" + M + "." + m + "." + p + "-" + pr + " <" + M + "." + m + "." + (+p + 1);
            } else {
              ret = ">=" + M + "." + m + "." + p + "-" + pr + " <" + M + "." + (+m + 1) + ".0";
            }
          } else {
            ret = ">=" + M + "." + m + "." + p + "-" + pr + " <" + (+M + 1) + ".0.0";
          }
        } else {
          debug("no pr");
          if (M === "0") {
            if (m === "0") {
              ret = ">=" + M + "." + m + "." + p + " <" + M + "." + m + "." + (+p + 1);
            } else {
              ret = ">=" + M + "." + m + "." + p + " <" + M + "." + (+m + 1) + ".0";
            }
          } else {
            ret = ">=" + M + "." + m + "." + p + " <" + (+M + 1) + ".0.0";
          }
        }
        debug("caret return", ret);
        return ret;
      });
    }
    function replaceXRanges(comp, options) {
      debug("replaceXRanges", comp, options);
      return comp.split(/\s+/).map(function(comp2) {
        return replaceXRange(comp2, options);
      }).join(" ");
    }
    function replaceXRange(comp, options) {
      comp = comp.trim();
      var r = options.loose ? safeRe[t.XRANGELOOSE] : safeRe[t.XRANGE];
      return comp.replace(r, function(ret, gtlt, M, m, p, pr) {
        debug("xRange", comp, ret, gtlt, M, m, p, pr);
        var xM = isX(M);
        var xm = xM || isX(m);
        var xp = xm || isX(p);
        var anyX = xp;
        if (gtlt === "=" && anyX) {
          gtlt = "";
        }
        pr = options.includePrerelease ? "-0" : "";
        if (xM) {
          if (gtlt === ">" || gtlt === "<") {
            ret = "<0.0.0-0";
          } else {
            ret = "*";
          }
        } else if (gtlt && anyX) {
          if (xm) {
            m = 0;
          }
          p = 0;
          if (gtlt === ">") {
            gtlt = ">=";
            if (xm) {
              M = +M + 1;
              m = 0;
              p = 0;
            } else {
              m = +m + 1;
              p = 0;
            }
          } else if (gtlt === "<=") {
            gtlt = "<";
            if (xm) {
              M = +M + 1;
            } else {
              m = +m + 1;
            }
          }
          ret = gtlt + M + "." + m + "." + p + pr;
        } else if (xm) {
          ret = ">=" + M + ".0.0" + pr + " <" + (+M + 1) + ".0.0" + pr;
        } else if (xp) {
          ret = ">=" + M + "." + m + ".0" + pr + " <" + M + "." + (+m + 1) + ".0" + pr;
        }
        debug("xRange return", ret);
        return ret;
      });
    }
    function replaceStars(comp, options) {
      debug("replaceStars", comp, options);
      return comp.trim().replace(safeRe[t.STAR], "");
    }
    function hyphenReplace($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr, tb) {
      if (isX(fM)) {
        from = "";
      } else if (isX(fm)) {
        from = ">=" + fM + ".0.0";
      } else if (isX(fp)) {
        from = ">=" + fM + "." + fm + ".0";
      } else {
        from = ">=" + from;
      }
      if (isX(tM)) {
        to = "";
      } else if (isX(tm)) {
        to = "<" + (+tM + 1) + ".0.0";
      } else if (isX(tp)) {
        to = "<" + tM + "." + (+tm + 1) + ".0";
      } else if (tpr) {
        to = "<=" + tM + "." + tm + "." + tp + "-" + tpr;
      } else {
        to = "<=" + to;
      }
      return (from + " " + to).trim();
    }
    Range.prototype.test = function(version) {
      if (!version) {
        return false;
      }
      if (typeof version === "string") {
        try {
          version = new SemVer(version, this.options);
        } catch (er) {
          return false;
        }
      }
      for (var i2 = 0; i2 < this.set.length; i2++) {
        if (testSet(this.set[i2], version, this.options)) {
          return true;
        }
      }
      return false;
    };
    function testSet(set, version, options) {
      for (var i2 = 0; i2 < set.length; i2++) {
        if (!set[i2].test(version)) {
          return false;
        }
      }
      if (version.prerelease.length && !options.includePrerelease) {
        for (i2 = 0; i2 < set.length; i2++) {
          debug(set[i2].semver);
          if (set[i2].semver === ANY) {
            continue;
          }
          if (set[i2].semver.prerelease.length > 0) {
            var allowed = set[i2].semver;
            if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) {
              return true;
            }
          }
        }
        return false;
      }
      return true;
    }
    exports2.satisfies = satisfies;
    function satisfies(version, range, options) {
      try {
        range = new Range(range, options);
      } catch (er) {
        return false;
      }
      return range.test(version);
    }
    exports2.maxSatisfying = maxSatisfying;
    function maxSatisfying(versions, range, options) {
      var max = null;
      var maxSV = null;
      try {
        var rangeObj = new Range(range, options);
      } catch (er) {
        return null;
      }
      versions.forEach(function(v) {
        if (rangeObj.test(v)) {
          if (!max || maxSV.compare(v) === -1) {
            max = v;
            maxSV = new SemVer(max, options);
          }
        }
      });
      return max;
    }
    exports2.minSatisfying = minSatisfying;
    function minSatisfying(versions, range, options) {
      var min = null;
      var minSV = null;
      try {
        var rangeObj = new Range(range, options);
      } catch (er) {
        return null;
      }
      versions.forEach(function(v) {
        if (rangeObj.test(v)) {
          if (!min || minSV.compare(v) === 1) {
            min = v;
            minSV = new SemVer(min, options);
          }
        }
      });
      return min;
    }
    exports2.minVersion = minVersion;
    function minVersion(range, loose) {
      range = new Range(range, loose);
      var minver = new SemVer("0.0.0");
      if (range.test(minver)) {
        return minver;
      }
      minver = new SemVer("0.0.0-0");
      if (range.test(minver)) {
        return minver;
      }
      minver = null;
      for (var i2 = 0; i2 < range.set.length; ++i2) {
        var comparators = range.set[i2];
        comparators.forEach(function(comparator) {
          var compver = new SemVer(comparator.semver.version);
          switch (comparator.operator) {
            case ">":
              if (compver.prerelease.length === 0) {
                compver.patch++;
              } else {
                compver.prerelease.push(0);
              }
              compver.raw = compver.format();
            /* fallthrough */
            case "":
            case ">=":
              if (!minver || gt(minver, compver)) {
                minver = compver;
              }
              break;
            case "<":
            case "<=":
              break;
            /* istanbul ignore next */
            default:
              throw new Error("Unexpected operation: " + comparator.operator);
          }
        });
      }
      if (minver && range.test(minver)) {
        return minver;
      }
      return null;
    }
    exports2.validRange = validRange;
    function validRange(range, options) {
      try {
        return new Range(range, options).range || "*";
      } catch (er) {
        return null;
      }
    }
    exports2.ltr = ltr;
    function ltr(version, range, options) {
      return outside(version, range, "<", options);
    }
    exports2.gtr = gtr;
    function gtr(version, range, options) {
      return outside(version, range, ">", options);
    }
    exports2.outside = outside;
    function outside(version, range, hilo, options) {
      version = new SemVer(version, options);
      range = new Range(range, options);
      var gtfn, ltefn, ltfn, comp, ecomp;
      switch (hilo) {
        case ">":
          gtfn = gt;
          ltefn = lte;
          ltfn = lt;
          comp = ">";
          ecomp = ">=";
          break;
        case "<":
          gtfn = lt;
          ltefn = gte;
          ltfn = gt;
          comp = "<";
          ecomp = "<=";
          break;
        default:
          throw new TypeError('Must provide a hilo val of "<" or ">"');
      }
      if (satisfies(version, range, options)) {
        return false;
      }
      for (var i2 = 0; i2 < range.set.length; ++i2) {
        var comparators = range.set[i2];
        var high = null;
        var low = null;
        comparators.forEach(function(comparator) {
          if (comparator.semver === ANY) {
            comparator = new Comparator(">=0.0.0");
          }
          high = high || comparator;
          low = low || comparator;
          if (gtfn(comparator.semver, high.semver, options)) {
            high = comparator;
          } else if (ltfn(comparator.semver, low.semver, options)) {
            low = comparator;
          }
        });
        if (high.operator === comp || high.operator === ecomp) {
          return false;
        }
        if ((!low.operator || low.operator === comp) && ltefn(version, low.semver)) {
          return false;
        } else if (low.operator === ecomp && ltfn(version, low.semver)) {
          return false;
        }
      }
      return true;
    }
    exports2.prerelease = prerelease;
    function prerelease(version, options) {
      var parsed = parse2(version, options);
      return parsed && parsed.prerelease.length ? parsed.prerelease : null;
    }
    exports2.intersects = intersects;
    function intersects(r1, r2, options) {
      r1 = new Range(r1, options);
      r2 = new Range(r2, options);
      return r1.intersects(r2);
    }
    exports2.coerce = coerce;
    function coerce(version, options) {
      if (version instanceof SemVer) {
        return version;
      }
      if (typeof version === "number") {
        version = String(version);
      }
      if (typeof version !== "string") {
        return null;
      }
      options = options || {};
      var match = null;
      if (!options.rtl) {
        match = version.match(safeRe[t.COERCE]);
      } else {
        var next;
        while ((next = safeRe[t.COERCERTL].exec(version)) && (!match || match.index + match[0].length !== version.length)) {
          if (!match || next.index + next[0].length !== match.index + match[0].length) {
            match = next;
          }
          safeRe[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length;
        }
        safeRe[t.COERCERTL].lastIndex = -1;
      }
      if (match === null) {
        return null;
      }
      return parse2(match[2] + "." + (match[3] || "0") + "." + (match[4] || "0"), options);
    }
  }
});

// node_modules/@babel/helper-compilation-targets/lib/targets.js
var require_targets = __commonJS({
  "node_modules/@babel/helper-compilation-targets/lib/targets.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.unreleasedLabels = exports2.browserNameMap = void 0;
    var unreleasedLabels = exports2.unreleasedLabels = {
      safari: "tp"
    };
    var browserNameMap = exports2.browserNameMap = {
      and_chr: "chrome",
      and_ff: "firefox",
      android: "android",
      chrome: "chrome",
      edge: "edge",
      firefox: "firefox",
      ie: "ie",
      ie_mob: "ie",
      ios_saf: "ios",
      node: "node",
      deno: "deno",
      op_mob: "opera_mobile",
      opera: "opera",
      safari: "safari",
      samsung: "samsung"
    };
  }
});

// node_modules/@babel/helper-compilation-targets/lib/utils.js
var require_utils3 = __commonJS({
  "node_modules/@babel/helper-compilation-targets/lib/utils.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.getHighestUnreleased = getHighestUnreleased;
    exports2.getLowestImplementedVersion = getLowestImplementedVersion;
    exports2.getLowestUnreleased = getLowestUnreleased;
    exports2.isUnreleasedVersion = isUnreleasedVersion;
    exports2.semverMin = semverMin;
    exports2.semverify = semverify;
    var _semver = require_semver2();
    var _helperValidatorOption = require_lib13();
    var _targets = require_targets();
    var versionRegExp = /^(?:\d+|\d(?:\d?[^\d\n\r\u2028\u2029]\d+|\d{2,}(?:[^\d\n\r\u2028\u2029]\d+)?))$/;
    var v = new _helperValidatorOption.OptionValidator("@babel/helper-compilation-targets");
    function semverMin(first, second) {
      return first && _semver.lt(first, second) ? first : second;
    }
    function semverify(version) {
      if (typeof version === "string" && _semver.valid(version)) {
        return version;
      }
      v.invariant(typeof version === "number" || typeof version === "string" && versionRegExp.test(version), `'${version}' is not a valid version`);
      version = version.toString();
      let pos = 0;
      let num = 0;
      while ((pos = version.indexOf(".", pos + 1)) > 0) {
        num++;
      }
      return version + ".0".repeat(2 - num);
    }
    function isUnreleasedVersion(version, env) {
      const unreleasedLabel = _targets.unreleasedLabels[env];
      return !!unreleasedLabel && unreleasedLabel === version.toString().toLowerCase();
    }
    function getLowestUnreleased(a, b, env) {
      const unreleasedLabel = _targets.unreleasedLabels[env];
      if (a === unreleasedLabel) {
        return b;
      }
      if (b === unreleasedLabel) {
        return a;
      }
      return semverMin(a, b);
    }
    function getHighestUnreleased(a, b, env) {
      return getLowestUnreleased(a, b, env) === a ? b : a;
    }
    function getLowestImplementedVersion(plugin, environment) {
      const result = plugin[environment];
      if (!result && environment === "android") {
        return plugin.chrome;
      }
      return result;
    }
  }
});

// node_modules/@babel/helper-compilation-targets/lib/options.js
var require_options2 = __commonJS({
  "node_modules/@babel/helper-compilation-targets/lib/options.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.TargetNames = void 0;
    var TargetNames = exports2.TargetNames = {
      node: "node",
      deno: "deno",
      chrome: "chrome",
      opera: "opera",
      edge: "edge",
      firefox: "firefox",
      safari: "safari",
      ie: "ie",
      ios: "ios",
      android: "android",
      electron: "electron",
      samsung: "samsung",
      rhino: "rhino",
      opera_mobile: "opera_mobile"
    };
  }
});

// node_modules/@babel/helper-compilation-targets/lib/pretty.js
var require_pretty = __commonJS({
  "node_modules/@babel/helper-compilation-targets/lib/pretty.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.prettifyTargets = prettifyTargets;
    exports2.prettifyVersion = prettifyVersion;
    var _semver = require_semver2();
    var _targets = require_targets();
    function prettifyVersion(version) {
      if (typeof version !== "string") {
        return version;
      }
      const {
        major,
        minor,
        patch
      } = _semver.parse(version);
      const parts = [major];
      if (minor || patch) {
        parts.push(minor);
      }
      if (patch) {
        parts.push(patch);
      }
      return parts.join(".");
    }
    function prettifyTargets(targets) {
      return Object.keys(targets).reduce((results, target) => {
        let value2 = targets[target];
        const unreleasedLabel = _targets.unreleasedLabels[target];
        if (typeof value2 === "string" && unreleasedLabel !== value2) {
          value2 = prettifyVersion(value2);
        }
        results[target] = value2;
        return results;
      }, {});
    }
  }
});

// node_modules/@babel/helper-compilation-targets/lib/debug.js
var require_debug = __commonJS({
  "node_modules/@babel/helper-compilation-targets/lib/debug.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.getInclusionReasons = getInclusionReasons;
    var _semver = require_semver2();
    var _pretty = require_pretty();
    var _utils = require_utils3();
    function getInclusionReasons(item, targetVersions, list) {
      const minVersions = list[item] || {};
      return Object.keys(targetVersions).reduce((result, env) => {
        const minVersion = (0, _utils.getLowestImplementedVersion)(minVersions, env);
        const targetVersion = targetVersions[env];
        if (!minVersion) {
          result[env] = (0, _pretty.prettifyVersion)(targetVersion);
        } else {
          const minIsUnreleased = (0, _utils.isUnreleasedVersion)(minVersion, env);
          const targetIsUnreleased = (0, _utils.isUnreleasedVersion)(targetVersion, env);
          if (!targetIsUnreleased && (minIsUnreleased || _semver.lt(targetVersion.toString(), (0, _utils.semverify)(minVersion)))) {
            result[env] = (0, _pretty.prettifyVersion)(targetVersion);
          }
        }
        return result;
      }, {});
    }
  }
});

// node_modules/@babel/compat-data/data/plugins.json
var require_plugins = __commonJS({
  "node_modules/@babel/compat-data/data/plugins.json"(exports2, module2) {
    module2.exports = {
      "transform-explicit-resource-management": {
        chrome: "134",
        edge: "134",
        node: "24",
        electron: "35.0"
      },
      "transform-duplicate-named-capturing-groups-regex": {
        chrome: "126",
        opera: "112",
        edge: "126",
        firefox: "129",
        safari: "17.4",
        node: "23",
        ios: "17.4",
        electron: "31.0"
      },
      "transform-regexp-modifiers": {
        chrome: "125",
        opera: "111",
        edge: "125",
        firefox: "132",
        node: "23",
        samsung: "27",
        electron: "31.0"
      },
      "transform-unicode-sets-regex": {
        chrome: "112",
        opera: "98",
        edge: "112",
        firefox: "116",
        safari: "17",
        node: "20",
        deno: "1.32",
        ios: "17",
        samsung: "23",
        opera_mobile: "75",
        electron: "24.0"
      },
      "bugfix/transform-v8-static-class-fields-redefine-readonly": {
        chrome: "98",
        opera: "84",
        edge: "98",
        firefox: "75",
        safari: "15",
        node: "12",
        deno: "1.18",
        ios: "15",
        samsung: "11",
        opera_mobile: "52",
        electron: "17.0"
      },
      "bugfix/transform-firefox-class-in-computed-class-key": {
        chrome: "74",
        opera: "62",
        edge: "79",
        firefox: "126",
        safari: "16",
        node: "12",
        deno: "1",
        ios: "16",
        samsung: "11",
        opera_mobile: "53",
        electron: "6.0"
      },
      "bugfix/transform-safari-class-field-initializer-scope": {
        chrome: "74",
        opera: "62",
        edge: "79",
        firefox: "69",
        safari: "16",
        node: "12",
        deno: "1",
        ios: "16",
        samsung: "11",
        opera_mobile: "53",
        electron: "6.0"
      },
      "transform-class-static-block": {
        chrome: "94",
        opera: "80",
        edge: "94",
        firefox: "93",
        safari: "16.4",
        node: "16.11",
        deno: "1.14",
        ios: "16.4",
        samsung: "17",
        opera_mobile: "66",
        electron: "15.0"
      },
      "proposal-class-static-block": {
        chrome: "94",
        opera: "80",
        edge: "94",
        firefox: "93",
        safari: "16.4",
        node: "16.11",
        deno: "1.14",
        ios: "16.4",
        samsung: "17",
        opera_mobile: "66",
        electron: "15.0"
      },
      "transform-private-property-in-object": {
        chrome: "91",
        opera: "77",
        edge: "91",
        firefox: "90",
        safari: "15",
        node: "16.9",
        deno: "1.9",
        ios: "15",
        samsung: "16",
        opera_mobile: "64",
        electron: "13.0"
      },
      "proposal-private-property-in-object": {
        chrome: "91",
        opera: "77",
        edge: "91",
        firefox: "90",
        safari: "15",
        node: "16.9",
        deno: "1.9",
        ios: "15",
        samsung: "16",
        opera_mobile: "64",
        electron: "13.0"
      },
      "transform-class-properties": {
        chrome: "74",
        opera: "62",
        edge: "79",
        firefox: "90",
        safari: "14.1",
        node: "12",
        deno: "1",
        ios: "14.5",
        samsung: "11",
        opera_mobile: "53",
        electron: "6.0"
      },
      "proposal-class-properties": {
        chrome: "74",
        opera: "62",
        edge: "79",
        firefox: "90",
        safari: "14.1",
        node: "12",
        deno: "1",
        ios: "14.5",
        samsung: "11",
        opera_mobile: "53",
        electron: "6.0"
      },
      "transform-private-methods": {
        chrome: "84",
        opera: "70",
        edge: "84",
        firefox: "90",
        safari: "15",
        node: "14.6",
        deno: "1",
        ios: "15",
        samsung: "14",
        opera_mobile: "60",
        electron: "10.0"
      },
      "proposal-private-methods": {
        chrome: "84",
        opera: "70",
        edge: "84",
        firefox: "90",
        safari: "15",
        node: "14.6",
        deno: "1",
        ios: "15",
        samsung: "14",
        opera_mobile: "60",
        electron: "10.0"
      },
      "transform-numeric-separator": {
        chrome: "75",
        opera: "62",
        edge: "79",
        firefox: "70",
        safari: "13",
        node: "12.5",
        deno: "1",
        ios: "13",
        samsung: "11",
        rhino: "1.7.14",
        opera_mobile: "54",
        electron: "6.0"
      },
      "proposal-numeric-separator": {
        chrome: "75",
        opera: "62",
        edge: "79",
        firefox: "70",
        safari: "13",
        node: "12.5",
        deno: "1",
        ios: "13",
        samsung: "11",
        rhino: "1.7.14",
        opera_mobile: "54",
        electron: "6.0"
      },
      "transform-logical-assignment-operators": {
        chrome: "85",
        opera: "71",
        edge: "85",
        firefox: "79",
        safari: "14",
        node: "15",
        deno: "1.2",
        ios: "14",
        samsung: "14",
        opera_mobile: "60",
        electron: "10.0"
      },
      "proposal-logical-assignment-operators": {
        chrome: "85",
        opera: "71",
        edge: "85",
        firefox: "79",
        safari: "14",
        node: "15",
        deno: "1.2",
        ios: "14",
        samsung: "14",
        opera_mobile: "60",
        electron: "10.0"
      },
      "transform-nullish-coalescing-operator": {
        chrome: "80",
        opera: "67",
        edge: "80",
        firefox: "72",
        safari: "13.1",
        node: "14",
        deno: "1",
        ios: "13.4",
        samsung: "13",
        rhino: "1.8",
        opera_mobile: "57",
        electron: "8.0"
      },
      "proposal-nullish-coalescing-operator": {
        chrome: "80",
        opera: "67",
        edge: "80",
        firefox: "72",
        safari: "13.1",
        node: "14",
        deno: "1",
        ios: "13.4",
        samsung: "13",
        rhino: "1.8",
        opera_mobile: "57",
        electron: "8.0"
      },
      "transform-optional-chaining": {
        chrome: "91",
        opera: "77",
        edge: "91",
        firefox: "74",
        safari: "13.1",
        node: "16.9",
        deno: "1.9",
        ios: "13.4",
        samsung: "16",
        opera_mobile: "64",
        electron: "13.0"
      },
      "proposal-optional-chaining": {
        chrome: "91",
        opera: "77",
        edge: "91",
        firefox: "74",
        safari: "13.1",
        node: "16.9",
        deno: "1.9",
        ios: "13.4",
        samsung: "16",
        opera_mobile: "64",
        electron: "13.0"
      },
      "transform-json-strings": {
        chrome: "66",
        opera: "53",
        edge: "79",
        firefox: "62",
        safari: "12",
        node: "10",
        deno: "1",
        ios: "12",
        samsung: "9",
        rhino: "1.7.14",
        opera_mobile: "47",
        electron: "3.0"
      },
      "proposal-json-strings": {
        chrome: "66",
        opera: "53",
        edge: "79",
        firefox: "62",
        safari: "12",
        node: "10",
        deno: "1",
        ios: "12",
        samsung: "9",
        rhino: "1.7.14",
        opera_mobile: "47",
        electron: "3.0"
      },
      "transform-optional-catch-binding": {
        chrome: "66",
        opera: "53",
        edge: "79",
        firefox: "58",
        safari: "11.1",
        node: "10",
        deno: "1",
        ios: "11.3",
        samsung: "9",
        opera_mobile: "47",
        electron: "3.0"
      },
      "proposal-optional-catch-binding": {
        chrome: "66",
        opera: "53",
        edge: "79",
        firefox: "58",
        safari: "11.1",
        node: "10",
        deno: "1",
        ios: "11.3",
        samsung: "9",
        opera_mobile: "47",
        electron: "3.0"
      },
      "transform-parameters": {
        chrome: "49",
        opera: "36",
        edge: "18",
        firefox: "52",
        safari: "16.3",
        node: "6",
        deno: "1",
        ios: "16.3",
        samsung: "5",
        opera_mobile: "36",
        electron: "0.37"
      },
      "transform-async-generator-functions": {
        chrome: "63",
        opera: "50",
        edge: "79",
        firefox: "57",
        safari: "12",
        node: "10",
        deno: "1",
        ios: "12",
        samsung: "8",
        opera_mobile: "46",
        electron: "3.0"
      },
      "proposal-async-generator-functions": {
        chrome: "63",
        opera: "50",
        edge: "79",
        firefox: "57",
        safari: "12",
        node: "10",
        deno: "1",
        ios: "12",
        samsung: "8",
        opera_mobile: "46",
        electron: "3.0"
      },
      "transform-object-rest-spread": {
        chrome: "60",
        opera: "47",
        edge: "79",
        firefox: "55",
        safari: "11.1",
        node: "8.3",
        deno: "1",
        ios: "11.3",
        samsung: "8",
        opera_mobile: "44",
        electron: "2.0"
      },
      "proposal-object-rest-spread": {
        chrome: "60",
        opera: "47",
        edge: "79",
        firefox: "55",
        safari: "11.1",
        node: "8.3",
        deno: "1",
        ios: "11.3",
        samsung: "8",
        opera_mobile: "44",
        electron: "2.0"
      },
      "transform-dotall-regex": {
        chrome: "62",
        opera: "49",
        edge: "79",
        firefox: "78",
        safari: "11.1",
        node: "8.10",
        deno: "1",
        ios: "11.3",
        samsung: "8",
        rhino: "1.7.15",
        opera_mobile: "46",
        electron: "3.0"
      },
      "transform-unicode-property-regex": {
        chrome: "64",
        opera: "51",
        edge: "79",
        firefox: "78",
        safari: "11.1",
        node: "10",
        deno: "1",
        ios: "11.3",
        samsung: "9",
        opera_mobile: "47",
        electron: "3.0"
      },
      "proposal-unicode-property-regex": {
        chrome: "64",
        opera: "51",
        edge: "79",
        firefox: "78",
        safari: "11.1",
        node: "10",
        deno: "1",
        ios: "11.3",
        samsung: "9",
        opera_mobile: "47",
        electron: "3.0"
      },
      "transform-named-capturing-groups-regex": {
        chrome: "64",
        opera: "51",
        edge: "79",
        firefox: "78",
        safari: "11.1",
        node: "10",
        deno: "1",
        ios: "11.3",
        samsung: "9",
        opera_mobile: "47",
        electron: "3.0"
      },
      "transform-async-to-generator": {
        chrome: "55",
        opera: "42",
        edge: "15",
        firefox: "52",
        safari: "11",
        node: "7.6",
        deno: "1",
        ios: "11",
        samsung: "6",
        opera_mobile: "42",
        electron: "1.6"
      },
      "transform-exponentiation-operator": {
        chrome: "52",
        opera: "39",
        edge: "14",
        firefox: "52",
        safari: "10.1",
        node: "7",
        deno: "1",
        ios: "10.3",
        samsung: "6",
        rhino: "1.7.14",
        opera_mobile: "41",
        electron: "1.3"
      },
      "transform-template-literals": {
        chrome: "41",
        opera: "28",
        edge: "13",
        firefox: "34",
        safari: "13",
        node: "4",
        deno: "1",
        ios: "13",
        samsung: "3.4",
        opera_mobile: "28",
        electron: "0.21"
      },
      "transform-literals": {
        chrome: "44",
        opera: "31",
        edge: "12",
        firefox: "53",
        safari: "9",
        node: "4",
        deno: "1",
        ios: "9",
        samsung: "4",
        rhino: "1.7.15",
        opera_mobile: "32",
        electron: "0.30"
      },
      "transform-function-name": {
        chrome: "51",
        opera: "38",
        edge: "79",
        firefox: "53",
        safari: "10",
        node: "6.5",
        deno: "1",
        ios: "10",
        samsung: "5",
        opera_mobile: "41",
        electron: "1.2"
      },
      "transform-arrow-functions": {
        chrome: "47",
        opera: "34",
        edge: "13",
        firefox: "43",
        safari: "10",
        node: "6",
        deno: "1",
        ios: "10",
        samsung: "5",
        rhino: "1.7.13",
        opera_mobile: "34",
        electron: "0.36"
      },
      "transform-block-scoped-functions": {
        chrome: "41",
        opera: "28",
        edge: "12",
        firefox: "46",
        safari: "10",
        node: "4",
        deno: "1",
        ie: "11",
        ios: "10",
        samsung: "3.4",
        opera_mobile: "28",
        electron: "0.21"
      },
      "transform-classes": {
        chrome: "46",
        opera: "33",
        edge: "13",
        firefox: "45",
        safari: "10",
        node: "5",
        deno: "1",
        ios: "10",
        samsung: "5",
        opera_mobile: "33",
        electron: "0.36"
      },
      "transform-object-super": {
        chrome: "46",
        opera: "33",
        edge: "13",
        firefox: "45",
        safari: "10",
        node: "5",
        deno: "1",
        ios: "10",
        samsung: "5",
        opera_mobile: "33",
        electron: "0.36"
      },
      "transform-shorthand-properties": {
        chrome: "43",
        opera: "30",
        edge: "12",
        firefox: "33",
        safari: "9",
        node: "4",
        deno: "1",
        ios: "9",
        samsung: "4",
        rhino: "1.7.14",
        opera_mobile: "30",
        electron: "0.27"
      },
      "transform-duplicate-keys": {
        chrome: "42",
        opera: "29",
        edge: "12",
        firefox: "34",
        safari: "9",
        node: "4",
        deno: "1",
        ios: "9",
        samsung: "3.4",
        opera_mobile: "29",
        electron: "0.25"
      },
      "transform-computed-properties": {
        chrome: "44",
        opera: "31",
        edge: "12",
        firefox: "34",
        safari: "7.1",
        node: "4",
        deno: "1",
        ios: "8",
        samsung: "4",
        rhino: "1.8",
        opera_mobile: "32",
        electron: "0.30"
      },
      "transform-for-of": {
        chrome: "51",
        opera: "38",
        edge: "15",
        firefox: "53",
        safari: "10",
        node: "6.5",
        deno: "1",
        ios: "10",
        samsung: "5",
        opera_mobile: "41",
        electron: "1.2"
      },
      "transform-sticky-regex": {
        chrome: "49",
        opera: "36",
        edge: "13",
        firefox: "3",
        safari: "10",
        node: "6",
        deno: "1",
        ios: "10",
        samsung: "5",
        rhino: "1.7.15",
        opera_mobile: "36",
        electron: "0.37"
      },
      "transform-unicode-escapes": {
        chrome: "44",
        opera: "31",
        edge: "12",
        firefox: "53",
        safari: "9",
        node: "4",
        deno: "1",
        ios: "9",
        samsung: "4",
        rhino: "1.7.15",
        opera_mobile: "32",
        electron: "0.30"
      },
      "transform-unicode-regex": {
        chrome: "50",
        opera: "37",
        edge: "13",
        firefox: "46",
        safari: "12",
        node: "6",
        deno: "1",
        ios: "12",
        samsung: "5",
        opera_mobile: "37",
        electron: "1.1"
      },
      "transform-spread": {
        chrome: "46",
        opera: "33",
        edge: "13",
        firefox: "45",
        safari: "10",
        node: "5",
        deno: "1",
        ios: "10",
        samsung: "5",
        opera_mobile: "33",
        electron: "0.36"
      },
      "transform-destructuring": {
        chrome: "51",
        opera: "38",
        edge: "15",
        firefox: "53",
        safari: "10",
        node: "6.5",
        deno: "1",
        ios: "10",
        samsung: "5",
        opera_mobile: "41",
        electron: "1.2"
      },
      "transform-block-scoping": {
        chrome: "50",
        opera: "37",
        edge: "14",
        firefox: "53",
        safari: "11",
        node: "6",
        deno: "1",
        ios: "11",
        samsung: "5",
        opera_mobile: "37",
        electron: "1.1"
      },
      "transform-typeof-symbol": {
        chrome: "48",
        opera: "35",
        edge: "12",
        firefox: "36",
        safari: "9",
        node: "6",
        deno: "1",
        ios: "9",
        samsung: "5",
        rhino: "1.8",
        opera_mobile: "35",
        electron: "0.37"
      },
      "transform-new-target": {
        chrome: "46",
        opera: "33",
        edge: "14",
        firefox: "41",
        safari: "10",
        node: "5",
        deno: "1",
        ios: "10",
        samsung: "5",
        opera_mobile: "33",
        electron: "0.36"
      },
      "transform-regenerator": {
        chrome: "50",
        opera: "37",
        edge: "13",
        firefox: "53",
        safari: "10",
        node: "6",
        deno: "1",
        ios: "10",
        samsung: "5",
        opera_mobile: "37",
        electron: "1.1"
      },
      "transform-member-expression-literals": {
        chrome: "7",
        opera: "12",
        edge: "12",
        firefox: "2",
        safari: "5.1",
        node: "0.4",
        deno: "1",
        ie: "9",
        android: "4",
        ios: "6",
        phantom: "1.9",
        samsung: "1",
        rhino: "1.7.13",
        opera_mobile: "12",
        electron: "0.20"
      },
      "transform-property-literals": {
        chrome: "7",
        opera: "12",
        edge: "12",
        firefox: "2",
        safari: "5.1",
        node: "0.4",
        deno: "1",
        ie: "9",
        android: "4",
        ios: "6",
        phantom: "1.9",
        samsung: "1",
        rhino: "1.7.13",
        opera_mobile: "12",
        electron: "0.20"
      },
      "transform-reserved-words": {
        chrome: "13",
        opera: "10.50",
        edge: "12",
        firefox: "2",
        safari: "3.1",
        node: "0.6",
        deno: "1",
        ie: "9",
        android: "4.4",
        ios: "6",
        phantom: "1.9",
        samsung: "1",
        rhino: "1.7.13",
        opera_mobile: "10.1",
        electron: "0.20"
      },
      "transform-export-namespace-from": {
        chrome: "72",
        deno: "1.0",
        edge: "79",
        firefox: "80",
        node: "13.2.0",
        opera: "60",
        opera_mobile: "51",
        safari: "14.1",
        ios: "14.5",
        samsung: "11.0",
        android: "72",
        electron: "5.0"
      },
      "proposal-export-namespace-from": {
        chrome: "72",
        deno: "1.0",
        edge: "79",
        firefox: "80",
        node: "13.2.0",
        opera: "60",
        opera_mobile: "51",
        safari: "14.1",
        ios: "14.5",
        samsung: "11.0",
        android: "72",
        electron: "5.0"
      }
    };
  }
});

// node_modules/@babel/compat-data/plugins.js
var require_plugins2 = __commonJS({
  "node_modules/@babel/compat-data/plugins.js"(exports2, module2) {
    module2.exports = require_plugins();
  }
});

// node_modules/@babel/helper-compilation-targets/lib/filter-items.js
var require_filter_items = __commonJS({
  "node_modules/@babel/helper-compilation-targets/lib/filter-items.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = filterItems;
    exports2.isRequired = isRequired;
    exports2.targetsSupported = targetsSupported;
    var _semver = require_semver2();
    var _utils = require_utils3();
    var pluginsCompatData = require_plugins2();
    function targetsSupported(target, support) {
      const targetEnvironments = Object.keys(target);
      if (targetEnvironments.length === 0) {
        return false;
      }
      const unsupportedEnvironments = targetEnvironments.filter((environment) => {
        const lowestImplementedVersion = (0, _utils.getLowestImplementedVersion)(support, environment);
        if (!lowestImplementedVersion) {
          return true;
        }
        const lowestTargetedVersion = target[environment];
        if ((0, _utils.isUnreleasedVersion)(lowestTargetedVersion, environment)) {
          return false;
        }
        if ((0, _utils.isUnreleasedVersion)(lowestImplementedVersion, environment)) {
          return true;
        }
        if (!_semver.valid(lowestTargetedVersion.toString())) {
          throw new Error(`Invalid version passed for target "${environment}": "${lowestTargetedVersion}". Versions must be in semver format (major.minor.patch)`);
        }
        return _semver.gt((0, _utils.semverify)(lowestImplementedVersion), lowestTargetedVersion.toString());
      });
      return unsupportedEnvironments.length === 0;
    }
    function isRequired(name, targets, {
      compatData = pluginsCompatData,
      includes,
      excludes
    } = {}) {
      if (excludes != null && excludes.has(name)) return false;
      if (includes != null && includes.has(name)) return true;
      return !targetsSupported(targets, compatData[name]);
    }
    function filterItems(list, includes, excludes, targets, defaultIncludes, defaultExcludes, pluginSyntaxMap) {
      const result = /* @__PURE__ */ new Set();
      const options = {
        compatData: list,
        includes,
        excludes
      };
      for (const item in list) {
        if (isRequired(item, targets, options)) {
          result.add(item);
        } else if (pluginSyntaxMap) {
          const shippedProposalsSyntax = pluginSyntaxMap.get(item);
          if (shippedProposalsSyntax) {
            result.add(shippedProposalsSyntax);
          }
        }
      }
      defaultIncludes == null || defaultIncludes.forEach((item) => !excludes.has(item) && result.add(item));
      defaultExcludes == null || defaultExcludes.forEach((item) => !includes.has(item) && result.delete(item));
      return result;
    }
  }
});

// node_modules/@babel/compat-data/data/native-modules.json
var require_native_modules = __commonJS({
  "node_modules/@babel/compat-data/data/native-modules.json"(exports2, module2) {
    module2.exports = {
      "es6.module": {
        chrome: "61",
        and_chr: "61",
        edge: "16",
        firefox: "60",
        and_ff: "60",
        node: "13.2.0",
        opera: "48",
        op_mob: "45",
        safari: "10.1",
        ios: "10.3",
        samsung: "8.2",
        android: "61",
        electron: "2.0",
        ios_saf: "10.3"
      }
    };
  }
});

// node_modules/@babel/compat-data/native-modules.js
var require_native_modules2 = __commonJS({
  "node_modules/@babel/compat-data/native-modules.js"(exports2, module2) {
    module2.exports = require_native_modules();
  }
});

// node_modules/@babel/helper-compilation-targets/lib/index.js
var require_lib14 = __commonJS({
  "node_modules/@babel/helper-compilation-targets/lib/index.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    Object.defineProperty(exports2, "TargetNames", {
      enumerable: true,
      get: function() {
        return _options.TargetNames;
      }
    });
    exports2.default = getTargets;
    Object.defineProperty(exports2, "filterItems", {
      enumerable: true,
      get: function() {
        return _filterItems.default;
      }
    });
    Object.defineProperty(exports2, "getInclusionReasons", {
      enumerable: true,
      get: function() {
        return _debug.getInclusionReasons;
      }
    });
    exports2.isBrowsersQueryValid = isBrowsersQueryValid;
    Object.defineProperty(exports2, "isRequired", {
      enumerable: true,
      get: function() {
        return _filterItems.isRequired;
      }
    });
    Object.defineProperty(exports2, "prettifyTargets", {
      enumerable: true,
      get: function() {
        return _pretty.prettifyTargets;
      }
    });
    Object.defineProperty(exports2, "unreleasedLabels", {
      enumerable: true,
      get: function() {
        return _targets.unreleasedLabels;
      }
    });
    var _browserslist = require_browserslist();
    var _helperValidatorOption = require_lib13();
    var _lruCache = require_lru_cache();
    var _utils = require_utils3();
    var _targets = require_targets();
    var _options = require_options2();
    var _pretty = require_pretty();
    var _debug = require_debug();
    var _filterItems = require_filter_items();
    var browserModulesData = require_native_modules2();
    var ESM_SUPPORT = browserModulesData["es6.module"];
    var v = new _helperValidatorOption.OptionValidator("@babel/helper-compilation-targets");
    function validateTargetNames(targets) {
      const validTargets = Object.keys(_options.TargetNames);
      for (const target of Object.keys(targets)) {
        if (!(target in _options.TargetNames)) {
          throw new Error(v.formatMessage(`'${target}' is not a valid target
- Did you mean '${(0, _helperValidatorOption.findSuggestion)(target, validTargets)}'?`));
        }
      }
      return targets;
    }
    function isBrowsersQueryValid(browsers) {
      return typeof browsers === "string" || Array.isArray(browsers) && browsers.every((b) => typeof b === "string");
    }
    function validateBrowsers(browsers) {
      v.invariant(browsers === void 0 || isBrowsersQueryValid(browsers), `'${String(browsers)}' is not a valid browserslist query`);
      return browsers;
    }
    function getLowestVersions(browsers) {
      return browsers.reduce((all, browser) => {
        const [browserName, browserVersion] = browser.split(" ");
        const target = _targets.browserNameMap[browserName];
        if (!target) {
          return all;
        }
        try {
          const splitVersion = browserVersion.split("-")[0].toLowerCase();
          const isSplitUnreleased = (0, _utils.isUnreleasedVersion)(splitVersion, target);
          if (!all[target]) {
            all[target] = isSplitUnreleased ? splitVersion : (0, _utils.semverify)(splitVersion);
            return all;
          }
          const version = all[target];
          const isUnreleased = (0, _utils.isUnreleasedVersion)(version, target);
          if (isUnreleased && isSplitUnreleased) {
            all[target] = (0, _utils.getLowestUnreleased)(version, splitVersion, target);
          } else if (isUnreleased) {
            all[target] = (0, _utils.semverify)(splitVersion);
          } else if (!isUnreleased && !isSplitUnreleased) {
            const parsedBrowserVersion = (0, _utils.semverify)(splitVersion);
            all[target] = (0, _utils.semverMin)(version, parsedBrowserVersion);
          }
        } catch (_) {
        }
        return all;
      }, {});
    }
    function outputDecimalWarning(decimalTargets) {
      if (!decimalTargets.length) {
        return;
      }
      console.warn("Warning, the following targets are using a decimal version:\n");
      decimalTargets.forEach(({
        target,
        value: value2
      }) => console.warn(`  ${target}: ${value2}`));
      console.warn(`
We recommend using a string for minor/patch versions to avoid numbers like 6.10
getting parsed as 6.1, which can lead to unexpected behavior.
`);
    }
    function semverifyTarget(target, value2) {
      try {
        return (0, _utils.semverify)(value2);
      } catch (_) {
        throw new Error(v.formatMessage(`'${value2}' is not a valid value for 'targets.${target}'.`));
      }
    }
    function nodeTargetParser(value2) {
      const parsed = value2 === true || value2 === "current" ? process.versions.node.split("-")[0] : semverifyTarget("node", value2);
      return ["node", parsed];
    }
    function defaultTargetParser(target, value2) {
      const version = (0, _utils.isUnreleasedVersion)(value2, target) ? value2.toLowerCase() : semverifyTarget(target, value2);
      return [target, version];
    }
    function generateTargets(inputTargets) {
      const input = Object.assign({}, inputTargets);
      delete input.esmodules;
      delete input.browsers;
      return input;
    }
    function resolveTargets(queries, env) {
      const resolved = _browserslist(queries, {
        mobileToDesktop: true,
        env
      });
      return getLowestVersions(resolved);
    }
    var targetsCache = new _lruCache({
      max: 64
    });
    function resolveTargetsCached(queries, env) {
      const cacheKey = typeof queries === "string" ? queries : queries.join() + env;
      let cached = targetsCache.get(cacheKey);
      if (!cached) {
        cached = resolveTargets(queries, env);
        targetsCache.set(cacheKey, cached);
      }
      return Object.assign({}, cached);
    }
    function getTargets(inputTargets = {}, options = {}) {
      var _browsers, _browsers2;
      let {
        browsers,
        esmodules
      } = inputTargets;
      const {
        configPath = ".",
        onBrowserslistConfigFound
      } = options;
      validateBrowsers(browsers);
      const input = generateTargets(inputTargets);
      let targets = validateTargetNames(input);
      const shouldParseBrowsers = !!browsers;
      const hasTargets = shouldParseBrowsers || Object.keys(targets).length > 0;
      const shouldSearchForConfig = !options.ignoreBrowserslistConfig && !hasTargets;
      if (!browsers && shouldSearchForConfig) {
        browsers = process.env.BROWSERSLIST;
        if (!browsers) {
          const configFile = options.configFile || process.env.BROWSERSLIST_CONFIG || _browserslist.findConfigFile(configPath);
          if (configFile != null) {
            onBrowserslistConfigFound == null || onBrowserslistConfigFound(configFile);
            browsers = _browserslist.loadConfig({
              config: configFile,
              env: options.browserslistEnv
            });
          }
        }
        if (browsers == null) {
          {
            browsers = [];
          }
        }
      }
      ;
      if (esmodules && (esmodules !== "intersect" || !((_browsers = browsers) != null && _browsers.length))) {
        browsers = Object.keys(ESM_SUPPORT).map((browser) => `${browser} >= ${ESM_SUPPORT[browser]}`).join(", ");
        esmodules = false;
      }
      if ((_browsers2 = browsers) != null && _browsers2.length) {
        const queryBrowsers = resolveTargetsCached(browsers, options.browserslistEnv);
        if (esmodules === "intersect") {
          for (const browser of Object.keys(queryBrowsers)) {
            if (browser !== "deno" && browser !== "ie") {
              const esmSupportVersion = ESM_SUPPORT[browser === "opera_mobile" ? "op_mob" : browser];
              if (esmSupportVersion) {
                const version = queryBrowsers[browser];
                queryBrowsers[browser] = (0, _utils.getHighestUnreleased)(version, (0, _utils.semverify)(esmSupportVersion), browser);
              } else {
                delete queryBrowsers[browser];
              }
            } else {
              delete queryBrowsers[browser];
            }
          }
        }
        targets = Object.assign(queryBrowsers, targets);
      }
      const result = {};
      const decimalWarnings = [];
      for (const target of Object.keys(targets).sort()) {
        const value2 = targets[target];
        if (typeof value2 === "number" && value2 % 1 !== 0) {
          decimalWarnings.push({
            target,
            value: value2
          });
        }
        const [parsedTarget, parsedValue] = target === "node" ? nodeTargetParser(value2) : defaultTargetParser(target, value2);
        if (parsedValue) {
          result[parsedTarget] = parsedValue;
        }
      }
      outputDecimalWarning(decimalWarnings);
      return result;
    }
  }
});

// node_modules/@babel/core/lib/config/resolve-targets.js
var require_resolve_targets = __commonJS({
  "node_modules/@babel/core/lib/config/resolve-targets.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.resolveBrowserslistConfigFile = resolveBrowserslistConfigFile;
    exports2.resolveTargets = resolveTargets;
    function _path() {
      const data = require("path");
      _path = function() {
        return data;
      };
      return data;
    }
    function _helperCompilationTargets() {
      const data = require_lib14();
      _helperCompilationTargets = function() {
        return data;
      };
      return data;
    }
    function resolveBrowserslistConfigFile(browserslistConfigFile, configFileDir) {
      return _path().resolve(configFileDir, browserslistConfigFile);
    }
    function resolveTargets(options, root) {
      const optTargets = options.targets;
      let targets;
      if (typeof optTargets === "string" || Array.isArray(optTargets)) {
        targets = {
          browsers: optTargets
        };
      } else if (optTargets) {
        if ("esmodules" in optTargets) {
          targets = Object.assign({}, optTargets, {
            esmodules: "intersect"
          });
        } else {
          targets = optTargets;
        }
      }
      const {
        browserslistConfigFile
      } = options;
      let configFile;
      let ignoreBrowserslistConfig = false;
      if (typeof browserslistConfigFile === "string") {
        configFile = browserslistConfigFile;
      } else {
        ignoreBrowserslistConfig = browserslistConfigFile === false;
      }
      return (0, _helperCompilationTargets().default)(targets, {
        ignoreBrowserslistConfig,
        configFile,
        configPath: root,
        browserslistEnv: options.browserslistEnv
      });
    }
  }
});

// node_modules/@babel/core/lib/config/config-descriptors.js
var require_config_descriptors = __commonJS({
  "node_modules/@babel/core/lib/config/config-descriptors.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.createCachedDescriptors = createCachedDescriptors;
    exports2.createDescriptor = createDescriptor;
    exports2.createUncachedDescriptors = createUncachedDescriptors;
    function _gensync() {
      const data = require_gensync();
      _gensync = function() {
        return data;
      };
      return data;
    }
    var _functional = require_functional();
    var _index = require_files();
    var _item = require_item();
    var _caching = require_caching();
    var _resolveTargets = require_resolve_targets();
    function isEqualDescriptor(a, b) {
      var _a$file, _b$file, _a$file2, _b$file2;
      return a.name === b.name && a.value === b.value && a.options === b.options && a.dirname === b.dirname && a.alias === b.alias && a.ownPass === b.ownPass && ((_a$file = a.file) == null ? void 0 : _a$file.request) === ((_b$file = b.file) == null ? void 0 : _b$file.request) && ((_a$file2 = a.file) == null ? void 0 : _a$file2.resolved) === ((_b$file2 = b.file) == null ? void 0 : _b$file2.resolved);
    }
    function* handlerOf(value2) {
      return value2;
    }
    function optionsWithResolvedBrowserslistConfigFile(options, dirname) {
      if (typeof options.browserslistConfigFile === "string") {
        options.browserslistConfigFile = (0, _resolveTargets.resolveBrowserslistConfigFile)(options.browserslistConfigFile, dirname);
      }
      return options;
    }
    function createCachedDescriptors(dirname, options, alias) {
      const {
        plugins,
        presets,
        passPerPreset
      } = options;
      return {
        options: optionsWithResolvedBrowserslistConfigFile(options, dirname),
        plugins: plugins ? () => createCachedPluginDescriptors(plugins, dirname)(alias) : () => handlerOf([]),
        presets: presets ? () => createCachedPresetDescriptors(presets, dirname)(alias)(!!passPerPreset) : () => handlerOf([])
      };
    }
    function createUncachedDescriptors(dirname, options, alias) {
      return {
        options: optionsWithResolvedBrowserslistConfigFile(options, dirname),
        plugins: (0, _functional.once)(() => createPluginDescriptors(options.plugins || [], dirname, alias)),
        presets: (0, _functional.once)(() => createPresetDescriptors(options.presets || [], dirname, alias, !!options.passPerPreset))
      };
    }
    var PRESET_DESCRIPTOR_CACHE = /* @__PURE__ */ new WeakMap();
    var createCachedPresetDescriptors = (0, _caching.makeWeakCacheSync)((items, cache) => {
      const dirname = cache.using((dir) => dir);
      return (0, _caching.makeStrongCacheSync)((alias) => (0, _caching.makeStrongCache)(function* (passPerPreset) {
        const descriptors = yield* createPresetDescriptors(items, dirname, alias, passPerPreset);
        return descriptors.map((desc) => loadCachedDescriptor(PRESET_DESCRIPTOR_CACHE, desc));
      }));
    });
    var PLUGIN_DESCRIPTOR_CACHE = /* @__PURE__ */ new WeakMap();
    var createCachedPluginDescriptors = (0, _caching.makeWeakCacheSync)((items, cache) => {
      const dirname = cache.using((dir) => dir);
      return (0, _caching.makeStrongCache)(function* (alias) {
        const descriptors = yield* createPluginDescriptors(items, dirname, alias);
        return descriptors.map((desc) => loadCachedDescriptor(PLUGIN_DESCRIPTOR_CACHE, desc));
      });
    });
    var DEFAULT_OPTIONS = {};
    function loadCachedDescriptor(cache, desc) {
      const {
        value: value2,
        options = DEFAULT_OPTIONS
      } = desc;
      if (options === false) return desc;
      let cacheByOptions = cache.get(value2);
      if (!cacheByOptions) {
        cacheByOptions = /* @__PURE__ */ new WeakMap();
        cache.set(value2, cacheByOptions);
      }
      let possibilities = cacheByOptions.get(options);
      if (!possibilities) {
        possibilities = [];
        cacheByOptions.set(options, possibilities);
      }
      if (!possibilities.includes(desc)) {
        const matches = possibilities.filter((possibility) => isEqualDescriptor(possibility, desc));
        if (matches.length > 0) {
          return matches[0];
        }
        possibilities.push(desc);
      }
      return desc;
    }
    function* createPresetDescriptors(items, dirname, alias, passPerPreset) {
      return yield* createDescriptors("preset", items, dirname, alias, passPerPreset);
    }
    function* createPluginDescriptors(items, dirname, alias) {
      return yield* createDescriptors("plugin", items, dirname, alias);
    }
    function* createDescriptors(type, items, dirname, alias, ownPass) {
      const descriptors = yield* _gensync().all(items.map((item, index) => createDescriptor(item, dirname, {
        type,
        alias: `${alias}$${index}`,
        ownPass: !!ownPass
      })));
      assertNoDuplicates(descriptors);
      return descriptors;
    }
    function* createDescriptor(pair, dirname, {
      type,
      alias,
      ownPass
    }) {
      const desc = (0, _item.getItemDescriptor)(pair);
      if (desc) {
        return desc;
      }
      let name;
      let options;
      let value2 = pair;
      if (Array.isArray(value2)) {
        if (value2.length === 3) {
          [value2, options, name] = value2;
        } else {
          [value2, options] = value2;
        }
      }
      let file = void 0;
      let filepath = null;
      if (typeof value2 === "string") {
        if (typeof type !== "string") {
          throw new Error("To resolve a string-based item, the type of item must be given");
        }
        const resolver = type === "plugin" ? _index.loadPlugin : _index.loadPreset;
        const request = value2;
        ({
          filepath,
          value: value2
        } = yield* resolver(value2, dirname));
        file = {
          request,
          resolved: filepath
        };
      }
      if (!value2) {
        throw new Error(`Unexpected falsy value: ${String(value2)}`);
      }
      if (typeof value2 === "object" && value2.__esModule) {
        if (value2.default) {
          value2 = value2.default;
        } else {
          throw new Error("Must export a default export when using ES6 modules.");
        }
      }
      if (typeof value2 !== "object" && typeof value2 !== "function") {
        throw new Error(`Unsupported format: ${typeof value2}. Expected an object or a function.`);
      }
      if (filepath !== null && typeof value2 === "object" && value2) {
        throw new Error(`Plugin/Preset files are not allowed to export objects, only functions. In ${filepath}`);
      }
      return {
        name,
        alias: filepath || alias,
        value: value2,
        options,
        dirname,
        ownPass,
        file
      };
    }
    function assertNoDuplicates(items) {
      const map = /* @__PURE__ */ new Map();
      for (const item of items) {
        if (typeof item.value !== "function") continue;
        let nameMap = map.get(item.value);
        if (!nameMap) {
          nameMap = /* @__PURE__ */ new Set();
          map.set(item.value, nameMap);
        }
        if (nameMap.has(item.name)) {
          const conflicts = items.filter((i) => i.value === item.value);
          throw new Error([`Duplicate plugin/preset detected.`, `If you'd like to use two separate instances of a plugin,`, `they need separate names, e.g.`, ``, `  plugins: [`, `    ['some-plugin', {}],`, `    ['some-plugin', {}, 'some unique name'],`, `  ]`, ``, `Duplicates detected are:`, `${JSON.stringify(conflicts, null, 2)}`].join("\n"));
        }
        nameMap.add(item.name);
      }
    }
  }
});

// node_modules/@babel/core/lib/config/item.js
var require_item = __commonJS({
  "node_modules/@babel/core/lib/config/item.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.createConfigItem = createConfigItem;
    exports2.createItemFromDescriptor = createItemFromDescriptor;
    exports2.getItemDescriptor = getItemDescriptor;
    function _path() {
      const data = require("path");
      _path = function() {
        return data;
      };
      return data;
    }
    var _configDescriptors = require_config_descriptors();
    function createItemFromDescriptor(desc) {
      return new ConfigItem(desc);
    }
    function* createConfigItem(value2, {
      dirname = ".",
      type
    } = {}) {
      const descriptor = yield* (0, _configDescriptors.createDescriptor)(value2, _path().resolve(dirname), {
        type,
        alias: "programmatic item"
      });
      return createItemFromDescriptor(descriptor);
    }
    var CONFIG_ITEM_BRAND = Symbol.for("@babel/core@7 - ConfigItem");
    function getItemDescriptor(item) {
      if (item != null && item[CONFIG_ITEM_BRAND]) {
        return item._descriptor;
      }
      return void 0;
    }
    var ConfigItem = class {
      constructor(descriptor) {
        this._descriptor = void 0;
        this[CONFIG_ITEM_BRAND] = true;
        this.value = void 0;
        this.options = void 0;
        this.dirname = void 0;
        this.name = void 0;
        this.file = void 0;
        this._descriptor = descriptor;
        Object.defineProperty(this, "_descriptor", {
          enumerable: false
        });
        Object.defineProperty(this, CONFIG_ITEM_BRAND, {
          enumerable: false
        });
        this.value = this._descriptor.value;
        this.options = this._descriptor.options;
        this.dirname = this._descriptor.dirname;
        this.name = this._descriptor.name;
        this.file = this._descriptor.file ? {
          request: this._descriptor.file.request,
          resolved: this._descriptor.file.resolved
        } : void 0;
        Object.freeze(this);
      }
    };
    Object.freeze(ConfigItem.prototype);
  }
});

// node_modules/@babel/core/lib/config/validation/removed.js
var require_removed = __commonJS({
  "node_modules/@babel/core/lib/config/validation/removed.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = void 0;
    var _default = exports2.default = {
      auxiliaryComment: {
        message: "Use `auxiliaryCommentBefore` or `auxiliaryCommentAfter`"
      },
      blacklist: {
        message: "Put the specific transforms you want in the `plugins` option"
      },
      breakConfig: {
        message: "This is not a necessary option in Babel 6"
      },
      experimental: {
        message: "Put the specific transforms you want in the `plugins` option"
      },
      externalHelpers: {
        message: "Use the `external-helpers` plugin instead. Check out http://babeljs.io/docs/plugins/external-helpers/"
      },
      extra: {
        message: ""
      },
      jsxPragma: {
        message: "use the `pragma` option in the `react-jsx` plugin. Check out http://babeljs.io/docs/plugins/transform-react-jsx/"
      },
      loose: {
        message: "Specify the `loose` option for the relevant plugin you are using or use a preset that sets the option."
      },
      metadataUsedHelpers: {
        message: "Not required anymore as this is enabled by default"
      },
      modules: {
        message: "Use the corresponding module transform plugin in the `plugins` option. Check out http://babeljs.io/docs/plugins/#modules"
      },
      nonStandard: {
        message: "Use the `react-jsx` and `flow-strip-types` plugins to support JSX and Flow. Also check out the react preset http://babeljs.io/docs/plugins/preset-react/"
      },
      optional: {
        message: "Put the specific transforms you want in the `plugins` option"
      },
      sourceMapName: {
        message: "The `sourceMapName` option has been removed because it makes more sense for the tooling that calls Babel to assign `map.file` themselves."
      },
      stage: {
        message: "Check out the corresponding stage-x presets http://babeljs.io/docs/plugins/#presets"
      },
      whitelist: {
        message: "Put the specific transforms you want in the `plugins` option"
      },
      resolveModuleSource: {
        version: 6,
        message: "Use `babel-plugin-module-resolver@3`'s 'resolvePath' options"
      },
      metadata: {
        version: 6,
        message: "Generated plugin metadata is always included in the output result"
      },
      sourceMapTarget: {
        version: 6,
        message: "The `sourceMapTarget` option has been removed because it makes more sense for the tooling that calls Babel to assign `map.file` themselves."
      }
    };
  }
});

// node_modules/@babel/core/lib/config/validation/option-assertions.js
var require_option_assertions = __commonJS({
  "node_modules/@babel/core/lib/config/validation/option-assertions.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.access = access;
    exports2.assertArray = assertArray;
    exports2.assertAssumptions = assertAssumptions;
    exports2.assertBabelrcSearch = assertBabelrcSearch;
    exports2.assertBoolean = assertBoolean;
    exports2.assertCallerMetadata = assertCallerMetadata;
    exports2.assertCompact = assertCompact;
    exports2.assertConfigApplicableTest = assertConfigApplicableTest;
    exports2.assertConfigFileSearch = assertConfigFileSearch;
    exports2.assertFunction = assertFunction;
    exports2.assertIgnoreList = assertIgnoreList;
    exports2.assertInputSourceMap = assertInputSourceMap;
    exports2.assertObject = assertObject;
    exports2.assertPluginList = assertPluginList;
    exports2.assertRootMode = assertRootMode;
    exports2.assertSourceMaps = assertSourceMaps;
    exports2.assertSourceType = assertSourceType;
    exports2.assertString = assertString;
    exports2.assertTargets = assertTargets;
    exports2.msg = msg;
    function _helperCompilationTargets() {
      const data = require_lib14();
      _helperCompilationTargets = function() {
        return data;
      };
      return data;
    }
    var _options = require_options3();
    function msg(loc) {
      switch (loc.type) {
        case "root":
          return ``;
        case "env":
          return `${msg(loc.parent)}.env["${loc.name}"]`;
        case "overrides":
          return `${msg(loc.parent)}.overrides[${loc.index}]`;
        case "option":
          return `${msg(loc.parent)}.${loc.name}`;
        case "access":
          return `${msg(loc.parent)}[${JSON.stringify(loc.name)}]`;
        default:
          throw new Error(`Assertion failure: Unknown type ${loc.type}`);
      }
    }
    function access(loc, name) {
      return {
        type: "access",
        name,
        parent: loc
      };
    }
    function assertRootMode(loc, value2) {
      if (value2 !== void 0 && value2 !== "root" && value2 !== "upward" && value2 !== "upward-optional") {
        throw new Error(`${msg(loc)} must be a "root", "upward", "upward-optional" or undefined`);
      }
      return value2;
    }
    function assertSourceMaps(loc, value2) {
      if (value2 !== void 0 && typeof value2 !== "boolean" && value2 !== "inline" && value2 !== "both") {
        throw new Error(`${msg(loc)} must be a boolean, "inline", "both", or undefined`);
      }
      return value2;
    }
    function assertCompact(loc, value2) {
      if (value2 !== void 0 && typeof value2 !== "boolean" && value2 !== "auto") {
        throw new Error(`${msg(loc)} must be a boolean, "auto", or undefined`);
      }
      return value2;
    }
    function assertSourceType(loc, value2) {
      if (value2 !== void 0 && value2 !== "module" && value2 !== "commonjs" && value2 !== "script" && value2 !== "unambiguous") {
        throw new Error(`${msg(loc)} must be "module", "commonjs", "script", "unambiguous", or undefined`);
      }
      return value2;
    }
    function assertCallerMetadata(loc, value2) {
      const obj = assertObject(loc, value2);
      if (obj) {
        if (typeof obj.name !== "string") {
          throw new Error(`${msg(loc)} set but does not contain "name" property string`);
        }
        for (const prop of Object.keys(obj)) {
          const propLoc = access(loc, prop);
          const value3 = obj[prop];
          if (value3 != null && typeof value3 !== "boolean" && typeof value3 !== "string" && typeof value3 !== "number") {
            throw new Error(`${msg(propLoc)} must be null, undefined, a boolean, a string, or a number.`);
          }
        }
      }
      return value2;
    }
    function assertInputSourceMap(loc, value2) {
      if (value2 !== void 0 && typeof value2 !== "boolean" && (typeof value2 !== "object" || !value2)) {
        throw new Error(`${msg(loc)} must be a boolean, object, or undefined`);
      }
      return value2;
    }
    function assertString(loc, value2) {
      if (value2 !== void 0 && typeof value2 !== "string") {
        throw new Error(`${msg(loc)} must be a string, or undefined`);
      }
      return value2;
    }
    function assertFunction(loc, value2) {
      if (value2 !== void 0 && typeof value2 !== "function") {
        throw new Error(`${msg(loc)} must be a function, or undefined`);
      }
      return value2;
    }
    function assertBoolean(loc, value2) {
      if (value2 !== void 0 && typeof value2 !== "boolean") {
        throw new Error(`${msg(loc)} must be a boolean, or undefined`);
      }
      return value2;
    }
    function assertObject(loc, value2) {
      if (value2 !== void 0 && (typeof value2 !== "object" || Array.isArray(value2) || !value2)) {
        throw new Error(`${msg(loc)} must be an object, or undefined`);
      }
      return value2;
    }
    function assertArray(loc, value2) {
      if (value2 != null && !Array.isArray(value2)) {
        throw new Error(`${msg(loc)} must be an array, or undefined`);
      }
      return value2;
    }
    function assertIgnoreList(loc, value2) {
      const arr = assertArray(loc, value2);
      arr == null || arr.forEach((item, i) => assertIgnoreItem(access(loc, i), item));
      return arr;
    }
    function assertIgnoreItem(loc, value2) {
      if (typeof value2 !== "string" && typeof value2 !== "function" && !(value2 instanceof RegExp)) {
        throw new Error(`${msg(loc)} must be an array of string/Function/RegExp values, or undefined`);
      }
      return value2;
    }
    function assertConfigApplicableTest(loc, value2) {
      if (value2 === void 0) {
        return value2;
      }
      if (Array.isArray(value2)) {
        value2.forEach((item, i) => {
          if (!checkValidTest(item)) {
            throw new Error(`${msg(access(loc, i))} must be a string/Function/RegExp.`);
          }
        });
      } else if (!checkValidTest(value2)) {
        throw new Error(`${msg(loc)} must be a string/Function/RegExp, or an array of those`);
      }
      return value2;
    }
    function checkValidTest(value2) {
      return typeof value2 === "string" || typeof value2 === "function" || value2 instanceof RegExp;
    }
    function assertConfigFileSearch(loc, value2) {
      if (value2 !== void 0 && typeof value2 !== "boolean" && typeof value2 !== "string") {
        throw new Error(`${msg(loc)} must be a undefined, a boolean, a string, got ${JSON.stringify(value2)}`);
      }
      return value2;
    }
    function assertBabelrcSearch(loc, value2) {
      if (value2 === void 0 || typeof value2 === "boolean") {
        return value2;
      }
      if (Array.isArray(value2)) {
        value2.forEach((item, i) => {
          if (!checkValidTest(item)) {
            throw new Error(`${msg(access(loc, i))} must be a string/Function/RegExp.`);
          }
        });
      } else if (!checkValidTest(value2)) {
        throw new Error(`${msg(loc)} must be a undefined, a boolean, a string/Function/RegExp or an array of those, got ${JSON.stringify(value2)}`);
      }
      return value2;
    }
    function assertPluginList(loc, value2) {
      const arr = assertArray(loc, value2);
      if (arr) {
        arr.forEach((item, i) => assertPluginItem(access(loc, i), item));
      }
      return arr;
    }
    function assertPluginItem(loc, value2) {
      if (Array.isArray(value2)) {
        if (value2.length === 0) {
          throw new Error(`${msg(loc)} must include an object`);
        }
        if (value2.length > 3) {
          throw new Error(`${msg(loc)} may only be a two-tuple or three-tuple`);
        }
        assertPluginTarget(access(loc, 0), value2[0]);
        if (value2.length > 1) {
          const opts = value2[1];
          if (opts !== void 0 && opts !== false && (typeof opts !== "object" || Array.isArray(opts) || opts === null)) {
            throw new Error(`${msg(access(loc, 1))} must be an object, false, or undefined`);
          }
        }
        if (value2.length === 3) {
          const name = value2[2];
          if (name !== void 0 && typeof name !== "string") {
            throw new Error(`${msg(access(loc, 2))} must be a string, or undefined`);
          }
        }
      } else {
        assertPluginTarget(loc, value2);
      }
      return value2;
    }
    function assertPluginTarget(loc, value2) {
      if ((typeof value2 !== "object" || !value2) && typeof value2 !== "string" && typeof value2 !== "function") {
        throw new Error(`${msg(loc)} must be a string, object, function`);
      }
      return value2;
    }
    function assertTargets(loc, value2) {
      if ((0, _helperCompilationTargets().isBrowsersQueryValid)(value2)) return value2;
      if (typeof value2 !== "object" || !value2 || Array.isArray(value2)) {
        throw new Error(`${msg(loc)} must be a string, an array of strings or an object`);
      }
      const browsersLoc = access(loc, "browsers");
      const esmodulesLoc = access(loc, "esmodules");
      assertBrowsersList(browsersLoc, value2.browsers);
      assertBoolean(esmodulesLoc, value2.esmodules);
      for (const key of Object.keys(value2)) {
        const val = value2[key];
        const subLoc = access(loc, key);
        if (key === "esmodules") assertBoolean(subLoc, val);
        else if (key === "browsers") assertBrowsersList(subLoc, val);
        else if (!hasOwnProperty.call(_helperCompilationTargets().TargetNames, key)) {
          const validTargets = Object.keys(_helperCompilationTargets().TargetNames).join(", ");
          throw new Error(`${msg(subLoc)} is not a valid target. Supported targets are ${validTargets}`);
        } else assertBrowserVersion(subLoc, val);
      }
      return value2;
    }
    function assertBrowsersList(loc, value2) {
      if (value2 !== void 0 && !(0, _helperCompilationTargets().isBrowsersQueryValid)(value2)) {
        throw new Error(`${msg(loc)} must be undefined, a string or an array of strings`);
      }
    }
    function assertBrowserVersion(loc, value2) {
      if (typeof value2 === "number" && Math.round(value2) === value2) return;
      if (typeof value2 === "string") return;
      throw new Error(`${msg(loc)} must be a string or an integer number`);
    }
    function assertAssumptions(loc, value2) {
      if (value2 === void 0) return;
      if (typeof value2 !== "object" || value2 === null) {
        throw new Error(`${msg(loc)} must be an object or undefined.`);
      }
      let root = loc;
      do {
        root = root.parent;
      } while (root.type !== "root");
      const inPreset = root.source === "preset";
      for (const name of Object.keys(value2)) {
        const subLoc = access(loc, name);
        if (!_options.assumptionsNames.has(name)) {
          throw new Error(`${msg(subLoc)} is not a supported assumption.`);
        }
        if (typeof value2[name] !== "boolean") {
          throw new Error(`${msg(subLoc)} must be a boolean.`);
        }
        if (inPreset && value2[name] === false) {
          throw new Error(`${msg(subLoc)} cannot be set to 'false' inside presets.`);
        }
      }
      return value2;
    }
  }
});

// node_modules/@babel/core/lib/config/validation/options.js
var require_options3 = __commonJS({
  "node_modules/@babel/core/lib/config/validation/options.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.assumptionsNames = void 0;
    exports2.checkNoUnwrappedItemOptionPairs = checkNoUnwrappedItemOptionPairs;
    exports2.validate = validate;
    var _removed = require_removed();
    var _optionAssertions = require_option_assertions();
    var _configError = require_config_error();
    var ROOT_VALIDATORS = {
      cwd: _optionAssertions.assertString,
      root: _optionAssertions.assertString,
      rootMode: _optionAssertions.assertRootMode,
      configFile: _optionAssertions.assertConfigFileSearch,
      caller: _optionAssertions.assertCallerMetadata,
      filename: _optionAssertions.assertString,
      filenameRelative: _optionAssertions.assertString,
      code: _optionAssertions.assertBoolean,
      ast: _optionAssertions.assertBoolean,
      cloneInputAst: _optionAssertions.assertBoolean,
      envName: _optionAssertions.assertString
    };
    var BABELRC_VALIDATORS = {
      babelrc: _optionAssertions.assertBoolean,
      babelrcRoots: _optionAssertions.assertBabelrcSearch
    };
    var NONPRESET_VALIDATORS = {
      extends: _optionAssertions.assertString,
      ignore: _optionAssertions.assertIgnoreList,
      only: _optionAssertions.assertIgnoreList,
      targets: _optionAssertions.assertTargets,
      browserslistConfigFile: _optionAssertions.assertConfigFileSearch,
      browserslistEnv: _optionAssertions.assertString
    };
    var COMMON_VALIDATORS = {
      inputSourceMap: _optionAssertions.assertInputSourceMap,
      presets: _optionAssertions.assertPluginList,
      plugins: _optionAssertions.assertPluginList,
      passPerPreset: _optionAssertions.assertBoolean,
      assumptions: _optionAssertions.assertAssumptions,
      env: assertEnvSet,
      overrides: assertOverridesList,
      test: _optionAssertions.assertConfigApplicableTest,
      include: _optionAssertions.assertConfigApplicableTest,
      exclude: _optionAssertions.assertConfigApplicableTest,
      retainLines: _optionAssertions.assertBoolean,
      comments: _optionAssertions.assertBoolean,
      shouldPrintComment: _optionAssertions.assertFunction,
      compact: _optionAssertions.assertCompact,
      minified: _optionAssertions.assertBoolean,
      auxiliaryCommentBefore: _optionAssertions.assertString,
      auxiliaryCommentAfter: _optionAssertions.assertString,
      sourceType: _optionAssertions.assertSourceType,
      wrapPluginVisitorMethod: _optionAssertions.assertFunction,
      highlightCode: _optionAssertions.assertBoolean,
      sourceMaps: _optionAssertions.assertSourceMaps,
      sourceMap: _optionAssertions.assertSourceMaps,
      sourceFileName: _optionAssertions.assertString,
      sourceRoot: _optionAssertions.assertString,
      parserOpts: _optionAssertions.assertObject,
      generatorOpts: _optionAssertions.assertObject
    };
    {
      Object.assign(COMMON_VALIDATORS, {
        getModuleId: _optionAssertions.assertFunction,
        moduleRoot: _optionAssertions.assertString,
        moduleIds: _optionAssertions.assertBoolean,
        moduleId: _optionAssertions.assertString
      });
    }
    var knownAssumptions = ["arrayLikeIsIterable", "constantReexports", "constantSuper", "enumerableModuleMeta", "ignoreFunctionLength", "ignoreToPrimitiveHint", "iterableIsArray", "mutableTemplateObject", "noClassCalls", "noDocumentAll", "noIncompleteNsImportDetection", "noNewArrows", "noUninitializedPrivateFieldAccess", "objectRestNoSymbols", "privateFieldsAsSymbols", "privateFieldsAsProperties", "pureGetters", "setClassMethods", "setComputedProperties", "setPublicClassFields", "setSpreadProperties", "skipForOfIteratorClosing", "superIsCallableConstructor"];
    var assumptionsNames = exports2.assumptionsNames = new Set(knownAssumptions);
    function getSource(loc) {
      return loc.type === "root" ? loc.source : getSource(loc.parent);
    }
    function validate(type, opts, filename) {
      try {
        return validateNested({
          type: "root",
          source: type
        }, opts);
      } catch (error) {
        const configError = new _configError.default(error.message, filename);
        if (error.code) configError.code = error.code;
        throw configError;
      }
    }
    function validateNested(loc, opts) {
      const type = getSource(loc);
      assertNoDuplicateSourcemap(opts);
      Object.keys(opts).forEach((key) => {
        const optLoc = {
          type: "option",
          name: key,
          parent: loc
        };
        if (type === "preset" && NONPRESET_VALIDATORS[key]) {
          throw new Error(`${(0, _optionAssertions.msg)(optLoc)} is not allowed in preset options`);
        }
        if (type !== "arguments" && ROOT_VALIDATORS[key]) {
          throw new Error(`${(0, _optionAssertions.msg)(optLoc)} is only allowed in root programmatic options`);
        }
        if (type !== "arguments" && type !== "configfile" && BABELRC_VALIDATORS[key]) {
          if (type === "babelrcfile" || type === "extendsfile") {
            throw new Error(`${(0, _optionAssertions.msg)(optLoc)} is not allowed in .babelrc or "extends"ed files, only in root programmatic options, or babel.config.js/config file options`);
          }
          throw new Error(`${(0, _optionAssertions.msg)(optLoc)} is only allowed in root programmatic options, or babel.config.js/config file options`);
        }
        const validator = COMMON_VALIDATORS[key] || NONPRESET_VALIDATORS[key] || BABELRC_VALIDATORS[key] || ROOT_VALIDATORS[key] || throwUnknownError;
        validator(optLoc, opts[key]);
      });
      return opts;
    }
    function throwUnknownError(loc) {
      const key = loc.name;
      if (_removed.default[key]) {
        const {
          message,
          version = 5
        } = _removed.default[key];
        throw new Error(`Using removed Babel ${version} option: ${(0, _optionAssertions.msg)(loc)} - ${message}`);
      } else {
        const unknownOptErr = new Error(`Unknown option: ${(0, _optionAssertions.msg)(loc)}. Check out https://babeljs.io/docs/en/babel-core/#options for more information about options.`);
        unknownOptErr.code = "BABEL_UNKNOWN_OPTION";
        throw unknownOptErr;
      }
    }
    function assertNoDuplicateSourcemap(opts) {
      if (hasOwnProperty.call(opts, "sourceMap") && hasOwnProperty.call(opts, "sourceMaps")) {
        throw new Error(".sourceMap is an alias for .sourceMaps, cannot use both");
      }
    }
    function assertEnvSet(loc, value2) {
      if (loc.parent.type === "env") {
        throw new Error(`${(0, _optionAssertions.msg)(loc)} is not allowed inside of another .env block`);
      }
      const parent = loc.parent;
      const obj = (0, _optionAssertions.assertObject)(loc, value2);
      if (obj) {
        for (const envName of Object.keys(obj)) {
          const env = (0, _optionAssertions.assertObject)((0, _optionAssertions.access)(loc, envName), obj[envName]);
          if (!env) continue;
          const envLoc = {
            type: "env",
            name: envName,
            parent
          };
          validateNested(envLoc, env);
        }
      }
      return obj;
    }
    function assertOverridesList(loc, value2) {
      if (loc.parent.type === "env") {
        throw new Error(`${(0, _optionAssertions.msg)(loc)} is not allowed inside an .env block`);
      }
      if (loc.parent.type === "overrides") {
        throw new Error(`${(0, _optionAssertions.msg)(loc)} is not allowed inside an .overrides block`);
      }
      const parent = loc.parent;
      const arr = (0, _optionAssertions.assertArray)(loc, value2);
      if (arr) {
        for (const [index, item] of arr.entries()) {
          const objLoc = (0, _optionAssertions.access)(loc, index);
          const env = (0, _optionAssertions.assertObject)(objLoc, item);
          if (!env) throw new Error(`${(0, _optionAssertions.msg)(objLoc)} must be an object`);
          const overridesLoc = {
            type: "overrides",
            index,
            parent
          };
          validateNested(overridesLoc, env);
        }
      }
      return arr;
    }
    function checkNoUnwrappedItemOptionPairs(items, index, type, e) {
      if (index === 0) return;
      const lastItem = items[index - 1];
      const thisItem = items[index];
      if (lastItem.file && lastItem.options === void 0 && typeof thisItem.value === "object") {
        e.message += `
- Maybe you meant to use
"${type}s": [
  ["${lastItem.file.request}", ${JSON.stringify(thisItem.value, void 0, 2)}]
]
To be a valid ${type}, its name and options should be wrapped in a pair of brackets`;
      }
    }
  }
});

// node_modules/@babel/core/lib/config/pattern-to-regex.js
var require_pattern_to_regex = __commonJS({
  "node_modules/@babel/core/lib/config/pattern-to-regex.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = pathToPattern;
    function _path() {
      const data = require("path");
      _path = function() {
        return data;
      };
      return data;
    }
    var sep = `\\${_path().sep}`;
    var endSep = `(?:${sep}|$)`;
    var substitution = `[^${sep}]+`;
    var starPat = `(?:${substitution}${sep})`;
    var starPatLast = `(?:${substitution}${endSep})`;
    var starStarPat = `${starPat}*?`;
    var starStarPatLast = `${starPat}*?${starPatLast}?`;
    function escapeRegExp(string) {
      return string.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&");
    }
    function pathToPattern(pattern, dirname) {
      const parts = _path().resolve(dirname, pattern).split(_path().sep);
      return new RegExp(["^", ...parts.map((part, i) => {
        const last = i === parts.length - 1;
        if (part === "**") return last ? starStarPatLast : starStarPat;
        if (part === "*") return last ? starPatLast : starPat;
        if (part.indexOf("*.") === 0) {
          return substitution + escapeRegExp(part.slice(1)) + (last ? endSep : sep);
        }
        return escapeRegExp(part) + (last ? endSep : sep);
      })].join(""));
    }
  }
});

// node_modules/@babel/core/lib/config/printer.js
var require_printer2 = __commonJS({
  "node_modules/@babel/core/lib/config/printer.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.ConfigPrinter = exports2.ChainFormatter = void 0;
    function _gensync() {
      const data = require_gensync();
      _gensync = function() {
        return data;
      };
      return data;
    }
    var ChainFormatter = exports2.ChainFormatter = {
      Programmatic: 0,
      Config: 1
    };
    var Formatter = {
      title(type, callerName, filepath) {
        let title = "";
        if (type === ChainFormatter.Programmatic) {
          title = "programmatic options";
          if (callerName) {
            title += " from " + callerName;
          }
        } else {
          title = "config " + filepath;
        }
        return title;
      },
      loc(index, envName) {
        let loc = "";
        if (index != null) {
          loc += `.overrides[${index}]`;
        }
        if (envName != null) {
          loc += `.env["${envName}"]`;
        }
        return loc;
      },
      *optionsAndDescriptors(opt) {
        const content = Object.assign({}, opt.options);
        delete content.overrides;
        delete content.env;
        const pluginDescriptors = [...yield* opt.plugins()];
        if (pluginDescriptors.length) {
          content.plugins = pluginDescriptors.map((d) => descriptorToConfig(d));
        }
        const presetDescriptors = [...yield* opt.presets()];
        if (presetDescriptors.length) {
          content.presets = [...presetDescriptors].map((d) => descriptorToConfig(d));
        }
        return JSON.stringify(content, void 0, 2);
      }
    };
    function descriptorToConfig(d) {
      var _d$file;
      let name = (_d$file = d.file) == null ? void 0 : _d$file.request;
      if (name == null) {
        if (typeof d.value === "object") {
          name = d.value;
        } else if (typeof d.value === "function") {
          name = `[Function: ${d.value.toString().slice(0, 50)} ... ]`;
        }
      }
      if (name == null) {
        name = "[Unknown]";
      }
      if (d.options === void 0) {
        return name;
      } else if (d.name == null) {
        return [name, d.options];
      } else {
        return [name, d.options, d.name];
      }
    }
    var ConfigPrinter = class _ConfigPrinter {
      constructor() {
        this._stack = [];
      }
      configure(enabled, type, {
        callerName,
        filepath
      }) {
        if (!enabled) return () => {
        };
        return (content, index, envName) => {
          this._stack.push({
            type,
            callerName,
            filepath,
            content,
            index,
            envName
          });
        };
      }
      static *format(config) {
        let title = Formatter.title(config.type, config.callerName, config.filepath);
        const loc = Formatter.loc(config.index, config.envName);
        if (loc) title += ` ${loc}`;
        const content = yield* Formatter.optionsAndDescriptors(config.content);
        return `${title}
${content}`;
      }
      *output() {
        if (this._stack.length === 0) return "";
        const configs = yield* _gensync().all(this._stack.map((s) => _ConfigPrinter.format(s)));
        return configs.join("\n\n");
      }
    };
    exports2.ConfigPrinter = ConfigPrinter;
  }
});

// node_modules/@babel/core/lib/config/config-chain.js
var require_config_chain = __commonJS({
  "node_modules/@babel/core/lib/config/config-chain.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.buildPresetChain = buildPresetChain;
    exports2.buildPresetChainWalker = void 0;
    exports2.buildRootChain = buildRootChain;
    function _path() {
      const data = require("path");
      _path = function() {
        return data;
      };
      return data;
    }
    function _debug() {
      const data = require_src();
      _debug = function() {
        return data;
      };
      return data;
    }
    var _options = require_options3();
    var _patternToRegex = require_pattern_to_regex();
    var _printer = require_printer2();
    var _rewriteStackTrace = require_rewrite_stack_trace();
    var _configError = require_config_error();
    var _index = require_files();
    var _caching = require_caching();
    var _configDescriptors = require_config_descriptors();
    var debug = _debug()("babel:config:config-chain");
    function* buildPresetChain(arg, context) {
      const chain = yield* buildPresetChainWalker(arg, context);
      if (!chain) return null;
      return {
        plugins: dedupDescriptors(chain.plugins),
        presets: dedupDescriptors(chain.presets),
        options: chain.options.map((o) => normalizeOptions(o)),
        files: /* @__PURE__ */ new Set()
      };
    }
    var buildPresetChainWalker = exports2.buildPresetChainWalker = makeChainWalker({
      root: (preset) => loadPresetDescriptors(preset),
      env: (preset, envName) => loadPresetEnvDescriptors(preset)(envName),
      overrides: (preset, index) => loadPresetOverridesDescriptors(preset)(index),
      overridesEnv: (preset, index, envName) => loadPresetOverridesEnvDescriptors(preset)(index)(envName),
      createLogger: () => () => {
      }
    });
    var loadPresetDescriptors = (0, _caching.makeWeakCacheSync)((preset) => buildRootDescriptors(preset, preset.alias, _configDescriptors.createUncachedDescriptors));
    var loadPresetEnvDescriptors = (0, _caching.makeWeakCacheSync)((preset) => (0, _caching.makeStrongCacheSync)((envName) => buildEnvDescriptors(preset, preset.alias, _configDescriptors.createUncachedDescriptors, envName)));
    var loadPresetOverridesDescriptors = (0, _caching.makeWeakCacheSync)((preset) => (0, _caching.makeStrongCacheSync)((index) => buildOverrideDescriptors(preset, preset.alias, _configDescriptors.createUncachedDescriptors, index)));
    var loadPresetOverridesEnvDescriptors = (0, _caching.makeWeakCacheSync)((preset) => (0, _caching.makeStrongCacheSync)((index) => (0, _caching.makeStrongCacheSync)((envName) => buildOverrideEnvDescriptors(preset, preset.alias, _configDescriptors.createUncachedDescriptors, index, envName))));
    function* buildRootChain(opts, context) {
      let configReport, babelRcReport;
      const programmaticLogger = new _printer.ConfigPrinter();
      const programmaticChain = yield* loadProgrammaticChain({
        options: opts,
        dirname: context.cwd
      }, context, void 0, programmaticLogger);
      if (!programmaticChain) return null;
      const programmaticReport = yield* programmaticLogger.output();
      let configFile;
      if (typeof opts.configFile === "string") {
        configFile = yield* (0, _index.loadConfig)(opts.configFile, context.cwd, context.envName, context.caller);
      } else if (opts.configFile !== false) {
        configFile = yield* (0, _index.findRootConfig)(context.root, context.envName, context.caller);
      }
      let {
        babelrc,
        babelrcRoots
      } = opts;
      let babelrcRootsDirectory = context.cwd;
      const configFileChain = emptyChain();
      const configFileLogger = new _printer.ConfigPrinter();
      if (configFile) {
        const validatedFile = validateConfigFile(configFile);
        const result = yield* loadFileChain(validatedFile, context, void 0, configFileLogger);
        if (!result) return null;
        configReport = yield* configFileLogger.output();
        if (babelrc === void 0) {
          babelrc = validatedFile.options.babelrc;
        }
        if (babelrcRoots === void 0) {
          babelrcRootsDirectory = validatedFile.dirname;
          babelrcRoots = validatedFile.options.babelrcRoots;
        }
        mergeChain(configFileChain, result);
      }
      let ignoreFile, babelrcFile;
      let isIgnored = false;
      const fileChain = emptyChain();
      if ((babelrc === true || babelrc === void 0) && typeof context.filename === "string") {
        const pkgData = yield* (0, _index.findPackageData)(context.filename);
        if (pkgData && babelrcLoadEnabled(context, pkgData, babelrcRoots, babelrcRootsDirectory)) {
          ({
            ignore: ignoreFile,
            config: babelrcFile
          } = yield* (0, _index.findRelativeConfig)(pkgData, context.envName, context.caller));
          if (ignoreFile) {
            fileChain.files.add(ignoreFile.filepath);
          }
          if (ignoreFile && shouldIgnore(context, ignoreFile.ignore, null, ignoreFile.dirname)) {
            isIgnored = true;
          }
          if (babelrcFile && !isIgnored) {
            const validatedFile = validateBabelrcFile(babelrcFile);
            const babelrcLogger = new _printer.ConfigPrinter();
            const result = yield* loadFileChain(validatedFile, context, void 0, babelrcLogger);
            if (!result) {
              isIgnored = true;
            } else {
              babelRcReport = yield* babelrcLogger.output();
              mergeChain(fileChain, result);
            }
          }
          if (babelrcFile && isIgnored) {
            fileChain.files.add(babelrcFile.filepath);
          }
        }
      }
      if (context.showConfig) {
        console.log(`Babel configs on "${context.filename}" (ascending priority):
` + [configReport, babelRcReport, programmaticReport].filter((x) => !!x).join("\n\n") + "\n-----End Babel configs-----");
      }
      const chain = mergeChain(mergeChain(mergeChain(emptyChain(), configFileChain), fileChain), programmaticChain);
      return {
        plugins: isIgnored ? [] : dedupDescriptors(chain.plugins),
        presets: isIgnored ? [] : dedupDescriptors(chain.presets),
        options: isIgnored ? [] : chain.options.map((o) => normalizeOptions(o)),
        fileHandling: isIgnored ? "ignored" : "transpile",
        ignore: ignoreFile || void 0,
        babelrc: babelrcFile || void 0,
        config: configFile || void 0,
        files: chain.files
      };
    }
    function babelrcLoadEnabled(context, pkgData, babelrcRoots, babelrcRootsDirectory) {
      if (typeof babelrcRoots === "boolean") return babelrcRoots;
      const absoluteRoot = context.root;
      if (babelrcRoots === void 0) {
        return pkgData.directories.includes(absoluteRoot);
      }
      let babelrcPatterns = babelrcRoots;
      if (!Array.isArray(babelrcPatterns)) {
        babelrcPatterns = [babelrcPatterns];
      }
      babelrcPatterns = babelrcPatterns.map((pat) => {
        return typeof pat === "string" ? _path().resolve(babelrcRootsDirectory, pat) : pat;
      });
      if (babelrcPatterns.length === 1 && babelrcPatterns[0] === absoluteRoot) {
        return pkgData.directories.includes(absoluteRoot);
      }
      return babelrcPatterns.some((pat) => {
        if (typeof pat === "string") {
          pat = (0, _patternToRegex.default)(pat, babelrcRootsDirectory);
        }
        return pkgData.directories.some((directory) => {
          return matchPattern(pat, babelrcRootsDirectory, directory, context);
        });
      });
    }
    var validateConfigFile = (0, _caching.makeWeakCacheSync)((file) => ({
      filepath: file.filepath,
      dirname: file.dirname,
      options: (0, _options.validate)("configfile", file.options, file.filepath)
    }));
    var validateBabelrcFile = (0, _caching.makeWeakCacheSync)((file) => ({
      filepath: file.filepath,
      dirname: file.dirname,
      options: (0, _options.validate)("babelrcfile", file.options, file.filepath)
    }));
    var validateExtendFile = (0, _caching.makeWeakCacheSync)((file) => ({
      filepath: file.filepath,
      dirname: file.dirname,
      options: (0, _options.validate)("extendsfile", file.options, file.filepath)
    }));
    var loadProgrammaticChain = makeChainWalker({
      root: (input) => buildRootDescriptors(input, "base", _configDescriptors.createCachedDescriptors),
      env: (input, envName) => buildEnvDescriptors(input, "base", _configDescriptors.createCachedDescriptors, envName),
      overrides: (input, index) => buildOverrideDescriptors(input, "base", _configDescriptors.createCachedDescriptors, index),
      overridesEnv: (input, index, envName) => buildOverrideEnvDescriptors(input, "base", _configDescriptors.createCachedDescriptors, index, envName),
      createLogger: (input, context, baseLogger) => buildProgrammaticLogger(input, context, baseLogger)
    });
    var loadFileChainWalker = makeChainWalker({
      root: (file) => loadFileDescriptors(file),
      env: (file, envName) => loadFileEnvDescriptors(file)(envName),
      overrides: (file, index) => loadFileOverridesDescriptors(file)(index),
      overridesEnv: (file, index, envName) => loadFileOverridesEnvDescriptors(file)(index)(envName),
      createLogger: (file, context, baseLogger) => buildFileLogger(file.filepath, context, baseLogger)
    });
    function* loadFileChain(input, context, files, baseLogger) {
      const chain = yield* loadFileChainWalker(input, context, files, baseLogger);
      chain == null || chain.files.add(input.filepath);
      return chain;
    }
    var loadFileDescriptors = (0, _caching.makeWeakCacheSync)((file) => buildRootDescriptors(file, file.filepath, _configDescriptors.createUncachedDescriptors));
    var loadFileEnvDescriptors = (0, _caching.makeWeakCacheSync)((file) => (0, _caching.makeStrongCacheSync)((envName) => buildEnvDescriptors(file, file.filepath, _configDescriptors.createUncachedDescriptors, envName)));
    var loadFileOverridesDescriptors = (0, _caching.makeWeakCacheSync)((file) => (0, _caching.makeStrongCacheSync)((index) => buildOverrideDescriptors(file, file.filepath, _configDescriptors.createUncachedDescriptors, index)));
    var loadFileOverridesEnvDescriptors = (0, _caching.makeWeakCacheSync)((file) => (0, _caching.makeStrongCacheSync)((index) => (0, _caching.makeStrongCacheSync)((envName) => buildOverrideEnvDescriptors(file, file.filepath, _configDescriptors.createUncachedDescriptors, index, envName))));
    function buildFileLogger(filepath, context, baseLogger) {
      if (!baseLogger) {
        return () => {
        };
      }
      return baseLogger.configure(context.showConfig, _printer.ChainFormatter.Config, {
        filepath
      });
    }
    function buildRootDescriptors({
      dirname,
      options
    }, alias, descriptors) {
      return descriptors(dirname, options, alias);
    }
    function buildProgrammaticLogger(_, context, baseLogger) {
      var _context$caller;
      if (!baseLogger) {
        return () => {
        };
      }
      return baseLogger.configure(context.showConfig, _printer.ChainFormatter.Programmatic, {
        callerName: (_context$caller = context.caller) == null ? void 0 : _context$caller.name
      });
    }
    function buildEnvDescriptors({
      dirname,
      options
    }, alias, descriptors, envName) {
      var _options$env;
      const opts = (_options$env = options.env) == null ? void 0 : _options$env[envName];
      return opts ? descriptors(dirname, opts, `${alias}.env["${envName}"]`) : null;
    }
    function buildOverrideDescriptors({
      dirname,
      options
    }, alias, descriptors, index) {
      var _options$overrides;
      const opts = (_options$overrides = options.overrides) == null ? void 0 : _options$overrides[index];
      if (!opts) throw new Error("Assertion failure - missing override");
      return descriptors(dirname, opts, `${alias}.overrides[${index}]`);
    }
    function buildOverrideEnvDescriptors({
      dirname,
      options
    }, alias, descriptors, index, envName) {
      var _options$overrides2, _override$env;
      const override = (_options$overrides2 = options.overrides) == null ? void 0 : _options$overrides2[index];
      if (!override) throw new Error("Assertion failure - missing override");
      const opts = (_override$env = override.env) == null ? void 0 : _override$env[envName];
      return opts ? descriptors(dirname, opts, `${alias}.overrides[${index}].env["${envName}"]`) : null;
    }
    function makeChainWalker({
      root,
      env,
      overrides,
      overridesEnv,
      createLogger
    }) {
      return function* chainWalker(input, context, files = /* @__PURE__ */ new Set(), baseLogger) {
        const {
          dirname
        } = input;
        const flattenedConfigs = [];
        const rootOpts = root(input);
        if (configIsApplicable(rootOpts, dirname, context, input.filepath)) {
          flattenedConfigs.push({
            config: rootOpts,
            envName: void 0,
            index: void 0
          });
          const envOpts = env(input, context.envName);
          if (envOpts && configIsApplicable(envOpts, dirname, context, input.filepath)) {
            flattenedConfigs.push({
              config: envOpts,
              envName: context.envName,
              index: void 0
            });
          }
          (rootOpts.options.overrides || []).forEach((_, index) => {
            const overrideOps = overrides(input, index);
            if (configIsApplicable(overrideOps, dirname, context, input.filepath)) {
              flattenedConfigs.push({
                config: overrideOps,
                index,
                envName: void 0
              });
              const overrideEnvOpts = overridesEnv(input, index, context.envName);
              if (overrideEnvOpts && configIsApplicable(overrideEnvOpts, dirname, context, input.filepath)) {
                flattenedConfigs.push({
                  config: overrideEnvOpts,
                  index,
                  envName: context.envName
                });
              }
            }
          });
        }
        if (flattenedConfigs.some(({
          config: {
            options: {
              ignore,
              only
            }
          }
        }) => shouldIgnore(context, ignore, only, dirname))) {
          return null;
        }
        const chain = emptyChain();
        const logger = createLogger(input, context, baseLogger);
        for (const {
          config,
          index,
          envName
        } of flattenedConfigs) {
          if (!(yield* mergeExtendsChain(chain, config.options, dirname, context, files, baseLogger))) {
            return null;
          }
          logger(config, index, envName);
          yield* mergeChainOpts(chain, config);
        }
        return chain;
      };
    }
    function* mergeExtendsChain(chain, opts, dirname, context, files, baseLogger) {
      if (opts.extends === void 0) return true;
      const file = yield* (0, _index.loadConfig)(opts.extends, dirname, context.envName, context.caller);
      if (files.has(file)) {
        throw new Error(`Configuration cycle detected loading ${file.filepath}.
File already loaded following the config chain:
` + Array.from(files, (file2) => ` - ${file2.filepath}`).join("\n"));
      }
      files.add(file);
      const fileChain = yield* loadFileChain(validateExtendFile(file), context, files, baseLogger);
      files.delete(file);
      if (!fileChain) return false;
      mergeChain(chain, fileChain);
      return true;
    }
    function mergeChain(target, source) {
      target.options.push(...source.options);
      target.plugins.push(...source.plugins);
      target.presets.push(...source.presets);
      for (const file of source.files) {
        target.files.add(file);
      }
      return target;
    }
    function* mergeChainOpts(target, {
      options,
      plugins,
      presets
    }) {
      target.options.push(options);
      target.plugins.push(...yield* plugins());
      target.presets.push(...yield* presets());
      return target;
    }
    function emptyChain() {
      return {
        options: [],
        presets: [],
        plugins: [],
        files: /* @__PURE__ */ new Set()
      };
    }
    function normalizeOptions(opts) {
      const options = Object.assign({}, opts);
      delete options.extends;
      delete options.env;
      delete options.overrides;
      delete options.plugins;
      delete options.presets;
      delete options.passPerPreset;
      delete options.ignore;
      delete options.only;
      delete options.test;
      delete options.include;
      delete options.exclude;
      if (hasOwnProperty.call(options, "sourceMap")) {
        options.sourceMaps = options.sourceMap;
        delete options.sourceMap;
      }
      return options;
    }
    function dedupDescriptors(items) {
      const map = /* @__PURE__ */ new Map();
      const descriptors = [];
      for (const item of items) {
        if (typeof item.value === "function") {
          const fnKey = item.value;
          let nameMap = map.get(fnKey);
          if (!nameMap) {
            nameMap = /* @__PURE__ */ new Map();
            map.set(fnKey, nameMap);
          }
          let desc = nameMap.get(item.name);
          if (!desc) {
            desc = {
              value: item
            };
            descriptors.push(desc);
            if (!item.ownPass) nameMap.set(item.name, desc);
          } else {
            desc.value = item;
          }
        } else {
          descriptors.push({
            value: item
          });
        }
      }
      return descriptors.reduce((acc, desc) => {
        acc.push(desc.value);
        return acc;
      }, []);
    }
    function configIsApplicable({
      options
    }, dirname, context, configName) {
      return (options.test === void 0 || configFieldIsApplicable(context, options.test, dirname, configName)) && (options.include === void 0 || configFieldIsApplicable(context, options.include, dirname, configName)) && (options.exclude === void 0 || !configFieldIsApplicable(context, options.exclude, dirname, configName));
    }
    function configFieldIsApplicable(context, test, dirname, configName) {
      const patterns = Array.isArray(test) ? test : [test];
      return matchesPatterns(context, patterns, dirname, configName);
    }
    function ignoreListReplacer(_key, value2) {
      if (value2 instanceof RegExp) {
        return String(value2);
      }
      return value2;
    }
    function shouldIgnore(context, ignore, only, dirname) {
      if (ignore && matchesPatterns(context, ignore, dirname)) {
        var _context$filename;
        const message = `No config is applied to "${(_context$filename = context.filename) != null ? _context$filename : "(unknown)"}" because it matches one of \`ignore: ${JSON.stringify(ignore, ignoreListReplacer)}\` from "${dirname}"`;
        debug(message);
        if (context.showConfig) {
          console.log(message);
        }
        return true;
      }
      if (only && !matchesPatterns(context, only, dirname)) {
        var _context$filename2;
        const message = `No config is applied to "${(_context$filename2 = context.filename) != null ? _context$filename2 : "(unknown)"}" because it fails to match one of \`only: ${JSON.stringify(only, ignoreListReplacer)}\` from "${dirname}"`;
        debug(message);
        if (context.showConfig) {
          console.log(message);
        }
        return true;
      }
      return false;
    }
    function matchesPatterns(context, patterns, dirname, configName) {
      return patterns.some((pattern) => matchPattern(pattern, dirname, context.filename, context, configName));
    }
    function matchPattern(pattern, dirname, pathToTest, context, configName) {
      if (typeof pattern === "function") {
        return !!(0, _rewriteStackTrace.endHiddenCallStack)(pattern)(pathToTest, {
          dirname,
          envName: context.envName,
          caller: context.caller
        });
      }
      if (typeof pathToTest !== "string") {
        throw new _configError.default(`Configuration contains string/RegExp pattern, but no filename was passed to Babel`, configName);
      }
      if (typeof pattern === "string") {
        pattern = (0, _patternToRegex.default)(pattern, dirname);
      }
      return pattern.test(pathToTest);
    }
  }
});

// node_modules/@babel/core/lib/config/validation/plugins.js
var require_plugins3 = __commonJS({
  "node_modules/@babel/core/lib/config/validation/plugins.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.validatePluginObject = validatePluginObject;
    var _optionAssertions = require_option_assertions();
    var VALIDATORS = {
      name: _optionAssertions.assertString,
      manipulateOptions: _optionAssertions.assertFunction,
      pre: _optionAssertions.assertFunction,
      post: _optionAssertions.assertFunction,
      inherits: _optionAssertions.assertFunction,
      visitor: assertVisitorMap,
      parserOverride: _optionAssertions.assertFunction,
      generatorOverride: _optionAssertions.assertFunction
    };
    function assertVisitorMap(loc, value2) {
      const obj = (0, _optionAssertions.assertObject)(loc, value2);
      if (obj) {
        Object.keys(obj).forEach((prop) => {
          if (prop !== "_exploded" && prop !== "_verified") {
            assertVisitorHandler(prop, obj[prop]);
          }
        });
        if (obj.enter || obj.exit) {
          throw new Error(`${(0, _optionAssertions.msg)(loc)} cannot contain catch-all "enter" or "exit" handlers. Please target individual nodes.`);
        }
      }
      return obj;
    }
    function assertVisitorHandler(key, value2) {
      if (value2 && typeof value2 === "object") {
        Object.keys(value2).forEach((handler) => {
          if (handler !== "enter" && handler !== "exit") {
            throw new Error(`.visitor["${key}"] may only have .enter and/or .exit handlers.`);
          }
        });
      } else if (typeof value2 !== "function") {
        throw new Error(`.visitor["${key}"] must be a function`);
      }
    }
    function validatePluginObject(obj) {
      const rootPath = {
        type: "root",
        source: "plugin"
      };
      Object.keys(obj).forEach((key) => {
        const validator = VALIDATORS[key];
        if (validator) {
          const optLoc = {
            type: "option",
            name: key,
            parent: rootPath
          };
          validator(optLoc, obj[key]);
        } else {
          const invalidPluginPropertyError = new Error(`.${key} is not a valid Plugin property`);
          invalidPluginPropertyError.code = "BABEL_UNKNOWN_PLUGIN_PROPERTY";
          throw invalidPluginPropertyError;
        }
      });
      return obj;
    }
  }
});

// node_modules/@babel/core/lib/config/helpers/environment.js
var require_environment = __commonJS({
  "node_modules/@babel/core/lib/config/helpers/environment.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.getEnv = getEnv;
    function getEnv(defaultValue = "development") {
      return process.env.BABEL_ENV || process.env.NODE_ENV || defaultValue;
    }
  }
});

// node_modules/@babel/core/lib/config/partial.js
var require_partial = __commonJS({
  "node_modules/@babel/core/lib/config/partial.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = loadPrivatePartialConfig;
    exports2.loadPartialConfig = loadPartialConfig;
    function _path() {
      const data = require("path");
      _path = function() {
        return data;
      };
      return data;
    }
    var _plugin = require_plugin();
    var _util = require_util2();
    var _item = require_item();
    var _configChain = require_config_chain();
    var _environment = require_environment();
    var _options = require_options3();
    var _index = require_files();
    var _resolveTargets = require_resolve_targets();
    var _excluded = ["showIgnoredFiles"];
    function _objectWithoutPropertiesLoose(r, e) {
      if (null == r) return {};
      var t = {};
      for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
        if (-1 !== e.indexOf(n)) continue;
        t[n] = r[n];
      }
      return t;
    }
    function resolveRootMode(rootDir, rootMode) {
      switch (rootMode) {
        case "root":
          return rootDir;
        case "upward-optional": {
          const upwardRootDir = (0, _index.findConfigUpwards)(rootDir);
          return upwardRootDir === null ? rootDir : upwardRootDir;
        }
        case "upward": {
          const upwardRootDir = (0, _index.findConfigUpwards)(rootDir);
          if (upwardRootDir !== null) return upwardRootDir;
          throw Object.assign(new Error(`Babel was run with rootMode:"upward" but a root could not be found when searching upward from "${rootDir}".
One of the following config files must be in the directory tree: "${_index.ROOT_CONFIG_FILENAMES.join(", ")}".`), {
            code: "BABEL_ROOT_NOT_FOUND",
            dirname: rootDir
          });
        }
        default:
          throw new Error(`Assertion failure - unknown rootMode value.`);
      }
    }
    function* loadPrivatePartialConfig(inputOpts) {
      if (inputOpts != null && (typeof inputOpts !== "object" || Array.isArray(inputOpts))) {
        throw new Error("Babel options must be an object, null, or undefined");
      }
      const args = inputOpts ? (0, _options.validate)("arguments", inputOpts) : {};
      const {
        envName = (0, _environment.getEnv)(),
        cwd = ".",
        root: rootDir = ".",
        rootMode = "root",
        caller,
        cloneInputAst = true
      } = args;
      const absoluteCwd = _path().resolve(cwd);
      const absoluteRootDir = resolveRootMode(_path().resolve(absoluteCwd, rootDir), rootMode);
      const filename = typeof args.filename === "string" ? _path().resolve(cwd, args.filename) : void 0;
      const showConfigPath = yield* (0, _index.resolveShowConfigPath)(absoluteCwd);
      const context = {
        filename,
        cwd: absoluteCwd,
        root: absoluteRootDir,
        envName,
        caller,
        showConfig: showConfigPath === filename
      };
      const configChain = yield* (0, _configChain.buildRootChain)(args, context);
      if (!configChain) return null;
      const merged = {
        assumptions: {}
      };
      configChain.options.forEach((opts) => {
        (0, _util.mergeOptions)(merged, opts);
      });
      const options = Object.assign({}, merged, {
        targets: (0, _resolveTargets.resolveTargets)(merged, absoluteRootDir),
        cloneInputAst,
        babelrc: false,
        configFile: false,
        browserslistConfigFile: false,
        passPerPreset: false,
        envName: context.envName,
        cwd: context.cwd,
        root: context.root,
        rootMode: "root",
        filename: typeof context.filename === "string" ? context.filename : void 0,
        plugins: configChain.plugins.map((descriptor) => (0, _item.createItemFromDescriptor)(descriptor)),
        presets: configChain.presets.map((descriptor) => (0, _item.createItemFromDescriptor)(descriptor))
      });
      return {
        options,
        context,
        fileHandling: configChain.fileHandling,
        ignore: configChain.ignore,
        babelrc: configChain.babelrc,
        config: configChain.config,
        files: configChain.files
      };
    }
    function* loadPartialConfig(opts) {
      let showIgnoredFiles = false;
      if (typeof opts === "object" && opts !== null && !Array.isArray(opts)) {
        var _opts = opts;
        ({
          showIgnoredFiles
        } = _opts);
        opts = _objectWithoutPropertiesLoose(_opts, _excluded);
        _opts;
      }
      const result = yield* loadPrivatePartialConfig(opts);
      if (!result) return null;
      const {
        options,
        babelrc,
        ignore,
        config,
        fileHandling,
        files
      } = result;
      if (fileHandling === "ignored" && !showIgnoredFiles) {
        return null;
      }
      (options.plugins || []).forEach((item) => {
        if (item.value instanceof _plugin.default) {
          throw new Error("Passing cached plugin instances is not supported in babel.loadPartialConfig()");
        }
      });
      return new PartialConfig(options, babelrc ? babelrc.filepath : void 0, ignore ? ignore.filepath : void 0, config ? config.filepath : void 0, fileHandling, files);
    }
    var PartialConfig = class {
      constructor(options, babelrc, ignore, config, fileHandling, files) {
        this.options = void 0;
        this.babelrc = void 0;
        this.babelignore = void 0;
        this.config = void 0;
        this.fileHandling = void 0;
        this.files = void 0;
        this.options = options;
        this.babelignore = ignore;
        this.babelrc = babelrc;
        this.config = config;
        this.fileHandling = fileHandling;
        this.files = files;
        Object.freeze(this);
      }
      hasFilesystemConfig() {
        return this.babelrc !== void 0 || this.config !== void 0;
      }
    };
    Object.freeze(PartialConfig.prototype);
  }
});

// node_modules/@babel/core/lib/config/full.js
var require_full = __commonJS({
  "node_modules/@babel/core/lib/config/full.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = void 0;
    function _gensync() {
      const data = require_gensync();
      _gensync = function() {
        return data;
      };
      return data;
    }
    var _async = require_async();
    var _util = require_util2();
    var context = require_lib27();
    var _plugin = require_plugin();
    var _item = require_item();
    var _configChain = require_config_chain();
    var _deepArray = require_deep_array();
    function _traverse() {
      const data = require_lib9();
      _traverse = function() {
        return data;
      };
      return data;
    }
    var _caching = require_caching();
    var _options = require_options3();
    var _plugins = require_plugins3();
    var _configApi = require_config_api();
    var _partial = require_partial();
    var _configError = require_config_error();
    var _default = exports2.default = _gensync()(function* loadFullConfig(inputOpts) {
      var _opts$assumptions;
      const result = yield* (0, _partial.default)(inputOpts);
      if (!result) {
        return null;
      }
      const {
        options,
        context: context2,
        fileHandling
      } = result;
      if (fileHandling === "ignored") {
        return null;
      }
      const optionDefaults = {};
      const {
        plugins,
        presets
      } = options;
      if (!plugins || !presets) {
        throw new Error("Assertion failure - plugins and presets exist");
      }
      const presetContext = Object.assign({}, context2, {
        targets: options.targets
      });
      const toDescriptor = (item) => {
        const desc = (0, _item.getItemDescriptor)(item);
        if (!desc) {
          throw new Error("Assertion failure - must be config item");
        }
        return desc;
      };
      const presetsDescriptors = presets.map(toDescriptor);
      const initialPluginsDescriptors = plugins.map(toDescriptor);
      const pluginDescriptorsByPass = [[]];
      const passes = [];
      const externalDependencies = [];
      const ignored = yield* enhanceError(context2, function* recursePresetDescriptors(rawPresets, pluginDescriptorsPass) {
        const presets2 = [];
        for (let i = 0; i < rawPresets.length; i++) {
          const descriptor = rawPresets[i];
          if (descriptor.options !== false) {
            try {
              var preset = yield* loadPresetDescriptor(descriptor, presetContext);
            } catch (e) {
              if (e.code === "BABEL_UNKNOWN_OPTION") {
                (0, _options.checkNoUnwrappedItemOptionPairs)(rawPresets, i, "preset", e);
              }
              throw e;
            }
            externalDependencies.push(preset.externalDependencies);
            if (descriptor.ownPass) {
              presets2.push({
                preset: preset.chain,
                pass: []
              });
            } else {
              presets2.unshift({
                preset: preset.chain,
                pass: pluginDescriptorsPass
              });
            }
          }
        }
        if (presets2.length > 0) {
          pluginDescriptorsByPass.splice(1, 0, ...presets2.map((o) => o.pass).filter((p) => p !== pluginDescriptorsPass));
          for (const {
            preset: preset2,
            pass
          } of presets2) {
            if (!preset2) return true;
            pass.push(...preset2.plugins);
            const ignored2 = yield* recursePresetDescriptors(preset2.presets, pass);
            if (ignored2) return true;
            preset2.options.forEach((opts2) => {
              (0, _util.mergeOptions)(optionDefaults, opts2);
            });
          }
        }
      })(presetsDescriptors, pluginDescriptorsByPass[0]);
      if (ignored) return null;
      const opts = optionDefaults;
      (0, _util.mergeOptions)(opts, options);
      const pluginContext = Object.assign({}, presetContext, {
        assumptions: (_opts$assumptions = opts.assumptions) != null ? _opts$assumptions : {}
      });
      yield* enhanceError(context2, function* loadPluginDescriptors() {
        pluginDescriptorsByPass[0].unshift(...initialPluginsDescriptors);
        for (const descs of pluginDescriptorsByPass) {
          const pass = [];
          passes.push(pass);
          for (let i = 0; i < descs.length; i++) {
            const descriptor = descs[i];
            if (descriptor.options !== false) {
              try {
                var plugin = yield* loadPluginDescriptor(descriptor, pluginContext);
              } catch (e) {
                if (e.code === "BABEL_UNKNOWN_PLUGIN_PROPERTY") {
                  (0, _options.checkNoUnwrappedItemOptionPairs)(descs, i, "plugin", e);
                }
                throw e;
              }
              pass.push(plugin);
              externalDependencies.push(plugin.externalDependencies);
            }
          }
        }
      })();
      opts.plugins = passes[0];
      opts.presets = passes.slice(1).filter((plugins2) => plugins2.length > 0).map((plugins2) => ({
        plugins: plugins2
      }));
      opts.passPerPreset = opts.presets.length > 0;
      return {
        options: opts,
        passes,
        externalDependencies: (0, _deepArray.finalize)(externalDependencies)
      };
    });
    function enhanceError(context2, fn) {
      return function* (arg1, arg2) {
        try {
          return yield* fn(arg1, arg2);
        } catch (e) {
          if (!/^\[BABEL\]/.test(e.message)) {
            var _context$filename;
            e.message = `[BABEL] ${(_context$filename = context2.filename) != null ? _context$filename : "unknown file"}: ${e.message}`;
          }
          throw e;
        }
      };
    }
    var makeDescriptorLoader = (apiFactory) => (0, _caching.makeWeakCache)(function* ({
      value: value2,
      options,
      dirname,
      alias
    }, cache) {
      if (options === false) throw new Error("Assertion failure");
      options = options || {};
      const externalDependencies = [];
      let item = value2;
      if (typeof value2 === "function") {
        const factory = (0, _async.maybeAsync)(value2, `You appear to be using an async plugin/preset, but Babel has been called synchronously`);
        const api = Object.assign({}, context, apiFactory(cache, externalDependencies));
        try {
          item = yield* factory(api, options, dirname);
        } catch (e) {
          if (alias) {
            e.message += ` (While processing: ${JSON.stringify(alias)})`;
          }
          throw e;
        }
      }
      if (!item || typeof item !== "object") {
        throw new Error("Plugin/Preset did not return an object.");
      }
      if ((0, _async.isThenable)(item)) {
        yield* [];
        throw new Error(`You appear to be using a promise as a plugin, which your current version of Babel does not support. If you're using a published plugin, you may need to upgrade your @babel/core version. As an alternative, you can prefix the promise with "await". (While processing: ${JSON.stringify(alias)})`);
      }
      if (externalDependencies.length > 0 && (!cache.configured() || cache.mode() === "forever")) {
        let error = `A plugin/preset has external untracked dependencies (${externalDependencies[0]}), but the cache `;
        if (!cache.configured()) {
          error += `has not been configured to be invalidated when the external dependencies change. `;
        } else {
          error += ` has been configured to never be invalidated. `;
        }
        error += `Plugins/presets should configure their cache to be invalidated when the external dependencies change, for example using \`api.cache.invalidate(() => statSync(filepath).mtimeMs)\` or \`api.cache.never()\`
(While processing: ${JSON.stringify(alias)})`;
        throw new Error(error);
      }
      return {
        value: item,
        options,
        dirname,
        alias,
        externalDependencies: (0, _deepArray.finalize)(externalDependencies)
      };
    });
    var pluginDescriptorLoader = makeDescriptorLoader(_configApi.makePluginAPI);
    var presetDescriptorLoader = makeDescriptorLoader(_configApi.makePresetAPI);
    var instantiatePlugin = (0, _caching.makeWeakCache)(function* ({
      value: value2,
      options,
      dirname,
      alias,
      externalDependencies
    }, cache) {
      const pluginObj = (0, _plugins.validatePluginObject)(value2);
      const plugin = Object.assign({}, pluginObj);
      if (plugin.visitor) {
        plugin.visitor = _traverse().default.explode(Object.assign({}, plugin.visitor));
      }
      if (plugin.inherits) {
        const inheritsDescriptor = {
          name: void 0,
          alias: `${alias}$inherits`,
          value: plugin.inherits,
          options,
          dirname
        };
        const inherits = yield* (0, _async.forwardAsync)(loadPluginDescriptor, (run) => {
          return cache.invalidate((data) => run(inheritsDescriptor, data));
        });
        plugin.pre = chainMaybeAsync(inherits.pre, plugin.pre);
        plugin.post = chainMaybeAsync(inherits.post, plugin.post);
        plugin.manipulateOptions = chainMaybeAsync(inherits.manipulateOptions, plugin.manipulateOptions);
        plugin.visitor = _traverse().default.visitors.merge([inherits.visitor || {}, plugin.visitor || {}]);
        if (inherits.externalDependencies.length > 0) {
          if (externalDependencies.length === 0) {
            externalDependencies = inherits.externalDependencies;
          } else {
            externalDependencies = (0, _deepArray.finalize)([externalDependencies, inherits.externalDependencies]);
          }
        }
      }
      return new _plugin.default(plugin, options, alias, externalDependencies);
    });
    function* loadPluginDescriptor(descriptor, context2) {
      if (descriptor.value instanceof _plugin.default) {
        if (descriptor.options) {
          throw new Error("Passed options to an existing Plugin instance will not work.");
        }
        return descriptor.value;
      }
      return yield* instantiatePlugin(yield* pluginDescriptorLoader(descriptor, context2), context2);
    }
    var needsFilename = (val) => val && typeof val !== "function";
    var validateIfOptionNeedsFilename = (options, descriptor) => {
      if (needsFilename(options.test) || needsFilename(options.include) || needsFilename(options.exclude)) {
        const formattedPresetName = descriptor.name ? `"${descriptor.name}"` : "/* your preset */";
        throw new _configError.default([`Preset ${formattedPresetName} requires a filename to be set when babel is called directly,`, `\`\`\``, `babel.transformSync(code, { filename: 'file.ts', presets: [${formattedPresetName}] });`, `\`\`\``, `See https://babeljs.io/docs/en/options#filename for more information.`].join("\n"));
      }
    };
    var validatePreset = (preset, context2, descriptor) => {
      if (!context2.filename) {
        var _options$overrides;
        const {
          options
        } = preset;
        validateIfOptionNeedsFilename(options, descriptor);
        (_options$overrides = options.overrides) == null || _options$overrides.forEach((overrideOptions) => validateIfOptionNeedsFilename(overrideOptions, descriptor));
      }
    };
    var instantiatePreset = (0, _caching.makeWeakCacheSync)(({
      value: value2,
      dirname,
      alias,
      externalDependencies
    }) => {
      return {
        options: (0, _options.validate)("preset", value2),
        alias,
        dirname,
        externalDependencies
      };
    });
    function* loadPresetDescriptor(descriptor, context2) {
      const preset = instantiatePreset(yield* presetDescriptorLoader(descriptor, context2));
      validatePreset(preset, context2, descriptor);
      return {
        chain: yield* (0, _configChain.buildPresetChain)(preset, context2),
        externalDependencies: preset.externalDependencies
      };
    }
    function chainMaybeAsync(a, b) {
      if (!a) return b;
      if (!b) return a;
      return function(...args) {
        const res = a.apply(this, args);
        if (res && typeof res.then === "function") {
          return res.then(() => b.apply(this, args));
        }
        return b.apply(this, args);
      };
    }
  }
});

// node_modules/@babel/core/lib/config/index.js
var require_config = __commonJS({
  "node_modules/@babel/core/lib/config/index.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.createConfigItem = createConfigItem;
    exports2.createConfigItemAsync = createConfigItemAsync;
    exports2.createConfigItemSync = createConfigItemSync;
    Object.defineProperty(exports2, "default", {
      enumerable: true,
      get: function() {
        return _full.default;
      }
    });
    exports2.loadOptions = loadOptions;
    exports2.loadOptionsAsync = loadOptionsAsync;
    exports2.loadOptionsSync = loadOptionsSync;
    exports2.loadPartialConfig = loadPartialConfig;
    exports2.loadPartialConfigAsync = loadPartialConfigAsync;
    exports2.loadPartialConfigSync = loadPartialConfigSync;
    function _gensync() {
      const data = require_gensync();
      _gensync = function() {
        return data;
      };
      return data;
    }
    var _full = require_full();
    var _partial = require_partial();
    var _item = require_item();
    var _rewriteStackTrace = require_rewrite_stack_trace();
    var loadPartialConfigRunner = _gensync()(_partial.loadPartialConfig);
    function loadPartialConfigAsync(...args) {
      return (0, _rewriteStackTrace.beginHiddenCallStack)(loadPartialConfigRunner.async)(...args);
    }
    function loadPartialConfigSync(...args) {
      return (0, _rewriteStackTrace.beginHiddenCallStack)(loadPartialConfigRunner.sync)(...args);
    }
    function loadPartialConfig(opts, callback) {
      if (callback !== void 0) {
        (0, _rewriteStackTrace.beginHiddenCallStack)(loadPartialConfigRunner.errback)(opts, callback);
      } else if (typeof opts === "function") {
        (0, _rewriteStackTrace.beginHiddenCallStack)(loadPartialConfigRunner.errback)(void 0, opts);
      } else {
        {
          return loadPartialConfigSync(opts);
        }
      }
    }
    function* loadOptionsImpl(opts) {
      var _config$options;
      const config = yield* (0, _full.default)(opts);
      return (_config$options = config == null ? void 0 : config.options) != null ? _config$options : null;
    }
    var loadOptionsRunner = _gensync()(loadOptionsImpl);
    function loadOptionsAsync(...args) {
      return (0, _rewriteStackTrace.beginHiddenCallStack)(loadOptionsRunner.async)(...args);
    }
    function loadOptionsSync(...args) {
      return (0, _rewriteStackTrace.beginHiddenCallStack)(loadOptionsRunner.sync)(...args);
    }
    function loadOptions(opts, callback) {
      if (callback !== void 0) {
        (0, _rewriteStackTrace.beginHiddenCallStack)(loadOptionsRunner.errback)(opts, callback);
      } else if (typeof opts === "function") {
        (0, _rewriteStackTrace.beginHiddenCallStack)(loadOptionsRunner.errback)(void 0, opts);
      } else {
        {
          return loadOptionsSync(opts);
        }
      }
    }
    var createConfigItemRunner = _gensync()(_item.createConfigItem);
    function createConfigItemAsync(...args) {
      return (0, _rewriteStackTrace.beginHiddenCallStack)(createConfigItemRunner.async)(...args);
    }
    function createConfigItemSync(...args) {
      return (0, _rewriteStackTrace.beginHiddenCallStack)(createConfigItemRunner.sync)(...args);
    }
    function createConfigItem(target, options, callback) {
      if (callback !== void 0) {
        (0, _rewriteStackTrace.beginHiddenCallStack)(createConfigItemRunner.errback)(target, options, callback);
      } else if (typeof options === "function") {
        (0, _rewriteStackTrace.beginHiddenCallStack)(createConfigItemRunner.errback)(target, void 0, callback);
      } else {
        {
          return createConfigItemSync(target, options);
        }
      }
    }
  }
});

// node_modules/@babel/core/lib/transformation/plugin-pass.js
var require_plugin_pass = __commonJS({
  "node_modules/@babel/core/lib/transformation/plugin-pass.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = void 0;
    var PluginPass = class {
      constructor(file, key, options, isAsync) {
        this._map = /* @__PURE__ */ new Map();
        this.key = void 0;
        this.file = void 0;
        this.opts = void 0;
        this.cwd = void 0;
        this.filename = void 0;
        this.isAsync = void 0;
        this.key = key;
        this.file = file;
        this.opts = options || {};
        this.cwd = file.opts.cwd;
        this.filename = file.opts.filename;
        this.isAsync = isAsync;
      }
      set(key, val) {
        this._map.set(key, val);
      }
      get(key) {
        return this._map.get(key);
      }
      availableHelper(name, versionRange) {
        return this.file.availableHelper(name, versionRange);
      }
      addHelper(name) {
        return this.file.addHelper(name);
      }
      buildCodeFrameError(node, msg, _Error) {
        return this.file.buildCodeFrameError(node, msg, _Error);
      }
    };
    exports2.default = PluginPass;
    {
      PluginPass.prototype.getModuleName = function getModuleName() {
        return this.file.getModuleName();
      };
      PluginPass.prototype.addImport = function addImport() {
        this.file.addImport();
      };
    }
  }
});

// node_modules/@babel/core/lib/transformation/block-hoist-plugin.js
var require_block_hoist_plugin = __commonJS({
  "node_modules/@babel/core/lib/transformation/block-hoist-plugin.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = loadBlockHoistPlugin;
    function _traverse() {
      const data = require_lib9();
      _traverse = function() {
        return data;
      };
      return data;
    }
    var _plugin = require_plugin();
    var LOADED_PLUGIN;
    var blockHoistPlugin = {
      name: "internal.blockHoist",
      visitor: {
        Block: {
          exit({
            node
          }) {
            node.body = performHoisting(node.body);
          }
        },
        SwitchCase: {
          exit({
            node
          }) {
            node.consequent = performHoisting(node.consequent);
          }
        }
      }
    };
    function performHoisting(body) {
      let max = Math.pow(2, 30) - 1;
      let hasChange = false;
      for (let i = 0; i < body.length; i++) {
        const n = body[i];
        const p = priority(n);
        if (p > max) {
          hasChange = true;
          break;
        }
        max = p;
      }
      if (!hasChange) return body;
      return stableSort(body.slice());
    }
    function loadBlockHoistPlugin() {
      if (!LOADED_PLUGIN) {
        LOADED_PLUGIN = new _plugin.default(Object.assign({}, blockHoistPlugin, {
          visitor: _traverse().default.explode(blockHoistPlugin.visitor)
        }), {});
      }
      return LOADED_PLUGIN;
    }
    function priority(bodyNode) {
      const priority2 = bodyNode == null ? void 0 : bodyNode._blockHoist;
      if (priority2 == null) return 1;
      if (priority2 === true) return 2;
      return priority2;
    }
    function stableSort(body) {
      const buckets = /* @__PURE__ */ Object.create(null);
      for (let i = 0; i < body.length; i++) {
        const n = body[i];
        const p = priority(n);
        const bucket = buckets[p] || (buckets[p] = []);
        bucket.push(n);
      }
      const keys = Object.keys(buckets).map((k) => +k).sort((a, b) => b - a);
      let index = 0;
      for (const key of keys) {
        const bucket = buckets[key];
        for (const n of bucket) {
          body[index++] = n;
        }
      }
      return body;
    }
  }
});

// node_modules/@babel/core/lib/transformation/normalize-opts.js
var require_normalize_opts = __commonJS({
  "node_modules/@babel/core/lib/transformation/normalize-opts.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = normalizeOptions;
    function _path() {
      const data = require("path");
      _path = function() {
        return data;
      };
      return data;
    }
    function normalizeOptions(config) {
      const {
        filename,
        cwd,
        filenameRelative = typeof filename === "string" ? _path().relative(cwd, filename) : "unknown",
        sourceType = "module",
        inputSourceMap,
        sourceMaps = !!inputSourceMap,
        sourceRoot = config.options.moduleRoot,
        sourceFileName = _path().basename(filenameRelative),
        comments = true,
        compact = "auto"
      } = config.options;
      const opts = config.options;
      const options = Object.assign({}, opts, {
        parserOpts: Object.assign({
          sourceType: _path().extname(filenameRelative) === ".mjs" ? "module" : sourceType,
          sourceFileName: filename,
          plugins: []
        }, opts.parserOpts),
        generatorOpts: Object.assign({
          filename,
          auxiliaryCommentBefore: opts.auxiliaryCommentBefore,
          auxiliaryCommentAfter: opts.auxiliaryCommentAfter,
          retainLines: opts.retainLines,
          comments,
          shouldPrintComment: opts.shouldPrintComment,
          compact,
          minified: opts.minified,
          sourceMaps,
          sourceRoot,
          sourceFileName
        }, opts.generatorOpts)
      });
      for (const plugins of config.passes) {
        for (const plugin of plugins) {
          if (plugin.manipulateOptions) {
            plugin.manipulateOptions(options, options.parserOpts);
          }
        }
      }
      return options;
    }
  }
});

// node_modules/convert-source-map/index.js
var require_convert_source_map = __commonJS({
  "node_modules/convert-source-map/index.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "commentRegex", {
      get: function getCommentRegex() {
        return /^\s*?\/[\/\*][@#]\s+?sourceMappingURL=data:(((?:application|text)\/json)(?:;charset=([^;,]+?)?)?)?(?:;(base64))?,(.*?)$/mg;
      }
    });
    Object.defineProperty(exports2, "mapFileCommentRegex", {
      get: function getMapFileCommentRegex() {
        return /(?:\/\/[@#][ \t]+?sourceMappingURL=([^\s'"`]+?)[ \t]*?$)|(?:\/\*[@#][ \t]+sourceMappingURL=([^*]+?)[ \t]*?(?:\*\/){1}[ \t]*?$)/mg;
      }
    });
    var decodeBase64;
    if (typeof Buffer !== "undefined") {
      if (typeof Buffer.from === "function") {
        decodeBase64 = decodeBase64WithBufferFrom;
      } else {
        decodeBase64 = decodeBase64WithNewBuffer;
      }
    } else {
      decodeBase64 = decodeBase64WithAtob;
    }
    function decodeBase64WithBufferFrom(base64) {
      return Buffer.from(base64, "base64").toString();
    }
    function decodeBase64WithNewBuffer(base64) {
      if (typeof value === "number") {
        throw new TypeError("The value to decode must not be of type number.");
      }
      return new Buffer(base64, "base64").toString();
    }
    function decodeBase64WithAtob(base64) {
      return decodeURIComponent(escape(atob(base64)));
    }
    function stripComment(sm) {
      return sm.split(",").pop();
    }
    function readFromFileMap(sm, read) {
      var r = exports2.mapFileCommentRegex.exec(sm);
      var filename = r[1] || r[2];
      try {
        var sm = read(filename);
        if (sm != null && typeof sm.catch === "function") {
          return sm.catch(throwError);
        } else {
          return sm;
        }
      } catch (e) {
        throwError(e);
      }
      function throwError(e) {
        throw new Error("An error occurred while trying to read the map file at " + filename + "\n" + e.stack);
      }
    }
    function Converter(sm, opts) {
      opts = opts || {};
      if (opts.hasComment) {
        sm = stripComment(sm);
      }
      if (opts.encoding === "base64") {
        sm = decodeBase64(sm);
      } else if (opts.encoding === "uri") {
        sm = decodeURIComponent(sm);
      }
      if (opts.isJSON || opts.encoding) {
        sm = JSON.parse(sm);
      }
      this.sourcemap = sm;
    }
    Converter.prototype.toJSON = function(space) {
      return JSON.stringify(this.sourcemap, null, space);
    };
    if (typeof Buffer !== "undefined") {
      if (typeof Buffer.from === "function") {
        Converter.prototype.toBase64 = encodeBase64WithBufferFrom;
      } else {
        Converter.prototype.toBase64 = encodeBase64WithNewBuffer;
      }
    } else {
      Converter.prototype.toBase64 = encodeBase64WithBtoa;
    }
    function encodeBase64WithBufferFrom() {
      var json = this.toJSON();
      return Buffer.from(json, "utf8").toString("base64");
    }
    function encodeBase64WithNewBuffer() {
      var json = this.toJSON();
      if (typeof json === "number") {
        throw new TypeError("The json to encode must not be of type number.");
      }
      return new Buffer(json, "utf8").toString("base64");
    }
    function encodeBase64WithBtoa() {
      var json = this.toJSON();
      return btoa(unescape(encodeURIComponent(json)));
    }
    Converter.prototype.toURI = function() {
      var json = this.toJSON();
      return encodeURIComponent(json);
    };
    Converter.prototype.toComment = function(options) {
      var encoding, content, data;
      if (options != null && options.encoding === "uri") {
        encoding = "";
        content = this.toURI();
      } else {
        encoding = ";base64";
        content = this.toBase64();
      }
      data = "sourceMappingURL=data:application/json;charset=utf-8" + encoding + "," + content;
      return options != null && options.multiline ? "/*# " + data + " */" : "//# " + data;
    };
    Converter.prototype.toObject = function() {
      return JSON.parse(this.toJSON());
    };
    Converter.prototype.addProperty = function(key, value2) {
      if (this.sourcemap.hasOwnProperty(key)) throw new Error('property "' + key + '" already exists on the sourcemap, use set property instead');
      return this.setProperty(key, value2);
    };
    Converter.prototype.setProperty = function(key, value2) {
      this.sourcemap[key] = value2;
      return this;
    };
    Converter.prototype.getProperty = function(key) {
      return this.sourcemap[key];
    };
    exports2.fromObject = function(obj) {
      return new Converter(obj);
    };
    exports2.fromJSON = function(json) {
      return new Converter(json, { isJSON: true });
    };
    exports2.fromURI = function(uri) {
      return new Converter(uri, { encoding: "uri" });
    };
    exports2.fromBase64 = function(base64) {
      return new Converter(base64, { encoding: "base64" });
    };
    exports2.fromComment = function(comment) {
      var m, encoding;
      comment = comment.replace(/^\/\*/g, "//").replace(/\*\/$/g, "");
      m = exports2.commentRegex.exec(comment);
      encoding = m && m[4] || "uri";
      return new Converter(comment, { encoding, hasComment: true });
    };
    function makeConverter(sm) {
      return new Converter(sm, { isJSON: true });
    }
    exports2.fromMapFileComment = function(comment, read) {
      if (typeof read === "string") {
        throw new Error(
          "String directory paths are no longer supported with `fromMapFileComment`\nPlease review the Upgrading documentation at https://github.com/thlorenz/convert-source-map#upgrading"
        );
      }
      var sm = readFromFileMap(comment, read);
      if (sm != null && typeof sm.then === "function") {
        return sm.then(makeConverter);
      } else {
        return makeConverter(sm);
      }
    };
    exports2.fromSource = function(content) {
      var m = content.match(exports2.commentRegex);
      return m ? exports2.fromComment(m.pop()) : null;
    };
    exports2.fromMapFileSource = function(content, read) {
      if (typeof read === "string") {
        throw new Error(
          "String directory paths are no longer supported with `fromMapFileSource`\nPlease review the Upgrading documentation at https://github.com/thlorenz/convert-source-map#upgrading"
        );
      }
      var m = content.match(exports2.mapFileCommentRegex);
      return m ? exports2.fromMapFileComment(m.pop(), read) : null;
    };
    exports2.removeComments = function(src) {
      return src.replace(exports2.commentRegex, "");
    };
    exports2.removeMapFileComments = function(src) {
      return src.replace(exports2.mapFileCommentRegex, "");
    };
    exports2.generateMapFileComment = function(file, options) {
      var data = "sourceMappingURL=" + file;
      return options && options.multiline ? "/*# " + data + " */" : "//# " + data;
    };
  }
});

// node_modules/@babel/core/lib/parser/util/missing-plugin-helper.js
var require_missing_plugin_helper = __commonJS({
  "node_modules/@babel/core/lib/parser/util/missing-plugin-helper.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = generateMissingPluginMessage;
    var pluginNameMap = {
      asyncDoExpressions: {
        syntax: {
          name: "@babel/plugin-syntax-async-do-expressions",
          url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-async-do-expressions"
        }
      },
      decimal: {
        syntax: {
          name: "@babel/plugin-syntax-decimal",
          url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-decimal"
        }
      },
      decorators: {
        syntax: {
          name: "@babel/plugin-syntax-decorators",
          url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-decorators"
        },
        transform: {
          name: "@babel/plugin-proposal-decorators",
          url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-proposal-decorators"
        }
      },
      doExpressions: {
        syntax: {
          name: "@babel/plugin-syntax-do-expressions",
          url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-do-expressions"
        },
        transform: {
          name: "@babel/plugin-proposal-do-expressions",
          url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-proposal-do-expressions"
        }
      },
      exportDefaultFrom: {
        syntax: {
          name: "@babel/plugin-syntax-export-default-from",
          url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-export-default-from"
        },
        transform: {
          name: "@babel/plugin-proposal-export-default-from",
          url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-proposal-export-default-from"
        }
      },
      flow: {
        syntax: {
          name: "@babel/plugin-syntax-flow",
          url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-flow"
        },
        transform: {
          name: "@babel/preset-flow",
          url: "https://github.com/babel/babel/tree/main/packages/babel-preset-flow"
        }
      },
      functionBind: {
        syntax: {
          name: "@babel/plugin-syntax-function-bind",
          url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-function-bind"
        },
        transform: {
          name: "@babel/plugin-proposal-function-bind",
          url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-proposal-function-bind"
        }
      },
      functionSent: {
        syntax: {
          name: "@babel/plugin-syntax-function-sent",
          url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-function-sent"
        },
        transform: {
          name: "@babel/plugin-proposal-function-sent",
          url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-proposal-function-sent"
        }
      },
      jsx: {
        syntax: {
          name: "@babel/plugin-syntax-jsx",
          url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-jsx"
        },
        transform: {
          name: "@babel/preset-react",
          url: "https://github.com/babel/babel/tree/main/packages/babel-preset-react"
        }
      },
      pipelineOperator: {
        syntax: {
          name: "@babel/plugin-syntax-pipeline-operator",
          url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-pipeline-operator"
        },
        transform: {
          name: "@babel/plugin-proposal-pipeline-operator",
          url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-proposal-pipeline-operator"
        }
      },
      recordAndTuple: {
        syntax: {
          name: "@babel/plugin-syntax-record-and-tuple",
          url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-record-and-tuple"
        }
      },
      throwExpressions: {
        syntax: {
          name: "@babel/plugin-syntax-throw-expressions",
          url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-throw-expressions"
        },
        transform: {
          name: "@babel/plugin-proposal-throw-expressions",
          url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-proposal-throw-expressions"
        }
      },
      typescript: {
        syntax: {
          name: "@babel/plugin-syntax-typescript",
          url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-typescript"
        },
        transform: {
          name: "@babel/preset-typescript",
          url: "https://github.com/babel/babel/tree/main/packages/babel-preset-typescript"
        }
      }
    };
    {
      Object.assign(pluginNameMap, {
        asyncGenerators: {
          syntax: {
            name: "@babel/plugin-syntax-async-generators",
            url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-async-generators"
          },
          transform: {
            name: "@babel/plugin-transform-async-generator-functions",
            url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-async-generator-functions"
          }
        },
        classProperties: {
          syntax: {
            name: "@babel/plugin-syntax-class-properties",
            url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-class-properties"
          },
          transform: {
            name: "@babel/plugin-transform-class-properties",
            url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-class-properties"
          }
        },
        classPrivateProperties: {
          syntax: {
            name: "@babel/plugin-syntax-class-properties",
            url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-class-properties"
          },
          transform: {
            name: "@babel/plugin-transform-class-properties",
            url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-class-properties"
          }
        },
        classPrivateMethods: {
          syntax: {
            name: "@babel/plugin-syntax-class-properties",
            url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-class-properties"
          },
          transform: {
            name: "@babel/plugin-transform-private-methods",
            url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-private-methods"
          }
        },
        classStaticBlock: {
          syntax: {
            name: "@babel/plugin-syntax-class-static-block",
            url: "https://github.com/babel/babel/tree/HEAD/packages/babel-plugin-syntax-class-static-block"
          },
          transform: {
            name: "@babel/plugin-transform-class-static-block",
            url: "https://github.com/babel/babel/tree/HEAD/packages/babel-plugin-transform-class-static-block"
          }
        },
        dynamicImport: {
          syntax: {
            name: "@babel/plugin-syntax-dynamic-import",
            url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-dynamic-import"
          }
        },
        exportNamespaceFrom: {
          syntax: {
            name: "@babel/plugin-syntax-export-namespace-from",
            url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-export-namespace-from"
          },
          transform: {
            name: "@babel/plugin-transform-export-namespace-from",
            url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-export-namespace-from"
          }
        },
        importAssertions: {
          syntax: {
            name: "@babel/plugin-syntax-import-assertions",
            url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-import-assertions"
          }
        },
        importAttributes: {
          syntax: {
            name: "@babel/plugin-syntax-import-attributes",
            url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-import-attributes"
          }
        },
        importMeta: {
          syntax: {
            name: "@babel/plugin-syntax-import-meta",
            url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-import-meta"
          }
        },
        logicalAssignment: {
          syntax: {
            name: "@babel/plugin-syntax-logical-assignment-operators",
            url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-logical-assignment-operators"
          },
          transform: {
            name: "@babel/plugin-transform-logical-assignment-operators",
            url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-logical-assignment-operators"
          }
        },
        moduleStringNames: {
          syntax: {
            name: "@babel/plugin-syntax-module-string-names",
            url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-module-string-names"
          }
        },
        numericSeparator: {
          syntax: {
            name: "@babel/plugin-syntax-numeric-separator",
            url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-numeric-separator"
          },
          transform: {
            name: "@babel/plugin-transform-numeric-separator",
            url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-numeric-separator"
          }
        },
        nullishCoalescingOperator: {
          syntax: {
            name: "@babel/plugin-syntax-nullish-coalescing-operator",
            url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-nullish-coalescing-operator"
          },
          transform: {
            name: "@babel/plugin-transform-nullish-coalescing-operator",
            url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-nullish-coalescing-opearator"
          }
        },
        objectRestSpread: {
          syntax: {
            name: "@babel/plugin-syntax-object-rest-spread",
            url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-object-rest-spread"
          },
          transform: {
            name: "@babel/plugin-transform-object-rest-spread",
            url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-object-rest-spread"
          }
        },
        optionalCatchBinding: {
          syntax: {
            name: "@babel/plugin-syntax-optional-catch-binding",
            url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-optional-catch-binding"
          },
          transform: {
            name: "@babel/plugin-transform-optional-catch-binding",
            url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-optional-catch-binding"
          }
        },
        optionalChaining: {
          syntax: {
            name: "@babel/plugin-syntax-optional-chaining",
            url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-optional-chaining"
          },
          transform: {
            name: "@babel/plugin-transform-optional-chaining",
            url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-optional-chaining"
          }
        },
        privateIn: {
          syntax: {
            name: "@babel/plugin-syntax-private-property-in-object",
            url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-private-property-in-object"
          },
          transform: {
            name: "@babel/plugin-transform-private-property-in-object",
            url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-private-property-in-object"
          }
        },
        regexpUnicodeSets: {
          syntax: {
            name: "@babel/plugin-syntax-unicode-sets-regex",
            url: "https://github.com/babel/babel/blob/main/packages/babel-plugin-syntax-unicode-sets-regex/README.md"
          },
          transform: {
            name: "@babel/plugin-transform-unicode-sets-regex",
            url: "https://github.com/babel/babel/blob/main/packages/babel-plugin-proposalunicode-sets-regex/README.md"
          }
        }
      });
    }
    var getNameURLCombination = ({
      name,
      url
    }) => `${name} (${url})`;
    function generateMissingPluginMessage(missingPluginName, loc, codeFrame, filename) {
      let helpMessage = `Support for the experimental syntax '${missingPluginName}' isn't currently enabled (${loc.line}:${loc.column + 1}):

` + codeFrame;
      const pluginInfo = pluginNameMap[missingPluginName];
      if (pluginInfo) {
        const {
          syntax: syntaxPlugin,
          transform: transformPlugin
        } = pluginInfo;
        if (syntaxPlugin) {
          const syntaxPluginInfo = getNameURLCombination(syntaxPlugin);
          if (transformPlugin) {
            const transformPluginInfo = getNameURLCombination(transformPlugin);
            const sectionType = transformPlugin.name.startsWith("@babel/plugin") ? "plugins" : "presets";
            helpMessage += `

Add ${transformPluginInfo} to the '${sectionType}' section of your Babel config to enable transformation.
If you want to leave it as-is, add ${syntaxPluginInfo} to the 'plugins' section to enable parsing.`;
          } else {
            helpMessage += `

Add ${syntaxPluginInfo} to the 'plugins' section of your Babel config to enable parsing.`;
          }
        }
      }
      const msgFilename = filename === "unknown" ? "<name of the input file>" : filename;
      helpMessage += `

If you already added the plugin for this syntax to your config, it's possible that your config isn't being loaded.
You can re-run Babel with the BABEL_SHOW_CONFIG_FOR environment variable to show the loaded configuration:
	npx cross-env BABEL_SHOW_CONFIG_FOR=${msgFilename} <your build command>
See https://babeljs.io/docs/configuration#print-effective-configs for more info.
`;
      return helpMessage;
    }
  }
});

// node_modules/@babel/core/lib/parser/index.js
var require_parser = __commonJS({
  "node_modules/@babel/core/lib/parser/index.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = parser;
    function _parser() {
      const data = require_lib4();
      _parser = function() {
        return data;
      };
      return data;
    }
    function _codeFrame() {
      const data = require_lib5();
      _codeFrame = function() {
        return data;
      };
      return data;
    }
    var _missingPluginHelper = require_missing_plugin_helper();
    function* parser(pluginPasses, {
      parserOpts,
      highlightCode = true,
      filename = "unknown"
    }, code) {
      try {
        const results = [];
        for (const plugins of pluginPasses) {
          for (const plugin of plugins) {
            const {
              parserOverride
            } = plugin;
            if (parserOverride) {
              const ast = parserOverride(code, parserOpts, _parser().parse);
              if (ast !== void 0) results.push(ast);
            }
          }
        }
        if (results.length === 0) {
          return (0, _parser().parse)(code, parserOpts);
        } else if (results.length === 1) {
          yield* [];
          if (typeof results[0].then === "function") {
            throw new Error(`You appear to be using an async parser plugin, which your current version of Babel does not support. If you're using a published plugin, you may need to upgrade your @babel/core version.`);
          }
          return results[0];
        }
        throw new Error("More than one plugin attempted to override parsing.");
      } catch (err) {
        if (err.code === "BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED") {
          err.message += "\nConsider renaming the file to '.mjs', or setting sourceType:module or sourceType:unambiguous in your Babel config for this file.";
        }
        const {
          loc,
          missingPlugin
        } = err;
        if (loc) {
          const codeFrame = (0, _codeFrame().codeFrameColumns)(code, {
            start: {
              line: loc.line,
              column: loc.column + 1
            }
          }, {
            highlightCode
          });
          if (missingPlugin) {
            err.message = `${filename}: ` + (0, _missingPluginHelper.default)(missingPlugin[0], loc, codeFrame, filename);
          } else {
            err.message = `${filename}: ${err.message}

` + codeFrame;
          }
          err.code = "BABEL_PARSE_ERROR";
        }
        throw err;
      }
    }
  }
});

// node_modules/@babel/core/lib/transformation/util/clone-deep.js
var require_clone_deep = __commonJS({
  "node_modules/@babel/core/lib/transformation/util/clone-deep.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = _default;
    var circleSet = /* @__PURE__ */ new Set();
    var depth = 0;
    function deepClone(value2, cache, allowCircle) {
      if (value2 !== null) {
        if (allowCircle) {
          if (cache.has(value2)) return cache.get(value2);
        } else if (++depth > 250) {
          if (circleSet.has(value2)) {
            depth = 0;
            circleSet.clear();
            throw new Error("Babel-deepClone: Cycles are not allowed in AST");
          }
          circleSet.add(value2);
        }
        let cloned;
        if (Array.isArray(value2)) {
          cloned = new Array(value2.length);
          if (allowCircle) cache.set(value2, cloned);
          for (let i = 0; i < value2.length; i++) {
            cloned[i] = typeof value2[i] !== "object" ? value2[i] : deepClone(value2[i], cache, allowCircle);
          }
        } else {
          cloned = {};
          if (allowCircle) cache.set(value2, cloned);
          const keys = Object.keys(value2);
          for (let i = 0; i < keys.length; i++) {
            const key = keys[i];
            cloned[key] = typeof value2[key] !== "object" ? value2[key] : deepClone(value2[key], cache, allowCircle || key === "leadingComments" || key === "innerComments" || key === "trailingComments" || key === "extra");
          }
        }
        if (!allowCircle) {
          if (depth-- > 250) circleSet.delete(value2);
        }
        return cloned;
      }
      return value2;
    }
    function _default(value2) {
      if (typeof value2 !== "object") return value2;
      {
        try {
          return deepClone(value2, /* @__PURE__ */ new Map(), true);
        } catch (_) {
          return structuredClone(value2);
        }
      }
    }
  }
});

// node_modules/@babel/core/lib/transformation/normalize-file.js
var require_normalize_file = __commonJS({
  "node_modules/@babel/core/lib/transformation/normalize-file.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = normalizeFile;
    function _fs() {
      const data = require("fs");
      _fs = function() {
        return data;
      };
      return data;
    }
    function _path() {
      const data = require("path");
      _path = function() {
        return data;
      };
      return data;
    }
    function _debug() {
      const data = require_src();
      _debug = function() {
        return data;
      };
      return data;
    }
    function _t() {
      const data = require_lib3();
      _t = function() {
        return data;
      };
      return data;
    }
    function _convertSourceMap() {
      const data = require_convert_source_map();
      _convertSourceMap = function() {
        return data;
      };
      return data;
    }
    var _file = require_file();
    var _index = require_parser();
    var _cloneDeep = require_clone_deep();
    var {
      file,
      traverseFast
    } = _t();
    var debug = _debug()("babel:transform:file");
    var INLINE_SOURCEMAP_REGEX = /^[@#]\s+sourceMappingURL=data:(?:application|text)\/json;(?:charset[:=]\S+?;)?base64,.*$/;
    var EXTERNAL_SOURCEMAP_REGEX = /^[@#][ \t]+sourceMappingURL=([^\s'"`]+)[ \t]*$/;
    function* normalizeFile(pluginPasses, options, code, ast) {
      code = `${code || ""}`;
      if (ast) {
        if (ast.type === "Program") {
          ast = file(ast, [], []);
        } else if (ast.type !== "File") {
          throw new Error("AST root must be a Program or File node");
        }
        if (options.cloneInputAst) {
          ast = (0, _cloneDeep.default)(ast);
        }
      } else {
        ast = yield* (0, _index.default)(pluginPasses, options, code);
      }
      let inputMap = null;
      if (options.inputSourceMap !== false) {
        if (typeof options.inputSourceMap === "object") {
          inputMap = _convertSourceMap().fromObject(options.inputSourceMap);
        }
        if (!inputMap) {
          const lastComment = extractComments(INLINE_SOURCEMAP_REGEX, ast);
          if (lastComment) {
            try {
              inputMap = _convertSourceMap().fromComment("//" + lastComment);
            } catch (err) {
              {
                debug("discarding unknown inline input sourcemap");
              }
            }
          }
        }
        if (!inputMap) {
          const lastComment = extractComments(EXTERNAL_SOURCEMAP_REGEX, ast);
          if (typeof options.filename === "string" && lastComment) {
            try {
              const match = EXTERNAL_SOURCEMAP_REGEX.exec(lastComment);
              const inputMapContent = _fs().readFileSync(_path().resolve(_path().dirname(options.filename), match[1]), "utf8");
              inputMap = _convertSourceMap().fromJSON(inputMapContent);
            } catch (err) {
              debug("discarding unknown file input sourcemap", err);
            }
          } else if (lastComment) {
            debug("discarding un-loadable file input sourcemap");
          }
        }
      }
      return new _file.default(options, {
        code,
        ast,
        inputMap
      });
    }
    function extractCommentsFromList(regex, comments, lastComment) {
      if (comments) {
        comments = comments.filter(({
          value: value2
        }) => {
          if (regex.test(value2)) {
            lastComment = value2;
            return false;
          }
          return true;
        });
      }
      return [comments, lastComment];
    }
    function extractComments(regex, ast) {
      let lastComment = null;
      traverseFast(ast, (node) => {
        [node.leadingComments, lastComment] = extractCommentsFromList(regex, node.leadingComments, lastComment);
        [node.innerComments, lastComment] = extractCommentsFromList(regex, node.innerComments, lastComment);
        [node.trailingComments, lastComment] = extractCommentsFromList(regex, node.trailingComments, lastComment);
      });
      return lastComment;
    }
  }
});

// node_modules/@ampproject/remapping/dist/remapping.umd.js
var require_remapping_umd = __commonJS({
  "node_modules/@ampproject/remapping/dist/remapping.umd.js"(exports2, module2) {
    (function(global2, factory) {
      typeof exports2 === "object" && typeof module2 !== "undefined" ? module2.exports = factory(require_trace_mapping_umd(), require_gen_mapping_umd()) : typeof define === "function" && define.amd ? define(["@jridgewell/trace-mapping", "@jridgewell/gen-mapping"], factory) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, global2.remapping = factory(global2.traceMapping, global2.genMapping));
    })(exports2, (function(traceMapping, genMapping) {
      "use strict";
      const SOURCELESS_MAPPING = /* @__PURE__ */ SegmentObject("", -1, -1, "", null, false);
      const EMPTY_SOURCES = [];
      function SegmentObject(source, line, column, name, content, ignore) {
        return { source, line, column, name, content, ignore };
      }
      function Source(map, sources, source, content, ignore) {
        return {
          map,
          sources,
          source,
          content,
          ignore
        };
      }
      function MapSource(map, sources) {
        return Source(map, sources, "", null, false);
      }
      function OriginalSource(source, content, ignore) {
        return Source(null, EMPTY_SOURCES, source, content, ignore);
      }
      function traceMappings(tree) {
        const gen = new genMapping.GenMapping({ file: tree.map.file });
        const { sources: rootSources, map } = tree;
        const rootNames = map.names;
        const rootMappings = traceMapping.decodedMappings(map);
        for (let i = 0; i < rootMappings.length; i++) {
          const segments = rootMappings[i];
          for (let j = 0; j < segments.length; j++) {
            const segment = segments[j];
            const genCol = segment[0];
            let traced = SOURCELESS_MAPPING;
            if (segment.length !== 1) {
              const source2 = rootSources[segment[1]];
              traced = originalPositionFor(source2, segment[2], segment[3], segment.length === 5 ? rootNames[segment[4]] : "");
              if (traced == null)
                continue;
            }
            const { column, line, name, content, source, ignore } = traced;
            genMapping.maybeAddSegment(gen, i, genCol, source, line, column, name);
            if (source && content != null)
              genMapping.setSourceContent(gen, source, content);
            if (ignore)
              genMapping.setIgnore(gen, source, true);
          }
        }
        return gen;
      }
      function originalPositionFor(source, line, column, name) {
        if (!source.map) {
          return SegmentObject(source.source, line, column, name, source.content, source.ignore);
        }
        const segment = traceMapping.traceSegment(source.map, line, column);
        if (segment == null)
          return null;
        if (segment.length === 1)
          return SOURCELESS_MAPPING;
        return originalPositionFor(source.sources[segment[1]], segment[2], segment[3], segment.length === 5 ? source.map.names[segment[4]] : name);
      }
      function asArray(value2) {
        if (Array.isArray(value2))
          return value2;
        return [value2];
      }
      function buildSourceMapTree(input, loader) {
        const maps = asArray(input).map((m) => new traceMapping.TraceMap(m, ""));
        const map = maps.pop();
        for (let i = 0; i < maps.length; i++) {
          if (maps[i].sources.length > 1) {
            throw new Error(`Transformation map ${i} must have exactly one source file.
Did you specify these with the most recent transformation maps first?`);
          }
        }
        let tree = build(map, loader, "", 0);
        for (let i = maps.length - 1; i >= 0; i--) {
          tree = MapSource(maps[i], [tree]);
        }
        return tree;
      }
      function build(map, loader, importer, importerDepth) {
        const { resolvedSources, sourcesContent, ignoreList } = map;
        const depth = importerDepth + 1;
        const children = resolvedSources.map((sourceFile, i) => {
          const ctx = {
            importer,
            depth,
            source: sourceFile || "",
            content: void 0,
            ignore: void 0
          };
          const sourceMap = loader(ctx.source, ctx);
          const { source, content, ignore } = ctx;
          if (sourceMap)
            return build(new traceMapping.TraceMap(sourceMap, source), loader, source, depth);
          const sourceContent = content !== void 0 ? content : sourcesContent ? sourcesContent[i] : null;
          const ignored = ignore !== void 0 ? ignore : ignoreList ? ignoreList.includes(i) : false;
          return OriginalSource(source, sourceContent, ignored);
        });
        return MapSource(map, children);
      }
      class SourceMap {
        constructor(map, options) {
          const out = options.decodedMappings ? genMapping.toDecodedMap(map) : genMapping.toEncodedMap(map);
          this.version = out.version;
          this.file = out.file;
          this.mappings = out.mappings;
          this.names = out.names;
          this.ignoreList = out.ignoreList;
          this.sourceRoot = out.sourceRoot;
          this.sources = out.sources;
          if (!options.excludeContent) {
            this.sourcesContent = out.sourcesContent;
          }
        }
        toString() {
          return JSON.stringify(this);
        }
      }
      function remapping(input, loader, options) {
        const opts = typeof options === "object" ? options : { excludeContent: !!options, decodedMappings: false };
        const tree = buildSourceMapTree(input, loader);
        return new SourceMap(traceMappings(tree), opts);
      }
      return remapping;
    }));
  }
});

// node_modules/@babel/core/lib/transformation/file/merge-map.js
var require_merge_map = __commonJS({
  "node_modules/@babel/core/lib/transformation/file/merge-map.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = mergeSourceMap;
    function _remapping() {
      const data = require_remapping_umd();
      _remapping = function() {
        return data;
      };
      return data;
    }
    function mergeSourceMap(inputMap, map, sourceFileName) {
      const source = sourceFileName.replace(/\\/g, "/");
      let found = false;
      const result = _remapping()(rootless(map), (s, ctx) => {
        if (s === source && !found) {
          found = true;
          ctx.source = "";
          return rootless(inputMap);
        }
        return null;
      });
      if (typeof inputMap.sourceRoot === "string") {
        result.sourceRoot = inputMap.sourceRoot;
      }
      return Object.assign({}, result);
    }
    function rootless(map) {
      return Object.assign({}, map, {
        sourceRoot: null
      });
    }
  }
});

// node_modules/@babel/core/lib/transformation/file/generate.js
var require_generate = __commonJS({
  "node_modules/@babel/core/lib/transformation/file/generate.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = generateCode;
    function _convertSourceMap() {
      const data = require_convert_source_map();
      _convertSourceMap = function() {
        return data;
      };
      return data;
    }
    function _generator() {
      const data = require_lib8();
      _generator = function() {
        return data;
      };
      return data;
    }
    var _mergeMap = require_merge_map();
    function generateCode(pluginPasses, file) {
      const {
        opts,
        ast,
        code,
        inputMap
      } = file;
      const {
        generatorOpts
      } = opts;
      generatorOpts.inputSourceMap = inputMap == null ? void 0 : inputMap.toObject();
      const results = [];
      for (const plugins of pluginPasses) {
        for (const plugin of plugins) {
          const {
            generatorOverride
          } = plugin;
          if (generatorOverride) {
            const result2 = generatorOverride(ast, generatorOpts, code, _generator().default);
            if (result2 !== void 0) results.push(result2);
          }
        }
      }
      let result;
      if (results.length === 0) {
        result = (0, _generator().default)(ast, generatorOpts, code);
      } else if (results.length === 1) {
        result = results[0];
        if (typeof result.then === "function") {
          throw new Error(`You appear to be using an async codegen plugin, which your current version of Babel does not support. If you're using a published plugin, you may need to upgrade your @babel/core version.`);
        }
      } else {
        throw new Error("More than one plugin attempted to override codegen.");
      }
      let {
        code: outputCode,
        decodedMap: outputMap = result.map
      } = result;
      if (result.__mergedMap) {
        outputMap = Object.assign({}, result.map);
      } else {
        if (outputMap) {
          if (inputMap) {
            outputMap = (0, _mergeMap.default)(inputMap.toObject(), outputMap, generatorOpts.sourceFileName);
          } else {
            outputMap = result.map;
          }
        }
      }
      if (opts.sourceMaps === "inline" || opts.sourceMaps === "both") {
        outputCode += "\n" + _convertSourceMap().fromObject(outputMap).toComment();
      }
      if (opts.sourceMaps === "inline") {
        outputMap = null;
      }
      return {
        outputCode,
        outputMap
      };
    }
  }
});

// node_modules/@babel/core/lib/transformation/index.js
var require_transformation = __commonJS({
  "node_modules/@babel/core/lib/transformation/index.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.run = run;
    function _traverse() {
      const data = require_lib9();
      _traverse = function() {
        return data;
      };
      return data;
    }
    var _pluginPass = require_plugin_pass();
    var _blockHoistPlugin = require_block_hoist_plugin();
    var _normalizeOpts = require_normalize_opts();
    var _normalizeFile = require_normalize_file();
    var _generate = require_generate();
    var _deepArray = require_deep_array();
    var _async = require_async();
    function* run(config, code, ast) {
      const file = yield* (0, _normalizeFile.default)(config.passes, (0, _normalizeOpts.default)(config), code, ast);
      const opts = file.opts;
      try {
        yield* transformFile(file, config.passes);
      } catch (e) {
        var _opts$filename;
        e.message = `${(_opts$filename = opts.filename) != null ? _opts$filename : "unknown file"}: ${e.message}`;
        if (!e.code) {
          e.code = "BABEL_TRANSFORM_ERROR";
        }
        throw e;
      }
      let outputCode, outputMap;
      try {
        if (opts.code !== false) {
          ({
            outputCode,
            outputMap
          } = (0, _generate.default)(config.passes, file));
        }
      } catch (e) {
        var _opts$filename2;
        e.message = `${(_opts$filename2 = opts.filename) != null ? _opts$filename2 : "unknown file"}: ${e.message}`;
        if (!e.code) {
          e.code = "BABEL_GENERATE_ERROR";
        }
        throw e;
      }
      return {
        metadata: file.metadata,
        options: opts,
        ast: opts.ast === true ? file.ast : null,
        code: outputCode === void 0 ? null : outputCode,
        map: outputMap === void 0 ? null : outputMap,
        sourceType: file.ast.program.sourceType,
        externalDependencies: (0, _deepArray.flattenToSet)(config.externalDependencies)
      };
    }
    function* transformFile(file, pluginPasses) {
      const async = yield* (0, _async.isAsync)();
      for (const pluginPairs of pluginPasses) {
        const passPairs = [];
        const passes = [];
        const visitors = [];
        for (const plugin of pluginPairs.concat([(0, _blockHoistPlugin.default)()])) {
          const pass = new _pluginPass.default(file, plugin.key, plugin.options, async);
          passPairs.push([plugin, pass]);
          passes.push(pass);
          visitors.push(plugin.visitor);
        }
        for (const [plugin, pass] of passPairs) {
          if (plugin.pre) {
            const fn = (0, _async.maybeAsync)(plugin.pre, `You appear to be using an async plugin/preset, but Babel has been called synchronously`);
            yield* fn.call(pass, file);
          }
        }
        const visitor = _traverse().default.visitors.merge(visitors, passes, file.opts.wrapPluginVisitorMethod);
        {
          (0, _traverse().default)(file.ast, visitor, file.scope);
        }
        for (const [plugin, pass] of passPairs) {
          if (plugin.post) {
            const fn = (0, _async.maybeAsync)(plugin.post, `You appear to be using an async plugin/preset, but Babel has been called synchronously`);
            yield* fn.call(pass, file);
          }
        }
      }
    }
  }
});

// node_modules/@babel/core/lib/transform-file.js
var require_transform_file = __commonJS({
  "node_modules/@babel/core/lib/transform-file.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.transformFile = transformFile;
    exports2.transformFileAsync = transformFileAsync;
    exports2.transformFileSync = transformFileSync;
    function _gensync() {
      const data = require_gensync();
      _gensync = function() {
        return data;
      };
      return data;
    }
    var _index = require_config();
    var _index2 = require_transformation();
    var fs = require_fs();
    var transformFileRunner = _gensync()(function* (filename, opts) {
      const options = Object.assign({}, opts, {
        filename
      });
      const config = yield* (0, _index.default)(options);
      if (config === null) return null;
      const code = yield* fs.readFile(filename, "utf8");
      return yield* (0, _index2.run)(config, code);
    });
    function transformFile(...args) {
      transformFileRunner.errback(...args);
    }
    function transformFileSync(...args) {
      return transformFileRunner.sync(...args);
    }
    function transformFileAsync(...args) {
      return transformFileRunner.async(...args);
    }
  }
});

// node_modules/@babel/core/lib/config/files/import.cjs
var require_import = __commonJS({
  "node_modules/@babel/core/lib/config/files/import.cjs"(exports2, module2) {
    module2.exports = function import_(filepath) {
      return import(filepath);
    };
  }
});

// node_modules/@babel/preset-typescript/package.json
var require_package2 = __commonJS({
  "node_modules/@babel/preset-typescript/package.json"(exports2, module2) {
    module2.exports = {
      name: "@babel/preset-typescript",
      version: "7.28.5",
      description: "Babel preset for TypeScript.",
      repository: {
        type: "git",
        url: "https://github.com/babel/babel.git",
        directory: "packages/babel-preset-typescript"
      },
      license: "MIT",
      publishConfig: {
        access: "public"
      },
      main: "./lib/index.js",
      keywords: [
        "babel-preset",
        "typescript"
      ],
      dependencies: {
        "@babel/helper-plugin-utils": "^7.27.1",
        "@babel/helper-validator-option": "^7.27.1",
        "@babel/plugin-syntax-jsx": "^7.27.1",
        "@babel/plugin-transform-modules-commonjs": "^7.27.1",
        "@babel/plugin-transform-typescript": "^7.28.5"
      },
      peerDependencies: {
        "@babel/core": "^7.0.0-0"
      },
      devDependencies: {
        "@babel/core": "^7.28.5",
        "@babel/helper-plugin-test-runner": "^7.27.1"
      },
      homepage: "https://babel.dev/docs/en/next/babel-preset-typescript",
      bugs: "https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22area%3A%20typescript%22+is%3Aopen",
      engines: {
        node: ">=6.9.0"
      },
      author: "The Babel Team (https://babel.dev/team)",
      type: "commonjs"
    };
  }
});

// node_modules/@babel/helper-plugin-utils/lib/index.js
var require_lib15 = __commonJS({
  "node_modules/@babel/helper-plugin-utils/lib/index.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.declare = declare2;
    exports2.declarePreset = void 0;
    var apiPolyfills = {
      assertVersion: (api) => (range) => {
        throwVersionError(range, api.version);
      }
    };
    Object.assign(apiPolyfills, {
      targets: () => () => {
        return {};
      },
      assumption: () => () => {
        return void 0;
      },
      addExternalDependency: () => () => {
      }
    });
    function declare2(builder) {
      return (api, options, dirname) => {
        let clonedApi;
        for (const name of Object.keys(apiPolyfills)) {
          if (api[name]) continue;
          clonedApi != null ? clonedApi : clonedApi = copyApiObject(api);
          clonedApi[name] = apiPolyfills[name](clonedApi);
        }
        return builder(clonedApi != null ? clonedApi : api, options || {}, dirname);
      };
    }
    var declarePreset = exports2.declarePreset = declare2;
    function copyApiObject(api) {
      let proto = null;
      if (typeof api.version === "string" && api.version.startsWith("7.")) {
        proto = Object.getPrototypeOf(api);
        if (proto && (!hasOwnProperty.call(proto, "version") || !hasOwnProperty.call(proto, "transform") || !hasOwnProperty.call(proto, "template") || !hasOwnProperty.call(proto, "types"))) {
          proto = null;
        }
      }
      return Object.assign({}, proto, api);
    }
    function throwVersionError(range, version) {
      if (typeof range === "number") {
        if (!Number.isInteger(range)) {
          throw new Error("Expected string or integer value.");
        }
        range = `^${range}.0.0-0`;
      }
      if (typeof range !== "string") {
        throw new Error("Expected string or integer value.");
      }
      const limit = Error.stackTraceLimit;
      if (typeof limit === "number" && limit < 25) {
        Error.stackTraceLimit = 25;
      }
      let err;
      if (version.startsWith("7.")) {
        err = new Error(`Requires Babel "^7.0.0-beta.41", but was loaded with "${version}". You'll need to update your @babel/core version.`);
      } else {
        err = new Error(`Requires Babel "${range}", but was loaded with "${version}". If you are sure you have a compatible version of @babel/core, it is likely that something in your build process is loading the wrong version. Inspect the stack trace of this error to look for the first entry that doesn't mention "@babel/core" or "babel-core" to see what is calling Babel.`);
      }
      if (typeof limit === "number") {
        Error.stackTraceLimit = limit;
      }
      throw Object.assign(err, {
        code: "BABEL_VERSION_UNSUPPORTED",
        version,
        range
      });
    }
  }
});

// node_modules/@babel/plugin-syntax-typescript/lib/index.js
var require_lib16 = __commonJS({
  "node_modules/@babel/plugin-syntax-typescript/lib/index.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = void 0;
    var _helperPluginUtils = require_lib15();
    var removePlugin = function(plugins, name) {
      const indices = [];
      plugins.forEach((plugin, i) => {
        const n = Array.isArray(plugin) ? plugin[0] : plugin;
        if (n === name) {
          indices.unshift(i);
        }
      });
      for (const i of indices) {
        plugins.splice(i, 1);
      }
    };
    var _default = exports2.default = (0, _helperPluginUtils.declare)((api, opts) => {
      api.assertVersion("^7.0.0-0 || ^8.0.0-0");
      const {
        disallowAmbiguousJSXLike,
        dts
      } = opts;
      var {
        isTSX
      } = opts;
      return {
        name: "syntax-typescript",
        manipulateOptions(opts2, parserOpts) {
          const {
            plugins
          } = parserOpts;
          removePlugin(plugins, "flow");
          removePlugin(plugins, "jsx");
          plugins.push("objectRestSpread", "classProperties");
          if (isTSX) {
            plugins.push("jsx");
          }
          parserOpts.plugins.push(["typescript", {
            disallowAmbiguousJSXLike,
            dts
          }]);
        }
      };
    });
  }
});

// node_modules/@babel/helper-create-class-features-plugin/node_modules/semver/semver.js
var require_semver3 = __commonJS({
  "node_modules/@babel/helper-create-class-features-plugin/node_modules/semver/semver.js"(exports2, module2) {
    exports2 = module2.exports = SemVer;
    var debug;
    if (typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG)) {
      debug = function() {
        var args = Array.prototype.slice.call(arguments, 0);
        args.unshift("SEMVER");
        console.log.apply(console, args);
      };
    } else {
      debug = function() {
      };
    }
    exports2.SEMVER_SPEC_VERSION = "2.0.0";
    var MAX_LENGTH = 256;
    var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */
    9007199254740991;
    var MAX_SAFE_COMPONENT_LENGTH = 16;
    var MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6;
    var re = exports2.re = [];
    var safeRe = exports2.safeRe = [];
    var src = exports2.src = [];
    var t = exports2.tokens = {};
    var R = 0;
    function tok(n) {
      t[n] = R++;
    }
    var LETTERDASHNUMBER = "[a-zA-Z0-9-]";
    var safeRegexReplacements = [
      ["\\s", 1],
      ["\\d", MAX_LENGTH],
      [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH]
    ];
    function makeSafeRe(value2) {
      for (var i2 = 0; i2 < safeRegexReplacements.length; i2++) {
        var token = safeRegexReplacements[i2][0];
        var max = safeRegexReplacements[i2][1];
        value2 = value2.split(token + "*").join(token + "{0," + max + "}").split(token + "+").join(token + "{1," + max + "}");
      }
      return value2;
    }
    tok("NUMERICIDENTIFIER");
    src[t.NUMERICIDENTIFIER] = "0|[1-9]\\d*";
    tok("NUMERICIDENTIFIERLOOSE");
    src[t.NUMERICIDENTIFIERLOOSE] = "\\d+";
    tok("NONNUMERICIDENTIFIER");
    src[t.NONNUMERICIDENTIFIER] = "\\d*[a-zA-Z-]" + LETTERDASHNUMBER + "*";
    tok("MAINVERSION");
    src[t.MAINVERSION] = "(" + src[t.NUMERICIDENTIFIER] + ")\\.(" + src[t.NUMERICIDENTIFIER] + ")\\.(" + src[t.NUMERICIDENTIFIER] + ")";
    tok("MAINVERSIONLOOSE");
    src[t.MAINVERSIONLOOSE] = "(" + src[t.NUMERICIDENTIFIERLOOSE] + ")\\.(" + src[t.NUMERICIDENTIFIERLOOSE] + ")\\.(" + src[t.NUMERICIDENTIFIERLOOSE] + ")";
    tok("PRERELEASEIDENTIFIER");
    src[t.PRERELEASEIDENTIFIER] = "(?:" + src[t.NUMERICIDENTIFIER] + "|" + src[t.NONNUMERICIDENTIFIER] + ")";
    tok("PRERELEASEIDENTIFIERLOOSE");
    src[t.PRERELEASEIDENTIFIERLOOSE] = "(?:" + src[t.NUMERICIDENTIFIERLOOSE] + "|" + src[t.NONNUMERICIDENTIFIER] + ")";
    tok("PRERELEASE");
    src[t.PRERELEASE] = "(?:-(" + src[t.PRERELEASEIDENTIFIER] + "(?:\\." + src[t.PRERELEASEIDENTIFIER] + ")*))";
    tok("PRERELEASELOOSE");
    src[t.PRERELEASELOOSE] = "(?:-?(" + src[t.PRERELEASEIDENTIFIERLOOSE] + "(?:\\." + src[t.PRERELEASEIDENTIFIERLOOSE] + ")*))";
    tok("BUILDIDENTIFIER");
    src[t.BUILDIDENTIFIER] = LETTERDASHNUMBER + "+";
    tok("BUILD");
    src[t.BUILD] = "(?:\\+(" + src[t.BUILDIDENTIFIER] + "(?:\\." + src[t.BUILDIDENTIFIER] + ")*))";
    tok("FULL");
    tok("FULLPLAIN");
    src[t.FULLPLAIN] = "v?" + src[t.MAINVERSION] + src[t.PRERELEASE] + "?" + src[t.BUILD] + "?";
    src[t.FULL] = "^" + src[t.FULLPLAIN] + "$";
    tok("LOOSEPLAIN");
    src[t.LOOSEPLAIN] = "[v=\\s]*" + src[t.MAINVERSIONLOOSE] + src[t.PRERELEASELOOSE] + "?" + src[t.BUILD] + "?";
    tok("LOOSE");
    src[t.LOOSE] = "^" + src[t.LOOSEPLAIN] + "$";
    tok("GTLT");
    src[t.GTLT] = "((?:<|>)?=?)";
    tok("XRANGEIDENTIFIERLOOSE");
    src[t.XRANGEIDENTIFIERLOOSE] = src[t.NUMERICIDENTIFIERLOOSE] + "|x|X|\\*";
    tok("XRANGEIDENTIFIER");
    src[t.XRANGEIDENTIFIER] = src[t.NUMERICIDENTIFIER] + "|x|X|\\*";
    tok("XRANGEPLAIN");
    src[t.XRANGEPLAIN] = "[v=\\s]*(" + src[t.XRANGEIDENTIFIER] + ")(?:\\.(" + src[t.XRANGEIDENTIFIER] + ")(?:\\.(" + src[t.XRANGEIDENTIFIER] + ")(?:" + src[t.PRERELEASE] + ")?" + src[t.BUILD] + "?)?)?";
    tok("XRANGEPLAINLOOSE");
    src[t.XRANGEPLAINLOOSE] = "[v=\\s]*(" + src[t.XRANGEIDENTIFIERLOOSE] + ")(?:\\.(" + src[t.XRANGEIDENTIFIERLOOSE] + ")(?:\\.(" + src[t.XRANGEIDENTIFIERLOOSE] + ")(?:" + src[t.PRERELEASELOOSE] + ")?" + src[t.BUILD] + "?)?)?";
    tok("XRANGE");
    src[t.XRANGE] = "^" + src[t.GTLT] + "\\s*" + src[t.XRANGEPLAIN] + "$";
    tok("XRANGELOOSE");
    src[t.XRANGELOOSE] = "^" + src[t.GTLT] + "\\s*" + src[t.XRANGEPLAINLOOSE] + "$";
    tok("COERCE");
    src[t.COERCE] = "(^|[^\\d])(\\d{1," + MAX_SAFE_COMPONENT_LENGTH + "})(?:\\.(\\d{1," + MAX_SAFE_COMPONENT_LENGTH + "}))?(?:\\.(\\d{1," + MAX_SAFE_COMPONENT_LENGTH + "}))?(?:$|[^\\d])";
    tok("COERCERTL");
    re[t.COERCERTL] = new RegExp(src[t.COERCE], "g");
    safeRe[t.COERCERTL] = new RegExp(makeSafeRe(src[t.COERCE]), "g");
    tok("LONETILDE");
    src[t.LONETILDE] = "(?:~>?)";
    tok("TILDETRIM");
    src[t.TILDETRIM] = "(\\s*)" + src[t.LONETILDE] + "\\s+";
    re[t.TILDETRIM] = new RegExp(src[t.TILDETRIM], "g");
    safeRe[t.TILDETRIM] = new RegExp(makeSafeRe(src[t.TILDETRIM]), "g");
    var tildeTrimReplace = "$1~";
    tok("TILDE");
    src[t.TILDE] = "^" + src[t.LONETILDE] + src[t.XRANGEPLAIN] + "$";
    tok("TILDELOOSE");
    src[t.TILDELOOSE] = "^" + src[t.LONETILDE] + src[t.XRANGEPLAINLOOSE] + "$";
    tok("LONECARET");
    src[t.LONECARET] = "(?:\\^)";
    tok("CARETTRIM");
    src[t.CARETTRIM] = "(\\s*)" + src[t.LONECARET] + "\\s+";
    re[t.CARETTRIM] = new RegExp(src[t.CARETTRIM], "g");
    safeRe[t.CARETTRIM] = new RegExp(makeSafeRe(src[t.CARETTRIM]), "g");
    var caretTrimReplace = "$1^";
    tok("CARET");
    src[t.CARET] = "^" + src[t.LONECARET] + src[t.XRANGEPLAIN] + "$";
    tok("CARETLOOSE");
    src[t.CARETLOOSE] = "^" + src[t.LONECARET] + src[t.XRANGEPLAINLOOSE] + "$";
    tok("COMPARATORLOOSE");
    src[t.COMPARATORLOOSE] = "^" + src[t.GTLT] + "\\s*(" + src[t.LOOSEPLAIN] + ")$|^$";
    tok("COMPARATOR");
    src[t.COMPARATOR] = "^" + src[t.GTLT] + "\\s*(" + src[t.FULLPLAIN] + ")$|^$";
    tok("COMPARATORTRIM");
    src[t.COMPARATORTRIM] = "(\\s*)" + src[t.GTLT] + "\\s*(" + src[t.LOOSEPLAIN] + "|" + src[t.XRANGEPLAIN] + ")";
    re[t.COMPARATORTRIM] = new RegExp(src[t.COMPARATORTRIM], "g");
    safeRe[t.COMPARATORTRIM] = new RegExp(makeSafeRe(src[t.COMPARATORTRIM]), "g");
    var comparatorTrimReplace = "$1$2$3";
    tok("HYPHENRANGE");
    src[t.HYPHENRANGE] = "^\\s*(" + src[t.XRANGEPLAIN] + ")\\s+-\\s+(" + src[t.XRANGEPLAIN] + ")\\s*$";
    tok("HYPHENRANGELOOSE");
    src[t.HYPHENRANGELOOSE] = "^\\s*(" + src[t.XRANGEPLAINLOOSE] + ")\\s+-\\s+(" + src[t.XRANGEPLAINLOOSE] + ")\\s*$";
    tok("STAR");
    src[t.STAR] = "(<|>)?=?\\s*\\*";
    for (i = 0; i < R; i++) {
      debug(i, src[i]);
      if (!re[i]) {
        re[i] = new RegExp(src[i]);
        safeRe[i] = new RegExp(makeSafeRe(src[i]));
      }
    }
    var i;
    exports2.parse = parse2;
    function parse2(version, options) {
      if (!options || typeof options !== "object") {
        options = {
          loose: !!options,
          includePrerelease: false
        };
      }
      if (version instanceof SemVer) {
        return version;
      }
      if (typeof version !== "string") {
        return null;
      }
      if (version.length > MAX_LENGTH) {
        return null;
      }
      var r = options.loose ? safeRe[t.LOOSE] : safeRe[t.FULL];
      if (!r.test(version)) {
        return null;
      }
      try {
        return new SemVer(version, options);
      } catch (er) {
        return null;
      }
    }
    exports2.valid = valid;
    function valid(version, options) {
      var v = parse2(version, options);
      return v ? v.version : null;
    }
    exports2.clean = clean;
    function clean(version, options) {
      var s = parse2(version.trim().replace(/^[=v]+/, ""), options);
      return s ? s.version : null;
    }
    exports2.SemVer = SemVer;
    function SemVer(version, options) {
      if (!options || typeof options !== "object") {
        options = {
          loose: !!options,
          includePrerelease: false
        };
      }
      if (version instanceof SemVer) {
        if (version.loose === options.loose) {
          return version;
        } else {
          version = version.version;
        }
      } else if (typeof version !== "string") {
        throw new TypeError("Invalid Version: " + version);
      }
      if (version.length > MAX_LENGTH) {
        throw new TypeError("version is longer than " + MAX_LENGTH + " characters");
      }
      if (!(this instanceof SemVer)) {
        return new SemVer(version, options);
      }
      debug("SemVer", version, options);
      this.options = options;
      this.loose = !!options.loose;
      var m = version.trim().match(options.loose ? safeRe[t.LOOSE] : safeRe[t.FULL]);
      if (!m) {
        throw new TypeError("Invalid Version: " + version);
      }
      this.raw = version;
      this.major = +m[1];
      this.minor = +m[2];
      this.patch = +m[3];
      if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
        throw new TypeError("Invalid major version");
      }
      if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
        throw new TypeError("Invalid minor version");
      }
      if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
        throw new TypeError("Invalid patch version");
      }
      if (!m[4]) {
        this.prerelease = [];
      } else {
        this.prerelease = m[4].split(".").map(function(id) {
          if (/^[0-9]+$/.test(id)) {
            var num = +id;
            if (num >= 0 && num < MAX_SAFE_INTEGER) {
              return num;
            }
          }
          return id;
        });
      }
      this.build = m[5] ? m[5].split(".") : [];
      this.format();
    }
    SemVer.prototype.format = function() {
      this.version = this.major + "." + this.minor + "." + this.patch;
      if (this.prerelease.length) {
        this.version += "-" + this.prerelease.join(".");
      }
      return this.version;
    };
    SemVer.prototype.toString = function() {
      return this.version;
    };
    SemVer.prototype.compare = function(other) {
      debug("SemVer.compare", this.version, this.options, other);
      if (!(other instanceof SemVer)) {
        other = new SemVer(other, this.options);
      }
      return this.compareMain(other) || this.comparePre(other);
    };
    SemVer.prototype.compareMain = function(other) {
      if (!(other instanceof SemVer)) {
        other = new SemVer(other, this.options);
      }
      return compareIdentifiers(this.major, other.major) || compareIdentifiers(this.minor, other.minor) || compareIdentifiers(this.patch, other.patch);
    };
    SemVer.prototype.comparePre = function(other) {
      if (!(other instanceof SemVer)) {
        other = new SemVer(other, this.options);
      }
      if (this.prerelease.length && !other.prerelease.length) {
        return -1;
      } else if (!this.prerelease.length && other.prerelease.length) {
        return 1;
      } else if (!this.prerelease.length && !other.prerelease.length) {
        return 0;
      }
      var i2 = 0;
      do {
        var a = this.prerelease[i2];
        var b = other.prerelease[i2];
        debug("prerelease compare", i2, a, b);
        if (a === void 0 && b === void 0) {
          return 0;
        } else if (b === void 0) {
          return 1;
        } else if (a === void 0) {
          return -1;
        } else if (a === b) {
          continue;
        } else {
          return compareIdentifiers(a, b);
        }
      } while (++i2);
    };
    SemVer.prototype.compareBuild = function(other) {
      if (!(other instanceof SemVer)) {
        other = new SemVer(other, this.options);
      }
      var i2 = 0;
      do {
        var a = this.build[i2];
        var b = other.build[i2];
        debug("prerelease compare", i2, a, b);
        if (a === void 0 && b === void 0) {
          return 0;
        } else if (b === void 0) {
          return 1;
        } else if (a === void 0) {
          return -1;
        } else if (a === b) {
          continue;
        } else {
          return compareIdentifiers(a, b);
        }
      } while (++i2);
    };
    SemVer.prototype.inc = function(release, identifier) {
      switch (release) {
        case "premajor":
          this.prerelease.length = 0;
          this.patch = 0;
          this.minor = 0;
          this.major++;
          this.inc("pre", identifier);
          break;
        case "preminor":
          this.prerelease.length = 0;
          this.patch = 0;
          this.minor++;
          this.inc("pre", identifier);
          break;
        case "prepatch":
          this.prerelease.length = 0;
          this.inc("patch", identifier);
          this.inc("pre", identifier);
          break;
        // If the input is a non-prerelease version, this acts the same as
        // prepatch.
        case "prerelease":
          if (this.prerelease.length === 0) {
            this.inc("patch", identifier);
          }
          this.inc("pre", identifier);
          break;
        case "major":
          if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) {
            this.major++;
          }
          this.minor = 0;
          this.patch = 0;
          this.prerelease = [];
          break;
        case "minor":
          if (this.patch !== 0 || this.prerelease.length === 0) {
            this.minor++;
          }
          this.patch = 0;
          this.prerelease = [];
          break;
        case "patch":
          if (this.prerelease.length === 0) {
            this.patch++;
          }
          this.prerelease = [];
          break;
        // This probably shouldn't be used publicly.
        // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction.
        case "pre":
          if (this.prerelease.length === 0) {
            this.prerelease = [0];
          } else {
            var i2 = this.prerelease.length;
            while (--i2 >= 0) {
              if (typeof this.prerelease[i2] === "number") {
                this.prerelease[i2]++;
                i2 = -2;
              }
            }
            if (i2 === -1) {
              this.prerelease.push(0);
            }
          }
          if (identifier) {
            if (this.prerelease[0] === identifier) {
              if (isNaN(this.prerelease[1])) {
                this.prerelease = [identifier, 0];
              }
            } else {
              this.prerelease = [identifier, 0];
            }
          }
          break;
        default:
          throw new Error("invalid increment argument: " + release);
      }
      this.format();
      this.raw = this.version;
      return this;
    };
    exports2.inc = inc;
    function inc(version, release, loose, identifier) {
      if (typeof loose === "string") {
        identifier = loose;
        loose = void 0;
      }
      try {
        return new SemVer(version, loose).inc(release, identifier).version;
      } catch (er) {
        return null;
      }
    }
    exports2.diff = diff;
    function diff(version1, version2) {
      if (eq(version1, version2)) {
        return null;
      } else {
        var v1 = parse2(version1);
        var v2 = parse2(version2);
        var prefix = "";
        if (v1.prerelease.length || v2.prerelease.length) {
          prefix = "pre";
          var defaultResult = "prerelease";
        }
        for (var key in v1) {
          if (key === "major" || key === "minor" || key === "patch") {
            if (v1[key] !== v2[key]) {
              return prefix + key;
            }
          }
        }
        return defaultResult;
      }
    }
    exports2.compareIdentifiers = compareIdentifiers;
    var numeric = /^[0-9]+$/;
    function compareIdentifiers(a, b) {
      var anum = numeric.test(a);
      var bnum = numeric.test(b);
      if (anum && bnum) {
        a = +a;
        b = +b;
      }
      return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1;
    }
    exports2.rcompareIdentifiers = rcompareIdentifiers;
    function rcompareIdentifiers(a, b) {
      return compareIdentifiers(b, a);
    }
    exports2.major = major;
    function major(a, loose) {
      return new SemVer(a, loose).major;
    }
    exports2.minor = minor;
    function minor(a, loose) {
      return new SemVer(a, loose).minor;
    }
    exports2.patch = patch;
    function patch(a, loose) {
      return new SemVer(a, loose).patch;
    }
    exports2.compare = compare;
    function compare(a, b, loose) {
      return new SemVer(a, loose).compare(new SemVer(b, loose));
    }
    exports2.compareLoose = compareLoose;
    function compareLoose(a, b) {
      return compare(a, b, true);
    }
    exports2.compareBuild = compareBuild;
    function compareBuild(a, b, loose) {
      var versionA = new SemVer(a, loose);
      var versionB = new SemVer(b, loose);
      return versionA.compare(versionB) || versionA.compareBuild(versionB);
    }
    exports2.rcompare = rcompare;
    function rcompare(a, b, loose) {
      return compare(b, a, loose);
    }
    exports2.sort = sort;
    function sort(list, loose) {
      return list.sort(function(a, b) {
        return exports2.compareBuild(a, b, loose);
      });
    }
    exports2.rsort = rsort;
    function rsort(list, loose) {
      return list.sort(function(a, b) {
        return exports2.compareBuild(b, a, loose);
      });
    }
    exports2.gt = gt;
    function gt(a, b, loose) {
      return compare(a, b, loose) > 0;
    }
    exports2.lt = lt;
    function lt(a, b, loose) {
      return compare(a, b, loose) < 0;
    }
    exports2.eq = eq;
    function eq(a, b, loose) {
      return compare(a, b, loose) === 0;
    }
    exports2.neq = neq;
    function neq(a, b, loose) {
      return compare(a, b, loose) !== 0;
    }
    exports2.gte = gte;
    function gte(a, b, loose) {
      return compare(a, b, loose) >= 0;
    }
    exports2.lte = lte;
    function lte(a, b, loose) {
      return compare(a, b, loose) <= 0;
    }
    exports2.cmp = cmp;
    function cmp(a, op, b, loose) {
      switch (op) {
        case "===":
          if (typeof a === "object")
            a = a.version;
          if (typeof b === "object")
            b = b.version;
          return a === b;
        case "!==":
          if (typeof a === "object")
            a = a.version;
          if (typeof b === "object")
            b = b.version;
          return a !== b;
        case "":
        case "=":
        case "==":
          return eq(a, b, loose);
        case "!=":
          return neq(a, b, loose);
        case ">":
          return gt(a, b, loose);
        case ">=":
          return gte(a, b, loose);
        case "<":
          return lt(a, b, loose);
        case "<=":
          return lte(a, b, loose);
        default:
          throw new TypeError("Invalid operator: " + op);
      }
    }
    exports2.Comparator = Comparator;
    function Comparator(comp, options) {
      if (!options || typeof options !== "object") {
        options = {
          loose: !!options,
          includePrerelease: false
        };
      }
      if (comp instanceof Comparator) {
        if (comp.loose === !!options.loose) {
          return comp;
        } else {
          comp = comp.value;
        }
      }
      if (!(this instanceof Comparator)) {
        return new Comparator(comp, options);
      }
      comp = comp.trim().split(/\s+/).join(" ");
      debug("comparator", comp, options);
      this.options = options;
      this.loose = !!options.loose;
      this.parse(comp);
      if (this.semver === ANY) {
        this.value = "";
      } else {
        this.value = this.operator + this.semver.version;
      }
      debug("comp", this);
    }
    var ANY = {};
    Comparator.prototype.parse = function(comp) {
      var r = this.options.loose ? safeRe[t.COMPARATORLOOSE] : safeRe[t.COMPARATOR];
      var m = comp.match(r);
      if (!m) {
        throw new TypeError("Invalid comparator: " + comp);
      }
      this.operator = m[1] !== void 0 ? m[1] : "";
      if (this.operator === "=") {
        this.operator = "";
      }
      if (!m[2]) {
        this.semver = ANY;
      } else {
        this.semver = new SemVer(m[2], this.options.loose);
      }
    };
    Comparator.prototype.toString = function() {
      return this.value;
    };
    Comparator.prototype.test = function(version) {
      debug("Comparator.test", version, this.options.loose);
      if (this.semver === ANY || version === ANY) {
        return true;
      }
      if (typeof version === "string") {
        try {
          version = new SemVer(version, this.options);
        } catch (er) {
          return false;
        }
      }
      return cmp(version, this.operator, this.semver, this.options);
    };
    Comparator.prototype.intersects = function(comp, options) {
      if (!(comp instanceof Comparator)) {
        throw new TypeError("a Comparator is required");
      }
      if (!options || typeof options !== "object") {
        options = {
          loose: !!options,
          includePrerelease: false
        };
      }
      var rangeTmp;
      if (this.operator === "") {
        if (this.value === "") {
          return true;
        }
        rangeTmp = new Range(comp.value, options);
        return satisfies(this.value, rangeTmp, options);
      } else if (comp.operator === "") {
        if (comp.value === "") {
          return true;
        }
        rangeTmp = new Range(this.value, options);
        return satisfies(comp.semver, rangeTmp, options);
      }
      var sameDirectionIncreasing = (this.operator === ">=" || this.operator === ">") && (comp.operator === ">=" || comp.operator === ">");
      var sameDirectionDecreasing = (this.operator === "<=" || this.operator === "<") && (comp.operator === "<=" || comp.operator === "<");
      var sameSemVer = this.semver.version === comp.semver.version;
      var differentDirectionsInclusive = (this.operator === ">=" || this.operator === "<=") && (comp.operator === ">=" || comp.operator === "<=");
      var oppositeDirectionsLessThan = cmp(this.semver, "<", comp.semver, options) && ((this.operator === ">=" || this.operator === ">") && (comp.operator === "<=" || comp.operator === "<"));
      var oppositeDirectionsGreaterThan = cmp(this.semver, ">", comp.semver, options) && ((this.operator === "<=" || this.operator === "<") && (comp.operator === ">=" || comp.operator === ">"));
      return sameDirectionIncreasing || sameDirectionDecreasing || sameSemVer && differentDirectionsInclusive || oppositeDirectionsLessThan || oppositeDirectionsGreaterThan;
    };
    exports2.Range = Range;
    function Range(range, options) {
      if (!options || typeof options !== "object") {
        options = {
          loose: !!options,
          includePrerelease: false
        };
      }
      if (range instanceof Range) {
        if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) {
          return range;
        } else {
          return new Range(range.raw, options);
        }
      }
      if (range instanceof Comparator) {
        return new Range(range.value, options);
      }
      if (!(this instanceof Range)) {
        return new Range(range, options);
      }
      this.options = options;
      this.loose = !!options.loose;
      this.includePrerelease = !!options.includePrerelease;
      this.raw = range.trim().split(/\s+/).join(" ");
      this.set = this.raw.split("||").map(function(range2) {
        return this.parseRange(range2.trim());
      }, this).filter(function(c) {
        return c.length;
      });
      if (!this.set.length) {
        throw new TypeError("Invalid SemVer Range: " + this.raw);
      }
      this.format();
    }
    Range.prototype.format = function() {
      this.range = this.set.map(function(comps) {
        return comps.join(" ").trim();
      }).join("||").trim();
      return this.range;
    };
    Range.prototype.toString = function() {
      return this.range;
    };
    Range.prototype.parseRange = function(range) {
      var loose = this.options.loose;
      var hr = loose ? safeRe[t.HYPHENRANGELOOSE] : safeRe[t.HYPHENRANGE];
      range = range.replace(hr, hyphenReplace);
      debug("hyphen replace", range);
      range = range.replace(safeRe[t.COMPARATORTRIM], comparatorTrimReplace);
      debug("comparator trim", range, safeRe[t.COMPARATORTRIM]);
      range = range.replace(safeRe[t.TILDETRIM], tildeTrimReplace);
      range = range.replace(safeRe[t.CARETTRIM], caretTrimReplace);
      range = range.split(/\s+/).join(" ");
      var compRe = loose ? safeRe[t.COMPARATORLOOSE] : safeRe[t.COMPARATOR];
      var set = range.split(" ").map(function(comp) {
        return parseComparator(comp, this.options);
      }, this).join(" ").split(/\s+/);
      if (this.options.loose) {
        set = set.filter(function(comp) {
          return !!comp.match(compRe);
        });
      }
      set = set.map(function(comp) {
        return new Comparator(comp, this.options);
      }, this);
      return set;
    };
    Range.prototype.intersects = function(range, options) {
      if (!(range instanceof Range)) {
        throw new TypeError("a Range is required");
      }
      return this.set.some(function(thisComparators) {
        return isSatisfiable(thisComparators, options) && range.set.some(function(rangeComparators) {
          return isSatisfiable(rangeComparators, options) && thisComparators.every(function(thisComparator) {
            return rangeComparators.every(function(rangeComparator) {
              return thisComparator.intersects(rangeComparator, options);
            });
          });
        });
      });
    };
    function isSatisfiable(comparators, options) {
      var result = true;
      var remainingComparators = comparators.slice();
      var testComparator = remainingComparators.pop();
      while (result && remainingComparators.length) {
        result = remainingComparators.every(function(otherComparator) {
          return testComparator.intersects(otherComparator, options);
        });
        testComparator = remainingComparators.pop();
      }
      return result;
    }
    exports2.toComparators = toComparators;
    function toComparators(range, options) {
      return new Range(range, options).set.map(function(comp) {
        return comp.map(function(c) {
          return c.value;
        }).join(" ").trim().split(" ");
      });
    }
    function parseComparator(comp, options) {
      debug("comp", comp, options);
      comp = replaceCarets(comp, options);
      debug("caret", comp);
      comp = replaceTildes(comp, options);
      debug("tildes", comp);
      comp = replaceXRanges(comp, options);
      debug("xrange", comp);
      comp = replaceStars(comp, options);
      debug("stars", comp);
      return comp;
    }
    function isX(id) {
      return !id || id.toLowerCase() === "x" || id === "*";
    }
    function replaceTildes(comp, options) {
      return comp.trim().split(/\s+/).map(function(comp2) {
        return replaceTilde(comp2, options);
      }).join(" ");
    }
    function replaceTilde(comp, options) {
      var r = options.loose ? safeRe[t.TILDELOOSE] : safeRe[t.TILDE];
      return comp.replace(r, function(_, M, m, p, pr) {
        debug("tilde", comp, _, M, m, p, pr);
        var ret;
        if (isX(M)) {
          ret = "";
        } else if (isX(m)) {
          ret = ">=" + M + ".0.0 <" + (+M + 1) + ".0.0";
        } else if (isX(p)) {
          ret = ">=" + M + "." + m + ".0 <" + M + "." + (+m + 1) + ".0";
        } else if (pr) {
          debug("replaceTilde pr", pr);
          ret = ">=" + M + "." + m + "." + p + "-" + pr + " <" + M + "." + (+m + 1) + ".0";
        } else {
          ret = ">=" + M + "." + m + "." + p + " <" + M + "." + (+m + 1) + ".0";
        }
        debug("tilde return", ret);
        return ret;
      });
    }
    function replaceCarets(comp, options) {
      return comp.trim().split(/\s+/).map(function(comp2) {
        return replaceCaret(comp2, options);
      }).join(" ");
    }
    function replaceCaret(comp, options) {
      debug("caret", comp, options);
      var r = options.loose ? safeRe[t.CARETLOOSE] : safeRe[t.CARET];
      return comp.replace(r, function(_, M, m, p, pr) {
        debug("caret", comp, _, M, m, p, pr);
        var ret;
        if (isX(M)) {
          ret = "";
        } else if (isX(m)) {
          ret = ">=" + M + ".0.0 <" + (+M + 1) + ".0.0";
        } else if (isX(p)) {
          if (M === "0") {
            ret = ">=" + M + "." + m + ".0 <" + M + "." + (+m + 1) + ".0";
          } else {
            ret = ">=" + M + "." + m + ".0 <" + (+M + 1) + ".0.0";
          }
        } else if (pr) {
          debug("replaceCaret pr", pr);
          if (M === "0") {
            if (m === "0") {
              ret = ">=" + M + "." + m + "." + p + "-" + pr + " <" + M + "." + m + "." + (+p + 1);
            } else {
              ret = ">=" + M + "." + m + "." + p + "-" + pr + " <" + M + "." + (+m + 1) + ".0";
            }
          } else {
            ret = ">=" + M + "." + m + "." + p + "-" + pr + " <" + (+M + 1) + ".0.0";
          }
        } else {
          debug("no pr");
          if (M === "0") {
            if (m === "0") {
              ret = ">=" + M + "." + m + "." + p + " <" + M + "." + m + "." + (+p + 1);
            } else {
              ret = ">=" + M + "." + m + "." + p + " <" + M + "." + (+m + 1) + ".0";
            }
          } else {
            ret = ">=" + M + "." + m + "." + p + " <" + (+M + 1) + ".0.0";
          }
        }
        debug("caret return", ret);
        return ret;
      });
    }
    function replaceXRanges(comp, options) {
      debug("replaceXRanges", comp, options);
      return comp.split(/\s+/).map(function(comp2) {
        return replaceXRange(comp2, options);
      }).join(" ");
    }
    function replaceXRange(comp, options) {
      comp = comp.trim();
      var r = options.loose ? safeRe[t.XRANGELOOSE] : safeRe[t.XRANGE];
      return comp.replace(r, function(ret, gtlt, M, m, p, pr) {
        debug("xRange", comp, ret, gtlt, M, m, p, pr);
        var xM = isX(M);
        var xm = xM || isX(m);
        var xp = xm || isX(p);
        var anyX = xp;
        if (gtlt === "=" && anyX) {
          gtlt = "";
        }
        pr = options.includePrerelease ? "-0" : "";
        if (xM) {
          if (gtlt === ">" || gtlt === "<") {
            ret = "<0.0.0-0";
          } else {
            ret = "*";
          }
        } else if (gtlt && anyX) {
          if (xm) {
            m = 0;
          }
          p = 0;
          if (gtlt === ">") {
            gtlt = ">=";
            if (xm) {
              M = +M + 1;
              m = 0;
              p = 0;
            } else {
              m = +m + 1;
              p = 0;
            }
          } else if (gtlt === "<=") {
            gtlt = "<";
            if (xm) {
              M = +M + 1;
            } else {
              m = +m + 1;
            }
          }
          ret = gtlt + M + "." + m + "." + p + pr;
        } else if (xm) {
          ret = ">=" + M + ".0.0" + pr + " <" + (+M + 1) + ".0.0" + pr;
        } else if (xp) {
          ret = ">=" + M + "." + m + ".0" + pr + " <" + M + "." + (+m + 1) + ".0" + pr;
        }
        debug("xRange return", ret);
        return ret;
      });
    }
    function replaceStars(comp, options) {
      debug("replaceStars", comp, options);
      return comp.trim().replace(safeRe[t.STAR], "");
    }
    function hyphenReplace($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr, tb) {
      if (isX(fM)) {
        from = "";
      } else if (isX(fm)) {
        from = ">=" + fM + ".0.0";
      } else if (isX(fp)) {
        from = ">=" + fM + "." + fm + ".0";
      } else {
        from = ">=" + from;
      }
      if (isX(tM)) {
        to = "";
      } else if (isX(tm)) {
        to = "<" + (+tM + 1) + ".0.0";
      } else if (isX(tp)) {
        to = "<" + tM + "." + (+tm + 1) + ".0";
      } else if (tpr) {
        to = "<=" + tM + "." + tm + "." + tp + "-" + tpr;
      } else {
        to = "<=" + to;
      }
      return (from + " " + to).trim();
    }
    Range.prototype.test = function(version) {
      if (!version) {
        return false;
      }
      if (typeof version === "string") {
        try {
          version = new SemVer(version, this.options);
        } catch (er) {
          return false;
        }
      }
      for (var i2 = 0; i2 < this.set.length; i2++) {
        if (testSet(this.set[i2], version, this.options)) {
          return true;
        }
      }
      return false;
    };
    function testSet(set, version, options) {
      for (var i2 = 0; i2 < set.length; i2++) {
        if (!set[i2].test(version)) {
          return false;
        }
      }
      if (version.prerelease.length && !options.includePrerelease) {
        for (i2 = 0; i2 < set.length; i2++) {
          debug(set[i2].semver);
          if (set[i2].semver === ANY) {
            continue;
          }
          if (set[i2].semver.prerelease.length > 0) {
            var allowed = set[i2].semver;
            if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) {
              return true;
            }
          }
        }
        return false;
      }
      return true;
    }
    exports2.satisfies = satisfies;
    function satisfies(version, range, options) {
      try {
        range = new Range(range, options);
      } catch (er) {
        return false;
      }
      return range.test(version);
    }
    exports2.maxSatisfying = maxSatisfying;
    function maxSatisfying(versions, range, options) {
      var max = null;
      var maxSV = null;
      try {
        var rangeObj = new Range(range, options);
      } catch (er) {
        return null;
      }
      versions.forEach(function(v) {
        if (rangeObj.test(v)) {
          if (!max || maxSV.compare(v) === -1) {
            max = v;
            maxSV = new SemVer(max, options);
          }
        }
      });
      return max;
    }
    exports2.minSatisfying = minSatisfying;
    function minSatisfying(versions, range, options) {
      var min = null;
      var minSV = null;
      try {
        var rangeObj = new Range(range, options);
      } catch (er) {
        return null;
      }
      versions.forEach(function(v) {
        if (rangeObj.test(v)) {
          if (!min || minSV.compare(v) === 1) {
            min = v;
            minSV = new SemVer(min, options);
          }
        }
      });
      return min;
    }
    exports2.minVersion = minVersion;
    function minVersion(range, loose) {
      range = new Range(range, loose);
      var minver = new SemVer("0.0.0");
      if (range.test(minver)) {
        return minver;
      }
      minver = new SemVer("0.0.0-0");
      if (range.test(minver)) {
        return minver;
      }
      minver = null;
      for (var i2 = 0; i2 < range.set.length; ++i2) {
        var comparators = range.set[i2];
        comparators.forEach(function(comparator) {
          var compver = new SemVer(comparator.semver.version);
          switch (comparator.operator) {
            case ">":
              if (compver.prerelease.length === 0) {
                compver.patch++;
              } else {
                compver.prerelease.push(0);
              }
              compver.raw = compver.format();
            /* fallthrough */
            case "":
            case ">=":
              if (!minver || gt(minver, compver)) {
                minver = compver;
              }
              break;
            case "<":
            case "<=":
              break;
            /* istanbul ignore next */
            default:
              throw new Error("Unexpected operation: " + comparator.operator);
          }
        });
      }
      if (minver && range.test(minver)) {
        return minver;
      }
      return null;
    }
    exports2.validRange = validRange;
    function validRange(range, options) {
      try {
        return new Range(range, options).range || "*";
      } catch (er) {
        return null;
      }
    }
    exports2.ltr = ltr;
    function ltr(version, range, options) {
      return outside(version, range, "<", options);
    }
    exports2.gtr = gtr;
    function gtr(version, range, options) {
      return outside(version, range, ">", options);
    }
    exports2.outside = outside;
    function outside(version, range, hilo, options) {
      version = new SemVer(version, options);
      range = new Range(range, options);
      var gtfn, ltefn, ltfn, comp, ecomp;
      switch (hilo) {
        case ">":
          gtfn = gt;
          ltefn = lte;
          ltfn = lt;
          comp = ">";
          ecomp = ">=";
          break;
        case "<":
          gtfn = lt;
          ltefn = gte;
          ltfn = gt;
          comp = "<";
          ecomp = "<=";
          break;
        default:
          throw new TypeError('Must provide a hilo val of "<" or ">"');
      }
      if (satisfies(version, range, options)) {
        return false;
      }
      for (var i2 = 0; i2 < range.set.length; ++i2) {
        var comparators = range.set[i2];
        var high = null;
        var low = null;
        comparators.forEach(function(comparator) {
          if (comparator.semver === ANY) {
            comparator = new Comparator(">=0.0.0");
          }
          high = high || comparator;
          low = low || comparator;
          if (gtfn(comparator.semver, high.semver, options)) {
            high = comparator;
          } else if (ltfn(comparator.semver, low.semver, options)) {
            low = comparator;
          }
        });
        if (high.operator === comp || high.operator === ecomp) {
          return false;
        }
        if ((!low.operator || low.operator === comp) && ltefn(version, low.semver)) {
          return false;
        } else if (low.operator === ecomp && ltfn(version, low.semver)) {
          return false;
        }
      }
      return true;
    }
    exports2.prerelease = prerelease;
    function prerelease(version, options) {
      var parsed = parse2(version, options);
      return parsed && parsed.prerelease.length ? parsed.prerelease : null;
    }
    exports2.intersects = intersects;
    function intersects(r1, r2, options) {
      r1 = new Range(r1, options);
      r2 = new Range(r2, options);
      return r1.intersects(r2);
    }
    exports2.coerce = coerce;
    function coerce(version, options) {
      if (version instanceof SemVer) {
        return version;
      }
      if (typeof version === "number") {
        version = String(version);
      }
      if (typeof version !== "string") {
        return null;
      }
      options = options || {};
      var match = null;
      if (!options.rtl) {
        match = version.match(safeRe[t.COERCE]);
      } else {
        var next;
        while ((next = safeRe[t.COERCERTL].exec(version)) && (!match || match.index + match[0].length !== version.length)) {
          if (!match || next.index + next[0].length !== match.index + match[0].length) {
            match = next;
          }
          safeRe[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length;
        }
        safeRe[t.COERCERTL].lastIndex = -1;
      }
      if (match === null) {
        return null;
      }
      return parse2(match[2] + "." + (match[3] || "0") + "." + (match[4] || "0"), options);
    }
  }
});

// node_modules/@babel/helper-member-expression-to-functions/lib/index.js
var require_lib17 = __commonJS({
  "node_modules/@babel/helper-member-expression-to-functions/lib/index.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    var _t = require_lib3();
    function _interopNamespace(e) {
      if (e && e.__esModule) return e;
      var n = /* @__PURE__ */ Object.create(null);
      if (e) {
        Object.keys(e).forEach(function(k) {
          if (k !== "default") {
            var d = Object.getOwnPropertyDescriptor(e, k);
            Object.defineProperty(n, k, d.get ? d : {
              enumerable: true,
              get: function() {
                return e[k];
              }
            });
          }
        });
      }
      n.default = e;
      return Object.freeze(n);
    }
    var _t__namespace = /* @__PURE__ */ _interopNamespace(_t);
    function willPathCastToBoolean(path) {
      const maybeWrapped = path;
      const {
        node,
        parentPath
      } = maybeWrapped;
      if (parentPath.isLogicalExpression()) {
        const {
          operator,
          right
        } = parentPath.node;
        if (operator === "&&" || operator === "||" || operator === "??" && node === right) {
          return willPathCastToBoolean(parentPath);
        }
      }
      if (parentPath.isSequenceExpression()) {
        const {
          expressions
        } = parentPath.node;
        if (expressions[expressions.length - 1] === node) {
          return willPathCastToBoolean(parentPath);
        } else {
          return true;
        }
      }
      return parentPath.isConditional({
        test: node
      }) || parentPath.isUnaryExpression({
        operator: "!"
      }) || parentPath.isForStatement({
        test: node
      }) || parentPath.isWhile({
        test: node
      });
    }
    var {
      LOGICAL_OPERATORS,
      arrowFunctionExpression,
      assignmentExpression,
      binaryExpression,
      booleanLiteral,
      callExpression,
      cloneNode,
      conditionalExpression,
      identifier,
      isMemberExpression,
      isOptionalCallExpression,
      isOptionalMemberExpression,
      isUpdateExpression,
      logicalExpression,
      memberExpression,
      nullLiteral,
      optionalCallExpression,
      optionalMemberExpression,
      sequenceExpression,
      updateExpression
    } = _t__namespace;
    var AssignmentMemoiser = class {
      constructor() {
        this._map = void 0;
        this._map = /* @__PURE__ */ new WeakMap();
      }
      has(key) {
        return this._map.has(key);
      }
      get(key) {
        if (!this.has(key)) return;
        const record = this._map.get(key);
        const {
          value: value2
        } = record;
        record.count--;
        if (record.count === 0) {
          return assignmentExpression("=", value2, key);
        }
        return value2;
      }
      set(key, value2, count) {
        return this._map.set(key, {
          count,
          value: value2
        });
      }
    };
    function toNonOptional(path, base) {
      const {
        node
      } = path;
      if (isOptionalMemberExpression(node)) {
        return memberExpression(base, node.property, node.computed);
      }
      if (path.isOptionalCallExpression()) {
        const callee = path.get("callee");
        if (path.node.optional && callee.isOptionalMemberExpression()) {
          const object = callee.node.object;
          const context = path.scope.maybeGenerateMemoised(object);
          callee.get("object").replaceWith(assignmentExpression("=", context, object));
          return callExpression(memberExpression(base, identifier("call")), [context, ...path.node.arguments]);
        }
        return callExpression(base, path.node.arguments);
      }
      return path.node;
    }
    function isInDetachedTree(path) {
      while (path) {
        if (path.isProgram()) break;
        const {
          parentPath,
          container,
          listKey
        } = path;
        const parentNode = parentPath.node;
        if (listKey) {
          if (container !== parentNode[listKey]) {
            return true;
          }
        } else {
          if (container !== parentNode) return true;
        }
        path = parentPath;
      }
      return false;
    }
    var handle = {
      memoise() {
      },
      handle(member, noDocumentAll) {
        const {
          node,
          parent,
          parentPath,
          scope
        } = member;
        if (member.isOptionalMemberExpression()) {
          if (isInDetachedTree(member)) return;
          const endPath = member.find(({
            node: node2,
            parent: parent2
          }) => {
            if (isOptionalMemberExpression(parent2)) {
              return parent2.optional || parent2.object !== node2;
            }
            if (isOptionalCallExpression(parent2)) {
              return node2 !== member.node && parent2.optional || parent2.callee !== node2;
            }
            return true;
          });
          if (scope.path.isPattern()) {
            endPath.replaceWith(callExpression(arrowFunctionExpression([], endPath.node), []));
            return;
          }
          const willEndPathCastToBoolean = willPathCastToBoolean(endPath);
          const rootParentPath = endPath.parentPath;
          if (rootParentPath.isUpdateExpression({
            argument: node
          })) {
            throw member.buildCodeFrameError(`can't handle update expression`);
          }
          const isAssignment = rootParentPath.isAssignmentExpression({
            left: endPath.node
          });
          const isDeleteOperation = rootParentPath.isUnaryExpression({
            operator: "delete"
          });
          if (isDeleteOperation && endPath.isOptionalMemberExpression() && endPath.get("property").isPrivateName()) {
            throw member.buildCodeFrameError(`can't delete a private class element`);
          }
          let startingOptional = member;
          for (; ; ) {
            if (startingOptional.isOptionalMemberExpression()) {
              if (startingOptional.node.optional) break;
              startingOptional = startingOptional.get("object");
              continue;
            } else if (startingOptional.isOptionalCallExpression()) {
              if (startingOptional.node.optional) break;
              startingOptional = startingOptional.get("callee");
              continue;
            }
            throw new Error(`Internal error: unexpected ${startingOptional.node.type}`);
          }
          const startingNode = startingOptional.isOptionalMemberExpression() ? startingOptional.node.object : startingOptional.node.callee;
          const baseNeedsMemoised = scope.maybeGenerateMemoised(startingNode);
          const baseRef = baseNeedsMemoised != null ? baseNeedsMemoised : startingNode;
          const parentIsOptionalCall = parentPath.isOptionalCallExpression({
            callee: node
          });
          const isOptionalCall = (parent2) => parentIsOptionalCall;
          const parentIsCall = parentPath.isCallExpression({
            callee: node
          });
          startingOptional.replaceWith(toNonOptional(startingOptional, baseRef));
          if (isOptionalCall()) {
            if (parent.optional) {
              parentPath.replaceWith(this.optionalCall(member, parent.arguments));
            } else {
              parentPath.replaceWith(this.call(member, parent.arguments));
            }
          } else if (parentIsCall) {
            member.replaceWith(this.boundGet(member));
          } else if (this.delete && parentPath.isUnaryExpression({
            operator: "delete"
          })) {
            parentPath.replaceWith(this.delete(member));
          } else if (parentPath.isAssignmentExpression()) {
            handleAssignment(this, member, parentPath);
          } else {
            member.replaceWith(this.get(member));
          }
          let regular = member.node;
          for (let current = member; current !== endPath; ) {
            const parentPath2 = current.parentPath;
            if (parentPath2 === endPath && isOptionalCall() && parent.optional) {
              regular = parentPath2.node;
              break;
            }
            regular = toNonOptional(parentPath2, regular);
            current = parentPath2;
          }
          let context;
          const endParentPath = endPath.parentPath;
          if (isMemberExpression(regular) && endParentPath.isOptionalCallExpression({
            callee: endPath.node,
            optional: true
          })) {
            const {
              object
            } = regular;
            context = member.scope.maybeGenerateMemoised(object);
            if (context) {
              regular.object = assignmentExpression("=", context, object);
            }
          }
          let replacementPath = endPath;
          if (isDeleteOperation || isAssignment) {
            replacementPath = endParentPath;
            regular = endParentPath.node;
          }
          const baseMemoised = baseNeedsMemoised ? assignmentExpression("=", cloneNode(baseRef), cloneNode(startingNode)) : cloneNode(baseRef);
          if (willEndPathCastToBoolean) {
            let nonNullishCheck;
            if (noDocumentAll) {
              nonNullishCheck = binaryExpression("!=", baseMemoised, nullLiteral());
            } else {
              nonNullishCheck = logicalExpression("&&", binaryExpression("!==", baseMemoised, nullLiteral()), binaryExpression("!==", cloneNode(baseRef), scope.buildUndefinedNode()));
            }
            replacementPath.replaceWith(logicalExpression("&&", nonNullishCheck, regular));
          } else {
            let nullishCheck;
            if (noDocumentAll) {
              nullishCheck = binaryExpression("==", baseMemoised, nullLiteral());
            } else {
              nullishCheck = logicalExpression("||", binaryExpression("===", baseMemoised, nullLiteral()), binaryExpression("===", cloneNode(baseRef), scope.buildUndefinedNode()));
            }
            replacementPath.replaceWith(conditionalExpression(nullishCheck, isDeleteOperation ? booleanLiteral(true) : scope.buildUndefinedNode(), regular));
          }
          if (context) {
            const endParent = endParentPath.node;
            endParentPath.replaceWith(optionalCallExpression(optionalMemberExpression(endParent.callee, identifier("call"), false, true), [cloneNode(context), ...endParent.arguments], false));
          }
          return;
        }
        if (isUpdateExpression(parent, {
          argument: node
        })) {
          if (this.simpleSet) {
            member.replaceWith(this.simpleSet(member));
            return;
          }
          const {
            operator,
            prefix
          } = parent;
          this.memoise(member, 2);
          const ref = scope.generateUidIdentifierBasedOnNode(node);
          scope.push({
            id: ref
          });
          const seq = [assignmentExpression("=", cloneNode(ref), this.get(member))];
          if (prefix) {
            seq.push(updateExpression(operator, cloneNode(ref), prefix));
            const value2 = sequenceExpression(seq);
            parentPath.replaceWith(this.set(member, value2));
            return;
          } else {
            const ref2 = scope.generateUidIdentifierBasedOnNode(node);
            scope.push({
              id: ref2
            });
            seq.push(assignmentExpression("=", cloneNode(ref2), updateExpression(operator, cloneNode(ref), prefix)), cloneNode(ref));
            const value2 = sequenceExpression(seq);
            parentPath.replaceWith(sequenceExpression([this.set(member, value2), cloneNode(ref2)]));
            return;
          }
        }
        if (parentPath.isAssignmentExpression({
          left: node
        })) {
          handleAssignment(this, member, parentPath);
          return;
        }
        if (parentPath.isCallExpression({
          callee: node
        })) {
          parentPath.replaceWith(this.call(member, parentPath.node.arguments));
          return;
        }
        if (parentPath.isOptionalCallExpression({
          callee: node
        })) {
          if (scope.path.isPattern()) {
            parentPath.replaceWith(callExpression(arrowFunctionExpression([], parentPath.node), []));
            return;
          }
          parentPath.replaceWith(this.optionalCall(member, parentPath.node.arguments));
          return;
        }
        if (this.delete && parentPath.isUnaryExpression({
          operator: "delete"
        })) {
          parentPath.replaceWith(this.delete(member));
          return;
        }
        if (parentPath.isForXStatement({
          left: node
        }) || parentPath.isObjectProperty({
          value: node
        }) && parentPath.parentPath.isObjectPattern() || parentPath.isAssignmentPattern({
          left: node
        }) && parentPath.parentPath.isObjectProperty({
          value: parent
        }) && parentPath.parentPath.parentPath.isObjectPattern() || parentPath.isArrayPattern() || parentPath.isAssignmentPattern({
          left: node
        }) && parentPath.parentPath.isArrayPattern() || parentPath.isRestElement()) {
          member.replaceWith(this.destructureSet(member));
          return;
        }
        if (parentPath.isTaggedTemplateExpression()) {
          member.replaceWith(this.boundGet(member));
        } else {
          member.replaceWith(this.get(member));
        }
      }
    };
    function handleAssignment(state, member, parentPath) {
      if (state.simpleSet) {
        member.replaceWith(state.simpleSet(member));
        return;
      }
      const {
        operator,
        right: value2
      } = parentPath.node;
      if (operator === "=") {
        parentPath.replaceWith(state.set(member, value2));
      } else {
        const operatorTrunc = operator.slice(0, -1);
        if (LOGICAL_OPERATORS.includes(operatorTrunc)) {
          state.memoise(member, 1);
          parentPath.replaceWith(logicalExpression(operatorTrunc, state.get(member), state.set(member, value2)));
        } else {
          state.memoise(member, 2);
          parentPath.replaceWith(state.set(member, binaryExpression(operatorTrunc, state.get(member), value2)));
        }
      }
    }
    function memberExpressionToFunctions(path, visitor, state) {
      path.traverse(visitor, Object.assign({}, handle, state, {
        memoiser: new AssignmentMemoiser()
      }));
    }
    exports2.default = memberExpressionToFunctions;
  }
});

// node_modules/@babel/helper-optimise-call-expression/lib/index.js
var require_lib18 = __commonJS({
  "node_modules/@babel/helper-optimise-call-expression/lib/index.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = optimiseCallExpression;
    var _t = require_lib3();
    var {
      callExpression,
      identifier,
      isIdentifier,
      isSpreadElement,
      memberExpression,
      optionalCallExpression,
      optionalMemberExpression
    } = _t;
    function optimiseCallExpression(callee, thisNode, args, optional) {
      if (args.length === 1 && isSpreadElement(args[0]) && isIdentifier(args[0].argument, {
        name: "arguments"
      })) {
        if (optional) {
          return optionalCallExpression(optionalMemberExpression(callee, identifier("apply"), false, true), [thisNode, args[0].argument], false);
        }
        return callExpression(memberExpression(callee, identifier("apply")), [thisNode, args[0].argument]);
      } else {
        if (optional) {
          return optionalCallExpression(optionalMemberExpression(callee, identifier("call"), false, true), [thisNode, ...args], false);
        }
        return callExpression(memberExpression(callee, identifier("call")), [thisNode, ...args]);
      }
    }
  }
});

// node_modules/@babel/helper-replace-supers/lib/index.js
var require_lib19 = __commonJS({
  "node_modules/@babel/helper-replace-supers/lib/index.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = void 0;
    var _helperMemberExpressionToFunctions = require_lib17();
    var _helperOptimiseCallExpression = require_lib18();
    var _core = require_lib27();
    var _traverse = require_lib9();
    var {
      assignmentExpression,
      callExpression,
      cloneNode,
      identifier,
      memberExpression,
      sequenceExpression,
      stringLiteral,
      thisExpression
    } = _core.types;
    exports2.environmentVisitor = _traverse.visitors.environmentVisitor({});
    exports2.skipAllButComputedKey = function skipAllButComputedKey(path) {
      path.skip();
      if (path.node.computed) {
        path.context.maybeQueue(path.get("key"));
      }
    };
    var visitor = _traverse.visitors.environmentVisitor({
      Super(path, state) {
        const {
          node,
          parentPath
        } = path;
        if (!parentPath.isMemberExpression({
          object: node
        })) return;
        state.handle(parentPath);
      }
    });
    var unshadowSuperBindingVisitor = _traverse.visitors.environmentVisitor({
      Scopable(path, {
        refName
      }) {
        const binding = path.scope.getOwnBinding(refName);
        if ((binding == null ? void 0 : binding.identifier.name) === refName) {
          path.scope.rename(refName);
        }
      }
    });
    var specHandlers = {
      memoise(superMember, count) {
        const {
          scope,
          node
        } = superMember;
        const {
          computed,
          property
        } = node;
        if (!computed) {
          return;
        }
        const memo = scope.maybeGenerateMemoised(property);
        if (!memo) {
          return;
        }
        this.memoiser.set(property, memo, count);
      },
      prop(superMember) {
        const {
          computed,
          property
        } = superMember.node;
        if (this.memoiser.has(property)) {
          return cloneNode(this.memoiser.get(property));
        }
        if (computed) {
          return cloneNode(property);
        }
        return stringLiteral(property.name);
      },
      _getPrototypeOfExpression() {
        const objectRef = cloneNode(this.getObjectRef());
        const targetRef = this.isStatic || this.isPrivateMethod ? objectRef : memberExpression(objectRef, identifier("prototype"));
        return callExpression(this.file.addHelper("getPrototypeOf"), [targetRef]);
      },
      get(superMember) {
        const objectRef = cloneNode(this.getObjectRef());
        return callExpression(this.file.addHelper("superPropGet"), [this.isDerivedConstructor ? sequenceExpression([thisExpression(), objectRef]) : objectRef, this.prop(superMember), thisExpression(), ...this.isStatic || this.isPrivateMethod ? [] : [_core.types.numericLiteral(1)]]);
      },
      _call(superMember, args, optional) {
        const objectRef = cloneNode(this.getObjectRef());
        let argsNode;
        if (args.length === 1 && _core.types.isSpreadElement(args[0]) && (_core.types.isIdentifier(args[0].argument) || _core.types.isArrayExpression(args[0].argument))) {
          argsNode = args[0].argument;
        } else {
          argsNode = _core.types.arrayExpression(args);
        }
        const call = _core.types.callExpression(this.file.addHelper("superPropGet"), [this.isDerivedConstructor ? sequenceExpression([thisExpression(), objectRef]) : objectRef, this.prop(superMember), thisExpression(), _core.types.numericLiteral(2 | (this.isStatic || this.isPrivateMethod ? 0 : 1))]);
        if (optional) {
          return _core.types.optionalCallExpression(call, [argsNode], true);
        }
        return callExpression(call, [argsNode]);
      },
      set(superMember, value2) {
        const objectRef = cloneNode(this.getObjectRef());
        return callExpression(this.file.addHelper("superPropSet"), [this.isDerivedConstructor ? sequenceExpression([thisExpression(), objectRef]) : objectRef, this.prop(superMember), value2, thisExpression(), _core.types.numericLiteral(superMember.isInStrictMode() ? 1 : 0), ...this.isStatic || this.isPrivateMethod ? [] : [_core.types.numericLiteral(1)]]);
      },
      destructureSet(superMember) {
        throw superMember.buildCodeFrameError(`Destructuring to a super field is not supported yet.`);
      },
      call(superMember, args) {
        return this._call(superMember, args, false);
      },
      optionalCall(superMember, args) {
        return this._call(superMember, args, true);
      },
      delete(superMember) {
        if (superMember.node.computed) {
          return sequenceExpression([callExpression(this.file.addHelper("toPropertyKey"), [cloneNode(superMember.node.property)]), _core.template.expression.ast`
          function () { throw new ReferenceError("'delete super[expr]' is invalid"); }()
        `]);
        } else {
          return _core.template.expression.ast`
        function () { throw new ReferenceError("'delete super.prop' is invalid"); }()
      `;
        }
      }
    };
    var specHandlers_old = {
      memoise(superMember, count) {
        const {
          scope,
          node
        } = superMember;
        const {
          computed,
          property
        } = node;
        if (!computed) {
          return;
        }
        const memo = scope.maybeGenerateMemoised(property);
        if (!memo) {
          return;
        }
        this.memoiser.set(property, memo, count);
      },
      prop(superMember) {
        const {
          computed,
          property
        } = superMember.node;
        if (this.memoiser.has(property)) {
          return cloneNode(this.memoiser.get(property));
        }
        if (computed) {
          return cloneNode(property);
        }
        return stringLiteral(property.name);
      },
      _getPrototypeOfExpression() {
        const objectRef = cloneNode(this.getObjectRef());
        const targetRef = this.isStatic || this.isPrivateMethod ? objectRef : memberExpression(objectRef, identifier("prototype"));
        return callExpression(this.file.addHelper("getPrototypeOf"), [targetRef]);
      },
      get(superMember) {
        return this._get(superMember);
      },
      _get(superMember) {
        const proto = this._getPrototypeOfExpression();
        return callExpression(this.file.addHelper("get"), [this.isDerivedConstructor ? sequenceExpression([thisExpression(), proto]) : proto, this.prop(superMember), thisExpression()]);
      },
      set(superMember, value2) {
        const proto = this._getPrototypeOfExpression();
        return callExpression(this.file.addHelper("set"), [this.isDerivedConstructor ? sequenceExpression([thisExpression(), proto]) : proto, this.prop(superMember), value2, thisExpression(), _core.types.booleanLiteral(superMember.isInStrictMode())]);
      },
      destructureSet(superMember) {
        throw superMember.buildCodeFrameError(`Destructuring to a super field is not supported yet.`);
      },
      call(superMember, args) {
        return (0, _helperOptimiseCallExpression.default)(this._get(superMember), thisExpression(), args, false);
      },
      optionalCall(superMember, args) {
        return (0, _helperOptimiseCallExpression.default)(this._get(superMember), cloneNode(thisExpression()), args, true);
      },
      delete(superMember) {
        if (superMember.node.computed) {
          return sequenceExpression([callExpression(this.file.addHelper("toPropertyKey"), [cloneNode(superMember.node.property)]), _core.template.expression.ast`
          function () { throw new ReferenceError("'delete super[expr]' is invalid"); }()
        `]);
        } else {
          return _core.template.expression.ast`
        function () { throw new ReferenceError("'delete super.prop' is invalid"); }()
      `;
        }
      }
    };
    var looseHandlers = Object.assign({}, specHandlers, {
      prop(superMember) {
        const {
          property
        } = superMember.node;
        if (this.memoiser.has(property)) {
          return cloneNode(this.memoiser.get(property));
        }
        return cloneNode(property);
      },
      get(superMember) {
        const {
          isStatic,
          getSuperRef
        } = this;
        const {
          computed
        } = superMember.node;
        const prop = this.prop(superMember);
        let object;
        if (isStatic) {
          var _getSuperRef;
          object = (_getSuperRef = getSuperRef()) != null ? _getSuperRef : memberExpression(identifier("Function"), identifier("prototype"));
        } else {
          var _getSuperRef2;
          object = memberExpression((_getSuperRef2 = getSuperRef()) != null ? _getSuperRef2 : identifier("Object"), identifier("prototype"));
        }
        return memberExpression(object, prop, computed);
      },
      set(superMember, value2) {
        const {
          computed
        } = superMember.node;
        const prop = this.prop(superMember);
        return assignmentExpression("=", memberExpression(thisExpression(), prop, computed), value2);
      },
      destructureSet(superMember) {
        const {
          computed
        } = superMember.node;
        const prop = this.prop(superMember);
        return memberExpression(thisExpression(), prop, computed);
      },
      call(superMember, args) {
        return (0, _helperOptimiseCallExpression.default)(this.get(superMember), thisExpression(), args, false);
      },
      optionalCall(superMember, args) {
        return (0, _helperOptimiseCallExpression.default)(this.get(superMember), thisExpression(), args, true);
      }
    });
    var ReplaceSupers = class {
      constructor(opts) {
        var _opts$constantSuper;
        const path = opts.methodPath;
        this.methodPath = path;
        this.isDerivedConstructor = path.isClassMethod({
          kind: "constructor"
        }) && !!opts.superRef;
        this.isStatic = path.isObjectMethod() || path.node.static || (path.isStaticBlock == null ? void 0 : path.isStaticBlock());
        this.isPrivateMethod = path.isPrivate() && path.isMethod();
        this.file = opts.file;
        this.constantSuper = (_opts$constantSuper = opts.constantSuper) != null ? _opts$constantSuper : opts.isLoose;
        this.opts = opts;
      }
      getObjectRef() {
        return cloneNode(this.opts.objectRef || this.opts.getObjectRef());
      }
      getSuperRef() {
        if (this.opts.superRef) return cloneNode(this.opts.superRef);
        if (this.opts.getSuperRef) {
          return cloneNode(this.opts.getSuperRef());
        }
      }
      replace() {
        const {
          methodPath
        } = this;
        if (this.opts.refToPreserve) {
          methodPath.traverse(unshadowSuperBindingVisitor, {
            refName: this.opts.refToPreserve.name
          });
        }
        const handler = this.constantSuper ? looseHandlers : this.file.availableHelper("superPropSet") ? specHandlers : specHandlers_old;
        visitor.shouldSkip = (path) => {
          if (path.parentPath === methodPath) {
            if (path.parentKey === "decorators" || path.parentKey === "key") {
              return true;
            }
          }
        };
        (0, _helperMemberExpressionToFunctions.default)(methodPath, visitor, Object.assign({
          file: this.file,
          scope: this.methodPath.scope,
          isDerivedConstructor: this.isDerivedConstructor,
          isStatic: this.isStatic,
          isPrivateMethod: this.isPrivateMethod,
          getObjectRef: this.getObjectRef.bind(this),
          getSuperRef: this.getSuperRef.bind(this),
          boundGet: handler.get
        }, handler));
      }
    };
    exports2.default = ReplaceSupers;
  }
});

// node_modules/@babel/helper-annotate-as-pure/lib/index.js
var require_lib20 = __commonJS({
  "node_modules/@babel/helper-annotate-as-pure/lib/index.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = annotateAsPure;
    var _t = require_lib3();
    var {
      addComment
    } = _t;
    var PURE_ANNOTATION = "#__PURE__";
    var isPureAnnotated = ({
      leadingComments
    }) => !!leadingComments && leadingComments.some((comment) => /[@#]__PURE__/.test(comment.value));
    function annotateAsPure(pathOrNode) {
      const node = pathOrNode.node || pathOrNode;
      if (isPureAnnotated(node)) {
        return;
      }
      addComment(node, "leading", PURE_ANNOTATION);
    }
  }
});

// node_modules/@babel/helper-skip-transparent-expression-wrappers/lib/index.js
var require_lib21 = __commonJS({
  "node_modules/@babel/helper-skip-transparent-expression-wrappers/lib/index.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.isTransparentExprWrapper = isTransparentExprWrapper;
    exports2.skipTransparentExprWrapperNodes = skipTransparentExprWrapperNodes;
    exports2.skipTransparentExprWrappers = skipTransparentExprWrappers;
    var _t = require_lib3();
    var {
      isParenthesizedExpression,
      isTSAsExpression,
      isTSNonNullExpression,
      isTSSatisfiesExpression,
      isTSTypeAssertion,
      isTypeCastExpression
    } = _t;
    function isTransparentExprWrapper(node) {
      return isTSAsExpression(node) || isTSSatisfiesExpression(node) || isTSTypeAssertion(node) || isTSNonNullExpression(node) || isTypeCastExpression(node) || isParenthesizedExpression(node);
    }
    function skipTransparentExprWrappers(path) {
      while (isTransparentExprWrapper(path.node)) {
        path = path.get("expression");
      }
      return path;
    }
    function skipTransparentExprWrapperNodes(node) {
      while (isTransparentExprWrapper(node)) {
        node = node.expression;
      }
      return node;
    }
  }
});

// node_modules/@babel/helper-create-class-features-plugin/lib/typescript.js
var require_typescript3 = __commonJS({
  "node_modules/@babel/helper-create-class-features-plugin/lib/typescript.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.assertFieldTransformed = assertFieldTransformed;
    function assertFieldTransformed(path) {
      if (path.node.declare || false) {
        throw path.buildCodeFrameError(`TypeScript 'declare' fields must first be transformed by @babel/plugin-transform-typescript.
If you have already enabled that plugin (or '@babel/preset-typescript'), make sure that it runs before any plugin related to additional class features:
 - @babel/plugin-transform-class-properties
 - @babel/plugin-transform-private-methods
 - @babel/plugin-proposal-decorators`);
      }
    }
  }
});

// node_modules/@babel/helper-create-class-features-plugin/lib/fields.js
var require_fields = __commonJS({
  "node_modules/@babel/helper-create-class-features-plugin/lib/fields.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.buildCheckInRHS = buildCheckInRHS;
    exports2.buildFieldsInitNodes = buildFieldsInitNodes;
    exports2.buildPrivateNamesMap = buildPrivateNamesMap;
    exports2.buildPrivateNamesNodes = buildPrivateNamesNodes;
    exports2.privateNameVisitorFactory = privateNameVisitorFactory;
    exports2.transformPrivateNamesUsage = transformPrivateNamesUsage;
    var _core = require_lib27();
    var _traverse = require_lib9();
    var _helperReplaceSupers = require_lib19();
    var _helperMemberExpressionToFunctions = require_lib17();
    var _helperOptimiseCallExpression = require_lib18();
    var _helperAnnotateAsPure = require_lib20();
    var _helperSkipTransparentExpressionWrappers = require_lib21();
    var ts = require_typescript3();
    var newHelpers = (file) => {
      return file.availableHelper("classPrivateFieldGet2");
    };
    function buildPrivateNamesMap(className, privateFieldsAsSymbolsOrProperties, props, file) {
      const privateNamesMap = /* @__PURE__ */ new Map();
      let classBrandId;
      for (const prop of props) {
        if (prop.isPrivate()) {
          const {
            name
          } = prop.node.key.id;
          let update = privateNamesMap.get(name);
          if (!update) {
            const isMethod = !prop.isProperty();
            const isStatic = prop.node.static;
            let initAdded = false;
            let id;
            if (!privateFieldsAsSymbolsOrProperties && newHelpers(file) && isMethod && !isStatic) {
              initAdded = !!classBrandId;
              classBrandId != null ? classBrandId : classBrandId = prop.scope.generateUidIdentifier(`${className}_brand`);
              id = classBrandId;
            } else {
              id = prop.scope.generateUidIdentifier(name);
            }
            update = {
              id,
              static: isStatic,
              method: isMethod,
              initAdded
            };
            privateNamesMap.set(name, update);
          }
          if (prop.isClassPrivateMethod()) {
            if (prop.node.kind === "get") {
              const {
                body
              } = prop.node.body;
              let $;
              if (body.length === 1 && _core.types.isReturnStatement($ = body[0]) && _core.types.isCallExpression($ = $.argument) && $.arguments.length === 1 && _core.types.isThisExpression($.arguments[0]) && _core.types.isIdentifier($ = $.callee)) {
                update.getId = _core.types.cloneNode($);
                update.getterDeclared = true;
              } else {
                update.getId = prop.scope.generateUidIdentifier(`get_${name}`);
              }
            } else if (prop.node.kind === "set") {
              const {
                params
              } = prop.node;
              const {
                body
              } = prop.node.body;
              let $;
              if (body.length === 1 && _core.types.isExpressionStatement($ = body[0]) && _core.types.isCallExpression($ = $.expression) && $.arguments.length === 2 && _core.types.isThisExpression($.arguments[0]) && _core.types.isIdentifier($.arguments[1], {
                name: params[0].name
              }) && _core.types.isIdentifier($ = $.callee)) {
                update.setId = _core.types.cloneNode($);
                update.setterDeclared = true;
              } else {
                update.setId = prop.scope.generateUidIdentifier(`set_${name}`);
              }
            } else if (prop.node.kind === "method") {
              update.methodId = prop.scope.generateUidIdentifier(name);
            }
          }
          privateNamesMap.set(name, update);
        }
      }
      return privateNamesMap;
    }
    function buildPrivateNamesNodes(privateNamesMap, privateFieldsAsProperties, privateFieldsAsSymbols, state) {
      const initNodes = [];
      const injectedIds = /* @__PURE__ */ new Set();
      for (const [name, value2] of privateNamesMap) {
        const {
          static: isStatic,
          method: isMethod,
          getId,
          setId
        } = value2;
        const isGetterOrSetter = getId || setId;
        const id = _core.types.cloneNode(value2.id);
        let init;
        if (privateFieldsAsProperties) {
          init = _core.types.callExpression(state.addHelper("classPrivateFieldLooseKey"), [_core.types.stringLiteral(name)]);
        } else if (privateFieldsAsSymbols) {
          init = _core.types.callExpression(_core.types.identifier("Symbol"), [_core.types.stringLiteral(name)]);
        } else if (!isStatic) {
          if (injectedIds.has(id.name)) continue;
          injectedIds.add(id.name);
          init = _core.types.newExpression(_core.types.identifier(isMethod && (!isGetterOrSetter || newHelpers(state)) ? "WeakSet" : "WeakMap"), []);
        }
        if (init) {
          if (!privateFieldsAsSymbols) {
            (0, _helperAnnotateAsPure.default)(init);
          }
          initNodes.push(_core.template.statement.ast`var ${id} = ${init}`);
        }
      }
      return initNodes;
    }
    function privateNameVisitorFactory(visitor) {
      const nestedVisitor = _traverse.visitors.environmentVisitor(Object.assign({}, visitor));
      const privateNameVisitor2 = Object.assign({}, visitor, {
        Class(path) {
          const {
            privateNamesMap
          } = this;
          const body = path.get("body.body");
          const visiblePrivateNames = new Map(privateNamesMap);
          const redeclared = [];
          for (const prop of body) {
            if (!prop.isPrivate()) continue;
            const {
              name
            } = prop.node.key.id;
            visiblePrivateNames.delete(name);
            redeclared.push(name);
          }
          if (!redeclared.length) {
            return;
          }
          path.get("body").traverse(nestedVisitor, Object.assign({}, this, {
            redeclared
          }));
          path.traverse(privateNameVisitor2, Object.assign({}, this, {
            privateNamesMap: visiblePrivateNames
          }));
          path.skipKey("body");
        }
      });
      return privateNameVisitor2;
    }
    var privateNameVisitor = privateNameVisitorFactory({
      PrivateName(path, {
        noDocumentAll
      }) {
        const {
          privateNamesMap,
          redeclared
        } = this;
        const {
          node,
          parentPath
        } = path;
        if (!parentPath.isMemberExpression({
          property: node
        }) && !parentPath.isOptionalMemberExpression({
          property: node
        })) {
          return;
        }
        const {
          name
        } = node.id;
        if (!privateNamesMap.has(name)) return;
        if (redeclared != null && redeclared.includes(name)) return;
        this.handle(parentPath, noDocumentAll);
      }
    });
    function unshadow(name, scope, innerBinding) {
      while ((_scope = scope) != null && _scope.hasBinding(name) && !scope.bindingIdentifierEquals(name, innerBinding)) {
        var _scope;
        scope.rename(name);
        scope = scope.parent;
      }
    }
    function buildCheckInRHS(rhs, file, inRHSIsObject) {
      if (inRHSIsObject || !(file.availableHelper != null && file.availableHelper("checkInRHS"))) return rhs;
      return _core.types.callExpression(file.addHelper("checkInRHS"), [rhs]);
    }
    var privateInVisitor = privateNameVisitorFactory({
      BinaryExpression(path, {
        file
      }) {
        const {
          operator,
          left,
          right
        } = path.node;
        if (operator !== "in") return;
        if (!_core.types.isPrivateName(left)) return;
        const {
          privateFieldsAsProperties,
          privateNamesMap,
          redeclared
        } = this;
        const {
          name
        } = left.id;
        if (!privateNamesMap.has(name)) return;
        if (redeclared != null && redeclared.includes(name)) return;
        unshadow(this.classRef.name, path.scope, this.innerBinding);
        if (privateFieldsAsProperties) {
          const {
            id: id2
          } = privateNamesMap.get(name);
          path.replaceWith(_core.template.expression.ast`
        Object.prototype.hasOwnProperty.call(${buildCheckInRHS(right, file)}, ${_core.types.cloneNode(id2)})
      `);
          return;
        }
        const {
          id,
          static: isStatic
        } = privateNamesMap.get(name);
        if (isStatic) {
          path.replaceWith(_core.template.expression.ast`${buildCheckInRHS(right, file)} === ${_core.types.cloneNode(this.classRef)}`);
          return;
        }
        path.replaceWith(_core.template.expression.ast`${_core.types.cloneNode(id)}.has(${buildCheckInRHS(right, file)})`);
      }
    });
    function readOnlyError(file, name) {
      return _core.types.callExpression(file.addHelper("readOnlyError"), [_core.types.stringLiteral(`#${name}`)]);
    }
    function writeOnlyError(file, name) {
      if (!file.availableHelper("writeOnlyError")) {
        console.warn(`@babel/helpers is outdated, update it to silence this warning.`);
        return _core.types.buildUndefinedNode();
      }
      return _core.types.callExpression(file.addHelper("writeOnlyError"), [_core.types.stringLiteral(`#${name}`)]);
    }
    function buildStaticPrivateFieldAccess(expr, noUninitializedPrivateFieldAccess) {
      if (noUninitializedPrivateFieldAccess) return expr;
      return _core.types.memberExpression(expr, _core.types.identifier("_"));
    }
    function autoInherits(fn) {
      return function(member) {
        return _core.types.inherits(fn.apply(this, arguments), member.node);
      };
    }
    var privateNameHandlerSpec = {
      memoise(member, count) {
        const {
          scope
        } = member;
        const {
          object
        } = member.node;
        const memo = scope.maybeGenerateMemoised(object);
        if (!memo) {
          return;
        }
        this.memoiser.set(object, memo, count);
      },
      receiver(member) {
        const {
          object
        } = member.node;
        if (this.memoiser.has(object)) {
          return _core.types.cloneNode(this.memoiser.get(object));
        }
        return _core.types.cloneNode(object);
      },
      get: autoInherits(function(member) {
        const {
          classRef,
          privateNamesMap,
          file,
          innerBinding,
          noUninitializedPrivateFieldAccess
        } = this;
        const privateName = member.node.property;
        const {
          name
        } = privateName.id;
        const {
          id,
          static: isStatic,
          method: isMethod,
          methodId,
          getId,
          setId
        } = privateNamesMap.get(name);
        const isGetterOrSetter = getId || setId;
        const cloneId = (id2) => _core.types.inherits(_core.types.cloneNode(id2), privateName);
        if (isStatic) {
          unshadow(classRef.name, member.scope, innerBinding);
          if (!newHelpers(file)) {
            const helperName = isMethod && !isGetterOrSetter ? "classStaticPrivateMethodGet" : "classStaticPrivateFieldSpecGet";
            return _core.types.callExpression(file.addHelper(helperName), [this.receiver(member), _core.types.cloneNode(classRef), cloneId(id)]);
          }
          const receiver = this.receiver(member);
          const skipCheck = _core.types.isIdentifier(receiver) && receiver.name === classRef.name;
          if (!isMethod) {
            if (skipCheck) {
              return buildStaticPrivateFieldAccess(cloneId(id), noUninitializedPrivateFieldAccess);
            }
            return buildStaticPrivateFieldAccess(_core.types.callExpression(file.addHelper("assertClassBrand"), [_core.types.cloneNode(classRef), receiver, cloneId(id)]), noUninitializedPrivateFieldAccess);
          }
          if (getId) {
            if (skipCheck) {
              return _core.types.callExpression(cloneId(getId), [receiver]);
            }
            return _core.types.callExpression(file.addHelper("classPrivateGetter"), [_core.types.cloneNode(classRef), receiver, cloneId(getId)]);
          }
          if (setId) {
            const err = _core.types.buildUndefinedNode();
            if (skipCheck) return err;
            return _core.types.sequenceExpression([_core.types.callExpression(file.addHelper("assertClassBrand"), [_core.types.cloneNode(classRef), receiver]), err]);
          }
          if (skipCheck) return cloneId(id);
          return _core.types.callExpression(file.addHelper("assertClassBrand"), [_core.types.cloneNode(classRef), receiver, cloneId(id)]);
        }
        if (isMethod) {
          if (isGetterOrSetter) {
            if (!getId) {
              return _core.types.sequenceExpression([this.receiver(member), writeOnlyError(file, name)]);
            }
            if (!newHelpers(file)) {
              return _core.types.callExpression(file.addHelper("classPrivateFieldGet"), [this.receiver(member), cloneId(id)]);
            }
            return _core.types.callExpression(file.addHelper("classPrivateGetter"), [_core.types.cloneNode(id), this.receiver(member), cloneId(getId)]);
          }
          if (!newHelpers(file)) {
            return _core.types.callExpression(file.addHelper("classPrivateMethodGet"), [this.receiver(member), _core.types.cloneNode(id), cloneId(methodId)]);
          }
          return _core.types.callExpression(file.addHelper("assertClassBrand"), [_core.types.cloneNode(id), this.receiver(member), cloneId(methodId)]);
        }
        if (newHelpers(file)) {
          return _core.types.callExpression(file.addHelper("classPrivateFieldGet2"), [cloneId(id), this.receiver(member)]);
        }
        return _core.types.callExpression(file.addHelper("classPrivateFieldGet"), [this.receiver(member), cloneId(id)]);
      }),
      boundGet(member) {
        this.memoise(member, 1);
        return _core.types.callExpression(_core.types.memberExpression(this.get(member), _core.types.identifier("bind")), [this.receiver(member)]);
      },
      set: autoInherits(function(member, value2) {
        const {
          classRef,
          privateNamesMap,
          file,
          noUninitializedPrivateFieldAccess
        } = this;
        const privateName = member.node.property;
        const {
          name
        } = privateName.id;
        const {
          id,
          static: isStatic,
          method: isMethod,
          setId,
          getId
        } = privateNamesMap.get(name);
        const isGetterOrSetter = getId || setId;
        const cloneId = (id2) => _core.types.inherits(_core.types.cloneNode(id2), privateName);
        if (isStatic) {
          if (!newHelpers(file)) {
            const helperName = isMethod && !isGetterOrSetter ? "classStaticPrivateMethodSet" : "classStaticPrivateFieldSpecSet";
            return _core.types.callExpression(file.addHelper(helperName), [this.receiver(member), _core.types.cloneNode(classRef), cloneId(id), value2]);
          }
          const receiver = this.receiver(member);
          const skipCheck = _core.types.isIdentifier(receiver) && receiver.name === classRef.name;
          if (isMethod && !setId) {
            const err = readOnlyError(file, name);
            if (skipCheck) return _core.types.sequenceExpression([value2, err]);
            return _core.types.sequenceExpression([value2, _core.types.callExpression(file.addHelper("assertClassBrand"), [_core.types.cloneNode(classRef), receiver]), readOnlyError(file, name)]);
          }
          if (setId) {
            if (skipCheck) {
              return _core.types.callExpression(_core.types.cloneNode(setId), [receiver, value2]);
            }
            return _core.types.callExpression(file.addHelper("classPrivateSetter"), [_core.types.cloneNode(classRef), cloneId(setId), receiver, value2]);
          }
          return _core.types.assignmentExpression("=", buildStaticPrivateFieldAccess(cloneId(id), noUninitializedPrivateFieldAccess), skipCheck ? value2 : _core.types.callExpression(file.addHelper("assertClassBrand"), [_core.types.cloneNode(classRef), receiver, value2]));
        }
        if (isMethod) {
          if (setId) {
            if (!newHelpers(file)) {
              return _core.types.callExpression(file.addHelper("classPrivateFieldSet"), [this.receiver(member), cloneId(id), value2]);
            }
            return _core.types.callExpression(file.addHelper("classPrivateSetter"), [_core.types.cloneNode(id), cloneId(setId), this.receiver(member), value2]);
          }
          return _core.types.sequenceExpression([this.receiver(member), value2, readOnlyError(file, name)]);
        }
        if (newHelpers(file)) {
          return _core.types.callExpression(file.addHelper("classPrivateFieldSet2"), [cloneId(id), this.receiver(member), value2]);
        }
        return _core.types.callExpression(file.addHelper("classPrivateFieldSet"), [this.receiver(member), cloneId(id), value2]);
      }),
      destructureSet(member) {
        const {
          classRef,
          privateNamesMap,
          file,
          noUninitializedPrivateFieldAccess
        } = this;
        const privateName = member.node.property;
        const {
          name
        } = privateName.id;
        const {
          id,
          static: isStatic,
          method: isMethod,
          setId
        } = privateNamesMap.get(name);
        const cloneId = (id2) => _core.types.inherits(_core.types.cloneNode(id2), privateName);
        if (!newHelpers(file)) {
          if (isStatic) {
            try {
              var helper = file.addHelper("classStaticPrivateFieldDestructureSet");
            } catch (_unused) {
              throw new Error("Babel can not transpile `[C.#p] = [0]` with @babel/helpers < 7.13.10, \nplease update @babel/helpers to the latest version.");
            }
            return _core.types.memberExpression(_core.types.callExpression(helper, [this.receiver(member), _core.types.cloneNode(classRef), cloneId(id)]), _core.types.identifier("value"));
          }
          return _core.types.memberExpression(_core.types.callExpression(file.addHelper("classPrivateFieldDestructureSet"), [this.receiver(member), cloneId(id)]), _core.types.identifier("value"));
        }
        if (isMethod && !setId) {
          return _core.types.memberExpression(_core.types.sequenceExpression([member.node.object, readOnlyError(file, name)]), _core.types.identifier("_"));
        }
        if (isStatic && !isMethod) {
          const getCall = this.get(member);
          if (!noUninitializedPrivateFieldAccess || !_core.types.isCallExpression(getCall)) {
            return getCall;
          }
          const ref = getCall.arguments.pop();
          getCall.arguments.push(_core.template.expression.ast`(_) => ${ref} = _`);
          return _core.types.memberExpression(_core.types.callExpression(file.addHelper("toSetter"), [getCall]), _core.types.identifier("_"));
        }
        const setCall = this.set(member, _core.types.identifier("_"));
        if (!_core.types.isCallExpression(setCall) || !_core.types.isIdentifier(setCall.arguments[setCall.arguments.length - 1], {
          name: "_"
        })) {
          throw member.buildCodeFrameError("Internal Babel error while compiling this code. This is a Babel bug. Please report it at https://github.com/babel/babel/issues.");
        }
        let args;
        if (_core.types.isMemberExpression(setCall.callee, {
          computed: false
        }) && _core.types.isIdentifier(setCall.callee.property) && setCall.callee.property.name === "call") {
          args = [setCall.callee.object, _core.types.arrayExpression(setCall.arguments.slice(1, -1)), setCall.arguments[0]];
        } else {
          args = [setCall.callee, _core.types.arrayExpression(setCall.arguments.slice(0, -1))];
        }
        return _core.types.memberExpression(_core.types.callExpression(file.addHelper("toSetter"), args), _core.types.identifier("_"));
      },
      call(member, args) {
        this.memoise(member, 1);
        return (0, _helperOptimiseCallExpression.default)(this.get(member), this.receiver(member), args, false);
      },
      optionalCall(member, args) {
        this.memoise(member, 1);
        return (0, _helperOptimiseCallExpression.default)(this.get(member), this.receiver(member), args, true);
      },
      delete() {
        throw new Error("Internal Babel error: deleting private elements is a parsing error.");
      }
    };
    var privateNameHandlerLoose = {
      get(member) {
        const {
          privateNamesMap,
          file
        } = this;
        const {
          object
        } = member.node;
        const {
          name
        } = member.node.property.id;
        return _core.template.expression`BASE(REF, PROP)[PROP]`({
          BASE: file.addHelper("classPrivateFieldLooseBase"),
          REF: _core.types.cloneNode(object),
          PROP: _core.types.cloneNode(privateNamesMap.get(name).id)
        });
      },
      set() {
        throw new Error("private name handler with loose = true don't need set()");
      },
      boundGet(member) {
        return _core.types.callExpression(_core.types.memberExpression(this.get(member), _core.types.identifier("bind")), [_core.types.cloneNode(member.node.object)]);
      },
      simpleSet(member) {
        return this.get(member);
      },
      destructureSet(member) {
        return this.get(member);
      },
      call(member, args) {
        return _core.types.callExpression(this.get(member), args);
      },
      optionalCall(member, args) {
        return _core.types.optionalCallExpression(this.get(member), args, true);
      },
      delete() {
        throw new Error("Internal Babel error: deleting private elements is a parsing error.");
      }
    };
    function transformPrivateNamesUsage(ref, path, privateNamesMap, {
      privateFieldsAsProperties,
      noUninitializedPrivateFieldAccess,
      noDocumentAll,
      innerBinding
    }, state) {
      if (!privateNamesMap.size) return;
      const body = path.get("body");
      const handler = privateFieldsAsProperties ? privateNameHandlerLoose : privateNameHandlerSpec;
      (0, _helperMemberExpressionToFunctions.default)(body, privateNameVisitor, Object.assign({
        privateNamesMap,
        classRef: ref,
        file: state
      }, handler, {
        noDocumentAll,
        noUninitializedPrivateFieldAccess,
        innerBinding
      }));
      body.traverse(privateInVisitor, {
        privateNamesMap,
        classRef: ref,
        file: state,
        privateFieldsAsProperties,
        innerBinding
      });
    }
    function buildPrivateFieldInitLoose(ref, prop, privateNamesMap) {
      const {
        id
      } = privateNamesMap.get(prop.node.key.id.name);
      const value2 = prop.node.value || prop.scope.buildUndefinedNode();
      return inheritPropComments(_core.template.statement.ast`
      Object.defineProperty(${ref}, ${_core.types.cloneNode(id)}, {
        // configurable is false by default
        // enumerable is false by default
        writable: true,
        value: ${value2}
      });
    `, prop);
    }
    function buildPrivateInstanceFieldInitSpec(ref, prop, privateNamesMap, state) {
      const {
        id
      } = privateNamesMap.get(prop.node.key.id.name);
      const value2 = prop.node.value || prop.scope.buildUndefinedNode();
      if (!state.availableHelper("classPrivateFieldInitSpec")) {
        return inheritPropComments(_core.template.statement.ast`${_core.types.cloneNode(id)}.set(${ref}, {
          // configurable is always false for private elements
          // enumerable is always false for private elements
          writable: true,
          value: ${value2},
        })`, prop);
      }
      const helper = state.addHelper("classPrivateFieldInitSpec");
      return inheritLoc(inheritPropComments(_core.types.expressionStatement(_core.types.callExpression(helper, [_core.types.thisExpression(), inheritLoc(_core.types.cloneNode(id), prop.node.key), newHelpers(state) ? value2 : _core.template.expression.ast`{ writable: true, value: ${value2} }`])), prop), prop.node);
    }
    function buildPrivateStaticFieldInitSpec(prop, privateNamesMap, noUninitializedPrivateFieldAccess) {
      const privateName = privateNamesMap.get(prop.node.key.id.name);
      const value2 = noUninitializedPrivateFieldAccess ? prop.node.value : _core.template.expression.ast`{
        _: ${prop.node.value || _core.types.buildUndefinedNode()}
      }`;
      return inheritPropComments(_core.types.variableDeclaration("var", [_core.types.variableDeclarator(_core.types.cloneNode(privateName.id), value2)]), prop);
    }
    var buildPrivateStaticFieldInitSpecOld = function(prop, privateNamesMap) {
      const privateName = privateNamesMap.get(prop.node.key.id.name);
      const {
        id,
        getId,
        setId,
        initAdded
      } = privateName;
      const isGetterOrSetter = getId || setId;
      if (!prop.isProperty() && (initAdded || !isGetterOrSetter)) return;
      if (isGetterOrSetter) {
        privateNamesMap.set(prop.node.key.id.name, Object.assign({}, privateName, {
          initAdded: true
        }));
        return inheritPropComments(_core.template.statement.ast`
          var ${_core.types.cloneNode(id)} = {
            // configurable is false by default
            // enumerable is false by default
            // writable is false by default
            get: ${getId ? getId.name : prop.scope.buildUndefinedNode()},
            set: ${setId ? setId.name : prop.scope.buildUndefinedNode()}
          }
        `, prop);
      }
      const value2 = prop.node.value || prop.scope.buildUndefinedNode();
      return inheritPropComments(_core.template.statement.ast`
        var ${_core.types.cloneNode(id)} = {
          // configurable is false by default
          // enumerable is false by default
          writable: true,
          value: ${value2}
        };
      `, prop);
    };
    function buildPrivateMethodInitLoose(ref, prop, privateNamesMap) {
      const privateName = privateNamesMap.get(prop.node.key.id.name);
      const {
        methodId,
        id,
        getId,
        setId,
        initAdded
      } = privateName;
      if (initAdded) return;
      if (methodId) {
        return inheritPropComments(_core.template.statement.ast`
        Object.defineProperty(${ref}, ${id}, {
          // configurable is false by default
          // enumerable is false by default
          // writable is false by default
          value: ${methodId.name}
        });
      `, prop);
      }
      const isGetterOrSetter = getId || setId;
      if (isGetterOrSetter) {
        privateNamesMap.set(prop.node.key.id.name, Object.assign({}, privateName, {
          initAdded: true
        }));
        return inheritPropComments(_core.template.statement.ast`
        Object.defineProperty(${ref}, ${id}, {
          // configurable is false by default
          // enumerable is false by default
          // writable is false by default
          get: ${getId ? getId.name : prop.scope.buildUndefinedNode()},
          set: ${setId ? setId.name : prop.scope.buildUndefinedNode()}
        });
      `, prop);
      }
    }
    function buildPrivateInstanceMethodInitSpec(ref, prop, privateNamesMap, state) {
      const privateName = privateNamesMap.get(prop.node.key.id.name);
      if (privateName.initAdded) return;
      if (!newHelpers(state)) {
        const isGetterOrSetter = privateName.getId || privateName.setId;
        if (isGetterOrSetter) {
          return buildPrivateAccessorInitialization(ref, prop, privateNamesMap, state);
        }
      }
      return buildPrivateInstanceMethodInitialization(ref, prop, privateNamesMap, state);
    }
    function buildPrivateAccessorInitialization(ref, prop, privateNamesMap, state) {
      const privateName = privateNamesMap.get(prop.node.key.id.name);
      const {
        id,
        getId,
        setId
      } = privateName;
      privateNamesMap.set(prop.node.key.id.name, Object.assign({}, privateName, {
        initAdded: true
      }));
      if (!state.availableHelper("classPrivateFieldInitSpec")) {
        return inheritPropComments(_core.template.statement.ast`
          ${id}.set(${ref}, {
            get: ${getId ? getId.name : prop.scope.buildUndefinedNode()},
            set: ${setId ? setId.name : prop.scope.buildUndefinedNode()}
          });
        `, prop);
      }
      const helper = state.addHelper("classPrivateFieldInitSpec");
      return inheritLoc(inheritPropComments(_core.template.statement.ast`${helper}(
      ${_core.types.thisExpression()},
      ${_core.types.cloneNode(id)},
      {
        get: ${getId ? getId.name : prop.scope.buildUndefinedNode()},
        set: ${setId ? setId.name : prop.scope.buildUndefinedNode()}
      },
    )`, prop), prop.node);
    }
    function buildPrivateInstanceMethodInitialization(ref, prop, privateNamesMap, state) {
      const privateName = privateNamesMap.get(prop.node.key.id.name);
      const {
        id
      } = privateName;
      if (!state.availableHelper("classPrivateMethodInitSpec")) {
        return inheritPropComments(_core.template.statement.ast`${id}.add(${ref})`, prop);
      }
      const helper = state.addHelper("classPrivateMethodInitSpec");
      return inheritPropComments(_core.template.statement.ast`${helper}(
      ${_core.types.thisExpression()},
      ${_core.types.cloneNode(id)}
    )`, prop);
    }
    function buildPublicFieldInitLoose(ref, prop) {
      const {
        key,
        computed
      } = prop.node;
      const value2 = prop.node.value || prop.scope.buildUndefinedNode();
      return inheritPropComments(_core.types.expressionStatement(_core.types.assignmentExpression("=", _core.types.memberExpression(ref, key, computed || _core.types.isLiteral(key)), value2)), prop);
    }
    function buildPublicFieldInitSpec(ref, prop, state) {
      const {
        key,
        computed
      } = prop.node;
      const value2 = prop.node.value || prop.scope.buildUndefinedNode();
      return inheritPropComments(_core.types.expressionStatement(_core.types.callExpression(state.addHelper("defineProperty"), [ref, computed || _core.types.isLiteral(key) ? key : _core.types.stringLiteral(key.name), value2])), prop);
    }
    function buildPrivateStaticMethodInitLoose(ref, prop, state, privateNamesMap) {
      const privateName = privateNamesMap.get(prop.node.key.id.name);
      const {
        id,
        methodId,
        getId,
        setId,
        initAdded
      } = privateName;
      if (initAdded) return;
      const isGetterOrSetter = getId || setId;
      if (isGetterOrSetter) {
        privateNamesMap.set(prop.node.key.id.name, Object.assign({}, privateName, {
          initAdded: true
        }));
        return inheritPropComments(_core.template.statement.ast`
        Object.defineProperty(${ref}, ${id}, {
          // configurable is false by default
          // enumerable is false by default
          // writable is false by default
          get: ${getId ? getId.name : prop.scope.buildUndefinedNode()},
          set: ${setId ? setId.name : prop.scope.buildUndefinedNode()}
        })
      `, prop);
      }
      return inheritPropComments(_core.template.statement.ast`
      Object.defineProperty(${ref}, ${id}, {
        // configurable is false by default
        // enumerable is false by default
        // writable is false by default
        value: ${methodId.name}
      });
    `, prop);
    }
    function buildPrivateMethodDeclaration(file, prop, privateNamesMap, privateFieldsAsSymbolsOrProperties = false) {
      const privateName = privateNamesMap.get(prop.node.key.id.name);
      const {
        id,
        methodId,
        getId,
        setId,
        getterDeclared,
        setterDeclared,
        static: isStatic
      } = privateName;
      const {
        params,
        body,
        generator,
        async
      } = prop.node;
      const isGetter = getId && params.length === 0;
      const isSetter = setId && params.length > 0;
      if (isGetter && getterDeclared || isSetter && setterDeclared) {
        privateNamesMap.set(prop.node.key.id.name, Object.assign({}, privateName, {
          initAdded: true
        }));
        return null;
      }
      if (newHelpers(file) && (isGetter || isSetter) && !privateFieldsAsSymbolsOrProperties) {
        const scope = prop.get("body").scope;
        const thisArg = scope.generateUidIdentifier("this");
        const state = {
          thisRef: thisArg,
          argumentsPath: []
        };
        prop.traverse(thisContextVisitor, state);
        if (state.argumentsPath.length) {
          const argumentsId = scope.generateUidIdentifier("arguments");
          scope.push({
            id: argumentsId,
            init: _core.template.expression.ast`[].slice.call(arguments, 1)`
          });
          for (const path of state.argumentsPath) {
            path.replaceWith(_core.types.cloneNode(argumentsId));
          }
        }
        params.unshift(_core.types.cloneNode(thisArg));
      }
      let declId = methodId;
      if (isGetter) {
        privateNamesMap.set(prop.node.key.id.name, Object.assign({}, privateName, {
          getterDeclared: true,
          initAdded: true
        }));
        declId = getId;
      } else if (isSetter) {
        privateNamesMap.set(prop.node.key.id.name, Object.assign({}, privateName, {
          setterDeclared: true,
          initAdded: true
        }));
        declId = setId;
      } else if (isStatic && !privateFieldsAsSymbolsOrProperties) {
        declId = id;
      }
      return inheritPropComments(_core.types.functionDeclaration(_core.types.cloneNode(declId), params, body, generator, async), prop);
    }
    var thisContextVisitor = _traverse.visitors.environmentVisitor({
      Identifier(path, state) {
        if (state.argumentsPath && path.node.name === "arguments") {
          state.argumentsPath.push(path);
        }
      },
      UnaryExpression(path) {
        const {
          node
        } = path;
        if (node.operator === "delete") {
          const argument = (0, _helperSkipTransparentExpressionWrappers.skipTransparentExprWrapperNodes)(node.argument);
          if (_core.types.isThisExpression(argument)) {
            path.replaceWith(_core.types.booleanLiteral(true));
          }
        }
      },
      ThisExpression(path, state) {
        state.needsClassRef = true;
        path.replaceWith(_core.types.cloneNode(state.thisRef));
      },
      MetaProperty(path) {
        const {
          node,
          scope
        } = path;
        if (node.meta.name === "new" && node.property.name === "target") {
          path.replaceWith(scope.buildUndefinedNode());
        }
      }
    });
    var innerReferencesVisitor = {
      ReferencedIdentifier(path, state) {
        if (path.scope.bindingIdentifierEquals(path.node.name, state.innerBinding)) {
          state.needsClassRef = true;
          path.node.name = state.thisRef.name;
        }
      }
    };
    function replaceThisContext(path, ref, innerBindingRef) {
      var _state$thisRef;
      const state = {
        thisRef: ref,
        needsClassRef: false,
        innerBinding: innerBindingRef
      };
      if (!path.isMethod()) {
        path.traverse(thisContextVisitor, state);
      }
      if (innerBindingRef != null && (_state$thisRef = state.thisRef) != null && _state$thisRef.name && state.thisRef.name !== innerBindingRef.name) {
        path.traverse(innerReferencesVisitor, state);
      }
      return state.needsClassRef;
    }
    function isNameOrLength({
      key,
      computed
    }) {
      if (key.type === "Identifier") {
        return !computed && (key.name === "name" || key.name === "length");
      }
      if (key.type === "StringLiteral") {
        return key.value === "name" || key.value === "length";
      }
      return false;
    }
    function inheritPropComments(node, prop) {
      _core.types.inheritLeadingComments(node, prop.node);
      _core.types.inheritInnerComments(node, prop.node);
      return node;
    }
    function inheritLoc(node, original) {
      node.start = original.start;
      node.end = original.end;
      node.loc = original.loc;
      return node;
    }
    function buildFieldsInitNodes(ref, superRef, props, privateNamesMap, file, setPublicClassFields, privateFieldsAsSymbolsOrProperties, noUninitializedPrivateFieldAccess, constantSuper, innerBindingRef) {
      let classRefFlags = 0;
      let injectSuperRef;
      const staticNodes = [];
      const instanceNodes = [];
      let lastInstanceNodeReturnsThis = false;
      const pureStaticNodes = [];
      let classBindingNode = null;
      const getSuperRef = _core.types.isIdentifier(superRef) ? () => superRef : () => {
        injectSuperRef != null ? injectSuperRef : injectSuperRef = props[0].scope.generateUidIdentifierBasedOnNode(superRef);
        return injectSuperRef;
      };
      const classRefForInnerBinding = ref != null ? ref : props[0].scope.generateUidIdentifier((innerBindingRef == null ? void 0 : innerBindingRef.name) || "Class");
      ref != null ? ref : ref = _core.types.cloneNode(innerBindingRef);
      for (const prop of props) {
        if (prop.isClassProperty()) {
          ts.assertFieldTransformed(prop);
        }
        const isStatic = !(_core.types.isStaticBlock != null && _core.types.isStaticBlock(prop.node)) && prop.node.static;
        const isInstance = !isStatic;
        const isPrivate = prop.isPrivate();
        const isPublic = !isPrivate;
        const isField = prop.isProperty();
        const isMethod = !isField;
        const isStaticBlock = prop.isStaticBlock == null ? void 0 : prop.isStaticBlock();
        if (isStatic) classRefFlags |= 1;
        if (isStatic || isMethod && isPrivate || isStaticBlock) {
          new _helperReplaceSupers.default({
            methodPath: prop,
            constantSuper,
            file,
            refToPreserve: innerBindingRef,
            getSuperRef,
            getObjectRef() {
              classRefFlags |= 2;
              if (isStatic || isStaticBlock) {
                return classRefForInnerBinding;
              } else {
                return _core.types.memberExpression(classRefForInnerBinding, _core.types.identifier("prototype"));
              }
            }
          }).replace();
          const replaced = replaceThisContext(prop, classRefForInnerBinding, innerBindingRef);
          if (replaced) {
            classRefFlags |= 2;
          }
        }
        lastInstanceNodeReturnsThis = false;
        switch (true) {
          case isStaticBlock: {
            const blockBody = prop.node.body;
            if (blockBody.length === 1 && _core.types.isExpressionStatement(blockBody[0])) {
              staticNodes.push(inheritPropComments(blockBody[0], prop));
            } else {
              staticNodes.push(_core.types.inheritsComments(_core.template.statement.ast`(() => { ${blockBody} })()`, prop.node));
            }
            break;
          }
          case (isStatic && isPrivate && isField && privateFieldsAsSymbolsOrProperties):
            staticNodes.push(buildPrivateFieldInitLoose(_core.types.cloneNode(ref), prop, privateNamesMap));
            break;
          case (isStatic && isPrivate && isField && !privateFieldsAsSymbolsOrProperties):
            if (!newHelpers(file)) {
              staticNodes.push(buildPrivateStaticFieldInitSpecOld(prop, privateNamesMap));
            } else {
              staticNodes.push(buildPrivateStaticFieldInitSpec(prop, privateNamesMap, noUninitializedPrivateFieldAccess));
            }
            break;
          case (isStatic && isPublic && isField && setPublicClassFields):
            if (!isNameOrLength(prop.node)) {
              staticNodes.push(buildPublicFieldInitLoose(_core.types.cloneNode(ref), prop));
              break;
            }
          case (isStatic && isPublic && isField && !setPublicClassFields):
            staticNodes.push(buildPublicFieldInitSpec(_core.types.cloneNode(ref), prop, file));
            break;
          case (isInstance && isPrivate && isField && privateFieldsAsSymbolsOrProperties):
            instanceNodes.push(buildPrivateFieldInitLoose(_core.types.thisExpression(), prop, privateNamesMap));
            break;
          case (isInstance && isPrivate && isField && !privateFieldsAsSymbolsOrProperties):
            instanceNodes.push(buildPrivateInstanceFieldInitSpec(_core.types.thisExpression(), prop, privateNamesMap, file));
            break;
          case (isInstance && isPrivate && isMethod && privateFieldsAsSymbolsOrProperties):
            instanceNodes.unshift(buildPrivateMethodInitLoose(_core.types.thisExpression(), prop, privateNamesMap));
            pureStaticNodes.push(buildPrivateMethodDeclaration(file, prop, privateNamesMap, privateFieldsAsSymbolsOrProperties));
            break;
          case (isInstance && isPrivate && isMethod && !privateFieldsAsSymbolsOrProperties):
            instanceNodes.unshift(buildPrivateInstanceMethodInitSpec(_core.types.thisExpression(), prop, privateNamesMap, file));
            pureStaticNodes.push(buildPrivateMethodDeclaration(file, prop, privateNamesMap, privateFieldsAsSymbolsOrProperties));
            break;
          case (isStatic && isPrivate && isMethod && !privateFieldsAsSymbolsOrProperties):
            if (!newHelpers(file)) {
              staticNodes.unshift(buildPrivateStaticFieldInitSpecOld(prop, privateNamesMap));
            }
            pureStaticNodes.push(buildPrivateMethodDeclaration(file, prop, privateNamesMap, privateFieldsAsSymbolsOrProperties));
            break;
          case (isStatic && isPrivate && isMethod && privateFieldsAsSymbolsOrProperties):
            staticNodes.unshift(buildPrivateStaticMethodInitLoose(_core.types.cloneNode(ref), prop, file, privateNamesMap));
            pureStaticNodes.push(buildPrivateMethodDeclaration(file, prop, privateNamesMap, privateFieldsAsSymbolsOrProperties));
            break;
          case (isInstance && isPublic && isField && setPublicClassFields):
            instanceNodes.push(buildPublicFieldInitLoose(_core.types.thisExpression(), prop));
            break;
          case (isInstance && isPublic && isField && !setPublicClassFields):
            lastInstanceNodeReturnsThis = true;
            instanceNodes.push(buildPublicFieldInitSpec(_core.types.thisExpression(), prop, file));
            break;
          default:
            throw new Error("Unreachable.");
        }
      }
      if (classRefFlags & 2 && innerBindingRef != null) {
        classBindingNode = _core.types.expressionStatement(_core.types.assignmentExpression("=", _core.types.cloneNode(classRefForInnerBinding), _core.types.cloneNode(innerBindingRef)));
      }
      return {
        staticNodes: staticNodes.filter(Boolean),
        instanceNodes: instanceNodes.filter(Boolean),
        lastInstanceNodeReturnsThis,
        pureStaticNodes: pureStaticNodes.filter(Boolean),
        classBindingNode,
        wrapClass(path) {
          for (const prop of props) {
            prop.node.leadingComments = null;
            prop.remove();
          }
          if (injectSuperRef) {
            path.scope.push({
              id: _core.types.cloneNode(injectSuperRef)
            });
            path.set("superClass", _core.types.assignmentExpression("=", injectSuperRef, path.node.superClass));
          }
          if (classRefFlags !== 0) {
            if (path.isClassExpression()) {
              path.scope.push({
                id: ref
              });
              path.replaceWith(_core.types.assignmentExpression("=", _core.types.cloneNode(ref), path.node));
            } else {
              if (innerBindingRef == null) {
                path.node.id = ref;
              }
              if (classBindingNode != null) {
                path.scope.push({
                  id: classRefForInnerBinding
                });
              }
            }
          }
          return path;
        }
      };
    }
  }
});

// node_modules/@babel/helper-create-class-features-plugin/lib/misc.js
var require_misc2 = __commonJS({
  "node_modules/@babel/helper-create-class-features-plugin/lib/misc.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.extractComputedKeys = extractComputedKeys;
    exports2.injectInitialization = injectInitialization;
    exports2.memoiseComputedKey = memoiseComputedKey;
    var _core = require_lib27();
    var _traverse = require_lib9();
    var findBareSupers = _traverse.visitors.environmentVisitor({
      Super(path) {
        const {
          node,
          parentPath
        } = path;
        if (parentPath.isCallExpression({
          callee: node
        })) {
          this.push(parentPath);
        }
      }
    });
    var referenceVisitor = {
      "TSTypeAnnotation|TypeAnnotation"(path) {
        path.skip();
      },
      ReferencedIdentifier(path, {
        scope
      }) {
        if (scope.hasOwnBinding(path.node.name)) {
          scope.rename(path.node.name);
          path.skip();
        }
      }
    };
    function handleClassTDZ(path, state) {
      if (state.classBinding && state.classBinding === path.scope.getBinding(path.node.name)) {
        const classNameTDZError = state.file.addHelper("classNameTDZError");
        const throwNode = _core.types.callExpression(classNameTDZError, [_core.types.stringLiteral(path.node.name)]);
        path.replaceWith(_core.types.sequenceExpression([throwNode, path.node]));
        path.skip();
      }
    }
    var classFieldDefinitionEvaluationTDZVisitor = {
      ReferencedIdentifier: handleClassTDZ,
      "TSTypeAnnotation|TypeAnnotation"(path) {
        path.skip();
      }
    };
    function injectInitialization(path, constructor, nodes, renamer, lastReturnsThis) {
      if (!nodes.length) return;
      const isDerived = !!path.node.superClass;
      if (!constructor) {
        const newConstructor = _core.types.classMethod("constructor", _core.types.identifier("constructor"), [], _core.types.blockStatement([]));
        if (isDerived) {
          newConstructor.params = [_core.types.restElement(_core.types.identifier("args"))];
          newConstructor.body.body.push(_core.template.statement.ast`super(...args)`);
        }
        [constructor] = path.get("body").unshiftContainer("body", newConstructor);
      }
      if (renamer) {
        renamer(referenceVisitor, {
          scope: constructor.scope
        });
      }
      if (isDerived) {
        const bareSupers = [];
        constructor.traverse(findBareSupers, bareSupers);
        let isFirst = true;
        for (const bareSuper of bareSupers) {
          if (isFirst) {
            isFirst = false;
          } else {
            nodes = nodes.map((n) => _core.types.cloneNode(n));
          }
          if (!bareSuper.parentPath.isExpressionStatement()) {
            const allNodes = [bareSuper.node, ...nodes.map((n) => _core.types.toExpression(n))];
            if (!lastReturnsThis) allNodes.push(_core.types.thisExpression());
            bareSuper.replaceWith(_core.types.sequenceExpression(allNodes));
          } else {
            bareSuper.insertAfter(nodes);
          }
        }
      } else {
        constructor.get("body").unshiftContainer("body", nodes);
      }
    }
    function memoiseComputedKey(keyNode, scope, hint) {
      const isUidReference = _core.types.isIdentifier(keyNode) && scope.hasUid(keyNode.name);
      if (isUidReference) {
        return;
      }
      const isMemoiseAssignment = _core.types.isAssignmentExpression(keyNode, {
        operator: "="
      }) && _core.types.isIdentifier(keyNode.left) && scope.hasUid(keyNode.left.name);
      if (isMemoiseAssignment) {
        return _core.types.cloneNode(keyNode);
      } else {
        const ident = _core.types.identifier(hint);
        scope.push({
          id: ident,
          kind: "let"
        });
        return _core.types.assignmentExpression("=", _core.types.cloneNode(ident), keyNode);
      }
    }
    function extractComputedKeys(path, computedPaths, file) {
      const {
        scope
      } = path;
      const declarations = [];
      const state = {
        classBinding: path.node.id && scope.getBinding(path.node.id.name),
        file
      };
      for (const computedPath of computedPaths) {
        const computedKey = computedPath.get("key");
        if (computedKey.isReferencedIdentifier()) {
          handleClassTDZ(computedKey, state);
        } else {
          computedKey.traverse(classFieldDefinitionEvaluationTDZVisitor, state);
        }
        const computedNode = computedPath.node;
        if (!computedKey.isConstantExpression()) {
          const assignment = memoiseComputedKey(computedKey.node, scope, scope.generateUidBasedOnNode(computedKey.node));
          if (assignment) {
            declarations.push(_core.types.expressionStatement(assignment));
            computedNode.key = _core.types.cloneNode(assignment.left);
          }
        }
      }
      return declarations;
    }
  }
});

// node_modules/@babel/helper-create-class-features-plugin/lib/decorators.js
var require_decorators = __commonJS({
  "node_modules/@babel/helper-create-class-features-plugin/lib/decorators.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.buildNamedEvaluationVisitor = buildNamedEvaluationVisitor;
    exports2.default = _default;
    exports2.hasDecorators = hasDecorators;
    exports2.hasOwnDecorators = hasOwnDecorators;
    var _core = require_lib27();
    var _helperReplaceSupers = require_lib19();
    var _helperSkipTransparentExpressionWrappers = require_lib21();
    var _fields = require_fields();
    var _misc = require_misc2();
    function hasOwnDecorators(node) {
      var _node$decorators;
      return !!((_node$decorators = node.decorators) != null && _node$decorators.length);
    }
    function hasDecorators(node) {
      return hasOwnDecorators(node) || node.body.body.some(hasOwnDecorators);
    }
    function incrementId(id, idx = id.length - 1) {
      if (idx === -1) {
        id.unshift(65);
        return;
      }
      const current = id[idx];
      if (current === 90) {
        id[idx] = 97;
      } else if (current === 122) {
        id[idx] = 65;
        incrementId(id, idx - 1);
      } else {
        id[idx] = current + 1;
      }
    }
    function createPrivateUidGeneratorForClass(classPath) {
      const currentPrivateId = [];
      const privateNames = /* @__PURE__ */ new Set();
      _core.types.traverseFast(classPath.node, (node) => {
        if (_core.types.isPrivateName(node)) {
          privateNames.add(node.id.name);
        }
      });
      return () => {
        let reifiedId;
        do {
          incrementId(currentPrivateId);
          reifiedId = String.fromCharCode(...currentPrivateId);
        } while (privateNames.has(reifiedId));
        return _core.types.privateName(_core.types.identifier(reifiedId));
      };
    }
    function createLazyPrivateUidGeneratorForClass(classPath) {
      let generator;
      return () => {
        if (!generator) {
          generator = createPrivateUidGeneratorForClass(classPath);
        }
        return generator();
      };
    }
    function replaceClassWithVar(path, className) {
      const id = path.node.id;
      const scope = path.scope;
      if (path.type === "ClassDeclaration") {
        const className2 = id.name;
        const varId = scope.generateUidIdentifierBasedOnNode(id);
        const classId = _core.types.identifier(className2);
        scope.rename(className2, varId.name);
        path.get("id").replaceWith(classId);
        return {
          id: _core.types.cloneNode(varId),
          path
        };
      } else {
        let varId;
        if (id) {
          className = id.name;
          varId = generateLetUidIdentifier(scope.parent, className);
          scope.rename(className, varId.name);
        } else {
          varId = generateLetUidIdentifier(scope.parent, typeof className === "string" ? className : "decorated_class");
        }
        const newClassExpr = _core.types.classExpression(typeof className === "string" ? _core.types.identifier(className) : null, path.node.superClass, path.node.body);
        const [newPath] = path.replaceWith(_core.types.sequenceExpression([newClassExpr, varId]));
        return {
          id: _core.types.cloneNode(varId),
          path: newPath.get("expressions.0")
        };
      }
    }
    function generateClassProperty(key, value2, isStatic) {
      if (key.type === "PrivateName") {
        return _core.types.classPrivateProperty(key, value2, void 0, isStatic);
      } else {
        return _core.types.classProperty(key, value2, void 0, void 0, isStatic);
      }
    }
    function assignIdForAnonymousClass(path, className) {
      if (!path.node.id) {
        path.node.id = typeof className === "string" ? _core.types.identifier(className) : path.scope.generateUidIdentifier("Class");
      }
    }
    function addProxyAccessorsFor(className, element, getterKey, setterKey, targetKey, isComputed, isStatic, version) {
      const thisArg = (version === "2023-11" || version === "2023-05") && isStatic ? className : _core.types.thisExpression();
      const getterBody = _core.types.blockStatement([_core.types.returnStatement(_core.types.memberExpression(_core.types.cloneNode(thisArg), _core.types.cloneNode(targetKey)))]);
      const setterBody = _core.types.blockStatement([_core.types.expressionStatement(_core.types.assignmentExpression("=", _core.types.memberExpression(_core.types.cloneNode(thisArg), _core.types.cloneNode(targetKey)), _core.types.identifier("v")))]);
      let getter, setter;
      if (getterKey.type === "PrivateName") {
        getter = _core.types.classPrivateMethod("get", getterKey, [], getterBody, isStatic);
        setter = _core.types.classPrivateMethod("set", setterKey, [_core.types.identifier("v")], setterBody, isStatic);
      } else {
        getter = _core.types.classMethod("get", getterKey, [], getterBody, isComputed, isStatic);
        setter = _core.types.classMethod("set", setterKey, [_core.types.identifier("v")], setterBody, isComputed, isStatic);
      }
      element.insertAfter(setter);
      element.insertAfter(getter);
    }
    function extractProxyAccessorsFor(targetKey, version) {
      if (version !== "2023-11" && version !== "2023-05" && version !== "2023-01") {
        return [_core.template.expression.ast`
        function () {
          return this.${_core.types.cloneNode(targetKey)};
        }
      `, _core.template.expression.ast`
        function (value) {
          this.${_core.types.cloneNode(targetKey)} = value;
        }
      `];
      }
      return [_core.template.expression.ast`
      o => o.${_core.types.cloneNode(targetKey)}
    `, _core.template.expression.ast`
      (o, v) => o.${_core.types.cloneNode(targetKey)} = v
    `];
    }
    function getComputedKeyLastElement(path) {
      path = (0, _helperSkipTransparentExpressionWrappers.skipTransparentExprWrappers)(path);
      if (path.isSequenceExpression()) {
        const expressions = path.get("expressions");
        return getComputedKeyLastElement(expressions[expressions.length - 1]);
      }
      return path;
    }
    function getComputedKeyMemoiser(path) {
      const element = getComputedKeyLastElement(path);
      if (element.isConstantExpression()) {
        return _core.types.cloneNode(path.node);
      } else if (element.isIdentifier() && path.scope.hasUid(element.node.name)) {
        return _core.types.cloneNode(path.node);
      } else if (element.isAssignmentExpression() && element.get("left").isIdentifier()) {
        return _core.types.cloneNode(element.node.left);
      } else {
        throw new Error(`Internal Error: the computed key ${path.toString()} has not yet been memoised.`);
      }
    }
    function prependExpressionsToComputedKey(expressions, fieldPath) {
      const key = fieldPath.get("key");
      if (key.isSequenceExpression()) {
        expressions.push(...key.node.expressions);
      } else {
        expressions.push(key.node);
      }
      key.replaceWith(maybeSequenceExpression(expressions));
    }
    function appendExpressionsToComputedKey(expressions, fieldPath) {
      const key = fieldPath.get("key");
      const completion = getComputedKeyLastElement(key);
      if (completion.isConstantExpression()) {
        prependExpressionsToComputedKey(expressions, fieldPath);
      } else {
        const scopeParent = key.scope.parent;
        const maybeAssignment = (0, _misc.memoiseComputedKey)(completion.node, scopeParent, scopeParent.generateUid("computedKey"));
        if (!maybeAssignment) {
          prependExpressionsToComputedKey(expressions, fieldPath);
        } else {
          const expressionSequence = [...expressions, _core.types.cloneNode(maybeAssignment.left)];
          const completionParent = completion.parentPath;
          if (completionParent.isSequenceExpression()) {
            completionParent.pushContainer("expressions", expressionSequence);
          } else {
            completion.replaceWith(maybeSequenceExpression([_core.types.cloneNode(maybeAssignment), ...expressionSequence]));
          }
        }
      }
    }
    function prependExpressionsToFieldInitializer(expressions, fieldPath) {
      const initializer = fieldPath.get("value");
      if (initializer.node) {
        expressions.push(initializer.node);
      } else if (expressions.length > 0) {
        expressions[expressions.length - 1] = _core.types.unaryExpression("void", expressions[expressions.length - 1]);
      }
      initializer.replaceWith(maybeSequenceExpression(expressions));
    }
    function prependExpressionsToStaticBlock(expressions, blockPath) {
      blockPath.unshiftContainer("body", _core.types.expressionStatement(maybeSequenceExpression(expressions)));
    }
    function prependExpressionsToConstructor(expressions, constructorPath) {
      constructorPath.node.body.body.unshift(_core.types.expressionStatement(maybeSequenceExpression(expressions)));
    }
    function isProtoInitCallExpression(expression, protoInitCall) {
      return _core.types.isCallExpression(expression) && _core.types.isIdentifier(expression.callee, {
        name: protoInitCall.name
      });
    }
    function optimizeSuperCallAndExpressions(expressions, protoInitLocal) {
      if (protoInitLocal) {
        if (expressions.length >= 2 && isProtoInitCallExpression(expressions[1], protoInitLocal)) {
          const mergedSuperCall = _core.types.callExpression(_core.types.cloneNode(protoInitLocal), [expressions[0]]);
          expressions.splice(0, 2, mergedSuperCall);
        }
        if (expressions.length >= 2 && _core.types.isThisExpression(expressions[expressions.length - 1]) && isProtoInitCallExpression(expressions[expressions.length - 2], protoInitLocal)) {
          expressions.splice(expressions.length - 1, 1);
        }
      }
      return maybeSequenceExpression(expressions);
    }
    function insertExpressionsAfterSuperCallAndOptimize(expressions, constructorPath, protoInitLocal) {
      constructorPath.traverse({
        CallExpression: {
          exit(path) {
            if (!path.get("callee").isSuper()) return;
            const newNodes = [path.node, ...expressions.map((expr) => _core.types.cloneNode(expr))];
            if (path.isCompletionRecord()) {
              newNodes.push(_core.types.thisExpression());
            }
            path.replaceWith(optimizeSuperCallAndExpressions(newNodes, protoInitLocal));
            path.skip();
          }
        },
        ClassMethod(path) {
          if (path.node.kind === "constructor") {
            path.skip();
          }
        }
      });
    }
    function createConstructorFromExpressions(expressions, isDerivedClass) {
      const body = [_core.types.expressionStatement(maybeSequenceExpression(expressions))];
      if (isDerivedClass) {
        body.unshift(_core.types.expressionStatement(_core.types.callExpression(_core.types.super(), [_core.types.spreadElement(_core.types.identifier("args"))])));
      }
      return _core.types.classMethod("constructor", _core.types.identifier("constructor"), isDerivedClass ? [_core.types.restElement(_core.types.identifier("args"))] : [], _core.types.blockStatement(body));
    }
    function createStaticBlockFromExpressions(expressions) {
      return _core.types.staticBlock([_core.types.expressionStatement(maybeSequenceExpression(expressions))]);
    }
    var FIELD = 0;
    var ACCESSOR = 1;
    var METHOD = 2;
    var GETTER = 3;
    var SETTER = 4;
    var STATIC_OLD_VERSION = 5;
    var STATIC = 8;
    var DECORATORS_HAVE_THIS = 16;
    function getElementKind(element) {
      switch (element.node.type) {
        case "ClassProperty":
        case "ClassPrivateProperty":
          return FIELD;
        case "ClassAccessorProperty":
          return ACCESSOR;
        case "ClassMethod":
        case "ClassPrivateMethod":
          if (element.node.kind === "get") {
            return GETTER;
          } else if (element.node.kind === "set") {
            return SETTER;
          } else {
            return METHOD;
          }
      }
    }
    function toSortedDecoratorInfo(info) {
      return [...info.filter((el) => el.isStatic && el.kind >= ACCESSOR && el.kind <= SETTER), ...info.filter((el) => !el.isStatic && el.kind >= ACCESSOR && el.kind <= SETTER), ...info.filter((el) => el.isStatic && el.kind === FIELD), ...info.filter((el) => !el.isStatic && el.kind === FIELD)];
    }
    function generateDecorationList(decorators, decoratorsThis, version) {
      const decsCount = decorators.length;
      const haveOneThis = decoratorsThis.some(Boolean);
      const decs = [];
      for (let i = 0; i < decsCount; i++) {
        if ((version === "2023-11" || version === "2023-05") && haveOneThis) {
          decs.push(decoratorsThis[i] || _core.types.unaryExpression("void", _core.types.numericLiteral(0)));
        }
        decs.push(decorators[i].expression);
      }
      return {
        haveThis: haveOneThis,
        decs
      };
    }
    function generateDecorationExprs(decorationInfo, version) {
      return _core.types.arrayExpression(decorationInfo.map((el) => {
        let flag = el.kind;
        if (el.isStatic) {
          flag += version === "2023-11" || version === "2023-05" ? STATIC : STATIC_OLD_VERSION;
        }
        if (el.decoratorsHaveThis) flag += DECORATORS_HAVE_THIS;
        return _core.types.arrayExpression([el.decoratorsArray, _core.types.numericLiteral(flag), el.name, ...el.privateMethods || []]);
      }));
    }
    function extractElementLocalAssignments(decorationInfo) {
      const localIds = [];
      for (const el of decorationInfo) {
        const {
          locals
        } = el;
        if (Array.isArray(locals)) {
          localIds.push(...locals);
        } else if (locals !== void 0) {
          localIds.push(locals);
        }
      }
      return localIds;
    }
    function addCallAccessorsFor(version, element, key, getId, setId, isStatic) {
      element.insertAfter(_core.types.classPrivateMethod("get", _core.types.cloneNode(key), [], _core.types.blockStatement([_core.types.returnStatement(_core.types.callExpression(_core.types.cloneNode(getId), version === "2023-11" && isStatic ? [] : [_core.types.thisExpression()]))]), isStatic));
      element.insertAfter(_core.types.classPrivateMethod("set", _core.types.cloneNode(key), [_core.types.identifier("v")], _core.types.blockStatement([_core.types.expressionStatement(_core.types.callExpression(_core.types.cloneNode(setId), version === "2023-11" && isStatic ? [_core.types.identifier("v")] : [_core.types.thisExpression(), _core.types.identifier("v")]))]), isStatic));
    }
    function movePrivateAccessor(element, key, methodLocalVar, isStatic) {
      let params;
      let block;
      if (element.node.kind === "set") {
        params = [_core.types.identifier("v")];
        block = [_core.types.expressionStatement(_core.types.callExpression(methodLocalVar, [_core.types.thisExpression(), _core.types.identifier("v")]))];
      } else {
        params = [];
        block = [_core.types.returnStatement(_core.types.callExpression(methodLocalVar, [_core.types.thisExpression()]))];
      }
      element.replaceWith(_core.types.classPrivateMethod(element.node.kind, _core.types.cloneNode(key), params, _core.types.blockStatement(block), isStatic));
    }
    function isClassDecoratableElementPath(path) {
      const {
        type
      } = path;
      return type !== "TSDeclareMethod" && type !== "TSIndexSignature" && type !== "StaticBlock";
    }
    function staticBlockToIIFE(block) {
      return _core.types.callExpression(_core.types.arrowFunctionExpression([], _core.types.blockStatement(block.body)), []);
    }
    function staticBlockToFunctionClosure(block) {
      return _core.types.functionExpression(null, [], _core.types.blockStatement(block.body));
    }
    function fieldInitializerToClosure(value2) {
      return _core.types.functionExpression(null, [], _core.types.blockStatement([_core.types.returnStatement(value2)]));
    }
    function maybeSequenceExpression(exprs) {
      if (exprs.length === 0) return _core.types.unaryExpression("void", _core.types.numericLiteral(0));
      if (exprs.length === 1) return exprs[0];
      return _core.types.sequenceExpression(exprs);
    }
    function createFunctionExpressionFromPrivateMethod(node) {
      const {
        params,
        body,
        generator: isGenerator,
        async: isAsync
      } = node;
      return _core.types.functionExpression(void 0, params, body, isGenerator, isAsync);
    }
    function createSetFunctionNameCall(state, className) {
      return _core.types.callExpression(state.addHelper("setFunctionName"), [_core.types.thisExpression(), className]);
    }
    function createToPropertyKeyCall(state, propertyKey) {
      return _core.types.callExpression(state.addHelper("toPropertyKey"), [propertyKey]);
    }
    function createPrivateBrandCheckClosure(brandName) {
      return _core.types.arrowFunctionExpression([_core.types.identifier("_")], _core.types.binaryExpression("in", _core.types.cloneNode(brandName), _core.types.identifier("_")));
    }
    function usesPrivateField(expression) {
      try {
        _core.types.traverseFast(expression, (node) => {
          if (_core.types.isPrivateName(node)) {
            throw null;
          }
        });
        return false;
      } catch (_unused) {
        return true;
      }
    }
    function convertToComputedKey(path) {
      const {
        node
      } = path;
      node.computed = true;
      if (_core.types.isIdentifier(node.key)) {
        node.key = _core.types.stringLiteral(node.key.name);
      }
    }
    function hasInstancePrivateAccess(path, privateNames) {
      let containsInstancePrivateAccess = false;
      if (privateNames.length > 0) {
        const privateNameVisitor = (0, _fields.privateNameVisitorFactory)({
          PrivateName(path2, state) {
            if (state.privateNamesMap.has(path2.node.id.name)) {
              containsInstancePrivateAccess = true;
              path2.stop();
            }
          }
        });
        const privateNamesMap = /* @__PURE__ */ new Map();
        for (const name of privateNames) {
          privateNamesMap.set(name, null);
        }
        path.traverse(privateNameVisitor, {
          privateNamesMap
        });
      }
      return containsInstancePrivateAccess;
    }
    function checkPrivateMethodUpdateError(path, decoratedPrivateMethods) {
      const privateNameVisitor = (0, _fields.privateNameVisitorFactory)({
        PrivateName(path2, state) {
          if (!state.privateNamesMap.has(path2.node.id.name)) return;
          const parentPath = path2.parentPath;
          const parentParentPath = parentPath.parentPath;
          if (parentParentPath.node.type === "AssignmentExpression" && parentParentPath.node.left === parentPath.node || parentParentPath.node.type === "UpdateExpression" || parentParentPath.node.type === "RestElement" || parentParentPath.node.type === "ArrayPattern" || parentParentPath.node.type === "ObjectProperty" && parentParentPath.node.value === parentPath.node && parentParentPath.parentPath.type === "ObjectPattern" || parentParentPath.node.type === "ForOfStatement" && parentParentPath.node.left === parentPath.node) {
            throw path2.buildCodeFrameError(`Decorated private methods are read-only, but "#${path2.node.id.name}" is updated via this expression.`);
          }
        }
      });
      const privateNamesMap = /* @__PURE__ */ new Map();
      for (const name of decoratedPrivateMethods) {
        privateNamesMap.set(name, null);
      }
      path.traverse(privateNameVisitor, {
        privateNamesMap
      });
    }
    function transformClass(path, state, constantSuper, ignoreFunctionLength, className, propertyVisitor, version) {
      var _path$node$id;
      const body = path.get("body.body");
      const classDecorators = path.node.decorators;
      let hasElementDecorators = false;
      let hasComputedKeysSideEffects = false;
      let elemDecsUseFnContext = false;
      const generateClassPrivateUid = createLazyPrivateUidGeneratorForClass(path);
      const classAssignments = [];
      const scopeParent = path.scope.parent;
      const memoiseExpression = (expression, hint, assignments) => {
        const localEvaluatedId = generateLetUidIdentifier(scopeParent, hint);
        assignments.push(_core.types.assignmentExpression("=", localEvaluatedId, expression));
        return _core.types.cloneNode(localEvaluatedId);
      };
      let protoInitLocal;
      let staticInitLocal;
      const classIdName = (_path$node$id = path.node.id) == null ? void 0 : _path$node$id.name;
      const setClassName = typeof className === "object" ? className : void 0;
      const usesFunctionContextOrYieldAwait = (decorator) => {
        try {
          _core.types.traverseFast(decorator, (node) => {
            if (_core.types.isThisExpression(node) || _core.types.isSuper(node) || _core.types.isYieldExpression(node) || _core.types.isAwaitExpression(node) || _core.types.isIdentifier(node, {
              name: "arguments"
            }) || classIdName && _core.types.isIdentifier(node, {
              name: classIdName
            }) || _core.types.isMetaProperty(node) && node.meta.name !== "import") {
              throw null;
            }
          });
          return false;
        } catch (_unused2) {
          return true;
        }
      };
      const instancePrivateNames = [];
      for (const element of body) {
        if (!isClassDecoratableElementPath(element)) {
          continue;
        }
        const elementNode = element.node;
        if (!elementNode.static && _core.types.isPrivateName(elementNode.key)) {
          instancePrivateNames.push(elementNode.key.id.name);
        }
        if (isDecorated(elementNode)) {
          switch (elementNode.type) {
            case "ClassProperty":
              propertyVisitor.ClassProperty(element, state);
              break;
            case "ClassPrivateProperty":
              propertyVisitor.ClassPrivateProperty(element, state);
              break;
            case "ClassAccessorProperty":
              propertyVisitor.ClassAccessorProperty(element, state);
              if (version === "2023-11") {
                break;
              }
            default:
              if (elementNode.static) {
                staticInitLocal != null ? staticInitLocal : staticInitLocal = generateLetUidIdentifier(scopeParent, "initStatic");
              } else {
                protoInitLocal != null ? protoInitLocal : protoInitLocal = generateLetUidIdentifier(scopeParent, "initProto");
              }
              break;
          }
          hasElementDecorators = true;
          elemDecsUseFnContext || (elemDecsUseFnContext = elementNode.decorators.some(usesFunctionContextOrYieldAwait));
        } else if (elementNode.type === "ClassAccessorProperty") {
          propertyVisitor.ClassAccessorProperty(element, state);
          const {
            key,
            value: value2,
            static: isStatic,
            computed
          } = elementNode;
          const newId = generateClassPrivateUid();
          const newField = generateClassProperty(newId, value2, isStatic);
          const keyPath = element.get("key");
          const [newPath] = element.replaceWith(newField);
          let getterKey, setterKey;
          if (computed && !keyPath.isConstantExpression()) {
            getterKey = (0, _misc.memoiseComputedKey)(createToPropertyKeyCall(state, key), scopeParent, scopeParent.generateUid("computedKey"));
            setterKey = _core.types.cloneNode(getterKey.left);
          } else {
            getterKey = _core.types.cloneNode(key);
            setterKey = _core.types.cloneNode(key);
          }
          assignIdForAnonymousClass(path, className);
          addProxyAccessorsFor(path.node.id, newPath, getterKey, setterKey, newId, computed, isStatic, version);
        }
        if ("computed" in element.node && element.node.computed) {
          hasComputedKeysSideEffects || (hasComputedKeysSideEffects = !scopeParent.isStatic(element.node.key));
        }
      }
      if (!classDecorators && !hasElementDecorators) {
        if (!path.node.id && typeof className === "string") {
          path.node.id = _core.types.identifier(className);
        }
        if (setClassName) {
          path.node.body.body.unshift(createStaticBlockFromExpressions([createSetFunctionNameCall(state, setClassName)]));
        }
        return;
      }
      const elementDecoratorInfo = [];
      let constructorPath;
      const decoratedPrivateMethods = /* @__PURE__ */ new Set();
      let classInitLocal, classIdLocal;
      let decoratorReceiverId = null;
      function handleDecorators(decorators) {
        let hasSideEffects = false;
        let usesFnContext = false;
        const decoratorsThis = [];
        for (const decorator of decorators) {
          const {
            expression
          } = decorator;
          let object;
          if ((version === "2023-11" || version === "2023-05") && _core.types.isMemberExpression(expression)) {
            if (_core.types.isSuper(expression.object)) {
              object = _core.types.thisExpression();
            } else if (scopeParent.isStatic(expression.object)) {
              object = _core.types.cloneNode(expression.object);
            } else {
              decoratorReceiverId != null ? decoratorReceiverId : decoratorReceiverId = generateLetUidIdentifier(scopeParent, "obj");
              object = _core.types.assignmentExpression("=", _core.types.cloneNode(decoratorReceiverId), expression.object);
              expression.object = _core.types.cloneNode(decoratorReceiverId);
            }
          }
          decoratorsThis.push(object);
          hasSideEffects || (hasSideEffects = !scopeParent.isStatic(expression));
          usesFnContext || (usesFnContext = usesFunctionContextOrYieldAwait(decorator));
        }
        return {
          hasSideEffects,
          usesFnContext,
          decoratorsThis
        };
      }
      const willExtractSomeElemDecs = hasComputedKeysSideEffects || elemDecsUseFnContext || version !== "2023-11";
      let needsDeclarationForClassBinding = false;
      let classDecorationsFlag = 0;
      let classDecorations = [];
      let classDecorationsId;
      let computedKeyAssignments = [];
      if (classDecorators) {
        classInitLocal = generateLetUidIdentifier(scopeParent, "initClass");
        needsDeclarationForClassBinding = path.isClassDeclaration();
        ({
          id: classIdLocal,
          path
        } = replaceClassWithVar(path, className));
        path.node.decorators = null;
        const classDecsUsePrivateName = classDecorators.some(usesPrivateField);
        const {
          hasSideEffects,
          usesFnContext,
          decoratorsThis
        } = handleDecorators(classDecorators);
        const {
          haveThis,
          decs
        } = generateDecorationList(classDecorators, decoratorsThis, version);
        classDecorationsFlag = haveThis ? 1 : 0;
        classDecorations = decs;
        if (usesFnContext || hasSideEffects && willExtractSomeElemDecs || classDecsUsePrivateName) {
          classDecorationsId = memoiseExpression(_core.types.arrayExpression(classDecorations), "classDecs", classAssignments);
        }
        if (!hasElementDecorators) {
          for (const element of path.get("body.body")) {
            const {
              node
            } = element;
            const isComputed = "computed" in node && node.computed;
            if (isComputed) {
              if (element.isClassProperty({
                static: true
              })) {
                if (!element.get("key").isConstantExpression()) {
                  const key = node.key;
                  const maybeAssignment = (0, _misc.memoiseComputedKey)(key, scopeParent, scopeParent.generateUid("computedKey"));
                  if (maybeAssignment != null) {
                    node.key = _core.types.cloneNode(maybeAssignment.left);
                    computedKeyAssignments.push(maybeAssignment);
                  }
                }
              } else if (computedKeyAssignments.length > 0) {
                prependExpressionsToComputedKey(computedKeyAssignments, element);
                computedKeyAssignments = [];
              }
            }
          }
        }
      } else {
        assignIdForAnonymousClass(path, className);
        classIdLocal = _core.types.cloneNode(path.node.id);
      }
      let lastInstancePrivateName;
      let needsInstancePrivateBrandCheck = false;
      let fieldInitializerExpressions = [];
      let staticFieldInitializerExpressions = [];
      if (hasElementDecorators) {
        if (protoInitLocal) {
          const protoInitCall = _core.types.callExpression(_core.types.cloneNode(protoInitLocal), [_core.types.thisExpression()]);
          fieldInitializerExpressions.push(protoInitCall);
        }
        for (const element of body) {
          if (!isClassDecoratableElementPath(element)) {
            if (staticFieldInitializerExpressions.length > 0 && element.isStaticBlock()) {
              prependExpressionsToStaticBlock(staticFieldInitializerExpressions, element);
              staticFieldInitializerExpressions = [];
            }
            continue;
          }
          const {
            node
          } = element;
          const decorators = node.decorators;
          const hasDecorators2 = !!(decorators != null && decorators.length);
          const isComputed = "computed" in node && node.computed;
          let name = "computedKey";
          if (node.key.type === "PrivateName") {
            name = node.key.id.name;
          } else if (!isComputed && node.key.type === "Identifier") {
            name = node.key.name;
          }
          let decoratorsArray;
          let decoratorsHaveThis;
          if (hasDecorators2) {
            const {
              hasSideEffects,
              usesFnContext,
              decoratorsThis
            } = handleDecorators(decorators);
            const {
              decs,
              haveThis
            } = generateDecorationList(decorators, decoratorsThis, version);
            decoratorsHaveThis = haveThis;
            decoratorsArray = decs.length === 1 ? decs[0] : _core.types.arrayExpression(decs);
            if (usesFnContext || hasSideEffects && willExtractSomeElemDecs) {
              decoratorsArray = memoiseExpression(decoratorsArray, name + "Decs", computedKeyAssignments);
            }
          }
          if (isComputed) {
            if (!element.get("key").isConstantExpression()) {
              const key2 = node.key;
              const maybeAssignment = (0, _misc.memoiseComputedKey)(hasDecorators2 ? createToPropertyKeyCall(state, key2) : key2, scopeParent, scopeParent.generateUid("computedKey"));
              if (maybeAssignment != null) {
                if (classDecorators && element.isClassProperty({
                  static: true
                })) {
                  node.key = _core.types.cloneNode(maybeAssignment.left);
                  computedKeyAssignments.push(maybeAssignment);
                } else {
                  node.key = maybeAssignment;
                }
              }
            }
          }
          const {
            key,
            static: isStatic
          } = node;
          const isPrivate = key.type === "PrivateName";
          const kind = getElementKind(element);
          if (isPrivate && !isStatic) {
            if (hasDecorators2) {
              needsInstancePrivateBrandCheck = true;
            }
            if (_core.types.isClassPrivateProperty(node) || !lastInstancePrivateName) {
              lastInstancePrivateName = key;
            }
          }
          if (element.isClassMethod({
            kind: "constructor"
          })) {
            constructorPath = element;
          }
          let locals;
          if (hasDecorators2) {
            let privateMethods;
            let nameExpr;
            if (isComputed) {
              nameExpr = getComputedKeyMemoiser(element.get("key"));
            } else if (key.type === "PrivateName") {
              nameExpr = _core.types.stringLiteral(key.id.name);
            } else if (key.type === "Identifier") {
              nameExpr = _core.types.stringLiteral(key.name);
            } else {
              nameExpr = _core.types.cloneNode(key);
            }
            if (kind === ACCESSOR) {
              const {
                value: value2
              } = element.node;
              const params = version === "2023-11" && isStatic ? [] : [_core.types.thisExpression()];
              if (value2) {
                params.push(_core.types.cloneNode(value2));
              }
              const newId = generateClassPrivateUid();
              const newFieldInitId = generateLetUidIdentifier(scopeParent, `init_${name}`);
              const newValue = _core.types.callExpression(_core.types.cloneNode(newFieldInitId), params);
              const newField = generateClassProperty(newId, newValue, isStatic);
              const [newPath] = element.replaceWith(newField);
              if (isPrivate) {
                privateMethods = extractProxyAccessorsFor(newId, version);
                const getId = generateLetUidIdentifier(scopeParent, `get_${name}`);
                const setId = generateLetUidIdentifier(scopeParent, `set_${name}`);
                addCallAccessorsFor(version, newPath, key, getId, setId, isStatic);
                locals = [newFieldInitId, getId, setId];
              } else {
                assignIdForAnonymousClass(path, className);
                addProxyAccessorsFor(path.node.id, newPath, _core.types.cloneNode(key), _core.types.isAssignmentExpression(key) ? _core.types.cloneNode(key.left) : _core.types.cloneNode(key), newId, isComputed, isStatic, version);
                locals = [newFieldInitId];
              }
            } else if (kind === FIELD) {
              const initId = generateLetUidIdentifier(scopeParent, `init_${name}`);
              const valuePath = element.get("value");
              const args = version === "2023-11" && isStatic ? [] : [_core.types.thisExpression()];
              if (valuePath.node) args.push(valuePath.node);
              valuePath.replaceWith(_core.types.callExpression(_core.types.cloneNode(initId), args));
              locals = [initId];
              if (isPrivate) {
                privateMethods = extractProxyAccessorsFor(key, version);
              }
            } else if (isPrivate) {
              const callId = generateLetUidIdentifier(scopeParent, `call_${name}`);
              locals = [callId];
              const replaceSupers = new _helperReplaceSupers.default({
                constantSuper,
                methodPath: element,
                objectRef: classIdLocal,
                superRef: path.node.superClass,
                file: state.file,
                refToPreserve: classIdLocal
              });
              replaceSupers.replace();
              privateMethods = [createFunctionExpressionFromPrivateMethod(element.node)];
              if (kind === GETTER || kind === SETTER) {
                movePrivateAccessor(element, _core.types.cloneNode(key), _core.types.cloneNode(callId), isStatic);
              } else {
                const node2 = element.node;
                path.node.body.body.unshift(_core.types.classPrivateProperty(key, _core.types.cloneNode(callId), [], node2.static));
                decoratedPrivateMethods.add(key.id.name);
                element.remove();
              }
            }
            elementDecoratorInfo.push({
              kind,
              decoratorsArray,
              decoratorsHaveThis,
              name: nameExpr,
              isStatic,
              privateMethods,
              locals
            });
            if (element.node) {
              element.node.decorators = null;
            }
          }
          if (isComputed && computedKeyAssignments.length > 0) {
            if (classDecorators && element.isClassProperty({
              static: true
            })) {
            } else {
              prependExpressionsToComputedKey(computedKeyAssignments, kind === ACCESSOR ? element.getNextSibling() : element);
              computedKeyAssignments = [];
            }
          }
          if (fieldInitializerExpressions.length > 0 && !isStatic && (kind === FIELD || kind === ACCESSOR)) {
            prependExpressionsToFieldInitializer(fieldInitializerExpressions, element);
            fieldInitializerExpressions = [];
          }
          if (staticFieldInitializerExpressions.length > 0 && isStatic && (kind === FIELD || kind === ACCESSOR)) {
            prependExpressionsToFieldInitializer(staticFieldInitializerExpressions, element);
            staticFieldInitializerExpressions = [];
          }
          if (hasDecorators2 && version === "2023-11") {
            if (kind === FIELD || kind === ACCESSOR) {
              const initExtraId = generateLetUidIdentifier(scopeParent, `init_extra_${name}`);
              locals.push(initExtraId);
              const initExtraCall = _core.types.callExpression(_core.types.cloneNode(initExtraId), isStatic ? [] : [_core.types.thisExpression()]);
              if (!isStatic) {
                fieldInitializerExpressions.push(initExtraCall);
              } else {
                staticFieldInitializerExpressions.push(initExtraCall);
              }
            }
          }
        }
      }
      if (computedKeyAssignments.length > 0) {
        const elements = path.get("body.body");
        let lastComputedElement;
        for (let i = elements.length - 1; i >= 0; i--) {
          const path2 = elements[i];
          const node = path2.node;
          if (node.computed) {
            if (classDecorators && _core.types.isClassProperty(node, {
              static: true
            })) {
              continue;
            }
            lastComputedElement = path2;
            break;
          }
        }
        if (lastComputedElement != null) {
          appendExpressionsToComputedKey(computedKeyAssignments, lastComputedElement);
          computedKeyAssignments = [];
        } else {
        }
      }
      if (fieldInitializerExpressions.length > 0) {
        const isDerivedClass = !!path.node.superClass;
        if (constructorPath) {
          if (isDerivedClass) {
            insertExpressionsAfterSuperCallAndOptimize(fieldInitializerExpressions, constructorPath, protoInitLocal);
          } else {
            prependExpressionsToConstructor(fieldInitializerExpressions, constructorPath);
          }
        } else {
          path.node.body.body.unshift(createConstructorFromExpressions(fieldInitializerExpressions, isDerivedClass));
        }
        fieldInitializerExpressions = [];
      }
      if (staticFieldInitializerExpressions.length > 0) {
        path.node.body.body.push(createStaticBlockFromExpressions(staticFieldInitializerExpressions));
        staticFieldInitializerExpressions = [];
      }
      const sortedElementDecoratorInfo = toSortedDecoratorInfo(elementDecoratorInfo);
      const elementDecorations = generateDecorationExprs(version === "2023-11" ? elementDecoratorInfo : sortedElementDecoratorInfo, version);
      const elementLocals = extractElementLocalAssignments(sortedElementDecoratorInfo);
      if (protoInitLocal) {
        elementLocals.push(protoInitLocal);
      }
      if (staticInitLocal) {
        elementLocals.push(staticInitLocal);
      }
      const classLocals = [];
      let classInitInjected = false;
      const classInitCall = classInitLocal && _core.types.callExpression(_core.types.cloneNode(classInitLocal), []);
      let originalClassPath = path;
      const originalClass = path.node;
      const staticClosures = [];
      if (classDecorators) {
        classLocals.push(classIdLocal, classInitLocal);
        const statics = [];
        path.get("body.body").forEach((element) => {
          if (element.isStaticBlock()) {
            if (hasInstancePrivateAccess(element, instancePrivateNames)) {
              const staticBlockClosureId = memoiseExpression(staticBlockToFunctionClosure(element.node), "staticBlock", staticClosures);
              staticFieldInitializerExpressions.push(_core.types.callExpression(_core.types.memberExpression(staticBlockClosureId, _core.types.identifier("call")), [_core.types.thisExpression()]));
            } else {
              staticFieldInitializerExpressions.push(staticBlockToIIFE(element.node));
            }
            element.remove();
            return;
          }
          if ((element.isClassProperty() || element.isClassPrivateProperty()) && element.node.static) {
            const valuePath = element.get("value");
            if (hasInstancePrivateAccess(valuePath, instancePrivateNames)) {
              const fieldValueClosureId = memoiseExpression(fieldInitializerToClosure(valuePath.node), "fieldValue", staticClosures);
              valuePath.replaceWith(_core.types.callExpression(_core.types.memberExpression(fieldValueClosureId, _core.types.identifier("call")), [_core.types.thisExpression()]));
            }
            if (staticFieldInitializerExpressions.length > 0) {
              prependExpressionsToFieldInitializer(staticFieldInitializerExpressions, element);
              staticFieldInitializerExpressions = [];
            }
            element.node.static = false;
            statics.push(element.node);
            element.remove();
          } else if (element.isClassPrivateMethod({
            static: true
          })) {
            if (hasInstancePrivateAccess(element, instancePrivateNames)) {
              const replaceSupers = new _helperReplaceSupers.default({
                constantSuper,
                methodPath: element,
                objectRef: classIdLocal,
                superRef: path.node.superClass,
                file: state.file,
                refToPreserve: classIdLocal
              });
              replaceSupers.replace();
              const privateMethodDelegateId = memoiseExpression(createFunctionExpressionFromPrivateMethod(element.node), element.get("key.id").node.name, staticClosures);
              if (ignoreFunctionLength) {
                element.node.params = [_core.types.restElement(_core.types.identifier("arg"))];
                element.node.body = _core.types.blockStatement([_core.types.returnStatement(_core.types.callExpression(_core.types.memberExpression(privateMethodDelegateId, _core.types.identifier("apply")), [_core.types.thisExpression(), _core.types.identifier("arg")]))]);
              } else {
                element.node.params = element.node.params.map((p, i) => {
                  if (_core.types.isRestElement(p)) {
                    return _core.types.restElement(_core.types.identifier("arg"));
                  } else {
                    return _core.types.identifier("_" + i);
                  }
                });
                element.node.body = _core.types.blockStatement([_core.types.returnStatement(_core.types.callExpression(_core.types.memberExpression(privateMethodDelegateId, _core.types.identifier("apply")), [_core.types.thisExpression(), _core.types.identifier("arguments")]))]);
              }
            }
            element.node.static = false;
            statics.push(element.node);
            element.remove();
          }
        });
        if (statics.length > 0 || staticFieldInitializerExpressions.length > 0) {
          const staticsClass = _core.template.expression.ast`
        class extends ${state.addHelper("identity")} {}
      `;
          staticsClass.body.body = [_core.types.classProperty(_core.types.toExpression(originalClass), void 0, void 0, void 0, true, true), ...statics];
          const constructorBody = [];
          const newExpr = _core.types.newExpression(staticsClass, []);
          if (staticFieldInitializerExpressions.length > 0) {
            constructorBody.push(...staticFieldInitializerExpressions);
          }
          if (classInitCall) {
            classInitInjected = true;
            constructorBody.push(classInitCall);
          }
          if (constructorBody.length > 0) {
            constructorBody.unshift(_core.types.callExpression(_core.types.super(), [_core.types.cloneNode(classIdLocal)]));
            staticsClass.body.body.push(createConstructorFromExpressions(constructorBody, false));
          } else {
            newExpr.arguments.push(_core.types.cloneNode(classIdLocal));
          }
          const [newPath] = path.replaceWith(newExpr);
          originalClassPath = newPath.get("callee").get("body").get("body.0.key");
        }
      }
      if (!classInitInjected && classInitCall) {
        path.node.body.body.push(_core.types.staticBlock([_core.types.expressionStatement(classInitCall)]));
      }
      let {
        superClass
      } = originalClass;
      if (superClass && (version === "2023-11" || version === "2023-05")) {
        const id = path.scope.maybeGenerateMemoised(superClass);
        if (id) {
          originalClass.superClass = _core.types.assignmentExpression("=", id, superClass);
          superClass = id;
        }
      }
      const applyDecoratorWrapper = _core.types.staticBlock([]);
      originalClass.body.body.unshift(applyDecoratorWrapper);
      const applyDecsBody = applyDecoratorWrapper.body;
      if (computedKeyAssignments.length > 0) {
        const elements = originalClassPath.get("body.body");
        let firstPublicElement;
        for (const path2 of elements) {
          if ((path2.isClassProperty() || path2.isClassMethod()) && path2.node.kind !== "constructor") {
            firstPublicElement = path2;
            break;
          }
        }
        if (firstPublicElement != null) {
          convertToComputedKey(firstPublicElement);
          prependExpressionsToComputedKey(computedKeyAssignments, firstPublicElement);
        } else {
          originalClass.body.body.unshift(_core.types.classProperty(_core.types.sequenceExpression([...computedKeyAssignments, _core.types.stringLiteral("_")]), void 0, void 0, void 0, true, true));
          applyDecsBody.push(_core.types.expressionStatement(_core.types.unaryExpression("delete", _core.types.memberExpression(_core.types.thisExpression(), _core.types.identifier("_")))));
        }
        computedKeyAssignments = [];
      }
      applyDecsBody.push(_core.types.expressionStatement(createLocalsAssignment(elementLocals, classLocals, elementDecorations, classDecorationsId != null ? classDecorationsId : _core.types.arrayExpression(classDecorations), _core.types.numericLiteral(classDecorationsFlag), needsInstancePrivateBrandCheck ? lastInstancePrivateName : null, setClassName, _core.types.cloneNode(superClass), state, version)));
      if (staticInitLocal) {
        applyDecsBody.push(_core.types.expressionStatement(_core.types.callExpression(_core.types.cloneNode(staticInitLocal), [_core.types.thisExpression()])));
      }
      if (staticClosures.length > 0) {
        applyDecsBody.push(...staticClosures.map((expr) => _core.types.expressionStatement(expr)));
      }
      path.insertBefore(classAssignments.map((expr) => _core.types.expressionStatement(expr)));
      if (needsDeclarationForClassBinding) {
        const classBindingInfo = scopeParent.getBinding(classIdLocal.name);
        if (!classBindingInfo.constantViolations.length) {
          path.insertBefore(_core.types.variableDeclaration("let", [_core.types.variableDeclarator(_core.types.cloneNode(classIdLocal))]));
        } else {
          const classOuterBindingDelegateLocal = scopeParent.generateUidIdentifier("t" + classIdLocal.name);
          const classOuterBindingLocal = classIdLocal;
          path.replaceWithMultiple([_core.types.variableDeclaration("let", [_core.types.variableDeclarator(_core.types.cloneNode(classOuterBindingLocal)), _core.types.variableDeclarator(classOuterBindingDelegateLocal)]), _core.types.blockStatement([_core.types.variableDeclaration("let", [_core.types.variableDeclarator(_core.types.cloneNode(classIdLocal))]), path.node, _core.types.expressionStatement(_core.types.assignmentExpression("=", _core.types.cloneNode(classOuterBindingDelegateLocal), _core.types.cloneNode(classIdLocal)))]), _core.types.expressionStatement(_core.types.assignmentExpression("=", _core.types.cloneNode(classOuterBindingLocal), _core.types.cloneNode(classOuterBindingDelegateLocal)))]);
        }
      }
      if (decoratedPrivateMethods.size > 0) {
        checkPrivateMethodUpdateError(path, decoratedPrivateMethods);
      }
      path.scope.crawl();
      return path;
    }
    function createLocalsAssignment(elementLocals, classLocals, elementDecorations, classDecorations, classDecorationsFlag, maybePrivateBrandName, setClassName, superClass, state, version) {
      let lhs, rhs;
      const args = [setClassName ? createSetFunctionNameCall(state, setClassName) : _core.types.thisExpression(), classDecorations, elementDecorations];
      if (version !== "2023-11") {
        args.splice(1, 2, elementDecorations, classDecorations);
      }
      if (version === "2021-12" || version === "2022-03" && !state.availableHelper("applyDecs2203R")) {
        lhs = _core.types.arrayPattern([...elementLocals, ...classLocals]);
        rhs = _core.types.callExpression(state.addHelper(version === "2021-12" ? "applyDecs" : "applyDecs2203"), args);
        return _core.types.assignmentExpression("=", lhs, rhs);
      } else if (version === "2022-03") {
        rhs = _core.types.callExpression(state.addHelper("applyDecs2203R"), args);
      } else if (version === "2023-01") {
        if (maybePrivateBrandName) {
          args.push(createPrivateBrandCheckClosure(maybePrivateBrandName));
        }
        rhs = _core.types.callExpression(state.addHelper("applyDecs2301"), args);
      } else if (version === "2023-05") {
        if (maybePrivateBrandName || superClass || classDecorationsFlag.value !== 0) {
          args.push(classDecorationsFlag);
        }
        if (maybePrivateBrandName) {
          args.push(createPrivateBrandCheckClosure(maybePrivateBrandName));
        } else if (superClass) {
          args.push(_core.types.unaryExpression("void", _core.types.numericLiteral(0)));
        }
        if (superClass) args.push(superClass);
        rhs = _core.types.callExpression(state.addHelper("applyDecs2305"), args);
      }
      if (version === "2023-11") {
        if (maybePrivateBrandName || superClass || classDecorationsFlag.value !== 0) {
          args.push(classDecorationsFlag);
        }
        if (maybePrivateBrandName) {
          args.push(createPrivateBrandCheckClosure(maybePrivateBrandName));
        } else if (superClass) {
          args.push(_core.types.unaryExpression("void", _core.types.numericLiteral(0)));
        }
        if (superClass) args.push(superClass);
        rhs = _core.types.callExpression(state.addHelper("applyDecs2311"), args);
      }
      if (elementLocals.length > 0) {
        if (classLocals.length > 0) {
          lhs = _core.types.objectPattern([_core.types.objectProperty(_core.types.identifier("e"), _core.types.arrayPattern(elementLocals)), _core.types.objectProperty(_core.types.identifier("c"), _core.types.arrayPattern(classLocals))]);
        } else {
          lhs = _core.types.arrayPattern(elementLocals);
          rhs = _core.types.memberExpression(rhs, _core.types.identifier("e"), false, false);
        }
      } else {
        lhs = _core.types.arrayPattern(classLocals);
        rhs = _core.types.memberExpression(rhs, _core.types.identifier("c"), false, false);
      }
      return _core.types.assignmentExpression("=", lhs, rhs);
    }
    function isProtoKey(node) {
      return node.type === "Identifier" ? node.name === "__proto__" : node.value === "__proto__";
    }
    function isDecorated(node) {
      return node.decorators && node.decorators.length > 0;
    }
    function shouldTransformElement(node) {
      switch (node.type) {
        case "ClassAccessorProperty":
          return true;
        case "ClassMethod":
        case "ClassProperty":
        case "ClassPrivateMethod":
        case "ClassPrivateProperty":
          return isDecorated(node);
        default:
          return false;
      }
    }
    function shouldTransformClass(node) {
      return isDecorated(node) || node.body.body.some(shouldTransformElement);
    }
    function buildNamedEvaluationVisitor(needsName, visitor) {
      function handleComputedProperty(propertyPath, key, state) {
        switch (key.type) {
          case "StringLiteral":
            return _core.types.stringLiteral(key.value);
          case "NumericLiteral":
          case "BigIntLiteral": {
            const keyValue = key.value + "";
            propertyPath.get("key").replaceWith(_core.types.stringLiteral(keyValue));
            return _core.types.stringLiteral(keyValue);
          }
          default: {
            const ref = propertyPath.scope.maybeGenerateMemoised(key);
            propertyPath.get("key").replaceWith(_core.types.assignmentExpression("=", ref, createToPropertyKeyCall(state, key)));
            return _core.types.cloneNode(ref);
          }
        }
      }
      return {
        VariableDeclarator(path, state) {
          const id = path.node.id;
          if (id.type === "Identifier") {
            const initializer = (0, _helperSkipTransparentExpressionWrappers.skipTransparentExprWrappers)(path.get("init"));
            if (needsName(initializer)) {
              const name = id.name;
              visitor(initializer, state, name);
            }
          }
        },
        AssignmentExpression(path, state) {
          const id = path.node.left;
          if (id.type === "Identifier") {
            const initializer = (0, _helperSkipTransparentExpressionWrappers.skipTransparentExprWrappers)(path.get("right"));
            if (needsName(initializer)) {
              switch (path.node.operator) {
                case "=":
                case "&&=":
                case "||=":
                case "??=":
                  visitor(initializer, state, id.name);
              }
            }
          }
        },
        AssignmentPattern(path, state) {
          const id = path.node.left;
          if (id.type === "Identifier") {
            const initializer = (0, _helperSkipTransparentExpressionWrappers.skipTransparentExprWrappers)(path.get("right"));
            if (needsName(initializer)) {
              const name = id.name;
              visitor(initializer, state, name);
            }
          }
        },
        ObjectExpression(path, state) {
          for (const propertyPath of path.get("properties")) {
            if (!propertyPath.isObjectProperty()) continue;
            const {
              node
            } = propertyPath;
            const id = node.key;
            const initializer = (0, _helperSkipTransparentExpressionWrappers.skipTransparentExprWrappers)(propertyPath.get("value"));
            if (needsName(initializer)) {
              if (!node.computed) {
                if (!isProtoKey(id)) {
                  if (id.type === "Identifier") {
                    visitor(initializer, state, id.name);
                  } else {
                    const className = _core.types.stringLiteral(id.value + "");
                    visitor(initializer, state, className);
                  }
                }
              } else {
                const ref = handleComputedProperty(propertyPath, id, state);
                visitor(initializer, state, ref);
              }
            }
          }
        },
        ClassPrivateProperty(path, state) {
          const {
            node
          } = path;
          const initializer = (0, _helperSkipTransparentExpressionWrappers.skipTransparentExprWrappers)(path.get("value"));
          if (needsName(initializer)) {
            const className = _core.types.stringLiteral("#" + node.key.id.name);
            visitor(initializer, state, className);
          }
        },
        ClassAccessorProperty(path, state) {
          const {
            node
          } = path;
          const id = node.key;
          const initializer = (0, _helperSkipTransparentExpressionWrappers.skipTransparentExprWrappers)(path.get("value"));
          if (needsName(initializer)) {
            if (!node.computed) {
              if (id.type === "Identifier") {
                visitor(initializer, state, id.name);
              } else if (id.type === "PrivateName") {
                const className = _core.types.stringLiteral("#" + id.id.name);
                visitor(initializer, state, className);
              } else {
                const className = _core.types.stringLiteral(id.value + "");
                visitor(initializer, state, className);
              }
            } else {
              const ref = handleComputedProperty(path, id, state);
              visitor(initializer, state, ref);
            }
          }
        },
        ClassProperty(path, state) {
          const {
            node
          } = path;
          const id = node.key;
          const initializer = (0, _helperSkipTransparentExpressionWrappers.skipTransparentExprWrappers)(path.get("value"));
          if (needsName(initializer)) {
            if (!node.computed) {
              if (id.type === "Identifier") {
                visitor(initializer, state, id.name);
              } else {
                const className = _core.types.stringLiteral(id.value + "");
                visitor(initializer, state, className);
              }
            } else {
              const ref = handleComputedProperty(path, id, state);
              visitor(initializer, state, ref);
            }
          }
        }
      };
    }
    function isDecoratedAnonymousClassExpression(path) {
      return path.isClassExpression({
        id: null
      }) && shouldTransformClass(path.node);
    }
    function generateLetUidIdentifier(scope, name) {
      const id = scope.generateUidIdentifier(name);
      scope.push({
        id,
        kind: "let"
      });
      return _core.types.cloneNode(id);
    }
    function _default({
      assertVersion,
      assumption
    }, {
      loose
    }, version, inherits) {
      var _assumption, _assumption2;
      if (version === "2023-11" || version === "2023-05" || version === "2023-01") {
        assertVersion("^7.21.0");
      } else if (version === "2021-12") {
        assertVersion("^7.16.0");
      } else {
        assertVersion("^7.19.0");
      }
      const VISITED = /* @__PURE__ */ new WeakSet();
      const constantSuper = (_assumption = assumption("constantSuper")) != null ? _assumption : loose;
      const ignoreFunctionLength = (_assumption2 = assumption("ignoreFunctionLength")) != null ? _assumption2 : loose;
      const namedEvaluationVisitor = buildNamedEvaluationVisitor(isDecoratedAnonymousClassExpression, visitClass);
      function visitClass(path, state, className) {
        var _node$id;
        if (VISITED.has(path)) return;
        const {
          node
        } = path;
        className != null ? className : className = (_node$id = node.id) == null ? void 0 : _node$id.name;
        const newPath = transformClass(path, state, constantSuper, ignoreFunctionLength, className, namedEvaluationVisitor, version);
        if (newPath) {
          VISITED.add(newPath);
          return;
        }
        VISITED.add(path);
      }
      return {
        name: "proposal-decorators",
        inherits,
        visitor: Object.assign({
          ExportDefaultDeclaration(path, state) {
            const {
              declaration
            } = path.node;
            if ((declaration == null ? void 0 : declaration.type) === "ClassDeclaration" && isDecorated(declaration)) {
              var _path$splitExportDecl;
              const isAnonymous = !declaration.id;
              (_path$splitExportDecl = path.splitExportDeclaration) != null ? _path$splitExportDecl : path.splitExportDeclaration = require_lib9().NodePath.prototype.splitExportDeclaration;
              const updatedVarDeclarationPath = path.splitExportDeclaration();
              if (isAnonymous) {
                visitClass(updatedVarDeclarationPath, state, _core.types.stringLiteral("default"));
              }
            }
          },
          ExportNamedDeclaration(path) {
            const {
              declaration
            } = path.node;
            if ((declaration == null ? void 0 : declaration.type) === "ClassDeclaration" && isDecorated(declaration)) {
              var _path$splitExportDecl2;
              (_path$splitExportDecl2 = path.splitExportDeclaration) != null ? _path$splitExportDecl2 : path.splitExportDeclaration = require_lib9().NodePath.prototype.splitExportDeclaration;
              path.splitExportDeclaration();
            }
          },
          Class(path, state) {
            visitClass(path, state, void 0);
          }
        }, namedEvaluationVisitor)
      };
    }
  }
});

// node_modules/@babel/helper-create-class-features-plugin/lib/decorators-2018-09.js
var require_decorators_2018_09 = __commonJS({
  "node_modules/@babel/helper-create-class-features-plugin/lib/decorators-2018-09.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.buildDecoratedClass = buildDecoratedClass;
    var _core = require_lib27();
    var _helperReplaceSupers = require_lib19();
    function prop(key, value2) {
      if (!value2) return null;
      return _core.types.objectProperty(_core.types.identifier(key), value2);
    }
    function method(key, body) {
      return _core.types.objectMethod("method", _core.types.identifier(key), [], _core.types.blockStatement(body));
    }
    function takeDecorators(node) {
      let result;
      if (node.decorators && node.decorators.length > 0) {
        result = _core.types.arrayExpression(node.decorators.map((decorator) => decorator.expression));
      }
      node.decorators = void 0;
      return result;
    }
    function getKey(node) {
      if (node.computed) {
        return node.key;
      } else if (_core.types.isIdentifier(node.key)) {
        return _core.types.stringLiteral(node.key.name);
      } else {
        return _core.types.stringLiteral(String(node.key.value));
      }
    }
    function extractElementDescriptor(file, classRef, superRef, path) {
      const isMethod = path.isClassMethod();
      if (path.isPrivate()) {
        throw path.buildCodeFrameError(`Private ${isMethod ? "methods" : "fields"} in decorated classes are not supported yet.`);
      }
      if (path.node.type === "ClassAccessorProperty") {
        throw path.buildCodeFrameError(`Accessor properties are not supported in 2018-09 decorator transform, please specify { "version": "2021-12" } instead.`);
      }
      if (path.node.type === "StaticBlock") {
        throw path.buildCodeFrameError(`Static blocks are not supported in 2018-09 decorator transform, please specify { "version": "2021-12" } instead.`);
      }
      const {
        node,
        scope
      } = path;
      if (!path.isTSDeclareMethod()) {
        new _helperReplaceSupers.default({
          methodPath: path,
          objectRef: classRef,
          superRef,
          file,
          refToPreserve: classRef
        }).replace();
      }
      const properties = [prop("kind", _core.types.stringLiteral(_core.types.isClassMethod(node) ? node.kind : "field")), prop("decorators", takeDecorators(node)), prop("static", node.static && _core.types.booleanLiteral(true)), prop("key", getKey(node))].filter(Boolean);
      if (isMethod) {
        var _path$ensureFunctionN;
        (_path$ensureFunctionN = path.ensureFunctionName) != null ? _path$ensureFunctionN : path.ensureFunctionName = require_lib9().NodePath.prototype.ensureFunctionName;
        path.ensureFunctionName(false);
        properties.push(prop("value", _core.types.toExpression(path.node)));
      } else if (_core.types.isClassProperty(node) && node.value) {
        properties.push(method("value", _core.template.statements.ast`return ${node.value}`));
      } else {
        properties.push(prop("value", scope.buildUndefinedNode()));
      }
      path.remove();
      return _core.types.objectExpression(properties);
    }
    function addDecorateHelper(file) {
      return file.addHelper("decorate");
    }
    function buildDecoratedClass(ref, path, elements, file) {
      const {
        node,
        scope
      } = path;
      const initializeId = scope.generateUidIdentifier("initialize");
      const isDeclaration = node.id && path.isDeclaration();
      const isStrict = path.isInStrictMode();
      const {
        superClass
      } = node;
      node.type = "ClassDeclaration";
      if (!node.id) node.id = _core.types.cloneNode(ref);
      let superId;
      if (superClass) {
        superId = scope.generateUidIdentifierBasedOnNode(node.superClass, "super");
        node.superClass = superId;
      }
      const classDecorators = takeDecorators(node);
      const definitions = _core.types.arrayExpression(elements.filter((element) => !element.node.abstract && element.node.type !== "TSIndexSignature").map((path2) => extractElementDescriptor(file, node.id, superId, path2)));
      const wrapperCall = _core.template.expression.ast`
    ${addDecorateHelper(file)}(
      ${classDecorators || _core.types.nullLiteral()},
      function (${initializeId}, ${superClass ? _core.types.cloneNode(superId) : null}) {
        ${node}
        return { F: ${_core.types.cloneNode(node.id)}, d: ${definitions} };
      },
      ${superClass}
    )
  `;
      if (!isStrict) {
        wrapperCall.arguments[1].body.directives.push(_core.types.directive(_core.types.directiveLiteral("use strict")));
      }
      let replacement = wrapperCall;
      let classPathDesc = "arguments.1.body.body.0";
      if (isDeclaration) {
        replacement = _core.template.statement.ast`let ${ref} = ${wrapperCall}`;
        classPathDesc = "declarations.0.init." + classPathDesc;
      }
      return {
        instanceNodes: [_core.template.statement.ast`
        ${_core.types.cloneNode(initializeId)}(this)
      `],
        wrapClass(path2) {
          path2.replaceWith(replacement);
          return path2.get(classPathDesc);
        }
      };
    }
  }
});

// node_modules/@babel/helper-create-class-features-plugin/lib/features.js
var require_features = __commonJS({
  "node_modules/@babel/helper-create-class-features-plugin/lib/features.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.FEATURES = void 0;
    exports2.enableFeature = enableFeature;
    exports2.isLoose = isLoose;
    exports2.shouldTransform = shouldTransform;
    var _decorators = require_decorators();
    var FEATURES = exports2.FEATURES = Object.freeze({
      fields: 1 << 1,
      privateMethods: 1 << 2,
      decorators: 1 << 3,
      privateIn: 1 << 4,
      staticBlocks: 1 << 5
    });
    var featuresSameLoose = /* @__PURE__ */ new Map([[FEATURES.fields, "@babel/plugin-transform-class-properties"], [FEATURES.privateMethods, "@babel/plugin-transform-private-methods"], [FEATURES.privateIn, "@babel/plugin-transform-private-property-in-object"]]);
    var featuresKey = "@babel/plugin-class-features/featuresKey";
    var looseKey = "@babel/plugin-class-features/looseKey";
    var looseLowPriorityKey = "@babel/plugin-class-features/looseLowPriorityKey/#__internal__@babel/preset-env__please-overwrite-loose-instead-of-throwing";
    var canIgnoreLoose = function(file, feature) {
      return !!(file.get(looseLowPriorityKey) & feature);
    };
    function enableFeature(file, feature, loose) {
      if (!hasFeature(file, feature) || canIgnoreLoose(file, feature)) {
        file.set(featuresKey, file.get(featuresKey) | feature);
        if (loose === "#__internal__@babel/preset-env__prefer-true-but-false-is-ok-if-it-prevents-an-error") {
          setLoose(file, feature, true);
          file.set(looseLowPriorityKey, file.get(looseLowPriorityKey) | feature);
        } else if (loose === "#__internal__@babel/preset-env__prefer-false-but-true-is-ok-if-it-prevents-an-error") {
          setLoose(file, feature, false);
          file.set(looseLowPriorityKey, file.get(looseLowPriorityKey) | feature);
        } else {
          setLoose(file, feature, loose);
        }
      }
      let resolvedLoose;
      for (const [mask, name] of featuresSameLoose) {
        if (!hasFeature(file, mask)) continue;
        if (canIgnoreLoose(file, mask)) continue;
        const loose2 = isLoose(file, mask);
        if (resolvedLoose === !loose2) {
          throw new Error("'loose' mode configuration must be the same for @babel/plugin-transform-class-properties, @babel/plugin-transform-private-methods and @babel/plugin-transform-private-property-in-object (when they are enabled).\n\n" + getBabelShowConfigForHint(file));
        } else {
          resolvedLoose = loose2;
          var higherPriorityPluginName = name;
        }
      }
      if (resolvedLoose !== void 0) {
        for (const [mask, name] of featuresSameLoose) {
          if (hasFeature(file, mask) && isLoose(file, mask) !== resolvedLoose) {
            setLoose(file, mask, resolvedLoose);
            console.warn(`Though the "loose" option was set to "${!resolvedLoose}" in your @babel/preset-env config, it will not be used for ${name} since the "loose" mode option was set to "${resolvedLoose}" for ${higherPriorityPluginName}.
The "loose" option must be the same for @babel/plugin-transform-class-properties, @babel/plugin-transform-private-methods and @babel/plugin-transform-private-property-in-object (when they are enabled): you can silence this warning by explicitly adding
	["${name}", { "loose": ${resolvedLoose} }]
to the "plugins" section of your Babel config.

` + getBabelShowConfigForHint(file));
          }
        }
      }
    }
    function getBabelShowConfigForHint(file) {
      let {
        filename
      } = file.opts;
      if (!filename || filename === "unknown") {
        filename = "[name of the input file]";
      }
      return `If you already set the same 'loose' mode for these plugins in your config, it's possible that they are enabled multiple times with different options.
You can re-run Babel with the BABEL_SHOW_CONFIG_FOR environment variable to show the loaded configuration:
	npx cross-env BABEL_SHOW_CONFIG_FOR=${filename} <your build command>
See https://babeljs.io/docs/configuration#print-effective-configs for more info.`;
    }
    function hasFeature(file, feature) {
      return !!(file.get(featuresKey) & feature);
    }
    function isLoose(file, feature) {
      return !!(file.get(looseKey) & feature);
    }
    function setLoose(file, feature, loose) {
      if (loose) file.set(looseKey, file.get(looseKey) | feature);
      else file.set(looseKey, file.get(looseKey) & ~feature);
      file.set(looseLowPriorityKey, file.get(looseLowPriorityKey) & ~feature);
    }
    function shouldTransform(path, file) {
      let decoratorPath = null;
      let publicFieldPath = null;
      let privateFieldPath = null;
      let privateMethodPath = null;
      let staticBlockPath = null;
      if ((0, _decorators.hasOwnDecorators)(path.node)) {
        decoratorPath = path.get("decorators.0");
      }
      for (const el of path.get("body.body")) {
        if (!decoratorPath && (0, _decorators.hasOwnDecorators)(el.node)) {
          decoratorPath = el.get("decorators.0");
        }
        if (!publicFieldPath && el.isClassProperty()) {
          publicFieldPath = el;
        }
        if (!privateFieldPath && el.isClassPrivateProperty()) {
          privateFieldPath = el;
        }
        if (!privateMethodPath && el.isClassPrivateMethod != null && el.isClassPrivateMethod()) {
          privateMethodPath = el;
        }
        if (!staticBlockPath && el.isStaticBlock != null && el.isStaticBlock()) {
          staticBlockPath = el;
        }
      }
      if (decoratorPath && privateFieldPath) {
        throw privateFieldPath.buildCodeFrameError("Private fields in decorated classes are not supported yet.");
      }
      if (decoratorPath && privateMethodPath) {
        throw privateMethodPath.buildCodeFrameError("Private methods in decorated classes are not supported yet.");
      }
      if (decoratorPath && !hasFeature(file, FEATURES.decorators)) {
        throw path.buildCodeFrameError('Decorators are not enabled.\nIf you are using ["@babel/plugin-proposal-decorators", { "version": "legacy" }], make sure it comes *before* "@babel/plugin-transform-class-properties" and enable loose mode, like so:\n	["@babel/plugin-proposal-decorators", { "version": "legacy" }]\n	["@babel/plugin-transform-class-properties", { "loose": true }]');
      }
      if (privateMethodPath && !hasFeature(file, FEATURES.privateMethods)) {
        throw privateMethodPath.buildCodeFrameError("Class private methods are not enabled. Please add `@babel/plugin-transform-private-methods` to your configuration.");
      }
      if ((publicFieldPath || privateFieldPath) && !hasFeature(file, FEATURES.fields) && !hasFeature(file, FEATURES.privateMethods)) {
        throw path.buildCodeFrameError("Class fields are not enabled. Please add `@babel/plugin-transform-class-properties` to your configuration.");
      }
      if (staticBlockPath && !hasFeature(file, FEATURES.staticBlocks)) {
        throw path.buildCodeFrameError("Static class blocks are not enabled. Please add `@babel/plugin-transform-class-static-block` to your configuration.");
      }
      if (decoratorPath || privateMethodPath || staticBlockPath) {
        return true;
      }
      if ((publicFieldPath || privateFieldPath) && hasFeature(file, FEATURES.fields)) {
        return true;
      }
      return false;
    }
  }
});

// node_modules/@babel/helper-create-class-features-plugin/lib/index.js
var require_lib22 = __commonJS({
  "node_modules/@babel/helper-create-class-features-plugin/lib/index.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    Object.defineProperty(exports2, "FEATURES", {
      enumerable: true,
      get: function() {
        return _features.FEATURES;
      }
    });
    Object.defineProperty(exports2, "buildCheckInRHS", {
      enumerable: true,
      get: function() {
        return _fields.buildCheckInRHS;
      }
    });
    Object.defineProperty(exports2, "buildNamedEvaluationVisitor", {
      enumerable: true,
      get: function() {
        return _decorators.buildNamedEvaluationVisitor;
      }
    });
    exports2.createClassFeaturePlugin = createClassFeaturePlugin;
    Object.defineProperty(exports2, "enableFeature", {
      enumerable: true,
      get: function() {
        return _features.enableFeature;
      }
    });
    Object.defineProperty(exports2, "injectInitialization", {
      enumerable: true,
      get: function() {
        return _misc.injectInitialization;
      }
    });
    var _core = require_lib27();
    var _semver = require_semver3();
    var _fields = require_fields();
    var _decorators = require_decorators();
    var _decorators2 = require_decorators_2018_09();
    var _misc = require_misc2();
    var _features = require_features();
    var _typescript = require_typescript3();
    var versionKey = "@babel/plugin-class-features/version";
    function createClassFeaturePlugin({
      name,
      feature,
      loose,
      manipulateOptions,
      api,
      inherits,
      decoratorVersion
    }) {
      var _api$assumption;
      if (feature & _features.FEATURES.decorators) {
        if (decoratorVersion === "2023-11" || decoratorVersion === "2023-05" || decoratorVersion === "2023-01" || decoratorVersion === "2022-03" || decoratorVersion === "2021-12") {
          return (0, _decorators.default)(api, {
            loose
          }, decoratorVersion, inherits);
        }
      }
      api != null ? api : api = {
        assumption: () => void 0
      };
      const setPublicClassFields = api.assumption("setPublicClassFields");
      const privateFieldsAsSymbols = api.assumption("privateFieldsAsSymbols");
      const privateFieldsAsProperties = api.assumption("privateFieldsAsProperties");
      const noUninitializedPrivateFieldAccess = (_api$assumption = api.assumption("noUninitializedPrivateFieldAccess")) != null ? _api$assumption : false;
      const constantSuper = api.assumption("constantSuper");
      const noDocumentAll = api.assumption("noDocumentAll");
      if (privateFieldsAsProperties && privateFieldsAsSymbols) {
        throw new Error(`Cannot enable both the "privateFieldsAsProperties" and "privateFieldsAsSymbols" assumptions as the same time.`);
      }
      const privateFieldsAsSymbolsOrProperties = privateFieldsAsProperties || privateFieldsAsSymbols;
      if (loose === true) {
        const explicit = [];
        if (setPublicClassFields !== void 0) {
          explicit.push(`"setPublicClassFields"`);
        }
        if (privateFieldsAsProperties !== void 0) {
          explicit.push(`"privateFieldsAsProperties"`);
        }
        if (privateFieldsAsSymbols !== void 0) {
          explicit.push(`"privateFieldsAsSymbols"`);
        }
        if (explicit.length !== 0) {
          console.warn(`[${name}]: You are using the "loose: true" option and you are explicitly setting a value for the ${explicit.join(" and ")} assumption${explicit.length > 1 ? "s" : ""}. The "loose" option can cause incompatibilities with the other class features plugins, so it's recommended that you replace it with the following top-level option:
	"assumptions": {
		"setPublicClassFields": true,
		"privateFieldsAsSymbols": true
	}`);
        }
      }
      return {
        name,
        manipulateOptions,
        inherits,
        pre(file) {
          (0, _features.enableFeature)(file, feature, loose);
          if (typeof file.get(versionKey) === "number") {
            file.set(versionKey, "7.28.6");
            return;
          }
          if (!file.get(versionKey) || _semver.lt(file.get(versionKey), "7.28.6")) {
            file.set(versionKey, "7.28.6");
          }
        },
        visitor: {
          Class(path, {
            file
          }) {
            if (file.get(versionKey) !== "7.28.6") return;
            if (!(0, _features.shouldTransform)(path, file)) return;
            const pathIsClassDeclaration = path.isClassDeclaration();
            if (pathIsClassDeclaration) (0, _typescript.assertFieldTransformed)(path);
            const loose2 = (0, _features.isLoose)(file, feature);
            let constructor;
            const isDecorated = (0, _decorators.hasDecorators)(path.node);
            const props = [];
            const elements = [];
            const computedPaths = [];
            const privateNames = /* @__PURE__ */ new Set();
            const body = path.get("body");
            for (const path2 of body.get("body")) {
              if ((path2.isClassProperty() || path2.isClassMethod()) && path2.node.computed) {
                computedPaths.push(path2);
              }
              if (path2.isPrivate()) {
                const {
                  name: name2
                } = path2.node.key.id;
                const getName = `get ${name2}`;
                const setName = `set ${name2}`;
                if (path2.isClassPrivateMethod()) {
                  if (path2.node.kind === "get") {
                    if (privateNames.has(getName) || privateNames.has(name2) && !privateNames.has(setName)) {
                      throw path2.buildCodeFrameError("Duplicate private field");
                    }
                    privateNames.add(getName).add(name2);
                  } else if (path2.node.kind === "set") {
                    if (privateNames.has(setName) || privateNames.has(name2) && !privateNames.has(getName)) {
                      throw path2.buildCodeFrameError("Duplicate private field");
                    }
                    privateNames.add(setName).add(name2);
                  }
                } else {
                  if (privateNames.has(name2) && !privateNames.has(getName) && !privateNames.has(setName) || privateNames.has(name2) && (privateNames.has(getName) || privateNames.has(setName))) {
                    throw path2.buildCodeFrameError("Duplicate private field");
                  }
                  privateNames.add(name2);
                }
              }
              if (path2.isClassMethod({
                kind: "constructor"
              })) {
                constructor = path2;
              } else {
                elements.push(path2);
                if (path2.isProperty() || path2.isPrivate() || path2.isStaticBlock != null && path2.isStaticBlock()) {
                  props.push(path2);
                }
              }
            }
            if (!props.length && !isDecorated) return;
            const innerBinding = path.node.id;
            let ref;
            if (!innerBinding || !pathIsClassDeclaration) {
              var _path$ensureFunctionN;
              (_path$ensureFunctionN = path.ensureFunctionName) != null ? _path$ensureFunctionN : path.ensureFunctionName = require_lib9().NodePath.prototype.ensureFunctionName;
              path.ensureFunctionName(false);
              ref = path.scope.generateUidIdentifier((innerBinding == null ? void 0 : innerBinding.name) || "Class");
            }
            const classRefForDefine = ref != null ? ref : _core.types.cloneNode(innerBinding);
            const privateNamesMap = (0, _fields.buildPrivateNamesMap)(classRefForDefine.name, privateFieldsAsSymbolsOrProperties != null ? privateFieldsAsSymbolsOrProperties : loose2, props, file);
            const privateNamesNodes = (0, _fields.buildPrivateNamesNodes)(privateNamesMap, privateFieldsAsProperties != null ? privateFieldsAsProperties : loose2, privateFieldsAsSymbols != null ? privateFieldsAsSymbols : false, file);
            (0, _fields.transformPrivateNamesUsage)(classRefForDefine, path, privateNamesMap, {
              privateFieldsAsProperties: privateFieldsAsSymbolsOrProperties != null ? privateFieldsAsSymbolsOrProperties : loose2,
              noUninitializedPrivateFieldAccess,
              noDocumentAll,
              innerBinding
            }, file);
            let keysNodes, staticNodes, instanceNodes, lastInstanceNodeReturnsThis, pureStaticNodes, classBindingNode, wrapClass;
            if (isDecorated) {
              staticNodes = pureStaticNodes = keysNodes = [];
              ({
                instanceNodes,
                wrapClass
              } = (0, _decorators2.buildDecoratedClass)(classRefForDefine, path, elements, file));
            } else {
              keysNodes = (0, _misc.extractComputedKeys)(path, computedPaths, file);
              ({
                staticNodes,
                pureStaticNodes,
                instanceNodes,
                lastInstanceNodeReturnsThis,
                classBindingNode,
                wrapClass
              } = (0, _fields.buildFieldsInitNodes)(ref, path.node.superClass, props, privateNamesMap, file, setPublicClassFields != null ? setPublicClassFields : loose2, privateFieldsAsSymbolsOrProperties != null ? privateFieldsAsSymbolsOrProperties : loose2, noUninitializedPrivateFieldAccess, constantSuper != null ? constantSuper : loose2, innerBinding));
            }
            if (instanceNodes.length > 0) {
              (0, _misc.injectInitialization)(path, constructor, instanceNodes, (referenceVisitor, state) => {
                if (isDecorated) return;
                for (const prop of props) {
                  if (_core.types.isStaticBlock != null && _core.types.isStaticBlock(prop.node) || prop.node.static) continue;
                  prop.traverse(referenceVisitor, state);
                }
              }, lastInstanceNodeReturnsThis);
            }
            const wrappedPath = wrapClass(path);
            wrappedPath.insertBefore([...privateNamesNodes, ...keysNodes]);
            if (staticNodes.length > 0) {
              wrappedPath.insertAfter(staticNodes);
            }
            if (pureStaticNodes.length > 0) {
              wrappedPath.find((parent) => parent.isStatement() || parent.isDeclaration()).insertAfter(pureStaticNodes);
            }
            if (classBindingNode != null && pathIsClassDeclaration) {
              wrappedPath.insertAfter(classBindingNode);
            }
          },
          ExportDefaultDeclaration(path, {
            file
          }) {
            if (file.get(versionKey) !== "7.28.6") return;
            const decl = path.get("declaration");
            if (decl.isClassDeclaration() && (0, _decorators.hasDecorators)(decl.node)) {
              if (decl.node.id) {
                var _path$splitExportDecl;
                (_path$splitExportDecl = path.splitExportDeclaration) != null ? _path$splitExportDecl : path.splitExportDeclaration = require_lib9().NodePath.prototype.splitExportDeclaration;
                path.splitExportDeclaration();
              } else {
                decl.node.type = "ClassExpression";
              }
            }
          }
        }
      };
    }
  }
});

// node_modules/@babel/plugin-transform-typescript/lib/enum.js
var require_enum = __commonJS({
  "node_modules/@babel/plugin-transform-typescript/lib/enum.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = transpileEnum;
    exports2.isSyntacticallyString = isSyntacticallyString;
    exports2.translateEnumValues = translateEnumValues;
    var _core = require_lib27();
    var _assert = require("assert");
    var _helperAnnotateAsPure = require_lib20();
    var _helperSkipTransparentExpressionWrappers = require_lib21();
    var ENUMS = /* @__PURE__ */ new WeakMap();
    var buildEnumWrapper = _core.template.expression(`
    (function (ID) {
      ASSIGNMENTS;
      return ID;
    })(INIT)
  `);
    function transpileEnum(path, t) {
      const {
        node,
        parentPath
      } = path;
      if (node.declare) {
        path.remove();
        return;
      }
      const name = node.id.name;
      const {
        fill,
        data,
        isPure
      } = enumFill(path, t, node.id);
      switch (parentPath.type) {
        case "BlockStatement":
        case "ExportNamedDeclaration":
        case "Program": {
          const isGlobal = t.isProgram(path.parent);
          const isSeen = seen(parentPath);
          let init = t.objectExpression([]);
          if (isSeen || isGlobal) {
            init = t.logicalExpression("||", t.cloneNode(fill.ID), init);
          }
          const enumIIFE = buildEnumWrapper(Object.assign({}, fill, {
            INIT: init
          }));
          if (isPure) (0, _helperAnnotateAsPure.default)(enumIIFE);
          if (isSeen) {
            const toReplace = parentPath.isExportDeclaration() ? parentPath : path;
            toReplace.replaceWith(t.expressionStatement(t.assignmentExpression("=", t.cloneNode(node.id), enumIIFE)));
          } else {
            path.scope.registerDeclaration(path.replaceWith(t.variableDeclaration(isGlobal ? "var" : "let", [t.variableDeclarator(node.id, enumIIFE)]))[0]);
          }
          ENUMS.set(path.scope.getBindingIdentifier(name), data);
          break;
        }
        default:
          throw new Error(`Unexpected enum parent '${path.parent.type}`);
      }
      function seen(parentPath2) {
        if (parentPath2.isExportDeclaration()) {
          return seen(parentPath2.parentPath);
        }
        if (parentPath2.getData(name)) {
          return true;
        } else {
          parentPath2.setData(name, true);
          return false;
        }
      }
    }
    var buildStringAssignment = _core.template.statement(`
  ENUM["NAME"] = VALUE;
`);
    var buildNumericAssignment = _core.template.statement(`
  ENUM[ENUM["NAME"] = VALUE] = "NAME";
`);
    var buildEnumMember = (isString, options) => (isString ? buildStringAssignment : buildNumericAssignment)(options);
    function enumFill(path, t, id) {
      const {
        enumValues,
        data,
        isPure
      } = translateEnumValues(path, t);
      const enumMembers = path.get("members");
      const assignments = [];
      for (let i = 0; i < enumMembers.length; i++) {
        const [memberName, memberValue] = enumValues[i];
        assignments.push(t.inheritsComments(buildEnumMember(isSyntacticallyString(memberValue), {
          ENUM: t.cloneNode(id),
          NAME: memberName,
          VALUE: memberValue
        }), enumMembers[i].node));
      }
      return {
        fill: {
          ID: t.cloneNode(id),
          ASSIGNMENTS: assignments
        },
        data,
        isPure
      };
    }
    function isSyntacticallyString(expr) {
      expr = (0, _helperSkipTransparentExpressionWrappers.skipTransparentExprWrapperNodes)(expr);
      switch (expr.type) {
        case "BinaryExpression": {
          const left = expr.left;
          const right = expr.right;
          return expr.operator === "+" && (isSyntacticallyString(left) || isSyntacticallyString(right));
        }
        case "TemplateLiteral":
        case "StringLiteral":
          return true;
      }
      return false;
    }
    function ReferencedIdentifier(expr, state) {
      const {
        seen,
        path,
        t
      } = state;
      const name = expr.node.name;
      if (seen.has(name)) {
        for (let curScope = expr.scope; curScope !== path.scope; curScope = curScope.parent) {
          if (curScope.hasOwnBinding(name)) {
            return;
          }
        }
        expr.replaceWith(t.memberExpression(t.cloneNode(path.node.id), t.cloneNode(expr.node)));
        expr.skip();
      }
    }
    var enumSelfReferenceVisitor = {
      ReferencedIdentifier
    };
    function translateEnumValues(path, t) {
      var _ENUMS$get;
      const bindingIdentifier = path.scope.getBindingIdentifier(path.node.id.name);
      const seen = (_ENUMS$get = ENUMS.get(bindingIdentifier)) != null ? _ENUMS$get : /* @__PURE__ */ new Map();
      let constValue = -1;
      let lastName;
      let isPure = true;
      const enumMembers = path.get("members");
      const enumValues = enumMembers.map((memberPath) => {
        const member = memberPath.node;
        const name = t.isIdentifier(member.id) ? member.id.name : member.id.value;
        const initializerPath = memberPath.get("initializer");
        const initializer = member.initializer;
        let value2;
        if (initializer) {
          constValue = computeConstantValue(initializerPath, seen);
          if (constValue !== void 0) {
            seen.set(name, constValue);
            _assert(typeof constValue === "number" || typeof constValue === "string");
            if (constValue === Infinity || Number.isNaN(constValue)) {
              value2 = t.identifier(String(constValue));
            } else if (constValue === -Infinity) {
              value2 = t.unaryExpression("-", t.identifier("Infinity"));
            } else {
              value2 = t.valueToNode(constValue);
            }
          } else {
            isPure && (isPure = initializerPath.isPure());
            if (initializerPath.isReferencedIdentifier()) {
              ReferencedIdentifier(initializerPath, {
                t,
                seen,
                path
              });
            } else {
              initializerPath.traverse(enumSelfReferenceVisitor, {
                t,
                seen,
                path
              });
            }
            value2 = initializerPath.node;
            seen.set(name, void 0);
          }
        } else if (typeof constValue === "number") {
          constValue += 1;
          value2 = t.numericLiteral(constValue);
          seen.set(name, constValue);
        } else if (typeof constValue === "string") {
          throw path.buildCodeFrameError("Enum member must have initializer.");
        } else {
          const lastRef = t.memberExpression(t.cloneNode(path.node.id), t.stringLiteral(lastName), true);
          value2 = t.binaryExpression("+", t.numericLiteral(1), lastRef);
          seen.set(name, void 0);
        }
        lastName = name;
        return [name, value2];
      });
      return {
        isPure,
        data: seen,
        enumValues
      };
    }
    function computeConstantValue(path, prevMembers, seen = /* @__PURE__ */ new Set()) {
      return evaluate(path);
      function evaluate(path2) {
        const expr = path2.node;
        switch (expr.type) {
          case "MemberExpression":
            return evaluateRef(path2, prevMembers, seen);
          case "StringLiteral":
            return expr.value;
          case "UnaryExpression":
            return evalUnaryExpression(path2);
          case "BinaryExpression":
            return evalBinaryExpression(path2);
          case "NumericLiteral":
            return expr.value;
          case "ParenthesizedExpression":
            return evaluate(path2.get("expression"));
          case "Identifier":
            return evaluateRef(path2, prevMembers, seen);
          case "TemplateLiteral": {
            if (expr.quasis.length === 1) {
              return expr.quasis[0].value.cooked;
            }
            const paths = path2.get("expressions");
            const quasis = expr.quasis;
            let str = "";
            for (let i = 0; i < quasis.length; i++) {
              str += quasis[i].value.cooked;
              if (i + 1 < quasis.length) {
                const value2 = evaluateRef(paths[i], prevMembers, seen);
                if (value2 === void 0) return void 0;
                str += value2;
              }
            }
            return str;
          }
          default:
            return void 0;
        }
      }
      function evaluateRef(path2, prevMembers2, seen2) {
        if (path2.isMemberExpression()) {
          const expr = path2.node;
          const obj = expr.object;
          const prop = expr.property;
          if (!_core.types.isIdentifier(obj) || (expr.computed ? !_core.types.isStringLiteral(prop) : !_core.types.isIdentifier(prop))) {
            return;
          }
          const bindingIdentifier = path2.scope.getBindingIdentifier(obj.name);
          const data = ENUMS.get(bindingIdentifier);
          if (!data) return;
          return data.get(prop.computed ? prop.value : prop.name);
        } else if (path2.isIdentifier()) {
          const name = path2.node.name;
          if (["Infinity", "NaN"].includes(name)) {
            return Number(name);
          }
          let value2 = prevMembers2 == null ? void 0 : prevMembers2.get(name);
          if (value2 !== void 0) {
            return value2;
          }
          if (prevMembers2 != null && prevMembers2.has(name)) {
            return void 0;
          }
          if (seen2.has(path2.node)) return;
          seen2.add(path2.node);
          value2 = computeConstantValue(path2.resolve(), prevMembers2, seen2);
          return value2;
        }
      }
      function evalUnaryExpression(path2) {
        const value2 = evaluate(path2.get("argument"));
        if (value2 === void 0) {
          return void 0;
        }
        switch (path2.node.operator) {
          case "+":
            return value2;
          case "-":
            return -value2;
          case "~":
            return ~value2;
          default:
            return void 0;
        }
      }
      function evalBinaryExpression(path2) {
        const left = evaluate(path2.get("left"));
        if (left === void 0) {
          return void 0;
        }
        const right = evaluate(path2.get("right"));
        if (right === void 0) {
          return void 0;
        }
        switch (path2.node.operator) {
          case "|":
            return left | right;
          case "&":
            return left & right;
          case ">>":
            return left >> right;
          case ">>>":
            return left >>> right;
          case "<<":
            return left << right;
          case "^":
            return left ^ right;
          case "*":
            return left * right;
          case "/":
            return left / right;
          case "+":
            return left + right;
          case "-":
            return left - right;
          case "%":
            return left % right;
          case "**":
            return Math.pow(left, right);
          default:
            return void 0;
        }
      }
    }
  }
});

// node_modules/@babel/plugin-transform-typescript/lib/const-enum.js
var require_const_enum = __commonJS({
  "node_modules/@babel/plugin-transform-typescript/lib/const-enum.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.EXPORTED_CONST_ENUMS_IN_NAMESPACE = void 0;
    exports2.default = transpileConstEnum;
    var _enum = require_enum();
    var EXPORTED_CONST_ENUMS_IN_NAMESPACE = exports2.EXPORTED_CONST_ENUMS_IN_NAMESPACE = /* @__PURE__ */ new WeakSet();
    function transpileConstEnum(path, t) {
      const {
        name
      } = path.node.id;
      const parentIsExport = path.parentPath.isExportNamedDeclaration();
      let isExported = parentIsExport;
      if (!isExported && t.isProgram(path.parent)) {
        isExported = path.parent.body.some((stmt) => t.isExportNamedDeclaration(stmt) && stmt.exportKind !== "type" && !stmt.source && stmt.specifiers.some((spec) => t.isExportSpecifier(spec) && spec.exportKind !== "type" && spec.local.name === name));
      }
      const {
        enumValues: entries
      } = (0, _enum.translateEnumValues)(path, t);
      if (isExported || EXPORTED_CONST_ENUMS_IN_NAMESPACE.has(path.node)) {
        const obj = t.objectExpression(entries.map(([name2, value2]) => t.objectProperty(t.isValidIdentifier(name2) ? t.identifier(name2) : t.stringLiteral(name2), value2)));
        if (path.scope.hasOwnBinding(name)) {
          (parentIsExport ? path.parentPath : path).replaceWith(t.expressionStatement(t.callExpression(t.memberExpression(t.identifier("Object"), t.identifier("assign")), [path.node.id, obj])));
        } else {
          path.replaceWith(t.variableDeclaration("var", [t.variableDeclarator(path.node.id, obj)]));
          path.scope.registerDeclaration(path);
        }
        return;
      }
      const entriesMap = new Map(entries);
      path.scope.path.traverse({
        Scope(path2) {
          if (path2.scope.hasOwnBinding(name)) path2.skip();
        },
        MemberExpression(path2) {
          if (!t.isIdentifier(path2.node.object, {
            name
          })) return;
          let key;
          if (path2.node.computed) {
            if (t.isStringLiteral(path2.node.property)) {
              key = path2.node.property.value;
            } else {
              return;
            }
          } else if (t.isIdentifier(path2.node.property)) {
            key = path2.node.property.name;
          } else {
            return;
          }
          if (!entriesMap.has(key)) return;
          path2.replaceWith(t.cloneNode(entriesMap.get(key)));
        }
      });
      path.remove();
    }
  }
});

// node_modules/@babel/plugin-transform-typescript/lib/global-types.js
var require_global_types = __commonJS({
  "node_modules/@babel/plugin-transform-typescript/lib/global-types.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.GLOBAL_TYPES = void 0;
    exports2.isGlobalType = isGlobalType;
    exports2.registerGlobalType = registerGlobalType;
    var GLOBAL_TYPES = exports2.GLOBAL_TYPES = /* @__PURE__ */ new WeakMap();
    function isGlobalType({
      scope
    }, name) {
      if (scope.hasBinding(name)) return false;
      if (GLOBAL_TYPES.get(scope).has(name)) return true;
      console.warn(`The exported identifier "${name}" is not declared in Babel's scope tracker
as a JavaScript value binding, and "@babel/plugin-transform-typescript"
never encountered it as a TypeScript type declaration.
It will be treated as a JavaScript value.

This problem is likely caused by another plugin injecting
"${name}" without registering it in the scope tracker. If you are the author
 of that plugin, please use "scope.registerDeclaration(declarationPath)".`);
      return false;
    }
    function registerGlobalType(programScope, name) {
      GLOBAL_TYPES.get(programScope).add(name);
    }
  }
});

// node_modules/@babel/plugin-transform-typescript/lib/namespace.js
var require_namespace = __commonJS({
  "node_modules/@babel/plugin-transform-typescript/lib/namespace.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = transpileNamespace;
    exports2.getFirstIdentifier = getFirstIdentifier;
    var _core = require_lib27();
    var _globalTypes = require_global_types();
    var _constEnum = require_const_enum();
    function getFirstIdentifier(node) {
      if (_core.types.isIdentifier(node)) {
        return node;
      }
      return getFirstIdentifier(node.left);
    }
    function transpileNamespace(path, allowNamespaces) {
      if (path.node.declare || path.node.id.type === "StringLiteral") {
        path.remove();
        return;
      }
      if (!allowNamespaces) {
        throw path.get("id").buildCodeFrameError("Namespace not marked type-only declare. Non-declarative namespaces are only supported experimentally in Babel. To enable and review caveats see: https://babeljs.io/docs/en/babel-plugin-transform-typescript");
      }
      const name = getFirstIdentifier(path.node.id).name;
      const value2 = handleNested(path, path.node);
      if (value2 === null) {
        const program = path.findParent((p) => p.isProgram());
        (0, _globalTypes.registerGlobalType)(program.scope, name);
        path.remove();
      } else if (path.scope.hasOwnBinding(name)) {
        path.replaceWith(value2);
      } else {
        path.scope.registerDeclaration(path.replaceWithMultiple([getDeclaration(name), value2])[0]);
      }
    }
    function getDeclaration(name) {
      return _core.types.variableDeclaration("let", [_core.types.variableDeclarator(_core.types.identifier(name))]);
    }
    function getMemberExpression(name, itemName) {
      return _core.types.memberExpression(_core.types.identifier(name), _core.types.identifier(itemName));
    }
    function handleVariableDeclaration(node, name, hub) {
      if (node.kind !== "const") {
        throw hub.file.buildCodeFrameError(node, "Namespaces exporting non-const are not supported by Babel. Change to const or see: https://babeljs.io/docs/en/babel-plugin-transform-typescript");
      }
      const {
        declarations
      } = node;
      if (declarations.every((declarator) => _core.types.isIdentifier(declarator.id))) {
        for (const declarator of declarations) {
          declarator.init = _core.types.assignmentExpression("=", getMemberExpression(name, declarator.id.name), declarator.init);
        }
        return [node];
      }
      const bindingIdentifiers = _core.types.getBindingIdentifiers(node);
      const assignments = [];
      for (const idName in bindingIdentifiers) {
        assignments.push(_core.types.assignmentExpression("=", getMemberExpression(name, idName), _core.types.cloneNode(bindingIdentifiers[idName])));
      }
      return [node, _core.types.expressionStatement(_core.types.sequenceExpression(assignments))];
    }
    function buildNestedAmbientModuleError(path, node) {
      return path.hub.buildError(node, "Ambient modules cannot be nested in other modules or namespaces.", Error);
    }
    function handleNested(path, node, parentExport) {
      const names = /* @__PURE__ */ new Set();
      const realName = node.id;
      const name = path.scope.generateUid(realName.name);
      const body = node.body;
      let id = node.id;
      let namespaceTopLevel;
      namespaceTopLevel = _core.types.isTSModuleBlock(body) ? body.body : [_core.types.exportNamedDeclaration(body)];
      let isEmpty = true;
      for (let i = 0; i < namespaceTopLevel.length; i++) {
        const subNode = namespaceTopLevel[i];
        switch (subNode.type) {
          case "TSModuleDeclaration": {
            if (!_core.types.isIdentifier(subNode.id)) {
              throw buildNestedAmbientModuleError(path, subNode);
            }
            const transformed = handleNested(path, subNode);
            if (transformed !== null) {
              isEmpty = false;
              const moduleName = subNode.id.name;
              if (names.has(moduleName)) {
                namespaceTopLevel[i] = transformed;
              } else {
                names.add(moduleName);
                namespaceTopLevel.splice(i++, 1, getDeclaration(moduleName), transformed);
              }
            }
            continue;
          }
          case "TSEnumDeclaration":
          case "FunctionDeclaration":
          case "ClassDeclaration":
            isEmpty = false;
            names.add(subNode.id.name);
            continue;
          case "VariableDeclaration": {
            isEmpty = false;
            for (const name2 in _core.types.getBindingIdentifiers(subNode)) {
              names.add(name2);
            }
            continue;
          }
          default:
            isEmpty && (isEmpty = _core.types.isTypeScript(subNode));
            continue;
          case "ExportNamedDeclaration":
        }
        if ("declare" in subNode.declaration && subNode.declaration.declare) {
          continue;
        }
        switch (subNode.declaration.type) {
          case "TSEnumDeclaration":
            _constEnum.EXPORTED_CONST_ENUMS_IN_NAMESPACE.add(subNode.declaration);
          case "FunctionDeclaration":
          case "ClassDeclaration": {
            isEmpty = false;
            const itemName = subNode.declaration.id.name;
            names.add(itemName);
            namespaceTopLevel.splice(i++, 1, subNode.declaration, _core.types.expressionStatement(_core.types.assignmentExpression("=", getMemberExpression(name, itemName), _core.types.identifier(itemName))));
            break;
          }
          case "VariableDeclaration": {
            isEmpty = false;
            const nodes = handleVariableDeclaration(subNode.declaration, name, path.hub);
            namespaceTopLevel.splice(i, nodes.length, ...nodes);
            i += nodes.length - 1;
            break;
          }
          case "TSModuleDeclaration": {
            if (!_core.types.isIdentifier(subNode.declaration.id)) {
              throw buildNestedAmbientModuleError(path, subNode.declaration);
            }
            const transformed = handleNested(path, subNode.declaration, _core.types.identifier(name));
            if (transformed !== null) {
              isEmpty = false;
              const moduleName = subNode.declaration.id.name;
              if (names.has(moduleName)) {
                namespaceTopLevel[i] = transformed;
              } else {
                names.add(moduleName);
                namespaceTopLevel.splice(i++, 1, getDeclaration(moduleName), transformed);
              }
            } else {
              namespaceTopLevel.splice(i, 1);
              i--;
            }
          }
        }
      }
      if (isEmpty) return null;
      let fallthroughValue = _core.types.objectExpression([]);
      if (parentExport) {
        const memberExpr = _core.types.memberExpression(parentExport, realName);
        fallthroughValue = _core.template.expression.ast`
      ${_core.types.cloneNode(memberExpr)} ||
        (${_core.types.cloneNode(memberExpr)} = ${fallthroughValue})
    `;
      }
      return _core.template.statement.ast`
    (function (${_core.types.identifier(name)}) {
      ${namespaceTopLevel}
    })(${realName} || (${_core.types.cloneNode(realName)} = ${fallthroughValue}));
  `;
    }
  }
});

// node_modules/@babel/plugin-transform-typescript/lib/index.js
var require_lib23 = __commonJS({
  "node_modules/@babel/plugin-transform-typescript/lib/index.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = void 0;
    var _helperPluginUtils = require_lib15();
    var _pluginSyntaxTypescript = require_lib16();
    var _helperCreateClassFeaturesPlugin = require_lib22();
    var _constEnum = require_const_enum();
    var _enum = require_enum();
    var _globalTypes = require_global_types();
    var _namespace = require_namespace();
    function isInType(path) {
      switch (path.parent.type) {
        case "TSTypeReference":
        case "TSExpressionWithTypeArguments":
        case "TSExpressionWithTypeArguments":
        case "TSTypeQuery":
          return true;
        case "TSQualifiedName":
          return path.parentPath.findParent((path2) => path2.type !== "TSQualifiedName").type !== "TSImportEqualsDeclaration";
        case "ExportSpecifier":
          return path.parent.exportKind === "type" || path.parentPath.parent.exportKind === "type";
        default:
          return false;
      }
    }
    var NEEDS_EXPLICIT_ESM = /* @__PURE__ */ new WeakMap();
    var PARSED_PARAMS = /* @__PURE__ */ new WeakSet();
    function safeRemove(path) {
      const ids = path.getBindingIdentifiers();
      for (const name of Object.keys(ids)) {
        const binding = path.scope.getBinding(name);
        if (binding && binding.identifier === ids[name]) {
          binding.scope.removeBinding(name);
        }
      }
      path.opts.noScope = true;
      path.remove();
      path.opts.noScope = false;
    }
    function assertCjsTransformEnabled(path, pass, wrong, suggestion, extra = "") {
      if (pass.file.get("@babel/plugin-transform-modules-*") !== "commonjs") {
        throw path.buildCodeFrameError(`\`${wrong}\` is only supported when compiling modules to CommonJS.
Please consider using \`${suggestion}\`${extra}, or add @babel/plugin-transform-modules-commonjs to your Babel config.`);
      }
    }
    var _default = exports2.default = (0, _helperPluginUtils.declare)((api, opts) => {
      const {
        types: t,
        template
      } = api;
      api.assertVersion(7);
      const JSX_PRAGMA_REGEX = /\*?\s*@jsx((?:Frag)?)\s+(\S+)/;
      const {
        allowNamespaces = true,
        jsxPragma = "React.createElement",
        jsxPragmaFrag = "React.Fragment",
        onlyRemoveTypeImports = false,
        optimizeConstEnums = false
      } = opts;
      var {
        allowDeclareFields = false
      } = opts;
      const classMemberVisitors = {
        field(path) {
          const {
            node
          } = path;
          if (!allowDeclareFields && node.declare) {
            throw path.buildCodeFrameError(`The 'declare' modifier is only allowed when the 'allowDeclareFields' option of @babel/plugin-transform-typescript or @babel/preset-typescript is enabled.`);
          }
          if (node.declare) {
            if (node.value) {
              throw path.buildCodeFrameError(`Fields with the 'declare' modifier cannot be initialized here, but only in the constructor`);
            }
            if (!node.decorators) {
              path.remove();
            }
          } else if (node.definite) {
            if (node.value) {
              throw path.buildCodeFrameError(`Definitely assigned fields cannot be initialized here, but only in the constructor`);
            }
            if (!allowDeclareFields && !node.decorators && !t.isClassPrivateProperty(node)) {
              path.remove();
            }
          } else if (node.abstract) {
            path.remove();
          } else {
            if (!allowDeclareFields && !node.value && !node.decorators && !t.isClassPrivateProperty(node)) {
              path.remove();
            }
          }
          if (node.accessibility) node.accessibility = null;
          if (node.abstract) node.abstract = null;
          if (node.readonly) node.readonly = null;
          if (node.optional) node.optional = null;
          if (node.typeAnnotation) node.typeAnnotation = null;
          if (node.definite) node.definite = null;
          if (node.declare) node.declare = null;
          if (node.override) node.override = null;
        },
        method({
          node
        }) {
          if (node.accessibility) node.accessibility = null;
          if (node.abstract) node.abstract = null;
          if (node.optional) node.optional = null;
          if (node.override) node.override = null;
        },
        constructor(path, classPath) {
          if (path.node.accessibility) path.node.accessibility = null;
          const assigns = [];
          const {
            scope
          } = path;
          for (const paramPath of path.get("params")) {
            const param = paramPath.node;
            if (param.type === "TSParameterProperty") {
              const parameter = param.parameter;
              if (PARSED_PARAMS.has(parameter)) continue;
              PARSED_PARAMS.add(parameter);
              let id;
              if (t.isIdentifier(parameter)) {
                id = parameter;
              } else if (t.isAssignmentPattern(parameter) && t.isIdentifier(parameter.left)) {
                id = parameter.left;
              } else {
                throw paramPath.buildCodeFrameError("Parameter properties can not be destructuring patterns.");
              }
              assigns.push(template.statement.ast`
              this.${t.cloneNode(id)} = ${t.cloneNode(id)}
            `);
              paramPath.replaceWith(paramPath.get("parameter"));
              scope.registerBinding("param", paramPath);
            }
          }
          (0, _helperCreateClassFeaturesPlugin.injectInitialization)(classPath, path, assigns);
        }
      };
      return {
        name: "transform-typescript",
        inherits: _pluginSyntaxTypescript.default,
        visitor: {
          Pattern: visitPattern,
          Identifier: visitPattern,
          RestElement: visitPattern,
          Program: {
            enter(path, state) {
              const {
                file
              } = state;
              let fileJsxPragma = null;
              let fileJsxPragmaFrag = null;
              const programScope = path.scope;
              if (!_globalTypes.GLOBAL_TYPES.has(programScope)) {
                _globalTypes.GLOBAL_TYPES.set(programScope, /* @__PURE__ */ new Set());
              }
              if (file.ast.comments) {
                for (const comment of file.ast.comments) {
                  const jsxMatches = JSX_PRAGMA_REGEX.exec(comment.value);
                  if (jsxMatches) {
                    if (jsxMatches[1]) {
                      fileJsxPragmaFrag = jsxMatches[2];
                    } else {
                      fileJsxPragma = jsxMatches[2];
                    }
                  }
                }
              }
              let pragmaImportName = fileJsxPragma || jsxPragma;
              if (pragmaImportName) {
                [pragmaImportName] = pragmaImportName.split(".");
              }
              let pragmaFragImportName = fileJsxPragmaFrag || jsxPragmaFrag;
              if (pragmaFragImportName) {
                [pragmaFragImportName] = pragmaFragImportName.split(".");
              }
              for (let stmt of path.get("body")) {
                if (stmt.isImportDeclaration()) {
                  if (!NEEDS_EXPLICIT_ESM.has(state.file.ast.program)) {
                    NEEDS_EXPLICIT_ESM.set(state.file.ast.program, true);
                  }
                  if (stmt.node.importKind === "type") {
                    for (const specifier of stmt.node.specifiers) {
                      (0, _globalTypes.registerGlobalType)(programScope, specifier.local.name);
                    }
                    stmt.remove();
                    continue;
                  }
                  const importsToRemove = /* @__PURE__ */ new Set();
                  const specifiersLength = stmt.node.specifiers.length;
                  const isAllSpecifiersElided = () => specifiersLength > 0 && specifiersLength === importsToRemove.size;
                  for (const specifier of stmt.node.specifiers) {
                    if (specifier.type === "ImportSpecifier" && specifier.importKind === "type") {
                      (0, _globalTypes.registerGlobalType)(programScope, specifier.local.name);
                      const binding = stmt.scope.getBinding(specifier.local.name);
                      if (binding) {
                        importsToRemove.add(binding.path);
                      }
                    }
                  }
                  if (onlyRemoveTypeImports) {
                    NEEDS_EXPLICIT_ESM.set(path.node, false);
                  } else {
                    if (stmt.node.specifiers.length === 0) {
                      NEEDS_EXPLICIT_ESM.set(path.node, false);
                      continue;
                    }
                    for (const specifier of stmt.node.specifiers) {
                      const binding = stmt.scope.getBinding(specifier.local.name);
                      if (binding && !importsToRemove.has(binding.path)) {
                        if (isImportTypeOnly({
                          binding,
                          programPath: path,
                          pragmaImportName,
                          pragmaFragImportName
                        })) {
                          importsToRemove.add(binding.path);
                        } else {
                          NEEDS_EXPLICIT_ESM.set(path.node, false);
                        }
                      }
                    }
                  }
                  if (isAllSpecifiersElided() && !onlyRemoveTypeImports) {
                    stmt.remove();
                  } else {
                    for (const importPath of importsToRemove) {
                      importPath.remove();
                    }
                  }
                  continue;
                }
                if (!onlyRemoveTypeImports && stmt.isTSImportEqualsDeclaration()) {
                  const {
                    id
                  } = stmt.node;
                  const binding = stmt.scope.getBinding(id.name);
                  if (binding && !stmt.node.isExport && isImportTypeOnly({
                    binding,
                    programPath: path,
                    pragmaImportName,
                    pragmaFragImportName
                  })) {
                    stmt.remove();
                    continue;
                  }
                }
                if (stmt.isExportDeclaration()) {
                  stmt = stmt.get("declaration");
                }
                if (stmt.isVariableDeclaration({
                  declare: true
                })) {
                  for (const name of Object.keys(stmt.getBindingIdentifiers())) {
                    (0, _globalTypes.registerGlobalType)(programScope, name);
                  }
                } else if (stmt.isTSTypeAliasDeclaration() || stmt.isTSDeclareFunction() && stmt.get("id").isIdentifier() || stmt.isTSInterfaceDeclaration() || stmt.isClassDeclaration({
                  declare: true
                }) || stmt.isTSEnumDeclaration({
                  declare: true
                }) || stmt.isTSModuleDeclaration({
                  declare: true
                }) && stmt.get("id").isIdentifier()) {
                  (0, _globalTypes.registerGlobalType)(programScope, stmt.node.id.name);
                }
              }
            },
            exit(path) {
              if (path.node.sourceType === "module" && NEEDS_EXPLICIT_ESM.get(path.node)) {
                path.pushContainer("body", t.exportNamedDeclaration());
              }
            }
          },
          ExportNamedDeclaration(path, state) {
            if (!NEEDS_EXPLICIT_ESM.has(state.file.ast.program)) {
              NEEDS_EXPLICIT_ESM.set(state.file.ast.program, true);
            }
            if (path.node.exportKind === "type") {
              path.remove();
              return;
            }
            if (path.node.source && path.node.specifiers.length > 0 && path.node.specifiers.every((specifier) => specifier.type === "ExportSpecifier" && specifier.exportKind === "type")) {
              path.remove();
              return;
            }
            if (!path.node.source && path.node.specifiers.length > 0 && path.node.specifiers.every((specifier) => t.isExportSpecifier(specifier) && (0, _globalTypes.isGlobalType)(path, specifier.local.name))) {
              path.remove();
              return;
            }
            if (t.isTSModuleDeclaration(path.node.declaration)) {
              const namespace = path.node.declaration;
              if (!t.isStringLiteral(namespace.id)) {
                const id = (0, _namespace.getFirstIdentifier)(namespace.id);
                if (path.scope.hasOwnBinding(id.name)) {
                  path.replaceWith(namespace);
                } else {
                  const [newExport] = path.replaceWithMultiple([t.exportNamedDeclaration(t.variableDeclaration("let", [t.variableDeclarator(t.cloneNode(id))])), namespace]);
                  path.scope.registerDeclaration(newExport);
                }
              }
            }
            NEEDS_EXPLICIT_ESM.set(state.file.ast.program, false);
          },
          ExportAllDeclaration(path) {
            if (path.node.exportKind === "type") path.remove();
          },
          ExportSpecifier(path) {
            const parent = path.parent;
            if (!parent.source && (0, _globalTypes.isGlobalType)(path, path.node.local.name) || path.node.exportKind === "type") {
              path.remove();
            }
          },
          ExportDefaultDeclaration(path, state) {
            if (!NEEDS_EXPLICIT_ESM.has(state.file.ast.program)) {
              NEEDS_EXPLICIT_ESM.set(state.file.ast.program, true);
            }
            if (t.isIdentifier(path.node.declaration) && (0, _globalTypes.isGlobalType)(path, path.node.declaration.name)) {
              path.remove();
              return;
            }
            NEEDS_EXPLICIT_ESM.set(state.file.ast.program, false);
          },
          TSDeclareFunction(path) {
            safeRemove(path);
          },
          TSDeclareMethod(path) {
            safeRemove(path);
          },
          VariableDeclaration(path) {
            if (path.node.declare) {
              safeRemove(path);
            }
          },
          VariableDeclarator({
            node
          }) {
            if (node.definite) node.definite = null;
          },
          TSIndexSignature(path) {
            path.remove();
          },
          ClassDeclaration(path) {
            const {
              node
            } = path;
            if (node.declare) {
              safeRemove(path);
            }
          },
          Class(path) {
            const {
              node
            } = path;
            if (node.typeParameters) node.typeParameters = null;
            if (node.superTypeParameters) node.superTypeParameters = null;
            if (node.implements) node.implements = null;
            if (node.abstract) node.abstract = null;
            path.get("body.body").forEach((child) => {
              if (child.isClassMethod() || child.isClassPrivateMethod()) {
                if (child.node.kind === "constructor") {
                  classMemberVisitors.constructor(child, path);
                } else {
                  classMemberVisitors.method(child);
                }
              } else if (child.isClassProperty() || child.isClassPrivateProperty() || child.isClassAccessorProperty()) {
                classMemberVisitors.field(child);
              }
            });
          },
          Function(path) {
            const {
              node
            } = path;
            if (node.typeParameters) node.typeParameters = null;
            if (node.returnType) node.returnType = null;
            const params = node.params;
            if (params.length > 0 && t.isIdentifier(params[0], {
              name: "this"
            })) {
              params.shift();
            }
          },
          TSModuleDeclaration(path) {
            (0, _namespace.default)(path, allowNamespaces);
          },
          TSInterfaceDeclaration(path) {
            path.remove();
          },
          TSTypeAliasDeclaration(path) {
            path.remove();
          },
          TSEnumDeclaration(path) {
            if (optimizeConstEnums && path.node.const) {
              (0, _constEnum.default)(path, t);
            } else {
              (0, _enum.default)(path, t);
            }
          },
          TSImportEqualsDeclaration(path, pass) {
            const {
              id,
              moduleReference
            } = path.node;
            let init;
            let varKind;
            if (t.isTSExternalModuleReference(moduleReference)) {
              assertCjsTransformEnabled(path, pass, `import ${id.name} = require(...);`, `import ${id.name} from '...';`, " alongside Typescript's --allowSyntheticDefaultImports option");
              init = t.callExpression(t.identifier("require"), [moduleReference.expression]);
              varKind = "const";
            } else {
              init = entityNameToExpr(moduleReference);
              varKind = "var";
            }
            const newNode = t.variableDeclaration(varKind, [t.variableDeclarator(id, init)]);
            path.replaceWith(path.node.isExport ? t.exportNamedDeclaration(newNode) : newNode);
            path.scope.registerDeclaration(path);
          },
          TSExportAssignment(path, pass) {
            assertCjsTransformEnabled(path, pass, `export = <value>;`, `export default <value>;`);
            path.replaceWith(template.statement.ast`module.exports = ${path.node.expression}`);
          },
          TSTypeAssertion(path) {
            path.replaceWith(path.node.expression);
          },
          [`TSAsExpression${t.tsSatisfiesExpression ? "|TSSatisfiesExpression" : ""}`](path) {
            let {
              node
            } = path;
            do {
              node = node.expression;
            } while (t.isTSAsExpression(node) || t.isTSSatisfiesExpression != null && t.isTSSatisfiesExpression(node));
            path.replaceWith(node);
          },
          [api.types.tsInstantiationExpression ? "TSNonNullExpression|TSInstantiationExpression" : "TSNonNullExpression"](path) {
            path.replaceWith(path.node.expression);
          },
          CallExpression(path) {
            path.node.typeParameters = null;
          },
          OptionalCallExpression(path) {
            path.node.typeParameters = null;
          },
          NewExpression(path) {
            path.node.typeParameters = null;
          },
          JSXOpeningElement(path) {
            path.node.typeParameters = null;
          },
          TaggedTemplateExpression(path) {
            path.node.typeParameters = null;
          }
        }
      };
      function entityNameToExpr(node) {
        if (t.isTSQualifiedName(node)) {
          return t.memberExpression(entityNameToExpr(node.left), node.right);
        }
        return node;
      }
      function visitPattern({
        node
      }) {
        if (node.typeAnnotation) node.typeAnnotation = null;
        if (t.isIdentifier(node) && node.optional) node.optional = null;
      }
      function isImportTypeOnly({
        binding,
        programPath,
        pragmaImportName,
        pragmaFragImportName
      }) {
        for (const path of binding.referencePaths) {
          if (!isInType(path)) {
            return false;
          }
        }
        if (binding.identifier.name !== pragmaImportName && binding.identifier.name !== pragmaFragImportName) {
          return true;
        }
        let sourceFileHasJsx = false;
        programPath.traverse({
          "JSXElement|JSXFragment"(path) {
            sourceFileHasJsx = true;
            path.stop();
          }
        });
        return !sourceFileHasJsx;
      }
    });
  }
});

// node_modules/@babel/plugin-syntax-jsx/lib/index.js
var require_lib24 = __commonJS({
  "node_modules/@babel/plugin-syntax-jsx/lib/index.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = void 0;
    var _helperPluginUtils = require_lib15();
    var _default = exports2.default = (0, _helperPluginUtils.declare)((api) => {
      api.assertVersion("^7.0.0-0 || ^8.0.0-0");
      return {
        name: "syntax-jsx",
        manipulateOptions(opts, parserOpts) {
          if (parserOpts.plugins.some((p) => (Array.isArray(p) ? p[0] : p) === "typescript")) {
            return;
          }
          parserOpts.plugins.push("jsx");
        }
      };
    });
  }
});

// node_modules/@babel/plugin-transform-modules-commonjs/lib/dynamic-import.js
var require_dynamic_import2 = __commonJS({
  "node_modules/@babel/plugin-transform-modules-commonjs/lib/dynamic-import.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.transformDynamicImport = transformDynamicImport;
    var _core = require_lib27();
    var _helperModuleTransforms = require_lib11();
    var requireNoInterop = (source) => _core.template.expression.ast`require(${source})`;
    var requireInterop = (source, file) => _core.types.callExpression(file.addHelper("interopRequireWildcard"), [requireNoInterop(source)]);
    function transformDynamicImport(path, noInterop, file) {
      const buildRequire = noInterop ? requireNoInterop : requireInterop;
      path.replaceWith((0, _helperModuleTransforms.buildDynamicImport)(path.node, true, false, (specifier) => buildRequire(specifier, file)));
    }
  }
});

// node_modules/@babel/plugin-transform-modules-commonjs/lib/lazy.js
var require_lazy = __commonJS({
  "node_modules/@babel/plugin-transform-modules-commonjs/lib/lazy.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.lazyImportsHook = void 0;
    var _core = require_lib27();
    var _helperModuleTransforms = require_lib11();
    var lazyImportsHook = (lazy) => ({
      name: `${"@babel/plugin-transform-modules-commonjs"}/lazy`,
      version: "7.28.6",
      getWrapperPayload(source, metadata) {
        if ((0, _helperModuleTransforms.isSideEffectImport)(metadata) || metadata.reexportAll) {
          return null;
        }
        if (lazy === true) {
          return source.includes(".") ? null : "lazy/function";
        }
        if (Array.isArray(lazy)) {
          return !lazy.includes(source) ? null : "lazy/function";
        }
        if (typeof lazy === "function") {
          return lazy(source) ? "lazy/function" : null;
        }
      },
      buildRequireWrapper(name, init, payload, referenced) {
        if (payload === "lazy/function") {
          if (!referenced) return false;
          return _core.template.statement.ast`
        function ${name}() {
          const data = ${init};
          ${name} = function(){ return data; };
          return data;
        }
      `;
        }
      },
      wrapReference(ref, payload) {
        if (payload === "lazy/function") return _core.types.callExpression(ref, []);
      }
    });
    exports2.lazyImportsHook = lazyImportsHook;
  }
});

// node_modules/@babel/plugin-transform-modules-commonjs/lib/hooks.js
var require_hooks = __commonJS({
  "node_modules/@babel/plugin-transform-modules-commonjs/lib/hooks.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.defineCommonJSHook = defineCommonJSHook;
    exports2.makeInvokers = makeInvokers;
    var commonJSHooksKey = "@babel/plugin-transform-modules-commonjs/customWrapperPlugin";
    function defineCommonJSHook(file, hook) {
      let hooks = file.get(commonJSHooksKey);
      if (!hooks) file.set(commonJSHooksKey, hooks = []);
      hooks.push(hook);
    }
    function findMap(arr, cb) {
      if (arr) {
        for (const el of arr) {
          const res = cb(el);
          if (res != null) return res;
        }
      }
    }
    function makeInvokers(file) {
      const hooks = file.get(commonJSHooksKey);
      return {
        getWrapperPayload(...args) {
          return findMap(hooks, (hook) => hook.getWrapperPayload == null ? void 0 : hook.getWrapperPayload(...args));
        },
        wrapReference(...args) {
          return findMap(hooks, (hook) => hook.wrapReference == null ? void 0 : hook.wrapReference(...args));
        },
        buildRequireWrapper(...args) {
          return findMap(hooks, (hook) => hook.buildRequireWrapper == null ? void 0 : hook.buildRequireWrapper(...args));
        }
      };
    }
  }
});

// node_modules/@babel/plugin-transform-modules-commonjs/lib/index.js
var require_lib25 = __commonJS({
  "node_modules/@babel/plugin-transform-modules-commonjs/lib/index.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = void 0;
    Object.defineProperty(exports2, "defineCommonJSHook", {
      enumerable: true,
      get: function() {
        return _hooks.defineCommonJSHook;
      }
    });
    var _helperPluginUtils = require_lib15();
    var _helperModuleTransforms = require_lib11();
    var _core = require_lib27();
    var _dynamicImport = require_dynamic_import2();
    var _lazy = require_lazy();
    var _hooks = require_hooks();
    var _default = exports2.default = (0, _helperPluginUtils.declare)((api, options) => {
      var _api$assumption, _api$assumption2, _api$assumption3;
      api.assertVersion(7);
      const {
        strictNamespace = false,
        mjsStrictNamespace = strictNamespace,
        allowTopLevelThis,
        strict,
        strictMode,
        noInterop,
        importInterop,
        lazy = false,
        allowCommonJSExports = true,
        loose = false
      } = options;
      const constantReexports = (_api$assumption = api.assumption("constantReexports")) != null ? _api$assumption : loose;
      const enumerableModuleMeta = (_api$assumption2 = api.assumption("enumerableModuleMeta")) != null ? _api$assumption2 : loose;
      const noIncompleteNsImportDetection = (_api$assumption3 = api.assumption("noIncompleteNsImportDetection")) != null ? _api$assumption3 : false;
      if (typeof lazy !== "boolean" && typeof lazy !== "function" && (!Array.isArray(lazy) || !lazy.every((item) => typeof item === "string"))) {
        throw new Error(`.lazy must be a boolean, array of strings, or a function`);
      }
      if (typeof strictNamespace !== "boolean") {
        throw new Error(`.strictNamespace must be a boolean, or undefined`);
      }
      if (typeof mjsStrictNamespace !== "boolean") {
        throw new Error(`.mjsStrictNamespace must be a boolean, or undefined`);
      }
      const getAssertion = (localName) => _core.template.expression.ast`
    (function(){
      throw new Error(
        "The CommonJS '" + "${localName}" + "' variable is not available in ES6 modules." +
        "Consider setting setting sourceType:script or sourceType:unambiguous in your " +
        "Babel config for this file.");
    })()
  `;
      const moduleExportsVisitor = {
        ReferencedIdentifier(path) {
          const localName = path.node.name;
          if (localName !== "module" && localName !== "exports") return;
          const localBinding = path.scope.getBinding(localName);
          const rootBinding = this.scope.getBinding(localName);
          if (rootBinding !== localBinding || path.parentPath.isObjectProperty({
            value: path.node
          }) && path.parentPath.parentPath.isObjectPattern() || path.parentPath.isAssignmentExpression({
            left: path.node
          }) || path.isAssignmentExpression({
            left: path.node
          })) {
            return;
          }
          path.replaceWith(getAssertion(localName));
        },
        UpdateExpression(path) {
          const arg = path.get("argument");
          if (!arg.isIdentifier()) return;
          const localName = arg.node.name;
          if (localName !== "module" && localName !== "exports") return;
          const localBinding = path.scope.getBinding(localName);
          const rootBinding = this.scope.getBinding(localName);
          if (rootBinding !== localBinding) return;
          path.replaceWith(_core.types.assignmentExpression(path.node.operator[0] + "=", arg.node, getAssertion(localName)));
        },
        AssignmentExpression(path) {
          const left = path.get("left");
          if (left.isIdentifier()) {
            const localName = left.node.name;
            if (localName !== "module" && localName !== "exports") return;
            const localBinding = path.scope.getBinding(localName);
            const rootBinding = this.scope.getBinding(localName);
            if (rootBinding !== localBinding) return;
            const right = path.get("right");
            right.replaceWith(_core.types.sequenceExpression([right.node, getAssertion(localName)]));
          } else if (left.isPattern()) {
            const ids = left.getOuterBindingIdentifiers();
            const localName = Object.keys(ids).find((localName2) => {
              if (localName2 !== "module" && localName2 !== "exports") return false;
              return this.scope.getBinding(localName2) === path.scope.getBinding(localName2);
            });
            if (localName) {
              const right = path.get("right");
              right.replaceWith(_core.types.sequenceExpression([right.node, getAssertion(localName)]));
            }
          }
        }
      };
      return {
        name: "transform-modules-commonjs",
        pre() {
          this.file.set("@babel/plugin-transform-modules-*", "commonjs");
          if (lazy) (0, _hooks.defineCommonJSHook)(this.file, (0, _lazy.lazyImportsHook)(lazy));
        },
        visitor: {
          ["CallExpression" + (api.types.importExpression ? "|ImportExpression" : "")](path) {
            if (!this.file.has("@babel/plugin-proposal-dynamic-import")) return;
            if (path.isCallExpression() && !_core.types.isImport(path.node.callee)) return;
            let {
              scope
            } = path;
            do {
              scope.rename("require");
            } while (scope = scope.parent);
            (0, _dynamicImport.transformDynamicImport)(path, noInterop, this.file);
          },
          Program: {
            exit(path, state) {
              if (!(0, _helperModuleTransforms.isModule)(path)) return;
              path.scope.rename("exports");
              path.scope.rename("module");
              path.scope.rename("require");
              path.scope.rename("__filename");
              path.scope.rename("__dirname");
              if (!allowCommonJSExports) {
                path.traverse(moduleExportsVisitor, {
                  scope: path.scope
                });
              }
              let moduleName = (0, _helperModuleTransforms.getModuleName)(this.file.opts, options);
              if (moduleName) moduleName = _core.types.stringLiteral(moduleName);
              const hooks = (0, _hooks.makeInvokers)(this.file);
              const {
                meta,
                headers
              } = (0, _helperModuleTransforms.rewriteModuleStatementsAndPrepareHeader)(path, {
                exportName: "exports",
                constantReexports,
                enumerableModuleMeta,
                strict,
                strictMode,
                allowTopLevelThis,
                noInterop,
                importInterop,
                wrapReference: hooks.wrapReference,
                getWrapperPayload: hooks.getWrapperPayload,
                esNamespaceOnly: typeof state.filename === "string" && state.filename.endsWith(".mjs") ? mjsStrictNamespace : strictNamespace,
                noIncompleteNsImportDetection,
                filename: this.file.opts.filename
              });
              for (const [source, metadata] of meta.source) {
                const loadExpr = _core.types.callExpression(_core.types.identifier("require"), [_core.types.stringLiteral(source)]);
                let header;
                if ((0, _helperModuleTransforms.isSideEffectImport)(metadata)) {
                  if (lazy && metadata.wrap === "function") {
                    throw new Error("Assertion failure");
                  }
                  header = _core.types.expressionStatement(loadExpr);
                } else {
                  const init = (0, _helperModuleTransforms.wrapInterop)(path, loadExpr, metadata.interop) || loadExpr;
                  if (metadata.wrap) {
                    const res = hooks.buildRequireWrapper(metadata.name, init, metadata.wrap, metadata.referenced);
                    if (res === false) continue;
                    else header = res;
                  }
                  header != null ? header : header = _core.template.statement.ast`
                var ${metadata.name} = ${init};
              `;
                }
                header.loc = metadata.loc;
                headers.push(header);
                headers.push(...(0, _helperModuleTransforms.buildNamespaceInitStatements)(meta, metadata, constantReexports, hooks.wrapReference));
              }
              (0, _helperModuleTransforms.ensureStatementsHoisted)(headers);
              path.unshiftContainer("body", headers);
              path.get("body").forEach((path2) => {
                if (!headers.includes(path2.node)) return;
                if (path2.isVariableDeclaration()) {
                  path2.scope.registerDeclaration(path2);
                }
              });
            }
          }
        }
      };
    });
  }
});

// node_modules/@babel/preset-typescript/lib/index.js
var require_lib26 = __commonJS({
  "node_modules/@babel/preset-typescript/lib/index.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    var helperPluginUtils = require_lib15();
    var transformTypeScript = require_lib23();
    require_lib24();
    var transformModulesCommonJS = require_lib25();
    var helperValidatorOption = require_lib13();
    function _interopDefault(e) {
      return e && e.__esModule ? e : { default: e };
    }
    var transformTypeScript__default = /* @__PURE__ */ _interopDefault(transformTypeScript);
    var transformModulesCommonJS__default = /* @__PURE__ */ _interopDefault(transformModulesCommonJS);
    var v = new helperValidatorOption.OptionValidator("@babel/preset-typescript");
    function normalizeOptions(options = {}) {
      let {
        allowNamespaces = true,
        jsxPragma,
        onlyRemoveTypeImports
      } = options;
      const TopLevelOptions = {
        ignoreExtensions: "ignoreExtensions",
        allowNamespaces: "allowNamespaces",
        disallowAmbiguousJSXLike: "disallowAmbiguousJSXLike",
        jsxPragma: "jsxPragma",
        jsxPragmaFrag: "jsxPragmaFrag",
        onlyRemoveTypeImports: "onlyRemoveTypeImports",
        optimizeConstEnums: "optimizeConstEnums",
        rewriteImportExtensions: "rewriteImportExtensions",
        allExtensions: "allExtensions",
        isTSX: "isTSX"
      };
      const jsxPragmaFrag = v.validateStringOption(TopLevelOptions.jsxPragmaFrag, options.jsxPragmaFrag, "React.Fragment");
      {
        var allExtensions = v.validateBooleanOption(TopLevelOptions.allExtensions, options.allExtensions, false);
        var isTSX = v.validateBooleanOption(TopLevelOptions.isTSX, options.isTSX, false);
        if (isTSX) {
          v.invariant(allExtensions, "isTSX:true requires allExtensions:true");
        }
      }
      const ignoreExtensions = v.validateBooleanOption(TopLevelOptions.ignoreExtensions, options.ignoreExtensions, false);
      const disallowAmbiguousJSXLike = v.validateBooleanOption(TopLevelOptions.disallowAmbiguousJSXLike, options.disallowAmbiguousJSXLike, false);
      if (disallowAmbiguousJSXLike) {
        {
          v.invariant(allExtensions, "disallowAmbiguousJSXLike:true requires allExtensions:true");
        }
      }
      const optimizeConstEnums = v.validateBooleanOption(TopLevelOptions.optimizeConstEnums, options.optimizeConstEnums, false);
      const rewriteImportExtensions = v.validateBooleanOption(TopLevelOptions.rewriteImportExtensions, options.rewriteImportExtensions, false);
      const normalized = {
        ignoreExtensions,
        allowNamespaces,
        disallowAmbiguousJSXLike,
        jsxPragma,
        jsxPragmaFrag,
        onlyRemoveTypeImports,
        optimizeConstEnums,
        rewriteImportExtensions
      };
      {
        normalized.allExtensions = allExtensions;
        normalized.isTSX = isTSX;
      }
      return normalized;
    }
    var pluginRewriteTSImports = helperPluginUtils.declare(function({
      types: t,
      template
    }) {
      function maybeReplace(source, path, state) {
        if (!source) return;
        if (t.isStringLiteral(source)) {
          if (/^\.\.?\//.test(source.value)) {
            source.value = source.value.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+)?)\.([cm]?)ts$/i, function(m, tsx, d, ext, cm) {
              return tsx ? ".js" : d && (!ext || !cm) ? m : d + ext + "." + cm.toLowerCase() + "js";
            });
          }
          return;
        }
        if (state.availableHelper("tsRewriteRelativeImportExtensions")) {
          path.replaceWith(t.callExpression(state.addHelper("tsRewriteRelativeImportExtensions"), [source]));
        } else {
          path.replaceWith(template.expression.ast`(${source} + "").replace(/([\\/].*\.[mc]?)tsx?$/, "$1js")`);
        }
      }
      return {
        name: "preset-typescript/plugin-rewrite-ts-imports",
        visitor: {
          "ImportDeclaration|ExportAllDeclaration|ExportNamedDeclaration"(path, state) {
            const node = path.node;
            const kind = t.isImportDeclaration(node) ? node.importKind : node.exportKind;
            if (kind === "value") {
              maybeReplace(node.source, path.get("source"), state);
            }
          },
          CallExpression(path, state) {
            if (t.isImport(path.node.callee)) {
              maybeReplace(path.node.arguments[0], path.get("arguments.0"), state);
            }
          },
          ImportExpression(path, state) {
            maybeReplace(path.node.source, path.get("source"), state);
          }
        }
      };
    });
    var index = helperPluginUtils.declarePreset((api, opts) => {
      api.assertVersion(7);
      const {
        allExtensions,
        ignoreExtensions,
        allowNamespaces,
        disallowAmbiguousJSXLike,
        isTSX,
        jsxPragma,
        jsxPragmaFrag,
        onlyRemoveTypeImports,
        optimizeConstEnums,
        rewriteImportExtensions
      } = normalizeOptions(opts);
      const pluginOptions = (disallowAmbiguousJSXLike2) => ({
        allowDeclareFields: opts.allowDeclareFields,
        allowNamespaces,
        disallowAmbiguousJSXLike: disallowAmbiguousJSXLike2,
        jsxPragma,
        jsxPragmaFrag,
        onlyRemoveTypeImports,
        optimizeConstEnums
      });
      const getPlugins = (isTSX2, disallowAmbiguousJSXLike2) => {
        {
          return [[transformTypeScript__default.default, Object.assign({
            isTSX: isTSX2
          }, pluginOptions(disallowAmbiguousJSXLike2))]];
        }
      };
      const disableExtensionDetect = allExtensions || ignoreExtensions;
      return {
        plugins: rewriteImportExtensions ? [pluginRewriteTSImports] : [],
        overrides: disableExtensionDetect ? [{
          plugins: getPlugins(isTSX, disallowAmbiguousJSXLike)
        }] : [{
          test: /\.ts$/,
          plugins: getPlugins(false, false)
        }, {
          test: /\.mts$/,
          sourceType: "module",
          plugins: getPlugins(false, true)
        }, {
          test: /\.cts$/,
          sourceType: "unambiguous",
          plugins: [[transformModulesCommonJS__default.default, {
            allowTopLevelThis: true
          }], [transformTypeScript__default.default, pluginOptions(true)]]
        }, {
          test: /\.tsx$/,
          plugins: getPlugins(true, false)
        }]
      };
    });
    exports2.default = index;
  }
});

// node_modules/@babel/core/lib/config/files/module-types.js
var require_module_types = __commonJS({
  "node_modules/@babel/core/lib/config/files/module-types.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = loadCodeDefault;
    exports2.supportsESM = void 0;
    var _async = require_async();
    function _path() {
      const data = require("path");
      _path = function() {
        return data;
      };
      return data;
    }
    function _url() {
      const data = require("url");
      _url = function() {
        return data;
      };
      return data;
    }
    require("module");
    function _semver() {
      const data = require_semver();
      _semver = function() {
        return data;
      };
      return data;
    }
    function _debug() {
      const data = require_src();
      _debug = function() {
        return data;
      };
      return data;
    }
    var _rewriteStackTrace = require_rewrite_stack_trace();
    var _configError = require_config_error();
    var _transformFile = require_transform_file();
    function asyncGeneratorStep(n, t, e, r, o, a, c) {
      try {
        var i = n[a](c), u = i.value;
      } catch (n2) {
        return void e(n2);
      }
      i.done ? t(u) : Promise.resolve(u).then(r, o);
    }
    function _asyncToGenerator(n) {
      return function() {
        var t = this, e = arguments;
        return new Promise(function(r, o) {
          var a = n.apply(t, e);
          function _next(n2) {
            asyncGeneratorStep(a, r, o, _next, _throw, "next", n2);
          }
          function _throw(n2) {
            asyncGeneratorStep(a, r, o, _next, _throw, "throw", n2);
          }
          _next(void 0);
        });
      };
    }
    var debug = _debug()("babel:config:loading:files:module-types");
    {
      try {
        import_ = require_import();
      } catch (_unused) {
      }
    }
    var import_;
    var supportsESM = exports2.supportsESM = _semver().satisfies(process.versions.node, "^12.17 || >=13.2");
    var LOADING_CJS_FILES = /* @__PURE__ */ new Set();
    function loadCjsDefault(filepath) {
      if (LOADING_CJS_FILES.has(filepath)) {
        debug("Auto-ignoring usage of config %o.", filepath);
        return {};
      }
      let module3;
      try {
        LOADING_CJS_FILES.add(filepath);
        module3 = (0, _rewriteStackTrace.endHiddenCallStack)(require)(filepath);
      } finally {
        LOADING_CJS_FILES.delete(filepath);
      }
      {
        return module3 != null && (module3.__esModule || module3[Symbol.toStringTag] === "Module") ? module3.default || (arguments[1] ? module3 : void 0) : module3;
      }
    }
    var loadMjsFromPath = (0, _rewriteStackTrace.endHiddenCallStack)((function() {
      var _loadMjsFromPath = _asyncToGenerator(function* (filepath) {
        const url = (0, _url().pathToFileURL)(filepath).toString() + "?import";
        {
          if (!import_) {
            throw new _configError.default("Internal error: Native ECMAScript modules aren't supported by this platform.\n", filepath);
          }
          return yield import_(url);
        }
      });
      function loadMjsFromPath2(_x) {
        return _loadMjsFromPath.apply(this, arguments);
      }
      return loadMjsFromPath2;
    })());
    var tsNotSupportedError = (ext) => `You are using a ${ext} config file, but Babel only supports transpiling .cts configs. Either:
- Use a .cts config file
- Update to Node.js 23.6.0, which has native TypeScript support
- Install tsx to transpile ${ext} files on the fly`;
    var SUPPORTED_EXTENSIONS = {
      ".js": "unknown",
      ".mjs": "esm",
      ".cjs": "cjs",
      ".ts": "unknown",
      ".mts": "esm",
      ".cts": "cjs"
    };
    var asyncModules = /* @__PURE__ */ new Set();
    function* loadCodeDefault(filepath, loader, esmError, tlaError) {
      let async;
      const ext = _path().extname(filepath);
      const isTS = ext === ".ts" || ext === ".cts" || ext === ".mts";
      const type = SUPPORTED_EXTENSIONS[hasOwnProperty.call(SUPPORTED_EXTENSIONS, ext) ? ext : ".js"];
      const pattern = `${loader} ${type}`;
      switch (pattern) {
        case "require cjs":
        case "auto cjs":
          if (isTS) {
            return ensureTsSupport(filepath, ext, () => loadCjsDefault(filepath));
          } else {
            return loadCjsDefault(filepath, arguments[2]);
          }
        case "auto unknown":
        case "require unknown":
        case "require esm":
          try {
            if (isTS) {
              return ensureTsSupport(filepath, ext, () => loadCjsDefault(filepath));
            } else {
              return loadCjsDefault(filepath, arguments[2]);
            }
          } catch (e) {
            if (e.code === "ERR_REQUIRE_ASYNC_MODULE" || e.code === "ERR_REQUIRE_CYCLE_MODULE" && asyncModules.has(filepath)) {
              asyncModules.add(filepath);
              if (!(async != null ? async : async = yield* (0, _async.isAsync)())) {
                throw new _configError.default(tlaError, filepath);
              }
            } else if (e.code === "ERR_REQUIRE_ESM" || type === "esm") {
            } else {
              throw e;
            }
          }
        case "auto esm":
          if (async != null ? async : async = yield* (0, _async.isAsync)()) {
            const promise = isTS ? ensureTsSupport(filepath, ext, () => loadMjsFromPath(filepath)) : loadMjsFromPath(filepath);
            return (yield* (0, _async.waitFor)(promise)).default;
          }
          if (isTS) {
            throw new _configError.default(tsNotSupportedError(ext), filepath);
          } else {
            throw new _configError.default(esmError, filepath);
          }
        default:
          throw new Error("Internal Babel error: unreachable code.");
      }
    }
    function ensureTsSupport(filepath, ext, callback) {
      if (process.features.typescript || require.extensions[".ts"] || require.extensions[".cts"] || require.extensions[".mts"]) {
        return callback();
      }
      if (ext !== ".cts") {
        throw new _configError.default(tsNotSupportedError(ext), filepath);
      }
      const opts = {
        babelrc: false,
        configFile: false,
        sourceType: "unambiguous",
        sourceMaps: "inline",
        sourceFileName: _path().basename(filepath),
        presets: [[getTSPreset(filepath), Object.assign({
          onlyRemoveTypeImports: true,
          optimizeConstEnums: true
        }, {
          allowDeclareFields: true
        })]]
      };
      let handler = function(m, filename) {
        if (handler && filename.endsWith(".cts")) {
          try {
            return m._compile((0, _transformFile.transformFileSync)(filename, Object.assign({}, opts, {
              filename
            })).code, filename);
          } catch (error) {
            const packageJson = require_package2();
            if (_semver().lt(packageJson.version, "7.21.4")) {
              console.error("`.cts` configuration file failed to load, please try to update `@babel/preset-typescript`.");
            }
            throw error;
          }
        }
        return require.extensions[".js"](m, filename);
      };
      require.extensions[ext] = handler;
      try {
        return callback();
      } finally {
        if (require.extensions[ext] === handler) delete require.extensions[ext];
        handler = void 0;
      }
    }
    function getTSPreset(filepath) {
      try {
        return require_lib26();
      } catch (error) {
        if (error.code !== "MODULE_NOT_FOUND") throw error;
        let message = "You appear to be using a .cts file as Babel configuration, but the `@babel/preset-typescript` package was not found: please install it!";
        {
          if (process.versions.pnp) {
            message += `
If you are using Yarn Plug'n'Play, you may also need to add the following configuration to your .yarnrc.yml file:

packageExtensions:
	"@babel/core@*":
		peerDependencies:
			"@babel/preset-typescript": "*"
`;
          }
        }
        throw new _configError.default(message, filepath);
      }
    }
  }
});

// node_modules/@babel/core/lib/config/files/configuration.js
var require_configuration = __commonJS({
  "node_modules/@babel/core/lib/config/files/configuration.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.ROOT_CONFIG_FILENAMES = void 0;
    exports2.findConfigUpwards = findConfigUpwards;
    exports2.findRelativeConfig = findRelativeConfig;
    exports2.findRootConfig = findRootConfig;
    exports2.loadConfig = loadConfig;
    exports2.resolveShowConfigPath = resolveShowConfigPath;
    function _debug() {
      const data = require_src();
      _debug = function() {
        return data;
      };
      return data;
    }
    function _fs() {
      const data = require("fs");
      _fs = function() {
        return data;
      };
      return data;
    }
    function _path() {
      const data = require("path");
      _path = function() {
        return data;
      };
      return data;
    }
    function _json() {
      const data = require_lib12();
      _json = function() {
        return data;
      };
      return data;
    }
    function _gensync() {
      const data = require_gensync();
      _gensync = function() {
        return data;
      };
      return data;
    }
    var _caching = require_caching();
    var _configApi = require_config_api();
    var _utils = require_utils2();
    var _moduleTypes = require_module_types();
    var _patternToRegex = require_pattern_to_regex();
    var _configError = require_config_error();
    var fs = require_fs();
    require("module");
    var _rewriteStackTrace = require_rewrite_stack_trace();
    var _async = require_async();
    var debug = _debug()("babel:config:loading:files:configuration");
    var ROOT_CONFIG_FILENAMES = exports2.ROOT_CONFIG_FILENAMES = ["babel.config.js", "babel.config.cjs", "babel.config.mjs", "babel.config.json", "babel.config.cts", "babel.config.ts", "babel.config.mts"];
    var RELATIVE_CONFIG_FILENAMES = [".babelrc", ".babelrc.js", ".babelrc.cjs", ".babelrc.mjs", ".babelrc.json", ".babelrc.cts"];
    var BABELIGNORE_FILENAME = ".babelignore";
    var runConfig = (0, _caching.makeWeakCache)(function* runConfig2(options, cache) {
      yield* [];
      return {
        options: (0, _rewriteStackTrace.endHiddenCallStack)(options)((0, _configApi.makeConfigAPI)(cache)),
        cacheNeedsConfiguration: !cache.configured()
      };
    });
    function* readConfigCode(filepath, data) {
      if (!_fs().existsSync(filepath)) return null;
      let options = yield* (0, _moduleTypes.default)(filepath, (yield* (0, _async.isAsync)()) ? "auto" : "require", "You appear to be using a native ECMAScript module configuration file, which is only supported when running Babel asynchronously or when using the Node.js `--experimental-require-module` flag.", "You appear to be using a configuration file that contains top-level await, which is only supported when running Babel asynchronously.");
      let cacheNeedsConfiguration = false;
      if (typeof options === "function") {
        ({
          options,
          cacheNeedsConfiguration
        } = yield* runConfig(options, data));
      }
      if (!options || typeof options !== "object" || Array.isArray(options)) {
        throw new _configError.default(`Configuration should be an exported JavaScript object.`, filepath);
      }
      if (typeof options.then === "function") {
        options.catch == null || options.catch(() => {
        });
        throw new _configError.default(`You appear to be using an async configuration, which your current version of Babel does not support. We may add support for this in the future, but if you're on the most recent version of @babel/core and still seeing this error, then you'll need to synchronously return your config.`, filepath);
      }
      if (cacheNeedsConfiguration) throwConfigError(filepath);
      return buildConfigFileObject(options, filepath);
    }
    var cfboaf = /* @__PURE__ */ new WeakMap();
    function buildConfigFileObject(options, filepath) {
      let configFilesByFilepath = cfboaf.get(options);
      if (!configFilesByFilepath) {
        cfboaf.set(options, configFilesByFilepath = /* @__PURE__ */ new Map());
      }
      let configFile = configFilesByFilepath.get(filepath);
      if (!configFile) {
        configFile = {
          filepath,
          dirname: _path().dirname(filepath),
          options
        };
        configFilesByFilepath.set(filepath, configFile);
      }
      return configFile;
    }
    var packageToBabelConfig = (0, _caching.makeWeakCacheSync)((file) => {
      const babel2 = file.options.babel;
      if (babel2 === void 0) return null;
      if (typeof babel2 !== "object" || Array.isArray(babel2) || babel2 === null) {
        throw new _configError.default(`.babel property must be an object`, file.filepath);
      }
      return {
        filepath: file.filepath,
        dirname: file.dirname,
        options: babel2
      };
    });
    var readConfigJSON5 = (0, _utils.makeStaticFileCache)((filepath, content) => {
      let options;
      try {
        options = _json().parse(content);
      } catch (err) {
        throw new _configError.default(`Error while parsing config - ${err.message}`, filepath);
      }
      if (!options) throw new _configError.default(`No config detected`, filepath);
      if (typeof options !== "object") {
        throw new _configError.default(`Config returned typeof ${typeof options}`, filepath);
      }
      if (Array.isArray(options)) {
        throw new _configError.default(`Expected config object but found array`, filepath);
      }
      delete options.$schema;
      return {
        filepath,
        dirname: _path().dirname(filepath),
        options
      };
    });
    var readIgnoreConfig = (0, _utils.makeStaticFileCache)((filepath, content) => {
      const ignoreDir = _path().dirname(filepath);
      const ignorePatterns = content.split("\n").map((line) => line.replace(/#.*$/, "").trim()).filter(Boolean);
      for (const pattern of ignorePatterns) {
        if (pattern[0] === "!") {
          throw new _configError.default(`Negation of file paths is not supported.`, filepath);
        }
      }
      return {
        filepath,
        dirname: _path().dirname(filepath),
        ignore: ignorePatterns.map((pattern) => (0, _patternToRegex.default)(pattern, ignoreDir))
      };
    });
    function findConfigUpwards(rootDir) {
      let dirname = rootDir;
      for (; ; ) {
        for (const filename of ROOT_CONFIG_FILENAMES) {
          if (_fs().existsSync(_path().join(dirname, filename))) {
            return dirname;
          }
        }
        const nextDir = _path().dirname(dirname);
        if (dirname === nextDir) break;
        dirname = nextDir;
      }
      return null;
    }
    function* findRelativeConfig(packageData, envName, caller) {
      let config = null;
      let ignore = null;
      const dirname = _path().dirname(packageData.filepath);
      for (const loc of packageData.directories) {
        if (!config) {
          var _packageData$pkg;
          config = yield* loadOneConfig(RELATIVE_CONFIG_FILENAMES, loc, envName, caller, ((_packageData$pkg = packageData.pkg) == null ? void 0 : _packageData$pkg.dirname) === loc ? packageToBabelConfig(packageData.pkg) : null);
        }
        if (!ignore) {
          const ignoreLoc = _path().join(loc, BABELIGNORE_FILENAME);
          ignore = yield* readIgnoreConfig(ignoreLoc);
          if (ignore) {
            debug("Found ignore %o from %o.", ignore.filepath, dirname);
          }
        }
      }
      return {
        config,
        ignore
      };
    }
    function findRootConfig(dirname, envName, caller) {
      return loadOneConfig(ROOT_CONFIG_FILENAMES, dirname, envName, caller);
    }
    function* loadOneConfig(names, dirname, envName, caller, previousConfig = null) {
      const configs = yield* _gensync().all(names.map((filename) => readConfig(_path().join(dirname, filename), envName, caller)));
      const config = configs.reduce((previousConfig2, config2) => {
        if (config2 && previousConfig2) {
          throw new _configError.default(`Multiple configuration files found. Please remove one:
 - ${_path().basename(previousConfig2.filepath)}
 - ${config2.filepath}
from ${dirname}`);
        }
        return config2 || previousConfig2;
      }, previousConfig);
      if (config) {
        debug("Found configuration %o from %o.", config.filepath, dirname);
      }
      return config;
    }
    function* loadConfig(name, dirname, envName, caller) {
      const filepath = (((v, w) => (v = v.split("."), w = w.split("."), +v[0] > +w[0] || v[0] == w[0] && +v[1] >= +w[1]))(process.versions.node, "8.9") ? require.resolve : (r, {
        paths: [b]
      }, M = require("module")) => {
        let f = M._findPath(r, M._nodeModulePaths(b).concat(b));
        if (f) return f;
        f = new Error(`Cannot resolve module '${r}'`);
        f.code = "MODULE_NOT_FOUND";
        throw f;
      })(name, {
        paths: [dirname]
      });
      const conf = yield* readConfig(filepath, envName, caller);
      if (!conf) {
        throw new _configError.default(`Config file contains no configuration data`, filepath);
      }
      debug("Loaded config %o from %o.", name, dirname);
      return conf;
    }
    function readConfig(filepath, envName, caller) {
      const ext = _path().extname(filepath);
      switch (ext) {
        case ".js":
        case ".cjs":
        case ".mjs":
        case ".ts":
        case ".cts":
        case ".mts":
          return readConfigCode(filepath, {
            envName,
            caller
          });
        default:
          return readConfigJSON5(filepath);
      }
    }
    function* resolveShowConfigPath(dirname) {
      const targetPath = process.env.BABEL_SHOW_CONFIG_FOR;
      if (targetPath != null) {
        const absolutePath = _path().resolve(dirname, targetPath);
        const stats = yield* fs.stat(absolutePath);
        if (!stats.isFile()) {
          throw new Error(`${absolutePath}: BABEL_SHOW_CONFIG_FOR must refer to a regular file, directories are not supported.`);
        }
        return absolutePath;
      }
      return null;
    }
    function throwConfigError(filepath) {
      throw new _configError.default(`Caching was left unconfigured. Babel's plugins, presets, and .babelrc.js files can be configured
for various types of caching, using the first param of their handler functions:

module.exports = function(api) {
  // The API exposes the following:

  // Cache the returned value forever and don't call this function again.
  api.cache(true);

  // Don't cache at all. Not recommended because it will be very slow.
  api.cache(false);

  // Cached based on the value of some function. If this function returns a value different from
  // a previously-encountered value, the plugins will re-evaluate.
  var env = api.cache(() => process.env.NODE_ENV);

  // If testing for a specific env, we recommend specifics to avoid instantiating a plugin for
  // any possible NODE_ENV value that might come up during plugin execution.
  var isProd = api.cache(() => process.env.NODE_ENV === "production");

  // .cache(fn) will perform a linear search though instances to find the matching plugin based
  // based on previous instantiated plugins. If you want to recreate the plugin and discard the
  // previous instance whenever something changes, you may use:
  var isProd = api.cache.invalidate(() => process.env.NODE_ENV === "production");

  // Note, we also expose the following more-verbose versions of the above examples:
  api.cache.forever(); // api.cache(true)
  api.cache.never();   // api.cache(false)
  api.cache.using(fn); // api.cache(fn)

  // Return the value that will be cached.
  return { };
};`, filepath);
    }
  }
});

// node_modules/@babel/core/lib/vendor/import-meta-resolve.js
var require_import_meta_resolve = __commonJS({
  "node_modules/@babel/core/lib/vendor/import-meta-resolve.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.moduleResolve = moduleResolve;
    exports2.resolve = resolve;
    function _assert() {
      const data = require("assert");
      _assert = function() {
        return data;
      };
      return data;
    }
    function _fs() {
      const data = _interopRequireWildcard(require("fs"), true);
      _fs = function() {
        return data;
      };
      return data;
    }
    function _process() {
      const data = require("process");
      _process = function() {
        return data;
      };
      return data;
    }
    function _url() {
      const data = require("url");
      _url = function() {
        return data;
      };
      return data;
    }
    function _path() {
      const data = require("path");
      _path = function() {
        return data;
      };
      return data;
    }
    function _module() {
      const data = require("module");
      _module = function() {
        return data;
      };
      return data;
    }
    function _v() {
      const data = require("v8");
      _v = function() {
        return data;
      };
      return data;
    }
    function _util() {
      const data = require("util");
      _util = function() {
        return data;
      };
      return data;
    }
    function _interopRequireWildcard(e, t) {
      if ("function" == typeof WeakMap) var r = /* @__PURE__ */ new WeakMap(), n = /* @__PURE__ */ new WeakMap();
      return (_interopRequireWildcard = function(e2, t2) {
        if (!t2 && e2 && e2.__esModule) return e2;
        var o, i, f = { __proto__: null, default: e2 };
        if (null === e2 || "object" != typeof e2 && "function" != typeof e2) return f;
        if (o = t2 ? n : r) {
          if (o.has(e2)) return o.get(e2);
          o.set(e2, f);
        }
        for (const t3 in e2) "default" !== t3 && {}.hasOwnProperty.call(e2, t3) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e2, t3)) && (i.get || i.set) ? o(f, t3, i) : f[t3] = e2[t3]);
        return f;
      })(e, t);
    }
    var own$1 = {}.hasOwnProperty;
    var classRegExp = /^([A-Z][a-z\d]*)+$/;
    var kTypes = /* @__PURE__ */ new Set(["string", "function", "number", "object", "Function", "Object", "boolean", "bigint", "symbol"]);
    var codes = {};
    function formatList(array, type = "and") {
      return array.length < 3 ? array.join(` ${type} `) : `${array.slice(0, -1).join(", ")}, ${type} ${array[array.length - 1]}`;
    }
    var messages = /* @__PURE__ */ new Map();
    var nodeInternalPrefix = "__node_internal_";
    var userStackTraceLimit;
    codes.ERR_INVALID_ARG_TYPE = createError("ERR_INVALID_ARG_TYPE", (name, expected, actual) => {
      _assert()(typeof name === "string", "'name' must be a string");
      if (!Array.isArray(expected)) {
        expected = [expected];
      }
      let message = "The ";
      if (name.endsWith(" argument")) {
        message += `${name} `;
      } else {
        const type = name.includes(".") ? "property" : "argument";
        message += `"${name}" ${type} `;
      }
      message += "must be ";
      const types2 = [];
      const instances = [];
      const other = [];
      for (const value2 of expected) {
        _assert()(typeof value2 === "string", "All expected entries have to be of type string");
        if (kTypes.has(value2)) {
          types2.push(value2.toLowerCase());
        } else if (classRegExp.exec(value2) === null) {
          _assert()(value2 !== "object", 'The value "object" should be written as "Object"');
          other.push(value2);
        } else {
          instances.push(value2);
        }
      }
      if (instances.length > 0) {
        const pos = types2.indexOf("object");
        if (pos !== -1) {
          types2.slice(pos, 1);
          instances.push("Object");
        }
      }
      if (types2.length > 0) {
        message += `${types2.length > 1 ? "one of type" : "of type"} ${formatList(types2, "or")}`;
        if (instances.length > 0 || other.length > 0) message += " or ";
      }
      if (instances.length > 0) {
        message += `an instance of ${formatList(instances, "or")}`;
        if (other.length > 0) message += " or ";
      }
      if (other.length > 0) {
        if (other.length > 1) {
          message += `one of ${formatList(other, "or")}`;
        } else {
          if (other[0].toLowerCase() !== other[0]) message += "an ";
          message += `${other[0]}`;
        }
      }
      message += `. Received ${determineSpecificType(actual)}`;
      return message;
    }, TypeError);
    codes.ERR_INVALID_MODULE_SPECIFIER = createError("ERR_INVALID_MODULE_SPECIFIER", (request, reason, base = void 0) => {
      return `Invalid module "${request}" ${reason}${base ? ` imported from ${base}` : ""}`;
    }, TypeError);
    codes.ERR_INVALID_PACKAGE_CONFIG = createError("ERR_INVALID_PACKAGE_CONFIG", (path, base, message) => {
      return `Invalid package config ${path}${base ? ` while importing ${base}` : ""}${message ? `. ${message}` : ""}`;
    }, Error);
    codes.ERR_INVALID_PACKAGE_TARGET = createError("ERR_INVALID_PACKAGE_TARGET", (packagePath, key, target, isImport = false, base = void 0) => {
      const relatedError = typeof target === "string" && !isImport && target.length > 0 && !target.startsWith("./");
      if (key === ".") {
        _assert()(isImport === false);
        return `Invalid "exports" main target ${JSON.stringify(target)} defined in the package config ${packagePath}package.json${base ? ` imported from ${base}` : ""}${relatedError ? '; targets must start with "./"' : ""}`;
      }
      return `Invalid "${isImport ? "imports" : "exports"}" target ${JSON.stringify(target)} defined for '${key}' in the package config ${packagePath}package.json${base ? ` imported from ${base}` : ""}${relatedError ? '; targets must start with "./"' : ""}`;
    }, Error);
    codes.ERR_MODULE_NOT_FOUND = createError("ERR_MODULE_NOT_FOUND", (path, base, exactUrl = false) => {
      return `Cannot find ${exactUrl ? "module" : "package"} '${path}' imported from ${base}`;
    }, Error);
    codes.ERR_NETWORK_IMPORT_DISALLOWED = createError("ERR_NETWORK_IMPORT_DISALLOWED", "import of '%s' by %s is not supported: %s", Error);
    codes.ERR_PACKAGE_IMPORT_NOT_DEFINED = createError("ERR_PACKAGE_IMPORT_NOT_DEFINED", (specifier, packagePath, base) => {
      return `Package import specifier "${specifier}" is not defined${packagePath ? ` in package ${packagePath}package.json` : ""} imported from ${base}`;
    }, TypeError);
    codes.ERR_PACKAGE_PATH_NOT_EXPORTED = createError("ERR_PACKAGE_PATH_NOT_EXPORTED", (packagePath, subpath, base = void 0) => {
      if (subpath === ".") return `No "exports" main defined in ${packagePath}package.json${base ? ` imported from ${base}` : ""}`;
      return `Package subpath '${subpath}' is not defined by "exports" in ${packagePath}package.json${base ? ` imported from ${base}` : ""}`;
    }, Error);
    codes.ERR_UNSUPPORTED_DIR_IMPORT = createError("ERR_UNSUPPORTED_DIR_IMPORT", "Directory import '%s' is not supported resolving ES modules imported from %s", Error);
    codes.ERR_UNSUPPORTED_RESOLVE_REQUEST = createError("ERR_UNSUPPORTED_RESOLVE_REQUEST", 'Failed to resolve module specifier "%s" from "%s": Invalid relative URL or base scheme is not hierarchical.', TypeError);
    codes.ERR_UNKNOWN_FILE_EXTENSION = createError("ERR_UNKNOWN_FILE_EXTENSION", (extension, path) => {
      return `Unknown file extension "${extension}" for ${path}`;
    }, TypeError);
    codes.ERR_INVALID_ARG_VALUE = createError("ERR_INVALID_ARG_VALUE", (name, value2, reason = "is invalid") => {
      let inspected = (0, _util().inspect)(value2);
      if (inspected.length > 128) {
        inspected = `${inspected.slice(0, 128)}...`;
      }
      const type = name.includes(".") ? "property" : "argument";
      return `The ${type} '${name}' ${reason}. Received ${inspected}`;
    }, TypeError);
    function createError(sym, value2, constructor) {
      messages.set(sym, value2);
      return makeNodeErrorWithCode(constructor, sym);
    }
    function makeNodeErrorWithCode(Base, key) {
      return NodeError;
      function NodeError(...parameters) {
        const limit = Error.stackTraceLimit;
        if (isErrorStackTraceLimitWritable()) Error.stackTraceLimit = 0;
        const error = new Base();
        if (isErrorStackTraceLimitWritable()) Error.stackTraceLimit = limit;
        const message = getMessage(key, parameters, error);
        Object.defineProperties(error, {
          message: {
            value: message,
            enumerable: false,
            writable: true,
            configurable: true
          },
          toString: {
            value() {
              return `${this.name} [${key}]: ${this.message}`;
            },
            enumerable: false,
            writable: true,
            configurable: true
          }
        });
        captureLargerStackTrace(error);
        error.code = key;
        return error;
      }
    }
    function isErrorStackTraceLimitWritable() {
      try {
        if (_v().startupSnapshot.isBuildingSnapshot()) {
          return false;
        }
      } catch (_unused) {
      }
      const desc = Object.getOwnPropertyDescriptor(Error, "stackTraceLimit");
      if (desc === void 0) {
        return Object.isExtensible(Error);
      }
      return own$1.call(desc, "writable") && desc.writable !== void 0 ? desc.writable : desc.set !== void 0;
    }
    function hideStackFrames(wrappedFunction) {
      const hidden = nodeInternalPrefix + wrappedFunction.name;
      Object.defineProperty(wrappedFunction, "name", {
        value: hidden
      });
      return wrappedFunction;
    }
    var captureLargerStackTrace = hideStackFrames(function(error) {
      const stackTraceLimitIsWritable = isErrorStackTraceLimitWritable();
      if (stackTraceLimitIsWritable) {
        userStackTraceLimit = Error.stackTraceLimit;
        Error.stackTraceLimit = Number.POSITIVE_INFINITY;
      }
      Error.captureStackTrace(error);
      if (stackTraceLimitIsWritable) Error.stackTraceLimit = userStackTraceLimit;
      return error;
    });
    function getMessage(key, parameters, self2) {
      const message = messages.get(key);
      _assert()(message !== void 0, "expected `message` to be found");
      if (typeof message === "function") {
        _assert()(message.length <= parameters.length, `Code: ${key}; The provided arguments length (${parameters.length}) does not match the required ones (${message.length}).`);
        return Reflect.apply(message, self2, parameters);
      }
      const regex = /%[dfijoOs]/g;
      let expectedLength = 0;
      while (regex.exec(message) !== null) expectedLength++;
      _assert()(expectedLength === parameters.length, `Code: ${key}; The provided arguments length (${parameters.length}) does not match the required ones (${expectedLength}).`);
      if (parameters.length === 0) return message;
      parameters.unshift(message);
      return Reflect.apply(_util().format, null, parameters);
    }
    function determineSpecificType(value2) {
      if (value2 === null || value2 === void 0) {
        return String(value2);
      }
      if (typeof value2 === "function" && value2.name) {
        return `function ${value2.name}`;
      }
      if (typeof value2 === "object") {
        if (value2.constructor && value2.constructor.name) {
          return `an instance of ${value2.constructor.name}`;
        }
        return `${(0, _util().inspect)(value2, {
          depth: -1
        })}`;
      }
      let inspected = (0, _util().inspect)(value2, {
        colors: false
      });
      if (inspected.length > 28) {
        inspected = `${inspected.slice(0, 25)}...`;
      }
      return `type ${typeof value2} (${inspected})`;
    }
    var hasOwnProperty$1 = {}.hasOwnProperty;
    var {
      ERR_INVALID_PACKAGE_CONFIG: ERR_INVALID_PACKAGE_CONFIG$1
    } = codes;
    var cache = /* @__PURE__ */ new Map();
    function read(jsonPath, {
      base,
      specifier
    }) {
      const existing = cache.get(jsonPath);
      if (existing) {
        return existing;
      }
      let string;
      try {
        string = _fs().default.readFileSync(_path().toNamespacedPath(jsonPath), "utf8");
      } catch (error) {
        const exception = error;
        if (exception.code !== "ENOENT") {
          throw exception;
        }
      }
      const result = {
        exists: false,
        pjsonPath: jsonPath,
        main: void 0,
        name: void 0,
        type: "none",
        exports: void 0,
        imports: void 0
      };
      if (string !== void 0) {
        let parsed;
        try {
          parsed = JSON.parse(string);
        } catch (error_) {
          const cause = error_;
          const error = new ERR_INVALID_PACKAGE_CONFIG$1(jsonPath, (base ? `"${specifier}" from ` : "") + (0, _url().fileURLToPath)(base || specifier), cause.message);
          error.cause = cause;
          throw error;
        }
        result.exists = true;
        if (hasOwnProperty$1.call(parsed, "name") && typeof parsed.name === "string") {
          result.name = parsed.name;
        }
        if (hasOwnProperty$1.call(parsed, "main") && typeof parsed.main === "string") {
          result.main = parsed.main;
        }
        if (hasOwnProperty$1.call(parsed, "exports")) {
          result.exports = parsed.exports;
        }
        if (hasOwnProperty$1.call(parsed, "imports")) {
          result.imports = parsed.imports;
        }
        if (hasOwnProperty$1.call(parsed, "type") && (parsed.type === "commonjs" || parsed.type === "module")) {
          result.type = parsed.type;
        }
      }
      cache.set(jsonPath, result);
      return result;
    }
    function getPackageScopeConfig(resolved) {
      let packageJSONUrl = new URL("package.json", resolved);
      while (true) {
        const packageJSONPath2 = packageJSONUrl.pathname;
        if (packageJSONPath2.endsWith("node_modules/package.json")) {
          break;
        }
        const packageConfig = read((0, _url().fileURLToPath)(packageJSONUrl), {
          specifier: resolved
        });
        if (packageConfig.exists) {
          return packageConfig;
        }
        const lastPackageJSONUrl = packageJSONUrl;
        packageJSONUrl = new URL("../package.json", packageJSONUrl);
        if (packageJSONUrl.pathname === lastPackageJSONUrl.pathname) {
          break;
        }
      }
      const packageJSONPath = (0, _url().fileURLToPath)(packageJSONUrl);
      return {
        pjsonPath: packageJSONPath,
        exists: false,
        type: "none"
      };
    }
    function getPackageType(url) {
      return getPackageScopeConfig(url).type;
    }
    var {
      ERR_UNKNOWN_FILE_EXTENSION
    } = codes;
    var hasOwnProperty2 = {}.hasOwnProperty;
    var extensionFormatMap = {
      __proto__: null,
      ".cjs": "commonjs",
      ".js": "module",
      ".json": "json",
      ".mjs": "module"
    };
    function mimeToFormat(mime) {
      if (mime && /\s*(text|application)\/javascript\s*(;\s*charset=utf-?8\s*)?/i.test(mime)) return "module";
      if (mime === "application/json") return "json";
      return null;
    }
    var protocolHandlers = {
      __proto__: null,
      "data:": getDataProtocolModuleFormat,
      "file:": getFileProtocolModuleFormat,
      "http:": getHttpProtocolModuleFormat,
      "https:": getHttpProtocolModuleFormat,
      "node:"() {
        return "builtin";
      }
    };
    function getDataProtocolModuleFormat(parsed) {
      const {
        1: mime
      } = /^([^/]+\/[^;,]+)[^,]*?(;base64)?,/.exec(parsed.pathname) || [null, null, null];
      return mimeToFormat(mime);
    }
    function extname(url) {
      const pathname = url.pathname;
      let index = pathname.length;
      while (index--) {
        const code = pathname.codePointAt(index);
        if (code === 47) {
          return "";
        }
        if (code === 46) {
          return pathname.codePointAt(index - 1) === 47 ? "" : pathname.slice(index);
        }
      }
      return "";
    }
    function getFileProtocolModuleFormat(url, _context, ignoreErrors) {
      const value2 = extname(url);
      if (value2 === ".js") {
        const packageType = getPackageType(url);
        if (packageType !== "none") {
          return packageType;
        }
        return "commonjs";
      }
      if (value2 === "") {
        const packageType = getPackageType(url);
        if (packageType === "none" || packageType === "commonjs") {
          return "commonjs";
        }
        return "module";
      }
      const format = extensionFormatMap[value2];
      if (format) return format;
      if (ignoreErrors) {
        return void 0;
      }
      const filepath = (0, _url().fileURLToPath)(url);
      throw new ERR_UNKNOWN_FILE_EXTENSION(value2, filepath);
    }
    function getHttpProtocolModuleFormat() {
    }
    function defaultGetFormatWithoutErrors(url, context) {
      const protocol = url.protocol;
      if (!hasOwnProperty2.call(protocolHandlers, protocol)) {
        return null;
      }
      return protocolHandlers[protocol](url, context, true) || null;
    }
    var {
      ERR_INVALID_ARG_VALUE
    } = codes;
    var DEFAULT_CONDITIONS = Object.freeze(["node", "import"]);
    var DEFAULT_CONDITIONS_SET = new Set(DEFAULT_CONDITIONS);
    function getDefaultConditions() {
      return DEFAULT_CONDITIONS;
    }
    function getDefaultConditionsSet() {
      return DEFAULT_CONDITIONS_SET;
    }
    function getConditionsSet(conditions) {
      if (conditions !== void 0 && conditions !== getDefaultConditions()) {
        if (!Array.isArray(conditions)) {
          throw new ERR_INVALID_ARG_VALUE("conditions", conditions, "expected an array");
        }
        return new Set(conditions);
      }
      return getDefaultConditionsSet();
    }
    var RegExpPrototypeSymbolReplace = RegExp.prototype[Symbol.replace];
    var {
      ERR_NETWORK_IMPORT_DISALLOWED,
      ERR_INVALID_MODULE_SPECIFIER,
      ERR_INVALID_PACKAGE_CONFIG,
      ERR_INVALID_PACKAGE_TARGET,
      ERR_MODULE_NOT_FOUND,
      ERR_PACKAGE_IMPORT_NOT_DEFINED,
      ERR_PACKAGE_PATH_NOT_EXPORTED,
      ERR_UNSUPPORTED_DIR_IMPORT,
      ERR_UNSUPPORTED_RESOLVE_REQUEST
    } = codes;
    var own = {}.hasOwnProperty;
    var invalidSegmentRegEx = /(^|\\|\/)((\.|%2e)(\.|%2e)?|(n|%6e|%4e)(o|%6f|%4f)(d|%64|%44)(e|%65|%45)(_|%5f)(m|%6d|%4d)(o|%6f|%4f)(d|%64|%44)(u|%75|%55)(l|%6c|%4c)(e|%65|%45)(s|%73|%53))?(\\|\/|$)/i;
    var deprecatedInvalidSegmentRegEx = /(^|\\|\/)((\.|%2e)(\.|%2e)?|(n|%6e|%4e)(o|%6f|%4f)(d|%64|%44)(e|%65|%45)(_|%5f)(m|%6d|%4d)(o|%6f|%4f)(d|%64|%44)(u|%75|%55)(l|%6c|%4c)(e|%65|%45)(s|%73|%53))(\\|\/|$)/i;
    var invalidPackageNameRegEx = /^\.|%|\\/;
    var patternRegEx = /\*/g;
    var encodedSeparatorRegEx = /%2f|%5c/i;
    var emittedPackageWarnings = /* @__PURE__ */ new Set();
    var doubleSlashRegEx = /[/\\]{2}/;
    function emitInvalidSegmentDeprecation(target, request, match, packageJsonUrl, internal, base, isTarget) {
      if (_process().noDeprecation) {
        return;
      }
      const pjsonPath = (0, _url().fileURLToPath)(packageJsonUrl);
      const double = doubleSlashRegEx.exec(isTarget ? target : request) !== null;
      _process().emitWarning(`Use of deprecated ${double ? "double slash" : "leading or trailing slash matching"} resolving "${target}" for module request "${request}" ${request === match ? "" : `matched to "${match}" `}in the "${internal ? "imports" : "exports"}" field module resolution of the package at ${pjsonPath}${base ? ` imported from ${(0, _url().fileURLToPath)(base)}` : ""}.`, "DeprecationWarning", "DEP0166");
    }
    function emitLegacyIndexDeprecation(url, packageJsonUrl, base, main) {
      if (_process().noDeprecation) {
        return;
      }
      const format = defaultGetFormatWithoutErrors(url, {
        parentURL: base.href
      });
      if (format !== "module") return;
      const urlPath = (0, _url().fileURLToPath)(url.href);
      const packagePath = (0, _url().fileURLToPath)(new (_url()).URL(".", packageJsonUrl));
      const basePath = (0, _url().fileURLToPath)(base);
      if (!main) {
        _process().emitWarning(`No "main" or "exports" field defined in the package.json for ${packagePath} resolving the main entry point "${urlPath.slice(packagePath.length)}", imported from ${basePath}.
Default "index" lookups for the main are deprecated for ES modules.`, "DeprecationWarning", "DEP0151");
      } else if (_path().resolve(packagePath, main) !== urlPath) {
        _process().emitWarning(`Package ${packagePath} has a "main" field set to "${main}", excluding the full filename and extension to the resolved file at "${urlPath.slice(packagePath.length)}", imported from ${basePath}.
 Automatic extension resolution of the "main" field is deprecated for ES modules.`, "DeprecationWarning", "DEP0151");
      }
    }
    function tryStatSync(path) {
      try {
        return (0, _fs().statSync)(path);
      } catch (_unused2) {
      }
    }
    function fileExists(url) {
      const stats = (0, _fs().statSync)(url, {
        throwIfNoEntry: false
      });
      const isFile = stats ? stats.isFile() : void 0;
      return isFile === null || isFile === void 0 ? false : isFile;
    }
    function legacyMainResolve(packageJsonUrl, packageConfig, base) {
      let guess;
      if (packageConfig.main !== void 0) {
        guess = new (_url()).URL(packageConfig.main, packageJsonUrl);
        if (fileExists(guess)) return guess;
        const tries2 = [`./${packageConfig.main}.js`, `./${packageConfig.main}.json`, `./${packageConfig.main}.node`, `./${packageConfig.main}/index.js`, `./${packageConfig.main}/index.json`, `./${packageConfig.main}/index.node`];
        let i2 = -1;
        while (++i2 < tries2.length) {
          guess = new (_url()).URL(tries2[i2], packageJsonUrl);
          if (fileExists(guess)) break;
          guess = void 0;
        }
        if (guess) {
          emitLegacyIndexDeprecation(guess, packageJsonUrl, base, packageConfig.main);
          return guess;
        }
      }
      const tries = ["./index.js", "./index.json", "./index.node"];
      let i = -1;
      while (++i < tries.length) {
        guess = new (_url()).URL(tries[i], packageJsonUrl);
        if (fileExists(guess)) break;
        guess = void 0;
      }
      if (guess) {
        emitLegacyIndexDeprecation(guess, packageJsonUrl, base, packageConfig.main);
        return guess;
      }
      throw new ERR_MODULE_NOT_FOUND((0, _url().fileURLToPath)(new (_url()).URL(".", packageJsonUrl)), (0, _url().fileURLToPath)(base));
    }
    function finalizeResolution(resolved, base, preserveSymlinks) {
      if (encodedSeparatorRegEx.exec(resolved.pathname) !== null) {
        throw new ERR_INVALID_MODULE_SPECIFIER(resolved.pathname, 'must not include encoded "/" or "\\" characters', (0, _url().fileURLToPath)(base));
      }
      let filePath;
      try {
        filePath = (0, _url().fileURLToPath)(resolved);
      } catch (error) {
        const cause = error;
        Object.defineProperty(cause, "input", {
          value: String(resolved)
        });
        Object.defineProperty(cause, "module", {
          value: String(base)
        });
        throw cause;
      }
      const stats = tryStatSync(filePath.endsWith("/") ? filePath.slice(-1) : filePath);
      if (stats && stats.isDirectory()) {
        const error = new ERR_UNSUPPORTED_DIR_IMPORT(filePath, (0, _url().fileURLToPath)(base));
        error.url = String(resolved);
        throw error;
      }
      if (!stats || !stats.isFile()) {
        const error = new ERR_MODULE_NOT_FOUND(filePath || resolved.pathname, base && (0, _url().fileURLToPath)(base), true);
        error.url = String(resolved);
        throw error;
      }
      if (!preserveSymlinks) {
        const real = (0, _fs().realpathSync)(filePath);
        const {
          search,
          hash
        } = resolved;
        resolved = (0, _url().pathToFileURL)(real + (filePath.endsWith(_path().sep) ? "/" : ""));
        resolved.search = search;
        resolved.hash = hash;
      }
      return resolved;
    }
    function importNotDefined(specifier, packageJsonUrl, base) {
      return new ERR_PACKAGE_IMPORT_NOT_DEFINED(specifier, packageJsonUrl && (0, _url().fileURLToPath)(new (_url()).URL(".", packageJsonUrl)), (0, _url().fileURLToPath)(base));
    }
    function exportsNotFound(subpath, packageJsonUrl, base) {
      return new ERR_PACKAGE_PATH_NOT_EXPORTED((0, _url().fileURLToPath)(new (_url()).URL(".", packageJsonUrl)), subpath, base && (0, _url().fileURLToPath)(base));
    }
    function throwInvalidSubpath(request, match, packageJsonUrl, internal, base) {
      const reason = `request is not a valid match in pattern "${match}" for the "${internal ? "imports" : "exports"}" resolution of ${(0, _url().fileURLToPath)(packageJsonUrl)}`;
      throw new ERR_INVALID_MODULE_SPECIFIER(request, reason, base && (0, _url().fileURLToPath)(base));
    }
    function invalidPackageTarget(subpath, target, packageJsonUrl, internal, base) {
      target = typeof target === "object" && target !== null ? JSON.stringify(target, null, "") : `${target}`;
      return new ERR_INVALID_PACKAGE_TARGET((0, _url().fileURLToPath)(new (_url()).URL(".", packageJsonUrl)), subpath, target, internal, base && (0, _url().fileURLToPath)(base));
    }
    function resolvePackageTargetString(target, subpath, match, packageJsonUrl, base, pattern, internal, isPathMap, conditions) {
      if (subpath !== "" && !pattern && target[target.length - 1] !== "/") throw invalidPackageTarget(match, target, packageJsonUrl, internal, base);
      if (!target.startsWith("./")) {
        if (internal && !target.startsWith("../") && !target.startsWith("/")) {
          let isURL2 = false;
          try {
            new (_url()).URL(target);
            isURL2 = true;
          } catch (_unused3) {
          }
          if (!isURL2) {
            const exportTarget = pattern ? RegExpPrototypeSymbolReplace.call(patternRegEx, target, () => subpath) : target + subpath;
            return packageResolve(exportTarget, packageJsonUrl, conditions);
          }
        }
        throw invalidPackageTarget(match, target, packageJsonUrl, internal, base);
      }
      if (invalidSegmentRegEx.exec(target.slice(2)) !== null) {
        if (deprecatedInvalidSegmentRegEx.exec(target.slice(2)) === null) {
          if (!isPathMap) {
            const request = pattern ? match.replace("*", () => subpath) : match + subpath;
            const resolvedTarget = pattern ? RegExpPrototypeSymbolReplace.call(patternRegEx, target, () => subpath) : target;
            emitInvalidSegmentDeprecation(resolvedTarget, request, match, packageJsonUrl, internal, base, true);
          }
        } else {
          throw invalidPackageTarget(match, target, packageJsonUrl, internal, base);
        }
      }
      const resolved = new (_url()).URL(target, packageJsonUrl);
      const resolvedPath = resolved.pathname;
      const packagePath = new (_url()).URL(".", packageJsonUrl).pathname;
      if (!resolvedPath.startsWith(packagePath)) throw invalidPackageTarget(match, target, packageJsonUrl, internal, base);
      if (subpath === "") return resolved;
      if (invalidSegmentRegEx.exec(subpath) !== null) {
        const request = pattern ? match.replace("*", () => subpath) : match + subpath;
        if (deprecatedInvalidSegmentRegEx.exec(subpath) === null) {
          if (!isPathMap) {
            const resolvedTarget = pattern ? RegExpPrototypeSymbolReplace.call(patternRegEx, target, () => subpath) : target;
            emitInvalidSegmentDeprecation(resolvedTarget, request, match, packageJsonUrl, internal, base, false);
          }
        } else {
          throwInvalidSubpath(request, match, packageJsonUrl, internal, base);
        }
      }
      if (pattern) {
        return new (_url()).URL(RegExpPrototypeSymbolReplace.call(patternRegEx, resolved.href, () => subpath));
      }
      return new (_url()).URL(subpath, resolved);
    }
    function isArrayIndex(key) {
      const keyNumber = Number(key);
      if (`${keyNumber}` !== key) return false;
      return keyNumber >= 0 && keyNumber < 4294967295;
    }
    function resolvePackageTarget(packageJsonUrl, target, subpath, packageSubpath, base, pattern, internal, isPathMap, conditions) {
      if (typeof target === "string") {
        return resolvePackageTargetString(target, subpath, packageSubpath, packageJsonUrl, base, pattern, internal, isPathMap, conditions);
      }
      if (Array.isArray(target)) {
        const targetList = target;
        if (targetList.length === 0) return null;
        let lastException;
        let i = -1;
        while (++i < targetList.length) {
          const targetItem = targetList[i];
          let resolveResult;
          try {
            resolveResult = resolvePackageTarget(packageJsonUrl, targetItem, subpath, packageSubpath, base, pattern, internal, isPathMap, conditions);
          } catch (error) {
            const exception = error;
            lastException = exception;
            if (exception.code === "ERR_INVALID_PACKAGE_TARGET") continue;
            throw error;
          }
          if (resolveResult === void 0) continue;
          if (resolveResult === null) {
            lastException = null;
            continue;
          }
          return resolveResult;
        }
        if (lastException === void 0 || lastException === null) {
          return null;
        }
        throw lastException;
      }
      if (typeof target === "object" && target !== null) {
        const keys = Object.getOwnPropertyNames(target);
        let i = -1;
        while (++i < keys.length) {
          const key = keys[i];
          if (isArrayIndex(key)) {
            throw new ERR_INVALID_PACKAGE_CONFIG((0, _url().fileURLToPath)(packageJsonUrl), base, '"exports" cannot contain numeric property keys.');
          }
        }
        i = -1;
        while (++i < keys.length) {
          const key = keys[i];
          if (key === "default" || conditions && conditions.has(key)) {
            const conditionalTarget = target[key];
            const resolveResult = resolvePackageTarget(packageJsonUrl, conditionalTarget, subpath, packageSubpath, base, pattern, internal, isPathMap, conditions);
            if (resolveResult === void 0) continue;
            return resolveResult;
          }
        }
        return null;
      }
      if (target === null) {
        return null;
      }
      throw invalidPackageTarget(packageSubpath, target, packageJsonUrl, internal, base);
    }
    function isConditionalExportsMainSugar(exports3, packageJsonUrl, base) {
      if (typeof exports3 === "string" || Array.isArray(exports3)) return true;
      if (typeof exports3 !== "object" || exports3 === null) return false;
      const keys = Object.getOwnPropertyNames(exports3);
      let isConditionalSugar = false;
      let i = 0;
      let keyIndex = -1;
      while (++keyIndex < keys.length) {
        const key = keys[keyIndex];
        const currentIsConditionalSugar = key === "" || key[0] !== ".";
        if (i++ === 0) {
          isConditionalSugar = currentIsConditionalSugar;
        } else if (isConditionalSugar !== currentIsConditionalSugar) {
          throw new ERR_INVALID_PACKAGE_CONFIG((0, _url().fileURLToPath)(packageJsonUrl), base, `"exports" cannot contain some keys starting with '.' and some not. The exports object must either be an object of package subpath keys or an object of main entry condition name keys only.`);
        }
      }
      return isConditionalSugar;
    }
    function emitTrailingSlashPatternDeprecation(match, pjsonUrl, base) {
      if (_process().noDeprecation) {
        return;
      }
      const pjsonPath = (0, _url().fileURLToPath)(pjsonUrl);
      if (emittedPackageWarnings.has(pjsonPath + "|" + match)) return;
      emittedPackageWarnings.add(pjsonPath + "|" + match);
      _process().emitWarning(`Use of deprecated trailing slash pattern mapping "${match}" in the "exports" field module resolution of the package at ${pjsonPath}${base ? ` imported from ${(0, _url().fileURLToPath)(base)}` : ""}. Mapping specifiers ending in "/" is no longer supported.`, "DeprecationWarning", "DEP0155");
    }
    function packageExportsResolve(packageJsonUrl, packageSubpath, packageConfig, base, conditions) {
      let exports3 = packageConfig.exports;
      if (isConditionalExportsMainSugar(exports3, packageJsonUrl, base)) {
        exports3 = {
          ".": exports3
        };
      }
      if (own.call(exports3, packageSubpath) && !packageSubpath.includes("*") && !packageSubpath.endsWith("/")) {
        const target = exports3[packageSubpath];
        const resolveResult = resolvePackageTarget(packageJsonUrl, target, "", packageSubpath, base, false, false, false, conditions);
        if (resolveResult === null || resolveResult === void 0) {
          throw exportsNotFound(packageSubpath, packageJsonUrl, base);
        }
        return resolveResult;
      }
      let bestMatch = "";
      let bestMatchSubpath = "";
      const keys = Object.getOwnPropertyNames(exports3);
      let i = -1;
      while (++i < keys.length) {
        const key = keys[i];
        const patternIndex = key.indexOf("*");
        if (patternIndex !== -1 && packageSubpath.startsWith(key.slice(0, patternIndex))) {
          if (packageSubpath.endsWith("/")) {
            emitTrailingSlashPatternDeprecation(packageSubpath, packageJsonUrl, base);
          }
          const patternTrailer = key.slice(patternIndex + 1);
          if (packageSubpath.length >= key.length && packageSubpath.endsWith(patternTrailer) && patternKeyCompare(bestMatch, key) === 1 && key.lastIndexOf("*") === patternIndex) {
            bestMatch = key;
            bestMatchSubpath = packageSubpath.slice(patternIndex, packageSubpath.length - patternTrailer.length);
          }
        }
      }
      if (bestMatch) {
        const target = exports3[bestMatch];
        const resolveResult = resolvePackageTarget(packageJsonUrl, target, bestMatchSubpath, bestMatch, base, true, false, packageSubpath.endsWith("/"), conditions);
        if (resolveResult === null || resolveResult === void 0) {
          throw exportsNotFound(packageSubpath, packageJsonUrl, base);
        }
        return resolveResult;
      }
      throw exportsNotFound(packageSubpath, packageJsonUrl, base);
    }
    function patternKeyCompare(a, b) {
      const aPatternIndex = a.indexOf("*");
      const bPatternIndex = b.indexOf("*");
      const baseLengthA = aPatternIndex === -1 ? a.length : aPatternIndex + 1;
      const baseLengthB = bPatternIndex === -1 ? b.length : bPatternIndex + 1;
      if (baseLengthA > baseLengthB) return -1;
      if (baseLengthB > baseLengthA) return 1;
      if (aPatternIndex === -1) return 1;
      if (bPatternIndex === -1) return -1;
      if (a.length > b.length) return -1;
      if (b.length > a.length) return 1;
      return 0;
    }
    function packageImportsResolve(name, base, conditions) {
      if (name === "#" || name.startsWith("#/") || name.endsWith("/")) {
        const reason = "is not a valid internal imports specifier name";
        throw new ERR_INVALID_MODULE_SPECIFIER(name, reason, (0, _url().fileURLToPath)(base));
      }
      let packageJsonUrl;
      const packageConfig = getPackageScopeConfig(base);
      if (packageConfig.exists) {
        packageJsonUrl = (0, _url().pathToFileURL)(packageConfig.pjsonPath);
        const imports = packageConfig.imports;
        if (imports) {
          if (own.call(imports, name) && !name.includes("*")) {
            const resolveResult = resolvePackageTarget(packageJsonUrl, imports[name], "", name, base, false, true, false, conditions);
            if (resolveResult !== null && resolveResult !== void 0) {
              return resolveResult;
            }
          } else {
            let bestMatch = "";
            let bestMatchSubpath = "";
            const keys = Object.getOwnPropertyNames(imports);
            let i = -1;
            while (++i < keys.length) {
              const key = keys[i];
              const patternIndex = key.indexOf("*");
              if (patternIndex !== -1 && name.startsWith(key.slice(0, -1))) {
                const patternTrailer = key.slice(patternIndex + 1);
                if (name.length >= key.length && name.endsWith(patternTrailer) && patternKeyCompare(bestMatch, key) === 1 && key.lastIndexOf("*") === patternIndex) {
                  bestMatch = key;
                  bestMatchSubpath = name.slice(patternIndex, name.length - patternTrailer.length);
                }
              }
            }
            if (bestMatch) {
              const target = imports[bestMatch];
              const resolveResult = resolvePackageTarget(packageJsonUrl, target, bestMatchSubpath, bestMatch, base, true, true, false, conditions);
              if (resolveResult !== null && resolveResult !== void 0) {
                return resolveResult;
              }
            }
          }
        }
      }
      throw importNotDefined(name, packageJsonUrl, base);
    }
    function parsePackageName(specifier, base) {
      let separatorIndex = specifier.indexOf("/");
      let validPackageName = true;
      let isScoped = false;
      if (specifier[0] === "@") {
        isScoped = true;
        if (separatorIndex === -1 || specifier.length === 0) {
          validPackageName = false;
        } else {
          separatorIndex = specifier.indexOf("/", separatorIndex + 1);
        }
      }
      const packageName = separatorIndex === -1 ? specifier : specifier.slice(0, separatorIndex);
      if (invalidPackageNameRegEx.exec(packageName) !== null) {
        validPackageName = false;
      }
      if (!validPackageName) {
        throw new ERR_INVALID_MODULE_SPECIFIER(specifier, "is not a valid package name", (0, _url().fileURLToPath)(base));
      }
      const packageSubpath = "." + (separatorIndex === -1 ? "" : specifier.slice(separatorIndex));
      return {
        packageName,
        packageSubpath,
        isScoped
      };
    }
    function packageResolve(specifier, base, conditions) {
      if (_module().builtinModules.includes(specifier)) {
        return new (_url()).URL("node:" + specifier);
      }
      const {
        packageName,
        packageSubpath,
        isScoped
      } = parsePackageName(specifier, base);
      const packageConfig = getPackageScopeConfig(base);
      if (packageConfig.exists) {
        const packageJsonUrl2 = (0, _url().pathToFileURL)(packageConfig.pjsonPath);
        if (packageConfig.name === packageName && packageConfig.exports !== void 0 && packageConfig.exports !== null) {
          return packageExportsResolve(packageJsonUrl2, packageSubpath, packageConfig, base, conditions);
        }
      }
      let packageJsonUrl = new (_url()).URL("./node_modules/" + packageName + "/package.json", base);
      let packageJsonPath = (0, _url().fileURLToPath)(packageJsonUrl);
      let lastPath;
      do {
        const stat = tryStatSync(packageJsonPath.slice(0, -13));
        if (!stat || !stat.isDirectory()) {
          lastPath = packageJsonPath;
          packageJsonUrl = new (_url()).URL((isScoped ? "../../../../node_modules/" : "../../../node_modules/") + packageName + "/package.json", packageJsonUrl);
          packageJsonPath = (0, _url().fileURLToPath)(packageJsonUrl);
          continue;
        }
        const packageConfig2 = read(packageJsonPath, {
          base,
          specifier
        });
        if (packageConfig2.exports !== void 0 && packageConfig2.exports !== null) {
          return packageExportsResolve(packageJsonUrl, packageSubpath, packageConfig2, base, conditions);
        }
        if (packageSubpath === ".") {
          return legacyMainResolve(packageJsonUrl, packageConfig2, base);
        }
        return new (_url()).URL(packageSubpath, packageJsonUrl);
      } while (packageJsonPath.length !== lastPath.length);
      throw new ERR_MODULE_NOT_FOUND(packageName, (0, _url().fileURLToPath)(base), false);
    }
    function isRelativeSpecifier(specifier) {
      if (specifier[0] === ".") {
        if (specifier.length === 1 || specifier[1] === "/") return true;
        if (specifier[1] === "." && (specifier.length === 2 || specifier[2] === "/")) {
          return true;
        }
      }
      return false;
    }
    function shouldBeTreatedAsRelativeOrAbsolutePath(specifier) {
      if (specifier === "") return false;
      if (specifier[0] === "/") return true;
      return isRelativeSpecifier(specifier);
    }
    function moduleResolve(specifier, base, conditions, preserveSymlinks) {
      const protocol = base.protocol;
      const isData = protocol === "data:";
      const isRemote = isData || protocol === "http:" || protocol === "https:";
      let resolved;
      if (shouldBeTreatedAsRelativeOrAbsolutePath(specifier)) {
        try {
          resolved = new (_url()).URL(specifier, base);
        } catch (error_) {
          const error = new ERR_UNSUPPORTED_RESOLVE_REQUEST(specifier, base);
          error.cause = error_;
          throw error;
        }
      } else if (protocol === "file:" && specifier[0] === "#") {
        resolved = packageImportsResolve(specifier, base, conditions);
      } else {
        try {
          resolved = new (_url()).URL(specifier);
        } catch (error_) {
          if (isRemote && !_module().builtinModules.includes(specifier)) {
            const error = new ERR_UNSUPPORTED_RESOLVE_REQUEST(specifier, base);
            error.cause = error_;
            throw error;
          }
          resolved = packageResolve(specifier, base, conditions);
        }
      }
      _assert()(resolved !== void 0, "expected to be defined");
      if (resolved.protocol !== "file:") {
        return resolved;
      }
      return finalizeResolution(resolved, base, preserveSymlinks);
    }
    function checkIfDisallowedImport(specifier, parsed, parsedParentURL) {
      if (parsedParentURL) {
        const parentProtocol = parsedParentURL.protocol;
        if (parentProtocol === "http:" || parentProtocol === "https:") {
          if (shouldBeTreatedAsRelativeOrAbsolutePath(specifier)) {
            const parsedProtocol = parsed == null ? void 0 : parsed.protocol;
            if (parsedProtocol && parsedProtocol !== "https:" && parsedProtocol !== "http:") {
              throw new ERR_NETWORK_IMPORT_DISALLOWED(specifier, parsedParentURL, "remote imports cannot import from a local location.");
            }
            return {
              url: (parsed == null ? void 0 : parsed.href) || ""
            };
          }
          if (_module().builtinModules.includes(specifier)) {
            throw new ERR_NETWORK_IMPORT_DISALLOWED(specifier, parsedParentURL, "remote imports cannot import from a local location.");
          }
          throw new ERR_NETWORK_IMPORT_DISALLOWED(specifier, parsedParentURL, "only relative and absolute specifiers are supported.");
        }
      }
    }
    function isURL(self2) {
      return Boolean(self2 && typeof self2 === "object" && "href" in self2 && typeof self2.href === "string" && "protocol" in self2 && typeof self2.protocol === "string" && self2.href && self2.protocol);
    }
    function throwIfInvalidParentURL(parentURL) {
      if (parentURL === void 0) {
        return;
      }
      if (typeof parentURL !== "string" && !isURL(parentURL)) {
        throw new codes.ERR_INVALID_ARG_TYPE("parentURL", ["string", "URL"], parentURL);
      }
    }
    function defaultResolve(specifier, context = {}) {
      const {
        parentURL
      } = context;
      _assert()(parentURL !== void 0, "expected `parentURL` to be defined");
      throwIfInvalidParentURL(parentURL);
      let parsedParentURL;
      if (parentURL) {
        try {
          parsedParentURL = new (_url()).URL(parentURL);
        } catch (_unused4) {
        }
      }
      let parsed;
      let protocol;
      try {
        parsed = shouldBeTreatedAsRelativeOrAbsolutePath(specifier) ? new (_url()).URL(specifier, parsedParentURL) : new (_url()).URL(specifier);
        protocol = parsed.protocol;
        if (protocol === "data:") {
          return {
            url: parsed.href,
            format: null
          };
        }
      } catch (_unused5) {
      }
      const maybeReturn = checkIfDisallowedImport(specifier, parsed, parsedParentURL);
      if (maybeReturn) return maybeReturn;
      if (protocol === void 0 && parsed) {
        protocol = parsed.protocol;
      }
      if (protocol === "node:") {
        return {
          url: specifier
        };
      }
      if (parsed && parsed.protocol === "node:") return {
        url: specifier
      };
      const conditions = getConditionsSet(context.conditions);
      const url = moduleResolve(specifier, new (_url()).URL(parentURL), conditions, false);
      return {
        url: url.href,
        format: defaultGetFormatWithoutErrors(url, {
          parentURL
        })
      };
    }
    function resolve(specifier, parent) {
      if (!parent) {
        throw new Error("Please pass `parent`: `import-meta-resolve` cannot ponyfill that");
      }
      try {
        return defaultResolve(specifier, {
          parentURL: parent
        }).url;
      } catch (error) {
        const exception = error;
        if ((exception.code === "ERR_UNSUPPORTED_DIR_IMPORT" || exception.code === "ERR_MODULE_NOT_FOUND") && typeof exception.url === "string") {
          return exception.url;
        }
        throw error;
      }
    }
  }
});

// node_modules/@babel/core/lib/config/files/plugins.js
var require_plugins4 = __commonJS({
  "node_modules/@babel/core/lib/config/files/plugins.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.loadPlugin = loadPlugin;
    exports2.loadPreset = loadPreset;
    exports2.resolvePreset = exports2.resolvePlugin = void 0;
    function _debug() {
      const data = require_src();
      _debug = function() {
        return data;
      };
      return data;
    }
    function _path() {
      const data = require("path");
      _path = function() {
        return data;
      };
      return data;
    }
    var _async = require_async();
    var _moduleTypes = require_module_types();
    function _url() {
      const data = require("url");
      _url = function() {
        return data;
      };
      return data;
    }
    var _importMetaResolve = require_import_meta_resolve();
    require("module");
    function _fs() {
      const data = require("fs");
      _fs = function() {
        return data;
      };
      return data;
    }
    var debug = _debug()("babel:config:loading:files:plugins");
    var EXACT_RE = /^module:/;
    var BABEL_PLUGIN_PREFIX_RE = /^(?!@|module:|[^/]+\/|babel-plugin-)/;
    var BABEL_PRESET_PREFIX_RE = /^(?!@|module:|[^/]+\/|babel-preset-)/;
    var BABEL_PLUGIN_ORG_RE = /^(@babel\/)(?!plugin-|[^/]+\/)/;
    var BABEL_PRESET_ORG_RE = /^(@babel\/)(?!preset-|[^/]+\/)/;
    var OTHER_PLUGIN_ORG_RE = /^(@(?!babel\/)[^/]+\/)(?![^/]*babel-plugin(?:-|\/|$)|[^/]+\/)/;
    var OTHER_PRESET_ORG_RE = /^(@(?!babel\/)[^/]+\/)(?![^/]*babel-preset(?:-|\/|$)|[^/]+\/)/;
    var OTHER_ORG_DEFAULT_RE = /^(@(?!babel$)[^/]+)$/;
    var resolvePlugin = exports2.resolvePlugin = resolveStandardizedName.bind(null, "plugin");
    var resolvePreset = exports2.resolvePreset = resolveStandardizedName.bind(null, "preset");
    function* loadPlugin(name, dirname) {
      const {
        filepath,
        loader
      } = resolvePlugin(name, dirname, yield* (0, _async.isAsync)());
      const value2 = yield* requireModule("plugin", loader, filepath);
      debug("Loaded plugin %o from %o.", name, dirname);
      return {
        filepath,
        value: value2
      };
    }
    function* loadPreset(name, dirname) {
      const {
        filepath,
        loader
      } = resolvePreset(name, dirname, yield* (0, _async.isAsync)());
      const value2 = yield* requireModule("preset", loader, filepath);
      debug("Loaded preset %o from %o.", name, dirname);
      return {
        filepath,
        value: value2
      };
    }
    function standardizeName(type, name) {
      if (_path().isAbsolute(name)) return name;
      const isPreset = type === "preset";
      return name.replace(isPreset ? BABEL_PRESET_PREFIX_RE : BABEL_PLUGIN_PREFIX_RE, `babel-${type}-`).replace(isPreset ? BABEL_PRESET_ORG_RE : BABEL_PLUGIN_ORG_RE, `$1${type}-`).replace(isPreset ? OTHER_PRESET_ORG_RE : OTHER_PLUGIN_ORG_RE, `$1babel-${type}-`).replace(OTHER_ORG_DEFAULT_RE, `$1/babel-${type}`).replace(EXACT_RE, "");
    }
    function* resolveAlternativesHelper(type, name) {
      const standardizedName = standardizeName(type, name);
      const {
        error,
        value: value2
      } = yield standardizedName;
      if (!error) return value2;
      if (error.code !== "MODULE_NOT_FOUND") throw error;
      if (standardizedName !== name && !(yield name).error) {
        error.message += `
- If you want to resolve "${name}", use "module:${name}"`;
      }
      if (!(yield standardizeName(type, "@babel/" + name)).error) {
        error.message += `
- Did you mean "@babel/${name}"?`;
      }
      const oppositeType = type === "preset" ? "plugin" : "preset";
      if (!(yield standardizeName(oppositeType, name)).error) {
        error.message += `
- Did you accidentally pass a ${oppositeType} as a ${type}?`;
      }
      if (type === "plugin") {
        const transformName = standardizedName.replace("-proposal-", "-transform-");
        if (transformName !== standardizedName && !(yield transformName).error) {
          error.message += `
- Did you mean "${transformName}"?`;
        }
      }
      error.message += `

Make sure that all the Babel plugins and presets you are using
are defined as dependencies or devDependencies in your package.json
file. It's possible that the missing plugin is loaded by a preset
you are using that forgot to add the plugin to its dependencies: you
can workaround this problem by explicitly adding the missing package
to your top-level package.json.
`;
      throw error;
    }
    function tryRequireResolve(id, dirname) {
      try {
        if (dirname) {
          return {
            error: null,
            value: (((v, w) => (v = v.split("."), w = w.split("."), +v[0] > +w[0] || v[0] == w[0] && +v[1] >= +w[1]))(process.versions.node, "8.9") ? require.resolve : (r, {
              paths: [b]
            }, M = require("module")) => {
              let f = M._findPath(r, M._nodeModulePaths(b).concat(b));
              if (f) return f;
              f = new Error(`Cannot resolve module '${r}'`);
              f.code = "MODULE_NOT_FOUND";
              throw f;
            })(id, {
              paths: [dirname]
            })
          };
        } else {
          return {
            error: null,
            value: require.resolve(id)
          };
        }
      } catch (error) {
        return {
          error,
          value: null
        };
      }
    }
    function tryImportMetaResolve(id, options) {
      try {
        return {
          error: null,
          value: (0, _importMetaResolve.resolve)(id, options)
        };
      } catch (error) {
        return {
          error,
          value: null
        };
      }
    }
    function resolveStandardizedNameForRequire(type, name, dirname) {
      const it = resolveAlternativesHelper(type, name);
      let res = it.next();
      while (!res.done) {
        res = it.next(tryRequireResolve(res.value, dirname));
      }
      return {
        loader: "require",
        filepath: res.value
      };
    }
    function resolveStandardizedNameForImport(type, name, dirname) {
      const parentUrl = (0, _url().pathToFileURL)(_path().join(dirname, "./babel-virtual-resolve-base.js")).href;
      const it = resolveAlternativesHelper(type, name);
      let res = it.next();
      while (!res.done) {
        res = it.next(tryImportMetaResolve(res.value, parentUrl));
      }
      return {
        loader: "auto",
        filepath: (0, _url().fileURLToPath)(res.value)
      };
    }
    function resolveStandardizedName(type, name, dirname, allowAsync) {
      if (!_moduleTypes.supportsESM || !allowAsync) {
        return resolveStandardizedNameForRequire(type, name, dirname);
      }
      try {
        const resolved = resolveStandardizedNameForImport(type, name, dirname);
        if (!(0, _fs().existsSync)(resolved.filepath)) {
          throw Object.assign(new Error(`Could not resolve "${name}" in file ${dirname}.`), {
            type: "MODULE_NOT_FOUND"
          });
        }
        return resolved;
      } catch (e) {
        try {
          return resolveStandardizedNameForRequire(type, name, dirname);
        } catch (e2) {
          if (e.type === "MODULE_NOT_FOUND") throw e;
          if (e2.type === "MODULE_NOT_FOUND") throw e2;
          throw e;
        }
      }
    }
    {
      LOADING_MODULES = /* @__PURE__ */ new Set();
    }
    var LOADING_MODULES;
    function* requireModule(type, loader, name) {
      {
        if (!(yield* (0, _async.isAsync)()) && LOADING_MODULES.has(name)) {
          throw new Error(`Reentrant ${type} detected trying to load "${name}". This module is not ignored and is trying to load itself while compiling itself, leading to a dependency cycle. We recommend adding it to your "ignore" list in your babelrc, or to a .babelignore.`);
        }
      }
      try {
        {
          LOADING_MODULES.add(name);
        }
        {
          return yield* (0, _moduleTypes.default)(name, loader, `You appear to be using a native ECMAScript module ${type}, which is only supported when running Babel asynchronously or when using the Node.js \`--experimental-require-module\` flag.`, `You appear to be using a ${type} that contains top-level await, which is only supported when running Babel asynchronously.`, true);
        }
      } catch (err) {
        err.message = `[BABEL]: ${err.message} (While processing: ${name})`;
        throw err;
      } finally {
        {
          LOADING_MODULES.delete(name);
        }
      }
    }
  }
});

// node_modules/@babel/core/lib/config/files/index.js
var require_files = __commonJS({
  "node_modules/@babel/core/lib/config/files/index.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    Object.defineProperty(exports2, "ROOT_CONFIG_FILENAMES", {
      enumerable: true,
      get: function() {
        return _configuration.ROOT_CONFIG_FILENAMES;
      }
    });
    Object.defineProperty(exports2, "findConfigUpwards", {
      enumerable: true,
      get: function() {
        return _configuration.findConfigUpwards;
      }
    });
    Object.defineProperty(exports2, "findPackageData", {
      enumerable: true,
      get: function() {
        return _package.findPackageData;
      }
    });
    Object.defineProperty(exports2, "findRelativeConfig", {
      enumerable: true,
      get: function() {
        return _configuration.findRelativeConfig;
      }
    });
    Object.defineProperty(exports2, "findRootConfig", {
      enumerable: true,
      get: function() {
        return _configuration.findRootConfig;
      }
    });
    Object.defineProperty(exports2, "loadConfig", {
      enumerable: true,
      get: function() {
        return _configuration.loadConfig;
      }
    });
    Object.defineProperty(exports2, "loadPlugin", {
      enumerable: true,
      get: function() {
        return _plugins.loadPlugin;
      }
    });
    Object.defineProperty(exports2, "loadPreset", {
      enumerable: true,
      get: function() {
        return _plugins.loadPreset;
      }
    });
    Object.defineProperty(exports2, "resolvePlugin", {
      enumerable: true,
      get: function() {
        return _plugins.resolvePlugin;
      }
    });
    Object.defineProperty(exports2, "resolvePreset", {
      enumerable: true,
      get: function() {
        return _plugins.resolvePreset;
      }
    });
    Object.defineProperty(exports2, "resolveShowConfigPath", {
      enumerable: true,
      get: function() {
        return _configuration.resolveShowConfigPath;
      }
    });
    var _package = require_package();
    var _configuration = require_configuration();
    var _plugins = require_plugins4();
  }
});

// node_modules/@babel/core/lib/transform.js
var require_transform = __commonJS({
  "node_modules/@babel/core/lib/transform.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.transform = void 0;
    exports2.transformAsync = transformAsync;
    exports2.transformSync = transformSync;
    function _gensync() {
      const data = require_gensync();
      _gensync = function() {
        return data;
      };
      return data;
    }
    var _index = require_config();
    var _index2 = require_transformation();
    var _rewriteStackTrace = require_rewrite_stack_trace();
    var transformRunner = _gensync()(function* transform3(code, opts) {
      const config = yield* (0, _index.default)(opts);
      if (config === null) return null;
      return yield* (0, _index2.run)(config, code);
    });
    var transform2 = exports2.transform = function transform3(code, optsOrCallback, maybeCallback) {
      let opts;
      let callback;
      if (typeof optsOrCallback === "function") {
        callback = optsOrCallback;
        opts = void 0;
      } else {
        opts = optsOrCallback;
        callback = maybeCallback;
      }
      if (callback === void 0) {
        {
          return (0, _rewriteStackTrace.beginHiddenCallStack)(transformRunner.sync)(code, opts);
        }
      }
      (0, _rewriteStackTrace.beginHiddenCallStack)(transformRunner.errback)(code, opts, callback);
    };
    function transformSync(...args) {
      return (0, _rewriteStackTrace.beginHiddenCallStack)(transformRunner.sync)(...args);
    }
    function transformAsync(...args) {
      return (0, _rewriteStackTrace.beginHiddenCallStack)(transformRunner.async)(...args);
    }
  }
});

// node_modules/@babel/core/lib/transform-ast.js
var require_transform_ast = __commonJS({
  "node_modules/@babel/core/lib/transform-ast.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.transformFromAst = void 0;
    exports2.transformFromAstAsync = transformFromAstAsync;
    exports2.transformFromAstSync = transformFromAstSync;
    function _gensync() {
      const data = require_gensync();
      _gensync = function() {
        return data;
      };
      return data;
    }
    var _index = require_config();
    var _index2 = require_transformation();
    var _rewriteStackTrace = require_rewrite_stack_trace();
    var transformFromAstRunner = _gensync()(function* (ast, code, opts) {
      const config = yield* (0, _index.default)(opts);
      if (config === null) return null;
      if (!ast) throw new Error("No AST given");
      return yield* (0, _index2.run)(config, code, ast);
    });
    var transformFromAst = exports2.transformFromAst = function transformFromAst2(ast, code, optsOrCallback, maybeCallback) {
      let opts;
      let callback;
      if (typeof optsOrCallback === "function") {
        callback = optsOrCallback;
        opts = void 0;
      } else {
        opts = optsOrCallback;
        callback = maybeCallback;
      }
      if (callback === void 0) {
        {
          return (0, _rewriteStackTrace.beginHiddenCallStack)(transformFromAstRunner.sync)(ast, code, opts);
        }
      }
      (0, _rewriteStackTrace.beginHiddenCallStack)(transformFromAstRunner.errback)(ast, code, opts, callback);
    };
    function transformFromAstSync(...args) {
      return (0, _rewriteStackTrace.beginHiddenCallStack)(transformFromAstRunner.sync)(...args);
    }
    function transformFromAstAsync(...args) {
      return (0, _rewriteStackTrace.beginHiddenCallStack)(transformFromAstRunner.async)(...args);
    }
  }
});

// node_modules/@babel/core/lib/parse.js
var require_parse4 = __commonJS({
  "node_modules/@babel/core/lib/parse.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.parse = void 0;
    exports2.parseAsync = parseAsync;
    exports2.parseSync = parseSync;
    function _gensync() {
      const data = require_gensync();
      _gensync = function() {
        return data;
      };
      return data;
    }
    var _index = require_config();
    var _index2 = require_parser();
    var _normalizeOpts = require_normalize_opts();
    var _rewriteStackTrace = require_rewrite_stack_trace();
    var parseRunner = _gensync()(function* parse3(code, opts) {
      const config = yield* (0, _index.default)(opts);
      if (config === null) {
        return null;
      }
      return yield* (0, _index2.default)(config.passes, (0, _normalizeOpts.default)(config), code);
    });
    var parse2 = exports2.parse = function parse3(code, opts, callback) {
      if (typeof opts === "function") {
        callback = opts;
        opts = void 0;
      }
      if (callback === void 0) {
        {
          return (0, _rewriteStackTrace.beginHiddenCallStack)(parseRunner.sync)(code, opts);
        }
      }
      (0, _rewriteStackTrace.beginHiddenCallStack)(parseRunner.errback)(code, opts, callback);
    };
    function parseSync(...args) {
      return (0, _rewriteStackTrace.beginHiddenCallStack)(parseRunner.sync)(...args);
    }
    function parseAsync(...args) {
      return (0, _rewriteStackTrace.beginHiddenCallStack)(parseRunner.async)(...args);
    }
  }
});

// node_modules/@babel/core/lib/index.js
var require_lib27 = __commonJS({
  "node_modules/@babel/core/lib/index.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.DEFAULT_EXTENSIONS = void 0;
    Object.defineProperty(exports2, "File", {
      enumerable: true,
      get: function() {
        return _file.default;
      }
    });
    Object.defineProperty(exports2, "buildExternalHelpers", {
      enumerable: true,
      get: function() {
        return _buildExternalHelpers.default;
      }
    });
    Object.defineProperty(exports2, "createConfigItem", {
      enumerable: true,
      get: function() {
        return _index2.createConfigItem;
      }
    });
    Object.defineProperty(exports2, "createConfigItemAsync", {
      enumerable: true,
      get: function() {
        return _index2.createConfigItemAsync;
      }
    });
    Object.defineProperty(exports2, "createConfigItemSync", {
      enumerable: true,
      get: function() {
        return _index2.createConfigItemSync;
      }
    });
    Object.defineProperty(exports2, "getEnv", {
      enumerable: true,
      get: function() {
        return _environment.getEnv;
      }
    });
    Object.defineProperty(exports2, "loadOptions", {
      enumerable: true,
      get: function() {
        return _index2.loadOptions;
      }
    });
    Object.defineProperty(exports2, "loadOptionsAsync", {
      enumerable: true,
      get: function() {
        return _index2.loadOptionsAsync;
      }
    });
    Object.defineProperty(exports2, "loadOptionsSync", {
      enumerable: true,
      get: function() {
        return _index2.loadOptionsSync;
      }
    });
    Object.defineProperty(exports2, "loadPartialConfig", {
      enumerable: true,
      get: function() {
        return _index2.loadPartialConfig;
      }
    });
    Object.defineProperty(exports2, "loadPartialConfigAsync", {
      enumerable: true,
      get: function() {
        return _index2.loadPartialConfigAsync;
      }
    });
    Object.defineProperty(exports2, "loadPartialConfigSync", {
      enumerable: true,
      get: function() {
        return _index2.loadPartialConfigSync;
      }
    });
    Object.defineProperty(exports2, "parse", {
      enumerable: true,
      get: function() {
        return _parse.parse;
      }
    });
    Object.defineProperty(exports2, "parseAsync", {
      enumerable: true,
      get: function() {
        return _parse.parseAsync;
      }
    });
    Object.defineProperty(exports2, "parseSync", {
      enumerable: true,
      get: function() {
        return _parse.parseSync;
      }
    });
    exports2.resolvePreset = exports2.resolvePlugin = void 0;
    Object.defineProperty((0, exports2), "template", {
      enumerable: true,
      get: function() {
        return _template().default;
      }
    });
    Object.defineProperty((0, exports2), "tokTypes", {
      enumerable: true,
      get: function() {
        return _parser().tokTypes;
      }
    });
    Object.defineProperty(exports2, "transform", {
      enumerable: true,
      get: function() {
        return _transform.transform;
      }
    });
    Object.defineProperty(exports2, "transformAsync", {
      enumerable: true,
      get: function() {
        return _transform.transformAsync;
      }
    });
    Object.defineProperty(exports2, "transformFile", {
      enumerable: true,
      get: function() {
        return _transformFile.transformFile;
      }
    });
    Object.defineProperty(exports2, "transformFileAsync", {
      enumerable: true,
      get: function() {
        return _transformFile.transformFileAsync;
      }
    });
    Object.defineProperty(exports2, "transformFileSync", {
      enumerable: true,
      get: function() {
        return _transformFile.transformFileSync;
      }
    });
    Object.defineProperty(exports2, "transformFromAst", {
      enumerable: true,
      get: function() {
        return _transformAst.transformFromAst;
      }
    });
    Object.defineProperty(exports2, "transformFromAstAsync", {
      enumerable: true,
      get: function() {
        return _transformAst.transformFromAstAsync;
      }
    });
    Object.defineProperty(exports2, "transformFromAstSync", {
      enumerable: true,
      get: function() {
        return _transformAst.transformFromAstSync;
      }
    });
    Object.defineProperty(exports2, "transformSync", {
      enumerable: true,
      get: function() {
        return _transform.transformSync;
      }
    });
    Object.defineProperty((0, exports2), "traverse", {
      enumerable: true,
      get: function() {
        return _traverse().default;
      }
    });
    exports2.version = exports2.types = void 0;
    var _file = require_file();
    var _buildExternalHelpers = require_build_external_helpers();
    var resolvers = require_files();
    var _environment = require_environment();
    function _types() {
      const data = require_lib3();
      _types = function() {
        return data;
      };
      return data;
    }
    Object.defineProperty((0, exports2), "types", {
      enumerable: true,
      get: function() {
        return _types();
      }
    });
    function _parser() {
      const data = require_lib4();
      _parser = function() {
        return data;
      };
      return data;
    }
    function _traverse() {
      const data = require_lib9();
      _traverse = function() {
        return data;
      };
      return data;
    }
    function _template() {
      const data = require_lib6();
      _template = function() {
        return data;
      };
      return data;
    }
    var _index2 = require_config();
    var _transform = require_transform();
    var _transformFile = require_transform_file();
    var _transformAst = require_transform_ast();
    var _parse = require_parse4();
    var version = exports2.version = "7.28.3";
    var resolvePlugin = (name, dirname) => resolvers.resolvePlugin(name, dirname, false).filepath;
    exports2.resolvePlugin = resolvePlugin;
    var resolvePreset = (name, dirname) => resolvers.resolvePreset(name, dirname, false).filepath;
    exports2.resolvePreset = resolvePreset;
    var DEFAULT_EXTENSIONS = exports2.DEFAULT_EXTENSIONS = Object.freeze([".js", ".jsx", ".es6", ".es", ".mjs", ".cjs"]);
    {
      exports2.OptionManager = class OptionManager {
        init(opts) {
          return (0, _index2.loadOptionsSync)(opts);
        }
      };
      exports2.Plugin = function Plugin(alias) {
        throw new Error(`The (${alias}) Babel 5 plugin is being run with an unsupported Babel version.`);
      };
    }
  }
});

// node_modules/@babel/plugin-syntax-import-attributes/lib/index.js
var require_lib28 = __commonJS({
  "node_modules/@babel/plugin-syntax-import-attributes/lib/index.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = void 0;
    var _helperPluginUtils = require_lib15();
    var _default = exports2.default = (0, _helperPluginUtils.declare)((api, {
      deprecatedAssertSyntax
    }) => {
      api.assertVersion("^7.22.0 || ^8.0.0-0");
      if (deprecatedAssertSyntax != null && typeof deprecatedAssertSyntax !== "boolean") {
        throw new Error("'deprecatedAssertSyntax' must be a boolean, if specified.");
      }
      return {
        name: "syntax-import-attributes",
        manipulateOptions({
          parserOpts,
          generatorOpts
        }) {
          var _generatorOpts$import;
          (_generatorOpts$import = generatorOpts.importAttributesKeyword) != null ? _generatorOpts$import : generatorOpts.importAttributesKeyword = "with";
          const importAssertionsPluginIndex = parserOpts.plugins.indexOf("importAssertions");
          if (importAssertionsPluginIndex !== -1) {
            parserOpts.plugins.splice(importAssertionsPluginIndex, 1);
            deprecatedAssertSyntax = true;
          }
          if (deprecatedAssertSyntax) {
            parserOpts.plugins.push("deprecatedImportAssert", ["importAttributes", {
              deprecatedAssertSyntax: true
            }]);
          } else {
            parserOpts.plugins.push("importAttributes");
          }
        }
      };
    });
  }
});

// node_modules/@babel/plugin-syntax-decorators/lib/index.js
var require_lib29 = __commonJS({
  "node_modules/@babel/plugin-syntax-decorators/lib/index.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = void 0;
    var _helperPluginUtils = require_lib15();
    var _default = exports2.default = (0, _helperPluginUtils.declare)((api, options) => {
      api.assertVersion("^7.0.0-0 || ^8.0.0-0 || >8.0.0-alpha <8.0.0-beta");
      let {
        version
      } = options;
      const {
        legacy
      } = options;
      if (legacy !== void 0) {
        if (typeof legacy !== "boolean") {
          throw new Error(".legacy must be a boolean.");
        }
        if (version !== void 0) {
          throw new Error("You can either use the .legacy or the .version option, not both.");
        }
      }
      if (version === void 0) {
        version = legacy ? "legacy" : "2018-09";
      } else if (version !== "2023-11" && version !== "2023-05" && version !== "2023-01" && version !== "2022-03" && version !== "2021-12" && version !== "2018-09" && version !== "legacy") {
        throw new Error("Unsupported decorators version: " + version);
      }
      var {
        decoratorsBeforeExport
      } = options;
      if (decoratorsBeforeExport === void 0) {
        if (version === "2021-12" || version === "2022-03") {
          decoratorsBeforeExport = false;
        } else if (version === "2018-09") {
          throw new Error("The decorators plugin, when .version is '2018-09' or not specified, requires a 'decoratorsBeforeExport' option, whose value must be a boolean.");
        }
      } else {
        if (version === "legacy" || version === "2022-03" || version === "2023-01") {
          throw new Error(`'decoratorsBeforeExport' can't be used with ${version} decorators.`);
        }
        if (typeof decoratorsBeforeExport !== "boolean") {
          throw new Error("'decoratorsBeforeExport' must be a boolean.");
        }
      }
      return {
        name: "syntax-decorators",
        manipulateOptions({
          generatorOpts
        }, parserOpts) {
          if (version === "legacy") {
            parserOpts.plugins.push("decorators-legacy");
          } else {
            if (version === "2023-01" || version === "2023-05" || version === "2023-11") {
              parserOpts.plugins.push(["decorators", {
                allowCallParenthesized: false
              }], "decoratorAutoAccessors");
            } else if (version === "2022-03") {
              parserOpts.plugins.push(["decorators", {
                decoratorsBeforeExport: false,
                allowCallParenthesized: false
              }], "decoratorAutoAccessors");
            } else if (version === "2021-12") {
              parserOpts.plugins.push(["decorators", {
                decoratorsBeforeExport
              }], "decoratorAutoAccessors");
              generatorOpts.decoratorsBeforeExport = decoratorsBeforeExport;
            } else if (version === "2018-09") {
              parserOpts.plugins.push(["decorators", {
                decoratorsBeforeExport
              }]);
              generatorOpts.decoratorsBeforeExport = decoratorsBeforeExport;
            }
          }
        }
      };
    });
  }
});

// node_modules/@babel/plugin-proposal-decorators/lib/transformer-legacy.js
var require_transformer_legacy = __commonJS({
  "node_modules/@babel/plugin-proposal-decorators/lib/transformer-legacy.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = void 0;
    var _core = require_lib27();
    var buildClassDecorator = _core.template.statement(`
  DECORATOR(CLASS_REF = INNER) || CLASS_REF;
`);
    var buildClassPrototype = (0, _core.template)(`
  CLASS_REF.prototype;
`);
    var buildGetDescriptor = (0, _core.template)(`
    Object.getOwnPropertyDescriptor(TARGET, PROPERTY);
`);
    var buildGetObjectInitializer = (0, _core.template)(`
    (TEMP = Object.getOwnPropertyDescriptor(TARGET, PROPERTY), (TEMP = TEMP ? TEMP.value : undefined), {
        enumerable: true,
        configurable: true,
        writable: true,
        initializer: function(){
            return TEMP;
        }
    })
`);
    var WARNING_CALLS = /* @__PURE__ */ new WeakSet();
    function applyEnsureOrdering(path) {
      const decorators = (path.isClass() ? [path, ...path.get("body.body")] : path.get("properties")).reduce((acc, prop) => acc.concat(prop.node.decorators || []), []);
      const identDecorators = decorators.filter((decorator) => !_core.types.isIdentifier(decorator.expression));
      if (identDecorators.length === 0) return;
      return _core.types.sequenceExpression(identDecorators.map((decorator) => {
        const expression = decorator.expression;
        const id = decorator.expression = path.scope.generateDeclaredUidIdentifier("dec");
        return _core.types.assignmentExpression("=", id, expression);
      }).concat([path.node]));
    }
    function applyClassDecorators(classPath) {
      if (!hasClassDecorators(classPath.node)) return;
      const decorators = classPath.node.decorators || [];
      classPath.node.decorators = null;
      const name = classPath.scope.generateDeclaredUidIdentifier("class");
      return decorators.map((dec) => dec.expression).reverse().reduce(function(acc, decorator) {
        return buildClassDecorator({
          CLASS_REF: _core.types.cloneNode(name),
          DECORATOR: _core.types.cloneNode(decorator),
          INNER: acc
        }).expression;
      }, classPath.node);
    }
    function hasClassDecorators(classNode) {
      var _classNode$decorators;
      return !!((_classNode$decorators = classNode.decorators) != null && _classNode$decorators.length);
    }
    function applyMethodDecorators(path, state) {
      if (!hasMethodDecorators(path.node.body.body)) return;
      return applyTargetDecorators(path, state, path.node.body.body);
    }
    function hasMethodDecorators(body) {
      return body.some((node) => {
        var _node$decorators;
        return (_node$decorators = node.decorators) == null ? void 0 : _node$decorators.length;
      });
    }
    function applyObjectDecorators(path, state) {
      if (!hasMethodDecorators(path.node.properties)) return;
      return applyTargetDecorators(path, state, path.node.properties.filter((prop) => prop.type !== "SpreadElement"));
    }
    function applyTargetDecorators(path, state, decoratedProps) {
      const name = path.scope.generateDeclaredUidIdentifier(path.isClass() ? "class" : "obj");
      const exprs = decoratedProps.reduce(function(acc, node) {
        let decorators = [];
        if (node.decorators != null) {
          decorators = node.decorators;
          node.decorators = null;
        }
        if (decorators.length === 0) return acc;
        if (node.computed) {
          throw path.buildCodeFrameError("Computed method/property decorators are not yet supported.");
        }
        const property = _core.types.isLiteral(node.key) ? node.key : _core.types.stringLiteral(node.key.name);
        const target = path.isClass() && !node.static ? buildClassPrototype({
          CLASS_REF: name
        }).expression : name;
        if (_core.types.isClassProperty(node, {
          static: false
        })) {
          const descriptor = path.scope.generateDeclaredUidIdentifier("descriptor");
          const initializer = node.value ? _core.types.functionExpression(null, [], _core.types.blockStatement([_core.types.returnStatement(node.value)])) : _core.types.nullLiteral();
          node.value = _core.types.callExpression(state.addHelper("initializerWarningHelper"), [descriptor, _core.types.thisExpression()]);
          WARNING_CALLS.add(node.value);
          acc.push(_core.types.assignmentExpression("=", _core.types.cloneNode(descriptor), _core.types.callExpression(state.addHelper("applyDecoratedDescriptor"), [_core.types.cloneNode(target), _core.types.cloneNode(property), _core.types.arrayExpression(decorators.map((dec) => _core.types.cloneNode(dec.expression))), _core.types.objectExpression([_core.types.objectProperty(_core.types.identifier("configurable"), _core.types.booleanLiteral(true)), _core.types.objectProperty(_core.types.identifier("enumerable"), _core.types.booleanLiteral(true)), _core.types.objectProperty(_core.types.identifier("writable"), _core.types.booleanLiteral(true)), _core.types.objectProperty(_core.types.identifier("initializer"), initializer)])])));
        } else {
          acc.push(_core.types.callExpression(state.addHelper("applyDecoratedDescriptor"), [_core.types.cloneNode(target), _core.types.cloneNode(property), _core.types.arrayExpression(decorators.map((dec) => _core.types.cloneNode(dec.expression))), _core.types.isObjectProperty(node) || _core.types.isClassProperty(node, {
            static: true
          }) ? buildGetObjectInitializer({
            TEMP: path.scope.generateDeclaredUidIdentifier("init"),
            TARGET: _core.types.cloneNode(target),
            PROPERTY: _core.types.cloneNode(property)
          }).expression : buildGetDescriptor({
            TARGET: _core.types.cloneNode(target),
            PROPERTY: _core.types.cloneNode(property)
          }).expression, _core.types.cloneNode(target)]));
        }
        return acc;
      }, []);
      return _core.types.sequenceExpression([_core.types.assignmentExpression("=", _core.types.cloneNode(name), path.node), _core.types.sequenceExpression(exprs), _core.types.cloneNode(name)]);
    }
    function decoratedClassToExpression({
      node,
      scope
    }) {
      if (!hasClassDecorators(node) && !hasMethodDecorators(node.body.body)) {
        return;
      }
      const ref = node.id ? _core.types.cloneNode(node.id) : scope.generateUidIdentifier("class");
      return _core.types.variableDeclaration("let", [_core.types.variableDeclarator(ref, _core.types.toExpression(node))]);
    }
    var visitor = {
      ExportDefaultDeclaration(path) {
        const decl = path.get("declaration");
        if (!decl.isClassDeclaration()) return;
        const replacement = decoratedClassToExpression(decl);
        if (replacement) {
          const [varDeclPath] = path.replaceWithMultiple([replacement, _core.types.exportNamedDeclaration(null, [_core.types.exportSpecifier(_core.types.cloneNode(replacement.declarations[0].id), _core.types.identifier("default"))])]);
          if (!decl.node.id) {
            path.scope.registerDeclaration(varDeclPath);
          }
        }
      },
      ClassDeclaration(path) {
        const replacement = decoratedClassToExpression(path);
        if (replacement) {
          const [newPath] = path.replaceWith(replacement);
          const decl = newPath.get("declarations.0");
          const id = decl.node.id;
          const binding = path.scope.getOwnBinding(id.name);
          binding.identifier = id;
          binding.path = decl;
        }
      },
      ClassExpression(path, state) {
        const decoratedClass = applyEnsureOrdering(path) || applyClassDecorators(path) || applyMethodDecorators(path, state);
        if (decoratedClass) path.replaceWith(decoratedClass);
      },
      ObjectExpression(path, state) {
        const decoratedObject = applyEnsureOrdering(path) || applyObjectDecorators(path, state);
        if (decoratedObject) path.replaceWith(decoratedObject);
      },
      AssignmentExpression(path, state) {
        if (!WARNING_CALLS.has(path.node.right)) return;
        path.replaceWith(_core.types.callExpression(state.addHelper("initializerDefineProperty"), [_core.types.cloneNode(path.get("left.object").node), _core.types.stringLiteral(path.get("left.property").node.name || path.get("left.property").node.value), _core.types.cloneNode(path.get("right.arguments")[0].node), _core.types.cloneNode(path.get("right.arguments")[1].node)]));
      },
      CallExpression(path, state) {
        if (path.node.arguments.length !== 3) return;
        if (!WARNING_CALLS.has(path.node.arguments[2])) return;
        if (path.node.callee.name !== state.addHelper("defineProperty").name) {
          return;
        }
        path.replaceWith(_core.types.callExpression(state.addHelper("initializerDefineProperty"), [_core.types.cloneNode(path.get("arguments")[0].node), _core.types.cloneNode(path.get("arguments")[1].node), _core.types.cloneNode(path.get("arguments.2.arguments")[0].node), _core.types.cloneNode(path.get("arguments.2.arguments")[1].node)]));
      }
    };
    var _default = exports2.default = visitor;
  }
});

// node_modules/@babel/plugin-proposal-decorators/lib/index.js
var require_lib30 = __commonJS({
  "node_modules/@babel/plugin-proposal-decorators/lib/index.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = void 0;
    var _helperPluginUtils = require_lib15();
    var _pluginSyntaxDecorators = require_lib29();
    var _helperCreateClassFeaturesPlugin = require_lib22();
    var _transformerLegacy = require_transformer_legacy();
    var _default = exports2.default = (0, _helperPluginUtils.declare)((api, options) => {
      api.assertVersion("^7.0.0-0 || ^8.0.0-0");
      var {
        legacy
      } = options;
      const {
        version
      } = options;
      if (legacy || version === "legacy") {
        return {
          name: "proposal-decorators",
          inherits: _pluginSyntaxDecorators.default,
          visitor: _transformerLegacy.default
        };
      } else if (!version || version === "2018-09" || version === "2021-12" || version === "2022-03" || version === "2023-01" || version === "2023-05" || version === "2023-11") {
        api.assertVersion("^7.0.2 || ^8.0.0-0");
        return (0, _helperCreateClassFeaturesPlugin.createClassFeaturePlugin)({
          name: "proposal-decorators",
          api,
          feature: _helperCreateClassFeaturesPlugin.FEATURES.decorators,
          inherits: _pluginSyntaxDecorators.default,
          decoratorVersion: version
        });
      } else {
        throw new Error("The '.version' option must be one of 'legacy', '2023-11', '2023-05', '2023-01', '2022-03', or '2021-12'.");
      }
    });
  }
});

// node_modules/@babel/plugin-transform-destructuring/lib/index.js
var require_lib31 = __commonJS({
  "node_modules/@babel/plugin-transform-destructuring/lib/index.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    var helperPluginUtils = require_lib15();
    var core = require_lib27();
    function isPureVoid(node) {
      return core.types.isUnaryExpression(node) && node.operator === "void" && core.types.isPureish(node.argument);
    }
    function unshiftForXStatementBody(statementPath, newStatements) {
      statementPath.ensureBlock();
      const {
        scope,
        node
      } = statementPath;
      const bodyScopeBindings = statementPath.get("body").scope.bindings;
      const hasShadowedBlockScopedBindings = Object.keys(bodyScopeBindings).some((name) => scope.hasBinding(name));
      if (hasShadowedBlockScopedBindings) {
        node.body = core.types.blockStatement([...newStatements, node.body]);
      } else {
        node.body.body.unshift(...newStatements);
      }
    }
    function hasArrayRest(pattern) {
      return pattern.elements.some((elem) => core.types.isRestElement(elem));
    }
    function hasObjectRest(pattern) {
      return pattern.properties.some((prop) => core.types.isRestElement(prop));
    }
    var STOP_TRAVERSAL = {};
    var arrayUnpackVisitor = (node, ancestors, state) => {
      if (!ancestors.length) {
        return;
      }
      if (core.types.isIdentifier(node) && core.types.isReferenced(node, ancestors[ancestors.length - 1].node) && state.bindings[node.name]) {
        state.deopt = true;
        throw STOP_TRAVERSAL;
      }
    };
    var DestructuringTransformer = class {
      constructor(opts) {
        this.blockHoist = void 0;
        this.operator = void 0;
        this.arrayRefSet = void 0;
        this.nodes = void 0;
        this.scope = void 0;
        this.kind = void 0;
        this.iterableIsArray = void 0;
        this.arrayLikeIsIterable = void 0;
        this.objectRestNoSymbols = void 0;
        this.useBuiltIns = void 0;
        this.addHelper = void 0;
        this.blockHoist = opts.blockHoist;
        this.operator = opts.operator;
        this.arrayRefSet = /* @__PURE__ */ new Set();
        this.nodes = opts.nodes || [];
        this.scope = opts.scope;
        this.kind = opts.kind;
        this.iterableIsArray = opts.iterableIsArray;
        this.arrayLikeIsIterable = opts.arrayLikeIsIterable;
        this.objectRestNoSymbols = opts.objectRestNoSymbols;
        this.useBuiltIns = opts.useBuiltIns;
        this.addHelper = opts.addHelper;
      }
      getExtendsHelper() {
        return this.useBuiltIns ? core.types.memberExpression(core.types.identifier("Object"), core.types.identifier("assign")) : this.addHelper("extends");
      }
      buildVariableAssignment(id, init) {
        let op = this.operator;
        if (core.types.isMemberExpression(id) || core.types.isOptionalMemberExpression(id)) op = "=";
        let node;
        if (op) {
          node = core.types.expressionStatement(core.types.assignmentExpression(op, id, core.types.cloneNode(init) || this.scope.buildUndefinedNode()));
        } else {
          let nodeInit;
          if (this.kind === "const" && init === null) {
            nodeInit = this.scope.buildUndefinedNode();
          } else {
            nodeInit = core.types.cloneNode(init);
          }
          node = core.types.variableDeclaration(this.kind, [core.types.variableDeclarator(id, nodeInit)]);
        }
        node._blockHoist = this.blockHoist;
        return node;
      }
      buildVariableDeclaration(id, init) {
        const declar = core.types.variableDeclaration("var", [core.types.variableDeclarator(core.types.cloneNode(id), core.types.cloneNode(init))]);
        declar._blockHoist = this.blockHoist;
        return declar;
      }
      push(id, _init) {
        const init = core.types.cloneNode(_init);
        if (core.types.isObjectPattern(id)) {
          this.pushObjectPattern(id, init);
        } else if (core.types.isArrayPattern(id)) {
          this.pushArrayPattern(id, init);
        } else if (core.types.isAssignmentPattern(id)) {
          this.pushAssignmentPattern(id, init);
        } else {
          this.nodes.push(this.buildVariableAssignment(id, init));
        }
      }
      toArray(node, count) {
        if (this.iterableIsArray || core.types.isIdentifier(node) && this.arrayRefSet.has(node.name)) {
          return node;
        } else {
          const {
            scope,
            arrayLikeIsIterable
          } = this;
          if (core.types.isIdentifier(node)) {
            const binding = scope.getBinding(node.name);
            if (binding != null && binding.constant && binding.path.isGenericType("Array")) {
              return node;
            }
          }
          if (core.types.isArrayExpression(node)) {
            return node;
          }
          if (core.types.isIdentifier(node, {
            name: "arguments"
          })) {
            return core.template.expression.ast`
          Array.prototype.slice.call(${node})
        `;
          }
          let helperName;
          const args = [node];
          if (typeof count === "number") {
            args.push(core.types.numericLiteral(count));
            helperName = "slicedToArray";
          } else {
            helperName = "toArray";
          }
          if (arrayLikeIsIterable) {
            args.unshift(scope.path.hub.addHelper(helperName));
            helperName = "maybeArrayLike";
          }
          return core.types.callExpression(scope.path.hub.addHelper(helperName), args);
        }
      }
      pushAssignmentPattern({
        left,
        right
      }, valueRef) {
        if (isPureVoid(valueRef)) {
          this.push(left, right);
          return;
        }
        const tempId = this.scope.generateUidIdentifierBasedOnNode(valueRef);
        this.nodes.push(this.buildVariableDeclaration(tempId, valueRef));
        const tempConditional = core.types.conditionalExpression(core.types.binaryExpression("===", core.types.cloneNode(tempId), this.scope.buildUndefinedNode()), right, core.types.cloneNode(tempId));
        if (core.types.isPattern(left)) {
          let patternId;
          let node;
          if (this.kind === "const" || this.kind === "let") {
            patternId = this.scope.generateUidIdentifier(tempId.name);
            node = this.buildVariableDeclaration(patternId, tempConditional);
          } else {
            patternId = tempId;
            node = core.types.expressionStatement(core.types.assignmentExpression("=", core.types.cloneNode(tempId), tempConditional));
          }
          this.nodes.push(node);
          this.push(left, patternId);
        } else {
          this.nodes.push(this.buildVariableAssignment(left, tempConditional));
        }
      }
      pushObjectRest(pattern, objRef, spreadProp, spreadPropIndex) {
        const value2 = buildObjectExcludingKeys(pattern.properties.slice(0, spreadPropIndex), objRef, this.scope, (name) => this.addHelper(name), this.objectRestNoSymbols, this.useBuiltIns);
        this.nodes.push(this.buildVariableAssignment(spreadProp.argument, value2));
      }
      pushObjectProperty(prop, propRef) {
        if (core.types.isLiteral(prop.key)) prop.computed = true;
        const pattern = prop.value;
        const objRef = core.types.memberExpression(core.types.cloneNode(propRef), prop.key, prop.computed);
        if (core.types.isPattern(pattern)) {
          this.push(pattern, objRef);
        } else {
          this.nodes.push(this.buildVariableAssignment(pattern, objRef));
        }
      }
      pushObjectPattern(pattern, objRef) {
        if (!pattern.properties.length) {
          this.nodes.push(core.types.expressionStatement(core.types.callExpression(this.addHelper("objectDestructuringEmpty"), isPureVoid(objRef) ? [] : [objRef])));
          return;
        }
        if (pattern.properties.length > 1 && !this.scope.isStatic(objRef)) {
          const temp = this.scope.generateUidIdentifierBasedOnNode(objRef);
          this.nodes.push(this.buildVariableDeclaration(temp, objRef));
          objRef = temp;
        }
        if (hasObjectRest(pattern)) {
          let copiedPattern;
          for (let i = 0; i < pattern.properties.length; i++) {
            const prop = pattern.properties[i];
            if (core.types.isRestElement(prop)) {
              break;
            }
            const key = prop.key;
            if (prop.computed && !this.scope.isPure(key)) {
              const name = this.scope.generateUidIdentifierBasedOnNode(key);
              this.nodes.push(this.buildVariableDeclaration(name, key));
              if (!copiedPattern) {
                copiedPattern = pattern = Object.assign({}, pattern, {
                  properties: pattern.properties.slice()
                });
              }
              copiedPattern.properties[i] = Object.assign({}, prop, {
                key: name
              });
            }
          }
        }
        for (let i = 0; i < pattern.properties.length; i++) {
          const prop = pattern.properties[i];
          if (core.types.isRestElement(prop)) {
            this.pushObjectRest(pattern, objRef, prop, i);
          } else {
            this.pushObjectProperty(prop, objRef);
          }
        }
      }
      canUnpackArrayPattern(pattern, arr) {
        if (!core.types.isArrayExpression(arr)) return false;
        if (pattern.elements.length > arr.elements.length) return;
        if (pattern.elements.length < arr.elements.length && !hasArrayRest(pattern)) {
          return false;
        }
        for (const elem of pattern.elements) {
          if (!elem) return false;
          if (core.types.isMemberExpression(elem)) return false;
        }
        for (const elem of arr.elements) {
          if (core.types.isSpreadElement(elem)) return false;
          if (core.types.isCallExpression(elem)) return false;
          if (core.types.isMemberExpression(elem)) return false;
        }
        const bindings = core.types.getBindingIdentifiers(pattern);
        const state = {
          deopt: false,
          bindings
        };
        try {
          core.types.traverse(arr, arrayUnpackVisitor, state);
        } catch (e) {
          if (e !== STOP_TRAVERSAL) throw e;
        }
        return !state.deopt;
      }
      pushUnpackedArrayPattern(pattern, arr) {
        const holeToUndefined = (el) => el != null ? el : this.scope.buildUndefinedNode();
        for (let i = 0; i < pattern.elements.length; i++) {
          const elem = pattern.elements[i];
          if (core.types.isRestElement(elem)) {
            this.push(elem.argument, core.types.arrayExpression(arr.elements.slice(i).map(holeToUndefined)));
          } else {
            this.push(elem, holeToUndefined(arr.elements[i]));
          }
        }
      }
      pushArrayPattern(pattern, arrayRef) {
        if (arrayRef === null) {
          this.nodes.push(core.types.expressionStatement(core.types.callExpression(this.addHelper("objectDestructuringEmpty"), [])));
          return;
        }
        if (!pattern.elements) return;
        if (this.canUnpackArrayPattern(pattern, arrayRef)) {
          this.pushUnpackedArrayPattern(pattern, arrayRef);
          return;
        }
        const count = !hasArrayRest(pattern) && pattern.elements.length;
        const toArray = this.toArray(arrayRef, count);
        if (core.types.isIdentifier(toArray)) {
          arrayRef = toArray;
        } else {
          arrayRef = this.scope.generateUidIdentifierBasedOnNode(arrayRef);
          this.arrayRefSet.add(arrayRef.name);
          this.nodes.push(this.buildVariableDeclaration(arrayRef, toArray));
        }
        for (let i = 0; i < pattern.elements.length; i++) {
          const elem = pattern.elements[i];
          if (!elem) continue;
          if (core.types.isRestElement(elem)) {
            this.push(elem.argument, core.types.callExpression(core.types.memberExpression(core.types.callExpression(this.scope.path.hub.addHelper("arrayLikeToArray"), [arrayRef]), core.types.identifier("slice")), [core.types.numericLiteral(i)]));
          } else {
            this.push(elem, core.types.memberExpression(arrayRef, core.types.numericLiteral(i), true));
          }
        }
      }
      init(pattern, ref) {
        if (!core.types.isArrayExpression(ref) && !core.types.isMemberExpression(ref)) {
          const memo = this.scope.maybeGenerateMemoised(ref, true);
          if (memo) {
            this.nodes.push(this.buildVariableDeclaration(memo, core.types.cloneNode(ref)));
            ref = memo;
          }
        }
        this.push(pattern, ref);
        return this.nodes;
      }
    };
    function buildObjectExcludingKeys(excludedKeys, objRef, scope, addHelper, objectRestNoSymbols, useBuiltIns) {
      const keys = [];
      let allLiteral = true;
      let hasTemplateLiteral = false;
      for (let i = 0; i < excludedKeys.length; i++) {
        const prop = excludedKeys[i];
        const key = prop.key;
        if (core.types.isIdentifier(key) && !prop.computed) {
          keys.push(core.types.stringLiteral(key.name));
        } else if (core.types.isTemplateLiteral(key)) {
          keys.push(core.types.cloneNode(key));
          hasTemplateLiteral = true;
        } else if (core.types.isLiteral(key)) {
          keys.push(core.types.stringLiteral(String(key.value)));
        } else if (core.types.isPrivateName(key)) ;
        else {
          keys.push(core.types.cloneNode(key));
          allLiteral = false;
        }
      }
      let value2;
      if (keys.length === 0) {
        const extendsHelper = useBuiltIns ? core.types.memberExpression(core.types.identifier("Object"), core.types.identifier("assign")) : addHelper("extends");
        value2 = core.types.callExpression(extendsHelper, [core.types.objectExpression([]), core.types.sequenceExpression([core.types.callExpression(addHelper("objectDestructuringEmpty"), [core.types.cloneNode(objRef)]), core.types.cloneNode(objRef)])]);
      } else {
        let keyExpression = core.types.arrayExpression(keys);
        if (!allLiteral) {
          keyExpression = core.types.callExpression(core.types.memberExpression(keyExpression, core.types.identifier("map")), [addHelper("toPropertyKey")]);
        } else if (!hasTemplateLiteral && !core.types.isProgram(scope.block)) {
          const programScope = scope.getProgramParent();
          const id = programScope.generateUidIdentifier("excluded");
          programScope.push({
            id,
            init: keyExpression,
            kind: "const"
          });
          keyExpression = core.types.cloneNode(id);
        }
        value2 = core.types.callExpression(addHelper(`objectWithoutProperties${objectRestNoSymbols ? "Loose" : ""}`), [core.types.cloneNode(objRef), keyExpression]);
      }
      return value2;
    }
    function convertVariableDeclaration(path, addHelper, arrayLikeIsIterable, iterableIsArray, objectRestNoSymbols, useBuiltIns) {
      const {
        node,
        scope
      } = path;
      const nodeKind = node.kind;
      const nodeLoc = node.loc;
      const nodes = [];
      for (let i = 0; i < node.declarations.length; i++) {
        const declar = node.declarations[i];
        const patternId = declar.init;
        const pattern = declar.id;
        const destructuring = new DestructuringTransformer({
          blockHoist: node._blockHoist,
          nodes,
          scope,
          kind: node.kind,
          iterableIsArray,
          arrayLikeIsIterable,
          useBuiltIns,
          objectRestNoSymbols,
          addHelper
        });
        if (core.types.isPattern(pattern)) {
          destructuring.init(pattern, patternId);
          if (+i !== node.declarations.length - 1) {
            core.types.inherits(nodes[nodes.length - 1], declar);
          }
        } else {
          nodes.push(core.types.inherits(destructuring.buildVariableAssignment(pattern, patternId), declar));
        }
      }
      let tail = null;
      let nodesOut = [];
      for (const node2 of nodes) {
        if (core.types.isVariableDeclaration(node2)) {
          if (tail !== null) {
            tail.declarations.push(...node2.declarations);
            continue;
          } else {
            node2.kind = nodeKind;
            tail = node2;
          }
        } else {
          tail = null;
        }
        if (!node2.loc) {
          node2.loc = nodeLoc;
        }
        nodesOut.push(node2);
      }
      if (nodesOut.length === 2 && core.types.isVariableDeclaration(nodesOut[0]) && core.types.isExpressionStatement(nodesOut[1]) && core.types.isCallExpression(nodesOut[1].expression) && nodesOut[0].declarations.length === 1) {
        const expr = nodesOut[1].expression;
        expr.arguments = [nodesOut[0].declarations[0].init];
        nodesOut = [expr];
      } else {
        if (core.types.isForStatement(path.parent, {
          init: node
        }) && !nodesOut.some((v) => core.types.isVariableDeclaration(v))) {
          for (let i = 0; i < nodesOut.length; i++) {
            const node2 = nodesOut[i];
            if (core.types.isExpressionStatement(node2)) {
              nodesOut[i] = node2.expression;
            }
          }
        }
      }
      if (nodesOut.length === 1) {
        path.replaceWith(nodesOut[0]);
      } else {
        path.replaceWithMultiple(nodesOut);
      }
      scope.crawl();
    }
    function convertAssignmentExpression(path, addHelper, arrayLikeIsIterable, iterableIsArray, objectRestNoSymbols, useBuiltIns) {
      const {
        node,
        scope,
        parentPath
      } = path;
      const nodes = [];
      const destructuring = new DestructuringTransformer({
        operator: node.operator,
        scope,
        nodes,
        arrayLikeIsIterable,
        iterableIsArray,
        objectRestNoSymbols,
        useBuiltIns,
        addHelper
      });
      let ref;
      if (!parentPath.isExpressionStatement() && !parentPath.isSequenceExpression() || path.isCompletionRecord()) {
        ref = scope.generateUidIdentifierBasedOnNode(node.right, "ref");
        nodes.push(core.types.variableDeclaration("var", [core.types.variableDeclarator(ref, node.right)]));
        if (core.types.isArrayExpression(node.right)) {
          destructuring.arrayRefSet.add(ref.name);
        }
      }
      destructuring.init(node.left, ref || node.right);
      if (ref) {
        if (parentPath.isArrowFunctionExpression()) {
          path.replaceWith(core.types.blockStatement([]));
          nodes.push(core.types.returnStatement(core.types.cloneNode(ref)));
        } else {
          nodes.push(core.types.expressionStatement(core.types.cloneNode(ref)));
        }
      }
      path.replaceWithMultiple(nodes);
      scope.crawl();
    }
    function variableDeclarationHasDestructuringPattern(node) {
      for (const declar of node.declarations) {
        if (core.types.isPattern(declar.id) && declar.id.type !== "VoidPattern") {
          return true;
        }
      }
      return false;
    }
    var index = helperPluginUtils.declare((api, options) => {
      var _ref, _api$assumption, _ref2, _options$allowArrayLi, _ref3, _api$assumption2;
      api.assertVersion(7);
      const {
        useBuiltIns = false
      } = options;
      const iterableIsArray = (_ref = (_api$assumption = api.assumption("iterableIsArray")) != null ? _api$assumption : options.loose) != null ? _ref : false;
      const arrayLikeIsIterable = (_ref2 = (_options$allowArrayLi = options.allowArrayLike) != null ? _options$allowArrayLi : api.assumption("arrayLikeIsIterable")) != null ? _ref2 : false;
      const objectRestNoSymbols = (_ref3 = (_api$assumption2 = api.assumption("objectRestNoSymbols")) != null ? _api$assumption2 : options.loose) != null ? _ref3 : false;
      return {
        name: "transform-destructuring",
        visitor: {
          ExportNamedDeclaration(path) {
            const declaration = path.get("declaration");
            if (!declaration.isVariableDeclaration()) return;
            if (!variableDeclarationHasDestructuringPattern(declaration.node)) return;
            {
              var _path$splitExportDecl;
              (_path$splitExportDecl = path.splitExportDeclaration) != null ? _path$splitExportDecl : path.splitExportDeclaration = require_lib9().NodePath.prototype.splitExportDeclaration;
            }
            path.splitExportDeclaration();
          },
          ForXStatement(path) {
            const {
              node,
              scope
            } = path;
            const left = node.left;
            if (core.types.isPattern(left)) {
              const temp = scope.generateUidIdentifier("ref");
              node.left = core.types.variableDeclaration("var", [core.types.variableDeclarator(temp)]);
              path.ensureBlock();
              const statementBody = path.node.body.body;
              const nodes2 = [];
              if (statementBody.length === 0 && path.isCompletionRecord()) {
                nodes2.unshift(core.types.expressionStatement(scope.buildUndefinedNode()));
              }
              nodes2.unshift(core.types.expressionStatement(core.types.assignmentExpression("=", left, core.types.cloneNode(temp))));
              unshiftForXStatementBody(path, nodes2);
              scope.crawl();
              return;
            }
            if (!core.types.isVariableDeclaration(left)) return;
            const pattern = left.declarations[0].id;
            if (!core.types.isPattern(pattern) || pattern.type === "VoidPattern") return;
            const key = scope.generateUidIdentifier("ref");
            node.left = core.types.variableDeclaration(left.kind, [core.types.variableDeclarator(key, null)]);
            const nodes = [];
            const destructuring = new DestructuringTransformer({
              kind: left.kind,
              scope,
              nodes,
              arrayLikeIsIterable,
              iterableIsArray,
              objectRestNoSymbols,
              useBuiltIns,
              addHelper: (name) => this.addHelper(name)
            });
            destructuring.init(pattern, key);
            unshiftForXStatementBody(path, nodes);
            scope.crawl();
          },
          CatchClause({
            node,
            scope
          }) {
            const pattern = node.param;
            if (!core.types.isPattern(pattern)) return;
            const ref = scope.generateUidIdentifier("ref");
            node.param = ref;
            const nodes = [];
            const destructuring = new DestructuringTransformer({
              kind: "let",
              scope,
              nodes,
              arrayLikeIsIterable,
              iterableIsArray,
              objectRestNoSymbols,
              useBuiltIns,
              addHelper: (name) => this.addHelper(name)
            });
            destructuring.init(pattern, ref);
            node.body.body = [...nodes, ...node.body.body];
            scope.crawl();
          },
          AssignmentExpression(path, state) {
            if (!core.types.isPattern(path.node.left)) return;
            convertAssignmentExpression(path, (name) => state.addHelper(name), arrayLikeIsIterable, iterableIsArray, objectRestNoSymbols, useBuiltIns);
          },
          VariableDeclaration(path, state) {
            const {
              node,
              parent
            } = path;
            if (core.types.isForXStatement(parent)) return;
            if (!parent || !path.container) return;
            if (!variableDeclarationHasDestructuringPattern(node)) return;
            convertVariableDeclaration(path, (name) => state.addHelper(name), arrayLikeIsIterable, iterableIsArray, objectRestNoSymbols, useBuiltIns);
          }
        }
      };
    });
    exports2.buildObjectExcludingKeys = buildObjectExcludingKeys;
    exports2.default = index;
    exports2.unshiftForXStatementBody = unshiftForXStatementBody;
  }
});

// node_modules/@babel/plugin-transform-explicit-resource-management/lib/index.js
var require_lib32 = __commonJS({
  "node_modules/@babel/plugin-transform-explicit-resource-management/lib/index.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = void 0;
    var _helperPluginUtils = require_lib15();
    var _pluginTransformDestructuring = require_lib31();
    var _core = require_lib27();
    function isAnonymousFunctionDefinition(node) {
      return _core.types.isArrowFunctionExpression(node) || (_core.types.isFunctionExpression(node) || _core.types.isClassExpression(node)) && !node.id;
    }
    function emitSetFunctionNameCall(state, expression, name) {
      return _core.types.callExpression(state.addHelper("setFunctionName"), [expression, _core.types.stringLiteral(name)]);
    }
    var _default = exports2.default = (0, _helperPluginUtils.declare)((api) => {
      api.assertVersion("^7.23.9 || ^8.0.0-0 || >8.0.0-alpha <8.0.0-beta");
      const TOP_LEVEL_USING = /* @__PURE__ */ new Map();
      function isUsingDeclaration(node) {
        if (!_core.types.isVariableDeclaration(node)) return false;
        return node.kind === "using" || node.kind === "await using" || TOP_LEVEL_USING.has(node);
      }
      const transformUsingDeclarationsVisitor = {
        ForOfStatement(path) {
          const {
            left
          } = path.node;
          if (!isUsingDeclaration(left)) return;
          const {
            id
          } = left.declarations[0];
          const tmpId = path.scope.generateUidIdentifierBasedOnNode(id);
          left.declarations[0].id = tmpId;
          left.kind = "const";
          path.ensureBlock();
          (0, _pluginTransformDestructuring.unshiftForXStatementBody)(path, [_core.types.variableDeclaration("using", [_core.types.variableDeclarator(id, _core.types.cloneNode(tmpId))])]);
        },
        "BlockStatement|StaticBlock"(path, state) {
          let ctx = null;
          let needsAwait = false;
          const scope = path.scope;
          for (const node of path.node.body) {
            if (!isUsingDeclaration(node)) continue;
            ctx != null ? ctx : ctx = scope.generateUidIdentifier("usingCtx");
            const isAwaitUsing = node.kind === "await using" || TOP_LEVEL_USING.get(node) === 1;
            needsAwait || (needsAwait = isAwaitUsing);
            if (!TOP_LEVEL_USING.delete(node)) {
              node.kind = "const";
            }
            for (const decl of node.declarations) {
              const currentInit = decl.init;
              decl.init = _core.types.callExpression(_core.types.memberExpression(_core.types.cloneNode(ctx), isAwaitUsing ? _core.types.identifier("a") : _core.types.identifier("u")), [isAnonymousFunctionDefinition(currentInit) && _core.types.isIdentifier(decl.id) ? emitSetFunctionNameCall(state, currentInit, decl.id.name) : currentInit]);
            }
          }
          if (!ctx) return;
          const disposeCall = _core.types.callExpression(_core.types.memberExpression(_core.types.cloneNode(ctx), _core.types.identifier("d")), []);
          const replacement = _core.template.statement.ast`
        try {
          var ${_core.types.cloneNode(ctx)} = ${state.addHelper("usingCtx")}();
          ${path.node.body}
        } catch (_) {
          ${_core.types.cloneNode(ctx)}.e = _;
        } finally {
          ${needsAwait ? _core.types.awaitExpression(disposeCall) : disposeCall}
        }
      `;
          _core.types.inherits(replacement, path.node);
          const {
            parentPath
          } = path;
          if (parentPath.isFunction() || parentPath.isTryStatement() || parentPath.isCatchClause()) {
            path.replaceWith(_core.types.blockStatement([replacement]));
          } else if (path.isStaticBlock()) {
            path.node.body = [replacement];
          } else {
            path.replaceWith(replacement);
          }
        }
      };
      const transformUsingDeclarationsVisitorSkipFn = _core.traverse.visitors.merge([transformUsingDeclarationsVisitor, {
        Function(path) {
          path.skip();
        }
      }]);
      return {
        name: "transform-explicit-resource-management",
        manipulateOptions: (_, p) => p.plugins.push("explicitResourceManagement"),
        visitor: _core.traverse.visitors.merge([transformUsingDeclarationsVisitor, {
          Program(path) {
            TOP_LEVEL_USING.clear();
            if (path.node.sourceType !== "module") return;
            if (!path.node.body.some(isUsingDeclaration)) return;
            const innerBlockBody = [];
            for (const stmt of path.get("body")) {
              if (stmt.isFunctionDeclaration() || stmt.isImportDeclaration()) {
                continue;
              }
              let node = stmt.node;
              let shouldRemove = true;
              if (stmt.isExportDefaultDeclaration()) {
                let {
                  declaration
                } = stmt.node;
                let varId;
                if (_core.types.isClassDeclaration(declaration)) {
                  varId = declaration.id;
                  declaration.id = _core.types.cloneNode(varId);
                  declaration = _core.types.toExpression(declaration);
                } else if (!_core.types.isExpression(declaration)) {
                  continue;
                }
                varId != null ? varId : varId = path.scope.generateUidIdentifier("_default");
                innerBlockBody.push(_core.types.variableDeclaration("var", [_core.types.variableDeclarator(varId, declaration)]));
                stmt.replaceWith(_core.types.exportNamedDeclaration(null, [_core.types.exportSpecifier(_core.types.cloneNode(varId), _core.types.identifier("default"))]));
                continue;
              }
              if (stmt.isExportNamedDeclaration()) {
                node = stmt.node.declaration;
                if (!node || _core.types.isFunction(node)) continue;
                stmt.replaceWith(_core.types.exportNamedDeclaration(null, Object.keys(_core.types.getOuterBindingIdentifiers(node, false)).map((id) => _core.types.exportSpecifier(_core.types.identifier(id), _core.types.identifier(id)))));
                shouldRemove = false;
              } else if (stmt.isExportDeclaration()) {
                continue;
              }
              if (_core.types.isClassDeclaration(node)) {
                const {
                  id
                } = node;
                node.id = _core.types.cloneNode(id);
                innerBlockBody.push(_core.types.variableDeclaration("var", [_core.types.variableDeclarator(id, _core.types.toExpression(node))]));
              } else if (_core.types.isVariableDeclaration(node)) {
                if (node.kind === "using") {
                  TOP_LEVEL_USING.set(stmt.node, 0);
                } else if (node.kind === "await using") {
                  TOP_LEVEL_USING.set(stmt.node, 1);
                }
                node.kind = "var";
                innerBlockBody.push(node);
              } else {
                innerBlockBody.push(stmt.node);
              }
              if (shouldRemove) stmt.remove();
            }
            path.pushContainer("body", _core.types.blockStatement(innerBlockBody));
          },
          Function(path, state) {
            if (path.node.async) {
              path.traverse(transformUsingDeclarationsVisitorSkipFn, state);
            }
          }
        }])
      };
    });
  }
});

// node_modules/@babel/plugin-transform-class-properties/lib/index.js
var require_lib33 = __commonJS({
  "node_modules/@babel/plugin-transform-class-properties/lib/index.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = void 0;
    var _helperPluginUtils = require_lib15();
    var _helperCreateClassFeaturesPlugin = require_lib22();
    var _default = exports2.default = (0, _helperPluginUtils.declare)((api, options) => {
      api.assertVersion("^7.0.0-0 || ^8.0.0-0");
      return (0, _helperCreateClassFeaturesPlugin.createClassFeaturePlugin)({
        name: "transform-class-properties",
        api,
        feature: _helperCreateClassFeaturesPlugin.FEATURES.fields,
        loose: options.loose,
        manipulateOptions(opts, parserOpts) {
          parserOpts.plugins.push("classProperties", "classPrivateProperties");
        }
      });
    });
  }
});

// node_modules/@babel/plugin-transform-class-static-block/lib/index.js
var require_lib34 = __commonJS({
  "node_modules/@babel/plugin-transform-class-static-block/lib/index.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = void 0;
    var _helperPluginUtils = require_lib15();
    var _helperCreateClassFeaturesPlugin = require_lib22();
    function generateUid(scope, denyList) {
      const name = "";
      let uid;
      let i = 1;
      do {
        uid = `_${name}`;
        if (i > 1) uid += i;
        i++;
      } while (denyList.has(uid));
      return uid;
    }
    function mapLast(arr, fn) {
      if (arr.length === 0) return arr;
      return [...arr.slice(0, -1), fn(arr[arr.length - 1])];
    }
    var _default = exports2.default = (0, _helperPluginUtils.declare)(({
      types: t,
      template,
      traverse: traverse2,
      assertVersion
    }) => {
      assertVersion("^7.12.0 || ^8.0.0-0 || >8.0.0-alpha <8.0.0-beta");
      const rawNamedEvaluationVisitor = (0, _helperCreateClassFeaturesPlugin.buildNamedEvaluationVisitor)((path) => {
        if (!path.isClassExpression()) return false;
        for (let i = path.node.body.body.length - 1; i >= 0; i--) {
          const el = path.node.body.body[i];
          if (t.isStaticBlock(el)) {
            return true;
          }
          if ((t.isClassProperty(el) || t.isClassPrivateProperty(el)) && el.static) {
            break;
          }
        }
        return false;
      }, (classPath, state, name) => {
        const nameNode = typeof name === "string" ? t.stringLiteral(name) : name;
        classPath.get("body").unshiftContainer("body", t.staticBlock([template.statement.ast`
            ${state.addHelper("setFunctionName")}(this, ${nameNode});
          `]));
      });
      if (!t.classAccessorProperty) {
        delete rawNamedEvaluationVisitor.ClassAccessorProperty;
      }
      const namedEvaluationVisitor = traverse2.visitors.explode(rawNamedEvaluationVisitor);
      const maybeSequenceExpression = (expressions) => {
        if (expressions.length === 1) {
          return expressions[0];
        } else {
          return t.sequenceExpression(expressions);
        }
      };
      const blocksToExpressions = (blocks) => blocks.map((block) => {
        const {
          body
        } = block;
        if (body.length === 1 && t.isExpressionStatement(body[0])) {
          return t.inheritsComments(t.inheritsComments(body[0].expression, body[0]), block);
        }
        return t.inheritsComments(template.expression.ast`(() => { ${body} })()`, block);
      });
      const prependToInitializer = (prop, expressions) => {
        prop.value = prop.value ? t.sequenceExpression([...expressions, prop.value]) : maybeSequenceExpression(mapLast(expressions, (expr) => t.unaryExpression("void", expr)));
      };
      return {
        name: "transform-class-static-block",
        manipulateOptions: (_, parser) => parser.plugins.push("classStaticBlock"),
        pre() {
          (0, _helperCreateClassFeaturesPlugin.enableFeature)(this.file, _helperCreateClassFeaturesPlugin.FEATURES.staticBlocks, false);
        },
        visitor: {
          ClassBody(classBody) {
            const {
              scope
            } = classBody;
            let parentPath = classBody.parentPath;
            if (parentPath.isClassExpression() && !parentPath.node.id) {
              do
                ({
                  parentPath
                } = parentPath);
              while (parentPath && !namedEvaluationVisitor[parentPath.type] && !parentPath.isStatement());
              if (parentPath) {
                var _namedEvaluationVisit;
                (_namedEvaluationVisit = namedEvaluationVisitor[parentPath.type]) == null || _namedEvaluationVisit.enter.forEach((f) => f.call(this, parentPath, this));
              }
            }
            const pendingStaticBlocks = [];
            let lastStaticProp = null;
            for (const path of classBody.get("body")) {
              if (path.isStaticBlock()) {
                pendingStaticBlocks.push(path.node);
                path.remove();
              } else if (path.isClassProperty({
                static: true
              }) || path.isClassPrivateProperty({
                static: true
              })) {
                lastStaticProp = path;
                if (pendingStaticBlocks.length > 0) {
                  prependToInitializer(path.node, blocksToExpressions(pendingStaticBlocks));
                  pendingStaticBlocks.length = 0;
                }
              }
            }
            if (pendingStaticBlocks.length > 0) {
              const tmp = scope.generateDeclaredUidIdentifier("staticBlock");
              let arrowBody;
              const needsCompletionValue = classBody.parentPath.isExpression();
              if (pendingStaticBlocks.length > 1 || pendingStaticBlocks[0].body.length === 1 && t.isExpressionStatement(pendingStaticBlocks[0].body[0])) {
                const expressions = blocksToExpressions(pendingStaticBlocks);
                if (needsCompletionValue) {
                  expressions.push(t.thisExpression());
                }
                arrowBody = maybeSequenceExpression(expressions);
              } else {
                arrowBody = t.blockStatement(pendingStaticBlocks[0].body);
                if (needsCompletionValue) {
                  arrowBody.body.push(t.returnStatement(t.thisExpression()));
                }
              }
              const init = template.expression.ast`${tmp} = () => ${arrowBody}`;
              if (lastStaticProp) {
                prependToInitializer(lastStaticProp.node, [init]);
              } else {
                const privateNames = /* @__PURE__ */ new Set();
                for (const path of classBody.get("body")) {
                  if (path.isPrivate()) {
                    privateNames.add(path.get("key.id").node.name);
                  }
                }
                const staticBlockPrivateId = generateUid(scope, privateNames);
                const staticBlockRef = t.privateName(t.identifier(staticBlockPrivateId));
                classBody.pushContainer("body", [t.classPrivateProperty(staticBlockRef, init, [], true)]);
              }
              const staticBlockClosureCall = t.callExpression(t.cloneNode(tmp), []);
              if (classBody.parentPath.isClassExpression()) {
                classBody.parentPath.replaceWith(t.sequenceExpression([classBody.parent, staticBlockClosureCall]));
              } else {
                classBody.parentPath.insertAfter(t.expressionStatement(staticBlockClosureCall));
              }
            }
          }
        }
      };
    });
  }
});

// node_modules/@babel/plugin-transform-numeric-separator/lib/index.js
var require_lib35 = __commonJS({
  "node_modules/@babel/plugin-transform-numeric-separator/lib/index.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = void 0;
    var _helperPluginUtils = require_lib15();
    function remover({
      node
    }) {
      var _extra$raw;
      const {
        extra
      } = node;
      if (extra != null && (_extra$raw = extra.raw) != null && _extra$raw.includes("_")) {
        extra.raw = extra.raw.replace(/_/g, "");
      }
    }
    var _default = exports2.default = (0, _helperPluginUtils.declare)((api) => {
      api.assertVersion("^7.0.0-0 || ^8.0.0-0 || >8.0.0-alpha <8.0.0-beta");
      return {
        name: "transform-numeric-separator",
        manipulateOptions: (_, parser) => parser.plugins.push("numericSeparator"),
        visitor: {
          NumericLiteral: remover,
          BigIntLiteral: remover
        }
      };
    });
  }
});

// node_modules/@babel/plugin-transform-logical-assignment-operators/lib/index.js
var require_lib36 = __commonJS({
  "node_modules/@babel/plugin-transform-logical-assignment-operators/lib/index.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = void 0;
    var _helperPluginUtils = require_lib15();
    var _core = require_lib27();
    var _default = exports2.default = (0, _helperPluginUtils.declare)((api) => {
      api.assertVersion("^7.0.0-0 || ^8.0.0-0 || >8.0.0-alpha <8.0.0-beta");
      return {
        name: "transform-logical-assignment-operators",
        manipulateOptions: (_, parser) => parser.plugins.push("logicalAssignment"),
        visitor: {
          AssignmentExpression(path) {
            const {
              node,
              scope
            } = path;
            const {
              operator,
              left,
              right
            } = node;
            const operatorTrunc = operator.slice(0, -1);
            if (!_core.types.LOGICAL_OPERATORS.includes(operatorTrunc)) {
              return;
            }
            const lhs = _core.types.cloneNode(left);
            if (_core.types.isMemberExpression(left)) {
              const {
                object,
                property,
                computed
              } = left;
              const memo = scope.maybeGenerateMemoised(object);
              if (memo) {
                left.object = memo;
                lhs.object = _core.types.assignmentExpression("=", _core.types.cloneNode(memo), object);
              }
              if (computed) {
                const memo2 = scope.maybeGenerateMemoised(property);
                if (memo2) {
                  left.property = memo2;
                  lhs.property = _core.types.assignmentExpression("=", _core.types.cloneNode(memo2), property);
                }
              }
            }
            path.replaceWith(_core.types.logicalExpression(operatorTrunc, lhs, _core.types.assignmentExpression("=", left, right)));
          }
        }
      };
    });
  }
});

// node_modules/@babel/plugin-transform-nullish-coalescing-operator/lib/index.js
var require_lib37 = __commonJS({
  "node_modules/@babel/plugin-transform-nullish-coalescing-operator/lib/index.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = void 0;
    var _helperPluginUtils = require_lib15();
    var _core = require_lib27();
    var _default = exports2.default = (0, _helperPluginUtils.declare)((api, {
      loose = false
    }) => {
      var _api$assumption, _api$assumption2;
      api.assertVersion("^7.0.0-0 || ^8.0.0-0 || >8.0.0-alpha <8.0.0-beta");
      const noDocumentAll = (_api$assumption = api.assumption("noDocumentAll")) != null ? _api$assumption : loose;
      const pureGetters = (_api$assumption2 = api.assumption("pureGetters")) != null ? _api$assumption2 : false;
      return {
        name: "transform-nullish-coalescing-operator",
        manipulateOptions: (_, parser) => parser.plugins.push("nullishCoalescingOperator"),
        visitor: {
          LogicalExpression(path) {
            const {
              node,
              scope
            } = path;
            if (node.operator !== "??") {
              return;
            }
            let ref;
            let assignment;
            if (pureGetters && scope.path.isPattern() && _core.types.isMemberExpression(node.left) && !node.left.computed && _core.types.isIdentifier(node.left.object) && _core.types.isIdentifier(node.left.property) || _core.types.isIdentifier(node.left) && (pureGetters || scope.hasBinding(node.left.name))) {
              ref = node.left;
              assignment = _core.types.cloneNode(node.left);
            } else if (scope.path.isPattern()) {
              path.replaceWith(_core.template.statement.ast`(() => ${path.node})()`);
              return;
            } else {
              ref = scope.generateUidIdentifierBasedOnNode(node.left);
              scope.push({
                id: _core.types.cloneNode(ref)
              });
              assignment = _core.types.assignmentExpression("=", ref, node.left);
            }
            path.replaceWith(_core.types.conditionalExpression(noDocumentAll ? _core.types.binaryExpression("!=", assignment, _core.types.nullLiteral()) : _core.types.logicalExpression("&&", _core.types.binaryExpression("!==", assignment, _core.types.nullLiteral()), _core.types.binaryExpression("!==", _core.types.cloneNode(ref), scope.buildUndefinedNode())), _core.types.cloneNode(ref), node.right));
          }
        }
      };
    });
  }
});

// node_modules/@babel/plugin-transform-optional-chaining/lib/index.js
var require_lib38 = __commonJS({
  "node_modules/@babel/plugin-transform-optional-chaining/lib/index.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    var helperPluginUtils = require_lib15();
    var core = require_lib27();
    var helperSkipTransparentExpressionWrappers = require_lib21();
    function willPathCastToBoolean(path) {
      const maybeWrapped = findOutermostTransparentParent(path);
      const {
        node,
        parentPath
      } = maybeWrapped;
      if (parentPath.isLogicalExpression()) {
        const {
          operator,
          right
        } = parentPath.node;
        if (operator === "&&" || operator === "||" || operator === "??" && node === right) {
          return willPathCastToBoolean(parentPath);
        }
      }
      if (parentPath.isSequenceExpression()) {
        const {
          expressions
        } = parentPath.node;
        if (expressions[expressions.length - 1] === node) {
          return willPathCastToBoolean(parentPath);
        } else {
          return true;
        }
      }
      return parentPath.isConditional({
        test: node
      }) || parentPath.isUnaryExpression({
        operator: "!"
      }) || parentPath.isForStatement({
        test: node
      }) || parentPath.isWhile({
        test: node
      });
    }
    function findOutermostTransparentParent(path) {
      let maybeWrapped = path;
      path.findParent((p) => {
        if (!helperSkipTransparentExpressionWrappers.isTransparentExprWrapper(p.node)) return true;
        maybeWrapped = p;
      });
      return maybeWrapped;
    }
    var last = (arr) => arr[arr.length - 1];
    function isSimpleMemberExpression(expression) {
      expression = helperSkipTransparentExpressionWrappers.skipTransparentExprWrapperNodes(expression);
      return core.types.isIdentifier(expression) || core.types.isSuper(expression) || core.types.isMemberExpression(expression) && !expression.computed && isSimpleMemberExpression(expression.object);
    }
    function needsMemoize(path) {
      let optionalPath = path;
      const {
        scope
      } = path;
      while (optionalPath.isOptionalMemberExpression() || optionalPath.isOptionalCallExpression()) {
        const {
          node
        } = optionalPath;
        const childPath = helperSkipTransparentExpressionWrappers.skipTransparentExprWrappers(optionalPath.isOptionalMemberExpression() ? optionalPath.get("object") : optionalPath.get("callee"));
        if (node.optional) {
          return !scope.isStatic(childPath.node);
        }
        optionalPath = childPath;
      }
    }
    var NULLISH_CHECK = core.template.expression(`%%check%% === null || %%ref%% === void 0`);
    var NULLISH_CHECK_NO_DDA = core.template.expression(`%%check%% == null`);
    var NULLISH_CHECK_NEG = core.template.expression(`%%check%% !== null && %%ref%% !== void 0`);
    var NULLISH_CHECK_NO_DDA_NEG = core.template.expression(`%%check%% != null`);
    function transformOptionalChain(path, {
      pureGetters,
      noDocumentAll
    }, replacementPath, ifNullish, wrapLast) {
      const {
        scope
      } = path;
      if (scope.path.isPattern() && needsMemoize(path)) {
        replacementPath.replaceWith(core.template.expression.ast`(() => ${replacementPath.node})()`);
        return;
      }
      const optionals = [];
      let optionalPath = path;
      while (optionalPath.isOptionalMemberExpression() || optionalPath.isOptionalCallExpression()) {
        const {
          node
        } = optionalPath;
        if (node.optional) {
          optionals.push(node);
        }
        if (optionalPath.isOptionalMemberExpression()) {
          optionalPath.node.type = "MemberExpression";
          optionalPath = helperSkipTransparentExpressionWrappers.skipTransparentExprWrappers(optionalPath.get("object"));
        } else if (optionalPath.isOptionalCallExpression()) {
          optionalPath.node.type = "CallExpression";
          optionalPath = helperSkipTransparentExpressionWrappers.skipTransparentExprWrappers(optionalPath.get("callee"));
        }
      }
      if (optionals.length === 0) {
        return;
      }
      const checks = [];
      let tmpVar;
      for (let i = optionals.length - 1; i >= 0; i--) {
        const node = optionals[i];
        const isCall = core.types.isCallExpression(node);
        const chainWithTypes = isCall ? node.callee : node.object;
        const chain = helperSkipTransparentExpressionWrappers.skipTransparentExprWrapperNodes(chainWithTypes);
        let ref;
        let check2;
        if (isCall && core.types.isIdentifier(chain, {
          name: "eval"
        })) {
          check2 = ref = chain;
          node.callee = core.types.sequenceExpression([core.types.numericLiteral(0), ref]);
        } else if (pureGetters && isCall && isSimpleMemberExpression(chain)) {
          check2 = ref = node.callee;
        } else if (scope.isStatic(chain)) {
          check2 = ref = chainWithTypes;
        } else {
          if (!tmpVar || isCall) {
            tmpVar = scope.generateUidIdentifierBasedOnNode(chain);
            scope.push({
              id: core.types.cloneNode(tmpVar)
            });
          }
          ref = tmpVar;
          check2 = core.types.assignmentExpression("=", core.types.cloneNode(tmpVar), chainWithTypes);
          if (isCall) {
            node.callee = ref;
          } else {
            node.object = ref;
          }
        }
        if (isCall && core.types.isMemberExpression(chain)) {
          if (pureGetters && isSimpleMemberExpression(chain)) {
            node.callee = chainWithTypes;
          } else {
            const {
              object
            } = chain;
            let context;
            if (core.types.isSuper(object)) {
              context = core.types.thisExpression();
            } else {
              const memoized = scope.maybeGenerateMemoised(object);
              if (memoized) {
                context = memoized;
                chain.object = core.types.assignmentExpression("=", memoized, object);
              } else {
                context = object;
              }
            }
            node.arguments.unshift(core.types.cloneNode(context));
            node.callee = core.types.memberExpression(node.callee, core.types.identifier("call"));
          }
        }
        const data = {
          check: core.types.cloneNode(check2),
          ref: core.types.cloneNode(ref)
        };
        Object.defineProperty(data, "ref", {
          enumerable: false
        });
        checks.push(data);
      }
      let result = replacementPath.node;
      if (wrapLast) result = wrapLast(result);
      const ifNullishBoolean = core.types.isBooleanLiteral(ifNullish);
      const ifNullishFalse = ifNullishBoolean && ifNullish.value === false;
      const ifNullishVoid = !ifNullishBoolean && core.types.isUnaryExpression(ifNullish, {
        operator: "void"
      });
      const isEvaluationValueIgnored = core.types.isExpressionStatement(replacementPath.parent) && !replacementPath.isCompletionRecord() || core.types.isSequenceExpression(replacementPath.parent) && last(replacementPath.parent.expressions) !== replacementPath.node;
      const tpl = ifNullishFalse ? noDocumentAll ? NULLISH_CHECK_NO_DDA_NEG : NULLISH_CHECK_NEG : noDocumentAll ? NULLISH_CHECK_NO_DDA : NULLISH_CHECK;
      const logicalOp = ifNullishFalse ? "&&" : "||";
      const check = checks.map(tpl).reduce((expr, check2) => core.types.logicalExpression(logicalOp, expr, check2));
      replacementPath.replaceWith(ifNullishBoolean || ifNullishVoid && isEvaluationValueIgnored ? core.types.logicalExpression(logicalOp, check, result) : core.types.conditionalExpression(check, ifNullish, result));
    }
    function transform2(path, assumptions) {
      const {
        scope
      } = path;
      const maybeWrapped = findOutermostTransparentParent(path);
      const {
        parentPath
      } = maybeWrapped;
      if (parentPath.isUnaryExpression({
        operator: "delete"
      })) {
        transformOptionalChain(path, assumptions, parentPath, core.types.booleanLiteral(true));
      } else {
        let wrapLast;
        if (parentPath.isCallExpression({
          callee: maybeWrapped.node
        }) && path.isOptionalMemberExpression()) {
          wrapLast = (replacement) => {
            const object = helperSkipTransparentExpressionWrappers.skipTransparentExprWrapperNodes(replacement.object);
            let baseRef;
            if (!assumptions.pureGetters || !isSimpleMemberExpression(object)) {
              baseRef = scope.maybeGenerateMemoised(object);
              if (baseRef) {
                replacement.object = core.types.assignmentExpression("=", baseRef, object);
              }
            }
            return core.types.callExpression(core.types.memberExpression(replacement, core.types.identifier("bind")), [core.types.cloneNode(baseRef != null ? baseRef : object)]);
          };
        }
        transformOptionalChain(path, assumptions, path, willPathCastToBoolean(maybeWrapped) ? core.types.booleanLiteral(false) : scope.buildUndefinedNode(), wrapLast);
      }
    }
    var index = helperPluginUtils.declare((api, options) => {
      var _api$assumption, _api$assumption2;
      api.assertVersion("^7.0.0-0 || ^8.0.0-0 || >8.0.0-alpha <8.0.0-beta");
      const {
        loose = false
      } = options;
      const noDocumentAll = (_api$assumption = api.assumption("noDocumentAll")) != null ? _api$assumption : loose;
      const pureGetters = (_api$assumption2 = api.assumption("pureGetters")) != null ? _api$assumption2 : loose;
      return {
        name: "transform-optional-chaining",
        manipulateOptions: (_, parser) => parser.plugins.push("optionalChaining"),
        visitor: {
          "OptionalCallExpression|OptionalMemberExpression"(path) {
            transform2(path, {
              noDocumentAll,
              pureGetters
            });
          }
        }
      };
    });
    exports2.default = index;
    exports2.transform = transform2;
    exports2.transformOptionalChain = transformOptionalChain;
  }
});

// node_modules/@babel/plugin-transform-private-methods/lib/index.js
var require_lib39 = __commonJS({
  "node_modules/@babel/plugin-transform-private-methods/lib/index.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = void 0;
    var _helperPluginUtils = require_lib15();
    var _helperCreateClassFeaturesPlugin = require_lib22();
    var _default = exports2.default = (0, _helperPluginUtils.declare)((api, options) => {
      api.assertVersion("^7.0.0-0 || ^8.0.0-0 || >8.0.0-alpha <8.0.0-beta");
      return (0, _helperCreateClassFeaturesPlugin.createClassFeaturePlugin)({
        name: "transform-private-methods",
        api,
        feature: _helperCreateClassFeaturesPlugin.FEATURES.privateMethods,
        loose: options.loose,
        manipulateOptions(opts, parserOpts) {
          parserOpts.plugins.push("classPrivateMethods");
        }
      });
    });
  }
});

// node_modules/@babel/plugin-syntax-json-strings/lib/index.js
var require_lib40 = __commonJS({
  "node_modules/@babel/plugin-syntax-json-strings/lib/index.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = void 0;
    var _helperPluginUtils = require_lib15();
    var _default = (0, _helperPluginUtils.declare)((api) => {
      api.assertVersion(7);
      return {
        name: "syntax-json-strings",
        manipulateOptions(opts, parserOpts) {
          parserOpts.plugins.push("jsonStrings");
        }
      };
    });
    exports2.default = _default;
  }
});

// node_modules/@babel/plugin-syntax-optional-catch-binding/lib/index.js
var require_lib41 = __commonJS({
  "node_modules/@babel/plugin-syntax-optional-catch-binding/lib/index.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = void 0;
    var _helperPluginUtils = require_lib15();
    var _default = (0, _helperPluginUtils.declare)((api) => {
      api.assertVersion(7);
      return {
        name: "syntax-optional-catch-binding",
        manipulateOptions(opts, parserOpts) {
          parserOpts.plugins.push("optionalCatchBinding");
        }
      };
    });
    exports2.default = _default;
  }
});

// node_modules/@babel/plugin-syntax-async-generators/lib/index.js
var require_lib42 = __commonJS({
  "node_modules/@babel/plugin-syntax-async-generators/lib/index.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = void 0;
    var _helperPluginUtils = require_lib15();
    var _default = (0, _helperPluginUtils.declare)((api) => {
      api.assertVersion(7);
      return {
        name: "syntax-async-generators",
        manipulateOptions(opts, parserOpts) {
          parserOpts.plugins.push("asyncGenerators");
        }
      };
    });
    exports2.default = _default;
  }
});

// node_modules/@babel/plugin-syntax-object-rest-spread/lib/index.js
var require_lib43 = __commonJS({
  "node_modules/@babel/plugin-syntax-object-rest-spread/lib/index.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = void 0;
    var _helperPluginUtils = require_lib15();
    var _default = (0, _helperPluginUtils.declare)((api) => {
      api.assertVersion(7);
      return {
        name: "syntax-object-rest-spread",
        manipulateOptions(opts, parserOpts) {
          parserOpts.plugins.push("objectRestSpread");
        }
      };
    });
    exports2.default = _default;
  }
});

// node_modules/@babel/plugin-transform-export-namespace-from/lib/index.js
var require_lib44 = __commonJS({
  "node_modules/@babel/plugin-transform-export-namespace-from/lib/index.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = void 0;
    var _helperPluginUtils = require_lib15();
    var _core = require_lib27();
    var _default = exports2.default = (0, _helperPluginUtils.declare)((api) => {
      api.assertVersion(7);
      return {
        name: "transform-export-namespace-from",
        manipulateOptions: (_, parser) => parser.plugins.push("exportNamespaceFrom"),
        visitor: {
          ExportNamedDeclaration(path) {
            var _exported$name;
            const {
              node,
              scope
            } = path;
            const {
              specifiers
            } = node;
            const index = _core.types.isExportDefaultSpecifier(specifiers[0]) ? 1 : 0;
            if (!_core.types.isExportNamespaceSpecifier(specifiers[index])) return;
            const nodes = [];
            if (index === 1) {
              nodes.push(_core.types.exportNamedDeclaration(null, [specifiers.shift()], node.source));
            }
            const specifier = specifiers.shift();
            const {
              exported
            } = specifier;
            const uid = scope.generateUidIdentifier((_exported$name = exported.name) != null ? _exported$name : exported.value);
            nodes.push(_core.types.importDeclaration([_core.types.importNamespaceSpecifier(uid)], _core.types.cloneNode(node.source)), _core.types.exportNamedDeclaration(null, [_core.types.exportSpecifier(_core.types.cloneNode(uid), exported)]));
            if (node.specifiers.length >= 1) {
              nodes.push(node);
            }
            const [importDeclaration] = path.replaceWithMultiple(nodes);
            path.scope.registerDeclaration(importDeclaration);
          }
        }
      };
    });
  }
});

// node_modules/@babel/plugin-transform-react-jsx/lib/create-plugin.js
var require_create_plugin = __commonJS({
  "node_modules/@babel/plugin-transform-react-jsx/lib/create-plugin.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = createPlugin;
    var _pluginSyntaxJsx = require_lib24();
    var _helperPluginUtils = require_lib15();
    var _core = require_lib27();
    var _helperModuleImports = require_lib10();
    var _helperAnnotateAsPure = require_lib20();
    var DEFAULT = {
      importSource: "react",
      runtime: "automatic",
      pragma: "React.createElement",
      pragmaFrag: "React.Fragment"
    };
    var JSX_SOURCE_ANNOTATION_REGEX = /^\s*(?:\*\s*)?@jsxImportSource\s+(\S+)\s*$/m;
    var JSX_RUNTIME_ANNOTATION_REGEX = /^\s*(?:\*\s*)?@jsxRuntime\s+(\S+)\s*$/m;
    var JSX_ANNOTATION_REGEX = /^\s*(?:\*\s*)?@jsx\s+(\S+)\s*$/m;
    var JSX_FRAG_ANNOTATION_REGEX = /^\s*(?:\*\s*)?@jsxFrag\s+(\S+)\s*$/m;
    var get = (pass, name) => pass.get(`@babel/plugin-react-jsx/${name}`);
    var set = (pass, name, v) => pass.set(`@babel/plugin-react-jsx/${name}`, v);
    function hasProto(node) {
      return node.properties.some((value2) => _core.types.isObjectProperty(value2, {
        computed: false,
        shorthand: false
      }) && (_core.types.isIdentifier(value2.key, {
        name: "__proto__"
      }) || _core.types.isStringLiteral(value2.key, {
        value: "__proto__"
      })));
    }
    function createPlugin({
      name,
      development
    }) {
      return (0, _helperPluginUtils.declare)((_, options) => {
        const {
          pure: PURE_ANNOTATION,
          throwIfNamespace = true,
          filter,
          runtime: RUNTIME_DEFAULT = development ? "automatic" : "classic",
          importSource: IMPORT_SOURCE_DEFAULT = DEFAULT.importSource,
          pragma: PRAGMA_DEFAULT = DEFAULT.pragma,
          pragmaFrag: PRAGMA_FRAG_DEFAULT = DEFAULT.pragmaFrag
        } = options;
        var {
          useSpread = false,
          useBuiltIns = false
        } = options;
        if (RUNTIME_DEFAULT === "classic") {
          if (typeof useSpread !== "boolean") {
            throw new Error("transform-react-jsx currently only accepts a boolean option for useSpread (defaults to false)");
          }
          if (typeof useBuiltIns !== "boolean") {
            throw new Error("transform-react-jsx currently only accepts a boolean option for useBuiltIns (defaults to false)");
          }
          if (useSpread && useBuiltIns) {
            throw new Error("transform-react-jsx currently only accepts useBuiltIns or useSpread but not both");
          }
        }
        let commentsNode = null;
        return {
          name,
          inherits: _pluginSyntaxJsx.default,
          visitor: {
            JSXNamespacedName(path) {
              if (throwIfNamespace) {
                throw path.buildCodeFrameError(`Namespace tags are not supported by default. React's JSX doesn't support namespace tags. You can set \`throwIfNamespace: false\` to bypass this warning.`);
              }
            },
            JSXSpreadChild(path) {
              throw path.buildCodeFrameError("Spread children are not supported in React.");
            },
            Program: {
              enter(path, state) {
                const {
                  file
                } = state;
                let runtime = RUNTIME_DEFAULT;
                let source = IMPORT_SOURCE_DEFAULT;
                let pragma = PRAGMA_DEFAULT;
                let pragmaFrag = PRAGMA_FRAG_DEFAULT;
                let sourceSet = !!options.importSource;
                let pragmaSet = !!options.pragma;
                let pragmaFragSet = !!options.pragmaFrag;
                if (file.ast.comments) {
                  for (const comment of file.ast.comments) {
                    const sourceMatches = JSX_SOURCE_ANNOTATION_REGEX.exec(comment.value);
                    if (sourceMatches) {
                      source = sourceMatches[1];
                      sourceSet = true;
                    }
                    const runtimeMatches = JSX_RUNTIME_ANNOTATION_REGEX.exec(comment.value);
                    if (runtimeMatches) {
                      runtime = runtimeMatches[1];
                    }
                    const jsxMatches = JSX_ANNOTATION_REGEX.exec(comment.value);
                    if (jsxMatches) {
                      pragma = jsxMatches[1];
                      pragmaSet = true;
                    }
                    const jsxFragMatches = JSX_FRAG_ANNOTATION_REGEX.exec(comment.value);
                    if (jsxFragMatches) {
                      pragmaFrag = jsxFragMatches[1];
                      pragmaFragSet = true;
                    }
                  }
                }
                set(state, "runtime", runtime);
                if (runtime === "classic") {
                  if (sourceSet) {
                    throw path.buildCodeFrameError(`importSource cannot be set when runtime is classic.`);
                  }
                  const createElement = toMemberExpression(pragma);
                  const fragment = toMemberExpression(pragmaFrag);
                  set(state, "id/createElement", () => _core.types.cloneNode(createElement));
                  set(state, "id/fragment", () => _core.types.cloneNode(fragment));
                  set(state, "defaultPure", pragma === DEFAULT.pragma);
                } else if (runtime === "automatic") {
                  if (pragmaSet || pragmaFragSet) {
                    throw path.buildCodeFrameError(`pragma and pragmaFrag cannot be set when runtime is automatic.`);
                  }
                  const define2 = (name2, id) => set(state, name2, createImportLazily(state, path, id, source));
                  define2("id/jsx", development ? "jsxDEV" : "jsx");
                  define2("id/jsxs", development ? "jsxDEV" : "jsxs");
                  define2("id/createElement", "createElement");
                  define2("id/fragment", "Fragment");
                  set(state, "defaultPure", source === DEFAULT.importSource);
                } else {
                  throw path.buildCodeFrameError(`Runtime must be either "classic" or "automatic".`);
                }
                if (development) {
                  let isDerivedClass = function(classNode) {
                    return classNode.superClass !== null;
                  }, isThisAllowed = function(parents) {
                    let i = parents.length - 1;
                    do {
                      const {
                        node
                      } = parents[i];
                      if (_core.types.isFunctionParent(node) && !_core.types.isArrowFunctionExpression(node)) {
                        if (!_core.types.isMethod(node)) {
                          return true;
                        }
                        if (node.kind !== "constructor") {
                          return true;
                        }
                        return !isDerivedClass(parents[i - 2].node);
                      }
                      if (_core.types.isTSModuleBlock(node)) {
                        return false;
                      }
                    } while (i-- > 0);
                    return true;
                  }, makeSource = function(node) {
                    const location = node.loc;
                    if (!location) {
                      return path.scope.buildUndefinedNode();
                    }
                    if (!fileNameIdentifier) {
                      fileNameIdentifier = path.scope.generateUidIdentifier("_jsxFileName");
                    }
                    return makeTrace(_core.types.cloneNode(fileNameIdentifier), location.start.line, location.start.column);
                  }, makeTrace = function(fileNameIdentifier2, lineNumber, column0Based) {
                    const fileLineLiteral = lineNumber != null ? _core.types.numericLiteral(lineNumber) : _core.types.nullLiteral();
                    const fileColumnLiteral = column0Based != null ? _core.types.numericLiteral(column0Based + 1) : _core.types.nullLiteral();
                    return _core.template.expression.ast`{
                    fileName: ${fileNameIdentifier2},
                    lineNumber: ${fileLineLiteral},
                    columnNumber: ${fileColumnLiteral},
                  }`;
                  };
                  let fileNameIdentifier;
                  _core.types.traverse(path.node, {
                    enter(node, parents) {
                      if (!_core.types.isJSXOpeningElement(node)) {
                        return;
                      }
                      const attributes = node.attributes;
                      if (isThisAllowed(parents)) {
                        attributes.push(_core.types.jsxAttribute(_core.types.jsxIdentifier("__self"), _core.types.jsxExpressionContainer(_core.types.thisExpression())));
                      }
                      attributes.push(_core.types.jsxAttribute(_core.types.jsxIdentifier("__source"), _core.types.jsxExpressionContainer(makeSource(node))));
                    }
                  });
                  if (fileNameIdentifier) {
                    const {
                      filename = ""
                    } = state;
                    path.scope.push({
                      id: fileNameIdentifier,
                      init: _core.types.stringLiteral(filename)
                    });
                  }
                }
              }
            },
            JSXFragment: {
              exit(path, file) {
                let callExpr;
                if (get(file, "runtime") === "classic") {
                  callExpr = buildCreateElementFragmentCall(path, file);
                } else {
                  callExpr = buildJSXFragmentCall(path, file);
                }
                path.replaceWith(_core.types.inherits(callExpr, path.node));
              }
            },
            JSXElement: {
              exit(path, file) {
                let callExpr;
                if (get(file, "runtime") === "classic" || shouldUseCreateElement(path)) {
                  callExpr = buildCreateElementCall(path, file);
                } else {
                  callExpr = buildJSXElementCall(path, file);
                }
                path.replaceWith(_core.types.inherits(callExpr, path.node));
              }
            },
            JSXAttribute(path) {
              if (_core.types.isJSXElement(path.node.value)) {
                path.node.value = _core.types.jsxExpressionContainer(path.node.value);
              }
            }
          }
        };
        function call(pass, name2, args) {
          const node = _core.types.callExpression(get(pass, `id/${name2}`)(), args);
          if (PURE_ANNOTATION != null ? PURE_ANNOTATION : get(pass, "defaultPure")) (0, _helperAnnotateAsPure.default)(node);
          return node;
        }
        function shouldUseCreateElement(path) {
          const openingPath = path.get("openingElement");
          const attributes = openingPath.node.attributes;
          let seenPropsSpread = false;
          for (let i = 0; i < attributes.length; i++) {
            const attr = attributes[i];
            if (seenPropsSpread && _core.types.isJSXAttribute(attr) && attr.name.name === "key") {
              return true;
            } else if (_core.types.isJSXSpreadAttribute(attr)) {
              seenPropsSpread = true;
            }
          }
          return false;
        }
        function convertJSXIdentifier(node, parent) {
          if (_core.types.isJSXIdentifier(node)) {
            if (node.name === "this" && _core.types.isReferenced(node, parent)) {
              return _core.types.thisExpression();
            } else if (_core.types.isValidIdentifier(node.name, false)) {
              node.type = "Identifier";
              return node;
            } else {
              return _core.types.stringLiteral(node.name);
            }
          } else if (_core.types.isJSXMemberExpression(node)) {
            return _core.types.memberExpression(convertJSXIdentifier(node.object, node), convertJSXIdentifier(node.property, node));
          } else if (_core.types.isJSXNamespacedName(node)) {
            return _core.types.stringLiteral(`${node.namespace.name}:${node.name.name}`);
          }
          return node;
        }
        function convertAttributeValue(node) {
          if (_core.types.isJSXExpressionContainer(node)) {
            return node.expression;
          } else {
            return node;
          }
        }
        function processComments(attribs) {
          commentsNode = null;
          if (attribs.length && attribs[0].isJSXSpreadAttribute()) {
            const node = attribs[0].node.argument;
            if (node.leadingComments || node.trailingComments) {
              commentsNode = _core.types.cloneNode(node);
            }
          }
        }
        function accumulateAttribute(array, attribute) {
          if (_core.types.isJSXSpreadAttribute(attribute.node)) {
            const arg = attribute.node.argument;
            if (_core.types.isObjectExpression(arg) && !hasProto(arg)) {
              array.push(...arg.properties);
            } else {
              array.push(_core.types.spreadElement(arg));
            }
            return array;
          }
          const value2 = convertAttributeValue(attribute.node.name.name !== "key" ? attribute.node.value || _core.types.booleanLiteral(true) : attribute.node.value);
          if (attribute.node.name.name === "key" && value2 === null) {
            throw attribute.buildCodeFrameError('Please provide an explicit key value. Using "key" as a shorthand for "key={true}" is not allowed.');
          }
          if (_core.types.isStringLiteral(value2) && !_core.types.isJSXExpressionContainer(attribute.node.value)) {
            var _value$extra;
            value2.value = value2.value.replace(/\n\s+/g, " ");
            (_value$extra = value2.extra) == null || delete _value$extra.raw;
          }
          if (_core.types.isJSXNamespacedName(attribute.node.name)) {
            attribute.node.name = _core.types.stringLiteral(attribute.node.name.namespace.name + ":" + attribute.node.name.name.name);
          } else if (_core.types.isValidIdentifier(attribute.node.name.name, false)) {
            attribute.node.name.type = "Identifier";
          } else {
            attribute.node.name = _core.types.stringLiteral(attribute.node.name.name);
          }
          array.push(_core.types.inherits(_core.types.objectProperty(attribute.node.name, value2), attribute.node));
          return array;
        }
        function buildChildrenProperty(children) {
          let childrenNode;
          if (children.length === 1) {
            childrenNode = children[0];
          } else if (children.length > 1) {
            childrenNode = _core.types.arrayExpression(children);
          } else {
            return void 0;
          }
          return _core.types.objectProperty(_core.types.identifier("children"), childrenNode);
        }
        function buildJSXElementCall(path, file) {
          const openingPath = path.get("openingElement");
          const args = [getTag(openingPath)];
          const attribsArray = [];
          const extracted = /* @__PURE__ */ Object.create(null);
          for (const attr of openingPath.get("attributes")) {
            if (attr.isJSXAttribute() && _core.types.isJSXIdentifier(attr.node.name)) {
              const {
                name: name2
              } = attr.node.name;
              switch (name2) {
                case "__source":
                case "__self":
                  if (extracted[name2]) throw sourceSelfError(path, name2);
                case "key": {
                  const keyValue = convertAttributeValue(attr.node.value);
                  if (keyValue === null) {
                    throw attr.buildCodeFrameError('Please provide an explicit key value. Using "key" as a shorthand for "key={true}" is not allowed.');
                  }
                  extracted[name2] = keyValue;
                  break;
                }
                default:
                  attribsArray.push(attr);
              }
            } else {
              attribsArray.push(attr);
            }
          }
          const children = _core.types.react.buildChildren(path.node);
          let attribs;
          if (attribsArray.length || children.length) {
            attribs = buildJSXOpeningElementAttributes(attribsArray, children);
            if (commentsNode) {
              _core.types.inheritsComments(attribs, commentsNode);
            }
          } else {
            attribs = _core.types.objectExpression([]);
          }
          args.push(attribs);
          if (development) {
            var _extracted$key;
            args.push((_extracted$key = extracted.key) != null ? _extracted$key : path.scope.buildUndefinedNode(), _core.types.booleanLiteral(children.length > 1));
            if (extracted.__source) {
              args.push(extracted.__source);
              if (extracted.__self) args.push(extracted.__self);
            } else if (extracted.__self) {
              args.push(path.scope.buildUndefinedNode(), extracted.__self);
            }
          } else if (extracted.key !== void 0) {
            args.push(extracted.key);
          }
          return call(file, children.length > 1 ? "jsxs" : "jsx", args);
        }
        function buildJSXOpeningElementAttributes(attribs, children) {
          processComments(attribs);
          const props = attribs.reduce(accumulateAttribute, []);
          if ((children == null ? void 0 : children.length) > 0) {
            props.push(buildChildrenProperty(children));
          }
          return _core.types.objectExpression(props);
        }
        function buildJSXFragmentCall(path, file) {
          const args = [get(file, "id/fragment")()];
          const children = _core.types.react.buildChildren(path.node);
          args.push(_core.types.objectExpression(children.length > 0 ? [buildChildrenProperty(children)] : []));
          if (development) {
            args.push(path.scope.buildUndefinedNode(), _core.types.booleanLiteral(children.length > 1));
          }
          return call(file, children.length > 1 ? "jsxs" : "jsx", args);
        }
        function buildCreateElementFragmentCall(path, file) {
          if (filter && !filter(path.node, file)) return;
          return call(file, "createElement", [get(file, "id/fragment")(), _core.types.nullLiteral(), ..._core.types.react.buildChildren(path.node)]);
        }
        function buildCreateElementCall(path, file) {
          const openingPath = path.get("openingElement");
          return call(file, "createElement", [getTag(openingPath), buildCreateElementOpeningElementAttributes(file, path, openingPath.get("attributes")), ..._core.types.react.buildChildren(path.node)]);
        }
        function getTag(openingPath) {
          const tagExpr = convertJSXIdentifier(openingPath.node.name, openingPath.node);
          let tagName;
          if (_core.types.isIdentifier(tagExpr)) {
            tagName = tagExpr.name;
          } else if (_core.types.isStringLiteral(tagExpr)) {
            tagName = tagExpr.value;
          }
          if (_core.types.react.isCompatTag(tagName)) {
            return _core.types.stringLiteral(tagName);
          } else {
            return tagExpr;
          }
        }
        function buildCreateElementOpeningElementAttributes(file, path, attribs) {
          const runtime = get(file, "runtime");
          if (runtime !== "automatic") {
            const objs = [];
            processComments(attribs);
            const props2 = attribs.reduce(accumulateAttribute, []);
            if (!useSpread) {
              let start = 0;
              props2.forEach((prop, i) => {
                if (_core.types.isSpreadElement(prop)) {
                  if (i > start) {
                    objs.push(_core.types.objectExpression(props2.slice(start, i)));
                  }
                  objs.push(prop.argument);
                  start = i + 1;
                }
              });
              if (props2.length > start) {
                objs.push(_core.types.objectExpression(props2.slice(start)));
              }
            } else if (props2.length) {
              objs.push(_core.types.objectExpression(props2));
            }
            if (!objs.length) {
              return _core.types.nullLiteral();
            }
            if (commentsNode) {
              _core.types.inheritsComments(objs[0], commentsNode);
            }
            if (objs.length === 1) {
              if (!(_core.types.isSpreadElement(props2[0]) && _core.types.isObjectExpression(props2[0].argument))) {
                return objs[0];
              }
            }
            if (!_core.types.isObjectExpression(objs[0])) {
              objs.unshift(_core.types.objectExpression([]));
            }
            const helper = useBuiltIns ? _core.types.memberExpression(_core.types.identifier("Object"), _core.types.identifier("assign")) : file.addHelper("extends");
            return _core.types.callExpression(helper, objs);
          }
          const props = [];
          const found = /* @__PURE__ */ Object.create(null);
          processComments(attribs);
          for (const attr of attribs) {
            const {
              node
            } = attr;
            const name2 = _core.types.isJSXAttribute(node) && _core.types.isJSXIdentifier(node.name) && node.name.name;
            if (runtime === "automatic" && (name2 === "__source" || name2 === "__self")) {
              if (found[name2]) throw sourceSelfError(path, name2);
              found[name2] = true;
            }
            accumulateAttribute(props, attr);
          }
          const ret = props.length === 1 && _core.types.isSpreadElement(props[0]) && !_core.types.isObjectExpression(props[0].argument) ? props[0].argument : props.length > 0 ? _core.types.objectExpression(props) : _core.types.nullLiteral();
          if (commentsNode) {
            _core.types.inheritsComments(ret, commentsNode);
          }
          return ret;
        }
      });
      function getSource(source, importName) {
        switch (importName) {
          case "Fragment":
            return `${source}/${development ? "jsx-dev-runtime" : "jsx-runtime"}`;
          case "jsxDEV":
            return `${source}/jsx-dev-runtime`;
          case "jsx":
          case "jsxs":
            return `${source}/jsx-runtime`;
          case "createElement":
            return source;
        }
      }
      function createImportLazily(pass, path, importName, source) {
        return () => {
          const actualSource = getSource(source, importName);
          if ((0, _helperModuleImports.isModule)(path)) {
            let reference = get(pass, `imports/${importName}`);
            if (reference) return _core.types.cloneNode(reference);
            reference = (0, _helperModuleImports.addNamed)(path, importName, actualSource, {
              importedInterop: "uncompiled",
              importPosition: "after"
            });
            set(pass, `imports/${importName}`, reference);
            return reference;
          } else {
            let reference = get(pass, `requires/${actualSource}`);
            if (reference) {
              reference = _core.types.cloneNode(reference);
            } else {
              reference = (0, _helperModuleImports.addNamespace)(path, actualSource, {
                importedInterop: "uncompiled"
              });
              set(pass, `requires/${actualSource}`, reference);
            }
            return _core.types.memberExpression(reference, _core.types.identifier(importName));
          }
        };
      }
    }
    function toMemberExpression(id) {
      return id.split(".").map((name) => _core.types.identifier(name)).reduce((object, property) => _core.types.memberExpression(object, property));
    }
    function sourceSelfError(path, name) {
      const pluginName = `transform-react-jsx-${name.slice(2)}`;
      return path.buildCodeFrameError(`Duplicate ${name} prop found. You are most likely using the deprecated ${pluginName} Babel plugin. Both __source and __self are automatically set when using the automatic runtime. Please remove transform-react-jsx-source and transform-react-jsx-self from your Babel config.`);
    }
  }
});

// node_modules/@babel/plugin-transform-react-jsx/lib/index.js
var require_lib45 = __commonJS({
  "node_modules/@babel/plugin-transform-react-jsx/lib/index.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", {
      value: true
    });
    exports2.default = void 0;
    var _createPlugin = require_create_plugin();
    var _default = exports2.default = (0, _createPlugin.default)({
      name: "transform-react-jsx",
      development: false
    });
  }
});

// packages/playwright/src/transform/babelBundle.ts
var babelBundle_exports = {};
__export(babelBundle_exports, {
  babelParse: () => babelParse,
  babelTransform: () => babelTransform,
  codeFrameColumns: () => import_code_frame.codeFrameColumns,
  declare: () => import_helper_plugin_utils.declare,
  traverse: () => traverse,
  types: () => import_core.types
});
module.exports = __toCommonJS(babelBundle_exports);
var babel = __toESM(require_lib27());
var import_traverse = __toESM(require_lib9());
var import_code_frame = __toESM(require_lib5());
var import_helper_plugin_utils = __toESM(require_lib15());
var import_core = __toESM(require_lib27());
var traverse = import_traverse.default;
function babelTransformOptions(isTypeScript2, isModule, pluginsPrologue, pluginsEpilogue, jsxImportSource) {
  const plugins = [
    [require_lib28(), { deprecatedAssertSyntax: true }]
  ];
  if (isTypeScript2) {
    plugins.push(
      [require_lib30(), { version: "2023-05" }],
      [require_lib32()],
      [require_lib33()],
      [require_lib34()],
      [require_lib35()],
      [require_lib36()],
      [require_lib37()],
      [require_lib38()],
      [require_lib39()],
      [require_lib40()],
      [require_lib41()],
      [require_lib42()],
      [require_lib43()],
      [require_lib44()],
      [
        // From https://github.com/G-Rath/babel-plugin-replace-ts-export-assignment/blob/8dfdca32c8aa428574b0cae341444fc5822f2dc6/src/index.ts
        ({ template }) => ({
          name: "replace-ts-export-assignment",
          visitor: {
            TSExportAssignment(path) {
              path.replaceWith(template("module.exports = ASSIGNMENT;")({
                ASSIGNMENT: path.node.expression
              }));
            }
          }
        })
      ]
    );
  }
  plugins.push([require_lib45(), {
    throwIfNamespace: false,
    runtime: "automatic",
    ...jsxImportSource ? { importSource: jsxImportSource } : {}
  }]);
  if (!isModule) {
    plugins.push([require_lib25()]);
    plugins.push([
      () => ({
        name: "css-to-identity-obj-proxy",
        visitor: {
          ImportDeclaration(path) {
            if (path.node.source.value.match(/\.(css|less|scss)$/))
              path.remove();
          }
        }
      })
    ]);
  }
  return {
    browserslistConfigFile: false,
    babelrc: false,
    configFile: false,
    assumptions: {
      // Without this, babel defines a top level function that
      // breaks playwright evaluates.
      setPublicClassFields: true
    },
    presets: isTypeScript2 ? [
      [require_lib26(), { onlyRemoveTypeImports: false }]
    ] : [],
    plugins: [
      ...pluginsPrologue.map(([name, options]) => [require(name), options]),
      ...plugins,
      ...pluginsEpilogue.map(([name, options]) => [require(name), options])
    ],
    compact: false,
    sourceMaps: "both"
  };
}
var isTransforming = false;
function isTypeScript(filename) {
  return filename.endsWith(".ts") || filename.endsWith(".tsx") || filename.endsWith(".mts") || filename.endsWith(".cts");
}
function babelTransform(code, filename, isModule, pluginsPrologue, pluginsEpilogue, jsxImportSource) {
  if (isTransforming)
    return null;
  isTransforming = true;
  try {
    const options = babelTransformOptions(isTypeScript(filename), isModule, pluginsPrologue, pluginsEpilogue, jsxImportSource);
    return babel.transform(code, { filename, ...options });
  } finally {
    isTransforming = false;
  }
}
function babelParse(code, filename, isModule) {
  const options = babelTransformOptions(isTypeScript(filename), isModule, [], []);
  return babel.parse(code, { filename, ...options });
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  babelParse,
  babelTransform,
  codeFrameColumns,
  declare,
  traverse,
  types
});
packages/playwright/lib/transform/babelBundle.js

THIRD-PARTY SOFTWARE NOTICES AND INFORMATION

The following npm packages are inlined into this bundle.

- @ampproject/remapping@2.3.0 (https://github.com/ampproject/remapping)
- @babel/code-frame@7.29.0 (https://github.com/babel/babel)
- @babel/compat-data@7.28.0 (https://github.com/babel/babel)
- @babel/core@7.28.3 (https://github.com/babel/babel)
- @babel/generator@7.29.1 (https://github.com/babel/babel)
- @babel/helper-annotate-as-pure@7.27.3 (https://github.com/babel/babel)
- @babel/helper-compilation-targets@7.27.2 (https://github.com/babel/babel)
- @babel/helper-create-class-features-plugin@7.28.6 (https://github.com/babel/babel)
- @babel/helper-globals@7.28.0 (https://github.com/babel/babel)
- @babel/helper-member-expression-to-functions@7.28.5 (https://github.com/babel/babel)
- @babel/helper-module-imports@7.28.6 (https://github.com/babel/babel)
- @babel/helper-module-transforms@7.28.6 (https://github.com/babel/babel)
- @babel/helper-optimise-call-expression@7.27.1 (https://github.com/babel/babel)
- @babel/helper-plugin-utils@7.28.6 (https://github.com/babel/babel)
- @babel/helper-replace-supers@7.28.6 (https://github.com/babel/babel)
- @babel/helper-skip-transparent-expression-wrappers@7.27.1 (https://github.com/babel/babel)
- @babel/helper-string-parser@7.27.1 (https://github.com/babel/babel)
- @babel/helper-validator-identifier@7.28.5 (https://github.com/babel/babel)
- @babel/helper-validator-option@7.27.1 (https://github.com/babel/babel)
- @babel/helpers@7.28.3 (https://github.com/babel/babel)
- @babel/parser@7.29.2 (https://github.com/babel/babel)
- @babel/plugin-proposal-decorators@7.29.0 (https://github.com/babel/babel)
- @babel/plugin-syntax-async-generators@7.8.4 (https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-async-generators)
- @babel/plugin-syntax-decorators@7.28.6 (https://github.com/babel/babel)
- @babel/plugin-syntax-import-attributes@7.28.6 (https://github.com/babel/babel)
- @babel/plugin-syntax-json-strings@7.8.3 (https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-json-strings)
- @babel/plugin-syntax-jsx@7.28.6 (https://github.com/babel/babel)
- @babel/plugin-syntax-object-rest-spread@7.8.3 (https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-object-rest-spread)
- @babel/plugin-syntax-optional-catch-binding@7.8.3 (https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-optional-catch-binding)
- @babel/plugin-syntax-typescript@7.28.6 (https://github.com/babel/babel)
- @babel/plugin-transform-class-properties@7.28.6 (https://github.com/babel/babel)
- @babel/plugin-transform-class-static-block@7.28.6 (https://github.com/babel/babel)
- @babel/plugin-transform-destructuring@7.28.5 (https://github.com/babel/babel)
- @babel/plugin-transform-explicit-resource-management@7.28.6 (https://github.com/babel/babel)
- @babel/plugin-transform-export-namespace-from@7.27.1 (https://github.com/babel/babel)
- @babel/plugin-transform-logical-assignment-operators@7.28.6 (https://github.com/babel/babel)
- @babel/plugin-transform-modules-commonjs@7.28.6 (https://github.com/babel/babel)
- @babel/plugin-transform-nullish-coalescing-operator@7.28.6 (https://github.com/babel/babel)
- @babel/plugin-transform-numeric-separator@7.28.6 (https://github.com/babel/babel)
- @babel/plugin-transform-optional-chaining@7.28.6 (https://github.com/babel/babel)
- @babel/plugin-transform-private-methods@7.28.6 (https://github.com/babel/babel)
- @babel/plugin-transform-react-jsx@7.28.6 (https://github.com/babel/babel)
- @babel/plugin-transform-typescript@7.28.6 (https://github.com/babel/babel)
- @babel/preset-typescript@7.28.5 (https://github.com/babel/babel)
- @babel/template@7.28.6 (https://github.com/babel/babel)
- @babel/traverse@7.29.0 (https://github.com/babel/babel)
- @babel/types@7.29.0 (https://github.com/babel/babel)
- @jridgewell/gen-mapping@0.3.13 (https://github.com/jridgewell/sourcemaps)
- @jridgewell/resolve-uri@3.1.2 (https://github.com/jridgewell/resolve-uri)
- @jridgewell/sourcemap-codec@1.5.5 (https://github.com/jridgewell/sourcemaps)
- @jridgewell/trace-mapping@0.3.30 (https://github.com/jridgewell/sourcemaps)
- browserslist@4.25.4 (https://github.com/browserslist/browserslist)
- caniuse-lite@1.0.30001739 (https://github.com/browserslist/caniuse-lite)
- convert-source-map@2.0.0 (https://github.com/thlorenz/convert-source-map)
- debug@4.4.3 (https://github.com/debug-js/debug)
- electron-to-chromium@1.5.214 (https://github.com/kilian/electron-to-chromium)
- gensync@1.0.0-beta.2 (https://github.com/loganfsmyth/gensync)
- has-flag@4.0.0 (https://github.com/sindresorhus/has-flag)
- js-tokens@4.0.0 (https://github.com/lydell/js-tokens)
- jsesc@3.1.0 (https://github.com/mathiasbynens/jsesc)
- json5@2.2.3 (https://github.com/json5/json5)
- lru-cache@5.1.1 (https://github.com/isaacs/node-lru-cache)
- ms@2.1.3 (https://github.com/vercel/ms)
- node-releases@2.0.19 (https://github.com/chicoxyzzy/node-releases)
- picocolors@1.1.1 (https://github.com/alexeyraspopov/picocolors)
- semver@6.3.1 (https://github.com/npm/node-semver)
- supports-color@8.1.1 (https://github.com/chalk/supports-color)
- yallist@3.1.1 (https://github.com/isaacs/yallist)

%% @ampproject/remapping@2.3.0 NOTICES AND INFORMATION BEGIN HERE
=========================================
Apache License
                           Version 2.0, January 2004
                        http://www.apache.org/licenses/

   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

   1. Definitions.

      "License" shall mean the terms and conditions for use, reproduction,
      and distribution as defined by Sections 1 through 9 of this document.

      "Licensor" shall mean the copyright owner or entity authorized by
      the copyright owner that is granting the License.

      "Legal Entity" shall mean the union of the acting entity and all
      other entities that control, are controlled by, or are under common
      control with that entity. For the purposes of this definition,
      "control" means (i) the power, direct or indirect, to cause the
      direction or management of such entity, whether by contract or
      otherwise, or (ii) ownership of fifty percent (50%) or more of the
      outstanding shares, or (iii) beneficial ownership of such entity.

      "You" (or "Your") shall mean an individual or Legal Entity
      exercising permissions granted by this License.

      "Source" form shall mean the preferred form for making modifications,
      including but not limited to software source code, documentation
      source, and configuration files.

      "Object" form shall mean any form resulting from mechanical
      transformation or translation of a Source form, including but
      not limited to compiled object code, generated documentation,
      and conversions to other media types.

      "Work" shall mean the work of authorship, whether in Source or
      Object form, made available under the License, as indicated by a
      copyright notice that is included in or attached to the work
      (an example is provided in the Appendix below).

      "Derivative Works" shall mean any work, whether in Source or Object
      form, that is based on (or derived from) the Work and for which the
      editorial revisions, annotations, elaborations, or other modifications
      represent, as a whole, an original work of authorship. For the purposes
      of this License, Derivative Works shall not include works that remain
      separable from, or merely link (or bind by name) to the interfaces of,
      the Work and Derivative Works thereof.

      "Contribution" shall mean any work of authorship, including
      the original version of the Work and any modifications or additions
      to that Work or Derivative Works thereof, that is intentionally
      submitted to Licensor for inclusion in the Work by the copyright owner
      or by an individual or Legal Entity authorized to submit on behalf of
      the copyright owner. For the purposes of this definition, "submitted"
      means any form of electronic, verbal, or written communication sent
      to the Licensor or its representatives, including but not limited to
      communication on electronic mailing lists, source code control systems,
      and issue tracking systems that are managed by, or on behalf of, the
      Licensor for the purpose of discussing and improving the Work, but
      excluding communication that is conspicuously marked or otherwise
      designated in writing by the copyright owner as "Not a Contribution."

      "Contributor" shall mean Licensor and any individual or Legal Entity
      on behalf of whom a Contribution has been received by Licensor and
      subsequently incorporated within the Work.

   2. Grant of Copyright License. Subject to the terms and conditions of
      this License, each Contributor hereby grants to You a perpetual,
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
      copyright license to reproduce, prepare Derivative Works of,
      publicly display, publicly perform, sublicense, and distribute the
      Work and such Derivative Works in Source or Object form.

   3. Grant of Patent License. Subject to the terms and conditions of
      this License, each Contributor hereby grants to You a perpetual,
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
      (except as stated in this section) patent license to make, have made,
      use, offer to sell, sell, import, and otherwise transfer the Work,
      where such license applies only to those patent claims licensable
      by such Contributor that are necessarily infringed by their
      Contribution(s) alone or by combination of their Contribution(s)
      with the Work to which such Contribution(s) was submitted. If You
      institute patent litigation against any entity (including a
      cross-claim or counterclaim in a lawsuit) alleging that the Work
      or a Contribution incorporated within the Work constitutes direct
      or contributory patent infringement, then any patent licenses
      granted to You under this License for that Work shall terminate
      as of the date such litigation is filed.

   4. Redistribution. You may reproduce and distribute copies of the
      Work or Derivative Works thereof in any medium, with or without
      modifications, and in Source or Object form, provided that You
      meet the following conditions:

      (a) You must give any other recipients of the Work or
          Derivative Works a copy of this License; and

      (b) You must cause any modified files to carry prominent notices
          stating that You changed the files; and

      (c) You must retain, in the Source form of any Derivative Works
          that You distribute, all copyright, patent, trademark, and
          attribution notices from the Source form of the Work,
          excluding those notices that do not pertain to any part of
          the Derivative Works; and

      (d) If the Work includes a "NOTICE" text file as part of its
          distribution, then any Derivative Works that You distribute must
          include a readable copy of the attribution notices contained
          within such NOTICE file, excluding those notices that do not
          pertain to any part of the Derivative Works, in at least one
          of the following places: within a NOTICE text file distributed
          as part of the Derivative Works; within the Source form or
          documentation, if provided along with the Derivative Works; or,
          within a display generated by the Derivative Works, if and
          wherever such third-party notices normally appear. The contents
          of the NOTICE file are for informational purposes only and
          do not modify the License. You may add Your own attribution
          notices within Derivative Works that You distribute, alongside
          or as an addendum to the NOTICE text from the Work, provided
          that such additional attribution notices cannot be construed
          as modifying the License.

      You may add Your own copyright statement to Your modifications and
      may provide additional or different license terms and conditions
      for use, reproduction, or distribution of Your modifications, or
      for any such Derivative Works as a whole, provided Your use,
      reproduction, and distribution of the Work otherwise complies with
      the conditions stated in this License.

   5. Submission of Contributions. Unless You explicitly state otherwise,
      any Contribution intentionally submitted for inclusion in the Work
      by You to the Licensor shall be under the terms and conditions of
      this License, without any additional terms or conditions.
      Notwithstanding the above, nothing herein shall supersede or modify
      the terms of any separate license agreement you may have executed
      with Licensor regarding such Contributions.

   6. Trademarks. This License does not grant permission to use the trade
      names, trademarks, service marks, or product names of the Licensor,
      except as required for reasonable and customary use in describing the
      origin of the Work and reproducing the content of the NOTICE file.

   7. Disclaimer of Warranty. Unless required by applicable law or
      agreed to in writing, Licensor provides the Work (and each
      Contributor provides its Contributions) on an "AS IS" BASIS,
      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
      implied, including, without limitation, any warranties or conditions
      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
      PARTICULAR PURPOSE. You are solely responsible for determining the
      appropriateness of using or redistributing the Work and assume any
      risks associated with Your exercise of permissions under this License.

   8. Limitation of Liability. In no event and under no legal theory,
      whether in tort (including negligence), contract, or otherwise,
      unless required by applicable law (such as deliberate and grossly
      negligent acts) or agreed to in writing, shall any Contributor be
      liable to You for damages, including any direct, indirect, special,
      incidental, or consequential damages of any character arising as a
      result of this License or out of the use or inability to use the
      Work (including but not limited to damages for loss of goodwill,
      work stoppage, computer failure or malfunction, or any and all
      other commercial damages or losses), even if such Contributor
      has been advised of the possibility of such damages.

   9. Accepting Warranty or Additional Liability. While redistributing
      the Work or Derivative Works thereof, You may choose to offer,
      and charge a fee for, acceptance of support, warranty, indemnity,
      or other liability obligations and/or rights consistent with this
      License. However, in accepting such obligations, You may act only
      on Your own behalf and on Your sole responsibility, not on behalf
      of any other Contributor, and only if You agree to indemnify,
      defend, and hold each Contributor harmless for any liability
      incurred by, or claims asserted against, such Contributor by reason
      of your accepting any such warranty or additional liability.

   END OF TERMS AND CONDITIONS

   APPENDIX: How to apply the Apache License to your work.

      To apply the Apache License to your work, attach the following
      boilerplate notice, with the fields enclosed by brackets "[]"
      replaced with your own identifying information. (Don't include
      the brackets!)  The text should be enclosed in the appropriate
      comment syntax for the file format. We also recommend that a
      file or class name and description of purpose be included on the
      same "printed page" as the copyright notice for easier
      identification within third-party archives.

   Copyright [yyyy] [name of copyright owner]

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
=========================================
END OF @ampproject/remapping@2.3.0 NOTICES AND INFORMATION

%% @babel/code-frame@7.29.0 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License

Copyright (c) 2014-present Sebastian McKenzie and other contributors

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF @babel/code-frame@7.29.0 NOTICES AND INFORMATION

%% @babel/compat-data@7.28.0 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License

Copyright (c) 2014-present Sebastian McKenzie and other contributors

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF @babel/compat-data@7.28.0 NOTICES AND INFORMATION

%% @babel/core@7.28.3 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License

Copyright (c) 2014-present Sebastian McKenzie and other contributors

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF @babel/core@7.28.3 NOTICES AND INFORMATION

%% @babel/generator@7.29.1 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License

Copyright (c) 2014-present Sebastian McKenzie and other contributors

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF @babel/generator@7.29.1 NOTICES AND INFORMATION

%% @babel/helper-annotate-as-pure@7.27.3 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License

Copyright (c) 2014-present Sebastian McKenzie and other contributors

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF @babel/helper-annotate-as-pure@7.27.3 NOTICES AND INFORMATION

%% @babel/helper-compilation-targets@7.27.2 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License

Copyright (c) 2014-present Sebastian McKenzie and other contributors

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF @babel/helper-compilation-targets@7.27.2 NOTICES AND INFORMATION

%% @babel/helper-create-class-features-plugin@7.28.6 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License

Copyright (c) 2014-present Sebastian McKenzie and other contributors

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF @babel/helper-create-class-features-plugin@7.28.6 NOTICES AND INFORMATION

%% @babel/helper-globals@7.28.0 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License

Copyright (c) 2014-present Sebastian McKenzie and other contributors

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF @babel/helper-globals@7.28.0 NOTICES AND INFORMATION

%% @babel/helper-member-expression-to-functions@7.28.5 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License

Copyright (c) 2014-present Sebastian McKenzie and other contributors

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF @babel/helper-member-expression-to-functions@7.28.5 NOTICES AND INFORMATION

%% @babel/helper-module-imports@7.28.6 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License

Copyright (c) 2014-present Sebastian McKenzie and other contributors

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF @babel/helper-module-imports@7.28.6 NOTICES AND INFORMATION

%% @babel/helper-module-transforms@7.28.6 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License

Copyright (c) 2014-present Sebastian McKenzie and other contributors

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF @babel/helper-module-transforms@7.28.6 NOTICES AND INFORMATION

%% @babel/helper-optimise-call-expression@7.27.1 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License

Copyright (c) 2014-present Sebastian McKenzie and other contributors

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF @babel/helper-optimise-call-expression@7.27.1 NOTICES AND INFORMATION

%% @babel/helper-plugin-utils@7.28.6 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License

Copyright (c) 2014-present Sebastian McKenzie and other contributors

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF @babel/helper-plugin-utils@7.28.6 NOTICES AND INFORMATION

%% @babel/helper-replace-supers@7.28.6 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License

Copyright (c) 2014-present Sebastian McKenzie and other contributors

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF @babel/helper-replace-supers@7.28.6 NOTICES AND INFORMATION

%% @babel/helper-skip-transparent-expression-wrappers@7.27.1 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License

Copyright (c) 2014-present Sebastian McKenzie and other contributors

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF @babel/helper-skip-transparent-expression-wrappers@7.27.1 NOTICES AND INFORMATION

%% @babel/helper-string-parser@7.27.1 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License

Copyright (c) 2014-present Sebastian McKenzie and other contributors

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF @babel/helper-string-parser@7.27.1 NOTICES AND INFORMATION

%% @babel/helper-validator-identifier@7.28.5 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License

Copyright (c) 2014-present Sebastian McKenzie and other contributors

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF @babel/helper-validator-identifier@7.28.5 NOTICES AND INFORMATION

%% @babel/helper-validator-option@7.27.1 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License

Copyright (c) 2014-present Sebastian McKenzie and other contributors

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF @babel/helper-validator-option@7.27.1 NOTICES AND INFORMATION

%% @babel/helpers@7.28.3 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License

Copyright (c) 2014-present Sebastian McKenzie and other contributors
Copyright (c) 2014-present, Facebook, Inc. (ONLY ./src/helpers/regenerator* files)

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF @babel/helpers@7.28.3 NOTICES AND INFORMATION

%% @babel/parser@7.29.2 NOTICES AND INFORMATION BEGIN HERE
=========================================
Copyright (C) 2012-2014 by various contributors (see AUTHORS)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
=========================================
END OF @babel/parser@7.29.2 NOTICES AND INFORMATION

%% @babel/plugin-proposal-decorators@7.29.0 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License

Copyright (c) 2014-present Sebastian McKenzie and other contributors

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF @babel/plugin-proposal-decorators@7.29.0 NOTICES AND INFORMATION

%% @babel/plugin-syntax-async-generators@7.8.4 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License

Copyright (c) 2014-present Sebastian McKenzie and other contributors

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF @babel/plugin-syntax-async-generators@7.8.4 NOTICES AND INFORMATION

%% @babel/plugin-syntax-decorators@7.28.6 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License

Copyright (c) 2014-present Sebastian McKenzie and other contributors

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF @babel/plugin-syntax-decorators@7.28.6 NOTICES AND INFORMATION

%% @babel/plugin-syntax-import-attributes@7.28.6 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License

Copyright (c) 2014-present Sebastian McKenzie and other contributors

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF @babel/plugin-syntax-import-attributes@7.28.6 NOTICES AND INFORMATION

%% @babel/plugin-syntax-json-strings@7.8.3 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License

Copyright (c) 2014-present Sebastian McKenzie and other contributors

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF @babel/plugin-syntax-json-strings@7.8.3 NOTICES AND INFORMATION

%% @babel/plugin-syntax-jsx@7.28.6 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License

Copyright (c) 2014-present Sebastian McKenzie and other contributors

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF @babel/plugin-syntax-jsx@7.28.6 NOTICES AND INFORMATION

%% @babel/plugin-syntax-object-rest-spread@7.8.3 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License

Copyright (c) 2014-present Sebastian McKenzie and other contributors

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF @babel/plugin-syntax-object-rest-spread@7.8.3 NOTICES AND INFORMATION

%% @babel/plugin-syntax-optional-catch-binding@7.8.3 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License

Copyright (c) 2014-present Sebastian McKenzie and other contributors

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF @babel/plugin-syntax-optional-catch-binding@7.8.3 NOTICES AND INFORMATION

%% @babel/plugin-syntax-typescript@7.28.6 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License

Copyright (c) 2014-present Sebastian McKenzie and other contributors

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF @babel/plugin-syntax-typescript@7.28.6 NOTICES AND INFORMATION

%% @babel/plugin-transform-class-properties@7.28.6 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License

Copyright (c) 2014-present Sebastian McKenzie and other contributors

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF @babel/plugin-transform-class-properties@7.28.6 NOTICES AND INFORMATION

%% @babel/plugin-transform-class-static-block@7.28.6 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License

Copyright (c) 2014-present Sebastian McKenzie and other contributors

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF @babel/plugin-transform-class-static-block@7.28.6 NOTICES AND INFORMATION

%% @babel/plugin-transform-destructuring@7.28.5 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License

Copyright (c) 2014-present Sebastian McKenzie and other contributors

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF @babel/plugin-transform-destructuring@7.28.5 NOTICES AND INFORMATION

%% @babel/plugin-transform-explicit-resource-management@7.28.6 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License

Copyright (c) 2014-present Sebastian McKenzie and other contributors

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF @babel/plugin-transform-explicit-resource-management@7.28.6 NOTICES AND INFORMATION

%% @babel/plugin-transform-export-namespace-from@7.27.1 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License

Copyright (c) 2014-present Sebastian McKenzie and other contributors

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF @babel/plugin-transform-export-namespace-from@7.27.1 NOTICES AND INFORMATION

%% @babel/plugin-transform-logical-assignment-operators@7.28.6 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License

Copyright (c) 2014-present Sebastian McKenzie and other contributors

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF @babel/plugin-transform-logical-assignment-operators@7.28.6 NOTICES AND INFORMATION

%% @babel/plugin-transform-modules-commonjs@7.28.6 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License

Copyright (c) 2014-present Sebastian McKenzie and other contributors

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF @babel/plugin-transform-modules-commonjs@7.28.6 NOTICES AND INFORMATION

%% @babel/plugin-transform-nullish-coalescing-operator@7.28.6 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License

Copyright (c) 2014-present Sebastian McKenzie and other contributors

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF @babel/plugin-transform-nullish-coalescing-operator@7.28.6 NOTICES AND INFORMATION

%% @babel/plugin-transform-numeric-separator@7.28.6 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License

Copyright (c) 2014-present Sebastian McKenzie and other contributors

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF @babel/plugin-transform-numeric-separator@7.28.6 NOTICES AND INFORMATION

%% @babel/plugin-transform-optional-chaining@7.28.6 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License

Copyright (c) 2014-present Sebastian McKenzie and other contributors

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF @babel/plugin-transform-optional-chaining@7.28.6 NOTICES AND INFORMATION

%% @babel/plugin-transform-private-methods@7.28.6 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License

Copyright (c) 2014-present Sebastian McKenzie and other contributors

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF @babel/plugin-transform-private-methods@7.28.6 NOTICES AND INFORMATION

%% @babel/plugin-transform-react-jsx@7.28.6 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License

Copyright (c) 2014-present Sebastian McKenzie and other contributors

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF @babel/plugin-transform-react-jsx@7.28.6 NOTICES AND INFORMATION

%% @babel/plugin-transform-typescript@7.28.6 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License

Copyright (c) 2014-present Sebastian McKenzie and other contributors

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF @babel/plugin-transform-typescript@7.28.6 NOTICES AND INFORMATION

%% @babel/preset-typescript@7.28.5 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License

Copyright (c) 2014-present Sebastian McKenzie and other contributors

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF @babel/preset-typescript@7.28.5 NOTICES AND INFORMATION

%% @babel/template@7.28.6 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License

Copyright (c) 2014-present Sebastian McKenzie and other contributors

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF @babel/template@7.28.6 NOTICES AND INFORMATION

%% @babel/traverse@7.29.0 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License

Copyright (c) 2014-present Sebastian McKenzie and other contributors

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF @babel/traverse@7.29.0 NOTICES AND INFORMATION

%% @babel/types@7.29.0 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License

Copyright (c) 2014-present Sebastian McKenzie and other contributors

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF @babel/types@7.29.0 NOTICES AND INFORMATION

%% @jridgewell/gen-mapping@0.3.13 NOTICES AND INFORMATION BEGIN HERE
=========================================
Copyright 2024 Justin Ridgewell <justin@ridgewell.name>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
=========================================
END OF @jridgewell/gen-mapping@0.3.13 NOTICES AND INFORMATION

%% @jridgewell/resolve-uri@3.1.2 NOTICES AND INFORMATION BEGIN HERE
=========================================
Copyright 2019 Justin Ridgewell <jridgewell@google.com>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
=========================================
END OF @jridgewell/resolve-uri@3.1.2 NOTICES AND INFORMATION

%% @jridgewell/sourcemap-codec@1.5.5 NOTICES AND INFORMATION BEGIN HERE
=========================================
Copyright 2024 Justin Ridgewell <justin@ridgewell.name>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
=========================================
END OF @jridgewell/sourcemap-codec@1.5.5 NOTICES AND INFORMATION

%% @jridgewell/trace-mapping@0.3.30 NOTICES AND INFORMATION BEGIN HERE
=========================================
Copyright 2024 Justin Ridgewell <justin@ridgewell.name>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
=========================================
END OF @jridgewell/trace-mapping@0.3.30 NOTICES AND INFORMATION

%% browserslist@4.25.4 NOTICES AND INFORMATION BEGIN HERE
=========================================
The MIT License (MIT)

Copyright 2014 Andrey Sitnik <andrey@sitnik.ru> and other contributors

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF browserslist@4.25.4 NOTICES AND INFORMATION

%% caniuse-lite@1.0.30001739 NOTICES AND INFORMATION BEGIN HERE
=========================================
Attribution 4.0 International

=======================================================================

Creative Commons Corporation ("Creative Commons") is not a law firm and
does not provide legal services or legal advice. Distribution of
Creative Commons public licenses does not create a lawyer-client or
other relationship. Creative Commons makes its licenses and related
information available on an "as-is" basis. Creative Commons gives no
warranties regarding its licenses, any material licensed under their
terms and conditions, or any related information. Creative Commons
disclaims all liability for damages resulting from their use to the
fullest extent possible.

Using Creative Commons Public Licenses

Creative Commons public licenses provide a standard set of terms and
conditions that creators and other rights holders may use to share
original works of authorship and other material subject to copyright
and certain other rights specified in the public license below. The
following considerations are for informational purposes only, are not
exhaustive, and do not form part of our licenses.

     Considerations for licensors: Our public licenses are
     intended for use by those authorized to give the public
     permission to use material in ways otherwise restricted by
     copyright and certain other rights. Our licenses are
     irrevocable. Licensors should read and understand the terms
     and conditions of the license they choose before applying it.
     Licensors should also secure all rights necessary before
     applying our licenses so that the public can reuse the
     material as expected. Licensors should clearly mark any
     material not subject to the license. This includes other CC-
     licensed material, or material used under an exception or
     limitation to copyright. More considerations for licensors:
	wiki.creativecommons.org/Considerations_for_licensors

     Considerations for the public: By using one of our public
     licenses, a licensor grants the public permission to use the
     licensed material under specified terms and conditions. If
     the licensor's permission is not necessary for any reason--for
     example, because of any applicable exception or limitation to
     copyright--then that use is not regulated by the license. Our
     licenses grant only permissions under copyright and certain
     other rights that a licensor has authority to grant. Use of
     the licensed material may still be restricted for other
     reasons, including because others have copyright or other
     rights in the material. A licensor may make special requests,
     such as asking that all changes be marked or described.
     Although not required by our licenses, you are encouraged to
     respect those requests where reasonable. More_considerations
     for the public: 
	wiki.creativecommons.org/Considerations_for_licensees

=======================================================================

Creative Commons Attribution 4.0 International Public License

By exercising the Licensed Rights (defined below), You accept and agree
to be bound by the terms and conditions of this Creative Commons
Attribution 4.0 International Public License ("Public License"). To the
extent this Public License may be interpreted as a contract, You are
granted the Licensed Rights in consideration of Your acceptance of
these terms and conditions, and the Licensor grants You such rights in
consideration of benefits the Licensor receives from making the
Licensed Material available under these terms and conditions.


Section 1 -- Definitions.

  a. Adapted Material means material subject to Copyright and Similar
     Rights that is derived from or based upon the Licensed Material
     and in which the Licensed Material is translated, altered,
     arranged, transformed, or otherwise modified in a manner requiring
     permission under the Copyright and Similar Rights held by the
     Licensor. For purposes of this Public License, where the Licensed
     Material is a musical work, performance, or sound recording,
     Adapted Material is always produced where the Licensed Material is
     synched in timed relation with a moving image.

  b. Adapter's License means the license You apply to Your Copyright
     and Similar Rights in Your contributions to Adapted Material in
     accordance with the terms and conditions of this Public License.

  c. Copyright and Similar Rights means copyright and/or similar rights
     closely related to copyright including, without limitation,
     performance, broadcast, sound recording, and Sui Generis Database
     Rights, without regard to how the rights are labeled or
     categorized. For purposes of this Public License, the rights
     specified in Section 2(b)(1)-(2) are not Copyright and Similar
     Rights.

  d. Effective Technological Measures means those measures that, in the
     absence of proper authority, may not be circumvented under laws
     fulfilling obligations under Article 11 of the WIPO Copyright
     Treaty adopted on December 20, 1996, and/or similar international
     agreements.

  e. Exceptions and Limitations means fair use, fair dealing, and/or
     any other exception or limitation to Copyright and Similar Rights
     that applies to Your use of the Licensed Material.

  f. Licensed Material means the artistic or literary work, database,
     or other material to which the Licensor applied this Public
     License.

  g. Licensed Rights means the rights granted to You subject to the
     terms and conditions of this Public License, which are limited to
     all Copyright and Similar Rights that apply to Your use of the
     Licensed Material and that the Licensor has authority to license.

  h. Licensor means the individual(s) or entity(ies) granting rights
     under this Public License.

  i. Share means to provide material to the public by any means or
     process that requires permission under the Licensed Rights, such
     as reproduction, public display, public performance, distribution,
     dissemination, communication, or importation, and to make material
     available to the public including in ways that members of the
     public may access the material from a place and at a time
     individually chosen by them.

  j. Sui Generis Database Rights means rights other than copyright
     resulting from Directive 96/9/EC of the European Parliament and of
     the Council of 11 March 1996 on the legal protection of databases,
     as amended and/or succeeded, as well as other essentially
     equivalent rights anywhere in the world.

  k. You means the individual or entity exercising the Licensed Rights
     under this Public License. Your has a corresponding meaning.


Section 2 -- Scope.

  a. License grant.

       1. Subject to the terms and conditions of this Public License,
          the Licensor hereby grants You a worldwide, royalty-free,
          non-sublicensable, non-exclusive, irrevocable license to
          exercise the Licensed Rights in the Licensed Material to:

            a. reproduce and Share the Licensed Material, in whole or
               in part; and

            b. produce, reproduce, and Share Adapted Material.

       2. Exceptions and Limitations. For the avoidance of doubt, where
          Exceptions and Limitations apply to Your use, this Public
          License does not apply, and You do not need to comply with
          its terms and conditions.

       3. Term. The term of this Public License is specified in Section
          6(a).

       4. Media and formats; technical modifications allowed. The
          Licensor authorizes You to exercise the Licensed Rights in
          all media and formats whether now known or hereafter created,
          and to make technical modifications necessary to do so. The
          Licensor waives and/or agrees not to assert any right or
          authority to forbid You from making technical modifications
          necessary to exercise the Licensed Rights, including
          technical modifications necessary to circumvent Effective
          Technological Measures. For purposes of this Public License,
          simply making modifications authorized by this Section 2(a)
          (4) never produces Adapted Material.

       5. Downstream recipients.

            a. Offer from the Licensor -- Licensed Material. Every
               recipient of the Licensed Material automatically
               receives an offer from the Licensor to exercise the
               Licensed Rights under the terms and conditions of this
               Public License.

            b. No downstream restrictions. You may not offer or impose
               any additional or different terms or conditions on, or
               apply any Effective Technological Measures to, the
               Licensed Material if doing so restricts exercise of the
               Licensed Rights by any recipient of the Licensed
               Material.

       6. No endorsement. Nothing in this Public License constitutes or
          may be construed as permission to assert or imply that You
          are, or that Your use of the Licensed Material is, connected
          with, or sponsored, endorsed, or granted official status by,
          the Licensor or others designated to receive attribution as
          provided in Section 3(a)(1)(A)(i).

  b. Other rights.

       1. Moral rights, such as the right of integrity, are not
          licensed under this Public License, nor are publicity,
          privacy, and/or other similar personality rights; however, to
          the extent possible, the Licensor waives and/or agrees not to
          assert any such rights held by the Licensor to the limited
          extent necessary to allow You to exercise the Licensed
          Rights, but not otherwise.

       2. Patent and trademark rights are not licensed under this
          Public License.

       3. To the extent possible, the Licensor waives any right to
          collect royalties from You for the exercise of the Licensed
          Rights, whether directly or through a collecting society
          under any voluntary or waivable statutory or compulsory
          licensing scheme. In all other cases the Licensor expressly
          reserves any right to collect such royalties.


Section 3 -- License Conditions.

Your exercise of the Licensed Rights is expressly made subject to the
following conditions.

  a. Attribution.

       1. If You Share the Licensed Material (including in modified
          form), You must:

            a. retain the following if it is supplied by the Licensor
               with the Licensed Material:

                 i. identification of the creator(s) of the Licensed
                    Material and any others designated to receive
                    attribution, in any reasonable manner requested by
                    the Licensor (including by pseudonym if
                    designated);

                ii. a copyright notice;

               iii. a notice that refers to this Public License;

                iv. a notice that refers to the disclaimer of
                    warranties;

                 v. a URI or hyperlink to the Licensed Material to the
                    extent reasonably practicable;

            b. indicate if You modified the Licensed Material and
               retain an indication of any previous modifications; and

            c. indicate the Licensed Material is licensed under this
               Public License, and include the text of, or the URI or
               hyperlink to, this Public License.

       2. You may satisfy the conditions in Section 3(a)(1) in any
          reasonable manner based on the medium, means, and context in
          which You Share the Licensed Material. For example, it may be
          reasonable to satisfy the conditions by providing a URI or
          hyperlink to a resource that includes the required
          information.

       3. If requested by the Licensor, You must remove any of the
          information required by Section 3(a)(1)(A) to the extent
          reasonably practicable.

       4. If You Share Adapted Material You produce, the Adapter's
          License You apply must not prevent recipients of the Adapted
          Material from complying with this Public License.


Section 4 -- Sui Generis Database Rights.

Where the Licensed Rights include Sui Generis Database Rights that
apply to Your use of the Licensed Material:

  a. for the avoidance of doubt, Section 2(a)(1) grants You the right
     to extract, reuse, reproduce, and Share all or a substantial
     portion of the contents of the database;

  b. if You include all or a substantial portion of the database
     contents in a database in which You have Sui Generis Database
     Rights, then the database in which You have Sui Generis Database
     Rights (but not its individual contents) is Adapted Material; and

  c. You must comply with the conditions in Section 3(a) if You Share
     all or a substantial portion of the contents of the database.

For the avoidance of doubt, this Section 4 supplements and does not
replace Your obligations under this Public License where the Licensed
Rights include other Copyright and Similar Rights.


Section 5 -- Disclaimer of Warranties and Limitation of Liability.

  a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE
     EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS
     AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF
     ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS,
     IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION,
     WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR
     PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS,
     ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT
     KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT
     ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU.

  b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE
     TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION,
     NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT,
     INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES,
     COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR
     USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN
     ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR
     DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR
     IN PART, THIS LIMITATION MAY NOT APPLY TO YOU.

  c. The disclaimer of warranties and limitation of liability provided
     above shall be interpreted in a manner that, to the extent
     possible, most closely approximates an absolute disclaimer and
     waiver of all liability.


Section 6 -- Term and Termination.

  a. This Public License applies for the term of the Copyright and
     Similar Rights licensed here. However, if You fail to comply with
     this Public License, then Your rights under this Public License
     terminate automatically.

  b. Where Your right to use the Licensed Material has terminated under
     Section 6(a), it reinstates:

       1. automatically as of the date the violation is cured, provided
          it is cured within 30 days of Your discovery of the
          violation; or

       2. upon express reinstatement by the Licensor.

     For the avoidance of doubt, this Section 6(b) does not affect any
     right the Licensor may have to seek remedies for Your violations
     of this Public License.

  c. For the avoidance of doubt, the Licensor may also offer the
     Licensed Material under separate terms or conditions or stop
     distributing the Licensed Material at any time; however, doing so
     will not terminate this Public License.

  d. Sections 1, 5, 6, 7, and 8 survive termination of this Public
     License.


Section 7 -- Other Terms and Conditions.

  a. The Licensor shall not be bound by any additional or different
     terms or conditions communicated by You unless expressly agreed.

  b. Any arrangements, understandings, or agreements regarding the
     Licensed Material not stated herein are separate from and
     independent of the terms and conditions of this Public License.


Section 8 -- Interpretation.

  a. For the avoidance of doubt, this Public License does not, and
     shall not be interpreted to, reduce, limit, restrict, or impose
     conditions on any use of the Licensed Material that could lawfully
     be made without permission under this Public License.

  b. To the extent possible, if any provision of this Public License is
     deemed unenforceable, it shall be automatically reformed to the
     minimum extent necessary to make it enforceable. If the provision
     cannot be reformed, it shall be severed from this Public License
     without affecting the enforceability of the remaining terms and
     conditions.

  c. No term or condition of this Public License will be waived and no
     failure to comply consented to unless expressly agreed to by the
     Licensor.

  d. Nothing in this Public License constitutes or may be interpreted
     as a limitation upon, or waiver of, any privileges and immunities
     that apply to the Licensor or You, including from the legal
     processes of any jurisdiction or authority.


=======================================================================

Creative Commons is not a party to its public
licenses. Notwithstanding, Creative Commons may elect to apply one of
its public licenses to material it publishes and in those instances
will be considered the â€œLicensor.â€� The text of the Creative Commons
public licenses is dedicated to the public domain under the CC0 Public
Domain Dedication. Except for the limited purpose of indicating that
material is shared under a Creative Commons public license or as
otherwise permitted by the Creative Commons policies published at
creativecommons.org/policies, Creative Commons does not authorize the
use of the trademark "Creative Commons" or any other trademark or logo
of Creative Commons without its prior written consent including,
without limitation, in connection with any unauthorized modifications
to any of its public licenses or any other arrangements,
understandings, or agreements concerning use of licensed material. For
the avoidance of doubt, this paragraph does not form part of the
public licenses.

Creative Commons may be contacted at creativecommons.org.
=========================================
END OF caniuse-lite@1.0.30001739 NOTICES AND INFORMATION

%% convert-source-map@2.0.0 NOTICES AND INFORMATION BEGIN HERE
=========================================
Copyright 2013 Thorsten Lorenz. 
All rights reserved.

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF convert-source-map@2.0.0 NOTICES AND INFORMATION

%% debug@4.4.3 NOTICES AND INFORMATION BEGIN HERE
=========================================
(The MIT License)

Copyright (c) 2014-2017 TJ Holowaychuk <tj@vision-media.ca>
Copyright (c) 2018-2021 Josh Junon

Permission is hereby granted, free of charge, to any person obtaining a copy of this software
and associated documentation files (the 'Software'), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial
portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF debug@4.4.3 NOTICES AND INFORMATION

%% electron-to-chromium@1.5.214 NOTICES AND INFORMATION BEGIN HERE
=========================================
Copyright 2018 Kilian Valkhof

Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
=========================================
END OF electron-to-chromium@1.5.214 NOTICES AND INFORMATION

%% gensync@1.0.0-beta.2 NOTICES AND INFORMATION BEGIN HERE
=========================================
Copyright 2018 Logan Smyth <loganfsmyth@gmail.com>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF gensync@1.0.0-beta.2 NOTICES AND INFORMATION

%% has-flag@4.0.0 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License

Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF has-flag@4.0.0 NOTICES AND INFORMATION

%% js-tokens@4.0.0 NOTICES AND INFORMATION BEGIN HERE
=========================================
The MIT License (MIT)

Copyright (c) 2014, 2015, 2016, 2017, 2018 Simon Lydell

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
=========================================
END OF js-tokens@4.0.0 NOTICES AND INFORMATION

%% jsesc@3.1.0 NOTICES AND INFORMATION BEGIN HERE
=========================================
Copyright Mathias Bynens <https://mathiasbynens.be/>

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF jsesc@3.1.0 NOTICES AND INFORMATION

%% json5@2.2.3 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License

Copyright (c) 2012-2018 Aseem Kishore, and [others].

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

[others]: https://github.com/json5/json5/contributors
=========================================
END OF json5@2.2.3 NOTICES AND INFORMATION

%% lru-cache@5.1.1 NOTICES AND INFORMATION BEGIN HERE
=========================================
The ISC License

Copyright (c) Isaac Z. Schlueter and Contributors

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
=========================================
END OF lru-cache@5.1.1 NOTICES AND INFORMATION

%% ms@2.1.3 NOTICES AND INFORMATION BEGIN HERE
=========================================
The MIT License (MIT)

Copyright (c) 2020 Vercel, Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
=========================================
END OF ms@2.1.3 NOTICES AND INFORMATION

%% node-releases@2.0.19 NOTICES AND INFORMATION BEGIN HERE
=========================================
The MIT License

Copyright (c) 2017 Sergey Rubanov (https://github.com/chicoxyzzy)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
=========================================
END OF node-releases@2.0.19 NOTICES AND INFORMATION

%% picocolors@1.1.1 NOTICES AND INFORMATION BEGIN HERE
=========================================
ISC License

Copyright (c) 2021-2024 Oleksii Raspopov, Kostiantyn Denysov, Anton Verinov

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
=========================================
END OF picocolors@1.1.1 NOTICES AND INFORMATION

%% semver@6.3.1 NOTICES AND INFORMATION BEGIN HERE
=========================================
The ISC License

Copyright (c) Isaac Z. Schlueter and Contributors

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
=========================================
END OF semver@6.3.1 NOTICES AND INFORMATION

%% supports-color@8.1.1 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License

Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF supports-color@8.1.1 NOTICES AND INFORMATION

%% yallist@3.1.1 NOTICES AND INFORMATION BEGIN HERE
=========================================
The ISC License

Copyright (c) Isaac Z. Schlueter and Contributors

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
=========================================
END OF yallist@3.1.1 NOTICES AND INFORMATION

SUMMARY
=========================================
Total Packages: 68
=========================================# packages/playwright/lib/transform/babelBundle.js
# total: 2724.2 KB

## Inlined (319)
    5.7 KB  node_modules/@ampproject/remapping/dist/remapping.umd.js
    7.9 KB  node_modules/@babel/code-frame/lib/index.js
    0.5 KB  node_modules/@babel/compat-data/data/native-modules.json
   18.6 KB  node_modules/@babel/compat-data/data/plugins.json
    0.2 KB  node_modules/@babel/compat-data/native-modules.js
    0.1 KB  node_modules/@babel/compat-data/plugins.js
    8.3 KB  node_modules/@babel/core/lib/config/caching.js
   20.1 KB  node_modules/@babel/core/lib/config/config-chain.js
    7.6 KB  node_modules/@babel/core/lib/config/config-descriptors.js
   11.6 KB  node_modules/@babel/core/lib/config/files/configuration.js
    0.2 KB  node_modules/@babel/core/lib/config/files/import.cjs
    2.1 KB  node_modules/@babel/core/lib/config/files/index.js
    8.0 KB  node_modules/@babel/core/lib/config/files/module-types.js
    1.8 KB  node_modules/@babel/core/lib/config/files/package.js
    8.4 KB  node_modules/@babel/core/lib/config/files/plugins.js
    1.0 KB  node_modules/@babel/core/lib/config/files/utils.js
   12.1 KB  node_modules/@babel/core/lib/config/full.js
    3.1 KB  node_modules/@babel/core/lib/config/helpers/config-api.js
    0.7 KB  node_modules/@babel/core/lib/config/helpers/deep-array.js
    0.4 KB  node_modules/@babel/core/lib/config/helpers/environment.js
    3.7 KB  node_modules/@babel/core/lib/config/index.js
    2.1 KB  node_modules/@babel/core/lib/config/item.js
    5.8 KB  node_modules/@babel/core/lib/config/partial.js
    1.3 KB  node_modules/@babel/core/lib/config/pattern-to-regex.js
    1.1 KB  node_modules/@babel/core/lib/config/plugin.js
    3.3 KB  node_modules/@babel/core/lib/config/printer.js
    1.8 KB  node_modules/@babel/core/lib/config/resolve-targets.js
    1.1 KB  node_modules/@babel/core/lib/config/util.js
   11.0 KB  node_modules/@babel/core/lib/config/validation/option-assertions.js
    8.6 KB  node_modules/@babel/core/lib/config/validation/options.js
    2.4 KB  node_modules/@babel/core/lib/config/validation/plugins.js
    2.6 KB  node_modules/@babel/core/lib/config/validation/removed.js
    0.6 KB  node_modules/@babel/core/lib/errors/config-error.js
    3.6 KB  node_modules/@babel/core/lib/errors/rewrite-stack-trace.js
    3.1 KB  node_modules/@babel/core/lib/gensync-utils/async.js
    0.7 KB  node_modules/@babel/core/lib/gensync-utils/fs.js
    1.6 KB  node_modules/@babel/core/lib/gensync-utils/functional.js
    6.5 KB  node_modules/@babel/core/lib/index.js
    1.6 KB  node_modules/@babel/core/lib/parse.js
    2.5 KB  node_modules/@babel/core/lib/parser/index.js
   14.1 KB  node_modules/@babel/core/lib/parser/util/missing-plugin-helper.js
    5.0 KB  node_modules/@babel/core/lib/tools/build-external-helpers.js
    1.8 KB  node_modules/@babel/core/lib/transform-ast.js
    1.2 KB  node_modules/@babel/core/lib/transform-file.js
    1.7 KB  node_modules/@babel/core/lib/transform.js
    2.3 KB  node_modules/@babel/core/lib/transformation/block-hoist-plugin.js
    0.2 KB  node_modules/@babel/core/lib/transformation/file/babel-7-helpers.cjs
    6.8 KB  node_modules/@babel/core/lib/transformation/file/file.js
    2.6 KB  node_modules/@babel/core/lib/transformation/file/generate.js
    1.0 KB  node_modules/@babel/core/lib/transformation/file/merge-map.js
    3.3 KB  node_modules/@babel/core/lib/transformation/index.js
    4.1 KB  node_modules/@babel/core/lib/transformation/normalize-file.js
    1.8 KB  node_modules/@babel/core/lib/transformation/normalize-opts.js
    1.4 KB  node_modules/@babel/core/lib/transformation/plugin-pass.js
    1.9 KB  node_modules/@babel/core/lib/transformation/util/clone-deep.js
   44.8 KB  node_modules/@babel/core/lib/vendor/import-meta-resolve.js
   38.4 KB  node_modules/@babel/core/node_modules/semver/semver.js
    7.1 KB  node_modules/@babel/generator/lib/buffer.js
    3.1 KB  node_modules/@babel/generator/lib/generators/base.js
    6.8 KB  node_modules/@babel/generator/lib/generators/classes.js
    2.5 KB  node_modules/@babel/generator/lib/generators/deprecated.js
    9.5 KB  node_modules/@babel/generator/lib/generators/expressions.js
   18.9 KB  node_modules/@babel/generator/lib/generators/flow.js
    4.3 KB  node_modules/@babel/generator/lib/generators/index.js
    3.5 KB  node_modules/@babel/generator/lib/generators/jsx.js
    7.0 KB  node_modules/@babel/generator/lib/generators/methods.js
    9.7 KB  node_modules/@babel/generator/lib/generators/modules.js
    8.1 KB  node_modules/@babel/generator/lib/generators/statements.js
    1.3 KB  node_modules/@babel/generator/lib/generators/template-literals.js
    6.1 KB  node_modules/@babel/generator/lib/generators/types.js
   21.5 KB  node_modules/@babel/generator/lib/generators/typescript.js
    4.6 KB  node_modules/@babel/generator/lib/index.js
    2.5 KB  node_modules/@babel/generator/lib/node/index.js
   11.4 KB  node_modules/@babel/generator/lib/node/parentheses.js
    0.8 KB  node_modules/@babel/generator/lib/nodes.js
   29.0 KB  node_modules/@babel/generator/lib/printer.js
    3.4 KB  node_modules/@babel/generator/lib/source-map.js
    6.4 KB  node_modules/@babel/generator/lib/token-map.js
    0.7 KB  node_modules/@babel/helper-annotate-as-pure/lib/index.js
    1.2 KB  node_modules/@babel/helper-compilation-targets/lib/debug.js
    2.7 KB  node_modules/@babel/helper-compilation-targets/lib/filter-items.js
    8.7 KB  node_modules/@babel/helper-compilation-targets/lib/index.js
    0.6 KB  node_modules/@babel/helper-compilation-targets/lib/options.js
    1.2 KB  node_modules/@babel/helper-compilation-targets/lib/pretty.js
    0.8 KB  node_modules/@babel/helper-compilation-targets/lib/targets.js
    2.2 KB  node_modules/@babel/helper-compilation-targets/lib/utils.js
   38.5 KB  node_modules/@babel/helper-compilation-targets/node_modules/semver/semver.js
    5.1 KB  node_modules/@babel/helper-create-class-features-plugin/lib/decorators-2018-09.js
   59.9 KB  node_modules/@babel/helper-create-class-features-plugin/lib/decorators.js
    7.3 KB  node_modules/@babel/helper-create-class-features-plugin/lib/features.js
   43.4 KB  node_modules/@babel/helper-create-class-features-plugin/lib/fields.js
   11.1 KB  node_modules/@babel/helper-create-class-features-plugin/lib/index.js
    4.9 KB  node_modules/@babel/helper-create-class-features-plugin/lib/misc.js
    0.8 KB  node_modules/@babel/helper-create-class-features-plugin/lib/typescript.js
   38.5 KB  node_modules/@babel/helper-create-class-features-plugin/node_modules/semver/semver.js
    0.4 KB  node_modules/@babel/helper-globals/data/builtin-lower.json
    1.0 KB  node_modules/@babel/helper-globals/data/builtin-upper.json
   14.3 KB  node_modules/@babel/helper-member-expression-to-functions/lib/index.js
    4.6 KB  node_modules/@babel/helper-module-imports/lib/import-builder.js
   12.0 KB  node_modules/@babel/helper-module-imports/lib/import-injector.js
    1.3 KB  node_modules/@babel/helper-module-imports/lib/index.js
    0.3 KB  node_modules/@babel/helper-module-imports/lib/is-module.js
    1.9 KB  node_modules/@babel/helper-module-transforms/lib/dynamic-import.js
    1.9 KB  node_modules/@babel/helper-module-transforms/lib/get-module-name.js
   14.7 KB  node_modules/@babel/helper-module-transforms/lib/index.js
    1.2 KB  node_modules/@babel/helper-module-transforms/lib/lazy-modules.js
   14.6 KB  node_modules/@babel/helper-module-transforms/lib/normalize-and-load-metadata.js
   14.8 KB  node_modules/@babel/helper-module-transforms/lib/rewrite-live-references.js
    0.8 KB  node_modules/@babel/helper-module-transforms/lib/rewrite-this.js
    1.2 KB  node_modules/@babel/helper-optimise-call-expression/lib/index.js
    2.8 KB  node_modules/@babel/helper-plugin-utils/lib/index.js
   11.6 KB  node_modules/@babel/helper-replace-supers/lib/index.js
    1.2 KB  node_modules/@babel/helper-skip-transparent-expression-wrappers/lib/index.js
    8.9 KB  node_modules/@babel/helper-string-parser/lib/index.js
   12.6 KB  node_modules/@babel/helper-validator-identifier/lib/identifier.js
    1.6 KB  node_modules/@babel/helper-validator-identifier/lib/index.js
    1.7 KB  node_modules/@babel/helper-validator-identifier/lib/keyword.js
    0.9 KB  node_modules/@babel/helper-validator-option/lib/find-suggestion.js
    0.6 KB  node_modules/@babel/helper-validator-option/lib/index.js
    1.7 KB  node_modules/@babel/helper-validator-option/lib/validator.js
  117.4 KB  node_modules/@babel/helpers/lib/helpers-generated.js
    4.1 KB  node_modules/@babel/helpers/lib/index.js
  556.4 KB  node_modules/@babel/parser/lib/index.js
    1.6 KB  node_modules/@babel/plugin-proposal-decorators/lib/index.js
    9.0 KB  node_modules/@babel/plugin-proposal-decorators/lib/transformer-legacy.js
    0.6 KB  node_modules/@babel/plugin-syntax-async-generators/lib/index.js
    3.2 KB  node_modules/@babel/plugin-syntax-decorators/lib/index.js
    1.5 KB  node_modules/@babel/plugin-syntax-import-attributes/lib/index.js
    0.6 KB  node_modules/@babel/plugin-syntax-json-strings/lib/index.js
    0.7 KB  node_modules/@babel/plugin-syntax-jsx/lib/index.js
    0.6 KB  node_modules/@babel/plugin-syntax-object-rest-spread/lib/index.js
    0.6 KB  node_modules/@babel/plugin-syntax-optional-catch-binding/lib/index.js
    1.4 KB  node_modules/@babel/plugin-syntax-typescript/lib/index.js
    0.9 KB  node_modules/@babel/plugin-transform-class-properties/lib/index.js
    6.6 KB  node_modules/@babel/plugin-transform-class-static-block/lib/index.js
   23.5 KB  node_modules/@babel/plugin-transform-destructuring/lib/index.js
    7.3 KB  node_modules/@babel/plugin-transform-explicit-resource-management/lib/index.js
    1.9 KB  node_modules/@babel/plugin-transform-export-namespace-from/lib/index.js
    2.0 KB  node_modules/@babel/plugin-transform-logical-assignment-operators/lib/index.js
    0.9 KB  node_modules/@babel/plugin-transform-modules-commonjs/lib/dynamic-import.js
    1.3 KB  node_modules/@babel/plugin-transform-modules-commonjs/lib/hooks.js
    8.8 KB  node_modules/@babel/plugin-transform-modules-commonjs/lib/index.js
    1.5 KB  node_modules/@babel/plugin-transform-modules-commonjs/lib/lazy.js
    2.5 KB  node_modules/@babel/plugin-transform-nullish-coalescing-operator/lib/index.js
    1.0 KB  node_modules/@babel/plugin-transform-numeric-separator/lib/index.js
    9.9 KB  node_modules/@babel/plugin-transform-optional-chaining/lib/index.js
    0.9 KB  node_modules/@babel/plugin-transform-private-methods/lib/index.js
   24.0 KB  node_modules/@babel/plugin-transform-react-jsx/lib/create-plugin.js
    0.4 KB  node_modules/@babel/plugin-transform-react-jsx/lib/index.js
    2.5 KB  node_modules/@babel/plugin-transform-typescript/lib/const-enum.js
   11.0 KB  node_modules/@babel/plugin-transform-typescript/lib/enum.js
    1.2 KB  node_modules/@babel/plugin-transform-typescript/lib/global-types.js
   19.8 KB  node_modules/@babel/plugin-transform-typescript/lib/index.js
    7.2 KB  node_modules/@babel/plugin-transform-typescript/lib/namespace.js
    6.3 KB  node_modules/@babel/preset-typescript/lib/index.js
    1.4 KB  node_modules/@babel/preset-typescript/package.json
    2.7 KB  node_modules/@babel/template/lib/builder.js
    1.8 KB  node_modules/@babel/template/lib/formatters.js
    1.0 KB  node_modules/@babel/template/lib/index.js
    2.2 KB  node_modules/@babel/template/lib/literal.js
    3.3 KB  node_modules/@babel/template/lib/options.js
    5.2 KB  node_modules/@babel/template/lib/parse.js
    4.9 KB  node_modules/@babel/template/lib/populate.js
    0.7 KB  node_modules/@babel/template/lib/string.js
    1.2 KB  node_modules/@babel/traverse/lib/cache.js
    3.7 KB  node_modules/@babel/traverse/lib/context.js
    0.5 KB  node_modules/@babel/traverse/lib/hub.js
    2.9 KB  node_modules/@babel/traverse/lib/index.js
    4.1 KB  node_modules/@babel/traverse/lib/path/ancestry.js
    1.8 KB  node_modules/@babel/traverse/lib/path/comments.js
    8.2 KB  node_modules/@babel/traverse/lib/path/context.js
   23.4 KB  node_modules/@babel/traverse/lib/path/conversion.js
   12.3 KB  node_modules/@babel/traverse/lib/path/evaluation.js
   11.8 KB  node_modules/@babel/traverse/lib/path/family.js
   12.0 KB  node_modules/@babel/traverse/lib/path/index.js
    4.8 KB  node_modules/@babel/traverse/lib/path/inference/index.js
    5.2 KB  node_modules/@babel/traverse/lib/path/inference/inferer-reference.js
    7.4 KB  node_modules/@babel/traverse/lib/path/inference/inferers.js
    0.8 KB  node_modules/@babel/traverse/lib/path/inference/util.js
   14.2 KB  node_modules/@babel/traverse/lib/path/introspection.js
    6.0 KB  node_modules/@babel/traverse/lib/path/lib/hoister.js
    1.5 KB  node_modules/@babel/traverse/lib/path/lib/removal-hooks.js
    5.0 KB  node_modules/@babel/traverse/lib/path/lib/virtual-types-validator.js
    1.9 KB  node_modules/@babel/traverse/lib/path/lib/virtual-types.js
    8.9 KB  node_modules/@babel/traverse/lib/path/modification.js
    2.2 KB  node_modules/@babel/traverse/lib/path/removal.js
   10.1 KB  node_modules/@babel/traverse/lib/path/replacement.js
    2.3 KB  node_modules/@babel/traverse/lib/scope/binding.js
   34.9 KB  node_modules/@babel/traverse/lib/scope/index.js
    4.3 KB  node_modules/@babel/traverse/lib/scope/lib/renamer.js
    2.1 KB  node_modules/@babel/traverse/lib/scope/traverseForScope.js
    1.0 KB  node_modules/@babel/traverse/lib/traverse-node.js
    8.7 KB  node_modules/@babel/traverse/lib/visitors.js
    0.6 KB  node_modules/@babel/types/lib/asserts/assertNode.js
   49.7 KB  node_modules/@babel/types/lib/asserts/generated/index.js
    0.6 KB  node_modules/@babel/types/lib/builders/flow/createFlowUnionType.js
    1.2 KB  node_modules/@babel/types/lib/builders/flow/createTypeAnnotationBasedOnTypeof.js
    1.0 KB  node_modules/@babel/types/lib/builders/generated/index.js
   96.2 KB  node_modules/@babel/types/lib/builders/generated/lowercase.js
   28.6 KB  node_modules/@babel/types/lib/builders/generated/uppercase.js
    0.4 KB  node_modules/@babel/types/lib/builders/productions.js
    0.9 KB  node_modules/@babel/types/lib/builders/react/buildChildren.js
    0.8 KB  node_modules/@babel/types/lib/builders/typescript/createTSUnionType.js
    0.3 KB  node_modules/@babel/types/lib/clone/clone.js
    0.4 KB  node_modules/@babel/types/lib/clone/cloneDeep.js
    0.4 KB  node_modules/@babel/types/lib/clone/cloneDeepWithoutLoc.js
    3.7 KB  node_modules/@babel/types/lib/clone/cloneNode.js
    0.4 KB  node_modules/@babel/types/lib/clone/cloneWithoutLoc.js
    0.5 KB  node_modules/@babel/types/lib/comments/addComment.js
    0.6 KB  node_modules/@babel/types/lib/comments/addComments.js
    0.4 KB  node_modules/@babel/types/lib/comments/inheritInnerComments.js
    0.4 KB  node_modules/@babel/types/lib/comments/inheritLeadingComments.js
    0.7 KB  node_modules/@babel/types/lib/comments/inheritsComments.js
    0.4 KB  node_modules/@babel/types/lib/comments/inheritTrailingComments.js
    0.4 KB  node_modules/@babel/types/lib/comments/removeComments.js
    6.5 KB  node_modules/@babel/types/lib/constants/generated/index.js
    2.9 KB  node_modules/@babel/types/lib/constants/index.js
    0.4 KB  node_modules/@babel/types/lib/converters/ensureBlock.js
    2.6 KB  node_modules/@babel/types/lib/converters/gatherSequenceExpressions.js
    0.5 KB  node_modules/@babel/types/lib/converters/toBindingIdentifierName.js
    0.9 KB  node_modules/@babel/types/lib/converters/toBlock.js
    0.5 KB  node_modules/@babel/types/lib/converters/toComputedKey.js
    0.9 KB  node_modules/@babel/types/lib/converters/toExpression.js
    0.8 KB  node_modules/@babel/types/lib/converters/toIdentifier.js
    1.2 KB  node_modules/@babel/types/lib/converters/toKeyAlias.js
    0.7 KB  node_modules/@babel/types/lib/converters/toSequenceExpression.js
    1.1 KB  node_modules/@babel/types/lib/converters/toStatement.js
    3.2 KB  node_modules/@babel/types/lib/converters/valueToNode.js
   61.0 KB  node_modules/@babel/types/lib/definitions/core.js
    0.4 KB  node_modules/@babel/types/lib/definitions/deprecated-aliases.js
    3.4 KB  node_modules/@babel/types/lib/definitions/experimental.js
   18.1 KB  node_modules/@babel/types/lib/definitions/flow.js
    3.1 KB  node_modules/@babel/types/lib/definitions/index.js
    4.8 KB  node_modules/@babel/types/lib/definitions/jsx.js
    0.9 KB  node_modules/@babel/types/lib/definitions/misc.js
    1.2 KB  node_modules/@babel/types/lib/definitions/placeholders.js
   18.5 KB  node_modules/@babel/types/lib/definitions/typescript.js
   10.8 KB  node_modules/@babel/types/lib/definitions/utils.js
   18.1 KB  node_modules/@babel/types/lib/index.js
    0.6 KB  node_modules/@babel/types/lib/modifications/appendToMemberExpression.js
    2.2 KB  node_modules/@babel/types/lib/modifications/flow/removeTypeDuplicates.js
    0.9 KB  node_modules/@babel/types/lib/modifications/inherits.js
    0.7 KB  node_modules/@babel/types/lib/modifications/prependToMemberExpression.js
    0.9 KB  node_modules/@babel/types/lib/modifications/removeProperties.js
    0.5 KB  node_modules/@babel/types/lib/modifications/removePropertiesDeep.js
    2.3 KB  node_modules/@babel/types/lib/modifications/typescript/removeTypeDuplicates.js
    1.4 KB  node_modules/@babel/types/lib/retrievers/getAssignmentIdentifiers.js
    3.3 KB  node_modules/@babel/types/lib/retrievers/getBindingIdentifiers.js
    2.0 KB  node_modules/@babel/types/lib/retrievers/getFunctionName.js
    0.5 KB  node_modules/@babel/types/lib/retrievers/getOuterBindingIdentifiers.js
    1.4 KB  node_modules/@babel/types/lib/traverse/traverse.js
    1.1 KB  node_modules/@babel/types/lib/traverse/traverseFast.js
    1.4 KB  node_modules/@babel/types/lib/utils/deprecationWarning.js
    0.4 KB  node_modules/@babel/types/lib/utils/inherit.js
    1.4 KB  node_modules/@babel/types/lib/utils/react/cleanJSXElementLiteralChild.js
    0.5 KB  node_modules/@babel/types/lib/utils/shallowEqual.js
    0.5 KB  node_modules/@babel/types/lib/validators/buildMatchMemberExpression.js
  105.3 KB  node_modules/@babel/types/lib/validators/generated/index.js
    0.9 KB  node_modules/@babel/types/lib/validators/is.js
    0.9 KB  node_modules/@babel/types/lib/validators/isBinding.js
    0.5 KB  node_modules/@babel/types/lib/validators/isBlockScoped.js
    0.6 KB  node_modules/@babel/types/lib/validators/isImmutable.js
    0.5 KB  node_modules/@babel/types/lib/validators/isLet.js
    0.4 KB  node_modules/@babel/types/lib/validators/isNode.js
    1.7 KB  node_modules/@babel/types/lib/validators/isNodesEquivalent.js
    0.6 KB  node_modules/@babel/types/lib/validators/isPlaceholderType.js
    3.0 KB  node_modules/@babel/types/lib/validators/isReferenced.js
    0.6 KB  node_modules/@babel/types/lib/validators/isScope.js
    0.5 KB  node_modules/@babel/types/lib/validators/isSpecifierDefault.js
    0.6 KB  node_modules/@babel/types/lib/validators/isType.js
    0.8 KB  node_modules/@babel/types/lib/validators/isValidES3Identifier.js
    0.7 KB  node_modules/@babel/types/lib/validators/isValidIdentifier.js
    0.5 KB  node_modules/@babel/types/lib/validators/isVar.js
    1.6 KB  node_modules/@babel/types/lib/validators/matchesPattern.js
    0.3 KB  node_modules/@babel/types/lib/validators/react/isCompatTag.js
    0.5 KB  node_modules/@babel/types/lib/validators/react/isReactComponent.js
    1.7 KB  node_modules/@babel/types/lib/validators/validate.js
   12.8 KB  node_modules/@jridgewell/gen-mapping/dist/gen-mapping.umd.js
    5.8 KB  node_modules/@jridgewell/resolve-uri/dist/resolve-uri.umd.js
   16.9 KB  node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.js
   21.4 KB  node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js
    0.4 KB  node_modules/browserslist/error.js
   37.3 KB  node_modules/browserslist/index.js
   14.3 KB  node_modules/browserslist/node.js
    2.1 KB  node_modules/browserslist/parse.js
   28.2 KB  node_modules/caniuse-lite/data/agents.js
    0.4 KB  node_modules/caniuse-lite/data/browsers.js
    2.8 KB  node_modules/caniuse-lite/data/browserVersions.js
    0.5 KB  node_modules/caniuse-lite/dist/lib/statuses.js
    0.3 KB  node_modules/caniuse-lite/dist/lib/supported.js
    1.7 KB  node_modules/caniuse-lite/dist/unpacker/agents.js
    0.2 KB  node_modules/caniuse-lite/dist/unpacker/browsers.js
    0.2 KB  node_modules/caniuse-lite/dist/unpacker/browserVersions.js
    1.6 KB  node_modules/caniuse-lite/dist/unpacker/feature.js
    0.7 KB  node_modules/caniuse-lite/dist/unpacker/region.js
    6.8 KB  node_modules/convert-source-map/index.js
    4.6 KB  node_modules/debug/src/browser.js
    5.8 KB  node_modules/debug/src/common.js
    0.3 KB  node_modules/debug/src/index.js
    4.2 KB  node_modules/debug/src/node.js
    4.2 KB  node_modules/electron-to-chromium/versions.js
    9.3 KB  node_modules/gensync/index.js
    0.4 KB  node_modules/has-flag/index.js
    1.4 KB  node_modules/js-tokens/index.js
    9.1 KB  node_modules/jsesc/jsesc.js
    0.3 KB  node_modules/json5/lib/index.js
   20.2 KB  node_modules/json5/lib/parse.js
    6.8 KB  node_modules/json5/lib/stringify.js
   15.5 KB  node_modules/json5/lib/unicode.js
    0.9 KB  node_modules/json5/lib/util.js
    8.2 KB  node_modules/lru-cache/index.js
    2.8 KB  node_modules/ms/index.js
   33.0 KB  node_modules/node-releases/data/processed/envs.json
    2.3 KB  node_modules/node-releases/data/release-schedule/release-schedule.json
    3.1 KB  node_modules/picocolors/picocolors.js
    3.4 KB  node_modules/supports-color/index.js
    0.3 KB  node_modules/yallist/iterator.js
    9.7 KB  node_modules/yallist/yallist.js
    3.5 KB  packages/playwright/src/transform/babelBundle.ts

## External (0)
"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __commonJS = (cb, mod) => function __require() {
  return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  // If the importer is in node compatibility mode or this is not an ESM
  // file that has been converted to a CommonJS file using a Babel-
  // compatible transform (i.e. "__esModule" has not been set), then set
  // "default" to the CommonJS "module.exports" for node compatibility.
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  mod
));

// node_modules/source-map/lib/base64.js
var require_base64 = __commonJS({
  "node_modules/source-map/lib/base64.js"(exports2) {
    var intToCharMap = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");
    exports2.encode = function(number) {
      if (0 <= number && number < intToCharMap.length) {
        return intToCharMap[number];
      }
      throw new TypeError("Must be between 0 and 63: " + number);
    };
    exports2.decode = function(charCode) {
      var bigA = 65;
      var bigZ = 90;
      var littleA = 97;
      var littleZ = 122;
      var zero = 48;
      var nine = 57;
      var plus = 43;
      var slash = 47;
      var littleOffset = 26;
      var numberOffset = 52;
      if (bigA <= charCode && charCode <= bigZ) {
        return charCode - bigA;
      }
      if (littleA <= charCode && charCode <= littleZ) {
        return charCode - littleA + littleOffset;
      }
      if (zero <= charCode && charCode <= nine) {
        return charCode - zero + numberOffset;
      }
      if (charCode == plus) {
        return 62;
      }
      if (charCode == slash) {
        return 63;
      }
      return -1;
    };
  }
});

// node_modules/source-map/lib/base64-vlq.js
var require_base64_vlq = __commonJS({
  "node_modules/source-map/lib/base64-vlq.js"(exports2) {
    var base64 = require_base64();
    var VLQ_BASE_SHIFT = 5;
    var VLQ_BASE = 1 << VLQ_BASE_SHIFT;
    var VLQ_BASE_MASK = VLQ_BASE - 1;
    var VLQ_CONTINUATION_BIT = VLQ_BASE;
    function toVLQSigned(aValue) {
      return aValue < 0 ? (-aValue << 1) + 1 : (aValue << 1) + 0;
    }
    function fromVLQSigned(aValue) {
      var isNegative = (aValue & 1) === 1;
      var shifted = aValue >> 1;
      return isNegative ? -shifted : shifted;
    }
    exports2.encode = function base64VLQ_encode(aValue) {
      var encoded = "";
      var digit;
      var vlq = toVLQSigned(aValue);
      do {
        digit = vlq & VLQ_BASE_MASK;
        vlq >>>= VLQ_BASE_SHIFT;
        if (vlq > 0) {
          digit |= VLQ_CONTINUATION_BIT;
        }
        encoded += base64.encode(digit);
      } while (vlq > 0);
      return encoded;
    };
    exports2.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) {
      var strLen = aStr.length;
      var result2 = 0;
      var shift = 0;
      var continuation, digit;
      do {
        if (aIndex >= strLen) {
          throw new Error("Expected more digits in base 64 VLQ value.");
        }
        digit = base64.decode(aStr.charCodeAt(aIndex++));
        if (digit === -1) {
          throw new Error("Invalid base64 digit: " + aStr.charAt(aIndex - 1));
        }
        continuation = !!(digit & VLQ_CONTINUATION_BIT);
        digit &= VLQ_BASE_MASK;
        result2 = result2 + (digit << shift);
        shift += VLQ_BASE_SHIFT;
      } while (continuation);
      aOutParam.value = fromVLQSigned(result2);
      aOutParam.rest = aIndex;
    };
  }
});

// node_modules/source-map/lib/util.js
var require_util = __commonJS({
  "node_modules/source-map/lib/util.js"(exports2) {
    function getArg(aArgs, aName, aDefaultValue) {
      if (aName in aArgs) {
        return aArgs[aName];
      } else if (arguments.length === 3) {
        return aDefaultValue;
      } else {
        throw new Error('"' + aName + '" is a required argument.');
      }
    }
    exports2.getArg = getArg;
    var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/;
    var dataUrlRegexp = /^data:.+\,.+$/;
    function urlParse(aUrl) {
      var match = aUrl.match(urlRegexp);
      if (!match) {
        return null;
      }
      return {
        scheme: match[1],
        auth: match[2],
        host: match[3],
        port: match[4],
        path: match[5]
      };
    }
    exports2.urlParse = urlParse;
    function urlGenerate(aParsedUrl) {
      var url4 = "";
      if (aParsedUrl.scheme) {
        url4 += aParsedUrl.scheme + ":";
      }
      url4 += "//";
      if (aParsedUrl.auth) {
        url4 += aParsedUrl.auth + "@";
      }
      if (aParsedUrl.host) {
        url4 += aParsedUrl.host;
      }
      if (aParsedUrl.port) {
        url4 += ":" + aParsedUrl.port;
      }
      if (aParsedUrl.path) {
        url4 += aParsedUrl.path;
      }
      return url4;
    }
    exports2.urlGenerate = urlGenerate;
    function normalize(aPath) {
      var path6 = aPath;
      var url4 = urlParse(aPath);
      if (url4) {
        if (!url4.path) {
          return aPath;
        }
        path6 = url4.path;
      }
      var isAbsolute = exports2.isAbsolute(path6);
      var parts = path6.split(/\/+/);
      for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {
        part = parts[i];
        if (part === ".") {
          parts.splice(i, 1);
        } else if (part === "..") {
          up++;
        } else if (up > 0) {
          if (part === "") {
            parts.splice(i + 1, up);
            up = 0;
          } else {
            parts.splice(i, 2);
            up--;
          }
        }
      }
      path6 = parts.join("/");
      if (path6 === "") {
        path6 = isAbsolute ? "/" : ".";
      }
      if (url4) {
        url4.path = path6;
        return urlGenerate(url4);
      }
      return path6;
    }
    exports2.normalize = normalize;
    function join(aRoot, aPath) {
      if (aRoot === "") {
        aRoot = ".";
      }
      if (aPath === "") {
        aPath = ".";
      }
      var aPathUrl = urlParse(aPath);
      var aRootUrl = urlParse(aRoot);
      if (aRootUrl) {
        aRoot = aRootUrl.path || "/";
      }
      if (aPathUrl && !aPathUrl.scheme) {
        if (aRootUrl) {
          aPathUrl.scheme = aRootUrl.scheme;
        }
        return urlGenerate(aPathUrl);
      }
      if (aPathUrl || aPath.match(dataUrlRegexp)) {
        return aPath;
      }
      if (aRootUrl && !aRootUrl.host && !aRootUrl.path) {
        aRootUrl.host = aPath;
        return urlGenerate(aRootUrl);
      }
      var joined = aPath.charAt(0) === "/" ? aPath : normalize(aRoot.replace(/\/+$/, "") + "/" + aPath);
      if (aRootUrl) {
        aRootUrl.path = joined;
        return urlGenerate(aRootUrl);
      }
      return joined;
    }
    exports2.join = join;
    exports2.isAbsolute = function(aPath) {
      return aPath.charAt(0) === "/" || urlRegexp.test(aPath);
    };
    function relative(aRoot, aPath) {
      if (aRoot === "") {
        aRoot = ".";
      }
      aRoot = aRoot.replace(/\/$/, "");
      var level = 0;
      while (aPath.indexOf(aRoot + "/") !== 0) {
        var index = aRoot.lastIndexOf("/");
        if (index < 0) {
          return aPath;
        }
        aRoot = aRoot.slice(0, index);
        if (aRoot.match(/^([^\/]+:\/)?\/*$/)) {
          return aPath;
        }
        ++level;
      }
      return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1);
    }
    exports2.relative = relative;
    var supportsNullProto = (function() {
      var obj = /* @__PURE__ */ Object.create(null);
      return !("__proto__" in obj);
    })();
    function identity(s) {
      return s;
    }
    function toSetString(aStr) {
      if (isProtoString(aStr)) {
        return "$" + aStr;
      }
      return aStr;
    }
    exports2.toSetString = supportsNullProto ? identity : toSetString;
    function fromSetString(aStr) {
      if (isProtoString(aStr)) {
        return aStr.slice(1);
      }
      return aStr;
    }
    exports2.fromSetString = supportsNullProto ? identity : fromSetString;
    function isProtoString(s) {
      if (!s) {
        return false;
      }
      var length = s.length;
      if (length < 9) {
        return false;
      }
      if (s.charCodeAt(length - 1) !== 95 || s.charCodeAt(length - 2) !== 95 || s.charCodeAt(length - 3) !== 111 || s.charCodeAt(length - 4) !== 116 || s.charCodeAt(length - 5) !== 111 || s.charCodeAt(length - 6) !== 114 || s.charCodeAt(length - 7) !== 112 || s.charCodeAt(length - 8) !== 95 || s.charCodeAt(length - 9) !== 95) {
        return false;
      }
      for (var i = length - 10; i >= 0; i--) {
        if (s.charCodeAt(i) !== 36) {
          return false;
        }
      }
      return true;
    }
    function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) {
      var cmp = strcmp(mappingA.source, mappingB.source);
      if (cmp !== 0) {
        return cmp;
      }
      cmp = mappingA.originalLine - mappingB.originalLine;
      if (cmp !== 0) {
        return cmp;
      }
      cmp = mappingA.originalColumn - mappingB.originalColumn;
      if (cmp !== 0 || onlyCompareOriginal) {
        return cmp;
      }
      cmp = mappingA.generatedColumn - mappingB.generatedColumn;
      if (cmp !== 0) {
        return cmp;
      }
      cmp = mappingA.generatedLine - mappingB.generatedLine;
      if (cmp !== 0) {
        return cmp;
      }
      return strcmp(mappingA.name, mappingB.name);
    }
    exports2.compareByOriginalPositions = compareByOriginalPositions;
    function compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) {
      var cmp = mappingA.generatedLine - mappingB.generatedLine;
      if (cmp !== 0) {
        return cmp;
      }
      cmp = mappingA.generatedColumn - mappingB.generatedColumn;
      if (cmp !== 0 || onlyCompareGenerated) {
        return cmp;
      }
      cmp = strcmp(mappingA.source, mappingB.source);
      if (cmp !== 0) {
        return cmp;
      }
      cmp = mappingA.originalLine - mappingB.originalLine;
      if (cmp !== 0) {
        return cmp;
      }
      cmp = mappingA.originalColumn - mappingB.originalColumn;
      if (cmp !== 0) {
        return cmp;
      }
      return strcmp(mappingA.name, mappingB.name);
    }
    exports2.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated;
    function strcmp(aStr1, aStr2) {
      if (aStr1 === aStr2) {
        return 0;
      }
      if (aStr1 === null) {
        return 1;
      }
      if (aStr2 === null) {
        return -1;
      }
      if (aStr1 > aStr2) {
        return 1;
      }
      return -1;
    }
    function compareByGeneratedPositionsInflated(mappingA, mappingB) {
      var cmp = mappingA.generatedLine - mappingB.generatedLine;
      if (cmp !== 0) {
        return cmp;
      }
      cmp = mappingA.generatedColumn - mappingB.generatedColumn;
      if (cmp !== 0) {
        return cmp;
      }
      cmp = strcmp(mappingA.source, mappingB.source);
      if (cmp !== 0) {
        return cmp;
      }
      cmp = mappingA.originalLine - mappingB.originalLine;
      if (cmp !== 0) {
        return cmp;
      }
      cmp = mappingA.originalColumn - mappingB.originalColumn;
      if (cmp !== 0) {
        return cmp;
      }
      return strcmp(mappingA.name, mappingB.name);
    }
    exports2.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated;
    function parseSourceMapInput(str) {
      return JSON.parse(str.replace(/^\)]}'[^\n]*\n/, ""));
    }
    exports2.parseSourceMapInput = parseSourceMapInput;
    function computeSourceURL(sourceRoot, sourceURL, sourceMapURL) {
      sourceURL = sourceURL || "";
      if (sourceRoot) {
        if (sourceRoot[sourceRoot.length - 1] !== "/" && sourceURL[0] !== "/") {
          sourceRoot += "/";
        }
        sourceURL = sourceRoot + sourceURL;
      }
      if (sourceMapURL) {
        var parsed = urlParse(sourceMapURL);
        if (!parsed) {
          throw new Error("sourceMapURL could not be parsed");
        }
        if (parsed.path) {
          var index = parsed.path.lastIndexOf("/");
          if (index >= 0) {
            parsed.path = parsed.path.substring(0, index + 1);
          }
        }
        sourceURL = join(urlGenerate(parsed), sourceURL);
      }
      return normalize(sourceURL);
    }
    exports2.computeSourceURL = computeSourceURL;
  }
});

// node_modules/source-map/lib/array-set.js
var require_array_set = __commonJS({
  "node_modules/source-map/lib/array-set.js"(exports2) {
    var util = require_util();
    var has = Object.prototype.hasOwnProperty;
    var hasNativeMap = typeof Map !== "undefined";
    function ArraySet() {
      this._array = [];
      this._set = hasNativeMap ? /* @__PURE__ */ new Map() : /* @__PURE__ */ Object.create(null);
    }
    ArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) {
      var set = new ArraySet();
      for (var i = 0, len = aArray.length; i < len; i++) {
        set.add(aArray[i], aAllowDuplicates);
      }
      return set;
    };
    ArraySet.prototype.size = function ArraySet_size() {
      return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length;
    };
    ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) {
      var sStr = hasNativeMap ? aStr : util.toSetString(aStr);
      var isDuplicate = hasNativeMap ? this.has(aStr) : has.call(this._set, sStr);
      var idx = this._array.length;
      if (!isDuplicate || aAllowDuplicates) {
        this._array.push(aStr);
      }
      if (!isDuplicate) {
        if (hasNativeMap) {
          this._set.set(aStr, idx);
        } else {
          this._set[sStr] = idx;
        }
      }
    };
    ArraySet.prototype.has = function ArraySet_has(aStr) {
      if (hasNativeMap) {
        return this._set.has(aStr);
      } else {
        var sStr = util.toSetString(aStr);
        return has.call(this._set, sStr);
      }
    };
    ArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) {
      if (hasNativeMap) {
        var idx = this._set.get(aStr);
        if (idx >= 0) {
          return idx;
        }
      } else {
        var sStr = util.toSetString(aStr);
        if (has.call(this._set, sStr)) {
          return this._set[sStr];
        }
      }
      throw new Error('"' + aStr + '" is not in the set.');
    };
    ArraySet.prototype.at = function ArraySet_at(aIdx) {
      if (aIdx >= 0 && aIdx < this._array.length) {
        return this._array[aIdx];
      }
      throw new Error("No element indexed by " + aIdx);
    };
    ArraySet.prototype.toArray = function ArraySet_toArray() {
      return this._array.slice();
    };
    exports2.ArraySet = ArraySet;
  }
});

// node_modules/source-map/lib/mapping-list.js
var require_mapping_list = __commonJS({
  "node_modules/source-map/lib/mapping-list.js"(exports2) {
    var util = require_util();
    function generatedPositionAfter(mappingA, mappingB) {
      var lineA = mappingA.generatedLine;
      var lineB = mappingB.generatedLine;
      var columnA = mappingA.generatedColumn;
      var columnB = mappingB.generatedColumn;
      return lineB > lineA || lineB == lineA && columnB >= columnA || util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0;
    }
    function MappingList() {
      this._array = [];
      this._sorted = true;
      this._last = { generatedLine: -1, generatedColumn: 0 };
    }
    MappingList.prototype.unsortedForEach = function MappingList_forEach(aCallback, aThisArg) {
      this._array.forEach(aCallback, aThisArg);
    };
    MappingList.prototype.add = function MappingList_add(aMapping) {
      if (generatedPositionAfter(this._last, aMapping)) {
        this._last = aMapping;
        this._array.push(aMapping);
      } else {
        this._sorted = false;
        this._array.push(aMapping);
      }
    };
    MappingList.prototype.toArray = function MappingList_toArray() {
      if (!this._sorted) {
        this._array.sort(util.compareByGeneratedPositionsInflated);
        this._sorted = true;
      }
      return this._array;
    };
    exports2.MappingList = MappingList;
  }
});

// node_modules/source-map/lib/source-map-generator.js
var require_source_map_generator = __commonJS({
  "node_modules/source-map/lib/source-map-generator.js"(exports2) {
    var base64VLQ = require_base64_vlq();
    var util = require_util();
    var ArraySet = require_array_set().ArraySet;
    var MappingList = require_mapping_list().MappingList;
    function SourceMapGenerator(aArgs) {
      if (!aArgs) {
        aArgs = {};
      }
      this._file = util.getArg(aArgs, "file", null);
      this._sourceRoot = util.getArg(aArgs, "sourceRoot", null);
      this._skipValidation = util.getArg(aArgs, "skipValidation", false);
      this._sources = new ArraySet();
      this._names = new ArraySet();
      this._mappings = new MappingList();
      this._sourcesContents = null;
    }
    SourceMapGenerator.prototype._version = 3;
    SourceMapGenerator.fromSourceMap = function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) {
      var sourceRoot = aSourceMapConsumer.sourceRoot;
      var generator = new SourceMapGenerator({
        file: aSourceMapConsumer.file,
        sourceRoot
      });
      aSourceMapConsumer.eachMapping(function(mapping) {
        var newMapping = {
          generated: {
            line: mapping.generatedLine,
            column: mapping.generatedColumn
          }
        };
        if (mapping.source != null) {
          newMapping.source = mapping.source;
          if (sourceRoot != null) {
            newMapping.source = util.relative(sourceRoot, newMapping.source);
          }
          newMapping.original = {
            line: mapping.originalLine,
            column: mapping.originalColumn
          };
          if (mapping.name != null) {
            newMapping.name = mapping.name;
          }
        }
        generator.addMapping(newMapping);
      });
      aSourceMapConsumer.sources.forEach(function(sourceFile) {
        var sourceRelative = sourceFile;
        if (sourceRoot !== null) {
          sourceRelative = util.relative(sourceRoot, sourceFile);
        }
        if (!generator._sources.has(sourceRelative)) {
          generator._sources.add(sourceRelative);
        }
        var content = aSourceMapConsumer.sourceContentFor(sourceFile);
        if (content != null) {
          generator.setSourceContent(sourceFile, content);
        }
      });
      return generator;
    };
    SourceMapGenerator.prototype.addMapping = function SourceMapGenerator_addMapping(aArgs) {
      var generated = util.getArg(aArgs, "generated");
      var original = util.getArg(aArgs, "original", null);
      var source = util.getArg(aArgs, "source", null);
      var name = util.getArg(aArgs, "name", null);
      if (!this._skipValidation) {
        this._validateMapping(generated, original, source, name);
      }
      if (source != null) {
        source = String(source);
        if (!this._sources.has(source)) {
          this._sources.add(source);
        }
      }
      if (name != null) {
        name = String(name);
        if (!this._names.has(name)) {
          this._names.add(name);
        }
      }
      this._mappings.add({
        generatedLine: generated.line,
        generatedColumn: generated.column,
        originalLine: original != null && original.line,
        originalColumn: original != null && original.column,
        source,
        name
      });
    };
    SourceMapGenerator.prototype.setSourceContent = function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) {
      var source = aSourceFile;
      if (this._sourceRoot != null) {
        source = util.relative(this._sourceRoot, source);
      }
      if (aSourceContent != null) {
        if (!this._sourcesContents) {
          this._sourcesContents = /* @__PURE__ */ Object.create(null);
        }
        this._sourcesContents[util.toSetString(source)] = aSourceContent;
      } else if (this._sourcesContents) {
        delete this._sourcesContents[util.toSetString(source)];
        if (Object.keys(this._sourcesContents).length === 0) {
          this._sourcesContents = null;
        }
      }
    };
    SourceMapGenerator.prototype.applySourceMap = function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) {
      var sourceFile = aSourceFile;
      if (aSourceFile == null) {
        if (aSourceMapConsumer.file == null) {
          throw new Error(
            `SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`
          );
        }
        sourceFile = aSourceMapConsumer.file;
      }
      var sourceRoot = this._sourceRoot;
      if (sourceRoot != null) {
        sourceFile = util.relative(sourceRoot, sourceFile);
      }
      var newSources = new ArraySet();
      var newNames = new ArraySet();
      this._mappings.unsortedForEach(function(mapping) {
        if (mapping.source === sourceFile && mapping.originalLine != null) {
          var original = aSourceMapConsumer.originalPositionFor({
            line: mapping.originalLine,
            column: mapping.originalColumn
          });
          if (original.source != null) {
            mapping.source = original.source;
            if (aSourceMapPath != null) {
              mapping.source = util.join(aSourceMapPath, mapping.source);
            }
            if (sourceRoot != null) {
              mapping.source = util.relative(sourceRoot, mapping.source);
            }
            mapping.originalLine = original.line;
            mapping.originalColumn = original.column;
            if (original.name != null) {
              mapping.name = original.name;
            }
          }
        }
        var source = mapping.source;
        if (source != null && !newSources.has(source)) {
          newSources.add(source);
        }
        var name = mapping.name;
        if (name != null && !newNames.has(name)) {
          newNames.add(name);
        }
      }, this);
      this._sources = newSources;
      this._names = newNames;
      aSourceMapConsumer.sources.forEach(function(sourceFile2) {
        var content = aSourceMapConsumer.sourceContentFor(sourceFile2);
        if (content != null) {
          if (aSourceMapPath != null) {
            sourceFile2 = util.join(aSourceMapPath, sourceFile2);
          }
          if (sourceRoot != null) {
            sourceFile2 = util.relative(sourceRoot, sourceFile2);
          }
          this.setSourceContent(sourceFile2, content);
        }
      }, this);
    };
    SourceMapGenerator.prototype._validateMapping = function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource, aName) {
      if (aOriginal && typeof aOriginal.line !== "number" && typeof aOriginal.column !== "number") {
        throw new Error(
          "original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values."
        );
      }
      if (aGenerated && "line" in aGenerated && "column" in aGenerated && aGenerated.line > 0 && aGenerated.column >= 0 && !aOriginal && !aSource && !aName) {
        return;
      } else if (aGenerated && "line" in aGenerated && "column" in aGenerated && aOriginal && "line" in aOriginal && "column" in aOriginal && aGenerated.line > 0 && aGenerated.column >= 0 && aOriginal.line > 0 && aOriginal.column >= 0 && aSource) {
        return;
      } else {
        throw new Error("Invalid mapping: " + JSON.stringify({
          generated: aGenerated,
          source: aSource,
          original: aOriginal,
          name: aName
        }));
      }
    };
    SourceMapGenerator.prototype._serializeMappings = function SourceMapGenerator_serializeMappings() {
      var previousGeneratedColumn = 0;
      var previousGeneratedLine = 1;
      var previousOriginalColumn = 0;
      var previousOriginalLine = 0;
      var previousName = 0;
      var previousSource = 0;
      var result2 = "";
      var next;
      var mapping;
      var nameIdx;
      var sourceIdx;
      var mappings = this._mappings.toArray();
      for (var i = 0, len = mappings.length; i < len; i++) {
        mapping = mappings[i];
        next = "";
        if (mapping.generatedLine !== previousGeneratedLine) {
          previousGeneratedColumn = 0;
          while (mapping.generatedLine !== previousGeneratedLine) {
            next += ";";
            previousGeneratedLine++;
          }
        } else {
          if (i > 0) {
            if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) {
              continue;
            }
            next += ",";
          }
        }
        next += base64VLQ.encode(mapping.generatedColumn - previousGeneratedColumn);
        previousGeneratedColumn = mapping.generatedColumn;
        if (mapping.source != null) {
          sourceIdx = this._sources.indexOf(mapping.source);
          next += base64VLQ.encode(sourceIdx - previousSource);
          previousSource = sourceIdx;
          next += base64VLQ.encode(mapping.originalLine - 1 - previousOriginalLine);
          previousOriginalLine = mapping.originalLine - 1;
          next += base64VLQ.encode(mapping.originalColumn - previousOriginalColumn);
          previousOriginalColumn = mapping.originalColumn;
          if (mapping.name != null) {
            nameIdx = this._names.indexOf(mapping.name);
            next += base64VLQ.encode(nameIdx - previousName);
            previousName = nameIdx;
          }
        }
        result2 += next;
      }
      return result2;
    };
    SourceMapGenerator.prototype._generateSourcesContent = function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) {
      return aSources.map(function(source) {
        if (!this._sourcesContents) {
          return null;
        }
        if (aSourceRoot != null) {
          source = util.relative(aSourceRoot, source);
        }
        var key = util.toSetString(source);
        return Object.prototype.hasOwnProperty.call(this._sourcesContents, key) ? this._sourcesContents[key] : null;
      }, this);
    };
    SourceMapGenerator.prototype.toJSON = function SourceMapGenerator_toJSON() {
      var map = {
        version: this._version,
        sources: this._sources.toArray(),
        names: this._names.toArray(),
        mappings: this._serializeMappings()
      };
      if (this._file != null) {
        map.file = this._file;
      }
      if (this._sourceRoot != null) {
        map.sourceRoot = this._sourceRoot;
      }
      if (this._sourcesContents) {
        map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot);
      }
      return map;
    };
    SourceMapGenerator.prototype.toString = function SourceMapGenerator_toString() {
      return JSON.stringify(this.toJSON());
    };
    exports2.SourceMapGenerator = SourceMapGenerator;
  }
});

// node_modules/source-map/lib/binary-search.js
var require_binary_search = __commonJS({
  "node_modules/source-map/lib/binary-search.js"(exports2) {
    exports2.GREATEST_LOWER_BOUND = 1;
    exports2.LEAST_UPPER_BOUND = 2;
    function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) {
      var mid = Math.floor((aHigh - aLow) / 2) + aLow;
      var cmp = aCompare(aNeedle, aHaystack[mid], true);
      if (cmp === 0) {
        return mid;
      } else if (cmp > 0) {
        if (aHigh - mid > 1) {
          return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias);
        }
        if (aBias == exports2.LEAST_UPPER_BOUND) {
          return aHigh < aHaystack.length ? aHigh : -1;
        } else {
          return mid;
        }
      } else {
        if (mid - aLow > 1) {
          return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias);
        }
        if (aBias == exports2.LEAST_UPPER_BOUND) {
          return mid;
        } else {
          return aLow < 0 ? -1 : aLow;
        }
      }
    }
    exports2.search = function search(aNeedle, aHaystack, aCompare, aBias) {
      if (aHaystack.length === 0) {
        return -1;
      }
      var index = recursiveSearch(
        -1,
        aHaystack.length,
        aNeedle,
        aHaystack,
        aCompare,
        aBias || exports2.GREATEST_LOWER_BOUND
      );
      if (index < 0) {
        return -1;
      }
      while (index - 1 >= 0) {
        if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) {
          break;
        }
        --index;
      }
      return index;
    };
  }
});

// node_modules/source-map/lib/quick-sort.js
var require_quick_sort = __commonJS({
  "node_modules/source-map/lib/quick-sort.js"(exports2) {
    function swap(ary, x, y) {
      var temp = ary[x];
      ary[x] = ary[y];
      ary[y] = temp;
    }
    function randomIntInRange(low, high) {
      return Math.round(low + Math.random() * (high - low));
    }
    function doQuickSort(ary, comparator, p, r) {
      if (p < r) {
        var pivotIndex = randomIntInRange(p, r);
        var i = p - 1;
        swap(ary, pivotIndex, r);
        var pivot = ary[r];
        for (var j = p; j < r; j++) {
          if (comparator(ary[j], pivot) <= 0) {
            i += 1;
            swap(ary, i, j);
          }
        }
        swap(ary, i + 1, j);
        var q = i + 1;
        doQuickSort(ary, comparator, p, q - 1);
        doQuickSort(ary, comparator, q + 1, r);
      }
    }
    exports2.quickSort = function(ary, comparator) {
      doQuickSort(ary, comparator, 0, ary.length - 1);
    };
  }
});

// node_modules/source-map/lib/source-map-consumer.js
var require_source_map_consumer = __commonJS({
  "node_modules/source-map/lib/source-map-consumer.js"(exports2) {
    var util = require_util();
    var binarySearch = require_binary_search();
    var ArraySet = require_array_set().ArraySet;
    var base64VLQ = require_base64_vlq();
    var quickSort = require_quick_sort().quickSort;
    function SourceMapConsumer(aSourceMap, aSourceMapURL) {
      var sourceMap = aSourceMap;
      if (typeof aSourceMap === "string") {
        sourceMap = util.parseSourceMapInput(aSourceMap);
      }
      return sourceMap.sections != null ? new IndexedSourceMapConsumer(sourceMap, aSourceMapURL) : new BasicSourceMapConsumer(sourceMap, aSourceMapURL);
    }
    SourceMapConsumer.fromSourceMap = function(aSourceMap, aSourceMapURL) {
      return BasicSourceMapConsumer.fromSourceMap(aSourceMap, aSourceMapURL);
    };
    SourceMapConsumer.prototype._version = 3;
    SourceMapConsumer.prototype.__generatedMappings = null;
    Object.defineProperty(SourceMapConsumer.prototype, "_generatedMappings", {
      configurable: true,
      enumerable: true,
      get: function() {
        if (!this.__generatedMappings) {
          this._parseMappings(this._mappings, this.sourceRoot);
        }
        return this.__generatedMappings;
      }
    });
    SourceMapConsumer.prototype.__originalMappings = null;
    Object.defineProperty(SourceMapConsumer.prototype, "_originalMappings", {
      configurable: true,
      enumerable: true,
      get: function() {
        if (!this.__originalMappings) {
          this._parseMappings(this._mappings, this.sourceRoot);
        }
        return this.__originalMappings;
      }
    });
    SourceMapConsumer.prototype._charIsMappingSeparator = function SourceMapConsumer_charIsMappingSeparator(aStr, index) {
      var c = aStr.charAt(index);
      return c === ";" || c === ",";
    };
    SourceMapConsumer.prototype._parseMappings = function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {
      throw new Error("Subclasses must implement _parseMappings");
    };
    SourceMapConsumer.GENERATED_ORDER = 1;
    SourceMapConsumer.ORIGINAL_ORDER = 2;
    SourceMapConsumer.GREATEST_LOWER_BOUND = 1;
    SourceMapConsumer.LEAST_UPPER_BOUND = 2;
    SourceMapConsumer.prototype.eachMapping = function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) {
      var context = aContext || null;
      var order = aOrder || SourceMapConsumer.GENERATED_ORDER;
      var mappings;
      switch (order) {
        case SourceMapConsumer.GENERATED_ORDER:
          mappings = this._generatedMappings;
          break;
        case SourceMapConsumer.ORIGINAL_ORDER:
          mappings = this._originalMappings;
          break;
        default:
          throw new Error("Unknown order of iteration.");
      }
      var sourceRoot = this.sourceRoot;
      mappings.map(function(mapping) {
        var source = mapping.source === null ? null : this._sources.at(mapping.source);
        source = util.computeSourceURL(sourceRoot, source, this._sourceMapURL);
        return {
          source,
          generatedLine: mapping.generatedLine,
          generatedColumn: mapping.generatedColumn,
          originalLine: mapping.originalLine,
          originalColumn: mapping.originalColumn,
          name: mapping.name === null ? null : this._names.at(mapping.name)
        };
      }, this).forEach(aCallback, context);
    };
    SourceMapConsumer.prototype.allGeneratedPositionsFor = function SourceMapConsumer_allGeneratedPositionsFor(aArgs) {
      var line = util.getArg(aArgs, "line");
      var needle = {
        source: util.getArg(aArgs, "source"),
        originalLine: line,
        originalColumn: util.getArg(aArgs, "column", 0)
      };
      needle.source = this._findSourceIndex(needle.source);
      if (needle.source < 0) {
        return [];
      }
      var mappings = [];
      var index = this._findMapping(
        needle,
        this._originalMappings,
        "originalLine",
        "originalColumn",
        util.compareByOriginalPositions,
        binarySearch.LEAST_UPPER_BOUND
      );
      if (index >= 0) {
        var mapping = this._originalMappings[index];
        if (aArgs.column === void 0) {
          var originalLine = mapping.originalLine;
          while (mapping && mapping.originalLine === originalLine) {
            mappings.push({
              line: util.getArg(mapping, "generatedLine", null),
              column: util.getArg(mapping, "generatedColumn", null),
              lastColumn: util.getArg(mapping, "lastGeneratedColumn", null)
            });
            mapping = this._originalMappings[++index];
          }
        } else {
          var originalColumn = mapping.originalColumn;
          while (mapping && mapping.originalLine === line && mapping.originalColumn == originalColumn) {
            mappings.push({
              line: util.getArg(mapping, "generatedLine", null),
              column: util.getArg(mapping, "generatedColumn", null),
              lastColumn: util.getArg(mapping, "lastGeneratedColumn", null)
            });
            mapping = this._originalMappings[++index];
          }
        }
      }
      return mappings;
    };
    exports2.SourceMapConsumer = SourceMapConsumer;
    function BasicSourceMapConsumer(aSourceMap, aSourceMapURL) {
      var sourceMap = aSourceMap;
      if (typeof aSourceMap === "string") {
        sourceMap = util.parseSourceMapInput(aSourceMap);
      }
      var version2 = util.getArg(sourceMap, "version");
      var sources = util.getArg(sourceMap, "sources");
      var names = util.getArg(sourceMap, "names", []);
      var sourceRoot = util.getArg(sourceMap, "sourceRoot", null);
      var sourcesContent = util.getArg(sourceMap, "sourcesContent", null);
      var mappings = util.getArg(sourceMap, "mappings");
      var file2 = util.getArg(sourceMap, "file", null);
      if (version2 != this._version) {
        throw new Error("Unsupported version: " + version2);
      }
      if (sourceRoot) {
        sourceRoot = util.normalize(sourceRoot);
      }
      sources = sources.map(String).map(util.normalize).map(function(source) {
        return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source) ? util.relative(sourceRoot, source) : source;
      });
      this._names = ArraySet.fromArray(names.map(String), true);
      this._sources = ArraySet.fromArray(sources, true);
      this._absoluteSources = this._sources.toArray().map(function(s) {
        return util.computeSourceURL(sourceRoot, s, aSourceMapURL);
      });
      this.sourceRoot = sourceRoot;
      this.sourcesContent = sourcesContent;
      this._mappings = mappings;
      this._sourceMapURL = aSourceMapURL;
      this.file = file2;
    }
    BasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);
    BasicSourceMapConsumer.prototype.consumer = SourceMapConsumer;
    BasicSourceMapConsumer.prototype._findSourceIndex = function(aSource) {
      var relativeSource = aSource;
      if (this.sourceRoot != null) {
        relativeSource = util.relative(this.sourceRoot, relativeSource);
      }
      if (this._sources.has(relativeSource)) {
        return this._sources.indexOf(relativeSource);
      }
      var i;
      for (i = 0; i < this._absoluteSources.length; ++i) {
        if (this._absoluteSources[i] == aSource) {
          return i;
        }
      }
      return -1;
    };
    BasicSourceMapConsumer.fromSourceMap = function SourceMapConsumer_fromSourceMap(aSourceMap, aSourceMapURL) {
      var smc = Object.create(BasicSourceMapConsumer.prototype);
      var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true);
      var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true);
      smc.sourceRoot = aSourceMap._sourceRoot;
      smc.sourcesContent = aSourceMap._generateSourcesContent(
        smc._sources.toArray(),
        smc.sourceRoot
      );
      smc.file = aSourceMap._file;
      smc._sourceMapURL = aSourceMapURL;
      smc._absoluteSources = smc._sources.toArray().map(function(s) {
        return util.computeSourceURL(smc.sourceRoot, s, aSourceMapURL);
      });
      var generatedMappings = aSourceMap._mappings.toArray().slice();
      var destGeneratedMappings = smc.__generatedMappings = [];
      var destOriginalMappings = smc.__originalMappings = [];
      for (var i = 0, length = generatedMappings.length; i < length; i++) {
        var srcMapping = generatedMappings[i];
        var destMapping = new Mapping();
        destMapping.generatedLine = srcMapping.generatedLine;
        destMapping.generatedColumn = srcMapping.generatedColumn;
        if (srcMapping.source) {
          destMapping.source = sources.indexOf(srcMapping.source);
          destMapping.originalLine = srcMapping.originalLine;
          destMapping.originalColumn = srcMapping.originalColumn;
          if (srcMapping.name) {
            destMapping.name = names.indexOf(srcMapping.name);
          }
          destOriginalMappings.push(destMapping);
        }
        destGeneratedMappings.push(destMapping);
      }
      quickSort(smc.__originalMappings, util.compareByOriginalPositions);
      return smc;
    };
    BasicSourceMapConsumer.prototype._version = 3;
    Object.defineProperty(BasicSourceMapConsumer.prototype, "sources", {
      get: function() {
        return this._absoluteSources.slice();
      }
    });
    function Mapping() {
      this.generatedLine = 0;
      this.generatedColumn = 0;
      this.source = null;
      this.originalLine = null;
      this.originalColumn = null;
      this.name = null;
    }
    BasicSourceMapConsumer.prototype._parseMappings = function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {
      var generatedLine = 1;
      var previousGeneratedColumn = 0;
      var previousOriginalLine = 0;
      var previousOriginalColumn = 0;
      var previousSource = 0;
      var previousName = 0;
      var length = aStr.length;
      var index = 0;
      var cachedSegments = {};
      var temp = {};
      var originalMappings = [];
      var generatedMappings = [];
      var mapping, str, segment, end, value;
      while (index < length) {
        if (aStr.charAt(index) === ";") {
          generatedLine++;
          index++;
          previousGeneratedColumn = 0;
        } else if (aStr.charAt(index) === ",") {
          index++;
        } else {
          mapping = new Mapping();
          mapping.generatedLine = generatedLine;
          for (end = index; end < length; end++) {
            if (this._charIsMappingSeparator(aStr, end)) {
              break;
            }
          }
          str = aStr.slice(index, end);
          segment = cachedSegments[str];
          if (segment) {
            index += str.length;
          } else {
            segment = [];
            while (index < end) {
              base64VLQ.decode(aStr, index, temp);
              value = temp.value;
              index = temp.rest;
              segment.push(value);
            }
            if (segment.length === 2) {
              throw new Error("Found a source, but no line and column");
            }
            if (segment.length === 3) {
              throw new Error("Found a source and line, but no column");
            }
            cachedSegments[str] = segment;
          }
          mapping.generatedColumn = previousGeneratedColumn + segment[0];
          previousGeneratedColumn = mapping.generatedColumn;
          if (segment.length > 1) {
            mapping.source = previousSource + segment[1];
            previousSource += segment[1];
            mapping.originalLine = previousOriginalLine + segment[2];
            previousOriginalLine = mapping.originalLine;
            mapping.originalLine += 1;
            mapping.originalColumn = previousOriginalColumn + segment[3];
            previousOriginalColumn = mapping.originalColumn;
            if (segment.length > 4) {
              mapping.name = previousName + segment[4];
              previousName += segment[4];
            }
          }
          generatedMappings.push(mapping);
          if (typeof mapping.originalLine === "number") {
            originalMappings.push(mapping);
          }
        }
      }
      quickSort(generatedMappings, util.compareByGeneratedPositionsDeflated);
      this.__generatedMappings = generatedMappings;
      quickSort(originalMappings, util.compareByOriginalPositions);
      this.__originalMappings = originalMappings;
    };
    BasicSourceMapConsumer.prototype._findMapping = function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName, aColumnName, aComparator, aBias) {
      if (aNeedle[aLineName] <= 0) {
        throw new TypeError("Line must be greater than or equal to 1, got " + aNeedle[aLineName]);
      }
      if (aNeedle[aColumnName] < 0) {
        throw new TypeError("Column must be greater than or equal to 0, got " + aNeedle[aColumnName]);
      }
      return binarySearch.search(aNeedle, aMappings, aComparator, aBias);
    };
    BasicSourceMapConsumer.prototype.computeColumnSpans = function SourceMapConsumer_computeColumnSpans() {
      for (var index = 0; index < this._generatedMappings.length; ++index) {
        var mapping = this._generatedMappings[index];
        if (index + 1 < this._generatedMappings.length) {
          var nextMapping = this._generatedMappings[index + 1];
          if (mapping.generatedLine === nextMapping.generatedLine) {
            mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1;
            continue;
          }
        }
        mapping.lastGeneratedColumn = Infinity;
      }
    };
    BasicSourceMapConsumer.prototype.originalPositionFor = function SourceMapConsumer_originalPositionFor(aArgs) {
      var needle = {
        generatedLine: util.getArg(aArgs, "line"),
        generatedColumn: util.getArg(aArgs, "column")
      };
      var index = this._findMapping(
        needle,
        this._generatedMappings,
        "generatedLine",
        "generatedColumn",
        util.compareByGeneratedPositionsDeflated,
        util.getArg(aArgs, "bias", SourceMapConsumer.GREATEST_LOWER_BOUND)
      );
      if (index >= 0) {
        var mapping = this._generatedMappings[index];
        if (mapping.generatedLine === needle.generatedLine) {
          var source = util.getArg(mapping, "source", null);
          if (source !== null) {
            source = this._sources.at(source);
            source = util.computeSourceURL(this.sourceRoot, source, this._sourceMapURL);
          }
          var name = util.getArg(mapping, "name", null);
          if (name !== null) {
            name = this._names.at(name);
          }
          return {
            source,
            line: util.getArg(mapping, "originalLine", null),
            column: util.getArg(mapping, "originalColumn", null),
            name
          };
        }
      }
      return {
        source: null,
        line: null,
        column: null,
        name: null
      };
    };
    BasicSourceMapConsumer.prototype.hasContentsOfAllSources = function BasicSourceMapConsumer_hasContentsOfAllSources() {
      if (!this.sourcesContent) {
        return false;
      }
      return this.sourcesContent.length >= this._sources.size() && !this.sourcesContent.some(function(sc) {
        return sc == null;
      });
    };
    BasicSourceMapConsumer.prototype.sourceContentFor = function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {
      if (!this.sourcesContent) {
        return null;
      }
      var index = this._findSourceIndex(aSource);
      if (index >= 0) {
        return this.sourcesContent[index];
      }
      var relativeSource = aSource;
      if (this.sourceRoot != null) {
        relativeSource = util.relative(this.sourceRoot, relativeSource);
      }
      var url4;
      if (this.sourceRoot != null && (url4 = util.urlParse(this.sourceRoot))) {
        var fileUriAbsPath = relativeSource.replace(/^file:\/\//, "");
        if (url4.scheme == "file" && this._sources.has(fileUriAbsPath)) {
          return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)];
        }
        if ((!url4.path || url4.path == "/") && this._sources.has("/" + relativeSource)) {
          return this.sourcesContent[this._sources.indexOf("/" + relativeSource)];
        }
      }
      if (nullOnMissing) {
        return null;
      } else {
        throw new Error('"' + relativeSource + '" is not in the SourceMap.');
      }
    };
    BasicSourceMapConsumer.prototype.generatedPositionFor = function SourceMapConsumer_generatedPositionFor(aArgs) {
      var source = util.getArg(aArgs, "source");
      source = this._findSourceIndex(source);
      if (source < 0) {
        return {
          line: null,
          column: null,
          lastColumn: null
        };
      }
      var needle = {
        source,
        originalLine: util.getArg(aArgs, "line"),
        originalColumn: util.getArg(aArgs, "column")
      };
      var index = this._findMapping(
        needle,
        this._originalMappings,
        "originalLine",
        "originalColumn",
        util.compareByOriginalPositions,
        util.getArg(aArgs, "bias", SourceMapConsumer.GREATEST_LOWER_BOUND)
      );
      if (index >= 0) {
        var mapping = this._originalMappings[index];
        if (mapping.source === needle.source) {
          return {
            line: util.getArg(mapping, "generatedLine", null),
            column: util.getArg(mapping, "generatedColumn", null),
            lastColumn: util.getArg(mapping, "lastGeneratedColumn", null)
          };
        }
      }
      return {
        line: null,
        column: null,
        lastColumn: null
      };
    };
    exports2.BasicSourceMapConsumer = BasicSourceMapConsumer;
    function IndexedSourceMapConsumer(aSourceMap, aSourceMapURL) {
      var sourceMap = aSourceMap;
      if (typeof aSourceMap === "string") {
        sourceMap = util.parseSourceMapInput(aSourceMap);
      }
      var version2 = util.getArg(sourceMap, "version");
      var sections = util.getArg(sourceMap, "sections");
      if (version2 != this._version) {
        throw new Error("Unsupported version: " + version2);
      }
      this._sources = new ArraySet();
      this._names = new ArraySet();
      var lastOffset = {
        line: -1,
        column: 0
      };
      this._sections = sections.map(function(s) {
        if (s.url) {
          throw new Error("Support for url field in sections not implemented.");
        }
        var offset = util.getArg(s, "offset");
        var offsetLine = util.getArg(offset, "line");
        var offsetColumn = util.getArg(offset, "column");
        if (offsetLine < lastOffset.line || offsetLine === lastOffset.line && offsetColumn < lastOffset.column) {
          throw new Error("Section offsets must be ordered and non-overlapping.");
        }
        lastOffset = offset;
        return {
          generatedOffset: {
            // The offset fields are 0-based, but we use 1-based indices when
            // encoding/decoding from VLQ.
            generatedLine: offsetLine + 1,
            generatedColumn: offsetColumn + 1
          },
          consumer: new SourceMapConsumer(util.getArg(s, "map"), aSourceMapURL)
        };
      });
    }
    IndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);
    IndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer;
    IndexedSourceMapConsumer.prototype._version = 3;
    Object.defineProperty(IndexedSourceMapConsumer.prototype, "sources", {
      get: function() {
        var sources = [];
        for (var i = 0; i < this._sections.length; i++) {
          for (var j = 0; j < this._sections[i].consumer.sources.length; j++) {
            sources.push(this._sections[i].consumer.sources[j]);
          }
        }
        return sources;
      }
    });
    IndexedSourceMapConsumer.prototype.originalPositionFor = function IndexedSourceMapConsumer_originalPositionFor(aArgs) {
      var needle = {
        generatedLine: util.getArg(aArgs, "line"),
        generatedColumn: util.getArg(aArgs, "column")
      };
      var sectionIndex = binarySearch.search(
        needle,
        this._sections,
        function(needle2, section2) {
          var cmp = needle2.generatedLine - section2.generatedOffset.generatedLine;
          if (cmp) {
            return cmp;
          }
          return needle2.generatedColumn - section2.generatedOffset.generatedColumn;
        }
      );
      var section = this._sections[sectionIndex];
      if (!section) {
        return {
          source: null,
          line: null,
          column: null,
          name: null
        };
      }
      return section.consumer.originalPositionFor({
        line: needle.generatedLine - (section.generatedOffset.generatedLine - 1),
        column: needle.generatedColumn - (section.generatedOffset.generatedLine === needle.generatedLine ? section.generatedOffset.generatedColumn - 1 : 0),
        bias: aArgs.bias
      });
    };
    IndexedSourceMapConsumer.prototype.hasContentsOfAllSources = function IndexedSourceMapConsumer_hasContentsOfAllSources() {
      return this._sections.every(function(s) {
        return s.consumer.hasContentsOfAllSources();
      });
    };
    IndexedSourceMapConsumer.prototype.sourceContentFor = function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {
      for (var i = 0; i < this._sections.length; i++) {
        var section = this._sections[i];
        var content = section.consumer.sourceContentFor(aSource, true);
        if (content) {
          return content;
        }
      }
      if (nullOnMissing) {
        return null;
      } else {
        throw new Error('"' + aSource + '" is not in the SourceMap.');
      }
    };
    IndexedSourceMapConsumer.prototype.generatedPositionFor = function IndexedSourceMapConsumer_generatedPositionFor(aArgs) {
      for (var i = 0; i < this._sections.length; i++) {
        var section = this._sections[i];
        if (section.consumer._findSourceIndex(util.getArg(aArgs, "source")) === -1) {
          continue;
        }
        var generatedPosition = section.consumer.generatedPositionFor(aArgs);
        if (generatedPosition) {
          var ret = {
            line: generatedPosition.line + (section.generatedOffset.generatedLine - 1),
            column: generatedPosition.column + (section.generatedOffset.generatedLine === generatedPosition.line ? section.generatedOffset.generatedColumn - 1 : 0)
          };
          return ret;
        }
      }
      return {
        line: null,
        column: null
      };
    };
    IndexedSourceMapConsumer.prototype._parseMappings = function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) {
      this.__generatedMappings = [];
      this.__originalMappings = [];
      for (var i = 0; i < this._sections.length; i++) {
        var section = this._sections[i];
        var sectionMappings = section.consumer._generatedMappings;
        for (var j = 0; j < sectionMappings.length; j++) {
          var mapping = sectionMappings[j];
          var source = section.consumer._sources.at(mapping.source);
          source = util.computeSourceURL(section.consumer.sourceRoot, source, this._sourceMapURL);
          this._sources.add(source);
          source = this._sources.indexOf(source);
          var name = null;
          if (mapping.name) {
            name = section.consumer._names.at(mapping.name);
            this._names.add(name);
            name = this._names.indexOf(name);
          }
          var adjustedMapping = {
            source,
            generatedLine: mapping.generatedLine + (section.generatedOffset.generatedLine - 1),
            generatedColumn: mapping.generatedColumn + (section.generatedOffset.generatedLine === mapping.generatedLine ? section.generatedOffset.generatedColumn - 1 : 0),
            originalLine: mapping.originalLine,
            originalColumn: mapping.originalColumn,
            name
          };
          this.__generatedMappings.push(adjustedMapping);
          if (typeof adjustedMapping.originalLine === "number") {
            this.__originalMappings.push(adjustedMapping);
          }
        }
      }
      quickSort(this.__generatedMappings, util.compareByGeneratedPositionsDeflated);
      quickSort(this.__originalMappings, util.compareByOriginalPositions);
    };
    exports2.IndexedSourceMapConsumer = IndexedSourceMapConsumer;
  }
});

// node_modules/source-map/lib/source-node.js
var require_source_node = __commonJS({
  "node_modules/source-map/lib/source-node.js"(exports2) {
    var SourceMapGenerator = require_source_map_generator().SourceMapGenerator;
    var util = require_util();
    var REGEX_NEWLINE = /(\r?\n)/;
    var NEWLINE_CODE = 10;
    var isSourceNode = "$$$isSourceNode$$$";
    function SourceNode(aLine, aColumn, aSource, aChunks, aName) {
      this.children = [];
      this.sourceContents = {};
      this.line = aLine == null ? null : aLine;
      this.column = aColumn == null ? null : aColumn;
      this.source = aSource == null ? null : aSource;
      this.name = aName == null ? null : aName;
      this[isSourceNode] = true;
      if (aChunks != null) this.add(aChunks);
    }
    SourceNode.fromStringWithSourceMap = function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) {
      var node = new SourceNode();
      var remainingLines = aGeneratedCode.split(REGEX_NEWLINE);
      var remainingLinesIndex = 0;
      var shiftNextLine = function() {
        var lineContents = getNextLine();
        var newLine = getNextLine() || "";
        return lineContents + newLine;
        function getNextLine() {
          return remainingLinesIndex < remainingLines.length ? remainingLines[remainingLinesIndex++] : void 0;
        }
      };
      var lastGeneratedLine = 1, lastGeneratedColumn = 0;
      var lastMapping = null;
      aSourceMapConsumer.eachMapping(function(mapping) {
        if (lastMapping !== null) {
          if (lastGeneratedLine < mapping.generatedLine) {
            addMappingWithCode(lastMapping, shiftNextLine());
            lastGeneratedLine++;
            lastGeneratedColumn = 0;
          } else {
            var nextLine = remainingLines[remainingLinesIndex] || "";
            var code = nextLine.substr(0, mapping.generatedColumn - lastGeneratedColumn);
            remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn - lastGeneratedColumn);
            lastGeneratedColumn = mapping.generatedColumn;
            addMappingWithCode(lastMapping, code);
            lastMapping = mapping;
            return;
          }
        }
        while (lastGeneratedLine < mapping.generatedLine) {
          node.add(shiftNextLine());
          lastGeneratedLine++;
        }
        if (lastGeneratedColumn < mapping.generatedColumn) {
          var nextLine = remainingLines[remainingLinesIndex] || "";
          node.add(nextLine.substr(0, mapping.generatedColumn));
          remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn);
          lastGeneratedColumn = mapping.generatedColumn;
        }
        lastMapping = mapping;
      }, this);
      if (remainingLinesIndex < remainingLines.length) {
        if (lastMapping) {
          addMappingWithCode(lastMapping, shiftNextLine());
        }
        node.add(remainingLines.splice(remainingLinesIndex).join(""));
      }
      aSourceMapConsumer.sources.forEach(function(sourceFile) {
        var content = aSourceMapConsumer.sourceContentFor(sourceFile);
        if (content != null) {
          if (aRelativePath != null) {
            sourceFile = util.join(aRelativePath, sourceFile);
          }
          node.setSourceContent(sourceFile, content);
        }
      });
      return node;
      function addMappingWithCode(mapping, code) {
        if (mapping === null || mapping.source === void 0) {
          node.add(code);
        } else {
          var source = aRelativePath ? util.join(aRelativePath, mapping.source) : mapping.source;
          node.add(new SourceNode(
            mapping.originalLine,
            mapping.originalColumn,
            source,
            code,
            mapping.name
          ));
        }
      }
    };
    SourceNode.prototype.add = function SourceNode_add(aChunk) {
      if (Array.isArray(aChunk)) {
        aChunk.forEach(function(chunk) {
          this.add(chunk);
        }, this);
      } else if (aChunk[isSourceNode] || typeof aChunk === "string") {
        if (aChunk) {
          this.children.push(aChunk);
        }
      } else {
        throw new TypeError(
          "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk
        );
      }
      return this;
    };
    SourceNode.prototype.prepend = function SourceNode_prepend(aChunk) {
      if (Array.isArray(aChunk)) {
        for (var i = aChunk.length - 1; i >= 0; i--) {
          this.prepend(aChunk[i]);
        }
      } else if (aChunk[isSourceNode] || typeof aChunk === "string") {
        this.children.unshift(aChunk);
      } else {
        throw new TypeError(
          "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk
        );
      }
      return this;
    };
    SourceNode.prototype.walk = function SourceNode_walk(aFn) {
      var chunk;
      for (var i = 0, len = this.children.length; i < len; i++) {
        chunk = this.children[i];
        if (chunk[isSourceNode]) {
          chunk.walk(aFn);
        } else {
          if (chunk !== "") {
            aFn(chunk, {
              source: this.source,
              line: this.line,
              column: this.column,
              name: this.name
            });
          }
        }
      }
    };
    SourceNode.prototype.join = function SourceNode_join(aSep) {
      var newChildren;
      var i;
      var len = this.children.length;
      if (len > 0) {
        newChildren = [];
        for (i = 0; i < len - 1; i++) {
          newChildren.push(this.children[i]);
          newChildren.push(aSep);
        }
        newChildren.push(this.children[i]);
        this.children = newChildren;
      }
      return this;
    };
    SourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) {
      var lastChild = this.children[this.children.length - 1];
      if (lastChild[isSourceNode]) {
        lastChild.replaceRight(aPattern, aReplacement);
      } else if (typeof lastChild === "string") {
        this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement);
      } else {
        this.children.push("".replace(aPattern, aReplacement));
      }
      return this;
    };
    SourceNode.prototype.setSourceContent = function SourceNode_setSourceContent(aSourceFile, aSourceContent) {
      this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent;
    };
    SourceNode.prototype.walkSourceContents = function SourceNode_walkSourceContents(aFn) {
      for (var i = 0, len = this.children.length; i < len; i++) {
        if (this.children[i][isSourceNode]) {
          this.children[i].walkSourceContents(aFn);
        }
      }
      var sources = Object.keys(this.sourceContents);
      for (var i = 0, len = sources.length; i < len; i++) {
        aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]);
      }
    };
    SourceNode.prototype.toString = function SourceNode_toString() {
      var str = "";
      this.walk(function(chunk) {
        str += chunk;
      });
      return str;
    };
    SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) {
      var generated = {
        code: "",
        line: 1,
        column: 0
      };
      var map = new SourceMapGenerator(aArgs);
      var sourceMappingActive = false;
      var lastOriginalSource = null;
      var lastOriginalLine = null;
      var lastOriginalColumn = null;
      var lastOriginalName = null;
      this.walk(function(chunk, original) {
        generated.code += chunk;
        if (original.source !== null && original.line !== null && original.column !== null) {
          if (lastOriginalSource !== original.source || lastOriginalLine !== original.line || lastOriginalColumn !== original.column || lastOriginalName !== original.name) {
            map.addMapping({
              source: original.source,
              original: {
                line: original.line,
                column: original.column
              },
              generated: {
                line: generated.line,
                column: generated.column
              },
              name: original.name
            });
          }
          lastOriginalSource = original.source;
          lastOriginalLine = original.line;
          lastOriginalColumn = original.column;
          lastOriginalName = original.name;
          sourceMappingActive = true;
        } else if (sourceMappingActive) {
          map.addMapping({
            generated: {
              line: generated.line,
              column: generated.column
            }
          });
          lastOriginalSource = null;
          sourceMappingActive = false;
        }
        for (var idx = 0, length = chunk.length; idx < length; idx++) {
          if (chunk.charCodeAt(idx) === NEWLINE_CODE) {
            generated.line++;
            generated.column = 0;
            if (idx + 1 === length) {
              lastOriginalSource = null;
              sourceMappingActive = false;
            } else if (sourceMappingActive) {
              map.addMapping({
                source: original.source,
                original: {
                  line: original.line,
                  column: original.column
                },
                generated: {
                  line: generated.line,
                  column: generated.column
                },
                name: original.name
              });
            }
          } else {
            generated.column++;
          }
        }
      });
      this.walkSourceContents(function(sourceFile, sourceContent) {
        map.setSourceContent(sourceFile, sourceContent);
      });
      return { code: generated.code, map };
    };
    exports2.SourceNode = SourceNode;
  }
});

// node_modules/source-map/source-map.js
var require_source_map = __commonJS({
  "node_modules/source-map/source-map.js"(exports2) {
    exports2.SourceMapGenerator = require_source_map_generator().SourceMapGenerator;
    exports2.SourceMapConsumer = require_source_map_consumer().SourceMapConsumer;
    exports2.SourceNode = require_source_node().SourceNode;
  }
});

// node_modules/buffer-from/index.js
var require_buffer_from = __commonJS({
  "node_modules/buffer-from/index.js"(exports2, module2) {
    var toString = Object.prototype.toString;
    var isModern = typeof Buffer !== "undefined" && typeof Buffer.alloc === "function" && typeof Buffer.allocUnsafe === "function" && typeof Buffer.from === "function";
    function isArrayBuffer(input) {
      return toString.call(input).slice(8, -1) === "ArrayBuffer";
    }
    function fromArrayBuffer(obj, byteOffset, length) {
      byteOffset >>>= 0;
      var maxLength = obj.byteLength - byteOffset;
      if (maxLength < 0) {
        throw new RangeError("'offset' is out of bounds");
      }
      if (length === void 0) {
        length = maxLength;
      } else {
        length >>>= 0;
        if (length > maxLength) {
          throw new RangeError("'length' is out of bounds");
        }
      }
      return isModern ? Buffer.from(obj.slice(byteOffset, byteOffset + length)) : new Buffer(new Uint8Array(obj.slice(byteOffset, byteOffset + length)));
    }
    function fromString(string, encoding) {
      if (typeof encoding !== "string" || encoding === "") {
        encoding = "utf8";
      }
      if (!Buffer.isEncoding(encoding)) {
        throw new TypeError('"encoding" must be a valid string encoding');
      }
      return isModern ? Buffer.from(string, encoding) : new Buffer(string, encoding);
    }
    function bufferFrom(value, encodingOrOffset, length) {
      if (typeof value === "number") {
        throw new TypeError('"value" argument must not be a number');
      }
      if (isArrayBuffer(value)) {
        return fromArrayBuffer(value, encodingOrOffset, length);
      }
      if (typeof value === "string") {
        return fromString(value, encodingOrOffset);
      }
      return isModern ? Buffer.from(value) : new Buffer(value);
    }
    module2.exports = bufferFrom;
  }
});

// node_modules/source-map-support/source-map-support.js
var require_source_map_support = __commonJS({
  "node_modules/source-map-support/source-map-support.js"(exports2, module2) {
    var SourceMapConsumer = require_source_map().SourceMapConsumer;
    var path6 = require("path");
    var fs7;
    try {
      fs7 = require("fs");
      if (!fs7.existsSync || !fs7.readFileSync) {
        fs7 = null;
      }
    } catch (err) {
    }
    var bufferFrom = require_buffer_from();
    function dynamicRequire(mod, request) {
      return mod.require(request);
    }
    var errorFormatterInstalled = false;
    var uncaughtShimInstalled = false;
    var emptyCacheBetweenOperations = false;
    var environment = "auto";
    var fileContentsCache = {};
    var sourceMapCache = {};
    var reSourceMap = /^data:application\/json[^,]+base64,/;
    var retrieveFileHandlers = [];
    var retrieveMapHandlers = [];
    function isInBrowser() {
      if (environment === "browser")
        return true;
      if (environment === "node")
        return false;
      return typeof window !== "undefined" && typeof XMLHttpRequest === "function" && !(window.require && window.module && window.process && window.process.type === "renderer");
    }
    function hasGlobalProcessEventEmitter() {
      return typeof process === "object" && process !== null && typeof process.on === "function";
    }
    function globalProcessVersion() {
      if (typeof process === "object" && process !== null) {
        return process.version;
      } else {
        return "";
      }
    }
    function globalProcessStderr() {
      if (typeof process === "object" && process !== null) {
        return process.stderr;
      }
    }
    function globalProcessExit(code) {
      if (typeof process === "object" && process !== null && typeof process.exit === "function") {
        return process.exit(code);
      }
    }
    function handlerExec(list) {
      return function(arg) {
        for (var i = 0; i < list.length; i++) {
          var ret = list[i](arg);
          if (ret) {
            return ret;
          }
        }
        return null;
      };
    }
    var retrieveFile = handlerExec(retrieveFileHandlers);
    retrieveFileHandlers.push(function(path7) {
      path7 = path7.trim();
      if (/^file:/.test(path7)) {
        path7 = path7.replace(/file:\/\/\/(\w:)?/, function(protocol, drive) {
          return drive ? "" : (
            // file:///C:/dir/file -> C:/dir/file
            "/"
          );
        });
      }
      if (path7 in fileContentsCache) {
        return fileContentsCache[path7];
      }
      var contents = "";
      try {
        if (!fs7) {
          var xhr = new XMLHttpRequest();
          xhr.open(
            "GET",
            path7,
            /** async */
            false
          );
          xhr.send(null);
          if (xhr.readyState === 4 && xhr.status === 200) {
            contents = xhr.responseText;
          }
        } else if (fs7.existsSync(path7)) {
          contents = fs7.readFileSync(path7, "utf8");
        }
      } catch (er) {
      }
      return fileContentsCache[path7] = contents;
    });
    function supportRelativeURL(file2, url4) {
      if (!file2) return url4;
      var dir = path6.dirname(file2);
      var match = /^\w+:\/\/[^\/]*/.exec(dir);
      var protocol = match ? match[0] : "";
      var startPath = dir.slice(protocol.length);
      if (protocol && /^\/\w\:/.test(startPath)) {
        protocol += "/";
        return protocol + path6.resolve(dir.slice(protocol.length), url4).replace(/\\/g, "/");
      }
      return protocol + path6.resolve(dir.slice(protocol.length), url4);
    }
    function retrieveSourceMapURL(source) {
      var fileData;
      if (isInBrowser()) {
        try {
          var xhr = new XMLHttpRequest();
          xhr.open("GET", source, false);
          xhr.send(null);
          fileData = xhr.readyState === 4 ? xhr.responseText : null;
          var sourceMapHeader = xhr.getResponseHeader("SourceMap") || xhr.getResponseHeader("X-SourceMap");
          if (sourceMapHeader) {
            return sourceMapHeader;
          }
        } catch (e) {
        }
      }
      fileData = retrieveFile(source);
      var re2 = /(?:\/\/[@#][\s]*sourceMappingURL=([^\s'"]+)[\s]*$)|(?:\/\*[@#][\s]*sourceMappingURL=([^\s*'"]+)[\s]*(?:\*\/)[\s]*$)/mg;
      var lastMatch, match;
      while (match = re2.exec(fileData)) lastMatch = match;
      if (!lastMatch) return null;
      return lastMatch[1];
    }
    var retrieveSourceMap = handlerExec(retrieveMapHandlers);
    retrieveMapHandlers.push(function(source) {
      var sourceMappingURL = retrieveSourceMapURL(source);
      if (!sourceMappingURL) return null;
      var sourceMapData;
      if (reSourceMap.test(sourceMappingURL)) {
        var rawData = sourceMappingURL.slice(sourceMappingURL.indexOf(",") + 1);
        sourceMapData = bufferFrom(rawData, "base64").toString();
        sourceMappingURL = source;
      } else {
        sourceMappingURL = supportRelativeURL(source, sourceMappingURL);
        sourceMapData = retrieveFile(sourceMappingURL);
      }
      if (!sourceMapData) {
        return null;
      }
      return {
        url: sourceMappingURL,
        map: sourceMapData
      };
    });
    function mapSourcePosition(position) {
      var sourceMap = sourceMapCache[position.source];
      if (!sourceMap) {
        var urlAndMap = retrieveSourceMap(position.source);
        if (urlAndMap) {
          sourceMap = sourceMapCache[position.source] = {
            url: urlAndMap.url,
            map: new SourceMapConsumer(urlAndMap.map)
          };
          if (sourceMap.map.sourcesContent) {
            sourceMap.map.sources.forEach(function(source, i) {
              var contents = sourceMap.map.sourcesContent[i];
              if (contents) {
                var url4 = supportRelativeURL(sourceMap.url, source);
                fileContentsCache[url4] = contents;
              }
            });
          }
        } else {
          sourceMap = sourceMapCache[position.source] = {
            url: null,
            map: null
          };
        }
      }
      if (sourceMap && sourceMap.map && typeof sourceMap.map.originalPositionFor === "function") {
        var originalPosition = sourceMap.map.originalPositionFor(position);
        if (originalPosition.source !== null) {
          originalPosition.source = supportRelativeURL(
            sourceMap.url,
            originalPosition.source
          );
          return originalPosition;
        }
      }
      return position;
    }
    function mapEvalOrigin(origin) {
      var match = /^eval at ([^(]+) \((.+):(\d+):(\d+)\)$/.exec(origin);
      if (match) {
        var position = mapSourcePosition({
          source: match[2],
          line: +match[3],
          column: match[4] - 1
        });
        return "eval at " + match[1] + " (" + position.source + ":" + position.line + ":" + (position.column + 1) + ")";
      }
      match = /^eval at ([^(]+) \((.+)\)$/.exec(origin);
      if (match) {
        return "eval at " + match[1] + " (" + mapEvalOrigin(match[2]) + ")";
      }
      return origin;
    }
    function CallSiteToString() {
      var fileName2;
      var fileLocation = "";
      if (this.isNative()) {
        fileLocation = "native";
      } else {
        fileName2 = this.getScriptNameOrSourceURL();
        if (!fileName2 && this.isEval()) {
          fileLocation = this.getEvalOrigin();
          fileLocation += ", ";
        }
        if (fileName2) {
          fileLocation += fileName2;
        } else {
          fileLocation += "<anonymous>";
        }
        var lineNumber = this.getLineNumber();
        if (lineNumber != null) {
          fileLocation += ":" + lineNumber;
          var columnNumber = this.getColumnNumber();
          if (columnNumber) {
            fileLocation += ":" + columnNumber;
          }
        }
      }
      var line = "";
      var functionName = this.getFunctionName();
      var addSuffix = true;
      var isConstructor = this.isConstructor();
      var isMethodCall = !(this.isToplevel() || isConstructor);
      if (isMethodCall) {
        var typeName = this.getTypeName();
        if (typeName === "[object Object]") {
          typeName = "null";
        }
        var methodName = this.getMethodName();
        if (functionName) {
          if (typeName && functionName.indexOf(typeName) != 0) {
            line += typeName + ".";
          }
          line += functionName;
          if (methodName && functionName.indexOf("." + methodName) != functionName.length - methodName.length - 1) {
            line += " [as " + methodName + "]";
          }
        } else {
          line += typeName + "." + (methodName || "<anonymous>");
        }
      } else if (isConstructor) {
        line += "new " + (functionName || "<anonymous>");
      } else if (functionName) {
        line += functionName;
      } else {
        line += fileLocation;
        addSuffix = false;
      }
      if (addSuffix) {
        line += " (" + fileLocation + ")";
      }
      return line;
    }
    function cloneCallSite(frame) {
      var object = {};
      Object.getOwnPropertyNames(Object.getPrototypeOf(frame)).forEach(function(name) {
        object[name] = /^(?:is|get)/.test(name) ? function() {
          return frame[name].call(frame);
        } : frame[name];
      });
      object.toString = CallSiteToString;
      return object;
    }
    function wrapCallSite(frame, state) {
      if (state === void 0) {
        state = { nextPosition: null, curPosition: null };
      }
      if (frame.isNative()) {
        state.curPosition = null;
        return frame;
      }
      var source = frame.getFileName() || frame.getScriptNameOrSourceURL();
      if (source) {
        var line = frame.getLineNumber();
        var column = frame.getColumnNumber() - 1;
        var noHeader = /^v(10\.1[6-9]|10\.[2-9][0-9]|10\.[0-9]{3,}|1[2-9]\d*|[2-9]\d|\d{3,}|11\.11)/;
        var headerLength = noHeader.test(globalProcessVersion()) ? 0 : 62;
        if (line === 1 && column > headerLength && !isInBrowser() && !frame.isEval()) {
          column -= headerLength;
        }
        var position = mapSourcePosition({
          source,
          line,
          column
        });
        state.curPosition = position;
        frame = cloneCallSite(frame);
        var originalFunctionName = frame.getFunctionName;
        frame.getFunctionName = function() {
          if (state.nextPosition == null) {
            return originalFunctionName();
          }
          return state.nextPosition.name || originalFunctionName();
        };
        frame.getFileName = function() {
          return position.source;
        };
        frame.getLineNumber = function() {
          return position.line;
        };
        frame.getColumnNumber = function() {
          return position.column + 1;
        };
        frame.getScriptNameOrSourceURL = function() {
          return position.source;
        };
        return frame;
      }
      var origin = frame.isEval() && frame.getEvalOrigin();
      if (origin) {
        origin = mapEvalOrigin(origin);
        frame = cloneCallSite(frame);
        frame.getEvalOrigin = function() {
          return origin;
        };
        return frame;
      }
      return frame;
    }
    function prepareStackTrace(error, stack) {
      if (emptyCacheBetweenOperations) {
        fileContentsCache = {};
        sourceMapCache = {};
      }
      var name = error.name || "Error";
      var message = error.message || "";
      var errorString = name + ": " + message;
      var state = { nextPosition: null, curPosition: null };
      var processedStack = [];
      for (var i = stack.length - 1; i >= 0; i--) {
        processedStack.push("\n    at " + wrapCallSite(stack[i], state));
        state.nextPosition = state.curPosition;
      }
      state.curPosition = state.nextPosition = null;
      return errorString + processedStack.reverse().join("");
    }
    function getErrorSource(error) {
      var match = /\n    at [^(]+ \((.*):(\d+):(\d+)\)/.exec(error.stack);
      if (match) {
        var source = match[1];
        var line = +match[2];
        var column = +match[3];
        var contents = fileContentsCache[source];
        if (!contents && fs7 && fs7.existsSync(source)) {
          try {
            contents = fs7.readFileSync(source, "utf8");
          } catch (er) {
            contents = "";
          }
        }
        if (contents) {
          var code = contents.split(/(?:\r\n|\r|\n)/)[line - 1];
          if (code) {
            return source + ":" + line + "\n" + code + "\n" + new Array(column).join(" ") + "^";
          }
        }
      }
      return null;
    }
    function printErrorAndExit(error) {
      var source = getErrorSource(error);
      var stderr = globalProcessStderr();
      if (stderr && stderr._handle && stderr._handle.setBlocking) {
        stderr._handle.setBlocking(true);
      }
      if (source) {
        console.error();
        console.error(source);
      }
      console.error(error.stack);
      globalProcessExit(1);
    }
    function shimEmitUncaughtException() {
      var origEmit = process.emit;
      process.emit = function(type) {
        if (type === "uncaughtException") {
          var hasStack = arguments[1] && arguments[1].stack;
          var hasListeners = this.listeners(type).length > 0;
          if (hasStack && !hasListeners) {
            return printErrorAndExit(arguments[1]);
          }
        }
        return origEmit.apply(this, arguments);
      };
    }
    var originalRetrieveFileHandlers = retrieveFileHandlers.slice(0);
    var originalRetrieveMapHandlers = retrieveMapHandlers.slice(0);
    exports2.wrapCallSite = wrapCallSite;
    exports2.getErrorSource = getErrorSource;
    exports2.mapSourcePosition = mapSourcePosition;
    exports2.retrieveSourceMap = retrieveSourceMap;
    exports2.install = function(options) {
      options = options || {};
      if (options.environment) {
        environment = options.environment;
        if (["node", "browser", "auto"].indexOf(environment) === -1) {
          throw new Error("environment " + environment + " was unknown. Available options are {auto, browser, node}");
        }
      }
      if (options.retrieveFile) {
        if (options.overrideRetrieveFile) {
          retrieveFileHandlers.length = 0;
        }
        retrieveFileHandlers.unshift(options.retrieveFile);
      }
      if (options.retrieveSourceMap) {
        if (options.overrideRetrieveSourceMap) {
          retrieveMapHandlers.length = 0;
        }
        retrieveMapHandlers.unshift(options.retrieveSourceMap);
      }
      if (options.hookRequire && !isInBrowser()) {
        var Module3 = dynamicRequire(module2, "module");
        var $compile = Module3.prototype._compile;
        if (!$compile.__sourceMapSupport) {
          Module3.prototype._compile = function(content, filename) {
            fileContentsCache[filename] = content;
            sourceMapCache[filename] = void 0;
            return $compile.call(this, content, filename);
          };
          Module3.prototype._compile.__sourceMapSupport = true;
        }
      }
      if (!emptyCacheBetweenOperations) {
        emptyCacheBetweenOperations = "emptyCacheBetweenOperations" in options ? options.emptyCacheBetweenOperations : false;
      }
      if (!errorFormatterInstalled) {
        errorFormatterInstalled = true;
        Error.prepareStackTrace = prepareStackTrace;
      }
      if (!uncaughtShimInstalled) {
        var installHandler = "handleUncaughtExceptions" in options ? options.handleUncaughtExceptions : true;
        try {
          var worker_threads = dynamicRequire(module2, "worker_threads");
          if (worker_threads.isMainThread === false) {
            installHandler = false;
          }
        } catch (e) {
        }
        if (installHandler && hasGlobalProcessEventEmitter()) {
          uncaughtShimInstalled = true;
          shimEmitUncaughtException();
        }
      }
    };
    exports2.resetRetrieveHandlers = function() {
      retrieveFileHandlers.length = 0;
      retrieveMapHandlers.length = 0;
      retrieveFileHandlers = originalRetrieveFileHandlers.slice(0);
      retrieveMapHandlers = originalRetrieveMapHandlers.slice(0);
      retrieveSourceMap = handlerExec(retrieveMapHandlers);
      retrieveFile = handlerExec(retrieveFileHandlers);
    };
  }
});

// node_modules/json5/lib/unicode.js
var require_unicode = __commonJS({
  "node_modules/json5/lib/unicode.js"(exports2, module2) {
    module2.exports.Space_Separator = /[\u1680\u2000-\u200A\u202F\u205F\u3000]/;
    module2.exports.ID_Start = /[\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\u0561-\u0587\u05D0-\u05EA\u05F0-\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-\u08BD\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\u0D05-\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\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\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-\u1877\u1880-\u1884\u1887-\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\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\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\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\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\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\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-\uAB65\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]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/;
    module2.exports.ID_Continue = /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\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\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\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\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/;
  }
});

// node_modules/json5/lib/util.js
var require_util2 = __commonJS({
  "node_modules/json5/lib/util.js"(exports2, module2) {
    var unicode = require_unicode();
    module2.exports = {
      isSpaceSeparator(c) {
        return typeof c === "string" && unicode.Space_Separator.test(c);
      },
      isIdStartChar(c) {
        return typeof c === "string" && (c >= "a" && c <= "z" || c >= "A" && c <= "Z" || c === "$" || c === "_" || unicode.ID_Start.test(c));
      },
      isIdContinueChar(c) {
        return typeof c === "string" && (c >= "a" && c <= "z" || c >= "A" && c <= "Z" || c >= "0" && c <= "9" || c === "$" || c === "_" || c === "\u200C" || c === "\u200D" || unicode.ID_Continue.test(c));
      },
      isDigit(c) {
        return typeof c === "string" && /[0-9]/.test(c);
      },
      isHexDigit(c) {
        return typeof c === "string" && /[0-9A-Fa-f]/.test(c);
      }
    };
  }
});

// node_modules/json5/lib/parse.js
var require_parse = __commonJS({
  "node_modules/json5/lib/parse.js"(exports2, module2) {
    var util = require_util2();
    var source;
    var parseState;
    var stack;
    var pos;
    var line;
    var column;
    var token;
    var key;
    var root;
    module2.exports = function parse(text, reviver) {
      source = String(text);
      parseState = "start";
      stack = [];
      pos = 0;
      line = 1;
      column = 0;
      token = void 0;
      key = void 0;
      root = void 0;
      do {
        token = lex();
        parseStates[parseState]();
      } while (token.type !== "eof");
      if (typeof reviver === "function") {
        return internalize({ "": root }, "", reviver);
      }
      return root;
    };
    function internalize(holder, name, reviver) {
      const value = holder[name];
      if (value != null && typeof value === "object") {
        if (Array.isArray(value)) {
          for (let i = 0; i < value.length; i++) {
            const key2 = String(i);
            const replacement = internalize(value, key2, reviver);
            if (replacement === void 0) {
              delete value[key2];
            } else {
              Object.defineProperty(value, key2, {
                value: replacement,
                writable: true,
                enumerable: true,
                configurable: true
              });
            }
          }
        } else {
          for (const key2 in value) {
            const replacement = internalize(value, key2, reviver);
            if (replacement === void 0) {
              delete value[key2];
            } else {
              Object.defineProperty(value, key2, {
                value: replacement,
                writable: true,
                enumerable: true,
                configurable: true
              });
            }
          }
        }
      }
      return reviver.call(holder, name, value);
    }
    var lexState;
    var buffer;
    var doubleQuote;
    var sign;
    var c;
    function lex() {
      lexState = "default";
      buffer = "";
      doubleQuote = false;
      sign = 1;
      for (; ; ) {
        c = peek();
        const token2 = lexStates[lexState]();
        if (token2) {
          return token2;
        }
      }
    }
    function peek() {
      if (source[pos]) {
        return String.fromCodePoint(source.codePointAt(pos));
      }
    }
    function read() {
      const c2 = peek();
      if (c2 === "\n") {
        line++;
        column = 0;
      } else if (c2) {
        column += c2.length;
      } else {
        column++;
      }
      if (c2) {
        pos += c2.length;
      }
      return c2;
    }
    var lexStates = {
      default() {
        switch (c) {
          case "	":
          case "\v":
          case "\f":
          case " ":
          case "\xA0":
          case "\uFEFF":
          case "\n":
          case "\r":
          case "\u2028":
          case "\u2029":
            read();
            return;
          case "/":
            read();
            lexState = "comment";
            return;
          case void 0:
            read();
            return newToken("eof");
        }
        if (util.isSpaceSeparator(c)) {
          read();
          return;
        }
        return lexStates[parseState]();
      },
      comment() {
        switch (c) {
          case "*":
            read();
            lexState = "multiLineComment";
            return;
          case "/":
            read();
            lexState = "singleLineComment";
            return;
        }
        throw invalidChar(read());
      },
      multiLineComment() {
        switch (c) {
          case "*":
            read();
            lexState = "multiLineCommentAsterisk";
            return;
          case void 0:
            throw invalidChar(read());
        }
        read();
      },
      multiLineCommentAsterisk() {
        switch (c) {
          case "*":
            read();
            return;
          case "/":
            read();
            lexState = "default";
            return;
          case void 0:
            throw invalidChar(read());
        }
        read();
        lexState = "multiLineComment";
      },
      singleLineComment() {
        switch (c) {
          case "\n":
          case "\r":
          case "\u2028":
          case "\u2029":
            read();
            lexState = "default";
            return;
          case void 0:
            read();
            return newToken("eof");
        }
        read();
      },
      value() {
        switch (c) {
          case "{":
          case "[":
            return newToken("punctuator", read());
          case "n":
            read();
            literal("ull");
            return newToken("null", null);
          case "t":
            read();
            literal("rue");
            return newToken("boolean", true);
          case "f":
            read();
            literal("alse");
            return newToken("boolean", false);
          case "-":
          case "+":
            if (read() === "-") {
              sign = -1;
            }
            lexState = "sign";
            return;
          case ".":
            buffer = read();
            lexState = "decimalPointLeading";
            return;
          case "0":
            buffer = read();
            lexState = "zero";
            return;
          case "1":
          case "2":
          case "3":
          case "4":
          case "5":
          case "6":
          case "7":
          case "8":
          case "9":
            buffer = read();
            lexState = "decimalInteger";
            return;
          case "I":
            read();
            literal("nfinity");
            return newToken("numeric", Infinity);
          case "N":
            read();
            literal("aN");
            return newToken("numeric", NaN);
          case '"':
          case "'":
            doubleQuote = read() === '"';
            buffer = "";
            lexState = "string";
            return;
        }
        throw invalidChar(read());
      },
      identifierNameStartEscape() {
        if (c !== "u") {
          throw invalidChar(read());
        }
        read();
        const u = unicodeEscape();
        switch (u) {
          case "$":
          case "_":
            break;
          default:
            if (!util.isIdStartChar(u)) {
              throw invalidIdentifier();
            }
            break;
        }
        buffer += u;
        lexState = "identifierName";
      },
      identifierName() {
        switch (c) {
          case "$":
          case "_":
          case "\u200C":
          case "\u200D":
            buffer += read();
            return;
          case "\\":
            read();
            lexState = "identifierNameEscape";
            return;
        }
        if (util.isIdContinueChar(c)) {
          buffer += read();
          return;
        }
        return newToken("identifier", buffer);
      },
      identifierNameEscape() {
        if (c !== "u") {
          throw invalidChar(read());
        }
        read();
        const u = unicodeEscape();
        switch (u) {
          case "$":
          case "_":
          case "\u200C":
          case "\u200D":
            break;
          default:
            if (!util.isIdContinueChar(u)) {
              throw invalidIdentifier();
            }
            break;
        }
        buffer += u;
        lexState = "identifierName";
      },
      sign() {
        switch (c) {
          case ".":
            buffer = read();
            lexState = "decimalPointLeading";
            return;
          case "0":
            buffer = read();
            lexState = "zero";
            return;
          case "1":
          case "2":
          case "3":
          case "4":
          case "5":
          case "6":
          case "7":
          case "8":
          case "9":
            buffer = read();
            lexState = "decimalInteger";
            return;
          case "I":
            read();
            literal("nfinity");
            return newToken("numeric", sign * Infinity);
          case "N":
            read();
            literal("aN");
            return newToken("numeric", NaN);
        }
        throw invalidChar(read());
      },
      zero() {
        switch (c) {
          case ".":
            buffer += read();
            lexState = "decimalPoint";
            return;
          case "e":
          case "E":
            buffer += read();
            lexState = "decimalExponent";
            return;
          case "x":
          case "X":
            buffer += read();
            lexState = "hexadecimal";
            return;
        }
        return newToken("numeric", sign * 0);
      },
      decimalInteger() {
        switch (c) {
          case ".":
            buffer += read();
            lexState = "decimalPoint";
            return;
          case "e":
          case "E":
            buffer += read();
            lexState = "decimalExponent";
            return;
        }
        if (util.isDigit(c)) {
          buffer += read();
          return;
        }
        return newToken("numeric", sign * Number(buffer));
      },
      decimalPointLeading() {
        if (util.isDigit(c)) {
          buffer += read();
          lexState = "decimalFraction";
          return;
        }
        throw invalidChar(read());
      },
      decimalPoint() {
        switch (c) {
          case "e":
          case "E":
            buffer += read();
            lexState = "decimalExponent";
            return;
        }
        if (util.isDigit(c)) {
          buffer += read();
          lexState = "decimalFraction";
          return;
        }
        return newToken("numeric", sign * Number(buffer));
      },
      decimalFraction() {
        switch (c) {
          case "e":
          case "E":
            buffer += read();
            lexState = "decimalExponent";
            return;
        }
        if (util.isDigit(c)) {
          buffer += read();
          return;
        }
        return newToken("numeric", sign * Number(buffer));
      },
      decimalExponent() {
        switch (c) {
          case "+":
          case "-":
            buffer += read();
            lexState = "decimalExponentSign";
            return;
        }
        if (util.isDigit(c)) {
          buffer += read();
          lexState = "decimalExponentInteger";
          return;
        }
        throw invalidChar(read());
      },
      decimalExponentSign() {
        if (util.isDigit(c)) {
          buffer += read();
          lexState = "decimalExponentInteger";
          return;
        }
        throw invalidChar(read());
      },
      decimalExponentInteger() {
        if (util.isDigit(c)) {
          buffer += read();
          return;
        }
        return newToken("numeric", sign * Number(buffer));
      },
      hexadecimal() {
        if (util.isHexDigit(c)) {
          buffer += read();
          lexState = "hexadecimalInteger";
          return;
        }
        throw invalidChar(read());
      },
      hexadecimalInteger() {
        if (util.isHexDigit(c)) {
          buffer += read();
          return;
        }
        return newToken("numeric", sign * Number(buffer));
      },
      string() {
        switch (c) {
          case "\\":
            read();
            buffer += escape();
            return;
          case '"':
            if (doubleQuote) {
              read();
              return newToken("string", buffer);
            }
            buffer += read();
            return;
          case "'":
            if (!doubleQuote) {
              read();
              return newToken("string", buffer);
            }
            buffer += read();
            return;
          case "\n":
          case "\r":
            throw invalidChar(read());
          case "\u2028":
          case "\u2029":
            separatorChar(c);
            break;
          case void 0:
            throw invalidChar(read());
        }
        buffer += read();
      },
      start() {
        switch (c) {
          case "{":
          case "[":
            return newToken("punctuator", read());
        }
        lexState = "value";
      },
      beforePropertyName() {
        switch (c) {
          case "$":
          case "_":
            buffer = read();
            lexState = "identifierName";
            return;
          case "\\":
            read();
            lexState = "identifierNameStartEscape";
            return;
          case "}":
            return newToken("punctuator", read());
          case '"':
          case "'":
            doubleQuote = read() === '"';
            lexState = "string";
            return;
        }
        if (util.isIdStartChar(c)) {
          buffer += read();
          lexState = "identifierName";
          return;
        }
        throw invalidChar(read());
      },
      afterPropertyName() {
        if (c === ":") {
          return newToken("punctuator", read());
        }
        throw invalidChar(read());
      },
      beforePropertyValue() {
        lexState = "value";
      },
      afterPropertyValue() {
        switch (c) {
          case ",":
          case "}":
            return newToken("punctuator", read());
        }
        throw invalidChar(read());
      },
      beforeArrayValue() {
        if (c === "]") {
          return newToken("punctuator", read());
        }
        lexState = "value";
      },
      afterArrayValue() {
        switch (c) {
          case ",":
          case "]":
            return newToken("punctuator", read());
        }
        throw invalidChar(read());
      },
      end() {
        throw invalidChar(read());
      }
    };
    function newToken(type, value) {
      return {
        type,
        value,
        line,
        column
      };
    }
    function literal(s) {
      for (const c2 of s) {
        const p = peek();
        if (p !== c2) {
          throw invalidChar(read());
        }
        read();
      }
    }
    function escape() {
      const c2 = peek();
      switch (c2) {
        case "b":
          read();
          return "\b";
        case "f":
          read();
          return "\f";
        case "n":
          read();
          return "\n";
        case "r":
          read();
          return "\r";
        case "t":
          read();
          return "	";
        case "v":
          read();
          return "\v";
        case "0":
          read();
          if (util.isDigit(peek())) {
            throw invalidChar(read());
          }
          return "\0";
        case "x":
          read();
          return hexEscape();
        case "u":
          read();
          return unicodeEscape();
        case "\n":
        case "\u2028":
        case "\u2029":
          read();
          return "";
        case "\r":
          read();
          if (peek() === "\n") {
            read();
          }
          return "";
        case "1":
        case "2":
        case "3":
        case "4":
        case "5":
        case "6":
        case "7":
        case "8":
        case "9":
          throw invalidChar(read());
        case void 0:
          throw invalidChar(read());
      }
      return read();
    }
    function hexEscape() {
      let buffer2 = "";
      let c2 = peek();
      if (!util.isHexDigit(c2)) {
        throw invalidChar(read());
      }
      buffer2 += read();
      c2 = peek();
      if (!util.isHexDigit(c2)) {
        throw invalidChar(read());
      }
      buffer2 += read();
      return String.fromCodePoint(parseInt(buffer2, 16));
    }
    function unicodeEscape() {
      let buffer2 = "";
      let count = 4;
      while (count-- > 0) {
        const c2 = peek();
        if (!util.isHexDigit(c2)) {
          throw invalidChar(read());
        }
        buffer2 += read();
      }
      return String.fromCodePoint(parseInt(buffer2, 16));
    }
    var parseStates = {
      start() {
        if (token.type === "eof") {
          throw invalidEOF();
        }
        push();
      },
      beforePropertyName() {
        switch (token.type) {
          case "identifier":
          case "string":
            key = token.value;
            parseState = "afterPropertyName";
            return;
          case "punctuator":
            pop();
            return;
          case "eof":
            throw invalidEOF();
        }
      },
      afterPropertyName() {
        if (token.type === "eof") {
          throw invalidEOF();
        }
        parseState = "beforePropertyValue";
      },
      beforePropertyValue() {
        if (token.type === "eof") {
          throw invalidEOF();
        }
        push();
      },
      beforeArrayValue() {
        if (token.type === "eof") {
          throw invalidEOF();
        }
        if (token.type === "punctuator" && token.value === "]") {
          pop();
          return;
        }
        push();
      },
      afterPropertyValue() {
        if (token.type === "eof") {
          throw invalidEOF();
        }
        switch (token.value) {
          case ",":
            parseState = "beforePropertyName";
            return;
          case "}":
            pop();
        }
      },
      afterArrayValue() {
        if (token.type === "eof") {
          throw invalidEOF();
        }
        switch (token.value) {
          case ",":
            parseState = "beforeArrayValue";
            return;
          case "]":
            pop();
        }
      },
      end() {
      }
    };
    function push() {
      let value;
      switch (token.type) {
        case "punctuator":
          switch (token.value) {
            case "{":
              value = {};
              break;
            case "[":
              value = [];
              break;
          }
          break;
        case "null":
        case "boolean":
        case "numeric":
        case "string":
          value = token.value;
          break;
      }
      if (root === void 0) {
        root = value;
      } else {
        const parent = stack[stack.length - 1];
        if (Array.isArray(parent)) {
          parent.push(value);
        } else {
          Object.defineProperty(parent, key, {
            value,
            writable: true,
            enumerable: true,
            configurable: true
          });
        }
      }
      if (value !== null && typeof value === "object") {
        stack.push(value);
        if (Array.isArray(value)) {
          parseState = "beforeArrayValue";
        } else {
          parseState = "beforePropertyName";
        }
      } else {
        const current = stack[stack.length - 1];
        if (current == null) {
          parseState = "end";
        } else if (Array.isArray(current)) {
          parseState = "afterArrayValue";
        } else {
          parseState = "afterPropertyValue";
        }
      }
    }
    function pop() {
      stack.pop();
      const current = stack[stack.length - 1];
      if (current == null) {
        parseState = "end";
      } else if (Array.isArray(current)) {
        parseState = "afterArrayValue";
      } else {
        parseState = "afterPropertyValue";
      }
    }
    function invalidChar(c2) {
      if (c2 === void 0) {
        return syntaxError(`JSON5: invalid end of input at ${line}:${column}`);
      }
      return syntaxError(`JSON5: invalid character '${formatChar(c2)}' at ${line}:${column}`);
    }
    function invalidEOF() {
      return syntaxError(`JSON5: invalid end of input at ${line}:${column}`);
    }
    function invalidIdentifier() {
      column -= 5;
      return syntaxError(`JSON5: invalid identifier character at ${line}:${column}`);
    }
    function separatorChar(c2) {
      console.warn(`JSON5: '${formatChar(c2)}' in strings is not valid ECMAScript; consider escaping`);
    }
    function formatChar(c2) {
      const replacements = {
        "'": "\\'",
        '"': '\\"',
        "\\": "\\\\",
        "\b": "\\b",
        "\f": "\\f",
        "\n": "\\n",
        "\r": "\\r",
        "	": "\\t",
        "\v": "\\v",
        "\0": "\\0",
        "\u2028": "\\u2028",
        "\u2029": "\\u2029"
      };
      if (replacements[c2]) {
        return replacements[c2];
      }
      if (c2 < " ") {
        const hexString = c2.charCodeAt(0).toString(16);
        return "\\x" + ("00" + hexString).substring(hexString.length);
      }
      return c2;
    }
    function syntaxError(message) {
      const err = new SyntaxError(message);
      err.lineNumber = line;
      err.columnNumber = column;
      return err;
    }
  }
});

// node_modules/json5/lib/stringify.js
var require_stringify = __commonJS({
  "node_modules/json5/lib/stringify.js"(exports2, module2) {
    var util = require_util2();
    module2.exports = function stringify(value, replacer, space) {
      const stack = [];
      let indent = "";
      let propertyList;
      let replacerFunc;
      let gap = "";
      let quote;
      if (replacer != null && typeof replacer === "object" && !Array.isArray(replacer)) {
        space = replacer.space;
        quote = replacer.quote;
        replacer = replacer.replacer;
      }
      if (typeof replacer === "function") {
        replacerFunc = replacer;
      } else if (Array.isArray(replacer)) {
        propertyList = [];
        for (const v of replacer) {
          let item;
          if (typeof v === "string") {
            item = v;
          } else if (typeof v === "number" || v instanceof String || v instanceof Number) {
            item = String(v);
          }
          if (item !== void 0 && propertyList.indexOf(item) < 0) {
            propertyList.push(item);
          }
        }
      }
      if (space instanceof Number) {
        space = Number(space);
      } else if (space instanceof String) {
        space = String(space);
      }
      if (typeof space === "number") {
        if (space > 0) {
          space = Math.min(10, Math.floor(space));
          gap = "          ".substr(0, space);
        }
      } else if (typeof space === "string") {
        gap = space.substr(0, 10);
      }
      return serializeProperty("", { "": value });
      function serializeProperty(key, holder) {
        let value2 = holder[key];
        if (value2 != null) {
          if (typeof value2.toJSON5 === "function") {
            value2 = value2.toJSON5(key);
          } else if (typeof value2.toJSON === "function") {
            value2 = value2.toJSON(key);
          }
        }
        if (replacerFunc) {
          value2 = replacerFunc.call(holder, key, value2);
        }
        if (value2 instanceof Number) {
          value2 = Number(value2);
        } else if (value2 instanceof String) {
          value2 = String(value2);
        } else if (value2 instanceof Boolean) {
          value2 = value2.valueOf();
        }
        switch (value2) {
          case null:
            return "null";
          case true:
            return "true";
          case false:
            return "false";
        }
        if (typeof value2 === "string") {
          return quoteString(value2, false);
        }
        if (typeof value2 === "number") {
          return String(value2);
        }
        if (typeof value2 === "object") {
          return Array.isArray(value2) ? serializeArray(value2) : serializeObject(value2);
        }
        return void 0;
      }
      function quoteString(value2) {
        const quotes = {
          "'": 0.1,
          '"': 0.2
        };
        const replacements = {
          "'": "\\'",
          '"': '\\"',
          "\\": "\\\\",
          "\b": "\\b",
          "\f": "\\f",
          "\n": "\\n",
          "\r": "\\r",
          "	": "\\t",
          "\v": "\\v",
          "\0": "\\0",
          "\u2028": "\\u2028",
          "\u2029": "\\u2029"
        };
        let product = "";
        for (let i = 0; i < value2.length; i++) {
          const c = value2[i];
          switch (c) {
            case "'":
            case '"':
              quotes[c]++;
              product += c;
              continue;
            case "\0":
              if (util.isDigit(value2[i + 1])) {
                product += "\\x00";
                continue;
              }
          }
          if (replacements[c]) {
            product += replacements[c];
            continue;
          }
          if (c < " ") {
            let hexString = c.charCodeAt(0).toString(16);
            product += "\\x" + ("00" + hexString).substring(hexString.length);
            continue;
          }
          product += c;
        }
        const quoteChar = quote || Object.keys(quotes).reduce((a, b) => quotes[a] < quotes[b] ? a : b);
        product = product.replace(new RegExp(quoteChar, "g"), replacements[quoteChar]);
        return quoteChar + product + quoteChar;
      }
      function serializeObject(value2) {
        if (stack.indexOf(value2) >= 0) {
          throw TypeError("Converting circular structure to JSON5");
        }
        stack.push(value2);
        let stepback = indent;
        indent = indent + gap;
        let keys = propertyList || Object.keys(value2);
        let partial = [];
        for (const key of keys) {
          const propertyString = serializeProperty(key, value2);
          if (propertyString !== void 0) {
            let member = serializeKey(key) + ":";
            if (gap !== "") {
              member += " ";
            }
            member += propertyString;
            partial.push(member);
          }
        }
        let final;
        if (partial.length === 0) {
          final = "{}";
        } else {
          let properties;
          if (gap === "") {
            properties = partial.join(",");
            final = "{" + properties + "}";
          } else {
            let separator = ",\n" + indent;
            properties = partial.join(separator);
            final = "{\n" + indent + properties + ",\n" + stepback + "}";
          }
        }
        stack.pop();
        indent = stepback;
        return final;
      }
      function serializeKey(key) {
        if (key.length === 0) {
          return quoteString(key, true);
        }
        const firstChar = String.fromCodePoint(key.codePointAt(0));
        if (!util.isIdStartChar(firstChar)) {
          return quoteString(key, true);
        }
        for (let i = firstChar.length; i < key.length; i++) {
          if (!util.isIdContinueChar(String.fromCodePoint(key.codePointAt(i)))) {
            return quoteString(key, true);
          }
        }
        return key;
      }
      function serializeArray(value2) {
        if (stack.indexOf(value2) >= 0) {
          throw TypeError("Converting circular structure to JSON5");
        }
        stack.push(value2);
        let stepback = indent;
        indent = indent + gap;
        let partial = [];
        for (let i = 0; i < value2.length; i++) {
          const propertyString = serializeProperty(String(i), value2);
          partial.push(propertyString !== void 0 ? propertyString : "null");
        }
        let final;
        if (partial.length === 0) {
          final = "[]";
        } else {
          if (gap === "") {
            let properties = partial.join(",");
            final = "[" + properties + "]";
          } else {
            let separator = ",\n" + indent;
            let properties = partial.join(separator);
            final = "[\n" + indent + properties + ",\n" + stepback + "]";
          }
        }
        stack.pop();
        indent = stepback;
        return final;
      }
    };
  }
});

// node_modules/json5/lib/index.js
var require_lib = __commonJS({
  "node_modules/json5/lib/index.js"(exports2, module2) {
    var parse = require_parse();
    var stringify = require_stringify();
    var JSON5 = {
      parse,
      stringify
    };
    module2.exports = JSON5;
  }
});

// node_modules/ms/index.js
var require_ms = __commonJS({
  "node_modules/ms/index.js"(exports2, module2) {
    var s = 1e3;
    var m = s * 60;
    var h = m * 60;
    var d = h * 24;
    var w = d * 7;
    var y = d * 365.25;
    module2.exports = function(val, options) {
      options = options || {};
      var type = typeof val;
      if (type === "string" && val.length > 0) {
        return parse(val);
      } else if (type === "number" && isFinite(val)) {
        return options.long ? fmtLong(val) : fmtShort(val);
      }
      throw new Error(
        "val is not a non-empty string or a valid number. val=" + JSON.stringify(val)
      );
    };
    function parse(str) {
      str = String(str);
      if (str.length > 100) {
        return;
      }
      var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
        str
      );
      if (!match) {
        return;
      }
      var n = parseFloat(match[1]);
      var type = (match[2] || "ms").toLowerCase();
      switch (type) {
        case "years":
        case "year":
        case "yrs":
        case "yr":
        case "y":
          return n * y;
        case "weeks":
        case "week":
        case "w":
          return n * w;
        case "days":
        case "day":
        case "d":
          return n * d;
        case "hours":
        case "hour":
        case "hrs":
        case "hr":
        case "h":
          return n * h;
        case "minutes":
        case "minute":
        case "mins":
        case "min":
        case "m":
          return n * m;
        case "seconds":
        case "second":
        case "secs":
        case "sec":
        case "s":
          return n * s;
        case "milliseconds":
        case "millisecond":
        case "msecs":
        case "msec":
        case "ms":
          return n;
        default:
          return void 0;
      }
    }
    function fmtShort(ms) {
      var msAbs = Math.abs(ms);
      if (msAbs >= d) {
        return Math.round(ms / d) + "d";
      }
      if (msAbs >= h) {
        return Math.round(ms / h) + "h";
      }
      if (msAbs >= m) {
        return Math.round(ms / m) + "m";
      }
      if (msAbs >= s) {
        return Math.round(ms / s) + "s";
      }
      return ms + "ms";
    }
    function fmtLong(ms) {
      var msAbs = Math.abs(ms);
      if (msAbs >= d) {
        return plural(ms, msAbs, d, "day");
      }
      if (msAbs >= h) {
        return plural(ms, msAbs, h, "hour");
      }
      if (msAbs >= m) {
        return plural(ms, msAbs, m, "minute");
      }
      if (msAbs >= s) {
        return plural(ms, msAbs, s, "second");
      }
      return ms + " ms";
    }
    function plural(ms, msAbs, n, name) {
      var isPlural = msAbs >= n * 1.5;
      return Math.round(ms / n) + " " + name + (isPlural ? "s" : "");
    }
  }
});

// node_modules/debug/src/common.js
var require_common = __commonJS({
  "node_modules/debug/src/common.js"(exports2, module2) {
    function setup(env) {
      createDebug.debug = createDebug;
      createDebug.default = createDebug;
      createDebug.coerce = coerce;
      createDebug.disable = disable;
      createDebug.enable = enable;
      createDebug.enabled = enabled;
      createDebug.humanize = require_ms();
      createDebug.destroy = destroy;
      Object.keys(env).forEach((key) => {
        createDebug[key] = env[key];
      });
      createDebug.names = [];
      createDebug.skips = [];
      createDebug.formatters = {};
      function selectColor(namespace) {
        let hash = 0;
        for (let i = 0; i < namespace.length; i++) {
          hash = (hash << 5) - hash + namespace.charCodeAt(i);
          hash |= 0;
        }
        return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
      }
      createDebug.selectColor = selectColor;
      function createDebug(namespace) {
        let prevTime;
        let enableOverride = null;
        let namespacesCache;
        let enabledCache;
        function debug2(...args) {
          if (!debug2.enabled) {
            return;
          }
          const self = debug2;
          const curr = Number(/* @__PURE__ */ new Date());
          const ms = curr - (prevTime || curr);
          self.diff = ms;
          self.prev = prevTime;
          self.curr = curr;
          prevTime = curr;
          args[0] = createDebug.coerce(args[0]);
          if (typeof args[0] !== "string") {
            args.unshift("%O");
          }
          let index = 0;
          args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {
            if (match === "%%") {
              return "%";
            }
            index++;
            const formatter = createDebug.formatters[format];
            if (typeof formatter === "function") {
              const val = args[index];
              match = formatter.call(self, val);
              args.splice(index, 1);
              index--;
            }
            return match;
          });
          createDebug.formatArgs.call(self, args);
          const logFn = self.log || createDebug.log;
          logFn.apply(self, args);
        }
        debug2.namespace = namespace;
        debug2.useColors = createDebug.useColors();
        debug2.color = createDebug.selectColor(namespace);
        debug2.extend = extend;
        debug2.destroy = createDebug.destroy;
        Object.defineProperty(debug2, "enabled", {
          enumerable: true,
          configurable: false,
          get: () => {
            if (enableOverride !== null) {
              return enableOverride;
            }
            if (namespacesCache !== createDebug.namespaces) {
              namespacesCache = createDebug.namespaces;
              enabledCache = createDebug.enabled(namespace);
            }
            return enabledCache;
          },
          set: (v) => {
            enableOverride = v;
          }
        });
        if (typeof createDebug.init === "function") {
          createDebug.init(debug2);
        }
        return debug2;
      }
      function extend(namespace, delimiter) {
        const newDebug = createDebug(this.namespace + (typeof delimiter === "undefined" ? ":" : delimiter) + namespace);
        newDebug.log = this.log;
        return newDebug;
      }
      function enable(namespaces) {
        createDebug.save(namespaces);
        createDebug.namespaces = namespaces;
        createDebug.names = [];
        createDebug.skips = [];
        const split = (typeof namespaces === "string" ? namespaces : "").trim().replace(/\s+/g, ",").split(",").filter(Boolean);
        for (const ns of split) {
          if (ns[0] === "-") {
            createDebug.skips.push(ns.slice(1));
          } else {
            createDebug.names.push(ns);
          }
        }
      }
      function matchesTemplate(search, template) {
        let searchIndex = 0;
        let templateIndex = 0;
        let starIndex = -1;
        let matchIndex = 0;
        while (searchIndex < search.length) {
          if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === "*")) {
            if (template[templateIndex] === "*") {
              starIndex = templateIndex;
              matchIndex = searchIndex;
              templateIndex++;
            } else {
              searchIndex++;
              templateIndex++;
            }
          } else if (starIndex !== -1) {
            templateIndex = starIndex + 1;
            matchIndex++;
            searchIndex = matchIndex;
          } else {
            return false;
          }
        }
        while (templateIndex < template.length && template[templateIndex] === "*") {
          templateIndex++;
        }
        return templateIndex === template.length;
      }
      function disable() {
        const namespaces = [
          ...createDebug.names,
          ...createDebug.skips.map((namespace) => "-" + namespace)
        ].join(",");
        createDebug.enable("");
        return namespaces;
      }
      function enabled(name) {
        for (const skip of createDebug.skips) {
          if (matchesTemplate(name, skip)) {
            return false;
          }
        }
        for (const ns of createDebug.names) {
          if (matchesTemplate(name, ns)) {
            return true;
          }
        }
        return false;
      }
      function coerce(val) {
        if (val instanceof Error) {
          return val.stack || val.message;
        }
        return val;
      }
      function destroy() {
        console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
      }
      createDebug.enable(createDebug.load());
      return createDebug;
    }
    module2.exports = setup;
  }
});

// node_modules/debug/src/browser.js
var require_browser = __commonJS({
  "node_modules/debug/src/browser.js"(exports2, module2) {
    exports2.formatArgs = formatArgs;
    exports2.save = save;
    exports2.load = load3;
    exports2.useColors = useColors;
    exports2.storage = localstorage();
    exports2.destroy = /* @__PURE__ */ (() => {
      let warned = false;
      return () => {
        if (!warned) {
          warned = true;
          console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
        }
      };
    })();
    exports2.colors = [
      "#0000CC",
      "#0000FF",
      "#0033CC",
      "#0033FF",
      "#0066CC",
      "#0066FF",
      "#0099CC",
      "#0099FF",
      "#00CC00",
      "#00CC33",
      "#00CC66",
      "#00CC99",
      "#00CCCC",
      "#00CCFF",
      "#3300CC",
      "#3300FF",
      "#3333CC",
      "#3333FF",
      "#3366CC",
      "#3366FF",
      "#3399CC",
      "#3399FF",
      "#33CC00",
      "#33CC33",
      "#33CC66",
      "#33CC99",
      "#33CCCC",
      "#33CCFF",
      "#6600CC",
      "#6600FF",
      "#6633CC",
      "#6633FF",
      "#66CC00",
      "#66CC33",
      "#9900CC",
      "#9900FF",
      "#9933CC",
      "#9933FF",
      "#99CC00",
      "#99CC33",
      "#CC0000",
      "#CC0033",
      "#CC0066",
      "#CC0099",
      "#CC00CC",
      "#CC00FF",
      "#CC3300",
      "#CC3333",
      "#CC3366",
      "#CC3399",
      "#CC33CC",
      "#CC33FF",
      "#CC6600",
      "#CC6633",
      "#CC9900",
      "#CC9933",
      "#CCCC00",
      "#CCCC33",
      "#FF0000",
      "#FF0033",
      "#FF0066",
      "#FF0099",
      "#FF00CC",
      "#FF00FF",
      "#FF3300",
      "#FF3333",
      "#FF3366",
      "#FF3399",
      "#FF33CC",
      "#FF33FF",
      "#FF6600",
      "#FF6633",
      "#FF9900",
      "#FF9933",
      "#FFCC00",
      "#FFCC33"
    ];
    function useColors() {
      if (typeof window !== "undefined" && window.process && (window.process.type === "renderer" || window.process.__nwjs)) {
        return true;
      }
      if (typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
        return false;
      }
      let m;
      return typeof document !== "undefined" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773
      typeof window !== "undefined" && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31?
      // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
      typeof navigator !== "undefined" && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(m[1], 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker
      typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
    }
    function formatArgs(args) {
      args[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + args[0] + (this.useColors ? "%c " : " ") + "+" + module2.exports.humanize(this.diff);
      if (!this.useColors) {
        return;
      }
      const c = "color: " + this.color;
      args.splice(1, 0, c, "color: inherit");
      let index = 0;
      let lastC = 0;
      args[0].replace(/%[a-zA-Z%]/g, (match) => {
        if (match === "%%") {
          return;
        }
        index++;
        if (match === "%c") {
          lastC = index;
        }
      });
      args.splice(lastC, 0, c);
    }
    exports2.log = console.debug || console.log || (() => {
    });
    function save(namespaces) {
      try {
        if (namespaces) {
          exports2.storage.setItem("debug", namespaces);
        } else {
          exports2.storage.removeItem("debug");
        }
      } catch (error) {
      }
    }
    function load3() {
      let r;
      try {
        r = exports2.storage.getItem("debug") || exports2.storage.getItem("DEBUG");
      } catch (error) {
      }
      if (!r && typeof process !== "undefined" && "env" in process) {
        r = process.env.DEBUG;
      }
      return r;
    }
    function localstorage() {
      try {
        return localStorage;
      } catch (error) {
      }
    }
    module2.exports = require_common()(exports2);
    var { formatters } = module2.exports;
    formatters.j = function(v) {
      try {
        return JSON.stringify(v);
      } catch (error) {
        return "[UnexpectedJSONParseError]: " + error.message;
      }
    };
  }
});

// node_modules/has-flag/index.js
var require_has_flag = __commonJS({
  "node_modules/has-flag/index.js"(exports2, module2) {
    "use strict";
    module2.exports = (flag, argv = process.argv) => {
      const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
      const position = argv.indexOf(prefix + flag);
      const terminatorPosition = argv.indexOf("--");
      return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
    };
  }
});

// node_modules/supports-color/index.js
var require_supports_color = __commonJS({
  "node_modules/supports-color/index.js"(exports2, module2) {
    "use strict";
    var os2 = require("os");
    var tty = require("tty");
    var hasFlag = require_has_flag();
    var { env } = process;
    var flagForceColor;
    if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
      flagForceColor = 0;
    } else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
      flagForceColor = 1;
    }
    function envForceColor() {
      if ("FORCE_COLOR" in env) {
        if (env.FORCE_COLOR === "true") {
          return 1;
        }
        if (env.FORCE_COLOR === "false") {
          return 0;
        }
        return env.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);
      }
    }
    function translateLevel(level) {
      if (level === 0) {
        return false;
      }
      return {
        level,
        hasBasic: true,
        has256: level >= 2,
        has16m: level >= 3
      };
    }
    function supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
      const noFlagForceColor = envForceColor();
      if (noFlagForceColor !== void 0) {
        flagForceColor = noFlagForceColor;
      }
      const forceColor = sniffFlags ? flagForceColor : noFlagForceColor;
      if (forceColor === 0) {
        return 0;
      }
      if (sniffFlags) {
        if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
          return 3;
        }
        if (hasFlag("color=256")) {
          return 2;
        }
      }
      if (haveStream && !streamIsTTY && forceColor === void 0) {
        return 0;
      }
      const min = forceColor || 0;
      if (env.TERM === "dumb") {
        return min;
      }
      if (process.platform === "win32") {
        const osRelease = os2.release().split(".");
        if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
          return Number(osRelease[2]) >= 14931 ? 3 : 2;
        }
        return 1;
      }
      if ("CI" in env) {
        if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "GITHUB_ACTIONS", "BUILDKITE", "DRONE"].some((sign) => sign in env) || env.CI_NAME === "codeship") {
          return 1;
        }
        return min;
      }
      if ("TEAMCITY_VERSION" in env) {
        return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
      }
      if (env.COLORTERM === "truecolor") {
        return 3;
      }
      if ("TERM_PROGRAM" in env) {
        const version2 = Number.parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
        switch (env.TERM_PROGRAM) {
          case "iTerm.app":
            return version2 >= 3 ? 3 : 2;
          case "Apple_Terminal":
            return 2;
        }
      }
      if (/-256(color)?$/i.test(env.TERM)) {
        return 2;
      }
      if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
        return 1;
      }
      if ("COLORTERM" in env) {
        return 1;
      }
      return min;
    }
    function getSupportLevel(stream, options = {}) {
      const level = supportsColor(stream, {
        streamIsTTY: stream && stream.isTTY,
        ...options
      });
      return translateLevel(level);
    }
    module2.exports = {
      supportsColor: getSupportLevel,
      stdout: getSupportLevel({ isTTY: tty.isatty(1) }),
      stderr: getSupportLevel({ isTTY: tty.isatty(2) })
    };
  }
});

// node_modules/debug/src/node.js
var require_node = __commonJS({
  "node_modules/debug/src/node.js"(exports2, module2) {
    var tty = require("tty");
    var util = require("util");
    exports2.init = init;
    exports2.log = log;
    exports2.formatArgs = formatArgs;
    exports2.save = save;
    exports2.load = load3;
    exports2.useColors = useColors;
    exports2.destroy = util.deprecate(
      () => {
      },
      "Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."
    );
    exports2.colors = [6, 2, 3, 4, 5, 1];
    try {
      const supportsColor = require_supports_color();
      if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {
        exports2.colors = [
          20,
          21,
          26,
          27,
          32,
          33,
          38,
          39,
          40,
          41,
          42,
          43,
          44,
          45,
          56,
          57,
          62,
          63,
          68,
          69,
          74,
          75,
          76,
          77,
          78,
          79,
          80,
          81,
          92,
          93,
          98,
          99,
          112,
          113,
          128,
          129,
          134,
          135,
          148,
          149,
          160,
          161,
          162,
          163,
          164,
          165,
          166,
          167,
          168,
          169,
          170,
          171,
          172,
          173,
          178,
          179,
          184,
          185,
          196,
          197,
          198,
          199,
          200,
          201,
          202,
          203,
          204,
          205,
          206,
          207,
          208,
          209,
          214,
          215,
          220,
          221
        ];
      }
    } catch (error) {
    }
    exports2.inspectOpts = Object.keys(process.env).filter((key) => {
      return /^debug_/i.test(key);
    }).reduce((obj, key) => {
      const prop = key.substring(6).toLowerCase().replace(/_([a-z])/g, (_, k) => {
        return k.toUpperCase();
      });
      let val = process.env[key];
      if (/^(yes|on|true|enabled)$/i.test(val)) {
        val = true;
      } else if (/^(no|off|false|disabled)$/i.test(val)) {
        val = false;
      } else if (val === "null") {
        val = null;
      } else {
        val = Number(val);
      }
      obj[prop] = val;
      return obj;
    }, {});
    function useColors() {
      return "colors" in exports2.inspectOpts ? Boolean(exports2.inspectOpts.colors) : tty.isatty(process.stderr.fd);
    }
    function formatArgs(args) {
      const { namespace: name, useColors: useColors2 } = this;
      if (useColors2) {
        const c = this.color;
        const colorCode = "\x1B[3" + (c < 8 ? c : "8;5;" + c);
        const prefix = `  ${colorCode};1m${name} \x1B[0m`;
        args[0] = prefix + args[0].split("\n").join("\n" + prefix);
        args.push(colorCode + "m+" + module2.exports.humanize(this.diff) + "\x1B[0m");
      } else {
        args[0] = getDate() + name + " " + args[0];
      }
    }
    function getDate() {
      if (exports2.inspectOpts.hideDate) {
        return "";
      }
      return (/* @__PURE__ */ new Date()).toISOString() + " ";
    }
    function log(...args) {
      return process.stderr.write(util.formatWithOptions(exports2.inspectOpts, ...args) + "\n");
    }
    function save(namespaces) {
      if (namespaces) {
        process.env.DEBUG = namespaces;
      } else {
        delete process.env.DEBUG;
      }
    }
    function load3() {
      return process.env.DEBUG;
    }
    function init(debug2) {
      debug2.inspectOpts = {};
      const keys = Object.keys(exports2.inspectOpts);
      for (let i = 0; i < keys.length; i++) {
        debug2.inspectOpts[keys[i]] = exports2.inspectOpts[keys[i]];
      }
    }
    module2.exports = require_common()(exports2);
    var { formatters } = module2.exports;
    formatters.o = function(v) {
      this.inspectOpts.colors = this.useColors;
      return util.inspect(v, this.inspectOpts).split("\n").map((str) => str.trim()).join(" ");
    };
    formatters.O = function(v) {
      this.inspectOpts.colors = this.useColors;
      return util.inspect(v, this.inspectOpts);
    };
  }
});

// node_modules/debug/src/index.js
var require_src = __commonJS({
  "node_modules/debug/src/index.js"(exports2, module2) {
    if (typeof process === "undefined" || process.type === "renderer" || process.browser === true || process.__nwjs) {
      module2.exports = require_browser();
    } else {
      module2.exports = require_node();
    }
  }
});

// node_modules/mime/Mime.js
var require_Mime = __commonJS({
  "node_modules/mime/Mime.js"(exports2, module2) {
    "use strict";
    function Mime() {
      this._types = /* @__PURE__ */ Object.create(null);
      this._extensions = /* @__PURE__ */ Object.create(null);
      for (let i = 0; i < arguments.length; i++) {
        this.define(arguments[i]);
      }
      this.define = this.define.bind(this);
      this.getType = this.getType.bind(this);
      this.getExtension = this.getExtension.bind(this);
    }
    Mime.prototype.define = function(typeMap, force) {
      for (let type in typeMap) {
        let extensions = typeMap[type].map(function(t) {
          return t.toLowerCase();
        });
        type = type.toLowerCase();
        for (let i = 0; i < extensions.length; i++) {
          const ext = extensions[i];
          if (ext[0] === "*") {
            continue;
          }
          if (!force && ext in this._types) {
            throw new Error(
              'Attempt to change mapping for "' + ext + '" extension from "' + this._types[ext] + '" to "' + type + '". Pass `force=true` to allow this, otherwise remove "' + ext + '" from the list of extensions for "' + type + '".'
            );
          }
          this._types[ext] = type;
        }
        if (force || !this._extensions[type]) {
          const ext = extensions[0];
          this._extensions[type] = ext[0] !== "*" ? ext : ext.substr(1);
        }
      }
    };
    Mime.prototype.getType = function(path6) {
      path6 = String(path6);
      let last = path6.replace(/^.*[/\\]/, "").toLowerCase();
      let ext = last.replace(/^.*\./, "").toLowerCase();
      let hasPath = last.length < path6.length;
      let hasDot = ext.length < last.length - 1;
      return (hasDot || !hasPath) && this._types[ext] || null;
    };
    Mime.prototype.getExtension = function(type) {
      type = /^\s*([^;\s]*)/.test(type) && RegExp.$1;
      return type && this._extensions[type.toLowerCase()] || null;
    };
    module2.exports = Mime;
  }
});

// node_modules/mime/types/standard.js
var require_standard = __commonJS({
  "node_modules/mime/types/standard.js"(exports2, module2) {
    module2.exports = { "application/andrew-inset": ["ez"], "application/applixware": ["aw"], "application/atom+xml": ["atom"], "application/atomcat+xml": ["atomcat"], "application/atomdeleted+xml": ["atomdeleted"], "application/atomsvc+xml": ["atomsvc"], "application/atsc-dwd+xml": ["dwd"], "application/atsc-held+xml": ["held"], "application/atsc-rsat+xml": ["rsat"], "application/bdoc": ["bdoc"], "application/calendar+xml": ["xcs"], "application/ccxml+xml": ["ccxml"], "application/cdfx+xml": ["cdfx"], "application/cdmi-capability": ["cdmia"], "application/cdmi-container": ["cdmic"], "application/cdmi-domain": ["cdmid"], "application/cdmi-object": ["cdmio"], "application/cdmi-queue": ["cdmiq"], "application/cu-seeme": ["cu"], "application/dash+xml": ["mpd"], "application/davmount+xml": ["davmount"], "application/docbook+xml": ["dbk"], "application/dssc+der": ["dssc"], "application/dssc+xml": ["xdssc"], "application/ecmascript": ["es", "ecma"], "application/emma+xml": ["emma"], "application/emotionml+xml": ["emotionml"], "application/epub+zip": ["epub"], "application/exi": ["exi"], "application/express": ["exp"], "application/fdt+xml": ["fdt"], "application/font-tdpfr": ["pfr"], "application/geo+json": ["geojson"], "application/gml+xml": ["gml"], "application/gpx+xml": ["gpx"], "application/gxf": ["gxf"], "application/gzip": ["gz"], "application/hjson": ["hjson"], "application/hyperstudio": ["stk"], "application/inkml+xml": ["ink", "inkml"], "application/ipfix": ["ipfix"], "application/its+xml": ["its"], "application/java-archive": ["jar", "war", "ear"], "application/java-serialized-object": ["ser"], "application/java-vm": ["class"], "application/javascript": ["js", "mjs"], "application/json": ["json", "map"], "application/json5": ["json5"], "application/jsonml+json": ["jsonml"], "application/ld+json": ["jsonld"], "application/lgr+xml": ["lgr"], "application/lost+xml": ["lostxml"], "application/mac-binhex40": ["hqx"], "application/mac-compactpro": ["cpt"], "application/mads+xml": ["mads"], "application/manifest+json": ["webmanifest"], "application/marc": ["mrc"], "application/marcxml+xml": ["mrcx"], "application/mathematica": ["ma", "nb", "mb"], "application/mathml+xml": ["mathml"], "application/mbox": ["mbox"], "application/mediaservercontrol+xml": ["mscml"], "application/metalink+xml": ["metalink"], "application/metalink4+xml": ["meta4"], "application/mets+xml": ["mets"], "application/mmt-aei+xml": ["maei"], "application/mmt-usd+xml": ["musd"], "application/mods+xml": ["mods"], "application/mp21": ["m21", "mp21"], "application/mp4": ["mp4s", "m4p"], "application/msword": ["doc", "dot"], "application/mxf": ["mxf"], "application/n-quads": ["nq"], "application/n-triples": ["nt"], "application/node": ["cjs"], "application/octet-stream": ["bin", "dms", "lrf", "mar", "so", "dist", "distz", "pkg", "bpk", "dump", "elc", "deploy", "exe", "dll", "deb", "dmg", "iso", "img", "msi", "msp", "msm", "buffer"], "application/oda": ["oda"], "application/oebps-package+xml": ["opf"], "application/ogg": ["ogx"], "application/omdoc+xml": ["omdoc"], "application/onenote": ["onetoc", "onetoc2", "onetmp", "onepkg"], "application/oxps": ["oxps"], "application/p2p-overlay+xml": ["relo"], "application/patch-ops-error+xml": ["xer"], "application/pdf": ["pdf"], "application/pgp-encrypted": ["pgp"], "application/pgp-signature": ["asc", "sig"], "application/pics-rules": ["prf"], "application/pkcs10": ["p10"], "application/pkcs7-mime": ["p7m", "p7c"], "application/pkcs7-signature": ["p7s"], "application/pkcs8": ["p8"], "application/pkix-attr-cert": ["ac"], "application/pkix-cert": ["cer"], "application/pkix-crl": ["crl"], "application/pkix-pkipath": ["pkipath"], "application/pkixcmp": ["pki"], "application/pls+xml": ["pls"], "application/postscript": ["ai", "eps", "ps"], "application/provenance+xml": ["provx"], "application/pskc+xml": ["pskcxml"], "application/raml+yaml": ["raml"], "application/rdf+xml": ["rdf", "owl"], "application/reginfo+xml": ["rif"], "application/relax-ng-compact-syntax": ["rnc"], "application/resource-lists+xml": ["rl"], "application/resource-lists-diff+xml": ["rld"], "application/rls-services+xml": ["rs"], "application/route-apd+xml": ["rapd"], "application/route-s-tsid+xml": ["sls"], "application/route-usd+xml": ["rusd"], "application/rpki-ghostbusters": ["gbr"], "application/rpki-manifest": ["mft"], "application/rpki-roa": ["roa"], "application/rsd+xml": ["rsd"], "application/rss+xml": ["rss"], "application/rtf": ["rtf"], "application/sbml+xml": ["sbml"], "application/scvp-cv-request": ["scq"], "application/scvp-cv-response": ["scs"], "application/scvp-vp-request": ["spq"], "application/scvp-vp-response": ["spp"], "application/sdp": ["sdp"], "application/senml+xml": ["senmlx"], "application/sensml+xml": ["sensmlx"], "application/set-payment-initiation": ["setpay"], "application/set-registration-initiation": ["setreg"], "application/shf+xml": ["shf"], "application/sieve": ["siv", "sieve"], "application/smil+xml": ["smi", "smil"], "application/sparql-query": ["rq"], "application/sparql-results+xml": ["srx"], "application/srgs": ["gram"], "application/srgs+xml": ["grxml"], "application/sru+xml": ["sru"], "application/ssdl+xml": ["ssdl"], "application/ssml+xml": ["ssml"], "application/swid+xml": ["swidtag"], "application/tei+xml": ["tei", "teicorpus"], "application/thraud+xml": ["tfi"], "application/timestamped-data": ["tsd"], "application/toml": ["toml"], "application/trig": ["trig"], "application/ttml+xml": ["ttml"], "application/ubjson": ["ubj"], "application/urc-ressheet+xml": ["rsheet"], "application/urc-targetdesc+xml": ["td"], "application/voicexml+xml": ["vxml"], "application/wasm": ["wasm"], "application/widget": ["wgt"], "application/winhlp": ["hlp"], "application/wsdl+xml": ["wsdl"], "application/wspolicy+xml": ["wspolicy"], "application/xaml+xml": ["xaml"], "application/xcap-att+xml": ["xav"], "application/xcap-caps+xml": ["xca"], "application/xcap-diff+xml": ["xdf"], "application/xcap-el+xml": ["xel"], "application/xcap-ns+xml": ["xns"], "application/xenc+xml": ["xenc"], "application/xhtml+xml": ["xhtml", "xht"], "application/xliff+xml": ["xlf"], "application/xml": ["xml", "xsl", "xsd", "rng"], "application/xml-dtd": ["dtd"], "application/xop+xml": ["xop"], "application/xproc+xml": ["xpl"], "application/xslt+xml": ["*xsl", "xslt"], "application/xspf+xml": ["xspf"], "application/xv+xml": ["mxml", "xhvml", "xvml", "xvm"], "application/yang": ["yang"], "application/yin+xml": ["yin"], "application/zip": ["zip"], "audio/3gpp": ["*3gpp"], "audio/adpcm": ["adp"], "audio/amr": ["amr"], "audio/basic": ["au", "snd"], "audio/midi": ["mid", "midi", "kar", "rmi"], "audio/mobile-xmf": ["mxmf"], "audio/mp3": ["*mp3"], "audio/mp4": ["m4a", "mp4a"], "audio/mpeg": ["mpga", "mp2", "mp2a", "mp3", "m2a", "m3a"], "audio/ogg": ["oga", "ogg", "spx", "opus"], "audio/s3m": ["s3m"], "audio/silk": ["sil"], "audio/wav": ["wav"], "audio/wave": ["*wav"], "audio/webm": ["weba"], "audio/xm": ["xm"], "font/collection": ["ttc"], "font/otf": ["otf"], "font/ttf": ["ttf"], "font/woff": ["woff"], "font/woff2": ["woff2"], "image/aces": ["exr"], "image/apng": ["apng"], "image/avif": ["avif"], "image/bmp": ["bmp"], "image/cgm": ["cgm"], "image/dicom-rle": ["drle"], "image/emf": ["emf"], "image/fits": ["fits"], "image/g3fax": ["g3"], "image/gif": ["gif"], "image/heic": ["heic"], "image/heic-sequence": ["heics"], "image/heif": ["heif"], "image/heif-sequence": ["heifs"], "image/hej2k": ["hej2"], "image/hsj2": ["hsj2"], "image/ief": ["ief"], "image/jls": ["jls"], "image/jp2": ["jp2", "jpg2"], "image/jpeg": ["jpeg", "jpg", "jpe"], "image/jph": ["jph"], "image/jphc": ["jhc"], "image/jpm": ["jpm"], "image/jpx": ["jpx", "jpf"], "image/jxr": ["jxr"], "image/jxra": ["jxra"], "image/jxrs": ["jxrs"], "image/jxs": ["jxs"], "image/jxsc": ["jxsc"], "image/jxsi": ["jxsi"], "image/jxss": ["jxss"], "image/ktx": ["ktx"], "image/ktx2": ["ktx2"], "image/png": ["png"], "image/sgi": ["sgi"], "image/svg+xml": ["svg", "svgz"], "image/t38": ["t38"], "image/tiff": ["tif", "tiff"], "image/tiff-fx": ["tfx"], "image/webp": ["webp"], "image/wmf": ["wmf"], "message/disposition-notification": ["disposition-notification"], "message/global": ["u8msg"], "message/global-delivery-status": ["u8dsn"], "message/global-disposition-notification": ["u8mdn"], "message/global-headers": ["u8hdr"], "message/rfc822": ["eml", "mime"], "model/3mf": ["3mf"], "model/gltf+json": ["gltf"], "model/gltf-binary": ["glb"], "model/iges": ["igs", "iges"], "model/mesh": ["msh", "mesh", "silo"], "model/mtl": ["mtl"], "model/obj": ["obj"], "model/step+xml": ["stpx"], "model/step+zip": ["stpz"], "model/step-xml+zip": ["stpxz"], "model/stl": ["stl"], "model/vrml": ["wrl", "vrml"], "model/x3d+binary": ["*x3db", "x3dbz"], "model/x3d+fastinfoset": ["x3db"], "model/x3d+vrml": ["*x3dv", "x3dvz"], "model/x3d+xml": ["x3d", "x3dz"], "model/x3d-vrml": ["x3dv"], "text/cache-manifest": ["appcache", "manifest"], "text/calendar": ["ics", "ifb"], "text/coffeescript": ["coffee", "litcoffee"], "text/css": ["css"], "text/csv": ["csv"], "text/html": ["html", "htm", "shtml"], "text/jade": ["jade"], "text/jsx": ["jsx"], "text/less": ["less"], "text/markdown": ["markdown", "md"], "text/mathml": ["mml"], "text/mdx": ["mdx"], "text/n3": ["n3"], "text/plain": ["txt", "text", "conf", "def", "list", "log", "in", "ini"], "text/richtext": ["rtx"], "text/rtf": ["*rtf"], "text/sgml": ["sgml", "sgm"], "text/shex": ["shex"], "text/slim": ["slim", "slm"], "text/spdx": ["spdx"], "text/stylus": ["stylus", "styl"], "text/tab-separated-values": ["tsv"], "text/troff": ["t", "tr", "roff", "man", "me", "ms"], "text/turtle": ["ttl"], "text/uri-list": ["uri", "uris", "urls"], "text/vcard": ["vcard"], "text/vtt": ["vtt"], "text/xml": ["*xml"], "text/yaml": ["yaml", "yml"], "video/3gpp": ["3gp", "3gpp"], "video/3gpp2": ["3g2"], "video/h261": ["h261"], "video/h263": ["h263"], "video/h264": ["h264"], "video/iso.segment": ["m4s"], "video/jpeg": ["jpgv"], "video/jpm": ["*jpm", "jpgm"], "video/mj2": ["mj2", "mjp2"], "video/mp2t": ["ts"], "video/mp4": ["mp4", "mp4v", "mpg4"], "video/mpeg": ["mpeg", "mpg", "mpe", "m1v", "m2v"], "video/ogg": ["ogv"], "video/quicktime": ["qt", "mov"], "video/webm": ["webm"] };
  }
});

// node_modules/mime/types/other.js
var require_other = __commonJS({
  "node_modules/mime/types/other.js"(exports2, module2) {
    module2.exports = { "application/prs.cww": ["cww"], "application/vnd.1000minds.decision-model+xml": ["1km"], "application/vnd.3gpp.pic-bw-large": ["plb"], "application/vnd.3gpp.pic-bw-small": ["psb"], "application/vnd.3gpp.pic-bw-var": ["pvb"], "application/vnd.3gpp2.tcap": ["tcap"], "application/vnd.3m.post-it-notes": ["pwn"], "application/vnd.accpac.simply.aso": ["aso"], "application/vnd.accpac.simply.imp": ["imp"], "application/vnd.acucobol": ["acu"], "application/vnd.acucorp": ["atc", "acutc"], "application/vnd.adobe.air-application-installer-package+zip": ["air"], "application/vnd.adobe.formscentral.fcdt": ["fcdt"], "application/vnd.adobe.fxp": ["fxp", "fxpl"], "application/vnd.adobe.xdp+xml": ["xdp"], "application/vnd.adobe.xfdf": ["xfdf"], "application/vnd.ahead.space": ["ahead"], "application/vnd.airzip.filesecure.azf": ["azf"], "application/vnd.airzip.filesecure.azs": ["azs"], "application/vnd.amazon.ebook": ["azw"], "application/vnd.americandynamics.acc": ["acc"], "application/vnd.amiga.ami": ["ami"], "application/vnd.android.package-archive": ["apk"], "application/vnd.anser-web-certificate-issue-initiation": ["cii"], "application/vnd.anser-web-funds-transfer-initiation": ["fti"], "application/vnd.antix.game-component": ["atx"], "application/vnd.apple.installer+xml": ["mpkg"], "application/vnd.apple.keynote": ["key"], "application/vnd.apple.mpegurl": ["m3u8"], "application/vnd.apple.numbers": ["numbers"], "application/vnd.apple.pages": ["pages"], "application/vnd.apple.pkpass": ["pkpass"], "application/vnd.aristanetworks.swi": ["swi"], "application/vnd.astraea-software.iota": ["iota"], "application/vnd.audiograph": ["aep"], "application/vnd.balsamiq.bmml+xml": ["bmml"], "application/vnd.blueice.multipass": ["mpm"], "application/vnd.bmi": ["bmi"], "application/vnd.businessobjects": ["rep"], "application/vnd.chemdraw+xml": ["cdxml"], "application/vnd.chipnuts.karaoke-mmd": ["mmd"], "application/vnd.cinderella": ["cdy"], "application/vnd.citationstyles.style+xml": ["csl"], "application/vnd.claymore": ["cla"], "application/vnd.cloanto.rp9": ["rp9"], "application/vnd.clonk.c4group": ["c4g", "c4d", "c4f", "c4p", "c4u"], "application/vnd.cluetrust.cartomobile-config": ["c11amc"], "application/vnd.cluetrust.cartomobile-config-pkg": ["c11amz"], "application/vnd.commonspace": ["csp"], "application/vnd.contact.cmsg": ["cdbcmsg"], "application/vnd.cosmocaller": ["cmc"], "application/vnd.crick.clicker": ["clkx"], "application/vnd.crick.clicker.keyboard": ["clkk"], "application/vnd.crick.clicker.palette": ["clkp"], "application/vnd.crick.clicker.template": ["clkt"], "application/vnd.crick.clicker.wordbank": ["clkw"], "application/vnd.criticaltools.wbs+xml": ["wbs"], "application/vnd.ctc-posml": ["pml"], "application/vnd.cups-ppd": ["ppd"], "application/vnd.curl.car": ["car"], "application/vnd.curl.pcurl": ["pcurl"], "application/vnd.dart": ["dart"], "application/vnd.data-vision.rdz": ["rdz"], "application/vnd.dbf": ["dbf"], "application/vnd.dece.data": ["uvf", "uvvf", "uvd", "uvvd"], "application/vnd.dece.ttml+xml": ["uvt", "uvvt"], "application/vnd.dece.unspecified": ["uvx", "uvvx"], "application/vnd.dece.zip": ["uvz", "uvvz"], "application/vnd.denovo.fcselayout-link": ["fe_launch"], "application/vnd.dna": ["dna"], "application/vnd.dolby.mlp": ["mlp"], "application/vnd.dpgraph": ["dpg"], "application/vnd.dreamfactory": ["dfac"], "application/vnd.ds-keypoint": ["kpxx"], "application/vnd.dvb.ait": ["ait"], "application/vnd.dvb.service": ["svc"], "application/vnd.dynageo": ["geo"], "application/vnd.ecowin.chart": ["mag"], "application/vnd.enliven": ["nml"], "application/vnd.epson.esf": ["esf"], "application/vnd.epson.msf": ["msf"], "application/vnd.epson.quickanime": ["qam"], "application/vnd.epson.salt": ["slt"], "application/vnd.epson.ssf": ["ssf"], "application/vnd.eszigno3+xml": ["es3", "et3"], "application/vnd.ezpix-album": ["ez2"], "application/vnd.ezpix-package": ["ez3"], "application/vnd.fdf": ["fdf"], "application/vnd.fdsn.mseed": ["mseed"], "application/vnd.fdsn.seed": ["seed", "dataless"], "application/vnd.flographit": ["gph"], "application/vnd.fluxtime.clip": ["ftc"], "application/vnd.framemaker": ["fm", "frame", "maker", "book"], "application/vnd.frogans.fnc": ["fnc"], "application/vnd.frogans.ltf": ["ltf"], "application/vnd.fsc.weblaunch": ["fsc"], "application/vnd.fujitsu.oasys": ["oas"], "application/vnd.fujitsu.oasys2": ["oa2"], "application/vnd.fujitsu.oasys3": ["oa3"], "application/vnd.fujitsu.oasysgp": ["fg5"], "application/vnd.fujitsu.oasysprs": ["bh2"], "application/vnd.fujixerox.ddd": ["ddd"], "application/vnd.fujixerox.docuworks": ["xdw"], "application/vnd.fujixerox.docuworks.binder": ["xbd"], "application/vnd.fuzzysheet": ["fzs"], "application/vnd.genomatix.tuxedo": ["txd"], "application/vnd.geogebra.file": ["ggb"], "application/vnd.geogebra.tool": ["ggt"], "application/vnd.geometry-explorer": ["gex", "gre"], "application/vnd.geonext": ["gxt"], "application/vnd.geoplan": ["g2w"], "application/vnd.geospace": ["g3w"], "application/vnd.gmx": ["gmx"], "application/vnd.google-apps.document": ["gdoc"], "application/vnd.google-apps.presentation": ["gslides"], "application/vnd.google-apps.spreadsheet": ["gsheet"], "application/vnd.google-earth.kml+xml": ["kml"], "application/vnd.google-earth.kmz": ["kmz"], "application/vnd.grafeq": ["gqf", "gqs"], "application/vnd.groove-account": ["gac"], "application/vnd.groove-help": ["ghf"], "application/vnd.groove-identity-message": ["gim"], "application/vnd.groove-injector": ["grv"], "application/vnd.groove-tool-message": ["gtm"], "application/vnd.groove-tool-template": ["tpl"], "application/vnd.groove-vcard": ["vcg"], "application/vnd.hal+xml": ["hal"], "application/vnd.handheld-entertainment+xml": ["zmm"], "application/vnd.hbci": ["hbci"], "application/vnd.hhe.lesson-player": ["les"], "application/vnd.hp-hpgl": ["hpgl"], "application/vnd.hp-hpid": ["hpid"], "application/vnd.hp-hps": ["hps"], "application/vnd.hp-jlyt": ["jlt"], "application/vnd.hp-pcl": ["pcl"], "application/vnd.hp-pclxl": ["pclxl"], "application/vnd.hydrostatix.sof-data": ["sfd-hdstx"], "application/vnd.ibm.minipay": ["mpy"], "application/vnd.ibm.modcap": ["afp", "listafp", "list3820"], "application/vnd.ibm.rights-management": ["irm"], "application/vnd.ibm.secure-container": ["sc"], "application/vnd.iccprofile": ["icc", "icm"], "application/vnd.igloader": ["igl"], "application/vnd.immervision-ivp": ["ivp"], "application/vnd.immervision-ivu": ["ivu"], "application/vnd.insors.igm": ["igm"], "application/vnd.intercon.formnet": ["xpw", "xpx"], "application/vnd.intergeo": ["i2g"], "application/vnd.intu.qbo": ["qbo"], "application/vnd.intu.qfx": ["qfx"], "application/vnd.ipunplugged.rcprofile": ["rcprofile"], "application/vnd.irepository.package+xml": ["irp"], "application/vnd.is-xpr": ["xpr"], "application/vnd.isac.fcs": ["fcs"], "application/vnd.jam": ["jam"], "application/vnd.jcp.javame.midlet-rms": ["rms"], "application/vnd.jisp": ["jisp"], "application/vnd.joost.joda-archive": ["joda"], "application/vnd.kahootz": ["ktz", "ktr"], "application/vnd.kde.karbon": ["karbon"], "application/vnd.kde.kchart": ["chrt"], "application/vnd.kde.kformula": ["kfo"], "application/vnd.kde.kivio": ["flw"], "application/vnd.kde.kontour": ["kon"], "application/vnd.kde.kpresenter": ["kpr", "kpt"], "application/vnd.kde.kspread": ["ksp"], "application/vnd.kde.kword": ["kwd", "kwt"], "application/vnd.kenameaapp": ["htke"], "application/vnd.kidspiration": ["kia"], "application/vnd.kinar": ["kne", "knp"], "application/vnd.koan": ["skp", "skd", "skt", "skm"], "application/vnd.kodak-descriptor": ["sse"], "application/vnd.las.las+xml": ["lasxml"], "application/vnd.llamagraphics.life-balance.desktop": ["lbd"], "application/vnd.llamagraphics.life-balance.exchange+xml": ["lbe"], "application/vnd.lotus-1-2-3": ["123"], "application/vnd.lotus-approach": ["apr"], "application/vnd.lotus-freelance": ["pre"], "application/vnd.lotus-notes": ["nsf"], "application/vnd.lotus-organizer": ["org"], "application/vnd.lotus-screencam": ["scm"], "application/vnd.lotus-wordpro": ["lwp"], "application/vnd.macports.portpkg": ["portpkg"], "application/vnd.mapbox-vector-tile": ["mvt"], "application/vnd.mcd": ["mcd"], "application/vnd.medcalcdata": ["mc1"], "application/vnd.mediastation.cdkey": ["cdkey"], "application/vnd.mfer": ["mwf"], "application/vnd.mfmp": ["mfm"], "application/vnd.micrografx.flo": ["flo"], "application/vnd.micrografx.igx": ["igx"], "application/vnd.mif": ["mif"], "application/vnd.mobius.daf": ["daf"], "application/vnd.mobius.dis": ["dis"], "application/vnd.mobius.mbk": ["mbk"], "application/vnd.mobius.mqy": ["mqy"], "application/vnd.mobius.msl": ["msl"], "application/vnd.mobius.plc": ["plc"], "application/vnd.mobius.txf": ["txf"], "application/vnd.mophun.application": ["mpn"], "application/vnd.mophun.certificate": ["mpc"], "application/vnd.mozilla.xul+xml": ["xul"], "application/vnd.ms-artgalry": ["cil"], "application/vnd.ms-cab-compressed": ["cab"], "application/vnd.ms-excel": ["xls", "xlm", "xla", "xlc", "xlt", "xlw"], "application/vnd.ms-excel.addin.macroenabled.12": ["xlam"], "application/vnd.ms-excel.sheet.binary.macroenabled.12": ["xlsb"], "application/vnd.ms-excel.sheet.macroenabled.12": ["xlsm"], "application/vnd.ms-excel.template.macroenabled.12": ["xltm"], "application/vnd.ms-fontobject": ["eot"], "application/vnd.ms-htmlhelp": ["chm"], "application/vnd.ms-ims": ["ims"], "application/vnd.ms-lrm": ["lrm"], "application/vnd.ms-officetheme": ["thmx"], "application/vnd.ms-outlook": ["msg"], "application/vnd.ms-pki.seccat": ["cat"], "application/vnd.ms-pki.stl": ["*stl"], "application/vnd.ms-powerpoint": ["ppt", "pps", "pot"], "application/vnd.ms-powerpoint.addin.macroenabled.12": ["ppam"], "application/vnd.ms-powerpoint.presentation.macroenabled.12": ["pptm"], "application/vnd.ms-powerpoint.slide.macroenabled.12": ["sldm"], "application/vnd.ms-powerpoint.slideshow.macroenabled.12": ["ppsm"], "application/vnd.ms-powerpoint.template.macroenabled.12": ["potm"], "application/vnd.ms-project": ["mpp", "mpt"], "application/vnd.ms-word.document.macroenabled.12": ["docm"], "application/vnd.ms-word.template.macroenabled.12": ["dotm"], "application/vnd.ms-works": ["wps", "wks", "wcm", "wdb"], "application/vnd.ms-wpl": ["wpl"], "application/vnd.ms-xpsdocument": ["xps"], "application/vnd.mseq": ["mseq"], "application/vnd.musician": ["mus"], "application/vnd.muvee.style": ["msty"], "application/vnd.mynfc": ["taglet"], "application/vnd.neurolanguage.nlu": ["nlu"], "application/vnd.nitf": ["ntf", "nitf"], "application/vnd.noblenet-directory": ["nnd"], "application/vnd.noblenet-sealer": ["nns"], "application/vnd.noblenet-web": ["nnw"], "application/vnd.nokia.n-gage.ac+xml": ["*ac"], "application/vnd.nokia.n-gage.data": ["ngdat"], "application/vnd.nokia.n-gage.symbian.install": ["n-gage"], "application/vnd.nokia.radio-preset": ["rpst"], "application/vnd.nokia.radio-presets": ["rpss"], "application/vnd.novadigm.edm": ["edm"], "application/vnd.novadigm.edx": ["edx"], "application/vnd.novadigm.ext": ["ext"], "application/vnd.oasis.opendocument.chart": ["odc"], "application/vnd.oasis.opendocument.chart-template": ["otc"], "application/vnd.oasis.opendocument.database": ["odb"], "application/vnd.oasis.opendocument.formula": ["odf"], "application/vnd.oasis.opendocument.formula-template": ["odft"], "application/vnd.oasis.opendocument.graphics": ["odg"], "application/vnd.oasis.opendocument.graphics-template": ["otg"], "application/vnd.oasis.opendocument.image": ["odi"], "application/vnd.oasis.opendocument.image-template": ["oti"], "application/vnd.oasis.opendocument.presentation": ["odp"], "application/vnd.oasis.opendocument.presentation-template": ["otp"], "application/vnd.oasis.opendocument.spreadsheet": ["ods"], "application/vnd.oasis.opendocument.spreadsheet-template": ["ots"], "application/vnd.oasis.opendocument.text": ["odt"], "application/vnd.oasis.opendocument.text-master": ["odm"], "application/vnd.oasis.opendocument.text-template": ["ott"], "application/vnd.oasis.opendocument.text-web": ["oth"], "application/vnd.olpc-sugar": ["xo"], "application/vnd.oma.dd2+xml": ["dd2"], "application/vnd.openblox.game+xml": ["obgx"], "application/vnd.openofficeorg.extension": ["oxt"], "application/vnd.openstreetmap.data+xml": ["osm"], "application/vnd.openxmlformats-officedocument.presentationml.presentation": ["pptx"], "application/vnd.openxmlformats-officedocument.presentationml.slide": ["sldx"], "application/vnd.openxmlformats-officedocument.presentationml.slideshow": ["ppsx"], "application/vnd.openxmlformats-officedocument.presentationml.template": ["potx"], "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": ["xlsx"], "application/vnd.openxmlformats-officedocument.spreadsheetml.template": ["xltx"], "application/vnd.openxmlformats-officedocument.wordprocessingml.document": ["docx"], "application/vnd.openxmlformats-officedocument.wordprocessingml.template": ["dotx"], "application/vnd.osgeo.mapguide.package": ["mgp"], "application/vnd.osgi.dp": ["dp"], "application/vnd.osgi.subsystem": ["esa"], "application/vnd.palm": ["pdb", "pqa", "oprc"], "application/vnd.pawaafile": ["paw"], "application/vnd.pg.format": ["str"], "application/vnd.pg.osasli": ["ei6"], "application/vnd.picsel": ["efif"], "application/vnd.pmi.widget": ["wg"], "application/vnd.pocketlearn": ["plf"], "application/vnd.powerbuilder6": ["pbd"], "application/vnd.previewsystems.box": ["box"], "application/vnd.proteus.magazine": ["mgz"], "application/vnd.publishare-delta-tree": ["qps"], "application/vnd.pvi.ptid1": ["ptid"], "application/vnd.quark.quarkxpress": ["qxd", "qxt", "qwd", "qwt", "qxl", "qxb"], "application/vnd.rar": ["rar"], "application/vnd.realvnc.bed": ["bed"], "application/vnd.recordare.musicxml": ["mxl"], "application/vnd.recordare.musicxml+xml": ["musicxml"], "application/vnd.rig.cryptonote": ["cryptonote"], "application/vnd.rim.cod": ["cod"], "application/vnd.rn-realmedia": ["rm"], "application/vnd.rn-realmedia-vbr": ["rmvb"], "application/vnd.route66.link66+xml": ["link66"], "application/vnd.sailingtracker.track": ["st"], "application/vnd.seemail": ["see"], "application/vnd.sema": ["sema"], "application/vnd.semd": ["semd"], "application/vnd.semf": ["semf"], "application/vnd.shana.informed.formdata": ["ifm"], "application/vnd.shana.informed.formtemplate": ["itp"], "application/vnd.shana.informed.interchange": ["iif"], "application/vnd.shana.informed.package": ["ipk"], "application/vnd.simtech-mindmapper": ["twd", "twds"], "application/vnd.smaf": ["mmf"], "application/vnd.smart.teacher": ["teacher"], "application/vnd.software602.filler.form+xml": ["fo"], "application/vnd.solent.sdkm+xml": ["sdkm", "sdkd"], "application/vnd.spotfire.dxp": ["dxp"], "application/vnd.spotfire.sfs": ["sfs"], "application/vnd.stardivision.calc": ["sdc"], "application/vnd.stardivision.draw": ["sda"], "application/vnd.stardivision.impress": ["sdd"], "application/vnd.stardivision.math": ["smf"], "application/vnd.stardivision.writer": ["sdw", "vor"], "application/vnd.stardivision.writer-global": ["sgl"], "application/vnd.stepmania.package": ["smzip"], "application/vnd.stepmania.stepchart": ["sm"], "application/vnd.sun.wadl+xml": ["wadl"], "application/vnd.sun.xml.calc": ["sxc"], "application/vnd.sun.xml.calc.template": ["stc"], "application/vnd.sun.xml.draw": ["sxd"], "application/vnd.sun.xml.draw.template": ["std"], "application/vnd.sun.xml.impress": ["sxi"], "application/vnd.sun.xml.impress.template": ["sti"], "application/vnd.sun.xml.math": ["sxm"], "application/vnd.sun.xml.writer": ["sxw"], "application/vnd.sun.xml.writer.global": ["sxg"], "application/vnd.sun.xml.writer.template": ["stw"], "application/vnd.sus-calendar": ["sus", "susp"], "application/vnd.svd": ["svd"], "application/vnd.symbian.install": ["sis", "sisx"], "application/vnd.syncml+xml": ["xsm"], "application/vnd.syncml.dm+wbxml": ["bdm"], "application/vnd.syncml.dm+xml": ["xdm"], "application/vnd.syncml.dmddf+xml": ["ddf"], "application/vnd.tao.intent-module-archive": ["tao"], "application/vnd.tcpdump.pcap": ["pcap", "cap", "dmp"], "application/vnd.tmobile-livetv": ["tmo"], "application/vnd.trid.tpt": ["tpt"], "application/vnd.triscape.mxs": ["mxs"], "application/vnd.trueapp": ["tra"], "application/vnd.ufdl": ["ufd", "ufdl"], "application/vnd.uiq.theme": ["utz"], "application/vnd.umajin": ["umj"], "application/vnd.unity": ["unityweb"], "application/vnd.uoml+xml": ["uoml"], "application/vnd.vcx": ["vcx"], "application/vnd.visio": ["vsd", "vst", "vss", "vsw"], "application/vnd.visionary": ["vis"], "application/vnd.vsf": ["vsf"], "application/vnd.wap.wbxml": ["wbxml"], "application/vnd.wap.wmlc": ["wmlc"], "application/vnd.wap.wmlscriptc": ["wmlsc"], "application/vnd.webturbo": ["wtb"], "application/vnd.wolfram.player": ["nbp"], "application/vnd.wordperfect": ["wpd"], "application/vnd.wqd": ["wqd"], "application/vnd.wt.stf": ["stf"], "application/vnd.xara": ["xar"], "application/vnd.xfdl": ["xfdl"], "application/vnd.yamaha.hv-dic": ["hvd"], "application/vnd.yamaha.hv-script": ["hvs"], "application/vnd.yamaha.hv-voice": ["hvp"], "application/vnd.yamaha.openscoreformat": ["osf"], "application/vnd.yamaha.openscoreformat.osfpvg+xml": ["osfpvg"], "application/vnd.yamaha.smaf-audio": ["saf"], "application/vnd.yamaha.smaf-phrase": ["spf"], "application/vnd.yellowriver-custom-menu": ["cmp"], "application/vnd.zul": ["zir", "zirz"], "application/vnd.zzazz.deck+xml": ["zaz"], "application/x-7z-compressed": ["7z"], "application/x-abiword": ["abw"], "application/x-ace-compressed": ["ace"], "application/x-apple-diskimage": ["*dmg"], "application/x-arj": ["arj"], "application/x-authorware-bin": ["aab", "x32", "u32", "vox"], "application/x-authorware-map": ["aam"], "application/x-authorware-seg": ["aas"], "application/x-bcpio": ["bcpio"], "application/x-bdoc": ["*bdoc"], "application/x-bittorrent": ["torrent"], "application/x-blorb": ["blb", "blorb"], "application/x-bzip": ["bz"], "application/x-bzip2": ["bz2", "boz"], "application/x-cbr": ["cbr", "cba", "cbt", "cbz", "cb7"], "application/x-cdlink": ["vcd"], "application/x-cfs-compressed": ["cfs"], "application/x-chat": ["chat"], "application/x-chess-pgn": ["pgn"], "application/x-chrome-extension": ["crx"], "application/x-cocoa": ["cco"], "application/x-conference": ["nsc"], "application/x-cpio": ["cpio"], "application/x-csh": ["csh"], "application/x-debian-package": ["*deb", "udeb"], "application/x-dgc-compressed": ["dgc"], "application/x-director": ["dir", "dcr", "dxr", "cst", "cct", "cxt", "w3d", "fgd", "swa"], "application/x-doom": ["wad"], "application/x-dtbncx+xml": ["ncx"], "application/x-dtbook+xml": ["dtb"], "application/x-dtbresource+xml": ["res"], "application/x-dvi": ["dvi"], "application/x-envoy": ["evy"], "application/x-eva": ["eva"], "application/x-font-bdf": ["bdf"], "application/x-font-ghostscript": ["gsf"], "application/x-font-linux-psf": ["psf"], "application/x-font-pcf": ["pcf"], "application/x-font-snf": ["snf"], "application/x-font-type1": ["pfa", "pfb", "pfm", "afm"], "application/x-freearc": ["arc"], "application/x-futuresplash": ["spl"], "application/x-gca-compressed": ["gca"], "application/x-glulx": ["ulx"], "application/x-gnumeric": ["gnumeric"], "application/x-gramps-xml": ["gramps"], "application/x-gtar": ["gtar"], "application/x-hdf": ["hdf"], "application/x-httpd-php": ["php"], "application/x-install-instructions": ["install"], "application/x-iso9660-image": ["*iso"], "application/x-iwork-keynote-sffkey": ["*key"], "application/x-iwork-numbers-sffnumbers": ["*numbers"], "application/x-iwork-pages-sffpages": ["*pages"], "application/x-java-archive-diff": ["jardiff"], "application/x-java-jnlp-file": ["jnlp"], "application/x-keepass2": ["kdbx"], "application/x-latex": ["latex"], "application/x-lua-bytecode": ["luac"], "application/x-lzh-compressed": ["lzh", "lha"], "application/x-makeself": ["run"], "application/x-mie": ["mie"], "application/x-mobipocket-ebook": ["prc", "mobi"], "application/x-ms-application": ["application"], "application/x-ms-shortcut": ["lnk"], "application/x-ms-wmd": ["wmd"], "application/x-ms-wmz": ["wmz"], "application/x-ms-xbap": ["xbap"], "application/x-msaccess": ["mdb"], "application/x-msbinder": ["obd"], "application/x-mscardfile": ["crd"], "application/x-msclip": ["clp"], "application/x-msdos-program": ["*exe"], "application/x-msdownload": ["*exe", "*dll", "com", "bat", "*msi"], "application/x-msmediaview": ["mvb", "m13", "m14"], "application/x-msmetafile": ["*wmf", "*wmz", "*emf", "emz"], "application/x-msmoney": ["mny"], "application/x-mspublisher": ["pub"], "application/x-msschedule": ["scd"], "application/x-msterminal": ["trm"], "application/x-mswrite": ["wri"], "application/x-netcdf": ["nc", "cdf"], "application/x-ns-proxy-autoconfig": ["pac"], "application/x-nzb": ["nzb"], "application/x-perl": ["pl", "pm"], "application/x-pilot": ["*prc", "*pdb"], "application/x-pkcs12": ["p12", "pfx"], "application/x-pkcs7-certificates": ["p7b", "spc"], "application/x-pkcs7-certreqresp": ["p7r"], "application/x-rar-compressed": ["*rar"], "application/x-redhat-package-manager": ["rpm"], "application/x-research-info-systems": ["ris"], "application/x-sea": ["sea"], "application/x-sh": ["sh"], "application/x-shar": ["shar"], "application/x-shockwave-flash": ["swf"], "application/x-silverlight-app": ["xap"], "application/x-sql": ["sql"], "application/x-stuffit": ["sit"], "application/x-stuffitx": ["sitx"], "application/x-subrip": ["srt"], "application/x-sv4cpio": ["sv4cpio"], "application/x-sv4crc": ["sv4crc"], "application/x-t3vm-image": ["t3"], "application/x-tads": ["gam"], "application/x-tar": ["tar"], "application/x-tcl": ["tcl", "tk"], "application/x-tex": ["tex"], "application/x-tex-tfm": ["tfm"], "application/x-texinfo": ["texinfo", "texi"], "application/x-tgif": ["*obj"], "application/x-ustar": ["ustar"], "application/x-virtualbox-hdd": ["hdd"], "application/x-virtualbox-ova": ["ova"], "application/x-virtualbox-ovf": ["ovf"], "application/x-virtualbox-vbox": ["vbox"], "application/x-virtualbox-vbox-extpack": ["vbox-extpack"], "application/x-virtualbox-vdi": ["vdi"], "application/x-virtualbox-vhd": ["vhd"], "application/x-virtualbox-vmdk": ["vmdk"], "application/x-wais-source": ["src"], "application/x-web-app-manifest+json": ["webapp"], "application/x-x509-ca-cert": ["der", "crt", "pem"], "application/x-xfig": ["fig"], "application/x-xliff+xml": ["*xlf"], "application/x-xpinstall": ["xpi"], "application/x-xz": ["xz"], "application/x-zmachine": ["z1", "z2", "z3", "z4", "z5", "z6", "z7", "z8"], "audio/vnd.dece.audio": ["uva", "uvva"], "audio/vnd.digital-winds": ["eol"], "audio/vnd.dra": ["dra"], "audio/vnd.dts": ["dts"], "audio/vnd.dts.hd": ["dtshd"], "audio/vnd.lucent.voice": ["lvp"], "audio/vnd.ms-playready.media.pya": ["pya"], "audio/vnd.nuera.ecelp4800": ["ecelp4800"], "audio/vnd.nuera.ecelp7470": ["ecelp7470"], "audio/vnd.nuera.ecelp9600": ["ecelp9600"], "audio/vnd.rip": ["rip"], "audio/x-aac": ["aac"], "audio/x-aiff": ["aif", "aiff", "aifc"], "audio/x-caf": ["caf"], "audio/x-flac": ["flac"], "audio/x-m4a": ["*m4a"], "audio/x-matroska": ["mka"], "audio/x-mpegurl": ["m3u"], "audio/x-ms-wax": ["wax"], "audio/x-ms-wma": ["wma"], "audio/x-pn-realaudio": ["ram", "ra"], "audio/x-pn-realaudio-plugin": ["rmp"], "audio/x-realaudio": ["*ra"], "audio/x-wav": ["*wav"], "chemical/x-cdx": ["cdx"], "chemical/x-cif": ["cif"], "chemical/x-cmdf": ["cmdf"], "chemical/x-cml": ["cml"], "chemical/x-csml": ["csml"], "chemical/x-xyz": ["xyz"], "image/prs.btif": ["btif"], "image/prs.pti": ["pti"], "image/vnd.adobe.photoshop": ["psd"], "image/vnd.airzip.accelerator.azv": ["azv"], "image/vnd.dece.graphic": ["uvi", "uvvi", "uvg", "uvvg"], "image/vnd.djvu": ["djvu", "djv"], "image/vnd.dvb.subtitle": ["*sub"], "image/vnd.dwg": ["dwg"], "image/vnd.dxf": ["dxf"], "image/vnd.fastbidsheet": ["fbs"], "image/vnd.fpx": ["fpx"], "image/vnd.fst": ["fst"], "image/vnd.fujixerox.edmics-mmr": ["mmr"], "image/vnd.fujixerox.edmics-rlc": ["rlc"], "image/vnd.microsoft.icon": ["ico"], "image/vnd.ms-dds": ["dds"], "image/vnd.ms-modi": ["mdi"], "image/vnd.ms-photo": ["wdp"], "image/vnd.net-fpx": ["npx"], "image/vnd.pco.b16": ["b16"], "image/vnd.tencent.tap": ["tap"], "image/vnd.valve.source.texture": ["vtf"], "image/vnd.wap.wbmp": ["wbmp"], "image/vnd.xiff": ["xif"], "image/vnd.zbrush.pcx": ["pcx"], "image/x-3ds": ["3ds"], "image/x-cmu-raster": ["ras"], "image/x-cmx": ["cmx"], "image/x-freehand": ["fh", "fhc", "fh4", "fh5", "fh7"], "image/x-icon": ["*ico"], "image/x-jng": ["jng"], "image/x-mrsid-image": ["sid"], "image/x-ms-bmp": ["*bmp"], "image/x-pcx": ["*pcx"], "image/x-pict": ["pic", "pct"], "image/x-portable-anymap": ["pnm"], "image/x-portable-bitmap": ["pbm"], "image/x-portable-graymap": ["pgm"], "image/x-portable-pixmap": ["ppm"], "image/x-rgb": ["rgb"], "image/x-tga": ["tga"], "image/x-xbitmap": ["xbm"], "image/x-xpixmap": ["xpm"], "image/x-xwindowdump": ["xwd"], "message/vnd.wfa.wsc": ["wsc"], "model/vnd.collada+xml": ["dae"], "model/vnd.dwf": ["dwf"], "model/vnd.gdl": ["gdl"], "model/vnd.gtw": ["gtw"], "model/vnd.mts": ["mts"], "model/vnd.opengex": ["ogex"], "model/vnd.parasolid.transmit.binary": ["x_b"], "model/vnd.parasolid.transmit.text": ["x_t"], "model/vnd.sap.vds": ["vds"], "model/vnd.usdz+zip": ["usdz"], "model/vnd.valve.source.compiled-map": ["bsp"], "model/vnd.vtu": ["vtu"], "text/prs.lines.tag": ["dsc"], "text/vnd.curl": ["curl"], "text/vnd.curl.dcurl": ["dcurl"], "text/vnd.curl.mcurl": ["mcurl"], "text/vnd.curl.scurl": ["scurl"], "text/vnd.dvb.subtitle": ["sub"], "text/vnd.fly": ["fly"], "text/vnd.fmi.flexstor": ["flx"], "text/vnd.graphviz": ["gv"], "text/vnd.in3d.3dml": ["3dml"], "text/vnd.in3d.spot": ["spot"], "text/vnd.sun.j2me.app-descriptor": ["jad"], "text/vnd.wap.wml": ["wml"], "text/vnd.wap.wmlscript": ["wmls"], "text/x-asm": ["s", "asm"], "text/x-c": ["c", "cc", "cxx", "cpp", "h", "hh", "dic"], "text/x-component": ["htc"], "text/x-fortran": ["f", "for", "f77", "f90"], "text/x-handlebars-template": ["hbs"], "text/x-java-source": ["java"], "text/x-lua": ["lua"], "text/x-markdown": ["mkd"], "text/x-nfo": ["nfo"], "text/x-opml": ["opml"], "text/x-org": ["*org"], "text/x-pascal": ["p", "pas"], "text/x-processing": ["pde"], "text/x-sass": ["sass"], "text/x-scss": ["scss"], "text/x-setext": ["etx"], "text/x-sfv": ["sfv"], "text/x-suse-ymp": ["ymp"], "text/x-uuencode": ["uu"], "text/x-vcalendar": ["vcs"], "text/x-vcard": ["vcf"], "video/vnd.dece.hd": ["uvh", "uvvh"], "video/vnd.dece.mobile": ["uvm", "uvvm"], "video/vnd.dece.pd": ["uvp", "uvvp"], "video/vnd.dece.sd": ["uvs", "uvvs"], "video/vnd.dece.video": ["uvv", "uvvv"], "video/vnd.dvb.file": ["dvb"], "video/vnd.fvt": ["fvt"], "video/vnd.mpegurl": ["mxu", "m4u"], "video/vnd.ms-playready.media.pyv": ["pyv"], "video/vnd.uvvu.mp4": ["uvu", "uvvu"], "video/vnd.vivo": ["viv"], "video/x-f4v": ["f4v"], "video/x-fli": ["fli"], "video/x-flv": ["flv"], "video/x-m4v": ["m4v"], "video/x-matroska": ["mkv", "mk3d", "mks"], "video/x-mng": ["mng"], "video/x-ms-asf": ["asf", "asx"], "video/x-ms-vob": ["vob"], "video/x-ms-wm": ["wm"], "video/x-ms-wmv": ["wmv"], "video/x-ms-wmx": ["wmx"], "video/x-ms-wvx": ["wvx"], "video/x-msvideo": ["avi"], "video/x-sgi-movie": ["movie"], "video/x-smv": ["smv"], "x-conference/x-cooltalk": ["ice"] };
  }
});

// node_modules/mime/index.js
var require_mime = __commonJS({
  "node_modules/mime/index.js"(exports2, module2) {
    "use strict";
    var Mime = require_Mime();
    module2.exports = new Mime(require_standard(), require_other());
  }
});

// node_modules/concat-map/index.js
var require_concat_map = __commonJS({
  "node_modules/concat-map/index.js"(exports2, module2) {
    module2.exports = function(xs, fn) {
      var res = [];
      for (var i = 0; i < xs.length; i++) {
        var x = fn(xs[i], i);
        if (isArray(x)) res.push.apply(res, x);
        else res.push(x);
      }
      return res;
    };
    var isArray = Array.isArray || function(xs) {
      return Object.prototype.toString.call(xs) === "[object Array]";
    };
  }
});

// node_modules/balanced-match/index.js
var require_balanced_match = __commonJS({
  "node_modules/balanced-match/index.js"(exports2, module2) {
    "use strict";
    module2.exports = balanced;
    function balanced(a, b, str) {
      if (a instanceof RegExp) a = maybeMatch(a, str);
      if (b instanceof RegExp) b = maybeMatch(b, str);
      var r = range(a, b, str);
      return r && {
        start: r[0],
        end: r[1],
        pre: str.slice(0, r[0]),
        body: str.slice(r[0] + a.length, r[1]),
        post: str.slice(r[1] + b.length)
      };
    }
    function maybeMatch(reg, str) {
      var m = str.match(reg);
      return m ? m[0] : null;
    }
    balanced.range = range;
    function range(a, b, str) {
      var begs, beg, left, right, result2;
      var ai = str.indexOf(a);
      var bi = str.indexOf(b, ai + 1);
      var i = ai;
      if (ai >= 0 && bi > 0) {
        if (a === b) {
          return [ai, bi];
        }
        begs = [];
        left = str.length;
        while (i >= 0 && !result2) {
          if (i == ai) {
            begs.push(i);
            ai = str.indexOf(a, i + 1);
          } else if (begs.length == 1) {
            result2 = [begs.pop(), bi];
          } else {
            beg = begs.pop();
            if (beg < left) {
              left = beg;
              right = bi;
            }
            bi = str.indexOf(b, i + 1);
          }
          i = ai < bi && ai >= 0 ? ai : bi;
        }
        if (begs.length) {
          result2 = [left, right];
        }
      }
      return result2;
    }
  }
});

// node_modules/brace-expansion/index.js
var require_brace_expansion = __commonJS({
  "node_modules/brace-expansion/index.js"(exports2, module2) {
    var concatMap = require_concat_map();
    var balanced = require_balanced_match();
    module2.exports = expandTop;
    var escSlash = "\0SLASH" + Math.random() + "\0";
    var escOpen = "\0OPEN" + Math.random() + "\0";
    var escClose = "\0CLOSE" + Math.random() + "\0";
    var escComma = "\0COMMA" + Math.random() + "\0";
    var escPeriod = "\0PERIOD" + Math.random() + "\0";
    function numeric(str) {
      return parseInt(str, 10) == str ? parseInt(str, 10) : str.charCodeAt(0);
    }
    function escapeBraces(str) {
      return str.split("\\\\").join(escSlash).split("\\{").join(escOpen).split("\\}").join(escClose).split("\\,").join(escComma).split("\\.").join(escPeriod);
    }
    function unescapeBraces(str) {
      return str.split(escSlash).join("\\").split(escOpen).join("{").split(escClose).join("}").split(escComma).join(",").split(escPeriod).join(".");
    }
    function parseCommaParts(str) {
      if (!str)
        return [""];
      var parts = [];
      var m = balanced("{", "}", str);
      if (!m)
        return str.split(",");
      var pre = m.pre;
      var body = m.body;
      var post = m.post;
      var p = pre.split(",");
      p[p.length - 1] += "{" + body + "}";
      var postParts = parseCommaParts(post);
      if (post.length) {
        p[p.length - 1] += postParts.shift();
        p.push.apply(p, postParts);
      }
      parts.push.apply(parts, p);
      return parts;
    }
    function expandTop(str) {
      if (!str)
        return [];
      if (str.substr(0, 2) === "{}") {
        str = "\\{\\}" + str.substr(2);
      }
      return expand(escapeBraces(str), true).map(unescapeBraces);
    }
    function embrace(str) {
      return "{" + str + "}";
    }
    function isPadded(el) {
      return /^-?0\d/.test(el);
    }
    function lte(i, y) {
      return i <= y;
    }
    function gte(i, y) {
      return i >= y;
    }
    function expand(str, isTop) {
      var expansions = [];
      var m = balanced("{", "}", str);
      if (!m || /\$$/.test(m.pre)) return [str];
      var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
      var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
      var isSequence = isNumericSequence || isAlphaSequence;
      var isOptions = m.body.indexOf(",") >= 0;
      if (!isSequence && !isOptions) {
        if (m.post.match(/,(?!,).*\}/)) {
          str = m.pre + "{" + m.body + escClose + m.post;
          return expand(str);
        }
        return [str];
      }
      var n;
      if (isSequence) {
        n = m.body.split(/\.\./);
      } else {
        n = parseCommaParts(m.body);
        if (n.length === 1) {
          n = expand(n[0], false).map(embrace);
          if (n.length === 1) {
            var post = m.post.length ? expand(m.post, false) : [""];
            return post.map(function(p) {
              return m.pre + n[0] + p;
            });
          }
        }
      }
      var pre = m.pre;
      var post = m.post.length ? expand(m.post, false) : [""];
      var N;
      if (isSequence) {
        var x = numeric(n[0]);
        var y = numeric(n[1]);
        var width = Math.max(n[0].length, n[1].length);
        var incr = n.length == 3 ? Math.abs(numeric(n[2])) : 1;
        var test = lte;
        var reverse = y < x;
        if (reverse) {
          incr *= -1;
          test = gte;
        }
        var pad = n.some(isPadded);
        N = [];
        for (var i = x; test(i, y); i += incr) {
          var c;
          if (isAlphaSequence) {
            c = String.fromCharCode(i);
            if (c === "\\")
              c = "";
          } else {
            c = String(i);
            if (pad) {
              var need = width - c.length;
              if (need > 0) {
                var z = new Array(need + 1).join("0");
                if (i < 0)
                  c = "-" + z + c.slice(1);
                else
                  c = z + c;
              }
            }
          }
          N.push(c);
        }
      } else {
        N = concatMap(n, function(el) {
          return expand(el, false);
        });
      }
      for (var j = 0; j < N.length; j++) {
        for (var k = 0; k < post.length; k++) {
          var expansion = pre + N[j] + post[k];
          if (!isTop || isSequence || expansion)
            expansions.push(expansion);
        }
      }
      return expansions;
    }
  }
});

// node_modules/minimatch/minimatch.js
var require_minimatch = __commonJS({
  "node_modules/minimatch/minimatch.js"(exports2, module2) {
    module2.exports = minimatch2;
    minimatch2.Minimatch = Minimatch;
    var path6 = (function() {
      try {
        return require("path");
      } catch (e) {
      }
    })() || {
      sep: "/"
    };
    minimatch2.sep = path6.sep;
    var GLOBSTAR = minimatch2.GLOBSTAR = Minimatch.GLOBSTAR = {};
    var expand = require_brace_expansion();
    var plTypes = {
      "!": { open: "(?:(?!(?:", close: "))[^/]*?)" },
      "?": { open: "(?:", close: ")?" },
      "+": { open: "(?:", close: ")+" },
      "*": { open: "(?:", close: ")*" },
      "@": { open: "(?:", close: ")" }
    };
    var qmark = "[^/]";
    var star = qmark + "*?";
    var twoStarDot = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?";
    var twoStarNoDot = "(?:(?!(?:\\/|^)\\.).)*?";
    var reSpecials = charSet("().*{}+?[]^$\\!");
    function charSet(s) {
      return s.split("").reduce(function(set, c) {
        set[c] = true;
        return set;
      }, {});
    }
    var slashSplit = /\/+/;
    minimatch2.filter = filter;
    function filter(pattern, options) {
      options = options || {};
      return function(p, i, list) {
        return minimatch2(p, pattern, options);
      };
    }
    function ext(a, b) {
      b = b || {};
      var t = {};
      Object.keys(a).forEach(function(k) {
        t[k] = a[k];
      });
      Object.keys(b).forEach(function(k) {
        t[k] = b[k];
      });
      return t;
    }
    minimatch2.defaults = function(def) {
      if (!def || typeof def !== "object" || !Object.keys(def).length) {
        return minimatch2;
      }
      var orig = minimatch2;
      var m = function minimatch3(p, pattern, options) {
        return orig(p, pattern, ext(def, options));
      };
      m.Minimatch = function Minimatch2(pattern, options) {
        return new orig.Minimatch(pattern, ext(def, options));
      };
      m.Minimatch.defaults = function defaults(options) {
        return orig.defaults(ext(def, options)).Minimatch;
      };
      m.filter = function filter2(pattern, options) {
        return orig.filter(pattern, ext(def, options));
      };
      m.defaults = function defaults(options) {
        return orig.defaults(ext(def, options));
      };
      m.makeRe = function makeRe2(pattern, options) {
        return orig.makeRe(pattern, ext(def, options));
      };
      m.braceExpand = function braceExpand2(pattern, options) {
        return orig.braceExpand(pattern, ext(def, options));
      };
      m.match = function(list, pattern, options) {
        return orig.match(list, pattern, ext(def, options));
      };
      return m;
    };
    Minimatch.defaults = function(def) {
      return minimatch2.defaults(def).Minimatch;
    };
    function minimatch2(p, pattern, options) {
      assertValidPattern(pattern);
      if (!options) options = {};
      if (!options.nocomment && pattern.charAt(0) === "#") {
        return false;
      }
      return new Minimatch(pattern, options).match(p);
    }
    function Minimatch(pattern, options) {
      if (!(this instanceof Minimatch)) {
        return new Minimatch(pattern, options);
      }
      assertValidPattern(pattern);
      if (!options) options = {};
      pattern = pattern.trim();
      if (!options.allowWindowsEscape && path6.sep !== "/") {
        pattern = pattern.split(path6.sep).join("/");
      }
      this.options = options;
      this.maxGlobstarRecursion = options.maxGlobstarRecursion !== void 0 ? options.maxGlobstarRecursion : 200;
      this.set = [];
      this.pattern = pattern;
      this.regexp = null;
      this.negate = false;
      this.comment = false;
      this.empty = false;
      this.partial = !!options.partial;
      this.make();
    }
    Minimatch.prototype.debug = function() {
    };
    Minimatch.prototype.make = make;
    function make() {
      var pattern = this.pattern;
      var options = this.options;
      if (!options.nocomment && pattern.charAt(0) === "#") {
        this.comment = true;
        return;
      }
      if (!pattern) {
        this.empty = true;
        return;
      }
      this.parseNegate();
      var set = this.globSet = this.braceExpand();
      if (options.debug) this.debug = function debug2() {
        console.error.apply(console, arguments);
      };
      this.debug(this.pattern, set);
      set = this.globParts = set.map(function(s) {
        return s.split(slashSplit);
      });
      this.debug(this.pattern, set);
      set = set.map(function(s, si, set2) {
        return s.map(this.parse, this);
      }, this);
      this.debug(this.pattern, set);
      set = set.filter(function(s) {
        return s.indexOf(false) === -1;
      });
      this.debug(this.pattern, set);
      this.set = set;
    }
    Minimatch.prototype.parseNegate = parseNegate;
    function parseNegate() {
      var pattern = this.pattern;
      var negate = false;
      var options = this.options;
      var negateOffset = 0;
      if (options.nonegate) return;
      for (var i = 0, l = pattern.length; i < l && pattern.charAt(i) === "!"; i++) {
        negate = !negate;
        negateOffset++;
      }
      if (negateOffset) this.pattern = pattern.substr(negateOffset);
      this.negate = negate;
    }
    minimatch2.braceExpand = function(pattern, options) {
      return braceExpand(pattern, options);
    };
    Minimatch.prototype.braceExpand = braceExpand;
    function braceExpand(pattern, options) {
      if (!options) {
        if (this instanceof Minimatch) {
          options = this.options;
        } else {
          options = {};
        }
      }
      pattern = typeof pattern === "undefined" ? this.pattern : pattern;
      assertValidPattern(pattern);
      if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) {
        return [pattern];
      }
      return expand(pattern);
    }
    var MAX_PATTERN_LENGTH = 1024 * 64;
    var assertValidPattern = function(pattern) {
      if (typeof pattern !== "string") {
        throw new TypeError("invalid pattern");
      }
      if (pattern.length > MAX_PATTERN_LENGTH) {
        throw new TypeError("pattern is too long");
      }
    };
    Minimatch.prototype.parse = parse;
    var SUBPARSE = {};
    function parse(pattern, isSub) {
      assertValidPattern(pattern);
      var options = this.options;
      if (pattern === "**") {
        if (!options.noglobstar)
          return GLOBSTAR;
        else
          pattern = "*";
      }
      if (pattern === "") return "";
      var re2 = "";
      var hasMagic = !!options.nocase;
      var escaping = false;
      var patternListStack = [];
      var negativeLists = [];
      var stateChar;
      var inClass = false;
      var reClassStart = -1;
      var classStart = -1;
      var patternStart = pattern.charAt(0) === "." ? "" : options.dot ? "(?!(?:^|\\/)\\.{1,2}(?:$|\\/))" : "(?!\\.)";
      var self = this;
      function clearStateChar() {
        if (stateChar) {
          switch (stateChar) {
            case "*":
              re2 += star;
              hasMagic = true;
              break;
            case "?":
              re2 += qmark;
              hasMagic = true;
              break;
            default:
              re2 += "\\" + stateChar;
              break;
          }
          self.debug("clearStateChar %j %j", stateChar, re2);
          stateChar = false;
        }
      }
      for (var i = 0, len = pattern.length, c; i < len && (c = pattern.charAt(i)); i++) {
        this.debug("%s	%s %s %j", pattern, i, re2, c);
        if (escaping && reSpecials[c]) {
          re2 += "\\" + c;
          escaping = false;
          continue;
        }
        switch (c) {
          /* istanbul ignore next */
          case "/": {
            return false;
          }
          case "\\":
            clearStateChar();
            escaping = true;
            continue;
          // the various stateChar values
          // for the "extglob" stuff.
          case "?":
          case "*":
          case "+":
          case "@":
          case "!":
            this.debug("%s	%s %s %j <-- stateChar", pattern, i, re2, c);
            if (inClass) {
              this.debug("  in class");
              if (c === "!" && i === classStart + 1) c = "^";
              re2 += c;
              continue;
            }
            if (c === "*" && stateChar === "*") continue;
            self.debug("call clearStateChar %j", stateChar);
            clearStateChar();
            stateChar = c;
            if (options.noext) clearStateChar();
            continue;
          case "(":
            if (inClass) {
              re2 += "(";
              continue;
            }
            if (!stateChar) {
              re2 += "\\(";
              continue;
            }
            patternListStack.push({
              type: stateChar,
              start: i - 1,
              reStart: re2.length,
              open: plTypes[stateChar].open,
              close: plTypes[stateChar].close
            });
            re2 += stateChar === "!" ? "(?:(?!(?:" : "(?:";
            this.debug("plType %j %j", stateChar, re2);
            stateChar = false;
            continue;
          case ")":
            if (inClass || !patternListStack.length) {
              re2 += "\\)";
              continue;
            }
            clearStateChar();
            hasMagic = true;
            var pl = patternListStack.pop();
            re2 += pl.close;
            if (pl.type === "!") {
              negativeLists.push(pl);
            }
            pl.reEnd = re2.length;
            continue;
          case "|":
            if (inClass || !patternListStack.length || escaping) {
              re2 += "\\|";
              escaping = false;
              continue;
            }
            clearStateChar();
            re2 += "|";
            continue;
          // these are mostly the same in regexp and glob
          case "[":
            clearStateChar();
            if (inClass) {
              re2 += "\\" + c;
              continue;
            }
            inClass = true;
            classStart = i;
            reClassStart = re2.length;
            re2 += c;
            continue;
          case "]":
            if (i === classStart + 1 || !inClass) {
              re2 += "\\" + c;
              escaping = false;
              continue;
            }
            var cs = pattern.substring(classStart + 1, i);
            try {
              RegExp("[" + cs + "]");
            } catch (er) {
              var sp = this.parse(cs, SUBPARSE);
              re2 = re2.substr(0, reClassStart) + "\\[" + sp[0] + "\\]";
              hasMagic = hasMagic || sp[1];
              inClass = false;
              continue;
            }
            hasMagic = true;
            inClass = false;
            re2 += c;
            continue;
          default:
            clearStateChar();
            if (escaping) {
              escaping = false;
            } else if (reSpecials[c] && !(c === "^" && inClass)) {
              re2 += "\\";
            }
            re2 += c;
        }
      }
      if (inClass) {
        cs = pattern.substr(classStart + 1);
        sp = this.parse(cs, SUBPARSE);
        re2 = re2.substr(0, reClassStart) + "\\[" + sp[0];
        hasMagic = hasMagic || sp[1];
      }
      for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) {
        var tail = re2.slice(pl.reStart + pl.open.length);
        this.debug("setting tail", re2, pl);
        tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, function(_, $1, $2) {
          if (!$2) {
            $2 = "\\";
          }
          return $1 + $1 + $2 + "|";
        });
        this.debug("tail=%j\n   %s", tail, tail, pl, re2);
        var t = pl.type === "*" ? star : pl.type === "?" ? qmark : "\\" + pl.type;
        hasMagic = true;
        re2 = re2.slice(0, pl.reStart) + t + "\\(" + tail;
      }
      clearStateChar();
      if (escaping) {
        re2 += "\\\\";
      }
      var addPatternStart = false;
      switch (re2.charAt(0)) {
        case "[":
        case ".":
        case "(":
          addPatternStart = true;
      }
      for (var n = negativeLists.length - 1; n > -1; n--) {
        var nl = negativeLists[n];
        var nlBefore = re2.slice(0, nl.reStart);
        var nlFirst = re2.slice(nl.reStart, nl.reEnd - 8);
        var nlLast = re2.slice(nl.reEnd - 8, nl.reEnd);
        var nlAfter = re2.slice(nl.reEnd);
        nlLast += nlAfter;
        var openParensBefore = nlBefore.split("(").length - 1;
        var cleanAfter = nlAfter;
        for (i = 0; i < openParensBefore; i++) {
          cleanAfter = cleanAfter.replace(/\)[+*?]?/, "");
        }
        nlAfter = cleanAfter;
        var dollar = "";
        if (nlAfter === "" && isSub !== SUBPARSE) {
          dollar = "$";
        }
        var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast;
        re2 = newRe;
      }
      if (re2 !== "" && hasMagic) {
        re2 = "(?=.)" + re2;
      }
      if (addPatternStart) {
        re2 = patternStart + re2;
      }
      if (isSub === SUBPARSE) {
        return [re2, hasMagic];
      }
      if (!hasMagic) {
        return globUnescape(pattern);
      }
      var flags = options.nocase ? "i" : "";
      try {
        var regExp = new RegExp("^" + re2 + "$", flags);
      } catch (er) {
        return new RegExp("$.");
      }
      regExp._glob = pattern;
      regExp._src = re2;
      return regExp;
    }
    minimatch2.makeRe = function(pattern, options) {
      return new Minimatch(pattern, options || {}).makeRe();
    };
    Minimatch.prototype.makeRe = makeRe;
    function makeRe() {
      if (this.regexp || this.regexp === false) return this.regexp;
      var set = this.set;
      if (!set.length) {
        this.regexp = false;
        return this.regexp;
      }
      var options = this.options;
      var twoStar = options.noglobstar ? star : options.dot ? twoStarDot : twoStarNoDot;
      var flags = options.nocase ? "i" : "";
      var re2 = set.map(function(pattern) {
        return pattern.map(function(p) {
          return p === GLOBSTAR ? twoStar : typeof p === "string" ? regExpEscape(p) : p._src;
        }).join("\\/");
      }).join("|");
      re2 = "^(?:" + re2 + ")$";
      if (this.negate) re2 = "^(?!" + re2 + ").*$";
      try {
        this.regexp = new RegExp(re2, flags);
      } catch (ex) {
        this.regexp = false;
      }
      return this.regexp;
    }
    minimatch2.match = function(list, pattern, options) {
      options = options || {};
      var mm = new Minimatch(pattern, options);
      list = list.filter(function(f) {
        return mm.match(f);
      });
      if (mm.options.nonull && !list.length) {
        list.push(pattern);
      }
      return list;
    };
    Minimatch.prototype.match = function match(f, partial) {
      if (typeof partial === "undefined") partial = this.partial;
      this.debug("match", f, this.pattern);
      if (this.comment) return false;
      if (this.empty) return f === "";
      if (f === "/" && partial) return true;
      var options = this.options;
      if (path6.sep !== "/") {
        f = f.split(path6.sep).join("/");
      }
      f = f.split(slashSplit);
      this.debug(this.pattern, "split", f);
      var set = this.set;
      this.debug(this.pattern, "set", set);
      var filename;
      var i;
      for (i = f.length - 1; i >= 0; i--) {
        filename = f[i];
        if (filename) break;
      }
      for (i = 0; i < set.length; i++) {
        var pattern = set[i];
        var file2 = f;
        if (options.matchBase && pattern.length === 1) {
          file2 = [filename];
        }
        var hit = this.matchOne(file2, pattern, partial);
        if (hit) {
          if (options.flipNegate) return true;
          return !this.negate;
        }
      }
      if (options.flipNegate) return false;
      return this.negate;
    };
    Minimatch.prototype.matchOne = function(file2, pattern, partial) {
      if (pattern.indexOf(GLOBSTAR) !== -1) {
        return this._matchGlobstar(file2, pattern, partial, 0, 0);
      }
      return this._matchOne(file2, pattern, partial, 0, 0);
    };
    Minimatch.prototype._matchGlobstar = function(file2, pattern, partial, fileIndex, patternIndex) {
      var i;
      var firstgs = -1;
      for (i = patternIndex; i < pattern.length; i++) {
        if (pattern[i] === GLOBSTAR) {
          firstgs = i;
          break;
        }
      }
      var lastgs = -1;
      for (i = pattern.length - 1; i >= 0; i--) {
        if (pattern[i] === GLOBSTAR) {
          lastgs = i;
          break;
        }
      }
      var head = pattern.slice(patternIndex, firstgs);
      var body = partial ? pattern.slice(firstgs + 1) : pattern.slice(firstgs + 1, lastgs);
      var tail = partial ? [] : pattern.slice(lastgs + 1);
      if (head.length) {
        var fileHead = file2.slice(fileIndex, fileIndex + head.length);
        if (!this._matchOne(fileHead, head, partial, 0, 0)) {
          return false;
        }
        fileIndex += head.length;
      }
      var fileTailMatch = 0;
      if (tail.length) {
        if (tail.length + fileIndex > file2.length) return false;
        var tailStart = file2.length - tail.length;
        if (this._matchOne(file2, tail, partial, tailStart, 0)) {
          fileTailMatch = tail.length;
        } else {
          if (file2[file2.length - 1] !== "" || fileIndex + tail.length === file2.length) {
            return false;
          }
          tailStart--;
          if (!this._matchOne(file2, tail, partial, tailStart, 0)) {
            return false;
          }
          fileTailMatch = tail.length + 1;
        }
      }
      if (!body.length) {
        var sawSome = !!fileTailMatch;
        for (i = fileIndex; i < file2.length - fileTailMatch; i++) {
          var f = String(file2[i]);
          sawSome = true;
          if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") {
            return false;
          }
        }
        return partial || sawSome;
      }
      var bodySegments = [[[], 0]];
      var currentBody = bodySegments[0];
      var nonGsParts = 0;
      var nonGsPartsSums = [0];
      for (var bi = 0; bi < body.length; bi++) {
        var b = body[bi];
        if (b === GLOBSTAR) {
          nonGsPartsSums.push(nonGsParts);
          currentBody = [[], 0];
          bodySegments.push(currentBody);
        } else {
          currentBody[0].push(b);
          nonGsParts++;
        }
      }
      var idx = bodySegments.length - 1;
      var fileLength = file2.length - fileTailMatch;
      for (var si = 0; si < bodySegments.length; si++) {
        bodySegments[si][1] = fileLength - (nonGsPartsSums[idx--] + bodySegments[si][0].length);
      }
      return !!this._matchGlobStarBodySections(
        file2,
        bodySegments,
        fileIndex,
        0,
        partial,
        0,
        !!fileTailMatch
      );
    };
    Minimatch.prototype._matchGlobStarBodySections = function(file2, bodySegments, fileIndex, bodyIndex, partial, globStarDepth, sawTail) {
      var bs = bodySegments[bodyIndex];
      if (!bs) {
        for (var i = fileIndex; i < file2.length; i++) {
          sawTail = true;
          var f = file2[i];
          if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") {
            return false;
          }
        }
        return sawTail;
      }
      var body = bs[0];
      var after = bs[1];
      while (fileIndex <= after) {
        var m = this._matchOne(
          file2.slice(0, fileIndex + body.length),
          body,
          partial,
          fileIndex,
          0
        );
        if (m && globStarDepth < this.maxGlobstarRecursion) {
          var sub = this._matchGlobStarBodySections(
            file2,
            bodySegments,
            fileIndex + body.length,
            bodyIndex + 1,
            partial,
            globStarDepth + 1,
            sawTail
          );
          if (sub !== false) {
            return sub;
          }
        }
        var f = file2[fileIndex];
        if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") {
          return false;
        }
        fileIndex++;
      }
      return partial || null;
    };
    Minimatch.prototype._matchOne = function(file2, pattern, partial, fileIndex, patternIndex) {
      var fi, pi, fl, pl;
      for (fi = fileIndex, pi = patternIndex, fl = file2.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
        this.debug("matchOne loop");
        var p = pattern[pi];
        var f = file2[fi];
        this.debug(pattern, p, f);
        if (p === false || p === GLOBSTAR) return false;
        var hit;
        if (typeof p === "string") {
          hit = f === p;
          this.debug("string match", p, f, hit);
        } else {
          hit = f.match(p);
          this.debug("pattern match", p, f, hit);
        }
        if (!hit) return false;
      }
      if (fi === fl && pi === pl) {
        return true;
      } else if (fi === fl) {
        return partial;
      } else if (pi === pl) {
        return fi === fl - 1 && file2[fi] === "";
      }
      throw new Error("wtf?");
    };
    function globUnescape(s) {
      return s.replace(/\\(.)/g, "$1");
    }
    function regExpEscape(s) {
      return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
    }
  }
});

// packages/playwright/src/transform/esmLoader.ts
var import_fs6 = __toESM(require("fs"));
var import_url3 = __toESM(require("url"));

// packages/playwright/src/transform/compilationCache.ts
var import_fs = __toESM(require("fs"));
var import_os = __toESM(require("os"));
var import_path = __toESM(require("path"));
var import_source_map_support = __toESM(require_source_map_support());

// packages/utils/crypto.ts
var import_crypto = __toESM(require("crypto"));
function calculateSha1(buffer) {
  const hash = import_crypto.default.createHash("sha1");
  hash.update(buffer);
  return hash.digest("hex");
}

// packages/utils/env.ts
function getFromENV(name) {
  let value = process.env[name];
  value = value === void 0 ? process.env[`npm_config_${name.toLowerCase()}`] : value;
  value = value === void 0 ? process.env[`npm_package_config_${name.toLowerCase()}`] : value;
  return value;
}
function getAsBooleanFromENV(name, defaultValue) {
  const value = getFromENV(name);
  if (value === "false" || value === "0")
    return false;
  if (value)
    return true;
  return !!defaultValue;
}

// packages/utils/debug.ts
var _debugMode = getFromENV("PWDEBUG") || "";
var _isUnderTest = getAsBooleanFromENV("PWTEST_UNDER_TEST");
function isUnderTest() {
  return _isUnderTest;
}

// packages/playwright/src/transform/compilationCache.ts
var import_globals = require("../globals");
var import_package = require("../package");
var cacheDir = process.env.PWTEST_CACHE_DIR || (() => {
  if (process.platform === "win32")
    return import_path.default.join(import_os.default.tmpdir(), `playwright-transform-cache`);
  return import_path.default.join(import_os.default.tmpdir(), `playwright-transform-cache-` + process.geteuid?.());
})();
var sourceMaps = /* @__PURE__ */ new Map();
var memoryCache = /* @__PURE__ */ new Map();
var fileDependencies = /* @__PURE__ */ new Map();
var externalDependencies = /* @__PURE__ */ new Map();
var devSourceInfix = import_path.default.sep + "playwright" + import_path.default.sep + "packages" + import_path.default.sep;
function installSourceMapSupport() {
  Error.stackTraceLimit = 200;
  import_source_map_support.default.install({
    environment: "node",
    handleUncaughtExceptions: false,
    retrieveSourceMap(source) {
      if (!process.env.PWDEBUGIMPL && isUnderTest() && source.includes(devSourceInfix))
        return { map: identitySourceMap(source), url: source };
      if (!sourceMaps.has(source))
        return null;
      const sourceMapPath = sourceMaps.get(source);
      try {
        return {
          map: JSON.parse(import_fs.default.readFileSync(sourceMapPath, "utf-8")),
          url: source
        };
      } catch {
        return null;
      }
    }
  });
}
function identitySourceMap(source) {
  const lineCount = import_fs.default.readFileSync(source, "utf8").split("\n").length;
  return {
    version: 3,
    sources: [source],
    mappings: lineCount ? "AAAA" + ";AACA".repeat(lineCount - 1) : ""
  };
}
function _innerAddToCompilationCacheAndSerialize(filename, entry) {
  sourceMaps.set(entry.moduleUrl || filename, entry.sourceMapPath);
  memoryCache.set(filename, entry);
  return {
    sourceMaps: [[entry.moduleUrl || filename, entry.sourceMapPath]],
    memoryCache: [[filename, entry]],
    fileDependencies: [],
    externalDependencies: []
  };
}
function getFromCompilationCache(filename, contentHash, moduleUrl) {
  const cache = memoryCache.get(filename);
  if (cache?.codePath) {
    try {
      return { cachedCode: import_fs.default.readFileSync(cache.codePath, "utf-8") };
    } catch {
    }
  }
  const filePathHash = calculateFilePathHash(filename);
  const hashPrefix = filePathHash + "_" + contentHash.substring(0, 7);
  const cacheFolderName = filePathHash.substring(0, 2);
  const cachePath = calculateCachePath(filename, cacheFolderName, hashPrefix);
  const codePath = cachePath + ".js";
  const sourceMapPath = cachePath + ".map";
  const dataPath = cachePath + ".data";
  try {
    const cachedCode = import_fs.default.readFileSync(codePath, "utf8");
    const serializedCache = _innerAddToCompilationCacheAndSerialize(filename, { codePath, sourceMapPath, dataPath, moduleUrl });
    return { cachedCode, serializedCache };
  } catch {
  }
  return {
    addToCache: (code, map, data) => {
      if ((0, import_globals.isWorkerProcess)())
        return {};
      clearOldCacheEntries(cacheFolderName, filePathHash);
      import_fs.default.mkdirSync(import_path.default.dirname(cachePath), { recursive: true });
      if (map)
        import_fs.default.writeFileSync(sourceMapPath, JSON.stringify(map), "utf8");
      if (data.size)
        import_fs.default.writeFileSync(dataPath, JSON.stringify(Object.fromEntries(data.entries()), void 0, 2), "utf8");
      import_fs.default.writeFileSync(codePath, code, "utf8");
      const serializedCache = _innerAddToCompilationCacheAndSerialize(filename, { codePath, sourceMapPath, dataPath, moduleUrl });
      return { serializedCache };
    }
  };
}
function serializeCompilationCache() {
  return {
    sourceMaps: [...sourceMaps.entries()],
    memoryCache: [...memoryCache.entries()],
    fileDependencies: [...fileDependencies.entries()].map(([filename, deps]) => [filename, [...deps]]),
    externalDependencies: [...externalDependencies.entries()].map(([filename, deps]) => [filename, [...deps]])
  };
}
function addToCompilationCache(payload) {
  for (const entry of payload.sourceMaps)
    sourceMaps.set(entry[0], entry[1]);
  for (const entry of payload.memoryCache)
    memoryCache.set(entry[0], entry[1]);
  for (const entry of payload.fileDependencies) {
    const existing = fileDependencies.get(entry[0]) || [];
    fileDependencies.set(entry[0], /* @__PURE__ */ new Set([...entry[1], ...existing]));
  }
  for (const entry of payload.externalDependencies) {
    const existing = externalDependencies.get(entry[0]) || [];
    externalDependencies.set(entry[0], /* @__PURE__ */ new Set([...entry[1], ...existing]));
  }
}
function calculateFilePathHash(filePath) {
  return calculateSha1(filePath).substring(0, 10);
}
function calculateCachePath(filePath, cacheFolderName, hashPrefix) {
  const fileName2 = hashPrefix + "_" + import_path.default.basename(filePath, import_path.default.extname(filePath)).replace(/\W/g, "");
  return import_path.default.join(cacheDir, cacheFolderName, fileName2);
}
function clearOldCacheEntries(cacheFolderName, filePathHash) {
  const cachePath = import_path.default.join(cacheDir, cacheFolderName);
  try {
    const cachedRelevantFiles = import_fs.default.readdirSync(cachePath).filter((file2) => file2.startsWith(filePathHash));
    for (const file2 of cachedRelevantFiles)
      import_fs.default.rmSync(import_path.default.join(cachePath, file2), { force: true });
  } catch {
  }
}
var depsCollector2;
function startCollectingFileDeps() {
  depsCollector2 = /* @__PURE__ */ new Set();
}
function stopCollectingFileDeps(filename) {
  if (!depsCollector2)
    return;
  depsCollector2.delete(filename);
  for (const dep of depsCollector2) {
    if (belongsToNodeModules(dep))
      depsCollector2.delete(dep);
  }
  fileDependencies.set(filename, depsCollector2);
  depsCollector2 = void 0;
}
function currentFileDepsCollector() {
  return depsCollector2;
}
var kPlaywrightInternalPrefix = import_package.packageRoot;
function belongsToNodeModules(file2) {
  if (file2.includes(`${import_path.default.sep}node_modules${import_path.default.sep}`))
    return true;
  if (file2.startsWith(kPlaywrightInternalPrefix) && (file2.endsWith(".js") || file2.endsWith(".mjs")))
    return true;
  return false;
}

// packages/playwright/src/transform/portTransport.ts
var PortTransport = class {
  constructor(port, handler) {
    this._lastId = 0;
    this._callbacks = /* @__PURE__ */ new Map();
    this._port = port;
    port.addEventListener("message", async (event) => {
      const message = event.data;
      const { id, ackId, method, params, result: result2 } = message;
      if (ackId) {
        const callback = this._callbacks.get(ackId);
        this._callbacks.delete(ackId);
        this._resetRef();
        callback?.(result2);
        return;
      }
      const handlerResult = await handler(method, params);
      if (id)
        this._port.postMessage({ ackId: id, result: handlerResult });
    });
    this._resetRef();
  }
  post(method, params) {
    this._port.postMessage({ method, params });
  }
  async send(method, params) {
    return await new Promise((f) => {
      const id = ++this._lastId;
      this._callbacks.set(id, f);
      this._resetRef();
      this._port.postMessage({ id, method, params });
    });
  }
  _resetRef() {
    if (this._callbacks.size) {
      this._port.ref();
    } else {
      this._port.unref();
    }
  }
};

// packages/playwright/src/transform/transform.ts
var import_fs5 = __toESM(require("fs"));
var import_module2 = __toESM(require("module"));
var import_path5 = __toESM(require("path"));
var import_url2 = __toESM(require("url"));
var import_crypto5 = __toESM(require("crypto"));
var import_source_map_support2 = __toESM(require_source_map_support());

// packages/playwright/src/transform/tsconfig-loader.ts
var import_path2 = __toESM(require("path"));
var import_fs2 = __toESM(require("fs"));
var import_json5 = __toESM(require_lib());
function loadTsConfig(configPath) {
  try {
    const references = [];
    const config = innerLoadTsConfig(configPath, references);
    return [config, ...references];
  } catch (e) {
    throw new Error(`Failed to load tsconfig file at ${configPath}:
${e.message}`);
  }
}
function resolveConfigFile(baseConfigFile, referencedConfigFile) {
  if (!referencedConfigFile.endsWith(".json"))
    referencedConfigFile += ".json";
  const currentDir = import_path2.default.dirname(baseConfigFile);
  let resolvedConfigFile = import_path2.default.resolve(currentDir, referencedConfigFile);
  if (referencedConfigFile.includes("/") && referencedConfigFile.includes(".") && !import_fs2.default.existsSync(resolvedConfigFile))
    resolvedConfigFile = import_path2.default.join(currentDir, "node_modules", referencedConfigFile);
  return resolvedConfigFile;
}
function innerLoadTsConfig(configFilePath, references, visited = /* @__PURE__ */ new Map()) {
  if (visited.has(configFilePath))
    return visited.get(configFilePath);
  let result2 = {
    tsConfigPath: configFilePath
  };
  visited.set(configFilePath, result2);
  if (!import_fs2.default.existsSync(configFilePath))
    return result2;
  const configString = import_fs2.default.readFileSync(configFilePath, "utf-8");
  const cleanedJson = StripBom(configString);
  const parsedConfig = import_json5.default.parse(cleanedJson);
  const extendsArray = Array.isArray(parsedConfig.extends) ? parsedConfig.extends : parsedConfig.extends ? [parsedConfig.extends] : [];
  for (const extendedConfig of extendsArray) {
    const extendedConfigPath = resolveConfigFile(configFilePath, extendedConfig);
    const base = innerLoadTsConfig(extendedConfigPath, references, visited);
    Object.assign(result2, base, { tsConfigPath: configFilePath });
  }
  if (parsedConfig.compilerOptions?.allowJs !== void 0)
    result2.allowJs = parsedConfig.compilerOptions.allowJs;
  if (parsedConfig.compilerOptions?.paths !== void 0) {
    result2.paths = {
      mapping: parsedConfig.compilerOptions.paths,
      pathsBasePath: import_path2.default.dirname(configFilePath)
    };
  }
  if (parsedConfig.compilerOptions?.baseUrl !== void 0) {
    result2.absoluteBaseUrl = import_path2.default.resolve(import_path2.default.dirname(configFilePath), parsedConfig.compilerOptions.baseUrl);
  }
  for (const ref of parsedConfig.references || [])
    references.push(innerLoadTsConfig(resolveConfigFile(configFilePath, ref.path), references, visited));
  if (import_path2.default.basename(configFilePath) === "jsconfig.json" && result2.allowJs === void 0)
    result2.allowJs = true;
  return result2;
}
function StripBom(string) {
  if (typeof string !== "string") {
    throw new TypeError(`Expected a string, got ${typeof string}`);
  }
  if (string.charCodeAt(0) === 65279) {
    return string.slice(1);
  }
  return string;
}

// packages/playwright/src/transform/transform.ts
var import_package2 = require("../package");

// packages/playwright/src/util.ts
var import_fs3 = __toESM(require("fs"));
var import_path3 = __toESM(require("path"));
var import_debug2 = __toESM(require_src());
var import_mime = __toESM(require_mime());
var import_minimatch = __toESM(require_minimatch());

// packages/isomorphic/stringUtils.ts
var ansiRegex = new RegExp("([\\u001B\\u009B][[\\]()#?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)|(?:(?:\\d{0,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~])))", "g");

// packages/isomorphic/rtti.ts
function isRegExp(obj) {
  return obj instanceof RegExp || Object.prototype.toString.call(obj) === "[object RegExp]";
}

// packages/isomorphic/stackTrace.ts
var re = new RegExp(
  "^(?:\\s*at )?(?:(new) )?(?:(.*?) \\()?(?:eval at ([^ ]+) \\((.+?):(\\d+):(\\d+)\\), )?(?:(.+?):(\\d+):(\\d+)|(native))(\\)?)$"
);

// packages/playwright/src/util.ts
var PLAYWRIGHT_TEST_PATH = import_path3.default.join(__dirname, "..");
var PLAYWRIGHT_CORE_PATH = import_path3.default.dirname(require.resolve("playwright-core/package.json"));
function createFileMatcher(patterns) {
  const reList = [];
  const filePatterns = [];
  for (const pattern of Array.isArray(patterns) ? patterns : [patterns]) {
    if (isRegExp(pattern)) {
      reList.push(pattern);
    } else {
      if (!pattern.startsWith("**/"))
        filePatterns.push("**/" + pattern);
      else
        filePatterns.push(pattern);
    }
  }
  return (filePath) => {
    for (const re2 of reList) {
      re2.lastIndex = 0;
      if (re2.test(filePath))
        return true;
    }
    if (import_path3.default.sep === "\\") {
      const unixPath = filePath.split(import_path3.default.sep).join("/");
      for (const re2 of reList) {
        re2.lastIndex = 0;
        if (re2.test(unixPath))
          return true;
      }
    }
    for (const pattern of filePatterns) {
      if ((0, import_minimatch.default)(filePath, pattern, { nocase: true, dot: true }))
        return true;
    }
    return false;
  };
}
var debugTest = (0, import_debug2.default)("pw:test");
var folderToPackageJsonPath = /* @__PURE__ */ new Map();
function getPackageJsonPath(folderPath) {
  const cached = folderToPackageJsonPath.get(folderPath);
  if (cached !== void 0)
    return cached;
  const packageJsonPath = import_path3.default.join(folderPath, "package.json");
  if (import_fs3.default.existsSync(packageJsonPath)) {
    folderToPackageJsonPath.set(folderPath, packageJsonPath);
    return packageJsonPath;
  }
  const parentFolder = import_path3.default.dirname(folderPath);
  if (folderPath === parentFolder) {
    folderToPackageJsonPath.set(folderPath, "");
    return "";
  }
  const result2 = getPackageJsonPath(parentFolder);
  folderToPackageJsonPath.set(folderPath, result2);
  return result2;
}
function fileIsModule(file2) {
  if (file2.endsWith(".mjs") || file2.endsWith(".mts"))
    return true;
  if (file2.endsWith(".cjs") || file2.endsWith(".cts"))
    return false;
  const folder = import_path3.default.dirname(file2);
  return folderIsModule(folder);
}
var packageJsonIsModuleCache = /* @__PURE__ */ new Map();
function folderIsModule(folder) {
  const packageJsonPath = getPackageJsonPath(folder);
  if (!packageJsonPath)
    return false;
  if (!packageJsonIsModuleCache.has(packageJsonPath)) {
    let isModule2 = false;
    try {
      isModule2 = JSON.parse(import_fs3.default.readFileSync(packageJsonPath, "utf8")).type === "module";
    } catch {
    }
    packageJsonIsModuleCache.set(packageJsonPath, isModule2);
  }
  return packageJsonIsModuleCache.get(packageJsonPath);
}
var packageJsonMainFieldCache = /* @__PURE__ */ new Map();
function getMainFieldFromPackageJson(packageJsonPath) {
  if (!packageJsonMainFieldCache.has(packageJsonPath)) {
    let mainField;
    try {
      mainField = JSON.parse(import_fs3.default.readFileSync(packageJsonPath, "utf8")).main;
    } catch {
    }
    packageJsonMainFieldCache.set(packageJsonPath, mainField);
  }
  return packageJsonMainFieldCache.get(packageJsonPath);
}
var kExtLookups = /* @__PURE__ */ new Map([
  [".js", [".jsx", ".ts", ".tsx"]],
  [".jsx", [".tsx"]],
  [".cjs", [".cts"]],
  [".mjs", [".mts"]],
  ["", [".js", ".ts", ".jsx", ".tsx", ".cjs", ".mjs", ".cts", ".mts"]]
]);
function resolveImportSpecifierExtension(resolved) {
  if (fileExists(resolved))
    return resolved;
  for (const [ext, others] of kExtLookups) {
    if (!resolved.endsWith(ext))
      continue;
    for (const other of others) {
      const modified = resolved.substring(0, resolved.length - ext.length) + other;
      if (fileExists(modified))
        return modified;
    }
    break;
  }
}
function resolveImportSpecifierAfterMapping(resolved, afterPathMapping) {
  const resolvedFile = resolveImportSpecifierExtension(resolved);
  if (resolvedFile)
    return resolvedFile;
  if (dirExists(resolved)) {
    const packageJsonPath = import_path3.default.join(resolved, "package.json");
    if (afterPathMapping) {
      const mainField = getMainFieldFromPackageJson(packageJsonPath);
      const mainFieldResolved = mainField ? resolveImportSpecifierExtension(import_path3.default.resolve(resolved, mainField)) : void 0;
      return mainFieldResolved || resolveImportSpecifierExtension(import_path3.default.join(resolved, "index"));
    }
    if (fileExists(packageJsonPath))
      return resolved;
    const dirImport = import_path3.default.join(resolved, "index");
    return resolveImportSpecifierExtension(dirImport);
  }
}
function fileExists(resolved) {
  return import_fs3.default.statSync(resolved, { throwIfNoEntry: false })?.isFile();
}
function dirExists(resolved) {
  return import_fs3.default.statSync(resolved, { throwIfNoEntry: false })?.isDirectory();
}

// packages/playwright/src/transform/esmLoaderSync.ts
var import_fs4 = __toESM(require("fs"));
var import_url = __toESM(require("url"));
function resolve(specifier, context, nextResolve) {
  if (context.parentURL && context.parentURL.startsWith("file://")) {
    const filename = import_url.default.fileURLToPath(context.parentURL);
    const resolved = resolveHook(filename, specifier);
    if (resolved !== void 0) {
      specifier = new Set(context.conditions).has("import") ? import_url.default.pathToFileURL(resolved).toString() : resolved;
    }
  }
  const result2 = nextResolve(specifier, context);
  if (result2?.url && result2.url.startsWith("file://"))
    currentFileDepsCollector()?.add(import_url.default.fileURLToPath(result2.url));
  return result2;
}
var kSupportedFormats = /* @__PURE__ */ new Map([
  ["commonjs", "commonjs"],
  ["module", "module"],
  ["commonjs-typescript", "commonjs"],
  ["module-typescript", "module"],
  ["typescript", null],
  [null, null],
  [void 0, void 0]
]);
function load(moduleUrl, context, nextLoad) {
  if (!kSupportedFormats.has(context.format))
    return nextLoad(moduleUrl, context);
  if (!moduleUrl.startsWith("file://"))
    return nextLoad(moduleUrl, context);
  const filename = import_url.default.fileURLToPath(moduleUrl);
  if (!shouldTransform(filename))
    return nextLoad(moduleUrl, context);
  const isRequire = !new Set(context.conditions).has("import");
  const format = isRequire ? "commonjs" : kSupportedFormats.get(context.format) || (fileIsModule(filename) ? "module" : "commonjs");
  const code = import_fs4.default.readFileSync(filename, "utf-8");
  const transformed = transformHook(code, filename, format === "module" ? moduleUrl : void 0);
  return {
    format,
    source: transformed.code,
    shortCircuit: true
  };
}

// packages/playwright/src/transform/pirates.ts
var import_module = __toESM(require("module"));
var import_path4 = __toESM(require("path"));
function addHook(transformHook2, shouldTransform2, extensions) {
  const extensionsToOverwrite = extensions.filter((e) => e !== ".cjs");
  const allSupportedExtensions = new Set(extensions);
  const loaders = import_module.default._extensions;
  const jsLoader = loaders[".js"];
  for (const extension of extensionsToOverwrite) {
    let newLoader2 = function(mod, filename, ...loaderArgs) {
      if (allSupportedExtensions.has(import_path4.default.extname(filename)) && shouldTransform2(filename)) {
        let newCompile2 = function(code, file2, ...ignoredArgs) {
          mod._compile = oldCompile;
          return oldCompile.call(this, transformHook2(code, filename), file2);
        };
        var newCompile = newCompile2;
        const oldCompile = mod._compile;
        mod._compile = newCompile2;
      }
      originalLoader.call(this, mod, filename, ...loaderArgs);
    };
    var newLoader = newLoader2;
    const originalLoader = loaders[extension] || jsLoader;
    loaders[extension] = newLoader2;
  }
}

// packages/playwright/src/transform/transform.ts
var version = import_package2.packageJSON.version;
var cachedTSConfigs = /* @__PURE__ */ new Map();
var _transformConfig = {
  babelPlugins: [],
  external: []
};
var _externalMatcher = () => false;
async function setTransformConfig(config) {
  _transformConfig = config;
  _externalMatcher = createFileMatcher(_transformConfig.external);
  if (loaderChannel)
    await loaderChannel.send("setTransformConfig", { config });
}
var _singleTSConfigPath;
var _singleTSConfig;
async function setSingleTSConfig(value) {
  _singleTSConfigPath = value;
  if (loaderChannel)
    await loaderChannel.send("setSingleTSConfig", { tsconfig: value });
}
function validateTsConfig(tsconfig) {
  const pathsBase = tsconfig.absoluteBaseUrl ?? tsconfig.paths?.pathsBasePath;
  const pathsFallback = tsconfig.absoluteBaseUrl ? [{ key: "*", values: ["*"] }] : [];
  return {
    allowJs: !!tsconfig.allowJs,
    pathsBase,
    paths: Object.entries(tsconfig.paths?.mapping || {}).map(([key, values]) => ({ key, values })).concat(pathsFallback)
  };
}
function loadAndValidateTsconfigsForFile(file2) {
  if (_singleTSConfigPath && !_singleTSConfig)
    _singleTSConfig = loadTsConfig(_singleTSConfigPath).map(validateTsConfig);
  if (_singleTSConfig)
    return _singleTSConfig;
  return loadAndValidateTsconfigsForFolder(import_path5.default.dirname(file2));
}
function loadAndValidateTsconfigsForFolder(folder) {
  const foldersWithConfig = [];
  let currentFolder = import_path5.default.resolve(folder);
  let result2;
  while (true) {
    const cached = cachedTSConfigs.get(currentFolder);
    if (cached) {
      result2 = cached;
      break;
    }
    foldersWithConfig.push(currentFolder);
    for (const name of ["tsconfig.json", "jsconfig.json"]) {
      const configPath = import_path5.default.join(currentFolder, name);
      if (import_fs5.default.existsSync(configPath)) {
        const loaded = loadTsConfig(configPath);
        result2 = loaded.map(validateTsConfig);
        break;
      }
    }
    if (result2)
      break;
    const parentFolder = import_path5.default.resolve(currentFolder, "../");
    if (currentFolder === parentFolder)
      break;
    currentFolder = parentFolder;
  }
  result2 = result2 || [];
  for (const folder2 of foldersWithConfig)
    cachedTSConfigs.set(folder2, result2);
  return result2;
}
var pathSeparator = process.platform === "win32" ? ";" : ":";
var builtins = new Set(import_module2.default.builtinModules);
function resolveHook(filename, specifier) {
  if (specifier.startsWith("node:") || builtins.has(specifier))
    return;
  if (!shouldTransform(filename))
    return;
  if (isRelativeSpecifier(specifier))
    return resolveImportSpecifierAfterMapping(import_path5.default.resolve(import_path5.default.dirname(filename), specifier), false);
  const isTypeScript = filename.endsWith(".ts") || filename.endsWith(".tsx");
  const tsconfigs = loadAndValidateTsconfigsForFile(filename);
  for (const tsconfig of tsconfigs) {
    if (!isTypeScript && !tsconfig.allowJs)
      continue;
    let longestPrefixLength = -1;
    let pathMatchedByLongestPrefix;
    for (const { key, values } of tsconfig.paths) {
      let matchedPartOfSpecifier = specifier;
      const [keyPrefix, keySuffix] = key.split("*");
      if (key.includes("*")) {
        if (keyPrefix) {
          if (!specifier.startsWith(keyPrefix))
            continue;
          matchedPartOfSpecifier = matchedPartOfSpecifier.substring(keyPrefix.length, matchedPartOfSpecifier.length);
        }
        if (keySuffix) {
          if (!specifier.endsWith(keySuffix))
            continue;
          matchedPartOfSpecifier = matchedPartOfSpecifier.substring(0, matchedPartOfSpecifier.length - keySuffix.length);
        }
      } else {
        if (specifier !== key)
          continue;
        matchedPartOfSpecifier = specifier;
      }
      if (keyPrefix.length <= longestPrefixLength)
        continue;
      for (const value of values) {
        let candidate = value;
        if (value.includes("*"))
          candidate = candidate.replace("*", matchedPartOfSpecifier);
        candidate = import_path5.default.resolve(tsconfig.pathsBase, candidate);
        const existing = resolveImportSpecifierAfterMapping(candidate, true);
        if (existing) {
          longestPrefixLength = keyPrefix.length;
          pathMatchedByLongestPrefix = existing;
        }
      }
    }
    if (pathMatchedByLongestPrefix)
      return pathMatchedByLongestPrefix;
  }
  if (import_path5.default.isAbsolute(specifier)) {
    return resolveImportSpecifierAfterMapping(specifier, false);
  }
}
function shouldTransform(filename) {
  if (_externalMatcher(filename))
    return false;
  return !belongsToNodeModules(filename);
}
var transformData;
function setTransformData(pluginName, value) {
  transformData.set(pluginName, value);
}
function transformHook(originalCode, filename, moduleUrl) {
  const hasPreprocessor = process.env.PW_TEST_SOURCE_TRANSFORM && process.env.PW_TEST_SOURCE_TRANSFORM_SCOPE && process.env.PW_TEST_SOURCE_TRANSFORM_SCOPE.split(pathSeparator).some((f) => filename.startsWith(f));
  const pluginsPrologue = _transformConfig.babelPlugins;
  const pluginsEpilogue = hasPreprocessor ? [[process.env.PW_TEST_SOURCE_TRANSFORM]] : [];
  const hash = calculateHash(originalCode, filename, !!moduleUrl, pluginsPrologue, pluginsEpilogue);
  const { cachedCode, addToCache, serializedCache } = getFromCompilationCache(filename, hash, moduleUrl);
  if (cachedCode !== void 0)
    return { code: cachedCode, serializedCache };
  process.env.BROWSERSLIST_IGNORE_OLD_DATA = "true";
  const { babelTransform } = require((0, import_package2.libPath)("transform", "babelBundle"));
  transformData = /* @__PURE__ */ new Map();
  const setTransformDataForPlugin = (key, value) => transformData.set(key, value);
  const wrappedPrologue = pluginsPrologue.map(([name, opts]) => [
    name,
    { ...opts || {}, setTransformData: setTransformDataForPlugin }
  ]);
  const babelResult = babelTransform(originalCode, filename, !!moduleUrl, wrappedPrologue, pluginsEpilogue, _transformConfig.jsxImportSource);
  if (!babelResult?.code)
    return { code: originalCode, serializedCache };
  const { code, map } = babelResult;
  const added = addToCache(code, map, transformData);
  return { code, serializedCache: added.serializedCache };
}
function calculateHash(content, filePath, isModule2, pluginsPrologue, pluginsEpilogue) {
  const hash = import_crypto5.default.createHash("sha1").update(isModule2 ? "esm" : "no_esm").update(content).update(filePath).update(version).update(pluginsPrologue.map((p) => p[0]).join(",")).update(pluginsEpilogue.map((p) => p[0]).join(",")).digest("hex");
  return hash;
}
async function requireOrImport(file) {
  installTransformIfNeeded();
  const isModule = fileIsModule(file);
  if (isModule) {
    const fileName = import_url2.default.pathToFileURL(file);
    const esmImport = () => eval(`import(${JSON.stringify(fileName)})`);
    if (loaderChannel) {
      await eval(`import(${JSON.stringify(fileName + ".esm.preflight")})`).catch((error) => debugTest("Failed to load preflight for " + file + ", source maps may be missing for errors thrown during loading.", error)).finally(nextTask);
    }
    return await esmImport().finally(nextTask);
  }
  const result = require(file);
  const depsCollector = currentFileDepsCollector();
  if (depsCollector) {
    const module2 = require.cache[file];
    if (module2) {
      const cjsDeps = /* @__PURE__ */ new Set();
      collectCJSDependencies(module2, cjsDeps);
      for (const dep of cjsDeps)
        depsCollector.add(dep);
    }
  }
  return result;
}
var transformInstalled = false;
function installTransformIfNeeded() {
  if (transformInstalled)
    return;
  transformInstalled = true;
  registerESMLoader();
  installSourceMapSupport();
  if (loaderChannel) {
    installCJSHooks();
    return;
  }
  const extensions = import_module2.default._extensions;
  for (const ext of [".ts", ".cts", ".tsx", ".jsx"])
    extensions[ext] = extensions[".js"];
}
function installCJSHooks() {
  const originalResolveFilename = import_module2.default._resolveFilename;
  function resolveFilename(specifier, parent, ...rest) {
    if (parent) {
      const resolved = resolveHook(parent.filename, specifier);
      if (resolved !== void 0)
        specifier = resolved;
    }
    return originalResolveFilename.call(this, specifier, parent, ...rest);
  }
  import_module2.default._resolveFilename = resolveFilename;
  addHook((code, filename) => {
    return transformHook(code, filename).code;
  }, shouldTransform, [".ts", ".tsx", ".js", ".jsx", ".mjs", ".mts", ".cjs", ".cts"]);
}
var collectCJSDependencies = (module2, dependencies) => {
  module2.children.forEach((child) => {
    if (!belongsToNodeModules(child.filename) && !dependencies.has(child.filename)) {
      dependencies.add(child.filename);
      collectCJSDependencies(child, dependencies);
    }
  });
};
function wrapFunctionWithLocation(func) {
  return (...args) => {
    const oldPrepareStackTrace = Error.prepareStackTrace;
    Error.prepareStackTrace = (error, stackFrames) => {
      const frame = import_source_map_support2.default.wrapCallSite(stackFrames[1]);
      const fileName2 = frame.getFileName();
      const file2 = fileName2 && fileName2.startsWith("file://") ? import_url2.default.fileURLToPath(fileName2) : fileName2;
      return {
        file: file2,
        line: frame.getLineNumber(),
        column: frame.getColumnNumber()
      };
    };
    const oldStackTraceLimit = Error.stackTraceLimit;
    Error.stackTraceLimit = 2;
    const obj = {};
    Error.captureStackTrace(obj);
    const location = obj.stack;
    Error.stackTraceLimit = oldStackTraceLimit;
    Error.prepareStackTrace = oldPrepareStackTrace;
    return func(location, ...args);
  };
}
function isRelativeSpecifier(specifier) {
  return specifier === "." || specifier === ".." || specifier.startsWith("./") || specifier.startsWith("../");
}
async function nextTask() {
  return new Promise((resolve3) => setTimeout(resolve3, 0));
}
var loaderChannel;
function registerESMLoader() {
  if (process.env.PW_DISABLE_TS_ESM)
    return;
  if ("Bun" in globalThis)
    return;
  const nodeModule = require("node:module");
  if (nodeModule.registerHooks && !process.env.PLAYWRIGHT_FORCE_ASYNC_LOADER) {
    nodeModule.registerHooks({ resolve, load });
    return;
  }
  if (!nodeModule.register)
    return;
  const { port1, port2 } = new MessageChannel();
  nodeModule.register(import_url2.default.pathToFileURL(require.resolve("../transform/esmLoader.js")), {
    data: { port: port2 },
    transferList: [port2]
  });
  loaderChannel = new PortTransport(port1, async (method, params) => {
    if (method === "pushToCompilationCache")
      addToCompilationCache(params.cache);
  });
  void loaderChannel.send("setSingleTSConfig", { tsconfig: _singleTSConfigPath });
  void loaderChannel.send("setTransformConfig", { config: _transformConfig });
  void loaderChannel.send("addToCompilationCache", { cache: serializeCompilationCache() });
}
async function startCollectingFileDeps2() {
  startCollectingFileDeps();
  if (loaderChannel)
    await loaderChannel.send("startCollectingFileDeps", {});
}
async function stopCollectingFileDeps2(file2) {
  stopCollectingFileDeps(file2);
  if (loaderChannel)
    await loaderChannel.send("stopCollectingFileDeps", { file: file2 });
}
async function incorporateCompilationCache() {
  if (!loaderChannel)
    return;
  const result2 = await loaderChannel.send("getCompilationCache", {});
  addToCompilationCache(result2.cache);
}

// packages/playwright/src/transform/esmLoader.ts
var esmPreflightExtension = ".esm.preflight";
async function resolve2(originalSpecifier, context, defaultResolve) {
  let specifier = originalSpecifier.replace(esmPreflightExtension, "");
  if (context.parentURL && context.parentURL.startsWith("file://")) {
    const filename = import_url3.default.fileURLToPath(context.parentURL);
    const resolved = resolveHook(filename, specifier);
    if (resolved !== void 0)
      specifier = import_url3.default.pathToFileURL(resolved).toString();
  }
  const result2 = await defaultResolve(specifier, context, defaultResolve);
  if (result2?.url && result2.url.startsWith("file://"))
    currentFileDepsCollector()?.add(import_url3.default.fileURLToPath(result2.url));
  if (originalSpecifier.endsWith(esmPreflightExtension))
    result2.url = result2.url + esmPreflightExtension;
  return result2;
}
var kSupportedFormats2 = /* @__PURE__ */ new Map([
  ["commonjs", "commonjs"],
  ["module", "module"],
  ["commonjs-typescript", "commonjs"],
  ["module-typescript", "module"],
  [null, null],
  [void 0, void 0]
]);
async function load2(moduleUrl, context, defaultLoad) {
  if (!kSupportedFormats2.has(context.format))
    return defaultLoad(moduleUrl, context, defaultLoad);
  if (!moduleUrl.startsWith("file://"))
    return defaultLoad(moduleUrl, context, defaultLoad);
  const filename = import_url3.default.fileURLToPath(moduleUrl);
  const isPreflight = moduleUrl.endsWith(esmPreflightExtension);
  if (!shouldTransform(filename))
    return defaultLoad(moduleUrl, context, defaultLoad);
  const originalModuleUrl = isPreflight ? moduleUrl.slice(0, -esmPreflightExtension.length) : moduleUrl;
  const originalFilename = isPreflight ? import_url3.default.fileURLToPath(originalModuleUrl) : filename;
  const code = import_fs6.default.readFileSync(originalFilename, "utf-8");
  const transformed = transformHook(code, originalFilename, originalModuleUrl);
  if (transformed.serializedCache)
    transport?.post("pushToCompilationCache", { cache: transformed.serializedCache });
  return {
    format: kSupportedFormats2.get(context.format) || (fileIsModule(originalFilename) ? "module" : "commonjs"),
    source: isPreflight ? `void 0;` : transformed.code,
    shortCircuit: true
  };
}
var transport;
function initialize(data) {
  transport = createTransport(data?.port);
}
function createTransport(port) {
  return new PortTransport(port, async (method, params) => {
    if (method === "setSingleTSConfig") {
      await setSingleTSConfig(params.tsconfig);
      return;
    }
    if (method === "setTransformConfig") {
      await setTransformConfig(params.config);
      return;
    }
    if (method === "addToCompilationCache") {
      addToCompilationCache(params.cache);
      return;
    }
    if (method === "getCompilationCache")
      return { cache: serializeCompilationCache() };
    if (method === "startCollectingFileDeps") {
      startCollectingFileDeps();
      return;
    }
    if (method === "stopCollectingFileDeps") {
      stopCollectingFileDeps(params.file);
      return;
    }
  });
}
module.exports = { initialize, load: load2, resolve: resolve2 };
packages/playwright/lib/transform/esmLoader.js

THIRD-PARTY SOFTWARE NOTICES AND INFORMATION

The following npm packages are inlined into this bundle.

- balanced-match@1.0.2 (https://github.com/juliangruber/balanced-match)
- brace-expansion@1.1.12 (https://github.com/juliangruber/brace-expansion)
- buffer-from@1.1.2 (https://github.com/LinusU/buffer-from)
- concat-map@0.0.1 (https://github.com/substack/node-concat-map)
- debug@4.4.3 (https://github.com/debug-js/debug)
- has-flag@4.0.0 (https://github.com/sindresorhus/has-flag)
- json5@2.2.3 (https://github.com/json5/json5)
- mime@3.0.0 (https://github.com/broofa/mime)
- minimatch@3.1.5 (https://github.com/isaacs/minimatch)
- ms@2.1.3 (https://github.com/vercel/ms)
- source-map-support@0.5.21 (https://github.com/evanw/node-source-map-support)
- source-map@0.6.1 (https://github.com/mozilla/source-map)
- supports-color@8.1.1 (https://github.com/chalk/supports-color)

%% balanced-match@1.0.2 NOTICES AND INFORMATION BEGIN HERE
=========================================
(MIT)

Copyright (c) 2013 Julian Gruber &lt;julian@juliangruber.com&gt;

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
=========================================
END OF balanced-match@1.0.2 NOTICES AND INFORMATION

%% brace-expansion@1.1.12 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License

Copyright (c) 2013 Julian Gruber <julian@juliangruber.com>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
=========================================
END OF brace-expansion@1.1.12 NOTICES AND INFORMATION

%% buffer-from@1.1.2 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License

Copyright (c) 2016, 2018 Linus UnnebÃ¤ck

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
=========================================
END OF buffer-from@1.1.2 NOTICES AND INFORMATION

%% concat-map@0.0.1 NOTICES AND INFORMATION BEGIN HERE
=========================================
This software is released under the MIT license:

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF concat-map@0.0.1 NOTICES AND INFORMATION

%% debug@4.4.3 NOTICES AND INFORMATION BEGIN HERE
=========================================
(The MIT License)

Copyright (c) 2014-2017 TJ Holowaychuk <tj@vision-media.ca>
Copyright (c) 2018-2021 Josh Junon

Permission is hereby granted, free of charge, to any person obtaining a copy of this software
and associated documentation files (the 'Software'), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial
portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF debug@4.4.3 NOTICES AND INFORMATION

%% has-flag@4.0.0 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License

Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF has-flag@4.0.0 NOTICES AND INFORMATION

%% json5@2.2.3 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License

Copyright (c) 2012-2018 Aseem Kishore, and [others].

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

[others]: https://github.com/json5/json5/contributors
=========================================
END OF json5@2.2.3 NOTICES AND INFORMATION

%% mime@3.0.0 NOTICES AND INFORMATION BEGIN HERE
=========================================
The MIT License (MIT)

Copyright (c) 2010 Benjamin Thomas, Robert Kieffer

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
=========================================
END OF mime@3.0.0 NOTICES AND INFORMATION

%% minimatch@3.1.5 NOTICES AND INFORMATION BEGIN HERE
=========================================
The ISC License

Copyright (c) Isaac Z. Schlueter and Contributors

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
=========================================
END OF minimatch@3.1.5 NOTICES AND INFORMATION

%% ms@2.1.3 NOTICES AND INFORMATION BEGIN HERE
=========================================
The MIT License (MIT)

Copyright (c) 2020 Vercel, Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
=========================================
END OF ms@2.1.3 NOTICES AND INFORMATION

%% source-map-support@0.5.21 NOTICES AND INFORMATION BEGIN HERE
=========================================
The MIT License (MIT)

Copyright (c) 2014 Evan Wallace

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
=========================================
END OF source-map-support@0.5.21 NOTICES AND INFORMATION

%% source-map@0.6.1 NOTICES AND INFORMATION BEGIN HERE
=========================================
Copyright (c) 2009-2011, Mozilla Foundation and contributors
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this
  list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice,
  this list of conditions and the following disclaimer in the documentation
  and/or other materials provided with the distribution.

* Neither the names of the Mozilla Foundation nor the names of project
  contributors may be used to endorse or promote products derived from this
  software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
=========================================
END OF source-map@0.6.1 NOTICES AND INFORMATION

%% supports-color@8.1.1 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License

Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF supports-color@8.1.1 NOTICES AND INFORMATION

SUMMARY
=========================================
Total Packages: 13
=========================================# packages/playwright/lib/transform/esmLoader.js
# total: 249.1 KB

## Inlined (47)
   1.5 KB  node_modules/balanced-match/index.js
   4.4 KB  node_modules/brace-expansion/index.js
   1.8 KB  node_modules/buffer-from/index.js
   0.5 KB  node_modules/concat-map/index.js
   4.6 KB  node_modules/debug/src/browser.js
   5.8 KB  node_modules/debug/src/common.js
   0.3 KB  node_modules/debug/src/index.js
   4.2 KB  node_modules/debug/src/node.js
   0.4 KB  node_modules/has-flag/index.js
   0.2 KB  node_modules/json5/lib/index.js
  20.2 KB  node_modules/json5/lib/parse.js
   6.8 KB  node_modules/json5/lib/stringify.js
  15.5 KB  node_modules/json5/lib/unicode.js
   0.9 KB  node_modules/json5/lib/util.js
   0.2 KB  node_modules/mime/index.js
   2.0 KB  node_modules/mime/Mime.js
  26.8 KB  node_modules/mime/types/other.js
  10.1 KB  node_modules/mime/types/standard.js
  20.9 KB  node_modules/minimatch/minimatch.js
   2.8 KB  node_modules/ms/index.js
  16.1 KB  node_modules/source-map-support/source-map-support.js
   2.2 KB  node_modules/source-map/lib/array-set.js
   1.7 KB  node_modules/source-map/lib/base64-vlq.js
   1.1 KB  node_modules/source-map/lib/base64.js
   1.5 KB  node_modules/source-map/lib/binary-search.js
   1.3 KB  node_modules/source-map/lib/mapping-list.js
   0.9 KB  node_modules/source-map/lib/quick-sort.js
  24.0 KB  node_modules/source-map/lib/source-map-consumer.js
  10.6 KB  node_modules/source-map/lib/source-map-generator.js
   9.6 KB  node_modules/source-map/lib/source-node.js
   8.6 KB  node_modules/source-map/lib/util.js
   0.3 KB  node_modules/source-map/source-map.js
   3.4 KB  node_modules/supports-color/index.js
   0.1 KB  packages/isomorphic/rtti.ts
   0.2 KB  packages/isomorphic/stackTrace.ts
   0.2 KB  packages/isomorphic/stringUtils.ts
   6.3 KB  packages/playwright/src/transform/compilationCache.ts
   3.1 KB  packages/playwright/src/transform/esmLoader.ts
   1.7 KB  packages/playwright/src/transform/esmLoaderSync.ts
   1.1 KB  packages/playwright/src/transform/pirates.ts
   1.1 KB  packages/playwright/src/transform/portTransport.ts
  11.7 KB  packages/playwright/src/transform/transform.ts
   2.9 KB  packages/playwright/src/transform/tsconfig-loader.ts
   4.9 KB  packages/playwright/src/util.ts
   0.2 KB  packages/utils/crypto.ts
   0.2 KB  packages/utils/debug.ts
   0.5 KB  packages/utils/env.ts

## External (4)
  ../globals
  ../package
  ../transform/esmLoader.js
  playwright-core/package.json
"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  // If the importer is in node compatibility mode or this is not an ESM
  // file that has been converted to a CommonJS file using a Babel-
  // compatible transform (i.e. "__esModule" has not been set), then set
  // "default" to the CommonJS "module.exports" for node compatibility.
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var util_exports = {};
__export(util_exports, {
  addSuffixToFilePath: () => addSuffixToFilePath,
  ansiRegex: () => ansiRegex,
  createFileMatcher: () => createFileMatcher,
  createTitleMatcher: () => createTitleMatcher,
  debugTest: () => debugTest,
  errorWithFile: () => errorWithFile,
  expectTypes: () => expectTypes,
  fileExistsAsync: () => fileExistsAsync,
  fileIsModule: () => fileIsModule,
  filterStackFile: () => filterStackFile,
  filterStackTrace: () => filterStackTrace,
  filteredStackTrace: () => filteredStackTrace,
  forceRegExp: () => forceRegExp,
  formatLocation: () => formatLocation,
  getContainedPath: () => getContainedPath,
  getPackageJsonPath: () => getPackageJsonPath,
  mergeObjects: () => mergeObjects,
  normalizeAndSaveAttachment: () => normalizeAndSaveAttachment,
  parseLocationArg: () => parseLocationArg,
  relativeFilePath: () => relativeFilePath,
  removeDirAndLogToConsole: () => removeDirAndLogToConsole,
  resolveImportSpecifierAfterMapping: () => resolveImportSpecifierAfterMapping,
  resolveReporterOutputPath: () => resolveReporterOutputPath,
  sanitizeFilePathBeforeExtension: () => sanitizeFilePathBeforeExtension,
  serializeError: () => serializeError,
  stripAnsiEscapes: () => stripAnsiEscapes,
  takeFirst: () => takeFirst,
  windowsFilesystemFriendlyLength: () => windowsFilesystemFriendlyLength
});
module.exports = __toCommonJS(util_exports);
var import_fs = __toESM(require("fs"));
var import_path = __toESM(require("path"));
var import_util = __toESM(require("util"));
const debug = require("playwright-core/lib/utilsBundle").debug;
const mime = require("playwright-core/lib/utilsBundle").mime;
const minimatch = require("playwright-core/lib/utilsBundle").minimatch;
const { calculateSha1 } = require("playwright-core/lib/coreBundle").utils;
const { sanitizeForFilePath } = require("playwright-core/lib/coreBundle").utils;
const { isRegExp } = require("playwright-core/lib/coreBundle").iso;
const { parseStackFrame, stringifyStackFrames } = require("playwright-core/lib/coreBundle").iso;
const { ansiRegex, isString, stripAnsiEscapes } = require("playwright-core/lib/coreBundle").iso;
const PLAYWRIGHT_TEST_PATH = import_path.default.join(__dirname, "..");
const PLAYWRIGHT_CORE_PATH = import_path.default.dirname(require.resolve("playwright-core/package.json"));
function filterStackTrace(e) {
  const name = e.name ? e.name + ": " : "";
  const cause = e.cause instanceof Error ? filterStackTrace(e.cause) : void 0;
  if (process.env.PWDEBUGIMPL)
    return { message: name + e.message, stack: e.stack || "", cause };
  const stackLines = stringifyStackFrames(filteredStackTrace(e.stack?.split("\n") || []));
  return {
    message: name + e.message,
    stack: `${name}${e.message}${stackLines.map((line) => "\n" + line).join("")}`,
    cause
  };
}
function filterStackFile(file) {
  if (process.env.PWDEBUGIMPL)
    return true;
  if (file.startsWith(PLAYWRIGHT_TEST_PATH))
    return false;
  if (file.startsWith(PLAYWRIGHT_CORE_PATH))
    return false;
  return true;
}
function filteredStackTrace(rawStack) {
  const frames = [];
  for (const line of rawStack) {
    const frame = parseStackFrame(line, import_path.default.sep, !!process.env.PWDEBUGIMPL);
    if (!frame || !frame.file)
      continue;
    if (!filterStackFile(frame.file))
      continue;
    frames.push(frame);
  }
  return frames;
}
function serializeError(error) {
  if (error instanceof Error)
    return filterStackTrace(error);
  return {
    value: import_util.default.inspect(error)
  };
}
function parseLocationArg(arg) {
  const match = /^(.*?):(\d+):?(\d+)?$/.exec(arg);
  return {
    file: match ? match[1] : arg,
    line: match ? parseInt(match[2], 10) : null,
    column: match?.[3] ? parseInt(match[3], 10) : null
  };
}
function createFileMatcher(patterns) {
  const reList = [];
  const filePatterns = [];
  for (const pattern of Array.isArray(patterns) ? patterns : [patterns]) {
    if (isRegExp(pattern)) {
      reList.push(pattern);
    } else {
      if (!pattern.startsWith("**/"))
        filePatterns.push("**/" + pattern);
      else
        filePatterns.push(pattern);
    }
  }
  return (filePath) => {
    for (const re of reList) {
      re.lastIndex = 0;
      if (re.test(filePath))
        return true;
    }
    if (import_path.default.sep === "\\") {
      const unixPath = filePath.split(import_path.default.sep).join("/");
      for (const re of reList) {
        re.lastIndex = 0;
        if (re.test(unixPath))
          return true;
      }
    }
    for (const pattern of filePatterns) {
      if (minimatch(filePath, pattern, { nocase: true, dot: true }))
        return true;
    }
    return false;
  };
}
function createTitleMatcher(patterns) {
  const reList = Array.isArray(patterns) ? patterns : [patterns];
  return (value) => {
    for (const re of reList) {
      re.lastIndex = 0;
      if (re.test(value))
        return true;
    }
    return false;
  };
}
function mergeObjects(a, b, c) {
  const result = { ...a };
  for (const x of [b, c].filter(Boolean)) {
    for (const [name, value] of Object.entries(x)) {
      if (!Object.is(value, void 0))
        result[name] = value;
    }
  }
  return result;
}
function forceRegExp(pattern) {
  const match = pattern.match(/^\/(.*)\/([gi]*)$/);
  if (match)
    return new RegExp(match[1], match[2]);
  return new RegExp(pattern, "gi");
}
function relativeFilePath(file) {
  if (!import_path.default.isAbsolute(file))
    return file;
  return import_path.default.relative(process.cwd(), file);
}
function formatLocation(location) {
  return relativeFilePath(location.file) + ":" + location.line + ":" + location.column;
}
function errorWithFile(file, message) {
  return new Error(`${relativeFilePath(file)}: ${message}`);
}
function expectTypes(receiver, types, matcherName) {
  if (typeof receiver !== "object" || !types.includes(receiver._apiName)) {
    const receiverString = typeof receiver === "object" && receiver !== null ? `${receiver.constructor.name} ${import_util.default.inspect(receiver)}` : String(receiver);
    const commaSeparated = types.slice();
    const lastType = commaSeparated.pop();
    const typesString = commaSeparated.length ? commaSeparated.join(", ") + " or " + lastType : lastType;
    throw new Error(`${matcherName} can be only used with ${typesString} object${types.length > 1 ? "s" : ""}, was called with ${receiverString}`);
  }
}
const windowsFilesystemFriendlyLength = 60;
function addSuffixToFilePath(filePath, suffix) {
  const ext = import_path.default.extname(filePath);
  const base = filePath.substring(0, filePath.length - ext.length);
  return base + suffix + ext;
}
function sanitizeFilePathBeforeExtension(filePath, ext) {
  ext ??= import_path.default.extname(filePath);
  const base = filePath.substring(0, filePath.length - ext.length);
  return sanitizeForFilePath(base) + ext;
}
function getContainedPath(parentPath, subPath = "") {
  const resolvedPath = import_path.default.resolve(parentPath, subPath);
  if (resolvedPath === parentPath || resolvedPath.startsWith(parentPath + import_path.default.sep))
    return resolvedPath;
  return null;
}
const debugTest = debug("pw:test");
const folderToPackageJsonPath = /* @__PURE__ */ new Map();
function getPackageJsonPath(folderPath) {
  const cached = folderToPackageJsonPath.get(folderPath);
  if (cached !== void 0)
    return cached;
  const packageJsonPath = import_path.default.join(folderPath, "package.json");
  if (import_fs.default.existsSync(packageJsonPath)) {
    folderToPackageJsonPath.set(folderPath, packageJsonPath);
    return packageJsonPath;
  }
  const parentFolder = import_path.default.dirname(folderPath);
  if (folderPath === parentFolder) {
    folderToPackageJsonPath.set(folderPath, "");
    return "";
  }
  const result = getPackageJsonPath(parentFolder);
  folderToPackageJsonPath.set(folderPath, result);
  return result;
}
function resolveReporterOutputPath(defaultValue, configDir, configValue) {
  if (configValue)
    return import_path.default.resolve(configDir, configValue);
  let basePath = getPackageJsonPath(configDir);
  basePath = basePath ? import_path.default.dirname(basePath) : process.cwd();
  return import_path.default.resolve(basePath, defaultValue);
}
async function normalizeAndSaveAttachment(outputPath, name, options = {}) {
  if (options.path === void 0 && options.body === void 0)
    return { name, contentType: "text/plain" };
  if ((options.path !== void 0 ? 1 : 0) + (options.body !== void 0 ? 1 : 0) !== 1)
    throw new Error(`Exactly one of "path" and "body" must be specified`);
  if (options.path !== void 0) {
    const hash = calculateSha1(options.path);
    if (!isString(name))
      throw new Error('"name" should be string.');
    const sanitizedNamePrefix = sanitizeForFilePath(name) + "-";
    const dest = import_path.default.join(outputPath, "attachments", sanitizedNamePrefix + hash + import_path.default.extname(options.path));
    await import_fs.default.promises.mkdir(import_path.default.dirname(dest), { recursive: true });
    await import_fs.default.promises.copyFile(options.path, dest);
    const contentType = options.contentType ?? (mime.getType(import_path.default.basename(options.path)) || "application/octet-stream");
    return { name, contentType, path: dest };
  } else {
    const contentType = options.contentType ?? (typeof options.body === "string" ? "text/plain" : "application/octet-stream");
    return { name, contentType, body: typeof options.body === "string" ? Buffer.from(options.body) : options.body };
  }
}
function fileIsModule(file) {
  if (file.endsWith(".mjs") || file.endsWith(".mts"))
    return true;
  if (file.endsWith(".cjs") || file.endsWith(".cts"))
    return false;
  const folder = import_path.default.dirname(file);
  return folderIsModule(folder);
}
const packageJsonIsModuleCache = /* @__PURE__ */ new Map();
function folderIsModule(folder) {
  const packageJsonPath = getPackageJsonPath(folder);
  if (!packageJsonPath)
    return false;
  if (!packageJsonIsModuleCache.has(packageJsonPath)) {
    let isModule = false;
    try {
      isModule = JSON.parse(import_fs.default.readFileSync(packageJsonPath, "utf8")).type === "module";
    } catch {
    }
    packageJsonIsModuleCache.set(packageJsonPath, isModule);
  }
  return packageJsonIsModuleCache.get(packageJsonPath);
}
const packageJsonMainFieldCache = /* @__PURE__ */ new Map();
function getMainFieldFromPackageJson(packageJsonPath) {
  if (!packageJsonMainFieldCache.has(packageJsonPath)) {
    let mainField;
    try {
      mainField = JSON.parse(import_fs.default.readFileSync(packageJsonPath, "utf8")).main;
    } catch {
    }
    packageJsonMainFieldCache.set(packageJsonPath, mainField);
  }
  return packageJsonMainFieldCache.get(packageJsonPath);
}
const kExtLookups = /* @__PURE__ */ new Map([
  [".js", [".jsx", ".ts", ".tsx"]],
  [".jsx", [".tsx"]],
  [".cjs", [".cts"]],
  [".mjs", [".mts"]],
  ["", [".js", ".ts", ".jsx", ".tsx", ".cjs", ".mjs", ".cts", ".mts"]]
]);
function resolveImportSpecifierExtension(resolved) {
  if (fileExists(resolved))
    return resolved;
  for (const [ext, others] of kExtLookups) {
    if (!resolved.endsWith(ext))
      continue;
    for (const other of others) {
      const modified = resolved.substring(0, resolved.length - ext.length) + other;
      if (fileExists(modified))
        return modified;
    }
    break;
  }
}
function resolveImportSpecifierAfterMapping(resolved, afterPathMapping) {
  const resolvedFile = resolveImportSpecifierExtension(resolved);
  if (resolvedFile)
    return resolvedFile;
  if (dirExists(resolved)) {
    const packageJsonPath = import_path.default.join(resolved, "package.json");
    if (afterPathMapping) {
      const mainField = getMainFieldFromPackageJson(packageJsonPath);
      const mainFieldResolved = mainField ? resolveImportSpecifierExtension(import_path.default.resolve(resolved, mainField)) : void 0;
      return mainFieldResolved || resolveImportSpecifierExtension(import_path.default.join(resolved, "index"));
    }
    if (fileExists(packageJsonPath))
      return resolved;
    const dirImport = import_path.default.join(resolved, "index");
    return resolveImportSpecifierExtension(dirImport);
  }
}
function fileExists(resolved) {
  return import_fs.default.statSync(resolved, { throwIfNoEntry: false })?.isFile();
}
async function fileExistsAsync(resolved) {
  try {
    const stat = await import_fs.default.promises.stat(resolved);
    return stat.isFile();
  } catch {
    return false;
  }
}
function dirExists(resolved) {
  return import_fs.default.statSync(resolved, { throwIfNoEntry: false })?.isDirectory();
}
async function removeDirAndLogToConsole(dir) {
  try {
    if (!import_fs.default.existsSync(dir))
      return;
    console.log(`Removing ${await import_fs.default.promises.realpath(dir)}`);
    await import_fs.default.promises.rm(dir, { recursive: true, force: true });
  } catch {
  }
}
function takeFirst(...args) {
  for (const arg of args) {
    if (arg !== void 0)
      return arg;
  }
  return void 0;
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  addSuffixToFilePath,
  ansiRegex,
  createFileMatcher,
  createTitleMatcher,
  debugTest,
  errorWithFile,
  expectTypes,
  fileExistsAsync,
  fileIsModule,
  filterStackFile,
  filterStackTrace,
  filteredStackTrace,
  forceRegExp,
  formatLocation,
  getContainedPath,
  getPackageJsonPath,
  mergeObjects,
  normalizeAndSaveAttachment,
  parseLocationArg,
  relativeFilePath,
  removeDirAndLogToConsole,
  resolveImportSpecifierAfterMapping,
  resolveReporterOutputPath,
  sanitizeFilePathBeforeExtension,
  serializeError,
  stripAnsiEscapes,
  takeFirst,
  windowsFilesystemFriendlyLength
});
"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  // If the importer is in node compatibility mode or this is not an ESM
  // file that has been converted to a CommonJS file using a Babel-
  // compatible transform (i.e. "__esModule" has not been set), then set
  // "default" to the CommonJS "module.exports" for node compatibility.
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  mod
));

// packages/playwright/src/worker/workerProcessEntry.ts
var import_common4 = require("../common");

// packages/playwright/src/worker/workerMain.ts
var import_common3 = require("../common");
var globals = __toESM(require("../globals"));
var import_expect = require("../matchers/expect");

// packages/playwright/src/util.ts
var import_fs = __toESM(require("fs"));
var import_path = __toESM(require("path"));
var import_util = __toESM(require("util"));
var debug = require("playwright-core/lib/utilsBundle").debug;
var mime = require("playwright-core/lib/utilsBundle").mime;
var minimatch = require("playwright-core/lib/utilsBundle").minimatch;
var { calculateSha1 } = require("playwright-core/lib/coreBundle").utils;
var { sanitizeForFilePath } = require("playwright-core/lib/coreBundle").utils;
var { isRegExp } = require("playwright-core/lib/coreBundle").iso;
var { parseStackFrame, stringifyStackFrames } = require("playwright-core/lib/coreBundle").iso;
var { ansiRegex, isString, stripAnsiEscapes } = require("playwright-core/lib/coreBundle").iso;
var PLAYWRIGHT_TEST_PATH = import_path.default.join(__dirname, "..");
var PLAYWRIGHT_CORE_PATH = import_path.default.dirname(require.resolve("playwright-core/package.json"));
function filterStackTrace(e) {
  const name = e.name ? e.name + ": " : "";
  const cause = e.cause instanceof Error ? filterStackTrace(e.cause) : void 0;
  if (process.env.PWDEBUGIMPL)
    return { message: name + e.message, stack: e.stack || "", cause };
  const stackLines = stringifyStackFrames(filteredStackTrace(e.stack?.split("\n") || []));
  return {
    message: name + e.message,
    stack: `${name}${e.message}${stackLines.map((line) => "\n" + line).join("")}`,
    cause
  };
}
function filterStackFile(file) {
  if (process.env.PWDEBUGIMPL)
    return true;
  if (file.startsWith(PLAYWRIGHT_TEST_PATH))
    return false;
  if (file.startsWith(PLAYWRIGHT_CORE_PATH))
    return false;
  return true;
}
function filteredStackTrace(rawStack) {
  const frames = [];
  for (const line of rawStack) {
    const frame = parseStackFrame(line, import_path.default.sep, !!process.env.PWDEBUGIMPL);
    if (!frame || !frame.file)
      continue;
    if (!filterStackFile(frame.file))
      continue;
    frames.push(frame);
  }
  return frames;
}
function serializeError(error) {
  if (error instanceof Error)
    return filterStackTrace(error);
  return {
    value: import_util.default.inspect(error)
  };
}
function relativeFilePath(file) {
  if (!import_path.default.isAbsolute(file))
    return file;
  return import_path.default.relative(process.cwd(), file);
}
function formatLocation(location) {
  return relativeFilePath(location.file) + ":" + location.line + ":" + location.column;
}
var windowsFilesystemFriendlyLength = 60;
function addSuffixToFilePath(filePath, suffix) {
  const ext = import_path.default.extname(filePath);
  const base = filePath.substring(0, filePath.length - ext.length);
  return base + suffix + ext;
}
function sanitizeFilePathBeforeExtension(filePath, ext) {
  ext ??= import_path.default.extname(filePath);
  const base = filePath.substring(0, filePath.length - ext.length);
  return sanitizeForFilePath(base) + ext;
}
function getContainedPath(parentPath, subPath = "") {
  const resolvedPath = import_path.default.resolve(parentPath, subPath);
  if (resolvedPath === parentPath || resolvedPath.startsWith(parentPath + import_path.default.sep))
    return resolvedPath;
  return null;
}
var debugTest = debug("pw:test");
async function normalizeAndSaveAttachment(outputPath, name, options = {}) {
  if (options.path === void 0 && options.body === void 0)
    return { name, contentType: "text/plain" };
  if ((options.path !== void 0 ? 1 : 0) + (options.body !== void 0 ? 1 : 0) !== 1)
    throw new Error(`Exactly one of "path" and "body" must be specified`);
  if (options.path !== void 0) {
    const hash = calculateSha1(options.path);
    if (!isString(name))
      throw new Error('"name" should be string.');
    const sanitizedNamePrefix = sanitizeForFilePath(name) + "-";
    const dest = import_path.default.join(outputPath, "attachments", sanitizedNamePrefix + hash + import_path.default.extname(options.path));
    await import_fs.default.promises.mkdir(import_path.default.dirname(dest), { recursive: true });
    await import_fs.default.promises.copyFile(options.path, dest);
    const contentType = options.contentType ?? (mime.getType(import_path.default.basename(options.path)) || "application/octet-stream");
    return { name, contentType, path: dest };
  } else {
    const contentType = options.contentType ?? (typeof options.body === "string" ? "text/plain" : "application/octet-stream");
    return { name, contentType, body: typeof options.body === "string" ? Buffer.from(options.body) : options.body };
  }
}

// packages/playwright/src/worker/fixtureRunner.ts
var import_common = require("../common");
var { ManualPromise } = require("playwright-core/lib/coreBundle").iso;
var { escapeWithQuotes } = require("playwright-core/lib/coreBundle").iso;
var Fixture = class {
  constructor(runner, registration) {
    this.failed = false;
    this._deps = /* @__PURE__ */ new Set();
    this._usages = /* @__PURE__ */ new Set();
    this.runner = runner;
    this.registration = registration;
    this.value = null;
    const isUserFixture = this.registration.location && filterStackFile(this.registration.location.file);
    const title = this.registration.customTitle || this.registration.name;
    const location = isUserFixture ? this.registration.location : void 0;
    this._stepInfo = { title: `Fixture ${escapeWithQuotes(title, '"')}`, category: "fixture", location };
    if (this.registration.box === "self")
      this._stepInfo = void 0;
    else if (this.registration.box)
      this._stepInfo.group = isUserFixture ? "configuration" : "internal";
    this._setupDescription = {
      title,
      phase: "setup",
      location,
      slot: this.registration.timeout !== void 0 ? {
        timeout: this.registration.timeout,
        elapsed: 0
      } : this.registration.scope === "worker" ? {
        timeout: this.runner.workerFixtureTimeout,
        elapsed: 0
      } : void 0
    };
    this._teardownDescription = { ...this._setupDescription, phase: "teardown" };
  }
  async setup(testInfo, runnable) {
    this.runner.instanceForId.set(this.registration.id, this);
    if (typeof this.registration.fn !== "function") {
      this.value = this.registration.fn;
      return;
    }
    const run = () => testInfo._runWithTimeout({ ...runnable, fixture: this._setupDescription }, () => this._setupInternal(testInfo));
    if (this._stepInfo)
      await testInfo._runAsStep(this._stepInfo, run);
    else
      await run();
  }
  async _setupInternal(testInfo) {
    const params = {};
    for (const name of this.registration.deps) {
      const registration = this.runner.pool.resolve(name, this.registration);
      const dep = this.runner.instanceForId.get(registration.id);
      if (!dep) {
        this.failed = true;
        return;
      }
      dep._usages.add(this);
      this._deps.add(dep);
      params[name] = dep.value;
      if (dep.failed) {
        this.failed = true;
        return;
      }
    }
    let called = false;
    const useFuncStarted = new ManualPromise();
    const useFunc = async (value) => {
      if (called)
        throw new Error(`Cannot provide fixture value for the second time`);
      called = true;
      this.value = value;
      this._useFuncFinished = new ManualPromise();
      useFuncStarted.resolve();
      await this._useFuncFinished;
    };
    const workerInfo = { config: testInfo.config, parallelIndex: testInfo.parallelIndex, workerIndex: testInfo.workerIndex, project: testInfo.project };
    const info = this.registration.scope === "worker" ? workerInfo : testInfo;
    this._selfTeardownComplete = (async () => {
      try {
        await this.registration.fn(params, useFunc, info);
        if (!useFuncStarted.isDone())
          throw new Error(`use() was not called in fixture "${this.registration.name}"`);
      } catch (error) {
        this.failed = true;
        if (!useFuncStarted.isDone())
          useFuncStarted.reject(error);
        else
          throw error;
      }
    })();
    await useFuncStarted;
  }
  async teardown(testInfo, runnable) {
    try {
      const fixtureRunnable = { ...runnable, fixture: this._teardownDescription };
      if (!testInfo._timeoutManager.isTimeExhaustedFor(fixtureRunnable)) {
        const run = () => testInfo._runWithTimeout(fixtureRunnable, () => this._teardownInternal());
        if (this._stepInfo)
          await testInfo._runAsStep(this._stepInfo, run);
        else
          await run();
      }
    } finally {
      for (const dep of this._deps)
        dep._usages.delete(this);
      this.runner.instanceForId.delete(this.registration.id);
    }
  }
  async _teardownInternal() {
    if (typeof this.registration.fn !== "function")
      return;
    if (this._usages.size !== 0) {
      console.error("Internal error: fixture integrity at", this._teardownDescription.title);
      this._usages.clear();
    }
    if (this._useFuncFinished) {
      this._useFuncFinished.resolve();
      this._useFuncFinished = void 0;
      await this._selfTeardownComplete;
    }
  }
  _collectFixturesInTeardownOrder(scope, collector) {
    if (this.registration.scope !== scope)
      return;
    for (const fixture of this._usages)
      fixture._collectFixturesInTeardownOrder(scope, collector);
    collector.add(this);
  }
};
var FixtureRunner = class {
  constructor() {
    this.testScopeClean = true;
    this.instanceForId = /* @__PURE__ */ new Map();
    this.workerFixtureTimeout = 0;
  }
  setPool(pool) {
    if (!this.testScopeClean)
      throw new Error("Did not teardown test scope");
    if (this.pool && pool.digest !== this.pool.digest) {
      throw new Error([
        `Playwright detected inconsistent test.use() options.`,
        `Most common mistakes that lead to this issue:`,
        `  - Calling test.use() outside of the test file, for example in a common helper.`,
        `  - One test file imports from another test file.`
      ].join("\n"));
    }
    this.pool = pool;
  }
  _collectFixturesInSetupOrder(registration, collector) {
    if (collector.has(registration))
      return;
    for (const name of registration.deps) {
      const dep = this.pool.resolve(name, registration);
      this._collectFixturesInSetupOrder(dep, collector);
    }
    collector.add(registration);
  }
  async teardownScope(scope, testInfo, runnable) {
    const allFixtures = Array.from(this.instanceForId.values()).reverse();
    const collector = /* @__PURE__ */ new Set();
    for (const fixture of allFixtures)
      fixture._collectFixturesInTeardownOrder(scope, collector);
    let firstError;
    for (const fixture of collector) {
      try {
        await fixture.teardown(testInfo, runnable);
      } catch (error) {
        firstError = firstError ?? error;
      }
    }
    if (scope === "test")
      this.testScopeClean = true;
    if (firstError)
      throw firstError;
  }
  async resolveParametersForFunction(fn, testInfo, autoFixtures, runnable) {
    const collector = /* @__PURE__ */ new Set();
    const auto = [];
    for (const registration of this.pool.autoFixtures()) {
      let shouldRun = true;
      if (autoFixtures === "all-hooks-only")
        shouldRun = registration.scope === "worker" || registration.auto === "all-hooks-included";
      else if (autoFixtures === "worker")
        shouldRun = registration.scope === "worker";
      if (shouldRun)
        auto.push(registration);
    }
    auto.sort((r1, r2) => (r1.scope === "worker" ? 0 : 1) - (r2.scope === "worker" ? 0 : 1));
    for (const registration of auto)
      this._collectFixturesInSetupOrder(registration, collector);
    const names = getRequiredFixtureNames(fn);
    for (const name of names)
      this._collectFixturesInSetupOrder(this.pool.resolve(name), collector);
    for (const registration of collector)
      await this._setupFixtureForRegistration(registration, testInfo, runnable);
    const params = {};
    for (const name of names) {
      const registration = this.pool.resolve(name);
      const fixture = this.instanceForId.get(registration.id);
      if (!fixture || fixture.failed)
        return null;
      params[name] = fixture.value;
    }
    return { result: params };
  }
  async resolveParametersAndRunFunction(fn, testInfo, autoFixtures, runnable) {
    const params = await this.resolveParametersForFunction(fn, testInfo, autoFixtures, runnable);
    if (params === null) {
      return null;
    }
    await testInfo._runWithTimeout(runnable, () => fn(params.result, testInfo));
  }
  async _setupFixtureForRegistration(registration, testInfo, runnable) {
    if (registration.scope === "test")
      this.testScopeClean = false;
    let fixture = this.instanceForId.get(registration.id);
    if (fixture)
      return fixture;
    fixture = new Fixture(this, registration);
    await fixture.setup(testInfo, runnable);
    return fixture;
  }
  dependsOnWorkerFixturesOnly(fn, location) {
    const names = getRequiredFixtureNames(fn, location);
    for (const name of names) {
      const registration = this.pool.resolve(name);
      if (registration.scope !== "worker")
        return false;
    }
    return true;
  }
};
function getRequiredFixtureNames(fn, location) {
  return import_common.fixtures.fixtureParameterNames(fn, location ?? { file: "<unknown>", line: 1, column: 1 }, (e) => {
    throw new Error(`${formatLocation(e.location)}: ${e.message}`);
  });
}

// packages/playwright/src/worker/testInfo.ts
var import_fs3 = __toESM(require("fs"));
var import_path3 = __toESM(require("path"));

// packages/playwright/src/worker/timeoutManager.ts
var colors = require("playwright-core/lib/utilsBundle").colors;
var { ManualPromise: ManualPromise2 } = require("playwright-core/lib/coreBundle").iso;
var { monotonicTime } = require("playwright-core/lib/coreBundle").iso;
var kMaxDeadline = 2147483647;
var TimeoutManager = class {
  constructor(timeout) {
    this._ignoreTimeouts = false;
    this._slow = false;
    this._defaultSlot = { timeout, elapsed: 0 };
  }
  setIgnoreTimeouts(ignoreTimeouts) {
    if (this._ignoreTimeouts === ignoreTimeouts)
      return;
    this._ignoreTimeouts = ignoreTimeouts;
    if (this._running) {
      if (ignoreTimeouts)
        this._running.slot.elapsed += monotonicTime() - this._running.start;
      else
        this._running.start = monotonicTime();
      this._updateTimeout(this._running);
    }
  }
  interrupt() {
    if (this._running)
      this._running.timeoutPromise.reject(this._createTimeoutError(this._running));
  }
  isTimeExhaustedFor(runnable) {
    const slot = runnable.fixture?.slot || runnable.slot || this._defaultSlot;
    return slot.timeout > 0 && slot.elapsed >= slot.timeout - 1;
  }
  async withRunnable(runnable, cb) {
    if (this._running)
      throw new Error(`Internal error: duplicate runnable`);
    const running = this._running = {
      runnable,
      slot: runnable.fixture?.slot || runnable.slot || this._defaultSlot,
      start: monotonicTime(),
      deadline: kMaxDeadline,
      timer: void 0,
      timeoutPromise: new ManualPromise2()
    };
    let debugTitle = "";
    try {
      if (debugTest.enabled) {
        debugTitle = runnable.fixture ? `${runnable.fixture.phase} "${runnable.fixture.title}"` : runnable.type;
        const location = runnable.location ? ` at "${formatLocation(runnable.location)}"` : ``;
        debugTest(`started ${debugTitle}${location}`);
      }
      this._updateTimeout(running);
      return await Promise.race([
        cb(),
        running.timeoutPromise
      ]);
    } finally {
      if (running.timer)
        clearTimeout(running.timer);
      running.timer = void 0;
      running.slot.elapsed += monotonicTime() - running.start;
      this._running = void 0;
      if (debugTest.enabled)
        debugTest(`finished ${debugTitle}`);
    }
  }
  _updateTimeout(running) {
    if (running.timer)
      clearTimeout(running.timer);
    running.timer = void 0;
    if (this._ignoreTimeouts || !running.slot.timeout) {
      running.deadline = kMaxDeadline;
      return;
    }
    running.deadline = running.start + (running.slot.timeout - running.slot.elapsed);
    const timeout = running.deadline - monotonicTime() + 1;
    if (timeout <= 0)
      running.timeoutPromise.reject(this._createTimeoutError(running));
    else
      running.timer = setTimeout(() => running.timeoutPromise.reject(this._createTimeoutError(running)), timeout);
  }
  defaultSlot() {
    return this._defaultSlot;
  }
  slow() {
    if (this._slow)
      return;
    this._slow = true;
    const slot = this._running ? this._running.slot : this._defaultSlot;
    slot.timeout = slot.timeout * 3;
    if (this._running)
      this._updateTimeout(this._running);
  }
  setTimeout(timeout) {
    const slot = this._running ? this._running.slot : this._defaultSlot;
    slot.timeout = timeout;
    if (this._running)
      this._updateTimeout(this._running);
  }
  currentSlotDeadline() {
    return this._running ? this._running.deadline : kMaxDeadline;
  }
  currentSlotType() {
    return this._running ? this._running.runnable.type : "test";
  }
  _createTimeoutError(running) {
    let message = "";
    const timeout = running.slot.timeout;
    const runnable = running.runnable;
    switch (runnable.type) {
      case "test": {
        if (runnable.fixture) {
          if (runnable.fixture.phase === "setup")
            message = `Test timeout of ${timeout}ms exceeded while setting up "${runnable.fixture.title}".`;
          else
            message = `Tearing down "${runnable.fixture.title}" exceeded the test timeout of ${timeout}ms.`;
        } else {
          message = `Test timeout of ${timeout}ms exceeded.`;
        }
        break;
      }
      case "afterEach":
      case "beforeEach":
        message = `Test timeout of ${timeout}ms exceeded while running "${runnable.type}" hook.`;
        break;
      case "beforeAll":
      case "afterAll":
        message = `"${runnable.type}" hook timeout of ${timeout}ms exceeded.`;
        break;
      case "teardown": {
        if (runnable.fixture)
          message = `Worker teardown timeout of ${timeout}ms exceeded while ${runnable.fixture.phase === "setup" ? "setting up" : "tearing down"} "${runnable.fixture.title}".`;
        else
          message = `Worker teardown timeout of ${timeout}ms exceeded.`;
        break;
      }
      case "skip":
      case "slow":
      case "fixme":
      case "fail":
        message = `"${runnable.type}" modifier timeout of ${timeout}ms exceeded.`;
        break;
    }
    const fixtureWithSlot = runnable.fixture?.slot ? runnable.fixture : void 0;
    if (fixtureWithSlot)
      message = `Fixture "${fixtureWithSlot.title}" timeout of ${timeout}ms exceeded during ${fixtureWithSlot.phase}.`;
    message = colors.red(message);
    const location = (fixtureWithSlot || runnable).location;
    const error = new TimeoutManagerError(message);
    error.name = "";
    error.stack = message + (location ? `
    at ${location.file}:${location.line}:${location.column}` : "");
    return error;
  }
};
var TimeoutManagerError = class extends Error {
};

// packages/playwright/src/worker/testTracing.ts
var import_fs2 = __toESM(require("fs"));
var import_path2 = __toESM(require("path"));
var import_coreBundle = require("playwright-core/lib/coreBundle");
var yazl = require("playwright-core/lib/utilsBundle").yazl;
var yauzl = require("playwright-core/lib/utilsBundle").yauzl;
var { ManualPromise: ManualPromise3 } = require("playwright-core/lib/coreBundle").iso;
var { monotonicTime: monotonicTime2 } = require("playwright-core/lib/coreBundle").iso;
var { calculateSha1: calculateSha12, createGuid } = require("playwright-core/lib/coreBundle").utils;
var { SerializedFS } = require("playwright-core/lib/coreBundle").utils;
var testTraceEntryName = "test.trace";
var version = 8;
var traceOrdinal = 0;
var TestTracing = class {
  constructor(testInfo, artifactsDir) {
    this._traceEvents = [];
    this._temporaryTraceFiles = [];
    this._didFinishTestFunctionAndAfterEachHooks = false;
    this._testInfo = testInfo;
    this._artifactsDir = artifactsDir;
    this._tracesDir = import_path2.default.join(this._artifactsDir, "traces");
    this._contextCreatedEvent = {
      version,
      type: "context-options",
      origin: "testRunner",
      browserName: "",
      playwrightVersion: (0, import_coreBundle.getPlaywrightVersion)(),
      options: {},
      platform: process.platform,
      wallTime: Date.now(),
      monotonicTime: monotonicTime2(),
      sdkLanguage: "javascript"
    };
    this._appendTraceEvent(this._contextCreatedEvent);
  }
  _shouldCaptureTrace() {
    if (this._options?.mode === "on")
      return true;
    if (this._options?.mode === "retain-on-failure")
      return true;
    if (this._options?.mode === "on-first-retry" && this._testInfo.retry === 1)
      return true;
    if (this._options?.mode === "on-all-retries" && this._testInfo.retry > 0)
      return true;
    if (this._options?.mode === "retain-on-first-failure" && this._testInfo.retry === 0)
      return true;
    if (this._options?.mode === "retain-on-failure-and-retries")
      return true;
    return false;
  }
  async startIfNeeded(value) {
    const defaultTraceOptions = { screenshots: true, snapshots: true, sources: true, attachments: true, live: false, mode: "off" };
    if (!value) {
      this._options = defaultTraceOptions;
    } else if (typeof value === "string") {
      this._options = { ...defaultTraceOptions, mode: value === "retry-with-trace" ? "on-first-retry" : value };
    } else {
      const mode = value.mode || "off";
      this._options = { ...defaultTraceOptions, ...value, mode: mode === "retry-with-trace" ? "on-first-retry" : mode };
    }
    if (!this._shouldCaptureTrace()) {
      this._options = void 0;
      return;
    }
    if (!this._liveTraceFile && this._options.live) {
      this._liveTraceFile = { file: import_path2.default.join(this._tracesDir, `${this._testInfo.testId}-test.trace`), fs: new SerializedFS() };
      this._liveTraceFile.fs.mkdir(import_path2.default.dirname(this._liveTraceFile.file));
      const data = this._traceEvents.map((e) => JSON.stringify(e)).join("\n") + "\n";
      this._liveTraceFile.fs.writeFile(this._liveTraceFile.file, data);
    }
  }
  didFinishTestFunctionAndAfterEachHooks() {
    this._didFinishTestFunctionAndAfterEachHooks = true;
  }
  artifactsDir() {
    return this._artifactsDir;
  }
  tracesDir() {
    return this._tracesDir;
  }
  traceTitle() {
    return [import_path2.default.relative(this._testInfo.project.testDir, this._testInfo.file) + ":" + this._testInfo.line, ...this._testInfo.titlePath.slice(1)].join(" \u203A ");
  }
  generateNextTraceRecordingName() {
    const ordinalSuffix = traceOrdinal ? `-recording${traceOrdinal}` : "";
    ++traceOrdinal;
    const retrySuffix = this._testInfo.retry ? `-retry${this._testInfo.retry}` : "";
    return `${this._testInfo.testId}${retrySuffix}${ordinalSuffix}`;
  }
  _generateNextTraceRecordingPath() {
    const file = import_path2.default.join(this._artifactsDir, createGuid() + ".zip");
    this._temporaryTraceFiles.push(file);
    return file;
  }
  traceOptions() {
    return this._options;
  }
  maybeGenerateNextTraceRecordingPath() {
    if (this._didFinishTestFunctionAndAfterEachHooks && this._shouldAbandonTrace())
      return;
    return this._generateNextTraceRecordingPath();
  }
  _shouldAbandonTrace() {
    if (!this._options)
      return true;
    const testFailed = this._testInfo.status !== this._testInfo.expectedStatus;
    if (this._options.mode === "retain-on-failure-and-retries")
      return !testFailed && this._testInfo.retry === 0;
    return !testFailed && (this._options.mode === "retain-on-failure" || this._options.mode === "retain-on-first-failure");
  }
  async stopIfNeeded() {
    this._contextCreatedEvent.testTimeout = this._testInfo.timeout;
    if (!this._options)
      return;
    const error = await this._liveTraceFile?.fs.syncAndGetError();
    if (error)
      throw error;
    if (this._shouldAbandonTrace()) {
      for (const file of this._temporaryTraceFiles)
        await import_fs2.default.promises.unlink(file).catch(() => {
        });
      return;
    }
    const zipFile = new yazl.ZipFile();
    if (!this._options?.attachments) {
      for (const event of this._traceEvents) {
        if (event.type === "after")
          delete event.attachments;
      }
    }
    if (this._options?.sources) {
      const sourceFiles = /* @__PURE__ */ new Set();
      for (const event of this._traceEvents) {
        if (event.type === "before") {
          for (const frame of event.stack || [])
            sourceFiles.add(frame.file);
        }
      }
      for (const sourceFile of sourceFiles) {
        await import_fs2.default.promises.readFile(sourceFile, "utf8").then((source) => {
          zipFile.addBuffer(Buffer.from(source), "resources/src@" + calculateSha12(sourceFile) + ".txt");
        }).catch(() => {
        });
      }
    }
    const sha1s = /* @__PURE__ */ new Set();
    for (const event of this._traceEvents.filter((e) => e.type === "after")) {
      for (const attachment of event.attachments || []) {
        let contentPromise;
        if (attachment.path)
          contentPromise = import_fs2.default.promises.readFile(attachment.path).catch(() => void 0);
        else if (attachment.base64)
          contentPromise = Promise.resolve(Buffer.from(attachment.base64, "base64"));
        const content = await contentPromise;
        if (content === void 0)
          continue;
        const sha1 = calculateSha12(content);
        attachment.sha1 = sha1;
        delete attachment.path;
        delete attachment.base64;
        if (sha1s.has(sha1))
          continue;
        sha1s.add(sha1);
        zipFile.addBuffer(content, "resources/" + sha1);
      }
    }
    const traceContent = Buffer.from(this._traceEvents.map((e) => JSON.stringify(e)).join("\n"));
    zipFile.addBuffer(traceContent, testTraceEntryName);
    await new Promise((resolve, reject) => {
      zipFile.end(void 0, () => {
        zipFile.outputStream.pipe(import_fs2.default.createWriteStream(this._generateNextTraceRecordingPath())).on("close", resolve).on("error", reject);
      });
    });
    const tracePath = this._testInfo.outputPath("trace.zip");
    await mergeTraceFiles(tracePath, this._temporaryTraceFiles);
    this._testInfo.attachments.push({ name: "trace", path: tracePath, contentType: "application/zip" });
  }
  appendForError(error) {
    const rawStack = error.stack?.split("\n") || [];
    const stack = rawStack ? filteredStackTrace(rawStack) : [];
    this._appendTraceEvent({
      type: "error",
      message: this._formatError(error),
      stack
    });
  }
  _formatError(error) {
    const parts = [error.message || String(error.value)];
    if (error.cause)
      parts.push("[cause]: " + this._formatError(error.cause));
    return parts.join("\n");
  }
  appendStdioToTrace(type, chunk) {
    this._appendTraceEvent({
      type,
      timestamp: monotonicTime2(),
      text: typeof chunk === "string" ? chunk : void 0,
      base64: typeof chunk === "string" ? void 0 : chunk.toString("base64")
    });
  }
  appendBeforeActionForStep(options) {
    this._appendTraceEvent({
      type: "before",
      callId: options.stepId,
      stepId: options.stepId,
      parentId: options.parentId,
      startTime: monotonicTime2(),
      class: "Test",
      method: options.category,
      title: options.title,
      params: Object.fromEntries(Object.entries(options.params || {}).map(([name, value]) => [name, generatePreview(value)])),
      stack: options.stack,
      group: options.group
    });
  }
  appendAfterActionForStep(callId, error, attachments = [], annotations) {
    this._appendTraceEvent({
      type: "after",
      callId,
      endTime: monotonicTime2(),
      attachments: serializeAttachments(attachments),
      annotations,
      error
    });
  }
  _appendTraceEvent(event) {
    this._traceEvents.push(event);
    if (this._liveTraceFile)
      this._liveTraceFile.fs.appendFile(this._liveTraceFile.file, JSON.stringify(event) + "\n", true);
  }
};
function serializeAttachments(attachments) {
  if (attachments.length === 0)
    return void 0;
  return attachments.filter((a) => a.name !== "trace").map((a) => {
    return {
      name: a.name,
      contentType: a.contentType,
      path: a.path,
      base64: a.body?.toString("base64")
    };
  });
}
function generatePreview(value, visited = /* @__PURE__ */ new Set()) {
  if (visited.has(value))
    return "";
  visited.add(value);
  if (typeof value === "string")
    return value;
  if (typeof value === "number")
    return value.toString();
  if (typeof value === "boolean")
    return value.toString();
  if (value === null)
    return "null";
  if (value === void 0)
    return "undefined";
  if (Array.isArray(value))
    return "[" + value.map((v) => generatePreview(v, visited)).join(", ") + "]";
  if (typeof value === "object")
    return "Object";
  return String(value);
}
async function mergeTraceFiles(fileName, temporaryTraceFiles) {
  temporaryTraceFiles = temporaryTraceFiles.filter((file) => import_fs2.default.existsSync(file));
  if (temporaryTraceFiles.length === 1) {
    await import_fs2.default.promises.rename(temporaryTraceFiles[0], fileName);
    return;
  }
  const mergePromise = new ManualPromise3();
  const zipFile = new yazl.ZipFile();
  const entryNames = /* @__PURE__ */ new Set();
  zipFile.on("error", (error) => mergePromise.reject(error));
  for (let i = temporaryTraceFiles.length - 1; i >= 0; --i) {
    const tempFile = temporaryTraceFiles[i];
    const promise = new ManualPromise3();
    yauzl.open(tempFile, (err, inZipFile) => {
      if (err) {
        promise.reject(err);
        return;
      }
      let pendingEntries = inZipFile.entryCount;
      inZipFile.on("entry", (entry) => {
        let entryName = entry.fileName;
        if (entry.fileName === testTraceEntryName) {
        } else if (entry.fileName.match(/trace\.[a-z]*$/)) {
          entryName = i + "-" + entry.fileName;
        }
        if (entryNames.has(entryName)) {
          if (--pendingEntries === 0)
            promise.resolve();
          return;
        }
        entryNames.add(entryName);
        inZipFile.openReadStream(entry, (err2, readStream) => {
          if (err2) {
            promise.reject(err2);
            return;
          }
          zipFile.addReadStream(readStream, entryName);
          if (--pendingEntries === 0)
            promise.resolve();
        });
      });
    });
    await promise;
  }
  zipFile.end(void 0, () => {
    zipFile.outputStream.pipe(import_fs2.default.createWriteStream(fileName)).on("close", () => {
      void Promise.all(temporaryTraceFiles.map((tempFile) => import_fs2.default.promises.unlink(tempFile))).then(() => {
        mergePromise.resolve();
      }).catch((error) => mergePromise.reject(error));
    }).on("error", (error) => mergePromise.reject(error));
  });
  await mergePromise;
}

// packages/playwright/src/worker/util.ts
function testInfoError(error) {
  const result = serializeError(error);
  const matcherResult = error instanceof Error ? error.matcherResult : void 0;
  if (matcherResult?.ariaSnapshot !== void 0)
    result.errorContext = matcherResult.ariaSnapshot;
  return result;
}

// packages/playwright/src/worker/testInfo.ts
var import_common2 = require("../common");
var { ManualPromise: ManualPromise4 } = require("playwright-core/lib/coreBundle").iso;
var { captureRawStack, stringifyStackFrames: stringifyStackFrames2 } = require("playwright-core/lib/coreBundle").iso;
var { escapeWithQuotes: escapeWithQuotes2 } = require("playwright-core/lib/coreBundle").iso;
var { monotonicTime: monotonicTime3 } = require("playwright-core/lib/coreBundle").iso;
var { createGuid: createGuid2 } = require("playwright-core/lib/coreBundle").utils;
var { sanitizeForFilePath: sanitizeForFilePath2, trimLongString } = require("playwright-core/lib/coreBundle").utils;
var { currentZone } = require("playwright-core/lib/coreBundle").utils;
var emtpyTestInfoCallbacks = {
  onStepBegin: () => {
  },
  onStepEnd: () => {
  },
  onAttach: () => {
  },
  onTestPaused: () => Promise.reject(new Error("TestInfoImpl not initialized"))
};
var TestInfoImpl = class {
  constructor(configInternal, projectInternal, workerParams, test, retry, callbacks) {
    this._snapshotNames = { lastAnonymousSnapshotIndex: 0, lastNamedSnapshotIndex: {} };
    this._ariaSnapshotNames = { lastAnonymousSnapshotIndex: 0, lastNamedSnapshotIndex: {} };
    this._interruptedPromise = new ManualPromise4();
    this._lastStepId = 0;
    this._steps = [];
    this._stepMap = /* @__PURE__ */ new Map();
    this._onDidFinishTestFunctionCallbacks = /* @__PURE__ */ new Set();
    this._hasNonRetriableError = false;
    this._hasUnhandledError = false;
    this._allowSkips = false;
    this.duration = 0;
    this.annotations = [];
    this.attachments = [];
    this.status = "passed";
    this.snapshotSuffix = "";
    this.errors = [];
    this._ignoreTimeoutsCounter = 0;
    this.testId = test?.id ?? "";
    this._callbacks = callbacks;
    this._startTime = monotonicTime3();
    this._startWallTime = Date.now();
    this._requireFile = test?._requireFile ?? "";
    this._uniqueSymbol = Symbol("testInfoUniqueSymbol");
    this._workerParams = workerParams;
    this.repeatEachIndex = workerParams.repeatEachIndex;
    this.retry = retry;
    this.workerIndex = workerParams.workerIndex;
    this.parallelIndex = workerParams.parallelIndex;
    this._projectInternal = projectInternal;
    this.project = projectInternal.project;
    this._configInternal = configInternal;
    this.config = configInternal.config;
    this.title = test?.title ?? "";
    this.titlePath = test?.titlePath() ?? [];
    this.file = test?.location.file ?? "";
    this.line = test?.location.line ?? 0;
    this.column = test?.location.column ?? 0;
    this.tags = test?.tags ?? [];
    this.fn = test?.fn ?? (() => {
    });
    this.expectedStatus = test?.expectedStatus ?? "skipped";
    this._timeoutManager = new TimeoutManager(this.project.timeout);
    if (configInternal.configCLIOverrides.debug === "inspector")
      this._setIgnoreTimeouts(true);
    this.outputDir = (() => {
      const relativeTestFilePath = import_path3.default.relative(this.project.testDir, this._requireFile.replace(/\.(spec|test)\.(js|ts|jsx|tsx|mjs|mts|cjs|cts)$/, ""));
      const sanitizedRelativePath = relativeTestFilePath.replace(process.platform === "win32" ? new RegExp("\\\\", "g") : new RegExp("/", "g"), "-");
      const fullTitleWithoutSpec = this.titlePath.slice(1).join(" ");
      let testOutputDir = trimLongString(sanitizedRelativePath + "-" + sanitizeForFilePath2(fullTitleWithoutSpec), windowsFilesystemFriendlyLength);
      if (projectInternal.id)
        testOutputDir += "-" + sanitizeForFilePath2(projectInternal.id);
      if (this.retry)
        testOutputDir += "-retry" + this.retry;
      if (this.repeatEachIndex)
        testOutputDir += "-repeat" + this.repeatEachIndex;
      return import_path3.default.join(this.project.outputDir, testOutputDir);
    })();
    this.snapshotDir = (() => {
      const relativeTestFilePath = import_path3.default.relative(this.project.testDir, this._requireFile);
      return import_path3.default.join(this.project.snapshotDir, relativeTestFilePath + "-snapshots");
    })();
    this._attachmentsPush = this.attachments.push.bind(this.attachments);
    const attachmentsPush = (...attachments) => {
      for (const a of attachments)
        this._attach(a, this._parentStep()?.stepId);
      return this.attachments.length;
    };
    Object.defineProperty(this.attachments, "push", {
      value: attachmentsPush,
      writable: true,
      enumerable: false,
      configurable: true
    });
    this._tracing = new TestTracing(this, workerParams.artifactsDir);
    this.skip = import_common2.transform.wrapFunctionWithLocation((location, ...args) => this._modifier("skip", location, args));
    this.fixme = import_common2.transform.wrapFunctionWithLocation((location, ...args) => this._modifier("fixme", location, args));
    this.fail = import_common2.transform.wrapFunctionWithLocation((location, ...args) => this._modifier("fail", location, args));
    this.slow = import_common2.transform.wrapFunctionWithLocation((location, ...args) => this._modifier("slow", location, args));
  }
  get error() {
    return this.errors[0];
  }
  set error(e) {
    if (e === void 0)
      throw new Error("Cannot assign testInfo.error undefined value!");
    this.errors[0] = e;
  }
  get timeout() {
    return this._timeoutManager.defaultSlot().timeout;
  }
  set timeout(timeout) {
  }
  _deadline() {
    return { deadline: this._timeoutManager.currentSlotDeadline(), timeout: this.timeout };
  }
  _modifier(type, location, modifierArgs) {
    if (typeof modifierArgs[1] === "function") {
      throw new Error([
        "It looks like you are calling test.skip() inside the test and pass a callback.",
        "Pass a condition instead and optional description instead:",
        `test('my test', async ({ page, isMobile }) => {`,
        `  test.skip(isMobile, 'This test is not applicable on mobile');`,
        `});`
      ].join("\n"));
    }
    if (modifierArgs.length >= 1 && !modifierArgs[0])
      return;
    const description = modifierArgs[1];
    this.annotations.push({ type, description, location });
    if (type === "slow") {
      this._timeoutManager.slow();
    } else if (type === "skip" || type === "fixme") {
      this.expectedStatus = "skipped";
      throw new TestSkipError("Test is skipped: " + (description || ""));
    } else if (type === "fail") {
      if (this.expectedStatus !== "skipped")
        this.expectedStatus = "failed";
    }
  }
  _findLastPredefinedStep(steps) {
    for (let i = steps.length - 1; i >= 0; i--) {
      const child = this._findLastPredefinedStep(steps[i].steps);
      if (child)
        return child;
      if ((steps[i].category === "hook" || steps[i].category === "fixture") && !steps[i].endWallTime)
        return steps[i];
    }
  }
  _parentStep() {
    return currentZone().data("stepZone") ?? this._findLastPredefinedStep(this._steps);
  }
  _addStep(data, parentStep) {
    const stepId = `${data.category}@${++this._lastStepId}`;
    if (data.category === "hook" || data.category === "fixture") {
      parentStep = this._findLastPredefinedStep(this._steps);
    } else {
      if (!parentStep)
        parentStep = this._parentStep();
    }
    const filteredStack = filteredStackTrace(captureRawStack());
    let boxedStack = parentStep?.boxedStack;
    let location = data.location;
    if (!boxedStack && data.box) {
      boxedStack = filteredStack.slice(1);
      location = location || boxedStack[0];
    }
    location = location || filteredStack[0];
    const step = {
      ...data,
      stepId,
      group: parentStep?.group ?? data.group,
      boxedStack,
      location,
      steps: [],
      attachmentIndices: [],
      info: new TestStepInfoImpl(this, stepId, data.title, parentStep?.info),
      complete: (result) => {
        if (step.endWallTime)
          return;
        step.endWallTime = Date.now();
        if (result.attachments) {
          for (const attachment of result.attachments)
            this._attach(attachment, stepId);
        }
        if (result.error) {
          if (typeof result.error === "object" && !result.error?.[stepSymbol])
            result.error[stepSymbol] = step;
          const error = testInfoError(result.error);
          if (step.boxedStack)
            error.stack = `${error.message}
${stringifyStackFrames2(step.boxedStack).join("\n")}`;
          step.error = error;
        }
        if (result.softError) {
          step.infectParentStepsWithError = true;
          this._failWithError(result.softError);
        }
        if (result.shouldNotRetryTest)
          this._hasNonRetriableError = true;
        if (!step.error) {
          for (const childStep of step.steps) {
            if (childStep.error && childStep.infectParentStepsWithError) {
              step.error = childStep.error;
              step.infectParentStepsWithError = true;
              break;
            }
          }
        }
        if (!step.group) {
          const payload = {
            testId: this.testId,
            stepId,
            wallTime: step.endWallTime,
            error: step.error ? import_common2.ipc.toTestInfoErrorPayload(step.error) : void 0,
            suggestedRebaseline: result.suggestedRebaseline,
            annotations: step.info.annotations
          };
          this._callbacks.onStepEnd(payload);
        }
        if (step.group !== "internal") {
          const errorForTrace = step.error ? { name: "", message: step.error.message || "", stack: step.error.stack } : void 0;
          const attachments = step.attachmentIndices.map((i) => this.attachments[i]);
          this._tracing.appendAfterActionForStep(stepId, errorForTrace, attachments, step.info.annotations);
        }
      }
    };
    const parentStepList = parentStep ? parentStep.steps : this._steps;
    parentStepList.push(step);
    this._stepMap.set(stepId, step);
    if (!step.group) {
      const payload = {
        testId: this.testId,
        stepId,
        parentStepId: parentStep ? parentStep.stepId : void 0,
        title: step.title,
        category: step.category,
        wallTime: Date.now(),
        location: step.location
      };
      this._callbacks.onStepBegin(payload);
    }
    if (step.group !== "internal") {
      this._tracing.appendBeforeActionForStep({
        stepId,
        parentId: parentStep?.stepId,
        title: step.shortTitle ?? step.title,
        category: step.category,
        params: step.params,
        stack: step.location ? [step.location] : [],
        group: step.group
      });
    }
    return step;
  }
  _abort(location, message) {
    this.annotations.push({ type: "abort", description: message, location });
    throw new TestAbortError("Test aborted" + (message ? ": " + message : ""));
  }
  _interrupt() {
    this._interruptedPromise.resolve();
    this._timeoutManager.interrupt();
    if (this.status === "passed")
      this.status = "interrupted";
  }
  _failWithError(root) {
    if (this.status === "passed" || this.status === "skipped")
      this.status = root instanceof TimeoutManagerError ? "timedOut" : "failed";
    const visit = (error) => {
      const serialized = testInfoError(error);
      const step = error === root && typeof error === "object" ? error?.[stepSymbol] : void 0;
      if (step && step.boxedStack)
        serialized.stack = `${error.name}: ${error.message}
${stringifyStackFrames2(step.boxedStack).join("\n")}`;
      this.errors.push(serialized);
      this._tracing.appendForError(serialized);
      const children = error?.errors;
      if (Array.isArray(children)) {
        for (const child of children)
          visit(child);
      }
    };
    visit(root);
  }
  async _runAsStep(stepInfo, cb) {
    const step = this._addStep(stepInfo);
    try {
      await cb();
      step.complete({});
    } catch (error) {
      step.complete({ error });
      throw error;
    }
  }
  async _runWithTimeout(runnable, cb) {
    try {
      await this._timeoutManager.withRunnable(runnable, async () => {
        try {
          await cb();
        } catch (e) {
          if (this._allowSkips && e instanceof TestSkipError) {
            if (this.status === "passed")
              this.status = "skipped";
          } else {
            this._failWithError(e);
          }
          throw e;
        }
      });
    } catch (error) {
      if (!this._interruptedPromise.isDone() && error instanceof TimeoutManagerError)
        this._failWithError(error);
      throw error;
    }
  }
  _isFailure() {
    return this.status !== "skipped" && this.status !== this.expectedStatus;
  }
  _currentHookType() {
    const type = this._timeoutManager.currentSlotType();
    return ["beforeAll", "afterAll", "beforeEach", "afterEach"].includes(type) ? type : void 0;
  }
  _setIgnoreTimeouts(ignoreTimeouts) {
    this._ignoreTimeoutsCounter += ignoreTimeouts ? 1 : -1;
    this._timeoutManager.setIgnoreTimeouts(this._ignoreTimeoutsCounter > 0);
  }
  async _didFinishTestFunction() {
    const shouldPause = this._workerParams.pauseAtEnd && !this._isFailure() || this._workerParams.pauseOnError && this._isFailure();
    if (shouldPause) {
      await Promise.race([
        this._callbacks.onTestPaused({ testId: this.testId, errors: this._isFailure() ? this.errors.map(import_common2.ipc.toTestInfoErrorPayload) : [], status: this.status }),
        this._interruptedPromise
      ]);
    }
    for (const cb of this._onDidFinishTestFunctionCallbacks)
      await cb();
  }
  // ------------ TestInfo methods ------------
  async attach(name, options = {}) {
    const step = this._addStep({
      title: `Attach ${escapeWithQuotes2(name, '"')}`,
      category: "test.attach"
    });
    this._attach(
      await normalizeAndSaveAttachment(this.outputPath(), name, options),
      step.stepId
    );
    step.complete({});
  }
  _attach(attachment, stepId) {
    const index = this._attachmentsPush(attachment) - 1;
    let step = stepId ? this._stepMap.get(stepId) : void 0;
    if (!!step?.group)
      step = void 0;
    if (step) {
      step.attachmentIndices.push(index);
    } else {
      const stepId2 = `attach@${createGuid2()}`;
      this._tracing.appendBeforeActionForStep({ stepId: stepId2, title: `Attach ${escapeWithQuotes2(attachment.name, '"')}`, category: "test.attach", stack: [] });
      this._tracing.appendAfterActionForStep(stepId2, void 0, [attachment]);
    }
    this._callbacks.onAttach({
      testId: this.testId,
      name: attachment.name,
      contentType: attachment.contentType,
      path: attachment.path,
      body: attachment.body?.toString("base64"),
      stepId: step?.stepId
    });
  }
  outputPath(...pathSegments) {
    const outputPath = this._getOutputPath(...pathSegments);
    import_fs3.default.mkdirSync(this.outputDir, { recursive: true });
    return outputPath;
  }
  _getOutputPath(...pathSegments) {
    const joinedPath = import_path3.default.join(...pathSegments);
    const outputPath = getContainedPath(this.outputDir, joinedPath);
    if (outputPath)
      return outputPath;
    throw new Error(`The outputPath is not allowed outside of the parent directory. Please fix the defined path.

	outputPath: ${joinedPath}`);
  }
  _fsSanitizedTestName() {
    const fullTitleWithoutSpec = this.titlePath.slice(1).join(" ");
    return sanitizeForFilePath2(trimLongString(fullTitleWithoutSpec));
  }
  _resolveSnapshotPaths(kind, name, updateSnapshotIndex, anonymousExtension) {
    const snapshotNames = kind === "aria" ? this._ariaSnapshotNames : this._snapshotNames;
    const defaultExtensions = { "aria": ".aria.yml", "screenshot": ".png", "snapshot": ".txt" };
    const ariaAwareExtname = (filePath) => kind === "aria" && filePath.endsWith(".aria.yml") ? ".aria.yml" : import_path3.default.extname(filePath);
    let subPath;
    let ext;
    let relativeOutputPath;
    if (!name) {
      const index = snapshotNames.lastAnonymousSnapshotIndex + 1;
      if (updateSnapshotIndex === "updateSnapshotIndex")
        snapshotNames.lastAnonymousSnapshotIndex = index;
      const fullTitleWithoutSpec = [...this.titlePath.slice(1), index].join(" ");
      ext = anonymousExtension ?? defaultExtensions[kind];
      subPath = sanitizeFilePathBeforeExtension(trimLongString(fullTitleWithoutSpec) + ext, ext);
      relativeOutputPath = sanitizeFilePathBeforeExtension(trimLongString(fullTitleWithoutSpec, windowsFilesystemFriendlyLength) + ext, ext);
    } else {
      if (Array.isArray(name)) {
        subPath = import_path3.default.join(...name);
        relativeOutputPath = import_path3.default.join(...name);
        ext = ariaAwareExtname(subPath);
      } else {
        ext = ariaAwareExtname(name);
        subPath = sanitizeFilePathBeforeExtension(name, ext);
        relativeOutputPath = sanitizeFilePathBeforeExtension(trimLongString(name, windowsFilesystemFriendlyLength), ext);
      }
      const index = (snapshotNames.lastNamedSnapshotIndex[relativeOutputPath] || 0) + 1;
      if (updateSnapshotIndex === "updateSnapshotIndex")
        snapshotNames.lastNamedSnapshotIndex[relativeOutputPath] = index;
      if (index > 1)
        relativeOutputPath = addSuffixToFilePath(relativeOutputPath, `-${index - 1}`);
    }
    const legacyTemplate = "{snapshotDir}/{testFileDir}/{testFileName}-snapshots/{arg}{-projectName}{-snapshotSuffix}{ext}";
    let template;
    if (kind === "screenshot") {
      template = this._projectInternal.expect?.toHaveScreenshot?.pathTemplate || this._projectInternal.snapshotPathTemplate || legacyTemplate;
    } else if (kind === "aria") {
      const ariaDefaultTemplate = "{snapshotDir}/{testFileDir}/{testFileName}-snapshots/{arg}{ext}";
      template = this._projectInternal.expect?.toMatchAriaSnapshot?.pathTemplate || this._projectInternal.snapshotPathTemplate || ariaDefaultTemplate;
    } else {
      template = this._projectInternal.snapshotPathTemplate || legacyTemplate;
    }
    const nameArgument = import_path3.default.join(import_path3.default.dirname(subPath), import_path3.default.basename(subPath, ext));
    const absoluteSnapshotPath = this._applyPathTemplate(template, nameArgument, ext);
    return { absoluteSnapshotPath, relativeOutputPath };
  }
  _applyPathTemplate(template, nameArgument, ext) {
    const relativeTestFilePath = import_path3.default.relative(this.project.testDir, this._requireFile);
    const parsedRelativeTestFilePath = import_path3.default.parse(relativeTestFilePath);
    const projectNamePathSegment = sanitizeForFilePath2(this.project.name);
    const snapshotPath = template.replace(/\{(.)?testDir\}/g, "$1" + this.project.testDir).replace(/\{(.)?snapshotDir\}/g, "$1" + this.project.snapshotDir).replace(/\{(.)?snapshotSuffix\}/g, this.snapshotSuffix ? "$1" + this.snapshotSuffix : "").replace(/\{(.)?testFileDir\}/g, "$1" + parsedRelativeTestFilePath.dir).replace(/\{(.)?platform\}/g, "$1" + process.platform).replace(/\{(.)?projectName\}/g, projectNamePathSegment ? "$1" + projectNamePathSegment : "").replace(/\{(.)?testName\}/g, "$1" + this._fsSanitizedTestName()).replace(/\{(.)?testFileBaseName\}/g, "$1" + parsedRelativeTestFilePath.name).replace(/\{(.)?testFileName\}/g, "$1" + parsedRelativeTestFilePath.base).replace(/\{(.)?testFilePath\}/g, "$1" + relativeTestFilePath).replace(/\{(.)?arg\}/g, "$1" + nameArgument).replace(/\{(.)?ext\}/g, ext ? "$1" + ext : "");
    return import_path3.default.normalize(import_path3.default.resolve(this._configInternal.configDir, snapshotPath));
  }
  snapshotPath(...args) {
    let name = args;
    let kind = "snapshot";
    const options = args[args.length - 1];
    if (options && typeof options === "object") {
      kind = options.kind ?? kind;
      name = args.slice(0, -1);
    }
    if (!["snapshot", "screenshot", "aria"].includes(kind))
      throw new Error(`testInfo.snapshotPath: unknown kind "${kind}", must be one of "snapshot", "screenshot" or "aria"`);
    return this._resolveSnapshotPaths(kind, name.length <= 1 ? name[0] : name, "dontUpdateSnapshotIndex").absoluteSnapshotPath;
  }
  setTimeout(timeout) {
    this._timeoutManager.setTimeout(timeout);
  }
  artifactsDir() {
    return this._workerParams.artifactsDir;
  }
};
var TestStepInfoImpl = class {
  constructor(testInfo, stepId, title, parentStep) {
    this.annotations = [];
    this._testInfo = testInfo;
    this._stepId = stepId;
    this._title = title;
    this._parentStep = parentStep;
    this.skip = import_common2.transform.wrapFunctionWithLocation((location, ...args) => {
      if (args.length > 0 && !args[0])
        return;
      const description = args[1];
      this.annotations.push({ type: "skip", description, location });
      throw new StepSkipError(description);
    });
  }
  async _runStepBody(skip, body, location) {
    if (skip) {
      this.annotations.push({ type: "skip", location });
      return void 0;
    }
    try {
      return await body(this);
    } catch (e) {
      if (e instanceof StepSkipError)
        return void 0;
      throw e;
    }
  }
  async attach(name, options) {
    this._testInfo._attach(await normalizeAndSaveAttachment(this._testInfo.outputPath(), name, options), this._stepId);
  }
  get titlePath() {
    const parent = this._parentStep ?? this._testInfo;
    return [...parent.titlePath, this._title];
  }
};
var TestSkipError = class extends Error {
};
var TestAbortError = class extends Error {
};
var StepSkipError = class extends Error {
};
var stepSymbol = Symbol("step");

// packages/playwright/src/worker/workerMain.ts
var colors2 = require("playwright-core/lib/utilsBundle").colors;
var { ManualPromise: ManualPromise5 } = require("playwright-core/lib/coreBundle").iso;
var { removeFolders } = require("playwright-core/lib/coreBundle").utils;
var { gracefullyCloseAll } = require("playwright-core/lib/coreBundle").utils;
var WorkerMain = class extends import_common3.ProcessRunner {
  constructor(params) {
    super();
    // Accumulated fatal errors that cannot be attributed to a test.
    this._fatalErrors = [];
    // The stage of the full cleanup. Once "finished", we can safely stop running anything.
    this._didRunFullCleanup = false;
    // Whether the worker was stopped due to an unhandled error in a test marked with test.fail().
    // This should force dispatcher to use a new worker instead.
    this._stoppedDueToUnhandledErrorInTestFail = false;
    // Whether the worker was requested to stop.
    this._isStopped = false;
    // This promise resolves once the single "run test group" call finishes.
    this._runFinished = new ManualPromise5();
    this._currentTest = null;
    this._lastRunningTests = [];
    this._totalRunningTests = 0;
    // Suites that had their beforeAll hooks, but not afterAll hooks executed.
    // These suites still need afterAll hooks to be executed for the proper cleanup.
    // Contains dynamic annotations originated by modifiers with a callback, e.g. `test.skip(() => true)`.
    this._activeSuites = /* @__PURE__ */ new Map();
    process.env.TEST_WORKER_INDEX = String(params.workerIndex);
    process.env.TEST_PARALLEL_INDEX = String(params.parallelIndex);
    globals.setIsWorkerProcess();
    this._params = params;
    this._fixtureRunner = new FixtureRunner();
    this._runFinished.resolve();
    process.on("unhandledRejection", (reason) => this.unhandledError(reason));
    process.on("uncaughtException", (error) => this.unhandledError(error));
    process.stdout.write = (chunk, cb) => {
      this.dispatchEvent("stdOut", import_common3.ipc.stdioChunkToParams(chunk));
      this._currentTest?._tracing.appendStdioToTrace("stdout", chunk);
      if (typeof cb === "function")
        process.nextTick(cb);
      return true;
    };
    if (!process.env.PW_RUNNER_DEBUG) {
      process.stderr.write = (chunk, cb) => {
        this.dispatchEvent("stdErr", import_common3.ipc.stdioChunkToParams(chunk));
        this._currentTest?._tracing.appendStdioToTrace("stderr", chunk);
        if (typeof cb === "function")
          process.nextTick(cb);
        return true;
      };
    }
  }
  _stop() {
    if (!this._isStopped) {
      this._isStopped = true;
      this._currentTest?._interrupt();
    }
    return this._runFinished;
  }
  async gracefullyClose() {
    try {
      await this._stop();
      if (!this._config) {
        return;
      }
      const fakeTestInfo = new TestInfoImpl(this._config, this._project, this._params, void 0, 0, emtpyTestInfoCallbacks);
      const runnable = { type: "teardown" };
      await fakeTestInfo._runWithTimeout(runnable, () => this._loadIfNeeded()).catch(() => {
      });
      await this._fixtureRunner.teardownScope("test", fakeTestInfo, runnable).catch(() => {
      });
      await this._fixtureRunner.teardownScope("worker", fakeTestInfo, runnable).catch(() => {
      });
      await fakeTestInfo._runWithTimeout(runnable, () => gracefullyCloseAll()).catch(() => {
      });
      this._fatalErrors.push(...fakeTestInfo.errors);
    } catch (e) {
      this._fatalErrors.push(testInfoError(e));
    }
    if (this._fatalErrors.length) {
      this._appendProcessTeardownDiagnostics(this._fatalErrors[this._fatalErrors.length - 1]);
      const payload = { fatalErrors: this._fatalErrors.map(import_common3.ipc.toTestInfoErrorPayload) };
      this.dispatchEvent("teardownErrors", payload);
    }
  }
  _appendProcessTeardownDiagnostics(error) {
    if (!this._lastRunningTests.length)
      return;
    const count = this._totalRunningTests === 1 ? "1 test" : `${this._totalRunningTests} tests`;
    let lastMessage = "";
    if (this._lastRunningTests.length < this._totalRunningTests)
      lastMessage = `, last ${this._lastRunningTests.length} tests were`;
    const message = [
      "",
      "",
      colors2.red(`Failed worker ran ${count}${lastMessage}:`),
      ...this._lastRunningTests.map((test) => formatTestTitle(test, this._project.project.name))
    ].join("\n");
    if (error.message) {
      if (error.stack) {
        let index = error.stack.indexOf(error.message);
        if (index !== -1) {
          index += error.message.length;
          error.stack = error.stack.substring(0, index) + message + error.stack.substring(index);
        }
      }
      error.message += message;
    } else if (error.value) {
      error.value += message;
    }
  }
  unhandledError(error) {
    if (!this._currentTest) {
      if (!this._fatalErrors.length)
        this._fatalErrors.push(testInfoError(error));
      void this._stop();
      return;
    }
    if (!this._currentTest._hasUnhandledError) {
      this._currentTest._hasUnhandledError = true;
      this._currentTest._failWithError(error);
    }
    const isExpectError = error instanceof Error && !!error.matcherResult;
    const shouldContinueInThisWorker = this._currentTest.expectedStatus === "failed" && isExpectError;
    if (!shouldContinueInThisWorker) {
      this._stoppedDueToUnhandledErrorInTestFail = true;
      void this._stop();
    }
  }
  async _loadIfNeeded() {
    if (this._config)
      return;
    const config = await import_common3.configLoader.deserializeConfig(this._params.config);
    const project = config.projects.find((p) => p.id === this._params.projectId);
    if (!project)
      throw new Error(`Project "${this._params.projectId}" not found in the worker process. Make sure project name does not change.`);
    this._config = config;
    this._project = project;
    this._poolBuilder = import_common3.poolBuilder.PoolBuilder.createForWorker(this._project);
    this._fixtureRunner.workerFixtureTimeout = this._project.project.timeout;
  }
  async runTestGroup(runPayload) {
    this._runFinished = new ManualPromise5();
    const entries = new Map(runPayload.entries.map((e) => [e.testId, e]));
    let fatalUnknownTestIds;
    try {
      await this._loadIfNeeded();
      const fileSuite = await import_common3.testLoader.loadTestFile(runPayload.file, this._config);
      const suite = import_common3.suiteUtils.bindFileSuiteToProject(this._project, fileSuite);
      if (this._params.repeatEachIndex)
        import_common3.suiteUtils.applyRepeatEachIndex(this._project, suite, this._params.repeatEachIndex);
      import_common3.suiteUtils.filterTestsRemoveEmptySuites(suite, (test) => entries.has(test.id));
      const tests = suite.allTests();
      const unknownTestIds = new Set(entries.keys());
      for (const test of tests)
        unknownTestIds.delete(test.id);
      if (unknownTestIds.size) {
        fatalUnknownTestIds = [...unknownTestIds];
        void this._stop();
        return;
      }
      this._poolBuilder.buildPools(suite);
      this._activeSuites = /* @__PURE__ */ new Map();
      this._didRunFullCleanup = false;
      for (let i = 0; i < tests.length; i++) {
        if (this._isStopped && this._didRunFullCleanup)
          break;
        const entry = entries.get(tests[i].id);
        entries.delete(tests[i].id);
        debugTest(`test started "${tests[i].title}"`);
        await this._runTest(tests[i], entry.retry, tests[i + 1]);
        debugTest(`test finished "${tests[i].title}"`);
      }
    } catch (e) {
      this._fatalErrors.push(testInfoError(e));
      void this._stop();
    } finally {
      const donePayload = {
        fatalErrors: this._fatalErrors.map(import_common3.ipc.toTestInfoErrorPayload),
        skipTestsDueToSetupFailure: [],
        fatalUnknownTestIds,
        stoppedDueToUnhandledErrorInTestFail: this._stoppedDueToUnhandledErrorInTestFail
      };
      for (const test of this._skipRemainingTestsInSuite?.allTests() || []) {
        if (entries.has(test.id))
          donePayload.skipTestsDueToSetupFailure.push(test.id);
      }
      this.dispatchEvent("done", donePayload);
      this._fatalErrors = [];
      this._skipRemainingTestsInSuite = void 0;
      this._runFinished.resolve();
    }
  }
  async customMessage(payload) {
    try {
      if (this._currentTest?.testId !== payload.testId)
        throw new Error("Test has already stopped");
      const response = await this._currentTest._onCustomMessageCallback?.(payload.request);
      return { response };
    } catch (error) {
      return { response: {}, error: import_common3.ipc.toTestInfoErrorPayload(testInfoError(error)) };
    }
  }
  resume(payload) {
    this._resumePromise?.resolve(payload);
  }
  async _runTest(test, retry, nextTest) {
    const testInfo = new TestInfoImpl(this._config, this._project, this._params, test, retry, {
      onStepBegin: (payload) => this.dispatchEvent("stepBegin", payload),
      onStepEnd: (payload) => this.dispatchEvent("stepEnd", payload),
      onAttach: (payload) => this.dispatchEvent("attach", payload),
      onTestPaused: (payload) => {
        this._resumePromise = new ManualPromise5();
        this.dispatchEvent("testPaused", payload);
        return this._resumePromise;
      }
    });
    const processAnnotation = (annotation) => {
      testInfo.annotations.push(annotation);
      switch (annotation.type) {
        case "fixme":
        case "skip":
          testInfo.expectedStatus = "skipped";
          break;
        case "fail":
          if (testInfo.expectedStatus !== "skipped")
            testInfo.expectedStatus = "failed";
          break;
        case "slow":
          testInfo._timeoutManager.slow();
          break;
      }
    };
    if (!this._isStopped)
      this._fixtureRunner.setPool(test._pool);
    const suites = getSuites(test);
    const reversedSuites = suites.slice().reverse();
    const nextSuites = new Set(getSuites(nextTest));
    testInfo._timeoutManager.setTimeout(test.timeout);
    for (const annotation of test.annotations)
      processAnnotation(annotation);
    for (const suite of suites) {
      const extraAnnotations = this._activeSuites.get(suite) || [];
      for (const annotation of extraAnnotations)
        processAnnotation(annotation);
    }
    this._currentTest = testInfo;
    globals.setCurrentTestInfo(testInfo);
    (0, import_expect.setExpectConfig)({
      testInfo,
      filteredStackTrace,
      ignoreSnapshots: testInfo._projectInternal.project.ignoreSnapshots,
      updateSnapshots: testInfo.config.updateSnapshots,
      timeout: testInfo._projectInternal.expect?.timeout,
      toHaveScreenshot: testInfo._projectInternal.expect?.toHaveScreenshot,
      toMatchSnapshot: testInfo._projectInternal.expect?.toMatchSnapshot,
      toMatchAriaSnapshot: testInfo._projectInternal.expect?.toMatchAriaSnapshot,
      toPass: testInfo._projectInternal.expect?.toPass
    });
    this.dispatchEvent("testBegin", buildTestBeginPayload(testInfo));
    const isSkipped = testInfo.expectedStatus === "skipped";
    const hasAfterAllToRunBeforeNextTest = reversedSuites.some((suite) => {
      return this._activeSuites.has(suite) && !nextSuites.has(suite) && suite._hooks.some((hook) => hook.type === "afterAll");
    });
    if (isSkipped && nextTest && !hasAfterAllToRunBeforeNextTest) {
      testInfo.status = "skipped";
      this.dispatchEvent("testEnd", buildTestEndPayload(testInfo));
      return;
    }
    this._totalRunningTests++;
    this._lastRunningTests.push(test);
    if (this._lastRunningTests.length > 10)
      this._lastRunningTests.shift();
    let shouldRunAfterEachHooks = false;
    testInfo._allowSkips = true;
    await (async () => {
      await testInfo._runWithTimeout({ type: "test" }, async () => {
        const traceFixtureRegistration = test._pool.resolve("trace");
        if (!traceFixtureRegistration)
          return;
        if (typeof traceFixtureRegistration.fn === "function")
          throw new Error(`"trace" option cannot be a function`);
        await testInfo._tracing.startIfNeeded(traceFixtureRegistration.fn);
      });
      if (this._isStopped || isSkipped) {
        testInfo.status = "skipped";
        return;
      }
      await removeFolders([testInfo.outputDir]);
      let testFunctionParams = null;
      await testInfo._runAsStep({ title: "Before Hooks", category: "hook" }, async () => {
        for (const suite of suites)
          await this._runBeforeAllHooksForSuite(suite, testInfo);
        shouldRunAfterEachHooks = true;
        await this._runEachHooksForSuites(suites, "beforeEach", testInfo);
        const params = await this._fixtureRunner.resolveParametersForFunction(test.fn, testInfo, "test", { type: "test" });
        if (params !== null)
          testFunctionParams = params.result;
      });
      if (testFunctionParams === null) {
        return;
      }
      await testInfo._runWithTimeout({ type: "test" }, async () => {
        const fn = test.fn;
        await fn(testFunctionParams, testInfo);
      });
    })().catch(() => {
    });
    testInfo.duration = testInfo._timeoutManager.defaultSlot().elapsed | 0;
    testInfo._allowSkips = true;
    const afterHooksTimeout = calculateMaxTimeout(this._project.project.timeout, testInfo.timeout);
    const afterHooksSlot = { timeout: afterHooksTimeout, elapsed: 0 };
    await testInfo._runAsStep({ title: "After Hooks", category: "hook" }, async () => {
      let firstAfterHooksError;
      try {
        await testInfo._runWithTimeout({ type: "test", slot: afterHooksSlot }, () => testInfo._didFinishTestFunction());
      } catch (error) {
        firstAfterHooksError = firstAfterHooksError ?? error;
      }
      try {
        if (shouldRunAfterEachHooks)
          await this._runEachHooksForSuites(reversedSuites, "afterEach", testInfo, afterHooksSlot);
      } catch (error) {
        firstAfterHooksError = firstAfterHooksError ?? error;
      }
      testInfo._tracing.didFinishTestFunctionAndAfterEachHooks();
      try {
        await this._fixtureRunner.teardownScope("test", testInfo, { type: "test", slot: afterHooksSlot });
      } catch (error) {
        firstAfterHooksError = firstAfterHooksError ?? error;
      }
      for (const suite of reversedSuites) {
        if (!nextSuites.has(suite) || testInfo._isFailure()) {
          try {
            await this._runAfterAllHooksForSuite(suite, testInfo);
          } catch (error) {
            firstAfterHooksError = firstAfterHooksError ?? error;
          }
        }
      }
      if (firstAfterHooksError)
        throw firstAfterHooksError;
    }).catch(() => {
    });
    if (testInfo._isFailure())
      this._isStopped = true;
    if (this._isStopped) {
      this._didRunFullCleanup = true;
      await testInfo._runAsStep({ title: "Worker Cleanup", category: "hook" }, async () => {
        let firstWorkerCleanupError;
        const teardownSlot = { timeout: this._project.project.timeout, elapsed: 0 };
        try {
          await this._fixtureRunner.teardownScope("test", testInfo, { type: "test", slot: teardownSlot });
        } catch (error) {
          firstWorkerCleanupError = firstWorkerCleanupError ?? error;
        }
        for (const suite of reversedSuites) {
          try {
            await this._runAfterAllHooksForSuite(suite, testInfo);
          } catch (error) {
            firstWorkerCleanupError = firstWorkerCleanupError ?? error;
          }
        }
        try {
          await this._fixtureRunner.teardownScope("worker", testInfo, { type: "teardown", slot: teardownSlot });
        } catch (error) {
          firstWorkerCleanupError = firstWorkerCleanupError ?? error;
        }
        if (firstWorkerCleanupError)
          throw firstWorkerCleanupError;
      }).catch(() => {
      });
    }
    const tracingSlot = { timeout: this._project.project.timeout, elapsed: 0 };
    await testInfo._runWithTimeout({ type: "test", slot: tracingSlot }, async () => {
      await testInfo._tracing.stopIfNeeded();
    }).catch(() => {
    });
    testInfo.duration = testInfo._timeoutManager.defaultSlot().elapsed + afterHooksSlot.elapsed | 0;
    this._currentTest = null;
    globals.setCurrentTestInfo(null);
    (0, import_expect.setExpectConfig)({ testInfo: null, filteredStackTrace, ignoreSnapshots: false, updateSnapshots: "missing" });
    this.dispatchEvent("testEnd", buildTestEndPayload(testInfo));
    const preserveOutput = this._config.config.preserveOutput === "always" || this._config.config.preserveOutput === "failures-only" && testInfo._isFailure();
    if (!preserveOutput)
      await removeFolders([testInfo.outputDir]);
  }
  _collectHooksAndModifiers(suite, type, testInfo) {
    const runnables = [];
    for (const modifier of suite._modifiers) {
      const modifierType = this._fixtureRunner.dependsOnWorkerFixturesOnly(modifier.fn, modifier.location) ? "beforeAll" : "beforeEach";
      if (modifierType !== type)
        continue;
      const fn = async (fixtures3) => {
        const result = await modifier.fn(fixtures3);
        testInfo._modifier(modifier.type, modifier.location, [!!result, modifier.description]);
      };
      import_common3.fixtures.inheritFixtureNames(modifier.fn, fn);
      runnables.push({
        title: `${modifier.type} modifier`,
        location: modifier.location,
        type: modifier.type,
        fn
      });
    }
    runnables.push(...suite._hooks.filter((hook) => hook.type === type));
    return runnables;
  }
  async _runBeforeAllHooksForSuite(suite, testInfo) {
    if (this._activeSuites.has(suite))
      return;
    const extraAnnotations = [];
    this._activeSuites.set(suite, extraAnnotations);
    await this._runAllHooksForSuite(suite, testInfo, "beforeAll", extraAnnotations);
  }
  async _runAllHooksForSuite(suite, testInfo, type, extraAnnotations) {
    let firstError;
    for (const hook of this._collectHooksAndModifiers(suite, type, testInfo)) {
      try {
        await testInfo._runAsStep({ title: hook.title, category: "hook", location: hook.location }, async () => {
          const timeSlot = { timeout: this._project.project.timeout, elapsed: 0 };
          const runnable = { type: hook.type, slot: timeSlot, location: hook.location };
          const existingAnnotations = new Set(testInfo.annotations);
          try {
            await this._fixtureRunner.resolveParametersAndRunFunction(hook.fn, testInfo, "all-hooks-only", runnable);
          } finally {
            if (extraAnnotations) {
              const newAnnotations = testInfo.annotations.filter((a) => !existingAnnotations.has(a));
              extraAnnotations.push(...newAnnotations);
            }
            await this._fixtureRunner.teardownScope("test", testInfo, runnable);
          }
        });
      } catch (error) {
        firstError = firstError ?? error;
        if (type === "beforeAll" && error instanceof TestSkipError)
          break;
        if (type === "beforeAll" && !this._skipRemainingTestsInSuite) {
          this._skipRemainingTestsInSuite = suite;
        }
      }
    }
    if (firstError)
      throw firstError;
  }
  async _runAfterAllHooksForSuite(suite, testInfo) {
    if (!this._activeSuites.has(suite))
      return;
    this._activeSuites.delete(suite);
    await this._runAllHooksForSuite(suite, testInfo, "afterAll");
  }
  async _runEachHooksForSuites(suites, type, testInfo, slot) {
    let firstError;
    const hooks = suites.map((suite) => this._collectHooksAndModifiers(suite, type, testInfo)).flat();
    for (const hook of hooks) {
      const runnable = { type: hook.type, location: hook.location, slot };
      if (testInfo._timeoutManager.isTimeExhaustedFor(runnable)) {
        continue;
      }
      try {
        await testInfo._runAsStep({ title: hook.title, category: "hook", location: hook.location }, async () => {
          await this._fixtureRunner.resolveParametersAndRunFunction(hook.fn, testInfo, "test", runnable);
        });
      } catch (error) {
        firstError = firstError ?? error;
        if (error instanceof TestSkipError)
          break;
      }
    }
    if (firstError)
      throw firstError;
  }
};
function buildTestBeginPayload(testInfo) {
  return {
    testId: testInfo.testId,
    startWallTime: testInfo._startWallTime
  };
}
function buildTestEndPayload(testInfo) {
  return {
    testId: testInfo.testId,
    duration: testInfo.duration,
    status: testInfo.status,
    errors: testInfo.errors.map(import_common3.ipc.toTestInfoErrorPayload),
    hasNonRetriableError: testInfo._hasNonRetriableError,
    expectedStatus: testInfo.expectedStatus,
    annotations: testInfo.annotations,
    timeout: testInfo.timeout
  };
}
function getSuites(test) {
  const suites = [];
  for (let suite = test?.parent; suite; suite = suite.parent)
    suites.push(suite);
  suites.reverse();
  return suites;
}
function formatTestTitle(test, projectName) {
  const [, ...titles] = test.titlePath();
  const location = `${relativeFilePath(test.location.file)}:${test.location.line}:${test.location.column}`;
  const projectTitle = projectName ? `[${projectName}] \u203A ` : "";
  return `${projectTitle}${location} \u203A ${titles.join(" \u203A ")}`;
}
function calculateMaxTimeout(t1, t2) {
  return !t1 || !t2 ? 0 : Math.max(t1, t2);
}
var create = (params) => new WorkerMain(params);

// packages/playwright/src/worker/workerProcessEntry.ts
(0, import_common4.startProcessRunner)(create);
# packages/playwright/lib/worker/workerProcessEntry.js
# total: 74.1 KB

## Inlined (8)
   4.4 KB  packages/playwright/src/util.ts
   8.6 KB  packages/playwright/src/worker/fixtureRunner.ts
  21.0 KB  packages/playwright/src/worker/testInfo.ts
  11.6 KB  packages/playwright/src/worker/testTracing.ts
   5.4 KB  packages/playwright/src/worker/timeoutManager.ts
   0.3 KB  packages/playwright/src/worker/util.ts
  21.0 KB  packages/playwright/src/worker/workerMain.ts
   0.1 KB  packages/playwright/src/worker/workerProcessEntry.ts

## External (6)
  ../common
  ../globals
  ../matchers/expect
  playwright-core/lib/coreBundle
  playwright-core/lib/utilsBundle
  playwright-core/package.json
{
  "name": "playwright",
  "version": "1.61.1",
  "description": "A high-level API to automate web browsers",
  "repository": {
    "type": "git",
    "url": "git+https://github.com/microsoft/playwright.git"
  },
  "homepage": "https://playwright.dev",
  "engines": {
    "node": ">=18"
  },
  "main": "index.js",
  "exports": {
    ".": {
      "types": "./index.d.ts",
      "import": "./index.mjs",
      "require": "./index.js",
      "default": "./index.js"
    },
    "./package.json": "./package.json",
    "./lib/common": "./lib/common/index.js",
    "./lib/fsWatcher": "./lib/fsWatcher.js",
    "./lib/mcp/index": "./lib/mcp/index.js",
    "./lib/program": "./lib/program.js",
    "./lib/runner": "./lib/runner/index.js",
    "./lib/isomorphic": "./lib/isomorphic/index.js",
    "./lib/transform/babelBundle": "./lib/transform/babelBundle.js",
    "./jsx-runtime": {
      "import": "./jsx-runtime.mjs",
      "require": "./jsx-runtime.js",
      "default": "./jsx-runtime.js"
    },
    "./lib/util": "./lib/util.js",
    "./types/test": {
      "types": "./types/test.d.ts"
    },
    "./types/testReporter": {
      "types": "./types/testReporter.d.ts"
    },
    "./test": {
      "types": "./test.d.ts",
      "import": "./test.mjs",
      "require": "./test.js",
      "default": "./test.js"
    }
  },
  "bin": {
    "playwright": "cli.js"
  },
  "author": {
    "name": "Microsoft Corporation"
  },
  "license": "Apache-2.0",
  "dependencies": {
    "playwright-core": "1.61.1"
  },
  "optionalDependencies": {
    "fsevents": "2.3.2"
  }
}
/**
 * Copyright (c) Microsoft Corporation.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

const pwt = require('./lib/index');
const playwright = require('./index');
const combinedExports = {
  ...playwright,
  ...pwt,
};

module.exports = Object.assign(combinedExports.test, combinedExports);
/**
 * Copyright (c) Microsoft Corporation.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

import playwright from './test.js';

export const chromium = playwright.chromium;
export const firefox = playwright.firefox;
export const webkit = playwright.webkit;
export const selectors = playwright.selectors;
export const devices = playwright.devices;
export const errors = playwright.errors;
export const request = playwright.request;
export const _electron = playwright._electron;
export const _android = playwright._android;
export const _baseTest = playwright._baseTest;
export const _utilityTest = playwright._utilityTest;
export const test = playwright.test;
export const expect = playwright.expect;
export const defineConfig = playwright.defineConfig;
export const mergeTests = playwright.mergeTests;
export const mergeExpects = playwright.mergeExpects;
export default playwright.test;
                                 Apache License
                           Version 2.0, January 2004
                        http://www.apache.org/licenses/

   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

   1. Definitions.

      "License" shall mean the terms and conditions for use, reproduction,
      and distribution as defined by Sections 1 through 9 of this document.

      "Licensor" shall mean the copyright owner or entity authorized by
      the copyright owner that is granting the License.

      "Legal Entity" shall mean the union of the acting entity and all
      other entities that control, are controlled by, or are under common
      control with that entity. For the purposes of this definition,
      "control" means (i) the power, direct or indirect, to cause the
      direction or management of such entity, whether by contract or
      otherwise, or (ii) ownership of fifty percent (50%) or more of the
      outstanding shares, or (iii) beneficial ownership of such entity.

      "You" (or "Your") shall mean an individual or Legal Entity
      exercising permissions granted by this License.

      "Source" form shall mean the preferred form for making modifications,
      including but not limited to software source code, documentation
      source, and configuration files.

      "Object" form shall mean any form resulting from mechanical
      transformation or translation of a Source form, including but
      not limited to compiled object code, generated documentation,
      and conversions to other media types.

      "Work" shall mean the work of authorship, whether in Source or
      Object form, made available under the License, as indicated by a
      copyright notice that is included in or attached to the work
      (an example is provided in the Appendix below).

      "Derivative Works" shall mean any work, whether in Source or Object
      form, that is based on (or derived from) the Work and for which the
      editorial revisions, annotations, elaborations, or other modifications
      represent, as a whole, an original work of authorship. For the purposes
      of this License, Derivative Works shall not include works that remain
      separable from, or merely link (or bind by name) to the interfaces of,
      the Work and Derivative Works thereof.

      "Contribution" shall mean any work of authorship, including
      the original version of the Work and any modifications or additions
      to that Work or Derivative Works thereof, that is intentionally
      submitted to Licensor for inclusion in the Work by the copyright owner
      or by an individual or Legal Entity authorized to submit on behalf of
      the copyright owner. For the purposes of this definition, "submitted"
      means any form of electronic, verbal, or written communication sent
      to the Licensor or its representatives, including but not limited to
      communication on electronic mailing lists, source code control systems,
      and issue tracking systems that are managed by, or on behalf of, the
      Licensor for the purpose of discussing and improving the Work, but
      excluding communication that is conspicuously marked or otherwise
      designated in writing by the copyright owner as "Not a Contribution."

      "Contributor" shall mean Licensor and any individual or Legal Entity
      on behalf of whom a Contribution has been received by Licensor and
      subsequently incorporated within the Work.

   2. Grant of Copyright License. Subject to the terms and conditions of
      this License, each Contributor hereby grants to You a perpetual,
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
      copyright license to reproduce, prepare Derivative Works of,
      publicly display, publicly perform, sublicense, and distribute the
      Work and such Derivative Works in Source or Object form.

   3. Grant of Patent License. Subject to the terms and conditions of
      this License, each Contributor hereby grants to You a perpetual,
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
      (except as stated in this section) patent license to make, have made,
      use, offer to sell, sell, import, and otherwise transfer the Work,
      where such license applies only to those patent claims licensable
      by such Contributor that are necessarily infringed by their
      Contribution(s) alone or by combination of their Contribution(s)
      with the Work to which such Contribution(s) was submitted. If You
      institute patent litigation against any entity (including a
      cross-claim or counterclaim in a lawsuit) alleging that the Work
      or a Contribution incorporated within the Work constitutes direct
      or contributory patent infringement, then any patent licenses
      granted to You under this License for that Work shall terminate
      as of the date such litigation is filed.

   4. Redistribution. You may reproduce and distribute copies of the
      Work or Derivative Works thereof in any medium, with or without
      modifications, and in Source or Object form, provided that You
      meet the following conditions:

      (a) You must give any other recipients of the Work or
          Derivative Works a copy of this License; and

      (b) You must cause any modified files to carry prominent notices
          stating that You changed the files; and

      (c) You must retain, in the Source form of any Derivative Works
          that You distribute, all copyright, patent, trademark, and
          attribution notices from the Source form of the Work,
          excluding those notices that do not pertain to any part of
          the Derivative Works; and

      (d) If the Work includes a "NOTICE" text file as part of its
          distribution, then any Derivative Works that You distribute must
          include a readable copy of the attribution notices contained
          within such NOTICE file, excluding those notices that do not
          pertain to any part of the Derivative Works, in at least one
          of the following places: within a NOTICE text file distributed
          as part of the Derivative Works; within the Source form or
          documentation, if provided along with the Derivative Works; or,
          within a display generated by the Derivative Works, if and
          wherever such third-party notices normally appear. The contents
          of the NOTICE file are for informational purposes only and
          do not modify the License. You may add Your own attribution
          notices within Derivative Works that You distribute, alongside
          or as an addendum to the NOTICE text from the Work, provided
          that such additional attribution notices cannot be construed
          as modifying the License.

      You may add Your own copyright statement to Your modifications and
      may provide additional or different license terms and conditions
      for use, reproduction, or distribution of Your modifications, or
      for any such Derivative Works as a whole, provided Your use,
      reproduction, and distribution of the Work otherwise complies with
      the conditions stated in this License.

   5. Submission of Contributions. Unless You explicitly state otherwise,
      any Contribution intentionally submitted for inclusion in the Work
      by You to the Licensor shall be under the terms and conditions of
      this License, without any additional terms or conditions.
      Notwithstanding the above, nothing herein shall supersede or modify
      the terms of any separate license agreement you may have executed
      with Licensor regarding such Contributions.

   6. Trademarks. This License does not grant permission to use the trade
      names, trademarks, service marks, or product names of the Licensor,
      except as required for reasonable and customary use in describing the
      origin of the Work and reproducing the content of the NOTICE file.

   7. Disclaimer of Warranty. Unless required by applicable law or
      agreed to in writing, Licensor provides the Work (and each
      Contributor provides its Contributions) on an "AS IS" BASIS,
      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
      implied, including, without limitation, any warranties or conditions
      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
      PARTICULAR PURPOSE. You are solely responsible for determining the
      appropriateness of using or redistributing the Work and assume any
      risks associated with Your exercise of permissions under this License.

   8. Limitation of Liability. In no event and under no legal theory,
      whether in tort (including negligence), contract, or otherwise,
      unless required by applicable law (such as deliberate and grossly
      negligent acts) or agreed to in writing, shall any Contributor be
      liable to You for damages, including any direct, indirect, special,
      incidental, or consequential damages of any character arising as a
      result of this License or out of the use or inability to use the
      Work (including but not limited to damages for loss of goodwill,
      work stoppage, computer failure or malfunction, or any and all
      other commercial damages or losses), even if such Contributor
      has been advised of the possibility of such damages.

   9. Accepting Warranty or Additional Liability. While redistributing
      the Work or Derivative Works thereof, You may choose to offer,
      and charge a fee for, acceptance of support, warranty, indemnity,
      or other liability obligations and/or rights consistent with this
      License. However, in accepting such obligations, You may act only
      on Your own behalf and on Your sole responsibility, not on behalf
      of any other Contributor, and only if You agree to indemnify,
      defend, and hold each Contributor harmless for any liability
      incurred by, or claims asserted against, such Contributor by reason
      of your accepting any such warranty or additional liability.

   END OF TERMS AND CONDITIONS

   APPENDIX: How to apply the Apache License to your work.

      To apply the Apache License to your work, attach the following
      boilerplate notice, with the fields enclosed by brackets "[]"
      replaced with your own identifying information. (Don't include
      the brackets!)  The text should be enclosed in the appropriate
      comment syntax for the file format. We also recommend that a
      file or class name and description of purpose be included on the
      same "printed page" as the copyright notice for easier
      identification within third-party archives.

   Portions Copyright (c) Microsoft Corporation.
   Portions Copyright 2017 Google Inc.

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
Playwright
Copyright (c) Microsoft Corporation

This software contains code derived from the Puppeteer project (https://github.com/puppeteer/puppeteer),
available under the Apache 2.0 license (https://github.com/puppeteer/puppeteer/blob/master/LICENSE).
microsoft/playwright-core

THIRD-PARTY SOFTWARE NOTICES AND INFORMATION

This package bundles third-party software inside individual files under
`lib/`. Each bundled output has a sidecar `<bundle>.js.LICENSE` file next
to it listing every npm package whose source was inlined into that
bundle, together with the full license text for each.

For example:
- lib/utilsBundle.js.LICENSE

This project incorporates components from the projects listed below. The original copyright notices and the licenses under which Microsoft received such components are set forth below. Microsoft reserves all rights not expressly granted herein, whether by implication, estoppel or otherwise.
$osInfo = Get-WmiObject -Class Win32_OperatingSystem
# check if running on Windows Server
if ($osInfo.ProductType -eq 3) {
  Install-WindowsFeature Server-Media-Foundation
}
$ErrorActionPreference = 'Stop'

# This script sets up a WSL distribution that will be used to run WebKit.

$Distribution = "playwright"
$Username = "pwuser"

$distributions = (wsl --list --quiet) -split "\r?\n"
if ($distributions -contains $Distribution) {
    Write-Host "WSL distribution '$Distribution' already exists. Skipping installation."
} else {
    Write-Host "Installing new WSL distribution '$Distribution'..."
    $VhdSize = "10GB"
    wsl --install -d Ubuntu-24.04 --name $Distribution --no-launch --vhd-size $VhdSize
    wsl -d $Distribution -u root adduser --gecos GECOS --disabled-password $Username
}

$pwshDirname = (Resolve-Path -Path $PSScriptRoot).Path;
$playwrightCoreRoot = Resolve-Path (Join-Path $pwshDirname "..")

$initScript = @"
if [ ! -f "/home/$Username/node/bin/node" ]; then
  mkdir -p /home/$Username/node
  curl -fsSL https://nodejs.org/dist/v22.17.0/node-v22.17.0-linux-x64.tar.xz -o /home/$Username/node/node-v22.17.0-linux-x64.tar.xz
  tar -xJf /home/$Username/node/node-v22.17.0-linux-x64.tar.xz -C /home/$Username/node --strip-components=1
  sudo -u $Username echo 'export PATH=/home/$Username/node/bin:\`$PATH' >> /home/$Username/.profile
fi
/home/$Username/node/bin/node cli.js install-deps webkit
sudo -u $Username PLAYWRIGHT_SKIP_BROWSER_GC=1 /home/$Username/node/bin/node cli.js install webkit
"@ -replace "\r\n", "`n"

wsl -d $Distribution --cd $playwrightCoreRoot -u root -- bash -c "$initScript"
Write-Host "Done!"#!/usr/bin/env bash
set -e
set -x

if [[ $(arch) == "aarch64" ]]; then
  echo "ERROR: not supported on Linux Arm64"
  exit 1
fi

if [ -z "$PLAYWRIGHT_HOST_PLATFORM_OVERRIDE" ]; then
  if [[ ! -f "/etc/os-release" ]]; then
    echo "ERROR: cannot install on unknown linux distribution (/etc/os-release is missing)"
    exit 1
  fi

  ID=$(bash -c 'source /etc/os-release && echo $ID')
  if [[ "${ID}" != "ubuntu" && "${ID}" != "debian" ]]; then
    echo "ERROR: cannot install on $ID distribution - only Ubuntu and Debian are supported"
    exit 1
  fi
fi

# 1. make sure to remove old beta if any.
if dpkg --get-selections | grep -q "^google-chrome-beta[[:space:]]*install$" >/dev/null; then
  apt-get remove -y google-chrome-beta
fi

# 2. Update apt lists (needed to install curl and chrome dependencies)
apt-get update

# 3. Install curl to download chrome
if ! command -v curl >/dev/null; then
  apt-get install -y curl
fi

# 4. download chrome beta from dl.google.com and install it.
cd /tmp
curl -L -O https://dl.google.com/linux/direct/google-chrome-beta_current_amd64.deb
apt-get install -y ./google-chrome-beta_current_amd64.deb
rm -rf ./google-chrome-beta_current_amd64.deb
cd -
google-chrome-beta --version
#!/usr/bin/env bash
set -e
set -x

rm -rf "/Applications/Google Chrome Beta.app"
cd /tmp
curl -L --retry 3 -o ./googlechromebeta.dmg https://dl.google.com/chrome/mac/universal/beta/googlechromebeta.dmg
hdiutil attach -nobrowse -quiet -noautofsck -noautoopen -mountpoint /Volumes/googlechromebeta.dmg ./googlechromebeta.dmg
cp -pR "/Volumes/googlechromebeta.dmg/Google Chrome Beta.app" /Applications
hdiutil detach /Volumes/googlechromebeta.dmg
rm -rf /tmp/googlechromebeta.dmg

/Applications/Google\ Chrome\ Beta.app/Contents/MacOS/Google\ Chrome\ Beta --version
$ErrorActionPreference = 'Stop'

$url = 'https://dl.google.com/tag/s/dl/chrome/install/beta/googlechromebetastandaloneenterprise64.msi'

Write-Host "Downloading Google Chrome Beta"
$wc = New-Object net.webclient
$msiInstaller = "$env:temp\google-chrome-beta.msi"
$wc.Downloadfile($url, $msiInstaller)

Write-Host "Installing Google Chrome Beta"
$arguments = "/i `"$msiInstaller`" /quiet"
Start-Process msiexec.exe -ArgumentList $arguments -Wait
Remove-Item $msiInstaller

$suffix = "\\Google\\Chrome Beta\\Application\\chrome.exe"
if (Test-Path "${env:ProgramFiles(x86)}$suffix") {
    (Get-Item "${env:ProgramFiles(x86)}$suffix").VersionInfo
} elseif (Test-Path "${env:ProgramFiles}$suffix") {
    (Get-Item "${env:ProgramFiles}$suffix").VersionInfo
} else {
    Write-Host "ERROR: Failed to install Google Chrome Beta."
    Write-Host "ERROR: This could be due to insufficient privileges, in which case re-running as Administrator may help."
    exit 1
}
#!/usr/bin/env bash
set -e
set -x

if [[ $(arch) == "aarch64" ]]; then
  echo "ERROR: not supported on Linux Arm64"
  exit 1
fi

if [ -z "$PLAYWRIGHT_HOST_PLATFORM_OVERRIDE" ]; then
  if [[ ! -f "/etc/os-release" ]]; then
    echo "ERROR: cannot install on unknown linux distribution (/etc/os-release is missing)"
    exit 1
  fi

  ID=$(bash -c 'source /etc/os-release && echo $ID')
  if [[ "${ID}" != "ubuntu" && "${ID}" != "debian" ]]; then
    echo "ERROR: cannot install on $ID distribution - only Ubuntu and Debian are supported"
    exit 1
  fi
fi

# 1. make sure to remove old stable if any.
if dpkg --get-selections | grep -q "^google-chrome[[:space:]]*install$" >/dev/null; then
  apt-get remove -y google-chrome
fi

# 2. Update apt lists (needed to install curl and chrome dependencies)
apt-get update

# 3. Install curl to download chrome
if ! command -v curl >/dev/null; then
  apt-get install -y curl
fi

# 4. download chrome stable from dl.google.com and install it.
cd /tmp
curl -L -O https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
apt-get install -y ./google-chrome-stable_current_amd64.deb
rm -rf ./google-chrome-stable_current_amd64.deb
cd -
google-chrome --version
#!/usr/bin/env bash
set -e
set -x

rm -rf "/Applications/Google Chrome.app"
cd /tmp
curl -L --retry 3 -o ./googlechrome.dmg https://dl.google.com/chrome/mac/universal/stable/GGRO/googlechrome.dmg
hdiutil attach -nobrowse -quiet -noautofsck -noautoopen -mountpoint /Volumes/googlechrome.dmg ./googlechrome.dmg
cp -pR "/Volumes/googlechrome.dmg/Google Chrome.app" /Applications
hdiutil detach /Volumes/googlechrome.dmg
rm -rf /tmp/googlechrome.dmg
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --version
$ErrorActionPreference = 'Stop'
$url = 'https://dl.google.com/tag/s/dl/chrome/install/googlechromestandaloneenterprise64.msi'

$wc = New-Object net.webclient
$msiInstaller = "$env:temp\google-chrome.msi"
Write-Host "Downloading Google Chrome"
$wc.Downloadfile($url, $msiInstaller)

Write-Host "Installing Google Chrome"
$arguments = "/i `"$msiInstaller`" /quiet"
Start-Process msiexec.exe -ArgumentList $arguments -Wait
Remove-Item $msiInstaller


$suffix = "\\Google\\Chrome\\Application\\chrome.exe"
if (Test-Path "${env:ProgramFiles(x86)}$suffix") {
    (Get-Item "${env:ProgramFiles(x86)}$suffix").VersionInfo
} elseif (Test-Path "${env:ProgramFiles}$suffix") {
    (Get-Item "${env:ProgramFiles}$suffix").VersionInfo
} else {
    Write-Host "ERROR: Failed to install Google Chrome."
    Write-Host "ERROR: This could be due to insufficient privileges, in which case re-running as Administrator may help."
    exit 1
}
#!/usr/bin/env bash

set -e
set -x

if [[ $(arch) == "aarch64" ]]; then
  echo "ERROR: not supported on Linux Arm64"
  exit 1
fi

if [ -z "$PLAYWRIGHT_HOST_PLATFORM_OVERRIDE" ]; then
  if [[ ! -f "/etc/os-release" ]]; then
    echo "ERROR: cannot install on unknown linux distribution (/etc/os-release is missing)"
    exit 1
  fi

  ID=$(bash -c 'source /etc/os-release && echo $ID')
  if [[ "${ID}" != "ubuntu" && "${ID}" != "debian" ]]; then
    echo "ERROR: cannot install on $ID distribution - only Ubuntu and Debian are supported"
    exit 1
  fi
fi

# 1. make sure to remove old beta if any.
if dpkg --get-selections | grep -q "^microsoft-edge-beta[[:space:]]*install$" >/dev/null; then
  apt-get remove -y microsoft-edge-beta
fi

# 2. Install curl to download Microsoft gpg key
if ! command -v curl >/dev/null; then
  apt-get update
  apt-get install -y curl
fi

# GnuPG is not preinstalled in slim images
if ! command -v gpg >/dev/null; then
  apt-get update
  apt-get install -y gpg
fi

# 3. Add the GPG key, the apt repo, update the apt cache, and install the package
curl -L https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > /tmp/microsoft.gpg
install -o root -g root -m 644 /tmp/microsoft.gpg /etc/apt/trusted.gpg.d/
sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/edge stable main" > /etc/apt/sources.list.d/microsoft-edge-dev.list'
rm /tmp/microsoft.gpg
apt-get update && apt-get install -y microsoft-edge-beta

microsoft-edge-beta --version
#!/usr/bin/env bash
set -e
set -x

cd /tmp
curl -L --retry 3 -o ./msedge_beta.pkg "$1"
# Note: there's no way to uninstall previously installed MSEdge.
# However, running PKG again seems to update installation.
sudo installer -pkg /tmp/msedge_beta.pkg -target /
rm -rf /tmp/msedge_beta.pkg
/Applications/Microsoft\ Edge\ Beta.app/Contents/MacOS/Microsoft\ Edge\ Beta --version
$ErrorActionPreference = 'Stop'
$url = $args[0]

Write-Host "Downloading Microsoft Edge Beta"
$wc = New-Object net.webclient
$msiInstaller = "$env:temp\microsoft-edge-beta.msi"
$wc.Downloadfile($url, $msiInstaller)

Write-Host "Installing Microsoft Edge Beta"
$arguments = "/i `"$msiInstaller`" /quiet"
Start-Process msiexec.exe -ArgumentList $arguments -Wait
Remove-Item $msiInstaller

$suffix = "\\Microsoft\\Edge Beta\\Application\\msedge.exe"
if (Test-Path "${env:ProgramFiles(x86)}$suffix") {
    (Get-Item "${env:ProgramFiles(x86)}$suffix").VersionInfo
} elseif (Test-Path "${env:ProgramFiles}$suffix") {
    (Get-Item "${env:ProgramFiles}$suffix").VersionInfo
} else {
    Write-Host "ERROR: Failed to install Microsoft Edge Beta."
    Write-Host "ERROR: This could be due to insufficient privileges, in which case re-running as Administrator may help."
    exit 1
}
#!/usr/bin/env bash

set -e
set -x

if [[ $(arch) == "aarch64" ]]; then
  echo "ERROR: not supported on Linux Arm64"
  exit 1
fi

if [ -z "$PLAYWRIGHT_HOST_PLATFORM_OVERRIDE" ]; then
  if [[ ! -f "/etc/os-release" ]]; then
    echo "ERROR: cannot install on unknown linux distribution (/etc/os-release is missing)"
    exit 1
  fi

  ID=$(bash -c 'source /etc/os-release && echo $ID')
  if [[ "${ID}" != "ubuntu" && "${ID}" != "debian" ]]; then
    echo "ERROR: cannot install on $ID distribution - only Ubuntu and Debian are supported"
    exit 1
  fi
fi

# 1. make sure to remove old dev if any.
if dpkg --get-selections | grep -q "^microsoft-edge-dev[[:space:]]*install$" >/dev/null; then
  apt-get remove -y microsoft-edge-dev
fi

# 2. Install curl to download Microsoft gpg key
if ! command -v curl >/dev/null; then
  apt-get update
  apt-get install -y curl
fi

# GnuPG is not preinstalled in slim images
if ! command -v gpg >/dev/null; then
  apt-get update
  apt-get install -y gpg
fi

# 3. Add the GPG key, the apt repo, update the apt cache, and install the package
curl -L https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > /tmp/microsoft.gpg
install -o root -g root -m 644 /tmp/microsoft.gpg /etc/apt/trusted.gpg.d/
sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/edge stable main" > /etc/apt/sources.list.d/microsoft-edge-dev.list'
rm /tmp/microsoft.gpg
apt-get update && apt-get install -y microsoft-edge-dev

microsoft-edge-dev --version
#!/usr/bin/env bash
set -e
set -x

cd /tmp
curl -L --retry 3 -o ./msedge_dev.pkg "$1"
# Note: there's no way to uninstall previously installed MSEdge.
# However, running PKG again seems to update installation.
sudo installer -pkg /tmp/msedge_dev.pkg -target /
rm -rf /tmp/msedge_dev.pkg
/Applications/Microsoft\ Edge\ Dev.app/Contents/MacOS/Microsoft\ Edge\ Dev --version
$ErrorActionPreference = 'Stop'
$url = $args[0]

Write-Host "Downloading Microsoft Edge Dev"
$wc = New-Object net.webclient
$msiInstaller = "$env:temp\microsoft-edge-dev.msi"
$wc.Downloadfile($url, $msiInstaller)

Write-Host "Installing Microsoft Edge Dev"
$arguments = "/i `"$msiInstaller`" /quiet"
Start-Process msiexec.exe -ArgumentList $arguments -Wait
Remove-Item $msiInstaller

$suffix = "\\Microsoft\\Edge Dev\\Application\\msedge.exe"
if (Test-Path "${env:ProgramFiles(x86)}$suffix") {
    (Get-Item "${env:ProgramFiles(x86)}$suffix").VersionInfo
} elseif (Test-Path "${env:ProgramFiles}$suffix") {
    (Get-Item "${env:ProgramFiles}$suffix").VersionInfo
} else {
    Write-Host "ERROR: Failed to install Microsoft Edge Dev."
    Write-Host "ERROR: This could be due to insufficient privileges, in which case re-running as Administrator may help."
    exit 1
}
#!/usr/bin/env bash

set -e
set -x

if [[ $(arch) == "aarch64" ]]; then
  echo "ERROR: not supported on Linux Arm64"
  exit 1
fi

if [ -z "$PLAYWRIGHT_HOST_PLATFORM_OVERRIDE" ]; then
  if [[ ! -f "/etc/os-release" ]]; then
    echo "ERROR: cannot install on unknown linux distribution (/etc/os-release is missing)"
    exit 1
  fi

  ID=$(bash -c 'source /etc/os-release && echo $ID')
  if [[ "${ID}" != "ubuntu" && "${ID}" != "debian" ]]; then
    echo "ERROR: cannot install on $ID distribution - only Ubuntu and Debian are supported"
    exit 1
  fi
fi

# 1. make sure to remove old stable if any.
if dpkg --get-selections | grep -q "^microsoft-edge-stable[[:space:]]*install$" >/dev/null; then
  apt-get remove -y microsoft-edge-stable
fi

# 2. Install curl to download Microsoft gpg key
if ! command -v curl >/dev/null; then
  apt-get update
  apt-get install -y curl
fi

# GnuPG is not preinstalled in slim images
if ! command -v gpg >/dev/null; then
  apt-get update
  apt-get install -y gpg
fi

# 3. Add the GPG key, the apt repo, update the apt cache, and install the package
curl -L https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > /tmp/microsoft.gpg
install -o root -g root -m 644 /tmp/microsoft.gpg /etc/apt/trusted.gpg.d/
sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/edge stable main" > /etc/apt/sources.list.d/microsoft-edge-stable.list'
rm /tmp/microsoft.gpg
apt-get update && apt-get install -y microsoft-edge-stable

microsoft-edge-stable --version
#!/usr/bin/env bash
set -e
set -x

cd /tmp
curl -L --retry 3 -o ./msedge_stable.pkg "$1"
# Note: there's no way to uninstall previously installed MSEdge.
# However, running PKG again seems to update installation.
sudo installer -pkg /tmp/msedge_stable.pkg -target /
rm -rf /tmp/msedge_stable.pkg
/Applications/Microsoft\ Edge.app/Contents/MacOS/Microsoft\ Edge --version
$ErrorActionPreference = 'Stop'

$url = $args[0]

Write-Host "Downloading Microsoft Edge"
$wc = New-Object net.webclient
$msiInstaller = "$env:temp\microsoft-edge-stable.msi"
$wc.Downloadfile($url, $msiInstaller)

Write-Host "Installing Microsoft Edge"
$arguments = "/i `"$msiInstaller`" /quiet"
Start-Process msiexec.exe -ArgumentList $arguments -Wait
Remove-Item $msiInstaller

$suffix = "\\Microsoft\\Edge\\Application\\msedge.exe"
if (Test-Path "${env:ProgramFiles(x86)}$suffix") {
    (Get-Item "${env:ProgramFiles(x86)}$suffix").VersionInfo
} elseif (Test-Path "${env:ProgramFiles}$suffix") {
    (Get-Item "${env:ProgramFiles}$suffix").VersionInfo
} else {
    Write-Host "ERROR: Failed to install Microsoft Edge."
    Write-Host "ERROR: This could be due to insufficient privileges, in which case re-running as Administrator may help."
    exit 1
}{
  "comment": "Do not edit this file, use utils/roll_browser.js",
  "browsers": [
    {
      "name": "chromium",
      "revision": "1228",
      "installByDefault": true,
      "browserVersion": "149.0.7827.55",
      "title": "Chrome for Testing"
    },
    {
      "name": "chromium-headless-shell",
      "revision": "1228",
      "installByDefault": true,
      "browserVersion": "149.0.7827.55",
      "title": "Chrome Headless Shell"
    },
    {
      "name": "chromium-tip-of-tree",
      "revision": "1432",
      "installByDefault": false,
      "browserVersion": "151.0.7886.0",
      "title": "Chrome Canary for Testing"
    },
    {
      "name": "chromium-tip-of-tree-headless-shell",
      "revision": "1432",
      "installByDefault": false,
      "browserVersion": "151.0.7886.0",
      "title": "Chrome Canary Headless Shell"
    },
    {
      "name": "firefox",
      "revision": "1532",
      "installByDefault": true,
      "browserVersion": "151.0",
      "title": "Firefox"
    },
    {
      "name": "firefox-beta",
      "revision": "1526",
      "installByDefault": false,
      "browserVersion": "152.0b1",
      "title": "Firefox Beta"
    },
    {
      "name": "webkit",
      "revision": "2311",
      "installByDefault": true,
      "revisionOverrides": {
        "mac14": "2251",
        "mac14-arm64": "2251",
        "debian11-x64": "2105",
        "debian11-arm64": "2105",
        "ubuntu20.04-x64": "2092",
        "ubuntu20.04-arm64": "2092"
      },
      "browserVersion": "26.5",
      "title": "WebKit"
    },
    {
      "name": "ffmpeg",
      "revision": "1011",
      "installByDefault": true,
      "revisionOverrides": {
        "mac12": "1010",
        "mac12-arm64": "1010"
      }
    },
    {
      "name": "winldd",
      "revision": "1007",
      "installByDefault": false
    },
    {
      "name": "android",
      "revision": "1001",
      "installByDefault": false
    }
  ]
}
#!/usr/bin/env node
/**
 * Copyright (c) Microsoft Corporation.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
const { libCli, libCliTestStub } = require('./lib/coreBundle');
const { program } = require('./lib/utilsBundle');
libCli.decorateProgram(program);
libCliTestStub.decorateProgram(program);
program.parse(process.argv);
/**
 * Copyright (c) Microsoft Corporation.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
require('./lib/bootstrap');
module.exports = require('./lib/coreBundle').inprocess.playwright;
/**
 * Copyright (c) Microsoft Corporation.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

import playwright from './index.js';

export const chromium = playwright.chromium;
export const firefox = playwright.firefox;
export const webkit = playwright.webkit;
export const selectors = playwright.selectors;
export const devices = playwright.devices;
export const errors = playwright.errors;
export const request = playwright.request;
export const _electron = playwright._electron;
export const _android = playwright._android;
export default playwright;
"use strict";
const minimumMajorNodeVersion = 18;
const currentNodeVersion = process.versions.node;
const major = +currentNodeVersion.split(".")[0];
if (major < minimumMajorNodeVersion) {
  console.error(
    "You are running Node.js " + currentNodeVersion + `.
Playwright requires Node.js ${minimumMajorNodeVersion} or higher. 
Please update your version of Node.js.`
  );
  process.exit(1);
}
if (process.env.PW_INSTRUMENT_MODULES) {
  const Module = require("module");
  const originalLoad = Module._load;
  const root = { name: "<root>", selfMs: 0, totalMs: 0, childrenMs: 0, children: [] };
  let current = root;
  const stack = [];
  Module._load = function(request, _parent, _isMain) {
    const node = { name: request, selfMs: 0, totalMs: 0, childrenMs: 0, children: [] };
    current.children.push(node);
    stack.push(current);
    current = node;
    const start = performance.now();
    let result;
    try {
      result = originalLoad.apply(this, arguments);
    } catch (e) {
      current = stack.pop();
      current.children.pop();
      throw e;
    }
    const duration = performance.now() - start;
    node.totalMs = duration;
    node.selfMs = Math.max(0, duration - node.childrenMs);
    current = stack.pop();
    current.childrenMs += duration;
    return result;
  };
  process.on("exit", () => {
    function printTree(node, prefix, isLast, lines2, depth) {
      if (node.totalMs < 1 && depth > 0)
        return;
      const connector = depth === 0 ? "" : isLast ? "\u2514\u2500\u2500 " : "\u251C\u2500\u2500 ";
      const time = `${node.totalMs.toFixed(1).padStart(8)}ms`;
      const self = node.children.length ? ` (self: ${node.selfMs.toFixed(1)}ms)` : "";
      lines2.push(`${time}  ${prefix}${connector}${node.name}${self}`);
      const childPrefix = prefix + (depth === 0 ? "" : isLast ? "    " : "\u2502   ");
      const sorted2 = node.children.slice().sort((a, b) => b.totalMs - a.totalMs);
      for (let i = 0; i < sorted2.length; i++)
        printTree(sorted2[i], childPrefix, i === sorted2.length - 1, lines2, depth + 1);
    }
    let totalModules = 0;
    function count(n) {
      totalModules++;
      n.children.forEach(count);
    }
    root.children.forEach(count);
    const lines = [];
    const sorted = root.children.slice().sort((a, b) => b.totalMs - a.totalMs);
    for (let i = 0; i < sorted.length; i++)
      printTree(sorted[i], "", i === sorted.length - 1, lines, 0);
    const totalMs = root.children.reduce((s, c) => s + c.totalMs, 0);
    process.stderr.write(`
--- Module load tree: ${totalModules} modules, ${totalMs.toFixed(0)}ms total ---
` + lines.join("\n") + "\n");
    const flat = /* @__PURE__ */ new Map();
    function gather(n) {
      const existing = flat.get(n.name);
      if (existing) {
        existing.selfMs += n.selfMs;
        existing.totalMs += n.totalMs;
        existing.count++;
      } else {
        flat.set(n.name, { selfMs: n.selfMs, totalMs: n.totalMs, count: 1 });
      }
      n.children.forEach(gather);
    }
    root.children.forEach(gather);
    const top50 = [...flat.entries()].sort((a, b) => b[1].selfMs - a[1].selfMs).slice(0, 50);
    const flatLines = top50.map(
      ([mod, { selfMs, totalMs: totalMs2, count: count2 }]) => `${selfMs.toFixed(1).padStart(8)}ms self ${totalMs2.toFixed(1).padStart(8)}ms total  (x${String(count2).padStart(3)})  ${mod}`
    );
    process.stderr.write(`
--- Top 50 modules by self time ---
` + flatLines.join("\n") + "\n");
  });
}
"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __esm = (fn, res) => function __init() {
  return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
};
var __commonJS = (cb, mod) => function __require() {
  return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
};
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  // If the importer is in node compatibility mode or this is not an ESM
  // file that has been converted to a CommonJS file using a Babel-
  // compatible transform (i.e. "__esModule" has not been set), then set
  // "default" to the CommonJS "module.exports" for node compatibility.
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);

// packages/isomorphic/ariaSnapshot.ts
function ariaNodesEqual(a, b) {
  if (a.role !== b.role || a.name !== b.name)
    return false;
  if (!ariaPropsEqual(a, b) || hasPointerCursor(a) !== hasPointerCursor(b))
    return false;
  const aKeys = Object.keys(a.props);
  const bKeys = Object.keys(b.props);
  return aKeys.length === bKeys.length && aKeys.every((k) => a.props[k] === b.props[k]);
}
function hasPointerCursor(ariaNode) {
  return ariaNode.box.cursor === "pointer";
}
function ariaPropsEqual(a, b) {
  return a.active === b.active && a.checked === b.checked && a.disabled === b.disabled && a.expanded === b.expanded && a.invalid === b.invalid && a.selected === b.selected && a.level === b.level && a.pressed === b.pressed;
}
function parseAriaSnapshotUnsafe(yaml3, text2, options = {}) {
  const result2 = parseAriaSnapshot(yaml3, text2, options);
  if (result2.errors.length)
    throw new Error(result2.errors[0].message);
  return result2.fragment;
}
function parseAriaSnapshot(yaml3, text2, options = {}) {
  const lineCounter = new yaml3.LineCounter();
  const parseOptions = {
    keepSourceTokens: true,
    lineCounter,
    ...options
  };
  const yamlDoc = yaml3.parseDocument(text2, parseOptions);
  const errors = [];
  const convertRange = (range) => {
    return [lineCounter.linePos(range[0]), lineCounter.linePos(range[1])];
  };
  const addError = (error) => {
    errors.push({
      message: error.message,
      range: [lineCounter.linePos(error.pos[0]), lineCounter.linePos(error.pos[1])]
    });
  };
  const convertSeq = (container, seq) => {
    for (const item of seq.items) {
      const itemIsString = item instanceof yaml3.Scalar && typeof item.value === "string";
      if (itemIsString) {
        const childNode = KeyParser.parse(item, parseOptions, errors);
        if (childNode) {
          container.children = container.children || [];
          container.children.push(childNode);
        }
        continue;
      }
      const itemIsMap = item instanceof yaml3.YAMLMap;
      if (itemIsMap) {
        convertMap(container, item);
        continue;
      }
      errors.push({
        message: "Sequence items should be strings or maps",
        range: convertRange(item.range || seq.range)
      });
    }
  };
  const convertMap = (container, map) => {
    for (const entry of map.items) {
      container.children = container.children || [];
      const keyIsString = entry.key instanceof yaml3.Scalar && typeof entry.key.value === "string";
      if (!keyIsString) {
        errors.push({
          message: "Only string keys are supported",
          range: convertRange(entry.key.range || map.range)
        });
        continue;
      }
      const key = entry.key;
      const value2 = entry.value;
      if (key.value === "text") {
        const valueIsString = value2 instanceof yaml3.Scalar && typeof value2.value === "string";
        if (!valueIsString) {
          errors.push({
            message: "Text value should be a string",
            range: convertRange(entry.value.range || map.range)
          });
          continue;
        }
        container.children.push({
          kind: "text",
          text: textValue(value2.value)
        });
        continue;
      }
      if (key.value === "/children") {
        const valueIsString = value2 instanceof yaml3.Scalar && typeof value2.value === "string";
        if (!valueIsString || value2.value !== "contain" && value2.value !== "equal" && value2.value !== "deep-equal") {
          errors.push({
            message: 'Strict value should be "contain", "equal" or "deep-equal"',
            range: convertRange(entry.value.range || map.range)
          });
          continue;
        }
        container.containerMode = value2.value;
        continue;
      }
      if (key.value.startsWith("/")) {
        const valueIsString = value2 instanceof yaml3.Scalar && typeof value2.value === "string";
        if (!valueIsString) {
          errors.push({
            message: "Property value should be a string",
            range: convertRange(entry.value.range || map.range)
          });
          continue;
        }
        container.props = container.props ?? {};
        container.props[key.value.slice(1)] = textValue(value2.value);
        continue;
      }
      const childNode = KeyParser.parse(key, parseOptions, errors);
      if (!childNode)
        continue;
      const valueIsScalar = value2 instanceof yaml3.Scalar;
      if (valueIsScalar) {
        const type3 = typeof value2.value;
        if (type3 !== "string" && type3 !== "number" && type3 !== "boolean") {
          errors.push({
            message: "Node value should be a string or a sequence",
            range: convertRange(entry.value.range || map.range)
          });
          continue;
        }
        container.children.push({
          ...childNode,
          children: [{
            kind: "text",
            text: textValue(String(value2.value))
          }]
        });
        continue;
      }
      const valueIsSequence = value2 instanceof yaml3.YAMLSeq;
      if (valueIsSequence) {
        container.children.push(childNode);
        convertSeq(childNode, value2);
        continue;
      }
      errors.push({
        message: "Map values should be strings or sequences",
        range: convertRange(entry.value.range || map.range)
      });
    }
  };
  const fragment = { kind: "role", role: "fragment" };
  yamlDoc.errors.forEach(addError);
  if (errors.length)
    return { errors, fragment };
  if (!(yamlDoc.contents instanceof yaml3.YAMLSeq)) {
    errors.push({
      message: 'Aria snapshot must be a YAML sequence, elements starting with " -"',
      range: yamlDoc.contents ? convertRange(yamlDoc.contents.range) : [{ line: 0, col: 0 }, { line: 0, col: 0 }]
    });
  }
  if (errors.length)
    return { errors, fragment };
  convertSeq(fragment, yamlDoc.contents);
  if (errors.length)
    return { errors, fragment: emptyFragment };
  if (fragment.children?.length === 1 && (!fragment.containerMode || fragment.containerMode === "contain"))
    return { fragment: fragment.children[0], errors: [] };
  return { fragment, errors: [] };
}
function normalizeWhitespace(text2) {
  return text2.replace(/[\u200b\u00ad]/g, "").replace(/[\r\n\s\t]+/g, " ").trim();
}
function textValue(value2) {
  return {
    raw: value2,
    normalized: normalizeWhitespace(value2)
  };
}
function findNewNode(from, to) {
  function fillMap(root, map, position) {
    let size = 1;
    let childPosition = position + size;
    for (const child of root.children || []) {
      if (typeof child === "string") {
        size++;
        childPosition++;
      } else {
        size += fillMap(child, map, childPosition);
        childPosition += size;
      }
    }
    if (!["none", "presentation", "fragment", "iframe", "generic"].includes(root.role) && root.name) {
      let byRole = map.get(root.role);
      if (!byRole) {
        byRole = /* @__PURE__ */ new Map();
        map.set(root.role, byRole);
      }
      const existing = byRole.get(root.name);
      const sizeAndPosition = size * 100 - position;
      if (!existing || existing.sizeAndPosition < sizeAndPosition)
        byRole.set(root.name, { node: root, sizeAndPosition });
    }
    return size;
  }
  const fromMap = /* @__PURE__ */ new Map();
  if (from)
    fillMap(from, fromMap, 0);
  const toMap = /* @__PURE__ */ new Map();
  fillMap(to, toMap, 0);
  const result2 = [];
  for (const [role, byRole] of toMap) {
    for (const [name, byName] of byRole) {
      const inFrom = fromMap.get(role)?.get(name);
      if (!inFrom)
        result2.push(byName);
    }
  }
  result2.sort((a, b) => b.sizeAndPosition - a.sizeAndPosition);
  return result2[0]?.node;
}
var emptyFragment, KeyParser, ParserError;
var init_ariaSnapshot = __esm({
  "packages/isomorphic/ariaSnapshot.ts"() {
    "use strict";
    emptyFragment = { kind: "role", role: "fragment" };
    KeyParser = class _KeyParser {
      static parse(text2, options, errors) {
        try {
          return new _KeyParser(text2.value)._parse();
        } catch (e) {
          if (e instanceof ParserError) {
            const message = options.prettyErrors === false ? e.message : e.message + ":\n\n" + text2.value + "\n" + " ".repeat(e.pos) + "^\n";
            errors.push({
              message,
              range: [options.lineCounter.linePos(text2.range[0]), options.lineCounter.linePos(text2.range[0] + e.pos)]
            });
            return null;
          }
          throw e;
        }
      }
      constructor(input) {
        this._input = input;
        this._pos = 0;
        this._length = input.length;
      }
      _peek() {
        return this._input[this._pos] || "";
      }
      _next() {
        if (this._pos < this._length)
          return this._input[this._pos++];
        return null;
      }
      _eof() {
        return this._pos >= this._length;
      }
      _isWhitespace() {
        return !this._eof() && /\s/.test(this._peek());
      }
      _skipWhitespace() {
        while (this._isWhitespace())
          this._pos++;
      }
      _readIdentifier(type3) {
        if (this._eof())
          this._throwError(`Unexpected end of input when expecting ${type3}`);
        const start3 = this._pos;
        while (!this._eof() && /[a-zA-Z]/.test(this._peek()))
          this._pos++;
        return this._input.slice(start3, this._pos);
      }
      _readString() {
        let result2 = "";
        let escaped2 = false;
        while (!this._eof()) {
          const ch = this._next();
          if (escaped2) {
            result2 += ch;
            escaped2 = false;
          } else if (ch === "\\") {
            escaped2 = true;
          } else if (ch === '"') {
            return result2;
          } else {
            result2 += ch;
          }
        }
        this._throwError("Unterminated string");
      }
      _throwError(message, offset = 0) {
        throw new ParserError(message, offset || this._pos);
      }
      _readRegex() {
        let result2 = "";
        let escaped2 = false;
        let insideClass = false;
        while (!this._eof()) {
          const ch = this._next();
          if (escaped2) {
            result2 += ch;
            escaped2 = false;
          } else if (ch === "\\") {
            escaped2 = true;
            result2 += ch;
          } else if (ch === "/" && !insideClass) {
            return { pattern: result2 };
          } else if (ch === "[") {
            insideClass = true;
            result2 += ch;
          } else if (ch === "]" && insideClass) {
            result2 += ch;
            insideClass = false;
          } else {
            result2 += ch;
          }
        }
        this._throwError("Unterminated regex");
      }
      _readStringOrRegex() {
        const ch = this._peek();
        if (ch === '"') {
          this._next();
          return normalizeWhitespace(this._readString());
        }
        if (ch === "/") {
          this._next();
          return this._readRegex();
        }
        return null;
      }
      _readAttributes(result2) {
        let errorPos = this._pos;
        while (true) {
          this._skipWhitespace();
          if (this._peek() === "[") {
            this._next();
            this._skipWhitespace();
            errorPos = this._pos;
            const flagName = this._readIdentifier("attribute");
            this._skipWhitespace();
            let flagValue = "";
            if (this._peek() === "=") {
              this._next();
              this._skipWhitespace();
              errorPos = this._pos;
              while (this._peek() !== "]" && !this._isWhitespace() && !this._eof())
                flagValue += this._next();
            }
            this._skipWhitespace();
            if (this._peek() !== "]")
              this._throwError("Expected ]");
            this._next();
            this._applyAttribute(result2, flagName, flagValue || "true", errorPos);
          } else {
            break;
          }
        }
      }
      _parse() {
        this._skipWhitespace();
        const role = this._readIdentifier("role");
        this._skipWhitespace();
        const name = this._readStringOrRegex() || "";
        const result2 = { kind: "role", role, name };
        this._readAttributes(result2);
        this._skipWhitespace();
        if (!this._eof())
          this._throwError("Unexpected input");
        return result2;
      }
      _applyAttribute(node, key, value2, errorPos) {
        if (key === "checked") {
          this._assert(value2 === "true" || value2 === "false" || value2 === "mixed", 'Value of "checked" attribute must be a boolean or "mixed"', errorPos);
          node.checked = value2 === "true" ? true : value2 === "false" ? false : "mixed";
          return;
        }
        if (key === "disabled") {
          this._assert(value2 === "true" || value2 === "false", 'Value of "disabled" attribute must be a boolean', errorPos);
          node.disabled = value2 === "true";
          return;
        }
        if (key === "expanded") {
          this._assert(value2 === "true" || value2 === "false", 'Value of "expanded" attribute must be a boolean', errorPos);
          node.expanded = value2 === "true";
          return;
        }
        if (key === "active") {
          this._assert(value2 === "true" || value2 === "false", 'Value of "active" attribute must be a boolean', errorPos);
          node.active = value2 === "true";
          return;
        }
        if (key === "invalid") {
          this._assert(value2 === "true" || value2 === "false" || value2 === "grammar" || value2 === "spelling", 'Value of "invalid" attribute must be a boolean, "grammar" or "spelling"', errorPos);
          node.invalid = value2 === "true" ? true : value2 === "false" ? false : value2;
          return;
        }
        if (key === "level") {
          this._assert(!isNaN(Number(value2)), 'Value of "level" attribute must be a number', errorPos);
          node.level = Number(value2);
          return;
        }
        if (key === "pressed") {
          this._assert(value2 === "true" || value2 === "false" || value2 === "mixed", 'Value of "pressed" attribute must be a boolean or "mixed"', errorPos);
          node.pressed = value2 === "true" ? true : value2 === "false" ? false : "mixed";
          return;
        }
        if (key === "selected") {
          this._assert(value2 === "true" || value2 === "false", 'Value of "selected" attribute must be a boolean', errorPos);
          node.selected = value2 === "true";
          return;
        }
        this._assert(false, `Unsupported attribute [${key}]`, errorPos);
      }
      _assert(value2, message, valuePos) {
        if (!value2)
          this._throwError(message || "Assertion error", valuePos);
      }
    };
    ParserError = class extends Error {
      constructor(message, pos) {
        super(message);
        this.pos = pos;
      }
    };
  }
});

// packages/isomorphic/stringUtils.ts
function escapeWithQuotes(text2, char = "'") {
  const stringified = JSON.stringify(text2);
  const escapedText = stringified.substring(1, stringified.length - 1).replace(/\\"/g, '"');
  if (char === "'")
    return char + escapedText.replace(/[']/g, "\\'") + char;
  if (char === '"')
    return char + escapedText.replace(/["]/g, '\\"') + char;
  if (char === "`")
    return char + escapedText.replace(/[`]/g, "\\`") + char;
  throw new Error("Invalid escape char");
}
function escapeTemplateString(text2) {
  return text2.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$\{/g, "\\${");
}
function isString(obj) {
  return typeof obj === "string" || obj instanceof String;
}
function toTitleCase(name) {
  return name.charAt(0).toUpperCase() + name.substring(1);
}
function toSnakeCase(name) {
  return name.replace(/([a-z0-9])([A-Z])/g, "$1_$2").replace(/([A-Z])([A-Z][a-z])/g, "$1_$2").toLowerCase();
}
function formatObject(value2, indent = "  ", mode = "multiline") {
  if (typeof value2 === "string")
    return escapeWithQuotes(value2, "'");
  if (Array.isArray(value2))
    return `[${value2.map((o) => formatObject(o)).join(", ")}]`;
  if (typeof value2 === "object") {
    const keys = Object.keys(value2).filter((key) => key !== "timeout" && value2[key] !== void 0).sort();
    if (!keys.length)
      return "{}";
    const tokens = [];
    for (const key of keys)
      tokens.push(`${key}: ${formatObject(value2[key])}`);
    if (mode === "multiline")
      return `{
${tokens.map((t) => indent + t).join(`,
`)}
}`;
    return `{ ${tokens.join(", ")} }`;
  }
  return String(value2);
}
function formatObjectOrVoid(value2, indent = "  ") {
  const result2 = formatObject(value2, indent);
  return result2 === "{}" ? "" : result2;
}
function quoteCSSAttributeValue(text2) {
  return `"${text2.replace(/["\\]/g, (char) => "\\" + char)}"`;
}
function cacheNormalizedWhitespaces() {
  normalizedWhitespaceCache = /* @__PURE__ */ new Map();
}
function normalizeWhiteSpace(text2) {
  let result2 = normalizedWhitespaceCache?.get(text2);
  if (result2 === void 0) {
    result2 = text2.replace(/[\u200b\u00ad]/g, "").trim().replace(/\s+/g, " ");
    normalizedWhitespaceCache?.set(text2, result2);
  }
  return result2;
}
function normalizeEscapedRegexQuotes(source11) {
  return source11.replace(/(^|[^\\])(\\\\)*\\(['"`])/g, "$1$2$3");
}
function escapeRegexForSelector(re2) {
  if (re2.unicode || re2.unicodeSets)
    return String(re2);
  return String(re2).replace(/(^|[^\\])(\\\\)*(["'`])/g, "$1$2\\$3").replace(/>>/g, "\\>\\>");
}
function escapeForTextSelector(text2, exact) {
  if (typeof text2 !== "string")
    return escapeRegexForSelector(text2);
  return `${JSON.stringify(text2)}${exact ? "s" : "i"}`;
}
function escapeForAttributeSelector(value2, exact) {
  if (typeof value2 !== "string")
    return escapeRegexForSelector(value2);
  return `"${value2.replace(/\\/g, "\\\\").replace(/["]/g, '\\"')}"${exact ? "s" : "i"}`;
}
function trimString(input, cap, suffix = "") {
  if (input.length <= cap)
    return input;
  const chars = [...input];
  if (chars.length > cap)
    return chars.slice(0, cap - suffix.length).join("") + suffix;
  return chars.join("");
}
function trimStringWithEllipsis(input, cap) {
  return trimString(input, cap, "\u2026");
}
function escapeRegExp(s) {
  return s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
}
function escapeHTMLAttribute(s) {
  return s.replace(/[&<>"']/ug, (char) => escaped[char]);
}
function escapeHTML(s) {
  return s.replace(/[&<]/ug, (char) => escaped[char]);
}
function longestCommonSubstring(s1, s2) {
  const n = s1.length;
  const m = s2.length;
  let maxLen = 0;
  let endingIndex = 0;
  const dp = Array(n + 1).fill(null).map(() => Array(m + 1).fill(0));
  for (let i = 1; i <= n; i++) {
    for (let j = 1; j <= m; j++) {
      if (s1[i - 1] === s2[j - 1]) {
        dp[i][j] = dp[i - 1][j - 1] + 1;
        if (dp[i][j] > maxLen) {
          maxLen = dp[i][j];
          endingIndex = i;
        }
      }
    }
  }
  return s1.slice(endingIndex - maxLen, endingIndex);
}
function parseRegex(regex) {
  if (regex[0] !== "/")
    throw new Error(`Invalid regex, must start with '/': ${regex}`);
  const lastSlash = regex.lastIndexOf("/");
  if (lastSlash <= 0)
    throw new Error(`Invalid regex, must end with '/' followed by optional flags: ${regex}`);
  const source11 = regex.slice(1, lastSlash);
  const flags = regex.slice(lastSlash + 1);
  return new RegExp(source11, flags);
}
function tomlBasicString(value2) {
  return JSON.stringify(value2);
}
function tomlArray(values) {
  return `[${values.map((value2) => tomlBasicString(value2)).join(", ")}]`;
}
function tomlMultilineBasicString(value2) {
  const escaped2 = value2.replace(/\\/g, "\\\\").replace(/"""/g, '\\"\\"\\"');
  return `"""
${escaped2}
"""`;
}
function stripAnsiEscapes(str) {
  return str.replace(ansiRegex, "");
}
var normalizedWhitespaceCache, escaped, ansiRegex;
var init_stringUtils = __esm({
  "packages/isomorphic/stringUtils.ts"() {
    "use strict";
    escaped = { "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;" };
    ansiRegex = new RegExp("([\\u001B\\u009B][[\\]()#?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)|(?:(?:\\d{0,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~])))", "g");
  }
});

// packages/isomorphic/rtti.ts
function isRegExp(obj) {
  return obj instanceof RegExp || Object.prototype.toString.call(obj) === "[object RegExp]";
}
function isRegexString(value2) {
  try {
    new RegExp(value2);
    return true;
  } catch {
    return false;
  }
}
function isObject(obj) {
  return typeof obj === "object" && obj !== null;
}
function isError(obj) {
  return obj instanceof Error || obj && Object.getPrototypeOf(obj)?.name === "Error";
}
var init_rtti = __esm({
  "packages/isomorphic/rtti.ts"() {
    "use strict";
    init_stringUtils();
  }
});

// packages/isomorphic/expectUtils.ts
function serializeExpectedTextValues(items, options = {}) {
  return items.map((i) => ({
    string: isString(i) ? i : void 0,
    regexSource: isRegExp(i) ? i.source : void 0,
    regexFlags: isRegExp(i) ? i.flags : void 0,
    matchSubstring: options.matchSubstring,
    ignoreCase: options.ignoreCase,
    normalizeWhiteSpace: options.normalizeWhiteSpace
  }));
}
var init_expectUtils = __esm({
  "packages/isomorphic/expectUtils.ts"() {
    "use strict";
    init_rtti();
  }
});

// packages/isomorphic/assert.ts
function assert(value2, message) {
  if (!value2)
    throw new Error(message || "Assertion error");
}
var init_assert = __esm({
  "packages/isomorphic/assert.ts"() {
    "use strict";
  }
});

// packages/isomorphic/base64.ts
function base64ByteLength(data) {
  if (!data)
    return 0;
  const padding = data[data.length - 2] === "=" ? 2 : data[data.length - 1] === "=" ? 1 : 0;
  return Math.max(0, Math.floor(data.length * 3 / 4) - padding);
}
var init_base64 = __esm({
  "packages/isomorphic/base64.ts"() {
    "use strict";
  }
});

// packages/isomorphic/colors.ts
var webColors, noColors, applyStyle;
var init_colors = __esm({
  "packages/isomorphic/colors.ts"() {
    "use strict";
    webColors = {
      enabled: true,
      reset: (text2) => applyStyle(0, 0, text2),
      bold: (text2) => applyStyle(1, 22, text2),
      dim: (text2) => applyStyle(2, 22, text2),
      italic: (text2) => applyStyle(3, 23, text2),
      underline: (text2) => applyStyle(4, 24, text2),
      inverse: (text2) => applyStyle(7, 27, text2),
      hidden: (text2) => applyStyle(8, 28, text2),
      strikethrough: (text2) => applyStyle(9, 29, text2),
      black: (text2) => applyStyle(30, 39, text2),
      red: (text2) => applyStyle(31, 39, text2),
      green: (text2) => applyStyle(32, 39, text2),
      yellow: (text2) => applyStyle(33, 39, text2),
      blue: (text2) => applyStyle(34, 39, text2),
      magenta: (text2) => applyStyle(35, 39, text2),
      cyan: (text2) => applyStyle(36, 39, text2),
      white: (text2) => applyStyle(37, 39, text2),
      gray: (text2) => applyStyle(90, 39, text2),
      grey: (text2) => applyStyle(90, 39, text2)
    };
    noColors = {
      enabled: false,
      reset: (t) => t,
      bold: (t) => t,
      dim: (t) => t,
      italic: (t) => t,
      underline: (t) => t,
      inverse: (t) => t,
      hidden: (t) => t,
      strikethrough: (t) => t,
      black: (t) => t,
      red: (t) => t,
      green: (t) => t,
      yellow: (t) => t,
      blue: (t) => t,
      magenta: (t) => t,
      cyan: (t) => t,
      white: (t) => t,
      gray: (t) => t,
      grey: (t) => t
    };
    applyStyle = (open5, close3, text2) => `\x1B[${open5}m${text2}\x1B[${close3}m`;
  }
});

// packages/isomorphic/headers.ts
function headersObjectToArray(headers, separator, setCookieSeparator) {
  if (!setCookieSeparator)
    setCookieSeparator = separator;
  const result2 = [];
  for (const name in headers) {
    const values = headers[name];
    if (values === void 0)
      continue;
    if (separator) {
      const sep = name.toLowerCase() === "set-cookie" ? setCookieSeparator : separator;
      for (const value2 of values.split(sep))
        result2.push({ name, value: value2.trim() });
    } else {
      result2.push({ name, value: values });
    }
  }
  return result2;
}
function headersArrayToObject(headers, lowerCase) {
  const result2 = {};
  for (const { name, value: value2 } of headers)
    result2[lowerCase ? name.toLowerCase() : name] = value2;
  return result2;
}
var init_headers = __esm({
  "packages/isomorphic/headers.ts"() {
    "use strict";
  }
});

// packages/isomorphic/imageUtils.ts
function padImageToSize(image, size) {
  if (image.width === size.width && image.height === size.height)
    return image;
  const buffer = new Uint8Array(size.width * size.height * 4);
  for (let y = 0; y < size.height; y++) {
    for (let x = 0; x < size.width; x++) {
      const to = (y * size.width + x) * 4;
      if (y < image.height && x < image.width) {
        const from = (y * image.width + x) * 4;
        buffer[to] = image.data[from];
        buffer[to + 1] = image.data[from + 1];
        buffer[to + 2] = image.data[from + 2];
        buffer[to + 3] = image.data[from + 3];
      } else {
        buffer[to] = 0;
        buffer[to + 1] = 0;
        buffer[to + 2] = 0;
        buffer[to + 3] = 0;
      }
    }
  }
  return { data: Buffer.from(buffer), width: size.width, height: size.height };
}
function scaleImageToSize(image, size) {
  const { data: src, width: w1, height: h1 } = image;
  const w2 = Math.max(1, Math.floor(size.width));
  const h2 = Math.max(1, Math.floor(size.height));
  if (w1 === w2 && h1 === h2)
    return image;
  if (w1 <= 0 || h1 <= 0)
    throw new Error("Invalid input image");
  if (size.width <= 0 || size.height <= 0 || !isFinite(size.width) || !isFinite(size.height))
    throw new Error("Invalid output dimensions");
  const clamp = (v, lo, hi) => v < lo ? lo : v > hi ? hi : v;
  const weights = (t, o) => {
    const t2 = t * t;
    const t3 = t2 * t;
    o[0] = -0.5 * t + 1 * t2 - 0.5 * t3;
    o[1] = 1 - 2.5 * t2 + 1.5 * t3;
    o[2] = 0.5 * t + 2 * t2 - 1.5 * t3;
    o[3] = -0.5 * t2 + 0.5 * t3;
  };
  const srcRowStride = w1 * 4;
  const dstRowStride = w2 * 4;
  const xOff = new Int32Array(w2 * 4);
  const xW = new Float32Array(w2 * 4);
  const wx = new Float32Array(4);
  const xScale = w1 / w2;
  for (let x = 0; x < w2; x++) {
    const sx = (x + 0.5) * xScale - 0.5;
    const sxi = Math.floor(sx);
    const t = sx - sxi;
    weights(t, wx);
    const b = x * 4;
    const i0 = clamp(sxi - 1, 0, w1 - 1);
    const i1 = clamp(sxi + 0, 0, w1 - 1);
    const i2 = clamp(sxi + 1, 0, w1 - 1);
    const i3 = clamp(sxi + 2, 0, w1 - 1);
    xOff[b + 0] = i0 << 2;
    xOff[b + 1] = i1 << 2;
    xOff[b + 2] = i2 << 2;
    xOff[b + 3] = i3 << 2;
    xW[b + 0] = wx[0];
    xW[b + 1] = wx[1];
    xW[b + 2] = wx[2];
    xW[b + 3] = wx[3];
  }
  const yRow = new Int32Array(h2 * 4);
  const yW = new Float32Array(h2 * 4);
  const wy = new Float32Array(4);
  const yScale = h1 / h2;
  for (let y = 0; y < h2; y++) {
    const sy = (y + 0.5) * yScale - 0.5;
    const syi = Math.floor(sy);
    const t = sy - syi;
    weights(t, wy);
    const b = y * 4;
    const j0 = clamp(syi - 1, 0, h1 - 1);
    const j1 = clamp(syi + 0, 0, h1 - 1);
    const j2 = clamp(syi + 1, 0, h1 - 1);
    const j3 = clamp(syi + 2, 0, h1 - 1);
    yRow[b + 0] = j0 * srcRowStride;
    yRow[b + 1] = j1 * srcRowStride;
    yRow[b + 2] = j2 * srcRowStride;
    yRow[b + 3] = j3 * srcRowStride;
    yW[b + 0] = wy[0];
    yW[b + 1] = wy[1];
    yW[b + 2] = wy[2];
    yW[b + 3] = wy[3];
  }
  const dst = new Uint8Array(w2 * h2 * 4);
  for (let y = 0; y < h2; y++) {
    const yb = y * 4;
    const rb0 = yRow[yb + 0];
    const rb1 = yRow[yb + 1];
    const rb2 = yRow[yb + 2];
    const rb3 = yRow[yb + 3];
    const wy0 = yW[yb + 0];
    const wy1 = yW[yb + 1];
    const wy2 = yW[yb + 2];
    const wy3 = yW[yb + 3];
    const dstBase = y * dstRowStride;
    for (let x = 0; x < w2; x++) {
      const xb = x * 4;
      const xo0 = xOff[xb + 0];
      const xo1 = xOff[xb + 1];
      const xo2 = xOff[xb + 2];
      const xo3 = xOff[xb + 3];
      const wx0 = xW[xb + 0];
      const wx1 = xW[xb + 1];
      const wx2 = xW[xb + 2];
      const wx3 = xW[xb + 3];
      const di = dstBase + (x << 2);
      for (let c = 0; c < 4; c++) {
        const r0 = src[rb0 + xo0 + c] * wx0 + src[rb0 + xo1 + c] * wx1 + src[rb0 + xo2 + c] * wx2 + src[rb0 + xo3 + c] * wx3;
        const r1 = src[rb1 + xo0 + c] * wx0 + src[rb1 + xo1 + c] * wx1 + src[rb1 + xo2 + c] * wx2 + src[rb1 + xo3 + c] * wx3;
        const r2 = src[rb2 + xo0 + c] * wx0 + src[rb2 + xo1 + c] * wx1 + src[rb2 + xo2 + c] * wx2 + src[rb2 + xo3 + c] * wx3;
        const r3 = src[rb3 + xo0 + c] * wx0 + src[rb3 + xo1 + c] * wx1 + src[rb3 + xo2 + c] * wx2 + src[rb3 + xo3 + c] * wx3;
        const v = r0 * wy0 + r1 * wy1 + r2 * wy2 + r3 * wy3;
        dst[di + c] = v < 0 ? 0 : v > 255 ? 255 : v | 0;
      }
    }
  }
  return { data: Buffer.from(dst.buffer), width: w2, height: h2 };
}
var init_imageUtils = __esm({
  "packages/isomorphic/imageUtils.ts"() {
    "use strict";
  }
});

// packages/isomorphic/jsonSchema.ts
function validate(value2, schema, path59) {
  const errors = [];
  if (schema.oneOf) {
    let bestErrors;
    for (const variant of schema.oneOf) {
      const variantErrors = validate(value2, variant, path59);
      if (variantErrors.length === 0)
        return [];
      if (!bestErrors || variantErrors.length < bestErrors.length)
        bestErrors = variantErrors;
    }
    if (bestErrors.length === 1 && bestErrors[0].startsWith(`${path59}: expected `))
      return [`${path59}: does not match any of the expected types`];
    return bestErrors;
  }
  if (schema.type === "string") {
    if (typeof value2 !== "string") {
      errors.push(`${path59}: expected string, got ${typeof value2}`);
      return errors;
    }
    if (schema.pattern && !cachedRegex(schema.pattern).test(value2))
      errors.push(schema.patternError || `${path59}: must match pattern "${schema.pattern}"`);
    return errors;
  }
  if (schema.type === "array") {
    if (!Array.isArray(value2)) {
      errors.push(`${path59}: expected array, got ${typeof value2}`);
      return errors;
    }
    if (schema.items) {
      for (let i = 0; i < value2.length; i++)
        errors.push(...validate(value2[i], schema.items, `${path59}[${i}]`));
    }
    return errors;
  }
  if (schema.type === "object") {
    if (!value2 || typeof value2 !== "object" || Array.isArray(value2)) {
      errors.push(`${path59}: expected object, got ${Array.isArray(value2) ? "array" : typeof value2}`);
      return errors;
    }
    const obj = value2;
    for (const key of schema.required || []) {
      if (obj[key] === void 0)
        errors.push(`${path59}.${key}: required`);
    }
    for (const [key, propSchema] of Object.entries(schema.properties || {})) {
      if (obj[key] !== void 0)
        errors.push(...validate(obj[key], propSchema, `${path59}.${key}`));
    }
    return errors;
  }
  return errors;
}
function cachedRegex(pattern) {
  let regex = regexCache.get(pattern);
  if (!regex) {
    regex = new RegExp(pattern);
    regexCache.set(pattern, regex);
  }
  return regex;
}
var regexCache;
var init_jsonSchema = __esm({
  "packages/isomorphic/jsonSchema.ts"() {
    "use strict";
    regexCache = /* @__PURE__ */ new Map();
  }
});

// packages/isomorphic/cssTokenizer.ts
function digit(code) {
  return between(code, 48, 57);
}
function hexdigit(code) {
  return digit(code) || between(code, 65, 70) || between(code, 97, 102);
}
function uppercaseletter(code) {
  return between(code, 65, 90);
}
function lowercaseletter(code) {
  return between(code, 97, 122);
}
function letter(code) {
  return uppercaseletter(code) || lowercaseletter(code);
}
function nonascii(code) {
  return code >= 128;
}
function namestartchar(code) {
  return letter(code) || nonascii(code) || code === 95;
}
function namechar(code) {
  return namestartchar(code) || digit(code) || code === 45;
}
function nonprintable(code) {
  return between(code, 0, 8) || code === 11 || between(code, 14, 31) || code === 127;
}
function newline(code) {
  return code === 10;
}
function whitespace(code) {
  return newline(code) || code === 9 || code === 32;
}
function preprocess(str) {
  const codepoints = [];
  for (let i = 0; i < str.length; i++) {
    let code = str.charCodeAt(i);
    if (code === 13 && str.charCodeAt(i + 1) === 10) {
      code = 10;
      i++;
    }
    if (code === 13 || code === 12)
      code = 10;
    if (code === 0)
      code = 65533;
    if (between(code, 55296, 56319) && between(str.charCodeAt(i + 1), 56320, 57343)) {
      const lead = code - 55296;
      const trail = str.charCodeAt(i + 1) - 56320;
      code = Math.pow(2, 16) + lead * Math.pow(2, 10) + trail;
      i++;
    }
    codepoints.push(code);
  }
  return codepoints;
}
function stringFromCode(code) {
  if (code <= 65535)
    return String.fromCharCode(code);
  code -= Math.pow(2, 16);
  const lead = Math.floor(code / Math.pow(2, 10)) + 55296;
  const trail = code % Math.pow(2, 10) + 56320;
  return String.fromCharCode(lead) + String.fromCharCode(trail);
}
function tokenize(str1) {
  const str = preprocess(str1);
  let i = -1;
  const tokens = [];
  let code;
  let line = 0;
  let column = 0;
  let lastLineLength = 0;
  const incrLineno = function() {
    line += 1;
    lastLineLength = column;
    column = 0;
  };
  const locStart = { line, column };
  const codepoint = function(i2) {
    if (i2 >= str.length)
      return -1;
    return str[i2];
  };
  const next = function(num) {
    if (num === void 0)
      num = 1;
    if (num > 3)
      throw "Spec Error: no more than three codepoints of lookahead.";
    return codepoint(i + num);
  };
  const consume = function(num) {
    if (num === void 0)
      num = 1;
    i += num;
    code = codepoint(i);
    if (newline(code))
      incrLineno();
    else
      column += num;
    return true;
  };
  const reconsume = function() {
    i -= 1;
    if (newline(code)) {
      line -= 1;
      column = lastLineLength;
    } else {
      column -= 1;
    }
    locStart.line = line;
    locStart.column = column;
    return true;
  };
  const eof = function(codepoint2) {
    if (codepoint2 === void 0)
      codepoint2 = code;
    return codepoint2 === -1;
  };
  const donothing = function() {
  };
  const parseerror = function() {
  };
  const consumeAToken = function() {
    consumeComments();
    consume();
    if (whitespace(code)) {
      while (whitespace(next()))
        consume();
      return new WhitespaceToken();
    } else if (code === 34) {
      return consumeAStringToken();
    } else if (code === 35) {
      if (namechar(next()) || areAValidEscape(next(1), next(2))) {
        const token = new HashToken("");
        if (wouldStartAnIdentifier(next(1), next(2), next(3)))
          token.type = "id";
        token.value = consumeAName();
        return token;
      } else {
        return new DelimToken(code);
      }
    } else if (code === 36) {
      if (next() === 61) {
        consume();
        return new SuffixMatchToken();
      } else {
        return new DelimToken(code);
      }
    } else if (code === 39) {
      return consumeAStringToken();
    } else if (code === 40) {
      return new OpenParenToken();
    } else if (code === 41) {
      return new CloseParenToken();
    } else if (code === 42) {
      if (next() === 61) {
        consume();
        return new SubstringMatchToken();
      } else {
        return new DelimToken(code);
      }
    } else if (code === 43) {
      if (startsWithANumber()) {
        reconsume();
        return consumeANumericToken();
      } else {
        return new DelimToken(code);
      }
    } else if (code === 44) {
      return new CommaToken();
    } else if (code === 45) {
      if (startsWithANumber()) {
        reconsume();
        return consumeANumericToken();
      } else if (next(1) === 45 && next(2) === 62) {
        consume(2);
        return new CDCToken();
      } else if (startsWithAnIdentifier()) {
        reconsume();
        return consumeAnIdentlikeToken();
      } else {
        return new DelimToken(code);
      }
    } else if (code === 46) {
      if (startsWithANumber()) {
        reconsume();
        return consumeANumericToken();
      } else {
        return new DelimToken(code);
      }
    } else if (code === 58) {
      return new ColonToken();
    } else if (code === 59) {
      return new SemicolonToken();
    } else if (code === 60) {
      if (next(1) === 33 && next(2) === 45 && next(3) === 45) {
        consume(3);
        return new CDOToken();
      } else {
        return new DelimToken(code);
      }
    } else if (code === 64) {
      if (wouldStartAnIdentifier(next(1), next(2), next(3)))
        return new AtKeywordToken(consumeAName());
      else
        return new DelimToken(code);
    } else if (code === 91) {
      return new OpenSquareToken();
    } else if (code === 92) {
      if (startsWithAValidEscape()) {
        reconsume();
        return consumeAnIdentlikeToken();
      } else {
        parseerror();
        return new DelimToken(code);
      }
    } else if (code === 93) {
      return new CloseSquareToken();
    } else if (code === 94) {
      if (next() === 61) {
        consume();
        return new PrefixMatchToken();
      } else {
        return new DelimToken(code);
      }
    } else if (code === 123) {
      return new OpenCurlyToken();
    } else if (code === 124) {
      if (next() === 61) {
        consume();
        return new DashMatchToken();
      } else if (next() === 124) {
        consume();
        return new ColumnToken();
      } else {
        return new DelimToken(code);
      }
    } else if (code === 125) {
      return new CloseCurlyToken();
    } else if (code === 126) {
      if (next() === 61) {
        consume();
        return new IncludeMatchToken();
      } else {
        return new DelimToken(code);
      }
    } else if (digit(code)) {
      reconsume();
      return consumeANumericToken();
    } else if (namestartchar(code)) {
      reconsume();
      return consumeAnIdentlikeToken();
    } else if (eof()) {
      return new EOFToken();
    } else {
      return new DelimToken(code);
    }
  };
  const consumeComments = function() {
    while (next(1) === 47 && next(2) === 42) {
      consume(2);
      while (true) {
        consume();
        if (code === 42 && next() === 47) {
          consume();
          break;
        } else if (eof()) {
          parseerror();
          return;
        }
      }
    }
  };
  const consumeANumericToken = function() {
    const num = consumeANumber();
    if (wouldStartAnIdentifier(next(1), next(2), next(3))) {
      const token = new DimensionToken();
      token.value = num.value;
      token.repr = num.repr;
      token.type = num.type;
      token.unit = consumeAName();
      return token;
    } else if (next() === 37) {
      consume();
      const token = new PercentageToken();
      token.value = num.value;
      token.repr = num.repr;
      return token;
    } else {
      const token = new NumberToken();
      token.value = num.value;
      token.repr = num.repr;
      token.type = num.type;
      return token;
    }
  };
  const consumeAnIdentlikeToken = function() {
    const str2 = consumeAName();
    if (str2.toLowerCase() === "url" && next() === 40) {
      consume();
      while (whitespace(next(1)) && whitespace(next(2)))
        consume();
      if (next() === 34 || next() === 39)
        return new FunctionToken(str2);
      else if (whitespace(next()) && (next(2) === 34 || next(2) === 39))
        return new FunctionToken(str2);
      else
        return consumeAURLToken();
    } else if (next() === 40) {
      consume();
      return new FunctionToken(str2);
    } else {
      return new IdentToken(str2);
    }
  };
  const consumeAStringToken = function(endingCodePoint) {
    if (endingCodePoint === void 0)
      endingCodePoint = code;
    let string = "";
    while (consume()) {
      if (code === endingCodePoint || eof()) {
        return new StringToken(string);
      } else if (newline(code)) {
        parseerror();
        reconsume();
        return new BadStringToken();
      } else if (code === 92) {
        if (eof(next()))
          donothing();
        else if (newline(next()))
          consume();
        else
          string += stringFromCode(consumeEscape());
      } else {
        string += stringFromCode(code);
      }
    }
    throw new Error("Internal error");
  };
  const consumeAURLToken = function() {
    const token = new URLToken("");
    while (whitespace(next()))
      consume();
    if (eof(next()))
      return token;
    while (consume()) {
      if (code === 41 || eof()) {
        return token;
      } else if (whitespace(code)) {
        while (whitespace(next()))
          consume();
        if (next() === 41 || eof(next())) {
          consume();
          return token;
        } else {
          consumeTheRemnantsOfABadURL();
          return new BadURLToken();
        }
      } else if (code === 34 || code === 39 || code === 40 || nonprintable(code)) {
        parseerror();
        consumeTheRemnantsOfABadURL();
        return new BadURLToken();
      } else if (code === 92) {
        if (startsWithAValidEscape()) {
          token.value += stringFromCode(consumeEscape());
        } else {
          parseerror();
          consumeTheRemnantsOfABadURL();
          return new BadURLToken();
        }
      } else {
        token.value += stringFromCode(code);
      }
    }
    throw new Error("Internal error");
  };
  const consumeEscape = function() {
    consume();
    if (hexdigit(code)) {
      const digits = [code];
      for (let total = 0; total < 5; total++) {
        if (hexdigit(next())) {
          consume();
          digits.push(code);
        } else {
          break;
        }
      }
      if (whitespace(next()))
        consume();
      let value2 = parseInt(digits.map(function(x) {
        return String.fromCharCode(x);
      }).join(""), 16);
      if (value2 > maximumallowedcodepoint)
        value2 = 65533;
      return value2;
    } else if (eof()) {
      return 65533;
    } else {
      return code;
    }
  };
  const areAValidEscape = function(c1, c2) {
    if (c1 !== 92)
      return false;
    if (newline(c2))
      return false;
    return true;
  };
  const startsWithAValidEscape = function() {
    return areAValidEscape(code, next());
  };
  const wouldStartAnIdentifier = function(c1, c2, c3) {
    if (c1 === 45)
      return namestartchar(c2) || c2 === 45 || areAValidEscape(c2, c3);
    else if (namestartchar(c1))
      return true;
    else if (c1 === 92)
      return areAValidEscape(c1, c2);
    else
      return false;
  };
  const startsWithAnIdentifier = function() {
    return wouldStartAnIdentifier(code, next(1), next(2));
  };
  const wouldStartANumber = function(c1, c2, c3) {
    if (c1 === 43 || c1 === 45) {
      if (digit(c2))
        return true;
      if (c2 === 46 && digit(c3))
        return true;
      return false;
    } else if (c1 === 46) {
      if (digit(c2))
        return true;
      return false;
    } else if (digit(c1)) {
      return true;
    } else {
      return false;
    }
  };
  const startsWithANumber = function() {
    return wouldStartANumber(code, next(1), next(2));
  };
  const consumeAName = function() {
    let result2 = "";
    while (consume()) {
      if (namechar(code)) {
        result2 += stringFromCode(code);
      } else if (startsWithAValidEscape()) {
        result2 += stringFromCode(consumeEscape());
      } else {
        reconsume();
        return result2;
      }
    }
    throw new Error("Internal parse error");
  };
  const consumeANumber = function() {
    let repr = "";
    let type3 = "integer";
    if (next() === 43 || next() === 45) {
      consume();
      repr += stringFromCode(code);
    }
    while (digit(next())) {
      consume();
      repr += stringFromCode(code);
    }
    if (next(1) === 46 && digit(next(2))) {
      consume();
      repr += stringFromCode(code);
      consume();
      repr += stringFromCode(code);
      type3 = "number";
      while (digit(next())) {
        consume();
        repr += stringFromCode(code);
      }
    }
    const c1 = next(1);
    const c2 = next(2);
    const c3 = next(3);
    if ((c1 === 69 || c1 === 101) && digit(c2)) {
      consume();
      repr += stringFromCode(code);
      consume();
      repr += stringFromCode(code);
      type3 = "number";
      while (digit(next())) {
        consume();
        repr += stringFromCode(code);
      }
    } else if ((c1 === 69 || c1 === 101) && (c2 === 43 || c2 === 45) && digit(c3)) {
      consume();
      repr += stringFromCode(code);
      consume();
      repr += stringFromCode(code);
      consume();
      repr += stringFromCode(code);
      type3 = "number";
      while (digit(next())) {
        consume();
        repr += stringFromCode(code);
      }
    }
    const value2 = convertAStringToANumber(repr);
    return { type: type3, value: value2, repr };
  };
  const convertAStringToANumber = function(string) {
    return +string;
  };
  const consumeTheRemnantsOfABadURL = function() {
    while (consume()) {
      if (code === 41 || eof()) {
        return;
      } else if (startsWithAValidEscape()) {
        consumeEscape();
        donothing();
      } else {
        donothing();
      }
    }
  };
  let iterationCount = 0;
  while (!eof(next())) {
    tokens.push(consumeAToken());
    iterationCount++;
    if (iterationCount > str.length * 2)
      throw new Error("I'm infinite-looping!");
  }
  return tokens;
}
function escapeIdent(string) {
  string = "" + string;
  let result2 = "";
  const firstcode = string.charCodeAt(0);
  for (let i = 0; i < string.length; i++) {
    const code = string.charCodeAt(i);
    if (code === 0)
      throw new InvalidCharacterError("Invalid character: the input contains U+0000.");
    if (between(code, 1, 31) || code === 127 || i === 0 && between(code, 48, 57) || i === 1 && between(code, 48, 57) && firstcode === 45)
      result2 += "\\" + code.toString(16) + " ";
    else if (code >= 128 || code === 45 || code === 95 || between(code, 48, 57) || between(code, 65, 90) || between(code, 97, 122))
      result2 += string[i];
    else
      result2 += "\\" + string[i];
  }
  return result2;
}
function escapeHash(string) {
  string = "" + string;
  let result2 = "";
  for (let i = 0; i < string.length; i++) {
    const code = string.charCodeAt(i);
    if (code === 0)
      throw new InvalidCharacterError("Invalid character: the input contains U+0000.");
    if (code >= 128 || code === 45 || code === 95 || between(code, 48, 57) || between(code, 65, 90) || between(code, 97, 122))
      result2 += string[i];
    else
      result2 += "\\" + code.toString(16) + " ";
  }
  return result2;
}
function escapeString(string) {
  string = "" + string;
  let result2 = "";
  for (let i = 0; i < string.length; i++) {
    const code = string.charCodeAt(i);
    if (code === 0)
      throw new InvalidCharacterError("Invalid character: the input contains U+0000.");
    if (between(code, 1, 31) || code === 127)
      result2 += "\\" + code.toString(16) + " ";
    else if (code === 34 || code === 92)
      result2 += "\\" + string[i];
    else
      result2 += string[i];
  }
  return result2;
}
var between, maximumallowedcodepoint, InvalidCharacterError, CSSParserToken, BadStringToken, BadURLToken, WhitespaceToken, CDOToken, CDCToken, ColonToken, SemicolonToken, CommaToken, GroupingToken, OpenCurlyToken, CloseCurlyToken, OpenSquareToken, CloseSquareToken, OpenParenToken, CloseParenToken, IncludeMatchToken, DashMatchToken, PrefixMatchToken, SuffixMatchToken, SubstringMatchToken, ColumnToken, EOFToken, DelimToken, StringValuedToken, IdentToken, FunctionToken, AtKeywordToken, HashToken, StringToken, URLToken, NumberToken, PercentageToken, DimensionToken;
var init_cssTokenizer = __esm({
  "packages/isomorphic/cssTokenizer.ts"() {
    "use strict";
    between = function(num, first, last) {
      return num >= first && num <= last;
    };
    maximumallowedcodepoint = 1114111;
    InvalidCharacterError = class extends Error {
      constructor(message) {
        super(message);
        this.name = "InvalidCharacterError";
      }
    };
    CSSParserToken = class {
      constructor() {
        this.tokenType = "";
      }
      toJSON() {
        return { token: this.tokenType };
      }
      toString() {
        return this.tokenType;
      }
      toSource() {
        return "" + this;
      }
    };
    BadStringToken = class extends CSSParserToken {
      constructor() {
        super(...arguments);
        this.tokenType = "BADSTRING";
      }
    };
    BadURLToken = class extends CSSParserToken {
      constructor() {
        super(...arguments);
        this.tokenType = "BADURL";
      }
    };
    WhitespaceToken = class extends CSSParserToken {
      constructor() {
        super(...arguments);
        this.tokenType = "WHITESPACE";
      }
      toString() {
        return "WS";
      }
      toSource() {
        return " ";
      }
    };
    CDOToken = class extends CSSParserToken {
      constructor() {
        super(...arguments);
        this.tokenType = "CDO";
      }
      toSource() {
        return "<!--";
      }
    };
    CDCToken = class extends CSSParserToken {
      constructor() {
        super(...arguments);
        this.tokenType = "CDC";
      }
      toSource() {
        return "-->";
      }
    };
    ColonToken = class extends CSSParserToken {
      constructor() {
        super(...arguments);
        this.tokenType = ":";
      }
    };
    SemicolonToken = class extends CSSParserToken {
      constructor() {
        super(...arguments);
        this.tokenType = ";";
      }
    };
    CommaToken = class extends CSSParserToken {
      constructor() {
        super(...arguments);
        this.tokenType = ",";
      }
    };
    GroupingToken = class extends CSSParserToken {
      constructor() {
        super(...arguments);
        this.value = "";
        this.mirror = "";
      }
    };
    OpenCurlyToken = class extends GroupingToken {
      constructor() {
        super();
        this.tokenType = "{";
        this.value = "{";
        this.mirror = "}";
      }
    };
    CloseCurlyToken = class extends GroupingToken {
      constructor() {
        super();
        this.tokenType = "}";
        this.value = "}";
        this.mirror = "{";
      }
    };
    OpenSquareToken = class extends GroupingToken {
      constructor() {
        super();
        this.tokenType = "[";
        this.value = "[";
        this.mirror = "]";
      }
    };
    CloseSquareToken = class extends GroupingToken {
      constructor() {
        super();
        this.tokenType = "]";
        this.value = "]";
        this.mirror = "[";
      }
    };
    OpenParenToken = class extends GroupingToken {
      constructor() {
        super();
        this.tokenType = "(";
        this.value = "(";
        this.mirror = ")";
      }
    };
    CloseParenToken = class extends GroupingToken {
      constructor() {
        super();
        this.tokenType = ")";
        this.value = ")";
        this.mirror = "(";
      }
    };
    IncludeMatchToken = class extends CSSParserToken {
      constructor() {
        super(...arguments);
        this.tokenType = "~=";
      }
    };
    DashMatchToken = class extends CSSParserToken {
      constructor() {
        super(...arguments);
        this.tokenType = "|=";
      }
    };
    PrefixMatchToken = class extends CSSParserToken {
      constructor() {
        super(...arguments);
        this.tokenType = "^=";
      }
    };
    SuffixMatchToken = class extends CSSParserToken {
      constructor() {
        super(...arguments);
        this.tokenType = "$=";
      }
    };
    SubstringMatchToken = class extends CSSParserToken {
      constructor() {
        super(...arguments);
        this.tokenType = "*=";
      }
    };
    ColumnToken = class extends CSSParserToken {
      constructor() {
        super(...arguments);
        this.tokenType = "||";
      }
    };
    EOFToken = class extends CSSParserToken {
      constructor() {
        super(...arguments);
        this.tokenType = "EOF";
      }
      toSource() {
        return "";
      }
    };
    DelimToken = class extends CSSParserToken {
      constructor(code) {
        super();
        this.tokenType = "DELIM";
        this.value = "";
        this.value = stringFromCode(code);
      }
      toString() {
        return "DELIM(" + this.value + ")";
      }
      toJSON() {
        const json = this.constructor.prototype.constructor.prototype.toJSON.call(this);
        json.value = this.value;
        return json;
      }
      toSource() {
        if (this.value === "\\")
          return "\\\n";
        else
          return this.value;
      }
    };
    StringValuedToken = class extends CSSParserToken {
      constructor() {
        super(...arguments);
        this.value = "";
      }
      ASCIIMatch(str) {
        return this.value.toLowerCase() === str.toLowerCase();
      }
      toJSON() {
        const json = this.constructor.prototype.constructor.prototype.toJSON.call(this);
        json.value = this.value;
        return json;
      }
    };
    IdentToken = class extends StringValuedToken {
      constructor(val) {
        super();
        this.tokenType = "IDENT";
        this.value = val;
      }
      toString() {
        return "IDENT(" + this.value + ")";
      }
      toSource() {
        return escapeIdent(this.value);
      }
    };
    FunctionToken = class extends StringValuedToken {
      constructor(val) {
        super();
        this.tokenType = "FUNCTION";
        this.value = val;
        this.mirror = ")";
      }
      toString() {
        return "FUNCTION(" + this.value + ")";
      }
      toSource() {
        return escapeIdent(this.value) + "(";
      }
    };
    AtKeywordToken = class extends StringValuedToken {
      constructor(val) {
        super();
        this.tokenType = "AT-KEYWORD";
        this.value = val;
      }
      toString() {
        return "AT(" + this.value + ")";
      }
      toSource() {
        return "@" + escapeIdent(this.value);
      }
    };
    HashToken = class extends StringValuedToken {
      constructor(val) {
        super();
        this.tokenType = "HASH";
        this.value = val;
        this.type = "unrestricted";
      }
      toString() {
        return "HASH(" + this.value + ")";
      }
      toJSON() {
        const json = this.constructor.prototype.constructor.prototype.toJSON.call(this);
        json.value = this.value;
        json.type = this.type;
        return json;
      }
      toSource() {
        if (this.type === "id")
          return "#" + escapeIdent(this.value);
        else
          return "#" + escapeHash(this.value);
      }
    };
    StringToken = class extends StringValuedToken {
      constructor(val) {
        super();
        this.tokenType = "STRING";
        this.value = val;
      }
      toString() {
        return '"' + escapeString(this.value) + '"';
      }
    };
    URLToken = class extends StringValuedToken {
      constructor(val) {
        super();
        this.tokenType = "URL";
        this.value = val;
      }
      toString() {
        return "URL(" + this.value + ")";
      }
      toSource() {
        return 'url("' + escapeString(this.value) + '")';
      }
    };
    NumberToken = class extends CSSParserToken {
      constructor() {
        super();
        this.tokenType = "NUMBER";
        this.type = "integer";
        this.repr = "";
      }
      toString() {
        if (this.type === "integer")
          return "INT(" + this.value + ")";
        return "NUMBER(" + this.value + ")";
      }
      toJSON() {
        const json = super.toJSON();
        json.value = this.value;
        json.type = this.type;
        json.repr = this.repr;
        return json;
      }
      toSource() {
        return this.repr;
      }
    };
    PercentageToken = class extends CSSParserToken {
      constructor() {
        super();
        this.tokenType = "PERCENTAGE";
        this.repr = "";
      }
      toString() {
        return "PERCENTAGE(" + this.value + ")";
      }
      toJSON() {
        const json = this.constructor.prototype.constructor.prototype.toJSON.call(this);
        json.value = this.value;
        json.repr = this.repr;
        return json;
      }
      toSource() {
        return this.repr + "%";
      }
    };
    DimensionToken = class extends CSSParserToken {
      constructor() {
        super();
        this.tokenType = "DIMENSION";
        this.type = "integer";
        this.repr = "";
        this.unit = "";
      }
      toString() {
        return "DIM(" + this.value + "," + this.unit + ")";
      }
      toJSON() {
        const json = this.constructor.prototype.constructor.prototype.toJSON.call(this);
        json.value = this.value;
        json.type = this.type;
        json.repr = this.repr;
        json.unit = this.unit;
        return json;
      }
      toSource() {
        const source11 = this.repr;
        let unit = escapeIdent(this.unit);
        if (unit[0].toLowerCase() === "e" && (unit[1] === "-" || between(unit.charCodeAt(1), 48, 57))) {
          unit = "\\65 " + unit.slice(1, unit.length);
        }
        return source11 + unit;
      }
    };
  }
});

// packages/isomorphic/cssParser.ts
function isInvalidSelectorError(error) {
  return error instanceof InvalidSelectorError;
}
function parseCSS(selector, customNames) {
  let tokens;
  try {
    tokens = tokenize(selector);
    if (!(tokens[tokens.length - 1] instanceof EOFToken))
      tokens.push(new EOFToken());
  } catch (e) {
    const newMessage = e.message + ` while parsing css selector "${selector}". Did you mean to CSS.escape it?`;
    const index = (e.stack || "").indexOf(e.message);
    if (index !== -1)
      e.stack = e.stack.substring(0, index) + newMessage + e.stack.substring(index + e.message.length);
    e.message = newMessage;
    throw e;
  }
  const unsupportedToken = tokens.find((token) => {
    return token instanceof AtKeywordToken || token instanceof BadStringToken || token instanceof BadURLToken || token instanceof ColumnToken || token instanceof CDOToken || token instanceof CDCToken || token instanceof SemicolonToken || // TODO: Consider using these for something, e.g. to escape complex strings.
    // For example :xpath{ (//div/bar[@attr="foo"])[2]/baz }
    // Or this way :xpath( {complex-xpath-goes-here("hello")} )
    token instanceof OpenCurlyToken || token instanceof CloseCurlyToken || // TODO: Consider treating these as strings?
    token instanceof URLToken || token instanceof PercentageToken;
  });
  if (unsupportedToken)
    throw new InvalidSelectorError(`Unsupported token "${unsupportedToken.toSource()}" while parsing css selector "${selector}". Did you mean to CSS.escape it?`);
  let pos = 0;
  const names = /* @__PURE__ */ new Set();
  function unexpected() {
    return new InvalidSelectorError(`Unexpected token "${tokens[pos].toSource()}" while parsing css selector "${selector}". Did you mean to CSS.escape it?`);
  }
  function skipWhitespace() {
    while (tokens[pos] instanceof WhitespaceToken)
      pos++;
  }
  function isIdent(p = pos) {
    return tokens[p] instanceof IdentToken;
  }
  function isString2(p = pos) {
    return tokens[p] instanceof StringToken;
  }
  function isNumber(p = pos) {
    return tokens[p] instanceof NumberToken;
  }
  function isComma(p = pos) {
    return tokens[p] instanceof CommaToken;
  }
  function isOpenParen(p = pos) {
    return tokens[p] instanceof OpenParenToken;
  }
  function isCloseParen(p = pos) {
    return tokens[p] instanceof CloseParenToken;
  }
  function isFunction2(p = pos) {
    return tokens[p] instanceof FunctionToken;
  }
  function isStar(p = pos) {
    return tokens[p] instanceof DelimToken && tokens[p].value === "*";
  }
  function isEOF(p = pos) {
    return tokens[p] instanceof EOFToken;
  }
  function isClauseCombinator(p = pos) {
    return tokens[p] instanceof DelimToken && [">", "+", "~"].includes(tokens[p].value);
  }
  function isSelectorClauseEnd(p = pos) {
    return isComma(p) || isCloseParen(p) || isEOF(p) || isClauseCombinator(p) || tokens[p] instanceof WhitespaceToken;
  }
  function consumeFunctionArguments() {
    const result3 = [consumeArgument()];
    while (true) {
      skipWhitespace();
      if (!isComma())
        break;
      pos++;
      result3.push(consumeArgument());
    }
    return result3;
  }
  function consumeArgument() {
    skipWhitespace();
    if (isNumber())
      return tokens[pos++].value;
    if (isString2())
      return tokens[pos++].value;
    return consumeComplexSelector();
  }
  function consumeComplexSelector() {
    const result3 = { simples: [] };
    skipWhitespace();
    if (isClauseCombinator()) {
      result3.simples.push({ selector: { functions: [{ name: "scope", args: [] }] }, combinator: "" });
    } else {
      result3.simples.push({ selector: consumeSimpleSelector(), combinator: "" });
    }
    while (true) {
      skipWhitespace();
      if (isClauseCombinator()) {
        result3.simples[result3.simples.length - 1].combinator = tokens[pos++].value;
        skipWhitespace();
      } else if (isSelectorClauseEnd()) {
        break;
      }
      result3.simples.push({ combinator: "", selector: consumeSimpleSelector() });
    }
    return result3;
  }
  function consumeSimpleSelector() {
    let rawCSSString = "";
    const functions = [];
    while (!isSelectorClauseEnd()) {
      if (isIdent() || isStar()) {
        rawCSSString += tokens[pos++].toSource();
      } else if (tokens[pos] instanceof HashToken) {
        rawCSSString += tokens[pos++].toSource();
      } else if (tokens[pos] instanceof DelimToken && tokens[pos].value === ".") {
        pos++;
        if (isIdent())
          rawCSSString += "." + tokens[pos++].toSource();
        else
          throw unexpected();
      } else if (tokens[pos] instanceof ColonToken) {
        pos++;
        if (isIdent()) {
          if (!customNames.has(tokens[pos].value.toLowerCase())) {
            rawCSSString += ":" + tokens[pos++].toSource();
          } else {
            const name = tokens[pos++].value.toLowerCase();
            functions.push({ name, args: [] });
            names.add(name);
          }
        } else if (isFunction2()) {
          const name = tokens[pos++].value.toLowerCase();
          if (!customNames.has(name)) {
            rawCSSString += `:${name}(${consumeBuiltinFunctionArguments()})`;
          } else {
            functions.push({ name, args: consumeFunctionArguments() });
            names.add(name);
          }
          skipWhitespace();
          if (!isCloseParen())
            throw unexpected();
          pos++;
        } else {
          throw unexpected();
        }
      } else if (tokens[pos] instanceof OpenSquareToken) {
        rawCSSString += "[";
        pos++;
        while (!(tokens[pos] instanceof CloseSquareToken) && !isEOF())
          rawCSSString += tokens[pos++].toSource();
        if (!(tokens[pos] instanceof CloseSquareToken))
          throw unexpected();
        rawCSSString += "]";
        pos++;
      } else {
        throw unexpected();
      }
    }
    if (!rawCSSString && !functions.length)
      throw unexpected();
    return { css: rawCSSString || void 0, functions };
  }
  function consumeBuiltinFunctionArguments() {
    let s = "";
    let balance = 1;
    while (!isEOF()) {
      if (isOpenParen() || isFunction2())
        balance++;
      if (isCloseParen())
        balance--;
      if (!balance)
        break;
      s += tokens[pos++].toSource();
    }
    return s;
  }
  const result2 = consumeFunctionArguments();
  if (!isEOF())
    throw unexpected();
  if (result2.some((arg) => typeof arg !== "object" || !("simples" in arg)))
    throw new InvalidSelectorError(`Error while parsing css selector "${selector}". Did you mean to CSS.escape it?`);
  return { selector: result2, names: Array.from(names) };
}
function serializeSelector(args) {
  return args.map((arg) => {
    if (typeof arg === "string")
      return `"${arg}"`;
    if (typeof arg === "number")
      return String(arg);
    return arg.simples.map(({ selector, combinator }) => {
      let s = selector.css || "";
      s = s + selector.functions.map((func) => `:${func.name}(${serializeSelector(func.args)})`).join("");
      if (combinator)
        s += " " + combinator;
      return s;
    }).join(" ");
  }).join(", ");
}
var InvalidSelectorError;
var init_cssParser = __esm({
  "packages/isomorphic/cssParser.ts"() {
    "use strict";
    init_cssTokenizer();
    InvalidSelectorError = class extends Error {
    };
  }
});

// packages/isomorphic/selectorParser.ts
function parseSelector(selector) {
  const parsedStrings = parseSelectorString(selector);
  const parts = [];
  for (const part of parsedStrings.parts) {
    if (part.name === "css" || part.name === "css:light") {
      if (part.name === "css:light")
        part.body = ":light(" + part.body + ")";
      const parsedCSS = parseCSS(part.body, customCSSNames);
      parts.push({
        name: "css",
        body: parsedCSS.selector,
        source: part.body
      });
      continue;
    }
    if (kNestedSelectorNames.has(part.name)) {
      let innerSelector;
      let distance;
      try {
        const unescaped = JSON.parse("[" + part.body + "]");
        if (!Array.isArray(unescaped) || unescaped.length < 1 || unescaped.length > 2 || typeof unescaped[0] !== "string")
          throw new InvalidSelectorError(`Malformed selector: ${part.name}=` + part.body);
        innerSelector = unescaped[0];
        if (unescaped.length === 2) {
          if (typeof unescaped[1] !== "number" || !kNestedSelectorNamesWithDistance.has(part.name))
            throw new InvalidSelectorError(`Malformed selector: ${part.name}=` + part.body);
          distance = unescaped[1];
        }
      } catch (e) {
        throw new InvalidSelectorError(`Malformed selector: ${part.name}=` + part.body);
      }
      const nested = { name: part.name, source: part.body, body: { parsed: parseSelector(innerSelector), distance } };
      const lastFrame = [...nested.body.parsed.parts].reverse().find((part2) => part2.name === "internal:control" && part2.body === "enter-frame");
      const lastFrameIndex = lastFrame ? nested.body.parsed.parts.indexOf(lastFrame) : -1;
      if (lastFrameIndex !== -1 && selectorPartsEqual(nested.body.parsed.parts.slice(0, lastFrameIndex + 1), parts.slice(0, lastFrameIndex + 1)))
        nested.body.parsed.parts.splice(0, lastFrameIndex + 1);
      parts.push(nested);
      continue;
    }
    parts.push({ ...part, source: part.body });
  }
  if (kNestedSelectorNames.has(parts[0].name))
    throw new InvalidSelectorError(`"${parts[0].name}" selector cannot be first`);
  return {
    capture: parsedStrings.capture,
    parts
  };
}
function splitSelectorByFrame(selectorText) {
  const selector = parseSelector(selectorText);
  const result2 = [];
  let chunk = {
    parts: []
  };
  let chunkStartIndex = 0;
  for (let i = 0; i < selector.parts.length; ++i) {
    const part = selector.parts[i];
    if (part.name === "internal:control" && part.body === "enter-frame") {
      if (!chunk.parts.length)
        throw new InvalidSelectorError("Selector cannot start with entering frame, select the iframe first");
      result2.push(chunk);
      chunk = { parts: [] };
      chunkStartIndex = i + 1;
      continue;
    }
    if (selector.capture === i)
      chunk.capture = i - chunkStartIndex;
    chunk.parts.push(part);
  }
  if (!chunk.parts.length)
    throw new InvalidSelectorError(`Selector cannot end with entering frame, while parsing selector ${selectorText}`);
  result2.push(chunk);
  if (typeof selector.capture === "number" && typeof result2[result2.length - 1].capture !== "number")
    throw new InvalidSelectorError(`Can not capture the selector before diving into the frame. Only use * after the last frame has been selected`);
  return result2;
}
function selectorPartsEqual(list1, list2) {
  return stringifySelector({ parts: list1 }) === stringifySelector({ parts: list2 });
}
function stringifySelector(selector, forceEngineName) {
  if (typeof selector === "string")
    return selector;
  return selector.parts.map((p, i) => {
    let includeEngine = true;
    if (!forceEngineName && i !== selector.capture) {
      if (p.name === "css")
        includeEngine = false;
      else if (p.name === "xpath" && p.source.startsWith("//") || p.source.startsWith(".."))
        includeEngine = false;
    }
    const prefix = includeEngine ? p.name + "=" : "";
    return `${i === selector.capture ? "*" : ""}${prefix}${p.source}`;
  }).join(" >> ");
}
function visitAllSelectorParts(selector, visitor) {
  const visit = (selector2, nested) => {
    for (const part of selector2.parts) {
      visitor(part, nested);
      if (kNestedSelectorNames.has(part.name))
        visit(part.body.parsed, true);
    }
  };
  visit(selector, false);
}
function parseSelectorString(selector) {
  let index = 0;
  let quote5;
  let start3 = 0;
  const result2 = { parts: [] };
  const append = () => {
    const part = selector.substring(start3, index).trim();
    const eqIndex = part.indexOf("=");
    let name;
    let body;
    if (eqIndex !== -1 && part.substring(0, eqIndex).trim().match(/^[a-zA-Z_0-9-+:*]+$/)) {
      name = part.substring(0, eqIndex).trim();
      body = part.substring(eqIndex + 1);
    } else if (part.length > 1 && part[0] === '"' && part[part.length - 1] === '"') {
      name = "text";
      body = part;
    } else if (part.length > 1 && part[0] === "'" && part[part.length - 1] === "'") {
      name = "text";
      body = part;
    } else if (/^\(*\/\//.test(part) || part.startsWith("..")) {
      name = "xpath";
      body = part;
    } else {
      name = "css";
      body = part;
    }
    let capture = false;
    if (name[0] === "*") {
      capture = true;
      name = name.substring(1);
    }
    result2.parts.push({ name, body });
    if (capture) {
      if (result2.capture !== void 0)
        throw new InvalidSelectorError(`Only one of the selectors can capture using * modifier`);
      result2.capture = result2.parts.length - 1;
    }
  };
  if (!selector.includes(">>")) {
    index = selector.length;
    append();
    return result2;
  }
  const shouldIgnoreTextSelectorQuote = () => {
    const prefix = selector.substring(start3, index);
    const match = prefix.match(/^\s*text\s*=(.*)$/);
    return !!match && !!match[1];
  };
  while (index < selector.length) {
    const c = selector[index];
    if (c === "\\" && index + 1 < selector.length) {
      index += 2;
    } else if (c === quote5) {
      quote5 = void 0;
      index++;
    } else if (!quote5 && (c === '"' || c === "'" || c === "`") && !shouldIgnoreTextSelectorQuote()) {
      quote5 = c;
      index++;
    } else if (!quote5 && c === ">" && selector[index + 1] === ">") {
      append();
      index += 2;
      start3 = index;
    } else {
      index++;
    }
  }
  append();
  return result2;
}
function parseAttributeSelector(selector, allowUnquotedStrings) {
  let wp = 0;
  let EOL = selector.length === 0;
  const next = () => selector[wp] || "";
  const eat1 = () => {
    const result3 = next();
    ++wp;
    EOL = wp >= selector.length;
    return result3;
  };
  const syntaxError = (stage) => {
    if (EOL)
      throw new InvalidSelectorError(`Unexpected end of selector while parsing selector \`${selector}\``);
    throw new InvalidSelectorError(`Error while parsing selector \`${selector}\` - unexpected symbol "${next()}" at position ${wp}` + (stage ? " during " + stage : ""));
  };
  function skipSpaces() {
    while (!EOL && /\s/.test(next()))
      eat1();
  }
  function isCSSNameChar(char) {
    return char >= "\x80" || char >= "0" && char <= "9" || char >= "A" && char <= "Z" || char >= "a" && char <= "z" || char >= "0" && char <= "9" || char === "_" || char === "-";
  }
  function readIdentifier() {
    let result3 = "";
    skipSpaces();
    while (!EOL && isCSSNameChar(next()))
      result3 += eat1();
    return result3;
  }
  function readQuotedString(quote5) {
    let result3 = eat1();
    if (result3 !== quote5)
      syntaxError("parsing quoted string");
    while (!EOL && next() !== quote5) {
      if (next() === "\\")
        eat1();
      result3 += eat1();
    }
    if (next() !== quote5)
      syntaxError("parsing quoted string");
    result3 += eat1();
    return result3;
  }
  function readRegularExpression() {
    if (eat1() !== "/")
      syntaxError("parsing regular expression");
    let source11 = "";
    let inClass = false;
    while (!EOL) {
      if (next() === "\\") {
        source11 += eat1();
        if (EOL)
          syntaxError("parsing regular expression");
      } else if (inClass && next() === "]") {
        inClass = false;
      } else if (!inClass && next() === "[") {
        inClass = true;
      } else if (!inClass && next() === "/") {
        break;
      }
      source11 += eat1();
    }
    if (eat1() !== "/")
      syntaxError("parsing regular expression");
    let flags = "";
    while (!EOL && next().match(/[dgimsuy]/))
      flags += eat1();
    try {
      return new RegExp(source11, flags);
    } catch (e) {
      throw new InvalidSelectorError(`Error while parsing selector \`${selector}\`: ${e.message}`);
    }
  }
  function readAttributeToken() {
    let token = "";
    skipSpaces();
    if (next() === `'` || next() === `"`)
      token = readQuotedString(next()).slice(1, -1);
    else
      token = readIdentifier();
    if (!token)
      syntaxError("parsing property path");
    return token;
  }
  function readOperator() {
    skipSpaces();
    let op = "";
    if (!EOL)
      op += eat1();
    if (!EOL && op !== "=")
      op += eat1();
    if (!["=", "*=", "^=", "$=", "|=", "~="].includes(op))
      syntaxError("parsing operator");
    return op;
  }
  function readAttribute() {
    eat1();
    const jsonPath = [];
    jsonPath.push(readAttributeToken());
    skipSpaces();
    while (next() === ".") {
      eat1();
      jsonPath.push(readAttributeToken());
      skipSpaces();
    }
    if (next() === "]") {
      eat1();
      return { name: jsonPath.join("."), jsonPath, op: "<truthy>", value: null, caseSensitive: false };
    }
    const operator = readOperator();
    let value2 = void 0;
    let caseSensitive = true;
    skipSpaces();
    if (next() === "/") {
      if (operator !== "=")
        throw new InvalidSelectorError(`Error while parsing selector \`${selector}\` - cannot use ${operator} in attribute with regular expression`);
      value2 = readRegularExpression();
    } else if (next() === `'` || next() === `"`) {
      value2 = readQuotedString(next()).slice(1, -1);
      skipSpaces();
      if (next() === "i" || next() === "I") {
        caseSensitive = false;
        eat1();
      } else if (next() === "s" || next() === "S") {
        caseSensitive = true;
        eat1();
      }
    } else {
      value2 = "";
      while (!EOL && (isCSSNameChar(next()) || next() === "+" || next() === "."))
        value2 += eat1();
      if (value2 === "true") {
        value2 = true;
      } else if (value2 === "false") {
        value2 = false;
      } else {
        if (!allowUnquotedStrings) {
          value2 = +value2;
          if (Number.isNaN(value2))
            syntaxError("parsing attribute value");
        }
      }
    }
    skipSpaces();
    if (next() !== "]")
      syntaxError("parsing attribute value");
    eat1();
    if (operator !== "=" && typeof value2 !== "string")
      throw new InvalidSelectorError(`Error while parsing selector \`${selector}\` - cannot use ${operator} in attribute with non-string matching value - ${value2}`);
    return { name: jsonPath.join("."), jsonPath, op: operator, value: value2, caseSensitive };
  }
  const result2 = {
    name: "",
    attributes: []
  };
  result2.name = readIdentifier();
  skipSpaces();
  while (next() === "[") {
    result2.attributes.push(readAttribute());
    skipSpaces();
  }
  if (!EOL)
    syntaxError(void 0);
  if (!result2.name && !result2.attributes.length)
    throw new InvalidSelectorError(`Error while parsing selector \`${selector}\` - selector cannot be empty`);
  return result2;
}
var kNestedSelectorNames, kNestedSelectorNamesWithDistance, customCSSNames;
var init_selectorParser = __esm({
  "packages/isomorphic/selectorParser.ts"() {
    "use strict";
    init_cssParser();
    init_cssParser();
    kNestedSelectorNames = /* @__PURE__ */ new Set(["internal:has", "internal:has-not", "internal:and", "internal:or", "internal:chain", "left-of", "right-of", "above", "below", "near"]);
    kNestedSelectorNamesWithDistance = /* @__PURE__ */ new Set(["left-of", "right-of", "above", "below", "near"]);
    customCSSNames = /* @__PURE__ */ new Set(["not", "is", "where", "has", "scope", "light", "visible", "text", "text-matches", "text-is", "has-text", "above", "below", "right-of", "left-of", "near", "nth-match"]);
  }
});

// packages/isomorphic/locatorGenerators.ts
function asLocatorDescription(lang, selector) {
  try {
    const parsed = parseSelector(selector);
    const customDescription = parseCustomDescription(parsed);
    if (customDescription)
      return customDescription;
    return innerAsLocators(new generators[lang](), parsed, false, 1)[0];
  } catch (e) {
    return selector;
  }
}
function locatorCustomDescription(selector) {
  try {
    const parsed = parseSelector(selector);
    return parseCustomDescription(parsed);
  } catch (e) {
    return void 0;
  }
}
function parseCustomDescription(parsed) {
  const lastPart = parsed.parts[parsed.parts.length - 1];
  if (lastPart?.name === "internal:describe") {
    const description = JSON.parse(lastPart.body);
    if (typeof description === "string")
      return description;
  }
  return void 0;
}
function asLocator(lang, selector, isFrameLocator = false) {
  return asLocators(lang, selector, isFrameLocator, 1)[0];
}
function asLocators(lang, selector, isFrameLocator = false, maxOutputSize = 20, preferredQuote) {
  try {
    return innerAsLocators(new generators[lang](preferredQuote), parseSelector(selector), isFrameLocator, maxOutputSize);
  } catch (e) {
    return [selector];
  }
}
function innerAsLocators(factory, parsed, isFrameLocator = false, maxOutputSize = 20) {
  const parts = [...parsed.parts];
  const tokens = [];
  let nextBase = isFrameLocator ? "frame-locator" : "page";
  for (let index = 0; index < parts.length; index++) {
    const part = parts[index];
    const base = nextBase;
    nextBase = "locator";
    if (part.name === "internal:describe")
      continue;
    if (part.name === "nth") {
      if (part.body === "0")
        tokens.push([factory.generateLocator(base, "first", ""), factory.generateLocator(base, "nth", "0")]);
      else if (part.body === "-1")
        tokens.push([factory.generateLocator(base, "last", ""), factory.generateLocator(base, "nth", "-1")]);
      else
        tokens.push([factory.generateLocator(base, "nth", part.body)]);
      continue;
    }
    if (part.name === "visible") {
      tokens.push([factory.generateLocator(base, "visible", part.body), factory.generateLocator(base, "default", `visible=${part.body}`)]);
      continue;
    }
    if (part.name === "internal:text") {
      const { exact, text: text2 } = detectExact(part.body);
      tokens.push([factory.generateLocator(base, "text", text2, { exact })]);
      continue;
    }
    if (part.name === "internal:has-text") {
      const { exact, text: text2 } = detectExact(part.body);
      if (!exact) {
        tokens.push([factory.generateLocator(base, "has-text", text2, { exact })]);
        continue;
      }
    }
    if (part.name === "internal:has-not-text") {
      const { exact, text: text2 } = detectExact(part.body);
      if (!exact) {
        tokens.push([factory.generateLocator(base, "has-not-text", text2, { exact })]);
        continue;
      }
    }
    if (part.name === "internal:has") {
      const inners = innerAsLocators(factory, part.body.parsed, false, maxOutputSize);
      tokens.push(inners.map((inner) => factory.generateLocator(base, "has", inner)));
      continue;
    }
    if (part.name === "internal:has-not") {
      const inners = innerAsLocators(factory, part.body.parsed, false, maxOutputSize);
      tokens.push(inners.map((inner) => factory.generateLocator(base, "hasNot", inner)));
      continue;
    }
    if (part.name === "internal:and") {
      const inners = innerAsLocators(factory, part.body.parsed, false, maxOutputSize);
      tokens.push(inners.map((inner) => factory.generateLocator(base, "and", inner)));
      continue;
    }
    if (part.name === "internal:or") {
      const inners = innerAsLocators(factory, part.body.parsed, false, maxOutputSize);
      tokens.push(inners.map((inner) => factory.generateLocator(base, "or", inner)));
      continue;
    }
    if (part.name === "internal:chain") {
      const inners = innerAsLocators(factory, part.body.parsed, false, maxOutputSize);
      tokens.push(inners.map((inner) => factory.generateLocator(base, "chain", inner)));
      continue;
    }
    if (part.name === "internal:label") {
      const { exact, text: text2 } = detectExact(part.body);
      tokens.push([factory.generateLocator(base, "label", text2, { exact })]);
      continue;
    }
    if (part.name === "internal:role") {
      const attrSelector = parseAttributeSelector(part.body, true);
      const options = { attrs: [] };
      for (const attr of attrSelector.attributes) {
        if (attr.name === "name") {
          if (options.exact !== void 0 && options.exact !== attr.caseSensitive)
            throw new Error(`Conflicting exactness in internal:role selector: ${stringifySelector({ parts: [part] })}`);
          options.exact = attr.caseSensitive;
          options.name = attr.value;
        } else if (attr.name === "description") {
          if (options.exact !== void 0 && options.exact !== attr.caseSensitive)
            throw new Error(`Conflicting exactness in internal:role selector: ${stringifySelector({ parts: [part] })}`);
          options.exact = attr.caseSensitive;
          options.description = attr.value;
        } else {
          if (attr.name === "level" && typeof attr.value === "string")
            attr.value = +attr.value;
          options.attrs.push({ name: attr.name === "include-hidden" ? "includeHidden" : attr.name, value: attr.value });
        }
      }
      tokens.push([factory.generateLocator(base, "role", attrSelector.name, options)]);
      continue;
    }
    if (part.name === "internal:testid") {
      const attrSelector = parseAttributeSelector(part.body, true);
      const { value: value2 } = attrSelector.attributes[0];
      tokens.push([factory.generateLocator(base, "test-id", value2)]);
      continue;
    }
    if (part.name === "internal:attr") {
      const attrSelector = parseAttributeSelector(part.body, true);
      const { name, value: value2, caseSensitive } = attrSelector.attributes[0];
      const text2 = value2;
      const exact = !!caseSensitive;
      if (name === "placeholder") {
        tokens.push([factory.generateLocator(base, "placeholder", text2, { exact })]);
        continue;
      }
      if (name === "alt") {
        tokens.push([factory.generateLocator(base, "alt", text2, { exact })]);
        continue;
      }
      if (name === "title") {
        tokens.push([factory.generateLocator(base, "title", text2, { exact })]);
        continue;
      }
    }
    if (part.name === "internal:control" && part.body === "enter-frame") {
      const lastTokens = tokens[tokens.length - 1];
      const lastPart = parts[index - 1];
      const transformed = lastTokens.map((token) => factory.chainLocators([token, factory.generateLocator(base, "frame", "")]));
      if (["xpath", "css"].includes(lastPart.name)) {
        transformed.push(
          factory.generateLocator(base, "frame-locator", stringifySelector({ parts: [lastPart] })),
          factory.generateLocator(base, "frame-locator", stringifySelector({ parts: [lastPart] }, true))
        );
      }
      lastTokens.splice(0, lastTokens.length, ...transformed);
      nextBase = "frame-locator";
      continue;
    }
    const nextPart = parts[index + 1];
    const selectorPart = stringifySelector({ parts: [part] });
    const locatorPart = factory.generateLocator(base, "default", selectorPart);
    if (nextPart && ["internal:has-text", "internal:has-not-text"].includes(nextPart.name)) {
      const { exact, text: text2 } = detectExact(nextPart.body);
      if (!exact) {
        const nextLocatorPart = factory.generateLocator("locator", nextPart.name === "internal:has-text" ? "has-text" : "has-not-text", text2, { exact });
        const options = {};
        if (nextPart.name === "internal:has-text")
          options.hasText = text2;
        else
          options.hasNotText = text2;
        const combinedPart = factory.generateLocator(base, "default", selectorPart, options);
        tokens.push([factory.chainLocators([locatorPart, nextLocatorPart]), combinedPart]);
        index++;
        continue;
      }
    }
    let locatorPartWithEngine;
    if (["xpath", "css"].includes(part.name)) {
      const selectorPart2 = stringifySelector(
        { parts: [part] },
        /* forceEngineName */
        true
      );
      locatorPartWithEngine = factory.generateLocator(base, "default", selectorPart2);
    }
    tokens.push([locatorPart, locatorPartWithEngine].filter(Boolean));
  }
  return combineTokens(factory, tokens, maxOutputSize);
}
function combineTokens(factory, tokens, maxOutputSize) {
  const currentTokens = tokens.map(() => "");
  const result2 = [];
  const visit = (index) => {
    if (index === tokens.length) {
      result2.push(factory.chainLocators(currentTokens));
      return result2.length < maxOutputSize;
    }
    for (const taken of tokens[index]) {
      currentTokens[index] = taken;
      if (!visit(index + 1))
        return false;
    }
    return true;
  };
  visit(0);
  return result2;
}
function detectExact(text2) {
  let exact = false;
  const match = text2.match(/^\/(.*)\/([igm]*)$/);
  if (match)
    return { text: new RegExp(match[1], match[2]) };
  if (text2.endsWith('"')) {
    text2 = JSON.parse(text2);
    exact = true;
  } else if (text2.endsWith('"s')) {
    text2 = JSON.parse(text2.substring(0, text2.length - 1));
    exact = true;
  } else if (text2.endsWith('"i')) {
    text2 = JSON.parse(text2.substring(0, text2.length - 1));
    exact = false;
  }
  return { exact, text: text2 };
}
function isRegExp2(obj) {
  return obj instanceof RegExp;
}
var JavaScriptLocatorFactory, PythonLocatorFactory, JavaLocatorFactory, CSharpLocatorFactory, JsonlLocatorFactory, generators;
var init_locatorGenerators = __esm({
  "packages/isomorphic/locatorGenerators.ts"() {
    "use strict";
    init_selectorParser();
    init_stringUtils();
    JavaScriptLocatorFactory = class {
      constructor(preferredQuote) {
        this.preferredQuote = preferredQuote;
      }
      generateLocator(base, kind, body, options = {}) {
        switch (kind) {
          case "default":
            if (options.hasText !== void 0)
              return `locator(${this.quote(body)}, { hasText: ${this.toHasText(options.hasText)} })`;
            if (options.hasNotText !== void 0)
              return `locator(${this.quote(body)}, { hasNotText: ${this.toHasText(options.hasNotText)} })`;
            return `locator(${this.quote(body)})`;
          case "frame-locator":
            return `frameLocator(${this.quote(body)})`;
          case "frame":
            return `contentFrame()`;
          case "nth":
            return `nth(${body})`;
          case "first":
            return `first()`;
          case "last":
            return `last()`;
          case "visible":
            return `filter({ visible: ${body === "true" ? "true" : "false"} })`;
          case "role":
            const attrs = [];
            if (isRegExp2(options.name))
              attrs.push(`name: ${this.regexToSourceString(options.name)}`);
            else if (typeof options.name === "string")
              attrs.push(`name: ${this.quote(options.name)}`);
            if (isRegExp2(options.description))
              attrs.push(`description: ${this.regexToSourceString(options.description)}`);
            else if (typeof options.description === "string")
              attrs.push(`description: ${this.quote(options.description)}`);
            if (options.exact && (typeof options.name === "string" || typeof options.description === "string"))
              attrs.push(`exact: true`);
            for (const { name, value: value2 } of options.attrs)
              attrs.push(`${name}: ${typeof value2 === "string" ? this.quote(value2) : value2}`);
            const attrString = attrs.length ? `, { ${attrs.join(", ")} }` : "";
            return `getByRole(${this.quote(body)}${attrString})`;
          case "has-text":
            return `filter({ hasText: ${this.toHasText(body)} })`;
          case "has-not-text":
            return `filter({ hasNotText: ${this.toHasText(body)} })`;
          case "has":
            return `filter({ has: ${body} })`;
          case "hasNot":
            return `filter({ hasNot: ${body} })`;
          case "and":
            return `and(${body})`;
          case "or":
            return `or(${body})`;
          case "chain":
            return `locator(${body})`;
          case "test-id":
            return `getByTestId(${this.toTestIdValue(body)})`;
          case "text":
            return this.toCallWithExact("getByText", body, !!options.exact);
          case "alt":
            return this.toCallWithExact("getByAltText", body, !!options.exact);
          case "placeholder":
            return this.toCallWithExact("getByPlaceholder", body, !!options.exact);
          case "label":
            return this.toCallWithExact("getByLabel", body, !!options.exact);
          case "title":
            return this.toCallWithExact("getByTitle", body, !!options.exact);
          default:
            throw new Error("Unknown selector kind " + kind);
        }
      }
      chainLocators(locators) {
        return locators.join(".");
      }
      regexToSourceString(re2) {
        return normalizeEscapedRegexQuotes(String(re2));
      }
      toCallWithExact(method, body, exact) {
        if (isRegExp2(body))
          return `${method}(${this.regexToSourceString(body)})`;
        return exact ? `${method}(${this.quote(body)}, { exact: true })` : `${method}(${this.quote(body)})`;
      }
      toHasText(body) {
        if (isRegExp2(body))
          return this.regexToSourceString(body);
        return this.quote(body);
      }
      toTestIdValue(value2) {
        if (isRegExp2(value2))
          return this.regexToSourceString(value2);
        return this.quote(value2);
      }
      quote(text2) {
        return escapeWithQuotes(text2, this.preferredQuote ?? "'");
      }
    };
    PythonLocatorFactory = class {
      generateLocator(base, kind, body, options = {}) {
        switch (kind) {
          case "default":
            if (options.hasText !== void 0)
              return `locator(${this.quote(body)}, has_text=${this.toHasText(options.hasText)})`;
            if (options.hasNotText !== void 0)
              return `locator(${this.quote(body)}, has_not_text=${this.toHasText(options.hasNotText)})`;
            return `locator(${this.quote(body)})`;
          case "frame-locator":
            return `frame_locator(${this.quote(body)})`;
          case "frame":
            return `content_frame`;
          case "nth":
            return `nth(${body})`;
          case "first":
            return `first`;
          case "last":
            return `last`;
          case "visible":
            return `filter(visible=${body === "true" ? "True" : "False"})`;
          case "role":
            const attrs = [];
            if (isRegExp2(options.name))
              attrs.push(`name=${this.regexToString(options.name)}`);
            else if (typeof options.name === "string")
              attrs.push(`name=${this.quote(options.name)}`);
            if (isRegExp2(options.description))
              attrs.push(`description=${this.regexToString(options.description)}`);
            else if (typeof options.description === "string")
              attrs.push(`description=${this.quote(options.description)}`);
            if (options.exact && (typeof options.name === "string" || typeof options.description === "string"))
              attrs.push(`exact=True`);
            for (const { name, value: value2 } of options.attrs) {
              let valueString = typeof value2 === "string" ? this.quote(value2) : value2;
              if (typeof value2 === "boolean")
                valueString = value2 ? "True" : "False";
              attrs.push(`${toSnakeCase(name)}=${valueString}`);
            }
            const attrString = attrs.length ? `, ${attrs.join(", ")}` : "";
            return `get_by_role(${this.quote(body)}${attrString})`;
          case "has-text":
            return `filter(has_text=${this.toHasText(body)})`;
          case "has-not-text":
            return `filter(has_not_text=${this.toHasText(body)})`;
          case "has":
            return `filter(has=${body})`;
          case "hasNot":
            return `filter(has_not=${body})`;
          case "and":
            return `and_(${body})`;
          case "or":
            return `or_(${body})`;
          case "chain":
            return `locator(${body})`;
          case "test-id":
            return `get_by_test_id(${this.toTestIdValue(body)})`;
          case "text":
            return this.toCallWithExact("get_by_text", body, !!options.exact);
          case "alt":
            return this.toCallWithExact("get_by_alt_text", body, !!options.exact);
          case "placeholder":
            return this.toCallWithExact("get_by_placeholder", body, !!options.exact);
          case "label":
            return this.toCallWithExact("get_by_label", body, !!options.exact);
          case "title":
            return this.toCallWithExact("get_by_title", body, !!options.exact);
          default:
            throw new Error("Unknown selector kind " + kind);
        }
      }
      chainLocators(locators) {
        return locators.join(".");
      }
      regexToString(body) {
        const suffix = body.flags.includes("i") ? ", re.IGNORECASE" : "";
        return `re.compile(r"${normalizeEscapedRegexQuotes(body.source).replace(/\\\//, "/").replace(/"/g, '\\"')}"${suffix})`;
      }
      toCallWithExact(method, body, exact) {
        if (isRegExp2(body))
          return `${method}(${this.regexToString(body)})`;
        if (exact)
          return `${method}(${this.quote(body)}, exact=True)`;
        return `${method}(${this.quote(body)})`;
      }
      toHasText(body) {
        if (isRegExp2(body))
          return this.regexToString(body);
        return `${this.quote(body)}`;
      }
      toTestIdValue(value2) {
        if (isRegExp2(value2))
          return this.regexToString(value2);
        return this.quote(value2);
      }
      quote(text2) {
        return escapeWithQuotes(text2, '"');
      }
    };
    JavaLocatorFactory = class {
      generateLocator(base, kind, body, options = {}) {
        let clazz;
        switch (base) {
          case "page":
            clazz = "Page";
            break;
          case "frame-locator":
            clazz = "FrameLocator";
            break;
          case "locator":
            clazz = "Locator";
            break;
        }
        switch (kind) {
          case "default":
            if (options.hasText !== void 0)
              return `locator(${this.quote(body)}, new ${clazz}.LocatorOptions().setHasText(${this.toHasText(options.hasText)}))`;
            if (options.hasNotText !== void 0)
              return `locator(${this.quote(body)}, new ${clazz}.LocatorOptions().setHasNotText(${this.toHasText(options.hasNotText)}))`;
            return `locator(${this.quote(body)})`;
          case "frame-locator":
            return `frameLocator(${this.quote(body)})`;
          case "frame":
            return `contentFrame()`;
          case "nth":
            return `nth(${body})`;
          case "first":
            return `first()`;
          case "last":
            return `last()`;
          case "visible":
            return `filter(new ${clazz}.FilterOptions().setVisible(${body === "true" ? "true" : "false"}))`;
          case "role":
            const attrs = [];
            if (isRegExp2(options.name))
              attrs.push(`.setName(${this.regexToString(options.name)})`);
            else if (typeof options.name === "string")
              attrs.push(`.setName(${this.quote(options.name)})`);
            if (isRegExp2(options.description))
              attrs.push(`.setDescription(${this.regexToString(options.description)})`);
            else if (typeof options.description === "string")
              attrs.push(`.setDescription(${this.quote(options.description)})`);
            if (options.exact && (typeof options.name === "string" || typeof options.description === "string"))
              attrs.push(`.setExact(true)`);
            for (const { name, value: value2 } of options.attrs)
              attrs.push(`.set${toTitleCase(name)}(${typeof value2 === "string" ? this.quote(value2) : value2})`);
            const attrString = attrs.length ? `, new ${clazz}.GetByRoleOptions()${attrs.join("")}` : "";
            return `getByRole(AriaRole.${toSnakeCase(body).toUpperCase()}${attrString})`;
          case "has-text":
            return `filter(new ${clazz}.FilterOptions().setHasText(${this.toHasText(body)}))`;
          case "has-not-text":
            return `filter(new ${clazz}.FilterOptions().setHasNotText(${this.toHasText(body)}))`;
          case "has":
            return `filter(new ${clazz}.FilterOptions().setHas(${body}))`;
          case "hasNot":
            return `filter(new ${clazz}.FilterOptions().setHasNot(${body}))`;
          case "and":
            return `and(${body})`;
          case "or":
            return `or(${body})`;
          case "chain":
            return `locator(${body})`;
          case "test-id":
            return `getByTestId(${this.toTestIdValue(body)})`;
          case "text":
            return this.toCallWithExact(clazz, "getByText", body, !!options.exact);
          case "alt":
            return this.toCallWithExact(clazz, "getByAltText", body, !!options.exact);
          case "placeholder":
            return this.toCallWithExact(clazz, "getByPlaceholder", body, !!options.exact);
          case "label":
            return this.toCallWithExact(clazz, "getByLabel", body, !!options.exact);
          case "title":
            return this.toCallWithExact(clazz, "getByTitle", body, !!options.exact);
          default:
            throw new Error("Unknown selector kind " + kind);
        }
      }
      chainLocators(locators) {
        return locators.join(".");
      }
      regexToString(body) {
        const suffix = body.flags.includes("i") ? ", Pattern.CASE_INSENSITIVE" : "";
        return `Pattern.compile(${this.quote(normalizeEscapedRegexQuotes(body.source))}${suffix})`;
      }
      toCallWithExact(clazz, method, body, exact) {
        if (isRegExp2(body))
          return `${method}(${this.regexToString(body)})`;
        if (exact)
          return `${method}(${this.quote(body)}, new ${clazz}.${toTitleCase(method)}Options().setExact(true))`;
        return `${method}(${this.quote(body)})`;
      }
      toHasText(body) {
        if (isRegExp2(body))
          return this.regexToString(body);
        return this.quote(body);
      }
      toTestIdValue(value2) {
        if (isRegExp2(value2))
          return this.regexToString(value2);
        return this.quote(value2);
      }
      quote(text2) {
        return escapeWithQuotes(text2, '"');
      }
    };
    CSharpLocatorFactory = class {
      generateLocator(base, kind, body, options = {}) {
        switch (kind) {
          case "default":
            if (options.hasText !== void 0)
              return `Locator(${this.quote(body)}, new() { ${this.toHasText(options.hasText)} })`;
            if (options.hasNotText !== void 0)
              return `Locator(${this.quote(body)}, new() { ${this.toHasNotText(options.hasNotText)} })`;
            return `Locator(${this.quote(body)})`;
          case "frame-locator":
            return `FrameLocator(${this.quote(body)})`;
          case "frame":
            return `ContentFrame`;
          case "nth":
            return `Nth(${body})`;
          case "first":
            return `First`;
          case "last":
            return `Last`;
          case "visible":
            return `Filter(new() { Visible = ${body === "true" ? "true" : "false"} })`;
          case "role":
            const attrs = [];
            if (isRegExp2(options.name))
              attrs.push(`NameRegex = ${this.regexToString(options.name)}`);
            else if (typeof options.name === "string")
              attrs.push(`Name = ${this.quote(options.name)}`);
            if (isRegExp2(options.description))
              attrs.push(`DescriptionRegex = ${this.regexToString(options.description)}`);
            else if (typeof options.description === "string")
              attrs.push(`Description = ${this.quote(options.description)}`);
            if (options.exact && (typeof options.name === "string" || typeof options.description === "string"))
              attrs.push(`Exact = true`);
            for (const { name, value: value2 } of options.attrs)
              attrs.push(`${toTitleCase(name)} = ${typeof value2 === "string" ? this.quote(value2) : value2}`);
            const attrString = attrs.length ? `, new() { ${attrs.join(", ")} }` : "";
            return `GetByRole(AriaRole.${toTitleCase(body)}${attrString})`;
          case "has-text":
            return `Filter(new() { ${this.toHasText(body)} })`;
          case "has-not-text":
            return `Filter(new() { ${this.toHasNotText(body)} })`;
          case "has":
            return `Filter(new() { Has = ${body} })`;
          case "hasNot":
            return `Filter(new() { HasNot = ${body} })`;
          case "and":
            return `And(${body})`;
          case "or":
            return `Or(${body})`;
          case "chain":
            return `Locator(${body})`;
          case "test-id":
            return `GetByTestId(${this.toTestIdValue(body)})`;
          case "text":
            return this.toCallWithExact("GetByText", body, !!options.exact);
          case "alt":
            return this.toCallWithExact("GetByAltText", body, !!options.exact);
          case "placeholder":
            return this.toCallWithExact("GetByPlaceholder", body, !!options.exact);
          case "label":
            return this.toCallWithExact("GetByLabel", body, !!options.exact);
          case "title":
            return this.toCallWithExact("GetByTitle", body, !!options.exact);
          default:
            throw new Error("Unknown selector kind " + kind);
        }
      }
      chainLocators(locators) {
        return locators.join(".");
      }
      regexToString(body) {
        const suffix = body.flags.includes("i") ? ", RegexOptions.IgnoreCase" : "";
        return `new Regex(${this.quote(normalizeEscapedRegexQuotes(body.source))}${suffix})`;
      }
      toCallWithExact(method, body, exact) {
        if (isRegExp2(body))
          return `${method}(${this.regexToString(body)})`;
        if (exact)
          return `${method}(${this.quote(body)}, new() { Exact = true })`;
        return `${method}(${this.quote(body)})`;
      }
      toHasText(body) {
        if (isRegExp2(body))
          return `HasTextRegex = ${this.regexToString(body)}`;
        return `HasText = ${this.quote(body)}`;
      }
      toTestIdValue(value2) {
        if (isRegExp2(value2))
          return this.regexToString(value2);
        return this.quote(value2);
      }
      toHasNotText(body) {
        if (isRegExp2(body))
          return `HasNotTextRegex = ${this.regexToString(body)}`;
        return `HasNotText = ${this.quote(body)}`;
      }
      quote(text2) {
        return escapeWithQuotes(text2, '"');
      }
    };
    JsonlLocatorFactory = class {
      generateLocator(base, kind, body, options = {}) {
        return JSON.stringify({
          kind,
          body,
          options
        });
      }
      chainLocators(locators) {
        const objects = locators.map((l) => JSON.parse(l));
        for (let i = 0; i < objects.length - 1; ++i)
          objects[i].next = objects[i + 1];
        return JSON.stringify(objects[0]);
      }
    };
    generators = {
      javascript: JavaScriptLocatorFactory,
      python: PythonLocatorFactory,
      java: JavaLocatorFactory,
      csharp: CSharpLocatorFactory,
      jsonl: JsonlLocatorFactory
    };
  }
});

// packages/isomorphic/stackTrace.ts
function captureRawStack() {
  const stackTraceLimit = Error.stackTraceLimit;
  Error.stackTraceLimit = 50;
  const error = new Error();
  const stack = error.stack || "";
  Error.stackTraceLimit = stackTraceLimit;
  return stack.split("\n");
}
function parseStackFrame(text2, pathSeparator, showInternalStackFrames) {
  const match = text2 && text2.match(re);
  if (!match)
    return null;
  let fname = match[2];
  let file = match[7];
  if (!file)
    return null;
  if (!showInternalStackFrames && (file.startsWith("internal") || file.startsWith("node:")))
    return null;
  const line = match[8];
  const column = match[9];
  const closeParen = match[11] === ")";
  const frame = {
    file: "",
    line: 0,
    column: 0
  };
  if (line)
    frame.line = Number(line);
  if (column)
    frame.column = Number(column);
  if (closeParen && file) {
    let closes = 0;
    for (let i = file.length - 1; i > 0; i--) {
      if (file.charAt(i) === ")") {
        closes++;
      } else if (file.charAt(i) === "(" && file.charAt(i - 1) === " ") {
        closes--;
        if (closes === -1 && file.charAt(i - 1) === " ") {
          const before = file.slice(0, i - 1);
          const after = file.slice(i + 1);
          file = after;
          fname += ` (${before}`;
          break;
        }
      }
    }
  }
  if (fname) {
    const methodMatch = fname.match(methodRe);
    if (methodMatch)
      fname = methodMatch[1];
  }
  if (file) {
    if (file.startsWith("file://"))
      file = fileURLToPath(file, pathSeparator);
    frame.file = file;
  }
  if (fname)
    frame.function = fname;
  return frame;
}
function rewriteErrorMessage(e, newMessage) {
  const lines = (e.stack?.split("\n") || []).filter((l) => l.startsWith("    at "));
  e.message = newMessage;
  const errorTitle = `${e.name}: ${e.message}`;
  if (lines.length)
    e.stack = `${errorTitle}
${lines.join("\n")}`;
  return e;
}
function stringifyStackFrames(frames) {
  const stackLines = [];
  for (const frame of frames) {
    if (frame.function)
      stackLines.push(`    at ${frame.function} (${frame.file}:${frame.line}:${frame.column})`);
    else
      stackLines.push(`    at ${frame.file}:${frame.line}:${frame.column}`);
  }
  return stackLines;
}
function splitErrorMessage(message) {
  const separationIdx = message.indexOf(":");
  return {
    name: separationIdx !== -1 ? message.slice(0, separationIdx) : "",
    message: separationIdx !== -1 && separationIdx + 2 <= message.length ? message.substring(separationIdx + 2) : message
  };
}
function parseErrorStack(stack, pathSeparator, showInternalStackFrames = false) {
  const lines = stack.split("\n");
  let firstStackLine = lines.findIndex((line) => line.startsWith("    at "));
  if (firstStackLine === -1)
    firstStackLine = lines.length;
  const message = lines.slice(0, firstStackLine).join("\n");
  const stackLines = lines.slice(firstStackLine);
  let location2;
  for (const line of stackLines) {
    const frame = parseStackFrame(line, pathSeparator, showInternalStackFrames);
    if (!frame || !frame.file)
      continue;
    if (belongsToNodeModules(frame.file, pathSeparator))
      continue;
    location2 = { file: frame.file, column: frame.column || 0, line: frame.line || 0 };
    break;
  }
  return { message, stackLines, location: location2 };
}
function belongsToNodeModules(file, pathSeparator) {
  return file.includes(`${pathSeparator}node_modules${pathSeparator}`);
}
function fileURLToPath(fileUrl, pathSeparator) {
  if (!fileUrl.startsWith("file://"))
    return fileUrl;
  let path59 = decodeURIComponent(fileUrl.slice(7));
  if (path59.startsWith("/") && /^[a-zA-Z]:/.test(path59.slice(1)))
    path59 = path59.slice(1);
  return path59.replace(/\//g, pathSeparator);
}
var re, methodRe;
var init_stackTrace = __esm({
  "packages/isomorphic/stackTrace.ts"() {
    "use strict";
    re = new RegExp(
      "^(?:\\s*at )?(?:(new) )?(?:(.*?) \\()?(?:eval at ([^ ]+) \\((.+?):(\\d+):(\\d+)\\), )?(?:(.+?):(\\d+):(\\d+)|(native))(\\)?)$"
    );
    methodRe = /^(.*?) \[as (.*?)\]$/;
  }
});

// packages/isomorphic/manualPromise.ts
function signalToPromise(signal) {
  if (signal.aborted)
    return { promise: Promise.resolve(), dispose: () => {
    } };
  let dispose;
  const promise = new Promise((resolve) => {
    const onAbort = () => resolve();
    signal.addEventListener("abort", onAbort, { once: true });
    dispose = () => signal.removeEventListener("abort", onAbort);
  });
  return { promise, dispose };
}
function cloneError(error, frames) {
  const clone = new Error();
  clone.name = error.name;
  clone.message = error.message;
  clone.stack = [error.name + ":" + error.message, ...frames].join("\n");
  return clone;
}
var ManualPromise, LongStandingScope;
var init_manualPromise = __esm({
  "packages/isomorphic/manualPromise.ts"() {
    "use strict";
    init_stackTrace();
    ManualPromise = class extends Promise {
      constructor() {
        let resolve;
        let reject;
        super((f, r) => {
          resolve = f;
          reject = r;
        });
        this._isDone = false;
        this._resolve = resolve;
        this._reject = reject;
      }
      isDone() {
        return this._isDone;
      }
      resolve(t) {
        this._isDone = true;
        this._resolve(t);
      }
      reject(e) {
        this._isDone = true;
        this._reject(e);
      }
      static get [Symbol.species]() {
        return Promise;
      }
      get [Symbol.toStringTag]() {
        return "ManualPromise";
      }
    };
    LongStandingScope = class {
      constructor() {
        this._terminatePromises = /* @__PURE__ */ new Map();
        this._isClosed = false;
      }
      reject(error) {
        this._isClosed = true;
        this._terminateError = error;
        for (const p of this._terminatePromises.keys())
          p.resolve(error);
      }
      close(error) {
        this._isClosed = true;
        this._closeError = error;
        for (const [p, frames] of this._terminatePromises)
          p.resolve(cloneError(error, frames));
      }
      isClosed() {
        return this._isClosed;
      }
      static async raceMultiple(scopes, promise) {
        return Promise.race(scopes.map((s) => s.race(promise)));
      }
      async race(promise) {
        return this._race(Array.isArray(promise) ? promise : [promise], false);
      }
      async safeRace(promise, defaultValue) {
        return this._race([promise], true, defaultValue);
      }
      async _race(promises, safe, defaultValue) {
        const terminatePromise = new ManualPromise();
        const frames = captureRawStack();
        if (this._terminateError)
          terminatePromise.resolve(this._terminateError);
        if (this._closeError)
          terminatePromise.resolve(cloneError(this._closeError, frames));
        this._terminatePromises.set(terminatePromise, frames);
        try {
          return await Promise.race([
            terminatePromise.then((e) => safe ? defaultValue : Promise.reject(e)),
            ...promises
          ]);
        } finally {
          this._terminatePromises.delete(terminatePromise);
        }
      }
    };
  }
});

// packages/isomorphic/mimeType.ts
function isJsonMimeType(mimeType) {
  return !!mimeType.match(/^(application\/json|application\/.*?\+json|text\/(x-)?json)(;\s*charset=.*)?$/);
}
function isXmlMimeType(mimeType) {
  return !!mimeType.match(/^(application\/xml|application\/.*?\+xml|text\/xml)(;\s*charset=.*)?$/);
}
function isTextualMimeType(mimeType) {
  return !!mimeType.match(/^(text\/.*?|application\/(json|(x-)?javascript|xml.*?|ecmascript|graphql|x-www-form-urlencoded)|image\/svg(\+xml)?|application\/.*?(\+json|\+xml))(;\s*charset=.*)?$/);
}
function getMimeTypeForPath(path59) {
  const dotIndex = path59.lastIndexOf(".");
  if (dotIndex === -1)
    return null;
  const extension = path59.substring(dotIndex + 1);
  return types.get(extension) || null;
}
function getExtensionForMimeType(contentType) {
  const subtype = (contentType ?? "").split(";")[0].split("/")[1]?.trim().toLowerCase() ?? "";
  if (!subtype)
    return "bin";
  const tail = subtype.includes("+") ? subtype.split("+").pop() : subtype;
  if (tail === "plain")
    return "txt";
  if (tail === "javascript" || tail === "ecmascript")
    return "js";
  if (tail === "jpeg")
    return "jpg";
  return tail.replace(/[^a-z0-9]/g, "") || "bin";
}
var types;
var init_mimeType = __esm({
  "packages/isomorphic/mimeType.ts"() {
    "use strict";
    types = /* @__PURE__ */ new Map([
      ["ez", "application/andrew-inset"],
      ["aw", "application/applixware"],
      ["atom", "application/atom+xml"],
      ["atomcat", "application/atomcat+xml"],
      ["atomdeleted", "application/atomdeleted+xml"],
      ["atomsvc", "application/atomsvc+xml"],
      ["dwd", "application/atsc-dwd+xml"],
      ["held", "application/atsc-held+xml"],
      ["rsat", "application/atsc-rsat+xml"],
      ["bdoc", "application/bdoc"],
      ["xcs", "application/calendar+xml"],
      ["ccxml", "application/ccxml+xml"],
      ["cdfx", "application/cdfx+xml"],
      ["cdmia", "application/cdmi-capability"],
      ["cdmic", "application/cdmi-container"],
      ["cdmid", "application/cdmi-domain"],
      ["cdmio", "application/cdmi-object"],
      ["cdmiq", "application/cdmi-queue"],
      ["cu", "application/cu-seeme"],
      ["mpd", "application/dash+xml"],
      ["davmount", "application/davmount+xml"],
      ["dbk", "application/docbook+xml"],
      ["dssc", "application/dssc+der"],
      ["xdssc", "application/dssc+xml"],
      ["ecma", "application/ecmascript"],
      ["es", "application/ecmascript"],
      ["emma", "application/emma+xml"],
      ["emotionml", "application/emotionml+xml"],
      ["epub", "application/epub+zip"],
      ["exi", "application/exi"],
      ["exp", "application/express"],
      ["fdt", "application/fdt+xml"],
      ["pfr", "application/font-tdpfr"],
      ["geojson", "application/geo+json"],
      ["gml", "application/gml+xml"],
      ["gpx", "application/gpx+xml"],
      ["gxf", "application/gxf"],
      ["gz", "application/gzip"],
      ["hjson", "application/hjson"],
      ["stk", "application/hyperstudio"],
      ["ink", "application/inkml+xml"],
      ["inkml", "application/inkml+xml"],
      ["ipfix", "application/ipfix"],
      ["its", "application/its+xml"],
      ["ear", "application/java-archive"],
      ["jar", "application/java-archive"],
      ["war", "application/java-archive"],
      ["ser", "application/java-serialized-object"],
      ["class", "application/java-vm"],
      ["js", "application/javascript"],
      ["mjs", "application/javascript"],
      ["json", "application/json"],
      ["map", "application/json"],
      ["json5", "application/json5"],
      ["jsonml", "application/jsonml+json"],
      ["jsonld", "application/ld+json"],
      ["lgr", "application/lgr+xml"],
      ["lostxml", "application/lost+xml"],
      ["hqx", "application/mac-binhex40"],
      ["cpt", "application/mac-compactpro"],
      ["mads", "application/mads+xml"],
      ["webmanifest", "application/manifest+json"],
      ["mrc", "application/marc"],
      ["mrcx", "application/marcxml+xml"],
      ["ma", "application/mathematica"],
      ["mb", "application/mathematica"],
      ["nb", "application/mathematica"],
      ["mathml", "application/mathml+xml"],
      ["mbox", "application/mbox"],
      ["mscml", "application/mediaservercontrol+xml"],
      ["metalink", "application/metalink+xml"],
      ["meta4", "application/metalink4+xml"],
      ["mets", "application/mets+xml"],
      ["maei", "application/mmt-aei+xml"],
      ["musd", "application/mmt-usd+xml"],
      ["mods", "application/mods+xml"],
      ["m21", "application/mp21"],
      ["mp21", "application/mp21"],
      ["m4p", "application/mp4"],
      ["mp4s", "application/mp4"],
      ["doc", "application/msword"],
      ["dot", "application/msword"],
      ["mxf", "application/mxf"],
      ["nq", "application/n-quads"],
      ["nt", "application/n-triples"],
      ["cjs", "application/node"],
      ["bin", "application/octet-stream"],
      ["bpk", "application/octet-stream"],
      ["buffer", "application/octet-stream"],
      ["deb", "application/octet-stream"],
      ["deploy", "application/octet-stream"],
      ["dist", "application/octet-stream"],
      ["distz", "application/octet-stream"],
      ["dll", "application/octet-stream"],
      ["dmg", "application/octet-stream"],
      ["dms", "application/octet-stream"],
      ["dump", "application/octet-stream"],
      ["elc", "application/octet-stream"],
      ["exe", "application/octet-stream"],
      ["img", "application/octet-stream"],
      ["iso", "application/octet-stream"],
      ["lrf", "application/octet-stream"],
      ["mar", "application/octet-stream"],
      ["msi", "application/octet-stream"],
      ["msm", "application/octet-stream"],
      ["msp", "application/octet-stream"],
      ["pkg", "application/octet-stream"],
      ["so", "application/octet-stream"],
      ["oda", "application/oda"],
      ["opf", "application/oebps-package+xml"],
      ["ogx", "application/ogg"],
      ["omdoc", "application/omdoc+xml"],
      ["onepkg", "application/onenote"],
      ["onetmp", "application/onenote"],
      ["onetoc", "application/onenote"],
      ["onetoc2", "application/onenote"],
      ["oxps", "application/oxps"],
      ["relo", "application/p2p-overlay+xml"],
      ["xer", "application/patch-ops-error+xml"],
      ["pdf", "application/pdf"],
      ["pgp", "application/pgp-encrypted"],
      ["asc", "application/pgp-signature"],
      ["sig", "application/pgp-signature"],
      ["prf", "application/pics-rules"],
      ["p10", "application/pkcs10"],
      ["p7c", "application/pkcs7-mime"],
      ["p7m", "application/pkcs7-mime"],
      ["p7s", "application/pkcs7-signature"],
      ["p8", "application/pkcs8"],
      ["ac", "application/pkix-attr-cert"],
      ["cer", "application/pkix-cert"],
      ["crl", "application/pkix-crl"],
      ["pkipath", "application/pkix-pkipath"],
      ["pki", "application/pkixcmp"],
      ["pls", "application/pls+xml"],
      ["ai", "application/postscript"],
      ["eps", "application/postscript"],
      ["ps", "application/postscript"],
      ["provx", "application/provenance+xml"],
      ["pskcxml", "application/pskc+xml"],
      ["raml", "application/raml+yaml"],
      ["owl", "application/rdf+xml"],
      ["rdf", "application/rdf+xml"],
      ["rif", "application/reginfo+xml"],
      ["rnc", "application/relax-ng-compact-syntax"],
      ["rl", "application/resource-lists+xml"],
      ["rld", "application/resource-lists-diff+xml"],
      ["rs", "application/rls-services+xml"],
      ["rapd", "application/route-apd+xml"],
      ["sls", "application/route-s-tsid+xml"],
      ["rusd", "application/route-usd+xml"],
      ["gbr", "application/rpki-ghostbusters"],
      ["mft", "application/rpki-manifest"],
      ["roa", "application/rpki-roa"],
      ["rsd", "application/rsd+xml"],
      ["rss", "application/rss+xml"],
      ["rtf", "application/rtf"],
      ["sbml", "application/sbml+xml"],
      ["scq", "application/scvp-cv-request"],
      ["scs", "application/scvp-cv-response"],
      ["spq", "application/scvp-vp-request"],
      ["spp", "application/scvp-vp-response"],
      ["sdp", "application/sdp"],
      ["senmlx", "application/senml+xml"],
      ["sensmlx", "application/sensml+xml"],
      ["setpay", "application/set-payment-initiation"],
      ["setreg", "application/set-registration-initiation"],
      ["shf", "application/shf+xml"],
      ["sieve", "application/sieve"],
      ["siv", "application/sieve"],
      ["smi", "application/smil+xml"],
      ["smil", "application/smil+xml"],
      ["rq", "application/sparql-query"],
      ["srx", "application/sparql-results+xml"],
      ["gram", "application/srgs"],
      ["grxml", "application/srgs+xml"],
      ["sru", "application/sru+xml"],
      ["ssdl", "application/ssdl+xml"],
      ["ssml", "application/ssml+xml"],
      ["swidtag", "application/swid+xml"],
      ["tei", "application/tei+xml"],
      ["teicorpus", "application/tei+xml"],
      ["tfi", "application/thraud+xml"],
      ["tsd", "application/timestamped-data"],
      ["toml", "application/toml"],
      ["trig", "application/trig"],
      ["ttml", "application/ttml+xml"],
      ["ubj", "application/ubjson"],
      ["rsheet", "application/urc-ressheet+xml"],
      ["td", "application/urc-targetdesc+xml"],
      ["vxml", "application/voicexml+xml"],
      ["wasm", "application/wasm"],
      ["wgt", "application/widget"],
      ["hlp", "application/winhlp"],
      ["wsdl", "application/wsdl+xml"],
      ["wspolicy", "application/wspolicy+xml"],
      ["xaml", "application/xaml+xml"],
      ["xav", "application/xcap-att+xml"],
      ["xca", "application/xcap-caps+xml"],
      ["xdf", "application/xcap-diff+xml"],
      ["xel", "application/xcap-el+xml"],
      ["xns", "application/xcap-ns+xml"],
      ["xenc", "application/xenc+xml"],
      ["xht", "application/xhtml+xml"],
      ["xhtml", "application/xhtml+xml"],
      ["xlf", "application/xliff+xml"],
      ["rng", "application/xml"],
      ["xml", "application/xml"],
      ["xsd", "application/xml"],
      ["xsl", "application/xml"],
      ["dtd", "application/xml-dtd"],
      ["xop", "application/xop+xml"],
      ["xpl", "application/xproc+xml"],
      ["*xsl", "application/xslt+xml"],
      ["xslt", "application/xslt+xml"],
      ["xspf", "application/xspf+xml"],
      ["mxml", "application/xv+xml"],
      ["xhvml", "application/xv+xml"],
      ["xvm", "application/xv+xml"],
      ["xvml", "application/xv+xml"],
      ["yang", "application/yang"],
      ["yin", "application/yin+xml"],
      ["zip", "application/zip"],
      ["*3gpp", "audio/3gpp"],
      ["adp", "audio/adpcm"],
      ["amr", "audio/amr"],
      ["au", "audio/basic"],
      ["snd", "audio/basic"],
      ["kar", "audio/midi"],
      ["mid", "audio/midi"],
      ["midi", "audio/midi"],
      ["rmi", "audio/midi"],
      ["mxmf", "audio/mobile-xmf"],
      ["*mp3", "audio/mp3"],
      ["m4a", "audio/mp4"],
      ["mp4a", "audio/mp4"],
      ["m2a", "audio/mpeg"],
      ["m3a", "audio/mpeg"],
      ["mp2", "audio/mpeg"],
      ["mp2a", "audio/mpeg"],
      ["mp3", "audio/mpeg"],
      ["mpga", "audio/mpeg"],
      ["oga", "audio/ogg"],
      ["ogg", "audio/ogg"],
      ["opus", "audio/ogg"],
      ["spx", "audio/ogg"],
      ["s3m", "audio/s3m"],
      ["sil", "audio/silk"],
      ["wav", "audio/wav"],
      ["*wav", "audio/wave"],
      ["weba", "audio/webm"],
      ["xm", "audio/xm"],
      ["ttc", "font/collection"],
      ["otf", "font/otf"],
      ["ttf", "font/ttf"],
      ["woff", "font/woff"],
      ["woff2", "font/woff2"],
      ["exr", "image/aces"],
      ["apng", "image/apng"],
      ["avif", "image/avif"],
      ["bmp", "image/bmp"],
      ["cgm", "image/cgm"],
      ["drle", "image/dicom-rle"],
      ["emf", "image/emf"],
      ["fits", "image/fits"],
      ["g3", "image/g3fax"],
      ["gif", "image/gif"],
      ["heic", "image/heic"],
      ["heics", "image/heic-sequence"],
      ["heif", "image/heif"],
      ["heifs", "image/heif-sequence"],
      ["hej2", "image/hej2k"],
      ["hsj2", "image/hsj2"],
      ["ief", "image/ief"],
      ["jls", "image/jls"],
      ["jp2", "image/jp2"],
      ["jpg2", "image/jp2"],
      ["jpe", "image/jpeg"],
      ["jpeg", "image/jpeg"],
      ["jpg", "image/jpeg"],
      ["jph", "image/jph"],
      ["jhc", "image/jphc"],
      ["jpm", "image/jpm"],
      ["jpf", "image/jpx"],
      ["jpx", "image/jpx"],
      ["jxr", "image/jxr"],
      ["jxra", "image/jxra"],
      ["jxrs", "image/jxrs"],
      ["jxs", "image/jxs"],
      ["jxsc", "image/jxsc"],
      ["jxsi", "image/jxsi"],
      ["jxss", "image/jxss"],
      ["ktx", "image/ktx"],
      ["ktx2", "image/ktx2"],
      ["png", "image/png"],
      ["sgi", "image/sgi"],
      ["svg", "image/svg+xml"],
      ["svgz", "image/svg+xml"],
      ["t38", "image/t38"],
      ["tif", "image/tiff"],
      ["tiff", "image/tiff"],
      ["tfx", "image/tiff-fx"],
      ["webp", "image/webp"],
      ["wmf", "image/wmf"],
      ["disposition-notification", "message/disposition-notification"],
      ["u8msg", "message/global"],
      ["u8dsn", "message/global-delivery-status"],
      ["u8mdn", "message/global-disposition-notification"],
      ["u8hdr", "message/global-headers"],
      ["eml", "message/rfc822"],
      ["mime", "message/rfc822"],
      ["3mf", "model/3mf"],
      ["gltf", "model/gltf+json"],
      ["glb", "model/gltf-binary"],
      ["iges", "model/iges"],
      ["igs", "model/iges"],
      ["mesh", "model/mesh"],
      ["msh", "model/mesh"],
      ["silo", "model/mesh"],
      ["mtl", "model/mtl"],
      ["obj", "model/obj"],
      ["stpx", "model/step+xml"],
      ["stpz", "model/step+zip"],
      ["stpxz", "model/step-xml+zip"],
      ["stl", "model/stl"],
      ["vrml", "model/vrml"],
      ["wrl", "model/vrml"],
      ["*x3db", "model/x3d+binary"],
      ["x3dbz", "model/x3d+binary"],
      ["x3db", "model/x3d+fastinfoset"],
      ["*x3dv", "model/x3d+vrml"],
      ["x3dvz", "model/x3d+vrml"],
      ["x3d", "model/x3d+xml"],
      ["x3dz", "model/x3d+xml"],
      ["x3dv", "model/x3d-vrml"],
      ["appcache", "text/cache-manifest"],
      ["manifest", "text/cache-manifest"],
      ["ics", "text/calendar"],
      ["ifb", "text/calendar"],
      ["coffee", "text/coffeescript"],
      ["litcoffee", "text/coffeescript"],
      ["css", "text/css"],
      ["csv", "text/csv"],
      ["htm", "text/html"],
      ["html", "text/html"],
      ["shtml", "text/html"],
      ["jade", "text/jade"],
      ["jsx", "text/jsx"],
      ["less", "text/less"],
      ["markdown", "text/markdown"],
      ["md", "text/markdown"],
      ["mml", "text/mathml"],
      ["mdx", "text/mdx"],
      ["n3", "text/n3"],
      ["conf", "text/plain"],
      ["def", "text/plain"],
      ["in", "text/plain"],
      ["ini", "text/plain"],
      ["list", "text/plain"],
      ["log", "text/plain"],
      ["text", "text/plain"],
      ["txt", "text/plain"],
      ["rtx", "text/richtext"],
      ["*rtf", "text/rtf"],
      ["sgm", "text/sgml"],
      ["sgml", "text/sgml"],
      ["shex", "text/shex"],
      ["slim", "text/slim"],
      ["slm", "text/slim"],
      ["spdx", "text/spdx"],
      ["styl", "text/stylus"],
      ["stylus", "text/stylus"],
      ["tsv", "text/tab-separated-values"],
      ["man", "text/troff"],
      ["me", "text/troff"],
      ["ms", "text/troff"],
      ["roff", "text/troff"],
      ["t", "text/troff"],
      ["tr", "text/troff"],
      ["ttl", "text/turtle"],
      ["uri", "text/uri-list"],
      ["uris", "text/uri-list"],
      ["urls", "text/uri-list"],
      ["vcard", "text/vcard"],
      ["vtt", "text/vtt"],
      ["*xml", "text/xml"],
      ["yaml", "text/yaml"],
      ["yml", "text/yaml"],
      ["3gp", "video/3gpp"],
      ["3gpp", "video/3gpp"],
      ["3g2", "video/3gpp2"],
      ["h261", "video/h261"],
      ["h263", "video/h263"],
      ["h264", "video/h264"],
      ["m4s", "video/iso.segment"],
      ["jpgv", "video/jpeg"],
      ["jpm", "video/jpm"],
      ["jpgm", "video/jpm"],
      ["mj2", "video/mj2"],
      ["mjp2", "video/mj2"],
      ["ts", "application/typescript"],
      ["mp4", "video/mp4"],
      ["mp4v", "video/mp4"],
      ["mpg4", "video/mp4"],
      ["m1v", "video/mpeg"],
      ["m2v", "video/mpeg"],
      ["mpe", "video/mpeg"],
      ["mpeg", "video/mpeg"],
      ["mpg", "video/mpeg"],
      ["ogv", "video/ogg"],
      ["mov", "video/quicktime"],
      ["qt", "video/quicktime"],
      ["webm", "video/webm"]
    ]);
  }
});

// packages/isomorphic/multimap.ts
var MultiMap;
var init_multimap = __esm({
  "packages/isomorphic/multimap.ts"() {
    "use strict";
    MultiMap = class {
      constructor() {
        this._map = /* @__PURE__ */ new Map();
      }
      set(key, value2) {
        let values = this._map.get(key);
        if (!values) {
          values = [];
          this._map.set(key, values);
        }
        values.push(value2);
      }
      get(key) {
        return this._map.get(key) || [];
      }
      has(key) {
        return this._map.has(key);
      }
      delete(key, value2) {
        const values = this._map.get(key);
        if (!values)
          return;
        if (values.includes(value2))
          this._map.set(key, values.filter((v) => value2 !== v));
      }
      deleteAll(key) {
        this._map.delete(key);
      }
      hasValue(key, value2) {
        const values = this._map.get(key);
        if (!values)
          return false;
        return values.includes(value2);
      }
      get size() {
        return this._map.size;
      }
      [Symbol.iterator]() {
        return this._map[Symbol.iterator]();
      }
      keys() {
        return this._map.keys();
      }
      values() {
        const result2 = [];
        for (const key of this.keys())
          result2.push(...this.get(key));
        return result2;
      }
      clear() {
        this._map.clear();
      }
    };
  }
});

// packages/isomorphic/protocolMetainfo.ts
function getMetainfo(metadata) {
  return methodMetainfo.get(metadata.type + "." + metadata.method);
}
var methodMetainfo;
var init_protocolMetainfo = __esm({
  "packages/isomorphic/protocolMetainfo.ts"() {
    "use strict";
    methodMetainfo = /* @__PURE__ */ new Map([
      ["Android.devices", { internal: true }],
      ["AndroidSocket.write", { internal: true }],
      ["AndroidSocket.close", { internal: true }],
      ["AndroidDevice.wait", { title: "Wait" }],
      ["AndroidDevice.fill", { title: 'Fill "{text}"' }],
      ["AndroidDevice.tap", { title: "Tap" }],
      ["AndroidDevice.drag", { title: "Drag" }],
      ["AndroidDevice.fling", { title: "Fling" }],
      ["AndroidDevice.longTap", { title: "Long tap" }],
      ["AndroidDevice.pinchClose", { title: "Pinch close" }],
      ["AndroidDevice.pinchOpen", { title: "Pinch open" }],
      ["AndroidDevice.scroll", { title: "Scroll" }],
      ["AndroidDevice.swipe", { title: "Swipe" }],
      ["AndroidDevice.info", { internal: true }],
      ["AndroidDevice.screenshot", { title: "Screenshot" }],
      ["AndroidDevice.inputType", { title: "Type" }],
      ["AndroidDevice.inputPress", { title: "Press" }],
      ["AndroidDevice.inputTap", { title: "Tap" }],
      ["AndroidDevice.inputSwipe", { title: "Swipe" }],
      ["AndroidDevice.inputDrag", { title: "Drag" }],
      ["AndroidDevice.launchBrowser", { title: "Launch browser" }],
      ["AndroidDevice.open", { title: "Open app" }],
      ["AndroidDevice.shell", { title: "Execute shell command", group: "configuration" }],
      ["AndroidDevice.installApk", { title: "Install apk" }],
      ["AndroidDevice.push", { title: "Push" }],
      ["AndroidDevice.connectToWebView", { title: "Connect to Web View" }],
      ["AndroidDevice.close", { internal: true }],
      ["APIRequestContext.fetch", { title: '{method} "{url}"' }],
      ["APIRequestContext.fetchResponseBody", { title: "Get response body", group: "getter" }],
      ["APIRequestContext.fetchLog", { internal: true }],
      ["APIRequestContext.storageState", { title: "Get storage state", group: "configuration" }],
      ["APIRequestContext.disposeAPIResponse", { internal: true }],
      ["APIRequestContext.dispose", { internal: true, potentiallyClosesScope: true }],
      ["Artifact.pathAfterFinished", { internal: true }],
      ["Artifact.saveAs", { internal: true }],
      ["Artifact.saveAsStream", { internal: true }],
      ["Artifact.failure", { internal: true }],
      ["Artifact.stream", { internal: true }],
      ["Artifact.cancel", { internal: true }],
      ["Artifact.delete", { internal: true, potentiallyClosesScope: true }],
      ["Stream.read", { internal: true }],
      ["Stream.close", { internal: true }],
      ["WritableStream.write", { internal: true }],
      ["WritableStream.close", { internal: true }],
      ["Browser.startServer", { title: "Start server" }],
      ["Browser.stopServer", { title: "Stop server" }],
      ["Browser.close", { title: "Close browser", pause: true, potentiallyClosesScope: true }],
      ["Browser.killForTests", { internal: true, potentiallyClosesScope: true }],
      ["Browser.defaultUserAgentForTest", { internal: true }],
      ["Browser.newContext", { title: "Create context" }],
      ["Browser.newContextForReuse", { internal: true }],
      ["Browser.disconnectFromReusedContext", { internal: true }],
      ["Browser.newBrowserCDPSession", { title: "Create CDP session", group: "configuration" }],
      ["Browser.startTracing", { title: "Start browser tracing", group: "configuration" }],
      ["Browser.stopTracing", { title: "Stop browser tracing", group: "configuration" }],
      ["BrowserContext.addCookies", { title: "Add cookies", group: "configuration" }],
      ["BrowserContext.addInitScript", { title: "Add init script", group: "configuration" }],
      ["BrowserContext.clearCookies", { title: "Clear cookies", group: "configuration" }],
      ["BrowserContext.clearPermissions", { title: "Clear permissions", group: "configuration" }],
      ["BrowserContext.close", { title: "Close context", pause: true, potentiallyClosesScope: true }],
      ["BrowserContext.cookies", { title: "Get cookies", group: "getter" }],
      ["BrowserContext.exposeBinding", { title: "Expose binding", group: "configuration" }],
      ["BrowserContext.grantPermissions", { title: "Grant permissions", group: "configuration" }],
      ["BrowserContext.newPage", { title: "Create page" }],
      ["BrowserContext.registerSelectorEngine", { internal: true }],
      ["BrowserContext.setTestIdAttributeName", { internal: true }],
      ["BrowserContext.setExtraHTTPHeaders", { title: "Set extra HTTP headers", group: "configuration" }],
      ["BrowserContext.setGeolocation", { title: "Set geolocation", group: "configuration" }],
      ["BrowserContext.setHTTPCredentials", { title: "Set HTTP credentials", group: "configuration" }],
      ["BrowserContext.setNetworkInterceptionPatterns", { title: "Route requests", group: "route" }],
      ["BrowserContext.setWebSocketInterceptionPatterns", { title: "Route WebSockets", group: "route" }],
      ["BrowserContext.setOffline", { title: "Set offline mode" }],
      ["BrowserContext.storageState", { title: "Get storage state", group: "configuration" }],
      ["BrowserContext.setStorageState", { title: "Set storage state", group: "configuration" }],
      ["BrowserContext.pause", { title: "Pause" }],
      ["BrowserContext.enableRecorder", { internal: true }],
      ["BrowserContext.disableRecorder", { internal: true }],
      ["BrowserContext.exposeConsoleApi", { internal: true }],
      ["BrowserContext.newCDPSession", { title: "Create CDP session", group: "configuration" }],
      ["BrowserContext.createTempFiles", { internal: true }],
      ["BrowserContext.updateSubscription", { internal: true }],
      ["BrowserContext.clockFastForward", { title: 'Fast forward clock "{ticksNumber|ticksString}"' }],
      ["BrowserContext.clockInstall", { title: 'Install clock "{timeNumber|timeString}"' }],
      ["BrowserContext.clockPauseAt", { title: 'Pause clock "{timeNumber|timeString}"' }],
      ["BrowserContext.clockResume", { title: "Resume clock" }],
      ["BrowserContext.clockRunFor", { title: 'Run clock "{ticksNumber|ticksString}"' }],
      ["BrowserContext.clockSetFixedTime", { title: 'Set fixed time "{timeNumber|timeString}"' }],
      ["BrowserContext.clockSetSystemTime", { title: 'Set system time "{timeNumber|timeString}"' }],
      ["BrowserContext.credentialsInstall", { title: "Install virtual WebAuthn authenticator", group: "configuration" }],
      ["BrowserContext.credentialsCreate", { title: 'Create virtual credential for "{rpId}"', group: "configuration" }],
      ["BrowserContext.credentialsGet", { title: "Get virtual credentials", group: "configuration" }],
      ["BrowserContext.credentialsDelete", { title: "Delete virtual credential", group: "configuration" }],
      ["BrowserType.launch", { title: "Launch browser" }],
      ["BrowserType.launchPersistentContext", { title: "Launch persistent context" }],
      ["BrowserType.connectOverCDP", { title: "Connect over CDP" }],
      ["BrowserType.connectToWorker", { title: "Connect to worker" }],
      ["Disposable.dispose", { internal: true, potentiallyClosesScope: true }],
      ["Electron.launch", { title: "Launch electron" }],
      ["ElectronApplication.browserWindow", { internal: true }],
      ["ElectronApplication.evaluateExpression", { title: "Evaluate" }],
      ["ElectronApplication.evaluateExpressionHandle", { title: "Evaluate" }],
      ["ElectronApplication.updateSubscription", { internal: true }],
      ["Frame.evalOnSelector", { title: "Evaluate", snapshot: true, pause: true }],
      ["Frame.evalOnSelectorAll", { title: "Evaluate", snapshot: true, pause: true }],
      ["Frame.addScriptTag", { title: "Add script tag", snapshot: true, pause: true }],
      ["Frame.addStyleTag", { title: "Add style tag", snapshot: true, pause: true }],
      ["Frame.ariaSnapshot", { title: "Aria snapshot", group: "getter" }],
      ["Frame.blur", { title: "Blur", slowMo: true, snapshot: true, pause: true }],
      ["Frame.check", { title: "Check", slowMo: true, snapshot: true, pause: true, input: true, isAutoWaiting: true }],
      ["Frame.click", { title: "Click", slowMo: true, snapshot: true, pause: true, input: true, isAutoWaiting: true, potentiallyClosesScope: true }],
      ["Frame.content", { title: "Get content", snapshot: true, pause: true }],
      ["Frame.dragAndDrop", { title: "Drag and drop", slowMo: true, snapshot: true, pause: true, input: true, isAutoWaiting: true }],
      ["Frame.drop", { title: "Drop files or data onto an element", slowMo: true, snapshot: true, pause: true, input: true, isAutoWaiting: true }],
      ["Frame.dblclick", { title: "Double click", slowMo: true, snapshot: true, pause: true, input: true, isAutoWaiting: true }],
      ["Frame.dispatchEvent", { title: 'Dispatch "{type}"', slowMo: true, snapshot: true, pause: true }],
      ["Frame.evaluateExpression", { title: "Evaluate", snapshot: true, pause: true }],
      ["Frame.evaluateExpressionHandle", { title: "Evaluate", snapshot: true, pause: true }],
      ["Frame.fill", { title: 'Fill "{value}"', slowMo: true, snapshot: true, pause: true, input: true, isAutoWaiting: true }],
      ["Frame.focus", { title: "Focus", slowMo: true, snapshot: true, pause: true }],
      ["Frame.frameElement", { title: "Get frame element", group: "getter" }],
      ["Frame.resolveSelector", { internal: true }],
      ["Frame.highlight", { internal: true }],
      ["Frame.hideHighlight", { internal: true }],
      ["Frame.getAttribute", { title: 'Get attribute "{name}"', snapshot: true, pause: true, group: "getter" }],
      ["Frame.goto", { title: 'Navigate to "{url}"', slowMo: true, snapshot: true, pause: true }],
      ["Frame.hover", { title: "Hover", slowMo: true, snapshot: true, pause: true, input: true, isAutoWaiting: true }],
      ["Frame.innerHTML", { title: "Get HTML", snapshot: true, pause: true, group: "getter" }],
      ["Frame.innerText", { title: "Get inner text", snapshot: true, pause: true, group: "getter" }],
      ["Frame.inputValue", { title: "Get input value", snapshot: true, pause: true, group: "getter" }],
      ["Frame.isChecked", { title: "Is checked", snapshot: true, pause: true, group: "getter" }],
      ["Frame.isDisabled", { title: "Is disabled", snapshot: true, pause: true, group: "getter" }],
      ["Frame.isEnabled", { title: "Is enabled", snapshot: true, pause: true, group: "getter" }],
      ["Frame.isHidden", { title: "Is hidden", snapshot: true, pause: true, group: "getter" }],
      ["Frame.isVisible", { title: "Is visible", snapshot: true, pause: true, group: "getter" }],
      ["Frame.isEditable", { title: "Is editable", snapshot: true, pause: true, group: "getter" }],
      ["Frame.press", { title: 'Press "{key}"', slowMo: true, snapshot: true, pause: true, input: true, isAutoWaiting: true }],
      ["Frame.querySelector", { title: "Query selector", snapshot: true }],
      ["Frame.querySelectorAll", { title: "Query selector all", snapshot: true }],
      ["Frame.queryCount", { title: "Query count", snapshot: true, pause: true }],
      ["Frame.selectOption", { title: "Select option", slowMo: true, snapshot: true, pause: true, input: true, isAutoWaiting: true }],
      ["Frame.setContent", { title: "Set content", snapshot: true, pause: true }],
      ["Frame.setInputFiles", { title: "Set input files", slowMo: true, snapshot: true, pause: true, input: true, isAutoWaiting: true }],
      ["Frame.tap", { title: "Tap", slowMo: true, snapshot: true, pause: true, input: true, isAutoWaiting: true }],
      ["Frame.textContent", { title: "Get text content", snapshot: true, pause: true, group: "getter" }],
      ["Frame.title", { title: "Get page title", group: "getter" }],
      ["Frame.type", { title: 'Type "{text}"', slowMo: true, snapshot: true, pause: true, input: true, isAutoWaiting: true }],
      ["Frame.uncheck", { title: "Uncheck", slowMo: true, snapshot: true, pause: true, input: true, isAutoWaiting: true }],
      ["Frame.waitForTimeout", { title: "Wait for timeout", snapshot: true }],
      ["Frame.waitForFunction", { title: "Wait for function", snapshot: true, pause: true }],
      ["Frame.waitForSelector", { title: "Wait for selector", snapshot: true }],
      ["Frame.expect", { title: 'Expect "{expression}"', snapshot: true, pause: true }],
      ["JSHandle.dispose", { internal: true, potentiallyClosesScope: true }],
      ["ElementHandle.dispose", { internal: true, potentiallyClosesScope: true }],
      ["JSHandle.evaluateExpression", { title: "Evaluate", snapshot: true, pause: true }],
      ["ElementHandle.evaluateExpression", { title: "Evaluate", snapshot: true, pause: true }],
      ["JSHandle.evaluateExpressionHandle", { title: "Evaluate", snapshot: true, pause: true }],
      ["ElementHandle.evaluateExpressionHandle", { title: "Evaluate", snapshot: true, pause: true }],
      ["JSHandle.getPropertyList", { title: "Get property list", group: "getter" }],
      ["ElementHandle.getPropertyList", { title: "Get property list", group: "getter" }],
      ["JSHandle.getProperty", { title: "Get JS property", group: "getter" }],
      ["ElementHandle.getProperty", { title: "Get JS property", group: "getter" }],
      ["JSHandle.jsonValue", { title: "Get JSON value", group: "getter" }],
      ["ElementHandle.jsonValue", { title: "Get JSON value", group: "getter" }],
      ["ElementHandle.evalOnSelector", { title: "Evaluate", snapshot: true, pause: true }],
      ["ElementHandle.evalOnSelectorAll", { title: "Evaluate", snapshot: true, pause: true }],
      ["ElementHandle.boundingBox", { title: "Get bounding box", snapshot: true, pause: true }],
      ["ElementHandle.check", { title: "Check", slowMo: true, snapshot: true, pause: true, input: true, isAutoWaiting: true }],
      ["ElementHandle.click", { title: "Click", slowMo: true, snapshot: true, pause: true, input: true, isAutoWaiting: true }],
      ["ElementHandle.contentFrame", { title: "Get content frame", group: "getter" }],
      ["ElementHandle.dblclick", { title: "Double click", slowMo: true, snapshot: true, pause: true, input: true, isAutoWaiting: true }],
      ["ElementHandle.dispatchEvent", { title: "Dispatch event", slowMo: true, snapshot: true, pause: true }],
      ["ElementHandle.fill", { title: 'Fill "{value}"', slowMo: true, snapshot: true, pause: true, input: true, isAutoWaiting: true }],
      ["ElementHandle.focus", { title: "Focus", slowMo: true, snapshot: true, pause: true }],
      ["ElementHandle.getAttribute", { title: "Get attribute", snapshot: true, pause: true, group: "getter" }],
      ["ElementHandle.hover", { title: "Hover", slowMo: true, snapshot: true, pause: true, input: true, isAutoWaiting: true }],
      ["ElementHandle.innerHTML", { title: "Get HTML", snapshot: true, pause: true, group: "getter" }],
      ["ElementHandle.innerText", { title: "Get inner text", snapshot: true, pause: true, group: "getter" }],
      ["ElementHandle.inputValue", { title: "Get input value", snapshot: true, pause: true, group: "getter" }],
      ["ElementHandle.isChecked", { title: "Is checked", snapshot: true, pause: true, group: "getter" }],
      ["ElementHandle.isDisabled", { title: "Is disabled", snapshot: true, pause: true, group: "getter" }],
      ["ElementHandle.isEditable", { title: "Is editable", snapshot: true, pause: true, group: "getter" }],
      ["ElementHandle.isEnabled", { title: "Is enabled", snapshot: true, pause: true, group: "getter" }],
      ["ElementHandle.isHidden", { title: "Is hidden", snapshot: true, pause: true, group: "getter" }],
      ["ElementHandle.isVisible", { title: "Is visible", snapshot: true, pause: true, group: "getter" }],
      ["ElementHandle.ownerFrame", { title: "Get owner frame", group: "getter" }],
      ["ElementHandle.press", { title: 'Press "{key}"', slowMo: true, snapshot: true, pause: true, input: true, isAutoWaiting: true }],
      ["ElementHandle.querySelector", { title: "Query selector", snapshot: true }],
      ["ElementHandle.querySelectorAll", { title: "Query selector all", snapshot: true }],
      ["ElementHandle.screenshot", { title: "Screenshot", snapshot: true, pause: true }],
      ["ElementHandle.scrollIntoViewIfNeeded", { title: "Scroll into view", slowMo: true, snapshot: true, pause: true }],
      ["ElementHandle.selectOption", { title: "Select option", slowMo: true, snapshot: true, pause: true, input: true, isAutoWaiting: true }],
      ["ElementHandle.selectText", { title: "Select text", slowMo: true, snapshot: true, pause: true }],
      ["ElementHandle.setInputFiles", { title: "Set input files", slowMo: true, snapshot: true, pause: true, input: true, isAutoWaiting: true }],
      ["ElementHandle.tap", { title: "Tap", slowMo: true, snapshot: true, pause: true, input: true, isAutoWaiting: true }],
      ["ElementHandle.textContent", { title: "Get text content", snapshot: true, pause: true, group: "getter" }],
      ["ElementHandle.type", { title: "Type", slowMo: true, snapshot: true, pause: true, input: true, isAutoWaiting: true }],
      ["ElementHandle.uncheck", { title: "Uncheck", slowMo: true, snapshot: true, pause: true, input: true, isAutoWaiting: true }],
      ["ElementHandle.waitForElementState", { title: "Wait for state", snapshot: true, pause: true }],
      ["ElementHandle.waitForSelector", { title: "Wait for selector", snapshot: true }],
      ["LocalUtils.zip", { internal: true }],
      ["LocalUtils.harOpen", { internal: true }],
      ["LocalUtils.harLookup", { internal: true }],
      ["LocalUtils.harClose", { internal: true }],
      ["LocalUtils.harUnzip", { internal: true }],
      ["LocalUtils.connect", { internal: true }],
      ["LocalUtils.tracingStarted", { internal: true }],
      ["LocalUtils.addStackToTracingNoReply", { internal: true }],
      ["LocalUtils.traceDiscarded", { internal: true }],
      ["LocalUtils.globToRegex", { internal: true }],
      ["Request.response", { internal: true }],
      ["Request.rawRequestHeaders", { internal: true }],
      ["Route.redirectNavigationRequest", { internal: true }],
      ["Route.abort", { title: "Abort request", group: "route" }],
      ["Route.continue", { title: "Continue request", group: "route" }],
      ["Route.fulfill", { title: "Fulfill request", group: "route" }],
      ["WebSocketRoute.connect", { title: "Connect WebSocket to server", group: "route" }],
      ["WebSocketRoute.ensureOpened", { internal: true }],
      ["WebSocketRoute.sendToPage", { title: "Send WebSocket message", group: "route" }],
      ["WebSocketRoute.sendToServer", { title: "Send WebSocket message", group: "route" }],
      ["WebSocketRoute.closePage", { internal: true }],
      ["WebSocketRoute.closeServer", { internal: true }],
      ["Response.body", { title: "Get response body", group: "getter" }],
      ["Response.securityDetails", { internal: true }],
      ["Response.serverAddr", { internal: true }],
      ["Response.rawResponseHeaders", { internal: true }],
      ["Response.httpVersion", { internal: true }],
      ["Response.sizes", { internal: true }],
      ["Page.addInitScript", { title: "Add init script", group: "configuration" }],
      ["Page.close", { title: "Close page", pause: true, potentiallyClosesScope: true }],
      ["Page.runBeforeUnload", { title: "Run beforeunload", pause: true }],
      ["Page.clearConsoleMessages", { title: "Clear console messages" }],
      ["Page.consoleMessages", { title: "Get console messages", group: "getter" }],
      ["Page.emulateMedia", { title: "Emulate media", snapshot: true, pause: true }],
      ["Page.exposeBinding", { title: "Expose binding", group: "configuration" }],
      ["Page.goBack", { title: "Go back", slowMo: true, snapshot: true, pause: true }],
      ["Page.goForward", { title: "Go forward", slowMo: true, snapshot: true, pause: true }],
      ["Page.requestGC", { title: "Request garbage collection", group: "configuration" }],
      ["Page.registerLocatorHandler", { title: "Register locator handler" }],
      ["Page.resolveLocatorHandlerNoReply", { internal: true }],
      ["Page.unregisterLocatorHandler", { title: "Unregister locator handler" }],
      ["Page.reload", { title: "Reload", slowMo: true, snapshot: true, pause: true }],
      ["Page.expectScreenshot", { title: "Expect screenshot", snapshot: true, pause: true }],
      ["Page.screenshot", { title: "Screenshot", snapshot: true, pause: true }],
      ["Page.setExtraHTTPHeaders", { title: "Set extra HTTP headers", group: "configuration" }],
      ["Page.setNetworkInterceptionPatterns", { title: "Route requests", group: "route" }],
      ["Page.setWebSocketInterceptionPatterns", { title: "Route WebSockets", group: "route" }],
      ["Page.setViewportSize", { title: "Set viewport size", snapshot: true, pause: true }],
      ["Page.keyboardDown", { title: 'Key down "{key}"', slowMo: true, snapshot: true, pause: true, input: true }],
      ["Page.keyboardUp", { title: 'Key up "{key}"', slowMo: true, snapshot: true, pause: true, input: true }],
      ["Page.keyboardInsertText", { title: 'Insert "{text}"', slowMo: true, snapshot: true, pause: true, input: true }],
      ["Page.keyboardType", { title: 'Type "{text}"', slowMo: true, snapshot: true, pause: true, input: true }],
      ["Page.keyboardPress", { title: 'Press "{key}"', slowMo: true, snapshot: true, pause: true, input: true }],
      ["Page.mouseMove", { title: "Mouse move", slowMo: true, snapshot: true, pause: true, input: true }],
      ["Page.mouseDown", { title: "Mouse down", slowMo: true, snapshot: true, pause: true, input: true }],
      ["Page.mouseUp", { title: "Mouse up", slowMo: true, snapshot: true, pause: true, input: true }],
      ["Page.mouseClick", { title: "Click", slowMo: true, snapshot: true, pause: true, input: true }],
      ["Page.mouseWheel", { title: "Mouse wheel", slowMo: true, snapshot: true, pause: true, input: true }],
      ["Page.touchscreenTap", { title: "Tap", slowMo: true, snapshot: true, pause: true, input: true }],
      ["Page.clearPageErrors", { title: "Clear page errors" }],
      ["Page.pageErrors", { title: "Get page errors", group: "getter" }],
      ["Page.pdf", { title: "PDF" }],
      ["Page.requests", { title: "Get network requests", group: "getter" }],
      ["Page.startJSCoverage", { title: "Start JS coverage", group: "configuration" }],
      ["Page.stopJSCoverage", { title: "Stop JS coverage", group: "configuration" }],
      ["Page.startCSSCoverage", { title: "Start CSS coverage", group: "configuration" }],
      ["Page.stopCSSCoverage", { title: "Stop CSS coverage", group: "configuration" }],
      ["Page.bringToFront", { title: "Bring to front" }],
      ["Page.pickLocator", { title: "Pick locator", group: "configuration" }],
      ["Page.cancelPickLocator", { title: "Cancel pick locator", group: "configuration" }],
      ["Page.hideHighlight", { title: "Hide all element highlights", group: "configuration" }],
      ["Page.screencastShowOverlay", { title: "Show overlay", group: "configuration" }],
      ["Page.screencastRemoveOverlay", { title: "Remove overlay", group: "configuration" }],
      ["Page.screencastChapter", { title: "Show chapter overlay", group: "configuration" }],
      ["Page.screencastSetOverlayVisible", { title: "Set overlay visibility", group: "configuration" }],
      ["Page.screencastShowActions", { title: "Show actions", group: "configuration" }],
      ["Page.screencastHideActions", { title: "Remove actions", group: "configuration" }],
      ["Page.screencastStart", { title: "Start screencast", group: "configuration" }],
      ["Page.screencastStop", { title: "Stop screencast", group: "configuration" }],
      ["Page.updateSubscription", { internal: true }],
      ["Page.setDockTile", { internal: true }],
      ["Page.webStorageItems", { title: "Get WebStorage items", group: "getter" }],
      ["Page.webStorageGetItem", { title: "Get WebStorage item", group: "getter" }],
      ["Page.webStorageSetItem", { title: "Set WebStorage item", group: "configuration" }],
      ["Page.webStorageRemoveItem", { title: "Remove WebStorage item", group: "configuration" }],
      ["Page.webStorageClear", { title: "Clear WebStorage", group: "configuration" }],
      ["Root.initialize", { internal: true }],
      ["Playwright.newRequest", { title: "Create request context" }],
      ["DebugController.initialize", { internal: true }],
      ["DebugController.setReportStateChanged", { internal: true }],
      ["DebugController.setRecorderMode", { internal: true }],
      ["DebugController.highlight", { internal: true }],
      ["DebugController.hideHighlight", { internal: true }],
      ["DebugController.resume", { internal: true }],
      ["DebugController.kill", { internal: true }],
      ["SocksSupport.socksConnected", { internal: true }],
      ["SocksSupport.socksFailed", { internal: true }],
      ["SocksSupport.socksData", { internal: true }],
      ["SocksSupport.socksError", { internal: true }],
      ["SocksSupport.socksEnd", { internal: true }],
      ["JsonPipe.send", { internal: true }],
      ["JsonPipe.close", { internal: true }],
      ["CDPSession.send", { title: "Send CDP command", group: "configuration" }],
      ["CDPSession.detach", { title: "Detach CDP session", potentiallyClosesScope: true, group: "configuration" }],
      ["BindingCall.reject", { internal: true }],
      ["BindingCall.resolve", { internal: true }],
      ["Debugger.requestPause", { title: "Pause on next call", group: "configuration" }],
      ["Debugger.resume", { title: "Resume", group: "configuration" }],
      ["Debugger.next", { title: "Step to next call", group: "configuration" }],
      ["Debugger.runTo", { title: "Run to location", group: "configuration" }],
      ["Dialog.accept", { title: "Accept dialog" }],
      ["Dialog.dismiss", { title: "Dismiss dialog" }],
      ["Tracing.tracingStart", { title: "Start tracing", group: "configuration" }],
      ["Tracing.tracingStartChunk", { title: "Start tracing", group: "configuration" }],
      ["Tracing.tracingGroup", { title: 'Trace "{name}"' }],
      ["Tracing.tracingGroupEnd", { title: "Group end" }],
      ["Tracing.tracingStopChunk", { title: "Stop tracing", group: "configuration" }],
      ["Tracing.tracingStop", { title: "Stop tracing", group: "configuration" }],
      ["Tracing.harStart", { internal: true }],
      ["Tracing.harExport", { internal: true }],
      ["Worker.disconnect", { title: "Disconnect from worker", potentiallyClosesScope: true }],
      ["Worker.evaluateExpression", { title: "Evaluate" }],
      ["Worker.evaluateExpressionHandle", { title: "Evaluate" }],
      ["Worker.updateSubscription", { internal: true }]
    ]);
  }
});

// packages/isomorphic/protocolFormatter.ts
function formatProtocolParam(params2, alternatives) {
  return _formatProtocolParam(params2, alternatives)?.replaceAll("\n", "\\n");
}
function _formatProtocolParam(params2, alternatives) {
  if (!params2)
    return void 0;
  for (const name of alternatives.split("|")) {
    if (name === "url") {
      try {
        const urlObject = new URL(params2[name]);
        if (urlObject.protocol === "data:")
          return urlObject.protocol;
        if (["about:", "chrome:", "edge:"].includes(urlObject.protocol))
          return params2[name];
        return urlObject.pathname + urlObject.search;
      } catch (error) {
        if (params2[name] !== void 0)
          return params2[name];
      }
    }
    if (name === "timeNumber" && params2[name] !== void 0) {
      return new Date(params2[name]).toString();
    }
    const value2 = deepParam(params2, name);
    if (value2 !== void 0)
      return value2;
  }
}
function deepParam(params2, name) {
  const tokens = name.split(".");
  let current = params2;
  for (const token of tokens) {
    if (typeof current !== "object" || current === null)
      return void 0;
    current = current[token];
  }
  if (current === void 0)
    return void 0;
  return String(current);
}
function renderTitleForCall(metadata) {
  const titleFormat = metadata.title ?? getMetainfo(metadata)?.title ?? metadata.method;
  return titleFormat.replace(/\{([^}]+)\}/g, (fullMatch, p1) => {
    return formatProtocolParam(metadata.params, p1) ?? fullMatch;
  });
}
function getActionGroup(metadata) {
  return getMetainfo(metadata)?.group;
}
var init_protocolFormatter = __esm({
  "packages/isomorphic/protocolFormatter.ts"() {
    "use strict";
    init_protocolMetainfo();
  }
});

// packages/isomorphic/semaphore.ts
var Semaphore;
var init_semaphore = __esm({
  "packages/isomorphic/semaphore.ts"() {
    "use strict";
    init_manualPromise();
    Semaphore = class {
      constructor(max) {
        this._acquired = 0;
        this._queue = [];
        this._max = max;
      }
      setMax(max) {
        this._max = max;
      }
      acquire() {
        const lock2 = new ManualPromise();
        this._queue.push(lock2);
        this._flush();
        return lock2;
      }
      release() {
        --this._acquired;
        this._flush();
      }
      _flush() {
        while (this._acquired < this._max && this._queue.length) {
          ++this._acquired;
          this._queue.shift().resolve();
        }
      }
    };
  }
});

// packages/isomorphic/formatUtils.ts
function msToString(ms) {
  if (ms < 0 || !isFinite(ms))
    return "-";
  if (ms === 0)
    return "0ms";
  if (ms < 1e3)
    return ms.toFixed(0) + "ms";
  const seconds = ms / 1e3;
  if (seconds < 60)
    return seconds.toFixed(1) + "s";
  const minutes = seconds / 60;
  if (minutes < 60)
    return minutes.toFixed(1) + "m";
  const hours = minutes / 60;
  if (hours < 24)
    return hours.toFixed(1) + "h";
  const days = hours / 24;
  return days.toFixed(1) + "d";
}
function bytesToString(bytes) {
  if (bytes < 0 || !isFinite(bytes))
    return "-";
  if (bytes === 0)
    return "0";
  if (bytes < 1e3)
    return bytes.toFixed(0);
  const kb = bytes / 1024;
  if (kb < 1e3)
    return kb.toFixed(1) + "K";
  const mb = kb / 1024;
  if (mb < 1e3)
    return mb.toFixed(1) + "M";
  const gb = mb / 1024;
  return gb.toFixed(1) + "G";
}
var init_formatUtils = __esm({
  "packages/isomorphic/formatUtils.ts"() {
    "use strict";
  }
});

// packages/isomorphic/time.ts
function setTimeOrigin(origin) {
  _timeOrigin = origin;
  _timeShift = performance.timeOrigin - origin;
}
function timeOrigin() {
  return _timeOrigin;
}
function monotonicTime() {
  return Math.floor((performance.now() + _timeShift) * 1e3) / 1e3;
}
var _timeOrigin, _timeShift, DEFAULT_PLAYWRIGHT_TIMEOUT, DEFAULT_PLAYWRIGHT_LAUNCH_TIMEOUT;
var init_time = __esm({
  "packages/isomorphic/time.ts"() {
    "use strict";
    _timeOrigin = performance.timeOrigin;
    _timeShift = 0;
    DEFAULT_PLAYWRIGHT_TIMEOUT = 3e4;
    DEFAULT_PLAYWRIGHT_LAUNCH_TIMEOUT = 3 * 60 * 1e3;
  }
});

// packages/isomorphic/timeoutRunner.ts
async function raceAgainstDeadline(cb, deadline) {
  let timer;
  return await Promise.race([
    cb().then((result2) => {
      return { result: result2, timedOut: false };
    }),
    new Promise((resolve) => {
      if (!deadline)
        return;
      timer = setTimeout(() => resolve({ timedOut: true }), deadline - monotonicTime());
    })
  ]).finally(() => {
    clearTimeout(timer);
  });
}
async function pollAgainstDeadline(callback, deadline, pollIntervals = [100, 250, 500, 1e3]) {
  const lastPollInterval = pollIntervals.pop() ?? 1e3;
  let lastResult;
  const wrappedCallback = () => Promise.resolve().then(callback);
  while (true) {
    const time = monotonicTime();
    if (deadline && time >= deadline)
      break;
    const received = await raceAgainstDeadline(wrappedCallback, deadline);
    if (received.timedOut)
      break;
    lastResult = received.result.result;
    if (!received.result.continuePolling)
      return { result: lastResult, timedOut: false };
    const interval = pollIntervals.shift() ?? lastPollInterval;
    if (deadline && deadline <= monotonicTime() + interval)
      break;
    await new Promise((x) => setTimeout(x, interval));
  }
  return { timedOut: true, result: lastResult };
}
var init_timeoutRunner = __esm({
  "packages/isomorphic/timeoutRunner.ts"() {
    "use strict";
    init_time();
  }
});

// packages/isomorphic/trace/snapshotServer.ts
function removeHash(url2) {
  try {
    const u = new URL(url2);
    u.hash = "";
    return u.toString();
  } catch (e) {
    return url2;
  }
}
var SnapshotServer;
var init_snapshotServer = __esm({
  "packages/isomorphic/trace/snapshotServer.ts"() {
    "use strict";
    SnapshotServer = class {
      constructor(snapshotStorage, resourceLoader) {
        this._snapshotIds = /* @__PURE__ */ new Map();
        this._snapshotStorage = snapshotStorage;
        this._resourceLoader = resourceLoader;
      }
      serveSnapshot(pageOrFrameId, searchParams, snapshotUrl) {
        const snapshot3 = this._snapshot(pageOrFrameId, searchParams);
        if (!snapshot3)
          return new Response(null, { status: 404 });
        const renderedSnapshot = snapshot3.render();
        this._snapshotIds.set(snapshotUrl, snapshot3);
        return new Response(renderedSnapshot.html, { status: 200, headers: { "Content-Type": "text/html; charset=utf-8" } });
      }
      async serveClosestScreenshot(pageOrFrameId, searchParams) {
        const snapshot3 = this._snapshot(pageOrFrameId, searchParams);
        const sha1 = snapshot3?.closestScreenshot();
        if (!sha1)
          return new Response(null, { status: 404 });
        return new Response(await this._resourceLoader(sha1));
      }
      serveSnapshotInfo(pageOrFrameId, searchParams) {
        const snapshot3 = this._snapshot(pageOrFrameId, searchParams);
        return this._respondWithJson(snapshot3 ? {
          viewport: snapshot3.viewport(),
          url: snapshot3.snapshot().frameUrl,
          timestamp: snapshot3.snapshot().timestamp,
          wallTime: snapshot3.snapshot().wallTime
        } : {
          error: "No snapshot found"
        });
      }
      _snapshot(pageOrFrameId, params2) {
        const name = params2.get("name");
        return this._snapshotStorage.snapshotByName(pageOrFrameId, name);
      }
      _respondWithJson(object) {
        return new Response(JSON.stringify(object), {
          status: 200,
          headers: {
            "Cache-Control": "public, max-age=31536000",
            "Content-Type": "application/json"
          }
        });
      }
      async serveResource(requestUrlAlternatives, method, snapshotUrl) {
        let resource;
        const snapshot3 = this._snapshotIds.get(snapshotUrl);
        for (const requestUrl of requestUrlAlternatives) {
          resource = snapshot3?.resourceByUrl(removeHash(requestUrl), method);
          if (resource)
            break;
        }
        if (!resource)
          return new Response(null, { status: 404 });
        const sha1 = resource.response.content._sha1;
        const content = sha1 ? await this._resourceLoader(sha1) || new Blob([]) : new Blob([]);
        let contentType = resource.response.content.mimeType;
        const isTextEncoding = /^text\/|^application\/(javascript|json)/.test(contentType);
        if (isTextEncoding && !contentType.includes("charset"))
          contentType = `${contentType}; charset=utf-8`;
        const headers = new Headers();
        if (contentType !== "x-unknown")
          headers.set("Content-Type", contentType);
        for (const { name, value: value2 } of resource.response.headers)
          headers.set(name, value2);
        headers.delete("Content-Encoding");
        headers.delete("Access-Control-Allow-Origin");
        headers.set("Access-Control-Allow-Origin", "*");
        headers.delete("Content-Length");
        headers.set("Content-Length", String(content.size));
        if (this._snapshotStorage.hasResourceOverride(resource.request.url))
          headers.set("Cache-Control", "no-store, no-cache, max-age=0");
        else
          headers.set("Cache-Control", "public, max-age=31536000");
        const { status } = resource.response;
        const isNullBodyStatus = status === 101 || status === 204 || status === 205 || status === 304;
        return new Response(isNullBodyStatus ? null : content, {
          headers,
          status: resource.response.status,
          statusText: resource.response.statusText
        });
      }
    };
  }
});

// packages/isomorphic/urlMatch.ts
function isHttpUrl(url2, base) {
  try {
    return ["http:", "https:"].includes(new URL(url2, base).protocol);
  } catch {
    return false;
  }
}
function globToRegexPattern(glob) {
  const tokens = ["^"];
  let inGroup = false;
  for (let i = 0; i < glob.length; ++i) {
    const c = glob[i];
    if (c === "\\" && i + 1 < glob.length) {
      const char = glob[++i];
      tokens.push(escapedChars.has(char) ? "\\" + char : char);
      continue;
    }
    if (c === "*") {
      const charBefore = glob[i - 1];
      let starCount = 1;
      while (glob[i + 1] === "*") {
        starCount++;
        i++;
      }
      if (starCount > 1) {
        const charAfter = glob[i + 1];
        if (charAfter === "/") {
          if (charBefore === "/")
            tokens.push("((.+/)|)");
          else
            tokens.push("(.*/)");
          ++i;
        } else {
          tokens.push("(.*)");
        }
      } else {
        tokens.push("([^/]*)");
      }
      continue;
    }
    switch (c) {
      case "{":
        if (inGroup)
          throw new Error(`Invalid glob pattern ${JSON.stringify(glob)}: nested '{' is not supported`);
        inGroup = true;
        tokens.push("(");
        break;
      case "}":
        if (!inGroup)
          throw new Error(`Invalid glob pattern ${JSON.stringify(glob)}: unmatched '}'`);
        inGroup = false;
        tokens.push(")");
        break;
      case ",":
        if (inGroup) {
          tokens.push("|");
          break;
        }
        tokens.push("\\" + c);
        break;
      default:
        tokens.push(escapedChars.has(c) ? "\\" + c : c);
    }
  }
  if (inGroup)
    throw new Error(`Invalid glob pattern ${JSON.stringify(glob)}: unmatched '{'`);
  tokens.push("$");
  return tokens.join("");
}
function isRegExp3(obj) {
  return obj instanceof RegExp || Object.prototype.toString.call(obj) === "[object RegExp]";
}
function serializeURLPattern(v) {
  return {
    hash: v.hash,
    hostname: v.hostname,
    password: v.password,
    pathname: v.pathname,
    port: v.port,
    protocol: v.protocol,
    search: v.search,
    username: v.username
  };
}
function serializeURLMatch(match) {
  if (isString(match))
    return { glob: match };
  if (isRegExp3(match))
    return { regexSource: match.source, regexFlags: match.flags };
  if (isURLPattern(match))
    return { urlPattern: serializeURLPattern(match) };
  return void 0;
}
function deserializeURLPattern(v) {
  if (typeof globalThis.URLPattern !== "function")
    return () => true;
  return new globalThis.URLPattern({
    hash: v.hash,
    hostname: v.hostname,
    password: v.password,
    pathname: v.pathname,
    port: v.port,
    protocol: v.protocol,
    search: v.search,
    username: v.username
  });
}
function deserializeURLMatch(match) {
  if (match.regexSource)
    return new RegExp(match.regexSource, match.regexFlags);
  if (match.urlPattern)
    return deserializeURLPattern(match.urlPattern);
  return match.glob;
}
function urlMatchesEqual(match1, match2) {
  if (isRegExp3(match1) && isRegExp3(match2))
    return match1.source === match2.source && match1.flags === match2.flags;
  return match1 === match2;
}
function urlMatches(baseURL, urlString, match, webSocketUrl) {
  if (match === void 0 || match === "")
    return true;
  if (isString(match))
    match = new RegExp(resolveGlobToRegexPattern(baseURL, match, webSocketUrl));
  if (isRegExp3(match)) {
    const r = match.test(urlString);
    return r;
  }
  const url2 = parseURL(urlString);
  if (!url2)
    return false;
  if (isURLPattern(match))
    return match.test(url2.href);
  if (typeof match !== "function")
    throw new Error("url parameter should be string, RegExp, URLPattern or function");
  return match(url2);
}
function resolveGlobToRegexPattern(baseURL, glob, webSocketUrl) {
  if (webSocketUrl)
    baseURL = toWebSocketBaseUrl(baseURL);
  glob = resolveGlobBase(baseURL, glob);
  return globToRegexPattern(glob);
}
function toWebSocketBaseUrl(baseURL) {
  if (baseURL && /^https?:\/\//.test(baseURL))
    baseURL = baseURL.replace(/^http/, "ws");
  return baseURL;
}
function resolveGlobBase(baseURL, match) {
  if (!match.startsWith("*")) {
    let mapToken2 = function(original, replacement) {
      if (original.length === 0)
        return "";
      tokenMap.set(replacement, original);
      return replacement;
    };
    var mapToken = mapToken2;
    const tokenMap = /* @__PURE__ */ new Map();
    match = match.replaceAll(/\\\\\?/g, "?");
    if (match.startsWith("about:") || match.startsWith("data:") || match.startsWith("chrome:") || match.startsWith("edge:") || match.startsWith("file:"))
      return match;
    const relativePath = match.split("/").map((token, index) => {
      if (token === "." || token === ".." || token === "")
        return token;
      if (index === 0 && token.endsWith(":")) {
        if (token.indexOf("*") !== -1 || token.indexOf("{") !== -1)
          return mapToken2(token, "http:");
        return token;
      }
      const questionIndex = token.indexOf("?");
      if (questionIndex === -1)
        return mapToken2(token, `$_${index}_$`);
      const newPrefix = mapToken2(token.substring(0, questionIndex), `$_${index}_$`);
      const newSuffix = mapToken2(token.substring(questionIndex), `?$_${index}_$`);
      return newPrefix + newSuffix;
    }).join("/");
    const result2 = resolveBaseURL(baseURL, relativePath);
    let resolved = result2.resolved;
    for (const [token, original] of tokenMap) {
      const normalize = result2.caseInsensitivePart?.includes(token);
      resolved = resolved.replace(token, normalize ? original.toLowerCase() : original);
    }
    match = resolved;
  }
  return match;
}
function parseURL(url2) {
  try {
    return new URL(url2);
  } catch (e) {
    return null;
  }
}
function constructURLBasedOnBaseURL(baseURL, givenURL) {
  try {
    return resolveBaseURL(baseURL, givenURL).resolved;
  } catch (e) {
    return givenURL;
  }
}
function resolveBaseURL(baseURL, givenURL) {
  try {
    const url2 = new URL(givenURL, baseURL);
    const resolved = url2.toString();
    const caseInsensitivePrefix = url2.origin;
    return { resolved, caseInsensitivePart: caseInsensitivePrefix };
  } catch (e) {
    return { resolved: givenURL };
  }
}
var escapedChars, isURLPattern;
var init_urlMatch = __esm({
  "packages/isomorphic/urlMatch.ts"() {
    "use strict";
    init_stringUtils();
    escapedChars = /* @__PURE__ */ new Set(["$", "^", "+", ".", "*", "(", ")", "|", "\\", "?", "{", "}", "[", "]"]);
    isURLPattern = (v) => typeof globalThis.URLPattern === "function" && v instanceof globalThis.URLPattern;
  }
});

// packages/isomorphic/locatorUtils.ts
function getByAttributeTextSelector(attrName, text2, options) {
  return `internal:attr=[${attrName}=${escapeForAttributeSelector(text2, options?.exact || false)}]`;
}
function encodeTestIdAttributeName(testIdAttributeName2) {
  return testIdAttributeName2.includes(",") ? JSON.stringify(testIdAttributeName2) : testIdAttributeName2;
}
function getByTestIdSelector(testIdAttributeName2, testId) {
  return `internal:testid=[${encodeTestIdAttributeName(testIdAttributeName2)}=${escapeForAttributeSelector(testId, true)}]`;
}
function getByLabelSelector(text2, options) {
  return "internal:label=" + escapeForTextSelector(text2, !!options?.exact);
}
function getByAltTextSelector(text2, options) {
  return getByAttributeTextSelector("alt", text2, options);
}
function getByTitleSelector(text2, options) {
  return getByAttributeTextSelector("title", text2, options);
}
function getByPlaceholderSelector(text2, options) {
  return getByAttributeTextSelector("placeholder", text2, options);
}
function getByTextSelector(text2, options) {
  return "internal:text=" + escapeForTextSelector(text2, !!options?.exact);
}
function getByRoleSelector(role, options = {}) {
  const props = [];
  if (options.checked !== void 0)
    props.push(["checked", String(options.checked)]);
  if (options.disabled !== void 0)
    props.push(["disabled", String(options.disabled)]);
  if (options.selected !== void 0)
    props.push(["selected", String(options.selected)]);
  if (options.expanded !== void 0)
    props.push(["expanded", String(options.expanded)]);
  if (options.includeHidden !== void 0)
    props.push(["include-hidden", String(options.includeHidden)]);
  if (options.level !== void 0)
    props.push(["level", String(options.level)]);
  if (options.name !== void 0)
    props.push(["name", escapeForAttributeSelector(options.name, !!options.exact)]);
  if (options.description !== void 0)
    props.push(["description", escapeForAttributeSelector(options.description, !!options.exact)]);
  if (options.pressed !== void 0)
    props.push(["pressed", String(options.pressed)]);
  return `internal:role=${role}${props.map(([n, v]) => `[${n}=${v}]`).join("")}`;
}
var init_locatorUtils = __esm({
  "packages/isomorphic/locatorUtils.ts"() {
    "use strict";
    init_stringUtils();
  }
});

// packages/isomorphic/locatorParser.ts
function parseLocator(locator2, testIdAttributeName2) {
  locator2 = locator2.replace(/AriaRole\s*\.\s*([\w]+)/g, (_, group) => group.toLowerCase()).replace(/(get_by_role|getByRole)\s*\(\s*(?:["'`])([^'"`]+)['"`]/g, (_, group1, group2) => `${group1}(${group2.toLowerCase()}`);
  const params2 = [];
  let template = "";
  for (let i = 0; i < locator2.length; ++i) {
    const quote5 = locator2[i];
    if (quote5 !== '"' && quote5 !== "'" && quote5 !== "`" && quote5 !== "/") {
      template += quote5;
      continue;
    }
    const isRegexEscaping = locator2[i - 1] === "r" || locator2[i] === "/";
    ++i;
    let text2 = "";
    while (i < locator2.length) {
      if (locator2[i] === "\\") {
        if (isRegexEscaping) {
          if (locator2[i + 1] !== quote5)
            text2 += locator2[i];
          ++i;
          text2 += locator2[i];
        } else {
          ++i;
          if (locator2[i] === "n")
            text2 += "\n";
          else if (locator2[i] === "r")
            text2 += "\r";
          else if (locator2[i] === "t")
            text2 += "	";
          else
            text2 += locator2[i];
        }
        ++i;
        continue;
      }
      if (locator2[i] !== quote5) {
        text2 += locator2[i++];
        continue;
      }
      break;
    }
    params2.push({ quote: quote5, text: text2 });
    template += (quote5 === "/" ? "r" : "") + "$" + params2.length;
  }
  template = template.toLowerCase().replace(/get_by_alt_text/g, "getbyalttext").replace(/get_by_test_id/g, "getbytestid").replace(/get_by_([\w]+)/g, "getby$1").replace(/has_not_text/g, "hasnottext").replace(/has_text/g, "hastext").replace(/has_not/g, "hasnot").replace(/frame_locator/g, "framelocator").replace(/content_frame/g, "contentframe").replace(/[{}\s]/g, "").replace(/new\(\)/g, "").replace(/new[\w]+\.[\w]+options\(\)/g, "").replace(/\.set/g, ",set").replace(/\.or_\(/g, "or(").replace(/\.and_\(/g, "and(").replace(/:/g, "=").replace(/,re\.ignorecase/g, "i").replace(/,pattern.case_insensitive/g, "i").replace(/,regexoptions.ignorecase/g, "i").replace(/re.compile\(([^)]+)\)/g, "$1").replace(/pattern.compile\(([^)]+)\)/g, "r$1").replace(/newregex\(([^)]+)\)/g, "r$1").replace(/string=/g, "=").replace(/regex=/g, "=").replace(/,,/g, ",").replace(/,\)/g, ")");
  const preferredQuote = params2.map((p) => p.quote).filter((quote5) => "'\"`".includes(quote5))[0];
  return { selector: transform(template, params2, testIdAttributeName2), preferredQuote };
}
function countParams(template) {
  return [...template.matchAll(/\$\d+/g)].length;
}
function shiftParams(template, sub) {
  return template.replace(/\$(\d+)/g, (_, ordinal) => `$${ordinal - sub}`);
}
function transform(template, params2, testIdAttributeName2) {
  while (true) {
    const hasMatch = template.match(/filter\(,?(has=|hasnot=|sethas\(|sethasnot\()/);
    if (!hasMatch)
      break;
    const start3 = hasMatch.index + hasMatch[0].length;
    let balance = 0;
    let end = start3;
    for (; end < template.length; end++) {
      if (template[end] === "(")
        balance++;
      else if (template[end] === ")")
        balance--;
      if (balance < 0)
        break;
    }
    let prefix = template.substring(0, start3);
    let extraSymbol = 0;
    if (["sethas(", "sethasnot("].includes(hasMatch[1])) {
      extraSymbol = 1;
      prefix = prefix.replace(/sethas\($/, "has=").replace(/sethasnot\($/, "hasnot=");
    }
    const paramsCountBeforeHas = countParams(template.substring(0, start3));
    const hasTemplate = shiftParams(template.substring(start3, end), paramsCountBeforeHas);
    const paramsCountInHas = countParams(hasTemplate);
    const hasParams = params2.slice(paramsCountBeforeHas, paramsCountBeforeHas + paramsCountInHas);
    const hasSelector = JSON.stringify(transform(hasTemplate, hasParams, testIdAttributeName2));
    template = prefix.replace(/=$/, "2=") + `$${paramsCountBeforeHas + 1}` + shiftParams(template.substring(end + extraSymbol), paramsCountInHas - 1);
    const paramsBeforeHas = params2.slice(0, paramsCountBeforeHas);
    const paramsAfterHas = params2.slice(paramsCountBeforeHas + paramsCountInHas);
    params2 = paramsBeforeHas.concat([{ quote: '"', text: hasSelector }]).concat(paramsAfterHas);
  }
  template = template.replace(/\,set([\w]+)\(([^)]+)\)/g, (_, group1, group2) => "," + group1.toLowerCase() + "=" + group2.toLowerCase()).replace(/framelocator\(([^)]+)\)/g, "$1.internal:control=enter-frame").replace(/contentframe(\(\))?/g, "internal:control=enter-frame").replace(/locator\(([^)]+),hastext=([^),]+)\)/g, "locator($1).internal:has-text=$2").replace(/locator\(([^)]+),hasnottext=([^),]+)\)/g, "locator($1).internal:has-not-text=$2").replace(/locator\(([^)]+),hastext=([^),]+)\)/g, "locator($1).internal:has-text=$2").replace(/locator\(([^)]+)\)/g, "$1").replace(/getbyrole\(([^)]+)\)/g, "internal:role=$1").replace(/getbytext\(([^)]+)\)/g, "internal:text=$1").replace(/getbylabel\(([^)]+)\)/g, "internal:label=$1").replace(/getbytestid\(([^)]+)\)/g, `internal:testid=[${encodeTestIdAttributeName(testIdAttributeName2)}=$1]`).replace(/getby(placeholder|alt|title)(?:text)?\(([^)]+)\)/g, "internal:attr=[$1=$2]").replace(/first(\(\))?/g, "nth=0").replace(/last(\(\))?/g, "nth=-1").replace(/nth\(([^)]+)\)/g, "nth=$1").replace(/filter\(,?visible=true\)/g, "visible=true").replace(/filter\(,?visible=false\)/g, "visible=false").replace(/filter\(,?hastext=([^)]+)\)/g, "internal:has-text=$1").replace(/filter\(,?hasnottext=([^)]+)\)/g, "internal:has-not-text=$1").replace(/filter\(,?has2=([^)]+)\)/g, "internal:has=$1").replace(/filter\(,?hasnot2=([^)]+)\)/g, "internal:has-not=$1").replace(/,exact=false/g, "").replace(/(,name=\$\d+)(,description=\$\d+),exact=true/g, "$1s$2s").replace(/,exact=true/g, "s").replace(/,includehidden=/g, ",include-hidden=").replace(/\,/g, "][");
  const parts = template.split(".");
  for (let index = 0; index < parts.length - 1; index++) {
    if (parts[index] === "internal:control=enter-frame" && parts[index + 1].startsWith("nth=")) {
      const [nth] = parts.splice(index, 1);
      parts.splice(index + 1, 0, nth);
    }
  }
  return parts.map((t) => {
    if (!t.startsWith("internal:") || t === "internal:control")
      return t.replace(/\$(\d+)/g, (_, ordinal) => {
        const param = params2[+ordinal - 1];
        return param.text;
      });
    t = t.includes("[") ? t.replace(/\]/, "") + "]" : t;
    t = t.replace(/(?:r)\$(\d+)(i)?/g, (_, ordinal, suffix) => {
      const param = params2[+ordinal - 1];
      if (t.startsWith("internal:attr") || t.startsWith("internal:testid") || t.startsWith("internal:role"))
        return escapeForAttributeSelector(new RegExp(param.text), false) + (suffix || "");
      return escapeForTextSelector(new RegExp(param.text, suffix), false);
    }).replace(/\$(\d+)(i|s)?/g, (_, ordinal, suffix) => {
      const param = params2[+ordinal - 1];
      if (t.startsWith("internal:has=") || t.startsWith("internal:has-not="))
        return param.text;
      if (t.startsWith("internal:testid"))
        return escapeForAttributeSelector(param.text, true);
      if (t.startsWith("internal:attr") || t.startsWith("internal:role"))
        return escapeForAttributeSelector(param.text, suffix === "s");
      return escapeForTextSelector(param.text, suffix === "s");
    });
    return t;
  }).join(" >> ");
}
function locatorOrSelectorAsSelector(language, locator2, testIdAttributeName2 = "data-testid") {
  try {
    return unsafeLocatorOrSelectorAsSelector(language, locator2, testIdAttributeName2);
  } catch (e) {
    return "";
  }
}
function unsafeLocatorOrSelectorAsSelector(language, locator2, testIdAttributeName2 = "data-testid") {
  try {
    parseSelector(locator2);
    return locator2;
  } catch (e) {
  }
  const { selector, preferredQuote } = parseLocator(locator2, testIdAttributeName2);
  const locators = asLocators(language, selector, void 0, void 0, preferredQuote);
  const digest = digestForComparison(language, locator2);
  if (locators.some((candidate) => digestForComparison(language, candidate) === digest))
    return selector;
  return "";
}
function digestForComparison(language, locator2) {
  locator2 = locator2.replace(/\s/g, "");
  if (language === "javascript")
    locator2 = locator2.replace(/\\?["`]/g, "'").replace(/,{}/g, "");
  return locator2;
}
var init_locatorParser = __esm({
  "packages/isomorphic/locatorParser.ts"() {
    "use strict";
    init_locatorGenerators();
    init_locatorUtils();
    init_selectorParser();
    init_stringUtils();
  }
});

// packages/isomorphic/trace/snapshotRenderer.ts
function findClosest(items, metric, target) {
  return items.find((item, index) => {
    if (index === items.length - 1)
      return true;
    const next = items[index + 1];
    return Math.abs(metric(item) - target) < Math.abs(metric(next) - target);
  });
}
function isNodeNameAttributesChildNodesSnapshot(n) {
  return Array.isArray(n) && typeof n[0] === "string";
}
function isSubtreeReferenceSnapshot(n) {
  return Array.isArray(n) && Array.isArray(n[0]);
}
function snapshotNodes(snapshot3) {
  if (!snapshot3._nodes) {
    const nodes = [];
    const visit = (n) => {
      if (typeof n === "string") {
        nodes.push(n);
      } else if (isNodeNameAttributesChildNodesSnapshot(n)) {
        const [, , ...children] = n;
        for (const child of children)
          visit(child);
        nodes.push(n);
      }
    };
    visit(snapshot3.html);
    snapshot3._nodes = nodes;
  }
  return snapshot3._nodes;
}
function snapshotScript(viewport, ...targetIds) {
  function applyPlaywrightAttributes(blankSnapshotUrl2, viewport2, ...targetIds2) {
    const win = window;
    const searchParams = new URLSearchParams(win.location.search);
    const shouldPopulateCanvasFromScreenshot = searchParams.has("shouldPopulateCanvasFromScreenshot");
    const isUnderTest2 = searchParams.has("isUnderTest");
    const frameBoundingRectsInfo = {
      viewport: viewport2,
      frames: /* @__PURE__ */ new WeakMap()
    };
    win["__playwright_frame_bounding_rects__"] = frameBoundingRectsInfo;
    const kPointerWarningTitle = "Recorded click position in absolute coordinates did not match the center of the clicked element. This is either due to the use of provided offset, or due to a difference between the test runner and the trace viewer operating systems.";
    const scrollTops = [];
    const scrollLefts = [];
    const targetElements = [];
    const canvasElements = [];
    let topSnapshotWindow = win;
    while (topSnapshotWindow !== topSnapshotWindow.parent && !topSnapshotWindow.location.pathname.match(/\/page@[a-z0-9]+$/))
      topSnapshotWindow = topSnapshotWindow.parent;
    const visit = (root) => {
      for (const e of root.querySelectorAll(`[__playwright_scroll_top_]`))
        scrollTops.push(e);
      for (const e of root.querySelectorAll(`[__playwright_scroll_left_]`))
        scrollLefts.push(e);
      for (const element2 of root.querySelectorAll(`[__playwright_value_]`)) {
        const inputElement = element2;
        if (inputElement.type !== "file")
          inputElement.value = inputElement.getAttribute("__playwright_value_");
        element2.removeAttribute("__playwright_value_");
      }
      for (const element2 of root.querySelectorAll(`[__playwright_checked_]`)) {
        element2.checked = element2.getAttribute("__playwright_checked_") === "true";
        element2.removeAttribute("__playwright_checked_");
      }
      for (const element2 of root.querySelectorAll(`[__playwright_selected_]`)) {
        element2.selected = element2.getAttribute("__playwright_selected_") === "true";
        element2.removeAttribute("__playwright_selected_");
      }
      for (const element2 of root.querySelectorAll(`[__playwright_popover_open_]`)) {
        try {
          element2.showPopover();
        } catch {
        }
        element2.removeAttribute("__playwright_popover_open_");
      }
      for (const element2 of root.querySelectorAll(`[__playwright_dialog_open_]`)) {
        try {
          if (element2.getAttribute("__playwright_dialog_open_") === "modal")
            element2.showModal();
          else
            element2.show();
        } catch {
        }
        element2.removeAttribute("__playwright_dialog_open_");
      }
      const highlightTarget = (target) => {
        const style = target.style;
        style.outline = "2px solid #006ab1";
        style.backgroundColor = "#6fa8dc7f";
        targetElements.push(target);
      };
      for (const target of root.querySelectorAll(`[__playwright_target__=""]`))
        highlightTarget(target);
      for (const targetId of targetIds2) {
        if (!targetId)
          continue;
        for (const target of root.querySelectorAll(`[__playwright_target__="${targetId}"]`))
          highlightTarget(target);
      }
      for (const iframe of root.querySelectorAll("iframe, frame")) {
        const boundingRectJson = iframe.getAttribute("__playwright_bounding_rect__");
        iframe.removeAttribute("__playwright_bounding_rect__");
        const boundingRect = boundingRectJson ? JSON.parse(boundingRectJson) : void 0;
        if (boundingRect)
          frameBoundingRectsInfo.frames.set(iframe, { boundingRect, scrollLeft: 0, scrollTop: 0 });
        const src = iframe.getAttribute("__playwright_src__");
        if (!src) {
          iframe.setAttribute("src", blankSnapshotUrl2);
        } else {
          const url2 = new URL(win.location.href);
          const index = url2.pathname.lastIndexOf("/snapshot/");
          if (index !== -1)
            url2.pathname = url2.pathname.substring(0, index + 1);
          url2.pathname += src.substring(1);
          iframe.setAttribute("src", url2.toString());
        }
      }
      {
        const body = root.querySelector(`body[__playwright_custom_elements__]`);
        if (body && win.customElements) {
          const customElements = (body.getAttribute("__playwright_custom_elements__") || "").split(",");
          for (const elementName of customElements)
            win.customElements.define(elementName, class extends HTMLElement {
            });
        }
      }
      for (const element2 of root.querySelectorAll(`template[__playwright_shadow_root_]`)) {
        const template = element2;
        const shadowRoot = template.parentElement.attachShadow({ mode: "open" });
        shadowRoot.appendChild(template.content);
        template.remove();
        visit(shadowRoot);
      }
      for (const element2 of root.querySelectorAll("a"))
        element2.addEventListener("click", (event) => {
          event.preventDefault();
        });
      if ("adoptedStyleSheets" in root) {
        const adoptedSheets = [...root.adoptedStyleSheets];
        for (const element2 of root.querySelectorAll(`template[__playwright_style_sheet_]`)) {
          const template = element2;
          const sheet = new CSSStyleSheet();
          sheet.replaceSync(template.getAttribute("__playwright_style_sheet_"));
          adoptedSheets.push(sheet);
        }
        root.adoptedStyleSheets = adoptedSheets;
      }
      canvasElements.push(...root.querySelectorAll("canvas"));
    };
    const onLoad = () => {
      win.removeEventListener("load", onLoad);
      for (const element2 of scrollTops) {
        element2.scrollTop = +element2.getAttribute("__playwright_scroll_top_");
        element2.removeAttribute("__playwright_scroll_top_");
        if (frameBoundingRectsInfo.frames.has(element2))
          frameBoundingRectsInfo.frames.get(element2).scrollTop = element2.scrollTop;
      }
      for (const element2 of scrollLefts) {
        element2.scrollLeft = +element2.getAttribute("__playwright_scroll_left_");
        element2.removeAttribute("__playwright_scroll_left_");
        if (frameBoundingRectsInfo.frames.has(element2))
          frameBoundingRectsInfo.frames.get(element2).scrollLeft = element2.scrollLeft;
      }
      win.document.styleSheets[0].disabled = true;
      const search = new URL(win.location.href).searchParams;
      const isTopFrame = win === topSnapshotWindow;
      if (isTopFrame && search.get("pointX") && search.get("pointY")) {
        const pointX = +search.get("pointX");
        const pointY = +search.get("pointY");
        const pointElement = win.document.createElement("x-pw-pointer");
        pointElement.style.position = "fixed";
        pointElement.style.backgroundColor = "#f44336";
        pointElement.style.width = "20px";
        pointElement.style.height = "20px";
        pointElement.style.borderRadius = "10px";
        pointElement.style.margin = "-10px 0 0 -10px";
        pointElement.style.zIndex = "2147483646";
        pointElement.style.display = "flex";
        pointElement.style.alignItems = "center";
        pointElement.style.justifyContent = "center";
        const target = targetElements[0];
        const targetBox = target?.getBoundingClientRect();
        const targetCenter = target ? { x: targetBox.left + targetBox.width / 2, y: targetBox.top + targetBox.height / 2 } : null;
        pointElement.style.left = (targetCenter?.x ?? pointX) + "px";
        pointElement.style.top = (targetCenter?.y ?? pointY) + "px";
        const isAligned = !targetCenter || Math.abs(targetCenter.x - pointX) <= 10 && Math.abs(targetCenter.y - pointY) <= 10;
        if (!isAligned) {
          const warningElement = win.document.createElement("x-pw-pointer-warning");
          warningElement.textContent = "\u26A0";
          warningElement.style.fontSize = "19px";
          warningElement.style.color = "white";
          warningElement.style.marginTop = "-3.5px";
          warningElement.style.userSelect = "none";
          pointElement.appendChild(warningElement);
          pointElement.setAttribute("title", kPointerWarningTitle);
        }
        win.document.documentElement.appendChild(pointElement);
      }
      if (canvasElements.length > 0) {
        let drawCheckerboard2 = function(context2, canvas) {
          function createCheckerboardPattern() {
            const pattern = win.document.createElement("canvas");
            pattern.width = pattern.width / Math.floor(pattern.width / 24);
            pattern.height = pattern.height / Math.floor(pattern.height / 24);
            const context3 = pattern.getContext("2d");
            context3.fillStyle = "lightgray";
            context3.fillRect(0, 0, pattern.width, pattern.height);
            context3.fillStyle = "white";
            context3.fillRect(0, 0, pattern.width / 2, pattern.height / 2);
            context3.fillRect(pattern.width / 2, pattern.height / 2, pattern.width, pattern.height);
            return context3.createPattern(pattern, "repeat");
          }
          context2.fillStyle = createCheckerboardPattern();
          context2.fillRect(0, 0, canvas.width, canvas.height);
        };
        var drawCheckerboard = drawCheckerboard2;
        const img = new Image();
        img.onload = () => {
          for (const canvas of canvasElements) {
            const context2 = canvas.getContext("2d");
            const boundingRectAttribute = canvas.getAttribute("__playwright_bounding_rect__");
            canvas.removeAttribute("__playwright_bounding_rect__");
            if (!boundingRectAttribute)
              continue;
            let boundingRect;
            try {
              boundingRect = JSON.parse(boundingRectAttribute);
            } catch (e) {
              continue;
            }
            let currWindow = win;
            while (currWindow !== topSnapshotWindow) {
              const iframe = currWindow.frameElement;
              currWindow = currWindow.parent;
              const iframeInfo = currWindow["__playwright_frame_bounding_rects__"]?.frames.get(iframe);
              if (!iframeInfo?.boundingRect)
                break;
              const leftOffset = iframeInfo.boundingRect.left - iframeInfo.scrollLeft;
              const topOffset = iframeInfo.boundingRect.top - iframeInfo.scrollTop;
              boundingRect.left += leftOffset;
              boundingRect.top += topOffset;
              boundingRect.right += leftOffset;
              boundingRect.bottom += topOffset;
            }
            const { width, height } = topSnapshotWindow["__playwright_frame_bounding_rects__"].viewport;
            boundingRect.left = boundingRect.left / width;
            boundingRect.top = boundingRect.top / height;
            boundingRect.right = boundingRect.right / width;
            boundingRect.bottom = boundingRect.bottom / height;
            const partiallyUncaptured = boundingRect.right > 1 || boundingRect.bottom > 1;
            const fullyUncaptured = boundingRect.left > 1 || boundingRect.top > 1;
            if (fullyUncaptured) {
              canvas.title = `Playwright couldn't capture canvas contents because it's located outside the viewport.`;
              continue;
            }
            drawCheckerboard2(context2, canvas);
            if (shouldPopulateCanvasFromScreenshot) {
              context2.drawImage(img, boundingRect.left * img.width, boundingRect.top * img.height, (boundingRect.right - boundingRect.left) * img.width, (boundingRect.bottom - boundingRect.top) * img.height, 0, 0, canvas.width, canvas.height);
              if (partiallyUncaptured)
                canvas.title = `Playwright couldn't capture full canvas contents because it's located partially outside the viewport.`;
              else
                canvas.title = `Canvas contents are displayed on a best-effort basis based on viewport screenshots taken during test execution.`;
            } else {
              canvas.title = "Canvas content display is disabled.";
            }
            if (isUnderTest2)
              console.log(`canvas drawn:`, JSON.stringify([boundingRect.left, boundingRect.top, boundingRect.right - boundingRect.left, boundingRect.bottom - boundingRect.top].map((v) => Math.floor(v * 100))));
          }
        };
        img.onerror = () => {
          for (const canvas of canvasElements) {
            const context2 = canvas.getContext("2d");
            drawCheckerboard2(context2, canvas);
            canvas.title = `Playwright couldn't show canvas contents because the screenshot failed to load.`;
          }
        };
        img.src = location.href.replace("/snapshot", "/closest-screenshot");
      }
    };
    const onDOMContentLoaded = () => visit(win.document);
    win.addEventListener("load", onLoad);
    win.addEventListener("DOMContentLoaded", onDOMContentLoaded);
  }
  const safe = (value2) => JSON.stringify(value2).replace(/</g, "\\u003c");
  return `
(${applyPlaywrightAttributes.toString()})(${safe(blankSnapshotUrl)},${safe(viewport)}${targetIds.map((id) => `, ${safe(String(id))}`).join("")})`;
}
function rewriteURLForCustomProtocol(href) {
  if (href.startsWith(kLegacyBlobPrefix))
    href = href.substring(kLegacyBlobPrefix.length);
  try {
    const url2 = new URL(href);
    if (url2.protocol === "javascript:" || url2.protocol === "vbscript:")
      return "javascript:void(0)";
    const isBlob = url2.protocol === "blob:";
    const isFile = url2.protocol === "file:";
    if (!isBlob && !isFile && schemas.includes(url2.protocol))
      return href;
    const prefix = "pw-" + url2.protocol.slice(0, url2.protocol.length - 1);
    if (!isFile)
      url2.protocol = "https:";
    url2.hostname = url2.hostname ? `${prefix}--${url2.hostname}` : prefix;
    if (isFile) {
      url2.protocol = "https:";
    }
    return url2.toString();
  } catch {
    return href;
  }
}
function rewriteURLsInStyleSheetForCustomProtocol(text2) {
  return text2.replace(urlInCSSRegex, (match, protocol) => {
    const isBlob = protocol === "blob:";
    const isFile = protocol === "file:";
    if (!isBlob && !isFile && schemas.includes(protocol))
      return match;
    return match.replace(protocol + "//", `https://pw-${protocol.slice(0, -1)}--`);
  });
}
function escapeURLsInStyleSheet(text2) {
  const replacer = (match, url2) => {
    if (url2.includes("</"))
      return match.replace(url2, encodeURI(url2));
    return match;
  };
  return text2.replace(urlToEscapeRegex1, replacer).replace(urlToEscapeRegex2, replacer);
}
var SnapshotRenderer, autoClosing, kAllowedMetaHttpEquivs, schemas, kLegacyBlobPrefix, urlInCSSRegex, urlToEscapeRegex1, urlToEscapeRegex2, blankSnapshotUrl;
var init_snapshotRenderer = __esm({
  "packages/isomorphic/trace/snapshotRenderer.ts"() {
    "use strict";
    init_stringUtils();
    SnapshotRenderer = class {
      constructor(htmlCache, resources, snapshots, screencastFrames, index) {
        this._htmlCache = htmlCache;
        this._resources = resources;
        this._snapshots = snapshots;
        this._index = index;
        this._snapshot = snapshots[index];
        this._callId = snapshots[index].callId;
        this._screencastFrames = screencastFrames;
        this.snapshotName = snapshots[index].snapshotName;
      }
      snapshot() {
        return this._snapshots[this._index];
      }
      viewport() {
        return this._snapshots[this._index].viewport;
      }
      closestScreenshot() {
        const { wallTime, timestamp } = this.snapshot();
        const closestFrame = wallTime && this._screencastFrames[0]?.frameSwapWallTime ? findClosest(this._screencastFrames, (frame) => frame.frameSwapWallTime, wallTime) : findClosest(this._screencastFrames, (frame) => frame.timestamp, timestamp);
        return closestFrame?.sha1;
      }
      render() {
        const result2 = [];
        const visit = (n, snapshotIndex, parentTag, parentAttrs) => {
          if (typeof n === "string") {
            if (parentTag === "STYLE" || parentTag === "style")
              result2.push(escapeURLsInStyleSheet(rewriteURLsInStyleSheetForCustomProtocol(n)));
            else
              result2.push(escapeHTML(n));
            return;
          }
          if (isSubtreeReferenceSnapshot(n)) {
            const referenceIndex = snapshotIndex - n[0][0];
            if (referenceIndex >= 0 && referenceIndex <= snapshotIndex) {
              const nodes = snapshotNodes(this._snapshots[referenceIndex]);
              const nodeIndex = n[0][1];
              if (nodeIndex >= 0 && nodeIndex < nodes.length)
                return visit(nodes[nodeIndex], referenceIndex, parentTag, parentAttrs);
            }
          } else if (isNodeNameAttributesChildNodesSnapshot(n)) {
            const [name, nodeAttrs, ...children] = n;
            if (name.toUpperCase() === "SCRIPT")
              return;
            const upperName = name.toUpperCase();
            const nodeName = upperName === "NOSCRIPT" ? "X-NOSCRIPT" : name;
            const attrs = Object.entries(nodeAttrs || {});
            result2.push("<", nodeName);
            const kCurrentSrcAttribute = "__playwright_current_src__";
            const isFrame = upperName === "IFRAME" || upperName === "FRAME";
            const isAnchor = upperName === "A";
            const isImg = upperName === "IMG";
            const isMeta = upperName === "META";
            const isImgWithCurrentSrc = isImg && attrs.some((a) => a[0] === kCurrentSrcAttribute);
            const isSourceInsidePictureWithCurrentSrc = upperName === "SOURCE" && parentTag === "PICTURE" && parentAttrs?.some((a) => a[0] === kCurrentSrcAttribute);
            const hasUnsafeHttpEquiv = isMeta && attrs.some((a) => a[0].toLowerCase() === "http-equiv" && !kAllowedMetaHttpEquivs.has(a[1].trim().toLowerCase()));
            for (const [attr, value2] of attrs) {
              let attrName = attr;
              if (attr.toLowerCase().startsWith("on"))
                continue;
              if (isFrame && attr.toLowerCase() === "src") {
                attrName = "__playwright_src__";
              }
              if (isFrame && (attr.toLowerCase() === "srcdoc" || attr.toLowerCase() === "sandbox")) {
                attrName = "__playwright_" + attr.toLowerCase() + "__";
              }
              if (upperName === "OBJECT" && attr.toLowerCase() === "data")
                attrName = "__playwright_data__";
              if (upperName === "EMBED" && attr.toLowerCase() === "src")
                attrName = "__playwright_src__";
              if (isImg && attr === kCurrentSrcAttribute) {
                attrName = "src";
              }
              if (["src", "srcset"].includes(attr.toLowerCase()) && (isImgWithCurrentSrc || isSourceInsidePictureWithCurrentSrc)) {
                attrName = "_" + attrName;
              }
              if (hasUnsafeHttpEquiv && (attr.toLowerCase() === "http-equiv" || attr.toLowerCase() === "content")) {
                attrName = "_" + attr;
              }
              let attrValue = value2;
              if (!isAnchor && (attr.toLowerCase() === "href" || attr.toLowerCase() === "src" || attr === kCurrentSrcAttribute))
                attrValue = rewriteURLForCustomProtocol(value2);
              result2.push(" ", attrName, '="', escapeHTMLAttribute(attrValue), '"');
            }
            result2.push(">");
            for (const child of children)
              visit(child, snapshotIndex, nodeName, attrs);
            if (!autoClosing.has(nodeName))
              result2.push("</", nodeName, ">");
            return;
          } else {
            return;
          }
        };
        const snapshot3 = this._snapshot;
        const html = this._htmlCache.getOrCompute(this, () => {
          visit(snapshot3.html, this._index, void 0, void 0);
          const safeDoctype = snapshot3.doctype?.replace(/[^a-zA-Z0-9]/g, "");
          const prefix = safeDoctype ? `<!DOCTYPE ${safeDoctype}>` : "";
          const html2 = prefix + [
            // Hide the document in order to prevent flickering. We will unhide once script has processed shadow.
            "<style>*,*::before,*::after { visibility: hidden }</style>",
            `<script>${snapshotScript(this.viewport(), this._callId, this.snapshotName)}</script>`
          ].join("") + result2.join("");
          return { value: html2, size: html2.length };
        });
        return { html, pageId: snapshot3.pageId, frameId: snapshot3.frameId, index: this._index };
      }
      resourceByUrl(url2, method) {
        const snapshot3 = this._snapshot;
        let sameFrameResource;
        let otherFrameResource;
        for (const resource of this._resources) {
          if (typeof resource._monotonicTime === "number" && resource._monotonicTime >= snapshot3.timestamp)
            break;
          if (resource.response.status === 304) {
            continue;
          }
          if (resource.request.url === url2 && resource.request.method === method) {
            if (resource._frameref === snapshot3.frameId)
              sameFrameResource = resource;
            else
              otherFrameResource = resource;
          }
        }
        let result2 = sameFrameResource ?? otherFrameResource;
        if (result2 && method.toUpperCase() === "GET") {
          let override = snapshot3.resourceOverrides.find((o) => o.url === url2);
          if (override?.ref) {
            const index = this._index - override.ref;
            if (index >= 0 && index < this._snapshots.length)
              override = this._snapshots[index].resourceOverrides.find((o) => o.url === url2);
          }
          if (override?.sha1) {
            result2 = {
              ...result2,
              response: {
                ...result2.response,
                content: {
                  ...result2.response.content,
                  _sha1: override.sha1
                }
              }
            };
          }
        }
        return result2;
      }
    };
    autoClosing = /* @__PURE__ */ new Set(["AREA", "BASE", "BR", "COL", "COMMAND", "EMBED", "HR", "IMG", "INPUT", "KEYGEN", "LINK", "MENUITEM", "META", "PARAM", "SOURCE", "TRACK", "WBR"]);
    kAllowedMetaHttpEquivs = /* @__PURE__ */ new Set(["content-type", "content-language", "default-style", "x-ua-compatible"]);
    schemas = ["about:", "blob:", "data:", "file:", "ftp:", "http:", "https:", "mailto:", "sftp:", "ws:", "wss:"];
    kLegacyBlobPrefix = "http://playwright.bloburl/#";
    urlInCSSRegex = /url\(['"]?([\w-]+:)\/\//ig;
    urlToEscapeRegex1 = /url\(\s*'([^']*)'\s*\)/ig;
    urlToEscapeRegex2 = /url\(\s*"([^"]*)"\s*\)/ig;
    blankSnapshotUrl = "data:text/html;base64," + btoa(`<body></body><style>body { color-scheme: light dark; background: light-dark(white, #333) }</style>`);
  }
});

// packages/isomorphic/lruCache.ts
var LRUCache;
var init_lruCache = __esm({
  "packages/isomorphic/lruCache.ts"() {
    "use strict";
    LRUCache = class {
      constructor(maxSize) {
        this._maxSize = maxSize;
        this._map = /* @__PURE__ */ new Map();
        this._size = 0;
      }
      getOrCompute(key, compute) {
        if (this._map.has(key)) {
          const result3 = this._map.get(key);
          this._map.delete(key);
          this._map.set(key, result3);
          return result3.value;
        }
        const result2 = compute();
        while (this._map.size && this._size + result2.size > this._maxSize) {
          const [firstKey, firstValue] = this._map.entries().next().value;
          this._size -= firstValue.size;
          this._map.delete(firstKey);
        }
        this._map.set(key, result2);
        this._size += result2.size;
        return result2.value;
      }
    };
  }
});

// packages/isomorphic/trace/snapshotStorage.ts
var SnapshotStorage;
var init_snapshotStorage = __esm({
  "packages/isomorphic/trace/snapshotStorage.ts"() {
    "use strict";
    init_snapshotRenderer();
    init_lruCache();
    SnapshotStorage = class {
      constructor() {
        this._frameSnapshots = /* @__PURE__ */ new Map();
        this._cache = new LRUCache(1e8);
        // 100MB per each trace
        this._contextToResources = /* @__PURE__ */ new Map();
        this._resourceUrlsWithOverrides = /* @__PURE__ */ new Set();
      }
      addResource(contextId4, resource) {
        resource.request.url = rewriteURLForCustomProtocol(resource.request.url);
        this._ensureResourcesForContext(contextId4).push(resource);
      }
      addFrameSnapshot(contextId4, snapshot3, screencastFrames) {
        for (const override of snapshot3.resourceOverrides)
          override.url = rewriteURLForCustomProtocol(override.url);
        let frameSnapshots = this._frameSnapshots.get(snapshot3.frameId);
        if (!frameSnapshots) {
          frameSnapshots = {
            raw: [],
            renderers: []
          };
          this._frameSnapshots.set(snapshot3.frameId, frameSnapshots);
          if (snapshot3.isMainFrame)
            this._frameSnapshots.set(snapshot3.pageId, frameSnapshots);
        }
        frameSnapshots.raw.push(snapshot3);
        const resources = this._ensureResourcesForContext(contextId4);
        const renderer = new SnapshotRenderer(this._cache, resources, frameSnapshots.raw, screencastFrames, frameSnapshots.raw.length - 1);
        frameSnapshots.renderers.push(renderer);
        return renderer;
      }
      snapshotByName(pageOrFrameId, snapshotName) {
        const snapshot3 = this._frameSnapshots.get(pageOrFrameId);
        return snapshot3?.renderers.find((r) => r.snapshotName === snapshotName);
      }
      snapshotsForTest() {
        return [...this._frameSnapshots.keys()];
      }
      finalize() {
        for (const resources of this._contextToResources.values())
          resources.sort((a, b) => (a._monotonicTime || 0) - (b._monotonicTime || 0));
        for (const frameSnapshots of this._frameSnapshots.values()) {
          for (const snapshot3 of frameSnapshots.raw) {
            for (const override of snapshot3.resourceOverrides)
              this._resourceUrlsWithOverrides.add(override.url);
          }
        }
      }
      hasResourceOverride(url2) {
        return this._resourceUrlsWithOverrides.has(url2);
      }
      _ensureResourcesForContext(contextId4) {
        let resources = this._contextToResources.get(contextId4);
        if (!resources) {
          resources = [];
          this._contextToResources.set(contextId4, resources);
        }
        return resources;
      }
    };
  }
});

// packages/isomorphic/trace/traceUtils.ts
function parseClientSideCallMetadata(data) {
  const result2 = /* @__PURE__ */ new Map();
  const { files, stacks } = data;
  for (const s of stacks) {
    const [id, ff] = s;
    result2.set(`call@${id}`, ff.map((f) => ({ file: files[f[0]], line: f[1], column: f[2], function: f[3] })));
  }
  return result2;
}
function serializeClientSideCallMetadata(metadatas) {
  const fileNames = /* @__PURE__ */ new Map();
  const stacks = [];
  for (const m of metadatas) {
    if (!m.stack || !m.stack.length)
      continue;
    const stack = [];
    for (const frame of m.stack) {
      let ordinal = fileNames.get(frame.file);
      if (typeof ordinal !== "number") {
        ordinal = fileNames.size;
        fileNames.set(frame.file, ordinal);
      }
      const stackFrame = [ordinal, frame.line || 0, frame.column || 0, frame.function || ""];
      stack.push(stackFrame);
    }
    stacks.push([m.id, stack]);
  }
  return { files: [...fileNames.keys()], stacks };
}
var init_traceUtils = __esm({
  "packages/isomorphic/trace/traceUtils.ts"() {
    "use strict";
  }
});

// packages/isomorphic/trace/traceModernizer.ts
var TraceVersionError, latestVersion, TraceModernizer;
var init_traceModernizer = __esm({
  "packages/isomorphic/trace/traceModernizer.ts"() {
    "use strict";
    TraceVersionError = class extends Error {
      constructor(message) {
        super(message);
        this.name = "TraceVersionError";
      }
    };
    latestVersion = 8;
    TraceModernizer = class {
      constructor(contextEntry, snapshotStorage) {
        this._actionMap = /* @__PURE__ */ new Map();
        this._pageEntries = /* @__PURE__ */ new Map();
        this._jsHandles = /* @__PURE__ */ new Map();
        this._consoleObjects = /* @__PURE__ */ new Map();
        this._contextEntry = contextEntry;
        this._snapshotStorage = snapshotStorage;
      }
      appendTrace(trace) {
        for (const line of trace.split("\n"))
          this._appendEvent(line);
      }
      actions() {
        return [...this._actionMap.values()];
      }
      _pageEntry(pageId4) {
        let pageEntry = this._pageEntries.get(pageId4);
        if (!pageEntry) {
          pageEntry = {
            pageId: pageId4,
            screencastFrames: []
          };
          this._pageEntries.set(pageId4, pageEntry);
          this._contextEntry.pages.push(pageEntry);
        }
        return pageEntry;
      }
      _appendEvent(line) {
        if (!line)
          return;
        const events = this._modernize(JSON.parse(line));
        for (const event of events)
          this._innerAppendEvent(event);
      }
      _innerAppendEvent(event) {
        const contextEntry = this._contextEntry;
        switch (event.type) {
          case "context-options": {
            if (event.version > latestVersion)
              throw new TraceVersionError("The trace was created by a newer version of Playwright and is not supported by this version of the viewer. Please use latest Playwright to open the trace.");
            this._version = event.version;
            contextEntry.origin = event.origin;
            contextEntry.browserName = event.browserName;
            contextEntry.channel = event.channel;
            contextEntry.title = event.title;
            contextEntry.platform = event.platform;
            contextEntry.playwrightVersion = event.playwrightVersion;
            contextEntry.wallTime = event.wallTime;
            contextEntry.startTime = event.monotonicTime;
            contextEntry.sdkLanguage = event.sdkLanguage;
            contextEntry.options = event.options;
            contextEntry.testIdAttributeName = event.testIdAttributeName;
            contextEntry.contextId = event.contextId ?? "";
            contextEntry.testTimeout = event.testTimeout;
            break;
          }
          case "screencast-frame": {
            this._pageEntry(event.pageId).screencastFrames.push(event);
            break;
          }
          case "before": {
            this._actionMap.set(event.callId, { ...event, type: "action", endTime: 0, log: [] });
            break;
          }
          case "input": {
            const existing = this._actionMap.get(event.callId);
            existing.inputSnapshot = event.inputSnapshot;
            existing.point = event.point;
            break;
          }
          case "log": {
            const existing = this._actionMap.get(event.callId);
            if (!existing)
              return;
            existing.log.push({
              time: event.time,
              message: event.message
            });
            break;
          }
          case "after": {
            const existing = this._actionMap.get(event.callId);
            existing.afterSnapshot = event.afterSnapshot;
            existing.endTime = event.endTime;
            existing.result = event.result;
            existing.error = event.error;
            existing.attachments = event.attachments;
            existing.annotations = event.annotations;
            if (event.point)
              existing.point = event.point;
            break;
          }
          case "action": {
            this._actionMap.set(event.callId, { ...event, log: [] });
            break;
          }
          case "event": {
            contextEntry.events.push(event);
            break;
          }
          case "stdout": {
            contextEntry.stdio.push(event);
            break;
          }
          case "stderr": {
            contextEntry.stdio.push(event);
            break;
          }
          case "error": {
            contextEntry.errors.push(event);
            break;
          }
          case "console": {
            contextEntry.events.push(event);
            break;
          }
          case "resource-snapshot":
            this._snapshotStorage.addResource(this._contextEntry.contextId, event.snapshot);
            contextEntry.resources.push(event.snapshot);
            break;
          case "frame-snapshot":
            this._snapshotStorage.addFrameSnapshot(this._contextEntry.contextId, event.snapshot, this._pageEntry(event.snapshot.pageId).screencastFrames);
            break;
        }
        if ("pageId" in event && event.pageId)
          this._pageEntry(event.pageId);
        if (event.type === "action" || event.type === "before")
          contextEntry.startTime = Math.min(contextEntry.startTime, event.startTime);
        if (event.type === "action" || event.type === "after")
          contextEntry.endTime = Math.max(contextEntry.endTime, event.endTime);
        if (event.type === "event") {
          contextEntry.startTime = Math.min(contextEntry.startTime, event.time);
          contextEntry.endTime = Math.max(contextEntry.endTime, event.time);
        }
        if (event.type === "screencast-frame") {
          contextEntry.startTime = Math.min(contextEntry.startTime, event.timestamp);
          contextEntry.endTime = Math.max(contextEntry.endTime, event.timestamp);
        }
      }
      _processedContextCreatedEvent() {
        return this._version !== void 0;
      }
      _modernize(event) {
        let version3 = this._version ?? event.version ?? 6;
        let events = [event];
        for (; version3 < latestVersion; ++version3)
          events = this[`_modernize_${version3}_to_${version3 + 1}`].call(this, events);
        return events;
      }
      _modernize_0_to_1(events) {
        for (const event of events) {
          if (event.type !== "action")
            continue;
          if (typeof event.metadata.error === "string")
            event.metadata.error = { error: { name: "Error", message: event.metadata.error } };
        }
        return events;
      }
      _modernize_1_to_2(events) {
        for (const event of events) {
          if (event.type !== "frame-snapshot" || !event.snapshot.isMainFrame)
            continue;
          event.snapshot.viewport = this._contextEntry.options?.viewport || { width: 1280, height: 720 };
        }
        return events;
      }
      _modernize_2_to_3(events) {
        for (const event of events) {
          if (event.type !== "resource-snapshot" || event.snapshot.request)
            continue;
          const resource = event.snapshot;
          event.snapshot = {
            _frameref: resource.frameId,
            request: {
              url: resource.url,
              method: resource.method,
              headers: resource.requestHeaders,
              postData: resource.requestSha1 ? { _sha1: resource.requestSha1 } : void 0
            },
            response: {
              status: resource.status,
              headers: resource.responseHeaders,
              content: {
                mimeType: resource.contentType,
                _sha1: resource.responseSha1
              }
            },
            _monotonicTime: resource.timestamp
          };
        }
        return events;
      }
      _modernize_3_to_4(events) {
        const result2 = [];
        for (const event of events) {
          const e = this._modernize_event_3_to_4(event);
          if (e)
            result2.push(e);
        }
        return result2;
      }
      _modernize_event_3_to_4(event) {
        if (event.type !== "action" && event.type !== "event") {
          return event;
        }
        const metadata = event.metadata;
        if (metadata.internal || metadata.method.startsWith("tracing"))
          return null;
        if (event.type === "event") {
          if (metadata.method === "__create__" && metadata.type === "ConsoleMessage") {
            return {
              type: "object",
              class: metadata.type,
              guid: metadata.params.guid,
              initializer: metadata.params.initializer
            };
          }
          return {
            type: "event",
            time: metadata.startTime,
            class: metadata.type,
            method: metadata.method,
            params: metadata.params,
            pageId: metadata.pageId
          };
        }
        return {
          type: "action",
          callId: metadata.id,
          startTime: metadata.startTime,
          endTime: metadata.endTime,
          apiName: metadata.apiName || metadata.type + "." + metadata.method,
          class: metadata.type,
          method: metadata.method,
          params: metadata.params,
          // eslint-disable-next-line no-restricted-globals
          wallTime: metadata.wallTime || Date.now(),
          log: metadata.log,
          beforeSnapshot: metadata.snapshots.find((s) => s.title === "before")?.snapshotName,
          inputSnapshot: metadata.snapshots.find((s) => s.title === "input")?.snapshotName,
          afterSnapshot: metadata.snapshots.find((s) => s.title === "after")?.snapshotName,
          error: metadata.error?.error,
          result: metadata.result,
          point: metadata.point,
          pageId: metadata.pageId
        };
      }
      _modernize_4_to_5(events) {
        const result2 = [];
        for (const event of events) {
          const e = this._modernize_event_4_to_5(event);
          if (e)
            result2.push(e);
        }
        return result2;
      }
      _modernize_event_4_to_5(event) {
        if (event.type === "event" && event.method === "__create__" && event.class === "JSHandle")
          this._jsHandles.set(event.params.guid, event.params.initializer);
        if (event.type === "object") {
          if (event.class !== "ConsoleMessage")
            return null;
          const args = event.initializer.args?.map((arg) => {
            if (arg.guid) {
              const handle = this._jsHandles.get(arg.guid);
              return { preview: handle?.preview || "", value: "" };
            }
            return { preview: arg.preview || "", value: arg.value || "" };
          });
          this._consoleObjects.set(event.guid, {
            type: event.initializer.type,
            text: event.initializer.text,
            location: event.initializer.location,
            args
          });
          return null;
        }
        if (event.type === "event" && event.method === "console") {
          const consoleMessage = this._consoleObjects.get(event.params.message?.guid || "");
          if (!consoleMessage)
            return null;
          return {
            type: "console",
            time: event.time,
            pageId: event.pageId,
            messageType: consoleMessage.type,
            text: consoleMessage.text,
            args: consoleMessage.args,
            location: consoleMessage.location
          };
        }
        return event;
      }
      _modernize_5_to_6(events) {
        const result2 = [];
        for (const event of events) {
          result2.push(event);
          if (event.type !== "after" || !event.log.length)
            continue;
          for (const log2 of event.log) {
            result2.push({
              type: "log",
              callId: event.callId,
              message: log2,
              time: -1
            });
          }
        }
        return result2;
      }
      _modernize_6_to_7(events) {
        const result2 = [];
        if (!this._processedContextCreatedEvent() && events[0].type !== "context-options") {
          const event = {
            type: "context-options",
            origin: "testRunner",
            version: 6,
            browserName: "",
            options: {},
            platform: "unknown",
            wallTime: 0,
            monotonicTime: 0,
            sdkLanguage: "javascript",
            contextId: ""
          };
          result2.push(event);
        }
        for (const event of events) {
          if (event.type === "context-options") {
            result2.push({ ...event, monotonicTime: 0, origin: "library", contextId: "" });
            continue;
          }
          if (event.type === "before" || event.type === "action") {
            if (!this._contextEntry.wallTime)
              this._contextEntry.wallTime = event.wallTime;
            const eventAsV6 = event;
            const eventAsV7 = event;
            eventAsV7.stepId = `${eventAsV6.apiName}@${eventAsV6.wallTime}`;
            result2.push(eventAsV7);
          } else {
            result2.push(event);
          }
        }
        return result2;
      }
      _modernize_7_to_8(events) {
        const result2 = [];
        for (const event of events) {
          if (event.type === "before" || event.type === "action") {
            const eventAsV7 = event;
            const eventAsV8 = event;
            if (eventAsV7.apiName) {
              eventAsV8.title = eventAsV7.apiName;
              delete eventAsV8.apiName;
            }
            eventAsV8.stepId = eventAsV7.stepId ?? eventAsV7.callId;
            result2.push(eventAsV8);
          } else {
            result2.push(event);
          }
        }
        return result2;
      }
    };
  }
});

// packages/isomorphic/trace/traceLoader.ts
function stripEncodingFromContentType(contentType) {
  const charset = contentType.match(/^(.*);\s*charset=.*$/);
  if (charset)
    return charset[1];
  return contentType;
}
function createEmptyContext() {
  return {
    origin: "testRunner",
    startTime: Number.MAX_SAFE_INTEGER,
    wallTime: Number.MAX_SAFE_INTEGER,
    endTime: 0,
    browserName: "",
    options: {
      deviceScaleFactor: 1,
      isMobile: false,
      viewport: { width: 1280, height: 800 }
    },
    pages: [],
    resources: [],
    actions: [],
    events: [],
    errors: [],
    stdio: [],
    hasSource: false,
    contextId: ""
  };
}
var TraceLoader;
var init_traceLoader = __esm({
  "packages/isomorphic/trace/traceLoader.ts"() {
    "use strict";
    init_traceUtils();
    init_snapshotStorage();
    init_traceModernizer();
    TraceLoader = class {
      constructor() {
        this.contextEntries = [];
        this._resourceToContentType = /* @__PURE__ */ new Map();
      }
      async load(backend, traceFile, unzipProgress) {
        this._backend = backend;
        const prefix = traceFile?.match(/(.+)\.trace$/)?.[1];
        const prefixes = [];
        let hasSource = false;
        for (const entryName of await this._backend.entryNames()) {
          const match = entryName.match(/(.+)\.trace$/);
          if (match && (!prefix || prefix === match[1]))
            prefixes.push(match[1] || "");
          if (entryName.includes("src@"))
            hasSource = true;
        }
        if (!prefixes.length)
          throw new Error("Cannot find .trace file");
        this._snapshotStorage = new SnapshotStorage();
        const total = prefixes.length * 3;
        let done = 0;
        for (const prefix2 of prefixes) {
          const contextEntry = createEmptyContext();
          contextEntry.hasSource = hasSource;
          const modernizer = new TraceModernizer(contextEntry, this._snapshotStorage);
          const trace = await this._backend.readText(prefix2 + ".trace") || "";
          modernizer.appendTrace(trace);
          unzipProgress?.(++done, total);
          const network = await this._backend.readText(prefix2 + ".network") || "";
          modernizer.appendTrace(network);
          unzipProgress?.(++done, total);
          contextEntry.actions = modernizer.actions().sort((a1, a2) => a1.startTime - a2.startTime);
          if (!backend.isLive()) {
            for (const action of contextEntry.actions.slice().reverse()) {
              if (!action.endTime && !action.error) {
                for (const a of contextEntry.actions) {
                  if (a.parentId === action.callId && action.endTime < a.endTime)
                    action.endTime = a.endTime;
                }
              }
            }
          }
          const stacks = await this._backend.readText(prefix2 + ".stacks");
          if (stacks) {
            const callMetadata = parseClientSideCallMetadata(JSON.parse(stacks));
            for (const action of contextEntry.actions)
              action.stack = action.stack || callMetadata.get(action.callId);
          }
          unzipProgress?.(++done, total);
          for (const resource of contextEntry.resources) {
            if (resource.request.postData?._sha1)
              this._resourceToContentType.set(resource.request.postData._sha1, stripEncodingFromContentType(resource.request.postData.mimeType));
            if (resource.response.content?._sha1)
              this._resourceToContentType.set(resource.response.content._sha1, stripEncodingFromContentType(resource.response.content.mimeType));
          }
          this.contextEntries.push(contextEntry);
        }
        this._snapshotStorage.finalize();
      }
      async hasEntry(filename) {
        return this._backend.hasEntry(filename);
      }
      async resourceForSha1(sha1) {
        const blob = await this._backend.readBlob("resources/" + sha1);
        const contentType = this._resourceToContentType.get(sha1);
        if (!blob || contentType === void 0 || contentType === "x-unknown")
          return blob;
        return new Blob([blob], { type: contentType });
      }
      storage() {
        return this._snapshotStorage;
      }
    };
  }
});

// packages/isomorphic/trace/traceModel.ts
function indexModel(context2) {
  for (const page of context2.pages)
    page[contextSymbol] = context2;
  for (let i = 0; i < context2.actions.length; ++i) {
    const action = context2.actions[i];
    action[contextSymbol] = context2;
  }
  let lastNonRouteAction = void 0;
  for (let i = context2.actions.length - 1; i >= 0; i--) {
    const action = context2.actions[i];
    action[nextInContextSymbol] = lastNonRouteAction;
    if (action.class !== "Route")
      lastNonRouteAction = action;
  }
  for (const event of context2.events)
    event[contextSymbol] = context2;
  for (const resource of context2.resources)
    resource[contextSymbol] = context2;
}
function mergeActionsAndUpdateTiming(contexts) {
  const result2 = [];
  const actions = mergeActionsAndUpdateTimingSameTrace(contexts);
  result2.push(...actions);
  result2.sort((a1, a2) => {
    if (a2.parentId === a1.callId)
      return 1;
    if (a1.parentId === a2.callId)
      return -1;
    return a1.endTime - a2.endTime;
  });
  for (let i = 1; i < result2.length; ++i)
    result2[i][prevByEndTimeSymbol] = result2[i - 1];
  result2.sort((a1, a2) => {
    if (a2.parentId === a1.callId)
      return -1;
    if (a1.parentId === a2.callId)
      return 1;
    return a1.startTime - a2.startTime;
  });
  for (let i = 0; i + 1 < result2.length; ++i)
    result2[i][nextByStartTimeSymbol] = result2[i + 1];
  return result2;
}
function mergeActionsAndUpdateTimingSameTrace(contexts) {
  const map = /* @__PURE__ */ new Map();
  const libraryContexts = contexts.filter((context2) => context2.origin === "library");
  const testRunnerContexts = contexts.filter((context2) => context2.origin === "testRunner");
  if (!testRunnerContexts.length || !libraryContexts.length) {
    return contexts.map((context2) => {
      return context2.actions.map((action) => ({ ...action, context: context2 }));
    }).flat();
  }
  for (const context2 of libraryContexts) {
    for (const action of context2.actions) {
      map.set(action.stepId || `tmp-step@${++lastTmpStepId}`, { ...action, context: context2 });
    }
  }
  const delta = monotonicTimeDeltaBetweenLibraryAndRunner(testRunnerContexts, map);
  if (delta)
    adjustMonotonicTime(libraryContexts, delta);
  const nonPrimaryIdToPrimaryId = /* @__PURE__ */ new Map();
  for (const context2 of testRunnerContexts) {
    for (const action of context2.actions) {
      const existing = action.stepId && map.get(action.stepId);
      if (existing) {
        nonPrimaryIdToPrimaryId.set(action.callId, existing.callId);
        if (action.error)
          existing.error = action.error;
        if (action.attachments)
          existing.attachments = action.attachments;
        if (action.annotations)
          existing.annotations = action.annotations;
        if (action.parentId)
          existing.parentId = nonPrimaryIdToPrimaryId.get(action.parentId) ?? action.parentId;
        if (action.group)
          existing.group = action.group;
        existing.startTime = action.startTime;
        existing.endTime = action.endTime;
        continue;
      }
      if (action.parentId)
        action.parentId = nonPrimaryIdToPrimaryId.get(action.parentId) ?? action.parentId;
      map.set(action.stepId || `tmp-step@${++lastTmpStepId}`, { ...action, context: context2 });
    }
  }
  return [...map.values()];
}
function adjustMonotonicTime(contexts, monotonicTimeDelta) {
  for (const context2 of contexts) {
    context2.startTime += monotonicTimeDelta;
    context2.endTime += monotonicTimeDelta;
    for (const action of context2.actions) {
      if (action.startTime)
        action.startTime += monotonicTimeDelta;
      if (action.endTime)
        action.endTime += monotonicTimeDelta;
    }
    for (const event of context2.events)
      event.time += monotonicTimeDelta;
    for (const event of context2.stdio)
      event.timestamp += monotonicTimeDelta;
    for (const page of context2.pages) {
      for (const frame of page.screencastFrames)
        frame.timestamp += monotonicTimeDelta;
    }
    for (const resource of context2.resources) {
      if (resource._monotonicTime)
        resource._monotonicTime += monotonicTimeDelta;
    }
  }
}
function monotonicTimeDeltaBetweenLibraryAndRunner(nonPrimaryContexts, libraryActions) {
  for (const context2 of nonPrimaryContexts) {
    for (const action of context2.actions) {
      if (!action.startTime)
        continue;
      const libraryAction = action.stepId ? libraryActions.get(action.stepId) : void 0;
      if (libraryAction)
        return action.startTime - libraryAction.startTime;
    }
  }
  return 0;
}
function buildActionTree(actions) {
  const itemMap = /* @__PURE__ */ new Map();
  for (const action of actions) {
    itemMap.set(action.callId, {
      id: action.callId,
      parent: void 0,
      children: [],
      action
    });
  }
  const rootItem = { action: { ...kFakeRootAction }, id: "", parent: void 0, children: [] };
  for (const item of itemMap.values()) {
    rootItem.action.startTime = Math.min(rootItem.action.startTime, item.action.startTime);
    rootItem.action.endTime = Math.max(rootItem.action.endTime, item.action.endTime);
    const parent = item.action.parentId ? itemMap.get(item.action.parentId) || rootItem : rootItem;
    parent.children.push(item);
    item.parent = parent;
  }
  const inheritStack = (item) => {
    for (const child of item.children) {
      child.action.stack = child.action.stack ?? item.action.stack;
      inheritStack(child);
    }
  };
  inheritStack(rootItem);
  return { rootItem, itemMap };
}
function context(action) {
  return action[contextSymbol];
}
function nextInContext(action) {
  return action[nextInContextSymbol];
}
function previousActionByEndTime(action) {
  return action[prevByEndTimeSymbol];
}
function nextActionByStartTime(action) {
  return action[nextByStartTimeSymbol];
}
function stats(action) {
  let errors = 0;
  let warnings = 0;
  for (const event of eventsForAction(action)) {
    if (event.type === "console") {
      const type3 = event.messageType;
      if (type3 === "warning")
        ++warnings;
      else if (type3 === "error")
        ++errors;
    }
    if (event.type === "event" && event.method === "pageError")
      ++errors;
  }
  return { errors, warnings };
}
function eventsForAction(action) {
  let result2 = action[eventsSymbol];
  if (result2)
    return result2;
  const nextAction = nextInContext(action);
  result2 = context(action).events.filter((event) => {
    return event.time >= action.startTime && (!nextAction || event.time < nextAction.startTime);
  });
  action[eventsSymbol] = result2;
  return result2;
}
function collectSources(actions, errorDescriptors) {
  const result2 = /* @__PURE__ */ new Map();
  for (const action of actions) {
    for (const frame of action.stack || []) {
      let source11 = result2.get(frame.file);
      if (!source11) {
        source11 = { errors: [], content: void 0 };
        result2.set(frame.file, source11);
      }
    }
  }
  for (const error of errorDescriptors) {
    const { action, stack, message } = error;
    if (!action || !stack)
      continue;
    result2.get(stack[0].file)?.errors.push({
      line: stack[0].line || 0,
      message
    });
  }
  return result2;
}
var contextSymbol, nextInContextSymbol, prevByEndTimeSymbol, nextByStartTimeSymbol, eventsSymbol, TraceModel, lastTmpStepId, kFakeRootAction;
var init_traceModel = __esm({
  "packages/isomorphic/trace/traceModel.ts"() {
    "use strict";
    init_protocolFormatter();
    contextSymbol = Symbol("context");
    nextInContextSymbol = Symbol("nextInContext");
    prevByEndTimeSymbol = Symbol("prevByEndTime");
    nextByStartTimeSymbol = Symbol("nextByStartTime");
    eventsSymbol = Symbol("events");
    TraceModel = class {
      constructor(traceUri, contexts) {
        contexts.forEach((contextEntry) => indexModel(contextEntry));
        const libraryContext = contexts.find((context2) => context2.origin === "library");
        this.traceUri = traceUri;
        this.browserName = libraryContext?.browserName || "";
        this.sdkLanguage = libraryContext?.sdkLanguage;
        this.channel = libraryContext?.channel;
        this.testIdAttributeName = libraryContext?.testIdAttributeName;
        this.platform = libraryContext?.platform || "";
        this.playwrightVersion = contexts.find((c) => c.playwrightVersion)?.playwrightVersion;
        this.title = libraryContext?.title || "";
        this.options = libraryContext?.options || {};
        this.testTimeout = contexts.find((c) => c.origin === "testRunner")?.testTimeout;
        this.actions = mergeActionsAndUpdateTiming(contexts);
        this.pages = [].concat(...contexts.map((c) => c.pages));
        this.wallTime = contexts.map((c) => c.wallTime).reduce((prev, cur) => Math.min(prev || Number.MAX_VALUE, cur), Number.MAX_VALUE);
        this.startTime = contexts.map((c) => c.startTime).reduce((prev, cur) => Math.min(prev, cur), Number.MAX_VALUE);
        this.endTime = contexts.map((c) => c.endTime).reduce((prev, cur) => Math.max(prev, cur), Number.MIN_VALUE);
        this.events = [].concat(...contexts.map((c) => c.events));
        this.stdio = [].concat(...contexts.map((c) => c.stdio));
        this.errors = [].concat(...contexts.map((c) => c.errors));
        this.hasSource = contexts.some((c) => c.hasSource);
        this.hasStepData = contexts.some((context2) => context2.origin === "testRunner");
        this.resources = [...contexts.map((c) => c.resources)].flat().map((entry) => ({ ...entry, id: `${entry.pageref}-${entry.startedDateTime}-${entry.request.url}` }));
        this.attachments = this.actions.flatMap((action) => action.attachments?.map((attachment) => ({ ...attachment, callId: action.callId, traceUri })) ?? []);
        this.visibleAttachments = this.attachments.filter((attachment) => !attachment.name.startsWith("_"));
        this.events.sort((a1, a2) => a1.time - a2.time);
        this.resources.sort((a1, a2) => a1._monotonicTime - a2._monotonicTime);
        this.errorDescriptors = this.hasStepData ? this._errorDescriptorsFromTestRunner() : this._errorDescriptorsFromActions();
        this.sources = collectSources(this.actions, this.errorDescriptors);
        this.actionCounters = /* @__PURE__ */ new Map();
        for (const action of this.actions) {
          action.group = action.group ?? getActionGroup({ type: action.class, method: action.method });
          if (action.group)
            this.actionCounters.set(action.group, 1 + (this.actionCounters.get(action.group) || 0));
        }
      }
      createRelativeUrl(path59) {
        const url2 = new URL("http://localhost/" + path59);
        url2.searchParams.set("trace", this.traceUri);
        return url2.toString().substring("http://localhost/".length);
      }
      failedAction() {
        return this.actions.findLast((a) => a.error);
      }
      filteredActions(actionsFilter) {
        const filter = new Set(actionsFilter);
        return this.actions.filter((action) => !action.group || filter.has(action.group));
      }
      renderActionTree(filter) {
        const actions = this.filteredActions(filter ?? []);
        const { rootItem } = buildActionTree(actions);
        const actionTree = [];
        const visit = (actionItem, indent) => {
          const title = renderTitleForCall({ ...actionItem.action, type: actionItem.action.class });
          actionTree.push(`${indent}${title || actionItem.id}`);
          for (const child of actionItem.children)
            visit(child, indent + "  ");
        };
        rootItem.children.forEach((a) => visit(a, ""));
        return actionTree;
      }
      _errorDescriptorsFromActions() {
        const errors = [];
        for (const action of this.actions || []) {
          if (!action.error?.message)
            continue;
          errors.push({
            action,
            stack: action.stack,
            message: action.error.message
          });
        }
        return errors;
      }
      _errorDescriptorsFromTestRunner() {
        return this.errors.filter((e) => !!e.message).map((error, i) => ({
          stack: error.stack,
          message: error.message
        }));
      }
    };
    lastTmpStepId = 0;
    kFakeRootAction = {
      type: "action",
      callId: "",
      startTime: 0,
      endTime: 0,
      class: "",
      method: "",
      params: {},
      log: [],
      context: {
        origin: "library",
        startTime: 0,
        endTime: 0,
        browserName: "",
        wallTime: 0,
        options: {},
        pages: [],
        resources: [],
        actions: [],
        events: [],
        stdio: [],
        errors: [],
        hasSource: false,
        contextId: ""
      }
    };
  }
});

// packages/isomorphic/yaml.ts
function yamlEscapeKeyIfNeeded(str) {
  if (!yamlStringNeedsQuotes(str))
    return str;
  return `'` + str.replace(/'/g, `''`) + `'`;
}
function yamlEscapeValueIfNeeded(str) {
  if (!yamlStringNeedsQuotes(str))
    return str;
  return '"' + str.replace(/[\\"\x00-\x1f\x7f-\x9f]/g, (c) => {
    switch (c) {
      case "\\":
        return "\\\\";
      case '"':
        return '\\"';
      case "\b":
        return "\\b";
      case "\f":
        return "\\f";
      case "\n":
        return "\\n";
      case "\r":
        return "\\r";
      case "	":
        return "\\t";
      default:
        const code = c.charCodeAt(0);
        return "\\x" + code.toString(16).padStart(2, "0");
    }
  }) + '"';
}
function yamlStringNeedsQuotes(str) {
  if (str.length === 0)
    return true;
  if (/^\s|\s$/.test(str))
    return true;
  if (/[\x00-\x08\x0b\x0c\x0e-\x1f\x7f-\x9f]/.test(str))
    return true;
  if (/^-/.test(str))
    return true;
  if (/[\n:](\s|$)/.test(str))
    return true;
  if (/\s#/.test(str))
    return true;
  if (/[\n\r]/.test(str))
    return true;
  if (/^[&*\],?!>|@"'#%]/.test(str))
    return true;
  if (/[{}`]/.test(str))
    return true;
  if (/^\[/.test(str))
    return true;
  if (!isNaN(Number(str)) || ["y", "n", "yes", "no", "true", "false", "on", "off", "null"].includes(str.toLowerCase()))
    return true;
  return false;
}
var init_yaml = __esm({
  "packages/isomorphic/yaml.ts"() {
    "use strict";
  }
});

// packages/isomorphic/index.ts
var isomorphic_exports = {};
__export(isomorphic_exports, {
  CSharpLocatorFactory: () => CSharpLocatorFactory,
  DEFAULT_PLAYWRIGHT_LAUNCH_TIMEOUT: () => DEFAULT_PLAYWRIGHT_LAUNCH_TIMEOUT,
  DEFAULT_PLAYWRIGHT_TIMEOUT: () => DEFAULT_PLAYWRIGHT_TIMEOUT,
  InvalidSelectorError: () => InvalidSelectorError,
  JavaLocatorFactory: () => JavaLocatorFactory,
  JavaScriptLocatorFactory: () => JavaScriptLocatorFactory,
  JsonlLocatorFactory: () => JsonlLocatorFactory,
  KeyParser: () => KeyParser,
  LongStandingScope: () => LongStandingScope,
  ManualPromise: () => ManualPromise,
  MultiMap: () => MultiMap,
  ParserError: () => ParserError,
  PythonLocatorFactory: () => PythonLocatorFactory,
  Semaphore: () => Semaphore,
  SnapshotServer: () => SnapshotServer,
  SnapshotStorage: () => SnapshotStorage,
  TraceLoader: () => TraceLoader,
  TraceModel: () => TraceModel,
  ansiRegex: () => ansiRegex,
  ariaNodesEqual: () => ariaNodesEqual,
  asLocator: () => asLocator,
  asLocatorDescription: () => asLocatorDescription,
  asLocators: () => asLocators,
  assert: () => assert,
  base64ByteLength: () => base64ByteLength,
  buildActionTree: () => buildActionTree,
  bytesToString: () => bytesToString,
  cacheNormalizedWhitespaces: () => cacheNormalizedWhitespaces,
  captureRawStack: () => captureRawStack,
  constructURLBasedOnBaseURL: () => constructURLBasedOnBaseURL,
  context: () => context,
  customCSSNames: () => customCSSNames,
  deserializeURLMatch: () => deserializeURLMatch,
  escapeForAttributeSelector: () => escapeForAttributeSelector,
  escapeForTextSelector: () => escapeForTextSelector,
  escapeHTML: () => escapeHTML,
  escapeHTMLAttribute: () => escapeHTMLAttribute,
  escapeRegExp: () => escapeRegExp,
  escapeTemplateString: () => escapeTemplateString,
  escapeWithQuotes: () => escapeWithQuotes,
  eventsForAction: () => eventsForAction,
  findNewNode: () => findNewNode,
  formatObject: () => formatObject,
  formatObjectOrVoid: () => formatObjectOrVoid,
  formatProtocolParam: () => formatProtocolParam,
  getActionGroup: () => getActionGroup,
  getExtensionForMimeType: () => getExtensionForMimeType,
  getMetainfo: () => getMetainfo,
  getMimeTypeForPath: () => getMimeTypeForPath,
  globToRegexPattern: () => globToRegexPattern,
  hasPointerCursor: () => hasPointerCursor,
  headersArrayToObject: () => headersArrayToObject,
  headersObjectToArray: () => headersObjectToArray,
  isError: () => isError,
  isHttpUrl: () => isHttpUrl,
  isInvalidSelectorError: () => isInvalidSelectorError,
  isJsonMimeType: () => isJsonMimeType,
  isObject: () => isObject,
  isRegExp: () => isRegExp,
  isRegexString: () => isRegexString,
  isString: () => isString,
  isTextualMimeType: () => isTextualMimeType,
  isURLPattern: () => isURLPattern,
  isXmlMimeType: () => isXmlMimeType,
  locatorCustomDescription: () => locatorCustomDescription,
  locatorOrSelectorAsSelector: () => locatorOrSelectorAsSelector,
  longestCommonSubstring: () => longestCommonSubstring,
  methodMetainfo: () => methodMetainfo,
  monotonicTime: () => monotonicTime,
  msToString: () => msToString,
  nextActionByStartTime: () => nextActionByStartTime,
  noColors: () => noColors,
  normalizeEscapedRegexQuotes: () => normalizeEscapedRegexQuotes,
  normalizeWhiteSpace: () => normalizeWhiteSpace,
  padImageToSize: () => padImageToSize,
  parseAriaSnapshot: () => parseAriaSnapshot,
  parseAriaSnapshotUnsafe: () => parseAriaSnapshotUnsafe,
  parseAttributeSelector: () => parseAttributeSelector,
  parseCSS: () => parseCSS,
  parseClientSideCallMetadata: () => parseClientSideCallMetadata,
  parseErrorStack: () => parseErrorStack,
  parseRegex: () => parseRegex,
  parseSelector: () => parseSelector,
  parseStackFrame: () => parseStackFrame,
  pollAgainstDeadline: () => pollAgainstDeadline,
  previousActionByEndTime: () => previousActionByEndTime,
  quoteCSSAttributeValue: () => quoteCSSAttributeValue,
  raceAgainstDeadline: () => raceAgainstDeadline,
  renderTitleForCall: () => renderTitleForCall,
  resolveGlobToRegexPattern: () => resolveGlobToRegexPattern,
  rewriteErrorMessage: () => rewriteErrorMessage,
  scaleImageToSize: () => scaleImageToSize,
  serializeClientSideCallMetadata: () => serializeClientSideCallMetadata,
  serializeExpectedTextValues: () => serializeExpectedTextValues,
  serializeSelector: () => serializeSelector,
  serializeURLMatch: () => serializeURLMatch,
  serializeURLPattern: () => serializeURLPattern,
  setTimeOrigin: () => setTimeOrigin,
  signalToPromise: () => signalToPromise,
  splitErrorMessage: () => splitErrorMessage,
  splitSelectorByFrame: () => splitSelectorByFrame,
  stats: () => stats,
  stringifySelector: () => stringifySelector,
  stringifyStackFrames: () => stringifyStackFrames,
  stripAnsiEscapes: () => stripAnsiEscapes,
  textValue: () => textValue,
  timeOrigin: () => timeOrigin,
  toSnakeCase: () => toSnakeCase,
  toTitleCase: () => toTitleCase,
  tomlArray: () => tomlArray,
  tomlBasicString: () => tomlBasicString,
  tomlMultilineBasicString: () => tomlMultilineBasicString,
  trimString: () => trimString,
  trimStringWithEllipsis: () => trimStringWithEllipsis,
  unsafeLocatorOrSelectorAsSelector: () => unsafeLocatorOrSelectorAsSelector,
  urlMatches: () => urlMatches,
  urlMatchesEqual: () => urlMatchesEqual,
  validate: () => validate,
  visitAllSelectorParts: () => visitAllSelectorParts,
  webColors: () => webColors,
  yamlEscapeKeyIfNeeded: () => yamlEscapeKeyIfNeeded,
  yamlEscapeValueIfNeeded: () => yamlEscapeValueIfNeeded
});
var init_isomorphic = __esm({
  "packages/isomorphic/index.ts"() {
    "use strict";
    init_ariaSnapshot();
    init_expectUtils();
    init_assert();
    init_base64();
    init_colors();
    init_headers();
    init_imageUtils();
    init_jsonSchema();
    init_locatorGenerators();
    init_manualPromise();
    init_mimeType();
    init_multimap();
    init_protocolFormatter();
    init_protocolMetainfo();
    init_rtti();
    init_semaphore();
    init_stackTrace();
    init_stringUtils();
    init_formatUtils();
    init_time();
    init_timeoutRunner();
    init_snapshotServer();
    init_urlMatch();
    init_cssParser();
    init_locatorParser();
    init_selectorParser();
    init_snapshotStorage();
    init_traceLoader();
    init_traceModel();
    init_traceUtils();
    init_yaml();
  }
});

// packages/utils/ascii.ts
function wrapInASCIIBox(text2, padding = 0) {
  const lines = text2.split("\n");
  const maxLength = Math.max(...lines.map((line) => line.length));
  return [
    "\u2554" + "\u2550".repeat(maxLength + padding * 2) + "\u2557",
    ...lines.map((line) => "\u2551" + " ".repeat(padding) + line + " ".repeat(maxLength - line.length + padding) + "\u2551"),
    "\u255A" + "\u2550".repeat(maxLength + padding * 2) + "\u255D"
  ].join("\n");
}
function jsonStringifyForceASCII(object) {
  return JSON.stringify(object).replace(
    /[\u007f-\uffff]/g,
    (c) => "\\u" + ("0000" + c.charCodeAt(0).toString(16)).slice(-4)
  );
}
var init_ascii = __esm({
  "packages/utils/ascii.ts"() {
    "use strict";
  }
});

// packages/utils/chromiumChannels.ts
function defaultUserDataDirForChannel(channel) {
  return channelToDefaultUserDataDir.get(channel)?.[process.platform];
}
function isChromiumChannelName(channel) {
  return channelToDefaultUserDataDir.has(channel);
}
var import_os, import_path, channelToDefaultUserDataDir;
var init_chromiumChannels = __esm({
  "packages/utils/chromiumChannels.ts"() {
    "use strict";
    import_os = __toESM(require("os"));
    import_path = __toESM(require("path"));
    channelToDefaultUserDataDir = /* @__PURE__ */ new Map([
      ["chrome", {
        "linux": import_path.default.join(import_os.default.homedir(), ".config", "google-chrome"),
        "darwin": import_path.default.join(import_os.default.homedir(), "Library", "Application Support", "Google", "Chrome"),
        "win32": import_path.default.join(process.env.LOCALAPPDATA || import_path.default.join(import_os.default.homedir(), "AppData", "Local"), "Google", "Chrome", "User Data")
      }],
      ["chrome-beta", {
        "linux": import_path.default.join(import_os.default.homedir(), ".config", "google-chrome-beta"),
        "darwin": import_path.default.join(import_os.default.homedir(), "Library", "Application Support", "Google", "Chrome Beta"),
        "win32": import_path.default.join(process.env.LOCALAPPDATA || import_path.default.join(import_os.default.homedir(), "AppData", "Local"), "Google", "Chrome Beta", "User Data")
      }],
      ["chrome-dev", {
        "linux": import_path.default.join(import_os.default.homedir(), ".config", "google-chrome-unstable"),
        "darwin": import_path.default.join(import_os.default.homedir(), "Library", "Application Support", "Google", "Chrome Dev"),
        "win32": import_path.default.join(process.env.LOCALAPPDATA || import_path.default.join(import_os.default.homedir(), "AppData", "Local"), "Google", "Chrome Dev", "User Data")
      }],
      ["chrome-canary", {
        "linux": import_path.default.join(import_os.default.homedir(), ".config", "google-chrome-canary"),
        "darwin": import_path.default.join(import_os.default.homedir(), "Library", "Application Support", "Google", "Chrome Canary"),
        "win32": import_path.default.join(process.env.LOCALAPPDATA || import_path.default.join(import_os.default.homedir(), "AppData", "Local"), "Google", "Chrome SxS", "User Data")
      }],
      ["msedge", {
        "linux": import_path.default.join(import_os.default.homedir(), ".config", "microsoft-edge"),
        "darwin": import_path.default.join(import_os.default.homedir(), "Library", "Application Support", "Microsoft Edge"),
        "win32": import_path.default.join(process.env.LOCALAPPDATA || import_path.default.join(import_os.default.homedir(), "AppData", "Local"), "Microsoft", "Edge", "User Data")
      }],
      ["msedge-beta", {
        "linux": import_path.default.join(import_os.default.homedir(), ".config", "microsoft-edge-beta"),
        "darwin": import_path.default.join(import_os.default.homedir(), "Library", "Application Support", "Microsoft Edge Beta"),
        "win32": import_path.default.join(process.env.LOCALAPPDATA || import_path.default.join(import_os.default.homedir(), "AppData", "Local"), "Microsoft", "Edge Beta", "User Data")
      }],
      ["msedge-dev", {
        "linux": import_path.default.join(import_os.default.homedir(), ".config", "microsoft-edge-dev"),
        "darwin": import_path.default.join(import_os.default.homedir(), "Library", "Application Support", "Microsoft Edge Dev"),
        "win32": import_path.default.join(process.env.LOCALAPPDATA || import_path.default.join(import_os.default.homedir(), "AppData", "Local"), "Microsoft", "Edge Dev", "User Data")
      }],
      ["msedge-canary", {
        "linux": import_path.default.join(import_os.default.homedir(), ".config", "microsoft-edge-canary"),
        "darwin": import_path.default.join(import_os.default.homedir(), "Library", "Application Support", "Microsoft Edge Canary"),
        "win32": import_path.default.join(process.env.LOCALAPPDATA || import_path.default.join(import_os.default.homedir(), "AppData", "Local"), "Microsoft", "Edge SxS", "User Data")
      }]
    ]);
  }
});

// packages/utils/third_party/pixelmatch.js
var require_pixelmatch = __commonJS({
  "packages/utils/third_party/pixelmatch.js"(exports2, module2) {
    "use strict";
    module2.exports = pixelmatch2;
    var defaultOptions = {
      threshold: 0.1,
      // matching threshold (0 to 1); smaller is more sensitive
      includeAA: false,
      // whether to skip anti-aliasing detection
      alpha: 0.1,
      // opacity of original image in diff output
      aaColor: [255, 255, 0],
      // color of anti-aliased pixels in diff output
      diffColor: [255, 0, 0],
      // color of different pixels in diff output
      diffColorAlt: null,
      // whether to detect dark on light differences between img1 and img2 and set an alternative color to differentiate between the two
      diffMask: false
      // draw the diff over a transparent background (a mask)
    };
    function pixelmatch2(img1, img2, output, width, height, options) {
      if (!isPixelData(img1) || !isPixelData(img2) || output && !isPixelData(output))
        throw new Error("Image data: Uint8Array, Uint8ClampedArray or Buffer expected.");
      if (img1.length !== img2.length || output && output.length !== img1.length)
        throw new Error("Image sizes do not match.");
      if (img1.length !== width * height * 4) throw new Error("Image data size does not match width/height.");
      options = Object.assign({}, defaultOptions, options);
      const len = width * height;
      const a32 = new Uint32Array(img1.buffer, img1.byteOffset, len);
      const b32 = new Uint32Array(img2.buffer, img2.byteOffset, len);
      let identical = true;
      for (let i = 0; i < len; i++) {
        if (a32[i] !== b32[i]) {
          identical = false;
          break;
        }
      }
      if (identical) {
        if (output && !options.diffMask) {
          for (let i = 0; i < len; i++) drawGrayPixel(img1, 4 * i, options.alpha, output);
        }
        return 0;
      }
      const maxDelta = 35215 * options.threshold * options.threshold;
      let diff2 = 0;
      for (let y = 0; y < height; y++) {
        for (let x = 0; x < width; x++) {
          const pos = (y * width + x) * 4;
          const delta = colorDelta(img1, img2, pos, pos);
          if (Math.abs(delta) > maxDelta) {
            if (!options.includeAA && (antialiased(img1, x, y, width, height, img2) || antialiased(img2, x, y, width, height, img1))) {
              if (output && !options.diffMask) drawPixel2(output, pos, ...options.aaColor);
            } else {
              if (output) {
                drawPixel2(output, pos, ...delta < 0 && options.diffColorAlt || options.diffColor);
              }
              diff2++;
            }
          } else if (output) {
            if (!options.diffMask) drawGrayPixel(img1, pos, options.alpha, output);
          }
        }
      }
      return diff2;
    }
    function isPixelData(arr) {
      return ArrayBuffer.isView(arr) && arr.constructor.BYTES_PER_ELEMENT === 1;
    }
    function antialiased(img, x1, y1, width, height, img2) {
      const x0 = Math.max(x1 - 1, 0);
      const y0 = Math.max(y1 - 1, 0);
      const x2 = Math.min(x1 + 1, width - 1);
      const y2 = Math.min(y1 + 1, height - 1);
      const pos = (y1 * width + x1) * 4;
      let zeroes = x1 === x0 || x1 === x2 || y1 === y0 || y1 === y2 ? 1 : 0;
      let min = 0;
      let max = 0;
      let minX, minY, maxX, maxY;
      for (let x = x0; x <= x2; x++) {
        for (let y = y0; y <= y2; y++) {
          if (x === x1 && y === y1) continue;
          const delta = colorDelta(img, img, pos, (y * width + x) * 4, true);
          if (delta === 0) {
            zeroes++;
            if (zeroes > 2) return false;
          } else if (delta < min) {
            min = delta;
            minX = x;
            minY = y;
          } else if (delta > max) {
            max = delta;
            maxX = x;
            maxY = y;
          }
        }
      }
      if (min === 0 || max === 0) return false;
      return hasManySiblings(img, minX, minY, width, height) && hasManySiblings(img2, minX, minY, width, height) || hasManySiblings(img, maxX, maxY, width, height) && hasManySiblings(img2, maxX, maxY, width, height);
    }
    function hasManySiblings(img, x1, y1, width, height) {
      const x0 = Math.max(x1 - 1, 0);
      const y0 = Math.max(y1 - 1, 0);
      const x2 = Math.min(x1 + 1, width - 1);
      const y2 = Math.min(y1 + 1, height - 1);
      const pos = (y1 * width + x1) * 4;
      let zeroes = x1 === x0 || x1 === x2 || y1 === y0 || y1 === y2 ? 1 : 0;
      for (let x = x0; x <= x2; x++) {
        for (let y = y0; y <= y2; y++) {
          if (x === x1 && y === y1) continue;
          const pos2 = (y * width + x) * 4;
          if (img[pos] === img[pos2] && img[pos + 1] === img[pos2 + 1] && img[pos + 2] === img[pos2 + 2] && img[pos + 3] === img[pos2 + 3]) zeroes++;
          if (zeroes > 2) return true;
        }
      }
      return false;
    }
    function colorDelta(img1, img2, k, m, yOnly) {
      let r1 = img1[k + 0];
      let g1 = img1[k + 1];
      let b1 = img1[k + 2];
      let a1 = img1[k + 3];
      let r2 = img2[m + 0];
      let g2 = img2[m + 1];
      let b2 = img2[m + 2];
      let a2 = img2[m + 3];
      if (a1 === a2 && r1 === r2 && g1 === g2 && b1 === b2) return 0;
      if (a1 < 255) {
        a1 /= 255;
        r1 = blend(r1, a1);
        g1 = blend(g1, a1);
        b1 = blend(b1, a1);
      }
      if (a2 < 255) {
        a2 /= 255;
        r2 = blend(r2, a2);
        g2 = blend(g2, a2);
        b2 = blend(b2, a2);
      }
      const y1 = rgb2y(r1, g1, b1);
      const y2 = rgb2y(r2, g2, b2);
      const y = y1 - y2;
      if (yOnly) return y;
      const i = rgb2i(r1, g1, b1) - rgb2i(r2, g2, b2);
      const q = rgb2q(r1, g1, b1) - rgb2q(r2, g2, b2);
      const delta = 0.5053 * y * y + 0.299 * i * i + 0.1957 * q * q;
      return y1 > y2 ? -delta : delta;
    }
    function rgb2y(r, g, b) {
      return r * 0.29889531 + g * 0.58662247 + b * 0.11448223;
    }
    function rgb2i(r, g, b) {
      return r * 0.59597799 - g * 0.2741761 - b * 0.32180189;
    }
    function rgb2q(r, g, b) {
      return r * 0.21147017 - g * 0.52261711 + b * 0.31114694;
    }
    function blend(c, a) {
      return 255 + (c - 255) * a;
    }
    function drawPixel2(output, pos, r, g, b) {
      output[pos + 0] = r;
      output[pos + 1] = g;
      output[pos + 2] = b;
      output[pos + 3] = 255;
    }
    function drawGrayPixel(img, i, alpha, output) {
      const r = img[i + 0];
      const g = img[i + 1];
      const b = img[i + 2];
      const val = blend(rgb2y(r, g, b), alpha * img[i + 3] / 255);
      drawPixel2(output, i, val, val, val);
    }
  }
});

// packages/utils/image_tools/colorUtils.ts
function blendWithWhite(c, a) {
  return 255 + (c - 255) * a;
}
function rgb2gray(r, g, b) {
  return 77 * r + 150 * g + 29 * b + 128 >> 8;
}
function colorDeltaE94(rgb1, rgb2) {
  const [l1, a1, b1] = xyz2lab(srgb2xyz(rgb1));
  const [l2, a2, b2] = xyz2lab(srgb2xyz(rgb2));
  const deltaL = l1 - l2;
  const deltaA = a1 - a2;
  const deltaB = b1 - b2;
  const c1 = Math.sqrt(a1 ** 2 + b1 ** 2);
  const c2 = Math.sqrt(a2 ** 2 + b2 ** 2);
  const deltaC = c1 - c2;
  let deltaH = deltaA ** 2 + deltaB ** 2 - deltaC ** 2;
  deltaH = deltaH < 0 ? 0 : Math.sqrt(deltaH);
  const k1 = 0.045;
  const k2 = 0.015;
  const kL = 1;
  const kC = 1;
  const kH = 1;
  const sC = 1 + k1 * c1;
  const sH = 1 + k2 * c1;
  const sL = 1;
  return Math.sqrt((deltaL / sL / kL) ** 2 + (deltaC / sC / kC) ** 2 + (deltaH / sH / kH) ** 2);
}
function srgb2xyz(rgb) {
  let r = rgb[0] / 255;
  let g = rgb[1] / 255;
  let b = rgb[2] / 255;
  r = r > 0.04045 ? Math.pow((r + 0.055) / 1.055, 2.4) : r / 12.92;
  g = g > 0.04045 ? Math.pow((g + 0.055) / 1.055, 2.4) : g / 12.92;
  b = b > 0.04045 ? Math.pow((b + 0.055) / 1.055, 2.4) : b / 12.92;
  return [
    r * 0.4124 + g * 0.3576 + b * 0.1805,
    r * 0.2126 + g * 0.7152 + b * 0.0722,
    r * 0.0193 + g * 0.1192 + b * 0.9505
  ];
}
function xyz2lab(xyz) {
  const x = xyz[0] / 0.950489;
  const y = xyz[1];
  const z31 = xyz[2] / 1.08884;
  const fx = x > sigma_pow3 ? x ** (1 / 3) : x / 3 / sigma_pow2 + 4 / 29;
  const fy = y > sigma_pow3 ? y ** (1 / 3) : y / 3 / sigma_pow2 + 4 / 29;
  const fz = z31 > sigma_pow3 ? z31 ** (1 / 3) : z31 / 3 / sigma_pow2 + 4 / 29;
  const l = 116 * fy - 16;
  const a = 500 * (fx - fy);
  const b = 200 * (fy - fz);
  return [l, a, b];
}
var sigma_pow2, sigma_pow3;
var init_colorUtils = __esm({
  "packages/utils/image_tools/colorUtils.ts"() {
    "use strict";
    sigma_pow2 = 6 * 6 / 29 / 29;
    sigma_pow3 = 6 * 6 * 6 / 29 / 29 / 29;
  }
});

// packages/utils/image_tools/imageChannel.ts
var ImageChannel;
var init_imageChannel = __esm({
  "packages/utils/image_tools/imageChannel.ts"() {
    "use strict";
    init_colorUtils();
    ImageChannel = class _ImageChannel {
      static intoRGB(width, height, data, options = {}) {
        const {
          paddingSize = 0,
          paddingColorOdd = [255, 0, 255],
          paddingColorEven = [0, 255, 0]
        } = options;
        const newWidth = width + 2 * paddingSize;
        const newHeight = height + 2 * paddingSize;
        const r = new Uint8Array(newWidth * newHeight);
        const g = new Uint8Array(newWidth * newHeight);
        const b = new Uint8Array(newWidth * newHeight);
        for (let y = 0; y < newHeight; ++y) {
          for (let x = 0; x < newWidth; ++x) {
            const index = y * newWidth + x;
            if (y >= paddingSize && y < newHeight - paddingSize && x >= paddingSize && x < newWidth - paddingSize) {
              const offset = ((y - paddingSize) * width + (x - paddingSize)) * 4;
              const alpha = data[offset + 3] === 255 ? 1 : data[offset + 3] / 255;
              r[index] = blendWithWhite(data[offset], alpha);
              g[index] = blendWithWhite(data[offset + 1], alpha);
              b[index] = blendWithWhite(data[offset + 2], alpha);
            } else {
              const color = (y + x) % 2 === 0 ? paddingColorEven : paddingColorOdd;
              r[index] = color[0];
              g[index] = color[1];
              b[index] = color[2];
            }
          }
        }
        return [
          new _ImageChannel(newWidth, newHeight, r),
          new _ImageChannel(newWidth, newHeight, g),
          new _ImageChannel(newWidth, newHeight, b)
        ];
      }
      constructor(width, height, data) {
        this.data = data;
        this.width = width;
        this.height = height;
      }
      get(x, y) {
        return this.data[y * this.width + x];
      }
      boundXY(x, y) {
        return [
          Math.min(Math.max(x, 0), this.width - 1),
          Math.min(Math.max(y, 0), this.height - 1)
        ];
      }
    };
  }
});

// packages/utils/image_tools/stats.ts
function ssim(stats2, x1, y1, x2, y2) {
  const mean1 = stats2.meanC1(x1, y1, x2, y2);
  const mean2 = stats2.meanC2(x1, y1, x2, y2);
  const var1 = stats2.varianceC1(x1, y1, x2, y2);
  const var2 = stats2.varianceC2(x1, y1, x2, y2);
  const cov = stats2.covariance(x1, y1, x2, y2);
  const c1 = (0.01 * DYNAMIC_RANGE) ** 2;
  const c2 = (0.03 * DYNAMIC_RANGE) ** 2;
  return (2 * mean1 * mean2 + c1) * (2 * cov + c2) / (mean1 ** 2 + mean2 ** 2 + c1) / (var1 + var2 + c2);
}
var DYNAMIC_RANGE, FastStats;
var init_stats = __esm({
  "packages/utils/image_tools/stats.ts"() {
    "use strict";
    DYNAMIC_RANGE = 2 ** 8 - 1;
    FastStats = class {
      constructor(c1, c2) {
        this.c1 = c1;
        this.c2 = c2;
        const { width, height } = c1;
        this._partialSumC1 = new Array(width * height);
        this._partialSumC2 = new Array(width * height);
        this._partialSumSq1 = new Array(width * height);
        this._partialSumSq2 = new Array(width * height);
        this._partialSumMult = new Array(width * height);
        const recalc = (mx, idx, initial, x, y) => {
          mx[idx] = initial;
          if (y > 0)
            mx[idx] += mx[(y - 1) * width + x];
          if (x > 0)
            mx[idx] += mx[y * width + x - 1];
          if (x > 0 && y > 0)
            mx[idx] -= mx[(y - 1) * width + x - 1];
        };
        for (let y = 0; y < height; ++y) {
          for (let x = 0; x < width; ++x) {
            const idx = y * width + x;
            recalc(this._partialSumC1, idx, this.c1.data[idx], x, y);
            recalc(this._partialSumC2, idx, this.c2.data[idx], x, y);
            recalc(this._partialSumSq1, idx, this.c1.data[idx] * this.c1.data[idx], x, y);
            recalc(this._partialSumSq2, idx, this.c2.data[idx] * this.c2.data[idx], x, y);
            recalc(this._partialSumMult, idx, this.c1.data[idx] * this.c2.data[idx], x, y);
          }
        }
      }
      _sum(partialSum, x1, y1, x2, y2) {
        const width = this.c1.width;
        let result2 = partialSum[y2 * width + x2];
        if (y1 > 0)
          result2 -= partialSum[(y1 - 1) * width + x2];
        if (x1 > 0)
          result2 -= partialSum[y2 * width + x1 - 1];
        if (x1 > 0 && y1 > 0)
          result2 += partialSum[(y1 - 1) * width + x1 - 1];
        return result2;
      }
      meanC1(x1, y1, x2, y2) {
        const N = (y2 - y1 + 1) * (x2 - x1 + 1);
        return this._sum(this._partialSumC1, x1, y1, x2, y2) / N;
      }
      meanC2(x1, y1, x2, y2) {
        const N = (y2 - y1 + 1) * (x2 - x1 + 1);
        return this._sum(this._partialSumC2, x1, y1, x2, y2) / N;
      }
      varianceC1(x1, y1, x2, y2) {
        const N = (y2 - y1 + 1) * (x2 - x1 + 1);
        return (this._sum(this._partialSumSq1, x1, y1, x2, y2) - this._sum(this._partialSumC1, x1, y1, x2, y2) ** 2 / N) / N;
      }
      varianceC2(x1, y1, x2, y2) {
        const N = (y2 - y1 + 1) * (x2 - x1 + 1);
        return (this._sum(this._partialSumSq2, x1, y1, x2, y2) - this._sum(this._partialSumC2, x1, y1, x2, y2) ** 2 / N) / N;
      }
      covariance(x1, y1, x2, y2) {
        const N = (y2 - y1 + 1) * (x2 - x1 + 1);
        return (this._sum(this._partialSumMult, x1, y1, x2, y2) - this._sum(this._partialSumC1, x1, y1, x2, y2) * this._sum(this._partialSumC2, x1, y1, x2, y2) / N) / N;
      }
    };
  }
});

// packages/utils/image_tools/compare.ts
function drawPixel(width, data, x, y, r, g, b) {
  const idx = (y * width + x) * 4;
  data[idx + 0] = r;
  data[idx + 1] = g;
  data[idx + 2] = b;
  data[idx + 3] = 255;
}
function compare(actual, expected, diff2, width, height, options = {}) {
  const {
    maxColorDeltaE94 = 1
  } = options;
  const paddingSize = Math.max(VARIANCE_WINDOW_RADIUS, SSIM_WINDOW_RADIUS);
  const paddingColorEven = [255, 0, 255];
  const paddingColorOdd = [0, 255, 0];
  const [r1, g1, b1] = ImageChannel.intoRGB(width, height, expected, {
    paddingSize,
    paddingColorEven,
    paddingColorOdd
  });
  const [r2, g2, b2] = ImageChannel.intoRGB(width, height, actual, {
    paddingSize,
    paddingColorEven,
    paddingColorOdd
  });
  const noop = (x, y) => {
  };
  const drawRedPixel = diff2 ? (x, y) => drawPixel(width, diff2, x - paddingSize, y - paddingSize, 255, 0, 0) : noop;
  const drawYellowPixel = diff2 ? (x, y) => drawPixel(width, diff2, x - paddingSize, y - paddingSize, 255, 255, 0) : noop;
  const drawGrayPixel = diff2 ? (x, y) => {
    const gray = rgb2gray(r1.get(x, y), g1.get(x, y), b1.get(x, y));
    const value2 = blendWithWhite(gray, 0.1);
    drawPixel(width, diff2, x - paddingSize, y - paddingSize, value2, value2, value2);
  } : noop;
  let fastR;
  let fastG;
  let fastB;
  let diffCount = 0;
  for (let y = paddingSize; y < r1.height - paddingSize; ++y) {
    for (let x = paddingSize; x < r1.width - paddingSize; ++x) {
      if (r1.get(x, y) === r2.get(x, y) && g1.get(x, y) === g2.get(x, y) && b1.get(x, y) === b2.get(x, y)) {
        drawGrayPixel(x, y);
        continue;
      }
      const delta = colorDeltaE94(
        [r1.get(x, y), g1.get(x, y), b1.get(x, y)],
        [r2.get(x, y), g2.get(x, y), b2.get(x, y)]
      );
      if (delta <= maxColorDeltaE94) {
        drawGrayPixel(x, y);
        continue;
      }
      if (!fastR || !fastG || !fastB) {
        fastR = new FastStats(r1, r2);
        fastG = new FastStats(g1, g2);
        fastB = new FastStats(b1, b2);
      }
      const [varX1, varY1] = r1.boundXY(x - VARIANCE_WINDOW_RADIUS, y - VARIANCE_WINDOW_RADIUS);
      const [varX2, varY2] = r1.boundXY(x + VARIANCE_WINDOW_RADIUS, y + VARIANCE_WINDOW_RADIUS);
      const var1 = fastR.varianceC1(varX1, varY1, varX2, varY2) + fastG.varianceC1(varX1, varY1, varX2, varY2) + fastB.varianceC1(varX1, varY1, varX2, varY2);
      const var2 = fastR.varianceC2(varX1, varY1, varX2, varY2) + fastG.varianceC2(varX1, varY1, varX2, varY2) + fastB.varianceC2(varX1, varY1, varX2, varY2);
      if (var1 === 0 || var2 === 0) {
        drawRedPixel(x, y);
        ++diffCount;
        continue;
      }
      const [ssimX1, ssimY1] = r1.boundXY(x - SSIM_WINDOW_RADIUS, y - SSIM_WINDOW_RADIUS);
      const [ssimX2, ssimY2] = r1.boundXY(x + SSIM_WINDOW_RADIUS, y + SSIM_WINDOW_RADIUS);
      const ssimRGB = (ssim(fastR, ssimX1, ssimY1, ssimX2, ssimY2) + ssim(fastG, ssimX1, ssimY1, ssimX2, ssimY2) + ssim(fastB, ssimX1, ssimY1, ssimX2, ssimY2)) / 3;
      const isAntialiased = ssimRGB >= 0.99;
      if (isAntialiased) {
        drawYellowPixel(x, y);
      } else {
        drawRedPixel(x, y);
        ++diffCount;
      }
    }
  }
  return diffCount;
}
var SSIM_WINDOW_RADIUS, VARIANCE_WINDOW_RADIUS;
var init_compare = __esm({
  "packages/utils/image_tools/compare.ts"() {
    "use strict";
    init_colorUtils();
    init_imageChannel();
    init_stats();
    SSIM_WINDOW_RADIUS = 15;
    VARIANCE_WINDOW_RADIUS = 1;
  }
});

// packages/utils/comparators.ts
function getComparator(mimeType) {
  if (mimeType === "image/png")
    return compareImages.bind(null, "image/png");
  if (mimeType === "image/jpeg")
    return compareImages.bind(null, "image/jpeg");
  if (mimeType === "text/plain")
    return compareText;
  return compareBuffersOrStrings;
}
function compareBuffersOrStrings(actualBuffer, expectedBuffer) {
  if (typeof actualBuffer === "string")
    return compareText(actualBuffer, expectedBuffer);
  if (!actualBuffer || !(actualBuffer instanceof Buffer))
    return { errorMessage: "Actual result should be a Buffer or a string." };
  if (Buffer.compare(actualBuffer, expectedBuffer))
    return { errorMessage: "Buffers differ" };
  return null;
}
function compareImages(mimeType, actualBuffer, expectedBuffer, options = {}) {
  if (!actualBuffer || !(actualBuffer instanceof Buffer))
    return { errorMessage: "Actual result should be a Buffer." };
  validateBuffer(expectedBuffer, mimeType);
  let actual = mimeType === "image/png" ? PNG.sync.read(actualBuffer) : jpegjs.decode(actualBuffer, { maxMemoryUsageInMB: JPEG_JS_MAX_BUFFER_SIZE_IN_MB });
  let expected = mimeType === "image/png" ? PNG.sync.read(expectedBuffer) : jpegjs.decode(expectedBuffer, { maxMemoryUsageInMB: JPEG_JS_MAX_BUFFER_SIZE_IN_MB });
  const size = { width: Math.max(expected.width, actual.width), height: Math.max(expected.height, actual.height) };
  let sizesMismatchError = "";
  if (expected.width !== actual.width || expected.height !== actual.height) {
    sizesMismatchError = `Expected an image ${expected.width}px by ${expected.height}px, received ${actual.width}px by ${actual.height}px. `;
    actual = padImageToSize(actual, size);
    expected = padImageToSize(expected, size);
  }
  const diff2 = new PNG({ width: size.width, height: size.height });
  let count;
  if (options.comparator === "ssim-cie94") {
    count = compare(expected.data, actual.data, diff2.data, size.width, size.height, {
      // All Î”E* formulae are originally designed to have the difference of 1.0 stand for a "just noticeable difference" (JND).
      // See https://en.wikipedia.org/wiki/Color_difference#CIELAB_%CE%94E*
      maxColorDeltaE94: 1
    });
  } else if ((options.comparator ?? "pixelmatch") === "pixelmatch") {
    count = (0, import_pixelmatch.default)(expected.data, actual.data, diff2.data, size.width, size.height, {
      threshold: options.threshold ?? 0.2
    });
  } else {
    throw new Error(`Configuration specifies unknown comparator "${options.comparator}"`);
  }
  const maxDiffPixels1 = options.maxDiffPixels;
  const maxDiffPixels2 = options.maxDiffPixelRatio !== void 0 ? expected.width * expected.height * options.maxDiffPixelRatio : void 0;
  let maxDiffPixels;
  if (maxDiffPixels1 !== void 0 && maxDiffPixels2 !== void 0)
    maxDiffPixels = Math.min(maxDiffPixels1, maxDiffPixels2);
  else
    maxDiffPixels = maxDiffPixels1 ?? maxDiffPixels2 ?? 0;
  const ratio = Math.ceil(count / (expected.width * expected.height) * 100) / 100;
  const pixelsMismatchError = count > maxDiffPixels ? `${count} pixels (ratio ${ratio.toFixed(2)} of all image pixels) are different.` : "";
  if (pixelsMismatchError || sizesMismatchError)
    return { errorMessage: sizesMismatchError + pixelsMismatchError, diff: PNG.sync.write(diff2) };
  return null;
}
function validateBuffer(buffer, mimeType) {
  if (mimeType === "image/png") {
    const pngMagicNumber = [137, 80, 78, 71, 13, 10, 26, 10];
    if (buffer.length < pngMagicNumber.length || !pngMagicNumber.every((byte, index) => buffer[index] === byte))
      throw new Error("Could not decode expected image as PNG.");
  } else if (mimeType === "image/jpeg") {
    const jpegMagicNumber = [255, 216];
    if (buffer.length < jpegMagicNumber.length || !jpegMagicNumber.every((byte, index) => buffer[index] === byte))
      throw new Error("Could not decode expected image as JPEG.");
  }
}
function compareText(actual, expectedBuffer) {
  if (typeof actual !== "string")
    return { errorMessage: "Actual result should be a string" };
  let expected = expectedBuffer.toString("utf-8");
  if (expected === actual)
    return null;
  if (!actual.endsWith("\n"))
    actual += "\n";
  if (!expected.endsWith("\n"))
    expected += "\n";
  const lines = diff.createPatch("file", expected, actual, void 0, void 0, { context: 5 }).split("\n");
  const coloredLines = lines.slice(4).map((line) => {
    if (line.startsWith("-"))
      return colors.green(line);
    if (line.startsWith("+"))
      return colors.red(line);
    if (line.startsWith("@@"))
      return colors.dim(line);
    return line;
  });
  const errorMessage = coloredLines.join("\n");
  return { errorMessage };
}
var import_pixelmatch, jpegjs, colors, diff, PNG, JPEG_JS_MAX_BUFFER_SIZE_IN_MB;
var init_comparators = __esm({
  "packages/utils/comparators.ts"() {
    "use strict";
    init_imageUtils();
    import_pixelmatch = __toESM(require_pixelmatch());
    init_compare();
    jpegjs = require("./utilsBundle").jpegjs;
    colors = require("./utilsBundle").colors;
    diff = require("./utilsBundle").diff;
    ({ PNG } = require("./utilsBundle"));
    JPEG_JS_MAX_BUFFER_SIZE_IN_MB = 5 * 1024;
  }
});

// packages/utils/crypto.ts
function createGuid() {
  return import_crypto.default.randomBytes(16).toString("hex");
}
function calculateSha1(buffer) {
  const hash = import_crypto.default.createHash("sha1");
  hash.update(buffer);
  return hash.digest("hex");
}
function encodeBase128(value2) {
  const bytes = [];
  do {
    let byte = value2 & 127;
    value2 >>>= 7;
    if (bytes.length > 0)
      byte |= 128;
    bytes.push(byte);
  } while (value2 > 0);
  return Buffer.from(bytes.reverse());
}
function generateSelfSignedCertificate() {
  const { privateKey, publicKey } = import_crypto.default.generateKeyPairSync("rsa", { modulusLength: 2048 });
  const publicKeyDer = publicKey.export({ type: "pkcs1", format: "der" });
  const oneYearInMilliseconds = 365 * 24 * 60 * 60 * 1e3;
  const notBefore = new Date((/* @__PURE__ */ new Date()).getTime() - oneYearInMilliseconds);
  const notAfter = new Date((/* @__PURE__ */ new Date()).getTime() + oneYearInMilliseconds);
  const tbsCertificate = DER.encodeSequence([
    DER.encodeExplicitContextDependent(0, DER.encodeInteger(1)),
    // version
    DER.encodeInteger(1),
    // serialNumber
    DER.encodeSequence([
      DER.encodeObjectIdentifier("1.2.840.113549.1.1.11"),
      // sha256WithRSAEncryption PKCS #1
      DER.encodeNull()
    ]),
    // signature
    DER.encodeSequence([
      DER.encodeSet([
        DER.encodeSequence([
          DER.encodeObjectIdentifier("2.5.4.3"),
          // commonName X.520 DN component
          DER.encodePrintableString("localhost")
        ])
      ]),
      DER.encodeSet([
        DER.encodeSequence([
          DER.encodeObjectIdentifier("2.5.4.10"),
          // organizationName X.520 DN component
          DER.encodePrintableString("Playwright Client Certificate Support")
        ])
      ])
    ]),
    // issuer
    DER.encodeSequence([
      DER.encodeDate(notBefore),
      // notBefore
      DER.encodeDate(notAfter)
      // notAfter
    ]),
    // validity
    DER.encodeSequence([
      DER.encodeSet([
        DER.encodeSequence([
          DER.encodeObjectIdentifier("2.5.4.3"),
          // commonName X.520 DN component
          DER.encodePrintableString("localhost")
        ])
      ]),
      DER.encodeSet([
        DER.encodeSequence([
          DER.encodeObjectIdentifier("2.5.4.10"),
          // organizationName X.520 DN component
          DER.encodePrintableString("Playwright Client Certificate Support")
        ])
      ])
    ]),
    // subject
    DER.encodeSequence([
      DER.encodeSequence([
        DER.encodeObjectIdentifier("1.2.840.113549.1.1.1"),
        // rsaEncryption PKCS #1
        DER.encodeNull()
      ]),
      DER.encodeBitString(publicKeyDer)
    ])
    // SubjectPublicKeyInfo
  ]);
  const signature = import_crypto.default.sign("sha256", tbsCertificate, privateKey);
  const certificate = DER.encodeSequence([
    tbsCertificate,
    DER.encodeSequence([
      DER.encodeObjectIdentifier("1.2.840.113549.1.1.11"),
      // sha256WithRSAEncryption PKCS #1
      DER.encodeNull()
    ]),
    DER.encodeBitString(signature)
  ]);
  const certPem = [
    "-----BEGIN CERTIFICATE-----",
    // Split the base64 string into lines of 64 characters
    certificate.toString("base64").match(/.{1,64}/g).join("\n"),
    "-----END CERTIFICATE-----"
  ].join("\n");
  return {
    cert: certPem,
    key: privateKey.export({ type: "pkcs1", format: "pem" })
  };
}
var import_crypto, DER;
var init_crypto = __esm({
  "packages/utils/crypto.ts"() {
    "use strict";
    import_crypto = __toESM(require("crypto"));
    init_assert();
    DER = class {
      static encodeSequence(data) {
        return this._encode(48, Buffer.concat(data));
      }
      static encodeInteger(data) {
        assert(data >= -128 && data <= 127);
        return this._encode(2, Buffer.from([data]));
      }
      static encodeObjectIdentifier(oid) {
        const parts = oid.split(".").map((v) => Number(v));
        const output = [encodeBase128(40 * parts[0] + parts[1])];
        for (let i = 2; i < parts.length; i++)
          output.push(encodeBase128(parts[i]));
        return this._encode(6, Buffer.concat(output));
      }
      static encodeNull() {
        return Buffer.from([5, 0]);
      }
      static encodeSet(data) {
        assert(data.length === 1, "Only one item in the set is supported. We'd need to sort the data to support more.");
        return this._encode(49, Buffer.concat(data));
      }
      static encodeExplicitContextDependent(tag, data) {
        return this._encode(160 + tag, data);
      }
      static encodePrintableString(data) {
        return this._encode(19, Buffer.from(data));
      }
      static encodeBitString(data) {
        const unusedBits = 0;
        const content = Buffer.concat([Buffer.from([unusedBits]), data]);
        return this._encode(3, content);
      }
      static encodeDate(date) {
        const year = date.getUTCFullYear();
        const isGeneralizedTime = year >= 2050;
        const parts = [
          isGeneralizedTime ? year.toString() : year.toString().slice(-2),
          (date.getUTCMonth() + 1).toString().padStart(2, "0"),
          date.getUTCDate().toString().padStart(2, "0"),
          date.getUTCHours().toString().padStart(2, "0"),
          date.getUTCMinutes().toString().padStart(2, "0"),
          date.getUTCSeconds().toString().padStart(2, "0")
        ];
        const encodedDate = parts.join("") + "Z";
        const tag = isGeneralizedTime ? 24 : 23;
        return this._encode(tag, Buffer.from(encodedDate));
      }
      static _encode(tag, data) {
        const lengthBytes = this._encodeLength(data.length);
        return Buffer.concat([Buffer.from([tag]), lengthBytes, data]);
      }
      static _encodeLength(length) {
        if (length < 128) {
          return Buffer.from([length]);
        } else {
          const lengthBytes = [];
          while (length > 0) {
            lengthBytes.unshift(length & 255);
            length >>= 8;
          }
          return Buffer.from([128 | lengthBytes.length, ...lengthBytes]);
        }
      }
    };
  }
});

// packages/utils/env.ts
function getFromENV(name) {
  let value2 = process.env[name];
  value2 = value2 === void 0 ? process.env[`npm_config_${name.toLowerCase()}`] : value2;
  value2 = value2 === void 0 ? process.env[`npm_package_config_${name.toLowerCase()}`] : value2;
  return value2;
}
function getAsBooleanFromENV(name, defaultValue) {
  const value2 = getFromENV(name);
  if (value2 === "false" || value2 === "0")
    return false;
  if (value2)
    return true;
  return !!defaultValue;
}
function getPackageManager() {
  const env = process.env.npm_config_user_agent || "";
  if (env.includes("yarn"))
    return "yarn";
  if (env.includes("pnpm"))
    return "pnpm";
  return "npm";
}
function getPackageManagerExecCommand() {
  const packageManager = getPackageManager();
  if (packageManager === "yarn")
    return "yarn";
  if (packageManager === "pnpm")
    return "pnpm exec";
  return "npx";
}
function isLikelyNpxGlobal() {
  return process.argv.length >= 2 && process.argv[1].includes("_npx");
}
function setPlaywrightTestProcessEnv() {
  return process.env["PLAYWRIGHT_TEST"] = "1";
}
function guessClientName() {
  if (process.env.CLAUDECODE)
    return "Claude Code";
  if (process.env.COPILOT_CLI)
    return "GitHub Copilot";
  return "playwright-cli";
}
function isCodingAgent() {
  return !!process.env.CLAUDECODE || !!process.env.COPILOT_CLI;
}
var init_env = __esm({
  "packages/utils/env.ts"() {
    "use strict";
  }
});

// packages/utils/debug.ts
function debugMode() {
  if (_debugMode === "console")
    return "console";
  if (_debugMode === "0" || _debugMode === "false")
    return "";
  return _debugMode ? "inspector" : "";
}
function isUnderTest() {
  return _isUnderTest;
}
var _debugMode, _isUnderTest;
var init_debug = __esm({
  "packages/utils/debug.ts"() {
    "use strict";
    init_env();
    _debugMode = getFromENV("PWDEBUG") || "";
    _isUnderTest = getAsBooleanFromENV("PWTEST_UNDER_TEST");
  }
});

// packages/utils/debugLogger.ts
var import_fs, debug, debugLoggerColorMap, DebugLogger, debugLogger, kLogCount, RecentLogsCollector;
var init_debugLogger = __esm({
  "packages/utils/debugLogger.ts"() {
    "use strict";
    import_fs = __toESM(require("fs"));
    debug = require("./utilsBundle").debug;
    debugLoggerColorMap = {
      "api": 45,
      // cyan
      "protocol": 34,
      // green
      "install": 34,
      // green
      "download": 34,
      // green
      "browser": 0,
      // reset
      "socks": 92,
      // purple
      "client-certificates": 92,
      // purple
      "error": 160,
      // red,
      "channel": 33,
      // blue
      "server": 45,
      // cyan
      "server:channel": 34,
      // green
      "server:metadata": 33,
      // blue,
      "recorder": 45
      // cyan
    };
    DebugLogger = class {
      constructor() {
        this._debuggers = /* @__PURE__ */ new Map();
        if (process.env.DEBUG_FILE) {
          const ansiRegex2 = new RegExp([
            "[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)",
            "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"
          ].join("|"), "g");
          const stream3 = import_fs.default.createWriteStream(process.env.DEBUG_FILE);
          debug.log = (data) => {
            stream3.write(data.replace(ansiRegex2, ""));
            stream3.write("\n");
          };
        }
      }
      log(name, message) {
        let cachedDebugger = this._debuggers.get(name);
        if (!cachedDebugger) {
          cachedDebugger = debug(`pw:${name}`);
          this._debuggers.set(name, cachedDebugger);
          cachedDebugger.color = debugLoggerColorMap[name] || 0;
        }
        cachedDebugger(message);
      }
      isEnabled(name) {
        return debug.enabled(`pw:${name}`);
      }
    };
    debugLogger = new DebugLogger();
    kLogCount = 150;
    RecentLogsCollector = class {
      constructor() {
        this._logs = [];
        this._listeners = [];
      }
      log(message) {
        this._logs.push(message);
        if (this._logs.length === kLogCount * 2)
          this._logs.splice(0, kLogCount);
        for (const listener of this._listeners)
          listener(message);
      }
      recentLogs() {
        if (this._logs.length > kLogCount)
          return this._logs.slice(-kLogCount);
        return this._logs;
      }
      onMessage(listener) {
        for (const message of this._logs)
          listener(message);
        this._listeners.push(listener);
      }
    };
  }
});

// packages/utils/eventsHelper.ts
var EventsHelper, eventsHelper;
var init_eventsHelper = __esm({
  "packages/utils/eventsHelper.ts"() {
    "use strict";
    EventsHelper = class {
      static addEventListener(emitter, eventName, handler) {
        emitter.on(eventName, handler);
        return { emitter, eventName, handler, dispose: async () => {
          emitter.removeListener(eventName, handler);
        } };
      }
      static removeEventListeners(listeners) {
        for (const listener of listeners)
          listener.emitter.removeListener(listener.eventName, listener.handler);
        listeners.splice(0, listeners.length);
      }
    };
    eventsHelper = EventsHelper;
  }
});

// packages/utils/fileUtils.ts
async function mkdirIfNeeded(filePath) {
  await import_fs2.default.promises.mkdir(import_path2.default.dirname(filePath), { recursive: true }).catch(() => {
  });
}
async function removeFolders(dirs) {
  return await Promise.all(dirs.map(
    (dir) => import_fs2.default.promises.rm(dir, { recursive: true, force: true, maxRetries: 10 }).catch((e) => e)
  ));
}
function canAccessFile(file) {
  if (!file)
    return false;
  try {
    import_fs2.default.accessSync(file);
    return true;
  } catch (e) {
    return false;
  }
}
function isWritable(file) {
  try {
    import_fs2.default.accessSync(file, import_fs2.default.constants.W_OK);
    return true;
  } catch {
    return false;
  }
}
function isSystemDirectory(dir) {
  const resolved = import_path2.default.resolve(dir);
  if (process.platform === "win32") {
    const systemRoot = import_path2.default.resolve(process.env.SystemRoot || "C:\\Windows");
    return isPathInside(systemRoot.toLowerCase(), resolved.toLowerCase());
  }
  return resolved === "/";
}
async function copyFileAndMakeWritable(from, to) {
  await import_fs2.default.promises.copyFile(from, to);
  await import_fs2.default.promises.chmod(to, 436);
}
function addSuffixToFilePath(filePath, suffix) {
  const ext = import_path2.default.extname(filePath);
  const base = filePath.substring(0, filePath.length - ext.length);
  return base + suffix + ext;
}
function sanitizeForFilePath(s) {
  return s.replace(/[\x00-\x2C\x2E-\x2F\x3A-\x40\x5B-\x60\x7B-\x7F]+/g, "-");
}
function trimLongString(s, length = 100) {
  if (s.length <= length)
    return s;
  const hash = calculateSha1(s);
  const middle = `-${hash.substring(0, 5)}-`;
  const start3 = Math.floor((length - middle.length) / 2);
  const end = length - middle.length - start3;
  return s.substring(0, start3) + middle + s.slice(-end);
}
function isPathInside(root, candidate) {
  const resolvedRoot = import_path2.default.resolve(root);
  const resolvedCandidate = import_path2.default.resolve(candidate);
  if (resolvedCandidate === resolvedRoot)
    return true;
  return resolvedCandidate.startsWith(resolvedRoot + import_path2.default.sep);
}
function resolveWithinRoot(root, fileName) {
  if (import_path2.default.isAbsolute(fileName))
    return null;
  const resolvedFile = import_path2.default.resolve(root, fileName);
  return isPathInside(root, resolvedFile) ? resolvedFile : null;
}
function throwingResolveWithinRoot(root, fileName) {
  const resolved = resolveWithinRoot(root, fileName);
  if (!resolved)
    throw new Error(`Path '${fileName}' escapes root directory`);
  return resolved;
}
function toPosixPath(aPath) {
  return aPath.split(import_path2.default.sep).join(import_path2.default.posix.sep);
}
function makeSocketPath(domain, name) {
  const userNameHash = calculateSha1(process.env.USERNAME || process.env.USER || "default").slice(0, 8);
  if (process.platform === "win32") {
    const socketsDir = process.env.PWTEST_SOCKETS_DIR;
    const suffix2 = socketsDir ? `-${calculateSha1(socketsDir).slice(0, 8)}` : "";
    return `\\\\.\\pipe\\pw-${userNameHash}-${domain}-${name}${suffix2}`;
  }
  const baseDir = process.env.PWTEST_SOCKETS_DIR || import_path2.default.join(import_os2.default.tmpdir(), `pw-${userNameHash}`);
  const dir = import_path2.default.join(baseDir, domain);
  const suffix = ".sock";
  const maxNameLength = UNIX_SOCKET_PATH_MAX - dir.length - import_path2.default.sep.length - suffix.length;
  if (maxNameLength < 1)
    throw new Error(`Socket directory path is too long (${dir.length} chars); set PWTEST_SOCKETS_DIR to a shorter location.`);
  const fsFriendlyName = trimLongString(sanitizeForFilePath(name), maxNameLength);
  const result2 = import_path2.default.join(dir, `${fsFriendlyName}${suffix}`);
  import_fs2.default.mkdirSync(dir, { recursive: true });
  return result2;
}
var import_fs2, import_os2, import_path2, existsAsync, UNIX_SOCKET_PATH_MAX;
var init_fileUtils = __esm({
  "packages/utils/fileUtils.ts"() {
    "use strict";
    import_fs2 = __toESM(require("fs"));
    import_os2 = __toESM(require("os"));
    import_path2 = __toESM(require("path"));
    init_crypto();
    existsAsync = (path59) => new Promise((resolve) => import_fs2.default.stat(path59, (err) => resolve(!err)));
    UNIX_SOCKET_PATH_MAX = 103;
  }
});

// packages/utils/linuxUtils.ts
function getLinuxDistributionInfoSync() {
  if (process.platform !== "linux")
    return void 0;
  if (!osRelease && !didFailToReadOSRelease) {
    try {
      const osReleaseText = import_fs3.default.readFileSync("/etc/os-release", "utf8");
      const fields = parseOSReleaseText(osReleaseText);
      osRelease = {
        id: fields.get("id") ?? "",
        version: fields.get("version_id") ?? ""
      };
    } catch (e) {
      didFailToReadOSRelease = true;
    }
  }
  return osRelease;
}
function parseOSReleaseText(osReleaseText) {
  const fields = /* @__PURE__ */ new Map();
  for (const line of osReleaseText.split("\n")) {
    const tokens = line.split("=");
    const name = tokens.shift();
    let value2 = tokens.join("=").trim();
    if (value2.startsWith('"') && value2.endsWith('"'))
      value2 = value2.substring(1, value2.length - 1);
    if (!name)
      continue;
    fields.set(name.toLowerCase(), value2);
  }
  return fields;
}
var import_fs3, didFailToReadOSRelease, osRelease;
var init_linuxUtils = __esm({
  "packages/utils/linuxUtils.ts"() {
    "use strict";
    import_fs3 = __toESM(require("fs"));
    didFailToReadOSRelease = false;
  }
});

// packages/utils/hostPlatform.ts
function calculatePlatform() {
  if (process.env.PLAYWRIGHT_HOST_PLATFORM_OVERRIDE) {
    return {
      hostPlatform: process.env.PLAYWRIGHT_HOST_PLATFORM_OVERRIDE,
      isOfficiallySupportedPlatform: false
    };
  }
  const platform = import_os3.default.platform();
  if (platform === "darwin") {
    const ver = import_os3.default.release().split(".").map((a) => parseInt(a, 10));
    let macVersion = "";
    if (ver[0] < 18) {
      macVersion = "mac10.13";
    } else if (ver[0] === 18) {
      macVersion = "mac10.14";
    } else if (ver[0] === 19) {
      macVersion = "mac10.15";
    } else if (ver[0] < 25) {
      macVersion = "mac" + (ver[0] - 9);
      if (import_os3.default.cpus().some((cpu) => cpu.model.includes("Apple")))
        macVersion += "-arm64";
    } else {
      const LAST_STABLE_MACOS_MAJOR_VERSION = 26;
      macVersion = "mac" + Math.min(ver[0] + 1, LAST_STABLE_MACOS_MAJOR_VERSION);
      if (import_os3.default.cpus().some((cpu) => cpu.model.includes("Apple")))
        macVersion += "-arm64";
    }
    return { hostPlatform: macVersion, isOfficiallySupportedPlatform: true };
  }
  if (platform === "linux") {
    if (!["x64", "arm64"].includes(import_os3.default.arch()))
      return { hostPlatform: "<unknown>", isOfficiallySupportedPlatform: false };
    const archSuffix = "-" + import_os3.default.arch();
    const distroInfo = getLinuxDistributionInfoSync();
    if (distroInfo?.id === "ubuntu" || distroInfo?.id === "pop" || distroInfo?.id === "neon" || distroInfo?.id === "tuxedo") {
      const isUbuntu = distroInfo?.id === "ubuntu";
      const version3 = distroInfo?.version;
      const major2 = parseInt(distroInfo.version, 10);
      if (major2 < 20)
        return { hostPlatform: "ubuntu18.04" + archSuffix, isOfficiallySupportedPlatform: false };
      if (major2 < 22)
        return { hostPlatform: "ubuntu20.04" + archSuffix, isOfficiallySupportedPlatform: isUbuntu && version3 === "20.04" };
      if (major2 < 24)
        return { hostPlatform: "ubuntu22.04" + archSuffix, isOfficiallySupportedPlatform: isUbuntu && version3 === "22.04" };
      if (major2 < 26)
        return { hostPlatform: "ubuntu24.04" + archSuffix, isOfficiallySupportedPlatform: isUbuntu && version3 === "24.04" };
      if (major2 < 28)
        return { hostPlatform: "ubuntu26.04" + archSuffix, isOfficiallySupportedPlatform: isUbuntu && version3 === "26.04" };
      return { hostPlatform: "ubuntu" + distroInfo.version + archSuffix, isOfficiallySupportedPlatform: false };
    }
    if (distroInfo?.id === "linuxmint") {
      const mintMajor = parseInt(distroInfo.version, 10);
      if (mintMajor <= 20)
        return { hostPlatform: "ubuntu20.04" + archSuffix, isOfficiallySupportedPlatform: false };
      if (mintMajor === 21)
        return { hostPlatform: "ubuntu22.04" + archSuffix, isOfficiallySupportedPlatform: false };
      return { hostPlatform: "ubuntu24.04" + archSuffix, isOfficiallySupportedPlatform: false };
    }
    if (distroInfo?.id === "debian" || distroInfo?.id === "raspbian") {
      const isOfficiallySupportedPlatform2 = distroInfo?.id === "debian";
      if (distroInfo?.version === "11")
        return { hostPlatform: "debian11" + archSuffix, isOfficiallySupportedPlatform: isOfficiallySupportedPlatform2 };
      if (distroInfo?.version === "12")
        return { hostPlatform: "debian12" + archSuffix, isOfficiallySupportedPlatform: isOfficiallySupportedPlatform2 };
      if (distroInfo?.version === "13")
        return { hostPlatform: "debian13" + archSuffix, isOfficiallySupportedPlatform: isOfficiallySupportedPlatform2 };
      if (distroInfo?.version === "")
        return { hostPlatform: "debian13" + archSuffix, isOfficiallySupportedPlatform: isOfficiallySupportedPlatform2 };
    }
    return { hostPlatform: "ubuntu24.04" + archSuffix, isOfficiallySupportedPlatform: false };
  }
  if (platform === "win32")
    return { hostPlatform: "win64", isOfficiallySupportedPlatform: true };
  return { hostPlatform: "<unknown>", isOfficiallySupportedPlatform: false };
}
function toShortPlatform(hostPlatform2) {
  if (hostPlatform2 === "<unknown>")
    return "<unknown>";
  if (hostPlatform2 === "win64")
    return "win-x64";
  if (hostPlatform2.startsWith("mac"))
    return hostPlatform2.endsWith("arm64") ? "mac-arm64" : "mac-x64";
  return hostPlatform2.endsWith("arm64") ? "linux-arm64" : "linux-x64";
}
var import_os3, hostPlatform, isOfficiallySupportedPlatform, shortPlatform;
var init_hostPlatform = __esm({
  "packages/utils/hostPlatform.ts"() {
    "use strict";
    import_os3 = __toESM(require("os"));
    init_linuxUtils();
    ({ hostPlatform, isOfficiallySupportedPlatform } = calculatePlatform());
    shortPlatform = toShortPlatform(hostPlatform);
  }
});

// packages/utils/happyEyeballs.ts
async function createSocket(host, port) {
  return new Promise((resolve, reject) => {
    if (import_net.default.isIP(host)) {
      const socket = import_net.default.createConnection({ host, port });
      socket.on("connect", () => resolve(socket));
      socket.on("error", (error) => reject(error));
    } else {
      createConnectionAsync(
        { host, port },
        (err, socket) => {
          if (err)
            reject(err);
          if (socket)
            resolve(socket);
        },
        /* useTLS */
        false
      ).catch((err) => reject(err));
    }
  });
}
async function createConnectionAsync(options, oncreate, useTLS) {
  const lookup = options.__testHookLookup || lookupAddresses;
  const hostname = clientRequestArgsToHostName(options);
  const addresses = await lookup(hostname);
  const dnsLookupAt = monotonicTime();
  const sockets = /* @__PURE__ */ new Set();
  let firstError;
  let errorCount = 0;
  const handleError = (socket, err) => {
    if (!sockets.delete(socket))
      return;
    ++errorCount;
    firstError ??= err;
    if (errorCount === addresses.length)
      oncreate?.(firstError);
  };
  const connected = new ManualPromise();
  for (const { address } of addresses) {
    const socket = useTLS ? import_tls.default.connect({
      ...options,
      port: options.port,
      host: address,
      servername: hostname
    }) : import_net.default.createConnection({
      ...options,
      port: options.port,
      host: address
    });
    socket[kDNSLookupAt] = dnsLookupAt;
    socket.on("connect", () => {
      socket[kTCPConnectionAt] = monotonicTime();
      connected.resolve();
      oncreate?.(null, socket);
      sockets.delete(socket);
      for (const s of sockets)
        s.destroy();
      sockets.clear();
    });
    socket.on("timeout", () => {
      socket.destroy();
      handleError(socket, new Error("Connection timeout"));
    });
    socket.on("error", (e) => handleError(socket, e));
    sockets.add(socket);
    await Promise.race([
      connected,
      new Promise((f) => setTimeout(f, connectionAttemptDelayMs))
    ]);
    if (connected.isDone())
      break;
  }
}
async function lookupAddresses(hostname) {
  const [v4Result, v6Result] = await Promise.allSettled([
    import_dns.default.promises.lookup(hostname, { all: true, family: 4 }),
    import_dns.default.promises.lookup(hostname, { all: true, family: 6 })
  ]);
  const v4Addresses = v4Result.status === "fulfilled" ? v4Result.value : [];
  const v6Addresses = v6Result.status === "fulfilled" ? v6Result.value : [];
  if (!v4Addresses.length && !v6Addresses.length) {
    if (v4Result.status === "rejected")
      throw v4Result.reason;
    throw v6Result.reason;
  }
  const result2 = [];
  for (let i = 0; i < Math.max(v4Addresses.length, v6Addresses.length); i++) {
    if (v6Addresses[i])
      result2.push(v6Addresses[i]);
    if (v4Addresses[i])
      result2.push(v4Addresses[i]);
  }
  return result2;
}
function clientRequestArgsToHostName(options) {
  if (options.hostname)
    return options.hostname;
  if (options.host)
    return options.host;
  throw new Error("Either options.hostname or options.host must be provided");
}
function timingForSocket(socket) {
  return {
    dnsLookupAt: socket[kDNSLookupAt],
    tcpConnectionAt: socket[kTCPConnectionAt]
  };
}
var import_dns, import_http, import_https, import_net, import_tls, connectionAttemptDelayMs, kDNSLookupAt, kTCPConnectionAt, HttpHappyEyeballsAgent, HttpsHappyEyeballsAgent, httpsHappyEyeballsAgent, httpHappyEyeballsAgent;
var init_happyEyeballs = __esm({
  "packages/utils/happyEyeballs.ts"() {
    "use strict";
    import_dns = __toESM(require("dns"));
    import_http = __toESM(require("http"));
    import_https = __toESM(require("https"));
    import_net = __toESM(require("net"));
    import_tls = __toESM(require("tls"));
    init_assert();
    init_manualPromise();
    init_time();
    connectionAttemptDelayMs = 300;
    kDNSLookupAt = Symbol("kDNSLookupAt");
    kTCPConnectionAt = Symbol("kTCPConnectionAt");
    HttpHappyEyeballsAgent = class extends import_http.default.Agent {
      createConnection(options, oncreate) {
        if (import_net.default.isIP(clientRequestArgsToHostName(options)))
          return import_net.default.createConnection(options);
        createConnectionAsync(
          options,
          oncreate,
          /* useTLS */
          false
        ).catch((err) => oncreate?.(err));
      }
    };
    HttpsHappyEyeballsAgent = class extends import_https.default.Agent {
      createConnection(options, oncreate) {
        if (import_net.default.isIP(clientRequestArgsToHostName(options)))
          return import_tls.default.connect(options);
        createConnectionAsync(
          options,
          oncreate,
          /* useTLS */
          true
        ).catch((err) => oncreate?.(err));
      }
    };
    httpsHappyEyeballsAgent = new HttpsHappyEyeballsAgent({ keepAlive: true });
    httpHappyEyeballsAgent = new HttpHappyEyeballsAgent({ keepAlive: true });
  }
});

// packages/utils/network.ts
function httpRequest(params2, onResponse, onError) {
  let url2 = new URL(params2.url);
  const options = {
    method: params2.method || "GET",
    headers: params2.headers
  };
  if (params2.rejectUnauthorized !== void 0)
    options.rejectUnauthorized = params2.rejectUnauthorized;
  const proxyURL = getProxyForUrl(params2.url);
  if (proxyURL) {
    const parsedProxyURL = normalizeProxyURL(proxyURL);
    if (params2.url.startsWith("http:")) {
      options.path = url2.toString();
      const headers = options.headers || {};
      if (!Object.keys(headers).some((header) => header.toLowerCase() === "host"))
        headers.host = url2.host;
      options.headers = headers;
      url2 = parsedProxyURL;
    } else {
      options.agent = new HttpsProxyAgent(parsedProxyURL);
    }
  }
  options.agent ??= url2.protocol === "https:" ? httpsHappyEyeballsAgent : httpHappyEyeballsAgent;
  let cancelRequest;
  const requestCallback = (res) => {
    const statusCode = res.statusCode || 0;
    if (statusCode >= 300 && statusCode < 400 && res.headers.location) {
      request2.destroy();
      cancelRequest = httpRequest({ ...params2, url: new URL(res.headers.location, params2.url).toString() }, onResponse, onError).cancel;
    } else {
      onResponse(res);
    }
  };
  const request2 = url2.protocol === "https:" ? import_https2.default.request(url2, options, requestCallback) : import_http2.default.request(url2, options, requestCallback);
  request2.on("error", onError);
  if (params2.socketTimeout !== void 0) {
    request2.setTimeout(params2.socketTimeout, () => {
      onError(new Error(`Request to ${params2.url} timed out after ${params2.socketTimeout}ms`));
      request2.abort();
    });
  }
  cancelRequest = (e) => {
    try {
      request2.destroy(e);
    } catch {
    }
  };
  request2.end(params2.data);
  return { cancel: (e) => cancelRequest(e) };
}
function shouldBypassProxy(url2, bypass) {
  if (!bypass)
    return false;
  const domains = bypass.split(",").map((s) => {
    s = s.trim();
    if (!s.startsWith("."))
      s = "." + s;
    return s;
  });
  const domain = "." + url2.hostname;
  return domains.some((d) => domain.endsWith(d));
}
function normalizeProxyURL(proxy) {
  proxy = proxy.trim();
  if (!/^\w+:\/\//.test(proxy))
    proxy = "http://" + proxy;
  return new URL(proxy);
}
function createProxyAgent(proxy, forUrl) {
  if (!proxy)
    return;
  if (forUrl && proxy.bypass && shouldBypassProxy(forUrl, proxy.bypass))
    return;
  const proxyURL = normalizeProxyURL(proxy.server);
  if (proxyURL.protocol?.startsWith("socks")) {
    if (proxyURL.protocol === "socks5:")
      proxyURL.protocol = "socks5h:";
    else if (proxyURL.protocol === "socks4:")
      proxyURL.protocol = "socks4a:";
    return new SocksProxyAgent(proxyURL);
  }
  if (proxy.username) {
    proxyURL.username = proxy.username;
    proxyURL.password = proxy.password || "";
  }
  if (forUrl && ["ws:", "wss:"].includes(forUrl.protocol)) {
    return new HttpsProxyAgent(proxyURL);
  }
  return new HttpsProxyAgent(proxyURL);
}
function createHttpServer(...args) {
  const server = import_http2.default.createServer(...args);
  decorateServer(server);
  return server;
}
function createHttpsServer(...args) {
  const server = import_https2.default.createServer(...args);
  decorateServer(server);
  return server;
}
function createHttp2Server(...args) {
  const server = import_http22.default.createSecureServer(...args);
  decorateServer(server);
  return server;
}
async function startHttpServer(server, options) {
  const { host = "localhost", port = 0 } = options;
  const errorPromise = new ManualPromise();
  const errorListener = (error) => errorPromise.reject(error);
  server.on("error", errorListener);
  try {
    server.listen(port, host);
    await Promise.race([
      new Promise((cb) => server.once("listening", cb)),
      errorPromise
    ]);
  } finally {
    server.removeListener("error", errorListener);
  }
}
async function isURLAvailable(url2, ignoreHTTPSErrors, onLog, onStdErr) {
  let statusCode = await httpStatusCode(url2, ignoreHTTPSErrors, onLog, onStdErr);
  if (statusCode === 404 && url2.pathname === "/") {
    const indexUrl = new URL(url2);
    indexUrl.pathname = "/index.html";
    statusCode = await httpStatusCode(indexUrl, ignoreHTTPSErrors, onLog, onStdErr);
  }
  return statusCode >= 200 && statusCode < 404;
}
async function httpStatusCode(url2, ignoreHTTPSErrors, onLog, onStdErr) {
  return new Promise((resolve) => {
    onLog?.(`HTTP GET: ${url2}`);
    httpRequest({
      url: url2.toString(),
      headers: { Accept: "*/*" },
      rejectUnauthorized: !ignoreHTTPSErrors
    }, (res) => {
      res.resume();
      const statusCode = res.statusCode ?? 0;
      onLog?.(`HTTP Status: ${statusCode}`);
      resolve(statusCode);
    }, (error) => {
      if (error.code === "DEPTH_ZERO_SELF_SIGNED_CERT")
        onStdErr?.(`[WebServer] Self-signed certificate detected. Try adding ignoreHTTPSErrors: true to config.webServer.`);
      onLog?.(`Error while checking if ${url2} is available: ${error.message}`);
      resolve(0);
    });
  });
}
function decorateServer(server) {
  const sockets = /* @__PURE__ */ new Set();
  server.on("connection", (socket) => {
    sockets.add(socket);
    socket.once("close", () => sockets.delete(socket));
  });
  const close3 = server.close;
  server.close = (callback) => {
    for (const socket of sockets)
      socket.destroy();
    sockets.clear();
    return close3.call(server, callback);
  };
}
var import_http2, import_http22, import_https2, HttpsProxyAgent, SocksProxyAgent, getProxyForUrl, NET_DEFAULT_TIMEOUT;
var init_network = __esm({
  "packages/utils/network.ts"() {
    "use strict";
    import_http2 = __toESM(require("http"));
    import_http22 = __toESM(require("http2"));
    import_https2 = __toESM(require("https"));
    init_manualPromise();
    init_happyEyeballs();
    ({ HttpsProxyAgent } = require("./utilsBundle"));
    ({ SocksProxyAgent } = require("./utilsBundle"));
    ({ getProxyForUrl } = require("./utilsBundle"));
    NET_DEFAULT_TIMEOUT = 3e4;
  }
});

// packages/utils/httpServer.ts
function computeAllowedHosts(requested, bound) {
  const loopback = /* @__PURE__ */ new Set(["127.0.0.1", "::1", "localhost"]);
  const isLoopback = (h) => h !== void 0 && loopback.has(h.toLowerCase());
  if (!isLoopback(requested) && requested !== void 0)
    return null;
  if (!isLoopback(bound) && requested === void 0)
    return null;
  return /* @__PURE__ */ new Set(["localhost", "127.0.0.1", "[::1]"]);
}
function urlHostFromAddress(address) {
  return address.family === "IPv6" ? `[${address.address}]` : address.address;
}
function hostnameFromHostHeader(host) {
  if (host.startsWith("[")) {
    const end = host.indexOf("]");
    return end < 0 ? host : host.substring(0, end + 1);
  }
  const colon = host.indexOf(":");
  return colon < 0 ? host : host.substring(0, colon);
}
function serveFolder(folder) {
  const server = new HttpServer(folder);
  server.routePrefix("/", (request2, response2) => {
    let relativePath = new URL("http://localhost" + request2.url).pathname;
    if (relativePath.startsWith("/trace/file")) {
      const url2 = new URL("http://localhost" + request2.url);
      const requested = url2.searchParams.get("path");
      if (!requested)
        return false;
      const resolved = import_path3.default.resolve(requested);
      try {
        return server.serveFile(request2, response2, resolved);
      } catch (e) {
        return false;
      }
    }
    if (relativePath === "/")
      relativePath = "/index.html";
    const absolutePath = import_path3.default.join(folder, ...relativePath.split("/"));
    return server.serveFile(request2, response2, absolutePath);
  });
  return server;
}
var import_fs4, import_path3, mime, wsServer, HttpServer;
var init_httpServer = __esm({
  "packages/utils/httpServer.ts"() {
    "use strict";
    import_fs4 = __toESM(require("fs"));
    import_path3 = __toESM(require("path"));
    init_assert();
    init_crypto();
    init_fileUtils();
    init_network();
    mime = require("./utilsBundle").mime;
    ({ wsServer } = require("./utilsBundle"));
    HttpServer = class {
      constructor(staticRoot) {
        this._urlPrefixPrecise = "";
        this._urlPrefixHumanReadable = "";
        this._port = 0;
        this._started = false;
        this._routes = [];
        // Allowed Host headers; null disables the check (host bound to a public address).
        this._allowedHosts = null;
        this._server = createHttpServer(this._onRequest.bind(this));
        this._staticRoot = staticRoot ? import_path3.default.resolve(staticRoot) : void 0;
      }
      server() {
        return this._server;
      }
      routePrefix(prefix, handler) {
        this._routes.push({ prefix, handler });
      }
      routePath(path59, handler) {
        this._routes.push({ exact: path59, handler });
      }
      port() {
        return this._port;
      }
      createWebSocket(transportFactory, guid) {
        assert(!this._wsGuid, "can only create one main websocket transport per server");
        this._wsGuid = guid || createGuid();
        const wsPath = "/" + this._wsGuid;
        const wss = new wsServer({ noServer: true });
        this._server.on("upgrade", (request2, socket, head) => {
          const pathname = new URL(request2.url ?? "/", "http://localhost").pathname;
          if (pathname !== wsPath)
            return;
          wss.handleUpgrade(request2, socket, head, (ws4) => wss.emit("connection", ws4, request2));
        });
        wss.on("connection", (ws4, request2) => {
          const url2 = new URL(request2.url ?? "/", "http://localhost");
          const transport = transportFactory(url2);
          transport.sendEvent = (method, params2) => ws4.send(JSON.stringify({ method, params: params2 }));
          transport.close = () => ws4.close();
          transport.onconnect();
          ws4.on("message", async (message) => {
            const { id, method, params: params2 } = JSON.parse(String(message));
            try {
              const result2 = await transport.dispatch(method, params2);
              ws4.send(JSON.stringify({ id, result: result2 }));
            } catch (e) {
              ws4.send(JSON.stringify({ id, error: String(e) }));
            }
          });
          ws4.on("close", () => transport.onclose());
          ws4.on("error", () => transport.onclose());
        });
      }
      wsGuid() {
        return this._wsGuid;
      }
      async createViteDevServer(options) {
        const loadVite = new Function('return import("vite")');
        const vite = await loadVite();
        return await vite.createServer({
          root: options.root,
          base: options.base,
          server: {
            middlewareMode: true,
            // Dedicated path so Vite's HMR websocket does not collide with any
            // websocket HttpServer owns via createWebSocket().
            hmr: { path: "/__vite_hmr", server: this._server }
          },
          appType: "spa",
          clearScreen: false
        });
      }
      // HMR end
      // Vite's middleware `next` callback for the "no middleware matched" case;
      // emits a 404 only if nothing downstream already responded.
      static notFoundFallback(response2) {
        return () => {
          if (!response2.headersSent) {
            response2.statusCode = 404;
            response2.end();
          }
        };
      }
      async start(options = {}) {
        assert(!this._started, "server already started");
        this._started = true;
        const host = options.host;
        if (options.preferredPort) {
          try {
            await startHttpServer(this._server, { port: options.preferredPort, host });
          } catch (e) {
            if (!e || !e.message || !e.message.includes("EADDRINUSE"))
              throw e;
            await startHttpServer(this._server, { host });
          }
        } else {
          await startHttpServer(this._server, { port: options.port, host });
        }
        const address = this._server.address();
        assert(address, "Could not bind server socket");
        if (typeof address === "string") {
          this._urlPrefixPrecise = address;
          this._urlPrefixHumanReadable = address;
        } else {
          this._port = address.port;
          this._urlPrefixPrecise = `http://${urlHostFromAddress(address)}:${address.port}`;
          this._urlPrefixHumanReadable = `http://${host ?? "localhost"}:${address.port}`;
          this._allowedHosts = computeAllowedHosts(host, address.address);
        }
      }
      async stop() {
        await new Promise((cb) => this._server.close(cb));
      }
      urlPrefix(purpose) {
        return purpose === "human-readable" ? this._urlPrefixHumanReadable : this._urlPrefixPrecise;
      }
      serveFile(request2, response2, absoluteFilePath, headers, options) {
        if (this._staticRoot && !options?.skipRootCheck && !isPathInside(this._staticRoot, absoluteFilePath)) {
          response2.statusCode = 403;
          response2.end();
          return true;
        }
        try {
          for (const [name, value2] of Object.entries(headers || {}))
            response2.setHeader(name, value2);
          if (request2.headers.range)
            this._serveRangeFile(request2, response2, absoluteFilePath);
          else
            this._serveFile(response2, absoluteFilePath);
          return true;
        } catch (e) {
          return false;
        }
      }
      _serveFile(response2, absoluteFilePath) {
        const content = import_fs4.default.readFileSync(absoluteFilePath);
        response2.statusCode = 200;
        const contentType = mime.getType(import_path3.default.extname(absoluteFilePath)) || "application/octet-stream";
        response2.setHeader("Content-Type", contentType);
        response2.setHeader("Content-Length", content.byteLength);
        response2.end(content);
      }
      _serveRangeFile(request2, response2, absoluteFilePath) {
        const range = request2.headers.range;
        if (!range || !range.startsWith("bytes=") || range.includes(", ") || [...range].filter((char) => char === "-").length !== 1) {
          response2.statusCode = 400;
          return response2.end("Bad request");
        }
        const [startStr, endStr] = range.replace(/bytes=/, "").split("-");
        let start3;
        let end;
        const size = import_fs4.default.statSync(absoluteFilePath).size;
        if (startStr !== "" && endStr === "") {
          start3 = +startStr;
          end = size - 1;
        } else if (startStr === "" && endStr !== "") {
          start3 = size - +endStr;
          end = size - 1;
        } else {
          start3 = +startStr;
          end = +endStr;
        }
        if (Number.isNaN(start3) || Number.isNaN(end) || start3 >= size || end >= size || start3 > end) {
          response2.writeHead(416, {
            "Content-Range": `bytes */${size}`
          });
          return response2.end();
        }
        response2.writeHead(206, {
          "Content-Range": `bytes ${start3}-${end}/${size}`,
          "Accept-Ranges": "bytes",
          "Content-Length": end - start3 + 1,
          "Content-Type": mime.getType(import_path3.default.extname(absoluteFilePath))
        });
        const readable = import_fs4.default.createReadStream(absoluteFilePath, { start: start3, end });
        readable.pipe(response2);
      }
      _onRequest(request2, response2) {
        if (request2.method === "OPTIONS") {
          response2.writeHead(200);
          response2.end();
          return;
        }
        if (this._allowedHosts) {
          const host = request2.headers.host?.toLowerCase();
          const hostname = host ? hostnameFromHostHeader(host) : void 0;
          if (!hostname || !this._allowedHosts.has(hostname)) {
            response2.statusCode = 403;
            response2.end();
            return;
          }
        }
        request2.on("error", () => response2.end());
        try {
          if (!request2.url) {
            response2.end();
            return;
          }
          const url2 = new URL("http://localhost" + request2.url);
          for (const route2 of this._routes) {
            if (route2.exact && url2.pathname === route2.exact && route2.handler(request2, response2))
              return;
            if (route2.prefix && url2.pathname.startsWith(route2.prefix) && route2.handler(request2, response2))
              return;
          }
          response2.statusCode = 404;
          response2.end();
        } catch (e) {
          response2.end();
        }
      }
    };
  }
});

// packages/utils/zones.ts
function currentZone() {
  return asyncLocalStorage.getStore() ?? emptyZone;
}
var import_async_hooks, asyncLocalStorage, Zone, emptyZone;
var init_zones = __esm({
  "packages/utils/zones.ts"() {
    "use strict";
    import_async_hooks = require("async_hooks");
    asyncLocalStorage = new import_async_hooks.AsyncLocalStorage();
    Zone = class _Zone {
      constructor(asyncLocalStorage2, store) {
        this._asyncLocalStorage = asyncLocalStorage2;
        this._data = store;
      }
      with(type3, data) {
        return new _Zone(this._asyncLocalStorage, new Map(this._data).set(type3, data));
      }
      without(type3) {
        const data = type3 ? new Map(this._data) : /* @__PURE__ */ new Map();
        data.delete(type3);
        return new _Zone(this._asyncLocalStorage, data);
      }
      run(func) {
        return this._asyncLocalStorage.run(this, func);
      }
      data(type3) {
        return this._data.get(type3);
      }
    };
    emptyZone = new Zone(asyncLocalStorage, /* @__PURE__ */ new Map());
  }
});

// packages/utils/nodePlatform.ts
function setBoxedStackPrefixes(prefixes) {
  boxedStackPrefixes = prefixes;
}
var import_crypto4, import_fs5, import_path4, util, import_stream, import_events, colors2, pipelineAsync, NodeZone, boxedStackPrefixes, nodePlatform, ReadableStreamImpl, WritableStreamImpl;
var init_nodePlatform = __esm({
  "packages/utils/nodePlatform.ts"() {
    "use strict";
    import_crypto4 = __toESM(require("crypto"));
    import_fs5 = __toESM(require("fs"));
    import_path4 = __toESM(require("path"));
    util = __toESM(require("util"));
    import_stream = require("stream");
    import_events = require("events");
    init_debugLogger();
    init_zones();
    init_debug();
    colors2 = require("./utilsBundle").colors;
    pipelineAsync = util.promisify(import_stream.pipeline);
    NodeZone = class _NodeZone {
      constructor(zone) {
        this._zone = zone;
      }
      push(data) {
        return new _NodeZone(this._zone.with("apiZone", data));
      }
      pop() {
        return new _NodeZone(this._zone.without("apiZone"));
      }
      run(func) {
        return this._zone.run(func);
      }
      data() {
        return this._zone.data("apiZone");
      }
    };
    boxedStackPrefixes = [];
    nodePlatform = (coreDir) => ({
      name: "node",
      boxedStackPrefixes: () => {
        if (process.env.PWDEBUGIMPL)
          return [];
        return [coreDir, ...boxedStackPrefixes];
      },
      calculateSha1: (text2) => {
        const sha1 = import_crypto4.default.createHash("sha1");
        sha1.update(text2);
        return Promise.resolve(sha1.digest("hex"));
      },
      colors: colors2,
      coreDir,
      createGuid: () => import_crypto4.default.randomBytes(16).toString("hex"),
      defaultMaxListeners: () => import_events.EventEmitter.defaultMaxListeners,
      fs: () => import_fs5.default,
      env: process.env,
      inspectCustom: util.inspect.custom,
      isDebugMode: () => debugMode() === "inspector",
      isJSDebuggerAttached: () => !!require("inspector").url(),
      isLogEnabled(name) {
        return debugLogger.isEnabled(name);
      },
      isUnderTest: () => isUnderTest(),
      log(name, message) {
        debugLogger.log(name, message);
      },
      path: () => import_path4.default,
      pathSeparator: import_path4.default.sep,
      showInternalStackFrames: () => !!process.env.PWDEBUGIMPL,
      async streamFile(path59, stream3) {
        await pipelineAsync(import_fs5.default.createReadStream(path59), stream3);
      },
      streamReadable: (channel) => {
        return new ReadableStreamImpl(channel);
      },
      streamWritable: (channel) => {
        return new WritableStreamImpl(channel);
      },
      zones: {
        current: () => new NodeZone(currentZone()),
        empty: new NodeZone(emptyZone)
      }
    });
    ReadableStreamImpl = class extends import_stream.Readable {
      constructor(channel) {
        super();
        this._channel = channel;
      }
      async _read() {
        const result2 = await this._channel.read({ size: 1024 * 1024 });
        if (result2.binary.byteLength)
          this.push(result2.binary);
        else
          this.push(null);
      }
      _destroy(error, callback) {
        this._channel.close().catch((e) => null);
        super._destroy(error, callback);
      }
    };
    WritableStreamImpl = class extends import_stream.Writable {
      constructor(channel) {
        super();
        this._channel = channel;
      }
      async _write(chunk, encoding, callback) {
        const error = await this._channel.write({ binary: typeof chunk === "string" ? Buffer.from(chunk) : chunk }).catch((e) => e);
        callback(error || null);
      }
      async _final(callback) {
        const error = await this._channel.close().catch((e) => e);
        callback(error || null);
      }
    };
  }
});

// packages/utils/processLauncher.ts
async function gracefullyCloseAll() {
  await Promise.all(Array.from(gracefullyCloseSet).map((gracefullyClose) => gracefullyClose().catch((e) => {
  })));
}
function gracefullyProcessExitDoNotHang(code, onExit2) {
  const beforeExit = onExit2 ? () => onExit2().catch(() => {
  }) : () => Promise.resolve();
  const callback = () => beforeExit().then(() => process.exit(code));
  setTimeout(callback, 3e4);
  gracefullyCloseAll().then(callback);
}
function exitHandler() {
  for (const kill of killSet)
    kill();
}
function sigintHandler() {
  const exitWithCode130 = () => {
    if (isUnderTest()) {
      setTimeout(() => process.exit(130), 1e3);
    } else {
      process.exit(130);
    }
  };
  if (sigintHandlerCalled) {
    process.off("SIGINT", sigintHandler);
    for (const kill of killSet)
      kill();
    exitWithCode130();
  } else {
    sigintHandlerCalled = true;
    gracefullyCloseAll().then(() => exitWithCode130());
  }
}
function sigtermHandler() {
  gracefullyCloseAll();
}
function sighupHandler() {
  gracefullyCloseAll();
}
function addProcessHandlerIfNeeded(name) {
  if (!installedHandlers.has(name)) {
    installedHandlers.add(name);
    process.on(name, processHandlers[name]);
  }
}
function removeProcessHandlersIfNeeded() {
  if (killSet.size)
    return;
  for (const handler of installedHandlers)
    process.off(handler, processHandlers[handler]);
  installedHandlers.clear();
}
async function launchProcess(options) {
  const stdio = options.stdio === "pipe" ? ["ignore", "pipe", "pipe", "pipe", "pipe"] : ["pipe", "pipe", "pipe"];
  options.log(`<launching> ${options.command} ${options.args ? options.args.join(" ") : ""}`);
  const spawnOptions = {
    // On non-windows platforms, `detached: true` makes child process a leader of a new
    // process group, making it possible to kill child process tree with `.kill(-pid)` command.
    // @see https://nodejs.org/api/child_process.html#child_process_options_detached
    detached: process.platform !== "win32",
    env: options.env,
    cwd: options.cwd,
    shell: options.shell,
    stdio
  };
  const spawnedProcess = childProcess.spawn(options.command, options.args || [], spawnOptions);
  const cleanup = async () => {
    options.log(`[pid=${spawnedProcess.pid || "N/A"}] starting temporary directories cleanup`);
    const errors = await removeFolders(options.tempDirectories);
    for (let i = 0; i < options.tempDirectories.length; ++i) {
      if (errors[i])
        options.log(`[pid=${spawnedProcess.pid || "N/A"}] exception while removing ${options.tempDirectories[i]}: ${errors[i]}`);
    }
    options.log(`[pid=${spawnedProcess.pid || "N/A"}] finished temporary directories cleanup`);
  };
  spawnedProcess.on("error", () => {
  });
  if (!spawnedProcess.pid) {
    let failed;
    const failedPromise = new Promise((f, r) => failed = f);
    spawnedProcess.once("error", (error) => {
      failed(new Error("Failed to launch: " + error));
    });
    return failedPromise.then(async (error) => {
      await cleanup();
      throw error;
    });
  }
  options.log(`<launched> pid=${spawnedProcess.pid}`);
  const stdout = readline.createInterface({ input: spawnedProcess.stdout });
  stdout.on("line", (data) => {
    options.log(`[pid=${spawnedProcess.pid}][out] ` + data);
  });
  const stderr = readline.createInterface({ input: spawnedProcess.stderr });
  stderr.on("line", (data) => {
    options.log(`[pid=${spawnedProcess.pid}][err] ` + data);
  });
  let processClosed = false;
  let fulfillCleanup = () => {
  };
  const waitForCleanup = new Promise((f) => fulfillCleanup = f);
  spawnedProcess.once("close", (exitCode, signal) => {
    options.log(`[pid=${spawnedProcess.pid}] <process did exit: exitCode=${exitCode}, signal=${signal}>`);
    processClosed = true;
    gracefullyCloseSet.delete(gracefullyClose);
    killSet.delete(killProcessAndCleanup);
    removeProcessHandlersIfNeeded();
    options.onExit(exitCode, signal);
    cleanup().then(fulfillCleanup);
  });
  addProcessHandlerIfNeeded("exit");
  if (options.handleSIGINT)
    addProcessHandlerIfNeeded("SIGINT");
  if (options.handleSIGTERM)
    addProcessHandlerIfNeeded("SIGTERM");
  if (options.handleSIGHUP)
    addProcessHandlerIfNeeded("SIGHUP");
  gracefullyCloseSet.add(gracefullyClose);
  killSet.add(killProcessAndCleanup);
  let gracefullyClosing = false;
  async function gracefullyClose() {
    if (gracefullyClosing) {
      options.log(`[pid=${spawnedProcess.pid}] <forcefully close>`);
      killProcess();
      await waitForCleanup;
      return;
    }
    gracefullyClosing = true;
    options.log(`[pid=${spawnedProcess.pid}] <gracefully close start>`);
    await options.attemptToGracefullyClose().catch(() => killProcess());
    await waitForCleanup;
    options.log(`[pid=${spawnedProcess.pid}] <gracefully close end>`);
  }
  function killProcess() {
    gracefullyCloseSet.delete(gracefullyClose);
    killSet.delete(killProcessAndCleanup);
    removeProcessHandlersIfNeeded();
    options.log(`[pid=${spawnedProcess.pid}] <kill>`);
    if (spawnedProcess.pid && !spawnedProcess.killed && !processClosed) {
      options.log(`[pid=${spawnedProcess.pid}] <will force kill>`);
      try {
        if (process.platform === "win32") {
          const taskkillProcess = childProcess.spawnSync(`taskkill /pid ${spawnedProcess.pid} /T /F`, { shell: true });
          const [stdout2, stderr2] = [taskkillProcess.stdout.toString(), taskkillProcess.stderr.toString()];
          if (stdout2)
            options.log(`[pid=${spawnedProcess.pid}] taskkill stdout: ${stdout2}`);
          if (stderr2)
            options.log(`[pid=${spawnedProcess.pid}] taskkill stderr: ${stderr2}`);
        } else {
          process.kill(-spawnedProcess.pid, "SIGKILL");
        }
      } catch (e) {
        options.log(`[pid=${spawnedProcess.pid}] exception while trying to kill process: ${e}`);
      }
    } else {
      options.log(`[pid=${spawnedProcess.pid}] <skipped force kill spawnedProcess.killed=${spawnedProcess.killed} processClosed=${processClosed}>`);
    }
  }
  function killProcessAndCleanup() {
    killProcess();
    options.log(`[pid=${spawnedProcess.pid || "N/A"}] starting temporary directories cleanup`);
    for (const dir of options.tempDirectories) {
      try {
        import_fs6.default.rmSync(dir, { force: true, recursive: true, maxRetries: 5 });
      } catch (e) {
        options.log(`[pid=${spawnedProcess.pid || "N/A"}] exception while removing ${dir}: ${e}`);
      }
    }
    options.log(`[pid=${spawnedProcess.pid || "N/A"}] finished temporary directories cleanup`);
  }
  function killAndWait() {
    killProcess();
    return waitForCleanup;
  }
  return { launchedProcess: spawnedProcess, gracefullyClose, kill: killAndWait };
}
function envArrayToObject(env) {
  const result2 = {};
  for (const { name, value: value2 } of env)
    result2[name] = value2;
  return result2;
}
var childProcess, import_fs6, readline, gracefullyCloseSet, killSet, sigintHandlerCalled, installedHandlers, processHandlers;
var init_processLauncher = __esm({
  "packages/utils/processLauncher.ts"() {
    "use strict";
    childProcess = __toESM(require("child_process"));
    import_fs6 = __toESM(require("fs"));
    readline = __toESM(require("readline"));
    init_fileUtils();
    init_debug();
    gracefullyCloseSet = /* @__PURE__ */ new Set();
    killSet = /* @__PURE__ */ new Set();
    sigintHandlerCalled = false;
    installedHandlers = /* @__PURE__ */ new Set();
    processHandlers = {
      exit: exitHandler,
      SIGINT: sigintHandler,
      SIGTERM: sigtermHandler,
      SIGHUP: sighupHandler
    };
  }
});

// packages/utils/profiler.ts
async function startProfiling() {
  if (!profileDir)
    return;
  session = new (require("inspector")).Session();
  session.connect();
  await new Promise((f) => {
    session.post("Profiler.enable", () => {
      session.post("Profiler.start", f);
    });
  });
}
async function stopProfiling(profileName) {
  if (!profileDir)
    return;
  await new Promise((f) => session.post("Profiler.stop", (err, { profile }) => {
    if (!err) {
      import_fs7.default.mkdirSync(profileDir, { recursive: true });
      import_fs7.default.writeFileSync(import_path5.default.join(profileDir, profileName + ".json"), JSON.stringify(profile));
    }
    f();
  }));
}
var import_fs7, import_path5, profileDir, session;
var init_profiler = __esm({
  "packages/utils/profiler.ts"() {
    "use strict";
    import_fs7 = __toESM(require("fs"));
    import_path5 = __toESM(require("path"));
    profileDir = process.env.PWTEST_PROFILE_DIR || "";
  }
});

// packages/utils/serializedFS.ts
var import_fs8, yazl, APPEND_CHUNK_SIZE, SerializedFS;
var init_serializedFS = __esm({
  "packages/utils/serializedFS.ts"() {
    "use strict";
    import_fs8 = __toESM(require("fs"));
    init_manualPromise();
    yazl = require("./utilsBundle").yazl;
    APPEND_CHUNK_SIZE = 64 * 1024;
    SerializedFS = class {
      constructor() {
        this._buffers = /* @__PURE__ */ new Map();
        this._operations = [];
        this._operationsDone = new ManualPromise();
        this._operationsDone.resolve();
      }
      mkdir(dir) {
        this._appendOperation({ op: "mkdir", dir });
      }
      writeFile(file, content, skipIfExists) {
        this._buffers.delete(file);
        this._appendOperation({ op: "writeFile", file, content, skipIfExists });
      }
      appendFile(file, text2, flush) {
        if (!this._buffers.has(file))
          this._buffers.set(file, []);
        const buffer = this._buffers.get(file);
        buffer.push(text2);
        let size = 0;
        for (const chunk of buffer)
          size += chunk.length;
        if (flush || size >= APPEND_CHUNK_SIZE)
          this._flushFile(file);
      }
      _flushFile(file) {
        const buffer = this._buffers.get(file);
        if (buffer === void 0)
          return;
        const content = buffer.join("");
        this._buffers.delete(file);
        this._appendOperation({ op: "appendFile", file, content });
      }
      copyFile(from, to) {
        this._flushFile(from);
        this._buffers.delete(to);
        this._appendOperation({ op: "copyFile", from, to });
      }
      async syncAndGetError() {
        for (const file of this._buffers.keys())
          this._flushFile(file);
        await this._operationsDone;
        return this._error;
      }
      zip(entries, zipFileName) {
        for (const file of this._buffers.keys())
          this._flushFile(file);
        this._appendOperation({ op: "zip", entries, zipFileName });
      }
      // This method serializes all writes to the trace.
      _appendOperation(op) {
        const last = this._operations[this._operations.length - 1];
        if (last?.op === "appendFile" && op.op === "appendFile" && last.file === op.file && last.content.length < APPEND_CHUNK_SIZE) {
          last.content += op.content;
          return;
        }
        this._operations.push(op);
        if (this._operationsDone.isDone())
          this._performOperations();
      }
      async _performOperations() {
        this._operationsDone = new ManualPromise();
        while (this._operations.length) {
          const op = this._operations.shift();
          if (this._error)
            continue;
          try {
            await this._performOperation(op);
          } catch (e) {
            this._error = e;
          }
        }
        this._operationsDone.resolve();
      }
      async _performOperation(op) {
        switch (op.op) {
          case "mkdir": {
            await import_fs8.default.promises.mkdir(op.dir, { recursive: true });
            return;
          }
          case "writeFile": {
            if (op.skipIfExists)
              await import_fs8.default.promises.writeFile(op.file, op.content, { flag: "wx" }).catch(() => {
              });
            else
              await import_fs8.default.promises.writeFile(op.file, op.content);
            return;
          }
          case "copyFile": {
            await import_fs8.default.promises.copyFile(op.from, op.to);
            return;
          }
          case "appendFile": {
            await import_fs8.default.promises.appendFile(op.file, op.content);
            return;
          }
          case "zip": {
            const zipFile = new yazl.ZipFile();
            const result2 = new ManualPromise();
            zipFile.on("error", (error) => result2.reject(error));
            for (const entry of op.entries)
              zipFile.addFile(entry.value, entry.name);
            zipFile.end();
            zipFile.outputStream.pipe(import_fs8.default.createWriteStream(op.zipFileName)).on("close", () => result2.resolve()).on("error", (error) => result2.reject(error));
            await result2;
            return;
          }
        }
      }
    };
  }
});

// packages/utils/socksProxy.ts
function hexToNumber(hex) {
  return [...hex].reduce((value2, digit2) => {
    const code = digit2.charCodeAt(0);
    if (code >= 48 && code <= 57)
      return value2 + code;
    if (code >= 97 && code <= 102)
      return value2 + (code - 97) + 10;
    if (code >= 65 && code <= 70)
      return value2 + (code - 65) + 10;
    throw new Error("Invalid IPv6 token " + hex);
  }, 0);
}
function ipToSocksAddress(address) {
  const ipv4Mapped = /^::ffff:(\d+\.\d+\.\d+\.\d+)$/i.exec(address);
  if (ipv4Mapped)
    address = ipv4Mapped[1];
  if (import_net2.default.isIPv4(address)) {
    return [
      1,
      // IPv4
      ...address.split(".", 4).map((t) => +t & 255)
      // Address
    ];
  }
  if (import_net2.default.isIPv6(address)) {
    const result2 = [4];
    const tokens = address.split(":", 8);
    while (tokens.length < 8)
      tokens.unshift("");
    for (const token of tokens) {
      const value2 = hexToNumber(token);
      result2.push(value2 >> 8 & 255, value2 & 255);
    }
    return result2;
  }
  throw new Error("Only IPv4 and IPv6 addresses are supported");
}
function starMatchToRegex(pattern) {
  const source11 = pattern.split("*").map((s) => {
    return s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
  }).join(".*");
  return new RegExp("^" + source11 + "$");
}
function parsePattern(pattern) {
  if (!pattern)
    return () => false;
  const matchers = pattern.split(",").map((token) => {
    const match = token.match(/^(.*?)(?::(\d+))?$/);
    if (!match)
      throw new Error(`Unsupported token "${token}" in pattern "${pattern}"`);
    const tokenPort = match[2] ? +match[2] : void 0;
    const portMatches = (port) => tokenPort === void 0 || tokenPort === port;
    let tokenHost = match[1];
    if (tokenHost === "<loopback>") {
      return (host, port) => {
        if (!portMatches(port))
          return false;
        return host === "localhost" || host.endsWith(".localhost") || host === "127.0.0.1" || host === "[::1]";
      };
    }
    if (tokenHost === "*")
      return (host, port) => portMatches(port);
    if (import_net2.default.isIPv4(tokenHost) || import_net2.default.isIPv6(tokenHost))
      return (host, port) => host === tokenHost && portMatches(port);
    if (tokenHost[0] === ".")
      tokenHost = "*" + tokenHost;
    const tokenRegex = starMatchToRegex(tokenHost);
    return (host, port) => {
      if (!portMatches(port))
        return false;
      if (import_net2.default.isIPv4(host) || import_net2.default.isIPv6(host))
        return false;
      return !!host.match(tokenRegex);
    };
  });
  return (host, port) => matchers.some((matcher) => matcher(host, port));
}
var import_events2, import_net2, SocksConnection, SocksProxy, SocksProxyHandler;
var init_socksProxy = __esm({
  "packages/utils/socksProxy.ts"() {
    "use strict";
    import_events2 = __toESM(require("events"));
    import_net2 = __toESM(require("net"));
    init_assert();
    init_crypto();
    init_debugLogger();
    init_happyEyeballs();
    SocksConnection = class {
      constructor(uid, socket, client) {
        this._buffer = Buffer.from([]);
        this._offset = 0;
        this._fence = 0;
        this._uid = uid;
        this._socket = socket;
        this._client = client;
        this._boundOnData = this._onData.bind(this);
        socket.on("data", this._boundOnData);
        socket.on("close", () => this._onClose());
        socket.on("end", () => this._onClose());
        socket.on("error", () => this._onClose());
        this._run().catch(() => this._socket.end());
      }
      async _run() {
        assert(await this._authenticate());
        const { command, host, port } = await this._parseRequest();
        if (command !== 1 /* CONNECT */) {
          this._writeBytes(Buffer.from([
            5,
            7 /* CommandNotSupported */,
            0,
            // RSV
            1,
            // IPv4
            0,
            0,
            0,
            0,
            // Address
            0,
            0
            // Port
          ]));
          return;
        }
        this._socket.off("data", this._boundOnData);
        this._client.onSocketRequested({ uid: this._uid, host, port });
      }
      async _authenticate() {
        const version3 = await this._readByte();
        assert(version3 === 5, "The VER field must be set to x05 for this version of the protocol, was " + version3);
        const nMethods = await this._readByte();
        assert(nMethods, "No authentication methods specified");
        const methods = await this._readBytes(nMethods);
        for (const method of methods) {
          if (method === 0) {
            this._writeBytes(Buffer.from([version3, method]));
            return true;
          }
        }
        this._writeBytes(Buffer.from([version3, 255 /* NO_ACCEPTABLE_METHODS */]));
        return false;
      }
      async _parseRequest() {
        const version3 = await this._readByte();
        assert(version3 === 5, "The VER field must be set to x05 for this version of the protocol, was " + version3);
        const command = await this._readByte();
        await this._readByte();
        const addressType = await this._readByte();
        let host = "";
        switch (addressType) {
          case 1 /* IPv4 */:
            host = (await this._readBytes(4)).join(".");
            break;
          case 3 /* FqName */:
            const length = await this._readByte();
            host = (await this._readBytes(length)).toString();
            break;
          case 4 /* IPv6 */:
            const bytes = await this._readBytes(16);
            const tokens = [];
            for (let i = 0; i < 8; ++i)
              tokens.push(bytes.readUInt16BE(i * 2).toString(16));
            host = tokens.join(":");
            break;
        }
        const port = (await this._readBytes(2)).readUInt16BE(0);
        this._buffer = Buffer.from([]);
        this._offset = 0;
        this._fence = 0;
        return {
          command,
          host,
          port
        };
      }
      async _readByte() {
        const buffer = await this._readBytes(1);
        return buffer[0];
      }
      async _readBytes(length) {
        this._fence = this._offset + length;
        if (!this._buffer || this._buffer.length < this._fence)
          await new Promise((f) => this._fenceCallback = f);
        this._offset += length;
        return this._buffer.slice(this._offset - length, this._offset);
      }
      _writeBytes(buffer) {
        if (this._socket.writable)
          this._socket.write(buffer);
      }
      _onClose() {
        this._client.onSocketClosed({ uid: this._uid });
      }
      _onData(buffer) {
        this._buffer = Buffer.concat([this._buffer, buffer]);
        if (this._fenceCallback && this._buffer.length >= this._fence) {
          const callback = this._fenceCallback;
          this._fenceCallback = void 0;
          callback();
        }
      }
      socketConnected(host, port) {
        this._writeBytes(Buffer.from([
          5,
          0 /* Succeeded */,
          0,
          // RSV
          ...ipToSocksAddress(host),
          // ATYP, Address
          port >> 8,
          port & 255
          // Port
        ]));
        this._socket.on("data", (data) => this._client.onSocketData({ uid: this._uid, data }));
      }
      socketFailed(errorCode) {
        const buffer = Buffer.from([
          5,
          0,
          0,
          // RSV
          ...ipToSocksAddress("0.0.0.0"),
          // ATYP, Address
          0,
          0
          // Port
        ]);
        switch (errorCode) {
          case "ENOENT":
          case "ENOTFOUND":
          case "ETIMEDOUT":
          case "EHOSTUNREACH":
            buffer[1] = 4 /* HostUnreachable */;
            break;
          case "ENETUNREACH":
            buffer[1] = 3 /* NetworkUnreachable */;
            break;
          case "ECONNREFUSED":
            buffer[1] = 5 /* ConnectionRefused */;
            break;
          case "ERULESET":
            buffer[1] = 2 /* NotAllowedByRuleSet */;
            break;
        }
        this._writeBytes(buffer);
        this._socket.end();
      }
      sendData(data) {
        this._socket.write(data);
      }
      end() {
        this._socket.end();
      }
      error(error) {
        this._socket.destroy(new Error(error));
      }
    };
    SocksProxy = class _SocksProxy extends import_events2.default {
      constructor() {
        super();
        this._connections = /* @__PURE__ */ new Map();
        this._sockets = /* @__PURE__ */ new Set();
        this._closed = false;
        this._patternMatcher = () => false;
        this._directSockets = /* @__PURE__ */ new Map();
        this._server = new import_net2.default.Server((socket) => {
          const uid = createGuid();
          const connection = new SocksConnection(uid, socket, this);
          this._connections.set(uid, connection);
        });
        this._server.on("connection", (socket) => {
          if (this._closed) {
            socket.destroy();
            return;
          }
          this._sockets.add(socket);
          socket.once("close", () => this._sockets.delete(socket));
        });
      }
      static {
        this.Events = {
          SocksRequested: "socksRequested",
          SocksData: "socksData",
          SocksClosed: "socksClosed"
        };
      }
      setPattern(pattern) {
        try {
          this._patternMatcher = parsePattern(pattern);
        } catch (e) {
          this._patternMatcher = () => false;
        }
      }
      async _handleDirect(request2) {
        try {
          const socket = await createSocket(request2.host, request2.port);
          socket.on("data", (data) => this._connections.get(request2.uid)?.sendData(data));
          socket.on("error", (error) => {
            this._connections.get(request2.uid)?.error(error.message);
            this._directSockets.delete(request2.uid);
          });
          socket.on("end", () => {
            this._connections.get(request2.uid)?.end();
            this._directSockets.delete(request2.uid);
          });
          const localAddress = socket.localAddress;
          const localPort = socket.localPort;
          this._directSockets.set(request2.uid, socket);
          this._connections.get(request2.uid)?.socketConnected(localAddress, localPort);
        } catch (error) {
          this._connections.get(request2.uid)?.socketFailed(error.code);
        }
      }
      port() {
        return this._port;
      }
      async listen(port, hostname) {
        return new Promise((f) => {
          this._server.listen(port, hostname, () => {
            const port2 = this._server.address().port;
            this._port = port2;
            f(port2);
          });
        });
      }
      async close() {
        if (this._closed)
          return;
        this._closed = true;
        for (const socket of this._sockets)
          socket.destroy();
        this._sockets.clear();
        await new Promise((f) => this._server.close(f));
      }
      onSocketRequested(payload) {
        if (!this._patternMatcher(payload.host, payload.port)) {
          this._handleDirect(payload);
          return;
        }
        this.emit(_SocksProxy.Events.SocksRequested, payload);
      }
      onSocketData(payload) {
        const direct = this._directSockets.get(payload.uid);
        if (direct) {
          direct.write(payload.data);
          return;
        }
        this.emit(_SocksProxy.Events.SocksData, payload);
      }
      onSocketClosed(payload) {
        const direct = this._directSockets.get(payload.uid);
        if (direct) {
          direct.destroy();
          this._directSockets.delete(payload.uid);
          return;
        }
        this.emit(_SocksProxy.Events.SocksClosed, payload);
      }
      socketConnected({ uid, host, port }) {
        this._connections.get(uid)?.socketConnected(host, port);
      }
      socketFailed({ uid, errorCode }) {
        this._connections.get(uid)?.socketFailed(errorCode);
      }
      sendSocketData({ uid, data }) {
        this._connections.get(uid)?.sendData(data);
      }
      sendSocketEnd({ uid }) {
        this._connections.get(uid)?.end();
      }
      sendSocketError({ uid, error }) {
        this._connections.get(uid)?.error(error);
      }
    };
    SocksProxyHandler = class _SocksProxyHandler extends import_events2.default {
      constructor(pattern, redirectPortForTest) {
        super();
        this._sockets = /* @__PURE__ */ new Map();
        this._patternMatcher = () => false;
        this._patternMatcher = parsePattern(pattern);
        this._redirectPortForTest = redirectPortForTest;
      }
      static {
        this.Events = {
          SocksConnected: "socksConnected",
          SocksData: "socksData",
          SocksError: "socksError",
          SocksFailed: "socksFailed",
          SocksEnd: "socksEnd"
        };
      }
      cleanup() {
        for (const uid of this._sockets.keys())
          this.socketClosed({ uid });
      }
      async socketRequested({ uid, host, port }) {
        debugLogger.log("socks", `[${uid}] => request ${host}:${port}`);
        if (!this._patternMatcher(host, port)) {
          const payload = { uid, errorCode: "ERULESET" };
          debugLogger.log("socks", `[${uid}] <= pattern error ${payload.errorCode}`);
          this.emit(_SocksProxyHandler.Events.SocksFailed, payload);
          return;
        }
        if (host === "local.playwright")
          host = "localhost";
        try {
          if (this._redirectPortForTest)
            port = this._redirectPortForTest;
          const socket = await createSocket(host, port);
          socket.on("data", (data) => {
            const payload2 = { uid, data };
            this.emit(_SocksProxyHandler.Events.SocksData, payload2);
          });
          socket.on("error", (error) => {
            const payload2 = { uid, error: error.message };
            debugLogger.log("socks", `[${uid}] <= network socket error ${payload2.error}`);
            this.emit(_SocksProxyHandler.Events.SocksError, payload2);
            this._sockets.delete(uid);
          });
          socket.on("end", () => {
            const payload2 = { uid };
            debugLogger.log("socks", `[${uid}] <= network socket closed`);
            this.emit(_SocksProxyHandler.Events.SocksEnd, payload2);
            this._sockets.delete(uid);
          });
          const localAddress = socket.localAddress;
          const localPort = socket.localPort;
          this._sockets.set(uid, socket);
          const payload = { uid, host: localAddress, port: localPort };
          debugLogger.log("socks", `[${uid}] <= connected to network ${payload.host}:${payload.port}`);
          this.emit(_SocksProxyHandler.Events.SocksConnected, payload);
        } catch (error) {
          const payload = { uid, errorCode: error.code };
          debugLogger.log("socks", `[${uid}] <= connect error ${payload.errorCode}`);
          this.emit(_SocksProxyHandler.Events.SocksFailed, payload);
        }
      }
      sendSocketData({ uid, data }) {
        this._sockets.get(uid)?.write(data);
      }
      socketClosed({ uid }) {
        debugLogger.log("socks", `[${uid}] <= browser socket closed`);
        this._sockets.get(uid)?.destroy();
        this._sockets.delete(uid);
      }
    };
  }
});

// packages/utils/spawnAsync.ts
function spawnAsync(cmd, args, options = {}) {
  const process2 = (0, import_child_process.spawn)(cmd, args, Object.assign({ windowsHide: true }, options));
  return new Promise((resolve) => {
    let stdout = "";
    let stderr = "";
    if (process2.stdout)
      process2.stdout.on("data", (data) => stdout += data.toString());
    if (process2.stderr)
      process2.stderr.on("data", (data) => stderr += data.toString());
    process2.on("close", (code) => resolve({ stdout, stderr, code }));
    process2.on("error", (error) => resolve({ stdout, stderr, code: 0, error }));
  });
}
var import_child_process;
var init_spawnAsync = __esm({
  "packages/utils/spawnAsync.ts"() {
    "use strict";
    import_child_process = require("child_process");
  }
});

// packages/utils/stringWidth.ts
function characterWidth(c) {
  return getEastAsianWidth.eastAsianWidth(c.codePointAt(0));
}
function stringWidth(v) {
  let width = 0;
  for (const { segment } of new Intl.Segmenter(void 0, { granularity: "grapheme" }).segment(v))
    width += characterWidth(segment);
  return width;
}
function suffixOfWidth(v, width) {
  const segments = [...new Intl.Segmenter(void 0, { granularity: "grapheme" }).segment(v)];
  let suffixBegin = v.length;
  for (const { segment, index } of segments.reverse()) {
    const segmentWidth = stringWidth(segment);
    if (segmentWidth > width)
      break;
    width -= segmentWidth;
    suffixBegin = index;
  }
  return v.substring(suffixBegin);
}
function fitToWidth(line, width, prefix) {
  const prefixLength = prefix ? stripAnsiEscapes(prefix).length : 0;
  width -= prefixLength;
  if (stringWidth(line) <= width)
    return line;
  const parts = line.split(ansiRegex);
  const taken = [];
  for (let i = parts.length - 1; i >= 0; i--) {
    if (i % 2) {
      taken.push(parts[i]);
    } else {
      let part = suffixOfWidth(parts[i], width);
      const wasTruncated = part.length < parts[i].length;
      if (wasTruncated && parts[i].length > 0) {
        part = "\u2026" + suffixOfWidth(parts[i], width - 1);
      }
      taken.push(part);
      width -= stringWidth(part);
    }
  }
  return taken.reverse().join("");
}
var getEastAsianWidth;
var init_stringWidth = __esm({
  "packages/utils/stringWidth.ts"() {
    "use strict";
    init_stringUtils();
    getEastAsianWidth = require("./utilsBundle").getEastAsianWidth;
  }
});

// packages/utils/task.ts
function makeWaitForNextTask() {
  if (process.versions.electron)
    return (callback) => setTimeout(callback, 0);
  if (parseInt(process.versions.node, 10) >= 11)
    return setImmediate;
  let spinning = false;
  const callbacks = [];
  const loop = () => {
    const callback = callbacks.shift();
    if (!callback) {
      spinning = false;
      return;
    }
    setImmediate(loop);
    callback();
  };
  return (callback) => {
    callbacks.push(callback);
    if (!spinning) {
      spinning = true;
      setImmediate(loop);
    }
  };
}
var init_task = __esm({
  "packages/utils/task.ts"() {
    "use strict";
  }
});

// packages/utils/wsServer.ts
var wsServer2, lastConnectionId, kConnectionSymbol, perMessageDeflate, WSServer;
var init_wsServer = __esm({
  "packages/utils/wsServer.ts"() {
    "use strict";
    init_httpServer();
    init_network();
    init_debugLogger();
    ({ wsServer: wsServer2 } = require("./utilsBundle"));
    lastConnectionId = 0;
    kConnectionSymbol = Symbol("kConnection");
    perMessageDeflate = {
      serverNoContextTakeover: true,
      zlibDeflateOptions: {
        level: 3
      },
      zlibInflateOptions: {
        chunkSize: 10 * 1024
      },
      threshold: 10 * 1024
    };
    WSServer = class {
      constructor(delegate) {
        // Allowed Host headers for HTTP requests. null disables the check (server bound to a public address).
        this._allowedHosts = null;
        this._delegate = delegate;
      }
      async listen(port = 0, hostname, path59) {
        debugLogger.log("server", `Server started at ${/* @__PURE__ */ new Date()}`);
        hostname ??= "localhost";
        const server = createHttpServer((request2, response2) => this._onRequest(request2, response2));
        server.on("error", (error) => debugLogger.log("server", String(error)));
        this.server = server;
        const wsEndpoint = await new Promise((resolve, reject) => {
          server.listen(port, hostname, () => {
            const address = server.address();
            if (!address) {
              reject(new Error("Could not bind server socket"));
              return;
            }
            if (typeof address === "string") {
              resolve(`${address}${path59}`);
              return;
            }
            this._allowedHosts = computeAllowedHosts(hostname, address.address);
            resolve(`ws://${urlHostFromAddress(address)}:${address.port}${path59}`);
          }).on("error", reject);
        });
        debugLogger.log("server", "Listening at " + wsEndpoint);
        this._wsServer = new wsServer2({
          noServer: true,
          perMessageDeflate
        });
        this._wsServer.on("headers", (headers) => this._delegate.onHeaders(headers));
        server.on("upgrade", (request2, socket, head) => {
          const pathname = new URL("http://localhost" + request2.url).pathname;
          if (pathname !== path59) {
            socket.write(`HTTP/${request2.httpVersion} 400 Bad Request\r
\r
`);
            socket.destroy();
            return;
          }
          if (this._allowedHosts && !this._isAllowedOrigin(request2.headers.origin)) {
            socket.write(`HTTP/${request2.httpVersion} 403 Forbidden\r
\r
`);
            socket.destroy();
            return;
          }
          const upgradeResult = this._delegate.onUpgrade(request2, socket);
          if (upgradeResult) {
            socket.write(upgradeResult.error);
            socket.destroy();
            return;
          }
          this._wsServer.handleUpgrade(request2, socket, head, (ws4) => this._wsServer.emit("connection", ws4, request2));
        });
        this._wsServer.on("connection", (ws4, request2) => {
          debugLogger.log("server", "Connected client ws.extension=" + ws4.extensions);
          const url2 = new URL("http://localhost" + (request2.url || ""));
          const id = String(++lastConnectionId);
          debugLogger.log("server", `[${id}] serving connection: ${request2.url}`);
          const connection = this._delegate.onConnection(request2, url2, ws4, id);
          ws4[kConnectionSymbol] = connection;
        });
        return wsEndpoint;
      }
      _onRequest(request2, response2) {
        if (this._allowedHosts) {
          const host = request2.headers.host?.toLowerCase();
          const hostname = host ? hostnameFromHostHeader(host) : void 0;
          if (!hostname || !this._allowedHosts.has(hostname)) {
            response2.statusCode = 403;
            response2.end();
            return;
          }
        }
        this._delegate.onRequest(request2, response2);
      }
      _isAllowedOrigin(origin) {
        if (!origin)
          return true;
        try {
          const hostname = new URL(origin).hostname.toLowerCase();
          const bracketed = hostname.includes(":") ? `[${hostname}]` : hostname;
          return this._allowedHosts.has(hostname) || this._allowedHosts.has(bracketed);
        } catch {
          return false;
        }
      }
      async close() {
        const server = this._wsServer;
        if (!server)
          return;
        debugLogger.log("server", "closing websocket server");
        const waitForClose = new Promise((f) => server.close(f));
        await Promise.all(Array.from(server.clients).map(async (ws4) => {
          const connection = ws4[kConnectionSymbol];
          if (connection)
            await connection.close();
          try {
            ws4.terminate();
          } catch (e) {
          }
        }));
        await waitForClose;
        debugLogger.log("server", "closing http server");
        if (this.server)
          await new Promise((f) => this.server.close(f));
        this._wsServer = void 0;
        this.server = void 0;
        debugLogger.log("server", "closed server");
      }
    };
  }
});

// packages/utils/zipFile.ts
var yauzl, ZipFile;
var init_zipFile = __esm({
  "packages/utils/zipFile.ts"() {
    "use strict";
    yauzl = require("./utilsBundle").yauzl;
    ZipFile = class {
      constructor(fileName) {
        this._entries = /* @__PURE__ */ new Map();
        this._fileName = fileName;
        this._openedPromise = this._open();
      }
      async _open() {
        await new Promise((fulfill, reject) => {
          yauzl.open(this._fileName, { autoClose: false }, (e, z31) => {
            if (e) {
              reject(e);
              return;
            }
            this._zipFile = z31;
            this._zipFile.on("entry", (entry) => {
              this._entries.set(entry.fileName, entry);
            });
            this._zipFile.on("end", fulfill);
          });
        });
      }
      async entries() {
        await this._openedPromise;
        return [...this._entries.keys()];
      }
      async read(entryPath) {
        await this._openedPromise;
        const entry = this._entries.get(entryPath);
        if (!entry)
          throw new Error(`${entryPath} not found in file ${this._fileName}`);
        return new Promise((resolve, reject) => {
          this._zipFile.openReadStream(entry, (error, readStream) => {
            if (error || !readStream) {
              reject(error || "Entry not found");
              return;
            }
            const buffers = [];
            readStream.on("data", (data) => buffers.push(data));
            readStream.on("end", () => resolve(Buffer.concat(buffers)));
          });
        });
      }
      close() {
        this._zipFile?.close();
      }
    };
  }
});

// packages/utils/third_party/extractZip.ts
async function extractZip(zipPath, opts) {
  debug2("creating target directory", opts.dir);
  if (!import_path6.default.isAbsolute(opts.dir))
    throw new Error("Target directory is expected to be absolute");
  await import_fs9.promises.mkdir(opts.dir, { recursive: true });
  opts.dir = await import_fs9.promises.realpath(opts.dir);
  return new Extractor(zipPath, opts).extract();
}
var import_fs9, import_path6, import_stream2, import_util, debugPkg, getStream, yauzl2, debug2, openZip, pipeline2, Extractor;
var init_extractZip = __esm({
  "packages/utils/third_party/extractZip.ts"() {
    "use strict";
    import_fs9 = require("fs");
    import_path6 = __toESM(require("path"));
    import_stream2 = __toESM(require("stream"));
    import_util = require("util");
    debugPkg = require("./utilsBundle").debug;
    getStream = require("./utilsBundle").getStream;
    yauzl2 = require("./utilsBundle").yauzl;
    debug2 = debugPkg("extract-zip");
    openZip = (0, import_util.promisify)(yauzl2.open);
    pipeline2 = (0, import_util.promisify)(import_stream2.default.pipeline);
    Extractor = class {
      constructor(zipPath, opts) {
        this.canceled = false;
        this.zipPath = zipPath;
        this.opts = opts;
      }
      async extract() {
        debug2("opening", this.zipPath, "with opts", this.opts);
        this.zipfile = await openZip(this.zipPath, { lazyEntries: true });
        this.canceled = false;
        return new Promise((resolve, reject) => {
          this.zipfile.on("error", (err) => {
            this.canceled = true;
            reject(err);
          });
          this.zipfile.readEntry();
          this.zipfile.on("close", () => {
            if (!this.canceled) {
              debug2("zip extraction complete");
              resolve();
            }
          });
          this.zipfile.on("entry", async (entry) => {
            if (this.canceled) {
              debug2("skipping entry", entry.fileName, { cancelled: this.canceled });
              return;
            }
            debug2("zipfile entry", entry.fileName);
            if (entry.fileName.startsWith("__MACOSX/")) {
              this.zipfile.readEntry();
              return;
            }
            const destDir = import_path6.default.dirname(import_path6.default.join(this.opts.dir, entry.fileName));
            try {
              await import_fs9.promises.mkdir(destDir, { recursive: true });
              const canonicalDestDir = await import_fs9.promises.realpath(destDir);
              const relativeDestDir = import_path6.default.relative(this.opts.dir, canonicalDestDir);
              if (relativeDestDir.split(import_path6.default.sep).includes(".."))
                throw new Error(`Out of bound path "${canonicalDestDir}" found while processing file ${entry.fileName}`);
              await this.extractEntry(entry);
              debug2("finished processing", entry.fileName);
              this.zipfile.readEntry();
            } catch (err) {
              this.canceled = true;
              this.zipfile.close();
              reject(err);
            }
          });
        });
      }
      async extractEntry(entry) {
        if (this.canceled) {
          debug2("skipping entry extraction", entry.fileName, { cancelled: this.canceled });
          return;
        }
        if (this.opts.onEntry)
          this.opts.onEntry(entry, this.zipfile);
        const dest = import_path6.default.join(this.opts.dir, entry.fileName);
        const mode = entry.externalFileAttributes >> 16 & 65535;
        const IFMT = 61440;
        const IFDIR = 16384;
        const IFLNK = 40960;
        const symlink = (mode & IFMT) === IFLNK;
        let isDir = (mode & IFMT) === IFDIR;
        if (!isDir && entry.fileName.endsWith("/"))
          isDir = true;
        const madeBy = entry.versionMadeBy >> 8;
        if (!isDir)
          isDir = madeBy === 0 && entry.externalFileAttributes === 16;
        debug2("extracting entry", { filename: entry.fileName, isDir, isSymlink: symlink });
        const procMode = this.getExtractedMode(mode, isDir) & 511;
        const destDir = isDir ? dest : import_path6.default.dirname(dest);
        const mkdirOptions = { recursive: true };
        if (isDir)
          mkdirOptions.mode = procMode;
        debug2("mkdir", { dir: destDir, ...mkdirOptions });
        await import_fs9.promises.mkdir(destDir, mkdirOptions);
        if (isDir)
          return;
        debug2("opening read stream", dest);
        const readStream = await (0, import_util.promisify)(this.zipfile.openReadStream.bind(this.zipfile))(entry);
        if (symlink) {
          const link = await getStream(readStream);
          debug2("creating symlink", link, dest);
          await import_fs9.promises.symlink(link, dest);
        } else {
          await pipeline2(readStream, (0, import_fs9.createWriteStream)(dest, { mode: procMode }));
        }
      }
      getExtractedMode(entryMode, isDir) {
        let mode = entryMode;
        if (mode === 0) {
          if (isDir) {
            if (this.opts.defaultDirMode)
              mode = Number(this.opts.defaultDirMode);
            if (!mode)
              mode = 493;
          } else {
            if (this.opts.defaultFileMode)
              mode = Number(this.opts.defaultFileMode);
            if (!mode)
              mode = 420;
          }
        }
        return mode;
      }
    };
  }
});

// packages/utils/third_party/lockfile.ts
function probe(file, fs61, callback) {
  const cachedPrecision = fs61[cacheSymbol];
  if (cachedPrecision) {
    return fs61.stat(file, (err, stat) => {
      if (err)
        return callback(err);
      callback(null, stat.mtime, cachedPrecision);
    });
  }
  const mtime = new Date(Math.ceil(Date.now() / 1e3) * 1e3 + 5);
  fs61.utimes(file, mtime, mtime, (err) => {
    if (err)
      return callback(err);
    fs61.stat(file, (err2, stat) => {
      if (err2)
        return callback(err2);
      const precision = stat.mtime.getTime() % 1e3 === 0 ? "s" : "ms";
      Object.defineProperty(fs61, cacheSymbol, { value: precision });
      callback(null, stat.mtime, precision);
    });
  });
}
function getMtime(precision) {
  let now = Date.now();
  if (precision === "s")
    now = Math.ceil(now / 1e3) * 1e3;
  return new Date(now);
}
function getLockFile(file, options) {
  return options.lockfilePath || `${file}.lock`;
}
function resolveCanonicalPath(file, options, callback) {
  if (!options.realpath)
    return callback(null, import_path7.default.resolve(file));
  options.fs.realpath(file, callback);
}
function acquireLock(file, options, callback) {
  const lockfilePath = getLockFile(file, options);
  options.fs.mkdir(lockfilePath, (err) => {
    if (!err) {
      return probe(lockfilePath, options.fs, (err2, mtime, mtimePrecision) => {
        if (err2) {
          options.fs.rmdir(lockfilePath, () => {
          });
          return callback(err2);
        }
        callback(null, mtime, mtimePrecision);
      });
    }
    if (err.code !== "EEXIST")
      return callback(err);
    if (options.stale <= 0)
      return callback(Object.assign(new Error("Lock file is already being held"), { code: "ELOCKED", file }));
    options.fs.stat(lockfilePath, (err2, stat) => {
      if (err2) {
        if (err2.code === "ENOENT")
          return acquireLock(file, { ...options, stale: 0 }, callback);
        return callback(err2);
      }
      if (!isLockStale(stat, options))
        return callback(Object.assign(new Error("Lock file is already being held"), { code: "ELOCKED", file }));
      removeLock(file, options, (err3) => {
        if (err3)
          return callback(err3);
        acquireLock(file, { ...options, stale: 0 }, callback);
      });
    });
  });
}
function isLockStale(stat, options) {
  return stat.mtime.getTime() < Date.now() - options.stale;
}
function removeLock(file, options, callback) {
  options.fs.rmdir(getLockFile(file, options), (err) => {
    if (err && err.code !== "ENOENT")
      return callback(err);
    callback(null);
  });
}
function updateLock(file, options) {
  const lock2 = locks[file];
  if (lock2.updateTimeout)
    return;
  lock2.updateDelay = lock2.updateDelay || options.update;
  lock2.updateTimeout = setTimeout(() => {
    lock2.updateTimeout = null;
    options.fs.stat(lock2.lockfilePath, (err, stat) => {
      const isOverThreshold = lock2.lastUpdate + options.stale < Date.now();
      if (err) {
        if (err.code === "ENOENT" || isOverThreshold)
          return setLockAsCompromised(file, lock2, Object.assign(err, { code: "ECOMPROMISED" }));
        lock2.updateDelay = 1e3;
        return updateLock(file, options);
      }
      const isMtimeOurs = lock2.mtime.getTime() === stat.mtime.getTime();
      if (!isMtimeOurs) {
        return setLockAsCompromised(
          file,
          lock2,
          Object.assign(
            new Error("Unable to update lock within the stale threshold"),
            { code: "ECOMPROMISED" }
          )
        );
      }
      const mtime = getMtime(lock2.mtimePrecision);
      options.fs.utimes(lock2.lockfilePath, mtime, mtime, (err2) => {
        const isOverThreshold2 = lock2.lastUpdate + options.stale < Date.now();
        if (lock2.released)
          return;
        if (err2) {
          if (err2.code === "ENOENT" || isOverThreshold2)
            return setLockAsCompromised(file, lock2, Object.assign(err2, { code: "ECOMPROMISED" }));
          lock2.updateDelay = 1e3;
          return updateLock(file, options);
        }
        lock2.mtime = mtime;
        lock2.lastUpdate = Date.now();
        lock2.updateDelay = null;
        updateLock(file, options);
      });
    });
  }, lock2.updateDelay);
  if (lock2.updateTimeout && lock2.updateTimeout.unref)
    lock2.updateTimeout.unref();
}
function setLockAsCompromised(file, lock2, err) {
  lock2.released = true;
  if (lock2.updateTimeout)
    clearTimeout(lock2.updateTimeout);
  if (locks[file] === lock2)
    delete locks[file];
  lock2.options.onCompromised(err);
}
function lockImpl(file, options, callback) {
  const resolvedOptions = {
    stale: 1e4,
    update: null,
    realpath: true,
    retries: 0,
    fs: gracefulFs,
    onCompromised: (err) => {
      throw err;
    },
    ...options
  };
  resolvedOptions.retries = resolvedOptions.retries || 0;
  resolvedOptions.retries = typeof resolvedOptions.retries === "number" ? { retries: resolvedOptions.retries } : resolvedOptions.retries;
  resolvedOptions.stale = Math.max(resolvedOptions.stale || 0, 2e3);
  resolvedOptions.update = resolvedOptions.update === null || resolvedOptions.update === void 0 ? resolvedOptions.stale / 2 : resolvedOptions.update || 0;
  resolvedOptions.update = Math.max(Math.min(resolvedOptions.update, resolvedOptions.stale / 2), 1e3);
  resolveCanonicalPath(file, resolvedOptions, (err, resolvedFile) => {
    if (err)
      return callback(err);
    const canonicalFile = resolvedFile;
    const operation = retry.operation(resolvedOptions.retries);
    operation.attempt(() => {
      acquireLock(canonicalFile, resolvedOptions, (err2, mtime, mtimePrecision) => {
        if (operation.retry(err2 || void 0))
          return;
        if (err2)
          return callback(operation.mainError());
        const lock2 = locks[canonicalFile] = {
          lockfilePath: getLockFile(canonicalFile, resolvedOptions),
          mtime,
          mtimePrecision,
          options: resolvedOptions,
          lastUpdate: Date.now()
        };
        updateLock(canonicalFile, resolvedOptions);
        callback(null, (releasedCallback) => {
          if (lock2.released) {
            return releasedCallback && releasedCallback(Object.assign(new Error("Lock is already released"), { code: "ERELEASED" }));
          }
          unlock(canonicalFile, { ...resolvedOptions, realpath: false }, releasedCallback || (() => {
          }));
        });
      });
    });
  });
}
function unlock(file, options, callback) {
  const resolvedOptions = {
    stale: 1e4,
    update: null,
    realpath: true,
    retries: 0,
    fs: gracefulFs,
    onCompromised: (err) => {
      throw err;
    },
    ...options
  };
  resolveCanonicalPath(file, resolvedOptions, (err, resolvedFile) => {
    if (err)
      return callback(err);
    const canonicalFile = resolvedFile;
    const lock2 = locks[canonicalFile];
    if (!lock2)
      return callback(Object.assign(new Error("Lock is not acquired/owned by you"), { code: "ENOTACQUIRED" }));
    if (lock2.updateTimeout)
      clearTimeout(lock2.updateTimeout);
    lock2.released = true;
    delete locks[canonicalFile];
    removeLock(canonicalFile, resolvedOptions, callback);
  });
}
function toPromise(method) {
  return (...args) => new Promise((resolve, reject) => {
    args.push((err, result2) => {
      if (err)
        reject(err);
      else
        resolve(result2);
    });
    method(...args);
  });
}
function ensureCleanup() {
  if (cleanupInitialized)
    return;
  cleanupInitialized = true;
  onExit(() => {
    for (const file in locks) {
      const options = locks[file].options;
      try {
        options.fs.rmdirSync(getLockFile(file, options));
      } catch (e) {
      }
    }
  });
}
async function lock(file, options) {
  ensureCleanup();
  const release = await toPromise(lockImpl)(file, options || {});
  return toPromise(release);
}
var import_path7, gracefulFs, retry, onExit, locks, cacheSymbol, cleanupInitialized;
var init_lockfile = __esm({
  "packages/utils/third_party/lockfile.ts"() {
    "use strict";
    import_path7 = __toESM(require("path"));
    gracefulFs = require("./utilsBundle").gracefulFs;
    retry = require("./utilsBundle").retry;
    onExit = require("./utilsBundle").onExit;
    locks = {};
    cacheSymbol = Symbol();
    cleanupInitialized = false;
  }
});

// packages/utils/index.ts
var utils_exports = {};
__export(utils_exports, {
  FastStats: () => FastStats,
  HttpServer: () => HttpServer,
  ImageChannel: () => ImageChannel,
  NET_DEFAULT_TIMEOUT: () => NET_DEFAULT_TIMEOUT,
  RecentLogsCollector: () => RecentLogsCollector,
  SerializedFS: () => SerializedFS,
  SocksProxy: () => SocksProxy,
  SocksProxyHandler: () => SocksProxyHandler,
  WSServer: () => WSServer,
  ZipFile: () => ZipFile,
  Zone: () => Zone,
  addSuffixToFilePath: () => addSuffixToFilePath,
  blendWithWhite: () => blendWithWhite,
  calculateSha1: () => calculateSha1,
  canAccessFile: () => canAccessFile,
  colorDeltaE94: () => colorDeltaE94,
  compare: () => compare,
  compareBuffersOrStrings: () => compareBuffersOrStrings,
  computeAllowedHosts: () => computeAllowedHosts,
  copyFileAndMakeWritable: () => copyFileAndMakeWritable,
  createGuid: () => createGuid,
  createHttp2Server: () => createHttp2Server,
  createHttpServer: () => createHttpServer,
  createHttpsServer: () => createHttpsServer,
  createProxyAgent: () => createProxyAgent,
  currentZone: () => currentZone,
  debugLogger: () => debugLogger,
  debugMode: () => debugMode,
  decorateServer: () => decorateServer,
  defaultUserDataDirForChannel: () => defaultUserDataDirForChannel,
  emptyZone: () => emptyZone,
  envArrayToObject: () => envArrayToObject,
  eventsHelper: () => eventsHelper,
  existsAsync: () => existsAsync,
  extractZip: () => extractZip,
  fitToWidth: () => fitToWidth,
  generateSelfSignedCertificate: () => generateSelfSignedCertificate,
  getAsBooleanFromENV: () => getAsBooleanFromENV,
  getComparator: () => getComparator,
  getFromENV: () => getFromENV,
  getPackageManager: () => getPackageManager,
  getPackageManagerExecCommand: () => getPackageManagerExecCommand,
  gracefullyCloseAll: () => gracefullyCloseAll,
  gracefullyCloseSet: () => gracefullyCloseSet,
  gracefullyProcessExitDoNotHang: () => gracefullyProcessExitDoNotHang,
  guessClientName: () => guessClientName,
  hostPlatform: () => hostPlatform,
  hostnameFromHostHeader: () => hostnameFromHostHeader,
  httpRequest: () => httpRequest,
  isChromiumChannelName: () => isChromiumChannelName,
  isCodingAgent: () => isCodingAgent,
  isLikelyNpxGlobal: () => isLikelyNpxGlobal,
  isOfficiallySupportedPlatform: () => isOfficiallySupportedPlatform,
  isPathInside: () => isPathInside,
  isSystemDirectory: () => isSystemDirectory,
  isURLAvailable: () => isURLAvailable,
  isUnderTest: () => isUnderTest,
  isWritable: () => isWritable,
  jsonStringifyForceASCII: () => jsonStringifyForceASCII,
  launchProcess: () => launchProcess,
  lock: () => lock,
  makeSocketPath: () => makeSocketPath,
  makeWaitForNextTask: () => makeWaitForNextTask,
  mkdirIfNeeded: () => mkdirIfNeeded,
  nodePlatform: () => nodePlatform,
  parsePattern: () => parsePattern,
  perMessageDeflate: () => perMessageDeflate,
  removeFolders: () => removeFolders,
  resolveWithinRoot: () => resolveWithinRoot,
  rgb2gray: () => rgb2gray,
  sanitizeForFilePath: () => sanitizeForFilePath,
  serveFolder: () => serveFolder,
  setBoxedStackPrefixes: () => setBoxedStackPrefixes,
  setPlaywrightTestProcessEnv: () => setPlaywrightTestProcessEnv,
  shortPlatform: () => shortPlatform,
  spawnAsync: () => spawnAsync,
  srgb2xyz: () => srgb2xyz,
  ssim: () => ssim,
  startHttpServer: () => startHttpServer,
  startProfiling: () => startProfiling,
  stopProfiling: () => stopProfiling,
  stringWidth: () => stringWidth,
  throwingResolveWithinRoot: () => throwingResolveWithinRoot,
  toPosixPath: () => toPosixPath,
  trimLongString: () => trimLongString,
  urlHostFromAddress: () => urlHostFromAddress,
  wrapInASCIIBox: () => wrapInASCIIBox,
  xyz2lab: () => xyz2lab
});
var init_utils = __esm({
  "packages/utils/index.ts"() {
    "use strict";
    init_ascii();
    init_chromiumChannels();
    init_comparators();
    init_crypto();
    init_debug();
    init_debugLogger();
    init_env();
    init_eventsHelper();
    init_fileUtils();
    init_hostPlatform();
    init_httpServer();
    init_network();
    init_nodePlatform();
    init_processLauncher();
    init_profiler();
    init_serializedFS();
    init_socksProxy();
    init_spawnAsync();
    init_stringWidth();
    init_task();
    init_wsServer();
    init_zipFile();
    init_zones();
    init_extractZip();
    init_lockfile();
    init_colorUtils();
    init_compare();
    init_imageChannel();
    init_stats();
  }
});

// packages/playwright-core/src/client/eventEmitter.ts
function checkListener(listener) {
  if (typeof listener !== "function")
    throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof listener);
}
function unwrapListener(l) {
  return wrappedListener(l) ?? l;
}
function unwrapListeners(arr) {
  return arr.map((l) => wrappedListener(l) ?? l);
}
function wrappedListener(l) {
  return l.listener;
}
var EventEmitter3, OnceWrapper;
var init_eventEmitter = __esm({
  "packages/playwright-core/src/client/eventEmitter.ts"() {
    "use strict";
    EventEmitter3 = class {
      constructor(platform) {
        this._events = void 0;
        this._eventsCount = 0;
        this._maxListeners = void 0;
        this._pendingHandlers = /* @__PURE__ */ new Map();
        this._platform = platform;
        if (this._events === void 0 || this._events === Object.getPrototypeOf(this)._events) {
          this._events = /* @__PURE__ */ Object.create(null);
          this._eventsCount = 0;
        }
        this._maxListeners = this._maxListeners || void 0;
        this.on = this.addListener;
        this.off = this.removeListener;
      }
      setMaxListeners(n) {
        if (typeof n !== "number" || n < 0 || Number.isNaN(n))
          throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + n + ".");
        this._maxListeners = n;
        return this;
      }
      getMaxListeners() {
        return this._maxListeners === void 0 ? this._platform.defaultMaxListeners() : this._maxListeners;
      }
      emit(type3, ...args) {
        const events = this._events;
        if (events === void 0)
          return false;
        const handler = events?.[type3];
        if (handler === void 0)
          return false;
        if (typeof handler === "function") {
          this._callHandler(type3, handler, args);
        } else {
          const len = handler.length;
          const listeners = handler.slice();
          for (let i = 0; i < len; ++i)
            this._callHandler(type3, listeners[i], args);
        }
        return true;
      }
      _callHandler(type3, handler, args) {
        const promise = Reflect.apply(handler, this, args);
        if (!(promise instanceof Promise))
          return;
        let set = this._pendingHandlers.get(type3);
        if (!set) {
          set = /* @__PURE__ */ new Set();
          this._pendingHandlers.set(type3, set);
        }
        set.add(promise);
        promise.catch((e) => {
          if (this._rejectionHandler)
            this._rejectionHandler(e);
          else
            throw e;
        }).finally(() => set.delete(promise));
      }
      addListener(type3, listener) {
        return this._addListener(type3, listener, false);
      }
      on(type3, listener) {
        return this._addListener(type3, listener, false);
      }
      _addListener(type3, listener, prepend) {
        checkListener(listener);
        let events = this._events;
        let existing;
        if (events === void 0) {
          events = this._events = /* @__PURE__ */ Object.create(null);
          this._eventsCount = 0;
        } else {
          if (events.newListener !== void 0) {
            this.emit("newListener", type3, unwrapListener(listener));
            events = this._events;
          }
          existing = events[type3];
        }
        if (existing === void 0) {
          existing = events[type3] = listener;
          ++this._eventsCount;
        } else {
          if (typeof existing === "function") {
            existing = events[type3] = prepend ? [listener, existing] : [existing, listener];
          } else if (prepend) {
            existing.unshift(listener);
          } else {
            existing.push(listener);
          }
          const m = this.getMaxListeners();
          if (m > 0 && existing.length > m && !existing.warned) {
            existing.warned = true;
            const w = new Error("Possible EventEmitter memory leak detected. " + existing.length + " " + String(type3) + " listeners added. Use emitter.setMaxListeners() to increase limit");
            w.name = "MaxListenersExceededWarning";
            w.emitter = this;
            w.type = type3;
            w.count = existing.length;
            if (!this._platform.isUnderTest()) {
              console.warn(w);
            }
          }
        }
        return this;
      }
      prependListener(type3, listener) {
        return this._addListener(type3, listener, true);
      }
      once(type3, listener) {
        checkListener(listener);
        this.on(type3, new OnceWrapper(this, type3, listener).wrapperFunction);
        return this;
      }
      prependOnceListener(type3, listener) {
        checkListener(listener);
        this.prependListener(type3, new OnceWrapper(this, type3, listener).wrapperFunction);
        return this;
      }
      removeListener(type3, listener) {
        checkListener(listener);
        const events = this._events;
        if (events === void 0)
          return this;
        const list = events[type3];
        if (list === void 0)
          return this;
        if (list === listener || list.listener === listener) {
          if (--this._eventsCount === 0) {
            this._events = /* @__PURE__ */ Object.create(null);
          } else {
            delete events[type3];
            if (events.removeListener)
              this.emit("removeListener", type3, list.listener ?? listener);
          }
        } else if (typeof list !== "function") {
          let position = -1;
          let originalListener;
          for (let i = list.length - 1; i >= 0; i--) {
            if (list[i] === listener || wrappedListener(list[i]) === listener) {
              originalListener = wrappedListener(list[i]);
              position = i;
              break;
            }
          }
          if (position < 0)
            return this;
          if (position === 0)
            list.shift();
          else
            list.splice(position, 1);
          if (list.length === 1)
            events[type3] = list[0];
          if (events.removeListener !== void 0)
            this.emit("removeListener", type3, originalListener || listener);
        }
        return this;
      }
      off(type3, listener) {
        return this.removeListener(type3, listener);
      }
      removeAllListeners(type3, options) {
        this._removeAllListeners(type3);
        if (!options)
          return this;
        if (options.behavior === "wait") {
          const errors = [];
          this._rejectionHandler = (error) => errors.push(error);
          return this._waitFor(type3).then(() => {
            if (errors.length)
              throw errors[0];
          });
        }
        if (options.behavior === "ignoreErrors")
          this._rejectionHandler = () => {
          };
        return Promise.resolve();
      }
      _removeAllListeners(type3) {
        const events = this._events;
        if (!events)
          return;
        if (!events.removeListener) {
          if (type3 === void 0) {
            this._events = /* @__PURE__ */ Object.create(null);
            this._eventsCount = 0;
          } else if (events[type3] !== void 0) {
            if (--this._eventsCount === 0)
              this._events = /* @__PURE__ */ Object.create(null);
            else
              delete events[type3];
          }
          return;
        }
        if (type3 === void 0) {
          const keys = Object.keys(events);
          let key;
          for (let i = 0; i < keys.length; ++i) {
            key = keys[i];
            if (key === "removeListener")
              continue;
            this._removeAllListeners(key);
          }
          this._removeAllListeners("removeListener");
          this._events = /* @__PURE__ */ Object.create(null);
          this._eventsCount = 0;
          return;
        }
        const listeners = events[type3];
        if (typeof listeners === "function") {
          this.removeListener(type3, listeners);
        } else if (listeners !== void 0) {
          for (let i = listeners.length - 1; i >= 0; i--)
            this.removeListener(type3, listeners[i]);
        }
      }
      listeners(type3) {
        return this._listeners(this, type3, true);
      }
      rawListeners(type3) {
        return this._listeners(this, type3, false);
      }
      listenerCount(type3) {
        const events = this._events;
        if (events !== void 0) {
          const listener = events[type3];
          if (typeof listener === "function")
            return 1;
          if (listener !== void 0)
            return listener.length;
        }
        return 0;
      }
      eventNames() {
        return this._eventsCount > 0 && this._events ? Reflect.ownKeys(this._events) : [];
      }
      async _waitFor(type3) {
        let promises = [];
        if (type3) {
          promises = [...this._pendingHandlers.get(type3) || []];
        } else {
          promises = [];
          for (const [, pending] of this._pendingHandlers)
            promises.push(...pending);
        }
        await Promise.all(promises);
      }
      _listeners(target, type3, unwrap) {
        const events = target._events;
        if (events === void 0)
          return [];
        const listener = events[type3];
        if (listener === void 0)
          return [];
        if (typeof listener === "function")
          return unwrap ? [unwrapListener(listener)] : [listener];
        return unwrap ? unwrapListeners(listener) : listener.slice();
      }
    };
    OnceWrapper = class {
      constructor(eventEmitter, eventType, listener) {
        this._fired = false;
        this._eventEmitter = eventEmitter;
        this._eventType = eventType;
        this._listener = listener;
        this.wrapperFunction = this._handle.bind(this);
        this.wrapperFunction.listener = listener;
      }
      _handle(...args) {
        if (this._fired)
          return;
        this._fired = true;
        this._eventEmitter.removeListener(this._eventType, this.wrapperFunction);
        return this._listener.apply(this._eventEmitter, args);
      }
    };
  }
});

// packages/playwright-core/src/bootstrap.ts
var minimumMajorNodeVersion, currentNodeVersion, major;
var init_bootstrap = __esm({
  "packages/playwright-core/src/bootstrap.ts"() {
    "use strict";
    minimumMajorNodeVersion = 18;
    currentNodeVersion = process.versions.node;
    major = +currentNodeVersion.split(".")[0];
    if (major < minimumMajorNodeVersion) {
      console.error(
        "You are running Node.js " + currentNodeVersion + `.
Playwright requires Node.js ${minimumMajorNodeVersion} or higher. 
Please update your version of Node.js.`
      );
      process.exit(1);
    }
    if (process.env.PW_INSTRUMENT_MODULES) {
      const Module = require("module");
      const originalLoad = Module._load;
      const root = { name: "<root>", selfMs: 0, totalMs: 0, childrenMs: 0, children: [] };
      let current = root;
      const stack = [];
      Module._load = function(request2, _parent, _isMain) {
        const node = { name: request2, selfMs: 0, totalMs: 0, childrenMs: 0, children: [] };
        current.children.push(node);
        stack.push(current);
        current = node;
        const start3 = performance.now();
        let result2;
        try {
          result2 = originalLoad.apply(this, arguments);
        } catch (e) {
          current = stack.pop();
          current.children.pop();
          throw e;
        }
        const duration = performance.now() - start3;
        node.totalMs = duration;
        node.selfMs = Math.max(0, duration - node.childrenMs);
        current = stack.pop();
        current.childrenMs += duration;
        return result2;
      };
      process.on("exit", () => {
        function printTree(node, prefix, isLast, lines2, depth) {
          if (node.totalMs < 1 && depth > 0)
            return;
          const connector = depth === 0 ? "" : isLast ? "\u2514\u2500\u2500 " : "\u251C\u2500\u2500 ";
          const time = `${node.totalMs.toFixed(1).padStart(8)}ms`;
          const self2 = node.children.length ? ` (self: ${node.selfMs.toFixed(1)}ms)` : "";
          lines2.push(`${time}  ${prefix}${connector}${node.name}${self2}`);
          const childPrefix = prefix + (depth === 0 ? "" : isLast ? "    " : "\u2502   ");
          const sorted2 = node.children.slice().sort((a, b) => b.totalMs - a.totalMs);
          for (let i = 0; i < sorted2.length; i++)
            printTree(sorted2[i], childPrefix, i === sorted2.length - 1, lines2, depth + 1);
        }
        let totalModules = 0;
        function count(n) {
          totalModules++;
          n.children.forEach(count);
        }
        root.children.forEach(count);
        const lines = [];
        const sorted = root.children.slice().sort((a, b) => b.totalMs - a.totalMs);
        for (let i = 0; i < sorted.length; i++)
          printTree(sorted[i], "", i === sorted.length - 1, lines, 0);
        const totalMs = root.children.reduce((s, c) => s + c.totalMs, 0);
        process.stderr.write(`
--- Module load tree: ${totalModules} modules, ${totalMs.toFixed(0)}ms total ---
` + lines.join("\n") + "\n");
        const flat = /* @__PURE__ */ new Map();
        function gather(n) {
          const existing = flat.get(n.name);
          if (existing) {
            existing.selfMs += n.selfMs;
            existing.totalMs += n.totalMs;
            existing.count++;
          } else {
            flat.set(n.name, { selfMs: n.selfMs, totalMs: n.totalMs, count: 1 });
          }
          n.children.forEach(gather);
        }
        root.children.forEach(gather);
        const top50 = [...flat.entries()].sort((a, b) => b[1].selfMs - a[1].selfMs).slice(0, 50);
        const flatLines = top50.map(
          ([mod, { selfMs, totalMs: totalMs2, count: count2 }]) => `${selfMs.toFixed(1).padStart(8)}ms self ${totalMs2.toFixed(1).padStart(8)}ms total  (x${String(count2).padStart(3)})  ${mod}`
        );
        process.stderr.write(`
--- Top 50 modules by self time ---
` + flatLines.join("\n") + "\n");
      });
    }
  }
});

// packages/playwright-core/src/package.ts
function libPath(...parts) {
  return import_path8.default.join(packageRoot, "lib", ...parts);
}
var import_path8, packageRoot, packageJSON, binPath;
var init_package = __esm({
  "packages/playwright-core/src/package.ts"() {
    "use strict";
    import_path8 = __toESM(require("path"));
    packageRoot = import_path8.default.join(__dirname, "..");
    packageJSON = require(import_path8.default.join(packageRoot, "package.json"));
    binPath = import_path8.default.join(packageRoot, "bin");
  }
});

// packages/playwright-core/src/tools/trace/traceParser.ts
async function extractTrace(traceFile, outDir) {
  const zipFile = new ZipFile(traceFile);
  try {
    const entries = await zipFile.entries();
    for (const entry of entries) {
      const outPath = resolveWithinRoot(outDir, entry);
      if (!outPath)
        throw new Error(`Trace entry '${entry}' escapes output directory`);
      await import_fs10.default.promises.mkdir(import_path9.default.dirname(outPath), { recursive: true });
      const buffer = await zipFile.read(entry);
      await import_fs10.default.promises.writeFile(outPath, buffer);
    }
  } finally {
    zipFile.close();
  }
}
var import_fs10, import_path9, DirTraceLoaderBackend;
var init_traceParser = __esm({
  "packages/playwright-core/src/tools/trace/traceParser.ts"() {
    "use strict";
    import_fs10 = __toESM(require("fs"));
    import_path9 = __toESM(require("path"));
    init_fileUtils();
    init_zipFile();
    DirTraceLoaderBackend = class {
      constructor(dir) {
        this._dir = dir;
      }
      isLive() {
        return false;
      }
      async entryNames() {
        const entries = [];
        const walk = async (dir, prefix) => {
          const items = await import_fs10.default.promises.readdir(dir, { withFileTypes: true });
          for (const item of items) {
            if (item.isDirectory())
              await walk(import_path9.default.join(dir, item.name), prefix ? `${prefix}/${item.name}` : item.name);
            else
              entries.push(prefix ? `${prefix}/${item.name}` : item.name);
          }
        };
        await walk(this._dir, "");
        return entries;
      }
      async hasEntry(entryName) {
        const resolved = resolveWithinRoot(this._dir, entryName);
        if (!resolved)
          return false;
        try {
          await import_fs10.default.promises.access(resolved);
          return true;
        } catch {
          return false;
        }
      }
      async readText(entryName) {
        const resolved = resolveWithinRoot(this._dir, entryName);
        if (!resolved)
          return;
        try {
          return await import_fs10.default.promises.readFile(resolved, "utf-8");
        } catch {
        }
      }
      async readBlob(entryName) {
        const resolved = resolveWithinRoot(this._dir, entryName);
        if (!resolved)
          return;
        try {
          const buffer = await import_fs10.default.promises.readFile(resolved);
          return new Blob([new Uint8Array(buffer)]);
        } catch {
        }
      }
    };
  }
});

// packages/playwright-core/src/tools/trace/traceUtils.ts
function ensureTraceOpen() {
  if (!import_fs11.default.existsSync(traceDir))
    throw new Error(`No trace opened. Run 'npx playwright trace open <file>' first.`);
  return traceDir;
}
async function closeTrace() {
  if (import_fs11.default.existsSync(traceDir))
    await import_fs11.default.promises.rm(traceDir, { recursive: true });
}
async function openTrace(traceFile) {
  const filePath = import_path10.default.resolve(traceFile);
  if (!import_fs11.default.existsSync(filePath))
    throw new Error(`Trace file not found: ${filePath}`);
  await closeTrace();
  await import_fs11.default.promises.mkdir(traceDir, { recursive: true });
  if (filePath.endsWith(".zip"))
    await extractTrace(filePath, traceDir);
  else
    await import_fs11.default.promises.writeFile(import_path10.default.join(traceDir, ".link"), filePath, "utf-8");
}
async function loadTrace() {
  const dir = ensureTraceOpen();
  const linkFile = import_path10.default.join(dir, ".link");
  let traceDir2;
  let traceFile;
  if (import_fs11.default.existsSync(linkFile)) {
    const tracePath = await import_fs11.default.promises.readFile(linkFile, "utf-8");
    traceDir2 = import_path10.default.dirname(tracePath);
    traceFile = import_path10.default.basename(tracePath);
  } else {
    traceDir2 = dir;
  }
  const backend = new DirTraceLoaderBackend(traceDir2);
  const loader = new TraceLoader();
  await loader.load(backend, traceFile);
  const model = new TraceModel(traceDir2, loader.contextEntries);
  return new LoadedTrace(model, loader, buildOrdinalMap(model));
}
function formatTimestamp(ms, base) {
  const relative = ms - base;
  if (relative < 0)
    return "0:00.000";
  const totalMs = Math.floor(relative);
  const minutes = Math.floor(totalMs / 6e4);
  const seconds = Math.floor(totalMs % 6e4 / 1e3);
  const millis = totalMs % 1e3;
  return `${minutes}:${seconds.toString().padStart(2, "0")}.${millis.toString().padStart(3, "0")}`;
}
function actionTitle(action) {
  return renderTitleForCall({ ...action, type: action.class }) || `${action.class}.${action.method}`;
}
async function saveOutputFile(fileName, content, explicitOutput) {
  let outFile;
  if (explicitOutput) {
    outFile = explicitOutput;
  } else {
    const resolved = resolveWithinRoot(cliOutputDir, fileName);
    if (!resolved)
      throw new Error(`Attachment name '${fileName}' escapes output directory`);
    await import_fs11.default.promises.mkdir(import_path10.default.dirname(resolved), { recursive: true });
    outFile = resolved;
  }
  await import_fs11.default.promises.writeFile(outFile, content);
  return outFile;
}
function buildOrdinalMap(model) {
  const actions = model.actions.filter((a) => a.group !== "configuration");
  const { rootItem } = buildActionTree(actions);
  const ordinalToCallId = /* @__PURE__ */ new Map();
  const callIdToOrdinal = /* @__PURE__ */ new Map();
  let ordinal = 1;
  const visit = (item) => {
    ordinalToCallId.set(ordinal, item.action.callId);
    callIdToOrdinal.set(item.action.callId, ordinal);
    ordinal++;
    for (const child of item.children)
      visit(child);
  };
  for (const child of rootItem.children)
    visit(child);
  return { ordinalToCallId, callIdToOrdinal };
}
var import_fs11, import_path10, traceDir, cliOutputDir, LoadedTrace;
var init_traceUtils2 = __esm({
  "packages/playwright-core/src/tools/trace/traceUtils.ts"() {
    "use strict";
    import_fs11 = __toESM(require("fs"));
    import_path10 = __toESM(require("path"));
    init_traceModel();
    init_traceLoader();
    init_protocolFormatter();
    init_fileUtils();
    init_traceParser();
    traceDir = import_path10.default.join(".playwright-cli", "trace");
    cliOutputDir = ".playwright-cli";
    LoadedTrace = class {
      constructor(model, loader, ordinals) {
        this.model = model;
        this.loader = loader;
        this.ordinalToCallId = ordinals.ordinalToCallId;
        this.callIdToOrdinal = ordinals.callIdToOrdinal;
      }
      resolveActionId(actionId) {
        const ordinal = parseInt(actionId, 10);
        if (!isNaN(ordinal)) {
          const callId = this.ordinalToCallId.get(ordinal);
          if (callId)
            return this.model.actions.find((a) => a.callId === callId);
        }
        return this.model.actions.find((a) => a.callId === actionId);
      }
    };
  }
});

// packages/playwright-core/src/tools/trace/traceOpen.ts
async function traceOpen(traceFile) {
  await openTrace(traceFile);
  await traceInfo();
}
async function traceInfo() {
  const trace = await loadTrace();
  const model = trace.model;
  const info = {
    browser: model.browserName || "unknown",
    platform: model.platform || "unknown",
    playwrightVersion: model.playwrightVersion || "unknown",
    title: model.title || "",
    duration: msToString(model.endTime - model.startTime),
    durationMs: model.endTime - model.startTime,
    startTime: model.wallTime ? new Date(model.wallTime).toISOString() : "unknown",
    viewport: model.options.viewport ? `${model.options.viewport.width}x${model.options.viewport.height}` : "default",
    actions: model.actions.length,
    pages: model.pages.length,
    network: model.resources.length,
    errors: model.errorDescriptors.length,
    attachments: model.attachments.length,
    consoleMessages: model.events.filter((e) => e.type === "console").length
  };
  console.log("");
  console.log(`  Browser:      ${info.browser}`);
  console.log(`  Platform:     ${info.platform}`);
  console.log(`  Playwright:   ${info.playwrightVersion}`);
  if (info.title)
    console.log(`  Title:        ${info.title}`);
  console.log(`  Duration:     ${info.duration}`);
  console.log(`  Start time:   ${info.startTime}`);
  console.log(`  Viewport:     ${info.viewport}`);
  console.log(`  Actions:      ${info.actions}`);
  console.log(`  Pages:        ${info.pages}`);
  console.log(`  Network:      ${info.network} requests`);
  console.log(`  Errors:       ${info.errors}`);
  console.log(`  Attachments:  ${info.attachments}`);
  console.log(`  Console:      ${info.consoleMessages} messages`);
  console.log("");
}
var init_traceOpen = __esm({
  "packages/playwright-core/src/tools/trace/traceOpen.ts"() {
    "use strict";
    init_formatUtils();
    init_traceUtils2();
  }
});

// packages/playwright-core/src/tools/trace/traceActions.ts
async function traceActions(options) {
  const trace = await loadTrace();
  const actions = filterActions(trace.model.actions, options);
  const { rootItem } = buildActionTree(actions);
  console.log(`  ${"#".padStart(4)} ${"Time".padEnd(9)}  ${"Action".padEnd(55)} ${"Duration".padStart(8)}`);
  console.log(`  ${"\u2500".repeat(4)} ${"\u2500".repeat(9)}  ${"\u2500".repeat(55)} ${"\u2500".repeat(8)}`);
  const visit = (item, indent) => {
    const action = item.action;
    const ordinal = trace.callIdToOrdinal.get(action.callId) ?? "?";
    const ts = formatTimestamp(action.startTime, trace.model.startTime);
    const duration = action.endTime ? msToString(action.endTime - action.startTime) : "running";
    const title = actionTitle(action);
    const locator2 = actionLocator(action);
    const error = action.error ? "  \u2717" : "";
    const prefix = `  ${(ordinal + ".").padStart(4)} ${ts}  ${indent}`;
    console.log(`${prefix}${title.padEnd(Math.max(1, 55 - indent.length))} ${duration.padStart(8)}${error}`);
    if (locator2)
      console.log(`${" ".repeat(prefix.length)}${locator2}`);
    for (const child of item.children)
      visit(child, indent + "  ");
  };
  for (const child of rootItem.children)
    visit(child, "");
}
function filterActions(actions, options) {
  let result2 = actions.filter((a) => a.group !== "configuration");
  if (options.grep) {
    const pattern = new RegExp(options.grep, "i");
    result2 = result2.filter((a) => pattern.test(actionTitle(a)) || pattern.test(actionLocator(a) || ""));
  }
  if (options.errorsOnly)
    result2 = result2.filter((a) => !!a.error);
  return result2;
}
function actionLocator(action, sdkLanguage) {
  return action.params.selector ? asLocatorDescription(sdkLanguage || "javascript", action.params.selector) : void 0;
}
async function traceAction(actionId) {
  const trace = await loadTrace();
  const action = trace.resolveActionId(actionId);
  if (!action) {
    console.error(`Action '${actionId}' not found. Use 'trace actions' to see available action IDs.`);
    process.exitCode = 1;
    return;
  }
  const title = actionTitle(action);
  console.log(`
  ${title}
`);
  console.log("  Time");
  console.log(`    start:     ${formatTimestamp(action.startTime, trace.model.startTime)}`);
  const duration = action.endTime ? msToString(action.endTime - action.startTime) : action.error ? "Timed Out" : "Running";
  console.log(`    duration:  ${duration}`);
  const paramKeys = Object.keys(action.params).filter((name) => name !== "info");
  if (paramKeys.length) {
    console.log("\n  Parameters");
    for (const key of paramKeys) {
      const value2 = formatParamValue(action.params[key]);
      console.log(`    ${key}: ${value2}`);
    }
  }
  if (action.result) {
    console.log("\n  Return value");
    for (const [key, value2] of Object.entries(action.result))
      console.log(`    ${key}: ${formatParamValue(value2)}`);
  }
  if (action.error) {
    console.log("\n  Error");
    console.log(`    ${action.error.message}`);
  }
  if (action.log.length) {
    console.log("\n  Log");
    for (const entry of action.log) {
      const time = entry.time !== -1 ? formatTimestamp(entry.time, trace.model.startTime) : "";
      console.log(`    ${time.padEnd(12)} ${entry.message}`);
    }
  }
  if (action.stack?.length) {
    console.log("\n  Source");
    for (const frame of action.stack.slice(0, 5)) {
      const file = frame.file.replace(/.*[/\\](.*)/, "$1");
      console.log(`    ${file}:${frame.line}:${frame.column}`);
    }
  }
  const snapshots = [];
  if (action.beforeSnapshot)
    snapshots.push("before");
  if (action.inputSnapshot)
    snapshots.push("input");
  if (action.afterSnapshot)
    snapshots.push("after");
  if (snapshots.length) {
    console.log("\n  Snapshots");
    console.log(`    available: ${snapshots.join(", ")}`);
    console.log(`    usage:     npx playwright trace snapshot ${actionId} --name <${snapshots.join("|")}>`);
  }
  console.log("");
}
function formatParamValue(value2) {
  if (value2 === void 0 || value2 === null)
    return String(value2);
  if (typeof value2 === "string")
    return `"${value2}"`;
  if (typeof value2 !== "object")
    return String(value2);
  if (value2.guid)
    return "<handle>";
  return JSON.stringify(value2).slice(0, 1e3);
}
var init_traceActions = __esm({
  "packages/playwright-core/src/tools/trace/traceActions.ts"() {
    "use strict";
    init_traceModel();
    init_locatorGenerators();
    init_formatUtils();
    init_traceUtils2();
  }
});

// packages/playwright-core/src/tools/trace/traceRequests.ts
async function traceRequests(options) {
  const trace = await loadTrace();
  const model = trace.model;
  let indexed = model.resources.map((r, i) => ({ resource: r, ordinal: i + 1 }));
  if (options.grep) {
    const pattern = new RegExp(options.grep, "i");
    indexed = indexed.filter(({ resource: r }) => pattern.test(r.request.url));
  }
  if (options.method)
    indexed = indexed.filter(({ resource: r }) => r.request.method.toLowerCase() === options.method.toLowerCase());
  if (options.status) {
    const code = parseInt(options.status, 10);
    indexed = indexed.filter(({ resource: r }) => r.response.status === code);
  }
  if (options.failed)
    indexed = indexed.filter(({ resource: r }) => r.response.status >= 400 || r.response.status === -1);
  if (!indexed.length) {
    console.log("  No network requests");
    return;
  }
  console.log(`  ${"#".padStart(4)} ${"Method".padEnd(8)} ${"Status".padEnd(8)} ${"Name".padEnd(45)} ${"Duration".padStart(10)} ${"Size".padStart(8)} ${"Route".padEnd(10)}`);
  console.log(`  ${"\u2500".repeat(4)} ${"\u2500".repeat(8)} ${"\u2500".repeat(8)} ${"\u2500".repeat(45)} ${"\u2500".repeat(10)} ${"\u2500".repeat(8)} ${"\u2500".repeat(10)}`);
  for (const { resource: r, ordinal } of indexed) {
    let name;
    try {
      const url2 = new URL(r.request.url);
      name = url2.pathname.substring(url2.pathname.lastIndexOf("/") + 1);
      if (!name)
        name = url2.host;
      if (url2.search)
        name += url2.search;
    } catch {
      name = r.request.url;
    }
    if (name.length > 45)
      name = name.substring(0, 42) + "...";
    const status = r.response.status > 0 ? String(r.response.status) : "ERR";
    const size = r.response._transferSize > 0 ? r.response._transferSize : r.response.bodySize;
    const route2 = formatRouteStatus(r);
    console.log(`  ${(ordinal + ".").padStart(4)} ${r.request.method.padEnd(8)} ${status.padEnd(8)} ${name.padEnd(45)} ${msToString(r.time).padStart(10)} ${bytesToString2(size).padStart(8)} ${route2.padEnd(10)}`);
  }
}
async function traceRequest(requestId) {
  const trace = await loadTrace();
  const model = trace.model;
  const ordinal = parseInt(requestId, 10);
  const resource = !isNaN(ordinal) && ordinal >= 1 && ordinal <= model.resources.length ? model.resources[ordinal - 1] : void 0;
  if (!resource) {
    console.error(`Request '${requestId}' not found. Use 'trace requests' to see available request IDs.`);
    process.exitCode = 1;
    return;
  }
  const r = resource;
  const status = r.response.status > 0 ? `${r.response.status} ${r.response.statusText}` : "ERR";
  const size = r.response._transferSize > 0 ? r.response._transferSize : r.response.bodySize;
  console.log(`
  ${r.request.method} ${r.request.url}
`);
  console.log("  General");
  console.log(`    status:    ${status}`);
  console.log(`    duration:  ${msToString(r.time)}`);
  console.log(`    size:      ${bytesToString2(size)}`);
  if (r.response.content.mimeType)
    console.log(`    type:      ${r.response.content.mimeType}`);
  const route2 = formatRouteStatus(r);
  if (route2)
    console.log(`    route:     ${route2}`);
  if (r.serverIPAddress)
    console.log(`    server:    ${r.serverIPAddress}${r._serverPort ? ":" + r._serverPort : ""}`);
  if (r.response._failureText)
    console.log(`    error:     ${r.response._failureText}`);
  if (r.request.headers.length) {
    console.log("\n  Request headers");
    for (const h of r.request.headers)
      console.log(`    ${h.name}: ${h.value}`);
  }
  if (r.request.postData) {
    console.log("\n  Request body");
    const resource2 = r.request.postData._sha1 ?? r.request.postData._file;
    if (resource2) {
      console.log(`    ${import_path11.default.relative(process.cwd(), import_path11.default.join(trace.model.traceUri, "resources", resource2))}`);
    } else {
      const text2 = r.request.postData.text.length > 2e3 ? r.request.postData.text.substring(0, 2e3) + "..." : r.request.postData.text;
      console.log(`    ${text2}`);
    }
  }
  if (r.response.headers.length) {
    console.log("\n  Response headers");
    for (const h of r.response.headers)
      console.log(`    ${h.name}: ${h.value}`);
  }
  if (r.response.bodySize > 0) {
    const resource2 = r.response.content._sha1 ?? r.response.content._file;
    if (resource2) {
      console.log("\n  Response body");
      console.log(`    ${import_path11.default.relative(process.cwd(), import_path11.default.join(trace.model.traceUri, "resources", resource2))}`);
    } else if (r.response.content.text) {
      const text2 = r.response.content.text.length > 2e3 ? r.response.content.text.substring(0, 2e3) + "..." : r.response.content.text;
      console.log("\n  Response body");
      console.log(`    ${text2}`);
    }
  }
  if (r._securityDetails) {
    console.log("\n  Security");
    if (r._securityDetails.protocol)
      console.log(`    protocol:  ${r._securityDetails.protocol}`);
    if (r._securityDetails.subjectName)
      console.log(`    subject:   ${r._securityDetails.subjectName}`);
    if (r._securityDetails.issuer)
      console.log(`    issuer:    ${r._securityDetails.issuer}`);
  }
  console.log("");
}
function bytesToString2(bytes) {
  if (bytes < 0 || !isFinite(bytes))
    return "-";
  if (bytes === 0)
    return "0";
  if (bytes < 1e3)
    return bytes.toFixed(0);
  const kb = bytes / 1024;
  if (kb < 1e3)
    return kb.toFixed(1) + "K";
  const mb = kb / 1024;
  if (mb < 1e3)
    return mb.toFixed(1) + "M";
  const gb = mb / 1024;
  return gb.toFixed(1) + "G";
}
function formatRouteStatus(r) {
  if (r._wasAborted)
    return "aborted";
  if (r._wasContinued)
    return "continued";
  if (r._wasFulfilled)
    return "fulfilled";
  if (r._apiRequest)
    return "api";
  return "";
}
var import_path11;
var init_traceRequests = __esm({
  "packages/playwright-core/src/tools/trace/traceRequests.ts"() {
    "use strict";
    import_path11 = __toESM(require("path"));
    init_formatUtils();
    init_traceUtils2();
  }
});

// packages/playwright-core/src/tools/trace/traceConsole.ts
async function traceConsole(options) {
  const trace = await loadTrace();
  const model = trace.model;
  const items = [];
  for (const event of model.events) {
    if (event.type === "console") {
      if (options.stdio)
        continue;
      const level = event.messageType;
      if (options.errorsOnly && level !== "error")
        continue;
      if (options.warnings && level !== "error" && level !== "warning")
        continue;
      const url2 = event.location.url;
      const filename = url2 ? url2.substring(url2.lastIndexOf("/") + 1) : "<anonymous>";
      items.push({
        type: "browser",
        level,
        text: event.text,
        location: `${filename}:${event.location.lineNumber}`,
        timestamp: event.time
      });
    }
    if (event.type === "event" && event.method === "pageError") {
      if (options.stdio)
        continue;
      const error = event.params.error;
      items.push({
        type: "browser",
        level: "error",
        text: error?.error?.message || String(error?.value || ""),
        timestamp: event.time
      });
    }
  }
  for (const event of model.stdio) {
    if (options.browser)
      continue;
    if (options.errorsOnly && event.type !== "stderr")
      continue;
    if (options.warnings && event.type !== "stderr")
      continue;
    let text2 = "";
    if (event.text)
      text2 = event.text.trim();
    if (event.base64)
      text2 = Buffer.from(event.base64, "base64").toString("utf-8").trim();
    if (!text2)
      continue;
    items.push({
      type: event.type,
      level: event.type === "stderr" ? "error" : "info",
      text: text2,
      timestamp: event.timestamp
    });
  }
  items.sort((a, b) => a.timestamp - b.timestamp);
  if (!items.length) {
    console.log("  No console entries");
    return;
  }
  for (const item of items) {
    const ts = formatTimestamp(item.timestamp, model.startTime);
    const source11 = item.type === "browser" ? "[browser]" : `[${item.type}]`;
    const level = item.level.padEnd(8);
    const location2 = item.location ? `  ${item.location}` : "";
    console.log(`  ${ts}  ${source11.padEnd(10)} ${level} ${item.text}${location2}`);
  }
}
var init_traceConsole = __esm({
  "packages/playwright-core/src/tools/trace/traceConsole.ts"() {
    "use strict";
    init_traceUtils2();
  }
});

// packages/playwright-core/src/tools/trace/traceErrors.ts
async function traceErrors() {
  const trace = await loadTrace();
  const model = trace.model;
  if (!model.errorDescriptors.length) {
    console.log("  No errors");
    return;
  }
  for (const error of model.errorDescriptors) {
    if (error.action) {
      const title = actionTitle(error.action);
      console.log(`
  \u2717 ${title}`);
    } else {
      console.log(`
  \u2717 Error`);
    }
    if (error.stack?.length) {
      const frame = error.stack[0];
      const file = frame.file.replace(/.*[/\\](.*)/, "$1");
      console.log(`    at ${file}:${frame.line}:${frame.column}`);
    }
    console.log("");
    const indented = error.message.split("\n").map((l) => `    ${l}`).join("\n");
    console.log(indented);
  }
  console.log("");
}
var init_traceErrors = __esm({
  "packages/playwright-core/src/tools/trace/traceErrors.ts"() {
    "use strict";
    init_traceUtils2();
  }
});

// packages/isomorphic/disposable.ts
async function disposeAll(disposables) {
  const copy = [...disposables];
  disposables.length = 0;
  await Promise.all(copy.map((d) => d.dispose()));
}
var init_disposable = __esm({
  "packages/isomorphic/disposable.ts"() {
    "use strict";
  }
});

// packages/playwright-core/src/server/userAgent.ts
function getUserAgent() {
  if (cachedUserAgent)
    return cachedUserAgent;
  try {
    cachedUserAgent = determineUserAgent();
  } catch (e) {
    cachedUserAgent = "Playwright/unknown";
  }
  return cachedUserAgent;
}
function determineUserAgent() {
  let osIdentifier = "unknown";
  let osVersion = "unknown";
  if (process.platform === "win32") {
    const version3 = import_os4.default.release().split(".");
    osIdentifier = "windows";
    osVersion = `${version3[0]}.${version3[1]}`;
  } else if (process.platform === "darwin") {
    const version3 = (0, import_child_process2.execSync)("sw_vers -productVersion", { stdio: ["ignore", "pipe", "ignore"] }).toString().trim().split(".");
    osIdentifier = "macOS";
    osVersion = `${version3[0]}.${version3[1]}`;
  } else if (process.platform === "linux") {
    const distroInfo = getLinuxDistributionInfoSync();
    if (distroInfo) {
      osIdentifier = distroInfo.id || "linux";
      osVersion = distroInfo.version || "unknown";
    } else {
      osIdentifier = "linux";
    }
  }
  const additionalTokens = [];
  if (process.env.CI)
    additionalTokens.push("CI/1");
  const serializedTokens = additionalTokens.length ? " " + additionalTokens.join(" ") : "";
  const { embedderName, embedderVersion } = getEmbedderName();
  return `Playwright/${getPlaywrightVersion()} (${import_os4.default.arch()}; ${osIdentifier} ${osVersion}) ${embedderName}/${embedderVersion}${serializedTokens}`;
}
function getEmbedderName() {
  let embedderName = "unknown";
  let embedderVersion = "unknown";
  if (!process.env.PW_LANG_NAME) {
    embedderName = "node";
    embedderVersion = process.version.substring(1).split(".").slice(0, 2).join(".");
  } else if (["node", "python", "java", "csharp"].includes(process.env.PW_LANG_NAME)) {
    embedderName = process.env.PW_LANG_NAME;
    embedderVersion = process.env.PW_LANG_NAME_VERSION ?? "unknown";
  }
  return { embedderName, embedderVersion };
}
function getPlaywrightVersion(majorMinorOnly = false) {
  const version3 = process.env.PW_VERSION_OVERRIDE || packageJSON.version;
  return majorMinorOnly ? version3.split(".").slice(0, 2).join(".") : version3;
}
var import_child_process2, import_os4, cachedUserAgent;
var init_userAgent = __esm({
  "packages/playwright-core/src/server/userAgent.ts"() {
    "use strict";
    import_child_process2 = require("child_process");
    import_os4 = __toESM(require("os"));
    init_linuxUtils();
    init_package();
  }
});

// packages/playwright-core/src/generated/clockSource.ts
var source;
var init_clockSource = __esm({
  "packages/playwright-core/src/generated/clockSource.ts"() {
    "use strict";
    source = '\nvar __commonJS = obj => {\n  let required = false;\n  let result;\n  return function __require() {\n    if (!required) {\n      required = true;\n      let fn;\n      for (const name in obj) { fn = obj[name]; break; }\n      const module = { exports: {} };\n      fn(module.exports, module);\n      result = module.exports;\n    }\n    return result;\n  }\n};\nvar __export = (target, all) => {for (var name in all) target[name] = all[name];};\nvar __toESM = mod => ({ ...mod, \'default\': mod });\nvar __toCommonJS = mod => ({ ...mod, __esModule: true });\n\n\n// packages/injected/src/clock.ts\nvar clock_exports = {};\n__export(clock_exports, {\n  ClockController: () => ClockController,\n  createClock: () => createClock,\n  inject: () => inject,\n  install: () => install\n});\nmodule.exports = __toCommonJS(clock_exports);\nvar ClockController = class {\n  constructor(embedder) {\n    this._duringTick = false;\n    this._uniqueTimerId = idCounterStart;\n    this.disposables = [];\n    this._log = [];\n    this._timers = /* @__PURE__ */ new Map();\n    this._now = { time: asWallTime(0), isFixedTime: false, ticks: 0, origin: asWallTime(-1) };\n    this._embedder = embedder;\n  }\n  uninstall() {\n    this.disposables.forEach((dispose) => dispose());\n    this.disposables.length = 0;\n  }\n  now() {\n    this._replayLogOnce();\n    this._syncRealTime();\n    return this._now.time;\n  }\n  install(time) {\n    this._replayLogOnce();\n    this._innerInstall(asWallTime(time));\n  }\n  setSystemTime(time) {\n    this._replayLogOnce();\n    this._innerSetTime(asWallTime(time));\n  }\n  setFixedTime(time) {\n    this._replayLogOnce();\n    this._innerSetFixedTime(asWallTime(time));\n  }\n  performanceNow() {\n    this._replayLogOnce();\n    this._syncRealTime();\n    return this._now.ticks;\n  }\n  _syncRealTime() {\n    if (!this._realTime)\n      return;\n    const now = this._embedder.performanceNow();\n    const sinceLastSync = now - this._realTime.lastSyncTicks;\n    if (sinceLastSync > 0) {\n      this._advanceNow(shiftTicks(this._now.ticks, sinceLastSync));\n      this._realTime.lastSyncTicks = now;\n    }\n  }\n  _innerSetTime(time) {\n    this._now.time = time;\n    this._now.isFixedTime = false;\n    if (this._now.origin < 0)\n      this._now.origin = this._now.time;\n  }\n  _innerInstall(time) {\n    if (this._now.origin < 0)\n      this._now.ticks = 0;\n    this._innerSetTime(time);\n  }\n  _innerSetFixedTime(time) {\n    this._innerSetTime(time);\n    this._now.isFixedTime = true;\n  }\n  _advanceNow(to) {\n    if (this._now.ticks > to) {\n      return;\n    }\n    if (!this._now.isFixedTime)\n      this._now.time = asWallTime(this._now.time + to - this._now.ticks);\n    this._now.ticks = to;\n  }\n  async log(type, time, param) {\n    this._log.push({ type, time, param });\n  }\n  async runFor(ticks) {\n    this._replayLogOnce();\n    if (ticks < 0)\n      throw new TypeError("Negative ticks are not supported");\n    await this._runWithDisabledRealTimeSync(async () => {\n      await this._runTo(shiftTicks(this._now.ticks, ticks));\n    });\n  }\n  async _runTo(to) {\n    to = Math.ceil(to);\n    if (this._now.ticks > to)\n      return;\n    let firstException;\n    while (true) {\n      const result = await this._callFirstTimer(to);\n      if (!result.timerFound)\n        break;\n      firstException = firstException || result.error;\n    }\n    this._advanceNow(to);\n    if (firstException)\n      throw firstException;\n  }\n  async pauseAt(time) {\n    this._replayLogOnce();\n    await this._innerPause();\n    const toConsume = time - this._now.time;\n    await this._innerFastForwardTo(shiftTicks(this._now.ticks, toConsume));\n    return toConsume;\n  }\n  async _innerPause() {\n    var _a;\n    this._realTime = void 0;\n    await ((_a = this._currentRealTimeTimer) == null ? void 0 : _a.dispose());\n    this._currentRealTimeTimer = void 0;\n  }\n  resume() {\n    this._replayLogOnce();\n    this._innerResume();\n  }\n  _innerResume() {\n    const now = this._embedder.performanceNow();\n    this._realTime = { startTicks: now, lastSyncTicks: now };\n    this._updateRealTimeTimer();\n  }\n  _updateRealTimeTimer() {\n    var _a;\n    if ((_a = this._currentRealTimeTimer) == null ? void 0 : _a.promise) {\n      return;\n    }\n    const firstTimer = this._firstTimer();\n    const nextTick = Math.min(firstTimer ? firstTimer.callAt : this._now.ticks + maxTimeout, this._now.ticks + 100);\n    const callAt = this._currentRealTimeTimer ? Math.min(this._currentRealTimeTimer.callAt, nextTick) : nextTick;\n    if (this._currentRealTimeTimer) {\n      this._currentRealTimeTimer.cancel();\n      this._currentRealTimeTimer = void 0;\n    }\n    const realTimeTimer = {\n      callAt,\n      promise: void 0,\n      cancel: this._embedder.setTimeout(() => {\n        this._syncRealTime();\n        realTimeTimer.promise = this._runTo(this._now.ticks).catch((e) => console.error(e));\n        void realTimeTimer.promise.then(() => {\n          this._currentRealTimeTimer = void 0;\n          if (this._realTime)\n            this._updateRealTimeTimer();\n        });\n      }, callAt - this._now.ticks),\n      dispose: async () => {\n        realTimeTimer.cancel();\n        await realTimeTimer.promise;\n      }\n    };\n    this._currentRealTimeTimer = realTimeTimer;\n  }\n  async _runWithDisabledRealTimeSync(fn) {\n    if (!this._realTime) {\n      await fn();\n      return;\n    }\n    await this._innerPause();\n    try {\n      await fn();\n    } finally {\n      this._innerResume();\n    }\n  }\n  async fastForward(ticks) {\n    this._replayLogOnce();\n    await this._runWithDisabledRealTimeSync(async () => {\n      await this._innerFastForwardTo(shiftTicks(this._now.ticks, ticks | 0));\n    });\n  }\n  async _innerFastForwardTo(to) {\n    if (to < this._now.ticks)\n      throw new Error("Cannot fast-forward to the past");\n    for (const timer of this._timers.values()) {\n      if (to > timer.callAt)\n        timer.callAt = to;\n    }\n    await this._runTo(to);\n  }\n  addTimer(options) {\n    this._replayLogOnce();\n    if (options.type === "AnimationFrame" /* AnimationFrame */ && !options.func)\n      throw new Error("Callback must be provided to requestAnimationFrame calls");\n    if (options.type === "IdleCallback" /* IdleCallback */ && !options.func)\n      throw new Error("Callback must be provided to requestIdleCallback calls");\n    if (["Timeout" /* Timeout */, "Interval" /* Interval */].includes(options.type) && !options.func && options.delay === void 0)\n      throw new Error("Callback must be provided to timer calls");\n    let delay = options.delay ? +options.delay : 0;\n    if (!Number.isFinite(delay))\n      delay = 0;\n    delay = delay > maxTimeout ? 1 : delay;\n    delay = Math.max(0, delay);\n    const timer = {\n      type: options.type,\n      func: options.func,\n      args: options.args || [],\n      delay,\n      callAt: shiftTicks(this._now.ticks, delay || (this._duringTick ? 1 : 0)),\n      createdAt: this._now.ticks,\n      id: this._uniqueTimerId++,\n      error: new Error()\n    };\n    this._timers.set(timer.id, timer);\n    if (this._realTime)\n      this._updateRealTimeTimer();\n    return timer.id;\n  }\n  countTimers() {\n    return this._timers.size;\n  }\n  _firstTimer(beforeTick) {\n    let firstTimer = null;\n    for (const timer of this._timers.values()) {\n      const isInRange = beforeTick === void 0 || timer.callAt <= beforeTick;\n      if (isInRange && (!firstTimer || compareTimers(firstTimer, timer) === 1))\n        firstTimer = timer;\n    }\n    return firstTimer;\n  }\n  _takeFirstTimer(beforeTick) {\n    const timer = this._firstTimer(beforeTick);\n    if (!timer)\n      return null;\n    this._advanceNow(timer.callAt);\n    if (timer.type === "Interval" /* Interval */)\n      timer.callAt = shiftTicks(timer.callAt, timer.delay);\n    else\n      this._timers.delete(timer.id);\n    return timer;\n  }\n  async _callFirstTimer(beforeTick) {\n    const timer = this._takeFirstTimer(beforeTick);\n    if (!timer)\n      return { timerFound: false };\n    this._duringTick = true;\n    try {\n      if (typeof timer.func !== "function") {\n        let error2;\n        try {\n          (() => {\n            globalThis.eval(timer.func);\n          })();\n        } catch (e) {\n          error2 = e;\n        }\n        await new Promise((f) => this._embedder.setTimeout(f));\n        return { timerFound: true, error: error2 };\n      }\n      let args = timer.args;\n      if (timer.type === "AnimationFrame" /* AnimationFrame */)\n        args = [this._now.ticks];\n      else if (timer.type === "IdleCallback" /* IdleCallback */)\n        args = [{ didTimeout: false, timeRemaining: () => 0 }];\n      let error;\n      try {\n        timer.func.apply(null, args);\n      } catch (e) {\n        error = e;\n      }\n      await new Promise((f) => this._embedder.setTimeout(f));\n      return { timerFound: true, error };\n    } finally {\n      this._duringTick = false;\n    }\n  }\n  getTimeToNextFrame() {\n    this._replayLogOnce();\n    return 16 - this._now.ticks % 16;\n  }\n  clearTimer(timerId, type) {\n    this._replayLogOnce();\n    if (!timerId) {\n      return;\n    }\n    const id = Number(timerId);\n    if (Number.isNaN(id) || id < idCounterStart) {\n      const handlerName = getClearHandler(type);\n      new Error(`Clock: ${handlerName} was invoked to clear a native timer instead of one created by the clock library.`);\n    }\n    const timer = this._timers.get(id);\n    if (timer) {\n      if (timer.type === type || timer.type === "Timeout" && type === "Interval" || timer.type === "Interval" && type === "Timeout") {\n        this._timers.delete(id);\n      } else {\n        const clear = getClearHandler(type);\n        const schedule = getScheduleHandler(timer.type);\n        throw new Error(\n          `Cannot clear timer: timer created with ${schedule}() but cleared with ${clear}()`\n        );\n      }\n    }\n  }\n  _replayLogOnce() {\n    if (!this._log.length)\n      return;\n    let lastLogTime = -1;\n    let isPaused = false;\n    for (const { type, time, param } of this._log) {\n      if (!isPaused && lastLogTime !== -1)\n        this._advanceNow(shiftTicks(this._now.ticks, time - lastLogTime));\n      lastLogTime = time;\n      if (type === "install") {\n        this._innerInstall(asWallTime(param));\n      } else if (type === "fastForward" || type === "runFor") {\n        this._advanceNow(shiftTicks(this._now.ticks, param));\n      } else if (type === "pauseAt") {\n        isPaused = true;\n        this._innerSetTime(asWallTime(param));\n      } else if (type === "resume") {\n        isPaused = false;\n      } else if (type === "setFixedTime") {\n        this._innerSetFixedTime(asWallTime(param));\n      } else if (type === "setSystemTime") {\n        this._innerSetTime(asWallTime(param));\n      }\n    }\n    if (!isPaused) {\n      if (lastLogTime > 0)\n        this._advanceNow(shiftTicks(this._now.ticks, this._embedder.dateNow() - lastLogTime));\n      this._innerResume();\n    } else {\n      this._realTime = void 0;\n    }\n    this._log.length = 0;\n  }\n};\nfunction mirrorDateProperties(target, source) {\n  for (const prop in source) {\n    if (source.hasOwnProperty(prop))\n      target[prop] = source[prop];\n  }\n  target.toString = () => source.toString();\n  target.prototype = source.prototype;\n  target.parse = source.parse;\n  target.UTC = source.UTC;\n  target.prototype.toUTCString = source.prototype.toUTCString;\n  target.isFake = true;\n  return target;\n}\nfunction createDate(clock, NativeDate) {\n  function ClockDate(year, month, date, hour, minute, second, ms) {\n    if (!(this instanceof ClockDate))\n      return new NativeDate(clock.now()).toString();\n    switch (arguments.length) {\n      case 0:\n        return new NativeDate(clock.now());\n      case 1:\n        return new NativeDate(year);\n      case 2:\n        return new NativeDate(year, month);\n      case 3:\n        return new NativeDate(year, month, date);\n      case 4:\n        return new NativeDate(year, month, date, hour);\n      case 5:\n        return new NativeDate(year, month, date, hour, minute);\n      case 6:\n        return new NativeDate(\n          year,\n          month,\n          date,\n          hour,\n          minute,\n          second\n        );\n      default:\n        return new NativeDate(\n          year,\n          month,\n          date,\n          hour,\n          minute,\n          second,\n          ms\n        );\n    }\n  }\n  ClockDate.now = () => clock.now();\n  return mirrorDateProperties(ClockDate, NativeDate);\n}\nfunction createIntl(clock, NativeIntl) {\n  const ClockIntl = {};\n  for (const key of Object.getOwnPropertyNames(NativeIntl))\n    ClockIntl[key] = NativeIntl[key];\n  ClockIntl.DateTimeFormat = function(...args) {\n    const realFormatter = new NativeIntl.DateTimeFormat(...args);\n    const formatter = {\n      formatRange: realFormatter.formatRange.bind(realFormatter),\n      formatRangeToParts: realFormatter.formatRangeToParts.bind(realFormatter),\n      resolvedOptions: realFormatter.resolvedOptions.bind(realFormatter),\n      format: (date) => realFormatter.format(date || clock.now()),\n      formatToParts: (date) => realFormatter.formatToParts(date || clock.now())\n    };\n    return formatter;\n  };\n  ClockIntl.DateTimeFormat.prototype = Object.create(\n    NativeIntl.DateTimeFormat.prototype\n  );\n  ClockIntl.DateTimeFormat.supportedLocalesOf = NativeIntl.DateTimeFormat.supportedLocalesOf;\n  return ClockIntl;\n}\nfunction compareTimers(a, b) {\n  if (a.callAt < b.callAt)\n    return -1;\n  if (a.callAt > b.callAt)\n    return 1;\n  if (a.type === "Immediate" /* Immediate */ && b.type !== "Immediate" /* Immediate */)\n    return -1;\n  if (a.type !== "Immediate" /* Immediate */ && b.type === "Immediate" /* Immediate */)\n    return 1;\n  if (a.createdAt < b.createdAt)\n    return -1;\n  if (a.createdAt > b.createdAt)\n    return 1;\n  if (a.id < b.id)\n    return -1;\n  if (a.id > b.id)\n    return 1;\n}\nvar maxTimeout = Math.pow(2, 31) - 1;\nvar idCounterStart = 1e12;\nfunction platformOriginals(globalObject) {\n  const raw = {\n    setTimeout: globalObject.setTimeout,\n    clearTimeout: globalObject.clearTimeout,\n    setInterval: globalObject.setInterval,\n    clearInterval: globalObject.clearInterval,\n    requestAnimationFrame: globalObject.requestAnimationFrame ? globalObject.requestAnimationFrame : void 0,\n    cancelAnimationFrame: globalObject.cancelAnimationFrame ? globalObject.cancelAnimationFrame : void 0,\n    requestIdleCallback: globalObject.requestIdleCallback ? globalObject.requestIdleCallback : void 0,\n    cancelIdleCallback: globalObject.cancelIdleCallback ? globalObject.cancelIdleCallback : void 0,\n    Date: globalObject.Date,\n    performance: globalObject.performance,\n    Intl: globalObject.Intl,\n    AbortSignal: globalObject.AbortSignal\n  };\n  const bound = { ...raw };\n  for (const key of Object.keys(bound)) {\n    if (key !== "Date" && key !== "AbortSignal" && typeof bound[key] === "function")\n      bound[key] = bound[key].bind(globalObject);\n  }\n  return { raw, bound };\n}\nfunction getScheduleHandler(type) {\n  if (type === "IdleCallback" || type === "AnimationFrame")\n    return `request${type}`;\n  return `set${type}`;\n}\nfunction createApi(clock, originals, browserName) {\n  return {\n    setTimeout: (func, timeout, ...args) => {\n      const delay = timeout ? +timeout : timeout;\n      return clock.addTimer({\n        type: "Timeout" /* Timeout */,\n        func,\n        args,\n        delay\n      });\n    },\n    clearTimeout: (timerId) => {\n      if (timerId)\n        clock.clearTimer(timerId, "Timeout" /* Timeout */);\n    },\n    setInterval: (func, timeout, ...args) => {\n      const delay = timeout ? +timeout : timeout;\n      return clock.addTimer({\n        type: "Interval" /* Interval */,\n        func,\n        args,\n        delay\n      });\n    },\n    clearInterval: (timerId) => {\n      if (timerId)\n        return clock.clearTimer(timerId, "Interval" /* Interval */);\n    },\n    requestAnimationFrame: (callback) => {\n      return clock.addTimer({\n        type: "AnimationFrame" /* AnimationFrame */,\n        func: callback,\n        delay: clock.getTimeToNextFrame()\n      });\n    },\n    cancelAnimationFrame: (timerId) => {\n      if (timerId)\n        return clock.clearTimer(timerId, "AnimationFrame" /* AnimationFrame */);\n    },\n    requestIdleCallback: (callback, options) => {\n      let timeToNextIdlePeriod = 0;\n      if (clock.countTimers() > 0)\n        timeToNextIdlePeriod = 50;\n      return clock.addTimer({\n        type: "IdleCallback" /* IdleCallback */,\n        func: callback,\n        delay: (options == null ? void 0 : options.timeout) ? Math.min(options == null ? void 0 : options.timeout, timeToNextIdlePeriod) : timeToNextIdlePeriod\n      });\n    },\n    cancelIdleCallback: (timerId) => {\n      if (timerId)\n        return clock.clearTimer(timerId, "IdleCallback" /* IdleCallback */);\n    },\n    Intl: originals.Intl ? createIntl(clock, originals.Intl) : void 0,\n    Date: createDate(clock, originals.Date),\n    performance: originals.performance ? fakePerformance(clock, originals.performance) : void 0,\n    AbortSignal: originals.AbortSignal ? fakeAbortSignal(clock, originals.AbortSignal, browserName) : void 0\n  };\n}\nfunction getClearHandler(type) {\n  if (type === "IdleCallback" || type === "AnimationFrame")\n    return `cancel${type}`;\n  return `clear${type}`;\n}\nvar FakePerformanceEntry = class {\n  constructor(name, entryType, startTime, duration) {\n    this.name = name;\n    this.entryType = entryType;\n    this.startTime = startTime;\n    this.duration = duration;\n  }\n  toJSON() {\n    return JSON.stringify({ ...this });\n  }\n};\nfunction fakePerformance(clock, performance) {\n  const result = {\n    now: () => clock.performanceNow()\n  };\n  result.__defineGetter__("timeOrigin", () => clock._now.origin || 0);\n  for (const key of Object.keys(performance.__proto__)) {\n    if (key === "now" || key === "timeOrigin")\n      continue;\n    if (key === "getEntries" || key === "getEntriesByName" || key === "getEntriesByType")\n      result[key] = () => [];\n    else if (key === "mark")\n      result[key] = (name) => new FakePerformanceEntry(name, "mark", 0, 0);\n    else if (key === "measure")\n      result[key] = (name) => new FakePerformanceEntry(name, "measure", 0, 50);\n    else\n      result[key] = () => {\n      };\n  }\n  return result;\n}\nfunction fakeAbortSignal(clock, abortSignal, browserName) {\n  Object.defineProperty(abortSignal, "timeout", {\n    value(ms) {\n      const controller = new AbortController();\n      clock.addTimer({\n        delay: ms,\n        type: "Timeout" /* Timeout */,\n        func: () => controller.abort(\n          new DOMException(\n            browserName === "chromium" ? "signal timed out" : "The operation timed out.",\n            "TimeoutError"\n          )\n        )\n      });\n      return controller.signal;\n    }\n  });\n  return abortSignal;\n}\nfunction createClock(globalObject, config = {}) {\n  const originals = platformOriginals(globalObject);\n  const embedder = {\n    dateNow: () => originals.raw.Date.now(),\n    performanceNow: () => Math.ceil(originals.raw.performance.now()),\n    setTimeout: (task, timeout) => {\n      const timerId = originals.bound.setTimeout(task, timeout);\n      return () => originals.bound.clearTimeout(timerId);\n    },\n    setInterval: (task, delay) => {\n      const intervalId = originals.bound.setInterval(task, delay);\n      return () => originals.bound.clearInterval(intervalId);\n    }\n  };\n  const clock = new ClockController(embedder);\n  const api = createApi(clock, originals.bound, config.browserName);\n  return { clock, api, originals: originals.raw };\n}\nfunction install(globalObject, config = {}) {\n  var _a, _b;\n  if ((_a = globalObject.Date) == null ? void 0 : _a.isFake) {\n    throw new TypeError(`Can\'t install fake timers twice on the same global object.`);\n  }\n  const { clock, api, originals } = createClock(globalObject, config);\n  const toFake = ((_b = config.toFake) == null ? void 0 : _b.length) ? config.toFake : Object.keys(originals);\n  for (const method of toFake) {\n    if (method === "Date") {\n      globalObject.Date = mirrorDateProperties(api.Date, globalObject.Date);\n    } else if (method === "Intl") {\n      globalObject.Intl = api[method];\n    } else if (method === "AbortSignal") {\n      globalObject.AbortSignal = api[method];\n    } else if (method === "performance") {\n      globalObject.performance = api[method];\n      const kEventTimeStamp = Symbol("playwrightEventTimeStamp");\n      Object.defineProperty(Event.prototype, "timeStamp", {\n        get() {\n          var _a2;\n          if (!this[kEventTimeStamp])\n            this[kEventTimeStamp] = (_a2 = api.performance) == null ? void 0 : _a2.now();\n          return this[kEventTimeStamp];\n        }\n      });\n    } else {\n      globalObject[method] = (...args) => {\n        return api[method].apply(api, args);\n      };\n    }\n    clock.disposables.push(() => {\n      globalObject[method] = originals[method];\n    });\n  }\n  return { clock, api, originals };\n}\nfunction inject(globalObject, browserName) {\n  const builtins = platformOriginals(globalObject).bound;\n  const { clock: controller } = install(globalObject, { browserName });\n  controller.resume();\n  return {\n    controller,\n    builtins\n  };\n}\nfunction asWallTime(n) {\n  return n;\n}\nfunction shiftTicks(ticks, ms) {\n  return ticks + ms;\n}\n';
  }
});

// packages/playwright-core/src/protocol/serializers.ts
function parseSerializedValue(value2, handles) {
  return innerParseSerializedValue(value2, handles, /* @__PURE__ */ new Map(), []);
}
function innerParseSerializedValue(value2, handles, refs, accessChain) {
  if (value2.ref !== void 0)
    return refs.get(value2.ref);
  if (value2.n !== void 0)
    return value2.n;
  if (value2.s !== void 0)
    return value2.s;
  if (value2.b !== void 0)
    return value2.b;
  if (value2.v !== void 0) {
    if (value2.v === "undefined")
      return void 0;
    if (value2.v === "null")
      return null;
    if (value2.v === "NaN")
      return NaN;
    if (value2.v === "Infinity")
      return Infinity;
    if (value2.v === "-Infinity")
      return -Infinity;
    if (value2.v === "-0")
      return -0;
  }
  if (value2.d !== void 0)
    return new Date(value2.d);
  if (value2.u !== void 0)
    return new URL(value2.u);
  if (value2.bi !== void 0)
    return BigInt(value2.bi);
  if (value2.e !== void 0) {
    const error = new Error(value2.e.m);
    error.name = value2.e.n;
    error.stack = value2.e.s;
    return error;
  }
  if (value2.r !== void 0)
    return new RegExp(value2.r.p, value2.r.f);
  if (value2.ta !== void 0) {
    const ctor = typedArrayKindToConstructor[value2.ta.k];
    return new ctor(value2.ta.b.buffer, value2.ta.b.byteOffset, value2.ta.b.length / ctor.BYTES_PER_ELEMENT);
  }
  if (value2.a !== void 0) {
    const result2 = [];
    refs.set(value2.id, result2);
    for (let i = 0; i < value2.a.length; i++)
      result2.push(innerParseSerializedValue(value2.a[i], handles, refs, [...accessChain, i]));
    return result2;
  }
  if (value2.o !== void 0) {
    const result2 = {};
    refs.set(value2.id, result2);
    for (const { k, v } of value2.o)
      result2[k] = innerParseSerializedValue(v, handles, refs, [...accessChain, k]);
    return result2;
  }
  if (value2.h !== void 0) {
    if (handles === void 0)
      throw new Error("Unexpected handle");
    return handles[value2.h];
  }
  throw new Error(`Attempting to deserialize unexpected value${accessChainToDisplayString(accessChain)}: ${value2}`);
}
function serializeValue(value2, handleSerializer) {
  return innerSerializeValue(value2, handleSerializer, { lastId: 0, visited: /* @__PURE__ */ new Map() }, []);
}
function innerSerializeValue(value2, handleSerializer, visitorInfo, accessChain) {
  const handle = handleSerializer(value2);
  if ("fallThrough" in handle)
    value2 = handle.fallThrough;
  else
    return handle;
  if (typeof value2 === "symbol")
    return { v: "undefined" };
  if (Object.is(value2, void 0))
    return { v: "undefined" };
  if (Object.is(value2, null))
    return { v: "null" };
  if (Object.is(value2, NaN))
    return { v: "NaN" };
  if (Object.is(value2, Infinity))
    return { v: "Infinity" };
  if (Object.is(value2, -Infinity))
    return { v: "-Infinity" };
  if (Object.is(value2, -0))
    return { v: "-0" };
  if (typeof value2 === "boolean")
    return { b: value2 };
  if (typeof value2 === "number")
    return { n: value2 };
  if (typeof value2 === "string")
    return { s: value2 };
  if (typeof value2 === "bigint")
    return { bi: value2.toString() };
  if (isError2(value2))
    return { e: { n: value2.name, m: value2.message, s: value2.stack || "" } };
  if (isDate(value2))
    return { d: value2.toJSON() };
  if (isURL(value2))
    return { u: value2.toJSON() };
  if (isRegExp4(value2))
    return { r: { p: value2.source, f: value2.flags } };
  const typedArrayKind = constructorToTypedArrayKind.get(value2.constructor);
  if (typedArrayKind)
    return { ta: { b: Buffer.from(value2.buffer, value2.byteOffset, value2.byteLength), k: typedArrayKind } };
  const id = visitorInfo.visited.get(value2);
  if (id)
    return { ref: id };
  if (Array.isArray(value2)) {
    const a = [];
    const id2 = ++visitorInfo.lastId;
    visitorInfo.visited.set(value2, id2);
    for (let i = 0; i < value2.length; ++i)
      a.push(innerSerializeValue(value2[i], handleSerializer, visitorInfo, [...accessChain, i]));
    return { a, id: id2 };
  }
  if (typeof value2 === "object") {
    const o = [];
    const id2 = ++visitorInfo.lastId;
    visitorInfo.visited.set(value2, id2);
    for (const name of Object.keys(value2))
      o.push({ k: name, v: innerSerializeValue(value2[name], handleSerializer, visitorInfo, [...accessChain, name]) });
    return { o, id: id2 };
  }
  throw new Error(`Attempting to serialize unexpected value${accessChainToDisplayString(accessChain)}: ${value2}`);
}
function accessChainToDisplayString(accessChain) {
  const chainString = accessChain.map((accessor, i) => {
    if (typeof accessor === "string")
      return i ? `.${accessor}` : accessor;
    return `[${accessor}]`;
  }).join("");
  return chainString.length > 0 ? ` at position "${chainString}"` : "";
}
function isRegExp4(obj) {
  return obj instanceof RegExp || Object.prototype.toString.call(obj) === "[object RegExp]";
}
function isDate(obj) {
  return obj instanceof Date || Object.prototype.toString.call(obj) === "[object Date]";
}
function isURL(obj) {
  return obj instanceof URL || Object.prototype.toString.call(obj) === "[object URL]";
}
function isError2(obj) {
  const proto = obj ? Object.getPrototypeOf(obj) : null;
  return obj instanceof Error || proto?.name === "Error" || proto && isError2(proto);
}
var typedArrayKindToConstructor, constructorToTypedArrayKind;
var init_serializers = __esm({
  "packages/playwright-core/src/protocol/serializers.ts"() {
    "use strict";
    typedArrayKindToConstructor = {
      i8: Int8Array,
      ui8: Uint8Array,
      ui8c: Uint8ClampedArray,
      i16: Int16Array,
      ui16: Uint16Array,
      i32: Int32Array,
      ui32: Uint32Array,
      f32: Float32Array,
      f64: Float64Array,
      bi64: BigInt64Array,
      bui64: BigUint64Array
    };
    constructorToTypedArrayKind = new Map(Object.entries(typedArrayKindToConstructor).map(([k, v]) => [v, k]));
  }
});

// packages/playwright-core/src/server/errors.ts
function isTargetClosedError(error) {
  return error instanceof TargetClosedError || error.name === "TargetClosedError";
}
function serializeError(e) {
  if (isError(e))
    return { error: { message: e.message, stack: e.stack, name: e.name } };
  return { value: serializeValue(e, (value2) => ({ fallThrough: value2 })) };
}
function parseError(error) {
  if (!error.error) {
    if (error.value === void 0)
      throw new Error("Serialized error must have either an error or a value");
    return parseSerializedValue(error.value, void 0);
  }
  const e = new Error(error.error.message);
  e.stack = error.error.stack || "";
  e.name = error.error.name;
  return e;
}
var CustomError, TimeoutError, TargetClosedError;
var init_errors = __esm({
  "packages/playwright-core/src/server/errors.ts"() {
    "use strict";
    init_rtti();
    init_serializers();
    CustomError = class extends Error {
      constructor(message) {
        super(message);
        this.name = this.constructor.name;
      }
    };
    TimeoutError = class extends CustomError {
    };
    TargetClosedError = class extends CustomError {
      constructor(cause, logs) {
        super((cause || "Target page, context or browser has been closed") + (logs || ""));
      }
    };
  }
});

// packages/playwright-core/src/server/progress.ts
function isAbortError(error) {
  return error instanceof TimeoutError || !!error[kAbortErrorSymbol];
}
async function raceUncancellableOperationWithCleanup(progress2, run, cleanup) {
  let aborted = false;
  try {
    return await progress2.race(run().then(async (t) => {
      if (aborted)
        await cleanup(t);
      return t;
    }));
  } catch (error) {
    aborted = true;
    throw error;
  }
}
var ProgressController, kAbortErrorSymbol, nullProgress;
var init_progress = __esm({
  "packages/playwright-core/src/server/progress.ts"() {
    "use strict";
    init_manualPromise();
    init_assert();
    init_time();
    init_debugLogger();
    init_errors();
    ProgressController = class _ProgressController {
      constructor(metadata, onCallLog) {
        this._forceAbortPromise = new ManualPromise();
        this._donePromise = new ManualPromise();
        this._state = "before";
        this.metadata = metadata || { id: "", startTime: 0, endTime: 0, type: "Internal", method: "", params: {}, log: [], internal: true };
        this._onCallLog = onCallLog;
        this._forceAbortPromise.catch((e) => null);
        this._controller = new AbortController();
      }
      static createForSdkObject(sdkObject, callMetadata) {
        const logName = sdkObject.logName || "api";
        return new _ProgressController(callMetadata, (message) => {
          if (logName === "api" && sdkObject.attribution.playwright?.options.isInternalPlaywright)
            return;
          debugLogger.log(logName, message);
          sdkObject.instrumentation.onCallLog(sdkObject, callMetadata, logName, message);
        });
      }
      async abort(error) {
        if (this._state === "running") {
          error[kAbortErrorSymbol] = true;
          this._state = { error };
          this._forceAbortPromise.reject(error);
          this._controller.abort(error);
        }
        await this._donePromise;
      }
      async run(task, timeout) {
        const deadline = timeout ? monotonicTime() + timeout : 0;
        assert(this._state === "before");
        this._state = "running";
        let timer;
        let outerProgress;
        let allowConcurrent = false;
        const progress2 = {
          timeout: timeout ?? 0,
          deadline,
          disableTimeout: () => {
            clearTimeout(timer);
          },
          log: (message) => {
            if (this._state === "running")
              this.metadata.log.push(message);
            this._onCallLog?.(message);
          },
          metadata: this.metadata,
          setAllowConcurrentOrNestedRaces: (allow) => {
            allowConcurrent = allow;
          },
          race: (promise) => {
            if (process.env.PW_DETECT_NESTED_PROGRESS) {
              const innerProgress = new Error().stack;
              if (outerProgress && !allowConcurrent && outerProgress !== innerProgress) {
                console.error("Cannot call race() inside another race()");
                console.error("<<<<<OUTER>>>>>:", outerProgress);
                console.error("<<<<<INNER>>>>>:", innerProgress);
              }
              outerProgress = innerProgress;
            }
            const promises = Array.isArray(promise) ? promise : [promise];
            if (!promises.length)
              return Promise.resolve();
            return Promise.race([...promises, this._forceAbortPromise]).finally(() => outerProgress = void 0);
          },
          wait: async (timeout2) => {
            let timer2;
            const promise = new Promise((f) => timer2 = setTimeout(f, timeout2));
            return progress2.race(promise).finally(() => clearTimeout(timer2));
          },
          signal: this._controller.signal
        };
        if (deadline) {
          const timeoutError = new TimeoutError(`Timeout ${timeout}ms exceeded.`);
          timer = setTimeout(() => {
            if (this.metadata.pauseStartTime && !this.metadata.pauseEndTime)
              return;
            if (this._state === "running") {
              this._state = { error: timeoutError };
              this._forceAbortPromise.reject(timeoutError);
              this._controller.abort(timeoutError);
            }
          }, deadline - monotonicTime());
        }
        try {
          const result2 = await task(progress2);
          this._state = "finished";
          return result2;
        } catch (error) {
          this._state = { error };
          throw error;
        } finally {
          clearTimeout(timer);
          this._donePromise.resolve();
        }
      }
    };
    kAbortErrorSymbol = Symbol("kAbortError");
    nullProgress = {
      timeout: 0,
      deadline: 0,
      disableTimeout() {
      },
      log() {
      },
      race(promise) {
        const promises = Array.isArray(promise) ? promise : [promise];
        return Promise.race(promises);
      },
      wait: async (timeout) => await new Promise((f) => setTimeout(f, timeout)),
      signal: new AbortController().signal,
      metadata: {
        id: "",
        startTime: 0,
        endTime: 0,
        type: "",
        method: "",
        params: {},
        log: [],
        internal: true
      },
      setAllowConcurrentOrNestedRaces() {
      }
    };
  }
});

// packages/playwright-core/src/server/clock.ts
function parseTicks(value2) {
  if (typeof value2 === "number")
    return value2;
  if (!value2)
    return 0;
  const str = value2;
  const strings = str.split(":");
  const l = strings.length;
  let i = l;
  let ms = 0;
  let parsed;
  if (l > 3 || !/^(\d\d:){0,2}\d\d?$/.test(str)) {
    throw new Error(
      `Clock only understands numbers, 'mm:ss' and 'hh:mm:ss'`
    );
  }
  while (i--) {
    parsed = parseInt(strings[i], 10);
    if (parsed >= 60)
      throw new Error(`Invalid time ${str}`);
    ms += parsed * Math.pow(60, l - i - 1);
  }
  return ms * 1e3;
}
function parseTime(epoch) {
  if (!epoch)
    return 0;
  if (typeof epoch === "number")
    return epoch;
  const parsed = new Date(epoch);
  if (!isFinite(parsed.getTime()))
    throw new Error(`Invalid date: ${epoch}`);
  return parsed.getTime();
}
var Clock;
var init_clock = __esm({
  "packages/playwright-core/src/server/clock.ts"() {
    "use strict";
    init_clockSource();
    init_progress();
    Clock = class {
      constructor(browserContext) {
        this._initScripts = [];
        this._browserContext = browserContext;
      }
      async uninstall(progress2) {
        await progress2.race(Promise.all(this._initScripts.map((script) => script.dispose())));
        this._initScripts = [];
      }
      async fastForward(ticks) {
        await this._installIfNeeded();
        const ticksMillis = parseTicks(ticks);
        this._initScripts.push(await this._browserContext.addInitScript(nullProgress, `globalThis.__pwClock.controller.log('fastForward', ${Date.now()}, ${ticksMillis})`));
        await this._evaluateInFrames(`globalThis.__pwClock.controller.fastForward(${ticksMillis})`);
      }
      async install(time) {
        await this._installIfNeeded();
        const timeMillis = time !== void 0 ? parseTime(time) : Date.now();
        this._initScripts.push(await this._browserContext.addInitScript(nullProgress, `globalThis.__pwClock.controller.log('install', ${Date.now()}, ${timeMillis})`));
        await this._evaluateInFrames(`globalThis.__pwClock.controller.install(${timeMillis})`);
      }
      async pauseAt(ticks) {
        await this._installIfNeeded();
        const timeMillis = parseTime(ticks);
        this._initScripts.push(await this._browserContext.addInitScript(nullProgress, `globalThis.__pwClock.controller.log('pauseAt', ${Date.now()}, ${timeMillis})`));
        await this._evaluateInFrames(`globalThis.__pwClock.controller.pauseAt(${timeMillis})`);
      }
      resumeNoReply() {
        if (!this._initScripts.length)
          return;
        const doResume = async () => {
          this._initScripts.push(await this._browserContext.addInitScript(nullProgress, `globalThis.__pwClock.controller.log('resume', ${Date.now()})`));
          await this._evaluateInFrames(`globalThis.__pwClock.controller.resume()`);
        };
        doResume().catch(() => {
        });
      }
      async resume(progress2) {
        await progress2.race(this._installIfNeeded());
        this._initScripts.push(await this._browserContext.addInitScript(nullProgress, `globalThis.__pwClock.controller.log('resume', ${Date.now()})`));
        await progress2.race(this._evaluateInFrames(`globalThis.__pwClock.controller.resume()`));
      }
      async setFixedTime(time) {
        await this._installIfNeeded();
        const timeMillis = parseTime(time);
        this._initScripts.push(await this._browserContext.addInitScript(nullProgress, `globalThis.__pwClock.controller.log('setFixedTime', ${Date.now()}, ${timeMillis})`));
        await this._evaluateInFrames(`globalThis.__pwClock.controller.setFixedTime(${timeMillis})`);
      }
      async setSystemTime(time) {
        await this._installIfNeeded();
        const timeMillis = parseTime(time);
        this._initScripts.push(await this._browserContext.addInitScript(nullProgress, `globalThis.__pwClock.controller.log('setSystemTime', ${Date.now()}, ${timeMillis})`));
        await this._evaluateInFrames(`globalThis.__pwClock.controller.setSystemTime(${timeMillis})`);
      }
      async runFor(ticks) {
        await this._installIfNeeded();
        const ticksMillis = parseTicks(ticks);
        this._initScripts.push(await this._browserContext.addInitScript(nullProgress, `globalThis.__pwClock.controller.log('runFor', ${Date.now()}, ${ticksMillis})`));
        await this._evaluateInFrames(`globalThis.__pwClock.controller.runFor(${ticksMillis})`);
      }
      async _installIfNeeded() {
        if (this._initScripts.length)
          return;
        const script = `(() => {
      const module = {};
      ${source}
      if (!globalThis.__pwClock)
        globalThis.__pwClock = (module.exports.inject())(globalThis, ${JSON.stringify(this._browserContext._browser.options.name)});
    })();`;
        const initScript = await this._browserContext.addInitScript(nullProgress, script);
        await this._evaluateInFrames(script);
        this._initScripts.push(initScript);
      }
      async _evaluateInFrames(script) {
        await this._browserContext.safeNonStallingEvaluateInAllFrames(script, "main", { throwOnJSErrors: true });
      }
    };
  }
});

// packages/playwright-core/src/generated/webAuthnSource.ts
var source2;
var init_webAuthnSource = __esm({
  "packages/playwright-core/src/generated/webAuthnSource.ts"() {
    "use strict";
    source2 = `
var __commonJS = obj => {
  let required = false;
  let result;
  return function __require() {
    if (!required) {
      required = true;
      let fn;
      for (const name in obj) { fn = obj[name]; break; }
      const module = { exports: {} };
      fn(module.exports, module);
      result = module.exports;
    }
    return result;
  }
};
var __export = (target, all) => {for (var name in all) target[name] = all[name];};
var __toESM = mod => ({ ...mod, 'default': mod });
var __toCommonJS = mod => ({ ...mod, __esModule: true });


// packages/injected/src/webAuthn.ts
var webAuthn_exports = {};
__export(webAuthn_exports, {
  inject: () => inject
});
module.exports = __toCommonJS(webAuthn_exports);
function inject(globalThis) {
  if (globalThis.__pwWebAuthnInstalled)
    return;
  globalThis.__pwWebAuthnInstalled = true;
  const binding = globalThis.__pwWebAuthnBinding;
  if (!binding || !globalThis.navigator)
    return;
  if (!globalThis.navigator.credentials) {
    Object.defineProperty(globalThis.navigator, "credentials", {
      value: { create: async () => null, get: async () => null },
      writable: true,
      configurable: true
    });
  }
  function toBase64Url(buf) {
    const bytes = buf instanceof ArrayBuffer ? new Uint8Array(buf) : new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength);
    let s = "";
    for (let i = 0; i < bytes.length; i++)
      s += String.fromCharCode(bytes[i]);
    return globalThis.btoa(s).replaceAll("+", "-").replaceAll("/", "_").replaceAll("=", "");
  }
  function fromBase64Url(s) {
    let str = s.replaceAll("-", "+").replaceAll("_", "/");
    while (str.length % 4)
      str += "=";
    const bin = globalThis.atob(str);
    const out = new Uint8Array(bin.length);
    for (let i = 0; i < bin.length; i++)
      out[i] = bin.charCodeAt(i);
    return out.buffer;
  }
  const PublicKeyCredentialCtor = globalThis.PublicKeyCredential;
  const AuthAttestationResponseCtor = globalThis.AuthenticatorAttestationResponse;
  const AuthAssertionResponseCtor = globalThis.AuthenticatorAssertionResponse;
  function defineReadonly(target, props) {
    for (const k of Object.keys(props))
      Object.defineProperty(target, k, { value: props[k], enumerable: true, configurable: true });
  }
  function makeAttestationResponse(clientDataJSON, attestationObject) {
    const proto = (AuthAttestationResponseCtor == null ? void 0 : AuthAttestationResponseCtor.prototype) || Object.prototype;
    const r = Object.create(proto);
    defineReadonly(r, { clientDataJSON, attestationObject });
    r.getTransports = () => ["internal"];
    r.getAuthenticatorData = () => {
      return attestationObject;
    };
    r.getPublicKey = () => null;
    r.getPublicKeyAlgorithm = () => -7;
    return r;
  }
  function makeAssertionResponse(clientDataJSON, authenticatorData, signature, userHandle) {
    const proto = (AuthAssertionResponseCtor == null ? void 0 : AuthAssertionResponseCtor.prototype) || Object.prototype;
    const r = Object.create(proto);
    defineReadonly(r, { clientDataJSON, authenticatorData, signature, userHandle });
    return r;
  }
  function makePublicKeyCredential(id, response) {
    const proto = (PublicKeyCredentialCtor == null ? void 0 : PublicKeyCredentialCtor.prototype) || Object.prototype;
    const cred = Object.create(proto);
    defineReadonly(cred, {
      id,
      rawId: fromBase64Url(id),
      type: "public-key",
      authenticatorAttachment: "platform",
      response
    });
    cred.getClientExtensionResults = () => ({});
    cred.toJSON = () => ({ id, rawId: id, type: "public-key", response: {} });
    return cred;
  }
  function toBuf(x) {
    if (!x)
      return new ArrayBuffer(0);
    if (x instanceof ArrayBuffer)
      return x;
    const v = x;
    const out = new Uint8Array(v.byteLength);
    out.set(new Uint8Array(v.buffer, v.byteOffset, v.byteLength));
    return out.buffer;
  }
  function failure(name, message) {
    const Ctor = globalThis.DOMException || Error;
    throw new Ctor(message, name);
  }
  const origCreate = globalThis.navigator.credentials.create.bind(globalThis.navigator.credentials);
  const origGet = globalThis.navigator.credentials.get.bind(globalThis.navigator.credentials);
  globalThis.navigator.credentials.create = async function(options) {
    var _a, _b, _c, _d, _e, _f, _g;
    if (!options || !options.publicKey)
      return origCreate(options);
    const pk = options.publicKey;
    const req = {
      type: "create",
      origin: globalThis.location.origin,
      challenge: toBase64Url(toBuf(pk.challenge)),
      rp: { id: (_a = pk.rp) == null ? void 0 : _a.id, name: ((_b = pk.rp) == null ? void 0 : _b.name) || "" },
      user: {
        id: toBase64Url(toBuf((_c = pk.user) == null ? void 0 : _c.id)),
        name: ((_d = pk.user) == null ? void 0 : _d.name) || "",
        displayName: ((_e = pk.user) == null ? void 0 : _e.displayName) || ""
      },
      pubKeyCredParams: (pk.pubKeyCredParams || []).map((p) => ({ type: p.type, alg: p.alg })),
      excludeCredentials: (pk.excludeCredentials || []).map((c) => ({ type: c.type, id: toBase64Url(toBuf(c.id)) })),
      userVerification: (_f = pk.authenticatorSelection) == null ? void 0 : _f.userVerification,
      residentKey: (_g = pk.authenticatorSelection) == null ? void 0 : _g.residentKey
    };
    const result = await binding(req);
    if (!result.ok)
      failure(result.name, result.message);
    const resp = makeAttestationResponse(fromBase64Url(result.clientDataJSON), fromBase64Url(result.attestationObject));
    return makePublicKeyCredential(result.id, resp);
  };
  globalThis.navigator.credentials.get = async function(options) {
    if (!options || !options.publicKey)
      return origGet(options);
    const pk = options.publicKey;
    const req = {
      type: "get",
      origin: globalThis.location.origin,
      challenge: toBase64Url(toBuf(pk.challenge)),
      rpId: pk.rpId || new URL(globalThis.location.origin).hostname,
      allowCredentials: (pk.allowCredentials || []).map((c) => ({ type: c.type, id: toBase64Url(toBuf(c.id)) })),
      userVerification: pk.userVerification
    };
    const result = await binding(req);
    if (!result.ok)
      failure(result.name, result.message);
    const resp = makeAssertionResponse(
      fromBase64Url(result.clientDataJSON),
      fromBase64Url(result.authenticatorData),
      fromBase64Url(result.signature),
      result.userHandle ? fromBase64Url(result.userHandle) : null
    );
    return makePublicKeyCredential(result.id, resp);
  };
  if (PublicKeyCredentialCtor) {
    PublicKeyCredentialCtor.isUserVerifyingPlatformAuthenticatorAvailable = async () => true;
    PublicKeyCredentialCtor.isConditionalMediationAvailable = async () => true;
  }
}
`;
  }
});

// packages/playwright-core/src/server/credentials.ts
function toPublic(r) {
  return { id: r.id, rpId: r.rpId, userHandle: r.userHandle, privateKey: r.privateKey, publicKey: r.publicKey };
}
function randomBase64Url(bytes) {
  return bufToB64Url(import_crypto6.default.randomBytes(bytes));
}
function bufToB64Url(b) {
  return b.toString("base64").replaceAll("+", "-").replaceAll("/", "_").replaceAll("=", "");
}
function b64UrlToBuf(s) {
  return Buffer.from(s, "base64url");
}
function u32ToBytes(n) {
  const b = Buffer.alloc(4);
  b.writeUInt32BE(n >>> 0, 0);
  return b;
}
function cborHead(major2, value2) {
  const m = major2 << 5;
  if (value2 < 24)
    return Buffer.from([m | value2]);
  if (value2 < 256)
    return Buffer.from([m | 24, value2]);
  if (value2 < 65536)
    return Buffer.from([m | 25, value2 >> 8 & 255, value2 & 255]);
  return Buffer.from([m | 26, value2 >>> 24 & 255, value2 >> 16 & 255, value2 >> 8 & 255, value2 & 255]);
}
function cborUint(v) {
  return cborHead(0, v);
}
function cborNint(v) {
  return cborHead(1, -1 - v);
}
function cborBytes(b) {
  return Buffer.concat([cborHead(2, b.length), b]);
}
function cborText(s) {
  const b = Buffer.from(s, "utf8");
  return Buffer.concat([cborHead(3, b.length), b]);
}
function cborMap(entries) {
  return Buffer.concat([cborHead(5, entries.length), ...entries.flatMap(([k, v]) => [k, v])]);
}
function encodeCoseEs256PublicKey(publicKey) {
  const jwk = publicKey.export({ format: "jwk" });
  const x = Buffer.from(jwk.x, "base64url");
  const y = Buffer.from(jwk.y, "base64url");
  return cborMap([
    [cborUint(1), cborUint(2)],
    // kty = EC2
    [cborUint(3), cborNint(-7)],
    // alg = ES256
    [cborNint(-1), cborUint(1)],
    // crv = P-256
    [cborNint(-2), cborBytes(x)],
    [cborNint(-3), cborBytes(y)]
  ]);
}
function encodeAttestationObjectNone(authData) {
  return cborMap([
    [cborText("fmt"), cborText("none")],
    [cborText("attStmt"), cborMap([])],
    [cborText("authData"), cborBytes(authData)]
  ]);
}
var import_crypto6, kBindingName, kAuthenticatorAAGUID, Credentials;
var init_credentials = __esm({
  "packages/playwright-core/src/server/credentials.ts"() {
    "use strict";
    import_crypto6 = __toESM(require("crypto"));
    init_webAuthnSource();
    init_progress();
    kBindingName = "__pwWebAuthnBinding";
    kAuthenticatorAAGUID = Buffer.alloc(16);
    Credentials = class {
      constructor(browserContext) {
        this._initScripts = [];
        this._installed = false;
        this._registry = /* @__PURE__ */ new Map();
        this._browserContext = browserContext;
      }
      async create(options) {
        let privateKey = options.privateKey;
        let publicKey = options.publicKey;
        if (!privateKey || !publicKey) {
          const pair = import_crypto6.default.generateKeyPairSync("ec", { namedCurve: "P-256" });
          privateKey = bufToB64Url(pair.privateKey.export({ format: "der", type: "pkcs8" }));
          publicKey = bufToB64Url(pair.publicKey.export({ format: "der", type: "spki" }));
        }
        const record = {
          id: options.id || randomBase64Url(16),
          rpId: options.rpId,
          userHandle: options.userHandle || randomBase64Url(16),
          privateKey,
          publicKey,
          signCount: 0,
          isResident: true
        };
        this._registry.set(record.id, record);
        return toPublic(record);
      }
      async get(filter) {
        return [...this._registry.values()].filter((c) => {
          if (filter?.rpId && c.rpId !== filter.rpId)
            return false;
          if (filter?.id && c.id !== filter.id)
            return false;
          return true;
        }).map(toPublic);
      }
      async delete(id) {
        this._registry.delete(id);
      }
      async dispose(progress2) {
        await progress2.race(Promise.all(this._initScripts.map((s) => s.dispose())));
        this._initScripts = [];
        this._installed = false;
        this._registry.clear();
      }
      async install(progress2) {
        if (this._installed)
          return;
        this._installed = true;
        await this._browserContext.exposeBinding(progress2, kBindingName, async (_source, payload) => {
          try {
            if (payload?.type === "create")
              return await this._handleCreate(payload);
            if (payload?.type === "get")
              return this._handleGet(payload);
          } catch (e) {
            return { ok: false, name: "NotAllowedError", message: e.message };
          }
          return { ok: false, name: "NotAllowedError", message: "Unknown WebAuthn request" };
        });
        const script = `(() => {
      const module = {};
      ${source2}
      module.exports.inject()(globalThis);
    })();`;
        const initScript = await this._browserContext.addInitScript(nullProgress, script);
        this._initScripts.push(initScript);
        await progress2.race(this._browserContext.safeNonStallingEvaluateInAllFrames(script, "main", { throwOnJSErrors: false }));
      }
      async _handleCreate(req) {
        const rpId = req.rp?.id || new URL(req.origin).hostname;
        const userHandle = req.user.id;
        if (req.excludeCredentials?.length) {
          for (const desc of req.excludeCredentials) {
            if (this._registry.has(desc.id))
              return { ok: false, name: "InvalidStateError", message: "Credential excluded" };
          }
        }
        const pair = import_crypto6.default.generateKeyPairSync("ec", { namedCurve: "P-256" });
        const privateKey = bufToB64Url(pair.privateKey.export({ format: "der", type: "pkcs8" }));
        const publicKey = bufToB64Url(pair.publicKey.export({ format: "der", type: "spki" }));
        const credentialId = import_crypto6.default.randomBytes(16);
        const credentialIdB64 = bufToB64Url(credentialId);
        const record = {
          id: credentialIdB64,
          rpId,
          userHandle,
          privateKey,
          publicKey,
          signCount: 0,
          isResident: req.residentKey === "required" || req.residentKey === "preferred"
        };
        this._registry.set(credentialIdB64, record);
        const clientDataJSON = Buffer.from(JSON.stringify({
          type: "webauthn.create",
          challenge: req.challenge,
          origin: req.origin,
          crossOrigin: false
        }));
        const rpIdHash = import_crypto6.default.createHash("sha256").update(rpId).digest();
        const flags = 1 | 4 | 64;
        const signCountBuf = u32ToBytes(record.signCount);
        const cosePublicKey = encodeCoseEs256PublicKey(pair.publicKey);
        const credIdLenBuf = Buffer.from([credentialId.length >> 8 & 255, credentialId.length & 255]);
        const attestedCredentialData = Buffer.concat([kAuthenticatorAAGUID, credIdLenBuf, credentialId, cosePublicKey]);
        const authData = Buffer.concat([rpIdHash, Buffer.from([flags]), signCountBuf, attestedCredentialData]);
        const attestationObject = encodeAttestationObjectNone(authData);
        return {
          ok: true,
          id: credentialIdB64,
          clientDataJSON: bufToB64Url(clientDataJSON),
          attestationObject: bufToB64Url(attestationObject)
        };
      }
      _handleGet(req) {
        const rpId = req.rpId || new URL(req.origin).hostname;
        let candidate;
        if (req.allowCredentials?.length) {
          for (const desc of req.allowCredentials) {
            const c = this._registry.get(desc.id);
            if (c && c.rpId === rpId) {
              candidate = c;
              break;
            }
          }
        } else {
          for (const c of this._registry.values()) {
            if (c.rpId === rpId && c.isResident) {
              candidate = c;
              break;
            }
          }
        }
        if (!candidate)
          return { ok: false, name: "NotAllowedError", message: "No matching credential" };
        const clientDataJSON = Buffer.from(JSON.stringify({
          type: "webauthn.get",
          challenge: req.challenge,
          origin: req.origin,
          crossOrigin: false
        }));
        const rpIdHash = import_crypto6.default.createHash("sha256").update(rpId).digest();
        const flags = 1 | 4;
        candidate.signCount += 1;
        const signCountBuf = u32ToBytes(candidate.signCount);
        const authData = Buffer.concat([rpIdHash, Buffer.from([flags]), signCountBuf]);
        const clientDataHash = import_crypto6.default.createHash("sha256").update(clientDataJSON).digest();
        const toSign = Buffer.concat([authData, clientDataHash]);
        const privateKey = import_crypto6.default.createPrivateKey({ key: b64UrlToBuf(candidate.privateKey), format: "der", type: "pkcs8" });
        const signature = import_crypto6.default.sign("sha256", toSign, privateKey);
        return {
          ok: true,
          id: candidate.id,
          clientDataJSON: bufToB64Url(clientDataJSON),
          authenticatorData: bufToB64Url(authData),
          signature: bufToB64Url(signature),
          userHandle: candidate.userHandle || null
        };
      }
    };
  }
});

// packages/playwright-core/src/server/instrumentation.ts
function createRootSdkObject() {
  const fakeParent = { attribution: {}, instrumentation: createInstrumentation() };
  const root = new SdkObject(fakeParent);
  root.guid = "";
  return root;
}
function createInstrumentation() {
  const listeners = /* @__PURE__ */ new Map();
  const lastListeners = /* @__PURE__ */ new Map();
  return new Proxy({}, {
    get: (obj, prop) => {
      if (typeof prop !== "string")
        return obj[prop];
      if (prop === "addListener") {
        return (listener, context2, options) => {
          if (options?.order === "last")
            lastListeners.set(listener, context2);
          else
            listeners.set(listener, context2);
        };
      }
      if (prop === "removeListener") {
        return (listener) => {
          listeners.delete(listener);
          lastListeners.delete(listener);
        };
      }
      if (!prop.startsWith("on"))
        return obj[prop];
      return async (sdkObject, ...params2) => {
        for (const [listener, context2] of listeners) {
          if (!context2 || sdkObject.attribution.context === context2)
            await listener[prop]?.(sdkObject, ...params2);
        }
        for (const [listener, context2] of lastListeners) {
          if (!context2 || sdkObject.attribution.context === context2)
            await listener[prop]?.(sdkObject, ...params2);
        }
      };
    }
  });
}
var import_events3, SdkObject;
var init_instrumentation = __esm({
  "packages/playwright-core/src/server/instrumentation.ts"() {
    "use strict";
    import_events3 = require("events");
    init_crypto();
    init_debugLogger();
    SdkObject = class extends import_events3.EventEmitter {
      constructor(parent, guidPrefix, guid) {
        super();
        this.guid = guid || `${guidPrefix || ""}@${createGuid()}`;
        this.setMaxListeners(0);
        this.attribution = { ...parent.attribution };
        this.instrumentation = parent.instrumentation;
      }
      apiLog(message) {
        if (!this.attribution.playwright.options.isInternalPlaywright)
          debugLogger.log("api", message);
      }
      closeReason() {
        return this.attribution.worker?._closeReason || this.attribution.page?._closeReason || this.attribution.context?._closeReason || this.attribution.browser?._closeReason;
      }
    };
  }
});

// packages/playwright-core/src/server/debugger.ts
function matchesLocation(metadata, location2) {
  return !!metadata.location?.file.includes(location2.file) && (location2.line === void 0 || metadata.location.line === location2.line) && (location2.column === void 0 || metadata.location.column === location2.column);
}
var symbol, Debugger;
var init_debugger = __esm({
  "packages/playwright-core/src/server/debugger.ts"() {
    "use strict";
    init_protocolMetainfo();
    init_time();
    init_instrumentation();
    init_browserContext();
    symbol = Symbol("Debugger");
    Debugger = class _Debugger extends SdkObject {
      constructor(context2) {
        super(context2, "debugger");
        this._pauseAt = {};
        this._enabled = false;
        this._pauseBeforeWaitingActions = false;
        this._muted = false;
        this._context = context2;
        this._context[symbol] = this;
        context2.instrumentation.addListener(this, context2, { order: "last" });
        this._context.once(BrowserContext.Events.Close, () => {
          this._context.instrumentation.removeListener(this);
        });
      }
      static {
        this.Events = {
          PausedStateChanged: "pausedstatechanged"
        };
      }
      requestPause(progress2) {
        if (this.isPaused())
          throw new Error("Debugger is already paused");
        this.setPauseBeforeWaitingActions();
        this.setPauseAt({ next: true });
      }
      doResume(progress2) {
        if (!this.isPaused())
          throw new Error("Debugger is not paused");
        this.resume();
      }
      next(progress2) {
        if (!this.isPaused())
          throw new Error("Debugger is not paused");
        this.setPauseBeforeWaitingActions();
        this.setPauseAt({ next: true });
        this.resume();
      }
      runTo(progress2, location2) {
        if (!this.isPaused())
          throw new Error("Debugger is not paused");
        this.setPauseBeforeWaitingActions();
        this.setPauseAt({ location: location2 });
        this.resume();
      }
      async setMuted(muted) {
        this._muted = muted;
      }
      async onBeforeCall(sdkObject, metadata) {
        if (this._muted || metadata.internal)
          return;
        const metainfo = getMetainfo(metadata);
        const pauseOnPauseCall = this._enabled && metadata.type === "BrowserContext" && metadata.method === "pause";
        const pauseBeforeAction = !!this._pauseAt.next && !!metainfo?.pause && (this._pauseBeforeWaitingActions || !metainfo?.isAutoWaiting);
        const pauseOnLocation = !!this._pauseAt.location && matchesLocation(metadata, this._pauseAt.location);
        if (pauseOnPauseCall || pauseBeforeAction || pauseOnLocation)
          await this._pause(sdkObject, metadata);
      }
      async onBeforeInputAction(sdkObject, metadata) {
        if (this._muted || metadata.internal)
          return;
        const metainfo = getMetainfo(metadata);
        const pauseBeforeInput = !!this._pauseAt.next && !!metainfo?.pause && !!metainfo?.isAutoWaiting && !this._pauseBeforeWaitingActions;
        if (pauseBeforeInput)
          await this._pause(sdkObject, metadata);
      }
      async _pause(sdkObject, metadata) {
        if (this._muted || metadata.internal)
          return;
        if (this._pausedCall)
          return;
        this._pauseAt = {};
        metadata.pauseStartTime = monotonicTime();
        const result2 = new Promise((resolve) => {
          this._pausedCall = { metadata, sdkObject, resolve };
        });
        this.emit(_Debugger.Events.PausedStateChanged);
        return result2;
      }
      resume() {
        if (!this._pausedCall)
          return;
        this._pausedCall.metadata.pauseEndTime = monotonicTime();
        this._pausedCall.resolve();
        this._pausedCall = void 0;
        this.emit(_Debugger.Events.PausedStateChanged);
      }
      setPauseBeforeWaitingActions() {
        this._pauseBeforeWaitingActions = true;
      }
      setPauseAt(at = {}) {
        this._enabled = true;
        this._pauseAt = at;
      }
      isPaused(metadata) {
        if (metadata)
          return this._pausedCall?.metadata === metadata;
        return !!this._pausedCall;
      }
      pausedDetails() {
        return this._pausedCall;
      }
    };
  }
});

// packages/playwright-core/src/server/dialog.ts
var Dialog, DialogManager;
var init_dialog = __esm({
  "packages/playwright-core/src/server/dialog.ts"() {
    "use strict";
    init_assert();
    init_instrumentation();
    Dialog = class extends SdkObject {
      constructor(page, type3, message, onHandle, defaultValue) {
        super(page, "dialog");
        this._handled = false;
        this._page = page;
        this._type = type3;
        this._message = message;
        this._onHandle = onHandle;
        this._defaultValue = defaultValue || "";
      }
      async accept(progress2, promptText) {
        await progress2.race(this._accept(promptText));
      }
      async dismiss(progress2) {
        await progress2.race(this._dismiss());
      }
      page() {
        return this._page;
      }
      type() {
        return this._type;
      }
      message() {
        return this._message;
      }
      defaultValue() {
        return this._defaultValue;
      }
      async _accept(promptText) {
        assert(!this._handled, "Cannot accept dialog which is already handled!");
        this._handled = true;
        this._page.browserContext.dialogManager._dialogWillClose(this);
        await this._onHandle(true, promptText);
      }
      async _dismiss() {
        assert(!this._handled, "Cannot dismiss dialog which is already handled!");
        this._handled = true;
        this._page.browserContext.dialogManager._dialogWillClose(this);
        await this._onHandle(false);
      }
      async _close() {
        if (this._type === "beforeunload")
          await this._accept();
        else
          await this._dismiss();
      }
    };
    DialogManager = class {
      constructor(instrumentation) {
        this._dialogHandlers = /* @__PURE__ */ new Set();
        this._openedDialogs = /* @__PURE__ */ new Set();
        this._instrumentation = instrumentation;
      }
      dialogDidOpen(dialog) {
        for (const frame of dialog.page().frameManager.frames())
          frame.invalidateNonStallingEvaluations("JavaScript dialog interrupted evaluation");
        this._openedDialogs.add(dialog);
        this._instrumentation.onDialog(dialog);
        let hasHandlers = false;
        for (const handler of this._dialogHandlers) {
          if (handler(dialog))
            hasHandlers = true;
        }
        if (!hasHandlers)
          dialog._close().then(() => {
          });
      }
      _dialogWillClose(dialog) {
        this._openedDialogs.delete(dialog);
      }
      addDialogHandler(handler) {
        this._dialogHandlers.add(handler);
      }
      removeDialogHandler(handler) {
        this._dialogHandlers.delete(handler);
        if (!this._dialogHandlers.size) {
          for (const dialog of this._openedDialogs)
            dialog._close().catch(() => {
            });
        }
      }
      hasOpenDialogsForPage(page) {
        return [...this._openedDialogs].some((dialog) => dialog.page() === page);
      }
      async closeBeforeUnloadDialogs() {
        await Promise.all([...this._openedDialogs].map(async (dialog) => {
          if (dialog.type() === "beforeunload")
            await dialog._dismiss();
        }));
      }
    };
  }
});

// packages/playwright-core/src/server/network.ts
function filterCookies(cookies, urls) {
  const parsedURLs = urls.map((s) => new URL(s));
  return cookies.filter((c) => {
    if (!parsedURLs.length)
      return true;
    for (const parsedURL of parsedURLs) {
      let domain = c.domain;
      if (!domain.startsWith("."))
        domain = "." + domain;
      if (!("." + parsedURL.hostname).endsWith(domain))
        continue;
      if (!parsedURL.pathname.startsWith(c.path))
        continue;
      if (parsedURL.protocol !== "https:" && !isLocalHostname(parsedURL.hostname) && c.secure)
        continue;
      return true;
    }
    return false;
  });
}
function isLocalHostname(hostname) {
  return hostname === "localhost" || hostname.endsWith(".localhost");
}
function isForbiddenHeader(name, value2) {
  const lowerName = name.toLowerCase();
  if (FORBIDDEN_HEADER_NAMES.has(lowerName))
    return true;
  if (lowerName.startsWith("proxy-"))
    return true;
  if (lowerName.startsWith("sec-"))
    return true;
  if (lowerName === "x-http-method" || lowerName === "x-http-method-override" || lowerName === "x-method-override") {
    if (value2 && FORBIDDEN_METHODS.has(value2.toUpperCase()))
      return true;
  }
  return false;
}
function applyHeadersOverrides(original, overrides) {
  const forbiddenHeaders = original.filter((header) => isForbiddenHeader(header.name, header.value));
  const allowedHeaders = overrides.filter((header) => !isForbiddenHeader(header.name, header.value));
  return mergeHeaders([allowedHeaders, forbiddenHeaders]);
}
function rewriteCookies(cookies) {
  return cookies.map((c) => {
    assert(c.url || c.domain && c.path, "Cookie should have a url or a domain/path pair");
    assert(!(c.url && c.domain), "Cookie should have either url or domain");
    assert(!(c.url && c.path), "Cookie should have either url or path");
    assert(!(c.expires && c.expires < 0 && c.expires !== -1), "Cookie should have a valid expires, only -1 or a positive number for the unix timestamp in seconds is allowed");
    assert(!(c.expires && c.expires > 0 && c.expires > kMaxCookieExpiresDateInSeconds), "Cookie should have a valid expires, only -1 or a positive number for the unix timestamp in seconds is allowed");
    const copy = { ...c };
    if (copy.url) {
      assert(copy.url !== "about:blank", `Blank page can not have cookie "${c.name}"`);
      assert(!copy.url.startsWith("data:"), `Data URL page can not have cookie "${c.name}"`);
      const url2 = new URL(copy.url);
      copy.domain = url2.hostname;
      copy.path = url2.pathname.substring(0, url2.pathname.lastIndexOf("/") + 1);
      copy.secure = url2.protocol === "https:";
    }
    return copy;
  });
}
function parseURL2(url2) {
  try {
    return new URL(url2);
  } catch (e) {
    return null;
  }
}
function stripFragmentFromUrl(url2) {
  if (!url2.includes("#"))
    return url2;
  return url2.substring(0, url2.indexOf("#"));
}
function statusText(status) {
  return STATUS_TEXTS[String(status)] || "Unknown";
}
function singleHeader(name, value2) {
  return [{ name, value: value2 }];
}
function mergeHeaders(headers) {
  const lowerCaseToValue = /* @__PURE__ */ new Map();
  const lowerCaseToOriginalCase = /* @__PURE__ */ new Map();
  for (const h of headers) {
    if (!h)
      continue;
    for (const { name, value: value2 } of h) {
      const lower = name.toLowerCase();
      lowerCaseToOriginalCase.set(lower, name);
      lowerCaseToValue.set(lower, value2);
    }
  }
  const result2 = [];
  for (const [lower, value2] of lowerCaseToValue)
    result2.push({ name: lowerCaseToOriginalCase.get(lower), value: value2 });
  return result2;
}
function headersSize(headers) {
  let result2 = 0;
  for (const header of headers)
    result2 += header.name.length + header.value.length + 4;
  return result2;
}
function requestHeadersSize(headers, url2, method) {
  let result2 = 4;
  result2 += method.length;
  result2 += new URL(url2).pathname.length;
  result2 += 8;
  result2 += headersSize(headers);
  return result2;
}
function responseHeadersSize(headers, statusText2) {
  let result2 = 4;
  result2 += 8;
  result2 += 3;
  result2 += statusText2.length;
  result2 += headersSize(headers);
  result2 += 2;
  return result2;
}
var FORBIDDEN_HEADER_NAMES, FORBIDDEN_METHODS, kMaxCookieExpiresDateInSeconds, Request, Route, Response2, WebSocket, STATUS_TEXTS;
var init_network2 = __esm({
  "packages/playwright-core/src/server/network.ts"() {
    "use strict";
    init_manualPromise();
    init_assert();
    init_browserContext();
    init_fetch();
    init_instrumentation();
    FORBIDDEN_HEADER_NAMES = /* @__PURE__ */ new Set([
      "accept-charset",
      "accept-encoding",
      "access-control-request-headers",
      "access-control-request-method",
      "connection",
      "content-length",
      "cookie",
      "date",
      "dnt",
      "expect",
      "host",
      "keep-alive",
      "origin",
      "referer",
      "set-cookie",
      "te",
      "trailer",
      "transfer-encoding",
      "upgrade",
      "via"
    ]);
    FORBIDDEN_METHODS = /* @__PURE__ */ new Set(["CONNECT", "TRACE", "TRACK"]);
    kMaxCookieExpiresDateInSeconds = 253402300799;
    Request = class _Request extends SdkObject {
      constructor(context2, frame, serviceWorker, redirectedFrom, documentId, url2, resourceType, method, postData, headers, wallTimeMs) {
        super(frame || context2, "request");
        this._response = null;
        this._redirectedTo = null;
        this._failureText = null;
        this._frame = null;
        this._serviceWorker = null;
        this._rawRequestHeadersPromise = new ManualPromise();
        this._waitForResponsePromise = new ManualPromise();
        this._responseEndTiming = -1;
        assert(!url2.startsWith("data:"), "Data urls should not fire requests");
        this._context = context2;
        this._frame = frame;
        this._serviceWorker = serviceWorker;
        this._redirectedFrom = redirectedFrom;
        if (redirectedFrom)
          redirectedFrom._redirectedTo = this;
        this._documentId = documentId;
        this._url = stripFragmentFromUrl(url2);
        this._resourceType = resourceType;
        this._method = method;
        this._postData = postData;
        this._headers = headers;
        this._wallTimeMs = wallTimeMs;
        this._isFavicon = url2.endsWith("/favicon.ico") || !!redirectedFrom?._isFavicon;
      }
      static {
        this.Events = {
          Response: "response"
        };
      }
      wallTimeMs() {
        return this._wallTimeMs;
      }
      async raceWithPageClosure(progress2, promise) {
        const scope = this._serviceWorker?.openScope ?? this._frame?._page.openScope;
        if (scope)
          return await progress2.race(scope.race(promise));
        return await progress2.race(promise);
      }
      async rawRequestHeaders(progress2) {
        return await this.raceWithPageClosure(progress2, this.internalRawRequestHeaders());
      }
      async response(progress2) {
        return await this.raceWithPageClosure(progress2, this._waitForResponse());
      }
      _setFailureText(failureText) {
        this._failureText = failureText;
        this._waitForResponsePromise.resolve(null);
      }
      _applyOverrides(overrides) {
        this._overrides = { ...this._overrides, ...overrides };
        return this._overrides;
      }
      overrides() {
        return this._overrides;
      }
      url() {
        return this._overrides?.url || this._url;
      }
      resourceType() {
        return this._resourceType;
      }
      method() {
        return this._overrides?.method || this._method;
      }
      postDataBuffer() {
        return this._overrides?.postData || this._postData;
      }
      headers() {
        return this._overrides?.headers || this._headers;
      }
      headerValue(name) {
        const lowerCaseName = name.toLowerCase();
        return this.headers().find((h) => h.name.toLowerCase() === lowerCaseName)?.value;
      }
      // "null" means no raw headers available - we'll use provisional headers as raw headers.
      setRawRequestHeaders(headers) {
        if (!this._rawRequestHeadersPromise.isDone())
          this._rawRequestHeadersPromise.resolve(headers || this._headers);
      }
      async internalRawRequestHeaders() {
        return this._overrides?.headers || this._rawRequestHeadersPromise;
      }
      _waitForResponse() {
        return this._waitForResponsePromise;
      }
      _existingResponse() {
        return this._response;
      }
      _setResponse(response2) {
        this._response = response2;
        this._waitForResponsePromise.resolve(response2);
        this.emit(_Request.Events.Response, response2);
      }
      _finalRequest() {
        return this._redirectedTo ? this._redirectedTo._finalRequest() : this;
      }
      frame() {
        return this._frame;
      }
      serviceWorker() {
        return this._serviceWorker;
      }
      isNavigationRequest() {
        return !!this._documentId;
      }
      redirectedFrom() {
        return this._redirectedFrom;
      }
      failure() {
        if (this._failureText === null)
          return null;
        return {
          errorText: this._failureText
        };
      }
      // TODO(bidi): remove once post body is available.
      _setBodySize(size) {
        this._bodySize = size;
      }
      bodySize() {
        return this._bodySize || this.postDataBuffer()?.length || 0;
      }
      async _requestHeadersSize() {
        return requestHeadersSize(await this.internalRawRequestHeaders(), this.url(), this.method());
      }
    };
    Route = class extends SdkObject {
      constructor(request2, delegate) {
        super(request2._frame || request2._context, "route");
        this._handled = false;
        this._futureHandlers = [];
        this._request = request2;
        this._delegate = delegate;
        this._request._context.addRouteInFlight(this);
      }
      handle(handlers) {
        this._futureHandlers = [...handlers];
        this.continue({ isFallback: true }).catch(() => {
        });
      }
      async removeHandler(handler) {
        this._futureHandlers = this._futureHandlers.filter((h) => h !== handler);
        if (handler === this._currentHandler) {
          await this.continue({ isFallback: true }).catch(() => {
          });
          return;
        }
      }
      request() {
        return this._request;
      }
      async abort(errorCode = "failed") {
        this._startHandling();
        this._request._context.emit(BrowserContext.Events.RequestAborted, this._request);
        await this._delegate.abort(errorCode);
        this._endHandling();
      }
      redirectNavigationRequest(url2) {
        this._startHandling();
        assert(this._request.isNavigationRequest());
        this._request.frame().redirectNavigation(url2, this._request._documentId, this._request.headerValue("referer"));
        this._endHandling();
      }
      async fulfill(overrides) {
        this._startHandling();
        let body = overrides.body;
        let isBase64 = overrides.isBase64 || false;
        if (body === void 0) {
          if (overrides.fetchResponseUid) {
            const buffer = this._request._context.fetchRequest.fetchResponses.get(overrides.fetchResponseUid) || APIRequestContext.findResponseBody(overrides.fetchResponseUid);
            assert(buffer, "Fetch response has been disposed");
            body = buffer.toString("base64");
            isBase64 = true;
          } else {
            body = "";
            isBase64 = false;
          }
        } else if (!overrides.status || overrides.status < 200 || overrides.status >= 400) {
          this._request._responseBodyOverride = { body, isBase64 };
        }
        const headers = [...overrides.headers || []];
        this._maybeAddCorsHeaders(headers);
        this._request._context.emit(BrowserContext.Events.RequestFulfilled, this._request);
        await this._delegate.fulfill({
          status: overrides.status || 200,
          headers,
          body,
          isBase64
        });
        this._endHandling();
      }
      // See https://github.com/microsoft/playwright/issues/12929
      _maybeAddCorsHeaders(headers) {
        const origin = this._request.headerValue("origin");
        if (!origin)
          return;
        const requestUrl = new URL(this._request.url());
        if (!requestUrl.protocol.startsWith("http"))
          return;
        if (requestUrl.origin === origin.trim())
          return;
        const corsHeader = headers.find(({ name }) => name === "access-control-allow-origin");
        if (corsHeader)
          return;
        headers.push({ name: "access-control-allow-origin", value: origin });
        headers.push({ name: "access-control-allow-credentials", value: "true" });
        headers.push({ name: "vary", value: "Origin" });
      }
      async continue(overrides) {
        if (overrides.url) {
          const newUrl = new URL(overrides.url);
          const oldUrl = new URL(this._request.url());
          if (oldUrl.protocol !== newUrl.protocol)
            throw new Error("New URL must have same protocol as overridden URL");
        }
        if (overrides.headers) {
          overrides.headers = applyHeadersOverrides(this._request._headers, overrides.headers);
        }
        overrides = this._request._applyOverrides(overrides);
        const nextHandler = this._futureHandlers.shift();
        if (nextHandler) {
          this._currentHandler = nextHandler;
          nextHandler(this, this._request);
          return;
        }
        if (!overrides.isFallback)
          this._request._context.emit(BrowserContext.Events.RequestContinued, this._request);
        this._startHandling();
        await this._delegate.continue(overrides);
        this._endHandling();
      }
      _startHandling() {
        assert(!this._handled, "Route is already handled!");
        this._handled = true;
        this._currentHandler = void 0;
      }
      _endHandling() {
        this._futureHandlers = [];
        this._currentHandler = void 0;
        this._request._context.removeRouteInFlight(this);
      }
    };
    Response2 = class extends SdkObject {
      constructor(request2, status, statusText2, headers, timing, getResponseBodyCallback, fromServiceWorker) {
        super(request2.frame() || request2._context, "response");
        this._contentPromise = null;
        this._finishedPromise = new ManualPromise();
        this._headersMap = /* @__PURE__ */ new Map();
        this._serverAddrPromise = new ManualPromise();
        this._securityDetailsPromise = new ManualPromise();
        this._rawResponseHeadersPromise = new ManualPromise();
        this._httpVersionPromise = new ManualPromise();
        this._encodedBodySizePromise = new ManualPromise();
        this._transferSizePromise = new ManualPromise();
        this._responseHeadersSizePromise = new ManualPromise();
        this._request = request2;
        this._timing = timing;
        this._status = status;
        this._statusText = statusText2;
        this._url = request2.url();
        this._headers = headers;
        for (const { name, value: value2 } of this._headers)
          this._headersMap.set(name.toLowerCase(), value2);
        this._getResponseBodyCallback = getResponseBodyCallback;
        this._request._setResponse(this);
        this._fromServiceWorker = fromServiceWorker;
      }
      async body(progress2) {
        return await this._request.raceWithPageClosure(progress2, this.internalBody());
      }
      async securityDetails(progress2) {
        return await this._request.raceWithPageClosure(progress2, this.internalSecurityDetails());
      }
      async serverAddr(progress2) {
        return await this._request.raceWithPageClosure(progress2, this.internalServerAddr());
      }
      async rawResponseHeaders(progress2) {
        return await this._request.raceWithPageClosure(progress2, this.internalRawResponseHeaders());
      }
      async httpVersion(progress2) {
        return await this._request.raceWithPageClosure(progress2, this.internalHttpVersion());
      }
      async sizes(progress2) {
        return await this._request.raceWithPageClosure(progress2, this.internalSizes());
      }
      _serverAddrFinished(addr) {
        this._serverAddrPromise.resolve(addr);
      }
      _securityDetailsFinished(securityDetails) {
        this._securityDetailsPromise.resolve(securityDetails);
      }
      _requestFinished(responseEndTiming) {
        this._request._responseEndTiming = Math.max(responseEndTiming, this._timing.responseStart);
        if (this._timing.requestStart === -1)
          this._timing.requestStart = this._request._responseEndTiming;
        this._finishedPromise.resolve();
      }
      _setHttpVersion(httpVersion) {
        this._httpVersionPromise.resolve(httpVersion);
      }
      url() {
        return this._url;
      }
      status() {
        return this._status;
      }
      statusText() {
        return this._statusText;
      }
      headers() {
        return this._headers;
      }
      headerValue(name) {
        return this._headersMap.get(name);
      }
      // "null" means no raw headers available - we'll use provisional headers as raw headers.
      setRawResponseHeaders(headers) {
        if (!this._rawResponseHeadersPromise.isDone())
          this._rawResponseHeadersPromise.resolve(headers || this._headers);
      }
      setTransferSize(size) {
        this._transferSizePromise.resolve(size);
      }
      setEncodedBodySize(size) {
        this._encodedBodySizePromise.resolve(size);
      }
      setResponseHeadersSize(size) {
        this._responseHeadersSizePromise.resolve(size);
      }
      timing() {
        return this._timing;
      }
      async internalSecurityDetails() {
        return await this._securityDetailsPromise || null;
      }
      async internalServerAddr() {
        return await this._serverAddrPromise || null;
      }
      async internalRawResponseHeaders() {
        return await this._rawResponseHeadersPromise;
      }
      internalBody() {
        if (!this._contentPromise) {
          this._contentPromise = this._finishedPromise.then(async () => {
            if (this._status >= 300 && this._status <= 399)
              throw new Error("Response body is unavailable for redirect responses");
            if (this._request._responseBodyOverride) {
              const { body, isBase64 } = this._request._responseBodyOverride;
              return Buffer.from(body, isBase64 ? "base64" : "utf-8");
            }
            return this._getResponseBodyCallback();
          });
        }
        return this._contentPromise;
      }
      request() {
        return this._request;
      }
      finished() {
        return this._finishedPromise;
      }
      frame() {
        return this._request.frame();
      }
      async internalHttpVersion() {
        const httpVersion = await this._httpVersionPromise || null;
        if (!httpVersion)
          return "HTTP/1.1";
        if (httpVersion === "http/1.1")
          return "HTTP/1.1";
        if (httpVersion === "h2")
          return "HTTP/2.0";
        return httpVersion;
      }
      fromServiceWorker() {
        return this._fromServiceWorker;
      }
      async responseHeadersSize() {
        const availableSize = await this._responseHeadersSizePromise;
        if (availableSize !== null)
          return availableSize;
        return responseHeadersSize(await this._rawResponseHeadersPromise, this.statusText());
      }
      async internalSizes() {
        const requestHeadersSize2 = await this._request._requestHeadersSize();
        const responseHeadersSize2 = await this.responseHeadersSize();
        let encodedBodySize = await this._encodedBodySizePromise;
        if (encodedBodySize === null) {
          const headers = await this._rawResponseHeadersPromise;
          const contentLength = headers.find((h) => h.name.toLowerCase() === "content-length")?.value;
          encodedBodySize = contentLength ? +contentLength : 0;
        }
        let transferSize = await this._transferSizePromise;
        if (transferSize === null) {
          transferSize = responseHeadersSize2 + encodedBodySize;
        }
        return {
          requestBodySize: this._request.bodySize(),
          requestHeadersSize: requestHeadersSize2,
          responseBodySize: encodedBodySize,
          responseHeadersSize: responseHeadersSize2,
          transferSize
        };
      }
    };
    WebSocket = class _WebSocket extends SdkObject {
      constructor(parent, url2) {
        super(parent, "ws");
        this._notified = false;
        this._url = stripFragmentFromUrl(url2);
      }
      static {
        this.Events = {
          Close: "close",
          SocketError: "socketerror",
          FrameReceived: "framereceived",
          FrameSent: "framesent",
          Request: "request",
          Response: "response"
        };
      }
      markAsNotified() {
        if (this._notified)
          return false;
        this._notified = true;
        return true;
      }
      url() {
        return this._url;
      }
      wallTimeMs() {
        return this._wallTimeMs;
      }
      setWallTimeMs(wallTimeMs) {
        this._wallTimeMs = wallTimeMs;
      }
      requestSent(headers) {
        this.emit(_WebSocket.Events.Request, { headers });
      }
      responseReceived(status, statusText2, headers) {
        this.emit(_WebSocket.Events.Response, { status, statusText: statusText2, headers });
      }
      frameSent(opcode, data, wallTimeMs) {
        this.emit(_WebSocket.Events.FrameSent, { opcode, data, wallTimeMs });
      }
      frameReceived(opcode, data, wallTimeMs) {
        this.emit(_WebSocket.Events.FrameReceived, { opcode, data, wallTimeMs });
      }
      error(errorMessage) {
        this.emit(_WebSocket.Events.SocketError, errorMessage);
      }
      closed() {
        this.emit(_WebSocket.Events.Close);
      }
    };
    STATUS_TEXTS = {
      "100": "Continue",
      "101": "Switching Protocols",
      "102": "Processing",
      "103": "Early Hints",
      "200": "OK",
      "201": "Created",
      "202": "Accepted",
      "203": "Non-Authoritative Information",
      "204": "No Content",
      "205": "Reset Content",
      "206": "Partial Content",
      "207": "Multi-Status",
      "208": "Already Reported",
      "226": "IM Used",
      "300": "Multiple Choices",
      "301": "Moved Permanently",
      "302": "Found",
      "303": "See Other",
      "304": "Not Modified",
      "305": "Use Proxy",
      "306": "Switch Proxy",
      "307": "Temporary Redirect",
      "308": "Permanent Redirect",
      "400": "Bad Request",
      "401": "Unauthorized",
      "402": "Payment Required",
      "403": "Forbidden",
      "404": "Not Found",
      "405": "Method Not Allowed",
      "406": "Not Acceptable",
      "407": "Proxy Authentication Required",
      "408": "Request Timeout",
      "409": "Conflict",
      "410": "Gone",
      "411": "Length Required",
      "412": "Precondition Failed",
      "413": "Payload Too Large",
      "414": "URI Too Long",
      "415": "Unsupported Media Type",
      "416": "Range Not Satisfiable",
      "417": "Expectation Failed",
      "418": "I'm a teapot",
      "421": "Misdirected Request",
      "422": "Unprocessable Entity",
      "423": "Locked",
      "424": "Failed Dependency",
      "425": "Too Early",
      "426": "Upgrade Required",
      "428": "Precondition Required",
      "429": "Too Many Requests",
      "431": "Request Header Fields Too Large",
      "451": "Unavailable For Legal Reasons",
      "500": "Internal Server Error",
      "501": "Not Implemented",
      "502": "Bad Gateway",
      "503": "Service Unavailable",
      "504": "Gateway Timeout",
      "505": "HTTP Version Not Supported",
      "506": "Variant Also Negotiates",
      "507": "Insufficient Storage",
      "508": "Loop Detected",
      "510": "Not Extended",
      "511": "Network Authentication Required"
    };
  }
});

// packages/playwright-core/src/server/cookieStore.ts
function parseRawCookie(header) {
  const pairs = header.split(";").filter((s) => s.trim().length > 0).map((p) => {
    let key = "";
    let value3 = "";
    const separatorPos = p.indexOf("=");
    if (separatorPos === -1) {
      key = p.trim();
    } else {
      key = p.slice(0, separatorPos).trim();
      value3 = p.slice(separatorPos + 1).trim();
    }
    return [key, value3];
  });
  if (!pairs.length)
    return null;
  const [name, value2] = pairs[0];
  const cookie = {
    name,
    value: value2
  };
  for (let i = 1; i < pairs.length; i++) {
    const [name2, value3] = pairs[i];
    switch (name2.toLowerCase()) {
      case "expires":
        const expiresMs = +new Date(value3);
        if (isFinite(expiresMs)) {
          if (expiresMs <= 0)
            cookie.expires = 0;
          else
            cookie.expires = Math.min(expiresMs / 1e3, kMaxCookieExpiresDateInSeconds);
        }
        break;
      case "max-age":
        const maxAgeSec = parseInt(value3, 10);
        if (isFinite(maxAgeSec)) {
          if (maxAgeSec <= 0)
            cookie.expires = 0;
          else
            cookie.expires = Math.min(Date.now() / 1e3 + maxAgeSec, kMaxCookieExpiresDateInSeconds);
        }
        break;
      case "domain":
        cookie.domain = value3.toLocaleLowerCase() || "";
        if (cookie.domain && !cookie.domain.startsWith(".") && cookie.domain.includes("."))
          cookie.domain = "." + cookie.domain;
        break;
      case "path":
        cookie.path = value3 || "";
        break;
      case "secure":
        cookie.secure = true;
        break;
      case "httponly":
        cookie.httpOnly = true;
        break;
      case "samesite":
        switch (value3.toLowerCase()) {
          case "none":
            cookie.sameSite = "None";
            break;
          case "lax":
            cookie.sameSite = "Lax";
            break;
          case "strict":
            cookie.sameSite = "Strict";
            break;
        }
        break;
    }
  }
  return cookie;
}
function domainMatches(value2, domain) {
  if (value2 === domain)
    return true;
  if (!domain.startsWith("."))
    return false;
  value2 = "." + value2;
  return value2.endsWith(domain);
}
function pathMatches(value2, path59) {
  if (value2 === path59)
    return true;
  if (!value2.endsWith("/"))
    value2 = value2 + "/";
  if (!path59.endsWith("/"))
    path59 = path59 + "/";
  return value2.startsWith(path59);
}
var Cookie, CookieStore;
var init_cookieStore = __esm({
  "packages/playwright-core/src/server/cookieStore.ts"() {
    "use strict";
    init_network2();
    Cookie = class {
      constructor(data) {
        this._raw = data;
      }
      _name() {
        return this._raw.name;
      }
      // https://datatracker.ietf.org/doc/html/rfc6265#section-5.4
      matches(url2) {
        if (this._raw.secure && (url2.protocol !== "https:" && !isLocalHostname(url2.hostname)))
          return false;
        if (!domainMatches(url2.hostname, this._raw.domain))
          return false;
        if (!pathMatches(url2.pathname, this._raw.path))
          return false;
        return true;
      }
      _equals(other) {
        return this._raw.name === other._raw.name && this._raw.domain === other._raw.domain && this._raw.path === other._raw.path;
      }
      _networkCookie() {
        return this._raw;
      }
      _updateExpiresFrom(other) {
        this._raw.expires = other._raw.expires;
      }
      _expired() {
        if (this._raw.expires === -1)
          return false;
        return this._raw.expires * 1e3 < Date.now();
      }
    };
    CookieStore = class _CookieStore {
      constructor() {
        this._nameToCookies = /* @__PURE__ */ new Map();
      }
      addCookies(cookies) {
        for (const cookie of cookies)
          this._addCookie(new Cookie(cookie));
      }
      cookies(url2) {
        const result2 = [];
        for (const cookie of this._cookiesIterator()) {
          if (cookie.matches(url2))
            result2.push(cookie._networkCookie());
        }
        return result2;
      }
      allCookies() {
        const result2 = [];
        for (const cookie of this._cookiesIterator())
          result2.push(cookie._networkCookie());
        return result2;
      }
      _addCookie(cookie) {
        let set = this._nameToCookies.get(cookie._name());
        if (!set) {
          set = /* @__PURE__ */ new Set();
          this._nameToCookies.set(cookie._name(), set);
        }
        for (const other of set) {
          if (other._equals(cookie))
            set.delete(other);
        }
        set.add(cookie);
        _CookieStore.pruneExpired(set);
      }
      *_cookiesIterator() {
        for (const [name, cookies] of this._nameToCookies) {
          _CookieStore.pruneExpired(cookies);
          for (const cookie of cookies)
            yield cookie;
          if (cookies.size === 0)
            this._nameToCookies.delete(name);
        }
      }
      static pruneExpired(cookies) {
        for (const cookie of cookies) {
          if (cookie._expired())
            cookies.delete(cookie);
        }
      }
    };
  }
});

// packages/playwright-core/src/server/formData.ts
function generateUniqueBoundaryString() {
  const charCodes = [];
  for (let i = 0; i < 16; i++)
    charCodes.push(alphaNumericEncodingMap[Math.floor(Math.random() * alphaNumericEncodingMap.length)]);
  return "----WebKitFormBoundary" + String.fromCharCode(...charCodes);
}
var mime2, MultipartFormData, alphaNumericEncodingMap;
var init_formData = __esm({
  "packages/playwright-core/src/server/formData.ts"() {
    "use strict";
    mime2 = require("./utilsBundle").mime;
    MultipartFormData = class {
      constructor() {
        this._chunks = [];
        this._boundary = generateUniqueBoundaryString();
      }
      contentTypeHeader() {
        return `multipart/form-data; boundary=${this._boundary}`;
      }
      addField(name, value2) {
        this._beginMultiPartHeader(name);
        this._finishMultiPartHeader();
        this._chunks.push(Buffer.from(value2));
        this._finishMultiPartField();
      }
      addFileField(name, value2) {
        this._beginMultiPartHeader(name);
        this._chunks.push(Buffer.from(`; filename="${value2.name}"`));
        this._chunks.push(Buffer.from(`\r
content-type: ${value2.mimeType || mime2.getType(value2.name) || "application/octet-stream"}`));
        this._finishMultiPartHeader();
        this._chunks.push(value2.buffer);
        this._finishMultiPartField();
      }
      finish() {
        this._addBoundary(true);
        return Buffer.concat(this._chunks);
      }
      _beginMultiPartHeader(name) {
        this._addBoundary();
        this._chunks.push(Buffer.from(`content-disposition: form-data; name="${name}"`));
      }
      _finishMultiPartHeader() {
        this._chunks.push(Buffer.from(`\r
\r
`));
      }
      _finishMultiPartField() {
        this._chunks.push(Buffer.from(`\r
`));
      }
      _addBoundary(isLastBoundary) {
        this._chunks.push(Buffer.from("--" + this._boundary));
        if (isLastBoundary)
          this._chunks.push(Buffer.from("--"));
        this._chunks.push(Buffer.from("\r\n"));
      }
    };
    alphaNumericEncodingMap = [
      65,
      66,
      67,
      68,
      69,
      70,
      71,
      72,
      73,
      74,
      75,
      76,
      77,
      78,
      79,
      80,
      81,
      82,
      83,
      84,
      85,
      86,
      87,
      88,
      89,
      90,
      97,
      98,
      99,
      100,
      101,
      102,
      103,
      104,
      105,
      106,
      107,
      108,
      109,
      110,
      111,
      112,
      113,
      114,
      115,
      116,
      117,
      118,
      119,
      120,
      121,
      122,
      48,
      49,
      50,
      51,
      52,
      53,
      54,
      55,
      56,
      57,
      65,
      66
    ];
  }
});

// packages/playwright-core/src/server/socksClientCertificatesInterceptor.ts
function loadDummyServerCertsIfNeeded() {
  if (dummyServerTlsOptions)
    return;
  const { cert, key } = generateSelfSignedCertificate();
  dummyServerTlsOptions = { key, cert };
}
function normalizeOrigin(origin) {
  try {
    return new URL(origin).origin;
  } catch (error) {
    return origin;
  }
}
function convertClientCertificatesToTLSOptions(clientCertificates) {
  if (!clientCertificates || !clientCertificates.length)
    return;
  const tlsOptions = {
    pfx: [],
    key: [],
    cert: []
  };
  for (const cert of clientCertificates) {
    if (cert.cert)
      tlsOptions.cert.push(cert.cert);
    if (cert.key)
      tlsOptions.key.push({ pem: cert.key, passphrase: cert.passphrase });
    if (cert.pfx)
      tlsOptions.pfx.push({ buf: cert.pfx, passphrase: cert.passphrase });
  }
  return tlsOptions;
}
function getMatchingTLSOptionsForOrigin(clientCertificates, origin) {
  const matchingCerts = clientCertificates?.filter(
    (c) => normalizeOrigin(c.origin) === origin
  );
  return convertClientCertificatesToTLSOptions(matchingCerts);
}
function rewriteToLocalhostIfNeeded(host) {
  return host === "local.playwright" ? "localhost" : host;
}
function rewriteOpenSSLErrorIfNeeded(error) {
  if (error.message !== "unsupported" && error.code !== "ERR_CRYPTO_UNSUPPORTED_OPERATION")
    return error;
  return rewriteErrorMessage(error, [
    "Unsupported TLS certificate.",
    "Most likely, the security algorithm of the given certificate was deprecated by OpenSSL.",
    "For more details, see https://github.com/openssl/openssl/blob/master/README-PROVIDERS.md#the-legacy-provider",
    "You could probably modernize the certificate by following the steps at https://github.com/nodejs/node/issues/40672#issuecomment-1243648223"
  ].join("\n"));
}
function parseALPNFromClientHello(buffer) {
  if (buffer.length < 6)
    return null;
  if (buffer[0] !== 22)
    return null;
  let offset = 5;
  if (buffer[offset] !== 1)
    return null;
  offset += 4;
  offset += 2;
  offset += 32;
  if (offset >= buffer.length)
    return null;
  const sessionIdLength = buffer[offset];
  offset += 1 + sessionIdLength;
  if (offset + 2 > buffer.length)
    return null;
  const cipherSuitesLength = buffer.readUInt16BE(offset);
  offset += 2 + cipherSuitesLength;
  if (offset >= buffer.length)
    return null;
  const compressionMethodsLength = buffer[offset];
  offset += 1 + compressionMethodsLength;
  if (offset + 2 > buffer.length)
    return null;
  const extensionsLength = buffer.readUInt16BE(offset);
  offset += 2;
  const extensionsEnd = offset + extensionsLength;
  if (extensionsEnd > buffer.length)
    return null;
  while (offset + 4 <= extensionsEnd) {
    const extensionType = buffer.readUInt16BE(offset);
    offset += 2;
    const extensionLength = buffer.readUInt16BE(offset);
    offset += 2;
    if (offset + extensionLength > extensionsEnd)
      return null;
    if (extensionType === 16)
      return parseALPNExtension(buffer.subarray(offset, offset + extensionLength));
    offset += extensionLength;
  }
  return null;
}
function parseALPNExtension(buffer) {
  if (buffer.length < 2)
    return null;
  const listLength = buffer.readUInt16BE(0);
  if (listLength !== buffer.length - 2)
    return null;
  const protocols = [];
  let offset = 2;
  while (offset < buffer.length) {
    const protocolLength = buffer[offset];
    offset += 1;
    if (offset + protocolLength > buffer.length)
      break;
    const protocol = buffer.subarray(offset, offset + protocolLength).toString("utf8");
    protocols.push(protocol);
    offset += protocolLength;
  }
  return protocols.length > 0 ? protocols : null;
}
var import_events4, import_http23, import_net3, import_stream3, import_tls2, getProxyForUrl2, dummyServerTlsOptions, SocksProxyConnection, ClientCertificatesProxy;
var init_socksClientCertificatesInterceptor = __esm({
  "packages/playwright-core/src/server/socksClientCertificatesInterceptor.ts"() {
    "use strict";
    import_events4 = require("events");
    import_http23 = __toESM(require("http2"));
    import_net3 = __toESM(require("net"));
    import_stream3 = __toESM(require("stream"));
    import_tls2 = __toESM(require("tls"));
    init_socksProxy();
    init_debugLogger();
    init_happyEyeballs();
    init_stringUtils();
    init_crypto();
    init_stackTrace();
    init_network();
    init_browserContext();
    ({ getProxyForUrl: getProxyForUrl2 } = require("./utilsBundle"));
    dummyServerTlsOptions = void 0;
    SocksProxyConnection = class {
      constructor(socksProxy, uid, host, port) {
        this._firstPackageReceived = false;
        this._closed = false;
        this.socksProxy = socksProxy;
        this.uid = uid;
        this.host = host;
        this.port = port;
        this._serverCloseEventListener = () => {
          this._browserEncrypted.destroy();
        };
        this._browserEncrypted = new import_stream3.default.Duplex({
          read: () => {
          },
          write: (data, encoding, callback) => {
            this.socksProxy._socksProxy.sendSocketData({ uid: this.uid, data });
            callback();
          },
          destroy: (error, callback) => {
            if (error)
              socksProxy._socksProxy.sendSocketError({ uid: this.uid, error: error.message });
            else
              socksProxy._socksProxy.sendSocketEnd({ uid: this.uid });
            callback();
          }
        });
      }
      async connect() {
        const proxyAgent = this.socksProxy._getProxyAgent(this.host, this.port);
        if (proxyAgent)
          this._serverEncrypted = await proxyAgent.connect(new import_events4.EventEmitter(), { host: rewriteToLocalhostIfNeeded(this.host), port: this.port, secureEndpoint: false });
        else
          this._serverEncrypted = await createSocket(rewriteToLocalhostIfNeeded(this.host), this.port);
        this._serverEncrypted.once("close", this._serverCloseEventListener);
        this._serverEncrypted.once("error", (error) => this._browserEncrypted.destroy(error));
        if (this._closed) {
          this._serverEncrypted.destroy();
          return;
        }
        this.socksProxy._socksProxy.socketConnected({
          uid: this.uid,
          host: this._serverEncrypted.localAddress,
          port: this._serverEncrypted.localPort
        });
      }
      onClose() {
        this._serverEncrypted.destroy();
        this._browserEncrypted.destroy();
        this._closed = true;
      }
      onData(data) {
        if (!this._firstPackageReceived) {
          this._firstPackageReceived = true;
          const secureContext = data[0] === 22 ? this.socksProxy.secureContextMap.get(normalizeOrigin(`https://${this.host}:${this.port}`)) : void 0;
          if (secureContext)
            this._establishTlsTunnel(this._browserEncrypted, data, secureContext);
          else
            this._establishPlaintextTunnel(this._browserEncrypted);
        }
        this._browserEncrypted.push(data);
      }
      _establishPlaintextTunnel(browserEncrypted) {
        browserEncrypted.pipe(this._serverEncrypted);
        this._serverEncrypted.pipe(browserEncrypted);
      }
      _establishTlsTunnel(browserEncrypted, clientHello, secureContext) {
        const browserALPNProtocols = parseALPNFromClientHello(clientHello) || ["http/1.1"];
        debugLogger.log("client-certificates", `Browser->Proxy ${this.host}:${this.port} offers ALPN ${browserALPNProtocols}`);
        const rejectUnauthorized = !this.socksProxy.ignoreHTTPSErrors;
        const serverDecrypted = import_tls2.default.connect({
          socket: this._serverEncrypted,
          host: this.host,
          port: this.port,
          rejectUnauthorized,
          ALPNProtocols: browserALPNProtocols,
          servername: !import_net3.default.isIP(this.host) ? this.host : void 0,
          secureContext
        }, async () => {
          const browserDecrypted = await this._upgradeToTLSIfNeeded(browserEncrypted, serverDecrypted.alpnProtocol);
          debugLogger.log("client-certificates", `Proxy->Server ${this.host}:${this.port} chooses ALPN ${browserDecrypted.alpnProtocol}`);
          browserDecrypted.pipe(serverDecrypted);
          serverDecrypted.pipe(browserDecrypted);
          const cleanup = (error) => this._serverEncrypted.destroy(error);
          browserDecrypted.once("error", cleanup);
          serverDecrypted.once("error", cleanup);
          browserDecrypted.once("close", cleanup);
          serverDecrypted.once("close", cleanup);
          if (this._closed)
            serverDecrypted.destroy();
        });
        serverDecrypted.once("error", async (error) => {
          debugLogger.log("client-certificates", `error when connecting to server: ${error.message.replaceAll("\n", " ")}`);
          this._serverEncrypted.removeListener("close", this._serverCloseEventListener);
          this._serverEncrypted.destroy();
          const browserDecrypted = await this._upgradeToTLSIfNeeded(this._browserEncrypted, serverDecrypted.alpnProtocol);
          const responseBody = escapeHTML("Playwright client-certificate error: " + error.message).replaceAll("\n", " <br>");
          if (browserDecrypted.alpnProtocol === "h2") {
            if ("performServerHandshake" in import_http23.default) {
              const session2 = import_http23.default.performServerHandshake(browserDecrypted);
              session2.on("error", (error2) => {
                this._browserEncrypted.destroy(error2);
              });
              session2.once("stream", (stream3) => {
                const cleanup = (error2) => {
                  session2.close();
                  this._browserEncrypted.destroy(error2);
                };
                stream3.once("end", cleanup);
                stream3.once("error", cleanup);
                stream3.respond({
                  [import_http23.default.constants.HTTP2_HEADER_CONTENT_TYPE]: "text/html",
                  [import_http23.default.constants.HTTP2_HEADER_STATUS]: 503
                });
                stream3.end(responseBody);
              });
            } else {
              this._browserEncrypted.destroy(error);
            }
          } else {
            browserDecrypted.end([
              "HTTP/1.1 503 Internal Server Error",
              "Content-Type: text/html; charset=utf-8",
              "Content-Length: " + Buffer.byteLength(responseBody),
              "",
              responseBody
            ].join("\r\n"));
          }
        });
      }
      async _upgradeToTLSIfNeeded(socket, alpnProtocol) {
        this._brorwserDecrypted ??= new Promise((resolve, reject) => {
          const dummyServer = import_tls2.default.createServer({
            ...dummyServerTlsOptions,
            ALPNProtocols: [alpnProtocol || "http/1.1"]
          });
          dummyServer.emit("connection", socket);
          dummyServer.once("secureConnection", (tlsSocket) => {
            dummyServer.close();
            resolve(tlsSocket);
          });
          dummyServer.once("error", (error) => {
            dummyServer.close();
            reject(error);
          });
        });
        return this._brorwserDecrypted;
      }
    };
    ClientCertificatesProxy = class _ClientCertificatesProxy {
      constructor(contextOptions) {
        this._connections = /* @__PURE__ */ new Map();
        this.secureContextMap = /* @__PURE__ */ new Map();
        verifyClientCertificates(contextOptions.clientCertificates);
        this.ignoreHTTPSErrors = contextOptions.ignoreHTTPSErrors;
        this._proxy = contextOptions.proxy;
        this._initSecureContexts(contextOptions.clientCertificates);
        this._socksProxy = new SocksProxy();
        this._socksProxy.setPattern("*");
        this._socksProxy.addListener(SocksProxy.Events.SocksRequested, async (payload) => {
          try {
            const connection = new SocksProxyConnection(this, payload.uid, payload.host, payload.port);
            await connection.connect();
            this._connections.set(payload.uid, connection);
          } catch (error) {
            debugLogger.log("client-certificates", `Failed to connect to ${payload.host}:${payload.port}: ${error.message}`);
            this._socksProxy.socketFailed({ uid: payload.uid, errorCode: error.code });
          }
        });
        this._socksProxy.addListener(SocksProxy.Events.SocksData, (payload) => {
          this._connections.get(payload.uid)?.onData(payload.data);
        });
        this._socksProxy.addListener(SocksProxy.Events.SocksClosed, (payload) => {
          this._connections.get(payload.uid)?.onClose();
          this._connections.delete(payload.uid);
        });
        loadDummyServerCertsIfNeeded();
      }
      _getProxyAgent(host, port) {
        const proxyFromOptions = createProxyAgent(this._proxy);
        if (proxyFromOptions)
          return proxyFromOptions;
        const proxyFromEnv = getProxyForUrl2(`https://${host}:${port}`);
        if (proxyFromEnv)
          return createProxyAgent({ server: proxyFromEnv });
      }
      _initSecureContexts(clientCertificates) {
        const origin2certs = /* @__PURE__ */ new Map();
        for (const cert of clientCertificates || []) {
          const origin = normalizeOrigin(cert.origin);
          const certs = origin2certs.get(origin) || [];
          certs.push(cert);
          origin2certs.set(origin, certs);
        }
        for (const [origin, certs] of origin2certs) {
          try {
            this.secureContextMap.set(origin, import_tls2.default.createSecureContext(convertClientCertificatesToTLSOptions(certs)));
          } catch (error) {
            error = rewriteOpenSSLErrorIfNeeded(error);
            throw rewriteErrorMessage(error, `Failed to load client certificate: ${error.message}`);
          }
        }
      }
      static async create(progress2, contextOptions) {
        const proxy = new _ClientCertificatesProxy(contextOptions);
        try {
          await progress2.race(proxy._socksProxy.listen(0, "127.0.0.1"));
          return proxy;
        } catch (error) {
          await progress2.race(proxy.close());
          throw error;
        }
      }
      proxySettings() {
        return { server: `socks5://127.0.0.1:${this._socksProxy.port()}` };
      }
      async close() {
        await this._socksProxy.close();
      }
    };
  }
});

// packages/playwright-core/src/server/trace/recorder/snapshotterInjected.ts
function frameSnapshotStreamer(snapshotStreamer, removeNoScript) {
  if (window[snapshotStreamer])
    return;
  const kShadowAttribute = "__playwright_shadow_root_";
  const kValueAttribute = "__playwright_value_";
  const kCheckedAttribute = "__playwright_checked_";
  const kSelectedAttribute = "__playwright_selected_";
  const kScrollTopAttribute = "__playwright_scroll_top_";
  const kScrollLeftAttribute = "__playwright_scroll_left_";
  const kStyleSheetAttribute = "__playwright_style_sheet_";
  const kTargetAttribute = "__playwright_target__";
  const kCustomElementsAttribute = "__playwright_custom_elements__";
  const kCurrentSrcAttribute = "__playwright_current_src__";
  const kBoundingRectAttribute = "__playwright_bounding_rect__";
  const kPopoverOpenAttribute = "__playwright_popover_open_";
  const kDialogOpenAttribute = "__playwright_dialog_open_";
  const kSnapshotFrameId = Symbol("__playwright_snapshot_frameid_");
  const kCachedData = Symbol("__playwright_snapshot_cache_");
  const kEndOfList = Symbol("__playwright_end_of_list_");
  function resetCachedData(obj) {
    delete obj[kCachedData];
  }
  function ensureCachedData(obj) {
    if (!obj[kCachedData])
      obj[kCachedData] = {};
    return obj[kCachedData];
  }
  const kObserverConfig = { attributes: true, subtree: true };
  function removeHash2(url2) {
    try {
      const u = new URL(url2);
      u.hash = "";
      return u.toString();
    } catch (e) {
      return url2;
    }
  }
  class Streamer {
    constructor() {
      this._lastSnapshotNumber = 0;
      this._staleStyleSheets = /* @__PURE__ */ new Set();
      this._modifiedStyleSheets = /* @__PURE__ */ new Set();
      this._readingStyleSheet = false;
      this._targetGeneration = 0;
      const invalidateCSSGroupingRule = (rule) => {
        if (rule.parentStyleSheet)
          this._invalidateStyleSheet(rule.parentStyleSheet);
      };
      this._interceptNativeMethod(window.CSSStyleSheet.prototype, "insertRule", (sheet) => this._invalidateStyleSheet(sheet));
      this._interceptNativeMethod(window.CSSStyleSheet.prototype, "deleteRule", (sheet) => this._invalidateStyleSheet(sheet));
      this._interceptNativeMethod(window.CSSStyleSheet.prototype, "addRule", (sheet) => this._invalidateStyleSheet(sheet));
      this._interceptNativeMethod(window.CSSStyleSheet.prototype, "removeRule", (sheet) => this._invalidateStyleSheet(sheet));
      this._interceptNativeGetter(window.CSSStyleSheet.prototype, "rules", (sheet) => this._invalidateStyleSheet(sheet));
      this._interceptNativeGetter(window.CSSStyleSheet.prototype, "cssRules", (sheet) => this._invalidateStyleSheet(sheet));
      this._interceptNativeMethod(window.CSSStyleSheet.prototype, "replaceSync", (sheet) => this._invalidateStyleSheet(sheet));
      this._interceptNativeMethod(window.CSSGroupingRule.prototype, "insertRule", invalidateCSSGroupingRule);
      this._interceptNativeMethod(window.CSSGroupingRule.prototype, "deleteRule", invalidateCSSGroupingRule);
      this._interceptNativeGetter(window.CSSGroupingRule.prototype, "cssRules", invalidateCSSGroupingRule);
      this._interceptNativeSetter(window.StyleSheet.prototype, "disabled", (sheet) => {
        if (sheet instanceof CSSStyleSheet)
          this._invalidateStyleSheet(sheet);
      });
      this._interceptNativeAsyncMethod(window.CSSStyleSheet.prototype, "replace", (sheet) => this._invalidateStyleSheet(sheet));
      this._fakeBase = document.createElement("base");
      this._observer = new MutationObserver((list) => this._handleMutations(list));
      this._ensureObservingCurrentDocument();
    }
    _refreshListenersWhenNeeded() {
      this._refreshListeners();
      const customEventName = "__playwright_snapshotter_global_listeners_check__";
      let seenEvent = false;
      const handleCustomEvent = () => seenEvent = true;
      window.addEventListener(customEventName, handleCustomEvent);
      const observer = new MutationObserver((entries) => {
        const newDocumentElement = entries.some((entry) => Array.from(entry.addedNodes).includes(document.documentElement));
        if (newDocumentElement) {
          seenEvent = false;
          window.dispatchEvent(new CustomEvent(customEventName));
          if (!seenEvent) {
            window.addEventListener(customEventName, handleCustomEvent);
            this._refreshListeners();
          }
        }
      });
      observer.observe(document, { childList: true });
    }
    _refreshListeners() {
      document.addEventListener("__playwright_mark_target__", (event) => {
        const target = event.composedPath()[0];
        if (target?.nodeType !== Node.ELEMENT_NODE)
          return;
        target.__playwright_target__ = this._targetGeneration;
      });
      document.addEventListener("__playwright_reset_targets__", () => {
        ++this._targetGeneration;
      });
    }
    _interceptNativeMethod(obj, method, cb) {
      const native = obj[method];
      if (!native)
        return;
      obj[method] = function(...args) {
        const result2 = native.call(this, ...args);
        cb(this, result2);
        return result2;
      };
    }
    _interceptNativeAsyncMethod(obj, method, cb) {
      const native = obj[method];
      if (!native)
        return;
      obj[method] = async function(...args) {
        const result2 = await native.call(this, ...args);
        cb(this, result2);
        return result2;
      };
    }
    _interceptNativeGetter(obj, prop, cb) {
      const descriptor = Object.getOwnPropertyDescriptor(obj, prop);
      Object.defineProperty(obj, prop, {
        ...descriptor,
        get: function() {
          const result2 = descriptor.get.call(this);
          cb(this, result2);
          return result2;
        }
      });
    }
    _interceptNativeSetter(obj, prop, cb) {
      const descriptor = Object.getOwnPropertyDescriptor(obj, prop);
      Object.defineProperty(obj, prop, {
        ...descriptor,
        set: function(value2) {
          const result2 = descriptor.set.call(this, value2);
          cb(this, value2);
          return result2;
        }
      });
    }
    _handleMutations(list) {
      for (const mutation of list)
        ensureCachedData(mutation.target).attributesCached = void 0;
    }
    _ensureObservingCurrentDocument() {
      if (this._observedDocument === document)
        return;
      this._observedDocument = document;
      this._observer.disconnect();
      this._observer.observe(document, kObserverConfig);
      this._refreshListenersWhenNeeded();
    }
    _invalidateStyleSheet(sheet) {
      if (this._readingStyleSheet)
        return;
      this._staleStyleSheets.add(sheet);
      if (sheet.href !== null)
        this._modifiedStyleSheets.add(sheet);
    }
    _updateStyleElementStyleSheetTextIfNeeded(sheet, forceText) {
      const data = ensureCachedData(sheet);
      if (this._staleStyleSheets.has(sheet) || forceText && data.cssText === void 0) {
        this._staleStyleSheets.delete(sheet);
        try {
          data.cssText = this._getSheetText(sheet);
        } catch (e) {
          data.cssText = "";
        }
      }
      return data.cssText;
    }
    // Returns either content, ref, or no override.
    _updateLinkStyleSheetTextIfNeeded(sheet, snapshotNumber) {
      const data = ensureCachedData(sheet);
      if (this._staleStyleSheets.has(sheet)) {
        this._staleStyleSheets.delete(sheet);
        try {
          data.cssText = this._getSheetText(sheet);
          data.cssRef = snapshotNumber;
          return data.cssText;
        } catch (e) {
        }
      }
      return data.cssRef === void 0 ? void 0 : snapshotNumber - data.cssRef;
    }
    markIframe(iframeElement, frameId) {
      iframeElement[kSnapshotFrameId] = frameId;
    }
    resetHistory() {
      this._staleStyleSheets.clear();
      const visitNode = (node) => {
        resetCachedData(node);
        if (node.nodeType === Node.ELEMENT_NODE) {
          const element2 = node;
          if (element2.shadowRoot)
            visitNode(element2.shadowRoot);
        }
        for (let child = node.firstChild; child; child = child.nextSibling)
          visitNode(child);
      };
      visitNode(document.documentElement);
      visitNode(this._fakeBase);
    }
    __sanitizeMetaAttribute(name, value2, httpEquiv) {
      if (name === "charset")
        return "utf-8";
      if (httpEquiv.toLowerCase() !== "content-type" || name !== "content")
        return value2;
      const [type3, ...params2] = value2.split(";");
      if (type3 !== "text/html" || params2.length <= 0)
        return value2;
      const charsetParamIdx = params2.findIndex((param) => param.trim().startsWith("charset="));
      if (charsetParamIdx > -1)
        params2[charsetParamIdx] = "charset=utf-8";
      return `${type3}; ${params2.join("; ")}`;
    }
    _sanitizeUrl(url2) {
      if (url2.startsWith("javascript:") || url2.startsWith("vbscript:"))
        return "";
      return url2;
    }
    _sanitizeSrcSet(srcset) {
      return srcset.split(",").map((src) => {
        src = src.trim();
        const spaceIndex = src.lastIndexOf(" ");
        if (spaceIndex === -1)
          return this._sanitizeUrl(src);
        return this._sanitizeUrl(src.substring(0, spaceIndex).trim()) + src.substring(spaceIndex);
      }).join(", ");
    }
    _resolveUrl(base, url2) {
      if (url2 === "")
        return "";
      try {
        return new URL(url2, base).href;
      } catch (e) {
        return url2;
      }
    }
    _getSheetBase(sheet) {
      let rootSheet = sheet;
      while (rootSheet.parentStyleSheet)
        rootSheet = rootSheet.parentStyleSheet;
      if (rootSheet.ownerNode)
        return rootSheet.ownerNode.baseURI;
      return document.baseURI;
    }
    _getSheetText(sheet) {
      this._readingStyleSheet = true;
      try {
        if (sheet.disabled)
          return "";
        const rules = [];
        for (const rule of sheet.cssRules)
          rules.push(rule.cssText);
        return rules.join("\n");
      } finally {
        this._readingStyleSheet = false;
      }
    }
    captureSnapshot(reset) {
      const timestamp = performance.now();
      const snapshotNumber = ++this._lastSnapshotNumber;
      if (reset === "history")
        this.resetHistory();
      if (reset)
        ++this._targetGeneration;
      let nodeCounter = 0;
      let shadowDomNesting = 0;
      let headNesting = 0;
      this._ensureObservingCurrentDocument();
      this._handleMutations(this._observer.takeRecords());
      const definedCustomElements = /* @__PURE__ */ new Set();
      const visitNode = (node) => {
        const nodeType = node.nodeType;
        const nodeName = nodeType === Node.DOCUMENT_FRAGMENT_NODE ? "template" : node.nodeName;
        if (nodeType !== Node.ELEMENT_NODE && nodeType !== Node.DOCUMENT_FRAGMENT_NODE && nodeType !== Node.TEXT_NODE)
          return;
        if (nodeName === "SCRIPT")
          return;
        if (nodeName === "LINK" && nodeType === Node.ELEMENT_NODE) {
          const rel = node.getAttribute("rel")?.toLowerCase();
          if (rel === "preload" || rel === "prefetch")
            return;
        }
        if (removeNoScript && nodeName === "NOSCRIPT")
          return;
        if (nodeName === "META") {
          const httpEquiv = node.httpEquiv.toLowerCase();
          if (httpEquiv === "content-security-policy" || httpEquiv === "refresh" || httpEquiv === "set-cookie")
            return;
        }
        if ((nodeName === "IFRAME" || nodeName === "FRAME") && headNesting)
          return;
        const data = ensureCachedData(node);
        const values = [];
        let equals = !!data.cached;
        let extraNodes = 0;
        const expectValue = (value2) => {
          equals = equals && data.cached[values.length] === value2;
          values.push(value2);
        };
        const checkAndReturn = (n) => {
          data.attributesCached = true;
          if (equals)
            return { equals: true, n: [[snapshotNumber - data.ref[0], data.ref[1]]] };
          nodeCounter += extraNodes;
          data.ref = [snapshotNumber, nodeCounter++];
          data.cached = values;
          return { equals: false, n };
        };
        if (nodeType === Node.TEXT_NODE) {
          const value2 = node.nodeValue || "";
          expectValue(value2);
          return checkAndReturn(value2);
        }
        if (nodeName === "STYLE") {
          const sheet = node.sheet;
          let cssText;
          if (sheet)
            cssText = this._updateStyleElementStyleSheetTextIfNeeded(sheet);
          cssText = cssText || node.textContent || "";
          expectValue(cssText);
          extraNodes++;
          return checkAndReturn([nodeName, {}, cssText]);
        }
        const attrs = {};
        const result3 = [nodeName, attrs];
        const visitChild = (child) => {
          const snapshot3 = visitNode(child);
          if (snapshot3) {
            result3.push(snapshot3.n);
            expectValue(child);
            equals = equals && snapshot3.equals;
          }
        };
        const visitChildStyleSheet = (child) => {
          const snapshot3 = visitStyleSheet(child);
          if (snapshot3) {
            result3.push(snapshot3.n);
            expectValue(child);
            equals = equals && snapshot3.equals;
          }
        };
        if (nodeType === Node.DOCUMENT_FRAGMENT_NODE)
          attrs[kShadowAttribute] = "open";
        if (nodeType === Node.ELEMENT_NODE) {
          const element2 = node;
          if (element2.localName.includes("-") && window.customElements?.get(element2.localName))
            definedCustomElements.add(element2.localName);
          if (nodeName === "INPUT" || nodeName === "TEXTAREA") {
            const value2 = element2.value;
            expectValue(kValueAttribute);
            expectValue(value2);
            attrs[kValueAttribute] = value2;
          }
          if (nodeName === "INPUT" && ["checkbox", "radio"].includes(element2.type)) {
            const value2 = element2.checked ? "true" : "false";
            expectValue(kCheckedAttribute);
            expectValue(value2);
            attrs[kCheckedAttribute] = value2;
          }
          if (nodeName === "OPTION") {
            const value2 = element2.selected ? "true" : "false";
            expectValue(kSelectedAttribute);
            expectValue(value2);
            attrs[kSelectedAttribute] = value2;
          }
          if (nodeName === "CANVAS" || nodeName === "IFRAME" || nodeName === "FRAME") {
            const boundingRect = element2.getBoundingClientRect();
            const value2 = JSON.stringify({
              left: boundingRect.left,
              top: boundingRect.top,
              right: boundingRect.right,
              bottom: boundingRect.bottom
            });
            expectValue(kBoundingRectAttribute);
            expectValue(value2);
            attrs[kBoundingRectAttribute] = value2;
          }
          if (element2.popover && element2.matches && element2.matches(":popover-open")) {
            const value2 = "true";
            expectValue(kPopoverOpenAttribute);
            expectValue(value2);
            attrs[kPopoverOpenAttribute] = value2;
          }
          if (nodeName === "DIALOG" && element2.open) {
            const value2 = element2.matches(":modal") ? "modal" : "true";
            expectValue(kDialogOpenAttribute);
            expectValue(value2);
            attrs[kDialogOpenAttribute] = value2;
          }
          if (element2.scrollTop) {
            expectValue(kScrollTopAttribute);
            expectValue(element2.scrollTop);
            attrs[kScrollTopAttribute] = "" + element2.scrollTop;
          }
          if (element2.scrollLeft) {
            expectValue(kScrollLeftAttribute);
            expectValue(element2.scrollLeft);
            attrs[kScrollLeftAttribute] = "" + element2.scrollLeft;
          }
          if (element2.shadowRoot) {
            ++shadowDomNesting;
            visitChild(element2.shadowRoot);
            --shadowDomNesting;
          }
          if (element2.__playwright_target__ === this._targetGeneration) {
            expectValue(kTargetAttribute);
            attrs[kTargetAttribute] = "";
          }
        }
        if (nodeName === "HEAD") {
          ++headNesting;
          this._fakeBase.setAttribute("href", document.baseURI);
          visitChild(this._fakeBase);
        }
        for (let child = node.firstChild; child; child = child.nextSibling)
          visitChild(child);
        if (nodeName === "HEAD")
          --headNesting;
        expectValue(kEndOfList);
        let documentOrShadowRoot = null;
        if (node.ownerDocument.documentElement === node)
          documentOrShadowRoot = node.ownerDocument;
        else if (node.nodeType === Node.DOCUMENT_FRAGMENT_NODE)
          documentOrShadowRoot = node;
        if (documentOrShadowRoot) {
          for (const sheet of documentOrShadowRoot.adoptedStyleSheets || [])
            visitChildStyleSheet(sheet);
          expectValue(kEndOfList);
        }
        if (nodeName === "IFRAME" || nodeName === "FRAME") {
          const element2 = node;
          const frameId = element2[kSnapshotFrameId];
          const name = "src";
          const value2 = frameId ? `/snapshot/${frameId}` : "";
          expectValue(name);
          expectValue(value2);
          attrs[name] = value2;
        }
        if (nodeName === "BODY" && definedCustomElements.size) {
          const value2 = [...definedCustomElements].join(",");
          expectValue(kCustomElementsAttribute);
          expectValue(value2);
          attrs[kCustomElementsAttribute] = value2;
        }
        if (nodeName === "IMG" || nodeName === "PICTURE") {
          const value2 = nodeName === "PICTURE" ? "" : this._sanitizeUrl(node.currentSrc);
          expectValue(kCurrentSrcAttribute);
          expectValue(value2);
          attrs[kCurrentSrcAttribute] = value2;
        }
        if (equals && data.attributesCached && !shadowDomNesting)
          return checkAndReturn(result3);
        if (nodeType === Node.ELEMENT_NODE) {
          const element2 = node;
          for (let i = 0; i < element2.attributes.length; i++) {
            const name = element2.attributes[i].name;
            if (nodeName === "LINK" && name === "integrity")
              continue;
            if (nodeName === "IFRAME" && (name === "src" || name === "srcdoc" || name === "sandbox"))
              continue;
            if (nodeName === "FRAME" && name === "src")
              continue;
            if (nodeName === "DIALOG" && name === "open")
              continue;
            let value2 = element2.attributes[i].value;
            if (nodeName === "META")
              value2 = this.__sanitizeMetaAttribute(name, value2, node.httpEquiv);
            else if (name === "src" && nodeName === "IMG")
              value2 = this._sanitizeUrl(value2);
            else if (name === "srcset" && nodeName === "IMG")
              value2 = this._sanitizeSrcSet(value2);
            else if (name === "srcset" && nodeName === "SOURCE")
              value2 = this._sanitizeSrcSet(value2);
            else if (name === "href" && nodeName === "LINK")
              value2 = this._sanitizeUrl(value2);
            else if (name.startsWith("on"))
              value2 = "";
            expectValue(name);
            expectValue(value2);
            attrs[name] = value2;
          }
          expectValue(kEndOfList);
        }
        if (result3.length === 2 && !Object.keys(attrs).length)
          result3.pop();
        return checkAndReturn(result3);
      };
      const visitStyleSheet = (sheet) => {
        const data = ensureCachedData(sheet);
        const oldCSSText = data.cssText;
        const cssText = this._updateStyleElementStyleSheetTextIfNeeded(
          sheet,
          true
          /* forceText */
        );
        if (cssText === oldCSSText)
          return { equals: true, n: [[snapshotNumber - data.ref[0], data.ref[1]]] };
        data.ref = [snapshotNumber, nodeCounter++];
        return {
          equals: false,
          n: ["template", {
            [kStyleSheetAttribute]: cssText
          }]
        };
      };
      let html;
      if (document.documentElement) {
        const { n } = visitNode(document.documentElement);
        html = n;
      } else {
        html = ["html"];
      }
      const result2 = {
        html,
        doctype: document.doctype ? document.doctype.name : void 0,
        resourceOverrides: [],
        viewport: {
          width: window.innerWidth,
          height: window.innerHeight
        },
        url: location.href,
        wallTime: Date.now(),
        collectionTime: 0
      };
      for (const sheet of this._modifiedStyleSheets) {
        if (sheet.href === null)
          continue;
        const content = this._updateLinkStyleSheetTextIfNeeded(sheet, snapshotNumber);
        if (content === void 0) {
          continue;
        }
        const base = this._getSheetBase(sheet);
        const url2 = removeHash2(this._resolveUrl(base, sheet.href));
        result2.resourceOverrides.push({ url: url2, content, contentType: "text/css" });
      }
      result2.collectionTime = performance.now() - timestamp;
      return result2;
    }
  }
  window[snapshotStreamer] = new Streamer();
}
var init_snapshotterInjected = __esm({
  "packages/playwright-core/src/server/trace/recorder/snapshotterInjected.ts"() {
    "use strict";
  }
});

// packages/playwright-core/src/server/trace/recorder/snapshotter.ts
var mime3, Snapshotter, kNeedsResetSymbol;
var init_snapshotter = __esm({
  "packages/playwright-core/src/server/trace/recorder/snapshotter.ts"() {
    "use strict";
    init_time();
    init_crypto();
    init_debugLogger();
    init_eventsHelper();
    init_snapshotterInjected();
    init_browserContext();
    init_progress();
    mime3 = require("./utilsBundle").mime;
    Snapshotter = class {
      constructor(context2, delegate) {
        this._eventListeners = [];
        this._started = false;
        this._context = context2;
        this._delegate = delegate;
        const guid = createGuid();
        this._snapshotStreamer = "__playwright_snapshot_streamer_" + guid;
      }
      started() {
        return this._started;
      }
      async start(progress2) {
        this._started = true;
        if (!this._initScript)
          await this._initialize(progress2);
        await progress2.race(this.reset());
      }
      async reset() {
        if (this._started)
          await this._context.safeNonStallingEvaluateInAllFrames(`window["${this._snapshotStreamer}"].resetHistory()`, "main");
      }
      stop() {
        this._started = false;
      }
      async resetForReuse() {
        if (this._initScript) {
          eventsHelper.removeEventListeners(this._eventListeners);
          await this._initScript.dispose();
          this._initScript = void 0;
        }
      }
      async _initialize(progress2) {
        for (const page of this._context.pages())
          this._onPage(page);
        this._eventListeners = [
          eventsHelper.addEventListener(this._context, BrowserContext.Events.Page, this._onPage.bind(this)),
          eventsHelper.addEventListener(this._context, BrowserContext.Events.FrameAttached, (frame) => this._annotateFrameHierarchy(frame))
        ];
        const { javaScriptEnabled } = this._context._options;
        const initScriptSource = `(${frameSnapshotStreamer})("${this._snapshotStreamer}", ${javaScriptEnabled || javaScriptEnabled === void 0})`;
        this._initScript = await this._context.addInitScript(progress2, initScriptSource);
        await progress2.race(this._context.safeNonStallingEvaluateInAllFrames(initScriptSource, "main"));
      }
      dispose() {
        eventsHelper.removeEventListeners(this._eventListeners);
      }
      async _captureFrameSnapshot(frame, resetTargets) {
        const needsHistoryReset = !!frame[kNeedsResetSymbol];
        frame[kNeedsResetSymbol] = false;
        const reset = needsHistoryReset ? "history" : resetTargets ? "targets" : void 0;
        const expression2 = `window["${this._snapshotStreamer}"].captureSnapshot(${JSON.stringify(reset)})`;
        try {
          return await frame.nonStallingRawEvaluateInExistingMainContext(expression2);
        } catch (e) {
          frame[kNeedsResetSymbol] = true;
          debugLogger.log("error", e);
        }
      }
      async captureSnapshot(page, callId, snapshotName, resetTargets) {
        const snapshots = page.frames().map(async (frame) => {
          const data = await this._captureFrameSnapshot(frame, resetTargets);
          if (!data || !this._started)
            return;
          const snapshot3 = {
            callId,
            snapshotName,
            pageId: page.guid,
            frameId: frame.guid,
            frameUrl: data.url,
            doctype: data.doctype,
            html: data.html,
            viewport: data.viewport,
            timestamp: monotonicTime(),
            wallTime: data.wallTime,
            collectionTime: data.collectionTime,
            resourceOverrides: [],
            isMainFrame: page.mainFrame() === frame
          };
          for (const { url: url2, content, contentType } of data.resourceOverrides) {
            if (typeof content === "string") {
              const buffer = Buffer.from(content);
              const sha1 = calculateSha1(buffer) + "." + (mime3.getExtension(contentType) || "dat");
              this._delegate.onSnapshotterBlob({ sha1, buffer });
              snapshot3.resourceOverrides.push({ url: url2, sha1 });
            } else {
              snapshot3.resourceOverrides.push({ url: url2, ref: content });
            }
          }
          this._delegate.onFrameSnapshot(snapshot3);
        });
        await Promise.all(snapshots);
      }
      _onPage(page) {
        for (const frame of page.frames())
          this._annotateFrameHierarchy(frame);
      }
      _annotateFrameHierarchy(frame) {
        (async () => {
          const frameElement = await frame.frameElement(nullProgress);
          const parent = frame.parentFrame();
          if (!parent)
            return;
          const context2 = await parent.mainContext();
          await context2?.evaluate(({ snapshotStreamer, frameElement: frameElement2, frameId }) => {
            window[snapshotStreamer].markIframe(frameElement2, frameId);
          }, { snapshotStreamer: this._snapshotStreamer, frameElement, frameId: frame.guid });
          frameElement.dispose();
        })().catch(() => {
        });
      }
    };
    kNeedsResetSymbol = Symbol("kNeedsReset");
  }
});

// packages/playwright-core/src/server/artifact.ts
var import_fs12, Artifact;
var init_artifact = __esm({
  "packages/playwright-core/src/server/artifact.ts"() {
    "use strict";
    import_fs12 = __toESM(require("fs"));
    init_manualPromise();
    init_assert();
    init_errors();
    init_instrumentation();
    Artifact = class extends SdkObject {
      constructor(parent, localPath, unaccessibleErrorMessage, cancelCallback) {
        super(parent, "artifact");
        this._finishedPromise = new ManualPromise();
        this._saveCallbacks = [];
        this._finished = false;
        this._deleted = false;
        this._localPath = localPath;
        this._unaccessibleErrorMessage = unaccessibleErrorMessage;
        this._cancelCallback = cancelCallback;
      }
      async localPathAfterFinished(progress2) {
        return await progress2.race(this._localPathAfterFinished());
      }
      async failureError(progress2) {
        return await progress2.race(this._failureError());
      }
      async cancel(progress2) {
        return await progress2.race(this._cancel());
      }
      async delete(progress2) {
        return await progress2.race(this._delete());
      }
      localPath() {
        return this._localPath;
      }
      async _localPathAfterFinished() {
        if (this._unaccessibleErrorMessage)
          throw new Error(this._unaccessibleErrorMessage);
        await this._finishedPromise;
        if (this._failureErrorValue)
          throw this._failureErrorValue;
        return this._localPath;
      }
      saveAs(progress2, saveCallback) {
        if (this._unaccessibleErrorMessage)
          throw new Error(this._unaccessibleErrorMessage);
        if (this._deleted)
          throw new Error(`File already deleted. Save before deleting.`);
        if (this._failureErrorValue)
          throw this._failureErrorValue;
        if (this._finished) {
          saveCallback(this._localPath).catch(() => {
          });
          return;
        }
        this._saveCallbacks.push(saveCallback);
      }
      async _failureError() {
        if (this._unaccessibleErrorMessage)
          return this._unaccessibleErrorMessage;
        await this._finishedPromise;
        return this._failureErrorValue?.message || null;
      }
      async _cancel() {
        assert(this._cancelCallback !== void 0);
        return this._cancelCallback();
      }
      async _delete() {
        if (this._unaccessibleErrorMessage)
          return;
        const fileName = await this._localPathAfterFinished();
        if (this._deleted)
          return;
        this._deleted = true;
        if (fileName)
          await import_fs12.default.promises.unlink(fileName).catch((e) => {
          });
      }
      async deleteOnContextClose() {
        if (this._deleted)
          return;
        this._deleted = true;
        if (!this._unaccessibleErrorMessage)
          await import_fs12.default.promises.unlink(this._localPath).catch((e) => {
          });
        await this.reportFinished(new TargetClosedError(this.closeReason()));
      }
      async reportFinished(error) {
        if (this._finished)
          return;
        this._finished = true;
        this._failureErrorValue = error;
        if (error) {
          for (const callback of this._saveCallbacks)
            await callback("", error);
        } else {
          for (const callback of this._saveCallbacks)
            await callback(this._localPath);
        }
        this._saveCallbacks = [];
        this._finishedPromise.resolve();
      }
    };
  }
});

// packages/playwright-core/src/protocol/validatorPrimitives.ts
function findValidator(type3, method, kind) {
  const validator = maybeFindValidator(type3, method, kind);
  if (!validator)
    throw new ValidationError(`Unknown scheme for ${kind}: ${type3}.${method}`);
  return validator;
}
function maybeFindValidator(type3, method, kind) {
  const schemeName = type3 + (kind === "Initializer" ? "" : method[0].toUpperCase() + method.substring(1)) + kind;
  return scheme[schemeName];
}
function createMetadataValidator() {
  return tOptional(scheme["Metadata"]);
}
function createWaitInfoValidator() {
  return scheme["WaitInfo"];
}
var ValidationError, scheme, tFloat, tInt, tBoolean, tString, tBinary, tAny, tOptional, tArray, tObject, tEnum, tChannel, tType;
var init_validatorPrimitives = __esm({
  "packages/playwright-core/src/protocol/validatorPrimitives.ts"() {
    "use strict";
    ValidationError = class extends Error {
    };
    scheme = {};
    tFloat = (arg, path59, context2) => {
      if (arg instanceof Number)
        return arg.valueOf();
      if (typeof arg === "number")
        return arg;
      throw new ValidationError(`${path59}: expected float, got ${typeof arg}`);
    };
    tInt = (arg, path59, context2) => {
      let value2;
      if (arg instanceof Number)
        value2 = arg.valueOf();
      else if (typeof arg === "number")
        value2 = arg;
      else
        throw new ValidationError(`${path59}: expected integer, got ${typeof arg}`);
      if (!Number.isInteger(value2))
        throw new ValidationError(`${path59}: expected integer, got float ${value2}`);
      return value2;
    };
    tBoolean = (arg, path59, context2) => {
      if (arg instanceof Boolean)
        return arg.valueOf();
      if (typeof arg === "boolean")
        return arg;
      throw new ValidationError(`${path59}: expected boolean, got ${typeof arg}`);
    };
    tString = (arg, path59, context2) => {
      if (arg instanceof String)
        return arg.valueOf();
      if (typeof arg === "string")
        return arg;
      throw new ValidationError(`${path59}: expected string, got ${typeof arg}`);
    };
    tBinary = (arg, path59, context2) => {
      if (context2.binary === "fromBase64") {
        if (arg instanceof String)
          return Buffer.from(arg.valueOf(), "base64");
        if (typeof arg === "string")
          return Buffer.from(arg, "base64");
        throw new ValidationError(`${path59}: expected base64-encoded buffer, got ${typeof arg}`);
      }
      if (context2.binary === "toBase64") {
        if (!(arg instanceof Buffer))
          throw new ValidationError(`${path59}: expected Buffer, got ${typeof arg}`);
        return arg.toString("base64");
      }
      if (context2.binary === "buffer") {
        if (!(arg instanceof Buffer) && !(arg instanceof Object))
          throw new ValidationError(`${path59}: expected Buffer, got ${typeof arg}`);
        return arg;
      }
      throw new ValidationError(`Unsupported binary behavior "${context2.binary}"`);
    };
    tAny = (arg, path59, context2) => {
      return arg;
    };
    tOptional = (v) => {
      return (arg, path59, context2) => {
        if (Object.is(arg, void 0))
          return arg;
        return v(arg, path59, context2);
      };
    };
    tArray = (v) => {
      return (arg, path59, context2) => {
        if (!Array.isArray(arg))
          throw new ValidationError(`${path59}: expected array, got ${typeof arg}`);
        return arg.map((x, index) => v(x, path59 + "[" + index + "]", context2));
      };
    };
    tObject = (s) => {
      return (arg, path59, context2) => {
        if (Object.is(arg, null))
          throw new ValidationError(`${path59}: expected object, got null`);
        if (typeof arg !== "object")
          throw new ValidationError(`${path59}: expected object, got ${typeof arg}`);
        const result2 = {};
        for (const [key, v] of Object.entries(s)) {
          const value2 = v(arg[key], path59 ? path59 + "." + key : key, context2);
          if (!Object.is(value2, void 0))
            result2[key] = value2;
        }
        if (context2.isUnderTest()) {
          for (const [key, value2] of Object.entries(arg)) {
            if (key.startsWith("__testHook"))
              result2[key] = value2;
          }
        }
        return result2;
      };
    };
    tEnum = (e) => {
      return (arg, path59, context2) => {
        if (!e.includes(arg))
          throw new ValidationError(`${path59}: expected one of (${e.join("|")})`);
        return arg;
      };
    };
    tChannel = (names) => {
      return (arg, path59, context2) => {
        return context2.tChannelImpl(names, arg, path59, context2);
      };
    };
    tType = (name) => {
      return (arg, path59, context2) => {
        const v = scheme[name];
        if (!v)
          throw new ValidationError(path59 + ': unknown type "' + name + '"');
        return v(arg, path59, context2);
      };
    };
  }
});

// packages/playwright-core/src/protocol/validator.ts
var init_validator = __esm({
  "packages/playwright-core/src/protocol/validator.ts"() {
    "use strict";
    init_validatorPrimitives();
    init_validatorPrimitives();
    scheme.AndroidInitializer = tOptional(tObject({}));
    scheme.AndroidDevicesParams = tObject({
      host: tOptional(tString),
      port: tOptional(tInt),
      omitDriverInstall: tOptional(tBoolean)
    });
    scheme.AndroidDevicesResult = tObject({
      devices: tArray(tChannel(["AndroidDevice"]))
    });
    scheme.AndroidSocketInitializer = tOptional(tObject({}));
    scheme.AndroidSocketDataEvent = tObject({
      data: tBinary
    });
    scheme.AndroidSocketCloseEvent = tOptional(tObject({}));
    scheme.AndroidSocketWriteParams = tObject({
      data: tBinary
    });
    scheme.AndroidSocketWriteResult = tOptional(tObject({}));
    scheme.AndroidSocketCloseParams = tOptional(tObject({}));
    scheme.AndroidSocketCloseResult = tOptional(tObject({}));
    scheme.AndroidDeviceInitializer = tObject({
      model: tString,
      serial: tString
    });
    scheme.AndroidDeviceCloseEvent = tOptional(tObject({}));
    scheme.AndroidDeviceWebViewAddedEvent = tObject({
      webView: tType("AndroidWebView")
    });
    scheme.AndroidDeviceWebViewRemovedEvent = tObject({
      socketName: tString
    });
    scheme.AndroidDeviceWaitParams = tObject({
      androidSelector: tType("AndroidSelector"),
      state: tOptional(tEnum(["gone"])),
      timeout: tFloat
    });
    scheme.AndroidDeviceWaitResult = tOptional(tObject({}));
    scheme.AndroidDeviceFillParams = tObject({
      androidSelector: tType("AndroidSelector"),
      text: tString,
      timeout: tFloat
    });
    scheme.AndroidDeviceFillResult = tOptional(tObject({}));
    scheme.AndroidDeviceTapParams = tObject({
      androidSelector: tType("AndroidSelector"),
      duration: tOptional(tFloat),
      timeout: tFloat
    });
    scheme.AndroidDeviceTapResult = tOptional(tObject({}));
    scheme.AndroidDeviceDragParams = tObject({
      androidSelector: tType("AndroidSelector"),
      dest: tType("Point"),
      speed: tOptional(tFloat),
      timeout: tFloat
    });
    scheme.AndroidDeviceDragResult = tOptional(tObject({}));
    scheme.AndroidDeviceFlingParams = tObject({
      androidSelector: tType("AndroidSelector"),
      direction: tEnum(["up", "down", "left", "right"]),
      speed: tOptional(tFloat),
      timeout: tFloat
    });
    scheme.AndroidDeviceFlingResult = tOptional(tObject({}));
    scheme.AndroidDeviceLongTapParams = tObject({
      androidSelector: tType("AndroidSelector"),
      timeout: tFloat
    });
    scheme.AndroidDeviceLongTapResult = tOptional(tObject({}));
    scheme.AndroidDevicePinchCloseParams = tObject({
      androidSelector: tType("AndroidSelector"),
      percent: tFloat,
      speed: tOptional(tFloat),
      timeout: tFloat
    });
    scheme.AndroidDevicePinchCloseResult = tOptional(tObject({}));
    scheme.AndroidDevicePinchOpenParams = tObject({
      androidSelector: tType("AndroidSelector"),
      percent: tFloat,
      speed: tOptional(tFloat),
      timeout: tFloat
    });
    scheme.AndroidDevicePinchOpenResult = tOptional(tObject({}));
    scheme.AndroidDeviceScrollParams = tObject({
      androidSelector: tType("AndroidSelector"),
      direction: tEnum(["up", "down", "left", "right"]),
      percent: tFloat,
      speed: tOptional(tFloat),
      timeout: tFloat
    });
    scheme.AndroidDeviceScrollResult = tOptional(tObject({}));
    scheme.AndroidDeviceSwipeParams = tObject({
      androidSelector: tType("AndroidSelector"),
      direction: tEnum(["up", "down", "left", "right"]),
      percent: tFloat,
      speed: tOptional(tFloat),
      timeout: tFloat
    });
    scheme.AndroidDeviceSwipeResult = tOptional(tObject({}));
    scheme.AndroidDeviceInfoParams = tObject({
      androidSelector: tType("AndroidSelector")
    });
    scheme.AndroidDeviceInfoResult = tObject({
      info: tType("AndroidElementInfo")
    });
    scheme.AndroidDeviceScreenshotParams = tOptional(tObject({}));
    scheme.AndroidDeviceScreenshotResult = tObject({
      binary: tBinary
    });
    scheme.AndroidDeviceInputTypeParams = tObject({
      text: tString
    });
    scheme.AndroidDeviceInputTypeResult = tOptional(tObject({}));
    scheme.AndroidDeviceInputPressParams = tObject({
      key: tString
    });
    scheme.AndroidDeviceInputPressResult = tOptional(tObject({}));
    scheme.AndroidDeviceInputTapParams = tObject({
      point: tType("Point")
    });
    scheme.AndroidDeviceInputTapResult = tOptional(tObject({}));
    scheme.AndroidDeviceInputSwipeParams = tObject({
      segments: tArray(tType("Point")),
      steps: tInt
    });
    scheme.AndroidDeviceInputSwipeResult = tOptional(tObject({}));
    scheme.AndroidDeviceInputDragParams = tObject({
      from: tType("Point"),
      to: tType("Point"),
      steps: tInt
    });
    scheme.AndroidDeviceInputDragResult = tOptional(tObject({}));
    scheme.AndroidDeviceLaunchBrowserParams = tObject({
      noDefaultViewport: tOptional(tBoolean),
      viewport: tOptional(tObject({
        width: tInt,
        height: tInt
      })),
      screen: tOptional(tObject({
        width: tInt,
        height: tInt
      })),
      ignoreHTTPSErrors: tOptional(tBoolean),
      clientCertificates: tOptional(tArray(tObject({
        origin: tString,
        cert: tOptional(tBinary),
        key: tOptional(tBinary),
        passphrase: tOptional(tString),
        pfx: tOptional(tBinary)
      }))),
      javaScriptEnabled: tOptional(tBoolean),
      bypassCSP: tOptional(tBoolean),
      userAgent: tOptional(tString),
      locale: tOptional(tString),
      timezoneId: tOptional(tString),
      geolocation: tOptional(tObject({
        longitude: tFloat,
        latitude: tFloat,
        accuracy: tOptional(tFloat)
      })),
      permissions: tOptional(tArray(tString)),
      extraHTTPHeaders: tOptional(tArray(tType("NameValue"))),
      offline: tOptional(tBoolean),
      httpCredentials: tOptional(tObject({
        username: tString,
        password: tString,
        origin: tOptional(tString),
        send: tOptional(tEnum(["always", "unauthorized"]))
      })),
      deviceScaleFactor: tOptional(tFloat),
      isMobile: tOptional(tBoolean),
      hasTouch: tOptional(tBoolean),
      colorScheme: tOptional(tEnum(["dark", "light", "no-preference", "no-override"])),
      reducedMotion: tOptional(tEnum(["reduce", "no-preference", "no-override"])),
      forcedColors: tOptional(tEnum(["active", "none", "no-override"])),
      acceptDownloads: tOptional(tEnum(["accept", "deny", "internal-browser-default"])),
      contrast: tOptional(tEnum(["no-preference", "more", "no-override"])),
      baseURL: tOptional(tString),
      recordVideo: tOptional(tObject({
        dir: tOptional(tString),
        size: tOptional(tObject({
          width: tInt,
          height: tInt
        })),
        showActions: tOptional(tObject({
          duration: tOptional(tFloat),
          position: tOptional(tEnum(["top-left", "top", "top-right", "bottom-left", "bottom", "bottom-right"])),
          fontSize: tOptional(tInt),
          cursor: tOptional(tEnum(["none", "pointer"]))
        }))
      })),
      strictSelectors: tOptional(tBoolean),
      serviceWorkers: tOptional(tEnum(["allow", "block"])),
      selectorEngines: tOptional(tArray(tType("SelectorEngine"))),
      testIdAttributeName: tOptional(tString),
      pkg: tOptional(tString),
      args: tOptional(tArray(tString)),
      proxy: tOptional(tObject({
        server: tString,
        bypass: tOptional(tString),
        username: tOptional(tString),
        password: tOptional(tString)
      }))
    });
    scheme.AndroidDeviceLaunchBrowserResult = tObject({
      context: tChannel(["BrowserContext"])
    });
    scheme.AndroidDeviceOpenParams = tObject({
      command: tString
    });
    scheme.AndroidDeviceOpenResult = tObject({
      socket: tChannel(["AndroidSocket"])
    });
    scheme.AndroidDeviceShellParams = tObject({
      command: tString
    });
    scheme.AndroidDeviceShellResult = tObject({
      result: tBinary
    });
    scheme.AndroidDeviceInstallApkParams = tObject({
      file: tBinary,
      args: tOptional(tArray(tString))
    });
    scheme.AndroidDeviceInstallApkResult = tOptional(tObject({}));
    scheme.AndroidDevicePushParams = tObject({
      file: tBinary,
      path: tString,
      mode: tOptional(tInt)
    });
    scheme.AndroidDevicePushResult = tOptional(tObject({}));
    scheme.AndroidDeviceConnectToWebViewParams = tObject({
      socketName: tString
    });
    scheme.AndroidDeviceConnectToWebViewResult = tObject({
      context: tChannel(["BrowserContext"])
    });
    scheme.AndroidDeviceCloseParams = tOptional(tObject({}));
    scheme.AndroidDeviceCloseResult = tOptional(tObject({}));
    scheme.AndroidWebView = tObject({
      pid: tInt,
      pkg: tString,
      socketName: tString
    });
    scheme.AndroidSelector = tObject({
      checkable: tOptional(tBoolean),
      checked: tOptional(tBoolean),
      clazz: tOptional(tString),
      clickable: tOptional(tBoolean),
      depth: tOptional(tInt),
      desc: tOptional(tString),
      enabled: tOptional(tBoolean),
      focusable: tOptional(tBoolean),
      focused: tOptional(tBoolean),
      hasChild: tOptional(tObject({
        androidSelector: tType("AndroidSelector")
      })),
      hasDescendant: tOptional(tObject({
        androidSelector: tType("AndroidSelector"),
        maxDepth: tOptional(tInt)
      })),
      longClickable: tOptional(tBoolean),
      pkg: tOptional(tString),
      res: tOptional(tString),
      scrollable: tOptional(tBoolean),
      selected: tOptional(tBoolean),
      text: tOptional(tString)
    });
    scheme.AndroidElementInfo = tObject({
      children: tOptional(tArray(tType("AndroidElementInfo"))),
      clazz: tString,
      desc: tString,
      res: tString,
      pkg: tString,
      text: tString,
      bounds: tType("Rect"),
      checkable: tBoolean,
      checked: tBoolean,
      clickable: tBoolean,
      enabled: tBoolean,
      focusable: tBoolean,
      focused: tBoolean,
      longClickable: tBoolean,
      scrollable: tBoolean,
      selected: tBoolean
    });
    scheme.APIRequestContextInitializer = tObject({
      tracing: tChannel(["Tracing"])
    });
    scheme.APIRequestContextFetchParams = tObject({
      url: tString,
      encodedParams: tOptional(tString),
      params: tOptional(tArray(tType("NameValue"))),
      method: tOptional(tString),
      headers: tOptional(tArray(tType("NameValue"))),
      postData: tOptional(tBinary),
      jsonData: tOptional(tString),
      formData: tOptional(tArray(tType("NameValue"))),
      multipartData: tOptional(tArray(tType("FormField"))),
      timeout: tFloat,
      failOnStatusCode: tOptional(tBoolean),
      ignoreHTTPSErrors: tOptional(tBoolean),
      maxRedirects: tOptional(tInt),
      maxRetries: tOptional(tInt)
    });
    scheme.APIRequestContextFetchResult = tObject({
      response: tType("APIResponse")
    });
    scheme.APIRequestContextFetchResponseBodyParams = tObject({
      fetchUid: tString
    });
    scheme.APIRequestContextFetchResponseBodyResult = tObject({
      binary: tOptional(tBinary)
    });
    scheme.APIRequestContextFetchLogParams = tObject({
      fetchUid: tString
    });
    scheme.APIRequestContextFetchLogResult = tObject({
      log: tArray(tString)
    });
    scheme.APIRequestContextStorageStateParams = tObject({
      indexedDB: tOptional(tBoolean)
    });
    scheme.APIRequestContextStorageStateResult = tObject({
      cookies: tArray(tType("NetworkCookie")),
      origins: tArray(tType("OriginStorage"))
    });
    scheme.APIRequestContextDisposeAPIResponseParams = tObject({
      fetchUid: tString
    });
    scheme.APIRequestContextDisposeAPIResponseResult = tOptional(tObject({}));
    scheme.APIRequestContextDisposeParams = tObject({
      reason: tOptional(tString)
    });
    scheme.APIRequestContextDisposeResult = tOptional(tObject({}));
    scheme.APIResponse = tObject({
      fetchUid: tString,
      url: tString,
      status: tInt,
      statusText: tString,
      headers: tArray(tType("NameValue")),
      securityDetails: tOptional(tType("SecurityDetails")),
      serverAddr: tOptional(tType("RemoteAddr"))
    });
    scheme.ArtifactInitializer = tObject({
      absolutePath: tString
    });
    scheme.ArtifactPathAfterFinishedParams = tOptional(tObject({}));
    scheme.ArtifactPathAfterFinishedResult = tObject({
      value: tString
    });
    scheme.ArtifactSaveAsParams = tObject({
      path: tString
    });
    scheme.ArtifactSaveAsResult = tOptional(tObject({}));
    scheme.ArtifactSaveAsStreamParams = tOptional(tObject({}));
    scheme.ArtifactSaveAsStreamResult = tObject({
      stream: tChannel(["Stream"])
    });
    scheme.ArtifactFailureParams = tOptional(tObject({}));
    scheme.ArtifactFailureResult = tObject({
      error: tOptional(tString)
    });
    scheme.ArtifactStreamParams = tOptional(tObject({}));
    scheme.ArtifactStreamResult = tObject({
      stream: tChannel(["Stream"])
    });
    scheme.ArtifactCancelParams = tOptional(tObject({}));
    scheme.ArtifactCancelResult = tOptional(tObject({}));
    scheme.ArtifactDeleteParams = tOptional(tObject({}));
    scheme.ArtifactDeleteResult = tOptional(tObject({}));
    scheme.StreamInitializer = tOptional(tObject({}));
    scheme.StreamReadParams = tObject({
      size: tOptional(tInt)
    });
    scheme.StreamReadResult = tObject({
      binary: tBinary
    });
    scheme.StreamCloseParams = tOptional(tObject({}));
    scheme.StreamCloseResult = tOptional(tObject({}));
    scheme.WritableStreamInitializer = tOptional(tObject({}));
    scheme.WritableStreamWriteParams = tObject({
      binary: tBinary
    });
    scheme.WritableStreamWriteResult = tOptional(tObject({}));
    scheme.WritableStreamCloseParams = tOptional(tObject({}));
    scheme.WritableStreamCloseResult = tOptional(tObject({}));
    scheme.BrowserInitializer = tObject({
      version: tString,
      name: tString,
      browserName: tEnum(["chromium", "firefox", "webkit"])
    });
    scheme.BrowserContextEvent = tObject({
      context: tChannel(["BrowserContext"])
    });
    scheme.BrowserCloseEvent = tOptional(tObject({}));
    scheme.BrowserStartServerParams = tObject({
      title: tString,
      workspaceDir: tOptional(tString),
      metadata: tOptional(tAny),
      host: tOptional(tString),
      port: tOptional(tInt)
    });
    scheme.BrowserStartServerResult = tObject({
      endpoint: tString
    });
    scheme.BrowserStopServerParams = tOptional(tObject({}));
    scheme.BrowserStopServerResult = tOptional(tObject({}));
    scheme.BrowserCloseParams = tObject({
      reason: tOptional(tString)
    });
    scheme.BrowserCloseResult = tOptional(tObject({}));
    scheme.BrowserKillForTestsParams = tOptional(tObject({}));
    scheme.BrowserKillForTestsResult = tOptional(tObject({}));
    scheme.BrowserDefaultUserAgentForTestParams = tOptional(tObject({}));
    scheme.BrowserDefaultUserAgentForTestResult = tObject({
      userAgent: tString
    });
    scheme.BrowserNewContextParams = tObject({
      noDefaultViewport: tOptional(tBoolean),
      viewport: tOptional(tObject({
        width: tInt,
        height: tInt
      })),
      screen: tOptional(tObject({
        width: tInt,
        height: tInt
      })),
      ignoreHTTPSErrors: tOptional(tBoolean),
      clientCertificates: tOptional(tArray(tObject({
        origin: tString,
        cert: tOptional(tBinary),
        key: tOptional(tBinary),
        passphrase: tOptional(tString),
        pfx: tOptional(tBinary)
      }))),
      javaScriptEnabled: tOptional(tBoolean),
      bypassCSP: tOptional(tBoolean),
      userAgent: tOptional(tString),
      locale: tOptional(tString),
      timezoneId: tOptional(tString),
      geolocation: tOptional(tObject({
        longitude: tFloat,
        latitude: tFloat,
        accuracy: tOptional(tFloat)
      })),
      permissions: tOptional(tArray(tString)),
      extraHTTPHeaders: tOptional(tArray(tType("NameValue"))),
      offline: tOptional(tBoolean),
      httpCredentials: tOptional(tObject({
        username: tString,
        password: tString,
        origin: tOptional(tString),
        send: tOptional(tEnum(["always", "unauthorized"]))
      })),
      deviceScaleFactor: tOptional(tFloat),
      isMobile: tOptional(tBoolean),
      hasTouch: tOptional(tBoolean),
      colorScheme: tOptional(tEnum(["dark", "light", "no-preference", "no-override"])),
      reducedMotion: tOptional(tEnum(["reduce", "no-preference", "no-override"])),
      forcedColors: tOptional(tEnum(["active", "none", "no-override"])),
      acceptDownloads: tOptional(tEnum(["accept", "deny", "internal-browser-default"])),
      contrast: tOptional(tEnum(["no-preference", "more", "no-override"])),
      baseURL: tOptional(tString),
      recordVideo: tOptional(tObject({
        dir: tOptional(tString),
        size: tOptional(tObject({
          width: tInt,
          height: tInt
        })),
        showActions: tOptional(tObject({
          duration: tOptional(tFloat),
          position: tOptional(tEnum(["top-left", "top", "top-right", "bottom-left", "bottom", "bottom-right"])),
          fontSize: tOptional(tInt),
          cursor: tOptional(tEnum(["none", "pointer"]))
        }))
      })),
      strictSelectors: tOptional(tBoolean),
      serviceWorkers: tOptional(tEnum(["allow", "block"])),
      selectorEngines: tOptional(tArray(tType("SelectorEngine"))),
      testIdAttributeName: tOptional(tString),
      proxy: tOptional(tObject({
        server: tString,
        bypass: tOptional(tString),
        username: tOptional(tString),
        password: tOptional(tString)
      })),
      storageState: tOptional(tObject({
        cookies: tOptional(tArray(tType("SetNetworkCookie"))),
        origins: tOptional(tArray(tType("SetOriginStorage")))
      }))
    });
    scheme.BrowserNewContextResult = tObject({
      context: tChannel(["BrowserContext"])
    });
    scheme.BrowserNewContextForReuseParams = tObject({
      noDefaultViewport: tOptional(tBoolean),
      viewport: tOptional(tObject({
        width: tInt,
        height: tInt
      })),
      screen: tOptional(tObject({
        width: tInt,
        height: tInt
      })),
      ignoreHTTPSErrors: tOptional(tBoolean),
      clientCertificates: tOptional(tArray(tObject({
        origin: tString,
        cert: tOptional(tBinary),
        key: tOptional(tBinary),
        passphrase: tOptional(tString),
        pfx: tOptional(tBinary)
      }))),
      javaScriptEnabled: tOptional(tBoolean),
      bypassCSP: tOptional(tBoolean),
      userAgent: tOptional(tString),
      locale: tOptional(tString),
      timezoneId: tOptional(tString),
      geolocation: tOptional(tObject({
        longitude: tFloat,
        latitude: tFloat,
        accuracy: tOptional(tFloat)
      })),
      permissions: tOptional(tArray(tString)),
      extraHTTPHeaders: tOptional(tArray(tType("NameValue"))),
      offline: tOptional(tBoolean),
      httpCredentials: tOptional(tObject({
        username: tString,
        password: tString,
        origin: tOptional(tString),
        send: tOptional(tEnum(["always", "unauthorized"]))
      })),
      deviceScaleFactor: tOptional(tFloat),
      isMobile: tOptional(tBoolean),
      hasTouch: tOptional(tBoolean),
      colorScheme: tOptional(tEnum(["dark", "light", "no-preference", "no-override"])),
      reducedMotion: tOptional(tEnum(["reduce", "no-preference", "no-override"])),
      forcedColors: tOptional(tEnum(["active", "none", "no-override"])),
      acceptDownloads: tOptional(tEnum(["accept", "deny", "internal-browser-default"])),
      contrast: tOptional(tEnum(["no-preference", "more", "no-override"])),
      baseURL: tOptional(tString),
      recordVideo: tOptional(tObject({
        dir: tOptional(tString),
        size: tOptional(tObject({
          width: tInt,
          height: tInt
        })),
        showActions: tOptional(tObject({
          duration: tOptional(tFloat),
          position: tOptional(tEnum(["top-left", "top", "top-right", "bottom-left", "bottom", "bottom-right"])),
          fontSize: tOptional(tInt),
          cursor: tOptional(tEnum(["none", "pointer"]))
        }))
      })),
      strictSelectors: tOptional(tBoolean),
      serviceWorkers: tOptional(tEnum(["allow", "block"])),
      selectorEngines: tOptional(tArray(tType("SelectorEngine"))),
      testIdAttributeName: tOptional(tString),
      proxy: tOptional(tObject({
        server: tString,
        bypass: tOptional(tString),
        username: tOptional(tString),
        password: tOptional(tString)
      })),
      storageState: tOptional(tObject({
        cookies: tOptional(tArray(tType("SetNetworkCookie"))),
        origins: tOptional(tArray(tType("SetOriginStorage")))
      }))
    });
    scheme.BrowserNewContextForReuseResult = tObject({
      context: tChannel(["BrowserContext"])
    });
    scheme.BrowserDisconnectFromReusedContextParams = tObject({
      reason: tString
    });
    scheme.BrowserDisconnectFromReusedContextResult = tOptional(tObject({}));
    scheme.BrowserNewBrowserCDPSessionParams = tOptional(tObject({}));
    scheme.BrowserNewBrowserCDPSessionResult = tObject({
      session: tChannel(["CDPSession"])
    });
    scheme.BrowserStartTracingParams = tObject({
      page: tOptional(tChannel(["Page"])),
      screenshots: tOptional(tBoolean),
      categories: tOptional(tArray(tString))
    });
    scheme.BrowserStartTracingResult = tOptional(tObject({}));
    scheme.BrowserStopTracingParams = tOptional(tObject({}));
    scheme.BrowserStopTracingResult = tObject({
      artifact: tChannel(["Artifact"])
    });
    scheme.BrowserContextInitializer = tObject({
      debugger: tChannel(["Debugger"]),
      requestContext: tChannel(["APIRequestContext"]),
      tracing: tChannel(["Tracing"]),
      options: tObject({
        noDefaultViewport: tOptional(tBoolean),
        viewport: tOptional(tObject({
          width: tInt,
          height: tInt
        })),
        screen: tOptional(tObject({
          width: tInt,
          height: tInt
        })),
        ignoreHTTPSErrors: tOptional(tBoolean),
        clientCertificates: tOptional(tArray(tObject({
          origin: tString,
          cert: tOptional(tBinary),
          key: tOptional(tBinary),
          passphrase: tOptional(tString),
          pfx: tOptional(tBinary)
        }))),
        javaScriptEnabled: tOptional(tBoolean),
        bypassCSP: tOptional(tBoolean),
        userAgent: tOptional(tString),
        locale: tOptional(tString),
        timezoneId: tOptional(tString),
        geolocation: tOptional(tObject({
          longitude: tFloat,
          latitude: tFloat,
          accuracy: tOptional(tFloat)
        })),
        permissions: tOptional(tArray(tString)),
        extraHTTPHeaders: tOptional(tArray(tType("NameValue"))),
        offline: tOptional(tBoolean),
        httpCredentials: tOptional(tObject({
          username: tString,
          password: tString,
          origin: tOptional(tString),
          send: tOptional(tEnum(["always", "unauthorized"]))
        })),
        deviceScaleFactor: tOptional(tFloat),
        isMobile: tOptional(tBoolean),
        hasTouch: tOptional(tBoolean),
        colorScheme: tOptional(tEnum(["dark", "light", "no-preference", "no-override"])),
        reducedMotion: tOptional(tEnum(["reduce", "no-preference", "no-override"])),
        forcedColors: tOptional(tEnum(["active", "none", "no-override"])),
        acceptDownloads: tOptional(tEnum(["accept", "deny", "internal-browser-default"])),
        contrast: tOptional(tEnum(["no-preference", "more", "no-override"])),
        baseURL: tOptional(tString),
        recordVideo: tOptional(tObject({
          dir: tOptional(tString),
          size: tOptional(tObject({
            width: tInt,
            height: tInt
          })),
          showActions: tOptional(tObject({
            duration: tOptional(tFloat),
            position: tOptional(tEnum(["top-left", "top", "top-right", "bottom-left", "bottom", "bottom-right"])),
            fontSize: tOptional(tInt),
            cursor: tOptional(tEnum(["none", "pointer"]))
          }))
        })),
        strictSelectors: tOptional(tBoolean),
        serviceWorkers: tOptional(tEnum(["allow", "block"])),
        selectorEngines: tOptional(tArray(tType("SelectorEngine"))),
        testIdAttributeName: tOptional(tString)
      })
    });
    scheme.BrowserContextBindingCallEvent = tObject({
      binding: tChannel(["BindingCall"])
    });
    scheme.BrowserContextConsoleEvent = tObject({
      type: tString,
      text: tString,
      args: tArray(tChannel(["ElementHandle", "JSHandle"])),
      location: tObject({
        url: tString,
        lineNumber: tInt,
        columnNumber: tInt
      }),
      timestamp: tFloat,
      page: tOptional(tChannel(["Page"])),
      worker: tOptional(tChannel(["Worker"]))
    });
    scheme.BrowserContextCloseEvent = tOptional(tObject({}));
    scheme.BrowserContextDialogEvent = tObject({
      dialog: tChannel(["Dialog"])
    });
    scheme.BrowserContextPageEvent = tObject({
      page: tChannel(["Page"])
    });
    scheme.BrowserContextPageErrorEvent = tObject({
      error: tType("SerializedError"),
      page: tChannel(["Page"]),
      location: tObject({
        url: tString,
        line: tInt,
        column: tInt
      })
    });
    scheme.BrowserContextRouteEvent = tObject({
      route: tChannel(["Route"])
    });
    scheme.BrowserContextWebSocketRouteEvent = tObject({
      webSocketRoute: tChannel(["WebSocketRoute"])
    });
    scheme.BrowserContextServiceWorkerEvent = tObject({
      worker: tChannel(["Worker"])
    });
    scheme.BrowserContextRequestEvent = tObject({
      request: tChannel(["Request"]),
      page: tOptional(tChannel(["Page"]))
    });
    scheme.BrowserContextRequestFailedEvent = tObject({
      request: tChannel(["Request"]),
      failureText: tOptional(tString),
      responseEndTiming: tFloat,
      page: tOptional(tChannel(["Page"]))
    });
    scheme.BrowserContextRequestFinishedEvent = tObject({
      request: tChannel(["Request"]),
      response: tOptional(tChannel(["Response"])),
      responseEndTiming: tFloat,
      page: tOptional(tChannel(["Page"]))
    });
    scheme.BrowserContextResponseEvent = tObject({
      response: tChannel(["Response"]),
      page: tOptional(tChannel(["Page"]))
    });
    scheme.BrowserContextRecorderEventEvent = tObject({
      event: tEnum(["actionAdded", "actionUpdated", "signalAdded"]),
      data: tAny,
      page: tChannel(["Page"]),
      code: tString
    });
    scheme.BrowserContextAddCookiesParams = tObject({
      cookies: tArray(tType("SetNetworkCookie"))
    });
    scheme.BrowserContextAddCookiesResult = tOptional(tObject({}));
    scheme.BrowserContextAddInitScriptParams = tObject({
      source: tString
    });
    scheme.BrowserContextAddInitScriptResult = tObject({
      disposable: tChannel(["Disposable"])
    });
    scheme.BrowserContextClearCookiesParams = tObject({
      name: tOptional(tString),
      nameRegexSource: tOptional(tString),
      nameRegexFlags: tOptional(tString),
      domain: tOptional(tString),
      domainRegexSource: tOptional(tString),
      domainRegexFlags: tOptional(tString),
      path: tOptional(tString),
      pathRegexSource: tOptional(tString),
      pathRegexFlags: tOptional(tString)
    });
    scheme.BrowserContextClearCookiesResult = tOptional(tObject({}));
    scheme.BrowserContextClearPermissionsParams = tOptional(tObject({}));
    scheme.BrowserContextClearPermissionsResult = tOptional(tObject({}));
    scheme.BrowserContextCloseParams = tObject({
      reason: tOptional(tString)
    });
    scheme.BrowserContextCloseResult = tOptional(tObject({}));
    scheme.BrowserContextCookiesParams = tObject({
      urls: tArray(tString)
    });
    scheme.BrowserContextCookiesResult = tObject({
      cookies: tArray(tType("NetworkCookie"))
    });
    scheme.BrowserContextExposeBindingParams = tObject({
      name: tString
    });
    scheme.BrowserContextExposeBindingResult = tObject({
      disposable: tChannel(["Disposable"])
    });
    scheme.BrowserContextGrantPermissionsParams = tObject({
      permissions: tArray(tString),
      origin: tOptional(tString)
    });
    scheme.BrowserContextGrantPermissionsResult = tOptional(tObject({}));
    scheme.BrowserContextNewPageParams = tOptional(tObject({}));
    scheme.BrowserContextNewPageResult = tObject({
      page: tChannel(["Page"])
    });
    scheme.BrowserContextRegisterSelectorEngineParams = tObject({
      selectorEngine: tType("SelectorEngine")
    });
    scheme.BrowserContextRegisterSelectorEngineResult = tOptional(tObject({}));
    scheme.BrowserContextSetTestIdAttributeNameParams = tObject({
      testIdAttributeName: tString
    });
    scheme.BrowserContextSetTestIdAttributeNameResult = tOptional(tObject({}));
    scheme.BrowserContextSetExtraHTTPHeadersParams = tObject({
      headers: tArray(tType("NameValue"))
    });
    scheme.BrowserContextSetExtraHTTPHeadersResult = tOptional(tObject({}));
    scheme.BrowserContextSetGeolocationParams = tObject({
      geolocation: tOptional(tObject({
        longitude: tFloat,
        latitude: tFloat,
        accuracy: tOptional(tFloat)
      }))
    });
    scheme.BrowserContextSetGeolocationResult = tOptional(tObject({}));
    scheme.BrowserContextSetHTTPCredentialsParams = tObject({
      httpCredentials: tOptional(tObject({
        username: tString,
        password: tString,
        origin: tOptional(tString)
      }))
    });
    scheme.BrowserContextSetHTTPCredentialsResult = tOptional(tObject({}));
    scheme.BrowserContextSetNetworkInterceptionPatternsParams = tObject({
      patterns: tArray(tObject({
        glob: tOptional(tString),
        regexSource: tOptional(tString),
        regexFlags: tOptional(tString),
        urlPattern: tOptional(tType("URLPattern"))
      }))
    });
    scheme.BrowserContextSetNetworkInterceptionPatternsResult = tOptional(tObject({}));
    scheme.BrowserContextSetWebSocketInterceptionPatternsParams = tObject({
      patterns: tArray(tObject({
        glob: tOptional(tString),
        regexSource: tOptional(tString),
        regexFlags: tOptional(tString),
        urlPattern: tOptional(tType("URLPattern"))
      }))
    });
    scheme.BrowserContextSetWebSocketInterceptionPatternsResult = tOptional(tObject({}));
    scheme.BrowserContextSetOfflineParams = tObject({
      offline: tBoolean
    });
    scheme.BrowserContextSetOfflineResult = tOptional(tObject({}));
    scheme.BrowserContextStorageStateParams = tObject({
      indexedDB: tOptional(tBoolean)
    });
    scheme.BrowserContextStorageStateResult = tObject({
      cookies: tArray(tType("NetworkCookie")),
      origins: tArray(tType("OriginStorage"))
    });
    scheme.BrowserContextSetStorageStateParams = tObject({
      storageState: tOptional(tObject({
        cookies: tOptional(tArray(tType("SetNetworkCookie"))),
        origins: tOptional(tArray(tType("SetOriginStorage")))
      }))
    });
    scheme.BrowserContextSetStorageStateResult = tOptional(tObject({}));
    scheme.BrowserContextPauseParams = tOptional(tObject({}));
    scheme.BrowserContextPauseResult = tOptional(tObject({}));
    scheme.BrowserContextEnableRecorderParams = tObject({
      language: tOptional(tString),
      mode: tOptional(tEnum(["inspecting", "recording"])),
      recorderMode: tOptional(tEnum(["default", "api"])),
      pauseOnNextStatement: tOptional(tBoolean),
      testIdAttributeName: tOptional(tString),
      launchOptions: tOptional(tAny),
      contextOptions: tOptional(tAny),
      device: tOptional(tString),
      saveStorage: tOptional(tString),
      outputFile: tOptional(tString),
      handleSIGINT: tOptional(tBoolean),
      omitCallTracking: tOptional(tBoolean)
    });
    scheme.BrowserContextEnableRecorderResult = tOptional(tObject({}));
    scheme.BrowserContextDisableRecorderParams = tOptional(tObject({}));
    scheme.BrowserContextDisableRecorderResult = tOptional(tObject({}));
    scheme.BrowserContextExposeConsoleApiParams = tOptional(tObject({}));
    scheme.BrowserContextExposeConsoleApiResult = tOptional(tObject({}));
    scheme.BrowserContextNewCDPSessionParams = tObject({
      page: tOptional(tChannel(["Page"])),
      frame: tOptional(tChannel(["Frame"]))
    });
    scheme.BrowserContextNewCDPSessionResult = tObject({
      session: tChannel(["CDPSession"])
    });
    scheme.BrowserContextCreateTempFilesParams = tObject({
      rootDirName: tOptional(tString),
      items: tArray(tObject({
        name: tString,
        lastModifiedMs: tOptional(tFloat)
      }))
    });
    scheme.BrowserContextCreateTempFilesResult = tObject({
      rootDir: tOptional(tChannel(["WritableStream"])),
      writableStreams: tArray(tChannel(["WritableStream"]))
    });
    scheme.BrowserContextUpdateSubscriptionParams = tObject({
      event: tEnum(["console", "dialog", "request", "response", "requestFinished", "requestFailed"]),
      enabled: tBoolean
    });
    scheme.BrowserContextUpdateSubscriptionResult = tOptional(tObject({}));
    scheme.BrowserContextClockFastForwardParams = tObject({
      ticksNumber: tOptional(tFloat),
      ticksString: tOptional(tString)
    });
    scheme.BrowserContextClockFastForwardResult = tOptional(tObject({}));
    scheme.BrowserContextClockInstallParams = tObject({
      timeNumber: tOptional(tFloat),
      timeString: tOptional(tString)
    });
    scheme.BrowserContextClockInstallResult = tOptional(tObject({}));
    scheme.BrowserContextClockPauseAtParams = tObject({
      timeNumber: tOptional(tFloat),
      timeString: tOptional(tString)
    });
    scheme.BrowserContextClockPauseAtResult = tOptional(tObject({}));
    scheme.BrowserContextClockResumeParams = tOptional(tObject({}));
    scheme.BrowserContextClockResumeResult = tOptional(tObject({}));
    scheme.BrowserContextClockRunForParams = tObject({
      ticksNumber: tOptional(tFloat),
      ticksString: tOptional(tString)
    });
    scheme.BrowserContextClockRunForResult = tOptional(tObject({}));
    scheme.BrowserContextClockSetFixedTimeParams = tObject({
      timeNumber: tOptional(tFloat),
      timeString: tOptional(tString)
    });
    scheme.BrowserContextClockSetFixedTimeResult = tOptional(tObject({}));
    scheme.BrowserContextClockSetSystemTimeParams = tObject({
      timeNumber: tOptional(tFloat),
      timeString: tOptional(tString)
    });
    scheme.BrowserContextClockSetSystemTimeResult = tOptional(tObject({}));
    scheme.BrowserContextCredentialsInstallParams = tOptional(tObject({}));
    scheme.BrowserContextCredentialsInstallResult = tOptional(tObject({}));
    scheme.BrowserContextCredentialsCreateParams = tObject({
      rpId: tString,
      id: tOptional(tString),
      userHandle: tOptional(tString),
      privateKey: tOptional(tString),
      publicKey: tOptional(tString)
    });
    scheme.BrowserContextCredentialsCreateResult = tObject({
      credential: tType("VirtualCredential")
    });
    scheme.BrowserContextCredentialsGetParams = tObject({
      rpId: tOptional(tString),
      id: tOptional(tString)
    });
    scheme.BrowserContextCredentialsGetResult = tObject({
      credentials: tArray(tType("VirtualCredential"))
    });
    scheme.BrowserContextCredentialsDeleteParams = tObject({
      id: tString
    });
    scheme.BrowserContextCredentialsDeleteResult = tOptional(tObject({}));
    scheme.BrowserTypeInitializer = tObject({
      executablePath: tString,
      name: tString
    });
    scheme.BrowserTypeLaunchParams = tObject({
      channel: tOptional(tString),
      executablePath: tOptional(tString),
      args: tOptional(tArray(tString)),
      ignoreAllDefaultArgs: tOptional(tBoolean),
      ignoreDefaultArgs: tOptional(tArray(tString)),
      handleSIGINT: tOptional(tBoolean),
      handleSIGTERM: tOptional(tBoolean),
      handleSIGHUP: tOptional(tBoolean),
      timeout: tFloat,
      env: tOptional(tArray(tType("NameValue"))),
      headless: tOptional(tBoolean),
      proxy: tOptional(tObject({
        server: tString,
        bypass: tOptional(tString),
        username: tOptional(tString),
        password: tOptional(tString)
      })),
      downloadsPath: tOptional(tString),
      tracesDir: tOptional(tString),
      artifactsDir: tOptional(tString),
      chromiumSandbox: tOptional(tBoolean),
      firefoxUserPrefs: tOptional(tAny),
      cdpPort: tOptional(tInt),
      slowMo: tOptional(tFloat)
    });
    scheme.BrowserTypeLaunchResult = tObject({
      browser: tChannel(["Browser"])
    });
    scheme.BrowserTypeLaunchPersistentContextParams = tObject({
      channel: tOptional(tString),
      executablePath: tOptional(tString),
      args: tOptional(tArray(tString)),
      ignoreAllDefaultArgs: tOptional(tBoolean),
      ignoreDefaultArgs: tOptional(tArray(tString)),
      handleSIGINT: tOptional(tBoolean),
      handleSIGTERM: tOptional(tBoolean),
      handleSIGHUP: tOptional(tBoolean),
      timeout: tFloat,
      env: tOptional(tArray(tType("NameValue"))),
      headless: tOptional(tBoolean),
      proxy: tOptional(tObject({
        server: tString,
        bypass: tOptional(tString),
        username: tOptional(tString),
        password: tOptional(tString)
      })),
      downloadsPath: tOptional(tString),
      tracesDir: tOptional(tString),
      artifactsDir: tOptional(tString),
      chromiumSandbox: tOptional(tBoolean),
      firefoxUserPrefs: tOptional(tAny),
      cdpPort: tOptional(tInt),
      noDefaultViewport: tOptional(tBoolean),
      viewport: tOptional(tObject({
        width: tInt,
        height: tInt
      })),
      screen: tOptional(tObject({
        width: tInt,
        height: tInt
      })),
      ignoreHTTPSErrors: tOptional(tBoolean),
      clientCertificates: tOptional(tArray(tObject({
        origin: tString,
        cert: tOptional(tBinary),
        key: tOptional(tBinary),
        passphrase: tOptional(tString),
        pfx: tOptional(tBinary)
      }))),
      javaScriptEnabled: tOptional(tBoolean),
      bypassCSP: tOptional(tBoolean),
      userAgent: tOptional(tString),
      locale: tOptional(tString),
      timezoneId: tOptional(tString),
      geolocation: tOptional(tObject({
        longitude: tFloat,
        latitude: tFloat,
        accuracy: tOptional(tFloat)
      })),
      permissions: tOptional(tArray(tString)),
      extraHTTPHeaders: tOptional(tArray(tType("NameValue"))),
      offline: tOptional(tBoolean),
      httpCredentials: tOptional(tObject({
        username: tString,
        password: tString,
        origin: tOptional(tString),
        send: tOptional(tEnum(["always", "unauthorized"]))
      })),
      deviceScaleFactor: tOptional(tFloat),
      isMobile: tOptional(tBoolean),
      hasTouch: tOptional(tBoolean),
      colorScheme: tOptional(tEnum(["dark", "light", "no-preference", "no-override"])),
      reducedMotion: tOptional(tEnum(["reduce", "no-preference", "no-override"])),
      forcedColors: tOptional(tEnum(["active", "none", "no-override"])),
      acceptDownloads: tOptional(tEnum(["accept", "deny", "internal-browser-default"])),
      contrast: tOptional(tEnum(["no-preference", "more", "no-override"])),
      baseURL: tOptional(tString),
      recordVideo: tOptional(tObject({
        dir: tOptional(tString),
        size: tOptional(tObject({
          width: tInt,
          height: tInt
        })),
        showActions: tOptional(tObject({
          duration: tOptional(tFloat),
          position: tOptional(tEnum(["top-left", "top", "top-right", "bottom-left", "bottom", "bottom-right"])),
          fontSize: tOptional(tInt),
          cursor: tOptional(tEnum(["none", "pointer"]))
        }))
      })),
      strictSelectors: tOptional(tBoolean),
      serviceWorkers: tOptional(tEnum(["allow", "block"])),
      selectorEngines: tOptional(tArray(tType("SelectorEngine"))),
      testIdAttributeName: tOptional(tString),
      userDataDir: tString,
      slowMo: tOptional(tFloat)
    });
    scheme.BrowserTypeLaunchPersistentContextResult = tObject({
      browser: tChannel(["Browser"]),
      context: tChannel(["BrowserContext"])
    });
    scheme.BrowserTypeConnectOverCDPParams = tObject({
      endpointURL: tOptional(tString),
      headers: tOptional(tArray(tType("NameValue"))),
      slowMo: tOptional(tFloat),
      timeout: tFloat,
      isLocal: tOptional(tBoolean),
      noDefaults: tOptional(tBoolean),
      artifactsDir: tOptional(tString),
      transport: tOptional(tBinary)
    });
    scheme.BrowserTypeConnectOverCDPResult = tObject({
      browser: tChannel(["Browser"]),
      defaultContext: tOptional(tChannel(["BrowserContext"]))
    });
    scheme.BrowserTypeConnectToWorkerParams = tObject({
      endpoint: tString,
      timeout: tFloat
    });
    scheme.BrowserTypeConnectToWorkerResult = tObject({
      worker: tChannel(["Worker"])
    });
    scheme.Metadata = tObject({
      location: tOptional(tObject({
        file: tString,
        line: tOptional(tInt),
        column: tOptional(tInt)
      })),
      title: tOptional(tString),
      internal: tOptional(tBoolean),
      stepId: tOptional(tString)
    });
    scheme.ClientSideCallMetadata = tObject({
      id: tInt,
      stack: tOptional(tArray(tType("StackFrame")))
    });
    scheme.SDKLanguage = tEnum(["javascript", "python", "java", "csharp"]);
    scheme.DisposableInitializer = tOptional(tObject({}));
    scheme.DisposableDisposeParams = tOptional(tObject({}));
    scheme.DisposableDisposeResult = tOptional(tObject({}));
    scheme.WaitInfo = tObject({
      waitId: tString,
      phase: tEnum(["before", "after", "log"]),
      event: tOptional(tString),
      message: tOptional(tString),
      error: tOptional(tString)
    });
    scheme.ElectronInitializer = tOptional(tObject({}));
    scheme.ElectronLaunchParams = tObject({
      executablePath: tOptional(tString),
      args: tOptional(tArray(tString)),
      chromiumSandbox: tOptional(tBoolean),
      cwd: tOptional(tString),
      env: tOptional(tArray(tType("NameValue"))),
      timeout: tFloat,
      acceptDownloads: tOptional(tEnum(["accept", "deny", "internal-browser-default"])),
      bypassCSP: tOptional(tBoolean),
      colorScheme: tOptional(tEnum(["dark", "light", "no-preference", "no-override"])),
      extraHTTPHeaders: tOptional(tArray(tType("NameValue"))),
      geolocation: tOptional(tObject({
        longitude: tFloat,
        latitude: tFloat,
        accuracy: tOptional(tFloat)
      })),
      httpCredentials: tOptional(tObject({
        username: tString,
        password: tString,
        origin: tOptional(tString)
      })),
      ignoreHTTPSErrors: tOptional(tBoolean),
      locale: tOptional(tString),
      offline: tOptional(tBoolean),
      recordVideo: tOptional(tObject({
        dir: tOptional(tString),
        size: tOptional(tObject({
          width: tInt,
          height: tInt
        })),
        showActions: tOptional(tObject({
          duration: tOptional(tFloat),
          position: tOptional(tEnum(["top-left", "top", "top-right", "bottom-left", "bottom", "bottom-right"])),
          fontSize: tOptional(tInt),
          cursor: tOptional(tEnum(["none", "pointer"]))
        }))
      })),
      strictSelectors: tOptional(tBoolean),
      timezoneId: tOptional(tString),
      tracesDir: tOptional(tString),
      artifactsDir: tOptional(tString),
      selectorEngines: tOptional(tArray(tType("SelectorEngine"))),
      testIdAttributeName: tOptional(tString)
    });
    scheme.ElectronLaunchResult = tObject({
      electronApplication: tChannel(["ElectronApplication"])
    });
    scheme.ElectronApplicationInitializer = tObject({
      context: tChannel(["BrowserContext"])
    });
    scheme.ElectronApplicationCloseEvent = tOptional(tObject({}));
    scheme.ElectronApplicationConsoleEvent = tObject({
      type: tString,
      text: tString,
      args: tArray(tChannel(["ElementHandle", "JSHandle"])),
      location: tObject({
        url: tString,
        lineNumber: tInt,
        columnNumber: tInt
      }),
      timestamp: tFloat
    });
    scheme.ElectronApplicationBrowserWindowParams = tObject({
      page: tChannel(["Page"])
    });
    scheme.ElectronApplicationBrowserWindowResult = tObject({
      handle: tChannel(["ElementHandle", "JSHandle"])
    });
    scheme.ElectronApplicationEvaluateExpressionParams = tObject({
      expression: tString,
      isFunction: tOptional(tBoolean),
      arg: tType("SerializedArgument")
    });
    scheme.ElectronApplicationEvaluateExpressionResult = tObject({
      value: tType("SerializedValue")
    });
    scheme.ElectronApplicationEvaluateExpressionHandleParams = tObject({
      expression: tString,
      isFunction: tOptional(tBoolean),
      arg: tType("SerializedArgument")
    });
    scheme.ElectronApplicationEvaluateExpressionHandleResult = tObject({
      handle: tChannel(["ElementHandle", "JSHandle"])
    });
    scheme.ElectronApplicationUpdateSubscriptionParams = tObject({
      event: tEnum(["console"]),
      enabled: tBoolean
    });
    scheme.ElectronApplicationUpdateSubscriptionResult = tOptional(tObject({}));
    scheme.FrameInitializer = tObject({
      url: tString,
      name: tString,
      parentFrame: tOptional(tChannel(["Frame"])),
      loadStates: tArray(tType("LifecycleEvent"))
    });
    scheme.FrameLoadstateEvent = tObject({
      add: tOptional(tType("LifecycleEvent")),
      remove: tOptional(tType("LifecycleEvent"))
    });
    scheme.FrameNavigatedEvent = tObject({
      url: tString,
      name: tString,
      newDocument: tOptional(tObject({
        request: tOptional(tChannel(["Request"]))
      })),
      error: tOptional(tString)
    });
    scheme.FrameEvalOnSelectorParams = tObject({
      selector: tString,
      strict: tOptional(tBoolean),
      expression: tString,
      isFunction: tOptional(tBoolean),
      arg: tType("SerializedArgument")
    });
    scheme.FrameEvalOnSelectorResult = tObject({
      value: tType("SerializedValue")
    });
    scheme.FrameEvalOnSelectorAllParams = tObject({
      selector: tString,
      expression: tString,
      isFunction: tOptional(tBoolean),
      arg: tType("SerializedArgument")
    });
    scheme.FrameEvalOnSelectorAllResult = tObject({
      value: tType("SerializedValue")
    });
    scheme.FrameAddScriptTagParams = tObject({
      url: tOptional(tString),
      content: tOptional(tString),
      type: tOptional(tString)
    });
    scheme.FrameAddScriptTagResult = tObject({
      element: tChannel(["ElementHandle"])
    });
    scheme.FrameAddStyleTagParams = tObject({
      url: tOptional(tString),
      content: tOptional(tString)
    });
    scheme.FrameAddStyleTagResult = tObject({
      element: tChannel(["ElementHandle"])
    });
    scheme.FrameAriaSnapshotParams = tObject({
      mode: tOptional(tEnum(["ai", "default"])),
      track: tOptional(tString),
      selector: tOptional(tString),
      depth: tOptional(tInt),
      boxes: tOptional(tBoolean),
      timeout: tFloat
    });
    scheme.FrameAriaSnapshotResult = tObject({
      snapshot: tString
    });
    scheme.FrameBlurParams = tObject({
      selector: tString,
      strict: tOptional(tBoolean),
      timeout: tFloat
    });
    scheme.FrameBlurResult = tOptional(tObject({}));
    scheme.FrameCheckParams = tObject({
      selector: tString,
      strict: tOptional(tBoolean),
      force: tOptional(tBoolean),
      position: tOptional(tType("Point")),
      timeout: tFloat,
      trial: tOptional(tBoolean)
    });
    scheme.FrameCheckResult = tOptional(tObject({}));
    scheme.FrameClickParams = tObject({
      selector: tString,
      strict: tOptional(tBoolean),
      force: tOptional(tBoolean),
      noWaitAfter: tOptional(tBoolean),
      modifiers: tOptional(tArray(tEnum(["Alt", "Control", "ControlOrMeta", "Meta", "Shift"]))),
      position: tOptional(tType("Point")),
      delay: tOptional(tFloat),
      button: tOptional(tEnum(["left", "right", "middle"])),
      clickCount: tOptional(tInt),
      timeout: tFloat,
      trial: tOptional(tBoolean),
      steps: tOptional(tInt)
    });
    scheme.FrameClickResult = tOptional(tObject({}));
    scheme.FrameContentParams = tOptional(tObject({}));
    scheme.FrameContentResult = tObject({
      value: tString
    });
    scheme.FrameDragAndDropParams = tObject({
      source: tString,
      target: tString,
      force: tOptional(tBoolean),
      timeout: tFloat,
      trial: tOptional(tBoolean),
      sourcePosition: tOptional(tType("Point")),
      targetPosition: tOptional(tType("Point")),
      strict: tOptional(tBoolean),
      steps: tOptional(tInt)
    });
    scheme.FrameDragAndDropResult = tOptional(tObject({}));
    scheme.FrameDropParams = tObject({
      selector: tString,
      strict: tOptional(tBoolean),
      position: tOptional(tType("Point")),
      payloads: tOptional(tArray(tObject({
        name: tString,
        mimeType: tOptional(tString),
        buffer: tBinary
      }))),
      localPaths: tOptional(tArray(tString)),
      streams: tOptional(tArray(tChannel(["WritableStream"]))),
      data: tOptional(tArray(tObject({
        mimeType: tString,
        value: tString
      }))),
      timeout: tFloat
    });
    scheme.FrameDropResult = tOptional(tObject({}));
    scheme.FrameDblclickParams = tObject({
      selector: tString,
      strict: tOptional(tBoolean),
      force: tOptional(tBoolean),
      modifiers: tOptional(tArray(tEnum(["Alt", "Control", "ControlOrMeta", "Meta", "Shift"]))),
      position: tOptional(tType("Point")),
      delay: tOptional(tFloat),
      button: tOptional(tEnum(["left", "right", "middle"])),
      timeout: tFloat,
      trial: tOptional(tBoolean),
      steps: tOptional(tInt)
    });
    scheme.FrameDblclickResult = tOptional(tObject({}));
    scheme.FrameDispatchEventParams = tObject({
      selector: tString,
      strict: tOptional(tBoolean),
      type: tString,
      eventInit: tType("SerializedArgument"),
      timeout: tFloat
    });
    scheme.FrameDispatchEventResult = tOptional(tObject({}));
    scheme.FrameEvaluateExpressionParams = tObject({
      expression: tString,
      isFunction: tOptional(tBoolean),
      arg: tType("SerializedArgument")
    });
    scheme.FrameEvaluateExpressionResult = tObject({
      value: tType("SerializedValue")
    });
    scheme.FrameEvaluateExpressionHandleParams = tObject({
      expression: tString,
      isFunction: tOptional(tBoolean),
      arg: tType("SerializedArgument")
    });
    scheme.FrameEvaluateExpressionHandleResult = tObject({
      handle: tChannel(["ElementHandle", "JSHandle"])
    });
    scheme.FrameFillParams = tObject({
      selector: tString,
      strict: tOptional(tBoolean),
      value: tString,
      force: tOptional(tBoolean),
      timeout: tFloat
    });
    scheme.FrameFillResult = tOptional(tObject({}));
    scheme.FrameFocusParams = tObject({
      selector: tString,
      strict: tOptional(tBoolean),
      timeout: tFloat
    });
    scheme.FrameFocusResult = tOptional(tObject({}));
    scheme.FrameFrameElementParams = tOptional(tObject({}));
    scheme.FrameFrameElementResult = tObject({
      element: tChannel(["ElementHandle"])
    });
    scheme.FrameResolveSelectorParams = tObject({
      selector: tString
    });
    scheme.FrameResolveSelectorResult = tObject({
      resolvedSelector: tString
    });
    scheme.FrameHighlightParams = tObject({
      selector: tString,
      style: tOptional(tString)
    });
    scheme.FrameHighlightResult = tOptional(tObject({}));
    scheme.FrameHideHighlightParams = tObject({
      selector: tString
    });
    scheme.FrameHideHighlightResult = tOptional(tObject({}));
    scheme.FrameGetAttributeParams = tObject({
      selector: tString,
      strict: tOptional(tBoolean),
      name: tString,
      timeout: tFloat
    });
    scheme.FrameGetAttributeResult = tObject({
      value: tOptional(tString)
    });
    scheme.FrameGotoParams = tObject({
      url: tString,
      timeout: tFloat,
      waitUntil: tOptional(tType("LifecycleEvent")),
      referer: tOptional(tString)
    });
    scheme.FrameGotoResult = tObject({
      response: tOptional(tChannel(["Response"]))
    });
    scheme.FrameHoverParams = tObject({
      selector: tString,
      strict: tOptional(tBoolean),
      force: tOptional(tBoolean),
      modifiers: tOptional(tArray(tEnum(["Alt", "Control", "ControlOrMeta", "Meta", "Shift"]))),
      position: tOptional(tType("Point")),
      timeout: tFloat,
      trial: tOptional(tBoolean)
    });
    scheme.FrameHoverResult = tOptional(tObject({}));
    scheme.FrameInnerHTMLParams = tObject({
      selector: tString,
      strict: tOptional(tBoolean),
      timeout: tFloat
    });
    scheme.FrameInnerHTMLResult = tObject({
      value: tString
    });
    scheme.FrameInnerTextParams = tObject({
      selector: tString,
      strict: tOptional(tBoolean),
      timeout: tFloat
    });
    scheme.FrameInnerTextResult = tObject({
      value: tString
    });
    scheme.FrameInputValueParams = tObject({
      selector: tString,
      strict: tOptional(tBoolean),
      timeout: tFloat
    });
    scheme.FrameInputValueResult = tObject({
      value: tString
    });
    scheme.FrameIsCheckedParams = tObject({
      selector: tString,
      strict: tOptional(tBoolean),
      timeout: tFloat
    });
    scheme.FrameIsCheckedResult = tObject({
      value: tBoolean
    });
    scheme.FrameIsDisabledParams = tObject({
      selector: tString,
      strict: tOptional(tBoolean),
      timeout: tFloat
    });
    scheme.FrameIsDisabledResult = tObject({
      value: tBoolean
    });
    scheme.FrameIsEnabledParams = tObject({
      selector: tString,
      strict: tOptional(tBoolean),
      timeout: tFloat
    });
    scheme.FrameIsEnabledResult = tObject({
      value: tBoolean
    });
    scheme.FrameIsHiddenParams = tObject({
      selector: tString,
      strict: tOptional(tBoolean)
    });
    scheme.FrameIsHiddenResult = tObject({
      value: tBoolean
    });
    scheme.FrameIsVisibleParams = tObject({
      selector: tString,
      strict: tOptional(tBoolean)
    });
    scheme.FrameIsVisibleResult = tObject({
      value: tBoolean
    });
    scheme.FrameIsEditableParams = tObject({
      selector: tString,
      strict: tOptional(tBoolean),
      timeout: tFloat
    });
    scheme.FrameIsEditableResult = tObject({
      value: tBoolean
    });
    scheme.FramePressParams = tObject({
      selector: tString,
      strict: tOptional(tBoolean),
      key: tString,
      delay: tOptional(tFloat),
      noWaitAfter: tOptional(tBoolean),
      timeout: tFloat
    });
    scheme.FramePressResult = tOptional(tObject({}));
    scheme.FrameQuerySelectorParams = tObject({
      selector: tString,
      strict: tOptional(tBoolean)
    });
    scheme.FrameQuerySelectorResult = tObject({
      element: tOptional(tChannel(["ElementHandle"]))
    });
    scheme.FrameQuerySelectorAllParams = tObject({
      selector: tString
    });
    scheme.FrameQuerySelectorAllResult = tObject({
      elements: tArray(tChannel(["ElementHandle"]))
    });
    scheme.FrameQueryCountParams = tObject({
      selector: tString
    });
    scheme.FrameQueryCountResult = tObject({
      value: tInt
    });
    scheme.FrameSelectOptionParams = tObject({
      selector: tString,
      strict: tOptional(tBoolean),
      elements: tOptional(tArray(tChannel(["ElementHandle"]))),
      options: tOptional(tArray(tObject({
        valueOrLabel: tOptional(tString),
        value: tOptional(tString),
        label: tOptional(tString),
        index: tOptional(tInt)
      }))),
      force: tOptional(tBoolean),
      timeout: tFloat
    });
    scheme.FrameSelectOptionResult = tObject({
      values: tArray(tString)
    });
    scheme.FrameSetContentParams = tObject({
      html: tString,
      timeout: tFloat,
      waitUntil: tOptional(tType("LifecycleEvent"))
    });
    scheme.FrameSetContentResult = tOptional(tObject({}));
    scheme.FrameSetInputFilesParams = tObject({
      selector: tString,
      strict: tOptional(tBoolean),
      payloads: tOptional(tArray(tObject({
        name: tString,
        mimeType: tOptional(tString),
        buffer: tBinary
      }))),
      localDirectory: tOptional(tString),
      directoryStream: tOptional(tChannel(["WritableStream"])),
      localPaths: tOptional(tArray(tString)),
      streams: tOptional(tArray(tChannel(["WritableStream"]))),
      timeout: tFloat
    });
    scheme.FrameSetInputFilesResult = tOptional(tObject({}));
    scheme.FrameTapParams = tObject({
      selector: tString,
      strict: tOptional(tBoolean),
      force: tOptional(tBoolean),
      modifiers: tOptional(tArray(tEnum(["Alt", "Control", "ControlOrMeta", "Meta", "Shift"]))),
      position: tOptional(tType("Point")),
      timeout: tFloat,
      trial: tOptional(tBoolean)
    });
    scheme.FrameTapResult = tOptional(tObject({}));
    scheme.FrameTextContentParams = tObject({
      selector: tString,
      strict: tOptional(tBoolean),
      timeout: tFloat
    });
    scheme.FrameTextContentResult = tObject({
      value: tOptional(tString)
    });
    scheme.FrameTitleParams = tOptional(tObject({}));
    scheme.FrameTitleResult = tObject({
      value: tString
    });
    scheme.FrameTypeParams = tObject({
      selector: tString,
      strict: tOptional(tBoolean),
      text: tString,
      delay: tOptional(tFloat),
      timeout: tFloat
    });
    scheme.FrameTypeResult = tOptional(tObject({}));
    scheme.FrameUncheckParams = tObject({
      selector: tString,
      strict: tOptional(tBoolean),
      force: tOptional(tBoolean),
      position: tOptional(tType("Point")),
      timeout: tFloat,
      trial: tOptional(tBoolean)
    });
    scheme.FrameUncheckResult = tOptional(tObject({}));
    scheme.FrameWaitForTimeoutParams = tObject({
      waitTimeout: tFloat
    });
    scheme.FrameWaitForTimeoutResult = tOptional(tObject({}));
    scheme.FrameWaitForFunctionParams = tObject({
      expression: tString,
      isFunction: tOptional(tBoolean),
      arg: tType("SerializedArgument"),
      timeout: tFloat,
      pollingInterval: tOptional(tFloat)
    });
    scheme.FrameWaitForFunctionResult = tObject({
      handle: tChannel(["ElementHandle", "JSHandle"])
    });
    scheme.FrameWaitForSelectorParams = tObject({
      selector: tString,
      strict: tOptional(tBoolean),
      timeout: tFloat,
      state: tOptional(tEnum(["attached", "detached", "visible", "hidden"])),
      omitReturnValue: tOptional(tBoolean)
    });
    scheme.FrameWaitForSelectorResult = tObject({
      element: tOptional(tChannel(["ElementHandle"]))
    });
    scheme.FrameExpectParams = tObject({
      selector: tOptional(tString),
      expression: tString,
      expressionArg: tOptional(tAny),
      pseudo: tOptional(tEnum(["before", "after"])),
      expectedText: tOptional(tArray(tType("ExpectedTextValue"))),
      expectedNumber: tOptional(tFloat),
      expectedValue: tOptional(tType("SerializedArgument")),
      useInnerText: tOptional(tBoolean),
      isNot: tBoolean,
      timeout: tFloat
    });
    scheme.FrameExpectResult = tOptional(tObject({}));
    scheme.FrameExpectErrorDetails = tObject({
      received: tOptional(tObject({
        value: tOptional(tType("SerializedValue")),
        ariaSnapshot: tOptional(tString)
      })),
      timedOut: tOptional(tBoolean),
      customErrorMessage: tOptional(tString)
    });
    scheme.JSHandleInitializer = tObject({
      preview: tString
    });
    scheme.JSHandlePreviewUpdatedEvent = tObject({
      preview: tString
    });
    scheme.ElementHandlePreviewUpdatedEvent = tType("JSHandlePreviewUpdatedEvent");
    scheme.JSHandleDisposeParams = tOptional(tObject({}));
    scheme.ElementHandleDisposeParams = tType("JSHandleDisposeParams");
    scheme.JSHandleDisposeResult = tOptional(tObject({}));
    scheme.ElementHandleDisposeResult = tType("JSHandleDisposeResult");
    scheme.JSHandleEvaluateExpressionParams = tObject({
      expression: tString,
      isFunction: tOptional(tBoolean),
      arg: tType("SerializedArgument")
    });
    scheme.ElementHandleEvaluateExpressionParams = tType("JSHandleEvaluateExpressionParams");
    scheme.JSHandleEvaluateExpressionResult = tObject({
      value: tType("SerializedValue")
    });
    scheme.ElementHandleEvaluateExpressionResult = tType("JSHandleEvaluateExpressionResult");
    scheme.JSHandleEvaluateExpressionHandleParams = tObject({
      expression: tString,
      isFunction: tOptional(tBoolean),
      arg: tType("SerializedArgument")
    });
    scheme.ElementHandleEvaluateExpressionHandleParams = tType("JSHandleEvaluateExpressionHandleParams");
    scheme.JSHandleEvaluateExpressionHandleResult = tObject({
      handle: tChannel(["ElementHandle", "JSHandle"])
    });
    scheme.ElementHandleEvaluateExpressionHandleResult = tType("JSHandleEvaluateExpressionHandleResult");
    scheme.JSHandleGetPropertyListParams = tOptional(tObject({}));
    scheme.ElementHandleGetPropertyListParams = tType("JSHandleGetPropertyListParams");
    scheme.JSHandleGetPropertyListResult = tObject({
      properties: tArray(tObject({
        name: tString,
        value: tChannel(["ElementHandle", "JSHandle"])
      }))
    });
    scheme.ElementHandleGetPropertyListResult = tType("JSHandleGetPropertyListResult");
    scheme.JSHandleGetPropertyParams = tObject({
      name: tString
    });
    scheme.ElementHandleGetPropertyParams = tType("JSHandleGetPropertyParams");
    scheme.JSHandleGetPropertyResult = tObject({
      handle: tChannel(["ElementHandle", "JSHandle"])
    });
    scheme.ElementHandleGetPropertyResult = tType("JSHandleGetPropertyResult");
    scheme.JSHandleJsonValueParams = tOptional(tObject({}));
    scheme.ElementHandleJsonValueParams = tType("JSHandleJsonValueParams");
    scheme.JSHandleJsonValueResult = tObject({
      value: tType("SerializedValue")
    });
    scheme.ElementHandleJsonValueResult = tType("JSHandleJsonValueResult");
    scheme.ElementHandleInitializer = tObject({
      preview: tString
    });
    scheme.ElementHandleEvalOnSelectorParams = tObject({
      selector: tString,
      strict: tOptional(tBoolean),
      expression: tString,
      isFunction: tOptional(tBoolean),
      arg: tType("SerializedArgument")
    });
    scheme.ElementHandleEvalOnSelectorResult = tObject({
      value: tType("SerializedValue")
    });
    scheme.ElementHandleEvalOnSelectorAllParams = tObject({
      selector: tString,
      expression: tString,
      isFunction: tOptional(tBoolean),
      arg: tType("SerializedArgument")
    });
    scheme.ElementHandleEvalOnSelectorAllResult = tObject({
      value: tType("SerializedValue")
    });
    scheme.ElementHandleBoundingBoxParams = tOptional(tObject({}));
    scheme.ElementHandleBoundingBoxResult = tObject({
      value: tOptional(tType("Rect"))
    });
    scheme.ElementHandleCheckParams = tObject({
      force: tOptional(tBoolean),
      position: tOptional(tType("Point")),
      timeout: tFloat,
      trial: tOptional(tBoolean)
    });
    scheme.ElementHandleCheckResult = tOptional(tObject({}));
    scheme.ElementHandleClickParams = tObject({
      force: tOptional(tBoolean),
      noWaitAfter: tOptional(tBoolean),
      modifiers: tOptional(tArray(tEnum(["Alt", "Control", "ControlOrMeta", "Meta", "Shift"]))),
      position: tOptional(tType("Point")),
      delay: tOptional(tFloat),
      button: tOptional(tEnum(["left", "right", "middle"])),
      clickCount: tOptional(tInt),
      timeout: tFloat,
      trial: tOptional(tBoolean),
      steps: tOptional(tInt)
    });
    scheme.ElementHandleClickResult = tOptional(tObject({}));
    scheme.ElementHandleContentFrameParams = tOptional(tObject({}));
    scheme.ElementHandleContentFrameResult = tObject({
      frame: tOptional(tChannel(["Frame"]))
    });
    scheme.ElementHandleDblclickParams = tObject({
      force: tOptional(tBoolean),
      modifiers: tOptional(tArray(tEnum(["Alt", "Control", "ControlOrMeta", "Meta", "Shift"]))),
      position: tOptional(tType("Point")),
      delay: tOptional(tFloat),
      button: tOptional(tEnum(["left", "right", "middle"])),
      timeout: tFloat,
      trial: tOptional(tBoolean),
      steps: tOptional(tInt)
    });
    scheme.ElementHandleDblclickResult = tOptional(tObject({}));
    scheme.ElementHandleDispatchEventParams = tObject({
      type: tString,
      eventInit: tType("SerializedArgument")
    });
    scheme.ElementHandleDispatchEventResult = tOptional(tObject({}));
    scheme.ElementHandleFillParams = tObject({
      value: tString,
      force: tOptional(tBoolean),
      timeout: tFloat
    });
    scheme.ElementHandleFillResult = tOptional(tObject({}));
    scheme.ElementHandleFocusParams = tOptional(tObject({}));
    scheme.ElementHandleFocusResult = tOptional(tObject({}));
    scheme.ElementHandleGetAttributeParams = tObject({
      name: tString
    });
    scheme.ElementHandleGetAttributeResult = tObject({
      value: tOptional(tString)
    });
    scheme.ElementHandleHoverParams = tObject({
      force: tOptional(tBoolean),
      modifiers: tOptional(tArray(tEnum(["Alt", "Control", "ControlOrMeta", "Meta", "Shift"]))),
      position: tOptional(tType("Point")),
      timeout: tFloat,
      trial: tOptional(tBoolean)
    });
    scheme.ElementHandleHoverResult = tOptional(tObject({}));
    scheme.ElementHandleInnerHTMLParams = tOptional(tObject({}));
    scheme.ElementHandleInnerHTMLResult = tObject({
      value: tString
    });
    scheme.ElementHandleInnerTextParams = tOptional(tObject({}));
    scheme.ElementHandleInnerTextResult = tObject({
      value: tString
    });
    scheme.ElementHandleInputValueParams = tOptional(tObject({}));
    scheme.ElementHandleInputValueResult = tObject({
      value: tString
    });
    scheme.ElementHandleIsCheckedParams = tOptional(tObject({}));
    scheme.ElementHandleIsCheckedResult = tObject({
      value: tBoolean
    });
    scheme.ElementHandleIsDisabledParams = tOptional(tObject({}));
    scheme.ElementHandleIsDisabledResult = tObject({
      value: tBoolean
    });
    scheme.ElementHandleIsEditableParams = tOptional(tObject({}));
    scheme.ElementHandleIsEditableResult = tObject({
      value: tBoolean
    });
    scheme.ElementHandleIsEnabledParams = tOptional(tObject({}));
    scheme.ElementHandleIsEnabledResult = tObject({
      value: tBoolean
    });
    scheme.ElementHandleIsHiddenParams = tOptional(tObject({}));
    scheme.ElementHandleIsHiddenResult = tObject({
      value: tBoolean
    });
    scheme.ElementHandleIsVisibleParams = tOptional(tObject({}));
    scheme.ElementHandleIsVisibleResult = tObject({
      value: tBoolean
    });
    scheme.ElementHandleOwnerFrameParams = tOptional(tObject({}));
    scheme.ElementHandleOwnerFrameResult = tObject({
      frame: tOptional(tChannel(["Frame"]))
    });
    scheme.ElementHandlePressParams = tObject({
      key: tString,
      delay: tOptional(tFloat),
      timeout: tFloat,
      noWaitAfter: tOptional(tBoolean)
    });
    scheme.ElementHandlePressResult = tOptional(tObject({}));
    scheme.ElementHandleQuerySelectorParams = tObject({
      selector: tString,
      strict: tOptional(tBoolean)
    });
    scheme.ElementHandleQuerySelectorResult = tObject({
      element: tOptional(tChannel(["ElementHandle"]))
    });
    scheme.ElementHandleQuerySelectorAllParams = tObject({
      selector: tString
    });
    scheme.ElementHandleQuerySelectorAllResult = tObject({
      elements: tArray(tChannel(["ElementHandle"]))
    });
    scheme.ElementHandleScreenshotParams = tObject({
      timeout: tFloat,
      type: tOptional(tEnum(["png", "jpeg"])),
      quality: tOptional(tInt),
      omitBackground: tOptional(tBoolean),
      caret: tOptional(tEnum(["hide", "initial"])),
      animations: tOptional(tEnum(["disabled", "allow"])),
      scale: tOptional(tEnum(["css", "device"])),
      mask: tOptional(tArray(tObject({
        frame: tChannel(["Frame"]),
        selector: tString
      }))),
      maskColor: tOptional(tString),
      style: tOptional(tString)
    });
    scheme.ElementHandleScreenshotResult = tObject({
      binary: tBinary
    });
    scheme.ElementHandleScrollIntoViewIfNeededParams = tObject({
      timeout: tFloat
    });
    scheme.ElementHandleScrollIntoViewIfNeededResult = tOptional(tObject({}));
    scheme.ElementHandleSelectOptionParams = tObject({
      elements: tOptional(tArray(tChannel(["ElementHandle"]))),
      options: tOptional(tArray(tObject({
        valueOrLabel: tOptional(tString),
        value: tOptional(tString),
        label: tOptional(tString),
        index: tOptional(tInt)
      }))),
      force: tOptional(tBoolean),
      timeout: tFloat
    });
    scheme.ElementHandleSelectOptionResult = tObject({
      values: tArray(tString)
    });
    scheme.ElementHandleSelectTextParams = tObject({
      force: tOptional(tBoolean),
      timeout: tFloat
    });
    scheme.ElementHandleSelectTextResult = tOptional(tObject({}));
    scheme.ElementHandleSetInputFilesParams = tObject({
      payloads: tOptional(tArray(tObject({
        name: tString,
        mimeType: tOptional(tString),
        buffer: tBinary
      }))),
      localDirectory: tOptional(tString),
      directoryStream: tOptional(tChannel(["WritableStream"])),
      localPaths: tOptional(tArray(tString)),
      streams: tOptional(tArray(tChannel(["WritableStream"]))),
      timeout: tFloat
    });
    scheme.ElementHandleSetInputFilesResult = tOptional(tObject({}));
    scheme.ElementHandleTapParams = tObject({
      force: tOptional(tBoolean),
      modifiers: tOptional(tArray(tEnum(["Alt", "Control", "ControlOrMeta", "Meta", "Shift"]))),
      position: tOptional(tType("Point")),
      timeout: tFloat,
      trial: tOptional(tBoolean)
    });
    scheme.ElementHandleTapResult = tOptional(tObject({}));
    scheme.ElementHandleTextContentParams = tOptional(tObject({}));
    scheme.ElementHandleTextContentResult = tObject({
      value: tOptional(tString)
    });
    scheme.ElementHandleTypeParams = tObject({
      text: tString,
      delay: tOptional(tFloat),
      timeout: tFloat
    });
    scheme.ElementHandleTypeResult = tOptional(tObject({}));
    scheme.ElementHandleUncheckParams = tObject({
      force: tOptional(tBoolean),
      position: tOptional(tType("Point")),
      timeout: tFloat,
      trial: tOptional(tBoolean)
    });
    scheme.ElementHandleUncheckResult = tOptional(tObject({}));
    scheme.ElementHandleWaitForElementStateParams = tObject({
      state: tEnum(["visible", "hidden", "stable", "enabled", "disabled", "editable"]),
      timeout: tFloat
    });
    scheme.ElementHandleWaitForElementStateResult = tOptional(tObject({}));
    scheme.ElementHandleWaitForSelectorParams = tObject({
      selector: tString,
      strict: tOptional(tBoolean),
      timeout: tFloat,
      state: tOptional(tEnum(["attached", "detached", "visible", "hidden"]))
    });
    scheme.ElementHandleWaitForSelectorResult = tObject({
      element: tOptional(tChannel(["ElementHandle"]))
    });
    scheme.LocalUtilsInitializer = tObject({
      deviceDescriptors: tArray(tObject({
        name: tString,
        descriptor: tObject({
          userAgent: tString,
          viewport: tObject({
            width: tInt,
            height: tInt
          }),
          screen: tOptional(tObject({
            width: tInt,
            height: tInt
          })),
          deviceScaleFactor: tFloat,
          isMobile: tBoolean,
          hasTouch: tBoolean,
          defaultBrowserType: tEnum(["chromium", "firefox", "webkit"])
        })
      }))
    });
    scheme.LocalUtilsZipParams = tObject({
      zipFile: tString,
      entries: tArray(tType("NameValue")),
      stacksId: tOptional(tString),
      mode: tEnum(["write", "append"]),
      includeSources: tBoolean,
      additionalSources: tOptional(tArray(tString))
    });
    scheme.LocalUtilsZipResult = tOptional(tObject({}));
    scheme.LocalUtilsHarOpenParams = tObject({
      file: tString
    });
    scheme.LocalUtilsHarOpenResult = tObject({
      harId: tOptional(tString),
      error: tOptional(tString)
    });
    scheme.LocalUtilsHarLookupParams = tObject({
      harId: tString,
      url: tString,
      method: tString,
      headers: tArray(tType("NameValue")),
      postData: tOptional(tBinary),
      isNavigationRequest: tBoolean
    });
    scheme.LocalUtilsHarLookupResult = tObject({
      action: tEnum(["error", "redirect", "fulfill", "noentry"]),
      message: tOptional(tString),
      redirectURL: tOptional(tString),
      status: tOptional(tInt),
      headers: tOptional(tArray(tType("NameValue"))),
      body: tOptional(tBinary)
    });
    scheme.LocalUtilsHarCloseParams = tObject({
      harId: tString
    });
    scheme.LocalUtilsHarCloseResult = tOptional(tObject({}));
    scheme.LocalUtilsHarUnzipParams = tObject({
      zipFile: tString,
      harFile: tString,
      resourcesDir: tOptional(tString)
    });
    scheme.LocalUtilsHarUnzipResult = tOptional(tObject({}));
    scheme.LocalUtilsConnectParams = tObject({
      endpoint: tString,
      headers: tOptional(tAny),
      exposeNetwork: tOptional(tString),
      slowMo: tOptional(tFloat),
      timeout: tFloat,
      socksProxyRedirectPortForTest: tOptional(tInt)
    });
    scheme.LocalUtilsConnectResult = tObject({
      pipe: tChannel(["JsonPipe"]),
      headers: tArray(tType("NameValue"))
    });
    scheme.LocalUtilsTracingStartedParams = tObject({
      tracesDir: tOptional(tString),
      traceName: tString,
      live: tOptional(tBoolean)
    });
    scheme.LocalUtilsTracingStartedResult = tObject({
      stacksId: tString
    });
    scheme.LocalUtilsAddStackToTracingNoReplyParams = tObject({
      callData: tType("ClientSideCallMetadata")
    });
    scheme.LocalUtilsAddStackToTracingNoReplyResult = tOptional(tObject({}));
    scheme.LocalUtilsTraceDiscardedParams = tObject({
      stacksId: tString
    });
    scheme.LocalUtilsTraceDiscardedResult = tOptional(tObject({}));
    scheme.LocalUtilsGlobToRegexParams = tObject({
      glob: tString,
      baseURL: tOptional(tString),
      webSocketUrl: tOptional(tBoolean)
    });
    scheme.LocalUtilsGlobToRegexResult = tObject({
      regex: tString
    });
    scheme.SetNetworkCookie = tObject({
      name: tString,
      value: tString,
      url: tOptional(tString),
      domain: tOptional(tString),
      path: tOptional(tString),
      expires: tOptional(tFloat),
      httpOnly: tOptional(tBoolean),
      secure: tOptional(tBoolean),
      sameSite: tOptional(tEnum(["Strict", "Lax", "None"])),
      partitionKey: tOptional(tString),
      _crHasCrossSiteAncestor: tOptional(tBoolean)
    });
    scheme.NetworkCookie = tObject({
      name: tString,
      value: tString,
      domain: tString,
      path: tString,
      expires: tFloat,
      httpOnly: tBoolean,
      secure: tBoolean,
      sameSite: tEnum(["Strict", "Lax", "None"]),
      partitionKey: tOptional(tString),
      _crHasCrossSiteAncestor: tOptional(tBoolean)
    });
    scheme.RequestInitializer = tObject({
      frame: tOptional(tChannel(["Frame"])),
      serviceWorker: tOptional(tChannel(["Worker"])),
      url: tString,
      resourceType: tString,
      method: tString,
      postData: tOptional(tBinary),
      headers: tArray(tType("NameValue")),
      isNavigationRequest: tBoolean,
      redirectedFrom: tOptional(tChannel(["Request"]))
    });
    scheme.RequestResponseParams = tOptional(tObject({}));
    scheme.RequestResponseResult = tObject({
      response: tOptional(tChannel(["Response"]))
    });
    scheme.RequestRawRequestHeadersParams = tOptional(tObject({}));
    scheme.RequestRawRequestHeadersResult = tObject({
      headers: tArray(tType("NameValue"))
    });
    scheme.RouteInitializer = tObject({
      request: tChannel(["Request"])
    });
    scheme.RouteRedirectNavigationRequestParams = tObject({
      url: tString
    });
    scheme.RouteRedirectNavigationRequestResult = tOptional(tObject({}));
    scheme.RouteAbortParams = tObject({
      errorCode: tOptional(tString)
    });
    scheme.RouteAbortResult = tOptional(tObject({}));
    scheme.RouteContinueParams = tObject({
      url: tOptional(tString),
      method: tOptional(tString),
      headers: tOptional(tArray(tType("NameValue"))),
      postData: tOptional(tBinary),
      isFallback: tBoolean
    });
    scheme.RouteContinueResult = tOptional(tObject({}));
    scheme.RouteFulfillParams = tObject({
      status: tOptional(tInt),
      headers: tOptional(tArray(tType("NameValue"))),
      body: tOptional(tString),
      isBase64: tOptional(tBoolean),
      fetchResponseUid: tOptional(tString)
    });
    scheme.RouteFulfillResult = tOptional(tObject({}));
    scheme.WebSocketRouteInitializer = tObject({
      url: tString,
      protocols: tArray(tString)
    });
    scheme.WebSocketRouteMessageFromPageEvent = tObject({
      message: tString,
      isBase64: tBoolean
    });
    scheme.WebSocketRouteMessageFromServerEvent = tObject({
      message: tString,
      isBase64: tBoolean
    });
    scheme.WebSocketRouteClosePageEvent = tObject({
      code: tOptional(tInt),
      reason: tOptional(tString),
      wasClean: tBoolean
    });
    scheme.WebSocketRouteCloseServerEvent = tObject({
      code: tOptional(tInt),
      reason: tOptional(tString),
      wasClean: tBoolean
    });
    scheme.WebSocketRouteConnectParams = tOptional(tObject({}));
    scheme.WebSocketRouteConnectResult = tOptional(tObject({}));
    scheme.WebSocketRouteEnsureOpenedParams = tOptional(tObject({}));
    scheme.WebSocketRouteEnsureOpenedResult = tOptional(tObject({}));
    scheme.WebSocketRouteSendToPageParams = tObject({
      message: tString,
      isBase64: tBoolean
    });
    scheme.WebSocketRouteSendToPageResult = tOptional(tObject({}));
    scheme.WebSocketRouteSendToServerParams = tObject({
      message: tString,
      isBase64: tBoolean
    });
    scheme.WebSocketRouteSendToServerResult = tOptional(tObject({}));
    scheme.WebSocketRouteClosePageParams = tObject({
      code: tOptional(tInt),
      reason: tOptional(tString),
      wasClean: tBoolean
    });
    scheme.WebSocketRouteClosePageResult = tOptional(tObject({}));
    scheme.WebSocketRouteCloseServerParams = tObject({
      code: tOptional(tInt),
      reason: tOptional(tString),
      wasClean: tBoolean
    });
    scheme.WebSocketRouteCloseServerResult = tOptional(tObject({}));
    scheme.ResourceTiming = tObject({
      startTime: tFloat,
      domainLookupStart: tFloat,
      domainLookupEnd: tFloat,
      connectStart: tFloat,
      secureConnectionStart: tFloat,
      connectEnd: tFloat,
      requestStart: tFloat,
      responseStart: tFloat
    });
    scheme.ResponseInitializer = tObject({
      request: tChannel(["Request"]),
      url: tString,
      status: tInt,
      statusText: tString,
      headers: tArray(tType("NameValue")),
      timing: tType("ResourceTiming"),
      fromServiceWorker: tBoolean
    });
    scheme.ResponseBodyParams = tOptional(tObject({}));
    scheme.ResponseBodyResult = tObject({
      binary: tBinary
    });
    scheme.ResponseSecurityDetailsParams = tOptional(tObject({}));
    scheme.ResponseSecurityDetailsResult = tObject({
      value: tOptional(tType("SecurityDetails"))
    });
    scheme.ResponseServerAddrParams = tOptional(tObject({}));
    scheme.ResponseServerAddrResult = tObject({
      value: tOptional(tType("RemoteAddr"))
    });
    scheme.ResponseRawResponseHeadersParams = tOptional(tObject({}));
    scheme.ResponseRawResponseHeadersResult = tObject({
      headers: tArray(tType("NameValue"))
    });
    scheme.ResponseHttpVersionParams = tOptional(tObject({}));
    scheme.ResponseHttpVersionResult = tObject({
      value: tString
    });
    scheme.ResponseSizesParams = tOptional(tObject({}));
    scheme.ResponseSizesResult = tObject({
      sizes: tType("RequestSizes")
    });
    scheme.SecurityDetails = tObject({
      issuer: tOptional(tString),
      protocol: tOptional(tString),
      subjectName: tOptional(tString),
      validFrom: tOptional(tFloat),
      validTo: tOptional(tFloat)
    });
    scheme.RequestSizes = tObject({
      requestBodySize: tInt,
      requestHeadersSize: tInt,
      responseBodySize: tInt,
      responseHeadersSize: tInt
    });
    scheme.RemoteAddr = tObject({
      ipAddress: tString,
      port: tInt
    });
    scheme.WebSocketInitializer = tObject({
      url: tString
    });
    scheme.WebSocketOpenEvent = tOptional(tObject({}));
    scheme.WebSocketFrameSentEvent = tObject({
      opcode: tInt,
      data: tString
    });
    scheme.WebSocketFrameReceivedEvent = tObject({
      opcode: tInt,
      data: tString
    });
    scheme.WebSocketSocketErrorEvent = tObject({
      error: tString
    });
    scheme.WebSocketCloseEvent = tOptional(tObject({}));
    scheme.PageInitializer = tObject({
      mainFrame: tChannel(["Frame"]),
      viewportSize: tOptional(tObject({
        width: tInt,
        height: tInt
      })),
      isClosed: tBoolean,
      opener: tOptional(tChannel(["Page"])),
      video: tOptional(tChannel(["Artifact"]))
    });
    scheme.PageBindingCallEvent = tObject({
      binding: tChannel(["BindingCall"])
    });
    scheme.PageCloseEvent = tOptional(tObject({}));
    scheme.PageCrashEvent = tOptional(tObject({}));
    scheme.PageDownloadEvent = tObject({
      url: tString,
      suggestedFilename: tString,
      artifact: tChannel(["Artifact"])
    });
    scheme.PageViewportSizeChangedEvent = tObject({
      viewportSize: tOptional(tObject({
        width: tInt,
        height: tInt
      }))
    });
    scheme.PageFileChooserEvent = tObject({
      element: tChannel(["ElementHandle"]),
      isMultiple: tBoolean
    });
    scheme.PageFrameAttachedEvent = tObject({
      frame: tChannel(["Frame"])
    });
    scheme.PageFrameDetachedEvent = tObject({
      frame: tChannel(["Frame"])
    });
    scheme.PageLocatorHandlerTriggeredEvent = tObject({
      uid: tInt
    });
    scheme.PageRouteEvent = tObject({
      route: tChannel(["Route"])
    });
    scheme.PageScreencastFrameEvent = tObject({
      data: tBinary,
      timestamp: tFloat,
      viewportWidth: tInt,
      viewportHeight: tInt
    });
    scheme.PageWebSocketRouteEvent = tObject({
      webSocketRoute: tChannel(["WebSocketRoute"])
    });
    scheme.PageWebSocketEvent = tObject({
      webSocket: tChannel(["WebSocket"])
    });
    scheme.PageWorkerEvent = tObject({
      worker: tChannel(["Worker"])
    });
    scheme.PageAddInitScriptParams = tObject({
      source: tString
    });
    scheme.PageAddInitScriptResult = tObject({
      disposable: tChannel(["Disposable"])
    });
    scheme.PageCloseParams = tObject({
      reason: tOptional(tString)
    });
    scheme.PageCloseResult = tOptional(tObject({}));
    scheme.PageRunBeforeUnloadParams = tOptional(tObject({}));
    scheme.PageRunBeforeUnloadResult = tOptional(tObject({}));
    scheme.PageClearConsoleMessagesParams = tOptional(tObject({}));
    scheme.PageClearConsoleMessagesResult = tOptional(tObject({}));
    scheme.PageConsoleMessagesParams = tObject({
      filter: tOptional(tType("ConsoleMessagesFilter"))
    });
    scheme.PageConsoleMessagesResult = tObject({
      messages: tArray(tObject({
        type: tString,
        text: tString,
        args: tArray(tChannel(["ElementHandle", "JSHandle"])),
        location: tObject({
          url: tString,
          lineNumber: tInt,
          columnNumber: tInt
        }),
        timestamp: tFloat
      }))
    });
    scheme.PageEmulateMediaParams = tObject({
      media: tOptional(tEnum(["screen", "print", "no-override"])),
      colorScheme: tOptional(tEnum(["dark", "light", "no-preference", "no-override"])),
      reducedMotion: tOptional(tEnum(["reduce", "no-preference", "no-override"])),
      forcedColors: tOptional(tEnum(["active", "none", "no-override"])),
      contrast: tOptional(tEnum(["no-preference", "more", "no-override"]))
    });
    scheme.PageEmulateMediaResult = tOptional(tObject({}));
    scheme.PageExposeBindingParams = tObject({
      name: tString
    });
    scheme.PageExposeBindingResult = tObject({
      disposable: tChannel(["Disposable"])
    });
    scheme.PageGoBackParams = tObject({
      timeout: tFloat,
      waitUntil: tOptional(tType("LifecycleEvent"))
    });
    scheme.PageGoBackResult = tObject({
      response: tOptional(tChannel(["Response"]))
    });
    scheme.PageGoForwardParams = tObject({
      timeout: tFloat,
      waitUntil: tOptional(tType("LifecycleEvent"))
    });
    scheme.PageGoForwardResult = tObject({
      response: tOptional(tChannel(["Response"]))
    });
    scheme.PageRequestGCParams = tOptional(tObject({}));
    scheme.PageRequestGCResult = tOptional(tObject({}));
    scheme.PageRegisterLocatorHandlerParams = tObject({
      selector: tString,
      noWaitAfter: tOptional(tBoolean)
    });
    scheme.PageRegisterLocatorHandlerResult = tObject({
      uid: tInt
    });
    scheme.PageResolveLocatorHandlerNoReplyParams = tObject({
      uid: tInt,
      remove: tOptional(tBoolean)
    });
    scheme.PageResolveLocatorHandlerNoReplyResult = tOptional(tObject({}));
    scheme.PageUnregisterLocatorHandlerParams = tObject({
      uid: tInt
    });
    scheme.PageUnregisterLocatorHandlerResult = tOptional(tObject({}));
    scheme.PageReloadParams = tObject({
      timeout: tFloat,
      waitUntil: tOptional(tType("LifecycleEvent"))
    });
    scheme.PageReloadResult = tObject({
      response: tOptional(tChannel(["Response"]))
    });
    scheme.PageExpectScreenshotParams = tObject({
      expected: tOptional(tBinary),
      timeout: tFloat,
      isNot: tBoolean,
      locator: tOptional(tObject({
        frame: tChannel(["Frame"]),
        selector: tString
      })),
      comparator: tOptional(tString),
      maxDiffPixels: tOptional(tInt),
      maxDiffPixelRatio: tOptional(tFloat),
      threshold: tOptional(tFloat),
      fullPage: tOptional(tBoolean),
      clip: tOptional(tType("Rect")),
      omitBackground: tOptional(tBoolean),
      caret: tOptional(tEnum(["hide", "initial"])),
      animations: tOptional(tEnum(["disabled", "allow"])),
      scale: tOptional(tEnum(["css", "device"])),
      mask: tOptional(tArray(tObject({
        frame: tChannel(["Frame"]),
        selector: tString
      }))),
      maskColor: tOptional(tString),
      style: tOptional(tString)
    });
    scheme.PageExpectScreenshotResult = tObject({
      actual: tOptional(tBinary)
    });
    scheme.PageExpectScreenshotErrorDetails = tObject({
      diff: tOptional(tBinary),
      customErrorMessage: tOptional(tString),
      actual: tOptional(tBinary),
      previous: tOptional(tBinary),
      timedOut: tOptional(tBoolean),
      log: tOptional(tArray(tString))
    });
    scheme.PageScreenshotParams = tObject({
      timeout: tFloat,
      type: tOptional(tEnum(["png", "jpeg"])),
      quality: tOptional(tInt),
      fullPage: tOptional(tBoolean),
      clip: tOptional(tType("Rect")),
      omitBackground: tOptional(tBoolean),
      caret: tOptional(tEnum(["hide", "initial"])),
      animations: tOptional(tEnum(["disabled", "allow"])),
      scale: tOptional(tEnum(["css", "device"])),
      mask: tOptional(tArray(tObject({
        frame: tChannel(["Frame"]),
        selector: tString
      }))),
      maskColor: tOptional(tString),
      style: tOptional(tString)
    });
    scheme.PageScreenshotResult = tObject({
      binary: tBinary
    });
    scheme.PageSetExtraHTTPHeadersParams = tObject({
      headers: tArray(tType("NameValue"))
    });
    scheme.PageSetExtraHTTPHeadersResult = tOptional(tObject({}));
    scheme.PageSetNetworkInterceptionPatternsParams = tObject({
      patterns: tArray(tObject({
        glob: tOptional(tString),
        regexSource: tOptional(tString),
        regexFlags: tOptional(tString),
        urlPattern: tOptional(tType("URLPattern"))
      }))
    });
    scheme.PageSetNetworkInterceptionPatternsResult = tOptional(tObject({}));
    scheme.PageSetWebSocketInterceptionPatternsParams = tObject({
      patterns: tArray(tObject({
        glob: tOptional(tString),
        regexSource: tOptional(tString),
        regexFlags: tOptional(tString),
        urlPattern: tOptional(tType("URLPattern"))
      }))
    });
    scheme.PageSetWebSocketInterceptionPatternsResult = tOptional(tObject({}));
    scheme.PageSetViewportSizeParams = tObject({
      viewportSize: tObject({
        width: tInt,
        height: tInt
      })
    });
    scheme.PageSetViewportSizeResult = tOptional(tObject({}));
    scheme.PageKeyboardDownParams = tObject({
      key: tString
    });
    scheme.PageKeyboardDownResult = tOptional(tObject({}));
    scheme.PageKeyboardUpParams = tObject({
      key: tString
    });
    scheme.PageKeyboardUpResult = tOptional(tObject({}));
    scheme.PageKeyboardInsertTextParams = tObject({
      text: tString
    });
    scheme.PageKeyboardInsertTextResult = tOptional(tObject({}));
    scheme.PageKeyboardTypeParams = tObject({
      text: tString,
      delay: tOptional(tFloat)
    });
    scheme.PageKeyboardTypeResult = tOptional(tObject({}));
    scheme.PageKeyboardPressParams = tObject({
      key: tString,
      delay: tOptional(tFloat)
    });
    scheme.PageKeyboardPressResult = tOptional(tObject({}));
    scheme.PageMouseMoveParams = tObject({
      x: tFloat,
      y: tFloat,
      steps: tOptional(tInt)
    });
    scheme.PageMouseMoveResult = tOptional(tObject({}));
    scheme.PageMouseDownParams = tObject({
      button: tOptional(tEnum(["left", "right", "middle"])),
      clickCount: tOptional(tInt)
    });
    scheme.PageMouseDownResult = tOptional(tObject({}));
    scheme.PageMouseUpParams = tObject({
      button: tOptional(tEnum(["left", "right", "middle"])),
      clickCount: tOptional(tInt)
    });
    scheme.PageMouseUpResult = tOptional(tObject({}));
    scheme.PageMouseClickParams = tObject({
      x: tFloat,
      y: tFloat,
      delay: tOptional(tFloat),
      button: tOptional(tEnum(["left", "right", "middle"])),
      clickCount: tOptional(tInt)
    });
    scheme.PageMouseClickResult = tOptional(tObject({}));
    scheme.PageMouseWheelParams = tObject({
      deltaX: tFloat,
      deltaY: tFloat
    });
    scheme.PageMouseWheelResult = tOptional(tObject({}));
    scheme.PageTouchscreenTapParams = tObject({
      x: tFloat,
      y: tFloat
    });
    scheme.PageTouchscreenTapResult = tOptional(tObject({}));
    scheme.PageClearPageErrorsParams = tOptional(tObject({}));
    scheme.PageClearPageErrorsResult = tOptional(tObject({}));
    scheme.PagePageErrorsParams = tObject({
      filter: tOptional(tType("ConsoleMessagesFilter"))
    });
    scheme.PagePageErrorsResult = tObject({
      errors: tArray(tType("SerializedError"))
    });
    scheme.PagePdfParams = tObject({
      scale: tOptional(tFloat),
      displayHeaderFooter: tOptional(tBoolean),
      headerTemplate: tOptional(tString),
      footerTemplate: tOptional(tString),
      printBackground: tOptional(tBoolean),
      landscape: tOptional(tBoolean),
      pageRanges: tOptional(tString),
      format: tOptional(tString),
      width: tOptional(tString),
      height: tOptional(tString),
      preferCSSPageSize: tOptional(tBoolean),
      margin: tOptional(tObject({
        top: tOptional(tString),
        bottom: tOptional(tString),
        left: tOptional(tString),
        right: tOptional(tString)
      })),
      tagged: tOptional(tBoolean),
      outline: tOptional(tBoolean)
    });
    scheme.PagePdfResult = tObject({
      pdf: tBinary
    });
    scheme.PageRequestsParams = tOptional(tObject({}));
    scheme.PageRequestsResult = tObject({
      requests: tArray(tChannel(["Request"]))
    });
    scheme.PageStartJSCoverageParams = tObject({
      resetOnNavigation: tOptional(tBoolean),
      reportAnonymousScripts: tOptional(tBoolean)
    });
    scheme.PageStartJSCoverageResult = tOptional(tObject({}));
    scheme.PageStopJSCoverageParams = tOptional(tObject({}));
    scheme.PageStopJSCoverageResult = tObject({
      entries: tArray(tObject({
        url: tString,
        scriptId: tString,
        source: tOptional(tString),
        functions: tArray(tObject({
          functionName: tString,
          isBlockCoverage: tBoolean,
          ranges: tArray(tObject({
            startOffset: tInt,
            endOffset: tInt,
            count: tInt
          }))
        }))
      }))
    });
    scheme.PageStartCSSCoverageParams = tObject({
      resetOnNavigation: tOptional(tBoolean)
    });
    scheme.PageStartCSSCoverageResult = tOptional(tObject({}));
    scheme.PageStopCSSCoverageParams = tOptional(tObject({}));
    scheme.PageStopCSSCoverageResult = tObject({
      entries: tArray(tObject({
        url: tString,
        text: tOptional(tString),
        ranges: tArray(tObject({
          start: tInt,
          end: tInt
        }))
      }))
    });
    scheme.PageBringToFrontParams = tOptional(tObject({}));
    scheme.PageBringToFrontResult = tOptional(tObject({}));
    scheme.PagePickLocatorParams = tOptional(tObject({}));
    scheme.PagePickLocatorResult = tObject({
      selector: tString
    });
    scheme.PageCancelPickLocatorParams = tOptional(tObject({}));
    scheme.PageCancelPickLocatorResult = tOptional(tObject({}));
    scheme.PageHideHighlightParams = tOptional(tObject({}));
    scheme.PageHideHighlightResult = tOptional(tObject({}));
    scheme.PageScreencastShowOverlayParams = tObject({
      html: tString,
      duration: tOptional(tFloat)
    });
    scheme.PageScreencastShowOverlayResult = tObject({
      id: tString
    });
    scheme.PageScreencastRemoveOverlayParams = tObject({
      id: tString
    });
    scheme.PageScreencastRemoveOverlayResult = tOptional(tObject({}));
    scheme.PageScreencastChapterParams = tObject({
      title: tString,
      description: tOptional(tString),
      duration: tOptional(tFloat)
    });
    scheme.PageScreencastChapterResult = tOptional(tObject({}));
    scheme.PageScreencastSetOverlayVisibleParams = tObject({
      visible: tBoolean
    });
    scheme.PageScreencastSetOverlayVisibleResult = tOptional(tObject({}));
    scheme.PageScreencastShowActionsParams = tObject({
      duration: tOptional(tFloat),
      position: tOptional(tEnum(["top-left", "top", "top-right", "bottom-left", "bottom", "bottom-right"])),
      fontSize: tOptional(tInt),
      cursor: tOptional(tEnum(["none", "pointer"]))
    });
    scheme.PageScreencastShowActionsResult = tOptional(tObject({}));
    scheme.PageScreencastHideActionsParams = tOptional(tObject({}));
    scheme.PageScreencastHideActionsResult = tOptional(tObject({}));
    scheme.PageScreencastStartParams = tObject({
      size: tOptional(tObject({
        width: tInt,
        height: tInt
      })),
      quality: tOptional(tInt),
      sendFrames: tOptional(tBoolean),
      record: tOptional(tBoolean)
    });
    scheme.PageScreencastStartResult = tObject({
      artifact: tOptional(tChannel(["Artifact"]))
    });
    scheme.PageScreencastStopParams = tOptional(tObject({}));
    scheme.PageScreencastStopResult = tOptional(tObject({}));
    scheme.PageUpdateSubscriptionParams = tObject({
      event: tEnum(["console", "dialog", "fileChooser", "request", "response", "requestFinished", "requestFailed"]),
      enabled: tBoolean
    });
    scheme.PageUpdateSubscriptionResult = tOptional(tObject({}));
    scheme.PageSetDockTileParams = tObject({
      image: tBinary
    });
    scheme.PageSetDockTileResult = tOptional(tObject({}));
    scheme.PageWebStorageItemsParams = tObject({
      kind: tEnum(["local", "session"])
    });
    scheme.PageWebStorageItemsResult = tObject({
      items: tArray(tType("NameValue"))
    });
    scheme.PageWebStorageGetItemParams = tObject({
      kind: tEnum(["local", "session"]),
      name: tString
    });
    scheme.PageWebStorageGetItemResult = tObject({
      value: tOptional(tString)
    });
    scheme.PageWebStorageSetItemParams = tObject({
      kind: tEnum(["local", "session"]),
      name: tString,
      value: tString
    });
    scheme.PageWebStorageSetItemResult = tOptional(tObject({}));
    scheme.PageWebStorageRemoveItemParams = tObject({
      kind: tEnum(["local", "session"]),
      name: tString
    });
    scheme.PageWebStorageRemoveItemResult = tOptional(tObject({}));
    scheme.PageWebStorageClearParams = tObject({
      kind: tEnum(["local", "session"])
    });
    scheme.PageWebStorageClearResult = tOptional(tObject({}));
    scheme.RootInitializer = tOptional(tObject({}));
    scheme.RootInitializeParams = tObject({
      sdkLanguage: tType("SDKLanguage")
    });
    scheme.RootInitializeResult = tObject({
      playwright: tChannel(["Playwright"])
    });
    scheme.PlaywrightInitializer = tObject({
      chromium: tChannel(["BrowserType"]),
      firefox: tChannel(["BrowserType"]),
      webkit: tChannel(["BrowserType"]),
      android: tChannel(["Android"]),
      electron: tChannel(["Electron"]),
      utils: tOptional(tChannel(["LocalUtils"])),
      preLaunchedBrowser: tOptional(tChannel(["Browser"])),
      preConnectedAndroidDevice: tOptional(tChannel(["AndroidDevice"])),
      socksSupport: tOptional(tChannel(["SocksSupport"]))
    });
    scheme.PlaywrightNewRequestParams = tObject({
      baseURL: tOptional(tString),
      userAgent: tOptional(tString),
      ignoreHTTPSErrors: tOptional(tBoolean),
      extraHTTPHeaders: tOptional(tArray(tType("NameValue"))),
      failOnStatusCode: tOptional(tBoolean),
      clientCertificates: tOptional(tArray(tObject({
        origin: tString,
        cert: tOptional(tBinary),
        key: tOptional(tBinary),
        passphrase: tOptional(tString),
        pfx: tOptional(tBinary)
      }))),
      maxRedirects: tOptional(tInt),
      httpCredentials: tOptional(tObject({
        username: tString,
        password: tString,
        origin: tOptional(tString),
        send: tOptional(tEnum(["always", "unauthorized"]))
      })),
      proxy: tOptional(tObject({
        server: tString,
        bypass: tOptional(tString),
        username: tOptional(tString),
        password: tOptional(tString)
      })),
      storageState: tOptional(tObject({
        cookies: tOptional(tArray(tType("NetworkCookie"))),
        origins: tOptional(tArray(tType("SetOriginStorage")))
      })),
      tracesDir: tOptional(tString)
    });
    scheme.PlaywrightNewRequestResult = tObject({
      request: tChannel(["APIRequestContext"])
    });
    scheme.DebugControllerInitializer = tOptional(tObject({}));
    scheme.DebugControllerInspectRequestedEvent = tObject({
      selector: tString,
      locator: tString,
      ariaSnapshot: tString
    });
    scheme.DebugControllerSetModeRequestedEvent = tObject({
      mode: tString
    });
    scheme.DebugControllerStateChangedEvent = tObject({
      pageCount: tInt
    });
    scheme.DebugControllerSourceChangedEvent = tObject({
      text: tString,
      header: tOptional(tString),
      footer: tOptional(tString),
      actions: tOptional(tArray(tString))
    });
    scheme.DebugControllerPausedEvent = tObject({
      paused: tBoolean
    });
    scheme.DebugControllerInitializeParams = tObject({
      codegenId: tString,
      sdkLanguage: tType("SDKLanguage")
    });
    scheme.DebugControllerInitializeResult = tOptional(tObject({}));
    scheme.DebugControllerSetReportStateChangedParams = tObject({
      enabled: tBoolean
    });
    scheme.DebugControllerSetReportStateChangedResult = tOptional(tObject({}));
    scheme.DebugControllerSetRecorderModeParams = tObject({
      mode: tEnum(["inspecting", "recording", "none"]),
      testIdAttributeName: tOptional(tString),
      generateAutoExpect: tOptional(tBoolean)
    });
    scheme.DebugControllerSetRecorderModeResult = tOptional(tObject({}));
    scheme.DebugControllerHighlightParams = tObject({
      selector: tOptional(tString),
      ariaTemplate: tOptional(tString)
    });
    scheme.DebugControllerHighlightResult = tOptional(tObject({}));
    scheme.DebugControllerHideHighlightParams = tOptional(tObject({}));
    scheme.DebugControllerHideHighlightResult = tOptional(tObject({}));
    scheme.DebugControllerResumeParams = tOptional(tObject({}));
    scheme.DebugControllerResumeResult = tOptional(tObject({}));
    scheme.DebugControllerKillParams = tOptional(tObject({}));
    scheme.DebugControllerKillResult = tOptional(tObject({}));
    scheme.SocksSupportInitializer = tOptional(tObject({}));
    scheme.SocksSupportSocksRequestedEvent = tObject({
      uid: tString,
      host: tString,
      port: tInt
    });
    scheme.SocksSupportSocksDataEvent = tObject({
      uid: tString,
      data: tBinary
    });
    scheme.SocksSupportSocksClosedEvent = tObject({
      uid: tString
    });
    scheme.SocksSupportSocksConnectedParams = tObject({
      uid: tString,
      host: tString,
      port: tInt
    });
    scheme.SocksSupportSocksConnectedResult = tOptional(tObject({}));
    scheme.SocksSupportSocksFailedParams = tObject({
      uid: tString,
      errorCode: tString
    });
    scheme.SocksSupportSocksFailedResult = tOptional(tObject({}));
    scheme.SocksSupportSocksDataParams = tObject({
      uid: tString,
      data: tBinary
    });
    scheme.SocksSupportSocksDataResult = tOptional(tObject({}));
    scheme.SocksSupportSocksErrorParams = tObject({
      uid: tString,
      error: tString
    });
    scheme.SocksSupportSocksErrorResult = tOptional(tObject({}));
    scheme.SocksSupportSocksEndParams = tObject({
      uid: tString
    });
    scheme.SocksSupportSocksEndResult = tOptional(tObject({}));
    scheme.JsonPipeInitializer = tOptional(tObject({}));
    scheme.JsonPipeMessageEvent = tObject({
      message: tAny
    });
    scheme.JsonPipeClosedEvent = tObject({
      reason: tOptional(tString)
    });
    scheme.JsonPipeSendParams = tObject({
      message: tAny
    });
    scheme.JsonPipeSendResult = tOptional(tObject({}));
    scheme.JsonPipeCloseParams = tOptional(tObject({}));
    scheme.JsonPipeCloseResult = tOptional(tObject({}));
    scheme.ExpectedTextValue = tObject({
      string: tOptional(tString),
      regexSource: tOptional(tString),
      regexFlags: tOptional(tString),
      matchSubstring: tOptional(tBoolean),
      ignoreCase: tOptional(tBoolean),
      normalizeWhiteSpace: tOptional(tBoolean)
    });
    scheme.SelectorEngine = tObject({
      name: tString,
      source: tString,
      contentScript: tOptional(tBoolean)
    });
    scheme.FormField = tObject({
      name: tString,
      value: tOptional(tString),
      file: tOptional(tObject({
        name: tString,
        mimeType: tOptional(tString),
        buffer: tBinary
      }))
    });
    scheme.LifecycleEvent = tEnum(["load", "domcontentloaded", "networkidle", "commit"]);
    scheme.ConsoleMessagesFilter = tEnum(["all", "since-navigation"]);
    scheme.RecorderSource = tObject({
      isRecorded: tBoolean,
      id: tString,
      label: tString,
      text: tString,
      language: tString,
      highlight: tArray(tObject({
        line: tInt,
        type: tString
      })),
      revealLine: tOptional(tInt),
      group: tOptional(tString)
    });
    scheme.IndexedDBDatabase = tObject({
      name: tString,
      version: tInt,
      stores: tArray(tObject({
        name: tString,
        autoIncrement: tBoolean,
        keyPath: tOptional(tString),
        keyPathArray: tOptional(tArray(tString)),
        records: tArray(tObject({
          key: tOptional(tAny),
          keyEncoded: tOptional(tAny),
          value: tOptional(tAny),
          valueEncoded: tOptional(tAny)
        })),
        indexes: tArray(tObject({
          name: tString,
          keyPath: tOptional(tString),
          keyPathArray: tOptional(tArray(tString)),
          multiEntry: tBoolean,
          unique: tBoolean
        }))
      }))
    });
    scheme.SetOriginStorage = tObject({
      origin: tString,
      localStorage: tArray(tType("NameValue")),
      indexedDB: tOptional(tArray(tType("IndexedDBDatabase")))
    });
    scheme.OriginStorage = tObject({
      origin: tString,
      localStorage: tArray(tType("NameValue")),
      indexedDB: tOptional(tArray(tType("IndexedDBDatabase")))
    });
    scheme.RecordHarOptions = tObject({
      content: tOptional(tEnum(["embed", "attach", "omit"])),
      mode: tOptional(tEnum(["full", "minimal"])),
      urlGlob: tOptional(tString),
      urlRegexSource: tOptional(tString),
      urlRegexFlags: tOptional(tString),
      harPath: tOptional(tString),
      resourcesDir: tOptional(tString)
    });
    scheme.CDPSessionInitializer = tOptional(tObject({}));
    scheme.CDPSessionEventEvent = tObject({
      method: tString,
      params: tOptional(tAny)
    });
    scheme.CDPSessionCloseEvent = tOptional(tObject({}));
    scheme.CDPSessionSendParams = tObject({
      method: tString,
      params: tOptional(tAny)
    });
    scheme.CDPSessionSendResult = tObject({
      result: tAny
    });
    scheme.CDPSessionDetachParams = tOptional(tObject({}));
    scheme.CDPSessionDetachResult = tOptional(tObject({}));
    scheme.BindingCallInitializer = tObject({
      frame: tChannel(["Frame"]),
      name: tString,
      args: tArray(tType("SerializedValue"))
    });
    scheme.BindingCallRejectParams = tObject({
      error: tType("SerializedError")
    });
    scheme.BindingCallRejectResult = tOptional(tObject({}));
    scheme.BindingCallResolveParams = tObject({
      result: tType("SerializedArgument")
    });
    scheme.BindingCallResolveResult = tOptional(tObject({}));
    scheme.DebuggerInitializer = tOptional(tObject({}));
    scheme.DebuggerPausedStateChangedEvent = tObject({
      pausedDetails: tOptional(tObject({
        location: tObject({
          file: tString,
          line: tOptional(tInt),
          column: tOptional(tInt)
        }),
        title: tString,
        stack: tOptional(tString)
      }))
    });
    scheme.DebuggerRequestPauseParams = tOptional(tObject({}));
    scheme.DebuggerRequestPauseResult = tOptional(tObject({}));
    scheme.DebuggerResumeParams = tOptional(tObject({}));
    scheme.DebuggerResumeResult = tOptional(tObject({}));
    scheme.DebuggerNextParams = tOptional(tObject({}));
    scheme.DebuggerNextResult = tOptional(tObject({}));
    scheme.DebuggerRunToParams = tObject({
      location: tObject({
        file: tString,
        line: tOptional(tInt),
        column: tOptional(tInt)
      })
    });
    scheme.DebuggerRunToResult = tOptional(tObject({}));
    scheme.DialogInitializer = tObject({
      page: tOptional(tChannel(["Page"])),
      type: tString,
      message: tString,
      defaultValue: tString
    });
    scheme.DialogAcceptParams = tObject({
      promptText: tOptional(tString)
    });
    scheme.DialogAcceptResult = tOptional(tObject({}));
    scheme.DialogDismissParams = tOptional(tObject({}));
    scheme.DialogDismissResult = tOptional(tObject({}));
    scheme.SerializedValue = tObject({
      n: tOptional(tFloat),
      b: tOptional(tBoolean),
      s: tOptional(tString),
      v: tOptional(tEnum(["null", "undefined", "NaN", "Infinity", "-Infinity", "-0"])),
      d: tOptional(tString),
      u: tOptional(tString),
      bi: tOptional(tString),
      ta: tOptional(tObject({
        b: tBinary,
        k: tEnum(["i8", "ui8", "ui8c", "i16", "ui16", "i32", "ui32", "f32", "f64", "bi64", "bui64"])
      })),
      e: tOptional(tObject({
        m: tString,
        n: tString,
        s: tString
      })),
      r: tOptional(tObject({
        p: tString,
        f: tString
      })),
      a: tOptional(tArray(tType("SerializedValue"))),
      o: tOptional(tArray(tObject({
        k: tString,
        v: tType("SerializedValue")
      }))),
      h: tOptional(tInt),
      id: tOptional(tInt),
      ref: tOptional(tInt)
    });
    scheme.SerializedArgument = tObject({
      value: tType("SerializedValue"),
      handles: tArray(tChannel("*"))
    });
    scheme.SerializedError = tObject({
      error: tOptional(tObject({
        message: tString,
        name: tString,
        stack: tOptional(tString)
      })),
      value: tOptional(tType("SerializedValue"))
    });
    scheme.StackFrame = tObject({
      file: tString,
      line: tInt,
      column: tInt,
      function: tOptional(tString)
    });
    scheme.VirtualCredential = tObject({
      id: tString,
      rpId: tString,
      userHandle: tString,
      privateKey: tString,
      publicKey: tString
    });
    scheme.Point = tObject({
      x: tFloat,
      y: tFloat
    });
    scheme.Rect = tObject({
      x: tFloat,
      y: tFloat,
      width: tFloat,
      height: tFloat
    });
    scheme.URLPattern = tObject({
      hash: tString,
      hostname: tString,
      password: tString,
      pathname: tString,
      port: tString,
      protocol: tString,
      search: tString,
      username: tString
    });
    scheme.NameValue = tObject({
      name: tString,
      value: tString
    });
    scheme.TracingInitializer = tOptional(tObject({}));
    scheme.TracingTracingStartParams = tObject({
      name: tOptional(tString),
      snapshots: tOptional(tBoolean),
      screenshots: tOptional(tBoolean),
      live: tOptional(tBoolean)
    });
    scheme.TracingTracingStartResult = tOptional(tObject({}));
    scheme.TracingTracingStartChunkParams = tObject({
      name: tOptional(tString),
      title: tOptional(tString)
    });
    scheme.TracingTracingStartChunkResult = tObject({
      traceName: tString
    });
    scheme.TracingTracingGroupParams = tObject({
      name: tString,
      location: tOptional(tObject({
        file: tString,
        line: tOptional(tInt),
        column: tOptional(tInt)
      }))
    });
    scheme.TracingTracingGroupResult = tOptional(tObject({}));
    scheme.TracingTracingGroupEndParams = tOptional(tObject({}));
    scheme.TracingTracingGroupEndResult = tOptional(tObject({}));
    scheme.TracingTracingStopChunkParams = tObject({
      mode: tEnum(["archive", "discard", "entries"])
    });
    scheme.TracingTracingStopChunkResult = tObject({
      artifact: tOptional(tChannel(["Artifact"])),
      entries: tOptional(tArray(tType("NameValue")))
    });
    scheme.TracingTracingStopParams = tOptional(tObject({}));
    scheme.TracingTracingStopResult = tOptional(tObject({}));
    scheme.TracingHarStartParams = tObject({
      page: tOptional(tChannel(["Page"])),
      options: tType("RecordHarOptions")
    });
    scheme.TracingHarStartResult = tObject({
      harId: tString
    });
    scheme.TracingHarExportParams = tObject({
      harId: tOptional(tString),
      mode: tEnum(["archive", "entries"])
    });
    scheme.TracingHarExportResult = tObject({
      artifact: tOptional(tChannel(["Artifact"])),
      entries: tOptional(tArray(tType("NameValue")))
    });
    scheme.WorkerInitializer = tObject({
      url: tString
    });
    scheme.WorkerConsoleEvent = tObject({
      type: tString,
      text: tString,
      args: tArray(tChannel(["ElementHandle", "JSHandle"])),
      location: tObject({
        url: tString,
        lineNumber: tInt,
        columnNumber: tInt
      }),
      timestamp: tFloat
    });
    scheme.WorkerCloseEvent = tOptional(tObject({}));
    scheme.WorkerDisconnectParams = tObject({
      reason: tOptional(tString)
    });
    scheme.WorkerDisconnectResult = tOptional(tObject({}));
    scheme.WorkerEvaluateExpressionParams = tObject({
      expression: tString,
      isFunction: tOptional(tBoolean),
      arg: tType("SerializedArgument")
    });
    scheme.WorkerEvaluateExpressionResult = tObject({
      value: tType("SerializedValue")
    });
    scheme.WorkerEvaluateExpressionHandleParams = tObject({
      expression: tString,
      isFunction: tOptional(tBoolean),
      arg: tType("SerializedArgument")
    });
    scheme.WorkerEvaluateExpressionHandleResult = tObject({
      handle: tChannel(["ElementHandle", "JSHandle"])
    });
    scheme.WorkerUpdateSubscriptionParams = tObject({
      event: tEnum(["console"]),
      enabled: tBoolean
    });
    scheme.WorkerUpdateSubscriptionResult = tOptional(tObject({}));
  }
});

// packages/playwright-core/src/server/protocolError.ts
function isProtocolError(e) {
  return e instanceof ProtocolError;
}
function isSessionClosedError(e) {
  return e instanceof ProtocolError && (e.type === "closed" || e.type === "crashed");
}
var ProtocolError;
var init_protocolError = __esm({
  "packages/playwright-core/src/server/protocolError.ts"() {
    "use strict";
    init_stackTrace();
    ProtocolError = class extends Error {
      constructor(type3, method, logs) {
        super();
        this.type = type3;
        this.method = method;
        this.logs = logs;
      }
      setMessage(message) {
        rewriteErrorMessage(this, `Protocol error (${this.method}): ${message}`);
      }
      browserLogMessage() {
        return this.logs ? "\nBrowser logs:\n" + this.logs : "";
      }
    };
  }
});

// packages/playwright-core/src/server/callLog.ts
function compressCallLog(log2) {
  const lines = [];
  for (const block of findRepeatedSubsequences(log2)) {
    for (let i = 0; i < block.sequence.length; i++) {
      const line = block.sequence[i];
      const leadingWhitespace = line.match(/^\s*/);
      const whitespacePrefix = "  " + leadingWhitespace?.[0] || "";
      const countPrefix = `${block.count} \xD7 `;
      if (block.count > 1 && i === 0)
        lines.push(whitespacePrefix + countPrefix + line.trim());
      else if (block.count > 1)
        lines.push(whitespacePrefix + " ".repeat(countPrefix.length - 2) + "- " + line.trim());
      else
        lines.push(whitespacePrefix + "- " + line.trim());
    }
  }
  return lines;
}
function findRepeatedSubsequences(s) {
  const n = s.length;
  const result2 = [];
  let i = 0;
  const arraysEqual = (a1, a2) => {
    if (a1.length !== a2.length)
      return false;
    for (let j = 0; j < a1.length; j++) {
      if (a1[j] !== a2[j])
        return false;
    }
    return true;
  };
  while (i < n) {
    let maxRepeatCount = 1;
    let maxRepeatSubstr = [s[i]];
    let maxRepeatLength = 1;
    for (let p = 1; p <= n - i; p++) {
      const substr = s.slice(i, i + p);
      let k = 1;
      while (i + p * k <= n && arraysEqual(s.slice(i + p * (k - 1), i + p * k), substr))
        k += 1;
      k -= 1;
      if (k > 1 && k * p > maxRepeatCount * maxRepeatLength) {
        maxRepeatCount = k;
        maxRepeatSubstr = substr;
        maxRepeatLength = p;
      }
    }
    result2.push({ sequence: maxRepeatSubstr, count: maxRepeatCount });
    i += maxRepeatLength * maxRepeatCount;
  }
  return result2;
}
var findRepeatedSubsequencesForTest;
var init_callLog = __esm({
  "packages/playwright-core/src/server/callLog.ts"() {
    "use strict";
    findRepeatedSubsequencesForTest = findRepeatedSubsequences;
  }
});

// packages/playwright-core/src/server/dispatchers/dispatcher.ts
function setMaxDispatchersForTest(value2) {
  maxDispatchersOverride = value2;
}
function maxDispatchersForBucket(gcBucket) {
  return maxDispatchersOverride ?? {
    "JSHandle": 1e5,
    "ElementHandle": 1e5
  }[gcBucket] ?? 1e4;
}
var import_events5, metadataValidator, waitInfoValidator, maxDispatchersOverride, Dispatcher, RootDispatcher, DispatcherConnection;
var init_dispatcher = __esm({
  "packages/playwright-core/src/server/dispatchers/dispatcher.ts"() {
    "use strict";
    import_events5 = require("events");
    init_protocolMetainfo();
    init_eventsHelper();
    init_debug();
    init_assert();
    init_time();
    init_stackTrace();
    init_validator();
    init_errors();
    init_instrumentation();
    init_protocolError();
    init_callLog();
    init_progress();
    metadataValidator = createMetadataValidator();
    waitInfoValidator = createWaitInfoValidator();
    Dispatcher = class extends import_events5.EventEmitter {
      constructor(parent, object, type3, initializer, gcBucket) {
        super();
        this._dispatchers = /* @__PURE__ */ new Map();
        this._disposed = false;
        this._eventListeners = [];
        this._activeProgressControllers = /* @__PURE__ */ new Set();
        this.connection = parent instanceof DispatcherConnection ? parent : parent.connection;
        this._parent = parent instanceof DispatcherConnection ? void 0 : parent;
        const guid = object.guid;
        this._guid = guid;
        this._type = type3;
        this._object = object;
        this._gcBucket = gcBucket ?? type3;
        this.connection.registerDispatcher(this);
        if (this._parent) {
          assert(!this._parent._dispatchers.has(guid));
          this._parent._dispatchers.set(guid, this);
        }
        if (this._parent)
          this.connection.sendCreate(this._parent, type3, guid, initializer);
        this.connection.maybeDisposeStaleDispatchers(this._gcBucket);
      }
      parentScope() {
        return this._parent;
      }
      addObjectListener(eventName, handler) {
        this._eventListeners.push(eventsHelper.addEventListener(this._object, eventName, handler));
      }
      adopt(child) {
        if (child._parent === this)
          return;
        const oldParent = child._parent;
        oldParent._dispatchers.delete(child._guid);
        this._dispatchers.set(child._guid, child);
        child._parent = this;
        this.connection.sendAdopt(this, child);
      }
      async _runCommand(callMetadata, method, validParams) {
        const controller = ProgressController.createForSdkObject(this._object, callMetadata);
        this._activeProgressControllers.add(controller);
        try {
          return await controller.run((progress2) => this[method](validParams, progress2), validParams?.timeout);
        } finally {
          this._activeProgressControllers.delete(controller);
        }
      }
      _dispatchEvent(method, params2) {
        if (this._disposed) {
          if (isUnderTest())
            throw new Error(`${this._guid} is sending "${String(method)}" event after being disposed`);
          return;
        }
        this.connection.sendEvent(this, method, params2);
      }
      _dispose(reason) {
        this._disposeRecursively(new TargetClosedError(this._object.closeReason()));
        this.connection.sendDispose(this, reason);
      }
      _onDispose() {
      }
      async stopPendingOperations(error) {
        const controllers = [];
        const collect = (dispatcher) => {
          controllers.push(...dispatcher._activeProgressControllers);
          for (const child of [...dispatcher._dispatchers.values()])
            collect(child);
        };
        collect(this);
        await Promise.all(controllers.map((controller) => controller.abort(error)));
      }
      _disposeRecursively(error) {
        assert(!this._disposed, `${this._guid} is disposed more than once`);
        this._onDispose();
        this._disposed = true;
        eventsHelper.removeEventListeners(this._eventListeners);
        this._parent?._dispatchers.delete(this._guid);
        const list = this.connection._dispatchersByBucket.get(this._gcBucket);
        list?.delete(this._guid);
        this.connection._dispatcherByGuid.delete(this._guid);
        this.connection._dispatcherByObject.delete(this._object);
        for (const dispatcher of [...this._dispatchers.values()])
          dispatcher._disposeRecursively(error);
        this._dispatchers.clear();
      }
      _debugScopeState() {
        return {
          _guid: this._guid,
          objects: Array.from(this._dispatchers.values()).map((o) => o._debugScopeState())
        };
      }
    };
    RootDispatcher = class extends Dispatcher {
      constructor(connection, createPlaywright2) {
        super(connection, createRootSdkObject(), "Root", {});
        this.createPlaywright = createPlaywright2;
        this._initialized = false;
      }
      async initialize(params2, progress2) {
        assert(this.createPlaywright);
        assert(!this._initialized);
        this._initialized = true;
        return {
          playwright: await progress2.race(this.createPlaywright(this, params2))
        };
      }
    };
    DispatcherConnection = class {
      constructor(isInProcess) {
        this._dispatcherByGuid = /* @__PURE__ */ new Map();
        this._dispatcherByObject = /* @__PURE__ */ new Map();
        this._dispatchersByBucket = /* @__PURE__ */ new Map();
        this.onmessage = (message) => {
        };
        this._waitOperations = /* @__PURE__ */ new Map();
        this._isInProcess = !!isInProcess;
      }
      sendEvent(dispatcher, event, params2) {
        const validator = findValidator(dispatcher._type, event, "Event");
        params2 = validator(params2, "", this._validatorToWireContext());
        this.onmessage({ guid: dispatcher._guid, method: event, params: params2 });
      }
      sendCreate(parent, type3, guid, initializer) {
        const validator = findValidator(type3, "", "Initializer");
        initializer = validator(initializer, "", this._validatorToWireContext());
        this.onmessage({ guid: parent._guid, method: "__create__", params: { type: type3, initializer, guid } });
      }
      sendAdopt(parent, dispatcher) {
        this.onmessage({ guid: parent._guid, method: "__adopt__", params: { guid: dispatcher._guid } });
      }
      sendDispose(dispatcher, reason) {
        this.onmessage({ guid: dispatcher._guid, method: "__dispose__", params: { reason } });
      }
      _validatorToWireContext() {
        return {
          tChannelImpl: this._tChannelImplToWire.bind(this),
          binary: this._isInProcess ? "buffer" : "toBase64",
          isUnderTest
        };
      }
      _validatorFromWireContext() {
        return {
          tChannelImpl: this._tChannelImplFromWire.bind(this),
          binary: this._isInProcess ? "buffer" : "fromBase64",
          isUnderTest
        };
      }
      _tChannelImplFromWire(names, arg, path59, context2) {
        if (arg && typeof arg === "object" && typeof arg.guid === "string") {
          const guid = arg.guid;
          const dispatcher = this._dispatcherByGuid.get(guid);
          if (!dispatcher)
            throw new ValidationError(`${path59}: no object with guid ${guid}`);
          if (names !== "*" && !names.includes(dispatcher._type))
            throw new ValidationError(`${path59}: object with guid ${guid} has type ${dispatcher._type}, expected ${names.toString()}`);
          return dispatcher;
        }
        throw new ValidationError(`${path59}: expected guid for ${names.toString()}`);
      }
      _tChannelImplToWire(names, arg, path59, context2) {
        if (arg instanceof Dispatcher) {
          if (names !== "*" && !names.includes(arg._type))
            throw new ValidationError(`${path59}: dispatcher with guid ${arg._guid} has type ${arg._type}, expected ${names.toString()}`);
          return { guid: arg._guid };
        }
        throw new ValidationError(`${path59}: expected dispatcher ${names.toString()}`);
      }
      existingDispatcher(object) {
        return this._dispatcherByObject.get(object);
      }
      registerDispatcher(dispatcher) {
        assert(!this._dispatcherByGuid.has(dispatcher._guid));
        this._dispatcherByGuid.set(dispatcher._guid, dispatcher);
        this._dispatcherByObject.set(dispatcher._object, dispatcher);
        let list = this._dispatchersByBucket.get(dispatcher._gcBucket);
        if (!list) {
          list = /* @__PURE__ */ new Set();
          this._dispatchersByBucket.set(dispatcher._gcBucket, list);
        }
        list.add(dispatcher._guid);
      }
      maybeDisposeStaleDispatchers(gcBucket) {
        const maxDispatchers = maxDispatchersForBucket(gcBucket);
        const list = this._dispatchersByBucket.get(gcBucket);
        if (!list || list.size <= maxDispatchers)
          return;
        const dispatchersArray = [...list];
        const disposeCount = maxDispatchers / 10 | 0;
        this._dispatchersByBucket.set(gcBucket, new Set(dispatchersArray.slice(disposeCount)));
        for (let i = 0; i < disposeCount; ++i) {
          const d = this._dispatcherByGuid.get(dispatchersArray[i]);
          if (!d)
            continue;
          d._dispose("gc");
        }
      }
      async dispatch(message) {
        const { id, guid, method, params: params2, metadata } = message;
        const dispatcher = this._dispatcherByGuid.get(guid);
        if (method === "__waitInfo__") {
          if (dispatcher)
            await this._dispatchWaitInfo(id, dispatcher, params2, metadata);
          return;
        }
        if (!dispatcher) {
          this.onmessage({ id, error: serializeError(new TargetClosedError(void 0)) });
          return;
        }
        let validParams;
        let validMetadata;
        try {
          const validator = findValidator(dispatcher._type, method, "Params");
          const validatorContext = this._validatorFromWireContext();
          validParams = validator(params2, "", validatorContext);
          validMetadata = metadataValidator(metadata, "", validatorContext);
          if (typeof dispatcher[method] !== "function")
            throw new Error(`Mismatching dispatcher: "${dispatcher._type}" does not implement "${method}"`);
        } catch (e) {
          this.onmessage({ id, error: serializeError(e) });
          return;
        }
        const metainfo = getMetainfo({ type: dispatcher._type, method });
        if (metainfo?.internal) {
          validMetadata.internal = true;
        }
        const sdkObject = dispatcher._object;
        const callMetadata = {
          id: `call@${id}`,
          location: validMetadata.location,
          title: validMetadata.title,
          internal: validMetadata.internal,
          stepId: validMetadata.stepId,
          objectId: sdkObject.guid,
          pageId: sdkObject.attribution?.page?.guid,
          frameId: sdkObject.attribution?.frame?.guid,
          startTime: monotonicTime(),
          endTime: 0,
          type: dispatcher._type,
          method,
          params: params2 || {},
          log: []
        };
        await sdkObject.instrumentation.onBeforeCall(sdkObject, callMetadata);
        const response2 = { id };
        try {
          if (this._dispatcherByGuid.get(guid) !== dispatcher)
            throw new TargetClosedError(sdkObject.closeReason());
          const result2 = await dispatcher._runCommand(callMetadata, method, validParams);
          const validator = findValidator(dispatcher._type, method, "Result");
          response2.result = validator(result2, "", this._validatorToWireContext());
          callMetadata.result = result2;
        } catch (e) {
          if (isTargetClosedError(e)) {
            const reason = sdkObject.closeReason();
            if (reason)
              rewriteErrorMessage(e, reason);
          } else if (isProtocolError(e)) {
            if (e.type === "closed")
              e = new TargetClosedError(sdkObject.closeReason(), e.browserLogMessage());
            else if (e.type === "crashed")
              rewriteErrorMessage(e, "Target crashed " + e.browserLogMessage());
          }
          response2.error = serializeError(e);
          const detailsValidator = maybeFindValidator(dispatcher._type, method, "ErrorDetails");
          if (detailsValidator)
            response2.errorDetails = detailsValidator(e?.details ?? {}, "", this._validatorToWireContext());
          callMetadata.error = response2.error;
        } finally {
          callMetadata.endTime = monotonicTime();
          await sdkObject.instrumentation.onAfterCall(sdkObject, callMetadata);
          if (metainfo?.slowMo)
            await this._doSlowMo(sdkObject);
        }
        if (response2.error)
          response2.log = compressCallLog(callMetadata.log);
        this.onmessage(response2);
      }
      async _doSlowMo(sdkObject) {
        const slowMo = sdkObject.attribution.browser?.options.slowMo;
        if (slowMo)
          await new Promise((f) => setTimeout(f, slowMo));
      }
      async _dispatchWaitInfo(id, dispatcher, params2, metadata) {
        let info;
        let validMetadata;
        try {
          const validatorContext = this._validatorFromWireContext();
          info = waitInfoValidator(params2, "", validatorContext);
          validMetadata = metadataValidator(metadata, "", validatorContext);
        } catch {
          return;
        }
        const sdkObject = dispatcher._object;
        if (info.phase === "before") {
          const callMetadata = {
            id: `call@${id}`,
            location: validMetadata.location,
            title: validMetadata.title,
            internal: validMetadata.internal,
            stepId: validMetadata.stepId,
            objectId: sdkObject.guid,
            pageId: sdkObject.attribution?.page?.guid,
            frameId: sdkObject.attribution?.frame?.guid,
            startTime: monotonicTime(),
            endTime: 0,
            type: dispatcher._type,
            method: "__waitInfo__",
            params: params2 || {},
            log: []
          };
          this._waitOperations.set(info.waitId, callMetadata);
          await sdkObject.instrumentation.onBeforeCall(sdkObject, callMetadata).catch(() => {
          });
          return;
        }
        const originalMetadata = this._waitOperations.get(info.waitId);
        if (!originalMetadata)
          return;
        if (info.phase === "log" && info.message) {
          originalMetadata.log.push(info.message);
          sdkObject.instrumentation.onCallLog(sdkObject, originalMetadata, "api", info.message);
          return;
        }
        if (info.phase === "after") {
          originalMetadata.endTime = monotonicTime();
          originalMetadata.error = info.error ? { error: { name: "Error", message: info.error } } : void 0;
          this._waitOperations.delete(info.waitId);
          await sdkObject.instrumentation.onAfterCall(sdkObject, originalMetadata).catch(() => {
          });
        }
      }
    };
  }
});

// packages/isomorphic/utilityScriptSerializers.ts
function isRegExp5(obj) {
  try {
    return obj instanceof RegExp || Object.prototype.toString.call(obj) === "[object RegExp]";
  } catch (error) {
    return false;
  }
}
function isDate2(obj) {
  try {
    return obj instanceof Date || Object.prototype.toString.call(obj) === "[object Date]";
  } catch (error) {
    return false;
  }
}
function isURL2(obj) {
  try {
    return obj instanceof URL || Object.prototype.toString.call(obj) === "[object URL]";
  } catch (error) {
    return false;
  }
}
function isError3(obj) {
  try {
    return obj instanceof Error || obj && Object.getPrototypeOf(obj)?.name === "Error";
  } catch (error) {
    return false;
  }
}
function isTypedArray(obj, constructor) {
  try {
    return obj instanceof constructor || Object.prototype.toString.call(obj) === `[object ${constructor.name}]`;
  } catch (error) {
    return false;
  }
}
function isArrayBuffer(obj) {
  try {
    return obj instanceof ArrayBuffer || Object.prototype.toString.call(obj) === "[object ArrayBuffer]";
  } catch (error) {
    return false;
  }
}
function typedArrayToBase64(array) {
  if ("toBase64" in array)
    return array.toBase64();
  const binary = Array.from(new Uint8Array(array.buffer, array.byteOffset, array.byteLength)).map((b) => String.fromCharCode(b)).join("");
  return btoa(binary);
}
function base64ToTypedArray(base64, TypedArrayConstructor) {
  const binary = atob(base64);
  const bytes = new Uint8Array(binary.length);
  for (let i = 0; i < binary.length; i++)
    bytes[i] = binary.charCodeAt(i);
  return new TypedArrayConstructor(bytes.buffer);
}
function parseEvaluationResultValue(value2, handles = [], refs = /* @__PURE__ */ new Map()) {
  if (Object.is(value2, void 0))
    return void 0;
  if (typeof value2 === "object" && value2) {
    if ("ref" in value2)
      return refs.get(value2.ref);
    if ("v" in value2) {
      if (value2.v === "undefined")
        return void 0;
      if (value2.v === "null")
        return null;
      if (value2.v === "NaN")
        return NaN;
      if (value2.v === "Infinity")
        return Infinity;
      if (value2.v === "-Infinity")
        return -Infinity;
      if (value2.v === "-0")
        return -0;
      return void 0;
    }
    if ("d" in value2) {
      return new Date(value2.d);
    }
    if ("u" in value2)
      return new URL(value2.u);
    if ("bi" in value2)
      return BigInt(value2.bi);
    if ("e" in value2) {
      const error = new Error(value2.e.m);
      error.name = value2.e.n;
      error.stack = value2.e.s;
      return error;
    }
    if ("r" in value2)
      return new RegExp(value2.r.p, value2.r.f);
    if ("a" in value2) {
      const result2 = [];
      refs.set(value2.id, result2);
      for (const a of value2.a)
        result2.push(parseEvaluationResultValue(a, handles, refs));
      return result2;
    }
    if ("o" in value2) {
      const result2 = {};
      refs.set(value2.id, result2);
      for (const { k, v } of value2.o) {
        if (k === "__proto__")
          continue;
        result2[k] = parseEvaluationResultValue(v, handles, refs);
      }
      return result2;
    }
    if ("h" in value2)
      return handles[value2.h];
    if ("ta" in value2)
      return base64ToTypedArray(value2.ta.b, typedArrayConstructors[value2.ta.k]);
    if ("ab" in value2)
      return base64ToTypedArray(value2.ab.b, Uint8Array).buffer;
  }
  return value2;
}
function serializeAsCallArgument(value2, handleSerializer) {
  return serialize(value2, handleSerializer, { visited: /* @__PURE__ */ new Map(), lastId: 0 });
}
function serialize(value2, handleSerializer, visitorInfo) {
  if (value2 && typeof value2 === "object") {
    if (typeof globalThis.Window === "function" && value2 instanceof globalThis.Window)
      return "ref: <Window>";
    if (typeof globalThis.Document === "function" && value2 instanceof globalThis.Document)
      return "ref: <Document>";
    if (typeof globalThis.Node === "function" && value2 instanceof globalThis.Node)
      return "ref: <Node>";
  }
  return innerSerialize(value2, handleSerializer, visitorInfo);
}
function innerSerialize(value2, handleSerializer, visitorInfo) {
  const result2 = handleSerializer(value2);
  if ("fallThrough" in result2)
    value2 = result2.fallThrough;
  else
    return result2;
  if (typeof value2 === "symbol")
    return { v: "undefined" };
  if (Object.is(value2, void 0))
    return { v: "undefined" };
  if (Object.is(value2, null))
    return { v: "null" };
  if (Object.is(value2, NaN))
    return { v: "NaN" };
  if (Object.is(value2, Infinity))
    return { v: "Infinity" };
  if (Object.is(value2, -Infinity))
    return { v: "-Infinity" };
  if (Object.is(value2, -0))
    return { v: "-0" };
  if (typeof value2 === "boolean")
    return value2;
  if (typeof value2 === "number")
    return value2;
  if (typeof value2 === "string")
    return value2;
  if (typeof value2 === "bigint")
    return { bi: value2.toString() };
  if (isError3(value2)) {
    let stack;
    if (value2.stack?.startsWith(value2.name + ": " + value2.message)) {
      stack = value2.stack;
    } else {
      stack = `${value2.name}: ${value2.message}
${value2.stack}`;
    }
    return { e: { n: value2.name, m: value2.message, s: stack } };
  }
  if (isDate2(value2))
    return { d: value2.toJSON() };
  if (isURL2(value2))
    return { u: value2.toJSON() };
  if (isRegExp5(value2))
    return { r: { p: value2.source, f: value2.flags } };
  for (const [k, ctor] of Object.entries(typedArrayConstructors)) {
    if (isTypedArray(value2, ctor))
      return { ta: { b: typedArrayToBase64(value2), k } };
  }
  if (isArrayBuffer(value2))
    return { ab: { b: typedArrayToBase64(new Uint8Array(value2)) } };
  const id = visitorInfo.visited.get(value2);
  if (id)
    return { ref: id };
  if (Array.isArray(value2)) {
    const a = [];
    const id2 = ++visitorInfo.lastId;
    visitorInfo.visited.set(value2, id2);
    for (let i = 0; i < value2.length; ++i)
      a.push(serialize(value2[i], handleSerializer, visitorInfo));
    return { a, id: id2 };
  }
  if (typeof value2 === "object") {
    const o = [];
    const id2 = ++visitorInfo.lastId;
    visitorInfo.visited.set(value2, id2);
    for (const name of Object.keys(value2)) {
      let item;
      try {
        item = value2[name];
      } catch (e) {
        continue;
      }
      if (name === "toJSON" && typeof item === "function")
        o.push({ k: name, v: { o: [], id: 0 } });
      else
        o.push({ k: name, v: serialize(item, handleSerializer, visitorInfo) });
    }
    let jsonWrapper;
    try {
      if (o.length === 0 && value2.toJSON && typeof value2.toJSON === "function")
        jsonWrapper = { value: value2.toJSON() };
    } catch (e) {
    }
    if (jsonWrapper)
      return innerSerialize(jsonWrapper.value, handleSerializer, visitorInfo);
    return { o, id: id2 };
  }
}
var typedArrayConstructors;
var init_utilityScriptSerializers = __esm({
  "packages/isomorphic/utilityScriptSerializers.ts"() {
    "use strict";
    typedArrayConstructors = {
      i8: Int8Array,
      ui8: Uint8Array,
      ui8c: Uint8ClampedArray,
      i16: Int16Array,
      ui16: Uint16Array,
      i32: Int32Array,
      ui32: Uint32Array,
      // TODO: add Float16Array once it's in baseline
      f32: Float32Array,
      f64: Float64Array,
      bi64: BigInt64Array,
      bui64: BigUint64Array
    };
  }
});

// packages/playwright-core/src/generated/utilityScriptSource.ts
var source3;
var init_utilityScriptSource = __esm({
  "packages/playwright-core/src/generated/utilityScriptSource.ts"() {
    "use strict";
    source3 = '\nvar __commonJS = obj => {\n  let required = false;\n  let result;\n  return function __require() {\n    if (!required) {\n      required = true;\n      let fn;\n      for (const name in obj) { fn = obj[name]; break; }\n      const module = { exports: {} };\n      fn(module.exports, module);\n      result = module.exports;\n    }\n    return result;\n  }\n};\nvar __export = (target, all) => {for (var name in all) target[name] = all[name];};\nvar __toESM = mod => ({ ...mod, \'default\': mod });\nvar __toCommonJS = mod => ({ ...mod, __esModule: true });\n\n\n// packages/injected/src/utilityScript.ts\nvar utilityScript_exports = {};\n__export(utilityScript_exports, {\n  UtilityScript: () => UtilityScript\n});\nmodule.exports = __toCommonJS(utilityScript_exports);\n\n// packages/isomorphic/utilityScriptSerializers.ts\nfunction isRegExp(obj) {\n  try {\n    return obj instanceof RegExp || Object.prototype.toString.call(obj) === "[object RegExp]";\n  } catch (error) {\n    return false;\n  }\n}\nfunction isDate(obj) {\n  try {\n    return obj instanceof Date || Object.prototype.toString.call(obj) === "[object Date]";\n  } catch (error) {\n    return false;\n  }\n}\nfunction isURL(obj) {\n  try {\n    return obj instanceof URL || Object.prototype.toString.call(obj) === "[object URL]";\n  } catch (error) {\n    return false;\n  }\n}\nfunction isError(obj) {\n  var _a;\n  try {\n    return obj instanceof Error || obj && ((_a = Object.getPrototypeOf(obj)) == null ? void 0 : _a.name) === "Error";\n  } catch (error) {\n    return false;\n  }\n}\nfunction isTypedArray(obj, constructor) {\n  try {\n    return obj instanceof constructor || Object.prototype.toString.call(obj) === `[object ${constructor.name}]`;\n  } catch (error) {\n    return false;\n  }\n}\nfunction isArrayBuffer(obj) {\n  try {\n    return obj instanceof ArrayBuffer || Object.prototype.toString.call(obj) === "[object ArrayBuffer]";\n  } catch (error) {\n    return false;\n  }\n}\nvar typedArrayConstructors = {\n  i8: Int8Array,\n  ui8: Uint8Array,\n  ui8c: Uint8ClampedArray,\n  i16: Int16Array,\n  ui16: Uint16Array,\n  i32: Int32Array,\n  ui32: Uint32Array,\n  // TODO: add Float16Array once it\'s in baseline\n  f32: Float32Array,\n  f64: Float64Array,\n  bi64: BigInt64Array,\n  bui64: BigUint64Array\n};\nfunction typedArrayToBase64(array) {\n  if ("toBase64" in array)\n    return array.toBase64();\n  const binary = Array.from(new Uint8Array(array.buffer, array.byteOffset, array.byteLength)).map((b) => String.fromCharCode(b)).join("");\n  return btoa(binary);\n}\nfunction base64ToTypedArray(base64, TypedArrayConstructor) {\n  const binary = atob(base64);\n  const bytes = new Uint8Array(binary.length);\n  for (let i = 0; i < binary.length; i++)\n    bytes[i] = binary.charCodeAt(i);\n  return new TypedArrayConstructor(bytes.buffer);\n}\nfunction parseEvaluationResultValue(value, handles = [], refs = /* @__PURE__ */ new Map()) {\n  if (Object.is(value, void 0))\n    return void 0;\n  if (typeof value === "object" && value) {\n    if ("ref" in value)\n      return refs.get(value.ref);\n    if ("v" in value) {\n      if (value.v === "undefined")\n        return void 0;\n      if (value.v === "null")\n        return null;\n      if (value.v === "NaN")\n        return NaN;\n      if (value.v === "Infinity")\n        return Infinity;\n      if (value.v === "-Infinity")\n        return -Infinity;\n      if (value.v === "-0")\n        return -0;\n      return void 0;\n    }\n    if ("d" in value) {\n      return new Date(value.d);\n    }\n    if ("u" in value)\n      return new URL(value.u);\n    if ("bi" in value)\n      return BigInt(value.bi);\n    if ("e" in value) {\n      const error = new Error(value.e.m);\n      error.name = value.e.n;\n      error.stack = value.e.s;\n      return error;\n    }\n    if ("r" in value)\n      return new RegExp(value.r.p, value.r.f);\n    if ("a" in value) {\n      const result = [];\n      refs.set(value.id, result);\n      for (const a of value.a)\n        result.push(parseEvaluationResultValue(a, handles, refs));\n      return result;\n    }\n    if ("o" in value) {\n      const result = {};\n      refs.set(value.id, result);\n      for (const { k, v } of value.o) {\n        if (k === "__proto__")\n          continue;\n        result[k] = parseEvaluationResultValue(v, handles, refs);\n      }\n      return result;\n    }\n    if ("h" in value)\n      return handles[value.h];\n    if ("ta" in value)\n      return base64ToTypedArray(value.ta.b, typedArrayConstructors[value.ta.k]);\n    if ("ab" in value)\n      return base64ToTypedArray(value.ab.b, Uint8Array).buffer;\n  }\n  return value;\n}\nfunction serializeAsCallArgument(value, handleSerializer) {\n  return serialize(value, handleSerializer, { visited: /* @__PURE__ */ new Map(), lastId: 0 });\n}\nfunction serialize(value, handleSerializer, visitorInfo) {\n  if (value && typeof value === "object") {\n    if (typeof globalThis.Window === "function" && value instanceof globalThis.Window)\n      return "ref: <Window>";\n    if (typeof globalThis.Document === "function" && value instanceof globalThis.Document)\n      return "ref: <Document>";\n    if (typeof globalThis.Node === "function" && value instanceof globalThis.Node)\n      return "ref: <Node>";\n  }\n  return innerSerialize(value, handleSerializer, visitorInfo);\n}\nfunction innerSerialize(value, handleSerializer, visitorInfo) {\n  var _a;\n  const result = handleSerializer(value);\n  if ("fallThrough" in result)\n    value = result.fallThrough;\n  else\n    return result;\n  if (typeof value === "symbol")\n    return { v: "undefined" };\n  if (Object.is(value, void 0))\n    return { v: "undefined" };\n  if (Object.is(value, null))\n    return { v: "null" };\n  if (Object.is(value, NaN))\n    return { v: "NaN" };\n  if (Object.is(value, Infinity))\n    return { v: "Infinity" };\n  if (Object.is(value, -Infinity))\n    return { v: "-Infinity" };\n  if (Object.is(value, -0))\n    return { v: "-0" };\n  if (typeof value === "boolean")\n    return value;\n  if (typeof value === "number")\n    return value;\n  if (typeof value === "string")\n    return value;\n  if (typeof value === "bigint")\n    return { bi: value.toString() };\n  if (isError(value)) {\n    let stack;\n    if ((_a = value.stack) == null ? void 0 : _a.startsWith(value.name + ": " + value.message)) {\n      stack = value.stack;\n    } else {\n      stack = `${value.name}: ${value.message}\n${value.stack}`;\n    }\n    return { e: { n: value.name, m: value.message, s: stack } };\n  }\n  if (isDate(value))\n    return { d: value.toJSON() };\n  if (isURL(value))\n    return { u: value.toJSON() };\n  if (isRegExp(value))\n    return { r: { p: value.source, f: value.flags } };\n  for (const [k, ctor] of Object.entries(typedArrayConstructors)) {\n    if (isTypedArray(value, ctor))\n      return { ta: { b: typedArrayToBase64(value), k } };\n  }\n  if (isArrayBuffer(value))\n    return { ab: { b: typedArrayToBase64(new Uint8Array(value)) } };\n  const id = visitorInfo.visited.get(value);\n  if (id)\n    return { ref: id };\n  if (Array.isArray(value)) {\n    const a = [];\n    const id2 = ++visitorInfo.lastId;\n    visitorInfo.visited.set(value, id2);\n    for (let i = 0; i < value.length; ++i)\n      a.push(serialize(value[i], handleSerializer, visitorInfo));\n    return { a, id: id2 };\n  }\n  if (typeof value === "object") {\n    const o = [];\n    const id2 = ++visitorInfo.lastId;\n    visitorInfo.visited.set(value, id2);\n    for (const name of Object.keys(value)) {\n      let item;\n      try {\n        item = value[name];\n      } catch (e) {\n        continue;\n      }\n      if (name === "toJSON" && typeof item === "function")\n        o.push({ k: name, v: { o: [], id: 0 } });\n      else\n        o.push({ k: name, v: serialize(item, handleSerializer, visitorInfo) });\n    }\n    let jsonWrapper;\n    try {\n      if (o.length === 0 && value.toJSON && typeof value.toJSON === "function")\n        jsonWrapper = { value: value.toJSON() };\n    } catch (e) {\n    }\n    if (jsonWrapper)\n      return innerSerialize(jsonWrapper.value, handleSerializer, visitorInfo);\n    return { o, id: id2 };\n  }\n}\n\n// packages/injected/src/utilityScript.ts\nvar UtilityScript = class {\n  constructor(global, isUnderTest) {\n    var _a, _b, _c, _d, _e, _f, _g, _h;\n    this.global = global;\n    this.isUnderTest = isUnderTest;\n    if (global.__pwClock) {\n      this.builtins = global.__pwClock.builtins;\n    } else {\n      this.builtins = {\n        setTimeout: (_a = global.setTimeout) == null ? void 0 : _a.bind(global),\n        clearTimeout: (_b = global.clearTimeout) == null ? void 0 : _b.bind(global),\n        setInterval: (_c = global.setInterval) == null ? void 0 : _c.bind(global),\n        clearInterval: (_d = global.clearInterval) == null ? void 0 : _d.bind(global),\n        requestAnimationFrame: (_e = global.requestAnimationFrame) == null ? void 0 : _e.bind(global),\n        cancelAnimationFrame: (_f = global.cancelAnimationFrame) == null ? void 0 : _f.bind(global),\n        requestIdleCallback: (_g = global.requestIdleCallback) == null ? void 0 : _g.bind(global),\n        cancelIdleCallback: (_h = global.cancelIdleCallback) == null ? void 0 : _h.bind(global),\n        performance: global.performance,\n        Intl: global.Intl,\n        Date: global.Date,\n        AbortSignal: global.AbortSignal\n      };\n    }\n    if (this.isUnderTest)\n      global.builtins = this.builtins;\n  }\n  evaluate(isFunction, returnByValue, expression, argCount, ...argsAndHandles) {\n    const args = argsAndHandles.slice(0, argCount);\n    const handles = argsAndHandles.slice(argCount);\n    const parameters = [];\n    for (let i = 0; i < args.length; i++)\n      parameters[i] = parseEvaluationResultValue(args[i], handles);\n    let result = this.global.eval(expression);\n    if (isFunction === true) {\n      result = result(...parameters);\n    } else if (isFunction === false) {\n      result = result;\n    } else {\n      if (typeof result === "function")\n        result = result(...parameters);\n    }\n    return returnByValue ? this._promiseAwareJsonValueNoThrow(result) : result;\n  }\n  jsonValue(returnByValue, value) {\n    if (value === void 0)\n      return void 0;\n    return serializeAsCallArgument(value, (value2) => ({ fallThrough: value2 }));\n  }\n  _promiseAwareJsonValueNoThrow(value) {\n    const safeJson = (value2) => {\n      try {\n        return this.jsonValue(true, value2);\n      } catch (e) {\n        return void 0;\n      }\n    };\n    if (value && typeof value === "object" && typeof value.then === "function") {\n      return (async () => {\n        const promiseValue = await value;\n        return safeJson(promiseValue);\n      })();\n    }\n    return safeJson(value);\n  }\n};\n';
  }
});

// packages/playwright-core/src/server/javascript.ts
async function evaluate(context2, returnByValue, pageFunction, ...args) {
  return evaluateExpression(context2, String(pageFunction), { returnByValue, isFunction: typeof pageFunction === "function" }, ...args);
}
async function evaluateExpression(context2, expression2, options, ...args) {
  expression2 = normalizeEvaluationExpression(expression2, options.isFunction);
  const handles = [];
  const toDispose = [];
  const pushHandle = (handle) => {
    handles.push(handle);
    return handles.length - 1;
  };
  args = args.map((arg) => serializeAsCallArgument(arg, (handle) => {
    if (handle instanceof JSHandle) {
      if (!handle._objectId)
        return { fallThrough: handle._value };
      if (handle._disposed)
        throw new JavaScriptErrorInEvaluate("JSHandle is disposed!");
      const adopted = context2.adoptIfNeeded(handle);
      if (adopted === null)
        return { h: pushHandle(Promise.resolve(handle)) };
      toDispose.push(adopted);
      return { h: pushHandle(adopted) };
    }
    return { fallThrough: handle };
  }));
  const utilityScriptObjects = [];
  for (const handle of await Promise.all(handles)) {
    if (handle._context !== context2)
      throw new JavaScriptErrorInEvaluate("JSHandles can be evaluated only in the context they were created!");
    utilityScriptObjects.push(handle);
  }
  const utilityScriptValues = [options.isFunction, options.returnByValue, expression2, args.length, ...args];
  const script = `(utilityScript, ...args) => utilityScript.evaluate(...args)`;
  try {
    return await context2._evaluateWithArguments(script, options.returnByValue || false, utilityScriptValues, utilityScriptObjects);
  } finally {
    toDispose.map((handlePromise) => handlePromise.then((handle) => handle.dispose()));
  }
}
function parseUnserializableValue(unserializableValue) {
  if (unserializableValue === "NaN")
    return NaN;
  if (unserializableValue === "Infinity")
    return Infinity;
  if (unserializableValue === "-Infinity")
    return -Infinity;
  if (unserializableValue === "-0")
    return -0;
}
function normalizeEvaluationExpression(expression2, isFunction2) {
  expression2 = expression2.trim();
  if (isFunction2) {
    try {
      new Function("(" + expression2 + ")");
    } catch (e1) {
      if (expression2.startsWith("async "))
        expression2 = "async function " + expression2.substring("async ".length);
      else
        expression2 = "function " + expression2;
      try {
        new Function("(" + expression2 + ")");
      } catch (e2) {
        throw new Error("Passed function is not well-serializable!");
      }
    }
  }
  if (/^(async)?\s*function(\s|\()/.test(expression2))
    expression2 = "(" + expression2 + ")";
  return expression2;
}
function isJavaScriptErrorInEvaluate(error) {
  return error instanceof JavaScriptErrorInEvaluate;
}
function sparseArrayToString(entries) {
  const arrayEntries = [];
  for (const { name, value: value2 } of entries) {
    const index = +name;
    if (isNaN(index) || index < 0)
      continue;
    arrayEntries.push({ index, value: value2 });
  }
  arrayEntries.sort((a, b) => a.index - b.index);
  let lastIndex = -1;
  const tokens = [];
  for (const { index, value: value2 } of arrayEntries) {
    const emptyItems = index - lastIndex - 1;
    if (emptyItems === 1)
      tokens.push(`empty`);
    else if (emptyItems > 1)
      tokens.push(`empty x ${emptyItems}`);
    tokens.push(String(value2));
    lastIndex = index;
  }
  return "[" + tokens.join(", ") + "]";
}
var ExecutionContext, JSHandle, JavaScriptErrorInEvaluate, snapshottedFunctionBuiltins, snapshottedObjectBuiltins, snapshottedTimerBuiltins, saveGlobalsSnapshotSource, mainWorldGlobalsSnapshotSource;
var init_javascript = __esm({
  "packages/playwright-core/src/server/javascript.ts"() {
    "use strict";
    init_utilityScriptSerializers();
    init_manualPromise();
    init_debug();
    init_instrumentation();
    init_utilityScriptSource();
    ExecutionContext = class extends SdkObject {
      constructor(parent, delegate, worldNameForTest, options) {
        super(parent, "execution-context");
        this._contextDestroyedScope = new LongStandingScope();
        this.worldNameForTest = worldNameForTest;
        this._noUtilityWorld = options?.noUtilityWorld;
        this.delegate = delegate;
      }
      contextDestroyed(reason) {
        this._contextDestroyedScope.close(new Error(reason));
      }
      async raceAgainstContextDestroyed(promise) {
        return this._contextDestroyedScope.race(promise);
      }
      rawEvaluateJSON(expression2) {
        return this.raceAgainstContextDestroyed(this.delegate.rawEvaluateJSON(expression2));
      }
      rawEvaluateHandle(expression2) {
        return this.raceAgainstContextDestroyed(this.delegate.rawEvaluateHandle(this, expression2));
      }
      async _evaluateWithArguments(expression2, returnByValue, values, handles) {
        const utilityScript = await this._utilityScript();
        return this.raceAgainstContextDestroyed(this.delegate.evaluateWithArguments(expression2, returnByValue, utilityScript, values, handles));
      }
      getProperties(object) {
        return this.raceAgainstContextDestroyed(this.delegate.getProperties(object));
      }
      _releaseHandle(handle) {
        return this.delegate.releaseHandle(handle);
      }
      adoptIfNeeded(handle) {
        return null;
      }
      _utilityScript() {
        if (!this._utilityScriptPromise) {
          const globalsSnapshot = this._noUtilityWorld ? mainWorldGlobalsSnapshotSource : "";
          const source11 = `
      (() => {
        ${globalsSnapshot}
        const module = {};
        ${source3}
        return new (module.exports.UtilityScript())(globalThis, ${isUnderTest()});
      })();`;
          this._utilityScriptPromise = this.raceAgainstContextDestroyed(this.delegate.rawEvaluateHandle(this, source11)).then((handle) => {
            handle._setPreview("UtilityScript");
            return handle;
          });
        }
        return this._utilityScriptPromise;
      }
    };
    JSHandle = class extends SdkObject {
      constructor(context2, type3, preview, objectId, value2) {
        super(context2, "handle");
        this.__jshandle = true;
        this._disposed = false;
        this._context = context2;
        this._objectId = objectId;
        this._value = value2;
        this._objectType = type3;
        this._preview = this._objectId ? preview || `JSHandle@${this._objectType}` : String(value2);
        if (this._objectId && globalThis.leakedJSHandles)
          globalThis.leakedJSHandles.set(this, new Error("Leaked JSHandle"));
      }
      async evaluateExpression(progress2, expression2, options, arg) {
        return await progress2.race(this.internalEvaluateExpression(expression2, options, arg));
      }
      async evaluateExpressionHandle(progress2, expression2, options, arg) {
        return await progress2.race(this._evaluateExpressionHandle(expression2, options, arg));
      }
      async getProperty(progress2, propertyName) {
        return await progress2.race(this._getProperty(propertyName));
      }
      async getProperties(progress2) {
        return await progress2.race(this.internalGetProperties());
      }
      async jsonValue(progress2) {
        return await progress2.race(this._jsonValue());
      }
      async evaluate(pageFunction, arg) {
        return evaluate(this._context, true, pageFunction, this, arg);
      }
      async evaluateHandle(pageFunction, arg) {
        return evaluate(this._context, false, pageFunction, this, arg);
      }
      async internalEvaluateExpression(expression2, options, arg) {
        return await evaluateExpression(this._context, expression2, { ...options, returnByValue: true }, this, arg);
      }
      async _evaluateExpressionHandle(expression2, options, arg) {
        return await evaluateExpression(this._context, expression2, { ...options, returnByValue: false }, this, arg);
      }
      async _getProperty(propertyName) {
        const objectHandle = await this.evaluateHandle((object, propertyName2) => {
          const result3 = { __proto__: null };
          result3[propertyName2] = object[propertyName2];
          return result3;
        }, propertyName);
        const properties = await objectHandle.internalGetProperties();
        const result2 = properties.get(propertyName);
        objectHandle.dispose();
        return result2;
      }
      async internalGetProperties() {
        if (!this._objectId)
          return /* @__PURE__ */ new Map();
        return this._context.getProperties(this);
      }
      rawValue() {
        return this._value;
      }
      async _jsonValue() {
        if (!this._objectId)
          return this._value;
        const script = `(utilityScript, ...args) => utilityScript.jsonValue(...args)`;
        return this._context._evaluateWithArguments(script, true, [true], [this]);
      }
      asElement() {
        return null;
      }
      dispose() {
        if (this._disposed)
          return;
        this._disposed = true;
        if (this._objectId) {
          this._context._releaseHandle(this).catch((e) => {
          });
          if (globalThis.leakedJSHandles)
            globalThis.leakedJSHandles.delete(this);
        }
      }
      toString() {
        return this._preview;
      }
      _setPreviewCallback(callback) {
        this._previewCallback = callback;
      }
      preview() {
        return this._preview;
      }
      worldNameForTest() {
        return this._context.worldNameForTest;
      }
      _setPreview(preview) {
        this._preview = preview;
        if (this._previewCallback)
          this._previewCallback(preview);
      }
    };
    JavaScriptErrorInEvaluate = class extends Error {
    };
    snapshottedFunctionBuiltins = [
      // DOM
      "Node",
      "Element",
      "NodeFilter",
      "HTMLElement",
      "Document",
      "ShadowRoot",
      "MutationObserver",
      "Event",
      "CustomEvent",
      "EventTarget",
      // JS standard
      "Map",
      "Set",
      "WeakMap",
      "WeakSet",
      "Promise",
      "Symbol",
      "Error",
      "TypeError",
      "RegExp",
      "Array",
      "Object"
    ];
    snapshottedObjectBuiltins = ["JSON", "Math"];
    snapshottedTimerBuiltins = ["setTimeout"];
    saveGlobalsSnapshotSource = `window.__pwSnapshotGlobals = {
${[...snapshottedFunctionBuiltins, ...snapshottedObjectBuiltins, ...snapshottedTimerBuiltins].map((n) => `  ${n}: window.${n}`).join(",\n")}
};`;
    mainWorldGlobalsSnapshotSource = `
  const __snap = globalThis.__pwSnapshotGlobals || {};
${snapshottedFunctionBuiltins.map((n) => `  const ${n} = (typeof globalThis.${n} === 'function' ? globalThis.${n} : __snap.${n});`).join("\n")}
${snapshottedObjectBuiltins.map((n) => `  const ${n} = (typeof globalThis.${n} === 'object' && globalThis.${n} ? globalThis.${n} : __snap.${n});`).join("\n")}
`;
  }
});

// packages/playwright-core/src/server/fileUploadUtils.ts
async function filesExceedUploadLimit(files) {
  const sizes = await Promise.all(files.map(async (file) => (await import_fs13.default.promises.stat(file)).size));
  return sizes.reduce((total, size) => total + size, 0) >= fileUploadSizeLimit;
}
async function prepareFilesForUpload(frame, params2) {
  const { payloads, streams, directoryStream } = params2;
  let { localPaths, localDirectory } = params2;
  if (localPaths && !frame.attribution.playwright.options.isClientCollocatedWithServer)
    throw new Error("localPaths are not allowed when the client is not local");
  if ([payloads, localPaths, localDirectory, streams, directoryStream].filter(Boolean).length !== 1)
    throw new Error("Exactly one of payloads, localPaths and streams must be provided");
  if (streams)
    localPaths = streams.map((c) => c.path());
  if (directoryStream)
    localDirectory = directoryStream.path();
  if (localPaths) {
    for (const p of localPaths)
      assert(import_path12.default.isAbsolute(p) && import_path12.default.resolve(p) === p, "Paths provided to localPaths must be absolute and fully resolved.");
  }
  let fileBuffers = payloads;
  if (!frame._page.browserContext._browser._isBrowserCollocatedWithServer) {
    if (localPaths) {
      if (await filesExceedUploadLimit(localPaths))
        throw new Error("Cannot transfer files larger than 50Mb to a browser not co-located with the server");
      fileBuffers = await Promise.all(localPaths.map(async (item) => {
        return {
          name: import_path12.default.basename(item),
          buffer: await import_fs13.default.promises.readFile(item),
          lastModifiedMs: (await import_fs13.default.promises.stat(item)).mtimeMs
        };
      }));
      localPaths = void 0;
    }
  }
  const filePayloads = fileBuffers?.map((payload) => ({
    name: payload.name,
    mimeType: payload.mimeType || mime4.getType(payload.name) || "application/octet-stream",
    buffer: payload.buffer.toString("base64"),
    lastModifiedMs: payload.lastModifiedMs
  }));
  return { localPaths, localDirectory, filePayloads };
}
var import_fs13, import_path12, mime4, fileUploadSizeLimit;
var init_fileUploadUtils = __esm({
  "packages/playwright-core/src/server/fileUploadUtils.ts"() {
    "use strict";
    import_fs13 = __toESM(require("fs"));
    import_path12 = __toESM(require("path"));
    init_assert();
    mime4 = require("./utilsBundle").mime;
    fileUploadSizeLimit = 50 * 1024 * 1024;
  }
});

// packages/playwright-core/src/generated/injectedScriptSource.ts
var source4;
var init_injectedScriptSource = __esm({
  "packages/playwright-core/src/generated/injectedScriptSource.ts"() {
    "use strict";
    source4 = '\nvar __commonJS = obj => {\n  let required = false;\n  let result;\n  return function __require() {\n    if (!required) {\n      required = true;\n      let fn;\n      for (const name in obj) { fn = obj[name]; break; }\n      const module = { exports: {} };\n      fn(module.exports, module);\n      result = module.exports;\n    }\n    return result;\n  }\n};\nvar __export = (target, all) => {for (var name in all) target[name] = all[name];};\nvar __toESM = mod => ({ ...mod, \'default\': mod });\nvar __toCommonJS = mod => ({ ...mod, __esModule: true });\n\n\n// packages/injected/src/injectedScript.ts\nvar injectedScript_exports = {};\n__export(injectedScript_exports, {\n  InjectedScript: () => InjectedScript\n});\nmodule.exports = __toCommonJS(injectedScript_exports);\n\n// packages/isomorphic/ariaSnapshot.ts\nfunction ariaNodesEqual(a, b) {\n  if (a.role !== b.role || a.name !== b.name)\n    return false;\n  if (!ariaPropsEqual(a, b) || hasPointerCursor(a) !== hasPointerCursor(b))\n    return false;\n  const aKeys = Object.keys(a.props);\n  const bKeys = Object.keys(b.props);\n  return aKeys.length === bKeys.length && aKeys.every((k) => a.props[k] === b.props[k]);\n}\nfunction hasPointerCursor(ariaNode) {\n  return ariaNode.box.cursor === "pointer";\n}\nfunction ariaPropsEqual(a, b) {\n  return a.active === b.active && a.checked === b.checked && a.disabled === b.disabled && a.expanded === b.expanded && a.invalid === b.invalid && a.selected === b.selected && a.level === b.level && a.pressed === b.pressed;\n}\nfunction parseAriaSnapshot(yaml, text, options = {}) {\n  var _a;\n  const lineCounter = new yaml.LineCounter();\n  const parseOptions = {\n    keepSourceTokens: true,\n    lineCounter,\n    ...options\n  };\n  const yamlDoc = yaml.parseDocument(text, parseOptions);\n  const errors = [];\n  const convertRange = (range) => {\n    return [lineCounter.linePos(range[0]), lineCounter.linePos(range[1])];\n  };\n  const addError = (error) => {\n    errors.push({\n      message: error.message,\n      range: [lineCounter.linePos(error.pos[0]), lineCounter.linePos(error.pos[1])]\n    });\n  };\n  const convertSeq = (container, seq) => {\n    for (const item of seq.items) {\n      const itemIsString = item instanceof yaml.Scalar && typeof item.value === "string";\n      if (itemIsString) {\n        const childNode = KeyParser.parse(item, parseOptions, errors);\n        if (childNode) {\n          container.children = container.children || [];\n          container.children.push(childNode);\n        }\n        continue;\n      }\n      const itemIsMap = item instanceof yaml.YAMLMap;\n      if (itemIsMap) {\n        convertMap(container, item);\n        continue;\n      }\n      errors.push({\n        message: "Sequence items should be strings or maps",\n        range: convertRange(item.range || seq.range)\n      });\n    }\n  };\n  const convertMap = (container, map) => {\n    var _a2;\n    for (const entry of map.items) {\n      container.children = container.children || [];\n      const keyIsString = entry.key instanceof yaml.Scalar && typeof entry.key.value === "string";\n      if (!keyIsString) {\n        errors.push({\n          message: "Only string keys are supported",\n          range: convertRange(entry.key.range || map.range)\n        });\n        continue;\n      }\n      const key = entry.key;\n      const value = entry.value;\n      if (key.value === "text") {\n        const valueIsString = value instanceof yaml.Scalar && typeof value.value === "string";\n        if (!valueIsString) {\n          errors.push({\n            message: "Text value should be a string",\n            range: convertRange(entry.value.range || map.range)\n          });\n          continue;\n        }\n        container.children.push({\n          kind: "text",\n          text: textValue(value.value)\n        });\n        continue;\n      }\n      if (key.value === "/children") {\n        const valueIsString = value instanceof yaml.Scalar && typeof value.value === "string";\n        if (!valueIsString || value.value !== "contain" && value.value !== "equal" && value.value !== "deep-equal") {\n          errors.push({\n            message: \'Strict value should be "contain", "equal" or "deep-equal"\',\n            range: convertRange(entry.value.range || map.range)\n          });\n          continue;\n        }\n        container.containerMode = value.value;\n        continue;\n      }\n      if (key.value.startsWith("/")) {\n        const valueIsString = value instanceof yaml.Scalar && typeof value.value === "string";\n        if (!valueIsString) {\n          errors.push({\n            message: "Property value should be a string",\n            range: convertRange(entry.value.range || map.range)\n          });\n          continue;\n        }\n        container.props = (_a2 = container.props) != null ? _a2 : {};\n        container.props[key.value.slice(1)] = textValue(value.value);\n        continue;\n      }\n      const childNode = KeyParser.parse(key, parseOptions, errors);\n      if (!childNode)\n        continue;\n      const valueIsScalar = value instanceof yaml.Scalar;\n      if (valueIsScalar) {\n        const type = typeof value.value;\n        if (type !== "string" && type !== "number" && type !== "boolean") {\n          errors.push({\n            message: "Node value should be a string or a sequence",\n            range: convertRange(entry.value.range || map.range)\n          });\n          continue;\n        }\n        container.children.push({\n          ...childNode,\n          children: [{\n            kind: "text",\n            text: textValue(String(value.value))\n          }]\n        });\n        continue;\n      }\n      const valueIsSequence = value instanceof yaml.YAMLSeq;\n      if (valueIsSequence) {\n        container.children.push(childNode);\n        convertSeq(childNode, value);\n        continue;\n      }\n      errors.push({\n        message: "Map values should be strings or sequences",\n        range: convertRange(entry.value.range || map.range)\n      });\n    }\n  };\n  const fragment = { kind: "role", role: "fragment" };\n  yamlDoc.errors.forEach(addError);\n  if (errors.length)\n    return { errors, fragment };\n  if (!(yamlDoc.contents instanceof yaml.YAMLSeq)) {\n    errors.push({\n      message: \'Aria snapshot must be a YAML sequence, elements starting with " -"\',\n      range: yamlDoc.contents ? convertRange(yamlDoc.contents.range) : [{ line: 0, col: 0 }, { line: 0, col: 0 }]\n    });\n  }\n  if (errors.length)\n    return { errors, fragment };\n  convertSeq(fragment, yamlDoc.contents);\n  if (errors.length)\n    return { errors, fragment: emptyFragment };\n  if (((_a = fragment.children) == null ? void 0 : _a.length) === 1 && (!fragment.containerMode || fragment.containerMode === "contain"))\n    return { fragment: fragment.children[0], errors: [] };\n  return { fragment, errors: [] };\n}\nvar emptyFragment = { kind: "role", role: "fragment" };\nfunction normalizeWhitespace(text) {\n  return text.replace(/[\\u200b\\u00ad]/g, "").replace(/[\\r\\n\\s\\t]+/g, " ").trim();\n}\nfunction textValue(value) {\n  return {\n    raw: value,\n    normalized: normalizeWhitespace(value)\n  };\n}\nvar KeyParser = class _KeyParser {\n  static parse(text, options, errors) {\n    try {\n      return new _KeyParser(text.value)._parse();\n    } catch (e) {\n      if (e instanceof ParserError) {\n        const message = options.prettyErrors === false ? e.message : e.message + ":\\n\\n" + text.value + "\\n" + " ".repeat(e.pos) + "^\\n";\n        errors.push({\n          message,\n          range: [options.lineCounter.linePos(text.range[0]), options.lineCounter.linePos(text.range[0] + e.pos)]\n        });\n        return null;\n      }\n      throw e;\n    }\n  }\n  constructor(input) {\n    this._input = input;\n    this._pos = 0;\n    this._length = input.length;\n  }\n  _peek() {\n    return this._input[this._pos] || "";\n  }\n  _next() {\n    if (this._pos < this._length)\n      return this._input[this._pos++];\n    return null;\n  }\n  _eof() {\n    return this._pos >= this._length;\n  }\n  _isWhitespace() {\n    return !this._eof() && /\\s/.test(this._peek());\n  }\n  _skipWhitespace() {\n    while (this._isWhitespace())\n      this._pos++;\n  }\n  _readIdentifier(type) {\n    if (this._eof())\n      this._throwError(`Unexpected end of input when expecting ${type}`);\n    const start = this._pos;\n    while (!this._eof() && /[a-zA-Z]/.test(this._peek()))\n      this._pos++;\n    return this._input.slice(start, this._pos);\n  }\n  _readString() {\n    let result = "";\n    let escaped = false;\n    while (!this._eof()) {\n      const ch = this._next();\n      if (escaped) {\n        result += ch;\n        escaped = false;\n      } else if (ch === "\\\\") {\n        escaped = true;\n      } else if (ch === \'"\') {\n        return result;\n      } else {\n        result += ch;\n      }\n    }\n    this._throwError("Unterminated string");\n  }\n  _throwError(message, offset = 0) {\n    throw new ParserError(message, offset || this._pos);\n  }\n  _readRegex() {\n    let result = "";\n    let escaped = false;\n    let insideClass = false;\n    while (!this._eof()) {\n      const ch = this._next();\n      if (escaped) {\n        result += ch;\n        escaped = false;\n      } else if (ch === "\\\\") {\n        escaped = true;\n        result += ch;\n      } else if (ch === "/" && !insideClass) {\n        return { pattern: result };\n      } else if (ch === "[") {\n        insideClass = true;\n        result += ch;\n      } else if (ch === "]" && insideClass) {\n        result += ch;\n        insideClass = false;\n      } else {\n        result += ch;\n      }\n    }\n    this._throwError("Unterminated regex");\n  }\n  _readStringOrRegex() {\n    const ch = this._peek();\n    if (ch === \'"\') {\n      this._next();\n      return normalizeWhitespace(this._readString());\n    }\n    if (ch === "/") {\n      this._next();\n      return this._readRegex();\n    }\n    return null;\n  }\n  _readAttributes(result) {\n    let errorPos = this._pos;\n    while (true) {\n      this._skipWhitespace();\n      if (this._peek() === "[") {\n        this._next();\n        this._skipWhitespace();\n        errorPos = this._pos;\n        const flagName = this._readIdentifier("attribute");\n        this._skipWhitespace();\n        let flagValue = "";\n        if (this._peek() === "=") {\n          this._next();\n          this._skipWhitespace();\n          errorPos = this._pos;\n          while (this._peek() !== "]" && !this._isWhitespace() && !this._eof())\n            flagValue += this._next();\n        }\n        this._skipWhitespace();\n        if (this._peek() !== "]")\n          this._throwError("Expected ]");\n        this._next();\n        this._applyAttribute(result, flagName, flagValue || "true", errorPos);\n      } else {\n        break;\n      }\n    }\n  }\n  _parse() {\n    this._skipWhitespace();\n    const role = this._readIdentifier("role");\n    this._skipWhitespace();\n    const name = this._readStringOrRegex() || "";\n    const result = { kind: "role", role, name };\n    this._readAttributes(result);\n    this._skipWhitespace();\n    if (!this._eof())\n      this._throwError("Unexpected input");\n    return result;\n  }\n  _applyAttribute(node, key, value, errorPos) {\n    if (key === "checked") {\n      this._assert(value === "true" || value === "false" || value === "mixed", \'Value of "checked" attribute must be a boolean or "mixed"\', errorPos);\n      node.checked = value === "true" ? true : value === "false" ? false : "mixed";\n      return;\n    }\n    if (key === "disabled") {\n      this._assert(value === "true" || value === "false", \'Value of "disabled" attribute must be a boolean\', errorPos);\n      node.disabled = value === "true";\n      return;\n    }\n    if (key === "expanded") {\n      this._assert(value === "true" || value === "false", \'Value of "expanded" attribute must be a boolean\', errorPos);\n      node.expanded = value === "true";\n      return;\n    }\n    if (key === "active") {\n      this._assert(value === "true" || value === "false", \'Value of "active" attribute must be a boolean\', errorPos);\n      node.active = value === "true";\n      return;\n    }\n    if (key === "invalid") {\n      this._assert(value === "true" || value === "false" || value === "grammar" || value === "spelling", \'Value of "invalid" attribute must be a boolean, "grammar" or "spelling"\', errorPos);\n      node.invalid = value === "true" ? true : value === "false" ? false : value;\n      return;\n    }\n    if (key === "level") {\n      this._assert(!isNaN(Number(value)), \'Value of "level" attribute must be a number\', errorPos);\n      node.level = Number(value);\n      return;\n    }\n    if (key === "pressed") {\n      this._assert(value === "true" || value === "false" || value === "mixed", \'Value of "pressed" attribute must be a boolean or "mixed"\', errorPos);\n      node.pressed = value === "true" ? true : value === "false" ? false : "mixed";\n      return;\n    }\n    if (key === "selected") {\n      this._assert(value === "true" || value === "false", \'Value of "selected" attribute must be a boolean\', errorPos);\n      node.selected = value === "true";\n      return;\n    }\n    this._assert(false, `Unsupported attribute [${key}]`, errorPos);\n  }\n  _assert(value, message, valuePos) {\n    if (!value)\n      this._throwError(message || "Assertion error", valuePos);\n  }\n};\nvar ParserError = class extends Error {\n  constructor(message, pos) {\n    super(message);\n    this.pos = pos;\n  }\n};\nfunction findNewNode(from, to) {\n  var _a, _b;\n  function fillMap(root, map, position) {\n    let size = 1;\n    let childPosition = position + size;\n    for (const child of root.children || []) {\n      if (typeof child === "string") {\n        size++;\n        childPosition++;\n      } else {\n        size += fillMap(child, map, childPosition);\n        childPosition += size;\n      }\n    }\n    if (!["none", "presentation", "fragment", "iframe", "generic"].includes(root.role) && root.name) {\n      let byRole = map.get(root.role);\n      if (!byRole) {\n        byRole = /* @__PURE__ */ new Map();\n        map.set(root.role, byRole);\n      }\n      const existing = byRole.get(root.name);\n      const sizeAndPosition = size * 100 - position;\n      if (!existing || existing.sizeAndPosition < sizeAndPosition)\n        byRole.set(root.name, { node: root, sizeAndPosition });\n    }\n    return size;\n  }\n  const fromMap = /* @__PURE__ */ new Map();\n  if (from)\n    fillMap(from, fromMap, 0);\n  const toMap = /* @__PURE__ */ new Map();\n  fillMap(to, toMap, 0);\n  const result = [];\n  for (const [role, byRole] of toMap) {\n    for (const [name, byName] of byRole) {\n      const inFrom = (_a = fromMap.get(role)) == null ? void 0 : _a.get(name);\n      if (!inFrom)\n        result.push(byName);\n    }\n  }\n  result.sort((a, b) => b.sizeAndPosition - a.sizeAndPosition);\n  return (_b = result[0]) == null ? void 0 : _b.node;\n}\n\n// packages/isomorphic/cssTokenizer.ts\nvar between = function(num, first, last) {\n  return num >= first && num <= last;\n};\nfunction digit(code) {\n  return between(code, 48, 57);\n}\nfunction hexdigit(code) {\n  return digit(code) || between(code, 65, 70) || between(code, 97, 102);\n}\nfunction uppercaseletter(code) {\n  return between(code, 65, 90);\n}\nfunction lowercaseletter(code) {\n  return between(code, 97, 122);\n}\nfunction letter(code) {\n  return uppercaseletter(code) || lowercaseletter(code);\n}\nfunction nonascii(code) {\n  return code >= 128;\n}\nfunction namestartchar(code) {\n  return letter(code) || nonascii(code) || code === 95;\n}\nfunction namechar(code) {\n  return namestartchar(code) || digit(code) || code === 45;\n}\nfunction nonprintable(code) {\n  return between(code, 0, 8) || code === 11 || between(code, 14, 31) || code === 127;\n}\nfunction newline(code) {\n  return code === 10;\n}\nfunction whitespace(code) {\n  return newline(code) || code === 9 || code === 32;\n}\nvar maximumallowedcodepoint = 1114111;\nvar InvalidCharacterError = class extends Error {\n  constructor(message) {\n    super(message);\n    this.name = "InvalidCharacterError";\n  }\n};\nfunction preprocess(str) {\n  const codepoints = [];\n  for (let i = 0; i < str.length; i++) {\n    let code = str.charCodeAt(i);\n    if (code === 13 && str.charCodeAt(i + 1) === 10) {\n      code = 10;\n      i++;\n    }\n    if (code === 13 || code === 12)\n      code = 10;\n    if (code === 0)\n      code = 65533;\n    if (between(code, 55296, 56319) && between(str.charCodeAt(i + 1), 56320, 57343)) {\n      const lead = code - 55296;\n      const trail = str.charCodeAt(i + 1) - 56320;\n      code = Math.pow(2, 16) + lead * Math.pow(2, 10) + trail;\n      i++;\n    }\n    codepoints.push(code);\n  }\n  return codepoints;\n}\nfunction stringFromCode(code) {\n  if (code <= 65535)\n    return String.fromCharCode(code);\n  code -= Math.pow(2, 16);\n  const lead = Math.floor(code / Math.pow(2, 10)) + 55296;\n  const trail = code % Math.pow(2, 10) + 56320;\n  return String.fromCharCode(lead) + String.fromCharCode(trail);\n}\nfunction tokenize(str1) {\n  const str = preprocess(str1);\n  let i = -1;\n  const tokens = [];\n  let code;\n  let line = 0;\n  let column = 0;\n  let lastLineLength = 0;\n  const incrLineno = function() {\n    line += 1;\n    lastLineLength = column;\n    column = 0;\n  };\n  const locStart = { line, column };\n  const codepoint = function(i2) {\n    if (i2 >= str.length)\n      return -1;\n    return str[i2];\n  };\n  const next = function(num) {\n    if (num === void 0)\n      num = 1;\n    if (num > 3)\n      throw "Spec Error: no more than three codepoints of lookahead.";\n    return codepoint(i + num);\n  };\n  const consume = function(num) {\n    if (num === void 0)\n      num = 1;\n    i += num;\n    code = codepoint(i);\n    if (newline(code))\n      incrLineno();\n    else\n      column += num;\n    return true;\n  };\n  const reconsume = function() {\n    i -= 1;\n    if (newline(code)) {\n      line -= 1;\n      column = lastLineLength;\n    } else {\n      column -= 1;\n    }\n    locStart.line = line;\n    locStart.column = column;\n    return true;\n  };\n  const eof = function(codepoint2) {\n    if (codepoint2 === void 0)\n      codepoint2 = code;\n    return codepoint2 === -1;\n  };\n  const donothing = function() {\n  };\n  const parseerror = function() {\n  };\n  const consumeAToken = function() {\n    consumeComments();\n    consume();\n    if (whitespace(code)) {\n      while (whitespace(next()))\n        consume();\n      return new WhitespaceToken();\n    } else if (code === 34) {\n      return consumeAStringToken();\n    } else if (code === 35) {\n      if (namechar(next()) || areAValidEscape(next(1), next(2))) {\n        const token = new HashToken("");\n        if (wouldStartAnIdentifier(next(1), next(2), next(3)))\n          token.type = "id";\n        token.value = consumeAName();\n        return token;\n      } else {\n        return new DelimToken(code);\n      }\n    } else if (code === 36) {\n      if (next() === 61) {\n        consume();\n        return new SuffixMatchToken();\n      } else {\n        return new DelimToken(code);\n      }\n    } else if (code === 39) {\n      return consumeAStringToken();\n    } else if (code === 40) {\n      return new OpenParenToken();\n    } else if (code === 41) {\n      return new CloseParenToken();\n    } else if (code === 42) {\n      if (next() === 61) {\n        consume();\n        return new SubstringMatchToken();\n      } else {\n        return new DelimToken(code);\n      }\n    } else if (code === 43) {\n      if (startsWithANumber()) {\n        reconsume();\n        return consumeANumericToken();\n      } else {\n        return new DelimToken(code);\n      }\n    } else if (code === 44) {\n      return new CommaToken();\n    } else if (code === 45) {\n      if (startsWithANumber()) {\n        reconsume();\n        return consumeANumericToken();\n      } else if (next(1) === 45 && next(2) === 62) {\n        consume(2);\n        return new CDCToken();\n      } else if (startsWithAnIdentifier()) {\n        reconsume();\n        return consumeAnIdentlikeToken();\n      } else {\n        return new DelimToken(code);\n      }\n    } else if (code === 46) {\n      if (startsWithANumber()) {\n        reconsume();\n        return consumeANumericToken();\n      } else {\n        return new DelimToken(code);\n      }\n    } else if (code === 58) {\n      return new ColonToken();\n    } else if (code === 59) {\n      return new SemicolonToken();\n    } else if (code === 60) {\n      if (next(1) === 33 && next(2) === 45 && next(3) === 45) {\n        consume(3);\n        return new CDOToken();\n      } else {\n        return new DelimToken(code);\n      }\n    } else if (code === 64) {\n      if (wouldStartAnIdentifier(next(1), next(2), next(3)))\n        return new AtKeywordToken(consumeAName());\n      else\n        return new DelimToken(code);\n    } else if (code === 91) {\n      return new OpenSquareToken();\n    } else if (code === 92) {\n      if (startsWithAValidEscape()) {\n        reconsume();\n        return consumeAnIdentlikeToken();\n      } else {\n        parseerror();\n        return new DelimToken(code);\n      }\n    } else if (code === 93) {\n      return new CloseSquareToken();\n    } else if (code === 94) {\n      if (next() === 61) {\n        consume();\n        return new PrefixMatchToken();\n      } else {\n        return new DelimToken(code);\n      }\n    } else if (code === 123) {\n      return new OpenCurlyToken();\n    } else if (code === 124) {\n      if (next() === 61) {\n        consume();\n        return new DashMatchToken();\n      } else if (next() === 124) {\n        consume();\n        return new ColumnToken();\n      } else {\n        return new DelimToken(code);\n      }\n    } else if (code === 125) {\n      return new CloseCurlyToken();\n    } else if (code === 126) {\n      if (next() === 61) {\n        consume();\n        return new IncludeMatchToken();\n      } else {\n        return new DelimToken(code);\n      }\n    } else if (digit(code)) {\n      reconsume();\n      return consumeANumericToken();\n    } else if (namestartchar(code)) {\n      reconsume();\n      return consumeAnIdentlikeToken();\n    } else if (eof()) {\n      return new EOFToken();\n    } else {\n      return new DelimToken(code);\n    }\n  };\n  const consumeComments = function() {\n    while (next(1) === 47 && next(2) === 42) {\n      consume(2);\n      while (true) {\n        consume();\n        if (code === 42 && next() === 47) {\n          consume();\n          break;\n        } else if (eof()) {\n          parseerror();\n          return;\n        }\n      }\n    }\n  };\n  const consumeANumericToken = function() {\n    const num = consumeANumber();\n    if (wouldStartAnIdentifier(next(1), next(2), next(3))) {\n      const token = new DimensionToken();\n      token.value = num.value;\n      token.repr = num.repr;\n      token.type = num.type;\n      token.unit = consumeAName();\n      return token;\n    } else if (next() === 37) {\n      consume();\n      const token = new PercentageToken();\n      token.value = num.value;\n      token.repr = num.repr;\n      return token;\n    } else {\n      const token = new NumberToken();\n      token.value = num.value;\n      token.repr = num.repr;\n      token.type = num.type;\n      return token;\n    }\n  };\n  const consumeAnIdentlikeToken = function() {\n    const str2 = consumeAName();\n    if (str2.toLowerCase() === "url" && next() === 40) {\n      consume();\n      while (whitespace(next(1)) && whitespace(next(2)))\n        consume();\n      if (next() === 34 || next() === 39)\n        return new FunctionToken(str2);\n      else if (whitespace(next()) && (next(2) === 34 || next(2) === 39))\n        return new FunctionToken(str2);\n      else\n        return consumeAURLToken();\n    } else if (next() === 40) {\n      consume();\n      return new FunctionToken(str2);\n    } else {\n      return new IdentToken(str2);\n    }\n  };\n  const consumeAStringToken = function(endingCodePoint) {\n    if (endingCodePoint === void 0)\n      endingCodePoint = code;\n    let string = "";\n    while (consume()) {\n      if (code === endingCodePoint || eof()) {\n        return new StringToken(string);\n      } else if (newline(code)) {\n        parseerror();\n        reconsume();\n        return new BadStringToken();\n      } else if (code === 92) {\n        if (eof(next()))\n          donothing();\n        else if (newline(next()))\n          consume();\n        else\n          string += stringFromCode(consumeEscape());\n      } else {\n        string += stringFromCode(code);\n      }\n    }\n    throw new Error("Internal error");\n  };\n  const consumeAURLToken = function() {\n    const token = new URLToken("");\n    while (whitespace(next()))\n      consume();\n    if (eof(next()))\n      return token;\n    while (consume()) {\n      if (code === 41 || eof()) {\n        return token;\n      } else if (whitespace(code)) {\n        while (whitespace(next()))\n          consume();\n        if (next() === 41 || eof(next())) {\n          consume();\n          return token;\n        } else {\n          consumeTheRemnantsOfABadURL();\n          return new BadURLToken();\n        }\n      } else if (code === 34 || code === 39 || code === 40 || nonprintable(code)) {\n        parseerror();\n        consumeTheRemnantsOfABadURL();\n        return new BadURLToken();\n      } else if (code === 92) {\n        if (startsWithAValidEscape()) {\n          token.value += stringFromCode(consumeEscape());\n        } else {\n          parseerror();\n          consumeTheRemnantsOfABadURL();\n          return new BadURLToken();\n        }\n      } else {\n        token.value += stringFromCode(code);\n      }\n    }\n    throw new Error("Internal error");\n  };\n  const consumeEscape = function() {\n    consume();\n    if (hexdigit(code)) {\n      const digits = [code];\n      for (let total = 0; total < 5; total++) {\n        if (hexdigit(next())) {\n          consume();\n          digits.push(code);\n        } else {\n          break;\n        }\n      }\n      if (whitespace(next()))\n        consume();\n      let value = parseInt(digits.map(function(x) {\n        return String.fromCharCode(x);\n      }).join(""), 16);\n      if (value > maximumallowedcodepoint)\n        value = 65533;\n      return value;\n    } else if (eof()) {\n      return 65533;\n    } else {\n      return code;\n    }\n  };\n  const areAValidEscape = function(c1, c2) {\n    if (c1 !== 92)\n      return false;\n    if (newline(c2))\n      return false;\n    return true;\n  };\n  const startsWithAValidEscape = function() {\n    return areAValidEscape(code, next());\n  };\n  const wouldStartAnIdentifier = function(c1, c2, c3) {\n    if (c1 === 45)\n      return namestartchar(c2) || c2 === 45 || areAValidEscape(c2, c3);\n    else if (namestartchar(c1))\n      return true;\n    else if (c1 === 92)\n      return areAValidEscape(c1, c2);\n    else\n      return false;\n  };\n  const startsWithAnIdentifier = function() {\n    return wouldStartAnIdentifier(code, next(1), next(2));\n  };\n  const wouldStartANumber = function(c1, c2, c3) {\n    if (c1 === 43 || c1 === 45) {\n      if (digit(c2))\n        return true;\n      if (c2 === 46 && digit(c3))\n        return true;\n      return false;\n    } else if (c1 === 46) {\n      if (digit(c2))\n        return true;\n      return false;\n    } else if (digit(c1)) {\n      return true;\n    } else {\n      return false;\n    }\n  };\n  const startsWithANumber = function() {\n    return wouldStartANumber(code, next(1), next(2));\n  };\n  const consumeAName = function() {\n    let result = "";\n    while (consume()) {\n      if (namechar(code)) {\n        result += stringFromCode(code);\n      } else if (startsWithAValidEscape()) {\n        result += stringFromCode(consumeEscape());\n      } else {\n        reconsume();\n        return result;\n      }\n    }\n    throw new Error("Internal parse error");\n  };\n  const consumeANumber = function() {\n    let repr = "";\n    let type = "integer";\n    if (next() === 43 || next() === 45) {\n      consume();\n      repr += stringFromCode(code);\n    }\n    while (digit(next())) {\n      consume();\n      repr += stringFromCode(code);\n    }\n    if (next(1) === 46 && digit(next(2))) {\n      consume();\n      repr += stringFromCode(code);\n      consume();\n      repr += stringFromCode(code);\n      type = "number";\n      while (digit(next())) {\n        consume();\n        repr += stringFromCode(code);\n      }\n    }\n    const c1 = next(1);\n    const c2 = next(2);\n    const c3 = next(3);\n    if ((c1 === 69 || c1 === 101) && digit(c2)) {\n      consume();\n      repr += stringFromCode(code);\n      consume();\n      repr += stringFromCode(code);\n      type = "number";\n      while (digit(next())) {\n        consume();\n        repr += stringFromCode(code);\n      }\n    } else if ((c1 === 69 || c1 === 101) && (c2 === 43 || c2 === 45) && digit(c3)) {\n      consume();\n      repr += stringFromCode(code);\n      consume();\n      repr += stringFromCode(code);\n      consume();\n      repr += stringFromCode(code);\n      type = "number";\n      while (digit(next())) {\n        consume();\n        repr += stringFromCode(code);\n      }\n    }\n    const value = convertAStringToANumber(repr);\n    return { type, value, repr };\n  };\n  const convertAStringToANumber = function(string) {\n    return +string;\n  };\n  const consumeTheRemnantsOfABadURL = function() {\n    while (consume()) {\n      if (code === 41 || eof()) {\n        return;\n      } else if (startsWithAValidEscape()) {\n        consumeEscape();\n        donothing();\n      } else {\n        donothing();\n      }\n    }\n  };\n  let iterationCount = 0;\n  while (!eof(next())) {\n    tokens.push(consumeAToken());\n    iterationCount++;\n    if (iterationCount > str.length * 2)\n      throw new Error("I\'m infinite-looping!");\n  }\n  return tokens;\n}\nvar CSSParserToken = class {\n  constructor() {\n    this.tokenType = "";\n  }\n  toJSON() {\n    return { token: this.tokenType };\n  }\n  toString() {\n    return this.tokenType;\n  }\n  toSource() {\n    return "" + this;\n  }\n};\nvar BadStringToken = class extends CSSParserToken {\n  constructor() {\n    super(...arguments);\n    this.tokenType = "BADSTRING";\n  }\n};\nvar BadURLToken = class extends CSSParserToken {\n  constructor() {\n    super(...arguments);\n    this.tokenType = "BADURL";\n  }\n};\nvar WhitespaceToken = class extends CSSParserToken {\n  constructor() {\n    super(...arguments);\n    this.tokenType = "WHITESPACE";\n  }\n  toString() {\n    return "WS";\n  }\n  toSource() {\n    return " ";\n  }\n};\nvar CDOToken = class extends CSSParserToken {\n  constructor() {\n    super(...arguments);\n    this.tokenType = "CDO";\n  }\n  toSource() {\n    return "<!--";\n  }\n};\nvar CDCToken = class extends CSSParserToken {\n  constructor() {\n    super(...arguments);\n    this.tokenType = "CDC";\n  }\n  toSource() {\n    return "-->";\n  }\n};\nvar ColonToken = class extends CSSParserToken {\n  constructor() {\n    super(...arguments);\n    this.tokenType = ":";\n  }\n};\nvar SemicolonToken = class extends CSSParserToken {\n  constructor() {\n    super(...arguments);\n    this.tokenType = ";";\n  }\n};\nvar CommaToken = class extends CSSParserToken {\n  constructor() {\n    super(...arguments);\n    this.tokenType = ",";\n  }\n};\nvar GroupingToken = class extends CSSParserToken {\n  constructor() {\n    super(...arguments);\n    this.value = "";\n    this.mirror = "";\n  }\n};\nvar OpenCurlyToken = class extends GroupingToken {\n  constructor() {\n    super();\n    this.tokenType = "{";\n    this.value = "{";\n    this.mirror = "}";\n  }\n};\nvar CloseCurlyToken = class extends GroupingToken {\n  constructor() {\n    super();\n    this.tokenType = "}";\n    this.value = "}";\n    this.mirror = "{";\n  }\n};\nvar OpenSquareToken = class extends GroupingToken {\n  constructor() {\n    super();\n    this.tokenType = "[";\n    this.value = "[";\n    this.mirror = "]";\n  }\n};\nvar CloseSquareToken = class extends GroupingToken {\n  constructor() {\n    super();\n    this.tokenType = "]";\n    this.value = "]";\n    this.mirror = "[";\n  }\n};\nvar OpenParenToken = class extends GroupingToken {\n  constructor() {\n    super();\n    this.tokenType = "(";\n    this.value = "(";\n    this.mirror = ")";\n  }\n};\nvar CloseParenToken = class extends GroupingToken {\n  constructor() {\n    super();\n    this.tokenType = ")";\n    this.value = ")";\n    this.mirror = "(";\n  }\n};\nvar IncludeMatchToken = class extends CSSParserToken {\n  constructor() {\n    super(...arguments);\n    this.tokenType = "~=";\n  }\n};\nvar DashMatchToken = class extends CSSParserToken {\n  constructor() {\n    super(...arguments);\n    this.tokenType = "|=";\n  }\n};\nvar PrefixMatchToken = class extends CSSParserToken {\n  constructor() {\n    super(...arguments);\n    this.tokenType = "^=";\n  }\n};\nvar SuffixMatchToken = class extends CSSParserToken {\n  constructor() {\n    super(...arguments);\n    this.tokenType = "$=";\n  }\n};\nvar SubstringMatchToken = class extends CSSParserToken {\n  constructor() {\n    super(...arguments);\n    this.tokenType = "*=";\n  }\n};\nvar ColumnToken = class extends CSSParserToken {\n  constructor() {\n    super(...arguments);\n    this.tokenType = "||";\n  }\n};\nvar EOFToken = class extends CSSParserToken {\n  constructor() {\n    super(...arguments);\n    this.tokenType = "EOF";\n  }\n  toSource() {\n    return "";\n  }\n};\nvar DelimToken = class extends CSSParserToken {\n  constructor(code) {\n    super();\n    this.tokenType = "DELIM";\n    this.value = "";\n    this.value = stringFromCode(code);\n  }\n  toString() {\n    return "DELIM(" + this.value + ")";\n  }\n  toJSON() {\n    const json = this.constructor.prototype.constructor.prototype.toJSON.call(this);\n    json.value = this.value;\n    return json;\n  }\n  toSource() {\n    if (this.value === "\\\\")\n      return "\\\\\\n";\n    else\n      return this.value;\n  }\n};\nvar StringValuedToken = class extends CSSParserToken {\n  constructor() {\n    super(...arguments);\n    this.value = "";\n  }\n  ASCIIMatch(str) {\n    return this.value.toLowerCase() === str.toLowerCase();\n  }\n  toJSON() {\n    const json = this.constructor.prototype.constructor.prototype.toJSON.call(this);\n    json.value = this.value;\n    return json;\n  }\n};\nvar IdentToken = class extends StringValuedToken {\n  constructor(val) {\n    super();\n    this.tokenType = "IDENT";\n    this.value = val;\n  }\n  toString() {\n    return "IDENT(" + this.value + ")";\n  }\n  toSource() {\n    return escapeIdent(this.value);\n  }\n};\nvar FunctionToken = class extends StringValuedToken {\n  constructor(val) {\n    super();\n    this.tokenType = "FUNCTION";\n    this.value = val;\n    this.mirror = ")";\n  }\n  toString() {\n    return "FUNCTION(" + this.value + ")";\n  }\n  toSource() {\n    return escapeIdent(this.value) + "(";\n  }\n};\nvar AtKeywordToken = class extends StringValuedToken {\n  constructor(val) {\n    super();\n    this.tokenType = "AT-KEYWORD";\n    this.value = val;\n  }\n  toString() {\n    return "AT(" + this.value + ")";\n  }\n  toSource() {\n    return "@" + escapeIdent(this.value);\n  }\n};\nvar HashToken = class extends StringValuedToken {\n  constructor(val) {\n    super();\n    this.tokenType = "HASH";\n    this.value = val;\n    this.type = "unrestricted";\n  }\n  toString() {\n    return "HASH(" + this.value + ")";\n  }\n  toJSON() {\n    const json = this.constructor.prototype.constructor.prototype.toJSON.call(this);\n    json.value = this.value;\n    json.type = this.type;\n    return json;\n  }\n  toSource() {\n    if (this.type === "id")\n      return "#" + escapeIdent(this.value);\n    else\n      return "#" + escapeHash(this.value);\n  }\n};\nvar StringToken = class extends StringValuedToken {\n  constructor(val) {\n    super();\n    this.tokenType = "STRING";\n    this.value = val;\n  }\n  toString() {\n    return \'"\' + escapeString(this.value) + \'"\';\n  }\n};\nvar URLToken = class extends StringValuedToken {\n  constructor(val) {\n    super();\n    this.tokenType = "URL";\n    this.value = val;\n  }\n  toString() {\n    return "URL(" + this.value + ")";\n  }\n  toSource() {\n    return \'url("\' + escapeString(this.value) + \'")\';\n  }\n};\nvar NumberToken = class extends CSSParserToken {\n  constructor() {\n    super();\n    this.tokenType = "NUMBER";\n    this.type = "integer";\n    this.repr = "";\n  }\n  toString() {\n    if (this.type === "integer")\n      return "INT(" + this.value + ")";\n    return "NUMBER(" + this.value + ")";\n  }\n  toJSON() {\n    const json = super.toJSON();\n    json.value = this.value;\n    json.type = this.type;\n    json.repr = this.repr;\n    return json;\n  }\n  toSource() {\n    return this.repr;\n  }\n};\nvar PercentageToken = class extends CSSParserToken {\n  constructor() {\n    super();\n    this.tokenType = "PERCENTAGE";\n    this.repr = "";\n  }\n  toString() {\n    return "PERCENTAGE(" + this.value + ")";\n  }\n  toJSON() {\n    const json = this.constructor.prototype.constructor.prototype.toJSON.call(this);\n    json.value = this.value;\n    json.repr = this.repr;\n    return json;\n  }\n  toSource() {\n    return this.repr + "%";\n  }\n};\nvar DimensionToken = class extends CSSParserToken {\n  constructor() {\n    super();\n    this.tokenType = "DIMENSION";\n    this.type = "integer";\n    this.repr = "";\n    this.unit = "";\n  }\n  toString() {\n    return "DIM(" + this.value + "," + this.unit + ")";\n  }\n  toJSON() {\n    const json = this.constructor.prototype.constructor.prototype.toJSON.call(this);\n    json.value = this.value;\n    json.type = this.type;\n    json.repr = this.repr;\n    json.unit = this.unit;\n    return json;\n  }\n  toSource() {\n    const source = this.repr;\n    let unit = escapeIdent(this.unit);\n    if (unit[0].toLowerCase() === "e" && (unit[1] === "-" || between(unit.charCodeAt(1), 48, 57))) {\n      unit = "\\\\65 " + unit.slice(1, unit.length);\n    }\n    return source + unit;\n  }\n};\nfunction escapeIdent(string) {\n  string = "" + string;\n  let result = "";\n  const firstcode = string.charCodeAt(0);\n  for (let i = 0; i < string.length; i++) {\n    const code = string.charCodeAt(i);\n    if (code === 0)\n      throw new InvalidCharacterError("Invalid character: the input contains U+0000.");\n    if (between(code, 1, 31) || code === 127 || i === 0 && between(code, 48, 57) || i === 1 && between(code, 48, 57) && firstcode === 45)\n      result += "\\\\" + code.toString(16) + " ";\n    else if (code >= 128 || code === 45 || code === 95 || between(code, 48, 57) || between(code, 65, 90) || between(code, 97, 122))\n      result += string[i];\n    else\n      result += "\\\\" + string[i];\n  }\n  return result;\n}\nfunction escapeHash(string) {\n  string = "" + string;\n  let result = "";\n  for (let i = 0; i < string.length; i++) {\n    const code = string.charCodeAt(i);\n    if (code === 0)\n      throw new InvalidCharacterError("Invalid character: the input contains U+0000.");\n    if (code >= 128 || code === 45 || code === 95 || between(code, 48, 57) || between(code, 65, 90) || between(code, 97, 122))\n      result += string[i];\n    else\n      result += "\\\\" + code.toString(16) + " ";\n  }\n  return result;\n}\nfunction escapeString(string) {\n  string = "" + string;\n  let result = "";\n  for (let i = 0; i < string.length; i++) {\n    const code = string.charCodeAt(i);\n    if (code === 0)\n      throw new InvalidCharacterError("Invalid character: the input contains U+0000.");\n    if (between(code, 1, 31) || code === 127)\n      result += "\\\\" + code.toString(16) + " ";\n    else if (code === 34 || code === 92)\n      result += "\\\\" + string[i];\n    else\n      result += string[i];\n  }\n  return result;\n}\n\n// packages/isomorphic/cssParser.ts\nvar InvalidSelectorError = class extends Error {\n};\nfunction parseCSS(selector, customNames) {\n  let tokens;\n  try {\n    tokens = tokenize(selector);\n    if (!(tokens[tokens.length - 1] instanceof EOFToken))\n      tokens.push(new EOFToken());\n  } catch (e) {\n    const newMessage = e.message + ` while parsing css selector "${selector}". Did you mean to CSS.escape it?`;\n    const index = (e.stack || "").indexOf(e.message);\n    if (index !== -1)\n      e.stack = e.stack.substring(0, index) + newMessage + e.stack.substring(index + e.message.length);\n    e.message = newMessage;\n    throw e;\n  }\n  const unsupportedToken = tokens.find((token) => {\n    return token instanceof AtKeywordToken || token instanceof BadStringToken || token instanceof BadURLToken || token instanceof ColumnToken || token instanceof CDOToken || token instanceof CDCToken || token instanceof SemicolonToken || // TODO: Consider using these for something, e.g. to escape complex strings.\n    // For example :xpath{ (//div/bar[@attr="foo"])[2]/baz }\n    // Or this way :xpath( {complex-xpath-goes-here("hello")} )\n    token instanceof OpenCurlyToken || token instanceof CloseCurlyToken || // TODO: Consider treating these as strings?\n    token instanceof URLToken || token instanceof PercentageToken;\n  });\n  if (unsupportedToken)\n    throw new InvalidSelectorError(`Unsupported token "${unsupportedToken.toSource()}" while parsing css selector "${selector}". Did you mean to CSS.escape it?`);\n  let pos = 0;\n  const names = /* @__PURE__ */ new Set();\n  function unexpected() {\n    return new InvalidSelectorError(`Unexpected token "${tokens[pos].toSource()}" while parsing css selector "${selector}". Did you mean to CSS.escape it?`);\n  }\n  function skipWhitespace() {\n    while (tokens[pos] instanceof WhitespaceToken)\n      pos++;\n  }\n  function isIdent(p = pos) {\n    return tokens[p] instanceof IdentToken;\n  }\n  function isString(p = pos) {\n    return tokens[p] instanceof StringToken;\n  }\n  function isNumber(p = pos) {\n    return tokens[p] instanceof NumberToken;\n  }\n  function isComma(p = pos) {\n    return tokens[p] instanceof CommaToken;\n  }\n  function isOpenParen(p = pos) {\n    return tokens[p] instanceof OpenParenToken;\n  }\n  function isCloseParen(p = pos) {\n    return tokens[p] instanceof CloseParenToken;\n  }\n  function isFunction(p = pos) {\n    return tokens[p] instanceof FunctionToken;\n  }\n  function isStar(p = pos) {\n    return tokens[p] instanceof DelimToken && tokens[p].value === "*";\n  }\n  function isEOF(p = pos) {\n    return tokens[p] instanceof EOFToken;\n  }\n  function isClauseCombinator(p = pos) {\n    return tokens[p] instanceof DelimToken && [">", "+", "~"].includes(tokens[p].value);\n  }\n  function isSelectorClauseEnd(p = pos) {\n    return isComma(p) || isCloseParen(p) || isEOF(p) || isClauseCombinator(p) || tokens[p] instanceof WhitespaceToken;\n  }\n  function consumeFunctionArguments() {\n    const result2 = [consumeArgument()];\n    while (true) {\n      skipWhitespace();\n      if (!isComma())\n        break;\n      pos++;\n      result2.push(consumeArgument());\n    }\n    return result2;\n  }\n  function consumeArgument() {\n    skipWhitespace();\n    if (isNumber())\n      return tokens[pos++].value;\n    if (isString())\n      return tokens[pos++].value;\n    return consumeComplexSelector();\n  }\n  function consumeComplexSelector() {\n    const result2 = { simples: [] };\n    skipWhitespace();\n    if (isClauseCombinator()) {\n      result2.simples.push({ selector: { functions: [{ name: "scope", args: [] }] }, combinator: "" });\n    } else {\n      result2.simples.push({ selector: consumeSimpleSelector(), combinator: "" });\n    }\n    while (true) {\n      skipWhitespace();\n      if (isClauseCombinator()) {\n        result2.simples[result2.simples.length - 1].combinator = tokens[pos++].value;\n        skipWhitespace();\n      } else if (isSelectorClauseEnd()) {\n        break;\n      }\n      result2.simples.push({ combinator: "", selector: consumeSimpleSelector() });\n    }\n    return result2;\n  }\n  function consumeSimpleSelector() {\n    let rawCSSString = "";\n    const functions = [];\n    while (!isSelectorClauseEnd()) {\n      if (isIdent() || isStar()) {\n        rawCSSString += tokens[pos++].toSource();\n      } else if (tokens[pos] instanceof HashToken) {\n        rawCSSString += tokens[pos++].toSource();\n      } else if (tokens[pos] instanceof DelimToken && tokens[pos].value === ".") {\n        pos++;\n        if (isIdent())\n          rawCSSString += "." + tokens[pos++].toSource();\n        else\n          throw unexpected();\n      } else if (tokens[pos] instanceof ColonToken) {\n        pos++;\n        if (isIdent()) {\n          if (!customNames.has(tokens[pos].value.toLowerCase())) {\n            rawCSSString += ":" + tokens[pos++].toSource();\n          } else {\n            const name = tokens[pos++].value.toLowerCase();\n            functions.push({ name, args: [] });\n            names.add(name);\n          }\n        } else if (isFunction()) {\n          const name = tokens[pos++].value.toLowerCase();\n          if (!customNames.has(name)) {\n            rawCSSString += `:${name}(${consumeBuiltinFunctionArguments()})`;\n          } else {\n            functions.push({ name, args: consumeFunctionArguments() });\n            names.add(name);\n          }\n          skipWhitespace();\n          if (!isCloseParen())\n            throw unexpected();\n          pos++;\n        } else {\n          throw unexpected();\n        }\n      } else if (tokens[pos] instanceof OpenSquareToken) {\n        rawCSSString += "[";\n        pos++;\n        while (!(tokens[pos] instanceof CloseSquareToken) && !isEOF())\n          rawCSSString += tokens[pos++].toSource();\n        if (!(tokens[pos] instanceof CloseSquareToken))\n          throw unexpected();\n        rawCSSString += "]";\n        pos++;\n      } else {\n        throw unexpected();\n      }\n    }\n    if (!rawCSSString && !functions.length)\n      throw unexpected();\n    return { css: rawCSSString || void 0, functions };\n  }\n  function consumeBuiltinFunctionArguments() {\n    let s = "";\n    let balance = 1;\n    while (!isEOF()) {\n      if (isOpenParen() || isFunction())\n        balance++;\n      if (isCloseParen())\n        balance--;\n      if (!balance)\n        break;\n      s += tokens[pos++].toSource();\n    }\n    return s;\n  }\n  const result = consumeFunctionArguments();\n  if (!isEOF())\n    throw unexpected();\n  if (result.some((arg) => typeof arg !== "object" || !("simples" in arg)))\n    throw new InvalidSelectorError(`Error while parsing css selector "${selector}". Did you mean to CSS.escape it?`);\n  return { selector: result, names: Array.from(names) };\n}\n\n// packages/isomorphic/selectorParser.ts\nvar kNestedSelectorNames = /* @__PURE__ */ new Set(["internal:has", "internal:has-not", "internal:and", "internal:or", "internal:chain", "left-of", "right-of", "above", "below", "near"]);\nvar kNestedSelectorNamesWithDistance = /* @__PURE__ */ new Set(["left-of", "right-of", "above", "below", "near"]);\nvar customCSSNames = /* @__PURE__ */ new Set(["not", "is", "where", "has", "scope", "light", "visible", "text", "text-matches", "text-is", "has-text", "above", "below", "right-of", "left-of", "near", "nth-match"]);\nfunction parseSelector(selector) {\n  const parsedStrings = parseSelectorString(selector);\n  const parts = [];\n  for (const part of parsedStrings.parts) {\n    if (part.name === "css" || part.name === "css:light") {\n      if (part.name === "css:light")\n        part.body = ":light(" + part.body + ")";\n      const parsedCSS = parseCSS(part.body, customCSSNames);\n      parts.push({\n        name: "css",\n        body: parsedCSS.selector,\n        source: part.body\n      });\n      continue;\n    }\n    if (kNestedSelectorNames.has(part.name)) {\n      let innerSelector;\n      let distance;\n      try {\n        const unescaped = JSON.parse("[" + part.body + "]");\n        if (!Array.isArray(unescaped) || unescaped.length < 1 || unescaped.length > 2 || typeof unescaped[0] !== "string")\n          throw new InvalidSelectorError(`Malformed selector: ${part.name}=` + part.body);\n        innerSelector = unescaped[0];\n        if (unescaped.length === 2) {\n          if (typeof unescaped[1] !== "number" || !kNestedSelectorNamesWithDistance.has(part.name))\n            throw new InvalidSelectorError(`Malformed selector: ${part.name}=` + part.body);\n          distance = unescaped[1];\n        }\n      } catch (e) {\n        throw new InvalidSelectorError(`Malformed selector: ${part.name}=` + part.body);\n      }\n      const nested = { name: part.name, source: part.body, body: { parsed: parseSelector(innerSelector), distance } };\n      const lastFrame = [...nested.body.parsed.parts].reverse().find((part2) => part2.name === "internal:control" && part2.body === "enter-frame");\n      const lastFrameIndex = lastFrame ? nested.body.parsed.parts.indexOf(lastFrame) : -1;\n      if (lastFrameIndex !== -1 && selectorPartsEqual(nested.body.parsed.parts.slice(0, lastFrameIndex + 1), parts.slice(0, lastFrameIndex + 1)))\n        nested.body.parsed.parts.splice(0, lastFrameIndex + 1);\n      parts.push(nested);\n      continue;\n    }\n    parts.push({ ...part, source: part.body });\n  }\n  if (kNestedSelectorNames.has(parts[0].name))\n    throw new InvalidSelectorError(`"${parts[0].name}" selector cannot be first`);\n  return {\n    capture: parsedStrings.capture,\n    parts\n  };\n}\nfunction selectorPartsEqual(list1, list2) {\n  return stringifySelector({ parts: list1 }) === stringifySelector({ parts: list2 });\n}\nfunction stringifySelector(selector, forceEngineName) {\n  if (typeof selector === "string")\n    return selector;\n  return selector.parts.map((p, i) => {\n    let includeEngine = true;\n    if (!forceEngineName && i !== selector.capture) {\n      if (p.name === "css")\n        includeEngine = false;\n      else if (p.name === "xpath" && p.source.startsWith("//") || p.source.startsWith(".."))\n        includeEngine = false;\n    }\n    const prefix = includeEngine ? p.name + "=" : "";\n    return `${i === selector.capture ? "*" : ""}${prefix}${p.source}`;\n  }).join(" >> ");\n}\nfunction visitAllSelectorParts(selector, visitor) {\n  const visit = (selector2, nested) => {\n    for (const part of selector2.parts) {\n      visitor(part, nested);\n      if (kNestedSelectorNames.has(part.name))\n        visit(part.body.parsed, true);\n    }\n  };\n  visit(selector, false);\n}\nfunction parseSelectorString(selector) {\n  let index = 0;\n  let quote;\n  let start = 0;\n  const result = { parts: [] };\n  const append = () => {\n    const part = selector.substring(start, index).trim();\n    const eqIndex = part.indexOf("=");\n    let name;\n    let body;\n    if (eqIndex !== -1 && part.substring(0, eqIndex).trim().match(/^[a-zA-Z_0-9-+:*]+$/)) {\n      name = part.substring(0, eqIndex).trim();\n      body = part.substring(eqIndex + 1);\n    } else if (part.length > 1 && part[0] === \'"\' && part[part.length - 1] === \'"\') {\n      name = "text";\n      body = part;\n    } else if (part.length > 1 && part[0] === "\'" && part[part.length - 1] === "\'") {\n      name = "text";\n      body = part;\n    } else if (/^\\(*\\/\\//.test(part) || part.startsWith("..")) {\n      name = "xpath";\n      body = part;\n    } else {\n      name = "css";\n      body = part;\n    }\n    let capture = false;\n    if (name[0] === "*") {\n      capture = true;\n      name = name.substring(1);\n    }\n    result.parts.push({ name, body });\n    if (capture) {\n      if (result.capture !== void 0)\n        throw new InvalidSelectorError(`Only one of the selectors can capture using * modifier`);\n      result.capture = result.parts.length - 1;\n    }\n  };\n  if (!selector.includes(">>")) {\n    index = selector.length;\n    append();\n    return result;\n  }\n  const shouldIgnoreTextSelectorQuote = () => {\n    const prefix = selector.substring(start, index);\n    const match = prefix.match(/^\\s*text\\s*=(.*)$/);\n    return !!match && !!match[1];\n  };\n  while (index < selector.length) {\n    const c = selector[index];\n    if (c === "\\\\" && index + 1 < selector.length) {\n      index += 2;\n    } else if (c === quote) {\n      quote = void 0;\n      index++;\n    } else if (!quote && (c === \'"\' || c === "\'" || c === "`") && !shouldIgnoreTextSelectorQuote()) {\n      quote = c;\n      index++;\n    } else if (!quote && c === ">" && selector[index + 1] === ">") {\n      append();\n      index += 2;\n      start = index;\n    } else {\n      index++;\n    }\n  }\n  append();\n  return result;\n}\nfunction parseAttributeSelector(selector, allowUnquotedStrings) {\n  let wp = 0;\n  let EOL = selector.length === 0;\n  const next = () => selector[wp] || "";\n  const eat1 = () => {\n    const result2 = next();\n    ++wp;\n    EOL = wp >= selector.length;\n    return result2;\n  };\n  const syntaxError = (stage) => {\n    if (EOL)\n      throw new InvalidSelectorError(`Unexpected end of selector while parsing selector \\`${selector}\\``);\n    throw new InvalidSelectorError(`Error while parsing selector \\`${selector}\\` - unexpected symbol "${next()}" at position ${wp}` + (stage ? " during " + stage : ""));\n  };\n  function skipSpaces() {\n    while (!EOL && /\\s/.test(next()))\n      eat1();\n  }\n  function isCSSNameChar(char) {\n    return char >= "\\x80" || char >= "0" && char <= "9" || char >= "A" && char <= "Z" || char >= "a" && char <= "z" || char >= "0" && char <= "9" || char === "_" || char === "-";\n  }\n  function readIdentifier() {\n    let result2 = "";\n    skipSpaces();\n    while (!EOL && isCSSNameChar(next()))\n      result2 += eat1();\n    return result2;\n  }\n  function readQuotedString(quote) {\n    let result2 = eat1();\n    if (result2 !== quote)\n      syntaxError("parsing quoted string");\n    while (!EOL && next() !== quote) {\n      if (next() === "\\\\")\n        eat1();\n      result2 += eat1();\n    }\n    if (next() !== quote)\n      syntaxError("parsing quoted string");\n    result2 += eat1();\n    return result2;\n  }\n  function readRegularExpression() {\n    if (eat1() !== "/")\n      syntaxError("parsing regular expression");\n    let source = "";\n    let inClass = false;\n    while (!EOL) {\n      if (next() === "\\\\") {\n        source += eat1();\n        if (EOL)\n          syntaxError("parsing regular expression");\n      } else if (inClass && next() === "]") {\n        inClass = false;\n      } else if (!inClass && next() === "[") {\n        inClass = true;\n      } else if (!inClass && next() === "/") {\n        break;\n      }\n      source += eat1();\n    }\n    if (eat1() !== "/")\n      syntaxError("parsing regular expression");\n    let flags = "";\n    while (!EOL && next().match(/[dgimsuy]/))\n      flags += eat1();\n    try {\n      return new RegExp(source, flags);\n    } catch (e) {\n      throw new InvalidSelectorError(`Error while parsing selector \\`${selector}\\`: ${e.message}`);\n    }\n  }\n  function readAttributeToken() {\n    let token = "";\n    skipSpaces();\n    if (next() === `\'` || next() === `"`)\n      token = readQuotedString(next()).slice(1, -1);\n    else\n      token = readIdentifier();\n    if (!token)\n      syntaxError("parsing property path");\n    return token;\n  }\n  function readOperator() {\n    skipSpaces();\n    let op = "";\n    if (!EOL)\n      op += eat1();\n    if (!EOL && op !== "=")\n      op += eat1();\n    if (!["=", "*=", "^=", "$=", "|=", "~="].includes(op))\n      syntaxError("parsing operator");\n    return op;\n  }\n  function readAttribute() {\n    eat1();\n    const jsonPath = [];\n    jsonPath.push(readAttributeToken());\n    skipSpaces();\n    while (next() === ".") {\n      eat1();\n      jsonPath.push(readAttributeToken());\n      skipSpaces();\n    }\n    if (next() === "]") {\n      eat1();\n      return { name: jsonPath.join("."), jsonPath, op: "<truthy>", value: null, caseSensitive: false };\n    }\n    const operator = readOperator();\n    let value = void 0;\n    let caseSensitive = true;\n    skipSpaces();\n    if (next() === "/") {\n      if (operator !== "=")\n        throw new InvalidSelectorError(`Error while parsing selector \\`${selector}\\` - cannot use ${operator} in attribute with regular expression`);\n      value = readRegularExpression();\n    } else if (next() === `\'` || next() === `"`) {\n      value = readQuotedString(next()).slice(1, -1);\n      skipSpaces();\n      if (next() === "i" || next() === "I") {\n        caseSensitive = false;\n        eat1();\n      } else if (next() === "s" || next() === "S") {\n        caseSensitive = true;\n        eat1();\n      }\n    } else {\n      value = "";\n      while (!EOL && (isCSSNameChar(next()) || next() === "+" || next() === "."))\n        value += eat1();\n      if (value === "true") {\n        value = true;\n      } else if (value === "false") {\n        value = false;\n      } else {\n        if (!allowUnquotedStrings) {\n          value = +value;\n          if (Number.isNaN(value))\n            syntaxError("parsing attribute value");\n        }\n      }\n    }\n    skipSpaces();\n    if (next() !== "]")\n      syntaxError("parsing attribute value");\n    eat1();\n    if (operator !== "=" && typeof value !== "string")\n      throw new InvalidSelectorError(`Error while parsing selector \\`${selector}\\` - cannot use ${operator} in attribute with non-string matching value - ${value}`);\n    return { name: jsonPath.join("."), jsonPath, op: operator, value, caseSensitive };\n  }\n  const result = {\n    name: "",\n    attributes: []\n  };\n  result.name = readIdentifier();\n  skipSpaces();\n  while (next() === "[") {\n    result.attributes.push(readAttribute());\n    skipSpaces();\n  }\n  if (!EOL)\n    syntaxError(void 0);\n  if (!result.name && !result.attributes.length)\n    throw new InvalidSelectorError(`Error while parsing selector \\`${selector}\\` - selector cannot be empty`);\n  return result;\n}\n\n// packages/isomorphic/stringUtils.ts\nfunction escapeWithQuotes(text, char = "\'") {\n  const stringified = JSON.stringify(text);\n  const escapedText = stringified.substring(1, stringified.length - 1).replace(/\\\\"/g, \'"\');\n  if (char === "\'")\n    return char + escapedText.replace(/[\']/g, "\\\\\'") + char;\n  if (char === \'"\')\n    return char + escapedText.replace(/["]/g, \'\\\\"\') + char;\n  if (char === "`")\n    return char + escapedText.replace(/[`]/g, "\\\\`") + char;\n  throw new Error("Invalid escape char");\n}\nfunction toTitleCase(name) {\n  return name.charAt(0).toUpperCase() + name.substring(1);\n}\nfunction toSnakeCase(name) {\n  return name.replace(/([a-z0-9])([A-Z])/g, "$1_$2").replace(/([A-Z])([A-Z][a-z])/g, "$1_$2").toLowerCase();\n}\nfunction quoteCSSAttributeValue(text) {\n  return `"${text.replace(/["\\\\]/g, (char) => "\\\\" + char)}"`;\n}\nvar normalizedWhitespaceCache;\nfunction cacheNormalizedWhitespaces() {\n  normalizedWhitespaceCache = /* @__PURE__ */ new Map();\n}\nfunction normalizeWhiteSpace(text) {\n  let result = normalizedWhitespaceCache == null ? void 0 : normalizedWhitespaceCache.get(text);\n  if (result === void 0) {\n    result = text.replace(/[\\u200b\\u00ad]/g, "").trim().replace(/\\s+/g, " ");\n    normalizedWhitespaceCache == null ? void 0 : normalizedWhitespaceCache.set(text, result);\n  }\n  return result;\n}\nfunction normalizeEscapedRegexQuotes(source) {\n  return source.replace(/(^|[^\\\\])(\\\\\\\\)*\\\\([\'"`])/g, "$1$2$3");\n}\nfunction escapeRegexForSelector(re) {\n  if (re.unicode || re.unicodeSets)\n    return String(re);\n  return String(re).replace(/(^|[^\\\\])(\\\\\\\\)*(["\'`])/g, "$1$2\\\\$3").replace(/>>/g, "\\\\>\\\\>");\n}\nfunction escapeForTextSelector(text, exact) {\n  if (typeof text !== "string")\n    return escapeRegexForSelector(text);\n  return `${JSON.stringify(text)}${exact ? "s" : "i"}`;\n}\nfunction escapeForAttributeSelector(value, exact) {\n  if (typeof value !== "string")\n    return escapeRegexForSelector(value);\n  return `"${value.replace(/\\\\/g, "\\\\\\\\").replace(/["]/g, \'\\\\"\')}"${exact ? "s" : "i"}`;\n}\nfunction trimString(input, cap, suffix = "") {\n  if (input.length <= cap)\n    return input;\n  const chars = [...input];\n  if (chars.length > cap)\n    return chars.slice(0, cap - suffix.length).join("") + suffix;\n  return chars.join("");\n}\nfunction trimStringWithEllipsis(input, cap) {\n  return trimString(input, cap, "\\u2026");\n}\nfunction escapeRegExp(s) {\n  return s.replace(/[.*+?^${}()|[\\]\\\\]/g, "\\\\$&");\n}\nfunction longestCommonSubstring(s1, s2) {\n  const n = s1.length;\n  const m = s2.length;\n  let maxLen = 0;\n  let endingIndex = 0;\n  const dp = Array(n + 1).fill(null).map(() => Array(m + 1).fill(0));\n  for (let i = 1; i <= n; i++) {\n    for (let j = 1; j <= m; j++) {\n      if (s1[i - 1] === s2[j - 1]) {\n        dp[i][j] = dp[i - 1][j - 1] + 1;\n        if (dp[i][j] > maxLen) {\n          maxLen = dp[i][j];\n          endingIndex = i;\n        }\n      }\n    }\n  }\n  return s1.slice(endingIndex - maxLen, endingIndex);\n}\nvar ansiRegex = new RegExp("([\\\\u001B\\\\u009B][[\\\\]()#?]*(?:(?:(?:[a-zA-Z\\\\d]*(?:;[-a-zA-Z\\\\d\\\\/#&.:=?%@~_]*)*)?\\\\u0007)|(?:(?:\\\\d{0,4}(?:;\\\\d{0,4})*)?[\\\\dA-PR-TZcf-ntqry=><~])))", "g");\n\n// packages/isomorphic/locatorGenerators.ts\nfunction asLocator(lang, selector, isFrameLocator = false) {\n  return asLocators(lang, selector, isFrameLocator, 1)[0];\n}\nfunction asLocators(lang, selector, isFrameLocator = false, maxOutputSize = 20, preferredQuote) {\n  try {\n    return innerAsLocators(new generators[lang](preferredQuote), parseSelector(selector), isFrameLocator, maxOutputSize);\n  } catch (e) {\n    return [selector];\n  }\n}\nfunction innerAsLocators(factory, parsed, isFrameLocator = false, maxOutputSize = 20) {\n  const parts = [...parsed.parts];\n  const tokens = [];\n  let nextBase = isFrameLocator ? "frame-locator" : "page";\n  for (let index = 0; index < parts.length; index++) {\n    const part = parts[index];\n    const base = nextBase;\n    nextBase = "locator";\n    if (part.name === "internal:describe")\n      continue;\n    if (part.name === "nth") {\n      if (part.body === "0")\n        tokens.push([factory.generateLocator(base, "first", ""), factory.generateLocator(base, "nth", "0")]);\n      else if (part.body === "-1")\n        tokens.push([factory.generateLocator(base, "last", ""), factory.generateLocator(base, "nth", "-1")]);\n      else\n        tokens.push([factory.generateLocator(base, "nth", part.body)]);\n      continue;\n    }\n    if (part.name === "visible") {\n      tokens.push([factory.generateLocator(base, "visible", part.body), factory.generateLocator(base, "default", `visible=${part.body}`)]);\n      continue;\n    }\n    if (part.name === "internal:text") {\n      const { exact, text } = detectExact(part.body);\n      tokens.push([factory.generateLocator(base, "text", text, { exact })]);\n      continue;\n    }\n    if (part.name === "internal:has-text") {\n      const { exact, text } = detectExact(part.body);\n      if (!exact) {\n        tokens.push([factory.generateLocator(base, "has-text", text, { exact })]);\n        continue;\n      }\n    }\n    if (part.name === "internal:has-not-text") {\n      const { exact, text } = detectExact(part.body);\n      if (!exact) {\n        tokens.push([factory.generateLocator(base, "has-not-text", text, { exact })]);\n        continue;\n      }\n    }\n    if (part.name === "internal:has") {\n      const inners = innerAsLocators(factory, part.body.parsed, false, maxOutputSize);\n      tokens.push(inners.map((inner) => factory.generateLocator(base, "has", inner)));\n      continue;\n    }\n    if (part.name === "internal:has-not") {\n      const inners = innerAsLocators(factory, part.body.parsed, false, maxOutputSize);\n      tokens.push(inners.map((inner) => factory.generateLocator(base, "hasNot", inner)));\n      continue;\n    }\n    if (part.name === "internal:and") {\n      const inners = innerAsLocators(factory, part.body.parsed, false, maxOutputSize);\n      tokens.push(inners.map((inner) => factory.generateLocator(base, "and", inner)));\n      continue;\n    }\n    if (part.name === "internal:or") {\n      const inners = innerAsLocators(factory, part.body.parsed, false, maxOutputSize);\n      tokens.push(inners.map((inner) => factory.generateLocator(base, "or", inner)));\n      continue;\n    }\n    if (part.name === "internal:chain") {\n      const inners = innerAsLocators(factory, part.body.parsed, false, maxOutputSize);\n      tokens.push(inners.map((inner) => factory.generateLocator(base, "chain", inner)));\n      continue;\n    }\n    if (part.name === "internal:label") {\n      const { exact, text } = detectExact(part.body);\n      tokens.push([factory.generateLocator(base, "label", text, { exact })]);\n      continue;\n    }\n    if (part.name === "internal:role") {\n      const attrSelector = parseAttributeSelector(part.body, true);\n      const options = { attrs: [] };\n      for (const attr of attrSelector.attributes) {\n        if (attr.name === "name") {\n          if (options.exact !== void 0 && options.exact !== attr.caseSensitive)\n            throw new Error(`Conflicting exactness in internal:role selector: ${stringifySelector({ parts: [part] })}`);\n          options.exact = attr.caseSensitive;\n          options.name = attr.value;\n        } else if (attr.name === "description") {\n          if (options.exact !== void 0 && options.exact !== attr.caseSensitive)\n            throw new Error(`Conflicting exactness in internal:role selector: ${stringifySelector({ parts: [part] })}`);\n          options.exact = attr.caseSensitive;\n          options.description = attr.value;\n        } else {\n          if (attr.name === "level" && typeof attr.value === "string")\n            attr.value = +attr.value;\n          options.attrs.push({ name: attr.name === "include-hidden" ? "includeHidden" : attr.name, value: attr.value });\n        }\n      }\n      tokens.push([factory.generateLocator(base, "role", attrSelector.name, options)]);\n      continue;\n    }\n    if (part.name === "internal:testid") {\n      const attrSelector = parseAttributeSelector(part.body, true);\n      const { value } = attrSelector.attributes[0];\n      tokens.push([factory.generateLocator(base, "test-id", value)]);\n      continue;\n    }\n    if (part.name === "internal:attr") {\n      const attrSelector = parseAttributeSelector(part.body, true);\n      const { name, value, caseSensitive } = attrSelector.attributes[0];\n      const text = value;\n      const exact = !!caseSensitive;\n      if (name === "placeholder") {\n        tokens.push([factory.generateLocator(base, "placeholder", text, { exact })]);\n        continue;\n      }\n      if (name === "alt") {\n        tokens.push([factory.generateLocator(base, "alt", text, { exact })]);\n        continue;\n      }\n      if (name === "title") {\n        tokens.push([factory.generateLocator(base, "title", text, { exact })]);\n        continue;\n      }\n    }\n    if (part.name === "internal:control" && part.body === "enter-frame") {\n      const lastTokens = tokens[tokens.length - 1];\n      const lastPart = parts[index - 1];\n      const transformed = lastTokens.map((token) => factory.chainLocators([token, factory.generateLocator(base, "frame", "")]));\n      if (["xpath", "css"].includes(lastPart.name)) {\n        transformed.push(\n          factory.generateLocator(base, "frame-locator", stringifySelector({ parts: [lastPart] })),\n          factory.generateLocator(base, "frame-locator", stringifySelector({ parts: [lastPart] }, true))\n        );\n      }\n      lastTokens.splice(0, lastTokens.length, ...transformed);\n      nextBase = "frame-locator";\n      continue;\n    }\n    const nextPart = parts[index + 1];\n    const selectorPart = stringifySelector({ parts: [part] });\n    const locatorPart = factory.generateLocator(base, "default", selectorPart);\n    if (nextPart && ["internal:has-text", "internal:has-not-text"].includes(nextPart.name)) {\n      const { exact, text } = detectExact(nextPart.body);\n      if (!exact) {\n        const nextLocatorPart = factory.generateLocator("locator", nextPart.name === "internal:has-text" ? "has-text" : "has-not-text", text, { exact });\n        const options = {};\n        if (nextPart.name === "internal:has-text")\n          options.hasText = text;\n        else\n          options.hasNotText = text;\n        const combinedPart = factory.generateLocator(base, "default", selectorPart, options);\n        tokens.push([factory.chainLocators([locatorPart, nextLocatorPart]), combinedPart]);\n        index++;\n        continue;\n      }\n    }\n    let locatorPartWithEngine;\n    if (["xpath", "css"].includes(part.name)) {\n      const selectorPart2 = stringifySelector(\n        { parts: [part] },\n        /* forceEngineName */\n        true\n      );\n      locatorPartWithEngine = factory.generateLocator(base, "default", selectorPart2);\n    }\n    tokens.push([locatorPart, locatorPartWithEngine].filter(Boolean));\n  }\n  return combineTokens(factory, tokens, maxOutputSize);\n}\nfunction combineTokens(factory, tokens, maxOutputSize) {\n  const currentTokens = tokens.map(() => "");\n  const result = [];\n  const visit = (index) => {\n    if (index === tokens.length) {\n      result.push(factory.chainLocators(currentTokens));\n      return result.length < maxOutputSize;\n    }\n    for (const taken of tokens[index]) {\n      currentTokens[index] = taken;\n      if (!visit(index + 1))\n        return false;\n    }\n    return true;\n  };\n  visit(0);\n  return result;\n}\nfunction detectExact(text) {\n  let exact = false;\n  const match = text.match(/^\\/(.*)\\/([igm]*)$/);\n  if (match)\n    return { text: new RegExp(match[1], match[2]) };\n  if (text.endsWith(\'"\')) {\n    text = JSON.parse(text);\n    exact = true;\n  } else if (text.endsWith(\'"s\')) {\n    text = JSON.parse(text.substring(0, text.length - 1));\n    exact = true;\n  } else if (text.endsWith(\'"i\')) {\n    text = JSON.parse(text.substring(0, text.length - 1));\n    exact = false;\n  }\n  return { exact, text };\n}\nvar JavaScriptLocatorFactory = class {\n  constructor(preferredQuote) {\n    this.preferredQuote = preferredQuote;\n  }\n  generateLocator(base, kind, body, options = {}) {\n    switch (kind) {\n      case "default":\n        if (options.hasText !== void 0)\n          return `locator(${this.quote(body)}, { hasText: ${this.toHasText(options.hasText)} })`;\n        if (options.hasNotText !== void 0)\n          return `locator(${this.quote(body)}, { hasNotText: ${this.toHasText(options.hasNotText)} })`;\n        return `locator(${this.quote(body)})`;\n      case "frame-locator":\n        return `frameLocator(${this.quote(body)})`;\n      case "frame":\n        return `contentFrame()`;\n      case "nth":\n        return `nth(${body})`;\n      case "first":\n        return `first()`;\n      case "last":\n        return `last()`;\n      case "visible":\n        return `filter({ visible: ${body === "true" ? "true" : "false"} })`;\n      case "role":\n        const attrs = [];\n        if (isRegExp(options.name))\n          attrs.push(`name: ${this.regexToSourceString(options.name)}`);\n        else if (typeof options.name === "string")\n          attrs.push(`name: ${this.quote(options.name)}`);\n        if (isRegExp(options.description))\n          attrs.push(`description: ${this.regexToSourceString(options.description)}`);\n        else if (typeof options.description === "string")\n          attrs.push(`description: ${this.quote(options.description)}`);\n        if (options.exact && (typeof options.name === "string" || typeof options.description === "string"))\n          attrs.push(`exact: true`);\n        for (const { name, value } of options.attrs)\n          attrs.push(`${name}: ${typeof value === "string" ? this.quote(value) : value}`);\n        const attrString = attrs.length ? `, { ${attrs.join(", ")} }` : "";\n        return `getByRole(${this.quote(body)}${attrString})`;\n      case "has-text":\n        return `filter({ hasText: ${this.toHasText(body)} })`;\n      case "has-not-text":\n        return `filter({ hasNotText: ${this.toHasText(body)} })`;\n      case "has":\n        return `filter({ has: ${body} })`;\n      case "hasNot":\n        return `filter({ hasNot: ${body} })`;\n      case "and":\n        return `and(${body})`;\n      case "or":\n        return `or(${body})`;\n      case "chain":\n        return `locator(${body})`;\n      case "test-id":\n        return `getByTestId(${this.toTestIdValue(body)})`;\n      case "text":\n        return this.toCallWithExact("getByText", body, !!options.exact);\n      case "alt":\n        return this.toCallWithExact("getByAltText", body, !!options.exact);\n      case "placeholder":\n        return this.toCallWithExact("getByPlaceholder", body, !!options.exact);\n      case "label":\n        return this.toCallWithExact("getByLabel", body, !!options.exact);\n      case "title":\n        return this.toCallWithExact("getByTitle", body, !!options.exact);\n      default:\n        throw new Error("Unknown selector kind " + kind);\n    }\n  }\n  chainLocators(locators) {\n    return locators.join(".");\n  }\n  regexToSourceString(re) {\n    return normalizeEscapedRegexQuotes(String(re));\n  }\n  toCallWithExact(method, body, exact) {\n    if (isRegExp(body))\n      return `${method}(${this.regexToSourceString(body)})`;\n    return exact ? `${method}(${this.quote(body)}, { exact: true })` : `${method}(${this.quote(body)})`;\n  }\n  toHasText(body) {\n    if (isRegExp(body))\n      return this.regexToSourceString(body);\n    return this.quote(body);\n  }\n  toTestIdValue(value) {\n    if (isRegExp(value))\n      return this.regexToSourceString(value);\n    return this.quote(value);\n  }\n  quote(text) {\n    var _a;\n    return escapeWithQuotes(text, (_a = this.preferredQuote) != null ? _a : "\'");\n  }\n};\nvar PythonLocatorFactory = class {\n  generateLocator(base, kind, body, options = {}) {\n    switch (kind) {\n      case "default":\n        if (options.hasText !== void 0)\n          return `locator(${this.quote(body)}, has_text=${this.toHasText(options.hasText)})`;\n        if (options.hasNotText !== void 0)\n          return `locator(${this.quote(body)}, has_not_text=${this.toHasText(options.hasNotText)})`;\n        return `locator(${this.quote(body)})`;\n      case "frame-locator":\n        return `frame_locator(${this.quote(body)})`;\n      case "frame":\n        return `content_frame`;\n      case "nth":\n        return `nth(${body})`;\n      case "first":\n        return `first`;\n      case "last":\n        return `last`;\n      case "visible":\n        return `filter(visible=${body === "true" ? "True" : "False"})`;\n      case "role":\n        const attrs = [];\n        if (isRegExp(options.name))\n          attrs.push(`name=${this.regexToString(options.name)}`);\n        else if (typeof options.name === "string")\n          attrs.push(`name=${this.quote(options.name)}`);\n        if (isRegExp(options.description))\n          attrs.push(`description=${this.regexToString(options.description)}`);\n        else if (typeof options.description === "string")\n          attrs.push(`description=${this.quote(options.description)}`);\n        if (options.exact && (typeof options.name === "string" || typeof options.description === "string"))\n          attrs.push(`exact=True`);\n        for (const { name, value } of options.attrs) {\n          let valueString = typeof value === "string" ? this.quote(value) : value;\n          if (typeof value === "boolean")\n            valueString = value ? "True" : "False";\n          attrs.push(`${toSnakeCase(name)}=${valueString}`);\n        }\n        const attrString = attrs.length ? `, ${attrs.join(", ")}` : "";\n        return `get_by_role(${this.quote(body)}${attrString})`;\n      case "has-text":\n        return `filter(has_text=${this.toHasText(body)})`;\n      case "has-not-text":\n        return `filter(has_not_text=${this.toHasText(body)})`;\n      case "has":\n        return `filter(has=${body})`;\n      case "hasNot":\n        return `filter(has_not=${body})`;\n      case "and":\n        return `and_(${body})`;\n      case "or":\n        return `or_(${body})`;\n      case "chain":\n        return `locator(${body})`;\n      case "test-id":\n        return `get_by_test_id(${this.toTestIdValue(body)})`;\n      case "text":\n        return this.toCallWithExact("get_by_text", body, !!options.exact);\n      case "alt":\n        return this.toCallWithExact("get_by_alt_text", body, !!options.exact);\n      case "placeholder":\n        return this.toCallWithExact("get_by_placeholder", body, !!options.exact);\n      case "label":\n        return this.toCallWithExact("get_by_label", body, !!options.exact);\n      case "title":\n        return this.toCallWithExact("get_by_title", body, !!options.exact);\n      default:\n        throw new Error("Unknown selector kind " + kind);\n    }\n  }\n  chainLocators(locators) {\n    return locators.join(".");\n  }\n  regexToString(body) {\n    const suffix = body.flags.includes("i") ? ", re.IGNORECASE" : "";\n    return `re.compile(r"${normalizeEscapedRegexQuotes(body.source).replace(/\\\\\\//, "/").replace(/"/g, \'\\\\"\')}"${suffix})`;\n  }\n  toCallWithExact(method, body, exact) {\n    if (isRegExp(body))\n      return `${method}(${this.regexToString(body)})`;\n    if (exact)\n      return `${method}(${this.quote(body)}, exact=True)`;\n    return `${method}(${this.quote(body)})`;\n  }\n  toHasText(body) {\n    if (isRegExp(body))\n      return this.regexToString(body);\n    return `${this.quote(body)}`;\n  }\n  toTestIdValue(value) {\n    if (isRegExp(value))\n      return this.regexToString(value);\n    return this.quote(value);\n  }\n  quote(text) {\n    return escapeWithQuotes(text, \'"\');\n  }\n};\nvar JavaLocatorFactory = class {\n  generateLocator(base, kind, body, options = {}) {\n    let clazz;\n    switch (base) {\n      case "page":\n        clazz = "Page";\n        break;\n      case "frame-locator":\n        clazz = "FrameLocator";\n        break;\n      case "locator":\n        clazz = "Locator";\n        break;\n    }\n    switch (kind) {\n      case "default":\n        if (options.hasText !== void 0)\n          return `locator(${this.quote(body)}, new ${clazz}.LocatorOptions().setHasText(${this.toHasText(options.hasText)}))`;\n        if (options.hasNotText !== void 0)\n          return `locator(${this.quote(body)}, new ${clazz}.LocatorOptions().setHasNotText(${this.toHasText(options.hasNotText)}))`;\n        return `locator(${this.quote(body)})`;\n      case "frame-locator":\n        return `frameLocator(${this.quote(body)})`;\n      case "frame":\n        return `contentFrame()`;\n      case "nth":\n        return `nth(${body})`;\n      case "first":\n        return `first()`;\n      case "last":\n        return `last()`;\n      case "visible":\n        return `filter(new ${clazz}.FilterOptions().setVisible(${body === "true" ? "true" : "false"}))`;\n      case "role":\n        const attrs = [];\n        if (isRegExp(options.name))\n          attrs.push(`.setName(${this.regexToString(options.name)})`);\n        else if (typeof options.name === "string")\n          attrs.push(`.setName(${this.quote(options.name)})`);\n        if (isRegExp(options.description))\n          attrs.push(`.setDescription(${this.regexToString(options.description)})`);\n        else if (typeof options.description === "string")\n          attrs.push(`.setDescription(${this.quote(options.description)})`);\n        if (options.exact && (typeof options.name === "string" || typeof options.description === "string"))\n          attrs.push(`.setExact(true)`);\n        for (const { name, value } of options.attrs)\n          attrs.push(`.set${toTitleCase(name)}(${typeof value === "string" ? this.quote(value) : value})`);\n        const attrString = attrs.length ? `, new ${clazz}.GetByRoleOptions()${attrs.join("")}` : "";\n        return `getByRole(AriaRole.${toSnakeCase(body).toUpperCase()}${attrString})`;\n      case "has-text":\n        return `filter(new ${clazz}.FilterOptions().setHasText(${this.toHasText(body)}))`;\n      case "has-not-text":\n        return `filter(new ${clazz}.FilterOptions().setHasNotText(${this.toHasText(body)}))`;\n      case "has":\n        return `filter(new ${clazz}.FilterOptions().setHas(${body}))`;\n      case "hasNot":\n        return `filter(new ${clazz}.FilterOptions().setHasNot(${body}))`;\n      case "and":\n        return `and(${body})`;\n      case "or":\n        return `or(${body})`;\n      case "chain":\n        return `locator(${body})`;\n      case "test-id":\n        return `getByTestId(${this.toTestIdValue(body)})`;\n      case "text":\n        return this.toCallWithExact(clazz, "getByText", body, !!options.exact);\n      case "alt":\n        return this.toCallWithExact(clazz, "getByAltText", body, !!options.exact);\n      case "placeholder":\n        return this.toCallWithExact(clazz, "getByPlaceholder", body, !!options.exact);\n      case "label":\n        return this.toCallWithExact(clazz, "getByLabel", body, !!options.exact);\n      case "title":\n        return this.toCallWithExact(clazz, "getByTitle", body, !!options.exact);\n      default:\n        throw new Error("Unknown selector kind " + kind);\n    }\n  }\n  chainLocators(locators) {\n    return locators.join(".");\n  }\n  regexToString(body) {\n    const suffix = body.flags.includes("i") ? ", Pattern.CASE_INSENSITIVE" : "";\n    return `Pattern.compile(${this.quote(normalizeEscapedRegexQuotes(body.source))}${suffix})`;\n  }\n  toCallWithExact(clazz, method, body, exact) {\n    if (isRegExp(body))\n      return `${method}(${this.regexToString(body)})`;\n    if (exact)\n      return `${method}(${this.quote(body)}, new ${clazz}.${toTitleCase(method)}Options().setExact(true))`;\n    return `${method}(${this.quote(body)})`;\n  }\n  toHasText(body) {\n    if (isRegExp(body))\n      return this.regexToString(body);\n    return this.quote(body);\n  }\n  toTestIdValue(value) {\n    if (isRegExp(value))\n      return this.regexToString(value);\n    return this.quote(value);\n  }\n  quote(text) {\n    return escapeWithQuotes(text, \'"\');\n  }\n};\nvar CSharpLocatorFactory = class {\n  generateLocator(base, kind, body, options = {}) {\n    switch (kind) {\n      case "default":\n        if (options.hasText !== void 0)\n          return `Locator(${this.quote(body)}, new() { ${this.toHasText(options.hasText)} })`;\n        if (options.hasNotText !== void 0)\n          return `Locator(${this.quote(body)}, new() { ${this.toHasNotText(options.hasNotText)} })`;\n        return `Locator(${this.quote(body)})`;\n      case "frame-locator":\n        return `FrameLocator(${this.quote(body)})`;\n      case "frame":\n        return `ContentFrame`;\n      case "nth":\n        return `Nth(${body})`;\n      case "first":\n        return `First`;\n      case "last":\n        return `Last`;\n      case "visible":\n        return `Filter(new() { Visible = ${body === "true" ? "true" : "false"} })`;\n      case "role":\n        const attrs = [];\n        if (isRegExp(options.name))\n          attrs.push(`NameRegex = ${this.regexToString(options.name)}`);\n        else if (typeof options.name === "string")\n          attrs.push(`Name = ${this.quote(options.name)}`);\n        if (isRegExp(options.description))\n          attrs.push(`DescriptionRegex = ${this.regexToString(options.description)}`);\n        else if (typeof options.description === "string")\n          attrs.push(`Description = ${this.quote(options.description)}`);\n        if (options.exact && (typeof options.name === "string" || typeof options.description === "string"))\n          attrs.push(`Exact = true`);\n        for (const { name, value } of options.attrs)\n          attrs.push(`${toTitleCase(name)} = ${typeof value === "string" ? this.quote(value) : value}`);\n        const attrString = attrs.length ? `, new() { ${attrs.join(", ")} }` : "";\n        return `GetByRole(AriaRole.${toTitleCase(body)}${attrString})`;\n      case "has-text":\n        return `Filter(new() { ${this.toHasText(body)} })`;\n      case "has-not-text":\n        return `Filter(new() { ${this.toHasNotText(body)} })`;\n      case "has":\n        return `Filter(new() { Has = ${body} })`;\n      case "hasNot":\n        return `Filter(new() { HasNot = ${body} })`;\n      case "and":\n        return `And(${body})`;\n      case "or":\n        return `Or(${body})`;\n      case "chain":\n        return `Locator(${body})`;\n      case "test-id":\n        return `GetByTestId(${this.toTestIdValue(body)})`;\n      case "text":\n        return this.toCallWithExact("GetByText", body, !!options.exact);\n      case "alt":\n        return this.toCallWithExact("GetByAltText", body, !!options.exact);\n      case "placeholder":\n        return this.toCallWithExact("GetByPlaceholder", body, !!options.exact);\n      case "label":\n        return this.toCallWithExact("GetByLabel", body, !!options.exact);\n      case "title":\n        return this.toCallWithExact("GetByTitle", body, !!options.exact);\n      default:\n        throw new Error("Unknown selector kind " + kind);\n    }\n  }\n  chainLocators(locators) {\n    return locators.join(".");\n  }\n  regexToString(body) {\n    const suffix = body.flags.includes("i") ? ", RegexOptions.IgnoreCase" : "";\n    return `new Regex(${this.quote(normalizeEscapedRegexQuotes(body.source))}${suffix})`;\n  }\n  toCallWithExact(method, body, exact) {\n    if (isRegExp(body))\n      return `${method}(${this.regexToString(body)})`;\n    if (exact)\n      return `${method}(${this.quote(body)}, new() { Exact = true })`;\n    return `${method}(${this.quote(body)})`;\n  }\n  toHasText(body) {\n    if (isRegExp(body))\n      return `HasTextRegex = ${this.regexToString(body)}`;\n    return `HasText = ${this.quote(body)}`;\n  }\n  toTestIdValue(value) {\n    if (isRegExp(value))\n      return this.regexToString(value);\n    return this.quote(value);\n  }\n  toHasNotText(body) {\n    if (isRegExp(body))\n      return `HasNotTextRegex = ${this.regexToString(body)}`;\n    return `HasNotText = ${this.quote(body)}`;\n  }\n  quote(text) {\n    return escapeWithQuotes(text, \'"\');\n  }\n};\nvar JsonlLocatorFactory = class {\n  generateLocator(base, kind, body, options = {}) {\n    return JSON.stringify({\n      kind,\n      body,\n      options\n    });\n  }\n  chainLocators(locators) {\n    const objects = locators.map((l) => JSON.parse(l));\n    for (let i = 0; i < objects.length - 1; ++i)\n      objects[i].next = objects[i + 1];\n    return JSON.stringify(objects[0]);\n  }\n};\nvar generators = {\n  javascript: JavaScriptLocatorFactory,\n  python: PythonLocatorFactory,\n  java: JavaLocatorFactory,\n  csharp: CSharpLocatorFactory,\n  jsonl: JsonlLocatorFactory\n};\nfunction isRegExp(obj) {\n  return obj instanceof RegExp;\n}\n\n// packages/isomorphic/locatorUtils.ts\nfunction getByAttributeTextSelector(attrName, text, options) {\n  return `internal:attr=[${attrName}=${escapeForAttributeSelector(text, (options == null ? void 0 : options.exact) || false)}]`;\n}\nfunction splitTestIdAttributeNames(testIdAttributeName) {\n  return testIdAttributeName.split(",");\n}\nfunction encodeTestIdAttributeName(testIdAttributeName) {\n  return testIdAttributeName.includes(",") ? JSON.stringify(testIdAttributeName) : testIdAttributeName;\n}\nfunction getByTestIdSelector(testIdAttributeName, testId) {\n  return `internal:testid=[${encodeTestIdAttributeName(testIdAttributeName)}=${escapeForAttributeSelector(testId, true)}]`;\n}\nfunction getByLabelSelector(text, options) {\n  return "internal:label=" + escapeForTextSelector(text, !!(options == null ? void 0 : options.exact));\n}\nfunction getByAltTextSelector(text, options) {\n  return getByAttributeTextSelector("alt", text, options);\n}\nfunction getByTitleSelector(text, options) {\n  return getByAttributeTextSelector("title", text, options);\n}\nfunction getByPlaceholderSelector(text, options) {\n  return getByAttributeTextSelector("placeholder", text, options);\n}\nfunction getByTextSelector(text, options) {\n  return "internal:text=" + escapeForTextSelector(text, !!(options == null ? void 0 : options.exact));\n}\nfunction getByRoleSelector(role, options = {}) {\n  const props = [];\n  if (options.checked !== void 0)\n    props.push(["checked", String(options.checked)]);\n  if (options.disabled !== void 0)\n    props.push(["disabled", String(options.disabled)]);\n  if (options.selected !== void 0)\n    props.push(["selected", String(options.selected)]);\n  if (options.expanded !== void 0)\n    props.push(["expanded", String(options.expanded)]);\n  if (options.includeHidden !== void 0)\n    props.push(["include-hidden", String(options.includeHidden)]);\n  if (options.level !== void 0)\n    props.push(["level", String(options.level)]);\n  if (options.name !== void 0)\n    props.push(["name", escapeForAttributeSelector(options.name, !!options.exact)]);\n  if (options.description !== void 0)\n    props.push(["description", escapeForAttributeSelector(options.description, !!options.exact)]);\n  if (options.pressed !== void 0)\n    props.push(["pressed", String(options.pressed)]);\n  return `internal:role=${role}${props.map(([n, v]) => `[${n}=${v}]`).join("")}`;\n}\n\n// packages/isomorphic/yaml.ts\nfunction yamlEscapeKeyIfNeeded(str) {\n  if (!yamlStringNeedsQuotes(str))\n    return str;\n  return `\'` + str.replace(/\'/g, `\'\'`) + `\'`;\n}\nfunction yamlEscapeValueIfNeeded(str) {\n  if (!yamlStringNeedsQuotes(str))\n    return str;\n  return \'"\' + str.replace(/[\\\\"\\x00-\\x1f\\x7f-\\x9f]/g, (c) => {\n    switch (c) {\n      case "\\\\":\n        return "\\\\\\\\";\n      case \'"\':\n        return \'\\\\"\';\n      case "\\b":\n        return "\\\\b";\n      case "\\f":\n        return "\\\\f";\n      case "\\n":\n        return "\\\\n";\n      case "\\r":\n        return "\\\\r";\n      case "	":\n        return "\\\\t";\n      default:\n        const code = c.charCodeAt(0);\n        return "\\\\x" + code.toString(16).padStart(2, "0");\n    }\n  }) + \'"\';\n}\nfunction yamlStringNeedsQuotes(str) {\n  if (str.length === 0)\n    return true;\n  if (/^\\s|\\s$/.test(str))\n    return true;\n  if (/[\\x00-\\x08\\x0b\\x0c\\x0e-\\x1f\\x7f-\\x9f]/.test(str))\n    return true;\n  if (/^-/.test(str))\n    return true;\n  if (/[\\n:](\\s|$)/.test(str))\n    return true;\n  if (/\\s#/.test(str))\n    return true;\n  if (/[\\n\\r]/.test(str))\n    return true;\n  if (/^[&*\\],?!>|@"\'#%]/.test(str))\n    return true;\n  if (/[{}`]/.test(str))\n    return true;\n  if (/^\\[/.test(str))\n    return true;\n  if (!isNaN(Number(str)) || ["y", "n", "yes", "no", "true", "false", "on", "off", "null"].includes(str.toLowerCase()))\n    return true;\n  return false;\n}\n\n// packages/injected/src/domUtils.ts\nvar globalOptions = {};\nfunction setGlobalOptions(options) {\n  globalOptions = options;\n}\nfunction isInsideScope(scope, element) {\n  while (element) {\n    if (scope.contains(element))\n      return true;\n    element = enclosingShadowHost(element);\n  }\n  return false;\n}\nfunction parentElementOrShadowHost(element) {\n  if (element.parentElement)\n    return element.parentElement;\n  if (!element.parentNode)\n    return;\n  if (element.parentNode.nodeType === 11 && element.parentNode.host)\n    return element.parentNode.host;\n}\nfunction enclosingShadowRootOrDocument(element) {\n  let node = element;\n  while (node.parentNode)\n    node = node.parentNode;\n  if (node.nodeType === 11 || node.nodeType === 9)\n    return node;\n}\nfunction enclosingShadowHost(element) {\n  while (element.parentElement)\n    element = element.parentElement;\n  return parentElementOrShadowHost(element);\n}\nfunction closestCrossShadow(element, css, scope) {\n  while (element) {\n    const closest = element.closest(css);\n    if (scope && closest !== scope && (closest == null ? void 0 : closest.contains(scope)))\n      return;\n    if (closest)\n      return closest;\n    element = enclosingShadowHost(element);\n  }\n}\nfunction getElementComputedStyle(element, pseudo) {\n  const cache = pseudo === "::before" ? cacheStyleBefore : pseudo === "::after" ? cacheStyleAfter : cacheStyle;\n  if (cache && cache.has(element))\n    return cache.get(element);\n  const style = element.ownerDocument && element.ownerDocument.defaultView ? element.ownerDocument.defaultView.getComputedStyle(element, pseudo) : void 0;\n  cache == null ? void 0 : cache.set(element, style);\n  return style;\n}\nfunction isElementStyleVisibilityVisible(element, style) {\n  style = style != null ? style : getElementComputedStyle(element);\n  if (!style)\n    return true;\n  if (Element.prototype.checkVisibility && globalOptions.browserNameForWorkarounds !== "webkit") {\n    if (!element.checkVisibility())\n      return false;\n  } else {\n    const detailsOrSummary = element.closest("details,summary");\n    if (detailsOrSummary !== element && (detailsOrSummary == null ? void 0 : detailsOrSummary.nodeName) === "DETAILS" && !detailsOrSummary.open)\n      return false;\n  }\n  if (style.visibility !== "visible")\n    return false;\n  return true;\n}\nfunction computeBox(element) {\n  const style = getElementComputedStyle(element);\n  if (!style)\n    return { visible: true, inline: false };\n  const cursor = style.cursor;\n  if (style.display === "contents") {\n    for (let child = element.firstChild; child; child = child.nextSibling) {\n      if (child.nodeType === 1 && isElementVisible(child))\n        return { visible: true, inline: false, cursor };\n      if (child.nodeType === 3 && isVisibleTextNode(child))\n        return { visible: true, inline: true, cursor };\n    }\n    return { visible: false, inline: false, cursor };\n  }\n  if (!isElementStyleVisibilityVisible(element, style))\n    return { cursor, visible: false, inline: false };\n  const rect = element.getBoundingClientRect();\n  return { cursor, visible: rect.width > 0 && rect.height > 0, inline: style.display === "inline" };\n}\nfunction isElementVisible(element) {\n  return computeBox(element).visible;\n}\nfunction isVisibleTextNode(node) {\n  const range = node.ownerDocument.createRange();\n  range.selectNode(node);\n  const rect = range.getBoundingClientRect();\n  return rect.width > 0 && rect.height > 0;\n}\nfunction elementSafeTagName(element) {\n  const tagName = element.tagName;\n  if (typeof tagName === "string")\n    return tagName.toUpperCase();\n  if (element instanceof HTMLFormElement)\n    return "FORM";\n  return element.tagName.toUpperCase();\n}\nvar cacheStyle;\nvar cacheStyleBefore;\nvar cacheStyleAfter;\nvar cachesCounter = 0;\nfunction beginDOMCaches() {\n  ++cachesCounter;\n  cacheStyle != null ? cacheStyle : cacheStyle = /* @__PURE__ */ new Map();\n  cacheStyleBefore != null ? cacheStyleBefore : cacheStyleBefore = /* @__PURE__ */ new Map();\n  cacheStyleAfter != null ? cacheStyleAfter : cacheStyleAfter = /* @__PURE__ */ new Map();\n}\nfunction endDOMCaches() {\n  if (!--cachesCounter) {\n    cacheStyle = void 0;\n    cacheStyleBefore = void 0;\n    cacheStyleAfter = void 0;\n  }\n}\n\n// packages/injected/src/roleUtils.ts\nfunction hasExplicitAccessibleName(e) {\n  return e.hasAttribute("aria-label") || e.hasAttribute("aria-labelledby");\n}\nvar kAncestorPreventingLandmark = "article:not([role]), aside:not([role]), main:not([role]), nav:not([role]), section:not([role]), [role=article], [role=complementary], [role=main], [role=navigation], [role=region]";\nvar kGlobalAriaAttributes = [\n  ["aria-atomic", void 0],\n  ["aria-busy", void 0],\n  ["aria-controls", void 0],\n  ["aria-current", void 0],\n  ["aria-describedby", void 0],\n  ["aria-details", void 0],\n  // Global use deprecated in ARIA 1.2\n  // [\'aria-disabled\', undefined],\n  ["aria-dropeffect", void 0],\n  // Global use deprecated in ARIA 1.2\n  // [\'aria-errormessage\', undefined],\n  ["aria-flowto", void 0],\n  ["aria-grabbed", void 0],\n  // Global use deprecated in ARIA 1.2\n  // [\'aria-haspopup\', undefined],\n  ["aria-hidden", void 0],\n  // Global use deprecated in ARIA 1.2\n  // [\'aria-invalid\', undefined],\n  ["aria-keyshortcuts", void 0],\n  ["aria-label", ["caption", "code", "deletion", "emphasis", "generic", "insertion", "paragraph", "presentation", "strong", "subscript", "superscript"]],\n  ["aria-labelledby", ["caption", "code", "deletion", "emphasis", "generic", "insertion", "paragraph", "presentation", "strong", "subscript", "superscript"]],\n  ["aria-live", void 0],\n  ["aria-owns", void 0],\n  ["aria-relevant", void 0],\n  ["aria-roledescription", ["generic"]]\n];\nfunction hasGlobalAriaAttribute(element, forRole) {\n  return kGlobalAriaAttributes.some(([attr, prohibited]) => {\n    return !(prohibited == null ? void 0 : prohibited.includes(forRole || "")) && element.hasAttribute(attr);\n  });\n}\nfunction hasTabIndex(element) {\n  return !Number.isNaN(Number(String(element.getAttribute("tabindex"))));\n}\nfunction isFocusable(element) {\n  return !isNativelyDisabled(element) && (isNativelyFocusable(element) || hasTabIndex(element));\n}\nfunction isNativelyFocusable(element) {\n  const tagName = elementSafeTagName(element);\n  if (["BUTTON", "DETAILS", "SELECT", "TEXTAREA"].includes(tagName))\n    return true;\n  if (tagName === "A" || tagName === "AREA")\n    return element.hasAttribute("href");\n  if (tagName === "INPUT")\n    return !element.hidden;\n  return false;\n}\nvar kImplicitRoleByTagName = {\n  "A": (e) => {\n    return e.hasAttribute("href") ? "link" : null;\n  },\n  "AREA": (e) => {\n    return e.hasAttribute("href") ? "link" : null;\n  },\n  "ARTICLE": () => "article",\n  "ASIDE": () => "complementary",\n  "BLOCKQUOTE": () => "blockquote",\n  "BUTTON": () => "button",\n  "CAPTION": () => "caption",\n  "CODE": () => "code",\n  "DATALIST": () => "listbox",\n  "DD": () => "definition",\n  "DEL": () => "deletion",\n  "DETAILS": () => "group",\n  "DFN": () => "term",\n  "DIALOG": () => "dialog",\n  "DT": () => "term",\n  "EM": () => "emphasis",\n  "FIELDSET": () => "group",\n  "FIGURE": () => "figure",\n  "FOOTER": (e) => closestCrossShadow(e, kAncestorPreventingLandmark) ? null : "contentinfo",\n  "FORM": (e) => hasExplicitAccessibleName(e) ? "form" : null,\n  "H1": () => "heading",\n  "H2": () => "heading",\n  "H3": () => "heading",\n  "H4": () => "heading",\n  "H5": () => "heading",\n  "H6": () => "heading",\n  "HEADER": (e) => closestCrossShadow(e, kAncestorPreventingLandmark) ? null : "banner",\n  "HR": () => "separator",\n  "HTML": () => "document",\n  "IMG": (e) => e.getAttribute("alt") === "" && !e.getAttribute("title") && !hasGlobalAriaAttribute(e) && !hasTabIndex(e) ? "presentation" : "img",\n  "INPUT": (e) => {\n    const type = e.type.toLowerCase();\n    if (type === "search")\n      return e.hasAttribute("list") ? "combobox" : "searchbox";\n    if (["email", "tel", "text", "url", ""].includes(type)) {\n      const list = getIdRefs(e, e.getAttribute("list"))[0];\n      return list && elementSafeTagName(list) === "DATALIST" ? "combobox" : "textbox";\n    }\n    if (type === "hidden")\n      return null;\n    if (type === "file")\n      return "button";\n    return inputTypeToRole[type] || "textbox";\n  },\n  "INS": () => "insertion",\n  "LI": () => "listitem",\n  "MAIN": () => "main",\n  "MARK": () => "mark",\n  "MATH": () => "math",\n  "MENU": () => "list",\n  "METER": () => "meter",\n  "NAV": () => "navigation",\n  "OL": () => "list",\n  "OPTGROUP": () => "group",\n  "OPTION": () => "option",\n  "OUTPUT": () => "status",\n  "P": () => "paragraph",\n  "PROGRESS": () => "progressbar",\n  "SEARCH": () => "search",\n  "SECTION": (e) => hasExplicitAccessibleName(e) ? "region" : null,\n  "SELECT": (e) => e.hasAttribute("multiple") || e.size > 1 ? "listbox" : "combobox",\n  "STRONG": () => "strong",\n  "SUB": () => "subscript",\n  "SUP": () => "superscript",\n  // For <svg> we default to Chrome behavior:\n  // - Chrome reports \'img\'.\n  // - Firefox reports \'diagram\' that is not in official ARIA spec yet.\n  // - Safari reports \'no role\', but still computes accessible name.\n  "SVG": () => "img",\n  "TABLE": () => "table",\n  "TBODY": () => "rowgroup",\n  "TD": (e) => {\n    const table = closestCrossShadow(e, "table");\n    const role = table ? getExplicitAriaRole(table) : "";\n    return role === "grid" || role === "treegrid" ? "gridcell" : "cell";\n  },\n  "TEXTAREA": () => "textbox",\n  "TFOOT": () => "rowgroup",\n  "TH": (e) => {\n    const scope = e.getAttribute("scope");\n    if (scope === "col" || scope === "colgroup")\n      return "columnheader";\n    if (scope === "row" || scope === "rowgroup")\n      return "rowheader";\n    const nextSibling = e.nextElementSibling;\n    const prevSibling = e.previousElementSibling;\n    const row = !!e.parentElement && elementSafeTagName(e.parentElement) === "TR" ? e.parentElement : void 0;\n    if (!nextSibling && !prevSibling) {\n      if (row) {\n        const table = closestCrossShadow(row, "table");\n        if (table && table.rows.length <= 1)\n          return null;\n      }\n      return "columnheader";\n    }\n    if (isHeaderCell(nextSibling) && isHeaderCell(prevSibling))\n      return "columnheader";\n    if (isNonEmptyDataCell(nextSibling) || isNonEmptyDataCell(prevSibling))\n      return "rowheader";\n    return "columnheader";\n  },\n  "THEAD": () => "rowgroup",\n  "TIME": () => "time",\n  "TR": () => "row",\n  "UL": () => "list"\n};\nfunction isHeaderCell(element) {\n  return !!element && elementSafeTagName(element) === "TH";\n}\nfunction isNonEmptyDataCell(element) {\n  var _a;\n  if (!element || elementSafeTagName(element) !== "TD")\n    return false;\n  return !!(((_a = element.textContent) == null ? void 0 : _a.trim()) || element.children.length > 0);\n}\nvar kPresentationInheritanceParents = {\n  "DD": ["DL", "DIV"],\n  "DIV": ["DL"],\n  "DT": ["DL", "DIV"],\n  "LI": ["OL", "UL"],\n  "TBODY": ["TABLE"],\n  "TD": ["TR"],\n  "TFOOT": ["TABLE"],\n  "TH": ["TR"],\n  "THEAD": ["TABLE"],\n  "TR": ["THEAD", "TBODY", "TFOOT", "TABLE"]\n};\nfunction getImplicitAriaRole(element) {\n  var _a;\n  const implicitRole = ((_a = kImplicitRoleByTagName[elementSafeTagName(element)]) == null ? void 0 : _a.call(kImplicitRoleByTagName, element)) || "";\n  if (!implicitRole)\n    return null;\n  let ancestor = element;\n  while (ancestor) {\n    const parent = parentElementOrShadowHost(ancestor);\n    const parents = kPresentationInheritanceParents[elementSafeTagName(ancestor)];\n    if (!parents || !parent || !parents.includes(elementSafeTagName(parent)))\n      break;\n    const parentExplicitRole = getExplicitAriaRole(parent);\n    if ((parentExplicitRole === "none" || parentExplicitRole === "presentation") && !hasPresentationConflictResolution(parent, parentExplicitRole))\n      return parentExplicitRole;\n    ancestor = parent;\n  }\n  return implicitRole;\n}\nvar validRoles = [\n  "alert",\n  "alertdialog",\n  "application",\n  "article",\n  "banner",\n  "blockquote",\n  "button",\n  "caption",\n  "cell",\n  "checkbox",\n  "code",\n  "columnheader",\n  "combobox",\n  "complementary",\n  "contentinfo",\n  "definition",\n  "deletion",\n  "dialog",\n  "directory",\n  "document",\n  "emphasis",\n  "feed",\n  "figure",\n  "form",\n  "generic",\n  "grid",\n  "gridcell",\n  "group",\n  "heading",\n  "img",\n  "insertion",\n  "link",\n  "list",\n  "listbox",\n  "listitem",\n  "log",\n  "main",\n  "mark",\n  "marquee",\n  "math",\n  "meter",\n  "menu",\n  "menubar",\n  "menuitem",\n  "menuitemcheckbox",\n  "menuitemradio",\n  "navigation",\n  "none",\n  "note",\n  "option",\n  "paragraph",\n  "presentation",\n  "progressbar",\n  "radio",\n  "radiogroup",\n  "region",\n  "row",\n  "rowgroup",\n  "rowheader",\n  "scrollbar",\n  "search",\n  "searchbox",\n  "separator",\n  "slider",\n  "spinbutton",\n  "status",\n  "strong",\n  "subscript",\n  "superscript",\n  "switch",\n  "tab",\n  "table",\n  "tablist",\n  "tabpanel",\n  "term",\n  "textbox",\n  "time",\n  "timer",\n  "toolbar",\n  "tooltip",\n  "tree",\n  "treegrid",\n  "treeitem"\n];\nfunction getExplicitAriaRole(element) {\n  const roles = (element.getAttribute("role") || "").split(" ").map((role) => role.trim());\n  return roles.find((role) => validRoles.includes(role)) || null;\n}\nfunction hasPresentationConflictResolution(element, role) {\n  return hasGlobalAriaAttribute(element, role) || isFocusable(element);\n}\nfunction getAriaRole(element) {\n  const explicitRole = getExplicitAriaRole(element);\n  if (!explicitRole)\n    return getImplicitAriaRole(element);\n  if (explicitRole === "none" || explicitRole === "presentation") {\n    const implicitRole = getImplicitAriaRole(element);\n    if (hasPresentationConflictResolution(element, implicitRole))\n      return implicitRole;\n  }\n  return explicitRole;\n}\nfunction getAriaBoolean(attr) {\n  return attr === null ? void 0 : attr.toLowerCase() === "true";\n}\nfunction isElementIgnoredForAria(element) {\n  return ["STYLE", "SCRIPT", "NOSCRIPT", "TEMPLATE"].includes(elementSafeTagName(element));\n}\nfunction isElementHiddenForAria(element) {\n  if (isElementIgnoredForAria(element))\n    return true;\n  const style = getElementComputedStyle(element);\n  const isSlot = element.nodeName === "SLOT";\n  if ((style == null ? void 0 : style.display) === "contents" && !isSlot) {\n    for (let child = element.firstChild; child; child = child.nextSibling) {\n      if (child.nodeType === 1 && !isElementHiddenForAria(child))\n        return false;\n      if (child.nodeType === 3 && isVisibleTextNode(child))\n        return false;\n    }\n    return true;\n  }\n  const isOptionInsideSelect = element.nodeName === "OPTION" && !!element.closest("select");\n  if (!isOptionInsideSelect && !isSlot && !isElementStyleVisibilityVisible(element, style))\n    return true;\n  return belongsToDisplayNoneOrAriaHiddenOrNonSlotted(element);\n}\nfunction belongsToDisplayNoneOrAriaHiddenOrNonSlotted(element) {\n  let hidden = cacheIsHidden == null ? void 0 : cacheIsHidden.get(element);\n  if (hidden === void 0) {\n    hidden = false;\n    if (element.parentElement && element.parentElement.shadowRoot && !element.assignedSlot)\n      hidden = true;\n    if (!hidden) {\n      const style = getElementComputedStyle(element);\n      hidden = !style || style.display === "none" || getAriaBoolean(element.getAttribute("aria-hidden")) === true;\n    }\n    if (!hidden) {\n      const parent = parentElementOrShadowHost(element);\n      if (parent)\n        hidden = belongsToDisplayNoneOrAriaHiddenOrNonSlotted(parent);\n    }\n    cacheIsHidden == null ? void 0 : cacheIsHidden.set(element, hidden);\n  }\n  return hidden;\n}\nfunction getIdRefs(element, ref) {\n  if (!ref)\n    return [];\n  const root = enclosingShadowRootOrDocument(element);\n  if (!root)\n    return [];\n  try {\n    const ids = ref.split(" ").filter((id) => !!id);\n    const result = [];\n    for (const id of ids) {\n      const firstElement = root.querySelector("#" + CSS.escape(id));\n      if (firstElement && !result.includes(firstElement))\n        result.push(firstElement);\n    }\n    return result;\n  } catch (e) {\n    return [];\n  }\n}\nfunction trimFlatString(s) {\n  return s.trim();\n}\nfunction asFlatString(s) {\n  return s.split("\\xA0").map((chunk) => chunk.replace(/\\r\\n/g, "\\n").replace(/[\\u200b\\u00ad]/g, "").replace(/\\s\\s*/g, " ")).join("\\xA0").trim();\n}\nfunction queryInAriaOwned(element, selector) {\n  const result = [...element.querySelectorAll(selector)];\n  for (const owned of getIdRefs(element, element.getAttribute("aria-owns"))) {\n    if (owned.matches(selector))\n      result.push(owned);\n    result.push(...owned.querySelectorAll(selector));\n  }\n  return result;\n}\nfunction getCSSContent(element, pseudo) {\n  const cache = pseudo === "::before" ? cachePseudoContentBefore : pseudo === "::after" ? cachePseudoContentAfter : cachePseudoContent;\n  if (cache == null ? void 0 : cache.has(element))\n    return cache == null ? void 0 : cache.get(element);\n  const style = getElementComputedStyle(element, pseudo);\n  let content;\n  if (style) {\n    const contentValue = style.content;\n    if (contentValue && contentValue !== "none" && contentValue !== "normal") {\n      if (style.display !== "none" && style.visibility !== "hidden") {\n        content = parseCSSContentPropertyAsString(element, contentValue, !!pseudo);\n      }\n    }\n  }\n  if (pseudo && content !== void 0) {\n    const display = (style == null ? void 0 : style.display) || "inline";\n    if (display !== "inline")\n      content = " " + content + " ";\n  }\n  if (cache)\n    cache.set(element, content);\n  return content;\n}\nfunction parseCSSContentPropertyAsString(element, content, isPseudo) {\n  if (!content || content === "none" || content === "normal") {\n    return;\n  }\n  try {\n    let tokens = tokenize(content).filter((token) => !(token instanceof WhitespaceToken));\n    const delimIndex = tokens.findIndex((token) => token instanceof DelimToken && token.value === "/");\n    if (delimIndex !== -1) {\n      tokens = tokens.slice(delimIndex + 1);\n    } else if (!isPseudo) {\n      return;\n    }\n    const accumulated = [];\n    let index = 0;\n    while (index < tokens.length) {\n      if (tokens[index] instanceof StringToken) {\n        accumulated.push(tokens[index].value);\n        index++;\n      } else if (index + 2 < tokens.length && tokens[index] instanceof FunctionToken && tokens[index].value === "attr" && tokens[index + 1] instanceof IdentToken && tokens[index + 2] instanceof CloseParenToken) {\n        const attrName = tokens[index + 1].value;\n        accumulated.push(element.getAttribute(attrName) || "");\n        index += 3;\n      } else {\n        return;\n      }\n    }\n    return accumulated.join("");\n  } catch {\n  }\n}\nfunction getAriaLabelledByElements(element) {\n  const ref = element.getAttribute("aria-labelledby");\n  if (ref === null)\n    return null;\n  const refs = getIdRefs(element, ref);\n  return refs.length ? refs : null;\n}\nfunction allowsNameFromContent(role, targetDescendant) {\n  const alwaysAllowsNameFromContent = ["button", "cell", "checkbox", "columnheader", "gridcell", "heading", "link", "menuitem", "menuitemcheckbox", "menuitemradio", "option", "radio", "row", "rowheader", "switch", "tab", "tooltip", "treeitem"].includes(role);\n  const descendantAllowsNameFromContent = targetDescendant && ["", "caption", "code", "contentinfo", "definition", "deletion", "emphasis", "insertion", "list", "listitem", "mark", "none", "paragraph", "presentation", "region", "row", "rowgroup", "section", "strong", "subscript", "superscript", "table", "term", "time"].includes(role);\n  return alwaysAllowsNameFromContent || descendantAllowsNameFromContent;\n}\nfunction getElementAccessibleName(element, includeHidden) {\n  const cache = includeHidden ? cacheAccessibleNameHidden : cacheAccessibleName;\n  let accessibleName = cache == null ? void 0 : cache.get(element);\n  if (accessibleName === void 0) {\n    accessibleName = "";\n    const elementProhibitsNaming = ["caption", "code", "definition", "deletion", "emphasis", "generic", "insertion", "mark", "paragraph", "presentation", "strong", "subscript", "suggestion", "superscript", "term", "time"].includes(getAriaRole(element) || "");\n    if (!elementProhibitsNaming) {\n      accessibleName = asFlatString(getTextAlternativeInternal(element, {\n        includeHidden,\n        visitedElements: /* @__PURE__ */ new Set(),\n        embeddedInTargetElement: "self"\n      }));\n    }\n    cache == null ? void 0 : cache.set(element, accessibleName);\n  }\n  return accessibleName;\n}\nfunction getElementAccessibleDescription(element, includeHidden) {\n  const cache = includeHidden ? cacheAccessibleDescriptionHidden : cacheAccessibleDescription;\n  let accessibleDescription = cache == null ? void 0 : cache.get(element);\n  if (accessibleDescription === void 0) {\n    accessibleDescription = "";\n    if (element.hasAttribute("aria-describedby")) {\n      const describedBy = getIdRefs(element, element.getAttribute("aria-describedby"));\n      accessibleDescription = asFlatString(describedBy.map((ref) => getTextAlternativeInternal(ref, {\n        includeHidden,\n        visitedElements: /* @__PURE__ */ new Set(),\n        embeddedInDescribedBy: { element: ref, hidden: isElementHiddenForAria(ref) }\n      })).join(" "));\n    } else if (element.hasAttribute("aria-description")) {\n      accessibleDescription = asFlatString(element.getAttribute("aria-description") || "");\n    } else {\n      accessibleDescription = asFlatString(element.getAttribute("title") || "");\n    }\n    cache == null ? void 0 : cache.set(element, accessibleDescription);\n  }\n  return accessibleDescription;\n}\nvar kAriaInvalidRoles = [\n  "application",\n  "checkbox",\n  "columnheader",\n  "combobox",\n  "gridcell",\n  "listbox",\n  "radiogroup",\n  "rowheader",\n  "searchbox",\n  "slider",\n  "spinbutton",\n  "switch",\n  "textbox",\n  "tree"\n];\nfunction getAriaInvalid(element) {\n  const ariaInvalid = element.getAttribute("aria-invalid");\n  if (!ariaInvalid || ariaInvalid.trim() === "" || ariaInvalid.toLocaleLowerCase() === "false")\n    return "false";\n  if (ariaInvalid === "true" || ariaInvalid === "grammar" || ariaInvalid === "spelling")\n    return ariaInvalid;\n  return "true";\n}\nfunction getValidityInvalid(element) {\n  if ("validity" in element) {\n    const validity = element.validity;\n    return (validity == null ? void 0 : validity.valid) === false;\n  }\n  return false;\n}\nfunction getElementAccessibleErrorMessage(element) {\n  const cache = cacheAccessibleErrorMessage;\n  let accessibleErrorMessage = cacheAccessibleErrorMessage == null ? void 0 : cacheAccessibleErrorMessage.get(element);\n  if (accessibleErrorMessage === void 0) {\n    accessibleErrorMessage = "";\n    const isAriaInvalid = getAriaInvalid(element) !== "false";\n    const isValidityInvalid = getValidityInvalid(element);\n    if (isAriaInvalid || isValidityInvalid) {\n      const errorMessageId = element.getAttribute("aria-errormessage");\n      const errorMessages = getIdRefs(element, errorMessageId);\n      const parts = errorMessages.map((errorMessage) => asFlatString(\n        getTextAlternativeInternal(errorMessage, {\n          visitedElements: /* @__PURE__ */ new Set(),\n          embeddedInDescribedBy: { element: errorMessage, hidden: isElementHiddenForAria(errorMessage) }\n        })\n      ));\n      accessibleErrorMessage = parts.join(" ").trim();\n    }\n    cache == null ? void 0 : cache.set(element, accessibleErrorMessage);\n  }\n  return accessibleErrorMessage;\n}\nfunction getTextAlternativeInternal(element, options) {\n  var _a, _b, _c, _d;\n  if (options.visitedElements.has(element))\n    return "";\n  const childOptions = {\n    ...options,\n    embeddedInTargetElement: options.embeddedInTargetElement === "self" ? "descendant" : options.embeddedInTargetElement\n  };\n  if (!options.includeHidden) {\n    const isEmbeddedInHiddenReferenceTraversal = !!((_a = options.embeddedInLabelledBy) == null ? void 0 : _a.hidden) || !!((_b = options.embeddedInDescribedBy) == null ? void 0 : _b.hidden) || !!((_c = options.embeddedInNativeTextAlternative) == null ? void 0 : _c.hidden) || !!((_d = options.embeddedInLabel) == null ? void 0 : _d.hidden);\n    if (isElementIgnoredForAria(element) || !isEmbeddedInHiddenReferenceTraversal && isElementHiddenForAria(element)) {\n      options.visitedElements.add(element);\n      return "";\n    }\n  }\n  const labelledBy = getAriaLabelledByElements(element);\n  if (!options.embeddedInLabelledBy) {\n    const accessibleName = (labelledBy || []).map((ref) => getTextAlternativeInternal(ref, {\n      ...options,\n      embeddedInLabelledBy: { element: ref, hidden: isElementHiddenForAria(ref) },\n      embeddedInDescribedBy: void 0,\n      embeddedInTargetElement: void 0,\n      embeddedInLabel: void 0,\n      embeddedInNativeTextAlternative: void 0\n    })).join(" ");\n    if (accessibleName)\n      return accessibleName;\n  }\n  const role = getAriaRole(element) || "";\n  const tagName = elementSafeTagName(element);\n  if (!!options.embeddedInLabel || !!options.embeddedInLabelledBy || options.embeddedInTargetElement === "descendant") {\n    const isOwnLabel = [...element.labels || []].includes(element);\n    const isOwnLabelledBy = (labelledBy || []).includes(element);\n    if (!isOwnLabel && !isOwnLabelledBy) {\n      if (role === "textbox") {\n        options.visitedElements.add(element);\n        if (tagName === "INPUT" || tagName === "TEXTAREA")\n          return element.value;\n        return element.textContent || "";\n      }\n      if (["combobox", "listbox"].includes(role)) {\n        options.visitedElements.add(element);\n        let selectedOptions;\n        if (tagName === "SELECT") {\n          selectedOptions = [...element.selectedOptions];\n          if (!selectedOptions.length && element.options.length)\n            selectedOptions.push(element.options[0]);\n        } else {\n          const listbox = role === "combobox" ? queryInAriaOwned(element, "*").find((e) => getAriaRole(e) === "listbox") : element;\n          selectedOptions = listbox ? queryInAriaOwned(listbox, \'[aria-selected="true"]\').filter((e) => getAriaRole(e) === "option") : [];\n        }\n        if (!selectedOptions.length && tagName === "INPUT") {\n          return element.value;\n        }\n        return selectedOptions.map((option) => getTextAlternativeInternal(option, childOptions)).join(" ");\n      }\n      if (["progressbar", "scrollbar", "slider", "spinbutton", "meter"].includes(role)) {\n        options.visitedElements.add(element);\n        if (element.hasAttribute("aria-valuetext"))\n          return element.getAttribute("aria-valuetext") || "";\n        if (element.hasAttribute("aria-valuenow"))\n          return element.getAttribute("aria-valuenow") || "";\n        return element.getAttribute("value") || "";\n      }\n      if (["menu"].includes(role)) {\n        options.visitedElements.add(element);\n        return "";\n      }\n    }\n  }\n  const ariaLabel = element.getAttribute("aria-label") || "";\n  if (trimFlatString(ariaLabel)) {\n    options.visitedElements.add(element);\n    return ariaLabel;\n  }\n  if (!["presentation", "none"].includes(role)) {\n    if (tagName === "INPUT" && ["button", "submit", "reset"].includes(element.type)) {\n      options.visitedElements.add(element);\n      const value = element.value || "";\n      if (trimFlatString(value))\n        return value;\n      if (element.type === "submit")\n        return "Submit";\n      if (element.type === "reset")\n        return "Reset";\n      const title = element.getAttribute("title") || "";\n      return title;\n    }\n    if (tagName === "INPUT" && element.type === "file") {\n      options.visitedElements.add(element);\n      const labels = element.labels || [];\n      if (labels.length && !options.embeddedInLabelledBy)\n        return getAccessibleNameFromAssociatedLabels(labels, options);\n      return "Choose File";\n    }\n    if (tagName === "INPUT" && element.type === "image") {\n      options.visitedElements.add(element);\n      const labels = element.labels || [];\n      if (labels.length && !options.embeddedInLabelledBy)\n        return getAccessibleNameFromAssociatedLabels(labels, options);\n      const alt = element.getAttribute("alt") || "";\n      if (trimFlatString(alt))\n        return alt;\n      const title = element.getAttribute("title") || "";\n      if (trimFlatString(title))\n        return title;\n      return "Submit";\n    }\n    if (!labelledBy && tagName === "BUTTON") {\n      options.visitedElements.add(element);\n      const labels = element.labels || [];\n      if (labels.length)\n        return getAccessibleNameFromAssociatedLabels(labels, options);\n    }\n    if (!labelledBy && tagName === "OUTPUT") {\n      options.visitedElements.add(element);\n      const labels = element.labels || [];\n      if (labels.length)\n        return getAccessibleNameFromAssociatedLabels(labels, options);\n      return element.getAttribute("title") || "";\n    }\n    if (!labelledBy && (tagName === "TEXTAREA" || tagName === "SELECT" || tagName === "INPUT")) {\n      options.visitedElements.add(element);\n      const labels = element.labels || [];\n      if (labels.length)\n        return getAccessibleNameFromAssociatedLabels(labels, options);\n      const usePlaceholder = tagName === "INPUT" && ["text", "password", "search", "tel", "email", "url"].includes(element.type) || tagName === "TEXTAREA";\n      const placeholder = element.getAttribute("placeholder") || "";\n      const title = element.getAttribute("title") || "";\n      if (!usePlaceholder || title)\n        return title;\n      return placeholder;\n    }\n    if (!labelledBy && tagName === "FIELDSET") {\n      options.visitedElements.add(element);\n      for (let child = element.firstElementChild; child; child = child.nextElementSibling) {\n        if (elementSafeTagName(child) === "LEGEND") {\n          return getTextAlternativeInternal(child, {\n            ...childOptions,\n            embeddedInNativeTextAlternative: { element: child, hidden: isElementHiddenForAria(child) }\n          });\n        }\n      }\n      const title = element.getAttribute("title") || "";\n      return title;\n    }\n    if (!labelledBy && tagName === "FIGURE") {\n      options.visitedElements.add(element);\n      for (let child = element.firstElementChild; child; child = child.nextElementSibling) {\n        if (elementSafeTagName(child) === "FIGCAPTION") {\n          return getTextAlternativeInternal(child, {\n            ...childOptions,\n            embeddedInNativeTextAlternative: { element: child, hidden: isElementHiddenForAria(child) }\n          });\n        }\n      }\n      const title = element.getAttribute("title") || "";\n      return title;\n    }\n    if (tagName === "IMG") {\n      options.visitedElements.add(element);\n      const alt = element.getAttribute("alt") || "";\n      if (trimFlatString(alt))\n        return alt;\n      const title = element.getAttribute("title") || "";\n      return title;\n    }\n    if (tagName === "TABLE") {\n      options.visitedElements.add(element);\n      for (let child = element.firstElementChild; child; child = child.nextElementSibling) {\n        if (elementSafeTagName(child) === "CAPTION") {\n          return getTextAlternativeInternal(child, {\n            ...childOptions,\n            embeddedInNativeTextAlternative: { element: child, hidden: isElementHiddenForAria(child) }\n          });\n        }\n      }\n      const summary = element.getAttribute("summary") || "";\n      if (summary)\n        return summary;\n    }\n    if (tagName === "AREA") {\n      options.visitedElements.add(element);\n      const alt = element.getAttribute("alt") || "";\n      if (trimFlatString(alt))\n        return alt;\n      const title = element.getAttribute("title") || "";\n      return title;\n    }\n    if (tagName === "SVG" || element.ownerSVGElement) {\n      options.visitedElements.add(element);\n      for (let child = element.firstElementChild; child; child = child.nextElementSibling) {\n        if (elementSafeTagName(child) === "TITLE" && child.ownerSVGElement) {\n          return getTextAlternativeInternal(child, {\n            ...childOptions,\n            embeddedInLabelledBy: { element: child, hidden: isElementHiddenForAria(child) }\n          });\n        }\n      }\n    }\n    if (element.ownerSVGElement && tagName === "A") {\n      const title = element.getAttribute("xlink:title") || "";\n      if (trimFlatString(title)) {\n        options.visitedElements.add(element);\n        return title;\n      }\n    }\n  }\n  const shouldNameFromContentForSummary = tagName === "SUMMARY" && !["presentation", "none"].includes(role);\n  if (allowsNameFromContent(role, options.embeddedInTargetElement === "descendant") || shouldNameFromContentForSummary || !!options.embeddedInLabelledBy || !!options.embeddedInDescribedBy || !!options.embeddedInLabel || !!options.embeddedInNativeTextAlternative) {\n    options.visitedElements.add(element);\n    const accessibleName = innerAccumulatedElementText(element, childOptions);\n    const maybeTrimmedAccessibleName = options.embeddedInTargetElement === "self" ? trimFlatString(accessibleName) : accessibleName;\n    if (maybeTrimmedAccessibleName)\n      return accessibleName;\n  }\n  if (!["presentation", "none"].includes(role) || tagName === "IFRAME") {\n    options.visitedElements.add(element);\n    const title = element.getAttribute("title") || "";\n    if (trimFlatString(title))\n      return title;\n  }\n  options.visitedElements.add(element);\n  return "";\n}\nfunction innerAccumulatedElementText(element, options) {\n  const tokens = [];\n  const visit = (node, skipSlotted) => {\n    var _a;\n    if (skipSlotted && node.assignedSlot)\n      return;\n    if (node.nodeType === 1) {\n      const display = ((_a = getElementComputedStyle(node)) == null ? void 0 : _a.display) || "inline";\n      let token = getTextAlternativeInternal(node, options);\n      if (display !== "inline" || node.nodeName === "BR")\n        token = " " + token + " ";\n      tokens.push(token);\n    } else if (node.nodeType === 3) {\n      tokens.push(node.textContent || "");\n    }\n  };\n  tokens.push(getCSSContent(element, "::before") || "");\n  const content = getCSSContent(element);\n  if (content !== void 0) {\n    tokens.push(content);\n  } else {\n    const assignedNodes = element.nodeName === "SLOT" ? element.assignedNodes() : [];\n    if (assignedNodes.length) {\n      for (const child of assignedNodes)\n        visit(child, false);\n    } else {\n      for (let child = element.firstChild; child; child = child.nextSibling)\n        visit(child, true);\n      if (element.shadowRoot) {\n        for (let child = element.shadowRoot.firstChild; child; child = child.nextSibling)\n          visit(child, true);\n      }\n      for (const owned of getIdRefs(element, element.getAttribute("aria-owns")))\n        visit(owned, true);\n    }\n  }\n  tokens.push(getCSSContent(element, "::after") || "");\n  return tokens.join("");\n}\nvar kAriaSelectedRoles = ["gridcell", "option", "row", "tab", "rowheader", "columnheader", "treeitem"];\nfunction getAriaSelected(element) {\n  if (elementSafeTagName(element) === "OPTION")\n    return element.selected;\n  if (kAriaSelectedRoles.includes(getAriaRole(element) || ""))\n    return getAriaBoolean(element.getAttribute("aria-selected")) === true;\n  return false;\n}\nvar kAriaCheckedRoles = ["checkbox", "menuitemcheckbox", "option", "radio", "switch", "menuitemradio", "treeitem"];\nfunction getAriaChecked(element) {\n  const result = getChecked(element, true);\n  return result === "error" ? false : result;\n}\nfunction getCheckedAllowMixed(element) {\n  return getChecked(element, true);\n}\nfunction getCheckedWithoutMixed(element) {\n  const result = getChecked(element, false);\n  return result;\n}\nfunction getChecked(element, allowMixed) {\n  const tagName = elementSafeTagName(element);\n  if (allowMixed && tagName === "INPUT" && element.indeterminate)\n    return "mixed";\n  if (tagName === "INPUT" && ["checkbox", "radio"].includes(element.type))\n    return element.checked;\n  if (kAriaCheckedRoles.includes(getAriaRole(element) || "")) {\n    const checked = element.getAttribute("aria-checked");\n    if (checked === "true")\n      return true;\n    if (allowMixed && checked === "mixed")\n      return "mixed";\n    return false;\n  }\n  return "error";\n}\nvar kAriaReadonlyRoles = ["checkbox", "combobox", "grid", "gridcell", "listbox", "radiogroup", "slider", "spinbutton", "textbox", "columnheader", "rowheader", "searchbox", "switch", "treegrid"];\nfunction getReadonly(element) {\n  const tagName = elementSafeTagName(element);\n  if (["INPUT", "TEXTAREA", "SELECT"].includes(tagName))\n    return element.hasAttribute("readonly");\n  if (kAriaReadonlyRoles.includes(getAriaRole(element) || ""))\n    return element.getAttribute("aria-readonly") === "true";\n  if (element.isContentEditable)\n    return false;\n  return "error";\n}\nvar kAriaPressedRoles = ["button"];\nfunction getAriaPressed(element) {\n  if (kAriaPressedRoles.includes(getAriaRole(element) || "")) {\n    const pressed = element.getAttribute("aria-pressed");\n    if (pressed === "true")\n      return true;\n    if (pressed === "mixed")\n      return "mixed";\n  }\n  return false;\n}\nvar kAriaExpandedRoles = ["application", "button", "checkbox", "combobox", "gridcell", "link", "listbox", "menuitem", "row", "rowheader", "tab", "treeitem", "columnheader", "menuitemcheckbox", "menuitemradio", "rowheader", "switch"];\nfunction getAriaExpanded(element) {\n  if (elementSafeTagName(element) === "DETAILS")\n    return element.open;\n  if (kAriaExpandedRoles.includes(getAriaRole(element) || "")) {\n    const expanded = element.getAttribute("aria-expanded");\n    if (expanded === null)\n      return void 0;\n    if (expanded === "true")\n      return true;\n    return false;\n  }\n  return void 0;\n}\nvar kAriaLevelRoles = ["heading", "listitem", "row", "treeitem"];\nfunction getAriaLevel(element) {\n  const native = { "H1": 1, "H2": 2, "H3": 3, "H4": 4, "H5": 5, "H6": 6 }[elementSafeTagName(element)];\n  if (native)\n    return native;\n  if (kAriaLevelRoles.includes(getAriaRole(element) || "")) {\n    const attr = element.getAttribute("aria-level");\n    const value = attr === null ? Number.NaN : Number(attr);\n    if (Number.isInteger(value) && value >= 1)\n      return value;\n  }\n  return 0;\n}\nvar kAriaDisabledRoles = ["application", "button", "composite", "gridcell", "group", "input", "link", "menuitem", "scrollbar", "separator", "tab", "checkbox", "columnheader", "combobox", "grid", "listbox", "menu", "menubar", "menuitemcheckbox", "menuitemradio", "option", "radio", "radiogroup", "row", "rowheader", "searchbox", "select", "slider", "spinbutton", "switch", "tablist", "textbox", "toolbar", "tree", "treegrid", "treeitem"];\nfunction getAriaDisabled(element) {\n  return isNativelyDisabled(element) || hasExplicitAriaDisabled(element);\n}\nfunction isNativelyDisabled(element) {\n  const isNativeFormControl = ["BUTTON", "INPUT", "SELECT", "TEXTAREA", "OPTION", "OPTGROUP"].includes(elementSafeTagName(element));\n  return isNativeFormControl && (element.hasAttribute("disabled") || belongsToDisabledOptGroup(element) || belongsToDisabledFieldSet(element));\n}\nfunction belongsToDisabledOptGroup(element) {\n  return elementSafeTagName(element) === "OPTION" && !!element.closest("OPTGROUP[DISABLED]");\n}\nfunction belongsToDisabledFieldSet(element) {\n  const fieldSetElement = element == null ? void 0 : element.closest("FIELDSET[DISABLED]");\n  if (!fieldSetElement)\n    return false;\n  const legendElement = fieldSetElement.querySelector(":scope > LEGEND");\n  return !legendElement || !legendElement.contains(element);\n}\nfunction hasExplicitAriaDisabled(element, isAncestor = false) {\n  if (!element)\n    return false;\n  if (isAncestor || kAriaDisabledRoles.includes(getAriaRole(element) || "")) {\n    const attribute = (element.getAttribute("aria-disabled") || "").toLowerCase();\n    if (attribute === "true")\n      return true;\n    if (attribute === "false")\n      return false;\n    return hasExplicitAriaDisabled(parentElementOrShadowHost(element), true);\n  }\n  return false;\n}\nfunction getAccessibleNameFromAssociatedLabels(labels, options) {\n  return [...labels].map((label) => getTextAlternativeInternal(label, {\n    ...options,\n    embeddedInLabel: { element: label, hidden: isElementHiddenForAria(label) },\n    embeddedInNativeTextAlternative: void 0,\n    embeddedInLabelledBy: void 0,\n    embeddedInDescribedBy: void 0,\n    embeddedInTargetElement: void 0\n  })).filter((accessibleName) => !!accessibleName).join(" ");\n}\nfunction receivesPointerEvents(element) {\n  const cache = cachePointerEvents;\n  let e = element;\n  let result;\n  const parents = [];\n  for (; e; e = parentElementOrShadowHost(e)) {\n    const cached = cache.get(e);\n    if (cached !== void 0) {\n      result = cached;\n      break;\n    }\n    parents.push(e);\n    const style = getElementComputedStyle(e);\n    if (!style) {\n      result = true;\n      break;\n    }\n    const value = style.pointerEvents;\n    if (value) {\n      result = value !== "none";\n      break;\n    }\n  }\n  if (result === void 0)\n    result = true;\n  for (const parent of parents)\n    cache.set(parent, result);\n  return result;\n}\nvar cacheAccessibleName;\nvar cacheAccessibleNameHidden;\nvar cacheAccessibleDescription;\nvar cacheAccessibleDescriptionHidden;\nvar cacheAccessibleErrorMessage;\nvar cacheIsHidden;\nvar cachePseudoContent;\nvar cachePseudoContentBefore;\nvar cachePseudoContentAfter;\nvar cachePointerEvents;\nvar cachesCounter2 = 0;\nfunction beginAriaCaches() {\n  beginDOMCaches();\n  ++cachesCounter2;\n  cacheAccessibleName != null ? cacheAccessibleName : cacheAccessibleName = /* @__PURE__ */ new Map();\n  cacheAccessibleNameHidden != null ? cacheAccessibleNameHidden : cacheAccessibleNameHidden = /* @__PURE__ */ new Map();\n  cacheAccessibleDescription != null ? cacheAccessibleDescription : cacheAccessibleDescription = /* @__PURE__ */ new Map();\n  cacheAccessibleDescriptionHidden != null ? cacheAccessibleDescriptionHidden : cacheAccessibleDescriptionHidden = /* @__PURE__ */ new Map();\n  cacheAccessibleErrorMessage != null ? cacheAccessibleErrorMessage : cacheAccessibleErrorMessage = /* @__PURE__ */ new Map();\n  cacheIsHidden != null ? cacheIsHidden : cacheIsHidden = /* @__PURE__ */ new Map();\n  cachePseudoContent != null ? cachePseudoContent : cachePseudoContent = /* @__PURE__ */ new Map();\n  cachePseudoContentBefore != null ? cachePseudoContentBefore : cachePseudoContentBefore = /* @__PURE__ */ new Map();\n  cachePseudoContentAfter != null ? cachePseudoContentAfter : cachePseudoContentAfter = /* @__PURE__ */ new Map();\n  cachePointerEvents != null ? cachePointerEvents : cachePointerEvents = /* @__PURE__ */ new Map();\n}\nfunction endAriaCaches() {\n  if (!--cachesCounter2) {\n    cacheAccessibleName = void 0;\n    cacheAccessibleNameHidden = void 0;\n    cacheAccessibleDescription = void 0;\n    cacheAccessibleDescriptionHidden = void 0;\n    cacheAccessibleErrorMessage = void 0;\n    cacheIsHidden = void 0;\n    cachePseudoContent = void 0;\n    cachePseudoContentBefore = void 0;\n    cachePseudoContentAfter = void 0;\n    cachePointerEvents = void 0;\n  }\n  endDOMCaches();\n}\nvar inputTypeToRole = {\n  "button": "button",\n  "checkbox": "checkbox",\n  "image": "button",\n  "number": "spinbutton",\n  "radio": "radio",\n  "range": "slider",\n  "reset": "button",\n  "submit": "button"\n};\n\n// packages/injected/src/ariaSnapshot.ts\nvar lastRef = 0;\nfunction toInternalOptions(options) {\n  const renderBoxes = options.boxes;\n  if (options.mode === "ai") {\n    return {\n      visibility: "ariaOrVisible",\n      refs: "interactable",\n      refPrefix: options.refPrefix,\n      includeGenericRole: true,\n      renderActive: !options.doNotRenderActive,\n      renderCursorPointer: true,\n      renderBoxes\n    };\n  }\n  if (options.mode === "autoexpect") {\n    return { visibility: "ariaAndVisible", refs: "none", renderBoxes };\n  }\n  if (options.mode === "codegen") {\n    return { visibility: "aria", refs: "none", renderStringsAsRegex: true, renderBoxes };\n  }\n  return { visibility: "aria", refs: "none", renderBoxes };\n}\nfunction generateAriaTree(rootElement, publicOptions) {\n  const options = toInternalOptions(publicOptions);\n  const visited = /* @__PURE__ */ new Set();\n  const snapshot = {\n    root: { role: "fragment", name: "", children: [], props: {}, box: computeBox(rootElement), receivesPointerEvents: true },\n    elements: /* @__PURE__ */ new Map(),\n    refs: /* @__PURE__ */ new Map(),\n    iframeRefs: []\n  };\n  setAriaNodeElement(snapshot.root, rootElement);\n  const visit = (ariaNode, node, parentElementVisible) => {\n    if (visited.has(node))\n      return;\n    visited.add(node);\n    if (node.nodeType === Node.TEXT_NODE && node.nodeValue) {\n      if (!parentElementVisible)\n        return;\n      const text = node.nodeValue;\n      if (ariaNode.role !== "textbox" && text)\n        ariaNode.children.push(node.nodeValue || "");\n      return;\n    }\n    if (node.nodeType !== Node.ELEMENT_NODE)\n      return;\n    const element = node;\n    const isElementVisibleForAria = !isElementHiddenForAria(element);\n    let visible = isElementVisibleForAria;\n    if (options.visibility === "ariaOrVisible")\n      visible = isElementVisibleForAria || isElementVisible(element);\n    if (options.visibility === "ariaAndVisible")\n      visible = isElementVisibleForAria && isElementVisible(element);\n    if (options.visibility === "aria" && !visible)\n      return;\n    const ariaChildren = [];\n    if (element.hasAttribute("aria-owns")) {\n      const ids = element.getAttribute("aria-owns").split(/\\s+/);\n      for (const id of ids) {\n        const ownedElement = rootElement.ownerDocument.getElementById(id);\n        if (ownedElement)\n          ariaChildren.push(ownedElement);\n      }\n    }\n    const childAriaNode = visible ? toAriaNode(element, options) : null;\n    if (childAriaNode) {\n      if (childAriaNode.ref) {\n        snapshot.elements.set(childAriaNode.ref, element);\n        snapshot.refs.set(element, childAriaNode.ref);\n        if (childAriaNode.role === "iframe")\n          snapshot.iframeRefs.push(childAriaNode.ref);\n      }\n      ariaNode.children.push(childAriaNode);\n    }\n    processElement(childAriaNode || ariaNode, element, ariaChildren, visible);\n  };\n  function processElement(ariaNode, element, ariaChildren, parentElementVisible) {\n    var _a;\n    const display = ((_a = getElementComputedStyle(element)) == null ? void 0 : _a.display) || "inline";\n    const treatAsBlock = display !== "inline" || element.nodeName === "BR" ? " " : "";\n    if (treatAsBlock)\n      ariaNode.children.push(treatAsBlock);\n    ariaNode.children.push(getCSSContent(element, "::before") || "");\n    const assignedNodes = element.nodeName === "SLOT" ? element.assignedNodes() : [];\n    if (assignedNodes.length) {\n      for (const child of assignedNodes)\n        visit(ariaNode, child, parentElementVisible);\n    } else {\n      for (let child = element.firstChild; child; child = child.nextSibling) {\n        if (!child.assignedSlot)\n          visit(ariaNode, child, parentElementVisible);\n      }\n      if (element.shadowRoot) {\n        for (let child = element.shadowRoot.firstChild; child; child = child.nextSibling)\n          visit(ariaNode, child, parentElementVisible);\n      }\n    }\n    for (const child of ariaChildren)\n      visit(ariaNode, child, parentElementVisible);\n    ariaNode.children.push(getCSSContent(element, "::after") || "");\n    if (treatAsBlock)\n      ariaNode.children.push(treatAsBlock);\n    if (ariaNode.children.length === 1 && ariaNode.name === ariaNode.children[0])\n      ariaNode.children = [];\n    if (ariaNode.role === "link" && element.hasAttribute("href")) {\n      const href = element.getAttribute("href");\n      ariaNode.props["url"] = href;\n    }\n    if (ariaNode.role === "textbox" && element.hasAttribute("placeholder") && element.getAttribute("placeholder") !== ariaNode.name) {\n      const placeholder = element.getAttribute("placeholder");\n      ariaNode.props["placeholder"] = placeholder;\n    }\n  }\n  beginAriaCaches();\n  try {\n    visit(snapshot.root, rootElement, true);\n  } finally {\n    endAriaCaches();\n  }\n  normalizeStringChildren(snapshot.root);\n  normalizeGenericRoles(snapshot.root);\n  return snapshot;\n}\nfunction computeAriaRef(ariaNode, options) {\n  var _a;\n  if (options.refs === "none")\n    return;\n  if (options.refs === "interactable" && (!ariaNode.box.visible || !ariaNode.receivesPointerEvents))\n    return;\n  const element = ariaNodeElement(ariaNode);\n  let ariaRef = element._ariaRef;\n  if (!ariaRef || ariaRef.role !== ariaNode.role || ariaRef.name !== ariaNode.name) {\n    ariaRef = { role: ariaNode.role, name: ariaNode.name, ref: ((_a = options.refPrefix) != null ? _a : "") + "e" + ++lastRef };\n    element._ariaRef = ariaRef;\n  }\n  ariaNode.ref = ariaRef.ref;\n}\nfunction toAriaNode(element, options) {\n  var _a;\n  const active = element.ownerDocument.activeElement === element;\n  if (element.nodeName === "IFRAME") {\n    const ariaNode = {\n      role: "iframe",\n      name: "",\n      children: [],\n      props: {},\n      box: computeBox(element),\n      receivesPointerEvents: true,\n      active\n    };\n    setAriaNodeElement(ariaNode, element);\n    computeAriaRef(ariaNode, options);\n    return ariaNode;\n  }\n  const defaultRole = options.includeGenericRole ? "generic" : null;\n  const role = (_a = getAriaRole(element)) != null ? _a : defaultRole;\n  if (!role || role === "presentation" || role === "none")\n    return null;\n  const name = normalizeWhiteSpace(getElementAccessibleName(element, false) || "");\n  const receivesPointerEvents2 = receivesPointerEvents(element);\n  const box = computeBox(element);\n  if (role === "generic" && box.inline && element.childNodes.length === 1 && element.childNodes[0].nodeType === Node.TEXT_NODE)\n    return null;\n  const result = {\n    role,\n    name,\n    children: [],\n    props: {},\n    box,\n    receivesPointerEvents: receivesPointerEvents2,\n    active\n  };\n  setAriaNodeElement(result, element);\n  computeAriaRef(result, options);\n  if (kAriaCheckedRoles.includes(role))\n    result.checked = getAriaChecked(element);\n  if (kAriaDisabledRoles.includes(role))\n    result.disabled = getAriaDisabled(element);\n  if (kAriaExpandedRoles.includes(role))\n    result.expanded = getAriaExpanded(element);\n  if (kAriaInvalidRoles.includes(role)) {\n    const invalid = getAriaInvalid(element);\n    result.invalid = invalid === "false" ? false : invalid === "true" ? true : invalid;\n  }\n  if (kAriaLevelRoles.includes(role))\n    result.level = getAriaLevel(element);\n  if (kAriaPressedRoles.includes(role))\n    result.pressed = getAriaPressed(element);\n  if (kAriaSelectedRoles.includes(role))\n    result.selected = getAriaSelected(element);\n  if (element instanceof HTMLInputElement || element instanceof HTMLTextAreaElement) {\n    if (element.type !== "checkbox" && element.type !== "radio" && element.type !== "file")\n      result.children = [element.value];\n  }\n  return result;\n}\nfunction normalizeGenericRoles(node) {\n  const normalizeChildren = (node2) => {\n    const result = [];\n    for (const child of node2.children || []) {\n      if (typeof child === "string") {\n        result.push(child);\n        continue;\n      }\n      const normalized = normalizeChildren(child);\n      result.push(...normalized);\n    }\n    const removeSelf = node2.role === "generic" && !node2.name && result.length <= 1 && result.every((c) => typeof c !== "string" && !!c.ref);\n    if (removeSelf)\n      return result;\n    node2.children = result;\n    return [node2];\n  };\n  normalizeChildren(node);\n}\nfunction normalizeStringChildren(rootA11yNode) {\n  const flushChildren = (buffer, normalizedChildren) => {\n    if (!buffer.length)\n      return;\n    const text = normalizeWhiteSpace(buffer.join(""));\n    if (text)\n      normalizedChildren.push(text);\n    buffer.length = 0;\n  };\n  const visit = (ariaNode) => {\n    const normalizedChildren = [];\n    const buffer = [];\n    for (const child of ariaNode.children || []) {\n      if (typeof child === "string") {\n        buffer.push(child);\n      } else {\n        flushChildren(buffer, normalizedChildren);\n        visit(child);\n        normalizedChildren.push(child);\n      }\n    }\n    flushChildren(buffer, normalizedChildren);\n    ariaNode.children = normalizedChildren.length ? normalizedChildren : [];\n    if (ariaNode.children.length === 1 && ariaNode.children[0] === ariaNode.name)\n      ariaNode.children = [];\n  };\n  visit(rootA11yNode);\n}\nfunction matchesStringOrRegex(text, template) {\n  if (!template)\n    return true;\n  if (!text)\n    return false;\n  if (typeof template === "string")\n    return text === template;\n  return !!text.match(new RegExp(template.pattern));\n}\nfunction matchesTextValue(text, template) {\n  if (!(template == null ? void 0 : template.normalized))\n    return true;\n  if (!text)\n    return false;\n  if (text === template.normalized)\n    return true;\n  if (text === template.raw)\n    return true;\n  const regex = cachedRegex(template);\n  if (regex)\n    return !!text.match(regex);\n  return false;\n}\nvar cachedRegexSymbol = Symbol("cachedRegex");\nfunction cachedRegex(template) {\n  if (template[cachedRegexSymbol] !== void 0)\n    return template[cachedRegexSymbol];\n  const { raw } = template;\n  const canBeRegex = raw.startsWith("/") && raw.endsWith("/") && raw.length > 1;\n  let regex;\n  try {\n    regex = canBeRegex ? new RegExp(raw.slice(1, -1)) : null;\n  } catch (e) {\n    regex = null;\n  }\n  template[cachedRegexSymbol] = regex;\n  return regex;\n}\nfunction matchesExpectAriaTemplate(rootElement, template) {\n  const snapshot = generateAriaTree(rootElement, { mode: "default" });\n  const matches = matchesNodeDeep(snapshot.root, template, false, false);\n  return {\n    matches,\n    received: {\n      raw: renderAriaTree(snapshot, { mode: "default" }).text,\n      regex: renderAriaTree(snapshot, { mode: "codegen" }).text\n    }\n  };\n}\nfunction getAllElementsMatchingExpectAriaTemplate(rootElement, template) {\n  const root = generateAriaTree(rootElement, { mode: "default" }).root;\n  const matches = matchesNodeDeep(root, template, true, false);\n  return matches.map((n) => ariaNodeElement(n));\n}\nfunction matchesNode(node, template, isDeepEqual) {\n  var _a;\n  if (typeof node === "string" && template.kind === "text")\n    return matchesTextValue(node, template.text);\n  if (node === null || typeof node !== "object" || template.kind !== "role")\n    return false;\n  if (template.role !== "fragment" && template.role !== node.role)\n    return false;\n  if (template.checked !== void 0 && template.checked !== node.checked)\n    return false;\n  if (template.disabled !== void 0 && template.disabled !== node.disabled)\n    return false;\n  if (template.expanded !== void 0 && template.expanded !== node.expanded)\n    return false;\n  if (template.invalid !== void 0 && template.invalid !== node.invalid)\n    return false;\n  if (template.level !== void 0 && template.level !== node.level)\n    return false;\n  if (template.pressed !== void 0 && template.pressed !== node.pressed)\n    return false;\n  if (template.selected !== void 0 && template.selected !== node.selected)\n    return false;\n  if (!matchesStringOrRegex(node.name, template.name))\n    return false;\n  if (!matchesTextValue(node.props.url, (_a = template.props) == null ? void 0 : _a.url))\n    return false;\n  if (template.containerMode === "contain")\n    return containsList(node.children || [], template.children || []);\n  if (template.containerMode === "equal")\n    return listEqual(node.children || [], template.children || [], false);\n  if (template.containerMode === "deep-equal" || isDeepEqual)\n    return listEqual(node.children || [], template.children || [], true);\n  return containsList(node.children || [], template.children || []);\n}\nfunction listEqual(children, template, isDeepEqual) {\n  if (template.length !== children.length)\n    return false;\n  for (let i = 0; i < template.length; ++i) {\n    if (!matchesNode(children[i], template[i], isDeepEqual))\n      return false;\n  }\n  return true;\n}\nfunction containsList(children, template) {\n  if (template.length > children.length)\n    return false;\n  const cc = children.slice();\n  const tt = template.slice();\n  for (const t of tt) {\n    let c = cc.shift();\n    while (c) {\n      if (matchesNode(c, t, false))\n        break;\n      c = cc.shift();\n    }\n    if (!c)\n      return false;\n  }\n  return true;\n}\nfunction matchesNodeDeep(root, template, collectAll, isDeepEqual) {\n  const results = [];\n  const visit = (node, parent) => {\n    if (matchesNode(node, template, isDeepEqual)) {\n      const result = typeof node === "string" ? parent : node;\n      if (result)\n        results.push(result);\n      return !collectAll;\n    }\n    if (typeof node === "string")\n      return false;\n    for (const child of node.children || []) {\n      if (visit(child, node))\n        return true;\n    }\n    return false;\n  };\n  visit(root, null);\n  return results;\n}\nfunction buildByRefMap(root, map = /* @__PURE__ */ new Map()) {\n  if (root == null ? void 0 : root.ref)\n    map.set(root.ref, root);\n  for (const child of (root == null ? void 0 : root.children) || []) {\n    if (typeof child !== "string")\n      buildByRefMap(child, map);\n  }\n  return map;\n}\nfunction compareSnapshots(ariaSnapshot, previousSnapshot) {\n  var _a;\n  const previousByRef = buildByRefMap(previousSnapshot == null ? void 0 : previousSnapshot.root);\n  const result = /* @__PURE__ */ new Map();\n  const visit = (ariaNode, previousNode) => {\n    let same = ariaNode.children.length === (previousNode == null ? void 0 : previousNode.children.length) && ariaNodesEqual(ariaNode, previousNode);\n    let canBeSkipped = same;\n    for (let childIndex = 0; childIndex < ariaNode.children.length; childIndex++) {\n      const child = ariaNode.children[childIndex];\n      const previousChild = previousNode == null ? void 0 : previousNode.children[childIndex];\n      if (typeof child === "string") {\n        same && (same = child === previousChild);\n        canBeSkipped && (canBeSkipped = child === previousChild);\n      } else {\n        let previous = typeof previousChild !== "string" ? previousChild : void 0;\n        if (child.ref)\n          previous = previousByRef.get(child.ref);\n        const sameChild = visit(child, previous);\n        if (!previous || !sameChild && !child.ref || previous !== previousChild)\n          canBeSkipped = false;\n        same && (same = sameChild && previous === previousChild);\n      }\n    }\n    result.set(ariaNode, same ? "same" : canBeSkipped ? "skip" : "changed");\n    return same;\n  };\n  visit(ariaSnapshot.root, previousByRef.get((_a = previousSnapshot == null ? void 0 : previousSnapshot.root) == null ? void 0 : _a.ref));\n  return result;\n}\nfunction filterSnapshotDiff(nodes, statusMap) {\n  const result = [];\n  const visit = (ariaNode) => {\n    const status = statusMap.get(ariaNode);\n    if (status === "same") {\n    } else if (status === "skip") {\n      for (const child of ariaNode.children) {\n        if (typeof child !== "string")\n          visit(child);\n      }\n    } else {\n      result.push(ariaNode);\n    }\n  };\n  for (const node of nodes) {\n    if (typeof node === "string")\n      result.push(node);\n    else\n      visit(node);\n  }\n  return result;\n}\nfunction indent(depth) {\n  return "  ".repeat(depth);\n}\nfunction renderAriaTree(ariaSnapshot, publicOptions, previousSnapshot) {\n  const options = toInternalOptions(publicOptions);\n  const lines = [];\n  const iframeDepths = {};\n  const includeText = options.renderStringsAsRegex ? textContributesInfo : () => true;\n  const renderString = options.renderStringsAsRegex ? convertToBestGuessRegex : (str) => str;\n  let nodesToRender = ariaSnapshot.root.role === "fragment" ? ariaSnapshot.root.children : [ariaSnapshot.root];\n  const statusMap = compareSnapshots(ariaSnapshot, previousSnapshot);\n  if (previousSnapshot)\n    nodesToRender = filterSnapshotDiff(nodesToRender, statusMap);\n  const visitText = (text, depth) => {\n    if (publicOptions.depth && depth > publicOptions.depth)\n      return;\n    const escaped = yamlEscapeValueIfNeeded(renderString(text));\n    if (escaped)\n      lines.push(indent(depth) + "- text: " + escaped);\n  };\n  const createKey = (ariaNode, renderCursorPointer) => {\n    let key = ariaNode.role;\n    if (ariaNode.name && ariaNode.name.length <= 900) {\n      const name = renderString(ariaNode.name);\n      if (name) {\n        const stringifiedName = name.startsWith("/") && name.endsWith("/") ? name : JSON.stringify(name);\n        key += " " + stringifiedName;\n      }\n    }\n    if (ariaNode.checked === "mixed")\n      key += ` [checked=mixed]`;\n    if (ariaNode.checked === true)\n      key += ` [checked]`;\n    if (ariaNode.disabled)\n      key += ` [disabled]`;\n    if (ariaNode.expanded)\n      key += ` [expanded]`;\n    if (ariaNode.active && options.renderActive)\n      key += ` [active]`;\n    if (ariaNode.invalid === "grammar" || ariaNode.invalid === "spelling")\n      key += ` [invalid=${ariaNode.invalid}]`;\n    if (ariaNode.invalid === true)\n      key += ` [invalid]`;\n    if (ariaNode.level)\n      key += ` [level=${ariaNode.level}]`;\n    if (ariaNode.pressed === "mixed")\n      key += ` [pressed=mixed]`;\n    if (ariaNode.pressed === true)\n      key += ` [pressed]`;\n    if (ariaNode.selected === true)\n      key += ` [selected]`;\n    if (ariaNode.ref) {\n      key += ` [ref=${ariaNode.ref}]`;\n      if (renderCursorPointer && hasPointerCursor(ariaNode))\n        key += " [cursor=pointer]";\n    }\n    if (options.renderBoxes) {\n      const element = ariaNodeElement(ariaNode);\n      if (element) {\n        const r = element.getBoundingClientRect();\n        key += ` [box=${Math.round(r.x)},${Math.round(r.y)},${Math.round(r.width)},${Math.round(r.height)}]`;\n      }\n    }\n    return key;\n  };\n  const getSingleInlinedTextChild = (ariaNode) => {\n    return (ariaNode == null ? void 0 : ariaNode.children.length) === 1 && typeof ariaNode.children[0] === "string" && !Object.keys(ariaNode.props).length ? ariaNode.children[0] : void 0;\n  };\n  const visit = (ariaNode, depth, renderCursorPointer) => {\n    if (publicOptions.depth && depth > publicOptions.depth)\n      return;\n    if (ariaNode.role === "iframe" && ariaNode.ref)\n      iframeDepths[ariaNode.ref] = depth;\n    if (statusMap.get(ariaNode) === "same" && ariaNode.ref) {\n      lines.push(indent(depth) + `- ref=${ariaNode.ref} [unchanged]`);\n      return;\n    }\n    const isDiffRoot = !!previousSnapshot && !depth;\n    const escapedKey = indent(depth) + "- " + (isDiffRoot ? "<changed> " : "") + yamlEscapeKeyIfNeeded(createKey(ariaNode, renderCursorPointer));\n    const singleInlinedTextChild = getSingleInlinedTextChild(ariaNode);\n    const isAtDepthLimit = !!publicOptions.depth && depth === publicOptions.depth;\n    const hasNoChildren = !singleInlinedTextChild && (!ariaNode.children.length || isAtDepthLimit);\n    if (hasNoChildren && !Object.keys(ariaNode.props).length) {\n      lines.push(escapedKey);\n    } else if (singleInlinedTextChild !== void 0) {\n      const shouldInclude = includeText(ariaNode, singleInlinedTextChild);\n      if (shouldInclude)\n        lines.push(escapedKey + ": " + yamlEscapeValueIfNeeded(renderString(singleInlinedTextChild)));\n      else\n        lines.push(escapedKey);\n    } else {\n      lines.push(escapedKey + ":");\n      for (const [name, value] of Object.entries(ariaNode.props))\n        lines.push(indent(depth + 1) + "- /" + name + ": " + yamlEscapeValueIfNeeded(value));\n      const inCursorPointer = !!ariaNode.ref && renderCursorPointer && hasPointerCursor(ariaNode);\n      for (const child of ariaNode.children) {\n        if (typeof child === "string")\n          visitText(includeText(ariaNode, child) ? child : "", depth + 1);\n        else\n          visit(child, depth + 1, renderCursorPointer && !inCursorPointer);\n      }\n    }\n  };\n  for (const nodeToRender of nodesToRender) {\n    if (typeof nodeToRender === "string")\n      visitText(nodeToRender, 0);\n    else\n      visit(nodeToRender, 0, !!options.renderCursorPointer);\n  }\n  return { text: lines.join("\\n"), iframeDepths };\n}\nfunction convertToBestGuessRegex(text) {\n  const dynamicContent = [\n    // 550e8400-e29b-41d4-a716-446655440000\n    { regex: /\\b[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}\\b/, replacement: "[0-9a-fA-F-]+" },\n    // 2mb\n    { regex: /\\b[\\d,.]+[bkmBKM]+\\b/, replacement: "[\\\\d,.]+[bkmBKM]+" },\n    // 2ms, 20s\n    { regex: /\\b\\d+[hmsp]+\\b/, replacement: "\\\\d+[hmsp]+" },\n    { regex: /\\b[\\d,.]+[hmsp]+\\b/, replacement: "[\\\\d,.]+[hmsp]+" },\n    // Do not replace single digits with regex by default.\n    // 2+ digits: [Issue 22, 22.3, 2.33, 2,333]\n    { regex: /\\b\\d+,\\d+\\b/, replacement: "\\\\d+,\\\\d+" },\n    { regex: /\\b\\d+\\.\\d{2,}\\b/, replacement: "\\\\d+\\\\.\\\\d+" },\n    { regex: /\\b\\d{2,}\\.\\d+\\b/, replacement: "\\\\d+\\\\.\\\\d+" },\n    { regex: /\\b\\d{2,}\\b/, replacement: "\\\\d+" }\n  ];\n  let pattern = "";\n  let lastIndex = 0;\n  const combinedRegex = new RegExp(dynamicContent.map((r) => "(" + r.regex.source + ")").join("|"), "g");\n  text.replace(combinedRegex, (match, ...args) => {\n    const offset = args[args.length - 2];\n    const groups = args.slice(0, -2);\n    pattern += escapeRegExp(text.slice(lastIndex, offset));\n    for (let i = 0; i < groups.length; i++) {\n      if (groups[i]) {\n        const { replacement } = dynamicContent[i];\n        pattern += replacement;\n        break;\n      }\n    }\n    lastIndex = offset + match.length;\n    return match;\n  });\n  if (!pattern)\n    return text;\n  pattern += escapeRegExp(text.slice(lastIndex));\n  return String(new RegExp(pattern));\n}\nfunction textContributesInfo(node, text) {\n  if (!text.length)\n    return false;\n  if (!node.name)\n    return true;\n  const substr = text.length <= 200 && node.name.length <= 200 ? longestCommonSubstring(text, node.name) : "";\n  let filtered = text;\n  while (substr && filtered.includes(substr))\n    filtered = filtered.replace(substr, "");\n  return filtered.trim().length / text.length > 0.1;\n}\nvar elementSymbol = Symbol("element");\nfunction ariaNodeElement(ariaNode) {\n  return ariaNode[elementSymbol];\n}\nfunction setAriaNodeElement(ariaNode, element) {\n  ariaNode[elementSymbol] = element;\n}\nfunction findNewElement(from, to) {\n  const node = findNewNode(from, to);\n  return node ? ariaNodeElement(node) : void 0;\n}\n\n// packages/injected/src/highlight.css?inline\nvar highlight_default = ":host{font-size:13px;font-family:system-ui,Ubuntu,Droid Sans,sans-serif;color:#333;color-scheme:light}svg{position:absolute;height:0}x-pw-tooltip{backdrop-filter:blur(5px);background-color:#fff;border-radius:6px;box-shadow:0 .5rem 1.2rem #0000004d;display:none;font-size:12.8px;font-weight:400;left:0;line-height:1.5;max-width:600px;position:absolute;top:0;padding:0;flex-direction:column;overflow:hidden}x-pw-tooltip-line{display:flex;max-width:600px;padding:6px;user-select:none;cursor:pointer}x-pw-tooltip-footer{display:flex;max-width:600px;padding:6px;user-select:none;color:#777}x-pw-dialog{background-color:#fff;pointer-events:auto;border-radius:6px;box-shadow:0 .5rem 1.2rem #0000004d;display:flex;flex-direction:column;position:absolute;z-index:10;font-size:13px}x-pw-dialog:not(.autosize){width:400px;height:150px}x-pw-dialog-body{display:flex;flex-direction:column;flex:auto}x-pw-dialog-body label{margin:5px 8px;display:flex;flex-direction:row;align-items:center}x-pw-highlight{position:absolute;top:0;left:0;width:0;height:0}x-pw-action-point{position:absolute;width:20px;height:20px;background:red;border-radius:10px;margin:-10px 0 0 -10px;z-index:2}x-pw-action-cursor{position:absolute;width:18px;height:22px;pointer-events:none;z-index:4;filter:drop-shadow(0 1px 2px rgba(0,0,0,.4))}x-pw-action-cursor svg{width:100%;height:100%;position:static}x-pw-title{position:absolute;backdrop-filter:blur(5px);background-color:#00000080;color:#fff;border-radius:6px;padding:6px;font-size:24px;line-height:1.4;white-space:nowrap;user-select:none;z-index:3}x-pw-user-overlays,x-pw-user-overlay{position:absolute;inset:0}@keyframes pw-fade-out{0%{opacity:1}to{opacity:0}}x-pw-separator{height:1px;margin:6px 9px;background:#949494e5}x-pw-tool-gripper{height:28px;width:24px;margin:2px 0;cursor:grab}x-pw-tool-gripper:active{cursor:grabbing}x-pw-tool-gripper>x-div{width:16px;height:16px;margin:6px 4px;clip-path:url(#icon-gripper);background-color:#555}x-pw-tools-list>label{display:flex;align-items:center;margin:0 10px;user-select:none}x-pw-tools-list{display:flex;width:100%;border-bottom:1px solid #dddddd}x-pw-tool-item{pointer-events:auto;height:28px;width:28px;border-radius:3px}x-pw-tool-item:not(.disabled){cursor:pointer}x-pw-tool-item:not(.disabled):hover{background-color:#dbdbdb}x-pw-tool-item.toggled{background-color:#8acae480}x-pw-tool-item.toggled:not(.disabled):hover{background-color:#8acae4c4}x-pw-tool-item>x-div{width:16px;height:16px;margin:6px;background-color:#3a3a3a}x-pw-tool-item.disabled>x-div{background-color:#61616180;cursor:default}x-pw-tool-item.record.toggled{background-color:transparent}x-pw-tool-item.record.toggled:not(.disabled):hover{background-color:#dbdbdb}x-pw-tool-item.record.toggled>x-div{background-color:#a1260d}x-pw-tool-item.record.disabled.toggled>x-div{opacity:.8}x-pw-tool-item.accept>x-div{background-color:#388a34}x-pw-tool-item.record>x-div{clip-path:url(#icon-circle-large-filled)}x-pw-tool-item.record.toggled>x-div{clip-path:url(#icon-stop-circle)}x-pw-tool-item.pick-locator>x-div{clip-path:url(#icon-inspect)}x-pw-tool-item.text>x-div{clip-path:url(#icon-whole-word)}x-pw-tool-item.visibility>x-div{clip-path:url(#icon-eye)}x-pw-tool-item.value>x-div{clip-path:url(#icon-symbol-constant)}x-pw-tool-item.snapshot>x-div{clip-path:url(#icon-gist)}x-pw-tool-item.accept>x-div{clip-path:url(#icon-check)}x-pw-tool-item.cancel>x-div{clip-path:url(#icon-close)}x-pw-tool-item.succeeded>x-div{clip-path:url(#icon-pass);background-color:#388a34!important}x-pw-overlay{position:absolute;top:0;max-width:min-content;z-index:2147483647;background:transparent;pointer-events:auto}x-pw-overlay x-pw-tools-list{background-color:#fffd;box-shadow:#0000001a 0 5px 5px;border-radius:3px;border-bottom:none}x-pw-overlay x-pw-tool-item{margin:2px}textarea.text-editor{font-family:system-ui,Ubuntu,Droid Sans,sans-serif;flex:auto;border:none;margin:6px 10px;color:#333;outline:1px solid transparent!important;resize:none;padding:0;font-size:13px}textarea.text-editor.does-not-match{outline:1px solid red!important}x-div{display:block}x-spacer{flex:auto}*{box-sizing:border-box}*[hidden]{display:none!important}x-locator-editor{flex:none;width:100%;height:60px;padding:4px;border-bottom:1px solid #dddddd;outline:1px solid transparent}x-locator-editor.does-not-match{outline:1px solid red}.CodeMirror{width:100%!important;height:100%!important}x-pw-action-list{flex:auto;display:flex;flex-direction:column;user-select:none}x-pw-action-item{padding:6px 10px;cursor:pointer;overflow:hidden}x-pw-action-item:hover{background-color:#f2f2f2}x-pw-action-item:last-child{border-bottom-left-radius:6px;border-bottom-right-radius:6px}\\n";\n\n// packages/injected/src/highlight.ts\nvar Highlight = class {\n  constructor(injectedScript) {\n    this._renderedEntries = [];\n    this._userOverlays = /* @__PURE__ */ new Map();\n    this._userOverlayHidden = false;\n    this._language = "javascript";\n    this._elementHighlightSelectors = /* @__PURE__ */ new Map();\n    this._injectedScript = injectedScript;\n    const document = injectedScript.document;\n    this._isUnderTest = injectedScript.isUnderTest;\n    this._glassPaneElement = document.createElement("x-pw-glass");\n    this._glassPaneElement.setAttribute("popover", "manual");\n    this._glassPaneElement.style.inset = "0";\n    this._glassPaneElement.style.width = "100%";\n    this._glassPaneElement.style.height = "100%";\n    this._glassPaneElement.style.maxWidth = "none";\n    this._glassPaneElement.style.maxHeight = "none";\n    this._glassPaneElement.style.padding = "0";\n    this._glassPaneElement.style.margin = "0";\n    this._glassPaneElement.style.border = "none";\n    this._glassPaneElement.style.overflow = "visible";\n    this._glassPaneElement.style.pointerEvents = "none";\n    this._glassPaneElement.style.display = "flex";\n    this._glassPaneElement.style.backgroundColor = "transparent";\n    this._actionPointElement = document.createElement("x-pw-action-point");\n    this._actionPointElement.setAttribute("hidden", "true");\n    this._actionCursorElement = document.createElement("x-pw-action-cursor");\n    this._actionCursorElement.style.visibility = "hidden";\n    this._actionCursorElement.appendChild(this._createCursorSvg(document));\n    this._titleElement = document.createElement("x-pw-title");\n    this._titleElement.setAttribute("hidden", "true");\n    this._userOverlayContainer = document.createElement("x-pw-user-overlays");\n    this._userOverlayContainer.setAttribute("hidden", "true");\n    this._glassPaneShadow = this._glassPaneElement.attachShadow({ mode: this._isUnderTest ? "open" : "closed" });\n    if (typeof this._glassPaneShadow.adoptedStyleSheets.push === "function") {\n      const sheet = new this._injectedScript.window.CSSStyleSheet();\n      sheet.replaceSync(highlight_default);\n      this._glassPaneShadow.adoptedStyleSheets.push(sheet);\n    } else {\n      const styleElement = this._injectedScript.document.createElement("style");\n      styleElement.textContent = highlight_default;\n      this._glassPaneShadow.appendChild(styleElement);\n    }\n    this._glassPaneShadow.appendChild(this._actionPointElement);\n    this._glassPaneShadow.appendChild(this._actionCursorElement);\n    this._glassPaneShadow.appendChild(this._titleElement);\n    this._glassPaneShadow.appendChild(this._userOverlayContainer);\n  }\n  install() {\n    if (!this._injectedScript.document.documentElement)\n      return;\n    if (!this._injectedScript.document.documentElement.contains(this._glassPaneElement) || this._glassPaneElement.nextElementSibling)\n      this._injectedScript.document.documentElement.appendChild(this._glassPaneElement);\n    this._bringToFront();\n  }\n  _bringToFront() {\n    this._glassPaneElement.hidePopover();\n    this._glassPaneElement.showPopover();\n  }\n  setLanguage(language) {\n    this._language = language;\n  }\n  addElementHighlight(selector, cssStyle) {\n    const key = stringifySelector(selector);\n    this._elementHighlightSelectors.set(key, { selector, cssStyle });\n    this._ensureElementHighlightRaf();\n  }\n  removeElementHighlight(selector) {\n    const key = stringifySelector(selector);\n    if (!this._elementHighlightSelectors.delete(key))\n      return;\n    if (this._elementHighlightSelectors.size === 0) {\n      if (this._rafRequest) {\n        this._injectedScript.utils.builtins.cancelAnimationFrame(this._rafRequest);\n        this._rafRequest = void 0;\n      }\n      this.clearHighlight();\n    }\n  }\n  _ensureElementHighlightRaf() {\n    if (this._rafRequest)\n      return;\n    const tick = () => {\n      const entries = [];\n      for (const { selector, cssStyle } of this._elementHighlightSelectors.values()) {\n        const elements = this._injectedScript.querySelectorAll(selector, this._injectedScript.document.documentElement);\n        const locator = asLocator(this._language, stringifySelector(selector));\n        const color = elements.length > 1 ? "#f6b26b7f" : "#6fa8dc7f";\n        for (let i = 0; i < elements.length; ++i) {\n          const suffix = elements.length > 1 ? ` [${i + 1} of ${elements.length}]` : "";\n          entries.push({ element: elements[i], color, tooltipText: locator + suffix, cssStyle });\n        }\n      }\n      this.updateHighlight(entries);\n      this._rafRequest = this._injectedScript.utils.builtins.requestAnimationFrame(tick);\n    };\n    this._rafRequest = this._injectedScript.utils.builtins.requestAnimationFrame(tick);\n  }\n  uninstall() {\n    if (this._rafRequest) {\n      this._injectedScript.utils.builtins.cancelAnimationFrame(this._rafRequest);\n      this._rafRequest = void 0;\n    }\n    this._elementHighlightSelectors.clear();\n    this._glassPaneElement.remove();\n  }\n  showActionPoint(x, y, fadeDuration) {\n    this._actionPointElement.style.top = y + "px";\n    this._actionPointElement.style.left = x + "px";\n    this._actionPointElement.hidden = false;\n    if (fadeDuration)\n      this._actionPointElement.style.animation = `pw-fade-out ${fadeDuration}ms ease-out forwards`;\n    else\n      this._actionPointElement.style.animation = "";\n  }\n  hideActionPoint() {\n    this._actionPointElement.hidden = true;\n  }\n  moveActionCursor(x, y, fadeDuration) {\n    const moveDuration = fadeDuration ? Math.max(80, Math.min(fadeDuration * 0.6, 400)) : 0;\n    this._actionCursorElement.style.transition = `top ${moveDuration}ms ease, left ${moveDuration}ms ease`;\n    this._actionCursorElement.style.left = x + "px";\n    this._actionCursorElement.style.top = y + "px";\n    this._actionCursorElement.style.visibility = "visible";\n  }\n  hideActionCursor() {\n    this._actionCursorElement.style.visibility = "hidden";\n  }\n  _createCursorSvg(document) {\n    const svgNs = "http://www.w3.org/2000/svg";\n    const svg = document.createElementNS(svgNs, "svg");\n    svg.setAttribute("viewBox", "0 0 18 22");\n    const path = document.createElementNS(svgNs, "path");\n    path.setAttribute("d", "M1 1 L1 17 L5.5 13 L8 20.5 L11 19.5 L8.5 12 L15 12 Z");\n    path.setAttribute("fill", "white");\n    path.setAttribute("stroke", "black");\n    path.setAttribute("stroke-width", "1.5");\n    path.setAttribute("stroke-linejoin", "round");\n    svg.appendChild(path);\n    return svg;\n  }\n  showActionTitle(text, fadeDuration, position, fontSize) {\n    this._titleElement.textContent = text;\n    this._titleElement.hidden = false;\n    if (fadeDuration) {\n      const fadeTime = fadeDuration / 4;\n      this._titleElement.style.animation = `pw-fade-out ${fadeTime}ms ease-out ${fadeDuration - fadeTime}ms forwards`;\n    } else {\n      this._titleElement.style.animation = "";\n    }\n    this._titleElement.style.top = "";\n    this._titleElement.style.bottom = "";\n    this._titleElement.style.left = "";\n    this._titleElement.style.right = "";\n    this._titleElement.style.transform = "";\n    switch (position) {\n      case "top-left":\n        this._titleElement.style.top = "6px";\n        this._titleElement.style.left = "6px";\n        break;\n      case "top":\n        this._titleElement.style.top = "6px";\n        this._titleElement.style.left = "50%";\n        this._titleElement.style.transform = "translateX(-50%)";\n        break;\n      case "bottom-left":\n        this._titleElement.style.bottom = "6px";\n        this._titleElement.style.left = "6px";\n        break;\n      case "bottom":\n        this._titleElement.style.bottom = "6px";\n        this._titleElement.style.left = "50%";\n        this._titleElement.style.transform = "translateX(-50%)";\n        break;\n      case "bottom-right":\n        this._titleElement.style.bottom = "6px";\n        this._titleElement.style.right = "6px";\n        break;\n      case "top-right":\n      default:\n        this._titleElement.style.top = "6px";\n        this._titleElement.style.right = "6px";\n        break;\n    }\n    if (fontSize)\n      this._titleElement.style.fontSize = fontSize + "px";\n  }\n  hideActionTitle() {\n    this._titleElement.hidden = true;\n  }\n  addUserOverlay(id, html) {\n    const element = this._injectedScript.document.createElement("div");\n    element.className = "x-pw-user-overlay";\n    element.innerHTML = html;\n    for (const script of element.querySelectorAll("script"))\n      script.remove();\n    for (const el of element.querySelectorAll("*")) {\n      for (const attr of [...el.attributes]) {\n        if (attr.name.startsWith("on"))\n          el.removeAttribute(attr.name);\n      }\n    }\n    this._userOverlays.set(id, element);\n    this._userOverlayContainer.appendChild(element);\n    this._userOverlayContainer.hidden = this._userOverlayHidden;\n    return id;\n  }\n  getUserOverlay(id) {\n    return this._userOverlays.get(id);\n  }\n  removeUserOverlay(id) {\n    const element = this._userOverlays.get(id);\n    if (element) {\n      element.remove();\n      this._userOverlays.delete(id);\n    }\n    if (this._userOverlays.size === 0)\n      this._userOverlayContainer.hidden = true;\n  }\n  setUserOverlaysVisible(visible) {\n    this._userOverlayHidden = !visible;\n    this._userOverlayContainer.hidden = !visible || this._userOverlays.size === 0;\n  }\n  clearHighlight() {\n    var _a, _b;\n    for (const entry of this._renderedEntries) {\n      (_a = entry.highlightElement) == null ? void 0 : _a.remove();\n      (_b = entry.tooltipElement) == null ? void 0 : _b.remove();\n    }\n    this._renderedEntries = [];\n  }\n  maskElements(elements, color) {\n    this.updateHighlight(elements.map((element) => ({ element, color })));\n  }\n  updateHighlight(entries) {\n    if (this._highlightIsUpToDate(entries))\n      return;\n    this.clearHighlight();\n    for (const entry of entries) {\n      const highlightElement = this._createHighlightElement();\n      this._glassPaneShadow.appendChild(highlightElement);\n      let tooltipElement;\n      if (entry.tooltipText) {\n        tooltipElement = this._injectedScript.document.createElement("x-pw-tooltip");\n        this._glassPaneShadow.appendChild(tooltipElement);\n        tooltipElement.style.top = "0";\n        tooltipElement.style.left = "0";\n        tooltipElement.style.display = "flex";\n        const lineElement = this._injectedScript.document.createElement("x-pw-tooltip-line");\n        lineElement.textContent = entry.tooltipText;\n        tooltipElement.appendChild(lineElement);\n      }\n      this._renderedEntries.push({ targetElement: entry.element, box: toDOMRect(entry.box), color: entry.color, borderColor: entry.borderColor, fadeDuration: entry.fadeDuration, cssStyle: entry.cssStyle, tooltipElement, highlightElement });\n    }\n    for (const entry of this._renderedEntries) {\n      if (!entry.box && !entry.targetElement)\n        continue;\n      entry.box = entry.box || entry.targetElement.getBoundingClientRect();\n      if (!entry.tooltipElement)\n        continue;\n      const { anchorLeft, anchorTop } = this.tooltipPosition(entry.box, entry.tooltipElement);\n      entry.tooltipTop = anchorTop;\n      entry.tooltipLeft = anchorLeft;\n    }\n    for (const entry of this._renderedEntries) {\n      if (entry.tooltipElement) {\n        entry.tooltipElement.style.top = entry.tooltipTop + "px";\n        entry.tooltipElement.style.left = entry.tooltipLeft + "px";\n      }\n      const box = entry.box;\n      entry.highlightElement.style.backgroundColor = entry.color;\n      entry.highlightElement.style.left = box.x + "px";\n      entry.highlightElement.style.top = box.y + "px";\n      entry.highlightElement.style.width = box.width + "px";\n      entry.highlightElement.style.height = box.height + "px";\n      entry.highlightElement.style.display = "block";\n      if (entry.borderColor)\n        entry.highlightElement.style.border = "2px solid " + entry.borderColor;\n      if (entry.fadeDuration)\n        entry.highlightElement.style.animation = `pw-fade-out ${entry.fadeDuration}ms ease-out forwards`;\n      if (entry.cssStyle)\n        entry.highlightElement.style.cssText += ";" + entry.cssStyle;\n      if (this._isUnderTest)\n        console.error("Highlight box for test: " + JSON.stringify({ x: box.x, y: box.y, width: box.width, height: box.height }));\n    }\n  }\n  firstBox() {\n    var _a;\n    return (_a = this._renderedEntries[0]) == null ? void 0 : _a.box;\n  }\n  firstTooltipBox() {\n    const entry = this._renderedEntries[0];\n    if (!entry || !entry.tooltipElement || entry.tooltipLeft === void 0 || entry.tooltipTop === void 0)\n      return;\n    return {\n      x: entry.tooltipLeft,\n      y: entry.tooltipTop,\n      left: entry.tooltipLeft,\n      top: entry.tooltipTop,\n      width: entry.tooltipElement.offsetWidth,\n      height: entry.tooltipElement.offsetHeight,\n      bottom: entry.tooltipTop + entry.tooltipElement.offsetHeight,\n      right: entry.tooltipLeft + entry.tooltipElement.offsetWidth,\n      toJSON: () => {\n      }\n    };\n  }\n  // Note: there is a copy of this method in dialog.tsx. Please fix bugs in both places.\n  tooltipPosition(box, tooltipElement) {\n    const tooltipWidth = tooltipElement.offsetWidth;\n    const tooltipHeight = tooltipElement.offsetHeight;\n    const totalWidth = this._glassPaneElement.offsetWidth;\n    const totalHeight = this._glassPaneElement.offsetHeight;\n    let anchorLeft = Math.max(5, box.left);\n    if (anchorLeft + tooltipWidth > totalWidth - 5)\n      anchorLeft = totalWidth - tooltipWidth - 5;\n    let anchorTop = Math.max(0, box.bottom) + 5;\n    if (anchorTop + tooltipHeight > totalHeight - 5) {\n      if (Math.max(0, box.top) > tooltipHeight + 5) {\n        anchorTop = Math.max(0, box.top) - tooltipHeight - 5;\n      } else {\n        anchorTop = totalHeight - 5 - tooltipHeight;\n      }\n    }\n    return { anchorLeft, anchorTop };\n  }\n  _highlightIsUpToDate(entries) {\n    if (entries.length !== this._renderedEntries.length)\n      return false;\n    for (let i = 0; i < this._renderedEntries.length; ++i) {\n      if (entries[i].element !== this._renderedEntries[i].targetElement)\n        return false;\n      if (entries[i].color !== this._renderedEntries[i].color)\n        return false;\n      if (entries[i].cssStyle !== this._renderedEntries[i].cssStyle)\n        return false;\n      const oldBox = this._renderedEntries[i].box;\n      if (!oldBox)\n        return false;\n      const box = entries[i].box ? toDOMRect(entries[i].box) : entries[i].element.getBoundingClientRect();\n      if (box.top !== oldBox.top || box.right !== oldBox.right || box.bottom !== oldBox.bottom || box.left !== oldBox.left)\n        return false;\n    }\n    return true;\n  }\n  _createHighlightElement() {\n    return this._injectedScript.document.createElement("x-pw-highlight");\n  }\n  appendChild(element) {\n    this._glassPaneShadow.appendChild(element);\n  }\n  onGlassPaneClick(handler) {\n    this._glassPaneElement.style.pointerEvents = "auto";\n    this._glassPaneElement.style.backgroundColor = "rgba(0, 0, 0, 0.3)";\n    this._glassPaneElement.addEventListener("click", handler);\n  }\n  offGlassPaneClick(handler) {\n    this._glassPaneElement.style.pointerEvents = "none";\n    this._glassPaneElement.style.backgroundColor = "transparent";\n    this._glassPaneElement.removeEventListener("click", handler);\n  }\n};\nfunction toDOMRect(box) {\n  if (!box)\n    return void 0;\n  return new DOMRect(box.x, box.y, box.width, box.height);\n}\n\n// packages/injected/src/layoutSelectorUtils.ts\nfunction boxRightOf(box1, box2, maxDistance) {\n  const distance = box1.left - box2.right;\n  if (distance < 0 || maxDistance !== void 0 && distance > maxDistance)\n    return;\n  return distance + Math.max(box2.bottom - box1.bottom, 0) + Math.max(box1.top - box2.top, 0);\n}\nfunction boxLeftOf(box1, box2, maxDistance) {\n  const distance = box2.left - box1.right;\n  if (distance < 0 || maxDistance !== void 0 && distance > maxDistance)\n    return;\n  return distance + Math.max(box2.bottom - box1.bottom, 0) + Math.max(box1.top - box2.top, 0);\n}\nfunction boxAbove(box1, box2, maxDistance) {\n  const distance = box2.top - box1.bottom;\n  if (distance < 0 || maxDistance !== void 0 && distance > maxDistance)\n    return;\n  return distance + Math.max(box1.left - box2.left, 0) + Math.max(box2.right - box1.right, 0);\n}\nfunction boxBelow(box1, box2, maxDistance) {\n  const distance = box1.top - box2.bottom;\n  if (distance < 0 || maxDistance !== void 0 && distance > maxDistance)\n    return;\n  return distance + Math.max(box1.left - box2.left, 0) + Math.max(box2.right - box1.right, 0);\n}\nfunction boxNear(box1, box2, maxDistance) {\n  const kThreshold = maxDistance === void 0 ? 50 : maxDistance;\n  let score = 0;\n  if (box1.left - box2.right >= 0)\n    score += box1.left - box2.right;\n  if (box2.left - box1.right >= 0)\n    score += box2.left - box1.right;\n  if (box2.top - box1.bottom >= 0)\n    score += box2.top - box1.bottom;\n  if (box1.top - box2.bottom >= 0)\n    score += box1.top - box2.bottom;\n  return score > kThreshold ? void 0 : score;\n}\nvar kLayoutSelectorNames = ["left-of", "right-of", "above", "below", "near"];\nfunction layoutSelectorScore(name, element, inner, maxDistance) {\n  const box = element.getBoundingClientRect();\n  const scorer = { "left-of": boxLeftOf, "right-of": boxRightOf, "above": boxAbove, "below": boxBelow, "near": boxNear }[name];\n  let bestScore;\n  for (const e of inner) {\n    if (e === element)\n      continue;\n    const score = scorer(box, e.getBoundingClientRect(), maxDistance);\n    if (score === void 0)\n      continue;\n    if (bestScore === void 0 || score < bestScore)\n      bestScore = score;\n  }\n  return bestScore;\n}\n\n// packages/injected/src/selectorUtils.ts\nfunction matchesAttributePart(value, attr) {\n  const objValue = typeof value === "string" && !attr.caseSensitive ? value.toUpperCase() : value;\n  const attrValue = typeof attr.value === "string" && !attr.caseSensitive ? attr.value.toUpperCase() : attr.value;\n  if (attr.op === "<truthy>")\n    return !!objValue;\n  if (attr.op === "=") {\n    if (attrValue instanceof RegExp)\n      return typeof objValue === "string" && !!objValue.match(attrValue);\n    return objValue === attrValue;\n  }\n  if (typeof objValue !== "string" || typeof attrValue !== "string")\n    return false;\n  if (attr.op === "*=")\n    return objValue.includes(attrValue);\n  if (attr.op === "^=")\n    return objValue.startsWith(attrValue);\n  if (attr.op === "$=")\n    return objValue.endsWith(attrValue);\n  if (attr.op === "|=")\n    return objValue === attrValue || objValue.startsWith(attrValue + "-");\n  if (attr.op === "~=")\n    return objValue.split(" ").includes(attrValue);\n  return false;\n}\nfunction shouldSkipForTextMatching(element) {\n  const document = element.ownerDocument;\n  return element.nodeName === "SCRIPT" || element.nodeName === "NOSCRIPT" || element.nodeName === "STYLE" || document.head && document.head.contains(element);\n}\nfunction elementText(cache, root) {\n  let value = cache.get(root);\n  if (value === void 0) {\n    value = { full: "", normalized: "", immediate: [] };\n    if (!shouldSkipForTextMatching(root)) {\n      let currentImmediate = "";\n      if (root instanceof HTMLInputElement && (root.type === "submit" || root.type === "button")) {\n        value = { full: root.value, normalized: normalizeWhiteSpace(root.value), immediate: [root.value] };\n      } else {\n        for (let child = root.firstChild; child; child = child.nextSibling) {\n          if (child.nodeType === Node.TEXT_NODE) {\n            value.full += child.nodeValue || "";\n            currentImmediate += child.nodeValue || "";\n          } else if (child.nodeType === Node.COMMENT_NODE) {\n            continue;\n          } else {\n            if (currentImmediate)\n              value.immediate.push(currentImmediate);\n            currentImmediate = "";\n            if (child.nodeType === Node.ELEMENT_NODE)\n              value.full += elementText(cache, child).full;\n          }\n        }\n        if (currentImmediate)\n          value.immediate.push(currentImmediate);\n        if (root.shadowRoot)\n          value.full += elementText(cache, root.shadowRoot).full;\n        if (value.full)\n          value.normalized = normalizeWhiteSpace(value.full);\n      }\n    }\n    cache.set(root, value);\n  }\n  return value;\n}\nfunction elementMatchesText(cache, element, matcher) {\n  if (shouldSkipForTextMatching(element))\n    return "none";\n  if (!matcher(elementText(cache, element)))\n    return "none";\n  for (let child = element.firstChild; child; child = child.nextSibling) {\n    if (child.nodeType === Node.ELEMENT_NODE && matcher(elementText(cache, child)))\n      return "selfAndChildren";\n  }\n  if (element.shadowRoot && matcher(elementText(cache, element.shadowRoot)))\n    return "selfAndChildren";\n  return "self";\n}\nfunction getElementLabels(textCache, element) {\n  const labels = getAriaLabelledByElements(element);\n  if (labels)\n    return labels.map((label) => elementText(textCache, label));\n  const ariaLabel = element.getAttribute("aria-label");\n  if (ariaLabel !== null && !!ariaLabel.trim())\n    return [{ full: ariaLabel, normalized: normalizeWhiteSpace(ariaLabel), immediate: [ariaLabel] }];\n  const isNonHiddenInput = element.nodeName === "INPUT" && element.type !== "hidden";\n  if (["BUTTON", "METER", "OUTPUT", "PROGRESS", "SELECT", "TEXTAREA"].includes(element.nodeName) || isNonHiddenInput) {\n    const labels2 = element.labels;\n    if (labels2)\n      return [...labels2].map((label) => elementText(textCache, label));\n  }\n  return [];\n}\n\n// packages/injected/src/roleSelectorEngine.ts\nvar kSupportedAttributes = ["selected", "checked", "pressed", "expanded", "level", "disabled", "name", "description", "include-hidden"];\nkSupportedAttributes.sort();\nfunction validateSupportedRole(attr, roles, role) {\n  if (!roles.includes(role))\n    throw new Error(`"${attr}" attribute is only supported for roles: ${roles.slice().sort().map((role2) => `"${role2}"`).join(", ")}`);\n}\nfunction validateSupportedValues(attr, values) {\n  if (attr.op !== "<truthy>" && !values.includes(attr.value))\n    throw new Error(`"${attr.name}" must be one of ${values.map((v) => JSON.stringify(v)).join(", ")}`);\n}\nfunction validateSupportedOp(attr, ops) {\n  if (!ops.includes(attr.op))\n    throw new Error(`"${attr.name}" does not support "${attr.op}" matcher`);\n}\nfunction validateAttributes(attrs, role) {\n  const options = { role };\n  for (const attr of attrs) {\n    switch (attr.name) {\n      case "checked": {\n        validateSupportedRole(attr.name, kAriaCheckedRoles, role);\n        validateSupportedValues(attr, [true, false, "mixed"]);\n        validateSupportedOp(attr, ["<truthy>", "="]);\n        options.checked = attr.op === "<truthy>" ? true : attr.value;\n        break;\n      }\n      case "pressed": {\n        validateSupportedRole(attr.name, kAriaPressedRoles, role);\n        validateSupportedValues(attr, [true, false, "mixed"]);\n        validateSupportedOp(attr, ["<truthy>", "="]);\n        options.pressed = attr.op === "<truthy>" ? true : attr.value;\n        break;\n      }\n      case "selected": {\n        validateSupportedRole(attr.name, kAriaSelectedRoles, role);\n        validateSupportedValues(attr, [true, false]);\n        validateSupportedOp(attr, ["<truthy>", "="]);\n        options.selected = attr.op === "<truthy>" ? true : attr.value;\n        break;\n      }\n      case "expanded": {\n        validateSupportedRole(attr.name, kAriaExpandedRoles, role);\n        validateSupportedValues(attr, [true, false]);\n        validateSupportedOp(attr, ["<truthy>", "="]);\n        options.expanded = attr.op === "<truthy>" ? true : attr.value;\n        break;\n      }\n      case "level": {\n        validateSupportedRole(attr.name, kAriaLevelRoles, role);\n        if (typeof attr.value === "string")\n          attr.value = +attr.value;\n        if (attr.op !== "=" || typeof attr.value !== "number" || Number.isNaN(attr.value))\n          throw new Error(`"level" attribute must be compared to a number`);\n        options.level = attr.value;\n        break;\n      }\n      case "disabled": {\n        validateSupportedValues(attr, [true, false]);\n        validateSupportedOp(attr, ["<truthy>", "="]);\n        options.disabled = attr.op === "<truthy>" ? true : attr.value;\n        break;\n      }\n      case "name": {\n        if (attr.op === "<truthy>")\n          throw new Error(`"name" attribute must have a value`);\n        if (typeof attr.value !== "string" && !(attr.value instanceof RegExp))\n          throw new Error(`"name" attribute must be a string or a regular expression`);\n        options.name = attr.value;\n        options.nameOp = attr.op;\n        options.nameExact = attr.caseSensitive;\n        break;\n      }\n      case "description": {\n        if (attr.op === "<truthy>")\n          throw new Error(`"description" attribute must have a value`);\n        if (typeof attr.value !== "string" && !(attr.value instanceof RegExp))\n          throw new Error(`"description" attribute must be a string or a regular expression`);\n        options.description = attr.value;\n        options.descriptionOp = attr.op;\n        options.descriptionExact = attr.caseSensitive;\n        break;\n      }\n      case "include-hidden": {\n        validateSupportedValues(attr, [true, false]);\n        validateSupportedOp(attr, ["<truthy>", "="]);\n        options.includeHidden = attr.op === "<truthy>" ? true : attr.value;\n        break;\n      }\n      default: {\n        throw new Error(`Unknown attribute "${attr.name}", must be one of ${kSupportedAttributes.map((a) => `"${a}"`).join(", ")}.`);\n      }\n    }\n  }\n  return options;\n}\nfunction queryRole(scope, options, internal) {\n  const result = [];\n  const match = (element) => {\n    if (getAriaRole(element) !== options.role)\n      return;\n    if (options.selected !== void 0 && getAriaSelected(element) !== options.selected)\n      return;\n    if (options.checked !== void 0 && getAriaChecked(element) !== options.checked)\n      return;\n    if (options.pressed !== void 0 && getAriaPressed(element) !== options.pressed)\n      return;\n    if (options.expanded !== void 0 && getAriaExpanded(element) !== options.expanded)\n      return;\n    if (options.level !== void 0 && getAriaLevel(element) !== options.level)\n      return;\n    if (options.disabled !== void 0 && getAriaDisabled(element) !== options.disabled)\n      return;\n    if (!options.includeHidden) {\n      const isHidden = isElementHiddenForAria(element);\n      if (isHidden)\n        return;\n    }\n    if (options.name !== void 0) {\n      const accessibleName = normalizeWhiteSpace(getElementAccessibleName(element, !!options.includeHidden));\n      if (typeof options.name === "string")\n        options.name = normalizeWhiteSpace(options.name);\n      if (internal && !options.nameExact && options.nameOp === "=")\n        options.nameOp = "*=";\n      if (!matchesAttributePart(accessibleName, { name: "", jsonPath: [], op: options.nameOp || "=", value: options.name, caseSensitive: !!options.nameExact }))\n        return;\n    }\n    if (options.description !== void 0) {\n      const accessibleDescription = normalizeWhiteSpace(getElementAccessibleDescription(element, !!options.includeHidden));\n      if (typeof options.description === "string")\n        options.description = normalizeWhiteSpace(options.description);\n      if (internal && !options.descriptionExact && options.descriptionOp === "=")\n        options.descriptionOp = "*=";\n      if (!matchesAttributePart(accessibleDescription, { name: "", jsonPath: [], op: options.descriptionOp || "=", value: options.description, caseSensitive: !!options.descriptionExact }))\n        return;\n    }\n    result.push(element);\n  };\n  const query = (root) => {\n    const shadows = [];\n    if (root.shadowRoot)\n      shadows.push(root.shadowRoot);\n    for (const element of root.querySelectorAll("*")) {\n      match(element);\n      if (element.shadowRoot)\n        shadows.push(element.shadowRoot);\n    }\n    shadows.forEach(query);\n  };\n  query(scope);\n  return result;\n}\nfunction createRoleEngine(internal) {\n  return {\n    queryAll: (scope, selector) => {\n      const parsed = parseAttributeSelector(selector, true);\n      const role = parsed.name.toLowerCase();\n      if (!role)\n        throw new Error(`Role must not be empty`);\n      const options = validateAttributes(parsed.attributes, role);\n      beginAriaCaches();\n      try {\n        return queryRole(scope, options, internal);\n      } finally {\n        endAriaCaches();\n      }\n    }\n  };\n}\n\n// packages/injected/src/selectorEvaluator.ts\nvar SelectorEvaluatorImpl = class {\n  constructor() {\n    this._retainCacheCounter = 0;\n    this._cacheText = /* @__PURE__ */ new Map();\n    this._cacheQueryCSS = /* @__PURE__ */ new Map();\n    this._cacheMatches = /* @__PURE__ */ new Map();\n    this._cacheQuery = /* @__PURE__ */ new Map();\n    this._cacheMatchesSimple = /* @__PURE__ */ new Map();\n    this._cacheMatchesParents = /* @__PURE__ */ new Map();\n    this._cacheCallMatches = /* @__PURE__ */ new Map();\n    this._cacheCallQuery = /* @__PURE__ */ new Map();\n    this._cacheQuerySimple = /* @__PURE__ */ new Map();\n    this._engines = /* @__PURE__ */ new Map();\n    this._engines.set("not", notEngine);\n    this._engines.set("is", isEngine);\n    this._engines.set("where", isEngine);\n    this._engines.set("has", hasEngine);\n    this._engines.set("scope", scopeEngine);\n    this._engines.set("light", lightEngine);\n    this._engines.set("visible", visibleEngine);\n    this._engines.set("text", textEngine);\n    this._engines.set("text-is", textIsEngine);\n    this._engines.set("text-matches", textMatchesEngine);\n    this._engines.set("has-text", hasTextEngine);\n    this._engines.set("right-of", createLayoutEngine("right-of"));\n    this._engines.set("left-of", createLayoutEngine("left-of"));\n    this._engines.set("above", createLayoutEngine("above"));\n    this._engines.set("below", createLayoutEngine("below"));\n    this._engines.set("near", createLayoutEngine("near"));\n    this._engines.set("nth-match", nthMatchEngine);\n    const allNames = [...this._engines.keys()];\n    allNames.sort();\n    const parserNames = [...customCSSNames];\n    parserNames.sort();\n    if (allNames.join("|") !== parserNames.join("|"))\n      throw new Error(`Please keep customCSSNames in sync with evaluator engines: ${allNames.join("|")} vs ${parserNames.join("|")}`);\n  }\n  begin() {\n    ++this._retainCacheCounter;\n  }\n  end() {\n    --this._retainCacheCounter;\n    if (!this._retainCacheCounter) {\n      this._cacheQueryCSS.clear();\n      this._cacheMatches.clear();\n      this._cacheQuery.clear();\n      this._cacheMatchesSimple.clear();\n      this._cacheMatchesParents.clear();\n      this._cacheCallMatches.clear();\n      this._cacheCallQuery.clear();\n      this._cacheQuerySimple.clear();\n      this._cacheText.clear();\n    }\n  }\n  _cached(cache, main, rest, cb) {\n    if (!cache.has(main))\n      cache.set(main, []);\n    const entries = cache.get(main);\n    const entry = entries.find((e) => rest.every((value, index) => e.rest[index] === value));\n    if (entry)\n      return entry.result;\n    const result = cb();\n    entries.push({ rest, result });\n    return result;\n  }\n  _checkSelector(s) {\n    const wellFormed = typeof s === "object" && s && (Array.isArray(s) || "simples" in s && s.simples.length);\n    if (!wellFormed)\n      throw new Error(`Malformed selector "${s}"`);\n    return s;\n  }\n  matches(element, s, context) {\n    const selector = this._checkSelector(s);\n    this.begin();\n    try {\n      return this._cached(this._cacheMatches, element, [selector, context.scope, context.pierceShadow, context.originalScope], () => {\n        if (Array.isArray(selector))\n          return this._matchesEngine(isEngine, element, selector, context);\n        if (this._hasScopeClause(selector))\n          context = this._expandContextForScopeMatching(context);\n        if (!this._matchesSimple(element, selector.simples[selector.simples.length - 1].selector, context))\n          return false;\n        return this._matchesParents(element, selector, selector.simples.length - 2, context);\n      });\n    } finally {\n      this.end();\n    }\n  }\n  query(context, s) {\n    const selector = this._checkSelector(s);\n    this.begin();\n    try {\n      return this._cached(this._cacheQuery, selector, [context.scope, context.pierceShadow, context.originalScope], () => {\n        if (Array.isArray(selector))\n          return this._queryEngine(isEngine, context, selector);\n        if (this._hasScopeClause(selector))\n          context = this._expandContextForScopeMatching(context);\n        const previousScoreMap = this._scoreMap;\n        this._scoreMap = /* @__PURE__ */ new Map();\n        let elements = this._querySimple(context, selector.simples[selector.simples.length - 1].selector);\n        elements = elements.filter((element) => this._matchesParents(element, selector, selector.simples.length - 2, context));\n        if (this._scoreMap.size) {\n          elements.sort((a, b) => {\n            const aScore = this._scoreMap.get(a);\n            const bScore = this._scoreMap.get(b);\n            if (aScore === bScore)\n              return 0;\n            if (aScore === void 0)\n              return 1;\n            if (bScore === void 0)\n              return -1;\n            return aScore - bScore;\n          });\n        }\n        this._scoreMap = previousScoreMap;\n        return elements;\n      });\n    } finally {\n      this.end();\n    }\n  }\n  _markScore(element, score) {\n    if (this._scoreMap)\n      this._scoreMap.set(element, score);\n  }\n  _hasScopeClause(selector) {\n    return selector.simples.some((simple) => simple.selector.functions.some((f) => f.name === "scope"));\n  }\n  _expandContextForScopeMatching(context) {\n    if (context.scope.nodeType !== 1)\n      return context;\n    const scope = parentElementOrShadowHost(context.scope);\n    if (!scope)\n      return context;\n    return { ...context, scope, originalScope: context.originalScope || context.scope };\n  }\n  _matchesSimple(element, simple, context) {\n    return this._cached(this._cacheMatchesSimple, element, [simple, context.scope, context.pierceShadow, context.originalScope], () => {\n      if (element === context.scope)\n        return false;\n      if (simple.css && !this._matchesCSS(element, simple.css))\n        return false;\n      for (const func of simple.functions) {\n        if (!this._matchesEngine(this._getEngine(func.name), element, func.args, context))\n          return false;\n      }\n      return true;\n    });\n  }\n  _querySimple(context, simple) {\n    if (!simple.functions.length)\n      return this._queryCSS(context, simple.css || "*");\n    return this._cached(this._cacheQuerySimple, simple, [context.scope, context.pierceShadow, context.originalScope], () => {\n      let css = simple.css;\n      const funcs = simple.functions;\n      if (css === "*" && funcs.length)\n        css = void 0;\n      let elements;\n      let firstIndex = -1;\n      if (css !== void 0) {\n        elements = this._queryCSS(context, css);\n      } else {\n        firstIndex = funcs.findIndex((func) => this._getEngine(func.name).query !== void 0);\n        if (firstIndex === -1)\n          firstIndex = 0;\n        elements = this._queryEngine(this._getEngine(funcs[firstIndex].name), context, funcs[firstIndex].args);\n      }\n      for (let i = 0; i < funcs.length; i++) {\n        if (i === firstIndex)\n          continue;\n        const engine = this._getEngine(funcs[i].name);\n        if (engine.matches !== void 0)\n          elements = elements.filter((e) => this._matchesEngine(engine, e, funcs[i].args, context));\n      }\n      for (let i = 0; i < funcs.length; i++) {\n        if (i === firstIndex)\n          continue;\n        const engine = this._getEngine(funcs[i].name);\n        if (engine.matches === void 0)\n          elements = elements.filter((e) => this._matchesEngine(engine, e, funcs[i].args, context));\n      }\n      return elements;\n    });\n  }\n  _matchesParents(element, complex, index, context) {\n    if (index < 0)\n      return true;\n    return this._cached(this._cacheMatchesParents, element, [complex, index, context.scope, context.pierceShadow, context.originalScope], () => {\n      const { selector: simple, combinator } = complex.simples[index];\n      if (combinator === ">") {\n        const parent = parentElementOrShadowHostInContext(element, context);\n        if (!parent || !this._matchesSimple(parent, simple, context))\n          return false;\n        return this._matchesParents(parent, complex, index - 1, context);\n      }\n      if (combinator === "+") {\n        const previousSibling = previousSiblingInContext(element, context);\n        if (!previousSibling || !this._matchesSimple(previousSibling, simple, context))\n          return false;\n        return this._matchesParents(previousSibling, complex, index - 1, context);\n      }\n      if (combinator === "") {\n        let parent = parentElementOrShadowHostInContext(element, context);\n        while (parent) {\n          if (this._matchesSimple(parent, simple, context)) {\n            if (this._matchesParents(parent, complex, index - 1, context))\n              return true;\n            if (complex.simples[index - 1].combinator === "")\n              break;\n          }\n          parent = parentElementOrShadowHostInContext(parent, context);\n        }\n        return false;\n      }\n      if (combinator === "~") {\n        let previousSibling = previousSiblingInContext(element, context);\n        while (previousSibling) {\n          if (this._matchesSimple(previousSibling, simple, context)) {\n            if (this._matchesParents(previousSibling, complex, index - 1, context))\n              return true;\n            if (complex.simples[index - 1].combinator === "~")\n              break;\n          }\n          previousSibling = previousSiblingInContext(previousSibling, context);\n        }\n        return false;\n      }\n      if (combinator === ">=") {\n        let parent = element;\n        while (parent) {\n          if (this._matchesSimple(parent, simple, context)) {\n            if (this._matchesParents(parent, complex, index - 1, context))\n              return true;\n            if (complex.simples[index - 1].combinator === "")\n              break;\n          }\n          parent = parentElementOrShadowHostInContext(parent, context);\n        }\n        return false;\n      }\n      throw new Error(`Unsupported combinator "${combinator}"`);\n    });\n  }\n  _matchesEngine(engine, element, args, context) {\n    if (engine.matches)\n      return this._callMatches(engine, element, args, context);\n    if (engine.query)\n      return this._callQuery(engine, args, context).includes(element);\n    throw new Error(`Selector engine should implement "matches" or "query"`);\n  }\n  _queryEngine(engine, context, args) {\n    if (engine.query)\n      return this._callQuery(engine, args, context);\n    if (engine.matches)\n      return this._queryCSS(context, "*").filter((element) => this._callMatches(engine, element, args, context));\n    throw new Error(`Selector engine should implement "matches" or "query"`);\n  }\n  _callMatches(engine, element, args, context) {\n    return this._cached(this._cacheCallMatches, element, [engine, context.scope, context.pierceShadow, context.originalScope, ...args], () => {\n      return engine.matches(element, args, context, this);\n    });\n  }\n  _callQuery(engine, args, context) {\n    return this._cached(this._cacheCallQuery, engine, [context.scope, context.pierceShadow, context.originalScope, ...args], () => {\n      return engine.query(context, args, this);\n    });\n  }\n  _matchesCSS(element, css) {\n    return element.matches(css);\n  }\n  _queryCSS(context, css) {\n    return this._cached(this._cacheQueryCSS, css, [context.scope, context.pierceShadow, context.originalScope], () => {\n      let result = [];\n      function query(root) {\n        result = result.concat([...root.querySelectorAll(css)]);\n        if (!context.pierceShadow)\n          return;\n        if (root.shadowRoot)\n          query(root.shadowRoot);\n        for (const element of root.querySelectorAll("*")) {\n          if (element.shadowRoot)\n            query(element.shadowRoot);\n        }\n      }\n      query(context.scope);\n      return result;\n    });\n  }\n  _getEngine(name) {\n    const engine = this._engines.get(name);\n    if (!engine)\n      throw new Error(`Unknown selector engine "${name}"`);\n    return engine;\n  }\n};\nvar isEngine = {\n  matches(element, args, context, evaluator) {\n    if (args.length === 0)\n      throw new Error(`"is" engine expects non-empty selector list`);\n    return args.some((selector) => evaluator.matches(element, selector, context));\n  },\n  query(context, args, evaluator) {\n    if (args.length === 0)\n      throw new Error(`"is" engine expects non-empty selector list`);\n    let elements = [];\n    for (const arg of args)\n      elements = elements.concat(evaluator.query(context, arg));\n    return args.length === 1 ? elements : sortInDOMOrder(elements);\n  }\n};\nvar hasEngine = {\n  matches(element, args, context, evaluator) {\n    if (args.length === 0)\n      throw new Error(`"has" engine expects non-empty selector list`);\n    return evaluator.query({ ...context, scope: element }, args).length > 0;\n  }\n  // TODO: we can implement efficient "query" by matching "args" and returning\n  // all parents/descendants, just have to be careful with the ":scope" matching.\n};\nvar scopeEngine = {\n  matches(element, args, context, evaluator) {\n    if (args.length !== 0)\n      throw new Error(`"scope" engine expects no arguments`);\n    const actualScope = context.originalScope || context.scope;\n    if (actualScope.nodeType === 9)\n      return element === actualScope.documentElement;\n    return element === actualScope;\n  },\n  query(context, args, evaluator) {\n    if (args.length !== 0)\n      throw new Error(`"scope" engine expects no arguments`);\n    const actualScope = context.originalScope || context.scope;\n    if (actualScope.nodeType === 9) {\n      const root = actualScope.documentElement;\n      return root ? [root] : [];\n    }\n    if (actualScope.nodeType === 1)\n      return [actualScope];\n    return [];\n  }\n};\nvar notEngine = {\n  matches(element, args, context, evaluator) {\n    if (args.length === 0)\n      throw new Error(`"not" engine expects non-empty selector list`);\n    return !evaluator.matches(element, args, context);\n  }\n};\nvar lightEngine = {\n  query(context, args, evaluator) {\n    return evaluator.query({ ...context, pierceShadow: false }, args);\n  },\n  matches(element, args, context, evaluator) {\n    return evaluator.matches(element, args, { ...context, pierceShadow: false });\n  }\n};\nvar visibleEngine = {\n  matches(element, args, context, evaluator) {\n    if (args.length)\n      throw new Error(`"visible" engine expects no arguments`);\n    return isElementVisible(element);\n  }\n};\nvar textEngine = {\n  matches(element, args, context, evaluator) {\n    if (args.length !== 1 || typeof args[0] !== "string")\n      throw new Error(`"text" engine expects a single string`);\n    const text = normalizeWhiteSpace(args[0]).toLowerCase();\n    const matcher = (elementText2) => elementText2.normalized.toLowerCase().includes(text);\n    return elementMatchesText(evaluator._cacheText, element, matcher) === "self";\n  }\n};\nvar textIsEngine = {\n  matches(element, args, context, evaluator) {\n    if (args.length !== 1 || typeof args[0] !== "string")\n      throw new Error(`"text-is" engine expects a single string`);\n    const text = normalizeWhiteSpace(args[0]);\n    const matcher = (elementText2) => {\n      if (!text && !elementText2.immediate.length)\n        return true;\n      return elementText2.immediate.some((s) => normalizeWhiteSpace(s) === text);\n    };\n    return elementMatchesText(evaluator._cacheText, element, matcher) !== "none";\n  }\n};\nvar textMatchesEngine = {\n  matches(element, args, context, evaluator) {\n    if (args.length === 0 || typeof args[0] !== "string" || args.length > 2 || args.length === 2 && typeof args[1] !== "string")\n      throw new Error(`"text-matches" engine expects a regexp body and optional regexp flags`);\n    const re = new RegExp(args[0], args.length === 2 ? args[1] : void 0);\n    const matcher = (elementText2) => re.test(elementText2.full);\n    return elementMatchesText(evaluator._cacheText, element, matcher) === "self";\n  }\n};\nvar hasTextEngine = {\n  matches(element, args, context, evaluator) {\n    if (args.length !== 1 || typeof args[0] !== "string")\n      throw new Error(`"has-text" engine expects a single string`);\n    if (shouldSkipForTextMatching(element))\n      return false;\n    const text = normalizeWhiteSpace(args[0]).toLowerCase();\n    const matcher = (elementText2) => elementText2.normalized.toLowerCase().includes(text);\n    return matcher(elementText(evaluator._cacheText, element));\n  }\n};\nfunction createLayoutEngine(name) {\n  return {\n    matches(element, args, context, evaluator) {\n      const maxDistance = args.length && typeof args[args.length - 1] === "number" ? args[args.length - 1] : void 0;\n      const queryArgs = maxDistance === void 0 ? args : args.slice(0, args.length - 1);\n      if (args.length < 1 + (maxDistance === void 0 ? 0 : 1))\n        throw new Error(`"${name}" engine expects a selector list and optional maximum distance in pixels`);\n      const inner = evaluator.query(context, queryArgs);\n      const score = layoutSelectorScore(name, element, inner, maxDistance);\n      if (score === void 0)\n        return false;\n      evaluator._markScore(element, score);\n      return true;\n    }\n  };\n}\nvar nthMatchEngine = {\n  query(context, args, evaluator) {\n    let index = args[args.length - 1];\n    if (args.length < 2)\n      throw new Error(`"nth-match" engine expects non-empty selector list and an index argument`);\n    if (typeof index !== "number" || index < 1)\n      throw new Error(`"nth-match" engine expects a one-based index as the last argument`);\n    const elements = isEngine.query(context, args.slice(0, args.length - 1), evaluator);\n    index--;\n    return index < elements.length ? [elements[index]] : [];\n  }\n};\nfunction parentElementOrShadowHostInContext(element, context) {\n  if (element === context.scope)\n    return;\n  if (!context.pierceShadow)\n    return element.parentElement || void 0;\n  return parentElementOrShadowHost(element);\n}\nfunction previousSiblingInContext(element, context) {\n  if (element === context.scope)\n    return;\n  return element.previousElementSibling || void 0;\n}\nfunction sortInDOMOrder(elements) {\n  const elementToEntry = /* @__PURE__ */ new Map();\n  const roots = [];\n  const result = [];\n  function append(element) {\n    let entry = elementToEntry.get(element);\n    if (entry)\n      return entry;\n    const parent = parentElementOrShadowHost(element);\n    if (parent) {\n      const parentEntry = append(parent);\n      parentEntry.children.push(element);\n    } else {\n      roots.push(element);\n    }\n    entry = { children: [], taken: false };\n    elementToEntry.set(element, entry);\n    return entry;\n  }\n  for (const e of elements)\n    append(e).taken = true;\n  function visit(element) {\n    const entry = elementToEntry.get(element);\n    if (entry.taken)\n      result.push(element);\n    if (entry.children.length > 1) {\n      const set = new Set(entry.children);\n      entry.children = [];\n      let child = element.firstElementChild;\n      while (child && entry.children.length < set.size) {\n        if (set.has(child))\n          entry.children.push(child);\n        child = child.nextElementSibling;\n      }\n      child = element.shadowRoot ? element.shadowRoot.firstElementChild : null;\n      while (child && entry.children.length < set.size) {\n        if (set.has(child))\n          entry.children.push(child);\n        child = child.nextElementSibling;\n      }\n    }\n    entry.children.forEach(visit);\n  }\n  roots.forEach(visit);\n  return result;\n}\n\n// packages/injected/src/selectorGenerator.ts\nvar kTextScoreRange = 10;\nvar kExactPenalty = kTextScoreRange / 2;\nvar kTestIdScore = 1;\nvar kOtherTestIdScore = 2;\nvar kIframeByAttributeScore = 10;\nvar kBeginPenalizedScore = 50;\nvar kRoleWithNameScore = 100;\nvar kPlaceholderScore = 120;\nvar kLabelScore = 140;\nvar kAltTextScore = 160;\nvar kTextScore = 180;\nvar kTitleScore = 200;\nvar kTextScoreRegex = 250;\nvar kPlaceholderScoreExact = kPlaceholderScore + kExactPenalty;\nvar kLabelScoreExact = kLabelScore + kExactPenalty;\nvar kRoleWithNameScoreExact = kRoleWithNameScore + kExactPenalty;\nvar kAltTextScoreExact = kAltTextScore + kExactPenalty;\nvar kTextScoreExact = kTextScore + kExactPenalty;\nvar kTitleScoreExact = kTitleScore + kExactPenalty;\nvar kEndPenalizedScore = 300;\nvar kCSSIdScore = 500;\nvar kRoleWithoutNameScore = 510;\nvar kCSSInputTypeNameScore = 520;\nvar kCSSTagNameScore = 530;\nvar kNthScore = 1e4;\nvar kCSSFallbackScore = 1e7;\nvar kScoreThresholdForTextExpect = 1e3;\nfunction generateSelector(injectedScript, targetElement, options) {\n  var _a;\n  injectedScript._evaluator.begin();\n  const cache = { allowText: /* @__PURE__ */ new Map(), disallowText: /* @__PURE__ */ new Map() };\n  beginAriaCaches();\n  beginDOMCaches();\n  try {\n    let selectors = [];\n    if (options.forTextExpect) {\n      let targetTokens = cssFallback(injectedScript, targetElement.ownerDocument.documentElement, options);\n      for (let element = targetElement; element; element = parentElementOrShadowHost(element)) {\n        const tokens = generateSelectorFor(cache, injectedScript, element, { ...options, noText: true });\n        if (!tokens)\n          continue;\n        const score = combineScores(tokens);\n        if (score <= kScoreThresholdForTextExpect) {\n          targetTokens = tokens;\n          break;\n        }\n      }\n      selectors = [joinTokens(targetTokens)];\n    } else {\n      if (!targetElement.matches("input,textarea,select") && !targetElement.isContentEditable) {\n        const interactiveParent = closestCrossShadow(targetElement, "button,select,input,[role=button],[role=checkbox],[role=radio],a,[role=link]", options.root);\n        if (interactiveParent && isElementVisible(interactiveParent))\n          targetElement = interactiveParent;\n      }\n      if (options.multiple) {\n        const withText = generateSelectorFor(cache, injectedScript, targetElement, options);\n        const withoutText = generateSelectorFor(cache, injectedScript, targetElement, { ...options, noText: true });\n        let tokens = [withText, withoutText];\n        cache.allowText.clear();\n        cache.disallowText.clear();\n        if (withText && hasCSSIdToken(withText))\n          tokens.push(generateSelectorFor(cache, injectedScript, targetElement, { ...options, noCSSId: true }));\n        if (withoutText && hasCSSIdToken(withoutText))\n          tokens.push(generateSelectorFor(cache, injectedScript, targetElement, { ...options, noText: true, noCSSId: true }));\n        tokens = tokens.filter(Boolean);\n        if (!tokens.length) {\n          const css = cssFallback(injectedScript, targetElement, options);\n          tokens.push(css);\n          if (hasCSSIdToken(css))\n            tokens.push(cssFallback(injectedScript, targetElement, { ...options, noCSSId: true }));\n        }\n        selectors = [...new Set(tokens.map((t) => joinTokens(t)))];\n      } else {\n        const targetTokens = generateSelectorFor(cache, injectedScript, targetElement, options) || cssFallback(injectedScript, targetElement, options);\n        selectors = [joinTokens(targetTokens)];\n      }\n    }\n    const selector = selectors[0];\n    const parsedSelector = injectedScript.parseSelector(selector);\n    return {\n      selector,\n      selectors,\n      elements: injectedScript.querySelectorAll(parsedSelector, (_a = options.root) != null ? _a : targetElement.ownerDocument)\n    };\n  } finally {\n    endDOMCaches();\n    endAriaCaches();\n    injectedScript._evaluator.end();\n  }\n}\nfunction generateSelectorFor(cache, injectedScript, targetElement, options) {\n  var _a;\n  if (options.root && !isInsideScope(options.root, targetElement))\n    throw new Error(`Target element must belong to the root\'s subtree`);\n  if (targetElement === options.root)\n    return [{ engine: "css", selector: ":scope", score: 1 }];\n  if (targetElement.ownerDocument.documentElement === targetElement)\n    return [{ engine: "css", selector: "html", score: 1 }];\n  let result = null;\n  const updateResult = (candidate) => {\n    if (!result || combineScores(candidate) < combineScores(result))\n      result = candidate;\n  };\n  const candidates = [];\n  if (!options.noText) {\n    for (const candidate of buildTextCandidates(injectedScript, targetElement, !options.isRecursive))\n      candidates.push({ candidate, isTextCandidate: true });\n  }\n  for (const token of buildNoTextCandidates(injectedScript, targetElement, options)) {\n    if (options.omitInternalEngines && token.engine.startsWith("internal:"))\n      continue;\n    candidates.push({ candidate: [token], isTextCandidate: false });\n  }\n  candidates.sort((a, b) => combineScores(a.candidate) - combineScores(b.candidate));\n  for (const { candidate, isTextCandidate } of candidates) {\n    const elements = injectedScript.querySelectorAll(injectedScript.parseSelector(joinTokens(candidate)), (_a = options.root) != null ? _a : targetElement.ownerDocument);\n    if (!elements.includes(targetElement)) {\n      continue;\n    }\n    if (elements.length === 1) {\n      updateResult(candidate);\n      break;\n    }\n    const index = elements.indexOf(targetElement);\n    if (index > 5) {\n      continue;\n    }\n    updateResult([...candidate, { engine: "nth", selector: String(index), score: kNthScore }]);\n    if (options.isRecursive) {\n      continue;\n    }\n    for (let parent = parentElementOrShadowHost(targetElement); parent && parent !== options.root; parent = parentElementOrShadowHost(parent)) {\n      const filtered = elements.filter((e) => isInsideScope(parent, e) && e !== parent);\n      const newIndex = filtered.indexOf(targetElement);\n      if (filtered.length > 5 || newIndex === -1 || newIndex === index && filtered.length > 1) {\n        continue;\n      }\n      const inParent = filtered.length === 1 ? candidate : [...candidate, { engine: "nth", selector: String(newIndex), score: kNthScore }];\n      const idealSelectorForParent = { engine: "", selector: "", score: 1 };\n      if (result && combineScores([idealSelectorForParent, ...inParent]) >= combineScores(result)) {\n        continue;\n      }\n      const noText = !!options.noText || isTextCandidate;\n      const cacheMap = noText ? cache.disallowText : cache.allowText;\n      let parentTokens = cacheMap.get(parent);\n      if (parentTokens === void 0) {\n        parentTokens = generateSelectorFor(cache, injectedScript, parent, { ...options, isRecursive: true, noText }) || cssFallback(injectedScript, parent, options);\n        cacheMap.set(parent, parentTokens);\n      }\n      if (!parentTokens)\n        continue;\n      updateResult([...parentTokens, ...inParent]);\n    }\n  }\n  return result;\n}\nfunction buildNoTextCandidates(injectedScript, element, options) {\n  const candidates = [];\n  const testIdAttributeNames = splitTestIdAttributeNames(options.testIdAttributeName);\n  {\n    for (const attr of ["data-testid", "data-test-id", "data-test"]) {\n      if (!testIdAttributeNames.includes(attr) && element.getAttribute(attr))\n        candidates.push({ engine: "css", selector: `[${attr}=${quoteCSSAttributeValue(element.getAttribute(attr))}]`, score: kOtherTestIdScore });\n    }\n    if (!options.noCSSId) {\n      const idAttr = element.getAttribute("id");\n      if (idAttr && !isGuidLike(idAttr))\n        candidates.push({ engine: "css", selector: makeSelectorForId(idAttr), score: kCSSIdScore });\n    }\n    candidates.push({ engine: "css", selector: escapeNodeName(element), score: kCSSTagNameScore });\n  }\n  if (element.nodeName === "IFRAME") {\n    for (const attribute of ["name", "title"]) {\n      if (element.getAttribute(attribute))\n        candidates.push({ engine: "css", selector: `${escapeNodeName(element)}[${attribute}=${quoteCSSAttributeValue(element.getAttribute(attribute))}]`, score: kIframeByAttributeScore });\n    }\n    for (const testIdAttr of testIdAttributeNames) {\n      if (element.getAttribute(testIdAttr))\n        candidates.push({ engine: "css", selector: `[${testIdAttr}=${quoteCSSAttributeValue(element.getAttribute(testIdAttr))}]`, score: kTestIdScore });\n    }\n    penalizeScoreForLength([candidates]);\n    return candidates;\n  }\n  for (const testIdAttr of testIdAttributeNames) {\n    if (element.getAttribute(testIdAttr))\n      candidates.push({ engine: "internal:testid", selector: `[${testIdAttr}=${escapeForAttributeSelector(element.getAttribute(testIdAttr), true)}]`, score: kTestIdScore });\n  }\n  if (element.nodeName === "INPUT" || element.nodeName === "TEXTAREA") {\n    const input = element;\n    if (input.placeholder) {\n      candidates.push({ engine: "internal:attr", selector: `[placeholder=${escapeForAttributeSelector(input.placeholder, true)}]`, score: kPlaceholderScoreExact });\n      for (const alternative of suitableTextAlternatives(input.placeholder))\n        candidates.push({ engine: "internal:attr", selector: `[placeholder=${escapeForAttributeSelector(alternative.text, false)}]`, score: kPlaceholderScore - alternative.scoreBonus });\n    }\n  }\n  const labels = getElementLabels(injectedScript._evaluator._cacheText, element);\n  for (const label of labels) {\n    const labelText = label.normalized;\n    candidates.push({ engine: "internal:label", selector: escapeForTextSelector(labelText, true), score: kLabelScoreExact });\n    for (const alternative of suitableTextAlternatives(labelText))\n      candidates.push({ engine: "internal:label", selector: escapeForTextSelector(alternative.text, false), score: kLabelScore - alternative.scoreBonus });\n  }\n  const ariaRole = getAriaRole(element);\n  if (ariaRole && !["none", "presentation"].includes(ariaRole))\n    candidates.push({ engine: "internal:role", selector: ariaRole, score: kRoleWithoutNameScore });\n  if (element.getAttribute("name") && ["BUTTON", "FORM", "FIELDSET", "FRAME", "IFRAME", "INPUT", "KEYGEN", "OBJECT", "OUTPUT", "SELECT", "TEXTAREA", "MAP", "META", "PARAM"].includes(element.nodeName))\n    candidates.push({ engine: "css", selector: `${escapeNodeName(element)}[name=${quoteCSSAttributeValue(element.getAttribute("name"))}]`, score: kCSSInputTypeNameScore });\n  if (["INPUT", "TEXTAREA"].includes(element.nodeName) && element.getAttribute("type") !== "hidden") {\n    if (element.getAttribute("type"))\n      candidates.push({ engine: "css", selector: `${escapeNodeName(element)}[type=${quoteCSSAttributeValue(element.getAttribute("type"))}]`, score: kCSSInputTypeNameScore });\n  }\n  if (["INPUT", "TEXTAREA", "SELECT"].includes(element.nodeName) && element.getAttribute("type") !== "hidden")\n    candidates.push({ engine: "css", selector: escapeNodeName(element), score: kCSSInputTypeNameScore + 1 });\n  penalizeScoreForLength([candidates]);\n  return candidates;\n}\nfunction buildTextCandidates(injectedScript, element, isTargetNode) {\n  if (element.nodeName === "SELECT")\n    return [];\n  const candidates = [];\n  const title = element.getAttribute("title");\n  if (title) {\n    candidates.push([{ engine: "internal:attr", selector: `[title=${escapeForAttributeSelector(title, true)}]`, score: kTitleScoreExact }]);\n    for (const alternative of suitableTextAlternatives(title))\n      candidates.push([{ engine: "internal:attr", selector: `[title=${escapeForAttributeSelector(alternative.text, false)}]`, score: kTitleScore - alternative.scoreBonus }]);\n  }\n  const alt = element.getAttribute("alt");\n  if (alt && ["APPLET", "AREA", "IMG", "INPUT"].includes(element.nodeName)) {\n    candidates.push([{ engine: "internal:attr", selector: `[alt=${escapeForAttributeSelector(alt, true)}]`, score: kAltTextScoreExact }]);\n    for (const alternative of suitableTextAlternatives(alt))\n      candidates.push([{ engine: "internal:attr", selector: `[alt=${escapeForAttributeSelector(alternative.text, false)}]`, score: kAltTextScore - alternative.scoreBonus }]);\n  }\n  const text = elementText(injectedScript._evaluator._cacheText, element).normalized;\n  const textAlternatives = text ? suitableTextAlternatives(text) : [];\n  if (text) {\n    if (isTargetNode) {\n      if (text.length <= 80)\n        candidates.push([{ engine: "internal:text", selector: escapeForTextSelector(text, true), score: kTextScoreExact }]);\n      for (const alternative of textAlternatives)\n        candidates.push([{ engine: "internal:text", selector: escapeForTextSelector(alternative.text, false), score: kTextScore - alternative.scoreBonus }]);\n    }\n    const cssToken = { engine: "css", selector: escapeNodeName(element), score: kCSSTagNameScore };\n    for (const alternative of textAlternatives)\n      candidates.push([cssToken, { engine: "internal:has-text", selector: escapeForTextSelector(alternative.text, false), score: kTextScore - alternative.scoreBonus }]);\n    if (isTargetNode && text.length <= 80) {\n      const re = new RegExp("^" + escapeRegExp(text) + "$");\n      candidates.push([cssToken, { engine: "internal:has-text", selector: escapeForTextSelector(re, false), score: kTextScoreRegex }]);\n    }\n  }\n  const ariaRole = getAriaRole(element);\n  if (ariaRole && !["none", "presentation"].includes(ariaRole)) {\n    const ariaName = getElementAccessibleName(element, false);\n    if (ariaName && !ariaName.match(/^\\p{Co}+$/u)) {\n      const roleToken = { engine: "internal:role", selector: `${ariaRole}[name=${escapeForAttributeSelector(ariaName, true)}]`, score: kRoleWithNameScoreExact };\n      candidates.push([roleToken]);\n      for (const alternative of suitableTextAlternatives(ariaName))\n        candidates.push([{ engine: "internal:role", selector: `${ariaRole}[name=${escapeForAttributeSelector(alternative.text, false)}]`, score: kRoleWithNameScore - alternative.scoreBonus }]);\n      const ariaDescription = getElementAccessibleDescription(element, false);\n      if (ariaDescription) {\n        candidates.push([{ engine: "internal:role", selector: `${ariaRole}[name=${escapeForAttributeSelector(ariaName, true)}][description=${escapeForAttributeSelector(ariaDescription, true)}]`, score: kRoleWithNameScoreExact + 1 }]);\n        for (const alternative of suitableTextAlternatives(ariaName))\n          candidates.push([{ engine: "internal:role", selector: `${ariaRole}[name=${escapeForAttributeSelector(alternative.text, false)}][description=${escapeForAttributeSelector(ariaDescription, false)}]`, score: kRoleWithNameScore - alternative.scoreBonus + 1 }]);\n      }\n    } else {\n      const roleToken = { engine: "internal:role", selector: `${ariaRole}`, score: kRoleWithoutNameScore };\n      const ariaDescription = getElementAccessibleDescription(element, false);\n      if (ariaDescription)\n        candidates.push([{ engine: "internal:role", selector: `${ariaRole}[description=${escapeForAttributeSelector(ariaDescription, true)}]`, score: kRoleWithoutNameScore + 1 }]);\n      for (const alternative of textAlternatives)\n        candidates.push([roleToken, { engine: "internal:has-text", selector: escapeForTextSelector(alternative.text, false), score: kTextScore - alternative.scoreBonus }]);\n      if (isTargetNode && text.length <= 80) {\n        const re = new RegExp("^" + escapeRegExp(text) + "$");\n        candidates.push([roleToken, { engine: "internal:has-text", selector: escapeForTextSelector(re, false), score: kTextScoreRegex }]);\n      }\n    }\n  }\n  penalizeScoreForLength(candidates);\n  return candidates;\n}\nfunction makeSelectorForId(id) {\n  return /^[a-zA-Z][a-zA-Z0-9\\-\\_]+$/.test(id) ? "#" + id : `[id=${quoteCSSAttributeValue(id)}]`;\n}\nfunction hasCSSIdToken(tokens) {\n  return tokens.some((token) => token.engine === "css" && (token.selector.startsWith("#") || token.selector.startsWith(\'[id="\')));\n}\nfunction cssFallback(injectedScript, targetElement, options) {\n  var _a;\n  const root = (_a = options.root) != null ? _a : targetElement.ownerDocument;\n  const tokens = [];\n  function uniqueCSSSelector(prefix) {\n    const path = tokens.slice();\n    if (prefix)\n      path.unshift(prefix);\n    const selector = path.join(" > ");\n    const parsedSelector = injectedScript.parseSelector(selector);\n    const node = injectedScript.querySelector(parsedSelector, root, false);\n    return node === targetElement ? selector : void 0;\n  }\n  function makeStrict(selector) {\n    const token = { engine: "css", selector, score: kCSSFallbackScore };\n    const parsedSelector = injectedScript.parseSelector(selector);\n    const elements = injectedScript.querySelectorAll(parsedSelector, root);\n    if (elements.length === 1)\n      return [token];\n    const nth = { engine: "nth", selector: String(elements.indexOf(targetElement)), score: kNthScore };\n    return [token, nth];\n  }\n  for (let element = targetElement; element && element !== root; element = parentElementOrShadowHost(element)) {\n    let bestTokenForLevel = "";\n    if (element.id && !options.noCSSId) {\n      const token = makeSelectorForId(element.id);\n      const selector = uniqueCSSSelector(token);\n      if (selector)\n        return makeStrict(selector);\n      bestTokenForLevel = token;\n    }\n    const parent = element.parentNode;\n    const classes = [...element.classList].map(escapeClassName);\n    for (let i = 0; i < classes.length; ++i) {\n      const token = "." + classes.slice(0, i + 1).join(".");\n      const selector = uniqueCSSSelector(token);\n      if (selector)\n        return makeStrict(selector);\n      if (!bestTokenForLevel && parent) {\n        const sameClassSiblings = parent.querySelectorAll(token);\n        if (sameClassSiblings.length === 1)\n          bestTokenForLevel = token;\n      }\n    }\n    if (parent) {\n      const siblings = [...parent.children];\n      const nodeName = element.nodeName;\n      const sameTagSiblings = siblings.filter((sibling) => sibling.nodeName === nodeName);\n      const token = sameTagSiblings.indexOf(element) === 0 ? escapeNodeName(element) : `${escapeNodeName(element)}:nth-child(${1 + siblings.indexOf(element)})`;\n      const selector = uniqueCSSSelector(token);\n      if (selector)\n        return makeStrict(selector);\n      if (!bestTokenForLevel)\n        bestTokenForLevel = token;\n    } else if (!bestTokenForLevel) {\n      bestTokenForLevel = escapeNodeName(element);\n    }\n    tokens.unshift(bestTokenForLevel);\n  }\n  return makeStrict(uniqueCSSSelector());\n}\nfunction penalizeScoreForLength(groups) {\n  for (const group of groups) {\n    for (const token of group) {\n      if (token.score > kBeginPenalizedScore && token.score < kEndPenalizedScore)\n        token.score += Math.min(kTextScoreRange, token.selector.length / 10 | 0);\n    }\n  }\n}\nfunction joinTokens(tokens) {\n  const parts = [];\n  let lastEngine = "";\n  for (const { engine, selector } of tokens) {\n    if (parts.length && (lastEngine !== "css" || engine !== "css" || selector.startsWith(":nth-match(")))\n      parts.push(">>");\n    lastEngine = engine;\n    if (engine === "css")\n      parts.push(selector);\n    else\n      parts.push(`${engine}=${selector}`);\n  }\n  return parts.join(" ");\n}\nfunction combineScores(tokens) {\n  let score = 0;\n  for (let i = 0; i < tokens.length; i++)\n    score += tokens[i].score * (tokens.length - i);\n  return score;\n}\nfunction isGuidLike(id) {\n  let lastCharacterType;\n  let transitionCount = 0;\n  for (let i = 0; i < id.length; ++i) {\n    const c = id[i];\n    let characterType;\n    if (c === "-" || c === "_")\n      continue;\n    if (c >= "a" && c <= "z")\n      characterType = "lower";\n    else if (c >= "A" && c <= "Z")\n      characterType = "upper";\n    else if (c >= "0" && c <= "9")\n      characterType = "digit";\n    else\n      characterType = "other";\n    if (characterType === "lower" && lastCharacterType === "upper") {\n      lastCharacterType = characterType;\n      continue;\n    }\n    if (lastCharacterType && lastCharacterType !== characterType)\n      ++transitionCount;\n    lastCharacterType = characterType;\n  }\n  return transitionCount >= id.length / 4;\n}\nfunction trimWordBoundary(text, maxLength) {\n  if (text.length <= maxLength)\n    return text;\n  text = text.substring(0, maxLength);\n  const match = text.match(/^(.*)\\b(.+?)$/);\n  if (!match)\n    return "";\n  return match[1].trimEnd();\n}\nfunction suitableTextAlternatives(text) {\n  let result = [];\n  {\n    const match = text.match(/^([\\d.,]+)[^.,\\w]/);\n    const leadingNumberLength = match ? match[1].length : 0;\n    if (leadingNumberLength) {\n      const alt = trimWordBoundary(text.substring(leadingNumberLength).trimStart(), 80);\n      result.push({ text: alt, scoreBonus: alt.length <= 30 ? 2 : 1 });\n    }\n  }\n  {\n    const match = text.match(/[^.,\\w]([\\d.,]+)$/);\n    const trailingNumberLength = match ? match[1].length : 0;\n    if (trailingNumberLength) {\n      const alt = trimWordBoundary(text.substring(0, text.length - trailingNumberLength).trimEnd(), 80);\n      result.push({ text: alt, scoreBonus: alt.length <= 30 ? 2 : 1 });\n    }\n  }\n  if (text.length <= 30) {\n    result.push({ text, scoreBonus: 0 });\n  } else {\n    result.push({ text: trimWordBoundary(text, 80), scoreBonus: 0 });\n    result.push({ text: trimWordBoundary(text, 30), scoreBonus: 1 });\n  }\n  result = result.filter((r) => r.text);\n  if (!result.length)\n    result.push({ text: text.substring(0, 80), scoreBonus: 0 });\n  return result;\n}\nfunction escapeNodeName(node) {\n  return node.nodeName.toLocaleLowerCase().replace(/[:\\.]/g, (char) => "\\\\" + char);\n}\nfunction escapeClassName(className) {\n  let result = "";\n  for (let i = 0; i < className.length; i++)\n    result += cssEscapeCharacter(className, i);\n  return result;\n}\nfunction cssEscapeCharacter(s, i) {\n  const c = s.charCodeAt(i);\n  if (c === 0)\n    return "\\uFFFD";\n  if (c >= 1 && c <= 31 || c >= 48 && c <= 57 && (i === 0 || i === 1 && s.charCodeAt(0) === 45))\n    return "\\\\" + c.toString(16) + " ";\n  if (i === 0 && c === 45 && s.length === 1)\n    return "\\\\" + s.charAt(i);\n  if (c >= 128 || c === 45 || c === 95 || c >= 48 && c <= 57 || c >= 65 && c <= 90 || c >= 97 && c <= 122)\n    return s.charAt(i);\n  return "\\\\" + s.charAt(i);\n}\n\n// packages/injected/src/xpathSelectorEngine.ts\nvar XPathEngine = {\n  queryAll(root, selector) {\n    if (selector.startsWith("/") && root.nodeType !== Node.DOCUMENT_NODE)\n      selector = "." + selector;\n    const result = [];\n    const document = root.ownerDocument || root;\n    if (!document)\n      return result;\n    const it = document.evaluate(selector, root, null, XPathResult.ORDERED_NODE_ITERATOR_TYPE);\n    for (let node = it.iterateNext(); node; node = it.iterateNext()) {\n      if (node.nodeType === Node.ELEMENT_NODE)\n        result.push(node);\n    }\n    return result;\n  }\n};\n\n// packages/injected/src/consoleApi.ts\nvar selectorSymbol = Symbol("selector");\nselectorSymbol;\nvar _Locator = class _Locator {\n  constructor(injectedScript, selector, options) {\n    if (options == null ? void 0 : options.hasText)\n      selector += ` >> internal:has-text=${escapeForTextSelector(options.hasText, false)}`;\n    if (options == null ? void 0 : options.hasNotText)\n      selector += ` >> internal:has-not-text=${escapeForTextSelector(options.hasNotText, false)}`;\n    if (options == null ? void 0 : options.has)\n      selector += ` >> internal:has=` + JSON.stringify(options.has[selectorSymbol]);\n    if (options == null ? void 0 : options.hasNot)\n      selector += ` >> internal:has-not=` + JSON.stringify(options.hasNot[selectorSymbol]);\n    if ((options == null ? void 0 : options.visible) !== void 0)\n      selector += ` >> visible=${options.visible ? "true" : "false"}`;\n    this[selectorSymbol] = selector;\n    if (selector) {\n      const parsed = injectedScript.parseSelector(selector);\n      this.element = injectedScript.querySelector(parsed, injectedScript.document, false);\n      this.elements = injectedScript.querySelectorAll(parsed, injectedScript.document);\n    }\n    const selectorBase = selector;\n    const self = this;\n    self.locator = (selector2, options2) => {\n      return new _Locator(injectedScript, selectorBase ? selectorBase + " >> " + selector2 : selector2, options2);\n    };\n    self.getByTestId = (testId) => self.locator(getByTestIdSelector(injectedScript.testIdAttributeNameForStrictErrorAndConsoleCodegen(), testId));\n    self.getByAltText = (text, options2) => self.locator(getByAltTextSelector(text, options2));\n    self.getByLabel = (text, options2) => self.locator(getByLabelSelector(text, options2));\n    self.getByPlaceholder = (text, options2) => self.locator(getByPlaceholderSelector(text, options2));\n    self.getByText = (text, options2) => self.locator(getByTextSelector(text, options2));\n    self.getByTitle = (text, options2) => self.locator(getByTitleSelector(text, options2));\n    self.getByRole = (role, options2 = {}) => self.locator(getByRoleSelector(role, options2));\n    self.filter = (options2) => new _Locator(injectedScript, selector, options2);\n    self.first = () => self.locator("nth=0");\n    self.last = () => self.locator("nth=-1");\n    self.nth = (index) => self.locator(`nth=${index}`);\n    self.and = (locator) => new _Locator(injectedScript, selectorBase + ` >> internal:and=` + JSON.stringify(locator[selectorSymbol]));\n    self.or = (locator) => new _Locator(injectedScript, selectorBase + ` >> internal:or=` + JSON.stringify(locator[selectorSymbol]));\n  }\n};\nvar Locator = _Locator;\nvar ConsoleAPI = class {\n  constructor(injectedScript) {\n    this._injectedScript = injectedScript;\n  }\n  install() {\n    if (this._injectedScript.window.playwright)\n      return;\n    this._injectedScript.window.playwright = {\n      $: (selector, strict) => this._querySelector(selector, !!strict),\n      $$: (selector) => this._querySelectorAll(selector),\n      inspect: (selector) => this._inspect(selector),\n      selector: (element) => this._selector(element),\n      generateLocator: (element, language) => this._generateLocator(element, language),\n      ariaSnapshot: (element, options) => {\n        return this._injectedScript.ariaSnapshot(element || this._injectedScript.document.body, options || { mode: "default" });\n      },\n      resume: () => this._resume(),\n      ...new Locator(this._injectedScript, "")\n    };\n    delete this._injectedScript.window.playwright.filter;\n    delete this._injectedScript.window.playwright.first;\n    delete this._injectedScript.window.playwright.last;\n    delete this._injectedScript.window.playwright.nth;\n    delete this._injectedScript.window.playwright.and;\n    delete this._injectedScript.window.playwright.or;\n  }\n  _querySelector(selector, strict) {\n    if (typeof selector !== "string")\n      throw new Error(`Usage: playwright.query(\'Playwright >> selector\').`);\n    const parsed = this._injectedScript.parseSelector(selector);\n    return this._injectedScript.querySelector(parsed, this._injectedScript.document, strict);\n  }\n  _querySelectorAll(selector) {\n    if (typeof selector !== "string")\n      throw new Error(`Usage: playwright.$$(\'Playwright >> selector\').`);\n    const parsed = this._injectedScript.parseSelector(selector);\n    return this._injectedScript.querySelectorAll(parsed, this._injectedScript.document);\n  }\n  _inspect(selector) {\n    if (typeof selector !== "string")\n      throw new Error(`Usage: playwright.inspect(\'Playwright >> selector\').`);\n    this._injectedScript.window.inspect(this._querySelector(selector, false));\n  }\n  _selector(element) {\n    if (!(element instanceof Element))\n      throw new Error(`Usage: playwright.selector(element).`);\n    return this._injectedScript.generateSelectorSimple(element);\n  }\n  _generateLocator(element, language) {\n    if (!(element instanceof Element))\n      throw new Error(`Usage: playwright.locator(element).`);\n    const selector = this._injectedScript.generateSelectorSimple(element);\n    return asLocator(language || "javascript", selector);\n  }\n  _resume() {\n    if (!this._injectedScript.window.__pw_resume)\n      return false;\n    this._injectedScript.window.__pw_resume().catch(() => {\n    });\n  }\n};\n\n// packages/isomorphic/utilityScriptSerializers.ts\nfunction isRegExp2(obj) {\n  try {\n    return obj instanceof RegExp || Object.prototype.toString.call(obj) === "[object RegExp]";\n  } catch (error) {\n    return false;\n  }\n}\nfunction isDate(obj) {\n  try {\n    return obj instanceof Date || Object.prototype.toString.call(obj) === "[object Date]";\n  } catch (error) {\n    return false;\n  }\n}\nfunction isURL(obj) {\n  try {\n    return obj instanceof URL || Object.prototype.toString.call(obj) === "[object URL]";\n  } catch (error) {\n    return false;\n  }\n}\nfunction isError(obj) {\n  var _a;\n  try {\n    return obj instanceof Error || obj && ((_a = Object.getPrototypeOf(obj)) == null ? void 0 : _a.name) === "Error";\n  } catch (error) {\n    return false;\n  }\n}\nfunction isTypedArray(obj, constructor) {\n  try {\n    return obj instanceof constructor || Object.prototype.toString.call(obj) === `[object ${constructor.name}]`;\n  } catch (error) {\n    return false;\n  }\n}\nfunction isArrayBuffer(obj) {\n  try {\n    return obj instanceof ArrayBuffer || Object.prototype.toString.call(obj) === "[object ArrayBuffer]";\n  } catch (error) {\n    return false;\n  }\n}\nvar typedArrayConstructors = {\n  i8: Int8Array,\n  ui8: Uint8Array,\n  ui8c: Uint8ClampedArray,\n  i16: Int16Array,\n  ui16: Uint16Array,\n  i32: Int32Array,\n  ui32: Uint32Array,\n  // TODO: add Float16Array once it\'s in baseline\n  f32: Float32Array,\n  f64: Float64Array,\n  bi64: BigInt64Array,\n  bui64: BigUint64Array\n};\nfunction typedArrayToBase64(array) {\n  if ("toBase64" in array)\n    return array.toBase64();\n  const binary = Array.from(new Uint8Array(array.buffer, array.byteOffset, array.byteLength)).map((b) => String.fromCharCode(b)).join("");\n  return btoa(binary);\n}\nfunction base64ToTypedArray(base64, TypedArrayConstructor) {\n  const binary = atob(base64);\n  const bytes = new Uint8Array(binary.length);\n  for (let i = 0; i < binary.length; i++)\n    bytes[i] = binary.charCodeAt(i);\n  return new TypedArrayConstructor(bytes.buffer);\n}\nfunction parseEvaluationResultValue(value, handles = [], refs = /* @__PURE__ */ new Map()) {\n  if (Object.is(value, void 0))\n    return void 0;\n  if (typeof value === "object" && value) {\n    if ("ref" in value)\n      return refs.get(value.ref);\n    if ("v" in value) {\n      if (value.v === "undefined")\n        return void 0;\n      if (value.v === "null")\n        return null;\n      if (value.v === "NaN")\n        return NaN;\n      if (value.v === "Infinity")\n        return Infinity;\n      if (value.v === "-Infinity")\n        return -Infinity;\n      if (value.v === "-0")\n        return -0;\n      return void 0;\n    }\n    if ("d" in value) {\n      return new Date(value.d);\n    }\n    if ("u" in value)\n      return new URL(value.u);\n    if ("bi" in value)\n      return BigInt(value.bi);\n    if ("e" in value) {\n      const error = new Error(value.e.m);\n      error.name = value.e.n;\n      error.stack = value.e.s;\n      return error;\n    }\n    if ("r" in value)\n      return new RegExp(value.r.p, value.r.f);\n    if ("a" in value) {\n      const result = [];\n      refs.set(value.id, result);\n      for (const a of value.a)\n        result.push(parseEvaluationResultValue(a, handles, refs));\n      return result;\n    }\n    if ("o" in value) {\n      const result = {};\n      refs.set(value.id, result);\n      for (const { k, v } of value.o) {\n        if (k === "__proto__")\n          continue;\n        result[k] = parseEvaluationResultValue(v, handles, refs);\n      }\n      return result;\n    }\n    if ("h" in value)\n      return handles[value.h];\n    if ("ta" in value)\n      return base64ToTypedArray(value.ta.b, typedArrayConstructors[value.ta.k]);\n    if ("ab" in value)\n      return base64ToTypedArray(value.ab.b, Uint8Array).buffer;\n  }\n  return value;\n}\nfunction serializeAsCallArgument(value, handleSerializer) {\n  return serialize(value, handleSerializer, { visited: /* @__PURE__ */ new Map(), lastId: 0 });\n}\nfunction serialize(value, handleSerializer, visitorInfo) {\n  if (value && typeof value === "object") {\n    if (typeof globalThis.Window === "function" && value instanceof globalThis.Window)\n      return "ref: <Window>";\n    if (typeof globalThis.Document === "function" && value instanceof globalThis.Document)\n      return "ref: <Document>";\n    if (typeof globalThis.Node === "function" && value instanceof globalThis.Node)\n      return "ref: <Node>";\n  }\n  return innerSerialize(value, handleSerializer, visitorInfo);\n}\nfunction innerSerialize(value, handleSerializer, visitorInfo) {\n  var _a;\n  const result = handleSerializer(value);\n  if ("fallThrough" in result)\n    value = result.fallThrough;\n  else\n    return result;\n  if (typeof value === "symbol")\n    return { v: "undefined" };\n  if (Object.is(value, void 0))\n    return { v: "undefined" };\n  if (Object.is(value, null))\n    return { v: "null" };\n  if (Object.is(value, NaN))\n    return { v: "NaN" };\n  if (Object.is(value, Infinity))\n    return { v: "Infinity" };\n  if (Object.is(value, -Infinity))\n    return { v: "-Infinity" };\n  if (Object.is(value, -0))\n    return { v: "-0" };\n  if (typeof value === "boolean")\n    return value;\n  if (typeof value === "number")\n    return value;\n  if (typeof value === "string")\n    return value;\n  if (typeof value === "bigint")\n    return { bi: value.toString() };\n  if (isError(value)) {\n    let stack;\n    if ((_a = value.stack) == null ? void 0 : _a.startsWith(value.name + ": " + value.message)) {\n      stack = value.stack;\n    } else {\n      stack = `${value.name}: ${value.message}\n${value.stack}`;\n    }\n    return { e: { n: value.name, m: value.message, s: stack } };\n  }\n  if (isDate(value))\n    return { d: value.toJSON() };\n  if (isURL(value))\n    return { u: value.toJSON() };\n  if (isRegExp2(value))\n    return { r: { p: value.source, f: value.flags } };\n  for (const [k, ctor] of Object.entries(typedArrayConstructors)) {\n    if (isTypedArray(value, ctor))\n      return { ta: { b: typedArrayToBase64(value), k } };\n  }\n  if (isArrayBuffer(value))\n    return { ab: { b: typedArrayToBase64(new Uint8Array(value)) } };\n  const id = visitorInfo.visited.get(value);\n  if (id)\n    return { ref: id };\n  if (Array.isArray(value)) {\n    const a = [];\n    const id2 = ++visitorInfo.lastId;\n    visitorInfo.visited.set(value, id2);\n    for (let i = 0; i < value.length; ++i)\n      a.push(serialize(value[i], handleSerializer, visitorInfo));\n    return { a, id: id2 };\n  }\n  if (typeof value === "object") {\n    const o = [];\n    const id2 = ++visitorInfo.lastId;\n    visitorInfo.visited.set(value, id2);\n    for (const name of Object.keys(value)) {\n      let item;\n      try {\n        item = value[name];\n      } catch (e) {\n        continue;\n      }\n      if (name === "toJSON" && typeof item === "function")\n        o.push({ k: name, v: { o: [], id: 0 } });\n      else\n        o.push({ k: name, v: serialize(item, handleSerializer, visitorInfo) });\n    }\n    let jsonWrapper;\n    try {\n      if (o.length === 0 && value.toJSON && typeof value.toJSON === "function")\n        jsonWrapper = { value: value.toJSON() };\n    } catch (e) {\n    }\n    if (jsonWrapper)\n      return innerSerialize(jsonWrapper.value, handleSerializer, visitorInfo);\n    return { o, id: id2 };\n  }\n}\n\n// packages/injected/src/utilityScript.ts\nvar UtilityScript = class {\n  constructor(global, isUnderTest) {\n    var _a, _b, _c, _d, _e, _f, _g, _h;\n    this.global = global;\n    this.isUnderTest = isUnderTest;\n    if (global.__pwClock) {\n      this.builtins = global.__pwClock.builtins;\n    } else {\n      this.builtins = {\n        setTimeout: (_a = global.setTimeout) == null ? void 0 : _a.bind(global),\n        clearTimeout: (_b = global.clearTimeout) == null ? void 0 : _b.bind(global),\n        setInterval: (_c = global.setInterval) == null ? void 0 : _c.bind(global),\n        clearInterval: (_d = global.clearInterval) == null ? void 0 : _d.bind(global),\n        requestAnimationFrame: (_e = global.requestAnimationFrame) == null ? void 0 : _e.bind(global),\n        cancelAnimationFrame: (_f = global.cancelAnimationFrame) == null ? void 0 : _f.bind(global),\n        requestIdleCallback: (_g = global.requestIdleCallback) == null ? void 0 : _g.bind(global),\n        cancelIdleCallback: (_h = global.cancelIdleCallback) == null ? void 0 : _h.bind(global),\n        performance: global.performance,\n        Intl: global.Intl,\n        Date: global.Date,\n        AbortSignal: global.AbortSignal\n      };\n    }\n    if (this.isUnderTest)\n      global.builtins = this.builtins;\n  }\n  evaluate(isFunction, returnByValue, expression, argCount, ...argsAndHandles) {\n    const args = argsAndHandles.slice(0, argCount);\n    const handles = argsAndHandles.slice(argCount);\n    const parameters = [];\n    for (let i = 0; i < args.length; i++)\n      parameters[i] = parseEvaluationResultValue(args[i], handles);\n    let result = this.global.eval(expression);\n    if (isFunction === true) {\n      result = result(...parameters);\n    } else if (isFunction === false) {\n      result = result;\n    } else {\n      if (typeof result === "function")\n        result = result(...parameters);\n    }\n    return returnByValue ? this._promiseAwareJsonValueNoThrow(result) : result;\n  }\n  jsonValue(returnByValue, value) {\n    if (value === void 0)\n      return void 0;\n    return serializeAsCallArgument(value, (value2) => ({ fallThrough: value2 }));\n  }\n  _promiseAwareJsonValueNoThrow(value) {\n    const safeJson = (value2) => {\n      try {\n        return this.jsonValue(true, value2);\n      } catch (e) {\n        return void 0;\n      }\n    };\n    if (value && typeof value === "object" && typeof value.then === "function") {\n      return (async () => {\n        const promiseValue = await value;\n        return safeJson(promiseValue);\n      })();\n    }\n    return safeJson(value);\n  }\n};\n\n// packages/injected/src/injectedScript.ts\nvar InjectedScript = class {\n  constructor(window, options) {\n    this._testIdAttributeNameForStrictErrorAndConsoleCodegen = "data-testid";\n    this._lastAriaSnapshotForTrack = /* @__PURE__ */ new Map();\n    // Recorder must use any external dependencies through InjectedScript.\n    // Otherwise it will end up with a copy of all modules it uses, and any\n    // module-level globals will be duplicated, which leads to subtle bugs.\n    this.utils = {\n      asLocator,\n      cacheNormalizedWhitespaces,\n      elementText,\n      getAriaRole,\n      getElementAccessibleDescription,\n      getElementAccessibleName,\n      isElementVisible,\n      isInsideScope,\n      normalizeWhiteSpace,\n      parseAriaSnapshot,\n      generateAriaTree,\n      findNewElement,\n      // Builtins protect injected code from clock emulation.\n      builtins: null\n    };\n    this.window = window;\n    this.document = window.document;\n    this.isUnderTest = options.isUnderTest;\n    this.utils.builtins = new UtilityScript(window, options.isUnderTest).builtins;\n    this._sdkLanguage = options.sdkLanguage;\n    this._testIdAttributeNameForStrictErrorAndConsoleCodegen = options.testIdAttributeName;\n    this._evaluator = new SelectorEvaluatorImpl();\n    this.consoleApi = new ConsoleAPI(this);\n    this.onGlobalListenersRemoved = /* @__PURE__ */ new Set();\n    this._autoClosingTags = /* @__PURE__ */ new Set(["AREA", "BASE", "BR", "COL", "COMMAND", "EMBED", "HR", "IMG", "INPUT", "KEYGEN", "LINK", "MENUITEM", "META", "PARAM", "SOURCE", "TRACK", "WBR"]);\n    this._booleanAttributes = /* @__PURE__ */ new Set(["checked", "selected", "disabled", "readonly", "multiple"]);\n    this._eventTypes = /* @__PURE__ */ new Map([\n      ["auxclick", "mouse"],\n      ["click", "mouse"],\n      ["dblclick", "mouse"],\n      ["mousedown", "mouse"],\n      ["mouseeenter", "mouse"],\n      ["mouseleave", "mouse"],\n      ["mousemove", "mouse"],\n      ["mouseout", "mouse"],\n      ["mouseover", "mouse"],\n      ["mouseup", "mouse"],\n      ["mouseleave", "mouse"],\n      ["mousewheel", "mouse"],\n      ["keydown", "keyboard"],\n      ["keyup", "keyboard"],\n      ["keypress", "keyboard"],\n      ["textInput", "keyboard"],\n      ["touchstart", "touch"],\n      ["touchmove", "touch"],\n      ["touchend", "touch"],\n      ["touchcancel", "touch"],\n      ["pointerover", "pointer"],\n      ["pointerout", "pointer"],\n      ["pointerenter", "pointer"],\n      ["pointerleave", "pointer"],\n      ["pointerdown", "pointer"],\n      ["pointerup", "pointer"],\n      ["pointermove", "pointer"],\n      ["pointercancel", "pointer"],\n      ["gotpointercapture", "pointer"],\n      ["lostpointercapture", "pointer"],\n      ["focus", "focus"],\n      ["blur", "focus"],\n      ["drag", "drag"],\n      ["dragstart", "drag"],\n      ["dragend", "drag"],\n      ["dragover", "drag"],\n      ["dragenter", "drag"],\n      ["dragleave", "drag"],\n      ["dragexit", "drag"],\n      ["drop", "drag"],\n      ["wheel", "wheel"],\n      ["deviceorientation", "deviceorientation"],\n      ["deviceorientationabsolute", "deviceorientation"],\n      ["devicemotion", "devicemotion"]\n    ]);\n    this._hoverHitTargetInterceptorEvents = /* @__PURE__ */ new Set(["mousemove"]);\n    this._tapHitTargetInterceptorEvents = /* @__PURE__ */ new Set(["pointerdown", "pointerup", "touchstart", "touchend", "touchcancel"]);\n    this._mouseHitTargetInterceptorEvents = /* @__PURE__ */ new Set(["mousedown", "mouseup", "pointerdown", "pointerup", "click", "auxclick", "dblclick", "contextmenu"]);\n    this._allHitTargetInterceptorEvents = /* @__PURE__ */ new Set([...this._hoverHitTargetInterceptorEvents, ...this._tapHitTargetInterceptorEvents, ...this._mouseHitTargetInterceptorEvents]);\n    this._engines = /* @__PURE__ */ new Map();\n    this._engines.set("xpath", XPathEngine);\n    this._engines.set("xpath:light", XPathEngine);\n    this._engines.set("role", createRoleEngine(false));\n    this._engines.set("text", this._createTextEngine(true, false));\n    this._engines.set("text:light", this._createTextEngine(false, false));\n    this._engines.set("id", this._createAttributeEngine("id", true));\n    this._engines.set("id:light", this._createAttributeEngine("id", false));\n    this._engines.set("data-testid", this._createAttributeEngine("data-testid", true));\n    this._engines.set("data-testid:light", this._createAttributeEngine("data-testid", false));\n    this._engines.set("data-test-id", this._createAttributeEngine("data-test-id", true));\n    this._engines.set("data-test-id:light", this._createAttributeEngine("data-test-id", false));\n    this._engines.set("data-test", this._createAttributeEngine("data-test", true));\n    this._engines.set("data-test:light", this._createAttributeEngine("data-test", false));\n    this._engines.set("css", this._createCSSEngine());\n    this._engines.set("nth", { queryAll: () => [] });\n    this._engines.set("visible", this._createVisibleEngine());\n    this._engines.set("internal:control", this._createControlEngine());\n    this._engines.set("internal:has", this._createHasEngine());\n    this._engines.set("internal:has-not", this._createHasNotEngine());\n    this._engines.set("internal:and", { queryAll: () => [] });\n    this._engines.set("internal:or", { queryAll: () => [] });\n    this._engines.set("internal:chain", this._createInternalChainEngine());\n    this._engines.set("internal:label", this._createInternalLabelEngine());\n    this._engines.set("internal:text", this._createTextEngine(true, true));\n    this._engines.set("internal:has-text", this._createInternalHasTextEngine());\n    this._engines.set("internal:has-not-text", this._createInternalHasNotTextEngine());\n    this._engines.set("internal:attr", this._createNamedAttributeEngine());\n    this._engines.set("internal:testid", this._createTestIdEngine());\n    this._engines.set("internal:role", createRoleEngine(true));\n    this._engines.set("internal:describe", this._createDescribeEngine());\n    this._engines.set("aria-ref", this._createAriaRefEngine());\n    for (const { name, source } of options.customEngines)\n      this._engines.set(name, this.eval(source));\n    this._stableRafCount = options.stableRafCount;\n    this._browserName = options.browserName;\n    this._shouldPrependErrorPrefix = !!options.shouldPrependErrorPrefix;\n    this._isUtilityWorld = !!options.isUtilityWorld;\n    setGlobalOptions({ browserNameForWorkarounds: options.browserName });\n    this._setupGlobalListenersRemovalDetection();\n    this._setupHitTargetInterceptors();\n    if (this.isUnderTest)\n      this.window.__injectedScript = this;\n  }\n  eval(expression) {\n    return this.window.eval(expression);\n  }\n  testIdAttributeNameForStrictErrorAndConsoleCodegen() {\n    return this._testIdAttributeNameForStrictErrorAndConsoleCodegen;\n  }\n  parseSelector(selector) {\n    const result = parseSelector(selector);\n    visitAllSelectorParts(result, (part) => {\n      if (!this._engines.has(part.name))\n        throw this.createStacklessError(`Unknown engine "${part.name}" while parsing selector ${selector}`);\n    });\n    return result;\n  }\n  generateSelector(targetElement, options) {\n    return generateSelector(this, targetElement, options);\n  }\n  generateSelectorSimple(targetElement, options) {\n    return generateSelector(this, targetElement, { ...options, testIdAttributeName: this._testIdAttributeNameForStrictErrorAndConsoleCodegen }).selector;\n  }\n  querySelector(selector, root, strict) {\n    const result = this.querySelectorAll(selector, root);\n    if (strict && result.length > 1)\n      throw this.strictModeViolationError(selector, result);\n    this.checkDeprecatedSelectorUsage(selector, result);\n    return result[0];\n  }\n  _queryNth(elements, part) {\n    const list = [...elements];\n    let nth = +part.body;\n    if (nth === -1)\n      nth = list.length - 1;\n    return new Set(list.slice(nth, nth + 1));\n  }\n  _queryLayoutSelector(elements, part, originalRoot) {\n    const name = part.name;\n    const body = part.body;\n    const result = [];\n    const inner = this.querySelectorAll(body.parsed, originalRoot);\n    for (const element of elements) {\n      const score = layoutSelectorScore(name, element, inner, body.distance);\n      if (score !== void 0)\n        result.push({ element, score });\n    }\n    result.sort((a, b) => a.score - b.score);\n    return new Set(result.map((r) => r.element));\n  }\n  ariaSnapshot(node, options) {\n    return this.incrementalAriaSnapshot(node, options).full;\n  }\n  incrementalAriaSnapshot(node, options) {\n    if (node.nodeType !== Node.ELEMENT_NODE)\n      throw this.createStacklessError("Can only capture aria snapshot of Element nodes.");\n    const ariaSnapshot = generateAriaTree(node, options);\n    const rendered = renderAriaTree(ariaSnapshot, options);\n    let incremental;\n    if (options.track) {\n      const previousSnapshot = this._lastAriaSnapshotForTrack.get(options.track);\n      if (previousSnapshot)\n        incremental = renderAriaTree(ariaSnapshot, options, previousSnapshot).text;\n      this._lastAriaSnapshotForTrack.set(options.track, ariaSnapshot);\n    }\n    this._lastAriaSnapshotForQuery = ariaSnapshot;\n    return { full: rendered.text, incremental, iframeRefs: ariaSnapshot.iframeRefs, iframeDepths: rendered.iframeDepths };\n  }\n  ariaSnapshotForRecorder() {\n    const tree = generateAriaTree(this.document.body, { mode: "ai" });\n    const { text: ariaSnapshot } = renderAriaTree(tree, { mode: "ai" });\n    return { ariaSnapshot, refs: tree.refs };\n  }\n  getAllElementsMatchingExpectAriaTemplate(document, template) {\n    return getAllElementsMatchingExpectAriaTemplate(document.documentElement, template);\n  }\n  querySelectorAll(selector, root) {\n    if (selector.capture !== void 0) {\n      if (selector.parts.some((part) => part.name === "nth"))\n        throw this.createStacklessError(`Can\'t query n-th element in a request with the capture.`);\n      const withHas = { parts: selector.parts.slice(0, selector.capture + 1) };\n      if (selector.capture < selector.parts.length - 1) {\n        const parsed = { parts: selector.parts.slice(selector.capture + 1) };\n        const has = { name: "internal:has", body: { parsed }, source: stringifySelector(parsed) };\n        withHas.parts.push(has);\n      }\n      return this.querySelectorAll(withHas, root);\n    }\n    if (!root["querySelectorAll"])\n      throw this.createStacklessError("Node is not queryable.");\n    if (selector.capture !== void 0) {\n      throw this.createStacklessError("Internal error: there should not be a capture in the selector.");\n    }\n    if (root.nodeType === 11 && selector.parts.length === 1 && selector.parts[0].name === "css" && selector.parts[0].source === ":scope")\n      return [root];\n    this._evaluator.begin();\n    try {\n      let roots = /* @__PURE__ */ new Set([root]);\n      for (const part of selector.parts) {\n        if (part.name === "nth") {\n          roots = this._queryNth(roots, part);\n        } else if (part.name === "internal:and") {\n          const andElements = this.querySelectorAll(part.body.parsed, root);\n          roots = new Set(andElements.filter((e) => roots.has(e)));\n        } else if (part.name === "internal:or") {\n          const orElements = this.querySelectorAll(part.body.parsed, root);\n          roots = new Set(sortInDOMOrder(/* @__PURE__ */ new Set([...roots, ...orElements])));\n        } else if (kLayoutSelectorNames.includes(part.name)) {\n          roots = this._queryLayoutSelector(roots, part, root);\n        } else {\n          const next = /* @__PURE__ */ new Set();\n          for (const root2 of roots) {\n            const all = this._queryEngineAll(part, root2);\n            for (const one of all)\n              next.add(one);\n          }\n          roots = next;\n        }\n      }\n      return [...roots];\n    } finally {\n      this._evaluator.end();\n    }\n  }\n  _queryEngineAll(part, root) {\n    const result = this._engines.get(part.name).queryAll(root, part.body);\n    for (const element of result) {\n      if (!("nodeName" in element))\n        throw this.createStacklessError(`Expected a Node but got ${Object.prototype.toString.call(element)}`);\n    }\n    return result;\n  }\n  _createAttributeEngine(attribute, shadow) {\n    const toCSS = (selector) => {\n      const css = `[${attribute}=${JSON.stringify(selector)}]`;\n      return [{ simples: [{ selector: { css, functions: [] }, combinator: "" }] }];\n    };\n    return {\n      queryAll: (root, selector) => {\n        return this._evaluator.query({ scope: root, pierceShadow: shadow }, toCSS(selector));\n      }\n    };\n  }\n  _createCSSEngine() {\n    return {\n      queryAll: (root, body) => {\n        return this._evaluator.query({ scope: root, pierceShadow: true }, body);\n      }\n    };\n  }\n  _createTextEngine(shadow, internal) {\n    const queryAll = (root, selector) => {\n      const { matcher, kind } = createTextMatcher(selector, internal);\n      const result = [];\n      let lastDidNotMatchSelf = null;\n      const appendElement = (element) => {\n        if (kind === "lax" && lastDidNotMatchSelf && lastDidNotMatchSelf.contains(element))\n          return false;\n        const matches = elementMatchesText(this._evaluator._cacheText, element, matcher);\n        if (matches === "none")\n          lastDidNotMatchSelf = element;\n        if (matches === "self" || matches === "selfAndChildren" && kind === "strict" && !internal)\n          result.push(element);\n      };\n      if (root.nodeType === Node.ELEMENT_NODE)\n        appendElement(root);\n      const elements = this._evaluator._queryCSS({ scope: root, pierceShadow: shadow }, "*");\n      for (const element of elements)\n        appendElement(element);\n      return result;\n    };\n    return { queryAll };\n  }\n  _createInternalHasTextEngine() {\n    return {\n      queryAll: (root, selector) => {\n        if (root.nodeType !== 1)\n          return [];\n        const element = root;\n        const text = elementText(this._evaluator._cacheText, element);\n        const { matcher } = createTextMatcher(selector, true);\n        return matcher(text) ? [element] : [];\n      }\n    };\n  }\n  _createInternalHasNotTextEngine() {\n    return {\n      queryAll: (root, selector) => {\n        if (root.nodeType !== 1)\n          return [];\n        const element = root;\n        const text = elementText(this._evaluator._cacheText, element);\n        const { matcher } = createTextMatcher(selector, true);\n        return matcher(text) ? [] : [element];\n      }\n    };\n  }\n  _createInternalLabelEngine() {\n    return {\n      queryAll: (root, selector) => {\n        const { matcher } = createTextMatcher(selector, true);\n        const allElements = this._evaluator._queryCSS({ scope: root, pierceShadow: true }, "*");\n        return allElements.filter((element) => {\n          return getElementLabels(this._evaluator._cacheText, element).some((label) => matcher(label));\n        });\n      }\n    };\n  }\n  _createNamedAttributeEngine() {\n    const queryAll = (root, selector) => {\n      const parsed = parseAttributeSelector(selector, true);\n      if (parsed.name || parsed.attributes.length !== 1)\n        throw new Error("Malformed attribute selector: " + selector);\n      const { name } = parsed.attributes[0];\n      const matcher = createAttributeMatcher(parsed.attributes[0]);\n      const elements = this._evaluator._queryCSS({ scope: root, pierceShadow: true }, `[${name}]`);\n      return elements.filter((e) => matcher(e.getAttribute(name)));\n    };\n    return { queryAll };\n  }\n  _createTestIdEngine() {\n    const queryAll = (root, selector) => {\n      const parsed = parseAttributeSelector(selector, true);\n      if (parsed.name || parsed.attributes.length !== 1)\n        throw new Error("Malformed test id selector: " + selector);\n      const names = splitTestIdAttributeNames(parsed.attributes[0].name);\n      const matcher = createAttributeMatcher(parsed.attributes[0]);\n      const cssQuery = names.map((n) => `[${n}]`).join(",");\n      const elements = this._evaluator._queryCSS({ scope: root, pierceShadow: true }, cssQuery);\n      return elements.filter((e) => names.some((n) => {\n        const actual = e.getAttribute(n);\n        return actual !== null && matcher(actual);\n      }));\n    };\n    return { queryAll };\n  }\n  _createDescribeEngine() {\n    const queryAll = (root) => {\n      if (root.nodeType !== 1)\n        return [];\n      return [root];\n    };\n    return { queryAll };\n  }\n  _createControlEngine() {\n    return {\n      queryAll(root, body) {\n        if (body === "enter-frame")\n          return [];\n        if (body === "return-empty")\n          return [];\n        if (body === "component") {\n          if (root.nodeType !== 1)\n            return [];\n          return [root.childElementCount === 1 ? root.firstElementChild : root];\n        }\n        throw new Error(`Internal error, unknown internal:control selector ${body}`);\n      }\n    };\n  }\n  _createHasEngine() {\n    const queryAll = (root, body) => {\n      if (root.nodeType !== 1)\n        return [];\n      const has = !!this.querySelector(body.parsed, root, false);\n      return has ? [root] : [];\n    };\n    return { queryAll };\n  }\n  _createHasNotEngine() {\n    const queryAll = (root, body) => {\n      if (root.nodeType !== 1)\n        return [];\n      const has = !!this.querySelector(body.parsed, root, false);\n      return has ? [] : [root];\n    };\n    return { queryAll };\n  }\n  _createVisibleEngine() {\n    const queryAll = (root, body) => {\n      if (root.nodeType !== 1)\n        return [];\n      const visible = body === "true";\n      return isElementVisible(root) === visible ? [root] : [];\n    };\n    return { queryAll };\n  }\n  _createInternalChainEngine() {\n    const queryAll = (root, body) => {\n      return this.querySelectorAll(body.parsed, root);\n    };\n    return { queryAll };\n  }\n  extend(source, params) {\n    const constrFunction = this.window.eval(`\n    (() => {\n      const module = {};\n      ${source}\n      return module.exports.default();\n    })()`);\n    return new constrFunction(this, params);\n  }\n  async viewportRatio(element) {\n    return await new Promise((resolve) => {\n      const observer = new IntersectionObserver((entries) => {\n        resolve(entries[0].intersectionRatio);\n        observer.disconnect();\n      });\n      observer.observe(element);\n      this.utils.builtins.requestAnimationFrame(() => {\n      });\n    });\n  }\n  getElementBorderWidth(node) {\n    if (node.nodeType !== Node.ELEMENT_NODE || !node.ownerDocument || !node.ownerDocument.defaultView)\n      return { left: 0, top: 0 };\n    const style = node.ownerDocument.defaultView.getComputedStyle(node);\n    return { left: parseInt(style.borderLeftWidth || "", 10), top: parseInt(style.borderTopWidth || "", 10) };\n  }\n  describeIFrameStyle(iframe) {\n    if (!iframe.ownerDocument || !iframe.ownerDocument.defaultView)\n      return "error:notconnected";\n    const defaultView = iframe.ownerDocument.defaultView;\n    for (let e = iframe; e; e = parentElementOrShadowHost(e)) {\n      if (defaultView.getComputedStyle(e).transform !== "none")\n        return "transformed";\n    }\n    const iframeStyle = defaultView.getComputedStyle(iframe);\n    return {\n      left: parseInt(iframeStyle.borderLeftWidth || "", 10) + parseInt(iframeStyle.paddingLeft || "", 10),\n      top: parseInt(iframeStyle.borderTopWidth || "", 10) + parseInt(iframeStyle.paddingTop || "", 10)\n    };\n  }\n  retarget(node, behavior) {\n    let element = node.nodeType === Node.ELEMENT_NODE ? node : node.parentElement;\n    if (!element)\n      return null;\n    if (behavior === "none")\n      return element;\n    if (!element.matches("input, textarea, select") && !element.isContentEditable) {\n      if (behavior === "button-link")\n        element = element.closest("button, [role=button], a, [role=link]") || element;\n      else\n        element = element.closest("button, [role=button], [role=checkbox], [role=radio]") || element;\n    }\n    if (behavior === "follow-label") {\n      if (!element.matches("a, input, textarea, button, select, [role=link], [role=button], [role=checkbox], [role=radio]") && !element.isContentEditable) {\n        const enclosingLabel = element.closest("label");\n        if (enclosingLabel && enclosingLabel.control)\n          element = enclosingLabel.control;\n      }\n    }\n    return element;\n  }\n  async checkElementStates(node, states) {\n    if (states.includes("stable")) {\n      const stableResult = await this._checkElementIsStable(node);\n      if (stableResult === false)\n        return { missingState: "stable" };\n      if (stableResult === "error:notconnected")\n        return "error:notconnected";\n    }\n    for (const state of states) {\n      if (state !== "stable") {\n        const result = this.elementState(node, state);\n        if (result.received === "error:notconnected")\n          return "error:notconnected";\n        if (!result.matches)\n          return { missingState: state };\n      }\n    }\n  }\n  async _checkElementIsStable(node) {\n    const continuePolling = Symbol("continuePolling");\n    let lastRect;\n    let stableRafCounter = 0;\n    let lastTime = 0;\n    const check = () => {\n      const element = this.retarget(node, "no-follow-label");\n      if (!element)\n        return "error:notconnected";\n      const time = this.utils.builtins.performance.now();\n      if (this._stableRafCount > 1 && time - lastTime < 15)\n        return continuePolling;\n      lastTime = time;\n      const clientRect = element.getBoundingClientRect();\n      const rect = { x: clientRect.top, y: clientRect.left, width: clientRect.width, height: clientRect.height };\n      if (lastRect) {\n        const samePosition = rect.x === lastRect.x && rect.y === lastRect.y && rect.width === lastRect.width && rect.height === lastRect.height;\n        if (!samePosition)\n          return false;\n        if (++stableRafCounter >= this._stableRafCount)\n          return true;\n      }\n      lastRect = rect;\n      return continuePolling;\n    };\n    let fulfill;\n    let reject;\n    const result = new Promise((f, r) => {\n      fulfill = f;\n      reject = r;\n    });\n    const raf = () => {\n      try {\n        const success = check();\n        if (success !== continuePolling)\n          fulfill(success);\n        else\n          this.utils.builtins.requestAnimationFrame(raf);\n      } catch (e) {\n        reject(e);\n      }\n    };\n    this.utils.builtins.requestAnimationFrame(raf);\n    return result;\n  }\n  _createAriaRefEngine() {\n    const queryAll = (root, selector) => {\n      var _a, _b;\n      const result = (_b = (_a = this._lastAriaSnapshotForQuery) == null ? void 0 : _a.elements) == null ? void 0 : _b.get(selector);\n      return result && result.isConnected ? [result] : [];\n    };\n    return { queryAll };\n  }\n  elementState(node, state) {\n    const element = this.retarget(node, ["visible", "hidden"].includes(state) ? "none" : "follow-label");\n    if (!element || !element.isConnected) {\n      if (state === "hidden")\n        return { matches: true, received: "hidden" };\n      return { matches: false, received: "error:notconnected" };\n    }\n    if (state === "visible" || state === "hidden") {\n      const visible = isElementVisible(element);\n      return {\n        matches: state === "visible" ? visible : !visible,\n        received: visible ? "visible" : "hidden"\n      };\n    }\n    if (state === "disabled" || state === "enabled") {\n      const disabled = getAriaDisabled(element);\n      return {\n        matches: state === "disabled" ? disabled : !disabled,\n        received: disabled ? "disabled" : "enabled"\n      };\n    }\n    if (state === "editable") {\n      const disabled = getAriaDisabled(element);\n      const readonly = getReadonly(element);\n      if (readonly === "error")\n        throw this.createStacklessError("Element is not an <input>, <textarea>, <select> or [contenteditable] and does not have a role allowing [aria-readonly]");\n      return {\n        matches: !disabled && !readonly,\n        received: disabled ? "disabled" : readonly ? "readOnly" : "editable"\n      };\n    }\n    if (state === "checked" || state === "unchecked") {\n      const need = state === "checked";\n      const checked = getCheckedWithoutMixed(element);\n      if (checked === "error")\n        throw this.createStacklessError("Not a checkbox or radio button");\n      const isRadio = element.nodeName === "INPUT" && element.type === "radio";\n      return {\n        matches: need === checked,\n        received: checked ? "checked" : "unchecked",\n        isRadio\n      };\n    }\n    if (state === "indeterminate") {\n      const checked = getCheckedAllowMixed(element);\n      if (checked === "error")\n        throw this.createStacklessError("Not a checkbox or radio button");\n      return {\n        matches: checked === "mixed",\n        received: checked === true ? "checked" : checked === false ? "unchecked" : "mixed"\n      };\n    }\n    throw this.createStacklessError(`Unexpected element state "${state}"`);\n  }\n  selectOptions(node, optionsToSelect) {\n    const element = this.retarget(node, "follow-label");\n    if (!element)\n      return "error:notconnected";\n    if (element.nodeName.toLowerCase() !== "select")\n      throw this.createStacklessError("Element is not a <select> element");\n    const select = element;\n    const options = [...select.options];\n    const selectedOptions = [];\n    let remainingOptionsToSelect = optionsToSelect.slice();\n    for (let index = 0; index < options.length; index++) {\n      const option = options[index];\n      const normalizedOptionLabel = normalizeWhiteSpace(option.label);\n      const filter = (optionToSelect) => {\n        if (optionToSelect instanceof Node)\n          return option === optionToSelect;\n        const matchesLabel = (label) => label === option.label || normalizeWhiteSpace(label) === normalizedOptionLabel;\n        let matches = true;\n        if (optionToSelect.valueOrLabel !== void 0)\n          matches = matches && (optionToSelect.valueOrLabel === option.value || matchesLabel(optionToSelect.valueOrLabel));\n        if (optionToSelect.value !== void 0)\n          matches = matches && optionToSelect.value === option.value;\n        if (optionToSelect.label !== void 0)\n          matches = matches && matchesLabel(optionToSelect.label);\n        if (optionToSelect.index !== void 0)\n          matches = matches && optionToSelect.index === index;\n        return matches;\n      };\n      if (!remainingOptionsToSelect.some(filter))\n        continue;\n      if (!this.elementState(option, "enabled").matches)\n        return "error:optionnotenabled";\n      selectedOptions.push(option);\n      if (select.multiple) {\n        remainingOptionsToSelect = remainingOptionsToSelect.filter((o) => !filter(o));\n      } else {\n        remainingOptionsToSelect = [];\n        break;\n      }\n    }\n    if (remainingOptionsToSelect.length)\n      return "error:optionsnotfound";\n    select.value = void 0;\n    selectedOptions.forEach((option) => option.selected = true);\n    select.dispatchEvent(new Event("input", { bubbles: true, composed: true }));\n    select.dispatchEvent(new Event("change", { bubbles: true }));\n    return selectedOptions.map((option) => option.value);\n  }\n  fill(node, value) {\n    const element = this.retarget(node, "follow-label");\n    if (!element)\n      return "error:notconnected";\n    if (element.nodeName.toLowerCase() === "input") {\n      const input = element;\n      const type = input.type.toLowerCase();\n      const kInputTypesToSetValue = /* @__PURE__ */ new Set(["color", "date", "time", "datetime-local", "month", "range", "week"]);\n      const kInputTypesToTypeInto = /* @__PURE__ */ new Set(["", "email", "number", "password", "search", "tel", "text", "url"]);\n      if (!kInputTypesToTypeInto.has(type) && !kInputTypesToSetValue.has(type))\n        throw this.createStacklessError(`Input of type "${type}" cannot be filled`);\n      if (type === "number") {\n        value = value.trim();\n        if (isNaN(Number(value)))\n          throw this.createStacklessError("Cannot type text into input[type=number]");\n      }\n      if (type === "color")\n        value = value.toLowerCase();\n      if (kInputTypesToSetValue.has(type)) {\n        value = value.trim();\n        input.focus();\n        input.value = value;\n        if (input.value !== value)\n          throw this.createStacklessError("Malformed value");\n        element.dispatchEvent(new Event("input", { bubbles: true, composed: true }));\n        element.dispatchEvent(new Event("change", { bubbles: true }));\n        return "done";\n      }\n    } else if (element.nodeName.toLowerCase() === "textarea") {\n    } else if (!element.isContentEditable) {\n      throw this.createStacklessError("Element is not an <input>, <textarea> or [contenteditable] element");\n    }\n    this.selectText(element);\n    return "needsinput";\n  }\n  selectText(node) {\n    const element = this.retarget(node, "follow-label");\n    if (!element)\n      return "error:notconnected";\n    if (element.nodeName.toLowerCase() === "input") {\n      const input = element;\n      input.select();\n      input.focus();\n      return "done";\n    }\n    if (element.nodeName.toLowerCase() === "textarea") {\n      const textarea = element;\n      textarea.selectionStart = 0;\n      textarea.selectionEnd = textarea.value.length;\n      textarea.focus();\n      return "done";\n    }\n    element.focus();\n    const range = element.ownerDocument.createRange();\n    range.selectNodeContents(element);\n    const selection = element.ownerDocument.defaultView.getSelection();\n    if (selection) {\n      selection.removeAllRanges();\n      selection.addRange(range);\n    }\n    return "done";\n  }\n  _activelyFocused(node) {\n    const activeElement = node.getRootNode().activeElement;\n    const isFocused = activeElement === node && !!node.ownerDocument && node.ownerDocument.hasFocus();\n    return { activeElement, isFocused };\n  }\n  focusNode(node, resetSelectionIfNotFocused) {\n    if (!node.isConnected)\n      return "error:notconnected";\n    if (node.nodeType !== Node.ELEMENT_NODE)\n      throw this.createStacklessError("Node is not an element");\n    const { activeElement, isFocused: wasFocused } = this._activelyFocused(node);\n    if (node.isContentEditable && !wasFocused && activeElement && activeElement.blur) {\n      activeElement.blur();\n    }\n    node.focus();\n    node.focus();\n    if (resetSelectionIfNotFocused && !wasFocused && node.nodeName.toLowerCase() === "input") {\n      try {\n        const input = node;\n        input.setSelectionRange(0, 0);\n      } catch (e) {\n      }\n    }\n    return "done";\n  }\n  blurNode(node) {\n    if (!node.isConnected)\n      return "error:notconnected";\n    if (node.nodeType !== Node.ELEMENT_NODE)\n      throw this.createStacklessError("Node is not an element");\n    node.blur();\n    return "done";\n  }\n  setInputFiles(node, payloads) {\n    if (node.nodeType !== Node.ELEMENT_NODE)\n      return "Node is not of type HTMLElement";\n    const element = node;\n    if (element.nodeName !== "INPUT")\n      return "Not an <input> element";\n    const input = element;\n    const type = (input.getAttribute("type") || "").toLowerCase();\n    if (type !== "file")\n      return "Not an input[type=file] element";\n    const files = payloads.map((file) => {\n      const bytes = Uint8Array.from(atob(file.buffer), (c) => c.charCodeAt(0));\n      return new File([bytes], file.name, { type: file.mimeType, lastModified: file.lastModifiedMs });\n    });\n    const dt = new DataTransfer();\n    for (const file of files)\n      dt.items.add(file);\n    input.files = dt.files;\n    input.dispatchEvent(new Event("input", { bubbles: true, composed: true }));\n    input.dispatchEvent(new Event("change", { bubbles: true }));\n  }\n  expectHitTarget(hitPoint, targetElement) {\n    var _a;\n    const roots = [];\n    let parentElement = targetElement;\n    while (parentElement) {\n      const root = enclosingShadowRootOrDocument(parentElement);\n      if (!root)\n        break;\n      roots.push(root);\n      if (root.nodeType === 9)\n        break;\n      parentElement = root.host;\n    }\n    let hitElement;\n    for (let index = roots.length - 1; index >= 0; index--) {\n      const root = roots[index];\n      const elements = root.elementsFromPoint(hitPoint.x, hitPoint.y);\n      const singleElement = root.elementFromPoint(hitPoint.x, hitPoint.y);\n      if (singleElement && elements[0] && parentElementOrShadowHost(singleElement) === elements[0]) {\n        const style = this.window.getComputedStyle(singleElement);\n        if ((style == null ? void 0 : style.display) === "contents") {\n          elements.unshift(singleElement);\n        }\n      }\n      if (elements[0] && elements[0].shadowRoot === root && elements[1] === singleElement) {\n        elements.shift();\n      }\n      const innerElement = elements[0];\n      if (!innerElement)\n        break;\n      hitElement = innerElement;\n      if (index && innerElement !== roots[index - 1].host)\n        break;\n    }\n    const hitParents = [];\n    while (hitElement && hitElement !== targetElement) {\n      hitParents.push(hitElement);\n      hitElement = (_a = hitElement.assignedSlot) != null ? _a : parentElementOrShadowHost(hitElement);\n    }\n    if (hitElement === targetElement)\n      return "done";\n    const hitTargetDescription = this.previewNode(hitParents[0] || this.document.documentElement);\n    let rootHitTargetDescription;\n    let element = targetElement;\n    while (element) {\n      const index = hitParents.indexOf(element);\n      if (index !== -1) {\n        if (index > 1)\n          rootHitTargetDescription = this.previewNode(hitParents[index - 1]);\n        break;\n      }\n      element = parentElementOrShadowHost(element);\n    }\n    if (rootHitTargetDescription)\n      return { hitTargetDescription: `${hitTargetDescription} from ${rootHitTargetDescription} subtree` };\n    return { hitTargetDescription };\n  }\n  // Life of a pointer action, for example click.\n  //\n  // 0. Retry items 1 and 2 while action fails due to navigation or element being detached.\n  //   1. Resolve selector to an element.\n  //   2. Retry the following steps until the element is detached or frame navigates away.\n  //     2a. Wait for the element to be stable (not moving), visible and enabled.\n  //     2b. Scroll element into view. Scrolling alternates between:\n  //         - Built-in protocol scrolling.\n  //         - Anchoring to the top/left, bottom/right and center/center.\n  //         This is to scroll elements from under sticky headers/footers.\n  //     2c. Click point is calculated, either based on explicitly specified position,\n  //         or some visible point of the element based on protocol content quads.\n  //     2d. Click point relative to page viewport is converted relative to the target iframe\n  //         for the next hit-point check.\n  //     2e. (injected) Hit target at the click point must be a descendant of the target element.\n  //         This prevents mis-clicking in edge cases like <iframe> overlaying the target.\n  //     2f. (injected) Events specific for click (or some other action type) are intercepted on\n  //         the Window with capture:true. See 2i for details.\n  //         Note: this step is skipped for drag&drop (see inline comments for the reason).\n  //     2g. Necessary keyboard modifiers are pressed.\n  //     2h. Click event is issued (mousemove + mousedown + mouseup).\n  //     2i. (injected) For each event, we check that hit target at the event point\n  //         is a descendant of the target element.\n  //         This guarantees no race between issuing the event and handling it in the page,\n  //         for example due to layout shift.\n  //         When hit target check fails, we block all future events in the page.\n  //     2j. Keyboard modifiers are restored.\n  //     2k. (injected) Event interceptor is removed.\n  //     2l. All navigations triggered between 2g-2k are awaited to be either committed or canceled.\n  //     2m. If failed, wait for increasing amount of time before the next retry.\n  setupHitTargetInterceptor(node, action, hitPoint, blockAllEvents) {\n    const element = this.retarget(node, "button-link");\n    if (!element || !element.isConnected)\n      return "error:notconnected";\n    if (hitPoint) {\n      const preliminaryResult = this.expectHitTarget(hitPoint, element);\n      if (preliminaryResult !== "done")\n        return preliminaryResult.hitTargetDescription;\n    }\n    if (action === "drag")\n      return { stop: () => "done" };\n    const events = {\n      "hover": this._hoverHitTargetInterceptorEvents,\n      "tap": this._tapHitTargetInterceptorEvents,\n      "mouse": this._mouseHitTargetInterceptorEvents\n    }[action];\n    let result;\n    const listener = (event) => {\n      if (!events.has(event.type))\n        return;\n      if (!event.isTrusted && !event.__pwTrustedSynthetic)\n        return;\n      const point = !!this.window.TouchEvent && event instanceof this.window.TouchEvent ? event.touches[0] : event;\n      if (result === void 0 && point)\n        result = this.expectHitTarget({ x: point.clientX, y: point.clientY }, element);\n      if (blockAllEvents || result !== "done" && result !== void 0) {\n        event.preventDefault();\n        event.stopPropagation();\n        event.stopImmediatePropagation();\n      }\n    };\n    const stop = () => {\n      if (this._hitTargetInterceptor === listener)\n        this._hitTargetInterceptor = void 0;\n      return result || "done";\n    };\n    this._hitTargetInterceptor = listener;\n    return { stop };\n  }\n  dispatchEvent(node, type, eventInitObj) {\n    var _a, _b, _c, _d, _e;\n    let event;\n    const eventInit = { bubbles: true, cancelable: true, composed: true, ...eventInitObj };\n    switch (this._eventTypes.get(type)) {\n      case "mouse":\n        event = new MouseEvent(type, eventInit);\n        break;\n      case "keyboard":\n        event = new KeyboardEvent(type, eventInit);\n        break;\n      case "touch": {\n        if (this._browserName === "webkit") {\n          const createTouch = (t) => {\n            var _a2, _b2, _c2;\n            if (t instanceof Touch)\n              return t;\n            let pageX = t.pageX;\n            if (pageX === void 0 && t.clientX !== void 0)\n              pageX = t.clientX + (((_a2 = this.document.scrollingElement) == null ? void 0 : _a2.scrollLeft) || 0);\n            let pageY = t.pageY;\n            if (pageY === void 0 && t.clientY !== void 0)\n              pageY = t.clientY + (((_b2 = this.document.scrollingElement) == null ? void 0 : _b2.scrollTop) || 0);\n            return this.document.createTouch(this.window, (_c2 = t.target) != null ? _c2 : node, t.identifier, pageX, pageY, t.screenX, t.screenY, t.radiusX, t.radiusY, t.rotationAngle, t.force);\n          };\n          const createTouchList = (touches) => {\n            if (touches instanceof TouchList || !touches)\n              return touches;\n            return this.document.createTouchList(...touches.map(createTouch));\n          };\n          (_a = eventInit.target) != null ? _a : eventInit.target = node;\n          eventInit.touches = createTouchList(eventInit.touches);\n          eventInit.targetTouches = createTouchList(eventInit.targetTouches);\n          eventInit.changedTouches = createTouchList(eventInit.changedTouches);\n          event = new TouchEvent(type, eventInit);\n        } else {\n          (_b = eventInit.target) != null ? _b : eventInit.target = node;\n          eventInit.touches = (_c = eventInit.touches) == null ? void 0 : _c.map((t) => {\n            var _a2;\n            return t instanceof Touch ? t : new Touch({ ...t, target: (_a2 = t.target) != null ? _a2 : node });\n          });\n          eventInit.targetTouches = (_d = eventInit.targetTouches) == null ? void 0 : _d.map((t) => {\n            var _a2;\n            return t instanceof Touch ? t : new Touch({ ...t, target: (_a2 = t.target) != null ? _a2 : node });\n          });\n          eventInit.changedTouches = (_e = eventInit.changedTouches) == null ? void 0 : _e.map((t) => {\n            var _a2;\n            return t instanceof Touch ? t : new Touch({ ...t, target: (_a2 = t.target) != null ? _a2 : node });\n          });\n          event = new TouchEvent(type, eventInit);\n        }\n        break;\n      }\n      case "pointer":\n        event = new PointerEvent(type, eventInit);\n        break;\n      case "focus":\n        event = new FocusEvent(type, eventInit);\n        break;\n      case "drag":\n        event = new DragEvent(type, eventInit);\n        break;\n      case "wheel":\n        event = new WheelEvent(type, eventInit);\n        break;\n      case "deviceorientation":\n        try {\n          event = new DeviceOrientationEvent(type, eventInit);\n        } catch {\n          const { bubbles, cancelable, alpha, beta, gamma, absolute } = eventInit;\n          event = this.document.createEvent("DeviceOrientationEvent");\n          event.initDeviceOrientationEvent(type, bubbles, cancelable, alpha, beta, gamma, absolute);\n        }\n        break;\n      case "devicemotion":\n        try {\n          event = new DeviceMotionEvent(type, eventInit);\n        } catch {\n          const { bubbles, cancelable, acceleration, accelerationIncludingGravity, rotationRate, interval } = eventInit;\n          event = this.document.createEvent("DeviceMotionEvent");\n          event.initDeviceMotionEvent(type, bubbles, cancelable, acceleration, accelerationIncludingGravity, rotationRate, interval);\n        }\n        break;\n      default:\n        event = new Event(type, eventInit);\n        break;\n    }\n    node.dispatchEvent(event);\n  }\n  previewNode(node) {\n    if (node.nodeType === Node.TEXT_NODE)\n      return oneLine(`#text=${node.nodeValue || ""}`);\n    if (node.nodeType !== Node.ELEMENT_NODE)\n      return oneLine(`<${node.nodeName.toLowerCase()} />`);\n    const element = node;\n    const attrs = [];\n    for (let i = 0; i < element.attributes.length; i++) {\n      const { name, value } = element.attributes[i];\n      if (name === "style")\n        continue;\n      if (!value && this._booleanAttributes.has(name))\n        attrs.push(` ${name}`);\n      else\n        attrs.push(` ${name}="${value}"`);\n    }\n    attrs.sort((a, b) => a.length - b.length);\n    const attrText = trimStringWithEllipsis(attrs.join(""), 500);\n    if (this._autoClosingTags.has(element.nodeName))\n      return oneLine(`<${element.nodeName.toLowerCase()}${attrText}/>`);\n    const children = element.childNodes;\n    let onlyText = false;\n    if (children.length <= 5) {\n      onlyText = true;\n      for (let i = 0; i < children.length; i++)\n        onlyText = onlyText && children[i].nodeType === Node.TEXT_NODE;\n    }\n    const text = onlyText ? element.textContent || "" : children.length ? "\\u2026" : "";\n    return oneLine(`<${element.nodeName.toLowerCase()}${attrText}>${trimStringWithEllipsis(text, 50)}</${element.nodeName.toLowerCase()}>`);\n  }\n  _generateSelectors(elements) {\n    this._evaluator.begin();\n    beginAriaCaches();\n    beginDOMCaches();\n    try {\n      const maxElements = this._isUtilityWorld && this._browserName === "firefox" ? 2 : 10;\n      const infos = elements.slice(0, maxElements).map((m) => ({\n        preview: this.previewNode(m),\n        selector: this.generateSelectorSimple(m)\n      }));\n      return infos.map((info, i) => `${i + 1}) ${info.preview} aka ${asLocator(this._sdkLanguage, info.selector)}`);\n    } finally {\n      endDOMCaches();\n      endAriaCaches();\n      this._evaluator.end();\n    }\n  }\n  strictModeViolationError(selector, matches) {\n    const lines = this._generateSelectors(matches).map((line) => `\n    ` + line);\n    if (lines.length < matches.length)\n      lines.push("\\n    ...");\n    return this.createStacklessError(`strict mode violation: ${asLocator(this._sdkLanguage, stringifySelector(selector))} resolved to ${matches.length} elements:${lines.join("")}\n`);\n  }\n  checkDeprecatedSelectorUsage(selector, matches) {\n    const kDeprecatedSelectors = /* @__PURE__ */ new Set([\n      "_react",\n      "_vue",\n      "xpath:light",\n      "text:light",\n      "id:light",\n      "data-testid:light",\n      "data-test-id:light",\n      "data-test:light"\n    ]);\n    if (!matches.length)\n      return;\n    const deperecated = selector.parts.find((part) => kDeprecatedSelectors.has(part.name));\n    if (!deperecated)\n      return;\n    const lines = this._generateSelectors(matches).map((line) => `\n    ` + line);\n    if (lines.length < matches.length)\n      lines.push("\\n    ...");\n    throw this.createStacklessError(`"${deperecated.name}" selector is not supported: ${asLocator(this._sdkLanguage, stringifySelector(selector))} resolved to ${matches.length} element${matches.length === 1 ? "" : "s"}:${lines.join("")}\n`);\n  }\n  createStacklessError(message) {\n    const error = this._shouldPrependErrorPrefix ? new Error("Error: " + message) : new Error(message);\n    if (this._browserName === "firefox") {\n      error.stack = "";\n      return error;\n    }\n    delete error.stack;\n    return error;\n  }\n  createHighlight() {\n    return new Highlight(this);\n  }\n  maskSelectors(selectors, color) {\n    const highlight = this._createHighlight();\n    const elements = [];\n    for (const selector of selectors)\n      elements.push(this.querySelectorAll(selector, this.document.documentElement));\n    highlight.maskElements(elements.flat(), color);\n  }\n  _createHighlight() {\n    if (this._highlight)\n      this.hideHighlight();\n    this._highlight = new Highlight(this);\n    this._highlight.install();\n    return this._highlight;\n  }\n  _ensureHighlight() {\n    if (!this._highlight) {\n      this._highlight = new Highlight(this);\n      this._highlight.install();\n    }\n    return this._highlight;\n  }\n  addHighlight(selector, style) {\n    const highlight = this._ensureHighlight();\n    highlight.addElementHighlight(selector, style);\n  }\n  removeHighlight(selector) {\n    const highlight = this._ensureHighlight();\n    highlight.removeElementHighlight(selector);\n  }\n  setScreencastAnnotation(annotation) {\n    var _a;\n    const highlight = this._ensureHighlight();\n    if (!annotation) {\n      highlight.updateHighlight([]);\n      highlight.hideActionPoint();\n      highlight.hideActionTitle();\n      highlight.hideActionCursor();\n      return;\n    }\n    const fadeDuration = (_a = annotation.duration) != null ? _a : 500;\n    if (annotation.box) {\n      highlight.updateHighlight([{\n        box: annotation.box,\n        color: "rgba(0, 128, 255, 0.15)",\n        borderColor: "rgba(0, 128, 255, 0.6)",\n        fadeDuration\n      }]);\n    }\n    if (annotation.point) {\n      if (annotation.cursor !== "none")\n        highlight.moveActionCursor(annotation.point.x, annotation.point.y, fadeDuration);\n      highlight.showActionPoint(annotation.point.x, annotation.point.y, fadeDuration);\n    }\n    if (annotation.actionTitle)\n      highlight.showActionTitle(annotation.actionTitle, fadeDuration, annotation.position, annotation.fontSize);\n  }\n  addUserOverlay(id, html) {\n    const highlight = this._ensureHighlight();\n    highlight.addUserOverlay(id, html);\n  }\n  getUserOverlay(id) {\n    const highlight = this._ensureHighlight();\n    return highlight.getUserOverlay(id);\n  }\n  removeUserOverlay(id) {\n    const highlight = this._ensureHighlight();\n    highlight.removeUserOverlay(id);\n  }\n  setUserOverlaysVisible(visible) {\n    const highlight = this._ensureHighlight();\n    highlight.setUserOverlaysVisible(visible);\n  }\n  hideHighlight() {\n    if (this._highlight) {\n      this._highlight.uninstall();\n      delete this._highlight;\n    }\n  }\n  markTargetElements(markedElements) {\n    const resetEvent = new CustomEvent("__playwright_reset_targets__", {\n      bubbles: true,\n      cancelable: true,\n      composed: true\n    });\n    this.document.dispatchEvent(resetEvent);\n    const markEvent = new CustomEvent("__playwright_mark_target__", {\n      bubbles: true,\n      cancelable: true,\n      composed: true\n    });\n    for (const element of markedElements)\n      element.dispatchEvent(markEvent);\n  }\n  _setupGlobalListenersRemovalDetection() {\n    const customEventName = "__playwright_global_listeners_check__";\n    let seenEvent = false;\n    const handleCustomEvent = () => seenEvent = true;\n    this.window.addEventListener(customEventName, handleCustomEvent);\n    new MutationObserver((entries) => {\n      const newDocumentElement = entries.some((entry) => Array.from(entry.addedNodes).includes(this.document.documentElement));\n      if (!newDocumentElement)\n        return;\n      seenEvent = false;\n      this.window.dispatchEvent(new CustomEvent(customEventName));\n      if (seenEvent)\n        return;\n      this.window.addEventListener(customEventName, handleCustomEvent);\n      for (const callback of this.onGlobalListenersRemoved)\n        callback();\n    }).observe(this.document, { childList: true });\n  }\n  _setupHitTargetInterceptors() {\n    const listener = (event) => {\n      var _a;\n      return (_a = this._hitTargetInterceptor) == null ? void 0 : _a.call(this, event);\n    };\n    const addHitTargetInterceptorListeners = () => {\n      for (const event of this._allHitTargetInterceptorEvents)\n        this.window.addEventListener(event, listener, { capture: true, passive: false });\n    };\n    addHitTargetInterceptorListeners();\n    this.onGlobalListenersRemoved.add(addHitTargetInterceptorListeners);\n  }\n  async expect(element, options, elements) {\n    const core = await this._expectCore(element, options, elements);\n    const ariaSnapshot = core.matches !== options.isNot ? void 0 : this._ariaSnapshotForExpect(element, options);\n    if (core.received === void 0 && ariaSnapshot === void 0)\n      return { matches: core.matches, missingReceived: core.missingReceived };\n    return { matches: core.matches, received: { value: core.received, ariaSnapshot }, missingReceived: core.missingReceived };\n  }\n  _ariaSnapshotForExpect(element, options) {\n    const expression = options.expression;\n    if (expression === "to.have.count" || expression.endsWith(".array"))\n      return void 0;\n    if (expression === "to.match.aria")\n      return void 0;\n    if (element && isElementVisible(element)) {\n      const isContainment = expression === "to.have.text";\n      return this._renderAriaSnapshot(element, { mode: "default", depth: isContainment ? void 0 : 1 });\n    }\n    if (!this.document.body)\n      return void 0;\n    return this._renderAriaSnapshot(this.document.body, { mode: "default" });\n  }\n  _renderAriaSnapshot(element, options) {\n    return renderAriaTree(generateAriaTree(element, options), options).text;\n  }\n  async _expectCore(element, options, elements) {\n    var _a, _b;\n    const isArray = options.expression === "to.have.count" || options.expression.endsWith(".array");\n    if (isArray)\n      return this.expectArray(elements, options);\n    if (!element) {\n      if (!options.isNot && options.expression === "to.be.hidden")\n        return { matches: true };\n      if (options.isNot && options.expression === "to.be.visible")\n        return { matches: false };\n      if (!options.isNot && options.expression === "to.be.detached")\n        return { matches: true };\n      if (options.isNot && options.expression === "to.be.attached")\n        return { matches: false };\n      if (options.isNot && options.expression === "to.be.in.viewport")\n        return { matches: false };\n      if (options.expression === "to.have.title" && ((_a = options == null ? void 0 : options.expectedText) == null ? void 0 : _a[0])) {\n        const matcher = new ExpectedTextMatcher(options.expectedText[0]);\n        const received = this.document.title;\n        return { received, matches: matcher.matches(received) };\n      }\n      if (options.expression === "to.have.url" && ((_b = options == null ? void 0 : options.expectedText) == null ? void 0 : _b[0])) {\n        const matcher = new ExpectedTextMatcher(options.expectedText[0]);\n        const received = this.document.location.href;\n        return { received, matches: matcher.matches(received) };\n      }\n      if (options.expression === "to.match.aria" && !options.selector) {\n        if (!this.document.body)\n          return { matches: options.isNot, missingReceived: true };\n        const result = matchesExpectAriaTemplate(this.document.body, options.expectedValue);\n        return {\n          received: result.received,\n          matches: !!result.matches.length\n        };\n      }\n      return { matches: options.isNot, missingReceived: true };\n    }\n    return await this.expectSingleElement(element, options);\n  }\n  async expectSingleElement(element, options) {\n    var _a, _b;\n    const expression = options.expression;\n    {\n      let result;\n      if (expression === "to.have.attribute") {\n        const hasAttribute = element.hasAttribute(options.expressionArg);\n        result = {\n          matches: hasAttribute,\n          received: hasAttribute ? "attribute present" : "attribute not present"\n        };\n      } else if (expression === "to.be.checked") {\n        const { checked, indeterminate } = options.expectedValue;\n        if (indeterminate) {\n          if (checked !== void 0)\n            throw this.createStacklessError("Can\'t assert indeterminate and checked at the same time");\n          result = this.elementState(element, "indeterminate");\n        } else {\n          result = this.elementState(element, checked === false ? "unchecked" : "checked");\n        }\n      } else if (expression === "to.be.disabled") {\n        result = this.elementState(element, "disabled");\n      } else if (expression === "to.be.editable") {\n        result = this.elementState(element, "editable");\n      } else if (expression === "to.be.readonly") {\n        result = this.elementState(element, "editable");\n        result.matches = !result.matches;\n      } else if (expression === "to.be.empty") {\n        if (element.nodeName === "INPUT" || element.nodeName === "TEXTAREA") {\n          const value = element.value;\n          result = { matches: !value, received: value ? "notEmpty" : "empty" };\n        } else {\n          const text = (_a = element.textContent) == null ? void 0 : _a.trim();\n          result = { matches: !text, received: text ? "notEmpty" : "empty" };\n        }\n      } else if (expression === "to.be.enabled") {\n        result = this.elementState(element, "enabled");\n      } else if (expression === "to.be.focused") {\n        const focused = this._activelyFocused(element).isFocused;\n        result = {\n          matches: focused,\n          received: focused ? "focused" : "inactive"\n        };\n      } else if (expression === "to.be.hidden") {\n        result = this.elementState(element, "hidden");\n      } else if (expression === "to.be.visible") {\n        result = this.elementState(element, "visible");\n      } else if (expression === "to.be.attached") {\n        result = {\n          matches: true,\n          received: "attached"\n        };\n      } else if (expression === "to.be.detached") {\n        result = {\n          matches: false,\n          received: "attached"\n        };\n      }\n      if (result) {\n        if (result.received === "error:notconnected")\n          throw this.createStacklessError("Element is not connected");\n        return result;\n      }\n    }\n    {\n      if (expression === "to.have.property") {\n        let target = element;\n        const properties = options.expressionArg.split(".");\n        for (let i = 0; i < properties.length - 1; i++) {\n          if (typeof target !== "object" || !(properties[i] in target))\n            return { received: void 0, matches: false };\n          target = target[properties[i]];\n        }\n        const received = target[properties[properties.length - 1]];\n        const matches = deepEquals(received, options.expectedValue);\n        return { received, matches };\n      }\n    }\n    {\n      if (expression === "to.be.in.viewport") {\n        const ratio = await this.viewportRatio(element);\n        return { received: `viewport ratio ${ratio}`, matches: ratio > 0 && ratio > ((_b = options.expectedNumber) != null ? _b : 0) - 1e-9 };\n      }\n    }\n    {\n      if (expression === "to.have.values") {\n        element = this.retarget(element, "follow-label");\n        if (element.nodeName !== "SELECT" || !element.multiple)\n          throw this.createStacklessError("Not a select element with a multiple attribute");\n        const received = [...element.selectedOptions].map((o) => o.value);\n        if (received.length !== options.expectedText.length)\n          return { received, matches: false };\n        return { received, matches: received.map((r, i) => new ExpectedTextMatcher(options.expectedText[i]).matches(r)).every(Boolean) };\n      }\n    }\n    {\n      if (expression === "to.match.aria") {\n        const result = matchesExpectAriaTemplate(element, options.expectedValue);\n        return {\n          received: result.received,\n          matches: !!result.matches.length\n        };\n      }\n    }\n    {\n      let received;\n      if (expression === "to.have.attribute.value") {\n        const value = element.getAttribute(options.expressionArg);\n        if (value === null)\n          return { received: null, matches: false };\n        received = value;\n      } else if (["to.have.class", "to.contain.class"].includes(expression)) {\n        if (!options.expectedText)\n          throw this.createStacklessError("Expected text is not provided for " + expression);\n        return {\n          received: element.classList.toString(),\n          matches: new ExpectedTextMatcher(options.expectedText[0]).matchesClassList(\n            this,\n            element.classList,\n            /* partial */\n            expression === "to.contain.class"\n          )\n        };\n      } else if (expression === "to.have.css") {\n        received = this.window.getComputedStyle(element, options.pseudo ? `::${options.pseudo}` : void 0).getPropertyValue(options.expressionArg);\n      } else if (expression === "to.have.id") {\n        received = element.id;\n      } else if (expression === "to.have.text") {\n        received = options.useInnerText ? element.innerText : elementText(/* @__PURE__ */ new Map(), element).full;\n      } else if (expression === "to.have.accessible.name") {\n        received = getElementAccessibleName(\n          element,\n          false\n          /* includeHidden */\n        );\n      } else if (expression === "to.have.accessible.description") {\n        received = getElementAccessibleDescription(\n          element,\n          false\n          /* includeHidden */\n        );\n      } else if (expression === "to.have.accessible.error.message") {\n        received = getElementAccessibleErrorMessage(element);\n      } else if (expression === "to.have.role") {\n        received = getAriaRole(element) || "";\n      } else if (expression === "to.have.value") {\n        element = this.retarget(element, "follow-label");\n        if (element.nodeName !== "INPUT" && element.nodeName !== "TEXTAREA" && element.nodeName !== "SELECT")\n          throw this.createStacklessError("Not an input element");\n        received = element.value;\n      }\n      if (received !== void 0 && options.expectedText) {\n        const matcher = new ExpectedTextMatcher(options.expectedText[0]);\n        return { received, matches: matcher.matches(received) };\n      }\n    }\n    throw this.createStacklessError("Unknown expect matcher: " + expression);\n  }\n  expectArray(elements, options) {\n    const expression = options.expression;\n    if (expression === "to.have.count") {\n      const received2 = elements.length;\n      const matches2 = received2 === options.expectedNumber;\n      return { received: received2, matches: matches2 };\n    }\n    if (!options.expectedText)\n      throw this.createStacklessError("Expected text is not provided for " + expression);\n    if (["to.have.class.array", "to.contain.class.array"].includes(expression)) {\n      const receivedClassLists = elements.map((e) => e.classList);\n      const received2 = receivedClassLists.map(String);\n      if (receivedClassLists.length !== options.expectedText.length)\n        return { received: received2, matches: false };\n      const matches2 = this._matchSequentially(\n        options.expectedText,\n        receivedClassLists,\n        (matcher, r) => matcher.matchesClassList(\n          this,\n          r,\n          /* partial */\n          expression === "to.contain.class.array"\n        )\n      );\n      return {\n        received: received2,\n        matches: matches2\n      };\n    }\n    if (!["to.contain.text.array", "to.have.text.array"].includes(expression))\n      throw this.createStacklessError("Unknown expect matcher: " + expression);\n    const received = elements.map((e) => options.useInnerText ? e.innerText : elementText(/* @__PURE__ */ new Map(), e).full);\n    const lengthShouldMatch = expression !== "to.contain.text.array";\n    const matchesLength = received.length === options.expectedText.length || !lengthShouldMatch;\n    if (!matchesLength)\n      return { received, matches: false };\n    const matches = this._matchSequentially(options.expectedText, received, (matcher, r) => matcher.matches(r));\n    return { received, matches };\n  }\n  _matchSequentially(expectedText, received, matchFn) {\n    const matchers = expectedText.map((e) => new ExpectedTextMatcher(e));\n    let mIndex = 0;\n    let rIndex = 0;\n    while (mIndex < matchers.length && rIndex < received.length) {\n      if (matchFn(matchers[mIndex], received[rIndex]))\n        ++mIndex;\n      ++rIndex;\n    }\n    return mIndex === matchers.length;\n  }\n};\nfunction oneLine(s) {\n  return s.replace(/\\n/g, "\\u21B5").replace(/\\t/g, "\\u21C6");\n}\nfunction createAttributeMatcher(part) {\n  const { value, caseSensitive } = part;\n  if (value instanceof RegExp)\n    return (s) => !!s.match(value);\n  if (caseSensitive)\n    return (s) => s === value;\n  const lowerCaseValue = value.toLowerCase();\n  return (s) => s.toLowerCase().includes(lowerCaseValue);\n}\nfunction cssUnquote(s) {\n  s = s.substring(1, s.length - 1);\n  if (!s.includes("\\\\"))\n    return s;\n  const r = [];\n  let i = 0;\n  while (i < s.length) {\n    if (s[i] === "\\\\" && i + 1 < s.length)\n      i++;\n    r.push(s[i++]);\n  }\n  return r.join("");\n}\nfunction createTextMatcher(selector, internal) {\n  if (selector[0] === "/" && selector.lastIndexOf("/") > 0) {\n    const lastSlash = selector.lastIndexOf("/");\n    const re = new RegExp(selector.substring(1, lastSlash), selector.substring(lastSlash + 1));\n    return { matcher: (elementText2) => re.test(elementText2.full), kind: "regex" };\n  }\n  const unquote = internal ? JSON.parse.bind(JSON) : cssUnquote;\n  let strict = false;\n  if (selector.length > 1 && selector[0] === \'"\' && selector[selector.length - 1] === \'"\') {\n    selector = unquote(selector);\n    strict = true;\n  } else if (internal && selector.length > 1 && selector[0] === \'"\' && selector[selector.length - 2] === \'"\' && selector[selector.length - 1] === "i") {\n    selector = unquote(selector.substring(0, selector.length - 1));\n    strict = false;\n  } else if (internal && selector.length > 1 && selector[0] === \'"\' && selector[selector.length - 2] === \'"\' && selector[selector.length - 1] === "s") {\n    selector = unquote(selector.substring(0, selector.length - 1));\n    strict = true;\n  } else if (selector.length > 1 && selector[0] === "\'" && selector[selector.length - 1] === "\'") {\n    selector = unquote(selector);\n    strict = true;\n  }\n  selector = normalizeWhiteSpace(selector);\n  if (strict) {\n    if (internal)\n      return { kind: "strict", matcher: (elementText2) => elementText2.normalized === selector };\n    const strictTextNodeMatcher = (elementText2) => {\n      if (!selector && !elementText2.immediate.length)\n        return true;\n      return elementText2.immediate.some((s) => normalizeWhiteSpace(s) === selector);\n    };\n    return { matcher: strictTextNodeMatcher, kind: "strict" };\n  }\n  selector = selector.toLowerCase();\n  return { kind: "lax", matcher: (elementText2) => elementText2.normalized.toLowerCase().includes(selector) };\n}\nvar ExpectedTextMatcher = class {\n  constructor(expected) {\n    this._normalizeWhiteSpace = expected.normalizeWhiteSpace;\n    this._ignoreCase = expected.ignoreCase;\n    this._string = expected.matchSubstring ? void 0 : this.normalize(expected.string);\n    this._substring = expected.matchSubstring ? this.normalize(expected.string) : void 0;\n    if (expected.regexSource) {\n      const flags = new Set((expected.regexFlags || "").split(""));\n      if (expected.ignoreCase === false)\n        flags.delete("i");\n      if (expected.ignoreCase === true)\n        flags.add("i");\n      this._regex = new RegExp(expected.regexSource, [...flags].join(""));\n    }\n  }\n  matches(text) {\n    if (!this._regex)\n      text = this.normalize(text);\n    if (this._string !== void 0)\n      return text === this._string;\n    if (this._substring !== void 0)\n      return text.includes(this._substring);\n    if (this._regex)\n      return !!this._regex.test(text);\n    return false;\n  }\n  matchesClassList(injectedScript, classList, partial) {\n    if (partial) {\n      if (this._regex)\n        throw injectedScript.createStacklessError("Partial matching does not support regular expressions. Please provide a string value.");\n      return this._string.split(/\\s+/g).filter(Boolean).every((className) => classList.contains(className));\n    }\n    return this.matches(classList.toString());\n  }\n  normalize(s) {\n    if (!s)\n      return s;\n    if (this._normalizeWhiteSpace)\n      s = normalizeWhiteSpace(s);\n    if (this._ignoreCase)\n      s = s.toLocaleLowerCase();\n    return s;\n  }\n};\nfunction deepEquals(a, b) {\n  if (a === b)\n    return true;\n  if (a && b && typeof a === "object" && typeof b === "object") {\n    if (a.constructor !== b.constructor)\n      return false;\n    if (Array.isArray(a)) {\n      if (a.length !== b.length)\n        return false;\n      for (let i = 0; i < a.length; ++i) {\n        if (!deepEquals(a[i], b[i]))\n          return false;\n      }\n      return true;\n    }\n    if (a instanceof RegExp)\n      return a.source === b.source && a.flags === b.flags;\n    if (a.valueOf !== Object.prototype.valueOf)\n      return a.valueOf() === b.valueOf();\n    if (a.toString !== Object.prototype.toString)\n      return a.toString() === b.toString();\n    const keys = Object.keys(a);\n    if (keys.length !== Object.keys(b).length)\n      return false;\n    for (let i = 0; i < keys.length; ++i) {\n      if (!b.hasOwnProperty(keys[i]))\n        return false;\n    }\n    for (const key of keys) {\n      if (!deepEquals(a[key], b[key]))\n        return false;\n    }\n    return true;\n  }\n  if (typeof a === "number" && typeof b === "number")\n    return isNaN(a) && isNaN(b);\n  return false;\n}\n';
  }
});

// packages/playwright-core/src/server/dom.ts
function isNonRecoverableDOMError(error) {
  return error instanceof NonRecoverableDOMError;
}
function throwRetargetableDOMError(result2) {
  if (result2 === "error:notconnected")
    throwElementIsNotAttached();
  return result2;
}
function throwElementIsNotAttached() {
  throw new Error("Element is not attached to the DOM");
}
function assertDone(result2) {
}
function roundPoint(point) {
  return {
    x: (point.x * 100 | 0) / 100,
    y: (point.y * 100 | 0) / 100
  };
}
function quadToRect(quad) {
  let minX = Infinity;
  let minY = Infinity;
  let maxX = -Infinity;
  let maxY = -Infinity;
  for (const point of quad) {
    minX = Math.min(minX, point.x);
    minY = Math.min(minY, point.y);
    maxX = Math.max(maxX, point.x);
    maxY = Math.max(maxY, point.y);
  }
  return { x: minX, y: minY, width: maxX - minX, height: maxY - minY };
}
function quadMiddlePoint(quad) {
  const result2 = { x: 0, y: 0 };
  for (const point of quad) {
    result2.x += point.x / 4;
    result2.y += point.y / 4;
  }
  return result2;
}
function triangleArea(p1, p2, p3) {
  return Math.abs(p1.x * (p2.y - p3.y) + p2.x * (p3.y - p1.y) + p3.x * (p1.y - p2.y)) / 2;
}
function isPointInsideQuad(point, quad) {
  const area1 = triangleArea(point, quad[0], quad[1]) + triangleArea(point, quad[1], quad[2]) + triangleArea(point, quad[2], quad[3]) + triangleArea(point, quad[3], quad[0]);
  const area2 = triangleArea(quad[0], quad[1], quad[2]) + triangleArea(quad[1], quad[2], quad[3]);
  if (Math.abs(area1 - area2) > 0.1)
    return false;
  return point.x < Math.max(quad[0].x, quad[1].x, quad[2].x, quad[3].x) && point.y < Math.max(quad[0].y, quad[1].y, quad[2].y, quad[3].y);
}
function findIntegerPointInsideQuad(quad) {
  const point = quadMiddlePoint(quad);
  point.x = Math.floor(point.x);
  point.y = Math.floor(point.y);
  if (isPointInsideQuad(point, quad))
    return point;
  point.x += 1;
  if (isPointInsideQuad(point, quad))
    return point;
  point.y += 1;
  if (isPointInsideQuad(point, quad))
    return point;
  point.x -= 1;
  if (isPointInsideQuad(point, quad))
    return point;
}
var import_fs14, import_path13, mime5, NonRecoverableDOMError, FrameExecutionContext, ElementHandle, kUnableToAdoptErrorMessage;
var init_dom = __esm({
  "packages/playwright-core/src/server/dom.ts"() {
    "use strict";
    import_fs14 = __toESM(require("fs"));
    import_path13 = __toESM(require("path"));
    init_debug();
    init_javascript();
    init_fileUploadUtils();
    init_injectedScriptSource();
    mime5 = require("./utilsBundle").mime;
    NonRecoverableDOMError = class extends Error {
    };
    FrameExecutionContext = class extends ExecutionContext {
      constructor(delegate, frame, world) {
        super(frame, delegate, world || "content-script", { noUtilityWorld: frame._page.delegate.noUtilityWorld?.() });
        this.frame = frame;
        this.world = world;
      }
      adoptIfNeeded(handle) {
        if (handle instanceof ElementHandle && handle._context !== this)
          return this.frame._page.delegate.adoptElementHandle(handle, this);
        return null;
      }
      async evaluate(pageFunction, arg) {
        return evaluate(this, true, pageFunction, arg);
      }
      async evaluateHandle(pageFunction, arg) {
        return evaluate(this, false, pageFunction, arg);
      }
      async evaluateExpression(expression2, options, arg) {
        return evaluateExpression(this, expression2, { ...options, returnByValue: true }, arg);
      }
      async evaluateExpressionHandle(expression2, options, arg) {
        return evaluateExpression(this, expression2, { ...options, returnByValue: false }, arg);
      }
      injectedScript() {
        if (!this._injectedScriptPromise) {
          const customEngines = [];
          const selectorsRegistry = this.frame._page.browserContext.selectors();
          for (const [name, { source: source12 }] of selectorsRegistry._engines)
            customEngines.push({ name, source: `(${source12})` });
          const sdkLanguage = this.frame._page.browserContext._browser.sdkLanguage();
          const options = {
            isUnderTest: isUnderTest(),
            sdkLanguage,
            testIdAttributeName: selectorsRegistry.testIdAttributeName(),
            stableRafCount: this.frame._page.delegate.rafCountForStablePosition(),
            browserName: this.frame._page.browserContext._browser.options.name,
            shouldPrependErrorPrefix: this.delegate.shouldPrependErrorPrefix(),
            isUtilityWorld: this.world === "utility",
            customEngines
          };
          const globalsSnapshot = this.frame._page.delegate.noUtilityWorld?.() ? mainWorldGlobalsSnapshotSource : "";
          const source11 = `
        (() => {
        ${globalsSnapshot}
        const module = {};
        ${source4}
        return new (module.exports.InjectedScript())(globalThis, ${JSON.stringify(options)});
        })();
      `;
          this._injectedScriptPromise = this.rawEvaluateHandle(source11).then((handle) => {
            handle._setPreview("InjectedScript");
            return handle;
          });
        }
        return this._injectedScriptPromise;
      }
    };
    ElementHandle = class extends JSHandle {
      constructor(context2, objectId) {
        super(context2, "node", void 0, objectId);
        this.__elementhandle = true;
        this._page = context2.frame._page;
        this._frame = context2.frame;
        this._initializePreview().catch((e) => {
        });
      }
      async _initializePreview() {
        const utility = await this._context.injectedScript();
        this._setPreview(await utility.evaluate((injected, e) => "JSHandle@" + injected.previewNode(e), this));
      }
      asElement() {
        return this;
      }
      async evaluateInUtility(pageFunction, arg) {
        try {
          const utility = await this._frame.utilityContext();
          return await utility.evaluate(pageFunction, [await utility.injectedScript(), this, arg]);
        } catch (e) {
          if (this._frame.isNonRetriableError(e))
            throw e;
          return "error:notconnected";
        }
      }
      async _evaluateHandleInUtility(pageFunction, arg) {
        try {
          const utility = await this._frame.utilityContext();
          return await utility.evaluateHandle(pageFunction, [await utility.injectedScript(), this, arg]);
        } catch (e) {
          if (this._frame.isNonRetriableError(e))
            throw e;
          return "error:notconnected";
        }
      }
      async ownerFrame(progress2) {
        return await progress2.race(this._ownerFrame());
      }
      async _ownerFrame() {
        const frameId = await this._page.delegate.getOwnerFrame(this);
        if (!frameId)
          return null;
        const frame = this._page.frameManager.frame(frameId);
        if (frame)
          return frame;
        for (const page of this._page.browserContext.pages()) {
          const frame2 = page.frameManager.frame(frameId);
          if (frame2)
            return frame2;
        }
        return null;
      }
      async _isIframeElement() {
        return this.evaluateInUtility(([injected, node]) => node && (node.nodeName === "IFRAME" || node.nodeName === "FRAME"), {});
      }
      async contentFrame(progress2) {
        return progress2.race(this._contentFrame());
      }
      async _contentFrame() {
        const isFrameElement = throwRetargetableDOMError(await this._isIframeElement());
        if (!isFrameElement)
          return null;
        return this._page.delegate.getContentFrame(this);
      }
      async getAttribute(progress2, name) {
        return this._frame.getAttribute(progress2, ":scope", name, {}, this);
      }
      async inputValue(progress2) {
        return this._frame.inputValue(progress2, ":scope", {}, this);
      }
      async textContent(progress2) {
        return this._frame.textContent(progress2, ":scope", {}, this);
      }
      async innerText(progress2) {
        return this._frame.innerText(progress2, ":scope", {}, this);
      }
      async innerHTML(progress2) {
        return this._frame.innerHTML(progress2, ":scope", {}, this);
      }
      async dispatchEvent(progress2, type3, eventInit = {}) {
        return this._frame.dispatchEvent(progress2, ":scope", type3, eventInit, {}, this);
      }
      async _scrollRectIntoViewIfNeeded(progress2, rect) {
        return await progress2.race(this._page.delegate.scrollRectIntoViewIfNeeded(this, rect));
      }
      async _waitAndScrollIntoViewIfNeeded(progress2, waitForVisible) {
        const result2 = await this._retryAction(progress2, "scroll into view", async (progress3) => {
          progress3.log(`  waiting for element to be stable`);
          const waitResult = await progress3.race(this.evaluateInUtility(async ([injected, node, { waitForVisible: waitForVisible2 }]) => {
            return await injected.checkElementStates(node, waitForVisible2 ? ["visible", "stable"] : ["stable"]);
          }, { waitForVisible }));
          if (waitResult)
            return waitResult;
          return await this._scrollRectIntoViewIfNeeded(progress3);
        }, {});
        assertDone(throwRetargetableDOMError(result2));
      }
      async scrollIntoViewIfNeeded(progress2) {
        await this._waitAndScrollIntoViewIfNeeded(
          progress2,
          false
          /* waitForVisible */
        );
      }
      async _clickablePoint(progress2) {
        const intersectQuadWithViewport = (quad2) => {
          return quad2.map((point) => ({
            x: Math.min(Math.max(point.x, 0), metrics.width),
            y: Math.min(Math.max(point.y, 0), metrics.height)
          }));
        };
        const computeQuadArea = (quad2) => {
          let area = 0;
          for (let i = 0; i < quad2.length; ++i) {
            const p1 = quad2[i];
            const p2 = quad2[(i + 1) % quad2.length];
            area += (p1.x * p2.y - p2.x * p1.y) / 2;
          }
          return Math.abs(area);
        };
        const [quads, metrics] = await progress2.race(Promise.all([
          this._page.delegate.getContentQuads(this),
          this._page.mainFrame().utilityContext().then((utility) => utility.evaluate(() => ({ width: innerWidth, height: innerHeight })))
        ]));
        if (quads === "error:notconnected")
          return quads;
        if (!quads || !quads.length)
          return "error:notvisible";
        const filtered = quads.map((quad2) => intersectQuadWithViewport(quad2)).filter((quad2) => computeQuadArea(quad2) > 0.99);
        if (!filtered.length)
          return "error:notinviewport";
        const quad = filtered[0];
        const box = quadToRect(quad);
        if (this._page.browserContext._browser.options.name === "firefox") {
          for (const q of filtered) {
            const integerPoint = findIntegerPointInsideQuad(q);
            if (integerPoint)
              return { point: integerPoint, box };
          }
        }
        return { point: quadMiddlePoint(quad), box };
      }
      async _offsetPoint(progress2, offset) {
        const [box, border] = await progress2.race(Promise.all([
          this.boundingBox(progress2),
          this.evaluateInUtility(([injected, node]) => injected.getElementBorderWidth(node), {}).catch((e) => {
          })
        ]));
        if (!box || !border)
          return "error:notvisible";
        if (border === "error:notconnected")
          return border;
        return {
          point: {
            x: box.x + border.left + offset.x,
            y: box.y + border.top + offset.y
          },
          box
        };
      }
      async _retryAction(progress2, actionName, action, options) {
        let retry2 = 0;
        const waitTime = [0, 20, 100, 100, 500];
        const noAutoWaiting = options.__testHookNoAutoWaiting ?? options.noAutoWaiting;
        while (true) {
          if (retry2) {
            progress2.log(`retrying ${actionName} action${options.trial ? " (trial run)" : ""}`);
            const timeout = waitTime[Math.min(retry2 - 1, waitTime.length - 1)];
            if (timeout) {
              progress2.log(`  waiting ${timeout}ms`);
              const result3 = await progress2.race(this.evaluateInUtility(([injected, node, timeout2]) => new Promise((f) => setTimeout(f, timeout2)), timeout));
              if (result3 === "error:notconnected")
                return result3;
            }
          } else {
            progress2.log(`attempting ${actionName} action${options.trial ? " (trial run)" : ""}`);
          }
          if (!options.skipActionPreChecks && !options.force && !noAutoWaiting)
            await this._frame._page.performActionPreChecks(progress2);
          const result2 = await action(progress2, retry2);
          ++retry2;
          if (result2 === "error:notvisible") {
            if (options.force || noAutoWaiting)
              throw new NonRecoverableDOMError("Element is not visible");
            progress2.log("  element is not visible");
            continue;
          }
          if (result2 === "error:notinviewport") {
            if (options.force || noAutoWaiting)
              throw new NonRecoverableDOMError("Element is outside of the viewport");
            progress2.log("  element is outside of the viewport");
            continue;
          }
          if (result2 === "error:optionsnotfound") {
            if (noAutoWaiting)
              throw new NonRecoverableDOMError("Did not find some options");
            progress2.log("  did not find some options");
            continue;
          }
          if (result2 === "error:optionnotenabled") {
            if (noAutoWaiting)
              throw new NonRecoverableDOMError("Option being selected is not enabled");
            progress2.log("  option being selected is not enabled");
            continue;
          }
          if (typeof result2 === "object" && "hitTargetDescription" in result2) {
            if (noAutoWaiting)
              throw new NonRecoverableDOMError(`${result2.hitTargetDescription} intercepts pointer events`);
            progress2.log(`  ${result2.hitTargetDescription} intercepts pointer events`);
            continue;
          }
          if (typeof result2 === "object" && "missingState" in result2) {
            if (noAutoWaiting)
              throw new NonRecoverableDOMError(`Element is not ${result2.missingState}`);
            progress2.log(`  element is not ${result2.missingState}`);
            continue;
          }
          return result2;
        }
      }
      async _retryPointerAction(progress2, actionName, waitForEnabled, action, options) {
        const skipActionPreChecks = actionName === "move and up";
        return await this._retryAction(progress2, actionName, async (progress3, retry2) => {
          const scrollOptions = [
            void 0,
            { block: "end", inline: "end" },
            { block: "center", inline: "center" },
            { block: "start", inline: "start" }
          ];
          const forceScrollOptions = scrollOptions[retry2 % scrollOptions.length];
          return await this._performPointerAction(progress3, actionName, waitForEnabled, action, forceScrollOptions, options);
        }, { ...options, skipActionPreChecks });
      }
      async _performPointerAction(progress2, actionName, waitForEnabled, action, forceScrollOptions, options) {
        const { force = false, position } = options;
        const doScrollIntoView = async (progress3) => {
          if (forceScrollOptions) {
            return await progress3.race(this.evaluateInUtility(([injected, node, options2]) => {
              if (node.nodeType === 1)
                node.scrollIntoView(options2);
              return "done";
            }, forceScrollOptions));
          }
          return await this._scrollRectIntoViewIfNeeded(progress3, position ? { x: position.x, y: position.y, width: 0, height: 0 } : void 0);
        };
        if (this._frame.parentFrame()) {
          await doScrollIntoView(progress2).catch(() => {
          });
        }
        if (options.__testHookBeforeStable)
          await progress2.race(options.__testHookBeforeStable());
        if (!force) {
          const elementStates = waitForEnabled ? ["visible", "enabled", "stable"] : ["visible", "stable"];
          progress2.log(`  waiting for element to be ${waitForEnabled ? "visible, enabled and stable" : "visible and stable"}`);
          const result2 = await progress2.race(this.evaluateInUtility(async ([injected, node, { elementStates: elementStates2 }]) => {
            return await injected.checkElementStates(node, elementStates2);
          }, { elementStates }));
          if (result2)
            return result2;
          progress2.log(`  element is ${waitForEnabled ? "visible, enabled and stable" : "visible and stable"}`);
        }
        if (options.__testHookAfterStable)
          await progress2.race(options.__testHookAfterStable());
        progress2.log("  scrolling into view if needed");
        const scrolled = await doScrollIntoView(progress2);
        if (scrolled !== "done")
          return scrolled;
        progress2.log("  done scrolling");
        const maybeResult = position ? await this._offsetPoint(progress2, position) : await this._clickablePoint(progress2);
        if (typeof maybeResult === "string")
          return maybeResult;
        const point = roundPoint(maybeResult.point);
        await progress2.race(this.instrumentation.onBeforeInputAction(this, progress2.metadata, point, maybeResult.box));
        let hitTargetInterceptionHandle;
        if (force) {
          progress2.log(`  forcing action`);
        } else {
          if (options.__testHookBeforeHitTarget)
            await progress2.race(options.__testHookBeforeHitTarget());
          const frameCheckResult = await this._checkFrameIsHitTarget(progress2, point);
          if (frameCheckResult === "error:notconnected" || "hitTargetDescription" in frameCheckResult)
            return frameCheckResult;
          const hitPoint = frameCheckResult.framePoint;
          const actionType = actionName === "move and up" ? "drag" : actionName === "hover" || actionName === "tap" ? actionName : "mouse";
          const handle = await progress2.race(this._evaluateHandleInUtility(([injected, node, { actionType: actionType2, hitPoint: hitPoint2, trial }]) => injected.setupHitTargetInterceptor(node, actionType2, hitPoint2, trial), { actionType, hitPoint, trial: !!options.trial }));
          if (handle === "error:notconnected")
            return handle;
          if (!handle._objectId) {
            const error = handle.rawValue();
            if (error === "error:notconnected")
              return error;
            return { hitTargetDescription: error };
          }
          hitTargetInterceptionHandle = handle;
        }
        const actionResult = await this._page.frameManager.waitForSignalsCreatedBy(progress2, options.waitAfter === true, async (progress3) => {
          if (options.__testHookBeforePointerAction)
            await progress3.race(options.__testHookBeforePointerAction());
          let restoreModifiers;
          if (options && options.modifiers)
            restoreModifiers = await this._page.keyboard.ensureModifiers(progress3, options.modifiers);
          progress3.log(`  performing ${actionName} action`);
          await action(progress3, point);
          if (restoreModifiers)
            await this._page.keyboard.ensureModifiers(progress3, restoreModifiers);
          if (hitTargetInterceptionHandle) {
            const stopHitTargetInterception = this._frame.raceAgainstEvaluationStallingEvents(() => {
              return hitTargetInterceptionHandle.evaluate((h) => h.stop());
            }).catch((e) => "done").finally(() => {
              hitTargetInterceptionHandle?.dispose();
            });
            if (options.waitAfter !== false) {
              const hitTargetResult = await progress3.race(stopHitTargetInterception);
              if (hitTargetResult !== "done")
                return hitTargetResult;
            }
          }
          progress3.log(`  ${options.trial ? "trial " : ""}${actionName} action done`);
          progress3.log("  waiting for scheduled navigations to finish");
          if (options.__testHookAfterPointerAction)
            await progress3.race(options.__testHookAfterPointerAction());
          return "done";
        }).finally(() => {
          const stopPromise = hitTargetInterceptionHandle?.evaluate((h) => h.stop()).catch(() => {
          });
          stopPromise?.then(() => hitTargetInterceptionHandle?.dispose());
        });
        if (actionResult !== "done")
          return actionResult;
        progress2.log("  navigations have finished");
        return "done";
      }
      async _markAsTargetElement(progress2) {
        await progress2.race(this.evaluateInUtility(([injected, node]) => {
          if (node.nodeType === 1)
            injected.markTargetElements(/* @__PURE__ */ new Set([node]));
        }, {}));
      }
      async hover(progress2, options) {
        await this._markAsTargetElement(progress2);
        const result2 = await this._hover(progress2, options);
        return assertDone(throwRetargetableDOMError(result2));
      }
      _hover(progress2, options) {
        return this._retryPointerAction(progress2, "hover", false, (progress3, point) => this._page.mouse.move(progress3, point.x, point.y), { ...options, waitAfter: "disabled" });
      }
      async click(progress2, options) {
        await this._markAsTargetElement(progress2);
        const result2 = await this._click(progress2, { ...options, waitAfter: !options.noWaitAfter });
        return assertDone(throwRetargetableDOMError(result2));
      }
      _click(progress2, options) {
        return this._retryPointerAction(progress2, "click", true, (progress3, point) => this._page.mouse.click(progress3, point.x, point.y, options), options);
      }
      async dblclick(progress2, options) {
        await this._markAsTargetElement(progress2);
        const result2 = await this._dblclick(progress2, options);
        return assertDone(throwRetargetableDOMError(result2));
      }
      _dblclick(progress2, options) {
        return this._retryPointerAction(progress2, "dblclick", true, (progress3, point) => this._page.mouse.click(progress3, point.x, point.y, { ...options, clickCount: 2 }), { ...options, waitAfter: "disabled" });
      }
      async tap(progress2, options) {
        await this._markAsTargetElement(progress2);
        const result2 = await this._tap(progress2, options);
        return assertDone(throwRetargetableDOMError(result2));
      }
      _tap(progress2, options) {
        return this._retryPointerAction(progress2, "tap", true, (progress3, point) => this._page.touchscreen.tap(progress3, point.x, point.y), { ...options, waitAfter: "disabled" });
      }
      async selectOption(progress2, elements, values, options) {
        await this._markAsTargetElement(progress2);
        const result2 = await this._selectOption(progress2, elements, values, options);
        return throwRetargetableDOMError(result2);
      }
      async _selectOption(progress2, elements, values, options) {
        let resultingOptions = [];
        const result2 = await this._retryAction(progress2, "select option", async (progress3) => {
          await progress3.race(this.instrumentation.onBeforeInputAction(this, progress3.metadata));
          if (!options.force)
            progress3.log(`  waiting for element to be visible and enabled`);
          const optionsToSelect = [...elements, ...values];
          const result3 = await progress3.race(this.evaluateInUtility(async ([injected, node, { optionsToSelect: optionsToSelect2, force }]) => {
            if (!force) {
              const checkResult = await injected.checkElementStates(node, ["visible", "enabled"]);
              if (checkResult)
                return checkResult;
            }
            return injected.selectOptions(node, optionsToSelect2);
          }, { optionsToSelect, force: options.force }));
          if (Array.isArray(result3)) {
            progress3.log("  selected specified option(s)");
            resultingOptions = result3;
            return "done";
          }
          return result3;
        }, options);
        if (result2 === "error:notconnected")
          return result2;
        return resultingOptions;
      }
      async fill(progress2, value2, options) {
        await this._markAsTargetElement(progress2);
        const result2 = await this._fill(progress2, value2, options);
        assertDone(throwRetargetableDOMError(result2));
      }
      async _fill(progress2, value2, options) {
        progress2.log(`  fill("${value2}")`);
        return await this._retryAction(progress2, "fill", async (progress3) => {
          await progress3.race(this.instrumentation.onBeforeInputAction(this, progress3.metadata));
          if (!options.force)
            progress3.log("  waiting for element to be visible, enabled and editable");
          const result2 = await progress3.race(this.evaluateInUtility(async ([injected, node, { value: value3, force }]) => {
            if (!force) {
              const checkResult = await injected.checkElementStates(node, ["visible", "enabled", "editable"]);
              if (checkResult)
                return checkResult;
            }
            return injected.fill(node, value3);
          }, { value: value2, force: options.force }));
          if (result2 === "needsinput") {
            if (value2)
              await this._page.keyboard.insertText(progress3, value2);
            else
              await this._page.keyboard.press(progress3, "Delete");
            return "done";
          } else {
            return result2;
          }
        }, options);
      }
      async selectText(progress2, options) {
        const result2 = await this._retryAction(progress2, "selectText", async (progress3) => {
          if (!options.force)
            progress3.log("  waiting for element to be visible");
          return await progress3.race(this.evaluateInUtility(async ([injected, node, { force }]) => {
            if (!force) {
              const checkResult = await injected.checkElementStates(node, ["visible"]);
              if (checkResult)
                return checkResult;
            }
            return injected.selectText(node);
          }, { force: options.force }));
        }, options);
        assertDone(throwRetargetableDOMError(result2));
      }
      async setInputFiles(progress2, params2) {
        const inputFileItems = await progress2.race(prepareFilesForUpload(this._frame, params2));
        await this._markAsTargetElement(progress2);
        const result2 = await this._setInputFiles(progress2, inputFileItems);
        return assertDone(throwRetargetableDOMError(result2));
      }
      async _drop(progress2, inputFileItems, data, options) {
        const { filePayloads, localPaths } = inputFileItems;
        let payloads;
        if (localPaths && !filePayloads) {
          payloads = await Promise.all(localPaths.map(async (p) => ({
            name: import_path13.default.basename(p),
            mimeType: mime5.getType(p) || "application/octet-stream",
            buffer: (await import_fs14.default.promises.readFile(p)).toString("base64"),
            lastModifiedMs: (await import_fs14.default.promises.stat(p)).mtimeMs
          })));
        } else {
          payloads = (filePayloads ?? []).map((p) => ({
            name: p.name,
            mimeType: p.mimeType || "application/octet-stream",
            buffer: p.buffer,
            lastModifiedMs: p.lastModifiedMs
          }));
        }
        return this._retryPointerAction(progress2, "drop", false, async (progress3, point) => {
          const mainContext = await progress3.race(this._frame.mainContext());
          const handle = this._context === mainContext ? this : await progress3.race(this._page.delegate.adoptElementHandle(this, mainContext));
          const disposeHandle = handle !== this;
          try {
            const result2 = await progress3.race(handle.evaluate((node, { payloads: payloads2, data: data2, point: point2 }) => {
              if (!node.isConnected || node.nodeType !== 1)
                return "error:notconnected";
              const element2 = node;
              const dt = new DataTransfer();
              for (const p of payloads2) {
                const bytes = Uint8Array.from(atob(p.buffer), (c) => c.charCodeAt(0));
                const file = new File([bytes], p.name, { type: p.mimeType, lastModified: p.lastModifiedMs });
                dt.items.add(file);
              }
              for (const entry of data2)
                dt.setData(entry.mimeType, entry.value);
              const makeEvent = (type3) => new DragEvent(type3, {
                bubbles: true,
                cancelable: true,
                composed: true,
                clientX: point2.x,
                clientY: point2.y,
                dataTransfer: dt
              });
              element2.dispatchEvent(makeEvent("dragenter"));
              const over = makeEvent("dragover");
              element2.dispatchEvent(over);
              if (!over.defaultPrevented) {
                element2.dispatchEvent(makeEvent("dragleave"));
                return "not-accepted";
              }
              element2.dispatchEvent(makeEvent("drop"));
              return "accepted";
            }, { payloads, data, point }));
            if (result2 === "not-accepted")
              throw new NonRecoverableDOMError("Drop target did not accept the drop \u2014 its dragover handler did not call preventDefault()");
          } finally {
            if (disposeHandle)
              handle.dispose();
          }
        }, { ...options, waitAfter: "disabled" });
      }
      async _setInputFiles(progress2, items) {
        const { filePayloads, localPaths, localDirectory } = items;
        const multiple = filePayloads && filePayloads.length > 1 || localPaths && localPaths.length > 1;
        const result2 = await progress2.race(this._evaluateHandleInUtility(([injected, node, { multiple: multiple2, directoryUpload }]) => {
          const element2 = injected.retarget(node, "follow-label");
          if (!element2)
            return;
          if (element2.tagName !== "INPUT")
            throw injected.createStacklessError("Node is not an HTMLInputElement");
          const inputElement = element2;
          if (multiple2 && !inputElement.multiple && !inputElement.webkitdirectory)
            throw injected.createStacklessError("Non-multiple file input can only accept single file");
          if (directoryUpload && !inputElement.webkitdirectory)
            throw injected.createStacklessError("File input does not support directories, pass individual files instead");
          if (!directoryUpload && inputElement.webkitdirectory)
            throw injected.createStacklessError("[webkitdirectory] input requires passing a path to a directory");
          return inputElement;
        }, { multiple, directoryUpload: !!localDirectory }));
        if (result2 === "error:notconnected" || !result2.asElement())
          return "error:notconnected";
        const retargeted = result2.asElement();
        await progress2.race(this.instrumentation.onBeforeInputAction(this, progress2.metadata));
        if (localPaths || localDirectory) {
          const localPathsOrDirectory = localDirectory ? [localDirectory] : localPaths;
          await progress2.race(Promise.all(localPathsOrDirectory.map((localPath) => import_fs14.default.promises.access(localPath, import_fs14.default.constants.F_OK))));
          const waitForInputEvent = localDirectory ? this.evaluate((node) => new Promise((fulfill) => {
            node.addEventListener("input", fulfill, { once: true });
          })).catch(() => {
          }) : Promise.resolve();
          await this._page.delegate.setInputFilePaths(progress2, retargeted, localPathsOrDirectory);
          await progress2.race(waitForInputEvent);
        } else {
          await progress2.race(retargeted.evaluateInUtility(([injected, node, files]) => injected.setInputFiles(node, files), filePayloads));
        }
        return "done";
      }
      async focus(progress2) {
        await this._markAsTargetElement(progress2);
        const result2 = await this._focus(progress2);
        return assertDone(throwRetargetableDOMError(result2));
      }
      async _focus(progress2, resetSelectionIfNotFocused) {
        return await progress2.race(this.evaluateInUtility(([injected, node, resetSelectionIfNotFocused2]) => injected.focusNode(node, resetSelectionIfNotFocused2), resetSelectionIfNotFocused));
      }
      async _blur(progress2) {
        return await progress2.race(this.evaluateInUtility(([injected, node]) => injected.blurNode(node), {}));
      }
      async type(progress2, text2, options) {
        await this._markAsTargetElement(progress2);
        const result2 = await this._type(progress2, text2, options);
        return assertDone(throwRetargetableDOMError(result2));
      }
      async _type(progress2, text2, options) {
        progress2.log(`elementHandle.type("${text2}")`);
        await progress2.race(this.instrumentation.onBeforeInputAction(this, progress2.metadata));
        const result2 = await this._focus(
          progress2,
          true
          /* resetSelectionIfNotFocused */
        );
        if (result2 !== "done")
          return result2;
        await this._page.keyboard.type(progress2, text2, options);
        return "done";
      }
      async press(progress2, key, options) {
        await this._markAsTargetElement(progress2);
        const result2 = await this._press(progress2, key, options);
        return assertDone(throwRetargetableDOMError(result2));
      }
      async _press(progress2, key, options) {
        progress2.log(`elementHandle.press("${key}")`);
        await progress2.race(this.instrumentation.onBeforeInputAction(this, progress2.metadata));
        return this._page.frameManager.waitForSignalsCreatedBy(progress2, !options.noWaitAfter, async (progress3) => {
          const result2 = await this._focus(
            progress3,
            true
            /* resetSelectionIfNotFocused */
          );
          if (result2 !== "done")
            return result2;
          await this._page.keyboard.press(progress3, key, options);
          return "done";
        });
      }
      async check(progress2, options) {
        const result2 = await this._setChecked(progress2, true, options);
        return assertDone(throwRetargetableDOMError(result2));
      }
      async uncheck(progress2, options) {
        const result2 = await this._setChecked(progress2, false, options);
        return assertDone(throwRetargetableDOMError(result2));
      }
      async _setChecked(progress2, state, options) {
        const isChecked = async (progress3) => {
          const result3 = await progress3.race(this.evaluateInUtility(([injected, node]) => injected.elementState(node, "checked"), {}));
          if (result3 === "error:notconnected" || result3.received === "error:notconnected")
            throwElementIsNotAttached();
          return { matches: result3.matches, isRadio: result3.isRadio };
        };
        await this._markAsTargetElement(progress2);
        const checkedState = await isChecked(progress2);
        if (checkedState.matches === state)
          return "done";
        if (!state && checkedState.isRadio)
          throw new NonRecoverableDOMError("Cannot uncheck radio button. Radio buttons can only be unchecked by selecting another radio button in the same group.");
        const result2 = await this._click(progress2, { ...options, waitAfter: "disabled" });
        if (result2 !== "done")
          return result2;
        if (options.trial)
          return "done";
        const finalState = await isChecked(progress2);
        if (finalState.matches !== state)
          throw new NonRecoverableDOMError("Clicking the checkbox did not change its state");
        return "done";
      }
      async boundingBox(progress2) {
        return await progress2.race(this._page.delegate.getBoundingBox(this));
      }
      async screenshot(progress2, options) {
        return await this._page.screenshotter.screenshotElement(progress2, this, options);
      }
      async querySelector(progress2, selector, options) {
        return progress2.race(this._querySelector(selector, options));
      }
      async _querySelector(selector, options) {
        return this._frame.selectors.query(selector, options, this);
      }
      async querySelectorAll(progress2, selector) {
        return progress2.race(this._querySelectorAll(selector));
      }
      async _querySelectorAll(selector) {
        return this._frame.selectors.queryAll(selector, this);
      }
      async evalOnSelector(progress2, selector, strict, expression2, isFunction2, arg) {
        return this._frame.evalOnSelector(progress2, selector, strict, expression2, isFunction2, arg, this);
      }
      async evalOnSelectorAll(progress2, selector, expression2, isFunction2, arg) {
        return this._frame.evalOnSelectorAll(progress2, selector, expression2, isFunction2, arg, this);
      }
      async isVisible(progress2) {
        return this._frame.isVisible(progress2, ":scope", {}, this);
      }
      async isHidden(progress2) {
        return this._frame.isHidden(progress2, ":scope", {}, this);
      }
      async isEnabled(progress2) {
        return this._frame.isEnabled(progress2, ":scope", {}, this);
      }
      async isDisabled(progress2) {
        return this._frame.isDisabled(progress2, ":scope", {}, this);
      }
      async isEditable(progress2) {
        return this._frame.isEditable(progress2, ":scope", {}, this);
      }
      async isChecked(progress2) {
        return this._frame.isChecked(progress2, ":scope", {}, this);
      }
      async waitForElementState(progress2, state) {
        const actionName = `wait for ${state}`;
        const result2 = await this._retryAction(progress2, actionName, async (progress3) => {
          return await progress3.race(this.evaluateInUtility(async ([injected, node, state2]) => {
            return await injected.checkElementStates(node, [state2]) || "done";
          }, state));
        }, {});
        assertDone(throwRetargetableDOMError(result2));
      }
      async waitForSelector(progress2, selector, options) {
        return await this._frame.waitForSelector(progress2, selector, true, options, this);
      }
      async _adoptTo(context2) {
        if (this._context !== context2) {
          const adopted = await this._page.delegate.adoptElementHandle(this, context2);
          this.dispose();
          return adopted;
        }
        return this;
      }
      async _checkFrameIsHitTarget(progress2, point) {
        let frame = this._frame;
        const data = [];
        while (frame.parentFrame()) {
          const frameElement = await frame.frameElement(progress2);
          const box = await frameElement.boundingBox(progress2);
          const style = await progress2.race(frameElement.evaluateInUtility(([injected, iframe]) => injected.describeIFrameStyle(iframe), {}).catch((e) => "error:notconnected"));
          if (!box || style === "error:notconnected")
            return "error:notconnected";
          if (style === "transformed") {
            return { framePoint: void 0 };
          }
          const pointInFrame = { x: point.x - box.x - style.left, y: point.y - box.y - style.top };
          data.push({ frame, frameElement, pointInFrame });
          frame = frame.parentFrame();
        }
        data.push({ frame, frameElement: null, pointInFrame: point });
        for (let i = data.length - 1; i > 0; i--) {
          const element2 = data[i - 1].frameElement;
          const point2 = data[i].pointInFrame;
          const hitTargetResult = await progress2.race(element2.evaluateInUtility(([injected, element3, hitPoint]) => {
            return injected.expectHitTarget(hitPoint, element3);
          }, point2));
          if (hitTargetResult !== "done")
            return hitTargetResult;
        }
        return { framePoint: data[0].pointInFrame };
      }
    };
    kUnableToAdoptErrorMessage = "Unable to adopt element handle from a different document";
  }
});

// packages/playwright-core/src/server/frameSelectors.ts
async function adoptIfNeeded(handle, context2) {
  if (handle._context === context2)
    return handle;
  const adopted = await handle._page.delegate.adoptElementHandle(handle, context2);
  handle.dispose();
  return adopted;
}
var FrameSelectors;
var init_frameSelectors = __esm({
  "packages/playwright-core/src/server/frameSelectors.ts"() {
    "use strict";
    init_selectorParser();
    init_locatorGenerators();
    FrameSelectors = class {
      constructor(frame) {
        this.frame = frame;
      }
      _parseSelector(selector, options) {
        const strict = typeof options?.strict === "boolean" ? options.strict : !!this.frame._page.browserContext._options.strictSelectors;
        return this.frame._page.browserContext.selectors().parseSelector(selector, strict);
      }
      async query(selector, options, scope) {
        const resolved = await this.resolveInjectedForSelector(selector, options, scope);
        if (!resolved)
          return null;
        const handle = await resolved.injected.evaluateHandle((injected, { info, scope: scope2 }) => {
          return injected.querySelector(info.parsed, scope2 || document, info.strict);
        }, { info: resolved.info, scope: resolved.scope });
        const elementHandle = handle.asElement();
        if (!elementHandle) {
          handle.dispose();
          return null;
        }
        return adoptIfNeeded(elementHandle, await resolved.frame.mainContext());
      }
      async queryArrayInMainWorld(selector, scope) {
        const resolved = await this.resolveInjectedForSelector(selector, { mainWorld: true }, scope);
        if (!resolved)
          throw new Error(`Failed to find frame for selector "${selector}"`);
        return await resolved.injected.evaluateHandle((injected, { info, scope: scope2 }) => {
          const elements = injected.querySelectorAll(info.parsed, scope2 || document);
          injected.checkDeprecatedSelectorUsage(info.parsed, elements);
          return elements;
        }, { info: resolved.info, scope: resolved.scope });
      }
      async queryCount(selector, options) {
        const resolved = await this.resolveInjectedForSelector(selector);
        if (!resolved)
          throw new Error(`Failed to find frame for selector "${selector}"`);
        await options.__testHookBeforeQuery?.();
        return await resolved.injected.evaluate((injected, { info }) => {
          const elements = injected.querySelectorAll(info.parsed, document);
          injected.checkDeprecatedSelectorUsage(info.parsed, elements);
          return elements.length;
        }, { info: resolved.info });
      }
      async queryAll(selector, scope) {
        const resolved = await this.resolveInjectedForSelector(selector, {}, scope);
        if (!resolved)
          return [];
        const arrayHandle = await resolved.injected.evaluateHandle((injected, { info, scope: scope2 }) => {
          const elements = injected.querySelectorAll(info.parsed, scope2 || document);
          injected.checkDeprecatedSelectorUsage(info.parsed, elements);
          return elements;
        }, { info: resolved.info, scope: resolved.scope });
        const properties = await arrayHandle.internalGetProperties();
        arrayHandle.dispose();
        const targetContext = await resolved.frame.mainContext();
        const result2 = [];
        for (const property of properties.values()) {
          const elementHandle = property.asElement();
          if (elementHandle)
            result2.push(adoptIfNeeded(elementHandle, targetContext));
          else
            property.dispose();
        }
        return Promise.all(result2);
      }
      _jumpToAriaRefFrameIfNeeded(selector, info, frame) {
        if (info.parsed.parts[0].name !== "aria-ref")
          return frame;
        const body = info.parsed.parts[0].body;
        const match = body.match(/^f(\d+)e\d+$/);
        if (!match)
          return frame;
        const frameSeq = +match[1];
        const jumptToFrame = this.frame._page.frameManager.frames().find((frame2) => frame2.seq === frameSeq);
        if (!jumptToFrame)
          throw new InvalidSelectorError(`Invalid frame in aria-ref selector "${selector}"`);
        return jumptToFrame;
      }
      async resolveFrameForSelector(selector, options = {}, scope) {
        let frame = this.frame;
        const frameChunks = splitSelectorByFrame(selector);
        for (const chunk of frameChunks) {
          visitAllSelectorParts(chunk, (part, nested) => {
            if (nested && part.name === "internal:control" && part.body === "enter-frame") {
              const locator2 = asLocator(this.frame._page.browserContext._browser.sdkLanguage(), selector);
              throw new InvalidSelectorError(`Frame locators are not allowed inside composite locators, while querying "${locator2}"`);
            }
          });
        }
        for (let i = 0; i < frameChunks.length - 1; ++i) {
          const info = this._parseSelector(frameChunks[i], options);
          frame = this._jumpToAriaRefFrameIfNeeded(selector, info, frame);
          const context2 = await frame.context(info.world);
          const injectedScript = await context2.injectedScript();
          const handle = await injectedScript.evaluateHandle((injected, { info: info2, scope: scope2, selectorString }) => {
            const element3 = injected.querySelector(info2.parsed, scope2 || document, info2.strict);
            if (element3 && element3.nodeName !== "IFRAME" && element3.nodeName !== "FRAME")
              throw injected.createStacklessError(`Selector "${selectorString}" resolved to ${injected.previewNode(element3)}, <iframe> was expected`);
            return element3;
          }, { info, scope: i === 0 ? scope : void 0, selectorString: stringifySelector(info.parsed) });
          const element2 = handle.asElement();
          if (!element2)
            return null;
          const maybeFrame = await frame._page.delegate.getContentFrame(element2);
          element2.dispose();
          if (!maybeFrame)
            return null;
          frame = maybeFrame;
        }
        if (frame !== this.frame)
          scope = void 0;
        const lastChunk = frame.selectors._parseSelector(frameChunks[frameChunks.length - 1], options);
        frame = this._jumpToAriaRefFrameIfNeeded(selector, lastChunk, frame);
        return { frame, info: lastChunk, scope };
      }
      async resolveInjectedForSelector(selector, options, scope) {
        const resolved = await this.resolveFrameForSelector(selector, options, scope);
        if (!resolved)
          return;
        const context2 = await resolved.frame.context(options?.mainWorld ? "main" : resolved.info.world);
        const injected = await context2.injectedScript();
        return { injected, info: resolved.info, frame: resolved.frame, scope: resolved.scope };
      }
    };
  }
});

// packages/playwright-core/src/server/helper.ts
var MAX_LOG_LENGTH, Helper, helper;
var init_helper = __esm({
  "packages/playwright-core/src/server/helper.ts"() {
    "use strict";
    init_debugLogger();
    init_eventsHelper();
    MAX_LOG_LENGTH = process.env.MAX_LOG_LENGTH ? +process.env.MAX_LOG_LENGTH : Infinity;
    Helper = class {
      static completeUserURL(urlString) {
        if (urlString.startsWith("localhost") || urlString.startsWith("127.0.0.1"))
          urlString = "http://" + urlString;
        return urlString;
      }
      static enclosingIntRect(rect) {
        const x = Math.floor(rect.x + 1e-3);
        const y = Math.floor(rect.y + 1e-3);
        const x2 = Math.ceil(rect.x + rect.width - 1e-3);
        const y2 = Math.ceil(rect.y + rect.height - 1e-3);
        return { x, y, width: x2 - x, height: y2 - y };
      }
      static enclosingIntSize(size) {
        return { width: Math.floor(size.width + 1e-3), height: Math.floor(size.height + 1e-3) };
      }
      static getViewportSizeFromWindowFeatures(features) {
        const widthString = features.find((f) => f.startsWith("width="));
        const heightString = features.find((f) => f.startsWith("height="));
        const width = widthString ? parseInt(widthString.substring(6), 10) : NaN;
        const height = heightString ? parseInt(heightString.substring(7), 10) : NaN;
        if (!Number.isNaN(width) && !Number.isNaN(height))
          return { width, height };
        return null;
      }
      static waitForEvent(progress2, emitter, event, predicate) {
        const listeners = [];
        const dispose = () => eventsHelper.removeEventListeners(listeners);
        const promise = progress2.race(new Promise((resolve, reject) => {
          listeners.push(eventsHelper.addEventListener(emitter, event, (eventArg) => {
            try {
              if (predicate && !predicate(eventArg))
                return;
              resolve(eventArg);
            } catch (e) {
              reject(e);
            }
          }));
        })).finally(() => dispose());
        return { promise, dispose };
      }
      static secondsToRoundishMillis(value2) {
        return (value2 * 1e6 | 0) / 1e3;
      }
      static millisToRoundishMillis(value2) {
        return (value2 * 1e3 | 0) / 1e3;
      }
      static debugProtocolLogger(protocolLogger) {
        return (direction, message) => {
          if (protocolLogger)
            protocolLogger(direction, message);
          if (debugLogger.isEnabled("protocol")) {
            let text2 = JSON.stringify(message);
            if (text2.length > MAX_LOG_LENGTH)
              text2 = text2.substring(0, MAX_LOG_LENGTH / 2) + " <<<<<( LOG TRUNCATED )>>>>> " + text2.substring(text2.length - MAX_LOG_LENGTH / 2);
            debugLogger.log("protocol", (direction === "send" ? "SEND \u25BA " : "\u25C0 RECV ") + text2);
          }
        };
      }
      static formatBrowserLogs(logs, disconnectReason) {
        if (!disconnectReason && !logs.length)
          return "";
        return "\n" + (disconnectReason ? disconnectReason + "\n" : "") + logs.join("\n");
      }
    };
    helper = Helper;
  }
});

// packages/playwright-core/src/server/disposable.ts
async function disposeAll2(disposables) {
  const copy = [...disposables];
  disposables.length = 0;
  await Promise.all(copy.map((d) => d.dispose()));
}
var DisposableObject;
var init_disposable2 = __esm({
  "packages/playwright-core/src/server/disposable.ts"() {
    "use strict";
    init_instrumentation();
    DisposableObject = class extends SdkObject {
      constructor(parent) {
        super(parent, "disposable");
        this.parent = parent;
      }
    };
  }
});

// packages/playwright-core/src/server/console.ts
var ConsoleMessage;
var init_console = __esm({
  "packages/playwright-core/src/server/console.ts"() {
    "use strict";
    ConsoleMessage = class {
      constructor(page, worker, type3, text2, args, location2, timestamp) {
        this._page = page;
        this._worker = worker;
        this._type = type3;
        this._text = text2;
        this._args = args;
        this._location = location2 || { url: "", lineNumber: 0, columnNumber: 0 };
        this._timestamp = timestamp;
      }
      page() {
        return this._page;
      }
      worker() {
        return this._worker;
      }
      type() {
        return this._type;
      }
      text() {
        if (this._text === void 0)
          this._text = this._args.map((arg) => arg.preview()).join(" ");
        return this._text;
      }
      args() {
        return this._args;
      }
      location() {
        return this._location;
      }
      timestamp() {
        return this._timestamp;
      }
    };
  }
});

// packages/playwright-core/src/server/fileChooser.ts
var FileChooser;
var init_fileChooser = __esm({
  "packages/playwright-core/src/server/fileChooser.ts"() {
    "use strict";
    FileChooser = class {
      constructor(elementHandle, isMultiple) {
        this._elementHandle = elementHandle;
        this._isMultiple = isMultiple;
      }
      element() {
        return this._elementHandle;
      }
      isMultiple() {
        return this._isMultiple;
      }
    };
  }
});

// packages/playwright-core/src/server/usKeyboardLayout.ts
var keypadLocation, USKeyboardLayout;
var init_usKeyboardLayout = __esm({
  "packages/playwright-core/src/server/usKeyboardLayout.ts"() {
    "use strict";
    keypadLocation = 3;
    USKeyboardLayout = {
      // Functions row
      "Escape": { "keyCode": 27, "key": "Escape" },
      "F1": { "keyCode": 112, "key": "F1" },
      "F2": { "keyCode": 113, "key": "F2" },
      "F3": { "keyCode": 114, "key": "F3" },
      "F4": { "keyCode": 115, "key": "F4" },
      "F5": { "keyCode": 116, "key": "F5" },
      "F6": { "keyCode": 117, "key": "F6" },
      "F7": { "keyCode": 118, "key": "F7" },
      "F8": { "keyCode": 119, "key": "F8" },
      "F9": { "keyCode": 120, "key": "F9" },
      "F10": { "keyCode": 121, "key": "F10" },
      "F11": { "keyCode": 122, "key": "F11" },
      "F12": { "keyCode": 123, "key": "F12" },
      // Numbers row
      "Backquote": { "keyCode": 192, "shiftKey": "~", "key": "`" },
      "Digit1": { "keyCode": 49, "shiftKey": "!", "key": "1" },
      "Digit2": { "keyCode": 50, "shiftKey": "@", "key": "2" },
      "Digit3": { "keyCode": 51, "shiftKey": "#", "key": "3" },
      "Digit4": { "keyCode": 52, "shiftKey": "$", "key": "4" },
      "Digit5": { "keyCode": 53, "shiftKey": "%", "key": "5" },
      "Digit6": { "keyCode": 54, "shiftKey": "^", "key": "6" },
      "Digit7": { "keyCode": 55, "shiftKey": "&", "key": "7" },
      "Digit8": { "keyCode": 56, "shiftKey": "*", "key": "8" },
      "Digit9": { "keyCode": 57, "shiftKey": "(", "key": "9" },
      "Digit0": { "keyCode": 48, "shiftKey": ")", "key": "0" },
      "Minus": { "keyCode": 189, "shiftKey": "_", "key": "-" },
      "Equal": { "keyCode": 187, "shiftKey": "+", "key": "=" },
      "Backslash": { "keyCode": 220, "shiftKey": "|", "key": "\\" },
      "Backspace": { "keyCode": 8, "key": "Backspace" },
      // First row
      "Tab": { "keyCode": 9, "key": "Tab" },
      "KeyQ": { "keyCode": 81, "shiftKey": "Q", "key": "q" },
      "KeyW": { "keyCode": 87, "shiftKey": "W", "key": "w" },
      "KeyE": { "keyCode": 69, "shiftKey": "E", "key": "e" },
      "KeyR": { "keyCode": 82, "shiftKey": "R", "key": "r" },
      "KeyT": { "keyCode": 84, "shiftKey": "T", "key": "t" },
      "KeyY": { "keyCode": 89, "shiftKey": "Y", "key": "y" },
      "KeyU": { "keyCode": 85, "shiftKey": "U", "key": "u" },
      "KeyI": { "keyCode": 73, "shiftKey": "I", "key": "i" },
      "KeyO": { "keyCode": 79, "shiftKey": "O", "key": "o" },
      "KeyP": { "keyCode": 80, "shiftKey": "P", "key": "p" },
      "BracketLeft": { "keyCode": 219, "shiftKey": "{", "key": "[" },
      "BracketRight": { "keyCode": 221, "shiftKey": "}", "key": "]" },
      // Second row
      "CapsLock": { "keyCode": 20, "key": "CapsLock" },
      "KeyA": { "keyCode": 65, "shiftKey": "A", "key": "a" },
      "KeyS": { "keyCode": 83, "shiftKey": "S", "key": "s" },
      "KeyD": { "keyCode": 68, "shiftKey": "D", "key": "d" },
      "KeyF": { "keyCode": 70, "shiftKey": "F", "key": "f" },
      "KeyG": { "keyCode": 71, "shiftKey": "G", "key": "g" },
      "KeyH": { "keyCode": 72, "shiftKey": "H", "key": "h" },
      "KeyJ": { "keyCode": 74, "shiftKey": "J", "key": "j" },
      "KeyK": { "keyCode": 75, "shiftKey": "K", "key": "k" },
      "KeyL": { "keyCode": 76, "shiftKey": "L", "key": "l" },
      "Semicolon": { "keyCode": 186, "shiftKey": ":", "key": ";" },
      "Quote": { "keyCode": 222, "shiftKey": '"', "key": "'" },
      "Enter": { "keyCode": 13, "key": "Enter", "text": "\r" },
      // Third row
      "ShiftLeft": { "keyCode": 160, "keyCodeWithoutLocation": 16, "key": "Shift", "location": 1 },
      "KeyZ": { "keyCode": 90, "shiftKey": "Z", "key": "z" },
      "KeyX": { "keyCode": 88, "shiftKey": "X", "key": "x" },
      "KeyC": { "keyCode": 67, "shiftKey": "C", "key": "c" },
      "KeyV": { "keyCode": 86, "shiftKey": "V", "key": "v" },
      "KeyB": { "keyCode": 66, "shiftKey": "B", "key": "b" },
      "KeyN": { "keyCode": 78, "shiftKey": "N", "key": "n" },
      "KeyM": { "keyCode": 77, "shiftKey": "M", "key": "m" },
      "Comma": { "keyCode": 188, "shiftKey": "<", "key": "," },
      "Period": { "keyCode": 190, "shiftKey": ">", "key": "." },
      "Slash": { "keyCode": 191, "shiftKey": "?", "key": "/" },
      "ShiftRight": { "keyCode": 161, "keyCodeWithoutLocation": 16, "key": "Shift", "location": 2 },
      // Last row
      "ControlLeft": { "keyCode": 162, "keyCodeWithoutLocation": 17, "key": "Control", "location": 1 },
      "MetaLeft": { "keyCode": 91, "key": "Meta", "location": 1 },
      "AltLeft": { "keyCode": 164, "keyCodeWithoutLocation": 18, "key": "Alt", "location": 1 },
      "Space": { "keyCode": 32, "key": " " },
      "AltRight": { "keyCode": 165, "keyCodeWithoutLocation": 18, "key": "Alt", "location": 2 },
      "AltGraph": { "keyCode": 225, "key": "AltGraph" },
      "MetaRight": { "keyCode": 92, "key": "Meta", "location": 2 },
      "ContextMenu": { "keyCode": 93, "key": "ContextMenu" },
      "ControlRight": { "keyCode": 163, "keyCodeWithoutLocation": 17, "key": "Control", "location": 2 },
      // Center block
      "PrintScreen": { "keyCode": 44, "key": "PrintScreen" },
      "ScrollLock": { "keyCode": 145, "key": "ScrollLock" },
      "Pause": { "keyCode": 19, "key": "Pause" },
      "PageUp": { "keyCode": 33, "key": "PageUp" },
      "PageDown": { "keyCode": 34, "key": "PageDown" },
      "Insert": { "keyCode": 45, "key": "Insert" },
      "Delete": { "keyCode": 46, "key": "Delete" },
      "Home": { "keyCode": 36, "key": "Home" },
      "End": { "keyCode": 35, "key": "End" },
      "ArrowLeft": { "keyCode": 37, "key": "ArrowLeft" },
      "ArrowUp": { "keyCode": 38, "key": "ArrowUp" },
      "ArrowRight": { "keyCode": 39, "key": "ArrowRight" },
      "ArrowDown": { "keyCode": 40, "key": "ArrowDown" },
      // Media keys
      "AudioVolumeMute": { "keyCode": 173, "key": "AudioVolumeMute" },
      "AudioVolumeDown": { "keyCode": 174, "key": "AudioVolumeDown" },
      "AudioVolumeUp": { "keyCode": 175, "key": "AudioVolumeUp" },
      "MediaTrackNext": { "keyCode": 176, "key": "MediaTrackNext" },
      "MediaTrackPrevious": { "keyCode": 177, "key": "MediaTrackPrevious" },
      "MediaPlayPause": { "keyCode": 179, "key": "MediaPlayPause" },
      // Numpad
      "NumLock": { "keyCode": 144, "key": "NumLock" },
      "NumpadDivide": { "keyCode": 111, "key": "/", "location": 3 },
      "NumpadMultiply": { "keyCode": 106, "key": "*", "location": 3 },
      "NumpadSubtract": { "keyCode": 109, "key": "-", "location": 3 },
      "Numpad7": { "keyCode": 36, "shiftKeyCode": 103, "key": "Home", "shiftKey": "7", "location": 3 },
      "Numpad8": { "keyCode": 38, "shiftKeyCode": 104, "key": "ArrowUp", "shiftKey": "8", "location": 3 },
      "Numpad9": { "keyCode": 33, "shiftKeyCode": 105, "key": "PageUp", "shiftKey": "9", "location": 3 },
      "Numpad4": { "keyCode": 37, "shiftKeyCode": 100, "key": "ArrowLeft", "shiftKey": "4", "location": 3 },
      "Numpad5": { "keyCode": 12, "shiftKeyCode": 101, "key": "Clear", "shiftKey": "5", "location": 3 },
      "Numpad6": { "keyCode": 39, "shiftKeyCode": 102, "key": "ArrowRight", "shiftKey": "6", "location": 3 },
      "NumpadAdd": { "keyCode": 107, "key": "+", "location": 3 },
      "Numpad1": { "keyCode": 35, "shiftKeyCode": 97, "key": "End", "shiftKey": "1", "location": 3 },
      "Numpad2": { "keyCode": 40, "shiftKeyCode": 98, "key": "ArrowDown", "shiftKey": "2", "location": 3 },
      "Numpad3": { "keyCode": 34, "shiftKeyCode": 99, "key": "PageDown", "shiftKey": "3", "location": 3 },
      "Numpad0": { "keyCode": 45, "shiftKeyCode": 96, "key": "Insert", "shiftKey": "0", "location": 3 },
      "NumpadDecimal": { "keyCode": 46, "shiftKeyCode": 110, "key": "\0", "shiftKey": ".", "location": 3 },
      "NumpadEnter": { "keyCode": 13, "key": "Enter", "text": "\r", "location": 3 }
    };
  }
});

// packages/playwright-core/src/server/input.ts
function resolveSmartModifierString(key) {
  if (key === "ControlOrMeta")
    return process.platform === "darwin" ? "Meta" : "Control";
  return key;
}
function resolveSmartModifier(m) {
  return resolveSmartModifierString(m);
}
function buildLayoutClosure(layout) {
  const result2 = /* @__PURE__ */ new Map();
  for (const code in layout) {
    const definition = layout[code];
    const description = {
      key: definition.key || "",
      keyCode: definition.keyCode || 0,
      keyCodeWithoutLocation: definition.keyCodeWithoutLocation || definition.keyCode || 0,
      code,
      text: definition.text || "",
      location: definition.location || 0
    };
    if (definition.key.length === 1)
      description.text = description.key;
    let shiftedDescription;
    if (definition.shiftKey) {
      assert(definition.shiftKey.length === 1);
      shiftedDescription = { ...description };
      shiftedDescription.key = definition.shiftKey;
      shiftedDescription.text = definition.shiftKey;
      if (definition.shiftKeyCode)
        shiftedDescription.keyCode = definition.shiftKeyCode;
    }
    result2.set(code, { ...description, shifted: shiftedDescription });
    if (aliases.has(code)) {
      for (const alias of aliases.get(code))
        result2.set(alias, description);
    }
    if (definition.location)
      continue;
    if (description.key.length === 1)
      result2.set(description.key, description);
    if (shiftedDescription)
      result2.set(shiftedDescription.key, { ...shiftedDescription, shifted: void 0 });
  }
  return result2;
}
var keypadLocation2, kModifiers, Keyboard, Mouse, aliases, usKeyboardLayout, Touchscreen;
var init_input = __esm({
  "packages/playwright-core/src/server/input.ts"() {
    "use strict";
    init_assert();
    init_usKeyboardLayout();
    init_dom();
    keypadLocation2 = keypadLocation;
    kModifiers = ["Alt", "Control", "Meta", "Shift"];
    Keyboard = class {
      constructor(raw, page) {
        this._pressedModifiers = /* @__PURE__ */ new Set();
        this._pressedKeys = /* @__PURE__ */ new Set();
        this._raw = raw;
        this._page = page;
      }
      async apiDown(progress2, key) {
        await progress2.race(this._page.instrumentation.onBeforeInputAction(this._page, progress2.metadata));
        await this.down(progress2, key);
      }
      async down(progress2, key) {
        const description = this._keyDescriptionForString(key);
        const autoRepeat = this._pressedKeys.has(description.code);
        this._pressedKeys.add(description.code);
        if (kModifiers.includes(description.key))
          this._pressedModifiers.add(description.key);
        await this._raw.keydown(progress2, this._pressedModifiers, key, description, autoRepeat);
      }
      _keyDescriptionForString(str) {
        const keyString = resolveSmartModifierString(str);
        let description = usKeyboardLayout.get(keyString);
        if (!description)
          throw new NonRecoverableDOMError(`Unknown key: "${keyString}"`);
        const shift = this._pressedModifiers.has("Shift");
        description = shift && description.shifted ? description.shifted : description;
        if (this._pressedModifiers.size > 1 || !this._pressedModifiers.has("Shift") && this._pressedModifiers.size === 1)
          return { ...description, text: "" };
        return description;
      }
      async apiUp(progress2, key) {
        await progress2.race(this._page.instrumentation.onBeforeInputAction(this._page, progress2.metadata));
        await this.up(progress2, key);
      }
      async up(progress2, key) {
        const description = this._keyDescriptionForString(key);
        if (kModifiers.includes(description.key))
          this._pressedModifiers.delete(description.key);
        this._pressedKeys.delete(description.code);
        await this._raw.keyup(progress2, this._pressedModifiers, key, description);
      }
      async apiInsertText(progress2, text2) {
        await progress2.race(this._page.instrumentation.onBeforeInputAction(this._page, progress2.metadata));
        await this.insertText(progress2, text2);
      }
      async insertText(progress2, text2) {
        await this._raw.sendText(progress2, text2);
      }
      async apiType(progress2, text2, options) {
        await progress2.race(this._page.instrumentation.onBeforeInputAction(this._page, progress2.metadata));
        await this.type(progress2, text2, options);
      }
      async type(progress2, text2, options) {
        const delay = options && options.delay || void 0;
        for (const char of text2) {
          if (usKeyboardLayout.has(char)) {
            await this.press(progress2, char, { delay });
          } else {
            if (delay)
              await progress2.wait(delay);
            await this.insertText(progress2, char);
          }
        }
      }
      async apiPress(progress2, key, options = {}) {
        await progress2.race(this._page.instrumentation.onBeforeInputAction(this._page, progress2.metadata));
        await this.press(progress2, key, options);
      }
      async press(progress2, key, options = {}) {
        function split(keyString) {
          const keys = [];
          let building = "";
          for (const char of keyString) {
            if (char === "+" && building) {
              keys.push(building);
              building = "";
            } else {
              building += char;
            }
          }
          keys.push(building);
          return keys;
        }
        const tokens = split(key);
        key = tokens[tokens.length - 1];
        for (let i = 0; i < tokens.length - 1; ++i)
          await this.down(progress2, tokens[i]);
        await this.down(progress2, key);
        if (options.delay)
          await progress2.wait(options.delay);
        await this.up(progress2, key);
        for (let i = tokens.length - 2; i >= 0; --i)
          await this.up(progress2, tokens[i]);
      }
      async ensureModifiers(progress2, mm) {
        const modifiers = mm.map(resolveSmartModifier);
        for (const modifier of modifiers) {
          if (!kModifiers.includes(modifier))
            throw new Error("Unknown modifier " + modifier);
        }
        const restore = Array.from(this._pressedModifiers);
        for (const key of kModifiers) {
          const needDown = modifiers.includes(key);
          const isDown = this._pressedModifiers.has(key);
          if (needDown && !isDown)
            await this.down(progress2, key);
          else if (!needDown && isDown)
            await this.up(progress2, key);
        }
        return restore;
      }
      _modifiers() {
        return this._pressedModifiers;
      }
    };
    Mouse = class {
      constructor(raw, page) {
        this._x = 0;
        this._y = 0;
        this._lastButton = "none";
        this._buttons = /* @__PURE__ */ new Set();
        this._raw = raw;
        this._page = page;
        this._keyboard = this._page.keyboard;
      }
      _currentPoint() {
        return { x: this._x, y: this._y };
      }
      async apiMove(progress2, x, y, options = {}) {
        await progress2.race(this._page.instrumentation.onBeforeInputAction(this._page, progress2.metadata, { x, y }));
        await this.move(progress2, x, y, options);
      }
      async move(progress2, x, y, options = {}) {
        const { steps = 1 } = options;
        const fromX = this._x;
        const fromY = this._y;
        this._x = x;
        this._y = y;
        for (let i = 1; i <= steps; i++) {
          const middleX = fromX + (x - fromX) * (i / steps);
          const middleY = fromY + (y - fromY) * (i / steps);
          await this._raw.move(progress2, middleX, middleY, this._lastButton, this._buttons, this._keyboard._modifiers(), !!options.forClick);
        }
      }
      async apiDown(progress2, options = {}) {
        await progress2.race(this._page.instrumentation.onBeforeInputAction(this._page, progress2.metadata, this._currentPoint()));
        await this.down(progress2, options);
      }
      async down(progress2, options = {}) {
        const { button = "left", clickCount = 1 } = options;
        this._lastButton = button;
        this._buttons.add(button);
        await this._raw.down(progress2, this._x, this._y, this._lastButton, this._buttons, this._keyboard._modifiers(), clickCount);
      }
      async apiUp(progress2, options = {}) {
        await progress2.race(this._page.instrumentation.onBeforeInputAction(this._page, progress2.metadata, this._currentPoint()));
        await this.up(progress2, options);
      }
      async up(progress2, options = {}) {
        const { button = "left", clickCount = 1 } = options;
        this._lastButton = "none";
        this._buttons.delete(button);
        await this._raw.up(progress2, this._x, this._y, button, this._buttons, this._keyboard._modifiers(), clickCount);
      }
      async apiClick(progress2, x, y, options = {}) {
        await progress2.race(this._page.instrumentation.onBeforeInputAction(this._page, progress2.metadata, { x, y }));
        await this.click(progress2, x, y, options);
      }
      async click(progress2, x, y, options = {}) {
        const { delay = null, clickCount = 1, steps } = options;
        if (delay) {
          await this.move(progress2, x, y, { forClick: true, steps });
          for (let cc = 1; cc <= clickCount; ++cc) {
            await this.down(progress2, { ...options, clickCount: cc });
            await progress2.wait(delay);
            await this.up(progress2, { ...options, clickCount: cc });
            if (cc < clickCount)
              await progress2.wait(delay);
          }
        } else {
          progress2.setAllowConcurrentOrNestedRaces(true);
          const promises = [];
          const movePromise = this.move(progress2, x, y, { forClick: true, steps });
          if (steps !== void 0 && steps > 1)
            await movePromise;
          else
            promises.push(movePromise);
          for (let cc = 1; cc <= clickCount; ++cc) {
            promises.push(this.down(progress2, { ...options, clickCount: cc }));
            promises.push(this.up(progress2, { ...options, clickCount: cc }));
          }
          await Promise.all(promises);
          progress2.setAllowConcurrentOrNestedRaces(false);
        }
      }
      async apiWheel(progress2, deltaX, deltaY) {
        await progress2.race(this._page.instrumentation.onBeforeInputAction(this._page, progress2.metadata));
        await this._raw.wheel(progress2, this._x, this._y, this._buttons, this._keyboard._modifiers(), deltaX, deltaY);
      }
    };
    aliases = /* @__PURE__ */ new Map([
      ["ShiftLeft", ["Shift"]],
      ["ControlLeft", ["Control"]],
      ["AltLeft", ["Alt"]],
      ["MetaLeft", ["Meta"]],
      ["Enter", ["\n", "\r"]]
    ]);
    usKeyboardLayout = buildLayoutClosure(USKeyboardLayout);
    Touchscreen = class {
      constructor(raw, page) {
        this._raw = raw;
        this._page = page;
      }
      async apiTap(progress2, x, y) {
        if (!this._page.browserContext._options.hasTouch)
          throw new Error("hasTouch must be enabled on the browser context before using the touchscreen.");
        await progress2.race(this._page.instrumentation.onBeforeInputAction(this._page, progress2.metadata, { x, y }));
        await this.tap(progress2, x, y);
      }
      async tap(progress2, x, y) {
        await this._raw.tap(progress2, x, y, this._page.keyboard._modifiers());
      }
    };
  }
});

// packages/playwright-core/src/server/screenshotter.ts
function inPagePrepareForScreenshots(screenshotStyle, hideCaret, disableAnimations, syncAnimations) {
  if (syncAnimations) {
    const style = document.createElement("style");
    style.textContent = "body {}";
    document.head.appendChild(style);
    document.documentElement.getBoundingClientRect();
    style.remove();
  }
  if (!screenshotStyle && !hideCaret && !disableAnimations)
    return;
  const collectRoots = (root, roots2 = []) => {
    roots2.push(root);
    const walker = document.createTreeWalker(root, NodeFilter.SHOW_ELEMENT);
    do {
      const node = walker.currentNode;
      const shadowRoot = node instanceof Element ? node.shadowRoot : null;
      if (shadowRoot)
        collectRoots(shadowRoot, roots2);
    } while (walker.nextNode());
    return roots2;
  };
  const roots = collectRoots(document);
  const cleanupCallbacks = [];
  if (screenshotStyle) {
    for (const root of roots) {
      const styleTag = document.createElement("style");
      styleTag.textContent = screenshotStyle;
      if (root === document)
        document.documentElement.append(styleTag);
      else
        root.append(styleTag);
      cleanupCallbacks.push(() => {
        styleTag.remove();
      });
    }
  }
  if (hideCaret) {
    const elements = /* @__PURE__ */ new Map();
    for (const root of roots) {
      root.querySelectorAll("input,textarea,[contenteditable]").forEach((element2) => {
        elements.set(element2, {
          value: element2.style.getPropertyValue("caret-color"),
          priority: element2.style.getPropertyPriority("caret-color")
        });
        element2.style.setProperty("caret-color", "transparent", "important");
      });
    }
    cleanupCallbacks.push(() => {
      for (const [element2, value2] of elements)
        element2.style.setProperty("caret-color", value2.value, value2.priority);
    });
  }
  if (disableAnimations) {
    const infiniteAnimationsToResume = /* @__PURE__ */ new Set();
    const handleAnimations = (root) => {
      for (const animation of root.getAnimations()) {
        if (!animation.effect || animation.playbackRate === 0 || infiniteAnimationsToResume.has(animation))
          continue;
        const endTime = animation.effect.getComputedTiming().endTime;
        if (Number.isFinite(endTime)) {
          try {
            animation.finish();
          } catch (e) {
          }
        } else {
          try {
            animation.cancel();
            infiniteAnimationsToResume.add(animation);
          } catch (e) {
          }
        }
      }
    };
    for (const root of roots) {
      const handleRootAnimations = handleAnimations.bind(null, root);
      handleRootAnimations();
      root.addEventListener("transitionrun", handleRootAnimations);
      root.addEventListener("animationstart", handleRootAnimations);
      cleanupCallbacks.push(() => {
        root.removeEventListener("transitionrun", handleRootAnimations);
        root.removeEventListener("animationstart", handleRootAnimations);
      });
    }
    cleanupCallbacks.push(() => {
      for (const animation of infiniteAnimationsToResume) {
        try {
          animation.play();
        } catch (e) {
        }
      }
    });
  }
  window.__pwCleanupScreenshot = () => {
    for (const cleanupCallback of cleanupCallbacks)
      cleanupCallback();
    delete window.__pwCleanupScreenshot;
  };
}
function trimClipToSize(clip, size) {
  const p1 = {
    x: Math.max(0, Math.min(clip.x, size.width)),
    y: Math.max(0, Math.min(clip.y, size.height))
  };
  const p2 = {
    x: Math.max(0, Math.min(clip.x + clip.width, size.width)),
    y: Math.max(0, Math.min(clip.y + clip.height, size.height))
  };
  const result2 = { x: p1.x, y: p1.y, width: p2.x - p1.x, height: p2.y - p1.y };
  assert(result2.width && result2.height, "Clipped area is either empty or outside the resulting image");
  return result2;
}
function validateScreenshotOptions(options) {
  let format2 = null;
  if (options.type) {
    assert(options.type === "png" || options.type === "jpeg", "Unknown options.type value: " + options.type);
    format2 = options.type;
  }
  if (!format2)
    format2 = "png";
  if (options.quality !== void 0) {
    assert(format2 === "jpeg", "options.quality is unsupported for the " + format2 + " screenshots");
    assert(typeof options.quality === "number", "Expected options.quality to be a number but found " + typeof options.quality);
    assert(Number.isInteger(options.quality), "Expected options.quality to be an integer");
    assert(options.quality >= 0 && options.quality <= 100, "Expected options.quality to be between 0 and 100 (inclusive), got " + options.quality);
  }
  if (options.clip) {
    assert(typeof options.clip.x === "number", "Expected options.clip.x to be a number but found " + typeof options.clip.x);
    assert(typeof options.clip.y === "number", "Expected options.clip.y to be a number but found " + typeof options.clip.y);
    assert(typeof options.clip.width === "number", "Expected options.clip.width to be a number but found " + typeof options.clip.width);
    assert(typeof options.clip.height === "number", "Expected options.clip.height to be a number but found " + typeof options.clip.height);
    assert(options.clip.width !== 0, "Expected options.clip.width not to be 0.");
    assert(options.clip.height !== 0, "Expected options.clip.height not to be 0.");
  }
  return format2;
}
var Screenshotter, TaskQueue;
var init_screenshotter = __esm({
  "packages/playwright-core/src/server/screenshotter.ts"() {
    "use strict";
    init_multimap();
    init_assert();
    init_helper();
    Screenshotter = class {
      constructor(page) {
        this._queue = new TaskQueue();
        this._page = page;
        this._queue = new TaskQueue();
      }
      async _originalViewportSize(progress2) {
        let viewportSize = this._page.emulatedSize()?.viewport;
        if (!viewportSize)
          viewportSize = await this._page.mainFrame().waitForFunctionValueInUtility(progress2, () => ({ width: window.innerWidth, height: window.innerHeight }));
        return viewportSize;
      }
      async _fullPageSize(progress2) {
        const fullPageSize = await this._page.mainFrame().waitForFunctionValueInUtility(progress2, () => {
          if (!document.body || !document.documentElement)
            return null;
          return {
            width: Math.max(
              document.body.scrollWidth,
              document.documentElement.scrollWidth,
              document.body.offsetWidth,
              document.documentElement.offsetWidth,
              document.body.clientWidth,
              document.documentElement.clientWidth
            ),
            height: Math.max(
              document.body.scrollHeight,
              document.documentElement.scrollHeight,
              document.body.offsetHeight,
              document.documentElement.offsetHeight,
              document.body.clientHeight,
              document.documentElement.clientHeight
            )
          };
        });
        return fullPageSize;
      }
      async screenshotPage(progress2, options) {
        const format2 = validateScreenshotOptions(options);
        return this._queue._postTask(async () => {
          progress2.log("taking page screenshot");
          const viewportSize = await this._originalViewportSize(progress2);
          await this._preparePageForScreenshot(progress2, this._page.mainFrame(), options.style, options.caret !== "initial", options.animations === "disabled");
          try {
            if (options.fullPage) {
              const fullPageSize = await this._fullPageSize(progress2);
              let documentRect = { x: 0, y: 0, width: fullPageSize.width, height: fullPageSize.height };
              const fitsViewport = fullPageSize.width <= viewportSize.width && fullPageSize.height <= viewportSize.height;
              if (options.clip)
                documentRect = trimClipToSize(options.clip, documentRect);
              return await this._screenshot(progress2, format2, documentRect, void 0, fitsViewport, options);
            }
            const viewportRect = options.clip ? trimClipToSize(options.clip, viewportSize) : { x: 0, y: 0, ...viewportSize };
            return await this._screenshot(progress2, format2, void 0, viewportRect, true, options);
          } finally {
            await progress2.race(this._restorePageAfterScreenshot()).catch(() => {
            });
          }
        });
      }
      async screenshotElement(progress2, handle, options) {
        const format2 = validateScreenshotOptions(options);
        return this._queue._postTask(async () => {
          progress2.log("taking element screenshot");
          const viewportSize = await this._originalViewportSize(progress2);
          await this._preparePageForScreenshot(progress2, handle._frame, options.style, options.caret !== "initial", options.animations === "disabled");
          try {
            await handle._waitAndScrollIntoViewIfNeeded(
              progress2,
              true
              /* waitForVisible */
            );
            const boundingBox = await handle.boundingBox(progress2);
            assert(boundingBox, "Node is either not visible or not an HTMLElement");
            assert(boundingBox.width !== 0, "Node has 0 width.");
            assert(boundingBox.height !== 0, "Node has 0 height.");
            const fitsViewport = boundingBox.width <= viewportSize.width && boundingBox.height <= viewportSize.height;
            const scrollOffset = await this._page.mainFrame().waitForFunctionValueInUtility(progress2, () => ({ x: window.scrollX, y: window.scrollY }));
            const documentRect = { ...boundingBox };
            documentRect.x += scrollOffset.x;
            documentRect.y += scrollOffset.y;
            return await this._screenshot(progress2, format2, helper.enclosingIntRect(documentRect), void 0, fitsViewport, options);
          } finally {
            await progress2.race(this._restorePageAfterScreenshot()).catch(() => {
            });
          }
        });
      }
      async _preparePageForScreenshot(progress2, frame, screenshotStyle, hideCaret, disableAnimations) {
        if (disableAnimations)
          progress2.log("  disabled all CSS animations");
        const syncAnimations = this._page.delegate.shouldToggleStyleSheetToSyncAnimations();
        await progress2.race(this._page.safeNonStallingEvaluateInAllFrames("(" + inPagePrepareForScreenshots.toString() + `)(${JSON.stringify(screenshotStyle)}, ${hideCaret}, ${disableAnimations}, ${syncAnimations})`, "utility"));
        try {
          if (!process.env.PW_TEST_SCREENSHOT_NO_FONTS_READY) {
            progress2.log("waiting for fonts to load...");
            await progress2.race(frame.nonStallingEvaluateInExistingContext("document.fonts.ready", "utility").catch(() => {
            }));
            progress2.log("fonts loaded");
          }
        } catch (error) {
          await progress2.race(this._restorePageAfterScreenshot());
          throw error;
        }
      }
      async _restorePageAfterScreenshot() {
        await this._page.safeNonStallingEvaluateInAllFrames("window.__pwCleanupScreenshot && window.__pwCleanupScreenshot()", "utility");
      }
      async _maskElements(progress2, options) {
        if (!options.mask || !options.mask.length)
          return () => Promise.resolve();
        const framesToParsedSelectors = new MultiMap();
        await progress2.race(Promise.all((options.mask || []).map(async ({ frame, selector }) => {
          const pair = await frame.selectors.resolveFrameForSelector(selector);
          if (pair)
            framesToParsedSelectors.set(pair.frame, pair.info.parsed);
        })));
        const frames = [...framesToParsedSelectors.keys()];
        const cleanup = async () => {
          await Promise.all(frames.map((frame) => frame.hideHighlight()));
        };
        try {
          const promises = frames.map((frame) => frame.maskSelectors(framesToParsedSelectors.get(frame), options.maskColor || "#F0F"));
          await progress2.race(Promise.all(promises));
          return cleanup;
        } catch (error) {
          cleanup().catch(() => {
          });
          throw error;
        }
      }
      async _screenshot(progress2, format2, documentRect, viewportRect, fitsViewport, options) {
        if (options.__testHookBeforeScreenshot)
          await progress2.race(options.__testHookBeforeScreenshot());
        const shouldSetDefaultBackground = options.omitBackground && format2 === "png";
        if (shouldSetDefaultBackground)
          await progress2.race(this._page.delegate.setBackgroundColor({ r: 0, g: 0, b: 0, a: 0 }));
        const cleanupHighlight = await this._maskElements(progress2, options);
        try {
          const quality = format2 === "jpeg" ? options.quality ?? 80 : void 0;
          const buffer = await this._page.delegate.takeScreenshot(progress2, format2, documentRect, viewportRect, quality, fitsViewport, options.scale || "device");
          await progress2.race(cleanupHighlight());
          if (shouldSetDefaultBackground)
            await progress2.race(this._page.delegate.setBackgroundColor());
          if (options.__testHookAfterScreenshot)
            await progress2.race(options.__testHookAfterScreenshot());
          return buffer;
        } catch (error) {
          cleanupHighlight().catch(() => {
          });
          if (shouldSetDefaultBackground)
            this._page.delegate.setBackgroundColor().catch(() => {
            });
          throw error;
        }
      }
    };
    TaskQueue = class {
      constructor() {
        this._chain = Promise.resolve();
      }
      _postTask(task) {
        const result2 = this._chain.then(task);
        this._chain = result2.catch(() => {
        });
        return result2;
      }
    };
  }
});

// packages/playwright-core/src/generated/bindingsControllerSource.ts
var source5;
var init_bindingsControllerSource = __esm({
  "packages/playwright-core/src/generated/bindingsControllerSource.ts"() {
    "use strict";
    source5 = '\nvar __commonJS = obj => {\n  let required = false;\n  let result;\n  return function __require() {\n    if (!required) {\n      required = true;\n      let fn;\n      for (const name in obj) { fn = obj[name]; break; }\n      const module = { exports: {} };\n      fn(module.exports, module);\n      result = module.exports;\n    }\n    return result;\n  }\n};\nvar __export = (target, all) => {for (var name in all) target[name] = all[name];};\nvar __toESM = mod => ({ ...mod, \'default\': mod });\nvar __toCommonJS = mod => ({ ...mod, __esModule: true });\n\n\n// packages/injected/src/bindingsController.ts\nvar bindingsController_exports = {};\n__export(bindingsController_exports, {\n  BindingsController: () => BindingsController\n});\nmodule.exports = __toCommonJS(bindingsController_exports);\n\n// packages/isomorphic/utilityScriptSerializers.ts\nfunction isRegExp(obj) {\n  try {\n    return obj instanceof RegExp || Object.prototype.toString.call(obj) === "[object RegExp]";\n  } catch (error) {\n    return false;\n  }\n}\nfunction isDate(obj) {\n  try {\n    return obj instanceof Date || Object.prototype.toString.call(obj) === "[object Date]";\n  } catch (error) {\n    return false;\n  }\n}\nfunction isURL(obj) {\n  try {\n    return obj instanceof URL || Object.prototype.toString.call(obj) === "[object URL]";\n  } catch (error) {\n    return false;\n  }\n}\nfunction isError(obj) {\n  var _a;\n  try {\n    return obj instanceof Error || obj && ((_a = Object.getPrototypeOf(obj)) == null ? void 0 : _a.name) === "Error";\n  } catch (error) {\n    return false;\n  }\n}\nfunction isTypedArray(obj, constructor) {\n  try {\n    return obj instanceof constructor || Object.prototype.toString.call(obj) === `[object ${constructor.name}]`;\n  } catch (error) {\n    return false;\n  }\n}\nfunction isArrayBuffer(obj) {\n  try {\n    return obj instanceof ArrayBuffer || Object.prototype.toString.call(obj) === "[object ArrayBuffer]";\n  } catch (error) {\n    return false;\n  }\n}\nvar typedArrayConstructors = {\n  i8: Int8Array,\n  ui8: Uint8Array,\n  ui8c: Uint8ClampedArray,\n  i16: Int16Array,\n  ui16: Uint16Array,\n  i32: Int32Array,\n  ui32: Uint32Array,\n  // TODO: add Float16Array once it\'s in baseline\n  f32: Float32Array,\n  f64: Float64Array,\n  bi64: BigInt64Array,\n  bui64: BigUint64Array\n};\nfunction typedArrayToBase64(array) {\n  if ("toBase64" in array)\n    return array.toBase64();\n  const binary = Array.from(new Uint8Array(array.buffer, array.byteOffset, array.byteLength)).map((b) => String.fromCharCode(b)).join("");\n  return btoa(binary);\n}\nfunction serializeAsCallArgument(value, handleSerializer) {\n  return serialize(value, handleSerializer, { visited: /* @__PURE__ */ new Map(), lastId: 0 });\n}\nfunction serialize(value, handleSerializer, visitorInfo) {\n  if (value && typeof value === "object") {\n    if (typeof globalThis.Window === "function" && value instanceof globalThis.Window)\n      return "ref: <Window>";\n    if (typeof globalThis.Document === "function" && value instanceof globalThis.Document)\n      return "ref: <Document>";\n    if (typeof globalThis.Node === "function" && value instanceof globalThis.Node)\n      return "ref: <Node>";\n  }\n  return innerSerialize(value, handleSerializer, visitorInfo);\n}\nfunction innerSerialize(value, handleSerializer, visitorInfo) {\n  var _a;\n  const result = handleSerializer(value);\n  if ("fallThrough" in result)\n    value = result.fallThrough;\n  else\n    return result;\n  if (typeof value === "symbol")\n    return { v: "undefined" };\n  if (Object.is(value, void 0))\n    return { v: "undefined" };\n  if (Object.is(value, null))\n    return { v: "null" };\n  if (Object.is(value, NaN))\n    return { v: "NaN" };\n  if (Object.is(value, Infinity))\n    return { v: "Infinity" };\n  if (Object.is(value, -Infinity))\n    return { v: "-Infinity" };\n  if (Object.is(value, -0))\n    return { v: "-0" };\n  if (typeof value === "boolean")\n    return value;\n  if (typeof value === "number")\n    return value;\n  if (typeof value === "string")\n    return value;\n  if (typeof value === "bigint")\n    return { bi: value.toString() };\n  if (isError(value)) {\n    let stack;\n    if ((_a = value.stack) == null ? void 0 : _a.startsWith(value.name + ": " + value.message)) {\n      stack = value.stack;\n    } else {\n      stack = `${value.name}: ${value.message}\n${value.stack}`;\n    }\n    return { e: { n: value.name, m: value.message, s: stack } };\n  }\n  if (isDate(value))\n    return { d: value.toJSON() };\n  if (isURL(value))\n    return { u: value.toJSON() };\n  if (isRegExp(value))\n    return { r: { p: value.source, f: value.flags } };\n  for (const [k, ctor] of Object.entries(typedArrayConstructors)) {\n    if (isTypedArray(value, ctor))\n      return { ta: { b: typedArrayToBase64(value), k } };\n  }\n  if (isArrayBuffer(value))\n    return { ab: { b: typedArrayToBase64(new Uint8Array(value)) } };\n  const id = visitorInfo.visited.get(value);\n  if (id)\n    return { ref: id };\n  if (Array.isArray(value)) {\n    const a = [];\n    const id2 = ++visitorInfo.lastId;\n    visitorInfo.visited.set(value, id2);\n    for (let i = 0; i < value.length; ++i)\n      a.push(serialize(value[i], handleSerializer, visitorInfo));\n    return { a, id: id2 };\n  }\n  if (typeof value === "object") {\n    const o = [];\n    const id2 = ++visitorInfo.lastId;\n    visitorInfo.visited.set(value, id2);\n    for (const name of Object.keys(value)) {\n      let item;\n      try {\n        item = value[name];\n      } catch (e) {\n        continue;\n      }\n      if (name === "toJSON" && typeof item === "function")\n        o.push({ k: name, v: { o: [], id: 0 } });\n      else\n        o.push({ k: name, v: serialize(item, handleSerializer, visitorInfo) });\n    }\n    let jsonWrapper;\n    try {\n      if (o.length === 0 && value.toJSON && typeof value.toJSON === "function")\n        jsonWrapper = { value: value.toJSON() };\n    } catch (e) {\n    }\n    if (jsonWrapper)\n      return innerSerialize(jsonWrapper.value, handleSerializer, visitorInfo);\n    return { o, id: id2 };\n  }\n}\n\n// packages/injected/src/bindingsController.ts\nvar BindingsController = class {\n  constructor(global, globalBindingName) {\n    this._bindings = /* @__PURE__ */ new Map();\n    this._global = global;\n    this._globalBindingName = globalBindingName;\n  }\n  addBinding(bindingName) {\n    const data = {\n      callbacks: /* @__PURE__ */ new Map(),\n      lastSeq: 0,\n      removed: false\n    };\n    this._bindings.set(bindingName, data);\n    this._global[bindingName] = (...args) => {\n      if (data.removed)\n        throw new Error(`binding "${bindingName}" has been removed`);\n      const seq = ++data.lastSeq;\n      const promise = new Promise((resolve, reject) => data.callbacks.set(seq, { resolve, reject }));\n      const serializedArgs = [];\n      for (let i = 0; i < args.length; i++) {\n        serializedArgs[i] = serializeAsCallArgument(args[i], (v) => {\n          return { fallThrough: v };\n        });\n      }\n      const payload = { name: bindingName, seq, serializedArgs };\n      this._global[this._globalBindingName](JSON.stringify(payload));\n      return promise;\n    };\n  }\n  removeBinding(bindingName) {\n    const data = this._bindings.get(bindingName);\n    if (data)\n      data.removed = true;\n    this._bindings.delete(bindingName);\n    delete this._global[bindingName];\n  }\n  deliverBindingResult(arg) {\n    const callbacks = this._bindings.get(arg.name).callbacks;\n    if ("error" in arg)\n      callbacks.get(arg.seq).reject(arg.error);\n    else\n      callbacks.get(arg.seq).resolve(arg.result);\n    callbacks.delete(arg.seq);\n  }\n};\n';
  }
});

// packages/playwright-core/src/server/overlay.ts
var Overlay;
var init_overlay = __esm({
  "packages/playwright-core/src/server/overlay.ts"() {
    "use strict";
    init_crypto();
    init_debugLogger();
    init_stringUtils();
    init_page();
    Overlay = class {
      constructor(page) {
        this._overlays = /* @__PURE__ */ new Map();
        this._page = page;
        this._page.on(Page.Events.InternalFrameNavigatedToNewDocument, (frame) => {
          if (frame.parentFrame())
            return;
          for (const [id, html] of this._overlays)
            this._doAdd(id, html).catch((e) => debugLogger.log("error", e));
        });
      }
      dispose() {
      }
      async show(html, duration) {
        const id = createGuid();
        this._overlays.set(id, html);
        await this._doAdd(id, html).catch((e) => debugLogger.log("error", e));
        if (duration) {
          await new Promise((f) => setTimeout(f, duration));
          await this.remove(id);
        }
        return id;
      }
      async _doAdd(id, html) {
        const utility = await this._page.mainFrame().utilityContext();
        await utility.evaluate(({ injected, html: html2, id: id2 }) => {
          return injected.addUserOverlay(id2, html2);
        }, { injected: await utility.injectedScript(), html, id });
      }
      async remove(id) {
        this._overlays.delete(id);
        const utility = await this._page.mainFrame().utilityContext();
        await utility.evaluate(({ injected, id: id2 }) => {
          injected.removeUserOverlay(id2);
        }, { injected: await utility.injectedScript(), id }).catch((e) => debugLogger.log("error", e));
      }
      async chapter(options) {
        const fadeDuration = 300;
        const descriptionHtml = options.description ? `<div id="description">${escapeHTML(options.description)}</div>` : "";
        const styleSheet = `
      @keyframes pw-chapter-fade-in {
        from { opacity: 0; }
        to { opacity: 1; }
      }
      @keyframes pw-chapter-fade-out {
        from { opacity: 1; }
        to { opacity: 0; }
      }
      #background {
        position: absolute;
        inset: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        backdrop-filter: blur(2px);
        animation: pw-chapter-fade-in ${fadeDuration}ms ease-out forwards;
      }
      #background.fade-out {
        animation: pw-chapter-fade-out ${fadeDuration}ms ease-in forwards;
      }
      #content {
        background: rgba(0, 0, 0, 0.7);
        border: 1px solid rgba(255, 255, 255, 0.15);
        border-radius: 16px;
        padding: 40px 56px;
        max-width: 560px;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
      }
      #title {
        color: white;
        font-family: system-ui, -apple-system, sans-serif;
        font-size: 28px;
        font-weight: 600;
        line-height: 1.3;
        text-align: center;
        letter-spacing: -0.01em;
      }
      #description {
        color: rgba(255, 255, 255, 0.7);
        font-family: system-ui, -apple-system, sans-serif;
        font-size: 15px;
        line-height: 1.5;
        margin-top: 12px;
        text-align: center;
      }
    `;
        const duration = options.duration ?? 2e3;
        const html = `<style>${styleSheet}</style><div id="background"><div id="content"><div id="title">${escapeHTML(options.title)}</div>${descriptionHtml}</div></div>`;
        const id = await this.show(html);
        await new Promise((f) => setTimeout(f, duration));
        const utility = await this._page.mainFrame().utilityContext();
        await utility.evaluate(({ injected, id: id2, fadeDuration: fadeDuration2 }) => {
          const overlay = injected.getUserOverlay(id2);
          const bg = overlay?.querySelector("#background");
          if (bg)
            bg.classList.add("fade-out");
          return new Promise((f) => injected.utils.builtins.setTimeout(f, fadeDuration2));
        }, { injected: await utility.injectedScript(), id, fadeDuration }).catch((e) => debugLogger.log("error", e));
        await this.remove(id);
      }
      async setVisible(visible) {
        if (!this._overlays.size)
          return;
        const utility = await this._page.mainFrame().utilityContext();
        await utility.evaluate(({ injected, visible: visible2 }) => {
          injected.setUserOverlaysVisible(visible2);
        }, { injected: await utility.injectedScript(), visible }).catch((e) => debugLogger.log("error", e));
      }
    };
  }
});

// packages/playwright-core/src/server/screencast.ts
var Screencast;
var init_screencast = __esm({
  "packages/playwright-core/src/server/screencast.ts"() {
    "use strict";
    init_manualPromise();
    init_protocolFormatter();
    init_debugLogger();
    init_progress();
    init_dom();
    Screencast = class {
      constructor(page) {
        this._clients = /* @__PURE__ */ new Map();
        this.page = page;
        this.page.instrumentation.addListener(this, this.page.browserContext);
      }
      async handlePageOrContextClose() {
        const clients = [...this._clients.keys()];
        this._clients.clear();
        for (const client of clients) {
          if (client.gracefulClose)
            await client.gracefulClose();
        }
      }
      dispose() {
        for (const client of this._clients.keys())
          client.dispose();
        this._clients.clear();
        this.page.instrumentation.removeListener(this);
      }
      showActions(options) {
        this._actions = options;
      }
      hideActions() {
        this._actions = void 0;
      }
      addClient(client) {
        const isFirst = this._clients.size === 0;
        this._clients.set(client, new ManualPromise());
        if (isFirst) {
          this._startScreencast(client.size, client.quality);
        } else if (this._lastFrame) {
          const frame = this._lastFrame;
          setTimeout(() => {
            if (this._clients.has(client))
              void client.onFrame(frame);
          }, 0);
        }
        return { size: this._size };
      }
      removeClient(client) {
        const disconnected = this._clients.get(client);
        if (!disconnected)
          return;
        this._clients.delete(client);
        disconnected.resolve();
        if (!this._clients.size)
          this._stopScreencast();
      }
      _startScreencast(size, quality) {
        this._size = size;
        if (!this._size) {
          const viewport = this.page.browserContext._options.viewport || { width: 800, height: 600 };
          const scale = Math.min(1, 800 / Math.max(viewport.width, viewport.height));
          this._size = {
            width: Math.floor(viewport.width * scale),
            height: Math.floor(viewport.height * scale)
          };
        }
        this._size = {
          width: this._size.width & ~1,
          height: this._size.height & ~1
        };
        this.page.delegate.startScreencast({
          width: this._size.width,
          height: this._size.height,
          quality: quality ?? 90
        });
      }
      _stopScreencast() {
        this._lastFrame = void 0;
        this.page.delegate.stopScreencast();
      }
      onScreencastFrame(frame, ack) {
        this._lastFrame = frame;
        const asyncResults = [];
        for (const [client, disconnected] of this._clients) {
          const result2 = client.onFrame(frame);
          if (!result2)
            continue;
          asyncResults.push(Promise.race([result2.catch(() => {
          }), disconnected]));
        }
        if (ack) {
          if (!asyncResults.length)
            ack();
          else
            Promise.race(asyncResults).then(ack);
        }
      }
      async onBeforeInputAction(sdkObject, metadata, point, box) {
        if (!this._actions)
          return;
        const page = sdkObject.attribution.page;
        if (page !== this.page)
          return;
        if (!box && sdkObject instanceof ElementHandle)
          box = await sdkObject.boundingBox(nullProgress) || void 0;
        const actionTitle2 = renderTitleForCall(metadata);
        const utility = await page.mainFrame().utilityContext();
        await utility.evaluate(async (options) => {
          const { injected, duration } = options;
          injected.setScreencastAnnotation(options);
          await new Promise((f) => injected.utils.builtins.setTimeout(f, duration));
          injected.setScreencastAnnotation(null);
        }, {
          injected: await utility.injectedScript(),
          duration: this._actions?.duration ?? 500,
          point,
          box,
          actionTitle: actionTitle2,
          position: this._actions?.position,
          fontSize: this._actions?.fontSize,
          cursor: this._actions?.cursor ?? "pointer"
        }).catch((e) => debugLogger.log("error", e));
      }
    };
  }
});

// packages/playwright-core/src/server/page.ts
async function ariaSnapshotForFrame(progress2, frame, options = {}) {
  const snapshot3 = await frame.retryWithProgressAndTimeouts(progress2, [1e3, 2e3, 4e3, 8e3], async (progress3, continuePolling) => {
    try {
      const context2 = await progress3.race(frame.utilityContext());
      const injectedScript = await progress3.race(context2.injectedScript());
      const snapshotOrRetry = await progress3.race(injectedScript.evaluate((injected, options2) => {
        if (options2.info) {
          const element2 = injected.querySelector(options2.info.parsed, injected.document, options2.info.strict);
          if (!element2)
            return false;
          return injected.incrementalAriaSnapshot(element2, options2);
        }
        const node = injected.document.body;
        if (!node)
          return true;
        return injected.incrementalAriaSnapshot(node, options2);
      }, {
        mode: options.mode ?? "default",
        refPrefix: frame.seq ? "f" + frame.seq : "",
        track: options.track,
        doNotRenderActive: options.doNotRenderActive,
        info: options.info,
        depth: options.depth,
        boxes: options.boxes
      }));
      if (snapshotOrRetry === true)
        return continuePolling;
      if (snapshotOrRetry === false)
        throw new NonRecoverableDOMError(`Selector "${stringifySelector(options.info.parsed)}" does not match any element`);
      return snapshotOrRetry;
    } catch (e) {
      if (frame.isNonRetriableError(e))
        throw e;
      return continuePolling;
    }
  });
  const renderedIframeRefs = snapshot3.iframeRefs.filter((ref) => ref in snapshot3.iframeDepths);
  progress2.setAllowConcurrentOrNestedRaces(true);
  const childSnapshotPromises = renderedIframeRefs.map((ref) => {
    const iframeDepth = snapshot3.iframeDepths[ref];
    const childDepth = options.depth ? options.depth - iframeDepth - 1 : void 0;
    return ariaSnapshotFrameRef(progress2, frame, ref, { ...options, depth: childDepth });
  });
  const childSnapshots = await Promise.all(childSnapshotPromises);
  progress2.setAllowConcurrentOrNestedRaces(false);
  const full = [];
  let incremental;
  if (snapshot3.incremental !== void 0) {
    incremental = snapshot3.incremental.split("\n");
    for (let i = 0; i < renderedIframeRefs.length; i++) {
      const childSnapshot = childSnapshots[i];
      if (childSnapshot.incremental)
        incremental.push(...childSnapshot.incremental);
      else if (childSnapshot.full.length)
        incremental.push("- <changed> iframe [ref=" + renderedIframeRefs[i] + "]:", ...childSnapshot.full.map((l) => "  " + l));
    }
  }
  for (const line of snapshot3.full.split("\n")) {
    const match = line.match(/^(\s*)- iframe (?:\[active\] )?\[ref=([^\]]*)\]/);
    if (!match) {
      full.push(line);
      continue;
    }
    const leadingSpace = match[1];
    const ref = match[2];
    const childSnapshot = childSnapshots[renderedIframeRefs.indexOf(ref)] ?? { full: [] };
    full.push(childSnapshot.full.length ? line + ":" : line);
    full.push(...childSnapshot.full.map((l) => leadingSpace + "  " + l));
  }
  return { full, incremental };
}
async function ariaSnapshotFrameRef(progress2, parentFrame, frameRef, options) {
  const frameSelector = `aria-ref=${frameRef} >> internal:control=enter-frame`;
  const frameBodySelector = `${frameSelector} >> body`;
  const child = await progress2.race(parentFrame.selectors.resolveFrameForSelector(frameBodySelector, { strict: true }));
  if (!child)
    return { full: [] };
  try {
    return await ariaSnapshotForFrame(progress2, child.frame, { ...options, info: void 0 });
  } catch {
    return { full: [] };
  }
}
function ensureArrayLimit(array, limit) {
  if (array.length > limit)
    return array.splice(0, limit / 10);
  return [];
}
var PageEvent, navigationMarkSymbol, Page, WorkerEvent, Worker, PageBinding, InitScript;
var init_page = __esm({
  "packages/playwright-core/src/server/page.ts"() {
    "use strict";
    init_selectorParser();
    init_manualPromise();
    init_utilityScriptSerializers();
    init_comparators();
    init_debugLogger();
    init_manualPromise();
    init_assert();
    init_stringUtils();
    init_locatorGenerators();
    init_browserContext();
    init_disposable2();
    init_console();
    init_errors();
    init_fileChooser();
    init_frames();
    init_helper();
    init_input();
    init_instrumentation();
    init_javascript();
    init_screenshotter();
    init_callLog();
    init_bindingsControllerSource();
    init_overlay();
    init_dom();
    init_screencast();
    init_javascript();
    PageEvent = {
      Close: "close",
      Crash: "crash",
      Download: "download",
      EmulatedSizeChanged: "emulatedsizechanged",
      FileChooser: "filechooser",
      FrameAttached: "frameattached",
      FrameDetached: "framedetached",
      InternalFrameNavigatedToNewDocument: "internalframenavigatedtonewdocument",
      LocatorHandlerTriggered: "locatorhandlertriggered",
      WebSocket: "websocket",
      Worker: "worker"
    };
    navigationMarkSymbol = Symbol("navigationMark");
    Page = class _Page extends SdkObject {
      constructor(delegate, browserContext) {
        super(browserContext, "page");
        this._closedState = "open";
        this.closedPromise = new ManualPromise();
        this._initializedPromise = new ManualPromise();
        this._consoleMessages = [];
        this._pageErrors = [];
        this._crashed = false;
        this.openScope = new LongStandingScope();
        this._emulatedMedia = {};
        this._fileChooserInterceptedBy = /* @__PURE__ */ new Set();
        this._pageBindings = /* @__PURE__ */ new Map();
        this.initScripts = [];
        this._workers = /* @__PURE__ */ new Map();
        this.requestInterceptors = [];
        this._locatorHandlers = /* @__PURE__ */ new Map();
        this._lastLocatorHandlerUid = 0;
        this._locatorHandlerRunningCounter = 0;
        this._networkRequests = [];
        this.attribution.page = this;
        this.delegate = delegate;
        this.browserContext = browserContext;
        this.keyboard = new Keyboard(delegate.rawKeyboard, this);
        this.mouse = new Mouse(delegate.rawMouse, this);
        this.touchscreen = new Touchscreen(delegate.rawTouchscreen, this);
        this.screenshotter = new Screenshotter(this);
        this.frameManager = new FrameManager(this);
        this.overlay = new Overlay(this);
        this.screencast = new Screencast(this);
        if (delegate.pdf)
          this.pdf = delegate.pdf.bind(delegate);
        this.coverage = delegate.coverage ? delegate.coverage() : null;
        this.isStorageStatePage = browserContext.isCreatingStorageStatePage();
      }
      static {
        this.Events = PageEvent;
      }
      async reportAsNew(opener, error) {
        if (this.delegate.noUtilityWorld?.()) {
          await this._addInitScript(saveGlobalsSnapshotSource);
          await this.safeNonStallingEvaluateInAllFrames(saveGlobalsSnapshotSource, "main");
        }
        if (opener) {
          const openerPageOrError = await opener.waitForInitializedOrError();
          if (openerPageOrError instanceof _Page && !openerPageOrError.isClosed())
            this._opener = openerPageOrError;
        }
        this._markInitialized(error);
      }
      _markInitialized(error = void 0) {
        if (error) {
          if (this.browserContext.isClosingOrClosed())
            return;
          this.frameManager.createDummyMainFrameIfNeeded();
        }
        this._initialized = error || this;
        this.emitOnContext(BrowserContext.Events.Page, this);
        for (const pageError of this._pageErrors)
          this.emitOnContext(BrowserContext.Events.PageError, pageError, this);
        for (const message of this._consoleMessages)
          this.emitOnContext(BrowserContext.Events.Console, message);
        if (this.isClosed())
          this.emit(_Page.Events.Close);
        else
          this.instrumentation.onPageOpen(this);
        this._initializedPromise.resolve(this._initialized);
      }
      initializedOrUndefined() {
        return this._initialized ? this : void 0;
      }
      waitForInitializedOrError() {
        return this._initializedPromise;
      }
      emitOnContext(event, ...args) {
        if (this.isStorageStatePage)
          return;
        this.browserContext.emit(event, ...args);
      }
      async resetForReuse(progress2) {
        await this.mainFrame().gotoImpl(progress2, "about:blank", {});
        this._emulatedSize = void 0;
        this._emulatedMedia = {};
        this._extraHTTPHeaders = void 0;
        await progress2.race(Promise.all([
          this.delegate.updateEmulatedViewportSize(),
          this.delegate.updateEmulateMedia(),
          this.delegate.updateExtraHTTPHeaders()
        ]));
        await this.delegate.resetForReuse(progress2);
      }
      _didClose() {
        this.frameManager.dispose();
        this.screencast.dispose();
        this.overlay.dispose();
        assert(this._closedState !== "closed", "Page closed twice");
        this._closedState = "closed";
        this.emit(_Page.Events.Close);
        this.browserContext.emit(BrowserContext.Events.PageClosed, this);
        this.closedPromise.resolve();
        this.instrumentation.onPageClose(this);
        this.openScope.close(new TargetClosedError(this.closeReason()));
      }
      _didCrash() {
        this.frameManager.dispose();
        this.screencast.dispose();
        this.overlay.dispose();
        this.emit(_Page.Events.Crash);
        this._crashed = true;
        this.instrumentation.onPageClose(this);
        this.openScope.close(new Error("Page crashed"));
      }
      async _onFileChooserOpened(handle) {
        let multiple;
        try {
          multiple = await handle.evaluate((element2) => !!element2.multiple);
        } catch (e) {
          return;
        }
        if (!this.listenerCount(_Page.Events.FileChooser)) {
          handle.dispose();
          return;
        }
        const fileChooser = new FileChooser(handle, multiple);
        this.emit(_Page.Events.FileChooser, fileChooser);
      }
      opener() {
        return this._opener;
      }
      mainFrame() {
        return this.frameManager.mainFrame();
      }
      frames() {
        return this.frameManager.frames();
      }
      async exposeBinding(progress2, name, playwrightBinding) {
        if (this._pageBindings.has(name))
          throw new Error(`Function "${name}" has been already registered`);
        if (this.browserContext._pageBindings.has(name))
          throw new Error(`Function "${name}" has been already registered in the browser context`);
        await progress2.race(this.browserContext.exposePlaywrightBindingIfNeeded());
        const binding = new PageBinding(this, name, playwrightBinding);
        this._pageBindings.set(name, binding);
        try {
          await progress2.race(this.delegate.addInitScript(binding.initScript));
          await progress2.race(this.safeNonStallingEvaluateInAllFrames(binding.initScript.source, "main"));
          return binding;
        } catch (error) {
          this._pageBindings.delete(name);
          throw error;
        }
      }
      async removeExposedBinding(binding) {
        if (this._pageBindings.get(binding.name) !== binding)
          return;
        this._pageBindings.delete(binding.name);
        await this.delegate.removeInitScripts([binding.initScript]);
        const cleanup = `{ ${binding.cleanupScript} };`;
        await this.safeNonStallingEvaluateInAllFrames(cleanup, "main");
      }
      async setExtraHTTPHeaders(progress2, headers) {
        const oldHeaders = this._extraHTTPHeaders;
        try {
          this._extraHTTPHeaders = headers;
          await progress2.race(this.delegate.updateExtraHTTPHeaders());
        } catch (error) {
          this._extraHTTPHeaders = oldHeaders;
          this.delegate.updateExtraHTTPHeaders().catch(() => {
          });
          throw error;
        }
      }
      extraHTTPHeaders() {
        return this._extraHTTPHeaders;
      }
      addNetworkRequest(request2) {
        this._networkRequests.push(request2);
        ensureArrayLimit(this._networkRequests, 100);
      }
      networkRequests() {
        return this._networkRequests;
      }
      async onBindingCalled(payload, context2) {
        if (this._closedState === "closed")
          return;
        await PageBinding.dispatch(this, payload, context2);
      }
      addConsoleMessage(worker, type3, args, location2, text2, timestamp) {
        const message = new ConsoleMessage(this, worker, type3, text2, args, location2, timestamp);
        const intercepted = this.frameManager.interceptConsoleMessage(message);
        if (intercepted) {
          args.forEach((arg) => arg.dispose());
          return;
        }
        this._consoleMessages.push(message);
        ensureArrayLimit(this._consoleMessages, 200);
        if (this._initialized)
          this.emitOnContext(BrowserContext.Events.Console, message);
      }
      clearConsoleMessages() {
        this._consoleMessages.length = 0;
      }
      consoleMessages(filter) {
        if (filter === "all")
          return this._consoleMessages;
        const marked = this._consoleMessages.findLastIndex((m) => m[navigationMarkSymbol]);
        return marked === -1 ? this._consoleMessages : this._consoleMessages.slice(marked + 1);
      }
      addPageError(error, location2) {
        const pageError = { error, location: location2 };
        this._pageErrors.push(pageError);
        ensureArrayLimit(this._pageErrors, 200);
        if (this._initialized)
          this.emitOnContext(BrowserContext.Events.PageError, pageError, this);
      }
      clearPageErrors() {
        this._pageErrors.length = 0;
      }
      pageErrors(filter) {
        if (filter === "all")
          return this._pageErrors.map((e) => e.error);
        const marked = this._pageErrors.findLastIndex((e) => e[navigationMarkSymbol]);
        return (marked === -1 ? this._pageErrors : this._pageErrors.slice(marked + 1)).map((e) => e.error);
      }
      async reload(progress2, options) {
        return this.mainFrame().raceNavigationAction(progress2, async () => {
          const [response2] = await Promise.all([
            // Reload must be a new document, and should not be confused with a stray pushState.
            this.mainFrame().waitForNavigation(progress2, true, options),
            progress2.race(this.delegate.reload())
          ]);
          return response2;
        });
      }
      async goBack(progress2, options) {
        return this.mainFrame().raceNavigationAction(progress2, async () => {
          let error;
          const waitPromise = this.mainFrame().waitForNavigation(progress2, false, options).catch((e) => {
            error = e;
            return null;
          });
          const result2 = await progress2.race(this.delegate.goBack());
          if (!result2) {
            waitPromise.catch(() => {
            });
            return null;
          }
          const response2 = await waitPromise;
          if (error)
            throw error;
          return response2;
        });
      }
      async goForward(progress2, options) {
        return this.mainFrame().raceNavigationAction(progress2, async () => {
          let error;
          const waitPromise = this.mainFrame().waitForNavigation(progress2, false, options).catch((e) => {
            error = e;
            return null;
          });
          const result2 = await progress2.race(this.delegate.goForward());
          if (!result2) {
            waitPromise.catch(() => {
            });
            return null;
          }
          const response2 = await waitPromise;
          if (error)
            throw error;
          return response2;
        });
      }
      requestGC(progress2) {
        return progress2.race(this.delegate.requestGC());
      }
      registerLocatorHandler(selector, noWaitAfter) {
        const uid = ++this._lastLocatorHandlerUid;
        this._locatorHandlers.set(uid, { selector, noWaitAfter });
        return uid;
      }
      resolveLocatorHandler(uid, remove) {
        const handler = this._locatorHandlers.get(uid);
        if (remove)
          this._locatorHandlers.delete(uid);
        if (handler) {
          handler.resolved?.resolve();
          handler.resolved = void 0;
        }
      }
      unregisterLocatorHandler(uid) {
        this._locatorHandlers.delete(uid);
      }
      async performActionPreChecks(progress2) {
        await this._performWaitForNavigationCheck(progress2);
        await this._performLocatorHandlersCheckpoint(progress2);
        await this._performWaitForNavigationCheck(progress2);
      }
      async _performWaitForNavigationCheck(progress2) {
        if (process.env.PLAYWRIGHT_SKIP_NAVIGATION_CHECK)
          return;
        const mainFrame = this.frameManager.mainFrame();
        if (!mainFrame || !mainFrame.pendingDocument())
          return;
        const url2 = mainFrame.pendingDocument()?.request?.url();
        const toUrl = url2 ? `" ${trimStringWithEllipsis(url2, 200)}"` : "";
        progress2.log(`  waiting for${toUrl} navigation to finish...`);
        await helper.waitForEvent(progress2, mainFrame, Frame.Events.InternalNavigation, (e) => {
          if (!e.isPublic)
            return false;
          if (!e.error)
            progress2.log(`  navigated to "${trimStringWithEllipsis(mainFrame.url(), 200)}"`);
          return true;
        }).promise;
      }
      async _performLocatorHandlersCheckpoint(progress2) {
        if (this._locatorHandlerRunningCounter)
          return;
        for (const [uid, handler] of this._locatorHandlers) {
          if (!handler.resolved) {
            if (await this.mainFrame().isVisibleInternal(progress2, handler.selector, { strict: true })) {
              handler.resolved = new ManualPromise();
              this.emit(_Page.Events.LocatorHandlerTriggered, uid);
            }
          }
          if (handler.resolved) {
            ++this._locatorHandlerRunningCounter;
            progress2.log(`  found ${asLocator(this.browserContext._browser.sdkLanguage(), handler.selector)}, intercepting action to run the handler`);
            const promise = handler.resolved.then(async () => {
              if (!handler.noWaitAfter) {
                progress2.log(`  locator handler has finished, waiting for ${asLocator(this.browserContext._browser.sdkLanguage(), handler.selector)} to be hidden`);
                await this.mainFrame().waitForSelector(progress2, handler.selector, false, { state: "hidden" });
              } else {
                progress2.log(`  locator handler has finished`);
              }
            });
            try {
              progress2.setAllowConcurrentOrNestedRaces(true);
              await progress2.race(this.openScope.race(promise));
            } finally {
              progress2.setAllowConcurrentOrNestedRaces(false);
              --this._locatorHandlerRunningCounter;
            }
            progress2.log(`  interception handler has finished, continuing`);
          }
        }
      }
      async emulateMedia(progress2, options) {
        const oldEmulatedMedia = { ...this._emulatedMedia };
        if (options.media !== void 0)
          this._emulatedMedia.media = options.media;
        if (options.colorScheme !== void 0)
          this._emulatedMedia.colorScheme = options.colorScheme;
        if (options.reducedMotion !== void 0)
          this._emulatedMedia.reducedMotion = options.reducedMotion;
        if (options.forcedColors !== void 0)
          this._emulatedMedia.forcedColors = options.forcedColors;
        if (options.contrast !== void 0)
          this._emulatedMedia.contrast = options.contrast;
        try {
          await progress2.race(this.delegate.updateEmulateMedia());
        } catch (error) {
          this._emulatedMedia = oldEmulatedMedia;
          this.delegate.updateEmulateMedia().catch(() => {
          });
          throw error;
        }
      }
      emulatedMedia() {
        const contextOptions = this.browserContext._options;
        return {
          media: this._emulatedMedia.media || "no-override",
          colorScheme: this._emulatedMedia.colorScheme !== void 0 ? this._emulatedMedia.colorScheme : contextOptions.colorScheme ?? "light",
          reducedMotion: this._emulatedMedia.reducedMotion !== void 0 ? this._emulatedMedia.reducedMotion : contextOptions.reducedMotion ?? "no-preference",
          forcedColors: this._emulatedMedia.forcedColors !== void 0 ? this._emulatedMedia.forcedColors : contextOptions.forcedColors ?? "none",
          contrast: this._emulatedMedia.contrast !== void 0 ? this._emulatedMedia.contrast : contextOptions.contrast ?? "no-preference"
        };
      }
      async setViewportSize(progress2, viewportSize) {
        const oldEmulatedSize = this._emulatedSize;
        try {
          this._setEmulatedSize({ viewport: { ...viewportSize }, screen: { ...viewportSize } });
          await progress2.race(this.delegate.updateEmulatedViewportSize());
        } catch (error) {
          this._emulatedSize = oldEmulatedSize;
          this.delegate.updateEmulatedViewportSize().catch(() => {
          });
          throw error;
        }
      }
      setEmulatedSizeFromWindowOpen(emulatedSize) {
        this._setEmulatedSize(emulatedSize);
      }
      _setEmulatedSize(emulatedSize) {
        this._emulatedSize = emulatedSize;
        this.emit(_Page.Events.EmulatedSizeChanged);
      }
      emulatedSize() {
        if (this._emulatedSize)
          return this._emulatedSize;
        const contextOptions = this.browserContext._options;
        return contextOptions.viewport ? { viewport: contextOptions.viewport, screen: contextOptions.screen || contextOptions.viewport } : void 0;
      }
      async bringToFront(progress2) {
        await progress2.race(this.delegate.bringToFront());
      }
      async addInitScript(progress2, source11) {
        return await progress2.race(this._addInitScript(source11));
      }
      async _addInitScript(source11) {
        const initScript = new InitScript(this, source11);
        this.initScripts.push(initScript);
        try {
          await this.delegate.addInitScript(initScript);
        } catch (error) {
          initScript.dispose().catch(() => {
          });
          throw error;
        }
        return initScript;
      }
      async removeInitScript(initScript) {
        this.initScripts = this.initScripts.filter((script) => initScript !== script);
        await this.delegate.removeInitScripts([initScript]);
      }
      needsRequestInterception() {
        return this.requestInterceptors.length > 0 || this.browserContext.requestInterceptors.length > 0;
      }
      async addRequestInterceptor(progress2, handler, prepend) {
        if (prepend)
          this.requestInterceptors.unshift(handler);
        else
          this.requestInterceptors.push(handler);
        await progress2.race(this.delegate.updateRequestInterception());
      }
      async removeRequestInterceptor(handler) {
        const index = this.requestInterceptors.indexOf(handler);
        if (index === -1)
          return;
        this.requestInterceptors.splice(index, 1);
        await this.browserContext.notifyRoutesInFlightAboutRemovedHandler(handler);
        await this.delegate.updateRequestInterception();
      }
      async expectScreenshot(progress2, options) {
        const locator2 = options.locator;
        const rafrafScreenshot = locator2 ? async (progress3, timeout) => {
          return await locator2.frame.rafrafTimeoutScreenshotElementWithProgress(progress3, locator2.selector, timeout, options || {});
        } : async (progress3, timeout) => {
          await this.performActionPreChecks(progress3);
          await this.mainFrame().rafrafTimeout(progress3, timeout);
          return await this.screenshotter.screenshotPage(progress3, options || {});
        };
        const comparator = getComparator("image/png");
        let intermediateResult;
        const areEqualScreenshots = (actual, expected, previous) => {
          const comparatorResult = actual && expected ? comparator(actual, expected, options) : void 0;
          if (comparatorResult !== void 0 && !!comparatorResult === !!options.isNot)
            return true;
          if (comparatorResult)
            intermediateResult = { errorMessage: comparatorResult.errorMessage, diff: comparatorResult.diff, actual, previous };
          return false;
        };
        try {
          if (!options.expected && options.isNot)
            throw new Error('"not" matcher requires expected result');
          const format2 = validateScreenshotOptions(options || {});
          if (format2 !== "png")
            throw new Error("Only PNG screenshots are supported");
          let actual;
          let previous;
          const pollIntervals = [0, 100, 250, 500];
          if (options.expected)
            progress2.log(`  verifying given screenshot expectation`);
          else
            progress2.log(`  generating new stable screenshot expectation`);
          let isFirstIteration = true;
          while (true) {
            if (this.isClosed())
              throw new Error("The page has closed");
            const screenshotTimeout = pollIntervals.shift() ?? 1e3;
            if (screenshotTimeout)
              progress2.log(`waiting ${screenshotTimeout}ms before taking screenshot`);
            previous = actual;
            actual = await rafrafScreenshot(progress2, screenshotTimeout).catch((e) => {
              if (this.mainFrame().isNonRetriableError(e))
                throw e;
              progress2.log(`failed to take screenshot - ` + e.message);
              return void 0;
            });
            if (!actual)
              continue;
            const expectation = options.expected && isFirstIteration ? options.expected : previous;
            if (areEqualScreenshots(actual, expectation, previous))
              break;
            if (intermediateResult)
              progress2.log(intermediateResult.errorMessage);
            isFirstIteration = false;
          }
          if (!isFirstIteration)
            progress2.log(`captured a stable screenshot`);
          if (!options.expected)
            return { actual };
          if (isFirstIteration) {
            progress2.log(`screenshot matched expectation`);
            return {};
          }
          if (areEqualScreenshots(actual, options.expected, void 0)) {
            progress2.log(`screenshot matched expectation`);
            return {};
          }
          throw new Error(intermediateResult.errorMessage);
        } catch (e) {
          if (isJavaScriptErrorInEvaluate(e) || isInvalidSelectorError(e))
            throw e;
          let errorMessage = e.message;
          if (e instanceof TimeoutError && intermediateResult?.previous)
            errorMessage = `Failed to take two consecutive stable screenshots.`;
          const details = {
            log: compressCallLog(e.message ? [...progress2.metadata.log, e.message] : progress2.metadata.log),
            actual: intermediateResult?.actual,
            previous: intermediateResult?.previous,
            diff: intermediateResult?.diff,
            timedOut: e instanceof TimeoutError,
            customErrorMessage: errorMessage
          };
          const error = new Error("Expect failed");
          error.details = details;
          throw error;
        }
      }
      async screenshot(progress2, options) {
        return await this.screenshotter.screenshotPage(progress2, options);
      }
      async close(progress2, options = {}) {
        await progress2.race(this._close(options));
      }
      async _close(options = {}) {
        if (this._closedState === "closed")
          return;
        if (options.reason)
          this._closeReason = options.reason;
        await this.screencast.handlePageOrContextClose();
        if (this._closedState !== "closing") {
          this._closedState = "closing";
          await this.delegate.closePage(false).catch((e) => debugLogger.log("error", e));
        }
        await this.closedPromise;
      }
      async runBeforeUnload(progress2) {
        await progress2.race(this._runBeforeUnload());
      }
      async _runBeforeUnload() {
        await this.delegate.closePage(true).catch((e) => debugLogger.log("error", e));
      }
      isClosed() {
        return this._closedState === "closed";
      }
      hasCrashed() {
        return this._crashed;
      }
      isClosedOrClosingOrCrashed() {
        return this._closedState !== "open" || this._crashed;
      }
      addWorker(workerId, worker) {
        this._workers.set(workerId, worker);
        this.emit(_Page.Events.Worker, worker);
      }
      removeWorker(workerId) {
        const worker = this._workers.get(workerId);
        if (!worker)
          return;
        worker.didClose();
        this._workers.delete(workerId);
      }
      clearWorkers() {
        for (const [workerId, worker] of this._workers) {
          worker.didClose();
          this._workers.delete(workerId);
        }
      }
      async setFileChooserInterceptedBy(progress2, enabled, by) {
        await progress2.race(this._setFileChooserInterceptedBy(enabled, by));
      }
      async _setFileChooserInterceptedBy(enabled, by) {
        const wasIntercepted = this.fileChooserIntercepted();
        if (enabled)
          this._fileChooserInterceptedBy.add(by);
        else
          this._fileChooserInterceptedBy.delete(by);
        if (wasIntercepted !== this.fileChooserIntercepted())
          await this.delegate.updateFileChooserInterception();
      }
      fileChooserIntercepted() {
        return this._fileChooserInterceptedBy.size > 0;
      }
      frameNavigatedToNewDocument(frame) {
        this.emit(_Page.Events.InternalFrameNavigatedToNewDocument, frame);
        this.browserContext.emit(BrowserContext.Events.InternalFrameNavigatedToNewDocument, frame);
        const origin = frame.origin();
        if (origin)
          this.browserContext.addVisitedOrigin(origin);
        if (frame === this.mainFrame()) {
          if (this._consoleMessages.length > 0)
            this._consoleMessages[this._consoleMessages.length - 1][navigationMarkSymbol] = true;
          if (this._pageErrors.length > 0)
            this._pageErrors[this._pageErrors.length - 1][navigationMarkSymbol] = true;
        }
      }
      allInitScripts() {
        const bindings = [...this.browserContext._pageBindings.values(), ...this._pageBindings.values()].map((binding) => binding.initScript);
        if (this.browserContext.bindingsInitScript)
          bindings.unshift(this.browserContext.bindingsInitScript);
        return [...bindings, ...this.browserContext.initScripts, ...this.initScripts];
      }
      getBinding(name) {
        return this._pageBindings.get(name) || this.browserContext._pageBindings.get(name);
      }
      async safeNonStallingEvaluateInAllFrames(expression2, world, options = {}) {
        await Promise.all(this.frames().map(async (frame) => {
          try {
            await frame.nonStallingEvaluateInExistingContext(expression2, world);
          } catch (e) {
            if (options.throwOnJSErrors && isJavaScriptErrorInEvaluate(e))
              throw e;
          }
        }));
      }
      async hideHighlight() {
        await Promise.all(this.frames().map((frame) => frame.hideHighlight().catch(() => {
        })));
      }
      async setDockTile(image) {
        await this.delegate.setDockTile(image);
      }
      async webStorageItems(progress2, kind) {
        const storage = `${kind}Storage`;
        return await this.mainFrame().evaluateExpression(progress2, `(() => {
      const result = [];
      for (let i = 0; i < ${storage}.length; i++) {
        const name = ${storage}.key(i);
        if (name !== null)
          result.push({ name, value: ${storage}.getItem(name) ?? '' });
      }
      return result;
    })()`, { world: "utility" });
      }
      async webStorageGetItem(progress2, kind, name) {
        const value2 = await this.mainFrame().evaluateExpression(progress2, `${kind}Storage.getItem(${JSON.stringify(name)})`, { world: "utility" });
        return value2 === null ? void 0 : value2;
      }
      async webStorageSetItem(progress2, kind, name, value2) {
        await this.mainFrame().evaluateExpression(progress2, `${kind}Storage.setItem(${JSON.stringify(name)}, ${JSON.stringify(value2)})`, { world: "utility" });
      }
      async webStorageRemoveItem(progress2, kind, name) {
        await this.mainFrame().evaluateExpression(progress2, `${kind}Storage.removeItem(${JSON.stringify(name)})`, { world: "utility" });
      }
      async webStorageClear(progress2, kind) {
        await this.mainFrame().evaluateExpression(progress2, `${kind}Storage.clear()`, { world: "utility" });
      }
    };
    WorkerEvent = {
      Console: "console",
      Close: "close"
    };
    Worker = class _Worker extends SdkObject {
      constructor(parent, url2, onDisconnect) {
        super(parent, "worker");
        this._executionContextPromise = new ManualPromise();
        this._workerScriptLoaded = false;
        this.existingExecutionContext = null;
        this.openScope = new LongStandingScope();
        this.attribution.worker = this;
        this.url = url2;
        this._onDisconnect = onDisconnect;
      }
      static {
        this.Events = WorkerEvent;
      }
      createExecutionContext(delegate) {
        this.existingExecutionContext = new ExecutionContext(this, delegate, "worker");
        if (this._workerScriptLoaded)
          this._executionContextPromise.resolve(this.existingExecutionContext);
        return this.existingExecutionContext;
      }
      destroyExecutionContext(errorMessage) {
        if (this.existingExecutionContext)
          this.existingExecutionContext.contextDestroyed(errorMessage);
        this.existingExecutionContext = null;
        this._workerScriptLoaded = false;
        this._executionContextPromise = new ManualPromise();
      }
      workerScriptLoaded() {
        this._workerScriptLoaded = true;
        if (this.existingExecutionContext)
          this._executionContextPromise.resolve(this.existingExecutionContext);
      }
      didClose() {
        if (this.existingExecutionContext)
          this.existingExecutionContext.contextDestroyed("Worker was closed");
        this.emit(_Worker.Events.Close, this);
        this.openScope.close(new Error("Worker closed"));
      }
      async evaluateExpression(progress2, expression2, isFunction2, arg) {
        return progress2.race(evaluateExpression(await this._executionContextPromise, expression2, { returnByValue: true, isFunction: isFunction2 }, arg));
      }
      async evaluateExpressionHandle(progress2, expression2, isFunction2, arg) {
        return progress2.race(evaluateExpression(await this._executionContextPromise, expression2, { returnByValue: false, isFunction: isFunction2 }, arg));
      }
      async disconnect(progress2, options = {}) {
        if (!this._onDisconnect)
          throw new Error("Cannot disconnect from this worker");
        this._closeReason = options.reason;
        await progress2.race(this._onDisconnect());
      }
    };
    PageBinding = class _PageBinding extends DisposableObject {
      static {
        this.kController = "__playwright__binding__controller__";
      }
      static {
        this.kBindingName = "__playwright__binding__";
      }
      static createInitScript(browserContext) {
        return new InitScript(browserContext, `
      (() => {
        const module = {};
        ${source5}
        const property = '${_PageBinding.kController}';
        if (!globalThis[property])
          globalThis[property] = new (module.exports.BindingsController())(globalThis, '${_PageBinding.kBindingName}');
      })();
    `);
      }
      constructor(parent, name, playwrightFunction) {
        super(parent);
        this.name = name;
        this.playwrightFunction = playwrightFunction;
        this.initScript = new InitScript(parent, `globalThis['${_PageBinding.kController}'].addBinding(${JSON.stringify(name)})`);
        this.cleanupScript = `globalThis['${_PageBinding.kController}'].removeBinding(${JSON.stringify(name)})`;
      }
      static async dispatch(page, payload, context2) {
        const { name, seq, serializedArgs } = JSON.parse(payload);
        try {
          assert(context2.world);
          const binding = page.getBinding(name);
          if (!binding)
            throw new Error(`Function "${name}" is not exposed`);
          if (!Array.isArray(serializedArgs))
            throw new Error(`serializedArgs is not an array. This can happen when Array.prototype.toJSON is defined incorrectly`);
          const args = serializedArgs.map((a) => parseEvaluationResultValue(a));
          const result2 = await binding.playwrightFunction({ frame: context2.frame, page, context: page.browserContext }, ...args);
          context2.evaluateExpressionHandle(`arg => globalThis['${_PageBinding.kController}'].deliverBindingResult(arg)`, { isFunction: true }, { name, seq, result: result2 }).catch((e) => debugLogger.log("error", e));
        } catch (error) {
          context2.evaluateExpressionHandle(`arg => globalThis['${_PageBinding.kController}'].deliverBindingResult(arg)`, { isFunction: true }, { name, seq, error }).catch((e) => debugLogger.log("error", e));
        }
      }
      async dispose() {
        await this.parent.removeExposedBinding(this);
      }
    };
    InitScript = class extends DisposableObject {
      constructor(owner, source11) {
        super(owner);
        this.source = `(() => {
      ${source11}
    })();`;
      }
      async dispose() {
        await this.parent.removeInitScript(this);
      }
    };
  }
});

// packages/playwright-core/src/server/types.ts
var kLifecycleEvents;
var init_types = __esm({
  "packages/playwright-core/src/server/types.ts"() {
    "use strict";
    kLifecycleEvents = /* @__PURE__ */ new Set(["load", "domcontentloaded", "networkidle", "commit"]);
  }
});

// packages/playwright-core/src/server/frames.ts
function verifyLifecycle(name, waitUntil) {
  if (waitUntil === "networkidle0")
    waitUntil = "networkidle";
  if (!kLifecycleEvents.has(waitUntil))
    throw new Error(`${name}: expected one of (load|domcontentloaded|networkidle|commit)`);
  return waitUntil;
}
function renderUnexpectedValue(expression2, received) {
  if (expression2 === "to.match.aria")
    return received ? received.raw : received;
  return received;
}
var yaml, NavigationAbortedError, ExpectError, kDummyFrameId, FrameManager, FrameEvent, Frame, SignalBarrier;
var init_frames = __esm({
  "packages/playwright-core/src/server/frames.ts"() {
    "use strict";
    init_ariaSnapshot();
    init_selectorParser();
    init_manualPromise();
    init_eventsHelper();
    init_manualPromise();
    init_locatorGenerators();
    init_assert();
    init_urlMatch();
    init_task();
    init_crypto();
    init_browserContext();
    init_dom();
    init_errors();
    init_fileUploadUtils();
    init_frameSelectors();
    init_helper();
    init_instrumentation();
    init_javascript();
    init_network2();
    init_page();
    init_progress();
    init_types();
    init_protocolError();
    yaml = require("./utilsBundle").yaml;
    NavigationAbortedError = class extends Error {
      constructor(documentId, message) {
        super(message);
        this.documentId = documentId;
      }
    };
    ExpectError = class extends Error {
      constructor(details) {
        super("Expect failed");
        this.name = "ExpectError";
        this.details = details;
      }
    };
    kDummyFrameId = "<dummy>";
    FrameManager = class {
      constructor(page) {
        this._frames = /* @__PURE__ */ new Map();
        this._consoleMessageTags = /* @__PURE__ */ new Map();
        this._signalBarriers = /* @__PURE__ */ new Set();
        this._webSockets = /* @__PURE__ */ new Map();
        this._nextFrameSeq = 0;
        this._page = page;
        this._mainFrame = void 0;
      }
      _allocateFrameSeq() {
        return this._nextFrameSeq++;
      }
      createDummyMainFrameIfNeeded() {
        if (!this._mainFrame)
          this.frameAttached(kDummyFrameId, null);
      }
      dispose() {
        for (const frame of this._frames.values()) {
          frame._stopNetworkIdleTimer();
          frame.invalidateNonStallingEvaluations("Target crashed");
        }
      }
      mainFrame() {
        return this._mainFrame;
      }
      frames() {
        const frames = [];
        collect(this._mainFrame);
        return frames;
        function collect(frame) {
          frames.push(frame);
          for (const subframe of frame._getChildFrames())
            collect(subframe);
        }
      }
      frame(frameId) {
        return this._frames.get(frameId) || null;
      }
      frameAttached(frameId, parentFrameId) {
        const parentFrame = parentFrameId ? this._frames.get(parentFrameId) : null;
        if (!parentFrame) {
          if (this._mainFrame) {
            this._frames.delete(this._mainFrame._id);
            this._mainFrame._id = frameId;
          } else {
            assert(!this._frames.has(frameId));
            this._mainFrame = new Frame(this._page, frameId, parentFrame);
          }
          this._frames.set(frameId, this._mainFrame);
          return this._mainFrame;
        } else {
          assert(!this._frames.has(frameId));
          const frame = new Frame(this._page, frameId, parentFrame);
          this._frames.set(frameId, frame);
          this._page.emit(Page.Events.FrameAttached, frame);
          this._page.browserContext.emit(BrowserContext.Events.FrameAttached, frame);
          return frame;
        }
      }
      async waitForSignalsCreatedBy(progress2, waitAfter, action) {
        if (!waitAfter)
          return action(progress2);
        const barrier = new SignalBarrier(progress2);
        this._signalBarriers.add(barrier);
        try {
          const result2 = await action(progress2);
          await progress2.race(this._page.delegate.inputActionEpilogue());
          await barrier.waitFor(progress2);
          await new Promise(makeWaitForNextTask());
          return result2;
        } finally {
          this._signalBarriers.delete(barrier);
        }
      }
      frameWillPotentiallyRequestNavigation() {
        for (const barrier of this._signalBarriers)
          barrier.retain();
      }
      frameDidPotentiallyRequestNavigation() {
        for (const barrier of this._signalBarriers)
          barrier.release();
      }
      frameRequestedNavigation(frameId, documentId) {
        const frame = this._frames.get(frameId);
        if (!frame)
          return;
        for (const barrier of this._signalBarriers)
          barrier.addFrameNavigation(frame);
        if (frame.pendingDocument() && frame.pendingDocument().documentId === documentId) {
          return;
        }
        const request2 = documentId ? Array.from(frame._inflightRequests).find((request3) => request3._documentId === documentId) : void 0;
        frame._setPendingDocument({ documentId, request: request2 });
      }
      frameCommittedNewDocumentNavigation(frameId, url2, name, documentId, initial) {
        const frame = this._frames.get(frameId);
        this.removeChildFramesRecursively(frame);
        this._clearWebSockets(frame);
        frame._url = url2;
        frame._name = name;
        let keepPending;
        const pendingDocument = frame.pendingDocument();
        if (pendingDocument) {
          if (pendingDocument.documentId === void 0) {
            pendingDocument.documentId = documentId;
          }
          if (pendingDocument.documentId === documentId) {
            frame._currentDocument = pendingDocument;
          } else {
            keepPending = pendingDocument;
            frame._currentDocument = { documentId, request: void 0 };
          }
          frame._setPendingDocument(void 0);
        } else {
          frame._currentDocument = { documentId, request: void 0 };
        }
        frame._onClearLifecycle();
        const navigationEvent = { url: url2, name, newDocument: frame._currentDocument, isPublic: true };
        this._fireInternalFrameNavigation(frame, navigationEvent);
        if (!initial) {
          frame.apiLog(`  navigated to "${url2}"`);
          this._page.frameNavigatedToNewDocument(frame);
        }
        frame._setPendingDocument(keepPending);
      }
      frameCommittedSameDocumentNavigation(frameId, url2) {
        const frame = this._frames.get(frameId);
        if (!frame)
          return;
        const pending = frame.pendingDocument();
        if (pending && pending.documentId === void 0 && pending.request === void 0) {
          frame._setPendingDocument(void 0);
        }
        frame._url = url2;
        const navigationEvent = { url: url2, name: frame._name, isPublic: true };
        this._fireInternalFrameNavigation(frame, navigationEvent);
        frame.apiLog(`  navigated to "${url2}"`);
      }
      frameAbortedNavigation(frameId, errorText, documentId) {
        const frame = this._frames.get(frameId);
        if (!frame || !frame.pendingDocument())
          return;
        if (documentId !== void 0 && frame.pendingDocument().documentId !== documentId)
          return;
        const navigationEvent = {
          url: frame._url,
          name: frame._name,
          newDocument: frame.pendingDocument(),
          error: new NavigationAbortedError(documentId, errorText),
          isPublic: !(documentId && frame._redirectedNavigations.has(documentId))
        };
        frame._setPendingDocument(void 0);
        this._fireInternalFrameNavigation(frame, navigationEvent);
      }
      frameDetached(frameId) {
        const frame = this._frames.get(frameId);
        if (frame) {
          this._removeFramesRecursively(frame);
          this._page.mainFrame()._recalculateNetworkIdle();
        }
      }
      frameLifecycleEvent(frameId, event) {
        const frame = this._frames.get(frameId);
        if (frame)
          frame.onLifecycleEvent(event);
      }
      requestStarted(request2, route2) {
        const frame = request2.frame();
        this._inflightRequestStarted(request2);
        if (request2._documentId)
          frame._setPendingDocument({ documentId: request2._documentId, request: request2 });
        if (request2._isFavicon) {
          route2?.abort("aborted").catch(() => {
          });
          return;
        }
        this._page.addNetworkRequest(request2);
        this._page.emitOnContext(BrowserContext.Events.Request, request2);
        if (route2)
          new Route(request2, route2).handle([...this._page.requestInterceptors, ...this._page.browserContext.requestInterceptors]);
      }
      requestReceivedResponse(response2) {
        if (response2.request()._isFavicon)
          return;
        this._page.emitOnContext(BrowserContext.Events.Response, response2);
      }
      reportRequestFinished(request2, response2) {
        this._inflightRequestFinished(request2);
        if (request2._isFavicon)
          return;
        this._page.emitOnContext(BrowserContext.Events.RequestFinished, { request: request2, response: response2 });
      }
      requestFailed(request2, canceled) {
        const frame = request2.frame();
        this._inflightRequestFinished(request2);
        if (frame.pendingDocument() && frame.pendingDocument().request === request2) {
          let errorText = request2.failure().errorText;
          if (canceled)
            errorText += "; maybe frame was detached?";
          this.frameAbortedNavigation(frame._id, errorText, frame.pendingDocument().documentId);
        }
        if (request2._isFavicon)
          return;
        this._page.emitOnContext(BrowserContext.Events.RequestFailed, request2);
      }
      removeChildFramesRecursively(frame) {
        for (const child of frame._getChildFrames())
          this._removeFramesRecursively(child);
      }
      _removeFramesRecursively(frame) {
        this.removeChildFramesRecursively(frame);
        frame._onDetached();
        this._frames.delete(frame._id);
        if (!this._page.isClosed())
          this._page.emit(Page.Events.FrameDetached, frame);
      }
      _inflightRequestFinished(request2) {
        const frame = request2.frame();
        if (request2._isFavicon)
          return;
        if (!frame._inflightRequests.has(request2))
          return;
        frame._inflightRequests.delete(request2);
        if (frame._inflightRequests.size === 0)
          frame._startNetworkIdleTimer();
      }
      _inflightRequestStarted(request2) {
        const frame = request2.frame();
        if (request2._isFavicon)
          return;
        frame._inflightRequests.add(request2);
        if (frame._inflightRequests.size === 1)
          frame._stopNetworkIdleTimer();
      }
      interceptConsoleMessage(message) {
        if (message.type() !== "debug")
          return false;
        const tag = message.text();
        const handler = this._consoleMessageTags.get(tag);
        if (!handler)
          return false;
        this._consoleMessageTags.delete(tag);
        handler();
        return true;
      }
      _clearWebSockets(frame) {
        if (frame.parentFrame())
          return;
        this._webSockets.clear();
      }
      onWebSocketCreated(requestId, url2) {
        const ws4 = new WebSocket(this._page, url2);
        this._webSockets.set(requestId, ws4);
      }
      onWebSocketRequest(requestId, headers, wallTimeMs) {
        const ws4 = this._webSockets.get(requestId);
        if (!ws4)
          return;
        ws4.setWallTimeMs(wallTimeMs);
        if (ws4.markAsNotified()) {
          this._page.emit(Page.Events.WebSocket, ws4);
          this._page.browserContext.emit(BrowserContext.Events.WebSocket, ws4, this._page);
        }
        ws4.requestSent(headers);
      }
      onWebSocketResponse(requestId, status, statusText2, headers) {
        const ws4 = this._webSockets.get(requestId);
        if (!ws4)
          return;
        ws4.responseReceived(status, statusText2, headers);
        if (status >= 400)
          ws4.error(`${statusText2}: ${status}`);
      }
      onWebSocketFrameSent(requestId, opcode, data, wallTimeMs) {
        const ws4 = this._webSockets.get(requestId);
        if (ws4)
          ws4.frameSent(opcode, data, wallTimeMs);
      }
      webSocketFrameReceived(requestId, opcode, data, wallTimeMs) {
        const ws4 = this._webSockets.get(requestId);
        if (ws4)
          ws4.frameReceived(opcode, data, wallTimeMs);
      }
      webSocketClosed(requestId) {
        const ws4 = this._webSockets.get(requestId);
        if (ws4) {
          if (ws4.markAsNotified()) {
            this._page.emit(Page.Events.WebSocket, ws4);
            this._page.browserContext.emit(BrowserContext.Events.WebSocket, ws4, this._page);
          }
          ws4.closed();
        }
        this._webSockets.delete(requestId);
      }
      webSocketError(requestId, errorMessage) {
        const ws4 = this._webSockets.get(requestId);
        if (ws4) {
          if (ws4.markAsNotified()) {
            this._page.emit(Page.Events.WebSocket, ws4);
            this._page.browserContext.emit(BrowserContext.Events.WebSocket, ws4, this._page);
          }
          ws4.error(errorMessage);
        }
      }
      _fireInternalFrameNavigation(frame, event) {
        frame.emit(Frame.Events.InternalNavigation, event);
      }
    };
    FrameEvent = {
      InternalNavigation: "internalnavigation",
      AddLifecycle: "addlifecycle",
      RemoveLifecycle: "removelifecycle"
    };
    Frame = class _Frame extends SdkObject {
      constructor(page, id, parentFrame) {
        super(page, "frame");
        this._firedLifecycleEvents = /* @__PURE__ */ new Set();
        this._firedNetworkIdleSelf = false;
        this._url = "";
        this._contextData = /* @__PURE__ */ new Map();
        this._childFrames = /* @__PURE__ */ new Set();
        this._name = "";
        this._inflightRequests = /* @__PURE__ */ new Set();
        this._detachedScope = new LongStandingScope();
        this._raceAgainstEvaluationStallingEventsPromises = /* @__PURE__ */ new Set();
        this._redirectedNavigations = /* @__PURE__ */ new Map();
        this.attribution.frame = this;
        this.seq = page.frameManager._allocateFrameSeq();
        this._id = id;
        this._page = page;
        this._parentFrame = parentFrame;
        this._currentDocument = { documentId: void 0, request: void 0 };
        this.selectors = new FrameSelectors(this);
        this._contextData.set("main", { contextPromise: new ManualPromise(), context: null });
        this._contextData.set("utility", { contextPromise: new ManualPromise(), context: null });
        this._setContext("main", null);
        this._setContext("utility", null);
        if (this._parentFrame)
          this._parentFrame._childFrames.add(this);
        this._firedLifecycleEvents.add("commit");
        if (id !== kDummyFrameId)
          this._startNetworkIdleTimer();
      }
      static {
        this.Events = FrameEvent;
      }
      _isDetached() {
        return this._detachedScope.isClosed();
      }
      onLifecycleEvent(event) {
        if (this._firedLifecycleEvents.has(event))
          return;
        this._firedLifecycleEvents.add(event);
        this.emit(_Frame.Events.AddLifecycle, event);
        if (this === this._page.mainFrame() && this._url !== "about:blank")
          this.apiLog(`  "${event}" event fired`);
        this._page.mainFrame()._recalculateNetworkIdle();
      }
      _onClearLifecycle() {
        for (const event of this._firedLifecycleEvents)
          this.emit(_Frame.Events.RemoveLifecycle, event);
        this._firedLifecycleEvents.clear();
        this._inflightRequests = new Set(Array.from(this._inflightRequests).filter((request2) => request2 === this._currentDocument.request));
        this._stopNetworkIdleTimer();
        if (this._inflightRequests.size === 0)
          this._startNetworkIdleTimer();
        this._page.mainFrame()._recalculateNetworkIdle(this);
        this.onLifecycleEvent("commit");
      }
      _setPendingDocument(documentInfo) {
        this._pendingDocument = documentInfo;
        if (documentInfo)
          this.invalidateNonStallingEvaluations("Navigation interrupted the evaluation");
      }
      pendingDocument() {
        return this._pendingDocument;
      }
      invalidateNonStallingEvaluations(message) {
        if (!this._raceAgainstEvaluationStallingEventsPromises.size)
          return;
        const error = new Error(message);
        for (const promise of this._raceAgainstEvaluationStallingEventsPromises)
          promise.reject(error);
      }
      async raceAgainstEvaluationStallingEvents(cb) {
        if (this._pendingDocument)
          throw new Error("Frame is currently attempting a navigation");
        if (this._page.browserContext.dialogManager.hasOpenDialogsForPage(this._page))
          throw new Error("Open JavaScript dialog prevents evaluation");
        const promise = new ManualPromise();
        this._raceAgainstEvaluationStallingEventsPromises.add(promise);
        try {
          return await Promise.race([
            cb(),
            promise
          ]);
        } finally {
          this._raceAgainstEvaluationStallingEventsPromises.delete(promise);
        }
      }
      nonStallingRawEvaluateInExistingMainContext(expression2) {
        return this.raceAgainstEvaluationStallingEvents(() => {
          const context2 = this._existingMainContext();
          if (!context2)
            throw new Error("Frame does not yet have a main execution context");
          return context2.rawEvaluateJSON(expression2);
        });
      }
      nonStallingEvaluateInExistingContext(expression2, world) {
        return this.raceAgainstEvaluationStallingEvents(() => {
          const context2 = this._contextData.get(world)?.context;
          if (!context2)
            throw new Error("Frame does not yet have the execution context");
          return context2.evaluateExpression(expression2, { isFunction: false });
        });
      }
      _recalculateNetworkIdle(frameThatAllowsRemovingNetworkIdle) {
        let isNetworkIdle = this._firedNetworkIdleSelf;
        for (const child of this._childFrames) {
          child._recalculateNetworkIdle(frameThatAllowsRemovingNetworkIdle);
          if (!child._firedLifecycleEvents.has("networkidle"))
            isNetworkIdle = false;
        }
        if (isNetworkIdle && !this._firedLifecycleEvents.has("networkidle")) {
          this._firedLifecycleEvents.add("networkidle");
          this.emit(_Frame.Events.AddLifecycle, "networkidle");
          if (this === this._page.mainFrame() && this._url !== "about:blank")
            this.apiLog(`  "networkidle" event fired`);
        }
        if (frameThatAllowsRemovingNetworkIdle !== this && this._firedLifecycleEvents.has("networkidle") && !isNetworkIdle) {
          this._firedLifecycleEvents.delete("networkidle");
          this.emit(_Frame.Events.RemoveLifecycle, "networkidle");
        }
      }
      async raceNavigationAction(progress2, action) {
        progress2.setAllowConcurrentOrNestedRaces(true);
        const result2 = await progress2.race(LongStandingScope.raceMultiple([
          this._detachedScope,
          this._page.openScope
        ], action().catch((e) => {
          if (e instanceof NavigationAbortedError && e.documentId) {
            const data = this._redirectedNavigations.get(e.documentId);
            if (data) {
              progress2.log(`waiting for redirected navigation to "${data.url}"`);
              return progress2.race(data.gotoPromise);
            }
          }
          throw e;
        })));
        progress2.setAllowConcurrentOrNestedRaces(false);
        return result2;
      }
      redirectNavigation(url2, documentId, referer) {
        const controller = new ProgressController();
        const data = {
          url: url2,
          gotoPromise: controller.run((progress2) => this.gotoImpl(progress2, url2, { referer }), 0)
        };
        this._redirectedNavigations.set(documentId, data);
        data.gotoPromise.finally(() => this._redirectedNavigations.delete(documentId));
      }
      async goto(progress2, url2, options = {}) {
        const constructedNavigationURL = constructURLBasedOnBaseURL(this._page.browserContext._options.baseURL, url2);
        return this.raceNavigationAction(progress2, async () => this.gotoImpl(progress2, constructedNavigationURL, options));
      }
      async gotoImpl(progress2, url2, options) {
        const waitUntil = verifyLifecycle("waitUntil", options.waitUntil === void 0 ? "load" : options.waitUntil);
        progress2.log(`navigating to "${url2}", waiting until "${waitUntil}"`);
        const headers = this._page.extraHTTPHeaders() || [];
        const refererHeader = headers.find((h) => h.name.toLowerCase() === "referer");
        let referer = refererHeader ? refererHeader.value : void 0;
        if (options.referer !== void 0) {
          if (referer !== void 0 && referer !== options.referer)
            throw new Error('"referer" is already specified as extra HTTP header');
          referer = options.referer;
        }
        url2 = helper.completeUserURL(url2);
        const navigationEvents = [];
        const collectNavigations = (arg) => navigationEvents.push(arg);
        this.on(_Frame.Events.InternalNavigation, collectNavigations);
        let navigateResult;
        try {
          navigateResult = await progress2.race(this._page.delegate.navigateFrame(this, url2, referer));
        } finally {
          this.off(_Frame.Events.InternalNavigation, collectNavigations);
        }
        let event;
        if (navigateResult.newDocumentId) {
          const predicate = (event2) => {
            return event2.newDocument && (event2.newDocument.documentId === navigateResult.newDocumentId || !event2.error);
          };
          const events = navigationEvents.filter(predicate);
          if (events.length)
            event = events[0];
          else
            event = await helper.waitForEvent(progress2, this, _Frame.Events.InternalNavigation, predicate).promise;
          if (event.newDocument.documentId !== navigateResult.newDocumentId) {
            throw new NavigationAbortedError(navigateResult.newDocumentId, `Navigation to "${url2}" is interrupted by another navigation to "${event.url}"`);
          }
          if (event.error)
            throw event.error;
        } else {
          const predicate = (e) => !e.newDocument;
          const events = navigationEvents.filter(predicate);
          if (events.length)
            event = events[0];
          else
            event = await helper.waitForEvent(progress2, this, _Frame.Events.InternalNavigation, predicate).promise;
        }
        if (!this._firedLifecycleEvents.has(waitUntil))
          await helper.waitForEvent(progress2, this, _Frame.Events.AddLifecycle, (e) => e === waitUntil).promise;
        const request2 = event.newDocument ? event.newDocument.request : void 0;
        const response2 = request2 ? await request2._finalRequest().response(progress2) : null;
        return response2;
      }
      async waitForNavigation(progress2, requiresNewDocument, options) {
        const waitUntil = verifyLifecycle("waitUntil", options.waitUntil === void 0 ? "load" : options.waitUntil);
        progress2.log(`waiting for navigation until "${waitUntil}"`);
        const navigationEvent = await helper.waitForEvent(progress2, this, _Frame.Events.InternalNavigation, (event) => {
          if (event.error)
            return true;
          if (requiresNewDocument && !event.newDocument)
            return false;
          progress2.log(`  navigated to "${this._url}"`);
          return true;
        }).promise;
        if (navigationEvent.error)
          throw navigationEvent.error;
        if (!this._firedLifecycleEvents.has(waitUntil))
          await helper.waitForEvent(progress2, this, _Frame.Events.AddLifecycle, (e) => e === waitUntil).promise;
        const request2 = navigationEvent.newDocument ? navigationEvent.newDocument.request : void 0;
        return request2 ? request2._finalRequest().response(progress2) : null;
      }
      async waitForLoadState(progress2, state) {
        const waitUntil = verifyLifecycle("state", state);
        if (!this._firedLifecycleEvents.has(waitUntil))
          await helper.waitForEvent(progress2, this, _Frame.Events.AddLifecycle, (e) => e === waitUntil).promise;
      }
      async frameElement(progress2) {
        return await progress2.race(this._page.delegate.getFrameElement(this));
      }
      context(world) {
        if (this._page.delegate.noUtilityWorld?.())
          world = "main";
        return this._contextData.get(world).contextPromise.then((contextOrDestroyedReason) => {
          if (contextOrDestroyedReason instanceof ExecutionContext)
            return contextOrDestroyedReason;
          throw new Error(contextOrDestroyedReason.destroyedReason);
        });
      }
      mainContext() {
        return this.context("main");
      }
      _existingMainContext() {
        return this._contextData.get("main")?.context || null;
      }
      utilityContext() {
        return this.context("utility");
      }
      async evaluateExpression(progress2, expression2, options = {}, arg) {
        return await progress2.race(this._evaluateExpression(expression2, options, arg));
      }
      async _evaluateExpression(expression2, options = {}, arg) {
        const context2 = await this.context(options.world ?? "main");
        const value2 = await context2.evaluateExpression(expression2, options, arg);
        return value2;
      }
      async evaluateExpressionHandle(progress2, expression2, options = {}, arg) {
        return await progress2.race(this._evaluateExpressionHandle(expression2, options, arg));
      }
      async _evaluateExpressionHandle(expression2, options = {}, arg) {
        const context2 = await this.context(options.world ?? "main");
        const value2 = await context2.evaluateExpressionHandle(expression2, options, arg);
        return value2;
      }
      async querySelector(progress2, selector, options) {
        this.apiLog(`    finding element using the selector "${selector}"`);
        return progress2.race(this.selectors.query(selector, options));
      }
      async waitForSelector(progress2, selector, performActionPreChecksAndLog, options, scope) {
        if (options.visibility)
          throw new Error("options.visibility is not supported, did you mean options.state?");
        if (options.waitFor && options.waitFor !== "visible")
          throw new Error("options.waitFor is not supported, did you mean options.state?");
        const { state = "visible" } = options;
        if (!["attached", "detached", "visible", "hidden"].includes(state))
          throw new Error(`state: expected one of (attached|detached|visible|hidden)`);
        if (performActionPreChecksAndLog)
          progress2.log(`waiting for ${this._asLocator(selector)}${state === "attached" ? "" : " to be " + state}`);
        const promise = this.retryWithProgressAndBackoff(progress2, async (progress3, continuePolling) => {
          if (performActionPreChecksAndLog)
            await this._page.performActionPreChecks(progress3);
          const resolved = await progress3.race(this.selectors.resolveInjectedForSelector(selector, options, scope));
          if (!resolved) {
            if (state === "hidden" || state === "detached")
              return null;
            return continuePolling;
          }
          const result2 = await progress3.race(resolved.injected.evaluateHandle((injected, { info, root }) => {
            if (root && !root.isConnected)
              throw injected.createStacklessError("Element is not attached to the DOM");
            const elements = injected.querySelectorAll(info.parsed, root || document);
            const element3 = elements[0];
            const visible2 = element3 ? injected.utils.isElementVisible(element3) : false;
            let log3 = "";
            if (elements.length > 1) {
              if (info.strict)
                throw injected.strictModeViolationError(info.parsed, elements);
              log3 = `  locator resolved to ${elements.length} elements. Proceeding with the first one: ${injected.previewNode(elements[0])}`;
            } else if (element3) {
              log3 = `  locator resolved to ${visible2 ? "visible" : "hidden"} ${injected.previewNode(element3)}`;
            }
            injected.checkDeprecatedSelectorUsage(info.parsed, elements);
            return { log: log3, element: element3, visible: visible2, attached: !!element3 };
          }, { info: resolved.info, root: resolved.frame === this ? scope : void 0 }));
          const { log: log2, visible, attached } = await progress3.race(result2.evaluate((r) => ({ log: r.log, visible: r.visible, attached: r.attached })));
          if (log2)
            progress3.log(log2);
          const success = { attached, detached: !attached, visible, hidden: !visible }[state];
          if (!success) {
            result2.dispose();
            return continuePolling;
          }
          if (options.omitReturnValue) {
            result2.dispose();
            return null;
          }
          const element2 = state === "attached" || state === "visible" ? await progress3.race(result2.evaluateHandle((r) => r.element)) : null;
          result2.dispose();
          if (!element2)
            return null;
          if (options.__testHookBeforeAdoptNode)
            await progress3.race(options.__testHookBeforeAdoptNode());
          try {
            const mainContext = await progress3.race(resolved.frame.mainContext());
            return await progress3.race(element2._adoptTo(mainContext));
          } catch (e) {
            return continuePolling;
          }
        });
        return scope ? scope._context.raceAgainstContextDestroyed(promise) : promise;
      }
      async dispatchEvent(progress2, selector, type3, eventInit = {}, options, scope) {
        await this._callOnElementOnceMatches(progress2, selector, (injectedScript, element2, data) => {
          injectedScript.dispatchEvent(element2, data.type, data.eventInit);
        }, { type: type3, eventInit }, { mainWorld: true, ...options }, scope);
      }
      async evalOnSelector(progress2, selector, strict, expression2, isFunction2, arg, scope) {
        return progress2.race(this._evalOnSelector(selector, strict, expression2, isFunction2, arg, scope));
      }
      async _evalOnSelector(selector, strict, expression2, isFunction2, arg, scope) {
        const handle = await this.selectors.query(selector, { strict }, scope);
        if (!handle)
          throw new Error(`Failed to find element matching selector "${selector}"`);
        const result2 = await handle.internalEvaluateExpression(expression2, { isFunction: isFunction2 }, arg);
        handle.dispose();
        return result2;
      }
      async evalOnSelectorAll(progress2, selector, expression2, isFunction2, arg, scope) {
        return progress2.race(this._evalOnSelectorAll(selector, expression2, isFunction2, arg, scope));
      }
      async _evalOnSelectorAll(selector, expression2, isFunction2, arg, scope) {
        const arrayHandle = await this.selectors.queryArrayInMainWorld(selector, scope);
        const result2 = await arrayHandle.internalEvaluateExpression(expression2, { isFunction: isFunction2 }, arg);
        arrayHandle.dispose();
        return result2;
      }
      async maskSelectors(selectors, color) {
        const context2 = await this.utilityContext();
        const injectedScript = await context2.injectedScript();
        await injectedScript.evaluate((injected, { parsed, color: color2 }) => {
          injected.maskSelectors(parsed, color2);
        }, { parsed: selectors, color });
      }
      async querySelectorAll(progress2, selector) {
        return progress2.race(this.selectors.queryAll(selector));
      }
      async queryCount(progress2, selector, options) {
        try {
          return await progress2.race(this.selectors.queryCount(selector, options));
        } catch (e) {
          if (this.isNonRetriableError(e))
            throw e;
          return 0;
        }
      }
      async content(progress2) {
        return progress2.race(this._content());
      }
      async _content() {
        try {
          const context2 = await this.utilityContext();
          return await context2.evaluate(() => {
            let retVal = "";
            if (document.doctype)
              retVal = new XMLSerializer().serializeToString(document.doctype);
            if (document.documentElement)
              retVal += document.documentElement.outerHTML;
            return retVal;
          });
        } catch (e) {
          if (this.isNonRetriableError(e))
            throw e;
          throw new Error(`Unable to retrieve content because the page is navigating and changing the content.`);
        }
      }
      async setContent(progress2, html, options) {
        const tag = `--playwright--set--content--${createGuid()}--`;
        await this.raceNavigationAction(progress2, async () => {
          const waitUntil = options.waitUntil === void 0 ? "load" : options.waitUntil;
          progress2.log(`setting frame content, waiting until "${waitUntil}"`);
          const context2 = await progress2.race(this.utilityContext());
          const tagPromise = new ManualPromise();
          this._page.frameManager._consoleMessageTags.set(tag, () => {
            this._onClearLifecycle();
            tagPromise.resolve();
          });
          progress2.setAllowConcurrentOrNestedRaces(true);
          const lifecyclePromise = progress2.race(tagPromise).then(() => this.waitForLoadState(progress2, waitUntil));
          const contentPromise = progress2.race(context2.evaluate(({ html: html2, tag: tag2 }) => {
            document.open();
            console.debug(tag2);
            document.write(html2);
            document.close();
          }, { html, tag }));
          await Promise.all([contentPromise, lifecyclePromise]);
          progress2.setAllowConcurrentOrNestedRaces(false);
          return null;
        }).finally(() => {
          this._page.frameManager._consoleMessageTags.delete(tag);
        });
      }
      name() {
        return this._name || "";
      }
      url() {
        return this._url;
      }
      origin() {
        if (!this._url.startsWith("http"))
          return;
        return parseURL2(this._url)?.origin;
      }
      parentFrame() {
        return this._parentFrame;
      }
      _getChildFrames() {
        return Array.from(this._childFrames);
      }
      async addScriptTag(progress2, params2) {
        return await progress2.race(this._addScriptTag(params2));
      }
      async _addScriptTag(params2) {
        const {
          url: url2 = null,
          content = null,
          type: type3 = ""
        } = params2;
        if (!url2 && !content)
          throw new Error("Provide an object with a `url`, `path` or `content` property");
        const context2 = await this.mainContext();
        return this._raceWithCSPError(async () => {
          if (url2 !== null)
            return (await context2.evaluateHandle(addScriptUrl, { url: url2, type: type3 })).asElement();
          const result2 = (await context2.evaluateHandle(addScriptContent, { content, type: type3 })).asElement();
          if (this._page.delegate.cspErrorsAsynchronousForInlineScripts)
            await context2.evaluate(() => true);
          return result2;
        });
        async function addScriptUrl(params3) {
          const script = document.createElement("script");
          script.src = params3.url;
          if (params3.type)
            script.type = params3.type;
          const promise = new Promise((res, rej) => {
            script.onload = res;
            script.onerror = (e) => rej(typeof e === "string" ? new Error(e) : new Error(`Failed to load script at ${script.src}`));
          });
          document.head.appendChild(script);
          await promise;
          return script;
        }
        function addScriptContent(params3) {
          const script = document.createElement("script");
          script.type = params3.type || "text/javascript";
          script.text = params3.content;
          let error = null;
          script.onerror = (e) => error = e;
          document.head.appendChild(script);
          if (error)
            throw error;
          return script;
        }
      }
      async addStyleTag(progress2, params2) {
        return await progress2.race(this._addStyleTag(params2));
      }
      async _addStyleTag(params2) {
        const {
          url: url2 = null,
          content = null
        } = params2;
        if (!url2 && !content)
          throw new Error("Provide an object with a `url`, `path` or `content` property");
        const context2 = await this.mainContext();
        return this._raceWithCSPError(async () => {
          if (url2 !== null)
            return (await context2.evaluateHandle(addStyleUrl, url2)).asElement();
          return (await context2.evaluateHandle(addStyleContent, content)).asElement();
        });
        async function addStyleUrl(url3) {
          const link = document.createElement("link");
          link.rel = "stylesheet";
          link.href = url3;
          const promise = new Promise((res, rej) => {
            link.onload = res;
            link.onerror = rej;
          });
          document.head.appendChild(link);
          await promise;
          return link;
        }
        async function addStyleContent(content2) {
          const style = document.createElement("style");
          style.type = "text/css";
          style.appendChild(document.createTextNode(content2));
          const promise = new Promise((res, rej) => {
            style.onload = res;
            style.onerror = rej;
          });
          document.head.appendChild(style);
          await promise;
          return style;
        }
      }
      async _raceWithCSPError(func) {
        const listeners = [];
        let result2;
        let error;
        let cspMessage;
        const actionPromise = func().then((r) => result2 = r).catch((e) => error = e);
        const errorPromise = new Promise((resolve) => {
          listeners.push(eventsHelper.addEventListener(this._page.browserContext, BrowserContext.Events.Console, (message) => {
            if (message.page() !== this._page || message.type() !== "error")
              return;
            if (message.text().includes("Content-Security-Policy") || message.text().includes("Content Security Policy")) {
              cspMessage = message;
              resolve();
            }
          }));
        });
        await Promise.race([actionPromise, errorPromise]);
        eventsHelper.removeEventListeners(listeners);
        if (cspMessage)
          throw new Error(cspMessage.text());
        if (error)
          throw error;
        return result2;
      }
      async retryWithProgressAndBackoff(progress2, action) {
        const backoffScale = [20, 50, 100, 100, 500];
        if (progress2.timeout) {
          while (backoffScale.length && backoffScale[backoffScale.length - 1] > progress2.timeout / 5)
            backoffScale.pop();
        }
        return await this.retryWithProgressAndTimeouts(progress2, backoffScale, action);
      }
      async retryWithProgressAndTimeouts(progress2, timeouts, action) {
        const continuePolling = Symbol("continuePolling");
        timeouts = [0, ...timeouts];
        let timeoutIndex = 0;
        while (true) {
          const timeout = timeouts[Math.min(timeoutIndex++, timeouts.length - 1)];
          if (timeout) {
            const actionPromise = new Promise((f) => setTimeout(f, timeout));
            await progress2.race(LongStandingScope.raceMultiple([
              this._page.openScope,
              this._detachedScope
            ], actionPromise));
          }
          try {
            const result2 = await action(progress2, continuePolling);
            if (result2 === continuePolling)
              continue;
            return result2;
          } catch (e) {
            if (this.isNonRetriableError(e))
              throw e;
            continue;
          }
        }
      }
      isNonRetriableError(e) {
        if (isAbortError(e))
          return true;
        if (isJavaScriptErrorInEvaluate(e) || isSessionClosedError(e))
          return true;
        if (isNonRecoverableDOMError(e) || isInvalidSelectorError(e))
          return true;
        if (this._isDetached())
          return true;
        return false;
      }
      async _retryWithProgressIfNotConnected(progress2, selector, options, action) {
        progress2.log(`waiting for ${this._asLocator(selector)}`);
        const noAutoWaiting = options.__testHookNoAutoWaiting ?? options.noAutoWaiting;
        const performActionPreChecks = (options.performActionPreChecks ?? !options.force) && !noAutoWaiting;
        return this.retryWithProgressAndBackoff(progress2, async (progress3, continuePolling) => {
          if (performActionPreChecks)
            await this._page.performActionPreChecks(progress3);
          const resolved = await progress3.race(this.selectors.resolveInjectedForSelector(selector, { strict: options.strict }));
          if (!resolved) {
            if (noAutoWaiting)
              throw new NonRecoverableDOMError("Element(s) not found");
            return continuePolling;
          }
          const result2 = await progress3.race(resolved.injected.evaluateHandle((injected, { info }) => {
            const elements = injected.querySelectorAll(info.parsed, document);
            injected.markTargetElements(new Set(elements));
            const element3 = elements[0];
            let log3 = "";
            if (elements.length > 1) {
              if (info.strict)
                throw injected.strictModeViolationError(info.parsed, elements);
              log3 = `  locator resolved to ${elements.length} elements. Proceeding with the first one: ${injected.previewNode(elements[0])}`;
            } else if (element3) {
              log3 = `  locator resolved to ${injected.previewNode(element3)}`;
            }
            injected.checkDeprecatedSelectorUsage(info.parsed, elements);
            return { log: log3, success: !!element3, element: element3 };
          }, { info: resolved.info }));
          const { log: log2, success } = await progress3.race(result2.evaluate((r) => ({ log: r.log, success: r.success })));
          if (log2)
            progress3.log(log2);
          if (!success) {
            if (noAutoWaiting)
              throw new NonRecoverableDOMError("Element(s) not found");
            result2.dispose();
            return continuePolling;
          }
          const element2 = await progress3.race(result2.evaluateHandle((r) => r.element));
          result2.dispose();
          try {
            const result3 = await action(progress3, element2);
            if (result3 === "error:notconnected") {
              if (noAutoWaiting)
                throw new NonRecoverableDOMError("Element is not attached to the DOM");
              progress3.log("element was detached from the DOM, retrying");
              return continuePolling;
            }
            return result3;
          } finally {
            element2?.dispose();
          }
        });
      }
      async rafrafTimeoutScreenshotElementWithProgress(progress2, selector, timeout, options) {
        return await this._retryWithProgressIfNotConnected(progress2, selector, { strict: true, performActionPreChecks: true }, async (progress3, handle) => {
          await handle._frame.rafrafTimeout(progress3, timeout);
          return await this._page.screenshotter.screenshotElement(progress3, handle, options);
        });
      }
      async click(progress2, selector, options) {
        return assertDone(await this._retryWithProgressIfNotConnected(progress2, selector, options, (progress3, handle) => handle._click(progress3, { ...options, waitAfter: !options.noWaitAfter })));
      }
      async dblclick(progress2, selector, options) {
        return assertDone(await this._retryWithProgressIfNotConnected(progress2, selector, options, (progress3, handle) => handle._dblclick(progress3, options)));
      }
      async dragAndDrop(progress2, source11, target, options) {
        assertDone(await this._retryWithProgressIfNotConnected(progress2, source11, options, async (progress3, handle) => {
          return handle._retryPointerAction(progress3, "move and down", false, async (progress4, point) => {
            await this._page.mouse.move(progress4, point.x, point.y);
            await this._page.mouse.down(progress4);
          }, {
            ...options,
            waitAfter: "disabled",
            position: options.sourcePosition
          });
        }));
        assertDone(await this._retryWithProgressIfNotConnected(progress2, target, { ...options, performActionPreChecks: false }, async (progress3, handle) => {
          return handle._retryPointerAction(progress3, "move and up", false, async (progress4, point) => {
            await this._page.mouse.move(progress4, point.x, point.y, { steps: options.steps });
            await this._page.mouse.up(progress4);
          }, {
            ...options,
            waitAfter: "disabled",
            position: options.targetPosition
          });
        }));
      }
      async tap(progress2, selector, options) {
        if (!this._page.browserContext._options.hasTouch)
          throw new Error("The page does not support tap. Use hasTouch context option to enable touch support.");
        return assertDone(await this._retryWithProgressIfNotConnected(progress2, selector, options, (progress3, handle) => handle._tap(progress3, options)));
      }
      async fill(progress2, selector, value2, options) {
        return assertDone(await this._retryWithProgressIfNotConnected(progress2, selector, options, (progress3, handle) => handle._fill(progress3, value2, options)));
      }
      async focus(progress2, selector, options) {
        assertDone(await this._retryWithProgressIfNotConnected(progress2, selector, options, (progress3, handle) => handle._focus(progress3)));
      }
      async blur(progress2, selector, options) {
        assertDone(await this._retryWithProgressIfNotConnected(progress2, selector, options, (progress3, handle) => handle._blur(progress3)));
      }
      async resolveSelector(progress2, selector, options = {}) {
        const element2 = await progress2.race(this.selectors.query(selector, options));
        if (!element2)
          throw new Error(`No element matching ${selector}`);
        const generated = await progress2.race(element2.evaluateInUtility(async ([injected, node]) => {
          return injected.generateSelectorSimple(node);
        }, {}));
        if (!generated)
          throw new Error(`Unable to generate locator for ${selector}`);
        let frame = element2._frame;
        const result2 = [generated];
        while (frame?.parentFrame()) {
          const frameElement = await frame.frameElement(progress2);
          if (frameElement) {
            const generated2 = await progress2.race(frameElement.evaluateInUtility(async ([injected, node]) => {
              return injected.generateSelectorSimple(node);
            }, {}));
            frameElement.dispose();
            if (generated2 === "error:notconnected" || !generated2)
              throw new Error(`Unable to generate locator for ${selector}`);
            result2.push(generated2);
          }
          frame = frame.parentFrame();
        }
        const resolvedSelector = result2.reverse().join(" >> internal:control=enter-frame >> ");
        return { resolvedSelector };
      }
      async textContent(progress2, selector, options, scope) {
        return this._callOnElementOnceMatches(progress2, selector, (injected, element2) => element2.textContent, void 0, options, scope);
      }
      async innerText(progress2, selector, options, scope) {
        return this._callOnElementOnceMatches(progress2, selector, (injectedScript, element2) => {
          if (element2.namespaceURI !== "http://www.w3.org/1999/xhtml")
            throw injectedScript.createStacklessError("Node is not an HTMLElement");
          return element2.innerText;
        }, void 0, options, scope);
      }
      async innerHTML(progress2, selector, options, scope) {
        return this._callOnElementOnceMatches(progress2, selector, (injected, element2) => element2.innerHTML, void 0, options, scope);
      }
      async getAttribute(progress2, selector, name, options, scope) {
        return this._callOnElementOnceMatches(progress2, selector, (injected, element2, data) => element2.getAttribute(data.name), { name }, options, scope);
      }
      async inputValue(progress2, selector, options, scope) {
        return this._callOnElementOnceMatches(progress2, selector, (injectedScript, node) => {
          const element2 = injectedScript.retarget(node, "follow-label");
          if (!element2 || element2.nodeName !== "INPUT" && element2.nodeName !== "TEXTAREA" && element2.nodeName !== "SELECT")
            throw injectedScript.createStacklessError("Node is not an <input>, <textarea> or <select> element");
          return element2.value;
        }, void 0, options, scope);
      }
      async addHighlight(progress2, selector, style) {
        const resolved = await progress2.race(this.selectors.resolveInjectedForSelector(selector));
        if (!resolved)
          return;
        return await progress2.race(resolved.injected.evaluate((injected, { info, style: style2 }) => {
          return injected.addHighlight(info.parsed, style2);
        }, { info: resolved.info, style }));
      }
      async removeHighlight(progress2, selector) {
        const resolved = await progress2.race(this.selectors.resolveInjectedForSelector(selector));
        if (!resolved)
          return;
        return await progress2.race(resolved.injected.evaluate((injected, { info }) => {
          return injected.removeHighlight(info.parsed);
        }, { info: resolved.info }));
      }
      async hideHighlight() {
        return this.raceAgainstEvaluationStallingEvents(async () => {
          const context2 = await this.utilityContext();
          const injectedScript = await context2.injectedScript();
          return await injectedScript.evaluate((injected) => {
            return injected.hideHighlight();
          });
        });
      }
      async _elementState(progress2, selector, state, options, scope) {
        const result2 = await this._callOnElementOnceMatches(progress2, selector, (injected, element2, data) => {
          return injected.elementState(element2, data.state);
        }, { state }, options, scope);
        if (result2.received === "error:notconnected")
          throwElementIsNotAttached();
        return result2.matches;
      }
      async isVisible(progress2, selector, options = {}, scope) {
        progress2.log(`  checking visibility of ${this._asLocator(selector)}`);
        return await this.isVisibleInternal(progress2, selector, options, scope);
      }
      async isVisibleInternal(progress2, selector, options = {}, scope) {
        try {
          const resolved = await progress2.race(this.selectors.resolveInjectedForSelector(selector, options, scope));
          if (!resolved)
            return false;
          return await progress2.race(resolved.injected.evaluate((injected, { info, root }) => {
            const element2 = injected.querySelector(info.parsed, root || document, info.strict);
            const state = element2 ? injected.elementState(element2, "visible") : { matches: false, received: "error:notconnected" };
            return state.matches;
          }, { info: resolved.info, root: resolved.frame === this ? scope : void 0 }));
        } catch (e) {
          if (this.isNonRetriableError(e))
            throw e;
          return false;
        }
      }
      async isHidden(progress2, selector, options = {}, scope) {
        return !await this.isVisible(progress2, selector, options, scope);
      }
      async isDisabled(progress2, selector, options, scope) {
        return this._elementState(progress2, selector, "disabled", options, scope);
      }
      async isEnabled(progress2, selector, options, scope) {
        return this._elementState(progress2, selector, "enabled", options, scope);
      }
      async isEditable(progress2, selector, options, scope) {
        return this._elementState(progress2, selector, "editable", options, scope);
      }
      async isChecked(progress2, selector, options, scope) {
        return this._elementState(progress2, selector, "checked", options, scope);
      }
      async hover(progress2, selector, options) {
        return assertDone(await this._retryWithProgressIfNotConnected(progress2, selector, options, (progress3, handle) => handle._hover(progress3, options)));
      }
      async selectOption(progress2, selector, elements, values, options) {
        return await this._retryWithProgressIfNotConnected(progress2, selector, options, (progress3, handle) => handle._selectOption(progress3, elements, values, options));
      }
      async setInputFiles(progress2, selector, params2) {
        const inputFileItems = await progress2.race(prepareFilesForUpload(this, params2));
        return assertDone(await this._retryWithProgressIfNotConnected(progress2, selector, params2, (progress3, handle) => handle._setInputFiles(progress3, inputFileItems)));
      }
      async drop(progress2, selector, params2, options) {
        const hasFiles = !!(params2.payloads?.length || params2.localPaths?.length || params2.streams?.length);
        const hasData = !!params2.data?.length;
        if (!hasFiles && !hasData)
          throw new Error('At least one of "files" or "data" must be provided.');
        const inputFileItems = hasFiles ? await progress2.race(prepareFilesForUpload(this, params2)) : { filePayloads: void 0, localPaths: void 0 };
        const data = params2.data ?? [];
        assertDone(await this._retryWithProgressIfNotConnected(progress2, selector, options, (progress3, handle) => handle._drop(progress3, inputFileItems, data, options)));
      }
      async type(progress2, selector, text2, options) {
        return assertDone(await this._retryWithProgressIfNotConnected(progress2, selector, options, (progress3, handle) => handle._type(progress3, text2, options)));
      }
      async press(progress2, selector, key, options) {
        return assertDone(await this._retryWithProgressIfNotConnected(progress2, selector, options, (progress3, handle) => handle._press(progress3, key, options)));
      }
      async check(progress2, selector, options) {
        return assertDone(await this._retryWithProgressIfNotConnected(progress2, selector, options, (progress3, handle) => handle._setChecked(progress3, true, options)));
      }
      async uncheck(progress2, selector, options) {
        return assertDone(await this._retryWithProgressIfNotConnected(progress2, selector, options, (progress3, handle) => handle._setChecked(progress3, false, options)));
      }
      async waitForTimeout(progress2, timeout) {
        let timer;
        const promise = new Promise((f) => timer = setTimeout(f, timeout));
        try {
          await progress2.race(LongStandingScope.raceMultiple([
            this._page.openScope,
            this._detachedScope
          ], promise));
        } finally {
          clearTimeout(timer);
        }
      }
      async expect(progress2, selector, options) {
        if (options.expression === "to.match.aria" && options.expectedValue) {
          try {
            options = { ...options, expectedValue: parseAriaSnapshotUnsafe(yaml, options.expectedValue) };
          } catch (e) {
            throw new ExpectError({ customErrorMessage: e.message });
          }
        }
        const lastIntermediateResult = { isSet: false };
        try {
          if (selector)
            progress2.log(`waiting for ${this._asLocator(selector)}`);
          await this._page.performActionPreChecks(progress2);
          try {
            const resultOneShot = await this._expectInternal(progress2, selector, options, lastIntermediateResult, true);
            if (resultOneShot.matches !== options.isNot)
              return;
          } catch (e) {
            if (this.isNonRetriableError(e))
              throw e;
          }
          await this.retryWithProgressAndBackoff(progress2, async (progress3, continuePolling) => {
            await this._page.performActionPreChecks(progress3);
            const { matches, received } = await this._expectInternal(progress3, selector, options, lastIntermediateResult, false);
            if (matches === options.isNot) {
              return continuePolling;
            }
            return { matches, received };
          });
        } catch (e) {
          const details = {};
          if (isInvalidSelectorError(e)) {
            details.customErrorMessage = e.message;
          } else if (isJavaScriptErrorInEvaluate(e)) {
            details.customErrorMessage = e.message.startsWith("Error: ") ? e.message.substring("Error: ".length) : e.message;
          } else if (lastIntermediateResult.isSet) {
            details.received = lastIntermediateResult.received;
            details.customErrorMessage = lastIntermediateResult.errorMessage;
          }
          if (e instanceof TimeoutError)
            details.timedOut = true;
          throw new ExpectError(details);
        }
      }
      async _expectInternal(progress2, selector, options, lastIntermediateResult, noAbort) {
        const progressLog = (text2) => progress2.log(text2);
        if (noAbort)
          progress2 = nullProgress;
        const selectorInFrame = selector ? await progress2.race(this.selectors.resolveFrameForSelector(selector, { strict: true })) : void 0;
        const { frame, info } = selectorInFrame || { frame: this, info: void 0 };
        const world = options.expression === "to.have.property" ? "main" : info?.world ?? "utility";
        const context2 = await progress2.race(frame.context(world));
        const injected = await progress2.race(context2.injectedScript());
        const { log: log2, matches, received, missingReceived } = await progress2.race(injected.evaluate(async (injected2, { info: info2, options: options2 }) => {
          const elements = info2 ? injected2.querySelectorAll(info2.parsed, document) : [];
          injected2.markTargetElements(new Set(elements));
          const isArray = options2.expression === "to.have.count" || options2.expression.endsWith(".array");
          let log3 = "";
          if (isArray)
            log3 = `  locator resolved to ${elements.length} element${elements.length === 1 ? "" : "s"}`;
          else if (elements.length > 1)
            throw injected2.strictModeViolationError(info2.parsed, elements);
          else if (elements.length)
            log3 = `  locator resolved to ${injected2.previewNode(elements[0])}`;
          if (info2)
            injected2.checkDeprecatedSelectorUsage(info2.parsed, elements);
          return { log: log3, ...await injected2.expect(elements[0], options2, elements) };
        }, { info, options }));
        if (log2)
          progressLog(log2);
        if (matches === options.isNot) {
          lastIntermediateResult.errorMessage = missingReceived ? "element(s) not found" : void 0;
          lastIntermediateResult.received = received;
          lastIntermediateResult.isSet = true;
          if (!missingReceived && !Array.isArray(received?.value))
            progressLog(`  unexpected value "${renderUnexpectedValue(options.expression, received?.value)}"`);
        }
        return { matches, received };
      }
      async waitForFunctionExpression(progress2, expression2, isFunction2, arg, options, world = "main") {
        if (typeof options.pollingInterval === "number")
          assert(options.pollingInterval > 0, "Cannot poll with non-positive interval: " + options.pollingInterval);
        expression2 = normalizeEvaluationExpression(expression2, isFunction2);
        return this.retryWithProgressAndTimeouts(progress2, [100], async () => {
          const context2 = world === "main" ? await progress2.race(this.mainContext()) : await progress2.race(this.utilityContext());
          const injectedScript = await progress2.race(context2.injectedScript());
          const handle = await progress2.race(injectedScript.evaluateHandle((injected, { expression: expression3, isFunction: isFunction3, polling, arg: arg2 }) => {
            let evaledExpression;
            const predicate = () => {
              let result3 = evaledExpression ?? globalThis.eval(expression3);
              if (isFunction3 === true) {
                evaledExpression = result3;
                result3 = result3(arg2);
              } else if (isFunction3 === false) {
                result3 = result3;
              } else {
                if (typeof result3 === "function") {
                  evaledExpression = result3;
                  result3 = result3(arg2);
                }
              }
              return result3;
            };
            let fulfill;
            let reject;
            let aborted = false;
            const result2 = new Promise((f, r) => {
              fulfill = f;
              reject = r;
            });
            const next = () => {
              if (aborted)
                return;
              try {
                const success = predicate();
                if (success) {
                  fulfill(success);
                  return;
                }
                if (typeof polling !== "number")
                  injected.utils.builtins.requestAnimationFrame(next);
                else
                  injected.utils.builtins.setTimeout(next, polling);
              } catch (e) {
                reject(e);
              }
            };
            next();
            return { result: result2, abort: () => aborted = true };
          }, { expression: expression2, isFunction: isFunction2, polling: options.pollingInterval, arg }));
          try {
            return await progress2.race(handle.evaluateHandle((h) => h.result));
          } catch (error) {
            await handle.evaluate((h) => h.abort()).catch(() => {
            });
            throw error;
          } finally {
            handle.dispose();
          }
        });
      }
      async waitForFunctionValueInUtility(progress2, pageFunction) {
        const expression2 = `() => {
      const result = (${pageFunction})();
      if (!result)
        return result;
      return JSON.stringify(result);
    }`;
        const handle = await this.waitForFunctionExpression(progress2, expression2, true, void 0, {}, "utility");
        return JSON.parse(handle.rawValue());
      }
      async title(progress2) {
        return progress2.race(this._title());
      }
      async _title() {
        try {
          return await this.raceAgainstEvaluationStallingEvents(async () => {
            const context2 = await this.utilityContext();
            return await context2.evaluate(() => document.title);
          });
        } catch {
          const url2 = this.pendingDocument()?.request?.url();
          if (url2)
            return `Loading ${url2}`;
          return "";
        }
      }
      async rafrafTimeout(progress2, timeout) {
        if (timeout === 0)
          return;
        const context2 = await progress2.race(this.utilityContext());
        progress2.setAllowConcurrentOrNestedRaces(true);
        await Promise.all([
          // wait for double raf
          progress2.race(context2.evaluate(() => new Promise((x) => {
            requestAnimationFrame(() => {
              requestAnimationFrame(x);
            });
          }))),
          progress2.wait(timeout)
        ]);
        progress2.setAllowConcurrentOrNestedRaces(false);
      }
      _onDetached() {
        this._stopNetworkIdleTimer();
        this._detachedScope.close(new Error("Frame was detached"));
        for (const data of this._contextData.values()) {
          if (data.context)
            data.context.contextDestroyed("Frame was detached");
          data.contextPromise.resolve({ destroyedReason: "Frame was detached" });
        }
        if (this._parentFrame)
          this._parentFrame._childFrames.delete(this);
        this._parentFrame = null;
      }
      async _callOnElementOnceMatches(progress2, selector, body, taskData, options, scope) {
        const callbackText = body.toString();
        progress2.log(`waiting for ${this._asLocator(selector)}`);
        const promise = this.retryWithProgressAndBackoff(progress2, async (progress3, continuePolling) => {
          const resolved = await progress3.race(this.selectors.resolveInjectedForSelector(selector, options, scope));
          if (!resolved)
            return continuePolling;
          const { log: log2, success, value: value2 } = await progress3.race(resolved.injected.evaluate((injected, { info, callbackText: callbackText2, taskData: taskData2, root }) => {
            const callback = injected.eval(callbackText2);
            const element2 = injected.querySelector(info.parsed, root || document, info.strict);
            if (!element2)
              return { success: false };
            const log3 = `  locator resolved to ${injected.previewNode(element2)}`;
            injected.markTargetElements(/* @__PURE__ */ new Set([element2]));
            return { log: log3, success: true, value: callback(injected, element2, taskData2) };
          }, { info: resolved.info, callbackText, taskData, root: resolved.frame === this ? scope : void 0 }));
          if (log2)
            progress3.log(log2);
          if (!success)
            return continuePolling;
          return value2;
        });
        return scope ? scope._context.raceAgainstContextDestroyed(promise) : promise;
      }
      _setContext(world, context2) {
        const data = this._contextData.get(world);
        data.context = context2;
        if (context2)
          data.contextPromise.resolve(context2);
        else
          data.contextPromise = new ManualPromise();
      }
      contextCreated(world, context2) {
        const data = this._contextData.get(world);
        if (data.context) {
          data.context.contextDestroyed("Execution context was destroyed, most likely because of a navigation");
          this._setContext(world, null);
        }
        this._setContext(world, context2);
      }
      contextDestroyed(context2) {
        if (this._detachedScope.isClosed())
          return;
        context2.contextDestroyed("Execution context was destroyed, most likely because of a navigation");
        for (const [world, data] of this._contextData) {
          if (data.context === context2)
            this._setContext(world, null);
        }
      }
      _startNetworkIdleTimer() {
        assert(!this._networkIdleTimer);
        if (this._firedLifecycleEvents.has("networkidle") || this._detachedScope.isClosed())
          return;
        this._networkIdleTimer = setTimeout(() => {
          this._firedNetworkIdleSelf = true;
          this._page.mainFrame()._recalculateNetworkIdle();
        }, 500);
      }
      _stopNetworkIdleTimer() {
        if (this._networkIdleTimer)
          clearTimeout(this._networkIdleTimer);
        this._networkIdleTimer = void 0;
        this._firedNetworkIdleSelf = false;
      }
      async extendInjectedScript(source11, arg) {
        const context2 = await this.context("main");
        const injectedScriptHandle = await context2.injectedScript();
        await injectedScriptHandle.evaluate((injectedScript, { source: source12, arg: arg2 }) => {
          injectedScript.extend(source12, arg2);
        }, { source: source11, arg });
      }
      async ariaSnapshot(progress2, options = {}) {
        if (options.selector && options.track)
          throw new Error("Cannot specify both selector and track options");
        if (options.selector && options.mode !== "ai") {
          const snapshot4 = await this._retryWithProgressIfNotConnected(progress2, options.selector, { strict: true, performActionPreChecks: true }, async (progress3, handle) => {
            return await progress3.race(handle.evaluateInUtility(([injected, element2, opts]) => injected.ariaSnapshot(element2, opts), { mode: "default", depth: options.depth, boxes: options.boxes }));
          });
          return { snapshot: snapshot4 };
        }
        let targetFrame;
        let info;
        if (options.selector) {
          const resolved = await progress2.race(this.selectors.resolveInjectedForSelector(options.selector, { strict: true }));
          if (!resolved)
            throw new Error(`Selector "${options.selector}" did not resolve to any element`);
          targetFrame = resolved.frame;
          info = resolved.info;
        } else {
          targetFrame = this;
        }
        const result2 = await ariaSnapshotForFrame(progress2, targetFrame, { ...options, info });
        const snapshot3 = options.track && result2.incremental ? result2.incremental.join("\n") : result2.full.join("\n");
        return { snapshot: snapshot3 };
      }
      _asLocator(selector) {
        return asLocator(this._page.browserContext._browser.sdkLanguage(), selector);
      }
    };
    SignalBarrier = class {
      constructor(progress2) {
        this._protectCount = 0;
        this._promise = new ManualPromise();
        this._progress = progress2;
        this.retain();
      }
      waitFor(progress2) {
        this.release();
        return progress2.race(this._promise);
      }
      addFrameNavigation(frame) {
        if (frame.parentFrame())
          return;
        this.retain();
        const waiter = helper.waitForEvent(this._progress, frame, Frame.Events.InternalNavigation, (e) => {
          if (!e.isPublic)
            return false;
          if (!e.error && this._progress)
            this._progress.log(`  navigated to "${frame._url}"`);
          return true;
        });
        LongStandingScope.raceMultiple([
          frame._page.openScope,
          frame._detachedScope
        ], waiter.promise).catch(() => {
        }).finally(() => {
          waiter.dispose();
          this.release();
        });
      }
      retain() {
        ++this._protectCount;
      }
      release() {
        --this._protectCount;
        if (!this._protectCount)
          this._promise.resolve();
      }
    };
  }
});

// packages/playwright-core/src/server/har/harTracer.ts
function createHarEntry(pageRef, method, url2, frameref, options, wallTime) {
  const startedDateTime = wallTime && safeDateToISOString(wallTime) || (/* @__PURE__ */ new Date()).toISOString();
  const harEntry = {
    pageref: pageRef,
    startedDateTime,
    time: -1,
    request: {
      method,
      url: url2.toString(),
      httpVersion: FALLBACK_HTTP_VERSION,
      cookies: [],
      headers: [],
      queryString: [...url2.searchParams].map((e) => ({ name: e[0], value: e[1] })),
      headersSize: -1,
      bodySize: -1
    },
    response: {
      status: -1,
      statusText: "",
      httpVersion: FALLBACK_HTTP_VERSION,
      cookies: [],
      headers: [],
      content: {
        size: -1,
        mimeType: "x-unknown"
      },
      headersSize: -1,
      bodySize: -1,
      redirectURL: "",
      _transferSize: options.omitSizes ? void 0 : -1
    },
    cache: {},
    timings: {
      send: -1,
      wait: -1,
      receive: -1
    },
    _frameref: options.includeTraceInfo ? frameref : void 0,
    _monotonicTime: options.includeTraceInfo ? monotonicTime() : void 0
  };
  return harEntry;
}
function parseCookie(c) {
  const cookie = {
    name: "",
    value: ""
  };
  let first = true;
  for (const pair of c.split(/; */)) {
    const indexOfEquals = pair.indexOf("=");
    const name = indexOfEquals !== -1 ? pair.substr(0, indexOfEquals).trim() : pair.trim();
    const value2 = indexOfEquals !== -1 ? pair.substr(indexOfEquals + 1, pair.length).trim() : "";
    if (first) {
      first = false;
      cookie.name = name;
      cookie.value = value2;
      continue;
    }
    if (name === "Domain")
      cookie.domain = value2;
    if (name === "Expires")
      cookie.expires = safeDateToISOString(value2);
    if (name === "HttpOnly")
      cookie.httpOnly = true;
    if (name === "Max-Age")
      cookie.expires = safeDateToISOString(Date.now() + +value2 * 1e3);
    if (name === "Path")
      cookie.path = value2;
    if (name === "SameSite")
      cookie.sameSite = value2;
    if (name === "Secure")
      cookie.secure = true;
  }
  return cookie;
}
function safeDateToISOString(value2) {
  try {
    return new Date(value2).toISOString();
  } catch (e) {
  }
}
var mime6, FALLBACK_HTTP_VERSION, HarTracer, startedDateSymbol;
var init_harTracer = __esm({
  "packages/playwright-core/src/server/har/harTracer.ts"() {
    "use strict";
    init_base64();
    init_manualPromise();
    init_eventsHelper();
    init_assert();
    init_crypto();
    init_time();
    init_mimeType();
    init_urlMatch();
    init_userAgent();
    init_browserContext();
    init_fetch();
    init_frames();
    init_helper();
    init_network2();
    init_progress();
    mime6 = require("./utilsBundle").mime;
    FALLBACK_HTTP_VERSION = "HTTP/1.1";
    HarTracer = class {
      constructor(context2, page, delegate, options) {
        this._barrierPromises = /* @__PURE__ */ new Set();
        this._pageEntries = [];
        this._eventListeners = [];
        this._started = false;
        this._omitWebSocketFrames = true;
        this._context = context2;
        this._page = page;
        this._delegate = delegate;
        this._options = options;
        if (options.slimMode) {
          options.omitSecurityDetails = true;
          options.omitCookies = true;
          options.omitTiming = true;
          options.omitServerIP = true;
          options.omitSizes = true;
          options.omitPages = true;
        }
        this._entrySymbol = Symbol("requestHarEntry");
        this._pageEntrySymbol = Symbol("pageHarEntry");
        this._baseURL = context2 instanceof APIRequestContext ? context2._defaultOptions().baseURL : context2._options.baseURL;
      }
      setOmitWebSocketFrames(omitWebSocketFrames) {
        this._omitWebSocketFrames = omitWebSocketFrames;
      }
      start(options) {
        if (this._started)
          return;
        this._options.omitScripts = options.omitScripts;
        this._started = true;
        const apiRequest = this._context instanceof APIRequestContext ? this._context : this._context.fetchRequest;
        this._eventListeners = [
          eventsHelper.addEventListener(apiRequest, APIRequestContext.Events.Request, (event) => this._onAPIRequest(event)),
          eventsHelper.addEventListener(apiRequest, APIRequestContext.Events.RequestFinished, (event) => this._onAPIRequestFinished(event))
        ];
        if (this._context instanceof BrowserContext) {
          this._eventListeners.push(
            eventsHelper.addEventListener(this._context, BrowserContext.Events.Page, (page) => this._createPageEntryIfNeeded(page)),
            eventsHelper.addEventListener(this._context, BrowserContext.Events.Request, (request2) => this._onRequest(request2)),
            eventsHelper.addEventListener(this._context, BrowserContext.Events.RequestFinished, ({ request: request2, response: response2 }) => this._onRequestFinished(request2, response2).catch(() => {
            })),
            eventsHelper.addEventListener(this._context, BrowserContext.Events.RequestFailed, (request2) => this._onRequestFailed(request2)),
            eventsHelper.addEventListener(this._context, BrowserContext.Events.Response, (response2) => this._onResponse(response2)),
            eventsHelper.addEventListener(this._context, BrowserContext.Events.RequestAborted, (request2) => this._onRequestAborted(request2)),
            eventsHelper.addEventListener(this._context, BrowserContext.Events.RequestFulfilled, (request2) => this._onRequestFulfilled(request2)),
            eventsHelper.addEventListener(this._context, BrowserContext.Events.RequestContinued, (request2) => this._onRequestContinued(request2)),
            eventsHelper.addEventListener(this._context, BrowserContext.Events.WebSocket, (webSocket, page) => this._onWebSocket(page, webSocket))
          );
          for (const page of this._context.pages())
            this._createPageEntryIfNeeded(page);
        }
      }
      _shouldIncludeEntryWithUrl(urlString) {
        return !this._options.urlFilter || urlMatches(this._baseURL, urlString, this._options.urlFilter);
      }
      _entryForRequest(request2) {
        return request2[this._entrySymbol];
      }
      _createPageEntryIfNeeded(page) {
        if (!page)
          return;
        if (this._options.omitPages)
          return;
        if (this._page && page !== this._page)
          return;
        let pageEntry = page[this._pageEntrySymbol];
        if (!pageEntry) {
          const date = /* @__PURE__ */ new Date();
          pageEntry = {
            startedDateTime: date.toISOString(),
            id: page.guid,
            title: "",
            pageTimings: this._options.omitTiming ? {} : {
              onContentLoad: -1,
              onLoad: -1
            }
          };
          pageEntry[startedDateSymbol] = date;
          page.mainFrame().on(Frame.Events.AddLifecycle, (event) => {
            if (event === "load")
              this._onLoad(page, pageEntry);
            if (event === "domcontentloaded")
              this._onDOMContentLoaded(page, pageEntry);
          });
          page[this._pageEntrySymbol] = pageEntry;
          this._pageEntries.push(pageEntry);
        }
        return pageEntry;
      }
      _onDOMContentLoaded(page, pageEntry) {
        const promise = page.mainFrame().evaluateExpression(nullProgress, String(() => {
          return {
            title: document.title,
            domContentLoaded: performance.timing.domContentLoadedEventStart
          };
        }), { isFunction: true, world: "utility" }).then((result2) => {
          pageEntry.title = result2.title;
          if (!this._options.omitTiming)
            pageEntry.pageTimings.onContentLoad = result2.domContentLoaded;
        }).catch(() => {
        });
        this._addBarrier(page, promise);
      }
      _onLoad(page, pageEntry) {
        const promise = page.mainFrame().evaluateExpression(nullProgress, String(() => {
          return {
            title: document.title,
            loaded: performance.timing.loadEventStart
          };
        }), { isFunction: true, world: "utility" }).then((result2) => {
          pageEntry.title = result2.title;
          if (!this._options.omitTiming)
            pageEntry.pageTimings.onLoad = result2.loaded;
        }).catch(() => {
        });
        this._addBarrier(page, promise);
      }
      _addBarrier(target, promise) {
        if (!target)
          return null;
        if (!this._options.waitForContentOnStop)
          return;
        const race = target.openScope.safeRace(promise);
        this._barrierPromises.add(race);
        race.then(() => this._barrierPromises.delete(race));
      }
      _onAPIRequest(event) {
        if (!this._shouldIncludeEntryWithUrl(event.url.toString()))
          return;
        const harEntry = createHarEntry(void 0, event.method, event.url, void 0, this._options);
        harEntry._apiRequest = true;
        if (!this._options.omitCookies)
          harEntry.request.cookies = event.cookies;
        harEntry.request.headers = Object.entries(event.headers).map(([name, value2]) => ({ name, value: value2 }));
        harEntry.request.postData = this._postDataForBuffer(event.postData || null, event.headers["content-type"], this._options.content);
        if (!this._options.omitSizes)
          harEntry.request.bodySize = event.postData?.length || 0;
        event[this._entrySymbol] = harEntry;
        if (this._started)
          this._delegate.onEntryStarted(harEntry);
      }
      _onAPIRequestFinished(event) {
        const harEntry = this._entryForRequest(event.requestEvent);
        if (!harEntry)
          return;
        harEntry.response.status = event.statusCode;
        harEntry.response.statusText = event.statusMessage;
        harEntry.response.httpVersion = event.httpVersion;
        harEntry.response.redirectURL = event.headers.location || "";
        if (!this._options.omitServerIP) {
          harEntry.serverIPAddress = event.serverIPAddress;
          harEntry._serverPort = event.serverPort;
        }
        if (!this._options.omitTiming) {
          harEntry.timings = event.timings;
          this._computeHarEntryTotalTime(harEntry);
        }
        if (!this._options.omitSecurityDetails)
          harEntry._securityDetails = event.securityDetails;
        for (let i = 0; i < event.rawHeaders.length; i += 2) {
          harEntry.response.headers.push({
            name: event.rawHeaders[i],
            value: event.rawHeaders[i + 1]
          });
        }
        harEntry.response.cookies = this._options.omitCookies ? [] : event.cookies.map((c) => {
          return {
            ...c,
            expires: c.expires === -1 ? void 0 : safeDateToISOString(c.expires)
          };
        });
        const content = harEntry.response.content;
        const contentType = event.headers["content-type"];
        if (contentType)
          content.mimeType = contentType;
        this._storeResponseContent(event.body, content, "other");
        if (!this._options.omitSizes)
          harEntry.response.bodySize = event.body?.length ?? 0;
        if (this._started)
          this._delegate.onEntryFinished(harEntry);
      }
      _onRequest(request2) {
        if (!this._shouldIncludeEntryWithUrl(request2.url()))
          return;
        const page = request2.frame()?._page;
        if (this._page && page !== this._page)
          return;
        const url2 = parseURL2(request2.url());
        if (!url2)
          return;
        const pageEntry = this._createPageEntryIfNeeded(page);
        const harEntry = createHarEntry(pageEntry?.id, request2.method(), url2, request2.frame()?.guid, this._options, request2.wallTimeMs());
        harEntry._resourceType = request2.resourceType();
        this._recordRequestHeadersAndCookies(harEntry, request2.headers());
        harEntry.request.postData = this._postDataForRequest(request2, this._options.content);
        if (!this._options.omitSizes)
          harEntry.request.bodySize = request2.bodySize();
        if (request2.redirectedFrom()) {
          const fromEntry = this._entryForRequest(request2.redirectedFrom());
          if (fromEntry)
            fromEntry.response.redirectURL = request2.url();
        }
        request2[this._entrySymbol] = harEntry;
        assert(this._started);
        this._delegate.onEntryStarted(harEntry);
      }
      _recordRequestHeadersAndCookies(harEntry, headers) {
        if (!this._options.omitCookies) {
          harEntry.request.cookies = [];
          for (const header of headers.filter((header2) => header2.name.toLowerCase() === "cookie"))
            harEntry.request.cookies.push(...header.value.split(";").map(parseCookie));
        }
        harEntry.request.headers = headers;
      }
      _recordRequestOverrides(harEntry, request2) {
        if (!request2.overrides() || !this._options.recordRequestOverrides)
          return;
        harEntry.request.method = request2.method();
        harEntry.request.url = request2.url();
        harEntry.request.postData = this._postDataForRequest(request2, this._options.content);
        this._recordRequestHeadersAndCookies(harEntry, request2.headers());
      }
      async _onRequestFinished(request2, response2) {
        if (!response2)
          return;
        const harEntry = this._entryForRequest(request2);
        if (!harEntry)
          return;
        const page = request2.frame()?._page;
        if (!this._options.omitServerIP) {
          this._addBarrier(page || request2.serviceWorker(), response2.internalServerAddr().then((server) => {
            if (server?.ipAddress)
              harEntry.serverIPAddress = server.ipAddress;
            if (server?.port)
              harEntry._serverPort = server.port;
          }));
        }
        if (!this._options.omitSecurityDetails) {
          this._addBarrier(page || request2.serviceWorker(), response2.internalSecurityDetails().then((details) => {
            if (details)
              harEntry._securityDetails = details;
          }));
        }
        const compressionCalculationBarrier = this._options.omitSizes ? void 0 : {
          _encodedBodySize: -1,
          _decodedBodySize: -1,
          barrier: new ManualPromise(),
          _check: function() {
            if (this._encodedBodySize !== -1 && this._decodedBodySize !== -1) {
              harEntry.response.content.compression = Math.max(0, this._decodedBodySize - this._encodedBodySize);
              this.barrier.resolve();
            }
          },
          setEncodedBodySize: function(encodedBodySize) {
            this._encodedBodySize = encodedBodySize;
            this._check();
          },
          setDecodedBodySize: function(decodedBodySize) {
            this._decodedBodySize = decodedBodySize;
            this._check();
          }
        };
        if (compressionCalculationBarrier)
          this._addBarrier(page || request2.serviceWorker(), compressionCalculationBarrier.barrier);
        const promise = response2.internalBody().then((buffer) => {
          if (this._options.omitScripts && request2.resourceType() === "script") {
            compressionCalculationBarrier?.setDecodedBodySize(0);
            return;
          }
          const content = harEntry.response.content;
          compressionCalculationBarrier?.setDecodedBodySize(buffer.length);
          this._storeResponseContent(buffer, content, request2.resourceType());
        }).catch(() => {
          compressionCalculationBarrier?.setDecodedBodySize(0);
        }).then(() => {
          if (this._started)
            this._delegate.onEntryFinished(harEntry);
        });
        this._addBarrier(page || request2.serviceWorker(), promise);
        this._addBarrier(page || request2.serviceWorker(), response2.internalHttpVersion().then((httpVersion) => {
          harEntry.request.httpVersion = httpVersion;
          harEntry.response.httpVersion = httpVersion;
        }));
        const timing = response2.timing();
        harEntry.timings.receive = response2.request()._responseEndTiming !== -1 ? helper.millisToRoundishMillis(response2.request()._responseEndTiming - timing.responseStart) : -1;
        this._computeHarEntryTotalTime(harEntry);
        if (!this._options.omitSizes) {
          this._addBarrier(page || request2.serviceWorker(), response2.internalSizes().then((sizes) => {
            harEntry.response.bodySize = sizes.responseBodySize;
            harEntry.response.headersSize = sizes.responseHeadersSize;
            harEntry.response._transferSize = sizes.transferSize;
            harEntry.request.headersSize = sizes.requestHeadersSize;
            compressionCalculationBarrier?.setEncodedBodySize(sizes.responseBodySize);
          }));
        }
      }
      async _onRequestFailed(request2) {
        const harEntry = this._entryForRequest(request2);
        if (!harEntry)
          return;
        if (request2._failureText !== null)
          harEntry.response._failureText = request2._failureText;
        this._recordRequestOverrides(harEntry, request2);
        if (this._started)
          this._delegate.onEntryFinished(harEntry);
      }
      _onRequestAborted(request2) {
        const harEntry = this._entryForRequest(request2);
        if (harEntry)
          harEntry._wasAborted = true;
      }
      _onRequestFulfilled(request2) {
        const harEntry = this._entryForRequest(request2);
        if (harEntry)
          harEntry._wasFulfilled = true;
      }
      _onRequestContinued(request2) {
        const harEntry = this._entryForRequest(request2);
        if (harEntry)
          harEntry._wasContinued = true;
      }
      _onWebSocket(page, webSocket) {
        if (this._page && page !== this._page)
          return;
        if (!this._shouldIncludeEntryWithUrl(webSocket.url()))
          return;
        const url2 = parseURL2(webSocket.url());
        if (!url2)
          return;
        const method = "GET";
        const pageEntry = this._createPageEntryIfNeeded(page);
        const harEntry = createHarEntry(pageEntry?.id, method, url2, page.mainFrame().guid, this._options, webSocket.wallTimeMs());
        harEntry._resourceType = "websocket";
        let sha1 = void 0;
        const recordMessage = (type3, opcode, data, wallTimeMs) => {
          if (this._omitWebSocketFrames)
            return;
          const message = { type: type3, time: this._options.omitTiming ? -1 : wallTimeMs, opcode, data };
          if (this._options.content === "embed") {
            harEntry._webSocketMessages ??= [];
            harEntry._webSocketMessages.push(message);
          } else if (this._options.content === "attach") {
            if (!sha1) {
              sha1 = createGuid() + ".jsonl";
              if (this._options.includeTraceInfo)
                harEntry.response.content._sha1 = sha1;
              else
                harEntry.response.content._file = sha1;
            }
            if (this._started)
              this._delegate.onContentBlobAppend(sha1, JSON.stringify(message) + "\n");
          }
        };
        let oldestWallTimeMs = Infinity;
        let newestWallTimeMs = -Infinity;
        const updateTime = (wallTimeMs) => {
          if (this._options.omitTiming)
            return;
          if (wallTimeMs >= oldestWallTimeMs && wallTimeMs <= newestWallTimeMs)
            return;
          if (wallTimeMs < oldestWallTimeMs)
            oldestWallTimeMs = wallTimeMs;
          if (wallTimeMs > newestWallTimeMs)
            newestWallTimeMs = wallTimeMs;
          if (oldestWallTimeMs === newestWallTimeMs)
            return;
          harEntry.time = newestWallTimeMs - oldestWallTimeMs;
        };
        const eventListeners = [
          eventsHelper.addEventListener(webSocket, WebSocket.Events.Request, ({ headers }) => {
            this._recordRequestHeadersAndCookies(harEntry, headers);
            if (!this._options.omitSizes)
              harEntry.request.headersSize = requestHeadersSize(headers, webSocket.url(), method);
          }),
          eventsHelper.addEventListener(webSocket, WebSocket.Events.Response, ({ status, statusText: statusText2, headers }) => {
            harEntry.response.status = status;
            harEntry.response.statusText = statusText2;
            this._recordResponseHeaders(harEntry, headers);
            if (!this._options.omitSizes) {
              harEntry.response.headersSize = responseHeadersSize(headers, statusText2);
              harEntry.response._transferSize = Math.max(0, harEntry.response._transferSize) + harEntry.response.headersSize;
            }
          }),
          eventsHelper.addEventListener(webSocket, WebSocket.Events.FrameSent, ({ opcode, data, wallTimeMs }) => {
            recordMessage("send", opcode, data, wallTimeMs);
            updateTime(wallTimeMs);
          }),
          eventsHelper.addEventListener(webSocket, WebSocket.Events.FrameReceived, ({ opcode, data, wallTimeMs }) => {
            recordMessage("receive", opcode, data, wallTimeMs);
            updateTime(wallTimeMs);
            if (!this._options.omitSizes) {
              const length = opcode === 1 ? Buffer.byteLength(data, "utf8") : base64ByteLength(data);
              let headerSize = 6;
              if (length >= 2 ** 16)
                headerSize += 8;
              else if (length > 125)
                headerSize += 2;
              harEntry.response._transferSize = Math.max(0, harEntry.response._transferSize) + headerSize + length;
            }
          }),
          eventsHelper.addEventListener(webSocket, WebSocket.Events.SocketError, (errorMessage) => {
            harEntry.response._failureText = errorMessage;
          }),
          eventsHelper.addEventListener(webSocket, WebSocket.Events.Close, () => {
            eventsHelper.removeEventListeners(eventListeners);
            if (this._started)
              this._delegate.onEntryFinished(harEntry);
          })
        ];
        this._eventListeners.push(...eventListeners);
        if (this._started)
          this._delegate.onEntryStarted(harEntry);
      }
      _storeResponseContent(buffer, content, resourceType) {
        if (!buffer) {
          content.size = 0;
          return;
        }
        if (!this._options.omitSizes)
          content.size = buffer.length;
        if (this._options.content === "embed") {
          if (isTextualMimeType(content.mimeType) && resourceType !== "font") {
            content.text = buffer.toString();
          } else {
            content.text = buffer.toString("base64");
            content.encoding = "base64";
          }
        } else if (this._options.content === "attach") {
          const sha1 = calculateSha1(buffer) + "." + (mime6.getExtension(content.mimeType) || "dat");
          if (this._options.includeTraceInfo)
            content._sha1 = sha1;
          else
            content._file = sha1;
          if (this._started)
            this._delegate.onContentBlob(sha1, buffer);
        }
      }
      _onResponse(response2) {
        const harEntry = this._entryForRequest(response2.request());
        if (!harEntry)
          return;
        const page = response2.frame()?._page;
        const pageEntry = this._createPageEntryIfNeeded(page);
        const request2 = response2.request();
        harEntry.response = {
          status: response2.status(),
          statusText: response2.statusText(),
          httpVersion: FALLBACK_HTTP_VERSION,
          // These are bad values that will be overwritten below.
          cookies: [],
          headers: [],
          content: {
            size: -1,
            mimeType: "x-unknown"
          },
          headersSize: -1,
          bodySize: -1,
          redirectURL: "",
          _transferSize: this._options.omitSizes ? void 0 : -1
        };
        if (!this._options.omitTiming) {
          const startDateTime = pageEntry ? pageEntry[startedDateSymbol].valueOf() : 0;
          const timing = response2.timing();
          if (pageEntry && startDateTime > timing.startTime)
            pageEntry.startedDateTime = new Date(timing.startTime).toISOString();
          if (request2.wallTimeMs() === void 0 && timing.startTime > 0) {
            const startedDateTime = safeDateToISOString(timing.startTime);
            if (startedDateTime)
              harEntry.startedDateTime = startedDateTime;
          }
          const dns2 = timing.domainLookupEnd !== -1 ? helper.millisToRoundishMillis(timing.domainLookupEnd - timing.domainLookupStart) : -1;
          const connect2 = timing.connectEnd !== -1 ? helper.millisToRoundishMillis(timing.connectEnd - timing.connectStart) : -1;
          const ssl = timing.connectEnd !== -1 ? helper.millisToRoundishMillis(timing.connectEnd - timing.secureConnectionStart) : -1;
          const wait2 = timing.responseStart !== -1 ? helper.millisToRoundishMillis(timing.responseStart - timing.requestStart) : -1;
          const receive = -1;
          harEntry.timings = {
            dns: dns2,
            connect: connect2,
            ssl,
            send: 0,
            wait: wait2,
            receive
          };
          this._computeHarEntryTotalTime(harEntry);
        }
        this._recordRequestOverrides(harEntry, request2);
        this._addBarrier(page || request2.serviceWorker(), request2.internalRawRequestHeaders().then((headers) => {
          this._recordRequestHeadersAndCookies(harEntry, headers);
        }));
        this._recordResponseHeaders(harEntry, response2.headers());
        this._addBarrier(page || request2.serviceWorker(), response2.internalRawResponseHeaders().then((headers) => {
          this._recordResponseHeaders(harEntry, headers);
        }));
      }
      _recordResponseHeaders(harEntry, headers) {
        if (!this._options.omitCookies) {
          harEntry.response.cookies = headers.filter((header) => header.name.toLowerCase() === "set-cookie").map((header) => parseCookie(header.value));
        }
        harEntry.response.headers = headers;
        const contentType = headers.find((header) => header.name.toLowerCase() === "content-type");
        if (contentType)
          harEntry.response.content.mimeType = contentType.value;
      }
      _computeHarEntryTotalTime(harEntry) {
        harEntry.time = [
          harEntry.timings.dns,
          harEntry.timings.connect,
          harEntry.timings.ssl,
          harEntry.timings.wait,
          harEntry.timings.receive
        ].reduce((pre, cur) => (cur || -1) > 0 ? cur + pre : pre, 0);
      }
      async flush() {
        await Promise.all(this._barrierPromises);
      }
      stop() {
        this._started = false;
        eventsHelper.removeEventListeners(this._eventListeners);
        this._barrierPromises.clear();
        const context2 = this._context instanceof BrowserContext ? this._context : void 0;
        const log2 = {
          version: "1.2",
          creator: {
            name: "Playwright",
            version: getPlaywrightVersion()
          },
          browser: {
            name: context2?._browser.options.name || "",
            version: context2?._browser.version() || ""
          },
          pages: this._pageEntries.length ? this._pageEntries.slice() : void 0,
          entries: []
        };
        if (!this._options.omitTiming) {
          for (const pageEntry of log2.pages || []) {
            const startDateTime = pageEntry[startedDateSymbol].valueOf();
            if (typeof pageEntry.pageTimings.onContentLoad === "number" && pageEntry.pageTimings.onContentLoad >= 0)
              pageEntry.pageTimings.onContentLoad -= startDateTime;
            else
              pageEntry.pageTimings.onContentLoad = -1;
            if (typeof pageEntry.pageTimings.onLoad === "number" && pageEntry.pageTimings.onLoad >= 0)
              pageEntry.pageTimings.onLoad -= startDateTime;
            else
              pageEntry.pageTimings.onLoad = -1;
          }
        }
        this._pageEntries = [];
        return log2;
      }
      _postDataForRequest(request2, content) {
        const postData = request2.postDataBuffer();
        if (!postData)
          return;
        const contentType = request2.headerValue("content-type");
        return this._postDataForBuffer(postData, contentType, content);
      }
      _postDataForBuffer(postData, contentType, content) {
        if (!postData)
          return;
        contentType ??= "application/octet-stream";
        const result2 = {
          mimeType: contentType,
          text: "",
          params: []
        };
        if (content === "embed" && contentType !== "application/octet-stream")
          result2.text = postData.toString();
        if (content === "attach") {
          const sha1 = calculateSha1(postData) + "." + (mime6.getExtension(contentType) || "dat");
          if (this._options.includeTraceInfo)
            result2._sha1 = sha1;
          else
            result2._file = sha1;
          this._delegate.onContentBlob(sha1, postData);
        }
        if (contentType === "application/x-www-form-urlencoded") {
          const parsed = new URLSearchParams(postData.toString());
          for (const [name, value2] of parsed.entries())
            result2.params.push({ name, value: value2 });
        }
        return result2;
      }
    };
    startedDateSymbol = Symbol("startedDate");
  }
});

// packages/playwright-core/src/server/har/harRecorder.ts
var import_path14, HarRecorder;
var init_harRecorder = __esm({
  "packages/playwright-core/src/server/har/harRecorder.ts"() {
    "use strict";
    import_path14 = __toESM(require("path"));
    init_serializedFS();
    init_artifact();
    init_harTracer();
    HarRecorder = class {
      constructor(context2, fallbackDir, harId, page, options) {
        this._fs = new SerializedFS();
        this._isFlushed = false;
        this._entries = [];
        this._writtenContentEntries = /* @__PURE__ */ new Set();
        this._context = context2;
        const isServer = !!context2.attribution.playwright.options.isServer;
        this._harFilePath = !isServer && options.harPath ? options.harPath : import_path14.default.join(fallbackDir, `${harId}.har`);
        if (!isServer && options.resourcesDir)
          this._resourcesDir = options.resourcesDir;
        else if (!isServer && options.harPath)
          this._resourcesDir = import_path14.default.dirname(options.harPath);
        else
          this._resourcesDir = import_path14.default.join(fallbackDir, `${harId}-resources`);
        const urlFilterRe = options.urlRegexSource !== void 0 && options.urlRegexFlags !== void 0 ? new RegExp(options.urlRegexSource, options.urlRegexFlags) : void 0;
        const content = options.content || "embed";
        this._tracer = new HarTracer(context2, page, this, {
          content,
          slimMode: options.mode === "minimal",
          includeTraceInfo: false,
          recordRequestOverrides: true,
          waitForContentOnStop: true,
          urlFilter: urlFilterRe ?? options.urlGlob
        });
        this._tracer.setOmitWebSocketFrames(!!process.env.PLAYWRIGHT_HAR_NO_WEBSOCKET_FRAMES);
        this._tracer.start({ omitScripts: false });
      }
      onEntryStarted(entry) {
        this._entries.push(entry);
      }
      onEntryFinished(entry) {
      }
      onContentBlob(sha1, buffer) {
        if (this._writtenContentEntries.has(sha1))
          return;
        if (!this._writtenContentEntries.size)
          this._fs.mkdir(this._resourcesDir);
        this._writtenContentEntries.add(sha1);
        this._fs.writeFile(
          import_path14.default.join(this._resourcesDir, sha1),
          buffer,
          true
          /* skipIfExists */
        );
      }
      onContentBlobAppend(sha1, text2) {
        if (!this._writtenContentEntries.size)
          this._fs.mkdir(this._resourcesDir);
        this._writtenContentEntries.add(sha1);
        this._fs.appendFile(import_path14.default.join(this._resourcesDir, sha1), text2);
      }
      async _flush() {
        if (this._isFlushed)
          return;
        this._isFlushed = true;
        await this._tracer.flush();
        const log2 = this._tracer.stop();
        log2.entries = this._entries;
        this._fs.mkdir(import_path14.default.dirname(this._harFilePath));
        const file = this._harFilePath;
        this._fs.writeFile(file, "");
        this._fs.appendFile(file, '{"log":{"version":' + JSON.stringify(log2.version));
        this._fs.appendFile(file, ',"creator":' + JSON.stringify(log2.creator));
        if (log2.browser)
          this._fs.appendFile(file, ',"browser":' + JSON.stringify(log2.browser));
        if (log2.pages) {
          this._fs.appendFile(file, ',"pages":[');
          for (let i = 0; i < log2.pages.length; i++) {
            if (i)
              this._fs.appendFile(file, ",");
            this._fs.appendFile(file, JSON.stringify(log2.pages[i]));
          }
          this._fs.appendFile(file, "]");
        }
        this._fs.appendFile(file, ',"entries":[');
        for (let i = 0; i < log2.entries.length; i++) {
          if (i)
            this._fs.appendFile(file, ",");
          this._fs.appendFile(file, JSON.stringify(log2.entries[i]));
        }
        this._fs.appendFile(file, "]");
        if (log2.comment !== void 0)
          this._fs.appendFile(file, ',"comment":' + JSON.stringify(log2.comment));
        this._fs.appendFile(
          file,
          "}}",
          true
          /* flush */
        );
      }
      async flush() {
        await this._flush();
        const error = await this._fs.syncAndGetError();
        if (error)
          throw error;
      }
      async export(mode) {
        await this._flush();
        const entries = [{ name: "har.har", value: this._harFilePath }];
        for (const sha1 of this._writtenContentEntries)
          entries.push({ name: sha1, value: import_path14.default.join(this._resourcesDir, sha1) });
        const zipPath = this._harFilePath + ".zip";
        if (mode === "archive")
          this._fs.zip(entries, zipPath);
        const error = await this._fs.syncAndGetError();
        if (error)
          throw error;
        if (mode === "entries")
          return { entries };
        const artifact = new Artifact(this._context, zipPath);
        artifact.reportFinished();
        return { artifact };
      }
    };
  }
});

// packages/playwright-core/src/server/trace/recorder/tracing.ts
function visitTraceEvent(object, sha1s) {
  if (Array.isArray(object))
    return object.map((o) => visitTraceEvent(o, sha1s));
  if (object instanceof Dispatcher)
    return `<${object._type}>`;
  if (object instanceof Buffer)
    return `<Buffer>`;
  if (object instanceof Date)
    return object;
  if (typeof object === "object") {
    const result2 = {};
    for (const key in object) {
      if (key === "sha1" || key === "_sha1" || key.endsWith("Sha1")) {
        const sha1 = object[key];
        if (sha1)
          sha1s.add(sha1);
      }
      result2[key] = visitTraceEvent(object[key], sha1s);
    }
    return result2;
  }
  return object;
}
function createBeforeActionTraceEvent(metadata, parentId) {
  if (metadata.internal || metadata.method.startsWith("tracing"))
    return null;
  const event = {
    type: "before",
    callId: metadata.id,
    startTime: metadata.startTime,
    title: metadata.title,
    class: metadata.type,
    method: metadata.method,
    params: metadata.params,
    stepId: metadata.stepId,
    pageId: metadata.pageId
  };
  if (parentId)
    event.parentId = parentId;
  return event;
}
function createInputActionTraceEvent(metadata, point) {
  if (metadata.internal || metadata.method.startsWith("tracing"))
    return null;
  return {
    type: "input",
    callId: metadata.id,
    point
  };
}
function createActionLogTraceEvent(metadata, message) {
  if (metadata.internal || metadata.method.startsWith("tracing"))
    return null;
  return {
    type: "log",
    callId: metadata.id,
    time: monotonicTime(),
    message
  };
}
function createAfterActionTraceEvent(metadata) {
  if (metadata.internal || metadata.method.startsWith("tracing"))
    return null;
  return {
    type: "after",
    callId: metadata.id,
    endTime: metadata.endTime,
    error: metadata.error?.error,
    result: metadata.result
  };
}
var import_fs15, import_os5, import_path15, version, Tracing, throttledRate, unthrottleDuration, ScreencastTracingRecorder;
var init_tracing = __esm({
  "packages/playwright-core/src/server/trace/recorder/tracing.ts"() {
    "use strict";
    import_fs15 = __toESM(require("fs"));
    import_os5 = __toESM(require("os"));
    import_path15 = __toESM(require("path"));
    init_protocolMetainfo();
    init_assert();
    init_time();
    init_manualPromise();
    init_eventsHelper();
    init_crypto();
    init_fileUtils();
    init_serializedFS();
    init_userAgent();
    init_snapshotter();
    init_artifact();
    init_browserContext();
    init_dispatcher();
    init_errors();
    init_harRecorder();
    init_harTracer();
    init_instrumentation();
    init_progress();
    version = 8;
    Tracing = class extends SdkObject {
      constructor(context2, tracesDir) {
        super(context2, "tracing");
        this._fs = new SerializedFS();
        this._screencastListeners = [];
        this._pageTracingRecorders = /* @__PURE__ */ new Map();
        this._eventListeners = [];
        this._isStopping = false;
        this._allResources = /* @__PURE__ */ new Set();
        this._pendingHarEntries = /* @__PURE__ */ new Set();
        this._started = false;
        this.harRecorders = /* @__PURE__ */ new Map();
        this._context = context2;
        this._precreatedTracesDir = tracesDir;
        this._harTracer = new HarTracer(context2, null, this, {
          content: "attach",
          includeTraceInfo: true,
          recordRequestOverrides: false,
          waitForContentOnStop: false
        });
        const testIdAttributeName2 = "selectors" in context2 ? context2.selectors().testIdAttributeName() : void 0;
        this._contextCreatedEvent = {
          version,
          type: "context-options",
          origin: "library",
          browserName: "",
          playwrightVersion: getPlaywrightVersion(),
          options: {},
          platform: process.platform,
          wallTime: 0,
          monotonicTime: 0,
          sdkLanguage: this._sdkLanguage(),
          testIdAttributeName: testIdAttributeName2,
          contextId: context2.guid
        };
        if (context2 instanceof BrowserContext) {
          this._snapshotter = new Snapshotter(context2, this);
          assert(tracesDir, "tracesDir must be specified for BrowserContext");
          this._contextCreatedEvent.browserName = context2._browser.options.name;
          this._contextCreatedEvent.channel = context2._browser.options.channel;
          this._contextCreatedEvent.options = context2._options;
        }
      }
      _sdkLanguage() {
        return this._context instanceof BrowserContext ? this._context._browser.sdkLanguage() : this._context.attribution.playwright.options.sdkLanguage;
      }
      async resetForReuse(progress2) {
        await this.stopChunk(progress2, { mode: "discard" }).catch(() => {
        });
        await progress2.race(this._stop());
        if (this._snapshotter)
          await progress2.race(this._snapshotter.resetForReuse());
      }
      start(progress2, options) {
        if (this._isStopping)
          throw new Error("Cannot start tracing while stopping");
        if (this._state)
          throw new Error("Tracing has been already started");
        this._contextCreatedEvent.sdkLanguage = this._sdkLanguage();
        const traceName = options.name || createGuid();
        const tracesDir = this._createTracesDirIfNeeded();
        this._state = {
          options,
          traceName,
          tracesDir,
          traceFile: import_path15.default.join(tracesDir, traceName + ".trace"),
          networkFile: import_path15.default.join(tracesDir, traceName + ".network"),
          resourcesDir: import_path15.default.join(tracesDir, "resources"),
          chunkOrdinal: 0,
          traceSha1s: /* @__PURE__ */ new Set(),
          networkSha1s: /* @__PURE__ */ new Set(),
          recording: false,
          callIds: /* @__PURE__ */ new Set(),
          groupStack: []
        };
        this._fs.mkdir(this._state.resourcesDir);
        this._fs.writeFile(this._state.networkFile, "");
        if (options.snapshots)
          this._harTracer.start({ omitScripts: !options.live });
        this._started = true;
      }
      async startChunk(progress2, options = {}) {
        if (this._state && this._state.recording)
          await this.stopChunk(progress2, { mode: "discard" });
        if (!this._state)
          throw new Error("Must start tracing before starting a new chunk");
        if (this._isStopping)
          throw new Error("Cannot start a trace chunk while stopping");
        this._state.recording = true;
        this._state.callIds.clear();
        const preserveNetworkResources = this._context instanceof BrowserContext;
        if (options.name && options.name !== this._state.traceName)
          this._changeTraceName(this._state, options.name, preserveNetworkResources);
        else
          this._allocateNewTraceFile(this._state);
        if (!preserveNetworkResources)
          this._fs.writeFile(this._state.networkFile, "");
        this._fs.mkdir(import_path15.default.dirname(this._state.traceFile));
        const event = {
          ...this._contextCreatedEvent,
          title: options.title,
          wallTime: Date.now(),
          monotonicTime: monotonicTime()
        };
        this._appendTraceEvent(event);
        this._context.instrumentation.addListener(this, this._context);
        this._eventListeners.push(
          eventsHelper.addEventListener(this._context, BrowserContext.Events.Console, this._onConsoleMessage.bind(this)),
          eventsHelper.addEventListener(this._context, BrowserContext.Events.PageError, this._onPageError.bind(this))
        );
        if (this._state.options.screenshots)
          this._startScreencast();
        this._harTracer.setOmitWebSocketFrames(!!process.env.PLAYWRIGHT_TRACING_NO_WEBSOCKET_FRAMES);
        if (this._state.options.snapshots)
          await this._snapshotter?.start(progress2);
        return { traceName: this._state.traceName };
      }
      _currentGroupId() {
        return this._state?.groupStack.length ? this._state.groupStack[this._state.groupStack.length - 1] : void 0;
      }
      group(progress2, name, location2) {
        if (!this._state)
          return;
        const metadata = progress2.metadata;
        const stackFrames = [];
        const { file, line, column } = location2 ?? metadata.location ?? {};
        if (file) {
          stackFrames.push({
            file,
            line: line ?? 0,
            column: column ?? 0
          });
        }
        const event = {
          type: "before",
          callId: metadata.id,
          startTime: metadata.startTime,
          title: name,
          class: "Tracing",
          method: "tracingGroup",
          params: {},
          stepId: metadata.stepId,
          stack: stackFrames
        };
        if (this._currentGroupId())
          event.parentId = this._currentGroupId();
        this._state.groupStack.push(event.callId);
        this._appendTraceEvent(event);
      }
      groupEnd(progress2) {
        this._groupEnd();
      }
      _groupEnd() {
        if (!this._state)
          return;
        const callId = this._state.groupStack.pop();
        if (!callId)
          return;
        const event = {
          type: "after",
          callId,
          endTime: monotonicTime()
        };
        this._appendTraceEvent(event);
      }
      _startScreencast() {
        if (!(this._context instanceof BrowserContext))
          return;
        for (const page of this._context.pages())
          this._startScreencastInPage(page);
        this._screencastListeners.push(
          eventsHelper.addEventListener(this._context, BrowserContext.Events.Page, this._startScreencastInPage.bind(this))
        );
      }
      _stopScreencast() {
        eventsHelper.removeEventListeners(this._screencastListeners);
        for (const recorder of this._pageTracingRecorders.values())
          recorder.dispose();
        this._pageTracingRecorders.clear();
      }
      _allocateNewTraceFile(state) {
        const suffix = state.chunkOrdinal ? `-chunk${state.chunkOrdinal}` : ``;
        state.chunkOrdinal++;
        state.traceFile = import_path15.default.join(state.tracesDir, `${state.traceName}${suffix}.trace`);
      }
      _changeTraceName(state, name, preserveNetworkResources) {
        state.traceName = name;
        state.chunkOrdinal = 0;
        this._allocateNewTraceFile(state);
        const newNetworkFile = import_path15.default.join(state.tracesDir, name + ".network");
        if (preserveNetworkResources)
          this._fs.copyFile(state.networkFile, newNetworkFile);
        state.networkFile = newNetworkFile;
      }
      async stop(progress2) {
        await progress2.race(this._stop());
      }
      async _stop() {
        if (!this._state)
          return;
        if (this._isStopping)
          throw new Error(`Tracing is already stopping`);
        if (this._state.recording)
          throw new Error(`Must stop trace file before stopping tracing`);
        this._closeAllGroups();
        this._harTracer.stop();
        this.flushHarEntries();
        await this._fs.syncAndGetError().finally(() => {
          this._state = void 0;
        });
      }
      async deleteTmpTracesDir() {
        if (this._tracesTmpDir)
          await removeFolders([this._tracesTmpDir]);
      }
      _createTracesDirIfNeeded() {
        if (this._precreatedTracesDir)
          return this._precreatedTracesDir;
        this._tracesTmpDir = import_fs15.default.mkdtempSync(import_path15.default.join(import_os5.default.tmpdir(), "playwright-tracing-"));
        return this._tracesTmpDir;
      }
      abort() {
        this._snapshotter?.dispose();
        this._harTracer.stop();
      }
      async flush() {
        this.abort();
        for (const harRecorder of this.harRecorders.values())
          await harRecorder.flush();
        await this._fs.syncAndGetError();
      }
      harStart(page, options) {
        const harId = createGuid();
        const artifactsDir = this._context instanceof BrowserContext ? this._context._browser.options.artifactsDir : this._createTracesDirIfNeeded();
        this.harRecorders.set(harId, new HarRecorder(this._context, artifactsDir, harId, page, options));
        return harId;
      }
      async harExport(progress2, harId, mode) {
        const recorder = this.harRecorders.get(harId || "");
        const result2 = await progress2.race(recorder.export(mode));
        this.harRecorders.delete(harId || "");
        return result2;
      }
      _closeAllGroups() {
        while (this._currentGroupId())
          this._groupEnd();
      }
      async stopChunk(progress2, params2) {
        if (this._isStopping)
          throw new Error(`Tracing is already stopping`);
        this._isStopping = true;
        if (!this._state || !this._state.recording) {
          this._isStopping = false;
          if (params2.mode !== "discard")
            throw new Error(`Must start tracing before stopping`);
          return {};
        }
        this._closeAllGroups();
        this._context.instrumentation.removeListener(this);
        eventsHelper.removeEventListeners(this._eventListeners);
        if (this._state.options.screenshots)
          this._stopScreencast();
        this._harTracer.setOmitWebSocketFrames(true);
        if (this._state.options.snapshots)
          this._snapshotter?.stop();
        this.flushHarEntries();
        const newNetworkFile = import_path15.default.join(this._state.tracesDir, this._state.traceName + `-pwnetcopy-${this._state.chunkOrdinal}.network`);
        const entries = [];
        entries.push({ name: "trace.trace", value: this._state.traceFile });
        entries.push({ name: "trace.network", value: newNetworkFile });
        for (const sha1 of /* @__PURE__ */ new Set([...this._state.traceSha1s, ...this._state.networkSha1s]))
          entries.push({ name: import_path15.default.join("resources", sha1), value: import_path15.default.join(this._state.resourcesDir, sha1) });
        this._state.traceSha1s = /* @__PURE__ */ new Set();
        if (params2.mode === "discard") {
          this._isStopping = false;
          this._state.recording = false;
          return {};
        }
        this._fs.copyFile(this._state.networkFile, newNetworkFile);
        const zipFileName = this._state.traceFile + ".zip";
        if (params2.mode === "archive")
          this._fs.zip(entries, zipFileName);
        let error;
        try {
          await progress2.race(this._fs.syncAndGetError());
        } catch (e) {
          error = e;
        }
        this._isStopping = false;
        if (this._state)
          this._state.recording = false;
        if (error) {
          if (!isAbortError(error) && this._context instanceof BrowserContext && !this._context._browser.isConnected())
            return {};
          throw error;
        }
        if (params2.mode === "entries")
          return { entries };
        const artifact = new Artifact(this._context, zipFileName);
        artifact.reportFinished();
        return { artifact };
      }
      async _captureSnapshot(snapshotName, sdkObject, metadata, resetTargets) {
        if (!snapshotName || !sdkObject.attribution.page)
          return;
        await this._snapshotter?.captureSnapshot(sdkObject.attribution.page, metadata.id, snapshotName, resetTargets).catch(() => {
        });
      }
      _shouldCaptureSnapshot(sdkObject, metadata, phase) {
        if (!sdkObject.attribution.page || !this._snapshotter?.started())
          return;
        const metainfo = getMetainfo(metadata);
        if (!metainfo?.snapshot)
          return false;
        switch (phase) {
          case "before":
            return !metainfo.input || !!metainfo.isAutoWaiting;
          case "input":
            return !!metainfo.input;
          case "after":
            return true;
        }
      }
      onBeforeCall(sdkObject, metadata, parentId) {
        const event = createBeforeActionTraceEvent(metadata, parentId ?? this._currentGroupId());
        if (!event)
          return Promise.resolve();
        this._temporarilyDisableThrottling(sdkObject.attribution.page);
        if (this._shouldCaptureSnapshot(sdkObject, metadata, "before"))
          event.beforeSnapshot = `before@${metadata.id}`;
        this._state?.callIds.add(metadata.id);
        this._appendTraceEvent(event);
        return this._captureSnapshot(event.beforeSnapshot, sdkObject, metadata, true);
      }
      onBeforeInputAction(sdkObject, metadata, point) {
        if (!this._state?.callIds.has(metadata.id))
          return Promise.resolve();
        const event = createInputActionTraceEvent(metadata, point);
        if (!event)
          return Promise.resolve();
        this._temporarilyDisableThrottling(sdkObject.attribution.page);
        if (this._shouldCaptureSnapshot(sdkObject, metadata, "input"))
          event.inputSnapshot = `input@${metadata.id}`;
        this._appendTraceEvent(event);
        return this._captureSnapshot(event.inputSnapshot, sdkObject, metadata, false);
      }
      onCallLog(sdkObject, metadata, logName, message) {
        if (!this._state?.callIds.has(metadata.id))
          return;
        if (metadata.internal)
          return;
        if (logName !== "api")
          return;
        const event = createActionLogTraceEvent(metadata, message);
        if (event)
          this._appendTraceEvent(event);
      }
      onAfterCall(sdkObject, metadata) {
        if (!this._state?.callIds.has(metadata.id))
          return Promise.resolve();
        this._state?.callIds.delete(metadata.id);
        const event = createAfterActionTraceEvent(metadata);
        if (!event)
          return Promise.resolve();
        this._temporarilyDisableThrottling(sdkObject.attribution.page);
        if (this._shouldCaptureSnapshot(sdkObject, metadata, "after"))
          event.afterSnapshot = `after@${metadata.id}`;
        this._appendTraceEvent(event);
        return this._captureSnapshot(event.afterSnapshot, sdkObject, metadata, false);
      }
      onEntryStarted(entry) {
        this._pendingHarEntries.add(entry);
      }
      onEntryFinished(entry) {
        this._pendingHarEntries.delete(entry);
        const event = { type: "resource-snapshot", snapshot: entry };
        const visited = visitTraceEvent(event, this._state.networkSha1s);
        this._fs.appendFile(
          this._state.networkFile,
          JSON.stringify(visited) + "\n",
          true
          /* flush */
        );
      }
      flushHarEntries() {
        const harLines = [];
        for (const entry of this._pendingHarEntries) {
          const event = { type: "resource-snapshot", snapshot: entry };
          const visited = visitTraceEvent(event, this._state.networkSha1s);
          harLines.push(JSON.stringify(visited));
        }
        this._pendingHarEntries.clear();
        if (harLines.length)
          this._fs.appendFile(
            this._state.networkFile,
            harLines.join("\n") + "\n",
            true
            /* flush */
          );
      }
      onContentBlob(sha1, buffer) {
        this._appendResource(sha1, buffer);
      }
      onContentBlobAppend(sha1, text2) {
        if (!this._allResources.has(sha1))
          this._allResources.add(sha1);
        this._fs.appendFile(
          import_path15.default.join(this._state.resourcesDir, sha1),
          text2,
          this._state.options.live
          /* flush */
        );
      }
      onSnapshotterBlob(blob) {
        this._appendResource(blob.sha1, blob.buffer);
      }
      onFrameSnapshot(snapshot3) {
        this._appendTraceEvent({ type: "frame-snapshot", snapshot: snapshot3 });
      }
      _onConsoleMessage(message) {
        const event = {
          type: "console",
          messageType: message.type(),
          text: message.text(),
          args: message.args().map((a) => ({ preview: a.toString(), value: a.rawValue() })),
          location: message.location(),
          time: monotonicTime(),
          pageId: message.page()?.guid
        };
        this._appendTraceEvent(event);
      }
      onDialog(dialog) {
        const event = {
          type: "event",
          time: monotonicTime(),
          class: "BrowserContext",
          method: "dialog",
          params: { pageId: dialog.page().guid, type: dialog.type(), message: dialog.message(), defaultValue: dialog.defaultValue() }
        };
        this._appendTraceEvent(event);
      }
      onDownload(page, download) {
        const event = {
          type: "event",
          time: monotonicTime(),
          class: "BrowserContext",
          method: "download",
          params: { pageId: page.guid, url: download.url, suggestedFilename: download.suggestedFilename() }
        };
        this._appendTraceEvent(event);
      }
      onPageOpen(page) {
        const event = {
          type: "event",
          time: monotonicTime(),
          class: "BrowserContext",
          method: "page",
          params: { pageId: page.guid, openerPageId: page.opener()?.guid }
        };
        this._appendTraceEvent(event);
      }
      onPageClose(page) {
        const event = {
          type: "event",
          time: monotonicTime(),
          class: "BrowserContext",
          method: "pageClosed",
          params: { pageId: page.guid }
        };
        this._appendTraceEvent(event);
        this._pageTracingRecorders.get(page)?.dispose();
        this._pageTracingRecorders.delete(page);
      }
      dispose(params2) {
        if (this._started)
          this.stopChunk(nullProgress, params2).then(() => this._stop()).catch(() => {
          });
        this._started = false;
      }
      _onPageError(pageError, page) {
        const event = {
          type: "event",
          time: monotonicTime(),
          class: "BrowserContext",
          method: "pageError",
          params: {
            error: serializeError(pageError.error),
            location: {
              url: pageError.location.url,
              line: pageError.location.lineNumber,
              column: pageError.location.columnNumber
            }
          },
          pageId: page.guid
        };
        this._appendTraceEvent(event);
      }
      _temporarilyDisableThrottling(page) {
        if (page)
          this._pageTracingRecorders.get(page)?.temporarilyDisableThrottling();
      }
      _startScreencastInPage(page) {
        const prefix = page.guid;
        const onFrame = (params2) => {
          const suffix = Date.now();
          const sha1 = `${prefix}-${suffix}.jpeg`;
          const event = {
            type: "screencast-frame",
            pageId: page.guid,
            sha1,
            width: params2.viewportWidth,
            height: params2.viewportHeight,
            timestamp: monotonicTime(),
            frameSwapWallTime: params2.frameSwapWallTime
          };
          this._appendResource(sha1, params2.buffer);
          this._appendTraceEvent(event);
        };
        this._pageTracingRecorders.set(page, new ScreencastTracingRecorder(page.screencast, onFrame));
      }
      _appendTraceEvent(event) {
        const visited = visitTraceEvent(event, this._state.traceSha1s);
        const flush = this._state.options.live || event.type !== "event" && event.type !== "console" && event.type !== "log";
        this._fs.appendFile(this._state.traceFile, JSON.stringify(visited) + "\n", flush);
      }
      _appendResource(sha1, buffer) {
        if (this._allResources.has(sha1))
          return;
        this._allResources.add(sha1);
        const resourcePath = import_path15.default.join(this._state.resourcesDir, sha1);
        this._fs.writeFile(
          resourcePath,
          buffer,
          true
          /* skipIfExists */
        );
      }
    };
    throttledRate = 200;
    unthrottleDuration = 500;
    ScreencastTracingRecorder = class {
      constructor(screencast, onFrame) {
        this._unthrottledUntil = 0;
        this._screencast = screencast;
        this._client = {
          onFrame: (frame) => {
            const time = monotonicTime();
            if (time < this._unthrottledUntil) {
              onFrame(frame);
              return;
            }
            if (this._pendingAck)
              return;
            onFrame(frame);
            this._pendingAck = new ManualPromise();
            this._timer = setTimeout(() => this._clearPendingAck(), throttledRate);
            return this._pendingAck;
          },
          gracefulClose: () => this.dispose(),
          dispose: () => this.dispose()
        };
        this._screencast.addClient(this._client);
      }
      dispose() {
        this._screencast.removeClient(this._client);
        this._clearPendingAck();
      }
      temporarilyDisableThrottling() {
        this._unthrottledUntil = monotonicTime() + unthrottleDuration;
        this._clearPendingAck();
      }
      _clearPendingAck() {
        this._pendingAck?.resolve();
        this._pendingAck = void 0;
        if (this._timer) {
          clearTimeout(this._timer);
          this._timer = void 0;
        }
      }
    };
  }
});

// packages/playwright-core/src/server/fetch.ts
function toHeadersArray(rawHeaders) {
  const result2 = [];
  for (let i = 0; i < rawHeaders.length; i += 2)
    result2.push({ name: rawHeaders[i], value: rawHeaders[i + 1] });
  return result2;
}
function parseCookie2(header) {
  const raw = parseRawCookie(header);
  if (!raw)
    return null;
  const cookie = {
    domain: "",
    path: "",
    expires: -1,
    httpOnly: false,
    secure: false,
    // From https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie/SameSite
    // The cookie-sending behavior if SameSite is not specified is SameSite=Lax.
    sameSite: "Lax",
    ...raw
  };
  return cookie;
}
function serializePostData(params2, headers) {
  assert((params2.postData ? 1 : 0) + (params2.jsonData ? 1 : 0) + (params2.formData ? 1 : 0) + (params2.multipartData ? 1 : 0) <= 1, `Only one of 'data', 'form' or 'multipart' can be specified`);
  if (params2.jsonData !== void 0) {
    setHeader(headers, "content-type", "application/json", true);
    return Buffer.from(params2.jsonData, "utf8");
  } else if (params2.formData) {
    const searchParams = new URLSearchParams();
    for (const { name, value: value2 } of params2.formData)
      searchParams.append(name, value2);
    setHeader(headers, "content-type", "application/x-www-form-urlencoded", true);
    return Buffer.from(searchParams.toString(), "utf8");
  } else if (params2.multipartData) {
    const formData = new MultipartFormData();
    for (const field of params2.multipartData) {
      if (field.file)
        formData.addFileField(field.name, field.file);
      else if (field.value)
        formData.addField(field.name, field.value);
    }
    setHeader(headers, "content-type", formData.contentTypeHeader(), true);
    return formData.finish();
  } else if (params2.postData !== void 0) {
    setHeader(headers, "content-type", "application/octet-stream", true);
    return params2.postData;
  }
  return void 0;
}
function setHeader(headers, name, value2, keepExisting = false) {
  const existing = Object.entries(headers).find((pair) => pair[0].toLowerCase() === name.toLowerCase());
  if (!existing)
    headers[name] = value2;
  else if (!keepExisting)
    headers[existing[0]] = value2;
}
function getHeader(headers, name) {
  const existing = Object.entries(headers).find((pair) => pair[0].toLowerCase() === name.toLowerCase());
  return existing ? existing[1] : void 0;
}
function removeHeader(headers, name) {
  const existing = Object.entries(headers).find((pair) => pair[0].toLowerCase() === name.toLowerCase());
  if (existing)
    delete headers[existing[0]];
}
function isNetworkConnectionError(e) {
  const code = e?.code;
  return code === "ECONNRESET" || code === "EPIPE" || code === "ECONNABORTED";
}
function setBasicAuthorizationHeader(headers, credentials) {
  const { username, password } = credentials;
  const encoded = Buffer.from(`${username || ""}:${password || ""}`).toString("base64");
  setHeader(headers, "authorization", `Basic ${encoded}`);
}
var import_http3, import_https3, import_stream4, import_tls3, zlib, APIRequestContext, SafeEmptyStreamTransform, BrowserContextAPIRequestContext, GlobalAPIRequestContext, redirectStatus;
var init_fetch = __esm({
  "packages/playwright-core/src/server/fetch.ts"() {
    "use strict";
    import_http3 = __toESM(require("http"));
    import_https3 = __toESM(require("https"));
    import_stream4 = require("stream");
    import_tls3 = require("tls");
    zlib = __toESM(require("zlib"));
    init_crypto();
    init_happyEyeballs();
    init_assert();
    init_urlMatch();
    init_eventsHelper();
    init_time();
    init_network();
    init_userAgent();
    init_browserContext();
    init_cookieStore();
    init_formData();
    init_errors();
    init_instrumentation();
    init_progress();
    init_socksClientCertificatesInterceptor();
    init_tracing();
    APIRequestContext = class _APIRequestContext extends SdkObject {
      constructor(parent) {
        super(parent, "request-context");
        this.fetchResponses = /* @__PURE__ */ new Map();
        this.fetchLog = /* @__PURE__ */ new Map();
        this._disposed = false;
        _APIRequestContext.allInstances.add(this);
      }
      static {
        this.Events = {
          Dispose: "dispose",
          Request: "request",
          RequestFinished: "requestfinished"
        };
      }
      static {
        this.allInstances = /* @__PURE__ */ new Set();
      }
      static findResponseBody(guid) {
        for (const request2 of _APIRequestContext.allInstances) {
          const body = request2.fetchResponses.get(guid);
          if (body)
            return body;
        }
        return void 0;
      }
      fetchResponseBody(progress2, fetchUid) {
        return this.fetchResponses.get(fetchUid);
      }
      fetchLogForUid(progress2, fetchUid) {
        return this.fetchLog.get(fetchUid) || [];
      }
      disposeResponse(progress2, fetchUid) {
        this._disposeResponse(fetchUid);
      }
      _disposeImpl() {
        this._disposed = true;
        _APIRequestContext.allInstances.delete(this);
        this.fetchResponses.clear();
        this.fetchLog.clear();
        this.emit(_APIRequestContext.Events.Dispose);
      }
      _disposeResponse(fetchUid) {
        this.fetchResponses.delete(fetchUid);
        this.fetchLog.delete(fetchUid);
      }
      _storeResponseBody(body) {
        const uid = createGuid();
        this.fetchResponses.set(uid, body);
        return uid;
      }
      async fetch(progress2, params2) {
        const defaults = this._defaultOptions();
        const headers = {
          "user-agent": defaults.userAgent,
          "accept": "*/*",
          "accept-encoding": "gzip,deflate,br"
        };
        if (defaults.extraHTTPHeaders) {
          for (const { name, value: value2 } of defaults.extraHTTPHeaders)
            setHeader(headers, name, value2);
        }
        if (params2.headers) {
          for (const { name, value: value2 } of params2.headers)
            setHeader(headers, name, value2);
        }
        const requestUrl = new URL(constructURLBasedOnBaseURL(defaults.baseURL, params2.url));
        if (params2.encodedParams) {
          requestUrl.search = params2.encodedParams;
        } else if (params2.params) {
          for (const { name, value: value2 } of params2.params)
            requestUrl.searchParams.append(name, value2);
        }
        const credentials = this._getHttpCredentials(requestUrl);
        if (credentials?.send === "always")
          setBasicAuthorizationHeader(headers, credentials);
        const method = params2.method?.toUpperCase() || "GET";
        const proxy = defaults.proxy;
        let agent;
        if (proxy?.server !== "per-context")
          agent = createProxyAgent(proxy, requestUrl);
        let maxRedirects = params2.maxRedirects ?? (defaults.maxRedirects ?? 20);
        maxRedirects = maxRedirects === 0 ? -1 : maxRedirects;
        const options = {
          method,
          headers,
          agent,
          maxRedirects,
          ...getMatchingTLSOptionsForOrigin(this._defaultOptions().clientCertificates, requestUrl.origin),
          __testHookLookup: params2.__testHookLookup
        };
        if (params2.ignoreHTTPSErrors || defaults.ignoreHTTPSErrors)
          options.rejectUnauthorized = false;
        const postData = serializePostData(params2, headers);
        if (postData)
          setHeader(headers, "content-length", String(postData.byteLength));
        const { body, log: log2, response: response2 } = await this._sendRequestWithRetries(progress2, requestUrl, options, postData, params2.maxRetries);
        const failOnStatusCode = params2.failOnStatusCode !== void 0 ? params2.failOnStatusCode : !!defaults.failOnStatusCode;
        if (failOnStatusCode && (response2.status < 200 || response2.status >= 400)) {
          let responseText = "";
          if (body.byteLength) {
            let text2 = body.toString("utf8");
            if (text2.length > 1e3)
              text2 = text2.substring(0, 997) + "...";
            responseText = `
Response text:
${text2}`;
          }
          throw new Error(`${response2.status} ${response2.statusText}${responseText}`);
        }
        const fetchUid = this._storeResponseBody(body);
        this.fetchLog.set(fetchUid, log2);
        return { ...response2, fetchUid };
      }
      _parseSetCookieHeader(responseUrl, setCookie) {
        if (!setCookie)
          return [];
        const url2 = new URL(responseUrl);
        const defaultPath = "/" + url2.pathname.substr(1).split("/").slice(0, -1).join("/");
        const cookies = [];
        for (const header of setCookie) {
          const cookie = parseCookie2(header);
          if (!cookie)
            continue;
          if (!cookie.domain)
            cookie.domain = url2.hostname;
          else
            assert(cookie.domain.startsWith(".") || !cookie.domain.includes("."));
          if (!domainMatches(url2.hostname, cookie.domain))
            continue;
          if (!cookie.path || !cookie.path.startsWith("/"))
            cookie.path = defaultPath;
          cookies.push(cookie);
        }
        return cookies;
      }
      async _updateRequestCookieHeader(progress2, url2, headers) {
        if (getHeader(headers, "cookie") !== void 0)
          return;
        const contextCookies = await this.cookies(progress2, url2);
        const cookies = contextCookies.filter((c) => new Cookie(c).matches(url2));
        if (cookies.length) {
          const valueArray = cookies.map((c) => `${c.name}=${c.value}`);
          setHeader(headers, "cookie", valueArray.join("; "));
        }
      }
      async _sendRequestWithRetries(progress2, url2, options, postData, maxRetries) {
        const log2 = [];
        maxRetries ??= 0;
        let backoff = 250;
        for (let i = 0; i <= maxRetries; i++) {
          try {
            return await this._sendRequest(progress2, log2, url2, options, postData);
          } catch (e) {
            if (isAbortError(e))
              throw e;
            e = rewriteOpenSSLErrorIfNeeded(e);
            if (maxRetries === 0)
              throw e;
            if (i === maxRetries)
              throw new Error(`Failed after ${i + 1} attempt(s): ${e}`);
            if (e.code !== "ECONNRESET")
              throw e;
            const message = `  Received ECONNRESET, will retry after ${backoff}ms.`;
            log2.push(message);
            progress2.log(message);
            await progress2.wait(backoff);
            backoff *= 2;
          }
        }
        throw new Error("Unreachable");
      }
      async _sendRequest(progress2, log2, url2, options, postData) {
        const fetchLog = (message) => {
          log2.push(message);
          progress2.log(message);
        };
        await this._updateRequestCookieHeader(progress2, url2, options.headers);
        const requestCookies = getHeader(options.headers, "cookie")?.split(";").map((p) => {
          const indexOfEquals = p.indexOf("=");
          const name = indexOfEquals !== -1 ? p.substring(0, indexOfEquals).trim() : p.trim();
          const value2 = indexOfEquals !== -1 ? p.substring(indexOfEquals + 1).trim() : "";
          return { name, value: value2 };
        }) || [];
        const requestEvent = {
          url: url2,
          method: options.method,
          headers: options.headers,
          cookies: requestCookies,
          postData
        };
        this.emit(_APIRequestContext.Events.Request, requestEvent);
        if (this._disposed)
          throw new TargetClosedError(this._closeReason || "Request context disposed.");
        let destroyRequest;
        progress2.setAllowConcurrentOrNestedRaces(true);
        const resultPromise = new Promise((fulfill, reject) => {
          const requestConstructor = (url2.protocol === "https:" ? import_https3.default : import_http3.default).request;
          const agent = options.agent || (url2.protocol === "https:" ? httpsHappyEyeballsAgent : httpHappyEyeballsAgent);
          const requestOptions = { ...options, agent };
          const startAt = monotonicTime();
          let reusedSocketAt;
          let dnsLookupAt;
          let tcpConnectionAt;
          let tlsHandshakeAt;
          let requestFinishAt;
          let serverIPAddress;
          let serverPort;
          let securityDetails;
          const listeners = [];
          const request2 = requestConstructor(url2, requestOptions, async (response2) => {
            const responseAt = monotonicTime();
            const notifyRequestFinished = (body2) => {
              const endAt = monotonicTime();
              const connectEnd = tlsHandshakeAt ?? tcpConnectionAt;
              const timings = {
                send: requestFinishAt - startAt,
                wait: responseAt - requestFinishAt,
                receive: endAt - responseAt,
                dns: dnsLookupAt ? dnsLookupAt - startAt : -1,
                connect: connectEnd ? connectEnd - startAt : -1,
                // "If [ssl] is defined then the time is also included in the connect field "
                ssl: tlsHandshakeAt ? tlsHandshakeAt - tcpConnectionAt : -1,
                blocked: reusedSocketAt ? reusedSocketAt - startAt : -1
              };
              const requestFinishedEvent = {
                requestEvent,
                httpVersion: response2.httpVersion,
                statusCode: response2.statusCode || 0,
                statusMessage: response2.statusMessage || "",
                headers: response2.headers,
                rawHeaders: response2.rawHeaders,
                cookies,
                body: body2,
                timings,
                serverIPAddress,
                serverPort,
                securityDetails
              };
              this.emit(_APIRequestContext.Events.RequestFinished, requestFinishedEvent);
            };
            fetchLog(`\u2190 ${response2.statusCode} ${response2.statusMessage}`);
            for (const [name, value2] of Object.entries(response2.headers))
              fetchLog(`  ${name}: ${value2}`);
            const cookies = this._parseSetCookieHeader(response2.url || url2.toString(), response2.headers["set-cookie"]);
            if (cookies.length) {
              try {
                await this.addCookies(cookies);
              } catch (e) {
                await Promise.all(cookies.map((c) => this.addCookies([c]).catch(() => {
                })));
              }
            }
            if (redirectStatus.includes(response2.statusCode) && options.maxRedirects >= 0) {
              if (options.maxRedirects === 0) {
                reject(new Error("Max redirect count exceeded"));
                request2.destroy();
                return;
              }
              const headers = { ...options.headers };
              removeHeader(headers, `cookie`);
              const status = response2.statusCode;
              let method = options.method;
              if ((status === 301 || status === 302) && method === "POST" || status === 303 && !["GET", "HEAD"].includes(method)) {
                method = "GET";
                postData = void 0;
                removeHeader(headers, `content-encoding`);
                removeHeader(headers, `content-language`);
                removeHeader(headers, `content-length`);
                removeHeader(headers, `content-location`);
                removeHeader(headers, `content-type`);
              }
              const redirectOptions = {
                method,
                headers,
                agent: options.agent,
                maxRedirects: options.maxRedirects - 1,
                __testHookLookup: options.__testHookLookup
              };
              if (options.rejectUnauthorized === false)
                redirectOptions.rejectUnauthorized = false;
              const locationHeaderValue = Buffer.from(response2.headers.location ?? "", "latin1").toString("utf8");
              if (locationHeaderValue) {
                let locationURL;
                try {
                  locationURL = new URL(locationHeaderValue, url2);
                } catch (error) {
                  reject(new Error(`uri requested responds with an invalid redirect URL: ${locationHeaderValue}`));
                  request2.destroy();
                  return;
                }
                if (headers["host"])
                  headers["host"] = locationURL.host;
                if (locationURL.origin !== url2.origin)
                  removeHeader(headers, "authorization");
                Object.assign(
                  redirectOptions,
                  getMatchingTLSOptionsForOrigin(this._defaultOptions().clientCertificates, locationURL.origin)
                );
                notifyRequestFinished();
                fulfill(this._sendRequest(progress2, log2, locationURL, redirectOptions, postData));
                request2.destroy();
                return;
              }
            }
            if (response2.statusCode === 401 && !getHeader(options.headers, "authorization")) {
              const auth = response2.headers["www-authenticate"];
              const credentials = this._getHttpCredentials(url2);
              if (auth?.trim().startsWith("Basic") && credentials) {
                setBasicAuthorizationHeader(options.headers, credentials);
                notifyRequestFinished();
                fulfill(this._sendRequest(progress2, log2, url2, options, postData));
                request2.destroy();
                return;
              }
            }
            const chunks = [];
            const notifyBodyFinished = () => {
              const body2 = Buffer.concat(chunks);
              notifyRequestFinished(body2);
              fulfill({
                body: body2,
                log: log2,
                response: {
                  url: response2.url || url2.toString(),
                  status: response2.statusCode || 0,
                  statusText: response2.statusMessage || "",
                  headers: toHeadersArray(response2.rawHeaders),
                  securityDetails,
                  serverAddr: serverIPAddress !== void 0 && serverPort !== void 0 ? { ipAddress: serverIPAddress, port: serverPort } : void 0
                }
              });
            };
            let body = response2;
            let transform2;
            const encoding = response2.headers["content-encoding"];
            if (encoding === "gzip" || encoding === "x-gzip") {
              transform2 = zlib.createGunzip({
                flush: zlib.constants.Z_SYNC_FLUSH,
                finishFlush: zlib.constants.Z_SYNC_FLUSH
              });
            } else if (encoding === "br") {
              transform2 = zlib.createBrotliDecompress({
                flush: zlib.constants.BROTLI_OPERATION_FLUSH,
                finishFlush: zlib.constants.BROTLI_OPERATION_FLUSH
              });
            } else if (encoding === "deflate") {
              transform2 = zlib.createInflate();
            }
            if (transform2) {
              const emptyStreamTransform = new SafeEmptyStreamTransform(notifyBodyFinished);
              body = (0, import_stream4.pipeline)(response2, emptyStreamTransform, transform2, (e) => {
                if (e) {
                  if (isNetworkConnectionError(e))
                    reject(e);
                  else
                    reject(new Error(`failed to decompress '${encoding}' encoding: ${e.message}`));
                }
              });
              body.on("error", (e) => {
                if (isNetworkConnectionError(e))
                  reject(e);
                else
                  reject(new Error(`failed to decompress '${encoding}' encoding: ${e}`));
              });
            } else {
              response2.on("aborted", () => reject(new Error("aborted")));
              body.on("error", reject);
            }
            body.on("data", (chunk) => chunks.push(chunk));
            body.on("end", notifyBodyFinished);
          });
          request2.on("error", reject);
          destroyRequest = () => request2.destroy();
          listeners.push(
            eventsHelper.addEventListener(this, _APIRequestContext.Events.Dispose, () => {
              reject(new TargetClosedError(this._closeReason || "Request context disposed."));
              request2.destroy();
            })
          );
          request2.on("close", () => eventsHelper.removeEventListeners(listeners));
          const captureSecurityDetails = (socket) => {
            if (!(socket instanceof import_tls3.TLSSocket))
              return;
            const peerCertificate = socket.getPeerCertificate();
            securityDetails = {
              protocol: socket.getProtocol() ?? void 0,
              subjectName: peerCertificate.subject.CN,
              validFrom: new Date(peerCertificate.valid_from).getTime() / 1e3,
              validTo: new Date(peerCertificate.valid_to).getTime() / 1e3,
              issuer: peerCertificate.issuer.CN
            };
          };
          request2.on("socket", (socket) => {
            serverIPAddress = socket.remoteAddress;
            serverPort = socket.remotePort;
            if (request2.reusedSocket) {
              reusedSocketAt = monotonicTime();
              captureSecurityDetails(socket);
              return;
            }
            const happyEyeBallsTimings = timingForSocket(socket);
            dnsLookupAt = happyEyeBallsTimings.dnsLookupAt;
            tcpConnectionAt = happyEyeBallsTimings.tcpConnectionAt;
            listeners.push(
              eventsHelper.addEventListener(socket, "lookup", () => {
                dnsLookupAt = monotonicTime();
              }),
              eventsHelper.addEventListener(socket, "connect", () => {
                tcpConnectionAt = monotonicTime();
              }),
              eventsHelper.addEventListener(socket, "secureConnect", () => {
                tlsHandshakeAt = monotonicTime();
                captureSecurityDetails(socket);
              })
            );
          });
          request2.on("finish", () => {
            requestFinishAt = monotonicTime();
          });
          fetchLog(`\u2192 ${options.method} ${url2.toString()}`);
          if (options.headers) {
            for (const [name, value2] of Object.entries(options.headers))
              fetchLog(`  ${name}: ${value2}`);
          }
          if (postData)
            request2.write(postData);
          request2.end();
        });
        return progress2.race(resultPromise).catch((error) => {
          destroyRequest?.();
          throw error;
        }).finally(() => {
          progress2.setAllowConcurrentOrNestedRaces(false);
        });
      }
      _getHttpCredentials(url2) {
        if (!this._defaultOptions().httpCredentials?.origin || url2.origin.toLowerCase() === this._defaultOptions().httpCredentials?.origin?.toLowerCase())
          return this._defaultOptions().httpCredentials;
        return void 0;
      }
    };
    SafeEmptyStreamTransform = class extends import_stream4.Transform {
      constructor(onEmptyStreamCallback) {
        super();
        this._receivedSomeData = false;
        this._onEmptyStreamCallback = onEmptyStreamCallback;
      }
      _transform(chunk, encoding, callback) {
        this._receivedSomeData = true;
        callback(null, chunk);
      }
      _flush(callback) {
        if (this._receivedSomeData)
          callback(null);
        else
          this._onEmptyStreamCallback();
      }
    };
    BrowserContextAPIRequestContext = class extends APIRequestContext {
      constructor(context2) {
        super(context2);
        this._context = context2;
        context2.once(BrowserContext.Events.Close, () => this._disposeImpl());
      }
      tracing() {
        return this._context.tracing;
      }
      async dispose(options) {
        this._closeReason = options.reason;
        this.fetchResponses.clear();
      }
      _defaultOptions() {
        return {
          userAgent: this._context._options.userAgent || this._context._browser.userAgent(),
          extraHTTPHeaders: this._context._options.extraHTTPHeaders,
          failOnStatusCode: void 0,
          httpCredentials: this._context._options.httpCredentials,
          proxy: this._context._options.proxy || this._context._browser.options.proxy,
          ignoreHTTPSErrors: this._context._options.ignoreHTTPSErrors,
          baseURL: this._context._options.baseURL,
          clientCertificates: this._context._options.clientCertificates
        };
      }
      async addCookies(cookies) {
        await this._context.addCookies(cookies);
      }
      async cookies(progress2, url2) {
        return await this._context.cookies(progress2, url2.toString());
      }
      async storageState(progress2, indexedDB) {
        return this._context.storageState(progress2, indexedDB);
      }
    };
    GlobalAPIRequestContext = class extends APIRequestContext {
      constructor(playwright2, options) {
        super(playwright2);
        this._cookieStore = new CookieStore();
        this.attribution.context = this;
        if (options.storageState) {
          this._origins = options.storageState.origins?.map((origin) => ({ indexedDB: [], ...origin }));
          this._cookieStore.addCookies(options.storageState.cookies || []);
        }
        verifyClientCertificates(options.clientCertificates);
        this._options = {
          baseURL: options.baseURL,
          userAgent: options.userAgent || getUserAgent(),
          extraHTTPHeaders: options.extraHTTPHeaders,
          failOnStatusCode: !!options.failOnStatusCode,
          ignoreHTTPSErrors: !!options.ignoreHTTPSErrors,
          maxRedirects: options.maxRedirects,
          httpCredentials: options.httpCredentials,
          clientCertificates: options.clientCertificates,
          proxy: options.proxy
        };
        this._tracing = new Tracing(this, options.tracesDir);
      }
      tracing() {
        return this._tracing;
      }
      async dispose(options) {
        this._closeReason = options.reason;
        await this._tracing.flush();
        await this._tracing.deleteTmpTracesDir();
        this._disposeImpl();
      }
      _defaultOptions() {
        return this._options;
      }
      async addCookies(cookies) {
        this._cookieStore.addCookies(cookies);
      }
      async cookies(progress2, url2) {
        return this._cookieStore.cookies(url2);
      }
      async storageState(progress2, indexedDB = false) {
        return {
          cookies: this._cookieStore.allCookies(),
          origins: (this._origins || []).map((origin) => ({ ...origin, indexedDB: indexedDB ? origin.indexedDB : [] }))
        };
      }
    };
    redirectStatus = [301, 302, 303, 307, 308];
  }
});

// packages/playwright-core/src/server/utils.ts
async function fetchData(progress2, params2, onError) {
  const promise = new ManualPromise();
  const { cancel } = httpRequest(params2, async (response2) => {
    if (response2.statusCode !== 200) {
      const error = onError ? await onError(params2, response2) : new Error(`fetch failed: server returned code ${response2.statusCode}. URL: ${params2.url}`);
      promise.reject(error);
      return;
    }
    let body = "";
    response2.on("data", (chunk) => body += chunk);
    response2.on("error", (error) => promise.reject(error));
    response2.on("end", () => promise.resolve(body));
  }, (error) => promise.reject(error));
  if (!progress2)
    return promise;
  try {
    return await progress2.race(promise);
  } catch (error) {
    cancel(error);
    throw error;
  }
}
var init_utils2 = __esm({
  "packages/playwright-core/src/server/utils.ts"() {
    "use strict";
    init_manualPromise();
    init_network();
  }
});

// packages/playwright-core/src/server/registry/nativeDeps.ts
var deps;
var init_nativeDeps = __esm({
  "packages/playwright-core/src/server/registry/nativeDeps.ts"() {
    "use strict";
    deps = {
      "ubuntu20.04-x64": {
        tools: [
          "xvfb",
          "fonts-noto-color-emoji",
          "ttf-unifont",
          "libfontconfig",
          "libfreetype6",
          "xfonts-cyrillic",
          "xfonts-scalable",
          "fonts-liberation",
          "fonts-ipafont-gothic",
          "fonts-wqy-zenhei",
          "fonts-tlwg-loma-otf",
          "ttf-ubuntu-font-family"
        ],
        chromium: [
          "fonts-liberation",
          "libasound2",
          "libatk-bridge2.0-0",
          "libatk1.0-0",
          "libatspi2.0-0",
          "libcairo2",
          "libcups2",
          "libdbus-1-3",
          "libdrm2",
          "libegl1",
          "libgbm1",
          "libglib2.0-0",
          "libgtk-3-0",
          "libnspr4",
          "libnss3",
          "libpango-1.0-0",
          "libx11-6",
          "libx11-xcb1",
          "libxcb1",
          "libxcomposite1",
          "libxdamage1",
          "libxext6",
          "libxfixes3",
          "libxrandr2",
          "libxshmfence1"
        ],
        firefox: [
          "ffmpeg",
          "libatk1.0-0",
          "libcairo-gobject2",
          "libcairo2",
          "libdbus-1-3",
          "libdbus-glib-1-2",
          "libfontconfig1",
          "libfreetype6",
          "libgdk-pixbuf2.0-0",
          "libglib2.0-0",
          "libgtk-3-0",
          "libpango-1.0-0",
          "libpangocairo-1.0-0",
          "libpangoft2-1.0-0",
          "libx11-6",
          "libx11-xcb1",
          "libxcb-shm0",
          "libxcb1",
          "libxcomposite1",
          "libxcursor1",
          "libxdamage1",
          "libxext6",
          "libxfixes3",
          "libxi6",
          "libxrender1",
          "libxt6",
          "libxtst6"
        ],
        webkit: [
          "libenchant-2-2",
          "libflite1",
          "libx264-155",
          "libatk-bridge2.0-0",
          "libatk1.0-0",
          "libcairo2",
          "libegl1",
          "libenchant1c2a",
          "libepoxy0",
          "libevdev2",
          "libfontconfig1",
          "libfreetype6",
          "libgdk-pixbuf2.0-0",
          "libgl1",
          "libgles2",
          "libglib2.0-0",
          "libgtk-3-0",
          "libgudev-1.0-0",
          "libharfbuzz-icu0",
          "libharfbuzz0b",
          "libhyphen0",
          "libicu66",
          "libjpeg-turbo8",
          "libnghttp2-14",
          "libnotify4",
          "libopengl0",
          "libopenjp2-7",
          "libopus0",
          "libpango-1.0-0",
          "libpng16-16",
          "libsecret-1-0",
          "libvpx6",
          "libwayland-client0",
          "libwayland-egl1",
          "libwayland-server0",
          "libwebp6",
          "libwebpdemux2",
          "libwoff1",
          "libx11-6",
          "libxcomposite1",
          "libxdamage1",
          "libxkbcommon0",
          "libxml2",
          "libxslt1.1",
          "libatomic1",
          "libevent-2.1-7"
        ],
        lib2package: {
          "libflite.so.1": "libflite1",
          "libflite_usenglish.so.1": "libflite1",
          "libflite_cmu_grapheme_lang.so.1": "libflite1",
          "libflite_cmu_grapheme_lex.so.1": "libflite1",
          "libflite_cmu_indic_lang.so.1": "libflite1",
          "libflite_cmu_indic_lex.so.1": "libflite1",
          "libflite_cmulex.so.1": "libflite1",
          "libflite_cmu_time_awb.so.1": "libflite1",
          "libflite_cmu_us_awb.so.1": "libflite1",
          "libflite_cmu_us_kal16.so.1": "libflite1",
          "libflite_cmu_us_kal.so.1": "libflite1",
          "libflite_cmu_us_rms.so.1": "libflite1",
          "libflite_cmu_us_slt.so.1": "libflite1",
          "libx264.so": "libx264-155",
          "libasound.so.2": "libasound2",
          "libatk-1.0.so.0": "libatk1.0-0",
          "libatk-bridge-2.0.so.0": "libatk-bridge2.0-0",
          "libatspi.so.0": "libatspi2.0-0",
          "libcairo-gobject.so.2": "libcairo-gobject2",
          "libcairo.so.2": "libcairo2",
          "libcups.so.2": "libcups2",
          "libdbus-1.so.3": "libdbus-1-3",
          "libdbus-glib-1.so.2": "libdbus-glib-1-2",
          "libdrm.so.2": "libdrm2",
          "libEGL.so.1": "libegl1",
          "libenchant.so.1": "libenchant1c2a",
          "libevdev.so.2": "libevdev2",
          "libepoxy.so.0": "libepoxy0",
          "libfontconfig.so.1": "libfontconfig1",
          "libfreetype.so.6": "libfreetype6",
          "libgbm.so.1": "libgbm1",
          "libgdk_pixbuf-2.0.so.0": "libgdk-pixbuf2.0-0",
          "libgdk-3.so.0": "libgtk-3-0",
          "libgdk-x11-2.0.so.0": "libgtk2.0-0",
          "libgio-2.0.so.0": "libglib2.0-0",
          "libGL.so.1": "libgl1",
          "libGLESv2.so.2": "libgles2",
          "libglib-2.0.so.0": "libglib2.0-0",
          "libgmodule-2.0.so.0": "libglib2.0-0",
          "libgobject-2.0.so.0": "libglib2.0-0",
          "libgthread-2.0.so.0": "libglib2.0-0",
          "libgtk-3.so.0": "libgtk-3-0",
          "libgtk-x11-2.0.so.0": "libgtk2.0-0",
          "libgudev-1.0.so.0": "libgudev-1.0-0",
          "libharfbuzz-icu.so.0": "libharfbuzz-icu0",
          "libharfbuzz.so.0": "libharfbuzz0b",
          "libhyphen.so.0": "libhyphen0",
          "libicui18n.so.66": "libicu66",
          "libicuuc.so.66": "libicu66",
          "libjpeg.so.8": "libjpeg-turbo8",
          "libnotify.so.4": "libnotify4",
          "libnspr4.so": "libnspr4",
          "libnss3.so": "libnss3",
          "libnssutil3.so": "libnss3",
          "libOpenGL.so.0": "libopengl0",
          "libopenjp2.so.7": "libopenjp2-7",
          "libopus.so.0": "libopus0",
          "libpango-1.0.so.0": "libpango-1.0-0",
          "libpangocairo-1.0.so.0": "libpangocairo-1.0-0",
          "libpangoft2-1.0.so.0": "libpangoft2-1.0-0",
          "libpng16.so.16": "libpng16-16",
          "libsecret-1.so.0": "libsecret-1-0",
          "libsmime3.so": "libnss3",
          "libvpx.so.6": "libvpx6",
          "libwayland-client.so.0": "libwayland-client0",
          "libwayland-egl.so.1": "libwayland-egl1",
          "libwayland-server.so.0": "libwayland-server0",
          "libwebp.so.6": "libwebp6",
          "libwebpdemux.so.2": "libwebpdemux2",
          "libwoff2dec.so.1.0.2": "libwoff1",
          "libX11-xcb.so.1": "libx11-xcb1",
          "libX11.so.6": "libx11-6",
          "libxcb-dri3.so.0": "libxcb-dri3-0",
          "libxcb-shm.so.0": "libxcb-shm0",
          "libxcb.so.1": "libxcb1",
          "libXcomposite.so.1": "libxcomposite1",
          "libXcursor.so.1": "libxcursor1",
          "libXdamage.so.1": "libxdamage1",
          "libXext.so.6": "libxext6",
          "libXfixes.so.3": "libxfixes3",
          "libXi.so.6": "libxi6",
          "libxkbcommon.so.0": "libxkbcommon0",
          "libxml2.so.2": "libxml2",
          "libXrandr.so.2": "libxrandr2",
          "libXrender.so.1": "libxrender1",
          "libxslt.so.1": "libxslt1.1",
          "libXt.so.6": "libxt6",
          "libXtst.so.6": "libxtst6",
          "libxshmfence.so.1": "libxshmfence1",
          "libatomic.so.1": "libatomic1",
          "libenchant-2.so.2": "libenchant-2-2",
          "libevent-2.1.so.7": "libevent-2.1-7"
        }
      },
      "ubuntu22.04-x64": {
        tools: [
          "xvfb",
          "fonts-noto-color-emoji",
          "fonts-unifont",
          "libfontconfig1",
          "libfreetype6",
          "xfonts-cyrillic",
          "xfonts-scalable",
          "fonts-liberation",
          "fonts-ipafont-gothic",
          "fonts-wqy-zenhei",
          "fonts-tlwg-loma-otf",
          "fonts-freefont-ttf"
        ],
        chromium: [
          "libasound2",
          "libatk-bridge2.0-0",
          "libatk1.0-0",
          "libatspi2.0-0",
          "libcairo2",
          "libcups2",
          "libdbus-1-3",
          "libdrm2",
          "libgbm1",
          "libglib2.0-0",
          "libnspr4",
          "libnss3",
          "libpango-1.0-0",
          "libwayland-client0",
          "libx11-6",
          "libxcb1",
          "libxcomposite1",
          "libxdamage1",
          "libxext6",
          "libxfixes3",
          "libxkbcommon0",
          "libxrandr2"
        ],
        firefox: [
          "ffmpeg",
          "libasound2",
          "libatk1.0-0",
          "libcairo-gobject2",
          "libcairo2",
          "libdbus-1-3",
          "libdbus-glib-1-2",
          "libfontconfig1",
          "libfreetype6",
          "libgdk-pixbuf-2.0-0",
          "libglib2.0-0",
          "libgtk-3-0",
          "libpango-1.0-0",
          "libpangocairo-1.0-0",
          "libx11-6",
          "libx11-xcb1",
          "libxcb-shm0",
          "libxcb1",
          "libxcomposite1",
          "libxcursor1",
          "libxdamage1",
          "libxext6",
          "libxfixes3",
          "libxi6",
          "libxrandr2",
          "libxrender1",
          "libxtst6"
        ],
        webkit: [
          "libsoup-3.0-0",
          "libenchant-2-2",
          "gstreamer1.0-libav",
          "gstreamer1.0-plugins-bad",
          "gstreamer1.0-plugins-base",
          "gstreamer1.0-plugins-good",
          "libicu70",
          "libatk-bridge2.0-0",
          "libatk1.0-0",
          "libcairo2",
          "libdbus-1-3",
          "libdrm2",
          "libegl1",
          "libepoxy0",
          "libevdev2",
          "libffi7",
          "libfontconfig1",
          "libfreetype6",
          "libgbm1",
          "libgdk-pixbuf-2.0-0",
          "libgles2",
          "libglib2.0-0",
          "libglx0",
          "libgstreamer-gl1.0-0",
          "libgstreamer-plugins-base1.0-0",
          "libgstreamer1.0-0",
          "libgtk-4-1",
          "libgudev-1.0-0",
          "libharfbuzz-icu0",
          "libharfbuzz0b",
          "libhyphen0",
          "libjpeg-turbo8",
          "liblcms2-2",
          "libmanette-0.2-0",
          "libnotify4",
          "libopengl0",
          "libopenjp2-7",
          "libopus0",
          "libpango-1.0-0",
          "libpng16-16",
          "libproxy1v5",
          "libsecret-1-0",
          "libwayland-client0",
          "libwayland-egl1",
          "libwayland-server0",
          "libwebpdemux2",
          "libwoff1",
          "libx11-6",
          "libxcomposite1",
          "libxdamage1",
          "libxkbcommon0",
          "libxml2",
          "libxslt1.1",
          "libx264-163",
          "libatomic1",
          "libevent-2.1-7",
          "libavif13"
        ],
        lib2package: {
          "libavif.so.13": "libavif13",
          "libsoup-3.0.so.0": "libsoup-3.0-0",
          "libasound.so.2": "libasound2",
          "libatk-1.0.so.0": "libatk1.0-0",
          "libatk-bridge-2.0.so.0": "libatk-bridge2.0-0",
          "libatspi.so.0": "libatspi2.0-0",
          "libcairo-gobject.so.2": "libcairo-gobject2",
          "libcairo.so.2": "libcairo2",
          "libcups.so.2": "libcups2",
          "libdbus-1.so.3": "libdbus-1-3",
          "libdbus-glib-1.so.2": "libdbus-glib-1-2",
          "libdrm.so.2": "libdrm2",
          "libEGL.so.1": "libegl1",
          "libepoxy.so.0": "libepoxy0",
          "libevdev.so.2": "libevdev2",
          "libffi.so.7": "libffi7",
          "libfontconfig.so.1": "libfontconfig1",
          "libfreetype.so.6": "libfreetype6",
          "libgbm.so.1": "libgbm1",
          "libgdk_pixbuf-2.0.so.0": "libgdk-pixbuf-2.0-0",
          "libgdk-3.so.0": "libgtk-3-0",
          "libgio-2.0.so.0": "libglib2.0-0",
          "libGLESv2.so.2": "libgles2",
          "libglib-2.0.so.0": "libglib2.0-0",
          "libGLX.so.0": "libglx0",
          "libgmodule-2.0.so.0": "libglib2.0-0",
          "libgobject-2.0.so.0": "libglib2.0-0",
          "libgstallocators-1.0.so.0": "libgstreamer-plugins-base1.0-0",
          "libgstapp-1.0.so.0": "libgstreamer-plugins-base1.0-0",
          "libgstaudio-1.0.so.0": "libgstreamer-plugins-base1.0-0",
          "libgstbase-1.0.so.0": "libgstreamer1.0-0",
          "libgstfft-1.0.so.0": "libgstreamer-plugins-base1.0-0",
          "libgstgl-1.0.so.0": "libgstreamer-gl1.0-0",
          "libgstpbutils-1.0.so.0": "libgstreamer-plugins-base1.0-0",
          "libgstreamer-1.0.so.0": "libgstreamer1.0-0",
          "libgsttag-1.0.so.0": "libgstreamer-plugins-base1.0-0",
          "libgstvideo-1.0.so.0": "libgstreamer-plugins-base1.0-0",
          "libgtk-3.so.0": "libgtk-3-0",
          "libgtk-4.so.1": "libgtk-4-1",
          "libgudev-1.0.so.0": "libgudev-1.0-0",
          "libharfbuzz-icu.so.0": "libharfbuzz-icu0",
          "libharfbuzz.so.0": "libharfbuzz0b",
          "libhyphen.so.0": "libhyphen0",
          "libjpeg.so.8": "libjpeg-turbo8",
          "liblcms2.so.2": "liblcms2-2",
          "libmanette-0.2.so.0": "libmanette-0.2-0",
          "libnotify.so.4": "libnotify4",
          "libnspr4.so": "libnspr4",
          "libnss3.so": "libnss3",
          "libnssutil3.so": "libnss3",
          "libOpenGL.so.0": "libopengl0",
          "libopenjp2.so.7": "libopenjp2-7",
          "libopus.so.0": "libopus0",
          "libpango-1.0.so.0": "libpango-1.0-0",
          "libpangocairo-1.0.so.0": "libpangocairo-1.0-0",
          "libpng16.so.16": "libpng16-16",
          "libproxy.so.1": "libproxy1v5",
          "libsecret-1.so.0": "libsecret-1-0",
          "libsmime3.so": "libnss3",
          "libwayland-client.so.0": "libwayland-client0",
          "libwayland-egl.so.1": "libwayland-egl1",
          "libwayland-server.so.0": "libwayland-server0",
          "libwebpdemux.so.2": "libwebpdemux2",
          "libwoff2dec.so.1.0.2": "libwoff1",
          "libX11-xcb.so.1": "libx11-xcb1",
          "libX11.so.6": "libx11-6",
          "libxcb-shm.so.0": "libxcb-shm0",
          "libxcb.so.1": "libxcb1",
          "libXcomposite.so.1": "libxcomposite1",
          "libXcursor.so.1": "libxcursor1",
          "libXdamage.so.1": "libxdamage1",
          "libXext.so.6": "libxext6",
          "libXfixes.so.3": "libxfixes3",
          "libXi.so.6": "libxi6",
          "libxkbcommon.so.0": "libxkbcommon0",
          "libxml2.so.2": "libxml2",
          "libXrandr.so.2": "libxrandr2",
          "libXrender.so.1": "libxrender1",
          "libxslt.so.1": "libxslt1.1",
          "libXtst.so.6": "libxtst6",
          "libicui18n.so.60": "libicu70",
          "libicuuc.so.66": "libicu70",
          "libicui18n.so.66": "libicu70",
          "libwebp.so.6": "libwebp6",
          "libenchant-2.so.2": "libenchant-2-2",
          "libx264.so": "libx264-163",
          "libvpx.so.7": "libvpx7",
          "libatomic.so.1": "libatomic1",
          "libevent-2.1.so.7": "libevent-2.1-7"
        }
      },
      "ubuntu24.04-x64": {
        tools: [
          "xvfb",
          "fonts-noto-color-emoji",
          "fonts-unifont",
          "libfontconfig1",
          "libfreetype6",
          "xfonts-cyrillic",
          "xfonts-scalable",
          "fonts-liberation",
          "fonts-ipafont-gothic",
          "fonts-wqy-zenhei",
          "fonts-tlwg-loma-otf",
          "fonts-freefont-ttf"
        ],
        chromium: [
          "libasound2t64",
          "libatk-bridge2.0-0t64",
          "libatk1.0-0t64",
          "libatspi2.0-0t64",
          "libcairo2",
          "libcups2t64",
          "libdbus-1-3",
          "libdrm2",
          "libgbm1",
          "libglib2.0-0t64",
          "libnspr4",
          "libnss3",
          "libpango-1.0-0",
          "libx11-6",
          "libxcb1",
          "libxcomposite1",
          "libxdamage1",
          "libxext6",
          "libxfixes3",
          "libxkbcommon0",
          "libxrandr2"
        ],
        firefox: [
          "libasound2t64",
          "libatk1.0-0t64",
          "libavcodec60",
          "libcairo-gobject2",
          "libcairo2",
          "libdbus-1-3",
          "libfontconfig1",
          "libfreetype6",
          "libgdk-pixbuf-2.0-0",
          "libglib2.0-0t64",
          "libgtk-3-0t64",
          "libpango-1.0-0",
          "libpangocairo-1.0-0",
          "libx11-6",
          "libx11-xcb1",
          "libxcb-shm0",
          "libxcb1",
          "libxcomposite1",
          "libxcursor1",
          "libxdamage1",
          "libxext6",
          "libxfixes3",
          "libxi6",
          "libxrandr2",
          "libxrender1"
        ],
        webkit: [
          "gstreamer1.0-libav",
          "gstreamer1.0-plugins-bad",
          "gstreamer1.0-plugins-base",
          "gstreamer1.0-plugins-good",
          "libicu74",
          "libatomic1",
          "libatk-bridge2.0-0t64",
          "libatk1.0-0t64",
          "libcairo-gobject2",
          "libcairo2",
          "libdbus-1-3",
          "libdrm2",
          "libenchant-2-2",
          "libepoxy0",
          "libevent-2.1-7t64",
          "libflite1",
          "libfontconfig1",
          "libfreetype6",
          "libgbm1",
          "libgdk-pixbuf-2.0-0",
          "libgles2",
          "libglib2.0-0t64",
          "libgstreamer-gl1.0-0",
          "libgstreamer-plugins-bad1.0-0",
          "libgstreamer-plugins-base1.0-0",
          "libgstreamer1.0-0",
          "libgtk-4-1",
          "libharfbuzz-icu0",
          "libharfbuzz0b",
          "libhyphen0",
          "libicu74",
          "libjpeg-turbo8",
          "liblcms2-2",
          "libmanette-0.2-0",
          "libopus0",
          "libpango-1.0-0",
          "libpangocairo-1.0-0",
          "libpng16-16t64",
          "libsecret-1-0",
          "libvpx9",
          "libwayland-client0",
          "libwayland-egl1",
          "libwayland-server0",
          "libwebp7",
          "libwebpdemux2",
          "libwoff1",
          "libx11-6",
          "libxkbcommon0",
          "libxml2",
          "libxslt1.1",
          "libx264-164",
          "libavif16"
        ],
        lib2package: {
          "libavif.so.16": "libavif16",
          "libasound.so.2": "libasound2t64",
          "libatk-1.0.so.0": "libatk1.0-0t64",
          "libatk-bridge-2.0.so.0": "libatk-bridge2.0-0t64",
          "libatomic.so.1": "libatomic1",
          "libatspi.so.0": "libatspi2.0-0t64",
          "libcairo-gobject.so.2": "libcairo-gobject2",
          "libcairo.so.2": "libcairo2",
          "libcups.so.2": "libcups2t64",
          "libdbus-1.so.3": "libdbus-1-3",
          "libdrm.so.2": "libdrm2",
          "libenchant-2.so.2": "libenchant-2-2",
          "libepoxy.so.0": "libepoxy0",
          "libevent-2.1.so.7": "libevent-2.1-7t64",
          "libflite_cmu_grapheme_lang.so.1": "libflite1",
          "libflite_cmu_grapheme_lex.so.1": "libflite1",
          "libflite_cmu_indic_lang.so.1": "libflite1",
          "libflite_cmu_indic_lex.so.1": "libflite1",
          "libflite_cmu_time_awb.so.1": "libflite1",
          "libflite_cmu_us_awb.so.1": "libflite1",
          "libflite_cmu_us_kal.so.1": "libflite1",
          "libflite_cmu_us_kal16.so.1": "libflite1",
          "libflite_cmu_us_rms.so.1": "libflite1",
          "libflite_cmu_us_slt.so.1": "libflite1",
          "libflite_cmulex.so.1": "libflite1",
          "libflite_usenglish.so.1": "libflite1",
          "libflite.so.1": "libflite1",
          "libfontconfig.so.1": "libfontconfig1",
          "libfreetype.so.6": "libfreetype6",
          "libgbm.so.1": "libgbm1",
          "libgdk_pixbuf-2.0.so.0": "libgdk-pixbuf-2.0-0",
          "libgdk-3.so.0": "libgtk-3-0t64",
          "libgio-2.0.so.0": "libglib2.0-0t64",
          "libGLESv2.so.2": "libgles2",
          "libglib-2.0.so.0": "libglib2.0-0t64",
          "libgmodule-2.0.so.0": "libglib2.0-0t64",
          "libgobject-2.0.so.0": "libglib2.0-0t64",
          "libgstallocators-1.0.so.0": "libgstreamer-plugins-base1.0-0",
          "libgstapp-1.0.so.0": "libgstreamer-plugins-base1.0-0",
          "libgstaudio-1.0.so.0": "libgstreamer-plugins-base1.0-0",
          "libgstbase-1.0.so.0": "libgstreamer1.0-0",
          "libgstcodecparsers-1.0.so.0": "libgstreamer-plugins-bad1.0-0",
          "libgstfft-1.0.so.0": "libgstreamer-plugins-base1.0-0",
          "libgstgl-1.0.so.0": "libgstreamer-gl1.0-0",
          "libgstpbutils-1.0.so.0": "libgstreamer-plugins-base1.0-0",
          "libgstreamer-1.0.so.0": "libgstreamer1.0-0",
          "libgsttag-1.0.so.0": "libgstreamer-plugins-base1.0-0",
          "libgstvideo-1.0.so.0": "libgstreamer-plugins-base1.0-0",
          "libgtk-3.so.0": "libgtk-3-0t64",
          "libgtk-4.so.1": "libgtk-4-1",
          "libharfbuzz-icu.so.0": "libharfbuzz-icu0",
          "libharfbuzz.so.0": "libharfbuzz0b",
          "libhyphen.so.0": "libhyphen0",
          "libicudata.so.74": "libicu74",
          "libicui18n.so.74": "libicu74",
          "libicuuc.so.74": "libicu74",
          "libjpeg.so.8": "libjpeg-turbo8",
          "liblcms2.so.2": "liblcms2-2",
          "libmanette-0.2.so.0": "libmanette-0.2-0",
          "libnspr4.so": "libnspr4",
          "libnss3.so": "libnss3",
          "libnssutil3.so": "libnss3",
          "libopus.so.0": "libopus0",
          "libpango-1.0.so.0": "libpango-1.0-0",
          "libpangocairo-1.0.so.0": "libpangocairo-1.0-0",
          "libpng16.so.16": "libpng16-16t64",
          "libsecret-1.so.0": "libsecret-1-0",
          "libsmime3.so": "libnss3",
          "libsoup-3.0.so.0": "libsoup-3.0-0",
          "libvpx.so.9": "libvpx9",
          "libwayland-client.so.0": "libwayland-client0",
          "libwayland-egl.so.1": "libwayland-egl1",
          "libwayland-server.so.0": "libwayland-server0",
          "libwebp.so.7": "libwebp7",
          "libwebpdemux.so.2": "libwebpdemux2",
          "libwoff2dec.so.1.0.2": "libwoff1",
          "libX11-xcb.so.1": "libx11-xcb1",
          "libX11.so.6": "libx11-6",
          "libxcb-shm.so.0": "libxcb-shm0",
          "libxcb.so.1": "libxcb1",
          "libXcomposite.so.1": "libxcomposite1",
          "libXcursor.so.1": "libxcursor1",
          "libXdamage.so.1": "libxdamage1",
          "libXext.so.6": "libxext6",
          "libXfixes.so.3": "libxfixes3",
          "libXi.so.6": "libxi6",
          "libxkbcommon.so.0": "libxkbcommon0",
          "libxml2.so.2": "libxml2",
          "libXrandr.so.2": "libxrandr2",
          "libXrender.so.1": "libxrender1",
          "libxslt.so.1": "libxslt1.1",
          "libx264.so": "libx264-164"
        }
      },
      "ubuntu26.04-x64": {
        tools: [
          "xvfb",
          "fonts-noto-color-emoji",
          "fonts-unifont",
          "libfontconfig1",
          "libfreetype6",
          "xfonts-cyrillic",
          "xfonts-scalable",
          "fonts-liberation",
          "fonts-ipafont-gothic",
          "fonts-wqy-zenhei",
          "fonts-tlwg-loma-otf",
          "fonts-freefont-ttf"
        ],
        chromium: [
          "libasound2t64",
          "libatk-bridge2.0-0t64",
          "libatk1.0-0t64",
          "libatspi2.0-0t64",
          "libcairo2",
          "libcups2t64",
          "libdbus-1-3",
          "libdrm2",
          "libgbm1",
          "libglib2.0-0t64",
          "libnspr4",
          "libnss3",
          "libpango-1.0-0",
          "libx11-6",
          "libxcb1",
          "libxcomposite1",
          "libxdamage1",
          "libxext6",
          "libxfixes3",
          "libxkbcommon0",
          "libxrandr2"
        ],
        firefox: [
          "libasound2t64",
          "libatk1.0-0t64",
          "libavcodec62",
          "libcairo-gobject2",
          "libcairo2",
          "libdbus-1-3",
          "libfontconfig1",
          "libfreetype6",
          "libgdk-pixbuf-2.0-0",
          "libglib2.0-0t64",
          "libgtk-3-0t64",
          "libpango-1.0-0",
          "libpangocairo-1.0-0",
          "libx11-6",
          "libx11-xcb1",
          "libxcb-shm0",
          "libxcb1",
          "libxcomposite1",
          "libxcursor1",
          "libxdamage1",
          "libxext6",
          "libxfixes3",
          "libxi6",
          "libxrandr2",
          "libxrender1"
        ],
        webkit: [
          "gstreamer1.0-libav",
          "gstreamer1.0-plugins-bad",
          "gstreamer1.0-plugins-base",
          "gstreamer1.0-plugins-good",
          "libicu78",
          "libatomic1",
          "libatk-bridge2.0-0t64",
          "libatk1.0-0t64",
          "libcairo-gobject2",
          "libcairo2",
          "libdbus-1-3",
          "libdrm2",
          "libenchant-2-2",
          "libepoxy0",
          "libevent-2.1-7t64",
          "libflite1",
          "libfontconfig1",
          "libfreetype6",
          "libgbm1",
          "libgdk-pixbuf-2.0-0",
          "libgles2",
          "libglib2.0-0t64",
          "libgstreamer-gl1.0-0",
          "libgstreamer-plugins-bad1.0-0",
          "libgstreamer-plugins-base1.0-0",
          "libgstreamer1.0-0",
          "libgtk-4-1",
          "libharfbuzz-icu0",
          "libharfbuzz0b",
          "libhyphen0",
          "libjpeg-turbo8",
          "liblcms2-2",
          "libmanette-0.2-0",
          "libopus0",
          "libpango-1.0-0",
          "libpangocairo-1.0-0",
          "libpng16-16t64",
          "libsecret-1-0",
          "libvpx12",
          "libwayland-client0",
          "libwayland-egl1",
          "libwayland-server0",
          "libwebp7",
          "libwebpdemux2",
          "libwoff1",
          "libx11-6",
          "libxkbcommon0",
          "libxml2-16",
          "libxslt1.1",
          "libx264-165",
          "libavif16"
        ],
        lib2package: {
          "libavif.so.16": "libavif16",
          "libasound.so.2": "libasound2t64",
          "libatk-1.0.so.0": "libatk1.0-0t64",
          "libatk-bridge-2.0.so.0": "libatk-bridge2.0-0t64",
          "libatomic.so.1": "libatomic1",
          "libatspi.so.0": "libatspi2.0-0t64",
          "libcairo-gobject.so.2": "libcairo-gobject2",
          "libcairo.so.2": "libcairo2",
          "libcups.so.2": "libcups2t64",
          "libdbus-1.so.3": "libdbus-1-3",
          "libdrm.so.2": "libdrm2",
          "libenchant-2.so.2": "libenchant-2-2",
          "libepoxy.so.0": "libepoxy0",
          "libevent-2.1.so.7": "libevent-2.1-7t64",
          "libflite_cmu_grapheme_lang.so.1": "libflite1",
          "libflite_cmu_grapheme_lex.so.1": "libflite1",
          "libflite_cmu_indic_lang.so.1": "libflite1",
          "libflite_cmu_indic_lex.so.1": "libflite1",
          "libflite_cmu_time_awb.so.1": "libflite1",
          "libflite_cmu_us_awb.so.1": "libflite1",
          "libflite_cmu_us_kal.so.1": "libflite1",
          "libflite_cmu_us_kal16.so.1": "libflite1",
          "libflite_cmu_us_rms.so.1": "libflite1",
          "libflite_cmu_us_slt.so.1": "libflite1",
          "libflite_cmulex.so.1": "libflite1",
          "libflite_usenglish.so.1": "libflite1",
          "libflite.so.1": "libflite1",
          "libfontconfig.so.1": "libfontconfig1",
          "libfreetype.so.6": "libfreetype6",
          "libgbm.so.1": "libgbm1",
          "libgdk_pixbuf-2.0.so.0": "libgdk-pixbuf-2.0-0",
          "libgdk-3.so.0": "libgtk-3-0t64",
          "libgio-2.0.so.0": "libglib2.0-0t64",
          "libGLESv2.so.2": "libgles2",
          "libglib-2.0.so.0": "libglib2.0-0t64",
          "libgmodule-2.0.so.0": "libglib2.0-0t64",
          "libgobject-2.0.so.0": "libglib2.0-0t64",
          "libgstallocators-1.0.so.0": "libgstreamer-plugins-base1.0-0",
          "libgstapp-1.0.so.0": "libgstreamer-plugins-base1.0-0",
          "libgstaudio-1.0.so.0": "libgstreamer-plugins-base1.0-0",
          "libgstbase-1.0.so.0": "libgstreamer1.0-0",
          "libgstcodecparsers-1.0.so.0": "libgstreamer-plugins-bad1.0-0",
          "libgstfft-1.0.so.0": "libgstreamer-plugins-base1.0-0",
          "libgstgl-1.0.so.0": "libgstreamer-gl1.0-0",
          "libgstpbutils-1.0.so.0": "libgstreamer-plugins-base1.0-0",
          "libgstreamer-1.0.so.0": "libgstreamer1.0-0",
          "libgsttag-1.0.so.0": "libgstreamer-plugins-base1.0-0",
          "libgstvideo-1.0.so.0": "libgstreamer-plugins-base1.0-0",
          "libgtk-3.so.0": "libgtk-3-0t64",
          "libgtk-4.so.1": "libgtk-4-1",
          "libharfbuzz-icu.so.0": "libharfbuzz-icu0",
          "libharfbuzz.so.0": "libharfbuzz0b",
          "libhyphen.so.0": "libhyphen0",
          "libicudata.so.78": "libicu78",
          "libicui18n.so.78": "libicu78",
          "libicuuc.so.78": "libicu78",
          "libjpeg.so.8": "libjpeg-turbo8",
          "liblcms2.so.2": "liblcms2-2",
          "libmanette-0.2.so.0": "libmanette-0.2-0",
          "libnspr4.so": "libnspr4",
          "libnss3.so": "libnss3",
          "libnssutil3.so": "libnss3",
          "libopus.so.0": "libopus0",
          "libpango-1.0.so.0": "libpango-1.0-0",
          "libpangocairo-1.0.so.0": "libpangocairo-1.0-0",
          "libpng16.so.16": "libpng16-16t64",
          "libsecret-1.so.0": "libsecret-1-0",
          "libsmime3.so": "libnss3",
          "libsoup-3.0.so.0": "libsoup-3.0-0",
          "libvpx.so.12": "libvpx12",
          "libwayland-client.so.0": "libwayland-client0",
          "libwayland-egl.so.1": "libwayland-egl1",
          "libwayland-server.so.0": "libwayland-server0",
          "libwebp.so.7": "libwebp7",
          "libwebpdemux.so.2": "libwebpdemux2",
          "libwoff2dec.so.1.0.2": "libwoff1",
          "libX11-xcb.so.1": "libx11-xcb1",
          "libX11.so.6": "libx11-6",
          "libxcb-shm.so.0": "libxcb-shm0",
          "libxcb.so.1": "libxcb1",
          "libXcomposite.so.1": "libxcomposite1",
          "libXcursor.so.1": "libxcursor1",
          "libXdamage.so.1": "libxdamage1",
          "libXext.so.6": "libxext6",
          "libXfixes.so.3": "libxfixes3",
          "libXi.so.6": "libxi6",
          "libxkbcommon.so.0": "libxkbcommon0",
          "libxml2.so.16": "libxml2-16",
          "libXrandr.so.2": "libxrandr2",
          "libXrender.so.1": "libxrender1",
          "libxslt.so.1": "libxslt1.1",
          "libx264.so": "libx264-165"
        }
      },
      "debian11-x64": {
        tools: [
          "xvfb",
          "fonts-noto-color-emoji",
          "fonts-unifont",
          "libfontconfig1",
          "libfreetype6",
          "xfonts-cyrillic",
          "xfonts-scalable",
          "fonts-liberation",
          "fonts-ipafont-gothic",
          "fonts-wqy-zenhei",
          "fonts-tlwg-loma-otf",
          "fonts-freefont-ttf"
        ],
        chromium: [
          "libasound2",
          "libatk-bridge2.0-0",
          "libatk1.0-0",
          "libatspi2.0-0",
          "libcairo2",
          "libcups2",
          "libdbus-1-3",
          "libdrm2",
          "libgbm1",
          "libglib2.0-0",
          "libnspr4",
          "libnss3",
          "libpango-1.0-0",
          "libwayland-client0",
          "libx11-6",
          "libxcb1",
          "libxcomposite1",
          "libxdamage1",
          "libxext6",
          "libxfixes3",
          "libxkbcommon0",
          "libxrandr2"
        ],
        firefox: [
          "libasound2",
          "libatk1.0-0",
          "libavcodec58",
          "libcairo-gobject2",
          "libcairo2",
          "libdbus-1-3",
          "libdbus-glib-1-2",
          "libfontconfig1",
          "libfreetype6",
          "libgdk-pixbuf-2.0-0",
          "libglib2.0-0",
          "libgtk-3-0",
          "libharfbuzz0b",
          "libpango-1.0-0",
          "libpangocairo-1.0-0",
          "libx11-6",
          "libx11-xcb1",
          "libxcb-shm0",
          "libxcb1",
          "libxcomposite1",
          "libxcursor1",
          "libxdamage1",
          "libxext6",
          "libxfixes3",
          "libxi6",
          "libxrandr2",
          "libxrender1",
          "libxtst6"
        ],
        webkit: [
          "gstreamer1.0-libav",
          "gstreamer1.0-plugins-bad",
          "gstreamer1.0-plugins-base",
          "gstreamer1.0-plugins-good",
          "libatk-bridge2.0-0",
          "libatk1.0-0",
          "libcairo2",
          "libdbus-1-3",
          "libdrm2",
          "libegl1",
          "libenchant-2-2",
          "libepoxy0",
          "libevdev2",
          "libfontconfig1",
          "libfreetype6",
          "libgbm1",
          "libgdk-pixbuf-2.0-0",
          "libgles2",
          "libglib2.0-0",
          "libglx0",
          "libgstreamer-gl1.0-0",
          "libgstreamer-plugins-base1.0-0",
          "libgstreamer1.0-0",
          "libgtk-3-0",
          "libgudev-1.0-0",
          "libharfbuzz-icu0",
          "libharfbuzz0b",
          "libhyphen0",
          "libicu67",
          "libjpeg62-turbo",
          "liblcms2-2",
          "libmanette-0.2-0",
          "libnghttp2-14",
          "libnotify4",
          "libopengl0",
          "libopenjp2-7",
          "libopus0",
          "libpango-1.0-0",
          "libpng16-16",
          "libproxy1v5",
          "libsecret-1-0",
          "libwayland-client0",
          "libwayland-egl1",
          "libwayland-server0",
          "libwebp6",
          "libwebpdemux2",
          "libwoff1",
          "libx11-6",
          "libxcomposite1",
          "libxdamage1",
          "libxkbcommon0",
          "libxml2",
          "libxslt1.1",
          "libatomic1",
          "libevent-2.1-7"
        ],
        lib2package: {
          "libasound.so.2": "libasound2",
          "libatk-1.0.so.0": "libatk1.0-0",
          "libatk-bridge-2.0.so.0": "libatk-bridge2.0-0",
          "libatspi.so.0": "libatspi2.0-0",
          "libcairo-gobject.so.2": "libcairo-gobject2",
          "libcairo.so.2": "libcairo2",
          "libcups.so.2": "libcups2",
          "libdbus-1.so.3": "libdbus-1-3",
          "libdbus-glib-1.so.2": "libdbus-glib-1-2",
          "libdrm.so.2": "libdrm2",
          "libEGL.so.1": "libegl1",
          "libenchant-2.so.2": "libenchant-2-2",
          "libepoxy.so.0": "libepoxy0",
          "libevdev.so.2": "libevdev2",
          "libfontconfig.so.1": "libfontconfig1",
          "libfreetype.so.6": "libfreetype6",
          "libgbm.so.1": "libgbm1",
          "libgdk_pixbuf-2.0.so.0": "libgdk-pixbuf-2.0-0",
          "libgdk-3.so.0": "libgtk-3-0",
          "libgio-2.0.so.0": "libglib2.0-0",
          "libGLESv2.so.2": "libgles2",
          "libglib-2.0.so.0": "libglib2.0-0",
          "libGLX.so.0": "libglx0",
          "libgmodule-2.0.so.0": "libglib2.0-0",
          "libgobject-2.0.so.0": "libglib2.0-0",
          "libgstallocators-1.0.so.0": "libgstreamer-plugins-base1.0-0",
          "libgstapp-1.0.so.0": "libgstreamer-plugins-base1.0-0",
          "libgstaudio-1.0.so.0": "libgstreamer-plugins-base1.0-0",
          "libgstbase-1.0.so.0": "libgstreamer1.0-0",
          "libgstfft-1.0.so.0": "libgstreamer-plugins-base1.0-0",
          "libgstgl-1.0.so.0": "libgstreamer-gl1.0-0",
          "libgstpbutils-1.0.so.0": "libgstreamer-plugins-base1.0-0",
          "libgstreamer-1.0.so.0": "libgstreamer1.0-0",
          "libgsttag-1.0.so.0": "libgstreamer-plugins-base1.0-0",
          "libgstvideo-1.0.so.0": "libgstreamer-plugins-base1.0-0",
          "libgtk-3.so.0": "libgtk-3-0",
          "libgudev-1.0.so.0": "libgudev-1.0-0",
          "libharfbuzz-icu.so.0": "libharfbuzz-icu0",
          "libharfbuzz.so.0": "libharfbuzz0b",
          "libhyphen.so.0": "libhyphen0",
          "libicui18n.so.67": "libicu67",
          "libicuuc.so.67": "libicu67",
          "libjpeg.so.62": "libjpeg62-turbo",
          "liblcms2.so.2": "liblcms2-2",
          "libmanette-0.2.so.0": "libmanette-0.2-0",
          "libnotify.so.4": "libnotify4",
          "libnspr4.so": "libnspr4",
          "libnss3.so": "libnss3",
          "libnssutil3.so": "libnss3",
          "libOpenGL.so.0": "libopengl0",
          "libopenjp2.so.7": "libopenjp2-7",
          "libopus.so.0": "libopus0",
          "libpango-1.0.so.0": "libpango-1.0-0",
          "libpangocairo-1.0.so.0": "libpangocairo-1.0-0",
          "libpng16.so.16": "libpng16-16",
          "libproxy.so.1": "libproxy1v5",
          "libsecret-1.so.0": "libsecret-1-0",
          "libsmime3.so": "libnss3",
          "libwayland-client.so.0": "libwayland-client0",
          "libwayland-egl.so.1": "libwayland-egl1",
          "libwayland-server.so.0": "libwayland-server0",
          "libwebp.so.6": "libwebp6",
          "libwebpdemux.so.2": "libwebpdemux2",
          "libwoff2dec.so.1.0.2": "libwoff1",
          "libX11-xcb.so.1": "libx11-xcb1",
          "libX11.so.6": "libx11-6",
          "libxcb-shm.so.0": "libxcb-shm0",
          "libxcb.so.1": "libxcb1",
          "libXcomposite.so.1": "libxcomposite1",
          "libXcursor.so.1": "libxcursor1",
          "libXdamage.so.1": "libxdamage1",
          "libXext.so.6": "libxext6",
          "libXfixes.so.3": "libxfixes3",
          "libXi.so.6": "libxi6",
          "libxkbcommon.so.0": "libxkbcommon0",
          "libxml2.so.2": "libxml2",
          "libXrandr.so.2": "libxrandr2",
          "libXrender.so.1": "libxrender1",
          "libxslt.so.1": "libxslt1.1",
          "libXtst.so.6": "libxtst6",
          "libatomic.so.1": "libatomic1",
          "libevent-2.1.so.7": "libevent-2.1-7"
        }
      },
      "debian12-x64": {
        tools: [
          "xvfb",
          "fonts-noto-color-emoji",
          "fonts-unifont",
          "libfontconfig1",
          "libfreetype6",
          "xfonts-scalable",
          "fonts-liberation",
          "fonts-ipafont-gothic",
          "fonts-wqy-zenhei",
          "fonts-tlwg-loma-otf",
          "fonts-freefont-ttf"
        ],
        chromium: [
          "libasound2",
          "libatk-bridge2.0-0",
          "libatk1.0-0",
          "libatspi2.0-0",
          "libcairo2",
          "libcups2",
          "libdbus-1-3",
          "libdrm2",
          "libgbm1",
          "libglib2.0-0",
          "libnspr4",
          "libnss3",
          "libpango-1.0-0",
          "libx11-6",
          "libxcb1",
          "libxcomposite1",
          "libxdamage1",
          "libxext6",
          "libxfixes3",
          "libxkbcommon0",
          "libxrandr2"
        ],
        firefox: [
          "libasound2",
          "libatk1.0-0",
          "libavcodec59",
          "libcairo-gobject2",
          "libcairo2",
          "libdbus-1-3",
          "libdbus-glib-1-2",
          "libfontconfig1",
          "libfreetype6",
          "libgdk-pixbuf-2.0-0",
          "libglib2.0-0",
          "libgtk-3-0",
          "libharfbuzz0b",
          "libpango-1.0-0",
          "libpangocairo-1.0-0",
          "libx11-6",
          "libx11-xcb1",
          "libxcb-shm0",
          "libxcb1",
          "libxcomposite1",
          "libxcursor1",
          "libxdamage1",
          "libxext6",
          "libxfixes3",
          "libxi6",
          "libxrandr2",
          "libxrender1",
          "libxtst6"
        ],
        webkit: [
          "libsoup-3.0-0",
          "gstreamer1.0-libav",
          "gstreamer1.0-plugins-bad",
          "gstreamer1.0-plugins-base",
          "gstreamer1.0-plugins-good",
          "libatk-bridge2.0-0",
          "libatk1.0-0",
          "libcairo2",
          "libdbus-1-3",
          "libdrm2",
          "libegl1",
          "libenchant-2-2",
          "libepoxy0",
          "libevdev2",
          "libfontconfig1",
          "libfreetype6",
          "libgbm1",
          "libgdk-pixbuf-2.0-0",
          "libgles2",
          "libglib2.0-0",
          "libglx0",
          "libgstreamer-gl1.0-0",
          "libgstreamer-plugins-base1.0-0",
          "libgstreamer1.0-0",
          "libgtk-4-1",
          "libgudev-1.0-0",
          "libharfbuzz-icu0",
          "libharfbuzz0b",
          "libhyphen0",
          "libicu72",
          "libjpeg62-turbo",
          "liblcms2-2",
          "libmanette-0.2-0",
          "libnotify4",
          "libopengl0",
          "libopenjp2-7",
          "libopus0",
          "libpango-1.0-0",
          "libpng16-16",
          "libproxy1v5",
          "libsecret-1-0",
          "libwayland-client0",
          "libwayland-egl1",
          "libwayland-server0",
          "libwebp7",
          "libwebpdemux2",
          "libwoff1",
          "libx11-6",
          "libxcomposite1",
          "libxdamage1",
          "libxkbcommon0",
          "libxml2",
          "libxslt1.1",
          "libatomic1",
          "libevent-2.1-7",
          "libavif15"
        ],
        lib2package: {
          "libavif.so.15": "libavif15",
          "libsoup-3.0.so.0": "libsoup-3.0-0",
          "libasound.so.2": "libasound2",
          "libatk-1.0.so.0": "libatk1.0-0",
          "libatk-bridge-2.0.so.0": "libatk-bridge2.0-0",
          "libatspi.so.0": "libatspi2.0-0",
          "libcairo.so.2": "libcairo2",
          "libcups.so.2": "libcups2",
          "libdbus-1.so.3": "libdbus-1-3",
          "libdrm.so.2": "libdrm2",
          "libgbm.so.1": "libgbm1",
          "libgio-2.0.so.0": "libglib2.0-0",
          "libglib-2.0.so.0": "libglib2.0-0",
          "libgobject-2.0.so.0": "libglib2.0-0",
          "libnspr4.so": "libnspr4",
          "libnss3.so": "libnss3",
          "libnssutil3.so": "libnss3",
          "libpango-1.0.so.0": "libpango-1.0-0",
          "libsmime3.so": "libnss3",
          "libX11.so.6": "libx11-6",
          "libxcb.so.1": "libxcb1",
          "libXcomposite.so.1": "libxcomposite1",
          "libXdamage.so.1": "libxdamage1",
          "libXext.so.6": "libxext6",
          "libXfixes.so.3": "libxfixes3",
          "libxkbcommon.so.0": "libxkbcommon0",
          "libXrandr.so.2": "libxrandr2",
          "libgtk-4.so.1": "libgtk-4-1"
        }
      },
      "debian13-x64": {
        tools: [
          "xvfb",
          "fonts-noto-color-emoji",
          "fonts-unifont",
          "libfontconfig1",
          "libfreetype6",
          "xfonts-scalable",
          "fonts-liberation",
          "fonts-ipafont-gothic",
          "fonts-wqy-zenhei",
          "fonts-tlwg-loma-otf",
          "fonts-freefont-ttf"
        ],
        chromium: [
          "libasound2t64",
          "libatk-bridge2.0-0t64",
          "libatk1.0-0t64",
          "libatspi2.0-0t64",
          "libcairo2",
          "libcups2t64",
          "libdbus-1-3",
          "libdrm2",
          "libgbm1",
          "libglib2.0-0t64",
          "libnspr4",
          "libnss3",
          "libpango-1.0-0",
          "libx11-6",
          "libxcb1",
          "libxcomposite1",
          "libxdamage1",
          "libxext6",
          "libxfixes3",
          "libxkbcommon0",
          "libxrandr2"
        ],
        firefox: [
          "libasound2",
          "libatk1.0-0t64",
          "libavcodec61",
          "libcairo-gobject2",
          "libcairo2",
          "libdbus-1-3",
          "libdbus-glib-1-2",
          "libfontconfig1",
          "libfreetype6",
          "libgdk-pixbuf-2.0-0",
          "libglib2.0-0t64",
          "libgtk-3-0t64",
          "libharfbuzz0b",
          "libpango-1.0-0",
          "libpangocairo-1.0-0",
          "libx11-6",
          "libx11-xcb1",
          "libxcb-shm0",
          "libxcb1",
          "libxcomposite1",
          "libxcursor1",
          "libxdamage1",
          "libxext6",
          "libxfixes3",
          "libxi6",
          "libxrandr2",
          "libxrender1",
          "libxtst6"
        ],
        webkit: [
          "libsoup-3.0-0",
          "gstreamer1.0-libav",
          "gstreamer1.0-plugins-bad",
          "gstreamer1.0-plugins-base",
          "gstreamer1.0-plugins-good",
          "libatk-bridge2.0-0t64",
          "libatk1.0-0t64",
          "libcairo2",
          "libdbus-1-3",
          "libdrm2",
          "libegl1",
          "libenchant-2-2",
          "libepoxy0",
          "libevdev2",
          "libfontconfig1",
          "libfreetype6",
          "libgbm1",
          "libgdk-pixbuf-2.0-0",
          "libgles2",
          "libglib2.0-0t64",
          "libglx0",
          "libgstreamer-gl1.0-0",
          "libgstreamer-plugins-base1.0-0",
          "libgstreamer1.0-0",
          "libgtk-4-1",
          "libgudev-1.0-0",
          "libharfbuzz-icu0",
          "libharfbuzz0b",
          "libhyphen0",
          "libicu76",
          "libjpeg62-turbo",
          "liblcms2-2",
          "libmanette-0.2-0",
          "libnotify4",
          "libopengl0",
          "libopenjp2-7",
          "libopus0",
          "libpango-1.0-0",
          "libpng16-16t64",
          "libproxy1v5",
          "libsecret-1-0",
          "libwayland-client0",
          "libwayland-egl1",
          "libwayland-server0",
          "libwebp7",
          "libwebpdemux2",
          "libwoff1",
          "libx11-6",
          "libxcomposite1",
          "libxdamage1",
          "libxkbcommon0",
          "libxml2",
          "libxslt1.1",
          "libatomic1",
          "libevent-2.1-7t64",
          "libavif16"
        ],
        lib2package: {
          "libicudata.so.74": "libicu76",
          "libicui18n.so.74": "libicu76",
          "libicuuc.so.74": "libicu76",
          "libevent-2.1.so.7": "libevent-2.1-7t64",
          "libpng16.so.16": "libpng16-16t64",
          "libgdk-3.so.0": "libgtk-3-0t64",
          "libgtk-3.so.0": "libgtk-3-0t64",
          "libavif.so.16": "libavif16",
          "libsoup-3.0.so.0": "libsoup-3.0-0",
          "libasound.so.2": "libasound2t64",
          "libatk-1.0.so.0": "libatk1.0-0t64",
          "libatk-bridge-2.0.so.0": "libatk-bridge2.0-0t64",
          "libatspi.so.0": "libatspi2.0-0t64",
          "libcairo.so.2": "libcairo2",
          "libcups.so.2": "libcups2t64",
          "libdbus-1.so.3": "libdbus-1-3",
          "libdrm.so.2": "libdrm2",
          "libgbm.so.1": "libgbm1",
          "libgio-2.0.so.0": "libglib2.0-0t64",
          "libglib-2.0.so.0": "libglib2.0-0t64",
          "libgobject-2.0.so.0": "libglib2.0-0t64",
          "libnspr4.so": "libnspr4",
          "libnss3.so": "libnss3",
          "libnssutil3.so": "libnss3",
          "libpango-1.0.so.0": "libpango-1.0-0",
          "libsmime3.so": "libnss3",
          "libX11.so.6": "libx11-6",
          "libxcb.so.1": "libxcb1",
          "libXcomposite.so.1": "libxcomposite1",
          "libXdamage.so.1": "libxdamage1",
          "libXext.so.6": "libxext6",
          "libXfixes.so.3": "libxfixes3",
          "libxkbcommon.so.0": "libxkbcommon0",
          "libXrandr.so.2": "libxrandr2",
          "libgtk-4.so.1": "libgtk-4-1"
        }
      }
    };
    deps["ubuntu20.04-arm64"] = {
      tools: [...deps["ubuntu20.04-x64"].tools],
      chromium: [...deps["ubuntu20.04-x64"].chromium],
      firefox: [
        ...deps["ubuntu20.04-x64"].firefox
      ],
      webkit: [
        ...deps["ubuntu20.04-x64"].webkit
      ],
      lib2package: {
        ...deps["ubuntu20.04-x64"].lib2package
      }
    };
    deps["ubuntu22.04-arm64"] = {
      tools: [...deps["ubuntu22.04-x64"].tools],
      chromium: [...deps["ubuntu22.04-x64"].chromium],
      firefox: [
        ...deps["ubuntu22.04-x64"].firefox
      ],
      webkit: [
        ...deps["ubuntu22.04-x64"].webkit
      ],
      lib2package: {
        ...deps["ubuntu22.04-x64"].lib2package
      }
    };
    deps["ubuntu24.04-arm64"] = {
      tools: [...deps["ubuntu24.04-x64"].tools],
      chromium: [...deps["ubuntu24.04-x64"].chromium],
      firefox: [
        ...deps["ubuntu24.04-x64"].firefox
      ],
      webkit: [
        ...deps["ubuntu24.04-x64"].webkit
      ],
      lib2package: {
        ...deps["ubuntu24.04-x64"].lib2package
      }
    };
    deps["ubuntu26.04-arm64"] = {
      tools: [...deps["ubuntu26.04-x64"].tools],
      chromium: [...deps["ubuntu26.04-x64"].chromium],
      firefox: [
        ...deps["ubuntu26.04-x64"].firefox
      ],
      webkit: [
        ...deps["ubuntu26.04-x64"].webkit
      ],
      lib2package: {
        ...deps["ubuntu26.04-x64"].lib2package
      }
    };
    deps["debian11-arm64"] = {
      tools: [...deps["debian11-x64"].tools],
      chromium: [...deps["debian11-x64"].chromium],
      firefox: [
        ...deps["debian11-x64"].firefox
      ],
      webkit: [
        ...deps["debian11-x64"].webkit
      ],
      lib2package: {
        ...deps["debian11-x64"].lib2package
      }
    };
    deps["debian12-arm64"] = {
      tools: [...deps["debian12-x64"].tools],
      chromium: [...deps["debian12-x64"].chromium],
      firefox: [
        ...deps["debian12-x64"].firefox
      ],
      webkit: [
        ...deps["debian12-x64"].webkit
      ],
      lib2package: {
        ...deps["debian12-x64"].lib2package
      }
    };
    deps["debian13-arm64"] = {
      tools: [...deps["debian13-x64"].tools],
      chromium: [...deps["debian13-x64"].chromium],
      firefox: [
        ...deps["debian13-x64"].firefox
      ],
      webkit: [
        ...deps["debian13-x64"].webkit
      ],
      lib2package: {
        ...deps["debian13-x64"].lib2package
      }
    };
  }
});

// packages/playwright-core/src/server/registry/dependencies.ts
async function writeDockerVersion(dockerImageNameTemplate) {
  await import_fs16.default.promises.mkdir(import_path16.default.dirname(dockerVersionFilePath), { recursive: true });
  await import_fs16.default.promises.writeFile(dockerVersionFilePath, JSON.stringify(dockerVersion(dockerImageNameTemplate), null, 2), "utf8");
  await import_fs16.default.promises.chmod(dockerVersionFilePath, 511);
}
function dockerVersion(dockerImageNameTemplate) {
  return {
    driverVersion: languageBindingVersion,
    dockerImageName: dockerImageNameTemplate.replace("%version%", languageBindingVersion)
  };
}
function readDockerVersionSync() {
  try {
    const data = JSON.parse(import_fs16.default.readFileSync(dockerVersionFilePath, "utf8"));
    return {
      ...data,
      dockerImageNameTemplate: data.dockerImageName.replace(data.driverVersion, "%version%")
    };
  } catch (e) {
    return null;
  }
}
function isSupportedWindowsVersion() {
  if (import_os6.default.platform() !== "win32" || import_os6.default.arch() !== "x64")
    return false;
  const [major2, minor] = import_os6.default.release().split(".").map((token) => parseInt(token, 10));
  return major2 > 6 || major2 === 6 && minor > 1;
}
async function installDependenciesWindows(targets, dryRun) {
  if (targets.has("chromium")) {
    const command = "powershell.exe";
    const args = ["-ExecutionPolicy", "Bypass", "-File", import_path16.default.join(binPath, "install_media_pack.ps1")];
    if (dryRun) {
      console.log(`${command} ${quoteProcessArgs(args).join(" ")}`);
      return;
    }
    const { code } = await spawnAsync(command, args, { cwd: binPath, stdio: "inherit" });
    if (code !== 0)
      throw new Error("Failed to install windows dependencies!");
  }
}
async function installDependenciesLinux(targets, dryRun) {
  const libraries = [];
  const platform = hostPlatform;
  if (!isOfficiallySupportedPlatform)
    console.warn(`BEWARE: your OS is not officially supported by Playwright; installing dependencies for ${platform} as a fallback.`);
  for (const target of targets) {
    const info = deps[platform];
    if (!info) {
      console.warn(`Cannot install dependencies for ${platform} with Playwright ${getPlaywrightVersion()}!`);
      return;
    }
    libraries.push(...info[target]);
  }
  const uniqueLibraries = Array.from(new Set(libraries));
  if (dryRun) {
    await reportMissingDependenciesLinux(uniqueLibraries);
    return;
  }
  console.log(`Installing dependencies...`);
  const commands2 = [];
  commands2.push("apt-get update");
  commands2.push([
    "apt-get",
    "install",
    "-y",
    "--no-install-recommends",
    ...uniqueLibraries
  ].join(" "));
  const { command, args, elevatedPermissions } = await transformCommandsForRoot(commands2);
  if (elevatedPermissions)
    console.log("Switching to root user to install dependencies...");
  const child = childProcess2.spawn(command, args, { stdio: "inherit" });
  await new Promise((resolve, reject) => {
    child.on("exit", (code) => code === 0 ? resolve() : reject(new Error(`Installation process exited with code: ${code}`)));
    child.on("error", reject);
  });
}
async function reportMissingDependenciesLinux(packages) {
  const { code, stdout, stderr, error } = await spawnAsync("apt-get", ["install", "-s", "--no-install-recommends", ...packages], {});
  if (error)
    throw new Error(`Failed to run 'apt-get install -s' to simulate dependency install: ${error.message}`);
  if (code !== 0)
    throw new Error(`'apt-get install -s' exited with code ${code}:
${stderr || stdout}`);
  const missingPackages = [];
  for (const line of stdout.split("\n")) {
    const match = /^Inst (\S+) /.exec(line);
    if (match)
      missingPackages.push(match[1]);
  }
  if (!missingPackages.length) {
    console.log("All system dependencies are installed.");
    return;
  }
  console.log(`Missing system dependencies (${missingPackages.length}):
${missingPackages.sort().map((p) => `  ${p}`).join("\n")}`);
  process.exitCode = 1;
}
async function validateDependenciesWindows(sdkLanguage, windowsExeAndDllDirectories) {
  const directoryPaths = windowsExeAndDllDirectories;
  const lddPaths = [];
  for (const directoryPath of directoryPaths)
    lddPaths.push(...await executablesOrSharedLibraries(directoryPath));
  const allMissingDeps = await Promise.all(lddPaths.map((lddPath) => missingFileDependenciesWindows(sdkLanguage, lddPath)));
  const missingDeps = /* @__PURE__ */ new Set();
  for (const deps2 of allMissingDeps) {
    for (const dep of deps2)
      missingDeps.add(dep);
  }
  if (!missingDeps.size)
    return;
  let isCrtMissing = false;
  let isMediaFoundationMissing = false;
  for (const dep of missingDeps) {
    if (dep.startsWith("api-ms-win-crt") || dep === "vcruntime140.dll" || dep === "vcruntime140_1.dll" || dep === "msvcp140.dll")
      isCrtMissing = true;
    else if (dep === "mf.dll" || dep === "mfplat.dll" || dep === "msmpeg2vdec.dll" || dep === "evr.dll" || dep === "avrt.dll")
      isMediaFoundationMissing = true;
  }
  const details = [];
  if (isCrtMissing) {
    details.push(
      `Some of the Universal C Runtime files cannot be found on the system. You can fix`,
      `that by installing Microsoft Visual C++ Redistributable for Visual Studio from:`,
      `https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads`,
      ``
    );
  }
  if (isMediaFoundationMissing) {
    details.push(
      `Some of the Media Foundation files cannot be found on the system. If you are`,
      `on Windows Server try fixing this by running the following command in PowerShell`,
      `as Administrator:`,
      ``,
      `    Install-WindowsFeature Server-Media-Foundation`,
      ``,
      `For Windows N editions visit:`,
      `https://support.microsoft.com/en-us/help/3145500/media-feature-pack-list-for-windows-n-editions`,
      ``
    );
  }
  details.push(
    `Full list of missing libraries:`,
    `    ${[...missingDeps].join("\n    ")}`,
    ``
  );
  const message = `Host system is missing dependencies!

${details.join("\n")}`;
  if (isSupportedWindowsVersion()) {
    throw new Error(message);
  } else {
    console.warn(`WARNING: running on unsupported windows version!`);
    console.warn(message);
  }
}
async function validateDependenciesLinux(sdkLanguage, linuxLddDirectories, dlOpenLibraries) {
  const directoryPaths = linuxLddDirectories;
  const lddPaths = [];
  for (const directoryPath of directoryPaths)
    lddPaths.push(...await executablesOrSharedLibraries(directoryPath));
  const missingDepsPerFile = await Promise.all(lddPaths.map((lddPath) => missingFileDependencies(lddPath, directoryPaths)));
  const missingDeps = /* @__PURE__ */ new Set();
  for (const deps2 of missingDepsPerFile) {
    for (const dep of deps2)
      missingDeps.add(dep);
  }
  for (const dep of await missingDLOPENLibraries(dlOpenLibraries))
    missingDeps.add(dep);
  if (!missingDeps.size)
    return;
  const allMissingDeps = new Set(missingDeps);
  const missingPackages = /* @__PURE__ */ new Set();
  const libraryToPackageNameMapping = deps[hostPlatform] ? {
    ...deps[hostPlatform]?.lib2package || {},
    ...MANUAL_LIBRARY_TO_PACKAGE_NAME_UBUNTU
  } : {};
  for (const missingDep of missingDeps) {
    const packageName = libraryToPackageNameMapping[missingDep];
    if (packageName) {
      missingPackages.add(packageName);
      missingDeps.delete(missingDep);
    }
  }
  const maybeSudo = process.getuid?.() && import_os6.default.platform() !== "win32" ? "sudo " : "";
  const dockerInfo = readDockerVersionSync();
  const errorLines = [
    `Host system is missing dependencies to run browsers.`
  ];
  if (dockerInfo && !dockerInfo.driverVersion.startsWith(getPlaywrightVersion(
    true
    /* majorMinorOnly */
  ) + ".")) {
    const pwVersion = getPlaywrightVersion();
    const requiredDockerImage = dockerInfo.dockerImageName.replace(dockerInfo.driverVersion, pwVersion);
    errorLines.push(...[
      `This is most likely due to Docker image version not matching Playwright version:`,
      `- Playwright  : ${pwVersion}`,
      `- Docker image: ${dockerInfo.driverVersion}`,
      ``,
      `Either:`,
      `- (recommended) use Docker image "${requiredDockerImage}"`,
      `- (alternative 1) run the following command inside Docker to install missing dependencies:`,
      ``,
      `    ${maybeSudo}${buildPlaywrightCLICommand(sdkLanguage, "install-deps")}`,
      ``,
      `- (alternative 2) use apt inside Docker:`,
      ``,
      `    ${maybeSudo}apt-get install ${[...missingPackages].join("\\\n        ")}`,
      ``,
      `<3 Playwright Team`
    ]);
  } else if (missingPackages.size && !missingDeps.size) {
    errorLines.push(...[
      `Please install them with the following command:`,
      ``,
      `    ${maybeSudo}${buildPlaywrightCLICommand(sdkLanguage, "install-deps")}`,
      ``,
      `Alternatively, use apt:`,
      `    ${maybeSudo}apt-get install ${[...missingPackages].join("\\\n        ")}`,
      ``,
      `<3 Playwright Team`
    ]);
  } else {
    errorLines.push(...[
      `Missing libraries:`,
      ...[...allMissingDeps].map((dep) => "    " + dep)
    ]);
  }
  throw new Error("\n" + wrapInASCIIBox(errorLines.join("\n"), 1));
}
function isSharedLib(basename) {
  switch (import_os6.default.platform()) {
    case "linux":
      return basename.endsWith(".so") || basename.includes(".so.");
    case "win32":
      return basename.endsWith(".dll");
    default:
      return false;
  }
}
async function executablesOrSharedLibraries(directoryPath) {
  if (!import_fs16.default.existsSync(directoryPath))
    return [];
  const allPaths = (await import_fs16.default.promises.readdir(directoryPath)).map((file) => import_path16.default.resolve(directoryPath, file));
  const allStats = await Promise.all(allPaths.map((aPath) => import_fs16.default.promises.stat(aPath)));
  const filePaths = allPaths.filter((aPath, index) => allStats[index].isFile());
  const executablersOrLibraries = (await Promise.all(filePaths.map(async (filePath) => {
    const basename = import_path16.default.basename(filePath).toLowerCase();
    if (isSharedLib(basename))
      return filePath;
    if (await checkExecutable(filePath))
      return filePath;
    return false;
  }))).filter(Boolean);
  return executablersOrLibraries;
}
async function missingFileDependenciesWindows(sdkLanguage, filePath) {
  const executable = registry.findExecutable("winldd").executablePathOrDie(sdkLanguage);
  const dirname = import_path16.default.dirname(filePath);
  const { stdout, code } = await spawnAsync(executable, [filePath], {
    cwd: dirname,
    env: {
      ...process.env,
      LD_LIBRARY_PATH: process.env.LD_LIBRARY_PATH ? `${process.env.LD_LIBRARY_PATH}:${dirname}` : dirname
    }
  });
  if (code !== 0)
    return [];
  const missingDeps = stdout.split("\n").map((line) => line.trim()).filter((line) => line.endsWith("not found") && line.includes("=>")).map((line) => line.split("=>")[0].trim().toLowerCase());
  return missingDeps;
}
async function missingFileDependencies(filePath, extraLDPaths) {
  const dirname = import_path16.default.dirname(filePath);
  let LD_LIBRARY_PATH = extraLDPaths.join(":");
  if (process.env.LD_LIBRARY_PATH)
    LD_LIBRARY_PATH = `${process.env.LD_LIBRARY_PATH}:${LD_LIBRARY_PATH}`;
  const { stdout, code } = await spawnAsync("ldd", [filePath], {
    cwd: dirname,
    env: {
      ...process.env,
      LD_LIBRARY_PATH
    }
  });
  if (code !== 0)
    return [];
  const missingDeps = stdout.split("\n").map((line) => line.trim()).filter((line) => line.endsWith("not found") && line.includes("=>")).map((line) => line.split("=>")[0].trim());
  return missingDeps;
}
async function missingDLOPENLibraries(libraries) {
  if (!libraries.length)
    return [];
  const { stdout, code, error } = await spawnAsync("/sbin/ldconfig", ["-p"], {});
  if (code !== 0 || error)
    return [];
  const isLibraryAvailable = (library) => stdout.toLowerCase().includes(library.toLowerCase());
  return libraries.filter((library) => !isLibraryAvailable(library));
}
function quoteProcessArgs(args) {
  return args.map((arg) => {
    if (arg.includes(" "))
      return `"${arg}"`;
    return arg;
  });
}
async function transformCommandsForRoot(commands2) {
  const isRoot = process.getuid?.() === 0;
  if (isRoot)
    return { command: "sh", args: ["-c", `${commands2.join("&& ")}`], elevatedPermissions: false };
  const sudoExists = await spawnAsync("which", ["sudo"]);
  if (sudoExists.code === 0)
    return { command: "sudo", args: ["--", "sh", "-c", `${commands2.join("&& ")}`], elevatedPermissions: true };
  return { command: "su", args: ["root", "-c", `${commands2.join("&& ")}`], elevatedPermissions: true };
}
var childProcess2, import_fs16, import_os6, import_path16, languageBindingVersion, dockerVersionFilePath, checkExecutable, MANUAL_LIBRARY_TO_PACKAGE_NAME_UBUNTU;
var init_dependencies = __esm({
  "packages/playwright-core/src/server/registry/dependencies.ts"() {
    "use strict";
    childProcess2 = __toESM(require("child_process"));
    import_fs16 = __toESM(require("fs"));
    import_os6 = __toESM(require("os"));
    import_path16 = __toESM(require("path"));
    init_ascii();
    init_hostPlatform();
    init_spawnAsync();
    init_userAgent();
    init_nativeDeps();
    init_package();
    init_registry();
    languageBindingVersion = process.env.PW_CLI_DISPLAY_VERSION || packageJSON.version;
    dockerVersionFilePath = "/ms-playwright/.docker-info";
    checkExecutable = (filePath) => {
      if (process.platform === "win32")
        return filePath.endsWith(".exe");
      return import_fs16.default.promises.access(filePath, import_fs16.default.constants.X_OK).then(() => true).catch(() => false);
    };
    MANUAL_LIBRARY_TO_PACKAGE_NAME_UBUNTU = {
      // libgstlibav.so (the only actual library provided by gstreamer1.0-libav) is not
      // in the ldconfig cache, so we detect the actual library required for playing h.264
      // and if it's missing recommend installing missing gstreamer lib.
      // gstreamer1.0-libav -> libavcodec57 -> libx264-152
      "libx264.so": "gstreamer1.0-libav"
    };
  }
});

// packages/playwright-core/src/server/registry/browserFetcher.ts
async function downloadBrowserWithProgressBar(title, browserDirectory, executablePath, downloadURLs, downloadFileName, downloadSocketTimeout, force) {
  if (await existsAsync(browserDirectoryToMarkerFilePath(browserDirectory))) {
    debugLogger.log("install", `${title} is already downloaded.`);
    if (force)
      debugLogger.log("install", `force-downloading ${title}.`);
    else
      return;
  }
  const uniqueTempDir = await import_fs17.default.promises.mkdtemp(import_path17.default.join(import_os7.default.tmpdir(), "playwright-download-"));
  const zipPath = import_path17.default.join(uniqueTempDir, downloadFileName);
  try {
    const retryCount = 5;
    for (let attempt = 1; attempt <= retryCount; ++attempt) {
      debugLogger.log("install", `downloading ${title} - attempt #${attempt}`);
      const url2 = downloadURLs[(attempt - 1) % downloadURLs.length];
      logPolitely(`Downloading ${title}` + colors3.dim(` from ${url2}`));
      const { error } = await downloadBrowserWithProgressBarOutOfProcess(title, browserDirectory, url2, zipPath, executablePath, downloadSocketTimeout);
      if (!error) {
        debugLogger.log("install", `SUCCESS installing ${title}`);
        break;
      }
      if (await existsAsync(zipPath))
        await import_fs17.default.promises.unlink(zipPath);
      if (await existsAsync(browserDirectory))
        await removeFolders([browserDirectory]);
      const errorMessage = error?.message || "";
      debugLogger.log("install", `attempt #${attempt} - ERROR: ${errorMessage}`);
      if (attempt >= retryCount)
        throw error;
    }
  } catch (e) {
    debugLogger.log("install", `FAILED installation ${title} with error: ${e}`);
    process.exitCode = 1;
    throw e;
  } finally {
    await removeFolders([uniqueTempDir]);
  }
  logPolitely(`${title} downloaded to ${browserDirectory}`);
}
function downloadBrowserWithProgressBarOutOfProcess(title, browserDirectory, url2, zipPath, executablePath, socketTimeout) {
  const cp = childProcess3.fork(libPath("entry", "oopBrowserDownload.js"));
  const promise = new ManualPromise();
  const progress2 = getDownloadProgress();
  cp.on("message", (message) => {
    if (message?.method === "log")
      debugLogger.log("install", message.params.message);
    if (message?.method === "progress")
      progress2(message.params.done, message.params.total);
  });
  cp.on("exit", (code) => {
    if (code !== 0) {
      promise.resolve({ error: new Error(`Download failure, code=${code}`) });
      return;
    }
    if (!import_fs17.default.existsSync(browserDirectoryToMarkerFilePath(browserDirectory)))
      promise.resolve({ error: new Error(`Download failure, ${browserDirectoryToMarkerFilePath(browserDirectory)} does not exist`) });
    else
      promise.resolve({ error: null });
  });
  cp.on("error", (error) => {
    promise.resolve({ error });
  });
  debugLogger.log("install", `running download:`);
  debugLogger.log("install", `-- from url: ${url2}`);
  debugLogger.log("install", `-- to location: ${zipPath}`);
  const downloadParams = {
    title,
    browserDirectory,
    url: url2,
    zipPath,
    executablePath,
    socketTimeout,
    userAgent: getUserAgent()
  };
  cp.send({ method: "download", params: downloadParams });
  return promise;
}
function logPolitely(toBeLogged) {
  const logLevel = process.env.npm_config_loglevel;
  const logLevelDisplay = ["silent", "error", "warn"].indexOf(logLevel || "") > -1;
  if (!logLevelDisplay)
    console.log(toBeLogged);
}
function getDownloadProgress() {
  if (process.stdout.isTTY)
    return getAnimatedDownloadProgress();
  return getBasicDownloadProgress();
}
function getAnimatedDownloadProgress() {
  let progressBar;
  let lastDownloadedBytes = 0;
  return (downloadedBytes, totalBytes) => {
    if (!progressBar) {
      progressBar = new ProgressBar(
        `${toMegabytes(
          totalBytes
        )} [:bar] :percent :etas`,
        {
          complete: "=",
          incomplete: " ",
          width: 20,
          total: totalBytes
        }
      );
    }
    const delta = downloadedBytes - lastDownloadedBytes;
    lastDownloadedBytes = downloadedBytes;
    progressBar.tick(delta);
  };
}
function getBasicDownloadProgress() {
  const totalRows = 10;
  const stepWidth = 8;
  let lastRow = -1;
  return (downloadedBytes, totalBytes) => {
    const percentage = downloadedBytes / totalBytes;
    const row = Math.floor(totalRows * percentage);
    if (row > lastRow) {
      lastRow = row;
      const percentageString = String(percentage * 100 | 0).padStart(3);
      console.log(`|${"\u25A0".repeat(row * stepWidth)}${" ".repeat((totalRows - row) * stepWidth)}| ${percentageString}% of ${toMegabytes(totalBytes)}`);
    }
  };
}
function toMegabytes(bytes) {
  const mb = bytes / 1024 / 1024;
  return `${Math.round(mb * 10) / 10} MiB`;
}
var childProcess3, import_fs17, import_os7, import_path17, ProgressBar, colors3;
var init_browserFetcher = __esm({
  "packages/playwright-core/src/server/registry/browserFetcher.ts"() {
    "use strict";
    childProcess3 = __toESM(require("child_process"));
    import_fs17 = __toESM(require("fs"));
    import_os7 = __toESM(require("os"));
    import_path17 = __toESM(require("path"));
    init_manualPromise();
    init_debugLogger();
    init_fileUtils();
    init_userAgent();
    init_package();
    init_registry();
    ProgressBar = require("./utilsBundle").progress;
    colors3 = require("./utilsBundle").colors;
  }
});

// packages/playwright-core/src/server/registry/oopDownloadBrowserMain.ts
function log(message) {
  process.send?.({ method: "log", params: { message } });
}
function progress(done, total) {
  process.send?.({ method: "progress", params: { done, total } });
}
function browserDirectoryToMarkerFilePath2(browserDirectory) {
  return import_path18.default.join(browserDirectory, "INSTALLATION_COMPLETE");
}
function downloadFile(options) {
  let downloadedBytes = 0;
  let totalBytes = 0;
  let chunked = false;
  const reportProgress = !getAsBooleanFromENV("PLAYWRIGHT_DOWNLOAD_NO_PROGRESS");
  const promise = new ManualPromise();
  httpRequest({
    url: options.url,
    headers: {
      "User-Agent": options.userAgent
    },
    socketTimeout: options.socketTimeout
  }, (response2) => {
    log(`-- response status code: ${response2.statusCode}`);
    if (response2.statusCode !== 200) {
      let content = "";
      const handleError = () => {
        const error = new Error(`Download failed: server returned code ${response2.statusCode} body '${content}'. URL: ${options.url}`);
        response2.resume();
        promise.reject(error);
      };
      response2.on("data", (chunk) => content += chunk).on("end", handleError).on("error", handleError);
      return;
    }
    chunked = response2.headers["transfer-encoding"] === "chunked";
    log(`-- is chunked: ${chunked}`);
    totalBytes = parseInt(response2.headers["content-length"] || "0", 10);
    log(`-- total bytes: ${totalBytes}`);
    const file = import_fs18.default.createWriteStream(options.zipPath);
    file.on("finish", () => {
      if (!chunked && downloadedBytes !== totalBytes) {
        log(`-- download failed, size mismatch: ${downloadedBytes} != ${totalBytes}`);
        promise.reject(new Error(`Download failed: size mismatch, file size: ${downloadedBytes}, expected size: ${totalBytes} URL: ${options.url}`));
      } else {
        log(`-- download complete, size: ${downloadedBytes}`);
        promise.resolve();
      }
    });
    file.on("error", (error) => promise.reject(error));
    response2.pipe(file);
    response2.on("data", onData);
    response2.on("error", (error) => {
      file.close();
      if (error?.code === "ECONNRESET") {
        log(`-- download failed, server closed connection`);
        promise.reject(new Error(`Download failed: server closed connection. URL: ${options.url}`));
      } else {
        log(`-- download failed, unexpected error`);
        promise.reject(new Error(`Download failed: ${error?.message ?? error}. URL: ${options.url}`));
      }
    });
  }, (error) => promise.reject(error));
  return promise;
  function onData(chunk) {
    downloadedBytes += chunk.length;
    if (!chunked && reportProgress)
      progress(downloadedBytes, totalBytes);
  }
}
async function main(options) {
  await downloadFile(options);
  log(`SUCCESS downloading ${options.title}`);
  log(`removing existing browser directory if any`);
  await removeFolders([options.browserDirectory]);
  log(`extracting archive`);
  await extractZip(options.zipPath, { dir: options.browserDirectory });
  if (options.executablePath) {
    log(`fixing permissions at ${options.executablePath}`);
    await import_fs18.default.promises.chmod(options.executablePath, 493);
  }
  await import_fs18.default.promises.writeFile(browserDirectoryToMarkerFilePath2(options.browserDirectory), "");
}
function runOopDownloadBrowserMain() {
  process.on("message", async (message) => {
    const { method, params: params2 } = message;
    if (method === "download") {
      try {
        await main(params2);
        process.exit(0);
      } catch (e) {
        console.error(e);
        process.exit(1);
      }
    }
  });
  process.on("disconnect", () => {
    process.exit(0);
  });
}
var import_fs18, import_path18;
var init_oopDownloadBrowserMain = __esm({
  "packages/playwright-core/src/server/registry/oopDownloadBrowserMain.ts"() {
    "use strict";
    import_fs18 = __toESM(require("fs"));
    import_path18 = __toESM(require("path"));
    init_manualPromise();
    init_env();
    init_network();
    init_fileUtils();
    init_extractZip();
  }
});

// packages/playwright-core/src/server/registry/index.ts
var registry_exports = {};
__export(registry_exports, {
  Registry: () => Registry,
  browserDirectoryToMarkerFilePath: () => browserDirectoryToMarkerFilePath,
  buildPlaywrightCLICommand: () => buildPlaywrightCLICommand,
  defaultCacheDirectory: () => defaultCacheDirectory,
  defaultRegistryDirectory: () => defaultRegistryDirectory,
  findChromiumChannelBestEffort: () => findChromiumChannelBestEffort,
  installBrowsersForNpmInstall: () => installBrowsersForNpmInstall,
  registry: () => registry,
  registryDirectory: () => registryDirectory,
  runOopDownloadBrowserMain: () => runOopDownloadBrowserMain,
  writeDockerVersion: () => writeDockerVersion
});
function cftUrl(suffix) {
  return ({ browserVersion }) => {
    return {
      path: `builds/cft/${browserVersion}/${suffix}`,
      mirrors: [
        "https://cdn.playwright.dev"
      ]
    };
  };
}
function isBrowserDirectory(browserDirectory) {
  const baseName = import_path19.default.basename(browserDirectory);
  for (const browserName of allDownloadableDirectoriesThatEverExisted) {
    if (baseName.startsWith(browserName.replace(/-/g, "_") + "-"))
      return true;
  }
  return false;
}
function readDescriptors(browsersJSON) {
  return browsersJSON["browsers"].map((obj) => {
    const name = obj.name;
    const revisionOverride = (obj.revisionOverrides || {})[hostPlatform];
    const revision = revisionOverride || obj.revision;
    const browserDirectoryPrefix = revisionOverride ? `${name}_${hostPlatform}_special` : `${name}`;
    const descriptor = {
      name,
      revision,
      hasRevisionOverride: !!revisionOverride,
      // We only put browser version for the supported operating systems.
      browserVersion: revisionOverride ? void 0 : obj.browserVersion,
      title: obj["title"],
      installByDefault: !!obj.installByDefault,
      // Method `isBrowserDirectory` determines directory to be browser iff
      // it starts with some browser name followed by '-'. Some browser names
      // are prefixes of others, e.g. 'webkit' is a prefix of `webkit-technology-preview`.
      // To avoid older registries erroneously removing 'webkit-technology-preview', we have to
      // ensure that browser folders to never include dashes inside.
      dir: import_path19.default.join(registryDirectory, browserDirectoryPrefix.replace(/-/g, "_") + "-" + revision)
    };
    return descriptor;
  });
}
function browserDirectoryToMarkerFilePath(browserDirectory) {
  return import_path19.default.join(browserDirectory, "INSTALLATION_COMPLETE");
}
function buildPlaywrightCLICommand(sdkLanguage, parameters) {
  switch (sdkLanguage) {
    case "python":
      return `playwright ${parameters}`;
    case "java":
      return `mvn exec:java -e -D exec.mainClass=com.microsoft.playwright.CLI -D exec.args="${parameters}"`;
    case "csharp":
      return `pwsh bin/Debug/netX/playwright.ps1 ${parameters}`;
    default: {
      const packageManagerCommand = getPackageManagerExecCommand();
      return `${packageManagerCommand} playwright ${parameters}`;
    }
  }
}
async function installBrowsersForNpmInstall(browsers) {
  if (getAsBooleanFromENV("PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD")) {
    logPolitely("Skipping browsers download because `PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD` env variable is set");
    return false;
  }
  const executables = [];
  if (process.platform === "win32")
    executables.push(registry.findExecutable("winldd"));
  for (const browserName of browsers) {
    const executable = registry.findExecutable(browserName);
    if (!executable || executable.installType === "none")
      throw new Error(`Cannot install ${browserName}`);
    executables.push(executable);
  }
  await registry.install(executables);
}
function findChromiumChannelBestEffort(sdkLanguage) {
  let channel = null;
  for (const name of ["chromium", "chrome", "msedge"]) {
    try {
      registry.findExecutable(name).executablePathOrDie(sdkLanguage);
      channel = name === "chromium" ? void 0 : name;
      break;
    } catch (e) {
    }
  }
  if (channel === null) {
    const installCommand = buildPlaywrightCLICommand(sdkLanguage, `install chromium`);
    const prettyMessage = [
      `No chromium-based browser found on the system.`,
      `Please run the following command to download one:`,
      ``,
      `    ${installCommand}`,
      ``,
      `<3 Playwright Team`
    ].join("\n");
    throw new Error("\n" + wrapInASCIIBox(prettyMessage, 1));
  }
  return channel;
}
function lowercaseAllKeys(json) {
  if (typeof json !== "object" || !json)
    return json;
  if (Array.isArray(json))
    return json.map(lowercaseAllKeys);
  const result2 = {};
  for (const [key, value2] of Object.entries(json))
    result2[key.toLowerCase()] = lowercaseAllKeys(value2);
  return result2;
}
var import_fs19, import_os8, import_path19, util2, PACKAGE_PATH, BIN_PATH, PLAYWRIGHT_CDN_MIRRORS, EXECUTABLE_PATHS, DOWNLOAD_PATHS, defaultCacheDirectory, defaultRegistryDirectory, registryDirectory, allDownloadableDirectoriesThatEverExisted, chromiumAliases, Registry, registry;
var init_registry = __esm({
  "packages/playwright-core/src/server/registry/index.ts"() {
    "use strict";
    import_fs19 = __toESM(require("fs"));
    import_os8 = __toESM(require("os"));
    import_path19 = __toESM(require("path"));
    util2 = __toESM(require("util"));
    init_ascii();
    init_debugLogger();
    init_hostPlatform();
    init_network();
    init_spawnAsync();
    init_fileUtils();
    init_crypto();
    init_env();
    init_lockfile();
    init_utils2();
    init_userAgent();
    init_dependencies();
    init_dependencies();
    init_browserFetcher();
    init_package();
    init_dependencies();
    init_oopDownloadBrowserMain();
    PACKAGE_PATH = packageRoot;
    BIN_PATH = binPath;
    PLAYWRIGHT_CDN_MIRRORS = [
      "https://cdn.playwright.dev/dbazure/download/playwright",
      // ESRP CDN
      "https://playwright.download.prss.microsoft.com/dbazure/download/playwright",
      // Directly hit ESRP CDN
      "https://cdn.playwright.dev"
      // Hit the Storage Bucket directly
    ];
    if (process.env.PW_TEST_CDN_THAT_SHOULD_WORK) {
      for (let i = 0; i < PLAYWRIGHT_CDN_MIRRORS.length; i++) {
        const cdn = PLAYWRIGHT_CDN_MIRRORS[i];
        if (cdn !== process.env.PW_TEST_CDN_THAT_SHOULD_WORK) {
          const parsedCDN = new URL(cdn);
          parsedCDN.hostname = parsedCDN.hostname + ".does-not-resolve.playwright.dev";
          PLAYWRIGHT_CDN_MIRRORS[i] = parsedCDN.toString();
        }
      }
    }
    EXECUTABLE_PATHS = {
      "chromium": {
        "<unknown>": void 0,
        "linux-x64": ["chrome-linux64", "chrome"],
        "linux-arm64": ["chrome-linux", "chrome"],
        // non-cft build
        "mac-x64": ["chrome-mac-x64", "Google Chrome for Testing.app", "Contents", "MacOS", "Google Chrome for Testing"],
        "mac-arm64": ["chrome-mac-arm64", "Google Chrome for Testing.app", "Contents", "MacOS", "Google Chrome for Testing"],
        "win-x64": ["chrome-win64", "chrome.exe"]
      },
      "chromium-headless-shell": {
        "<unknown>": void 0,
        "linux-x64": ["chrome-headless-shell-linux64", "chrome-headless-shell"],
        "linux-arm64": ["chrome-linux", "headless_shell"],
        // non-cft build
        "mac-x64": ["chrome-headless-shell-mac-x64", "chrome-headless-shell"],
        "mac-arm64": ["chrome-headless-shell-mac-arm64", "chrome-headless-shell"],
        "win-x64": ["chrome-headless-shell-win64", "chrome-headless-shell.exe"]
      },
      "chromium-tip-of-tree": {
        "<unknown>": void 0,
        "linux-x64": ["chrome-linux64", "chrome"],
        "linux-arm64": ["chrome-linux", "chrome"],
        // non-cft build
        "mac-x64": ["chrome-mac-x64", "Google Chrome for Testing.app", "Contents", "MacOS", "Google Chrome for Testing"],
        "mac-arm64": ["chrome-mac-arm64", "Google Chrome for Testing.app", "Contents", "MacOS", "Google Chrome for Testing"],
        "win-x64": ["chrome-win64", "chrome.exe"]
      },
      "chromium-tip-of-tree-headless-shell": {
        "<unknown>": void 0,
        "linux-x64": ["chrome-headless-shell-linux64", "chrome-headless-shell"],
        "linux-arm64": ["chrome-linux", "headless_shell"],
        // non-cft build
        "mac-x64": ["chrome-headless-shell-mac-x64", "chrome-headless-shell"],
        "mac-arm64": ["chrome-headless-shell-mac-arm64", "chrome-headless-shell"],
        "win-x64": ["chrome-headless-shell-win64", "chrome-headless-shell.exe"]
      },
      "firefox": {
        "<unknown>": void 0,
        "linux-x64": ["firefox", "firefox"],
        "linux-arm64": ["firefox", "firefox"],
        "mac-x64": ["firefox", "Nightly.app", "Contents", "MacOS", "firefox"],
        "mac-arm64": ["firefox", "Nightly.app", "Contents", "MacOS", "firefox"],
        "win-x64": ["firefox", "firefox.exe"]
      },
      "webkit": {
        "<unknown>": void 0,
        "linux-x64": ["pw_run.sh"],
        "linux-arm64": ["pw_run.sh"],
        "mac-x64": ["pw_run.sh"],
        "mac-arm64": ["pw_run.sh"],
        "win-x64": ["Playwright.exe"]
      },
      "ffmpeg": {
        "<unknown>": void 0,
        "linux-x64": ["ffmpeg-linux"],
        "linux-arm64": ["ffmpeg-linux"],
        "mac-x64": ["ffmpeg-mac"],
        "mac-arm64": ["ffmpeg-mac"],
        "win-x64": ["ffmpeg-win64.exe"]
      },
      "winldd": {
        "<unknown>": void 0,
        "linux-x64": void 0,
        "linux-arm64": void 0,
        "mac-x64": void 0,
        "mac-arm64": void 0,
        "win-x64": ["PrintDeps.exe"]
      }
    };
    DOWNLOAD_PATHS = {
      "chromium": {
        "<unknown>": void 0,
        "ubuntu18.04-x64": void 0,
        "ubuntu20.04-x64": cftUrl("linux64/chrome-linux64.zip"),
        "ubuntu22.04-x64": cftUrl("linux64/chrome-linux64.zip"),
        "ubuntu24.04-x64": cftUrl("linux64/chrome-linux64.zip"),
        "ubuntu26.04-x64": cftUrl("linux64/chrome-linux64.zip"),
        "ubuntu18.04-arm64": void 0,
        "ubuntu20.04-arm64": "builds/chromium/%s/chromium-linux-arm64.zip",
        "ubuntu22.04-arm64": "builds/chromium/%s/chromium-linux-arm64.zip",
        "ubuntu24.04-arm64": "builds/chromium/%s/chromium-linux-arm64.zip",
        "ubuntu26.04-arm64": "builds/chromium/%s/chromium-linux-arm64.zip",
        "debian11-x64": cftUrl("linux64/chrome-linux64.zip"),
        "debian11-arm64": "builds/chromium/%s/chromium-linux-arm64.zip",
        "debian12-x64": cftUrl("linux64/chrome-linux64.zip"),
        "debian12-arm64": "builds/chromium/%s/chromium-linux-arm64.zip",
        "debian13-x64": cftUrl("linux64/chrome-linux64.zip"),
        "debian13-arm64": "builds/chromium/%s/chromium-linux-arm64.zip",
        "mac10.13": cftUrl("mac-x64/chrome-mac-x64.zip"),
        "mac10.14": cftUrl("mac-x64/chrome-mac-x64.zip"),
        "mac10.15": cftUrl("mac-x64/chrome-mac-x64.zip"),
        "mac11": cftUrl("mac-x64/chrome-mac-x64.zip"),
        "mac11-arm64": cftUrl("mac-arm64/chrome-mac-arm64.zip"),
        "mac12": cftUrl("mac-x64/chrome-mac-x64.zip"),
        "mac12-arm64": cftUrl("mac-arm64/chrome-mac-arm64.zip"),
        "mac13": cftUrl("mac-x64/chrome-mac-x64.zip"),
        "mac13-arm64": cftUrl("mac-arm64/chrome-mac-arm64.zip"),
        "mac14": cftUrl("mac-x64/chrome-mac-x64.zip"),
        "mac14-arm64": cftUrl("mac-arm64/chrome-mac-arm64.zip"),
        "mac15": cftUrl("mac-x64/chrome-mac-x64.zip"),
        "mac15-arm64": cftUrl("mac-arm64/chrome-mac-arm64.zip"),
        "mac26": cftUrl("mac-x64/chrome-mac-x64.zip"),
        "mac26-arm64": cftUrl("mac-arm64/chrome-mac-arm64.zip"),
        "win64": cftUrl("win64/chrome-win64.zip")
      },
      "chromium-headless-shell": {
        "<unknown>": void 0,
        "ubuntu18.04-x64": void 0,
        "ubuntu20.04-x64": cftUrl("linux64/chrome-headless-shell-linux64.zip"),
        "ubuntu22.04-x64": cftUrl("linux64/chrome-headless-shell-linux64.zip"),
        "ubuntu24.04-x64": cftUrl("linux64/chrome-headless-shell-linux64.zip"),
        "ubuntu26.04-x64": cftUrl("linux64/chrome-headless-shell-linux64.zip"),
        "ubuntu18.04-arm64": void 0,
        "ubuntu20.04-arm64": "builds/chromium/%s/chromium-headless-shell-linux-arm64.zip",
        "ubuntu22.04-arm64": "builds/chromium/%s/chromium-headless-shell-linux-arm64.zip",
        "ubuntu24.04-arm64": "builds/chromium/%s/chromium-headless-shell-linux-arm64.zip",
        "ubuntu26.04-arm64": "builds/chromium/%s/chromium-headless-shell-linux-arm64.zip",
        "debian11-x64": cftUrl("linux64/chrome-headless-shell-linux64.zip"),
        "debian11-arm64": "builds/chromium/%s/chromium-headless-shell-linux-arm64.zip",
        "debian12-x64": cftUrl("linux64/chrome-headless-shell-linux64.zip"),
        "debian12-arm64": "builds/chromium/%s/chromium-headless-shell-linux-arm64.zip",
        "debian13-x64": cftUrl("linux64/chrome-headless-shell-linux64.zip"),
        "debian13-arm64": "builds/chromium/%s/chromium-headless-shell-linux-arm64.zip",
        "mac10.13": void 0,
        "mac10.14": void 0,
        "mac10.15": void 0,
        "mac11": cftUrl("mac-x64/chrome-headless-shell-mac-x64.zip"),
        "mac11-arm64": cftUrl("mac-arm64/chrome-headless-shell-mac-arm64.zip"),
        "mac12": cftUrl("mac-x64/chrome-headless-shell-mac-x64.zip"),
        "mac12-arm64": cftUrl("mac-arm64/chrome-headless-shell-mac-arm64.zip"),
        "mac13": cftUrl("mac-x64/chrome-headless-shell-mac-x64.zip"),
        "mac13-arm64": cftUrl("mac-arm64/chrome-headless-shell-mac-arm64.zip"),
        "mac14": cftUrl("mac-x64/chrome-headless-shell-mac-x64.zip"),
        "mac14-arm64": cftUrl("mac-arm64/chrome-headless-shell-mac-arm64.zip"),
        "mac15": cftUrl("mac-x64/chrome-headless-shell-mac-x64.zip"),
        "mac15-arm64": cftUrl("mac-arm64/chrome-headless-shell-mac-arm64.zip"),
        "mac26": cftUrl("mac-x64/chrome-headless-shell-mac-x64.zip"),
        "mac26-arm64": cftUrl("mac-arm64/chrome-headless-shell-mac-arm64.zip"),
        "win64": cftUrl("win64/chrome-headless-shell-win64.zip")
      },
      "chromium-tip-of-tree": {
        "<unknown>": void 0,
        "ubuntu18.04-x64": void 0,
        "ubuntu20.04-x64": cftUrl("linux64/chrome-linux64.zip"),
        "ubuntu22.04-x64": cftUrl("linux64/chrome-linux64.zip"),
        "ubuntu24.04-x64": cftUrl("linux64/chrome-linux64.zip"),
        "ubuntu26.04-x64": cftUrl("linux64/chrome-linux64.zip"),
        "ubuntu18.04-arm64": void 0,
        "ubuntu20.04-arm64": "builds/chromium-tip-of-tree/%s/chromium-tip-of-tree-linux-arm64.zip",
        "ubuntu22.04-arm64": "builds/chromium-tip-of-tree/%s/chromium-tip-of-tree-linux-arm64.zip",
        "ubuntu24.04-arm64": "builds/chromium-tip-of-tree/%s/chromium-tip-of-tree-linux-arm64.zip",
        "ubuntu26.04-arm64": "builds/chromium-tip-of-tree/%s/chromium-tip-of-tree-linux-arm64.zip",
        "debian11-x64": cftUrl("linux64/chrome-linux64.zip"),
        "debian11-arm64": "builds/chromium-tip-of-tree/%s/chromium-tip-of-tree-linux-arm64.zip",
        "debian12-x64": cftUrl("linux64/chrome-linux64.zip"),
        "debian12-arm64": "builds/chromium-tip-of-tree/%s/chromium-tip-of-tree-linux-arm64.zip",
        "debian13-x64": cftUrl("linux64/chrome-linux64.zip"),
        "debian13-arm64": "builds/chromium-tip-of-tree/%s/chromium-tip-of-tree-linux-arm64.zip",
        "mac10.13": cftUrl("mac-x64/chrome-mac-x64.zip"),
        "mac10.14": cftUrl("mac-x64/chrome-mac-x64.zip"),
        "mac10.15": cftUrl("mac-x64/chrome-mac-x64.zip"),
        "mac11": cftUrl("mac-x64/chrome-mac-x64.zip"),
        "mac11-arm64": cftUrl("mac-arm64/chrome-mac-arm64.zip"),
        "mac12": cftUrl("mac-x64/chrome-mac-x64.zip"),
        "mac12-arm64": cftUrl("mac-arm64/chrome-mac-arm64.zip"),
        "mac13": cftUrl("mac-x64/chrome-mac-x64.zip"),
        "mac13-arm64": cftUrl("mac-arm64/chrome-mac-arm64.zip"),
        "mac14": cftUrl("mac-x64/chrome-mac-x64.zip"),
        "mac14-arm64": cftUrl("mac-arm64/chrome-mac-arm64.zip"),
        "mac15": cftUrl("mac-x64/chrome-mac-x64.zip"),
        "mac15-arm64": cftUrl("mac-arm64/chrome-mac-arm64.zip"),
        "mac26": cftUrl("mac-x64/chrome-mac-x64.zip"),
        "mac26-arm64": cftUrl("mac-arm64/chrome-mac-arm64.zip"),
        "win64": cftUrl("win64/chrome-win64.zip")
      },
      "chromium-tip-of-tree-headless-shell": {
        "<unknown>": void 0,
        "ubuntu18.04-x64": void 0,
        "ubuntu20.04-x64": cftUrl("linux64/chrome-headless-shell-linux64.zip"),
        "ubuntu22.04-x64": cftUrl("linux64/chrome-headless-shell-linux64.zip"),
        "ubuntu24.04-x64": cftUrl("linux64/chrome-headless-shell-linux64.zip"),
        "ubuntu26.04-x64": cftUrl("linux64/chrome-headless-shell-linux64.zip"),
        "ubuntu18.04-arm64": void 0,
        "ubuntu20.04-arm64": "builds/chromium-tip-of-tree/%s/chromium-tip-of-tree-headless-shell-linux-arm64.zip",
        "ubuntu22.04-arm64": "builds/chromium-tip-of-tree/%s/chromium-tip-of-tree-headless-shell-linux-arm64.zip",
        "ubuntu24.04-arm64": "builds/chromium-tip-of-tree/%s/chromium-tip-of-tree-headless-shell-linux-arm64.zip",
        "ubuntu26.04-arm64": "builds/chromium-tip-of-tree/%s/chromium-tip-of-tree-headless-shell-linux-arm64.zip",
        "debian11-x64": cftUrl("linux64/chrome-headless-shell-linux64.zip"),
        "debian11-arm64": "builds/chromium-tip-of-tree/%s/chromium-tip-of-tree-headless-shell-linux-arm64.zip",
        "debian12-x64": cftUrl("linux64/chrome-headless-shell-linux64.zip"),
        "debian12-arm64": "builds/chromium-tip-of-tree/%s/chromium-tip-of-tree-headless-shell-linux-arm64.zip",
        "debian13-x64": cftUrl("linux64/chrome-headless-shell-linux64.zip"),
        "debian13-arm64": "builds/chromium-tip-of-tree/%s/chromium-tip-of-tree-headless-shell-linux-arm64.zip",
        "mac10.13": void 0,
        "mac10.14": void 0,
        "mac10.15": void 0,
        "mac11": cftUrl("mac-x64/chrome-headless-shell-mac-x64.zip"),
        "mac11-arm64": cftUrl("mac-arm64/chrome-headless-shell-mac-arm64.zip"),
        "mac12": cftUrl("mac-x64/chrome-headless-shell-mac-x64.zip"),
        "mac12-arm64": cftUrl("mac-arm64/chrome-headless-shell-mac-arm64.zip"),
        "mac13": cftUrl("mac-x64/chrome-headless-shell-mac-x64.zip"),
        "mac13-arm64": cftUrl("mac-arm64/chrome-headless-shell-mac-arm64.zip"),
        "mac14": cftUrl("mac-x64/chrome-headless-shell-mac-x64.zip"),
        "mac14-arm64": cftUrl("mac-arm64/chrome-headless-shell-mac-arm64.zip"),
        "mac15": cftUrl("mac-x64/chrome-headless-shell-mac-x64.zip"),
        "mac15-arm64": cftUrl("mac-arm64/chrome-headless-shell-mac-arm64.zip"),
        "mac26": cftUrl("mac-x64/chrome-headless-shell-mac-x64.zip"),
        "mac26-arm64": cftUrl("mac-arm64/chrome-headless-shell-mac-arm64.zip"),
        "win64": cftUrl("win64/chrome-headless-shell-win64.zip")
      },
      "firefox": {
        "<unknown>": void 0,
        "ubuntu18.04-x64": void 0,
        "ubuntu20.04-x64": "builds/firefox/%s/firefox-ubuntu-20.04.zip",
        "ubuntu22.04-x64": "builds/firefox/%s/firefox-ubuntu-22.04.zip",
        "ubuntu24.04-x64": "builds/firefox/%s/firefox-ubuntu-24.04.zip",
        "ubuntu26.04-x64": "builds/firefox/%s/firefox-ubuntu-24.04.zip",
        "ubuntu18.04-arm64": void 0,
        "ubuntu20.04-arm64": "builds/firefox/%s/firefox-ubuntu-20.04-arm64.zip",
        "ubuntu22.04-arm64": "builds/firefox/%s/firefox-ubuntu-22.04-arm64.zip",
        "ubuntu24.04-arm64": "builds/firefox/%s/firefox-ubuntu-24.04-arm64.zip",
        "ubuntu26.04-arm64": "builds/firefox/%s/firefox-ubuntu-24.04-arm64.zip",
        "debian11-x64": "builds/firefox/%s/firefox-debian-11.zip",
        "debian11-arm64": "builds/firefox/%s/firefox-debian-11-arm64.zip",
        "debian12-x64": "builds/firefox/%s/firefox-debian-12.zip",
        "debian12-arm64": "builds/firefox/%s/firefox-debian-12-arm64.zip",
        "debian13-x64": "builds/firefox/%s/firefox-debian-13.zip",
        "debian13-arm64": "builds/firefox/%s/firefox-debian-13-arm64.zip",
        "mac10.13": "builds/firefox/%s/firefox-mac.zip",
        "mac10.14": "builds/firefox/%s/firefox-mac.zip",
        "mac10.15": "builds/firefox/%s/firefox-mac.zip",
        "mac11": "builds/firefox/%s/firefox-mac.zip",
        "mac11-arm64": "builds/firefox/%s/firefox-mac-arm64.zip",
        "mac12": "builds/firefox/%s/firefox-mac.zip",
        "mac12-arm64": "builds/firefox/%s/firefox-mac-arm64.zip",
        "mac13": "builds/firefox/%s/firefox-mac.zip",
        "mac13-arm64": "builds/firefox/%s/firefox-mac-arm64.zip",
        "mac14": "builds/firefox/%s/firefox-mac.zip",
        "mac14-arm64": "builds/firefox/%s/firefox-mac-arm64.zip",
        "mac15": "builds/firefox/%s/firefox-mac.zip",
        "mac15-arm64": "builds/firefox/%s/firefox-mac-arm64.zip",
        "mac26": "builds/firefox/%s/firefox-mac.zip",
        "mac26-arm64": "builds/firefox/%s/firefox-mac-arm64.zip",
        "win64": "builds/firefox/%s/firefox-win64.zip"
      },
      "firefox-beta": {
        "<unknown>": void 0,
        "ubuntu18.04-x64": void 0,
        "ubuntu20.04-x64": "builds/firefox-beta/%s/firefox-beta-ubuntu-20.04.zip",
        "ubuntu22.04-x64": "builds/firefox-beta/%s/firefox-beta-ubuntu-22.04.zip",
        "ubuntu24.04-x64": "builds/firefox-beta/%s/firefox-beta-ubuntu-24.04.zip",
        "ubuntu26.04-x64": "builds/firefox-beta/%s/firefox-beta-ubuntu-24.04.zip",
        "ubuntu18.04-arm64": void 0,
        "ubuntu20.04-arm64": void 0,
        "ubuntu22.04-arm64": "builds/firefox-beta/%s/firefox-beta-ubuntu-22.04-arm64.zip",
        "ubuntu24.04-arm64": "builds/firefox-beta/%s/firefox-beta-ubuntu-24.04-arm64.zip",
        "ubuntu26.04-arm64": "builds/firefox-beta/%s/firefox-beta-ubuntu-24.04-arm64.zip",
        "debian11-x64": "builds/firefox-beta/%s/firefox-beta-debian-11.zip",
        "debian11-arm64": "builds/firefox-beta/%s/firefox-beta-debian-11-arm64.zip",
        "debian12-x64": "builds/firefox-beta/%s/firefox-beta-debian-12.zip",
        "debian12-arm64": "builds/firefox-beta/%s/firefox-beta-debian-12-arm64.zip",
        "debian13-x64": "builds/firefox-beta/%s/firefox-beta-debian-12.zip",
        "debian13-arm64": "builds/firefox-beta/%s/firefox-beta-debian-12-arm64.zip",
        "mac10.13": "builds/firefox-beta/%s/firefox-beta-mac.zip",
        "mac10.14": "builds/firefox-beta/%s/firefox-beta-mac.zip",
        "mac10.15": "builds/firefox-beta/%s/firefox-beta-mac.zip",
        "mac11": "builds/firefox-beta/%s/firefox-beta-mac.zip",
        "mac11-arm64": "builds/firefox-beta/%s/firefox-beta-mac-arm64.zip",
        "mac12": "builds/firefox-beta/%s/firefox-beta-mac.zip",
        "mac12-arm64": "builds/firefox-beta/%s/firefox-beta-mac-arm64.zip",
        "mac13": "builds/firefox-beta/%s/firefox-beta-mac.zip",
        "mac13-arm64": "builds/firefox-beta/%s/firefox-beta-mac-arm64.zip",
        "mac14": "builds/firefox-beta/%s/firefox-beta-mac.zip",
        "mac14-arm64": "builds/firefox-beta/%s/firefox-beta-mac-arm64.zip",
        "mac15": "builds/firefox-beta/%s/firefox-beta-mac.zip",
        "mac15-arm64": "builds/firefox-beta/%s/firefox-beta-mac-arm64.zip",
        "mac26": "builds/firefox-beta/%s/firefox-beta-mac.zip",
        "mac26-arm64": "builds/firefox-beta/%s/firefox-beta-mac-arm64.zip",
        "win64": "builds/firefox-beta/%s/firefox-beta-win64.zip"
      },
      "webkit": {
        "<unknown>": void 0,
        "ubuntu18.04-x64": void 0,
        "ubuntu20.04-x64": "builds/webkit/%s/webkit-ubuntu-20.04.zip",
        "ubuntu22.04-x64": "builds/webkit/%s/webkit-ubuntu-22.04.zip",
        "ubuntu24.04-x64": "builds/webkit/%s/webkit-ubuntu-24.04.zip",
        "ubuntu26.04-x64": "builds/webkit/%s/webkit-ubuntu-26.04.zip",
        "ubuntu18.04-arm64": void 0,
        "ubuntu20.04-arm64": "builds/webkit/%s/webkit-ubuntu-20.04-arm64.zip",
        "ubuntu22.04-arm64": "builds/webkit/%s/webkit-ubuntu-22.04-arm64.zip",
        "ubuntu24.04-arm64": "builds/webkit/%s/webkit-ubuntu-24.04-arm64.zip",
        "ubuntu26.04-arm64": "builds/webkit/%s/webkit-ubuntu-26.04-arm64.zip",
        "debian11-x64": "builds/webkit/%s/webkit-debian-11.zip",
        "debian11-arm64": "builds/webkit/%s/webkit-debian-11-arm64.zip",
        "debian12-x64": "builds/webkit/%s/webkit-debian-12.zip",
        "debian12-arm64": "builds/webkit/%s/webkit-debian-12-arm64.zip",
        "debian13-x64": "builds/webkit/%s/webkit-debian-13.zip",
        "debian13-arm64": "builds/webkit/%s/webkit-debian-13-arm64.zip",
        "mac10.13": void 0,
        "mac10.14": void 0,
        "mac10.15": void 0,
        "mac11": void 0,
        "mac11-arm64": void 0,
        "mac12": void 0,
        "mac12-arm64": void 0,
        "mac13": void 0,
        "mac13-arm64": void 0,
        "mac14": "builds/webkit/%s/webkit-mac-14.zip",
        "mac14-arm64": "builds/webkit/%s/webkit-mac-14-arm64.zip",
        "mac15": "builds/webkit/%s/webkit-mac-15.zip",
        "mac15-arm64": "builds/webkit/%s/webkit-mac-15-arm64.zip",
        "mac26": "builds/webkit/%s/webkit-mac-15.zip",
        "mac26-arm64": "builds/webkit/%s/webkit-mac-15-arm64.zip",
        "win64": "builds/webkit/%s/webkit-win64.zip"
      },
      "ffmpeg": {
        "<unknown>": void 0,
        "ubuntu18.04-x64": void 0,
        "ubuntu20.04-x64": "builds/ffmpeg/%s/ffmpeg-linux.zip",
        "ubuntu22.04-x64": "builds/ffmpeg/%s/ffmpeg-linux.zip",
        "ubuntu24.04-x64": "builds/ffmpeg/%s/ffmpeg-linux.zip",
        "ubuntu26.04-x64": "builds/ffmpeg/%s/ffmpeg-linux.zip",
        "ubuntu18.04-arm64": void 0,
        "ubuntu20.04-arm64": "builds/ffmpeg/%s/ffmpeg-linux-arm64.zip",
        "ubuntu22.04-arm64": "builds/ffmpeg/%s/ffmpeg-linux-arm64.zip",
        "ubuntu24.04-arm64": "builds/ffmpeg/%s/ffmpeg-linux-arm64.zip",
        "ubuntu26.04-arm64": "builds/ffmpeg/%s/ffmpeg-linux-arm64.zip",
        "debian11-x64": "builds/ffmpeg/%s/ffmpeg-linux.zip",
        "debian11-arm64": "builds/ffmpeg/%s/ffmpeg-linux-arm64.zip",
        "debian12-x64": "builds/ffmpeg/%s/ffmpeg-linux.zip",
        "debian12-arm64": "builds/ffmpeg/%s/ffmpeg-linux-arm64.zip",
        "debian13-x64": "builds/ffmpeg/%s/ffmpeg-linux.zip",
        "debian13-arm64": "builds/ffmpeg/%s/ffmpeg-linux-arm64.zip",
        "mac10.13": "builds/ffmpeg/%s/ffmpeg-mac.zip",
        "mac10.14": "builds/ffmpeg/%s/ffmpeg-mac.zip",
        "mac10.15": "builds/ffmpeg/%s/ffmpeg-mac.zip",
        "mac11": "builds/ffmpeg/%s/ffmpeg-mac.zip",
        "mac11-arm64": "builds/ffmpeg/%s/ffmpeg-mac-arm64.zip",
        "mac12": "builds/ffmpeg/%s/ffmpeg-mac.zip",
        "mac12-arm64": "builds/ffmpeg/%s/ffmpeg-mac-arm64.zip",
        "mac13": "builds/ffmpeg/%s/ffmpeg-mac.zip",
        "mac13-arm64": "builds/ffmpeg/%s/ffmpeg-mac-arm64.zip",
        "mac14": "builds/ffmpeg/%s/ffmpeg-mac.zip",
        "mac14-arm64": "builds/ffmpeg/%s/ffmpeg-mac-arm64.zip",
        "mac15": "builds/ffmpeg/%s/ffmpeg-mac.zip",
        "mac15-arm64": "builds/ffmpeg/%s/ffmpeg-mac-arm64.zip",
        "mac26": "builds/ffmpeg/%s/ffmpeg-mac.zip",
        "mac26-arm64": "builds/ffmpeg/%s/ffmpeg-mac-arm64.zip",
        "win64": "builds/ffmpeg/%s/ffmpeg-win64.zip"
      },
      "winldd": {
        "<unknown>": void 0,
        "ubuntu18.04-x64": void 0,
        "ubuntu20.04-x64": void 0,
        "ubuntu22.04-x64": void 0,
        "ubuntu24.04-x64": void 0,
        "ubuntu26.04-x64": void 0,
        "ubuntu18.04-arm64": void 0,
        "ubuntu20.04-arm64": void 0,
        "ubuntu22.04-arm64": void 0,
        "ubuntu24.04-arm64": void 0,
        "ubuntu26.04-arm64": void 0,
        "debian11-x64": void 0,
        "debian11-arm64": void 0,
        "debian12-x64": void 0,
        "debian12-arm64": void 0,
        "debian13-x64": void 0,
        "debian13-arm64": void 0,
        "mac10.13": void 0,
        "mac10.14": void 0,
        "mac10.15": void 0,
        "mac11": void 0,
        "mac11-arm64": void 0,
        "mac12": void 0,
        "mac12-arm64": void 0,
        "mac13": void 0,
        "mac13-arm64": void 0,
        "mac14": void 0,
        "mac14-arm64": void 0,
        "mac15": void 0,
        "mac15-arm64": void 0,
        "mac26": void 0,
        "mac26-arm64": void 0,
        "win64": "builds/winldd/%s/winldd-win64.zip"
      },
      "android": {
        "<unknown>": "builds/android/%s/android.zip",
        "ubuntu18.04-x64": void 0,
        "ubuntu20.04-x64": "builds/android/%s/android.zip",
        "ubuntu22.04-x64": "builds/android/%s/android.zip",
        "ubuntu24.04-x64": "builds/android/%s/android.zip",
        "ubuntu26.04-x64": "builds/android/%s/android.zip",
        "ubuntu18.04-arm64": void 0,
        "ubuntu20.04-arm64": "builds/android/%s/android.zip",
        "ubuntu22.04-arm64": "builds/android/%s/android.zip",
        "ubuntu24.04-arm64": "builds/android/%s/android.zip",
        "ubuntu26.04-arm64": "builds/android/%s/android.zip",
        "debian11-x64": "builds/android/%s/android.zip",
        "debian11-arm64": "builds/android/%s/android.zip",
        "debian12-x64": "builds/android/%s/android.zip",
        "debian12-arm64": "builds/android/%s/android.zip",
        "debian13-x64": "builds/android/%s/android.zip",
        "debian13-arm64": "builds/android/%s/android.zip",
        "mac10.13": "builds/android/%s/android.zip",
        "mac10.14": "builds/android/%s/android.zip",
        "mac10.15": "builds/android/%s/android.zip",
        "mac11": "builds/android/%s/android.zip",
        "mac11-arm64": "builds/android/%s/android.zip",
        "mac12": "builds/android/%s/android.zip",
        "mac12-arm64": "builds/android/%s/android.zip",
        "mac13": "builds/android/%s/android.zip",
        "mac13-arm64": "builds/android/%s/android.zip",
        "mac14": "builds/android/%s/android.zip",
        "mac14-arm64": "builds/android/%s/android.zip",
        "mac15": "builds/android/%s/android.zip",
        "mac15-arm64": "builds/android/%s/android.zip",
        "mac26": "builds/android/%s/android.zip",
        "mac26-arm64": "builds/android/%s/android.zip",
        "win64": "builds/android/%s/android.zip"
      }
    };
    defaultCacheDirectory = (() => {
      if (process.platform === "linux")
        return process.env.XDG_CACHE_HOME || import_path19.default.join(import_os8.default.homedir(), ".cache");
      if (process.platform === "darwin")
        return import_path19.default.join(import_os8.default.homedir(), "Library", "Caches");
      if (process.platform === "win32")
        return process.env.LOCALAPPDATA || import_path19.default.join(import_os8.default.homedir(), "AppData", "Local");
      throw new Error("Unsupported platform: " + process.platform);
    })();
    defaultRegistryDirectory = import_path19.default.join(defaultCacheDirectory, "ms-playwright");
    registryDirectory = (() => {
      let result2;
      const envDefined = getFromENV("PLAYWRIGHT_BROWSERS_PATH");
      if (envDefined === "0")
        result2 = import_path19.default.join(packageRoot, ".local-browsers");
      else if (envDefined)
        result2 = envDefined;
      else
        result2 = defaultRegistryDirectory;
      if (!import_path19.default.isAbsolute(result2)) {
        result2 = import_path19.default.resolve(getFromENV("INIT_CWD") || process.cwd(), result2);
      }
      return result2;
    })();
    allDownloadableDirectoriesThatEverExisted = ["android", "chromium", "firefox", "webkit", "ffmpeg", "firefox-beta", "chromium-tip-of-tree", "chromium-headless-shell", "chromium-tip-of-tree-headless-shell", "winldd"];
    chromiumAliases = ["chrome-for-testing"];
    Registry = class {
      constructor(browsersJSON) {
        const descriptors = readDescriptors(browsersJSON);
        const findExecutablePath = (dir, name) => {
          const tokens = EXECUTABLE_PATHS[name][shortPlatform];
          return tokens ? import_path19.default.join(dir, ...tokens) : void 0;
        };
        const executablePathOrDie = (name, e, installByDefault, sdkLanguage) => {
          if (!e)
            throw new Error(`${name} is not supported on ${hostPlatform}`);
          const installCommand = buildPlaywrightCLICommand(sdkLanguage, `install${installByDefault ? "" : " " + name}`);
          if (!canAccessFile(e)) {
            const currentDockerVersion = readDockerVersionSync();
            const preferredDockerVersion = currentDockerVersion ? dockerVersion(currentDockerVersion.dockerImageNameTemplate) : null;
            const isOutdatedDockerImage = currentDockerVersion && preferredDockerVersion && currentDockerVersion.dockerImageName !== preferredDockerVersion.dockerImageName;
            const isFfmpeg = name === "ffmpeg";
            let prettyMessage;
            if (isOutdatedDockerImage) {
              prettyMessage = [
                `Looks like Playwright was just updated to ${preferredDockerVersion.driverVersion}.`,
                `Please update docker image as well.`,
                `-  current: ${currentDockerVersion.dockerImageName}`,
                `- required: ${preferredDockerVersion.dockerImageName}`,
                ``,
                `<3 Playwright Team`
              ].join("\n");
            } else if (isFfmpeg) {
              prettyMessage = [
                `Video rendering requires ffmpeg binary.`,
                `Downloading it will not affect any of the system-wide settings.`,
                `Please run the following command:`,
                ``,
                `    ${buildPlaywrightCLICommand(sdkLanguage, "install ffmpeg")}`,
                ``,
                `<3 Playwright Team`
              ].join("\n");
            } else {
              prettyMessage = [
                `Looks like Playwright was just installed or updated.`,
                `Please run the following command to download new browser${installByDefault ? "s" : ""}:`,
                ``,
                `    ${installCommand}`,
                ``,
                `<3 Playwright Team`
              ].join("\n");
            }
            throw new Error(`Executable doesn't exist at ${e}
${wrapInASCIIBox(prettyMessage, 1)}`);
          }
          return e;
        };
        this._executables = [];
        const chromium = descriptors.find((d) => d.name === "chromium");
        const chromiumExecutable = findExecutablePath(chromium.dir, "chromium");
        this._executables.push({
          name: "chromium",
          browserName: "chromium",
          directory: chromium.dir,
          executablePath: () => chromiumExecutable,
          executablePathOrDie: (sdkLanguage) => executablePathOrDie("chromium", chromiumExecutable, chromium.installByDefault, sdkLanguage),
          installType: chromium.installByDefault ? "download-by-default" : "download-on-demand",
          _validateHostRequirements: (sdkLanguage) => this._validateHostRequirements(sdkLanguage, chromium.dir, ["chrome-linux"], [], ["chrome-win"]),
          downloadURLs: this._downloadURLs(chromium),
          title: chromium.title,
          revision: chromium.revision,
          browserVersion: chromium.browserVersion,
          _install: (force) => this._downloadExecutable(chromium, force, chromiumExecutable),
          _dependencyGroup: "chromium",
          _isHermeticInstallation: true
        });
        const chromiumHeadlessShell = descriptors.find((d) => d.name === "chromium-headless-shell");
        const chromiumHeadlessShellExecutable = findExecutablePath(chromiumHeadlessShell.dir, "chromium-headless-shell");
        this._executables.push({
          name: "chromium-headless-shell",
          browserName: "chromium",
          directory: chromiumHeadlessShell.dir,
          executablePath: () => chromiumHeadlessShellExecutable,
          executablePathOrDie: (sdkLanguage) => executablePathOrDie("chromium", chromiumHeadlessShellExecutable, chromiumHeadlessShell.installByDefault, sdkLanguage),
          installType: chromiumHeadlessShell.installByDefault ? "download-by-default" : "download-on-demand",
          _validateHostRequirements: (sdkLanguage) => this._validateHostRequirements(sdkLanguage, chromiumHeadlessShell.dir, ["chrome-linux"], [], ["chrome-win"]),
          downloadURLs: this._downloadURLs(chromiumHeadlessShell),
          title: chromiumHeadlessShell.title,
          revision: chromiumHeadlessShell.revision,
          browserVersion: chromiumHeadlessShell.browserVersion,
          _install: (force) => this._downloadExecutable(chromiumHeadlessShell, force, chromiumHeadlessShellExecutable),
          _dependencyGroup: "chromium",
          _isHermeticInstallation: true
        });
        const chromiumTipOfTreeHeadlessShell = descriptors.find((d) => d.name === "chromium-tip-of-tree-headless-shell");
        const chromiumTipOfTreeHeadlessShellExecutable = findExecutablePath(chromiumTipOfTreeHeadlessShell.dir, "chromium-tip-of-tree-headless-shell");
        this._executables.push({
          name: "chromium-tip-of-tree-headless-shell",
          browserName: "chromium",
          directory: chromiumTipOfTreeHeadlessShell.dir,
          executablePath: () => chromiumTipOfTreeHeadlessShellExecutable,
          executablePathOrDie: (sdkLanguage) => executablePathOrDie("chromium", chromiumTipOfTreeHeadlessShellExecutable, chromiumTipOfTreeHeadlessShell.installByDefault, sdkLanguage),
          installType: chromiumTipOfTreeHeadlessShell.installByDefault ? "download-by-default" : "download-on-demand",
          _validateHostRequirements: (sdkLanguage) => this._validateHostRequirements(sdkLanguage, chromiumTipOfTreeHeadlessShell.dir, ["chrome-linux"], [], ["chrome-win"]),
          downloadURLs: this._downloadURLs(chromiumTipOfTreeHeadlessShell),
          title: chromiumTipOfTreeHeadlessShell.title,
          revision: chromiumTipOfTreeHeadlessShell.revision,
          browserVersion: chromiumTipOfTreeHeadlessShell.browserVersion,
          _install: (force) => this._downloadExecutable(chromiumTipOfTreeHeadlessShell, force, chromiumTipOfTreeHeadlessShellExecutable),
          _dependencyGroup: "chromium",
          _isHermeticInstallation: true
        });
        const chromiumTipOfTree = descriptors.find((d) => d.name === "chromium-tip-of-tree");
        const chromiumTipOfTreeExecutable = findExecutablePath(chromiumTipOfTree.dir, "chromium-tip-of-tree");
        this._executables.push({
          name: "chromium-tip-of-tree",
          browserName: "chromium",
          directory: chromiumTipOfTree.dir,
          executablePath: () => chromiumTipOfTreeExecutable,
          executablePathOrDie: (sdkLanguage) => executablePathOrDie("chromium-tip-of-tree", chromiumTipOfTreeExecutable, chromiumTipOfTree.installByDefault, sdkLanguage),
          installType: chromiumTipOfTree.installByDefault ? "download-by-default" : "download-on-demand",
          _validateHostRequirements: (sdkLanguage) => this._validateHostRequirements(sdkLanguage, chromiumTipOfTree.dir, ["chrome-linux"], [], ["chrome-win"]),
          downloadURLs: this._downloadURLs(chromiumTipOfTree),
          title: chromiumTipOfTree.title,
          revision: chromiumTipOfTree.revision,
          browserVersion: chromiumTipOfTree.browserVersion,
          _install: (force) => this._downloadExecutable(chromiumTipOfTree, force, chromiumTipOfTreeExecutable),
          _dependencyGroup: "chromium",
          _isHermeticInstallation: true
        });
        this._executables.push(this._createChromiumChannel("chrome", {
          "linux": "/opt/google/chrome/chrome",
          "darwin": "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome",
          "win32": `\\Google\\Chrome\\Application\\chrome.exe`
        }, () => this._installChromiumChannel("chrome", {
          "linux": "reinstall_chrome_stable_linux.sh",
          "darwin": "reinstall_chrome_stable_mac.sh",
          "win32": "reinstall_chrome_stable_win.ps1"
        })));
        this._executables.push(this._createChromiumChannel("chrome-beta", {
          "linux": "/opt/google/chrome-beta/chrome",
          "darwin": "/Applications/Google Chrome Beta.app/Contents/MacOS/Google Chrome Beta",
          "win32": `\\Google\\Chrome Beta\\Application\\chrome.exe`
        }, () => this._installChromiumChannel("chrome-beta", {
          "linux": "reinstall_chrome_beta_linux.sh",
          "darwin": "reinstall_chrome_beta_mac.sh",
          "win32": "reinstall_chrome_beta_win.ps1"
        })));
        this._executables.push(this._createChromiumChannel("chrome-dev", {
          "linux": "/opt/google/chrome-unstable/chrome",
          "darwin": "/Applications/Google Chrome Dev.app/Contents/MacOS/Google Chrome Dev",
          "win32": `\\Google\\Chrome Dev\\Application\\chrome.exe`
        }));
        this._executables.push(this._createChromiumChannel("chrome-canary", {
          "linux": "/opt/google/chrome-canary/chrome",
          "darwin": "/Applications/Google Chrome Canary.app/Contents/MacOS/Google Chrome Canary",
          "win32": `\\Google\\Chrome SxS\\Application\\chrome.exe`
        }));
        this._executables.push(this._createChromiumChannel("msedge", {
          "linux": "/opt/microsoft/msedge/msedge",
          "darwin": "/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge",
          "win32": `\\Microsoft\\Edge\\Application\\msedge.exe`
        }, () => this._installMSEdgeChannel("msedge", {
          "linux": "reinstall_msedge_stable_linux.sh",
          "darwin": "reinstall_msedge_stable_mac.sh",
          "win32": "reinstall_msedge_stable_win.ps1"
        })));
        this._executables.push(this._createChromiumChannel("msedge-beta", {
          "linux": "/opt/microsoft/msedge-beta/msedge",
          "darwin": "/Applications/Microsoft Edge Beta.app/Contents/MacOS/Microsoft Edge Beta",
          "win32": `\\Microsoft\\Edge Beta\\Application\\msedge.exe`
        }, () => this._installMSEdgeChannel("msedge-beta", {
          "darwin": "reinstall_msedge_beta_mac.sh",
          "linux": "reinstall_msedge_beta_linux.sh",
          "win32": "reinstall_msedge_beta_win.ps1"
        })));
        this._executables.push(this._createChromiumChannel("msedge-dev", {
          "linux": "/opt/microsoft/msedge-dev/msedge",
          "darwin": "/Applications/Microsoft Edge Dev.app/Contents/MacOS/Microsoft Edge Dev",
          "win32": `\\Microsoft\\Edge Dev\\Application\\msedge.exe`
        }, () => this._installMSEdgeChannel("msedge-dev", {
          "darwin": "reinstall_msedge_dev_mac.sh",
          "linux": "reinstall_msedge_dev_linux.sh",
          "win32": "reinstall_msedge_dev_win.ps1"
        })));
        this._executables.push(this._createChromiumChannel("msedge-canary", {
          "linux": "",
          "darwin": "/Applications/Microsoft Edge Canary.app/Contents/MacOS/Microsoft Edge Canary",
          "win32": `\\Microsoft\\Edge SxS\\Application\\msedge.exe`
        }));
        this._executables.push(this._createBidiFirefoxChannel("moz-firefox", {
          "linux": "/snap/bin/firefox",
          "darwin": "/Applications/Firefox.app/Contents/MacOS/firefox",
          "win32": "\\Mozilla Firefox\\firefox.exe"
        }));
        this._executables.push(this._createBidiFirefoxChannel("moz-firefox-beta", {
          "linux": "/opt/firefox-beta/firefox",
          "darwin": "/Applications/Firefox.app/Contents/MacOS/firefox",
          "win32": "\\Mozilla Firefox\\firefox.exe"
        }));
        this._executables.push(this._createBidiFirefoxChannel("moz-firefox-nightly", {
          "linux": "/opt/firefox-nightly/firefox",
          "darwin": "/Applications/Firefox Nightly.app/Contents/MacOS/firefox",
          "win32": "\\Mozilla Firefox\\firefox.exe"
        }));
        const firefox = descriptors.find((d) => d.name === "firefox");
        const firefoxExecutable = findExecutablePath(firefox.dir, "firefox");
        this._executables.push({
          name: "firefox",
          browserName: "firefox",
          directory: firefox.dir,
          executablePath: () => firefoxExecutable,
          executablePathOrDie: (sdkLanguage) => executablePathOrDie("firefox", firefoxExecutable, firefox.installByDefault, sdkLanguage),
          installType: firefox.installByDefault ? "download-by-default" : "download-on-demand",
          _validateHostRequirements: (sdkLanguage) => this._validateHostRequirements(sdkLanguage, firefox.dir, ["firefox"], [], ["firefox"]),
          downloadURLs: this._downloadURLs(firefox),
          title: firefox.title,
          revision: firefox.revision,
          browserVersion: firefox.browserVersion,
          _install: (force) => this._downloadExecutable(firefox, force, firefoxExecutable),
          _dependencyGroup: "firefox",
          _isHermeticInstallation: true
        });
        const firefoxBeta = descriptors.find((d) => d.name === "firefox-beta");
        const firefoxBetaExecutable = findExecutablePath(firefoxBeta.dir, "firefox");
        this._executables.push({
          name: "firefox-beta",
          browserName: "firefox",
          directory: firefoxBeta.dir,
          executablePath: () => firefoxBetaExecutable,
          executablePathOrDie: (sdkLanguage) => executablePathOrDie("firefox-beta", firefoxBetaExecutable, firefoxBeta.installByDefault, sdkLanguage),
          installType: firefoxBeta.installByDefault ? "download-by-default" : "download-on-demand",
          _validateHostRequirements: (sdkLanguage) => this._validateHostRequirements(sdkLanguage, firefoxBeta.dir, ["firefox"], [], ["firefox"]),
          downloadURLs: this._downloadURLs(firefoxBeta),
          title: firefoxBeta.title,
          revision: firefoxBeta.revision,
          browserVersion: firefoxBeta.browserVersion,
          _install: (force) => this._downloadExecutable(firefoxBeta, force, firefoxBetaExecutable),
          _dependencyGroup: "firefox",
          _isHermeticInstallation: true
        });
        const webkit = descriptors.find((d) => d.name === "webkit");
        const webkitExecutable = findExecutablePath(webkit.dir, "webkit");
        const webkitLinuxLddDirectories = [
          import_path19.default.join("minibrowser-gtk"),
          import_path19.default.join("minibrowser-gtk", "bin"),
          import_path19.default.join("minibrowser-gtk", "lib"),
          import_path19.default.join("minibrowser-gtk", "sys", "lib"),
          import_path19.default.join("minibrowser-wpe"),
          import_path19.default.join("minibrowser-wpe", "bin"),
          import_path19.default.join("minibrowser-wpe", "lib"),
          import_path19.default.join("minibrowser-wpe", "sys", "lib")
        ];
        this._executables.push({
          name: "webkit",
          browserName: "webkit",
          directory: webkit.dir,
          executablePath: () => webkitExecutable,
          executablePathOrDie: (sdkLanguage) => executablePathOrDie("webkit", webkitExecutable, webkit.installByDefault, sdkLanguage),
          installType: webkit.installByDefault ? "download-by-default" : "download-on-demand",
          _validateHostRequirements: (sdkLanguage) => this._validateHostRequirements(sdkLanguage, webkit.dir, webkitLinuxLddDirectories, ["libGLESv2.so.2", "libx264.so"], [""]),
          downloadURLs: this._downloadURLs(webkit),
          title: webkit.title,
          revision: webkit.revision,
          browserVersion: webkit.browserVersion,
          _install: (force) => this._downloadExecutable(webkit, force, webkitExecutable),
          _dependencyGroup: "webkit",
          _isHermeticInstallation: true
        });
        this._executables.push({
          name: "webkit-wsl",
          browserName: "webkit",
          directory: webkit.dir,
          executablePath: () => webkitExecutable,
          executablePathOrDie: (sdkLanguage) => executablePathOrDie("webkit", webkitExecutable, webkit.installByDefault, sdkLanguage),
          installType: "download-on-demand",
          title: "Webkit in WSL",
          _validateHostRequirements: (sdkLanguage) => Promise.resolve(),
          _isHermeticInstallation: true,
          _install: async () => {
            if (process.platform !== "win32")
              throw new Error(`WebKit via WSL is only supported on Windows`);
            const script = import_path19.default.join(BIN_PATH, "install_webkit_wsl.ps1");
            const { code } = await spawnAsync("powershell.exe", [
              "-ExecutionPolicy",
              "Bypass",
              "-File",
              script
            ], {
              stdio: "inherit"
            });
            if (code !== 0)
              throw new Error(`Failed to install WebKit via WSL`);
          }
        });
        const ffmpeg = descriptors.find((d) => d.name === "ffmpeg");
        const ffmpegExecutable = findExecutablePath(ffmpeg.dir, "ffmpeg");
        this._executables.push({
          name: "ffmpeg",
          browserName: void 0,
          directory: ffmpeg.dir,
          executablePath: () => ffmpegExecutable,
          executablePathOrDie: (sdkLanguage) => executablePathOrDie("ffmpeg", ffmpegExecutable, ffmpeg.installByDefault, sdkLanguage),
          installType: ffmpeg.installByDefault ? "download-by-default" : "download-on-demand",
          _validateHostRequirements: () => Promise.resolve(),
          downloadURLs: this._downloadURLs(ffmpeg),
          title: ffmpeg.title,
          revision: ffmpeg.revision,
          _install: (force) => this._downloadExecutable(ffmpeg, force, ffmpegExecutable),
          _dependencyGroup: "tools",
          _isHermeticInstallation: true
        });
        const winldd = descriptors.find((d) => d.name === "winldd");
        const winlddExecutable = findExecutablePath(winldd.dir, "winldd");
        this._executables.push({
          name: "winldd",
          browserName: void 0,
          directory: winldd.dir,
          executablePath: () => winlddExecutable,
          executablePathOrDie: (sdkLanguage) => executablePathOrDie("winldd", winlddExecutable, winldd.installByDefault, sdkLanguage),
          installType: process.platform === "win32" ? "download-by-default" : "none",
          _validateHostRequirements: () => Promise.resolve(),
          downloadURLs: this._downloadURLs(winldd),
          title: winldd.title,
          revision: winldd.revision,
          _install: (force) => this._downloadExecutable(winldd, force, winlddExecutable),
          _dependencyGroup: "tools",
          _isHermeticInstallation: true
        });
        const android = descriptors.find((d) => d.name === "android");
        this._executables.push({
          name: "android",
          browserName: void 0,
          directory: android.dir,
          executablePath: () => void 0,
          executablePathOrDie: () => "",
          installType: "download-on-demand",
          _validateHostRequirements: () => Promise.resolve(),
          downloadURLs: this._downloadURLs(android),
          title: android.title,
          revision: android.revision,
          _install: (force) => this._downloadExecutable(android, force),
          _dependencyGroup: "tools",
          _isHermeticInstallation: true
        });
      }
      _createChromiumChannel(name, lookAt, install2) {
        const executablePath = (sdkLanguage, shouldThrow) => {
          const suffix = lookAt[process.platform];
          if (!suffix) {
            if (shouldThrow)
              throw new Error(`Chromium distribution '${name}' is not supported on ${process.platform}`);
            return void 0;
          }
          const prefixes = process.platform === "win32" ? [
            process.env.LOCALAPPDATA,
            process.env.PROGRAMFILES,
            process.env["PROGRAMFILES(X86)"],
            // In some cases there is no PROGRAMFILES/(86) env var set but HOMEDRIVE is set.
            process.env.HOMEDRIVE + "\\Program Files",
            process.env.HOMEDRIVE + "\\Program Files (x86)"
          ].filter(Boolean) : [""];
          for (const prefix of prefixes) {
            const executablePath2 = import_path19.default.join(prefix, suffix);
            if (canAccessFile(executablePath2))
              return executablePath2;
          }
          if (!shouldThrow)
            return void 0;
          const location2 = prefixes.length ? ` at ${import_path19.default.join(prefixes[0], suffix)}` : ``;
          const installation = install2 ? `
Run "${buildPlaywrightCLICommand(sdkLanguage, "install " + name)}"` : "";
          throw new Error(`Chromium distribution '${name}' is not found${location2}${installation}`);
        };
        return {
          name,
          browserName: "chromium",
          directory: void 0,
          executablePath: () => executablePath("", false),
          executablePathOrDie: (sdkLanguage) => executablePath(sdkLanguage, true),
          installType: install2 ? "install-script" : "none",
          _validateHostRequirements: () => Promise.resolve(),
          _isHermeticInstallation: false,
          _install: install2
        };
      }
      _createBidiFirefoxChannel(name, lookAt, install2) {
        const executablePath = (sdkLanguage, shouldThrow) => {
          const suffix = lookAt[process.platform];
          if (!suffix) {
            if (shouldThrow)
              throw new Error(`Firefox distribution '${name}' is not supported on ${process.platform}`);
            return void 0;
          }
          const prefixes = process.platform === "win32" ? [
            process.env.LOCALAPPDATA,
            process.env.PROGRAMFILES,
            process.env["PROGRAMFILES(X86)"],
            // In some cases there is no PROGRAMFILES/(86) env var set but HOMEDRIVE is set.
            process.env.HOMEDRIVE + "\\Program Files",
            process.env.HOMEDRIVE + "\\Program Files (x86)"
          ].filter(Boolean) : [""];
          for (const prefix of prefixes) {
            const executablePath2 = import_path19.default.join(prefix, suffix);
            if (canAccessFile(executablePath2))
              return executablePath2;
          }
          if (shouldThrow)
            throw new Error(`Cannot find Firefox installation for channel '${name}' at the standard system paths. ${`Tried paths:
  ${prefixes.map((p) => import_path19.default.join(p, suffix)).join("\n  ")}`}`);
          return void 0;
        };
        return {
          name,
          browserName: "firefox",
          directory: void 0,
          executablePath: () => executablePath("", false),
          executablePathOrDie: (sdkLanguage) => executablePath(sdkLanguage, true),
          installType: "none",
          _validateHostRequirements: () => Promise.resolve(),
          _isHermeticInstallation: true,
          _install: install2
        };
      }
      executables() {
        return this._executables;
      }
      findExecutable(name) {
        return this._executables.find((b) => b.name === name);
      }
      defaultExecutables() {
        return this._executables.filter((e) => e.installType === "download-by-default");
      }
      _dedupe(executables) {
        return Array.from(new Set(executables));
      }
      async _validateHostRequirements(sdkLanguage, browserDirectory, linuxLddDirectories, dlOpenLibraries, windowsExeAndDllDirectories) {
        if (import_os8.default.platform() === "linux")
          return await validateDependenciesLinux(sdkLanguage, linuxLddDirectories.map((d) => import_path19.default.join(browserDirectory, d)), dlOpenLibraries);
        if (import_os8.default.platform() === "win32" && import_os8.default.arch() === "x64")
          return await validateDependenciesWindows(sdkLanguage, windowsExeAndDllDirectories.map((d) => import_path19.default.join(browserDirectory, d)));
      }
      async installDeps(executablesToInstallDeps, dryRun) {
        const executables = this._dedupe(executablesToInstallDeps);
        const targets = /* @__PURE__ */ new Set();
        for (const executable of executables) {
          if (executable._dependencyGroup)
            targets.add(executable._dependencyGroup);
        }
        targets.add("tools");
        if (import_os8.default.platform() === "win32")
          return await installDependenciesWindows(targets, dryRun);
        if (import_os8.default.platform() === "linux")
          return await installDependenciesLinux(targets, dryRun);
      }
      async install(executablesToInstall, options) {
        const executables = this._dedupe(executablesToInstall);
        await import_fs19.default.promises.mkdir(registryDirectory, { recursive: true });
        const lockfilePath = import_path19.default.join(registryDirectory, "__dirlock");
        const linksDir = import_path19.default.join(registryDirectory, ".links");
        let releaseLock;
        try {
          releaseLock = await lock(registryDirectory, {
            retries: {
              // Retry 20 times during 10 minutes with
              // exponential back-off.
              // See documentation at: https://www.npmjs.com/package/retry#retrytimeoutsoptions
              retries: 20,
              factor: 1.27579
            },
            onCompromised: (err) => {
              throw new Error(`${err.message} Path: ${lockfilePath}`);
            },
            lockfilePath
          });
          await import_fs19.default.promises.mkdir(linksDir, { recursive: true });
          await import_fs19.default.promises.writeFile(import_path19.default.join(linksDir, calculateSha1(PACKAGE_PATH)), PACKAGE_PATH);
          if (!getAsBooleanFromENV("PLAYWRIGHT_SKIP_BROWSER_GC"))
            await this._validateInstallationCache(linksDir);
          for (const executable of executables) {
            if (!executable._install)
              throw new Error(`ERROR: Playwright does not support installing ${executable.name}`);
            if (!getAsBooleanFromENV("CI") && !executable._isHermeticInstallation && !options?.force && executable.executablePath()) {
              const { embedderName } = getEmbedderName();
              const command = buildPlaywrightCLICommand(embedderName, "install --force " + executable.name);
              process.stderr.write("\n" + wrapInASCIIBox([
                `ATTENTION: "${executable.name}" is already installed on the system!`,
                ``,
                `"${executable.name}" installation is not hermetic; installing newer version`,
                `requires *removal* of a current installation first.`,
                ``,
                `To *uninstall* current version and re-install latest "${executable.name}":`,
                ``,
                `- Close all running instances of "${executable.name}", if any`,
                `- Use "--force" to install browser:`,
                ``,
                `    ${command}`,
                ``,
                `<3 Playwright Team`
              ].join("\n"), 1) + "\n\n");
              return;
            }
            await executable._install(!!options?.force);
          }
        } catch (e) {
          if (e.code === "ELOCKED") {
            const rmCommand = process.platform === "win32" ? "rm -R" : "rm -rf";
            throw new Error("\n" + wrapInASCIIBox([
              `An active lockfile is found at:`,
              ``,
              `  ${lockfilePath}`,
              ``,
              `Either:`,
              `- wait a few minutes if other Playwright is installing browsers in parallel`,
              `- remove lock manually with:`,
              ``,
              `    ${rmCommand} ${lockfilePath}`,
              ``,
              `<3 Playwright Team`
            ].join("\n"), 1));
          } else {
            throw e;
          }
        } finally {
          if (releaseLock)
            await releaseLock();
        }
      }
      async uninstall(all) {
        const linksDir = import_path19.default.join(registryDirectory, ".links");
        if (all) {
          const links = await import_fs19.default.promises.readdir(linksDir).catch(() => []);
          for (const link of links)
            await import_fs19.default.promises.unlink(import_path19.default.join(linksDir, link));
        } else {
          await import_fs19.default.promises.unlink(import_path19.default.join(linksDir, calculateSha1(PACKAGE_PATH))).catch(() => {
          });
        }
        await this._validateInstallationCache(linksDir);
        return {
          numberOfBrowsersLeft: (await import_fs19.default.promises.readdir(registryDirectory).catch(() => [])).filter((browserDirectory) => isBrowserDirectory(browserDirectory)).length
        };
      }
      async validateHostRequirementsForExecutablesIfNeeded(executables, sdkLanguage) {
        if (getAsBooleanFromENV("PLAYWRIGHT_SKIP_VALIDATE_HOST_REQUIREMENTS")) {
          process.stderr.write("Skipping host requirements validation logic because `PLAYWRIGHT_SKIP_VALIDATE_HOST_REQUIREMENTS` env variable is set.\n");
          return;
        }
        for (const executable of executables)
          await this._validateHostRequirementsForExecutableIfNeeded(executable, sdkLanguage);
      }
      async _validateHostRequirementsForExecutableIfNeeded(executable, sdkLanguage) {
        const kMaximumReValidationPeriod = 30 * 24 * 60 * 60 * 1e3;
        if (!executable.directory)
          return;
        const markerFile = import_path19.default.join(executable.directory, "DEPENDENCIES_VALIDATED");
        if (await import_fs19.default.promises.stat(markerFile).then((stat) => Date.now() - stat.mtime.getTime() < kMaximumReValidationPeriod).catch(() => false))
          return;
        debugLogger.log("install", `validating host requirements for "${executable.name}"`);
        try {
          await executable._validateHostRequirements(sdkLanguage);
          debugLogger.log("install", `validation passed for ${executable.name}`);
        } catch (error) {
          debugLogger.log("install", `validation failed for ${executable.name}`);
          throw error;
        }
        await import_fs19.default.promises.writeFile(markerFile, "").catch(() => {
        });
      }
      _downloadURLs(descriptor) {
        const paths = DOWNLOAD_PATHS[descriptor.name];
        const downloadPathTemplate = paths[hostPlatform] || paths["<unknown>"];
        if (!downloadPathTemplate)
          return [];
        let downloadPath;
        let mirrors;
        if (typeof downloadPathTemplate === "function") {
          const result2 = downloadPathTemplate(descriptor);
          downloadPath = result2.path;
          mirrors = result2.mirrors;
        } else {
          downloadPath = util2.format(downloadPathTemplate, descriptor.revision);
          mirrors = PLAYWRIGHT_CDN_MIRRORS;
        }
        let downloadHostEnv;
        if (descriptor.name.startsWith("chromium"))
          downloadHostEnv = "PLAYWRIGHT_CHROMIUM_DOWNLOAD_HOST";
        else if (descriptor.name.startsWith("firefox"))
          downloadHostEnv = "PLAYWRIGHT_FIREFOX_DOWNLOAD_HOST";
        else if (descriptor.name.startsWith("webkit"))
          downloadHostEnv = "PLAYWRIGHT_WEBKIT_DOWNLOAD_HOST";
        const customHostOverride = downloadHostEnv && getFromENV(downloadHostEnv) || getFromENV("PLAYWRIGHT_DOWNLOAD_HOST");
        if (customHostOverride)
          mirrors = [customHostOverride];
        return mirrors.map((mirror) => `${mirror}/${downloadPath}`);
      }
      async _downloadExecutable(descriptor, force, executablePath) {
        const downloadURLs = this._downloadURLs(descriptor);
        if (!downloadURLs.length)
          throw new Error(`ERROR: Playwright does not support ${descriptor.name} on ${hostPlatform}`);
        if (!isOfficiallySupportedPlatform)
          logPolitely(`BEWARE: your OS is not officially supported by Playwright; downloading fallback build for ${hostPlatform}.`);
        if (descriptor.hasRevisionOverride) {
          const message = `You are using a frozen ${descriptor.name} browser which does not receive updates anymore on ${hostPlatform}. Please update to the latest version of your operating system to test up-to-date browsers.`;
          if (process.env.GITHUB_ACTIONS)
            console.log(`::warning title=Playwright::${message}`);
          else
            logPolitely(message);
        }
        const title = this.calculateDownloadTitle(descriptor);
        const downloadFileName = `playwright-download-${descriptor.name}-${hostPlatform}-${descriptor.revision}.zip`;
        const downloadSocketTimeoutEnv = getFromENV("PLAYWRIGHT_DOWNLOAD_CONNECTION_TIMEOUT");
        const downloadSocketTimeout = +(downloadSocketTimeoutEnv || "0") || NET_DEFAULT_TIMEOUT;
        await downloadBrowserWithProgressBar(title, descriptor.dir, executablePath, downloadURLs, downloadFileName, downloadSocketTimeout, force).catch((e) => {
          throw new Error(`Failed to download ${title}, caused by
${e.stack}`);
        });
      }
      calculateDownloadTitle(descriptor) {
        const title = descriptor.title ?? descriptor.name.split("-").map((word) => {
          return word === "ffmpeg" ? "FFmpeg" : word.charAt(0).toUpperCase() + word.slice(1);
        }).join(" ");
        const version3 = descriptor.browserVersion ? " " + descriptor.browserVersion : "";
        return `${title}${version3} (playwright ${descriptor.name} v${descriptor.revision})`;
      }
      async _installMSEdgeChannel(channel, scripts) {
        const scriptArgs = [];
        if (process.platform !== "linux") {
          const products = lowercaseAllKeys(JSON.parse(await fetchData(void 0, { url: "https://edgeupdates.microsoft.com/api/products" })));
          const productName = {
            "msedge": "Stable",
            "msedge-beta": "Beta",
            "msedge-dev": "Dev"
          }[channel];
          const product = products.find((product2) => product2.product === productName);
          const searchConfig = {
            darwin: { platform: "MacOS", arch: "universal", artifact: "pkg" },
            win32: { platform: "Windows", arch: "x64", artifact: "msi" }
          }[process.platform];
          const release = searchConfig ? product.releases.find((release2) => release2.platform === searchConfig.platform && release2.architecture === searchConfig.arch && release2.artifacts.length > 0) : null;
          const artifact = release ? release.artifacts.find((artifact2) => artifact2.artifactname === searchConfig.artifact) : null;
          if (artifact)
            scriptArgs.push(
              artifact.location
              /* url */
            );
          else
            throw new Error(`Cannot install ${channel} on ${process.platform}`);
        }
        await this._installChromiumChannel(channel, scripts, scriptArgs);
      }
      async _installChromiumChannel(channel, scripts, scriptArgs = []) {
        const scriptName = scripts[process.platform];
        if (!scriptName)
          throw new Error(`Cannot install ${channel} on ${process.platform}`);
        const cwd = BIN_PATH;
        const isPowerShell = scriptName.endsWith(".ps1");
        if (isPowerShell) {
          const args = [
            "-ExecutionPolicy",
            "Bypass",
            "-File",
            import_path19.default.join(BIN_PATH, scriptName),
            ...scriptArgs
          ];
          const { code } = await spawnAsync("powershell.exe", args, { cwd, stdio: "inherit" });
          if (code !== 0)
            throw new Error(`Failed to install ${channel}`);
        } else {
          const shellArgs = scriptArgs.map((a) => `'${a.replace(/'/g, `'\\''`)}'`).join(" ");
          const { command, args, elevatedPermissions } = await transformCommandsForRoot([`bash "${import_path19.default.join(BIN_PATH, scriptName)}" ${shellArgs}`]);
          if (elevatedPermissions)
            console.log("Switching to root user to install dependencies...");
          const { code } = await spawnAsync(command, args, { cwd, stdio: "inherit" });
          if (code !== 0)
            throw new Error(`Failed to install ${channel}`);
        }
      }
      async listInstalledBrowsers() {
        const linksDir = import_path19.default.join(registryDirectory, ".links");
        const { browsers } = await this._traverseBrowserInstallations(linksDir);
        return browsers.filter((browser) => import_fs19.default.existsSync(browser.browserPath));
      }
      async _validateInstallationCache(linksDir) {
        const { browsers, brokenLinks } = await this._traverseBrowserInstallations(linksDir);
        await this._deleteStaleBrowsers(browsers);
        await this._deleteBrokenInstallations(brokenLinks);
      }
      async _traverseBrowserInstallations(linksDir) {
        const browserList = [];
        const brokenLinks = [];
        for (const fileName of await import_fs19.default.promises.readdir(linksDir)) {
          const linkPath = import_path19.default.join(linksDir, fileName);
          let linkTarget = "";
          try {
            linkTarget = (await import_fs19.default.promises.readFile(linkPath)).toString();
            const browsersJSON = require(import_path19.default.join(linkTarget, "browsers.json"));
            const descriptors = readDescriptors(browsersJSON);
            for (const browserName of allDownloadableDirectoriesThatEverExisted) {
              const descriptor = descriptors.find((d) => d.name === browserName);
              if (!descriptor)
                continue;
              const browserPath = descriptor.dir;
              const browserVersion = parseInt(descriptor.revision, 10);
              browserList.push({
                browserName,
                browserVersion,
                browserPath,
                referenceDir: linkTarget
              });
            }
          } catch (e) {
            brokenLinks.push(linkPath);
          }
        }
        return { browsers: browserList, brokenLinks };
      }
      async _deleteStaleBrowsers(browserList) {
        const usedBrowserPaths = /* @__PURE__ */ new Set();
        for (const browser of browserList) {
          const { browserName, browserVersion, browserPath } = browser;
          const shouldHaveMarkerFile = browserName === "chromium" && (browserVersion >= 786218 || browserVersion < 3e5) || browserName === "firefox" && browserVersion >= 1128 || browserName === "webkit" && browserVersion >= 1307 || // All new applications have a marker file right away.
          browserName !== "firefox" && browserName !== "chromium" && browserName !== "webkit";
          if (!shouldHaveMarkerFile || await existsAsync(browserDirectoryToMarkerFilePath(browserPath)))
            usedBrowserPaths.add(browserPath);
        }
        let downloadedBrowsers = (await import_fs19.default.promises.readdir(registryDirectory)).map((file) => import_path19.default.join(registryDirectory, file));
        downloadedBrowsers = downloadedBrowsers.filter((file) => isBrowserDirectory(file));
        const directories = new Set(downloadedBrowsers);
        for (const browserDirectory of usedBrowserPaths)
          directories.delete(browserDirectory);
        for (const directory of directories)
          logPolitely("Removing unused browser at " + directory);
        await removeFolders([...directories]);
      }
      async _deleteBrokenInstallations(brokenLinks) {
        for (const linkPath of brokenLinks)
          await import_fs19.default.promises.unlink(linkPath).catch((e) => {
          });
      }
      _defaultBrowsersToInstall(options) {
        let executables = this.defaultExecutables();
        if (options.shell === "no")
          executables = executables.filter((e) => e.name !== "chromium-headless-shell" && e.name !== "chromium-tip-of-tree-headless-shell");
        if (options.shell === "only")
          executables = executables.filter((e) => e.name !== "chromium" && e.name !== "chromium-tip-of-tree");
        return executables;
      }
      suggestedBrowsersToInstall() {
        const names = this.executables().filter((e) => e.installType !== "none").map((e) => e.name);
        names.push(...chromiumAliases);
        return names.sort().join(", ");
      }
      isChromiumAlias(name) {
        return chromiumAliases.includes(name);
      }
      resolveBrowsers(aliases2, options) {
        if (aliases2.length === 0)
          return this._defaultBrowsersToInstall(options);
        const faultyArguments = [];
        const executables = [];
        const handleArgument = (arg) => {
          const executable = this.findExecutable(arg);
          if (!executable || executable.installType === "none")
            faultyArguments.push(arg);
          else
            executables.push(executable);
          if (executable?.browserName)
            executables.push(this.findExecutable("ffmpeg"));
        };
        for (const alias of aliases2) {
          if (alias === "chromium" || chromiumAliases.includes(alias)) {
            if (options.shell !== "only")
              handleArgument("chromium");
            if (options.shell !== "no")
              handleArgument("chromium-headless-shell");
          } else if (alias === "chromium-tip-of-tree") {
            if (options.shell !== "only")
              handleArgument("chromium-tip-of-tree");
            if (options.shell !== "no")
              handleArgument("chromium-tip-of-tree-headless-shell");
          } else {
            handleArgument(alias);
          }
        }
        if (process.platform === "win32")
          executables.push(this.findExecutable("winldd"));
        if (faultyArguments.length)
          throw new Error(`Invalid installation targets: ${faultyArguments.map((name) => `'${name}'`).join(", ")}. Expecting one of: ${this.suggestedBrowsersToInstall()}`);
        return [...new Set(executables)];
      }
    };
    registry = new Registry(require(import_path19.default.join(packageRoot, "browsers.json")));
  }
});

// packages/playwright-core/src/server/launchApp.ts
async function launchApp(browserType, options) {
  const args = [...options.persistentContextOptions?.args ?? []];
  let channel = options.persistentContextOptions?.channel;
  if (browserType.name() === "chromium") {
    args.push(
      "--app=data:text/html,",
      `--window-size=${options.windowSize.width},${options.windowSize.height}`,
      ...options.windowPosition ? [`--window-position=${options.windowPosition.x},${options.windowPosition.y}`] : [],
      "--test-type="
    );
    if (!channel && !options.persistentContextOptions?.executablePath)
      channel = findChromiumChannelBestEffort(options.sdkLanguage);
  }
  const controller = new ProgressController();
  let context2;
  try {
    context2 = await controller.run((progress2) => browserType.launchPersistentContext(progress2, "", {
      ignoreDefaultArgs: ["--enable-automation"],
      ...options?.persistentContextOptions,
      channel,
      noDefaultViewport: options.persistentContextOptions?.noDefaultViewport ?? true,
      acceptDownloads: options?.persistentContextOptions?.acceptDownloads ?? (isUnderTest() ? "accept" : "internal-browser-default"),
      colorScheme: options?.persistentContextOptions?.colorScheme ?? "no-override",
      args
    }), 0);
  } catch (error) {
    if (channel) {
      error = rewriteErrorMessage(error, [
        `Failed to launch "${channel}" channel.`,
        "Using custom channels could lead to unexpected behavior due to Enterprise policies (chrome://policy).",
        "Install the default browser instead:",
        wrapInASCIIBox(`${buildPlaywrightCLICommand(options.sdkLanguage, "install")}`, 2)
      ].join("\n"));
    }
    throw error;
  }
  const [page] = context2.pages();
  if (browserType.name() === "chromium" && process.platform === "darwin") {
    context2.on("page", async (newPage) => {
      if (newPage.mainFrame().url() === "chrome://new-tab-page/") {
        await page.bringToFront(nullProgress);
        await newPage.close(nullProgress);
      }
    });
  }
  if (browserType.name() === "chromium")
    await installAppIcon(page);
  return { context: context2, page };
}
async function installAppIcon(page) {
  const icon = await import_fs20.default.promises.readFile(libPath("server", "chromium", "appIcon.png"));
  const crPage = page.delegate;
  await crPage._mainFrameSession._client.send("Browser.setDockTile", {
    image: icon.toString("base64")
  });
}
async function syncLocalStorageWithSettings(page, appName) {
  if (isUnderTest())
    return;
  const settingsFile = import_path20.default.join(registryDirectory, ".settings", `${appName}.json`);
  const controller = new ProgressController();
  await controller.run(async (progress2) => {
    await page.exposeBinding(progress2, "_saveSerializedSettings", (_, settings2) => {
      import_fs20.default.mkdirSync(import_path20.default.dirname(settingsFile), { recursive: true });
      import_fs20.default.writeFileSync(settingsFile, settings2);
    });
    const settings = await progress2.race(import_fs20.default.promises.readFile(settingsFile, "utf-8").catch(() => "{}"));
    await page.addInitScript(
      progress2,
      `(${String((settings2) => {
        if (location && location.protocol === "data:")
          return;
        if (window.top !== window)
          return;
        Object.entries(settings2).map(([k, v]) => localStorage[k] = v);
        window.saveSettings = () => {
          window._saveSerializedSettings(JSON.stringify({ ...localStorage }));
        };
      })})(${settings});
    `
    );
  });
}
var import_fs20, import_path20;
var init_launchApp = __esm({
  "packages/playwright-core/src/server/launchApp.ts"() {
    "use strict";
    import_fs20 = __toESM(require("fs"));
    import_path20 = __toESM(require("path"));
    init_debug();
    init_stackTrace();
    init_ascii();
    init_package();
    init_registry();
    init_registry();
    init_progress();
  }
});

// packages/playwright-core/src/server/recorder/throttledFile.ts
var import_fs21, ThrottledFile;
var init_throttledFile = __esm({
  "packages/playwright-core/src/server/recorder/throttledFile.ts"() {
    "use strict";
    import_fs21 = __toESM(require("fs"));
    ThrottledFile = class {
      constructor(file) {
        this._file = file;
      }
      setContent(text2) {
        this._text = text2;
        if (!this._timer)
          this._timer = setTimeout(() => this.flush(), 250);
      }
      flush() {
        if (this._timer) {
          clearTimeout(this._timer);
          this._timer = void 0;
        }
        if (this._text)
          import_fs21.default.writeFileSync(this._file, this._text);
        this._text = void 0;
      }
    };
  }
});

// packages/playwright-core/src/server/codegen/language.ts
function generateCode(actions, languageGenerator, options) {
  const header = languageGenerator.generateHeader(options);
  const footer = languageGenerator.generateFooter(options.saveStorage);
  const actionTexts = actions.map((a) => generateActionText(languageGenerator, a, !!options.generateAutoExpect)).filter(Boolean);
  const text2 = [header, ...actionTexts, footer].join("\n");
  return { header, footer, actionTexts, text: text2 };
}
function generateActionText(generator, action, generateAutoExpect) {
  let text2 = generator.generateAction(action);
  if (!text2)
    return;
  if (generateAutoExpect && action.action.preconditionSelector) {
    const expectAction = {
      frame: action.frame,
      startTime: action.startTime,
      endTime: action.startTime,
      action: {
        name: "assertVisible",
        selector: action.action.preconditionSelector,
        signals: []
      }
    };
    const expectText = generator.generateAction(expectAction);
    if (expectText)
      text2 = expectText + "\n\n" + text2;
  }
  return text2;
}
function sanitizeDeviceOptions(device, options) {
  const cleanedOptions = {};
  for (const property in options) {
    if (JSON.stringify(device[property]) !== JSON.stringify(options[property]))
      cleanedOptions[property] = options[property];
  }
  return cleanedOptions;
}
function toSignalMap(action) {
  let popup;
  let download;
  let dialog;
  for (const signal of action.signals) {
    if (signal.name === "popup")
      popup = signal;
    else if (signal.name === "download")
      download = signal;
    else if (signal.name === "dialog")
      dialog = signal;
  }
  return {
    popup,
    download,
    dialog
  };
}
function toKeyboardModifiers(modifiers) {
  const result2 = [];
  if (modifiers & 1)
    result2.push("Alt");
  if (modifiers & 2)
    result2.push("ControlOrMeta");
  if (modifiers & 4)
    result2.push("ControlOrMeta");
  if (modifiers & 8)
    result2.push("Shift");
  return result2;
}
function toClickOptionsForSourceCode(action) {
  const modifiers = toKeyboardModifiers(action.modifiers);
  const options = {};
  if (action.button !== "left")
    options.button = action.button;
  if (modifiers.length)
    options.modifiers = modifiers;
  if (action.clickCount > 2)
    options.clickCount = action.clickCount;
  if (action.position)
    options.position = action.position;
  return options;
}
var init_language = __esm({
  "packages/playwright-core/src/server/codegen/language.ts"() {
    "use strict";
  }
});

// packages/playwright-core/src/server/deviceDescriptorsSource.json
var deviceDescriptorsSource_default;
var init_deviceDescriptorsSource = __esm({
  "packages/playwright-core/src/server/deviceDescriptorsSource.json"() {
    deviceDescriptorsSource_default = {
      "Blackberry PlayBook": {
        userAgent: "Mozilla/5.0 (PlayBook; U; RIM Tablet OS 2.1.0; en-US) AppleWebKit/536.2+ (KHTML like Gecko) Version/26.5 Safari/536.2+",
        viewport: {
          width: 600,
          height: 1024
        },
        deviceScaleFactor: 1,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "webkit"
      },
      "Blackberry PlayBook landscape": {
        userAgent: "Mozilla/5.0 (PlayBook; U; RIM Tablet OS 2.1.0; en-US) AppleWebKit/536.2+ (KHTML like Gecko) Version/26.5 Safari/536.2+",
        viewport: {
          width: 1024,
          height: 600
        },
        deviceScaleFactor: 1,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "webkit"
      },
      "BlackBerry Z30": {
        userAgent: "Mozilla/5.0 (BB10; Touch) AppleWebKit/537.10+ (KHTML, like Gecko) Version/26.5 Mobile Safari/537.10+",
        viewport: {
          width: 360,
          height: 640
        },
        deviceScaleFactor: 2,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "webkit"
      },
      "BlackBerry Z30 landscape": {
        userAgent: "Mozilla/5.0 (BB10; Touch) AppleWebKit/537.10+ (KHTML, like Gecko) Version/26.5 Mobile Safari/537.10+",
        viewport: {
          width: 640,
          height: 360
        },
        deviceScaleFactor: 2,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "webkit"
      },
      "Galaxy Note 3": {
        userAgent: "Mozilla/5.0 (Linux; U; Android 4.3; en-us; SM-N900T Build/JSS15J) AppleWebKit/534.30 (KHTML, like Gecko) Version/26.5 Mobile Safari/534.30",
        viewport: {
          width: 360,
          height: 640
        },
        deviceScaleFactor: 3,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "webkit"
      },
      "Galaxy Note 3 landscape": {
        userAgent: "Mozilla/5.0 (Linux; U; Android 4.3; en-us; SM-N900T Build/JSS15J) AppleWebKit/534.30 (KHTML, like Gecko) Version/26.5 Mobile Safari/534.30",
        viewport: {
          width: 640,
          height: 360
        },
        deviceScaleFactor: 3,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "webkit"
      },
      "Galaxy Note II": {
        userAgent: "Mozilla/5.0 (Linux; U; Android 4.1; en-us; GT-N7100 Build/JRO03C) AppleWebKit/534.30 (KHTML, like Gecko) Version/26.5 Mobile Safari/534.30",
        viewport: {
          width: 360,
          height: 640
        },
        deviceScaleFactor: 2,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "webkit"
      },
      "Galaxy Note II landscape": {
        userAgent: "Mozilla/5.0 (Linux; U; Android 4.1; en-us; GT-N7100 Build/JRO03C) AppleWebKit/534.30 (KHTML, like Gecko) Version/26.5 Mobile Safari/534.30",
        viewport: {
          width: 640,
          height: 360
        },
        deviceScaleFactor: 2,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "webkit"
      },
      "Galaxy S III": {
        userAgent: "Mozilla/5.0 (Linux; U; Android 4.0; en-us; GT-I9300 Build/IMM76D) AppleWebKit/534.30 (KHTML, like Gecko) Version/26.5 Mobile Safari/534.30",
        viewport: {
          width: 360,
          height: 640
        },
        deviceScaleFactor: 2,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "webkit"
      },
      "Galaxy S III landscape": {
        userAgent: "Mozilla/5.0 (Linux; U; Android 4.0; en-us; GT-I9300 Build/IMM76D) AppleWebKit/534.30 (KHTML, like Gecko) Version/26.5 Mobile Safari/534.30",
        viewport: {
          width: 640,
          height: 360
        },
        deviceScaleFactor: 2,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "webkit"
      },
      "Galaxy S5": {
        userAgent: "Mozilla/5.0 (Linux; Android 5.0; SM-G900P Build/LRX21T) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
        viewport: {
          width: 360,
          height: 640
        },
        deviceScaleFactor: 3,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "chromium"
      },
      "Galaxy S5 landscape": {
        userAgent: "Mozilla/5.0 (Linux; Android 5.0; SM-G900P Build/LRX21T) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
        viewport: {
          width: 640,
          height: 360
        },
        deviceScaleFactor: 3,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "chromium"
      },
      "Galaxy S8": {
        userAgent: "Mozilla/5.0 (Linux; Android 7.0; SM-G950U Build/NRD90M) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
        viewport: {
          width: 360,
          height: 740
        },
        deviceScaleFactor: 3,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "chromium"
      },
      "Galaxy S8 landscape": {
        userAgent: "Mozilla/5.0 (Linux; Android 7.0; SM-G950U Build/NRD90M) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
        viewport: {
          width: 740,
          height: 360
        },
        deviceScaleFactor: 3,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "chromium"
      },
      "Galaxy S9+": {
        userAgent: "Mozilla/5.0 (Linux; Android 8.0.0; SM-G965U Build/R16NW) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
        viewport: {
          width: 320,
          height: 658
        },
        deviceScaleFactor: 4.5,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "chromium"
      },
      "Galaxy S9+ landscape": {
        userAgent: "Mozilla/5.0 (Linux; Android 8.0.0; SM-G965U Build/R16NW) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
        viewport: {
          width: 658,
          height: 320
        },
        deviceScaleFactor: 4.5,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "chromium"
      },
      "Galaxy S24": {
        userAgent: "Mozilla/5.0 (Linux; Android 14; SM-S921U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
        viewport: {
          width: 360,
          height: 780
        },
        deviceScaleFactor: 3,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "chromium"
      },
      "Galaxy S24 landscape": {
        userAgent: "Mozilla/5.0 (Linux; Android 14; SM-S921U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
        viewport: {
          width: 780,
          height: 360
        },
        deviceScaleFactor: 3,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "chromium"
      },
      "Galaxy A55": {
        userAgent: "Mozilla/5.0 (Linux; Android 14; SM-A556B) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
        viewport: {
          width: 480,
          height: 1040
        },
        deviceScaleFactor: 2.25,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "chromium"
      },
      "Galaxy A55 landscape": {
        userAgent: "Mozilla/5.0 (Linux; Android 14; SM-A556B) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
        viewport: {
          width: 1040,
          height: 480
        },
        deviceScaleFactor: 2.25,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "chromium"
      },
      "Galaxy Tab S4": {
        userAgent: "Mozilla/5.0 (Linux; Android 8.1.0; SM-T837A) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Safari/537.36",
        viewport: {
          width: 712,
          height: 1138
        },
        deviceScaleFactor: 2.25,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "chromium"
      },
      "Galaxy Tab S4 landscape": {
        userAgent: "Mozilla/5.0 (Linux; Android 8.1.0; SM-T837A) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Safari/537.36",
        viewport: {
          width: 1138,
          height: 712
        },
        deviceScaleFactor: 2.25,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "chromium"
      },
      "Galaxy Tab S9": {
        userAgent: "Mozilla/5.0 (Linux; Android 14; SM-X710) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Safari/537.36",
        viewport: {
          width: 640,
          height: 1024
        },
        deviceScaleFactor: 2.5,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "chromium"
      },
      "Galaxy Tab S9 landscape": {
        userAgent: "Mozilla/5.0 (Linux; Android 14; SM-X710) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Safari/537.36",
        viewport: {
          width: 1024,
          height: 640
        },
        deviceScaleFactor: 2.5,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "chromium"
      },
      "Galaxy Z Fold 6": {
        userAgent: "Mozilla/5.0 (Linux; Android 10; SM-F956U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
        screen: {
          width: 928,
          height: 1080
        },
        viewport: {
          width: 928,
          height: 1004
        },
        deviceScaleFactor: 2,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "chromium"
      },
      "Galaxy Z Fold 6 landscape": {
        userAgent: "Mozilla/5.0 (Linux; Android 10; SM-F956U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
        screen: {
          width: 1080,
          height: 928
        },
        viewport: {
          width: 1028,
          height: 876
        },
        deviceScaleFactor: 2,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "chromium"
      },
      "Galaxy Z Fold 6 Cover": {
        userAgent: "Mozilla/5.0 (Linux; Android 10; SM-F956U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
        screen: {
          width: 484,
          height: 1188
        },
        viewport: {
          width: 484,
          height: 1112
        },
        deviceScaleFactor: 2,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "chromium"
      },
      "Galaxy Z Fold 6 Cover landscape": {
        userAgent: "Mozilla/5.0 (Linux; Android 10; SM-F956U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
        screen: {
          width: 1188,
          height: 484
        },
        viewport: {
          width: 1136,
          height: 432
        },
        deviceScaleFactor: 2,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "chromium"
      },
      "Galaxy Z Fold 7": {
        userAgent: "Mozilla/5.0 (Linux; Android 10; SM-F966U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
        screen: {
          width: 984,
          height: 1092
        },
        viewport: {
          width: 984,
          height: 1016
        },
        deviceScaleFactor: 2,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "chromium"
      },
      "Galaxy Z Fold 7 landscape": {
        userAgent: "Mozilla/5.0 (Linux; Android 10; SM-F966U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
        screen: {
          width: 1092,
          height: 984
        },
        viewport: {
          width: 1040,
          height: 932
        },
        deviceScaleFactor: 2,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "chromium"
      },
      "Galaxy Z Fold 7 Cover": {
        userAgent: "Mozilla/5.0 (Linux; Android 10; SM-F966U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
        screen: {
          width: 360,
          height: 840
        },
        viewport: {
          width: 360,
          height: 764
        },
        deviceScaleFactor: 3,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "chromium"
      },
      "Galaxy Z Fold 7 Cover landscape": {
        userAgent: "Mozilla/5.0 (Linux; Android 10; SM-F966U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
        screen: {
          width: 840,
          height: 360
        },
        viewport: {
          width: 788,
          height: 308
        },
        deviceScaleFactor: 3,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "chromium"
      },
      "Galaxy Z Flip 6": {
        userAgent: "Mozilla/5.0 (Linux; Android 10; SM-F741U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
        screen: {
          width: 360,
          height: 880
        },
        viewport: {
          width: 360,
          height: 804
        },
        deviceScaleFactor: 3,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "chromium"
      },
      "Galaxy Z Flip 6 landscape": {
        userAgent: "Mozilla/5.0 (Linux; Android 10; SM-F741U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
        screen: {
          width: 880,
          height: 360
        },
        viewport: {
          width: 828,
          height: 308
        },
        deviceScaleFactor: 3,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "chromium"
      },
      "Galaxy Z Flip 6 Cover": {
        userAgent: "Mozilla/5.0 (Linux; Android 10; SM-F741U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
        screen: {
          width: 360,
          height: 374
        },
        viewport: {
          width: 360,
          height: 298
        },
        deviceScaleFactor: 2,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "chromium"
      },
      "Galaxy Z Flip 6 Cover landscape": {
        userAgent: "Mozilla/5.0 (Linux; Android 10; SM-F741U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
        screen: {
          width: 374,
          height: 360
        },
        viewport: {
          width: 322,
          height: 308
        },
        deviceScaleFactor: 2,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "chromium"
      },
      "Galaxy Z Flip 7": {
        userAgent: "Mozilla/5.0 (Linux; Android 10; SM-F761U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
        screen: {
          width: 360,
          height: 840
        },
        viewport: {
          width: 360,
          height: 764
        },
        deviceScaleFactor: 3,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "chromium"
      },
      "Galaxy Z Flip 7 landscape": {
        userAgent: "Mozilla/5.0 (Linux; Android 10; SM-F761U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
        screen: {
          width: 840,
          height: 360
        },
        viewport: {
          width: 788,
          height: 308
        },
        deviceScaleFactor: 3,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "chromium"
      },
      "Galaxy Z Flip 7 Cover": {
        userAgent: "Mozilla/5.0 (Linux; Android 10; SM-F761U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
        screen: {
          width: 474,
          height: 524
        },
        viewport: {
          width: 474,
          height: 448
        },
        deviceScaleFactor: 2,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "chromium"
      },
      "Galaxy Z Flip 7 Cover landscape": {
        userAgent: "Mozilla/5.0 (Linux; Android 10; SM-F761U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
        screen: {
          width: 524,
          height: 474
        },
        viewport: {
          width: 472,
          height: 422
        },
        deviceScaleFactor: 2,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "chromium"
      },
      "iPad (gen 5)": {
        userAgent: "Mozilla/5.0 (iPad; CPU OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
        viewport: {
          width: 768,
          height: 1024
        },
        deviceScaleFactor: 2,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "webkit"
      },
      "iPad (gen 5) landscape": {
        userAgent: "Mozilla/5.0 (iPad; CPU OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
        viewport: {
          width: 1024,
          height: 768
        },
        deviceScaleFactor: 2,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "webkit"
      },
      "iPad (gen 6)": {
        userAgent: "Mozilla/5.0 (iPad; CPU OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
        viewport: {
          width: 768,
          height: 1024
        },
        deviceScaleFactor: 2,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "webkit"
      },
      "iPad (gen 6) landscape": {
        userAgent: "Mozilla/5.0 (iPad; CPU OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
        viewport: {
          width: 1024,
          height: 768
        },
        deviceScaleFactor: 2,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "webkit"
      },
      "iPad (gen 7)": {
        userAgent: "Mozilla/5.0 (iPad; CPU OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
        viewport: {
          width: 810,
          height: 1080
        },
        deviceScaleFactor: 2,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "webkit"
      },
      "iPad (gen 7) landscape": {
        userAgent: "Mozilla/5.0 (iPad; CPU OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
        viewport: {
          width: 1080,
          height: 810
        },
        deviceScaleFactor: 2,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "webkit"
      },
      "iPad (gen 11)": {
        userAgent: "Mozilla/5.0 (iPad; CPU OS 18_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/19E241 Safari/604.1",
        viewport: {
          width: 656,
          height: 944
        },
        deviceScaleFactor: 2.5,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "webkit"
      },
      "iPad (gen 11) landscape": {
        userAgent: "Mozilla/5.0 (iPad; CPU OS 18_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/19E241 Safari/604.1",
        viewport: {
          width: 944,
          height: 656
        },
        deviceScaleFactor: 2.5,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "webkit"
      },
      "iPad Mini": {
        userAgent: "Mozilla/5.0 (iPad; CPU OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
        viewport: {
          width: 768,
          height: 1024
        },
        deviceScaleFactor: 2,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "webkit"
      },
      "iPad Mini landscape": {
        userAgent: "Mozilla/5.0 (iPad; CPU OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
        viewport: {
          width: 1024,
          height: 768
        },
        deviceScaleFactor: 2,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "webkit"
      },
      "iPad Pro 11": {
        userAgent: "Mozilla/5.0 (iPad; CPU OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
        viewport: {
          width: 834,
          height: 1194
        },
        deviceScaleFactor: 2,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "webkit"
      },
      "iPad Pro 11 landscape": {
        userAgent: "Mozilla/5.0 (iPad; CPU OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
        viewport: {
          width: 1194,
          height: 834
        },
        deviceScaleFactor: 2,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "webkit"
      },
      "iPhone 6": {
        userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/26.5 Mobile/15A372 Safari/604.1",
        viewport: {
          width: 375,
          height: 667
        },
        deviceScaleFactor: 2,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "webkit"
      },
      "iPhone 6 landscape": {
        userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/26.5 Mobile/15A372 Safari/604.1",
        viewport: {
          width: 667,
          height: 375
        },
        deviceScaleFactor: 2,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "webkit"
      },
      "iPhone 6 Plus": {
        userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/26.5 Mobile/15A372 Safari/604.1",
        viewport: {
          width: 414,
          height: 736
        },
        deviceScaleFactor: 3,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "webkit"
      },
      "iPhone 6 Plus landscape": {
        userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/26.5 Mobile/15A372 Safari/604.1",
        viewport: {
          width: 736,
          height: 414
        },
        deviceScaleFactor: 3,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "webkit"
      },
      "iPhone 7": {
        userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/26.5 Mobile/15A372 Safari/604.1",
        viewport: {
          width: 375,
          height: 667
        },
        deviceScaleFactor: 2,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "webkit"
      },
      "iPhone 7 landscape": {
        userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/26.5 Mobile/15A372 Safari/604.1",
        viewport: {
          width: 667,
          height: 375
        },
        deviceScaleFactor: 2,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "webkit"
      },
      "iPhone 7 Plus": {
        userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/26.5 Mobile/15A372 Safari/604.1",
        viewport: {
          width: 414,
          height: 736
        },
        deviceScaleFactor: 3,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "webkit"
      },
      "iPhone 7 Plus landscape": {
        userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/26.5 Mobile/15A372 Safari/604.1",
        viewport: {
          width: 736,
          height: 414
        },
        deviceScaleFactor: 3,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "webkit"
      },
      "iPhone 8": {
        userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/26.5 Mobile/15A372 Safari/604.1",
        viewport: {
          width: 375,
          height: 667
        },
        deviceScaleFactor: 2,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "webkit"
      },
      "iPhone 8 landscape": {
        userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/26.5 Mobile/15A372 Safari/604.1",
        viewport: {
          width: 667,
          height: 375
        },
        deviceScaleFactor: 2,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "webkit"
      },
      "iPhone 8 Plus": {
        userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/26.5 Mobile/15A372 Safari/604.1",
        viewport: {
          width: 414,
          height: 736
        },
        deviceScaleFactor: 3,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "webkit"
      },
      "iPhone 8 Plus landscape": {
        userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/26.5 Mobile/15A372 Safari/604.1",
        viewport: {
          width: 736,
          height: 414
        },
        deviceScaleFactor: 3,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "webkit"
      },
      "iPhone SE": {
        userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 10_3_1 like Mac OS X) AppleWebKit/603.1.30 (KHTML, like Gecko) Version/26.5 Mobile/14E304 Safari/602.1",
        viewport: {
          width: 320,
          height: 568
        },
        deviceScaleFactor: 2,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "webkit"
      },
      "iPhone SE landscape": {
        userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 10_3_1 like Mac OS X) AppleWebKit/603.1.30 (KHTML, like Gecko) Version/26.5 Mobile/14E304 Safari/602.1",
        viewport: {
          width: 568,
          height: 320
        },
        deviceScaleFactor: 2,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "webkit"
      },
      "iPhone SE (3rd gen)": {
        userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 18_5 like Mac OS X) AppleWebKit/603.1.30 (KHTML, like Gecko) Version/26.5 Mobile/19E241 Safari/602.1",
        viewport: {
          width: 375,
          height: 667
        },
        deviceScaleFactor: 2,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "webkit"
      },
      "iPhone SE (3rd gen) landscape": {
        userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 18_5 like Mac OS X) AppleWebKit/603.1.30 (KHTML, like Gecko) Version/26.5 Mobile/19E241 Safari/602.1",
        viewport: {
          width: 667,
          height: 375
        },
        deviceScaleFactor: 2,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "webkit"
      },
      "iPhone X": {
        userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/26.5 Mobile/15A372 Safari/604.1",
        viewport: {
          width: 375,
          height: 812
        },
        deviceScaleFactor: 3,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "webkit"
      },
      "iPhone X landscape": {
        userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/26.5 Mobile/15A372 Safari/604.1",
        viewport: {
          width: 812,
          height: 375
        },
        deviceScaleFactor: 3,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "webkit"
      },
      "iPhone XR": {
        userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 12_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
        viewport: {
          width: 414,
          height: 896
        },
        deviceScaleFactor: 3,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "webkit"
      },
      "iPhone XR landscape": {
        userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 12_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
        viewport: {
          width: 896,
          height: 414
        },
        deviceScaleFactor: 3,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "webkit"
      },
      "iPhone 11": {
        userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
        screen: {
          width: 414,
          height: 896
        },
        viewport: {
          width: 414,
          height: 715
        },
        deviceScaleFactor: 2,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "webkit"
      },
      "iPhone 11 landscape": {
        userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
        screen: {
          width: 414,
          height: 896
        },
        viewport: {
          width: 800,
          height: 364
        },
        deviceScaleFactor: 2,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "webkit"
      },
      "iPhone 11 Pro": {
        userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
        screen: {
          width: 375,
          height: 812
        },
        viewport: {
          width: 375,
          height: 635
        },
        deviceScaleFactor: 3,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "webkit"
      },
      "iPhone 11 Pro landscape": {
        userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
        screen: {
          width: 375,
          height: 812
        },
        viewport: {
          width: 724,
          height: 325
        },
        deviceScaleFactor: 3,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "webkit"
      },
      "iPhone 11 Pro Max": {
        userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
        screen: {
          width: 414,
          height: 896
        },
        viewport: {
          width: 414,
          height: 715
        },
        deviceScaleFactor: 3,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "webkit"
      },
      "iPhone 11 Pro Max landscape": {
        userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
        screen: {
          width: 414,
          height: 896
        },
        viewport: {
          width: 808,
          height: 364
        },
        deviceScaleFactor: 3,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "webkit"
      },
      "iPhone 12": {
        userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
        screen: {
          width: 390,
          height: 844
        },
        viewport: {
          width: 390,
          height: 664
        },
        deviceScaleFactor: 3,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "webkit"
      },
      "iPhone 12 landscape": {
        userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
        screen: {
          width: 390,
          height: 844
        },
        viewport: {
          width: 750,
          height: 340
        },
        deviceScaleFactor: 3,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "webkit"
      },
      "iPhone 12 Pro": {
        userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
        screen: {
          width: 390,
          height: 844
        },
        viewport: {
          width: 390,
          height: 664
        },
        deviceScaleFactor: 3,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "webkit"
      },
      "iPhone 12 Pro landscape": {
        userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
        screen: {
          width: 390,
          height: 844
        },
        viewport: {
          width: 750,
          height: 340
        },
        deviceScaleFactor: 3,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "webkit"
      },
      "iPhone 12 Pro Max": {
        userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
        screen: {
          width: 428,
          height: 926
        },
        viewport: {
          width: 428,
          height: 746
        },
        deviceScaleFactor: 3,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "webkit"
      },
      "iPhone 12 Pro Max landscape": {
        userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
        screen: {
          width: 428,
          height: 926
        },
        viewport: {
          width: 832,
          height: 378
        },
        deviceScaleFactor: 3,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "webkit"
      },
      "iPhone 12 Mini": {
        userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
        screen: {
          width: 375,
          height: 812
        },
        viewport: {
          width: 375,
          height: 629
        },
        deviceScaleFactor: 3,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "webkit"
      },
      "iPhone 12 Mini landscape": {
        userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
        screen: {
          width: 375,
          height: 812
        },
        viewport: {
          width: 712,
          height: 325
        },
        deviceScaleFactor: 3,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "webkit"
      },
      "iPhone 13": {
        userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 15_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
        screen: {
          width: 390,
          height: 844
        },
        viewport: {
          width: 390,
          height: 664
        },
        deviceScaleFactor: 3,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "webkit"
      },
      "iPhone 13 landscape": {
        userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 15_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
        screen: {
          width: 390,
          height: 844
        },
        viewport: {
          width: 750,
          height: 342
        },
        deviceScaleFactor: 3,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "webkit"
      },
      "iPhone 13 Pro": {
        userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 15_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
        screen: {
          width: 390,
          height: 844
        },
        viewport: {
          width: 390,
          height: 664
        },
        deviceScaleFactor: 3,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "webkit"
      },
      "iPhone 13 Pro landscape": {
        userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 15_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
        screen: {
          width: 390,
          height: 844
        },
        viewport: {
          width: 750,
          height: 342
        },
        deviceScaleFactor: 3,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "webkit"
      },
      "iPhone 13 Pro Max": {
        userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 15_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
        screen: {
          width: 428,
          height: 926
        },
        viewport: {
          width: 428,
          height: 746
        },
        deviceScaleFactor: 3,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "webkit"
      },
      "iPhone 13 Pro Max landscape": {
        userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 15_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
        screen: {
          width: 428,
          height: 926
        },
        viewport: {
          width: 832,
          height: 380
        },
        deviceScaleFactor: 3,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "webkit"
      },
      "iPhone 13 Mini": {
        userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 15_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
        screen: {
          width: 375,
          height: 812
        },
        viewport: {
          width: 375,
          height: 629
        },
        deviceScaleFactor: 3,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "webkit"
      },
      "iPhone 13 Mini landscape": {
        userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 15_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
        screen: {
          width: 375,
          height: 812
        },
        viewport: {
          width: 712,
          height: 327
        },
        deviceScaleFactor: 3,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "webkit"
      },
      "iPhone 14": {
        userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 16_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
        screen: {
          width: 390,
          height: 844
        },
        viewport: {
          width: 390,
          height: 664
        },
        deviceScaleFactor: 3,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "webkit"
      },
      "iPhone 14 landscape": {
        userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 16_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
        screen: {
          width: 390,
          height: 844
        },
        viewport: {
          width: 750,
          height: 340
        },
        deviceScaleFactor: 3,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "webkit"
      },
      "iPhone 14 Plus": {
        userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 16_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
        screen: {
          width: 428,
          height: 926
        },
        viewport: {
          width: 428,
          height: 746
        },
        deviceScaleFactor: 3,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "webkit"
      },
      "iPhone 14 Plus landscape": {
        userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 16_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
        screen: {
          width: 428,
          height: 926
        },
        viewport: {
          width: 832,
          height: 378
        },
        deviceScaleFactor: 3,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "webkit"
      },
      "iPhone 14 Pro": {
        userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 16_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
        screen: {
          width: 393,
          height: 852
        },
        viewport: {
          width: 393,
          height: 660
        },
        deviceScaleFactor: 3,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "webkit"
      },
      "iPhone 14 Pro landscape": {
        userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 16_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
        screen: {
          width: 393,
          height: 852
        },
        viewport: {
          width: 734,
          height: 343
        },
        deviceScaleFactor: 3,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "webkit"
      },
      "iPhone 14 Pro Max": {
        userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 16_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
        screen: {
          width: 430,
          height: 932
        },
        viewport: {
          width: 430,
          height: 740
        },
        deviceScaleFactor: 3,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "webkit"
      },
      "iPhone 14 Pro Max landscape": {
        userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 16_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
        screen: {
          width: 430,
          height: 932
        },
        viewport: {
          width: 814,
          height: 380
        },
        deviceScaleFactor: 3,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "webkit"
      },
      "iPhone 15": {
        userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 17_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
        screen: {
          width: 393,
          height: 852
        },
        viewport: {
          width: 393,
          height: 659
        },
        deviceScaleFactor: 3,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "webkit"
      },
      "iPhone 15 landscape": {
        userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 17_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
        screen: {
          width: 393,
          height: 852
        },
        viewport: {
          width: 734,
          height: 343
        },
        deviceScaleFactor: 3,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "webkit"
      },
      "iPhone 15 Plus": {
        userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 17_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
        screen: {
          width: 430,
          height: 932
        },
        viewport: {
          width: 430,
          height: 739
        },
        deviceScaleFactor: 3,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "webkit"
      },
      "iPhone 15 Plus landscape": {
        userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 17_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
        screen: {
          width: 430,
          height: 932
        },
        viewport: {
          width: 814,
          height: 380
        },
        deviceScaleFactor: 3,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "webkit"
      },
      "iPhone 15 Pro": {
        userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 17_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
        screen: {
          width: 393,
          height: 852
        },
        viewport: {
          width: 393,
          height: 659
        },
        deviceScaleFactor: 3,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "webkit"
      },
      "iPhone 15 Pro landscape": {
        userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 17_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
        screen: {
          width: 393,
          height: 852
        },
        viewport: {
          width: 734,
          height: 343
        },
        deviceScaleFactor: 3,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "webkit"
      },
      "iPhone 15 Pro Max": {
        userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 17_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
        screen: {
          width: 430,
          height: 932
        },
        viewport: {
          width: 430,
          height: 739
        },
        deviceScaleFactor: 3,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "webkit"
      },
      "iPhone 15 Pro Max landscape": {
        userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 17_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
        screen: {
          width: 430,
          height: 932
        },
        viewport: {
          width: 814,
          height: 380
        },
        deviceScaleFactor: 3,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "webkit"
      },
      "iPhone 16": {
        userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
        screen: {
          width: 393,
          height: 852
        },
        viewport: {
          width: 393,
          height: 659
        },
        deviceScaleFactor: 3,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "webkit"
      },
      "iPhone 16 landscape": {
        userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
        screen: {
          width: 393,
          height: 852
        },
        viewport: {
          width: 734,
          height: 343
        },
        deviceScaleFactor: 3,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "webkit"
      },
      "iPhone 16 Plus": {
        userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
        screen: {
          width: 430,
          height: 932
        },
        viewport: {
          width: 430,
          height: 739
        },
        deviceScaleFactor: 3,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "webkit"
      },
      "iPhone 16 Plus landscape": {
        userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
        screen: {
          width: 430,
          height: 932
        },
        viewport: {
          width: 814,
          height: 380
        },
        deviceScaleFactor: 3,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "webkit"
      },
      "iPhone 16 Pro": {
        userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
        screen: {
          width: 402,
          height: 874
        },
        viewport: {
          width: 402,
          height: 681
        },
        deviceScaleFactor: 3,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "webkit"
      },
      "iPhone 16 Pro landscape": {
        userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
        screen: {
          width: 402,
          height: 874
        },
        viewport: {
          width: 756,
          height: 352
        },
        deviceScaleFactor: 3,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "webkit"
      },
      "iPhone 16 Pro Max": {
        userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
        screen: {
          width: 440,
          height: 956
        },
        viewport: {
          width: 440,
          height: 763
        },
        deviceScaleFactor: 3,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "webkit"
      },
      "iPhone 16 Pro Max landscape": {
        userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
        screen: {
          width: 440,
          height: 956
        },
        viewport: {
          width: 838,
          height: 390
        },
        deviceScaleFactor: 3,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "webkit"
      },
      "iPhone 16e": {
        userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
        screen: {
          width: 390,
          height: 844
        },
        viewport: {
          width: 390,
          height: 651
        },
        deviceScaleFactor: 3,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "webkit"
      },
      "iPhone 16e landscape": {
        userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
        screen: {
          width: 390,
          height: 844
        },
        viewport: {
          width: 726,
          height: 340
        },
        deviceScaleFactor: 3,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "webkit"
      },
      "iPhone 17": {
        userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
        screen: {
          width: 402,
          height: 874
        },
        viewport: {
          width: 402,
          height: 681
        },
        deviceScaleFactor: 3,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "webkit"
      },
      "iPhone 17 landscape": {
        userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
        screen: {
          width: 402,
          height: 874
        },
        viewport: {
          width: 756,
          height: 352
        },
        deviceScaleFactor: 3,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "webkit"
      },
      "iPhone Air": {
        userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
        screen: {
          width: 420,
          height: 912
        },
        viewport: {
          width: 420,
          height: 719
        },
        deviceScaleFactor: 3,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "webkit"
      },
      "iPhone Air landscape": {
        userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
        screen: {
          width: 420,
          height: 912
        },
        viewport: {
          width: 794,
          height: 370
        },
        deviceScaleFactor: 3,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "webkit"
      },
      "iPhone 17 Pro": {
        userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
        screen: {
          width: 402,
          height: 874
        },
        viewport: {
          width: 402,
          height: 681
        },
        deviceScaleFactor: 3,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "webkit"
      },
      "iPhone 17 Pro landscape": {
        userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
        screen: {
          width: 402,
          height: 874
        },
        viewport: {
          width: 756,
          height: 352
        },
        deviceScaleFactor: 3,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "webkit"
      },
      "iPhone 17 Pro Max": {
        userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
        screen: {
          width: 440,
          height: 956
        },
        viewport: {
          width: 440,
          height: 763
        },
        deviceScaleFactor: 3,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "webkit"
      },
      "iPhone 17 Pro Max landscape": {
        userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
        screen: {
          width: 440,
          height: 956
        },
        viewport: {
          width: 838,
          height: 390
        },
        deviceScaleFactor: 3,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "webkit"
      },
      "iPhone 17e": {
        userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
        screen: {
          width: 390,
          height: 844
        },
        viewport: {
          width: 390,
          height: 651
        },
        deviceScaleFactor: 3,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "webkit"
      },
      "iPhone 17e landscape": {
        userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
        screen: {
          width: 390,
          height: 844
        },
        viewport: {
          width: 726,
          height: 340
        },
        deviceScaleFactor: 3,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "webkit"
      },
      "Kindle Fire HDX": {
        userAgent: "Mozilla/5.0 (Linux; U; en-us; KFAPWI Build/JDQ39) AppleWebKit/535.19 (KHTML, like Gecko) Silk/3.13 Safari/535.19 Silk-Accelerated=true",
        viewport: {
          width: 800,
          height: 1280
        },
        deviceScaleFactor: 2,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "webkit"
      },
      "Kindle Fire HDX landscape": {
        userAgent: "Mozilla/5.0 (Linux; U; en-us; KFAPWI Build/JDQ39) AppleWebKit/535.19 (KHTML, like Gecko) Silk/3.13 Safari/535.19 Silk-Accelerated=true",
        viewport: {
          width: 1280,
          height: 800
        },
        deviceScaleFactor: 2,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "webkit"
      },
      "LG Optimus L70": {
        userAgent: "Mozilla/5.0 (Linux; U; Android 4.4.2; en-us; LGMS323 Build/KOT49I.MS32310c) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/149.0.7827.55 Mobile Safari/537.36",
        viewport: {
          width: 384,
          height: 640
        },
        deviceScaleFactor: 1.25,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "chromium"
      },
      "LG Optimus L70 landscape": {
        userAgent: "Mozilla/5.0 (Linux; U; Android 4.4.2; en-us; LGMS323 Build/KOT49I.MS32310c) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/149.0.7827.55 Mobile Safari/537.36",
        viewport: {
          width: 640,
          height: 384
        },
        deviceScaleFactor: 1.25,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "chromium"
      },
      "Microsoft Lumia 550": {
        userAgent: "Mozilla/5.0 (Windows Phone 10.0; Android 4.2.1; Microsoft; Lumia 550) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36 Edge/14.14263",
        viewport: {
          width: 360,
          height: 640
        },
        deviceScaleFactor: 2,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "chromium"
      },
      "Microsoft Lumia 550 landscape": {
        userAgent: "Mozilla/5.0 (Windows Phone 10.0; Android 4.2.1; Microsoft; Lumia 550) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36 Edge/14.14263",
        viewport: {
          width: 640,
          height: 360
        },
        deviceScaleFactor: 2,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "chromium"
      },
      "Microsoft Lumia 950": {
        userAgent: "Mozilla/5.0 (Windows Phone 10.0; Android 4.2.1; Microsoft; Lumia 950) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36 Edge/14.14263",
        viewport: {
          width: 360,
          height: 640
        },
        deviceScaleFactor: 4,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "chromium"
      },
      "Microsoft Lumia 950 landscape": {
        userAgent: "Mozilla/5.0 (Windows Phone 10.0; Android 4.2.1; Microsoft; Lumia 950) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36 Edge/14.14263",
        viewport: {
          width: 640,
          height: 360
        },
        deviceScaleFactor: 4,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "chromium"
      },
      "Nexus 10": {
        userAgent: "Mozilla/5.0 (Linux; Android 6.0.1; Nexus 10 Build/MOB31T) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Safari/537.36",
        viewport: {
          width: 800,
          height: 1280
        },
        deviceScaleFactor: 2,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "chromium"
      },
      "Nexus 10 landscape": {
        userAgent: "Mozilla/5.0 (Linux; Android 6.0.1; Nexus 10 Build/MOB31T) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Safari/537.36",
        viewport: {
          width: 1280,
          height: 800
        },
        deviceScaleFactor: 2,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "chromium"
      },
      "Nexus 4": {
        userAgent: "Mozilla/5.0 (Linux; Android 4.4.2; Nexus 4 Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
        viewport: {
          width: 384,
          height: 640
        },
        deviceScaleFactor: 2,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "chromium"
      },
      "Nexus 4 landscape": {
        userAgent: "Mozilla/5.0 (Linux; Android 4.4.2; Nexus 4 Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
        viewport: {
          width: 640,
          height: 384
        },
        deviceScaleFactor: 2,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "chromium"
      },
      "Nexus 5": {
        userAgent: "Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
        viewport: {
          width: 360,
          height: 640
        },
        deviceScaleFactor: 3,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "chromium"
      },
      "Nexus 5 landscape": {
        userAgent: "Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
        viewport: {
          width: 640,
          height: 360
        },
        deviceScaleFactor: 3,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "chromium"
      },
      "Nexus 5X": {
        userAgent: "Mozilla/5.0 (Linux; Android 8.0.0; Nexus 5X Build/OPR4.170623.006) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
        viewport: {
          width: 412,
          height: 732
        },
        deviceScaleFactor: 2.625,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "chromium"
      },
      "Nexus 5X landscape": {
        userAgent: "Mozilla/5.0 (Linux; Android 8.0.0; Nexus 5X Build/OPR4.170623.006) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
        viewport: {
          width: 732,
          height: 412
        },
        deviceScaleFactor: 2.625,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "chromium"
      },
      "Nexus 6": {
        userAgent: "Mozilla/5.0 (Linux; Android 7.1.1; Nexus 6 Build/N6F26U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
        viewport: {
          width: 412,
          height: 732
        },
        deviceScaleFactor: 3.5,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "chromium"
      },
      "Nexus 6 landscape": {
        userAgent: "Mozilla/5.0 (Linux; Android 7.1.1; Nexus 6 Build/N6F26U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
        viewport: {
          width: 732,
          height: 412
        },
        deviceScaleFactor: 3.5,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "chromium"
      },
      "Nexus 6P": {
        userAgent: "Mozilla/5.0 (Linux; Android 8.0.0; Nexus 6P Build/OPP3.170518.006) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
        viewport: {
          width: 412,
          height: 732
        },
        deviceScaleFactor: 3.5,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "chromium"
      },
      "Nexus 6P landscape": {
        userAgent: "Mozilla/5.0 (Linux; Android 8.0.0; Nexus 6P Build/OPP3.170518.006) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
        viewport: {
          width: 732,
          height: 412
        },
        deviceScaleFactor: 3.5,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "chromium"
      },
      "Nexus 7": {
        userAgent: "Mozilla/5.0 (Linux; Android 6.0.1; Nexus 7 Build/MOB30X) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Safari/537.36",
        viewport: {
          width: 600,
          height: 960
        },
        deviceScaleFactor: 2,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "chromium"
      },
      "Nexus 7 landscape": {
        userAgent: "Mozilla/5.0 (Linux; Android 6.0.1; Nexus 7 Build/MOB30X) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Safari/537.36",
        viewport: {
          width: 960,
          height: 600
        },
        deviceScaleFactor: 2,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "chromium"
      },
      "Nokia Lumia 520": {
        userAgent: "Mozilla/5.0 (compatible; MSIE 10.0; Windows Phone 8.0; Trident/6.0; IEMobile/10.0; ARM; Touch; NOKIA; Lumia 520)",
        viewport: {
          width: 320,
          height: 533
        },
        deviceScaleFactor: 1.5,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "chromium"
      },
      "Nokia Lumia 520 landscape": {
        userAgent: "Mozilla/5.0 (compatible; MSIE 10.0; Windows Phone 8.0; Trident/6.0; IEMobile/10.0; ARM; Touch; NOKIA; Lumia 520)",
        viewport: {
          width: 533,
          height: 320
        },
        deviceScaleFactor: 1.5,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "chromium"
      },
      "Nokia N9": {
        userAgent: "Mozilla/5.0 (MeeGo; NokiaN9) AppleWebKit/534.13 (KHTML, like Gecko) NokiaBrowser/8.5.0 Mobile Safari/534.13",
        viewport: {
          width: 480,
          height: 854
        },
        deviceScaleFactor: 1,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "webkit"
      },
      "Nokia N9 landscape": {
        userAgent: "Mozilla/5.0 (MeeGo; NokiaN9) AppleWebKit/534.13 (KHTML, like Gecko) NokiaBrowser/8.5.0 Mobile Safari/534.13",
        viewport: {
          width: 854,
          height: 480
        },
        deviceScaleFactor: 1,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "webkit"
      },
      "Pixel 2": {
        userAgent: "Mozilla/5.0 (Linux; Android 8.0; Pixel 2 Build/OPD3.170816.012) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
        viewport: {
          width: 411,
          height: 731
        },
        deviceScaleFactor: 2.625,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "chromium"
      },
      "Pixel 2 landscape": {
        userAgent: "Mozilla/5.0 (Linux; Android 8.0; Pixel 2 Build/OPD3.170816.012) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
        viewport: {
          width: 731,
          height: 411
        },
        deviceScaleFactor: 2.625,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "chromium"
      },
      "Pixel 2 XL": {
        userAgent: "Mozilla/5.0 (Linux; Android 8.0.0; Pixel 2 XL Build/OPD1.170816.004) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
        viewport: {
          width: 411,
          height: 823
        },
        deviceScaleFactor: 3.5,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "chromium"
      },
      "Pixel 2 XL landscape": {
        userAgent: "Mozilla/5.0 (Linux; Android 8.0.0; Pixel 2 XL Build/OPD1.170816.004) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
        viewport: {
          width: 823,
          height: 411
        },
        deviceScaleFactor: 3.5,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "chromium"
      },
      "Pixel 3": {
        userAgent: "Mozilla/5.0 (Linux; Android 9; Pixel 3 Build/PQ1A.181105.017.A1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
        viewport: {
          width: 393,
          height: 786
        },
        deviceScaleFactor: 2.75,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "chromium"
      },
      "Pixel 3 landscape": {
        userAgent: "Mozilla/5.0 (Linux; Android 9; Pixel 3 Build/PQ1A.181105.017.A1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
        viewport: {
          width: 786,
          height: 393
        },
        deviceScaleFactor: 2.75,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "chromium"
      },
      "Pixel 4": {
        userAgent: "Mozilla/5.0 (Linux; Android 10; Pixel 4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
        viewport: {
          width: 353,
          height: 745
        },
        deviceScaleFactor: 3,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "chromium"
      },
      "Pixel 4 landscape": {
        userAgent: "Mozilla/5.0 (Linux; Android 10; Pixel 4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
        viewport: {
          width: 745,
          height: 353
        },
        deviceScaleFactor: 3,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "chromium"
      },
      "Pixel 4a (5G)": {
        userAgent: "Mozilla/5.0 (Linux; Android 11; Pixel 4a (5G)) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
        screen: {
          width: 412,
          height: 892
        },
        viewport: {
          width: 412,
          height: 765
        },
        deviceScaleFactor: 2.63,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "chromium"
      },
      "Pixel 4a (5G) landscape": {
        userAgent: "Mozilla/5.0 (Linux; Android 11; Pixel 4a (5G)) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
        screen: {
          height: 892,
          width: 412
        },
        viewport: {
          width: 840,
          height: 312
        },
        deviceScaleFactor: 2.63,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "chromium"
      },
      "Pixel 5": {
        userAgent: "Mozilla/5.0 (Linux; Android 11; Pixel 5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
        screen: {
          width: 393,
          height: 851
        },
        viewport: {
          width: 393,
          height: 727
        },
        deviceScaleFactor: 2.75,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "chromium"
      },
      "Pixel 5 landscape": {
        userAgent: "Mozilla/5.0 (Linux; Android 11; Pixel 5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
        screen: {
          width: 851,
          height: 393
        },
        viewport: {
          width: 802,
          height: 293
        },
        deviceScaleFactor: 2.75,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "chromium"
      },
      "Pixel 6": {
        userAgent: "Mozilla/5.0 (Linux; Android 12; Pixel 6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
        screen: {
          width: 412,
          height: 915
        },
        viewport: {
          width: 412,
          height: 839
        },
        deviceScaleFactor: 2.625,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "chromium"
      },
      "Pixel 6 landscape": {
        userAgent: "Mozilla/5.0 (Linux; Android 12; Pixel 6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
        screen: {
          width: 915,
          height: 412
        },
        viewport: {
          width: 863,
          height: 360
        },
        deviceScaleFactor: 2.625,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "chromium"
      },
      "Pixel 6 Pro": {
        userAgent: "Mozilla/5.0 (Linux; Android 12; Pixel 6 Pro) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
        screen: {
          width: 412,
          height: 892
        },
        viewport: {
          width: 412,
          height: 816
        },
        deviceScaleFactor: 3.5,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "chromium"
      },
      "Pixel 6 Pro landscape": {
        userAgent: "Mozilla/5.0 (Linux; Android 12; Pixel 6 Pro) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
        screen: {
          width: 892,
          height: 412
        },
        viewport: {
          width: 840,
          height: 360
        },
        deviceScaleFactor: 3.5,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "chromium"
      },
      "Pixel 6a": {
        userAgent: "Mozilla/5.0 (Linux; Android 12; Pixel 6a) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
        screen: {
          width: 412,
          height: 915
        },
        viewport: {
          width: 412,
          height: 839
        },
        deviceScaleFactor: 2.625,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "chromium"
      },
      "Pixel 6a landscape": {
        userAgent: "Mozilla/5.0 (Linux; Android 12; Pixel 6a) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
        screen: {
          width: 915,
          height: 412
        },
        viewport: {
          width: 863,
          height: 360
        },
        deviceScaleFactor: 2.625,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "chromium"
      },
      "Pixel 7": {
        userAgent: "Mozilla/5.0 (Linux; Android 14; Pixel 7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
        screen: {
          width: 412,
          height: 915
        },
        viewport: {
          width: 412,
          height: 839
        },
        deviceScaleFactor: 2.625,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "chromium"
      },
      "Pixel 7 landscape": {
        userAgent: "Mozilla/5.0 (Linux; Android 14; Pixel 7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
        screen: {
          width: 915,
          height: 412
        },
        viewport: {
          width: 863,
          height: 360
        },
        deviceScaleFactor: 2.625,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "chromium"
      },
      "Pixel 7 Pro": {
        userAgent: "Mozilla/5.0 (Linux; Android 13; Pixel 7 Pro) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
        screen: {
          width: 412,
          height: 892
        },
        viewport: {
          width: 412,
          height: 816
        },
        deviceScaleFactor: 3.5,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "chromium"
      },
      "Pixel 7 Pro landscape": {
        userAgent: "Mozilla/5.0 (Linux; Android 13; Pixel 7 Pro) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
        screen: {
          width: 892,
          height: 412
        },
        viewport: {
          width: 840,
          height: 360
        },
        deviceScaleFactor: 3.5,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "chromium"
      },
      "Pixel 7a": {
        userAgent: "Mozilla/5.0 (Linux; Android 13; Pixel 7a) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
        screen: {
          width: 412,
          height: 915
        },
        viewport: {
          width: 412,
          height: 839
        },
        deviceScaleFactor: 2.625,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "chromium"
      },
      "Pixel 7a landscape": {
        userAgent: "Mozilla/5.0 (Linux; Android 13; Pixel 7a) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
        screen: {
          width: 915,
          height: 412
        },
        viewport: {
          width: 863,
          height: 360
        },
        deviceScaleFactor: 2.625,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "chromium"
      },
      "Pixel 8": {
        userAgent: "Mozilla/5.0 (Linux; Android 14; Pixel 8) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
        screen: {
          width: 412,
          height: 915
        },
        viewport: {
          width: 412,
          height: 839
        },
        deviceScaleFactor: 2.625,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "chromium"
      },
      "Pixel 8 landscape": {
        userAgent: "Mozilla/5.0 (Linux; Android 14; Pixel 8) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
        screen: {
          width: 915,
          height: 412
        },
        viewport: {
          width: 863,
          height: 360
        },
        deviceScaleFactor: 2.625,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "chromium"
      },
      "Pixel 8 Pro": {
        userAgent: "Mozilla/5.0 (Linux; Android 14; Pixel 8 Pro) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
        screen: {
          width: 448,
          height: 997
        },
        viewport: {
          width: 448,
          height: 921
        },
        deviceScaleFactor: 3,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "chromium"
      },
      "Pixel 8 Pro landscape": {
        userAgent: "Mozilla/5.0 (Linux; Android 14; Pixel 8 Pro) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
        screen: {
          width: 997,
          height: 448
        },
        viewport: {
          width: 945,
          height: 396
        },
        deviceScaleFactor: 3,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "chromium"
      },
      "Pixel 8a": {
        userAgent: "Mozilla/5.0 (Linux; Android 14; Pixel 8a) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
        screen: {
          width: 412,
          height: 915
        },
        viewport: {
          width: 412,
          height: 839
        },
        deviceScaleFactor: 2.625,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "chromium"
      },
      "Pixel 8a landscape": {
        userAgent: "Mozilla/5.0 (Linux; Android 14; Pixel 8a) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
        screen: {
          width: 915,
          height: 412
        },
        viewport: {
          width: 863,
          height: 360
        },
        deviceScaleFactor: 2.625,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "chromium"
      },
      "Pixel 9": {
        userAgent: "Mozilla/5.0 (Linux; Android 14; Pixel 9) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
        screen: {
          width: 360,
          height: 808
        },
        viewport: {
          width: 360,
          height: 732
        },
        deviceScaleFactor: 3,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "chromium"
      },
      "Pixel 9 landscape": {
        userAgent: "Mozilla/5.0 (Linux; Android 14; Pixel 9) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
        screen: {
          width: 808,
          height: 360
        },
        viewport: {
          width: 756,
          height: 308
        },
        deviceScaleFactor: 3,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "chromium"
      },
      "Pixel 9 Pro": {
        userAgent: "Mozilla/5.0 (Linux; Android 14; Pixel 9 Pro) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
        screen: {
          width: 427,
          height: 952
        },
        viewport: {
          width: 427,
          height: 876
        },
        deviceScaleFactor: 3,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "chromium"
      },
      "Pixel 9 Pro landscape": {
        userAgent: "Mozilla/5.0 (Linux; Android 14; Pixel 9 Pro) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
        screen: {
          width: 952,
          height: 427
        },
        viewport: {
          width: 900,
          height: 375
        },
        deviceScaleFactor: 3,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "chromium"
      },
      "Pixel 9 Pro XL": {
        userAgent: "Mozilla/5.0 (Linux; Android 14; Pixel 9 Pro XL) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
        screen: {
          width: 448,
          height: 997
        },
        viewport: {
          width: 448,
          height: 921
        },
        deviceScaleFactor: 3,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "chromium"
      },
      "Pixel 9 Pro XL landscape": {
        userAgent: "Mozilla/5.0 (Linux; Android 14; Pixel 9 Pro XL) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
        screen: {
          width: 997,
          height: 448
        },
        viewport: {
          width: 945,
          height: 396
        },
        deviceScaleFactor: 3,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "chromium"
      },
      "Pixel 10": {
        userAgent: "Mozilla/5.0 (Linux; Android 16; Pixel 10) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
        screen: {
          width: 360,
          height: 808
        },
        viewport: {
          width: 360,
          height: 732
        },
        deviceScaleFactor: 3,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "chromium"
      },
      "Pixel 10 landscape": {
        userAgent: "Mozilla/5.0 (Linux; Android 16; Pixel 10) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
        screen: {
          width: 808,
          height: 360
        },
        viewport: {
          width: 756,
          height: 308
        },
        deviceScaleFactor: 3,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "chromium"
      },
      "Pixel 10 Pro": {
        userAgent: "Mozilla/5.0 (Linux; Android 16; Pixel 10 Pro) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
        screen: {
          width: 427,
          height: 952
        },
        viewport: {
          width: 427,
          height: 876
        },
        deviceScaleFactor: 3,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "chromium"
      },
      "Pixel 10 Pro landscape": {
        userAgent: "Mozilla/5.0 (Linux; Android 16; Pixel 10 Pro) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
        screen: {
          width: 952,
          height: 427
        },
        viewport: {
          width: 900,
          height: 375
        },
        deviceScaleFactor: 3,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "chromium"
      },
      "Pixel 10 Pro XL": {
        userAgent: "Mozilla/5.0 (Linux; Android 16; Pixel 10 Pro XL) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
        screen: {
          width: 448,
          height: 997
        },
        viewport: {
          width: 448,
          height: 921
        },
        deviceScaleFactor: 3,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "chromium"
      },
      "Pixel 10 Pro XL landscape": {
        userAgent: "Mozilla/5.0 (Linux; Android 16; Pixel 10 Pro XL) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
        screen: {
          width: 997,
          height: 448
        },
        viewport: {
          width: 945,
          height: 396
        },
        deviceScaleFactor: 3,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "chromium"
      },
      "Moto G4": {
        userAgent: "Mozilla/5.0 (Linux; Android 7.0; Moto G (4)) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
        viewport: {
          width: 360,
          height: 640
        },
        deviceScaleFactor: 3,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "chromium"
      },
      "Moto G4 landscape": {
        userAgent: "Mozilla/5.0 (Linux; Android 7.0; Moto G (4)) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
        viewport: {
          width: 640,
          height: 360
        },
        deviceScaleFactor: 3,
        isMobile: true,
        hasTouch: true,
        defaultBrowserType: "chromium"
      },
      "Desktop Chrome HiDPI": {
        userAgent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Safari/537.36",
        screen: {
          width: 1792,
          height: 1120
        },
        viewport: {
          width: 1280,
          height: 720
        },
        deviceScaleFactor: 2,
        isMobile: false,
        hasTouch: false,
        defaultBrowserType: "chromium"
      },
      "Desktop Edge HiDPI": {
        userAgent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Safari/537.36 Edg/149.0.7827.55",
        screen: {
          width: 1792,
          height: 1120
        },
        viewport: {
          width: 1280,
          height: 720
        },
        deviceScaleFactor: 2,
        isMobile: false,
        hasTouch: false,
        defaultBrowserType: "chromium"
      },
      "Desktop Firefox HiDPI": {
        userAgent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:151.0) Gecko/20100101 Firefox/151.0",
        screen: {
          width: 1792,
          height: 1120
        },
        viewport: {
          width: 1280,
          height: 720
        },
        deviceScaleFactor: 2,
        isMobile: false,
        hasTouch: false,
        defaultBrowserType: "firefox"
      },
      "Desktop Safari": {
        userAgent: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Safari/605.1.15",
        screen: {
          width: 1792,
          height: 1120
        },
        viewport: {
          width: 1280,
          height: 720
        },
        deviceScaleFactor: 2,
        isMobile: false,
        hasTouch: false,
        defaultBrowserType: "webkit"
      },
      "Desktop Chrome": {
        userAgent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Safari/537.36",
        screen: {
          width: 1920,
          height: 1080
        },
        viewport: {
          width: 1280,
          height: 720
        },
        deviceScaleFactor: 1,
        isMobile: false,
        hasTouch: false,
        defaultBrowserType: "chromium"
      },
      "Desktop Edge": {
        userAgent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Safari/537.36 Edg/149.0.7827.55",
        screen: {
          width: 1920,
          height: 1080
        },
        viewport: {
          width: 1280,
          height: 720
        },
        deviceScaleFactor: 1,
        isMobile: false,
        hasTouch: false,
        defaultBrowserType: "chromium"
      },
      "Desktop Firefox": {
        userAgent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:151.0) Gecko/20100101 Firefox/151.0",
        screen: {
          width: 1920,
          height: 1080
        },
        viewport: {
          width: 1280,
          height: 720
        },
        deviceScaleFactor: 1,
        isMobile: false,
        hasTouch: false,
        defaultBrowserType: "firefox"
      }
    };
  }
});

// packages/playwright-core/src/server/deviceDescriptors.ts
var deviceDescriptors;
var init_deviceDescriptors = __esm({
  "packages/playwright-core/src/server/deviceDescriptors.ts"() {
    "use strict";
    init_deviceDescriptorsSource();
    deviceDescriptors = deviceDescriptorsSource_default;
  }
});

// packages/playwright-core/src/server/codegen/csharp.ts
function formatObject2(value2, indent = "    ", name = "") {
  if (typeof value2 === "string") {
    if (["colorScheme", "modifiers", "button", "recordHarContent", "recordHarMode", "serviceWorkers"].includes(name))
      return `${getEnumName(name)}.${toPascal(value2)}`;
    return quote(value2);
  }
  if (Array.isArray(value2))
    return `new[] { ${value2.map((o) => formatObject2(o, indent, name)).join(", ")} }`;
  if (typeof value2 === "object") {
    const keys = Object.keys(value2).filter((key) => value2[key] !== void 0).sort();
    if (!keys.length)
      return `new()`;
    const tokens = [];
    for (const key of keys) {
      const property = getPropertyName(key);
      tokens.push(`${property} = ${formatObject2(value2[key], indent, key)},`);
    }
    return `new()
{
${indent}${tokens.join(`
${indent}`)}
${indent}}`;
  }
  if (name === "latitude" || name === "longitude")
    return String(value2) + "m";
  return String(value2);
}
function getEnumName(value2) {
  switch (value2) {
    case "modifiers":
      return "KeyboardModifier";
    case "button":
      return "MouseButton";
    case "recordHarMode":
      return "HarMode";
    case "recordHarContent":
      return "HarContentPolicy";
    case "serviceWorkers":
      return "ServiceWorkerPolicy";
    default:
      return toPascal(value2);
  }
}
function getPropertyName(key) {
  switch (key) {
    case "storageState":
      return "StorageStatePath";
    case "viewport":
      return "ViewportSize";
    default:
      return toPascal(key);
  }
}
function toPascal(value2) {
  return value2[0].toUpperCase() + value2.slice(1);
}
function formatContextOptions(contextOptions, deviceName) {
  const options = { ...contextOptions };
  delete options.recordHar;
  const device = deviceName && deviceDescriptors[deviceName];
  if (!device) {
    if (!Object.entries(options).length)
      return "";
    return formatObject2(options, "    ");
  }
  if (!Object.entries(sanitizeDeviceOptions(device, options)).length)
    return `playwright.Devices[${quote(deviceName)}]`;
  delete options["defaultBrowserType"];
  return formatObject2(options, "    ");
}
function quote(text2) {
  return escapeWithQuotes(text2, '"');
}
var CSharpLanguageGenerator, CSharpFormatter;
var init_csharp = __esm({
  "packages/playwright-core/src/server/codegen/csharp.ts"() {
    "use strict";
    init_locatorGenerators();
    init_stringUtils();
    init_language();
    init_deviceDescriptors();
    CSharpLanguageGenerator = class {
      constructor(mode) {
        this.groupName = ".NET C#";
        this.highlighter = "csharp";
        if (mode === "library") {
          this.name = "Library";
          this.id = "csharp";
        } else if (mode === "mstest") {
          this.name = "MSTest";
          this.id = "csharp-mstest";
        } else if (mode === "nunit") {
          this.name = "NUnit";
          this.id = "csharp-nunit";
        } else if (mode === "xunit") {
          this.name = "xUnit";
          this.id = "csharp-xunit";
        } else {
          throw new Error(`Unknown C# language mode: ${mode}`);
        }
        this._mode = mode;
      }
      generateAction(actionInContext) {
        const action = this._generateActionInner(actionInContext);
        if (action)
          return action;
        return "";
      }
      _generateActionInner(actionInContext) {
        const action = actionInContext.action;
        if (this._mode !== "library" && (action.name === "openPage" || action.name === "closePage"))
          return "";
        const pageAlias = this._formatPageAlias(actionInContext.frame.pageAlias);
        const formatter = new CSharpFormatter(this._mode === "library" ? 0 : 8);
        if (action.name === "openPage") {
          formatter.add(`var ${pageAlias} = await context.NewPageAsync();`);
          if (action.url && action.url !== "about:blank" && action.url !== "chrome://newtab/")
            formatter.add(`await ${pageAlias}.GotoAsync(${quote(action.url)});`);
          return formatter.format();
        }
        const locators = actionInContext.frame.framePath.map((selector) => `.${this._asLocator(selector)}.ContentFrame`);
        const subject = `${pageAlias}${locators.join("")}`;
        const signals = toSignalMap(action);
        if (signals.dialog) {
          formatter.add(`    void ${pageAlias}_Dialog${signals.dialog.dialogAlias}_EventHandler(object sender, IDialog dialog)
      {
          Console.WriteLine($"Dialog message: {dialog.Message}");
          dialog.DismissAsync();
          ${pageAlias}.Dialog -= ${pageAlias}_Dialog${signals.dialog.dialogAlias}_EventHandler;
      }
      ${pageAlias}.Dialog += ${pageAlias}_Dialog${signals.dialog.dialogAlias}_EventHandler;`);
        }
        const lines = [];
        lines.push(this._generateActionCall(subject, actionInContext));
        if (signals.download) {
          lines.unshift(`var download${signals.download.downloadAlias} = await ${pageAlias}.RunAndWaitForDownloadAsync(async () =>
{`);
          lines.push(`});`);
        }
        if (signals.popup) {
          lines.unshift(`var ${this._formatPageAlias(signals.popup.popupAlias)} = await ${pageAlias}.RunAndWaitForPopupAsync(async () =>
{`);
          lines.push(`});`);
        }
        for (const line of lines)
          formatter.add(line);
        return formatter.format();
      }
      _formatPageAlias(pageAlias) {
        if (this._mode === "library")
          return pageAlias;
        if (pageAlias === "page")
          return "Page";
        return pageAlias;
      }
      _generateActionCall(subject, actionInContext) {
        const action = actionInContext.action;
        switch (action.name) {
          case "openPage":
            throw Error("Not reached");
          case "closePage":
            return `await ${subject}.CloseAsync();`;
          case "click": {
            let method = "Click";
            if (action.clickCount === 2)
              method = "DblClick";
            const options = toClickOptionsForSourceCode(action);
            if (!Object.entries(options).length)
              return `await ${subject}.${this._asLocator(action.selector)}.${method}Async();`;
            const optionsString = formatObject2(options, "    ");
            return `await ${subject}.${this._asLocator(action.selector)}.${method}Async(${optionsString});`;
          }
          case "hover": {
            const optionsString = action.position ? formatObject2({ position: action.position }, "    ") : "";
            return `await ${subject}.${this._asLocator(action.selector)}.HoverAsync(${optionsString});`;
          }
          case "check":
            return `await ${subject}.${this._asLocator(action.selector)}.CheckAsync();`;
          case "uncheck":
            return `await ${subject}.${this._asLocator(action.selector)}.UncheckAsync();`;
          case "fill":
            return `await ${subject}.${this._asLocator(action.selector)}.FillAsync(${quote(action.text)});`;
          case "setInputFiles":
            return `await ${subject}.${this._asLocator(action.selector)}.SetInputFilesAsync(${formatObject2(action.files)});`;
          case "press": {
            const modifiers = toKeyboardModifiers(action.modifiers);
            const shortcut = [...modifiers, action.key].join("+");
            return `await ${subject}.${this._asLocator(action.selector)}.PressAsync(${quote(shortcut)});`;
          }
          case "navigate":
            return `await ${subject}.GotoAsync(${quote(action.url)});`;
          case "select":
            return `await ${subject}.${this._asLocator(action.selector)}.SelectOptionAsync(${formatObject2(action.options)});`;
          case "assertText":
            return `await Expect(${subject}.${this._asLocator(action.selector)}).${action.substring ? "ToContainTextAsync" : "ToHaveTextAsync"}(${quote(action.text)});`;
          case "assertChecked":
            return `await Expect(${subject}.${this._asLocator(action.selector)})${action.checked ? "" : ".Not"}.ToBeCheckedAsync();`;
          case "assertVisible":
            return `await Expect(${subject}.${this._asLocator(action.selector)}).ToBeVisibleAsync();`;
          case "assertValue": {
            const assertion = action.value ? `ToHaveValueAsync(${quote(action.value)})` : `ToBeEmptyAsync()`;
            return `await Expect(${subject}.${this._asLocator(action.selector)}).${assertion};`;
          }
          case "assertSnapshot":
            return `await Expect(${subject}.${this._asLocator(action.selector)}).ToMatchAriaSnapshotAsync(${quote(action.ariaSnapshot)});`;
        }
      }
      _asLocator(selector) {
        return asLocator("csharp", selector);
      }
      generateHeader(options) {
        if (this._mode === "library")
          return this.generateStandaloneHeader(options);
        return this.generateTestRunnerHeader(options);
      }
      generateStandaloneHeader(options) {
        const formatter = new CSharpFormatter(0);
        formatter.add(`
      using Microsoft.Playwright;
      using System;
      using System.Threading.Tasks;

      using var playwright = await Playwright.CreateAsync();
      await using var browser = await playwright.${toPascal(options.browserName)}.LaunchAsync(${formatObject2(options.launchOptions, "    ")});
      var context = await browser.NewContextAsync(${formatContextOptions(options.contextOptions, options.deviceName)});`);
        if (options.contextOptions.recordHar) {
          const url2 = options.contextOptions.recordHar.urlFilter;
          formatter.add(`      await context.RouteFromHARAsync(${quote(options.contextOptions.recordHar.path)}${url2 ? `, ${formatObject2({ url: url2 }, "    ")}` : ""});`);
        }
        formatter.newLine();
        return formatter.format();
      }
      generateTestRunnerHeader(options) {
        const formatter = new CSharpFormatter(0);
        const playwrightNamespace = this._mode === "nunit" ? "NUnit" : this._mode === "xunit" ? "Xunit" : "MSTest";
        const classAttributes = this._mode === "nunit" ? `[Parallelizable(ParallelScope.Self)]
      [TestFixture]
      ` : this._mode === "mstest" ? `[TestClass]
      ` : "";
        formatter.add(`
      using Microsoft.Playwright.${playwrightNamespace};
      using Microsoft.Playwright;${this._mode === "xunit" ? `
      using Xunit;` : ""}

      ${classAttributes}public class Tests : PageTest
      {`);
        const formattedContextOptions = formatContextOptions(options.contextOptions, options.deviceName);
        if (formattedContextOptions) {
          formatter.add(`public override BrowserNewContextOptions ContextOptions()
      {
          return ${formattedContextOptions};
      }`);
          formatter.newLine();
        }
        const testAttribute = this._mode === "nunit" ? "Test" : this._mode === "xunit" ? "Fact" : "TestMethod";
        formatter.add(`    [${testAttribute}]
    public async Task MyTest()
    {`);
        if (options.contextOptions.recordHar) {
          const url2 = options.contextOptions.recordHar.urlFilter;
          formatter.add(`    await Context.RouteFromHARAsync(${quote(options.contextOptions.recordHar.path)}${url2 ? `, ${formatObject2({ url: url2 }, "    ")}` : ""});`);
        }
        return formatter.format();
      }
      generateFooter(saveStorage) {
        const offset = this._mode === "library" ? "" : "        ";
        let storageStateLine = saveStorage ? `
${offset}await context.StorageStateAsync(new()
${offset}{
${offset}    Path = ${quote(saveStorage)}
${offset}});
` : "";
        if (this._mode !== "library")
          storageStateLine += `    }
}
`;
        return storageStateLine;
      }
    };
    CSharpFormatter = class {
      constructor(offset = 0) {
        this._lines = [];
        this._baseIndent = " ".repeat(4);
        this._baseOffset = " ".repeat(offset);
      }
      prepend(text2) {
        this._lines = text2.trim().split("\n").map((line) => line.trim()).concat(this._lines);
      }
      add(text2) {
        this._lines.push(...text2.trim().split("\n").map((line) => line.trim()));
      }
      newLine() {
        this._lines.push("");
      }
      format() {
        let spaces = "";
        let previousLine = "";
        return this._lines.map((line) => {
          if (line === "")
            return line;
          if (line.startsWith("}") || line.startsWith("]") || line.includes("});") || line === ");")
            spaces = spaces.substring(this._baseIndent.length);
          const extraSpaces = /^(for|while|if).*\(.*\)$/.test(previousLine) ? this._baseIndent : "";
          previousLine = line;
          line = spaces + extraSpaces + line;
          if (line.endsWith("{") || line.endsWith("[") || line.endsWith("("))
            spaces += this._baseIndent;
          if (line.endsWith("));"))
            spaces = spaces.substring(this._baseIndent.length);
          return this._baseOffset + line;
        }).join("\n");
      }
    };
  }
});

// packages/playwright-core/src/server/codegen/javascript.ts
function formatOptions(value2, hasArguments) {
  const keys = Object.keys(value2).filter((key) => value2[key] !== void 0);
  if (!keys.length)
    return "";
  return (hasArguments ? ", " : "") + formatObject(value2);
}
function formatContextOptions2(options, deviceName, isTest) {
  const device = deviceName && deviceDescriptors[deviceName];
  options = { ...options, recordHar: void 0 };
  if (!device)
    return formatObjectOrVoid(options);
  let serializedObject = formatObjectOrVoid(sanitizeDeviceOptions(device, options));
  if (!serializedObject)
    serializedObject = "{\n}";
  const lines = serializedObject.split("\n");
  lines.splice(1, 0, `...devices[${quote2(deviceName)}],`);
  return lines.join("\n");
}
function quote2(text2) {
  return escapeWithQuotes(text2, "'");
}
function wrapWithStep(description, body) {
  return description ? `await test.step(\`${description}\`, async () => {
${body}
});` : body;
}
function quoteMultiline(text2, indent = "  ") {
  const escape = (text3) => text3.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$\{/g, "\\${");
  const lines = text2.split("\n");
  if (lines.length === 1)
    return "`" + escape(text2) + "`";
  return "`\n" + lines.map((line) => indent + escape(line).replace(/\${/g, "\\${")).join("\n") + `
${indent}\``;
}
function isMultilineString(text2) {
  return text2.match(/`[\S\s]*`/)?.[0].includes("\n");
}
var JavaScriptLanguageGenerator, JavaScriptFormatter;
var init_javascript2 = __esm({
  "packages/playwright-core/src/server/codegen/javascript.ts"() {
    "use strict";
    init_locatorGenerators();
    init_stringUtils();
    init_language();
    init_deviceDescriptors();
    JavaScriptLanguageGenerator = class {
      constructor(isTest) {
        this.groupName = "Node.js";
        this.highlighter = "javascript";
        this.id = isTest ? "playwright-test" : "javascript";
        this.name = isTest ? "Test Runner" : "Library";
        this._isTest = isTest;
      }
      generateAction(actionInContext) {
        const action = actionInContext.action;
        if (this._isTest && (action.name === "openPage" || action.name === "closePage"))
          return "";
        const pageAlias = actionInContext.frame.pageAlias;
        const formatter = new JavaScriptFormatter(2);
        if (action.name === "openPage") {
          formatter.add(`const ${pageAlias} = await context.newPage();`);
          if (action.url && action.url !== "about:blank" && action.url !== "chrome://newtab/")
            formatter.add(`await ${pageAlias}.goto(${quote2(action.url)});`);
          return formatter.format();
        }
        const locators = actionInContext.frame.framePath.map((selector) => `.${this._asLocator(selector)}.contentFrame()`);
        const subject = `${pageAlias}${locators.join("")}`;
        const signals = toSignalMap(action);
        if (signals.dialog) {
          formatter.add(`  ${pageAlias}.once('dialog', dialog => {
    console.log(\`Dialog message: \${dialog.message()}\`);
    dialog.dismiss().catch(() => {});
  });`);
        }
        if (signals.popup)
          formatter.add(`const ${signals.popup.popupAlias}Promise = ${pageAlias}.waitForEvent('popup');`);
        if (signals.download)
          formatter.add(`const download${signals.download.downloadAlias}Promise = ${pageAlias}.waitForEvent('download');`);
        formatter.add(wrapWithStep(actionInContext.description, this._generateActionCall(subject, actionInContext)));
        if (signals.popup)
          formatter.add(`const ${signals.popup.popupAlias} = await ${signals.popup.popupAlias}Promise;`);
        if (signals.download)
          formatter.add(`const download${signals.download.downloadAlias} = await download${signals.download.downloadAlias}Promise;`);
        return formatter.format();
      }
      _generateActionCall(subject, actionInContext) {
        const action = actionInContext.action;
        switch (action.name) {
          case "openPage":
            throw Error("Not reached");
          case "closePage":
            return `await ${subject}.close();`;
          case "click": {
            let method = "click";
            if (action.clickCount === 2)
              method = "dblclick";
            const options = toClickOptionsForSourceCode(action);
            const optionsString = formatOptions(options, false);
            return `await ${subject}.${this._asLocator(action.selector)}.${method}(${optionsString});`;
          }
          case "hover":
            return `await ${subject}.${this._asLocator(action.selector)}.hover(${formatOptions({ position: action.position }, false)});`;
          case "check":
            return `await ${subject}.${this._asLocator(action.selector)}.check();`;
          case "uncheck":
            return `await ${subject}.${this._asLocator(action.selector)}.uncheck();`;
          case "fill":
            return `await ${subject}.${this._asLocator(action.selector)}.fill(${quote2(action.text)});`;
          case "setInputFiles":
            return `await ${subject}.${this._asLocator(action.selector)}.setInputFiles(${formatObject(action.files.length === 1 ? action.files[0] : action.files)});`;
          case "press": {
            const modifiers = toKeyboardModifiers(action.modifiers);
            const shortcut = [...modifiers, action.key].join("+");
            return `await ${subject}.${this._asLocator(action.selector)}.press(${quote2(shortcut)});`;
          }
          case "navigate":
            return `await ${subject}.goto(${quote2(action.url)});`;
          case "select":
            return `await ${subject}.${this._asLocator(action.selector)}.selectOption(${formatObject(action.options.length === 1 ? action.options[0] : action.options)});`;
          case "assertText":
            return `${this._isTest ? "" : "// "}await expect(${subject}.${this._asLocator(action.selector)}).${action.substring ? "toContainText" : "toHaveText"}(${quote2(action.text)});`;
          case "assertChecked":
            return `${this._isTest ? "" : "// "}await expect(${subject}.${this._asLocator(action.selector)})${action.checked ? "" : ".not"}.toBeChecked();`;
          case "assertVisible":
            return `${this._isTest ? "" : "// "}await expect(${subject}.${this._asLocator(action.selector)}).toBeVisible();`;
          case "assertValue": {
            const assertion = action.value ? `toHaveValue(${quote2(action.value)})` : `toBeEmpty()`;
            return `${this._isTest ? "" : "// "}await expect(${subject}.${this._asLocator(action.selector)}).${assertion};`;
          }
          case "assertSnapshot": {
            const commentIfNeeded = this._isTest ? "" : "// ";
            return `${commentIfNeeded}await expect(${subject}.${this._asLocator(action.selector)}).toMatchAriaSnapshot(${quoteMultiline(action.ariaSnapshot, `${commentIfNeeded}  `)});`;
          }
        }
      }
      _asLocator(selector) {
        return asLocator("javascript", selector);
      }
      generateHeader(options) {
        if (this._isTest)
          return this.generateTestHeader(options);
        return this.generateStandaloneHeader(options);
      }
      generateFooter(saveStorage) {
        if (this._isTest)
          return this.generateTestFooter(saveStorage);
        return this.generateStandaloneFooter(saveStorage);
      }
      generateTestHeader(options) {
        const formatter = new JavaScriptFormatter();
        const useText = formatContextOptions2(options.contextOptions, options.deviceName, this._isTest);
        formatter.add(`
      import { test, expect${options.deviceName ? ", devices" : ""} } from '@playwright/test';
${useText ? "\ntest.use(" + useText + ");\n" : ""}
      test('test', async ({ page }) => {`);
        if (options.contextOptions.recordHar) {
          const url2 = options.contextOptions.recordHar.urlFilter;
          formatter.add(`  await page.routeFromHAR(${quote2(options.contextOptions.recordHar.path)}${url2 ? `, ${formatOptions({ url: url2 }, false)}` : ""});`);
        }
        return formatter.format();
      }
      generateTestFooter(saveStorage) {
        return `});`;
      }
      generateStandaloneHeader(options) {
        const formatter = new JavaScriptFormatter();
        formatter.add(`
      const { ${options.browserName}${options.deviceName ? ", devices" : ""} } = require('playwright');

      (async () => {
        const browser = await ${options.browserName}.launch(${formatObjectOrVoid(options.launchOptions)});
        const context = await browser.newContext(${formatContextOptions2(options.contextOptions, options.deviceName, false)});`);
        if (options.contextOptions.recordHar)
          formatter.add(`        await context.routeFromHAR(${quote2(options.contextOptions.recordHar.path)});`);
        return formatter.format();
      }
      generateStandaloneFooter(saveStorage) {
        const storageStateLine = saveStorage ? `
  await context.storageState({ path: ${quote2(saveStorage)} });` : "";
        return `
  // ---------------------${storageStateLine}
  await context.close();
  await browser.close();
})();`;
      }
    };
    JavaScriptFormatter = class {
      constructor(offset = 0) {
        this._lines = [];
        this._baseIndent = " ".repeat(2);
        this._baseOffset = " ".repeat(offset);
      }
      prepend(text2) {
        const trim = isMultilineString(text2) ? (line) => line : (line) => line.trim();
        this._lines = text2.trim().split("\n").map(trim).concat(this._lines);
      }
      add(text2) {
        const trim = isMultilineString(text2) ? (line) => line : (line) => line.trim();
        this._lines.push(...text2.trim().split("\n").map(trim));
      }
      newLine() {
        this._lines.push("");
      }
      format() {
        let spaces = "";
        let previousLine = "";
        return this._lines.map((line) => {
          if (line === "")
            return line;
          if (line.startsWith("}") || line.startsWith("]"))
            spaces = spaces.substring(this._baseIndent.length);
          const extraSpaces = /^(for|while|if|try).*\(.*\)$/.test(previousLine) ? this._baseIndent : "";
          previousLine = line;
          const callCarryOver = line.startsWith(".set");
          line = spaces + extraSpaces + (callCarryOver ? this._baseIndent : "") + line;
          if (line.endsWith("{") || line.endsWith("["))
            spaces += this._baseIndent;
          return this._baseOffset + line;
        }).join("\n");
      }
    };
  }
});

// packages/playwright-core/src/server/codegen/java.ts
function formatPath(files) {
  if (Array.isArray(files)) {
    if (files.length === 0)
      return "new Path[0]";
    return `new Path[] {${files.map((s) => "Paths.get(" + quote3(s) + ")").join(", ")}}`;
  }
  return `Paths.get(${quote3(files)})`;
}
function formatSelectOption(options) {
  if (Array.isArray(options)) {
    if (options.length === 0)
      return "new String[0]";
    return `new String[] {${options.map((s) => quote3(s)).join(", ")}}`;
  }
  return quote3(options);
}
function formatLaunchOptions(options) {
  const lines = [];
  if (!Object.keys(options).filter((key) => options[key] !== void 0).length)
    return "";
  lines.push("new BrowserType.LaunchOptions()");
  if (options.channel)
    lines.push(`  .setChannel(${quote3(options.channel)})`);
  if (typeof options.headless === "boolean")
    lines.push(`  .setHeadless(false)`);
  return lines.join("\n");
}
function formatContextOptions3(contextOptions, deviceName) {
  const lines = [];
  if (!Object.keys(contextOptions).length && !deviceName)
    return "";
  const device = deviceName ? deviceDescriptors[deviceName] : {};
  const options = { ...device, ...contextOptions };
  lines.push("new Browser.NewContextOptions()");
  if (options.acceptDownloads)
    lines.push(`  .setAcceptDownloads(true)`);
  if (options.bypassCSP)
    lines.push(`  .setBypassCSP(true)`);
  if (options.colorScheme)
    lines.push(`  .setColorScheme(ColorScheme.${options.colorScheme.toUpperCase()})`);
  if (options.deviceScaleFactor)
    lines.push(`  .setDeviceScaleFactor(${options.deviceScaleFactor})`);
  if (options.geolocation)
    lines.push(`  .setGeolocation(${options.geolocation.latitude}, ${options.geolocation.longitude})`);
  if (options.hasTouch)
    lines.push(`  .setHasTouch(${options.hasTouch})`);
  if (options.isMobile)
    lines.push(`  .setIsMobile(${options.isMobile})`);
  if (options.locale)
    lines.push(`  .setLocale(${quote3(options.locale)})`);
  if (options.proxy)
    lines.push(`  .setProxy(new Proxy(${quote3(options.proxy.server)}))`);
  if (options.serviceWorkers)
    lines.push(`  .setServiceWorkers(ServiceWorkerPolicy.${options.serviceWorkers.toUpperCase()})`);
  if (options.storageState)
    lines.push(`  .setStorageStatePath(Paths.get(${quote3(options.storageState)}))`);
  if (options.timezoneId)
    lines.push(`  .setTimezoneId(${quote3(options.timezoneId)})`);
  if (options.userAgent)
    lines.push(`  .setUserAgent(${quote3(options.userAgent)})`);
  if (options.viewport)
    lines.push(`  .setViewportSize(${options.viewport.width}, ${options.viewport.height})`);
  return lines.join("\n");
}
function formatClickOptions(options) {
  const lines = [];
  if (options.button)
    lines.push(`  .setButton(MouseButton.${options.button.toUpperCase()})`);
  if (options.modifiers)
    lines.push(`  .setModifiers(Arrays.asList(${options.modifiers.map((m) => `KeyboardModifier.${m.toUpperCase()}`).join(", ")}))`);
  if (options.clickCount)
    lines.push(`  .setClickCount(${options.clickCount})`);
  if (options.position)
    lines.push(`  .setPosition(${options.position.x}, ${options.position.y})`);
  if (!lines.length)
    return "";
  lines.unshift(`new Locator.ClickOptions()`);
  return lines.join("\n");
}
function quote3(text2) {
  return escapeWithQuotes(text2, '"');
}
var JavaLanguageGenerator;
var init_java = __esm({
  "packages/playwright-core/src/server/codegen/java.ts"() {
    "use strict";
    init_locatorGenerators();
    init_stringUtils();
    init_language();
    init_deviceDescriptors();
    init_javascript2();
    JavaLanguageGenerator = class {
      constructor(mode) {
        this.groupName = "Java";
        this.highlighter = "java";
        if (mode === "library") {
          this.name = "Library";
          this.id = "java";
        } else if (mode === "junit") {
          this.name = "JUnit";
          this.id = "java-junit";
        } else {
          throw new Error(`Unknown Java language mode: ${mode}`);
        }
        this._mode = mode;
      }
      generateAction(actionInContext) {
        const action = actionInContext.action;
        const pageAlias = actionInContext.frame.pageAlias;
        const offset = this._mode === "junit" ? 4 : 6;
        const formatter = new JavaScriptFormatter(offset);
        if (this._mode !== "library" && (action.name === "openPage" || action.name === "closePage"))
          return "";
        if (action.name === "openPage") {
          formatter.add(`Page ${pageAlias} = context.newPage();`);
          if (action.url && action.url !== "about:blank" && action.url !== "chrome://newtab/")
            formatter.add(`${pageAlias}.navigate(${quote3(action.url)});`);
          return formatter.format();
        }
        const locators = actionInContext.frame.framePath.map((selector) => `.${this._asLocator(selector, false)}.contentFrame()`);
        const subject = `${pageAlias}${locators.join("")}`;
        const signals = toSignalMap(action);
        if (signals.dialog) {
          formatter.add(`  ${pageAlias}.onceDialog(dialog -> {
        System.out.println(String.format("Dialog message: %s", dialog.message()));
        dialog.dismiss();
      });`);
        }
        let code = this._generateActionCall(subject, actionInContext, !!actionInContext.frame.framePath.length);
        if (signals.popup) {
          code = `Page ${signals.popup.popupAlias} = ${pageAlias}.waitForPopup(() -> {
        ${code}
      });`;
        }
        if (signals.download) {
          code = `Download download${signals.download.downloadAlias} = ${pageAlias}.waitForDownload(() -> {
        ${code}
      });`;
        }
        formatter.add(code);
        return formatter.format();
      }
      _generateActionCall(subject, actionInContext, inFrameLocator) {
        const action = actionInContext.action;
        switch (action.name) {
          case "openPage":
            throw Error("Not reached");
          case "closePage":
            return `${subject}.close();`;
          case "click": {
            let method = "click";
            if (action.clickCount === 2)
              method = "dblclick";
            const options = toClickOptionsForSourceCode(action);
            const optionsText = formatClickOptions(options);
            return `${subject}.${this._asLocator(action.selector, inFrameLocator)}.${method}(${optionsText});`;
          }
          case "hover": {
            const optionsText = action.position ? `new Locator.HoverOptions().setPosition(${action.position.x}, ${action.position.y})` : "";
            return `${subject}.${this._asLocator(action.selector, inFrameLocator)}.hover(${optionsText});`;
          }
          case "check":
            return `${subject}.${this._asLocator(action.selector, inFrameLocator)}.check();`;
          case "uncheck":
            return `${subject}.${this._asLocator(action.selector, inFrameLocator)}.uncheck();`;
          case "fill":
            return `${subject}.${this._asLocator(action.selector, inFrameLocator)}.fill(${quote3(action.text)});`;
          case "setInputFiles":
            return `${subject}.${this._asLocator(action.selector, inFrameLocator)}.setInputFiles(${formatPath(action.files.length === 1 ? action.files[0] : action.files)});`;
          case "press": {
            const modifiers = toKeyboardModifiers(action.modifiers);
            const shortcut = [...modifiers, action.key].join("+");
            return `${subject}.${this._asLocator(action.selector, inFrameLocator)}.press(${quote3(shortcut)});`;
          }
          case "navigate":
            return `${subject}.navigate(${quote3(action.url)});`;
          case "select":
            return `${subject}.${this._asLocator(action.selector, inFrameLocator)}.selectOption(${formatSelectOption(action.options.length === 1 ? action.options[0] : action.options)});`;
          case "assertText":
            return `assertThat(${subject}.${this._asLocator(action.selector, inFrameLocator)}).${action.substring ? "containsText" : "hasText"}(${quote3(action.text)});`;
          case "assertChecked":
            return `assertThat(${subject}.${this._asLocator(action.selector, inFrameLocator)})${action.checked ? "" : ".not()"}.isChecked();`;
          case "assertVisible":
            return `assertThat(${subject}.${this._asLocator(action.selector, inFrameLocator)}).isVisible();`;
          case "assertValue": {
            const assertion = action.value ? `hasValue(${quote3(action.value)})` : `isEmpty()`;
            return `assertThat(${subject}.${this._asLocator(action.selector, inFrameLocator)}).${assertion};`;
          }
          case "assertSnapshot":
            return `assertThat(${subject}.${this._asLocator(action.selector, inFrameLocator)}).matchesAriaSnapshot(${quote3(action.ariaSnapshot)});`;
        }
      }
      _asLocator(selector, inFrameLocator) {
        return asLocator("java", selector, inFrameLocator);
      }
      generateHeader(options) {
        const formatter = new JavaScriptFormatter();
        if (this._mode === "junit") {
          formatter.add(`
      import com.microsoft.playwright.junit.UsePlaywright;
      import com.microsoft.playwright.Page;
      import com.microsoft.playwright.options.*;

      ${options.contextOptions.recordHar ? `import java.nio.file.Paths;
` : ""}import org.junit.jupiter.api.*;
      import static com.microsoft.playwright.assertions.PlaywrightAssertions.*;

      @UsePlaywright
      public class TestExample {
        @Test
        void test(Page page) {`);
          if (options.contextOptions.recordHar) {
            const url2 = options.contextOptions.recordHar.urlFilter;
            const recordHarOptions = typeof url2 === "string" ? `, new Page.RouteFromHAROptions()
            .setUrl(${quote3(url2)})` : "";
            formatter.add(`          page.routeFromHAR(Paths.get(${quote3(options.contextOptions.recordHar.path)})${recordHarOptions});`);
          }
          return formatter.format();
        }
        formatter.add(`
    import com.microsoft.playwright.*;
    import com.microsoft.playwright.options.*;
    import static com.microsoft.playwright.assertions.PlaywrightAssertions.assertThat;
    ${options.contextOptions.recordHar ? `import java.nio.file.Paths;
` : ""}import java.util.*;

    public class Example {
      public static void main(String[] args) {
        try (Playwright playwright = Playwright.create()) {
          Browser browser = playwright.${options.browserName}().launch(${formatLaunchOptions(options.launchOptions)});
          BrowserContext context = browser.newContext(${formatContextOptions3(options.contextOptions, options.deviceName)});`);
        if (options.contextOptions.recordHar) {
          const url2 = options.contextOptions.recordHar.urlFilter;
          const recordHarOptions = typeof url2 === "string" ? `, new BrowserContext.RouteFromHAROptions()
          .setUrl(${quote3(url2)})` : "";
          formatter.add(`          context.routeFromHAR(Paths.get(${quote3(options.contextOptions.recordHar.path)})${recordHarOptions});`);
        }
        return formatter.format();
      }
      generateFooter(saveStorage) {
        const storageStateLine = saveStorage ? `
      context.storageState(new BrowserContext.StorageStateOptions().setPath(${quote3(saveStorage)}));
` : "";
        if (this._mode === "junit") {
          return `${storageStateLine}  }
}`;
        }
        return `${storageStateLine}    }
  }
}`;
      }
    };
  }
});

// packages/playwright-core/src/server/codegen/jsonl.ts
var JsonlLanguageGenerator;
var init_jsonl = __esm({
  "packages/playwright-core/src/server/codegen/jsonl.ts"() {
    "use strict";
    init_locatorGenerators();
    JsonlLanguageGenerator = class {
      constructor() {
        this.id = "jsonl";
        this.groupName = "";
        this.name = "JSONL";
        this.highlighter = "javascript";
      }
      generateAction(actionInContext) {
        const locator2 = actionInContext.action.selector ? JSON.parse(asLocator("jsonl", actionInContext.action.selector)) : void 0;
        const entry = {
          ...actionInContext.action,
          ...actionInContext.frame,
          locator: locator2,
          ariaSnapshot: void 0
        };
        return JSON.stringify(entry);
      }
      generateHeader(options) {
        return JSON.stringify(options);
      }
      generateFooter(saveStorage) {
        return "";
      }
    };
  }
});

// packages/playwright-core/src/server/codegen/python.ts
function formatValue(value2) {
  if (value2 === false)
    return "False";
  if (value2 === true)
    return "True";
  if (value2 === void 0)
    return "None";
  if (Array.isArray(value2))
    return `[${value2.map(formatValue).join(", ")}]`;
  if (typeof value2 === "string")
    return quote4(value2);
  if (typeof value2 === "object")
    return JSON.stringify(value2);
  return String(value2);
}
function formatOptions2(value2, hasArguments, asDict) {
  const keys = Object.keys(value2).filter((key) => value2[key] !== void 0).sort();
  if (!keys.length)
    return "";
  return (hasArguments ? ", " : "") + keys.map((key) => {
    if (asDict)
      return `"${toSnakeCase(key)}": ${formatValue(value2[key])}`;
    return `${toSnakeCase(key)}=${formatValue(value2[key])}`;
  }).join(", ");
}
function formatContextOptions4(options, deviceName, asDict) {
  options = { ...options, recordHar: void 0 };
  const device = deviceName && deviceDescriptors[deviceName];
  if (!device)
    return formatOptions2(options, false, asDict);
  return `**playwright.devices[${quote4(deviceName)}]` + formatOptions2(sanitizeDeviceOptions(device, options), true, asDict);
}
function quote4(text2) {
  return escapeWithQuotes(text2, '"');
}
var PythonLanguageGenerator, PythonFormatter;
var init_python = __esm({
  "packages/playwright-core/src/server/codegen/python.ts"() {
    "use strict";
    init_locatorGenerators();
    init_stringUtils();
    init_language();
    init_deviceDescriptors();
    PythonLanguageGenerator = class {
      constructor(isAsync, isPyTest) {
        this.groupName = "Python";
        this.highlighter = "python";
        this.id = isPyTest ? "python-pytest" : isAsync ? "python-async" : "python";
        this.name = isPyTest ? "Pytest" : isAsync ? "Library Async" : "Library";
        this._isAsync = isAsync;
        this._isPyTest = isPyTest;
        this._awaitPrefix = isAsync ? "await " : "";
        this._asyncPrefix = isAsync ? "async " : "";
      }
      generateAction(actionInContext) {
        const action = actionInContext.action;
        if (this._isPyTest && (action.name === "openPage" || action.name === "closePage"))
          return "";
        const pageAlias = actionInContext.frame.pageAlias;
        const formatter = new PythonFormatter(4);
        if (action.name === "openPage") {
          formatter.add(`${pageAlias} = ${this._awaitPrefix}context.new_page()`);
          if (action.url && action.url !== "about:blank" && action.url !== "chrome://newtab/")
            formatter.add(`${this._awaitPrefix}${pageAlias}.goto(${quote4(action.url)})`);
          return formatter.format();
        }
        const locators = actionInContext.frame.framePath.map((selector) => `.${this._asLocator(selector)}.content_frame`);
        const subject = `${pageAlias}${locators.join("")}`;
        const signals = toSignalMap(action);
        if (signals.dialog)
          formatter.add(`  ${pageAlias}.once("dialog", lambda dialog: dialog.dismiss())`);
        let code = `${this._awaitPrefix}${this._generateActionCall(subject, actionInContext)}`;
        if (signals.popup) {
          code = `${this._asyncPrefix}with ${pageAlias}.expect_popup() as ${signals.popup.popupAlias}_info {
        ${code}
      }
      ${signals.popup.popupAlias} = ${this._awaitPrefix}${signals.popup.popupAlias}_info.value`;
        }
        if (signals.download) {
          code = `${this._asyncPrefix}with ${pageAlias}.expect_download() as download${signals.download.downloadAlias}_info {
        ${code}
      }
      download${signals.download.downloadAlias} = ${this._awaitPrefix}download${signals.download.downloadAlias}_info.value`;
        }
        formatter.add(code);
        return formatter.format();
      }
      _generateActionCall(subject, actionInContext) {
        const action = actionInContext.action;
        switch (action.name) {
          case "openPage":
            throw Error("Not reached");
          case "closePage":
            return `${subject}.close()`;
          case "click": {
            let method = "click";
            if (action.clickCount === 2)
              method = "dblclick";
            const options = toClickOptionsForSourceCode(action);
            const optionsString = formatOptions2(options, false);
            return `${subject}.${this._asLocator(action.selector)}.${method}(${optionsString})`;
          }
          case "hover":
            return `${subject}.${this._asLocator(action.selector)}.hover(${formatOptions2({ position: action.position }, false)})`;
          case "check":
            return `${subject}.${this._asLocator(action.selector)}.check()`;
          case "uncheck":
            return `${subject}.${this._asLocator(action.selector)}.uncheck()`;
          case "fill":
            return `${subject}.${this._asLocator(action.selector)}.fill(${quote4(action.text)})`;
          case "setInputFiles":
            return `${subject}.${this._asLocator(action.selector)}.set_input_files(${formatValue(action.files.length === 1 ? action.files[0] : action.files)})`;
          case "press": {
            const modifiers = toKeyboardModifiers(action.modifiers);
            const shortcut = [...modifiers, action.key].join("+");
            return `${subject}.${this._asLocator(action.selector)}.press(${quote4(shortcut)})`;
          }
          case "navigate":
            return `${subject}.goto(${quote4(action.url)})`;
          case "select":
            return `${subject}.${this._asLocator(action.selector)}.select_option(${formatValue(action.options.length === 1 ? action.options[0] : action.options)})`;
          case "assertText":
            return `expect(${subject}.${this._asLocator(action.selector)}).${action.substring ? "to_contain_text" : "to_have_text"}(${quote4(action.text)})`;
          case "assertChecked":
            return `expect(${subject}.${this._asLocator(action.selector)}).${action.checked ? "to_be_checked()" : "not_to_be_checked()"}`;
          case "assertVisible":
            return `expect(${subject}.${this._asLocator(action.selector)}).to_be_visible()`;
          case "assertValue": {
            const assertion = action.value ? `to_have_value(${quote4(action.value)})` : `to_be_empty()`;
            return `expect(${subject}.${this._asLocator(action.selector)}).${assertion};`;
          }
          case "assertSnapshot":
            return `expect(${subject}.${this._asLocator(action.selector)}).to_match_aria_snapshot(${quote4(action.ariaSnapshot)})`;
        }
      }
      _asLocator(selector) {
        return asLocator("python", selector);
      }
      generateHeader(options) {
        const formatter = new PythonFormatter();
        const recordHar = options.contextOptions.recordHar;
        if (this._isPyTest) {
          const contextOptions = formatContextOptions4(
            options.contextOptions,
            options.deviceName,
            true
            /* asDict */
          );
          const fixture = contextOptions ? `

@pytest.fixture(scope="session")
def browser_context_args(browser_context_args, playwright) {
    return {${contextOptions}}
}
` : "";
          formatter.add(`${options.deviceName || contextOptions ? "import pytest\n" : ""}import re
from playwright.sync_api import Page, expect
${fixture}

def test_example(page: Page) -> None {`);
          if (recordHar)
            formatter.add(`    page.route_from_har(${quote4(recordHar.path)}${typeof recordHar.urlFilter === "string" ? `, url=${quote4(recordHar.urlFilter)}` : ""})`);
        } else if (this._isAsync) {
          formatter.add(`
import asyncio
import re
from playwright.async_api import Playwright, async_playwright, expect


async def run(playwright: Playwright) -> None {
    browser = await playwright.${options.browserName}.launch(${formatOptions2(options.launchOptions, false)})
    context = await browser.new_context(${formatContextOptions4(options.contextOptions, options.deviceName)})`);
          if (recordHar)
            formatter.add(`    await context.route_from_har(${quote4(recordHar.path)}${typeof recordHar.urlFilter === "string" ? `, url=${quote4(recordHar.urlFilter)}` : ""})`);
        } else {
          formatter.add(`
import re
from playwright.sync_api import Playwright, sync_playwright, expect


def run(playwright: Playwright) -> None {
    browser = playwright.${options.browserName}.launch(${formatOptions2(options.launchOptions, false)})
    context = browser.new_context(${formatContextOptions4(options.contextOptions, options.deviceName)})`);
          if (recordHar)
            formatter.add(`    context.route_from_har(${quote4(recordHar.path)}${typeof recordHar.urlFilter === "string" ? `, url=${quote4(recordHar.urlFilter)}` : ""})`);
        }
        return formatter.format();
      }
      generateFooter(saveStorage) {
        if (this._isPyTest) {
          return "";
        } else if (this._isAsync) {
          const storageStateLine = saveStorage ? `
    await context.storage_state(path=${quote4(saveStorage)})` : "";
          return `
    # ---------------------${storageStateLine}
    await context.close()
    await browser.close()


async def main() -> None:
    async with async_playwright() as playwright:
        await run(playwright)


asyncio.run(main())
`;
        } else {
          const storageStateLine = saveStorage ? `
    context.storage_state(path=${quote4(saveStorage)})` : "";
          return `
    # ---------------------${storageStateLine}
    context.close()
    browser.close()


with sync_playwright() as playwright:
    run(playwright)
`;
        }
      }
    };
    PythonFormatter = class {
      constructor(offset = 0) {
        this._lines = [];
        this._baseIndent = " ".repeat(4);
        this._baseOffset = " ".repeat(offset);
      }
      prepend(text2) {
        this._lines = text2.trim().split("\n").map((line) => line.trim()).concat(this._lines);
      }
      add(text2) {
        this._lines.push(...text2.trim().split("\n").map((line) => line.trim()));
      }
      newLine() {
        this._lines.push("");
      }
      format() {
        let spaces = "";
        const lines = [];
        this._lines.forEach((line) => {
          if (line === "")
            return lines.push(line);
          if (line === "}") {
            spaces = spaces.substring(this._baseIndent.length);
            return;
          }
          line = spaces + line;
          if (line.endsWith("{")) {
            spaces += this._baseIndent;
            line = line.substring(0, line.length - 1).trimEnd() + ":";
          }
          return lines.push(this._baseOffset + line);
        });
        return lines.join("\n");
      }
    };
  }
});

// packages/playwright-core/src/server/codegen/languages.ts
function languageSet() {
  return /* @__PURE__ */ new Set([
    new JavaScriptLanguageGenerator(
      /* isPlaywrightTest */
      true
    ),
    new JavaScriptLanguageGenerator(
      /* isPlaywrightTest */
      false
    ),
    new PythonLanguageGenerator(
      /* isAsync */
      false,
      /* isPytest */
      true
    ),
    new PythonLanguageGenerator(
      /* isAsync */
      false,
      /* isPytest */
      false
    ),
    new PythonLanguageGenerator(
      /* isAsync */
      true,
      /* isPytest */
      false
    ),
    new CSharpLanguageGenerator("mstest"),
    new CSharpLanguageGenerator("nunit"),
    new CSharpLanguageGenerator("xunit"),
    new CSharpLanguageGenerator("library"),
    new JavaLanguageGenerator("junit"),
    new JavaLanguageGenerator("library"),
    new JsonlLanguageGenerator()
  ]);
}
var init_languages = __esm({
  "packages/playwright-core/src/server/codegen/languages.ts"() {
    "use strict";
    init_csharp();
    init_java();
    init_javascript2();
    init_jsonl();
    init_python();
  }
});

// packages/playwright-core/src/server/recorder/recorderUtils.ts
function buildFullSelector(framePath, selector) {
  return [...framePath, selector].join(" >> internal:control=enter-frame >> ");
}
function metadataToCallLog(metadata, status) {
  const title = renderTitleForCall(metadata);
  if (metadata.error)
    status = "error";
  const params2 = {
    url: metadata.params?.url,
    selector: metadata.params?.selector
  };
  let duration = metadata.endTime ? metadata.endTime - metadata.startTime : void 0;
  if (typeof duration === "number" && metadata.pauseStartTime && metadata.pauseEndTime) {
    duration -= metadata.pauseEndTime - metadata.pauseStartTime;
    duration = Math.max(duration, 0);
  }
  const callLog = {
    id: metadata.id,
    messages: metadata.log,
    title: title ?? "",
    status,
    error: metadata.error?.error?.message,
    params: params2,
    duration
  };
  return callLog;
}
function mainFrameForAction(pageAliases, actionInContext) {
  const pageAlias = actionInContext.frame.pageAlias;
  const page = [...pageAliases.entries()].find(([, alias]) => pageAlias === alias)?.[0];
  if (!page)
    throw new Error(`Internal error: page ${pageAlias} not found in [${[...pageAliases.values()]}]`);
  return page.mainFrame();
}
function isSameAction(a, b) {
  return a.action.name === b.action.name && a.frame.pageAlias === b.frame.pageAlias && a.frame.framePath.join("|") === b.frame.framePath.join("|");
}
function isSameSelector(action, lastAction) {
  return "selector" in action.action && "selector" in lastAction.action && action.action.selector === lastAction.action.selector;
}
function isShortlyAfter(action, lastAction) {
  return action.startTime - lastAction.startTime < 500;
}
function shouldMergeAction(action, lastAction) {
  if (!lastAction)
    return false;
  switch (action.action.name) {
    case "fill":
      return isSameAction(action, lastAction) && isSameSelector(action, lastAction);
    case "navigate":
      return isSameAction(action, lastAction);
    case "click":
      return isSameAction(action, lastAction) && isSameSelector(action, lastAction) && isShortlyAfter(action, lastAction) && action.action.clickCount > lastAction.action.clickCount;
  }
  return false;
}
function collapseActions(actions) {
  const result2 = [];
  for (const action of actions) {
    const lastAction = result2[result2.length - 1];
    const shouldMerge = shouldMergeAction(action, lastAction);
    if (!shouldMerge) {
      result2.push(action);
      continue;
    }
    const startTime = result2[result2.length - 1].startTime;
    result2[result2.length - 1] = action;
    result2[result2.length - 1].startTime = startTime;
  }
  return result2;
}
async function generateFrameSelector(progress2, frame) {
  const selectorPromises = [];
  progress2.setAllowConcurrentOrNestedRaces(true);
  while (frame) {
    const parent = frame.parentFrame();
    if (!parent)
      break;
    selectorPromises.push(generateFrameSelectorInParent(progress2, parent, frame));
    frame = parent;
  }
  const result2 = await Promise.all(selectorPromises);
  progress2.setAllowConcurrentOrNestedRaces(false);
  return result2.reverse();
}
async function generateFrameSelectorInParent(prgoress, parent, frame) {
  const result2 = await raceAgainstDeadline(async () => {
    try {
      const frameElement = await frame.frameElement(prgoress);
      if (!frameElement || !parent)
        return;
      const utility = await parent.utilityContext();
      const injected = await utility.injectedScript();
      const selector = await injected.evaluate((injected2, element2) => {
        return injected2.generateSelectorSimple(element2);
      }, frameElement);
      return selector;
    } catch (e) {
    }
  }, monotonicTime() + 2e3);
  if (!result2.timedOut && result2.result)
    return result2.result;
  if (frame.name())
    return `iframe[name=${quoteCSSAttributeValue(frame.name())}]`;
  return `iframe[src=${quoteCSSAttributeValue(frame.url())}]`;
}
var init_recorderUtils = __esm({
  "packages/playwright-core/src/server/recorder/recorderUtils.ts"() {
    "use strict";
    init_protocolFormatter();
    init_timeoutRunner();
    init_time();
    init_stringUtils();
  }
});

// packages/playwright-core/src/server/recorder/recorderSignalProcessor.ts
var RecorderSignalProcessor;
var init_recorderSignalProcessor = __esm({
  "packages/playwright-core/src/server/recorder/recorderSignalProcessor.ts"() {
    "use strict";
    init_time();
    init_debug();
    init_recorderUtils();
    init_progress();
    RecorderSignalProcessor = class {
      constructor(actionSink) {
        this._lastAction = null;
        this._delegate = actionSink;
      }
      addAction(actionInContext) {
        this._lastAction = actionInContext;
        this._delegate.addAction(actionInContext);
      }
      signal(pageAlias, frame, signal) {
        const timestamp = monotonicTime();
        if (signal.name === "navigation" && frame._page.mainFrame() === frame) {
          const lastAction = this._lastAction;
          const signalThreshold = isUnderTest() ? 500 : 5e3;
          let generateGoto = false;
          if (!lastAction)
            generateGoto = true;
          else if (lastAction.action.name !== "click" && lastAction.action.name !== "press" && lastAction.action.name !== "fill")
            generateGoto = true;
          else if (timestamp - lastAction.startTime > signalThreshold)
            generateGoto = true;
          if (generateGoto) {
            this.addAction({
              frame: {
                pageGuid: frame._page.guid,
                pageAlias,
                framePath: []
              },
              action: {
                name: "navigate",
                url: frame.url(),
                signals: []
              },
              startTime: timestamp,
              endTime: timestamp
            });
          }
          return;
        }
        generateFrameSelector(nullProgress, frame).then((framePath) => {
          const signalInContext = {
            frame: {
              pageGuid: frame._page.guid,
              pageAlias,
              framePath
            },
            signal,
            timestamp
          };
          this._delegate.addSignal(signalInContext);
        });
      }
    };
  }
});

// packages/playwright-core/src/generated/pollingRecorderSource.ts
var source6;
var init_pollingRecorderSource = __esm({
  "packages/playwright-core/src/generated/pollingRecorderSource.ts"() {
    "use strict";
    source6 = '\nvar __commonJS = obj => {\n  let required = false;\n  let result;\n  return function __require() {\n    if (!required) {\n      required = true;\n      let fn;\n      for (const name in obj) { fn = obj[name]; break; }\n      const module = { exports: {} };\n      fn(module.exports, module);\n      result = module.exports;\n    }\n    return result;\n  }\n};\nvar __export = (target, all) => {for (var name in all) target[name] = all[name];};\nvar __toESM = mod => ({ ...mod, \'default\': mod });\nvar __toCommonJS = mod => ({ ...mod, __esModule: true });\n\n\n// packages/injected/src/recorder/pollingRecorder.ts\nvar pollingRecorder_exports = {};\n__export(pollingRecorder_exports, {\n  PollingRecorder: () => PollingRecorder,\n  default: () => pollingRecorder_default\n});\nmodule.exports = __toCommonJS(pollingRecorder_exports);\n\n// packages/injected/src/recorder/clipPaths.ts\nvar svgJson = { "tagName": "svg", "children": [{ "tagName": "defs", "children": [{ "tagName": "clipPath", "attrs": { "width": "16", "height": "16", "viewBox": "0 0 16 16", "fill": "currentColor", "id": "icon-gripper" }, "children": [{ "tagName": "path", "attrs": { "d": "M5 3h2v2H5zm0 4h2v2H5zm0 4h2v2H5zm4-8h2v2H9zm0 4h2v2H9zm0 4h2v2H9z" } }] }, { "tagName": "clipPath", "attrs": { "width": "16", "height": "16", "viewBox": "0 0 16 16", "fill": "currentColor", "id": "icon-circle-large-filled" }, "children": [{ "tagName": "path", "attrs": { "d": "M8 1a6.8 6.8 0 0 1 1.86.253 6.899 6.899 0 0 1 3.083 1.805 6.903 6.903 0 0 1 1.804 3.083C14.916 6.738 15 7.357 15 8s-.084 1.262-.253 1.86a6.9 6.9 0 0 1-.704 1.674 7.157 7.157 0 0 1-2.516 2.509 6.966 6.966 0 0 1-1.668.71A6.984 6.984 0 0 1 8 15a6.984 6.984 0 0 1-1.86-.246 7.098 7.098 0 0 1-1.674-.711 7.3 7.3 0 0 1-1.415-1.094 7.295 7.295 0 0 1-1.094-1.415 7.098 7.098 0 0 1-.71-1.675A6.985 6.985 0 0 1 1 8c0-.643.082-1.262.246-1.86a6.968 6.968 0 0 1 .711-1.667 7.156 7.156 0 0 1 2.509-2.516 6.895 6.895 0 0 1 1.675-.704A6.808 6.808 0 0 1 8 1z" } }] }, { "tagName": "clipPath", "attrs": { "width": "16", "height": "16", "viewBox": "0 0 16 16", "fill": "currentColor", "id": "icon-stop-circle" }, "children": [{ "tagName": "path", "attrs": { "d": "M6 6h4v4H6z" } }, { "tagName": "path", "attrs": { "fill-rule": "evenodd", "clip-rule": "evenodd", "d": "M8.6 1c1.6.1 3.1.9 4.2 2 1.3 1.4 2 3.1 2 5.1 0 1.6-.6 3.1-1.6 4.4-1 1.2-2.4 2.1-4 2.4-1.6.3-3.2.1-4.6-.7-1.4-.8-2.5-2-3.1-3.5C.9 9.2.8 7.5 1.3 6c.5-1.6 1.4-2.9 2.8-3.8C5.4 1.3 7 .9 8.6 1zm.5 12.9c1.3-.3 2.5-1 3.4-2.1.8-1.1 1.3-2.4 1.2-3.8 0-1.6-.6-3.2-1.7-4.3-1-1-2.2-1.6-3.6-1.7-1.3-.1-2.7.2-3.8 1-1.1.8-1.9 1.9-2.3 3.3-.4 1.3-.4 2.7.2 4 .6 1.3 1.5 2.3 2.7 3 1.2.7 2.6.9 3.9.6z" } }] }, { "tagName": "clipPath", "attrs": { "width": "16", "height": "16", "viewBox": "0 0 16 16", "fill": "currentColor", "id": "icon-inspect" }, "children": [{ "tagName": "path", "attrs": { "fill-rule": "evenodd", "clip-rule": "evenodd", "d": "M1 3l1-1h12l1 1v6h-1V3H2v8h5v1H2l-1-1V3zm14.707 9.707L9 6v9.414l2.707-2.707h4zM10 13V8.414l3.293 3.293h-2L10 13z" } }] }, { "tagName": "clipPath", "attrs": { "width": "16", "height": "16", "viewBox": "0 0 16 16", "fill": "currentColor", "id": "icon-whole-word" }, "children": [{ "tagName": "path", "attrs": { "fill-rule": "evenodd", "clip-rule": "evenodd", "d": "M0 11H1V13H15V11H16V14H15H1H0V11Z" } }, { "tagName": "path", "attrs": { "d": "M6.84048 11H5.95963V10.1406H5.93814C5.555 10.7995 4.99104 11.1289 4.24625 11.1289C3.69839 11.1289 3.26871 10.9839 2.95718 10.6938C2.64924 10.4038 2.49527 10.0189 2.49527 9.53906C2.49527 8.51139 3.10041 7.91341 4.3107 7.74512L5.95963 7.51416C5.95963 6.57959 5.58186 6.1123 4.82632 6.1123C4.16389 6.1123 3.56591 6.33789 3.03238 6.78906V5.88672C3.57307 5.54297 4.19612 5.37109 4.90152 5.37109C6.19416 5.37109 6.84048 6.05501 6.84048 7.42285V11ZM5.95963 8.21777L4.63297 8.40039C4.22476 8.45768 3.91682 8.55973 3.70914 8.70654C3.50145 8.84977 3.39761 9.10579 3.39761 9.47461C3.39761 9.74316 3.4925 9.96338 3.68228 10.1353C3.87564 10.3035 4.13166 10.3877 4.45035 10.3877C4.8872 10.3877 5.24706 10.2355 5.52994 9.93115C5.8164 9.62321 5.95963 9.2347 5.95963 8.76562V8.21777Z" } }, { "tagName": "path", "attrs": { "d": "M9.3475 10.2051H9.32601V11H8.44515V2.85742H9.32601V6.4668H9.3475C9.78076 5.73633 10.4146 5.37109 11.2489 5.37109C11.9543 5.37109 12.5057 5.61816 12.9032 6.1123C13.3042 6.60286 13.5047 7.26172 13.5047 8.08887C13.5047 9.00911 13.2809 9.74674 12.8333 10.3018C12.3857 10.8532 11.7734 11.1289 10.9964 11.1289C10.2695 11.1289 9.71989 10.821 9.3475 10.2051ZM9.32601 7.98682V8.75488C9.32601 9.20964 9.47282 9.59635 9.76644 9.91504C10.0636 10.2301 10.4396 10.3877 10.8944 10.3877C11.4279 10.3877 11.8451 10.1836 12.1458 9.77539C12.4502 9.36719 12.6024 8.79964 12.6024 8.07275C12.6024 7.46045 12.4609 6.98063 12.1781 6.6333C11.8952 6.28597 11.512 6.1123 11.0286 6.1123C10.5166 6.1123 10.1048 6.29134 9.7933 6.64941C9.48177 7.00391 9.32601 7.44971 9.32601 7.98682Z" } }] }, { "tagName": "clipPath", "attrs": { "width": "16", "height": "16", "viewBox": "0 0 16 16", "fill": "currentColor", "id": "icon-eye" }, "children": [{ "tagName": "path", "attrs": { "d": "M7.99993 6.00316C9.47266 6.00316 10.6666 7.19708 10.6666 8.66981C10.6666 10.1426 9.47266 11.3365 7.99993 11.3365C6.52715 11.3365 5.33324 10.1426 5.33324 8.66981C5.33324 7.19708 6.52715 6.00316 7.99993 6.00316ZM7.99993 7.00315C7.07946 7.00315 6.33324 7.74935 6.33324 8.66981C6.33324 9.59028 7.07946 10.3365 7.99993 10.3365C8.9204 10.3365 9.6666 9.59028 9.6666 8.66981C9.6666 7.74935 8.9204 7.00315 7.99993 7.00315ZM7.99993 3.66675C11.0756 3.66675 13.7307 5.76675 14.4673 8.70968C14.5344 8.97755 14.3716 9.24908 14.1037 9.31615C13.8358 9.38315 13.5643 9.22041 13.4973 8.95248C12.8713 6.45205 10.6141 4.66675 7.99993 4.66675C5.38454 4.66675 3.12664 6.45359 2.50182 8.95555C2.43491 9.22341 2.16348 9.38635 1.89557 9.31948C1.62766 9.25255 1.46471 8.98115 1.53162 8.71321C2.26701 5.76856 4.9229 3.66675 7.99993 3.66675Z" } }] }, { "tagName": "clipPath", "attrs": { "width": "16", "height": "16", "viewBox": "0 0 16 16", "fill": "currentColor", "id": "icon-symbol-constant" }, "children": [{ "tagName": "path", "attrs": { "fill-rule": "evenodd", "clip-rule": "evenodd", "d": "M4 6h8v1H4V6zm8 3H4v1h8V9z" } }, { "tagName": "path", "attrs": { "fill-rule": "evenodd", "clip-rule": "evenodd", "d": "M1 4l1-1h12l1 1v8l-1 1H2l-1-1V4zm1 0v8h12V4H2z" } }] }, { "tagName": "clipPath", "attrs": { "width": "16", "height": "16", "viewBox": "0 0 16 16", "fill": "currentColor", "id": "icon-check" }, "children": [{ "tagName": "path", "attrs": { "fill-rule": "evenodd", "clip-rule": "evenodd", "d": "M14.431 3.323l-8.47 10-.79-.036-3.35-4.77.818-.574 2.978 4.24 8.051-9.506.764.646z" } }] }, { "tagName": "clipPath", "attrs": { "width": "16", "height": "16", "viewBox": "0 0 16 16", "fill": "currentColor", "id": "icon-close" }, "children": [{ "tagName": "path", "attrs": { "fill-rule": "evenodd", "clip-rule": "evenodd", "d": "M8 8.707l3.646 3.647.708-.707L8.707 8l3.647-3.646-.707-.708L8 7.293 4.354 3.646l-.707.708L7.293 8l-3.646 3.646.707.708L8 8.707z" } }] }, { "tagName": "clipPath", "attrs": { "width": "16", "height": "16", "viewBox": "0 0 16 16", "fill": "currentColor", "id": "icon-pass" }, "children": [{ "tagName": "path", "attrs": { "d": "M6.27 10.87h.71l4.56-4.56-.71-.71-4.2 4.21-1.92-1.92L4 8.6l2.27 2.27z" } }, { "tagName": "path", "attrs": { "fill-rule": "evenodd", "clip-rule": "evenodd", "d": "M8.6 1c1.6.1 3.1.9 4.2 2 1.3 1.4 2 3.1 2 5.1 0 1.6-.6 3.1-1.6 4.4-1 1.2-2.4 2.1-4 2.4-1.6.3-3.2.1-4.6-.7-1.4-.8-2.5-2-3.1-3.5C.9 9.2.8 7.5 1.3 6c.5-1.6 1.4-2.9 2.8-3.8C5.4 1.3 7 .9 8.6 1zm.5 12.9c1.3-.3 2.5-1 3.4-2.1.8-1.1 1.3-2.4 1.2-3.8 0-1.6-.6-3.2-1.7-4.3-1-1-2.2-1.6-3.6-1.7-1.3-.1-2.7.2-3.8 1-1.1.8-1.9 1.9-2.3 3.3-.4 1.3-.4 2.7.2 4 .6 1.3 1.5 2.3 2.7 3 1.2.7 2.6.9 3.9.6z" } }] }, { "tagName": "clipPath", "attrs": { "width": "16", "height": "16", "viewBox": "0 0 16 16", "fill": "currentColor", "id": "icon-gist" }, "children": [{ "tagName": "path", "attrs": { "fill-rule": "evenodd", "clip-rule": "evenodd", "d": "M10.57 1.14l3.28 3.3.15.36v9.7l-.5.5h-11l-.5-.5v-13l.5-.5h7.72l.35.14zM10 5h3l-3-3v3zM3 2v12h10V6H9.5L9 5.5V2H3zm2.062 7.533l1.817-1.828L6.17 7 4 9.179v.707l2.171 2.174.707-.707-1.816-1.82zM8.8 7.714l.7-.709 2.189 2.175v.709L9.5 12.062l-.705-.709 1.831-1.82L8.8 7.714z" } }] }] }] };\nvar clipPaths_default = svgJson;\n\n// packages/injected/src/recorder/recorder.ts\nvar HighlightColors = {\n  multiple: "#f6b26b7f",\n  single: "#6fa8dc7f",\n  assert: "#8acae480",\n  action: "#dc6f6f7f"\n};\nvar NoneTool = class {\n};\nvar InspectTool = class {\n  constructor(recorder, assertVisibility) {\n    this._hoveredModel = null;\n    this._hoveredElement = null;\n    this._recorder = recorder;\n    this._assertVisibility = assertVisibility;\n  }\n  cursor() {\n    return "pointer";\n  }\n  uninstall() {\n    this._hoveredModel = null;\n    this._hoveredElement = null;\n  }\n  onClick(event) {\n    var _a;\n    consumeEvent(event);\n    if (event.button !== 0)\n      return;\n    if ((_a = this._hoveredModel) == null ? void 0 : _a.selector)\n      this._commit(this._hoveredModel.selector, this._hoveredModel);\n  }\n  onPointerDown(event) {\n    consumeEvent(event);\n  }\n  onPointerUp(event) {\n    consumeEvent(event);\n  }\n  onMouseDown(event) {\n    consumeEvent(event);\n  }\n  onMouseUp(event) {\n    consumeEvent(event);\n  }\n  onMouseMove(event) {\n    var _a;\n    consumeEvent(event);\n    let target = this._recorder.deepEventTarget(event);\n    if (!target.isConnected)\n      target = null;\n    if (this._hoveredElement === target)\n      return;\n    this._hoveredElement = target;\n    let model = null;\n    if (this._hoveredElement) {\n      const generated = this._recorder.injectedScript.generateSelector(this._hoveredElement, { testIdAttributeName: this._recorder.state.testIdAttributeName, multiple: false });\n      model = {\n        selector: generated.selector,\n        elements: generated.elements,\n        tooltipText: this._recorder.injectedScript.utils.asLocator(this._recorder.state.language, generated.selector),\n        color: this._assertVisibility ? HighlightColors.assert : HighlightColors.single\n      };\n    }\n    if (((_a = this._hoveredModel) == null ? void 0 : _a.selector) === (model == null ? void 0 : model.selector))\n      return;\n    this._hoveredModel = model;\n    this._recorder.updateHighlight(model, true);\n  }\n  onMouseEnter(event) {\n    consumeEvent(event);\n  }\n  onMouseLeave(event) {\n    consumeEvent(event);\n    const window = this._recorder.injectedScript.window;\n    if (window.top !== window && this._recorder.deepEventTarget(event).nodeType === Node.DOCUMENT_NODE)\n      this._reset(true);\n  }\n  onKeyDown(event) {\n    consumeEvent(event);\n    if (event.key === "Escape") {\n      if (this._assertVisibility)\n        this._recorder.setMode("recording");\n    }\n  }\n  onKeyUp(event) {\n    consumeEvent(event);\n  }\n  onScroll(event) {\n    this._reset(false);\n  }\n  _commit(selector, model) {\n    var _a;\n    if (this._assertVisibility) {\n      void this._recorder.recordAction({\n        name: "assertVisible",\n        selector,\n        signals: []\n      });\n      this._recorder.setMode("recording");\n      (_a = this._recorder.overlay) == null ? void 0 : _a.flashToolSucceeded("assertingVisibility");\n    } else {\n      this._recorder.elementPicked(selector, model);\n    }\n  }\n  _reset(userGesture) {\n    this._hoveredElement = null;\n    this._hoveredModel = null;\n    this._recorder.updateHighlight(null, userGesture);\n  }\n};\nvar RecordActionTool = class {\n  constructor(recorder) {\n    this._hoveredModel = null;\n    this._hoveredElement = null;\n    this._activeModel = null;\n    this._expectProgrammaticKeyUp = false;\n    this._observer = null;\n    this._recorder = recorder;\n    this._performingActions = /* @__PURE__ */ new Set();\n    this._dialog = new Dialog(recorder);\n  }\n  cursor() {\n    return "pointer";\n  }\n  _installObserverIfNeeded() {\n    var _a;\n    if (this._observer)\n      return;\n    if (!((_a = this._recorder.injectedScript.document) == null ? void 0 : _a.body))\n      return;\n    this._observer = new MutationObserver((mutations) => {\n      if (!this._hoveredElement)\n        return;\n      for (const mutation of mutations) {\n        for (const node of mutation.removedNodes) {\n          if (node === this._hoveredElement || node.contains(this._hoveredElement))\n            this._resetHoveredModel();\n        }\n      }\n    });\n    this._observer.observe(this._recorder.injectedScript.document.body, { childList: true, subtree: true });\n  }\n  uninstall() {\n    var _a;\n    (_a = this._observer) == null ? void 0 : _a.disconnect();\n    this._observer = null;\n    this._hoveredModel = null;\n    this._hoveredElement = null;\n    this._activeModel = null;\n    this._expectProgrammaticKeyUp = false;\n    this._dialog.close();\n  }\n  onClick(event) {\n    if (this._dialog.isShowing()) {\n      if (event.button === 2 && event.type === "auxclick") {\n        consumeEvent(event);\n      }\n      return;\n    }\n    if (isRangeInput(this._hoveredElement))\n      return;\n    if (this._shouldIgnoreMouseEvent(event))\n      return;\n    if (this._actionInProgress(event))\n      return;\n    if (this._consumedDueToNoModel(event, this._hoveredModel))\n      return;\n    if (event.button === 2 && event.type === "auxclick") {\n      this._showActionListDialog(this._hoveredModel, event);\n      return;\n    }\n    const checkbox = asCheckbox(this._recorder.deepEventTarget(event));\n    if (checkbox && event.detail === 1) {\n      this._performAction({\n        name: checkbox.checked ? "check" : "uncheck",\n        selector: this._hoveredModel.selector,\n        signals: []\n      });\n      return;\n    }\n    this._cancelPendingClickAction();\n    if (event.detail === 1) {\n      this._pendingClickAction = {\n        action: {\n          name: "click",\n          selector: this._hoveredModel.selector,\n          position: positionForEvent(event),\n          signals: [],\n          button: buttonForEvent(event),\n          modifiers: modifiersForEvent(event),\n          clickCount: event.detail\n        },\n        timeout: this._recorder.injectedScript.utils.builtins.setTimeout(() => this._commitPendingClickAction(), 200)\n      };\n    }\n  }\n  onDblClick(event) {\n    if (this._dialog.isShowing())\n      return;\n    if (isRangeInput(this._hoveredElement))\n      return;\n    if (this._shouldIgnoreMouseEvent(event))\n      return;\n    if (this._actionInProgress(event))\n      return;\n    if (this._consumedDueToNoModel(event, this._hoveredModel))\n      return;\n    this._cancelPendingClickAction();\n    this._performAction({\n      name: "click",\n      selector: this._hoveredModel.selector,\n      position: positionForEvent(event),\n      signals: [],\n      button: buttonForEvent(event),\n      modifiers: modifiersForEvent(event),\n      clickCount: event.detail\n    });\n  }\n  _commitPendingClickAction() {\n    if (this._pendingClickAction)\n      this._performAction(this._pendingClickAction.action);\n    this._cancelPendingClickAction();\n  }\n  _cancelPendingClickAction() {\n    if (this._pendingClickAction)\n      this._recorder.injectedScript.utils.builtins.clearTimeout(this._pendingClickAction.timeout);\n    this._pendingClickAction = void 0;\n  }\n  onContextMenu(event) {\n    if (this._dialog.isShowing()) {\n      consumeEvent(event);\n      return;\n    }\n    if (this._shouldIgnoreMouseEvent(event))\n      return;\n    if (this._actionInProgress(event))\n      return;\n    if (this._consumedDueToNoModel(event, this._hoveredModel))\n      return;\n    this._showActionListDialog(this._hoveredModel, event);\n  }\n  onPointerDown(event) {\n    if (this._dialog.isShowing())\n      return;\n    if (this._shouldIgnoreMouseEvent(event))\n      return;\n    this._consumeWhenAboutToPerform(event);\n  }\n  onPointerUp(event) {\n    if (this._dialog.isShowing())\n      return;\n    if (this._shouldIgnoreMouseEvent(event))\n      return;\n    this._consumeWhenAboutToPerform(event);\n  }\n  onMouseDown(event) {\n    if (this._dialog.isShowing())\n      return;\n    if (this._shouldIgnoreMouseEvent(event))\n      return;\n    this._consumeWhenAboutToPerform(event);\n    this._activeModel = this._hoveredModel;\n  }\n  onMouseUp(event) {\n    if (this._dialog.isShowing())\n      return;\n    if (this._shouldIgnoreMouseEvent(event))\n      return;\n    this._consumeWhenAboutToPerform(event);\n  }\n  onMouseMove(event) {\n    if (this._dialog.isShowing())\n      return;\n    const target = this._recorder.deepEventTarget(event);\n    if (this._hoveredElement === target)\n      return;\n    this._hoveredElement = target;\n    this._updateModelForHoveredElement();\n  }\n  onMouseLeave(event) {\n    if (this._dialog.isShowing())\n      return;\n    const window = this._recorder.injectedScript.window;\n    if (window.top !== window && this._recorder.deepEventTarget(event).nodeType === Node.DOCUMENT_NODE) {\n      this._hoveredElement = null;\n      this._updateModelForHoveredElement();\n    }\n  }\n  onFocus(event) {\n    if (this._dialog.isShowing())\n      return;\n    this._onFocus(true);\n  }\n  onInput(event) {\n    if (this._dialog.isShowing())\n      return;\n    const target = this._recorder.deepEventTarget(event);\n    if (target.nodeName === "INPUT" && target.type.toLowerCase() === "file") {\n      const selector = target === this._hoveredElement ? this._hoveredModel.selector : this._recorder.injectedScript.generateSelector(target, { testIdAttributeName: this._recorder.state.testIdAttributeName }).selector;\n      this._recordAction({\n        name: "setInputFiles",\n        selector,\n        signals: [],\n        files: [...target.files || []].map((file) => file.name)\n      });\n      return;\n    }\n    if (isRangeInput(target)) {\n      this._recordAction({\n        name: "fill",\n        // must use hoveredModel instead of activeModel for it to work in webkit\n        selector: this._hoveredModel.selector,\n        signals: [],\n        text: target.value\n      });\n      return;\n    }\n    if (["INPUT", "TEXTAREA"].includes(target.nodeName) || target.isContentEditable) {\n      if (target.nodeName === "INPUT" && ["checkbox", "radio"].includes(target.type.toLowerCase())) {\n        return;\n      }\n      if (this._consumedDueWrongTarget(event))\n        return;\n      this._recordAction({\n        name: "fill",\n        selector: this._activeModel.selector,\n        signals: [],\n        text: target.isContentEditable ? target.innerText : target.value\n      });\n    }\n    if (target.nodeName === "SELECT") {\n      const selectElement = target;\n      this._recordAction({\n        name: "select",\n        selector: this._activeModel.selector,\n        options: [...selectElement.selectedOptions].map((option) => option.value),\n        signals: []\n      });\n    }\n  }\n  onKeyDown(event) {\n    if (this._dialog.isShowing())\n      return;\n    if (!this._shouldGenerateKeyPressFor(event))\n      return;\n    if (this._actionInProgress(event)) {\n      this._expectProgrammaticKeyUp = true;\n      return;\n    }\n    if (this._consumedDueWrongTarget(event))\n      return;\n    if (event.key === " ") {\n      const checkbox = asCheckbox(this._recorder.deepEventTarget(event));\n      if (checkbox && event.detail === 0) {\n        this._performAction({\n          name: checkbox.checked ? "uncheck" : "check",\n          selector: this._activeModel.selector,\n          signals: []\n        });\n        return;\n      }\n    }\n    this._performAction({\n      name: "press",\n      selector: this._activeModel.selector,\n      signals: [],\n      key: event.key,\n      modifiers: modifiersForEvent(event)\n    });\n  }\n  onKeyUp(event) {\n    if (this._dialog.isShowing())\n      return;\n    if (!this._shouldGenerateKeyPressFor(event))\n      return;\n    if (!this._expectProgrammaticKeyUp) {\n      consumeEvent(event);\n      return;\n    }\n    this._expectProgrammaticKeyUp = false;\n  }\n  onScroll(event) {\n    if (this._dialog.isShowing())\n      return;\n    this._resetHoveredModel();\n  }\n  _showActionListDialog(model, event) {\n    consumeEvent(event);\n    const actionPosition = positionForEvent(event);\n    const actions = [\n      {\n        title: "Click",\n        cb: () => this._performAction({\n          name: "click",\n          selector: model.selector,\n          position: actionPosition,\n          signals: [],\n          button: "left",\n          modifiers: 0,\n          clickCount: 0\n        })\n      },\n      {\n        title: "Right click",\n        cb: () => this._performAction({\n          name: "click",\n          selector: model.selector,\n          position: actionPosition,\n          signals: [],\n          button: "right",\n          modifiers: 0,\n          clickCount: 0\n        })\n      },\n      {\n        title: "Double click",\n        cb: () => this._performAction({\n          name: "click",\n          selector: model.selector,\n          position: actionPosition,\n          signals: [],\n          button: "left",\n          modifiers: 0,\n          clickCount: 2\n        })\n      },\n      {\n        title: "Hover",\n        cb: () => this._performAction({\n          name: "hover",\n          selector: model.selector,\n          position: actionPosition,\n          signals: []\n        })\n      },\n      {\n        title: "Pick locator",\n        cb: () => this._recorder.elementPicked(model.selector, model)\n      }\n    ];\n    const listElement = this._recorder.document.createElement("x-pw-action-list");\n    listElement.setAttribute("role", "list");\n    listElement.setAttribute("aria-label", "Choose action");\n    for (const action of actions) {\n      const actionElement = this._recorder.document.createElement("x-pw-action-item");\n      actionElement.setAttribute("role", "listitem");\n      actionElement.textContent = action.title;\n      actionElement.setAttribute("aria-label", action.title);\n      actionElement.addEventListener("click", () => {\n        this._dialog.close();\n        action.cb();\n      });\n      listElement.appendChild(actionElement);\n    }\n    const dialogElement = this._dialog.show({\n      label: "Choose action",\n      body: listElement,\n      autosize: true\n    });\n    const anchorBox = this._recorder.highlight.firstTooltipBox() || model.elements[0].getBoundingClientRect();\n    const dialogPosition = this._recorder.highlight.tooltipPosition(anchorBox, dialogElement);\n    this._dialog.moveTo(dialogPosition.anchorTop, dialogPosition.anchorLeft);\n  }\n  _resetHoveredModel() {\n    this._hoveredModel = null;\n    this._hoveredElement = null;\n    this._updateHighlight(false);\n  }\n  _onFocus(userGesture) {\n    const activeElement = deepActiveElement(this._recorder.document);\n    if (userGesture && activeElement === this._recorder.document.body)\n      return;\n    const result = activeElement ? this._recorder.injectedScript.generateSelector(activeElement, { testIdAttributeName: this._recorder.state.testIdAttributeName }) : null;\n    this._activeModel = result && result.selector ? { ...result, color: HighlightColors.action } : null;\n    if (userGesture) {\n      this._hoveredElement = activeElement;\n      this._updateModelForHoveredElement();\n    }\n  }\n  _shouldIgnoreMouseEvent(event) {\n    return shouldIgnoreMouseEvent(this._recorder.deepEventTarget(event));\n  }\n  _actionInProgress(event) {\n    const isKeyEvent = event instanceof KeyboardEvent;\n    const isMouseOrPointerEvent = event instanceof MouseEvent || event instanceof PointerEvent;\n    for (const action of this._performingActions) {\n      if (isKeyEvent && action.name === "press" && event.key === action.key)\n        return true;\n      if (isMouseOrPointerEvent && (action.name === "click" || action.name === "hover" || action.name === "check" || action.name === "uncheck"))\n        return true;\n    }\n    consumeEvent(event);\n    return false;\n  }\n  _consumedDueToNoModel(event, model) {\n    if (model)\n      return false;\n    consumeEvent(event);\n    return true;\n  }\n  _consumedDueWrongTarget(event) {\n    if (this._activeModel && this._activeModel.elements[0] === this._recorder.deepEventTarget(event))\n      return false;\n    consumeEvent(event);\n    return true;\n  }\n  _consumeWhenAboutToPerform(event) {\n    if (!this._performingActions.size)\n      consumeEvent(event);\n  }\n  _reportPerformedActionForTests() {\n    if (!this._recorder.injectedScript.isUnderTest)\n      return;\n    console.error("Action performed for test: " + JSON.stringify({\n      // eslint-disable-line no-console\n      hovered: this._hoveredModel ? this._hoveredModel.selector : null,\n      active: this._activeModel ? this._activeModel.selector : null\n    }));\n  }\n  _recordAction(action) {\n    void this._recorder.recordAction(action).then(() => this._reportPerformedActionForTests());\n  }\n  _performAction(action) {\n    this._recorder.updateHighlight(null, false);\n    this._performingActions.add(action);\n    void this._recorder.performAction(action).finally(() => {\n      this._performingActions.delete(action);\n      this._onFocus(false);\n    }).then(() => this._reportPerformedActionForTests());\n  }\n  _shouldGenerateKeyPressFor(event) {\n    if (typeof event.key !== "string")\n      return false;\n    if (event.key === "Enter" && (this._recorder.deepEventTarget(event).nodeName === "TEXTAREA" || this._recorder.deepEventTarget(event).isContentEditable))\n      return false;\n    if (["Backspace", "Delete", "AltGraph"].includes(event.key))\n      return false;\n    if (event.key === "@" && event.code === "KeyL")\n      return false;\n    if (navigator.platform.includes("Mac")) {\n      if (event.key === "v" && event.metaKey)\n        return false;\n    } else {\n      if (event.key === "v" && event.ctrlKey)\n        return false;\n      if (event.key === "Insert" && event.shiftKey)\n        return false;\n    }\n    if (["Shift", "Control", "Meta", "Alt", "Process"].includes(event.key))\n      return false;\n    const hasModifier = event.ctrlKey || event.altKey || event.metaKey;\n    if (event.key.length === 1 && !hasModifier)\n      return !!asCheckbox(this._recorder.deepEventTarget(event));\n    return true;\n  }\n  _updateModelForHoveredElement() {\n    this._installObserverIfNeeded();\n    if (this._performingActions.size)\n      return;\n    if (!this._hoveredElement || !this._hoveredElement.isConnected) {\n      this._hoveredModel = null;\n      this._hoveredElement = null;\n      this._updateHighlight(true);\n      return;\n    }\n    const { selector, elements } = this._recorder.injectedScript.generateSelector(this._hoveredElement, { testIdAttributeName: this._recorder.state.testIdAttributeName });\n    if (this._hoveredModel && this._hoveredModel.selector === selector)\n      return;\n    this._hoveredModel = selector ? { selector, elements, color: HighlightColors.action } : null;\n    this._updateHighlight(true);\n  }\n  _updateHighlight(userGesture) {\n    this._recorder.updateHighlight(this._hoveredModel, userGesture);\n  }\n};\nvar JsonRecordActionTool = class {\n  constructor(recorder) {\n    this._recorder = recorder;\n  }\n  install() {\n    this._recorder.highlight.uninstall();\n  }\n  uninstall() {\n    this._recorder.highlight.install();\n  }\n  onClick(event) {\n    const element = this._recorder.deepEventTarget(event);\n    if (isRangeInput(element))\n      return;\n    if (event.button === 2 && event.type === "auxclick")\n      return;\n    if (this._shouldIgnoreMouseEvent(event))\n      return;\n    const checkbox = asCheckbox(element);\n    const { ariaSnapshot, selector, ref } = this._ariaSnapshot(element);\n    if (checkbox && event.detail === 1) {\n      void this._recorder.recordAction({\n        name: checkbox.checked ? "check" : "uncheck",\n        selector,\n        ref,\n        signals: [],\n        ariaSnapshot\n      });\n      return;\n    }\n    void this._recorder.recordAction({\n      name: "click",\n      selector,\n      ref,\n      ariaSnapshot,\n      position: positionForEvent(event),\n      signals: [],\n      button: buttonForEvent(event),\n      modifiers: modifiersForEvent(event),\n      clickCount: event.detail\n    });\n  }\n  onContextMenu(event) {\n    const element = this._recorder.deepEventTarget(event);\n    const { ariaSnapshot, selector, ref } = this._ariaSnapshot(element);\n    void this._recorder.recordAction({\n      name: "click",\n      selector,\n      ref,\n      ariaSnapshot,\n      position: positionForEvent(event),\n      signals: [],\n      button: "right",\n      modifiers: modifiersForEvent(event),\n      clickCount: 1\n    });\n  }\n  onInput(event) {\n    const element = this._recorder.deepEventTarget(event);\n    const { ariaSnapshot, selector, ref } = this._ariaSnapshot(element);\n    if (isRangeInput(element)) {\n      void this._recorder.recordAction({\n        name: "fill",\n        selector,\n        ref,\n        ariaSnapshot,\n        signals: [],\n        text: element.value\n      });\n      return;\n    }\n    if (["INPUT", "TEXTAREA"].includes(element.nodeName) || element.isContentEditable) {\n      if (element.nodeName === "INPUT" && ["checkbox", "radio"].includes(element.type.toLowerCase())) {\n        return;\n      }\n      void this._recorder.recordAction({\n        name: "fill",\n        ref,\n        selector,\n        ariaSnapshot,\n        signals: [],\n        text: element.isContentEditable ? element.innerText : element.value\n      });\n      return;\n    }\n    if (element.nodeName === "SELECT") {\n      const selectElement = element;\n      void this._recorder.recordAction({\n        name: "select",\n        selector,\n        ref,\n        ariaSnapshot,\n        options: [...selectElement.selectedOptions].map((option) => option.value),\n        signals: []\n      });\n      return;\n    }\n  }\n  onKeyDown(event) {\n    if (!this._shouldGenerateKeyPressFor(event))\n      return;\n    const element = this._recorder.deepEventTarget(event);\n    const { ariaSnapshot, selector, ref } = this._ariaSnapshot(element);\n    if (event.key === " ") {\n      const checkbox = asCheckbox(element);\n      if (checkbox && event.detail === 0) {\n        void this._recorder.recordAction({\n          name: checkbox.checked ? "uncheck" : "check",\n          selector,\n          ref,\n          ariaSnapshot,\n          signals: []\n        });\n        return;\n      }\n    }\n    void this._recorder.recordAction({\n      name: "press",\n      selector,\n      ref,\n      ariaSnapshot,\n      signals: [],\n      key: event.key,\n      modifiers: modifiersForEvent(event)\n    });\n  }\n  _shouldIgnoreMouseEvent(event) {\n    return shouldIgnoreMouseEvent(this._recorder.deepEventTarget(event));\n  }\n  _shouldGenerateKeyPressFor(event) {\n    if (typeof event.key !== "string")\n      return false;\n    if (event.key === "Enter" && (this._recorder.deepEventTarget(event).nodeName === "TEXTAREA" || this._recorder.deepEventTarget(event).isContentEditable))\n      return false;\n    if (["Backspace", "Delete", "AltGraph"].includes(event.key))\n      return false;\n    if (event.key === "@" && event.code === "KeyL")\n      return false;\n    if (navigator.platform.includes("Mac")) {\n      if (event.key === "v" && event.metaKey)\n        return false;\n    } else {\n      if (event.key === "v" && event.ctrlKey)\n        return false;\n      if (event.key === "Insert" && event.shiftKey)\n        return false;\n    }\n    if (["Shift", "Control", "Meta", "Alt", "Process"].includes(event.key))\n      return false;\n    const hasModifier = event.ctrlKey || event.altKey || event.metaKey;\n    if (event.key.length === 1 && !hasModifier)\n      return !this._isEditable(this._recorder.deepEventTarget(event));\n    return true;\n  }\n  _isEditable(element) {\n    if (element.nodeName === "TEXTAREA" || element.nodeName === "INPUT")\n      return true;\n    if (element.isContentEditable)\n      return true;\n    return false;\n  }\n  _ariaSnapshot(element) {\n    const { ariaSnapshot, refs } = this._recorder.injectedScript.ariaSnapshotForRecorder();\n    const ref = element ? refs.get(element) : void 0;\n    const elementInfo = element ? this._recorder.injectedScript.generateSelector(element, { testIdAttributeName: this._recorder.state.testIdAttributeName }) : void 0;\n    return { ariaSnapshot, selector: elementInfo == null ? void 0 : elementInfo.selector, ref };\n  }\n};\nvar TextAssertionTool = class {\n  constructor(recorder, kind) {\n    this._hoverHighlight = null;\n    this._action = null;\n    this._recorder = recorder;\n    this._textCache = /* @__PURE__ */ new Map();\n    this._kind = kind;\n    this._dialog = new Dialog(recorder);\n  }\n  cursor() {\n    return "pointer";\n  }\n  uninstall() {\n    this._dialog.close();\n    this._hoverHighlight = null;\n  }\n  onClick(event) {\n    consumeEvent(event);\n    if (this._kind === "value") {\n      this._commitAssertValue();\n    } else {\n      if (!this._dialog.isShowing())\n        this._showDialog();\n    }\n  }\n  onMouseDown(event) {\n    const target = this._recorder.deepEventTarget(event);\n    if (this._elementHasValue(target))\n      event.preventDefault();\n  }\n  onPointerUp(event) {\n    var _a;\n    const target = (_a = this._hoverHighlight) == null ? void 0 : _a.elements[0];\n    if (this._kind === "value" && target && (target.nodeName === "INPUT" || target.nodeName === "SELECT") && target.disabled) {\n      this._commitAssertValue();\n    }\n  }\n  onMouseMove(event) {\n    var _a;\n    if (this._dialog.isShowing())\n      return;\n    const target = this._recorder.deepEventTarget(event);\n    if (((_a = this._hoverHighlight) == null ? void 0 : _a.elements[0]) === target)\n      return;\n    if (this._kind === "text" || this._kind === "snapshot") {\n      this._hoverHighlight = this._recorder.injectedScript.utils.elementText(this._textCache, target).full ? { elements: [target], selector: "", color: HighlightColors.assert } : null;\n    } else if (this._elementHasValue(target)) {\n      const generated = this._recorder.injectedScript.generateSelector(target, { testIdAttributeName: this._recorder.state.testIdAttributeName });\n      this._hoverHighlight = { selector: generated.selector, elements: generated.elements, color: HighlightColors.assert };\n    } else {\n      this._hoverHighlight = null;\n    }\n    this._recorder.updateHighlight(this._hoverHighlight, true);\n  }\n  onKeyDown(event) {\n    if (event.key === "Escape")\n      this._recorder.setMode("recording");\n    consumeEvent(event);\n  }\n  onScroll(event) {\n    this._recorder.updateHighlight(this._hoverHighlight, false);\n  }\n  _elementHasValue(element) {\n    return element.nodeName === "TEXTAREA" || element.nodeName === "SELECT" || element.nodeName === "INPUT" && !["button", "image", "reset", "submit"].includes(element.type);\n  }\n  _generateAction() {\n    var _a;\n    this._textCache.clear();\n    const target = (_a = this._hoverHighlight) == null ? void 0 : _a.elements[0];\n    if (!target)\n      return null;\n    if (this._kind === "value") {\n      if (!this._elementHasValue(target))\n        return null;\n      const { selector } = this._recorder.injectedScript.generateSelector(target, { testIdAttributeName: this._recorder.state.testIdAttributeName });\n      if (target.nodeName === "INPUT" && ["checkbox", "radio"].includes(target.type.toLowerCase())) {\n        return {\n          name: "assertChecked",\n          selector,\n          signals: [],\n          // Interestingly, inputElement.checked is reversed inside this event handler.\n          checked: !target.checked\n        };\n      } else {\n        return {\n          name: "assertValue",\n          selector,\n          signals: [],\n          value: target.value\n        };\n      }\n    } else if (this._kind === "snapshot") {\n      const generated = this._recorder.injectedScript.generateSelector(target, { testIdAttributeName: this._recorder.state.testIdAttributeName, forTextExpect: true });\n      this._hoverHighlight = { selector: generated.selector, elements: generated.elements, color: HighlightColors.assert };\n      this._recorder.updateHighlight(this._hoverHighlight, true);\n      return {\n        name: "assertSnapshot",\n        selector: this._hoverHighlight.selector,\n        signals: [],\n        ariaSnapshot: this._recorder.injectedScript.ariaSnapshot(target, { mode: "codegen" })\n      };\n    } else {\n      const generated = this._recorder.injectedScript.generateSelector(target, { testIdAttributeName: this._recorder.state.testIdAttributeName, forTextExpect: true });\n      this._hoverHighlight = { selector: generated.selector, elements: generated.elements, color: HighlightColors.assert };\n      this._recorder.updateHighlight(this._hoverHighlight, true);\n      return {\n        name: "assertText",\n        selector: this._hoverHighlight.selector,\n        signals: [],\n        text: this._recorder.injectedScript.utils.elementText(this._textCache, target).normalized,\n        substring: true\n      };\n    }\n  }\n  _renderValue(action) {\n    if ((action == null ? void 0 : action.name) === "assertText")\n      return this._recorder.injectedScript.utils.normalizeWhiteSpace(action.text);\n    if ((action == null ? void 0 : action.name) === "assertChecked")\n      return String(action.checked);\n    if ((action == null ? void 0 : action.name) === "assertValue")\n      return action.value;\n    if ((action == null ? void 0 : action.name) === "assertSnapshot")\n      return action.ariaSnapshot;\n    return "";\n  }\n  _commit() {\n    if (!this._action || !this._dialog.isShowing())\n      return;\n    this._dialog.close();\n    void this._recorder.recordAction(this._action);\n    this._recorder.setMode("recording");\n  }\n  _showDialog() {\n    var _a, _b, _c, _d;\n    if (!((_a = this._hoverHighlight) == null ? void 0 : _a.elements[0]))\n      return;\n    this._action = this._generateAction();\n    if (((_b = this._action) == null ? void 0 : _b.name) === "assertText") {\n      this._showTextDialog(this._action);\n    } else if (((_c = this._action) == null ? void 0 : _c.name) === "assertSnapshot") {\n      void this._recorder.recordAction(this._action);\n      this._recorder.setMode("recording");\n      (_d = this._recorder.overlay) == null ? void 0 : _d.flashToolSucceeded("assertingSnapshot");\n    }\n  }\n  _showTextDialog(action) {\n    const textElement = this._recorder.document.createElement("textarea");\n    textElement.setAttribute("spellcheck", "false");\n    textElement.value = this._renderValue(action);\n    textElement.classList.add("text-editor");\n    const updateAndValidate = () => {\n      var _a;\n      const newValue = this._recorder.injectedScript.utils.normalizeWhiteSpace(textElement.value);\n      const target = (_a = this._hoverHighlight) == null ? void 0 : _a.elements[0];\n      if (!target)\n        return;\n      action.text = newValue;\n      const targetText = this._recorder.injectedScript.utils.elementText(this._textCache, target).normalized;\n      const matches = newValue && targetText.includes(newValue);\n      textElement.classList.toggle("does-not-match", !matches);\n    };\n    textElement.addEventListener("input", updateAndValidate);\n    const label = "Assert that element contains text";\n    const dialogElement = this._dialog.show({\n      label,\n      body: textElement,\n      onCommit: () => this._commit()\n    });\n    const position = this._recorder.highlight.tooltipPosition(this._recorder.highlight.firstBox(), dialogElement);\n    this._dialog.moveTo(position.anchorTop, position.anchorLeft);\n    textElement.focus();\n  }\n  _commitAssertValue() {\n    var _a;\n    if (this._kind !== "value")\n      return;\n    const action = this._generateAction();\n    if (!action)\n      return;\n    void this._recorder.recordAction(action);\n    this._recorder.setMode("recording");\n    (_a = this._recorder.overlay) == null ? void 0 : _a.flashToolSucceeded("assertingValue");\n  }\n};\nvar Overlay = class {\n  constructor(recorder) {\n    this._listeners = [];\n    this._offsetX = 0;\n    this._measure = { width: 0, height: 0 };\n    this._recorder = recorder;\n    const document = this._recorder.document;\n    this._overlayElement = document.createElement("x-pw-overlay");\n    const toolsListElement = document.createElement("x-pw-tools-list");\n    this._overlayElement.appendChild(toolsListElement);\n    this._dragHandle = document.createElement("x-pw-tool-gripper");\n    this._dragHandle.appendChild(document.createElement("x-div"));\n    toolsListElement.appendChild(this._dragHandle);\n    this._recordToggle = this._recorder.document.createElement("x-pw-tool-item");\n    this._recordToggle.title = "Record";\n    this._recordToggle.classList.add("record");\n    this._recordToggle.appendChild(this._recorder.document.createElement("x-div"));\n    toolsListElement.appendChild(this._recordToggle);\n    this._pickLocatorToggle = this._recorder.document.createElement("x-pw-tool-item");\n    this._pickLocatorToggle.title = "Pick locator";\n    this._pickLocatorToggle.classList.add("pick-locator");\n    this._pickLocatorToggle.appendChild(this._recorder.document.createElement("x-div"));\n    toolsListElement.appendChild(this._pickLocatorToggle);\n    this._assertVisibilityToggle = this._recorder.document.createElement("x-pw-tool-item");\n    this._assertVisibilityToggle.title = "Assert visibility";\n    this._assertVisibilityToggle.classList.add("visibility");\n    this._assertVisibilityToggle.appendChild(this._recorder.document.createElement("x-div"));\n    toolsListElement.appendChild(this._assertVisibilityToggle);\n    this._assertTextToggle = this._recorder.document.createElement("x-pw-tool-item");\n    this._assertTextToggle.title = "Assert text";\n    this._assertTextToggle.classList.add("text");\n    this._assertTextToggle.appendChild(this._recorder.document.createElement("x-div"));\n    toolsListElement.appendChild(this._assertTextToggle);\n    this._assertValuesToggle = this._recorder.document.createElement("x-pw-tool-item");\n    this._assertValuesToggle.title = "Assert value";\n    this._assertValuesToggle.classList.add("value");\n    this._assertValuesToggle.appendChild(this._recorder.document.createElement("x-div"));\n    toolsListElement.appendChild(this._assertValuesToggle);\n    this._assertSnapshotToggle = this._recorder.document.createElement("x-pw-tool-item");\n    this._assertSnapshotToggle.title = "Assert snapshot";\n    this._assertSnapshotToggle.classList.add("snapshot");\n    this._assertSnapshotToggle.appendChild(this._recorder.document.createElement("x-div"));\n    toolsListElement.appendChild(this._assertSnapshotToggle);\n    this._updateVisualPosition();\n    this._refreshListeners();\n  }\n  _refreshListeners() {\n    removeEventListeners(this._listeners);\n    this._listeners = [\n      addEventListener(this._dragHandle, "mousedown", (event) => {\n        this._dragState = { offsetX: this._offsetX, dragStart: { x: event.clientX, y: 0 } };\n      }),\n      addEventListener(this._recordToggle, "click", () => {\n        if (this._recordToggle.classList.contains("disabled"))\n          return;\n        this._recorder.setMode(this._recorder.state.mode === "none" || this._recorder.state.mode === "standby" || this._recorder.state.mode === "inspecting" ? "recording" : "standby");\n      }),\n      addEventListener(this._pickLocatorToggle, "click", () => {\n        if (this._pickLocatorToggle.classList.contains("disabled"))\n          return;\n        const newMode = {\n          "inspecting": "standby",\n          "none": "inspecting",\n          "standby": "inspecting",\n          "recording": "recording-inspecting",\n          "recording-inspecting": "recording",\n          "assertingText": "recording-inspecting",\n          "assertingVisibility": "recording-inspecting",\n          "assertingValue": "recording-inspecting",\n          "assertingSnapshot": "recording-inspecting"\n        };\n        this._recorder.setMode(newMode[this._recorder.state.mode]);\n      }),\n      addEventListener(this._assertVisibilityToggle, "click", () => {\n        if (!this._assertVisibilityToggle.classList.contains("disabled"))\n          this._recorder.setMode(this._recorder.state.mode === "assertingVisibility" ? "recording" : "assertingVisibility");\n      }),\n      addEventListener(this._assertTextToggle, "click", () => {\n        if (!this._assertTextToggle.classList.contains("disabled"))\n          this._recorder.setMode(this._recorder.state.mode === "assertingText" ? "recording" : "assertingText");\n      }),\n      addEventListener(this._assertValuesToggle, "click", () => {\n        if (!this._assertValuesToggle.classList.contains("disabled"))\n          this._recorder.setMode(this._recorder.state.mode === "assertingValue" ? "recording" : "assertingValue");\n      }),\n      addEventListener(this._assertSnapshotToggle, "click", () => {\n        if (!this._assertSnapshotToggle.classList.contains("disabled"))\n          this._recorder.setMode(this._recorder.state.mode === "assertingSnapshot" ? "recording" : "assertingSnapshot");\n      })\n    ];\n  }\n  install() {\n    this._recorder.highlight.appendChild(this._overlayElement);\n    this._refreshListeners();\n    this._updateVisualPosition();\n  }\n  contains(element) {\n    return this._recorder.injectedScript.utils.isInsideScope(this._overlayElement, element);\n  }\n  setUIState(state) {\n    const isRecording = state.mode === "recording" || state.mode === "assertingText" || state.mode === "assertingVisibility" || state.mode === "assertingValue" || state.mode === "assertingSnapshot" || state.mode === "recording-inspecting";\n    this._recordToggle.classList.toggle("toggled", isRecording);\n    this._recordToggle.title = isRecording ? "Stop Recording" : "Start Recording";\n    this._pickLocatorToggle.classList.toggle("toggled", state.mode === "inspecting" || state.mode === "recording-inspecting");\n    this._assertVisibilityToggle.classList.toggle("toggled", state.mode === "assertingVisibility");\n    this._assertVisibilityToggle.classList.toggle("disabled", state.mode === "none" || state.mode === "standby" || state.mode === "inspecting");\n    this._assertTextToggle.classList.toggle("toggled", state.mode === "assertingText");\n    this._assertTextToggle.classList.toggle("disabled", state.mode === "none" || state.mode === "standby" || state.mode === "inspecting");\n    this._assertValuesToggle.classList.toggle("toggled", state.mode === "assertingValue");\n    this._assertValuesToggle.classList.toggle("disabled", state.mode === "none" || state.mode === "standby" || state.mode === "inspecting");\n    this._assertSnapshotToggle.classList.toggle("toggled", state.mode === "assertingSnapshot");\n    this._assertSnapshotToggle.classList.toggle("disabled", state.mode === "none" || state.mode === "standby" || state.mode === "inspecting");\n    if (this._offsetX !== state.overlay.offsetX) {\n      this._offsetX = state.overlay.offsetX;\n      this._updateVisualPosition();\n    }\n    if (state.mode === "none")\n      this._hideOverlay();\n    else\n      this._showOverlay();\n  }\n  flashToolSucceeded(tool) {\n    let element;\n    if (tool === "assertingVisibility")\n      element = this._assertVisibilityToggle;\n    else if (tool === "assertingSnapshot")\n      element = this._assertSnapshotToggle;\n    else\n      element = this._assertValuesToggle;\n    element.classList.add("succeeded");\n    this._recorder.injectedScript.utils.builtins.setTimeout(() => element.classList.remove("succeeded"), 2e3);\n  }\n  _hideOverlay() {\n    this._overlayElement.setAttribute("hidden", "true");\n  }\n  _showOverlay() {\n    if (!this._overlayElement.hasAttribute("hidden"))\n      return;\n    this._overlayElement.removeAttribute("hidden");\n    this._updateVisualPosition();\n  }\n  _updateVisualPosition() {\n    this._measure = this._overlayElement.getBoundingClientRect();\n    this._overlayElement.style.left = (this._recorder.injectedScript.window.innerWidth - this._measure.width) / 2 + this._offsetX + "px";\n  }\n  onMouseMove(event) {\n    if (!event.buttons) {\n      this._dragState = void 0;\n      return false;\n    }\n    if (this._dragState) {\n      this._offsetX = this._dragState.offsetX + event.clientX - this._dragState.dragStart.x;\n      const halfGapSize = (this._recorder.injectedScript.window.innerWidth - this._measure.width) / 2 - 10;\n      this._offsetX = Math.max(-halfGapSize, Math.min(halfGapSize, this._offsetX));\n      this._updateVisualPosition();\n      this._recorder.setOverlayState({ offsetX: this._offsetX });\n      consumeEvent(event);\n      return true;\n    }\n    return false;\n  }\n  onMouseUp(event) {\n    if (this._dragState) {\n      consumeEvent(event);\n      return true;\n    }\n    return false;\n  }\n  onClick(event) {\n    if (this._dragState) {\n      this._dragState = void 0;\n      consumeEvent(event);\n      return true;\n    }\n    return false;\n  }\n  onDblClick(event) {\n    return false;\n  }\n};\nvar Recorder = class {\n  constructor(injectedScript, options) {\n    this._listeners = [];\n    this._lastHighlightedSelector = void 0;\n    this._lastHighlightedAriaTemplateJSON = "undefined";\n    this.state = {\n      mode: "none",\n      testIdAttributeName: "data-testid",\n      language: "javascript",\n      overlay: { offsetX: 0 }\n    };\n    this._delegate = {};\n    var _a, _b;\n    this.document = injectedScript.document;\n    this.injectedScript = injectedScript;\n    this.highlight = injectedScript.createHighlight();\n    this._tools = {\n      "none": new NoneTool(),\n      "standby": new NoneTool(),\n      "inspecting": new InspectTool(this, false),\n      "recording": (options == null ? void 0 : options.recorderMode) === "api" ? new JsonRecordActionTool(this) : new RecordActionTool(this),\n      "recording-inspecting": new InspectTool(this, false),\n      "assertingText": new TextAssertionTool(this, "text"),\n      "assertingVisibility": new InspectTool(this, true),\n      "assertingValue": new TextAssertionTool(this, "value"),\n      "assertingSnapshot": new TextAssertionTool(this, "snapshot")\n    };\n    this._currentTool = this._tools.none;\n    (_b = (_a = this._currentTool).install) == null ? void 0 : _b.call(_a);\n    if (injectedScript.window.top === injectedScript.window && !(options == null ? void 0 : options.hideToolbar)) {\n      this.overlay = new Overlay(this);\n      this.overlay.setUIState(this.state);\n    }\n    this._stylesheet = new injectedScript.window.CSSStyleSheet();\n    this._stylesheet.replaceSync(`\n      body[data-pw-cursor=pointer] *, body[data-pw-cursor=pointer] *::after { cursor: pointer !important; }\n      body[data-pw-cursor=text] *, body[data-pw-cursor=text] *::after { cursor: text !important; }\n    `);\n    this.installListeners();\n    injectedScript.utils.cacheNormalizedWhitespaces();\n    if (injectedScript.isUnderTest)\n      console.error("Recorder script ready for test");\n    injectedScript.consoleApi.install();\n  }\n  installListeners() {\n    var _a, _b, _c;\n    removeEventListeners(this._listeners);\n    this._listeners = [\n      addEventListener(this.document, "click", (event) => this._onClick(event), true),\n      addEventListener(this.document, "auxclick", (event) => this._onClick(event), true),\n      addEventListener(this.document, "dblclick", (event) => this._onDblClick(event), true),\n      addEventListener(this.document, "contextmenu", (event) => this._onContextMenu(event), true),\n      addEventListener(this.document, "dragstart", (event) => this._onDragStart(event), true),\n      addEventListener(this.document, "input", (event) => this._onInput(event), true),\n      addEventListener(this.document, "keydown", (event) => this._onKeyDown(event), true),\n      addEventListener(this.document, "keyup", (event) => this._onKeyUp(event), true),\n      addEventListener(this.document, "pointerdown", (event) => this._onPointerDown(event), true),\n      addEventListener(this.document, "pointerup", (event) => this._onPointerUp(event), true),\n      addEventListener(this.document, "mousedown", (event) => this._onMouseDown(event), true),\n      addEventListener(this.document, "mouseup", (event) => this._onMouseUp(event), true),\n      addEventListener(this.document, "mousemove", (event) => this._onMouseMove(event), true),\n      addEventListener(this.document, "mouseleave", (event) => this._onMouseLeave(event), true),\n      addEventListener(this.document, "mouseenter", (event) => this._onMouseEnter(event), true),\n      addEventListener(this.document, "focus", (event) => this._onFocus(event), true),\n      addEventListener(this.document, "scroll", (event) => this._onScroll(event), true)\n    ];\n    this.highlight.install();\n    let recreationInterval;\n    const recreate = () => {\n      this.highlight.install();\n      recreationInterval = this.injectedScript.utils.builtins.setTimeout(recreate, 500);\n    };\n    recreationInterval = this.injectedScript.utils.builtins.setTimeout(recreate, 500);\n    this._listeners.push(() => this.injectedScript.utils.builtins.clearTimeout(recreationInterval));\n    this.highlight.appendChild(createSvgElement(this.document, clipPaths_default));\n    (_a = this.overlay) == null ? void 0 : _a.install();\n    (_c = (_b = this._currentTool) == null ? void 0 : _b.install) == null ? void 0 : _c.call(_b);\n    this.document.adoptedStyleSheets.push(this._stylesheet);\n  }\n  _switchCurrentTool() {\n    var _a, _b, _c, _d, _e, _f;\n    const newTool = this._tools[this.state.mode];\n    if (newTool === this._currentTool)\n      return;\n    (_b = (_a = this._currentTool).uninstall) == null ? void 0 : _b.call(_a);\n    this.clearHighlight();\n    this._currentTool = newTool;\n    (_d = (_c = this._currentTool).install) == null ? void 0 : _d.call(_c);\n    const cursor = (_e = newTool.cursor) == null ? void 0 : _e.call(newTool);\n    if (cursor)\n      (_f = this.injectedScript.document.body) == null ? void 0 : _f.setAttribute("data-pw-cursor", cursor);\n  }\n  setUIState(state, delegate) {\n    var _a;\n    this._delegate = delegate;\n    if (state.actionPoint && this.state.actionPoint && state.actionPoint.x === this.state.actionPoint.x && state.actionPoint.y === this.state.actionPoint.y) {\n    } else if (!state.actionPoint && !this.state.actionPoint) {\n    } else {\n      if (state.actionPoint)\n        this.highlight.showActionPoint(state.actionPoint.x, state.actionPoint.y);\n      else\n        this.highlight.hideActionPoint();\n    }\n    this.state = state;\n    this.highlight.setLanguage(state.language);\n    this._switchCurrentTool();\n    (_a = this.overlay) == null ? void 0 : _a.setUIState(state);\n    let highlight = "noop";\n    if (state.actionSelector !== this._lastHighlightedSelector) {\n      const entries = state.actionSelector ? entriesForSelectorHighlight(this.injectedScript, state.language, state.actionSelector, this.document) : null;\n      highlight = (entries == null ? void 0 : entries.length) ? entries : "clear";\n      this._lastHighlightedSelector = (entries == null ? void 0 : entries.length) ? state.actionSelector : void 0;\n    }\n    const ariaTemplateJSON = JSON.stringify(state.ariaTemplate);\n    if (this._lastHighlightedAriaTemplateJSON !== ariaTemplateJSON) {\n      const elements = state.ariaTemplate ? this.injectedScript.getAllElementsMatchingExpectAriaTemplate(this.document, state.ariaTemplate) : [];\n      if (elements.length) {\n        const color = elements.length > 1 ? HighlightColors.multiple : HighlightColors.single;\n        highlight = elements.map((element) => ({ element, color }));\n        this._lastHighlightedAriaTemplateJSON = ariaTemplateJSON;\n      } else {\n        if (!this._lastHighlightedSelector)\n          highlight = "clear";\n        this._lastHighlightedAriaTemplateJSON = "undefined";\n      }\n    }\n    if (highlight === "clear")\n      this.highlight.clearHighlight();\n    else if (highlight !== "noop")\n      this.highlight.updateHighlight(highlight);\n  }\n  clearHighlight() {\n    this.updateHighlight(null, false);\n  }\n  _onClick(event) {\n    var _a, _b, _c;\n    if (!event.isTrusted)\n      return;\n    if ((_a = this.overlay) == null ? void 0 : _a.onClick(event))\n      return;\n    if (this._ignoreOverlayEvent(event))\n      return;\n    (_c = (_b = this._currentTool).onClick) == null ? void 0 : _c.call(_b, event);\n  }\n  _onDblClick(event) {\n    var _a, _b, _c;\n    if (!event.isTrusted)\n      return;\n    if ((_a = this.overlay) == null ? void 0 : _a.onDblClick(event))\n      return;\n    if (this._ignoreOverlayEvent(event))\n      return;\n    (_c = (_b = this._currentTool).onDblClick) == null ? void 0 : _c.call(_b, event);\n  }\n  _onContextMenu(event) {\n    var _a, _b;\n    if (!event.isTrusted)\n      return;\n    (_b = (_a = this._currentTool).onContextMenu) == null ? void 0 : _b.call(_a, event);\n  }\n  _onDragStart(event) {\n    var _a, _b;\n    if (!event.isTrusted)\n      return;\n    if (this._ignoreOverlayEvent(event))\n      return;\n    (_b = (_a = this._currentTool).onDragStart) == null ? void 0 : _b.call(_a, event);\n  }\n  _onPointerDown(event) {\n    var _a, _b;\n    if (!event.isTrusted)\n      return;\n    if (this._ignoreOverlayEvent(event))\n      return;\n    (_b = (_a = this._currentTool).onPointerDown) == null ? void 0 : _b.call(_a, event);\n  }\n  _onPointerUp(event) {\n    var _a, _b;\n    if (!event.isTrusted)\n      return;\n    if (this._ignoreOverlayEvent(event))\n      return;\n    (_b = (_a = this._currentTool).onPointerUp) == null ? void 0 : _b.call(_a, event);\n  }\n  _onMouseDown(event) {\n    var _a, _b;\n    if (!event.isTrusted)\n      return;\n    if (this._ignoreOverlayEvent(event))\n      return;\n    (_b = (_a = this._currentTool).onMouseDown) == null ? void 0 : _b.call(_a, event);\n  }\n  _onMouseUp(event) {\n    var _a, _b, _c;\n    if (!event.isTrusted)\n      return;\n    if ((_a = this.overlay) == null ? void 0 : _a.onMouseUp(event))\n      return;\n    if (this._ignoreOverlayEvent(event))\n      return;\n    (_c = (_b = this._currentTool).onMouseUp) == null ? void 0 : _c.call(_b, event);\n  }\n  _onMouseMove(event) {\n    var _a, _b, _c;\n    if (!event.isTrusted)\n      return;\n    if ((_a = this.overlay) == null ? void 0 : _a.onMouseMove(event))\n      return;\n    if (this._ignoreOverlayEvent(event))\n      return;\n    (_c = (_b = this._currentTool).onMouseMove) == null ? void 0 : _c.call(_b, event);\n  }\n  _onMouseEnter(event) {\n    var _a, _b;\n    if (!event.isTrusted)\n      return;\n    if (this._ignoreOverlayEvent(event))\n      return;\n    (_b = (_a = this._currentTool).onMouseEnter) == null ? void 0 : _b.call(_a, event);\n  }\n  _onMouseLeave(event) {\n    var _a, _b;\n    if (!event.isTrusted)\n      return;\n    if (this._ignoreOverlayEvent(event))\n      return;\n    (_b = (_a = this._currentTool).onMouseLeave) == null ? void 0 : _b.call(_a, event);\n  }\n  _onFocus(event) {\n    var _a, _b;\n    if (!event.isTrusted)\n      return;\n    if (this._ignoreOverlayEvent(event))\n      return;\n    (_b = (_a = this._currentTool).onFocus) == null ? void 0 : _b.call(_a, event);\n  }\n  _onScroll(event) {\n    var _a, _b;\n    if (!event.isTrusted)\n      return;\n    this._lastHighlightedSelector = void 0;\n    this._lastHighlightedAriaTemplateJSON = "undefined";\n    this.highlight.hideActionPoint();\n    (_b = (_a = this._currentTool).onScroll) == null ? void 0 : _b.call(_a, event);\n  }\n  _onInput(event) {\n    var _a, _b;\n    if (this._ignoreOverlayEvent(event))\n      return;\n    (_b = (_a = this._currentTool).onInput) == null ? void 0 : _b.call(_a, event);\n  }\n  _onKeyDown(event) {\n    var _a, _b;\n    if (!event.isTrusted)\n      return;\n    if (this._ignoreOverlayEvent(event))\n      return;\n    (_b = (_a = this._currentTool).onKeyDown) == null ? void 0 : _b.call(_a, event);\n  }\n  _onKeyUp(event) {\n    var _a, _b;\n    if (!event.isTrusted)\n      return;\n    if (this._ignoreOverlayEvent(event))\n      return;\n    (_b = (_a = this._currentTool).onKeyUp) == null ? void 0 : _b.call(_a, event);\n  }\n  updateHighlight(model, userGesture) {\n    this._lastHighlightedSelector = void 0;\n    this._lastHighlightedAriaTemplateJSON = "undefined";\n    this._updateHighlight(model, userGesture);\n  }\n  _updateHighlight(model, userGesture) {\n    var _a, _b;\n    let tooltipText = model == null ? void 0 : model.tooltipText;\n    if (tooltipText === void 0 && (model == null ? void 0 : model.selector))\n      tooltipText = this.injectedScript.utils.asLocator(this.state.language, model.selector);\n    if (model)\n      this.highlight.updateHighlight(model.elements.map((element) => ({ element, color: model.color, tooltipText })));\n    else\n      this.highlight.clearHighlight();\n    if (userGesture)\n      (_b = (_a = this._delegate).highlightUpdated) == null ? void 0 : _b.call(_a);\n  }\n  _ignoreOverlayEvent(event) {\n    return event.composedPath().some((e) => {\n      const nodeName = e.nodeName || "";\n      return nodeName.toLowerCase() === "x-pw-glass";\n    });\n  }\n  deepEventTarget(event) {\n    var _a;\n    for (const element of event.composedPath()) {\n      if (!((_a = this.overlay) == null ? void 0 : _a.contains(element)))\n        return element;\n    }\n    return event.composedPath()[0];\n  }\n  setMode(mode) {\n    var _a, _b;\n    void ((_b = (_a = this._delegate).setMode) == null ? void 0 : _b.call(_a, mode));\n  }\n  _captureAutoExpectSnapshot() {\n    const documentElement = this.injectedScript.document.documentElement;\n    return documentElement ? this.injectedScript.utils.generateAriaTree(documentElement, { mode: "autoexpect" }) : void 0;\n  }\n  async performAction(action) {\n    var _a, _b, _c;\n    const previousSnapshot = this._lastActionAutoexpectSnapshot;\n    this._lastActionAutoexpectSnapshot = this._captureAutoExpectSnapshot();\n    if (!isAssertAction(action) && this._lastActionAutoexpectSnapshot) {\n      const element = this.injectedScript.utils.findNewElement(previousSnapshot == null ? void 0 : previousSnapshot.root, (_a = this._lastActionAutoexpectSnapshot) == null ? void 0 : _a.root);\n      action.preconditionSelector = element ? this.injectedScript.generateSelector(element, { testIdAttributeName: this.state.testIdAttributeName }).selector : void 0;\n      if (action.preconditionSelector === action.selector)\n        action.preconditionSelector = void 0;\n    }\n    await ((_c = (_b = this._delegate).performAction) == null ? void 0 : _c.call(_b, action).catch(() => {\n    }));\n  }\n  async recordAction(action) {\n    var _a, _b;\n    this._lastActionAutoexpectSnapshot = this._captureAutoExpectSnapshot();\n    await ((_b = (_a = this._delegate).recordAction) == null ? void 0 : _b.call(_a, action));\n  }\n  setOverlayState(state) {\n    var _a, _b;\n    void ((_b = (_a = this._delegate).setOverlayState) == null ? void 0 : _b.call(_a, state));\n  }\n  elementPicked(selector, model) {\n    var _a, _b;\n    const ariaSnapshot = this.injectedScript.ariaSnapshot(model.elements[0], { mode: "default" });\n    void ((_b = (_a = this._delegate).elementPicked) == null ? void 0 : _b.call(_a, { selector, ariaSnapshot }));\n  }\n};\nvar Dialog = class {\n  constructor(recorder) {\n    this._dialogElement = null;\n    this._recorder = recorder;\n  }\n  isShowing() {\n    return !!this._dialogElement;\n  }\n  show(options) {\n    const acceptButton = this._recorder.document.createElement("x-pw-tool-item");\n    acceptButton.title = "Accept";\n    acceptButton.classList.add("accept");\n    acceptButton.appendChild(this._recorder.document.createElement("x-div"));\n    acceptButton.addEventListener("click", () => {\n      var _a;\n      return (_a = options.onCommit) == null ? void 0 : _a.call(options);\n    });\n    const cancelButton = this._recorder.document.createElement("x-pw-tool-item");\n    cancelButton.title = "Close";\n    cancelButton.classList.add("cancel");\n    cancelButton.appendChild(this._recorder.document.createElement("x-div"));\n    cancelButton.addEventListener("click", () => {\n      var _a;\n      this.close();\n      (_a = options.onCancel) == null ? void 0 : _a.call(options);\n    });\n    this._dialogElement = this._recorder.document.createElement("x-pw-dialog");\n    if (options.autosize)\n      this._dialogElement.classList.add("autosize");\n    this._keyboardListener = (event) => {\n      var _a;\n      if (event.key === "Escape") {\n        this.close();\n        (_a = options.onCancel) == null ? void 0 : _a.call(options);\n        return;\n      }\n      if (options.onCommit && event.key === "Enter" && (event.ctrlKey || event.metaKey)) {\n        if (this._dialogElement)\n          options.onCommit();\n        return;\n      }\n    };\n    this._onGlassPaneClickHandler = (event) => {\n      var _a;\n      this.close();\n      (_a = options.onCancel) == null ? void 0 : _a.call(options);\n    };\n    this._dialogElement.addEventListener("click", (event) => event.stopPropagation());\n    const toolbarElement = this._recorder.document.createElement("x-pw-tools-list");\n    const labelElement = this._recorder.document.createElement("label");\n    labelElement.textContent = options.label;\n    toolbarElement.appendChild(labelElement);\n    toolbarElement.appendChild(this._recorder.document.createElement("x-spacer"));\n    if (options.onCommit)\n      toolbarElement.appendChild(acceptButton);\n    toolbarElement.appendChild(cancelButton);\n    this._dialogElement.appendChild(toolbarElement);\n    const bodyElement = this._recorder.document.createElement("x-pw-dialog-body");\n    bodyElement.appendChild(options.body);\n    this._dialogElement.appendChild(bodyElement);\n    this._recorder.highlight.appendChild(this._dialogElement);\n    this._recorder.highlight.onGlassPaneClick(this._onGlassPaneClickHandler);\n    this._recorder.document.addEventListener("keydown", this._keyboardListener, true);\n    return this._dialogElement;\n  }\n  moveTo(top, left) {\n    if (!this._dialogElement)\n      return;\n    this._dialogElement.style.top = top + "px";\n    this._dialogElement.style.left = left + "px";\n  }\n  close() {\n    if (!this._dialogElement)\n      return;\n    this._dialogElement.remove();\n    this._recorder.highlight.offGlassPaneClick(this._onGlassPaneClickHandler);\n    this._recorder.document.removeEventListener("keydown", this._keyboardListener);\n    this._dialogElement = null;\n  }\n};\nfunction deepActiveElement(document) {\n  let activeElement = document.activeElement;\n  while (activeElement && activeElement.shadowRoot && activeElement.shadowRoot.activeElement)\n    activeElement = activeElement.shadowRoot.activeElement;\n  return activeElement;\n}\nfunction modifiersForEvent(event) {\n  return (event.altKey ? 1 : 0) | (event.ctrlKey ? 2 : 0) | (event.metaKey ? 4 : 0) | (event.shiftKey ? 8 : 0);\n}\nfunction buttonForEvent(event) {\n  switch (event.which) {\n    case 1:\n      return "left";\n    case 2:\n      return "middle";\n    case 3:\n      return "right";\n  }\n  return "left";\n}\nfunction positionForEvent(event) {\n  const targetElement = event.target;\n  if (targetElement.nodeName !== "CANVAS")\n    return;\n  return {\n    x: event.offsetX,\n    y: event.offsetY\n  };\n}\nfunction consumeEvent(e) {\n  e.preventDefault();\n  e.stopPropagation();\n  e.stopImmediatePropagation();\n}\nfunction asCheckbox(node) {\n  if (!node || node.nodeName !== "INPUT")\n    return null;\n  const inputElement = node;\n  return ["checkbox", "radio"].includes(inputElement.type) ? inputElement : null;\n}\nfunction isRangeInput(node) {\n  if (!node || node.nodeName !== "INPUT")\n    return false;\n  const inputElement = node;\n  return inputElement.type.toLowerCase() === "range";\n}\nvar kNativePickerInputTypes = /* @__PURE__ */ new Set(["color", "date", "datetime-local", "file", "month", "range", "time", "week"]);\nfunction shouldIgnoreMouseEvent(target) {\n  const nodeName = target.nodeName;\n  if (nodeName === "SELECT" || nodeName === "OPTION")\n    return true;\n  if (nodeName === "INPUT" && kNativePickerInputTypes.has(target.type))\n    return true;\n  return false;\n}\nfunction addEventListener(target, eventName, listener, useCapture) {\n  target.addEventListener(eventName, listener, useCapture);\n  const remove = () => {\n    target.removeEventListener(eventName, listener, useCapture);\n  };\n  return remove;\n}\nfunction removeEventListeners(listeners) {\n  for (const listener of listeners)\n    listener();\n  listeners.splice(0, listeners.length);\n}\nfunction entriesForSelectorHighlight(injectedScript, language, selector, ownerDocument) {\n  try {\n    const parsedSelector = injectedScript.parseSelector(selector);\n    const elements = injectedScript.querySelectorAll(parsedSelector, ownerDocument);\n    const color = elements.length > 1 ? HighlightColors.multiple : HighlightColors.single;\n    const locator = injectedScript.utils.asLocator(language, selector);\n    return elements.map((element, index) => {\n      const suffix = elements.length > 1 ? ` [${index + 1} of ${elements.length}]` : "";\n      return { element, color, tooltipText: locator + suffix };\n    });\n  } catch (e) {\n    return [];\n  }\n}\nfunction createSvgElement(doc, { tagName, attrs, children }) {\n  const elem = doc.createElementNS("http://www.w3.org/2000/svg", tagName);\n  if (attrs) {\n    for (const [k, v] of Object.entries(attrs))\n      elem.setAttribute(k, v);\n  }\n  if (children) {\n    for (const c of children)\n      elem.appendChild(createSvgElement(doc, c));\n  }\n  return elem;\n}\nfunction isAssertAction(action) {\n  return action.name.startsWith("assert");\n}\n\n// packages/injected/src/recorder/pollingRecorder.ts\nvar PollingRecorder = class {\n  constructor(injectedScript, options) {\n    this._recorder = new Recorder(injectedScript, options);\n    this._embedder = injectedScript.window;\n    injectedScript.onGlobalListenersRemoved.add(() => this._recorder.installListeners());\n    const refreshOverlay = () => {\n      this._lastStateJSON = void 0;\n      this._pollRecorderMode().catch((e) => console.log(e));\n    };\n    this._embedder.__pw_refreshOverlay = refreshOverlay;\n    refreshOverlay();\n  }\n  async _pollRecorderMode() {\n    const pollPeriod = 1e3;\n    if (this._pollRecorderModeTimer)\n      this._recorder.injectedScript.utils.builtins.clearTimeout(this._pollRecorderModeTimer);\n    const state = await this._embedder.__pw_recorderState().catch(() => null);\n    if (!state) {\n      this._pollRecorderModeTimer = this._recorder.injectedScript.utils.builtins.setTimeout(() => this._pollRecorderMode(), pollPeriod);\n      return;\n    }\n    const stringifiedState = JSON.stringify(state);\n    if (this._lastStateJSON !== stringifiedState) {\n      this._lastStateJSON = stringifiedState;\n      const win = this._recorder.document.defaultView;\n      if (win.top !== win) {\n        state.actionPoint = void 0;\n      }\n      this._recorder.setUIState(state, this);\n    }\n    this._pollRecorderModeTimer = this._recorder.injectedScript.utils.builtins.setTimeout(() => this._pollRecorderMode(), pollPeriod);\n  }\n  async performAction(action) {\n    await this._embedder.__pw_recorderPerformAction(action);\n  }\n  async recordAction(action) {\n    await this._embedder.__pw_recorderRecordAction(action);\n  }\n  async elementPicked(elementInfo) {\n    await this._embedder.__pw_recorderElementPicked(elementInfo);\n  }\n  async setMode(mode) {\n    await this._embedder.__pw_recorderSetMode(mode);\n  }\n  async setOverlayState(state) {\n    await this._embedder.__pw_recorderSetOverlayState(state);\n  }\n};\nvar pollingRecorder_default = PollingRecorder;\n';
  }
});

// packages/playwright-core/src/server/recorder/recorderRunner.ts
async function performAction(progress2, pageAliases, actionInContext) {
  const mainFrame = mainFrameForAction(pageAliases, actionInContext);
  return await performActionImpl(progress2, mainFrame, actionInContext);
}
async function performActionImpl(progress2, mainFrame, actionInContext) {
  const { action } = actionInContext;
  if (action.name === "navigate") {
    await mainFrame.goto(progress2, action.url);
    return;
  }
  if (action.name === "openPage")
    throw Error("Not reached");
  if (action.name === "closePage") {
    await mainFrame._page.close(progress2);
    return;
  }
  const selector = buildFullSelector(actionInContext.frame.framePath, action.selector);
  if (action.name === "click") {
    const options = toClickOptions(action);
    await mainFrame.click(progress2, selector, { ...options, strict: true });
    return;
  }
  if (action.name === "hover") {
    await mainFrame.hover(progress2, selector, { position: action.position, strict: true });
    return;
  }
  if (action.name === "press") {
    const modifiers = toKeyboardModifiers(action.modifiers);
    const shortcut = [...modifiers, action.key].join("+");
    await mainFrame.press(progress2, selector, shortcut, { strict: true });
    return;
  }
  if (action.name === "fill") {
    await mainFrame.fill(progress2, selector, action.text, { strict: true });
    return;
  }
  if (action.name === "setInputFiles") {
    await mainFrame.setInputFiles(progress2, selector, { selector, payloads: [], strict: true });
    return;
  }
  if (action.name === "check") {
    await mainFrame.check(progress2, selector, { strict: true });
    return;
  }
  if (action.name === "uncheck") {
    await mainFrame.uncheck(progress2, selector, { strict: true });
    return;
  }
  if (action.name === "select") {
    const values = action.options.map((value2) => ({ value: value2 }));
    await mainFrame.selectOption(progress2, selector, [], values, { strict: true });
    return;
  }
  if (action.name === "assertChecked") {
    await mainFrame.expect(progress2, selector, {
      selector,
      expression: "to.be.checked",
      expectedValue: { checked: action.checked },
      isNot: !action.checked
    });
    return;
  }
  if (action.name === "assertText") {
    await mainFrame.expect(progress2, selector, {
      selector,
      expression: "to.have.text",
      expectedText: serializeExpectedTextValues([action.text], { matchSubstring: true, normalizeWhiteSpace: true }),
      isNot: false
    });
    return;
  }
  if (action.name === "assertValue") {
    await mainFrame.expect(progress2, selector, {
      selector,
      expression: "to.have.value",
      expectedValue: action.value,
      isNot: false
    });
    return;
  }
  if (action.name === "assertVisible") {
    await mainFrame.expect(progress2, selector, {
      selector,
      expression: "to.be.visible",
      isNot: false
    });
    return;
  }
  throw new Error("Internal error: unexpected action " + action.name);
}
function toClickOptions(action) {
  const modifiers = toKeyboardModifiers(action.modifiers);
  const options = {};
  if (action.button !== "left")
    options.button = action.button;
  if (modifiers.length)
    options.modifiers = modifiers;
  if (action.clickCount > 1)
    options.clickCount = action.clickCount;
  if (action.position)
    options.position = action.position;
  return options;
}
var init_recorderRunner = __esm({
  "packages/playwright-core/src/server/recorder/recorderRunner.ts"() {
    "use strict";
    init_expectUtils();
    init_language();
    init_recorderUtils();
  }
});

// packages/playwright-core/src/server/recorder.ts
function isScreenshotCommand(metadata) {
  return metadata.method.toLowerCase().includes("screenshot");
}
function languageForFile(file) {
  if (file.endsWith(".py"))
    return "python";
  if (file.endsWith(".java"))
    return "java";
  if (file.endsWith(".cs"))
    return "csharp";
  return "javascript";
}
var import_events6, import_fs22, recorderSymbol, RecorderEvent, Recorder;
var init_recorder = __esm({
  "packages/playwright-core/src/server/recorder.ts"() {
    "use strict";
    import_events6 = __toESM(require("events"));
    import_fs22 = __toESM(require("fs"));
    init_locatorParser();
    init_selectorParser();
    init_manualPromise();
    init_debug();
    init_eventsHelper();
    init_time();
    init_browserContext();
    init_debugger();
    init_recorderUtils();
    init_progress();
    init_recorderSignalProcessor();
    init_pollingRecorderSource();
    init_frames();
    init_page();
    init_recorderRunner();
    recorderSymbol = Symbol("recorderSymbol");
    RecorderEvent = {
      PausedStateChanged: "pausedStateChanged",
      ModeChanged: "modeChanged",
      ElementPicked: "elementPicked",
      CallLogsUpdated: "callLogsUpdated",
      UserSourcesChanged: "userSourcesChanged",
      ActionAdded: "actionAdded",
      SignalAdded: "signalAdded",
      PageNavigated: "pageNavigated",
      ContextClosed: "contextClosed"
    };
    Recorder = class _Recorder extends import_events6.default {
      constructor(context2, params2) {
        super();
        this._highlightedElement = {};
        this._overlayState = { offsetX: 0 };
        this._currentCallsMetadata = /* @__PURE__ */ new Map();
        this._actionPoints = /* @__PURE__ */ new Map();
        this._userSources = /* @__PURE__ */ new Map();
        this._omitCallTracking = false;
        this._currentLanguage = "javascript";
        this._pageAliases = /* @__PURE__ */ new Map();
        this._lastPopupOrdinal = 0;
        this._lastDialogOrdinal = -1;
        this._lastDownloadOrdinal = -1;
        this._listeners = [];
        this._enabled = false;
        this._callLogs = [];
        this._context = context2;
        this._params = params2;
        this._mode = params2.mode || "none";
        this._recorderMode = params2.recorderMode ?? "default";
        this.handleSIGINT = params2.handleSIGINT;
        this._signalProcessor = new RecorderSignalProcessor({
          addAction: (actionInContext) => {
            if (this._enabled)
              this.emit(RecorderEvent.ActionAdded, actionInContext);
          },
          addSignal: (signal) => {
            if (this._enabled)
              this.emit(RecorderEvent.SignalAdded, signal);
          }
        });
        context2.on(BrowserContext.Events.BeforeClose, () => {
          this.emit(RecorderEvent.ContextClosed);
        });
        this._listeners.push(eventsHelper.addEventListener(process, "exit", () => {
          this.emit(RecorderEvent.ContextClosed);
        }));
        this._setEnabled(params2.mode === "recording");
        this._omitCallTracking = !!params2.omitCallTracking;
        this._debugger = context2.debugger();
        context2.instrumentation.addListener(this, context2);
        if (isUnderTest()) {
          this._overlayState.offsetX = 200;
        }
      }
      static forContext(context2, params2) {
        let recorderPromise = context2[recorderSymbol];
        if (!recorderPromise) {
          recorderPromise = _Recorder._create(context2, params2);
          context2[recorderSymbol] = recorderPromise;
        }
        return recorderPromise;
      }
      static async existingForContext(context2) {
        const recorderPromise = context2[recorderSymbol];
        return await recorderPromise;
      }
      static async _create(context2, params2 = {}) {
        const recorder = new _Recorder(context2, params2);
        await recorder._install();
        return recorder;
      }
      async _install() {
        this.emit(RecorderEvent.ModeChanged, this._mode);
        this.emit(RecorderEvent.PausedStateChanged, this._debugger.isPaused());
        this._context.once(BrowserContext.Events.Close, () => {
          eventsHelper.removeEventListeners(this._listeners);
          this._context.instrumentation.removeListener(this);
          this.emit(RecorderEvent.ContextClosed);
        });
        const controller = new ProgressController();
        await controller.run(async (progress2) => {
          await this._context.exposeBinding(progress2, "__pw_recorderState", async (source11) => {
            let actionSelector;
            let actionPoint;
            const hasActiveScreenshotCommand = [...this._currentCallsMetadata.keys()].some(isScreenshotCommand);
            if (!hasActiveScreenshotCommand) {
              actionSelector = await this._scopeHighlightedSelectorToFrame(source11.frame);
              for (const [metadata, sdkObject] of this._currentCallsMetadata) {
                if (source11.page === sdkObject.attribution.page) {
                  actionPoint = this._actionPoints.get(metadata.id) || actionPoint;
                  actionSelector = actionSelector || metadata.params.selector;
                }
              }
            }
            let mode = this._mode;
            if (this._pickLocatorPage && source11.page !== this._pickLocatorPage)
              mode = "none";
            const uiState = {
              mode,
              actionPoint,
              actionSelector,
              ariaTemplate: this._highlightedElement.ariaTemplate,
              language: this._currentLanguage,
              testIdAttributeName: this._testIdAttributeName(),
              overlay: this._overlayState
            };
            return uiState;
          });
          await this._context.exposeBinding(progress2, "__pw_recorderElementPicked", async ({ frame }, elementInfo) => {
            const selectorChain = await generateFrameSelector(progress2, frame);
            this.emit(RecorderEvent.ElementPicked, { selector: buildFullSelector(selectorChain, elementInfo.selector), ariaSnapshot: elementInfo.ariaSnapshot }, true);
          });
          await this._context.exposeBinding(progress2, "__pw_recorderSetMode", async ({ frame }, mode) => {
            if (frame.parentFrame())
              return;
            await this.setMode(mode);
          });
          await this._context.exposeBinding(progress2, "__pw_recorderSetOverlayState", async ({ frame }, state) => {
            if (frame.parentFrame())
              return;
            this._overlayState = state;
          });
          await this._context.exposeBinding(progress2, "__pw_resume", () => {
            this._debugger.resume();
          });
          this._context.on(BrowserContext.Events.Page, (page) => this._onPage(page));
          for (const page of this._context.pages())
            this._onPage(page);
          this._context.dialogManager.addDialogHandler((dialog) => {
            this._onDialog(dialog.page());
            return false;
          });
          await this._context.exposeBinding(
            progress2,
            "__pw_recorderPerformAction",
            (source11, action) => this._performAction(progress2, source11.frame, action)
          );
          await this._context.exposeBinding(
            progress2,
            "__pw_recorderRecordAction",
            (source11, action) => this._recordAction(progress2, source11.frame, action)
          );
          await progress2.race(this._context.extendInjectedScript(source6, { recorderMode: this._recorderMode, hideToolbar: !!this._params.hideToolbar }));
        });
        if (this._debugger.isPaused())
          this._pausedStateChanged();
        this._debugger.on(Debugger.Events.PausedStateChanged, () => this._pausedStateChanged());
      }
      _pausedStateChanged() {
        const pausedDetails = this._debugger.pausedDetails();
        if (pausedDetails && !this._currentCallsMetadata.has(pausedDetails.metadata))
          this.onBeforeCall(pausedDetails.sdkObject, pausedDetails.metadata);
        this.emit(RecorderEvent.PausedStateChanged, this._debugger.isPaused());
        this._updateUserSources();
        this._updateCallLog([...this._currentCallsMetadata.keys()]);
      }
      mode() {
        return this._mode;
      }
      async setMode(mode) {
        if (this._mode === mode)
          return;
        this._highlightedElement = {};
        this._mode = mode;
        this.emit(RecorderEvent.ModeChanged, this._mode);
        this._setEnabled(this._isRecording());
        this._debugger.setMuted(this._isRecording());
        if (this._mode !== "none" && this._mode !== "standby") {
          let pageToFocus = this._pickLocatorPage;
          if (!pageToFocus && this._context.pages().length === 1)
            pageToFocus = this._context.pages()[0];
          pageToFocus?.bringToFront(nullProgress).catch(() => {
          });
        }
        await this._refreshOverlay();
      }
      async pickLocator(progress2, page) {
        if (this._mode !== "none")
          await progress2.race(this.setMode("none"));
        const selectorPromise = new ManualPromise();
        let recorderChangedState = false;
        const onElementPicked = (elementInfo) => {
          selectorPromise.resolve(elementInfo.selector);
        };
        const onModeChanged = () => {
          if (this._mode === "inspecting")
            return;
          recorderChangedState = true;
          selectorPromise.reject(new Error("Locator picking was cancelled"));
        };
        const listeners = [
          eventsHelper.addEventListener(this, RecorderEvent.ElementPicked, onElementPicked),
          eventsHelper.addEventListener(this, RecorderEvent.ModeChanged, onModeChanged)
        ];
        try {
          const doPickLocator = async () => {
            selectorPromise.catch(() => {
            });
            this._pickLocatorPage = page;
            await this.setMode("inspecting");
            return await selectorPromise;
          };
          return await progress2.race(page.openScope.race(doPickLocator()));
        } finally {
          eventsHelper.removeEventListeners(listeners);
          this._pickLocatorPage = void 0;
          if (!recorderChangedState)
            await progress2.race(this.setMode("none"));
        }
      }
      url() {
        const page = this._context.pages()[0];
        return page?.mainFrame().url();
      }
      async setHighlightedSelector(selector) {
        this._highlightedElement = { selector: locatorOrSelectorAsSelector(this._currentLanguage, selector, this._context.selectors().testIdAttributeName()) };
        await this._refreshOverlay();
      }
      async setHighlightedAriaTemplate(ariaTemplate) {
        this._highlightedElement = { ariaTemplate };
        await this._refreshOverlay();
      }
      step() {
        this._debugger.setPauseAt({ next: true });
        this._debugger.resume();
      }
      async setLanguage(language) {
        this._currentLanguage = language;
        await this._refreshOverlay();
      }
      resume() {
        this._debugger.resume();
      }
      pause() {
        this._debugger.setPauseAt({ next: true });
      }
      paused() {
        return this._debugger.isPaused();
      }
      close() {
        this._debugger.resume();
      }
      async hideHighlightedSelector() {
        this._highlightedElement = {};
        await this._refreshOverlay();
      }
      pausedSourceId() {
        const pausedDetails = this._debugger.pausedDetails();
        if (pausedDetails?.metadata.location) {
          const source11 = this._userSources.get(pausedDetails.metadata.location.file);
          if (source11)
            return source11.id;
        }
      }
      userSources() {
        return [...this._userSources.values()];
      }
      callLog() {
        return this._callLogs;
      }
      async _scopeHighlightedSelectorToFrame(frame) {
        if (!this._highlightedElement.selector)
          return;
        try {
          const mainFrame = frame._page.mainFrame();
          const resolved = await mainFrame.selectors.resolveFrameForSelector(this._highlightedElement.selector);
          if (!resolved)
            return "";
          if (resolved?.frame === mainFrame)
            return stringifySelector(resolved.info.parsed);
          if (resolved?.frame === frame)
            return stringifySelector(resolved.info.parsed);
          return "";
        } catch {
          return "";
        }
      }
      async _refreshOverlay() {
        await Promise.all(this._context.pages().map(
          (page) => page.safeNonStallingEvaluateInAllFrames("window.__pw_refreshOverlay()", "main")
        ));
      }
      async onBeforeCall(sdkObject, metadata) {
        if (this._omitCallTracking || this._isRecording())
          return;
        this._currentCallsMetadata.set(metadata, sdkObject);
        this._updateUserSources();
        this._updateCallLog([metadata]);
        if (isScreenshotCommand(metadata))
          this.hideHighlightedSelector();
        else if (metadata.params && metadata.params.selector)
          this._highlightedElement = { selector: metadata.params.selector };
      }
      async onAfterCall(sdkObject, metadata) {
        this._actionPoints.delete(metadata.id);
        if (this._omitCallTracking || this._isRecording())
          return;
        if (!metadata.error)
          this._currentCallsMetadata.delete(metadata);
        this._updateUserSources();
        this._updateCallLog([metadata]);
      }
      async onBeforeInputAction(sdkObject, metadata, point) {
        if (point)
          this._actionPoints.set(metadata.id, point);
      }
      _updateUserSources() {
        for (const source11 of this._userSources.values()) {
          source11.highlight = [];
          source11.revealLine = void 0;
        }
        for (const metadata of this._currentCallsMetadata.keys()) {
          if (!metadata.location)
            continue;
          const { file, line } = metadata.location;
          let source11 = this._userSources.get(file);
          if (!source11) {
            source11 = { isRecorded: false, label: file, id: file, text: this._readSource(file), highlight: [], language: languageForFile(file) };
            this._userSources.set(file, source11);
          }
          if (line) {
            const paused = this._debugger.isPaused(metadata);
            source11.highlight.push({ line, type: metadata.error ? "error" : paused ? "paused" : "running" });
            source11.revealLine = line;
          }
        }
        this.emit(RecorderEvent.UserSourcesChanged, this.userSources(), this.pausedSourceId());
      }
      async onCallLog(sdkObject, metadata, logName, message) {
        this._updateCallLog([metadata]);
      }
      _updateCallLog(metadatas) {
        if (this._isRecording())
          return;
        const logs = [];
        for (const metadata of metadatas) {
          if (!metadata.method || metadata.internal)
            continue;
          let status = "done";
          if (this._currentCallsMetadata.has(metadata))
            status = "in-progress";
          if (this._debugger.isPaused(metadata))
            status = "paused";
          logs.push(metadataToCallLog(metadata, status));
        }
        this._callLogs = logs;
        this.emit(RecorderEvent.CallLogsUpdated, logs);
      }
      _isRecording() {
        return ["recording", "assertingText", "assertingVisibility", "assertingValue", "assertingSnapshot"].includes(this._mode);
      }
      _readSource(fileName) {
        try {
          return import_fs22.default.readFileSync(fileName, "utf-8");
        } catch (e) {
          return "// No source available";
        }
      }
      _setEnabled(enabled) {
        this._enabled = enabled;
      }
      async _onPage(page) {
        const frame = page.mainFrame();
        page.on(Page.Events.Close, () => {
          this._signalProcessor.addAction({
            frame: this._describeMainFrame(page),
            action: {
              name: "closePage",
              signals: []
            },
            startTime: monotonicTime()
          });
          this._pageAliases.delete(page);
          this._filePrimaryURLChanged();
        });
        frame.on(Frame.Events.InternalNavigation, (event) => {
          if (event.isPublic && !event.error) {
            this._onFrameNavigated(frame, page);
            this._filePrimaryURLChanged();
          }
        });
        page.on(Page.Events.Download, () => this._onDownload(page));
        const suffix = this._pageAliases.size ? String(++this._lastPopupOrdinal) : "";
        const pageAlias = "page" + suffix;
        this._pageAliases.set(page, pageAlias);
        if (page.opener()) {
          this._onPopup(page.opener(), page);
        } else {
          this._signalProcessor.addAction({
            frame: this._describeMainFrame(page),
            action: {
              name: "openPage",
              url: page.mainFrame().url(),
              signals: []
            },
            startTime: monotonicTime()
          });
        }
        this._filePrimaryURLChanged();
      }
      _filePrimaryURLChanged() {
        const page = this._context.pages()[0];
        this.emit(RecorderEvent.PageNavigated, page?.mainFrame().url());
      }
      clear() {
        if (this._params.mode === "recording") {
          for (const page of this._context.pages())
            this._onFrameNavigated(page.mainFrame(), page);
        }
      }
      _describeMainFrame(page) {
        return {
          pageGuid: page.guid,
          pageAlias: this._pageAliases.get(page),
          framePath: []
        };
      }
      async _describeFrame(progress2, frame) {
        return {
          pageGuid: frame._page.guid,
          pageAlias: this._pageAliases.get(frame._page),
          framePath: await generateFrameSelector(progress2, frame)
        };
      }
      _testIdAttributeName() {
        return this._params.testIdAttributeName || this._context.selectors().testIdAttributeName() || "data-testid";
      }
      async _createActionInContext(progress2, frame, action) {
        const frameDescription = await this._describeFrame(progress2, frame);
        const actionInContext = {
          frame: frameDescription,
          action,
          description: void 0,
          startTime: monotonicTime()
        };
        return actionInContext;
      }
      async _performAction(progress2, frame, action) {
        const actionInContext = await this._createActionInContext(progress2, frame, action);
        this._signalProcessor.addAction(actionInContext);
        try {
          if (actionInContext.action.name !== "openPage" && actionInContext.action.name !== "closePage")
            await performAction(progress2, this._pageAliases, actionInContext);
        } finally {
          actionInContext.endTime = monotonicTime();
        }
      }
      async _recordAction(progress2, frame, action) {
        const actionInContext = await this._createActionInContext(progress2, frame, action);
        this._signalProcessor.addAction(actionInContext);
      }
      _onFrameNavigated(frame, page) {
        const pageAlias = this._pageAliases.get(page);
        this._signalProcessor.signal(pageAlias, frame, { name: "navigation", url: frame.url() });
      }
      _onPopup(page, popup) {
        const pageAlias = this._pageAliases.get(page);
        const popupAlias = this._pageAliases.get(popup);
        this._signalProcessor.signal(pageAlias, page.mainFrame(), { name: "popup", popupAlias });
      }
      _onDownload(page) {
        const pageAlias = this._pageAliases.get(page);
        ++this._lastDownloadOrdinal;
        this._signalProcessor.signal(pageAlias, page.mainFrame(), { name: "download", downloadAlias: this._lastDownloadOrdinal ? String(this._lastDownloadOrdinal) : "" });
      }
      _onDialog(page) {
        const pageAlias = this._pageAliases.get(page);
        ++this._lastDialogOrdinal;
        this._signalProcessor.signal(pageAlias, page.mainFrame(), { name: "dialog", dialogAlias: this._lastDialogOrdinal ? String(this._lastDialogOrdinal) : "" });
      }
    };
  }
});

// packages/utils/pipeTransport.ts
var PipeTransport;
var init_pipeTransport = __esm({
  "packages/utils/pipeTransport.ts"() {
    "use strict";
    init_task();
    PipeTransport = class {
      constructor(pipeWrite, pipeRead, closeable, endian = "le") {
        this._data = Buffer.from([]);
        this._waitForNextTask = makeWaitForNextTask();
        this._closed = false;
        this._bytesLeft = 0;
        this._pipeWrite = pipeWrite;
        this._endian = endian;
        this._closeableStream = closeable;
        pipeRead.on("data", (buffer) => this._dispatch(buffer));
        pipeRead.on("close", () => {
          this._closed = true;
          if (this.onclose)
            this.onclose();
        });
        this.onmessage = void 0;
        this.onclose = void 0;
      }
      send(message) {
        if (this._closed)
          throw new Error("Pipe has been closed");
        const data = Buffer.from(message, "utf-8");
        const dataLength = Buffer.alloc(4);
        if (this._endian === "be")
          dataLength.writeUInt32BE(data.length, 0);
        else
          dataLength.writeUInt32LE(data.length, 0);
        this._pipeWrite.write(dataLength);
        this._pipeWrite.write(data);
      }
      close() {
        this._closeableStream.close();
      }
      _dispatch(buffer) {
        this._data = Buffer.concat([this._data, buffer]);
        while (true) {
          if (!this._bytesLeft && this._data.length < 4) {
            break;
          }
          if (!this._bytesLeft) {
            this._bytesLeft = this._endian === "be" ? this._data.readUInt32BE(0) : this._data.readUInt32LE(0);
            this._data = this._data.slice(4);
          }
          if (!this._bytesLeft || this._data.length < this._bytesLeft) {
            break;
          }
          const message = this._data.slice(0, this._bytesLeft);
          this._data = this._data.slice(this._bytesLeft);
          this._bytesLeft = 0;
          this._waitForNextTask(() => {
            if (this.onmessage)
              this.onmessage(message.toString("utf-8"));
          });
        }
      }
    };
  }
});

// packages/playwright-core/src/server/chromium/chromiumSwitches.ts
var disabledFeatures, chromiumSwitches;
var init_chromiumSwitches = __esm({
  "packages/playwright-core/src/server/chromium/chromiumSwitches.ts"() {
    "use strict";
    disabledFeatures = [
      // See https://github.com/microsoft/playwright/issues/14047
      "AvoidUnnecessaryBeforeUnloadCheckSync",
      // See https://github.com/microsoft/playwright/issues/38568
      "BoundaryEventDispatchTracksNodeRemoval",
      "DestroyProfileOnBrowserClose",
      // See https://github.com/microsoft/playwright/pull/13854
      "DialMediaRouteProvider",
      "GlobalMediaControls",
      // See https://github.com/microsoft/playwright/pull/27605
      "HttpsUpgrades",
      // Hides the Lens feature in the URL address bar. Its not working in unofficial builds.
      "LensOverlay",
      // See https://github.com/microsoft/playwright/pull/8162
      "MediaRouter",
      // See https://github.com/microsoft/playwright/issues/28023
      "PaintHolding",
      // See https://github.com/microsoft/playwright/issues/32230
      "ThirdPartyStoragePartitioning",
      // See https://github.com/microsoft/playwright/issues/16126
      "Translate",
      // See https://issues.chromium.org/u/1/issues/435410220
      "AutoDeElevate",
      // See https://github.com/microsoft/playwright/issues/37714
      "RenderDocument",
      // Prevents downloading optimization hints on startup.
      "OptimizationHints",
      // Disables forced sign-in in Edge.
      "msForceBrowserSignIn",
      // Disables updating the preferred version in LaunchServices preferences on mac.
      "msEdgeUpdateLaunchServicesPreferredVersion"
    ].filter(Boolean);
    chromiumSwitches = (options) => [
      "--disable-field-trial-config",
      // https://source.chromium.org/chromium/chromium/src/+/main:testing/variations/README.md
      "--disable-background-networking",
      "--disable-background-timer-throttling",
      "--disable-backgrounding-occluded-windows",
      "--disable-back-forward-cache",
      // Avoids surprises like main request not being intercepted during page.goBack().
      "--disable-breakpad",
      "--disable-client-side-phishing-detection",
      "--disable-component-extensions-with-background-pages",
      "--disable-component-update",
      // Avoids unneeded network activity after startup.
      "--no-default-browser-check",
      "--disable-default-apps",
      "--disable-dev-shm-usage",
      "--disable-edgeupdater",
      // Disables Edge-specific updater on mac.
      "--disable-extensions",
      "--disable-features=" + disabledFeatures.join(","),
      process.env.PLAYWRIGHT_LEGACY_SCREENSHOT ? "" : "--enable-features=CDPScreenshotNewSurface",
      "--allow-pre-commit-input",
      "--disable-hang-monitor",
      "--disable-ipc-flooding-protection",
      "--disable-popup-blocking",
      "--disable-prompt-on-repost",
      "--disable-renderer-backgrounding",
      "--force-color-profile=srgb",
      "--metrics-recording-only",
      "--no-first-run",
      "--password-store=basic",
      "--use-mock-keychain",
      // See https://chromium-review.googlesource.com/c/chromium/src/+/2436773
      "--no-service-autorun",
      "--export-tagged-pdf",
      // https://chromium-review.googlesource.com/c/chromium/src/+/4853540
      "--disable-search-engine-choice-screen",
      // https://issues.chromium.org/41491762
      "--unsafely-disable-devtools-self-xss-warnings",
      // Edge can potentially restart on Windows (msRelaunchNoCompatLayer) which looses its file descriptors (stdout/stderr) and CDP (3/4). Disable until fixed upstream.
      "--edge-skip-compat-layer-relaunch",
      // This disables Chrome for Testing infobar that is visible in the persistent context.
      // The switch is ignored everywhere else, including Chromium/Chrome/Edge.
      "--disable-infobars",
      // Less annoying popups.
      "--disable-search-engine-choice-screen",
      // Prevents the "three dots" menu crash in IdentityManager::HasPrimaryAccount for ephemeral contexts.
      options?.android ? "" : "--disable-sync"
    ].filter(Boolean);
  }
});

// packages/playwright-core/src/server/chromium/crConnection.ts
var ConnectionEvents, kBrowserCloseMessageId, CRConnection, CRSession, CDPSession;
var init_crConnection = __esm({
  "packages/playwright-core/src/server/chromium/crConnection.ts"() {
    "use strict";
    init_debugLogger();
    init_assert();
    init_eventsHelper();
    init_helper();
    init_protocolError();
    init_instrumentation();
    ConnectionEvents = {
      Disconnected: Symbol("ConnectionEvents.Disconnected")
    };
    kBrowserCloseMessageId = -9999;
    CRConnection = class extends SdkObject {
      constructor(parent, transport, protocolLogger, browserLogsCollector) {
        super(parent, "cr-connection");
        this._lastId = 0;
        this._sessions = /* @__PURE__ */ new Map();
        this._closed = false;
        this.setMaxListeners(0);
        this._transport = transport;
        this._protocolLogger = protocolLogger;
        this._browserLogsCollector = browserLogsCollector;
        this.rootSession = new CRSession(this, null, "");
        this._sessions.set("", this.rootSession);
        this._transport.onmessage = this._onMessage.bind(this);
        this._transport.onclose = this._onClose.bind(this);
      }
      _rawSend(sessionId, method, params2) {
        const id = ++this._lastId;
        const message = { id, method, params: params2 };
        if (sessionId)
          message.sessionId = sessionId;
        this._protocolLogger("send", message);
        this._transport.send(message);
        return id;
      }
      async _onMessage(message) {
        this._protocolLogger("receive", message);
        if (message.id === kBrowserCloseMessageId)
          return;
        const session2 = this._sessions.get(message.sessionId || "");
        if (session2)
          session2._onMessage(message);
      }
      _onClose(reason) {
        this._closed = true;
        this._transport.onmessage = void 0;
        this._transport.onclose = void 0;
        this._browserDisconnectedLogs = helper.formatBrowserLogs(this._browserLogsCollector.recentLogs(), reason);
        this.rootSession.dispose();
        Promise.resolve().then(() => this.emit(ConnectionEvents.Disconnected));
      }
      close() {
        if (!this._closed)
          this._transport.close();
      }
      async createBrowserSession() {
        const { sessionId } = await this.rootSession.send("Target.attachToBrowserTarget");
        return new CDPSession(this.rootSession, sessionId);
      }
    };
    CRSession = class _CRSession extends SdkObject {
      constructor(connection, parentSession, sessionId, eventListener) {
        super(connection, "cr-session");
        this._callbacks = /* @__PURE__ */ new Map();
        this._crashed = false;
        this._closed = false;
        this.setMaxListeners(0);
        this._connection = connection;
        this._parentSession = parentSession;
        this._sessionId = sessionId;
        this._eventListener = eventListener;
      }
      _markAsCrashed() {
        this._crashed = true;
      }
      createChildSession(sessionId, eventListener) {
        const session2 = new _CRSession(this._connection, this, sessionId, eventListener);
        this._connection._sessions.set(sessionId, session2);
        return session2;
      }
      async send(method, params2) {
        if (this._crashed || this._closed || this._connection._closed || this._connection._browserDisconnectedLogs)
          throw new ProtocolError(this._crashed ? "crashed" : "closed", void 0, this._connection._browserDisconnectedLogs);
        const id = this._connection._rawSend(this._sessionId, method, params2);
        return new Promise((resolve, reject) => {
          this._callbacks.set(id, { resolve, reject, error: new ProtocolError("error", method) });
        });
      }
      _sendMayFail(method, params2) {
        return this.send(method, params2).catch((error) => debugLogger.log("error", error));
      }
      _onMessage(object) {
        if (object.id && this._callbacks.has(object.id)) {
          const callback = this._callbacks.get(object.id);
          this._callbacks.delete(object.id);
          if (object.error) {
            callback.error.setMessage(object.error.message);
            callback.reject(callback.error);
          } else {
            callback.resolve(object.result);
          }
        } else if (object.id && object.error?.code === -32001) {
        } else {
          assert(!object.id, object?.error?.message || void 0);
          Promise.resolve().then(() => {
            if (this._eventListener)
              this._eventListener(object.method, object.params);
            this.emit(object.method, object.params);
          });
        }
      }
      async detach() {
        if (this._closed)
          throw new Error(`Session already detached. Most likely the page has been closed.`);
        if (!this._parentSession)
          throw new Error("Root session cannot be closed");
        await this._sendMayFail("Runtime.runIfWaitingForDebugger");
        await this._parentSession.send("Target.detachFromTarget", { sessionId: this._sessionId });
        this.dispose();
      }
      dispose() {
        this._closed = true;
        this._connection._sessions.delete(this._sessionId);
        for (const callback of this._callbacks.values()) {
          callback.error.setMessage(`Internal server error, session closed.`);
          callback.error.type = this._crashed ? "crashed" : "closed";
          callback.error.logs = this._connection._browserDisconnectedLogs;
          callback.reject(callback.error);
        }
        this._callbacks.clear();
      }
    };
    CDPSession = class _CDPSession extends SdkObject {
      constructor(parentSession, sessionId) {
        super(parentSession, "cdp-session");
        this._listeners = [];
        this._session = parentSession.createChildSession(sessionId, (method, params2) => this.emit(_CDPSession.Events.Event, { method, params: params2 }));
        this._listeners = [eventsHelper.addEventListener(parentSession, "Target.detachedFromTarget", (event) => {
          if (event.sessionId === sessionId)
            this._onClose();
        })];
      }
      static {
        this.Events = {
          Event: "event",
          Closed: "close"
        };
      }
      async send(progress2, method, params2) {
        return await progress2.race(this._send(method, params2));
      }
      async detach(progress2) {
        return await progress2.race(this._session.detach());
      }
      async _send(method, params2) {
        return await this._session.send(method, params2);
      }
      async attachToTarget(targetId) {
        const { sessionId } = await this._send("Target.attachToTarget", { targetId, flatten: true });
        return new _CDPSession(this._session, sessionId);
      }
      _onClose() {
        eventsHelper.removeEventListeners(this._listeners);
        this._session.dispose();
        this.emit(_CDPSession.Events.Closed);
      }
    };
  }
});

// packages/playwright-core/src/server/chromium/crCoverage.ts
function convertToDisjointRanges(nestedRanges) {
  const points = [];
  for (const range of nestedRanges) {
    points.push({ offset: range.startOffset, type: 0, range });
    points.push({ offset: range.endOffset, type: 1, range });
  }
  points.sort((a, b) => {
    if (a.offset !== b.offset)
      return a.offset - b.offset;
    if (a.type !== b.type)
      return b.type - a.type;
    const aLength = a.range.endOffset - a.range.startOffset;
    const bLength = b.range.endOffset - b.range.startOffset;
    if (a.type === 0)
      return bLength - aLength;
    return aLength - bLength;
  });
  const hitCountStack = [];
  const results = [];
  let lastOffset = 0;
  for (const point of points) {
    if (hitCountStack.length && lastOffset < point.offset && hitCountStack[hitCountStack.length - 1] > 0) {
      const lastResult = results.length ? results[results.length - 1] : null;
      if (lastResult && lastResult.end === lastOffset)
        lastResult.end = point.offset;
      else
        results.push({ start: lastOffset, end: point.offset });
    }
    lastOffset = point.offset;
    if (point.type === 0)
      hitCountStack.push(point.range.count);
    else
      hitCountStack.pop();
  }
  return results.filter((range) => range.end - range.start > 1);
}
var CRCoverage, JSCoverage, CSSCoverage;
var init_crCoverage = __esm({
  "packages/playwright-core/src/server/chromium/crCoverage.ts"() {
    "use strict";
    init_eventsHelper();
    init_assert();
    init_progress();
    CRCoverage = class {
      constructor(client) {
        this._jsCoverage = new JSCoverage(client);
        this._cssCoverage = new CSSCoverage(client);
      }
      async startJSCoverage(progress2, options) {
        await raceUncancellableOperationWithCleanup(progress2, () => this._jsCoverage.start(options), () => this._jsCoverage.stop());
      }
      async stopJSCoverage() {
        return await this._jsCoverage.stop();
      }
      async startCSSCoverage(progress2, options) {
        await raceUncancellableOperationWithCleanup(progress2, () => this._cssCoverage.start(options), () => this._cssCoverage.stop());
      }
      async stopCSSCoverage() {
        return await this._cssCoverage.stop();
      }
    };
    JSCoverage = class {
      constructor(client) {
        this._reportAnonymousScripts = false;
        this._client = client;
        this._enabled = false;
        this._scriptIds = /* @__PURE__ */ new Set();
        this._scriptSources = /* @__PURE__ */ new Map();
        this._eventListeners = [];
        this._resetOnNavigation = false;
      }
      async start(options) {
        assert(!this._enabled, "JSCoverage is already enabled");
        const {
          resetOnNavigation = true,
          reportAnonymousScripts = false
        } = options;
        this._resetOnNavigation = resetOnNavigation;
        this._reportAnonymousScripts = reportAnonymousScripts;
        this._enabled = true;
        this._scriptIds.clear();
        this._scriptSources.clear();
        this._eventListeners = [
          eventsHelper.addEventListener(this._client, "Debugger.scriptParsed", this._onScriptParsed.bind(this)),
          eventsHelper.addEventListener(this._client, "Runtime.executionContextsCleared", this._onExecutionContextsCleared.bind(this)),
          eventsHelper.addEventListener(this._client, "Debugger.paused", this._onDebuggerPaused.bind(this))
        ];
        await Promise.all([
          this._client.send("Profiler.enable"),
          this._client.send("Profiler.startPreciseCoverage", { callCount: true, detailed: true }),
          this._client.send("Debugger.enable"),
          this._client.send("Debugger.setSkipAllPauses", { skip: true })
        ]);
      }
      _onDebuggerPaused() {
        this._client.send("Debugger.resume");
      }
      _onExecutionContextsCleared() {
        if (!this._resetOnNavigation)
          return;
        this._scriptIds.clear();
        this._scriptSources.clear();
      }
      async _onScriptParsed(event) {
        this._scriptIds.add(event.scriptId);
        if (!event.url && !this._reportAnonymousScripts)
          return;
        const response2 = await this._client._sendMayFail("Debugger.getScriptSource", { scriptId: event.scriptId });
        if (response2)
          this._scriptSources.set(event.scriptId, response2.scriptSource);
      }
      async stop() {
        if (!this._enabled)
          return { entries: [] };
        const [profileResponse] = await Promise.all([
          this._client.send("Profiler.takePreciseCoverage"),
          this._client.send("Profiler.stopPreciseCoverage"),
          this._client.send("Profiler.disable"),
          this._client.send("Debugger.disable")
        ]);
        eventsHelper.removeEventListeners(this._eventListeners);
        this._enabled = false;
        const coverage = { entries: [] };
        for (const entry of profileResponse.result) {
          if (!this._scriptIds.has(entry.scriptId))
            continue;
          if (!entry.url && !this._reportAnonymousScripts)
            continue;
          const source11 = this._scriptSources.get(entry.scriptId);
          if (source11)
            coverage.entries.push({ ...entry, source: source11 });
          else
            coverage.entries.push(entry);
        }
        return coverage;
      }
    };
    CSSCoverage = class {
      constructor(client) {
        this._client = client;
        this._enabled = false;
        this._stylesheetURLs = /* @__PURE__ */ new Map();
        this._stylesheetSources = /* @__PURE__ */ new Map();
        this._eventListeners = [];
        this._resetOnNavigation = false;
      }
      async start(options) {
        assert(!this._enabled, "CSSCoverage is already enabled");
        const { resetOnNavigation = true } = options;
        this._resetOnNavigation = resetOnNavigation;
        this._enabled = true;
        this._stylesheetURLs.clear();
        this._stylesheetSources.clear();
        this._eventListeners = [
          eventsHelper.addEventListener(this._client, "CSS.styleSheetAdded", this._onStyleSheet.bind(this)),
          eventsHelper.addEventListener(this._client, "Runtime.executionContextsCleared", this._onExecutionContextsCleared.bind(this))
        ];
        await Promise.all([
          this._client.send("DOM.enable"),
          this._client.send("CSS.enable"),
          this._client.send("CSS.startRuleUsageTracking")
        ]);
      }
      _onExecutionContextsCleared() {
        if (!this._resetOnNavigation)
          return;
        this._stylesheetURLs.clear();
        this._stylesheetSources.clear();
      }
      async _onStyleSheet(event) {
        const header = event.header;
        if (!header.sourceURL)
          return;
        const response2 = await this._client._sendMayFail("CSS.getStyleSheetText", { styleSheetId: header.styleSheetId });
        if (response2) {
          this._stylesheetURLs.set(header.styleSheetId, header.sourceURL);
          this._stylesheetSources.set(header.styleSheetId, response2.text);
        }
      }
      async stop() {
        if (!this._enabled)
          return { entries: [] };
        const ruleTrackingResponse = await this._client.send("CSS.stopRuleUsageTracking");
        await Promise.all([
          this._client.send("CSS.disable"),
          this._client.send("DOM.disable")
        ]);
        eventsHelper.removeEventListeners(this._eventListeners);
        this._enabled = false;
        const styleSheetIdToCoverage = /* @__PURE__ */ new Map();
        for (const entry of ruleTrackingResponse.ruleUsage) {
          let ranges = styleSheetIdToCoverage.get(entry.styleSheetId);
          if (!ranges) {
            ranges = [];
            styleSheetIdToCoverage.set(entry.styleSheetId, ranges);
          }
          ranges.push({
            startOffset: entry.startOffset,
            endOffset: entry.endOffset,
            count: entry.used ? 1 : 0
          });
        }
        const coverage = { entries: [] };
        for (const styleSheetId of this._stylesheetURLs.keys()) {
          const url2 = this._stylesheetURLs.get(styleSheetId);
          const text2 = this._stylesheetSources.get(styleSheetId);
          const ranges = convertToDisjointRanges(styleSheetIdToCoverage.get(styleSheetId) || []);
          coverage.entries.push({ url: url2, ranges, text: text2 });
        }
        return coverage;
      }
    };
  }
});

// packages/playwright-core/src/server/chromium/crProtocolHelper.ts
function getExceptionMessage(exceptionDetails) {
  if (exceptionDetails.exception)
    return exceptionDetails.exception.description || String(exceptionDetails.exception.value);
  let message = exceptionDetails.text;
  if (exceptionDetails.stackTrace) {
    for (const callframe of exceptionDetails.stackTrace.callFrames) {
      const location2 = callframe.url + ":" + callframe.lineNumber + ":" + callframe.columnNumber;
      const functionName = callframe.functionName || "<anonymous>";
      message += `
    at ${functionName} (${location2})`;
    }
  }
  return message;
}
async function releaseObject(client, objectId) {
  await client.send("Runtime.releaseObject", { objectId }).catch((error) => {
  });
}
async function saveProtocolStream(client, handle, path59) {
  let eof = false;
  await mkdirIfNeeded(path59);
  const fd = await import_fs23.default.promises.open(path59, "w");
  try {
    while (!eof) {
      const response2 = await client.send("IO.read", { handle });
      eof = response2.eof;
      const buf = Buffer.from(response2.data, response2.base64Encoded ? "base64" : void 0);
      await fd.write(buf);
    }
  } finally {
    await fd.close().catch(() => {
    });
  }
  await client.send("IO.close", { handle });
}
async function readProtocolStream(client, handle) {
  let eof = false;
  const chunks = [];
  while (!eof) {
    const response2 = await client.send("IO.read", { handle });
    eof = response2.eof;
    const buf = Buffer.from(response2.data, response2.base64Encoded ? "base64" : void 0);
    chunks.push(buf);
  }
  await client.send("IO.close", { handle });
  return Buffer.concat(chunks);
}
function stackTraceToLocation(stackTrace) {
  return stackTrace && stackTrace.callFrames.length ? {
    url: stackTrace.callFrames[0].url,
    lineNumber: stackTrace.callFrames[0].lineNumber,
    columnNumber: stackTrace.callFrames[0].columnNumber
  } : { url: "", lineNumber: 0, columnNumber: 0 };
}
function exceptionToError(exceptionDetails) {
  const messageWithStack = getExceptionMessage(exceptionDetails);
  const lines = messageWithStack.split("\n");
  const firstStackTraceLine = lines.findIndex((line) => line.startsWith("    at"));
  let messageWithName = "";
  let stack = "";
  if (firstStackTraceLine === -1) {
    messageWithName = messageWithStack;
  } else {
    messageWithName = lines.slice(0, firstStackTraceLine).join("\n");
    stack = messageWithStack;
  }
  const { name, message } = splitErrorMessage(messageWithName);
  const err = new Error(message);
  err.stack = stack;
  const nameOverride = exceptionDetails.exception?.preview?.properties.find((o) => o.name === "name");
  err.name = nameOverride ? nameOverride.value ?? "Error" : name;
  return err;
}
function toModifiersMask(modifiers) {
  let mask = 0;
  if (modifiers.has("Alt"))
    mask |= 1;
  if (modifiers.has("Control"))
    mask |= 2;
  if (modifiers.has("Meta"))
    mask |= 4;
  if (modifiers.has("Shift"))
    mask |= 8;
  return mask;
}
function toButtonsMask(buttons) {
  let mask = 0;
  if (buttons.has("left"))
    mask |= 1;
  if (buttons.has("right"))
    mask |= 2;
  if (buttons.has("middle"))
    mask |= 4;
  return mask;
}
var import_fs23;
var init_crProtocolHelper = __esm({
  "packages/playwright-core/src/server/chromium/crProtocolHelper.ts"() {
    "use strict";
    import_fs23 = __toESM(require("fs"));
    init_stackTrace();
    init_fileUtils();
  }
});

// packages/playwright-core/src/server/chromium/crDragDrop.ts
var DragManager;
var init_crDragDrop = __esm({
  "packages/playwright-core/src/server/chromium/crDragDrop.ts"() {
    "use strict";
    init_assert();
    init_crProtocolHelper();
    DragManager = class {
      constructor(page) {
        this._dragState = null;
        this._lastPosition = { x: 0, y: 0 };
        this._crPage = page;
      }
      async cancelDrag() {
        if (!this._dragState)
          return false;
        await this._crPage._mainFrameSession._client.send("Input.dispatchDragEvent", {
          type: "dragCancel",
          x: this._lastPosition.x,
          y: this._lastPosition.y,
          data: {
            items: [],
            dragOperationsMask: 65535
          }
        });
        this._dragState = null;
        return true;
      }
      async interceptDragCausedByMove(progress2, x, y, button, buttons, modifiers, moveCallback) {
        this._lastPosition = { x, y };
        if (this._dragState) {
          await progress2.race(this._crPage._mainFrameSession._client.send("Input.dispatchDragEvent", {
            type: "dragOver",
            x,
            y,
            data: this._dragState,
            modifiers: toModifiersMask(modifiers)
          }));
          return;
        }
        if (button !== "left")
          return moveCallback(progress2);
        const client = this._crPage._mainFrameSession._client;
        let onDragIntercepted;
        const dragInterceptedPromise = new Promise((x2) => onDragIntercepted = x2);
        function setupDragListeners() {
          let didStartDrag = Promise.resolve(false);
          let dragEvent = null;
          const dragListener = (event) => dragEvent = event;
          const mouseListener = () => {
            didStartDrag = new Promise((callback) => {
              window.addEventListener("dragstart", dragListener, { once: true, capture: true });
              setTimeout(() => callback(dragEvent ? !dragEvent.defaultPrevented : false), 0);
            });
          };
          window.addEventListener("mousemove", mouseListener, { once: true, capture: true });
          window.__cleanupDrag = async () => {
            const val = await didStartDrag;
            window.removeEventListener("mousemove", mouseListener, { capture: true });
            window.removeEventListener("dragstart", dragListener, { capture: true });
            delete window.__cleanupDrag;
            return val;
          };
        }
        try {
          let expectingDrag = false;
          await progress2.race(this._crPage._page.safeNonStallingEvaluateInAllFrames(`(${setupDragListeners.toString()})()`, "utility"));
          client.on("Input.dragIntercepted", onDragIntercepted);
          await progress2.race(client.send("Input.setInterceptDrags", { enabled: true }));
          try {
            await moveCallback(progress2);
            expectingDrag = (await progress2.race(Promise.all(this._crPage._page.frames().map(async (frame) => {
              return frame.nonStallingEvaluateInExistingContext("window.__cleanupDrag?.()", "utility").catch(() => false);
            })))).some((x2) => x2);
          } finally {
            client.off("Input.dragIntercepted", onDragIntercepted);
            await progress2.race(client.send("Input.setInterceptDrags", { enabled: false }));
          }
          this._dragState = expectingDrag ? (await dragInterceptedPromise).data : null;
        } catch (error) {
          this._crPage._page.safeNonStallingEvaluateInAllFrames("window.__cleanupDrag?.()", "utility").catch(() => {
          });
          throw error;
        }
        if (this._dragState) {
          await progress2.race(this._crPage._mainFrameSession._client.send("Input.dispatchDragEvent", {
            type: "dragEnter",
            x,
            y,
            data: this._dragState,
            modifiers: toModifiersMask(modifiers)
          }));
        }
      }
      isDragging() {
        return !!this._dragState;
      }
      async drop(progress2, x, y, modifiers) {
        assert(this._dragState, "missing drag state");
        await progress2.race(this._crPage._mainFrameSession._client.send("Input.dispatchDragEvent", {
          type: "drop",
          x,
          y,
          data: this._dragState,
          modifiers: toModifiersMask(modifiers)
        }));
        this._dragState = null;
      }
    };
  }
});

// packages/playwright-core/src/server/chromium/crExecutionContext.ts
function rewriteError(error) {
  if (error.message.includes("Object reference chain is too long") || error.message.includes("CBOR: stack limit exceeded"))
    throw new Error("Cannot serialize result: object reference chain is too long.");
  if (error.message.includes("Object couldn't be returned by value"))
    return { result: { type: "undefined" } };
  if (error instanceof TypeError && error.message.startsWith("Converting circular structure to JSON"))
    rewriteErrorMessage(error, error.message + " Are you passing a nested JSHandle?");
  if (!isJavaScriptErrorInEvaluate(error) && !isSessionClosedError(error))
    throw new Error("Execution context was destroyed, most likely because of a navigation.");
  throw error;
}
function potentiallyUnserializableValue(remoteObject) {
  const value2 = remoteObject.value;
  const unserializableValue = remoteObject.unserializableValue;
  return unserializableValue ? parseUnserializableValue(unserializableValue) : value2;
}
function renderPreview(object) {
  if (object.type === "undefined")
    return "undefined";
  if ("value" in object)
    return String(object.value);
  if (object.unserializableValue)
    return String(object.unserializableValue);
  if (object.description === "Object" && object.preview) {
    const tokens = [];
    for (const { name, value: value2 } of object.preview.properties)
      tokens.push(`${name}: ${value2}`);
    return `{${tokens.join(", ")}}`;
  }
  if (object.subtype === "array" && object.preview)
    return sparseArrayToString(object.preview.properties);
  return object.description;
}
function createHandle(context2, remoteObject) {
  if (remoteObject.subtype === "node") {
    assert(context2 instanceof FrameExecutionContext);
    return new ElementHandle(context2, remoteObject.objectId);
  }
  return new JSHandle(context2, remoteObject.subtype || remoteObject.type, renderPreview(remoteObject), remoteObject.objectId, potentiallyUnserializableValue(remoteObject));
}
var CRExecutionContext;
var init_crExecutionContext = __esm({
  "packages/playwright-core/src/server/chromium/crExecutionContext.ts"() {
    "use strict";
    init_assert();
    init_stackTrace();
    init_utilityScriptSerializers();
    init_crProtocolHelper();
    init_javascript();
    init_dom();
    init_protocolError();
    CRExecutionContext = class {
      constructor(client, contextPayload) {
        this._client = client;
        this._contextId = contextPayload.id;
      }
      async rawEvaluateJSON(expression2) {
        const { exceptionDetails, result: remoteObject } = await this._client.send("Runtime.evaluate", {
          expression: expression2,
          contextId: this._contextId,
          returnByValue: true
        }).catch(rewriteError);
        if (exceptionDetails)
          throw new JavaScriptErrorInEvaluate(getExceptionMessage(exceptionDetails));
        return remoteObject.value;
      }
      async rawEvaluateHandle(context2, expression2) {
        const { exceptionDetails, result: remoteObject } = await this._client.send("Runtime.evaluate", {
          expression: expression2,
          contextId: this._contextId
        }).catch(rewriteError);
        if (exceptionDetails)
          throw new JavaScriptErrorInEvaluate(getExceptionMessage(exceptionDetails));
        return createHandle(context2, remoteObject);
      }
      async evaluateWithArguments(expression2, returnByValue, utilityScript, values, handles) {
        const { exceptionDetails, result: remoteObject } = await this._client.send("Runtime.callFunctionOn", {
          functionDeclaration: expression2,
          objectId: utilityScript._objectId,
          arguments: [
            { objectId: utilityScript._objectId },
            ...values.map((value2) => ({ value: value2 })),
            ...handles.map((handle) => ({ objectId: handle._objectId }))
          ],
          returnByValue,
          awaitPromise: true,
          userGesture: true
        }).catch(rewriteError);
        if (exceptionDetails)
          throw new JavaScriptErrorInEvaluate(getExceptionMessage(exceptionDetails));
        return returnByValue ? parseEvaluationResultValue(remoteObject.value) : createHandle(utilityScript._context, remoteObject);
      }
      async getProperties(object) {
        const response2 = await this._client.send("Runtime.getProperties", {
          objectId: object._objectId,
          ownProperties: true
        });
        const result2 = /* @__PURE__ */ new Map();
        for (const property of response2.result) {
          if (!property.enumerable || !property.value)
            continue;
          result2.set(property.name, createHandle(object._context, property.value));
        }
        return result2;
      }
      async releaseHandle(handle) {
        if (!handle._objectId)
          return;
        await releaseObject(this._client, handle._objectId);
      }
      shouldPrependErrorPrefix() {
        return false;
      }
    };
  }
});

// packages/playwright-core/src/server/macEditingCommands.ts
var macEditingCommands;
var init_macEditingCommands = __esm({
  "packages/playwright-core/src/server/macEditingCommands.ts"() {
    "use strict";
    macEditingCommands = {
      "Backspace": "deleteBackward:",
      "Enter": "insertNewline:",
      "NumpadEnter": "insertNewline:",
      "Escape": "cancelOperation:",
      "ArrowUp": "moveUp:",
      "ArrowDown": "moveDown:",
      "ArrowLeft": "moveLeft:",
      "ArrowRight": "moveRight:",
      "F5": "complete:",
      "Delete": "deleteForward:",
      "Home": "scrollToBeginningOfDocument:",
      "End": "scrollToEndOfDocument:",
      "PageUp": "scrollPageUp:",
      "PageDown": "scrollPageDown:",
      "Shift+Backspace": "deleteBackward:",
      "Shift+Enter": "insertNewline:",
      "Shift+NumpadEnter": "insertNewline:",
      "Shift+Escape": "cancelOperation:",
      "Shift+ArrowUp": "moveUpAndModifySelection:",
      "Shift+ArrowDown": "moveDownAndModifySelection:",
      "Shift+ArrowLeft": "moveLeftAndModifySelection:",
      "Shift+ArrowRight": "moveRightAndModifySelection:",
      "Shift+F5": "complete:",
      "Shift+Delete": "deleteForward:",
      "Shift+Home": "moveToBeginningOfDocumentAndModifySelection:",
      "Shift+End": "moveToEndOfDocumentAndModifySelection:",
      "Shift+PageUp": "pageUpAndModifySelection:",
      "Shift+PageDown": "pageDownAndModifySelection:",
      "Shift+Numpad5": "delete:",
      "Control+Tab": "selectNextKeyView:",
      "Control+Enter": "insertLineBreak:",
      "Control+NumpadEnter": "insertLineBreak:",
      "Control+Quote": "insertSingleQuoteIgnoringSubstitution:",
      "Control+KeyA": "moveToBeginningOfParagraph:",
      "Control+KeyB": "moveBackward:",
      "Control+KeyD": "deleteForward:",
      "Control+KeyE": "moveToEndOfParagraph:",
      "Control+KeyF": "moveForward:",
      "Control+KeyH": "deleteBackward:",
      "Control+KeyK": "deleteToEndOfParagraph:",
      "Control+KeyL": "centerSelectionInVisibleArea:",
      "Control+KeyN": "moveDown:",
      "Control+KeyO": ["insertNewlineIgnoringFieldEditor:", "moveBackward:"],
      "Control+KeyP": "moveUp:",
      "Control+KeyT": "transpose:",
      "Control+KeyV": "pageDown:",
      "Control+KeyY": "yank:",
      "Control+Backspace": "deleteBackwardByDecomposingPreviousCharacter:",
      "Control+ArrowUp": "scrollPageUp:",
      "Control+ArrowDown": "scrollPageDown:",
      "Control+ArrowLeft": "moveToLeftEndOfLine:",
      "Control+ArrowRight": "moveToRightEndOfLine:",
      "Shift+Control+Enter": "insertLineBreak:",
      "Shift+Control+NumpadEnter": "insertLineBreak:",
      "Shift+Control+Tab": "selectPreviousKeyView:",
      "Shift+Control+Quote": "insertDoubleQuoteIgnoringSubstitution:",
      "Shift+Control+KeyA": "moveToBeginningOfParagraphAndModifySelection:",
      "Shift+Control+KeyB": "moveBackwardAndModifySelection:",
      "Shift+Control+KeyE": "moveToEndOfParagraphAndModifySelection:",
      "Shift+Control+KeyF": "moveForwardAndModifySelection:",
      "Shift+Control+KeyN": "moveDownAndModifySelection:",
      "Shift+Control+KeyP": "moveUpAndModifySelection:",
      "Shift+Control+KeyV": "pageDownAndModifySelection:",
      "Shift+Control+Backspace": "deleteBackwardByDecomposingPreviousCharacter:",
      "Shift+Control+ArrowUp": "scrollPageUp:",
      "Shift+Control+ArrowDown": "scrollPageDown:",
      "Shift+Control+ArrowLeft": "moveToLeftEndOfLineAndModifySelection:",
      "Shift+Control+ArrowRight": "moveToRightEndOfLineAndModifySelection:",
      "Alt+Backspace": "deleteWordBackward:",
      "Alt+Enter": "insertNewlineIgnoringFieldEditor:",
      "Alt+NumpadEnter": "insertNewlineIgnoringFieldEditor:",
      "Alt+Escape": "complete:",
      "Alt+ArrowUp": ["moveBackward:", "moveToBeginningOfParagraph:"],
      "Alt+ArrowDown": ["moveForward:", "moveToEndOfParagraph:"],
      "Alt+ArrowLeft": "moveWordLeft:",
      "Alt+ArrowRight": "moveWordRight:",
      "Alt+Delete": "deleteWordForward:",
      "Alt+PageUp": "pageUp:",
      "Alt+PageDown": "pageDown:",
      "Shift+Alt+Backspace": "deleteWordBackward:",
      "Shift+Alt+Enter": "insertNewlineIgnoringFieldEditor:",
      "Shift+Alt+NumpadEnter": "insertNewlineIgnoringFieldEditor:",
      "Shift+Alt+Escape": "complete:",
      "Shift+Alt+ArrowUp": "moveParagraphBackwardAndModifySelection:",
      "Shift+Alt+ArrowDown": "moveParagraphForwardAndModifySelection:",
      "Shift+Alt+ArrowLeft": "moveWordLeftAndModifySelection:",
      "Shift+Alt+ArrowRight": "moveWordRightAndModifySelection:",
      "Shift+Alt+Delete": "deleteWordForward:",
      "Shift+Alt+PageUp": "pageUp:",
      "Shift+Alt+PageDown": "pageDown:",
      "Control+Alt+KeyB": "moveWordBackward:",
      "Control+Alt+KeyF": "moveWordForward:",
      "Control+Alt+Backspace": "deleteWordBackward:",
      "Shift+Control+Alt+KeyB": "moveWordBackwardAndModifySelection:",
      "Shift+Control+Alt+KeyF": "moveWordForwardAndModifySelection:",
      "Shift+Control+Alt+Backspace": "deleteWordBackward:",
      "Meta+NumpadSubtract": "cancel:",
      "Meta+Backspace": "deleteToBeginningOfLine:",
      "Meta+ArrowUp": "moveToBeginningOfDocument:",
      "Meta+ArrowDown": "moveToEndOfDocument:",
      "Meta+ArrowLeft": "moveToLeftEndOfLine:",
      "Meta+ArrowRight": "moveToRightEndOfLine:",
      "Shift+Meta+NumpadSubtract": "cancel:",
      "Shift+Meta+Backspace": "deleteToBeginningOfLine:",
      "Shift+Meta+ArrowUp": "moveToBeginningOfDocumentAndModifySelection:",
      "Shift+Meta+ArrowDown": "moveToEndOfDocumentAndModifySelection:",
      "Shift+Meta+ArrowLeft": "moveToLeftEndOfLineAndModifySelection:",
      "Shift+Meta+ArrowRight": "moveToRightEndOfLineAndModifySelection:",
      "Meta+KeyA": "selectAll:",
      "Meta+KeyC": "copy:",
      "Meta+KeyX": "cut:",
      "Meta+KeyV": "paste:",
      "Meta+KeyZ": "undo:",
      "Shift+Meta+KeyZ": "redo:"
    };
  }
});

// packages/playwright-core/src/server/chromium/crInput.ts
var RawKeyboardImpl, RawMouseImpl, RawTouchscreenImpl;
var init_crInput = __esm({
  "packages/playwright-core/src/server/chromium/crInput.ts"() {
    "use strict";
    init_stringUtils();
    init_input();
    init_macEditingCommands();
    init_crProtocolHelper();
    RawKeyboardImpl = class {
      constructor(_client, _isMac, _dragManger) {
        this._client = _client;
        this._isMac = _isMac;
        this._dragManger = _dragManger;
      }
      _commandsForCode(code, modifiers) {
        if (!this._isMac)
          return [];
        const parts = [];
        for (const modifier of ["Shift", "Control", "Alt", "Meta"]) {
          if (modifiers.has(modifier))
            parts.push(modifier);
        }
        parts.push(code);
        const shortcut = parts.join("+");
        let commands2 = macEditingCommands[shortcut] || [];
        if (isString(commands2))
          commands2 = [commands2];
        commands2 = commands2.filter((x) => !x.startsWith("insert"));
        return commands2.map((c) => c.substring(0, c.length - 1));
      }
      async keydown(progress2, modifiers, keyName, description, autoRepeat) {
        const { code, key, location: location2, text: text2 } = description;
        if (code === "Escape" && await progress2.race(this._dragManger.cancelDrag()))
          return;
        const commands2 = this._commandsForCode(code, modifiers);
        await progress2.race(this._client.send("Input.dispatchKeyEvent", {
          type: text2 ? "keyDown" : "rawKeyDown",
          modifiers: toModifiersMask(modifiers),
          windowsVirtualKeyCode: description.keyCodeWithoutLocation,
          code,
          commands: commands2,
          key,
          text: text2,
          unmodifiedText: text2,
          autoRepeat,
          location: location2,
          isKeypad: location2 === keypadLocation2
        }));
      }
      async keyup(progress2, modifiers, keyName, description) {
        const { code, key, location: location2 } = description;
        await progress2.race(this._client.send("Input.dispatchKeyEvent", {
          type: "keyUp",
          modifiers: toModifiersMask(modifiers),
          key,
          windowsVirtualKeyCode: description.keyCodeWithoutLocation,
          code,
          location: location2
        }));
      }
      async sendText(progress2, text2) {
        await progress2.race(this._client.send("Input.insertText", { text: text2 }));
      }
    };
    RawMouseImpl = class {
      constructor(page, client, dragManager) {
        this._page = page;
        this._client = client;
        this._dragManager = dragManager;
      }
      async move(progress2, x, y, button, buttons, modifiers, forClick) {
        const actualMove = async (progress3) => {
          await progress3.race(this._client.send("Input.dispatchMouseEvent", {
            type: "mouseMoved",
            button,
            buttons: toButtonsMask(buttons),
            x,
            y,
            modifiers: toModifiersMask(modifiers),
            force: buttons.size > 0 ? 0.5 : 0
          }));
        };
        if (forClick) {
          await actualMove(progress2);
          return;
        }
        await this._dragManager.interceptDragCausedByMove(progress2, x, y, button, buttons, modifiers, actualMove);
      }
      async down(progress2, x, y, button, buttons, modifiers, clickCount) {
        if (this._dragManager.isDragging())
          return;
        await progress2.race(this._client.send("Input.dispatchMouseEvent", {
          type: "mousePressed",
          button,
          buttons: toButtonsMask(buttons),
          x,
          y,
          modifiers: toModifiersMask(modifiers),
          clickCount,
          force: buttons.size > 0 ? 0.5 : 0
        }));
      }
      async up(progress2, x, y, button, buttons, modifiers, clickCount) {
        if (this._dragManager.isDragging()) {
          await this._dragManager.drop(progress2, x, y, modifiers);
          return;
        }
        await progress2.race(this._client.send("Input.dispatchMouseEvent", {
          type: "mouseReleased",
          button,
          buttons: toButtonsMask(buttons),
          x,
          y,
          modifiers: toModifiersMask(modifiers),
          clickCount
        }));
      }
      async wheel(progress2, x, y, buttons, modifiers, deltaX, deltaY) {
        await progress2.race(this._client.send("Input.dispatchMouseEvent", {
          type: "mouseWheel",
          x,
          y,
          modifiers: toModifiersMask(modifiers),
          deltaX,
          deltaY
        }));
      }
    };
    RawTouchscreenImpl = class {
      constructor(client) {
        this._client = client;
      }
      async tap(progress2, x, y, modifiers) {
        await progress2.race(Promise.all([
          this._client.send("Input.dispatchTouchEvent", {
            type: "touchStart",
            modifiers: toModifiersMask(modifiers),
            touchPoints: [{
              x,
              y
            }]
          }),
          this._client.send("Input.dispatchTouchEvent", {
            type: "touchEnd",
            modifiers: toModifiersMask(modifiers),
            touchPoints: []
          })
        ]));
      }
    };
  }
});

// packages/playwright-core/src/server/chromium/crNetworkManager.ts
async function catchDisallowedErrors(callback) {
  try {
    return await callback();
  } catch (e) {
    if (isProtocolError(e) && e.message.includes("Invalid http status code or phrase"))
      throw e;
    if (isProtocolError(e) && e.message.includes("Unsafe header"))
      throw e;
  }
}
function splitSetCookieHeader(headers) {
  const index = headers.findIndex(({ name }) => name.toLowerCase() === "set-cookie");
  if (index === -1)
    return headers;
  const header = headers[index];
  const values = header.value.split("\n");
  if (values.length === 1)
    return headers;
  const result2 = headers.slice();
  result2.splice(index, 1, ...values.map((value2) => ({ name: header.name, value: value2 })));
  return result2;
}
function toResourceType(type3) {
  switch (type3) {
    case "Document":
      return "document";
    case "Stylesheet":
      return "stylesheet";
    case "Image":
      return "image";
    case "Media":
      return "media";
    case "Font":
      return "font";
    case "Script":
      return "script";
    case "TextTrack":
      return "texttrack";
    case "XHR":
      return "xhr";
    case "Fetch":
      return "fetch";
    case "EventSource":
      return "eventsource";
    case "WebSocket":
      return "websocket";
    case "Manifest":
      return "manifest";
    case "Ping":
      return "ping";
    case "CSPViolationReport":
      return "cspreport";
    case "Prefetch":
    case "SignedExchange":
    case "Preflight":
    case "FedCM":
    default:
      return "other";
  }
}
var CRNetworkManager, InterceptableRequest, RouteImpl, errorReasons, ResponseExtraInfoTracker;
var init_crNetworkManager = __esm({
  "packages/playwright-core/src/server/chromium/crNetworkManager.ts"() {
    "use strict";
    init_eventsHelper();
    init_assert();
    init_headers();
    init_helper();
    init_network2();
    init_protocolError();
    CRNetworkManager = class {
      constructor(page, serviceWorker) {
        this._requestIdToRequest = /* @__PURE__ */ new Map();
        this._requestIdToRequestWillBeSentEvent = /* @__PURE__ */ new Map();
        this._credentials = null;
        this._attemptedAuthentications = /* @__PURE__ */ new Set();
        this._userRequestInterceptionEnabled = false;
        this._protocolRequestInterceptionEnabled = false;
        this._offline = false;
        this._extraHTTPHeaders = [];
        this._requestIdToRequestPausedEvent = /* @__PURE__ */ new Map();
        this._responseExtraInfoTracker = new ResponseExtraInfoTracker();
        this._sessions = /* @__PURE__ */ new Map();
        this._timestampBaselineForWebSocket = /* @__PURE__ */ new Map();
        this._page = page;
        this._serviceWorker = serviceWorker;
      }
      async addSession(session2, workerFrame, isMain) {
        const sessionInfo = { session: session2, isMain, workerFrame, eventListeners: [] };
        sessionInfo.eventListeners = [
          eventsHelper.addEventListener(session2, "Fetch.requestPaused", this._onRequestPaused.bind(this, sessionInfo)),
          eventsHelper.addEventListener(session2, "Fetch.authRequired", this._onAuthRequired.bind(this, sessionInfo)),
          eventsHelper.addEventListener(session2, "Network.requestWillBeSent", this._onRequestWillBeSent.bind(this, sessionInfo)),
          eventsHelper.addEventListener(session2, "Network.requestWillBeSentExtraInfo", this._onRequestWillBeSentExtraInfo.bind(this)),
          eventsHelper.addEventListener(session2, "Network.requestServedFromCache", this._onRequestServedFromCache.bind(this)),
          eventsHelper.addEventListener(session2, "Network.responseReceived", this._onResponseReceived.bind(this, sessionInfo)),
          eventsHelper.addEventListener(session2, "Network.responseReceivedExtraInfo", this._onResponseReceivedExtraInfo.bind(this)),
          eventsHelper.addEventListener(session2, "Network.loadingFinished", this._onLoadingFinished.bind(this, sessionInfo)),
          eventsHelper.addEventListener(session2, "Network.loadingFailed", this._onLoadingFailed.bind(this, sessionInfo))
        ];
        if (this._page) {
          sessionInfo.eventListeners.push(...[
            eventsHelper.addEventListener(session2, "Network.webSocketCreated", (e) => this._page.frameManager.onWebSocketCreated(e.requestId, e.url)),
            eventsHelper.addEventListener(session2, "Network.webSocketWillSendHandshakeRequest", (event) => this._onWebSocketWillSendHandshakeRequest(event)),
            eventsHelper.addEventListener(session2, "Network.webSocketHandshakeResponseReceived", (e) => this._page.frameManager.onWebSocketResponse(e.requestId, e.response.status, e.response.statusText, headersObjectToArray(e.response.headers, "\n"))),
            eventsHelper.addEventListener(session2, "Network.webSocketFrameSent", (e) => e.response.payloadData && this._page.frameManager.onWebSocketFrameSent(e.requestId, e.response.opcode, e.response.payloadData, this._timestampToWallTimeMsForWebSocket(e.requestId, e.timestamp))),
            eventsHelper.addEventListener(session2, "Network.webSocketFrameReceived", (e) => e.response.payloadData && this._page.frameManager.webSocketFrameReceived(e.requestId, e.response.opcode, e.response.payloadData, this._timestampToWallTimeMsForWebSocket(e.requestId, e.timestamp))),
            eventsHelper.addEventListener(session2, "Network.webSocketClosed", (event) => this._onWebSocketClosed(event)),
            eventsHelper.addEventListener(session2, "Network.webSocketFrameError", (e) => this._page.frameManager.webSocketError(e.requestId, e.errorMessage))
          ]);
        }
        this._sessions.set(session2, sessionInfo);
        await Promise.all([
          session2.send("Network.enable"),
          this._updateProtocolRequestInterceptionForSession(
            sessionInfo,
            true
            /* initial */
          ),
          this._setOfflineForSession(
            sessionInfo,
            true
            /* initial */
          ),
          this._setExtraHTTPHeadersForSession(
            sessionInfo,
            true
            /* initial */
          )
        ]);
      }
      removeSession(session2) {
        const info = this._sessions.get(session2);
        if (info)
          eventsHelper.removeEventListeners(info.eventListeners);
        this._sessions.delete(session2);
      }
      async _forEachSession(cb) {
        await Promise.all([...this._sessions.values()].map((info) => {
          if (info.isMain)
            return cb(info);
          return cb(info).catch((e) => {
            if (isSessionClosedError(e))
              return;
            throw e;
          });
        }));
      }
      async authenticate(credentials) {
        this._credentials = credentials;
        await this._updateProtocolRequestInterception();
      }
      async setOffline(offline) {
        if (offline === this._offline)
          return;
        this._offline = offline;
        await this._forEachSession((info) => this._setOfflineForSession(info));
      }
      async _setOfflineForSession(info, initial) {
        if (initial && !this._offline)
          return;
        if (info.workerFrame)
          return;
        await info.session.send("Network.emulateNetworkConditions", {
          offline: this._offline,
          // values of 0 remove any active throttling. crbug.com/456324#c9
          latency: 0,
          downloadThroughput: -1,
          uploadThroughput: -1
        });
      }
      async setRequestInterception(value2) {
        this._userRequestInterceptionEnabled = value2;
        await this._updateProtocolRequestInterception();
      }
      async _updateProtocolRequestInterception() {
        const enabled = this._userRequestInterceptionEnabled || !!this._credentials;
        if (enabled === this._protocolRequestInterceptionEnabled)
          return;
        this._protocolRequestInterceptionEnabled = enabled;
        await this._forEachSession((info) => this._updateProtocolRequestInterceptionForSession(info));
      }
      async _updateProtocolRequestInterceptionForSession(info, initial) {
        const enabled = this._protocolRequestInterceptionEnabled;
        if (initial && !enabled)
          return;
        const cachePromise = info.session.send("Network.setCacheDisabled", { cacheDisabled: enabled });
        let fetchPromise = Promise.resolve(void 0);
        if (!info.workerFrame) {
          if (enabled)
            fetchPromise = info.session.send("Fetch.enable", { handleAuthRequests: true, patterns: [{ urlPattern: "*", requestStage: "Request" }] });
          else
            fetchPromise = info.session.send("Fetch.disable");
        }
        await Promise.all([cachePromise, fetchPromise]);
      }
      async setExtraHTTPHeaders(extraHTTPHeaders) {
        if (!this._extraHTTPHeaders.length && !extraHTTPHeaders.length)
          return;
        this._extraHTTPHeaders = extraHTTPHeaders;
        await this._forEachSession((info) => this._setExtraHTTPHeadersForSession(info));
      }
      async _setExtraHTTPHeadersForSession(info, initial) {
        if (initial && !this._extraHTTPHeaders.length)
          return;
        await info.session.send("Network.setExtraHTTPHeaders", { headers: headersArrayToObject(
          this._extraHTTPHeaders,
          false
          /* lowerCase */
        ) });
      }
      async clearCache() {
        await this._forEachSession(async (info) => {
          await info.session.send("Network.setCacheDisabled", { cacheDisabled: true });
          if (!this._protocolRequestInterceptionEnabled)
            await info.session.send("Network.setCacheDisabled", { cacheDisabled: false });
          if (!info.workerFrame)
            await info.session.send("Network.clearBrowserCache");
        });
      }
      _onRequestWillBeSent(sessionInfo, event) {
        if (this._protocolRequestInterceptionEnabled && !event.request.url.startsWith("data:")) {
          const requestId = event.requestId;
          const requestPausedEvent = this._requestIdToRequestPausedEvent.get(requestId);
          if (requestPausedEvent) {
            this._onRequest(sessionInfo, event, requestPausedEvent.sessionInfo, requestPausedEvent.event);
            this._requestIdToRequestPausedEvent.delete(requestId);
          } else {
            this._requestIdToRequestWillBeSentEvent.set(event.requestId, { sessionInfo, event });
          }
        } else {
          this._onRequest(sessionInfo, event, void 0, void 0);
        }
      }
      _onRequestServedFromCache(event) {
        this._responseExtraInfoTracker.requestServedFromCache(event);
      }
      _onRequestWillBeSentExtraInfo(event) {
        this._responseExtraInfoTracker.requestWillBeSentExtraInfo(event);
      }
      _onAuthRequired(sessionInfo, event) {
        let response2 = "Default";
        const shouldProvideCredentials = this._shouldProvideCredentials(event.request.url);
        if (this._attemptedAuthentications.has(event.requestId)) {
          response2 = "CancelAuth";
        } else if (shouldProvideCredentials) {
          response2 = "ProvideCredentials";
          this._attemptedAuthentications.add(event.requestId);
        }
        const { username, password } = shouldProvideCredentials && this._credentials ? this._credentials : { username: void 0, password: void 0 };
        sessionInfo.session._sendMayFail("Fetch.continueWithAuth", {
          requestId: event.requestId,
          authChallengeResponse: { response: response2, username, password }
        });
      }
      _shouldProvideCredentials(url2) {
        if (!this._credentials)
          return false;
        return !this._credentials.origin || new URL(url2).origin.toLowerCase() === this._credentials.origin.toLowerCase();
      }
      _onRequestPaused(sessionInfo, event) {
        if (!event.networkId) {
          sessionInfo.session._sendMayFail("Fetch.continueRequest", { requestId: event.requestId });
          return;
        }
        if (event.request.url.startsWith("data:"))
          return;
        const requestId = event.networkId;
        const requestWillBeSentEvent = this._requestIdToRequestWillBeSentEvent.get(requestId);
        if (requestWillBeSentEvent) {
          this._onRequest(requestWillBeSentEvent.sessionInfo, requestWillBeSentEvent.event, sessionInfo, event);
          this._requestIdToRequestWillBeSentEvent.delete(requestId);
        } else {
          const existingRequest = this._requestIdToRequest.get(requestId);
          const alreadyContinuedParams = existingRequest?._originalRequestRoute?._alreadyContinuedParams;
          if (alreadyContinuedParams && !event.redirectedRequestId) {
            sessionInfo.session._sendMayFail("Fetch.continueRequest", {
              ...alreadyContinuedParams,
              requestId: event.requestId
            });
            return;
          }
          this._requestIdToRequestPausedEvent.set(requestId, { sessionInfo, event });
        }
      }
      _onRequest(requestWillBeSentSessionInfo, requestWillBeSentEvent, requestPausedSessionInfo, requestPausedEvent) {
        if (requestWillBeSentEvent.request.url.startsWith("data:"))
          return;
        let redirectedFrom = null;
        if (requestWillBeSentEvent.redirectResponse) {
          const request3 = this._requestIdToRequest.get(requestWillBeSentEvent.requestId);
          if (request3) {
            this._handleRequestRedirect(request3, requestWillBeSentEvent.redirectResponse, requestWillBeSentEvent.timestamp, requestWillBeSentEvent.redirectHasExtraInfo);
            redirectedFrom = request3;
          }
        }
        let frame = requestWillBeSentEvent.frameId ? this._page?.frameManager.frame(requestWillBeSentEvent.frameId) : requestWillBeSentSessionInfo.workerFrame;
        if (!frame && this._page && requestPausedEvent && requestPausedEvent.frameId)
          frame = this._page.frameManager.frame(requestPausedEvent.frameId);
        if (!frame && this._page && requestWillBeSentEvent.frameId === (this._page?.delegate)._targetId) {
          frame = this._page.frameManager.frameAttached(requestWillBeSentEvent.frameId, null);
        }
        const isInterceptedOptionsPreflight = !!requestPausedEvent && requestPausedEvent.request.method === "OPTIONS" && requestWillBeSentEvent.initiator.type === "preflight";
        if (isInterceptedOptionsPreflight && (this._page || this._serviceWorker).needsRequestInterception()) {
          const requestHeaders = requestPausedEvent.request.headers;
          const responseHeaders = [
            { name: "Access-Control-Allow-Origin", value: requestHeaders["Origin"] || "*" },
            { name: "Access-Control-Allow-Methods", value: requestHeaders["Access-Control-Request-Method"] || "GET, POST, OPTIONS, DELETE" },
            { name: "Access-Control-Allow-Credentials", value: "true" }
          ];
          if (requestHeaders["Access-Control-Request-Headers"])
            responseHeaders.push({ name: "Access-Control-Allow-Headers", value: requestHeaders["Access-Control-Request-Headers"] });
          requestPausedSessionInfo.session._sendMayFail("Fetch.fulfillRequest", {
            requestId: requestPausedEvent.requestId,
            responseCode: 204,
            responsePhrase: statusText(204),
            responseHeaders,
            body: ""
          });
          return;
        }
        if (!frame && !this._serviceWorker) {
          if (requestPausedEvent)
            requestPausedSessionInfo.session._sendMayFail("Fetch.continueRequest", { requestId: requestPausedEvent.requestId });
          return;
        }
        let route2 = null;
        let headersOverride;
        if (requestPausedEvent) {
          if (redirectedFrom || !this._userRequestInterceptionEnabled && this._protocolRequestInterceptionEnabled) {
            headersOverride = redirectedFrom?._originalRequestRoute?._alreadyContinuedParams?.headers;
            if (headersOverride) {
              const originalHeaders = Object.entries(requestPausedEvent.request.headers).map(([name, value2]) => ({ name, value: value2 }));
              headersOverride = applyHeadersOverrides(originalHeaders, headersOverride);
            }
            requestPausedSessionInfo.session._sendMayFail("Fetch.continueRequest", { requestId: requestPausedEvent.requestId, headers: headersOverride });
          } else {
            route2 = new RouteImpl(requestPausedSessionInfo.session, requestPausedEvent.requestId);
          }
        }
        const isNavigationRequest = requestWillBeSentEvent.requestId === requestWillBeSentEvent.loaderId && requestWillBeSentEvent.type === "Document";
        const documentId = isNavigationRequest ? requestWillBeSentEvent.loaderId : void 0;
        const request2 = new InterceptableRequest({
          session: requestWillBeSentSessionInfo.session,
          context: (this._page || this._serviceWorker).browserContext,
          frame: frame || null,
          serviceWorker: this._serviceWorker || null,
          documentId,
          route: route2,
          requestWillBeSentEvent,
          requestPausedEvent,
          redirectedFrom,
          headersOverride: headersOverride || null
        });
        this._requestIdToRequest.set(requestWillBeSentEvent.requestId, request2);
        if (route2) {
          request2.request.setRawRequestHeaders(headersObjectToArray(requestPausedEvent.request.headers, "\n"));
        }
        (this._page?.frameManager || this._serviceWorker).requestStarted(request2.request, route2 || void 0);
      }
      _createResponse(request2, responsePayload, hasExtraInfo) {
        const getResponseBody = async () => {
          const contentLengthHeader = Object.entries(responsePayload.headers).find((header) => header[0].toLowerCase() === "content-length");
          const expectedLength = contentLengthHeader ? +contentLengthHeader[1] : void 0;
          const session2 = request2.session;
          const response3 = await session2.send("Network.getResponseBody", { requestId: request2._requestId });
          if (response3.body || !expectedLength)
            return Buffer.from(response3.body, response3.base64Encoded ? "base64" : "utf8");
          if (request2._originalRequestRoute?._fulfilled)
            return Buffer.from("");
          const resource = await session2.send("Network.loadNetworkResource", { url: request2.request.url(), frameId: this._serviceWorker ? void 0 : request2.request.frame()._id, options: { disableCache: false, includeCredentials: true } });
          const chunks = [];
          while (resource.resource.stream) {
            const chunk = await session2.send("IO.read", { handle: resource.resource.stream });
            chunks.push(Buffer.from(chunk.data, chunk.base64Encoded ? "base64" : "utf-8"));
            if (chunk.eof) {
              await session2.send("IO.close", { handle: resource.resource.stream });
              break;
            }
          }
          return Buffer.concat(chunks);
        };
        const timingPayload = responsePayload.timing;
        let timing;
        if (timingPayload && !this._responseExtraInfoTracker.servedFromCache(request2._requestId)) {
          timing = {
            startTime: (timingPayload.requestTime - request2._timestamp + request2._wallTime) * 1e3,
            domainLookupStart: timingPayload.dnsStart,
            domainLookupEnd: timingPayload.dnsEnd,
            connectStart: timingPayload.connectStart,
            secureConnectionStart: timingPayload.sslStart,
            connectEnd: timingPayload.connectEnd,
            requestStart: timingPayload.sendStart,
            responseStart: timingPayload.receiveHeadersEnd
          };
        } else {
          timing = {
            startTime: request2._wallTime * 1e3,
            domainLookupStart: -1,
            domainLookupEnd: -1,
            connectStart: -1,
            secureConnectionStart: -1,
            connectEnd: -1,
            requestStart: -1,
            responseStart: -1
          };
        }
        const response2 = new Response2(request2.request, responsePayload.status, responsePayload.statusText, headersObjectToArray(responsePayload.headers), timing, getResponseBody, !!responsePayload.fromServiceWorker);
        response2._setHttpVersion(responsePayload?.protocol ?? null);
        if (responsePayload?.remoteIPAddress && typeof responsePayload?.remotePort === "number") {
          response2._serverAddrFinished({
            ipAddress: responsePayload.remoteIPAddress,
            port: responsePayload.remotePort
          });
        } else {
          response2._serverAddrFinished();
        }
        response2._securityDetailsFinished({
          protocol: responsePayload?.securityDetails?.protocol,
          subjectName: responsePayload?.securityDetails?.subjectName,
          issuer: responsePayload?.securityDetails?.issuer,
          validFrom: responsePayload?.securityDetails?.validFrom,
          validTo: responsePayload?.securityDetails?.validTo
        });
        this._responseExtraInfoTracker.processResponse(request2._requestId, response2, hasExtraInfo);
        return response2;
      }
      _deleteRequest(request2) {
        this._requestIdToRequest.delete(request2._requestId);
        if (request2._interceptionId)
          this._attemptedAuthentications.delete(request2._interceptionId);
      }
      _handleRequestRedirect(request2, responsePayload, timestamp, hasExtraInfo) {
        const response2 = this._createResponse(request2, responsePayload, hasExtraInfo);
        response2.setTransferSize(null);
        response2.setEncodedBodySize(null);
        response2._requestFinished((timestamp - request2._timestamp) * 1e3);
        this._deleteRequest(request2);
        (this._page?.frameManager || this._serviceWorker).requestReceivedResponse(response2);
        (this._page?.frameManager || this._serviceWorker).reportRequestFinished(request2.request, response2);
      }
      _onResponseReceivedExtraInfo(event) {
        this._responseExtraInfoTracker.responseReceivedExtraInfo(event);
      }
      _onResponseReceived(sessionInfo, event) {
        let request2 = this._requestIdToRequest.get(event.requestId);
        if (!request2 && event.response.fromServiceWorker) {
          const requestWillBeSentEvent = this._requestIdToRequestWillBeSentEvent.get(event.requestId);
          if (requestWillBeSentEvent) {
            this._requestIdToRequestWillBeSentEvent.delete(event.requestId);
            this._onRequest(sessionInfo, requestWillBeSentEvent.event, void 0, void 0);
            request2 = this._requestIdToRequest.get(event.requestId);
          }
        }
        if (!request2)
          return;
        const response2 = this._createResponse(request2, event.response, event.hasExtraInfo);
        (this._page?.frameManager || this._serviceWorker).requestReceivedResponse(response2);
      }
      _onLoadingFinished(sessionInfo, event) {
        this._responseExtraInfoTracker.loadingFinished(event);
        const request2 = this._requestIdToRequest.get(event.requestId);
        if (!request2)
          return;
        this._maybeUpdateRequestSession(sessionInfo, request2);
        const response2 = request2.request._existingResponse();
        if (response2) {
          response2.setTransferSize(event.encodedDataLength);
          response2.responseHeadersSize().then((size) => response2.setEncodedBodySize(event.encodedDataLength - size));
          response2._requestFinished(helper.secondsToRoundishMillis(event.timestamp - request2._timestamp));
        }
        this._deleteRequest(request2);
        (this._page?.frameManager || this._serviceWorker).reportRequestFinished(request2.request, response2);
      }
      _onLoadingFailed(sessionInfo, event) {
        this._responseExtraInfoTracker.loadingFailed(event);
        let request2 = this._requestIdToRequest.get(event.requestId);
        if (!request2) {
          const requestWillBeSentEvent = this._requestIdToRequestWillBeSentEvent.get(event.requestId);
          if (requestWillBeSentEvent) {
            this._requestIdToRequestWillBeSentEvent.delete(event.requestId);
            this._onRequest(sessionInfo, requestWillBeSentEvent.event, void 0, void 0);
            request2 = this._requestIdToRequest.get(event.requestId);
          }
        }
        if (!request2)
          return;
        this._maybeUpdateRequestSession(sessionInfo, request2);
        const response2 = request2.request._existingResponse();
        if (response2) {
          response2.setTransferSize(null);
          response2.setEncodedBodySize(null);
          response2._requestFinished(helper.secondsToRoundishMillis(event.timestamp - request2._timestamp));
        } else {
          request2.request.setRawRequestHeaders(null);
        }
        this._deleteRequest(request2);
        request2.request._setFailureText(event.errorText || event.blockedReason || "");
        (this._page?.frameManager || this._serviceWorker).requestFailed(request2.request, !!event.canceled);
      }
      _onWebSocketWillSendHandshakeRequest(event) {
        const wallTimeMs = event.wallTime * 1e3;
        this._timestampBaselineForWebSocket.set(event.requestId, wallTimeMs - event.timestamp * 1e3);
        this._page.frameManager.onWebSocketRequest(event.requestId, headersObjectToArray(event.request.headers, "\n"), wallTimeMs);
      }
      _onWebSocketClosed(event) {
        this._timestampBaselineForWebSocket.delete(event.requestId);
        this._page.frameManager.webSocketClosed(event.requestId);
      }
      _timestampToWallTimeMsForWebSocket(requestId, timestamp) {
        return this._timestampBaselineForWebSocket.get(requestId) + timestamp * 1e3;
      }
      _maybeUpdateRequestSession(sessionInfo, request2) {
        if (request2.session !== sessionInfo.session && !sessionInfo.isMain && (request2._documentId === request2._requestId || sessionInfo.workerFrame))
          request2.session = sessionInfo.session;
      }
    };
    InterceptableRequest = class {
      constructor(options) {
        const { session: session2, context: context2, frame, documentId, route: route2, requestWillBeSentEvent, requestPausedEvent, redirectedFrom, serviceWorker, headersOverride } = options;
        this.session = session2;
        this._timestamp = requestWillBeSentEvent.timestamp;
        this._wallTime = requestWillBeSentEvent.wallTime;
        this._requestId = requestWillBeSentEvent.requestId;
        this._interceptionId = requestPausedEvent && requestPausedEvent.requestId;
        this._documentId = documentId;
        this._originalRequestRoute = route2 ?? redirectedFrom?._originalRequestRoute;
        const {
          headers,
          method,
          url: url2,
          postDataEntries = null
        } = requestPausedEvent ? requestPausedEvent.request : requestWillBeSentEvent.request;
        let postDataBuffer = null;
        const entries = postDataEntries?.filter((entry) => entry.bytes);
        if (entries && entries.length)
          postDataBuffer = Buffer.concat(entries.map((entry) => Buffer.from(entry.bytes, "base64")));
        this.request = new Request(context2, frame, serviceWorker, redirectedFrom?.request || null, documentId, url2, toResourceType(requestWillBeSentEvent.type || "Other"), method, postDataBuffer, headersOverride || headersObjectToArray(headers), requestWillBeSentEvent.wallTime * 1e3);
      }
    };
    RouteImpl = class {
      constructor(session2, interceptionId) {
        this._fulfilled = false;
        this._session = session2;
        this._interceptionId = interceptionId;
      }
      async continue(overrides) {
        this._alreadyContinuedParams = {
          requestId: this._interceptionId,
          url: overrides.url,
          headers: overrides.headers,
          method: overrides.method,
          postData: overrides.postData ? overrides.postData.toString("base64") : void 0
        };
        await catchDisallowedErrors(async () => {
          await this._session.send("Fetch.continueRequest", this._alreadyContinuedParams);
        });
      }
      async fulfill(response2) {
        this._fulfilled = true;
        const body = response2.isBase64 ? response2.body : Buffer.from(response2.body).toString("base64");
        const responseHeaders = splitSetCookieHeader(response2.headers);
        await catchDisallowedErrors(async () => {
          await this._session.send("Fetch.fulfillRequest", {
            requestId: this._interceptionId,
            responseCode: response2.status,
            responsePhrase: statusText(response2.status),
            responseHeaders,
            body
          });
        });
      }
      async abort(errorCode = "failed") {
        const errorReason = errorReasons[errorCode];
        assert(errorReason, "Unknown error code: " + errorCode);
        await catchDisallowedErrors(async () => {
          await this._session.send("Fetch.failRequest", {
            requestId: this._interceptionId,
            errorReason
          });
        });
      }
    };
    errorReasons = {
      "aborted": "Aborted",
      "accessdenied": "AccessDenied",
      "addressunreachable": "AddressUnreachable",
      "blockedbyclient": "BlockedByClient",
      "blockedbyresponse": "BlockedByResponse",
      "connectionaborted": "ConnectionAborted",
      "connectionclosed": "ConnectionClosed",
      "connectionfailed": "ConnectionFailed",
      "connectionrefused": "ConnectionRefused",
      "connectionreset": "ConnectionReset",
      "internetdisconnected": "InternetDisconnected",
      "namenotresolved": "NameNotResolved",
      "timedout": "TimedOut",
      "failed": "Failed"
    };
    ResponseExtraInfoTracker = class {
      constructor() {
        this._requests = /* @__PURE__ */ new Map();
      }
      requestWillBeSentExtraInfo(event) {
        const info = this._getOrCreateEntry(event.requestId);
        info.requestWillBeSentExtraInfo.push(event);
        this._patchHeaders(info, info.requestWillBeSentExtraInfo.length - 1);
        this._checkFinished(info);
      }
      requestServedFromCache(event) {
        const info = this._getOrCreateEntry(event.requestId);
        info.servedFromCache = true;
      }
      servedFromCache(requestId) {
        const info = this._requests.get(requestId);
        return !!info?.servedFromCache;
      }
      responseReceivedExtraInfo(event) {
        const info = this._getOrCreateEntry(event.requestId);
        info.responseReceivedExtraInfo.push(event);
        this._patchHeaders(info, info.responseReceivedExtraInfo.length - 1);
        this._checkFinished(info);
      }
      processResponse(requestId, response2, hasExtraInfo) {
        let info = this._requests.get(requestId);
        if (!hasExtraInfo || info?.servedFromCache) {
          response2.request().setRawRequestHeaders(null);
          response2.setResponseHeadersSize(null);
          response2.setRawResponseHeaders(null);
          return;
        }
        info = this._getOrCreateEntry(requestId);
        info.responses.push(response2);
        this._patchHeaders(info, info.responses.length - 1);
      }
      loadingFinished(event) {
        const info = this._requests.get(event.requestId);
        if (!info)
          return;
        info.loadingFinished = event;
        this._checkFinished(info);
      }
      loadingFailed(event) {
        const info = this._requests.get(event.requestId);
        if (!info)
          return;
        info.loadingFailed = event;
        this._checkFinished(info);
      }
      _getOrCreateEntry(requestId) {
        let info = this._requests.get(requestId);
        if (!info) {
          info = {
            requestId,
            requestWillBeSentExtraInfo: [],
            responseReceivedExtraInfo: [],
            responses: []
          };
          this._requests.set(requestId, info);
        }
        return info;
      }
      _patchHeaders(info, index) {
        const response2 = info.responses[index];
        const requestExtraInfo = info.requestWillBeSentExtraInfo[index];
        if (response2 && requestExtraInfo) {
          response2.request().setRawRequestHeaders(headersObjectToArray(requestExtraInfo.headers, "\n"));
          info.requestWillBeSentExtraInfo[index] = void 0;
        }
        const responseExtraInfo = info.responseReceivedExtraInfo[index];
        if (response2 && responseExtraInfo) {
          response2.setResponseHeadersSize(responseExtraInfo.headersText?.length || 0);
          response2.setRawResponseHeaders(headersObjectToArray(responseExtraInfo.headers, "\n"));
          info.responseReceivedExtraInfo[index] = void 0;
        }
      }
      _checkFinished(info) {
        if (!info.loadingFinished && !info.loadingFailed)
          return;
        if (info.responses.length <= info.responseReceivedExtraInfo.length) {
          this._stopTracking(info.requestId);
          return;
        }
      }
      _stopTracking(requestId) {
        this._requests.delete(requestId);
      }
    };
  }
});

// packages/playwright-core/src/server/chromium/crPdf.ts
function convertPrintParameterToInches(text2) {
  if (text2 === void 0)
    return void 0;
  let unit = text2.substring(text2.length - 2).toLowerCase();
  let valueText = "";
  if (unitToPixels.hasOwnProperty(unit)) {
    valueText = text2.substring(0, text2.length - 2);
  } else {
    unit = "px";
    valueText = text2;
  }
  const value2 = Number(valueText);
  assert(!isNaN(value2), "Failed to parse parameter value: " + text2);
  const pixels = value2 * unitToPixels[unit];
  return pixels / 96;
}
var PagePaperFormats, unitToPixels, CRPDF;
var init_crPdf = __esm({
  "packages/playwright-core/src/server/chromium/crPdf.ts"() {
    "use strict";
    init_assert();
    init_crProtocolHelper();
    PagePaperFormats = {
      letter: { width: 8.5, height: 11 },
      legal: { width: 8.5, height: 14 },
      tabloid: { width: 11, height: 17 },
      ledger: { width: 17, height: 11 },
      a0: { width: 33.1, height: 46.8 },
      a1: { width: 23.4, height: 33.1 },
      a2: { width: 16.54, height: 23.4 },
      a3: { width: 11.7, height: 16.54 },
      a4: { width: 8.27, height: 11.7 },
      a5: { width: 5.83, height: 8.27 },
      a6: { width: 4.13, height: 5.83 }
    };
    unitToPixels = {
      "px": 1,
      "in": 96,
      "cm": 37.8,
      "mm": 3.78
    };
    CRPDF = class {
      constructor(client) {
        this._client = client;
      }
      async generate(options) {
        const {
          scale = 1,
          displayHeaderFooter = false,
          headerTemplate = "",
          footerTemplate = "",
          printBackground = false,
          landscape = false,
          pageRanges = "",
          preferCSSPageSize = false,
          margin = {},
          tagged = false,
          outline = false
        } = options;
        let paperWidth = 8.5;
        let paperHeight = 11;
        if (options.format) {
          const format2 = PagePaperFormats[options.format.toLowerCase()];
          assert(format2, "Unknown paper format: " + options.format);
          paperWidth = format2.width;
          paperHeight = format2.height;
        } else {
          paperWidth = convertPrintParameterToInches(options.width) || paperWidth;
          paperHeight = convertPrintParameterToInches(options.height) || paperHeight;
        }
        const marginTop = convertPrintParameterToInches(margin.top) || 0;
        const marginLeft = convertPrintParameterToInches(margin.left) || 0;
        const marginBottom = convertPrintParameterToInches(margin.bottom) || 0;
        const marginRight = convertPrintParameterToInches(margin.right) || 0;
        const generateDocumentOutline = outline;
        const generateTaggedPDF = tagged;
        const result2 = await this._client.send("Page.printToPDF", {
          transferMode: "ReturnAsStream",
          landscape,
          displayHeaderFooter,
          headerTemplate,
          footerTemplate,
          printBackground,
          scale,
          paperWidth,
          paperHeight,
          marginTop,
          marginBottom,
          marginLeft,
          marginRight,
          pageRanges,
          preferCSSPageSize,
          generateTaggedPDF,
          generateDocumentOutline
        });
        return await readProtocolStream(this._client, result2.stream);
      }
    };
  }
});

// packages/playwright-core/src/server/chromium/defaultFontFamilies.ts
var platformToFontFamilies;
var init_defaultFontFamilies = __esm({
  "packages/playwright-core/src/server/chromium/defaultFontFamilies.ts"() {
    "use strict";
    platformToFontFamilies = {
      "linux": {
        "fontFamilies": {
          "standard": "Times New Roman",
          "fixed": "Monospace",
          "serif": "Times New Roman",
          "sansSerif": "Arial",
          "cursive": "Comic Sans MS",
          "fantasy": "Impact"
        }
      },
      "mac": {
        "fontFamilies": {
          "standard": "Times",
          "fixed": "Courier",
          "serif": "Times",
          "sansSerif": "Helvetica",
          "cursive": "Apple Chancery",
          "fantasy": "Papyrus"
        },
        "forScripts": [
          {
            "script": "jpan",
            "fontFamilies": {
              "standard": "Hiragino Kaku Gothic ProN",
              "fixed": "Osaka-Mono",
              "serif": "Hiragino Mincho ProN",
              "sansSerif": "Hiragino Kaku Gothic ProN"
            }
          },
          {
            "script": "hang",
            "fontFamilies": {
              "standard": "Apple SD Gothic Neo",
              "serif": "AppleMyungjo",
              "sansSerif": "Apple SD Gothic Neo"
            }
          },
          {
            "script": "hans",
            "fontFamilies": {
              "standard": ",PingFang SC,STHeiti",
              "serif": "Songti SC",
              "sansSerif": ",PingFang SC,STHeiti",
              "cursive": "Kaiti SC"
            }
          },
          {
            "script": "hant",
            "fontFamilies": {
              "standard": ",PingFang TC,Heiti TC",
              "serif": "Songti TC",
              "sansSerif": ",PingFang TC,Heiti TC",
              "cursive": "Kaiti TC"
            }
          }
        ]
      },
      "win": {
        "fontFamilies": {
          "standard": "Times New Roman",
          "fixed": "Consolas",
          "serif": "Times New Roman",
          "sansSerif": "Arial",
          "cursive": "Comic Sans MS",
          "fantasy": "Impact"
        },
        "forScripts": [
          {
            "script": "cyrl",
            "fontFamilies": {
              "standard": "Times New Roman",
              "fixed": "Courier New",
              "serif": "Times New Roman",
              "sansSerif": "Arial"
            }
          },
          {
            "script": "arab",
            "fontFamilies": {
              "fixed": "Courier New",
              "sansSerif": "Segoe UI"
            }
          },
          {
            "script": "grek",
            "fontFamilies": {
              "standard": "Times New Roman",
              "fixed": "Courier New",
              "serif": "Times New Roman",
              "sansSerif": "Arial"
            }
          },
          {
            "script": "jpan",
            "fontFamilies": {
              "standard": ",Meiryo,Yu Gothic",
              "fixed": "MS Gothic",
              "serif": ",Yu Mincho,MS PMincho",
              "sansSerif": ",Meiryo,Yu Gothic"
            }
          },
          {
            "script": "hang",
            "fontFamilies": {
              "standard": "Malgun Gothic",
              "fixed": "Gulimche",
              "serif": "Batang",
              "sansSerif": "Malgun Gothic",
              "cursive": "Gungsuh"
            }
          },
          {
            "script": "hans",
            "fontFamilies": {
              "standard": "Microsoft YaHei",
              "fixed": "NSimsun",
              "serif": "Simsun",
              "sansSerif": "Microsoft YaHei",
              "cursive": "KaiTi"
            }
          },
          {
            "script": "hant",
            "fontFamilies": {
              "standard": "Microsoft JhengHei",
              "fixed": "MingLiU",
              "serif": "PMingLiU",
              "sansSerif": "Microsoft JhengHei",
              "cursive": "DFKai-SB"
            }
          }
        ]
      }
    };
  }
});

// packages/playwright-core/src/server/videoRecorder.ts
function startAutomaticVideoRecording(page) {
  const recordVideo = page.browserContext._options.recordVideo;
  if (!recordVideo)
    return;
  const recorder = new VideoRecorder(page.screencast);
  if (page.browserContext._options.recordVideo?.showActions)
    page.screencast.showActions(page.browserContext._options.recordVideo?.showActions);
  const dir = recordVideo.dir ?? page.browserContext._browser.options.artifactsDir;
  const artifact = recorder.start({ size: recordVideo.size, fileName: import_path21.default.join(dir, page.guid + ".webm") });
  page.video = artifact;
}
function createWhiteImage(width, height) {
  const data = Buffer.alloc(width * height * 4, 255);
  return jpegjs2.encode({ data, width, height }, 80).data;
}
var import_path21, jpegjs2, fps, VideoRecorder, FfmpegVideoRecorder;
var init_videoRecorder = __esm({
  "packages/playwright-core/src/server/videoRecorder.ts"() {
    "use strict";
    import_path21 = __toESM(require("path"));
    init_processLauncher();
    init_assert();
    init_crypto();
    init_debugLogger();
    init_fileUtils();
    init_time();
    init_artifact();
    init_registry();
    jpegjs2 = require("./utilsBundle").jpegjs;
    fps = 25;
    VideoRecorder = class {
      constructor(screencast) {
        this._screencast = screencast;
      }
      start(options) {
        assert(!this._artifact);
        const ffmpegPath = registry.findExecutable("ffmpeg").executablePathOrDie(this._screencast.page.browserContext._browser.sdkLanguage());
        const outputFile2 = options.fileName ?? import_path21.default.join(this._screencast.page.browserContext._browser.options.artifactsDir, createGuid() + ".webm");
        this._client = {
          onFrame: (frame) => this._videoRecorder.writeFrame(frame.buffer, frame.frameSwapWallTime / 1e3),
          gracefulClose: () => this.stop(),
          dispose: () => this.stop().catch((e) => debugLogger.log("error", `Failed to stop video recorder: ${String(e)}`)),
          size: options.size
        };
        const { size } = this._screencast.addClient(this._client);
        const videoSize = options.size ?? size;
        this._videoRecorder = new FfmpegVideoRecorder(ffmpegPath, videoSize, outputFile2);
        this._artifact = new Artifact(this._screencast.page.browserContext, outputFile2);
        return this._artifact;
      }
      async stop() {
        if (!this._artifact)
          return;
        const artifact = this._artifact;
        this._artifact = void 0;
        const client = this._client;
        this._client = void 0;
        const videoRecorder = this._videoRecorder;
        this._videoRecorder = void 0;
        this._screencast.removeClient(client);
        await videoRecorder._stop();
        await artifact.reportFinished();
      }
    };
    FfmpegVideoRecorder = class {
      constructor(ffmpegPath, size, outputFile2) {
        this._process = null;
        this._gracefullyClose = null;
        this._lastWritePromise = Promise.resolve();
        this._firstFrameTimestamp = 0;
        this._lastFrame = null;
        this._lastWriteNodeTime = 0;
        this._frameQueue = [];
        this._isStopped = false;
        if (!outputFile2.endsWith(".webm"))
          throw new Error("File must have .webm extension");
        this._outputFile = outputFile2;
        this._ffmpegPath = ffmpegPath;
        this._size = size;
        this._launchPromise = this._launch().catch((e) => e);
      }
      async _launch() {
        await mkdirIfNeeded(this._outputFile);
        const w = this._size.width;
        const h = this._size.height;
        const args = `-loglevel error -f image2pipe -avioflags direct -fpsprobesize 0 -probesize 32 -analyzeduration 0 -c:v mjpeg -i pipe:0 -y -an -r ${fps} -c:v vp8 -qmin 0 -qmax 50 -crf 8 -deadline realtime -speed 8 -b:v 1M -threads 1 -vf pad=${w}:${h}:0:0:gray,crop=${w}:${h}:0:0`.split(" ");
        args.push(this._outputFile);
        const { launchedProcess, gracefullyClose } = await launchProcess({
          command: this._ffmpegPath,
          args,
          stdio: "stdin",
          log: (message) => debugLogger.log("browser", message),
          tempDirectories: [],
          attemptToGracefullyClose: async () => {
            debugLogger.log("browser", "Closing stdin...");
            launchedProcess.stdin.end();
          },
          onExit: (exitCode, signal) => {
            debugLogger.log("browser", `ffmpeg onkill exitCode=${exitCode} signal=${signal}`);
          }
        });
        launchedProcess.stdin.on("finish", () => {
          debugLogger.log("browser", "ffmpeg finished input.");
        });
        launchedProcess.stdin.on("error", () => {
          debugLogger.log("browser", "ffmpeg error.");
        });
        this._process = launchedProcess;
        this._gracefullyClose = gracefullyClose;
      }
      writeFrame(frame, timestamp) {
        this._launchPromise.then((error) => {
          if (error)
            return;
          this._writeFrame(frame, timestamp);
        });
      }
      _writeFrame(frame, timestamp) {
        assert(this._process);
        if (this._isStopped)
          return;
        if (!this._firstFrameTimestamp)
          this._firstFrameTimestamp = timestamp;
        const frameNumber = Math.floor((timestamp - this._firstFrameTimestamp) * fps);
        if (this._lastFrame) {
          const repeatCount = frameNumber - this._lastFrame.frameNumber;
          for (let i = 0; i < repeatCount; ++i)
            this._frameQueue.push(this._lastFrame.buffer);
          this._lastWritePromise = this._lastWritePromise.then(() => this._sendFrames());
        }
        this._lastFrame = { buffer: frame, timestamp, frameNumber };
        this._lastWriteNodeTime = monotonicTime();
      }
      async _sendFrames() {
        while (this._frameQueue.length)
          await this._sendFrame(this._frameQueue.shift());
      }
      async _sendFrame(frame) {
        return new Promise((f) => this._process.stdin.write(frame, f)).then((error) => {
          if (error)
            debugLogger.log("browser", `ffmpeg failed to write: ${String(error)}`);
        });
      }
      async _stop() {
        const error = await this._launchPromise;
        if (error)
          throw error;
        if (this._isStopped)
          return;
        if (!this._lastFrame) {
          this._writeFrame(createWhiteImage(this._size.width, this._size.height), monotonicTime());
        }
        const addTime = Math.max((monotonicTime() - this._lastWriteNodeTime) / 1e3, 1);
        this._writeFrame(Buffer.from([]), this._lastFrame.timestamp + addTime);
        this._isStopped = true;
        try {
          await this._lastWritePromise;
          await this._gracefullyClose();
        } catch (e) {
          debugLogger.log("error", `ffmpeg failed to stop: ${String(e)}`);
        }
      }
    };
  }
});

// packages/playwright-core/src/server/chromium/crPage.ts
async function emulateLocale(session2, locale) {
  try {
    await session2.send("Emulation.setLocaleOverride", { locale });
  } catch (exception) {
    if (exception.message.includes("Another locale override is already in effect"))
      return;
    throw exception;
  }
}
async function emulateTimezone(session2, timezoneId) {
  try {
    await session2.send("Emulation.setTimezoneOverride", { timezoneId });
  } catch (exception) {
    if (exception.message.includes("Timezone override is already in effect"))
      return;
    if (exception.message.includes("Invalid timezone"))
      throw new Error(`Invalid timezone ID: ${timezoneId}`);
    throw exception;
  }
}
function calculateUserAgentMetadata(options) {
  const ua = options.userAgent;
  if (!ua)
    return void 0;
  const metadata = {
    mobile: !!options.isMobile,
    model: "",
    architecture: "x86",
    platform: "Windows",
    platformVersion: ""
  };
  const androidMatch = ua.match(/Android (\d+(\.\d+)?(\.\d+)?)/);
  const iPhoneMatch = ua.match(/iPhone OS (\d+(_\d+)?)/);
  const iPadMatch = ua.match(/iPad; CPU OS (\d+(_\d+)?)/);
  const macOSMatch = ua.match(/Mac OS X (\d+(_\d+)?(_\d+)?)/);
  const windowsMatch = ua.match(/Windows\D+(\d+(\.\d+)?(\.\d+)?)/);
  if (androidMatch) {
    metadata.platform = "Android";
    metadata.platformVersion = androidMatch[1];
    metadata.architecture = "arm";
  } else if (iPhoneMatch) {
    metadata.platform = "iOS";
    metadata.platformVersion = iPhoneMatch[1];
    metadata.architecture = "arm";
  } else if (iPadMatch) {
    metadata.platform = "iOS";
    metadata.platformVersion = iPadMatch[1];
    metadata.architecture = "arm";
  } else if (macOSMatch) {
    metadata.platform = "macOS";
    metadata.platformVersion = macOSMatch[1];
    if (!ua.includes("Intel"))
      metadata.architecture = "arm";
  } else if (windowsMatch) {
    metadata.platform = "Windows";
    metadata.platformVersion = windowsMatch[1];
  } else if (ua.toLowerCase().includes("linux")) {
    metadata.platform = "Linux";
  }
  if (ua.includes("ARM"))
    metadata.architecture = "arm";
  return metadata;
}
var CRPage, FrameSession;
var init_crPage = __esm({
  "packages/playwright-core/src/server/chromium/crPage.ts"() {
    "use strict";
    init_assert();
    init_stackTrace();
    init_eventsHelper();
    init_dialog();
    init_dom();
    init_frames();
    init_helper();
    init_network2();
    init_page();
    init_crCoverage();
    init_crDragDrop();
    init_crExecutionContext();
    init_crInput();
    init_crNetworkManager();
    init_crPdf();
    init_crProtocolHelper();
    init_defaultFontFamilies();
    init_errors();
    init_protocolError();
    init_videoRecorder();
    init_progress();
    CRPage = class {
      constructor(client, targetId, browserContext, opener, bits) {
        this._sessions = /* @__PURE__ */ new Map();
        // Holds window features for the next popup being opened via window.open,
        // until the popup target arrives. This could be racy if two oopifs
        // simultaneously call window.open with window features: the order
        // of their Page.windowOpen events is not guaranteed to match the order
        // of new popup targets.
        this._nextWindowOpenPopupFeatures = [];
        this._targetId = targetId;
        this._opener = opener;
        const dragManager = new DragManager(this);
        this.rawKeyboard = new RawKeyboardImpl(client, browserContext._browser._platform() === "mac", dragManager);
        this.rawMouse = new RawMouseImpl(this, client, dragManager);
        this.rawTouchscreen = new RawTouchscreenImpl(client);
        this._pdf = new CRPDF(client);
        this._coverage = new CRCoverage(client);
        this._browserContext = browserContext;
        this._page = new Page(this, browserContext);
        this.utilityWorldName = `__playwright_utility_world_${this._page.guid}`;
        this._networkManager = new CRNetworkManager(this._page, null);
        this.updateOffline();
        this.updateExtraHTTPHeaders();
        this.updateHttpCredentials();
        this.updateRequestInterception();
        this._mainFrameSession = new FrameSession(this, client, targetId, null);
        this._sessions.set(targetId, this._mainFrameSession);
        if (opener && !browserContext._options.noDefaultViewport) {
          const features = opener._nextWindowOpenPopupFeatures.shift() || [];
          const viewportSize = helper.getViewportSizeFromWindowFeatures(features);
          if (viewportSize)
            this._page.setEmulatedSizeFromWindowOpen({ viewport: viewportSize, screen: viewportSize });
        }
        this._mainFrameSession._initialize(bits.hasUIWindow).then(
          () => this._page.reportAsNew(this._opener?._page, void 0),
          (error) => this._page.reportAsNew(this._opener?._page, error)
        );
      }
      static mainFrameSession(page) {
        const crPage = page.delegate;
        return crPage._mainFrameSession;
      }
      async _forAllFrameSessions(cb) {
        const frameSessions = Array.from(this._sessions.values());
        await Promise.all(frameSessions.map((frameSession) => {
          if (frameSession._isMainFrame())
            return cb(frameSession);
          return cb(frameSession).catch((e) => {
            if (isSessionClosedError(e))
              return;
            throw e;
          });
        }));
      }
      _sessionForFrame(frame) {
        while (!this._sessions.has(frame._id)) {
          const parent = frame.parentFrame();
          if (!parent)
            throw new Error(`Frame has been detached.`);
          frame = parent;
        }
        return this._sessions.get(frame._id);
      }
      _sessionForHandle(handle) {
        const frame = handle._context.frame;
        return this._sessionForFrame(frame);
      }
      willBeginDownload() {
        this._mainFrameSession._willBeginDownload();
      }
      didClose() {
        for (const session2 of this._sessions.values())
          session2.dispose();
        this._page._didClose();
      }
      async navigateFrame(frame, url2, referrer) {
        return this._sessionForFrame(frame)._navigate(frame, url2, referrer);
      }
      async updateExtraHTTPHeaders() {
        const headers = mergeHeaders([
          this._browserContext._options.extraHTTPHeaders,
          this._page.extraHTTPHeaders()
        ]);
        await this._networkManager.setExtraHTTPHeaders(headers);
      }
      async updateGeolocation() {
        await this._forAllFrameSessions((frame) => frame._updateGeolocation(false));
      }
      async updateOffline() {
        await this._networkManager.setOffline(!!this._browserContext._options.offline);
      }
      async updateHttpCredentials() {
        await this._networkManager.authenticate(this._browserContext._options.httpCredentials || null);
      }
      async updateEmulatedViewportSize(preserveWindowBoundaries) {
        await this._mainFrameSession._updateViewport(preserveWindowBoundaries);
      }
      async bringToFront() {
        await this._mainFrameSession._client.send("Page.bringToFront");
      }
      async updateEmulateMedia() {
        await this._forAllFrameSessions((frame) => frame._updateEmulateMedia());
      }
      async updateUserAgent() {
        await this._forAllFrameSessions((frame) => frame._updateUserAgent());
      }
      async updateRequestInterception() {
        await this._networkManager.setRequestInterception(this._page.needsRequestInterception());
      }
      async updateFileChooserInterception() {
        await this._forAllFrameSessions((frame) => frame._updateFileChooserInterception(false));
      }
      async reload() {
        await this._mainFrameSession._client.send("Page.reload");
      }
      async _go(delta) {
        const history = await this._mainFrameSession._client.send("Page.getNavigationHistory");
        const entry = history.entries[history.currentIndex + delta];
        if (!entry)
          return false;
        await this._mainFrameSession._client.send("Page.navigateToHistoryEntry", { entryId: entry.id });
        return true;
      }
      goBack() {
        return this._go(-1);
      }
      goForward() {
        return this._go(1);
      }
      async requestGC() {
        await this._mainFrameSession._client.send("HeapProfiler.collectGarbage");
      }
      async addInitScript(initScript, world = "main") {
        await this._forAllFrameSessions((frame) => frame._evaluateOnNewDocument(initScript, world));
      }
      async exposePlaywrightBinding() {
        await this._forAllFrameSessions((frame) => frame.exposePlaywrightBinding());
      }
      async removeInitScripts(initScripts) {
        await this._forAllFrameSessions((frame) => frame._removeEvaluatesOnNewDocument(initScripts));
      }
      async closePage(runBeforeUnload) {
        if (runBeforeUnload)
          await this._mainFrameSession._client.send("Page.close");
        else
          await this._browserContext._browser._closePage(this);
      }
      async setBackgroundColor(color) {
        await this._mainFrameSession._client.send("Emulation.setDefaultBackgroundColorOverride", { color });
      }
      async takeScreenshot(progress2, format2, documentRect, viewportRect, quality, fitsViewport, scale) {
        const { visualViewport, contentSize, cssContentSize } = await progress2.race(this._mainFrameSession._client.send("Page.getLayoutMetrics"));
        if (!documentRect) {
          documentRect = {
            x: visualViewport.pageX + viewportRect.x,
            y: visualViewport.pageY + viewportRect.y,
            ...helper.enclosingIntSize({
              width: viewportRect.width / visualViewport.scale,
              height: viewportRect.height / visualViewport.scale
            })
          };
        }
        const clip = { ...documentRect, scale: viewportRect ? visualViewport.scale : 1 };
        if (scale === "css") {
          const deviceScaleFactor = this._mainFrameSession._metricsOverride?.deviceScaleFactor || contentSize.width / cssContentSize.width || 1;
          clip.scale /= deviceScaleFactor;
        }
        const result2 = await progress2.race(this._mainFrameSession._client.send("Page.captureScreenshot", { format: format2, quality, clip, captureBeyondViewport: !fitsViewport }));
        return Buffer.from(result2.data, "base64");
      }
      async getContentFrame(handle) {
        return this._sessionForHandle(handle)._getContentFrame(handle);
      }
      async getOwnerFrame(handle) {
        return this._sessionForHandle(handle)._getOwnerFrame(handle);
      }
      async getBoundingBox(handle) {
        return this._sessionForHandle(handle)._getBoundingBox(handle);
      }
      async scrollRectIntoViewIfNeeded(handle, rect) {
        return this._sessionForHandle(handle)._scrollRectIntoViewIfNeeded(handle, rect);
      }
      startScreencast(options) {
        this._mainFrameSession._client.send("Page.startScreencast", {
          format: "jpeg",
          quality: options.quality,
          maxWidth: options.width,
          maxHeight: options.height
        }).catch(() => {
        });
      }
      stopScreencast() {
        this._mainFrameSession._client._sendMayFail("Page.stopScreencast").catch(() => {
        });
      }
      rafCountForStablePosition() {
        return 1;
      }
      async getContentQuads(handle) {
        return this._sessionForHandle(handle)._getContentQuads(handle);
      }
      async setInputFilePaths(progress2, handle, files) {
        const frame = await handle.ownerFrame(progress2);
        if (!frame)
          throw new Error("Cannot set input files to detached input element");
        const parentSession = this._sessionForFrame(frame);
        await progress2.race(parentSession._client.send("DOM.setFileInputFiles", {
          objectId: handle._objectId,
          files
        }));
      }
      async adoptElementHandle(handle, to) {
        return this._sessionForHandle(handle)._adoptElementHandle(handle, to);
      }
      async inputActionEpilogue() {
        await this._mainFrameSession._client.send("Page.enable").catch((e) => {
        });
      }
      async resetForReuse(progress2) {
        await this.rawMouse.move(progress2, -1, -1, "none", /* @__PURE__ */ new Set(), /* @__PURE__ */ new Set(), true);
      }
      async pdf(options) {
        return this._pdf.generate(options);
      }
      coverage() {
        return this._coverage;
      }
      async getFrameElement(frame) {
        let parent = frame.parentFrame();
        if (!parent)
          throw new Error("Frame has been detached.");
        const parentSession = this._sessionForFrame(parent);
        const { backendNodeId } = await parentSession._client.send("DOM.getFrameOwner", { frameId: frame._id }).catch((e) => {
          if (e instanceof Error && e.message.includes("Frame with the given id was not found."))
            rewriteErrorMessage(e, "Frame has been detached.");
          throw e;
        });
        parent = frame.parentFrame();
        if (!parent)
          throw new Error("Frame has been detached.");
        return parentSession._adoptBackendNodeId(backendNodeId, await parent.mainContext());
      }
      shouldToggleStyleSheetToSyncAnimations() {
        return false;
      }
      async setDockTile(image) {
        await this._mainFrameSession._client.send("Browser.setDockTile", { image: image.toString("base64") });
      }
    };
    FrameSession = class _FrameSession {
      constructor(crPage, client, targetId, parentSession) {
        this._childSessions = /* @__PURE__ */ new Set();
        this._contextIdToContext = /* @__PURE__ */ new Map();
        this._eventListeners = [];
        this._firstNonInitialNavigationCommittedFulfill = () => {
        };
        this._firstNonInitialNavigationCommittedReject = (e) => {
        };
        // Marks the oopif session that remote -> local transition has happened in the parent.
        // See Target.detachedFromTarget handler for details.
        this._swappedIn = false;
        this._workerSessions = /* @__PURE__ */ new Map();
        this._initScriptIds = /* @__PURE__ */ new Map();
        this._client = client;
        this._crPage = crPage;
        this._page = crPage._page;
        this._targetId = targetId;
        this._parentSession = parentSession;
        if (parentSession)
          parentSession._childSessions.add(this);
        this._firstNonInitialNavigationCommittedPromise = new Promise((f, r) => {
          this._firstNonInitialNavigationCommittedFulfill = f;
          this._firstNonInitialNavigationCommittedReject = r;
        });
        this._firstNonInitialNavigationCommittedPromise.catch(() => {
        });
      }
      _isMainFrame() {
        return this._targetId === this._crPage._targetId;
      }
      _addRendererListeners() {
        this._eventListeners.push(...[
          eventsHelper.addEventListener(this._client, "Log.entryAdded", (event) => this._onLogEntryAdded(event)),
          eventsHelper.addEventListener(this._client, "Page.fileChooserOpened", (event) => this._onFileChooserOpened(event)),
          eventsHelper.addEventListener(this._client, "Page.frameAttached", (event) => this._onFrameAttached(event.frameId, event.parentFrameId)),
          eventsHelper.addEventListener(this._client, "Page.frameDetached", (event) => this._onFrameDetached(event.frameId, event.reason)),
          eventsHelper.addEventListener(this._client, "Page.frameNavigated", (event) => this._onFrameNavigated(event.frame, false)),
          eventsHelper.addEventListener(this._client, "Page.frameRequestedNavigation", (event) => this._onFrameRequestedNavigation(event)),
          eventsHelper.addEventListener(this._client, "Page.javascriptDialogOpening", (event) => this._onDialog(event)),
          eventsHelper.addEventListener(this._client, "Page.navigatedWithinDocument", (event) => this._onFrameNavigatedWithinDocument(event.frameId, event.url)),
          eventsHelper.addEventListener(this._client, "Runtime.bindingCalled", (event) => this._onBindingCalled(event)),
          eventsHelper.addEventListener(this._client, "Runtime.consoleAPICalled", (event) => this._onConsoleAPI(event)),
          eventsHelper.addEventListener(this._client, "Runtime.exceptionThrown", (exception) => this._handleException(exception.exceptionDetails)),
          eventsHelper.addEventListener(this._client, "Runtime.executionContextCreated", (event) => this._onExecutionContextCreated(event.context)),
          eventsHelper.addEventListener(this._client, "Runtime.executionContextDestroyed", (event) => this._onExecutionContextDestroyed(event.executionContextId)),
          eventsHelper.addEventListener(this._client, "Runtime.executionContextsCleared", (event) => this._onExecutionContextsCleared())
        ]);
      }
      _addBrowserListeners() {
        this._eventListeners.push(...[
          eventsHelper.addEventListener(this._client, "Target.attachedToTarget", (event) => this._onAttachedToTarget(event)),
          eventsHelper.addEventListener(this._client, "Target.detachedFromTarget", (event) => this._onDetachedFromTarget(event)),
          eventsHelper.addEventListener(this._client, "Inspector.targetCrashed", (event) => this._onTargetCrashed()),
          eventsHelper.addEventListener(this._client, "Page.screencastFrame", (event) => this._onScreencastFrame(event)),
          eventsHelper.addEventListener(this._client, "Page.windowOpen", (event) => this._onWindowOpen(event))
        ]);
      }
      async _initialize(hasUIWindow) {
        if (!this._page.isStorageStatePage && hasUIWindow && !this._crPage._browserContext._browser.isClank() && !this._crPage._browserContext._options.noDefaultViewport) {
          try {
            const { windowId } = await this._client.send("Browser.getWindowForTarget");
            this._windowId = windowId;
          } catch {
          }
        }
        if (this._isMainFrame() && hasUIWindow && !this._page.isStorageStatePage)
          startAutomaticVideoRecording(this._crPage._page);
        let lifecycleEventsEnabled;
        if (!this._isMainFrame())
          this._addRendererListeners();
        this._addBrowserListeners();
        this._bufferedAttachedToTargetEvents = [];
        const promises = [
          this._client.send("Page.enable"),
          this._client.send("Page.getFrameTree").then(({ frameTree }) => {
            if (this._isMainFrame()) {
              this._handleFrameTree(frameTree);
              this._addRendererListeners();
            }
            const attachedToTargetEvents = this._bufferedAttachedToTargetEvents || [];
            this._bufferedAttachedToTargetEvents = void 0;
            for (const event of attachedToTargetEvents)
              this._onAttachedToTarget(event);
            const localFrames = this._isMainFrame() ? this._page.frames() : [this._page.frameManager.frame(this._targetId)];
            for (const frame of localFrames) {
              this._client._sendMayFail("Page.createIsolatedWorld", {
                frameId: frame._id,
                grantUniveralAccess: true,
                worldName: this._crPage.utilityWorldName
              });
            }
            const isInitialEmptyPage = this._isMainFrame() && this._page.mainFrame().url() === ":";
            if (isInitialEmptyPage) {
              lifecycleEventsEnabled.catch((e) => {
              }).then(() => {
                this._eventListeners.push(eventsHelper.addEventListener(this._client, "Page.lifecycleEvent", (event) => this._onLifecycleEvent(event)));
              });
            } else {
              this._firstNonInitialNavigationCommittedFulfill();
              this._eventListeners.push(eventsHelper.addEventListener(this._client, "Page.lifecycleEvent", (event) => this._onLifecycleEvent(event)));
            }
          }),
          this._client.send("Log.enable", {}),
          lifecycleEventsEnabled = this._client.send("Page.setLifecycleEventsEnabled", { enabled: true }),
          this._client.send("Runtime.enable", {}),
          this._client.send("Page.addScriptToEvaluateOnNewDocument", {
            source: "",
            worldName: this._crPage.utilityWorldName
          }),
          this._crPage._networkManager.addSession(this._client, void 0, this._isMainFrame()),
          this._client.send("Target.setAutoAttach", { autoAttach: true, waitForDebuggerOnStart: true, flatten: true })
        ];
        if (!this._page.isStorageStatePage) {
          const skipDefaultOverrides = this._crPage._browserContext._browser.options.noDefaults && this._crPage._browserContext === this._crPage._browserContext._browser._defaultContext;
          if (this._crPage._browserContext.needsPlaywrightBinding())
            promises.push(this.exposePlaywrightBinding());
          if (this._isMainFrame() && !skipDefaultOverrides)
            promises.push(this._client.send("Emulation.setFocusEmulationEnabled", { enabled: true }));
          const options = this._crPage._browserContext._options;
          if (options.bypassCSP)
            promises.push(this._client.send("Page.setBypassCSP", { enabled: true }));
          if (options.ignoreHTTPSErrors || options.internalIgnoreHTTPSErrors)
            promises.push(this._client.send("Security.setIgnoreCertificateErrors", { ignore: true }));
          if (this._isMainFrame())
            promises.push(this._updateViewport());
          if (options.hasTouch)
            promises.push(this._client.send("Emulation.setTouchEmulationEnabled", { enabled: true }));
          if (options.javaScriptEnabled === false)
            promises.push(this._client.send("Emulation.setScriptExecutionDisabled", { value: true }));
          if (options.userAgent || options.locale)
            promises.push(this._updateUserAgent());
          if (options.locale)
            promises.push(emulateLocale(this._client, options.locale));
          if (options.timezoneId)
            promises.push(emulateTimezone(this._client, options.timezoneId));
          if (!this._crPage._browserContext._browser.options.headful)
            promises.push(this._setDefaultFontFamilies(this._client));
          promises.push(this._updateGeolocation(true));
          if (!skipDefaultOverrides)
            promises.push(this._updateEmulateMedia());
          promises.push(this._updateFileChooserInterception(true));
          for (const initScript of this._crPage._page.allInitScripts())
            promises.push(this._evaluateOnNewDocument(
              initScript,
              "main",
              true
              /* runImmediately */
            ));
        }
        promises.push(this._client.send("Runtime.runIfWaitingForDebugger"));
        promises.push(this._firstNonInitialNavigationCommittedPromise);
        await Promise.all(promises);
      }
      dispose() {
        this._firstNonInitialNavigationCommittedReject(new TargetClosedError(this._page.closeReason()));
        for (const childSession of this._childSessions)
          childSession.dispose();
        if (this._parentSession)
          this._parentSession._childSessions.delete(this);
        eventsHelper.removeEventListeners(this._eventListeners);
        this._crPage._networkManager.removeSession(this._client);
        this._crPage._sessions.delete(this._targetId);
        this._client.dispose();
      }
      async _navigate(frame, url2, referrer) {
        const response2 = await this._client.send("Page.navigate", { url: url2, referrer, frameId: frame._id, referrerPolicy: "unsafeUrl" });
        if (response2.isDownload)
          throw new NavigationAbortedError(response2.loaderId, "Download is starting");
        if (response2.errorText)
          throw new NavigationAbortedError(response2.loaderId, `${response2.errorText} at ${url2}`);
        return { newDocumentId: response2.loaderId };
      }
      _onLifecycleEvent(event) {
        if (this._eventBelongsToStaleFrame(event.frameId))
          return;
        if (event.name === "load")
          this._page.frameManager.frameLifecycleEvent(event.frameId, "load");
        else if (event.name === "DOMContentLoaded")
          this._page.frameManager.frameLifecycleEvent(event.frameId, "domcontentloaded");
      }
      _handleFrameTree(frameTree) {
        this._onFrameAttached(frameTree.frame.id, frameTree.frame.parentId || null);
        this._onFrameNavigated(frameTree.frame, true);
        if (!frameTree.childFrames)
          return;
        for (const child of frameTree.childFrames)
          this._handleFrameTree(child);
      }
      _eventBelongsToStaleFrame(frameId) {
        const frame = this._page.frameManager.frame(frameId);
        if (!frame)
          return true;
        const session2 = this._crPage._sessionForFrame(frame);
        return session2 && session2 !== this && !session2._swappedIn;
      }
      _onFrameAttached(frameId, parentFrameId) {
        const frameSession = this._crPage._sessions.get(frameId);
        if (frameSession && frameId !== this._targetId) {
          frameSession._swappedIn = true;
          const frame = this._page.frameManager.frame(frameId);
          if (frame)
            this._page.frameManager.removeChildFramesRecursively(frame);
          return;
        }
        if (parentFrameId && !this._page.frameManager.frame(parentFrameId)) {
          return;
        }
        this._page.frameManager.frameAttached(frameId, parentFrameId);
      }
      _onFrameNavigated(framePayload, initial) {
        if (this._eventBelongsToStaleFrame(framePayload.id))
          return;
        this._page.frameManager.frameCommittedNewDocumentNavigation(framePayload.id, framePayload.url + (framePayload.urlFragment || ""), framePayload.name || "", framePayload.loaderId, initial);
        if (!initial)
          this._firstNonInitialNavigationCommittedFulfill();
      }
      _onFrameRequestedNavigation(payload) {
        if (this._eventBelongsToStaleFrame(payload.frameId))
          return;
        if (payload.disposition === "currentTab")
          this._page.frameManager.frameRequestedNavigation(payload.frameId);
      }
      _onFrameNavigatedWithinDocument(frameId, url2) {
        if (this._eventBelongsToStaleFrame(frameId))
          return;
        this._page.frameManager.frameCommittedSameDocumentNavigation(frameId, url2);
      }
      _onFrameDetached(frameId, reason) {
        if (this._crPage._sessions.has(frameId)) {
          return;
        }
        if (reason === "swap") {
          const frame = this._page.frameManager.frame(frameId);
          if (frame)
            this._page.frameManager.removeChildFramesRecursively(frame);
          return;
        }
        this._page.frameManager.frameDetached(frameId);
      }
      _onExecutionContextCreated(contextPayload) {
        const frame = contextPayload.auxData ? this._page.frameManager.frame(contextPayload.auxData.frameId) : null;
        if (!frame || this._eventBelongsToStaleFrame(frame._id))
          return;
        const delegate = new CRExecutionContext(this._client, contextPayload);
        let worldName = null;
        if (contextPayload.auxData && !!contextPayload.auxData.isDefault)
          worldName = "main";
        else if (contextPayload.name === this._crPage.utilityWorldName)
          worldName = "utility";
        const context2 = new FrameExecutionContext(delegate, frame, worldName);
        if (worldName)
          frame.contextCreated(worldName, context2);
        this._contextIdToContext.set(contextPayload.id, context2);
      }
      _onExecutionContextDestroyed(executionContextId) {
        const context2 = this._contextIdToContext.get(executionContextId);
        if (!context2)
          return;
        this._contextIdToContext.delete(executionContextId);
        context2.frame.contextDestroyed(context2);
      }
      _onExecutionContextsCleared() {
        for (const contextId4 of Array.from(this._contextIdToContext.keys()))
          this._onExecutionContextDestroyed(contextId4);
      }
      _onAttachedToTarget(event) {
        if (this._bufferedAttachedToTargetEvents) {
          this._bufferedAttachedToTargetEvents.push(event);
          return;
        }
        const session2 = this._client.createChildSession(event.sessionId);
        if (event.targetInfo.type === "iframe") {
          const targetId = event.targetInfo.targetId;
          let frame = this._page.frameManager.frame(targetId);
          if (!frame && event.targetInfo.parentFrameId) {
            frame = this._page.frameManager.frameAttached(targetId, event.targetInfo.parentFrameId);
          }
          if (!frame)
            return;
          this._page.frameManager.removeChildFramesRecursively(frame);
          for (const [contextId4, context2] of this._contextIdToContext) {
            if (context2.frame === frame)
              this._onExecutionContextDestroyed(contextId4);
          }
          const frameSession = new _FrameSession(this._crPage, session2, targetId, this);
          this._crPage._sessions.set(targetId, frameSession);
          frameSession._initialize(false).catch((e) => e);
          return;
        }
        if (event.targetInfo.type !== "worker") {
          session2.detach().catch(() => {
          });
          return;
        }
        const url2 = event.targetInfo.url;
        const worker = new Worker(this._page, url2);
        this._page.addWorker(event.sessionId, worker);
        this._workerSessions.set(event.sessionId, session2);
        session2.once("Runtime.executionContextCreated", async (event2) => {
          worker.createExecutionContext(new CRExecutionContext(session2, event2.context));
        });
        if (this._crPage._browserContext._browser.majorVersion() >= 143)
          session2.on("Inspector.workerScriptLoaded", () => worker.workerScriptLoaded());
        else
          worker.workerScriptLoaded();
        session2._sendMayFail("Runtime.enable");
        this._crPage._networkManager.addSession(session2, this._page.frameManager.frame(event.targetInfo.parentFrameId ?? this._targetId) ?? void 0).catch(() => {
        });
        session2._sendMayFail("Runtime.runIfWaitingForDebugger");
        session2._sendMayFail("Target.setAutoAttach", { autoAttach: true, waitForDebuggerOnStart: true, flatten: true });
        session2.on("Target.attachedToTarget", (event2) => this._onAttachedToTarget(event2));
        session2.on("Target.detachedFromTarget", (event2) => this._onDetachedFromTarget(event2));
        session2.on("Runtime.consoleAPICalled", (event2) => {
          const args = event2.args.map((o) => createHandle(worker.existingExecutionContext, o));
          this._page.addConsoleMessage(worker, event2.type, args, stackTraceToLocation(event2.stackTrace), void 0, event2.timestamp);
        });
        session2.on("Runtime.exceptionThrown", (exception) => this._page.addPageError(exceptionToError(exception.exceptionDetails), stackTraceToLocation(exception.exceptionDetails.stackTrace)));
      }
      _onDetachedFromTarget(event) {
        const workerSession = this._workerSessions.get(event.sessionId);
        if (workerSession) {
          workerSession.dispose();
          this._page.removeWorker(event.sessionId);
          return;
        }
        const childFrameSession = this._crPage._sessions.get(event.targetId);
        if (!childFrameSession)
          return;
        if (childFrameSession._swappedIn) {
          childFrameSession.dispose();
          return;
        }
        this._client.send("Page.enable").catch((e) => null).then(() => {
          if (!childFrameSession._swappedIn)
            this._page.frameManager.frameDetached(event.targetId);
          childFrameSession.dispose();
        });
      }
      _onWindowOpen(event) {
        this._crPage._nextWindowOpenPopupFeatures.push(event.windowFeatures);
      }
      async _onConsoleAPI(event) {
        if (event.executionContextId === 0) {
          return;
        }
        const context2 = this._contextIdToContext.get(event.executionContextId);
        if (!context2)
          return;
        const values = event.args.map((arg) => createHandle(context2, arg));
        this._page.addConsoleMessage(null, event.type, values, stackTraceToLocation(event.stackTrace), void 0, event.timestamp);
      }
      async _onBindingCalled(event) {
        const pageOrError = await this._crPage._page.waitForInitializedOrError();
        if (!(pageOrError instanceof Error)) {
          const context2 = this._contextIdToContext.get(event.executionContextId);
          if (context2)
            await this._page.onBindingCalled(event.payload, context2);
        }
      }
      _onDialog(event) {
        if (!this._page.frameManager.frame(this._targetId))
          return;
        this._page.browserContext.dialogManager.dialogDidOpen(new Dialog(
          this._page,
          event.type,
          event.message,
          async (accept, promptText) => {
            if (this._isMainFrame() && event.type === "beforeunload" && !accept)
              this._page.frameManager.frameAbortedNavigation(this._page.mainFrame()._id, "navigation cancelled by beforeunload dialog");
            await this._client.send("Page.handleJavaScriptDialog", { accept, promptText });
          },
          event.defaultPrompt
        ));
      }
      _handleException(exceptionDetails) {
        this._page.addPageError(exceptionToError(exceptionDetails), stackTraceToLocation(exceptionDetails.stackTrace));
      }
      async _onTargetCrashed() {
        this._client._markAsCrashed();
        this._page._didCrash();
      }
      _onLogEntryAdded(event) {
        const { level, text: text2, args, source: source11, url: url2, lineNumber } = event.entry;
        if (args)
          args.map((arg) => releaseObject(this._client, arg.objectId));
        if (source11 !== "worker") {
          const location2 = {
            url: url2 || "",
            lineNumber: lineNumber || 0,
            columnNumber: 0
          };
          this._page.addConsoleMessage(null, level, [], location2, text2, event.entry.timestamp);
        }
      }
      async _onFileChooserOpened(event) {
        if (!event.backendNodeId)
          return;
        const frame = this._page.frameManager.frame(event.frameId);
        if (!frame)
          return;
        let handle;
        try {
          const utilityContext = await frame.utilityContext();
          handle = await this._adoptBackendNodeId(event.backendNodeId, utilityContext);
        } catch (e) {
          return;
        }
        await this._page._onFileChooserOpened(handle);
      }
      _willBeginDownload() {
        if (!this._crPage._page.initializedOrUndefined()) {
          this._firstNonInitialNavigationCommittedReject(new Error("Starting new page download"));
        }
      }
      _onScreencastFrame(payload) {
        const buffer = Buffer.from(payload.data, "base64");
        this._page.screencast.onScreencastFrame({
          buffer,
          frameSwapWallTime: payload.metadata.timestamp ? payload.metadata.timestamp * 1e3 : Date.now(),
          viewportWidth: payload.metadata.deviceWidth,
          viewportHeight: payload.metadata.deviceHeight
        }, () => {
          this._client._sendMayFail("Page.screencastFrameAck", { sessionId: payload.sessionId });
        });
      }
      async _updateGeolocation(initial) {
        const geolocation = this._crPage._browserContext._options.geolocation;
        if (!initial || geolocation)
          await this._client.send("Emulation.setGeolocationOverride", geolocation || {});
      }
      async _updateViewport(preserveWindowBoundaries) {
        if (this._crPage._browserContext._browser.isClank())
          return;
        assert(this._isMainFrame());
        const options = this._crPage._browserContext._options;
        const emulatedSize = this._page.emulatedSize();
        if (!emulatedSize)
          return;
        const viewportSize = emulatedSize.viewport;
        const screenSize = emulatedSize.screen;
        const isLandscape = screenSize.width > screenSize.height;
        const metricsOverride = {
          mobile: !!options.isMobile,
          width: viewportSize.width,
          height: viewportSize.height,
          screenWidth: screenSize.width,
          screenHeight: screenSize.height,
          deviceScaleFactor: options.deviceScaleFactor || 1,
          screenOrientation: !!options.isMobile ? isLandscape ? { angle: 90, type: "landscapePrimary" } : { angle: 0, type: "portraitPrimary" } : { angle: 0, type: "landscapePrimary" },
          dontSetVisibleSize: preserveWindowBoundaries
        };
        if (JSON.stringify(this._metricsOverride) === JSON.stringify(metricsOverride))
          return;
        const promises = [];
        if (!preserveWindowBoundaries && this._windowId) {
          let insets = { width: 0, height: 0 };
          if (this._crPage._browserContext._browser.options.headful) {
            insets = { width: 24, height: 88 };
            if (process.platform === "win32")
              insets = { width: 16, height: 88 };
            else if (process.platform === "linux")
              insets = { width: 8, height: 85 };
            else if (process.platform === "darwin")
              insets = { width: 2, height: 80 };
            if (this._crPage._browserContext.isPersistentContext()) {
              insets.height += 46;
            }
          }
          promises.push(this.setWindowBounds({
            width: viewportSize.width + insets.width,
            height: viewportSize.height + insets.height
          }));
        }
        promises.push(this._client.send("Emulation.setDeviceMetricsOverride", metricsOverride));
        await Promise.all(promises);
        this._metricsOverride = metricsOverride;
      }
      async windowBounds() {
        const { bounds } = await this._client.send("Browser.getWindowBounds", {
          windowId: this._windowId
        });
        return bounds;
      }
      async setWindowBounds(bounds) {
        return await this._client.send("Browser.setWindowBounds", {
          windowId: this._windowId,
          bounds
        });
      }
      async _updateEmulateMedia() {
        const emulatedMedia = this._page.emulatedMedia();
        const media = emulatedMedia.media === "no-override" ? "" : emulatedMedia.media;
        const colorScheme = emulatedMedia.colorScheme === "no-override" ? "" : emulatedMedia.colorScheme;
        const reducedMotion = emulatedMedia.reducedMotion === "no-override" ? "" : emulatedMedia.reducedMotion;
        const forcedColors = emulatedMedia.forcedColors === "no-override" ? "" : emulatedMedia.forcedColors;
        const contrast = emulatedMedia.contrast === "no-override" ? "" : emulatedMedia.contrast;
        const features = [
          { name: "prefers-color-scheme", value: colorScheme },
          { name: "prefers-reduced-motion", value: reducedMotion },
          { name: "forced-colors", value: forcedColors },
          { name: "prefers-contrast", value: contrast }
        ];
        await this._client.send("Emulation.setEmulatedMedia", { media, features });
      }
      async _updateUserAgent() {
        const options = this._crPage._browserContext._options;
        await this._client.send("Emulation.setUserAgentOverride", {
          userAgent: options.userAgent || "",
          acceptLanguage: options.locale,
          userAgentMetadata: calculateUserAgentMetadata(options)
        });
      }
      async _setDefaultFontFamilies(session2) {
        const fontFamilies = platformToFontFamilies[this._crPage._browserContext._browser._platform()];
        await session2.send("Page.setFontFamilies", fontFamilies);
      }
      async _updateFileChooserInterception(initial) {
        const enabled = this._page.fileChooserIntercepted();
        if (initial && !enabled)
          return;
        await this._client.send("Page.setInterceptFileChooserDialog", { enabled }).catch(() => {
        });
      }
      async _evaluateOnNewDocument(initScript, world, runImmediately) {
        const worldName = world === "utility" ? this._crPage.utilityWorldName : void 0;
        const { identifier } = await this._client.send("Page.addScriptToEvaluateOnNewDocument", { source: initScript.source, worldName, runImmediately });
        this._initScriptIds.set(initScript, identifier);
      }
      async _removeEvaluatesOnNewDocument(initScripts) {
        const ids = [];
        for (const script of initScripts) {
          const id = this._initScriptIds.get(script);
          if (id)
            ids.push(id);
          this._initScriptIds.delete(script);
        }
        await Promise.all(ids.map((identifier) => this._client.send("Page.removeScriptToEvaluateOnNewDocument", { identifier }).catch(() => {
        })));
      }
      async exposePlaywrightBinding() {
        await this._client.send("Runtime.addBinding", { name: PageBinding.kBindingName });
      }
      async _getContentFrame(handle) {
        const nodeInfo = await this._client.send("DOM.describeNode", {
          objectId: handle._objectId
        });
        if (!nodeInfo || typeof nodeInfo.node.frameId !== "string")
          return null;
        return this._page.frameManager.frame(nodeInfo.node.frameId);
      }
      async _getOwnerFrame(handle) {
        const documentElement = await handle.evaluateHandle((node) => {
          const doc = node;
          if (doc.documentElement && doc.documentElement.ownerDocument === doc)
            return doc.documentElement;
          return node.ownerDocument ? node.ownerDocument.documentElement : null;
        });
        if (!documentElement)
          return null;
        if (!documentElement._objectId)
          return null;
        const nodeInfo = await this._client.send("DOM.describeNode", {
          objectId: documentElement._objectId
        });
        const frameId = nodeInfo && typeof nodeInfo.node.frameId === "string" ? nodeInfo.node.frameId : null;
        documentElement.dispose();
        return frameId;
      }
      async _getBoundingBox(handle) {
        const result2 = await this._client._sendMayFail("DOM.getBoxModel", {
          objectId: handle._objectId
        });
        if (!result2)
          return null;
        const quad = result2.model.border;
        const x = Math.min(quad[0], quad[2], quad[4], quad[6]);
        const y = Math.min(quad[1], quad[3], quad[5], quad[7]);
        const width = Math.max(quad[0], quad[2], quad[4], quad[6]) - x;
        const height = Math.max(quad[1], quad[3], quad[5], quad[7]) - y;
        const position = await this._framePosition();
        if (!position)
          return null;
        return { x: x + position.x, y: y + position.y, width, height };
      }
      async _framePosition() {
        const frame = this._page.frameManager.frame(this._targetId);
        if (!frame)
          return null;
        if (frame === this._page.mainFrame())
          return { x: 0, y: 0 };
        const element2 = await frame.frameElement(nullProgress);
        const box = await element2.boundingBox(nullProgress);
        return box;
      }
      async _scrollRectIntoViewIfNeeded(handle, rect) {
        return await this._client.send("DOM.scrollIntoViewIfNeeded", {
          objectId: handle._objectId,
          rect
        }).then(() => "done").catch((e) => {
          if (e instanceof Error && e.message.includes("Node does not have a layout object"))
            return "error:notvisible";
          if (e instanceof Error && e.message.includes("Node is detached from document"))
            return "error:notconnected";
          throw e;
        });
      }
      async _getContentQuads(handle) {
        const result2 = await this._client._sendMayFail("DOM.getContentQuads", {
          objectId: handle._objectId
        });
        if (!result2)
          return null;
        const position = await this._framePosition();
        if (!position)
          return null;
        return result2.quads.map((quad) => [
          { x: quad[0] + position.x, y: quad[1] + position.y },
          { x: quad[2] + position.x, y: quad[3] + position.y },
          { x: quad[4] + position.x, y: quad[5] + position.y },
          { x: quad[6] + position.x, y: quad[7] + position.y }
        ]);
      }
      async _adoptElementHandle(handle, to) {
        const nodeInfo = await this._client.send("DOM.describeNode", {
          objectId: handle._objectId
        });
        return this._adoptBackendNodeId(nodeInfo.node.backendNodeId, to);
      }
      async _adoptBackendNodeId(backendNodeId, to) {
        const result2 = await this._client._sendMayFail("DOM.resolveNode", {
          backendNodeId,
          executionContextId: to.delegate._contextId
        });
        if (!result2 || result2.object.subtype === "null")
          throw new Error(kUnableToAdoptErrorMessage);
        return createHandle(to, result2.object).asElement();
      }
    };
  }
});

// packages/playwright-core/src/server/chromium/crServiceWorker.ts
var CRServiceWorker;
var init_crServiceWorker = __esm({
  "packages/playwright-core/src/server/chromium/crServiceWorker.ts"() {
    "use strict";
    init_page();
    init_crExecutionContext();
    init_crNetworkManager();
    init_browserContext();
    init_network2();
    init_console();
    init_crProtocolHelper();
    init_crPage();
    CRServiceWorker = class extends Worker {
      constructor(browserContext, session2, url2) {
        super(browserContext, url2);
        this._session = session2;
        this.browserContext = browserContext;
        if (!process.env.PLAYWRIGHT_DISABLE_SERVICE_WORKER_NETWORK)
          this._networkManager = new CRNetworkManager(null, this);
        session2.on("Inspector.targetCrashed", () => this.destroyExecutionContext("Service worker restarted"));
        session2.on("Runtime.executionContextCreated", (event) => {
          this.createExecutionContext(new CRExecutionContext(session2, event.context));
          if (this.browserContext._browser.majorVersion() < 143)
            this.workerScriptLoaded();
        });
        if (this.browserContext._browser.majorVersion() >= 143)
          session2.on("Inspector.workerScriptLoaded", () => this.workerScriptLoaded());
        if (this._networkManager && this._isNetworkInspectionEnabled()) {
          this.updateRequestInterception();
          this.updateExtraHTTPHeaders();
          this.updateHttpCredentials();
          this.updateOffline();
          this.updateUserAgent();
          this._networkManager.addSession(
            session2,
            void 0,
            true
            /* isMain */
          ).catch(() => {
          });
        }
        session2.on("Runtime.consoleAPICalled", (event) => {
          if (!this.existingExecutionContext || process.env.PLAYWRIGHT_DISABLE_SERVICE_WORKER_CONSOLE)
            return;
          const args = event.args.map((o) => createHandle(this.existingExecutionContext, o));
          const message = new ConsoleMessage(null, this, event.type, void 0, args, stackTraceToLocation(event.stackTrace), event.timestamp);
          this.browserContext.emit(BrowserContext.Events.Console, message);
        });
        session2.send("Runtime.enable", {}).catch((e) => {
        });
        session2.send("Runtime.runIfWaitingForDebugger").catch((e) => {
        });
        session2.on("Inspector.targetReloadedAfterCrash", () => {
          session2._sendMayFail("Runtime.runIfWaitingForDebugger", {});
        });
      }
      didClose() {
        this._networkManager?.removeSession(this._session);
        this._session.dispose();
        super.didClose();
      }
      async updateOffline() {
        if (!this._isNetworkInspectionEnabled())
          return;
        await this._networkManager?.setOffline(!!this.browserContext._options.offline).catch(() => {
        });
      }
      async updateHttpCredentials() {
        if (!this._isNetworkInspectionEnabled())
          return;
        await this._networkManager?.authenticate(this.browserContext._options.httpCredentials || null).catch(() => {
        });
      }
      async updateExtraHTTPHeaders() {
        if (!this._isNetworkInspectionEnabled())
          return;
        await this._networkManager?.setExtraHTTPHeaders(this.browserContext._options.extraHTTPHeaders || []).catch(() => {
        });
      }
      async updateUserAgent() {
        const options = this.browserContext._options;
        await this._session.send("Emulation.setUserAgentOverride", {
          userAgent: options.userAgent || "",
          acceptLanguage: options.locale,
          userAgentMetadata: calculateUserAgentMetadata(options)
        }).catch(() => {
        });
      }
      async updateRequestInterception() {
        if (!this._isNetworkInspectionEnabled())
          return;
        await this._networkManager?.setRequestInterception(this.needsRequestInterception()).catch(() => {
        });
      }
      needsRequestInterception() {
        return this._isNetworkInspectionEnabled() && this.browserContext.requestInterceptors.length > 0;
      }
      reportRequestFinished(request2, response2) {
        this.browserContext.emit(BrowserContext.Events.RequestFinished, { request: request2, response: response2 });
      }
      requestFailed(request2, _canceled) {
        this.browserContext.emit(BrowserContext.Events.RequestFailed, request2);
      }
      requestReceivedResponse(response2) {
        this.browserContext.emit(BrowserContext.Events.Response, response2);
      }
      requestStarted(request2, route2) {
        this.browserContext.emit(BrowserContext.Events.Request, request2);
        if (route2)
          new Route(request2, route2).handle(this.browserContext.requestInterceptors);
      }
      _isNetworkInspectionEnabled() {
        return this.browserContext._options.serviceWorkers !== "block";
      }
    };
  }
});

// packages/playwright-core/src/server/chromium/crBrowser.ts
function shouldProxyLoopback(bypass) {
  if (process.env.PLAYWRIGHT_DISABLE_FORCED_CHROMIUM_PROXIED_LOOPBACK)
    return false;
  const hosts = (bypass || "").split(",").map((s) => s.trim());
  const shouldBypassSomeLoopback = ["localhost", "127.0.0.1", "::1", "[::]", "[::1]", "<loopback>", "<-loopback>"].some((host) => hosts.includes(host));
  return !shouldBypassSomeLoopback;
}
var import_path22, CRBrowser, CREvents, CRBrowserContext;
var init_crBrowser = __esm({
  "packages/playwright-core/src/server/chromium/crBrowser.ts"() {
    "use strict";
    import_path22 = __toESM(require("path"));
    init_assert();
    init_crypto();
    init_artifact();
    init_browser();
    init_browserContext();
    init_frames();
    init_network2();
    init_page();
    init_crConnection();
    init_crPage();
    init_crProtocolHelper();
    init_crServiceWorker();
    CRBrowser = class _CRBrowser extends Browser {
      constructor(parent, connection, options) {
        super(parent, options);
        this._clientRootSessionPromise = null;
        this._contexts = /* @__PURE__ */ new Map();
        this._crPages = /* @__PURE__ */ new Map();
        this._serviceWorkers = /* @__PURE__ */ new Map();
        this._version = "";
        this._majorVersion = 0;
        this._revision = "";
        this._tracingRecording = false;
        this._userAgent = "";
        this._connection = connection;
        this._session = this._connection.rootSession;
        this._connection.on(ConnectionEvents.Disconnected, () => this._didDisconnect());
        this._session.on("Target.attachedToTarget", this._onAttachedToTarget.bind(this));
        this._session.on("Target.detachedFromTarget", this._onDetachedFromTarget.bind(this));
        this._session.on("Browser.downloadWillBegin", this._onDownloadWillBegin.bind(this));
        this._session.on("Browser.downloadProgress", this._onDownloadProgress.bind(this));
      }
      static async connect(parent, transport, options, devtools) {
        options = { ...options };
        const connection = new CRConnection(parent, transport, options.protocolLogger, options.browserLogsCollector);
        const browser = new _CRBrowser(parent, connection, options);
        browser._devtools = devtools;
        if (browser.isClank())
          browser._isBrowserCollocatedWithServer = false;
        const session2 = connection.rootSession;
        if (options.__testHookOnConnectToBrowser)
          await options.__testHookOnConnectToBrowser();
        const version3 = await session2.send("Browser.getVersion");
        browser._revision = version3.revision;
        browser._version = version3.product.substring(version3.product.indexOf("/") + 1);
        try {
          browser._majorVersion = +browser._version.split(".")[0];
        } catch {
        }
        browser._userAgent = version3.userAgent;
        browser.options.headful = !version3.userAgent.includes("Headless");
        if (!options.persistent) {
          await session2.send("Target.setAutoAttach", { autoAttach: true, waitForDebuggerOnStart: true, flatten: true });
          return browser;
        }
        browser._defaultContext = new CRBrowserContext(browser, void 0, options.persistent);
        await Promise.all([
          session2.send("Target.setAutoAttach", { autoAttach: true, waitForDebuggerOnStart: true, flatten: true }).then(async () => {
            await session2.send("Target.getTargetInfo");
          }),
          browser._defaultContext.initialize()
        ]);
        await browser._waitForAllPagesToBeInitialized();
        return browser;
      }
      async doCreateNewContext(options) {
        const proxy = options.proxyOverride || options.proxy;
        let proxyBypassList = void 0;
        if (proxy) {
          if (shouldProxyLoopback(proxy.bypass))
            proxyBypassList = "<-loopback>" + (proxy.bypass ? `,${proxy.bypass}` : "");
          else
            proxyBypassList = proxy.bypass;
        }
        const { browserContextId } = await this._session.send("Target.createBrowserContext", {
          disposeOnDetach: true,
          proxyServer: proxy ? proxy.server : void 0,
          proxyBypassList
        });
        const context2 = new CRBrowserContext(this, browserContextId, options);
        await context2.initialize();
        this._contexts.set(browserContextId, context2);
        return context2;
      }
      contexts() {
        return Array.from(this._contexts.values());
      }
      version() {
        return this._version;
      }
      majorVersion() {
        return this._majorVersion;
      }
      userAgent() {
        return this._userAgent;
      }
      _platform() {
        if (this._userAgent.includes("Windows"))
          return "win";
        if (this._userAgent.includes("Macintosh"))
          return "mac";
        return "linux";
      }
      isClank() {
        return this.options.name === "clank";
      }
      async _waitForAllPagesToBeInitialized() {
        await Promise.all([...this._crPages.values()].map((crPage) => crPage._page.waitForInitializedOrError()));
      }
      _onAttachedToTarget({ targetInfo, sessionId, waitingForDebugger }) {
        if (targetInfo.type === "browser")
          return;
        const session2 = this._session.createChildSession(sessionId);
        assert(targetInfo.browserContextId, "targetInfo: " + JSON.stringify(targetInfo, null, 2));
        let context2 = this._contexts.get(targetInfo.browserContextId) || null;
        if (!context2) {
          context2 = this._defaultContext;
        }
        if (targetInfo.type === "other" && targetInfo.url.startsWith("devtools://devtools") && this._devtools) {
          this._devtools.install(session2);
          return;
        }
        const treatOtherAsPage = targetInfo.type === "other" && process.env.PW_CHROMIUM_ATTACH_TO_OTHER;
        if (!context2 || targetInfo.type === "other" && !treatOtherAsPage) {
          session2.detach().catch(() => {
          });
          return;
        }
        assert(!this._crPages.has(targetInfo.targetId), "Duplicate target " + targetInfo.targetId);
        assert(!this._serviceWorkers.has(targetInfo.targetId), "Duplicate target " + targetInfo.targetId);
        if (targetInfo.type === "page" || treatOtherAsPage) {
          const opener = targetInfo.openerId ? this._crPages.get(targetInfo.openerId) || null : null;
          const crPage = new CRPage(session2, targetInfo.targetId, context2, opener, { hasUIWindow: targetInfo.type === "page" });
          this._crPages.set(targetInfo.targetId, crPage);
          return;
        }
        if (targetInfo.type === "service_worker") {
          const serviceWorker = new CRServiceWorker(context2, session2, targetInfo.url);
          this._serviceWorkers.set(targetInfo.targetId, serviceWorker);
          context2.emit(CRBrowserContext.CREvents.ServiceWorker, serviceWorker);
          return;
        }
        session2.detach().catch(() => {
        });
      }
      _onDetachedFromTarget(payload) {
        const targetId = payload.targetId;
        const crPage = this._crPages.get(targetId);
        if (crPage) {
          this._crPages.delete(targetId);
          crPage.didClose();
          return;
        }
        const serviceWorker = this._serviceWorkers.get(targetId);
        if (serviceWorker) {
          this._serviceWorkers.delete(targetId);
          serviceWorker.didClose();
          return;
        }
      }
      _didDisconnect() {
        for (const crPage of this._crPages.values())
          crPage.didClose();
        this._crPages.clear();
        for (const serviceWorker of this._serviceWorkers.values())
          serviceWorker.didClose();
        this._serviceWorkers.clear();
        this.didClose();
      }
      _findOwningPage(frameId) {
        for (const crPage of this._crPages.values()) {
          const frame = crPage._page.frameManager.frame(frameId);
          if (frame)
            return crPage;
        }
        return null;
      }
      _onDownloadWillBegin(payload) {
        const page = this._findOwningPage(payload.frameId);
        if (!page) {
          return;
        }
        page.willBeginDownload();
        let originPage = page._page.initializedOrUndefined();
        if (!originPage && page._opener)
          originPage = page._opener._page.initializedOrUndefined();
        if (!originPage)
          return;
        this.downloadCreated(originPage, payload.guid, payload.url, payload.suggestedFilename);
      }
      _onDownloadProgress(payload) {
        if (payload.state === "completed")
          this.downloadFinished(payload.guid, "");
        if (payload.state === "canceled")
          this.downloadFinished(payload.guid, this._closeReason || "canceled");
      }
      async _closePage(crPage) {
        await this._session.send("Target.closeTarget", { targetId: crPage._targetId });
      }
      async newBrowserCDPSession() {
        return await this._connection.createBrowserSession();
      }
      async startTracing(page, options = {}) {
        assert(!this._tracingRecording, "Cannot start recording trace while already recording trace.");
        this._tracingClient = page ? page.delegate._mainFrameSession._client : this._session;
        const defaultCategories = [
          "-*",
          "devtools.timeline",
          "v8.execute",
          "disabled-by-default-devtools.timeline",
          "disabled-by-default-devtools.timeline.frame",
          "toplevel",
          "blink.console",
          "blink.user_timing",
          "latencyInfo",
          "disabled-by-default-devtools.timeline.stack",
          "disabled-by-default-v8.cpu_profiler",
          "disabled-by-default-v8.cpu_profiler.hires"
        ];
        const {
          screenshots = false,
          categories: categories2 = defaultCategories
        } = options;
        if (screenshots)
          categories2.push("disabled-by-default-devtools.screenshot");
        this._tracingRecording = true;
        await this._tracingClient.send("Tracing.start", {
          transferMode: "ReturnAsStream",
          categories: categories2.join(",")
        });
      }
      async stopTracing() {
        assert(this._tracingClient, "Tracing was not started.");
        const [event] = await Promise.all([
          new Promise((f) => this._tracingClient.once("Tracing.tracingComplete", f)),
          this._tracingClient.send("Tracing.end")
        ]);
        const tracingPath = import_path22.default.join(this.options.artifactsDir, createGuid() + ".crtrace");
        await saveProtocolStream(this._tracingClient, event.stream, tracingPath);
        this._tracingRecording = false;
        const artifact = new Artifact(this, tracingPath);
        artifact.reportFinished();
        return artifact;
      }
      isConnected() {
        return !this._connection._closed;
      }
      async _clientRootSession() {
        if (!this._clientRootSessionPromise)
          this._clientRootSessionPromise = this._connection.createBrowserSession();
        return this._clientRootSessionPromise;
      }
    };
    CREvents = {
      ServiceWorker: "serviceworker"
    };
    CRBrowserContext = class extends BrowserContext {
      static {
        this.CREvents = CREvents;
      }
      constructor(browser, browserContextId, options) {
        super(browser, options, browserContextId);
        this.authenticateProxyViaCredentials();
      }
      async initialize() {
        assert(!Array.from(this._browser._crPages.values()).some((page) => page._browserContext === this));
        const promises = [super.initialize()];
        if (this._browser.options.name !== "clank" && this._options.acceptDownloads !== "internal-browser-default") {
          promises.push(this._browser._session.send("Browser.setDownloadBehavior", {
            behavior: this._options.acceptDownloads === "accept" ? "allowAndName" : "deny",
            browserContextId: this._browserContextId,
            downloadPath: this._browser.options.downloadsPath,
            eventsEnabled: true
          }));
        }
        await Promise.all(promises);
      }
      _crPages() {
        return [...this._browser._crPages.values()].filter((crPage) => crPage._browserContext === this);
      }
      possiblyUninitializedPages() {
        return this._crPages().map((crPage) => crPage._page);
      }
      async doCreateNewPage() {
        const { targetId } = await this._browser._session.send("Target.createTarget", { url: "about:blank", browserContextId: this._browserContextId });
        return this._browser._crPages.get(targetId)._page;
      }
      async doGetCookies(urls) {
        const { cookies } = await this._browser._session.send("Storage.getCookies", { browserContextId: this._browserContextId });
        return filterCookies(cookies.map((c) => {
          const { name, value: value2, domain, path: path59, expires, httpOnly, secure, sameSite } = c;
          const copy = {
            name,
            value: value2,
            domain,
            path: path59,
            expires,
            httpOnly,
            secure,
            sameSite: sameSite ?? "Lax"
          };
          if (c.partitionKey) {
            copy._crHasCrossSiteAncestor = c.partitionKey.hasCrossSiteAncestor;
            copy.partitionKey = c.partitionKey.topLevelSite;
          }
          return copy;
        }), urls);
      }
      async addCookies(cookies) {
        function toChromiumCookie(cookie) {
          const { name, value: value2, url: url2, domain, path: path59, expires, httpOnly, secure, sameSite, partitionKey, _crHasCrossSiteAncestor } = cookie;
          const copy = {
            name,
            value: value2,
            url: url2,
            domain,
            path: path59,
            expires,
            httpOnly,
            secure,
            sameSite
          };
          if (partitionKey) {
            copy.partitionKey = {
              topLevelSite: partitionKey,
              // _crHasCrossSiteAncestor is non-standard, set it true by default if the cookie is partitioned.
              hasCrossSiteAncestor: _crHasCrossSiteAncestor ?? true
            };
          }
          return copy;
        }
        await this._browser._session.send("Storage.setCookies", {
          cookies: rewriteCookies(cookies).map(toChromiumCookie),
          browserContextId: this._browserContextId
        });
      }
      async doClearCookies() {
        await this._browser._session.send("Storage.clearCookies", { browserContextId: this._browserContextId });
      }
      async doGrantPermissions(origin, permissions) {
        const webPermissionToProtocol = /* @__PURE__ */ new Map([
          ["geolocation", "geolocation"],
          ["midi", "midi"],
          ["notifications", "notifications"],
          ["camera", "videoCapture"],
          ["microphone", "audioCapture"],
          ["background-sync", "backgroundSync"],
          ["ambient-light-sensor", "sensors"],
          ["accelerometer", "sensors"],
          ["gyroscope", "sensors"],
          ["magnetometer", "sensors"],
          ["clipboard-read", "clipboardReadWrite"],
          ["clipboard-write", "clipboardSanitizedWrite"],
          ["payment-handler", "paymentHandler"],
          // chrome-specific permissions we have.
          ["midi-sysex", "midiSysex"],
          ["storage-access", "storageAccess"],
          ["local-fonts", "localFonts"],
          ["local-network-access", ["localNetworkAccess", "localNetwork", "loopbackNetwork"]],
          ["screen-wake-lock", "wakeLockScreen"]
        ]);
        const grantPermissions = async (mapping) => {
          const filtered = permissions.flatMap((permission) => {
            const protocolPermission = mapping.get(permission);
            if (!protocolPermission)
              throw new Error("Unknown permission: " + permission);
            return typeof protocolPermission === "string" ? [protocolPermission] : protocolPermission;
          });
          await this._browser._session.send("Browser.grantPermissions", { origin: origin === "*" ? void 0 : origin, browserContextId: this._browserContextId, permissions: filtered });
        };
        try {
          await grantPermissions(webPermissionToProtocol);
        } catch (e) {
          const fallbackMapping = new Map(webPermissionToProtocol);
          fallbackMapping.set("local-network-access", ["localNetworkAccess"]);
          await grantPermissions(fallbackMapping);
        }
      }
      async doClearPermissions() {
        await this._browser._session.send("Browser.resetPermissions", { browserContextId: this._browserContextId });
      }
      async setGeolocation(geolocation) {
        verifyGeolocation(geolocation);
        this._options.geolocation = geolocation;
        for (const page of this.pages())
          await page.delegate.updateGeolocation();
      }
      async doUpdateExtraHTTPHeaders() {
        for (const page of this.pages())
          await page.delegate.updateExtraHTTPHeaders();
        for (const sw of this.serviceWorkers())
          await sw.updateExtraHTTPHeaders();
      }
      async setUserAgent(userAgent) {
        this._options.userAgent = userAgent;
        await Promise.all([
          ...this.pages().map((page) => page.delegate.updateUserAgent()),
          ...this.serviceWorkers().map((sw) => sw.updateUserAgent())
        ]);
      }
      async doUpdateOffline() {
        for (const page of this.pages())
          await page.delegate.updateOffline();
        for (const sw of this.serviceWorkers())
          await sw.updateOffline();
      }
      async doSetHTTPCredentials(httpCredentials) {
        this._options.httpCredentials = httpCredentials;
        for (const page of this.pages())
          await page.delegate.updateHttpCredentials();
        for (const sw of this.serviceWorkers())
          await sw.updateHttpCredentials();
      }
      async doAddInitScript(initScript) {
        for (const page of this.pages())
          await page.delegate.addInitScript(initScript);
      }
      async doRemoveInitScripts(initScripts) {
        for (const page of this.pages())
          await page.delegate.removeInitScripts(initScripts);
      }
      async doUpdateRequestInterception() {
        for (const page of this.pages())
          await page.delegate.updateRequestInterception();
        for (const sw of this.serviceWorkers())
          await sw.updateRequestInterception();
      }
      async doUpdateDefaultViewport() {
      }
      async doUpdateDefaultEmulatedMedia() {
      }
      async doExposePlaywrightBinding() {
        for (const page of this._crPages())
          await page.exposePlaywrightBinding();
      }
      async doClose(reason) {
        await this.dialogManager.closeBeforeUnloadDialogs();
        if (!this._browserContextId) {
          return "close-browser";
        }
        await Promise.all([...this._downloads].map((download) => download.cancel().catch(() => {
        })));
        await this._browser._session.send("Target.disposeBrowserContext", { browserContextId: this._browserContextId });
        this._browser._contexts.delete(this._browserContextId);
        for (const [targetId, serviceWorker] of this._browser._serviceWorkers) {
          if (serviceWorker.browserContext !== this)
            continue;
          serviceWorker.didClose();
          this._browser._serviceWorkers.delete(targetId);
        }
      }
      onClosePersistent() {
      }
      async clearCache() {
        for (const page of this._crPages())
          await page._networkManager.clearCache();
      }
      async cancelDownload(guid) {
        await this._browser._session.send("Browser.cancelDownload", {
          guid,
          browserContextId: this._browserContextId
        });
      }
      serviceWorkers() {
        return Array.from(this._browser._serviceWorkers.values()).filter((serviceWorker) => serviceWorker.browserContext === this);
      }
      async newCDPSession(page) {
        let targetId = null;
        if (page instanceof Page) {
          targetId = page.delegate._targetId;
        } else if (page instanceof Frame) {
          const session2 = page._page.delegate._sessions.get(page._id);
          if (!session2)
            throw new Error(`This frame does not have a separate CDP session, it is a part of the parent frame's session`);
          targetId = session2._targetId;
        } else {
          throw new Error("page: expected Page or Frame");
        }
        const rootSession = await this._browser._clientRootSession();
        return rootSession.attachToTarget(targetId);
      }
    };
  }
});

// packages/playwright-core/src/server/android/android.ts
function encodeWebFrame(data) {
  return import_utilsBundle.wsSender.frame(Buffer.from(data), {
    opcode: 1,
    mask: true,
    fin: true,
    readOnly: true
  })[0];
}
var import_events7, import_fs24, import_os9, import_path23, import_utilsBundle, debug3, ARTIFACTS_FOLDER, Android, AndroidDevice, AndroidBrowser, ClankBrowserProcess;
var init_android = __esm({
  "packages/playwright-core/src/server/android/android.ts"() {
    "use strict";
    import_events7 = require("events");
    import_fs24 = __toESM(require("fs"));
    import_os9 = __toESM(require("os"));
    import_path23 = __toESM(require("path"));
    init_pipeTransport();
    init_crypto();
    init_debug();
    init_env();
    init_task();
    init_debugLogger();
    init_fileUtils();
    init_processLauncher();
    import_utilsBundle = require("./utilsBundle");
    init_browserContext();
    init_chromiumSwitches();
    init_crBrowser();
    init_helper();
    init_instrumentation();
    init_progress();
    init_registry();
    debug3 = require("./utilsBundle").debug;
    ARTIFACTS_FOLDER = import_path23.default.join(import_os9.default.tmpdir(), "playwright-artifacts-");
    Android = class extends SdkObject {
      constructor(parent, backend) {
        super(parent, "android");
        this._devices = /* @__PURE__ */ new Map();
        this._backend = backend;
      }
      async devices(progress2, options) {
        const devices = (await progress2.race(this._backend.devices(options))).filter((d) => d.status === "device");
        const newSerials = /* @__PURE__ */ new Set();
        for (const d of devices) {
          newSerials.add(d.serial);
          if (this._devices.has(d.serial))
            continue;
          await progress2.race(AndroidDevice.create(this, d, options).then((device) => this._devices.set(d.serial, device)));
        }
        for (const d of this._devices.keys()) {
          if (!newSerials.has(d))
            this._devices.delete(d);
        }
        return [...this._devices.values()];
      }
      _deviceClosed(device) {
        this._devices.delete(device.serial);
      }
    };
    AndroidDevice = class _AndroidDevice extends SdkObject {
      constructor(android, backend, model, options) {
        super(android, "android-device");
        this._lastId = 0;
        this._callbacks = /* @__PURE__ */ new Map();
        this._webViews = /* @__PURE__ */ new Map();
        this._browserConnections = /* @__PURE__ */ new Set();
        this._isClosed = false;
        this._android = android;
        this._backend = backend;
        this.model = model;
        this.serial = backend.serial;
        this._options = options;
        this.logName = "browser";
      }
      static {
        this.Events = {
          WebViewAdded: "webViewAdded",
          WebViewRemoved: "webViewRemoved",
          Close: "close"
        };
      }
      static async create(android, backend, options) {
        await backend.init();
        const model = await backend.runCommand("shell:getprop ro.product.model");
        const device = new _AndroidDevice(android, backend, model.toString().trim(), options);
        await device._init();
        return device;
      }
      async _init() {
        await this._refreshWebViews();
        const poll = () => {
          this._pollingWebViews = setTimeout(() => this._refreshWebViews().then(poll).catch(() => {
            this._close().catch(() => {
            });
          }), 500);
        };
        poll();
      }
      async shell(progress2, command) {
        return await progress2.race(this._shell(command));
      }
      async _shell(command) {
        const result2 = await this._backend.runCommand(`shell:${command}`);
        await this._refreshWebViews();
        return result2;
      }
      async open(progress2, command) {
        return await this._open(progress2, command);
      }
      async screenshot(progress2) {
        return await progress2.race(this._backend.runCommand(`shell:screencap -p`));
      }
      async _driver() {
        if (this._isClosed)
          return;
        if (!this._driverPromise) {
          const controller = new ProgressController();
          this._driverPromise = controller.run((progress2) => this._installDriver(progress2));
        }
        return this._driverPromise;
      }
      async _installDriver(progress2) {
        debug3("pw:android")("Stopping the old driver");
        await progress2.race(this._shell(`am force-stop com.microsoft.playwright.androiddriver`));
        if (!this._options.omitDriverInstall) {
          debug3("pw:android")("Uninstalling the old driver");
          await this.shell(progress2, `cmd package uninstall com.microsoft.playwright.androiddriver`);
          await this.shell(progress2, `cmd package uninstall com.microsoft.playwright.androiddriver.test`);
          debug3("pw:android")("Installing the new driver");
          const executable = registry.findExecutable("android");
          const packageManagerCommand = getPackageManagerExecCommand();
          for (const file of ["android-driver.apk", "android-driver-target.apk"]) {
            const fullName = import_path23.default.join(executable.directory, file);
            if (!import_fs24.default.existsSync(fullName))
              throw new Error(`Please install Android driver apk using '${packageManagerCommand} playwright install android'`);
            await this.installApk(progress2, await progress2.race(import_fs24.default.promises.readFile(fullName)));
          }
        } else {
          debug3("pw:android")("Skipping the driver installation");
        }
        debug3("pw:android")("Starting the new driver");
        this._shell("am instrument -w com.microsoft.playwright.androiddriver.test/androidx.test.runner.AndroidJUnitRunner").catch((e) => debug3("pw:android")(e));
        const socket = await this._waitForLocalAbstract(progress2, "playwright_android_driver_socket");
        const transport = new PipeTransport(socket, socket, socket, "be");
        transport.onmessage = (message) => {
          const response2 = JSON.parse(message);
          const { id, result: result2, error } = response2;
          const callback = this._callbacks.get(id);
          if (!callback)
            return;
          if (error)
            callback.reject(new Error(error));
          else
            callback.fulfill(result2);
          this._callbacks.delete(id);
        };
        return transport;
      }
      async _waitForLocalAbstract(progress2, socketName) {
        let socket;
        debug3("pw:android")(`Polling the socket localabstract:${socketName}`);
        while (!socket) {
          try {
            socket = await this._open(progress2, `localabstract:${socketName}`);
          } catch (e) {
            if (isAbortError(e))
              throw e;
            await progress2.wait(250);
          }
        }
        debug3("pw:android")(`Connected to localabstract:${socketName}`);
        return socket;
      }
      async send(progress2, method, params2 = {}) {
        return await progress2.race(this._send(method, params2));
      }
      async _send(method, params2 = {}) {
        params2 = {
          ...params2,
          // Patch the timeout in, just in case it's missing in one of the commands.
          timeout: params2.timeout || 0
        };
        if (params2.androidSelector) {
          params2.selector = params2.androidSelector;
          delete params2.androidSelector;
        }
        const driver = await this._driver();
        if (!driver || this._isClosed)
          throw new Error("Device is closed");
        const id = ++this._lastId;
        const result2 = new Promise((fulfill, reject) => this._callbacks.set(id, { fulfill, reject }));
        driver.send(JSON.stringify({ id, method, params: params2 }));
        return result2;
      }
      async close(progress2) {
        await progress2.race(this._close());
      }
      async _close() {
        if (this._isClosed)
          return;
        this._isClosed = true;
        if (this._pollingWebViews)
          clearTimeout(this._pollingWebViews);
        for (const connection of this._browserConnections)
          await connection.close();
        for (const callback of this._callbacks.values())
          callback.reject(new Error("Device closed"));
        this._callbacks.clear();
        if (this._driverPromise) {
          const driver = await this._driver();
          driver?.close();
        }
        await this._backend.close();
        this._android._deviceClosed(this);
        this.emit(_AndroidDevice.Events.Close);
      }
      async launchBrowser(progress2, pkg = "com.android.chrome", options) {
        debug3("pw:android")("Force-stopping", pkg);
        await progress2.race(this._backend.runCommand(`shell:am force-stop ${pkg}`));
        const socketName = isUnderTest() ? "webview_devtools_remote_playwright_test" : "playwright_" + createGuid() + "_devtools_remote";
        const commandLine = this._defaultArgs(options, socketName).join(" ");
        debug3("pw:android")("Starting", pkg, commandLine);
        await progress2.race(this._backend.runCommand(`shell:echo "${Buffer.from(commandLine).toString("base64")}" | base64 -d > /data/local/tmp/chrome-command-line`));
        await progress2.race(this._backend.runCommand(`shell:am start -a android.intent.action.VIEW -d about:blank ${pkg}`));
        const browserContext = await this._connectToBrowser(progress2, socketName, options);
        try {
          await progress2.race(this._backend.runCommand(`shell:rm /data/local/tmp/chrome-command-line`));
          return browserContext;
        } catch (error) {
          await browserContext.close(progress2, { reason: "Failed to launch" }).catch(() => {
          });
          throw error;
        }
      }
      _defaultArgs(options, socketName) {
        const chromeArguments = [
          "_",
          "--disable-fre",
          "--no-default-browser-check",
          `--remote-debugging-socket-name=${socketName}`,
          ...chromiumSwitches({ android: true }),
          ...this._innerDefaultArgs(options)
        ];
        return chromeArguments;
      }
      _innerDefaultArgs(options) {
        const { args = [], proxy } = options;
        const chromeArguments = [];
        if (proxy) {
          chromeArguments.push(`--proxy-server=${proxy.server}`);
          const proxyBypassRules = [];
          if (proxy.bypass)
            proxyBypassRules.push(...proxy.bypass.split(",").map((t) => t.trim()).map((t) => t.startsWith(".") ? "*" + t : t));
          if (shouldProxyLoopback(proxy.bypass))
            proxyBypassRules.push("<-loopback>");
          if (proxyBypassRules.length > 0)
            chromeArguments.push(`--proxy-bypass-list=${proxyBypassRules.join(";")}`);
        }
        chromeArguments.push(...args);
        return chromeArguments;
      }
      async connectToWebView(progress2, socketName) {
        const webView = this._webViews.get(socketName);
        if (!webView)
          throw new Error("WebView has been closed");
        return await this._connectToBrowser(progress2, socketName);
      }
      async _connectToBrowser(progress2, socketName, options = {}) {
        const socket = await this._waitForLocalAbstract(progress2, socketName);
        try {
          const androidBrowser = new AndroidBrowser(this, socket);
          await progress2.race(androidBrowser._init());
          this._browserConnections.add(androidBrowser);
          const artifactsDir = await progress2.race(import_fs24.default.promises.mkdtemp(ARTIFACTS_FOLDER));
          const cleanupArtifactsDir = async () => {
            const errors = (await removeFolders([artifactsDir])).filter(Boolean);
            for (let i = 0; i < (errors || []).length; ++i)
              debug3("pw:android")(`exception while removing ${artifactsDir}: ${errors[i]}`);
          };
          gracefullyCloseSet.add(cleanupArtifactsDir);
          socket.on("close", async () => {
            gracefullyCloseSet.delete(cleanupArtifactsDir);
            cleanupArtifactsDir().catch((e) => debug3("pw:android")(`could not cleanup artifacts dir: ${e}`));
          });
          const browserOptions = {
            name: "clank",
            browserType: "chromium",
            slowMo: 0,
            persistent: { ...options, noDefaultViewport: true },
            artifactsDir,
            downloadsPath: artifactsDir,
            tracesDir: artifactsDir,
            browserProcess: new ClankBrowserProcess(androidBrowser),
            proxy: options.proxy,
            protocolLogger: helper.debugProtocolLogger(),
            browserLogsCollector: new RecentLogsCollector(),
            originalLaunchOptions: {}
          };
          validateBrowserContextOptions(options, browserOptions);
          const browser = await progress2.race(CRBrowser.connect(this.attribution.playwright, androidBrowser, browserOptions));
          const defaultContext = browser._defaultContext;
          await defaultContext.loadDefaultContextAsIs(progress2);
          return defaultContext;
        } catch (error) {
          socket.close();
          throw error;
        }
      }
      _open(progress2, command) {
        return raceUncancellableOperationWithCleanup(progress2, () => this._backend.open(command), (socket) => socket.close());
      }
      webViews() {
        return [...this._webViews.values()];
      }
      async installApk(progress2, content, options) {
        const args = options && options.args ? options.args : ["-r", "-t", "-S"];
        debug3("pw:android")("Opening install socket");
        const installSocket = await this._open(progress2, `shell:cmd package install ${args.join(" ")} ${content.length}`);
        debug3("pw:android")("Writing driver bytes: " + content.length);
        await progress2.race(installSocket.write(content));
        const success = await progress2.race(new Promise((f) => installSocket.on("data", f)));
        debug3("pw:android")("Written driver bytes: " + success);
        installSocket.close();
      }
      async push(progress2, content, path59, mode = 420) {
        const socket = await this._open(progress2, `sync:`);
        const sendHeader = async (progress3, command, length) => {
          const buffer = Buffer.alloc(command.length + 4);
          buffer.write(command, 0);
          buffer.writeUInt32LE(length, command.length);
          await progress3.race(socket.write(buffer));
        };
        const send = async (progress3, command, data) => {
          await sendHeader(progress3, command, data.length);
          await progress3.race(socket.write(data));
        };
        await send(progress2, "SEND", Buffer.from(`${path59},${mode}`));
        const maxChunk = 65535;
        for (let i = 0; i < content.length; i += maxChunk)
          await send(progress2, "DATA", content.slice(i, i + maxChunk));
        await sendHeader(progress2, "DONE", Date.now() / 1e3 | 0);
        const result2 = await progress2.race(new Promise((f) => socket.once("data", f)));
        const code = result2.slice(0, 4).toString();
        if (code !== "OKAY")
          throw new Error("Could not push: " + code);
        socket.close();
      }
      async _refreshWebViews() {
        const sockets = (await this._backend.runCommand(`shell:cat /proc/net/unix | grep webview_devtools_remote`)).toString().split("\n");
        if (this._isClosed)
          return;
        const socketNames = /* @__PURE__ */ new Set();
        for (const line of sockets) {
          const matchSocketName = line.match(/[^@]+@(.*?webview_devtools_remote_?.*)/);
          if (!matchSocketName)
            continue;
          const socketName = matchSocketName[1];
          socketNames.add(socketName);
          if (this._webViews.has(socketName))
            continue;
          const match = line.match(/[^@]+@.*?webview_devtools_remote_?(\d*)/);
          let pid = -1;
          if (match && match[1])
            pid = +match[1];
          const pkg = await this._extractPkg(pid);
          if (this._isClosed)
            return;
          const webView = { pid, pkg, socketName };
          this._webViews.set(socketName, webView);
          this.emit(_AndroidDevice.Events.WebViewAdded, webView);
        }
        for (const p of this._webViews.keys()) {
          if (!socketNames.has(p)) {
            this._webViews.delete(p);
            this.emit(_AndroidDevice.Events.WebViewRemoved, p);
          }
        }
      }
      async _extractPkg(pid) {
        let pkg = "";
        if (pid === -1)
          return pkg;
        const procs = (await this._backend.runCommand(`shell:ps -A | grep ${pid}`)).toString().split("\n");
        for (const proc of procs) {
          const match = proc.match(/[^\s]+\s+(\d+).*$/);
          if (!match)
            continue;
          pkg = proc.substring(proc.lastIndexOf(" ") + 1);
        }
        return pkg;
      }
    };
    AndroidBrowser = class extends import_events7.EventEmitter {
      constructor(device, socket) {
        super();
        this._waitForNextTask = makeWaitForNextTask();
        this.setMaxListeners(0);
        this.device = device;
        this._socket = socket;
        this._socket.on("close", () => {
          this._waitForNextTask(() => {
            if (this.onclose)
              this.onclose();
          });
        });
        this._receiver = new import_utilsBundle.wsReceiver();
        this._receiver.on("message", (message) => {
          this._waitForNextTask(() => {
            if (this.onmessage)
              this.onmessage(JSON.parse(message));
          });
        });
      }
      async _init() {
        await this._socket.write(Buffer.from(`GET /devtools/browser HTTP/1.1\r
Upgrade: WebSocket\r
Connection: Upgrade\r
Sec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ==\r
Sec-WebSocket-Version: 13\r
\r
`));
        await new Promise((f) => this._socket.once("data", f));
        this._socket.on("data", (data) => this._receiver._write(data, "binary", () => {
        }));
      }
      async send(s) {
        await this._socket.write(encodeWebFrame(JSON.stringify(s)));
      }
      async close() {
        this._socket.close();
      }
    };
    ClankBrowserProcess = class {
      constructor(browser) {
        this._browser = browser;
      }
      async kill() {
      }
      async close() {
        await this._browser.close();
      }
    };
  }
});

// packages/playwright-core/src/server/android/backendAdb.ts
async function runCommand(command, host = "127.0.0.1", port = 5037, serial) {
  debug4("pw:adb:runCommand")(command, serial);
  const socket = new BufferedSocketWrapper(command, import_net4.default.createConnection({ host, port }));
  try {
    if (serial) {
      await socket.write(encodeMessage(`host:transport:${serial}`));
      const status2 = await socket.read(4);
      assert(status2.toString() === "OKAY", status2.toString());
    }
    await socket.write(encodeMessage(command));
    const status = await socket.read(4);
    assert(status.toString() === "OKAY", status.toString());
    let commandOutput;
    if (!command.startsWith("shell:")) {
      const remainingLength = parseInt((await socket.read(4)).toString(), 16);
      commandOutput = await socket.read(remainingLength);
    } else {
      commandOutput = await socket.readAll();
    }
    return commandOutput;
  } finally {
    socket.close();
  }
}
async function open(command, host = "127.0.0.1", port = 5037, serial) {
  const socket = new BufferedSocketWrapper(command, import_net4.default.createConnection({ host, port }));
  if (serial) {
    await socket.write(encodeMessage(`host:transport:${serial}`));
    const status2 = await socket.read(4);
    assert(status2.toString() === "OKAY", status2.toString());
  }
  await socket.write(encodeMessage(command));
  const status = await socket.read(4);
  assert(status.toString() === "OKAY", status.toString());
  return socket;
}
function encodeMessage(message) {
  let lenHex = message.length.toString(16);
  lenHex = "0".repeat(4 - lenHex.length) + lenHex;
  return Buffer.from(lenHex + message);
}
var import_events8, import_net4, debug4, AdbBackend, AdbDevice, BufferedSocketWrapper;
var init_backendAdb = __esm({
  "packages/playwright-core/src/server/android/backendAdb.ts"() {
    "use strict";
    import_events8 = require("events");
    import_net4 = __toESM(require("net"));
    init_assert();
    debug4 = require("./utilsBundle").debug;
    AdbBackend = class {
      async devices(options = {}) {
        const result2 = await runCommand("host:devices", options.host, options.port);
        const lines = result2.toString().trim().split("\n");
        return lines.map((line) => {
          const [serial, status] = line.trim().split("	");
          return new AdbDevice(serial, status, options.host, options.port);
        });
      }
    };
    AdbDevice = class {
      constructor(serial, status, host, port) {
        this._closed = false;
        this.serial = serial;
        this.status = status;
        this.host = host;
        this.port = port;
      }
      async init() {
      }
      async close() {
        this._closed = true;
      }
      runCommand(command) {
        if (this._closed)
          throw new Error("Device is closed");
        return runCommand(command, this.host, this.port, this.serial);
      }
      async open(command) {
        if (this._closed)
          throw new Error("Device is closed");
        const result2 = await open(command, this.host, this.port, this.serial);
        result2.becomeSocket();
        return result2;
      }
    };
    BufferedSocketWrapper = class extends import_events8.EventEmitter {
      constructor(command, socket) {
        super();
        this._buffer = Buffer.from([]);
        this._isSocket = false;
        this._isClosed = false;
        this._command = command;
        this._socket = socket;
        this._connectPromise = new Promise((f) => this._socket.on("connect", f));
        this._socket.on("data", (data) => {
          debug4("pw:adb:data")(data.toString());
          if (this._isSocket) {
            this.emit("data", data);
            return;
          }
          this._buffer = Buffer.concat([this._buffer, data]);
          if (this._notifyReader)
            this._notifyReader();
        });
        this._socket.on("close", () => {
          this._isClosed = true;
          if (this._notifyReader)
            this._notifyReader();
          this.close();
          this.emit("close");
        });
        this._socket.on("error", (error) => this.emit("error", error));
      }
      async write(data) {
        debug4("pw:adb:send")(data.toString().substring(0, 100) + "...");
        await this._connectPromise;
        await new Promise((f) => this._socket.write(data, f));
      }
      close() {
        if (this._isClosed)
          return;
        debug4("pw:adb")("Close " + this._command);
        this._socket.destroy();
      }
      async read(length) {
        await this._connectPromise;
        assert(!this._isSocket, "Can not read by length in socket mode");
        while (this._buffer.length < length)
          await new Promise((f) => this._notifyReader = f);
        const result2 = this._buffer.slice(0, length);
        this._buffer = this._buffer.slice(length);
        debug4("pw:adb:recv")(result2.toString().substring(0, 100) + "...");
        return result2;
      }
      async readAll() {
        while (!this._isClosed)
          await new Promise((f) => this._notifyReader = f);
        return this._buffer;
      }
      becomeSocket() {
        assert(!this._buffer.length);
        this._isSocket = true;
      }
    };
  }
});

// packages/playwright-core/src/server/pipeTransport.ts
var PipeTransport2;
var init_pipeTransport2 = __esm({
  "packages/playwright-core/src/server/pipeTransport.ts"() {
    "use strict";
    init_debugLogger();
    init_task();
    PipeTransport2 = class {
      constructor(pipeWrite, pipeRead) {
        this._pendingBuffers = [];
        this._waitForNextTask = makeWaitForNextTask();
        this._closed = false;
        this._pipeRead = pipeRead;
        this._pipeWrite = pipeWrite;
        pipeRead.on("data", (buffer) => this._dispatch(buffer));
        pipeRead.on("close", () => {
          this._closed = true;
          if (this._onclose)
            this._onclose.call(null);
        });
        pipeRead.on("error", (e) => debugLogger.log("error", e));
        pipeWrite.on("error", (e) => debugLogger.log("error", e));
        this.onmessage = void 0;
      }
      get onclose() {
        return this._onclose;
      }
      set onclose(onclose) {
        this._onclose = onclose;
        if (onclose && !this._pipeRead.readable)
          onclose();
      }
      send(message) {
        if (this._closed)
          throw new Error("Pipe has been closed");
        this._pipeWrite.write(JSON.stringify(message));
        this._pipeWrite.write("\0");
      }
      close() {
        throw new Error("unimplemented");
      }
      _dispatch(buffer) {
        let end = buffer.indexOf("\0");
        if (end === -1) {
          this._pendingBuffers.push(buffer);
          return;
        }
        this._pendingBuffers.push(buffer.slice(0, end));
        const message = Buffer.concat(this._pendingBuffers).toString();
        this._waitForNextTask(() => {
          if (this.onmessage)
            this.onmessage.call(null, JSON.parse(message));
        });
        let start3 = end + 1;
        end = buffer.indexOf("\0", start3);
        while (end !== -1) {
          const message2 = buffer.toString(void 0, start3, end);
          this._waitForNextTask(() => {
            if (this.onmessage)
              this.onmessage.call(null, JSON.parse(message2));
          });
          start3 = end + 1;
          end = buffer.indexOf("\0", start3);
        }
        this._pendingBuffers = [buffer.slice(start3)];
      }
    };
  }
});

// packages/playwright-core/src/server/transport.ts
function stripQueryParams(url2) {
  try {
    const u = new URL(url2);
    u.search = "";
    u.hash = "";
    return u.toString();
  } catch {
    return url2;
  }
}
var ws, perMessageDeflate2, WebSocketTransport;
var init_transport = __esm({
  "packages/playwright-core/src/server/transport.ts"() {
    "use strict";
    init_happyEyeballs();
    init_task();
    ws = require("./utilsBundle").ws;
    perMessageDeflate2 = {
      clientNoContextTakeover: true,
      zlibDeflateOptions: {
        level: 3
      },
      zlibInflateOptions: {
        chunkSize: 10 * 1024
      },
      threshold: 10 * 1024
    };
    WebSocketTransport = class _WebSocketTransport {
      constructor(progress2, url2, logUrl, options) {
        this.headers = [];
        this.wsEndpoint = url2;
        this._logUrl = logUrl;
        this._ws = new ws(url2, [], {
          maxPayload: 256 * 1024 * 1024,
          // 256Mb,
          headers: options.headers,
          followRedirects: options.followRedirects,
          agent: /^(https|wss):\/\//.test(url2) ? httpsHappyEyeballsAgent : httpHappyEyeballsAgent,
          perMessageDeflate: perMessageDeflate2
        });
        this._ws.on("upgrade", (response2) => {
          for (let i = 0; i < response2.rawHeaders.length; i += 2) {
            this.headers.push({ name: response2.rawHeaders[i], value: response2.rawHeaders[i + 1] });
            if (options.debugLogHeader && response2.rawHeaders[i] === options.debugLogHeader)
              progress2?.log(response2.rawHeaders[i + 1]);
          }
        });
        this._progress = progress2;
        const messageWrap = makeWaitForNextTask();
        this._ws.addEventListener("message", (event) => {
          messageWrap(() => {
            const eventData = event.data;
            let parsedJson;
            try {
              parsedJson = JSON.parse(eventData);
            } catch (e) {
              this._progress?.log(`<closing ws> Closing websocket due to malformed JSON. eventData=${eventData} e=${e?.message}`);
              this._ws.close();
              return;
            }
            try {
              if (this.onmessage)
                this.onmessage.call(null, parsedJson);
            } catch (e) {
              this._progress?.log(`<closing ws> Closing websocket due to failed onmessage callback. eventData=${eventData} e=${e?.message}`);
              this._ws.close();
            }
          });
        });
        this._ws.addEventListener("close", (event) => {
          this._progress?.log(`<ws disconnected> ${logUrl} code=${event.code} reason=${event.reason}`);
          if (this.onclose)
            this.onclose.call(null, event.reason);
        });
        this._ws.addEventListener("error", (error) => this._progress?.log(`<ws error> ${logUrl} ${error.type} ${error.message}`));
      }
      static async connect(progress2, url2, options = {}) {
        return await _WebSocketTransport._connect(
          progress2,
          url2,
          options,
          false
          /* hadRedirects */
        );
      }
      static async _connect(progress2, url2, options, hadRedirects) {
        const logUrl = stripQueryParams(url2);
        progress2?.log(`<ws connecting> ${logUrl}`);
        const transport = new _WebSocketTransport(progress2, url2, logUrl, { ...options, followRedirects: !!options.followRedirects && hadRedirects });
        const resultPromise = new Promise((fulfill, reject) => {
          transport._ws.on("open", async () => {
            progress2?.log(`<ws connected> ${logUrl}`);
            fulfill({});
          });
          transport._ws.on("error", (event) => {
            progress2?.log(`<ws connect error> ${logUrl} ${event.message}`);
            reject(new Error("WebSocket error: " + event.message));
            transport._ws.close();
          });
          transport._ws.on("unexpected-response", (request2, response2) => {
            if (options.followRedirects && !hadRedirects && (response2.statusCode === 301 || response2.statusCode === 302 || response2.statusCode === 307 || response2.statusCode === 308)) {
              fulfill({ redirect: response2 });
              transport._ws.close();
              return;
            }
            for (let i = 0; i < response2.rawHeaders.length; i += 2) {
              if (options.debugLogHeader && response2.rawHeaders[i] === options.debugLogHeader)
                progress2?.log(response2.rawHeaders[i + 1]);
            }
            const chunks = [];
            const errorPrefix = `${logUrl} ${response2.statusCode} ${response2.statusMessage}`;
            response2.on("data", (chunk) => chunks.push(chunk));
            response2.on("close", () => {
              const error = chunks.length ? `${errorPrefix}
${Buffer.concat(chunks)}` : errorPrefix;
              progress2?.log(`<ws unexpected response> ${error}`);
              reject(new Error("WebSocket error: " + error));
              transport._ws.close();
            });
          });
        });
        try {
          const result2 = progress2 ? await progress2.race(resultPromise) : await resultPromise;
          if (result2.redirect) {
            const newHeaders = Object.fromEntries(Object.entries(options.headers || {}).filter(([name]) => {
              return !name.includes("access-key") && name.toLowerCase() !== "authorization";
            }));
            return _WebSocketTransport._connect(
              progress2,
              result2.redirect.headers.location,
              { ...options, headers: newHeaders },
              true
              /* hadRedirects */
            );
          }
          return transport;
        } catch (error) {
          await transport.closeAndWait();
          throw error;
        }
      }
      send(message) {
        this._ws.send(JSON.stringify(message));
      }
      close() {
        this._progress?.log(`<ws disconnecting> ${this._logUrl}`);
        this._ws.close();
      }
      async closeAndWait() {
        if (this._ws.readyState === ws.CLOSED)
          return;
        const promise = new Promise((f) => this._ws.once("close", f));
        this.close();
        await promise;
      }
    };
  }
});

// packages/playwright-core/src/server/browserType.ts
function copyTestHooks(from, to) {
  for (const [key, value2] of Object.entries(from)) {
    if (key.startsWith("__testHook"))
      to[key] = value2;
  }
}
var import_fs25, import_os10, import_path24, kNoXServerRunningError, BrowserType;
var init_browserType = __esm({
  "packages/playwright-core/src/server/browserType.ts"() {
    "use strict";
    import_fs25 = __toESM(require("fs"));
    import_os10 = __toESM(require("os"));
    import_path24 = __toESM(require("path"));
    init_assert();
    init_manualPromise();
    init_time();
    init_debug();
    init_fileUtils();
    init_processLauncher();
    init_debugLogger();
    init_browserContext();
    init_helper();
    init_instrumentation();
    init_pipeTransport2();
    init_protocolError();
    init_registry();
    init_socksClientCertificatesInterceptor();
    init_transport();
    kNoXServerRunningError = "Looks like you launched a headed browser without having a XServer running.\nSet either 'headless: true' or use 'xvfb-run <your-playwright-app>' before running Playwright.\n\n<3 Playwright Team";
    BrowserType = class extends SdkObject {
      constructor(parent, browserName) {
        super(parent, "browser-type");
        this.attribution.browserType = this;
        this._name = browserName;
        this.logName = "browser";
      }
      executablePath() {
        return registry.findExecutable(this._name).executablePath() || "";
      }
      name() {
        return this._name;
      }
      async launch(progress2, options, protocolLogger) {
        options = this._validateLaunchOptions(options);
        const seleniumHubUrl = options.__testHookSeleniumRemoteURL || process.env.SELENIUM_REMOTE_URL;
        if (seleniumHubUrl)
          return this.launchWithSeleniumHub(progress2, seleniumHubUrl, options);
        return this._innerLaunchWithRetries(progress2, options, void 0, helper.debugProtocolLogger(protocolLogger)).catch((e) => {
          throw this._rewriteStartupLog(e);
        });
      }
      async launchPersistentContext(progress2, userDataDir, options) {
        const launchOptions = this._validateLaunchOptions(options);
        let clientCertificatesProxy;
        if (options.clientCertificates?.length) {
          clientCertificatesProxy = await ClientCertificatesProxy.create(progress2, options);
          launchOptions.proxyOverride = clientCertificatesProxy.proxySettings();
          options = { ...options };
          options.internalIgnoreHTTPSErrors = true;
        }
        try {
          const browser = await this._innerLaunchWithRetries(progress2, launchOptions, options, helper.debugProtocolLogger(), userDataDir).catch((e) => {
            throw this._rewriteStartupLog(e);
          });
          browser._defaultContext._clientCertificatesProxy = clientCertificatesProxy;
          return browser._defaultContext;
        } catch (error) {
          await clientCertificatesProxy?.close().catch(() => {
          });
          throw error;
        }
      }
      async _innerLaunchWithRetries(progress2, options, persistent, protocolLogger, userDataDir) {
        try {
          return await this._innerLaunch(progress2, options, persistent, protocolLogger, userDataDir);
        } catch (error) {
          const errorMessage = typeof error === "object" && typeof error.message === "string" ? error.message : "";
          if (errorMessage.includes("Inconsistency detected by ld.so")) {
            progress2.log(`<restarting browser due to hitting race condition in glibc>`);
            return this._innerLaunch(progress2, options, persistent, protocolLogger, userDataDir);
          }
          throw error;
        }
      }
      async _innerLaunch(progress2, options, persistent, protocolLogger, maybeUserDataDir) {
        options.proxy = options.proxy ? normalizeProxySettings(options.proxy) : void 0;
        const browserLogsCollector = new RecentLogsCollector();
        const { browserProcess, userDataDir, artifactsDir, transport, wsEndpoint } = await this._launchProcess(progress2, options, !!persistent, browserLogsCollector, maybeUserDataDir);
        try {
          if (options.__testHookBeforeCreateBrowser)
            await progress2.race(options.__testHookBeforeCreateBrowser());
          const browserOptions = {
            name: this._name,
            browserType: this._name,
            channel: options.channel,
            slowMo: options.slowMo,
            persistent,
            headful: !options.headless,
            artifactsDir,
            downloadsPath: options.downloadsPath || artifactsDir,
            tracesDir: options.tracesDir || artifactsDir,
            browserProcess,
            customExecutablePath: options.executablePath,
            proxy: options.proxy,
            protocolLogger,
            browserLogsCollector,
            wsEndpoint,
            originalLaunchOptions: options,
            userDataDir: persistent ? userDataDir : void 0
          };
          if (persistent)
            validateBrowserContextOptions(persistent, browserOptions);
          copyTestHooks(options, browserOptions);
          const browser = await progress2.race(this.connectToTransport(transport, browserOptions, browserLogsCollector));
          browser._userDataDirForTest = userDataDir;
          if (persistent && !options.ignoreAllDefaultArgs)
            await browser._defaultContext.loadDefaultContext(progress2);
          return browser;
        } catch (error) {
          await progress2.race(browserProcess.close().catch(() => {
          }));
          throw error;
        }
      }
      async _prepareToLaunch(options, isPersistent, userDataDir) {
        const {
          ignoreDefaultArgs,
          ignoreAllDefaultArgs,
          args = [],
          executablePath = null
        } = options;
        const tempDirectories = [];
        let artifactsDir;
        if (options.artifactsDir) {
          artifactsDir = options.artifactsDir;
        } else {
          artifactsDir = await import_fs25.default.promises.mkdtemp(import_path24.default.join(import_os10.default.tmpdir(), "playwright-artifacts-"));
          tempDirectories.push(artifactsDir);
        }
        if (userDataDir) {
          assert(import_path24.default.isAbsolute(userDataDir), "userDataDir must be an absolute path");
          if (!await existsAsync(userDataDir))
            await import_fs25.default.promises.mkdir(userDataDir, { recursive: true, mode: 448 });
        } else {
          userDataDir = await import_fs25.default.promises.mkdtemp(import_path24.default.join(import_os10.default.tmpdir(), `playwright_${this._name}dev_profile-`));
          tempDirectories.push(userDataDir);
        }
        await this.prepareUserDataDir(options, userDataDir);
        const browserArguments = [];
        if (ignoreAllDefaultArgs)
          browserArguments.push(...args);
        else if (ignoreDefaultArgs)
          browserArguments.push(...(await this.defaultArgs(options, isPersistent, userDataDir)).filter((arg) => ignoreDefaultArgs.indexOf(arg) === -1));
        else
          browserArguments.push(...await this.defaultArgs(options, isPersistent, userDataDir));
        let executable;
        if (executablePath) {
          if (!await existsAsync(executablePath))
            throw new Error(`Failed to launch ${this._name} because executable doesn't exist at ${executablePath}`);
          executable = executablePath;
        } else {
          const registryExecutable = registry.findExecutable(this.getExecutableName(options));
          if (!registryExecutable || registryExecutable.browserName !== this._name)
            throw new Error(`Unsupported ${this._name} channel "${options.channel}"`);
          executable = registryExecutable.executablePathOrDie(this.attribution.playwright.options.sdkLanguage);
          await registry.validateHostRequirementsForExecutablesIfNeeded([registryExecutable], this.attribution.playwright.options.sdkLanguage);
        }
        return { executable, browserArguments, userDataDir, artifactsDir, tempDirectories };
      }
      async _launchProcess(progress2, options, isPersistent, browserLogsCollector, userDataDir) {
        const {
          handleSIGINT = true,
          handleSIGTERM = true,
          handleSIGHUP = true
        } = options;
        const env = options.env ? envArrayToObject(options.env) : process.env;
        const prepared = await progress2.race(this._prepareToLaunch(options, isPersistent, userDataDir));
        let transport = void 0;
        let browserProcess = void 0;
        const exitPromise = new ManualPromise();
        const { launchedProcess, gracefullyClose, kill } = await progress2.race(launchProcess({
          command: prepared.executable,
          args: prepared.browserArguments,
          env: this.amendEnvironment(env, prepared.userDataDir, isPersistent, options),
          handleSIGINT,
          handleSIGTERM,
          handleSIGHUP,
          log: (message) => {
            progress2.log(message);
            browserLogsCollector.log(message);
          },
          stdio: "pipe",
          tempDirectories: prepared.tempDirectories,
          attemptToGracefullyClose: async () => {
            if (options.__testHookGracefullyClose)
              await options.__testHookGracefullyClose();
            if (transport) {
              this.attemptToGracefullyCloseBrowser(transport);
            } else {
              throw new Error("Force-killing the browser because no transport is available to gracefully close it.");
            }
          },
          onExit: (exitCode, signal) => {
            exitPromise.resolve();
            if (browserProcess && browserProcess.onclose)
              browserProcess.onclose(exitCode, signal);
          }
        }));
        async function closeOrKill(timeout) {
          let timer;
          try {
            await Promise.race([
              gracefullyClose(),
              new Promise((resolve, reject) => timer = setTimeout(reject, timeout))
            ]);
          } catch (ignored) {
            await kill().catch((ignored2) => {
            });
          } finally {
            clearTimeout(timer);
          }
        }
        browserProcess = {
          onclose: void 0,
          process: launchedProcess,
          close: () => closeOrKill(options.__testHookBrowserCloseTimeout || DEFAULT_PLAYWRIGHT_TIMEOUT),
          kill
        };
        try {
          const { wsEndpoint } = await progress2.race([
            this.waitForReadyState(options, browserLogsCollector),
            exitPromise.then(() => ({ wsEndpoint: void 0 }))
          ]);
          if (exitPromise.isDone()) {
            const log2 = helper.formatBrowserLogs(browserLogsCollector.recentLogs());
            const updatedLog = this.doRewriteStartupLog(log2);
            throw new Error(`Failed to launch the browser process.
Browser logs:
${updatedLog}`);
          }
          if (!this.supportsPipeTransport()) {
            transport = await WebSocketTransport.connect(progress2, wsEndpoint);
          } else {
            const stdio = launchedProcess.stdio;
            transport = new PipeTransport2(stdio[3], stdio[4]);
          }
          return { browserProcess, artifactsDir: prepared.artifactsDir, userDataDir: prepared.userDataDir, transport, wsEndpoint };
        } catch (error) {
          await progress2.race(closeOrKill(DEFAULT_PLAYWRIGHT_TIMEOUT).catch(() => {
          }));
          throw error;
        }
      }
      async connectOverCDP(progress2, params2) {
        throw new Error("CDP connections are only supported by Chromium");
      }
      async connectToWorker(progress2, endpoint) {
        throw new Error("CDP connections are only supported by Chromium");
      }
      async launchWithSeleniumHub(progress2, hubUrl, options) {
        throw new Error("Connecting to SELENIUM_REMOTE_URL is only supported by Chromium");
      }
      _validateLaunchOptions(options) {
        let { headless = true, downloadsPath, proxy } = options;
        if (debugMode() === "inspector")
          headless = false;
        if (downloadsPath && !import_path24.default.isAbsolute(downloadsPath))
          downloadsPath = import_path24.default.join(process.cwd(), downloadsPath);
        if (options.socksProxyPort)
          proxy = { server: `socks5://127.0.0.1:${options.socksProxyPort}` };
        return { ...options, headless, downloadsPath, proxy };
      }
      _createUserDataDirArgMisuseError(userDataDirArg) {
        switch (this.attribution.playwright.options.sdkLanguage) {
          case "java":
            return new Error(`Pass userDataDir parameter to 'BrowserType.launchPersistentContext(userDataDir, options)' instead of specifying '${userDataDirArg}' argument`);
          case "python":
            return new Error(`Pass user_data_dir parameter to 'browser_type.launch_persistent_context(user_data_dir, **kwargs)' instead of specifying '${userDataDirArg}' argument`);
          case "csharp":
            return new Error(`Pass userDataDir parameter to 'BrowserType.LaunchPersistentContextAsync(userDataDir, options)' instead of specifying '${userDataDirArg}' argument`);
          default:
            return new Error(`Pass userDataDir parameter to 'browserType.launchPersistentContext(userDataDir, options)' instead of specifying '${userDataDirArg}' argument`);
        }
      }
      _rewriteStartupLog(error) {
        if (!isProtocolError(error))
          return error;
        if (error.logs)
          error.logs = this.doRewriteStartupLog(error.logs);
        return error;
      }
      async waitForReadyState(options, browserLogsCollector) {
        return {};
      }
      async prepareUserDataDir(options, userDataDir) {
      }
      supportsPipeTransport() {
        return true;
      }
      getExecutableName(options) {
        return options.channel || this._name;
      }
    };
  }
});

// packages/playwright-core/src/server/bidi/bidiConnection.ts
var import_events9, kBrowserCloseMessageId2, kShutdownSessionNewMessageId, BidiConnection, BidiSession;
var init_bidiConnection = __esm({
  "packages/playwright-core/src/server/bidi/bidiConnection.ts"() {
    "use strict";
    import_events9 = require("events");
    init_debugLogger();
    init_helper();
    init_protocolError();
    kBrowserCloseMessageId2 = Number.MAX_SAFE_INTEGER - 1;
    kShutdownSessionNewMessageId = kBrowserCloseMessageId2 - 1;
    BidiConnection = class {
      constructor(transport, onDisconnect, protocolLogger, browserLogsCollector) {
        this._lastId = 0;
        this._closed = false;
        this._browsingContextToSession = /* @__PURE__ */ new Map();
        this._realmToBrowsingContext = /* @__PURE__ */ new Map();
        // TODO: shared/service workers might have multiple owner realms.
        this._realmToOwnerRealm = /* @__PURE__ */ new Map();
        this._transport = transport;
        this._onDisconnect = onDisconnect;
        this._protocolLogger = protocolLogger;
        this._browserLogsCollector = browserLogsCollector;
        this.browserSession = new BidiSession(this, "", (message) => {
          this.rawSend(message);
        });
        this._transport.onmessage = this._dispatchMessage.bind(this);
        this._transport.onclose = this._onClose.bind(this);
      }
      nextMessageId() {
        return ++this._lastId;
      }
      rawSend(message) {
        this._protocolLogger("send", message);
        this._transport.send(message);
      }
      _dispatchMessage(message) {
        this._protocolLogger("receive", message);
        const object = message;
        if (object.type === "event") {
          if (object.method === "script.realmCreated") {
            if ("context" in object.params)
              this._realmToBrowsingContext.set(object.params.realm, object.params.context);
            if (object.params.type === "dedicated-worker")
              this._realmToOwnerRealm.set(object.params.realm, object.params.owners[0]);
          } else if (object.method === "script.realmDestroyed") {
            this._realmToBrowsingContext.delete(object.params.realm);
            this._realmToOwnerRealm.delete(object.params.realm);
          }
          let context2;
          let realm;
          if ("context" in object.params) {
            context2 = object.params.context;
          } else if (object.method === "log.entryAdded" || object.method === "script.message") {
            context2 = object.params.source?.context;
            realm = object.params.source?.realm;
          } else if (object.method === "script.realmCreated" && object.params.type === "dedicated-worker") {
            realm = object.params.owners[0];
          }
          if (!context2 && realm) {
            while (this._realmToOwnerRealm.get(realm))
              realm = this._realmToOwnerRealm.get(realm);
            context2 = this._realmToBrowsingContext.get(realm);
          }
          if (context2) {
            const session2 = this._browsingContextToSession.get(context2);
            if (session2) {
              session2.dispatchMessage(message);
              return;
            }
          }
        } else if (message.id) {
          for (const session2 of this._browsingContextToSession.values()) {
            if (session2.hasCallback(message.id)) {
              session2.dispatchMessage(message);
              return;
            }
          }
        }
        this.browserSession.dispatchMessage(message);
      }
      _onClose(reason) {
        this._closed = true;
        this._transport.onmessage = void 0;
        this._transport.onclose = void 0;
        this._browserDisconnectedLogs = helper.formatBrowserLogs(this._browserLogsCollector.recentLogs(), reason);
        this.browserSession.dispose();
        this._onDisconnect();
      }
      isClosed() {
        return this._closed;
      }
      close() {
        if (!this._closed)
          this._transport.close();
      }
      createMainFrameBrowsingContextSession(bowsingContextId) {
        const result2 = new BidiSession(this, bowsingContextId, (message) => this.rawSend(message));
        this._browsingContextToSession.set(bowsingContextId, result2);
        return result2;
      }
    };
    BidiSession = class extends import_events9.EventEmitter {
      constructor(connection, sessionId, rawSend) {
        super();
        this._disposed = false;
        this._callbacks = /* @__PURE__ */ new Map();
        this._crashed = false;
        this._browsingContexts = /* @__PURE__ */ new Set();
        this.setMaxListeners(0);
        this.connection = connection;
        this.sessionId = sessionId;
        this._rawSend = rawSend;
        this.on = super.on;
        this.off = super.removeListener;
        this.addListener = super.addListener;
        this.removeListener = super.removeListener;
        this.once = super.once;
      }
      addFrameBrowsingContext(context2) {
        this._browsingContexts.add(context2);
        this.connection._browsingContextToSession.set(context2, this);
      }
      removeFrameBrowsingContext(context2) {
        this._browsingContexts.delete(context2);
        this.connection._browsingContextToSession.delete(context2);
      }
      async send(method, params2) {
        if (this._crashed || this._disposed || this.connection._browserDisconnectedLogs)
          throw new ProtocolError(this._crashed ? "crashed" : "closed", void 0, this.connection._browserDisconnectedLogs);
        const id = this.connection.nextMessageId();
        const messageObj = { id, method, params: params2 };
        this._rawSend(messageObj);
        return new Promise((resolve, reject) => {
          this._callbacks.set(id, { resolve, reject, error: new ProtocolError("error", method) });
        });
      }
      sendMayFail(method, params2) {
        return this.send(method, params2).catch((error) => debugLogger.log("error", error));
      }
      markAsCrashed() {
        this._crashed = true;
      }
      isDisposed() {
        return this._disposed;
      }
      dispose() {
        this._disposed = true;
        this.connection._browsingContextToSession.delete(this.sessionId);
        for (const context2 of this._browsingContexts)
          this.connection._browsingContextToSession.delete(context2);
        this._browsingContexts.clear();
        for (const callback of this._callbacks.values()) {
          callback.error.type = this._crashed ? "crashed" : "closed";
          callback.error.setMessage(`Internal server error, session ${callback.error.type}.`);
          callback.error.logs = this.connection._browserDisconnectedLogs;
          callback.reject(callback.error);
        }
        this._callbacks.clear();
      }
      hasCallback(id) {
        return this._callbacks.has(id);
      }
      dispatchMessage(message) {
        const object = message;
        if (object.id === kBrowserCloseMessageId2 || object.id === kShutdownSessionNewMessageId)
          return;
        if (object.id && this._callbacks.has(object.id)) {
          const callback = this._callbacks.get(object.id);
          this._callbacks.delete(object.id);
          if (object.type === "error") {
            callback.error.setMessage(object.error + "\nMessage: " + object.message);
            callback.reject(callback.error);
          } else if (object.type === "success") {
            callback.resolve(object.result);
          } else {
            callback.error.setMessage("Internal error, unexpected response type: " + JSON.stringify(object));
            callback.reject(callback.error);
          }
        } else if (object.id) {
        } else {
          Promise.resolve().then(() => this.emit(object.method, object.params));
        }
      }
    };
  }
});

// packages/playwright-core/src/server/bidi/third_party/bidiProtocolCore.ts
var Session, BrowsingContext, Emulation, Network, Script, Log, Input;
var init_bidiProtocolCore = __esm({
  "packages/playwright-core/src/server/bidi/third_party/bidiProtocolCore.ts"() {
    "use strict";
    ((Session3) => {
      let UserPromptHandlerType;
      ((UserPromptHandlerType2) => {
        UserPromptHandlerType2["Accept"] = "accept";
        UserPromptHandlerType2["Dismiss"] = "dismiss";
        UserPromptHandlerType2["Ignore"] = "ignore";
      })(UserPromptHandlerType = Session3.UserPromptHandlerType || (Session3.UserPromptHandlerType = {}));
    })(Session || (Session = {}));
    ((BrowsingContext2) => {
      let ReadinessState;
      ((ReadinessState2) => {
        ReadinessState2["None"] = "none";
        ReadinessState2["Interactive"] = "interactive";
        ReadinessState2["Complete"] = "complete";
      })(ReadinessState = BrowsingContext2.ReadinessState || (BrowsingContext2.ReadinessState = {}));
    })(BrowsingContext || (BrowsingContext = {}));
    ((BrowsingContext2) => {
      let UserPromptType;
      ((UserPromptType2) => {
        UserPromptType2["Alert"] = "alert";
        UserPromptType2["Beforeunload"] = "beforeunload";
        UserPromptType2["Confirm"] = "confirm";
        UserPromptType2["Prompt"] = "prompt";
      })(UserPromptType = BrowsingContext2.UserPromptType || (BrowsingContext2.UserPromptType = {}));
    })(BrowsingContext || (BrowsingContext = {}));
    ((BrowsingContext2) => {
      let CreateType;
      ((CreateType2) => {
        CreateType2["Tab"] = "tab";
        CreateType2["Window"] = "window";
      })(CreateType = BrowsingContext2.CreateType || (BrowsingContext2.CreateType = {}));
    })(BrowsingContext || (BrowsingContext = {}));
    ((Emulation2) => {
      let ForcedColorsModeTheme;
      ((ForcedColorsModeTheme2) => {
        ForcedColorsModeTheme2["Light"] = "light";
        ForcedColorsModeTheme2["Dark"] = "dark";
      })(ForcedColorsModeTheme = Emulation2.ForcedColorsModeTheme || (Emulation2.ForcedColorsModeTheme = {}));
    })(Emulation || (Emulation = {}));
    ((Emulation2) => {
      let ScreenOrientationNatural;
      ((ScreenOrientationNatural2) => {
        ScreenOrientationNatural2["Portrait"] = "portrait";
        ScreenOrientationNatural2["Landscape"] = "landscape";
      })(ScreenOrientationNatural = Emulation2.ScreenOrientationNatural || (Emulation2.ScreenOrientationNatural = {}));
    })(Emulation || (Emulation = {}));
    ((Network3) => {
      let CollectorType;
      ((CollectorType2) => {
        CollectorType2["Blob"] = "blob";
      })(CollectorType = Network3.CollectorType || (Network3.CollectorType = {}));
    })(Network || (Network = {}));
    ((Network3) => {
      let SameSite;
      ((SameSite2) => {
        SameSite2["Strict"] = "strict";
        SameSite2["Lax"] = "lax";
        SameSite2["None"] = "none";
        SameSite2["Default"] = "default";
      })(SameSite = Network3.SameSite || (Network3.SameSite = {}));
    })(Network || (Network = {}));
    ((Network3) => {
      let DataType;
      ((DataType2) => {
        DataType2["Request"] = "request";
        DataType2["Response"] = "response";
      })(DataType = Network3.DataType || (Network3.DataType = {}));
    })(Network || (Network = {}));
    ((Network3) => {
      let InterceptPhase;
      ((InterceptPhase2) => {
        InterceptPhase2["BeforeRequestSent"] = "beforeRequestSent";
        InterceptPhase2["ResponseStarted"] = "responseStarted";
        InterceptPhase2["AuthRequired"] = "authRequired";
      })(InterceptPhase = Network3.InterceptPhase || (Network3.InterceptPhase = {}));
    })(Network || (Network = {}));
    ((Script2) => {
      let ResultOwnership;
      ((ResultOwnership2) => {
        ResultOwnership2["Root"] = "root";
        ResultOwnership2["None"] = "none";
      })(ResultOwnership = Script2.ResultOwnership || (Script2.ResultOwnership = {}));
    })(Script || (Script = {}));
    ((Log2) => {
      let Level;
      ((Level2) => {
        Level2["Debug"] = "debug";
        Level2["Info"] = "info";
        Level2["Warn"] = "warn";
        Level2["Error"] = "error";
      })(Level = Log2.Level || (Log2.Level = {}));
    })(Log || (Log = {}));
    ((Input2) => {
      let PointerType;
      ((PointerType2) => {
        PointerType2["Mouse"] = "mouse";
        PointerType2["Pen"] = "pen";
        PointerType2["Touch"] = "touch";
      })(PointerType = Input2.PointerType || (Input2.PointerType = {}));
    })(Input || (Input = {}));
  }
});

// packages/playwright-core/src/server/bidi/third_party/bidiProtocolPermissions.ts
var Permissions;
var init_bidiProtocolPermissions = __esm({
  "packages/playwright-core/src/server/bidi/third_party/bidiProtocolPermissions.ts"() {
    "use strict";
    ((Permissions2) => {
      let PermissionState;
      ((PermissionState2) => {
        PermissionState2["Granted"] = "granted";
        PermissionState2["Denied"] = "denied";
        PermissionState2["Prompt"] = "prompt";
      })(PermissionState = Permissions2.PermissionState || (Permissions2.PermissionState = {}));
    })(Permissions || (Permissions = {}));
  }
});

// packages/playwright-core/src/server/bidi/third_party/bidiProtocol.ts
var init_bidiProtocol = __esm({
  "packages/playwright-core/src/server/bidi/third_party/bidiProtocol.ts"() {
    "use strict";
    init_bidiProtocolCore();
    init_bidiProtocolPermissions();
  }
});

// packages/playwright-core/src/server/bidi/bidiNetworkManager.ts
function fromBidiHeaders(bidiHeaders) {
  const result2 = [];
  for (const { name, value: value2 } of bidiHeaders)
    result2.push({ name, value: bidiBytesValueToString(value2) });
  return result2;
}
function toBidiRequestHeaders(allHeaders) {
  const bidiHeaders = toBidiHeaders(allHeaders);
  return { headers: bidiHeaders };
}
function toBidiResponseHeaders(headers) {
  const setCookieHeaders = headers.filter((h) => h.name.toLowerCase() === "set-cookie");
  const otherHeaders = headers.filter((h) => h.name.toLowerCase() !== "set-cookie");
  const rawCookies = setCookieHeaders.map((h) => parseRawCookie(h.value));
  const cookies = rawCookies.filter(Boolean).map((c) => {
    return {
      ...c,
      value: { type: "string", value: c.value },
      sameSite: toBidiSameSite(c.sameSite)
    };
  });
  return { cookies, headers: toBidiHeaders(otherHeaders) };
}
function toBidiHeaders(headers) {
  return headers.map(({ name, value: value2 }) => ({ name, value: { type: "string", value: value2 } }));
}
function bidiBytesValueToString(value2) {
  if (value2.type === "string")
    return value2.value;
  if (value2.type === "base64")
    return Buffer.from(value2.type, "base64").toString("binary");
  return "unknown value type: " + value2.type;
}
function toBidiSameSite(sameSite) {
  if (!sameSite)
    return void 0;
  if (sameSite === "Strict")
    return Network.SameSite.Strict;
  if (sameSite === "Lax")
    return Network.SameSite.Lax;
  return Network.SameSite.None;
}
function resourceTypeFromBidi(requestDestination, requestInitiatorType, eventInitiatorType) {
  switch (requestDestination) {
    case "audio":
      return "media";
    case "audioworklet":
      return "script";
    case "document":
      return "document";
    case "font":
      return "font";
    case "frame":
      return "document";
    case "iframe":
      return "document";
    case "image":
      return "image";
    case "object":
      return "other";
    case "paintworklet":
      return "script";
    case "script":
      return "script";
    case "serviceworker":
      return "script";
    case "sharedworker":
      return "script";
    case "style":
      return "stylesheet";
    case "track":
      return "texttrack";
    case "video":
      return "media";
    case "worker":
      return "script";
    case "":
      switch (requestInitiatorType) {
        case "fetch":
          return "fetch";
        case "font":
          return "font";
        case "xmlhttprequest":
          return "xhr";
        case null:
          return eventInitiatorType === "script" ? "xhr" : "document";
        default:
          return "other";
      }
    default:
      return "other";
  }
}
var REQUEST_BODY_HEADERS, BidiNetworkManager, BidiRequest, BidiRouteImpl;
var init_bidiNetworkManager = __esm({
  "packages/playwright-core/src/server/bidi/bidiNetworkManager.ts"() {
    "use strict";
    init_eventsHelper();
    init_cookieStore();
    init_network2();
    init_bidiProtocol();
    REQUEST_BODY_HEADERS = /* @__PURE__ */ new Set(["content-encoding", "content-language", "content-location", "content-type"]);
    BidiNetworkManager = class {
      constructor(bidiSession, page) {
        this._userRequestInterceptionEnabled = false;
        this._protocolRequestInterceptionEnabled = false;
        this._attemptedAuthentications = /* @__PURE__ */ new Set();
        this._session = bidiSession;
        this._requests = /* @__PURE__ */ new Map();
        this._page = page;
        this._eventListeners = [
          eventsHelper.addEventListener(bidiSession, "network.beforeRequestSent", this._onBeforeRequestSent.bind(this)),
          eventsHelper.addEventListener(bidiSession, "network.responseStarted", this._onResponseStarted.bind(this)),
          eventsHelper.addEventListener(bidiSession, "network.responseCompleted", this._onResponseCompleted.bind(this)),
          eventsHelper.addEventListener(bidiSession, "network.fetchError", this._onFetchError.bind(this)),
          eventsHelper.addEventListener(bidiSession, "network.authRequired", this._onAuthRequired.bind(this))
        ];
      }
      dispose() {
        eventsHelper.removeEventListeners(this._eventListeners);
      }
      _onBeforeRequestSent(param) {
        if (param.request.url.startsWith("data:"))
          return;
        const redirectedFrom = param.redirectCount ? this._requests.get(param.request.request) || null : null;
        const frame = redirectedFrom ? redirectedFrom.request.frame() : param.context ? this._page.frameManager.frame(param.context) : null;
        if (!frame)
          return;
        if (redirectedFrom)
          this._deleteRequest(redirectedFrom._id);
        if (param.request.method === "OPTIONS") {
          const requestHeaders = Object.fromEntries(param.request.headers.map((h) => [h.name.toLowerCase(), bidiBytesValueToString(h.value)]));
          if (param.initiator?.type === "preflight" || requestHeaders["access-control-request-method"]) {
            if (param.intercepts) {
              const responseHeaders = [
                { name: "Access-Control-Allow-Origin", value: requestHeaders["origin"] || "*" },
                { name: "Access-Control-Allow-Methods", value: requestHeaders["access-control-request-method"] },
                { name: "Access-Control-Allow-Credentials", value: "true" }
              ];
              if (requestHeaders["access-control-request-headers"])
                responseHeaders.push({ name: "Access-Control-Allow-Headers", value: requestHeaders["access-control-request-headers"] });
              this._session.sendMayFail("network.provideResponse", {
                request: param.request.request,
                statusCode: 204,
                headers: toBidiHeaders(responseHeaders)
              });
            }
            return;
          }
        }
        let route2;
        let headersOverride;
        if (param.intercepts) {
          if (redirectedFrom) {
            let params2 = {};
            if (redirectedFrom._originalRequestRoute?._alreadyContinuedHeaders) {
              const originalHeaders = fromBidiHeaders(param.request.headers);
              headersOverride = applyHeadersOverrides(originalHeaders, redirectedFrom._originalRequestRoute._alreadyContinuedHeaders);
              if (redirectedFrom.request.method() === "POST" && param.request.method === "GET")
                headersOverride = headersOverride.filter(({ name }) => !REQUEST_BODY_HEADERS.has(name.toLowerCase()));
              params2 = toBidiRequestHeaders(headersOverride);
            }
            this._session.sendMayFail("network.continueRequest", {
              request: param.request.request,
              ...params2
            });
          } else {
            route2 = new BidiRouteImpl(this._session, param.request.request);
          }
        }
        const request2 = new BidiRequest(frame, redirectedFrom, param, route2, headersOverride);
        this._requests.set(request2._id, request2);
        this._page.frameManager.requestStarted(request2.request, route2);
      }
      _onResponseStarted(params2) {
        const request2 = this._requests.get(params2.request.request);
        if (!request2)
          return;
        const getResponseBody = async () => {
          const { bytes } = await this._session.send("network.getData", { request: params2.request.request, dataType: Network.DataType.Response });
          const encoding = bytes.type === "base64" ? "base64" : "utf8";
          return Buffer.from(bytes.value, encoding);
        };
        const timings = params2.request.timings;
        const startTime = timings.requestTime;
        function relativeToStart(time) {
          if (!time)
            return -1;
          return time - startTime;
        }
        const timing = {
          startTime,
          requestStart: relativeToStart(timings.requestStart),
          responseStart: relativeToStart(timings.responseStart),
          domainLookupStart: relativeToStart(timings.dnsStart),
          domainLookupEnd: relativeToStart(timings.dnsEnd),
          connectStart: relativeToStart(timings.connectStart),
          secureConnectionStart: relativeToStart(timings.tlsStart),
          connectEnd: relativeToStart(timings.connectEnd)
        };
        const response2 = new Response2(request2.request, params2.response.status, params2.response.statusText, fromBidiHeaders(params2.response.headers), timing, getResponseBody, false);
        response2._serverAddrFinished();
        response2._securityDetailsFinished();
        response2._setHttpVersion(params2.response.protocol);
        response2.setRawResponseHeaders(null);
        response2.setResponseHeadersSize(params2.response.headersSize);
        this._page.frameManager.requestReceivedResponse(response2);
      }
      _onResponseCompleted(params2) {
        const request2 = this._requests.get(params2.request.request);
        if (!request2)
          return;
        const response2 = request2.request._existingResponse();
        response2.setTransferSize(params2.response.bodySize);
        response2.setEncodedBodySize(params2.response.bodySize);
        const isRedirected = response2.status() >= 300 && response2.status() <= 399;
        const responseEndTime = params2.request.timings.responseEnd - response2.timing().startTime;
        if (isRedirected) {
          response2._requestFinished(responseEndTime);
        } else {
          this._deleteRequest(request2._id);
          response2._requestFinished(responseEndTime);
        }
        this._page.frameManager.reportRequestFinished(request2.request, response2);
      }
      _onFetchError(params2) {
        const request2 = this._requests.get(params2.request.request);
        if (!request2)
          return;
        this._deleteRequest(request2._id);
        const response2 = request2.request._existingResponse();
        if (response2) {
          response2.setTransferSize(null);
          response2.setEncodedBodySize(null);
          response2._requestFinished(-1);
        }
        request2.request._setFailureText(params2.errorText);
        this._page.frameManager.requestFailed(request2.request, params2.errorText === "NS_BINDING_ABORTED");
      }
      _onAuthRequired(params2) {
        const isBasic = params2.response.authChallenges?.some((challenge) => challenge.scheme.startsWith("Basic"));
        const credentials = this._page.browserContext._options.httpCredentials;
        if (isBasic && credentials && (!credentials.origin || new URL(params2.request.url).origin.toLowerCase() === credentials.origin.toLowerCase())) {
          if (this._attemptedAuthentications.has(params2.request.request)) {
            this._session.sendMayFail("network.continueWithAuth", {
              request: params2.request.request,
              action: "cancel"
            });
          } else {
            this._attemptedAuthentications.add(params2.request.request);
            this._session.sendMayFail("network.continueWithAuth", {
              request: params2.request.request,
              action: "provideCredentials",
              credentials: {
                type: "password",
                username: credentials.username,
                password: credentials.password
              }
            });
          }
        } else {
          this._session.sendMayFail("network.continueWithAuth", {
            request: params2.request.request,
            action: "cancel"
          });
        }
      }
      _deleteRequest(requestId) {
        this._requests.delete(requestId);
        this._attemptedAuthentications.delete(requestId);
      }
      async setRequestInterception(value2) {
        this._userRequestInterceptionEnabled = value2;
        await this._updateProtocolRequestInterception();
      }
      async setCredentials(credentials) {
        this._credentials = credentials;
        await this._updateProtocolRequestInterception();
      }
      async _updateProtocolRequestInterception(initial) {
        const enabled = this._userRequestInterceptionEnabled || !!this._credentials;
        if (enabled === this._protocolRequestInterceptionEnabled)
          return;
        this._protocolRequestInterceptionEnabled = enabled;
        if (initial && !enabled)
          return;
        const contexts = [this._page.delegate._session.sessionId];
        const cachePromise = this._session.send("network.setCacheBehavior", { cacheBehavior: enabled ? "bypass" : "default", contexts });
        let interceptPromise = Promise.resolve(void 0);
        if (enabled) {
          interceptPromise = this._session.send("network.addIntercept", {
            phases: [Network.InterceptPhase.BeforeRequestSent],
            contexts
          }).then((r) => {
            this._intercepId = r.intercept;
          });
        } else if (this._intercepId) {
          interceptPromise = this._session.send("network.removeIntercept", { intercept: this._intercepId });
          this._intercepId = void 0;
        }
        await Promise.all([cachePromise, interceptPromise]);
      }
    };
    BidiRequest = class {
      constructor(frame, redirectedFrom, payload, route2, headersOverride) {
        this._id = payload.request.request;
        if (redirectedFrom)
          redirectedFrom._redirectedTo = this;
        const postDataBuffer = null;
        this.request = new Request(
          frame._page.browserContext,
          frame,
          null,
          redirectedFrom ? redirectedFrom.request : null,
          payload.navigation ?? void 0,
          payload.request.url,
          resourceTypeFromBidi(payload.request.destination, payload.request.initiatorType, payload.initiator?.type),
          payload.request.method,
          postDataBuffer,
          headersOverride || fromBidiHeaders(payload.request.headers),
          payload.timestamp
        );
        this.request.setRawRequestHeaders(null);
        this.request._setBodySize(payload.request.bodySize || 0);
        this._originalRequestRoute = route2 ?? redirectedFrom?._originalRequestRoute;
        route2?._setRequest(this.request);
      }
      _finalRequest() {
        let request2 = this;
        while (request2._redirectedTo)
          request2 = request2._redirectedTo;
        return request2;
      }
    };
    BidiRouteImpl = class {
      constructor(session2, requestId) {
        this._session = session2;
        this._requestId = requestId;
      }
      _setRequest(request2) {
        this._request = request2;
      }
      async continue(overrides) {
        let headers = overrides.headers || this._request.headers();
        if (overrides.postData && headers) {
          headers = headers.map((header) => {
            if (header.name.toLowerCase() === "content-length")
              return { name: header.name, value: overrides.postData.byteLength.toString() };
            return header;
          });
        }
        this._alreadyContinuedHeaders = headers;
        await this._session.sendMayFail("network.continueRequest", {
          request: this._requestId,
          url: overrides.url,
          method: overrides.method,
          ...toBidiRequestHeaders(this._alreadyContinuedHeaders),
          body: overrides.postData ? { type: "base64", value: Buffer.from(overrides.postData).toString("base64") } : void 0
        });
      }
      async fulfill(response2) {
        const base64body = response2.isBase64 ? response2.body : Buffer.from(response2.body).toString("base64");
        const headers = response2.headers.filter((h) => h.name.toLowerCase() !== "content-encoding");
        await this._session.sendMayFail("network.provideResponse", {
          request: this._requestId,
          statusCode: response2.status,
          reasonPhrase: statusText(response2.status),
          ...toBidiResponseHeaders(headers),
          body: { type: "base64", value: base64body }
        });
      }
      async abort(errorCode) {
        await this._session.sendMayFail("network.failRequest", {
          request: this._requestId
        });
      }
    };
  }
});

// packages/playwright-core/src/server/bidi/third_party/bidiSerializer.ts
var UnserializableError, BidiSerializer, isPlainObject, isRegExp6, isDate3;
var init_bidiSerializer = __esm({
  "packages/playwright-core/src/server/bidi/third_party/bidiSerializer.ts"() {
    "use strict";
    UnserializableError = class extends Error {
    };
    BidiSerializer = class _BidiSerializer {
      static serialize(arg) {
        switch (typeof arg) {
          case "symbol":
          case "function":
            throw new UnserializableError(`Unable to serializable ${typeof arg}`);
          case "object":
            return _BidiSerializer._serializeObject(arg);
          case "undefined":
            return {
              type: "undefined"
            };
          case "number":
            return _BidiSerializer._serializeNumber(arg);
          case "bigint":
            return {
              type: "bigint",
              value: arg.toString()
            };
          case "string":
            return {
              type: "string",
              value: arg
            };
          case "boolean":
            return {
              type: "boolean",
              value: arg
            };
        }
      }
      static _serializeNumber(arg) {
        let value2;
        if (Object.is(arg, -0)) {
          value2 = "-0";
        } else if (Object.is(arg, Infinity)) {
          value2 = "Infinity";
        } else if (Object.is(arg, -Infinity)) {
          value2 = "-Infinity";
        } else if (Object.is(arg, NaN)) {
          value2 = "NaN";
        } else {
          value2 = arg;
        }
        return {
          type: "number",
          value: value2
        };
      }
      static _serializeObject(arg) {
        if (arg === null) {
          return {
            type: "null"
          };
        } else if (Array.isArray(arg)) {
          const parsedArray = arg.map((subArg) => {
            return _BidiSerializer.serialize(subArg);
          });
          return {
            type: "array",
            value: parsedArray
          };
        } else if (isPlainObject(arg)) {
          try {
            JSON.stringify(arg);
          } catch (error) {
            if (error instanceof TypeError && error.message.startsWith("Converting circular structure to JSON")) {
              error.message += " Recursive objects are not allowed.";
            }
            throw error;
          }
          const parsedObject = [];
          for (const key in arg) {
            parsedObject.push([_BidiSerializer.serialize(key), _BidiSerializer.serialize(arg[key])]);
          }
          return {
            type: "object",
            value: parsedObject
          };
        } else if (isRegExp6(arg)) {
          return {
            type: "regexp",
            value: {
              pattern: arg.source,
              flags: arg.flags
            }
          };
        } else if (isDate3(arg)) {
          return {
            type: "date",
            value: arg.toISOString()
          };
        }
        throw new UnserializableError(
          "Custom object serialization not possible. Use plain objects instead."
        );
      }
    };
    isPlainObject = (obj) => {
      return typeof obj === "object" && obj?.constructor === Object;
    };
    isRegExp6 = (obj) => {
      return typeof obj === "object" && obj?.constructor === RegExp;
    };
    isDate3 = (obj) => {
      return typeof obj === "object" && obj?.constructor === Date;
    };
  }
});

// packages/playwright-core/src/server/bidi/bidiDeserializer.ts
function deserializeBidiValue(result2, internalIdMap = /* @__PURE__ */ new Map()) {
  switch (result2.type) {
    case "undefined":
      return void 0;
    case "null":
      return null;
    case "number":
      return typeof result2.value === "number" ? result2.value : parseUnserializableValue(result2.value);
    case "boolean":
      return Boolean(result2.value);
    case "string":
      return result2.value;
    case "bigint":
      return BigInt(result2.value);
    case "array":
      return deserializeBidiList(result2, internalIdMap);
    case "arraybuffer":
      return getValue(result2, internalIdMap, () => ({}));
    case "date":
      return getValue(result2, internalIdMap, () => new Date(result2.value));
    case "error":
      return getValue(result2, internalIdMap, () => {
        const error = new Error();
        error.stack = "";
        return error;
      });
    case "function":
      return void 0;
    case "generator":
      return getValue(result2, internalIdMap, () => ({}));
    case "htmlcollection":
      return { ...deserializeBidiList(result2, internalIdMap) };
    case "map":
      return getValue(result2, internalIdMap, () => ({}));
    case "node":
      return "ref: <Node>";
    case "nodelist":
      return { ...deserializeBidiList(result2, internalIdMap) };
    case "object":
      return deserializeBidiMapping(result2, internalIdMap);
    case "promise":
      return getValue(result2, internalIdMap, () => ({}));
    case "proxy":
      return getValue(result2, internalIdMap, () => ({}));
    case "regexp":
      return getValue(result2, internalIdMap, () => new RegExp(result2.value.pattern, result2.value.flags));
    case "set":
      return getValue(result2, internalIdMap, () => ({}));
    case "symbol":
      return void 0;
    case "typedarray":
      return void 0;
    case "weakmap":
      return getValue(result2, internalIdMap, () => ({}));
    case "weakset":
      return getValue(result2, internalIdMap, () => ({}));
    case "window":
      return "ref: <Window>";
  }
}
function getValue(bidiValue, internalIdMap, defaultValue) {
  if ("internalId" in bidiValue && bidiValue.internalId) {
    if (internalIdMap.has(bidiValue.internalId)) {
      return internalIdMap.get(bidiValue.internalId);
    } else {
      const value2 = defaultValue();
      internalIdMap.set(bidiValue.internalId, value2);
      return value2;
    }
  } else {
    return defaultValue();
  }
}
function deserializeBidiList(bidiValue, internalIdMap) {
  const result2 = getValue(bidiValue, internalIdMap, () => []);
  for (const val of bidiValue.value || [])
    result2.push(deserializeBidiValue(val, internalIdMap));
  return result2;
}
function deserializeBidiMapping(bidiValue, internalIdMap) {
  const result2 = getValue(bidiValue, internalIdMap, () => ({}));
  for (const [serializedKey, serializedValue] of bidiValue.value || []) {
    const key = typeof serializedKey === "string" ? serializedKey : deserializeBidiValue(serializedKey, internalIdMap);
    const value2 = deserializeBidiValue(serializedValue, internalIdMap);
    result2[key] = value2;
  }
  return result2;
}
var init_bidiDeserializer = __esm({
  "packages/playwright-core/src/server/bidi/bidiDeserializer.ts"() {
    "use strict";
    init_javascript();
  }
});

// packages/playwright-core/src/server/bidi/bidiExecutionContext.ts
function rewriteError2(error) {
  if (error.message.includes("too much recursion") || error.message.includes("stack limit exceeded"))
    throw new Error("Cannot serialize result: object reference chain is too long.");
  throw error;
}
function renderPreview2(remoteObject, nested = false) {
  switch (remoteObject.type) {
    case "undefined":
    case "null":
      return remoteObject.type;
    case "number":
    case "boolean":
    case "string":
      return String(remoteObject.value);
    case "bigint":
      return `${remoteObject.value}n`;
    case "date":
      return String(new Date(remoteObject.value));
    case "regexp":
      return String(new RegExp(remoteObject.value.pattern, remoteObject.value.flags));
    case "node":
      return remoteObject.value?.localName || "Node";
    case "object":
      if (nested)
        return "Object";
      const tokens = [];
      for (const [name, value2] of remoteObject.value || []) {
        if (typeof name === "string")
          tokens.push(`${name}: ${renderPreview2(value2, true)}`);
      }
      return `{${tokens.join(", ")}}`;
    case "array":
    case "htmlcollection":
    case "nodelist":
      if (nested || !remoteObject.value)
        return remoteObject.value ? `Array(${remoteObject.value.length})` : "Array";
      return `[${remoteObject.value.map((v) => renderPreview2(v, true)).join(", ")}]`;
    case "map":
      return remoteObject.value ? `Map(${remoteObject.value.length})` : "Map";
    case "set":
      return remoteObject.value ? `Set(${remoteObject.value.length})` : "Set";
    case "arraybuffer":
      return "ArrayBuffer";
    case "error":
      return "Error";
    case "function":
      return "Function";
    case "generator":
      return "Generator";
    case "promise":
      return "Promise";
    case "proxy":
      return "Proxy";
    case "symbol":
      return "Symbol()";
    case "typedarray":
      return "TypedArray";
    case "weakmap":
      return "WeakMap";
    case "weakset":
      return "WeakSet";
    case "window":
      return "Window";
  }
}
function createHandle2(context2, remoteObject) {
  if (remoteObject.type === "node") {
    assert(context2 instanceof FrameExecutionContext);
    return new ElementHandle(context2, remoteObject.handle);
  }
  const objectId = "handle" in remoteObject ? remoteObject.handle : void 0;
  const preview = renderPreview2(remoteObject);
  const handle = new JSHandle(context2, remoteObject.type, preview, objectId, deserializeBidiValue(remoteObject));
  handle._setPreview(preview);
  return handle;
}
var BidiExecutionContext;
var init_bidiExecutionContext = __esm({
  "packages/playwright-core/src/server/bidi/bidiExecutionContext.ts"() {
    "use strict";
    init_utilityScriptSerializers();
    init_assert();
    init_javascript();
    init_dom();
    init_bidiProtocol();
    init_bidiSerializer();
    init_bidiDeserializer();
    BidiExecutionContext = class {
      constructor(session2, realmInfo) {
        this._session = session2;
        if (realmInfo.type === "window") {
          this._target = {
            context: realmInfo.context,
            sandbox: realmInfo.sandbox
          };
        } else {
          this._target = {
            realm: realmInfo.realm
          };
        }
      }
      async rawEvaluateJSON(expression2) {
        const response2 = await this._session.send("script.evaluate", {
          expression: expression2,
          target: this._target,
          serializationOptions: {
            maxObjectDepth: 10,
            maxDomDepth: 10
          },
          awaitPromise: true,
          userActivation: true
        });
        if (response2.type === "success")
          return deserializeBidiValue(response2.result);
        if (response2.type === "exception")
          throw new JavaScriptErrorInEvaluate(response2.exceptionDetails.text);
        throw new JavaScriptErrorInEvaluate("Unexpected response type: " + JSON.stringify(response2));
      }
      async rawEvaluateHandle(context2, expression2) {
        const response2 = await this._session.send("script.evaluate", {
          expression: expression2,
          target: this._target,
          resultOwnership: Script.ResultOwnership.Root,
          // Necessary for the handle to be returned.
          serializationOptions: { maxObjectDepth: 0, maxDomDepth: 0 },
          awaitPromise: true,
          userActivation: true
        });
        if (response2.type === "success") {
          if ("handle" in response2.result)
            return createHandle2(context2, response2.result);
          throw new JavaScriptErrorInEvaluate("Cannot get handle: " + JSON.stringify(response2.result));
        }
        if (response2.type === "exception")
          throw new JavaScriptErrorInEvaluate(response2.exceptionDetails.text);
        throw new JavaScriptErrorInEvaluate("Unexpected response type: " + JSON.stringify(response2));
      }
      async evaluateWithArguments(functionDeclaration, returnByValue, utilityScript, values, handles) {
        const response2 = await this._session.send("script.callFunction", {
          functionDeclaration,
          target: this._target,
          arguments: [
            { handle: utilityScript._objectId },
            ...values.map(BidiSerializer.serialize),
            ...handles.map((handle) => ({ handle: handle._objectId }))
          ],
          resultOwnership: returnByValue ? void 0 : Script.ResultOwnership.Root,
          // Necessary for the handle to be returned.
          serializationOptions: returnByValue ? {} : { maxObjectDepth: 0, maxDomDepth: 0 },
          awaitPromise: true,
          userActivation: true
        }).catch(rewriteError2);
        if (response2.type === "exception")
          throw new JavaScriptErrorInEvaluate(response2.exceptionDetails.text);
        if (response2.type === "success") {
          if (returnByValue)
            return parseEvaluationResultValue(deserializeBidiValue(response2.result));
          return createHandle2(utilityScript._context, response2.result);
        }
        throw new JavaScriptErrorInEvaluate("Unexpected response type: " + JSON.stringify(response2));
      }
      async getProperties(handle) {
        const names = await handle.evaluate((object) => {
          const names2 = [];
          const descriptors = Object.getOwnPropertyDescriptors(object);
          for (const name in descriptors) {
            if (descriptors[name]?.enumerable)
              names2.push(name);
          }
          return names2;
        });
        const values = await Promise.all(names.map(async (name) => {
          const value2 = await this._rawCallFunction("(object, name) => object[name]", [{ handle: handle._objectId }, { type: "string", value: name }], true, false);
          return createHandle2(handle._context, value2);
        }));
        const map = /* @__PURE__ */ new Map();
        for (let i = 0; i < names.length; i++)
          map.set(names[i], values[i]);
        return map;
      }
      async releaseHandle(handle) {
        if (!handle._objectId)
          return;
        await this._session.send("script.disown", {
          target: this._target,
          handles: [handle._objectId]
        });
      }
      shouldPrependErrorPrefix() {
        return false;
      }
      async nodeIdForElementHandle(handle) {
        const shared = await this._remoteValueForReference({ handle: handle._objectId });
        if (!("sharedId" in shared))
          throw new Error("Element is not a node");
        return {
          sharedId: shared.sharedId
        };
      }
      async remoteObjectForNodeId(context2, nodeId) {
        const result2 = await this._remoteValueForReference(nodeId, true);
        if (!("handle" in result2))
          throw new Error("Can't get remote object for nodeId");
        return createHandle2(context2, result2);
      }
      async contentFrameIdForFrame(handle) {
        const contentWindow = await this._rawCallFunction("e => e.contentWindow", [{ handle: handle._objectId }]);
        if (contentWindow?.type === "window")
          return contentWindow.value.context;
        return null;
      }
      async frameIdForWindowHandle(handle) {
        if (!handle._objectId)
          throw new Error("JSHandle is not a DOM node handle");
        const contentWindow = await this._remoteValueForReference({ handle: handle._objectId });
        if (contentWindow.type === "window")
          return contentWindow.value.context;
        return null;
      }
      async _remoteValueForReference(reference, createHandle6) {
        return await this._rawCallFunction("e => e", [reference], createHandle6);
      }
      async _rawCallFunction(functionDeclaration, args, createHandle6, awaitPromise = true) {
        const response2 = await this._session.send("script.callFunction", {
          functionDeclaration,
          target: this._target,
          arguments: args,
          // "Root" is necessary for the handle to be returned.
          resultOwnership: createHandle6 ? Script.ResultOwnership.Root : Script.ResultOwnership.None,
          serializationOptions: { maxObjectDepth: 0, maxDomDepth: 0 },
          awaitPromise,
          userActivation: true
        });
        if (response2.type === "exception")
          throw new JavaScriptErrorInEvaluate(response2.exceptionDetails.text);
        if (response2.type === "success")
          return response2.result;
        throw new JavaScriptErrorInEvaluate("Unexpected response type: " + JSON.stringify(response2));
      }
    };
  }
});

// packages/playwright-core/src/server/bidi/third_party/bidiKeyboard.ts
var getBidiKeyValue;
var init_bidiKeyboard = __esm({
  "packages/playwright-core/src/server/bidi/third_party/bidiKeyboard.ts"() {
    "use strict";
    getBidiKeyValue = (keyName) => {
      switch (keyName) {
        case "\r":
        case "\n":
          keyName = "Enter";
          break;
      }
      if ([...keyName].length === 1) {
        return keyName;
      }
      switch (keyName) {
        case "Cancel":
          return "\uE001";
        case "Help":
          return "\uE002";
        case "Backspace":
          return "\uE003";
        case "Tab":
          return "\uE004";
        case "Clear":
          return "\uE005";
        case "Enter":
          return "\uE007";
        case "Shift":
        case "ShiftLeft":
          return "\uE008";
        case "Control":
        case "ControlLeft":
          return "\uE009";
        case "Alt":
        case "AltLeft":
          return "\uE00A";
        case "Pause":
          return "\uE00B";
        case "Escape":
          return "\uE00C";
        case "PageUp":
          return "\uE00E";
        case "PageDown":
          return "\uE00F";
        case "End":
          return "\uE010";
        case "Home":
          return "\uE011";
        case "ArrowLeft":
          return "\uE012";
        case "ArrowUp":
          return "\uE013";
        case "ArrowRight":
          return "\uE014";
        case "ArrowDown":
          return "\uE015";
        case "Insert":
          return "\uE016";
        case "Delete":
          return "\uE017";
        case "NumpadEqual":
          return "\uE019";
        case "Numpad0":
          return "\uE01A";
        case "Numpad1":
          return "\uE01B";
        case "Numpad2":
          return "\uE01C";
        case "Numpad3":
          return "\uE01D";
        case "Numpad4":
          return "\uE01E";
        case "Numpad5":
          return "\uE01F";
        case "Numpad6":
          return "\uE020";
        case "Numpad7":
          return "\uE021";
        case "Numpad8":
          return "\uE022";
        case "Numpad9":
          return "\uE023";
        case "NumpadMultiply":
          return "\uE024";
        case "NumpadAdd":
          return "\uE025";
        case "NumpadSubtract":
          return "\uE027";
        case "NumpadDecimal":
          return "\uE028";
        case "NumpadDivide":
          return "\uE029";
        case "F1":
          return "\uE031";
        case "F2":
          return "\uE032";
        case "F3":
          return "\uE033";
        case "F4":
          return "\uE034";
        case "F5":
          return "\uE035";
        case "F6":
          return "\uE036";
        case "F7":
          return "\uE037";
        case "F8":
          return "\uE038";
        case "F9":
          return "\uE039";
        case "F10":
          return "\uE03A";
        case "F11":
          return "\uE03B";
        case "F12":
          return "\uE03C";
        case "Meta":
        case "MetaLeft":
          return "\uE03D";
        case "ShiftRight":
          return "\uE050";
        case "ControlRight":
          return "\uE051";
        case "AltRight":
          return "\uE052";
        case "MetaRight":
          return "\uE053";
        case "Space":
          return " ";
        case "Digit0":
          return "0";
        case "Digit1":
          return "1";
        case "Digit2":
          return "2";
        case "Digit3":
          return "3";
        case "Digit4":
          return "4";
        case "Digit5":
          return "5";
        case "Digit6":
          return "6";
        case "Digit7":
          return "7";
        case "Digit8":
          return "8";
        case "Digit9":
          return "9";
        case "KeyA":
          return "a";
        case "KeyB":
          return "b";
        case "KeyC":
          return "c";
        case "KeyD":
          return "d";
        case "KeyE":
          return "e";
        case "KeyF":
          return "f";
        case "KeyG":
          return "g";
        case "KeyH":
          return "h";
        case "KeyI":
          return "i";
        case "KeyJ":
          return "j";
        case "KeyK":
          return "k";
        case "KeyL":
          return "l";
        case "KeyM":
          return "m";
        case "KeyN":
          return "n";
        case "KeyO":
          return "o";
        case "KeyP":
          return "p";
        case "KeyQ":
          return "q";
        case "KeyR":
          return "r";
        case "KeyS":
          return "s";
        case "KeyT":
          return "t";
        case "KeyU":
          return "u";
        case "KeyV":
          return "v";
        case "KeyW":
          return "w";
        case "KeyX":
          return "x";
        case "KeyY":
          return "y";
        case "KeyZ":
          return "z";
        case "Semicolon":
          return ";";
        case "Equal":
          return "=";
        case "Comma":
          return ",";
        case "Minus":
          return "-";
        case "Period":
          return ".";
        case "Slash":
          return "/";
        case "Backquote":
          return "`";
        case "BracketLeft":
          return "[";
        case "Backslash":
          return "\\";
        case "BracketRight":
          return "]";
        case "Quote":
          return '"';
        default:
          throw new Error(`Unknown key: "${keyName}"`);
      }
    };
  }
});

// packages/playwright-core/src/server/bidi/bidiInput.ts
function toBidiButton(button) {
  switch (button) {
    case "left":
      return 0;
    case "right":
      return 2;
    case "middle":
      return 1;
  }
  throw new Error("Unknown button: " + button);
}
var RawKeyboardImpl2, RawMouseImpl2, RawTouchscreenImpl2;
var init_bidiInput = __esm({
  "packages/playwright-core/src/server/bidi/bidiInput.ts"() {
    "use strict";
    init_input();
    init_bidiKeyboard();
    init_bidiProtocol();
    RawKeyboardImpl2 = class {
      constructor(session2) {
        this._session = session2;
      }
      setSession(session2) {
        this._session = session2;
      }
      async keydown(progress2, modifiers, keyName, description, autoRepeat) {
        keyName = resolveSmartModifierString(keyName);
        const actions = [];
        actions.push({ type: "keyDown", value: getBidiKeyValue(keyName) });
        await this._performActions(progress2, actions);
      }
      async keyup(progress2, modifiers, keyName, description) {
        keyName = resolveSmartModifierString(keyName);
        const actions = [];
        actions.push({ type: "keyUp", value: getBidiKeyValue(keyName) });
        await this._performActions(progress2, actions);
      }
      async sendText(progress2, text2) {
        const actions = [];
        for (const char of text2) {
          const value2 = getBidiKeyValue(char);
          actions.push({ type: "keyDown", value: value2 });
          actions.push({ type: "keyUp", value: value2 });
        }
        await this._performActions(progress2, actions);
      }
      async _performActions(progress2, actions) {
        await progress2.race(this._session.send("input.performActions", {
          context: this._session.sessionId,
          actions: [
            {
              type: "key",
              id: "pw_keyboard",
              actions
            }
          ]
        }));
      }
    };
    RawMouseImpl2 = class {
      constructor(session2) {
        this._session = session2;
      }
      async move(progress2, x, y, button, buttons, modifiers, forClick) {
        await this._performActions(progress2, [{ type: "pointerMove", x, y }]);
      }
      async down(progress2, x, y, button, buttons, modifiers, clickCount) {
        await this._performActions(progress2, [{ type: "pointerDown", button: toBidiButton(button) }]);
      }
      async up(progress2, x, y, button, buttons, modifiers, clickCount) {
        await this._performActions(progress2, [{ type: "pointerUp", button: toBidiButton(button) }]);
      }
      async wheel(progress2, x, y, buttons, modifiers, deltaX, deltaY) {
        x = Math.floor(x);
        y = Math.floor(y);
        await progress2.race(this._session.send("input.performActions", {
          context: this._session.sessionId,
          actions: [
            {
              type: "wheel",
              id: "pw_mouse_wheel",
              actions: [{ type: "scroll", x, y, deltaX, deltaY }]
            }
          ]
        }));
      }
      async _performActions(progress2, actions) {
        await progress2.race(this._session.send("input.performActions", {
          context: this._session.sessionId,
          actions: [
            {
              type: "pointer",
              id: "pw_mouse",
              parameters: {
                pointerType: Input.PointerType.Mouse
              },
              actions
            }
          ]
        }));
      }
    };
    RawTouchscreenImpl2 = class {
      constructor(session2) {
        this._session = session2;
      }
      async tap(progress2, x, y, modifiers) {
      }
    };
  }
});

// packages/playwright-core/src/server/bidi/bidiPdf.ts
function convertPrintParameterToInches2(text2) {
  if (text2 === void 0)
    return void 0;
  let unit = text2.substring(text2.length - 2).toLowerCase();
  let valueText = "";
  if (unitToPixels2.hasOwnProperty(unit)) {
    valueText = text2.substring(0, text2.length - 2);
  } else {
    unit = "px";
    valueText = text2;
  }
  const value2 = Number(valueText);
  assert(!isNaN(value2), "Failed to parse parameter value: " + text2);
  const pixels = value2 * unitToPixels2[unit];
  return pixels / 96;
}
var PagePaperFormats2, unitToPixels2, BidiPDF;
var init_bidiPdf = __esm({
  "packages/playwright-core/src/server/bidi/bidiPdf.ts"() {
    "use strict";
    init_assert();
    PagePaperFormats2 = {
      letter: { width: 8.5, height: 11 },
      legal: { width: 8.5, height: 14 },
      tabloid: { width: 11, height: 17 },
      ledger: { width: 17, height: 11 },
      a0: { width: 33.1, height: 46.8 },
      a1: { width: 23.4, height: 33.1 },
      a2: { width: 16.54, height: 23.4 },
      a3: { width: 11.7, height: 16.54 },
      a4: { width: 8.27, height: 11.7 },
      a5: { width: 5.83, height: 8.27 },
      a6: { width: 4.13, height: 5.83 }
    };
    unitToPixels2 = {
      "px": 1,
      "in": 96,
      "cm": 37.8,
      "mm": 3.78
    };
    BidiPDF = class {
      constructor(session2) {
        this._session = session2;
      }
      async generate(options) {
        const {
          scale = 1,
          printBackground = false,
          landscape = false,
          pageRanges = "",
          margin = {}
        } = options;
        let paperWidth = 8.5;
        let paperHeight = 11;
        if (options.format) {
          const format2 = PagePaperFormats2[options.format.toLowerCase()];
          assert(format2, "Unknown paper format: " + options.format);
          paperWidth = format2.width;
          paperHeight = format2.height;
        } else {
          paperWidth = convertPrintParameterToInches2(options.width) || paperWidth;
          paperHeight = convertPrintParameterToInches2(options.height) || paperHeight;
        }
        const { data } = await this._session.send("browsingContext.print", {
          context: this._session.sessionId,
          background: printBackground,
          margin: {
            bottom: convertPrintParameterToInches2(margin.bottom) || 0,
            left: convertPrintParameterToInches2(margin.left) || 0,
            right: convertPrintParameterToInches2(margin.right) || 0,
            top: convertPrintParameterToInches2(margin.top) || 0
          },
          orientation: landscape ? "landscape" : "portrait",
          page: {
            width: paperWidth,
            height: paperHeight
          },
          pageRanges: pageRanges ? pageRanges.split(",").map((r) => r.trim()) : void 0,
          scale
        });
        return Buffer.from(data, "base64");
      }
    };
  }
});

// packages/playwright-core/src/server/bidi/bidiPage.ts
function toBidiExecutionContext(executionContext) {
  return executionContext.delegate;
}
var UTILITY_WORLD_NAME, kPlaywrightBindingChannel, BidiPage;
var init_bidiPage = __esm({
  "packages/playwright-core/src/server/bidi/bidiPage.ts"() {
    "use strict";
    init_debugLogger();
    init_eventsHelper();
    init_dialog();
    init_dom();
    init_bidiBrowser();
    init_page();
    init_bidiExecutionContext();
    init_bidiInput();
    init_bidiNetworkManager();
    init_bidiPdf();
    init_bidiProtocol();
    init_progress();
    init_network2();
    UTILITY_WORLD_NAME = "__playwright_utility_world__";
    kPlaywrightBindingChannel = "playwrightChannel";
    BidiPage = class {
      constructor(browserContext, bidiSession, opener) {
        this._realmToWorkerContext = /* @__PURE__ */ new Map();
        this._sessionListeners = [];
        this._initScriptIds = /* @__PURE__ */ new Map();
        this._fragmentNavigations = /* @__PURE__ */ new Set();
        this._session = bidiSession;
        this._opener = opener;
        this.rawKeyboard = new RawKeyboardImpl2(bidiSession);
        this.rawMouse = new RawMouseImpl2(bidiSession);
        this.rawTouchscreen = new RawTouchscreenImpl2(bidiSession);
        this._contextIdToContext = /* @__PURE__ */ new Map();
        this._page = new Page(this, browserContext);
        this._browserContext = browserContext;
        this._networkManager = new BidiNetworkManager(this._session, this._page);
        this._pdf = new BidiPDF(this._session);
        this._page.on(Page.Events.FrameDetached, (frame) => this._removeContextsForFrame(frame, false));
        this._sessionListeners = [
          eventsHelper.addEventListener(bidiSession, "script.realmCreated", this._onRealmCreated.bind(this)),
          eventsHelper.addEventListener(bidiSession, "script.message", this._onScriptMessage.bind(this)),
          eventsHelper.addEventListener(bidiSession, "browsingContext.contextDestroyed", this._onBrowsingContextDestroyed.bind(this)),
          eventsHelper.addEventListener(bidiSession, "browsingContext.navigationStarted", this._onNavigationStarted.bind(this)),
          eventsHelper.addEventListener(bidiSession, "browsingContext.navigationCommitted", this._onNavigationCommitted.bind(this)),
          eventsHelper.addEventListener(bidiSession, "browsingContext.navigationAborted", this._onNavigationAborted.bind(this)),
          eventsHelper.addEventListener(bidiSession, "browsingContext.navigationFailed", this._onNavigationFailed.bind(this)),
          eventsHelper.addEventListener(bidiSession, "browsingContext.fragmentNavigated", this._onFragmentNavigated.bind(this)),
          eventsHelper.addEventListener(bidiSession, "browsingContext.historyUpdated", this._onHistoryUpdated.bind(this)),
          eventsHelper.addEventListener(bidiSession, "browsingContext.domContentLoaded", this._onDomContentLoaded.bind(this)),
          eventsHelper.addEventListener(bidiSession, "browsingContext.load", this._onLoad.bind(this)),
          eventsHelper.addEventListener(bidiSession, "browsingContext.downloadWillBegin", this._onDownloadWillBegin.bind(this)),
          eventsHelper.addEventListener(bidiSession, "browsingContext.downloadEnd", this._onDownloadEnded.bind(this)),
          eventsHelper.addEventListener(bidiSession, "browsingContext.userPromptOpened", this._onUserPromptOpened.bind(this)),
          eventsHelper.addEventListener(bidiSession, "log.entryAdded", this._onLogEntryAdded.bind(this)),
          eventsHelper.addEventListener(bidiSession, "input.fileDialogOpened", this._onFileDialogOpened.bind(this))
        ];
        this._initialize().then(
          () => this._page.reportAsNew(this._opener?._page),
          (error) => this._page.reportAsNew(this._opener?._page, error)
        );
      }
      async _initialize() {
        this._onFrameAttached(this._session.sessionId, null);
        await Promise.all([
          this.updateHttpCredentials()
          // If the page is created by the Playwright client's call, some initialization
          // may be pending. Wait for it to complete before reporting the page as new.
        ]);
      }
      didClose() {
        this._session.dispose();
        eventsHelper.removeEventListeners(this._sessionListeners);
        this._page._didClose();
      }
      _onFrameAttached(frameId, parentFrameId) {
        return this._page.frameManager.frameAttached(frameId, parentFrameId);
      }
      _removeContextsForFrame(frame, notifyFrame) {
        for (const [contextId4, context2] of this._contextIdToContext) {
          if (context2.frame === frame) {
            this._contextIdToContext.delete(contextId4);
            if (notifyFrame)
              frame.contextDestroyed(context2);
          }
        }
      }
      _onRealmCreated(realmInfo) {
        if (realmInfo.type === "dedicated-worker") {
          const delegate2 = new BidiExecutionContext(this._session, realmInfo);
          const worker = new Worker(this._page, realmInfo.origin);
          this._realmToWorkerContext.set(realmInfo.realm, worker.createExecutionContext(delegate2));
          worker.workerScriptLoaded();
          this._page.addWorker(realmInfo.realm, worker);
          return;
        }
        if (this._contextIdToContext.has(realmInfo.realm))
          return;
        if (realmInfo.type !== "window")
          return;
        const frame = this._page.frameManager.frame(realmInfo.context);
        if (!frame)
          return;
        let worldName;
        if (!realmInfo.sandbox) {
          worldName = "main";
          this._touchUtilityWorld(realmInfo.context);
        } else if (realmInfo.sandbox === UTILITY_WORLD_NAME) {
          worldName = "utility";
        } else {
          return;
        }
        const delegate = new BidiExecutionContext(this._session, realmInfo);
        const context2 = new FrameExecutionContext(delegate, frame, worldName);
        frame.contextCreated(worldName, context2);
        this._contextIdToContext.set(realmInfo.realm, context2);
      }
      async _touchUtilityWorld(context2) {
        await this._session.sendMayFail("script.evaluate", {
          expression: "1 + 1",
          target: {
            context: context2,
            sandbox: UTILITY_WORLD_NAME
          },
          serializationOptions: {
            maxObjectDepth: 10,
            maxDomDepth: 10
          },
          awaitPromise: true,
          userActivation: true
        });
      }
      _onRealmDestroyed(params2) {
        const context2 = this._contextIdToContext.get(params2.realm);
        if (context2) {
          this._contextIdToContext.delete(params2.realm);
          context2.frame.contextDestroyed(context2);
          return true;
        }
        const existed = this._realmToWorkerContext.delete(params2.realm);
        if (existed) {
          this._page.removeWorker(params2.realm);
          return true;
        }
        return false;
      }
      // TODO: route the message directly to the browser
      _onBrowsingContextDestroyed(params2) {
        this._browserContext._browser._onBrowsingContextDestroyed(params2);
      }
      _onNavigationStarted(params2) {
        const frameId = params2.context;
        this._page.frameManager.frameRequestedNavigation(frameId, params2.navigation);
      }
      _onNavigationCommitted(params2) {
        const frameId = params2.context;
        const frame = this._page.frameManager.frame(frameId);
        this._browserContext.doGrantGlobalPermissionsForURL(params2.url).catch((error) => debugLogger.log("error", error));
        this._page.frameManager.frameCommittedNewDocumentNavigation(
          frameId,
          params2.url,
          frame._name,
          params2.navigation,
          /* initial */
          false
        );
      }
      _onDomContentLoaded(params2) {
        const frameId = params2.context;
        this._page.frameManager.frameLifecycleEvent(frameId, "domcontentloaded");
      }
      _onLoad(params2) {
        this._page.frameManager.frameLifecycleEvent(params2.context, "load");
      }
      _onNavigationAborted(params2) {
        this._page.frameManager.frameAbortedNavigation(params2.context, "Navigation aborted", params2.navigation || void 0);
      }
      _onNavigationFailed(params2) {
        this._page.frameManager.frameAbortedNavigation(params2.context, "Navigation failed", params2.navigation || void 0);
      }
      _onFragmentNavigated(params2) {
        if (params2.navigation)
          this._fragmentNavigations.add(params2.navigation);
        this._page.frameManager.frameCommittedSameDocumentNavigation(params2.context, params2.url);
      }
      _onHistoryUpdated(params2) {
        this._page.frameManager.frameCommittedSameDocumentNavigation(params2.context, params2.url);
      }
      _onUserPromptOpened(event) {
        this._page.browserContext.dialogManager.dialogDidOpen(new Dialog(
          this._page,
          event.type,
          event.message,
          async (accept, userText) => {
            await this._session.send("browsingContext.handleUserPrompt", { context: event.context, accept, userText });
          },
          event.defaultValue
        ));
      }
      _onDownloadWillBegin(event) {
        if (!event.navigation)
          return;
        this._page.frameManager.frameAbortedNavigation(event.context, "Download is starting");
        let originPage = this._page.initializedOrUndefined();
        if (!originPage && this._opener)
          originPage = this._opener._page.initializedOrUndefined();
        if (!originPage)
          return;
        this._browserContext._browser.downloadCreated(originPage, event.navigation, event.url, event.suggestedFilename, event.suggestedFilename);
      }
      _onDownloadEnded(event) {
        if (!event.navigation)
          return;
        this._browserContext._browser.downloadFinished(event.navigation, event.status === "canceled" ? "canceled" : void 0);
      }
      _onLogEntryAdded(params2) {
        if (params2.type === "javascript" && params2.level === "error") {
          let errorName = "";
          let errorMessage;
          if (params2.text?.includes(": ")) {
            const index = params2.text.indexOf(": ");
            errorName = params2.text.substring(0, index);
            errorMessage = params2.text.substring(index + 2);
          } else {
            errorMessage = params2.text ?? void 0;
          }
          const error = new Error(errorMessage);
          error.name = errorName;
          error.stack = `${params2.text}
${params2.stackTrace?.callFrames.map((f) => {
            const location4 = `${f.url}:${f.lineNumber + 1}:${f.columnNumber + 1}`;
            return f.functionName ? `    at ${f.functionName} (${location4})` : `    at ${location4}`;
          }).join("\n")}`;
          const callFrame2 = params2.stackTrace?.callFrames[0];
          const location3 = callFrame2 ?? { url: "", lineNumber: 1, columnNumber: 1 };
          this._page.addPageError(error, location3);
          return;
        }
        if (params2.type !== "console")
          return;
        const entry = params2;
        const context2 = this._contextIdToContext.get(params2.source.realm) ?? this._realmToWorkerContext.get(params2.source.realm);
        if (!context2)
          return;
        const callFrame = params2.stackTrace?.callFrames[0];
        const location2 = callFrame ?? { url: "", lineNumber: 1, columnNumber: 1 };
        const type3 = entry.method === "warn" ? "warning" : entry.method;
        const text2 = (entry.method === "timeLog" || entry.method === "timeEnd") && entry.text ? entry.text : void 0;
        this._page.addConsoleMessage(null, type3, entry.args.map((arg) => createHandle2(context2, arg)), location2, text2, params2.timestamp);
      }
      async _onFileDialogOpened(params2) {
        if (!params2.element)
          return;
        const frame = this._page.frameManager.frame(params2.context);
        if (!frame)
          return;
        const executionContext = await frame.mainContext();
        try {
          const handle = await toBidiExecutionContext(executionContext).remoteObjectForNodeId(executionContext, { sharedId: params2.element.sharedId });
          await this._page._onFileChooserOpened(handle);
        } catch {
        }
      }
      async navigateFrame(frame, url2, referrer) {
        const { navigation } = await this._session.send("browsingContext.navigate", {
          context: frame._id,
          url: url2
        });
        if (navigation && this._fragmentNavigations.has(navigation)) {
          this._fragmentNavigations.delete(navigation);
          return {};
        }
        return { newDocumentId: navigation || void 0 };
      }
      async updateExtraHTTPHeaders() {
        const allHeaders = mergeHeaders([
          this._browserContext._options.extraHTTPHeaders,
          this._page.extraHTTPHeaders()
        ]);
        await this._session.send("network.setExtraHeaders", {
          headers: allHeaders.map(({ name, value: value2 }) => ({ name, value: { type: "string", value: value2 } })),
          contexts: [this._session.sessionId]
        });
      }
      async updateEmulateMedia() {
      }
      async updateUserAgent() {
      }
      async bringToFront() {
        await this._session.send("browsingContext.activate", {
          context: this._session.sessionId
        });
      }
      async updateEmulatedViewportSize() {
        const options = this._browserContext._options;
        const emulatedSize = this._page.emulatedSize();
        if (!emulatedSize)
          return;
        const screenSize = emulatedSize.screen;
        const viewportSize = emulatedSize.viewport;
        await Promise.all([
          this._session.send("browsingContext.setViewport", {
            context: this._session.sessionId,
            viewport: {
              width: viewportSize.width,
              height: viewportSize.height
            },
            devicePixelRatio: options.deviceScaleFactor || 1
          }),
          this._session.send("emulation.setScreenOrientationOverride", {
            contexts: [this._session.sessionId],
            screenOrientation: getScreenOrientation(!!options.isMobile, screenSize)
          }),
          this._session.send("emulation.setScreenSettingsOverride", {
            contexts: [this._session.sessionId],
            screenArea: {
              width: screenSize.width,
              height: screenSize.height
            }
          })
        ]);
      }
      async updateRequestInterception() {
        await this._networkManager.setRequestInterception(this._page.requestInterceptors.length > 0);
      }
      async updateOffline() {
      }
      async updateHttpCredentials() {
        await this._networkManager.setCredentials(this._browserContext._options.httpCredentials);
      }
      async updateFileChooserInterception() {
      }
      async reload() {
        await this._session.send("browsingContext.reload", {
          context: this._session.sessionId,
          // ignoreCache: true,
          wait: BrowsingContext.ReadinessState.Interactive
        });
      }
      async goBack() {
        return await this._session.send("browsingContext.traverseHistory", {
          context: this._session.sessionId,
          delta: -1
        }).then(() => true).catch(() => false);
      }
      async goForward() {
        return await this._session.send("browsingContext.traverseHistory", {
          context: this._session.sessionId,
          delta: 1
        }).then(() => true).catch(() => false);
      }
      async requestGC() {
        const result2 = await this._session.send("script.evaluate", {
          expression: "TestUtils.gc()",
          target: { context: this._session.sessionId },
          awaitPromise: true
        });
        if (result2.type === "exception")
          throw new Error("Method not implemented.");
      }
      async _onScriptMessage(event) {
        if (event.channel !== kPlaywrightBindingChannel)
          return;
        const pageOrError = await this._page.waitForInitializedOrError();
        if (pageOrError instanceof Error)
          return;
        const context2 = this._contextIdToContext.get(event.source.realm);
        if (!context2)
          return;
        if (event.data.type !== "string")
          return;
        await this._page.onBindingCalled(event.data.value, context2);
      }
      async addInitScript(initScript) {
        const { script } = await this._session.send("script.addPreloadScript", {
          // TODO: remove function call from the source.
          functionDeclaration: `() => { return ${initScript.source} }`,
          // TODO: push to iframes?
          contexts: [this._session.sessionId]
        });
        this._initScriptIds.set(initScript, script);
      }
      async removeInitScripts(initScripts) {
        const ids = [];
        for (const script of initScripts) {
          const id = this._initScriptIds.get(script);
          if (id)
            ids.push(id);
          this._initScriptIds.delete(script);
        }
        await Promise.all(ids.map((script) => this._session.send("script.removePreloadScript", { script })));
      }
      async closePage(runBeforeUnload) {
        if (runBeforeUnload) {
          this._session.sendMayFail("browsingContext.close", {
            context: this._session.sessionId,
            promptUnload: runBeforeUnload
          });
        } else {
          await this._session.send("browsingContext.close", {
            context: this._session.sessionId,
            promptUnload: runBeforeUnload
          });
        }
      }
      async setBackgroundColor(color) {
        if (color)
          throw new Error("Not implemented");
      }
      async takeScreenshot(progress2, format2, documentRect, viewportRect, quality, fitsViewport, scale) {
        const rect = documentRect || viewportRect;
        const { data } = await progress2.race(this._session.send("browsingContext.captureScreenshot", {
          context: this._session.sessionId,
          format: {
            type: `image/${format2 === "png" ? "png" : "jpeg"}`,
            quality: quality !== void 0 ? quality / 100 : void 0
          },
          origin: documentRect ? "document" : "viewport",
          clip: {
            type: "box",
            ...rect
          }
        }));
        return Buffer.from(data, "base64");
      }
      async getContentFrame(handle) {
        const executionContext = toBidiExecutionContext(handle._context);
        const frameId = await executionContext.contentFrameIdForFrame(handle);
        if (!frameId)
          return null;
        return this._page.frameManager.frame(frameId);
      }
      async getOwnerFrame(handle) {
        const windowHandle = await handle.evaluateHandle((node) => {
          const doc = node.ownerDocument ?? node;
          return doc.defaultView;
        });
        if (!windowHandle)
          return null;
        const executionContext = toBidiExecutionContext(handle._context);
        return executionContext.frameIdForWindowHandle(windowHandle);
      }
      async getBoundingBox(handle) {
        const box = await handle.evaluate((element2) => {
          if (!(element2 instanceof Element) || element2.getClientRects().length === 0)
            return null;
          const rect = element2.getBoundingClientRect();
          return { x: rect.x, y: rect.y, width: rect.width, height: rect.height };
        });
        if (!box)
          return null;
        const position = await this._framePosition(handle._frame);
        if (!position)
          return null;
        box.x += position.x;
        box.y += position.y;
        return box;
      }
      // TODO: move to Frame.
      async _framePosition(frame) {
        if (frame === this._page.mainFrame())
          return { x: 0, y: 0 };
        const element2 = await frame.frameElement(nullProgress);
        const box = await element2.boundingBox(nullProgress);
        if (!box)
          return null;
        const style = await element2.evaluateInUtility(([injected, iframe]) => injected.describeIFrameStyle(iframe), {}).catch((e) => "error:notconnected");
        if (style === "error:notconnected" || style === "transformed")
          return null;
        box.x += style.left;
        box.y += style.top;
        return box;
      }
      async scrollRectIntoViewIfNeeded(handle, rect) {
        return await handle.evaluateInUtility(([injected, node]) => {
          node.scrollIntoView({
            block: "center",
            inline: "center",
            behavior: "instant"
          });
        }, null).then(() => "done").catch((e) => {
          if (e instanceof Error && e.message.includes("Node is detached from document"))
            return "error:notconnected";
          if (e instanceof Error && e.message.includes("Node does not have a layout object"))
            return "error:notvisible";
          throw e;
        });
      }
      startScreencast(options) {
      }
      stopScreencast() {
      }
      rafCountForStablePosition() {
        return 1;
      }
      async getContentQuads(handle) {
        const quads = await handle.evaluateInUtility(([injected, node]) => {
          if (!node.isConnected)
            return "error:notconnected";
          const rects = node.getClientRects();
          if (!rects)
            return null;
          return [...rects].map((rect) => [
            { x: rect.left, y: rect.top },
            { x: rect.right, y: rect.top },
            { x: rect.right, y: rect.bottom },
            { x: rect.left, y: rect.bottom }
          ]);
        }, null);
        if (!quads || quads === "error:notconnected")
          return quads;
        const position = await this._framePosition(handle._frame);
        if (!position)
          return null;
        quads.forEach((quad) => quad.forEach((point) => {
          point.x += position.x;
          point.y += position.y;
        }));
        return quads;
      }
      async setInputFilePaths(progress2, handle, paths) {
        const fromContext = toBidiExecutionContext(handle._context);
        await progress2.race(this._session.send("input.setFiles", {
          context: this._session.sessionId,
          element: await progress2.race(fromContext.nodeIdForElementHandle(handle)),
          files: paths
        }));
      }
      async adoptElementHandle(handle, to) {
        const fromContext = toBidiExecutionContext(handle._context);
        const nodeId = await fromContext.nodeIdForElementHandle(handle);
        const executionContext = toBidiExecutionContext(to);
        try {
          return await executionContext.remoteObjectForNodeId(to, nodeId);
        } catch {
          throw new Error(kUnableToAdoptErrorMessage);
        }
      }
      async inputActionEpilogue() {
      }
      async resetForReuse(progress2) {
      }
      async pdf(options) {
        return this._pdf.generate(options);
      }
      async getFrameElement(frame) {
        const parent = frame.parentFrame();
        if (!parent)
          throw new Error("Frame has been detached.");
        const node = await this._getFrameNode(frame);
        if (!node?.sharedId)
          throw new Error("Frame has been detached.");
        const parentFrameExecutionContext = await parent.mainContext();
        return await toBidiExecutionContext(parentFrameExecutionContext).remoteObjectForNodeId(parentFrameExecutionContext, { sharedId: node.sharedId });
      }
      async _getFrameNode(frame) {
        const parent = frame.parentFrame();
        if (!parent)
          return void 0;
        const result2 = await this._session.send("browsingContext.locateNodes", {
          context: parent._id,
          locator: { type: "context", value: { context: frame._id } }
        });
        const node = result2.nodes[0];
        return node;
      }
      shouldToggleStyleSheetToSyncAnimations() {
        return true;
      }
      async setDockTile(image) {
      }
    };
  }
});

// packages/playwright-core/src/server/bidi/bidiBrowser.ts
function fromBidiSameSite(sameSite) {
  switch (sameSite) {
    case "strict":
      return "Strict";
    case "lax":
      return "Lax";
    case "none":
      return "None";
    case "default":
      return "Lax";
  }
  return "None";
}
function toBidiSameSite2(sameSite) {
  switch (sameSite) {
    case "Strict":
      return Network.SameSite.Strict;
    case "Lax":
      return Network.SameSite.Lax;
    case "None":
      return Network.SameSite.None;
  }
  return Network.SameSite.None;
}
function getProxyConfiguration(proxySettings) {
  if (!proxySettings)
    return void 0;
  const proxy = {
    proxyType: "manual"
  };
  const url2 = new URL(proxySettings.server);
  switch (url2.protocol) {
    case "http:":
      proxy.httpProxy = url2.host;
      break;
    case "https:":
      proxy.sslProxy = url2.host;
      break;
    case "socks4:":
      proxy.socksProxy = url2.host;
      proxy.socksVersion = 4;
      break;
    case "socks5:":
      proxy.socksProxy = url2.host;
      proxy.socksVersion = 5;
      break;
    default:
      throw new Error("Invalid proxy server protocol: " + proxySettings.server);
  }
  const bypass = proxySettings.bypass ?? process.env.PLAYWRIGHT_PROXY_BYPASS_FOR_TESTING;
  if (bypass)
    proxy.noProxy = bypass.split(",");
  return proxy;
}
function getScreenOrientation(isMobile, viewportSize) {
  const screenOrientation = {
    type: "landscape-primary",
    natural: Emulation.ScreenOrientationNatural.Landscape
  };
  if (isMobile) {
    screenOrientation.natural = Emulation.ScreenOrientationNatural.Portrait;
    if (viewportSize.width <= viewportSize.height)
      screenOrientation.type = "portrait-primary";
  }
  return screenOrientation;
}
var BidiBrowser, BidiBrowserContext2, Network2;
var init_bidiBrowser = __esm({
  "packages/playwright-core/src/server/bidi/bidiBrowser.ts"() {
    "use strict";
    init_eventsHelper();
    init_browser();
    init_browserContext();
    init_network2();
    init_bidiConnection();
    init_bidiNetworkManager();
    init_bidiPage();
    init_page();
    init_bidiProtocol();
    BidiBrowser = class _BidiBrowser extends Browser {
      constructor(parent, transport, options) {
        super(parent, options);
        this._contexts = /* @__PURE__ */ new Map();
        this._bidiPages = /* @__PURE__ */ new Map();
        this._cacheBehavior = "default";
        this._connection = new BidiConnection(transport, this._onDisconnect.bind(this), options.protocolLogger, options.browserLogsCollector);
        this._browserSession = this._connection.browserSession;
        this._eventListeners = [
          eventsHelper.addEventListener(this._browserSession, "browsingContext.contextCreated", this._onBrowsingContextCreated.bind(this)),
          eventsHelper.addEventListener(this._browserSession, "script.realmDestroyed", this._onScriptRealmDestroyed.bind(this))
        ];
      }
      static async connect(parent, transport, options) {
        const browser = new _BidiBrowser(parent, transport, options);
        if (options.__testHookOnConnectToBrowser)
          await options.__testHookOnConnectToBrowser();
        browser._bidiSessionInfo = await browser._browserSession.send("session.new", {
          capabilities: {
            alwaysMatch: {
              "acceptInsecureCerts": options.persistent?.internalIgnoreHTTPSErrors || options.persistent?.ignoreHTTPSErrors,
              "proxy": getProxyConfiguration(options.originalLaunchOptions.proxyOverride ?? options.proxy),
              "unhandledPromptBehavior": {
                default: Session.UserPromptHandlerType.Ignore
              },
              "webSocketUrl": true,
              // Chrome with WebDriver BiDi does not support prerendering
              // yet because WebDriver BiDi behavior is not specified. See
              // https://github.com/w3c/webdriver-bidi/issues/321.
              "goog:prerenderingDisabled": true
            }
          }
        });
        await browser._browserSession.send("session.subscribe", {
          events: [
            "browsingContext",
            "network",
            "log",
            "script",
            "input"
          ]
        });
        await browser._browserSession.send("network.addIntercept", { phases: [Network.InterceptPhase.AuthRequired] });
        await browser._browserSession.send("network.addDataCollector", {
          dataTypes: [Network.DataType.Response],
          maxEncodedDataSize: 2e7
          // same default as in CDP: https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/inspector/inspector_network_agent.cc;l=134;drc=4128411589187a396829a827f59a655bed876aa7
        });
        if (options.persistent) {
          const context2 = new BidiBrowserContext2(browser, void 0, options.persistent);
          browser._defaultContext = context2;
          await context2.initialize();
          const page = await browser._defaultContext.doCreateNewPage();
          await page.waitForInitializedOrError();
        }
        return browser;
      }
      _onDisconnect() {
        this.didClose();
      }
      async doCreateNewContext(options) {
        const proxy = options.proxyOverride || options.proxy;
        const { userContext } = await this._browserSession.send("browser.createUserContext", {
          acceptInsecureCerts: options.internalIgnoreHTTPSErrors || options.ignoreHTTPSErrors,
          proxy: getProxyConfiguration(proxy)
        });
        const context2 = new BidiBrowserContext2(this, userContext, options);
        await context2.initialize();
        this._contexts.set(userContext, context2);
        return context2;
      }
      contexts() {
        return Array.from(this._contexts.values());
      }
      version() {
        return this._bidiSessionInfo.capabilities.browserVersion;
      }
      userAgent() {
        return this._bidiSessionInfo.capabilities.userAgent;
      }
      isConnected() {
        return !this._connection.isClosed();
      }
      async updateCacheBehavior() {
        const cacheBehavior = [...this._contexts.values()].some((context2) => context2.requestInterceptors.length > 0) ? "bypass" : "default";
        if (this._cacheBehavior !== cacheBehavior) {
          await this._browserSession.send("network.setCacheBehavior", { cacheBehavior });
          this._cacheBehavior = cacheBehavior;
        }
      }
      _onBrowsingContextCreated(event) {
        if (event.parent) {
          const parentFrameId = event.parent;
          const page2 = this._findPageForFrame(parentFrameId);
          if (page2) {
            page2._session.addFrameBrowsingContext(event.context);
            const frame = page2._page.frameManager.frameAttached(event.context, parentFrameId);
            frame._url = event.url;
            page2._getFrameNode(frame).then((node) => {
              const attributes = node?.value?.attributes;
              frame._name = attributes?.name ?? attributes?.id ?? "";
            }, () => {
            });
            return;
          }
          return;
        }
        let context2 = this._contexts.get(event.userContext);
        if (!context2)
          context2 = this._defaultContext;
        if (!context2)
          return;
        context2.doGrantGlobalPermissionsForURL(event.url);
        const session2 = this._connection.createMainFrameBrowsingContextSession(event.context);
        const opener = event.originalOpener && this._findPageForFrame(event.originalOpener);
        const page = new BidiPage(context2, session2, opener || null);
        page._page.mainFrame()._url = event.url;
        this._bidiPages.set(event.context, page);
      }
      _onBrowsingContextDestroyed(event) {
        if (event.parent) {
          this._browserSession.removeFrameBrowsingContext(event.context);
          const parentFrameId = event.parent;
          for (const page of this._bidiPages.values()) {
            const parentFrame = page._page.frameManager.frame(parentFrameId);
            if (!parentFrame)
              continue;
            page._page.frameManager.frameDetached(event.context);
            return;
          }
          return;
        }
        const bidiPage = this._bidiPages.get(event.context);
        if (!bidiPage)
          return;
        bidiPage.didClose();
        this._bidiPages.delete(event.context);
      }
      _onScriptRealmDestroyed(event) {
        for (const page of this._bidiPages.values()) {
          if (page._onRealmDestroyed(event))
            return;
        }
      }
      _findPageForFrame(frameId) {
        for (const page of this._bidiPages.values()) {
          if (page._page.frameManager.frame(frameId))
            return page;
        }
      }
    };
    BidiBrowserContext2 = class extends BrowserContext {
      constructor(browser, browserContextId, options) {
        super(browser, options, browserContextId);
        this._originToPermissions = /* @__PURE__ */ new Map();
        this._initScriptIds = /* @__PURE__ */ new Map();
        this.authenticateProxyViaHeader();
      }
      _bidiPages() {
        return [...this._browser._bidiPages.values()].filter((bidiPage) => bidiPage._browserContext === this);
      }
      async initialize() {
        const promises = [
          super.initialize()
        ];
        const downloadBehavior = this._options.acceptDownloads === "accept" ? { type: "allowed", destinationFolder: this._browser.options.downloadsPath } : { type: "denied" };
        promises.push(this._browser._browserSession.send("browser.setDownloadBehavior", {
          downloadBehavior,
          userContexts: [this._userContextId()]
        }));
        promises.push(this.doUpdateDefaultViewport());
        if (this._options.geolocation)
          promises.push(this.setGeolocation(this._options.geolocation));
        if (this._options.locale) {
          promises.push(this._browser._browserSession.send("emulation.setLocaleOverride", {
            locale: this._options.locale,
            userContexts: [this._userContextId()]
          }));
        }
        if (this._options.timezoneId) {
          promises.push(this._browser._browserSession.send("emulation.setTimezoneOverride", {
            timezone: this._options.timezoneId,
            userContexts: [this._userContextId()]
          }));
        }
        if (this._options.userAgent) {
          promises.push(this._browser._browserSession.send("emulation.setUserAgentOverride", {
            userAgent: this._options.userAgent,
            userContexts: [this._userContextId()]
          }));
        }
        if (this._options.extraHTTPHeaders)
          promises.push(this.doUpdateExtraHTTPHeaders());
        if (this._options.permissions)
          promises.push(this.doGrantPermissions("*", this._options.permissions));
        if (this._options.offline)
          promises.push(this.doUpdateOffline());
        await Promise.all(promises);
      }
      possiblyUninitializedPages() {
        return this._bidiPages().map((bidiPage) => bidiPage._page);
      }
      async doCreateNewPage() {
        const { context: context2 } = await this._browser._browserSession.send("browsingContext.create", {
          type: BrowsingContext.CreateType.Window,
          userContext: this._browserContextId
        });
        const page = this._browser._bidiPages.get(context2)._page;
        page.frameManager.frameLifecycleEvent(context2, "domcontentloaded");
        page.frameManager.frameLifecycleEvent(context2, "load");
        return page;
      }
      async doGetCookies(urls) {
        const { cookies } = await this._browser._browserSession.send(
          "storage.getCookies",
          { partition: { type: "storageKey", userContext: this._browserContextId } }
        );
        return filterCookies(cookies.map((c) => {
          const copy = {
            name: c.name,
            value: bidiBytesValueToString(c.value),
            domain: c.domain,
            path: c.path,
            httpOnly: c.httpOnly,
            secure: c.secure,
            expires: c.expiry ?? -1,
            sameSite: c.sameSite ? fromBidiSameSite(c.sameSite) : "None"
          };
          return copy;
        }), urls);
      }
      async addCookies(cookies) {
        cookies = rewriteCookies(cookies);
        const promises = cookies.map(async (c) => {
          const cookie = {
            name: c.name,
            value: { type: "string", value: c.value },
            domain: c.domain,
            path: c.path,
            httpOnly: c.httpOnly,
            secure: c.secure,
            sameSite: c.sameSite && toBidiSameSite2(c.sameSite),
            expiry: c.expires === -1 || c.expires === void 0 ? void 0 : Math.round(c.expires)
          };
          try {
            return await this._browser._browserSession.send(
              "storage.setCookie",
              { cookie, partition: { type: "storageKey", userContext: this._browserContextId, sourceOrigin: c.partitionKey } }
            );
          } catch (e) {
            if (!e.message.startsWith("Protocol error (storage.setCookie): unable to set cookie"))
              throw e;
          }
        });
        await Promise.all(promises);
      }
      async doClearCookies() {
        await this._browser._browserSession.send(
          "storage.deleteCookies",
          { partition: { type: "storageKey", userContext: this._browserContextId } }
        );
      }
      async doGrantPermissions(origin, permissions) {
        if (origin === "null")
          return;
        const currentPermissions = this._originToPermissions.get(origin) || [];
        const toGrant = permissions.filter((permission) => !currentPermissions.includes(permission));
        this._originToPermissions.set(origin, [...currentPermissions, ...toGrant]);
        if (origin === "*") {
          await Promise.all(this._bidiPages().flatMap(
            (page) => page._page.frames().map(
              (frame) => this.doGrantPermissions(new URL(frame._url).origin, permissions)
            )
          ));
        } else {
          await Promise.all(toGrant.map((permission) => this._setPermission(origin, permission, Permissions.PermissionState.Granted)));
        }
      }
      async doGrantGlobalPermissionsForURL(url2) {
        const permissions = this._originToPermissions.get("*");
        if (!permissions)
          return;
        await this.doGrantPermissions(new URL(url2).origin, permissions);
      }
      async doClearPermissions() {
        const currentPermissions = [...this._originToPermissions.entries()];
        this._originToPermissions = /* @__PURE__ */ new Map();
        await Promise.all(currentPermissions.flatMap(([origin, permissions]) => {
          if (origin !== "*")
            return permissions.map((p) => this._setPermission(origin, p, Permissions.PermissionState.Prompt));
        }));
      }
      async _setPermission(origin, permission, state) {
        await this._browser._browserSession.send("permissions.setPermission", {
          descriptor: {
            name: permission
          },
          state,
          origin,
          userContext: this._userContextId()
        });
      }
      async setGeolocation(geolocation) {
        verifyGeolocation(geolocation);
        this._options.geolocation = geolocation;
        await this._browser._browserSession.send("emulation.setGeolocationOverride", {
          coordinates: geolocation ? {
            latitude: geolocation.latitude,
            longitude: geolocation.longitude,
            accuracy: geolocation.accuracy
          } : null,
          userContexts: [this._userContextId()]
        });
      }
      async doUpdateExtraHTTPHeaders() {
        const allHeaders = this._options.extraHTTPHeaders || [];
        await this._browser._browserSession.send("network.setExtraHeaders", {
          headers: allHeaders.map(({ name, value: value2 }) => ({ name, value: { type: "string", value: value2 } })),
          userContexts: [this._userContextId()]
        });
      }
      async setUserAgent(userAgent) {
        this._options.userAgent = userAgent;
        await this._browser._browserSession.send("emulation.setUserAgentOverride", {
          userAgent: userAgent ?? null,
          userContexts: [this._userContextId()]
        });
      }
      async doUpdateOffline() {
        await this._browser._browserSession.send("emulation.setNetworkConditions", {
          networkConditions: this._options.offline ? { type: "offline" } : null,
          userContexts: [this._userContextId()]
        });
      }
      async doSetHTTPCredentials(httpCredentials) {
        this._options.httpCredentials = httpCredentials;
        for (const page of this.pages())
          await page.delegate.updateHttpCredentials();
      }
      async doAddInitScript(initScript) {
        const { script } = await this._browser._browserSession.send("script.addPreloadScript", {
          // TODO: remove function call from the source.
          functionDeclaration: `() => { return ${initScript.source} }`,
          userContexts: [this._userContextId()]
        });
        this._initScriptIds.set(initScript, script);
      }
      async doRemoveInitScripts(initScripts) {
        const ids = [];
        for (const script of initScripts) {
          const id = this._initScriptIds.get(script);
          if (id)
            ids.push(id);
          this._initScriptIds.delete(script);
        }
        await Promise.all(ids.map((script) => this._browser._browserSession.send("script.removePreloadScript", { script })));
      }
      async doUpdateRequestInterception() {
        let interceptPromise = Promise.resolve(void 0);
        if (this.requestInterceptors.length > 0 && !this._interceptId) {
          interceptPromise = this._browser._browserSession.send("network.addIntercept", {
            phases: [Network.InterceptPhase.BeforeRequestSent]
          }).then(({ intercept }) => this._interceptId = intercept);
        }
        if (this.requestInterceptors.length === 0 && this._interceptId) {
          const intercept = this._interceptId;
          this._interceptId = void 0;
          interceptPromise = this._browser._browserSession.send("network.removeIntercept", { intercept });
        }
        await Promise.all([this._browser.updateCacheBehavior(), interceptPromise]);
      }
      async doUpdateDefaultViewport() {
        if (!this._options.viewport && !this._options.screen)
          return;
        const screenSize = this._options.screen || this._options.viewport;
        const viewportSize = this._options.viewport || this._options.screen;
        await Promise.all([
          this._browser._browserSession.send("browsingContext.setViewport", {
            viewport: {
              width: viewportSize.width,
              height: viewportSize.height
            },
            devicePixelRatio: this._options.deviceScaleFactor || 1,
            userContexts: [this._userContextId()]
          }),
          this._browser._browserSession.send("emulation.setScreenOrientationOverride", {
            screenOrientation: getScreenOrientation(!!this._options.isMobile, screenSize),
            userContexts: [this._userContextId()]
          }),
          this._browser._browserSession.send("emulation.setScreenSettingsOverride", {
            screenArea: {
              width: screenSize.width,
              height: screenSize.height
            },
            userContexts: [this._userContextId()]
          })
        ]);
      }
      async doUpdateDefaultEmulatedMedia() {
      }
      async doExposePlaywrightBinding() {
        const args = [{
          type: "channel",
          value: {
            channel: kPlaywrightBindingChannel,
            ownership: Script.ResultOwnership.Root
          }
        }];
        const functionDeclaration = `function addMainBinding(callback) { globalThis['${PageBinding.kBindingName}'] = callback; }`;
        const promises = [];
        promises.push(this._browser._browserSession.send("script.addPreloadScript", {
          functionDeclaration,
          arguments: args,
          userContexts: [this._userContextId()]
        }));
        promises.push(...this._bidiPages().map((page) => {
          const realms = [...page._contextIdToContext].filter(([realm, context2]) => context2.world === "main").map(([realm, context2]) => realm);
          return Promise.all(realms.map((realm) => {
            return page._session.send("script.callFunction", {
              functionDeclaration,
              arguments: args,
              target: { realm },
              awaitPromise: false,
              userActivation: false
            });
          }));
        }));
        await Promise.all(promises);
      }
      onClosePersistent() {
      }
      async clearCache() {
      }
      async doClose(reason) {
        if (!this._browserContextId) {
          return "close-browser";
        }
        await this._browser._browserSession.send("browser.removeUserContext", {
          userContext: this._browserContextId
        });
        await Promise.all(this._bidiPages().map((bidiPage) => bidiPage._page.closedPromise));
        this._browser._contexts.delete(this._browserContextId);
      }
      async cancelDownload(uuid) {
      }
      _userContextId() {
        if (this._browserContextId)
          return this._browserContextId;
        return "default";
      }
    };
    ((Network3) => {
      let SameSite;
      ((SameSite2) => {
        SameSite2["Strict"] = "strict";
        SameSite2["Lax"] = "lax";
        SameSite2["None"] = "none";
      })(SameSite = Network3.SameSite || (Network3.SameSite = {}));
    })(Network2 || (Network2 = {}));
  }
});

// packages/playwright-core/src/server/chromium/crDevTools.ts
var import_fs26, kBindingName2, CRDevTools;
var init_crDevTools = __esm({
  "packages/playwright-core/src/server/chromium/crDevTools.ts"() {
    "use strict";
    import_fs26 = __toESM(require("fs"));
    kBindingName2 = "__pw_devtools__";
    CRDevTools = class {
      constructor(preferencesPath) {
        this._preferencesPath = preferencesPath;
        this._savePromise = Promise.resolve();
      }
      install(session2) {
        session2.on("Runtime.bindingCalled", async (event) => {
          if (event.name !== kBindingName2)
            return;
          const parsed = JSON.parse(event.payload);
          let result2 = void 0;
          if (parsed.method === "getPreferences") {
            if (this._prefs === void 0) {
              try {
                const json = await import_fs26.default.promises.readFile(this._preferencesPath, "utf8");
                this._prefs = JSON.parse(json);
              } catch (e) {
                this._prefs = {};
              }
            }
            result2 = this._prefs;
          } else if (parsed.method === "setPreference") {
            this._prefs[parsed.params[0]] = parsed.params[1];
            this._save();
          } else if (parsed.method === "removePreference") {
            delete this._prefs[parsed.params[0]];
            this._save();
          } else if (parsed.method === "clearPreferences") {
            this._prefs = {};
            this._save();
          }
          session2.send("Runtime.evaluate", {
            expression: `window.DevToolsAPI.embedderMessageAck(${parsed.id}, ${JSON.stringify(result2)})`,
            contextId: event.executionContextId
          }).catch((e) => null);
        });
        Promise.all([
          session2.send("Runtime.enable"),
          session2.send("Runtime.addBinding", { name: kBindingName2 }),
          session2.send("Page.enable"),
          session2.send("Page.addScriptToEvaluateOnNewDocument", { source: `
        (() => {
          const init = () => {
            // Lazy init happens when InspectorFrontendHost is initialized.
            // At this point DevToolsHost is ready to be used.
            const host = window.DevToolsHost;
            const old = host.sendMessageToEmbedder.bind(host);
            host.sendMessageToEmbedder = message => {
              if (['getPreferences', 'setPreference', 'removePreference', 'clearPreferences'].includes(JSON.parse(message).method))
                window.${kBindingName2}(message);
              else
                old(message);
            };
          };
          let value;
          Object.defineProperty(window, 'InspectorFrontendHost', {
            configurable: true,
            enumerable: true,
            get() { return value; },
            set(v) { value = v; init(); },
          });
        })()
      ` }),
          session2.send("Runtime.runIfWaitingForDebugger")
        ]).catch((e) => null);
      }
      _save() {
        this._savePromise = this._savePromise.then(async () => {
          await import_fs26.default.promises.writeFile(this._preferencesPath, JSON.stringify(this._prefs)).catch((e) => null);
        });
      }
    };
  }
});

// packages/playwright-core/src/server/chromium/chromium.ts
function profileInUseError(logs) {
  const markers = [
    "Failed to create a ProcessSingleton for your profile directory.",
    "Opening in existing browser session."
  ];
  for (const log2 of logs) {
    const marker = markers.find((m) => log2.includes(m));
    if (marker) {
      return new Error(
        `${marker} This usually means that the profile is already in use by another instance of Chromium.`
      );
    }
  }
}
async function waitForReadyState(options, browserLogsCollector) {
  if (!options.args?.some((a) => a.startsWith("--remote-debugging-port")))
    return {};
  const result2 = new ManualPromise();
  browserLogsCollector.onMessage((message) => {
    const error = profileInUseError([message]);
    if (error)
      result2.reject(error);
    const match = message.match(/DevTools listening on (.*)/);
    if (match)
      result2.resolve({ wsEndpoint: match[1] });
  });
  return result2;
}
async function urlToWSEndpoint(progress2, endpointURL, headers) {
  if (endpointURL.startsWith("ws"))
    return endpointURL;
  progress2.log(`<ws preparing> retrieving websocket url from ${endpointURL}`);
  const url2 = new URL(endpointURL);
  if (!url2.pathname.endsWith("/"))
    url2.pathname += "/";
  url2.pathname += "json/version/";
  const httpURL = url2.toString();
  const json = await fetchData(
    progress2,
    {
      url: httpURL,
      headers
    },
    async (_, resp) => new Error(`Unexpected status ${resp.statusCode} when connecting to ${httpURL}.
This does not look like a DevTools server, try connecting via ws://.`)
  );
  return JSON.parse(json).webSocketDebuggerUrl;
}
async function resolveChannelEndpoint(progress2, channel) {
  const userDataDir = defaultUserDataDirForChannel(channel);
  if (!userDataDir)
    throw new Error(`Connecting to ${channel} by channel name is not supported on ${process.platform}.`);
  const devToolsActivePortPath = import_path25.default.join(userDataDir, "DevToolsActivePort");
  progress2.log(`<ws preparing> reading ${devToolsActivePortPath}`);
  const contents = await progress2.race(import_fs27.default.promises.readFile(devToolsActivePortPath, "utf-8").catch(() => void 0));
  if (!contents) {
    throw new Error(
      `Could not connect to ${channel}: DevToolsActivePort file not found at ${devToolsActivePortPath}.
` + remoteDebuggingHint(channel)
    );
  }
  const port = parseInt(contents.trim(), 10);
  if (isNaN(port))
    throw new Error(`Could not connect to ${channel}: invalid DevToolsActivePort file at ${devToolsActivePortPath}.`);
  const endpoint = `ws://localhost:${port}/devtools/browser`;
  progress2.log(`<ws preparing> resolved channel "${channel}" to ${endpoint}`);
  return endpoint;
}
async function seleniumErrorHandler(params2, response2) {
  const body = await streamToString(response2);
  let message = body;
  try {
    const json = JSON.parse(body);
    message = json.value.localizedMessage || json.value.message;
  } catch (e) {
  }
  return new Error(`Error connecting to Selenium at ${params2.url}: ${message}`);
}
function addProtocol(url2) {
  if (!["ws://", "wss://", "http://", "https://"].some((protocol) => url2.startsWith(protocol)))
    return "http://" + url2;
  return url2;
}
function streamToString(stream3) {
  return new Promise((resolve, reject) => {
    const chunks = [];
    stream3.on("data", (chunk) => chunks.push(Buffer.from(chunk)));
    stream3.on("error", reject);
    stream3.on("end", () => resolve(Buffer.concat(chunks).toString("utf8")));
  });
}
function parseSeleniumRemoteParams(env, progress2) {
  try {
    const parsed = JSON.parse(env.value);
    progress2.log(`<selenium> using additional ${env.name} "${env.value}"`);
    return parsed;
  } catch (e) {
    progress2.log(`<selenium> ignoring additional ${env.name} "${env.value}": ${e}`);
  }
}
function remoteDebuggingHint(channel) {
  return `Make sure ${channel} is running with remote debugging enabled. Navigate to

        chrome://inspect/#remote-debugging

and check "Allow remote debugging for this browser instance".
`;
}
var import_fs27, import_os11, import_path25, ARTIFACTS_FOLDER2, Chromium;
var init_chromium = __esm({
  "packages/playwright-core/src/server/chromium/chromium.ts"() {
    "use strict";
    import_fs27 = __toESM(require("fs"));
    import_os11 = __toESM(require("os"));
    import_path25 = __toESM(require("path"));
    init_manualPromise();
    init_ascii();
    init_chromiumChannels();
    init_debugLogger();
    init_fileUtils();
    init_processLauncher();
    init_debug();
    init_headers();
    init_utils2();
    init_userAgent();
    init_chromiumSwitches();
    init_crBrowser();
    init_crConnection();
    init_browserContext();
    init_browserType();
    init_helper();
    init_registry();
    init_transport();
    init_crDevTools();
    init_browser();
    init_page();
    init_crExecutionContext();
    init_console();
    init_crProtocolHelper();
    ARTIFACTS_FOLDER2 = import_path25.default.join(import_os11.default.tmpdir(), "playwright-artifacts-");
    Chromium = class extends BrowserType {
      constructor(parent, bidiChromium) {
        super(parent, "chromium");
        this._bidiChromium = bidiChromium;
        if (debugMode() === "inspector")
          this._devtools = this._createDevTools();
      }
      launch(progress2, options, protocolLogger) {
        if (options.channel?.startsWith("bidi-"))
          return this._bidiChromium.launch(progress2, options, protocolLogger);
        return super.launch(progress2, options, protocolLogger);
      }
      async launchPersistentContext(progress2, userDataDir, options) {
        if (options.channel?.startsWith("bidi-"))
          return this._bidiChromium.launchPersistentContext(progress2, userDataDir, options);
        return super.launchPersistentContext(progress2, userDataDir, options);
      }
      async connectOverCDP(progress2, params2) {
        if (params2.transport)
          return this._connectOverCDPImpl(progress2, params2.transport, async () => params2.transport.close(), { ...params2, isLocal: true });
        return await this._connectOverCDPInternal(progress2, params2.endpointURL, params2);
      }
      async _connectOverCDPInternal(progress2, endpointURL, options, onClose) {
        let headersMap;
        if (options.headers)
          headersMap = headersArrayToObject(options.headers, false);
        if (!headersMap)
          headersMap = { "User-Agent": getUserAgent() };
        else if (headersMap && !Object.keys(headersMap).some((key) => key.toLowerCase() === "user-agent"))
          headersMap["User-Agent"] = getUserAgent();
        const channel = isChromiumChannelName(endpointURL) ? endpointURL : void 0;
        if (channel)
          endpointURL = await resolveChannelEndpoint(progress2, endpointURL);
        let wsEndpoint;
        let chromeTransport;
        try {
          wsEndpoint = await urlToWSEndpoint(progress2, endpointURL, headersMap);
          chromeTransport = await WebSocketTransport.connect(progress2, wsEndpoint, { headers: headersMap, followRedirects: true, debugLogHeader: "x-playwright-debug-log" });
        } catch (e) {
          if (channel)
            throw new Error(`Could not connect to ${channel}.
${remoteDebuggingHint(channel)}`);
          throw e;
        }
        const closeAndWait = async () => await chromeTransport.closeAndWait();
        return this._connectOverCDPImpl(progress2, chromeTransport, closeAndWait, options, onClose);
      }
      async _connectOverCDPImpl(progress2, transport, closeAndWait, options, onClose) {
        let artifactsDir;
        const tempDirectories = [];
        if (options.artifactsDir) {
          artifactsDir = options.artifactsDir;
        } else {
          artifactsDir = await progress2.race(import_fs27.default.promises.mkdtemp(ARTIFACTS_FOLDER2));
          tempDirectories.push(artifactsDir);
        }
        const doCleanup = async () => {
          await removeFolders(tempDirectories);
          const cb = onClose;
          onClose = void 0;
          await cb?.();
        };
        const doClose = async () => {
          await closeAndWait();
          await doCleanup();
        };
        try {
          const browserProcess = { close: doClose, kill: doClose };
          const persistent = {
            noDefaultViewport: true,
            ...options.noDefaults ? { acceptDownloads: "internal-browser-default" } : {}
          };
          const browserOptions = {
            slowMo: options.slowMo,
            name: "chromium",
            browserType: "chromium",
            persistent,
            browserProcess,
            protocolLogger: helper.debugProtocolLogger(),
            browserLogsCollector: new RecentLogsCollector(),
            artifactsDir,
            downloadsPath: options.downloadsPath || artifactsDir,
            tracesDir: options.tracesDir || artifactsDir,
            originalLaunchOptions: {},
            noDefaults: options.noDefaults
          };
          validateBrowserContextOptions(persistent, browserOptions);
          const browser = await progress2.race(CRBrowser.connect(this.attribution.playwright, transport, browserOptions));
          if (!options.isLocal)
            browser._isBrowserCollocatedWithServer = false;
          browser.on(Browser.Events.Disconnected, doCleanup);
          return browser;
        } catch (error) {
          await progress2.race(doClose().catch(() => {
          }));
          throw error;
        }
      }
      async connectToWorker(progress2, endpoint) {
        const wsEndpoint = await urlToWSEndpoint(progress2, endpoint, {});
        const transport = await WebSocketTransport.connect(progress2, wsEndpoint);
        try {
          const connection = new CRConnection(this, transport, helper.debugProtocolLogger(), new RecentLogsCollector());
          const session2 = connection.rootSession;
          const worker = new Worker(this, "", () => transport.closeAndWait());
          session2.on("Runtime.executionContextCreated", (event) => {
            const isDefault = event.context.auxData?.isDefault;
            if (isDefault === false) {
              return;
            }
            worker.workerScriptLoaded();
            worker.createExecutionContext(new CRExecutionContext(session2, event.context));
          });
          session2.on("Runtime.executionContextDestroyed", () => worker.destroyExecutionContext("Execution context was destroyed"));
          session2.on("Runtime.consoleAPICalled", (event) => {
            if (!worker.existingExecutionContext)
              return;
            const args = event.args.map((o) => createHandle(worker.existingExecutionContext, o));
            const message = new ConsoleMessage(null, worker, event.type, void 0, args, stackTraceToLocation(event.stackTrace), event.timestamp);
            worker.emit(Worker.Events.Console, message);
          });
          connection.on(ConnectionEvents.Disconnected, () => worker.didClose());
          session2._sendMayFail("Runtime.enable");
          session2._sendMayFail("Runtime.runIfWaitingForDebugger");
          return worker;
        } catch (error) {
          await progress2.race(transport.closeAndWait().catch(() => {
          }));
          throw error;
        }
      }
      _createDevTools() {
        const directory = registry.findExecutable("chromium").directory;
        return directory ? new CRDevTools(import_path25.default.join(directory, "devtools-preferences.json")) : void 0;
      }
      async connectToTransport(transport, options, browserLogsCollector) {
        try {
          return await CRBrowser.connect(this.attribution.playwright, transport, options, this._devtools);
        } catch (e) {
          const error = profileInUseError(browserLogsCollector.recentLogs());
          if (error)
            throw error;
          throw e;
        }
      }
      doRewriteStartupLog(logs) {
        if (logs.includes("Missing X server"))
          logs = "\n" + wrapInASCIIBox(kNoXServerRunningError, 1);
        if (!logs.includes("crbug.com/357670") && !logs.includes("No usable sandbox!") && !logs.includes("crbug.com/638180"))
          return logs;
        return [
          `Chromium sandboxing failed!`,
          `================================`,
          `To avoid the sandboxing issue, do either of the following:`,
          `  - (preferred): Configure your environment to support sandboxing`,
          `  - (alternative): Launch Chromium without sandbox using 'chromiumSandbox: false' option`,
          `================================`,
          ``
        ].join("\n");
      }
      amendEnvironment(env) {
        return env;
      }
      attemptToGracefullyCloseBrowser(transport) {
        const message = { method: "Browser.close", id: kBrowserCloseMessageId, params: {} };
        transport.send(message);
      }
      async launchWithSeleniumHub(progress2, hubUrl, options) {
        if (!hubUrl.endsWith("/"))
          hubUrl = hubUrl + "/";
        const args = this._innerDefaultArgs(options);
        args.push("--remote-debugging-port=0");
        const isEdge = options.channel && options.channel.startsWith("msedge");
        let desiredCapabilities = {
          "browserName": isEdge ? "MicrosoftEdge" : "chrome",
          [isEdge ? "ms:edgeOptions" : "goog:chromeOptions"]: { args }
        };
        if (process.env.SELENIUM_REMOTE_CAPABILITIES) {
          const remoteCapabilities = parseSeleniumRemoteParams({ name: "capabilities", value: process.env.SELENIUM_REMOTE_CAPABILITIES }, progress2);
          if (remoteCapabilities)
            desiredCapabilities = { ...desiredCapabilities, ...remoteCapabilities };
        }
        let headers = {};
        if (process.env.SELENIUM_REMOTE_HEADERS) {
          const remoteHeaders = parseSeleniumRemoteParams({ name: "headers", value: process.env.SELENIUM_REMOTE_HEADERS }, progress2);
          if (remoteHeaders)
            headers = remoteHeaders;
        }
        progress2.log(`<selenium> connecting to ${hubUrl}`);
        const response2 = await fetchData(progress2, {
          url: hubUrl + "session",
          method: "POST",
          headers: {
            "Content-Type": "application/json; charset=utf-8",
            ...headers
          },
          data: JSON.stringify({
            capabilities: { alwaysMatch: desiredCapabilities }
          })
        }, seleniumErrorHandler);
        const value2 = JSON.parse(response2).value;
        const sessionId = value2.sessionId;
        progress2.log(`<selenium> connected to sessionId=${sessionId}`);
        const disconnectFromSelenium = async () => {
          progress2.log(`<selenium> disconnecting from sessionId=${sessionId}`);
          await fetchData(void 0, {
            url: hubUrl + "session/" + sessionId,
            method: "DELETE",
            headers
          }).catch((error) => progress2.log(`<error disconnecting from selenium>: ${error}`));
          progress2.log(`<selenium> disconnected from sessionId=${sessionId}`);
          gracefullyCloseSet.delete(disconnectFromSelenium);
        };
        gracefullyCloseSet.add(disconnectFromSelenium);
        try {
          const capabilities = value2.capabilities;
          let endpointURL;
          if (capabilities["se:cdp"]) {
            progress2.log(`<selenium> using selenium v4`);
            const endpointURLString = addProtocol(capabilities["se:cdp"]);
            endpointURL = new URL(endpointURLString);
            if (endpointURL.hostname === "localhost" || endpointURL.hostname === "127.0.0.1")
              endpointURL.hostname = new URL(hubUrl).hostname;
            progress2.log(`<selenium> retrieved endpoint ${endpointURL.toString()} for sessionId=${sessionId}`);
          } else {
            progress2.log(`<selenium> using selenium v3`);
            const maybeChromeOptions = capabilities["goog:chromeOptions"];
            const chromeOptions = maybeChromeOptions && typeof maybeChromeOptions === "object" ? maybeChromeOptions : void 0;
            const debuggerAddress = chromeOptions && typeof chromeOptions.debuggerAddress === "string" ? chromeOptions.debuggerAddress : void 0;
            const chromeOptionsURL = typeof maybeChromeOptions === "string" ? maybeChromeOptions : void 0;
            const endpointURLString = addProtocol(debuggerAddress || chromeOptionsURL).replace("localhost", "127.0.0.1");
            progress2.log(`<selenium> retrieved endpoint ${endpointURLString} for sessionId=${sessionId}`);
            endpointURL = new URL(endpointURLString);
            if (endpointURL.hostname === "localhost" || endpointURL.hostname === "127.0.0.1") {
              const sessionInfoUrl = new URL(hubUrl).origin + "/grid/api/testsession?session=" + sessionId;
              try {
                const sessionResponse = await fetchData(progress2, {
                  url: sessionInfoUrl,
                  method: "GET",
                  headers
                }, seleniumErrorHandler);
                const proxyId = JSON.parse(sessionResponse).proxyId;
                endpointURL.hostname = new URL(proxyId).hostname;
                progress2.log(`<selenium> resolved endpoint ip ${endpointURL.toString()} for sessionId=${sessionId}`);
              } catch (e) {
                progress2.log(`<selenium> unable to resolve endpoint ip for sessionId=${sessionId}, running in standalone?`);
              }
            }
          }
          return await this._connectOverCDPInternal(progress2, endpointURL.toString(), {
            ...options,
            headers: headersObjectToArray(headers)
          }, disconnectFromSelenium);
        } catch (e) {
          await progress2.race(disconnectFromSelenium());
          throw e;
        }
      }
      async defaultArgs(options, isPersistent, userDataDir) {
        const chromeArguments = this._innerDefaultArgs(options);
        chromeArguments.push(`--user-data-dir=${userDataDir}`);
        chromeArguments.push("--remote-debugging-pipe");
        if (isPersistent)
          chromeArguments.push("about:blank");
        else
          chromeArguments.push("--no-startup-window");
        return chromeArguments;
      }
      _innerDefaultArgs(options) {
        const { args = [] } = options;
        const userDataDirArg = args.find((arg) => arg.startsWith("--user-data-dir"));
        if (userDataDirArg)
          throw this._createUserDataDirArgMisuseError("--user-data-dir");
        if (args.find((arg) => arg.startsWith("--remote-debugging-pipe")))
          throw new Error("Playwright manages remote debugging connection itself.");
        if (args.find((arg) => !arg.startsWith("-")))
          throw new Error("Arguments can not specify page to be opened");
        const chromeArguments = [...chromiumSwitches()];
        chromeArguments.push("--enable-unsafe-swiftshader");
        if (options.headless) {
          chromeArguments.push("--headless");
          chromeArguments.push(
            "--hide-scrollbars",
            "--mute-audio",
            "--blink-settings=primaryHoverType=2,availableHoverTypes=2,primaryPointerType=4,availablePointerTypes=4"
          );
        }
        if (options.chromiumSandbox !== true)
          chromeArguments.push("--no-sandbox");
        const proxy = options.proxyOverride || options.proxy;
        if (proxy) {
          const proxyURL = new URL(proxy.server);
          const isSocks = proxyURL.protocol === "socks5:";
          if (isSocks && !options.socksProxyPort) {
            chromeArguments.push(`--host-resolver-rules="MAP * ~NOTFOUND , EXCLUDE ${proxyURL.hostname}"`);
          }
          chromeArguments.push(`--proxy-server=${proxy.server}`);
          const proxyBypassRules = [];
          if (proxy.bypass)
            proxyBypassRules.push(...proxy.bypass.split(",").map((t) => t.trim()).map((t) => t.startsWith(".") ? "*" + t : t));
          if (options.socksProxyPort || shouldProxyLoopback(proxy.bypass))
            proxyBypassRules.push("<-loopback>");
          if (proxyBypassRules.length > 0)
            chromeArguments.push(`--proxy-bypass-list=${proxyBypassRules.join(";")}`);
        }
        chromeArguments.push(...args);
        return chromeArguments;
      }
      async waitForReadyState(options, browserLogsCollector) {
        return waitForReadyState(options, browserLogsCollector);
      }
      getExecutableName(options) {
        if (options.channel && registry.isChromiumAlias(options.channel))
          return "chromium";
        if (options.channel === "chromium-tip-of-tree")
          return options.headless ? "chromium-tip-of-tree-headless-shell" : "chromium-tip-of-tree";
        if (options.channel)
          return options.channel;
        return options.headless ? "chromium-headless-shell" : "chromium";
      }
    };
  }
});

// packages/playwright-core/src/server/bidi/bidiOverCdp.ts
var bidiOverCdp_exports = {};
__export(bidiOverCdp_exports, {
  connectBidiOverCdp: () => connectBidiOverCdp
});
async function connectBidiOverCdp(cdp) {
  let server = void 0;
  const bidiTransport = new BidiTransportImpl();
  const bidiConnection = new BidiConnection2(bidiTransport, () => server?.close());
  const cdpTransportImpl = new CdpTransportImpl(cdp);
  const cdpConnection = new bidiCdpConnection.MapperCdpConnection(cdpTransportImpl, bidiServerLogger);
  cdp.onclose = () => bidiConnection.onclose?.();
  server = await bidiMapper.BidiServer.createAndStart(
    bidiTransport,
    cdpConnection,
    await cdpConnection.createBrowserSession(),
    /* selfTargetId= */
    "",
    void 0,
    bidiServerLogger
  );
  return bidiConnection;
}
var bidiMapper, bidiCdpConnection, bidiServerLogger, BidiTransportImpl, BidiConnection2, CdpTransportImpl;
var init_bidiOverCdp = __esm({
  "packages/playwright-core/src/server/bidi/bidiOverCdp.ts"() {
    "use strict";
    bidiMapper = __toESM(require("chromium-bidi/lib/cjs/bidiMapper/BidiMapper"));
    bidiCdpConnection = __toESM(require("chromium-bidi/lib/cjs/cdp/CdpConnection"));
    init_debugLogger();
    bidiServerLogger = (prefix, ...args) => {
      debugLogger.log(prefix, args);
    };
    BidiTransportImpl = class {
      setOnMessage(handler) {
        this._handler = handler;
      }
      sendMessage(message) {
        return this._bidiConnection.onmessage?.(message);
      }
      close() {
        this._bidiConnection.onclose?.();
      }
    };
    BidiConnection2 = class {
      constructor(bidiTransport, closeCallback) {
        this._bidiTransport = bidiTransport;
        this._bidiTransport._bidiConnection = this;
        this._closeCallback = closeCallback;
      }
      send(s) {
        this._bidiTransport._handler?.(s);
      }
      close() {
        this._closeCallback();
      }
    };
    CdpTransportImpl = class {
      constructor(connection) {
        this._connection = connection;
        this._connection.onmessage = (message) => {
          this._handler?.(JSON.stringify(message));
        };
      }
      setOnMessage(handler) {
        this._handler = handler;
      }
      sendMessage(message) {
        return this._connection.send(JSON.parse(message));
      }
      close() {
        this._connection.close();
      }
    };
  }
});

// packages/playwright-core/src/server/bidi/bidiChromium.ts
var import_os12, BidiChromium, kBidiOverCdpWrapper;
var init_bidiChromium = __esm({
  "packages/playwright-core/src/server/bidi/bidiChromium.ts"() {
    "use strict";
    import_os12 = __toESM(require("os"));
    init_ascii();
    init_browserType();
    init_bidiBrowser();
    init_bidiConnection();
    init_chromiumSwitches();
    init_chromium();
    init_crBrowser();
    BidiChromium = class extends BrowserType {
      constructor(parent) {
        super(parent, "chromium");
      }
      async connectToTransport(transport, options, browserLogsCollector) {
        const bidiOverCdp = (init_bidiOverCdp(), __toCommonJS(bidiOverCdp_exports));
        const bidiTransport = await bidiOverCdp.connectBidiOverCdp(transport);
        transport[kBidiOverCdpWrapper] = bidiTransport;
        try {
          return BidiBrowser.connect(this.attribution.playwright, bidiTransport, options);
        } catch (e) {
          const error = profileInUseError(browserLogsCollector.recentLogs());
          if (error)
            throw error;
          throw e;
        }
      }
      doRewriteStartupLog(logs) {
        if (logs.includes("Missing X server"))
          logs = "\n" + wrapInASCIIBox(kNoXServerRunningError, 1);
        if (!logs.includes("crbug.com/357670") && !logs.includes("No usable sandbox!") && !logs.includes("crbug.com/638180"))
          return logs;
        return [
          `Chromium sandboxing failed!`,
          `================================`,
          `To avoid the sandboxing issue, do either of the following:`,
          `  - (preferred): Configure your environment to support sandboxing`,
          `  - (alternative): Launch Chromium without sandbox using 'chromiumSandbox: false' option`,
          `================================`,
          ``
        ].join("\n");
      }
      amendEnvironment(env) {
        return env;
      }
      attemptToGracefullyCloseBrowser(transport) {
        const bidiTransport = transport[kBidiOverCdpWrapper];
        if (bidiTransport)
          transport = bidiTransport;
        transport.send({ method: "browser.close", params: {}, id: kBrowserCloseMessageId2 });
      }
      supportsPipeTransport() {
        return false;
      }
      async defaultArgs(options, isPersistent, userDataDir) {
        const chromeArguments = this._innerDefaultArgs(options);
        chromeArguments.push(`--user-data-dir=${userDataDir}`);
        chromeArguments.push("--remote-debugging-port=0");
        if (isPersistent)
          chromeArguments.push("about:blank");
        else
          chromeArguments.push("--no-startup-window");
        return chromeArguments;
      }
      async waitForReadyState(options, browserLogsCollector) {
        return waitForReadyState({ ...options, args: ["--remote-debugging-port=0"] }, browserLogsCollector);
      }
      _innerDefaultArgs(options) {
        const { args = [] } = options;
        const userDataDirArg = args.find((arg) => arg.startsWith("--user-data-dir"));
        if (userDataDirArg)
          throw this._createUserDataDirArgMisuseError("--user-data-dir");
        if (args.find((arg) => arg.startsWith("--remote-debugging-pipe")))
          throw new Error("Playwright manages remote debugging connection itself.");
        if (args.find((arg) => !arg.startsWith("-")))
          throw new Error("Arguments can not specify page to be opened");
        const chromeArguments = [...chromiumSwitches()];
        if (import_os12.default.platform() === "darwin") {
          chromeArguments.push("--enable-unsafe-swiftshader");
        }
        if (options.headless) {
          chromeArguments.push("--headless");
          chromeArguments.push(
            "--hide-scrollbars",
            "--mute-audio",
            "--blink-settings=primaryHoverType=2,availableHoverTypes=2,primaryPointerType=4,availablePointerTypes=4"
          );
        }
        if (options.chromiumSandbox !== true)
          chromeArguments.push("--no-sandbox");
        const proxy = options.proxyOverride || options.proxy;
        if (proxy) {
          const proxyURL = new URL(proxy.server);
          const isSocks = proxyURL.protocol === "socks5:";
          if (isSocks && !options.socksProxyPort) {
            chromeArguments.push(`--host-resolver-rules="MAP * ~NOTFOUND , EXCLUDE ${proxyURL.hostname}"`);
          }
          chromeArguments.push(`--proxy-server=${proxy.server}`);
          const proxyBypassRules = [];
          if (proxy.bypass)
            proxyBypassRules.push(...proxy.bypass.split(",").map((t) => t.trim()).map((t) => t.startsWith(".") ? "*" + t : t));
          if (options.socksProxyPort || shouldProxyLoopback(proxy.bypass))
            proxyBypassRules.push("<-loopback>");
          if (proxyBypassRules.length > 0)
            chromeArguments.push(`--proxy-bypass-list=${proxyBypassRules.join(";")}`);
        }
        chromeArguments.push(...args);
        return chromeArguments;
      }
      getExecutableName(options) {
        switch (options.channel) {
          case "bidi-chromium":
            return "chromium";
          case "bidi-chrome":
            return "chrome";
          case "bidi-chrome-beta":
            return "chrome-beta";
          case "bidi-chrome-dev":
            return "chrome-dev";
          case "bidi-chrome-canary":
            return "chrome-canary";
        }
        throw new Error(`Unsupported Bidi Chromium channel: ${options.channel}`);
      }
    };
    kBidiOverCdpWrapper = Symbol("kBidiConnectionWrapper");
  }
});

// packages/playwright-core/src/server/bidi/third_party/firefoxPrefs.ts
async function createProfile(options) {
  if (!import_fs28.default.existsSync(options.path)) {
    await import_fs28.default.promises.mkdir(options.path, {
      recursive: true
    });
  }
  await writePreferences({
    preferences: {
      ...defaultProfilePreferences(options.preferences),
      ...options.preferences
    },
    path: options.path
  });
}
function defaultProfilePreferences(extraPrefs) {
  const server = "dummy.test";
  const defaultPrefs = {
    // Make sure Shield doesn't hit the network.
    "app.normandy.api_url": "",
    // Disable Firefox old build background check
    "app.update.checkInstallTime": false,
    // Disable automatically upgrading Firefox
    "app.update.disabledForTesting": true,
    // Increase the APZ content response timeout to 1 minute
    "apz.content_response_timeout": 6e4,
    // Prevent various error message on the console
    // jest-puppeteer asserts that no error message is emitted by the console
    "browser.contentblocking.features.standard": "-tp,tpPrivate,cookieBehavior0,-cm,-fp",
    // Enable the dump function: which sends messages to the system
    // console
    // https://bugzilla.mozilla.org/show_bug.cgi?id=1543115
    "browser.dom.window.dump.enabled": true,
    // Make sure newtab weather doesn't hit the network to retrieve weather data.
    "browser.newtabpage.activity-stream.discoverystream.region-weather-config": "",
    // Make sure newtab wallpapers don't hit the network to retrieve wallpaper data.
    "browser.newtabpage.activity-stream.newtabWallpapers.enabled": false,
    "browser.newtabpage.activity-stream.newtabWallpapers.v2.enabled": false,
    // Make sure Topsites doesn't hit the network to retrieve sponsored tiles.
    "browser.newtabpage.activity-stream.showSponsoredTopSites": false,
    // Disable topstories
    "browser.newtabpage.activity-stream.feeds.system.topstories": false,
    // Always display a blank page
    "browser.newtabpage.enabled": false,
    // Background thumbnails in particular cause grief: and disabling
    // thumbnails in general cannot hurt
    "browser.pagethumbnails.capturing_disabled": true,
    // Disable safebrowsing components.
    "browser.safebrowsing.blockedURIs.enabled": false,
    "browser.safebrowsing.downloads.enabled": false,
    "browser.safebrowsing.malware.enabled": false,
    "browser.safebrowsing.phishing.enabled": false,
    // Disable updates to search engines.
    "browser.search.update": false,
    // Do not restore the last open set of tabs if the browser has crashed
    "browser.sessionstore.resume_from_crash": false,
    // Skip check for default browser on startup
    "browser.shell.checkDefaultBrowser": false,
    // Disable newtabpage
    "browser.startup.homepage": "about:blank",
    // Do not redirect user when a milstone upgrade of Firefox is detected
    "browser.startup.homepage_override.mstone": "ignore",
    // Start with a blank page about:blank
    "browser.startup.page": 0,
    // Do not allow background tabs to be zombified on Android: otherwise for
    // tests that open additional tabs: the test harness tab itself might get
    // unloaded
    "browser.tabs.disableBackgroundZombification": false,
    // Do not warn when closing all other open tabs
    "browser.tabs.warnOnCloseOtherTabs": false,
    // Do not warn when multiple tabs will be opened
    "browser.tabs.warnOnOpen": false,
    // Do not automatically offer translations, as tests do not expect this.
    "browser.translations.automaticallyPopup": false,
    // Disable the UI tour.
    "browser.uitour.enabled": false,
    // Turn off search suggestions in the location bar so as not to trigger
    // network connections.
    "browser.urlbar.suggest.searches": false,
    // Disable first run splash page on Windows 10
    "browser.usedOnWindows10.introURL": "",
    // Do not warn on quitting Firefox
    "browser.warnOnQuit": false,
    // Defensively disable data reporting systems
    "datareporting.healthreport.documentServerURI": `http://${server}/dummy/healthreport/`,
    "datareporting.healthreport.logging.consoleEnabled": false,
    "datareporting.healthreport.service.enabled": false,
    "datareporting.healthreport.service.firstRun": false,
    "datareporting.healthreport.uploadEnabled": false,
    "datareporting.usage.uploadEnabled": false,
    "telemetry.fog.test.localhost_port": -1,
    // Do not show datareporting policy notifications which can interfere with tests
    "datareporting.policy.dataSubmissionEnabled": false,
    "datareporting.policy.dataSubmissionPolicyBypassNotification": true,
    // DevTools JSONViewer sometimes fails to load dependencies with its require.js.
    // This doesn't affect Puppeteer but spams console (Bug 1424372)
    "devtools.jsonview.enabled": false,
    // Disable popup-blocker
    "dom.disable_open_during_load": false,
    // Enable the support for File object creation in the content process
    // Required for |Page.setFileInputFiles| protocol method.
    "dom.file.createInChild": true,
    // Disable the ProcessHangMonitor
    "dom.ipc.reportProcessHangs": false,
    // Disable slow script dialogues
    "dom.max_chrome_script_run_time": 0,
    "dom.max_script_run_time": 0,
    // Disable background timer throttling to allow tests to run in parallel
    // without a decrease in performance.
    "dom.min_background_timeout_value": 0,
    "dom.min_background_timeout_value_without_budget_throttling": 0,
    "dom.timeout.enable_budget_timer_throttling": false,
    // Disable HTTPS-First upgrades
    "dom.security.https_first": false,
    // Only load extensions from the application and user profile
    // AddonManager.SCOPE_PROFILE + AddonManager.SCOPE_APPLICATION
    "extensions.autoDisableScopes": 0,
    "extensions.enabledScopes": 5,
    // Disable metadata caching for installed add-ons by default
    "extensions.getAddons.cache.enabled": false,
    // Disable installing any distribution extensions or add-ons.
    "extensions.installDistroAddons": false,
    // Disabled screenshots extension
    "extensions.screenshots.disabled": true,
    // Turn off extension updates so they do not bother tests
    "extensions.update.enabled": false,
    // Turn off extension updates so they do not bother tests
    "extensions.update.notifyUser": false,
    // Make sure opening about:addons will not hit the network
    "extensions.webservice.discoverURL": `http://${server}/dummy/discoveryURL`,
    // Allow the application to have focus even it runs in the background
    "focusmanager.testmode": true,
    // Disable useragent updates
    "general.useragent.updates.enabled": false,
    // Always use network provider for geolocation tests so we bypass the
    // macOS dialog raised by the corelocation provider
    "geo.provider.testing": true,
    // Do not scan Wifi
    "geo.wifi.scan": false,
    // No hang monitor
    "hangmonitor.timeout": 0,
    // Show chrome errors and warnings in the error console
    "javascript.options.showInConsole": true,
    // Do not throttle rendering (requestAnimationFrame) in background tabs
    "layout.testing.top-level-always-active": true,
    // Disable download and usage of OpenH264: and Widevine plugins
    "media.gmp-manager.updateEnabled": false,
    // Disable the GFX sanity window
    "media.sanity-test.disabled": true,
    // Disable connectivity service pings
    "network.connectivity-service.enabled": false,
    // Disable experimental feature that is only available in Nightly
    "network.cookie.sameSite.laxByDefault": false,
    // Do not prompt for temporary redirects
    "network.http.prompt-temp-redirect": false,
    // Disable speculative connections so they are not reported as leaking
    // when they are hanging around
    "network.http.speculative-parallel-limit": 0,
    // Do not automatically switch between offline and online
    "network.manage-offline-status": false,
    // Make sure SNTP requests do not hit the network
    "network.sntp.pools": server,
    // Disable Flash.
    "plugin.state.flash": 0,
    "privacy.trackingprotection.enabled": false,
    // Can be removed once Firefox 89 is no longer supported
    // https://bugzilla.mozilla.org/show_bug.cgi?id=1710839
    "remote.enabled": true,
    // Don't do network connections for mitm priming
    "security.certerrors.mitm.priming.enabled": false,
    // Local documents have access to all other local documents,
    // including directory listings
    "security.fileuri.strict_origin_policy": false,
    // Do not wait for the notification button security delay
    "security.notification_enable_delay": 0,
    // Do not automatically fill sign-in forms with known usernames and
    // passwords
    "signon.autofillForms": false,
    // Disable password capture, so that tests that include forms are not
    // influenced by the presence of the persistent doorhanger notification
    "signon.rememberSignons": false,
    // Disable first-run welcome page
    "startup.homepage_welcome_url": "about:blank",
    // Disable first-run welcome page
    "startup.homepage_welcome_url.additional": "",
    // Disable browser animations (tabs, fullscreen, sliding alerts)
    "toolkit.cosmeticAnimations.enabled": false,
    // Prevent starting into safe mode after application crashes
    "toolkit.startup.max_resumed_crashes": -1,
    // Enable TestUtils
    "dom.testing.testutils.enabled": true
  };
  return Object.assign(defaultPrefs, extraPrefs);
}
async function writePreferences(options) {
  const prefsPath = import_path26.default.join(options.path, "prefs.js");
  const lines = Object.entries(options.preferences).map(([key, value2]) => {
    return `user_pref(${JSON.stringify(key)}, ${JSON.stringify(value2)});`;
  });
  const result2 = await Promise.allSettled([
    import_fs28.default.promises.writeFile(import_path26.default.join(options.path, "user.js"), lines.join("\n")),
    // Create a backup of the preferences file if it already exitsts.
    import_fs28.default.promises.access(prefsPath, import_fs28.default.constants.F_OK).then(
      async () => {
        await import_fs28.default.promises.copyFile(
          prefsPath,
          import_path26.default.join(options.path, "prefs.js.playwright")
        );
      },
      // Swallow only if file does not exist
      () => {
      }
    )
  ]);
  for (const command of result2) {
    if (command.status === "rejected") {
      throw command.reason;
    }
  }
}
var import_fs28, import_path26;
var init_firefoxPrefs = __esm({
  "packages/playwright-core/src/server/bidi/third_party/firefoxPrefs.ts"() {
    "use strict";
    import_fs28 = __toESM(require("fs"));
    import_path26 = __toESM(require("path"));
  }
});

// packages/playwright-core/src/server/bidi/bidiFirefox.ts
var import_os13, import_path27, BidiFirefox;
var init_bidiFirefox = __esm({
  "packages/playwright-core/src/server/bidi/bidiFirefox.ts"() {
    "use strict";
    import_os13 = __toESM(require("os"));
    import_path27 = __toESM(require("path"));
    init_manualPromise();
    init_ascii();
    init_browserType();
    init_bidiBrowser();
    init_bidiConnection();
    init_firefoxPrefs();
    BidiFirefox = class extends BrowserType {
      constructor(parent) {
        super(parent, "firefox");
      }
      executablePath() {
        return "";
      }
      async connectToTransport(transport, options) {
        return BidiBrowser.connect(this.attribution.playwright, transport, options);
      }
      doRewriteStartupLog(logs) {
        if (logs.includes(`as root in a regular user's session is not supported.`))
          logs = "\n" + wrapInASCIIBox(`Firefox is unable to launch if the $HOME folder isn't owned by the current user.
Workaround: Set the HOME=/root environment variable${process.env.GITHUB_ACTION ? " in your GitHub Actions workflow file" : ""} when running Playwright.`, 1);
        if (logs.includes("no DISPLAY environment variable specified"))
          logs = "\n" + wrapInASCIIBox(kNoXServerRunningError, 1);
        return logs;
      }
      amendEnvironment(env) {
        if (!import_path27.default.isAbsolute(import_os13.default.homedir()))
          throw new Error(`Cannot launch Firefox with relative home directory. Did you set ${import_os13.default.platform() === "win32" ? "USERPROFILE" : "HOME"} to a relative path?`);
        env = {
          ...env,
          "MOZ_CRASHREPORTER": "1",
          "MOZ_CRASHREPORTER_NO_REPORT": "1",
          "MOZ_CRASHREPORTER_SHUTDOWN": "1"
        };
        if (import_os13.default.platform() === "linux") {
          return { ...env, SNAP_NAME: void 0, SNAP_INSTANCE_NAME: void 0 };
        }
        return env;
      }
      attemptToGracefullyCloseBrowser(transport) {
        this._attemptToGracefullyCloseBrowser(transport).catch(() => {
        });
      }
      async _attemptToGracefullyCloseBrowser(transport) {
        if (!transport.onmessage) {
          transport.send({ method: "session.new", params: { capabilities: {} }, id: kShutdownSessionNewMessageId });
          await new Promise((resolve) => {
            transport.onmessage = (message) => {
              if (message.id === kShutdownSessionNewMessageId)
                resolve(true);
            };
          });
        }
        transport.send({ method: "browser.close", params: {}, id: kBrowserCloseMessageId2 });
      }
      supportsPipeTransport() {
        return false;
      }
      async prepareUserDataDir(options, userDataDir) {
        await createProfile({
          path: userDataDir,
          preferences: options.firefoxUserPrefs || {}
        });
      }
      async defaultArgs(options, isPersistent, userDataDir) {
        const { args = [], headless } = options;
        const userDataDirArg = args.find((arg) => arg.startsWith("-profile") || arg.startsWith("--profile"));
        if (userDataDirArg)
          throw this._createUserDataDirArgMisuseError("--profile");
        if (args.find((arg) => !arg.startsWith("-")))
          throw new Error("Arguments can not specify page to be opened");
        const firefoxArguments = ["--remote-debugging-port=0"];
        if (headless)
          firefoxArguments.push("--headless");
        else
          firefoxArguments.push("--foreground");
        firefoxArguments.push(`--profile`, userDataDir);
        firefoxArguments.push(...args);
        return firefoxArguments;
      }
      async waitForReadyState(options, browserLogsCollector) {
        const result2 = new ManualPromise();
        browserLogsCollector.onMessage((message) => {
          const match = message.match(/WebDriver BiDi listening on (ws:\/\/.*)$/);
          if (match)
            result2.resolve({ wsEndpoint: match[1] + "/session" });
        });
        return result2;
      }
    };
  }
});

// packages/playwright-core/src/server/debugController.ts
function wireListeners(recorder, debugController) {
  if (recorder[wiredSymbol])
    return;
  recorder[wiredSymbol] = true;
  const actions = [];
  const languageGenerator = new JavaScriptLanguageGenerator(
    /* isPlaywrightTest */
    true
  );
  const actionsChanged = () => {
    const aa = collapseActions(actions);
    const { header, footer, text: text2, actionTexts } = generateCode(aa, languageGenerator, {
      browserName: "chromium",
      launchOptions: {},
      contextOptions: {},
      generateAutoExpect: debugController._generateAutoExpect
    });
    debugController.emit(DebugController.Events.SourceChanged, { text: text2, header, footer, actions: actionTexts });
  };
  recorder.on(RecorderEvent.ElementPicked, (elementInfo) => {
    const locator2 = asLocator(debugController._sdkLanguage, elementInfo.selector);
    debugController.emit(DebugController.Events.InspectRequested, { selector: elementInfo.selector, locator: locator2, ariaSnapshot: elementInfo.ariaSnapshot });
  });
  recorder.on(RecorderEvent.PausedStateChanged, (paused) => {
    debugController.emit(DebugController.Events.Paused, { paused });
  });
  recorder.on(RecorderEvent.ModeChanged, (mode) => {
    debugController.emit(DebugController.Events.SetModeRequested, { mode });
  });
  recorder.on(RecorderEvent.ActionAdded, (action) => {
    actions.push(action);
    actionsChanged();
  });
  recorder.on(RecorderEvent.SignalAdded, (signal) => {
    const lastAction = actions.findLast((a) => a.frame.pageGuid === signal.frame.pageGuid);
    if (lastAction)
      lastAction.action.signals.push(signal.signal);
    actionsChanged();
  });
}
var yaml2, DebugController, wiredSymbol;
var init_debugController = __esm({
  "packages/playwright-core/src/server/debugController.ts"() {
    "use strict";
    init_ariaSnapshot();
    init_locatorParser();
    init_processLauncher();
    init_locatorGenerators();
    init_instrumentation();
    init_recorder();
    init_language();
    init_recorderUtils();
    init_javascript2();
    yaml2 = require("./utilsBundle").yaml;
    DebugController = class _DebugController extends SdkObject {
      constructor(playwright2) {
        super({ attribution: { isInternalPlaywright: true }, instrumentation: createInstrumentation() }, void 0, "DebugController");
        this._sdkLanguage = "javascript";
        this._generateAutoExpect = false;
        this._playwright = playwright2;
      }
      static {
        this.Events = {
          StateChanged: "stateChanged",
          InspectRequested: "inspectRequested",
          SourceChanged: "sourceChanged",
          Paused: "paused",
          SetModeRequested: "setModeRequested"
        };
      }
      initialize(progress2, codegenId2, sdkLanguage) {
        this._sdkLanguage = sdkLanguage;
      }
      dispose() {
        this._setReportStateChanged(false);
      }
      setReportStateChanged(progress2, enabled) {
        this._setReportStateChanged(enabled);
      }
      _setReportStateChanged(enabled) {
        if (enabled && !this._trackHierarchyListener) {
          this._trackHierarchyListener = {
            onPageOpen: () => this._emitSnapshot(false),
            onPageClose: () => this._emitSnapshot(false)
          };
          this._playwright.instrumentation.addListener(this._trackHierarchyListener, null);
          this._emitSnapshot(true);
        } else if (!enabled && this._trackHierarchyListener) {
          this._playwright.instrumentation.removeListener(this._trackHierarchyListener);
          this._trackHierarchyListener = void 0;
        }
      }
      async setRecorderMode(progress2, params2) {
        await this._closeBrowsersWithoutPages(progress2);
        this._generateAutoExpect = !!params2.generateAutoExpect;
        if (params2.mode === "none") {
          const promises = [];
          for (const recorder of await progress2.race(this._allRecorders())) {
            promises.push(recorder.hideHighlightedSelector());
            promises.push(recorder.setMode("none"));
          }
          await progress2.race(Promise.all(promises));
          return;
        }
        if (!this._playwright.allBrowsers().length)
          await this._playwright.chromium.launch(progress2, { headless: !!process.env.PW_DEBUG_CONTROLLER_HEADLESS });
        const pages = this._playwright.allPages();
        if (!pages.length) {
          const [browser] = this._playwright.allBrowsers();
          const context2 = await browser.newContextForReuse(progress2, {});
          await context2.newPage(progress2);
        }
        if (params2.testIdAttributeName) {
          for (const page of this._playwright.allPages())
            page.browserContext.selectors().setTestIdAttributeName(params2.testIdAttributeName);
        }
        for (const recorder of await progress2.race(this._allRecorders())) {
          recorder.hideHighlightedSelector();
          recorder.setMode(params2.mode);
        }
      }
      async highlight(progress2, params2) {
        if (params2.selector)
          unsafeLocatorOrSelectorAsSelector(this._sdkLanguage, params2.selector, "data-testid");
        const ariaTemplate = params2.ariaTemplate ? parseAriaSnapshotUnsafe(yaml2, params2.ariaTemplate) : void 0;
        const promises = [];
        for (const recorder of await progress2.race(this._allRecorders())) {
          if (ariaTemplate)
            promises.push(recorder.setHighlightedAriaTemplate(ariaTemplate));
          else if (params2.selector)
            promises.push(recorder.setHighlightedSelector(params2.selector));
        }
        await progress2.race(Promise.all(promises));
      }
      async hideHighlight(progress2) {
        const promises = [];
        for (const recorder of await progress2.race(this._allRecorders()))
          promises.push(recorder.hideHighlightedSelector());
        promises.push(...this._playwright.allPages().map((p) => p.hideHighlight().catch(() => {
        })));
        await progress2.race(Promise.all(promises));
      }
      async resume(progress2) {
        for (const recorder of await progress2.race(this._allRecorders()))
          recorder.resume();
      }
      kill(progress2) {
        gracefullyProcessExitDoNotHang(0);
      }
      _emitSnapshot(initial) {
        const pageCount = this._playwright.allPages().length;
        if (initial && !pageCount)
          return;
        this.emit(_DebugController.Events.StateChanged, { pageCount });
      }
      async _allRecorders() {
        const contexts = /* @__PURE__ */ new Set();
        for (const page of this._playwright.allPages())
          contexts.add(page.browserContext);
        const recorders = await Promise.all([...contexts].map((c) => Recorder.forContext(c, { omitCallTracking: true })));
        const nonNullRecorders = recorders.filter(Boolean);
        for (const recorder of recorders)
          wireListeners(recorder, this);
        return nonNullRecorders;
      }
      async _closeBrowsersWithoutPages(progress2) {
        for (const browser of this._playwright.allBrowsers()) {
          for (const context2 of browser.contexts()) {
            if (!context2.pages().length)
              await context2.close(progress2, { reason: "Browser collected" });
          }
          if (!browser.contexts())
            await browser.close(progress2, { reason: "Browser collected" });
        }
      }
    };
    wiredSymbol = Symbol("wired");
  }
});

// packages/playwright-core/src/server/electron/electron.ts
async function waitForLine(progress2, process2, regex) {
  const promise = new ManualPromise();
  const rl = readline2.createInterface({ input: process2.stderr });
  const failError = new Error("Process failed to launch!");
  const listeners = [
    eventsHelper.addEventListener(rl, "line", onLine),
    eventsHelper.addEventListener(rl, "close", () => promise.reject(failError)),
    eventsHelper.addEventListener(process2, "exit", () => promise.reject(failError)),
    // It is Ok to remove error handler because we did not create process and there is another listener.
    eventsHelper.addEventListener(process2, "error", () => promise.reject(failError))
  ];
  function onLine(line) {
    const match = line.match(regex);
    if (match)
      promise.resolve(match);
  }
  try {
    return await progress2.race(promise);
  } finally {
    eventsHelper.removeEventListeners(listeners);
  }
}
function escapeDoubleQuotes(str) {
  return str.replace(/"/g, '\\"');
}
var import_fs29, import_os14, import_path28, readline2, ARTIFACTS_FOLDER3, ElectronApplication, Electron;
var init_electron = __esm({
  "packages/playwright-core/src/server/electron/electron.ts"() {
    "use strict";
    import_fs29 = __toESM(require("fs"));
    import_os14 = __toESM(require("os"));
    import_path28 = __toESM(require("path"));
    readline2 = __toESM(require("readline"));
    init_ascii();
    init_debugLogger();
    init_eventsHelper();
    init_processLauncher();
    init_manualPromise();
    init_package();
    init_browserContext();
    init_crBrowser();
    init_crConnection();
    init_crExecutionContext();
    init_crProtocolHelper();
    init_console();
    init_helper();
    init_instrumentation();
    init_javascript();
    init_transport();
    init_progress();
    ARTIFACTS_FOLDER3 = import_path28.default.join(import_os14.default.tmpdir(), "playwright-artifacts-");
    ElectronApplication = class _ElectronApplication extends SdkObject {
      constructor(parent, browser, nodeConnection, process2) {
        super(parent, "electron-app");
        this._nodeElectronHandlePromise = new ManualPromise();
        this._process = process2;
        this._browserContext = browser._defaultContext;
        this._nodeConnection = nodeConnection;
        this._nodeSession = nodeConnection.rootSession;
        this._nodeSession.on("Runtime.executionContextCreated", async (event) => {
          if (!event.context.auxData || !event.context.auxData.isDefault)
            return;
          const crExecutionContext = new CRExecutionContext(this._nodeSession, event.context);
          this._nodeExecutionContext = new ExecutionContext(this, crExecutionContext, "electron");
          const { result: remoteObject } = await crExecutionContext._client.send("Runtime.evaluate", {
            expression: `require('electron')`,
            contextId: event.context.id,
            // Needed after Electron 28 to get access to require: https://github.com/microsoft/playwright/issues/28048
            includeCommandLineAPI: true
          });
          this._nodeElectronHandlePromise.resolve(new JSHandle(this._nodeExecutionContext, "object", "ElectronModule", remoteObject.objectId));
        });
        this._nodeSession.on("Runtime.consoleAPICalled", (event) => this._onConsoleAPI(event));
        const appClosePromise = new Promise((f) => this.once(_ElectronApplication.Events.Close, f));
        this._browserContext.setCustomCloseHandler(async () => {
          const electronHandle = await this._nodeElectronHandlePromise;
          await electronHandle.evaluate(({ app }) => app.quit()).catch(() => {
          });
          this._nodeConnection.close();
          await appClosePromise;
        });
      }
      static {
        this.Events = {
          Close: "close",
          Console: "console"
        };
      }
      async _onConsoleAPI(event) {
        if (event.executionContextId === 0) {
          return;
        }
        if (!this._nodeExecutionContext)
          return;
        const args = event.args.map((arg) => createHandle(this._nodeExecutionContext, arg));
        const message = new ConsoleMessage(null, null, event.type, void 0, args, stackTraceToLocation(event.stackTrace), event.timestamp);
        this.emit(_ElectronApplication.Events.Console, message);
      }
      async initialize() {
        await this._nodeSession.send("Runtime.enable", {});
        await this._nodeSession.send("Runtime.evaluate", { expression: "__playwright_run()" });
      }
      process() {
        return this._process;
      }
      context() {
        return this._browserContext;
      }
      async close(progress2) {
        await this._browserContext.close(progress2, { reason: "Application exited" });
      }
      async browserWindow(progress2, page) {
        const targetId = page.delegate._targetId;
        const electronHandle = await progress2.race(this._nodeElectronHandlePromise);
        return await progress2.race(electronHandle.evaluateHandle(({ BrowserWindow, webContents }, targetId2) => {
          const wc = webContents.fromDevToolsTargetId(targetId2);
          return BrowserWindow.fromWebContents(wc);
        }, targetId));
      }
    };
    Electron = class extends SdkObject {
      constructor(playwright2) {
        super(playwright2, "electron");
        this.logName = "browser";
      }
      async launch(progress2, options) {
        let app = void 0;
        let electronArguments = ["--inspect=0", "--remote-debugging-port=0", ...options.args || []];
        if (import_os14.default.platform() === "linux") {
          if (!options.chromiumSandbox && electronArguments.indexOf("--no-sandbox") === -1)
            electronArguments.unshift("--no-sandbox");
        }
        let artifactsDir;
        const tempDirectories = [];
        if (options.artifactsDir) {
          artifactsDir = options.artifactsDir;
        } else {
          artifactsDir = await progress2.race(import_fs29.default.promises.mkdtemp(ARTIFACTS_FOLDER3));
          tempDirectories.push(artifactsDir);
        }
        const browserLogsCollector = new RecentLogsCollector();
        const env = options.env ? envArrayToObject(options.env) : process.env;
        let command;
        if (options.executablePath) {
          command = options.executablePath;
        } else {
          try {
            command = require("electron/index.js");
          } catch (error) {
            if (error?.code === "MODULE_NOT_FOUND") {
              throw new Error("\n" + wrapInASCIIBox([
                "Electron executablePath not found!",
                "Please install it using `npm install -D electron` or set the executablePath to your Electron executable."
              ].join("\n"), 1));
            }
            throw error;
          }
          electronArguments.unshift("-r", libPath("server", "electron", "loader.js"));
        }
        let shell = false;
        if (process.platform === "win32") {
          shell = true;
          command = [command, ...electronArguments].map((arg) => `"${escapeDoubleQuotes(arg)}"`).join(" ");
          electronArguments = [];
        }
        delete env.NODE_OPTIONS;
        const { launchedProcess, gracefullyClose, kill } = await progress2.race(launchProcess({
          command,
          args: electronArguments,
          env,
          log: (message) => {
            progress2.log(message);
            browserLogsCollector.log(message);
          },
          shell,
          stdio: "pipe",
          cwd: options.cwd,
          tempDirectories,
          attemptToGracefullyClose: () => app.close(nullProgress),
          handleSIGINT: true,
          handleSIGTERM: true,
          handleSIGHUP: true,
          onExit: () => app?.emit(ElectronApplication.Events.Close)
        }));
        const waitForXserverError = waitForLine(progress2, launchedProcess, /Unable to open X display/).then(() => {
          throw new Error([
            "Unable to open X display!",
            `================================`,
            "Most likely this is because there is no X server available.",
            "Use 'xvfb-run' on Linux to launch your tests with an emulated display server.",
            "For example: 'xvfb-run npm run test:e2e'",
            `================================`,
            progress2.metadata.log
          ].join("\n"));
        });
        const nodeMatchPromise = waitForLine(progress2, launchedProcess, /^Debugger listening on (ws:\/\/.*)$/);
        const chromeMatchPromise = waitForLine(progress2, launchedProcess, /^DevTools listening on (ws:\/\/.*)$/);
        const debuggerDisconnectPromise = waitForLine(progress2, launchedProcess, /Waiting for the debugger to disconnect\.\.\./);
        try {
          const nodeMatch = await nodeMatchPromise;
          const nodeTransport = await WebSocketTransport.connect(progress2, nodeMatch[1]);
          const nodeConnection = new CRConnection(this, nodeTransport, helper.debugProtocolLogger(), browserLogsCollector);
          debuggerDisconnectPromise.then(() => {
            nodeTransport.close();
          }).catch(() => {
          });
          const chromeMatch = await progress2.race(Promise.race([
            chromeMatchPromise,
            waitForXserverError
          ]));
          const chromeTransport = await WebSocketTransport.connect(progress2, chromeMatch[1]);
          const browserProcess = {
            onclose: void 0,
            process: launchedProcess,
            close: gracefullyClose,
            kill
          };
          const contextOptions = {
            ...options,
            noDefaultViewport: true
          };
          const browserOptions = {
            name: "electron",
            browserType: "chromium",
            headful: true,
            persistent: contextOptions,
            browserProcess,
            protocolLogger: helper.debugProtocolLogger(),
            browserLogsCollector,
            artifactsDir,
            downloadsPath: artifactsDir,
            tracesDir: options.tracesDir || artifactsDir,
            originalLaunchOptions: {}
          };
          validateBrowserContextOptions(contextOptions, browserOptions);
          const browser = await progress2.race(CRBrowser.connect(this.attribution.playwright, chromeTransport, browserOptions));
          app = new ElectronApplication(this, browser, nodeConnection, launchedProcess);
          await progress2.race(app.initialize());
          return app;
        } catch (error) {
          await progress2.race(kill());
          throw error;
        }
      }
    };
  }
});

// packages/playwright-core/src/server/firefox/ffConnection.ts
var import_events10, ConnectionEvents2, kBrowserCloseMessageId3, FFConnection, FFSession;
var init_ffConnection = __esm({
  "packages/playwright-core/src/server/firefox/ffConnection.ts"() {
    "use strict";
    import_events10 = require("events");
    init_debugLogger();
    init_helper();
    init_protocolError();
    ConnectionEvents2 = {
      Disconnected: Symbol("Disconnected")
    };
    kBrowserCloseMessageId3 = -9999;
    FFConnection = class extends import_events10.EventEmitter {
      constructor(transport, protocolLogger, browserLogsCollector) {
        super();
        this.setMaxListeners(0);
        this._transport = transport;
        this._protocolLogger = protocolLogger;
        this._browserLogsCollector = browserLogsCollector;
        this._lastId = 0;
        this._sessions = /* @__PURE__ */ new Map();
        this._closed = false;
        this.rootSession = new FFSession(this, "", (message) => this._rawSend(message));
        this._sessions.set("", this.rootSession);
        this._transport.onmessage = this._onMessage.bind(this);
        this._transport.onclose = this._onClose.bind(this);
      }
      nextMessageId() {
        return ++this._lastId;
      }
      _rawSend(message) {
        this._protocolLogger("send", message);
        this._transport.send(message);
      }
      async _onMessage(message) {
        this._protocolLogger("receive", message);
        if (message.id === kBrowserCloseMessageId3)
          return;
        const session2 = this._sessions.get(message.sessionId || "");
        if (session2)
          session2.dispatchMessage(message);
      }
      _onClose(reason) {
        this._closed = true;
        this._transport.onmessage = void 0;
        this._transport.onclose = void 0;
        this._browserDisconnectedLogs = helper.formatBrowserLogs(this._browserLogsCollector.recentLogs(), reason);
        this.rootSession.dispose();
        Promise.resolve().then(() => this.emit(ConnectionEvents2.Disconnected));
      }
      close() {
        if (!this._closed)
          this._transport.close();
      }
      createSession(sessionId) {
        const session2 = new FFSession(this, sessionId, (message) => this._rawSend({ ...message, sessionId }));
        this._sessions.set(sessionId, session2);
        return session2;
      }
    };
    FFSession = class extends import_events10.EventEmitter {
      constructor(connection, sessionId, rawSend) {
        super();
        this._disposed = false;
        this._crashed = false;
        this.setMaxListeners(0);
        this._callbacks = /* @__PURE__ */ new Map();
        this._connection = connection;
        this._sessionId = sessionId;
        this._rawSend = rawSend;
      }
      markAsCrashed() {
        this._crashed = true;
      }
      async send(method, params2) {
        if (this._crashed || this._disposed || this._connection._closed || this._connection._browserDisconnectedLogs)
          throw new ProtocolError(this._crashed ? "crashed" : "closed", void 0, this._connection._browserDisconnectedLogs);
        const id = this._connection.nextMessageId();
        this._rawSend({ method, params: params2, id });
        return new Promise((resolve, reject) => {
          this._callbacks.set(id, { resolve, reject, error: new ProtocolError("error", method) });
        });
      }
      sendMayFail(method, params2) {
        return this.send(method, params2).catch((error) => debugLogger.log("error", error));
      }
      dispatchMessage(object) {
        if (object.id) {
          const callback = this._callbacks.get(object.id);
          if (callback) {
            this._callbacks.delete(object.id);
            if (object.error) {
              callback.error.setMessage(object.error.message);
              callback.reject(callback.error);
            } else {
              callback.resolve(object.result);
            }
          }
        } else {
          Promise.resolve().then(() => this.emit(object.method, object.params));
        }
      }
      dispose() {
        this._disposed = true;
        this._connection._sessions.delete(this._sessionId);
        for (const callback of this._callbacks.values()) {
          callback.error.type = this._crashed ? "crashed" : "closed";
          callback.error.logs = this._connection._browserDisconnectedLogs;
          callback.reject(callback.error);
        }
        this._callbacks.clear();
      }
    };
  }
});

// packages/playwright-core/src/server/firefox/ffExecutionContext.ts
function checkException(exceptionDetails) {
  if (!exceptionDetails)
    return;
  if (exceptionDetails.value)
    throw new JavaScriptErrorInEvaluate(JSON.stringify(exceptionDetails.value));
  else
    throw new JavaScriptErrorInEvaluate(exceptionDetails.text + (exceptionDetails.stack ? "\n" + exceptionDetails.stack : ""));
}
function rewriteError3(error) {
  if (error.message.includes("cyclic object value") || error.message.includes("Object is not serializable"))
    return { result: { type: "undefined", value: void 0 } };
  if (error instanceof TypeError && error.message.startsWith("Converting circular structure to JSON"))
    rewriteErrorMessage(error, error.message + " Are you passing a nested JSHandle?");
  if (!isJavaScriptErrorInEvaluate(error) && !isSessionClosedError(error))
    throw new Error("Execution context was destroyed, most likely because of a navigation.");
  throw error;
}
function potentiallyUnserializableValue2(remoteObject) {
  const value2 = remoteObject.value;
  const unserializableValue = remoteObject.unserializableValue;
  return unserializableValue ? parseUnserializableValue(unserializableValue) : value2;
}
function renderPreview3(object) {
  if (object.type === "undefined")
    return "undefined";
  if (object.unserializableValue)
    return String(object.unserializableValue);
  if (object.type === "symbol")
    return "Symbol()";
  if (object.subtype === "regexp")
    return "RegExp";
  if (object.subtype === "weakmap")
    return "WeakMap";
  if (object.subtype === "weakset")
    return "WeakSet";
  if (object.subtype)
    return object.subtype[0].toUpperCase() + object.subtype.slice(1);
  if ("value" in object)
    return String(object.value);
}
function createHandle3(context2, remoteObject) {
  if (remoteObject.subtype === "node") {
    assert(context2 instanceof FrameExecutionContext);
    return new ElementHandle(context2, remoteObject.objectId);
  }
  return new JSHandle(context2, remoteObject.subtype || remoteObject.type || "", renderPreview3(remoteObject), remoteObject.objectId, potentiallyUnserializableValue2(remoteObject));
}
var FFExecutionContext;
var init_ffExecutionContext = __esm({
  "packages/playwright-core/src/server/firefox/ffExecutionContext.ts"() {
    "use strict";
    init_assert();
    init_stackTrace();
    init_utilityScriptSerializers();
    init_javascript();
    init_dom();
    init_protocolError();
    FFExecutionContext = class {
      constructor(session2, executionContextId) {
        this._session = session2;
        this._executionContextId = executionContextId;
      }
      async rawEvaluateJSON(expression2) {
        const payload = await this._session.send("Runtime.evaluate", {
          expression: expression2,
          returnByValue: true,
          executionContextId: this._executionContextId
        }).catch(rewriteError3);
        checkException(payload.exceptionDetails);
        return payload.result.value;
      }
      async rawEvaluateHandle(context2, expression2) {
        const payload = await this._session.send("Runtime.evaluate", {
          expression: expression2,
          returnByValue: false,
          executionContextId: this._executionContextId
        }).catch(rewriteError3);
        checkException(payload.exceptionDetails);
        return createHandle3(context2, payload.result);
      }
      async evaluateWithArguments(expression2, returnByValue, utilityScript, values, handles) {
        const payload = await this._session.send("Runtime.callFunction", {
          functionDeclaration: expression2,
          args: [
            { objectId: utilityScript._objectId, value: void 0 },
            ...values.map((value2) => ({ value: value2 })),
            ...handles.map((handle) => ({ objectId: handle._objectId, value: void 0 }))
          ],
          returnByValue,
          executionContextId: this._executionContextId
        }).catch(rewriteError3);
        checkException(payload.exceptionDetails);
        if (returnByValue)
          return parseEvaluationResultValue(payload.result.value);
        return createHandle3(utilityScript._context, payload.result);
      }
      async getProperties(object) {
        const response2 = await this._session.send("Runtime.getObjectProperties", {
          executionContextId: this._executionContextId,
          objectId: object._objectId
        });
        const result2 = /* @__PURE__ */ new Map();
        for (const property of response2.properties)
          result2.set(property.name, createHandle3(object._context, property.value));
        return result2;
      }
      async releaseHandle(handle) {
        if (!handle._objectId)
          return;
        await this._session.send("Runtime.disposeObject", {
          executionContextId: this._executionContextId,
          objectId: handle._objectId
        });
      }
      shouldPrependErrorPrefix() {
        return true;
      }
    };
  }
});

// packages/playwright-core/src/server/firefox/ffInput.ts
function toFirefoxKeyDescription(description) {
  const override = kFirefoxKeyOverrides.get(description.key);
  if (!override)
    return description;
  return {
    ...description,
    ...override
  };
}
function toModifiersMask2(modifiers) {
  let mask = 0;
  if (modifiers.has("Alt"))
    mask |= 1;
  if (modifiers.has("Control"))
    mask |= 2;
  if (modifiers.has("Shift"))
    mask |= 4;
  if (modifiers.has("Meta"))
    mask |= 8;
  return mask;
}
function toButtonNumber(button) {
  if (button === "left")
    return 0;
  if (button === "middle")
    return 1;
  if (button === "right")
    return 2;
  return 0;
}
function toButtonsMask2(buttons) {
  let mask = 0;
  if (buttons.has("left"))
    mask |= 1;
  if (buttons.has("right"))
    mask |= 2;
  if (buttons.has("middle"))
    mask |= 4;
  return mask;
}
var kFirefoxKeyOverrides, RawKeyboardImpl3, RawMouseImpl3, RawTouchscreenImpl3;
var init_ffInput = __esm({
  "packages/playwright-core/src/server/firefox/ffInput.ts"() {
    "use strict";
    kFirefoxKeyOverrides = /* @__PURE__ */ new Map([
      ["AudioVolumeMute", { code: "VolumeMute", keyCodeWithoutLocation: 181 }],
      ["AudioVolumeDown", { code: "VolumeDown", keyCodeWithoutLocation: 182 }],
      ["AudioVolumeUp", { code: "VolumeUp", keyCodeWithoutLocation: 183 }]
    ]);
    RawKeyboardImpl3 = class {
      constructor(client) {
        this._client = client;
      }
      async keydown(progress2, modifiers, keyName, description, autoRepeat) {
        const keyDescription = toFirefoxKeyDescription(description);
        let text2 = keyDescription.text;
        if (text2 === "\r")
          text2 = "";
        const { code, key, location: location2 } = keyDescription;
        await progress2.race(this._client.send("Page.dispatchKeyEvent", {
          type: "keydown",
          keyCode: keyDescription.keyCodeWithoutLocation,
          code,
          key,
          repeat: autoRepeat,
          location: location2,
          text: text2
        }));
      }
      async keyup(progress2, modifiers, keyName, description) {
        const keyDescription = toFirefoxKeyDescription(description);
        const { code, key, location: location2 } = keyDescription;
        await progress2.race(this._client.send("Page.dispatchKeyEvent", {
          type: "keyup",
          key,
          keyCode: keyDescription.keyCodeWithoutLocation,
          code,
          location: location2,
          repeat: false
        }));
      }
      async sendText(progress2, text2) {
        await progress2.race(this._client.send("Page.insertText", { text: text2 }));
      }
    };
    RawMouseImpl3 = class {
      constructor(client) {
        this._client = client;
      }
      async move(progress2, x, y, button, buttons, modifiers, forClick) {
        await progress2.race(this._client.send("Page.dispatchMouseEvent", {
          type: "mousemove",
          button: 0,
          buttons: toButtonsMask2(buttons),
          x: Math.floor(x),
          y: Math.floor(y),
          modifiers: toModifiersMask2(modifiers)
        }));
      }
      async down(progress2, x, y, button, buttons, modifiers, clickCount) {
        await progress2.race(this._client.send("Page.dispatchMouseEvent", {
          type: "mousedown",
          button: toButtonNumber(button),
          buttons: toButtonsMask2(buttons),
          x: Math.floor(x),
          y: Math.floor(y),
          modifiers: toModifiersMask2(modifiers),
          clickCount
        }));
      }
      async up(progress2, x, y, button, buttons, modifiers, clickCount) {
        await progress2.race(this._client.send("Page.dispatchMouseEvent", {
          type: "mouseup",
          button: toButtonNumber(button),
          buttons: toButtonsMask2(buttons),
          x: Math.floor(x),
          y: Math.floor(y),
          modifiers: toModifiersMask2(modifiers),
          clickCount
        }));
      }
      async wheel(progress2, x, y, buttons, modifiers, deltaX, deltaY) {
        await this._page.mainFrame().evaluateExpression(progress2, `new Promise(requestAnimationFrame)`, { world: "utility" });
        await progress2.race(this._client.send("Page.dispatchWheelEvent", {
          deltaX,
          deltaY,
          x: Math.floor(x),
          y: Math.floor(y),
          deltaZ: 0,
          modifiers: toModifiersMask2(modifiers)
        }));
      }
      setPage(page) {
        this._page = page;
      }
    };
    RawTouchscreenImpl3 = class {
      constructor(client) {
        this._client = client;
      }
      async tap(progress2, x, y, modifiers) {
        await progress2.race(this._client.send("Page.dispatchTapEvent", {
          x,
          y,
          modifiers: toModifiersMask2(modifiers)
        }));
      }
    };
  }
});

// packages/playwright-core/src/server/firefox/ffNetworkManager.ts
function parseMultivalueHeaders(headers) {
  const result2 = [];
  for (const header of headers) {
    const separator = header.name.toLowerCase() === "set-cookie" ? "\n" : ",";
    const tokens = header.value.split(separator).map((s) => s.trim());
    for (const token of tokens)
      result2.push({ name: header.name, value: token });
  }
  return result2;
}
var FFNetworkManager, causeToResourceType, internalCauseToResourceType, InterceptableRequest2, FFRouteImpl;
var init_ffNetworkManager = __esm({
  "packages/playwright-core/src/server/firefox/ffNetworkManager.ts"() {
    "use strict";
    init_eventsHelper();
    init_network2();
    FFNetworkManager = class {
      constructor(session2, page) {
        this._webSocketRequestIds = /* @__PURE__ */ new Set();
        this._session = session2;
        this._requests = /* @__PURE__ */ new Map();
        this._page = page;
        this._eventListeners = [
          eventsHelper.addEventListener(session2, "Network.requestWillBeSent", this._onRequestWillBeSent.bind(this)),
          eventsHelper.addEventListener(session2, "Network.responseReceived", this._onResponseReceived.bind(this)),
          eventsHelper.addEventListener(session2, "Network.requestFinished", this._onRequestFinished.bind(this)),
          eventsHelper.addEventListener(session2, "Network.requestFailed", this._onRequestFailed.bind(this))
        ];
      }
      dispose() {
        eventsHelper.removeEventListeners(this._eventListeners);
      }
      async setRequestInterception(enabled) {
        await Promise.all([
          this._session.send("Network.setRequestInterception", { enabled }),
          this._session.send("Page.setCacheDisabled", { cacheDisabled: enabled })
        ]);
      }
      _onRequestWillBeSent(event) {
        const redirectedFrom = event.redirectedFrom ? this._requests.get(event.redirectedFrom) || null : null;
        const frame = redirectedFrom ? redirectedFrom.request.frame() : event.frameId ? this._page._page.frameManager.frame(event.frameId) : null;
        if (!frame)
          return;
        if (event.method === "OPTIONS" && !event.isIntercepted)
          return;
        if (redirectedFrom)
          this._requests.delete(redirectedFrom._id);
        if (event.cause === "TYPE_WEBSOCKET") {
          this._webSocketRequestIds.add(event.requestId);
          this._page._onWebSocketRequestWillBeSent(event.requestId, event.url, event.headers);
          return;
        }
        const request2 = new InterceptableRequest2(frame, redirectedFrom, event);
        let route2;
        if (event.isIntercepted)
          route2 = new FFRouteImpl(this._session, request2);
        this._requests.set(request2._id, request2);
        this._page._page.frameManager.requestStarted(request2.request, route2);
      }
      _onResponseReceived(event) {
        const request2 = this._requests.get(event.requestId);
        if (!request2) {
          if (this._webSocketRequestIds.has(event.requestId))
            this._page._onWebSocketResponseReceived(event.requestId, event.status, event.statusText, event.headers);
          return;
        }
        const getResponseBody = async () => {
          const response3 = await this._session.send("Network.getResponseBody", {
            requestId: request2._id
          });
          if (response3.evicted)
            throw new Error(`Response body for ${request2.request.method()} ${request2.request.url()} was evicted!`);
          return Buffer.from(response3.base64body, "base64");
        };
        const startTime = event.timing.startTime;
        function relativeToStart(time) {
          if (!time)
            return -1;
          return (time - startTime) / 1e3;
        }
        const timing = {
          startTime: startTime / 1e3,
          domainLookupStart: relativeToStart(event.timing.domainLookupStart),
          domainLookupEnd: relativeToStart(event.timing.domainLookupEnd),
          connectStart: relativeToStart(event.timing.connectStart),
          secureConnectionStart: relativeToStart(event.timing.secureConnectionStart),
          connectEnd: relativeToStart(event.timing.connectEnd),
          requestStart: relativeToStart(event.timing.requestStart),
          responseStart: relativeToStart(event.timing.responseStart)
        };
        const response2 = new Response2(request2.request, event.status, event.statusText, parseMultivalueHeaders(event.headers), timing, getResponseBody, event.fromServiceWorker);
        if (event?.remoteIPAddress && typeof event?.remotePort === "number") {
          response2._serverAddrFinished({
            ipAddress: event.remoteIPAddress,
            port: event.remotePort
          });
        } else {
          response2._serverAddrFinished();
        }
        response2._securityDetailsFinished({
          protocol: event?.securityDetails?.protocol,
          subjectName: event?.securityDetails?.subjectName,
          issuer: event?.securityDetails?.issuer,
          validFrom: event?.securityDetails?.validFrom,
          validTo: event?.securityDetails?.validTo
        });
        response2.setRawResponseHeaders(null);
        response2.setResponseHeadersSize(null);
        this._page._page.frameManager.requestReceivedResponse(response2);
      }
      _onRequestFinished(event) {
        const request2 = this._requests.get(event.requestId);
        if (!request2) {
          if (this._webSocketRequestIds.has(event.requestId)) {
            this._webSocketRequestIds.delete(event.requestId);
            this._page._onWebSocketRequestFinished(event.requestId);
          }
          return;
        }
        const response2 = request2.request._existingResponse();
        response2.setTransferSize(event.transferSize);
        response2.setEncodedBodySize(event.encodedBodySize);
        const isRedirected = response2.status() >= 300 && response2.status() <= 399;
        const responseEndTime = event.responseEndTime ? event.responseEndTime / 1e3 - response2.timing().startTime : -1;
        if (isRedirected) {
          response2._requestFinished(responseEndTime);
        } else {
          this._requests.delete(request2._id);
          response2._requestFinished(responseEndTime);
        }
        response2._setHttpVersion(event.protocolVersion ?? null);
        this._page._page.frameManager.reportRequestFinished(request2.request, response2);
      }
      _onRequestFailed(event) {
        const request2 = this._requests.get(event.requestId);
        if (!request2)
          return;
        this._requests.delete(request2._id);
        const response2 = request2.request._existingResponse();
        if (response2) {
          response2.setTransferSize(null);
          response2.setEncodedBodySize(null);
          response2._requestFinished(-1);
          response2._setHttpVersion(null);
        }
        request2.request._setFailureText(event.errorCode);
        this._page._page.frameManager.requestFailed(request2.request, event.errorCode === "NS_BINDING_ABORTED");
      }
    };
    causeToResourceType = {
      TYPE_INVALID: "other",
      TYPE_OTHER: "other",
      TYPE_SCRIPT: "script",
      TYPE_IMAGE: "image",
      TYPE_STYLESHEET: "stylesheet",
      TYPE_OBJECT: "other",
      TYPE_DOCUMENT: "document",
      TYPE_SUBDOCUMENT: "document",
      TYPE_REFRESH: "document",
      TYPE_XBL: "other",
      TYPE_PING: "other",
      TYPE_XMLHTTPREQUEST: "xhr",
      TYPE_OBJECT_SUBREQUEST: "other",
      TYPE_DTD: "other",
      TYPE_FONT: "font",
      TYPE_MEDIA: "media",
      TYPE_WEBSOCKET: "websocket",
      TYPE_CSP_REPORT: "cspreport",
      TYPE_XSLT: "other",
      TYPE_BEACON: "beacon",
      TYPE_FETCH: "fetch",
      TYPE_IMAGESET: "image",
      TYPE_WEB_MANIFEST: "manifest"
    };
    internalCauseToResourceType = {
      TYPE_INTERNAL_EVENTSOURCE: "eventsource"
    };
    InterceptableRequest2 = class {
      constructor(frame, redirectedFrom, payload) {
        this._id = payload.requestId;
        if (redirectedFrom)
          redirectedFrom._redirectedTo = this;
        let postDataBuffer = null;
        if (payload.postData)
          postDataBuffer = Buffer.from(payload.postData, "base64");
        this.request = new Request(
          frame._page.browserContext,
          frame,
          null,
          redirectedFrom ? redirectedFrom.request : null,
          payload.navigationId,
          payload.url,
          internalCauseToResourceType[payload.internalCause] || causeToResourceType[payload.cause] || "other",
          payload.method,
          postDataBuffer,
          payload.headers
        );
        this.request.setRawRequestHeaders(null);
      }
      _finalRequest() {
        let request2 = this;
        while (request2._redirectedTo)
          request2 = request2._redirectedTo;
        return request2;
      }
    };
    FFRouteImpl = class {
      constructor(session2, request2) {
        this._session = session2;
        this._request = request2;
      }
      async continue(overrides) {
        await this._session.sendMayFail("Network.resumeInterceptedRequest", {
          requestId: this._request._id,
          url: overrides.url,
          method: overrides.method,
          headers: overrides.headers,
          postData: overrides.postData ? Buffer.from(overrides.postData).toString("base64") : void 0
        });
      }
      async fulfill(response2) {
        const base64body = response2.isBase64 ? response2.body : Buffer.from(response2.body).toString("base64");
        await this._session.sendMayFail("Network.fulfillInterceptedRequest", {
          requestId: this._request._id,
          status: response2.status,
          statusText: statusText(response2.status),
          headers: response2.headers,
          base64body
        });
      }
      async abort(errorCode) {
        await this._session.sendMayFail("Network.abortInterceptedRequest", {
          requestId: this._request._id,
          errorCode
        });
      }
    };
  }
});

// packages/playwright-core/src/server/firefox/ffPage.ts
function webSocketId(frameId, wsid) {
  return `${frameId}---${wsid}`;
}
var UTILITY_WORLD_NAME2, FFPage;
var init_ffPage = __esm({
  "packages/playwright-core/src/server/firefox/ffPage.ts"() {
    "use strict";
    init_assert();
    init_stackTrace();
    init_eventsHelper();
    init_dialog();
    init_dom();
    init_network2();
    init_page();
    init_page();
    init_ffConnection();
    init_ffExecutionContext();
    init_ffInput();
    init_ffNetworkManager();
    init_errors();
    init_videoRecorder();
    UTILITY_WORLD_NAME2 = "__playwright_utility_world__";
    FFPage = class {
      constructor(session2, browserContext, opener) {
        this.cspErrorsAsynchronousForInlineScripts = true;
        this._reportedAsNew = false;
        this._workers = /* @__PURE__ */ new Map();
        this._initScripts = [];
        this._webSocketRequests = /* @__PURE__ */ new Map();
        this._webSocketResponses = /* @__PURE__ */ new Map();
        this._session = session2;
        this._opener = opener;
        this.rawKeyboard = new RawKeyboardImpl3(session2);
        this.rawMouse = new RawMouseImpl3(session2);
        this.rawTouchscreen = new RawTouchscreenImpl3(session2);
        this._contextIdToContext = /* @__PURE__ */ new Map();
        this._browserContext = browserContext;
        this._page = new Page(this, browserContext);
        this.rawMouse.setPage(this._page);
        this._networkManager = new FFNetworkManager(session2, this);
        this._page.on(Page.Events.FrameDetached, (frame) => this._removeContextsForFrame(frame));
        this._eventListeners = [
          eventsHelper.addEventListener(this._session, "Page.eventFired", this._onEventFired.bind(this)),
          eventsHelper.addEventListener(this._session, "Page.frameAttached", this._onFrameAttached.bind(this)),
          eventsHelper.addEventListener(this._session, "Page.frameDetached", this._onFrameDetached.bind(this)),
          eventsHelper.addEventListener(this._session, "Page.navigationAborted", this._onNavigationAborted.bind(this)),
          eventsHelper.addEventListener(this._session, "Page.navigationCommitted", this._onNavigationCommitted.bind(this)),
          eventsHelper.addEventListener(this._session, "Page.navigationStarted", this._onNavigationStarted.bind(this)),
          eventsHelper.addEventListener(this._session, "Page.sameDocumentNavigation", this._onSameDocumentNavigation.bind(this)),
          eventsHelper.addEventListener(this._session, "Runtime.executionContextCreated", this._onExecutionContextCreated.bind(this)),
          eventsHelper.addEventListener(this._session, "Runtime.executionContextDestroyed", this._onExecutionContextDestroyed.bind(this)),
          eventsHelper.addEventListener(this._session, "Runtime.executionContextsCleared", this._onExecutionContextsCleared.bind(this)),
          eventsHelper.addEventListener(this._session, "Page.linkClicked", (event) => this._onLinkClicked(event.phase)),
          eventsHelper.addEventListener(this._session, "Page.uncaughtError", this._onUncaughtError.bind(this)),
          eventsHelper.addEventListener(this._session, "Runtime.console", this._onConsole.bind(this)),
          eventsHelper.addEventListener(this._session, "Page.dialogOpened", this._onDialogOpened.bind(this)),
          eventsHelper.addEventListener(this._session, "Page.bindingCalled", this._onBindingCalled.bind(this)),
          eventsHelper.addEventListener(this._session, "Page.fileChooserOpened", this._onFileChooserOpened.bind(this)),
          eventsHelper.addEventListener(this._session, "Page.workerCreated", this._onWorkerCreated.bind(this)),
          eventsHelper.addEventListener(this._session, "Page.workerDestroyed", this._onWorkerDestroyed.bind(this)),
          eventsHelper.addEventListener(this._session, "Page.dispatchMessageFromWorker", this._onDispatchMessageFromWorker.bind(this)),
          eventsHelper.addEventListener(this._session, "Page.crashed", this._onCrashed.bind(this)),
          eventsHelper.addEventListener(this._session, "Page.webSocketCreated", this._onWebSocketCreated.bind(this)),
          eventsHelper.addEventListener(this._session, "Page.webSocketOpened", this._onWebSocketOpened.bind(this)),
          eventsHelper.addEventListener(this._session, "Page.webSocketClosed", this._onWebSocketClosed.bind(this)),
          eventsHelper.addEventListener(this._session, "Page.webSocketFrameReceived", this._onWebSocketFrameReceived.bind(this)),
          eventsHelper.addEventListener(this._session, "Page.webSocketFrameSent", this._onWebSocketFrameSent.bind(this)),
          eventsHelper.addEventListener(this._session, "Page.screencastFrame", this._onScreencastFrame.bind(this))
        ];
        const promises = [];
        if (!this._page.isStorageStatePage)
          startAutomaticVideoRecording(this._page);
        promises.push(new Promise((f) => this._session.once("Page.ready", f)));
        Promise.all(promises).then(() => this._reportAsNew(), (error) => this._reportAsNew(error));
        this.addInitScript(new InitScript(this._page, ""), UTILITY_WORLD_NAME2).catch((e) => this._reportAsNew(e));
      }
      _reportAsNew(error) {
        if (this._reportedAsNew)
          return;
        this._reportedAsNew = true;
        this._page.reportAsNew(this._opener?._page, error);
      }
      _onWebSocketCreated(event) {
        this._page.frameManager.onWebSocketCreated(webSocketId(event.frameId, event.wsid), event.requestURL);
      }
      _onWebSocketRequestWillBeSent(requestId, url2, headers) {
        this._webSocketRequests.set(requestId, { url: url2, headers });
      }
      _onWebSocketResponseReceived(requestId, status, statusText2, headers) {
        this._webSocketResponses.set(requestId, { status, statusText: statusText2, headers });
      }
      _onWebSocketRequestFinished(requestId) {
        const response2 = this._webSocketResponses.get(requestId);
        assert(response2);
        if (response2.status >= 400) {
          const request2 = this._webSocketRequests.get(requestId);
          assert(request2);
          this._webSocketRequests.delete(requestId);
          this._webSocketResponses.delete(requestId);
          const url2 = parseURL2(request2.url);
          assert(url2);
          url2.protocol = url2.protocol === "https" ? "wss" : "ws";
          this._page.frameManager.onWebSocketCreated(requestId, url2.toString());
          this._page.frameManager.onWebSocketRequest(requestId, request2.headers);
          this._page.frameManager.onWebSocketResponse(requestId, response2.status, response2.statusText, response2.headers);
          this._page.frameManager.webSocketClosed(requestId);
          return;
        }
      }
      _onWebSocketOpened(event) {
        const request2 = this._webSocketRequests.get(event.requestId);
        assert(request2);
        const response2 = this._webSocketResponses.get(event.requestId);
        assert(response2);
        this._webSocketRequests.delete(event.requestId);
        this._webSocketResponses.delete(event.requestId);
        this._page.frameManager.onWebSocketRequest(webSocketId(event.frameId, event.wsid), request2.headers);
        this._page.frameManager.onWebSocketResponse(webSocketId(event.frameId, event.wsid), response2.status, response2.statusText, response2.headers);
      }
      _onWebSocketClosed(event) {
        if (event.error)
          this._page.frameManager.webSocketError(webSocketId(event.frameId, event.wsid), event.error);
        this._page.frameManager.webSocketClosed(webSocketId(event.frameId, event.wsid));
      }
      _onWebSocketFrameReceived(event) {
        this._page.frameManager.webSocketFrameReceived(webSocketId(event.frameId, event.wsid), event.opcode, event.data, event.timestamp * 1e3);
      }
      _onWebSocketFrameSent(event) {
        this._page.frameManager.onWebSocketFrameSent(webSocketId(event.frameId, event.wsid), event.opcode, event.data, event.timestamp * 1e3);
      }
      _onExecutionContextCreated(payload) {
        const { executionContextId, auxData } = payload;
        const frame = this._page.frameManager.frame(auxData.frameId);
        if (!frame)
          return;
        const delegate = new FFExecutionContext(this._session, executionContextId);
        let worldName = null;
        if (auxData.name === UTILITY_WORLD_NAME2)
          worldName = "utility";
        else if (!auxData.name)
          worldName = "main";
        const context2 = new FrameExecutionContext(delegate, frame, worldName);
        if (worldName)
          frame.contextCreated(worldName, context2);
        this._contextIdToContext.set(executionContextId, context2);
      }
      _onExecutionContextDestroyed(payload) {
        const { executionContextId } = payload;
        const context2 = this._contextIdToContext.get(executionContextId);
        if (!context2)
          return;
        this._contextIdToContext.delete(executionContextId);
        context2.frame.contextDestroyed(context2);
      }
      _onExecutionContextsCleared() {
        for (const executionContextId of Array.from(this._contextIdToContext.keys()))
          this._onExecutionContextDestroyed({ executionContextId });
      }
      _removeContextsForFrame(frame) {
        for (const [contextId4, context2] of this._contextIdToContext) {
          if (context2.frame === frame)
            this._contextIdToContext.delete(contextId4);
        }
      }
      _onLinkClicked(phase) {
        if (phase === "before")
          this._page.frameManager.frameWillPotentiallyRequestNavigation();
        else
          this._page.frameManager.frameDidPotentiallyRequestNavigation();
      }
      _onNavigationStarted(params2) {
        this._page.frameManager.frameRequestedNavigation(params2.frameId, params2.navigationId);
      }
      _onNavigationAborted(params2) {
        this._page.frameManager.frameAbortedNavigation(params2.frameId, params2.errorText, params2.navigationId);
      }
      _onNavigationCommitted(params2) {
        for (const [workerId, worker] of this._workers) {
          if (worker.frameId === params2.frameId)
            this._onWorkerDestroyed({ workerId });
        }
        this._page.frameManager.frameCommittedNewDocumentNavigation(params2.frameId, params2.url, params2.name || "", params2.navigationId || "", false);
      }
      _onSameDocumentNavigation(params2) {
        this._page.frameManager.frameCommittedSameDocumentNavigation(params2.frameId, params2.url);
      }
      _onFrameAttached(params2) {
        this._page.frameManager.frameAttached(params2.frameId, params2.parentFrameId);
      }
      _onFrameDetached(params2) {
        this._page.frameManager.frameDetached(params2.frameId);
      }
      _onEventFired(payload) {
        const { frameId, name } = payload;
        if (name === "load")
          this._page.frameManager.frameLifecycleEvent(frameId, "load");
        if (name === "DOMContentLoaded")
          this._page.frameManager.frameLifecycleEvent(frameId, "domcontentloaded");
      }
      _onUncaughtError(params2) {
        const { name, message } = splitErrorMessage(params2.message);
        const error = new Error(message);
        error.stack = params2.message + "\n" + params2.stack.split("\n").filter(Boolean).map((a) => a.replace(/([^@]*)@(.*)/, "    at $1 ($2)")).join("\n");
        error.name = name;
        this._page.addPageError(error, params2.location);
      }
      _onConsole(payload) {
        const { type: type3, args, executionContextId, location: location2 } = payload;
        const context2 = this._contextIdToContext.get(executionContextId);
        if (!context2)
          return;
        const timestamp = Date.now();
        this._page.addConsoleMessage(null, type3 === "warn" ? "warning" : type3, args.map((arg) => createHandle3(context2, arg)), location2, void 0, timestamp);
      }
      _onDialogOpened(params2) {
        this._page.browserContext.dialogManager.dialogDidOpen(new Dialog(
          this._page,
          params2.type,
          params2.message,
          async (accept, promptText) => {
            await this._session.sendMayFail("Page.handleDialog", { dialogId: params2.dialogId, accept, promptText });
          },
          params2.defaultValue
        ));
      }
      async _onBindingCalled(event) {
        const pageOrError = await this._page.waitForInitializedOrError();
        if (!(pageOrError instanceof Error)) {
          const context2 = this._contextIdToContext.get(event.executionContextId);
          if (context2)
            await this._page.onBindingCalled(event.payload, context2);
        }
      }
      async _onFileChooserOpened(payload) {
        const { executionContextId, element: element2 } = payload;
        const context2 = this._contextIdToContext.get(executionContextId);
        if (!context2)
          return;
        const handle = createHandle3(context2, element2).asElement();
        await this._page._onFileChooserOpened(handle);
      }
      async _onWorkerCreated(event) {
        const workerId = event.workerId;
        const worker = new Worker(this._page, event.url);
        const workerSession = new FFSession(this._session._connection, workerId, (message) => {
          this._session.send("Page.sendMessageToWorker", {
            frameId: event.frameId,
            workerId,
            message: JSON.stringify(message)
          }).catch((e) => {
            workerSession.dispatchMessage({ id: message.id, method: "", params: {}, error: { message: e.message, data: void 0 } });
          });
        });
        this._workers.set(workerId, { session: workerSession, frameId: event.frameId });
        this._page.addWorker(workerId, worker);
        workerSession.once("Runtime.executionContextCreated", (event2) => {
          worker.createExecutionContext(new FFExecutionContext(workerSession, event2.executionContextId));
          worker.workerScriptLoaded();
        });
        workerSession.on("Runtime.console", (event2) => {
          const { type: type3, args, location: location2 } = event2;
          const context2 = worker.existingExecutionContext;
          this._page.addConsoleMessage(worker, type3, args.map((arg) => createHandle3(context2, arg)), location2, void 0, Date.now());
        });
      }
      _onWorkerDestroyed(event) {
        const workerId = event.workerId;
        const worker = this._workers.get(workerId);
        if (!worker)
          return;
        worker.session.dispose();
        this._workers.delete(workerId);
        this._page.removeWorker(workerId);
      }
      async _onDispatchMessageFromWorker(event) {
        const worker = this._workers.get(event.workerId);
        if (!worker)
          return;
        worker.session.dispatchMessage(JSON.parse(event.message));
      }
      async _onCrashed(event) {
        this._session.markAsCrashed();
        this._page._didCrash();
      }
      didClose() {
        this._reportAsNew(new TargetClosedError(this._page.closeReason()));
        this._session.dispose();
        eventsHelper.removeEventListeners(this._eventListeners);
        this._networkManager.dispose();
        this._page._didClose();
      }
      async navigateFrame(frame, url2, referer) {
        const response2 = await this._session.send("Page.navigate", { url: url2, referer, frameId: frame._id });
        return { newDocumentId: response2.navigationId || void 0 };
      }
      async updateExtraHTTPHeaders() {
        await this._session.send("Network.setExtraHTTPHeaders", { headers: this._page.extraHTTPHeaders() || [] });
      }
      async updateEmulatedViewportSize() {
        const emulatedSize = this._page.emulatedSize();
        await this._session.send("Page.setViewportSize", {
          viewportSize: emulatedSize?.viewport ?? null,
          screenSize: emulatedSize?.screen,
          isMobile: !!this._browserContext._options.isMobile
        });
      }
      async bringToFront() {
        await this._session.send("Page.bringToFront", {});
      }
      async updateEmulateMedia() {
        const emulatedMedia = this._page.emulatedMedia();
        const colorScheme = emulatedMedia.colorScheme === "no-override" ? void 0 : emulatedMedia.colorScheme;
        const reducedMotion = emulatedMedia.reducedMotion === "no-override" ? void 0 : emulatedMedia.reducedMotion;
        const forcedColors = emulatedMedia.forcedColors === "no-override" ? void 0 : emulatedMedia.forcedColors;
        const contrast = emulatedMedia.contrast === "no-override" ? void 0 : emulatedMedia.contrast;
        await this._session.send("Page.setEmulatedMedia", {
          // Empty string means reset.
          type: emulatedMedia.media === "no-override" ? "" : emulatedMedia.media,
          colorScheme,
          reducedMotion,
          forcedColors,
          contrast
        });
      }
      async updateRequestInterception() {
        await this._networkManager.setRequestInterception(this._page.needsRequestInterception());
      }
      async updateFileChooserInterception() {
        const enabled = this._page.fileChooserIntercepted();
        await this._session.send("Page.setInterceptFileChooserDialog", { enabled }).catch(() => {
        });
      }
      async reload() {
        await this._session.send("Page.reload");
      }
      async goBack() {
        const { success } = await this._session.send("Page.goBack", { frameId: this._page.mainFrame()._id });
        return success;
      }
      async goForward() {
        const { success } = await this._session.send("Page.goForward", { frameId: this._page.mainFrame()._id });
        return success;
      }
      async requestGC() {
        await this._session.send("Heap.collectGarbage");
      }
      async addInitScript(initScript, worldName) {
        this._initScripts.push({ initScript, worldName });
        await this._updateInitScripts();
      }
      async removeInitScripts(initScripts) {
        const set = new Set(initScripts);
        this._initScripts = this._initScripts.filter((s) => !set.has(s.initScript));
        await this._updateInitScripts();
      }
      async _updateInitScripts() {
        await this._session.send("Page.setInitScripts", { scripts: this._initScripts.map((s) => ({ script: s.initScript.source, worldName: s.worldName })) });
      }
      async closePage(runBeforeUnload) {
        await this._session.send("Page.close", { runBeforeUnload });
      }
      async setBackgroundColor(color) {
        if (color)
          throw new Error("Not implemented");
      }
      async takeScreenshot(progress2, format2, documentRect, viewportRect, quality, fitsViewport, scale) {
        if (!documentRect) {
          const scrollOffset = await this._page.mainFrame().waitForFunctionValueInUtility(progress2, () => ({ x: window.scrollX, y: window.scrollY }));
          documentRect = {
            x: viewportRect.x + scrollOffset.x,
            y: viewportRect.y + scrollOffset.y,
            width: viewportRect.width,
            height: viewportRect.height
          };
        }
        const { data } = await progress2.race(this._session.send("Page.screenshot", {
          mimeType: "image/" + format2,
          clip: documentRect,
          quality,
          omitDeviceScaleFactor: scale === "css"
        }));
        return Buffer.from(data, "base64");
      }
      async getContentFrame(handle) {
        const { contentFrameId } = await this._session.send("Page.describeNode", {
          frameId: handle._context.frame._id,
          objectId: handle._objectId
        });
        if (!contentFrameId)
          return null;
        return this._page.frameManager.frame(contentFrameId);
      }
      async getOwnerFrame(handle) {
        const { ownerFrameId } = await this._session.send("Page.describeNode", {
          frameId: handle._context.frame._id,
          objectId: handle._objectId
        });
        return ownerFrameId || null;
      }
      async getBoundingBox(handle) {
        const quads = await this.getContentQuads(handle);
        if (!quads || !quads.length)
          return null;
        let minX = Infinity;
        let maxX = -Infinity;
        let minY = Infinity;
        let maxY = -Infinity;
        for (const quad of quads) {
          for (const point of quad) {
            minX = Math.min(minX, point.x);
            maxX = Math.max(maxX, point.x);
            minY = Math.min(minY, point.y);
            maxY = Math.max(maxY, point.y);
          }
        }
        return { x: minX, y: minY, width: maxX - minX, height: maxY - minY };
      }
      async scrollRectIntoViewIfNeeded(handle, rect) {
        return await this._session.send("Page.scrollIntoViewIfNeeded", {
          frameId: handle._context.frame._id,
          objectId: handle._objectId,
          rect
        }).then(() => "done").catch((e) => {
          if (e instanceof Error && e.message.includes("Node is detached from document"))
            return "error:notconnected";
          if (e instanceof Error && e.message.includes("Node does not have a layout object"))
            return "error:notvisible";
          throw e;
        });
      }
      startScreencast(options) {
        this._session.sendMayFail("Page.startScreencast", { width: options.width, height: options.height, quality: options.quality });
      }
      stopScreencast() {
        this._session.sendMayFail("Page.stopScreencast");
      }
      _onScreencastFrame(event) {
        const buffer = Buffer.from(event.data, "base64");
        this._page.screencast.onScreencastFrame({
          buffer,
          frameSwapWallTime: event.timestamp * 1e3,
          // timestamp is in seconds, we need to convert to milliseconds.
          viewportWidth: event.deviceWidth,
          viewportHeight: event.deviceHeight
        }, () => {
          this._session.sendMayFail("Page.screencastFrameAck");
        });
      }
      rafCountForStablePosition() {
        return 1;
      }
      async getContentQuads(handle) {
        const result2 = await this._session.sendMayFail("Page.getContentQuads", {
          frameId: handle._context.frame._id,
          objectId: handle._objectId
        });
        if (!result2)
          return null;
        return result2.quads.map((quad) => [quad.p1, quad.p2, quad.p3, quad.p4]);
      }
      async setInputFilePaths(progress2, handle, files) {
        await progress2.race(this._session.send("Page.setFileInputFiles", {
          frameId: handle._context.frame._id,
          objectId: handle._objectId,
          files
        }));
      }
      async adoptElementHandle(handle, to) {
        const result2 = await this._session.send("Page.adoptNode", {
          frameId: handle._context.frame._id,
          objectId: handle._objectId,
          executionContextId: to.delegate._executionContextId
        });
        if (!result2.remoteObject)
          throw new Error(kUnableToAdoptErrorMessage);
        return createHandle3(to, result2.remoteObject);
      }
      async inputActionEpilogue() {
      }
      async resetForReuse(progress2) {
        await this.rawMouse.move(progress2, -1, -1, "none", /* @__PURE__ */ new Set(), /* @__PURE__ */ new Set(), false);
      }
      async getFrameElement(frame) {
        const parent = frame.parentFrame();
        if (!parent)
          throw new Error("Frame has been detached.");
        const context2 = await parent.mainContext();
        const result2 = await this._session.send("Page.adoptNode", {
          frameId: frame._id,
          executionContextId: context2.delegate._executionContextId
        });
        if (!result2.remoteObject)
          throw new Error("Frame has been detached.");
        return createHandle3(context2, result2.remoteObject);
      }
      shouldToggleStyleSheetToSyncAnimations() {
        return false;
      }
      async setDockTile(image) {
      }
    };
  }
});

// packages/playwright-core/src/server/firefox/ffBrowser.ts
function toJugglerProxyOptions(proxy) {
  const proxyServer = new URL(proxy.server);
  let port = parseInt(proxyServer.port, 10);
  let type3 = "http";
  if (proxyServer.protocol === "socks5:")
    type3 = "socks";
  else if (proxyServer.protocol === "socks4:")
    type3 = "socks4";
  else if (proxyServer.protocol === "https:")
    type3 = "https";
  if (proxyServer.port === "") {
    if (proxyServer.protocol === "http:")
      port = 80;
    else if (proxyServer.protocol === "https:")
      port = 443;
  }
  return {
    type: type3,
    bypass: proxy.bypass ? proxy.bypass.split(",").map((domain) => domain.trim()) : [],
    host: proxyServer.hostname,
    port,
    username: proxy.username,
    password: proxy.password
  };
}
var FFBrowser, FFBrowserContext, kBandaidFirefoxUserPrefs;
var init_ffBrowser = __esm({
  "packages/playwright-core/src/server/firefox/ffBrowser.ts"() {
    "use strict";
    init_assert();
    init_browser();
    init_browserContext();
    init_network2();
    init_ffConnection();
    init_ffPage();
    init_page();
    FFBrowser = class _FFBrowser extends Browser {
      constructor(parent, connection, options) {
        super(parent, options);
        this._version = "";
        this._userAgent = "";
        this._connection = connection;
        this.session = connection.rootSession;
        this._ffPages = /* @__PURE__ */ new Map();
        this._contexts = /* @__PURE__ */ new Map();
        this._connection.on(ConnectionEvents2.Disconnected, () => this._onDisconnect());
        this.session.on("Browser.attachedToTarget", this._onAttachedToTarget.bind(this));
        this.session.on("Browser.detachedFromTarget", this._onDetachedFromTarget.bind(this));
        this.session.on("Browser.downloadCreated", this._onDownloadCreated.bind(this));
        this.session.on("Browser.downloadFinished", this._onDownloadFinished.bind(this));
      }
      static async connect(parent, transport, options) {
        const connection = new FFConnection(transport, options.protocolLogger, options.browserLogsCollector);
        const browser = new _FFBrowser(parent, connection, options);
        if (options.__testHookOnConnectToBrowser)
          await options.__testHookOnConnectToBrowser();
        let firefoxUserPrefs = options.originalLaunchOptions.firefoxUserPrefs ?? {};
        if (Object.keys(kBandaidFirefoxUserPrefs).length)
          firefoxUserPrefs = { ...kBandaidFirefoxUserPrefs, ...firefoxUserPrefs };
        const promises = [
          browser.session.send("Browser.enable", {
            attachToDefaultContext: !!options.persistent,
            userPrefs: Object.entries(firefoxUserPrefs).map(([name, value2]) => ({ name, value: value2 }))
          }),
          browser._initVersion()
        ];
        if (options.persistent) {
          browser._defaultContext = new FFBrowserContext(browser, void 0, options.persistent);
          promises.push(browser._defaultContext.initialize());
        }
        const proxy = options.originalLaunchOptions.proxyOverride || options.proxy;
        if (proxy)
          promises.push(browser.session.send("Browser.setBrowserProxy", toJugglerProxyOptions(proxy)));
        await Promise.all(promises);
        return browser;
      }
      async _initVersion() {
        const result2 = await this.session.send("Browser.getInfo");
        this._version = result2.version.substring(result2.version.indexOf("/") + 1);
        this._userAgent = result2.userAgent;
      }
      isConnected() {
        return !this._connection._closed;
      }
      async doCreateNewContext(options) {
        const { browserContextId } = await this.session.send("Browser.createBrowserContext", { removeOnDetach: true });
        const context2 = new FFBrowserContext(this, browserContextId, options);
        await context2.initialize();
        this._contexts.set(browserContextId, context2);
        return context2;
      }
      contexts() {
        return Array.from(this._contexts.values());
      }
      version() {
        return this._version;
      }
      userAgent() {
        return this._userAgent;
      }
      _onDetachedFromTarget(payload) {
        const ffPage = this._ffPages.get(payload.targetId);
        this._ffPages.delete(payload.targetId);
        ffPage.didClose();
      }
      _onAttachedToTarget(payload) {
        const { targetId, browserContextId, openerId, type: type3 } = payload.targetInfo;
        assert(type3 === "page");
        const context2 = browserContextId ? this._contexts.get(browserContextId) : this._defaultContext;
        assert(context2, `Unknown context id:${browserContextId}, _defaultContext: ${this._defaultContext}`);
        const session2 = this._connection.createSession(payload.sessionId);
        const opener = openerId ? this._ffPages.get(openerId) : null;
        const ffPage = new FFPage(session2, context2, opener);
        this._ffPages.set(targetId, ffPage);
      }
      _onDownloadCreated(payload) {
        const ffPage = this._ffPages.get(payload.pageTargetId);
        if (!ffPage)
          return;
        ffPage._page.frameManager.frameAbortedNavigation(payload.frameId, "Download is starting");
        let originPage = ffPage._page.initializedOrUndefined();
        if (!originPage) {
          ffPage._reportAsNew(new Error("Starting new page download"));
          if (ffPage._opener)
            originPage = ffPage._opener._page.initializedOrUndefined();
        }
        if (!originPage)
          return;
        this.downloadCreated(originPage, payload.uuid, payload.url, payload.suggestedFileName);
      }
      _onDownloadFinished(payload) {
        const error = payload.canceled ? "canceled" : payload.error;
        this.downloadFinished(payload.uuid, error);
      }
      _onDisconnect() {
        for (const ffPage of this._ffPages.values())
          ffPage.didClose();
        this._ffPages.clear();
        this.didClose();
      }
    };
    FFBrowserContext = class extends BrowserContext {
      constructor(browser, browserContextId, options) {
        super(browser, options, browserContextId);
      }
      async initialize() {
        assert(!this._ffPages().length);
        const browserContextId = this._browserContextId;
        const promises = [
          super.initialize(),
          this._updateInitScripts()
        ];
        if (this._options.acceptDownloads !== "internal-browser-default") {
          promises.push(this._browser.session.send("Browser.setDownloadOptions", {
            browserContextId,
            downloadOptions: {
              behavior: this._options.acceptDownloads === "accept" ? "saveToDisk" : "cancel",
              downloadsDir: this._browser.options.downloadsPath
            }
          }));
        }
        promises.push(this.doUpdateDefaultViewport());
        if (this._options.hasTouch)
          promises.push(this._browser.session.send("Browser.setTouchOverride", { browserContextId, hasTouch: true }));
        if (this._options.userAgent)
          promises.push(this._browser.session.send("Browser.setUserAgentOverride", { browserContextId, userAgent: this._options.userAgent }));
        if (this._options.bypassCSP)
          promises.push(this._browser.session.send("Browser.setBypassCSP", { browserContextId, bypassCSP: true }));
        if (this._options.ignoreHTTPSErrors || this._options.internalIgnoreHTTPSErrors)
          promises.push(this._browser.session.send("Browser.setIgnoreHTTPSErrors", { browserContextId, ignoreHTTPSErrors: true }));
        if (this._options.javaScriptEnabled === false)
          promises.push(this._browser.session.send("Browser.setJavaScriptDisabled", { browserContextId, javaScriptDisabled: true }));
        if (this._options.locale)
          promises.push(this._browser.session.send("Browser.setLocaleOverride", { browserContextId, locale: this._options.locale }));
        if (this._options.timezoneId)
          promises.push(this._browser.session.send("Browser.setTimezoneOverride", { browserContextId, timezoneId: this._options.timezoneId }));
        if (this._options.extraHTTPHeaders || this._options.locale)
          promises.push(this.doUpdateExtraHTTPHeaders());
        if (this._options.httpCredentials)
          promises.push(this.innerSetHTTPCredentials(this._options.httpCredentials));
        if (this._options.geolocation)
          promises.push(this.setGeolocation(this._options.geolocation));
        if (this._options.offline)
          promises.push(this.doUpdateOffline());
        promises.push(this.doUpdateDefaultEmulatedMedia());
        const proxy = this._options.proxyOverride || this._options.proxy;
        if (proxy) {
          promises.push(this._browser.session.send("Browser.setContextProxy", {
            browserContextId: this._browserContextId,
            ...toJugglerProxyOptions(proxy)
          }));
        }
        await Promise.all(promises);
      }
      _ffPages() {
        return Array.from(this._browser._ffPages.values()).filter((ffPage) => ffPage._browserContext === this);
      }
      possiblyUninitializedPages() {
        return this._ffPages().map((ffPage) => ffPage._page);
      }
      async doCreateNewPage() {
        const { targetId } = await this._browser.session.send("Browser.newPage", {
          browserContextId: this._browserContextId
        }).catch((e) => {
          if (e.message.includes("Failed to override timezone"))
            throw new Error(`Invalid timezone ID: ${this._options.timezoneId}`);
          throw e;
        });
        return this._browser._ffPages.get(targetId)._page;
      }
      async doGetCookies(urls) {
        const { cookies } = await this._browser.session.send("Browser.getCookies", { browserContextId: this._browserContextId });
        return filterCookies(cookies.map((c) => {
          const { name, value: value2, domain, path: path59, expires, httpOnly, secure, sameSite } = c;
          return {
            name,
            value: value2,
            domain,
            path: path59,
            expires,
            httpOnly,
            secure,
            sameSite
          };
        }), urls);
      }
      async addCookies(cookies) {
        const cc = rewriteCookies(cookies).map((c) => {
          const { name, value: value2, url: url2, domain, path: path59, expires, httpOnly, secure, sameSite } = c;
          return {
            name,
            value: value2,
            url: url2,
            domain,
            path: path59,
            expires: expires === -1 ? void 0 : expires,
            httpOnly,
            secure,
            sameSite
          };
        });
        await this._browser.session.send("Browser.setCookies", { browserContextId: this._browserContextId, cookies: cc });
      }
      async doClearCookies() {
        await this._browser.session.send("Browser.clearCookies", { browserContextId: this._browserContextId });
      }
      async doGrantPermissions(origin, permissions) {
        const webPermissionToProtocol = /* @__PURE__ */ new Map([
          ["geolocation", "geo"],
          ["persistent-storage", "persistent-storage"],
          ["push", "push"],
          ["notifications", "desktop-notification"],
          ["screen-wake-lock", "screen-wake-lock"]
        ]);
        const filtered = permissions.map((permission) => {
          const protocolPermission = webPermissionToProtocol.get(permission);
          if (!protocolPermission)
            throw new Error("Unknown permission: " + permission);
          return protocolPermission;
        });
        await this._browser.session.send("Browser.grantPermissions", { origin, browserContextId: this._browserContextId, permissions: filtered });
      }
      async doClearPermissions() {
        await this._browser.session.send("Browser.resetPermissions", { browserContextId: this._browserContextId });
      }
      async setGeolocation(geolocation) {
        verifyGeolocation(geolocation);
        this._options.geolocation = geolocation;
        await this._browser.session.send("Browser.setGeolocationOverride", { browserContextId: this._browserContextId, geolocation: geolocation || null });
      }
      async doUpdateExtraHTTPHeaders() {
        let allHeaders = this._options.extraHTTPHeaders || [];
        if (this._options.locale)
          allHeaders = mergeHeaders([allHeaders, singleHeader("Accept-Language", this._options.locale)]);
        await this._browser.session.send("Browser.setExtraHTTPHeaders", { browserContextId: this._browserContextId, headers: allHeaders });
      }
      async setUserAgent(userAgent) {
        await this._browser.session.send("Browser.setUserAgentOverride", { browserContextId: this._browserContextId, userAgent: userAgent || null });
      }
      async doUpdateOffline() {
        await this._browser.session.send("Browser.setOnlineOverride", { browserContextId: this._browserContextId, override: this._options.offline ? "offline" : "online" });
      }
      async doSetHTTPCredentials(httpCredentials) {
        this._options.httpCredentials = httpCredentials;
        let credentials = null;
        if (httpCredentials) {
          const { username, password, origin } = httpCredentials;
          credentials = { username, password, origin };
        }
        await this._browser.session.send("Browser.setHTTPCredentials", { browserContextId: this._browserContextId, credentials });
      }
      async doAddInitScript(initScript) {
        await this._updateInitScripts();
      }
      async doRemoveInitScripts(initScripts) {
        await this._updateInitScripts();
      }
      async _updateInitScripts() {
        const bindingScripts = [...this._pageBindings.values()].map((binding) => binding.initScript.source);
        if (this.bindingsInitScript)
          bindingScripts.unshift(this.bindingsInitScript.source);
        const initScripts = this.initScripts.map((script) => script.source);
        await this._browser.session.send("Browser.setInitScripts", { browserContextId: this._browserContextId, scripts: [...bindingScripts, ...initScripts].map((script) => ({ script })) });
      }
      async doUpdateRequestInterception() {
        await Promise.all([
          this._browser.session.send("Browser.setRequestInterception", { browserContextId: this._browserContextId, enabled: this.requestInterceptors.length > 0 }),
          this._browser.session.send("Browser.setCacheDisabled", { browserContextId: this._browserContextId, cacheDisabled: this.requestInterceptors.length > 0 })
        ]);
      }
      async doUpdateDefaultViewport() {
        if (!this._options.viewport)
          return;
        const viewport = {
          viewportSize: { width: this._options.viewport.width, height: this._options.viewport.height },
          screenSize: this._options.screen,
          deviceScaleFactor: this._options.deviceScaleFactor || 1,
          isMobile: !!this._options.isMobile
        };
        await this._browser.session.send("Browser.setDefaultViewport", { browserContextId: this._browserContextId, viewport });
      }
      async doUpdateDefaultEmulatedMedia() {
        if (this._options.colorScheme !== "no-override") {
          await this._browser.session.send("Browser.setColorScheme", {
            browserContextId: this._browserContextId,
            colorScheme: this._options.colorScheme !== void 0 ? this._options.colorScheme : "light"
          });
        }
        if (this._options.reducedMotion !== "no-override") {
          await this._browser.session.send("Browser.setReducedMotion", {
            browserContextId: this._browserContextId,
            reducedMotion: this._options.reducedMotion !== void 0 ? this._options.reducedMotion : "no-preference"
          });
        }
        if (this._options.forcedColors !== "no-override") {
          await this._browser.session.send("Browser.setForcedColors", {
            browserContextId: this._browserContextId,
            forcedColors: this._options.forcedColors !== void 0 ? this._options.forcedColors : "none"
          });
        }
        if (this._options.contrast !== "no-override") {
          await this._browser.session.send("Browser.setContrast", {
            browserContextId: this._browserContextId,
            contrast: this._options.contrast !== void 0 ? this._options.contrast : "no-preference"
          });
        }
      }
      async doExposePlaywrightBinding() {
        this._browser.session.send("Browser.addBinding", { browserContextId: this._browserContextId, name: PageBinding.kBindingName, script: "" });
      }
      onClosePersistent() {
      }
      async clearCache() {
        await this._browser.session.send("Browser.clearCache");
      }
      async doClose(reason) {
        if (!this._browserContextId) {
          return "close-browser";
        } else {
          await this._browser.session.send("Browser.removeBrowserContext", { browserContextId: this._browserContextId });
          this._browser._contexts.delete(this._browserContextId);
        }
      }
      async cancelDownload(uuid) {
        await this._browser.session.send("Browser.cancelDownload", { uuid });
      }
    };
    kBandaidFirefoxUserPrefs = {};
  }
});

// packages/playwright-core/src/server/firefox/firefox.ts
var import_os15, import_path29, Firefox;
var init_firefox = __esm({
  "packages/playwright-core/src/server/firefox/firefox.ts"() {
    "use strict";
    import_os15 = __toESM(require("os"));
    import_path29 = __toESM(require("path"));
    init_manualPromise();
    init_ascii();
    init_ffBrowser();
    init_ffConnection();
    init_browserType();
    Firefox = class extends BrowserType {
      constructor(parent, bidiFirefox) {
        super(parent, "firefox");
        this._bidiFirefox = bidiFirefox;
      }
      launch(progress2, options, protocolLogger) {
        if (options.channel?.startsWith("moz-"))
          return this._bidiFirefox.launch(progress2, options, protocolLogger);
        return super.launch(progress2, options, protocolLogger);
      }
      async launchPersistentContext(progress2, userDataDir, options) {
        if (options.channel?.startsWith("moz-"))
          return this._bidiFirefox.launchPersistentContext(progress2, userDataDir, options);
        return super.launchPersistentContext(progress2, userDataDir, options);
      }
      connectToTransport(transport, options) {
        return FFBrowser.connect(this.attribution.playwright, transport, options);
      }
      doRewriteStartupLog(logs) {
        if (logs.includes(`as root in a regular user's session is not supported.`))
          logs = "\n" + wrapInASCIIBox(`Firefox is unable to launch if the $HOME folder isn't owned by the current user.
Workaround: Set the HOME=/root environment variable${process.env.GITHUB_ACTION ? " in your GitHub Actions workflow file" : ""} when running Playwright.`, 1);
        if (logs.includes("no DISPLAY environment variable specified"))
          logs = "\n" + wrapInASCIIBox(kNoXServerRunningError, 1);
        return logs;
      }
      amendEnvironment(env) {
        if (!import_path29.default.isAbsolute(import_os15.default.homedir()))
          throw new Error(`Cannot launch Firefox with relative home directory. Did you set ${import_os15.default.platform() === "win32" ? "USERPROFILE" : "HOME"} to a relative path?`);
        if (import_os15.default.platform() === "linux") {
          return { ...env, SNAP_NAME: void 0, SNAP_INSTANCE_NAME: void 0 };
        }
        return env;
      }
      attemptToGracefullyCloseBrowser(transport) {
        const message = { method: "Browser.close", params: {}, id: kBrowserCloseMessageId3 };
        transport.send(message);
      }
      async defaultArgs(options, isPersistent, userDataDir) {
        const { args = [], headless } = options;
        const userDataDirArg = args.find((arg) => arg.startsWith("-profile") || arg.startsWith("--profile"));
        if (userDataDirArg)
          throw this._createUserDataDirArgMisuseError("--profile");
        if (args.find((arg) => arg.startsWith("-juggler")))
          throw new Error("Use the port parameter instead of -juggler argument");
        const firefoxArguments = ["-no-remote"];
        if (headless) {
          firefoxArguments.push("-headless");
        } else {
          firefoxArguments.push("-wait-for-browser");
          firefoxArguments.push("-foreground");
        }
        firefoxArguments.push(`-profile`, userDataDir);
        firefoxArguments.push("-juggler-pipe");
        firefoxArguments.push(...args);
        if (isPersistent)
          firefoxArguments.push("about:blank");
        else
          firefoxArguments.push("-silent");
        return firefoxArguments;
      }
      waitForReadyState(options, browserLogsCollector) {
        const result2 = new ManualPromise();
        browserLogsCollector.onMessage((message) => {
          if (message.includes("Juggler listening to the pipe"))
            result2.resolve({});
        });
        return result2;
      }
    };
  }
});

// packages/playwright-core/src/server/webkit/wkConnection.ts
var import_events11, kBrowserCloseMessageId4, kPageProxyMessageReceived, WKConnection, WKSession;
var init_wkConnection = __esm({
  "packages/playwright-core/src/server/webkit/wkConnection.ts"() {
    "use strict";
    import_events11 = require("events");
    init_debugLogger();
    init_assert();
    init_helper();
    init_protocolError();
    kBrowserCloseMessageId4 = -9999;
    kPageProxyMessageReceived = Symbol("kPageProxyMessageReceived");
    WKConnection = class {
      constructor(transport, onDisconnect, protocolLogger, browserLogsCollector) {
        this._lastId = 0;
        this._closed = false;
        this._transport = transport;
        this._onDisconnect = onDisconnect;
        this._protocolLogger = protocolLogger;
        this._browserLogsCollector = browserLogsCollector;
        this.browserSession = new WKSession(this, "", (message) => {
          this.rawSend(message);
        });
        this._transport.onmessage = this._dispatchMessage.bind(this);
        this._transport.onclose = this._onClose.bind(this);
      }
      nextMessageId() {
        return ++this._lastId;
      }
      rawSend(message) {
        this._protocolLogger("send", message);
        this._transport.send(message);
      }
      _dispatchMessage(message) {
        this._protocolLogger("receive", message);
        if (message.id === kBrowserCloseMessageId4)
          return;
        if (message.pageProxyId) {
          const payload = { message, pageProxyId: message.pageProxyId };
          this.browserSession.dispatchMessage({ method: kPageProxyMessageReceived, params: payload });
          return;
        }
        this.browserSession.dispatchMessage(message);
      }
      _onClose(reason) {
        this._closed = true;
        this._transport.onmessage = void 0;
        this._transport.onclose = void 0;
        this._browserDisconnectedLogs = helper.formatBrowserLogs(this._browserLogsCollector.recentLogs(), reason);
        this.browserSession.dispose();
        this._onDisconnect();
      }
      isClosed() {
        return this._closed;
      }
      close() {
        if (!this._closed)
          this._transport.close();
      }
    };
    WKSession = class extends import_events11.EventEmitter {
      constructor(connection, sessionId, rawSend) {
        super();
        this._disposed = false;
        this._callbacks = /* @__PURE__ */ new Map();
        this._crashed = false;
        this.setMaxListeners(0);
        this.connection = connection;
        this.sessionId = sessionId;
        this._rawSend = rawSend;
      }
      async send(method, params2) {
        if (this._crashed || this._disposed || this.connection._browserDisconnectedLogs)
          throw new ProtocolError(this._crashed ? "crashed" : "closed", void 0, this.connection._browserDisconnectedLogs);
        const id = this.connection.nextMessageId();
        const messageObj = { id, method, params: params2 };
        this._rawSend(messageObj);
        return new Promise((resolve, reject) => {
          this._callbacks.set(id, { resolve, reject, error: new ProtocolError("error", method) });
        });
      }
      sendMayFail(method, params2) {
        return this.send(method, params2).catch((error) => debugLogger.log("error", error));
      }
      markAsCrashed() {
        this._crashed = true;
      }
      isDisposed() {
        return this._disposed;
      }
      dispose() {
        for (const callback of this._callbacks.values()) {
          callback.error.type = this._crashed ? "crashed" : "closed";
          callback.error.logs = this.connection._browserDisconnectedLogs;
          callback.reject(callback.error);
        }
        this._callbacks.clear();
        this._disposed = true;
      }
      dispatchMessage(object) {
        if (object.id && this._callbacks.has(object.id)) {
          const callback = this._callbacks.get(object.id);
          this._callbacks.delete(object.id);
          if (object.error) {
            callback.error.setMessage(object.error.message);
            callback.reject(callback.error);
          } else {
            callback.resolve(object.result);
          }
        } else if (object.id && !object.error) {
          assert(this.isDisposed(), JSON.stringify(object));
        } else {
          Promise.resolve().then(() => this.emit(object.method, object.params));
        }
      }
    };
  }
});

// packages/playwright-core/src/server/webkit/wkExecutionContext.ts
function potentiallyUnserializableValue3(remoteObject) {
  const value2 = remoteObject.value;
  const isUnserializable = remoteObject.type === "number" && ["NaN", "-Infinity", "Infinity", "-0"].includes(remoteObject.description);
  return isUnserializable ? parseUnserializableValue(remoteObject.description) : value2;
}
function rewriteError4(error) {
  if (error.message.includes("Object has too long reference chain"))
    throw new Error("Cannot serialize result: object reference chain is too long.");
  if (!isJavaScriptErrorInEvaluate(error) && !isSessionClosedError(error))
    return new Error("Execution context was destroyed, most likely because of a navigation.");
  return error;
}
function renderPreview4(object) {
  if (object.type === "undefined")
    return "undefined";
  if ("value" in object)
    return String(object.value);
  if (object.description === "Object" && object.preview) {
    const tokens = [];
    for (const { name, value: value2 } of object.preview.properties)
      tokens.push(`${name}: ${value2}`);
    return `{${tokens.join(", ")}}`;
  }
  if (object.subtype === "array" && object.preview)
    return sparseArrayToString(object.preview.properties);
  return object.description;
}
function createHandle4(context2, remoteObject) {
  if (remoteObject.subtype === "node") {
    assert(context2 instanceof FrameExecutionContext);
    return new ElementHandle(context2, remoteObject.objectId);
  }
  const isPromise = remoteObject.className === "Promise";
  return new JSHandle(context2, isPromise ? "promise" : remoteObject.subtype || remoteObject.type, renderPreview4(remoteObject), remoteObject.objectId, potentiallyUnserializableValue3(remoteObject));
}
var WKExecutionContext;
var init_wkExecutionContext = __esm({
  "packages/playwright-core/src/server/webkit/wkExecutionContext.ts"() {
    "use strict";
    init_assert();
    init_utilityScriptSerializers();
    init_javascript();
    init_dom();
    init_protocolError();
    WKExecutionContext = class {
      constructor(session2, contextId4) {
        this._session = session2;
        this._contextId = contextId4;
      }
      async rawEvaluateJSON(expression2) {
        try {
          const response2 = await this._session.send("Runtime.evaluate", {
            expression: expression2,
            contextId: this._contextId,
            returnByValue: true
          });
          if (response2.wasThrown)
            throw new JavaScriptErrorInEvaluate(response2.result.description);
          return response2.result.value;
        } catch (error) {
          throw rewriteError4(error);
        }
      }
      async rawEvaluateHandle(context2, expression2) {
        try {
          const response2 = await this._session.send("Runtime.evaluate", {
            expression: expression2,
            contextId: this._contextId,
            returnByValue: false
          });
          if (response2.wasThrown)
            throw new JavaScriptErrorInEvaluate(response2.result.description);
          return createHandle4(context2, response2.result);
        } catch (error) {
          throw rewriteError4(error);
        }
      }
      async evaluateWithArguments(expression2, returnByValue, utilityScript, values, handles) {
        try {
          const response2 = await this._session.send("Runtime.callFunctionOn", {
            functionDeclaration: expression2,
            objectId: utilityScript._objectId,
            arguments: [
              { objectId: utilityScript._objectId },
              ...values.map((value2) => ({ value: value2 })),
              ...handles.map((handle) => ({ objectId: handle._objectId }))
            ],
            returnByValue,
            emulateUserGesture: true,
            awaitPromise: true
          });
          if (response2.wasThrown)
            throw new JavaScriptErrorInEvaluate(response2.result.description);
          if (returnByValue)
            return parseEvaluationResultValue(response2.result.value);
          return createHandle4(utilityScript._context, response2.result);
        } catch (error) {
          throw rewriteError4(error);
        }
      }
      async getProperties(object) {
        const response2 = await this._session.send("Runtime.getProperties", {
          objectId: object._objectId,
          ownProperties: true
        });
        const result2 = /* @__PURE__ */ new Map();
        for (const property of response2.properties) {
          if (!property.enumerable || !property.value)
            continue;
          result2.set(property.name, createHandle4(object._context, property.value));
        }
        return result2;
      }
      async releaseHandle(handle) {
        if (!handle._objectId)
          return;
        await this._session.send("Runtime.releaseObject", { objectId: handle._objectId });
      }
      shouldPrependErrorPrefix() {
        return false;
      }
    };
  }
});

// packages/playwright-core/src/server/webkit/wkInput.ts
function toModifiersMask3(modifiers) {
  let mask = 0;
  if (modifiers.has("Shift"))
    mask |= 1;
  if (modifiers.has("Control"))
    mask |= 2;
  if (modifiers.has("Alt"))
    mask |= 4;
  if (modifiers.has("Meta"))
    mask |= 8;
  return mask;
}
function toButtonsMask3(buttons) {
  let mask = 0;
  if (buttons.has("left"))
    mask |= 1;
  if (buttons.has("right"))
    mask |= 2;
  if (buttons.has("middle"))
    mask |= 4;
  return mask;
}
var RawKeyboardImpl4, RawMouseImpl4, RawTouchscreenImpl4;
var init_wkInput = __esm({
  "packages/playwright-core/src/server/webkit/wkInput.ts"() {
    "use strict";
    init_stringUtils();
    init_input();
    init_macEditingCommands();
    RawKeyboardImpl4 = class {
      constructor(session2) {
        this._pageProxySession = session2;
      }
      setSession(session2) {
        this._session = session2;
      }
      async keydown(progress2, modifiers, keyName, description, autoRepeat) {
        const parts = [];
        for (const modifier of ["Shift", "Control", "Alt", "Meta"]) {
          if (modifiers.has(modifier))
            parts.push(modifier);
        }
        const { code, keyCode, key, text: text2 } = description;
        parts.push(code);
        const shortcut = parts.join("+");
        let commands2 = macEditingCommands[shortcut];
        if (isString(commands2))
          commands2 = [commands2];
        await progress2.race(this._pageProxySession.send("Input.dispatchKeyEvent", {
          type: "keyDown",
          modifiers: toModifiersMask3(modifiers),
          windowsVirtualKeyCode: keyCode,
          code,
          key,
          text: text2,
          unmodifiedText: text2,
          autoRepeat,
          macCommands: commands2,
          isKeypad: description.location === keypadLocation2
        }));
      }
      async keyup(progress2, modifiers, keyName, description) {
        const { code, key } = description;
        await progress2.race(this._pageProxySession.send("Input.dispatchKeyEvent", {
          type: "keyUp",
          modifiers: toModifiersMask3(modifiers),
          key,
          windowsVirtualKeyCode: description.keyCode,
          code,
          isKeypad: description.location === keypadLocation2
        }));
      }
      async sendText(progress2, text2) {
        await progress2.race(this._session.send("Page.insertText", { text: text2 }));
      }
    };
    RawMouseImpl4 = class {
      constructor(session2) {
        this._pageProxySession = session2;
      }
      setSession(session2) {
        this._session = session2;
      }
      async move(progress2, x, y, button, buttons, modifiers, forClick) {
        await progress2.race(this._pageProxySession.send("Input.dispatchMouseEvent", {
          type: "move",
          button,
          buttons: toButtonsMask3(buttons),
          x,
          y,
          modifiers: toModifiersMask3(modifiers)
        }));
      }
      async down(progress2, x, y, button, buttons, modifiers, clickCount) {
        await progress2.race(this._pageProxySession.send("Input.dispatchMouseEvent", {
          type: "down",
          button,
          buttons: toButtonsMask3(buttons),
          x,
          y,
          modifiers: toModifiersMask3(modifiers),
          clickCount
        }));
      }
      async up(progress2, x, y, button, buttons, modifiers, clickCount) {
        await progress2.race(this._pageProxySession.send("Input.dispatchMouseEvent", {
          type: "up",
          button,
          buttons: toButtonsMask3(buttons),
          x,
          y,
          modifiers: toModifiersMask3(modifiers),
          clickCount
        }));
      }
      async wheel(progress2, x, y, buttons, modifiers, deltaX, deltaY) {
        if (this._page?.browserContext._options.isMobile)
          throw new Error("Mouse wheel is not supported in mobile WebKit");
        await progress2.race(this._session.send("Page.updateScrollingState"));
        await this._page.mainFrame().evaluateExpression(progress2, `new Promise(requestAnimationFrame)`, { world: "utility" });
        await progress2.race(this._pageProxySession.send("Input.dispatchWheelEvent", {
          x,
          y,
          deltaX,
          deltaY,
          modifiers: toModifiersMask3(modifiers)
        }));
      }
      setPage(page) {
        this._page = page;
      }
    };
    RawTouchscreenImpl4 = class {
      constructor(session2) {
        this._pageProxySession = session2;
      }
      async tap(progress2, x, y, modifiers) {
        await progress2.race(this._pageProxySession.send("Input.dispatchTapEvent", {
          x,
          y,
          modifiers: toModifiersMask3(modifiers)
        }));
      }
    };
  }
});

// packages/playwright-core/src/server/webkit/wkInterceptableRequest.ts
function wkMillisToRoundishMillis(value2) {
  if (value2 === -1e3)
    return -1;
  if (value2 <= 0) {
    return -1;
  }
  return (value2 * 1e3 | 0) / 1e3;
}
function toResourceType2(type3) {
  switch (type3) {
    case "Document":
      return "document";
    case "StyleSheet":
      return "stylesheet";
    case "Image":
      return "image";
    case "Font":
      return "font";
    case "Script":
      return "script";
    case "XHR":
      return "xhr";
    case "Fetch":
      return "fetch";
    case "Ping":
      return "ping";
    case "Beacon":
      return "beacon";
    case "WebSocket":
      return "websocket";
    case "EventSource":
      return "eventsource";
    default:
      return "other";
  }
}
var errorReasons2, wkSetCookieSeparator, WKInterceptableRequest, WKRouteImpl;
var init_wkInterceptableRequest = __esm({
  "packages/playwright-core/src/server/webkit/wkInterceptableRequest.ts"() {
    "use strict";
    init_assert();
    init_headers();
    init_network2();
    errorReasons2 = {
      "aborted": "Cancellation",
      "accessdenied": "AccessControl",
      "addressunreachable": "General",
      "blockedbyclient": "Cancellation",
      "blockedbyresponse": "General",
      "connectionaborted": "General",
      "connectionclosed": "General",
      "connectionfailed": "General",
      "connectionrefused": "General",
      "connectionreset": "General",
      "internetdisconnected": "General",
      "namenotresolved": "General",
      "timedout": "Timeout",
      "failed": "General"
    };
    wkSetCookieSeparator = process.platform === "darwin" ? "," : "playwright-set-cookie-separator";
    WKInterceptableRequest = class {
      constructor(session2, frame, event, redirectedFrom, documentId) {
        this._session = session2;
        this._requestId = event.requestId;
        const resourceType = event.type ? toResourceType2(event.type) : redirectedFrom ? redirectedFrom.request.resourceType() : "other";
        let postDataBuffer = null;
        this._timestamp = event.timestamp;
        this._wallTime = event.walltime * 1e3;
        if (event.request.postData)
          postDataBuffer = Buffer.from(event.request.postData, "base64");
        this.request = new Request(
          frame._page.browserContext,
          frame,
          null,
          redirectedFrom?.request || null,
          documentId,
          event.request.url,
          resourceType,
          event.request.method,
          postDataBuffer,
          headersObjectToArray(event.request.headers),
          this._wallTime
        );
      }
      adoptRequestFromNewProcess(newSession, requestId) {
        this._session = newSession;
        this._requestId = requestId;
      }
      createResponse(responsePayload) {
        const getResponseBody = async () => {
          const response3 = await this._session.send("Network.getResponseBody", { requestId: this._requestId });
          return Buffer.from(response3.body, response3.base64Encoded ? "base64" : "utf8");
        };
        const timingPayload = responsePayload.timing;
        const timing = {
          startTime: this._wallTime,
          domainLookupStart: timingPayload ? wkMillisToRoundishMillis(timingPayload.domainLookupStart) : -1,
          domainLookupEnd: timingPayload ? wkMillisToRoundishMillis(timingPayload.domainLookupEnd) : -1,
          connectStart: timingPayload ? wkMillisToRoundishMillis(timingPayload.connectStart) : -1,
          secureConnectionStart: timingPayload ? wkMillisToRoundishMillis(timingPayload.secureConnectionStart) : -1,
          connectEnd: timingPayload ? wkMillisToRoundishMillis(timingPayload.connectEnd) : -1,
          requestStart: timingPayload ? wkMillisToRoundishMillis(timingPayload.requestStart) : -1,
          responseStart: timingPayload ? wkMillisToRoundishMillis(timingPayload.responseStart) : -1
        };
        const response2 = new Response2(this.request, responsePayload.status, responsePayload.statusText, headersObjectToArray(responsePayload.headers, ",", wkSetCookieSeparator), timing, getResponseBody, responsePayload.source === "service-worker");
        response2.setRawResponseHeaders(null);
        response2.setTransferSize(null);
        if (responsePayload.requestHeaders && Object.keys(responsePayload.requestHeaders).length) {
          const headers = { ...responsePayload.requestHeaders };
          if (!headers["host"])
            headers["Host"] = new URL(this.request.url()).host;
          this.request.setRawRequestHeaders(headersObjectToArray(headers));
        } else {
          this.request.setRawRequestHeaders(null);
        }
        return response2;
      }
    };
    WKRouteImpl = class {
      constructor(session2, requestId) {
        this._session = session2;
        this._requestId = requestId;
      }
      async abort(errorCode) {
        const errorType = errorReasons2[errorCode];
        assert(errorType, "Unknown error code: " + errorCode);
        await this._session.sendMayFail("Network.interceptRequestWithError", { requestId: this._requestId, errorType });
      }
      async fulfill(response2) {
        if (300 <= response2.status && response2.status < 400)
          throw new Error("Cannot fulfill with redirect status: " + response2.status);
        let mimeType = response2.isBase64 ? "application/octet-stream" : "text/plain";
        const headers = headersArrayToObject(
          response2.headers,
          true
          /* lowerCase */
        );
        const contentType = headers["content-type"];
        if (contentType)
          mimeType = contentType.split(";")[0].trim();
        await this._session.sendMayFail("Network.interceptRequestWithResponse", {
          requestId: this._requestId,
          status: response2.status,
          statusText: statusText(response2.status),
          mimeType,
          headers,
          base64Encoded: response2.isBase64,
          content: response2.body
        });
      }
      async continue(overrides) {
        await this._session.sendMayFail("Network.interceptWithRequest", {
          requestId: this._requestId,
          url: overrides.url,
          method: overrides.method,
          headers: overrides.headers ? headersArrayToObject(
            overrides.headers,
            false
            /* lowerCase */
          ) : void 0,
          postData: overrides.postData ? Buffer.from(overrides.postData).toString("base64") : void 0
        });
      }
    };
  }
});

// packages/playwright-core/src/server/webkit/wkProvisionalPage.ts
var WKProvisionalPage;
var init_wkProvisionalPage = __esm({
  "packages/playwright-core/src/server/webkit/wkProvisionalPage.ts"() {
    "use strict";
    init_eventsHelper();
    init_assert();
    WKProvisionalPage = class {
      constructor(session2, page) {
        this._sessionListeners = [];
        this._mainFrameId = null;
        this._session = session2;
        this._wkPage = page;
        this._coopNavigationRequest = page._page.mainFrame().pendingDocument()?.request;
        const overrideFrameId = (handler) => {
          return (payload) => {
            if (payload.frameId)
              payload.frameId = this._wkPage._page.frameManager.mainFrame()._id;
            handler(payload);
          };
        };
        const wkPage = this._wkPage;
        this._sessionListeners = [
          eventsHelper.addEventListener(session2, "Network.requestWillBeSent", overrideFrameId((e) => this._onRequestWillBeSent(e))),
          eventsHelper.addEventListener(session2, "Network.requestIntercepted", overrideFrameId((e) => wkPage._onRequestIntercepted(session2, e))),
          eventsHelper.addEventListener(session2, "Network.responseReceived", overrideFrameId((e) => wkPage._onResponseReceived(session2, e))),
          eventsHelper.addEventListener(session2, "Network.loadingFinished", overrideFrameId((e) => this._onLoadingFinished(e))),
          eventsHelper.addEventListener(session2, "Network.loadingFailed", overrideFrameId((e) => this._onLoadingFailed(e)))
        ];
        this.initializationPromise = this._wkPage._initializeSession(session2, true, ({ frameTree }) => this._handleFrameTree(frameTree));
      }
      coopNavigationRequest() {
        return this._coopNavigationRequest;
      }
      dispose() {
        eventsHelper.removeEventListeners(this._sessionListeners);
      }
      commit() {
        assert(this._mainFrameId);
        this._wkPage._onFrameAttached(this._mainFrameId, null);
      }
      _onRequestWillBeSent(event) {
        if (this._coopNavigationRequest && this._coopNavigationRequest.url() === event.request.url) {
          this._wkPage._adoptRequestFromNewProcess(this._coopNavigationRequest, this._session, event.requestId);
          return;
        }
        this._wkPage._onRequestWillBeSent(this._session, event);
      }
      _onLoadingFinished(event) {
        this._coopNavigationRequest = void 0;
        this._wkPage._onLoadingFinished(event);
      }
      _onLoadingFailed(event) {
        this._coopNavigationRequest = void 0;
        this._wkPage._onLoadingFailed(this._session, event);
      }
      _handleFrameTree(frameTree) {
        assert(!frameTree.frame.parentId);
        this._mainFrameId = frameTree.frame.id;
      }
    };
  }
});

// packages/playwright-core/src/server/webkit/wkWorkers.ts
var WKWorkers;
var init_wkWorkers = __esm({
  "packages/playwright-core/src/server/webkit/wkWorkers.ts"() {
    "use strict";
    init_eventsHelper();
    init_page();
    init_wkConnection();
    init_wkExecutionContext();
    WKWorkers = class {
      constructor(page) {
        this._sessionListeners = [];
        this._workerSessions = /* @__PURE__ */ new Map();
        this._page = page;
      }
      setSession(session2) {
        eventsHelper.removeEventListeners(this._sessionListeners);
        this.clear();
        this._sessionListeners = [
          eventsHelper.addEventListener(session2, "Worker.workerCreated", (event) => {
            const worker = new Worker(this._page, event.url);
            const workerSession = new WKSession(session2.connection, event.workerId, (message) => {
              session2.send("Worker.sendMessageToWorker", {
                workerId: event.workerId,
                message: JSON.stringify(message)
              }).catch((e) => {
                workerSession.dispatchMessage({ id: message.id, error: { message: e.message } });
              });
            });
            this._workerSessions.set(event.workerId, workerSession);
            worker.createExecutionContext(new WKExecutionContext(workerSession, void 0));
            worker.workerScriptLoaded();
            this._page.addWorker(event.workerId, worker);
            workerSession.on("Console.messageAdded", (event2) => this._onConsoleMessage(worker, event2));
            Promise.all([
              workerSession.send("Runtime.enable"),
              workerSession.send("Console.enable"),
              session2.send("Worker.initialized", { workerId: event.workerId })
            ]).catch((e) => {
              this._page.removeWorker(event.workerId);
            });
          }),
          eventsHelper.addEventListener(session2, "Worker.dispatchMessageFromWorker", (event) => {
            const workerSession = this._workerSessions.get(event.workerId);
            if (!workerSession)
              return;
            workerSession.dispatchMessage(JSON.parse(event.message));
          }),
          eventsHelper.addEventListener(session2, "Worker.workerTerminated", (event) => {
            const workerSession = this._workerSessions.get(event.workerId);
            if (!workerSession)
              return;
            workerSession.dispose();
            this._workerSessions.delete(event.workerId);
            this._page.removeWorker(event.workerId);
          })
        ];
      }
      clear() {
        this._page.clearWorkers();
        this._workerSessions.clear();
      }
      async initializeSession(session2) {
        await session2.send("Worker.enable");
      }
      async _onConsoleMessage(worker, event) {
        const { type: type3, level, text: text2, parameters, url: url2, line: lineNumber, column: columnNumber } = event.message;
        let derivedType = type3 || "";
        if (type3 === "log")
          derivedType = level;
        else if (type3 === "timing")
          derivedType = "timeEnd";
        const handles = (parameters || []).map((p) => {
          return createHandle4(worker.existingExecutionContext, p);
        });
        const location2 = {
          url: url2 || "",
          lineNumber: (lineNumber || 1) - 1,
          columnNumber: (columnNumber || 1) - 1
        };
        const timestamp = event.message.timestamp ? event.message.timestamp * 1e3 : Date.now();
        this._page.addConsoleMessage(worker, derivedType, handles, location2, handles.length ? void 0 : text2, timestamp);
      }
    };
  }
});

// packages/playwright-core/src/server/webkit/wkPage.ts
function parseRemoteAddress(value2) {
  if (!value2)
    return;
  try {
    const colon = value2.lastIndexOf(":");
    const dot = value2.lastIndexOf(".");
    if (dot < 0) {
      return {
        ipAddress: `[${value2.slice(0, colon)}]`,
        port: +value2.slice(colon + 1)
      };
    }
    if (colon > dot) {
      const [address, port] = value2.split(":");
      return {
        ipAddress: address,
        port: +port
      };
    } else {
      const [address, port] = value2.split(".");
      return {
        ipAddress: `[${address}]`,
        port: +port
      };
    }
  } catch (_) {
  }
}
function isLoadedSecurely(url2, timing) {
  try {
    const u = new URL(url2);
    if (u.protocol !== "https:" && u.protocol !== "wss:" && u.protocol !== "sftp:")
      return false;
    if (timing.secureConnectionStart === -1 && timing.connectStart !== -1)
      return false;
    return true;
  } catch (_) {
  }
}
var PNG2, jpegjs3, UTILITY_WORLD_NAME3, enableFrameSessions, WKPage, WKFrame;
var init_wkPage = __esm({
  "packages/playwright-core/src/server/webkit/wkPage.ts"() {
    "use strict";
    init_headers();
    init_stackTrace();
    init_eventsHelper();
    init_hostPlatform();
    init_assert();
    init_dialog();
    init_dom();
    init_errors();
    init_helper();
    init_network2();
    init_page();
    init_wkConnection();
    init_wkExecutionContext();
    init_wkInput();
    init_wkInterceptableRequest();
    init_wkProvisionalPage();
    init_wkWorkers();
    init_webkit();
    init_registry();
    init_videoRecorder();
    init_progress();
    ({ PNG: PNG2 } = require("./utilsBundle"));
    jpegjs3 = require("./utilsBundle").jpegjs;
    UTILITY_WORLD_NAME3 = "__playwright_utility_world__";
    enableFrameSessions = !process.env.WK_DISABLE_FRAME_SESSIONS && parseInt(registry.findExecutable("webkit").revision, 10) >= 2245 && parseInt(registry.findExecutable("webkit").revision, 10) <= 2255;
    WKPage = class _WKPage {
      constructor(browserContext, pageProxySession, opener) {
        this._provisionalPage = null;
        this._targetIdToFrameSession = /* @__PURE__ */ new Map();
        this._requestIdToRequest = /* @__PURE__ */ new Map();
        this._requestIdToRequestWillBeSentEvent = /* @__PURE__ */ new Map();
        this._sessionListeners = [];
        this._firstNonInitialNavigationCommittedFulfill = () => {
        };
        this._firstNonInitialNavigationCommittedReject = (e) => {
        };
        this._lastConsoleMessage = null;
        this._requestIdToResponseReceivedPayloadEvent = /* @__PURE__ */ new Map();
        this._timestampBaselineForWebSocket = /* @__PURE__ */ new Map();
        this._screencastGeneration = 0;
        this._pageProxySession = pageProxySession;
        this._opener = opener;
        this.rawKeyboard = new RawKeyboardImpl4(pageProxySession);
        this.rawMouse = new RawMouseImpl4(pageProxySession);
        this.rawTouchscreen = new RawTouchscreenImpl4(pageProxySession);
        this._contextIdToContext = /* @__PURE__ */ new Map();
        this._page = new Page(this, browserContext);
        this.rawMouse.setPage(this._page);
        this._workers = new WKWorkers(this._page);
        this._session = void 0;
        this._browserContext = browserContext;
        this._page.on(Page.Events.FrameDetached, (frame) => this._removeContextsForFrame(frame, false));
        this._eventListeners = [
          eventsHelper.addEventListener(this._pageProxySession, "Target.targetCreated", this._onTargetCreated.bind(this)),
          eventsHelper.addEventListener(this._pageProxySession, "Target.targetDestroyed", this._onTargetDestroyed.bind(this)),
          eventsHelper.addEventListener(this._pageProxySession, "Target.dispatchMessageFromTarget", this._onDispatchMessageFromTarget.bind(this)),
          eventsHelper.addEventListener(this._pageProxySession, "Target.didCommitProvisionalTarget", this._onDidCommitProvisionalTarget.bind(this)),
          eventsHelper.addEventListener(this._pageProxySession, "Screencast.screencastFrame", this._onScreencastFrame.bind(this))
        ];
        this._firstNonInitialNavigationCommittedPromise = new Promise((f, r) => {
          this._firstNonInitialNavigationCommittedFulfill = f;
          this._firstNonInitialNavigationCommittedReject = r;
        });
        this._firstNonInitialNavigationCommittedPromise.catch(() => {
        });
        if (opener && !browserContext._options.noDefaultViewport && opener._nextWindowOpenPopupFeatures) {
          const viewportSize = helper.getViewportSizeFromWindowFeatures(opener._nextWindowOpenPopupFeatures);
          opener._nextWindowOpenPopupFeatures = void 0;
          if (viewportSize)
            this._page.setEmulatedSizeFromWindowOpen({ viewport: viewportSize, screen: viewportSize });
        }
      }
      async _initializePageProxySession() {
        if (this._page.isStorageStatePage)
          return;
        const promises = [
          this._pageProxySession.send("Dialog.enable"),
          this._pageProxySession.send("Emulation.setActiveAndFocused", { active: true })
        ];
        const contextOptions = this._browserContext._options;
        if (contextOptions.javaScriptEnabled === false)
          promises.push(this._pageProxySession.send("Emulation.setJavaScriptEnabled", { enabled: false }));
        promises.push(this._updateViewport());
        promises.push(this.updateHttpCredentials());
        if (this._browserContext._permissions.size) {
          for (const [key, value2] of this._browserContext._permissions)
            promises.push(this._grantPermissions(key, value2));
        }
        startAutomaticVideoRecording(this._page);
        await Promise.all(promises);
      }
      _setSession(session2) {
        eventsHelper.removeEventListeners(this._sessionListeners);
        this._session = session2;
        this.rawKeyboard.setSession(session2);
        this.rawMouse.setSession(session2);
        this._addSessionListeners();
        this._workers.setSession(session2);
      }
      // This method is called for provisional targets as well. The session passed as the parameter
      // may be different from the current session and may be destroyed without becoming current.
      async _initializeSession(session2, provisional, resourceTreeHandler) {
        await this._initializeSessionMayThrow(session2, resourceTreeHandler).catch((e) => {
          if (provisional && session2.isDisposed())
            return;
          if (this._session === session2)
            throw e;
        });
      }
      async _initializeSessionMayThrow(session2, resourceTreeHandler) {
        const [, frameTree] = await Promise.all([
          // Page agent must be enabled before Runtime.
          session2.send("Page.enable"),
          session2.send("Page.getResourceTree")
        ]);
        resourceTreeHandler(frameTree);
        const promises = [
          // Resource tree should be received before first execution context.
          session2.send("Runtime.enable"),
          session2.send("Page.createUserWorld", { name: UTILITY_WORLD_NAME3 }).catch((_) => {
          }),
          // Worlds are per-process
          session2.send("Network.enable"),
          this._workers.initializeSession(session2)
        ];
        if (enableFrameSessions)
          this._initializeFrameSessions(frameTree.frameTree, promises);
        else
          promises.push(session2.send("Console.enable"));
        if (this._page.browserContext.needsPlaywrightBinding())
          promises.push(session2.send("Runtime.addBinding", { name: PageBinding.kBindingName }));
        if (this._page.needsRequestInterception()) {
          promises.push(session2.send("Network.setInterceptionEnabled", { enabled: true }));
          promises.push(session2.send("Network.setResourceCachingDisabled", { disabled: true }));
          promises.push(session2.send("Network.addInterception", { url: ".*", stage: "request", isRegex: true }));
        }
        if (this._page.isStorageStatePage) {
          await Promise.all(promises);
          return;
        }
        const contextOptions = this._browserContext._options;
        if (contextOptions.userAgent)
          promises.push(this.updateUserAgent());
        const emulatedMedia = this._page.emulatedMedia();
        if (emulatedMedia.media || emulatedMedia.colorScheme || emulatedMedia.reducedMotion || emulatedMedia.forcedColors || emulatedMedia.contrast)
          promises.push(_WKPage._setEmulateMedia(session2, emulatedMedia.media, emulatedMedia.colorScheme, emulatedMedia.reducedMotion, emulatedMedia.forcedColors, emulatedMedia.contrast));
        const bootstrapScript = this._calculateBootstrapScript();
        if (bootstrapScript.length)
          promises.push(session2.send("Page.setBootstrapScript", { source: bootstrapScript }));
        this._page.frames().map((frame) => frame.evaluateExpression(nullProgress, bootstrapScript).catch((e) => {
        }));
        if (contextOptions.bypassCSP)
          promises.push(session2.send("Page.setBypassCSP", { enabled: true }));
        const emulatedSize = this._page.emulatedSize();
        if (emulatedSize) {
          promises.push(session2.send("Page.setScreenSizeOverride", {
            width: emulatedSize.screen.width,
            height: emulatedSize.screen.height
          }));
        }
        promises.push(this.updateEmulateMedia());
        promises.push(session2.send("Network.setExtraHTTPHeaders", { headers: headersArrayToObject(
          this._calculateExtraHTTPHeaders(),
          false
          /* lowerCase */
        ) }));
        if (contextOptions.offline)
          promises.push(session2.send("Network.setEmulateOfflineState", { offline: true }));
        promises.push(session2.send("Page.setTouchEmulationEnabled", { enabled: !!contextOptions.hasTouch }));
        if (contextOptions.timezoneId) {
          promises.push(session2.send("Page.setTimeZone", { timeZone: contextOptions.timezoneId }).catch((e) => {
            throw new Error(`Invalid timezone ID: ${contextOptions.timezoneId}`);
          }));
        }
        if (this._page.fileChooserIntercepted())
          promises.push(session2.send("Page.setInterceptFileChooserDialog", { enabled: true }));
        promises.push(session2.send("Page.overrideSetting", { setting: "DeviceOrientationEventEnabled", value: contextOptions.isMobile }));
        promises.push(session2.send("Page.overrideSetting", { setting: "FullScreenEnabled", value: !contextOptions.isMobile }));
        promises.push(session2.send("Page.overrideSetting", { setting: "NotificationsEnabled", value: !contextOptions.isMobile }));
        promises.push(session2.send("Page.overrideSetting", { setting: "PointerLockEnabled", value: !contextOptions.isMobile }));
        promises.push(session2.send("Page.overrideSetting", { setting: "InputTypeMonthEnabled", value: contextOptions.isMobile }));
        promises.push(session2.send("Page.overrideSetting", { setting: "InputTypeWeekEnabled", value: contextOptions.isMobile }));
        promises.push(session2.send("Page.overrideSetting", { setting: "FixedBackgroundsPaintRelativeToDocument", value: contextOptions.isMobile }));
        await Promise.all(promises);
      }
      _initializeFrameSessions(frame, promises) {
        const session2 = this._targetIdToFrameSession.get(`frame-${frame.frame.id}`);
        if (session2)
          promises.push(session2.initialize());
        for (const childFrame of frame.childFrames || [])
          this._initializeFrameSessions(childFrame, promises);
      }
      _onDidCommitProvisionalTarget(event) {
        const { oldTargetId, newTargetId } = event;
        assert(this._provisionalPage);
        assert(this._provisionalPage._session.sessionId === newTargetId, "Unknown new target: " + newTargetId);
        assert(this._session.sessionId === oldTargetId, "Unknown old target: " + oldTargetId);
        const newSession = this._provisionalPage._session;
        this._provisionalPage.commit();
        this._provisionalPage.dispose();
        this._provisionalPage = null;
        this._setSession(newSession);
      }
      _onTargetDestroyed(event) {
        const { targetId, crashed } = event;
        if (this._provisionalPage && this._provisionalPage._session.sessionId === targetId) {
          this._maybeCancelCoopNavigationRequest(this._provisionalPage);
          this._provisionalPage._session.dispose();
          this._provisionalPage.dispose();
          this._provisionalPage = null;
        } else if (this._session.sessionId === targetId) {
          this._session.dispose();
          eventsHelper.removeEventListeners(this._sessionListeners);
          if (crashed) {
            this._session.markAsCrashed();
            this._page._didCrash();
          }
        } else if (this._targetIdToFrameSession.has(targetId)) {
          this._targetIdToFrameSession.get(targetId).dispose();
          this._targetIdToFrameSession.delete(targetId);
        }
      }
      didClose() {
        this._pageProxySession.dispose();
        eventsHelper.removeEventListeners(this._sessionListeners);
        eventsHelper.removeEventListeners(this._eventListeners);
        if (this._session)
          this._session.dispose();
        if (this._provisionalPage) {
          this._provisionalPage._session.dispose();
          this._provisionalPage.dispose();
          this._provisionalPage = null;
        }
        this._firstNonInitialNavigationCommittedReject(new TargetClosedError(this._page.closeReason()));
        this._page._didClose();
      }
      dispatchMessageToSession(message) {
        this._pageProxySession.dispatchMessage(message);
      }
      handleProvisionalLoadFailed(event) {
        if (!this._page.initializedOrUndefined()) {
          this._firstNonInitialNavigationCommittedReject(new Error("Initial load failed"));
          return;
        }
        if (!this._provisionalPage)
          return;
        let errorText = event.error;
        if (errorText.includes("cancelled"))
          errorText += "; maybe frame was detached?";
        this._page.frameManager.frameAbortedNavigation(this._page.mainFrame()._id, errorText, event.loaderId);
      }
      handleWindowOpen(event) {
        this._nextWindowOpenPopupFeatures = event.windowFeatures;
      }
      async _onTargetCreated(event) {
        const { targetInfo } = event;
        const session2 = new WKSession(this._pageProxySession.connection, targetInfo.targetId, (message) => {
          this._pageProxySession.send("Target.sendMessageToTarget", {
            message: JSON.stringify(message),
            targetId: targetInfo.targetId
          }).catch((e) => {
            session2.dispatchMessage({ id: message.id, error: { message: e.message } });
          });
        });
        if (targetInfo.type === "frame") {
          if (enableFrameSessions) {
            const wkFrame = new WKFrame(this, session2);
            this._targetIdToFrameSession.set(targetInfo.targetId, wkFrame);
            await wkFrame.initialize().catch((e) => {
            });
          }
          return;
        }
        assert(targetInfo.type === "page", "Only page targets are expected in WebKit, received: " + targetInfo.type);
        if (!targetInfo.isProvisional) {
          assert(!this._page.initializedOrUndefined());
          let pageOrError;
          try {
            this._setSession(session2);
            await Promise.all([
              this._initializePageProxySession(),
              this._initializeSession(session2, false, ({ frameTree }) => this._handleFrameTree(frameTree))
            ]);
            pageOrError = this._page;
          } catch (e) {
            pageOrError = e;
          }
          if (targetInfo.isPaused)
            this._pageProxySession.sendMayFail("Target.resume", { targetId: targetInfo.targetId });
          if (pageOrError instanceof Page && this._page.mainFrame().url() === "") {
            try {
              await this._firstNonInitialNavigationCommittedPromise;
            } catch (e) {
              pageOrError = e;
            }
          }
          this._page.reportAsNew(this._opener?._page, pageOrError instanceof Page ? void 0 : pageOrError);
        } else {
          assert(targetInfo.isProvisional);
          assert(!this._provisionalPage);
          this._provisionalPage = new WKProvisionalPage(session2, this);
          if (targetInfo.isPaused) {
            this._provisionalPage.initializationPromise.then(() => {
              this._pageProxySession.sendMayFail("Target.resume", { targetId: targetInfo.targetId });
            });
          }
        }
      }
      _onDispatchMessageFromTarget(event) {
        const { targetId, message } = event;
        if (this._provisionalPage && this._provisionalPage._session.sessionId === targetId)
          this._provisionalPage._session.dispatchMessage(JSON.parse(message));
        else if (this._session.sessionId === targetId)
          this._session.dispatchMessage(JSON.parse(message));
        else if (this._targetIdToFrameSession.has(targetId))
          this._targetIdToFrameSession.get(targetId)._session.dispatchMessage(JSON.parse(message));
        else
          throw new Error("Unknown target: " + targetId);
      }
      _addSessionListeners() {
        this._sessionListeners = [
          eventsHelper.addEventListener(this._session, "Page.frameNavigated", (event) => this._onFrameNavigated(event.frame, false)),
          eventsHelper.addEventListener(this._session, "Page.navigatedWithinDocument", (event) => this._onFrameNavigatedWithinDocument(event.frameId, event.url)),
          eventsHelper.addEventListener(this._session, "Page.frameAttached", (event) => this._onFrameAttached(event.frameId, event.parentFrameId)),
          eventsHelper.addEventListener(this._session, "Page.frameDetached", (event) => this._onFrameDetached(event.frameId)),
          eventsHelper.addEventListener(this._session, "Page.willCheckNavigationPolicy", (event) => this._onWillCheckNavigationPolicy(event.frameId)),
          eventsHelper.addEventListener(this._session, "Page.didCheckNavigationPolicy", (event) => this._onDidCheckNavigationPolicy(event.frameId, event.cancel)),
          eventsHelper.addEventListener(this._session, "Page.loadEventFired", (event) => this._page.frameManager.frameLifecycleEvent(event.frameId, "load")),
          eventsHelper.addEventListener(this._session, "Page.domContentEventFired", (event) => this._page.frameManager.frameLifecycleEvent(event.frameId, "domcontentloaded")),
          eventsHelper.addEventListener(this._session, "Runtime.executionContextCreated", (event) => this._onExecutionContextCreated(event.context)),
          eventsHelper.addEventListener(this._session, "Runtime.bindingCalled", (event) => this._onBindingCalled(event.contextId, event.argument)),
          eventsHelper.addEventListener(this._session, "Console.messageAdded", (event) => this._onConsoleMessage(event)),
          eventsHelper.addEventListener(this._session, "Console.messageRepeatCountUpdated", (event) => this._onConsoleRepeatCountUpdated(event)),
          eventsHelper.addEventListener(this._pageProxySession, "Dialog.javascriptDialogOpening", (event) => this._onDialog(event)),
          eventsHelper.addEventListener(this._session, "Page.fileChooserOpened", (event) => this._onFileChooserOpened(event)),
          eventsHelper.addEventListener(this._session, "Network.requestWillBeSent", (e) => this._onRequestWillBeSent(this._session, e)),
          eventsHelper.addEventListener(this._session, "Network.requestIntercepted", (e) => this._onRequestIntercepted(this._session, e)),
          eventsHelper.addEventListener(this._session, "Network.responseReceived", (e) => this._onResponseReceived(this._session, e)),
          eventsHelper.addEventListener(this._session, "Network.loadingFinished", (e) => this._onLoadingFinished(e)),
          eventsHelper.addEventListener(this._session, "Network.loadingFailed", (e) => this._onLoadingFailed(this._session, e)),
          eventsHelper.addEventListener(this._session, "Network.webSocketCreated", (e) => this._page.frameManager.onWebSocketCreated(e.requestId, e.url)),
          eventsHelper.addEventListener(this._session, "Network.webSocketWillSendHandshakeRequest", (event) => this._onWebSocketWillSendHandshakeRequest(event)),
          eventsHelper.addEventListener(this._session, "Network.webSocketHandshakeResponseReceived", (e) => this._page.frameManager.onWebSocketResponse(e.requestId, e.response.status, e.response.statusText, headersObjectToArray(e.response.headers, ",", wkSetCookieSeparator))),
          eventsHelper.addEventListener(this._session, "Network.webSocketFrameSent", (e) => e.response.payloadData && this._page.frameManager.onWebSocketFrameSent(e.requestId, e.response.opcode, e.response.payloadData, this._timestampToWallTimeMsForWebSocket(e.requestId, e.timestamp))),
          eventsHelper.addEventListener(this._session, "Network.webSocketFrameReceived", (e) => e.response.payloadData && this._page.frameManager.webSocketFrameReceived(e.requestId, e.response.opcode, e.response.payloadData, this._timestampToWallTimeMsForWebSocket(e.requestId, e.timestamp))),
          eventsHelper.addEventListener(this._session, "Network.webSocketClosed", (event) => this._onWebSocketClosed(event)),
          eventsHelper.addEventListener(this._session, "Network.webSocketFrameError", (e) => this._page.frameManager.webSocketError(e.requestId, e.errorMessage))
        ];
      }
      async _updateState(method, params2) {
        await this._forAllSessions((session2) => session2.send(method, params2).then());
      }
      async _forAllSessions(callback) {
        const sessions = [
          this._session
        ];
        if (this._provisionalPage)
          sessions.push(this._provisionalPage._session);
        await Promise.all(sessions.map((session2) => callback(session2).catch((e) => {
        })));
      }
      _onWillCheckNavigationPolicy(frameId) {
        if (this._provisionalPage)
          return;
        this._page.frameManager.frameRequestedNavigation(frameId);
      }
      _onDidCheckNavigationPolicy(frameId, cancel) {
        if (!cancel)
          return;
        if (this._provisionalPage)
          return;
        this._page.frameManager.frameAbortedNavigation(frameId, "Navigation canceled by policy check");
      }
      _handleFrameTree(frameTree) {
        this._onFrameAttached(frameTree.frame.id, frameTree.frame.parentId || null);
        this._onFrameNavigated(frameTree.frame, true);
        this._page.frameManager.frameLifecycleEvent(frameTree.frame.id, "domcontentloaded");
        this._page.frameManager.frameLifecycleEvent(frameTree.frame.id, "load");
        if (!frameTree.childFrames)
          return;
        for (const child of frameTree.childFrames)
          this._handleFrameTree(child);
      }
      _onFrameAttached(frameId, parentFrameId) {
        return this._page.frameManager.frameAttached(frameId, parentFrameId);
      }
      _onFrameNavigated(framePayload, initial) {
        const frame = this._page.frameManager.frame(framePayload.id);
        assert(frame);
        this._removeContextsForFrame(frame, true);
        if (!framePayload.parentId)
          this._workers.clear();
        this._page.frameManager.frameCommittedNewDocumentNavigation(framePayload.id, framePayload.url, framePayload.name || "", framePayload.loaderId, initial);
        if (!initial)
          this._firstNonInitialNavigationCommittedFulfill();
      }
      _onFrameNavigatedWithinDocument(frameId, url2) {
        this._page.frameManager.frameCommittedSameDocumentNavigation(frameId, url2);
      }
      _onFrameDetached(frameId) {
        this._page.frameManager.frameDetached(frameId);
      }
      _removeContextsForFrame(frame, notifyFrame) {
        for (const [contextId4, context2] of this._contextIdToContext) {
          if (context2.frame === frame) {
            this._contextIdToContext.delete(contextId4);
            if (notifyFrame)
              frame.contextDestroyed(context2);
          }
        }
      }
      _onExecutionContextCreated(contextPayload) {
        if (this._contextIdToContext.has(contextPayload.id))
          return;
        const frame = this._page.frameManager.frame(contextPayload.frameId);
        if (!frame)
          return;
        const delegate = new WKExecutionContext(this._session, contextPayload.id);
        let worldName = null;
        if (contextPayload.type === "normal")
          worldName = "main";
        else if (contextPayload.type === "user" && contextPayload.name === UTILITY_WORLD_NAME3)
          worldName = "utility";
        const context2 = new FrameExecutionContext(delegate, frame, worldName);
        if (worldName)
          frame.contextCreated(worldName, context2);
        this._contextIdToContext.set(contextPayload.id, context2);
      }
      async _onBindingCalled(contextId4, argument) {
        const pageOrError = await this._page.waitForInitializedOrError();
        if (!(pageOrError instanceof Error)) {
          const context2 = this._contextIdToContext.get(contextId4);
          if (context2)
            await this._page.onBindingCalled(argument, context2);
        }
      }
      async navigateFrame(frame, url2, referrer) {
        if (this._pageProxySession.isDisposed())
          throw new TargetClosedError(this._page.closeReason());
        const pageProxyId = this._pageProxySession.sessionId;
        const result2 = await this._pageProxySession.connection.browserSession.send("Playwright.navigate", { url: url2, pageProxyId, frameId: frame._id, referrer });
        return { newDocumentId: result2.loaderId };
      }
      _onConsoleMessage(event) {
        const { type: type3, level, text: text2, parameters, url: url2, line: lineNumber, column: columnNumber, source: source11 } = event.message;
        if (level === "error" && source11 === "javascript") {
          const { name, message } = splitErrorMessage(text2);
          let stack;
          if (event.message.stackTrace) {
            stack = text2 + "\n" + event.message.stackTrace.callFrames.map((callFrame) => {
              return `    at ${callFrame.functionName || "unknown"} (${callFrame.url}:${callFrame.lineNumber}:${callFrame.columnNumber})`;
            }).join("\n");
          } else {
            stack = "";
          }
          this._lastConsoleMessage = null;
          const error = new Error(message);
          error.stack = stack;
          error.name = name;
          this._page.addPageError(error, {
            url: url2 || "",
            lineNumber: (lineNumber || 1) - 1,
            columnNumber: (columnNumber || 1) - 1
          });
          return;
        }
        let derivedType = type3 || "";
        if (type3 === "log")
          derivedType = level;
        else if (type3 === "timing")
          derivedType = "timeEnd";
        const handles = [];
        for (const p of parameters || []) {
          let context2;
          if (p.objectId) {
            const objectId = JSON.parse(p.objectId);
            context2 = this._contextIdToContext.get(objectId.injectedScriptId);
          } else {
            context2 = [...this._contextIdToContext.values()].find((c) => c.frame === this._page.mainFrame());
          }
          if (!context2)
            return;
          handles.push(createHandle4(context2, p));
        }
        this._lastConsoleMessage = {
          derivedType,
          text: text2,
          handles,
          count: 0,
          location: {
            url: url2 || "",
            lineNumber: (lineNumber || 1) - 1,
            columnNumber: (columnNumber || 1) - 1
          }
        };
        this._onConsoleRepeatCountUpdated({ count: 1, timestamp: event.message.timestamp });
      }
      _onConsoleRepeatCountUpdated(event) {
        if (this._lastConsoleMessage) {
          const {
            derivedType,
            text: text2,
            handles,
            count,
            location: location2
          } = this._lastConsoleMessage;
          const timestamp = event.timestamp ? event.timestamp * 1e3 : Date.now();
          for (let i = count; i < event.count; ++i)
            this._page.addConsoleMessage(null, derivedType, handles, location2, handles.length ? void 0 : text2, timestamp);
          this._lastConsoleMessage.count = event.count;
        }
      }
      _onDialog(event) {
        this._page.browserContext.dialogManager.dialogDidOpen(new Dialog(
          this._page,
          event.type,
          event.message,
          async (accept, promptText) => {
            if (event.type === "beforeunload" && !accept)
              this._page.frameManager.frameAbortedNavigation(this._page.mainFrame()._id, "navigation cancelled by beforeunload dialog");
            await this._pageProxySession.send("Dialog.handleJavaScriptDialog", { accept, promptText });
          },
          event.defaultPrompt
        ));
      }
      async _onFileChooserOpened(event) {
        let handle;
        try {
          const context2 = await this._page.frameManager.frame(event.frameId).mainContext();
          handle = createHandle4(context2, event.element).asElement();
        } catch (e) {
          return;
        }
        await this._page._onFileChooserOpened(handle);
      }
      static async _setEmulateMedia(session2, mediaType, colorScheme, reducedMotion, forcedColors, contrast) {
        const promises = [];
        promises.push(session2.send("Page.setEmulatedMedia", { media: mediaType === "no-override" ? "" : mediaType }));
        let appearance = void 0;
        switch (colorScheme) {
          case "light":
            appearance = "Light";
            break;
          case "dark":
            appearance = "Dark";
            break;
          case "no-override":
            appearance = void 0;
            break;
        }
        promises.push(session2.send("Page.overrideUserPreference", { name: "PrefersColorScheme", value: appearance }));
        let reducedMotionWk = void 0;
        switch (reducedMotion) {
          case "reduce":
            reducedMotionWk = "Reduce";
            break;
          case "no-preference":
            reducedMotionWk = "NoPreference";
            break;
          case "no-override":
            reducedMotionWk = void 0;
            break;
        }
        promises.push(session2.send("Page.overrideUserPreference", { name: "PrefersReducedMotion", value: reducedMotionWk }));
        let forcedColorsWk = void 0;
        switch (forcedColors) {
          case "active":
            forcedColorsWk = "Active";
            break;
          case "none":
            forcedColorsWk = "None";
            break;
          case "no-override":
            forcedColorsWk = void 0;
            break;
        }
        promises.push(session2.send("Page.setForcedColors", { forcedColors: forcedColorsWk }));
        let contrastWk = void 0;
        switch (contrast) {
          case "more":
            contrastWk = "More";
            break;
          case "no-preference":
            contrastWk = "NoPreference";
            break;
          case "no-override":
            contrastWk = void 0;
            break;
        }
        promises.push(session2.send("Page.overrideUserPreference", { name: "PrefersContrast", value: contrastWk }));
        await Promise.all(promises);
      }
      async updateExtraHTTPHeaders() {
        await this._updateState("Network.setExtraHTTPHeaders", { headers: headersArrayToObject(
          this._calculateExtraHTTPHeaders(),
          false
          /* lowerCase */
        ) });
      }
      _calculateExtraHTTPHeaders() {
        const locale = this._browserContext._options.locale;
        const headers = mergeHeaders([
          this._browserContext._options.extraHTTPHeaders,
          this._page.extraHTTPHeaders(),
          locale ? singleHeader("Accept-Language", locale) : void 0
        ]);
        return headers;
      }
      async updateEmulateMedia() {
        const emulatedMedia = this._page.emulatedMedia();
        const colorScheme = emulatedMedia.colorScheme;
        const reducedMotion = emulatedMedia.reducedMotion;
        const forcedColors = emulatedMedia.forcedColors;
        const contrast = emulatedMedia.contrast;
        await this._forAllSessions((session2) => _WKPage._setEmulateMedia(session2, emulatedMedia.media, colorScheme, reducedMotion, forcedColors, contrast));
      }
      async updateEmulatedViewportSize() {
        this._browserContext._validateEmulatedViewport(this._page.emulatedSize()?.viewport);
        await this._updateViewport();
      }
      async updateUserAgent() {
        const contextOptions = this._browserContext._options;
        this._updateState("Page.overrideUserAgent", { value: contextOptions.userAgent });
      }
      async bringToFront() {
        await this._pageProxySession.send("Target.activate", {
          targetId: this._session.sessionId
        });
      }
      async _updateViewport() {
        const options = this._browserContext._options;
        const emulatedSize = this._page.emulatedSize();
        if (!emulatedSize)
          return;
        const viewportSize = emulatedSize.viewport;
        const screenSize = emulatedSize.screen;
        const promises = [
          this._pageProxySession.send("Emulation.setDeviceMetricsOverride", {
            width: viewportSize.width,
            height: viewportSize.height,
            fixedLayout: !!options.isMobile,
            deviceScaleFactor: options.deviceScaleFactor || 1
          }),
          this._session.send("Page.setScreenSizeOverride", {
            width: screenSize.width,
            height: screenSize.height
          })
        ];
        if (options.isMobile) {
          const angle = viewportSize.width > viewportSize.height ? 90 : 0;
          promises.push(this._pageProxySession.send("Emulation.setOrientationOverride", { angle }));
        }
        await Promise.all(promises);
        if (!this._browserContext._browser?.options.headful && (hostPlatform === "ubuntu22.04-x64" || hostPlatform.startsWith("debian12")))
          await new Promise((r) => setTimeout(r, 500));
      }
      async updateRequestInterception() {
        const enabled = this._page.needsRequestInterception();
        await Promise.all([
          this._updateState("Network.setInterceptionEnabled", { enabled }),
          this._updateState("Network.setResourceCachingDisabled", { disabled: enabled }),
          this._updateState("Network.addInterception", { url: ".*", stage: "request", isRegex: true })
        ]);
      }
      async updateOffline() {
        await this._updateState("Network.setEmulateOfflineState", { offline: !!this._browserContext._options.offline });
      }
      async updateHttpCredentials() {
        const credentials = this._browserContext._options.httpCredentials || { username: "", password: "", origin: "" };
        await this._pageProxySession.send("Emulation.setAuthCredentials", { username: credentials.username, password: credentials.password, origin: credentials.origin });
      }
      async updateFileChooserInterception() {
        const enabled = this._page.fileChooserIntercepted();
        await this._session.send("Page.setInterceptFileChooserDialog", { enabled }).catch(() => {
        });
      }
      async reload() {
        await this._session.send("Page.reload");
      }
      goBack() {
        return this._session.send("Page.goBack").then(() => true).catch((error) => {
          if (error instanceof Error && error.message.includes(`Protocol error (Page.goBack): Failed to go`))
            return false;
          throw error;
        });
      }
      goForward() {
        return this._session.send("Page.goForward").then(() => true).catch((error) => {
          if (error instanceof Error && error.message.includes(`Protocol error (Page.goForward): Failed to go`))
            return false;
          throw error;
        });
      }
      async requestGC() {
        await this._session.send("Heap.gc");
      }
      async addInitScript(initScript) {
        await this._updateBootstrapScript();
      }
      async removeInitScripts(initScripts) {
        await this._updateBootstrapScript();
      }
      async exposePlaywrightBinding() {
        await this._updateState("Runtime.addBinding", { name: PageBinding.kBindingName });
      }
      _calculateBootstrapScript() {
        const scripts = [];
        if (!this._page.browserContext._options.isMobile) {
          scripts.push("delete window.orientation");
          scripts.push("delete window.ondevicemotion");
          scripts.push("delete window.ondeviceorientation");
        }
        scripts.push('if (!window.safari) window.safari = { pushNotification: { toString() { return "[object SafariRemoteNotification]"; } } };');
        scripts.push("if (!window.GestureEvent) window.GestureEvent = function GestureEvent() {};");
        scripts.push(this._publicKeyCredentialScript());
        scripts.push(...this._page.allInitScripts().map((script) => script.source));
        return scripts.join(";\n");
      }
      _publicKeyCredentialScript() {
        function polyfill() {
          window.PublicKeyCredential ??= {
            async getClientCapabilities() {
              return {};
            },
            async isConditionalMediationAvailable() {
              return false;
            },
            async isUserVerifyingPlatformAuthenticatorAvailable() {
              return false;
            }
          };
        }
        return `(${polyfill.toString()})();`;
      }
      async _updateBootstrapScript() {
        await this._updateState("Page.setBootstrapScript", { source: this._calculateBootstrapScript() });
      }
      async closePage(runBeforeUnload) {
        await this._pageProxySession.sendMayFail("Target.close", {
          targetId: this._session.sessionId,
          runBeforeUnload
        });
      }
      async setBackgroundColor(color) {
        await this._session.send("Page.setDefaultBackgroundColorOverride", { color });
      }
      _toolbarHeight() {
        if (this._page.browserContext._browser?.options.headful) {
          if (hostPlatform === "mac10.15")
            return 55;
          if (hostPlatform === "mac26-arm64" || hostPlatform === "mac26")
            return 69;
          return 59;
        }
        return 0;
      }
      validateScreenshotDimension(side, omitDeviceScaleFactor) {
        if (process.platform === "darwin")
          return;
        if (!omitDeviceScaleFactor && this._page.browserContext._options.deviceScaleFactor)
          side = Math.ceil(side * this._page.browserContext._options.deviceScaleFactor);
        if (side > 32767)
          throw new Error("Cannot take screenshot larger than 32767 pixels on any dimension");
      }
      async takeScreenshot(progress2, format2, documentRect, viewportRect, quality, fitsViewport, scale) {
        const rect = documentRect || viewportRect;
        const omitDeviceScaleFactor = scale === "css";
        this.validateScreenshotDimension(rect.width, omitDeviceScaleFactor);
        this.validateScreenshotDimension(rect.height, omitDeviceScaleFactor);
        const result2 = await progress2.race(this._session.send("Page.snapshotRect", { ...rect, coordinateSystem: documentRect ? "Page" : "Viewport", omitDeviceScaleFactor }));
        const prefix = "data:image/png;base64,";
        let buffer = Buffer.from(result2.dataURL.substr(prefix.length), "base64");
        if (format2 === "jpeg")
          buffer = jpegjs3.encode(PNG2.sync.read(buffer), quality).data;
        return buffer;
      }
      async getContentFrame(handle) {
        const nodeInfo = await this._session.send("DOM.describeNode", {
          objectId: handle._objectId
        });
        if (!nodeInfo.contentFrameId)
          return null;
        return this._page.frameManager.frame(nodeInfo.contentFrameId);
      }
      async getOwnerFrame(handle) {
        if (!handle._objectId)
          return null;
        const nodeInfo = await this._session.send("DOM.describeNode", {
          objectId: handle._objectId
        });
        return nodeInfo.ownerFrameId || null;
      }
      async getBoundingBox(handle) {
        const quads = await this.getContentQuads(handle);
        if (!quads || !quads.length)
          return null;
        let minX = Infinity;
        let maxX = -Infinity;
        let minY = Infinity;
        let maxY = -Infinity;
        for (const quad of quads) {
          for (const point of quad) {
            minX = Math.min(minX, point.x);
            maxX = Math.max(maxX, point.x);
            minY = Math.min(minY, point.y);
            maxY = Math.max(maxY, point.y);
          }
        }
        return { x: minX, y: minY, width: maxX - minX, height: maxY - minY };
      }
      async scrollRectIntoViewIfNeeded(handle, rect) {
        return await this._session.send("DOM.scrollIntoViewIfNeeded", {
          objectId: handle._objectId,
          rect
        }).then(() => "done").catch((e) => {
          if (e instanceof Error && e.message.includes("Node does not have a layout object"))
            return "error:notvisible";
          if (e instanceof Error && e.message.includes("Node is detached from document"))
            return "error:notconnected";
          throw e;
        });
      }
      startScreencast(options) {
        this._pageProxySession.send("Screencast.startScreencast", {
          quality: options.quality,
          width: options.width,
          height: options.height,
          toolbarHeight: this._toolbarHeight()
        }).then(({ generation }) => this._screencastGeneration = generation).catch(() => {
        });
      }
      stopScreencast() {
        this._pageProxySession.sendMayFail("Screencast.stopScreencast");
      }
      _onScreencastFrame(event) {
        const generation = this._screencastGeneration;
        const buffer = Buffer.from(event.data, "base64");
        this._page.screencast.onScreencastFrame({
          buffer,
          frameSwapWallTime: event.timestamp ? event.timestamp * 1e3 : Date.now(),
          viewportWidth: event.deviceWidth,
          viewportHeight: event.deviceHeight
        }, () => {
          this._pageProxySession.sendMayFail("Screencast.screencastFrameAck", { generation });
        });
      }
      rafCountForStablePosition() {
        return process.platform === "win32" ? 5 : 1;
      }
      async getContentQuads(handle) {
        const result2 = await this._session.sendMayFail("DOM.getContentQuads", {
          objectId: handle._objectId
        });
        if (!result2)
          return null;
        return result2.quads.map((quad) => [
          { x: quad[0], y: quad[1] },
          { x: quad[2], y: quad[3] },
          { x: quad[4], y: quad[5] },
          { x: quad[6], y: quad[7] }
        ]);
      }
      async setInputFilePaths(progress2, handle, paths) {
        const pageProxyId = this._pageProxySession.sessionId;
        const objectId = handle._objectId;
        if (this._browserContext._browser?.options.channel === "webkit-wsl")
          paths = await progress2.race(Promise.all(paths.map((path59) => translatePathToWSL(path59))));
        await progress2.race(Promise.all([
          this._pageProxySession.connection.browserSession.send("Playwright.grantFileReadAccess", { pageProxyId, paths }),
          this._session.send("DOM.setInputFiles", { objectId, paths })
        ]));
      }
      async adoptElementHandle(handle, to) {
        const result2 = await this._session.sendMayFail("DOM.resolveNode", {
          objectId: handle._objectId,
          executionContextId: to.delegate._contextId
        });
        if (!result2 || result2.object.subtype === "null")
          throw new Error(kUnableToAdoptErrorMessage);
        return createHandle4(to, result2.object);
      }
      async inputActionEpilogue() {
      }
      async resetForReuse(progress2) {
      }
      async getFrameElement(frame) {
        const parent = frame.parentFrame();
        if (!parent)
          throw new Error("Frame has been detached.");
        const context2 = await parent.mainContext();
        const result2 = await this._session.send("DOM.resolveNode", {
          frameId: frame._id,
          executionContextId: context2.delegate._contextId
        });
        if (!result2 || result2.object.subtype === "null")
          throw new Error("Frame has been detached.");
        return createHandle4(context2, result2.object);
      }
      _maybeCancelCoopNavigationRequest(provisionalPage) {
        const navigationRequest = provisionalPage.coopNavigationRequest();
        for (const [requestId, request2] of this._requestIdToRequest) {
          if (request2.request === navigationRequest) {
            this._onLoadingFailed(provisionalPage._session, {
              requestId,
              errorText: "Provisiolal navigation canceled.",
              timestamp: request2._timestamp,
              canceled: true
            });
            return;
          }
        }
      }
      _adoptRequestFromNewProcess(navigationRequest, newSession, newRequestId) {
        for (const [requestId, request2] of this._requestIdToRequest) {
          if (request2.request === navigationRequest) {
            this._requestIdToRequest.delete(requestId);
            request2.adoptRequestFromNewProcess(newSession, newRequestId);
            this._requestIdToRequest.set(newRequestId, request2);
            return;
          }
        }
      }
      _onRequestWillBeSent(session2, event) {
        if (event.request.url.startsWith("data:"))
          return;
        if (event.request.url.startsWith("about:"))
          return;
        if (this._page.needsRequestInterception() && !event.redirectResponse)
          this._requestIdToRequestWillBeSentEvent.set(event.requestId, event);
        else
          this._onRequest(session2, event, false);
      }
      _onRequest(session2, event, intercepted) {
        let redirectedFrom = null;
        if (event.redirectResponse) {
          const request3 = this._requestIdToRequest.get(event.requestId);
          if (request3) {
            this._handleRequestRedirect(request3, event.requestId, event.redirectResponse, event.timestamp);
            redirectedFrom = request3;
          }
        }
        const frame = redirectedFrom ? redirectedFrom.request.frame() : this._page.frameManager.frame(event.frameId);
        if (!frame)
          return;
        const isNavigationRequest = event.type === "Document";
        const documentId = isNavigationRequest ? event.loaderId : void 0;
        const request2 = new WKInterceptableRequest(session2, frame, event, redirectedFrom, documentId);
        let route2;
        if (intercepted) {
          route2 = new WKRouteImpl(session2, event.requestId);
          request2.request.setRawRequestHeaders(null);
        }
        this._requestIdToRequest.set(event.requestId, request2);
        this._page.frameManager.requestStarted(request2.request, route2);
      }
      _handleRequestRedirect(request2, requestId, responsePayload, timestamp) {
        const response2 = request2.createResponse(responsePayload);
        response2._setHttpVersion(null);
        response2._securityDetailsFinished();
        response2._serverAddrFinished();
        response2.setResponseHeadersSize(null);
        response2.setEncodedBodySize(null);
        response2._requestFinished(responsePayload.timing ? helper.secondsToRoundishMillis(timestamp - request2._timestamp) : -1);
        this._requestIdToRequest.delete(requestId);
        this._page.frameManager.requestReceivedResponse(response2);
        this._page.frameManager.reportRequestFinished(request2.request, response2);
      }
      _onRequestIntercepted(session2, event) {
        const requestWillBeSentEvent = this._requestIdToRequestWillBeSentEvent.get(event.requestId);
        if (!requestWillBeSentEvent) {
          session2.sendMayFail("Network.interceptWithRequest", { requestId: event.requestId });
          return;
        }
        this._requestIdToRequestWillBeSentEvent.delete(event.requestId);
        this._onRequest(session2, requestWillBeSentEvent, true);
      }
      _onResponseReceived(session2, event) {
        const requestWillBeSentEvent = this._requestIdToRequestWillBeSentEvent.get(event.requestId);
        if (requestWillBeSentEvent) {
          this._requestIdToRequestWillBeSentEvent.delete(event.requestId);
          this._onRequest(session2, requestWillBeSentEvent, false);
        }
        const request2 = this._requestIdToRequest.get(event.requestId);
        if (!request2)
          return;
        this._requestIdToResponseReceivedPayloadEvent.set(event.requestId, event);
        const response2 = request2.createResponse(event.response);
        this._page.frameManager.requestReceivedResponse(response2);
        if (response2.status() === 204 && request2.request.isNavigationRequest()) {
          this._onLoadingFailed(session2, {
            requestId: event.requestId,
            errorText: "Aborted: 204 No Content",
            timestamp: event.timestamp
          });
        }
      }
      _onLoadingFinished(event) {
        const request2 = this._requestIdToRequest.get(event.requestId);
        if (!request2)
          return;
        const response2 = request2.request._existingResponse();
        if (response2) {
          const responseReceivedPayload = this._requestIdToResponseReceivedPayloadEvent.get(event.requestId);
          response2._serverAddrFinished(parseRemoteAddress(event?.metrics?.remoteAddress));
          response2._securityDetailsFinished({
            protocol: isLoadedSecurely(response2.url(), response2.timing()) ? event.metrics?.securityConnection?.protocol : void 0,
            subjectName: responseReceivedPayload?.response.security?.certificate?.subject,
            validFrom: responseReceivedPayload?.response.security?.certificate?.validFrom,
            validTo: responseReceivedPayload?.response.security?.certificate?.validUntil
          });
          response2._setHttpVersion(event.metrics?.protocol ?? null);
          response2.setEncodedBodySize(event.metrics?.responseBodyBytesReceived ?? null);
          response2.setResponseHeadersSize(event.metrics?.responseHeaderBytesReceived ?? null);
          response2._requestFinished(helper.secondsToRoundishMillis(event.timestamp - request2._timestamp));
        } else {
          request2.request.setRawRequestHeaders(null);
        }
        this._requestIdToResponseReceivedPayloadEvent.delete(event.requestId);
        this._requestIdToRequest.delete(event.requestId);
        this._page.frameManager.reportRequestFinished(request2.request, response2);
      }
      _onLoadingFailed(session2, event) {
        const requestWillBeSentEvent = this._requestIdToRequestWillBeSentEvent.get(event.requestId);
        if (requestWillBeSentEvent) {
          this._requestIdToRequestWillBeSentEvent.delete(event.requestId);
          this._onRequest(session2, requestWillBeSentEvent, false);
        }
        const request2 = this._requestIdToRequest.get(event.requestId);
        if (!request2)
          return;
        const response2 = request2.request._existingResponse();
        if (response2) {
          response2._serverAddrFinished();
          response2._securityDetailsFinished();
          response2._setHttpVersion(null);
          response2.setResponseHeadersSize(null);
          response2.setEncodedBodySize(null);
          response2._requestFinished(helper.secondsToRoundishMillis(event.timestamp - request2._timestamp));
        } else {
          request2.request.setRawRequestHeaders(null);
        }
        this._requestIdToRequest.delete(event.requestId);
        request2.request._setFailureText(event.errorText);
        this._page.frameManager.requestFailed(request2.request, event.errorText.includes("cancelled"));
      }
      _onWebSocketWillSendHandshakeRequest(event) {
        const wallTimeMs = event.walltime * 1e3;
        this._timestampBaselineForWebSocket.set(event.requestId, wallTimeMs - event.timestamp * 1e3);
        this._page.frameManager.onWebSocketRequest(event.requestId, headersObjectToArray(event.request.headers), wallTimeMs);
      }
      _onWebSocketClosed(event) {
        this._timestampBaselineForWebSocket.delete(event.requestId);
        this._page.frameManager.webSocketClosed(event.requestId);
      }
      _timestampToWallTimeMsForWebSocket(requestId, timestamp) {
        return this._timestampBaselineForWebSocket.get(requestId) + timestamp * 1e3;
      }
      async _grantPermissions(origin, permissions) {
        const webPermissionToProtocol = /* @__PURE__ */ new Map([
          ["geolocation", "geolocation"],
          ["notifications", "notifications"],
          ["clipboard-read", "clipboard-read"],
          ["screen-wake-lock", "screen-wake-lock"]
        ]);
        const filtered = permissions.map((permission) => {
          const protocolPermission = webPermissionToProtocol.get(permission);
          if (!protocolPermission)
            throw new Error("Unknown permission: " + permission);
          return protocolPermission;
        });
        await this._pageProxySession.send("Emulation.grantPermissions", { origin, permissions: filtered });
      }
      async _clearPermissions() {
        await this._pageProxySession.send("Emulation.resetPermissions", {});
      }
      shouldToggleStyleSheetToSyncAnimations() {
        return true;
      }
      async setDockTile(image) {
      }
    };
    WKFrame = class {
      constructor(page, session2) {
        this._sessionListeners = [];
        this._initializePromise = null;
        this._page = page;
        this._session = session2;
      }
      async initialize() {
        if (this._initializePromise)
          return this._initializePromise;
        this._initializePromise = this._initializeImpl();
        return this._initializePromise;
      }
      async _initializeImpl() {
        this._sessionListeners = [
          eventsHelper.addEventListener(this._session, "Console.messageAdded", (event) => this._page._onConsoleMessage(event)),
          eventsHelper.addEventListener(this._session, "Console.messageRepeatCountUpdated", (event) => this._page._onConsoleRepeatCountUpdated(event))
        ];
        await this._session.send("Console.enable");
      }
      dispose() {
        eventsHelper.removeEventListeners(this._sessionListeners);
        this._session.dispose();
      }
    };
  }
});

// packages/playwright-core/src/server/webkit/wkBrowser.ts
var BROWSER_VERSION, DEFAULT_USER_AGENT, WKBrowser, WKBrowserContext;
var init_wkBrowser = __esm({
  "packages/playwright-core/src/server/webkit/wkBrowser.ts"() {
    "use strict";
    init_assert();
    init_browser();
    init_browserContext();
    init_network2();
    init_wkConnection();
    init_wkPage();
    init_webkit();
    BROWSER_VERSION = "26.5";
    DEFAULT_USER_AGENT = `Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/${BROWSER_VERSION} Safari/605.1.15`;
    WKBrowser = class _WKBrowser extends Browser {
      constructor(parent, transport, options) {
        super(parent, options);
        this._contexts = /* @__PURE__ */ new Map();
        this._wkPages = /* @__PURE__ */ new Map();
        this._connection = new WKConnection(transport, this._onDisconnect.bind(this), options.protocolLogger, options.browserLogsCollector);
        this._browserSession = this._connection.browserSession;
        this._browserSession.on("Playwright.pageProxyCreated", this._onPageProxyCreated.bind(this));
        this._browserSession.on("Playwright.pageProxyDestroyed", this._onPageProxyDestroyed.bind(this));
        this._browserSession.on("Playwright.provisionalLoadFailed", (event) => this._onProvisionalLoadFailed(event));
        this._browserSession.on("Playwright.windowOpen", (event) => this._onWindowOpen(event));
        this._browserSession.on("Playwright.downloadCreated", this._onDownloadCreated.bind(this));
        this._browserSession.on("Playwright.downloadFilenameSuggested", this._onDownloadFilenameSuggested.bind(this));
        this._browserSession.on("Playwright.downloadFinished", this._onDownloadFinished.bind(this));
        this._browserSession.on(kPageProxyMessageReceived, this._onPageProxyMessageReceived.bind(this));
      }
      static async connect(parent, transport, options) {
        const browser = new _WKBrowser(parent, transport, options);
        if (options.__testHookOnConnectToBrowser)
          await options.__testHookOnConnectToBrowser();
        const promises = [
          browser._browserSession.send("Playwright.enable")
        ];
        if (options.persistent) {
          options.persistent.userAgent ||= DEFAULT_USER_AGENT;
          browser._defaultContext = new WKBrowserContext(browser, void 0, options.persistent);
          promises.push(browser._defaultContext.initialize());
        }
        await Promise.all(promises);
        return browser;
      }
      _onDisconnect() {
        for (const wkPage of this._wkPages.values())
          wkPage.didClose();
        this._wkPages.clear();
        this.didClose();
      }
      async doCreateNewContext(options) {
        const proxy = options.proxyOverride || options.proxy;
        const createOptions = proxy ? {
          // Enable socks5 hostname resolution on Windows.
          // See https://github.com/microsoft/playwright/issues/20451
          proxyServer: process.platform === "win32" && this.attribution.browser?.options.channel !== "webkit-wsl" ? proxy.server.replace(/^socks5:\/\//, "socks5h://") : proxy.server,
          proxyBypassList: proxy.bypass
        } : void 0;
        const { browserContextId } = await this._browserSession.send("Playwright.createContext", createOptions);
        options.userAgent = options.userAgent || DEFAULT_USER_AGENT;
        const context2 = new WKBrowserContext(this, browserContextId, options);
        await context2.initialize();
        this._contexts.set(browserContextId, context2);
        return context2;
      }
      contexts() {
        return Array.from(this._contexts.values());
      }
      version() {
        return BROWSER_VERSION;
      }
      userAgent() {
        return DEFAULT_USER_AGENT;
      }
      _onDownloadCreated(payload) {
        const page = this._wkPages.get(payload.pageProxyId);
        if (!page)
          return;
        let frameId = payload.frameId;
        if (!page._page.frameManager.frame(frameId))
          frameId = page._page.mainFrame()._id;
        page._page.frameManager.frameAbortedNavigation(frameId, "Download is starting");
        let originPage = page._page.initializedOrUndefined();
        if (!originPage) {
          page._firstNonInitialNavigationCommittedReject(new Error("Starting new page download"));
          if (page._opener)
            originPage = page._opener._page.initializedOrUndefined();
        }
        if (!originPage)
          return;
        this.downloadCreated(originPage, payload.uuid, payload.url);
      }
      _onDownloadFilenameSuggested(payload) {
        this.downloadFilenameSuggested(payload.uuid, payload.suggestedFilename);
      }
      _onDownloadFinished(payload) {
        this.downloadFinished(payload.uuid, payload.error);
      }
      _onPageProxyCreated(event) {
        const pageProxyId = event.pageProxyId;
        let context2 = null;
        if (event.browserContextId) {
          context2 = this._contexts.get(event.browserContextId) || null;
        }
        if (!context2)
          context2 = this._defaultContext;
        if (!context2)
          return;
        const pageProxySession = new WKSession(this._connection, pageProxyId, (message) => {
          this._connection.rawSend({ ...message, pageProxyId });
        });
        const opener = event.openerId ? this._wkPages.get(event.openerId) : void 0;
        const wkPage = new WKPage(context2, pageProxySession, opener || null);
        this._wkPages.set(pageProxyId, wkPage);
      }
      _onPageProxyDestroyed(event) {
        const pageProxyId = event.pageProxyId;
        const wkPage = this._wkPages.get(pageProxyId);
        if (!wkPage)
          return;
        this._wkPages.delete(pageProxyId);
        wkPage.didClose();
      }
      _onPageProxyMessageReceived(event) {
        const wkPage = this._wkPages.get(event.pageProxyId);
        if (!wkPage)
          return;
        wkPage.dispatchMessageToSession(event.message);
      }
      _onProvisionalLoadFailed(event) {
        const wkPage = this._wkPages.get(event.pageProxyId);
        if (!wkPage)
          return;
        wkPage.handleProvisionalLoadFailed(event);
      }
      _onWindowOpen(event) {
        const wkPage = this._wkPages.get(event.pageProxyId);
        if (!wkPage)
          return;
        wkPage.handleWindowOpen(event);
      }
      isConnected() {
        return !this._connection.isClosed();
      }
    };
    WKBrowserContext = class extends BrowserContext {
      constructor(browser, browserContextId, options) {
        super(browser, options, browserContextId);
        this._validateEmulatedViewport(options.viewport);
        this.authenticateProxyViaHeader();
      }
      async initialize() {
        assert(!this._wkPages().length);
        const browserContextId = this._browserContextId;
        const promises = [super.initialize()];
        promises.push(this._browser._browserSession.send("Playwright.setDownloadBehavior", {
          behavior: this._options.acceptDownloads === "accept" ? "allow" : "deny",
          downloadPath: this._browser.options.channel === "webkit-wsl" ? await translatePathToWSL(this._browser.options.downloadsPath) : this._browser.options.downloadsPath,
          browserContextId
        }));
        if (this._options.ignoreHTTPSErrors || this._options.internalIgnoreHTTPSErrors)
          promises.push(this._browser._browserSession.send("Playwright.setIgnoreCertificateErrors", { browserContextId, ignore: true }));
        if (this._options.locale)
          promises.push(this._browser._browserSession.send("Playwright.setLanguages", { browserContextId, languages: [this._options.locale] }));
        if (this._options.geolocation)
          promises.push(this.setGeolocation(this._options.geolocation));
        if (this._options.offline)
          promises.push(this.doUpdateOffline());
        if (this._options.httpCredentials)
          promises.push(this.innerSetHTTPCredentials(this._options.httpCredentials));
        await Promise.all(promises);
      }
      _wkPages() {
        return Array.from(this._browser._wkPages.values()).filter((wkPage) => wkPage._browserContext === this);
      }
      possiblyUninitializedPages() {
        return this._wkPages().map((wkPage) => wkPage._page);
      }
      async doCreateNewPage() {
        const { pageProxyId } = await this._browser._browserSession.send("Playwright.createPage", { browserContextId: this._browserContextId });
        return this._browser._wkPages.get(pageProxyId)._page;
      }
      async doGetCookies(urls) {
        const { cookies } = await this._browser._browserSession.send("Playwright.getAllCookies", { browserContextId: this._browserContextId });
        return filterCookies(cookies.map((c) => {
          const { name, value: value2, domain, path: path59, expires, httpOnly, secure, sameSite } = c;
          const copy = {
            name,
            value: value2,
            domain,
            path: path59,
            expires: expires === -1 ? -1 : expires / 1e3,
            httpOnly,
            secure,
            sameSite
          };
          return copy;
        }), urls);
      }
      async addCookies(cookies) {
        const cc = rewriteCookies(cookies).map((c) => {
          const { name, value: value2, domain, path: path59, expires, httpOnly, secure, sameSite } = c;
          const copy = {
            name,
            value: value2,
            domain,
            path: path59,
            expires: expires && expires !== -1 ? expires * 1e3 : expires,
            httpOnly,
            secure,
            sameSite,
            session: expires === -1 || expires === void 0
          };
          return copy;
        });
        await this._browser._browserSession.send("Playwright.setCookies", { cookies: cc, browserContextId: this._browserContextId });
      }
      async doClearCookies() {
        await this._browser._browserSession.send("Playwright.deleteAllCookies", { browserContextId: this._browserContextId });
      }
      async doGrantPermissions(origin, permissions) {
        await Promise.all(this.pages().map((page) => page.delegate._grantPermissions(origin, permissions)));
      }
      async doClearPermissions() {
        await Promise.all(this.pages().map((page) => page.delegate._clearPermissions()));
      }
      async setGeolocation(geolocation) {
        verifyGeolocation(geolocation);
        this._options.geolocation = geolocation;
        const payload = geolocation ? { ...geolocation, timestamp: Date.now() } : void 0;
        await this._browser._browserSession.send("Playwright.setGeolocationOverride", { browserContextId: this._browserContextId, geolocation: payload });
      }
      async doUpdateExtraHTTPHeaders() {
        for (const page of this.pages())
          await page.delegate.updateExtraHTTPHeaders();
      }
      async setUserAgent(userAgent) {
        this._options.userAgent = userAgent;
        for (const page of this.pages())
          await page.delegate.updateUserAgent();
      }
      async doUpdateOffline() {
        for (const page of this.pages())
          await page.delegate.updateOffline();
      }
      async doSetHTTPCredentials(httpCredentials) {
        this._options.httpCredentials = httpCredentials;
        for (const page of this.pages())
          await page.delegate.updateHttpCredentials();
      }
      async doAddInitScript(initScript) {
        for (const page of this.pages())
          await page.delegate._updateBootstrapScript();
      }
      async doRemoveInitScripts(initScripts) {
        for (const page of this.pages())
          await page.delegate._updateBootstrapScript();
      }
      async doUpdateRequestInterception() {
        for (const page of this.pages())
          await page.delegate.updateRequestInterception();
      }
      async doUpdateDefaultViewport() {
      }
      async doUpdateDefaultEmulatedMedia() {
      }
      async doExposePlaywrightBinding() {
        for (const page of this.pages())
          await page.delegate.exposePlaywrightBinding();
      }
      onClosePersistent() {
      }
      async clearCache() {
        await this._browser._browserSession.send("Playwright.clearMemoryCache", {
          browserContextId: this._browserContextId
        });
      }
      async doClose(reason) {
        if (!this._browserContextId) {
          return "close-browser";
        } else {
          await this._browser._browserSession.send("Playwright.deleteContext", { browserContextId: this._browserContextId });
          this._browser._contexts.delete(this._browserContextId);
        }
      }
      async cancelDownload(uuid) {
        await this._browser._browserSession.send("Playwright.cancelDownload", { uuid });
      }
      _validateEmulatedViewport(viewportSize) {
        if (!viewportSize)
          return;
        if (process.platform === "win32" && this._browser.options.headful && (viewportSize.width < 250 || viewportSize.height < 240))
          throw new Error(`WebKit on Windows has a minimal viewport of 250x240.`);
      }
    };
  }
});

// packages/playwright-core/src/server/webkit/webview/dialogBridge.ts
var DialogBridge;
var init_dialogBridge = __esm({
  "packages/playwright-core/src/server/webkit/webview/dialogBridge.ts"() {
    "use strict";
    init_debugLogger();
    init_network();
    DialogBridge = class _DialogBridge {
      constructor(server, baseUrl) {
        this._handlers = /* @__PURE__ */ new Map();
        this._server = server;
        this._baseUrl = baseUrl;
        this._server.on("request", (req, res) => this._handleRequest(req, res));
      }
      static async start() {
        const server = createHttpServer();
        await new Promise((resolve, reject) => {
          server.once("error", reject);
          server.listen(0, "127.0.0.1", () => {
            server.removeListener("error", reject);
            resolve();
          });
        });
        const address = server.address();
        if (!address || typeof address === "string")
          throw new Error("DialogBridge: failed to bind HTTP server");
        return new _DialogBridge(server, `http://127.0.0.1:${address.port}`);
      }
      endpointFor(pageId4) {
        return `${this._baseUrl}/dialog?tab=${encodeURIComponent(pageId4)}`;
      }
      registerTab(pageId4, handler) {
        this._handlers.set(pageId4, handler);
      }
      unregisterTab(pageId4) {
        this._handlers.delete(pageId4);
      }
      async close() {
        this._handlers.clear();
        await new Promise((resolve) => this._server.close(() => resolve()));
      }
      _writeCorsHeaders(res) {
        res.setHeader("Access-Control-Allow-Origin", "*");
        res.setHeader("Access-Control-Allow-Methods", "POST, OPTIONS");
        res.setHeader("Access-Control-Allow-Headers", "content-type");
      }
      async _handleRequest(req, res) {
        this._writeCorsHeaders(res);
        if (req.method === "OPTIONS") {
          res.statusCode = 204;
          res.end();
          return;
        }
        const url2 = new URL(req.url || "/", this._baseUrl);
        if (!(req.method === "POST" && url2.pathname === "/dialog")) {
          res.statusCode = 404;
          res.end();
          return;
        }
        const tab2 = url2.searchParams.get("tab") || "";
        const handler = this._handlers.get(tab2);
        if (!handler) {
          res.statusCode = 404;
          res.end();
          return;
        }
        let body = "";
        req.setEncoding("utf8");
        req.on("data", (chunk) => {
          body += chunk;
        });
        req.on("end", async () => {
          let parsed;
          try {
            const json = JSON.parse(body);
            if (json.type !== "alert" && json.type !== "confirm" && json.type !== "prompt")
              throw new Error(`Invalid dialog type: ${json.type}`);
            parsed = {
              type: json.type,
              message: typeof json.message === "string" ? json.message : "",
              defaultValue: typeof json.defaultValue === "string" ? json.defaultValue : ""
            };
          } catch (e) {
            debugLogger.log("error", `DialogBridge: bad request body: ${e.message}`);
            res.statusCode = 400;
            res.end();
            return;
          }
          try {
            const result2 = await handler(parsed);
            res.statusCode = 200;
            res.setHeader("Content-Type", "application/json");
            res.end(JSON.stringify({
              accept: !!result2.accept,
              promptText: result2.promptText
            }));
          } catch (e) {
            debugLogger.log("error", `DialogBridge: handler error: ${e.message}`);
            res.statusCode = 500;
            res.end();
          }
        });
      }
    };
  }
});

// packages/playwright-core/src/server/webkit/webview/wvConnection.ts
var import_events12, WVConnection, WVSession;
var init_wvConnection = __esm({
  "packages/playwright-core/src/server/webkit/webview/wvConnection.ts"() {
    "use strict";
    import_events12 = require("events");
    init_debugLogger();
    init_assert();
    init_helper();
    init_protocolError();
    WVConnection = class {
      constructor(transport, onDisconnect, protocolLogger, browserLogsCollector) {
        this._lastId = 0;
        this._closed = false;
        this._transport = transport;
        this._onDisconnect = onDisconnect;
        this._protocolLogger = protocolLogger;
        this._browserLogsCollector = browserLogsCollector;
        this.outerSession = new WVSession(this, "", (message) => {
          this.rawSend(message);
        });
        this._transport.onmessage = this._dispatchMessage.bind(this);
        this._transport.onclose = this._onClose.bind(this);
      }
      nextMessageId() {
        return ++this._lastId;
      }
      rawSend(message) {
        this._protocolLogger("send", message);
        this._transport.send(message);
      }
      _dispatchMessage(message) {
        this._protocolLogger("receive", message);
        this.outerSession.dispatchMessage(message);
      }
      _onClose(reason) {
        this._closed = true;
        this._transport.onmessage = void 0;
        this._transport.onclose = void 0;
        this._browserDisconnectedLogs = helper.formatBrowserLogs(this._browserLogsCollector.recentLogs(), reason);
        this.outerSession.dispose();
        this._onDisconnect();
      }
      isClosed() {
        return this._closed;
      }
      close() {
        if (!this._closed)
          this._transport.close();
      }
    };
    WVSession = class extends import_events12.EventEmitter {
      constructor(connection, sessionId, rawSend) {
        super();
        this._disposed = false;
        this._callbacks = /* @__PURE__ */ new Map();
        this._crashed = false;
        this.setMaxListeners(0);
        this.connection = connection;
        this.sessionId = sessionId;
        this._rawSend = rawSend;
      }
      async send(method, params2) {
        if (this._crashed || this._disposed || this.connection._browserDisconnectedLogs)
          throw new ProtocolError(this._crashed ? "crashed" : "closed", void 0, this.connection._browserDisconnectedLogs);
        const id = this.connection.nextMessageId();
        const messageObj = { id, method, params: params2 };
        this._rawSend(messageObj);
        return new Promise((resolve, reject) => {
          this._callbacks.set(id, { resolve, reject, error: new ProtocolError("error", method) });
        });
      }
      sendMayFail(method, params2) {
        return this.send(method, params2).catch((error) => debugLogger.log("error", error));
      }
      markAsCrashed() {
        this._crashed = true;
      }
      isDisposed() {
        return this._disposed;
      }
      dispose() {
        for (const callback of this._callbacks.values()) {
          callback.error.type = this._crashed ? "crashed" : "closed";
          callback.error.logs = this.connection._browserDisconnectedLogs;
          callback.reject(callback.error);
        }
        this._callbacks.clear();
        this._disposed = true;
      }
      dispatchMessage(object) {
        if (object.id && this._callbacks.has(object.id)) {
          const callback = this._callbacks.get(object.id);
          this._callbacks.delete(object.id);
          if (object.error) {
            callback.error.setMessage(object.error.message);
            callback.reject(callback.error);
          } else {
            callback.resolve(object.result);
          }
        } else if (object.id && !object.error) {
          assert(this.isDisposed(), JSON.stringify(object));
        } else {
          Promise.resolve().then(() => this.emit(object.method, object.params));
        }
      }
    };
  }
});

// packages/playwright-core/src/generated/webViewInputSource.ts
var source7;
var init_webViewInputSource = __esm({
  "packages/playwright-core/src/generated/webViewInputSource.ts"() {
    "use strict";
    source7 = `
var __commonJS = obj => {
  let required = false;
  let result;
  return function __require() {
    if (!required) {
      required = true;
      let fn;
      for (const name in obj) { fn = obj[name]; break; }
      const module = { exports: {} };
      fn(module.exports, module);
      result = module.exports;
    }
    return result;
  }
};
var __export = (target, all) => {for (var name in all) target[name] = all[name];};
var __toESM = mod => ({ ...mod, 'default': mod });
var __toCommonJS = mod => ({ ...mod, __esModule: true });


// packages/injected/src/webview/webViewInput.ts
var webViewInput_exports = {};
__export(webViewInput_exports, {
  WebViewInput: () => WebViewInput,
  default: () => webViewInput_default
});
module.exports = __toCommonJS(webViewInput_exports);
var kTrustedSynthetic = "__pwTrustedSynthetic";
function markAndDispatch(node, event) {
  Object.defineProperty(event, kTrustedSynthetic, { value: true });
  return node.dispatchEvent(event);
}
var kNamedKeyIdentifiers = {
  8: "U+0008",
  // Backspace
  9: "U+0009",
  // Tab
  13: "Enter",
  16: "Shift",
  17: "Control",
  18: "Alt",
  27: "U+001B",
  // Escape
  33: "PageUp",
  34: "PageDown",
  35: "End",
  36: "Home",
  37: "Left",
  38: "Up",
  39: "Right",
  40: "Down",
  45: "Insert",
  46: "U+007F"
  // Delete
};
function keyIdentifierFor(keyCode, key) {
  const named = kNamedKeyIdentifiers[keyCode];
  if (named !== void 0)
    return named;
  if (keyCode >= 112 && keyCode <= 135)
    return "F" + (keyCode - 111);
  if (key.length === 1)
    return "U+" + key.toUpperCase().charCodeAt(0).toString(16).toUpperCase().padStart(4, "0");
  return "";
}
function dispatchKeyEvent(node, type, init, keyCode, key) {
  const event = new KeyboardEvent(type, init);
  Object.defineProperty(event, "keyIdentifier", { value: keyIdentifierFor(keyCode, key), configurable: true });
  return markAndDispatch(node, event);
}
var WebViewInput = class {
  constructor(window, document) {
    this._hoverTarget = null;
    this._window = window;
    this._document = document;
    this._setTimeout = (window.__pwSnapshotGlobals || window).setTimeout;
  }
  // Run each event in its own task (like real input).
  _postTask(task) {
    return new Promise((resolve) => {
      this._setTimeout.call(this._window, () => {
        try {
          task();
        } finally {
          resolve();
        }
      });
    });
  }
  // Descend through open shadow roots so synthetic events land on the actual
  // element under the pointer rather than on the shadow host.
  _deepElementFromPoint(x, y) {
    let el = this._document.elementFromPoint(x, y);
    while (el && el.shadowRoot) {
      const inner = el.shadowRoot.elementFromPoint(x, y);
      if (!inner || inner === el)
        break;
      el = inner;
    }
    return el;
  }
  // The focused element may live inside one or more shadow roots, where
  // document.activeElement only reports the outermost shadow host.
  _deepActiveElement() {
    let active = this._document.activeElement;
    while (active && active.shadowRoot && active.shadowRoot.activeElement)
      active = active.shadowRoot.activeElement;
    return active;
  }
  _insertText(target, text) {
    var _a, _b;
    if (target instanceof HTMLInputElement || target instanceof HTMLTextAreaElement) {
      const start = (_a = target.selectionStart) != null ? _a : target.value.length;
      const end = (_b = target.selectionEnd) != null ? _b : target.value.length;
      target.value = target.value.slice(0, start) + text + target.value.slice(end);
      const pos = start + text.length;
      try {
        target.setSelectionRange(pos, pos);
      } catch {
      }
      target.dispatchEvent(new InputEvent("input", { bubbles: true, cancelable: false, data: text, inputType: "insertText" }));
    } else if (target && target.isContentEditable) {
      this._document.execCommand("insertText", false, text);
    }
  }
  keydown(params) {
    const target = this._deepActiveElement() || this._document.body;
    if (!target)
      return Promise.resolve();
    const init = {
      bubbles: true,
      cancelable: true,
      view: this._window,
      code: params.code,
      key: params.key,
      keyCode: params.keyCode,
      which: params.keyCode,
      location: params.location,
      repeat: params.repeat,
      ctrlKey: params.ctrlKey,
      shiftKey: params.shiftKey,
      altKey: params.altKey,
      metaKey: params.metaKey
    };
    let notPrevented = true;
    let charNotPrevented = true;
    let lastTask = this._postTask(() => {
      notPrevented = dispatchKeyEvent(target, "keydown", init, params.keyCode, params.key);
    });
    if (params.text !== void 0) {
      const text = params.text;
      void this._postTask(() => {
        if (!notPrevented)
          return;
        const charCode = text.charCodeAt(0);
        charNotPrevented = markAndDispatch(target, new KeyboardEvent("keypress", { ...init, charCode, keyCode: charCode, which: charCode }));
      });
      lastTask = this._postTask(() => {
        if (!notPrevented || !charNotPrevented)
          return;
        this._dispatchTextInput(target, text === "\\r" ? "\\n" : text);
      });
    }
    return lastTask;
  }
  _dispatchTextInput(target, text) {
    const event = this._document.createEvent("TextEvent");
    event.initTextEvent("textInput", true, true, this._window, text);
    markAndDispatch(target, event);
  }
  keyup(params) {
    const target = this._deepActiveElement() || this._document.body;
    if (!target)
      return Promise.resolve();
    return this._postTask(() => {
      dispatchKeyEvent(target, "keyup", {
        bubbles: true,
        cancelable: true,
        view: this._window,
        code: params.code,
        key: params.key,
        keyCode: params.keyCode,
        which: params.keyCode,
        location: params.location,
        ctrlKey: params.ctrlKey,
        shiftKey: params.shiftKey,
        altKey: params.altKey,
        metaKey: params.metaKey
      }, params.keyCode, params.key);
    });
  }
  insertText(text) {
    return this._postTask(() => this._insertText(this._deepActiveElement(), text));
  }
  mouseMove(params) {
    const target = this._deepElementFromPoint(params.x, params.y) || this._document.documentElement;
    const base = {
      bubbles: true,
      cancelable: true,
      view: this._window,
      clientX: params.x,
      clientY: params.y,
      screenX: params.x,
      screenY: params.y,
      button: params.button,
      buttons: params.buttons,
      ctrlKey: params.ctrlKey,
      shiftKey: params.shiftKey,
      altKey: params.altKey,
      metaKey: params.metaKey
    };
    const pointer = { ...base, pointerId: 1, pointerType: "mouse", isPrimary: true };
    const prev = this._hoverTarget;
    if (prev !== target) {
      if (prev && prev.isConnected) {
        void this._postTask(() => markAndDispatch(prev, new PointerEvent("pointerout", { ...pointer, relatedTarget: target })));
        void this._postTask(() => markAndDispatch(prev, new MouseEvent("mouseout", { ...base, relatedTarget: target })));
        void this._postTask(() => markAndDispatch(prev, new PointerEvent("pointerleave", { ...pointer, bubbles: false, cancelable: false, relatedTarget: target })));
        void this._postTask(() => markAndDispatch(prev, new MouseEvent("mouseleave", { ...base, bubbles: false, cancelable: false, relatedTarget: target })));
      }
      void this._postTask(() => markAndDispatch(target, new PointerEvent("pointerover", { ...pointer, relatedTarget: prev })));
      void this._postTask(() => markAndDispatch(target, new MouseEvent("mouseover", { ...base, relatedTarget: prev })));
      void this._postTask(() => markAndDispatch(target, new PointerEvent("pointerenter", { ...pointer, bubbles: false, cancelable: false, relatedTarget: prev })));
      void this._postTask(() => markAndDispatch(target, new MouseEvent("mouseenter", { ...base, bubbles: false, cancelable: false, relatedTarget: prev })));
      this._hoverTarget = target;
    }
    void this._postTask(() => markAndDispatch(target, new PointerEvent("pointermove", pointer)));
    return this._postTask(() => markAndDispatch(target, new MouseEvent("mousemove", base)));
  }
  mouseEvent(params) {
    return this._postTask(() => {
      const target = this._deepElementFromPoint(params.x, params.y) || this._document.documentElement;
      markAndDispatch(target, new MouseEvent(params.type, {
        bubbles: true,
        cancelable: true,
        view: this._window,
        clientX: params.x,
        clientY: params.y,
        screenX: params.x,
        screenY: params.y,
        button: params.button,
        buttons: params.buttons,
        detail: params.clickCount,
        ctrlKey: params.ctrlKey,
        shiftKey: params.shiftKey,
        altKey: params.altKey,
        metaKey: params.metaKey
      }));
    });
  }
  wheel(params) {
    return this._postTask(() => {
      const target = this._deepElementFromPoint(params.x, params.y) || this._document.documentElement;
      markAndDispatch(target, new WheelEvent("wheel", {
        bubbles: true,
        cancelable: true,
        view: this._window,
        clientX: params.x,
        clientY: params.y,
        screenX: params.x,
        screenY: params.y,
        deltaX: params.deltaX,
        deltaY: params.deltaY,
        deltaMode: 0,
        ctrlKey: params.ctrlKey,
        shiftKey: params.shiftKey,
        altKey: params.altKey,
        metaKey: params.metaKey
      }));
      this._window.scrollBy(params.deltaX, params.deltaY);
    });
  }
  tap(params) {
    const target = this._deepElementFromPoint(params.x, params.y) || this._document.documentElement;
    const init = {
      bubbles: true,
      cancelable: true,
      view: this._window,
      clientX: params.x,
      clientY: params.y,
      screenX: params.x,
      screenY: params.y,
      ctrlKey: params.ctrlKey,
      shiftKey: params.shiftKey,
      altKey: params.altKey,
      metaKey: params.metaKey
    };
    try {
      const touch = new Touch({ identifier: 0, target, clientX: params.x, clientY: params.y, screenX: params.x, screenY: params.y, pageX: params.x, pageY: params.y, radiusX: 1, radiusY: 1, rotationAngle: 0, force: 1 });
      void this._postTask(() => markAndDispatch(target, new TouchEvent("touchstart", { ...init, touches: [touch], targetTouches: [touch], changedTouches: [touch] })));
      void this._postTask(() => markAndDispatch(target, new TouchEvent("touchend", { ...init, touches: [], targetTouches: [], changedTouches: [touch] })));
    } catch {
    }
    void this._postTask(() => markAndDispatch(target, new MouseEvent("mousedown", { ...init, button: 0, buttons: 1, detail: 1 })));
    void this._postTask(() => markAndDispatch(target, new MouseEvent("mouseup", { ...init, button: 0, buttons: 0, detail: 1 })));
    return this._postTask(() => markAndDispatch(target, new MouseEvent("click", { ...init, button: 0, buttons: 0, detail: 1 })));
  }
};
var webViewInput_default = WebViewInput;
`;
  }
});

// packages/playwright-core/src/generated/webViewDialogSource.ts
var source8;
var init_webViewDialogSource = __esm({
  "packages/playwright-core/src/generated/webViewDialogSource.ts"() {
    "use strict";
    source8 = `
var __commonJS = obj => {
  let required = false;
  let result;
  return function __require() {
    if (!required) {
      required = true;
      let fn;
      for (const name in obj) { fn = obj[name]; break; }
      const module = { exports: {} };
      fn(module.exports, module);
      result = module.exports;
    }
    return result;
  }
};
var __export = (target, all) => {for (var name in all) target[name] = all[name];};
var __toESM = mod => ({ ...mod, 'default': mod });
var __toCommonJS = mod => ({ ...mod, __esModule: true });


// packages/injected/src/webview/webViewDialog.ts
var webViewDialog_exports = {};
__export(webViewDialog_exports, {
  installDialogBridge: () => installDialogBridge
});
module.exports = __toCommonJS(webViewDialog_exports);
function toMessage(message) {
  return String(message === void 0 || message === null ? "" : message);
}
function installDialogBridge(window, endpoint) {
  function post(type, message, defaultValue) {
    const xhr = new window.XMLHttpRequest();
    try {
      xhr.open("POST", endpoint, false);
    } catch (e) {
      return null;
    }
    try {
      xhr.send(JSON.stringify({ type, message, defaultValue }));
    } catch (e) {
      return null;
    }
    if (xhr.status !== 200)
      return null;
    try {
      return JSON.parse(xhr.responseText);
    } catch (e) {
      return null;
    }
  }
  Object.defineProperty(window, "alert", {
    configurable: true,
    writable: false,
    value: function(message) {
      post("alert", toMessage(message), "");
    }
  });
  Object.defineProperty(window, "confirm", {
    configurable: true,
    writable: false,
    value: function(message) {
      const r = post("confirm", toMessage(message), "");
      return !!(r && r.accept);
    }
  });
  Object.defineProperty(window, "prompt", {
    configurable: true,
    writable: false,
    value: function(message, defaultValue) {
      const def = toMessage(defaultValue);
      const r = post("prompt", toMessage(message), def);
      if (!r || !r.accept)
        return null;
      return typeof r.promptText === "string" ? r.promptText : def;
    }
  });
}
`;
  }
});

// packages/playwright-core/src/server/webkit/webview/wvExecutionContext.ts
function potentiallyUnserializableValue4(remoteObject) {
  const value2 = remoteObject.value;
  const isUnserializable = remoteObject.type === "number" && ["NaN", "-Infinity", "Infinity", "-0"].includes(remoteObject.description);
  return isUnserializable ? parseUnserializableValue(remoteObject.description) : value2;
}
function rewriteError5(error) {
  if (error.message.includes("Object has too long reference chain"))
    throw new Error("Cannot serialize result: object reference chain is too long.");
  if (!isJavaScriptErrorInEvaluate(error) && !isSessionClosedError(error))
    return new Error("Execution context was destroyed, most likely because of a navigation.");
  return error;
}
function renderPreview5(object) {
  if (object.type === "undefined")
    return "undefined";
  if ("value" in object)
    return String(object.value);
  if (object.description === "Object" && object.preview) {
    const tokens = [];
    for (const { name, value: value2 } of object.preview.properties)
      tokens.push(`${name}: ${value2}`);
    return `{${tokens.join(", ")}}`;
  }
  if (object.subtype === "array" && object.preview)
    return sparseArrayToString(object.preview.properties);
  return object.description;
}
function createHandle5(context2, remoteObject) {
  if (remoteObject.subtype === "node") {
    assert(context2 instanceof FrameExecutionContext);
    return new ElementHandle(context2, remoteObject.objectId);
  }
  const isPromise = remoteObject.className === "Promise";
  return new JSHandle(context2, isPromise ? "promise" : remoteObject.subtype || remoteObject.type, renderPreview5(remoteObject), remoteObject.objectId, potentiallyUnserializableValue4(remoteObject));
}
var WVExecutionContext;
var init_wvExecutionContext = __esm({
  "packages/playwright-core/src/server/webkit/webview/wvExecutionContext.ts"() {
    "use strict";
    init_assert();
    init_utilityScriptSerializers();
    init_javascript();
    init_dom();
    init_protocolError();
    WVExecutionContext = class {
      constructor(session2, contextId4) {
        this._session = session2;
        this._contextId = void 0;
      }
      async rawEvaluateJSON(expression2) {
        try {
          const response2 = await this._session.send("Runtime.evaluate", {
            expression: expression2,
            contextId: this._contextId,
            returnByValue: true
          });
          if (response2.wasThrown)
            throw new JavaScriptErrorInEvaluate(response2.result.description);
          return response2.result.value;
        } catch (error) {
          throw rewriteError5(error);
        }
      }
      async rawEvaluateHandle(context2, expression2) {
        try {
          const response2 = await this._session.send("Runtime.evaluate", {
            expression: expression2,
            contextId: this._contextId,
            returnByValue: false
          });
          if (response2.wasThrown)
            throw new JavaScriptErrorInEvaluate(response2.result.description);
          return createHandle5(context2, response2.result);
        } catch (error) {
          throw rewriteError5(error);
        }
      }
      async evaluateWithArguments(expression2, returnByValue, utilityScript, values, handles) {
        try {
          const response2 = await this._session.send("Runtime.callFunctionOn", {
            functionDeclaration: expression2,
            objectId: utilityScript._objectId,
            arguments: [
              { objectId: utilityScript._objectId },
              ...values.map((value2) => ({ value: value2 })),
              ...handles.map((handle) => ({ objectId: handle._objectId }))
            ],
            returnByValue,
            emulateUserGesture: true,
            awaitPromise: true
          });
          if (response2.wasThrown)
            throw new JavaScriptErrorInEvaluate(response2.result.description);
          if (returnByValue)
            return parseEvaluationResultValue(response2.result.value);
          return createHandle5(utilityScript._context, response2.result);
        } catch (error) {
          throw rewriteError5(error);
        }
      }
      async getProperties(object) {
        const response2 = await this._session.send("Runtime.getProperties", {
          objectId: object._objectId,
          ownProperties: true
        });
        const result2 = /* @__PURE__ */ new Map();
        for (const property of response2.properties) {
          if (!property.enumerable || !property.value)
            continue;
          result2.set(property.name, createHandle5(object._context, property.value));
        }
        return result2;
      }
      async releaseHandle(handle) {
        if (!handle._objectId)
          return;
        await this._session.send("Runtime.releaseObject", { objectId: handle._objectId });
      }
      shouldPrependErrorPrefix() {
        return false;
      }
    };
  }
});

// packages/playwright-core/src/server/webkit/webview/wvInput.ts
function modifierFlags(modifiers) {
  return {
    ctrlKey: modifiers.has("Control"),
    shiftKey: modifiers.has("Shift"),
    altKey: modifiers.has("Alt"),
    metaKey: modifiers.has("Meta")
  };
}
function buttonToNumber(button) {
  if (button === "left")
    return 0;
  if (button === "middle")
    return 1;
  if (button === "right")
    return 2;
  return 0;
}
function toButtonsMask4(buttons) {
  let mask = 0;
  if (buttons.has("left"))
    mask |= 1;
  if (buttons.has("right"))
    mask |= 2;
  if (buttons.has("middle"))
    mask |= 4;
  return mask;
}
async function callWebViewInput(progress2, session2, method, arg) {
  if (!session2)
    throw new Error("Page is not initialized");
  const expression2 = `window.__pwWebViewInput.${method}(${JSON.stringify(arg)})`;
  const { result: result2 } = await progress2.race(session2.send("Runtime.evaluate", { expression: expression2, returnByValue: false }));
  if (result2?.className === "Promise" && result2.objectId) {
    await progress2.race(session2.send("Runtime.awaitPromise", { promiseObjectId: result2.objectId, returnByValue: true }));
    session2.sendMayFail("Runtime.releaseObject", { objectId: result2.objectId });
  }
}
var RawKeyboardImpl5, RawMouseImpl5, RawTouchscreenImpl5;
var init_wvInput = __esm({
  "packages/playwright-core/src/server/webkit/webview/wvInput.ts"() {
    "use strict";
    RawKeyboardImpl5 = class {
      setSession(session2) {
        this._session = session2;
      }
      async keydown(progress2, modifiers, keyName, description, autoRepeat) {
        const { code, keyCode, key, text: text2, location: location2 } = description;
        const params2 = {
          code,
          key,
          keyCode,
          location: location2,
          repeat: autoRepeat,
          ...modifierFlags(modifiers),
          ...text2 ? { text: text2 } : {}
        };
        await callWebViewInput(progress2, this._session, "keydown", params2);
      }
      async keyup(progress2, modifiers, keyName, description) {
        const { code, keyCode, key, location: location2 } = description;
        const params2 = { code, key, keyCode, location: location2, ...modifierFlags(modifiers) };
        await callWebViewInput(progress2, this._session, "keyup", params2);
      }
      async sendText(progress2, text2) {
        await callWebViewInput(progress2, this._session, "insertText", text2);
      }
    };
    RawMouseImpl5 = class {
      setSession(session2) {
        this._session = session2;
      }
      async move(progress2, x, y, button, buttons, modifiers, forClick) {
        await callWebViewInput(progress2, this._session, "mouseMove", {
          x,
          y,
          button: buttonToNumber(button),
          buttons: toButtonsMask4(buttons),
          ...modifierFlags(modifiers)
        });
      }
      async down(progress2, x, y, button, buttons, modifiers, clickCount) {
        const buttonCode = buttonToNumber(button);
        const buttonsMask = toButtonsMask4(buttons);
        await this._mouseEvent(progress2, "mousedown", x, y, buttonCode, buttonsMask, modifiers, clickCount);
        if (button === "right")
          await this._mouseEvent(progress2, "contextmenu", x, y, buttonCode, buttonsMask, modifiers, clickCount);
      }
      async up(progress2, x, y, button, buttons, modifiers, clickCount) {
        const buttonCode = buttonToNumber(button);
        const buttonsMask = toButtonsMask4(buttons);
        await this._mouseEvent(progress2, "mouseup", x, y, buttonCode, buttonsMask, modifiers, clickCount);
        if (clickCount > 0) {
          const clickType = button === "left" ? "click" : "auxclick";
          await this._mouseEvent(progress2, clickType, x, y, buttonCode, buttonsMask, modifiers, clickCount);
          if (clickCount === 2)
            await this._mouseEvent(progress2, "dblclick", x, y, buttonCode, buttonsMask, modifiers, clickCount);
        }
      }
      async wheel(progress2, x, y, buttons, modifiers, deltaX, deltaY) {
        await callWebViewInput(progress2, this._session, "wheel", { x, y, deltaX, deltaY, ...modifierFlags(modifiers) });
      }
      async _mouseEvent(progress2, type3, x, y, button, buttons, modifiers, clickCount) {
        await callWebViewInput(progress2, this._session, "mouseEvent", {
          type: type3,
          x,
          y,
          button,
          buttons,
          clickCount,
          ...modifierFlags(modifiers)
        });
      }
    };
    RawTouchscreenImpl5 = class {
      setSession(session2) {
        this._session = session2;
      }
      async tap(progress2, x, y, modifiers) {
        await callWebViewInput(progress2, this._session, "tap", { x, y, ...modifierFlags(modifiers) });
      }
    };
  }
});

// packages/playwright-core/src/server/webkit/webview/wvWorkers.ts
var WVWorkers;
var init_wvWorkers = __esm({
  "packages/playwright-core/src/server/webkit/webview/wvWorkers.ts"() {
    "use strict";
    init_eventsHelper();
    init_page();
    init_wvConnection();
    init_wvExecutionContext();
    WVWorkers = class {
      constructor(page, session2) {
        this._sessionListeners = [];
        this._workerSessions = /* @__PURE__ */ new Map();
        this._page = page;
        this.setSession(session2);
      }
      setSession(session2) {
        eventsHelper.removeEventListeners(this._sessionListeners);
        this.clear();
        this._sessionListeners = [
          eventsHelper.addEventListener(session2, "Worker.workerCreated", (event) => {
            const worker = new Worker(this._page, event.url);
            const workerSession = new WVSession(session2.connection, event.workerId, (message) => {
              session2.send("Worker.sendMessageToWorker", {
                workerId: event.workerId,
                message: JSON.stringify(message)
              }).catch((e) => {
                workerSession.dispatchMessage({ id: message.id, error: { message: e.message } });
              });
            });
            this._workerSessions.set(event.workerId, workerSession);
            worker.createExecutionContext(new WVExecutionContext(workerSession, void 0));
            worker.workerScriptLoaded();
            this._page.addWorker(event.workerId, worker);
            workerSession.on("Console.messageAdded", (event2) => this._onConsoleMessage(worker, event2));
            Promise.all([
              workerSession.send("Runtime.enable"),
              workerSession.send("Console.enable"),
              session2.send("Worker.initialized", { workerId: event.workerId })
            ]).catch((e) => {
              this._page.removeWorker(event.workerId);
            });
          }),
          eventsHelper.addEventListener(session2, "Worker.dispatchMessageFromWorker", (event) => {
            const workerSession = this._workerSessions.get(event.workerId);
            if (!workerSession)
              return;
            workerSession.dispatchMessage(JSON.parse(event.message));
          }),
          eventsHelper.addEventListener(session2, "Worker.workerTerminated", (event) => {
            const workerSession = this._workerSessions.get(event.workerId);
            if (!workerSession)
              return;
            workerSession.dispose();
            this._workerSessions.delete(event.workerId);
            this._page.removeWorker(event.workerId);
          })
        ];
      }
      clear() {
        this._page.clearWorkers();
        this._workerSessions.clear();
      }
      async initializeSession(session2) {
        await session2.send("Worker.enable");
      }
      async _onConsoleMessage(worker, event) {
        const { type: type3, level, text: text2, parameters, url: url2, line: lineNumber, column: columnNumber } = event.message;
        let derivedType = type3 || "";
        if (type3 === "log")
          derivedType = level;
        else if (type3 === "timing")
          derivedType = "timeEnd";
        const handles = (parameters || []).map((p) => {
          return createHandle5(worker.existingExecutionContext, p);
        });
        const location2 = {
          url: url2 || "",
          lineNumber: (lineNumber || 1) - 1,
          columnNumber: (columnNumber || 1) - 1
        };
        const timestamp = event.message.timestamp ? event.message.timestamp * 1e3 : Date.now();
        this._page.addConsoleMessage(worker, derivedType, handles, location2, handles.length ? void 0 : text2, timestamp);
      }
    };
  }
});

// packages/playwright-core/src/server/webkit/webview/wvInterceptableRequest.ts
function wkMillisToRoundishMillis2(value2) {
  if (value2 === -1e3)
    return -1;
  if (value2 <= 0) {
    return -1;
  }
  return (value2 * 1e3 | 0) / 1e3;
}
function toResourceType3(type3) {
  switch (type3) {
    case "Document":
      return "document";
    case "StyleSheet":
      return "stylesheet";
    case "Image":
      return "image";
    case "Font":
      return "font";
    case "Script":
      return "script";
    case "XHR":
      return "xhr";
    case "Fetch":
      return "fetch";
    case "Ping":
      return "ping";
    case "Beacon":
      return "beacon";
    case "WebSocket":
      return "websocket";
    case "EventSource":
      return "eventsource";
    default:
      return "other";
  }
}
var errorReasons3, WVInterceptableRequest, WVRouteImpl;
var init_wvInterceptableRequest = __esm({
  "packages/playwright-core/src/server/webkit/webview/wvInterceptableRequest.ts"() {
    "use strict";
    init_assert();
    init_headers();
    init_network2();
    errorReasons3 = {
      "aborted": "Cancellation",
      "accessdenied": "AccessControl",
      "addressunreachable": "General",
      "blockedbyclient": "Cancellation",
      "blockedbyresponse": "General",
      "connectionaborted": "General",
      "connectionclosed": "General",
      "connectionfailed": "General",
      "connectionrefused": "General",
      "connectionreset": "General",
      "internetdisconnected": "General",
      "namenotresolved": "General",
      "timedout": "Timeout",
      "failed": "General"
    };
    WVInterceptableRequest = class {
      constructor(session2, frame, event, redirectedFrom, documentId) {
        this._session = session2;
        this._requestId = event.requestId;
        const resourceType = event.type ? toResourceType3(event.type) : redirectedFrom ? redirectedFrom.request.resourceType() : "other";
        let postDataBuffer = null;
        this._timestamp = event.timestamp;
        this._wallTime = event.walltime * 1e3;
        if (event.request.postData) {
          postDataBuffer = Buffer.from(event.request.postData, "utf8");
        }
        this.request = new Request(
          frame._page.browserContext,
          frame,
          null,
          redirectedFrom?.request || null,
          documentId,
          event.request.url,
          resourceType,
          event.request.method,
          postDataBuffer,
          headersObjectToArray(event.request.headers),
          this._wallTime
        );
      }
      adoptRequestFromNewProcess(newSession, requestId) {
        this._session = newSession;
        this._requestId = requestId;
      }
      createResponse(responsePayload) {
        const getResponseBody = async () => {
          const response3 = await this._session.send("Network.getResponseBody", { requestId: this._requestId });
          return Buffer.from(response3.body, response3.base64Encoded ? "base64" : "utf8");
        };
        const timingPayload = responsePayload.timing;
        const timing = {
          startTime: this._wallTime,
          domainLookupStart: timingPayload ? wkMillisToRoundishMillis2(timingPayload.domainLookupStart) : -1,
          domainLookupEnd: timingPayload ? wkMillisToRoundishMillis2(timingPayload.domainLookupEnd) : -1,
          connectStart: timingPayload ? wkMillisToRoundishMillis2(timingPayload.connectStart) : -1,
          secureConnectionStart: timingPayload ? wkMillisToRoundishMillis2(timingPayload.secureConnectionStart) : -1,
          connectEnd: timingPayload ? wkMillisToRoundishMillis2(timingPayload.connectEnd) : -1,
          requestStart: timingPayload ? wkMillisToRoundishMillis2(timingPayload.requestStart) : -1,
          responseStart: timingPayload ? wkMillisToRoundishMillis2(timingPayload.responseStart) : -1
        };
        const setCookieSeparator = process.platform === "darwin" ? "," : "playwright-set-cookie-separator";
        const response2 = new Response2(this.request, responsePayload.status, responsePayload.statusText, headersObjectToArray(responsePayload.headers, ",", setCookieSeparator), timing, getResponseBody, responsePayload.source === "service-worker");
        response2.setRawResponseHeaders(null);
        response2.setTransferSize(null);
        if (responsePayload.requestHeaders && Object.keys(responsePayload.requestHeaders).length) {
          const headers = { ...responsePayload.requestHeaders };
          if (!headers["host"])
            headers["Host"] = new URL(this.request.url()).host;
          this.request.setRawRequestHeaders(headersObjectToArray(headers));
        } else {
          this.request.setRawRequestHeaders(null);
        }
        return response2;
      }
    };
    WVRouteImpl = class {
      constructor(session2, requestId) {
        this._session = session2;
        this._requestId = requestId;
      }
      async abort(errorCode) {
        const errorType = errorReasons3[errorCode];
        assert(errorType, "Unknown error code: " + errorCode);
        await this._session.sendMayFail("Network.interceptRequestWithError", { requestId: this._requestId, errorType });
      }
      async fulfill(response2) {
        if (300 <= response2.status && response2.status < 400)
          throw new Error("Cannot fulfill with redirect status: " + response2.status);
        let mimeType = response2.isBase64 ? "application/octet-stream" : "text/plain";
        const headers = headersArrayToObject(
          response2.headers,
          true
          /* lowerCase */
        );
        const contentType = headers["content-type"];
        if (contentType)
          mimeType = contentType.split(";")[0].trim();
        await this._session.sendMayFail("Network.interceptRequestWithResponse", {
          requestId: this._requestId,
          status: response2.status,
          statusText: statusText(response2.status),
          mimeType,
          headers,
          base64Encoded: response2.isBase64,
          content: response2.body
        });
      }
      async continue(overrides) {
        await this._session.sendMayFail("Network.interceptWithRequest", {
          requestId: this._requestId,
          url: overrides.url,
          method: overrides.method,
          headers: overrides.headers ? headersArrayToObject(
            overrides.headers,
            false
            /* lowerCase */
          ) : void 0,
          postData: overrides.postData ? Buffer.from(overrides.postData).toString("base64") : void 0
        });
      }
    };
  }
});

// packages/playwright-core/src/server/webkit/webview/wvProvisionalPage.ts
var WVProvisionalPage;
var init_wvProvisionalPage = __esm({
  "packages/playwright-core/src/server/webkit/webview/wvProvisionalPage.ts"() {
    "use strict";
    init_eventsHelper();
    init_assert();
    WVProvisionalPage = class {
      constructor(session2, page) {
        this._sessionListeners = [];
        this._mainFrameId = null;
        this._session = session2;
        this._wvPage = page;
        const overrideFrameId = (handler) => {
          return (payload) => {
            if (payload.frameId)
              payload.frameId = this._wvPage._page.frameManager.mainFrame()._id;
            handler(payload);
          };
        };
        const wvPage = this._wvPage;
        this._sessionListeners = [
          eventsHelper.addEventListener(session2, "Network.requestWillBeSent", overrideFrameId((e) => wvPage._onRequestWillBeSent(session2, e))),
          eventsHelper.addEventListener(session2, "Network.requestIntercepted", overrideFrameId((e) => wvPage._onRequestIntercepted(session2, e))),
          eventsHelper.addEventListener(session2, "Network.responseReceived", overrideFrameId((e) => wvPage._onResponseReceived(session2, e))),
          eventsHelper.addEventListener(session2, "Network.loadingFinished", overrideFrameId((e) => wvPage._onLoadingFinished(e))),
          eventsHelper.addEventListener(session2, "Network.loadingFailed", overrideFrameId((e) => wvPage._onLoadingFailed(session2, e)))
        ];
        this.initializationPromise = this._wvPage._initializeSession(session2, true, ({ frameTree }) => this._handleFrameTree(frameTree));
      }
      dispose() {
        eventsHelper.removeEventListeners(this._sessionListeners);
      }
      commit() {
        assert(this._mainFrameId);
        this._wvPage._onFrameAttached(this._mainFrameId, null);
      }
      _handleFrameTree(frameTree) {
        assert(!frameTree.frame.parentId);
        this._mainFrameId = frameTree.frame.id;
      }
    };
  }
});

// packages/playwright-core/src/server/webkit/webview/wvPage.ts
function parseRemoteAddress2(value2) {
  if (!value2)
    return;
  try {
    const colon = value2.lastIndexOf(":");
    const dot = value2.lastIndexOf(".");
    if (dot < 0) {
      return {
        ipAddress: `[${value2.slice(0, colon)}]`,
        port: +value2.slice(colon + 1)
      };
    }
    if (colon > dot) {
      const [address, port] = value2.split(":");
      return {
        ipAddress: address,
        port: +port
      };
    } else {
      const [address, port] = value2.split(".");
      return {
        ipAddress: `[${address}]`,
        port: +port
      };
    }
  } catch (_) {
  }
}
function isLoadedSecurely2(url2, timing) {
  try {
    const u = new URL(url2);
    if (u.protocol !== "https:" && u.protocol !== "wss:" && u.protocol !== "sftp:")
      return false;
    if (timing.secureConnectionStart === -1 && timing.connectStart !== -1)
      return false;
    return true;
  } catch (_) {
  }
}
function dialogBridgeSource(endpoint) {
  return `(() => {
  const module = {};
  ${source8}
  module.exports.installDialogBridge()(window, ${JSON.stringify(endpoint)});
})()`;
}
var PNG3, jpegjs4, WVPage, BINDING_CALL_TAG, webViewInputBootstrapSource, bindingBridgeSource;
var init_wvPage = __esm({
  "packages/playwright-core/src/server/webkit/webview/wvPage.ts"() {
    "use strict";
    init_assert();
    init_headers();
    init_manualPromise();
    init_stackTrace();
    init_debugLogger();
    init_eventsHelper();
    init_dialog();
    init_dom();
    init_errors();
    init_helper();
    init_javascript();
    init_webViewInputSource();
    init_webViewDialogSource();
    init_network2();
    init_page();
    init_wvConnection();
    init_wvExecutionContext();
    init_wvInput();
    init_wvWorkers();
    init_wvInterceptableRequest();
    init_wvProvisionalPage();
    ({ PNG: PNG3 } = require("./utilsBundle"));
    jpegjs4 = require("./utilsBundle").jpegjs;
    WVPage = class {
      constructor(browserContext, outerSession, dialogEndpoint) {
        this._provisionalPage = null;
        this._requestIdToRequest = /* @__PURE__ */ new Map();
        this._requestIdToRequestWillBeSentEvent = /* @__PURE__ */ new Map();
        this._sessionListeners = [];
        this._pendingMainFrameLoaderResolvers = /* @__PURE__ */ new Map();
        this._firstNonInitialNavigationCommittedFulfill = () => {
        };
        this._firstNonInitialNavigationCommittedReject = (e) => {
        };
        this._initializedPromise = new ManualPromise();
        this._lastConsoleMessage = null;
        this._requestIdToResponseReceivedPayloadEvent = /* @__PURE__ */ new Map();
        this._timestampBaselineForWebSocket = /* @__PURE__ */ new Map();
        this._outerSession = outerSession;
        this._dialogEndpoint = dialogEndpoint;
        this.rawKeyboard = new RawKeyboardImpl5();
        this.rawMouse = new RawMouseImpl5();
        this.rawTouchscreen = new RawTouchscreenImpl5();
        this._contextIdToContext = /* @__PURE__ */ new Map();
        this._page = new Page(this, browserContext);
        this._workers = new WVWorkers(this._page, outerSession);
        this._browserContext = browserContext;
        this._page.on(Page.Events.FrameDetached, (frame) => this._removeContextsForFrame(frame, false));
        this._eventListeners = [
          eventsHelper.addEventListener(outerSession, "Target.targetCreated", this._onTargetCreated.bind(this)),
          eventsHelper.addEventListener(outerSession, "Target.targetDestroyed", this._onTargetDestroyed.bind(this)),
          eventsHelper.addEventListener(outerSession, "Target.dispatchMessageFromTarget", this._onDispatchMessageFromTarget.bind(this)),
          eventsHelper.addEventListener(outerSession, "Target.didCommitProvisionalTarget", this._onDidCommitProvisionalTarget.bind(this))
        ];
        this._firstNonInitialNavigationCommittedPromise = new Promise((f, r) => {
          this._firstNonInitialNavigationCommittedFulfill = f;
          this._firstNonInitialNavigationCommittedReject = r;
        });
        this._firstNonInitialNavigationCommittedPromise.catch(() => {
        });
      }
      waitForInitialized() {
        return this._initializedPromise;
      }
      updateEmulatedViewportSize(preserveWindowBoundaries) {
        throw new Error("Method not implemented.");
      }
      updateEmulateMedia() {
        throw new Error("Method not implemented.");
      }
      goBack() {
        throw new Error("Method not implemented.");
      }
      goForward() {
        throw new Error("Method not implemented.");
      }
      requestGC() {
        throw new Error("Method not implemented.");
      }
      updateFileChooserInterception() {
        throw new Error("Method not implemented.");
      }
      setInputFilePaths(progress2, handle, files) {
        throw new Error("Method not implemented.");
      }
      startScreencast(options) {
        throw new Error("Method not implemented.");
      }
      stopScreencast() {
        throw new Error("Method not implemented.");
      }
      _setSession(session2) {
        eventsHelper.removeEventListeners(this._sessionListeners);
        this._session = session2;
        this.rawKeyboard.setSession(session2);
        this.rawMouse.setSession(session2);
        this.rawTouchscreen.setSession(session2);
        this._workers.setSession(session2);
        this._addSessionListeners();
      }
      // This method is called for provisional targets as well. The session passed as the parameter
      // may be different from the current session and may be destroyed without becoming current.
      async _initializeSession(session2, provisional, resourceTreeHandler) {
        await this._initializeSessionMayThrow(session2, resourceTreeHandler).catch((e) => {
          if (provisional && session2.isDisposed())
            return;
          if (this._session === session2)
            throw e;
        });
      }
      async _initializeSessionMayThrow(session2, resourceTreeHandler) {
        const [, frameTree] = await Promise.all([
          session2.send("Page.enable"),
          session2.send("Page.getResourceTree")
        ]);
        resourceTreeHandler(frameTree);
        await Promise.all([
          session2.send("Runtime.enable"),
          session2.sendMayFail("Network.enable"),
          session2.sendMayFail("Console.enable"),
          this._workers.initializeSession(session2),
          session2.sendMayFail("Page.setBootstrapScript", { source: this._calculateBootstrapScript() }),
          session2.sendMayFail("Runtime.evaluate", { expression: saveGlobalsSnapshotSource, returnByValue: true })
        ]);
        if (this._page.needsRequestInterception()) {
          await Promise.all([
            session2.sendMayFail("Network.setInterceptionEnabled", { enabled: true }),
            session2.sendMayFail("Network.setResourceCachingDisabled", { disabled: true }),
            session2.sendMayFail("Network.addInterception", { url: ".*", stage: "request", isRegex: true })
          ]);
        }
        await session2.sendMayFail("Runtime.evaluate", { expression: webViewInputBootstrapSource, returnByValue: true });
        if (this._dialogEndpoint) {
          await session2.sendMayFail("Runtime.evaluate", {
            expression: dialogBridgeSource(this._dialogEndpoint),
            returnByValue: true
          });
        }
      }
      _createSession(targetId) {
        const session2 = new WVSession(this._outerSession.connection, targetId, (message) => {
          this._outerSession.send("Target.sendMessageToTarget", {
            targetId,
            message: JSON.stringify(message)
          }).catch((e) => {
            session2.dispatchMessage({ id: message.id, error: { message: e.message } });
          });
        });
        return session2;
      }
      async _onTargetCreated(event) {
        const { targetInfo } = event;
        if (targetInfo.type !== "page") {
          if (targetInfo.isPaused)
            this._outerSession.sendMayFail("Target.resume", { targetId: targetInfo.targetId });
          return;
        }
        const session2 = this._createSession(targetInfo.targetId);
        if (!targetInfo.isProvisional) {
          let pageOrError;
          try {
            this._setSession(session2);
            await this._initializeSession(session2, false, ({ frameTree }) => this._handleFrameTree(frameTree));
            pageOrError = this._page;
          } catch (e) {
            pageOrError = e;
          }
          if (targetInfo.isPaused)
            this._outerSession.sendMayFail("Target.resume", { targetId: targetInfo.targetId });
          await this._page.reportAsNew(void 0, pageOrError instanceof Page ? void 0 : pageOrError);
          this._initializedPromise.resolve();
        } else {
          assert(!this._provisionalPage);
          this._provisionalPage = new WVProvisionalPage(session2, this);
          if (targetInfo.isPaused) {
            this._provisionalPage.initializationPromise.then(() => {
              this._outerSession.sendMayFail("Target.resume", { targetId: targetInfo.targetId });
            });
          }
        }
      }
      _onDispatchMessageFromTarget(event) {
        const { targetId, message } = event;
        if (this._provisionalPage && this._provisionalPage._session.sessionId === targetId)
          this._provisionalPage._session.dispatchMessage(JSON.parse(message));
        else if (this._session && this._session.sessionId === targetId)
          this._session.dispatchMessage(JSON.parse(message));
      }
      _onDidCommitProvisionalTarget(event) {
        const { oldTargetId, newTargetId } = event;
        assert(this._provisionalPage);
        assert(this._provisionalPage._session.sessionId === newTargetId, "Unknown new target: " + newTargetId);
        assert(this._session.sessionId === oldTargetId, "Unknown old target: " + oldTargetId);
        const newSession = this._provisionalPage._session;
        this._provisionalPage.commit();
        this._provisionalPage.dispose();
        this._provisionalPage = null;
        this._setSession(newSession);
      }
      _onTargetDestroyed(event) {
        const { targetId } = event;
        if (this._provisionalPage && this._provisionalPage._session.sessionId === targetId) {
          this._provisionalPage._session.dispose();
          this._provisionalPage.dispose();
          this._provisionalPage = null;
        } else if (this._session && this._session.sessionId === targetId) {
          this._session.dispose();
          eventsHelper.removeEventListeners(this._sessionListeners);
        }
      }
      async onBridgeDialog(req) {
        return await new Promise((resolve) => {
          this._page.browserContext.dialogManager.dialogDidOpen(new Dialog(
            this._page,
            req.type,
            req.message,
            async (accept, promptText) => resolve({ accept, promptText }),
            req.defaultValue
          ));
        });
      }
      didClose() {
        eventsHelper.removeEventListeners(this._sessionListeners);
        eventsHelper.removeEventListeners(this._eventListeners);
        if (this._session)
          this._session.dispose();
        if (this._provisionalPage) {
          this._provisionalPage._session.dispose();
          this._provisionalPage.dispose();
          this._provisionalPage = null;
        }
        this._firstNonInitialNavigationCommittedReject(new TargetClosedError(this._page.closeReason()));
        this._page._didClose();
      }
      _addSessionListeners() {
        this._sessionListeners = this._buildSessionListeners(this._session);
      }
      _buildSessionListeners(session2) {
        return [
          eventsHelper.addEventListener(session2, "Page.frameNavigated", (event) => this._onFrameNavigated(event.frame, false)),
          eventsHelper.addEventListener(session2, "Page.navigatedWithinDocument", (event) => this._onFrameNavigatedWithinDocument(event.frameId, event.url)),
          eventsHelper.addEventListener(session2, "Page.frameAttached", (event) => this._onFrameAttached(event.frameId, event.parentFrameId)),
          eventsHelper.addEventListener(session2, "Page.frameDetached", (event) => this._onFrameDetached(event.frameId)),
          eventsHelper.addEventListener(session2, "Page.loadEventFired", (event) => this._page.frameManager.frameLifecycleEvent(this._page.mainFrame()._id, "load")),
          eventsHelper.addEventListener(session2, "Page.domContentEventFired", (event) => this._page.frameManager.frameLifecycleEvent(this._page.mainFrame()._id, "domcontentloaded")),
          eventsHelper.addEventListener(session2, "Runtime.executionContextCreated", (event) => this._onExecutionContextCreated(event.context)),
          eventsHelper.addEventListener(session2, "Console.messageAdded", (event) => this._onConsoleMessage(event)),
          eventsHelper.addEventListener(session2, "Console.messageRepeatCountUpdated", (event) => this._onConsoleRepeatCountUpdated(event)),
          eventsHelper.addEventListener(session2, "Network.requestWillBeSent", (e) => this._onRequestWillBeSent(session2, e)),
          eventsHelper.addEventListener(session2, "Network.requestIntercepted", (e) => this._onRequestIntercepted(session2, e)),
          eventsHelper.addEventListener(session2, "Network.responseReceived", (e) => this._onResponseReceived(session2, e)),
          eventsHelper.addEventListener(session2, "Network.loadingFinished", (e) => this._onLoadingFinished(e)),
          eventsHelper.addEventListener(session2, "Network.loadingFailed", (e) => this._onLoadingFailed(session2, e)),
          eventsHelper.addEventListener(session2, "Network.webSocketCreated", (e) => this._page.frameManager.onWebSocketCreated(e.requestId, e.url)),
          eventsHelper.addEventListener(session2, "Network.webSocketWillSendHandshakeRequest", (event) => this._onWebSocketWillSendHandshakeRequest(event)),
          eventsHelper.addEventListener(session2, "Network.webSocketHandshakeResponseReceived", (e) => this._page.frameManager.onWebSocketResponse(e.requestId, e.response.status, e.response.statusText, headersObjectToArray(e.response.headers, ","))),
          eventsHelper.addEventListener(session2, "Network.webSocketFrameSent", (e) => e.response.payloadData && this._page.frameManager.onWebSocketFrameSent(e.requestId, e.response.opcode, e.response.payloadData, this._timestampToWallTimeMsForWebSocket(e.requestId, e.timestamp))),
          eventsHelper.addEventListener(session2, "Network.webSocketFrameReceived", (e) => e.response.payloadData && this._page.frameManager.webSocketFrameReceived(e.requestId, e.response.opcode, e.response.payloadData, this._timestampToWallTimeMsForWebSocket(e.requestId, e.timestamp))),
          eventsHelper.addEventListener(session2, "Network.webSocketClosed", (event) => this._onWebSocketClosed(event)),
          eventsHelper.addEventListener(session2, "Network.webSocketFrameError", (e) => this._page.frameManager.webSocketError(e.requestId, e.errorMessage))
        ];
      }
      async _updateState(method, params2) {
        await this._forAllSessions((session2) => session2.send(method, params2).then());
      }
      async _forAllSessions(callback) {
        const sessions = [
          this._session
        ];
        await Promise.all(sessions.map((session2) => callback(session2).catch((e) => {
        })));
      }
      _handleFrameTree(frameTree) {
        this._onFrameAttached(frameTree.frame.id, frameTree.frame.parentId || null);
        this._onFrameNavigated(frameTree.frame, true);
        this._page.frameManager.frameLifecycleEvent(frameTree.frame.id, "domcontentloaded");
        this._page.frameManager.frameLifecycleEvent(frameTree.frame.id, "load");
        if (!frameTree.childFrames)
          return;
        for (const child of frameTree.childFrames)
          this._handleFrameTree(child);
      }
      _onFrameAttached(frameId, parentFrameId) {
        return this._page.frameManager.frameAttached(frameId, parentFrameId);
      }
      _onFrameNavigated(framePayload, initial) {
        if (!this._page.frameManager.frame(framePayload.id))
          this._onFrameAttached(framePayload.id, framePayload.parentId || null);
        const frame = this._page.frameManager.frame(framePayload.id);
        this._removeContextsForFrame(frame, true);
        if (!framePayload.parentId)
          this._workers.clear();
        this._page.frameManager.frameCommittedNewDocumentNavigation(framePayload.id, framePayload.url, framePayload.name || "", framePayload.loaderId, initial);
        if (!initial)
          this._firstNonInitialNavigationCommittedFulfill();
        const pending = this._pendingMainFrameLoaderResolvers.get(framePayload.id);
        if (pending) {
          this._pendingMainFrameLoaderResolvers.delete(framePayload.id);
          pending(framePayload.loaderId);
        }
      }
      _onFrameNavigatedWithinDocument(frameId, url2) {
        this._page.frameManager.frameCommittedSameDocumentNavigation(frameId, url2);
      }
      _onFrameDetached(frameId) {
        this._page.frameManager.frameDetached(frameId);
      }
      _removeContextsForFrame(frame, notifyFrame) {
        for (const [contextId4, context2] of this._contextIdToContext) {
          if (context2.frame === frame) {
            this._contextIdToContext.delete(contextId4);
            if (notifyFrame)
              frame.contextDestroyed(context2);
          }
        }
      }
      _onExecutionContextCreated(contextPayload) {
        if (this._contextIdToContext.has(contextPayload.id))
          return;
        const frame = this._page.frameManager.frame(contextPayload.frameId);
        if (!frame)
          return;
        if (contextPayload.type !== "normal")
          return;
        const delegate = new WVExecutionContext(this._session, contextPayload.id);
        const context2 = new FrameExecutionContext(delegate, frame, "main");
        frame.contextCreated("main", context2);
        this._contextIdToContext.set(contextPayload.id, context2);
      }
      async navigateFrame(frame, url2, referrer) {
        if (frame.parentFrame())
          throw new Error("Navigating subframes is not supported on stock WebKit RDP \u2014 only the main frame can be navigated.");
        if (url2.startsWith("data:"))
          return await this._navigateToDataUrl(frame, url2);
        return await this._navigateMainFrame(frame, url2);
      }
      async _navigateMainFrame(frame, url2) {
        const loaderIdPromise = new Promise((resolve) => {
          this._pendingMainFrameLoaderResolvers.set(frame._id, resolve);
        });
        try {
          this._session.sendMayFail("Runtime.evaluate", {
            expression: `window.location.href = ${JSON.stringify(url2)}`,
            returnByValue: true
          });
          const loaderId = await loaderIdPromise;
          return { newDocumentId: loaderId };
        } finally {
          this._pendingMainFrameLoaderResolvers.delete(frame._id);
        }
      }
      async _navigateToDataUrl(frame, url2) {
        const match = /^data:([^,]*),([\s\S]*)$/.exec(url2);
        if (!match)
          throw new Error(`Invalid data URL: ${url2.slice(0, 80)}`);
        const meta = match[1];
        const data = match[2];
        const content = /;base64$/i.test(meta) ? Buffer.from(data, "base64").toString("utf8") : decodeURIComponent(data);
        const result2 = await this._navigateMainFrame(frame, "about:blank");
        await this._session.sendMayFail("Runtime.evaluate", {
          expression: `(function() { document.open(); document.write(${JSON.stringify(content)}); document.close(); })()`
        });
        return result2;
      }
      _onConsoleMessage(event) {
        const { type: type3, level, text: text2, parameters, url: url2, line: lineNumber, column: columnNumber, source: source11 } = event.message;
        if (level === "debug" && parameters && parameters.length >= 2 && parameters[0].type === "string" && parameters[0].value === BINDING_CALL_TAG && parameters[1].type === "string") {
          const payload = parameters[1].value;
          const context2 = [...this._contextIdToContext.values()].find((c) => c.frame === this._page.mainFrame());
          if (context2)
            this._page.onBindingCalled(payload, context2).catch((e) => debugLogger.log("error", e));
          return;
        }
        if (level === "error" && source11 === "javascript") {
          const { name, message } = splitErrorMessage(text2);
          let stack;
          if (event.message.stackTrace) {
            stack = text2 + "\n" + event.message.stackTrace.callFrames.map((callFrame) => {
              return `    at ${callFrame.functionName || "unknown"} (${callFrame.url}:${callFrame.lineNumber}:${callFrame.columnNumber})`;
            }).join("\n");
          } else {
            stack = "";
          }
          this._lastConsoleMessage = null;
          const error = new Error(message);
          error.stack = stack;
          error.name = name;
          this._page.addPageError(error, {
            url: url2 || "",
            lineNumber: (lineNumber || 1) - 1,
            columnNumber: (columnNumber || 1) - 1
          });
          return;
        }
        let derivedType = type3 || "";
        if (type3 === "log")
          derivedType = level;
        else if (type3 === "timing")
          derivedType = "timeEnd";
        const handles = [];
        for (const p of parameters || []) {
          let context2;
          if (p.objectId) {
            const objectId = JSON.parse(p.objectId);
            context2 = this._contextIdToContext.get(objectId.injectedScriptId);
          } else {
            context2 = [...this._contextIdToContext.values()].find((c) => c.frame === this._page.mainFrame());
          }
          if (!context2)
            return;
          handles.push(createHandle5(context2, p));
        }
        this._lastConsoleMessage = {
          derivedType,
          text: text2,
          handles,
          count: 0,
          location: {
            url: url2 || "",
            lineNumber: (lineNumber || 1) - 1,
            columnNumber: (columnNumber || 1) - 1
          }
        };
        this._onConsoleRepeatCountUpdated({ count: 1, timestamp: event.message.timestamp });
      }
      _onConsoleRepeatCountUpdated(event) {
        if (this._lastConsoleMessage) {
          const {
            derivedType,
            text: text2,
            handles,
            count,
            location: location2
          } = this._lastConsoleMessage;
          const timestamp = event.timestamp ? event.timestamp * 1e3 : Date.now();
          for (let i = count; i < event.count; ++i)
            this._page.addConsoleMessage(null, derivedType, handles, location2, handles.length ? void 0 : text2, timestamp);
          this._lastConsoleMessage.count = event.count;
        }
      }
      async updateExtraHTTPHeaders() {
        await this._updateState("Network.setExtraHTTPHeaders", { headers: headersArrayToObject(
          this._calculateExtraHTTPHeaders(),
          false
          /* lowerCase */
        ) });
      }
      _calculateExtraHTTPHeaders() {
        const locale = this._browserContext._options.locale;
        const headers = mergeHeaders([
          this._browserContext._options.extraHTTPHeaders,
          this._page.extraHTTPHeaders(),
          locale ? singleHeader("Accept-Language", locale) : void 0
        ]);
        return headers;
      }
      async bringToFront() {
      }
      noUtilityWorld() {
        return true;
      }
      async updateRequestInterception() {
        const enabled = this._page.needsRequestInterception();
        await Promise.all([
          this._updateState("Network.setInterceptionEnabled", { enabled }),
          this._updateState("Network.setResourceCachingDisabled", { disabled: enabled }),
          this._updateState("Network.addInterception", { url: ".*", stage: "request", isRegex: true })
        ]);
      }
      async reload() {
        await this._session.send("Page.reload");
      }
      async addInitScript(initScript) {
        await this._updateBootstrapScript();
      }
      async removeInitScripts(initScripts) {
        await this._updateBootstrapScript();
      }
      async exposePlaywrightBinding() {
        await this._updateBootstrapScript();
        await this._session.sendMayFail("Runtime.evaluate", {
          expression: bindingBridgeSource,
          returnByValue: true
        });
      }
      _calculateBootstrapScript() {
        const scripts = [];
        scripts.push(saveGlobalsSnapshotSource);
        if (!this._page.browserContext._options.isMobile) {
          scripts.push("delete window.orientation");
          scripts.push("delete window.ondevicemotion");
          scripts.push("delete window.ondeviceorientation");
        }
        scripts.push('if (!window.safari) window.safari = { pushNotification: { toString() { return "[object SafariRemoteNotification]"; } } };');
        scripts.push("if (!window.GestureEvent) window.GestureEvent = function GestureEvent() {};");
        scripts.push(this._publicKeyCredentialScript());
        scripts.push(bindingBridgeSource);
        scripts.push(webViewInputBootstrapSource);
        if (this._dialogEndpoint)
          scripts.push(dialogBridgeSource(this._dialogEndpoint));
        scripts.push(...this._page.allInitScripts().map((script) => script.source));
        return scripts.join(";\n");
      }
      _publicKeyCredentialScript() {
        function polyfill() {
          window.PublicKeyCredential ??= {
            async getClientCapabilities() {
              return {};
            },
            async isConditionalMediationAvailable() {
              return false;
            },
            async isUserVerifyingPlatformAuthenticatorAvailable() {
              return false;
            }
          };
        }
        return `(${polyfill.toString()})();`;
      }
      async _updateBootstrapScript() {
        await this._updateState("Page.setBootstrapScript", { source: this._calculateBootstrapScript() });
      }
      async closePage() {
        await this._session.sendMayFail("Runtime.evaluate", {
          expression: "window.close()",
          emulateUserGesture: true
        });
        this._session.connection.close();
      }
      async setBackgroundColor(color) {
        throw new Error("Method not implemented");
      }
      validateScreenshotDimension(side, omitDeviceScaleFactor) {
        if (process.platform === "darwin")
          return;
        if (!omitDeviceScaleFactor && this._page.browserContext._options.deviceScaleFactor)
          side = Math.ceil(side * this._page.browserContext._options.deviceScaleFactor);
        if (side > 32767)
          throw new Error("Cannot take screenshot larger than 32767 pixels on any dimension");
      }
      async takeScreenshot(progress2, format2, documentRect, viewportRect, quality, fitsViewport, scale) {
        const rect = documentRect || viewportRect;
        const omitDeviceScaleFactor = scale === "css";
        if (omitDeviceScaleFactor)
          throw new Error("css screenshots are not implemented");
        this.validateScreenshotDimension(rect.width, omitDeviceScaleFactor);
        this.validateScreenshotDimension(rect.height, omitDeviceScaleFactor);
        const result2 = await progress2.race(this._session.send("Page.snapshotRect", { ...rect, coordinateSystem: documentRect ? "Page" : "Viewport" }));
        const prefix = "data:image/png;base64,";
        let buffer = Buffer.from(result2.dataURL.substr(prefix.length), "base64");
        if (format2 === "jpeg")
          buffer = jpegjs4.encode(PNG3.sync.read(buffer), quality).data;
        return buffer;
      }
      async getContentFrame(handle) {
        throw new Error("Method not implemented");
      }
      async getOwnerFrame(handle) {
        throw new Error("Method not implemented");
      }
      async getBoundingBox(handle) {
        const quads = await this.getContentQuads(handle);
        if (!quads || !quads.length)
          return null;
        let minX = Infinity;
        let maxX = -Infinity;
        let minY = Infinity;
        let maxY = -Infinity;
        for (const quad of quads) {
          for (const point of quad) {
            minX = Math.min(minX, point.x);
            maxX = Math.max(maxX, point.x);
            minY = Math.min(minY, point.y);
            maxY = Math.max(maxY, point.y);
          }
        }
        return { x: minX, y: minY, width: maxX - minX, height: maxY - minY };
      }
      async scrollRectIntoViewIfNeeded(handle, rect) {
        const result2 = await handle.evaluateInUtility(([, node, rect2]) => {
          if (!node.isConnected)
            return "error:notconnected";
          if (!(node instanceof Element))
            return "error:notvisible";
          const box = node.getBoundingClientRect();
          if (!box.width && !box.height && !node.getClientRects().length)
            return "error:notvisible";
          const innerW = document.documentElement.clientWidth;
          const innerH = document.documentElement.clientHeight;
          const target = rect2 ? { left: box.left + rect2.x, top: box.top + rect2.y, right: box.left + rect2.x + rect2.width, bottom: box.top + rect2.y + rect2.height } : { left: box.left, top: box.top, right: box.right, bottom: box.bottom };
          const fullyVisible = target.left >= 0 && target.top >= 0 && target.right <= innerW && target.bottom <= innerH;
          if (!fullyVisible)
            node.scrollIntoView({ block: "center", inline: "center" });
          return "done";
        }, rect ?? null);
        if (result2 === "error:notvisible" || result2 === "error:notconnected" || result2 === "done")
          return result2;
        return "error:notconnected";
      }
      rafCountForStablePosition() {
        return 1;
      }
      async getContentQuads(handle) {
        const result2 = await handle.evaluateInUtility(([, node]) => {
          let element2 = node;
          while (element2 && element2.nodeType !== 1)
            element2 = element2.parentNode;
          if (!element2)
            return null;
          const rects = element2.getClientRects();
          if (!rects.length)
            return null;
          return Array.from(rects, (r) => [
            { x: r.left, y: r.top },
            { x: r.right, y: r.top },
            { x: r.right, y: r.bottom },
            { x: r.left, y: r.bottom }
          ]);
        }, {});
        if (!result2 || typeof result2 === "string")
          return null;
        return result2;
      }
      async adoptElementHandle(handle, to) {
        throw new Error("Method not implemented");
      }
      async inputActionEpilogue() {
      }
      async resetForReuse(progress2) {
      }
      async getFrameElement(frame) {
        throw new Error("Method not implemented");
      }
      _adoptRequestFromNewProcess(navigationRequest, newSession, newRequestId) {
        for (const [requestId, request2] of this._requestIdToRequest) {
          if (request2.request === navigationRequest) {
            this._requestIdToRequest.delete(requestId);
            request2.adoptRequestFromNewProcess(newSession, newRequestId);
            this._requestIdToRequest.set(newRequestId, request2);
            return;
          }
        }
      }
      _onRequestWillBeSent(session2, event) {
        if (event.request.url.startsWith("data:"))
          return;
        if (event.request.url.startsWith("about:"))
          return;
        if (this._page.needsRequestInterception() && !event.redirectResponse)
          this._requestIdToRequestWillBeSentEvent.set(event.requestId, event);
        else
          this._onRequest(session2, event, false);
      }
      _onRequest(session2, event, intercepted) {
        let redirectedFrom = null;
        if (event.redirectResponse) {
          const request3 = this._requestIdToRequest.get(event.requestId);
          if (request3) {
            this._handleRequestRedirect(request3, event.requestId, event.redirectResponse, event.timestamp);
            redirectedFrom = request3;
          }
        }
        const frame = redirectedFrom ? redirectedFrom.request.frame() : this._page.frameManager.frame(event.frameId);
        if (!frame)
          return;
        const isNavigationRequest = event.type === "Document";
        const documentId = isNavigationRequest ? event.loaderId : void 0;
        const request2 = new WVInterceptableRequest(session2, frame, event, redirectedFrom, documentId);
        let route2;
        if (intercepted) {
          route2 = new WVRouteImpl(session2, event.requestId);
          request2.request.setRawRequestHeaders(null);
        }
        this._requestIdToRequest.set(event.requestId, request2);
        this._page.frameManager.requestStarted(request2.request, route2);
      }
      _handleRequestRedirect(request2, requestId, responsePayload, timestamp) {
        const response2 = request2.createResponse(responsePayload);
        response2._setHttpVersion(null);
        response2._securityDetailsFinished();
        response2._serverAddrFinished();
        response2.setResponseHeadersSize(null);
        response2.setEncodedBodySize(null);
        response2._requestFinished(responsePayload.timing ? helper.secondsToRoundishMillis(timestamp - request2._timestamp) : -1);
        this._requestIdToRequest.delete(requestId);
        this._page.frameManager.requestReceivedResponse(response2);
        this._page.frameManager.reportRequestFinished(request2.request, response2);
      }
      _onRequestIntercepted(session2, event) {
        const requestWillBeSentEvent = this._requestIdToRequestWillBeSentEvent.get(event.requestId);
        if (!requestWillBeSentEvent) {
          session2.sendMayFail("Network.interceptWithRequest", { requestId: event.requestId });
          return;
        }
        this._requestIdToRequestWillBeSentEvent.delete(event.requestId);
        this._onRequest(session2, requestWillBeSentEvent, true);
      }
      _onResponseReceived(session2, event) {
        const requestWillBeSentEvent = this._requestIdToRequestWillBeSentEvent.get(event.requestId);
        if (requestWillBeSentEvent) {
          this._requestIdToRequestWillBeSentEvent.delete(event.requestId);
          this._onRequest(session2, requestWillBeSentEvent, false);
        }
        const request2 = this._requestIdToRequest.get(event.requestId);
        if (!request2)
          return;
        this._requestIdToResponseReceivedPayloadEvent.set(event.requestId, event);
        const response2 = request2.createResponse(event.response);
        this._page.frameManager.requestReceivedResponse(response2);
        if (response2.status() === 204 && request2.request.isNavigationRequest()) {
          this._onLoadingFailed(session2, {
            requestId: event.requestId,
            errorText: "Aborted: 204 No Content",
            timestamp: event.timestamp
          });
        }
      }
      _onLoadingFinished(event) {
        const request2 = this._requestIdToRequest.get(event.requestId);
        if (!request2)
          return;
        const response2 = request2.request._existingResponse();
        if (response2) {
          const responseReceivedPayload = this._requestIdToResponseReceivedPayloadEvent.get(event.requestId);
          response2._serverAddrFinished(parseRemoteAddress2(event?.metrics?.remoteAddress));
          response2._securityDetailsFinished({
            protocol: isLoadedSecurely2(response2.url(), response2.timing()) ? event.metrics?.securityConnection?.protocol : void 0,
            subjectName: responseReceivedPayload?.response.security?.certificate?.subject,
            validFrom: responseReceivedPayload?.response.security?.certificate?.validFrom,
            validTo: responseReceivedPayload?.response.security?.certificate?.validUntil
          });
          response2._setHttpVersion(event.metrics?.protocol ?? null);
          response2.setEncodedBodySize(event.metrics?.responseBodyBytesReceived ?? null);
          response2.setResponseHeadersSize(event.metrics?.responseHeaderBytesReceived ?? null);
          response2._requestFinished(helper.secondsToRoundishMillis(event.timestamp - request2._timestamp));
        } else {
          request2.request.setRawRequestHeaders(null);
        }
        this._requestIdToResponseReceivedPayloadEvent.delete(event.requestId);
        this._requestIdToRequest.delete(event.requestId);
        this._page.frameManager.reportRequestFinished(request2.request, response2);
      }
      _onLoadingFailed(session2, event) {
        const requestWillBeSentEvent = this._requestIdToRequestWillBeSentEvent.get(event.requestId);
        if (requestWillBeSentEvent) {
          this._requestIdToRequestWillBeSentEvent.delete(event.requestId);
          this._onRequest(session2, requestWillBeSentEvent, false);
        }
        const request2 = this._requestIdToRequest.get(event.requestId);
        if (!request2)
          return;
        const response2 = request2.request._existingResponse();
        if (response2) {
          response2._serverAddrFinished();
          response2._securityDetailsFinished();
          response2._setHttpVersion(null);
          response2.setResponseHeadersSize(null);
          response2.setEncodedBodySize(null);
          response2._requestFinished(helper.secondsToRoundishMillis(event.timestamp - request2._timestamp));
        } else {
          request2.request.setRawRequestHeaders(null);
        }
        this._requestIdToRequest.delete(event.requestId);
        request2.request._setFailureText(event.errorText);
        this._page.frameManager.requestFailed(request2.request, event.errorText.includes("cancelled"));
      }
      _onWebSocketWillSendHandshakeRequest(event) {
        const wallTimeMs = event.walltime * 1e3;
        this._timestampBaselineForWebSocket.set(event.requestId, wallTimeMs - event.timestamp * 1e3);
        this._page.frameManager.onWebSocketRequest(event.requestId, headersObjectToArray(event.request.headers), wallTimeMs);
      }
      _onWebSocketClosed(event) {
        this._timestampBaselineForWebSocket.delete(event.requestId);
        this._page.frameManager.webSocketClosed(event.requestId);
      }
      _timestampToWallTimeMsForWebSocket(requestId, timestamp) {
        return this._timestampBaselineForWebSocket.get(requestId) + timestamp * 1e3;
      }
      shouldToggleStyleSheetToSyncAnimations() {
        return true;
      }
      async setDockTile(image) {
      }
    };
    BINDING_CALL_TAG = "__pw_binding_call__";
    webViewInputBootstrapSource = `(() => {
  const module = {};
  ${source7}
  window.__pwWebViewInput = new (module.exports.default())(window, document);
})()`;
    bindingBridgeSource = `
  if (!window['${PageBinding.kBindingName}']) {
    Object.defineProperty(window, '${PageBinding.kBindingName}', {
      configurable: true,
      writable: false,
      value: function(payload) { console.debug('${BINDING_CALL_TAG}', payload); },
    });
  }
`;
  }
});

// packages/playwright-core/src/server/webkit/webview/wvBrowser.ts
function deriveProxyBase(endpointURL) {
  const u = new URL(endpointURL);
  if (u.protocol === "http:" || u.protocol === "https:")
    return `${u.protocol}//${u.host}`;
  const httpProto = u.protocol === "wss:" ? "https:" : "http:";
  return `${httpProto}//${u.host}`;
}
function pageIdFromWsUrl(wsUrl) {
  const m = /\/devtools\/page\/([^/]+)/.exec(wsUrl);
  return m ? m[1] : wsUrl;
}
async function listTabs(proxyBase, headers) {
  const res = await fetch(`${proxyBase}/json`, { headers });
  if (!res.ok)
    throw new Error(`ios_webkit_debug_proxy ${proxyBase}/json returned ${res.status}`);
  const data = await res.json();
  return data.filter((t) => !!t.webSocketDebuggerUrl);
}
async function connectOverRDP(progress2, parent, params2) {
  let headersMap;
  if (params2.headers)
    headersMap = headersArrayToObject(params2.headers, false);
  if (!headersMap)
    headersMap = { "User-Agent": getUserAgent() };
  else if (!Object.keys(headersMap).some((key) => key.toLowerCase() === "user-agent"))
    headersMap["User-Agent"] = getUserAgent();
  const transport = params2.transport;
  const proxyBase = transport ? "" : deriveProxyBase(params2.endpointURL);
  const artifactsDir = params2.artifactsDir ?? import_path30.default.join(import_os16.default.tmpdir(), "playwright-artifacts-");
  const doCleanup = async () => {
    await removeFolders([artifactsDir]);
  };
  const browser = await progress2.race((async () => {
    const dialogBridge = await DialogBridge.start();
    const created = new WVBrowser(parent, proxyBase, headersMap, dialogBridge, transport, {
      slowMo: params2.slowMo,
      name: "webkit",
      browserType: "webkit",
      browserProcess: { close: async () => {
      }, kill: async () => {
      } },
      protocolLogger: helper.debugProtocolLogger(),
      browserLogsCollector: new RecentLogsCollector(),
      artifactsDir,
      downloadsPath: artifactsDir,
      tracesDir: artifactsDir,
      originalLaunchOptions: {}
    });
    const shutdown = async () => {
      await created._closeAllTabs();
      await dialogBridge.close().catch(() => {
      });
      await doCleanup();
    };
    created.options.browserProcess = { close: shutdown, kill: shutdown };
    await created._initialize();
    return created;
  })());
  if (!params2.isLocal)
    browser._isBrowserCollocatedWithServer = false;
  browser.on(Browser.Events.Disconnected, doCleanup);
  return browser;
}
var import_os16, import_path30, ws2, DeferredWebSocketTransport, WVBrowser, WVBrowserContext;
var init_wvBrowser = __esm({
  "packages/playwright-core/src/server/webkit/webview/wvBrowser.ts"() {
    "use strict";
    import_os16 = __toESM(require("os"));
    import_path30 = __toESM(require("path"));
    init_debugLogger();
    init_fileUtils();
    init_happyEyeballs();
    init_headers();
    init_browser();
    init_helper();
    init_transport();
    init_userAgent();
    init_browserContext();
    init_dialogBridge();
    init_wvConnection();
    init_wvPage();
    ws2 = require("./utilsBundle").ws;
    DeferredWebSocketTransport = class {
      constructor(url2, headers) {
        this._closed = false;
        this._url = url2;
        this._headers = headers;
      }
      open() {
        if (this._closed)
          return;
        const url2 = this._url;
        this._ws = new ws2(url2, [], {
          maxPayload: 256 * 1024 * 1024,
          headers: this._headers,
          followRedirects: true,
          agent: /^(https|wss):\/\//.test(url2) ? httpsHappyEyeballsAgent : httpHappyEyeballsAgent,
          perMessageDeflate: perMessageDeflate2,
          allowSynchronousEvents: false
        });
        this._ws.addEventListener("message", (event) => {
          const eventData = event.data;
          let parsedJson;
          try {
            parsedJson = JSON.parse(eventData);
            this.onmessage?.(parsedJson);
          } catch {
            this._ws?.close();
          }
        });
        this._ws.addEventListener("close", (event) => {
          this.onclose?.(event.reason);
        });
        this._ws.addEventListener("error", () => {
        });
      }
      send(message) {
        this._ws?.send(JSON.stringify(message));
      }
      close() {
        this._closed = true;
        this._ws?.close();
      }
    };
    WVBrowser = class extends Browser {
      constructor(parent, proxyBase, headers, dialogBridge, directPageTransport, options) {
        super(parent, options);
        this._tabs = /* @__PURE__ */ new Map();
        this._didCloseFired = false;
        this._proxyBase = proxyBase;
        this._headers = headers;
        this._dialogBridge = dialogBridge;
        this._directPageTransport = directPageTransport;
        this._context = new WVBrowserContext(this);
      }
      async _initialize() {
        await this._context.initialize();
        if (this._directPageTransport) {
          await this._attachTab("rdp-transport", this._directPageTransport);
        } else {
          await this._syncTabs();
          if (!this._tabs.size)
            throw new Error(`No Mobile Safari tabs found at ${this._proxyBase}/json \u2014 open Safari first.`);
        }
        this._page = this._firstTab().page;
      }
      _firstTab() {
        return this._tabs.values().next().value;
      }
      async _syncTabs() {
        const tabs = await listTabs(this._proxyBase, this._headers);
        const seen = /* @__PURE__ */ new Set();
        for (const tab2 of tabs) {
          const pageId4 = pageIdFromWsUrl(tab2.webSocketDebuggerUrl);
          seen.add(pageId4);
          if (this._tabs.has(pageId4))
            continue;
          try {
            await this._attachTab(pageId4, new DeferredWebSocketTransport(tab2.webSocketDebuggerUrl, this._headers));
          } catch (e) {
            debugLogger.log("error", `webview: failed to attach to tab ${pageId4}: ${e.message}`);
          }
        }
        for (const pageId4 of Array.from(this._tabs.keys())) {
          if (!seen.has(pageId4))
            this._detachTab(pageId4);
        }
      }
      async _attachTab(pageId4, transport) {
        const connection = new WVConnection(transport, () => this._detachTab(pageId4), this.options.protocolLogger, this.options.browserLogsCollector);
        const dialogEndpoint = this._dialogBridge.endpointFor(pageId4);
        const page = new WVPage(this._context, connection.outerSession, dialogEndpoint);
        this._dialogBridge.registerTab(pageId4, (req) => page.onBridgeDialog(req));
        this._tabs.set(pageId4, { pageId: pageId4, transport, connection, page });
        transport.open?.();
        connection.outerSession.sendMayFail("Target.setPauseOnStart", { pauseOnStart: true });
        await page.waitForInitialized();
      }
      _detachTab(pageId4) {
        const entry = this._tabs.get(pageId4);
        if (!entry)
          return;
        this._tabs.delete(pageId4);
        this._dialogBridge.unregisterTab(pageId4);
        entry.connection.close();
        entry.page.didClose();
      }
      async _closeAllTabs() {
        for (const pageId4 of Array.from(this._tabs.keys()))
          this._detachTab(pageId4);
        this._fireDidCloseOnce();
      }
      _fireDidCloseOnce() {
        if (this._didCloseFired)
          return;
        this._didCloseFired = true;
        this.didClose();
      }
      async doCreateNewContext(options) {
        throw new Error("Not supported");
      }
      contexts() {
        return [this._context];
      }
      version() {
        return "";
      }
      userAgent() {
        return "";
      }
      isConnected() {
        return this._tabs.size > 0;
      }
    };
    WVBrowserContext = class extends BrowserContext {
      constructor(browser) {
        super(browser, {}, "");
        this.authenticateProxyViaHeader();
      }
      possiblyUninitializedPages() {
        return Array.from(this._browser._tabs.values()).map((entry) => entry.page._page);
      }
      async doCreateNewPage() {
        throw new Error("Not supported");
      }
      async doGetCookies(urls) {
        return [];
      }
      async addCookies(cookies) {
        throw new Error("Method not implemented.");
      }
      async doClearCookies() {
        throw new Error("Method not implemented.");
      }
      async doGrantPermissions(origin, permissions) {
        throw new Error("Method not implemented.");
      }
      async doClearPermissions() {
        throw new Error("Method not implemented.");
      }
      async setGeolocation(geolocation) {
        throw new Error("Method not implemented.");
      }
      async doUpdateExtraHTTPHeaders() {
        for (const page of this.pages())
          await page.delegate.updateExtraHTTPHeaders();
      }
      async doAddInitScript(initScript) {
        for (const page of this.pages())
          await page.delegate._updateBootstrapScript();
      }
      async doRemoveInitScripts(initScripts) {
        for (const page of this.pages())
          await page.delegate._updateBootstrapScript();
      }
      async doUpdateRequestInterception() {
        for (const page of this.pages())
          await page.delegate.updateRequestInterception();
      }
      async doExposePlaywrightBinding() {
        for (const page of this.pages())
          await page.delegate.exposePlaywrightBinding();
      }
      async onClosePersistent() {
      }
      async doUpdateDefaultViewport() {
      }
      async doUpdateDefaultEmulatedMedia() {
      }
      async clearCache() {
        throw new Error("Method not implemented.");
      }
      async doClose(reason) {
        throw new Error("Method not implemented.");
      }
      async cancelDownload(uuid) {
        throw new Error("Method not implemented.");
      }
      async setUserAgent(userAgent) {
        throw new Error("Method not implemented.");
      }
      async doSetHTTPCredentials(httpCredentials) {
        throw new Error("Method not implemented.");
      }
      async doUpdateOffline() {
        throw new Error("Method not implemented.");
      }
    };
  }
});

// packages/playwright-core/src/server/webkit/webkit.ts
async function translatePathToWSL(path59) {
  const { stdout } = await spawnAsync("wsl.exe", ["-d", "playwright", "--cd", "/home/pwuser", "wslpath", path59.replace(/\\/g, "\\\\")]);
  return stdout.toString().trim();
}
var import_path31, WebKit;
var init_webkit = __esm({
  "packages/playwright-core/src/server/webkit/webkit.ts"() {
    "use strict";
    import_path31 = __toESM(require("path"));
    init_ascii();
    init_spawnAsync();
    init_wkConnection();
    init_browserType();
    init_wkBrowser();
    init_wvBrowser();
    WebKit = class extends BrowserType {
      constructor(parent) {
        super(parent, "webkit");
      }
      connectToTransport(transport, options) {
        return WKBrowser.connect(this.attribution.playwright, transport, options);
      }
      async connectOverCDP(progress2, params2) {
        return connectOverRDP(progress2, this, params2);
      }
      amendEnvironment(env, userDataDir, isPersistent, options) {
        return {
          ...env,
          CURL_COOKIE_JAR_PATH: process.platform === "win32" && isPersistent ? import_path31.default.join(userDataDir, "cookiejar.db") : void 0
        };
      }
      doRewriteStartupLog(logs) {
        if (logs.includes("Failed to open display") || logs.includes("cannot open display"))
          logs = "\n" + wrapInASCIIBox(kNoXServerRunningError, 1);
        return logs;
      }
      attemptToGracefullyCloseBrowser(transport) {
        transport.send({ method: "Playwright.close", params: {}, id: kBrowserCloseMessageId4 });
      }
      async defaultArgs(options, isPersistent, userDataDir) {
        const { args = [], headless } = options;
        const userDataDirArg = args.find((arg) => arg.startsWith("--user-data-dir"));
        if (userDataDirArg)
          throw this._createUserDataDirArgMisuseError("--user-data-dir");
        if (args.find((arg) => !arg.startsWith("-")))
          throw new Error("Arguments can not specify page to be opened");
        const webkitArguments = ["--inspector-pipe"];
        if (process.platform === "win32" && options.channel !== "webkit-wsl")
          webkitArguments.push("--disable-accelerated-compositing");
        if (headless)
          webkitArguments.push("--headless");
        if (isPersistent)
          webkitArguments.push(`--user-data-dir=${options.channel === "webkit-wsl" ? await translatePathToWSL(userDataDir) : userDataDir}`);
        else
          webkitArguments.push(`--no-startup-window`);
        const proxy = options.proxyOverride || options.proxy;
        if (proxy) {
          if (process.platform === "darwin") {
            webkitArguments.push(`--proxy=${proxy.server}`);
            if (proxy.bypass)
              webkitArguments.push(`--proxy-bypass-list=${proxy.bypass}`);
          } else if (process.platform === "linux" || process.platform === "win32" && options.channel === "webkit-wsl") {
            webkitArguments.push(`--proxy=${proxy.server}`);
            if (proxy.bypass)
              webkitArguments.push(...proxy.bypass.split(",").map((t) => `--ignore-host=${t}`));
          } else if (process.platform === "win32") {
            webkitArguments.push(`--curl-proxy=${proxy.server.replace(/^socks5:\/\//, "socks5h://")}`);
            if (proxy.bypass)
              webkitArguments.push(`--curl-noproxy=${proxy.bypass}`);
          }
        }
        webkitArguments.push(...args);
        if (isPersistent)
          webkitArguments.push("about:blank");
        return webkitArguments;
      }
    };
  }
});

// packages/playwright-core/src/server/playwright.ts
var playwright_exports = {};
__export(playwright_exports, {
  Playwright: () => Playwright,
  createPlaywright: () => createPlaywright
});
function createPlaywright(options) {
  return new Playwright(options);
}
var Playwright;
var init_playwright = __esm({
  "packages/playwright-core/src/server/playwright.ts"() {
    "use strict";
    init_android();
    init_backendAdb();
    init_bidiChromium();
    init_bidiFirefox();
    init_chromium();
    init_debugController();
    init_electron();
    init_firefox();
    init_instrumentation();
    init_webkit();
    Playwright = class extends SdkObject {
      constructor(options) {
        super(createRootSdkObject(), void 0, "Playwright");
        this._allPages = /* @__PURE__ */ new Set();
        this._allBrowsers = /* @__PURE__ */ new Set();
        this.options = options;
        this.attribution.playwright = this;
        this.instrumentation.addListener({
          onBrowserOpen: (browser) => this._allBrowsers.add(browser),
          onBrowserClose: (browser) => this._allBrowsers.delete(browser),
          onPageOpen: (page) => this._allPages.add(page),
          onPageClose: (page) => this._allPages.delete(page)
        }, null);
        this.chromium = new Chromium(this, new BidiChromium(this));
        this.firefox = new Firefox(this, new BidiFirefox(this));
        this.webkit = new WebKit(this);
        this.electron = new Electron(this);
        this.android = new Android(this, new AdbBackend());
        this.debugController = new DebugController(this);
      }
      allBrowsers() {
        return [...this._allBrowsers];
      }
      allPages() {
        return [...this._allPages];
      }
    };
  }
});

// packages/playwright-core/src/server/recorder/recorderApp.ts
function determinePrimaryGeneratorId(sdkLanguage) {
  for (const language of languageSet()) {
    if (language.highlighter === sdkLanguage)
      return language.id;
  }
  return sdkLanguage;
}
function findPageByGuid(context2, guid) {
  return context2.pages().find((p) => p.guid === guid);
}
function createRecorderFrontend(page) {
  return new Proxy({}, {
    get: (_target, prop) => {
      if (typeof prop !== "string")
        return void 0;
      return (params2) => {
        page.mainFrame().evaluateExpression(nullProgress, ((event) => {
          window.dispatch(event);
        }).toString(), { isFunction: true }, { method: prop, params: params2 }).catch(() => {
        });
      };
    }
  });
}
var import_fs30, import_path32, mime7, RecorderApp, ProgrammaticRecorderApp, recorderAppSymbol;
var init_recorderApp = __esm({
  "packages/playwright-core/src/server/recorder/recorderApp.ts"() {
    "use strict";
    import_fs30 = __toESM(require("fs"));
    import_path32 = __toESM(require("path"));
    init_debug();
    init_package();
    init_launchApp();
    init_launchApp();
    init_progress();
    init_throttledFile();
    init_languages();
    init_recorderUtils();
    init_language();
    init_recorder();
    init_browserContext();
    mime7 = require("./utilsBundle").mime;
    RecorderApp = class _RecorderApp {
      constructor(recorder, params2, page, wsEndpointForTest) {
        this._throttledOutputFile = null;
        this._actions = [];
        this._userSources = [];
        this._recorderSources = [];
        this._page = page;
        this._recorder = recorder;
        this._frontend = createRecorderFrontend(page);
        this.wsEndpointForTest = wsEndpointForTest;
        this._languageGeneratorOptions = {
          browserName: params2.browserName,
          launchOptions: { headless: false, ...params2.launchOptions, tracesDir: void 0 },
          contextOptions: { ...params2.contextOptions },
          deviceName: params2.device,
          saveStorage: params2.saveStorage
        };
        this._throttledOutputFile = params2.outputFile ? new ThrottledFile(params2.outputFile) : null;
        this._primaryGeneratorId = process.env.TEST_INSPECTOR_LANGUAGE || params2.language || determinePrimaryGeneratorId(params2.sdkLanguage);
        this._selectedGeneratorId = this._primaryGeneratorId;
        for (const languageGenerator of languageSet()) {
          if (languageGenerator.id === this._primaryGeneratorId)
            this._recorder.setLanguage(languageGenerator.highlighter);
        }
      }
      async _init(inspectedContext) {
        await syncLocalStorageWithSettings(this._page, "recorder");
        const controller = new ProgressController();
        await controller.run(async (progress2) => {
          await this._page.addRequestInterceptor(progress2, (route2) => {
            if (!route2.request().url().startsWith("https://playwright/")) {
              route2.continue({ isFallback: true }).catch(() => {
              });
              return;
            }
            const uri = route2.request().url().substring("https://playwright/".length);
            const file = import_path32.default.join(libPath("vite", "recorder"), uri);
            import_fs30.default.promises.readFile(file).then((buffer) => {
              route2.fulfill({
                status: 200,
                headers: [
                  { name: "Content-Type", value: mime7.getType(import_path32.default.extname(file)) || "application/octet-stream" }
                ],
                body: buffer.toString("base64"),
                isBase64: true
              }).catch(() => {
              });
            });
          });
          await this._createDispatcher(progress2);
          this._page.once("close", () => {
            this._recorder.close();
            this._page.browserContext.close(nullProgress, { reason: "Recorder window closed" }).catch(() => {
            });
            delete inspectedContext[recorderAppSymbol];
          });
          await this._page.mainFrame().goto(progress2, "https://playwright/index.html");
        });
        const url2 = this._recorder.url();
        if (url2)
          this._frontend.pageNavigated({ url: url2 });
        this._frontend.modeChanged({ mode: this._recorder.mode() });
        this._frontend.pauseStateChanged({ paused: this._recorder.paused() });
        this._updateActions("reveal");
        this._onUserSourcesChanged(this._recorder.userSources(), this._recorder.pausedSourceId());
        this._frontend.callLogsUpdated({ callLogs: this._recorder.callLog() });
        this._wireListeners(this._recorder);
      }
      async _createDispatcher(progress2) {
        const dispatcher = {
          clear: async () => {
            this._actions = [];
            this._updateActions("reveal");
            this._recorder.clear();
          },
          fileChanged: async (params2) => {
            const source11 = [...this._recorderSources, ...this._userSources].find((s) => s.id === params2.fileId);
            if (source11) {
              if (source11.isRecorded)
                this._selectedGeneratorId = source11.id;
              await this._recorder.setLanguage(source11.language);
            }
          },
          setAutoExpect: async (params2) => {
            this._languageGeneratorOptions.generateAutoExpect = params2.autoExpect;
            this._updateActions();
          },
          setMode: async (params2) => {
            await this._recorder.setMode(params2.mode);
          },
          resume: async () => {
            this._recorder.resume();
          },
          pause: async () => {
            this._recorder.pause();
          },
          step: async () => {
            this._recorder.step();
          },
          highlightRequested: async (params2) => {
            if (params2.selector)
              await this._recorder.setHighlightedSelector(params2.selector);
            if (params2.ariaTemplate)
              await this._recorder.setHighlightedAriaTemplate(params2.ariaTemplate);
          }
        };
        await this._page.exposeBinding(progress2, "sendCommand", async (_, data) => {
          const { method, params: params2 } = data;
          return await dispatcher[method].call(dispatcher, params2);
        });
      }
      static async show(context2, params2) {
        if (process.env.PW_CODEGEN_NO_INSPECTOR)
          return;
        const recorder = await Recorder.forContext(context2, params2);
        if (params2.recorderMode === "api") {
          const browserName = context2._browser.options.name;
          await ProgrammaticRecorderApp.run(context2, recorder, browserName, params2);
          return;
        }
        await _RecorderApp._show(recorder, context2, params2);
      }
      async close() {
        await this._page.close(nullProgress);
      }
      static showInspectorNoReply(context2) {
        if (process.env.PW_CODEGEN_NO_INSPECTOR)
          return;
        void Recorder.forContext(context2, {}).then((recorder) => _RecorderApp._show(recorder, context2, {})).catch(() => {
        });
      }
      static async _show(recorder, inspectedContext, params2) {
        if (inspectedContext[recorderAppSymbol])
          return;
        inspectedContext[recorderAppSymbol] = true;
        const sdkLanguage = inspectedContext._browser.sdkLanguage();
        const isChromium = inspectedContext._browser.options.browserType === "chromium";
        const headed = !!inspectedContext._browser.options.headful;
        const { createPlaywright: createPlaywright2 } = (init_playwright(), __toCommonJS(playwright_exports));
        const recorderPlaywright = createPlaywright2({ sdkLanguage: "javascript", isInternalPlaywright: true });
        const { context: appContext, page } = await launchApp(recorderPlaywright.chromium, {
          sdkLanguage,
          windowSize: { width: 600, height: 600 },
          windowPosition: { x: 1020, y: 10 },
          persistentContextOptions: {
            noDefaultViewport: true,
            headless: !!process.env.PWTEST_CLI_HEADLESS || isUnderTest() && !headed,
            args: isUnderTest() ? ["--remote-debugging-port=0"] : void 0,
            handleSIGINT: params2.handleSIGINT,
            executablePath: isChromium ? inspectedContext._browser.options.customExecutablePath : void 0,
            // Use the same channel as the inspected context to guarantee that the browser is installed.
            channel: isChromium ? inspectedContext._browser.options.channel : void 0
          }
        });
        const controller = new ProgressController();
        await controller.run(async (progress2) => {
          await appContext._browser._defaultContext.loadDefaultContextAsIs(progress2);
        });
        const appParams = {
          browserName: inspectedContext._browser.options.name,
          sdkLanguage: inspectedContext._browser.sdkLanguage(),
          wsEndpointForTest: inspectedContext._browser.options.wsEndpoint,
          headed: !!inspectedContext._browser.options.headful,
          executablePath: isChromium ? inspectedContext._browser.options.customExecutablePath : void 0,
          channel: isChromium ? inspectedContext._browser.options.channel : void 0,
          ...params2
        };
        const recorderApp = new _RecorderApp(recorder, appParams, page, appContext._browser.options.wsEndpoint);
        await recorderApp._init(inspectedContext);
        inspectedContext.recorderAppForTest = recorderApp;
      }
      _wireListeners(recorder) {
        recorder.on(RecorderEvent.ActionAdded, (action) => {
          this._onActionAdded(action);
        });
        recorder.on(RecorderEvent.SignalAdded, (signal) => {
          this._onSignalAdded(signal);
        });
        recorder.on(RecorderEvent.PageNavigated, (url2) => {
          this._frontend.pageNavigated({ url: url2 });
        });
        recorder.on(RecorderEvent.ContextClosed, () => {
          this._throttledOutputFile?.flush();
          this._page.browserContext.close(nullProgress, { reason: "Recorder window closed" }).catch(() => {
          });
        });
        recorder.on(RecorderEvent.ModeChanged, (mode) => {
          this._frontend.modeChanged({ mode });
        });
        recorder.on(RecorderEvent.PausedStateChanged, (paused) => {
          this._frontend.pauseStateChanged({ paused });
        });
        recorder.on(RecorderEvent.UserSourcesChanged, (sources, pausedSourceId) => {
          this._onUserSourcesChanged(sources, pausedSourceId);
        });
        recorder.on(RecorderEvent.ElementPicked, (elementInfo, userGesture) => {
          if (userGesture)
            this._page.bringToFront(nullProgress).catch(() => {
            });
          this._frontend.elementPicked({ elementInfo, userGesture });
        });
        recorder.on(RecorderEvent.CallLogsUpdated, (callLogs) => {
          this._frontend.callLogsUpdated({ callLogs });
        });
      }
      _onActionAdded(action) {
        this._actions.push(action);
        this._updateActions("reveal");
      }
      _onSignalAdded(signal) {
        const lastAction = this._actions.findLast((a) => a.frame.pageGuid === signal.frame.pageGuid);
        if (lastAction)
          lastAction.action.signals.push(signal.signal);
        this._updateActions();
      }
      _onUserSourcesChanged(sources, pausedSourceId) {
        if (!sources.length && !this._userSources.length)
          return;
        this._userSources = sources;
        this._pushAllSources();
        this._revealSource(pausedSourceId);
      }
      _pushAllSources() {
        const sources = [...this._userSources, ...this._recorderSources];
        this._frontend.sourcesUpdated({ sources });
      }
      _revealSource(sourceId) {
        if (!sourceId)
          return;
        this._frontend.sourceRevealRequested({ sourceId });
      }
      _updateActions(reveal) {
        const recorderSources = [];
        const actions = collapseActions(this._actions);
        let revealSourceId;
        for (const languageGenerator of languageSet()) {
          const { header, footer, actionTexts, text: text2 } = generateCode(actions, languageGenerator, this._languageGeneratorOptions);
          const source11 = {
            isRecorded: true,
            label: languageGenerator.name,
            group: languageGenerator.groupName,
            id: languageGenerator.id,
            text: text2,
            header,
            footer,
            actions: actionTexts,
            language: languageGenerator.highlighter,
            highlight: []
          };
          source11.revealLine = text2.split("\n").length - 1;
          recorderSources.push(source11);
          if (languageGenerator.id === this._primaryGeneratorId)
            this._throttledOutputFile?.setContent(source11.text);
          if (reveal === "reveal" && source11.id === this._selectedGeneratorId)
            revealSourceId = source11.id;
        }
        this._recorderSources = recorderSources;
        this._pushAllSources();
        this._revealSource(revealSourceId);
      }
    };
    ProgrammaticRecorderApp = class {
      static async run(inspectedContext, recorder, browserName, params2) {
        let lastAction = null;
        const languages = [...languageSet()];
        const languageGeneratorOptions = {
          browserName,
          launchOptions: { headless: false, ...params2.launchOptions, tracesDir: void 0 },
          contextOptions: { ...params2.contextOptions },
          deviceName: params2.device,
          saveStorage: params2.saveStorage
        };
        const languageGenerator = languages.find((l) => l.id === params2.language) ?? languages.find((l) => l.id === "playwright-test");
        recorder.on(RecorderEvent.ActionAdded, (action) => {
          const page = findPageByGuid(inspectedContext, action.frame.pageGuid);
          if (!page)
            return;
          const { actionTexts } = generateCode([action], languageGenerator, languageGeneratorOptions);
          if (!lastAction || !shouldMergeAction(action, lastAction))
            inspectedContext.emit(BrowserContext.Events.RecorderEvent, { event: "actionAdded", data: action, page, code: actionTexts.join("\n") });
          else
            inspectedContext.emit(BrowserContext.Events.RecorderEvent, { event: "actionUpdated", data: action, page, code: actionTexts.join("\n") });
          lastAction = action;
        });
        recorder.on(RecorderEvent.SignalAdded, (signal) => {
          const page = findPageByGuid(inspectedContext, signal.frame.pageGuid);
          if (!page)
            return;
          inspectedContext.emit(BrowserContext.Events.RecorderEvent, { event: "signalAdded", data: signal, page, code: "" });
        });
      }
    };
    recorderAppSymbol = Symbol("recorderApp");
  }
});

// packages/playwright-core/src/server/selectors.ts
var Selectors;
var init_selectors = __esm({
  "packages/playwright-core/src/server/selectors.ts"() {
    "use strict";
    init_selectorParser();
    init_crypto();
    Selectors = class {
      constructor(engines, testIdAttributeName2) {
        this.guid = `selectors@${createGuid()}`;
        this._builtinEngines = /* @__PURE__ */ new Set([
          "css",
          "css:light",
          "xpath",
          "xpath:light",
          "_react",
          "_vue",
          "text",
          "text:light",
          "id",
          "id:light",
          "data-testid",
          "data-testid:light",
          "data-test-id",
          "data-test-id:light",
          "data-test",
          "data-test:light",
          "nth",
          "visible",
          "internal:control",
          "internal:has",
          "internal:has-not",
          "internal:has-text",
          "internal:has-not-text",
          "internal:and",
          "internal:or",
          "internal:chain",
          "role",
          "internal:attr",
          "internal:label",
          "internal:text",
          "internal:role",
          "internal:testid",
          "internal:describe",
          "aria-ref"
        ]);
        this._builtinEnginesInMainWorld = /* @__PURE__ */ new Set([
          "_react",
          "_vue"
        ]);
        this._engines = /* @__PURE__ */ new Map();
        this._testIdAttributeName = testIdAttributeName2 ?? "data-testid";
        for (const engine of engines)
          this.register(engine);
      }
      register(engine) {
        if (!engine.name.match(/^[a-zA-Z_0-9-]+$/))
          throw new Error("Selector engine name may only contain [a-zA-Z0-9_] characters");
        if (this._builtinEngines.has(engine.name) || engine.name === "zs" || engine.name === "zs:light")
          throw new Error(`"${engine.name}" is a predefined selector engine`);
        if (this._engines.has(engine.name))
          throw new Error(`"${engine.name}" selector engine has been already registered`);
        this._engines.set(engine.name, engine);
      }
      testIdAttributeName() {
        return this._testIdAttributeName;
      }
      setTestIdAttributeName(testIdAttributeName2) {
        this._testIdAttributeName = testIdAttributeName2;
      }
      parseSelector(selector, strict) {
        const parsed = typeof selector === "string" ? parseSelector(selector) : selector;
        let needsMainWorld = false;
        visitAllSelectorParts(parsed, (part) => {
          const name = part.name;
          const custom = this._engines.get(name);
          if (!custom && !this._builtinEngines.has(name))
            throw new InvalidSelectorError(`Unknown engine "${name}" while parsing selector ${stringifySelector(parsed)}`);
          if (custom && !custom.contentScript)
            needsMainWorld = true;
          if (this._builtinEnginesInMainWorld.has(name))
            needsMainWorld = true;
        });
        return {
          parsed,
          world: needsMainWorld ? "main" : "utility",
          strict
        };
      }
    };
  }
});

// packages/playwright-core/src/generated/storageScriptSource.ts
var source9;
var init_storageScriptSource = __esm({
  "packages/playwright-core/src/generated/storageScriptSource.ts"() {
    "use strict";
    source9 = '\nvar __commonJS = obj => {\n  let required = false;\n  let result;\n  return function __require() {\n    if (!required) {\n      required = true;\n      let fn;\n      for (const name in obj) { fn = obj[name]; break; }\n      const module = { exports: {} };\n      fn(module.exports, module);\n      result = module.exports;\n    }\n    return result;\n  }\n};\nvar __export = (target, all) => {for (var name in all) target[name] = all[name];};\nvar __toESM = mod => ({ ...mod, \'default\': mod });\nvar __toCommonJS = mod => ({ ...mod, __esModule: true });\n\n\n// packages/injected/src/storageScript.ts\nvar storageScript_exports = {};\n__export(storageScript_exports, {\n  StorageScript: () => StorageScript\n});\nmodule.exports = __toCommonJS(storageScript_exports);\n\n// packages/isomorphic/utilityScriptSerializers.ts\nfunction isRegExp(obj) {\n  try {\n    return obj instanceof RegExp || Object.prototype.toString.call(obj) === "[object RegExp]";\n  } catch (error) {\n    return false;\n  }\n}\nfunction isDate(obj) {\n  try {\n    return obj instanceof Date || Object.prototype.toString.call(obj) === "[object Date]";\n  } catch (error) {\n    return false;\n  }\n}\nfunction isURL(obj) {\n  try {\n    return obj instanceof URL || Object.prototype.toString.call(obj) === "[object URL]";\n  } catch (error) {\n    return false;\n  }\n}\nfunction isError(obj) {\n  var _a;\n  try {\n    return obj instanceof Error || obj && ((_a = Object.getPrototypeOf(obj)) == null ? void 0 : _a.name) === "Error";\n  } catch (error) {\n    return false;\n  }\n}\nfunction isTypedArray(obj, constructor) {\n  try {\n    return obj instanceof constructor || Object.prototype.toString.call(obj) === `[object ${constructor.name}]`;\n  } catch (error) {\n    return false;\n  }\n}\nfunction isArrayBuffer(obj) {\n  try {\n    return obj instanceof ArrayBuffer || Object.prototype.toString.call(obj) === "[object ArrayBuffer]";\n  } catch (error) {\n    return false;\n  }\n}\nvar typedArrayConstructors = {\n  i8: Int8Array,\n  ui8: Uint8Array,\n  ui8c: Uint8ClampedArray,\n  i16: Int16Array,\n  ui16: Uint16Array,\n  i32: Int32Array,\n  ui32: Uint32Array,\n  // TODO: add Float16Array once it\'s in baseline\n  f32: Float32Array,\n  f64: Float64Array,\n  bi64: BigInt64Array,\n  bui64: BigUint64Array\n};\nfunction typedArrayToBase64(array) {\n  if ("toBase64" in array)\n    return array.toBase64();\n  const binary = Array.from(new Uint8Array(array.buffer, array.byteOffset, array.byteLength)).map((b) => String.fromCharCode(b)).join("");\n  return btoa(binary);\n}\nfunction base64ToTypedArray(base64, TypedArrayConstructor) {\n  const binary = atob(base64);\n  const bytes = new Uint8Array(binary.length);\n  for (let i = 0; i < binary.length; i++)\n    bytes[i] = binary.charCodeAt(i);\n  return new TypedArrayConstructor(bytes.buffer);\n}\nfunction parseEvaluationResultValue(value, handles = [], refs = /* @__PURE__ */ new Map()) {\n  if (Object.is(value, void 0))\n    return void 0;\n  if (typeof value === "object" && value) {\n    if ("ref" in value)\n      return refs.get(value.ref);\n    if ("v" in value) {\n      if (value.v === "undefined")\n        return void 0;\n      if (value.v === "null")\n        return null;\n      if (value.v === "NaN")\n        return NaN;\n      if (value.v === "Infinity")\n        return Infinity;\n      if (value.v === "-Infinity")\n        return -Infinity;\n      if (value.v === "-0")\n        return -0;\n      return void 0;\n    }\n    if ("d" in value) {\n      return new Date(value.d);\n    }\n    if ("u" in value)\n      return new URL(value.u);\n    if ("bi" in value)\n      return BigInt(value.bi);\n    if ("e" in value) {\n      const error = new Error(value.e.m);\n      error.name = value.e.n;\n      error.stack = value.e.s;\n      return error;\n    }\n    if ("r" in value)\n      return new RegExp(value.r.p, value.r.f);\n    if ("a" in value) {\n      const result = [];\n      refs.set(value.id, result);\n      for (const a of value.a)\n        result.push(parseEvaluationResultValue(a, handles, refs));\n      return result;\n    }\n    if ("o" in value) {\n      const result = {};\n      refs.set(value.id, result);\n      for (const { k, v } of value.o) {\n        if (k === "__proto__")\n          continue;\n        result[k] = parseEvaluationResultValue(v, handles, refs);\n      }\n      return result;\n    }\n    if ("h" in value)\n      return handles[value.h];\n    if ("ta" in value)\n      return base64ToTypedArray(value.ta.b, typedArrayConstructors[value.ta.k]);\n    if ("ab" in value)\n      return base64ToTypedArray(value.ab.b, Uint8Array).buffer;\n  }\n  return value;\n}\nfunction serializeAsCallArgument(value, handleSerializer) {\n  return serialize(value, handleSerializer, { visited: /* @__PURE__ */ new Map(), lastId: 0 });\n}\nfunction serialize(value, handleSerializer, visitorInfo) {\n  if (value && typeof value === "object") {\n    if (typeof globalThis.Window === "function" && value instanceof globalThis.Window)\n      return "ref: <Window>";\n    if (typeof globalThis.Document === "function" && value instanceof globalThis.Document)\n      return "ref: <Document>";\n    if (typeof globalThis.Node === "function" && value instanceof globalThis.Node)\n      return "ref: <Node>";\n  }\n  return innerSerialize(value, handleSerializer, visitorInfo);\n}\nfunction innerSerialize(value, handleSerializer, visitorInfo) {\n  var _a;\n  const result = handleSerializer(value);\n  if ("fallThrough" in result)\n    value = result.fallThrough;\n  else\n    return result;\n  if (typeof value === "symbol")\n    return { v: "undefined" };\n  if (Object.is(value, void 0))\n    return { v: "undefined" };\n  if (Object.is(value, null))\n    return { v: "null" };\n  if (Object.is(value, NaN))\n    return { v: "NaN" };\n  if (Object.is(value, Infinity))\n    return { v: "Infinity" };\n  if (Object.is(value, -Infinity))\n    return { v: "-Infinity" };\n  if (Object.is(value, -0))\n    return { v: "-0" };\n  if (typeof value === "boolean")\n    return value;\n  if (typeof value === "number")\n    return value;\n  if (typeof value === "string")\n    return value;\n  if (typeof value === "bigint")\n    return { bi: value.toString() };\n  if (isError(value)) {\n    let stack;\n    if ((_a = value.stack) == null ? void 0 : _a.startsWith(value.name + ": " + value.message)) {\n      stack = value.stack;\n    } else {\n      stack = `${value.name}: ${value.message}\n${value.stack}`;\n    }\n    return { e: { n: value.name, m: value.message, s: stack } };\n  }\n  if (isDate(value))\n    return { d: value.toJSON() };\n  if (isURL(value))\n    return { u: value.toJSON() };\n  if (isRegExp(value))\n    return { r: { p: value.source, f: value.flags } };\n  for (const [k, ctor] of Object.entries(typedArrayConstructors)) {\n    if (isTypedArray(value, ctor))\n      return { ta: { b: typedArrayToBase64(value), k } };\n  }\n  if (isArrayBuffer(value))\n    return { ab: { b: typedArrayToBase64(new Uint8Array(value)) } };\n  const id = visitorInfo.visited.get(value);\n  if (id)\n    return { ref: id };\n  if (Array.isArray(value)) {\n    const a = [];\n    const id2 = ++visitorInfo.lastId;\n    visitorInfo.visited.set(value, id2);\n    for (let i = 0; i < value.length; ++i)\n      a.push(serialize(value[i], handleSerializer, visitorInfo));\n    return { a, id: id2 };\n  }\n  if (typeof value === "object") {\n    const o = [];\n    const id2 = ++visitorInfo.lastId;\n    visitorInfo.visited.set(value, id2);\n    for (const name of Object.keys(value)) {\n      let item;\n      try {\n        item = value[name];\n      } catch (e) {\n        continue;\n      }\n      if (name === "toJSON" && typeof item === "function")\n        o.push({ k: name, v: { o: [], id: 0 } });\n      else\n        o.push({ k: name, v: serialize(item, handleSerializer, visitorInfo) });\n    }\n    let jsonWrapper;\n    try {\n      if (o.length === 0 && value.toJSON && typeof value.toJSON === "function")\n        jsonWrapper = { value: value.toJSON() };\n    } catch (e) {\n    }\n    if (jsonWrapper)\n      return innerSerialize(jsonWrapper.value, handleSerializer, visitorInfo);\n    return { o, id: id2 };\n  }\n}\n\n// packages/injected/src/storageScript.ts\nvar StorageScript = class {\n  constructor(isFirefox) {\n    this._isFirefox = isFirefox;\n    this._global = globalThis;\n  }\n  _idbRequestToPromise(request) {\n    return new Promise((resolve, reject) => {\n      request.addEventListener("success", () => resolve(request.result));\n      request.addEventListener("error", () => reject(request.error));\n    });\n  }\n  _isPlainObject(v) {\n    const ctor = v == null ? void 0 : v.constructor;\n    if (this._isFirefox) {\n      const constructorImpl = ctor == null ? void 0 : ctor.toString();\n      if ((constructorImpl == null ? void 0 : constructorImpl.startsWith("function Object() {")) && (constructorImpl == null ? void 0 : constructorImpl.includes("[native code]")))\n        return true;\n    }\n    return ctor === Object;\n  }\n  _trySerialize(value) {\n    let trivial = true;\n    const encoded = serializeAsCallArgument(value, (v) => {\n      const isTrivial = this._isPlainObject(v) || Array.isArray(v) || typeof v === "string" || typeof v === "number" || typeof v === "boolean" || Object.is(v, null);\n      if (!isTrivial)\n        trivial = false;\n      return { fallThrough: v };\n    });\n    if (trivial)\n      return { trivial: value };\n    return { encoded };\n  }\n  async _collectDB(dbInfo) {\n    if (!dbInfo.name)\n      throw new Error("Database name is empty");\n    if (!dbInfo.version)\n      throw new Error("Database version is unset");\n    const db = await this._idbRequestToPromise(indexedDB.open(dbInfo.name));\n    if (db.objectStoreNames.length === 0)\n      return { name: dbInfo.name, version: dbInfo.version, stores: [] };\n    const transaction = db.transaction(db.objectStoreNames, "readonly");\n    const stores = await Promise.all([...db.objectStoreNames].map(async (storeName) => {\n      const objectStore = transaction.objectStore(storeName);\n      const keys = await this._idbRequestToPromise(objectStore.getAllKeys());\n      const records = await Promise.all(keys.map(async (key) => {\n        const record = {};\n        if (objectStore.keyPath === null) {\n          const { encoded: encoded2, trivial: trivial2 } = this._trySerialize(key);\n          if (trivial2)\n            record.key = trivial2;\n          else\n            record.keyEncoded = encoded2;\n        }\n        const value = await this._idbRequestToPromise(objectStore.get(key));\n        const { encoded, trivial } = this._trySerialize(value);\n        if (trivial)\n          record.value = trivial;\n        else\n          record.valueEncoded = encoded;\n        return record;\n      }));\n      const indexes = [...objectStore.indexNames].map((indexName) => {\n        const index = objectStore.index(indexName);\n        return {\n          name: index.name,\n          keyPath: typeof index.keyPath === "string" ? index.keyPath : void 0,\n          keyPathArray: Array.isArray(index.keyPath) ? index.keyPath : void 0,\n          multiEntry: index.multiEntry,\n          unique: index.unique\n        };\n      });\n      return {\n        name: storeName,\n        records,\n        indexes,\n        autoIncrement: objectStore.autoIncrement,\n        keyPath: typeof objectStore.keyPath === "string" ? objectStore.keyPath : void 0,\n        keyPathArray: Array.isArray(objectStore.keyPath) ? objectStore.keyPath : void 0\n      };\n    }));\n    return {\n      name: dbInfo.name,\n      version: dbInfo.version,\n      stores\n    };\n  }\n  async collect(recordIndexedDB) {\n    const localStorage = Object.keys(this._global.localStorage).map((name) => ({ name, value: this._global.localStorage.getItem(name) }));\n    if (!recordIndexedDB)\n      return { localStorage };\n    try {\n      const databases = await this._global.indexedDB.databases();\n      const indexedDB2 = await Promise.all(databases.map((db) => this._collectDB(db)));\n      return { localStorage, indexedDB: indexedDB2 };\n    } catch (e) {\n      throw new Error("Unable to serialize IndexedDB: " + e.message);\n    }\n  }\n  async _restoreDB(dbInfo) {\n    const openRequest = this._global.indexedDB.open(dbInfo.name, dbInfo.version);\n    openRequest.addEventListener("upgradeneeded", () => {\n      var _a, _b;\n      const db2 = openRequest.result;\n      for (const store of dbInfo.stores) {\n        const objectStore = db2.createObjectStore(store.name, { autoIncrement: store.autoIncrement, keyPath: (_a = store.keyPathArray) != null ? _a : store.keyPath });\n        for (const index of store.indexes)\n          objectStore.createIndex(index.name, (_b = index.keyPathArray) != null ? _b : index.keyPath, { unique: index.unique, multiEntry: index.multiEntry });\n      }\n    });\n    const db = await this._idbRequestToPromise(openRequest);\n    if (db.objectStoreNames.length === 0)\n      return;\n    const transaction = db.transaction(db.objectStoreNames, "readwrite");\n    await Promise.all(dbInfo.stores.map(async (store) => {\n      const objectStore = transaction.objectStore(store.name);\n      await Promise.all(store.records.map(async (record) => {\n        var _a, _b;\n        await this._idbRequestToPromise(\n          objectStore.add(\n            (_a = record.value) != null ? _a : parseEvaluationResultValue(record.valueEncoded),\n            (_b = record.key) != null ? _b : parseEvaluationResultValue(record.keyEncoded)\n          )\n        );\n      }));\n    }));\n  }\n  async restore(originState) {\n    var _a, _b, _c;\n    const registrations = this._global.navigator.serviceWorker ? await this._global.navigator.serviceWorker.getRegistrations() : [];\n    await Promise.all(registrations.map(async (r) => {\n      if (!r.installing && !r.waiting && !r.active)\n        r.unregister().catch(() => {\n        });\n      else\n        await r.unregister().catch(() => {\n        });\n    }));\n    try {\n      for (const db of await ((_b = (_a = this._global.indexedDB).databases) == null ? void 0 : _b.call(_a)) || []) {\n        if (db.name)\n          this._global.indexedDB.deleteDatabase(db.name);\n      }\n      await Promise.all(((_c = originState == null ? void 0 : originState.indexedDB) != null ? _c : []).map((dbInfo) => this._restoreDB(dbInfo)));\n    } catch (e) {\n      throw new Error("Unable to restore IndexedDB: " + e.message);\n    }\n    this._global.sessionStorage.clear();\n    this._global.localStorage.clear();\n    for (const { name, value } of (originState == null ? void 0 : originState.localStorage) || [])\n      this._global.localStorage.setItem(name, value);\n  }\n};\n';
  }
});

// packages/playwright-core/src/server/browserContext.ts
function validateBrowserContextOptions(options, browserOptions) {
  if (options.noDefaultViewport && options.deviceScaleFactor !== void 0)
    throw new Error(`"deviceScaleFactor" option is not supported with null "viewport"`);
  if (options.noDefaultViewport && !!options.isMobile)
    throw new Error(`"isMobile" option is not supported with null "viewport"`);
  if (options.acceptDownloads === void 0 && browserOptions.name !== "electron")
    options.acceptDownloads = "accept";
  else if (options.acceptDownloads === void 0 && browserOptions.name === "electron")
    options.acceptDownloads = "internal-browser-default";
  if (!options.viewport && !options.noDefaultViewport)
    options.viewport = { width: 1280, height: 720 };
  if (options.proxy)
    options.proxy = normalizeProxySettings(options.proxy);
  verifyGeolocation(options.geolocation);
}
function verifyGeolocation(geolocation) {
  if (!geolocation)
    return;
  geolocation.accuracy = geolocation.accuracy || 0;
  const { longitude, latitude, accuracy } = geolocation;
  if (longitude < -180 || longitude > 180)
    throw new Error(`geolocation.longitude: precondition -180 <= LONGITUDE <= 180 failed.`);
  if (latitude < -90 || latitude > 90)
    throw new Error(`geolocation.latitude: precondition -90 <= LATITUDE <= 90 failed.`);
  if (accuracy < 0)
    throw new Error(`geolocation.accuracy: precondition 0 <= ACCURACY failed.`);
}
function verifyClientCertificates(clientCertificates) {
  if (!clientCertificates)
    return;
  for (const cert of clientCertificates) {
    if (!cert.origin)
      throw new Error(`clientCertificates.origin is required`);
    if (!cert.cert && !cert.key && !cert.passphrase && !cert.pfx)
      throw new Error("None of cert, key, passphrase or pfx is specified");
    if (cert.cert && !cert.key)
      throw new Error("cert is specified without key");
    if (!cert.cert && cert.key)
      throw new Error("key is specified without cert");
    if (cert.pfx && (cert.cert || cert.key))
      throw new Error("pfx is specified together with cert, key or passphrase");
  }
}
function normalizeProxySettings(proxy) {
  let { server, bypass } = proxy;
  let url2;
  try {
    url2 = new URL(server);
    if (!url2.host || !url2.protocol)
      url2 = new URL("http://" + server);
  } catch (e) {
    url2 = new URL("http://" + server);
  }
  if (url2.protocol === "socks4:" && (proxy.username || proxy.password))
    throw new Error(`Socks4 proxy protocol does not support authentication`);
  if (url2.protocol === "socks5:" && (proxy.username || proxy.password))
    throw new Error(`Browser does not support socks5 proxy authentication`);
  server = url2.protocol + "//" + url2.host;
  if (bypass)
    bypass = bypass.split(",").map((t) => t.trim()).join(",");
  return { ...proxy, server, bypass };
}
var import_fs31, BrowserContextEvent, BrowserContext, paramsThatAllowContextReuse, defaultNewContextParamValues;
var init_browserContext = __esm({
  "packages/playwright-core/src/server/browserContext.ts"() {
    "use strict";
    import_fs31 = __toESM(require("fs"));
    init_stackTrace();
    init_debug();
    init_clock();
    init_credentials();
    init_debugger();
    init_dialog();
    init_fetch();
    init_helper();
    init_instrumentation();
    init_network2();
    init_page();
    init_page();
    init_recorderApp();
    init_selectors();
    init_tracing();
    init_storageScriptSource();
    init_progress();
    BrowserContextEvent = {
      Console: "console",
      Close: "close",
      Page: "page",
      // Can't use just 'error' due to node.js special treatment of error events.
      // @see https://nodejs.org/api/events.html#events_error_events
      PageError: "pageerror",
      Request: "request",
      Response: "response",
      RequestFailed: "requestfailed",
      RequestFinished: "requestfinished",
      RequestAborted: "requestaborted",
      RequestFulfilled: "requestfulfilled",
      RequestContinued: "requestcontinued",
      BeforeClose: "beforeclose",
      RecorderEvent: "recorderevent",
      PageClosed: "pageclosed",
      InternalFrameNavigatedToNewDocument: "internalframenavigatedtonewdocument",
      FrameAttached: "frameattached",
      WebSocket: "websocket"
    };
    BrowserContext = class _BrowserContext extends SdkObject {
      constructor(browser, options, browserContextId) {
        super(browser, "browser-context");
        this._pageBindings = /* @__PURE__ */ new Map();
        this.requestInterceptors = [];
        this._closedStatus = "open";
        this._permissions = /* @__PURE__ */ new Map();
        this._downloads = /* @__PURE__ */ new Set();
        this._origins = /* @__PURE__ */ new Set();
        this._tempDirs = [];
        this._creatingStorageStatePage = false;
        this.initScripts = [];
        this._routesInFlight = /* @__PURE__ */ new Set();
        this._consoleApiExposed = false;
        this.attribution.context = this;
        this._browser = browser;
        this._options = options;
        this._browserContextId = browserContextId;
        this._isPersistentContext = !browserContextId;
        this._closePromise = new Promise((fulfill) => this._closePromiseFulfill = fulfill);
        this._selectors = new Selectors(options.selectorEngines || [], options.testIdAttributeName);
        this.fetchRequest = new BrowserContextAPIRequestContext(this);
        this.tracing = new Tracing(this, browser.options.tracesDir);
        this.clock = new Clock(this);
        this.credentials = new Credentials(this);
        this.dialogManager = new DialogManager(this.instrumentation);
      }
      static {
        this.Events = BrowserContextEvent;
      }
      isPersistentContext() {
        return this._isPersistentContext;
      }
      selectors() {
        return this._selectors;
      }
      async initialize() {
        if (this.attribution.playwright.options.isInternalPlaywright)
          return;
        this._debugger = new Debugger(this);
        const shouldEnableDebugger = !this.attribution.playwright.options.isServer && (isUnderTest() || !!this._browser.options.headful);
        if (shouldEnableDebugger) {
          this._debugger.setPauseAt();
          this._debugger.on(Debugger.Events.PausedStateChanged, () => {
            if (this._debugger.isPaused())
              RecorderApp.showInspectorNoReply(this);
          });
        }
        if (debugMode() === "inspector") {
          this._debugger.setPauseAt({ next: true });
          await RecorderApp.show(this, { pauseOnNextStatement: true });
        }
        if (debugMode() === "console")
          await this._exposeConsoleApi();
        if (this._options.serviceWorkers === "block")
          await this.addInitScript(nullProgress, `
if (navigator.serviceWorker) navigator.serviceWorker.register = async () => { console.warn('Service Worker registration blocked by Playwright'); };
`);
        if (this._options.permissions)
          await this.grantPermissions(this._options.permissions);
      }
      debugger() {
        return this._debugger;
      }
      async exposeConsoleApi(progress2) {
        await progress2.race(this._exposeConsoleApi());
      }
      async _exposeConsoleApi() {
        if (this._consoleApiExposed)
          return;
        this._consoleApiExposed = true;
        await this.extendInjectedScript(`
      function installConsoleApi(injectedScript) { injectedScript.consoleApi.install(); }
      module.exports = { default: () => installConsoleApi };
    `);
      }
      canResetForReuse() {
        if (this._closedStatus !== "open")
          return false;
        return true;
      }
      static reusableContextHash(params2) {
        const paramsCopy = { ...params2 };
        if (paramsCopy.selectorEngines?.length === 0)
          delete paramsCopy.selectorEngines;
        for (const k of Object.keys(paramsCopy)) {
          const key = k;
          if (paramsCopy[key] === defaultNewContextParamValues[key])
            delete paramsCopy[key];
        }
        for (const key of paramsThatAllowContextReuse)
          delete paramsCopy[key];
        return JSON.stringify(paramsCopy);
      }
      async resetForReuse(progress2, params2) {
        await this.tracing.resetForReuse(progress2);
        if (params2) {
          for (const key of paramsThatAllowContextReuse)
            this._options[key] = params2[key];
          if (params2.testIdAttributeName)
            this.selectors().setTestIdAttributeName(params2.testIdAttributeName);
        }
        let page = this.pages()[0];
        const otherPages = this.possiblyUninitializedPages().filter((p) => p !== page);
        for (const p of otherPages)
          await p.close(progress2);
        if (page && page.hasCrashed()) {
          await page.close(progress2);
          page = void 0;
        }
        await page?.mainFrame().gotoImpl(progress2, "about:blank", {});
        await this.clock.uninstall(progress2);
        await this.credentials.dispose(progress2);
        await progress2.race(this.setUserAgent(this._options.userAgent));
        await progress2.race(this.doUpdateDefaultEmulatedMedia());
        await progress2.race(this.doUpdateDefaultViewport());
        await this.setStorageState(progress2, this._options.storageState, "resetForReuse");
        await page?.resetForReuse(progress2);
      }
      browserClosed() {
        for (const page of this.pages())
          page._didClose();
        this._didCloseInternal();
      }
      _didCloseInternal() {
        if (this._closedStatus === "closed") {
          return;
        }
        this._clientCertificatesProxy?.close().catch(() => {
        });
        this.tracing.abort();
        if (this._isPersistentContext)
          this.onClosePersistent();
        this._closePromiseFulfill(new Error("Context closed"));
        this.emit(_BrowserContext.Events.Close);
      }
      pages() {
        return this.possiblyUninitializedPages().filter((page) => page.initializedOrUndefined());
      }
      async cookies(progress2, urls = []) {
        return await progress2.race(this._cookies(urls));
      }
      async _cookies(urls = []) {
        if (urls && !Array.isArray(urls))
          urls = [urls];
        return await this.doGetCookies(urls);
      }
      async clearCookies(options) {
        const hasFilter = options.name !== void 0 || options.domain !== void 0 || options.path !== void 0;
        if (!hasFilter) {
          await this.doClearCookies();
          return;
        }
        const matches = (cookie, prop, value2) => {
          if (!value2)
            return true;
          if (value2 instanceof RegExp) {
            value2.lastIndex = 0;
            return value2.test(cookie[prop]);
          }
          return cookie[prop] === value2;
        };
        const currentCookies = await this._cookies();
        const cookiesToExpire = currentCookies.filter((cookie) => {
          return matches(cookie, "name", options.name) && matches(cookie, "domain", options.domain) && matches(cookie, "path", options.path);
        });
        if (!cookiesToExpire.length)
          return;
        await this.addCookies(cookiesToExpire.map((cookie) => ({
          ...cookie,
          value: "",
          expires: 0
        })));
      }
      setHTTPCredentials(progress2, httpCredentials) {
        return progress2.race(this.innerSetHTTPCredentials(httpCredentials));
      }
      innerSetHTTPCredentials(httpCredentials) {
        return this.doSetHTTPCredentials(httpCredentials);
      }
      getBindingClient(name) {
        return this._pageBindings.get(name)?.forClient;
      }
      async exposePlaywrightBindingIfNeeded() {
        this._playwrightBindingExposed ??= (async () => {
          await this.doExposePlaywrightBinding();
          this.bindingsInitScript = PageBinding.createInitScript(this);
          this.initScripts.push(this.bindingsInitScript);
          await this.doAddInitScript(this.bindingsInitScript);
          await this.safeNonStallingEvaluateInAllFrames(this.bindingsInitScript.source, "main");
        })();
        return await this._playwrightBindingExposed;
      }
      needsPlaywrightBinding() {
        return this._playwrightBindingExposed !== void 0;
      }
      async exposeBinding(progress2, name, playwrightBinding, forClient) {
        if (this._pageBindings.has(name))
          throw new Error(`Function "${name}" has been already registered`);
        for (const page of this.pages()) {
          if (page.getBinding(name))
            throw new Error(`Function "${name}" has been already registered in one of the pages`);
        }
        await progress2.race(this.exposePlaywrightBindingIfNeeded());
        const binding = new PageBinding(this, name, playwrightBinding);
        binding.forClient = forClient;
        this._pageBindings.set(name, binding);
        try {
          await progress2.race(this.doAddInitScript(binding.initScript));
          await progress2.race(this.safeNonStallingEvaluateInAllFrames(binding.initScript.source, "main"));
          return binding;
        } catch (error) {
          this._pageBindings.delete(name);
          throw error;
        }
      }
      async removeExposedBinding(binding) {
        if (this._pageBindings.get(binding.name) !== binding)
          return;
        this._pageBindings.delete(binding.name);
        await this.doRemoveInitScripts([binding.initScript]);
        const cleanup = `{ ${binding.cleanupScript} };`;
        await this.safeNonStallingEvaluateInAllFrames(cleanup, "main");
      }
      async grantPermissions(permissions, origin) {
        let resolvedOrigin = "*";
        if (origin) {
          const url2 = new URL(origin);
          resolvedOrigin = url2.origin;
        }
        const existing = new Set(this._permissions.get(resolvedOrigin) || []);
        permissions.forEach((p) => existing.add(p));
        const list = [...existing.values()];
        this._permissions.set(resolvedOrigin, list);
        await this.doGrantPermissions(resolvedOrigin, list);
      }
      async clearPermissions() {
        this._permissions.clear();
        await this.doClearPermissions();
      }
      async setExtraHTTPHeaders(progress2, headers) {
        const oldHeaders = this._options.extraHTTPHeaders;
        this._options.extraHTTPHeaders = headers;
        try {
          await progress2.race(this.doUpdateExtraHTTPHeaders());
        } catch (error) {
          this._options.extraHTTPHeaders = oldHeaders;
          this.doUpdateExtraHTTPHeaders().catch(() => {
          });
          throw error;
        }
      }
      async setOffline(progress2, offline) {
        const oldOffline = this._options.offline;
        this._options.offline = offline;
        try {
          await progress2.race(this.doUpdateOffline());
        } catch (error) {
          this._options.offline = oldOffline;
          this.doUpdateOffline().catch(() => {
          });
          throw error;
        }
      }
      async loadDefaultContextAsIs(progress2) {
        if (!this.possiblyUninitializedPages().length) {
          const waitForEvent2 = helper.waitForEvent(progress2, this, _BrowserContext.Events.Page);
          await progress2.race(Promise.race([waitForEvent2.promise, this._closePromise]));
        }
        const page = this.possiblyUninitializedPages()[0];
        if (!page)
          return;
        const pageOrError = await progress2.race(page.waitForInitializedOrError());
        if (pageOrError instanceof Error)
          throw pageOrError;
        await page.mainFrame().waitForLoadState(progress2, "load");
        return page;
      }
      async loadDefaultContext(progress2) {
        const defaultPage = await this.loadDefaultContextAsIs(progress2);
        if (!defaultPage)
          return;
        const browserName = this._browser.options.name;
        if (this._options.isMobile && browserName === "chromium" || this._options.locale && browserName === "webkit") {
          await this.newPage(progress2);
          await defaultPage.close(progress2);
        }
      }
      authenticateProxyViaHeader() {
        const proxy = this._options.proxy || this._browser.options.proxy || { username: void 0, password: void 0 };
        const { username, password } = proxy;
        if (username) {
          this._options.httpCredentials = { username, password };
          const token = Buffer.from(`${username}:${password}`).toString("base64");
          this._options.extraHTTPHeaders = mergeHeaders([
            this._options.extraHTTPHeaders,
            singleHeader("Proxy-Authorization", `Basic ${token}`)
          ]);
        }
      }
      authenticateProxyViaCredentials() {
        const proxy = this._options.proxy || this._browser.options.proxy;
        if (!proxy)
          return;
        const { username, password } = proxy;
        if (username)
          this._options.httpCredentials = { username, password: password || "" };
      }
      async addInitScript(progress2, source11) {
        return await progress2.race(this._internalAddInitScript(source11));
      }
      async _internalAddInitScript(source11) {
        const initScript = new InitScript(this, source11);
        this.initScripts.push(initScript);
        try {
          await this.doAddInitScript(initScript);
          return initScript;
        } catch (error) {
          initScript.dispose().catch(() => {
          });
          throw error;
        }
      }
      async removeInitScript(initScript) {
        this.initScripts = this.initScripts.filter((script) => initScript !== script);
        await this.doRemoveInitScripts([initScript]);
      }
      async addRequestInterceptor(progress2, handler) {
        this.requestInterceptors.push(handler);
        await progress2.race(this.doUpdateRequestInterception());
      }
      async removeRequestInterceptor(handler) {
        const index = this.requestInterceptors.indexOf(handler);
        if (index === -1)
          return;
        this.requestInterceptors.splice(index, 1);
        await this.notifyRoutesInFlightAboutRemovedHandler(handler);
        await this.doUpdateRequestInterception();
      }
      isClosingOrClosed() {
        return this._closedStatus !== "open";
      }
      async _deleteAllDownloads() {
        await Promise.all(Array.from(this._downloads).map((download) => download.artifact.deleteOnContextClose()));
      }
      async _deleteAllTempDirs() {
        await Promise.all(this._tempDirs.map(async (dir) => await import_fs31.default.promises.rm(dir, { recursive: true, force: true }).catch((e) => {
        })));
      }
      setCustomCloseHandler(handler) {
        this._customCloseHandler = handler;
      }
      async close(progress2, options) {
        if (this._closedStatus === "open") {
          if (options.reason)
            this._closeReason = options.reason;
          this.emit(_BrowserContext.Events.BeforeClose);
          this._closedStatus = "closing";
          await progress2.race(this.tracing.flush());
          await progress2.race(Promise.all(this.pages().map((page) => page.screencast.handlePageOrContextClose())));
          if (this._customCloseHandler) {
            await progress2.race(this._customCloseHandler());
          } else {
            const disposition = await progress2.race(this.doClose(options.reason));
            if (disposition === "close-browser")
              await this._browser.close(progress2, { reason: options.reason });
          }
          const promises = [];
          promises.push(this._deleteAllDownloads());
          promises.push(this._deleteAllTempDirs());
          await progress2.race(Promise.all(promises));
          if (!this._customCloseHandler)
            this._didCloseInternal();
        }
        await this._closePromise;
      }
      async newPage(progress2, forStorageState) {
        let page;
        try {
          this._creatingStorageStatePage = !!forStorageState;
          page = await progress2.race(this.doCreateNewPage());
          const pageOrError = await progress2.race(page.waitForInitializedOrError());
          if (pageOrError instanceof Page) {
            if (pageOrError.isClosed())
              throw new Error("Page has been closed.");
            return pageOrError;
          }
          throw pageOrError;
        } catch (error) {
          await page?.close(progress2, { reason: "Failed to create page" }).catch(() => {
          });
          throw error;
        } finally {
          this._creatingStorageStatePage = false;
        }
      }
      addVisitedOrigin(origin) {
        this._origins.add(origin);
      }
      async storageState(progress2, indexedDB = false) {
        const result2 = {
          cookies: await this.cookies(progress2),
          origins: []
        };
        const originsToSave = new Set(this._origins);
        const collectScript = `(() => {
      const module = {};
      ${source9}
      const script = new (module.exports.StorageScript())(${this._browser.options.name === "firefox"});
      return script.collect(${indexedDB});
    })()`;
        for (const page of this.pages()) {
          const origin = page.mainFrame().origin();
          if (!origin || !originsToSave.has(origin))
            continue;
          try {
            const storage = await progress2.race(page.mainFrame().nonStallingEvaluateInExistingContext(collectScript, "utility"));
            if (storage.localStorage.length || storage.indexedDB?.length)
              result2.origins.push({ origin, localStorage: storage.localStorage, indexedDB: storage.indexedDB });
            originsToSave.delete(origin);
          } catch {
          }
        }
        if (originsToSave.size) {
          const page = await this.newPage(
            progress2,
            true
            /* forStorageState */
          );
          try {
            await page.addRequestInterceptor(progress2, (route2) => {
              route2.fulfill({ body: "<html></html>" }).catch(() => {
              });
            }, "prepend");
            for (const origin of originsToSave) {
              const frame = page.mainFrame();
              await frame.gotoImpl(progress2, origin, {});
              const storage = await frame.evaluateExpression(progress2, collectScript, { world: "utility" });
              if (storage.localStorage.length || storage.indexedDB?.length)
                result2.origins.push({ origin, localStorage: storage.localStorage, indexedDB: storage.indexedDB });
            }
          } finally {
            await page.close(progress2);
          }
        }
        return result2;
      }
      isCreatingStorageStatePage() {
        return this._creatingStorageStatePage;
      }
      async setStorageState(progress2, state, mode) {
        let page;
        let interceptor;
        try {
          if (mode !== "initial") {
            await progress2.race(this.clearCache());
            await progress2.race(this.doClearCookies());
          }
          if (state?.cookies)
            await progress2.race(this.addCookies(state.cookies));
          const newOrigins = new Map(state?.origins?.map((p) => [p.origin, p]) || []);
          const allOrigins = /* @__PURE__ */ new Set([...this._origins, ...newOrigins.keys()]);
          if (allOrigins.size) {
            if (mode === "resetForReuse")
              page = this.pages()[0];
            if (!page)
              page = await this.newPage(
                progress2,
                mode !== "resetForReuse"
                /* forStorageState */
              );
            interceptor = (route2) => {
              route2.fulfill({ body: "<html></html>" }).catch(() => {
              });
            };
            await page.addRequestInterceptor(progress2, interceptor, "prepend");
            for (const origin of allOrigins) {
              const frame = page.mainFrame();
              await frame.gotoImpl(progress2, origin, {});
              const restoreScript = `(() => {
            const module = {};
            ${source9}
            const script = new (module.exports.StorageScript())(${this._browser.options.name === "firefox"});
            return script.restore(${JSON.stringify(newOrigins.get(origin))});
          })()`;
              await frame.evaluateExpression(progress2, restoreScript, { world: "utility" });
            }
          }
          this._origins = /* @__PURE__ */ new Set([...newOrigins.keys()]);
        } catch (error) {
          rewriteErrorMessage(error, `Error setting storage state:
` + error.message);
          throw error;
        } finally {
          if (mode !== "resetForReuse")
            await page?.close(progress2);
          else if (interceptor)
            await page?.removeRequestInterceptor(interceptor);
        }
      }
      async extendInjectedScript(source11, arg) {
        const installInFrame = (frame) => frame.extendInjectedScript(source11, arg).catch(() => {
        });
        const installInPage = (page) => {
          page.on(Page.Events.InternalFrameNavigatedToNewDocument, installInFrame);
          return Promise.all(page.frames().map(installInFrame));
        };
        this.on(_BrowserContext.Events.Page, installInPage);
        return Promise.all(this.pages().map(installInPage));
      }
      async safeNonStallingEvaluateInAllFrames(expression2, world, options = {}) {
        await Promise.all(this.pages().map((page) => page.safeNonStallingEvaluateInAllFrames(expression2, world, options)));
      }
      addRouteInFlight(route2) {
        this._routesInFlight.add(route2);
      }
      removeRouteInFlight(route2) {
        this._routesInFlight.delete(route2);
      }
      async notifyRoutesInFlightAboutRemovedHandler(handler) {
        await Promise.all([...this._routesInFlight].map((route2) => route2.removeHandler(handler)));
      }
    };
    paramsThatAllowContextReuse = [
      "colorScheme",
      "forcedColors",
      "reducedMotion",
      "contrast",
      "screen",
      "userAgent",
      "viewport",
      "testIdAttributeName"
    ];
    defaultNewContextParamValues = {
      noDefaultViewport: false,
      ignoreHTTPSErrors: false,
      javaScriptEnabled: true,
      bypassCSP: false,
      offline: false,
      isMobile: false,
      hasTouch: false,
      acceptDownloads: "accept",
      strictSelectors: false,
      serviceWorkers: "allow",
      locale: "en-US"
    };
  }
});

// packages/playwright-core/src/server/download.ts
var Download;
var init_download = __esm({
  "packages/playwright-core/src/server/download.ts"() {
    "use strict";
    init_assert();
    init_fileUtils();
    init_page();
    init_artifact();
    Download = class {
      constructor(page, downloadsPath, uuid, url2, suggestedFilename, downloadFilename) {
        const unaccessibleErrorMessage = page.browserContext._options.acceptDownloads === "deny" ? "Pass { acceptDownloads: true } when you are creating your browser context." : void 0;
        const downloadPath = resolveWithinRoot(downloadsPath, downloadFilename ?? uuid);
        if (!downloadPath)
          throw new Error(`Download filename '${downloadFilename}' escapes download directory`);
        this.artifact = new Artifact(page, downloadPath, unaccessibleErrorMessage, () => this.cancel());
        this._page = page;
        this.url = url2;
        this._uuid = uuid;
        this._suggestedFilename = suggestedFilename;
        page.browserContext._downloads.add(this);
        if (suggestedFilename !== void 0)
          this._fireDownloadEvent();
      }
      cancel() {
        return this._page.browserContext.cancelDownload(this._uuid);
      }
      filenameSuggested(suggestedFilename) {
        assert(this._suggestedFilename === void 0);
        this._suggestedFilename = suggestedFilename;
        this._fireDownloadEvent();
      }
      suggestedFilename() {
        return this._suggestedFilename;
      }
      _fireDownloadEvent() {
        this._page.instrumentation.onDownload(this._page, this);
        this._page.emit(Page.Events.Download, this);
      }
    };
  }
});

// packages/playwright-core/src/remote/serverTransport.ts
var import_events13, WebSocketServerTransport, SocketServerTransport;
var init_serverTransport = __esm({
  "packages/playwright-core/src/remote/serverTransport.ts"() {
    "use strict";
    import_events13 = require("events");
    WebSocketServerTransport = class {
      constructor(ws4) {
        this._ws = ws4;
      }
      send(message) {
        this._ws.send(message);
      }
      close(reason) {
        this._ws.close(reason?.code, reason?.reason);
      }
      on(event, handler) {
        this._ws.on(event, handler);
      }
      isClosed() {
        return this._ws.readyState === this._ws.CLOSING || this._ws.readyState === this._ws.CLOSED;
      }
    };
    SocketServerTransport = class extends import_events13.EventEmitter {
      constructor(socket) {
        super();
        this._closed = false;
        this._pendingBuffers = [];
        this._socket = socket;
        socket.on("data", (buffer) => this._dispatch(buffer));
        socket.on("close", () => {
          this._closed = true;
          super.emit("close");
        });
        socket.on("error", (error) => {
          super.emit("error", error);
        });
      }
      send(message) {
        if (this._closed)
          return;
        this._socket.write(message);
        this._socket.write("\0");
      }
      close(reason) {
        if (this._closed)
          return;
        this._closed = true;
        this._socket.end();
      }
      isClosed() {
        return this._closed;
      }
      _dispatch(buffer) {
        let end = buffer.indexOf("\0");
        if (end === -1) {
          this._pendingBuffers.push(buffer);
          return;
        }
        this._pendingBuffers.push(buffer.slice(0, end));
        const message = Buffer.concat(this._pendingBuffers).toString();
        super.emit("message", message);
        let start3 = end + 1;
        end = buffer.indexOf("\0", start3);
        while (end !== -1) {
          super.emit("message", buffer.toString(void 0, start3, end));
          start3 = end + 1;
          end = buffer.indexOf("\0", start3);
        }
        this._pendingBuffers = [buffer.slice(start3)];
      }
    };
  }
});

// packages/playwright-core/src/remote/playwrightPipeServer.ts
var import_net5, import_fs32, PlaywrightPipeServer;
var init_playwrightPipeServer = __esm({
  "packages/playwright-core/src/remote/playwrightPipeServer.ts"() {
    "use strict";
    import_net5 = __toESM(require("net"));
    import_fs32 = __toESM(require("fs"));
    init_debugLogger();
    init_network();
    init_semaphore();
    init_playwrightConnection();
    init_serverTransport();
    init_browser();
    PlaywrightPipeServer = class {
      constructor(browser) {
        this._connections = /* @__PURE__ */ new Set();
        this._connectionId = 0;
        this._browser = browser;
        browser.on(Browser.Events.Disconnected, () => this.close());
      }
      async listen(pipeName) {
        if (!pipeName.startsWith("\\\\.\\pipe\\")) {
          try {
            import_fs32.default.unlinkSync(pipeName);
          } catch {
          }
        }
        this._server = import_net5.default.createServer((socket) => {
          const id = String(++this._connectionId);
          debugLogger.log("server", `[${id}] pipe client connected`);
          const transport = new SocketServerTransport(socket);
          const connection = new PlaywrightConnection(
            new Semaphore(1),
            transport,
            false,
            this._browser.attribution.playwright,
            () => this._initPreLaunchedBrowserMode(id),
            id
          );
          this._connections.add(connection);
          transport.on("close", () => this._connections.delete(connection));
        });
        decorateServer(this._server);
        await new Promise((resolve, reject) => {
          this._server.listen(pipeName, () => resolve());
          this._server.on("error", reject);
        });
        debugLogger.log("server", `Pipe server listening at ${pipeName}`);
      }
      async _initPreLaunchedBrowserMode(id) {
        debugLogger.log("server", `[${id}] engaged pre-launched (browser) pipe mode`);
        return {
          preLaunchedBrowser: this._browser,
          sharedBrowser: true,
          denyLaunch: true
        };
      }
      async close() {
        if (!this._server)
          return;
        debugLogger.log("server", "closing pipe server");
        for (const connection of this._connections)
          await connection.close({ code: 1001, reason: "Server closing" });
        this._connections.clear();
        await new Promise((f) => this._server.close(() => f()));
        this._server = void 0;
        debugLogger.log("server", "closed pipe server");
      }
    };
  }
});

// packages/playwright-core/src/remote/playwrightWebSocketServer.ts
var PlaywrightWebSocketServer;
var init_playwrightWebSocketServer = __esm({
  "packages/playwright-core/src/remote/playwrightWebSocketServer.ts"() {
    "use strict";
    init_debugLogger();
    init_wsServer();
    init_semaphore();
    init_playwrightConnection();
    init_serverTransport();
    init_browser();
    PlaywrightWebSocketServer = class {
      constructor(browser, path59) {
        this._browser = browser;
        browser.on(Browser.Events.Disconnected, () => this.close());
        const semaphore = new Semaphore(Infinity);
        this._wsServer = new WSServer({
          onRequest: (request2, response2) => {
            response2.end("Running");
          },
          onUpgrade: () => void 0,
          onHeaders: () => {
          },
          onConnection: (request2, url2, ws4, id) => {
            debugLogger.log("server", `[${id}] ws client connected`);
            return new PlaywrightConnection(
              semaphore,
              new WebSocketServerTransport(ws4),
              false,
              this._browser.attribution.playwright,
              () => this._initPreLaunchedBrowserMode(id),
              id
            );
          }
        });
      }
      async _initPreLaunchedBrowserMode(id) {
        debugLogger.log("server", `[${id}] engaged pre-launched (browser) ws mode`);
        return {
          preLaunchedBrowser: this._browser,
          sharedBrowser: true,
          denyLaunch: true
        };
      }
      async listen(port = 0, hostname, path59) {
        return await this._wsServer.listen(port, hostname, path59 || "/");
      }
      async close() {
        await this._wsServer.close();
      }
    };
  }
});

// packages/playwright-core/src/serverRegistry.ts
async function canConnectTo(descriptor) {
  if (!descriptor.endpoint)
    return false;
  if (descriptor.endpoint.startsWith("ws://") || descriptor.endpoint.startsWith("wss://")) {
    return await new Promise((resolve) => {
      const url2 = new URL(descriptor.endpoint);
      const socket = import_net6.default.createConnection(Number(url2.port), url2.hostname, () => {
        socket.destroy();
        resolve(true);
      });
      socket.on("error", () => resolve(false));
    });
  }
  return await new Promise((resolve) => {
    const socket = import_net6.default.createConnection(descriptor.endpoint ?? descriptor.pipeName, () => {
      socket.destroy();
      resolve(true);
    });
    socket.on("error", () => resolve(false));
  });
}
var import_events14, import_fs33, import_net6, import_path33, import_os17, chokidar, packageVersion, ServerRegistry, defaultCacheDirectory2, registryDirectory2, serverRegistry;
var init_serverRegistry = __esm({
  "packages/playwright-core/src/serverRegistry.ts"() {
    "use strict";
    import_events14 = require("events");
    import_fs33 = __toESM(require("fs"));
    import_net6 = __toESM(require("net"));
    import_path33 = __toESM(require("path"));
    import_os17 = __toESM(require("os"));
    init_package();
    chokidar = require("./utilsBundle").chokidar;
    packageVersion = packageJSON.version;
    ServerRegistry = class extends import_events14.EventEmitter {
      constructor() {
        super(...arguments);
        this._descriptors = /* @__PURE__ */ new Map();
        this._watcherRefs = 0;
      }
      on(event, listener) {
        return super.on(event, listener);
      }
      off(event, listener) {
        return super.off(event, listener);
      }
      watch() {
        this._watcherRefs++;
        if (!this._watcher)
          this._startWatcher();
        let disposed = false;
        return () => {
          if (disposed)
            return;
          disposed = true;
          this._watcherRefs--;
          if (this._watcherRefs === 0)
            this._stopWatcher();
        };
      }
      ready() {
        return this._ready ?? Promise.resolve();
      }
      async list() {
        const ownWatcher = !this._watcher;
        let dispose;
        if (ownWatcher)
          dispose = this.watch();
        try {
          await this._ready;
          const statuses = await Promise.all(
            [...this._descriptors.values()].map(async (descriptor) => {
              const canConnect = await canConnectTo(descriptor);
              return { descriptor, canConnect };
            })
          );
          const result2 = /* @__PURE__ */ new Map();
          for (const { descriptor, canConnect } of statuses) {
            if (!canConnect) {
              await import_fs33.default.promises.unlink(import_path33.default.join(this._browsersDir(), descriptor.browser.guid)).catch(() => {
              });
              continue;
            }
            const key = descriptor.workspaceDir ?? "";
            let list = result2.get(key);
            if (!list) {
              list = [];
              result2.set(key, list);
            }
            list.push(descriptor);
          }
          return result2;
        } finally {
          dispose?.();
        }
      }
      async create(browser, endpoint) {
        const file = import_path33.default.join(this._browsersDir(), browser.guid);
        await import_fs33.default.promises.mkdir(this._browsersDir(), { recursive: true });
        const descriptor = {
          playwrightVersion: packageVersion,
          playwrightLib: packageRoot,
          title: endpoint.title,
          browser,
          endpoint: endpoint.endpoint,
          workspaceDir: endpoint.workspaceDir
        };
        await import_fs33.default.promises.writeFile(file, JSON.stringify(descriptor, null, 2), "utf-8");
      }
      async delete(guid) {
        const file = import_path33.default.join(this._browsersDir(), guid);
        await import_fs33.default.promises.unlink(file).catch(() => {
        });
      }
      async deleteUserData(guid) {
        const filePath = import_path33.default.join(this._browsersDir(), guid);
        const content = await import_fs33.default.promises.readFile(filePath, "utf-8");
        const descriptor = JSON.parse(content);
        if (descriptor.browser.userDataDir)
          await import_fs33.default.promises.rm(descriptor.browser.userDataDir, { recursive: true, force: true });
        await import_fs33.default.promises.unlink(filePath);
      }
      readDescriptor(guid) {
        const cached = this._descriptors.get(guid);
        if (cached)
          return cached;
        const filePath = import_path33.default.join(this._browsersDir(), guid);
        const content = import_fs33.default.readFileSync(filePath, "utf-8");
        return JSON.parse(content);
      }
      async find(name) {
        const entries = await this.list();
        for (const [, browsers] of entries) {
          for (const browser of browsers) {
            if (browser.title === name)
              return browser;
          }
        }
        return null;
      }
      _browsersDir() {
        return process.env.PWTEST_SERVER_REGISTRY || registryDirectory2;
      }
      _startWatcher() {
        const dir = this._browsersDir();
        try {
          import_fs33.default.mkdirSync(dir, { recursive: true });
        } catch {
        }
        const watcher = chokidar.watch(dir, {
          ignoreInitial: false,
          depth: 0,
          awaitWriteFinish: { stabilityThreshold: 50, pollInterval: 20 }
        });
        this._watcher = watcher;
        this._ready = new Promise((resolve, reject) => {
          watcher.once("ready", () => resolve());
          watcher.once("error", reject);
        });
        watcher.on("add", (file) => this._onAddOrChange(file, "added"));
        watcher.on("change", (file) => this._onAddOrChange(file, "changed"));
        watcher.on("unlink", (file) => {
          const guid = import_path33.default.basename(file);
          if (this._descriptors.delete(guid))
            this.emit("removed", guid);
        });
      }
      _onAddOrChange(file, event) {
        const guid = import_path33.default.basename(file);
        let descriptor;
        try {
          descriptor = JSON.parse(import_fs33.default.readFileSync(file, "utf-8"));
        } catch {
          return;
        }
        this._descriptors.set(guid, descriptor);
        this.emit(event, descriptor);
      }
      _stopWatcher() {
        const watcher = this._watcher;
        this._watcher = void 0;
        this._ready = void 0;
        this._descriptors.clear();
        void watcher?.close();
      }
    };
    defaultCacheDirectory2 = (() => {
      if (process.platform === "linux")
        return process.env.XDG_CACHE_HOME || import_path33.default.join(import_os17.default.homedir(), ".cache");
      if (process.platform === "darwin")
        return import_path33.default.join(import_os17.default.homedir(), "Library", "Caches");
      if (process.platform === "win32")
        return process.env.LOCALAPPDATA || import_path33.default.join(import_os17.default.homedir(), "AppData", "Local");
      throw new Error("Unsupported platform: " + process.platform);
    })();
    registryDirectory2 = import_path33.default.join(defaultCacheDirectory2, "ms-playwright", "b");
    serverRegistry = new ServerRegistry();
  }
});

// packages/playwright-core/src/server/browser.ts
function asClientLaunchOptions(serverOptions) {
  return {
    ...serverOptions,
    env: serverOptions.env ? Object.fromEntries(serverOptions.env.map(({ name, value: value2 }) => [name, value2])) : void 0
  };
}
var import_fs34, Browser, BrowserServer;
var init_browser = __esm({
  "packages/playwright-core/src/server/browser.ts"() {
    "use strict";
    import_fs34 = __toESM(require("fs"));
    init_fileUtils();
    init_crypto();
    init_browserContext();
    init_download();
    init_instrumentation();
    init_socksClientCertificatesInterceptor();
    init_playwrightPipeServer();
    init_playwrightWebSocketServer();
    init_serverRegistry();
    init_progress();
    init_errors();
    Browser = class _Browser extends SdkObject {
      constructor(parent, options) {
        super(parent, "browser");
        this._downloads = /* @__PURE__ */ new Map();
        this._defaultContext = null;
        this._startedClosing = false;
        this._isBrowserCollocatedWithServer = true;
        this.attribution.browser = this;
        this.options = options;
        this.instrumentation.onBrowserOpen(this);
        this._server = new BrowserServer(this);
      }
      static {
        this.Events = {
          Context: "context",
          Disconnected: "disconnected"
        };
      }
      sdkLanguage() {
        return this.options.sdkLanguage || this.attribution.playwright.options.sdkLanguage;
      }
      async newContext(progress2, options) {
        validateBrowserContextOptions(options, this.options);
        let clientCertificatesProxy;
        let context2;
        try {
          if (options.clientCertificates?.length) {
            clientCertificatesProxy = await ClientCertificatesProxy.create(progress2, options);
            options = { ...options };
            options.proxyOverride = clientCertificatesProxy.proxySettings();
            options.internalIgnoreHTTPSErrors = true;
          }
          context2 = await progress2.race(this.doCreateNewContext(options));
          context2._clientCertificatesProxy = clientCertificatesProxy;
          if (options.__testHookBeforeSetStorageState)
            await progress2.race(options.__testHookBeforeSetStorageState());
          await context2.setStorageState(progress2, options.storageState, "initial");
          this.emit(_Browser.Events.Context, context2);
          return context2;
        } catch (error) {
          await context2?.close(progress2, { reason: "Failed to create context" }).catch(() => {
          });
          await clientCertificatesProxy?.close().catch(() => {
          });
          throw error;
        }
      }
      async newContextForReuse(progress2, params2) {
        const hash = BrowserContext.reusableContextHash(params2);
        if (!this._contextForReuse || hash !== this._contextForReuse.hash || !this._contextForReuse.context.canResetForReuse()) {
          if (this._contextForReuse)
            await this._contextForReuse.context.close(progress2, { reason: "Context reused" });
          this._contextForReuse = { context: await this.newContext(progress2, params2), hash };
          return this._contextForReuse.context;
        }
        await this._contextForReuse.context.resetForReuse(progress2, params2);
        return this._contextForReuse.context;
      }
      contextForReuse() {
        return this._contextForReuse?.context;
      }
      downloadCreated(page, uuid, url2, suggestedFilename, downloadFilename) {
        const download = new Download(page, this.options.downloadsPath || "", uuid, url2, suggestedFilename, downloadFilename);
        this._downloads.set(uuid, download);
      }
      downloadFilenameSuggested(uuid, suggestedFilename) {
        const download = this._downloads.get(uuid);
        if (!download)
          return;
        download.filenameSuggested(suggestedFilename);
      }
      downloadFinished(uuid, error) {
        const download = this._downloads.get(uuid);
        if (!download)
          return;
        download.artifact.reportFinished(error ? new Error(error) : void 0);
        this._downloads.delete(uuid);
      }
      async startServer(progress2, title, options) {
        return await progress2.race(this._server.start(title, options));
      }
      async stopServer(progress2) {
        await progress2.race(this._server.stop());
      }
      didClose() {
        for (const context2 of this.contexts())
          context2.browserClosed();
        if (this._defaultContext)
          this._defaultContext.browserClosed();
        for (const download of this._downloads.values())
          download.artifact.reportFinished(new TargetClosedError(void 0));
        this.stopServer(nullProgress).catch(() => {
        });
        this.emit(_Browser.Events.Disconnected);
        this.instrumentation.onBrowserClose(this);
      }
      async close(progress2, options) {
        return await progress2.race(this._close(options));
      }
      async _close(options) {
        if (!this._startedClosing) {
          if (options.reason)
            this._closeReason = options.reason;
          this._startedClosing = true;
          await this.options.browserProcess.close();
        }
        if (this.isConnected())
          await new Promise((x) => this.once(_Browser.Events.Disconnected, x));
      }
      async killForTests(progress2) {
        await progress2.race(this.options.browserProcess.kill());
      }
    };
    BrowserServer = class {
      constructor(browser) {
        this._isStarted = false;
        this._browser = browser;
      }
      async start(title, options) {
        if (this._isStarted)
          throw new Error(`Server is already started.`);
        this._isStarted = true;
        let endpoint;
        if (options.host !== void 0 || options.port !== void 0) {
          this._wsServer = new PlaywrightWebSocketServer(this._browser, "/");
          endpoint = await this._wsServer.listen(options.port ?? 0, options.host, "/" + createGuid());
        } else {
          this._pipeServer = new PlaywrightPipeServer(this._browser);
          this._pipeSocketPath = await this._socketPath();
          await this._pipeServer.listen(this._pipeSocketPath);
          endpoint = this._pipeSocketPath;
        }
        const browserInfo2 = {
          guid: this._browser.guid,
          browserName: this._browser.options.browserType,
          launchOptions: asClientLaunchOptions(this._browser.options.originalLaunchOptions),
          userDataDir: this._browser.options.userDataDir
        };
        await serverRegistry.create(browserInfo2, {
          title,
          endpoint,
          workspaceDir: options.workspaceDir,
          metadata: options.metadata
        });
        return { endpoint };
      }
      async stop() {
        if (!this._browser.options.userDataDir)
          await serverRegistry.delete(this._browser.guid);
        if (this._pipeSocketPath && process.platform !== "win32")
          await import_fs34.default.promises.unlink(this._pipeSocketPath).catch(() => {
          });
        await this._pipeServer?.close();
        await this._wsServer?.close();
        this._pipeServer = void 0;
        this._wsServer = void 0;
        this._isStarted = false;
      }
      async _socketPath() {
        return makeSocketPath("browser", this._browser.guid.slice(0, 14));
      }
    };
  }
});

// packages/playwright-core/src/server/dispatchers/cdpSessionDispatcher.ts
var CDPSessionDispatcher;
var init_cdpSessionDispatcher = __esm({
  "packages/playwright-core/src/server/dispatchers/cdpSessionDispatcher.ts"() {
    "use strict";
    init_dispatcher();
    init_crConnection();
    CDPSessionDispatcher = class extends Dispatcher {
      constructor(scope, cdpSession) {
        super(scope, cdpSession, "CDPSession", {});
        this._type_CDPSession = true;
        this.addObjectListener(CDPSession.Events.Event, ({ method, params: params2 }) => this._dispatchEvent("event", { method, params: params2 }));
        this.addObjectListener(CDPSession.Events.Closed, () => {
          this._dispatchEvent("close");
          this._dispose();
        });
      }
      async send(params2, progress2) {
        return { result: await this._object.send(progress2, params2.method, params2.params) };
      }
      async detach(_, progress2) {
        await this._object.detach(progress2);
      }
    };
  }
});

// packages/playwright-core/src/server/dispatchers/debuggerDispatcher.ts
var DebuggerDispatcher;
var init_debuggerDispatcher = __esm({
  "packages/playwright-core/src/server/dispatchers/debuggerDispatcher.ts"() {
    "use strict";
    init_protocolFormatter();
    init_dispatcher();
    init_debugger();
    DebuggerDispatcher = class _DebuggerDispatcher extends Dispatcher {
      constructor(scope, debugger_) {
        super(scope, debugger_, "Debugger", {});
        this._type_Debugger = true;
        this.addObjectListener(Debugger.Events.PausedStateChanged, () => {
          this._dispatchEvent("pausedStateChanged", { pausedDetails: this._serializePausedDetails() });
        });
        this._dispatchEvent("pausedStateChanged", { pausedDetails: this._serializePausedDetails() });
      }
      static from(scope, debugger_) {
        const result2 = scope.connection.existingDispatcher(debugger_);
        return result2 || new _DebuggerDispatcher(scope, debugger_);
      }
      _serializePausedDetails() {
        const details = this._object.pausedDetails();
        if (!details)
          return void 0;
        const { metadata } = details;
        return {
          location: {
            file: metadata.location?.file ?? "<unknown>",
            line: metadata.location?.line,
            column: metadata.location?.column
          },
          title: renderTitleForCall(metadata)
        };
      }
      async requestPause(params2, progress2) {
        this._object.requestPause(progress2);
      }
      async resume(params2, progress2) {
        this._object.doResume(progress2);
      }
      async next(params2, progress2) {
        this._object.next(progress2);
      }
      async runTo(params2, progress2) {
        this._object.runTo(progress2, params2.location);
      }
    };
  }
});

// packages/playwright-core/src/server/dispatchers/streamDispatcher.ts
var StreamSdkObject, StreamDispatcher;
var init_streamDispatcher = __esm({
  "packages/playwright-core/src/server/dispatchers/streamDispatcher.ts"() {
    "use strict";
    init_manualPromise();
    init_dispatcher();
    init_instrumentation();
    StreamSdkObject = class extends SdkObject {
      constructor(parent, stream3) {
        super(parent, "stream");
        this.stream = stream3;
      }
    };
    StreamDispatcher = class extends Dispatcher {
      constructor(scope, stream3) {
        super(scope, new StreamSdkObject(scope._object, stream3), "Stream", {});
        this._type_Stream = true;
        this._ended = false;
        stream3.once("end", () => this._ended = true);
        stream3.once("error", () => this._ended = true);
      }
      async read(params2, progress2) {
        const stream3 = this._object.stream;
        if (this._ended)
          return { binary: Buffer.from("") };
        if (!stream3.readableLength) {
          const readyPromise = new ManualPromise();
          const done = () => readyPromise.resolve();
          stream3.on("readable", done);
          stream3.on("end", done);
          stream3.on("error", done);
          try {
            await progress2.race(readyPromise);
          } finally {
            stream3.off("readable", done);
            stream3.off("end", done);
            stream3.off("error", done);
          }
        }
        const buffer = stream3.read(Math.min(stream3.readableLength, params2.size || stream3.readableLength));
        return { binary: buffer || Buffer.from("") };
      }
      _onDispose() {
        this._object.stream.destroy();
      }
      async close(params2, progress2) {
        this._object.stream.destroy();
      }
    };
  }
});

// packages/playwright-core/src/server/dispatchers/artifactDispatcher.ts
var import_fs35, ArtifactDispatcher;
var init_artifactDispatcher = __esm({
  "packages/playwright-core/src/server/dispatchers/artifactDispatcher.ts"() {
    "use strict";
    import_fs35 = __toESM(require("fs"));
    init_fileUtils();
    init_dispatcher();
    init_streamDispatcher();
    ArtifactDispatcher = class _ArtifactDispatcher extends Dispatcher {
      constructor(scope, artifact) {
        super(scope, artifact, "Artifact", {
          absolutePath: artifact.localPath()
        });
        this._type_Artifact = true;
      }
      static from(parentScope, artifact) {
        return _ArtifactDispatcher.fromNullable(parentScope, artifact);
      }
      static fromNullable(parentScope, artifact) {
        if (!artifact)
          return void 0;
        const result2 = parentScope.connection.existingDispatcher(artifact);
        return result2 || new _ArtifactDispatcher(parentScope, artifact);
      }
      async pathAfterFinished(params2, progress2) {
        const path59 = await this._object.localPathAfterFinished(progress2);
        return { value: path59 };
      }
      async saveAs(params2, progress2) {
        return await progress2.race(new Promise((resolve, reject) => {
          this._object.saveAs(progress2, async (localPath, error) => {
            if (error) {
              reject(error);
              return;
            }
            try {
              await mkdirIfNeeded(params2.path);
              await import_fs35.default.promises.copyFile(localPath, params2.path);
              resolve();
            } catch (e) {
              reject(e);
            }
          });
        }));
      }
      async saveAsStream(params2, progress2) {
        return await progress2.race(new Promise((resolve, reject) => {
          this._object.saveAs(progress2, async (localPath, error) => {
            if (error) {
              reject(error);
              return;
            }
            try {
              const readable = import_fs35.default.createReadStream(localPath, { highWaterMark: 1024 * 1024 });
              const stream3 = new StreamDispatcher(this, readable);
              resolve({ stream: stream3 });
              await new Promise((resolve2) => {
                readable.on("close", resolve2);
                readable.on("end", resolve2);
                readable.on("error", resolve2);
              });
            } catch (e) {
              reject(e);
            }
          });
        }));
      }
      async stream(params2, progress2) {
        const fileName = await this._object.localPathAfterFinished(progress2);
        const readable = import_fs35.default.createReadStream(fileName, { highWaterMark: 1024 * 1024 });
        return { stream: new StreamDispatcher(this, readable) };
      }
      async failure(params2, progress2) {
        const error = await this._object.failureError(progress2);
        return { error: error || void 0 };
      }
      async cancel(params2, progress2) {
        await this._object.cancel(progress2);
      }
      async delete(params2, progress2) {
        await this._object.delete(progress2);
        this._dispose();
      }
    };
  }
});

// packages/playwright-core/src/server/dispatchers/jsHandleDispatcher.ts
function parseArgument(arg) {
  return parseSerializedValue(arg.value, arg.handles.map((a) => a._object));
}
function serializeResult(arg) {
  return serializeValue(arg, (value2) => ({ fallThrough: value2 }));
}
var JSHandleDispatcher;
var init_jsHandleDispatcher = __esm({
  "packages/playwright-core/src/server/dispatchers/jsHandleDispatcher.ts"() {
    "use strict";
    init_dispatcher();
    init_elementHandlerDispatcher();
    init_serializers();
    JSHandleDispatcher = class _JSHandleDispatcher extends Dispatcher {
      constructor(scope, jsHandle) {
        super(scope, jsHandle, jsHandle.asElement() ? "ElementHandle" : "JSHandle", {
          preview: jsHandle.toString()
        });
        this._type_JSHandle = true;
        jsHandle._setPreviewCallback((preview) => this._dispatchEvent("previewUpdated", { preview }));
      }
      static fromJSHandle(scope, handle) {
        return scope.connection.existingDispatcher(handle) || new _JSHandleDispatcher(scope, handle);
      }
      async evaluateExpression(params2, progress2) {
        const jsHandle = await this._object.evaluateExpression(progress2, params2.expression, { isFunction: params2.isFunction }, parseArgument(params2.arg));
        return { value: serializeResult(jsHandle) };
      }
      async evaluateExpressionHandle(params2, progress2) {
        const jsHandle = await this._object.evaluateExpressionHandle(progress2, params2.expression, { isFunction: params2.isFunction }, parseArgument(params2.arg));
        return { handle: ElementHandleDispatcher.fromJSOrElementHandle(this.parentScope(), jsHandle) };
      }
      async getProperty(params2, progress2) {
        const jsHandle = await this._object.getProperty(progress2, params2.name);
        return { handle: ElementHandleDispatcher.fromJSOrElementHandle(this.parentScope(), jsHandle) };
      }
      async getPropertyList(params2, progress2) {
        const map = await this._object.getProperties(progress2);
        const properties = [];
        for (const [name, value2] of map) {
          properties.push({ name, value: ElementHandleDispatcher.fromJSOrElementHandle(this.parentScope(), value2) });
        }
        return { properties };
      }
      async jsonValue(params2, progress2) {
        return { value: serializeResult(await this._object.jsonValue(progress2)) };
      }
      async dispose(_, progress2) {
        this._object.dispose();
        this._dispose();
      }
    };
  }
});

// packages/playwright-core/src/generated/webSocketMockSource.ts
var source10;
var init_webSocketMockSource = __esm({
  "packages/playwright-core/src/generated/webSocketMockSource.ts"() {
    "use strict";
    source10 = `
var __commonJS = obj => {
  let required = false;
  let result;
  return function __require() {
    if (!required) {
      required = true;
      let fn;
      for (const name in obj) { fn = obj[name]; break; }
      const module = { exports: {} };
      fn(module.exports, module);
      result = module.exports;
    }
    return result;
  }
};
var __export = (target, all) => {for (var name in all) target[name] = all[name];};
var __toESM = mod => ({ ...mod, 'default': mod });
var __toCommonJS = mod => ({ ...mod, __esModule: true });


// packages/injected/src/webSocketMock.ts
var webSocketMock_exports = {};
__export(webSocketMock_exports, {
  inject: () => inject
});
module.exports = __toCommonJS(webSocketMock_exports);
function inject(globalThis) {
  if (globalThis.__pwWebSocketDispatch)
    return;
  function generateId() {
    const bytes = new Uint8Array(32);
    globalThis.crypto.getRandomValues(bytes);
    const hex = "0123456789abcdef";
    return [...bytes].map((value) => {
      const high = Math.floor(value / 16);
      const low = value % 16;
      return hex[high] + hex[low];
    }).join("");
  }
  function bufferToData(b) {
    let s = "";
    for (let i = 0; i < b.length; i++)
      s += String.fromCharCode(b[i]);
    return { data: globalThis.btoa(s), isBase64: true };
  }
  function stringToBuffer(s) {
    s = globalThis.atob(s);
    const b = new Uint8Array(s.length);
    for (let i = 0; i < s.length; i++)
      b[i] = s.charCodeAt(i);
    return b.buffer;
  }
  function messageToData(message, cb) {
    if (message instanceof globalThis.Blob)
      return message.arrayBuffer().then((buffer) => cb(bufferToData(new Uint8Array(buffer))));
    if (typeof message === "string")
      return cb({ data: message, isBase64: false });
    if (ArrayBuffer.isView(message))
      return cb(bufferToData(new Uint8Array(message.buffer, message.byteOffset, message.byteLength)));
    return cb(bufferToData(new Uint8Array(message)));
  }
  function dataToMessage(data, binaryType) {
    if (!data.isBase64)
      return data.data;
    const buffer = stringToBuffer(data.data);
    return binaryType === "arraybuffer" ? buffer : new Blob([buffer]);
  }
  const binding = globalThis.__pwWebSocketBinding;
  const NativeWebSocket = globalThis.WebSocket;
  const idToWebSocket = /* @__PURE__ */ new Map();
  globalThis.__pwWebSocketDispatch = (request) => {
    const ws = idToWebSocket.get(request.id);
    if (!ws)
      return;
    if (request.type === "connect")
      ws._apiConnect();
    if (request.type === "passthrough")
      ws._apiPassThrough();
    if (request.type === "ensureOpened")
      ws._apiEnsureOpened();
    if (request.type === "sendToPage")
      ws._apiSendToPage(dataToMessage(request.data, ws.binaryType));
    if (request.type === "closePage")
      ws._apiClosePage(request.code, request.reason, request.wasClean);
    if (request.type === "sendToServer")
      ws._apiSendToServer(dataToMessage(request.data, ws.binaryType));
    if (request.type === "closeServer")
      ws._apiCloseServer(request.code, request.reason, request.wasClean);
  };
  const _WebSocketMock = class _WebSocketMock extends EventTarget {
    constructor(url, protocols) {
      var _a, _b;
      super();
      // WebSocket.CLOSED
      this.CONNECTING = 0;
      // WebSocket.CONNECTING
      this.OPEN = 1;
      // WebSocket.OPEN
      this.CLOSING = 2;
      // WebSocket.CLOSING
      this.CLOSED = 3;
      // WebSocket.CLOSED
      this._oncloseListener = null;
      this._onerrorListener = null;
      this._onmessageListener = null;
      this._onopenListener = null;
      this.bufferedAmount = 0;
      this.extensions = "";
      this.protocol = "";
      this.readyState = 0;
      this._origin = "";
      this._passthrough = false;
      this._wsBufferedMessages = [];
      this._binaryType = "blob";
      this.url = new URL(url, globalThis.window.document.baseURI).href.replace(/^http/, "ws");
      this._origin = (_b = (_a = URL.parse(this.url)) == null ? void 0 : _a.origin) != null ? _b : "";
      this._protocols = protocols;
      this._id = generateId();
      idToWebSocket.set(this._id, this);
      const protocolsList = Array.isArray(protocols) ? [...protocols] : protocols ? [protocols] : [];
      binding({ type: "onCreate", id: this._id, url: this.url, protocols: protocolsList });
    }
    // --- native WebSocket implementation ---
    get binaryType() {
      return this._binaryType;
    }
    set binaryType(type) {
      this._binaryType = type;
      if (this._ws)
        this._ws.binaryType = type;
    }
    get onclose() {
      return this._oncloseListener;
    }
    set onclose(listener) {
      if (this._oncloseListener)
        this.removeEventListener("close", this._oncloseListener);
      this._oncloseListener = listener;
      if (this._oncloseListener)
        this.addEventListener("close", this._oncloseListener);
    }
    get onerror() {
      return this._onerrorListener;
    }
    set onerror(listener) {
      if (this._onerrorListener)
        this.removeEventListener("error", this._onerrorListener);
      this._onerrorListener = listener;
      if (this._onerrorListener)
        this.addEventListener("error", this._onerrorListener);
    }
    get onopen() {
      return this._onopenListener;
    }
    set onopen(listener) {
      if (this._onopenListener)
        this.removeEventListener("open", this._onopenListener);
      this._onopenListener = listener;
      if (this._onopenListener)
        this.addEventListener("open", this._onopenListener);
    }
    get onmessage() {
      return this._onmessageListener;
    }
    set onmessage(listener) {
      if (this._onmessageListener)
        this.removeEventListener("message", this._onmessageListener);
      this._onmessageListener = listener;
      if (this._onmessageListener)
        this.addEventListener("message", this._onmessageListener);
    }
    send(message) {
      if (this.readyState === _WebSocketMock.CONNECTING)
        throw new DOMException(\`Failed to execute 'send' on 'WebSocket': Still in CONNECTING state.\`);
      if (this.readyState !== _WebSocketMock.OPEN)
        throw new DOMException(\`WebSocket is already in CLOSING or CLOSED state.\`);
      if (this._passthrough) {
        if (this._ws)
          this._apiSendToServer(message);
      } else {
        messageToData(message, (data) => binding({ type: "onMessageFromPage", id: this._id, data }));
      }
    }
    close(code, reason) {
      if (code !== void 0 && code !== 1e3 && (code < 3e3 || code > 4999))
        throw new DOMException(\`Failed to execute 'close' on 'WebSocket': The close code must be either 1000, or between 3000 and 4999. \${code} is neither.\`);
      if (this.readyState === _WebSocketMock.OPEN || this.readyState === _WebSocketMock.CONNECTING)
        this.readyState = _WebSocketMock.CLOSING;
      if (this._passthrough)
        this._apiCloseServer(code, reason, true);
      else
        binding({ type: "onClosePage", id: this._id, code, reason, wasClean: true });
    }
    // --- methods called from the routing API ---
    _apiEnsureOpened() {
      if (!this._ws)
        this._ensureOpened();
    }
    _apiSendToPage(message) {
      this._ensureOpened();
      if (this.readyState !== _WebSocketMock.OPEN)
        throw new DOMException(\`WebSocket is already in CLOSING or CLOSED state.\`);
      this.dispatchEvent(new MessageEvent("message", { data: message, origin: this._origin, cancelable: true }));
    }
    _apiSendToServer(message) {
      if (!this._ws)
        throw new Error("Cannot send a message before connecting to the server");
      if (this._ws.readyState === _WebSocketMock.CONNECTING)
        this._wsBufferedMessages.push(message);
      else
        this._ws.send(message);
    }
    _apiConnect() {
      if (this._ws)
        throw new Error("Can only connect to the server once");
      this._ws = new NativeWebSocket(this.url, this._protocols);
      this._ws.binaryType = this._binaryType;
      this._ws.onopen = () => {
        for (const message of this._wsBufferedMessages)
          this._ws.send(message);
        this._wsBufferedMessages = [];
        this._ensureOpened();
      };
      this._ws.onclose = (event) => {
        this._onWSClose(event.code, event.reason, event.wasClean);
      };
      this._ws.onmessage = (event) => {
        if (this._passthrough)
          this._apiSendToPage(event.data);
        else
          messageToData(event.data, (data) => binding({ type: "onMessageFromServer", id: this._id, data }));
      };
      this._ws.onerror = () => {
        const event = new Event("error", { cancelable: true });
        this.dispatchEvent(event);
      };
    }
    // This method connects to the server, and passes all messages through,
    // as if WebSocketMock was not engaged.
    _apiPassThrough() {
      this._passthrough = true;
      this._apiConnect();
    }
    _apiCloseServer(code, reason, wasClean) {
      if (!this._ws) {
        this._onWSClose(code, reason, wasClean);
        return;
      }
      if (this._ws.readyState === _WebSocketMock.CONNECTING || this._ws.readyState === _WebSocketMock.OPEN)
        this._ws.close(code, reason);
    }
    _apiClosePage(code, reason, wasClean) {
      if (this.readyState === _WebSocketMock.CLOSED)
        return;
      this.readyState = _WebSocketMock.CLOSED;
      this.dispatchEvent(new CloseEvent("close", { code, reason, wasClean, cancelable: true }));
      this._maybeCleanup();
      if (this._passthrough)
        this._apiCloseServer(code, reason, wasClean);
      else
        binding({ type: "onClosePage", id: this._id, code, reason, wasClean });
    }
    // --- internals ---
    _ensureOpened() {
      var _a;
      if (this.readyState !== _WebSocketMock.CONNECTING)
        return;
      this.extensions = ((_a = this._ws) == null ? void 0 : _a.extensions) || "";
      if (this._ws)
        this.protocol = this._ws.protocol;
      else if (Array.isArray(this._protocols))
        this.protocol = this._protocols[0] || "";
      else
        this.protocol = this._protocols || "";
      this.readyState = _WebSocketMock.OPEN;
      this.dispatchEvent(new Event("open", { cancelable: true }));
    }
    _onWSClose(code, reason, wasClean) {
      if (this._passthrough)
        this._apiClosePage(code, reason, wasClean);
      else
        binding({ type: "onCloseServer", id: this._id, code, reason, wasClean });
      if (this._ws) {
        this._ws.onopen = null;
        this._ws.onclose = null;
        this._ws.onmessage = null;
        this._ws.onerror = null;
        this._ws = void 0;
        this._wsBufferedMessages = [];
      }
      this._maybeCleanup();
    }
    _maybeCleanup() {
      if (this.readyState === _WebSocketMock.CLOSED && !this._ws)
        idToWebSocket.delete(this._id);
    }
  };
  _WebSocketMock.CONNECTING = 0;
  // WebSocket.CONNECTING
  _WebSocketMock.OPEN = 1;
  // WebSocket.OPEN
  _WebSocketMock.CLOSING = 2;
  // WebSocket.CLOSING
  _WebSocketMock.CLOSED = 3;
  let WebSocketMock = _WebSocketMock;
  globalThis.WebSocket = class WebSocket extends WebSocketMock {
  };
}
`;
  }
});

// packages/playwright-core/src/server/dispatchers/webSocketRouteDispatcher.ts
function matchesPattern(dispatcher, baseURL, url2) {
  for (const pattern of dispatcher._webSocketInterceptionPatterns || []) {
    if (urlMatches(baseURL, url2, deserializeURLMatch(pattern), true))
      return true;
  }
  return false;
}
var WebSocketRouteDispatcher, kBindingName3;
var init_webSocketRouteDispatcher = __esm({
  "packages/playwright-core/src/server/dispatchers/webSocketRouteDispatcher.ts"() {
    "use strict";
    init_urlMatch();
    init_eventsHelper();
    init_page();
    init_dispatcher();
    init_pageDispatcher();
    init_webSocketMockSource();
    init_instrumentation();
    WebSocketRouteDispatcher = class _WebSocketRouteDispatcher extends Dispatcher {
      constructor(scope, id, url2, protocols, frame) {
        super(scope, new SdkObject(scope._object, "webSocketRoute"), "WebSocketRoute", { url: url2, protocols });
        this._type_WebSocketRoute = true;
        this._id = id;
        this._frame = frame;
        this._eventListeners.push(
          // When the frame navigates or detaches, there will be no more communication
          // from the mock websocket, so pretend like it was closed.
          eventsHelper.addEventListener(frame._page, Page.Events.InternalFrameNavigatedToNewDocument, (frame2) => {
            if (frame2 === this._frame)
              this._executionContextGone();
          }),
          eventsHelper.addEventListener(frame._page, Page.Events.FrameDetached, (frame2) => {
            if (frame2 === this._frame)
              this._executionContextGone();
          }),
          eventsHelper.addEventListener(frame._page, Page.Events.Close, () => this._executionContextGone()),
          eventsHelper.addEventListener(frame._page, Page.Events.Crash, () => this._executionContextGone())
        );
        _WebSocketRouteDispatcher._idToDispatcher.set(this._id, this);
        scope._dispatchEvent("webSocketRoute", { webSocketRoute: this });
      }
      static {
        this._idToDispatcher = /* @__PURE__ */ new Map();
      }
      static async install(progress2, connection, target) {
        const context2 = target instanceof Page ? target.browserContext : target;
        let data = context2.getBindingClient(kBindingName3);
        if (data && data.connection !== connection)
          throw new Error("Another client is already routing WebSockets");
        if (!data) {
          data = { counter: 0, connection, binding: null };
          data.binding = await context2.exposeBinding(progress2, kBindingName3, (source11, payload) => {
            if (payload.type === "onCreate") {
              const contextDispatcher = connection.existingDispatcher(context2);
              const pageDispatcher = contextDispatcher ? PageDispatcher.fromNullable(contextDispatcher, source11.page) : void 0;
              let scope;
              if (pageDispatcher && matchesPattern(pageDispatcher, context2._options.baseURL, payload.url))
                scope = pageDispatcher;
              else if (contextDispatcher && matchesPattern(contextDispatcher, context2._options.baseURL, payload.url))
                scope = contextDispatcher;
              if (scope) {
                new _WebSocketRouteDispatcher(scope, payload.id, payload.url, payload.protocols, source11.frame);
              } else {
                const request2 = { id: payload.id, type: "passthrough" };
                source11.frame.evaluateExpression(progress2, `globalThis.__pwWebSocketDispatch(${JSON.stringify(request2)})`).catch(() => {
                });
              }
              return;
            }
            const dispatcher = _WebSocketRouteDispatcher._idToDispatcher.get(payload.id);
            if (payload.type === "onMessageFromPage")
              dispatcher?._dispatchEvent("messageFromPage", { message: payload.data.data, isBase64: payload.data.isBase64 });
            if (payload.type === "onMessageFromServer")
              dispatcher?._dispatchEvent("messageFromServer", { message: payload.data.data, isBase64: payload.data.isBase64 });
            if (payload.type === "onClosePage")
              dispatcher?._dispatchEvent("closePage", { code: payload.code, reason: payload.reason, wasClean: payload.wasClean });
            if (payload.type === "onCloseServer")
              dispatcher?._dispatchEvent("closeServer", { code: payload.code, reason: payload.reason, wasClean: payload.wasClean });
          }, data);
        }
        ++data.counter;
        return await target.addInitScript(progress2, `
      (() => {
        const module = {};
        ${source10}
        (module.exports.inject())(globalThis);
      })();
    `);
      }
      static async uninstall(connection, target, initScript) {
        const context2 = target instanceof Page ? target.browserContext : target;
        const data = context2.getBindingClient(kBindingName3);
        if (!data || data.connection !== connection)
          return;
        if (--data.counter <= 0)
          await data.binding.dispose();
        await initScript.dispose();
      }
      async connect(params2, progress2) {
        await this._evaluateAPIRequest(progress2, { id: this._id, type: "connect" });
      }
      async ensureOpened(params2, progress2) {
        await this._evaluateAPIRequest(progress2, { id: this._id, type: "ensureOpened" });
      }
      async sendToPage(params2, progress2) {
        await this._evaluateAPIRequest(progress2, { id: this._id, type: "sendToPage", data: { data: params2.message, isBase64: params2.isBase64 } });
      }
      async sendToServer(params2, progress2) {
        await this._evaluateAPIRequest(progress2, { id: this._id, type: "sendToServer", data: { data: params2.message, isBase64: params2.isBase64 } });
      }
      async closePage(params2, progress2) {
        await this._evaluateAPIRequest(progress2, { id: this._id, type: "closePage", code: params2.code, reason: params2.reason, wasClean: params2.wasClean });
      }
      async closeServer(params2, progress2) {
        await this._evaluateAPIRequest(progress2, { id: this._id, type: "closeServer", code: params2.code, reason: params2.reason, wasClean: params2.wasClean });
      }
      async _evaluateAPIRequest(progress2, request2) {
        await this._frame.evaluateExpression(progress2, `globalThis.__pwWebSocketDispatch(${JSON.stringify(request2)})`).catch(() => {
        });
      }
      _onDispose() {
        _WebSocketRouteDispatcher._idToDispatcher.delete(this._id);
      }
      _executionContextGone() {
        if (!this._disposed) {
          this._dispatchEvent("closePage", { wasClean: true });
          this._dispatchEvent("closeServer", { wasClean: true });
        }
      }
    };
    kBindingName3 = "__pwWebSocketBinding";
  }
});

// packages/playwright-core/src/server/dispatchers/disposableDispatcher.ts
var DisposableDispatcher;
var init_disposableDispatcher = __esm({
  "packages/playwright-core/src/server/dispatchers/disposableDispatcher.ts"() {
    "use strict";
    init_dispatcher();
    DisposableDispatcher = class extends Dispatcher {
      constructor(scope, disposable) {
        super(scope, disposable, "Disposable", {});
        this._type_Disposable = true;
      }
      async dispose(_, progress2) {
        await progress2.race(this._object.dispose());
        this._dispose();
      }
    };
  }
});

// packages/playwright-core/src/server/dispatchers/pageDispatcher.ts
function createVideoDispatcher(parentScope, video) {
  return ArtifactDispatcher.from(parentScope.parentScope(), video);
}
var PageDispatcher, WorkerDispatcher, BindingCallDispatcher;
var init_pageDispatcher = __esm({
  "packages/playwright-core/src/server/dispatchers/pageDispatcher.ts"() {
    "use strict";
    init_protocolFormatter();
    init_urlMatch();
    init_page();
    init_dispatcher();
    init_errors();
    init_artifactDispatcher();
    init_elementHandlerDispatcher();
    init_frameDispatcher();
    init_jsHandleDispatcher();
    init_networkDispatchers();
    init_networkDispatchers();
    init_networkDispatchers();
    init_webSocketRouteDispatcher();
    init_disposableDispatcher();
    init_instrumentation();
    init_recorder();
    init_disposable2();
    init_videoRecorder();
    init_progress();
    PageDispatcher = class _PageDispatcher extends Dispatcher {
      constructor(parentScope, page) {
        const mainFrame = FrameDispatcher.from(parentScope, page.mainFrame());
        super(parentScope, page, "Page", {
          mainFrame,
          viewportSize: page.emulatedSize()?.viewport,
          isClosed: page.isClosed(),
          opener: _PageDispatcher.fromNullable(parentScope, page.opener()),
          video: page.video ? createVideoDispatcher(parentScope, page.video) : void 0
        });
        this._type_Page = true;
        this._subscriptions = /* @__PURE__ */ new Set();
        this._webSocketInterceptionPatterns = [];
        this._disposables = [];
        this._interceptionUrlMatchers = [];
        this._locatorHandlers = /* @__PURE__ */ new Set();
        this._jsCoverageActive = false;
        this._cssCoverageActive = false;
        this.adopt(mainFrame);
        this._page = page;
        this._requestInterceptor = (route2, request2) => {
          const matchesSome = this._interceptionUrlMatchers.some((urlMatch) => urlMatches(this._page.browserContext._options.baseURL, request2.url(), urlMatch));
          if (!matchesSome) {
            route2.continue({ isFallback: true }).catch(() => {
            });
            return;
          }
          this._dispatchEvent("route", { route: new RouteDispatcher(RequestDispatcher.from(this.parentScope(), request2), route2) });
        };
        this.addObjectListener(Page.Events.Close, () => {
          this._dispatchEvent("close");
          this._dispose();
        });
        this.addObjectListener(Page.Events.Crash, () => this._dispatchEvent("crash"));
        this.addObjectListener(Page.Events.Download, (download) => {
          this._dispatchEvent("download", { url: download.url, suggestedFilename: download.suggestedFilename(), artifact: ArtifactDispatcher.from(parentScope, download.artifact) });
        });
        this.addObjectListener(Page.Events.EmulatedSizeChanged, () => this._dispatchEvent("viewportSizeChanged", { viewportSize: page.emulatedSize()?.viewport }));
        this.addObjectListener(Page.Events.FileChooser, (fileChooser) => this._dispatchEvent("fileChooser", {
          element: ElementHandleDispatcher.from(mainFrame, fileChooser.element()),
          isMultiple: fileChooser.isMultiple()
        }));
        this.addObjectListener(Page.Events.FrameAttached, (frame) => this._onFrameAttached(frame));
        this.addObjectListener(Page.Events.FrameDetached, (frame) => this._onFrameDetached(frame));
        this.addObjectListener(Page.Events.LocatorHandlerTriggered, (uid) => this._dispatchEvent("locatorHandlerTriggered", { uid }));
        this.addObjectListener(Page.Events.WebSocket, (webSocket) => this._dispatchEvent("webSocket", { webSocket: new WebSocketDispatcher(this, webSocket) }));
        this.addObjectListener(Page.Events.Worker, (worker) => this._dispatchEvent("worker", { worker: new WorkerDispatcher(this, worker) }));
        const frames = page.frameManager.frames();
        for (let i = 1; i < frames.length; i++)
          this._onFrameAttached(frames[i]);
      }
      static from(parentScope, page) {
        return _PageDispatcher.fromNullable(parentScope, page);
      }
      static fromNullable(parentScope, page) {
        if (!page)
          return void 0;
        const result2 = parentScope.connection.existingDispatcher(page);
        return result2 || new _PageDispatcher(parentScope, page);
      }
      page() {
        return this._page;
      }
      async exposeBinding(params2, progress2) {
        const binding = await this._page.exposeBinding(progress2, params2.name, (source11, ...args) => {
          if (this._disposed)
            return;
          const binding2 = new BindingCallDispatcher(this, params2.name, source11, args);
          this._dispatchEvent("bindingCall", { binding: binding2 });
          return binding2.promise();
        });
        this._disposables.push(binding);
        return { disposable: new DisposableDispatcher(this, binding) };
      }
      async setExtraHTTPHeaders(params2, progress2) {
        await this._page.setExtraHTTPHeaders(progress2, params2.headers);
      }
      async reload(params2, progress2) {
        return { response: ResponseDispatcher.fromNullable(this.parentScope(), await this._page.reload(progress2, params2)) };
      }
      async goBack(params2, progress2) {
        return { response: ResponseDispatcher.fromNullable(this.parentScope(), await this._page.goBack(progress2, params2)) };
      }
      async goForward(params2, progress2) {
        return { response: ResponseDispatcher.fromNullable(this.parentScope(), await this._page.goForward(progress2, params2)) };
      }
      async requestGC(params2, progress2) {
        await this._page.requestGC(progress2);
      }
      async registerLocatorHandler(params2, progress2) {
        const uid = this._page.registerLocatorHandler(params2.selector, params2.noWaitAfter);
        this._locatorHandlers.add(uid);
        return { uid };
      }
      async resolveLocatorHandlerNoReply(params2, progress2) {
        this._page.resolveLocatorHandler(params2.uid, params2.remove);
      }
      async unregisterLocatorHandler(params2, progress2) {
        this._page.unregisterLocatorHandler(params2.uid);
        this._locatorHandlers.delete(params2.uid);
      }
      async emulateMedia(params2, progress2) {
        await this._page.emulateMedia(progress2, {
          media: params2.media,
          colorScheme: params2.colorScheme,
          reducedMotion: params2.reducedMotion,
          forcedColors: params2.forcedColors,
          contrast: params2.contrast
        });
      }
      async setViewportSize(params2, progress2) {
        await this._page.setViewportSize(progress2, params2.viewportSize);
      }
      async addInitScript(params2, progress2) {
        const initScript = await this._page.addInitScript(progress2, params2.source);
        this._disposables.push(initScript);
        return { disposable: new DisposableDispatcher(this, initScript) };
      }
      async setNetworkInterceptionPatterns(params2, progress2) {
        const hadMatchers = this._interceptionUrlMatchers.length > 0;
        if (!params2.patterns.length) {
          if (hadMatchers)
            await progress2.race(this._page.removeRequestInterceptor(this._requestInterceptor));
          this._interceptionUrlMatchers = [];
        } else {
          this._interceptionUrlMatchers = params2.patterns.map(deserializeURLMatch);
          if (!hadMatchers)
            await this._page.addRequestInterceptor(progress2, this._requestInterceptor);
        }
      }
      async setWebSocketInterceptionPatterns(params2, progress2) {
        this._webSocketInterceptionPatterns = params2.patterns;
        if (params2.patterns.length && !this._routeWebSocketInitScript)
          this._routeWebSocketInitScript = await WebSocketRouteDispatcher.install(progress2, this.connection, this._page);
      }
      async expectScreenshot(params2, progress2) {
        const mask = (params2.mask || []).map(({ frame, selector }) => ({
          frame: frame._object,
          selector
        }));
        const locator2 = params2.locator ? {
          frame: params2.locator.frame._object,
          selector: params2.locator.selector
        } : void 0;
        progress2.log(`${renderTitleForCall(progress2.metadata)}${params2.timeout ? ` with timeout ${params2.timeout}ms` : ""}`);
        return await this._page.expectScreenshot(progress2, {
          ...params2,
          locator: locator2,
          mask
        });
      }
      async screenshot(params2, progress2) {
        const mask = (params2.mask || []).map(({ frame, selector }) => ({
          frame: frame._object,
          selector
        }));
        return { binary: await this._page.screenshot(progress2, { ...params2, mask }) };
      }
      async close(params2, progress2) {
        await this._page.close(progress2, params2);
      }
      async runBeforeUnload(params2, progress2) {
        await this._page.runBeforeUnload(progress2);
      }
      async updateSubscription(params2, progress2) {
        if (params2.event === "fileChooser")
          await this._page.setFileChooserInterceptedBy(progress2, params2.enabled, this);
        if (params2.enabled)
          this._subscriptions.add(params2.event);
        else
          this._subscriptions.delete(params2.event);
      }
      async keyboardDown(params2, progress2) {
        await this._page.keyboard.apiDown(progress2, params2.key);
      }
      async keyboardUp(params2, progress2) {
        await this._page.keyboard.apiUp(progress2, params2.key);
      }
      async keyboardInsertText(params2, progress2) {
        await this._page.keyboard.apiInsertText(progress2, params2.text);
      }
      async keyboardType(params2, progress2) {
        await this._page.keyboard.apiType(progress2, params2.text, params2);
      }
      async keyboardPress(params2, progress2) {
        await this._page.keyboard.apiPress(progress2, params2.key, params2);
      }
      async clearConsoleMessages(params2, progress2) {
        this._page.clearConsoleMessages();
      }
      async consoleMessages(params2, progress2) {
        this._subscriptions.add("console");
        return { messages: this._page.consoleMessages(params2.filter).map((message) => this.parentScope().serializeConsoleMessage(message, this)) };
      }
      async clearPageErrors(params2, progress2) {
        this._page.clearPageErrors();
      }
      async pageErrors(params2, progress2) {
        return { errors: this._page.pageErrors(params2.filter).map((error) => serializeError(error)) };
      }
      async mouseMove(params2, progress2) {
        await this._page.mouse.apiMove(progress2, params2.x, params2.y, params2);
      }
      async mouseDown(params2, progress2) {
        await this._page.mouse.apiDown(progress2, params2);
      }
      async mouseUp(params2, progress2) {
        await this._page.mouse.apiUp(progress2, params2);
      }
      async mouseClick(params2, progress2) {
        await this._page.mouse.apiClick(progress2, params2.x, params2.y, params2);
      }
      async mouseWheel(params2, progress2) {
        await this._page.mouse.apiWheel(progress2, params2.deltaX, params2.deltaY);
      }
      async touchscreenTap(params2, progress2) {
        await this._page.touchscreen.apiTap(progress2, params2.x, params2.y);
      }
      async pdf(params2, progress2) {
        if (!this._page.pdf)
          throw new Error("PDF generation is only supported for Headless Chromium");
        const buffer = await progress2.race(this._page.pdf(params2));
        return { pdf: buffer };
      }
      async requests(params2, progress2) {
        this._subscriptions.add("request");
        return { requests: this._page.networkRequests().map((request2) => RequestDispatcher.from(this.parentScope(), request2)) };
      }
      async bringToFront(params2, progress2) {
        await this._page.bringToFront(progress2);
      }
      async pickLocator(params2, progress2) {
        const recorder = await progress2.race(Recorder.forContext(this._page.browserContext, { omitCallTracking: true, hideToolbar: true }));
        const selector = await recorder.pickLocator(progress2, this._page);
        return { selector };
      }
      async cancelPickLocator(params2, progress2) {
        const recorder = await progress2.race(Recorder.existingForContext(this._page.browserContext));
        if (recorder)
          await progress2.race(recorder.setMode("none"));
      }
      async hideHighlight(params2, progress2) {
        await progress2.race(this._page.hideHighlight());
      }
      async screencastShowOverlay(params2) {
        const id = await this._page.overlay.show(params2.html, params2.duration);
        return { id };
      }
      async screencastRemoveOverlay(params2) {
        await this._page.overlay.remove(params2.id);
      }
      async screencastChapter(params2) {
        await this._page.overlay.chapter(params2);
      }
      async screencastSetOverlayVisible(params2) {
        await this._page.overlay.setVisible(params2.visible);
      }
      async screencastShowActions(params2) {
        this._page.screencast.showActions({ duration: params2.duration, position: params2.position, fontSize: params2.fontSize, cursor: params2.cursor });
      }
      async screencastHideActions() {
        this._page.screencast.hideActions();
      }
      async screencastStart(params2, progress2) {
        if (this._screencastClient || this._videoRecorder)
          throw new Error("Screencast is already running");
        if (params2.sendFrames) {
          this._screencastClient = {
            onFrame: (frame) => {
              this._dispatchEvent("screencastFrame", { data: frame.buffer, timestamp: frame.frameSwapWallTime, viewportWidth: frame.viewportWidth, viewportHeight: frame.viewportHeight });
            },
            dispose: () => {
            },
            size: params2.size,
            quality: params2.quality
          };
          this._page.screencast.addClient(this._screencastClient);
        }
        let artifact;
        if (params2.record) {
          this._videoRecorder = new VideoRecorder(this._page.screencast);
          artifact = this._videoRecorder.start(params2);
        }
        return { artifact: artifact ? createVideoDispatcher(this.parentScope(), artifact) : void 0 };
      }
      async screencastStop(params2, progress2) {
        if (this._videoRecorder) {
          await this._videoRecorder.stop();
          this._videoRecorder = void 0;
        }
        const client = this._screencastClient;
        this._screencastClient = void 0;
        if (client)
          this._page.screencast.removeClient(client);
      }
      async startJSCoverage(params2, progress2) {
        const coverage = this._page.coverage;
        await coverage.startJSCoverage(progress2, params2);
        this._jsCoverageActive = true;
      }
      async stopJSCoverage(params2, progress2) {
        this._jsCoverageActive = false;
        const coverage = this._page.coverage;
        return await progress2.race(coverage.stopJSCoverage());
      }
      async startCSSCoverage(params2, progress2) {
        const coverage = this._page.coverage;
        await coverage.startCSSCoverage(progress2, params2);
        this._cssCoverageActive = true;
      }
      async stopCSSCoverage(params2, progress2) {
        this._cssCoverageActive = false;
        const coverage = this._page.coverage;
        return await progress2.race(coverage.stopCSSCoverage());
      }
      _onFrameAttached(frame) {
        this._dispatchEvent("frameAttached", { frame: FrameDispatcher.from(this.parentScope(), frame) });
      }
      _onFrameDetached(frame) {
        this._dispatchEvent("frameDetached", { frame: FrameDispatcher.from(this.parentScope(), frame) });
      }
      _onDispose() {
        if (this._page.isClosedOrClosingOrCrashed())
          return;
        this._interceptionUrlMatchers = [];
        this._page.removeRequestInterceptor(this._requestInterceptor).catch(() => {
        });
        disposeAll2(this._disposables).catch(() => {
        });
        if (this._routeWebSocketInitScript)
          WebSocketRouteDispatcher.uninstall(this.connection, this._page, this._routeWebSocketInitScript).catch(() => {
          });
        this._routeWebSocketInitScript = void 0;
        for (const uid of this._locatorHandlers)
          this._page.unregisterLocatorHandler(uid);
        this._locatorHandlers.clear();
        this._page.setFileChooserInterceptedBy(nullProgress, false, this).catch(() => {
        });
        if (this._jsCoverageActive)
          this._page.coverage.stopJSCoverage().catch(() => {
          });
        this._jsCoverageActive = false;
        if (this._cssCoverageActive)
          this._page.coverage.stopCSSCoverage().catch(() => {
          });
        this._cssCoverageActive = false;
        this.screencastStop({}, void 0).catch(() => {
        });
      }
      async setDockTile(params2) {
        await this._page.setDockTile(params2.image);
      }
      async webStorageItems(params2, progress2) {
        return { items: await this._page.webStorageItems(progress2, params2.kind) };
      }
      async webStorageGetItem(params2, progress2) {
        return { value: await this._page.webStorageGetItem(progress2, params2.kind, params2.name) };
      }
      async webStorageSetItem(params2, progress2) {
        await this._page.webStorageSetItem(progress2, params2.kind, params2.name, params2.value);
      }
      async webStorageRemoveItem(params2, progress2) {
        await this._page.webStorageRemoveItem(progress2, params2.kind, params2.name);
      }
      async webStorageClear(params2, progress2) {
        await this._page.webStorageClear(progress2, params2.kind);
      }
    };
    WorkerDispatcher = class _WorkerDispatcher extends Dispatcher {
      constructor(scope, worker) {
        super(scope, worker, "Worker", {
          url: worker.url
        });
        this._type_Worker = true;
        this._subscriptions = /* @__PURE__ */ new Set();
        this.addObjectListener(Worker.Events.Console, (message) => {
          if (!this._subscriptions.has("console"))
            return;
          this._dispatchEvent("console", {
            type: message.type(),
            text: message.text(),
            args: message.args().map((a) => JSHandleDispatcher.fromJSHandle(this, a)),
            location: message.location(),
            timestamp: message.timestamp()
          });
        });
        this.addObjectListener(Worker.Events.Close, () => this._dispatchEvent("close"));
      }
      static fromNullable(scope, worker) {
        if (!worker)
          return void 0;
        const result2 = scope.connection.existingDispatcher(worker);
        return result2 || new _WorkerDispatcher(scope, worker);
      }
      async disconnect(params2, progress2) {
        await this._object.disconnect(progress2, params2);
      }
      async evaluateExpression(params2, progress2) {
        return { value: serializeResult(await this._object.evaluateExpression(progress2, params2.expression, params2.isFunction, parseArgument(params2.arg))) };
      }
      async evaluateExpressionHandle(params2, progress2) {
        return { handle: JSHandleDispatcher.fromJSHandle(this, await this._object.evaluateExpressionHandle(progress2, params2.expression, params2.isFunction, parseArgument(params2.arg))) };
      }
      async updateSubscription(params2, progress2) {
        if (params2.enabled)
          this._subscriptions.add(params2.event);
        else
          this._subscriptions.delete(params2.event);
      }
    };
    BindingCallDispatcher = class extends Dispatcher {
      constructor(scope, name, source11, args) {
        const frameDispatcher = FrameDispatcher.from(scope.parentScope(), source11.frame);
        super(scope, new SdkObject(scope._object, "bindingCall"), "BindingCall", {
          frame: frameDispatcher,
          name,
          args: args.map(serializeResult)
        });
        this._type_BindingCall = true;
        this._promise = new Promise((resolve, reject) => {
          this._resolve = resolve;
          this._reject = reject;
        });
      }
      promise() {
        return this._promise;
      }
      async resolve(params2, progress2) {
        this._resolve(parseArgument(params2.result));
        this._dispose();
      }
      async reject(params2, progress2) {
        this._reject(parseError(params2.error));
        this._dispose();
      }
    };
  }
});

// packages/playwright-core/src/server/dispatchers/dialogDispatcher.ts
var DialogDispatcher;
var init_dialogDispatcher = __esm({
  "packages/playwright-core/src/server/dispatchers/dialogDispatcher.ts"() {
    "use strict";
    init_dispatcher();
    init_pageDispatcher();
    DialogDispatcher = class extends Dispatcher {
      constructor(scope, dialog) {
        const page = PageDispatcher.fromNullable(scope, dialog.page().initializedOrUndefined());
        super(page || scope, dialog, "Dialog", {
          page,
          type: dialog.type(),
          message: dialog.message(),
          defaultValue: dialog.defaultValue()
        });
        this._type_Dialog = true;
      }
      async accept(params2, progress2) {
        await this._object.accept(progress2, params2.promptText);
      }
      async dismiss(params2, progress2) {
        await this._object.dismiss(progress2);
      }
    };
  }
});

// packages/playwright-core/src/server/dispatchers/tracingDispatcher.ts
var TracingDispatcher;
var init_tracingDispatcher = __esm({
  "packages/playwright-core/src/server/dispatchers/tracingDispatcher.ts"() {
    "use strict";
    init_artifactDispatcher();
    init_dispatcher();
    init_progress();
    TracingDispatcher = class _TracingDispatcher extends Dispatcher {
      constructor(scope, tracing) {
        super(scope, tracing, "Tracing", {});
        this._type_Tracing = true;
        this._started = false;
      }
      static from(scope, tracing) {
        const result2 = scope.connection.existingDispatcher(tracing);
        return result2 || new _TracingDispatcher(scope, tracing);
      }
      async tracingStart(params2, progress2) {
        this._object.start(progress2, params2);
        this._started = true;
      }
      async tracingStartChunk(params2, progress2) {
        return await this._object.startChunk(progress2, params2);
      }
      async tracingGroup(params2, progress2) {
        const { name, location: location2 } = params2;
        this._object.group(progress2, name, location2);
      }
      async tracingGroupEnd(params2, progress2) {
        this._object.groupEnd(progress2);
      }
      async tracingStopChunk(params2, progress2) {
        const { artifact, entries } = await this._object.stopChunk(progress2, params2);
        return { artifact: artifact ? ArtifactDispatcher.from(this, artifact) : void 0, entries };
      }
      async tracingStop(params2, progress2) {
        await this._object.stop(progress2);
      }
      async harStart(params2, progress2) {
        const harId = this._object.harStart(params2.page ? params2.page._object : null, params2.options);
        return { harId };
      }
      async harExport(params2, progress2) {
        const { artifact, entries } = await this._object.harExport(progress2, params2.harId, params2.mode);
        return {
          artifact: artifact ? ArtifactDispatcher.from(this, artifact) : void 0,
          entries
        };
      }
      _onDispose() {
        if (this._started)
          this._object.stopChunk(nullProgress, { mode: "discard" }).then(() => this._object.stop(nullProgress)).catch(() => {
          });
        this._started = false;
      }
    };
  }
});

// packages/playwright-core/src/server/dispatchers/writableStreamDispatcher.ts
var import_fs36, WritableStreamSdkObject, WritableStreamDispatcher;
var init_writableStreamDispatcher = __esm({
  "packages/playwright-core/src/server/dispatchers/writableStreamDispatcher.ts"() {
    "use strict";
    import_fs36 = __toESM(require("fs"));
    init_dispatcher();
    init_instrumentation();
    WritableStreamSdkObject = class extends SdkObject {
      constructor(parent, streamOrDirectory, lastModifiedMs) {
        super(parent, "stream");
        this.streamOrDirectory = streamOrDirectory;
        this.lastModifiedMs = lastModifiedMs;
      }
    };
    WritableStreamDispatcher = class extends Dispatcher {
      constructor(scope, streamOrDirectory, lastModifiedMs) {
        super(scope, new WritableStreamSdkObject(scope._object, streamOrDirectory, lastModifiedMs), "WritableStream", {});
        this._type_WritableStream = true;
      }
      async write(params2, progress2) {
        if (typeof this._object.streamOrDirectory === "string")
          throw new Error("Cannot write to a directory");
        const stream3 = this._object.streamOrDirectory;
        await progress2.race(new Promise((fulfill, reject) => {
          stream3.write(params2.binary, (error) => {
            if (error)
              reject(error);
            else
              fulfill();
          });
        }));
      }
      async close(params2, progress2) {
        if (typeof this._object.streamOrDirectory === "string")
          throw new Error("Cannot close a directory");
        const stream3 = this._object.streamOrDirectory;
        await progress2.race(new Promise((fulfill) => stream3.end(fulfill)));
        if (this._object.lastModifiedMs)
          await progress2.race(import_fs36.default.promises.utimes(this.path(), new Date(this._object.lastModifiedMs), new Date(this._object.lastModifiedMs)));
      }
      path() {
        if (typeof this._object.streamOrDirectory === "string")
          return this._object.streamOrDirectory;
        return this._object.streamOrDirectory.path;
      }
      _onDispose() {
        if (typeof this._object.streamOrDirectory !== "string")
          this._object.streamOrDirectory.destroy();
      }
    };
  }
});

// packages/playwright-core/src/server/dispatchers/browserContextDispatcher.ts
var import_fs37, import_path34, BrowserContextDispatcher;
var init_browserContextDispatcher = __esm({
  "packages/playwright-core/src/server/dispatchers/browserContextDispatcher.ts"() {
    "use strict";
    import_fs37 = __toESM(require("fs"));
    import_path34 = __toESM(require("path"));
    init_urlMatch();
    init_crypto();
    init_fileUtils();
    init_browserContext();
    init_cdpSessionDispatcher();
    init_debuggerDispatcher();
    init_dialogDispatcher();
    init_dispatcher();
    init_frameDispatcher();
    init_networkDispatchers();
    init_pageDispatcher();
    init_crBrowser();
    init_errors();
    init_disposableDispatcher();
    init_tracingDispatcher();
    init_webSocketRouteDispatcher();
    init_writableStreamDispatcher();
    init_recorder();
    init_recorderApp();
    init_elementHandlerDispatcher();
    init_jsHandleDispatcher();
    init_disposable2();
    BrowserContextDispatcher = class _BrowserContextDispatcher extends Dispatcher {
      constructor(parentScope, context2) {
        const debugger_ = DebuggerDispatcher.from(parentScope, context2.debugger());
        const requestContext = APIRequestContextDispatcher.from(parentScope, context2.fetchRequest);
        const tracing = TracingDispatcher.from(parentScope, context2.tracing);
        super(parentScope, context2, "BrowserContext", {
          debugger: debugger_,
          requestContext,
          tracing,
          options: context2._options
        });
        this._type_BrowserContext = true;
        this._subscriptions = /* @__PURE__ */ new Set();
        this._webSocketInterceptionPatterns = [];
        this._disposables = [];
        this._clockPaused = false;
        this._interceptionUrlMatchers = [];
        this.adopt(debugger_);
        this.adopt(requestContext);
        this.adopt(tracing);
        this._requestInterceptor = (route2, request2) => {
          const matchesSome = this._interceptionUrlMatchers.some((urlMatch) => urlMatches(this._context._options.baseURL, request2.url(), urlMatch));
          const routeDispatcher = this.connection.existingDispatcher(route2);
          if (!matchesSome || routeDispatcher) {
            route2.continue({ isFallback: true }).catch(() => {
            });
            return;
          }
          this._dispatchEvent("route", { route: new RouteDispatcher(RequestDispatcher.from(this, request2), route2) });
        };
        this._context = context2;
        for (const page of context2.pages())
          this._dispatchEvent("page", { page: PageDispatcher.from(this, page) });
        this.addObjectListener(BrowserContext.Events.Page, (page) => {
          this._dispatchEvent("page", { page: PageDispatcher.from(this, page) });
        });
        this.addObjectListener(BrowserContext.Events.Close, () => {
          this._dispatchEvent("close");
          this._dispose();
        });
        this.addObjectListener(BrowserContext.Events.PageError, (pageError, page) => {
          this._dispatchEvent("pageError", {
            error: serializeError(pageError.error),
            page: PageDispatcher.from(this, page),
            location: {
              url: pageError.location.url,
              line: pageError.location.lineNumber,
              column: pageError.location.columnNumber
            }
          });
        });
        this.addObjectListener(BrowserContext.Events.Console, (message) => {
          const pageDispatcher = PageDispatcher.fromNullable(this, message.page());
          const workerDispatcher = WorkerDispatcher.fromNullable(this, message.worker());
          if (this._shouldDispatchEvent(message.page(), "console") || workerDispatcher?._subscriptions.has("console")) {
            this._dispatchEvent("console", {
              page: pageDispatcher,
              worker: workerDispatcher,
              ...this.serializeConsoleMessage(message, workerDispatcher || pageDispatcher)
            });
          }
        });
        this._dialogHandler = (dialog) => {
          if (!this._shouldDispatchEvent(dialog.page(), "dialog"))
            return false;
          this._dispatchEvent("dialog", { dialog: new DialogDispatcher(this, dialog) });
          return true;
        };
        context2.dialogManager.addDialogHandler(this._dialogHandler);
        if (context2._browser.options.name === "chromium" && this._object._browser instanceof CRBrowser) {
          for (const serviceWorker of context2.serviceWorkers())
            this._dispatchEvent("serviceWorker", { worker: new WorkerDispatcher(this, serviceWorker) });
          this.addObjectListener(CRBrowserContext.CREvents.ServiceWorker, (serviceWorker) => this._dispatchEvent("serviceWorker", { worker: new WorkerDispatcher(this, serviceWorker) }));
        }
        this.addObjectListener(BrowserContext.Events.Request, (request2) => {
          const redirectFromDispatcher = request2.redirectedFrom() && this.connection.existingDispatcher(request2.redirectedFrom());
          if (!redirectFromDispatcher && !this._shouldDispatchNetworkEvent(request2, "request") && !request2.isNavigationRequest())
            return;
          const requestDispatcher = RequestDispatcher.from(this, request2);
          this._dispatchEvent("request", {
            request: requestDispatcher,
            page: PageDispatcher.fromNullable(this, request2.frame()?._page.initializedOrUndefined())
          });
        });
        this.addObjectListener(BrowserContext.Events.Response, (response2) => {
          const requestDispatcher = this.connection.existingDispatcher(response2.request());
          if (!requestDispatcher && !this._shouldDispatchNetworkEvent(response2.request(), "response"))
            return;
          this._dispatchEvent("response", {
            response: ResponseDispatcher.from(this, response2),
            page: PageDispatcher.fromNullable(this, response2.frame()?._page.initializedOrUndefined())
          });
        });
        this.addObjectListener(BrowserContext.Events.RequestFailed, (request2) => {
          const requestDispatcher = this.connection.existingDispatcher(request2);
          if (!requestDispatcher && !this._shouldDispatchNetworkEvent(request2, "requestFailed"))
            return;
          this._dispatchEvent("requestFailed", {
            request: RequestDispatcher.from(this, request2),
            failureText: request2._failureText || void 0,
            responseEndTiming: request2._responseEndTiming,
            page: PageDispatcher.fromNullable(this, request2.frame()?._page.initializedOrUndefined())
          });
        });
        this.addObjectListener(BrowserContext.Events.RequestFinished, ({ request: request2, response: response2 }) => {
          const requestDispatcher = this.connection.existingDispatcher(request2);
          if (!requestDispatcher && !this._shouldDispatchNetworkEvent(request2, "requestFinished"))
            return;
          this._dispatchEvent("requestFinished", {
            request: RequestDispatcher.from(this, request2),
            response: ResponseDispatcher.fromNullable(this, response2),
            responseEndTiming: request2._responseEndTiming,
            page: PageDispatcher.fromNullable(this, request2.frame()?._page.initializedOrUndefined())
          });
        });
        this.addObjectListener(BrowserContext.Events.RecorderEvent, ({ event, data, page, code }) => {
          this._dispatchEvent("recorderEvent", { event, data, code, page: PageDispatcher.from(this, page) });
        });
      }
      static from(parentScope, context2) {
        const result2 = parentScope.connection.existingDispatcher(context2);
        return result2 || new _BrowserContextDispatcher(parentScope, context2);
      }
      _shouldDispatchNetworkEvent(request2, event) {
        return this._shouldDispatchEvent(request2.frame()?._page?.initializedOrUndefined(), event);
      }
      _shouldDispatchEvent(page, event) {
        if (this._subscriptions.has(event))
          return true;
        const pageDispatcher = page ? this.connection.existingDispatcher(page) : void 0;
        if (pageDispatcher?._subscriptions.has(event))
          return true;
        return false;
      }
      serializeConsoleMessage(message, jsScope) {
        return {
          type: message.type(),
          text: message.text(),
          args: message.args().map((a) => {
            const elementHandle = a.asElement();
            if (elementHandle)
              return ElementHandleDispatcher.from(FrameDispatcher.from(this, elementHandle._frame), elementHandle);
            return JSHandleDispatcher.fromJSHandle(jsScope, a);
          }),
          location: message.location(),
          timestamp: message.timestamp()
        };
      }
      async createTempFiles(params2, progress2) {
        const dir = this._context._browser.options.artifactsDir;
        const tmpDir = import_path34.default.join(dir, "upload-" + createGuid());
        const tempDirWithRootName = params2.rootDirName ? import_path34.default.join(tmpDir, import_path34.default.basename(params2.rootDirName)) : tmpDir;
        await progress2.race(import_fs37.default.promises.mkdir(tempDirWithRootName, { recursive: true }));
        this._context._tempDirs.push(tmpDir);
        return {
          rootDir: params2.rootDirName ? new WritableStreamDispatcher(this, tempDirWithRootName) : void 0,
          writableStreams: await Promise.all(params2.items.map(async (item) => {
            const itemPath = throwingResolveWithinRoot(tempDirWithRootName, item.name);
            await progress2.race(import_fs37.default.promises.mkdir(import_path34.default.dirname(itemPath), { recursive: true }));
            const file = import_fs37.default.createWriteStream(itemPath);
            return new WritableStreamDispatcher(this, file, item.lastModifiedMs);
          }))
        };
      }
      async exposeBinding(params2, progress2) {
        const binding = await this._context.exposeBinding(progress2, params2.name, (source11, ...args) => {
          if (this._disposed)
            return;
          const pageDispatcher = PageDispatcher.from(this, source11.page);
          const binding2 = new BindingCallDispatcher(pageDispatcher, params2.name, source11, args);
          this._dispatchEvent("bindingCall", { binding: binding2 });
          return binding2.promise();
        });
        this._disposables.push(binding);
        return { disposable: new DisposableDispatcher(this, binding) };
      }
      async newPage(params2, progress2) {
        return { page: PageDispatcher.from(this, await this._context.newPage(progress2)) };
      }
      async cookies(params2, progress2) {
        return { cookies: await this._context.cookies(progress2, params2.urls) };
      }
      async addCookies(params2, progress2) {
        await progress2.race(this._context.addCookies(params2.cookies));
      }
      async clearCookies(params2, progress2) {
        const nameRe = params2.nameRegexSource !== void 0 && params2.nameRegexFlags !== void 0 ? new RegExp(params2.nameRegexSource, params2.nameRegexFlags) : void 0;
        const domainRe = params2.domainRegexSource !== void 0 && params2.domainRegexFlags !== void 0 ? new RegExp(params2.domainRegexSource, params2.domainRegexFlags) : void 0;
        const pathRe = params2.pathRegexSource !== void 0 && params2.pathRegexFlags !== void 0 ? new RegExp(params2.pathRegexSource, params2.pathRegexFlags) : void 0;
        await progress2.race(this._context.clearCookies({
          name: nameRe || params2.name,
          domain: domainRe || params2.domain,
          path: pathRe || params2.path
        }));
      }
      async grantPermissions(params2, progress2) {
        await progress2.race(this._context.grantPermissions(params2.permissions, params2.origin));
      }
      async clearPermissions(params2, progress2) {
        await progress2.race(this._context.clearPermissions());
      }
      async setGeolocation(params2, progress2) {
        await progress2.race(this._context.setGeolocation(params2.geolocation));
      }
      async setExtraHTTPHeaders(params2, progress2) {
        await this._context.setExtraHTTPHeaders(progress2, params2.headers);
      }
      async setOffline(params2, progress2) {
        await this._context.setOffline(progress2, params2.offline);
      }
      async setHTTPCredentials(params2, progress2) {
        await this._context.setHTTPCredentials(progress2, params2.httpCredentials);
      }
      async addInitScript(params2, progress2) {
        const initScript = await this._context.addInitScript(progress2, params2.source);
        this._disposables.push(initScript);
        return { disposable: new DisposableDispatcher(this, initScript) };
      }
      async setNetworkInterceptionPatterns(params2, progress2) {
        const hadMatchers = this._interceptionUrlMatchers.length > 0;
        if (!params2.patterns.length) {
          if (hadMatchers)
            await progress2.race(this._context.removeRequestInterceptor(this._requestInterceptor));
          this._interceptionUrlMatchers = [];
        } else {
          this._interceptionUrlMatchers = params2.patterns.map(deserializeURLMatch);
          if (!hadMatchers)
            await this._context.addRequestInterceptor(progress2, this._requestInterceptor);
        }
      }
      async setWebSocketInterceptionPatterns(params2, progress2) {
        this._webSocketInterceptionPatterns = params2.patterns;
        if (params2.patterns.length && !this._routeWebSocketInitScript)
          this._routeWebSocketInitScript = await WebSocketRouteDispatcher.install(progress2, this.connection, this._context);
      }
      async storageState(params2, progress2) {
        return await this._context.storageState(progress2, params2.indexedDB);
      }
      async setStorageState(params2, progress2) {
        await this._context.setStorageState(progress2, params2.storageState, "api");
      }
      async close(params2, progress2) {
        await this._context.close(progress2, params2);
      }
      async enableRecorder(params2, progress2) {
        await progress2.race(RecorderApp.show(this._context, params2));
      }
      async disableRecorder(params2, progress2) {
        const recorder = await progress2.race(Recorder.existingForContext(this._context));
        if (recorder)
          await progress2.race(recorder.setMode("none"));
      }
      async exposeConsoleApi(params2, progress2) {
        await this._context.exposeConsoleApi(progress2);
      }
      async pause(params2, progress2) {
      }
      async newCDPSession(params2, progress2) {
        if (this._object._browser.options.browserType !== "chromium")
          throw new Error(`CDP session is only available in Chromium`);
        if (!params2.page && !params2.frame || params2.page && params2.frame)
          throw new Error(`CDP session must be initiated with either Page or Frame, not none or both`);
        const crBrowserContext = this._object;
        return { session: new CDPSessionDispatcher(this, await progress2.race(crBrowserContext.newCDPSession((params2.page ? params2.page : params2.frame)._object))) };
      }
      async clockFastForward(params2, progress2) {
        await progress2.race(this._context.clock.fastForward(params2.ticksString ?? params2.ticksNumber ?? 0));
      }
      async clockInstall(params2, progress2) {
        await progress2.race(this._context.clock.install(params2.timeString ?? params2.timeNumber ?? void 0));
      }
      async clockPauseAt(params2, progress2) {
        await progress2.race(this._context.clock.pauseAt(params2.timeString ?? params2.timeNumber ?? 0));
        this._clockPaused = true;
      }
      async clockResume(params2, progress2) {
        await this._context.clock.resume(progress2);
        this._clockPaused = false;
      }
      async clockRunFor(params2, progress2) {
        await progress2.race(this._context.clock.runFor(params2.ticksString ?? params2.ticksNumber ?? 0));
      }
      async clockSetFixedTime(params2, progress2) {
        await progress2.race(this._context.clock.setFixedTime(params2.timeString ?? params2.timeNumber ?? 0));
      }
      async clockSetSystemTime(params2, progress2) {
        await progress2.race(this._context.clock.setSystemTime(params2.timeString ?? params2.timeNumber ?? 0));
      }
      async credentialsInstall(params2, progress2) {
        await this._context.credentials.install(progress2);
      }
      async credentialsCreate(params2, progress2) {
        const credential = await progress2.race(this._context.credentials.create(params2));
        return { credential };
      }
      async credentialsGet(params2, progress2) {
        const credentials = await progress2.race(this._context.credentials.get(params2));
        return { credentials };
      }
      async credentialsDelete(params2, progress2) {
        await progress2.race(this._context.credentials.delete(params2.id));
      }
      async updateSubscription(params2, progress2) {
        if (params2.enabled)
          this._subscriptions.add(params2.event);
        else
          this._subscriptions.delete(params2.event);
      }
      async registerSelectorEngine(params2, progress2) {
        this._object.selectors().register(params2.selectorEngine);
      }
      async setTestIdAttributeName(params2, progress2) {
        this._object.selectors().setTestIdAttributeName(params2.testIdAttributeName);
      }
      _onDispose() {
        if (this._context.isClosingOrClosed())
          return;
        this._context.dialogManager.removeDialogHandler(this._dialogHandler);
        this._interceptionUrlMatchers = [];
        this._context.removeRequestInterceptor(this._requestInterceptor).catch(() => {
        });
        disposeAll2(this._disposables).catch(() => {
        });
        if (this._routeWebSocketInitScript)
          WebSocketRouteDispatcher.uninstall(this.connection, this._context, this._routeWebSocketInitScript).catch(() => {
          });
        this._routeWebSocketInitScript = void 0;
        if (this._clockPaused)
          this._context.clock.resumeNoReply();
        this._clockPaused = false;
      }
    };
  }
});

// packages/playwright-core/src/server/dispatchers/elementHandlerDispatcher.ts
var ElementHandleDispatcher;
var init_elementHandlerDispatcher = __esm({
  "packages/playwright-core/src/server/dispatchers/elementHandlerDispatcher.ts"() {
    "use strict";
    init_browserContextDispatcher();
    init_frameDispatcher();
    init_jsHandleDispatcher();
    ElementHandleDispatcher = class _ElementHandleDispatcher extends JSHandleDispatcher {
      constructor(scope, elementHandle) {
        super(scope, elementHandle);
        this._type_ElementHandle = true;
        this._elementHandle = elementHandle;
      }
      static from(scope, handle) {
        return scope.connection.existingDispatcher(handle) || new _ElementHandleDispatcher(scope, handle);
      }
      static fromNullable(scope, handle) {
        if (!handle)
          return void 0;
        return scope.connection.existingDispatcher(handle) || new _ElementHandleDispatcher(scope, handle);
      }
      static fromJSOrElementHandle(scope, handle) {
        const result2 = scope.connection.existingDispatcher(handle);
        if (result2)
          return result2;
        const elementHandle = handle.asElement();
        if (!elementHandle)
          return new JSHandleDispatcher(scope, handle);
        return new _ElementHandleDispatcher(scope, elementHandle);
      }
      async ownerFrame(params2, progress2) {
        const frame = await this._elementHandle.ownerFrame(progress2);
        return { frame: frame ? FrameDispatcher.from(this._browserContextDispatcher(), frame) : void 0 };
      }
      async contentFrame(params2, progress2) {
        const frame = await this._elementHandle.contentFrame(progress2);
        return { frame: frame ? FrameDispatcher.from(this._browserContextDispatcher(), frame) : void 0 };
      }
      async getAttribute(params2, progress2) {
        const value2 = await this._elementHandle.getAttribute(progress2, params2.name);
        return { value: value2 === null ? void 0 : value2 };
      }
      async inputValue(params2, progress2) {
        const value2 = await this._elementHandle.inputValue(progress2);
        return { value: value2 };
      }
      async textContent(params2, progress2) {
        const value2 = await this._elementHandle.textContent(progress2);
        return { value: value2 === null ? void 0 : value2 };
      }
      async innerText(params2, progress2) {
        return { value: await this._elementHandle.innerText(progress2) };
      }
      async innerHTML(params2, progress2) {
        return { value: await this._elementHandle.innerHTML(progress2) };
      }
      async isChecked(params2, progress2) {
        return { value: await this._elementHandle.isChecked(progress2) };
      }
      async isDisabled(params2, progress2) {
        return { value: await this._elementHandle.isDisabled(progress2) };
      }
      async isEditable(params2, progress2) {
        return { value: await this._elementHandle.isEditable(progress2) };
      }
      async isEnabled(params2, progress2) {
        return { value: await this._elementHandle.isEnabled(progress2) };
      }
      async isHidden(params2, progress2) {
        return { value: await this._elementHandle.isHidden(progress2) };
      }
      async isVisible(params2, progress2) {
        return { value: await this._elementHandle.isVisible(progress2) };
      }
      async dispatchEvent(params2, progress2) {
        await this._elementHandle.dispatchEvent(progress2, params2.type, parseArgument(params2.eventInit));
      }
      async scrollIntoViewIfNeeded(params2, progress2) {
        await this._elementHandle.scrollIntoViewIfNeeded(progress2);
      }
      async hover(params2, progress2) {
        return await this._elementHandle.hover(progress2, params2);
      }
      async click(params2, progress2) {
        return await this._elementHandle.click(progress2, params2);
      }
      async dblclick(params2, progress2) {
        return await this._elementHandle.dblclick(progress2, params2);
      }
      async tap(params2, progress2) {
        return await this._elementHandle.tap(progress2, params2);
      }
      async selectOption(params2, progress2) {
        const elements = (params2.elements || []).map((e) => e._elementHandle);
        return { values: await this._elementHandle.selectOption(progress2, elements, params2.options || [], params2) };
      }
      async fill(params2, progress2) {
        return await this._elementHandle.fill(progress2, params2.value, params2);
      }
      async selectText(params2, progress2) {
        await this._elementHandle.selectText(progress2, params2);
      }
      async setInputFiles(params2, progress2) {
        return await this._elementHandle.setInputFiles(progress2, params2);
      }
      async focus(params2, progress2) {
        await this._elementHandle.focus(progress2);
      }
      async type(params2, progress2) {
        return await this._elementHandle.type(progress2, params2.text, params2);
      }
      async press(params2, progress2) {
        return await this._elementHandle.press(progress2, params2.key, params2);
      }
      async check(params2, progress2) {
        return await this._elementHandle.check(progress2, params2);
      }
      async uncheck(params2, progress2) {
        return await this._elementHandle.uncheck(progress2, params2);
      }
      async boundingBox(params2, progress2) {
        const value2 = await this._elementHandle.boundingBox(progress2);
        return { value: value2 || void 0 };
      }
      async screenshot(params2, progress2) {
        const mask = (params2.mask || []).map(({ frame, selector }) => ({
          frame: frame._object,
          selector
        }));
        return { binary: await this._elementHandle.screenshot(progress2, { ...params2, mask }) };
      }
      async querySelector(params2, progress2) {
        const handle = await this._elementHandle.querySelector(progress2, params2.selector, params2);
        return { element: _ElementHandleDispatcher.fromNullable(this.parentScope(), handle) };
      }
      async querySelectorAll(params2, progress2) {
        const elements = await this._elementHandle.querySelectorAll(progress2, params2.selector);
        return { elements: elements.map((e) => _ElementHandleDispatcher.from(this.parentScope(), e)) };
      }
      async evalOnSelector(params2, progress2) {
        return { value: serializeResult(await this._elementHandle.evalOnSelector(progress2, params2.selector, !!params2.strict, params2.expression, params2.isFunction, parseArgument(params2.arg))) };
      }
      async evalOnSelectorAll(params2, progress2) {
        return { value: serializeResult(await this._elementHandle.evalOnSelectorAll(progress2, params2.selector, params2.expression, params2.isFunction, parseArgument(params2.arg))) };
      }
      async waitForElementState(params2, progress2) {
        await this._elementHandle.waitForElementState(progress2, params2.state);
      }
      async waitForSelector(params2, progress2) {
        return { element: _ElementHandleDispatcher.fromNullable(this.parentScope(), await this._elementHandle.waitForSelector(progress2, params2.selector, params2)) };
      }
      _browserContextDispatcher() {
        const parentScope = this.parentScope().parentScope();
        if (parentScope instanceof BrowserContextDispatcher)
          return parentScope;
        return parentScope.parentScope();
      }
    };
  }
});

// packages/playwright-core/src/server/dispatchers/frameDispatcher.ts
var FrameDispatcher;
var init_frameDispatcher = __esm({
  "packages/playwright-core/src/server/dispatchers/frameDispatcher.ts"() {
    "use strict";
    init_protocolFormatter();
    init_frames();
    init_dispatcher();
    init_elementHandlerDispatcher();
    init_jsHandleDispatcher();
    init_networkDispatchers();
    init_networkDispatchers();
    FrameDispatcher = class _FrameDispatcher extends Dispatcher {
      constructor(scope, frame) {
        const gcBucket = frame._page.mainFrame() === frame ? "MainFrame" : "Frame";
        const pageDispatcher = scope.connection.existingDispatcher(frame._page);
        super(pageDispatcher || scope, frame, "Frame", {
          url: frame.url(),
          name: frame.name(),
          parentFrame: _FrameDispatcher.fromNullable(scope, frame.parentFrame()),
          loadStates: Array.from(frame._firedLifecycleEvents)
        }, gcBucket);
        this._type_Frame = true;
        this._browserContextDispatcher = scope;
        this._frame = frame;
        this.addObjectListener(Frame.Events.AddLifecycle, (lifecycleEvent) => {
          this._dispatchEvent("loadstate", { add: lifecycleEvent });
        });
        this.addObjectListener(Frame.Events.RemoveLifecycle, (lifecycleEvent) => {
          this._dispatchEvent("loadstate", { remove: lifecycleEvent });
        });
        this.addObjectListener(Frame.Events.InternalNavigation, (event) => {
          if (!event.isPublic)
            return;
          const params2 = { url: event.url, name: event.name, error: event.error ? event.error.message : void 0 };
          if (event.newDocument)
            params2.newDocument = { request: RequestDispatcher.fromNullable(this._browserContextDispatcher, event.newDocument.request || null) };
          this._dispatchEvent("navigated", params2);
        });
      }
      static from(scope, frame) {
        const result2 = scope.connection.existingDispatcher(frame);
        return result2 || new _FrameDispatcher(scope, frame);
      }
      static fromNullable(scope, frame) {
        if (!frame)
          return;
        return _FrameDispatcher.from(scope, frame);
      }
      async goto(params2, progress2) {
        return { response: ResponseDispatcher.fromNullable(this._browserContextDispatcher, await this._frame.goto(progress2, params2.url, params2)) };
      }
      async frameElement(params2, progress2) {
        return { element: ElementHandleDispatcher.from(this, await this._frame.frameElement(progress2)) };
      }
      async evaluateExpression(params2, progress2) {
        return { value: serializeResult(await this._frame.evaluateExpression(progress2, params2.expression, { isFunction: params2.isFunction }, parseArgument(params2.arg))) };
      }
      async evaluateExpressionHandle(params2, progress2) {
        return { handle: ElementHandleDispatcher.fromJSOrElementHandle(this, await this._frame.evaluateExpressionHandle(progress2, params2.expression, { isFunction: params2.isFunction }, parseArgument(params2.arg))) };
      }
      async waitForSelector(params2, progress2) {
        return { element: ElementHandleDispatcher.fromNullable(this, await this._frame.waitForSelector(progress2, params2.selector, true, params2)) };
      }
      async dispatchEvent(params2, progress2) {
        return this._frame.dispatchEvent(progress2, params2.selector, params2.type, parseArgument(params2.eventInit), params2);
      }
      async evalOnSelector(params2, progress2) {
        return { value: serializeResult(await this._frame.evalOnSelector(progress2, params2.selector, !!params2.strict, params2.expression, params2.isFunction, parseArgument(params2.arg))) };
      }
      async evalOnSelectorAll(params2, progress2) {
        return { value: serializeResult(await this._frame.evalOnSelectorAll(progress2, params2.selector, params2.expression, params2.isFunction, parseArgument(params2.arg))) };
      }
      async querySelector(params2, progress2) {
        return { element: ElementHandleDispatcher.fromNullable(this, await this._frame.querySelector(progress2, params2.selector, params2)) };
      }
      async querySelectorAll(params2, progress2) {
        const elements = await this._frame.querySelectorAll(progress2, params2.selector);
        return { elements: elements.map((e) => ElementHandleDispatcher.from(this, e)) };
      }
      async queryCount(params2, progress2) {
        return { value: await this._frame.queryCount(progress2, params2.selector, params2) };
      }
      async content(params2, progress2) {
        return { value: await this._frame.content(progress2) };
      }
      async setContent(params2, progress2) {
        return await this._frame.setContent(progress2, params2.html, params2);
      }
      async addScriptTag(params2, progress2) {
        return { element: ElementHandleDispatcher.from(this, await this._frame.addScriptTag(progress2, params2)) };
      }
      async addStyleTag(params2, progress2) {
        return { element: ElementHandleDispatcher.from(this, await this._frame.addStyleTag(progress2, params2)) };
      }
      async ariaSnapshot(params2, progress2) {
        return await this._frame.ariaSnapshot(progress2, params2);
      }
      async click(params2, progress2) {
        return await this._frame.click(progress2, params2.selector, params2);
      }
      async dblclick(params2, progress2) {
        return await this._frame.dblclick(progress2, params2.selector, params2);
      }
      async dragAndDrop(params2, progress2) {
        return await this._frame.dragAndDrop(progress2, params2.source, params2.target, params2);
      }
      async drop(params2, progress2) {
        return await this._frame.drop(progress2, params2.selector, params2, params2);
      }
      async tap(params2, progress2) {
        return await this._frame.tap(progress2, params2.selector, params2);
      }
      async fill(params2, progress2) {
        return await this._frame.fill(progress2, params2.selector, params2.value, params2);
      }
      async focus(params2, progress2) {
        await this._frame.focus(progress2, params2.selector, params2);
      }
      async blur(params2, progress2) {
        await this._frame.blur(progress2, params2.selector, params2);
      }
      async textContent(params2, progress2) {
        const value2 = await this._frame.textContent(progress2, params2.selector, params2);
        return { value: value2 === null ? void 0 : value2 };
      }
      async innerText(params2, progress2) {
        return { value: await this._frame.innerText(progress2, params2.selector, params2) };
      }
      async innerHTML(params2, progress2) {
        return { value: await this._frame.innerHTML(progress2, params2.selector, params2) };
      }
      async resolveSelector(params2, progress2) {
        return await this._frame.resolveSelector(progress2, params2.selector);
      }
      async getAttribute(params2, progress2) {
        const value2 = await this._frame.getAttribute(progress2, params2.selector, params2.name, params2);
        return { value: value2 === null ? void 0 : value2 };
      }
      async inputValue(params2, progress2) {
        const value2 = await this._frame.inputValue(progress2, params2.selector, params2);
        return { value: value2 };
      }
      async isChecked(params2, progress2) {
        return { value: await this._frame.isChecked(progress2, params2.selector, params2) };
      }
      async isDisabled(params2, progress2) {
        return { value: await this._frame.isDisabled(progress2, params2.selector, params2) };
      }
      async isEditable(params2, progress2) {
        return { value: await this._frame.isEditable(progress2, params2.selector, params2) };
      }
      async isEnabled(params2, progress2) {
        return { value: await this._frame.isEnabled(progress2, params2.selector, params2) };
      }
      async isHidden(params2, progress2) {
        return { value: await this._frame.isHidden(progress2, params2.selector, params2) };
      }
      async isVisible(params2, progress2) {
        return { value: await this._frame.isVisible(progress2, params2.selector, params2) };
      }
      async hover(params2, progress2) {
        return await this._frame.hover(progress2, params2.selector, params2);
      }
      async selectOption(params2, progress2) {
        const elements = (params2.elements || []).map((e) => e._elementHandle);
        return { values: await this._frame.selectOption(progress2, params2.selector, elements, params2.options || [], params2) };
      }
      async setInputFiles(params2, progress2) {
        return await this._frame.setInputFiles(progress2, params2.selector, params2);
      }
      async type(params2, progress2) {
        return await this._frame.type(progress2, params2.selector, params2.text, params2);
      }
      async press(params2, progress2) {
        return await this._frame.press(progress2, params2.selector, params2.key, params2);
      }
      async check(params2, progress2) {
        return await this._frame.check(progress2, params2.selector, params2);
      }
      async uncheck(params2, progress2) {
        return await this._frame.uncheck(progress2, params2.selector, params2);
      }
      async waitForTimeout(params2, progress2) {
        return await this._frame.waitForTimeout(progress2, params2.waitTimeout);
      }
      async waitForFunction(params2, progress2) {
        return { handle: ElementHandleDispatcher.fromJSOrElementHandle(this, await this._frame.waitForFunctionExpression(progress2, params2.expression, params2.isFunction, parseArgument(params2.arg), params2)) };
      }
      async title(params2, progress2) {
        return { value: await this._frame.title(progress2) };
      }
      async highlight(params2, progress2) {
        return await this._frame.addHighlight(progress2, params2.selector, params2.style);
      }
      async hideHighlight(params2, progress2) {
        return await this._frame.removeHighlight(progress2, params2.selector);
      }
      async expect(params2, progress2) {
        progress2.log(`${renderTitleForCall(progress2.metadata)}${params2.timeout ? ` with timeout ${params2.timeout}ms` : ""}`);
        const expectedValue = params2.expectedValue ? parseArgument(params2.expectedValue) : void 0;
        try {
          await this._frame.expect(progress2, params2.selector, { ...params2, expectedValue });
        } catch (e) {
          if (e instanceof ExpectError && e.details.received && "value" in e.details.received)
            e.details.received.value = serializeResult(e.details.received.value);
          throw e;
        }
      }
    };
  }
});

// packages/playwright-core/src/server/dispatchers/networkDispatchers.ts
var RequestDispatcher, ResponseDispatcher, RouteDispatcher, WebSocketDispatcher, APIRequestContextDispatcher;
var init_networkDispatchers = __esm({
  "packages/playwright-core/src/server/dispatchers/networkDispatchers.ts"() {
    "use strict";
    init_network2();
    init_dispatcher();
    init_frameDispatcher();
    init_pageDispatcher();
    init_tracingDispatcher();
    RequestDispatcher = class _RequestDispatcher extends Dispatcher {
      static from(scope, request2) {
        const result2 = scope.connection.existingDispatcher(request2);
        return result2 || new _RequestDispatcher(scope, request2);
      }
      static fromNullable(scope, request2) {
        return request2 ? _RequestDispatcher.from(scope, request2) : void 0;
      }
      constructor(scope, request2) {
        const postData = request2.postDataBuffer();
        const frame = request2.frame();
        const page = request2.frame()?._page;
        const pageDispatcher = page ? scope.connection.existingDispatcher(page) : null;
        const frameDispatcher = FrameDispatcher.fromNullable(scope, frame);
        super(pageDispatcher || frameDispatcher || scope, request2, "Request", {
          frame: frameDispatcher,
          serviceWorker: WorkerDispatcher.fromNullable(scope, request2.serviceWorker()),
          url: request2.url(),
          resourceType: request2.resourceType(),
          method: request2.method(),
          postData: postData === null ? void 0 : postData,
          headers: request2.headers(),
          isNavigationRequest: request2.isNavigationRequest(),
          redirectedFrom: _RequestDispatcher.fromNullable(scope, request2.redirectedFrom())
        });
        this._type_Request = true;
        this._browserContextDispatcher = scope;
        ResponseDispatcher.fromNullable(scope, request2._existingResponse());
      }
      async rawRequestHeaders(params2, progress2) {
        return { headers: await this._object.rawRequestHeaders(progress2) };
      }
      async response(params2, progress2) {
        return { response: ResponseDispatcher.fromNullable(this._browserContextDispatcher, await this._object.response(progress2)) };
      }
    };
    ResponseDispatcher = class _ResponseDispatcher extends Dispatcher {
      constructor(scope, response2) {
        super(scope, response2, "Response", {
          // TODO: responses in popups can point to non-reported requests.
          request: scope,
          url: response2.url(),
          status: response2.status(),
          statusText: response2.statusText(),
          headers: response2.headers(),
          timing: response2.timing(),
          fromServiceWorker: response2.fromServiceWorker()
        });
        this._type_Response = true;
      }
      static from(scope, response2) {
        const requestDispatcher = RequestDispatcher.from(scope, response2.request());
        const result2 = scope.connection.existingDispatcher(response2);
        return result2 || new _ResponseDispatcher(requestDispatcher, response2);
      }
      static fromNullable(scope, response2) {
        return response2 ? _ResponseDispatcher.from(scope, response2) : void 0;
      }
      async body(params2, progress2) {
        return { binary: await this._object.body(progress2) };
      }
      async securityDetails(params2, progress2) {
        return { value: await this._object.securityDetails(progress2) || void 0 };
      }
      async serverAddr(params2, progress2) {
        return { value: await this._object.serverAddr(progress2) || void 0 };
      }
      async rawResponseHeaders(params2, progress2) {
        return { headers: await this._object.rawResponseHeaders(progress2) };
      }
      async httpVersion(params2, progress2) {
        return { value: await this._object.httpVersion(progress2) };
      }
      async sizes(params2, progress2) {
        return { sizes: await this._object.sizes(progress2) };
      }
    };
    RouteDispatcher = class extends Dispatcher {
      constructor(scope, route2) {
        super(scope, route2, "Route", {
          // Context route can point to a non-reported request, so we send the request in the initializer.
          request: scope
        });
        this._type_Route = true;
        this._handled = false;
      }
      _checkNotHandled() {
        if (this._handled)
          throw new Error("Route is already handled!");
        this._handled = true;
      }
      async continue(params2, progress2) {
        this._checkNotHandled();
        await progress2.race(this._object.continue({
          url: params2.url,
          method: params2.method,
          headers: params2.headers,
          postData: params2.postData,
          isFallback: params2.isFallback
        }));
      }
      async fulfill(params2, progress2) {
        this._checkNotHandled();
        await progress2.race(this._object.fulfill(params2));
      }
      async abort(params2, progress2) {
        this._checkNotHandled();
        await progress2.race(this._object.abort(params2.errorCode || "failed"));
      }
      async redirectNavigationRequest(params2, progress2) {
        this._checkNotHandled();
        this._object.redirectNavigationRequest(params2.url);
      }
    };
    WebSocketDispatcher = class extends Dispatcher {
      constructor(scope, webSocket) {
        super(scope, webSocket, "WebSocket", {
          url: webSocket.url()
        });
        this._type_WebSocket = true;
        this.addObjectListener(WebSocket.Events.FrameSent, (event) => this._dispatchEvent("frameSent", event));
        this.addObjectListener(WebSocket.Events.FrameReceived, (event) => this._dispatchEvent("frameReceived", event));
        this.addObjectListener(WebSocket.Events.SocketError, (error) => this._dispatchEvent("socketError", { error }));
        this.addObjectListener(WebSocket.Events.Close, () => this._dispatchEvent("close", {}));
      }
    };
    APIRequestContextDispatcher = class _APIRequestContextDispatcher extends Dispatcher {
      constructor(parentScope, request2) {
        const tracing = TracingDispatcher.from(parentScope, request2.tracing());
        super(parentScope, request2, "APIRequestContext", {
          tracing
        });
        this._type_APIRequestContext = true;
        this.adopt(tracing);
      }
      static from(scope, request2) {
        const result2 = scope.connection.existingDispatcher(request2);
        return result2 || new _APIRequestContextDispatcher(scope, request2);
      }
      static fromNullable(scope, request2) {
        return request2 ? _APIRequestContextDispatcher.from(scope, request2) : void 0;
      }
      async storageState(params2, progress2) {
        return await this._object.storageState(progress2, params2.indexedDB);
      }
      async dispose(params2, progress2) {
        await progress2.race(this._object.dispose(params2));
        this._dispose();
      }
      async fetch(params2, progress2) {
        const response2 = await this._object.fetch(progress2, params2);
        return { response: response2 };
      }
      async fetchResponseBody(params2, progress2) {
        return { binary: this._object.fetchResponseBody(progress2, params2.fetchUid) };
      }
      async fetchLog(params2, progress2) {
        return { log: this._object.fetchLogForUid(progress2, params2.fetchUid) };
      }
      async disposeAPIResponse(params2, progress2) {
        this._object.disposeResponse(progress2, params2.fetchUid);
      }
    };
  }
});

// packages/playwright-core/src/server/dispatchers/androidDispatcher.ts
function fixupAndroidElementInfo(info) {
  info.clazz = info.clazz || "";
  info.pkg = info.pkg || "";
  info.res = info.res || "";
  info.desc = info.desc || "";
  info.text = info.text || "";
  for (const child of info.children || [])
    fixupAndroidElementInfo(child);
}
var AndroidDispatcher, AndroidDeviceDispatcher, SocketSdkObject, AndroidSocketDispatcher, keyMap;
var init_androidDispatcher = __esm({
  "packages/playwright-core/src/server/dispatchers/androidDispatcher.ts"() {
    "use strict";
    init_eventsHelper();
    init_browserContextDispatcher();
    init_dispatcher();
    init_android();
    init_instrumentation();
    AndroidDispatcher = class extends Dispatcher {
      constructor(scope, android, denyLaunch) {
        super(scope, android, "Android", {});
        this._type_Android = true;
        this._denyLaunch = denyLaunch;
      }
      async devices(params2, progress2) {
        if (this._denyLaunch)
          throw new Error(`Connecting to Android devices is not allowed.`);
        const devices = await this._object.devices(progress2, params2);
        return {
          devices: devices.map((d) => AndroidDeviceDispatcher.from(this, d))
        };
      }
    };
    AndroidDeviceDispatcher = class _AndroidDeviceDispatcher extends Dispatcher {
      constructor(scope, device) {
        super(scope, device, "AndroidDevice", {
          model: device.model,
          serial: device.serial
        });
        this._type_AndroidDevice = true;
        for (const webView of device.webViews())
          this._dispatchEvent("webViewAdded", { webView });
        this.addObjectListener(AndroidDevice.Events.WebViewAdded, (webView) => this._dispatchEvent("webViewAdded", { webView }));
        this.addObjectListener(AndroidDevice.Events.WebViewRemoved, (socketName) => this._dispatchEvent("webViewRemoved", { socketName }));
        this.addObjectListener(AndroidDevice.Events.Close, () => this._dispatchEvent("close"));
      }
      static from(scope, device) {
        const result2 = scope.connection.existingDispatcher(device);
        return result2 || new _AndroidDeviceDispatcher(scope, device);
      }
      async wait(params2, progress2) {
        await this._object.send(progress2, "wait", params2);
      }
      async fill(params2, progress2) {
        await this._object.send(progress2, "click", { selector: params2.androidSelector });
        await this._object.send(progress2, "fill", params2);
      }
      async tap(params2, progress2) {
        await this._object.send(progress2, "click", params2);
      }
      async drag(params2, progress2) {
        await this._object.send(progress2, "drag", params2);
      }
      async fling(params2, progress2) {
        await this._object.send(progress2, "fling", params2);
      }
      async longTap(params2, progress2) {
        await this._object.send(progress2, "longClick", params2);
      }
      async pinchClose(params2, progress2) {
        await this._object.send(progress2, "pinchClose", params2);
      }
      async pinchOpen(params2, progress2) {
        await this._object.send(progress2, "pinchOpen", params2);
      }
      async scroll(params2, progress2) {
        await this._object.send(progress2, "scroll", params2);
      }
      async swipe(params2, progress2) {
        await this._object.send(progress2, "swipe", params2);
      }
      async info(params2, progress2) {
        const info = await this._object.send(progress2, "info", params2);
        fixupAndroidElementInfo(info);
        return { info };
      }
      async inputType(params2, progress2) {
        const text2 = params2.text;
        const keyCodes = [];
        for (let i = 0; i < text2.length; ++i) {
          const code = keyMap.get(text2[i].toUpperCase());
          if (code === void 0)
            throw new Error("No mapping for " + text2[i] + " found");
          keyCodes.push(code);
        }
        await progress2.race(Promise.all(keyCodes.map((keyCode) => this._object.send(progress2, "inputPress", { keyCode }))));
      }
      async inputPress(params2, progress2) {
        if (!keyMap.has(params2.key))
          throw new Error("Unknown key: " + params2.key);
        await this._object.send(progress2, "inputPress", { keyCode: keyMap.get(params2.key) });
      }
      async inputTap(params2, progress2) {
        await this._object.send(progress2, "inputClick", params2);
      }
      async inputSwipe(params2, progress2) {
        await this._object.send(progress2, "inputSwipe", params2);
      }
      async inputDrag(params2, progress2) {
        await this._object.send(progress2, "inputDrag", params2);
      }
      async screenshot(params2, progress2) {
        return { binary: await this._object.screenshot(progress2) };
      }
      async shell(params2, progress2) {
        return { result: await this._object.shell(progress2, params2.command) };
      }
      async open(params2, progress2) {
        const socket = await this._object.open(progress2, params2.command);
        return { socket: new AndroidSocketDispatcher(this, new SocketSdkObject(this._object, socket)) };
      }
      async installApk(params2, progress2) {
        await this._object.installApk(progress2, params2.file, { args: params2.args });
      }
      async push(params2, progress2) {
        await this._object.push(progress2, params2.file, params2.path, params2.mode);
      }
      async launchBrowser(params2, progress2) {
        const context2 = await this._object.launchBrowser(progress2, params2.pkg, params2);
        return { context: BrowserContextDispatcher.from(this, context2) };
      }
      async close(params2, progress2) {
        await this._object.close(progress2);
      }
      async connectToWebView(params2, progress2) {
        return { context: BrowserContextDispatcher.from(this, await this._object.connectToWebView(progress2, params2.socketName)) };
      }
    };
    SocketSdkObject = class extends SdkObject {
      constructor(parent, socket) {
        super(parent, "socket");
        this._socket = socket;
        this._eventListeners = [
          eventsHelper.addEventListener(socket, "data", (data) => this.emit("data", data)),
          eventsHelper.addEventListener(socket, "close", () => {
            eventsHelper.removeEventListeners(this._eventListeners);
            this.emit("close");
          })
        ];
      }
      async write(data) {
        await this._socket.write(data);
      }
      close() {
        this._socket.close();
      }
    };
    AndroidSocketDispatcher = class extends Dispatcher {
      constructor(scope, socket) {
        super(scope, socket, "AndroidSocket", {});
        this._type_AndroidSocket = true;
        this.addObjectListener("data", (data) => this._dispatchEvent("data", { data }));
        this.addObjectListener("close", () => {
          this._dispatchEvent("close");
          this._dispose();
        });
      }
      async write(params2, progress2) {
        await progress2.race(this._object.write(params2.data));
      }
      async close(params2, progress2) {
        this._object.close();
      }
    };
    keyMap = /* @__PURE__ */ new Map([
      ["Unknown", 0],
      ["SoftLeft", 1],
      ["SoftRight", 2],
      ["Home", 3],
      ["Back", 4],
      ["Call", 5],
      ["EndCall", 6],
      ["0", 7],
      ["1", 8],
      ["2", 9],
      ["3", 10],
      ["4", 11],
      ["5", 12],
      ["6", 13],
      ["7", 14],
      ["8", 15],
      ["9", 16],
      ["Star", 17],
      ["*", 17],
      ["Pound", 18],
      ["#", 18],
      ["DialUp", 19],
      ["DialDown", 20],
      ["DialLeft", 21],
      ["DialRight", 22],
      ["DialCenter", 23],
      ["VolumeUp", 24],
      ["VolumeDown", 25],
      ["Power", 26],
      ["Camera", 27],
      ["Clear", 28],
      ["A", 29],
      ["B", 30],
      ["C", 31],
      ["D", 32],
      ["E", 33],
      ["F", 34],
      ["G", 35],
      ["H", 36],
      ["I", 37],
      ["J", 38],
      ["K", 39],
      ["L", 40],
      ["M", 41],
      ["N", 42],
      ["O", 43],
      ["P", 44],
      ["Q", 45],
      ["R", 46],
      ["S", 47],
      ["T", 48],
      ["U", 49],
      ["V", 50],
      ["W", 51],
      ["X", 52],
      ["Y", 53],
      ["Z", 54],
      ["Comma", 55],
      [",", 55],
      ["Period", 56],
      [".", 56],
      ["AltLeft", 57],
      ["AltRight", 58],
      ["ShiftLeft", 59],
      ["ShiftRight", 60],
      ["Tab", 61],
      ["	", 61],
      ["Space", 62],
      [" ", 62],
      ["Sym", 63],
      ["Explorer", 64],
      ["Envelop", 65],
      ["Enter", 66],
      ["Del", 67],
      ["Grave", 68],
      ["Minus", 69],
      ["-", 69],
      ["Equals", 70],
      ["=", 70],
      ["LeftBracket", 71],
      ["(", 71],
      ["RightBracket", 72],
      [")", 72],
      ["Backslash", 73],
      ["\\", 73],
      ["Semicolon", 74],
      [";", 74],
      ["Apostrophe", 75],
      ["`", 75],
      ["Slash", 76],
      ["/", 76],
      ["At", 77],
      ["@", 77],
      ["Num", 78],
      ["HeadsetHook", 79],
      ["Focus", 80],
      ["Plus", 81],
      ["Menu", 82],
      ["Notification", 83],
      ["Search", 84],
      ["MediaPlayPause", 85],
      ["MediaStop", 86],
      ["MediaNext", 87],
      ["MediaPrevious", 88],
      ["MediaRewind", 89],
      ["MediaFastForward", 90],
      ["MediaPlay", 126],
      ["MediaPause", 127],
      ["MediaClose", 128],
      ["MediaEject", 129],
      ["MediaRecord", 130],
      ["ChannelUp", 166],
      ["ChannelDown", 167],
      ["AppSwitch", 187],
      ["Assist", 219],
      ["MediaAudioTrack", 222],
      ["MediaTopMenu", 226],
      ["MediaSkipForward", 272],
      ["MediaSkipBackward", 273],
      ["MediaStepForward", 274],
      ["MediaStepBackward", 275],
      ["Cut", 277],
      ["Copy", 278],
      ["Paste", 279]
    ]);
  }
});

// packages/playwright-core/src/server/dispatchers/browserDispatcher.ts
var BrowserDispatcher;
var init_browserDispatcher = __esm({
  "packages/playwright-core/src/server/dispatchers/browserDispatcher.ts"() {
    "use strict";
    init_browser();
    init_browserContextDispatcher();
    init_cdpSessionDispatcher();
    init_dispatcher();
    init_browserContext();
    init_artifactDispatcher();
    init_progress();
    BrowserDispatcher = class extends Dispatcher {
      constructor(scope, browser, options = {}) {
        super(scope, browser, "Browser", { version: browser.version(), name: browser.options.name, browserName: browser.options.browserType });
        this._type_Browser = true;
        this._isolatedContexts = /* @__PURE__ */ new Set();
        this._options = options;
        if (!options.isolateContexts) {
          this.addObjectListener(Browser.Events.Context, (context2) => this._dispatchEvent("context", { context: BrowserContextDispatcher.from(this, context2) }));
          this.addObjectListener(Browser.Events.Disconnected, () => this._didClose());
          if (browser._defaultContext)
            this._dispatchEvent("context", { context: BrowserContextDispatcher.from(this, browser._defaultContext) });
          for (const context2 of browser.contexts())
            this._dispatchEvent("context", { context: BrowserContextDispatcher.from(this, context2) });
        }
      }
      _didClose() {
        this._dispatchEvent("close");
        this._dispose();
      }
      async newContext(params2, progress2) {
        if (params2.recordVideo && this._object.attribution.playwright.options.isServer)
          params2.recordVideo.dir = void 0;
        if (!this._options.isolateContexts) {
          const context3 = await this._object.newContext(progress2, params2);
          const contextDispatcher2 = BrowserContextDispatcher.from(this, context3);
          return { context: contextDispatcher2 };
        }
        const context2 = await this._object.newContext(progress2, params2);
        this._isolatedContexts.add(context2);
        context2.on(BrowserContext.Events.Close, () => this._isolatedContexts.delete(context2));
        const contextDispatcher = BrowserContextDispatcher.from(this, context2);
        this._dispatchEvent("context", { context: contextDispatcher });
        return { context: contextDispatcher };
      }
      async newContextForReuse(params2, progress2) {
        const context2 = await this._object.newContextForReuse(progress2, params2);
        const contextDispatcher = BrowserContextDispatcher.from(this, context2);
        this._dispatchEvent("context", { context: contextDispatcher });
        return { context: contextDispatcher };
      }
      async disconnectFromReusedContext(params2, progress2) {
        const context2 = this._object.contextForReuse();
        const contextDispatcher = context2 ? this.connection.existingDispatcher(context2) : void 0;
        if (contextDispatcher) {
          await progress2.race(contextDispatcher.stopPendingOperations(new Error(params2.reason)));
          contextDispatcher._dispose();
        }
      }
      async close(params2, progress2) {
        if (this._options.ignoreStopAndKill)
          return;
        await this._object.close(progress2, params2);
      }
      async killForTests(params2, progress2) {
        if (this._options.ignoreStopAndKill)
          return;
        await this._object.killForTests(progress2);
      }
      async defaultUserAgentForTest() {
        return { userAgent: this._object.userAgent() };
      }
      async newBrowserCDPSession(params2, progress2) {
        if (this._object.options.browserType !== "chromium")
          throw new Error(`CDP session is only available in Chromium`);
        const crBrowser = this._object;
        return { session: new CDPSessionDispatcher(this, await progress2.race(crBrowser.newBrowserCDPSession())) };
      }
      async startTracing(params2, progress2) {
        if (this._object.options.browserType !== "chromium")
          throw new Error(`Tracing is only available in Chromium`);
        const crBrowser = this._object;
        await progress2.race(crBrowser.startTracing(params2.page ? params2.page._object : void 0, params2));
      }
      async stopTracing(params2, progress2) {
        if (this._object.options.browserType !== "chromium")
          throw new Error(`Tracing is only available in Chromium`);
        const crBrowser = this._object;
        return { artifact: ArtifactDispatcher.from(this, await progress2.race(crBrowser.stopTracing())) };
      }
      async startServer(params2, progress2) {
        return await this._object.startServer(progress2, params2.title, params2);
      }
      async stopServer(params2, progress2) {
        await this._object.stopServer(progress2);
      }
      async cleanupContexts() {
        await Promise.all(Array.from(this._isolatedContexts).map((context2) => context2.close(nullProgress, { reason: "Global context cleanup (connection terminated)" })));
      }
    };
  }
});

// packages/playwright-core/src/server/dispatchers/browserTypeDispatcher.ts
var BrowserTypeDispatcher;
var init_browserTypeDispatcher = __esm({
  "packages/playwright-core/src/server/dispatchers/browserTypeDispatcher.ts"() {
    "use strict";
    init_browserContextDispatcher();
    init_browserDispatcher();
    init_pageDispatcher();
    init_dispatcher();
    BrowserTypeDispatcher = class extends Dispatcher {
      constructor(scope, browserType, denyLaunch) {
        super(scope, browserType, "BrowserType", {
          executablePath: browserType.executablePath(),
          name: browserType.name()
        });
        this._type_BrowserType = true;
        this._denyLaunch = denyLaunch;
      }
      async launch(params2, progress2) {
        if (this._denyLaunch)
          throw new Error(`Launching more browsers is not allowed.`);
        const browser = await this._object.launch(progress2, params2);
        return { browser: new BrowserDispatcher(this, browser) };
      }
      async launchPersistentContext(params2, progress2) {
        if (this._denyLaunch)
          throw new Error(`Launching more browsers is not allowed.`);
        const browserContext = await this._object.launchPersistentContext(progress2, params2.userDataDir, params2);
        const browserDispatcher = new BrowserDispatcher(this, browserContext._browser);
        const contextDispatcher = BrowserContextDispatcher.from(browserDispatcher, browserContext);
        return { browser: browserDispatcher, context: contextDispatcher };
      }
      async connectOverCDP(params2, progress2) {
        if (this._denyLaunch)
          throw new Error(`Launching more browsers is not allowed.`);
        const browser = await this._object.connectOverCDP(progress2, params2);
        const browserDispatcher = new BrowserDispatcher(this, browser);
        return {
          browser: browserDispatcher,
          defaultContext: browser._defaultContext ? BrowserContextDispatcher.from(browserDispatcher, browser._defaultContext) : void 0
        };
      }
      async connectToWorker(params2, progress2) {
        if (this._denyLaunch)
          throw new Error(`Launching more browsers is not allowed.`);
        const worker = await this._object.connectToWorker(progress2, params2.endpoint);
        return { worker: new WorkerDispatcher(this, worker) };
      }
    };
  }
});

// packages/playwright-core/src/server/dispatchers/electronDispatcher.ts
var ElectronDispatcher, ElectronApplicationDispatcher;
var init_electronDispatcher = __esm({
  "packages/playwright-core/src/server/dispatchers/electronDispatcher.ts"() {
    "use strict";
    init_browserContextDispatcher();
    init_dispatcher();
    init_jsHandleDispatcher();
    init_electron();
    ElectronDispatcher = class extends Dispatcher {
      constructor(scope, electron, denyLaunch) {
        super(scope, electron, "Electron", {});
        this._type_Electron = true;
        this._denyLaunch = denyLaunch;
      }
      async launch(params2, progress2) {
        if (this._denyLaunch)
          throw new Error(`Launching more browsers is not allowed.`);
        const electronApplication = await this._object.launch(progress2, params2);
        return { electronApplication: new ElectronApplicationDispatcher(this, electronApplication) };
      }
    };
    ElectronApplicationDispatcher = class extends Dispatcher {
      constructor(scope, electronApplication) {
        super(scope, electronApplication, "ElectronApplication", {
          context: BrowserContextDispatcher.from(scope, electronApplication.context())
        });
        this._type_EventTarget = true;
        this._type_ElectronApplication = true;
        this._subscriptions = /* @__PURE__ */ new Set();
        this.addObjectListener(ElectronApplication.Events.Close, () => {
          this._dispatchEvent("close");
          this._dispose();
        });
        this.addObjectListener(ElectronApplication.Events.Console, (message) => {
          if (!this._subscriptions.has("console"))
            return;
          this._dispatchEvent("console", {
            type: message.type(),
            text: message.text(),
            args: message.args().map((a) => JSHandleDispatcher.fromJSHandle(this, a)),
            location: message.location(),
            timestamp: message.timestamp()
          });
        });
      }
      async browserWindow(params2, progress2) {
        const handle = await this._object.browserWindow(progress2, params2.page.page());
        return { handle: JSHandleDispatcher.fromJSHandle(this, handle) };
      }
      async evaluateExpression(params2, progress2) {
        const handle = await progress2.race(this._object._nodeElectronHandlePromise);
        return { value: serializeResult(await handle.evaluateExpression(progress2, params2.expression, { isFunction: params2.isFunction }, parseArgument(params2.arg))) };
      }
      async evaluateExpressionHandle(params2, progress2) {
        const handle = await progress2.race(this._object._nodeElectronHandlePromise);
        const result2 = await handle.evaluateExpressionHandle(progress2, params2.expression, { isFunction: params2.isFunction }, parseArgument(params2.arg));
        return { handle: JSHandleDispatcher.fromJSHandle(this, result2) };
      }
      async updateSubscription(params2, progress2) {
        if (params2.enabled)
          this._subscriptions.add(params2.event);
        else
          this._subscriptions.delete(params2.event);
      }
    };
  }
});

// packages/playwright-core/src/server/harBackend.ts
function countMatchingHeaders(harHeaders, headers) {
  const set = new Set(headers.map((h) => h.name.toLowerCase() + ":" + h.value));
  let matches = 0;
  for (const h of harHeaders) {
    if (set.has(h.name.toLowerCase() + ":" + h.value))
      ++matches;
  }
  return matches;
}
function multipartBoundary(headers) {
  const contentType = headers.find((h) => h.name.toLowerCase() === "content-type");
  if (!contentType?.value.includes("multipart/form-data"))
    return void 0;
  const boundary = contentType.value.match(/boundary=(\S+)/);
  if (boundary)
    return boundary[1];
  return void 0;
}
var import_fs38, import_path35, redirectStatus2, HarBackend;
var init_harBackend = __esm({
  "packages/playwright-core/src/server/harBackend.ts"() {
    "use strict";
    import_fs38 = __toESM(require("fs"));
    import_path35 = __toESM(require("path"));
    init_crypto();
    init_fileUtils();
    redirectStatus2 = [301, 302, 303, 307, 308];
    HarBackend = class {
      constructor(harFile, baseDir, zipFile) {
        this.id = createGuid();
        this._harFile = harFile;
        this._baseDir = baseDir;
        this._zipFile = zipFile;
      }
      async lookup(url2, method, headers, postData, isNavigationRequest) {
        let entry;
        try {
          entry = await this._harFindResponse(url2, method, headers, postData);
        } catch (e) {
          return { action: "error", message: "HAR error: " + e.message };
        }
        if (!entry)
          return { action: "noentry" };
        if (entry.request.url !== url2 && isNavigationRequest)
          return { action: "redirect", redirectURL: entry.request.url };
        const response2 = entry.response;
        try {
          const buffer = await this._loadContent(response2.content);
          return {
            action: "fulfill",
            status: response2.status,
            headers: response2.headers,
            body: buffer
          };
        } catch (e) {
          return { action: "error", message: e.message };
        }
      }
      async _loadContent(content) {
        const file = content._file;
        let buffer;
        if (file) {
          if (this._zipFile) {
            buffer = await this._zipFile.read(file);
          } else {
            const resolved = import_path35.default.resolve(this._baseDir, file);
            if (!isPathInside(this._baseDir, resolved))
              throw new Error(`HAR entry _file escapes base directory: ${file}`);
            buffer = await import_fs38.default.promises.readFile(resolved);
          }
        } else {
          buffer = Buffer.from(content.text || "", content.encoding === "base64" ? "base64" : "utf-8");
        }
        return buffer;
      }
      async _harFindResponse(url2, method, headers, postData) {
        const harLog = this._harFile.log;
        const visited = /* @__PURE__ */ new Set();
        while (true) {
          const entries = [];
          for (const candidate of harLog.entries) {
            if (candidate.request.url !== url2 || candidate.request.method !== method)
              continue;
            if (method === "POST" && postData && candidate.request.postData) {
              const buffer = await this._loadContent(candidate.request.postData);
              if (!buffer.equals(postData)) {
                const boundary = multipartBoundary(headers);
                if (!boundary)
                  continue;
                const candidataBoundary = multipartBoundary(candidate.request.headers);
                if (!candidataBoundary)
                  continue;
                if (postData.toString().replaceAll(boundary, "") !== buffer.toString().replaceAll(candidataBoundary, ""))
                  continue;
              }
            }
            entries.push(candidate);
          }
          if (!entries.length)
            return;
          let entry = entries[0];
          if (entries.length > 1) {
            const list = [];
            for (const candidate of entries) {
              const matchingHeaders = countMatchingHeaders(candidate.request.headers, headers);
              list.push({ candidate, matchingHeaders });
            }
            list.sort((a, b) => b.matchingHeaders - a.matchingHeaders);
            entry = list[0].candidate;
          }
          if (visited.has(entry))
            throw new Error(`Found redirect cycle for ${url2}`);
          visited.add(entry);
          const locationHeader = entry.response.headers.find((h) => h.name.toLowerCase() === "location");
          if (redirectStatus2.includes(entry.response.status) && locationHeader) {
            const locationURL = new URL(locationHeader.value, url2);
            url2 = locationURL.toString();
            if ((entry.response.status === 301 || entry.response.status === 302) && method === "POST" || entry.response.status === 303 && !["GET", "HEAD"].includes(method)) {
              method = "GET";
            }
            continue;
          }
          return entry;
        }
      }
      dispose() {
        this._zipFile?.close();
      }
    };
  }
});

// packages/playwright-core/src/server/localUtils.ts
async function zip(progress2, stackSessions, params2) {
  const promise = new ManualPromise();
  const zipFile = new yazl2.ZipFile();
  zipFile.on("error", (error) => promise.reject(error));
  const addFile = (file, name) => {
    try {
      if (import_fs39.default.statSync(file).isFile())
        zipFile.addFile(file, name);
    } catch (e) {
    }
  };
  for (const entry of params2.entries)
    addFile(entry.value, entry.name);
  const stackSession = params2.stacksId ? stackSessions.get(params2.stacksId) : void 0;
  if (stackSession?.callStacks.length) {
    await progress2.race(stackSession.writer);
    const buffer = Buffer.from(JSON.stringify(serializeClientSideCallMetadata(stackSession.callStacks)));
    zipFile.addBuffer(buffer, "trace.stacks");
  }
  if (params2.includeSources) {
    const sourceFiles = new Set(params2.additionalSources);
    for (const { stack } of stackSession?.callStacks || []) {
      if (!stack)
        continue;
      for (const { file } of stack)
        sourceFiles.add(file);
    }
    for (const sourceFile of sourceFiles)
      addFile(sourceFile, "resources/src@" + calculateSha1(sourceFile) + ".txt");
  }
  if (params2.mode === "write") {
    await progress2.race(import_fs39.default.promises.mkdir(import_path36.default.dirname(params2.zipFile), { recursive: true }));
    zipFile.end(void 0, () => {
      zipFile.outputStream.pipe(import_fs39.default.createWriteStream(params2.zipFile)).on("close", () => promise.resolve()).on("error", (error) => promise.reject(error));
    });
    await progress2.race(promise);
    await deleteStackSession(progress2, stackSessions, params2.stacksId);
    return;
  }
  const tempFile = params2.zipFile + ".tmp";
  await progress2.race(import_fs39.default.promises.rename(params2.zipFile, tempFile));
  yauzl3.open(tempFile, (err, inZipFile) => {
    if (err) {
      promise.reject(err);
      return;
    }
    assert(inZipFile);
    inZipFile.on("error", (error) => promise.reject(error));
    let pendingEntries = inZipFile.entryCount;
    const finalizeRepack = () => {
      zipFile.end(void 0, () => {
        zipFile.outputStream.pipe(import_fs39.default.createWriteStream(params2.zipFile)).on("close", () => {
          import_fs39.default.promises.unlink(tempFile).then(() => {
            promise.resolve();
          }).catch((error) => promise.reject(error));
        }).on("error", (error) => promise.reject(error));
      });
    };
    if (pendingEntries === 0) {
      finalizeRepack();
      return;
    }
    inZipFile.on("entry", (entry) => {
      inZipFile.openReadStream(entry, (err2, readStream) => {
        if (err2) {
          promise.reject(err2);
          return;
        }
        zipFile.addReadStream(readStream, entry.fileName);
        if (--pendingEntries === 0)
          finalizeRepack();
      });
    });
  });
  await progress2.race(promise);
  await deleteStackSession(progress2, stackSessions, params2.stacksId);
}
async function deleteStackSession(progress2, stackSessions, stacksId) {
  const session2 = stacksId ? stackSessions.get(stacksId) : void 0;
  if (!session2)
    return;
  await progress2.race(session2.writer);
  stackSessions.delete(stacksId);
  if (session2.tmpDir)
    await progress2.race(removeFolders([session2.tmpDir]));
}
async function harOpen(progress2, harBackends, params2) {
  let harBackend;
  if (params2.file.endsWith(".zip")) {
    const zipFile = new ZipFile(params2.file);
    try {
      const entryNames = await progress2.race(zipFile.entries());
      const harEntryName = entryNames.find((e) => e.endsWith(".har"));
      if (!harEntryName)
        return { error: "Specified archive does not have a .har file" };
      const har = await progress2.race(zipFile.read(harEntryName));
      const harFile = JSON.parse(har.toString());
      harBackend = new HarBackend(harFile, null, zipFile);
    } catch (error) {
      zipFile.close();
      throw error;
    }
  } else {
    const harFile = JSON.parse(await progress2.race(import_fs39.default.promises.readFile(params2.file, "utf-8")));
    harBackend = new HarBackend(harFile, import_path36.default.dirname(params2.file), null);
  }
  harBackends.set(harBackend.id, harBackend);
  return { harId: harBackend.id };
}
async function harLookup(progress2, harBackends, params2) {
  const harBackend = harBackends.get(params2.harId);
  if (!harBackend)
    return { action: "error", message: `Internal error: har was not opened` };
  return await progress2.race(harBackend.lookup(params2.url, params2.method, params2.headers, params2.postData, params2.isNavigationRequest));
}
function harClose(harBackends, params2) {
  const harBackend = harBackends.get(params2.harId);
  if (harBackend) {
    harBackends.delete(harBackend.id);
    harBackend.dispose();
  }
}
async function harUnzip(progress2, params2) {
  const resourcesDir = params2.resourcesDir ?? import_path36.default.dirname(params2.zipFile);
  const zipFile = new ZipFile(params2.zipFile);
  let resourcesDirCreated = false;
  try {
    for (const entry of await progress2.race(zipFile.entries())) {
      const buffer = await progress2.race(zipFile.read(entry));
      if (entry === "har.har") {
        await progress2.race(import_fs39.default.promises.writeFile(params2.harFile, buffer));
      } else {
        if (!resourcesDirCreated) {
          await progress2.race(import_fs39.default.promises.mkdir(resourcesDir, { recursive: true }));
          resourcesDirCreated = true;
        }
        const outPath = resolveWithinRoot(resourcesDir, entry);
        if (!outPath)
          throw new Error(`HAR zip entry '${entry}' escapes output directory`);
        await progress2.race(import_fs39.default.promises.writeFile(outPath, buffer));
      }
    }
    await progress2.race(import_fs39.default.promises.unlink(params2.zipFile));
  } finally {
    zipFile.close();
  }
}
async function tracingStarted(progress2, stackSessions, params2) {
  let tmpDir = void 0;
  if (!params2.tracesDir)
    tmpDir = await progress2.race(import_fs39.default.promises.mkdtemp(import_path36.default.join(import_os18.default.tmpdir(), "playwright-tracing-")));
  const traceStacksFile = import_path36.default.join(params2.tracesDir || tmpDir, params2.traceName + ".stacks");
  await progress2.race(import_fs39.default.promises.mkdir(import_path36.default.dirname(traceStacksFile), { recursive: true }));
  stackSessions.set(traceStacksFile, { callStacks: [], file: traceStacksFile, writer: Promise.resolve(), tmpDir, live: params2.live });
  return { stacksId: traceStacksFile };
}
async function traceDiscarded(progress2, stackSessions, params2) {
  await deleteStackSession(progress2, stackSessions, params2.stacksId);
}
function addStackToTracingNoReply(stackSessions, params2) {
  for (const session2 of stackSessions.values()) {
    session2.callStacks.push(params2.callData);
    if (session2.live) {
      session2.writer = session2.writer.then(() => {
        const buffer = Buffer.from(JSON.stringify(serializeClientSideCallMetadata(session2.callStacks)));
        return import_fs39.default.promises.writeFile(session2.file, buffer);
      });
    }
  }
}
var import_fs39, import_os18, import_path36, yauzl3, yazl2;
var init_localUtils = __esm({
  "packages/playwright-core/src/server/localUtils.ts"() {
    "use strict";
    import_fs39 = __toESM(require("fs"));
    import_os18 = __toESM(require("os"));
    import_path36 = __toESM(require("path"));
    init_manualPromise();
    init_traceUtils();
    init_assert();
    init_crypto();
    init_zipFile();
    init_fileUtils();
    init_harBackend();
    yauzl3 = require("./utilsBundle").yauzl;
    yazl2 = require("./utilsBundle").yazl;
  }
});

// packages/playwright-core/src/server/dispatchers/jsonPipeDispatcher.ts
var JsonPipeDispatcher;
var init_jsonPipeDispatcher = __esm({
  "packages/playwright-core/src/server/dispatchers/jsonPipeDispatcher.ts"() {
    "use strict";
    init_dispatcher();
    init_instrumentation();
    JsonPipeDispatcher = class extends Dispatcher {
      constructor(scope) {
        super(scope, new SdkObject(scope._object, "jsonPipe"), "JsonPipe", {});
        this._type_JsonPipe = true;
      }
      async send(params2, progress2) {
        this.emit("message", params2.message);
      }
      async close(params2, progress2) {
        this.emit("close");
        if (!this._disposed) {
          this._dispatchEvent("closed", {});
          this._dispose();
        }
      }
      dispatch(message) {
        if (!this._disposed)
          this._dispatchEvent("message", { message });
      }
      wasClosed(reason) {
        if (!this._disposed) {
          this._dispatchEvent("closed", { reason });
          this._dispose();
        }
      }
      dispose() {
        this._dispose();
      }
    };
  }
});

// packages/playwright-core/src/server/socksInterceptor.ts
function tChannelForSocks(names, arg, path59, context2) {
  throw new ValidationError(`${path59}: channels are not expected in SocksSupport`);
}
var import_events15, SocksInterceptor;
var init_socksInterceptor = __esm({
  "packages/playwright-core/src/server/socksInterceptor.ts"() {
    "use strict";
    import_events15 = __toESM(require("events"));
    init_socksProxy();
    init_debug();
    init_validator();
    SocksInterceptor = class {
      constructor(transport, pattern, redirectPortForTest) {
        this._ids = /* @__PURE__ */ new Set();
        this._handler = new SocksProxyHandler(pattern, redirectPortForTest);
        let lastId = -1;
        this._channel = new Proxy(new import_events15.default(), {
          get: (obj, prop) => {
            if (prop in obj || obj[prop] !== void 0 || typeof prop !== "string")
              return obj[prop];
            return (params2) => {
              try {
                const id = --lastId;
                this._ids.add(id);
                const validator = findValidator("SocksSupport", prop, "Params");
                params2 = validator(params2, "", { tChannelImpl: tChannelForSocks, binary: "toBase64", isUnderTest });
                transport.send({ id, guid: this._socksSupportObjectGuid, method: prop, params: params2, metadata: { stack: [], apiName: "", internal: true } });
              } catch (e) {
              }
            };
          }
        });
        this._handler.on(SocksProxyHandler.Events.SocksConnected, (payload) => this._channel.socksConnected(payload));
        this._handler.on(SocksProxyHandler.Events.SocksData, (payload) => this._channel.socksData(payload));
        this._handler.on(SocksProxyHandler.Events.SocksError, (payload) => this._channel.socksError(payload));
        this._handler.on(SocksProxyHandler.Events.SocksFailed, (payload) => this._channel.socksFailed(payload));
        this._handler.on(SocksProxyHandler.Events.SocksEnd, (payload) => this._channel.socksEnd(payload));
        this._channel.on("socksRequested", (payload) => this._handler.socketRequested(payload));
        this._channel.on("socksClosed", (payload) => this._handler.socketClosed(payload));
        this._channel.on("socksData", (payload) => this._handler.sendSocketData(payload));
      }
      cleanup() {
        this._handler.cleanup();
      }
      interceptMessage(message) {
        if (this._ids.has(message.id)) {
          this._ids.delete(message.id);
          return true;
        }
        if (message.method === "__create__" && message.params.type === "SocksSupport") {
          this._socksSupportObjectGuid = message.params.guid;
          return false;
        }
        if (this._socksSupportObjectGuid && message.guid === this._socksSupportObjectGuid) {
          const validator = findValidator("SocksSupport", message.method, "Event");
          const params2 = validator(message.params, "", { tChannelImpl: tChannelForSocks, binary: "fromBase64", isUnderTest });
          this._channel.emit(message.method, params2);
          return true;
        }
        return false;
      }
    };
  }
});

// packages/playwright-core/src/server/dispatchers/localUtilsDispatcher.ts
async function urlToWSEndpoint2(progress2, endpointURL) {
  if (endpointURL.startsWith("ws"))
    return endpointURL;
  progress2.log(`<ws preparing> retrieving websocket url from ${endpointURL}`);
  const fetchUrl = new URL(endpointURL);
  if (!fetchUrl.pathname.endsWith("/"))
    fetchUrl.pathname += "/";
  fetchUrl.pathname += "json";
  const json = await fetchData(progress2, {
    url: fetchUrl.toString(),
    method: "GET",
    headers: { "User-Agent": getUserAgent() }
  }, async (params2, response2) => {
    return new Error(`Unexpected status ${response2.statusCode} when connecting to ${fetchUrl.toString()}.
This does not look like a Playwright server, try connecting via ws://.`);
  });
  const wsUrl = new URL(endpointURL);
  let wsEndpointPath = JSON.parse(json).wsEndpointPath;
  if (wsEndpointPath.startsWith("/"))
    wsEndpointPath = wsEndpointPath.substring(1);
  if (!wsUrl.pathname.endsWith("/"))
    wsUrl.pathname += "/";
  wsUrl.pathname += wsEndpointPath;
  wsUrl.protocol = wsUrl.protocol === "https:" ? "wss:" : "ws:";
  return wsUrl.toString();
}
var import_net7, LocalUtilsDispatcher;
var init_localUtilsDispatcher = __esm({
  "packages/playwright-core/src/server/dispatchers/localUtilsDispatcher.ts"() {
    "use strict";
    import_net7 = __toESM(require("net"));
    init_urlMatch();
    init_utils2();
    init_userAgent();
    init_dispatcher();
    init_instrumentation();
    init_localUtils();
    init_deviceDescriptors();
    init_jsonPipeDispatcher();
    init_pipeTransport2();
    init_socksInterceptor();
    init_transport();
    LocalUtilsDispatcher = class extends Dispatcher {
      constructor(scope, playwright2) {
        const localUtils = new SdkObject(playwright2, "localUtils", "localUtils");
        localUtils.logName = "browser";
        const deviceDescriptors2 = Object.entries(deviceDescriptors).map(([name, descriptor]) => ({ name, descriptor }));
        super(scope, localUtils, "LocalUtils", {
          deviceDescriptors: deviceDescriptors2
        });
        this._harBackends = /* @__PURE__ */ new Map();
        this._stackSessions = /* @__PURE__ */ new Map();
        this._type_LocalUtils = true;
      }
      async zip(params2, progress2) {
        return await zip(progress2, this._stackSessions, params2);
      }
      async harOpen(params2, progress2) {
        return await harOpen(progress2, this._harBackends, params2);
      }
      async harLookup(params2, progress2) {
        return await harLookup(progress2, this._harBackends, params2);
      }
      async harClose(params2, progress2) {
        harClose(this._harBackends, params2);
      }
      async harUnzip(params2, progress2) {
        return await harUnzip(progress2, params2);
      }
      async tracingStarted(params2, progress2) {
        return await tracingStarted(progress2, this._stackSessions, params2);
      }
      async traceDiscarded(params2, progress2) {
        return await traceDiscarded(progress2, this._stackSessions, params2);
      }
      async addStackToTracingNoReply(params2, progress2) {
        addStackToTracingNoReply(this._stackSessions, params2);
      }
      async connect(params2, progress2) {
        if (URL.canParse(params2.endpoint))
          return await this._connectOverWebSocket(progress2, params2);
        return await progress2.race(this._connectOverPipe(params2));
      }
      async _connectOverWebSocket(progress2, params2) {
        const wsHeaders = {
          "User-Agent": getUserAgent(),
          "x-playwright-proxy": params2.exposeNetwork ?? "",
          ...params2.headers
        };
        const wsEndpoint = await urlToWSEndpoint2(progress2, params2.endpoint);
        const transport = await WebSocketTransport.connect(progress2, wsEndpoint, { headers: wsHeaders, followRedirects: true, debugLogHeader: "x-playwright-debug-log" });
        const socksInterceptor = new SocksInterceptor(transport, params2.exposeNetwork, params2.socksProxyRedirectPortForTest);
        const pipe = new JsonPipeDispatcher(this);
        transport.onmessage = (json) => {
          if (socksInterceptor.interceptMessage(json))
            return;
          const cb = () => {
            try {
              pipe.dispatch(json);
            } catch (e) {
              transport.close();
            }
          };
          if (params2.slowMo)
            setTimeout(cb, params2.slowMo);
          else
            cb();
        };
        pipe.on("message", (message) => {
          transport.send(message);
        });
        transport.onclose = (reason) => {
          socksInterceptor?.cleanup();
          pipe.wasClosed(reason);
        };
        pipe.on("close", () => transport.close());
        return { pipe, headers: transport.headers };
      }
      async _connectOverPipe(params2) {
        const socket = await new Promise((resolve, reject) => {
          const conn = import_net7.default.connect(params2.endpoint, () => resolve(conn));
          conn.on("error", reject);
        });
        const transport = new PipeTransport2(socket, socket);
        const pipe = new JsonPipeDispatcher(this);
        transport.onmessage = (json) => {
          const cb = () => {
            try {
              pipe.dispatch(json);
            } catch (e) {
              transport.close();
            }
          };
          if (params2.slowMo)
            setTimeout(cb, params2.slowMo);
          else
            cb();
        };
        pipe.on("message", (message) => {
          transport.send(message);
        });
        transport.onclose = (reason) => {
          pipe.wasClosed(reason);
        };
        pipe.on("close", () => socket.end());
        return { pipe, headers: [] };
      }
      async globToRegex(params2, progress2) {
        const regex = resolveGlobToRegexPattern(params2.baseURL, params2.glob, params2.webSocketUrl);
        return { regex };
      }
    };
  }
});

// packages/playwright-core/src/server/dispatchers/playwrightDispatcher.ts
var PlaywrightDispatcher, SocksSupportDispatcher;
var init_playwrightDispatcher = __esm({
  "packages/playwright-core/src/server/dispatchers/playwrightDispatcher.ts"() {
    "use strict";
    init_socksProxy();
    init_eventsHelper();
    init_fetch();
    init_androidDispatcher();
    init_androidDispatcher();
    init_browserDispatcher();
    init_browserTypeDispatcher();
    init_dispatcher();
    init_electronDispatcher();
    init_localUtilsDispatcher();
    init_networkDispatchers();
    init_instrumentation();
    PlaywrightDispatcher = class extends Dispatcher {
      constructor(scope, playwright2, options = {}) {
        const denyLaunch = options.denyLaunch ?? false;
        const chromium = new BrowserTypeDispatcher(scope, playwright2.chromium, denyLaunch);
        const firefox = new BrowserTypeDispatcher(scope, playwright2.firefox, denyLaunch);
        const webkit = new BrowserTypeDispatcher(scope, playwright2.webkit, denyLaunch);
        const android = new AndroidDispatcher(scope, playwright2.android, denyLaunch);
        const initializer = {
          chromium,
          firefox,
          webkit,
          android,
          electron: new ElectronDispatcher(scope, playwright2.electron, denyLaunch),
          utils: playwright2.options.isServer ? void 0 : new LocalUtilsDispatcher(scope, playwright2),
          socksSupport: options.socksProxy ? new SocksSupportDispatcher(scope, playwright2, options.socksProxy) : void 0
        };
        let browserDispatcher;
        if (options.preLaunchedBrowser) {
          const browserTypeDispatcher = initializer[options.preLaunchedBrowser.options.name];
          browserDispatcher = new BrowserDispatcher(browserTypeDispatcher, options.preLaunchedBrowser, {
            ignoreStopAndKill: true,
            isolateContexts: !options.sharedBrowser
          });
          initializer.preLaunchedBrowser = browserDispatcher;
        }
        if (options.preLaunchedAndroidDevice)
          initializer.preConnectedAndroidDevice = new AndroidDeviceDispatcher(android, options.preLaunchedAndroidDevice);
        super(scope, playwright2, "Playwright", initializer);
        this._type_Playwright = true;
        this._browserDispatcher = browserDispatcher;
        this._denyLaunch = denyLaunch;
      }
      async newRequest(params2, progress2) {
        if (this._denyLaunch)
          throw new Error(`Creating new API request contexts is not allowed.`);
        const request2 = new GlobalAPIRequestContext(this._object, params2);
        return { request: APIRequestContextDispatcher.from(this.parentScope(), request2) };
      }
      async cleanup() {
        await this._browserDispatcher?.cleanupContexts();
      }
    };
    SocksSupportDispatcher = class extends Dispatcher {
      constructor(scope, parent, socksProxy) {
        super(scope, new SdkObject(parent, "socksSupport"), "SocksSupport", {});
        this._type_SocksSupport = true;
        this._socksProxy = socksProxy;
        this._socksListeners = [
          eventsHelper.addEventListener(socksProxy, SocksProxy.Events.SocksRequested, (payload) => this._dispatchEvent("socksRequested", payload)),
          eventsHelper.addEventListener(socksProxy, SocksProxy.Events.SocksData, (payload) => this._dispatchEvent("socksData", payload)),
          eventsHelper.addEventListener(socksProxy, SocksProxy.Events.SocksClosed, (payload) => this._dispatchEvent("socksClosed", payload))
        ];
      }
      async socksConnected(params2, progress2) {
        this._socksProxy?.socketConnected(params2);
      }
      async socksFailed(params2, progress2) {
        this._socksProxy?.socketFailed(params2);
      }
      async socksData(params2, progress2) {
        this._socksProxy?.sendSocketData(params2);
      }
      async socksError(params2, progress2) {
        this._socksProxy?.sendSocketError(params2);
      }
      async socksEnd(params2, progress2) {
        this._socksProxy?.sendSocketEnd(params2);
      }
      _onDispose() {
        eventsHelper.removeEventListeners(this._socksListeners);
      }
    };
  }
});

// packages/playwright-core/src/server/trace/viewer/traceViewer.ts
function validateTraceUrlOrPath(traceFileOrUrl) {
  if (!traceFileOrUrl)
    return traceFileOrUrl;
  if (traceFileOrUrl.startsWith("http://") || traceFileOrUrl.startsWith("https://"))
    return traceFileOrUrl;
  let traceFile = traceFileOrUrl;
  if (traceFile.endsWith(".json"))
    return toFilePathUrl(traceFile);
  try {
    const stat = import_fs40.default.statSync(traceFile);
    if (stat.isDirectory())
      traceFile = import_path37.default.join(traceFile, tracesDirMarker);
    return toFilePathUrl(traceFile);
  } catch {
    throw new Error(`Trace file ${traceFileOrUrl} does not exist!`);
  }
}
async function startTraceViewerServer(options) {
  const server = new HttpServer(libPath("vite", "traceViewer"));
  const isAllowed = (filePath) => options.allowedFileRoots().some((root) => isPathInside(import_path37.default.resolve(root), filePath));
  const serveTraceDataRoute = (request2, response2, relativePath) => {
    if (!relativePath.startsWith("/file"))
      return false;
    const url2 = new URL("http://localhost" + request2.url);
    try {
      const filePath = import_path37.default.resolve(url2.searchParams.get("path"));
      if (!isAllowed(filePath)) {
        response2.statusCode = 403;
        response2.end();
        return true;
      }
      if (import_fs40.default.existsSync(filePath))
        return server.serveFile(request2, response2, filePath, void 0, { skipRootCheck: true });
      if (filePath.endsWith(".json")) {
        const fullPrefix = filePath.substring(0, filePath.length - ".json".length);
        return sendTraceDescriptor(response2, import_path37.default.dirname(fullPrefix), import_path37.default.basename(fullPrefix));
      }
      if (filePath.endsWith(tracesDirMarker))
        return sendTraceDescriptor(response2, import_path37.default.dirname(filePath));
    } catch {
    }
    response2.statusCode = 404;
    response2.end();
    return true;
  };
  if (false) {
    const traceViewerRoot = import_path37.default.resolve(__dirname, "..", "..", "trace-viewer");
    const devServer = await server.createViteDevServer({ root: traceViewerRoot, base: "/trace/" });
    server.routePrefix("/trace", (request2, response2) => {
      const url2 = new URL("http://localhost" + request2.url);
      const relativePath = url2.pathname.slice("/trace".length);
      if (relativePath.startsWith("/file"))
        return serveTraceDataRoute(request2, response2, relativePath);
      if (relativePath === "/sw.bundle.js")
        return server.serveFile(request2, response2, import_path37.default.join(libPath("vite", "traceViewer"), "sw.bundle.js"));
      devServer.middlewares(request2, response2, HttpServer.notFoundFallback(response2));
      return true;
    });
  } else {
    server.routePrefix("/trace", (request2, response2) => {
      const url2 = new URL("http://localhost" + request2.url);
      const relativePath = url2.pathname.slice("/trace".length);
      if (relativePath.startsWith("/file"))
        return serveTraceDataRoute(request2, response2, relativePath);
      const absolutePath = import_path37.default.join(libPath("vite", "traceViewer"), ...relativePath.split("/"));
      return server.serveFile(request2, response2, absolutePath);
    });
  }
  const transport = options.transport || (options.isServer ? new StdinServer() : void 0);
  if (transport)
    server.createWebSocket(() => transport);
  const { host, port } = options;
  await server.start({ preferredPort: port, host });
  return server;
}
async function installRootRedirect(server, traceUrl, options) {
  const params2 = new URLSearchParams();
  if (import_path37.default.sep !== import_path37.default.posix.sep)
    params2.set("pathSeparator", import_path37.default.sep);
  if (traceUrl)
    params2.append("trace", traceUrl);
  if (server.wsGuid())
    params2.append("ws", server.wsGuid());
  if (options?.isServer)
    params2.append("isServer", "");
  if (isUnderTest())
    params2.append("isUnderTest", "true");
  for (const arg of options.args || [])
    params2.append("arg", arg);
  if (options.grep)
    params2.append("grep", options.grep);
  if (options.grepInvert)
    params2.append("grepInvert", options.grepInvert);
  for (const project of options.project || [])
    params2.append("project", project);
  for (const reporter of options.reporter || [])
    params2.append("reporter", reporter);
  const urlPath = `./trace/${options.webApp || "index.html"}?${params2.toString()}`;
  server.routePath("/", (_, response2) => {
    response2.statusCode = 302;
    response2.setHeader("Location", urlPath);
    response2.end();
    return true;
  });
}
async function runTraceViewerApp(traceUrl, browserName, options) {
  traceUrl = validateTraceUrlOrPath(traceUrl);
  const allowedFileRoots = traceFileRoots(traceUrl);
  const server = await startTraceViewerServer({ ...options, allowedFileRoots: () => allowedFileRoots });
  await installRootRedirect(server, traceUrl, options);
  const page = await openTraceViewerApp(server.urlPrefix("precise"), browserName, options);
  page.on("close", () => gracefullyProcessExitDoNotHang(0));
  return page;
}
async function runTraceInBrowser(traceUrl, options) {
  traceUrl = validateTraceUrlOrPath(traceUrl);
  const allowedFileRoots = traceFileRoots(traceUrl);
  const server = await startTraceViewerServer({ ...options, allowedFileRoots: () => allowedFileRoots });
  await installRootRedirect(server, traceUrl, options);
  await openTraceInBrowser(server.urlPrefix("human-readable"));
}
function traceFileRoots(traceUrl) {
  if (traceUrl?.startsWith("file://")) {
    try {
      return [import_path37.default.dirname(import_url.default.fileURLToPath(traceUrl))];
    } catch {
    }
  }
  if (traceUrl?.startsWith("file?path=")) {
    try {
      const url2 = new URL(traceUrl, "http://localhost");
      return [import_path37.default.dirname(url2.searchParams.get("path"))];
    } catch {
    }
  }
  return [process.cwd()];
}
async function openTraceViewerApp(url2, browserName, options) {
  const traceViewerPlaywright = createPlaywright({ sdkLanguage: "javascript", isInternalPlaywright: true });
  const traceViewerBrowser = isUnderTest() ? "chromium" : browserName;
  const { context: context2, page } = await launchApp(traceViewerPlaywright[traceViewerBrowser], {
    sdkLanguage: traceViewerPlaywright.options.sdkLanguage,
    windowSize: { width: 1280, height: 800 },
    persistentContextOptions: {
      ...options?.persistentContextOptions,
      args: isUnderTest() ? ["--remote-debugging-port=0"] : void 0,
      headless: !!options?.headless,
      colorScheme: isUnderTest() ? "light" : void 0
    }
  });
  const controller = new ProgressController();
  await controller.run(async (progress2) => {
    await context2._browser._defaultContext.loadDefaultContextAsIs(progress2);
    if (process.env.PWTEST_PRINT_WS_ENDPOINT) {
      process.stderr.write("DevTools listening on: " + context2._browser.options.wsEndpoint + "\n");
    }
    if (!isUnderTest())
      await progress2.race(syncLocalStorageWithSettings(page, "traceviewer"));
    if (isUnderTest())
      page.on("close", () => context2.close(nullProgress, { reason: "Trace viewer closed" }).catch(() => {
      }));
    await page.mainFrame().goto(progress2, url2);
  });
  return page;
}
async function openTraceInBrowser(url2) {
  console.log("\nListening on " + url2);
  if (!isUnderTest() && !isCodingAgent())
    await open2(url2.replace("0.0.0.0", "localhost")).catch(() => {
    });
}
function sendTraceDescriptor(response2, traceDir2, tracePrefix) {
  response2.statusCode = 200;
  response2.setHeader("Content-Type", "application/json");
  response2.end(JSON.stringify(traceDescriptor(traceDir2, tracePrefix)));
  return true;
}
function traceDescriptor(traceDir2, tracePrefix) {
  const result2 = {
    entries: []
  };
  for (const name of import_fs40.default.readdirSync(traceDir2)) {
    if (!tracePrefix || name.startsWith(tracePrefix))
      result2.entries.push({ name, path: toFilePathUrl(import_path37.default.join(traceDir2, name)) });
  }
  const resourcesDir = import_path37.default.join(traceDir2, "resources");
  if (import_fs40.default.existsSync(resourcesDir)) {
    for (const name of import_fs40.default.readdirSync(resourcesDir))
      result2.entries.push({ name: "resources/" + name, path: toFilePathUrl(import_path37.default.join(resourcesDir, name)) });
  }
  return result2;
}
function toFilePathUrl(filePath) {
  return `file?path=${encodeURIComponent(filePath)}`;
}
var import_fs40, import_path37, import_url, open2, tracesDirMarker, StdinServer;
var init_traceViewer = __esm({
  "packages/playwright-core/src/server/trace/viewer/traceViewer.ts"() {
    "use strict";
    import_fs40 = __toESM(require("fs"));
    import_path37 = __toESM(require("path"));
    import_url = __toESM(require("url"));
    init_httpServer();
    init_processLauncher();
    init_debug();
    init_env();
    init_fileUtils();
    init_package();
    init_launchApp();
    init_launchApp();
    init_playwright();
    init_progress();
    init_progress();
    open2 = require("./utilsBundle").open;
    tracesDirMarker = "traces.dir";
    StdinServer = class {
      constructor() {
        process.stdin.on("data", (data) => {
          const url2 = validateTraceUrlOrPath(data.toString().trim());
          if (!url2 || url2 === this._traceUrl)
            return;
          if (url2.endsWith(".json"))
            this._pollLoadTrace(url2);
          else
            this._loadTrace(url2);
        });
        process.stdin.on("close", () => gracefullyProcessExitDoNotHang(0));
      }
      onconnect() {
      }
      async dispatch(method, params2) {
        if (method === "initialize") {
          if (this._traceUrl)
            this._loadTrace(this._traceUrl);
        }
      }
      onclose() {
      }
      _loadTrace(traceUrl) {
        this._traceUrl = traceUrl;
        clearTimeout(this._pollTimer);
        this.sendEvent?.("loadTraceRequested", { traceUrl });
      }
      _pollLoadTrace(url2) {
        this._loadTrace(url2);
        this._pollTimer = setTimeout(() => {
          this._pollLoadTrace(url2);
        }, 500);
      }
    };
  }
});

// packages/playwright-core/src/server/index.ts
var server_exports = {};
__export(server_exports, {
  Browser: () => Browser,
  BrowserContext: () => BrowserContext,
  DispatcherConnection: () => DispatcherConnection,
  Page: () => Page,
  PlaywrightDispatcher: () => PlaywrightDispatcher,
  Request: () => Request,
  RequestDispatcher: () => RequestDispatcher,
  Response: () => Response2,
  ResponseDispatcher: () => ResponseDispatcher,
  RootDispatcher: () => RootDispatcher,
  WebSocketTransport: () => WebSocketTransport,
  createPlaywright: () => createPlaywright,
  deviceDescriptors: () => deviceDescriptors,
  findRepeatedSubsequencesForTest: () => findRepeatedSubsequencesForTest,
  installRootRedirect: () => installRootRedirect,
  nullProgress: () => nullProgress,
  openTraceInBrowser: () => openTraceInBrowser,
  openTraceViewerApp: () => openTraceViewerApp,
  runTraceViewerApp: () => runTraceViewerApp,
  setMaxDispatchersForTest: () => setMaxDispatchersForTest,
  startTraceViewerServer: () => startTraceViewerServer
});
var init_server = __esm({
  "packages/playwright-core/src/server/index.ts"() {
    "use strict";
    init_browser();
    init_browserContext();
    init_callLog();
    init_deviceDescriptors();
    init_dispatcher();
    init_networkDispatchers();
    init_playwrightDispatcher();
    init_network2();
    init_page();
    init_playwright();
    init_progress();
    init_transport();
    init_traceViewer();
  }
});

// packages/playwright-core/src/server/dispatchers/debugControllerDispatcher.ts
var DebugControllerDispatcher;
var init_debugControllerDispatcher = __esm({
  "packages/playwright-core/src/server/dispatchers/debugControllerDispatcher.ts"() {
    "use strict";
    init_eventsHelper();
    init_debugController();
    init_dispatcher();
    DebugControllerDispatcher = class extends Dispatcher {
      constructor(connection, debugController) {
        super(connection, debugController, "DebugController", {});
        this._type_DebugController = true;
        this._listeners = [
          eventsHelper.addEventListener(this._object, DebugController.Events.StateChanged, (params2) => {
            this._dispatchEvent("stateChanged", params2);
          }),
          eventsHelper.addEventListener(this._object, DebugController.Events.InspectRequested, ({ selector, locator: locator2, ariaSnapshot }) => {
            this._dispatchEvent("inspectRequested", { selector, locator: locator2, ariaSnapshot });
          }),
          eventsHelper.addEventListener(this._object, DebugController.Events.SourceChanged, ({ text: text2, header, footer, actions }) => {
            this._dispatchEvent("sourceChanged", { text: text2, header, footer, actions });
          }),
          eventsHelper.addEventListener(this._object, DebugController.Events.Paused, ({ paused }) => {
            this._dispatchEvent("paused", { paused });
          }),
          eventsHelper.addEventListener(this._object, DebugController.Events.SetModeRequested, ({ mode }) => {
            this._dispatchEvent("setModeRequested", { mode });
          })
        ];
      }
      async initialize(params2, progress2) {
        this._object.initialize(progress2, params2.codegenId, params2.sdkLanguage);
      }
      async setReportStateChanged(params2, progress2) {
        this._object.setReportStateChanged(progress2, params2.enabled);
      }
      async setRecorderMode(params2, progress2) {
        await this._object.setRecorderMode(progress2, params2);
      }
      async highlight(params2, progress2) {
        await this._object.highlight(progress2, params2);
      }
      async hideHighlight(params2, progress2) {
        await this._object.hideHighlight(progress2);
      }
      async resume(params2, progress2) {
        await this._object.resume(progress2);
      }
      async kill(params2, progress2) {
        this._object.kill(progress2);
      }
      _onDispose() {
        eventsHelper.removeEventListeners(this._listeners);
        this._object.dispose();
      }
    };
  }
});

// packages/playwright-core/src/remote/playwrightConnection.ts
var PlaywrightConnection;
var init_playwrightConnection = __esm({
  "packages/playwright-core/src/remote/playwrightConnection.ts"() {
    "use strict";
    init_profiler();
    init_debugLogger();
    init_time();
    init_server();
    init_android();
    init_browser();
    init_debugControllerDispatcher();
    PlaywrightConnection = class {
      constructor(semaphore, transport, controller, playwright2, initialize, id) {
        this._cleanups = [];
        this._transport = transport;
        this._semaphore = semaphore;
        this._id = id;
        this._profileName = (/* @__PURE__ */ new Date()).toISOString();
        const lock2 = this._semaphore.acquire();
        this._dispatcherConnection = new DispatcherConnection();
        this._dispatcherConnection.onmessage = async (message) => {
          await lock2;
          if (!transport.isClosed()) {
            const messageString = JSON.stringify(message);
            if (debugLogger.isEnabled("server:channel"))
              debugLogger.log("server:channel", `[${this._id}] ${monotonicTime() * 1e3} SEND \u25BA ${messageString}`);
            if (debugLogger.isEnabled("server:metadata"))
              this.logServerMetadata(message, messageString, "SEND");
            transport.send(messageString);
          }
        };
        transport.on("message", async (message) => {
          await lock2;
          const messageString = Buffer.from(message).toString();
          let jsonMessage;
          try {
            jsonMessage = JSON.parse(messageString);
          } catch (e) {
            debugLogger.log("server", `[${this._id}] failed to parse message: ${e}`);
            this.close({ code: 1007, reason: "Malformed message" });
            return;
          }
          if (debugLogger.isEnabled("server:channel"))
            debugLogger.log("server:channel", `[${this._id}] ${monotonicTime() * 1e3} \u25C0 RECV ${messageString}`);
          if (debugLogger.isEnabled("server:metadata"))
            this.logServerMetadata(jsonMessage, messageString, "RECV");
          this._dispatcherConnection.dispatch(jsonMessage);
        });
        transport.on("close", () => this._onDisconnect());
        transport.on("error", (error) => this._onDisconnect(error));
        if (controller) {
          debugLogger.log("server", `[${this._id}] engaged reuse controller mode`);
          this._root = new DebugControllerDispatcher(this._dispatcherConnection, playwright2.debugController);
          return;
        }
        this._root = new RootDispatcher(this._dispatcherConnection, async (scope, params2) => {
          await startProfiling();
          const options = await initialize();
          if (options.preLaunchedBrowser) {
            const browser = options.preLaunchedBrowser;
            browser.options.sdkLanguage = params2.sdkLanguage;
            browser.on(Browser.Events.Disconnected, () => {
              this.close({ code: 1001, reason: "Browser closed" });
            });
          }
          if (options.preLaunchedAndroidDevice) {
            const androidDevice = options.preLaunchedAndroidDevice;
            androidDevice.on(AndroidDevice.Events.Close, () => {
              this.close({ code: 1001, reason: "Android device disconnected" });
            });
          }
          if (options.dispose)
            this._cleanups.push(options.dispose);
          const dispatcher = new PlaywrightDispatcher(scope, playwright2, options);
          this._cleanups.push(() => dispatcher.cleanup());
          return dispatcher;
        });
      }
      _onDisconnect(error) {
        if (!this._onDisconnectPromise)
          this._onDisconnectPromise = this._doDisconnect(error);
        return this._onDisconnectPromise;
      }
      async _doDisconnect(error) {
        debugLogger.log("server", `[${this._id}] disconnected. error: ${error}`);
        await this._root.stopPendingOperations(new Error("Disconnected")).catch(() => {
        });
        this._root._dispose();
        debugLogger.log("server", `[${this._id}] starting cleanup`);
        for (const cleanup of this._cleanups)
          await cleanup().catch(() => {
          });
        await stopProfiling(this._profileName);
        this._semaphore.release();
        debugLogger.log("server", `[${this._id}] finished cleanup`);
      }
      logServerMetadata(message, messageString, direction) {
        const serverLogMetadata = {
          wallTime: Date.now(),
          id: message.id,
          guid: message.guid,
          method: message.method,
          payloadSizeInBytes: Buffer.byteLength(messageString, "utf-8")
        };
        debugLogger.log("server:metadata", (direction === "SEND" ? "SEND \u25BA " : "\u25C0 RECV ") + JSON.stringify(serverLogMetadata));
      }
      async close(reason) {
        if (!this._onDisconnectPromise) {
          debugLogger.log("server", `[${this._id}] force closing connection: ${reason?.reason || ""} (${reason?.code || 0})`);
          try {
            this._transport.close(reason);
          } catch (e) {
          }
        }
        await this._onDisconnect();
      }
    };
  }
});

// packages/playwright-core/src/remote/playwrightServer.ts
var playwrightServer_exports = {};
__export(playwrightServer_exports, {
  PlaywrightServer: () => PlaywrightServer
});
function userAgentVersionMatchesErrorMessage(userAgent) {
  const match = userAgent.match(/^Playwright\/(\d+\.\d+\.\d+)/);
  if (!match) {
    return;
  }
  const received = match[1].split(".").slice(0, 2).join(".");
  const expected = getPlaywrightVersion(true);
  if (received !== expected) {
    return wrapInASCIIBox([
      `Playwright version mismatch:`,
      `  - server version: v${expected}`,
      `  - client version: v${received}`,
      ``,
      `If you are using VSCode extension, restart VSCode.`,
      ``,
      `If you are connecting to a remote service,`,
      `keep your local Playwright version in sync`,
      `with the remote service version.`,
      ``,
      `<3 Playwright Team`
    ].join("\n"), 1);
  }
}
function launchOptionsHash(options) {
  const copy = { ...options };
  for (const k of Object.keys(copy)) {
    const key = k;
    if (copy[key] === defaultLaunchOptions[key])
      delete copy[key];
  }
  for (const key of optionsThatAllowBrowserReuse)
    delete copy[key];
  return JSON.stringify(copy);
}
function filterLaunchOptions(options, allowUnsafe) {
  return {
    channel: options.channel,
    args: allowUnsafe ? options.args : void 0,
    ignoreAllDefaultArgs: allowUnsafe ? options.ignoreAllDefaultArgs : void 0,
    ignoreDefaultArgs: allowUnsafe ? options.ignoreDefaultArgs : void 0,
    timeout: options.timeout,
    headless: options.headless,
    proxy: options.proxy,
    chromiumSandbox: allowUnsafe ? options.chromiumSandbox : void 0,
    firefoxUserPrefs: isUnderTest() || allowUnsafe ? options.firefoxUserPrefs : void 0,
    slowMo: options.slowMo,
    executablePath: isUnderTest() || allowUnsafe ? options.executablePath : void 0,
    downloadsPath: allowUnsafe ? options.downloadsPath : void 0,
    artifactsDir: isUnderTest() || allowUnsafe ? options.artifactsDir : void 0
  };
}
var PlaywrightServer, defaultLaunchOptions, optionsThatAllowBrowserReuse;
var init_playwrightServer = __esm({
  "packages/playwright-core/src/remote/playwrightServer.ts"() {
    "use strict";
    init_semaphore();
    init_time();
    init_wsServer();
    init_ascii();
    init_socksProxy();
    init_debugLogger();
    init_debug();
    init_userAgent();
    init_playwrightConnection();
    init_serverTransport();
    init_playwright();
    init_browser();
    init_progress();
    PlaywrightServer = class {
      constructor(options) {
        this._dontReuseBrowsers = /* @__PURE__ */ new Set();
        this._options = options;
        if (options.preLaunchedBrowser) {
          this._playwright = options.preLaunchedBrowser.attribution.playwright;
          this._dontReuse(options.preLaunchedBrowser);
        }
        if (options.preLaunchedAndroidDevice)
          this._playwright = options.preLaunchedAndroidDevice._android.attribution.playwright;
        this._playwright ??= createPlaywright({ sdkLanguage: "javascript", isServer: true });
        const browserSemaphore = new Semaphore(this._options.maxConnections);
        const controllerSemaphore = new Semaphore(1);
        const reuseBrowserSemaphore = new Semaphore(1);
        this._wsServer = new WSServer({
          onRequest: (request2, response2) => {
            if (request2.method === "GET" && request2.url === "/json") {
              response2.setHeader("Content-Type", "application/json");
              response2.end(JSON.stringify({
                wsEndpointPath: this._options.path
              }));
              return;
            }
            response2.end("Running");
          },
          onUpgrade: (request2, socket) => {
            const uaError = userAgentVersionMatchesErrorMessage(request2.headers["user-agent"] || "");
            if (uaError)
              return { error: `HTTP/${request2.httpVersion} 428 Precondition Required\r
\r
${uaError}` };
          },
          onHeaders: (headers) => {
            if (process.env.PWTEST_SERVER_WS_HEADERS)
              headers.push(process.env.PWTEST_SERVER_WS_HEADERS);
          },
          onConnection: (request2, url2, ws4, id) => {
            const browserHeader = request2.headers["x-playwright-browser"];
            const browserName = url2.searchParams.get("browser") || (Array.isArray(browserHeader) ? browserHeader[0] : browserHeader) || null;
            const proxyHeader = request2.headers["x-playwright-proxy"];
            const proxyValue = url2.searchParams.get("proxy") || (Array.isArray(proxyHeader) ? proxyHeader[0] : proxyHeader);
            const launchOptionsHeader = request2.headers["x-playwright-launch-options"] || "";
            const launchOptionsHeaderValue = Array.isArray(launchOptionsHeader) ? launchOptionsHeader[0] : launchOptionsHeader;
            const launchOptionsParam = url2.searchParams.get("launch-options");
            let launchOptions = { timeout: DEFAULT_PLAYWRIGHT_LAUNCH_TIMEOUT };
            try {
              launchOptions = JSON.parse(launchOptionsParam || launchOptionsHeaderValue);
              if (!launchOptions.timeout)
                launchOptions.timeout = DEFAULT_PLAYWRIGHT_LAUNCH_TIMEOUT;
            } catch (e) {
            }
            const isExtension = this._options.mode === "extension";
            launchOptions = filterLaunchOptions(launchOptions, isExtension || !!this._options.unsafe);
            if (this._options.artifactsDir)
              launchOptions.artifactsDir = this._options.artifactsDir;
            if (isExtension) {
              const connectFilter = url2.searchParams.get("connect");
              if (connectFilter) {
                if (connectFilter !== "first")
                  throw new Error(`Unknown connect filter: ${connectFilter}`);
                return new PlaywrightConnection(
                  browserSemaphore,
                  new WebSocketServerTransport(ws4),
                  false,
                  this._playwright,
                  () => this._initConnectMode(id, connectFilter, browserName, launchOptions),
                  id
                );
              }
              if (url2.searchParams.has("debug-controller")) {
                return new PlaywrightConnection(
                  controllerSemaphore,
                  new WebSocketServerTransport(ws4),
                  true,
                  this._playwright,
                  async () => {
                    throw new Error("shouldnt be used");
                  },
                  id
                );
              }
              return new PlaywrightConnection(
                reuseBrowserSemaphore,
                new WebSocketServerTransport(ws4),
                false,
                this._playwright,
                () => this._initReuseBrowsersMode(browserName, launchOptions, id),
                id
              );
            }
            if (this._options.mode === "launchServer" || this._options.mode === "launchServerShared") {
              if (this._options.preLaunchedBrowser) {
                return new PlaywrightConnection(
                  browserSemaphore,
                  new WebSocketServerTransport(ws4),
                  false,
                  this._playwright,
                  () => this._initPreLaunchedBrowserMode(id),
                  id
                );
              }
              return new PlaywrightConnection(
                browserSemaphore,
                new WebSocketServerTransport(ws4),
                false,
                this._playwright,
                () => this._initPreLaunchedAndroidMode(id),
                id
              );
            }
            return new PlaywrightConnection(
              browserSemaphore,
              new WebSocketServerTransport(ws4),
              false,
              this._playwright,
              () => this._initLaunchBrowserMode(browserName, proxyValue, launchOptions, id),
              id
            );
          }
        });
      }
      async _initReuseBrowsersMode(browserName, launchOptions, id) {
        debugLogger.log("server", `[${id}] engaged reuse browsers mode for ${browserName}`);
        const requestedOptions = launchOptionsHash(launchOptions);
        let browser = this._playwright.allBrowsers().find((b) => {
          if (b.options.name !== browserName)
            return false;
          if (this._dontReuseBrowsers.has(b))
            return false;
          const existingOptions = launchOptionsHash({ ...b.options.originalLaunchOptions, timeout: DEFAULT_PLAYWRIGHT_LAUNCH_TIMEOUT });
          return existingOptions === requestedOptions;
        });
        for (const b of this._playwright.allBrowsers()) {
          if (b === browser)
            continue;
          if (this._dontReuseBrowsers.has(b))
            continue;
          if (b.options.name === browserName && b.options.channel === launchOptions.channel)
            await b.close(nullProgress, { reason: "Connection terminated" });
        }
        if (!browser) {
          const browserType = this._playwright[browserName || "chromium"];
          const controller = new ProgressController();
          browser = await controller.run((progress2) => browserType.launch(progress2, {
            ...launchOptions,
            headless: !!process.env.PW_DEBUG_CONTROLLER_HEADLESS
          }), launchOptions.timeout);
        }
        return {
          preLaunchedBrowser: browser,
          denyLaunch: true,
          dispose: async () => {
            for (const context2 of browser.contexts()) {
              if (!context2.pages().length)
                await context2.close(nullProgress, { reason: "Connection terminated" });
            }
          }
        };
      }
      async _initConnectMode(id, filter, browserName, launchOptions) {
        browserName ??= "chromium";
        debugLogger.log("server", `[${id}] engaged connect mode`);
        let browser = this._playwright.allBrowsers().find((b) => b.options.name === browserName);
        if (!browser) {
          const browserType = this._playwright[browserName];
          const controller = new ProgressController();
          browser = await controller.run((progress2) => browserType.launch(progress2, launchOptions), launchOptions.timeout);
          this._dontReuse(browser);
        }
        return {
          preLaunchedBrowser: browser,
          denyLaunch: true,
          sharedBrowser: true
        };
      }
      async _initPreLaunchedBrowserMode(id) {
        debugLogger.log("server", `[${id}] engaged pre-launched (browser) mode`);
        const browser = this._options.preLaunchedBrowser;
        for (const b of this._playwright.allBrowsers()) {
          if (b !== browser)
            await b.close(nullProgress, { reason: "Connection terminated" });
        }
        return {
          preLaunchedBrowser: browser,
          socksProxy: this._options.preLaunchedSocksProxy,
          sharedBrowser: this._options.mode === "launchServerShared",
          denyLaunch: true
        };
      }
      async _initPreLaunchedAndroidMode(id) {
        debugLogger.log("server", `[${id}] engaged pre-launched (Android) mode`);
        const androidDevice = this._options.preLaunchedAndroidDevice;
        return {
          preLaunchedAndroidDevice: androidDevice,
          denyLaunch: true
        };
      }
      async _initLaunchBrowserMode(browserName, proxyValue, launchOptions, id) {
        debugLogger.log("server", `[${id}] engaged launch mode for "${browserName}"`);
        let socksProxy;
        if (proxyValue) {
          socksProxy = new SocksProxy();
          socksProxy.setPattern(proxyValue);
          launchOptions.socksProxyPort = await socksProxy.listen(0);
          debugLogger.log("server", `[${id}] started socks proxy on port ${launchOptions.socksProxyPort}`);
        } else {
          launchOptions.socksProxyPort = void 0;
        }
        const browserType = this._playwright[browserName];
        const controller = new ProgressController();
        const browser = await controller.run((progress2) => browserType.launch(progress2, launchOptions), launchOptions.timeout);
        this._dontReuseBrowsers.add(browser);
        return {
          preLaunchedBrowser: browser,
          socksProxy,
          denyLaunch: true,
          dispose: async () => {
            await browser.close(nullProgress, { reason: "Connection terminated" });
            socksProxy?.close();
          }
        };
      }
      _dontReuse(browser) {
        this._dontReuseBrowsers.add(browser);
        browser.on(Browser.Events.Disconnected, () => {
          this._dontReuseBrowsers.delete(browser);
        });
      }
      async listen(port = 0, hostname) {
        return this._wsServer.listen(port, hostname, this._options.path);
      }
      async close() {
        await this._wsServer.close();
        for (const browser of this._playwright.allBrowsers())
          await browser.close(nullProgress, { reason: "Server closed" });
      }
    };
    defaultLaunchOptions = {
      ignoreAllDefaultArgs: false,
      handleSIGINT: false,
      handleSIGTERM: false,
      handleSIGHUP: false,
      headless: true
    };
    optionsThatAllowBrowserReuse = [
      "headless",
      "timeout",
      "tracesDir",
      "artifactsDir"
    ];
  }
});

// packages/playwright-core/src/androidServerImpl.ts
var import_events16, AndroidServerLauncherImpl;
var init_androidServerImpl = __esm({
  "packages/playwright-core/src/androidServerImpl.ts"() {
    "use strict";
    import_events16 = __toESM(require("events"));
    init_crypto();
    init_playwrightServer();
    init_playwright();
    init_progress();
    AndroidServerLauncherImpl = class {
      async launchServer(options = {}) {
        const playwright2 = createPlaywright({ sdkLanguage: "javascript", isServer: true });
        const controller = new ProgressController();
        let devices = await controller.run((progress2) => playwright2.android.devices(progress2, {
          host: options.adbHost,
          port: options.adbPort,
          omitDriverInstall: options.omitDriverInstall
        }));
        if (devices.length === 0)
          throw new Error("No devices found");
        if (options.deviceSerialNumber) {
          devices = devices.filter((d) => d.serial === options.deviceSerialNumber);
          if (devices.length === 0)
            throw new Error(`No device with serial number '${options.deviceSerialNumber}' was found`);
        }
        if (devices.length > 1)
          throw new Error(`More than one device found. Please specify deviceSerialNumber`);
        const device = devices[0];
        const path59 = options.wsPath ? options.wsPath.startsWith("/") ? options.wsPath : `/${options.wsPath}` : `/${createGuid()}`;
        const server = new PlaywrightServer({ mode: "launchServer", path: path59, maxConnections: 1, preLaunchedAndroidDevice: device });
        const wsEndpoint = await server.listen(options.port, options.host);
        const browserServer = new import_events16.default();
        browserServer.wsEndpoint = () => wsEndpoint;
        browserServer.close = () => device.close(nullProgress);
        browserServer.kill = () => device.close(nullProgress);
        device.on("close", () => {
          server.close();
          browserServer.emit("close");
        });
        return browserServer;
      }
    };
  }
});

// packages/playwright-core/src/browserServerImpl.ts
function toProtocolLogger(logger) {
  return logger ? (direction, message) => {
    if (logger.isEnabled("protocol", "verbose"))
      logger.log("protocol", "verbose", (direction === "send" ? "SEND \u25BA " : "\u25C0 RECV ") + JSON.stringify(message), [], {});
  } : void 0;
}
function envObjectToArray(env) {
  const result2 = [];
  for (const name in env) {
    if (!Object.is(env[name], void 0))
      result2.push({ name, value: String(env[name]) });
  }
  return result2;
}
var import_events17, BrowserServerLauncherImpl;
var init_browserServerImpl = __esm({
  "packages/playwright-core/src/browserServerImpl.ts"() {
    "use strict";
    import_events17 = __toESM(require("events"));
    init_crypto();
    init_debug();
    init_stackTrace();
    init_time();
    init_playwrightServer();
    init_helper();
    init_playwright();
    init_validatorPrimitives();
    init_progress();
    BrowserServerLauncherImpl = class {
      constructor(browserName) {
        this._browserName = browserName;
      }
      async launchServer(options = {}) {
        const playwright2 = createPlaywright({ sdkLanguage: "javascript", isServer: true });
        const metadata = { id: "", startTime: 0, endTime: 0, type: "Internal", method: "", params: {}, log: [], internal: true };
        const validatorContext = {
          tChannelImpl: (names, arg, path60) => {
            throw new ValidationError(`${path60}: channels are not expected in launchServer`);
          },
          binary: "buffer",
          isUnderTest
        };
        let launchOptions = {
          ...options,
          ignoreDefaultArgs: Array.isArray(options.ignoreDefaultArgs) ? options.ignoreDefaultArgs : void 0,
          ignoreAllDefaultArgs: !!options.ignoreDefaultArgs && !Array.isArray(options.ignoreDefaultArgs),
          env: options.env ? envObjectToArray(options.env) : void 0,
          timeout: options.timeout ?? DEFAULT_PLAYWRIGHT_LAUNCH_TIMEOUT
        };
        let browser;
        try {
          const controller = new ProgressController(metadata);
          browser = await controller.run(async (progress2) => {
            if (options._userDataDir !== void 0) {
              const validator = scheme["BrowserTypeLaunchPersistentContextParams"];
              launchOptions = validator({ ...launchOptions, userDataDir: options._userDataDir }, "", validatorContext);
              const context2 = await playwright2[this._browserName].launchPersistentContext(progress2, options._userDataDir, launchOptions);
              return context2._browser;
            } else {
              const validator = scheme["BrowserTypeLaunchParams"];
              launchOptions = validator(launchOptions, "", validatorContext);
              return await playwright2[this._browserName].launch(progress2, launchOptions, toProtocolLogger(options.logger));
            }
          });
        } catch (e) {
          const log2 = helper.formatBrowserLogs(metadata.log);
          rewriteErrorMessage(e, `${e.message} Failed to launch browser.${log2}`);
          throw e;
        }
        const path59 = options.wsPath ? options.wsPath.startsWith("/") ? options.wsPath : `/${options.wsPath}` : `/${createGuid()}`;
        const server = new PlaywrightServer({ mode: options._sharedBrowser ? "launchServerShared" : "launchServer", path: path59, maxConnections: Infinity, preLaunchedBrowser: browser });
        const wsEndpoint = await server.listen(options.port, options.host);
        const browserServer = new import_events17.default();
        browserServer.process = () => browser.options.browserProcess.process;
        browserServer.wsEndpoint = () => wsEndpoint;
        browserServer.close = () => browser.options.browserProcess.close();
        browserServer[Symbol.asyncDispose] = browserServer.close;
        browserServer.kill = () => browser.options.browserProcess.kill();
        browserServer._disconnectForTest = () => server.close();
        browserServer._userDataDirForTest = browser._userDataDirForTest;
        browser.options.browserProcess.onclose = (exitCode, signal) => {
          server.close();
          browserServer.emit("close", exitCode, signal);
        };
        return browserServer;
      }
    };
  }
});

// packages/playwright-core/src/client/clientStackTrace.ts
function captureLibraryStackTrace(platform) {
  const stack = captureRawStack();
  let parsedFrames = stack.map((line) => {
    const frame = parseStackFrame(line, platform.pathSeparator, platform.showInternalStackFrames());
    if (!frame || !frame.file)
      return null;
    const isPlaywrightLibrary = !!platform.coreDir && frame.file.startsWith(platform.coreDir);
    const parsed = {
      frame,
      frameText: line,
      isPlaywrightLibrary
    };
    return parsed;
  }).filter(Boolean);
  let apiName = "";
  for (let i = 0; i < parsedFrames.length - 1; i++) {
    const parsedFrame = parsedFrames[i];
    if (parsedFrame.isPlaywrightLibrary && !parsedFrames[i + 1].isPlaywrightLibrary) {
      apiName = apiName || normalizeAPIName(parsedFrame.frame.function);
      break;
    }
  }
  function normalizeAPIName(name) {
    if (!name)
      return "";
    const match = name.match(/(API|JS|CDP|[A-Z])([^\d]+)\d?\.(.*)/);
    if (!match)
      return name;
    return match[1].toLowerCase() + match[2] + "." + match[3];
  }
  const filterPrefixes = platform.boxedStackPrefixes();
  parsedFrames = parsedFrames.filter((f) => {
    if (filterPrefixes.some((prefix) => f.frame.file.startsWith(prefix)))
      return false;
    return true;
  });
  return {
    frames: parsedFrames.map((p) => p.frame),
    apiName
  };
}
var init_clientStackTrace = __esm({
  "packages/playwright-core/src/client/clientStackTrace.ts"() {
    "use strict";
    init_stackTrace();
  }
});

// packages/playwright-core/src/client/channelOwner.ts
function logApiCall(platform, logger, message) {
  if (logger && logger.isEnabled("api", "info"))
    logger.log("api", "info", message, [], { color: "cyan" });
  platform.log("api", message);
}
function tChannelImplToWire(names, arg, path59, context2) {
  if (arg._object instanceof ChannelOwner && (names === "*" || names.includes(arg._object._type)))
    return { guid: arg._object._guid };
  throw new ValidationError(`${path59}: expected channel ${names.toString()}`);
}
var ChannelOwner;
var init_channelOwner = __esm({
  "packages/playwright-core/src/client/channelOwner.ts"() {
    "use strict";
    init_protocolMetainfo();
    init_stackTrace();
    init_eventEmitter();
    init_validator();
    init_clientStackTrace();
    ChannelOwner = class _ChannelOwner extends EventEmitter3 {
      constructor(parent, type3, guid, initializer) {
        const connection = parent instanceof _ChannelOwner ? parent._connection : parent;
        super(connection._platform);
        this._objects = /* @__PURE__ */ new Map();
        this._eventToSubscriptionMapping = /* @__PURE__ */ new Map();
        this._wasCollected = false;
        this.setMaxListeners(0);
        this._connection = connection;
        this._type = type3;
        this._guid = guid;
        this._parent = parent instanceof _ChannelOwner ? parent : void 0;
        this._instrumentation = this._connection._instrumentation;
        this._connection._objects.set(guid, this);
        if (this._parent) {
          this._parent._objects.set(guid, this);
          this._logger = this._parent._logger;
        }
        this._channel = this._createChannel(new EventEmitter3(connection._platform));
        this._initializer = initializer;
      }
      _setEventToSubscriptionMapping(mapping) {
        this._eventToSubscriptionMapping = mapping;
      }
      _updateSubscription(event, enabled) {
        const protocolEvent = this._eventToSubscriptionMapping.get(String(event));
        if (protocolEvent)
          this._channel.updateSubscription({ event: protocolEvent, enabled }).catch(() => {
          });
      }
      on(event, listener) {
        if (!this.listenerCount(event))
          this._updateSubscription(event, true);
        super.on(event, listener);
        return this;
      }
      addListener(event, listener) {
        if (!this.listenerCount(event))
          this._updateSubscription(event, true);
        super.addListener(event, listener);
        return this;
      }
      prependListener(event, listener) {
        if (!this.listenerCount(event))
          this._updateSubscription(event, true);
        super.prependListener(event, listener);
        return this;
      }
      off(event, listener) {
        super.off(event, listener);
        if (!this.listenerCount(event))
          this._updateSubscription(event, false);
        return this;
      }
      removeListener(event, listener) {
        super.removeListener(event, listener);
        if (!this.listenerCount(event))
          this._updateSubscription(event, false);
        return this;
      }
      _adopt(child) {
        child._parent._objects.delete(child._guid);
        this._objects.set(child._guid, child);
        child._parent = this;
      }
      _dispose(reason) {
        if (this._parent)
          this._parent._objects.delete(this._guid);
        this._connection._objects.delete(this._guid);
        this._wasCollected = reason === "gc";
        for (const object of [...this._objects.values()])
          object._dispose(reason);
        this._objects.clear();
      }
      _debugScopeState() {
        return {
          _guid: this._guid,
          objects: Array.from(this._objects.values()).map((o) => o._debugScopeState())
        };
      }
      _validatorToWireContext() {
        return {
          tChannelImpl: tChannelImplToWire,
          binary: this._connection.rawBuffers() ? "buffer" : "toBase64",
          isUnderTest: () => this._platform.isUnderTest()
        };
      }
      _createChannel(base) {
        const channel = new Proxy(base, {
          get: (obj, prop) => {
            if (typeof prop === "string") {
              const validator = maybeFindValidator(this._type, prop, "Params");
              const { internal } = getMetainfo({ type: this._type, method: prop }) || {};
              if (validator) {
                return async (params2) => {
                  return await this._wrapApiCall(async (apiZone) => {
                    const validatedParams = validator(params2, "", this._validatorToWireContext());
                    if (!apiZone.internal && !apiZone.reported) {
                      apiZone.reported = true;
                      this._instrumentation.onApiCallBegin(apiZone, { type: this._type, method: prop, params: params2 });
                      logApiCall(this._platform, this._logger, `=> ${apiZone.apiName} started`);
                      return await this._connection.sendMessageToServer(this, prop, validatedParams, apiZone);
                    }
                    return await this._connection.sendMessageToServer(this, prop, validatedParams, { internal: true });
                  }, { internal });
                };
              }
            }
            return obj[prop];
          }
        });
        channel._object = this;
        return channel;
      }
      async _wrapApiCall(func, options) {
        const logger = this._logger;
        const existingApiZone = this._platform.zones.current().data();
        if (existingApiZone)
          return await func(existingApiZone);
        const stackTrace = captureLibraryStackTrace(this._platform);
        const apiZone = { title: options?.title, apiName: stackTrace.apiName, frames: stackTrace.frames, internal: options?.internal ?? false, reported: false, userData: void 0, stepId: void 0 };
        try {
          const result2 = await this._platform.zones.current().push(apiZone).run(async () => await func(apiZone));
          if (!options?.internal) {
            logApiCall(this._platform, logger, `<= ${apiZone.apiName} succeeded`);
            this._instrumentation.onApiCallEnd(apiZone);
          }
          return result2;
        } catch (e) {
          const innerError = (this._platform.showInternalStackFrames() || this._platform.isUnderTest()) && e.stack ? "\n<inner error>\n" + e.stack : "";
          if (apiZone.apiName && !apiZone.apiName.includes("<anonymous>"))
            e.message = apiZone.apiName + ": " + e.message;
          const stackFrames = "\n" + stringifyStackFrames(stackTrace.frames).join("\n") + innerError;
          if (stackFrames.trim())
            e.stack = e.message + stackFrames;
          else
            e.stack = "";
          if (!options?.internal) {
            apiZone.error = e;
            logApiCall(this._platform, logger, `<= ${apiZone.apiName} failed`);
            this._instrumentation.onApiCallEnd(apiZone);
          }
          throw e;
        }
      }
      toJSON() {
        return {
          _type: this._type,
          _guid: this._guid
        };
      }
    };
  }
});

// packages/playwright-core/src/client/cdpSession.ts
var CDPSession2;
var init_cdpSession = __esm({
  "packages/playwright-core/src/client/cdpSession.ts"() {
    "use strict";
    init_channelOwner();
    CDPSession2 = class extends ChannelOwner {
      static from(cdpSession) {
        return cdpSession._object;
      }
      constructor(parent, type3, guid, initializer) {
        super(parent, type3, guid, initializer);
        this._channel.on("event", (event) => {
          this.emit(event.method, event.params);
          this.emit("event", event);
        });
        this._channel.on("close", () => {
          this.emit("close", this);
        });
        this.on = super.on;
        this.addListener = super.addListener;
        this.off = super.removeListener;
        this.removeListener = super.removeListener;
        this.once = super.once;
      }
      async send(method, params2) {
        const result2 = await this._channel.send({ method, params: params2 });
        return result2.result;
      }
      async detach() {
        return await this._channel.detach();
      }
    };
  }
});

// packages/playwright-core/src/client/clientHelper.ts
function envObjectToArray2(env) {
  const result2 = [];
  for (const name in env) {
    if (!Object.is(env[name], void 0))
      result2.push({ name, value: String(env[name]) });
  }
  return result2;
}
async function evaluationScript(platform, fun, arg, addSourceUrl = true) {
  if (typeof fun === "function") {
    const source11 = fun.toString();
    const argString = Object.is(arg, void 0) ? "undefined" : JSON.stringify(arg);
    return `(${source11})(${argString})`;
  }
  if (arg !== void 0)
    throw new Error("Cannot evaluate a string with arguments");
  if (isString(fun))
    return fun;
  if (fun.content !== void 0)
    return fun.content;
  if (fun.path !== void 0) {
    let source11 = await platform.fs().promises.readFile(fun.path, "utf8");
    if (addSourceUrl)
      source11 = addSourceUrlToScript(source11, fun.path);
    return source11;
  }
  throw new Error("Either path or content property must be present");
}
function addSourceUrlToScript(source11, path59) {
  return `${source11}
//# sourceURL=${path59.replace(/\n/g, "")}`;
}
var init_clientHelper = __esm({
  "packages/playwright-core/src/client/clientHelper.ts"() {
    "use strict";
    init_rtti();
  }
});

// packages/playwright-core/src/client/clock.ts
function parseTime2(time) {
  if (typeof time === "number")
    return { timeNumber: time };
  if (typeof time === "string")
    return { timeString: time };
  if (!isFinite(time.getTime()))
    throw new Error(`Invalid date: ${time}`);
  return { timeNumber: time.getTime() };
}
function parseTicks2(ticks) {
  return {
    ticksNumber: typeof ticks === "number" ? ticks : void 0,
    ticksString: typeof ticks === "string" ? ticks : void 0
  };
}
var Clock2;
var init_clock2 = __esm({
  "packages/playwright-core/src/client/clock.ts"() {
    "use strict";
    Clock2 = class {
      constructor(browserContext) {
        this._browserContext = browserContext;
      }
      async install(options = {}) {
        await this._browserContext._channel.clockInstall(options.time !== void 0 ? parseTime2(options.time) : {});
      }
      async fastForward(ticks) {
        await this._browserContext._channel.clockFastForward(parseTicks2(ticks));
      }
      async pauseAt(time) {
        await this._browserContext._channel.clockPauseAt(parseTime2(time));
      }
      async resume() {
        await this._browserContext._channel.clockResume({});
      }
      async runFor(ticks) {
        await this._browserContext._channel.clockRunFor(parseTicks2(ticks));
      }
      async setFixedTime(time) {
        await this._browserContext._channel.clockSetFixedTime(parseTime2(time));
      }
      async setSystemTime(time) {
        await this._browserContext._channel.clockSetSystemTime(parseTime2(time));
      }
    };
  }
});

// packages/playwright-core/src/client/errors.ts
function isTargetClosedError2(error) {
  return error instanceof TargetClosedError2;
}
function serializeError2(e) {
  if (isError(e))
    return { error: { message: e.message, stack: e.stack, name: e.name } };
  return { value: serializeValue(e, (value2) => ({ fallThrough: value2 })) };
}
function parseError2(error) {
  if (!error.error) {
    if (error.value === void 0)
      throw new Error("Serialized error must have either an error or a value");
    return parseSerializedValue(error.value, void 0);
  }
  let e;
  if (error.error.name === "TimeoutError")
    e = new TimeoutError2(error.error.message);
  else if (error.error.name === "TargetClosedError")
    e = new TargetClosedError2(error.error.message);
  else
    e = Object.assign(new PlaywrightError(error.error.message), { name: error.error.name });
  e.stack = error.error.stack || "";
  return e;
}
var PlaywrightError, TimeoutError2, TargetClosedError2;
var init_errors2 = __esm({
  "packages/playwright-core/src/client/errors.ts"() {
    "use strict";
    init_rtti();
    init_serializers();
    PlaywrightError = class extends Error {
      constructor() {
        super(...arguments);
        this.log = [];
      }
      // As declared in the protocol.
    };
    TimeoutError2 = class extends PlaywrightError {
      constructor(message) {
        super(message);
        this.name = "TimeoutError";
      }
    };
    TargetClosedError2 = class extends PlaywrightError {
      constructor(cause) {
        super(cause || "Target page, context or browser has been closed");
      }
    };
  }
});

// packages/playwright-core/src/client/jsHandle.ts
function serializeArgument(arg) {
  const handles = [];
  const pushHandle = (channel) => {
    handles.push(channel);
    return handles.length - 1;
  };
  const value2 = serializeValue(arg, (value3) => {
    if (value3 instanceof JSHandle2)
      return { h: pushHandle(value3._channel) };
    return { fallThrough: value3 };
  });
  return { value: value2, handles };
}
function parseResult(value2) {
  return parseSerializedValue(value2, void 0);
}
function assertMaxArguments(count, max) {
  if (count > max)
    throw new Error("Too many arguments. If you need to pass more than 1 argument to the function wrap them in an object.");
}
var JSHandle2;
var init_jsHandle = __esm({
  "packages/playwright-core/src/client/jsHandle.ts"() {
    "use strict";
    init_channelOwner();
    init_errors2();
    init_serializers();
    JSHandle2 = class _JSHandle extends ChannelOwner {
      static from(handle) {
        return handle._object;
      }
      constructor(parent, type3, guid, initializer) {
        super(parent, type3, guid, initializer);
        this._preview = this._initializer.preview;
        this._channel.on("previewUpdated", ({ preview }) => this._preview = preview);
      }
      async evaluate(pageFunction, arg) {
        const result2 = await this._channel.evaluateExpression({ expression: String(pageFunction), isFunction: typeof pageFunction === "function", arg: serializeArgument(arg) });
        return parseResult(result2.value);
      }
      async evaluateHandle(pageFunction, arg) {
        const result2 = await this._channel.evaluateExpressionHandle({ expression: String(pageFunction), isFunction: typeof pageFunction === "function", arg: serializeArgument(arg) });
        return _JSHandle.from(result2.handle);
      }
      async getProperty(propertyName) {
        const result2 = await this._channel.getProperty({ name: propertyName });
        return _JSHandle.from(result2.handle);
      }
      async getProperties() {
        const map = /* @__PURE__ */ new Map();
        for (const { name, value: value2 } of (await this._channel.getPropertyList()).properties)
          map.set(name, _JSHandle.from(value2));
        return map;
      }
      async jsonValue() {
        return parseResult((await this._channel.jsonValue()).value);
      }
      asElement() {
        return null;
      }
      async [Symbol.asyncDispose]() {
        await this.dispose();
      }
      async dispose() {
        try {
          await this._channel.dispose();
        } catch (e) {
          if (isTargetClosedError2(e))
            return;
          throw e;
        }
      }
      toString() {
        return this._preview;
      }
    };
  }
});

// packages/playwright-core/src/client/consoleMessage.ts
var ConsoleMessage2;
var init_consoleMessage = __esm({
  "packages/playwright-core/src/client/consoleMessage.ts"() {
    "use strict";
    init_jsHandle();
    ConsoleMessage2 = class {
      constructor(platform, event, page, worker) {
        this._page = page;
        this._worker = worker;
        this._event = event;
        if (platform.inspectCustom)
          this[platform.inspectCustom] = () => this._inspect();
      }
      worker() {
        return this._worker;
      }
      page() {
        return this._page;
      }
      type() {
        return this._event.type;
      }
      text() {
        return this._event.text;
      }
      args() {
        return this._event.args.map(JSHandle2.from);
      }
      location() {
        const { url: url2, lineNumber, columnNumber } = this._event.location;
        return { url: url2, line: lineNumber, column: columnNumber, lineNumber, columnNumber };
      }
      timestamp() {
        return this._event.timestamp;
      }
      _inspect() {
        return this.text();
      }
    };
  }
});

// packages/playwright-core/src/client/credentials.ts
var Credentials2;
var init_credentials2 = __esm({
  "packages/playwright-core/src/client/credentials.ts"() {
    "use strict";
    Credentials2 = class {
      constructor(browserContext) {
        this._browserContext = browserContext;
      }
      async install() {
        await this._browserContext._channel.credentialsInstall({});
      }
      async create(rpId, options = {}) {
        const { credential } = await this._browserContext._channel.credentialsCreate({ ...options, rpId });
        return credential;
      }
      async get(options = {}) {
        const { credentials } = await this._browserContext._channel.credentialsGet(options);
        return credentials;
      }
      async delete(id) {
        await this._browserContext._channel.credentialsDelete({ id });
      }
    };
  }
});

// packages/playwright-core/src/client/events.ts
var Events;
var init_events = __esm({
  "packages/playwright-core/src/client/events.ts"() {
    "use strict";
    Events = {
      AndroidDevice: {
        WebView: "webview",
        Close: "close"
      },
      AndroidSocket: {
        Data: "data",
        Close: "close"
      },
      AndroidWebView: {
        Close: "close"
      },
      Browser: {
        Context: "context",
        Disconnected: "disconnected"
      },
      Debugger: {
        PausedStateChanged: "pausedstatechanged"
      },
      BrowserContext: {
        Console: "console",
        Close: "close",
        Dialog: "dialog",
        Download: "download",
        FrameAttached: "frameattached",
        FrameDetached: "framedetached",
        FrameNavigated: "framenavigated",
        Page: "page",
        PageClose: "pageclose",
        PageLoad: "pageload",
        // Can't use just 'error' due to node.js special treatment of error events.
        // @see https://nodejs.org/api/events.html#events_error_events
        WebError: "weberror",
        BackgroundPage: "backgroundpage",
        // Deprecated in v1.56, never emitted anymore.
        ServiceWorker: "serviceworker",
        Request: "request",
        Response: "response",
        RequestFailed: "requestfailed",
        RequestFinished: "requestfinished"
      },
      BrowserServer: {
        Close: "close"
      },
      Page: {
        Close: "close",
        Crash: "crash",
        Console: "console",
        Dialog: "dialog",
        Download: "download",
        FileChooser: "filechooser",
        DOMContentLoaded: "domcontentloaded",
        // Can't use just 'error' due to node.js special treatment of error events.
        // @see https://nodejs.org/api/events.html#events_error_events
        PageError: "pageerror",
        Request: "request",
        Response: "response",
        RequestFailed: "requestfailed",
        RequestFinished: "requestfinished",
        FrameAttached: "frameattached",
        FrameDetached: "framedetached",
        FrameNavigated: "framenavigated",
        Load: "load",
        Popup: "popup",
        WebSocket: "websocket",
        Worker: "worker"
      },
      WebSocket: {
        Close: "close",
        Error: "socketerror",
        FrameReceived: "framereceived",
        FrameSent: "framesent"
      },
      Worker: {
        Close: "close",
        Console: "console"
      },
      ElectronApplication: {
        Close: "close",
        Console: "console",
        Window: "window"
      }
    };
  }
});

// packages/playwright-core/src/client/debugger.ts
var Debugger2;
var init_debugger2 = __esm({
  "packages/playwright-core/src/client/debugger.ts"() {
    "use strict";
    init_channelOwner();
    init_events();
    Debugger2 = class extends ChannelOwner {
      constructor(parent, type3, guid, initializer) {
        super(parent, type3, guid, initializer);
        this._pausedDetails = null;
        this._channel.on("pausedStateChanged", ({ pausedDetails }) => {
          this._pausedDetails = pausedDetails ?? null;
          this.emit(Events.Debugger.PausedStateChanged);
        });
      }
      static from(channel) {
        return channel._object;
      }
      async requestPause() {
        await this._channel.requestPause();
      }
      async resume() {
        await this._channel.resume();
      }
      async next() {
        await this._channel.next();
      }
      async runTo(location2) {
        await this._channel.runTo({ location: location2 });
      }
      pausedDetails() {
        return this._pausedDetails;
      }
    };
  }
});

// packages/playwright-core/src/client/stream.ts
var Stream;
var init_stream = __esm({
  "packages/playwright-core/src/client/stream.ts"() {
    "use strict";
    init_channelOwner();
    Stream = class extends ChannelOwner {
      static from(Stream2) {
        return Stream2._object;
      }
      constructor(parent, type3, guid, initializer) {
        super(parent, type3, guid, initializer);
      }
      stream() {
        return this._platform.streamReadable(this._channel);
      }
    };
  }
});

// packages/playwright-core/src/client/fileUtils.ts
async function mkdirIfNeeded2(platform, filePath) {
  await platform.fs().promises.mkdir(platform.path().dirname(filePath), { recursive: true }).catch(() => {
  });
}
var fileUploadSizeLimit2;
var init_fileUtils2 = __esm({
  "packages/playwright-core/src/client/fileUtils.ts"() {
    "use strict";
    fileUploadSizeLimit2 = 50 * 1024 * 1024;
  }
});

// packages/playwright-core/src/client/artifact.ts
var Artifact2;
var init_artifact2 = __esm({
  "packages/playwright-core/src/client/artifact.ts"() {
    "use strict";
    init_channelOwner();
    init_stream();
    init_fileUtils2();
    Artifact2 = class extends ChannelOwner {
      static from(channel) {
        return channel._object;
      }
      async pathAfterFinished() {
        if (this._connection.isRemote())
          throw new Error(`Path is not available when connecting remotely. Use saveAs() to save a local copy.`);
        return (await this._channel.pathAfterFinished()).value;
      }
      async saveAs(path59) {
        if (!this._connection.isRemote()) {
          await this._channel.saveAs({ path: path59 });
          return;
        }
        const result2 = await this._channel.saveAsStream();
        const stream3 = Stream.from(result2.stream);
        await mkdirIfNeeded2(this._platform, path59);
        await new Promise((resolve, reject) => {
          stream3.stream().pipe(this._platform.fs().createWriteStream(path59)).on("finish", resolve).on("error", reject);
        });
      }
      async failure() {
        return (await this._channel.failure()).error || null;
      }
      async createReadStream() {
        const result2 = await this._channel.stream();
        const stream3 = Stream.from(result2.stream);
        return stream3.stream();
      }
      async readIntoBuffer() {
        const stream3 = await this.createReadStream();
        return await new Promise((resolve, reject) => {
          const chunks = [];
          stream3.on("data", (chunk) => {
            chunks.push(chunk);
          });
          stream3.on("end", () => {
            resolve(Buffer.concat(chunks));
          });
          stream3.on("error", reject);
        });
      }
      async cancel() {
        return await this._channel.cancel();
      }
      async delete() {
        return await this._channel.delete();
      }
    };
  }
});

// packages/playwright-core/src/client/coverage.ts
var Coverage;
var init_coverage = __esm({
  "packages/playwright-core/src/client/coverage.ts"() {
    "use strict";
    Coverage = class {
      constructor(channel) {
        this._channel = channel;
      }
      async startJSCoverage(options = {}) {
        await this._channel.startJSCoverage(options);
      }
      async stopJSCoverage() {
        return (await this._channel.stopJSCoverage()).entries;
      }
      async startCSSCoverage(options = {}) {
        await this._channel.startCSSCoverage(options);
      }
      async stopCSSCoverage() {
        return (await this._channel.stopCSSCoverage()).entries;
      }
    };
  }
});

// packages/playwright-core/src/client/disposable.ts
var DisposableObject2, DisposableStub;
var init_disposable3 = __esm({
  "packages/playwright-core/src/client/disposable.ts"() {
    "use strict";
    init_channelOwner();
    init_errors2();
    DisposableObject2 = class extends ChannelOwner {
      static from(channel) {
        return channel._object;
      }
      async [Symbol.asyncDispose]() {
        await this.dispose();
      }
      async dispose() {
        try {
          await this._channel.dispose();
        } catch (e) {
          if (isTargetClosedError2(e))
            return;
          throw e;
        }
      }
    };
    DisposableStub = class {
      constructor(dispose) {
        this._dispose = dispose;
      }
      async [Symbol.asyncDispose]() {
        await this.dispose();
      }
      async dispose() {
        if (!this._dispose)
          return;
        try {
          const dispose = this._dispose;
          this._dispose = void 0;
          await dispose();
        } catch (e) {
          if (isTargetClosedError2(e))
            return;
          throw e;
        }
      }
    };
  }
});

// packages/playwright-core/src/client/download.ts
var Download2;
var init_download2 = __esm({
  "packages/playwright-core/src/client/download.ts"() {
    "use strict";
    Download2 = class {
      constructor(page, url2, suggestedFilename, artifact) {
        this._page = page;
        this._url = url2;
        this._suggestedFilename = suggestedFilename;
        this._artifact = artifact;
      }
      page() {
        return this._page;
      }
      url() {
        return this._url;
      }
      suggestedFilename() {
        return this._suggestedFilename;
      }
      async path() {
        return await this._artifact.pathAfterFinished();
      }
      async saveAs(path59) {
        return await this._artifact.saveAs(path59);
      }
      async failure() {
        return await this._artifact.failure();
      }
      async createReadStream() {
        return await this._artifact.createReadStream();
      }
      async cancel() {
        return await this._artifact.cancel();
      }
      async delete() {
        return await this._artifact.delete();
      }
    };
  }
});

// packages/playwright-core/src/client/locator.ts
function testIdAttributeName() {
  return _testIdAttributeName;
}
function setTestIdAttribute(attributeName) {
  _testIdAttributeName = attributeName;
}
function cssObjectToString(style) {
  return Object.entries(style).map(([key, value2]) => {
    const property = key.startsWith("--") ? key : key.replace(/[A-Z]/g, (m) => "-" + m.toLowerCase());
    return `${property}: ${value2}`;
  }).join("; ");
}
var Locator, FrameLocator, _testIdAttributeName;
var init_locator = __esm({
  "packages/playwright-core/src/client/locator.ts"() {
    "use strict";
    init_locatorGenerators();
    init_locatorUtils();
    init_stringUtils();
    init_rtti();
    init_time();
    init_elementHandle();
    init_disposable3();
    Locator = class _Locator {
      constructor(frame, selector, options) {
        this._apiName = "Locator";
        this._frame = frame;
        this._selector = selector;
        if (options?.hasText)
          this._selector += ` >> internal:has-text=${escapeForTextSelector(options.hasText, false)}`;
        if (options?.hasNotText)
          this._selector += ` >> internal:has-not-text=${escapeForTextSelector(options.hasNotText, false)}`;
        if (options?.has) {
          const locator2 = options.has;
          if (locator2._frame !== frame)
            throw new Error(`Inner "has" locator must belong to the same frame.`);
          this._selector += ` >> internal:has=` + JSON.stringify(locator2._selector);
        }
        if (options?.hasNot) {
          const locator2 = options.hasNot;
          if (locator2._frame !== frame)
            throw new Error(`Inner "hasNot" locator must belong to the same frame.`);
          this._selector += ` >> internal:has-not=` + JSON.stringify(locator2._selector);
        }
        if (options?.visible !== void 0)
          this._selector += ` >> visible=${options.visible ? "true" : "false"}`;
        if (this._frame._platform.inspectCustom)
          this[this._frame._platform.inspectCustom] = () => this._inspect();
      }
      async _withElement(task, options) {
        const timeout = this._frame._timeout({ timeout: options.timeout });
        const deadline = timeout ? monotonicTime() + timeout : 0;
        return await this._frame._wrapApiCall(async () => {
          const result2 = await this._frame._channel.waitForSelector({ selector: this._selector, strict: true, state: "attached", timeout });
          const handle = ElementHandle2.fromNullable(result2.element);
          if (!handle)
            throw new Error(`Could not resolve ${this._selector} to DOM Element`);
          try {
            return await task(handle, deadline ? deadline - monotonicTime() : 0);
          } finally {
            await handle.dispose();
          }
        }, { title: options.title, internal: options.internal });
      }
      _equals(locator2) {
        return this._frame === locator2._frame && this._selector === locator2._selector;
      }
      page() {
        return this._frame.page();
      }
      async boundingBox(options) {
        return await this._withElement((h) => h.boundingBox(), { title: "Bounding box", timeout: options?.timeout });
      }
      async check(options = {}) {
        return await this._frame.check(this._selector, { strict: true, ...options });
      }
      async click(options = {}) {
        return await this._frame.click(this._selector, { strict: true, ...options });
      }
      async dblclick(options = {}) {
        await this._frame.dblclick(this._selector, { strict: true, ...options });
      }
      async dispatchEvent(type3, eventInit = {}, options) {
        return await this._frame.dispatchEvent(this._selector, type3, eventInit, { strict: true, ...options });
      }
      async dragTo(target, options = {}) {
        return await this._frame.dragAndDrop(this._selector, target._selector, {
          strict: true,
          ...options
        });
      }
      async drop(payload, options = {}) {
        await this._frame._drop(this._selector, payload, { strict: true, ...options });
      }
      async evaluate(pageFunction, arg, options) {
        return await this._withElement((h) => h.evaluate(pageFunction, arg), { title: "Evaluate", timeout: options?.timeout });
      }
      async evaluateAll(pageFunction, arg) {
        return await this._frame.$$eval(this._selector, pageFunction, arg);
      }
      async evaluateHandle(pageFunction, arg, options) {
        return await this._withElement((h) => h.evaluateHandle(pageFunction, arg), { title: "Evaluate", timeout: options?.timeout });
      }
      async fill(value2, options = {}) {
        return await this._frame.fill(this._selector, value2, { strict: true, ...options });
      }
      async clear(options = {}) {
        await this._frame._wrapApiCall(() => this.fill("", options), { title: "Clear" });
      }
      async _highlight() {
        return await this._frame._highlight(this._selector);
      }
      async highlight(options = {}) {
        const style = typeof options.style === "object" ? cssObjectToString(options.style) : options.style;
        await this._frame._highlight(this._selector, style);
        return new DisposableStub(() => this.hideHighlight());
      }
      async hideHighlight() {
        await this._frame._hideHighlight(this._selector);
      }
      locator(selectorOrLocator, options) {
        if (isString(selectorOrLocator))
          return new _Locator(this._frame, this._selector + " >> " + selectorOrLocator, options);
        if (selectorOrLocator._frame !== this._frame)
          throw new Error(`Locators must belong to the same frame.`);
        return new _Locator(this._frame, this._selector + " >> internal:chain=" + JSON.stringify(selectorOrLocator._selector), options);
      }
      getByTestId(testId) {
        return this.locator(getByTestIdSelector(testIdAttributeName(), testId));
      }
      getByAltText(text2, options) {
        return this.locator(getByAltTextSelector(text2, options));
      }
      getByLabel(text2, options) {
        return this.locator(getByLabelSelector(text2, options));
      }
      getByPlaceholder(text2, options) {
        return this.locator(getByPlaceholderSelector(text2, options));
      }
      getByText(text2, options) {
        return this.locator(getByTextSelector(text2, options));
      }
      getByTitle(text2, options) {
        return this.locator(getByTitleSelector(text2, options));
      }
      getByRole(role, options = {}) {
        return this.locator(getByRoleSelector(role, options));
      }
      frameLocator(selector) {
        return new FrameLocator(this._frame, this._selector + " >> " + selector);
      }
      filter(options) {
        return new _Locator(this._frame, this._selector, options);
      }
      async elementHandle(options) {
        return await this._frame.waitForSelector(this._selector, { strict: true, state: "attached", ...options });
      }
      async elementHandles() {
        return await this._frame.$$(this._selector);
      }
      contentFrame() {
        return new FrameLocator(this._frame, this._selector);
      }
      describe(description) {
        return new _Locator(this._frame, this._selector + " >> internal:describe=" + JSON.stringify(description));
      }
      description() {
        return locatorCustomDescription(this._selector) || null;
      }
      first() {
        return new _Locator(this._frame, this._selector + " >> nth=0");
      }
      last() {
        return new _Locator(this._frame, this._selector + ` >> nth=-1`);
      }
      nth(index) {
        return new _Locator(this._frame, this._selector + ` >> nth=${index}`);
      }
      and(locator2) {
        if (locator2._frame !== this._frame)
          throw new Error(`Locators must belong to the same frame.`);
        return new _Locator(this._frame, this._selector + ` >> internal:and=` + JSON.stringify(locator2._selector));
      }
      or(locator2) {
        if (locator2._frame !== this._frame)
          throw new Error(`Locators must belong to the same frame.`);
        return new _Locator(this._frame, this._selector + ` >> internal:or=` + JSON.stringify(locator2._selector));
      }
      async focus(options) {
        return await this._frame.focus(this._selector, { strict: true, ...options });
      }
      async blur(options) {
        await this._frame._channel.blur({ selector: this._selector, strict: true, ...options, timeout: this._frame._timeout(options) });
      }
      // options are only here for testing
      async count(_options) {
        return await this._frame._queryCount(this._selector, _options);
      }
      async normalize() {
        const { resolvedSelector } = await this._frame._channel.resolveSelector({ selector: this._selector });
        return new _Locator(this._frame, resolvedSelector);
      }
      async getAttribute(name, options) {
        return await this._frame.getAttribute(this._selector, name, { strict: true, ...options });
      }
      async hover(options = {}) {
        return await this._frame.hover(this._selector, { strict: true, ...options });
      }
      async innerHTML(options) {
        return await this._frame.innerHTML(this._selector, { strict: true, ...options });
      }
      async innerText(options) {
        return await this._frame.innerText(this._selector, { strict: true, ...options });
      }
      async inputValue(options) {
        return await this._frame.inputValue(this._selector, { strict: true, ...options });
      }
      async isChecked(options) {
        return await this._frame.isChecked(this._selector, { strict: true, ...options });
      }
      async isDisabled(options) {
        return await this._frame.isDisabled(this._selector, { strict: true, ...options });
      }
      async isEditable(options) {
        return await this._frame.isEditable(this._selector, { strict: true, ...options });
      }
      async isEnabled(options) {
        return await this._frame.isEnabled(this._selector, { strict: true, ...options });
      }
      async isHidden(options) {
        return await this._frame.isHidden(this._selector, { strict: true, ...options });
      }
      async isVisible(options) {
        return await this._frame.isVisible(this._selector, { strict: true, ...options });
      }
      async press(key, options = {}) {
        return await this._frame.press(this._selector, key, { strict: true, ...options });
      }
      async screenshot(options = {}) {
        const mask = options.mask;
        return await this._withElement((h, timeout) => h.screenshot({ ...options, mask, timeout }), { title: "Screenshot", timeout: options.timeout });
      }
      async ariaSnapshot(options = {}) {
        const result2 = await this._frame._channel.ariaSnapshot({ timeout: this._frame._timeout(options), mode: options.mode, selector: this._selector, depth: options.depth, boxes: options.boxes });
        return result2.snapshot;
      }
      async scrollIntoViewIfNeeded(options = {}) {
        return await this._withElement((h, timeout) => h.scrollIntoViewIfNeeded({ ...options, timeout }), { title: "Scroll into view", timeout: options.timeout });
      }
      async selectOption(values, options = {}) {
        return await this._frame.selectOption(this._selector, values, { strict: true, ...options });
      }
      async selectText(options = {}) {
        return await this._withElement((h, timeout) => h.selectText({ ...options, timeout }), { title: "Select text", timeout: options.timeout });
      }
      async setChecked(checked, options) {
        if (checked)
          await this.check(options);
        else
          await this.uncheck(options);
      }
      async setInputFiles(files, options = {}) {
        return await this._frame.setInputFiles(this._selector, files, { strict: true, ...options });
      }
      async tap(options = {}) {
        return await this._frame.tap(this._selector, { strict: true, ...options });
      }
      async textContent(options) {
        return await this._frame.textContent(this._selector, { strict: true, ...options });
      }
      async type(text2, options = {}) {
        return await this._frame.type(this._selector, text2, { strict: true, ...options });
      }
      async pressSequentially(text2, options = {}) {
        return await this.type(text2, options);
      }
      async uncheck(options = {}) {
        return await this._frame.uncheck(this._selector, { strict: true, ...options });
      }
      async all() {
        return new Array(await this.count()).fill(0).map((e, i) => this.nth(i));
      }
      async allInnerTexts() {
        return await this._frame.$$eval(this._selector, (ee) => ee.map((e) => e.innerText));
      }
      async allTextContents() {
        return await this._frame.$$eval(this._selector, (ee) => ee.map((e) => e.textContent || ""));
      }
      async waitFor(options) {
        await this._frame._channel.waitForSelector({ selector: this._selector, strict: true, omitReturnValue: true, ...options, timeout: this._frame._timeout(options) });
      }
      async _expect(expression2, options) {
        return this._frame._expect(expression2, {
          ...options,
          selector: this._selector
        });
      }
      _inspect() {
        return this.toString();
      }
      toString() {
        return asLocatorDescription("javascript", this._selector);
      }
    };
    FrameLocator = class _FrameLocator {
      constructor(frame, selector) {
        this._frame = frame;
        this._frameSelector = selector;
      }
      locator(selectorOrLocator, options) {
        if (isString(selectorOrLocator))
          return new Locator(this._frame, this._frameSelector + " >> internal:control=enter-frame >> " + selectorOrLocator, options);
        if (selectorOrLocator._frame !== this._frame)
          throw new Error(`Locators must belong to the same frame.`);
        return new Locator(this._frame, this._frameSelector + " >> internal:control=enter-frame >> " + selectorOrLocator._selector, options);
      }
      getByTestId(testId) {
        return this.locator(getByTestIdSelector(testIdAttributeName(), testId));
      }
      getByAltText(text2, options) {
        return this.locator(getByAltTextSelector(text2, options));
      }
      getByLabel(text2, options) {
        return this.locator(getByLabelSelector(text2, options));
      }
      getByPlaceholder(text2, options) {
        return this.locator(getByPlaceholderSelector(text2, options));
      }
      getByText(text2, options) {
        return this.locator(getByTextSelector(text2, options));
      }
      getByTitle(text2, options) {
        return this.locator(getByTitleSelector(text2, options));
      }
      getByRole(role, options = {}) {
        return this.locator(getByRoleSelector(role, options));
      }
      owner() {
        return new Locator(this._frame, this._frameSelector);
      }
      frameLocator(selector) {
        return new _FrameLocator(this._frame, this._frameSelector + " >> internal:control=enter-frame >> " + selector);
      }
      first() {
        return new _FrameLocator(this._frame, this._frameSelector + " >> nth=0");
      }
      last() {
        return new _FrameLocator(this._frame, this._frameSelector + ` >> nth=-1`);
      }
      nth(index) {
        return new _FrameLocator(this._frame, this._frameSelector + ` >> nth=${index}`);
      }
    };
    _testIdAttributeName = "data-testid";
  }
});

// packages/playwright-core/src/client/timeoutSettings.ts
var TimeoutSettings;
var init_timeoutSettings = __esm({
  "packages/playwright-core/src/client/timeoutSettings.ts"() {
    "use strict";
    init_time();
    TimeoutSettings = class {
      constructor(platform, parent) {
        this._parent = parent;
        this._platform = platform;
      }
      setDefaultTimeout(timeout) {
        this._defaultTimeout = timeout;
      }
      setDefaultNavigationTimeout(timeout) {
        this._defaultNavigationTimeout = timeout;
      }
      defaultNavigationTimeout() {
        return this._defaultNavigationTimeout;
      }
      defaultTimeout() {
        return this._defaultTimeout;
      }
      navigationTimeout(options) {
        if (typeof options.timeout === "number")
          return options.timeout;
        if (this._defaultNavigationTimeout !== void 0)
          return this._defaultNavigationTimeout;
        if (this._platform.isDebugMode())
          return 0;
        if (this._defaultTimeout !== void 0)
          return this._defaultTimeout;
        if (this._parent)
          return this._parent.navigationTimeout(options);
        return DEFAULT_PLAYWRIGHT_TIMEOUT;
      }
      timeout(options) {
        if (typeof options.timeout === "number")
          return options.timeout;
        if (this._platform.isDebugMode())
          return 0;
        if (this._defaultTimeout !== void 0)
          return this._defaultTimeout;
        if (this._parent)
          return this._parent.timeout(options);
        return DEFAULT_PLAYWRIGHT_TIMEOUT;
      }
      launchTimeout(options) {
        if (typeof options.timeout === "number")
          return options.timeout;
        if (this._platform.isDebugMode())
          return 0;
        if (this._parent)
          return this._parent.launchTimeout(options);
        return DEFAULT_PLAYWRIGHT_LAUNCH_TIMEOUT;
      }
    };
  }
});

// packages/playwright-core/src/client/waiter.ts
function waitForEvent(emitter, event, savedZone, predicate) {
  let listener;
  const promise = new Promise((resolve, reject) => {
    listener = async (eventArg) => {
      await savedZone.run(async () => {
        try {
          if (predicate && !await predicate(eventArg))
            return;
          emitter.removeListener(event, listener);
          resolve(eventArg);
        } catch (e) {
          emitter.removeListener(event, listener);
          reject(e);
        }
      });
    };
    emitter.addListener(event, listener);
  });
  const dispose = () => emitter.removeListener(event, listener);
  return { promise, dispose };
}
function waitForTimeout(timeout) {
  let timeoutId;
  const promise = new Promise((resolve) => timeoutId = setTimeout(resolve, timeout));
  const dispose = () => clearTimeout(timeoutId);
  return { promise, dispose };
}
function formatLogRecording(log2) {
  if (!log2.length)
    return "";
  const header = ` logs `;
  const headerLength = 60;
  const leftLength = (headerLength - header.length) / 2;
  const rightLength = headerLength - header.length - leftLength;
  return `
${"=".repeat(leftLength)}${header}${"=".repeat(rightLength)}
${log2.join("\n")}
${"=".repeat(headerLength)}`;
}
var Waiter;
var init_waiter = __esm({
  "packages/playwright-core/src/client/waiter.ts"() {
    "use strict";
    init_stackTrace();
    init_errors2();
    Waiter = class _Waiter {
      constructor(channelOwner, event) {
        this._failures = [];
        this._logs = [];
        this._waitId = channelOwner._platform.createGuid();
        this._channelOwner = channelOwner;
        this._savedZone = channelOwner._platform.zones.current().pop();
        const title = `Wait for event "${event}"`;
        this._sendWaitInfo({ waitId: this._waitId, phase: "before", event }, { title });
        this._dispose = [
          () => this._sendWaitInfo({ waitId: this._waitId, phase: "after", error: this._error }, { internal: true })
        ];
      }
      static createForEvent(channelOwner, event) {
        return new _Waiter(channelOwner, event);
      }
      _sendWaitInfo(info, options) {
        const owner = this._channelOwner;
        owner._wrapApiCall(async (apiZone) => {
          if (apiZone.internal || apiZone.reported) {
            void owner._connection.sendMessageToServer(owner, "__waitInfo__", info, { internal: true });
            return;
          }
          apiZone.reported = true;
          if (!apiZone.title)
            apiZone.title = options.title;
          owner._instrumentation.onApiCallBegin(apiZone, { type: owner._type, method: "__waitInfo__", params: info });
          void owner._connection.sendMessageToServer(owner, "__waitInfo__", info, apiZone);
        }, options).catch(() => {
        });
      }
      async waitForEvent(emitter, event, predicate) {
        const { promise, dispose } = waitForEvent(emitter, event, this._savedZone, predicate);
        return await this.waitForPromise(promise, dispose);
      }
      rejectOnEvent(emitter, event, error, predicate) {
        const { promise, dispose } = waitForEvent(emitter, event, this._savedZone, predicate);
        this._rejectOn(promise.then(() => {
          throw typeof error === "function" ? error() : error;
        }), dispose);
      }
      rejectOnTimeout(timeout, message) {
        if (!timeout)
          return;
        const { promise, dispose } = waitForTimeout(timeout);
        this._rejectOn(promise.then(() => {
          throw new TimeoutError2(message);
        }), dispose);
      }
      rejectImmediately(error) {
        this._immediateError = error;
      }
      dispose() {
        for (const dispose of this._dispose)
          dispose();
      }
      async waitForPromise(promise, dispose) {
        try {
          if (this._immediateError)
            throw this._immediateError;
          const result2 = await Promise.race([promise, ...this._failures]);
          if (dispose)
            dispose();
          return result2;
        } catch (e) {
          if (dispose)
            dispose();
          this._error = e.message;
          this.dispose();
          rewriteErrorMessage(e, e.message + formatLogRecording(this._logs));
          throw e;
        }
      }
      log(s) {
        this._logs.push(s);
        this._sendWaitInfo({ waitId: this._waitId, phase: "log", message: s }, { internal: true });
      }
      _rejectOn(promise, dispose) {
        this._failures.push(promise);
        if (dispose)
          this._dispose.push(dispose);
      }
    };
  }
});

// packages/playwright-core/src/client/worker.ts
var Worker2;
var init_worker = __esm({
  "packages/playwright-core/src/client/worker.ts"() {
    "use strict";
    init_manualPromise();
    init_channelOwner();
    init_consoleMessage();
    init_errors2();
    init_events();
    init_jsHandle();
    init_timeoutSettings();
    init_waiter();
    Worker2 = class _Worker extends ChannelOwner {
      constructor(parent, type3, guid, initializer) {
        super(parent, type3, guid, initializer);
        // Set for service workers.
        this._closedScope = new LongStandingScope();
        this._setEventToSubscriptionMapping(/* @__PURE__ */ new Map([
          [Events.Worker.Console, "console"]
        ]));
        this._channel.on("console", (event) => {
          this.emit(Events.Worker.Console, new ConsoleMessage2(this._platform, event, null, this));
        });
        this._channel.on("close", () => {
          if (this._page)
            this._page._workers.delete(this);
          if (this._context)
            this._context._serviceWorkers.delete(this);
          this.emit(Events.Worker.Close, this);
        });
        this.once(Events.Worker.Close, () => this._closedScope.close(this._closeErrorWithReason()));
      }
      static fromNullable(worker) {
        return worker ? _Worker.from(worker) : null;
      }
      static from(worker) {
        return worker._object;
      }
      _closeErrorWithReason() {
        if (this._closeReason)
          return new TargetClosedError2(this._closeReason);
        return this._page?._closeErrorWithReason() || new TargetClosedError2();
      }
      url() {
        return this._initializer.url;
      }
      async evaluate(pageFunction, arg) {
        assertMaxArguments(arguments.length, 2);
        const result2 = await this._channel.evaluateExpression({ expression: String(pageFunction), isFunction: typeof pageFunction === "function", arg: serializeArgument(arg) });
        return parseResult(result2.value);
      }
      async evaluateHandle(pageFunction, arg) {
        assertMaxArguments(arguments.length, 2);
        const result2 = await this._channel.evaluateExpressionHandle({ expression: String(pageFunction), isFunction: typeof pageFunction === "function", arg: serializeArgument(arg) });
        return JSHandle2.from(result2.handle);
      }
      async waitForEvent(event, optionsOrPredicate = {}) {
        return await this._wrapApiCall(async () => {
          const timeoutSettings = this._page?._timeoutSettings ?? this._context?._timeoutSettings ?? new TimeoutSettings(this._platform);
          const timeout = timeoutSettings.timeout(typeof optionsOrPredicate === "function" ? {} : optionsOrPredicate);
          const predicate = typeof optionsOrPredicate === "function" ? optionsOrPredicate : optionsOrPredicate.predicate;
          const waiter = Waiter.createForEvent(this, event);
          waiter.rejectOnTimeout(timeout, `Timeout ${timeout}ms exceeded while waiting for event "${event}"`);
          if (event !== Events.Worker.Close)
            waiter.rejectOnEvent(this, Events.Worker.Close, () => this._closeErrorWithReason());
          const result2 = await waiter.waitForEvent(this, event, predicate);
          waiter.dispose();
          return result2;
        });
      }
      async _disconnect(options = {}) {
        this._closeReason = options.reason;
        try {
          await this._channel.disconnect(options);
        } catch (e) {
          if (isTargetClosedError2(e))
            return;
          throw e;
        }
      }
    };
  }
});

// packages/playwright-core/src/client/tracing.ts
var Tracing2;
var init_tracing2 = __esm({
  "packages/playwright-core/src/client/tracing.ts"() {
    "use strict";
    init_rtti();
    init_artifact2();
    init_channelOwner();
    init_disposable3();
    Tracing2 = class extends ChannelOwner {
      constructor(parent, type3, guid, initializer) {
        super(parent, type3, guid, initializer);
        this._includeSources = false;
        this._additionalSources = /* @__PURE__ */ new Set();
        this._isLive = false;
        this._isTracing = false;
        this._harRecorders = /* @__PURE__ */ new Map();
      }
      static from(channel) {
        return channel._object;
      }
      async start(options = {}) {
        await this._wrapApiCall(async () => {
          this._includeSources = !!options.sources;
          this._isLive = !!options.live;
          await this._channel.tracingStart({
            name: options.name,
            snapshots: options.snapshots,
            screenshots: options.screenshots,
            live: options.live
          });
          const { traceName } = await this._channel.tracingStartChunk({ name: options.name, title: options.title });
          await this._startCollectingStacks(traceName, this._isLive);
        });
      }
      async startChunk(options = {}) {
        await this._wrapApiCall(async () => {
          const { traceName } = await this._channel.tracingStartChunk(options);
          await this._startCollectingStacks(traceName, this._isLive);
        });
      }
      async group(name, options = {}) {
        if (options.location)
          this._additionalSources.add(options.location.file);
        await this._channel.tracingGroup({ name, location: options.location });
        return new DisposableStub(() => this.groupEnd());
      }
      async groupEnd() {
        await this._channel.tracingGroupEnd();
      }
      async _startCollectingStacks(traceName, live) {
        if (!this._isTracing) {
          this._isTracing = true;
          this._connection.setIsTracing(true);
        }
        const result2 = await this._connection.localUtils()?.tracingStarted({ tracesDir: this._tracesDir, traceName, live });
        this._stacksId = result2?.stacksId;
      }
      async stopChunk(options = {}) {
        await this._wrapApiCall(async () => {
          await this._doStopChunk(options.path);
        });
      }
      async stop(options = {}) {
        await this._wrapApiCall(async () => {
          await this._doStopChunk(options.path);
          await this._channel.tracingStop();
        });
      }
      async startHar(path59, options = {}) {
        await this._wrapApiCall(async () => {
          if (this._harId)
            throw new Error("HAR recording has already been started");
          if (options.resourcesDir && path59.endsWith(".zip"))
            throw new Error("resourcesDir option is not compatible with a .zip har file");
          const defaultContent = path59.endsWith(".zip") ? "attach" : "embed";
          this._harId = await this._recordIntoHAR(path59, null, {
            url: options.urlFilter,
            updateContent: options.content ?? defaultContent,
            updateMode: options.mode ?? "full",
            resourcesDir: options.resourcesDir
          });
        });
        return new DisposableStub(() => this.stopHar());
      }
      async stopHar() {
        await this._wrapApiCall(async () => {
          const harId = this._harId;
          if (!harId)
            throw new Error("HAR recording has not been started");
          this._harId = void 0;
          await this._exportHAR(harId);
        });
      }
      async _recordIntoHAR(har, page, options = {}) {
        const isZip = har.endsWith(".zip");
        const { harId } = await this._channel.harStart({
          page: page?._channel,
          options: {
            content: options.updateContent ?? "attach",
            urlGlob: isString(options.url) ? options.url : void 0,
            urlRegexSource: isRegExp(options.url) ? options.url.source : void 0,
            urlRegexFlags: isRegExp(options.url) ? options.url.flags : void 0,
            mode: options.updateMode ?? "minimal",
            harPath: isZip ? void 0 : har,
            resourcesDir: options.resourcesDir
          }
        });
        this._harRecorders.set(harId, { path: har, resourcesDir: options.resourcesDir });
        return harId;
      }
      async _exportHAR(harId) {
        const harParams = this._harRecorders.get(harId);
        if (!harParams)
          return;
        this._harRecorders.delete(harId);
        const isLocal = !this._connection.isRemote();
        const isZip = harParams.path.endsWith(".zip");
        if (isLocal) {
          const { entries } = await this._channel.harExport({ harId, mode: "entries" });
          if (!isZip) {
            return;
          }
          const localUtils2 = this._connection.localUtils();
          if (!localUtils2)
            throw new Error("Cannot save zipped HAR in thin clients");
          await localUtils2.zip({ zipFile: harParams.path, entries, mode: "write", includeSources: false, additionalSources: [] });
          return;
        }
        const { artifact: artifactChannel } = await this._channel.harExport({ harId, mode: "archive" });
        const artifact = Artifact2.from(artifactChannel);
        if (isZip) {
          await artifact.saveAs(harParams.path);
          await artifact.delete();
          return;
        }
        const localUtils = this._connection.localUtils();
        if (!localUtils)
          throw new Error("Uncompressed har is not supported in thin clients");
        await artifact.saveAs(harParams.path + ".tmp");
        await localUtils.harUnzip({ zipFile: harParams.path + ".tmp", harFile: harParams.path, resourcesDir: harParams.resourcesDir });
        await artifact.delete();
      }
      async _exportAllHars() {
        await this._wrapApiCall(async () => {
          await Promise.all([...this._harRecorders.keys()].map((harId) => this._exportHAR(harId)));
        }, { internal: true });
      }
      async _doStopChunk(filePath) {
        this._resetStackCounter();
        const additionalSources = [...this._additionalSources];
        this._additionalSources.clear();
        if (!filePath) {
          await this._channel.tracingStopChunk({ mode: "discard" });
          if (this._stacksId)
            await this._connection.localUtils().traceDiscarded({ stacksId: this._stacksId });
          return;
        }
        const localUtils = this._connection.localUtils();
        if (!localUtils)
          throw new Error("Cannot save trace in thin clients");
        const isLocal = !this._connection.isRemote();
        if (isLocal) {
          const result3 = await this._channel.tracingStopChunk({ mode: "entries" });
          await localUtils.zip({ zipFile: filePath, entries: result3.entries, mode: "write", stacksId: this._stacksId, includeSources: this._includeSources, additionalSources });
          return;
        }
        const result2 = await this._channel.tracingStopChunk({ mode: "archive" });
        if (!result2.artifact) {
          if (this._stacksId)
            await localUtils.traceDiscarded({ stacksId: this._stacksId });
          return;
        }
        const artifact = Artifact2.from(result2.artifact);
        await artifact.saveAs(filePath);
        await artifact.delete();
        await localUtils.zip({ zipFile: filePath, entries: [], mode: "append", stacksId: this._stacksId, includeSources: this._includeSources, additionalSources });
      }
      _resetStackCounter() {
        if (this._isTracing) {
          this._isTracing = false;
          this._connection.setIsTracing(false);
        }
      }
    };
  }
});

// packages/playwright-core/src/client/fetch.ts
async function toFormField(platform, name, value2) {
  const typeOfValue = typeof value2;
  if (isFilePayload(value2)) {
    const payload = value2;
    if (!Buffer.isBuffer(payload.buffer))
      throw new Error(`Unexpected buffer type of 'data.${name}'`);
    return { name, file: filePayloadToJson(payload) };
  } else if (typeOfValue === "string" || typeOfValue === "number" || typeOfValue === "boolean") {
    return { name, value: String(value2) };
  } else {
    return { name, file: await readStreamToJson(platform, value2) };
  }
}
function isJsonParsable(value2) {
  if (typeof value2 !== "string")
    return false;
  try {
    JSON.parse(value2);
    return true;
  } catch (e) {
    if (e instanceof SyntaxError)
      return false;
    else
      throw e;
  }
}
function filePayloadToJson(payload) {
  return {
    name: payload.name,
    mimeType: payload.mimeType,
    buffer: payload.buffer
  };
}
async function readStreamToJson(platform, stream3) {
  const buffer = await new Promise((resolve, reject) => {
    const chunks = [];
    stream3.on("data", (chunk) => chunks.push(chunk));
    stream3.on("end", () => resolve(Buffer.concat(chunks)));
    stream3.on("error", (err) => reject(err));
  });
  const streamPath = Buffer.isBuffer(stream3.path) ? stream3.path.toString("utf8") : stream3.path;
  return {
    name: platform.path().basename(streamPath),
    buffer
  };
}
function isJsonContentType(headers) {
  if (!headers)
    return false;
  for (const { name, value: value2 } of headers) {
    if (name.toLocaleLowerCase() === "content-type")
      return value2 === "application/json";
  }
  return false;
}
function objectToArray(map) {
  if (!map)
    return void 0;
  const result2 = [];
  for (const [name, value2] of Object.entries(map)) {
    if (value2 !== void 0)
      result2.push({ name, value: String(value2) });
  }
  return result2;
}
function isFilePayload(value2) {
  return typeof value2 === "object" && value2["name"] && value2["mimeType"] && value2["buffer"];
}
var APIRequest, APIRequestContext2, APIResponse;
var init_fetch2 = __esm({
  "packages/playwright-core/src/client/fetch.ts"() {
    "use strict";
    init_assert();
    init_headers();
    init_rtti();
    init_browserContext2();
    init_channelOwner();
    init_errors2();
    init_network3();
    init_tracing2();
    init_fileUtils2();
    init_timeoutSettings();
    APIRequest = class {
      constructor(playwright2) {
        this._contexts = /* @__PURE__ */ new Set();
        this._playwright = playwright2;
      }
      async newContext(options = {}) {
        options = { ...options };
        await this._playwright._instrumentation.runBeforeCreateRequestContext(options);
        const storageState2 = typeof options.storageState === "string" ? JSON.parse(await this._playwright._platform.fs().promises.readFile(options.storageState, "utf8")) : options.storageState;
        const context2 = APIRequestContext2.from((await this._playwright._channel.newRequest({
          ...options,
          extraHTTPHeaders: options.extraHTTPHeaders ? headersObjectToArray(options.extraHTTPHeaders) : void 0,
          storageState: storageState2,
          tracesDir: this._playwright._defaultLaunchOptions?.tracesDir,
          // We do not expose tracesDir in the API, so do not allow options to accidentally override it.
          clientCertificates: await toClientCertificatesProtocol(this._playwright._platform, options.clientCertificates)
        })).request);
        this._contexts.add(context2);
        context2._request = this;
        context2._timeoutSettings.setDefaultTimeout(options.timeout ?? this._playwright._defaultContextTimeout);
        context2.tracing._tracesDir = this._playwright._defaultLaunchOptions?.tracesDir;
        await context2._instrumentation.runAfterCreateRequestContext(context2);
        return context2;
      }
    };
    APIRequestContext2 = class extends ChannelOwner {
      static from(channel) {
        return channel._object;
      }
      constructor(parent, type3, guid, initializer) {
        super(parent, type3, guid, initializer);
        this.tracing = Tracing2.from(initializer.tracing);
        this._timeoutSettings = new TimeoutSettings(this._platform);
      }
      async [Symbol.asyncDispose]() {
        await this.dispose();
      }
      async dispose(options = {}) {
        this._closeReason = options.reason;
        await this._instrumentation.runBeforeCloseRequestContext(this);
        await this.tracing._exportAllHars();
        try {
          await this._channel.dispose(options);
        } catch (e) {
          if (isTargetClosedError2(e))
            return;
          throw e;
        }
        this.tracing._resetStackCounter();
        this._request?._contexts.delete(this);
      }
      async delete(url2, options) {
        return await this.fetch(url2, {
          ...options,
          method: "DELETE"
        });
      }
      async head(url2, options) {
        return await this.fetch(url2, {
          ...options,
          method: "HEAD"
        });
      }
      async get(url2, options) {
        return await this.fetch(url2, {
          ...options,
          method: "GET"
        });
      }
      async patch(url2, options) {
        return await this.fetch(url2, {
          ...options,
          method: "PATCH"
        });
      }
      async post(url2, options) {
        return await this.fetch(url2, {
          ...options,
          method: "POST"
        });
      }
      async put(url2, options) {
        return await this.fetch(url2, {
          ...options,
          method: "PUT"
        });
      }
      async fetch(urlOrRequest, options = {}) {
        const url2 = isString(urlOrRequest) ? urlOrRequest : void 0;
        const request2 = isString(urlOrRequest) ? void 0 : urlOrRequest;
        return await this._innerFetch({ url: url2, request: request2, ...options });
      }
      async _innerFetch(options = {}) {
        return await this._wrapApiCall(async () => {
          if (this._closeReason)
            throw new TargetClosedError2(this._closeReason);
          assert(options.request || typeof options.url === "string", "First argument must be either URL string or Request");
          assert((options.data === void 0 ? 0 : 1) + (options.form === void 0 ? 0 : 1) + (options.multipart === void 0 ? 0 : 1) <= 1, `Only one of 'data', 'form' or 'multipart' can be specified`);
          assert(options.maxRedirects === void 0 || options.maxRedirects >= 0, `'maxRedirects' must be greater than or equal to '0'`);
          assert(options.maxRetries === void 0 || options.maxRetries >= 0, `'maxRetries' must be greater than or equal to '0'`);
          const url2 = options.url !== void 0 ? options.url : options.request.url();
          const method = options.method || options.request?.method();
          let encodedParams = void 0;
          if (typeof options.params === "string")
            encodedParams = options.params;
          else if (options.params instanceof URLSearchParams)
            encodedParams = options.params.toString();
          const headersObj = options.headers || options.request?.headers();
          const headers = headersObj ? headersObjectToArray(headersObj) : void 0;
          let jsonData;
          let formData;
          let multipartData;
          let postDataBuffer;
          if (options.data !== void 0) {
            if (isString(options.data)) {
              if (isJsonContentType(headers))
                jsonData = isJsonParsable(options.data) ? options.data : JSON.stringify(options.data);
              else
                postDataBuffer = Buffer.from(options.data, "utf8");
            } else if (Buffer.isBuffer(options.data)) {
              postDataBuffer = options.data;
            } else if (typeof options.data === "object" || typeof options.data === "number" || typeof options.data === "boolean") {
              jsonData = JSON.stringify(options.data);
            } else {
              throw new Error(`Unexpected 'data' type`);
            }
          } else if (options.form) {
            if (globalThis.FormData && options.form instanceof FormData) {
              formData = [];
              for (const [name, value2] of options.form.entries()) {
                if (typeof value2 !== "string")
                  throw new Error(`Expected string for options.form["${name}"], found File. Please use options.multipart instead.`);
                formData.push({ name, value: value2 });
              }
            } else {
              formData = objectToArray(options.form);
            }
          } else if (options.multipart) {
            multipartData = [];
            if (globalThis.FormData && options.multipart instanceof FormData) {
              const form = options.multipart;
              for (const [name, value2] of form.entries()) {
                if (isString(value2)) {
                  multipartData.push({ name, value: value2 });
                } else {
                  const file = {
                    name: value2.name,
                    mimeType: value2.type,
                    buffer: Buffer.from(await value2.arrayBuffer())
                  };
                  multipartData.push({ name, file });
                }
              }
            } else {
              for (const [name, value2] of Object.entries(options.multipart))
                multipartData.push(await toFormField(this._platform, name, value2));
            }
          }
          if (postDataBuffer === void 0 && jsonData === void 0 && formData === void 0 && multipartData === void 0)
            postDataBuffer = options.request?.postDataBuffer() || void 0;
          const fixtures = {
            __testHookLookup: options.__testHookLookup
          };
          const result2 = await this._channel.fetch({
            url: url2,
            params: typeof options.params === "object" ? objectToArray(options.params) : void 0,
            encodedParams,
            method,
            headers,
            postData: postDataBuffer,
            jsonData,
            formData,
            multipartData,
            timeout: this._timeoutSettings.timeout(options),
            failOnStatusCode: options.failOnStatusCode,
            ignoreHTTPSErrors: options.ignoreHTTPSErrors,
            maxRedirects: options.maxRedirects,
            maxRetries: options.maxRetries,
            ...fixtures
          });
          return new APIResponse(this, result2.response);
        });
      }
      async storageState(options = {}) {
        const state = await this._channel.storageState({ indexedDB: options.indexedDB });
        if (options.path) {
          await mkdirIfNeeded2(this._platform, options.path);
          await this._platform.fs().promises.writeFile(options.path, JSON.stringify(state, void 0, 2), "utf8");
        }
        return state;
      }
    };
    APIResponse = class {
      constructor(context2, initializer) {
        this._apiName = "APIResponse";
        this._request = context2;
        this._initializer = initializer;
        this._headers = new RawHeaders(this._initializer.headers);
        if (context2._platform.inspectCustom)
          this[context2._platform.inspectCustom] = () => this._inspect();
      }
      ok() {
        return this._initializer.status >= 200 && this._initializer.status <= 299;
      }
      url() {
        return this._initializer.url;
      }
      status() {
        return this._initializer.status;
      }
      statusText() {
        return this._initializer.statusText;
      }
      headers() {
        return this._headers.headers();
      }
      headersArray() {
        return this._headers.headersArray();
      }
      async securityDetails() {
        return this._initializer.securityDetails ?? null;
      }
      async serverAddr() {
        return this._initializer.serverAddr ?? null;
      }
      async body() {
        return await this._request._wrapApiCall(async () => {
          try {
            const result2 = await this._request._channel.fetchResponseBody({ fetchUid: this._fetchUid() });
            if (result2.binary === void 0)
              throw new Error("Response has been disposed");
            return result2.binary;
          } catch (e) {
            if (isTargetClosedError2(e))
              throw new Error("Response has been disposed");
            throw e;
          }
        }, { internal: true });
      }
      async text() {
        const content = await this.body();
        return content.toString("utf8");
      }
      async json() {
        const content = await this.text();
        return JSON.parse(content);
      }
      async [Symbol.asyncDispose]() {
        await this.dispose();
      }
      async dispose() {
        await this._request._channel.disposeAPIResponse({ fetchUid: this._fetchUid() });
      }
      _inspect() {
        const headers = this.headersArray().map(({ name, value: value2 }) => `  ${name}: ${value2}`);
        return `APIResponse: ${this.status()} ${this.statusText()}
${headers.join("\n")}`;
      }
      _fetchUid() {
        return this._initializer.fetchUid;
      }
      async _fetchLog() {
        const { log: log2 } = await this._request._channel.fetchLog({ fetchUid: this._fetchUid() });
        return log2;
      }
    };
  }
});

// packages/playwright-core/src/client/network.ts
function validateHeaders(headers) {
  for (const key of Object.keys(headers)) {
    const value2 = headers[key];
    if (!Object.is(value2, void 0) && !isString(value2))
      throw new Error(`Expected value of header "${key}" to be String, but "${typeof value2}" is found.`);
  }
}
var Request2, Route2, WebSocketRoute, WebSocketRouteHandler, Response3, WebSocket2, RouteHandler, RawHeaders;
var init_network3 = __esm({
  "packages/playwright-core/src/client/network.ts"() {
    "use strict";
    init_assert();
    init_headers();
    init_urlMatch();
    init_manualPromise();
    init_multimap();
    init_rtti();
    init_stackTrace();
    init_mimeType();
    init_worker();
    init_waiter();
    init_frame();
    init_fetch2();
    init_events();
    init_errors2();
    init_channelOwner();
    Request2 = class _Request extends ChannelOwner {
      constructor(parent, type3, guid, initializer) {
        super(parent, type3, guid, initializer);
        this._redirectedFrom = null;
        this._redirectedTo = null;
        this._failureText = null;
        this._response = null;
        this._fallbackOverrides = {};
        this._redirectedFrom = _Request.fromNullable(initializer.redirectedFrom);
        if (this._redirectedFrom)
          this._redirectedFrom._redirectedTo = this;
        this._provisionalHeaders = new RawHeaders(initializer.headers);
        this._timing = {
          startTime: 0,
          domainLookupStart: -1,
          domainLookupEnd: -1,
          connectStart: -1,
          secureConnectionStart: -1,
          connectEnd: -1,
          requestStart: -1,
          responseStart: -1,
          responseEnd: -1
        };
      }
      static from(request2) {
        return request2._object;
      }
      static fromNullable(request2) {
        return request2 ? _Request.from(request2) : null;
      }
      url() {
        return this._fallbackOverrides.url || this._initializer.url;
      }
      resourceType() {
        return this._initializer.resourceType;
      }
      method() {
        return this._fallbackOverrides.method || this._initializer.method;
      }
      postData() {
        return (this._fallbackOverrides.postDataBuffer || this._initializer.postData)?.toString("utf-8") || null;
      }
      postDataBuffer() {
        return this._fallbackOverrides.postDataBuffer || this._initializer.postData || null;
      }
      postDataJSON() {
        const postData = this.postData();
        if (!postData)
          return null;
        const contentType = this.headers()["content-type"];
        if (contentType?.includes("application/x-www-form-urlencoded")) {
          const entries = {};
          const parsed = new URLSearchParams(postData);
          for (const [k, v] of parsed.entries())
            entries[k] = v;
          return entries;
        }
        try {
          return JSON.parse(postData);
        } catch (e) {
          throw new Error("POST data is not a valid JSON object: " + postData);
        }
      }
      /**
       * @deprecated
       */
      headers() {
        if (this._fallbackOverrides.headers)
          return RawHeaders._fromHeadersObjectLossy(this._fallbackOverrides.headers).headers();
        return this._provisionalHeaders.headers();
      }
      async _actualHeaders() {
        if (this._fallbackOverrides.headers)
          return RawHeaders._fromHeadersObjectLossy(this._fallbackOverrides.headers);
        if (!this._actualHeadersPromise) {
          this._actualHeadersPromise = this._wrapApiCall(async () => {
            return new RawHeaders((await this._channel.rawRequestHeaders()).headers);
          }, { internal: true });
        }
        return await this._actualHeadersPromise;
      }
      async allHeaders() {
        return (await this._actualHeaders()).headers();
      }
      async headersArray() {
        return (await this._actualHeaders()).headersArray();
      }
      async headerValue(name) {
        return (await this._actualHeaders()).get(name);
      }
      async response() {
        return Response3.fromNullable((await this._channel.response()).response);
      }
      async _internalResponse() {
        return Response3.fromNullable((await this._channel.response()).response);
      }
      existingResponse() {
        return this._response;
      }
      frame() {
        if (!this._initializer.frame) {
          assert(this.serviceWorker());
          throw new Error("Service Worker requests do not have an associated frame.");
        }
        const frame = Frame2.from(this._initializer.frame);
        if (!frame._page) {
          throw new Error([
            "Frame for this navigation request is not available, because the request",
            "was issued before the frame is created. You can check whether the request",
            "is a navigation request by calling isNavigationRequest() method."
          ].join("\n"));
        }
        return frame;
      }
      _safePage() {
        return Frame2.fromNullable(this._initializer.frame)?._page || null;
      }
      serviceWorker() {
        return this._initializer.serviceWorker ? Worker2.from(this._initializer.serviceWorker) : null;
      }
      isNavigationRequest() {
        return this._initializer.isNavigationRequest;
      }
      redirectedFrom() {
        return this._redirectedFrom;
      }
      redirectedTo() {
        return this._redirectedTo;
      }
      failure() {
        if (this._failureText === null)
          return null;
        return {
          errorText: this._failureText
        };
      }
      timing() {
        return this._timing;
      }
      async sizes() {
        const response2 = await this.response();
        if (!response2)
          throw new Error("Unable to fetch sizes for failed request");
        return (await response2._channel.sizes()).sizes;
      }
      _setResponseEndTiming(responseEndTiming) {
        this._timing.responseEnd = responseEndTiming;
        if (this._timing.responseStart === -1)
          this._timing.responseStart = responseEndTiming;
      }
      _finalRequest() {
        return this._redirectedTo ? this._redirectedTo._finalRequest() : this;
      }
      _applyFallbackOverrides(overrides) {
        if (overrides.url)
          this._fallbackOverrides.url = overrides.url;
        if (overrides.method)
          this._fallbackOverrides.method = overrides.method;
        if (overrides.headers)
          this._fallbackOverrides.headers = overrides.headers;
        if (isString(overrides.postData))
          this._fallbackOverrides.postDataBuffer = Buffer.from(overrides.postData, "utf-8");
        else if (overrides.postData instanceof Buffer)
          this._fallbackOverrides.postDataBuffer = overrides.postData;
        else if (overrides.postData)
          this._fallbackOverrides.postDataBuffer = Buffer.from(JSON.stringify(overrides.postData), "utf-8");
      }
      _fallbackOverridesForContinue() {
        return this._fallbackOverrides;
      }
      _targetClosedScope() {
        return this.serviceWorker()?._closedScope || this._safePage()?._closedOrCrashedScope || new LongStandingScope();
      }
    };
    Route2 = class extends ChannelOwner {
      constructor(parent, type3, guid, initializer) {
        super(parent, type3, guid, initializer);
        this._handlingPromise = null;
        this._didThrow = false;
      }
      static from(route2) {
        return route2._object;
      }
      request() {
        return Request2.from(this._initializer.request);
      }
      async _raceWithTargetClose(promise) {
        return await this.request()._targetClosedScope().safeRace(promise);
      }
      async _startHandling() {
        this._handlingPromise = new ManualPromise();
        return await this._handlingPromise;
      }
      async fallback(options = {}) {
        this._checkNotHandled();
        this.request()._applyFallbackOverrides(options);
        this._reportHandled(false);
      }
      async abort(errorCode) {
        await this._handleRoute(async () => {
          await this._raceWithTargetClose(this._channel.abort({ errorCode }));
        });
      }
      async _redirectNavigationRequest(url2) {
        await this._handleRoute(async () => {
          await this._raceWithTargetClose(this._channel.redirectNavigationRequest({ url: url2 }));
        });
      }
      async fetch(options = {}) {
        return await this._wrapApiCall(async () => {
          return await this._context.request._innerFetch({ request: this.request(), data: options.postData, ...options });
        });
      }
      async fulfill(options = {}) {
        await this._handleRoute(async () => {
          await this._innerFulfill(options);
        });
      }
      async _handleRoute(callback) {
        this._checkNotHandled();
        try {
          await callback();
          this._reportHandled(true);
        } catch (e) {
          this._didThrow = true;
          throw e;
        }
      }
      async _innerFulfill(options = {}) {
        let fetchResponseUid;
        let { status: statusOption, headers: headersOption, body } = options;
        if (options.json !== void 0) {
          assert(options.body === void 0, "Can specify either body or json parameters");
          body = JSON.stringify(options.json);
        }
        if (options.response instanceof APIResponse) {
          statusOption ??= options.response.status();
          headersOption ??= options.response.headers();
          if (body === void 0 && options.path === void 0) {
            if (options.response._request._connection === this._connection)
              fetchResponseUid = options.response._fetchUid();
            else
              body = await options.response.body();
          }
        }
        let isBase64 = false;
        let length = 0;
        if (options.path) {
          const buffer = await this._platform.fs().promises.readFile(options.path);
          body = buffer.toString("base64");
          isBase64 = true;
          length = buffer.length;
        } else if (isString(body)) {
          isBase64 = false;
          length = Buffer.byteLength(body);
        } else if (body) {
          length = body.length;
          body = body.toString("base64");
          isBase64 = true;
        }
        const headers = {};
        for (const header of Object.keys(headersOption || {}))
          headers[header.toLowerCase()] = String(headersOption[header]);
        if (options.contentType)
          headers["content-type"] = String(options.contentType);
        else if (options.json)
          headers["content-type"] = "application/json";
        else if (options.path)
          headers["content-type"] = getMimeTypeForPath(options.path) || "application/octet-stream";
        if (length && !("content-length" in headers))
          headers["content-length"] = String(length);
        await this._raceWithTargetClose(this._channel.fulfill({
          status: statusOption || 200,
          headers: headersObjectToArray(headers),
          body,
          isBase64,
          fetchResponseUid
        }));
      }
      async continue(options = {}) {
        await this._handleRoute(async () => {
          this.request()._applyFallbackOverrides(options);
          await this._innerContinue(
            false
            /* isFallback */
          );
        });
      }
      _checkNotHandled() {
        if (!this._handlingPromise)
          throw new Error("Route is already handled!");
      }
      _reportHandled(done) {
        const chain = this._handlingPromise;
        this._handlingPromise = null;
        chain.resolve(done);
      }
      async _innerContinue(isFallback) {
        const options = this.request()._fallbackOverridesForContinue();
        return await this._raceWithTargetClose(this._channel.continue({
          url: options.url,
          method: options.method,
          headers: options.headers ? headersObjectToArray(options.headers) : void 0,
          postData: options.postDataBuffer,
          isFallback
        }));
      }
    };
    WebSocketRoute = class extends ChannelOwner {
      constructor(parent, type3, guid, initializer) {
        super(parent, type3, guid, initializer);
        this._connected = false;
        this._server = {
          onMessage: (handler) => {
            this._onServerMessage = handler;
          },
          onClose: (handler) => {
            this._onServerClose = handler;
          },
          connectToServer: () => {
            throw new Error(`connectToServer must be called on the page-side WebSocketRoute`);
          },
          url: () => {
            return this._initializer.url;
          },
          protocols: () => {
            return [...this._initializer.protocols];
          },
          close: async (options = {}) => {
            await this._channel.closeServer({ ...options, wasClean: true }).catch(() => {
            });
          },
          send: (message) => {
            if (isString(message))
              this._channel.sendToServer({ message, isBase64: false }).catch(() => {
              });
            else
              this._channel.sendToServer({ message: message.toString("base64"), isBase64: true }).catch(() => {
              });
          },
          async [Symbol.asyncDispose]() {
            await this.close();
          }
        };
        this._channel.on("messageFromPage", ({ message, isBase64 }) => {
          if (this._onPageMessage)
            this._onPageMessage(isBase64 ? Buffer.from(message, "base64") : message);
          else if (this._connected)
            this._channel.sendToServer({ message, isBase64 }).catch(() => {
            });
        });
        this._channel.on("messageFromServer", ({ message, isBase64 }) => {
          if (this._onServerMessage)
            this._onServerMessage(isBase64 ? Buffer.from(message, "base64") : message);
          else
            this._channel.sendToPage({ message, isBase64 }).catch(() => {
            });
        });
        this._channel.on("closePage", ({ code, reason, wasClean }) => {
          if (this._onPageClose)
            this._onPageClose(code, reason);
          else
            this._channel.closeServer({ code, reason, wasClean }).catch(() => {
            });
        });
        this._channel.on("closeServer", ({ code, reason, wasClean }) => {
          if (this._onServerClose)
            this._onServerClose(code, reason);
          else
            this._channel.closePage({ code, reason, wasClean }).catch(() => {
            });
        });
      }
      static from(route2) {
        return route2._object;
      }
      url() {
        return this._initializer.url;
      }
      protocols() {
        return [...this._initializer.protocols];
      }
      async close(options = {}) {
        await this._channel.closePage({ ...options, wasClean: true }).catch(() => {
        });
      }
      connectToServer() {
        if (this._connected)
          throw new Error("Already connected to the server");
        this._connected = true;
        this._channel.connect().catch(() => {
        });
        return this._server;
      }
      send(message) {
        if (isString(message))
          this._channel.sendToPage({ message, isBase64: false }).catch(() => {
          });
        else
          this._channel.sendToPage({ message: message.toString("base64"), isBase64: true }).catch(() => {
          });
      }
      onMessage(handler) {
        this._onPageMessage = handler;
      }
      onClose(handler) {
        this._onPageClose = handler;
      }
      async [Symbol.asyncDispose]() {
        await this.close();
      }
      async _afterHandle() {
        if (this._connected)
          return;
        await this._channel.ensureOpened().catch(() => {
        });
      }
    };
    WebSocketRouteHandler = class {
      constructor(baseURL, url2, handler) {
        this._baseURL = baseURL;
        this.url = url2;
        this.handler = handler;
        if (typeof url2 === "string")
          resolveGlobToRegexPattern(baseURL, url2, true);
      }
      static prepareInterceptionPatterns(handlers) {
        const patterns = [];
        let all = false;
        for (const handler of handlers) {
          const serialized = serializeURLMatch(handler.url);
          if (serialized)
            patterns.push(serialized);
          else
            all = true;
        }
        if (all)
          return [{ glob: "**/*" }];
        return patterns;
      }
      matches(wsURL) {
        return urlMatches(this._baseURL, wsURL, this.url, true);
      }
      async handle(webSocketRoute) {
        const handler = this.handler;
        await handler(webSocketRoute);
        await webSocketRoute._afterHandle();
      }
    };
    Response3 = class _Response extends ChannelOwner {
      constructor(parent, type3, guid, initializer) {
        super(parent, type3, guid, initializer);
        this._finishedPromise = new ManualPromise();
        this._provisionalHeaders = new RawHeaders(initializer.headers);
        this._request = Request2.from(this._initializer.request);
        this._request._response = this;
        Object.assign(this._request._timing, this._initializer.timing);
      }
      static from(response2) {
        return response2._object;
      }
      static fromNullable(response2) {
        return response2 ? _Response.from(response2) : null;
      }
      url() {
        return this._initializer.url;
      }
      ok() {
        return this._initializer.status === 0 || this._initializer.status >= 200 && this._initializer.status <= 299;
      }
      status() {
        return this._initializer.status;
      }
      statusText() {
        return this._initializer.statusText;
      }
      fromServiceWorker() {
        return this._initializer.fromServiceWorker;
      }
      /**
       * @deprecated
       */
      headers() {
        return this._provisionalHeaders.headers();
      }
      async _actualHeaders() {
        if (!this._actualHeadersPromise) {
          this._actualHeadersPromise = (async () => {
            return new RawHeaders((await this._channel.rawResponseHeaders()).headers);
          })();
        }
        return await this._actualHeadersPromise;
      }
      async allHeaders() {
        return (await this._actualHeaders()).headers();
      }
      async headersArray() {
        return (await this._actualHeaders()).headersArray().slice();
      }
      async headerValue(name) {
        return (await this._actualHeaders()).get(name);
      }
      async headerValues(name) {
        return (await this._actualHeaders()).getAll(name);
      }
      async finished() {
        return await this.request()._targetClosedScope().race(this._finishedPromise);
      }
      async body() {
        return (await this._channel.body()).binary;
      }
      async text() {
        const content = await this.body();
        return content.toString("utf8");
      }
      async json() {
        const content = await this.text();
        return JSON.parse(content);
      }
      request() {
        return this._request;
      }
      frame() {
        return this._request.frame();
      }
      async serverAddr() {
        return (await this._channel.serverAddr()).value || null;
      }
      async securityDetails() {
        return (await this._channel.securityDetails()).value || null;
      }
      async httpVersion() {
        return (await this._channel.httpVersion()).value;
      }
    };
    WebSocket2 = class extends ChannelOwner {
      static from(webSocket) {
        return webSocket._object;
      }
      constructor(parent, type3, guid, initializer) {
        super(parent, type3, guid, initializer);
        this._isClosed = false;
        this._page = parent;
        this._channel.on("frameSent", (event) => {
          if (event.opcode === 1)
            this.emit(Events.WebSocket.FrameSent, { payload: event.data });
          else if (event.opcode === 2)
            this.emit(Events.WebSocket.FrameSent, { payload: Buffer.from(event.data, "base64") });
        });
        this._channel.on("frameReceived", (event) => {
          if (event.opcode === 1)
            this.emit(Events.WebSocket.FrameReceived, { payload: event.data });
          else if (event.opcode === 2)
            this.emit(Events.WebSocket.FrameReceived, { payload: Buffer.from(event.data, "base64") });
        });
        this._channel.on("socketError", ({ error }) => this.emit(Events.WebSocket.Error, error));
        this._channel.on("close", () => {
          this._isClosed = true;
          this.emit(Events.WebSocket.Close, this);
        });
      }
      url() {
        return this._initializer.url;
      }
      isClosed() {
        return this._isClosed;
      }
      async waitForEvent(event, optionsOrPredicate = {}) {
        return await this._wrapApiCall(async () => {
          const timeout = this._page._timeoutSettings.timeout(typeof optionsOrPredicate === "function" ? {} : optionsOrPredicate);
          const predicate = typeof optionsOrPredicate === "function" ? optionsOrPredicate : optionsOrPredicate.predicate;
          const waiter = Waiter.createForEvent(this, event);
          waiter.rejectOnTimeout(timeout, `Timeout ${timeout}ms exceeded while waiting for event "${event}"`);
          if (event !== Events.WebSocket.Error)
            waiter.rejectOnEvent(this, Events.WebSocket.Error, new Error("Socket error"));
          if (event !== Events.WebSocket.Close)
            waiter.rejectOnEvent(this, Events.WebSocket.Close, new Error("Socket closed"));
          waiter.rejectOnEvent(this._page, Events.Page.Close, () => this._page._closeErrorWithReason());
          const result2 = await waiter.waitForEvent(this, event, predicate);
          waiter.dispose();
          return result2;
        });
      }
    };
    RouteHandler = class {
      constructor(platform, baseURL, url2, handler, times = Number.MAX_SAFE_INTEGER) {
        this.handledCount = 0;
        this._ignoreException = false;
        this._activeInvocations = /* @__PURE__ */ new Set();
        this._baseURL = baseURL;
        this._times = times;
        this.url = url2;
        this.handler = handler;
        this._savedZone = platform.zones.current().pop();
        if (typeof url2 === "string")
          resolveGlobToRegexPattern(baseURL, url2);
      }
      static prepareInterceptionPatterns(handlers) {
        const patterns = [];
        let all = false;
        for (const handler of handlers) {
          const serialized = serializeURLMatch(handler.url);
          if (serialized)
            patterns.push(serialized);
          else
            all = true;
        }
        if (all)
          return [{ glob: "**/*" }];
        return patterns;
      }
      matches(requestURL) {
        return urlMatches(this._baseURL, requestURL, this.url);
      }
      async handle(route2) {
        return await this._savedZone.run(async () => this._handleImpl(route2));
      }
      async _handleImpl(route2) {
        const handlerInvocation = { complete: new ManualPromise(), route: route2 };
        this._activeInvocations.add(handlerInvocation);
        try {
          return await this._handleInternal(route2);
        } catch (e) {
          if (this._ignoreException)
            return false;
          if (isTargetClosedError2(e)) {
            rewriteErrorMessage(e, `"${e.message}" while running route callback.
Consider awaiting \`await page.unrouteAll({ behavior: 'ignoreErrors' })\`
before the end of the test to ignore remaining routes in flight.`);
          }
          throw e;
        } finally {
          handlerInvocation.complete.resolve();
          this._activeInvocations.delete(handlerInvocation);
        }
      }
      async stop(behavior) {
        if (behavior === "ignoreErrors") {
          this._ignoreException = true;
        } else {
          const promises = [];
          for (const activation of this._activeInvocations) {
            if (!activation.route._didThrow)
              promises.push(activation.complete);
          }
          await Promise.all(promises);
        }
      }
      async _handleInternal(route2) {
        ++this.handledCount;
        const handledPromise = route2._startHandling();
        const handler = this.handler;
        const [handled] = await Promise.all([
          handledPromise,
          handler(route2, route2.request())
        ]);
        return handled;
      }
      willExpire() {
        return this.handledCount + 1 >= this._times;
      }
    };
    RawHeaders = class _RawHeaders {
      constructor(headers) {
        this._headersMap = new MultiMap();
        this._headersArray = headers;
        for (const header of headers)
          this._headersMap.set(header.name.toLowerCase(), header.value);
      }
      static _fromHeadersObjectLossy(headers) {
        const headersArray = Object.entries(headers).map(([name, value2]) => ({
          name,
          value: value2
        })).filter((header) => header.value !== void 0);
        return new _RawHeaders(headersArray);
      }
      get(name) {
        const values = this.getAll(name);
        if (!values || !values.length)
          return null;
        return values.join(name.toLowerCase() === "set-cookie" ? "\n" : ", ");
      }
      getAll(name) {
        return [...this._headersMap.get(name.toLowerCase())];
      }
      headers() {
        const result2 = {};
        for (const name of this._headersMap.keys())
          result2[name] = this.get(name);
        return result2;
      }
      headersArray() {
        return this._headersArray;
      }
    };
  }
});

// packages/playwright-core/src/client/types.ts
var kLifecycleEvents2;
var init_types2 = __esm({
  "packages/playwright-core/src/client/types.ts"() {
    "use strict";
    kLifecycleEvents2 = /* @__PURE__ */ new Set(["load", "domcontentloaded", "networkidle", "commit"]);
  }
});

// packages/playwright-core/src/client/frame.ts
function verifyLoadState(name, waitUntil) {
  if (waitUntil === "networkidle0")
    waitUntil = "networkidle";
  if (!kLifecycleEvents2.has(waitUntil))
    throw new Error(`${name}: expected one of (load|domcontentloaded|networkidle|commit)`);
  return waitUntil;
}
var Frame2;
var init_frame = __esm({
  "packages/playwright-core/src/client/frame.ts"() {
    "use strict";
    init_assert();
    init_locatorUtils();
    init_urlMatch();
    init_eventEmitter();
    init_channelOwner();
    init_clientHelper();
    init_elementHandle();
    init_errors2();
    init_events();
    init_jsHandle();
    init_locator();
    init_network3();
    init_types2();
    init_waiter();
    init_timeoutSettings();
    Frame2 = class _Frame extends ChannelOwner {
      constructor(parent, type3, guid, initializer) {
        super(parent, type3, guid, initializer);
        this._parentFrame = null;
        this._url = "";
        this._name = "";
        this._detached = false;
        this._childFrames = /* @__PURE__ */ new Set();
        this._eventEmitter = new EventEmitter3(parent._platform);
        this._eventEmitter.setMaxListeners(0);
        this._parentFrame = _Frame.fromNullable(initializer.parentFrame);
        if (this._parentFrame)
          this._parentFrame._childFrames.add(this);
        this._name = initializer.name;
        this._url = initializer.url;
        this._loadStates = new Set(initializer.loadStates);
        this._channel.on("loadstate", (event) => {
          if (event.add) {
            this._loadStates.add(event.add);
            this._eventEmitter.emit("loadstate", event.add);
          }
          if (event.remove)
            this._loadStates.delete(event.remove);
          if (!this._parentFrame && event.add === "load" && this._page) {
            this._page.emit(Events.Page.Load, this._page);
            this._page.context().emit(Events.BrowserContext.PageLoad, this._page);
          }
          if (!this._parentFrame && event.add === "domcontentloaded" && this._page)
            this._page.emit(Events.Page.DOMContentLoaded, this._page);
        });
        this._channel.on("navigated", (event) => {
          this._url = event.url;
          this._name = event.name;
          this._eventEmitter.emit("navigated", event);
          if (!event.error && this._page) {
            this._page.emit(Events.Page.FrameNavigated, this);
            this._page.context().emit(Events.BrowserContext.FrameNavigated, this);
          }
        });
      }
      static from(frame) {
        return frame._object;
      }
      static fromNullable(frame) {
        return frame ? _Frame.from(frame) : null;
      }
      page() {
        return this._page;
      }
      _timeout(options) {
        const timeoutSettings = this._page?._timeoutSettings || new TimeoutSettings(this._platform);
        return timeoutSettings.timeout(options || {});
      }
      _navigationTimeout(options) {
        const timeoutSettings = this._page?._timeoutSettings || new TimeoutSettings(this._platform);
        return timeoutSettings.navigationTimeout(options || {});
      }
      async goto(url2, options = {}) {
        const waitUntil = verifyLoadState("waitUntil", options.waitUntil === void 0 ? "load" : options.waitUntil);
        return Response3.fromNullable((await this._channel.goto({ url: url2, ...options, waitUntil, timeout: this._navigationTimeout(options) })).response);
      }
      _setupNavigationWaiter(options) {
        const waiter = new Waiter(this._page, "");
        if (this._page.isClosed())
          waiter.rejectImmediately(this._page._closeErrorWithReason());
        waiter.rejectOnEvent(this._page, Events.Page.Close, () => this._page._closeErrorWithReason());
        waiter.rejectOnEvent(this._page, Events.Page.Crash, new Error("Navigation failed because page crashed!"));
        waiter.rejectOnEvent(this._page, Events.Page.FrameDetached, new Error("Navigating frame was detached!"), (frame) => frame === this);
        const timeout = this._page._timeoutSettings.navigationTimeout(options);
        waiter.rejectOnTimeout(timeout, `Timeout ${timeout}ms exceeded.`);
        return waiter;
      }
      async waitForNavigation(options = {}) {
        return await this._page._wrapApiCall(async () => {
          const waitUntil = verifyLoadState("waitUntil", options.waitUntil === void 0 ? "load" : options.waitUntil);
          const waiter = this._setupNavigationWaiter(options);
          const toUrl = typeof options.url === "string" ? ` to "${options.url}"` : "";
          waiter.log(`waiting for navigation${toUrl} until "${waitUntil}"`);
          const navigatedEvent = await waiter.waitForEvent(this._eventEmitter, "navigated", (event) => {
            if (event.error)
              return true;
            waiter.log(`  navigated to "${event.url}"`);
            return urlMatches(this._page?.context()._options.baseURL, event.url, options.url);
          });
          if (navigatedEvent.error) {
            const e = new Error(navigatedEvent.error);
            e.stack = "";
            await waiter.waitForPromise(Promise.reject(e));
          }
          if (!this._loadStates.has(waitUntil)) {
            await waiter.waitForEvent(this._eventEmitter, "loadstate", (s) => {
              waiter.log(`  "${s}" event fired`);
              return s === waitUntil;
            });
          }
          const request2 = navigatedEvent.newDocument ? Request2.fromNullable(navigatedEvent.newDocument.request) : null;
          const response2 = request2 ? await waiter.waitForPromise(request2._finalRequest()._internalResponse()) : null;
          waiter.dispose();
          return response2;
        }, { title: "Wait for navigation" });
      }
      async waitForLoadState(state = "load", options = {}) {
        state = verifyLoadState("state", state);
        return await this._page._wrapApiCall(async () => {
          const waiter = this._setupNavigationWaiter(options);
          if (this._loadStates.has(state)) {
            waiter.log(`  not waiting, "${state}" event already fired`);
          } else {
            await waiter.waitForEvent(this._eventEmitter, "loadstate", (s) => {
              waiter.log(`  "${s}" event fired`);
              return s === state;
            });
          }
          waiter.dispose();
        }, { title: `Wait for load state "${state}"` });
      }
      async waitForURL(url2, options = {}) {
        if (urlMatches(this._page?.context()._options.baseURL, this.url(), url2))
          return await this.waitForLoadState(options.waitUntil, options);
        await this.waitForNavigation({ url: url2, ...options });
      }
      async frameElement() {
        return ElementHandle2.from((await this._channel.frameElement()).element);
      }
      async evaluateHandle(pageFunction, arg) {
        assertMaxArguments(arguments.length, 2);
        const result2 = await this._channel.evaluateExpressionHandle({ expression: String(pageFunction), isFunction: typeof pageFunction === "function", arg: serializeArgument(arg) });
        return JSHandle2.from(result2.handle);
      }
      async evaluate(pageFunction, arg) {
        assertMaxArguments(arguments.length, 2);
        const result2 = await this._channel.evaluateExpression({ expression: String(pageFunction), isFunction: typeof pageFunction === "function", arg: serializeArgument(arg) });
        return parseResult(result2.value);
      }
      async _evaluateExposeUtilityScript(pageFunction, arg) {
        assertMaxArguments(arguments.length, 2);
        const result2 = await this._channel.evaluateExpression({ expression: String(pageFunction), isFunction: typeof pageFunction === "function", arg: serializeArgument(arg) });
        return parseResult(result2.value);
      }
      async $(selector, options) {
        const result2 = await this._channel.querySelector({ selector, ...options });
        return ElementHandle2.fromNullable(result2.element);
      }
      async waitForSelector(selector, options = {}) {
        if (options.visibility)
          throw new Error("options.visibility is not supported, did you mean options.state?");
        if (options.waitFor && options.waitFor !== "visible")
          throw new Error("options.waitFor is not supported, did you mean options.state?");
        const result2 = await this._channel.waitForSelector({ selector, ...options, timeout: this._timeout(options) });
        return ElementHandle2.fromNullable(result2.element);
      }
      async dispatchEvent(selector, type3, eventInit, options = {}) {
        await this._channel.dispatchEvent({ selector, type: type3, eventInit: serializeArgument(eventInit), ...options, timeout: this._timeout(options) });
      }
      async $eval(selector, pageFunction, arg) {
        assertMaxArguments(arguments.length, 3);
        const result2 = await this._channel.evalOnSelector({ selector, expression: String(pageFunction), isFunction: typeof pageFunction === "function", arg: serializeArgument(arg) });
        return parseResult(result2.value);
      }
      async $$eval(selector, pageFunction, arg) {
        assertMaxArguments(arguments.length, 3);
        const result2 = await this._channel.evalOnSelectorAll({ selector, expression: String(pageFunction), isFunction: typeof pageFunction === "function", arg: serializeArgument(arg) });
        return parseResult(result2.value);
      }
      async $$(selector) {
        const result2 = await this._channel.querySelectorAll({ selector });
        return result2.elements.map((e) => ElementHandle2.from(e));
      }
      async _queryCount(selector, options) {
        return (await this._channel.queryCount({ selector, ...options })).value;
      }
      async content() {
        return (await this._channel.content()).value;
      }
      async setContent(html, options = {}) {
        const waitUntil = verifyLoadState("waitUntil", options.waitUntil === void 0 ? "load" : options.waitUntil);
        await this._channel.setContent({ html, ...options, waitUntil, timeout: this._navigationTimeout(options) });
      }
      name() {
        return this._name || "";
      }
      url() {
        return this._url;
      }
      parentFrame() {
        return this._parentFrame;
      }
      childFrames() {
        return Array.from(this._childFrames);
      }
      isDetached() {
        return this._detached;
      }
      async addScriptTag(options = {}) {
        const copy = { ...options };
        if (copy.path) {
          copy.content = (await this._platform.fs().promises.readFile(copy.path)).toString();
          copy.content = addSourceUrlToScript(copy.content, copy.path);
        }
        return ElementHandle2.from((await this._channel.addScriptTag({ ...copy })).element);
      }
      async addStyleTag(options = {}) {
        const copy = { ...options };
        if (copy.path) {
          copy.content = (await this._platform.fs().promises.readFile(copy.path)).toString();
          copy.content += "/*# sourceURL=" + copy.path.replace(/\n/g, "") + "*/";
        }
        return ElementHandle2.from((await this._channel.addStyleTag({ ...copy })).element);
      }
      async click(selector, options = {}) {
        return await this._channel.click({ selector, ...options, timeout: this._timeout(options) });
      }
      async dblclick(selector, options = {}) {
        return await this._channel.dblclick({ selector, ...options, timeout: this._timeout(options) });
      }
      async dragAndDrop(source11, target, options = {}) {
        return await this._channel.dragAndDrop({ source: source11, target, ...options, timeout: this._timeout(options) });
      }
      async _drop(selector, payload, options = {}) {
        let fileParams = {};
        if (payload.files !== void 0) {
          const converted = await convertInputFiles(this._platform, payload.files, this.page().context());
          if (converted.localDirectory || converted.directoryStream)
            throw new Error("Dropping a directory is not supported \u2014 pass individual files.");
          fileParams = { payloads: converted.payloads, localPaths: converted.localPaths, streams: converted.streams };
        }
        const dataArray = payload.data ? Object.entries(payload.data).map(([mimeType, value2]) => ({ mimeType, value: value2 })) : void 0;
        await this._channel.drop({
          selector,
          ...fileParams,
          data: dataArray,
          ...options,
          timeout: this._timeout(options)
        });
      }
      async tap(selector, options = {}) {
        return await this._channel.tap({ selector, ...options, timeout: this._timeout(options) });
      }
      async fill(selector, value2, options = {}) {
        return await this._channel.fill({ selector, value: value2, ...options, timeout: this._timeout(options) });
      }
      async _highlight(selector, style) {
        return await this._channel.highlight({ selector, style });
      }
      async _hideHighlight(selector) {
        return await this._channel.hideHighlight({ selector });
      }
      locator(selector, options) {
        return new Locator(this, selector, options);
      }
      getByTestId(testId) {
        return this.locator(getByTestIdSelector(testIdAttributeName(), testId));
      }
      getByAltText(text2, options) {
        return this.locator(getByAltTextSelector(text2, options));
      }
      getByLabel(text2, options) {
        return this.locator(getByLabelSelector(text2, options));
      }
      getByPlaceholder(text2, options) {
        return this.locator(getByPlaceholderSelector(text2, options));
      }
      getByText(text2, options) {
        return this.locator(getByTextSelector(text2, options));
      }
      getByTitle(text2, options) {
        return this.locator(getByTitleSelector(text2, options));
      }
      getByRole(role, options = {}) {
        return this.locator(getByRoleSelector(role, options));
      }
      frameLocator(selector) {
        return new FrameLocator(this, selector);
      }
      async focus(selector, options = {}) {
        await this._channel.focus({ selector, ...options, timeout: this._timeout(options) });
      }
      async textContent(selector, options = {}) {
        const value2 = (await this._channel.textContent({ selector, ...options, timeout: this._timeout(options) })).value;
        return value2 === void 0 ? null : value2;
      }
      async innerText(selector, options = {}) {
        return (await this._channel.innerText({ selector, ...options, timeout: this._timeout(options) })).value;
      }
      async innerHTML(selector, options = {}) {
        return (await this._channel.innerHTML({ selector, ...options, timeout: this._timeout(options) })).value;
      }
      async getAttribute(selector, name, options = {}) {
        const value2 = (await this._channel.getAttribute({ selector, name, ...options, timeout: this._timeout(options) })).value;
        return value2 === void 0 ? null : value2;
      }
      async inputValue(selector, options = {}) {
        return (await this._channel.inputValue({ selector, ...options, timeout: this._timeout(options) })).value;
      }
      async isChecked(selector, options = {}) {
        return (await this._channel.isChecked({ selector, ...options, timeout: this._timeout(options) })).value;
      }
      async isDisabled(selector, options = {}) {
        return (await this._channel.isDisabled({ selector, ...options, timeout: this._timeout(options) })).value;
      }
      async isEditable(selector, options = {}) {
        return (await this._channel.isEditable({ selector, ...options, timeout: this._timeout(options) })).value;
      }
      async isEnabled(selector, options = {}) {
        return (await this._channel.isEnabled({ selector, ...options, timeout: this._timeout(options) })).value;
      }
      async isHidden(selector, options = {}) {
        return (await this._channel.isHidden({ selector, ...options })).value;
      }
      async isVisible(selector, options = {}) {
        return (await this._channel.isVisible({ selector, ...options })).value;
      }
      async hover(selector, options = {}) {
        await this._channel.hover({ selector, ...options, timeout: this._timeout(options) });
      }
      async selectOption(selector, values, options = {}) {
        return (await this._channel.selectOption({ selector, ...convertSelectOptionValues(values), ...options, timeout: this._timeout(options) })).values;
      }
      async setInputFiles(selector, files, options = {}) {
        const converted = await convertInputFiles(this._platform, files, this.page().context());
        await this._channel.setInputFiles({ selector, ...converted, ...options, timeout: this._timeout(options) });
      }
      async type(selector, text2, options = {}) {
        await this._channel.type({ selector, text: text2, ...options, timeout: this._timeout(options) });
      }
      async press(selector, key, options = {}) {
        await this._channel.press({ selector, key, ...options, timeout: this._timeout(options) });
      }
      async check(selector, options = {}) {
        await this._channel.check({ selector, ...options, timeout: this._timeout(options) });
      }
      async uncheck(selector, options = {}) {
        await this._channel.uncheck({ selector, ...options, timeout: this._timeout(options) });
      }
      async setChecked(selector, checked, options) {
        if (checked)
          await this.check(selector, options);
        else
          await this.uncheck(selector, options);
      }
      async waitForTimeout(timeout) {
        await this._channel.waitForTimeout({ waitTimeout: timeout });
      }
      async waitForFunction(pageFunction, arg, options = {}) {
        if (typeof options.polling === "string")
          assert(options.polling === "raf", "Unknown polling option: " + options.polling);
        const result2 = await this._channel.waitForFunction({
          ...options,
          pollingInterval: options.polling === "raf" ? void 0 : options.polling,
          expression: String(pageFunction),
          isFunction: typeof pageFunction === "function",
          arg: serializeArgument(arg),
          timeout: this._timeout(options)
        });
        return JSHandle2.from(result2.handle);
      }
      async title() {
        return (await this._channel.title()).value;
      }
      async _expect(expression2, options) {
        const params2 = { expression: expression2, ...options, isNot: !!options.isNot };
        params2.expectedValue = serializeArgument(options.expectedValue);
        try {
          await this._channel.expect(params2);
          return { matches: !params2.isNot };
        } catch (e) {
          if (!(e instanceof PlaywrightError))
            throw e;
          const details = e.details;
          const received = details.received ? {
            value: details.received.value !== void 0 ? parseResult(details.received.value) : void 0,
            ariaSnapshot: details.received.ariaSnapshot
          } : void 0;
          return {
            matches: !!params2.isNot,
            received,
            log: e.log,
            timedOut: details.timedOut,
            errorMessage: details.customErrorMessage ? "Error: " + details.customErrorMessage : void 0
          };
        }
      }
    };
  }
});

// packages/playwright-core/src/client/writableStream.ts
var WritableStream;
var init_writableStream = __esm({
  "packages/playwright-core/src/client/writableStream.ts"() {
    "use strict";
    init_channelOwner();
    WritableStream = class extends ChannelOwner {
      static from(Stream2) {
        return Stream2._object;
      }
      constructor(parent, type3, guid, initializer) {
        super(parent, type3, guid, initializer);
      }
      stream() {
        return this._platform.streamWritable(this._channel);
      }
    };
  }
});

// packages/playwright-core/src/client/elementHandle.ts
function convertSelectOptionValues(values) {
  if (values === null)
    return {};
  if (!Array.isArray(values))
    values = [values];
  if (!values.length)
    return {};
  for (let i = 0; i < values.length; i++)
    assert(values[i] !== null, `options[${i}]: expected object, got null`);
  if (values[0] instanceof ElementHandle2)
    return { elements: values.map((v) => v._elementChannel) };
  if (isString(values[0]))
    return { options: values.map((valueOrLabel) => ({ valueOrLabel })) };
  return { options: values };
}
function filePayloadExceedsSizeLimit(payloads) {
  return payloads.reduce((size, item) => size + (item.buffer ? item.buffer.byteLength : 0), 0) >= fileUploadSizeLimit2;
}
async function resolvePathsAndDirectoryForInputFiles(platform, items) {
  let localPaths;
  let localDirectory;
  for (const item of items) {
    const stat = await platform.fs().promises.stat(item);
    if (stat.isDirectory()) {
      if (localDirectory)
        throw new Error("Multiple directories are not supported");
      localDirectory = platform.path().resolve(item);
    } else {
      localPaths ??= [];
      localPaths.push(platform.path().resolve(item));
    }
  }
  if (localPaths?.length && localDirectory)
    throw new Error("File paths must be all files or a single directory");
  return [localPaths, localDirectory];
}
async function convertInputFiles(platform, files, context2) {
  const items = Array.isArray(files) ? files.slice() : [files];
  if (items.some((item) => typeof item === "string")) {
    if (!items.every((item) => typeof item === "string"))
      throw new Error("File paths cannot be mixed with buffers");
    const [localPaths, localDirectory] = await resolvePathsAndDirectoryForInputFiles(platform, items);
    if (context2._connection.isRemote()) {
      const files2 = localDirectory ? (await platform.fs().promises.readdir(localDirectory, { withFileTypes: true, recursive: true })).filter((f) => f.isFile()).map((f) => platform.path().join(f.parentPath, f.name)) : localPaths;
      const { writableStreams, rootDir } = await context2._wrapApiCall(async () => context2._channel.createTempFiles({
        rootDirName: localDirectory ? platform.path().basename(localDirectory) : void 0,
        items: await Promise.all(files2.map(async (file) => {
          const lastModifiedMs = (await platform.fs().promises.stat(file)).mtimeMs;
          return {
            name: localDirectory ? platform.path().relative(localDirectory, file) : platform.path().basename(file),
            lastModifiedMs
          };
        }))
      }), { internal: true });
      for (let i = 0; i < files2.length; i++) {
        const writable = WritableStream.from(writableStreams[i]);
        await platform.streamFile(files2[i], writable.stream());
      }
      return {
        directoryStream: rootDir,
        streams: localDirectory ? void 0 : writableStreams
      };
    }
    return {
      localPaths,
      localDirectory
    };
  }
  const payloads = items;
  if (filePayloadExceedsSizeLimit(payloads))
    throw new Error("Cannot set buffer larger than 50Mb, please write it to a file and pass its path instead.");
  return { payloads };
}
function determineScreenshotType(options) {
  if (options.path) {
    const mimeType = getMimeTypeForPath(options.path);
    if (mimeType === "image/png")
      return "png";
    else if (mimeType === "image/jpeg")
      return "jpeg";
    throw new Error(`path: unsupported mime type "${mimeType}"`);
  }
  return options.type;
}
var ElementHandle2;
var init_elementHandle = __esm({
  "packages/playwright-core/src/client/elementHandle.ts"() {
    "use strict";
    init_assert();
    init_rtti();
    init_mimeType();
    init_frame();
    init_jsHandle();
    init_fileUtils2();
    init_writableStream();
    ElementHandle2 = class _ElementHandle extends JSHandle2 {
      static from(handle) {
        return handle._object;
      }
      static fromNullable(handle) {
        return handle ? _ElementHandle.from(handle) : null;
      }
      constructor(parent, type3, guid, initializer) {
        super(parent, type3, guid, initializer);
        this._frame = parent;
        this._elementChannel = this._channel;
      }
      asElement() {
        return this;
      }
      async ownerFrame() {
        return Frame2.fromNullable((await this._elementChannel.ownerFrame()).frame);
      }
      async contentFrame() {
        return Frame2.fromNullable((await this._elementChannel.contentFrame()).frame);
      }
      async getAttribute(name) {
        const value2 = (await this._elementChannel.getAttribute({ name })).value;
        return value2 === void 0 ? null : value2;
      }
      async inputValue() {
        return (await this._elementChannel.inputValue()).value;
      }
      async textContent() {
        const value2 = (await this._elementChannel.textContent()).value;
        return value2 === void 0 ? null : value2;
      }
      async innerText() {
        return (await this._elementChannel.innerText()).value;
      }
      async innerHTML() {
        return (await this._elementChannel.innerHTML()).value;
      }
      async isChecked() {
        return (await this._elementChannel.isChecked()).value;
      }
      async isDisabled() {
        return (await this._elementChannel.isDisabled()).value;
      }
      async isEditable() {
        return (await this._elementChannel.isEditable()).value;
      }
      async isEnabled() {
        return (await this._elementChannel.isEnabled()).value;
      }
      async isHidden() {
        return (await this._elementChannel.isHidden()).value;
      }
      async isVisible() {
        return (await this._elementChannel.isVisible()).value;
      }
      async dispatchEvent(type3, eventInit = {}) {
        await this._elementChannel.dispatchEvent({ type: type3, eventInit: serializeArgument(eventInit) });
      }
      async scrollIntoViewIfNeeded(options = {}) {
        await this._elementChannel.scrollIntoViewIfNeeded({ ...options, timeout: this._frame._timeout(options) });
      }
      async hover(options = {}) {
        await this._elementChannel.hover({ ...options, timeout: this._frame._timeout(options) });
      }
      async click(options = {}) {
        return await this._elementChannel.click({ ...options, timeout: this._frame._timeout(options) });
      }
      async dblclick(options = {}) {
        return await this._elementChannel.dblclick({ ...options, timeout: this._frame._timeout(options) });
      }
      async tap(options = {}) {
        return await this._elementChannel.tap({ ...options, timeout: this._frame._timeout(options) });
      }
      async selectOption(values, options = {}) {
        const result2 = await this._elementChannel.selectOption({ ...convertSelectOptionValues(values), ...options, timeout: this._frame._timeout(options) });
        return result2.values;
      }
      async fill(value2, options = {}) {
        return await this._elementChannel.fill({ value: value2, ...options, timeout: this._frame._timeout(options) });
      }
      async selectText(options = {}) {
        await this._elementChannel.selectText({ ...options, timeout: this._frame._timeout(options) });
      }
      async setInputFiles(files, options = {}) {
        const frame = await this.ownerFrame();
        if (!frame)
          throw new Error("Cannot set input files to detached element");
        const converted = await convertInputFiles(this._platform, files, frame.page().context());
        await this._elementChannel.setInputFiles({ ...converted, ...options, timeout: this._frame._timeout(options) });
      }
      async focus() {
        await this._elementChannel.focus();
      }
      async type(text2, options = {}) {
        await this._elementChannel.type({ text: text2, ...options, timeout: this._frame._timeout(options) });
      }
      async press(key, options = {}) {
        await this._elementChannel.press({ key, ...options, timeout: this._frame._timeout(options) });
      }
      async check(options = {}) {
        return await this._elementChannel.check({ ...options, timeout: this._frame._timeout(options) });
      }
      async uncheck(options = {}) {
        return await this._elementChannel.uncheck({ ...options, timeout: this._frame._timeout(options) });
      }
      async setChecked(checked, options) {
        if (checked)
          await this.check(options);
        else
          await this.uncheck(options);
      }
      async boundingBox() {
        const value2 = (await this._elementChannel.boundingBox()).value;
        return value2 === void 0 ? null : value2;
      }
      async screenshot(options = {}) {
        const mask = options.mask;
        const copy = { ...options, mask: void 0, timeout: this._frame._timeout(options) };
        if (!copy.type)
          copy.type = determineScreenshotType(options);
        if (mask) {
          copy.mask = mask.map((locator2) => ({
            frame: locator2._frame._channel,
            selector: locator2._selector
          }));
        }
        const result2 = await this._elementChannel.screenshot(copy);
        if (options.path) {
          await mkdirIfNeeded2(this._platform, options.path);
          await this._platform.fs().promises.writeFile(options.path, result2.binary);
        }
        return result2.binary;
      }
      async $(selector) {
        return _ElementHandle.fromNullable((await this._elementChannel.querySelector({ selector })).element);
      }
      async $$(selector) {
        const result2 = await this._elementChannel.querySelectorAll({ selector });
        return result2.elements.map((h) => _ElementHandle.from(h));
      }
      async $eval(selector, pageFunction, arg) {
        const result2 = await this._elementChannel.evalOnSelector({ selector, expression: String(pageFunction), isFunction: typeof pageFunction === "function", arg: serializeArgument(arg) });
        return parseResult(result2.value);
      }
      async $$eval(selector, pageFunction, arg) {
        const result2 = await this._elementChannel.evalOnSelectorAll({ selector, expression: String(pageFunction), isFunction: typeof pageFunction === "function", arg: serializeArgument(arg) });
        return parseResult(result2.value);
      }
      async waitForElementState(state, options = {}) {
        return await this._elementChannel.waitForElementState({ state, ...options, timeout: this._frame._timeout(options) });
      }
      async waitForSelector(selector, options = {}) {
        const result2 = await this._elementChannel.waitForSelector({ selector, ...options, timeout: this._frame._timeout(options) });
        return _ElementHandle.fromNullable(result2.element);
      }
    };
  }
});

// packages/playwright-core/src/client/fileChooser.ts
var FileChooser2;
var init_fileChooser2 = __esm({
  "packages/playwright-core/src/client/fileChooser.ts"() {
    "use strict";
    FileChooser2 = class {
      constructor(page, elementHandle, isMultiple) {
        this._page = page;
        this._elementHandle = elementHandle;
        this._isMultiple = isMultiple;
      }
      element() {
        return this._elementHandle;
      }
      isMultiple() {
        return this._isMultiple;
      }
      page() {
        return this._page;
      }
      async setFiles(files, options) {
        return await this._elementHandle.setInputFiles(files, options);
      }
    };
  }
});

// packages/playwright-core/src/client/harRouter.ts
var HarRouter;
var init_harRouter = __esm({
  "packages/playwright-core/src/client/harRouter.ts"() {
    "use strict";
    HarRouter = class _HarRouter {
      static async create(localUtils, file, notFoundAction, options) {
        const { harId, error } = await localUtils.harOpen({ file });
        if (error)
          throw new Error(error);
        return new _HarRouter(localUtils, harId, notFoundAction, options);
      }
      constructor(localUtils, harId, notFoundAction, options) {
        this._localUtils = localUtils;
        this._harId = harId;
        this._options = options;
        this._notFoundAction = notFoundAction;
      }
      async _handle(route2) {
        const request2 = route2.request();
        const response2 = await this._localUtils.harLookup({
          harId: this._harId,
          url: request2.url(),
          method: request2.method(),
          headers: await request2.headersArray(),
          postData: request2.postDataBuffer() || void 0,
          isNavigationRequest: request2.isNavigationRequest()
        });
        if (response2.action === "redirect") {
          route2._platform.log("api", `HAR: ${route2.request().url()} redirected to ${response2.redirectURL}`);
          await route2._redirectNavigationRequest(response2.redirectURL);
          return;
        }
        if (response2.action === "fulfill") {
          if (response2.status === -1)
            return;
          const transformedHeaders = response2.headers.reduce((headersMap, { name, value: value2 }) => {
            if (name.toLowerCase() !== "set-cookie") {
              headersMap[name] = value2;
            } else {
              if (!headersMap["set-cookie"])
                headersMap["set-cookie"] = value2;
              else
                headersMap["set-cookie"] += `
${value2}`;
            }
            return headersMap;
          }, {});
          await route2.fulfill({
            status: response2.status,
            headers: transformedHeaders,
            body: response2.body
          });
          return;
        }
        if (response2.action === "error")
          route2._platform.log("api", "HAR: " + response2.message);
        if (this._notFoundAction === "abort") {
          await route2.abort();
          return;
        }
        await route2.fallback();
      }
      async addContextRoute(context2) {
        await context2.route(this._options.urlMatch || "**/*", (route2) => this._handle(route2));
      }
      async addPageRoute(page) {
        await page.route(this._options.urlMatch || "**/*", (route2) => this._handle(route2));
      }
      async [Symbol.asyncDispose]() {
        await this.dispose();
      }
      dispose() {
        this._localUtils.harClose({ harId: this._harId }).catch(() => {
        });
      }
    };
  }
});

// packages/playwright-core/src/client/input.ts
var Keyboard2, Mouse2, Touchscreen2;
var init_input2 = __esm({
  "packages/playwright-core/src/client/input.ts"() {
    "use strict";
    Keyboard2 = class {
      constructor(page) {
        this._page = page;
      }
      async down(key) {
        await this._page._channel.keyboardDown({ key });
      }
      async up(key) {
        await this._page._channel.keyboardUp({ key });
      }
      async insertText(text2) {
        await this._page._channel.keyboardInsertText({ text: text2 });
      }
      async type(text2, options = {}) {
        await this._page._channel.keyboardType({ text: text2, ...options });
      }
      async press(key, options = {}) {
        await this._page._channel.keyboardPress({ key, ...options });
      }
    };
    Mouse2 = class {
      constructor(page) {
        this._page = page;
      }
      async move(x, y, options = {}) {
        await this._page._channel.mouseMove({ x, y, ...options });
      }
      async down(options = {}) {
        await this._page._channel.mouseDown({ ...options });
      }
      async up(options = {}) {
        await this._page._channel.mouseUp(options);
      }
      async click(x, y, options = {}) {
        await this._page._channel.mouseClick({ x, y, ...options });
      }
      async dblclick(x, y, options = {}) {
        await this._page._wrapApiCall(async () => {
          await this.click(x, y, { ...options, clickCount: 2 });
        }, { title: "Double click" });
      }
      async wheel(deltaX, deltaY) {
        await this._page._channel.mouseWheel({ deltaX, deltaY });
      }
    };
    Touchscreen2 = class {
      constructor(page) {
        this._page = page;
      }
      async tap(x, y) {
        await this._page._channel.touchscreenTap({ x, y });
      }
    };
  }
});

// packages/playwright-core/src/client/webStorage.ts
var WebStorage;
var init_webStorage = __esm({
  "packages/playwright-core/src/client/webStorage.ts"() {
    "use strict";
    WebStorage = class {
      constructor(page, kind) {
        this._page = page;
        this._kind = kind;
      }
      async items() {
        const { items } = await this._page._channel.webStorageItems({ kind: this._kind });
        return items;
      }
      async getItem(name) {
        const { value: value2 } = await this._page._channel.webStorageGetItem({ kind: this._kind, name });
        return value2 ?? null;
      }
      async setItem(name, value2) {
        await this._page._channel.webStorageSetItem({ kind: this._kind, name, value: value2 });
      }
      async removeItem(name) {
        await this._page._channel.webStorageRemoveItem({ kind: this._kind, name });
      }
      async clear() {
        await this._page._channel.webStorageClear({ kind: this._kind });
      }
    };
  }
});

// packages/playwright-core/src/client/video.ts
var Video;
var init_video = __esm({
  "packages/playwright-core/src/client/video.ts"() {
    "use strict";
    init_eventEmitter();
    Video = class extends EventEmitter3 {
      constructor(page, connection, artifact) {
        super(page._platform);
        this._isRemote = false;
        this._isRemote = connection.isRemote();
        this._artifact = artifact;
      }
      async path() {
        if (this._isRemote)
          throw new Error(`Path is not available when connecting remotely. Use saveAs() to save a local copy.`);
        if (!this._artifact)
          throw new Error("Video recording has not been started.");
        return this._artifact._initializer.absolutePath;
      }
      async saveAs(path59) {
        if (!this._artifact)
          throw new Error("Video recording has not been started.");
        return await this._artifact.saveAs(path59);
      }
      async delete() {
        if (this._artifact)
          await this._artifact.delete();
      }
    };
  }
});

// packages/playwright-core/src/client/screencast.ts
var Screencast2;
var init_screencast2 = __esm({
  "packages/playwright-core/src/client/screencast.ts"() {
    "use strict";
    init_artifact2();
    init_disposable3();
    Screencast2 = class {
      constructor(page) {
        this._started = false;
        this._onFrame = null;
        this._page = page;
        this._page._channel.on("screencastFrame", ({ data, timestamp, viewportWidth, viewportHeight }) => {
          void this._onFrame?.({ data, timestamp, viewportWidth, viewportHeight });
        });
      }
      async start(options = {}) {
        if (this._started)
          throw new Error("Screencast is already started");
        this._started = true;
        if (options.onFrame)
          this._onFrame = options.onFrame;
        const result2 = await this._page._channel.screencastStart({
          size: options.size,
          quality: options.quality,
          sendFrames: !!options.onFrame,
          record: !!options.path
        });
        if (result2.artifact) {
          this._artifact = Artifact2.from(result2.artifact);
          this._savePath = options.path;
        }
        return new DisposableStub(() => this.stop());
      }
      async stop() {
        await this._page._wrapApiCall(async () => {
          this._started = false;
          this._onFrame = null;
          await this._page._channel.screencastStop();
          if (this._savePath)
            await this._artifact?.saveAs(this._savePath);
          this._artifact = void 0;
          this._savePath = void 0;
        });
      }
      async showActions(options) {
        await this._page._channel.screencastShowActions({ duration: options?.duration, position: options?.position, fontSize: options?.fontSize, cursor: options?.cursor });
        return new DisposableStub(() => this._page._channel.screencastHideActions());
      }
      async hideActions() {
        await this._page._channel.screencastHideActions();
      }
      async showOverlay(html, options) {
        const { id } = await this._page._channel.screencastShowOverlay({ html, duration: options?.duration });
        return new DisposableStub(() => this._page._channel.screencastRemoveOverlay({ id }));
      }
      async showChapter(title, options) {
        await this._page._channel.screencastChapter({ title, ...options });
      }
      async showOverlays() {
        await this._page._channel.screencastSetOverlayVisible({ visible: true });
      }
      async hideOverlays() {
        await this._page._channel.screencastSetOverlayVisible({ visible: false });
      }
    };
  }
});

// packages/playwright-core/src/client/page.ts
function trimUrl(param) {
  if (isRegExp(param))
    return `/${trimStringWithEllipsis(param.source, 50)}/${param.flags}`;
  if (isString(param))
    return `"${trimStringWithEllipsis(param, 50)}"`;
}
var Page2, BindingCall;
var init_page2 = __esm({
  "packages/playwright-core/src/client/page.ts"() {
    "use strict";
    init_assert();
    init_headers();
    init_stringUtils();
    init_urlMatch();
    init_manualPromise();
    init_rtti();
    init_artifact2();
    init_channelOwner();
    init_clientHelper();
    init_coverage();
    init_disposable3();
    init_download2();
    init_elementHandle();
    init_errors2();
    init_events();
    init_fileChooser2();
    init_frame();
    init_harRouter();
    init_input2();
    init_webStorage();
    init_jsHandle();
    init_network3();
    init_video();
    init_screencast2();
    init_waiter();
    init_worker();
    init_timeoutSettings();
    init_fileUtils2();
    init_consoleMessage();
    Page2 = class _Page extends ChannelOwner {
      constructor(parent, type3, guid, initializer) {
        super(parent, type3, guid, initializer);
        this._apiName = "Page";
        this._frames = /* @__PURE__ */ new Set();
        this._workers = /* @__PURE__ */ new Set();
        this._closed = false;
        this._closedOrCrashedScope = new LongStandingScope();
        this._routes = [];
        this._webSocketRoutes = [];
        this._bindings = /* @__PURE__ */ new Map();
        this._closeWasCalled = false;
        this._harRouters = [];
        this._locatorHandlers = /* @__PURE__ */ new Map();
        this._instrumentation.onPage(this);
        this._browserContext = parent;
        this._timeoutSettings = new TimeoutSettings(this._platform, this._browserContext._timeoutSettings);
        this.keyboard = new Keyboard2(this);
        this.mouse = new Mouse2(this);
        this.request = this._browserContext.request;
        this.touchscreen = new Touchscreen2(this);
        this.clock = this._browserContext.clock;
        this.localStorage = new WebStorage(this, "local");
        this.sessionStorage = new WebStorage(this, "session");
        this._mainFrame = Frame2.from(initializer.mainFrame);
        this._mainFrame._page = this;
        this._frames.add(this._mainFrame);
        this._viewportSize = initializer.viewportSize;
        this._closed = initializer.isClosed;
        this._opener = _Page.fromNullable(initializer.opener);
        this._video = new Video(this, this._connection, initializer.video ? Artifact2.from(initializer.video) : void 0);
        this.screencast = new Screencast2(this);
        this._channel.on("bindingCall", ({ binding }) => this._onBinding(BindingCall.from(binding)));
        this._channel.on("close", () => this._onClose());
        this._channel.on("crash", () => this._onCrash());
        this._channel.on("download", ({ url: url2, suggestedFilename, artifact }) => {
          const artifactObject = Artifact2.from(artifact);
          const download = new Download2(this, url2, suggestedFilename, artifactObject);
          this.emit(Events.Page.Download, download);
          this._browserContext.emit(Events.BrowserContext.Download, download);
        });
        this._channel.on("fileChooser", ({ element: element2, isMultiple }) => this.emit(Events.Page.FileChooser, new FileChooser2(this, ElementHandle2.from(element2), isMultiple)));
        this._channel.on("frameAttached", ({ frame }) => this._onFrameAttached(Frame2.from(frame)));
        this._channel.on("frameDetached", ({ frame }) => this._onFrameDetached(Frame2.from(frame)));
        this._channel.on("locatorHandlerTriggered", ({ uid }) => this._onLocatorHandlerTriggered(uid));
        this._channel.on("route", ({ route: route2 }) => this._onRoute(Route2.from(route2)));
        this._channel.on("webSocketRoute", ({ webSocketRoute }) => this._onWebSocketRoute(WebSocketRoute.from(webSocketRoute)));
        this._channel.on("viewportSizeChanged", ({ viewportSize }) => this._viewportSize = viewportSize);
        this._channel.on("webSocket", ({ webSocket }) => this.emit(Events.Page.WebSocket, WebSocket2.from(webSocket)));
        this._channel.on("worker", ({ worker }) => this._onWorker(Worker2.from(worker)));
        this.coverage = new Coverage(this._channel);
        this.once(Events.Page.Close, () => this._closedOrCrashedScope.close(this._closeErrorWithReason()));
        this.once(Events.Page.Crash, () => this._closedOrCrashedScope.close(new TargetClosedError2()));
        this._setEventToSubscriptionMapping(/* @__PURE__ */ new Map([
          [Events.Page.Console, "console"],
          [Events.Page.Dialog, "dialog"],
          [Events.Page.Request, "request"],
          [Events.Page.Response, "response"],
          [Events.Page.RequestFinished, "requestFinished"],
          [Events.Page.RequestFailed, "requestFailed"],
          [Events.Page.FileChooser, "fileChooser"]
        ]));
      }
      static from(page) {
        return page._object;
      }
      static fromNullable(page) {
        return page ? _Page.from(page) : null;
      }
      _onFrameAttached(frame) {
        frame._page = this;
        this._frames.add(frame);
        if (frame._parentFrame)
          frame._parentFrame._childFrames.add(frame);
        this.emit(Events.Page.FrameAttached, frame);
        this._browserContext.emit(Events.BrowserContext.FrameAttached, frame);
      }
      _onFrameDetached(frame) {
        this._frames.delete(frame);
        frame._detached = true;
        if (frame._parentFrame)
          frame._parentFrame._childFrames.delete(frame);
        this.emit(Events.Page.FrameDetached, frame);
        this._browserContext.emit(Events.BrowserContext.FrameDetached, frame);
      }
      async _onRoute(route2) {
        route2._context = this.context();
        const routeHandlers = this._routes.slice();
        for (const routeHandler of routeHandlers) {
          if (this._closeWasCalled || this._browserContext.isClosed())
            return;
          if (!routeHandler.matches(route2.request().url()))
            continue;
          const index = this._routes.indexOf(routeHandler);
          if (index === -1)
            continue;
          if (routeHandler.willExpire())
            this._routes.splice(index, 1);
          const handled = await routeHandler.handle(route2);
          if (!this._routes.length)
            this._updateInterceptionPatterns({ internal: true }).catch(() => {
            });
          if (handled)
            return;
        }
        await this._browserContext._onRoute(route2);
      }
      async _onWebSocketRoute(webSocketRoute) {
        const routeHandler = this._webSocketRoutes.find((route2) => route2.matches(webSocketRoute.url()));
        if (routeHandler)
          await routeHandler.handle(webSocketRoute);
        else
          await this._browserContext._onWebSocketRoute(webSocketRoute);
      }
      async _onBinding(bindingCall) {
        const func = this._bindings.get(bindingCall._initializer.name);
        if (func) {
          await bindingCall.call(func);
          return;
        }
        await this._browserContext._onBinding(bindingCall);
      }
      _onWorker(worker) {
        this._workers.add(worker);
        worker._page = this;
        this.emit(Events.Page.Worker, worker);
      }
      _onClose() {
        this._closed = true;
        this._browserContext._pages.delete(this);
        this._disposeHarRouters();
        this.emit(Events.Page.Close, this);
        this._browserContext.emit(Events.BrowserContext.PageClose, this);
      }
      _onCrash() {
        this.emit(Events.Page.Crash, this);
      }
      context() {
        return this._browserContext;
      }
      async opener() {
        if (!this._opener || this._opener.isClosed())
          return null;
        return this._opener;
      }
      mainFrame() {
        return this._mainFrame;
      }
      frame(frameSelector) {
        const name = isString(frameSelector) ? frameSelector : frameSelector.name;
        const url2 = isObject(frameSelector) ? frameSelector.url : void 0;
        assert(name || url2, "Either name or url matcher should be specified");
        return this.frames().find((f) => {
          if (name)
            return f.name() === name;
          return urlMatches(this._browserContext._options.baseURL, f.url(), url2);
        }) || null;
      }
      frames() {
        return [...this._frames];
      }
      setDefaultNavigationTimeout(timeout) {
        this._timeoutSettings.setDefaultNavigationTimeout(timeout);
      }
      setDefaultTimeout(timeout) {
        this._timeoutSettings.setDefaultTimeout(timeout);
      }
      video() {
        if (!this._browserContext._options.recordVideo)
          return null;
        return this._video;
      }
      async pickLocator() {
        const { selector } = await this._channel.pickLocator({});
        return this.locator(selector);
      }
      async cancelPickLocator() {
        await this._channel.cancelPickLocator({});
      }
      async hideHighlight() {
        await this._channel.hideHighlight({});
      }
      async $(selector, options) {
        return await this._mainFrame.$(selector, options);
      }
      async waitForSelector(selector, options) {
        return await this._mainFrame.waitForSelector(selector, options);
      }
      async dispatchEvent(selector, type3, eventInit, options) {
        return await this._mainFrame.dispatchEvent(selector, type3, eventInit, options);
      }
      async evaluateHandle(pageFunction, arg) {
        assertMaxArguments(arguments.length, 2);
        return await this._mainFrame.evaluateHandle(pageFunction, arg);
      }
      async $eval(selector, pageFunction, arg) {
        assertMaxArguments(arguments.length, 3);
        return await this._mainFrame.$eval(selector, pageFunction, arg);
      }
      async $$eval(selector, pageFunction, arg) {
        assertMaxArguments(arguments.length, 3);
        return await this._mainFrame.$$eval(selector, pageFunction, arg);
      }
      async $$(selector) {
        return await this._mainFrame.$$(selector);
      }
      async addScriptTag(options = {}) {
        return await this._mainFrame.addScriptTag(options);
      }
      async addStyleTag(options = {}) {
        return await this._mainFrame.addStyleTag(options);
      }
      async exposeFunction(name, callback) {
        const result2 = await this._channel.exposeBinding({ name });
        const binding = (source11, ...args) => callback(...args);
        this._bindings.set(name, binding);
        return DisposableObject2.from(result2.disposable);
      }
      async exposeBinding(name, callback) {
        const result2 = await this._channel.exposeBinding({ name });
        this._bindings.set(name, callback);
        return DisposableObject2.from(result2.disposable);
      }
      async setExtraHTTPHeaders(headers) {
        validateHeaders(headers);
        await this._channel.setExtraHTTPHeaders({ headers: headersObjectToArray(headers) });
      }
      url() {
        return this._mainFrame.url();
      }
      async content() {
        return await this._mainFrame.content();
      }
      async setContent(html, options) {
        return await this._mainFrame.setContent(html, options);
      }
      async goto(url2, options) {
        return await this._mainFrame.goto(url2, options);
      }
      async reload(options = {}) {
        const waitUntil = verifyLoadState("waitUntil", options.waitUntil === void 0 ? "load" : options.waitUntil);
        return Response3.fromNullable((await this._channel.reload({ ...options, waitUntil, timeout: this._timeoutSettings.navigationTimeout(options) })).response);
      }
      async addLocatorHandler(locator2, handler, options = {}) {
        if (locator2._frame !== this._mainFrame)
          throw new Error(`Locator must belong to the main frame of this page`);
        if (options.times === 0)
          return;
        const { uid } = await this._channel.registerLocatorHandler({ selector: locator2._selector, noWaitAfter: options.noWaitAfter });
        this._locatorHandlers.set(uid, { locator: locator2, handler, times: options.times });
      }
      async _onLocatorHandlerTriggered(uid) {
        let remove = false;
        try {
          const handler = this._locatorHandlers.get(uid);
          if (handler && handler.times !== 0) {
            if (handler.times !== void 0)
              handler.times--;
            await handler.handler(handler.locator);
          }
          remove = handler?.times === 0;
        } finally {
          if (remove)
            this._locatorHandlers.delete(uid);
          this._channel.resolveLocatorHandlerNoReply({ uid, remove }).catch(() => {
          });
        }
      }
      async removeLocatorHandler(locator2) {
        for (const [uid, data] of this._locatorHandlers) {
          if (data.locator._equals(locator2)) {
            this._locatorHandlers.delete(uid);
            await this._channel.unregisterLocatorHandler({ uid }).catch(() => {
            });
          }
        }
      }
      async waitForLoadState(state, options) {
        return await this._mainFrame.waitForLoadState(state, options);
      }
      async waitForNavigation(options) {
        return await this._mainFrame.waitForNavigation(options);
      }
      async waitForURL(url2, options) {
        return await this._mainFrame.waitForURL(url2, options);
      }
      async waitForRequest(urlOrPredicate, options = {}) {
        const predicate = async (request2) => {
          if (isString(urlOrPredicate) || isRegExp(urlOrPredicate))
            return urlMatches(this._browserContext._options.baseURL, request2.url(), urlOrPredicate);
          return await urlOrPredicate(request2);
        };
        const trimmedUrl = trimUrl(urlOrPredicate);
        const logLine = trimmedUrl ? `waiting for request ${trimmedUrl}` : void 0;
        return await this._waitForEvent(Events.Page.Request, { predicate, timeout: options.timeout }, logLine);
      }
      async waitForResponse(urlOrPredicate, options = {}) {
        const predicate = async (response2) => {
          if (isString(urlOrPredicate) || isRegExp(urlOrPredicate))
            return urlMatches(this._browserContext._options.baseURL, response2.url(), urlOrPredicate);
          return await urlOrPredicate(response2);
        };
        const trimmedUrl = trimUrl(urlOrPredicate);
        const logLine = trimmedUrl ? `waiting for response ${trimmedUrl}` : void 0;
        return await this._waitForEvent(Events.Page.Response, { predicate, timeout: options.timeout }, logLine);
      }
      async waitForEvent(event, optionsOrPredicate = {}) {
        return await this._waitForEvent(event, optionsOrPredicate, `waiting for event "${event}"`);
      }
      _closeErrorWithReason() {
        return new TargetClosedError2(this._closeReason || this._browserContext._effectiveCloseReason());
      }
      async _waitForEvent(event, optionsOrPredicate, logLine) {
        return await this._wrapApiCall(async () => {
          const timeout = this._timeoutSettings.timeout(typeof optionsOrPredicate === "function" ? {} : optionsOrPredicate);
          const predicate = typeof optionsOrPredicate === "function" ? optionsOrPredicate : optionsOrPredicate.predicate;
          const waiter = Waiter.createForEvent(this, event);
          if (logLine)
            waiter.log(logLine);
          waiter.rejectOnTimeout(timeout, `Timeout ${timeout}ms exceeded while waiting for event "${event}"`);
          if (event !== Events.Page.Crash)
            waiter.rejectOnEvent(this, Events.Page.Crash, new Error("Page crashed"));
          if (event !== Events.Page.Close)
            waiter.rejectOnEvent(this, Events.Page.Close, () => this._closeErrorWithReason());
          const result2 = await waiter.waitForEvent(this, event, predicate);
          waiter.dispose();
          return result2;
        });
      }
      async goBack(options = {}) {
        const waitUntil = verifyLoadState("waitUntil", options.waitUntil === void 0 ? "load" : options.waitUntil);
        return Response3.fromNullable((await this._channel.goBack({ ...options, waitUntil, timeout: this._timeoutSettings.navigationTimeout(options) })).response);
      }
      async goForward(options = {}) {
        const waitUntil = verifyLoadState("waitUntil", options.waitUntil === void 0 ? "load" : options.waitUntil);
        return Response3.fromNullable((await this._channel.goForward({ ...options, waitUntil, timeout: this._timeoutSettings.navigationTimeout(options) })).response);
      }
      async requestGC() {
        await this._channel.requestGC();
      }
      async emulateMedia(options = {}) {
        await this._channel.emulateMedia({
          media: options.media === null ? "no-override" : options.media,
          colorScheme: options.colorScheme === null ? "no-override" : options.colorScheme,
          reducedMotion: options.reducedMotion === null ? "no-override" : options.reducedMotion,
          forcedColors: options.forcedColors === null ? "no-override" : options.forcedColors,
          contrast: options.contrast === null ? "no-override" : options.contrast
        });
      }
      async setViewportSize(viewportSize) {
        this._viewportSize = viewportSize;
        await this._channel.setViewportSize({ viewportSize });
      }
      viewportSize() {
        return this._viewportSize || null;
      }
      async evaluate(pageFunction, arg) {
        assertMaxArguments(arguments.length, 2);
        return await this._mainFrame.evaluate(pageFunction, arg);
      }
      async addInitScript(script, arg) {
        const source11 = await evaluationScript(this._platform, script, arg);
        return DisposableObject2.from((await this._channel.addInitScript({ source: source11 })).disposable);
      }
      async route(url2, handler, options = {}) {
        this._routes.unshift(new RouteHandler(this._platform, this._browserContext._options.baseURL, url2, handler, options.times));
        await this._updateInterceptionPatterns({ title: "Route requests" });
        return new DisposableStub(() => this.unroute(url2, handler));
      }
      async routeFromHAR(har, options = {}) {
        const localUtils = this._connection.localUtils();
        if (!localUtils)
          throw new Error("Route from har is not supported in thin clients");
        if (options.update) {
          await this._browserContext.tracing._recordIntoHAR(har, this, options);
          return;
        }
        const harRouter = await HarRouter.create(localUtils, har, options.notFound || "abort", { urlMatch: options.url });
        this._harRouters.push(harRouter);
        await harRouter.addPageRoute(this);
      }
      async routeWebSocket(url2, handler) {
        this._webSocketRoutes.unshift(new WebSocketRouteHandler(this._browserContext._options.baseURL, url2, handler));
        await this._updateWebSocketInterceptionPatterns({ title: "Route WebSockets" });
      }
      _disposeHarRouters() {
        this._harRouters.forEach((router) => router.dispose());
        this._harRouters = [];
      }
      async unrouteAll(options) {
        await this._unrouteInternal(this._routes, [], options?.behavior);
        this._disposeHarRouters();
      }
      async unroute(url2, handler) {
        const removed = [];
        const remaining = [];
        for (const route2 of this._routes) {
          if (urlMatchesEqual(route2.url, url2) && (!handler || route2.handler === handler))
            removed.push(route2);
          else
            remaining.push(route2);
        }
        await this._unrouteInternal(removed, remaining, "default");
      }
      async _unrouteInternal(removed, remaining, behavior) {
        this._routes = remaining;
        if (behavior && behavior !== "default") {
          const promises = removed.map((routeHandler) => routeHandler.stop(behavior));
          await Promise.all(promises);
        }
        await this._updateInterceptionPatterns({ title: "Unroute requests" });
      }
      async _updateInterceptionPatterns(options) {
        const patterns = RouteHandler.prepareInterceptionPatterns(this._routes);
        await this._wrapApiCall(() => this._channel.setNetworkInterceptionPatterns({ patterns }), options);
      }
      async _updateWebSocketInterceptionPatterns(options) {
        const patterns = WebSocketRouteHandler.prepareInterceptionPatterns(this._webSocketRoutes);
        await this._wrapApiCall(() => this._channel.setWebSocketInterceptionPatterns({ patterns }), options);
      }
      async screenshot(options = {}) {
        const mask = options.mask;
        const copy = { ...options, mask: void 0, timeout: this._timeoutSettings.timeout(options) };
        if (!copy.type)
          copy.type = determineScreenshotType(options);
        if (mask) {
          copy.mask = mask.map((locator2) => ({
            frame: locator2._frame._channel,
            selector: locator2._selector
          }));
        }
        const result2 = await this._channel.screenshot(copy);
        if (options.path) {
          await mkdirIfNeeded2(this._platform, options.path);
          await this._platform.fs().promises.writeFile(options.path, result2.binary);
        }
        return result2.binary;
      }
      async _expectScreenshot(options) {
        const mask = options?.mask ? options?.mask.map((locator3) => ({
          frame: locator3._frame._channel,
          selector: locator3._selector
        })) : void 0;
        const locator2 = options.locator ? {
          frame: options.locator._frame._channel,
          selector: options.locator._selector
        } : void 0;
        try {
          const result2 = await this._channel.expectScreenshot({
            ...options,
            isNot: !!options.isNot,
            locator: locator2,
            mask
          });
          return { actual: result2.actual };
        } catch (e) {
          if (!(e instanceof PlaywrightError))
            throw e;
          const details = e.details;
          return { ...details, errorMessage: details.customErrorMessage };
        }
      }
      async title() {
        return await this._mainFrame.title();
      }
      async bringToFront() {
        await this._channel.bringToFront();
      }
      async [Symbol.asyncDispose]() {
        await this.close();
      }
      async close(options = {}) {
        this._closeReason = options.reason;
        if (!options.runBeforeUnload)
          this._closeWasCalled = true;
        try {
          if (this._ownedContext)
            await this._ownedContext.close();
          else if (options.runBeforeUnload)
            await this._channel.runBeforeUnload();
          else
            await this._channel.close({ reason: options.reason });
        } catch (e) {
          if (isTargetClosedError2(e) && !options.runBeforeUnload)
            return;
          throw e;
        }
      }
      isClosed() {
        return this._closed;
      }
      async click(selector, options) {
        return await this._mainFrame.click(selector, options);
      }
      async dragAndDrop(source11, target, options) {
        return await this._mainFrame.dragAndDrop(source11, target, options);
      }
      async dblclick(selector, options) {
        await this._mainFrame.dblclick(selector, options);
      }
      async tap(selector, options) {
        return await this._mainFrame.tap(selector, options);
      }
      async fill(selector, value2, options) {
        return await this._mainFrame.fill(selector, value2, options);
      }
      async clearConsoleMessages() {
        await this._channel.clearConsoleMessages();
      }
      async consoleMessages(options) {
        const { messages } = await this._channel.consoleMessages({ filter: options?.filter });
        return messages.map((message) => new ConsoleMessage2(this._platform, message, this, null));
      }
      async clearPageErrors() {
        await this._channel.clearPageErrors();
      }
      async pageErrors(options) {
        const { errors } = await this._channel.pageErrors({ filter: options?.filter });
        return errors.map((error) => parseError2(error));
      }
      locator(selector, options) {
        return this.mainFrame().locator(selector, options);
      }
      getByTestId(testId) {
        return this.mainFrame().getByTestId(testId);
      }
      getByAltText(text2, options) {
        return this.mainFrame().getByAltText(text2, options);
      }
      getByLabel(text2, options) {
        return this.mainFrame().getByLabel(text2, options);
      }
      getByPlaceholder(text2, options) {
        return this.mainFrame().getByPlaceholder(text2, options);
      }
      getByText(text2, options) {
        return this.mainFrame().getByText(text2, options);
      }
      getByTitle(text2, options) {
        return this.mainFrame().getByTitle(text2, options);
      }
      getByRole(role, options = {}) {
        return this.mainFrame().getByRole(role, options);
      }
      frameLocator(selector) {
        return this.mainFrame().frameLocator(selector);
      }
      async focus(selector, options) {
        return await this._mainFrame.focus(selector, options);
      }
      async textContent(selector, options) {
        return await this._mainFrame.textContent(selector, options);
      }
      async innerText(selector, options) {
        return await this._mainFrame.innerText(selector, options);
      }
      async innerHTML(selector, options) {
        return await this._mainFrame.innerHTML(selector, options);
      }
      async getAttribute(selector, name, options) {
        return await this._mainFrame.getAttribute(selector, name, options);
      }
      async inputValue(selector, options) {
        return await this._mainFrame.inputValue(selector, options);
      }
      async isChecked(selector, options) {
        return await this._mainFrame.isChecked(selector, options);
      }
      async isDisabled(selector, options) {
        return await this._mainFrame.isDisabled(selector, options);
      }
      async isEditable(selector, options) {
        return await this._mainFrame.isEditable(selector, options);
      }
      async isEnabled(selector, options) {
        return await this._mainFrame.isEnabled(selector, options);
      }
      async isHidden(selector, options) {
        return await this._mainFrame.isHidden(selector, options);
      }
      async isVisible(selector, options) {
        return await this._mainFrame.isVisible(selector, options);
      }
      async hover(selector, options) {
        return await this._mainFrame.hover(selector, options);
      }
      async selectOption(selector, values, options) {
        return await this._mainFrame.selectOption(selector, values, options);
      }
      async setInputFiles(selector, files, options) {
        return await this._mainFrame.setInputFiles(selector, files, options);
      }
      async type(selector, text2, options) {
        return await this._mainFrame.type(selector, text2, options);
      }
      async press(selector, key, options) {
        return await this._mainFrame.press(selector, key, options);
      }
      async check(selector, options) {
        return await this._mainFrame.check(selector, options);
      }
      async uncheck(selector, options) {
        return await this._mainFrame.uncheck(selector, options);
      }
      async setChecked(selector, checked, options) {
        return await this._mainFrame.setChecked(selector, checked, options);
      }
      async waitForTimeout(timeout) {
        return await this._mainFrame.waitForTimeout(timeout);
      }
      async waitForFunction(pageFunction, arg, options) {
        return await this._mainFrame.waitForFunction(pageFunction, arg, options);
      }
      async requests() {
        const { requests: requests2 } = await this._channel.requests();
        return requests2.map((request2) => Request2.from(request2));
      }
      workers() {
        return [...this._workers];
      }
      async pause(_options) {
        if (this._platform.isJSDebuggerAttached())
          return;
        const defaultNavigationTimeout = this._browserContext._timeoutSettings.defaultNavigationTimeout();
        const defaultTimeout = this._browserContext._timeoutSettings.defaultTimeout();
        this._browserContext.setDefaultNavigationTimeout(0);
        this._browserContext.setDefaultTimeout(0);
        this._instrumentation?.onWillPause({ keepTestTimeout: !!_options?.__testHookKeepTestTimeout });
        await this._closedOrCrashedScope.safeRace(this.context()._channel.pause());
        this._browserContext.setDefaultNavigationTimeout(defaultNavigationTimeout);
        this._browserContext.setDefaultTimeout(defaultTimeout);
      }
      async pdf(options = {}) {
        const transportOptions = { ...options };
        if (transportOptions.margin)
          transportOptions.margin = { ...transportOptions.margin };
        if (typeof options.width === "number")
          transportOptions.width = options.width + "px";
        if (typeof options.height === "number")
          transportOptions.height = options.height + "px";
        for (const margin of ["top", "right", "bottom", "left"]) {
          const index = margin;
          if (options.margin && typeof options.margin[index] === "number")
            transportOptions.margin[index] = transportOptions.margin[index] + "px";
        }
        const result2 = await this._channel.pdf(transportOptions);
        if (options.path) {
          const platform = this._platform;
          await platform.fs().promises.mkdir(platform.path().dirname(options.path), { recursive: true });
          await platform.fs().promises.writeFile(options.path, result2.pdf);
        }
        return result2.pdf;
      }
      async ariaSnapshot(options = {}) {
        const result2 = await this.mainFrame()._channel.ariaSnapshot({ timeout: this._timeoutSettings.timeout(options), track: options._track, mode: options.mode, depth: options.depth, boxes: options.boxes });
        return result2.snapshot;
      }
      async _setDockTile(image) {
        await this._channel.setDockTile({ image });
      }
    };
    BindingCall = class extends ChannelOwner {
      static from(channel) {
        return channel._object;
      }
      constructor(parent, type3, guid, initializer) {
        super(parent, type3, guid, initializer);
      }
      async call(func) {
        try {
          const frame = Frame2.from(this._initializer.frame);
          const source11 = {
            context: frame._page.context(),
            page: frame._page,
            frame
          };
          const result2 = await func(source11, ...this._initializer.args.map(parseResult));
          this._channel.resolve({ result: serializeArgument(result2) }).catch(() => {
          });
        } catch (e) {
          this._channel.reject({ error: serializeError2(e) }).catch(() => {
          });
        }
      }
    };
  }
});

// packages/playwright-core/src/client/dialog.ts
var Dialog2;
var init_dialog2 = __esm({
  "packages/playwright-core/src/client/dialog.ts"() {
    "use strict";
    init_channelOwner();
    init_page2();
    init_errors2();
    Dialog2 = class extends ChannelOwner {
      static from(dialog) {
        return dialog._object;
      }
      constructor(parent, type3, guid, initializer) {
        super(parent, type3, guid, initializer);
        this._page = Page2.fromNullable(initializer.page);
      }
      page() {
        return this._page;
      }
      type() {
        return this._initializer.type;
      }
      message() {
        return this._initializer.message;
      }
      defaultValue() {
        return this._initializer.defaultValue;
      }
      async accept(promptText) {
        await this._channel.accept({ promptText });
      }
      async dismiss() {
        try {
          await this._channel.dismiss();
        } catch (e) {
          if (isTargetClosedError2(e))
            return;
          throw e;
        }
      }
    };
  }
});

// packages/playwright-core/src/client/webError.ts
var WebError;
var init_webError = __esm({
  "packages/playwright-core/src/client/webError.ts"() {
    "use strict";
    WebError = class {
      constructor(page, error, location2) {
        this._page = page;
        this._error = error;
        this._location = location2;
      }
      page() {
        return this._page;
      }
      error() {
        return this._error;
      }
      location() {
        return this._location;
      }
    };
  }
});

// packages/playwright-core/src/client/browserContext.ts
async function prepareStorageState(platform, storageState2) {
  if (typeof storageState2 !== "string")
    return storageState2;
  try {
    return JSON.parse(await platform.fs().promises.readFile(storageState2, "utf8"));
  } catch (e) {
    rewriteErrorMessage(e, `Error reading storage state from ${storageState2}:
` + e.message);
    throw e;
  }
}
async function prepareBrowserContextParams(platform, options) {
  if (options.extraHTTPHeaders)
    validateHeaders(options.extraHTTPHeaders);
  const contextParams = {
    ...options,
    viewport: options.viewport === null ? void 0 : options.viewport,
    noDefaultViewport: options.viewport === null,
    extraHTTPHeaders: options.extraHTTPHeaders ? headersObjectToArray(options.extraHTTPHeaders) : void 0,
    storageState: options.storageState ? await prepareStorageState(platform, options.storageState) : void 0,
    serviceWorkers: options.serviceWorkers,
    colorScheme: options.colorScheme === null ? "no-override" : options.colorScheme,
    reducedMotion: options.reducedMotion === null ? "no-override" : options.reducedMotion,
    forcedColors: options.forcedColors === null ? "no-override" : options.forcedColors,
    contrast: options.contrast === null ? "no-override" : options.contrast,
    acceptDownloads: toAcceptDownloadsProtocol(options.acceptDownloads),
    clientCertificates: await toClientCertificatesProtocol(platform, options.clientCertificates)
  };
  if (contextParams.recordVideo && contextParams.recordVideo.dir)
    contextParams.recordVideo.dir = platform.path().resolve(contextParams.recordVideo.dir);
  return contextParams;
}
function toAcceptDownloadsProtocol(acceptDownloads) {
  if (acceptDownloads === void 0)
    return void 0;
  if (acceptDownloads)
    return "accept";
  return "deny";
}
async function toClientCertificatesProtocol(platform, certs) {
  if (!certs)
    return void 0;
  const bufferizeContent = async (value2, path59) => {
    if (value2)
      return value2;
    if (path59)
      return await platform.fs().promises.readFile(path59);
  };
  return await Promise.all(certs.map(async (cert) => ({
    origin: cert.origin,
    cert: await bufferizeContent(cert.cert, cert.certPath),
    key: await bufferizeContent(cert.key, cert.keyPath),
    pfx: await bufferizeContent(cert.pfx, cert.pfxPath),
    passphrase: cert.passphrase
  })));
}
var BrowserContext2;
var init_browserContext2 = __esm({
  "packages/playwright-core/src/client/browserContext.ts"() {
    "use strict";
    init_headers();
    init_urlMatch();
    init_rtti();
    init_stackTrace();
    init_cdpSession();
    init_channelOwner();
    init_clientHelper();
    init_clock2();
    init_consoleMessage();
    init_credentials2();
    init_debugger2();
    init_dialog2();
    init_disposable3();
    init_errors2();
    init_events();
    init_fetch2();
    init_frame();
    init_harRouter();
    init_network3();
    init_page2();
    init_tracing2();
    init_waiter();
    init_webError();
    init_worker();
    init_timeoutSettings();
    init_fileUtils2();
    BrowserContext2 = class _BrowserContext extends ChannelOwner {
      constructor(parent, type3, guid, initializer) {
        super(parent, type3, guid, initializer);
        this._pages = /* @__PURE__ */ new Set();
        this._routes = [];
        this._webSocketRoutes = [];
        // Browser is null for browser contexts created outside of normal browser, e.g. android or electron.
        this._browser = null;
        this._bindings = /* @__PURE__ */ new Map();
        this._forReuse = false;
        this._serviceWorkers = /* @__PURE__ */ new Set();
        this._closingStatus = "none";
        this._harRouters = [];
        this._options = initializer.options;
        this._timeoutSettings = new TimeoutSettings(this._platform);
        this.debugger = Debugger2.from(initializer.debugger);
        this.tracing = Tracing2.from(initializer.tracing);
        this.request = APIRequestContext2.from(initializer.requestContext);
        this.request._timeoutSettings = this._timeoutSettings;
        this.clock = new Clock2(this);
        this.credentials = new Credentials2(this);
        this._channel.on("bindingCall", ({ binding }) => this._onBinding(BindingCall.from(binding)));
        this._channel.on("close", () => this._onClose());
        this._channel.on("page", ({ page }) => this._onPage(Page2.from(page)));
        this._channel.on("route", ({ route: route2 }) => this._onRoute(Route2.from(route2)));
        this._channel.on("webSocketRoute", ({ webSocketRoute }) => this._onWebSocketRoute(WebSocketRoute.from(webSocketRoute)));
        this._channel.on("serviceWorker", ({ worker }) => {
          const serviceWorker = Worker2.from(worker);
          serviceWorker._context = this;
          this._serviceWorkers.add(serviceWorker);
          this.emit(Events.BrowserContext.ServiceWorker, serviceWorker);
        });
        this._channel.on("console", (event) => {
          const worker = Worker2.fromNullable(event.worker);
          const page = Page2.fromNullable(event.page);
          const consoleMessage = new ConsoleMessage2(this._platform, event, page, worker);
          worker?.emit(Events.Worker.Console, consoleMessage);
          page?.emit(Events.Page.Console, consoleMessage);
          if (worker && this._serviceWorkers.has(worker)) {
            const scope = this._serviceWorkerScope(worker);
            for (const page2 of this._pages) {
              if (scope && page2.url().startsWith(scope))
                page2.emit(Events.Page.Console, consoleMessage);
            }
          }
          this.emit(Events.BrowserContext.Console, consoleMessage);
        });
        this._channel.on("pageError", ({ error, page, location: location2 }) => {
          const pageObject = Page2.from(page);
          const parsedError = parseError2(error);
          this.emit(Events.BrowserContext.WebError, new WebError(pageObject, parsedError, location2));
          if (pageObject)
            pageObject.emit(Events.Page.PageError, parsedError);
        });
        this._channel.on("dialog", ({ dialog }) => {
          const dialogObject = Dialog2.from(dialog);
          let hasListeners = this.emit(Events.BrowserContext.Dialog, dialogObject);
          const page = dialogObject.page();
          if (page)
            hasListeners = page.emit(Events.Page.Dialog, dialogObject) || hasListeners;
          if (!hasListeners) {
            if (dialogObject.type() === "beforeunload")
              dialog.accept({}).catch(() => {
              });
            else
              dialog.dismiss().catch(() => {
              });
          }
        });
        this._channel.on("request", ({ request: request2, page }) => this._onRequest(Request2.from(request2), Page2.fromNullable(page)));
        this._channel.on("requestFailed", ({ request: request2, failureText, responseEndTiming, page }) => this._onRequestFailed(Request2.from(request2), responseEndTiming, failureText, Page2.fromNullable(page)));
        this._channel.on("requestFinished", (params2) => this._onRequestFinished(params2));
        this._channel.on("response", ({ response: response2, page }) => this._onResponse(Response3.from(response2), Page2.fromNullable(page)));
        this._channel.on("recorderEvent", ({ event, data, page, code }) => {
          if (event === "actionAdded")
            this._onRecorderEventSink?.actionAdded?.(Page2.from(page), data, code);
          else if (event === "actionUpdated")
            this._onRecorderEventSink?.actionUpdated?.(Page2.from(page), data, code);
          else if (event === "signalAdded")
            this._onRecorderEventSink?.signalAdded?.(Page2.from(page), data);
        });
        this._closedPromise = new Promise((f) => this.once(Events.BrowserContext.Close, f));
        this._setEventToSubscriptionMapping(/* @__PURE__ */ new Map([
          [Events.BrowserContext.Console, "console"],
          [Events.BrowserContext.Dialog, "dialog"],
          [Events.BrowserContext.Request, "request"],
          [Events.BrowserContext.Response, "response"],
          [Events.BrowserContext.RequestFinished, "requestFinished"],
          [Events.BrowserContext.RequestFailed, "requestFailed"]
        ]));
      }
      static from(context2) {
        return context2._object;
      }
      static fromNullable(context2) {
        return context2 ? _BrowserContext.from(context2) : null;
      }
      async _initializeHarFromOptions(recordHar) {
        if (!recordHar)
          return;
        const defaultContent = recordHar.path.endsWith(".zip") ? "attach" : "embed";
        await this.tracing._recordIntoHAR(recordHar.path, null, {
          url: recordHar.urlFilter,
          updateContent: recordHar.content ?? (recordHar.omitContent ? "omit" : defaultContent),
          updateMode: recordHar.mode ?? "full"
        });
      }
      _onPage(page) {
        this._pages.add(page);
        this.emit(Events.BrowserContext.Page, page);
        if (page._opener && !page._opener.isClosed())
          page._opener.emit(Events.Page.Popup, page);
      }
      _onRequest(request2, page) {
        this.emit(Events.BrowserContext.Request, request2);
        if (page)
          page.emit(Events.Page.Request, request2);
      }
      _onResponse(response2, page) {
        this.emit(Events.BrowserContext.Response, response2);
        if (page)
          page.emit(Events.Page.Response, response2);
      }
      _onRequestFailed(request2, responseEndTiming, failureText, page) {
        request2._failureText = failureText || null;
        request2._setResponseEndTiming(responseEndTiming);
        this.emit(Events.BrowserContext.RequestFailed, request2);
        if (page)
          page.emit(Events.Page.RequestFailed, request2);
      }
      _onRequestFinished(params2) {
        const { responseEndTiming } = params2;
        const request2 = Request2.from(params2.request);
        const response2 = Response3.fromNullable(params2.response);
        const page = Page2.fromNullable(params2.page);
        request2._setResponseEndTiming(responseEndTiming);
        this.emit(Events.BrowserContext.RequestFinished, request2);
        if (page)
          page.emit(Events.Page.RequestFinished, request2);
        if (response2)
          response2._finishedPromise.resolve(null);
      }
      async _onRoute(route2) {
        route2._context = this;
        const page = route2.request()._safePage();
        const routeHandlers = this._routes.slice();
        for (const routeHandler of routeHandlers) {
          if (page?._closeWasCalled || this.isClosed())
            return;
          if (!routeHandler.matches(route2.request().url()))
            continue;
          const index = this._routes.indexOf(routeHandler);
          if (index === -1)
            continue;
          if (routeHandler.willExpire())
            this._routes.splice(index, 1);
          const handled = await routeHandler.handle(route2);
          if (!this._routes.length)
            this._updateInterceptionPatterns({ internal: true }).catch(() => {
            });
          if (handled)
            return;
        }
        await route2._innerContinue(
          true
          /* isFallback */
        ).catch(() => {
        });
      }
      async _onWebSocketRoute(webSocketRoute) {
        const routeHandler = this._webSocketRoutes.find((route2) => route2.matches(webSocketRoute.url()));
        if (routeHandler)
          await routeHandler.handle(webSocketRoute);
        else
          webSocketRoute.connectToServer();
      }
      async _onBinding(bindingCall) {
        const func = this._bindings.get(bindingCall._initializer.name);
        if (!func)
          return;
        await bindingCall.call(func);
      }
      _serviceWorkerScope(serviceWorker) {
        try {
          let url2 = new URL(".", serviceWorker.url()).href;
          if (!url2.endsWith("/"))
            url2 += "/";
          return url2;
        } catch {
          return null;
        }
      }
      setDefaultNavigationTimeout(timeout) {
        this._timeoutSettings.setDefaultNavigationTimeout(timeout);
      }
      setDefaultTimeout(timeout) {
        this._timeoutSettings.setDefaultTimeout(timeout);
      }
      browser() {
        return this._browser;
      }
      pages() {
        return [...this._pages];
      }
      isClosed() {
        return this._closingStatus !== "none";
      }
      async newPage() {
        if (this._ownerPage)
          throw new Error("Please use browser.newContext()");
        return Page2.from((await this._channel.newPage()).page);
      }
      async cookies(urls) {
        if (!urls)
          urls = [];
        if (urls && typeof urls === "string")
          urls = [urls];
        return (await this._channel.cookies({ urls })).cookies;
      }
      async addCookies(cookies) {
        await this._channel.addCookies({ cookies });
      }
      async clearCookies(options = {}) {
        await this._channel.clearCookies({
          name: isString(options.name) ? options.name : void 0,
          nameRegexSource: isRegExp(options.name) ? options.name.source : void 0,
          nameRegexFlags: isRegExp(options.name) ? options.name.flags : void 0,
          domain: isString(options.domain) ? options.domain : void 0,
          domainRegexSource: isRegExp(options.domain) ? options.domain.source : void 0,
          domainRegexFlags: isRegExp(options.domain) ? options.domain.flags : void 0,
          path: isString(options.path) ? options.path : void 0,
          pathRegexSource: isRegExp(options.path) ? options.path.source : void 0,
          pathRegexFlags: isRegExp(options.path) ? options.path.flags : void 0
        });
      }
      async grantPermissions(permissions, options) {
        await this._channel.grantPermissions({ permissions, ...options });
      }
      async clearPermissions() {
        await this._channel.clearPermissions();
      }
      async setGeolocation(geolocation) {
        await this._channel.setGeolocation({ geolocation: geolocation || void 0 });
      }
      async setExtraHTTPHeaders(headers) {
        validateHeaders(headers);
        await this._channel.setExtraHTTPHeaders({ headers: headersObjectToArray(headers) });
      }
      async setOffline(offline) {
        await this._channel.setOffline({ offline });
      }
      async setHTTPCredentials(httpCredentials) {
        await this._channel.setHTTPCredentials({ httpCredentials: httpCredentials || void 0 });
      }
      async addInitScript(script, arg) {
        const source11 = await evaluationScript(this._platform, script, arg);
        return DisposableObject2.from((await this._channel.addInitScript({ source: source11 })).disposable);
      }
      async exposeBinding(name, callback) {
        const result2 = await this._channel.exposeBinding({ name });
        this._bindings.set(name, callback);
        return DisposableObject2.from(result2.disposable);
      }
      async exposeFunction(name, callback) {
        const result2 = await this._channel.exposeBinding({ name });
        const binding = (source11, ...args) => callback(...args);
        this._bindings.set(name, binding);
        return DisposableObject2.from(result2.disposable);
      }
      async route(url2, handler, options = {}) {
        this._routes.unshift(new RouteHandler(this._platform, this._options.baseURL, url2, handler, options.times));
        await this._updateInterceptionPatterns({ title: "Route requests" });
        return new DisposableStub(() => this.unroute(url2, handler));
      }
      async routeWebSocket(url2, handler) {
        this._webSocketRoutes.unshift(new WebSocketRouteHandler(this._options.baseURL, url2, handler));
        await this._updateWebSocketInterceptionPatterns({ title: "Route WebSockets" });
      }
      async routeFromHAR(har, options = {}) {
        const localUtils = this._connection.localUtils();
        if (!localUtils)
          throw new Error("Route from har is not supported in thin clients");
        if (options.update) {
          await this.tracing._recordIntoHAR(har, null, options);
          return;
        }
        const harRouter = await HarRouter.create(localUtils, har, options.notFound || "abort", { urlMatch: options.url });
        this._harRouters.push(harRouter);
        await harRouter.addContextRoute(this);
      }
      _disposeHarRouters() {
        this._harRouters.forEach((router) => router.dispose());
        this._harRouters = [];
      }
      async unrouteAll(options) {
        await this._unrouteInternal(this._routes, [], options?.behavior);
        this._disposeHarRouters();
      }
      async unroute(url2, handler) {
        const removed = [];
        const remaining = [];
        for (const route2 of this._routes) {
          if (urlMatchesEqual(route2.url, url2) && (!handler || route2.handler === handler))
            removed.push(route2);
          else
            remaining.push(route2);
        }
        await this._unrouteInternal(removed, remaining, "default");
      }
      async _unrouteInternal(removed, remaining, behavior) {
        this._routes = remaining;
        if (behavior && behavior !== "default") {
          const promises = removed.map((routeHandler) => routeHandler.stop(behavior));
          await Promise.all(promises);
        }
        await this._updateInterceptionPatterns({ title: "Unroute requests" });
      }
      async _updateInterceptionPatterns(options) {
        const patterns = RouteHandler.prepareInterceptionPatterns(this._routes);
        await this._wrapApiCall(() => this._channel.setNetworkInterceptionPatterns({ patterns }), options);
      }
      async _updateWebSocketInterceptionPatterns(options) {
        const patterns = WebSocketRouteHandler.prepareInterceptionPatterns(this._webSocketRoutes);
        await this._wrapApiCall(() => this._channel.setWebSocketInterceptionPatterns({ patterns }), options);
      }
      _effectiveCloseReason() {
        return this._closeReason || this._browser?._closeReason;
      }
      async waitForEvent(event, optionsOrPredicate = {}) {
        return await this._wrapApiCall(async () => {
          const timeout = this._timeoutSettings.timeout(typeof optionsOrPredicate === "function" ? {} : optionsOrPredicate);
          const predicate = typeof optionsOrPredicate === "function" ? optionsOrPredicate : optionsOrPredicate.predicate;
          const waiter = Waiter.createForEvent(this, event);
          waiter.rejectOnTimeout(timeout, `Timeout ${timeout}ms exceeded while waiting for event "${event}"`);
          if (event !== Events.BrowserContext.Close)
            waiter.rejectOnEvent(this, Events.BrowserContext.Close, () => new TargetClosedError2(this._effectiveCloseReason()));
          const result2 = await waiter.waitForEvent(this, event, predicate);
          waiter.dispose();
          return result2;
        });
      }
      async storageState(options = {}) {
        const state = await this._channel.storageState({ indexedDB: options.indexedDB });
        if (options.path) {
          await mkdirIfNeeded2(this._platform, options.path);
          await this._platform.fs().promises.writeFile(options.path, JSON.stringify(state, void 0, 2), "utf8");
        }
        return state;
      }
      async setStorageState(storageState2) {
        const state = await prepareStorageState(this._platform, storageState2);
        await this._channel.setStorageState({ storageState: state });
      }
      backgroundPages() {
        return [];
      }
      serviceWorkers() {
        return [...this._serviceWorkers];
      }
      async newCDPSession(page) {
        if (!(page instanceof Page2) && !(page instanceof Frame2))
          throw new Error("page: expected Page or Frame");
        const result2 = await this._channel.newCDPSession(page instanceof Page2 ? { page: page._channel } : { frame: page._channel });
        return CDPSession2.from(result2.session);
      }
      _onClose() {
        this._closingStatus = "closed";
        this._browser?._contexts.delete(this);
        this._browser?._browserType._contexts.delete(this);
        this._browser?._browserType._playwright.selectors._contextsForSelectors.delete(this);
        this._disposeHarRouters();
        this.tracing._resetStackCounter();
        this.emit(Events.BrowserContext.Close, this);
      }
      async [Symbol.asyncDispose]() {
        await this.close();
      }
      async close(options = {}) {
        if (this.isClosed())
          return;
        this._closeReason = options.reason;
        this._closingStatus = "closing";
        await this.request.dispose(options);
        await this._instrumentation.runBeforeCloseBrowserContext(this);
        await this.tracing._exportAllHars();
        await this._channel.close(options);
        await this._closedPromise;
      }
      async _enableRecorder(params2, eventSink) {
        if (eventSink)
          this._onRecorderEventSink = eventSink;
        await this._channel.enableRecorder(params2);
      }
      async _disableRecorder() {
        this._onRecorderEventSink = void 0;
        await this._channel.disableRecorder();
      }
      async _exposeConsoleApi() {
        await this._channel.exposeConsoleApi();
      }
    };
  }
});

// packages/playwright-core/src/client/browser.ts
var Browser2;
var init_browser2 = __esm({
  "packages/playwright-core/src/client/browser.ts"() {
    "use strict";
    init_artifact2();
    init_browserContext2();
    init_cdpSession();
    init_channelOwner();
    init_errors2();
    init_events();
    init_fileUtils2();
    Browser2 = class extends ChannelOwner {
      constructor(parent, type3, guid, initializer) {
        super(parent, type3, guid, initializer);
        this._contexts = /* @__PURE__ */ new Set();
        this._isConnected = true;
        this._shouldCloseConnectionOnClose = false;
        this._options = {};
        this._name = initializer.name;
        this._browserName = initializer.browserName;
        this._channel.on("context", ({ context: context2 }) => this._didCreateContext(BrowserContext2.from(context2)));
        this._channel.on("close", () => this._didClose());
        this._closedPromise = new Promise((f) => this.once(Events.Browser.Disconnected, f));
      }
      static from(browser) {
        return browser._object;
      }
      browserType() {
        return this._browserType;
      }
      async newContext(options = {}) {
        return await this._innerNewContext(options, false);
      }
      async _newContextForReuse(options = {}) {
        return await this._innerNewContext(options, true);
      }
      async _disconnectFromReusedContext(reason) {
        const context2 = [...this._contexts].find((context3) => context3._forReuse);
        if (!context2)
          return;
        await this._instrumentation.runBeforeCloseBrowserContext(context2);
        for (const page of context2.pages())
          page._onClose();
        context2._onClose();
        await this._channel.disconnectFromReusedContext({ reason });
      }
      async _innerNewContext(userOptions = {}, forReuse) {
        const options = this._browserType._playwright.selectors._withSelectorOptions(userOptions);
        await this._instrumentation.runBeforeCreateBrowserContext(options);
        const contextOptions = await prepareBrowserContextParams(this._platform, options);
        const response2 = forReuse ? await this._channel.newContextForReuse(contextOptions) : await this._channel.newContext(contextOptions);
        const context2 = BrowserContext2.from(response2.context);
        if (forReuse)
          context2._forReuse = true;
        if (options.logger)
          context2._logger = options.logger;
        await context2._initializeHarFromOptions(options.recordHar);
        await this._instrumentation.runAfterCreateBrowserContext(context2);
        return context2;
      }
      _connectToBrowserType(browserType, browserOptions, logger) {
        this._browserType = browserType;
        this._options = browserOptions;
        this._logger = logger;
        for (const context2 of this._contexts)
          this._setupBrowserContext(context2);
      }
      _didCreateContext(context2) {
        context2._browser = this;
        this._contexts.add(context2);
        if (this._browserType)
          this._setupBrowserContext(context2);
        this.emit(Events.Browser.Context, context2);
      }
      _setupBrowserContext(context2) {
        context2._logger = this._logger;
        context2.tracing._tracesDir = this._options.tracesDir;
        this._browserType._contexts.add(context2);
        this._browserType._playwright.selectors._contextsForSelectors.add(context2);
        context2.setDefaultTimeout(this._browserType._playwright._defaultContextTimeout);
        context2.setDefaultNavigationTimeout(this._browserType._playwright._defaultContextNavigationTimeout);
      }
      contexts() {
        return [...this._contexts];
      }
      version() {
        return this._initializer.version;
      }
      async bind(title, options = {}) {
        const { endpoint } = await this._channel.startServer({ title, ...options });
        return { endpoint };
      }
      async unbind() {
        await this._channel.stopServer();
      }
      async newPage(options = {}) {
        return await this._wrapApiCall(async () => {
          const context2 = await this.newContext(options);
          const page = await context2.newPage();
          page._ownedContext = context2;
          context2._ownerPage = page;
          return page;
        }, { title: "Create page" });
      }
      isConnected() {
        return this._isConnected;
      }
      async newBrowserCDPSession() {
        return CDPSession2.from((await this._channel.newBrowserCDPSession()).session);
      }
      async startTracing(page, options = {}) {
        this._path = options.path;
        await this._channel.startTracing({ ...options, page: page ? page._channel : void 0 });
      }
      async stopTracing() {
        const artifact = Artifact2.from((await this._channel.stopTracing()).artifact);
        const buffer = await artifact.readIntoBuffer();
        await artifact.delete();
        if (this._path) {
          await mkdirIfNeeded2(this._platform, this._path);
          await this._platform.fs().promises.writeFile(this._path, buffer);
          this._path = void 0;
        }
        return buffer;
      }
      async [Symbol.asyncDispose]() {
        await this.close();
      }
      async close(options = {}) {
        this._closeReason = options.reason;
        try {
          if (this._shouldCloseConnectionOnClose)
            this._connection.close();
          else
            await this._channel.close(options);
          await this._closedPromise;
        } catch (e) {
          if (isTargetClosedError2(e))
            return;
          throw e;
        }
      }
      _didClose() {
        this._isConnected = false;
        this.emit(Events.Browser.Disconnected, this);
      }
    };
  }
});

// packages/playwright-core/src/client/connect.ts
async function connectToBrowser(playwright2, params2) {
  const deadline = params2.timeout ? monotonicTime() + params2.timeout : 0;
  const nameParam = params2.browserName ? { "x-playwright-browser": params2.browserName } : {};
  const headers = { ...nameParam, ...params2.headers };
  const connectParams = {
    endpoint: params2.endpoint,
    headers,
    exposeNetwork: params2.exposeNetwork,
    slowMo: params2.slowMo,
    timeout: params2.timeout || 0
  };
  if (params2.__testHookRedirectPortForwarding)
    connectParams.socksProxyRedirectPortForTest = params2.__testHookRedirectPortForwarding;
  const connection = await connectToEndpoint(playwright2._connection, connectParams);
  let browser;
  connection.on("close", () => {
    for (const context2 of browser?.contexts() || []) {
      for (const page of context2.pages())
        page._onClose();
      context2._onClose();
    }
    setTimeout(() => browser?._didClose(), 0);
  });
  const result2 = await raceAgainstDeadline(async () => {
    if (params2.__testHookBeforeCreateBrowser)
      await params2.__testHookBeforeCreateBrowser();
    const playwright3 = await connection.initializePlaywright();
    if (!playwright3._initializer.preLaunchedBrowser) {
      connection.close();
      throw new Error("Malformed endpoint. Did you use BrowserType.launchServer method?");
    }
    playwright3.selectors = playwright3.selectors;
    browser = Browser2.from(playwright3._initializer.preLaunchedBrowser);
    browser._shouldCloseConnectionOnClose = true;
    browser.on(Events.Browser.Disconnected, () => connection.close());
    return browser;
  }, deadline);
  if (!result2.timedOut) {
    return result2.result;
  } else {
    connection.close();
    throw new Error(`Timeout ${params2.timeout}ms exceeded`);
  }
}
async function connectToEndpoint(parentConnection, params2) {
  const localUtils = parentConnection.localUtils();
  const transport = localUtils ? new JsonPipeTransport(localUtils) : new WebSocketTransport2();
  const connectHeaders = await transport.connect(params2);
  const connection = new Connection(parentConnection._platform, localUtils, parentConnection._instrumentation, connectHeaders);
  connection.markAsRemote();
  connection.on("close", () => transport.close());
  let closeError;
  const onTransportClosed = (reason) => {
    connection.close(reason || closeError);
  };
  transport.onClose((reason) => onTransportClosed(reason));
  connection.onmessage = (message) => transport.send(message).catch(() => onTransportClosed());
  transport.onMessage((message) => {
    try {
      connection.dispatch(message);
    } catch (e) {
      closeError = String(e);
      transport.close().catch(() => {
      });
    }
  });
  return connection;
}
var JsonPipeTransport, WebSocketTransport2;
var init_connect = __esm({
  "packages/playwright-core/src/client/connect.ts"() {
    "use strict";
    init_time();
    init_timeoutRunner();
    init_browser2();
    init_connection();
    init_events();
    JsonPipeTransport = class {
      constructor(owner) {
        this._owner = owner;
      }
      async connect(params2) {
        const { pipe, headers: connectHeaders } = await this._owner._channel.connect(params2);
        this._pipe = pipe;
        return connectHeaders;
      }
      async send(message) {
        await this._pipe.send({ message });
      }
      onMessage(callback) {
        this._pipe.on("message", ({ message }) => callback(message));
      }
      onClose(callback) {
        this._pipe.on("closed", ({ reason }) => callback(reason));
      }
      async close() {
        await this._pipe.close().catch(() => {
        });
      }
    };
    WebSocketTransport2 = class {
      async connect(params2) {
        this._ws = new window.WebSocket(params2.endpoint);
        return [];
      }
      async send(message) {
        this._ws.send(JSON.stringify(message));
      }
      onMessage(callback) {
        this._ws.addEventListener("message", (event) => callback(JSON.parse(event.data)));
      }
      onClose(callback) {
        this._ws.addEventListener("close", () => callback());
      }
      async close() {
        this._ws.close();
      }
    };
  }
});

// packages/playwright-core/src/client/android.ts
async function loadFile(platform, file) {
  if (isString(file))
    return await platform.fs().promises.readFile(file);
  return file;
}
function toSelectorChannel(selector) {
  const {
    checkable,
    checked,
    clazz,
    clickable,
    depth,
    desc,
    enabled,
    focusable,
    focused,
    hasChild,
    hasDescendant,
    longClickable,
    pkg,
    res,
    scrollable,
    selected,
    text: text2
  } = selector;
  const toRegex = (value2) => {
    if (value2 === void 0)
      return void 0;
    if (isRegExp(value2))
      return value2.source;
    return "^" + value2.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d") + "$";
  };
  return {
    checkable,
    checked,
    clazz: toRegex(clazz),
    pkg: toRegex(pkg),
    desc: toRegex(desc),
    res: toRegex(res),
    text: toRegex(text2),
    clickable,
    depth,
    enabled,
    focusable,
    focused,
    hasChild: hasChild ? { androidSelector: toSelectorChannel(hasChild.selector) } : void 0,
    hasDescendant: hasDescendant ? { androidSelector: toSelectorChannel(hasDescendant.selector), maxDepth: hasDescendant.maxDepth } : void 0,
    longClickable,
    scrollable,
    selected
  };
}
var Android2, AndroidDevice2, AndroidSocket, AndroidInput, AndroidWebView;
var init_android2 = __esm({
  "packages/playwright-core/src/client/android.ts"() {
    "use strict";
    init_rtti();
    init_time();
    init_timeoutRunner();
    init_eventEmitter();
    init_browserContext2();
    init_channelOwner();
    init_errors2();
    init_events();
    init_waiter();
    init_timeoutSettings();
    init_connect();
    Android2 = class extends ChannelOwner {
      static from(android) {
        return android._object;
      }
      constructor(parent, type3, guid, initializer) {
        super(parent, type3, guid, initializer);
        this._timeoutSettings = new TimeoutSettings(this._platform);
      }
      setDefaultTimeout(timeout) {
        this._timeoutSettings.setDefaultTimeout(timeout);
      }
      async devices(options = {}) {
        const { devices } = await this._channel.devices(options);
        return devices.map((d) => AndroidDevice2.from(d));
      }
      async launchServer(options = {}) {
        if (!this._serverLauncher)
          throw new Error("Launching server is not supported");
        return await this._serverLauncher.launchServer(options);
      }
      async connect(endpoint, options = {}) {
        return await this._wrapApiCall(async () => {
          const deadline = options.timeout ? monotonicTime() + options.timeout : 0;
          const headers = { "x-playwright-browser": "android", ...options.headers };
          const connectParams = { endpoint, headers, slowMo: options.slowMo, timeout: options.timeout || 0 };
          const connection = await connectToEndpoint(this._connection, connectParams);
          let device;
          connection.on("close", () => {
            device?._didClose();
          });
          const result2 = await raceAgainstDeadline(async () => {
            const playwright2 = await connection.initializePlaywright();
            if (!playwright2._initializer.preConnectedAndroidDevice) {
              connection.close();
              throw new Error("Malformed endpoint. Did you use Android.launchServer method?");
            }
            device = AndroidDevice2.from(playwright2._initializer.preConnectedAndroidDevice);
            device._shouldCloseConnectionOnClose = true;
            device.on(Events.AndroidDevice.Close, () => connection.close());
            return device;
          }, deadline);
          if (!result2.timedOut) {
            return result2.result;
          } else {
            connection.close();
            throw new Error(`Timeout ${options.timeout}ms exceeded`);
          }
        });
      }
    };
    AndroidDevice2 = class extends ChannelOwner {
      constructor(parent, type3, guid, initializer) {
        super(parent, type3, guid, initializer);
        this._webViews = /* @__PURE__ */ new Map();
        this._shouldCloseConnectionOnClose = false;
        this._android = parent;
        this.input = new AndroidInput(this);
        this._timeoutSettings = new TimeoutSettings(this._platform, parent._timeoutSettings);
        this._channel.on("webViewAdded", ({ webView }) => this._onWebViewAdded(webView));
        this._channel.on("webViewRemoved", ({ socketName }) => this._onWebViewRemoved(socketName));
        this._channel.on("close", () => this._didClose());
      }
      static from(androidDevice) {
        return androidDevice._object;
      }
      _onWebViewAdded(webView) {
        const view = new AndroidWebView(this, webView);
        this._webViews.set(webView.socketName, view);
        this.emit(Events.AndroidDevice.WebView, view);
      }
      _onWebViewRemoved(socketName) {
        const view = this._webViews.get(socketName);
        this._webViews.delete(socketName);
        if (view)
          view.emit(Events.AndroidWebView.Close);
      }
      setDefaultTimeout(timeout) {
        this._timeoutSettings.setDefaultTimeout(timeout);
      }
      serial() {
        return this._initializer.serial;
      }
      model() {
        return this._initializer.model;
      }
      webViews() {
        return [...this._webViews.values()];
      }
      async webView(selector, options) {
        const predicate = (v) => {
          if (selector.pkg)
            return v.pkg() === selector.pkg;
          if (selector.socketName)
            return v._socketName() === selector.socketName;
          return false;
        };
        const webView = [...this._webViews.values()].find(predicate);
        if (webView)
          return webView;
        return await this.waitForEvent("webview", { ...options, predicate });
      }
      async wait(selector, options = {}) {
        await this._channel.wait({ androidSelector: toSelectorChannel(selector), ...options, timeout: this._timeoutSettings.timeout(options) });
      }
      async fill(selector, text2, options = {}) {
        await this._channel.fill({ androidSelector: toSelectorChannel(selector), text: text2, ...options, timeout: this._timeoutSettings.timeout(options) });
      }
      async press(selector, key, options = {}) {
        await this.tap(selector, options);
        await this.input.press(key);
      }
      async tap(selector, options = {}) {
        await this._channel.tap({ androidSelector: toSelectorChannel(selector), ...options, timeout: this._timeoutSettings.timeout(options) });
      }
      async drag(selector, dest, options = {}) {
        await this._channel.drag({ androidSelector: toSelectorChannel(selector), dest, ...options, timeout: this._timeoutSettings.timeout(options) });
      }
      async fling(selector, direction, options = {}) {
        await this._channel.fling({ androidSelector: toSelectorChannel(selector), direction, ...options, timeout: this._timeoutSettings.timeout(options) });
      }
      async longTap(selector, options = {}) {
        await this._channel.longTap({ androidSelector: toSelectorChannel(selector), ...options, timeout: this._timeoutSettings.timeout(options) });
      }
      async pinchClose(selector, percent, options = {}) {
        await this._channel.pinchClose({ androidSelector: toSelectorChannel(selector), percent, ...options, timeout: this._timeoutSettings.timeout(options) });
      }
      async pinchOpen(selector, percent, options = {}) {
        await this._channel.pinchOpen({ androidSelector: toSelectorChannel(selector), percent, ...options, timeout: this._timeoutSettings.timeout(options) });
      }
      async scroll(selector, direction, percent, options = {}) {
        await this._channel.scroll({ androidSelector: toSelectorChannel(selector), direction, percent, ...options, timeout: this._timeoutSettings.timeout(options) });
      }
      async swipe(selector, direction, percent, options = {}) {
        await this._channel.swipe({ androidSelector: toSelectorChannel(selector), direction, percent, ...options, timeout: this._timeoutSettings.timeout(options) });
      }
      async info(selector) {
        return (await this._channel.info({ androidSelector: toSelectorChannel(selector) })).info;
      }
      async screenshot(options = {}) {
        const { binary } = await this._channel.screenshot();
        if (options.path)
          await this._platform.fs().promises.writeFile(options.path, binary);
        return binary;
      }
      async [Symbol.asyncDispose]() {
        await this.close();
      }
      async close() {
        try {
          if (this._shouldCloseConnectionOnClose)
            this._connection.close();
          else
            await this._channel.close();
        } catch (e) {
          if (isTargetClosedError2(e))
            return;
          throw e;
        }
      }
      _didClose() {
        this.emit(Events.AndroidDevice.Close, this);
      }
      async shell(command) {
        const { result: result2 } = await this._channel.shell({ command });
        return result2;
      }
      async open(command) {
        return AndroidSocket.from((await this._channel.open({ command })).socket);
      }
      async installApk(file, options) {
        await this._channel.installApk({ file: await loadFile(this._platform, file), args: options && options.args });
      }
      async push(file, path59, options) {
        await this._channel.push({ file: await loadFile(this._platform, file), path: path59, mode: options ? options.mode : void 0 });
      }
      async launchBrowser(options = {}) {
        const contextOptions = await prepareBrowserContextParams(this._platform, options);
        const result2 = await this._channel.launchBrowser(contextOptions);
        const context2 = BrowserContext2.from(result2.context);
        const selectors = this._android._playwright.selectors;
        selectors._contextsForSelectors.add(context2);
        context2.once(Events.BrowserContext.Close, () => selectors._contextsForSelectors.delete(context2));
        await context2._initializeHarFromOptions(options.recordHar);
        return context2;
      }
      async waitForEvent(event, optionsOrPredicate = {}) {
        return await this._wrapApiCall(async () => {
          const timeout = this._timeoutSettings.timeout(typeof optionsOrPredicate === "function" ? {} : optionsOrPredicate);
          const predicate = typeof optionsOrPredicate === "function" ? optionsOrPredicate : optionsOrPredicate.predicate;
          const waiter = Waiter.createForEvent(this, event);
          waiter.rejectOnTimeout(timeout, `Timeout ${timeout}ms exceeded while waiting for event "${event}"`);
          if (event !== Events.AndroidDevice.Close)
            waiter.rejectOnEvent(this, Events.AndroidDevice.Close, () => new TargetClosedError2());
          const result2 = await waiter.waitForEvent(this, event, predicate);
          waiter.dispose();
          return result2;
        });
      }
    };
    AndroidSocket = class extends ChannelOwner {
      static from(androidDevice) {
        return androidDevice._object;
      }
      constructor(parent, type3, guid, initializer) {
        super(parent, type3, guid, initializer);
        this._channel.on("data", ({ data }) => this.emit(Events.AndroidSocket.Data, data));
        this._channel.on("close", () => this.emit(Events.AndroidSocket.Close));
      }
      async write(data) {
        await this._channel.write({ data });
      }
      async close() {
        await this._channel.close();
      }
      async [Symbol.asyncDispose]() {
        await this.close();
      }
    };
    AndroidInput = class {
      constructor(device) {
        this._device = device;
      }
      async type(text2) {
        await this._device._channel.inputType({ text: text2 });
      }
      async press(key) {
        await this._device._channel.inputPress({ key });
      }
      async tap(point) {
        await this._device._channel.inputTap({ point });
      }
      async swipe(from, segments, steps) {
        await this._device._channel.inputSwipe({ segments, steps });
      }
      async drag(from, to, steps) {
        await this._device._channel.inputDrag({ from, to, steps });
      }
    };
    AndroidWebView = class extends EventEmitter3 {
      constructor(device, data) {
        super(device._platform);
        this._device = device;
        this._data = data;
      }
      pid() {
        return this._data.pid;
      }
      pkg() {
        return this._data.pkg;
      }
      _socketName() {
        return this._data.socketName;
      }
      async page() {
        if (!this._pagePromise)
          this._pagePromise = this._fetchPage();
        return await this._pagePromise;
      }
      async _fetchPage() {
        const { context: context2 } = await this._device._channel.connectToWebView({ socketName: this._data.socketName });
        return BrowserContext2.from(context2).pages()[0];
      }
    };
  }
});

// packages/playwright-core/src/client/browserType.ts
function isConnectionTransport(value2) {
  return !!value2 && typeof value2 === "object" && typeof value2.send === "function" && typeof value2.close === "function";
}
var BrowserType2;
var init_browserType2 = __esm({
  "packages/playwright-core/src/client/browserType.ts"() {
    "use strict";
    init_assert();
    init_headers();
    init_browser2();
    init_browserContext2();
    init_channelOwner();
    init_clientHelper();
    init_connect();
    init_timeoutSettings();
    init_worker();
    BrowserType2 = class extends ChannelOwner {
      constructor() {
        super(...arguments);
        this._contexts = /* @__PURE__ */ new Set();
      }
      static from(browserType) {
        return browserType._object;
      }
      executablePath() {
        if (!this._initializer.executablePath)
          throw new Error("Browser is not supported on current platform");
        return this._initializer.executablePath;
      }
      name() {
        return this._initializer.name;
      }
      async launch(options = {}) {
        assert(!options.userDataDir, "userDataDir option is not supported in `browserType.launch`. Use `browserType.launchPersistentContext` instead");
        assert(!options.port, "Cannot specify a port without launching as a server.");
        const logger = options.logger || this._playwright._defaultLaunchOptions?.logger;
        options = { ...this._playwright._defaultLaunchOptions, ...options };
        const launchOptions = {
          ...options,
          ignoreDefaultArgs: Array.isArray(options.ignoreDefaultArgs) ? options.ignoreDefaultArgs : void 0,
          ignoreAllDefaultArgs: !!options.ignoreDefaultArgs && !Array.isArray(options.ignoreDefaultArgs),
          env: options.env ? envObjectToArray2(options.env) : void 0,
          timeout: new TimeoutSettings(this._platform).launchTimeout(options)
        };
        return await this._wrapApiCall(async () => {
          const browser = Browser2.from((await this._channel.launch(launchOptions)).browser);
          browser._connectToBrowserType(this, options, logger);
          return browser;
        });
      }
      async launchServer(options = {}) {
        if (!this._serverLauncher)
          throw new Error("Launching server is not supported");
        options = { ...this._playwright._defaultLaunchOptions, ...options };
        return await this._serverLauncher.launchServer(options);
      }
      async launchPersistentContext(userDataDir, options = {}) {
        assert(!options.port, "Cannot specify a port without launching as a server.");
        options = this._playwright.selectors._withSelectorOptions({
          ...this._playwright._defaultLaunchOptions,
          ...options
        });
        await this._instrumentation.runBeforeCreateBrowserContext(options);
        const logger = options.logger || this._playwright._defaultLaunchOptions?.logger;
        const contextParams = await prepareBrowserContextParams(this._platform, options);
        const persistentParams = {
          ...contextParams,
          ignoreDefaultArgs: Array.isArray(options.ignoreDefaultArgs) ? options.ignoreDefaultArgs : void 0,
          ignoreAllDefaultArgs: !!options.ignoreDefaultArgs && !Array.isArray(options.ignoreDefaultArgs),
          env: options.env ? envObjectToArray2(options.env) : void 0,
          channel: options.channel,
          userDataDir: this._platform.path().isAbsolute(userDataDir) || !userDataDir ? userDataDir : this._platform.path().resolve(userDataDir),
          timeout: new TimeoutSettings(this._platform).launchTimeout(options)
        };
        const context2 = await this._wrapApiCall(async () => {
          const result2 = await this._channel.launchPersistentContext(persistentParams);
          const browser = Browser2.from(result2.browser);
          browser._connectToBrowserType(this, options, logger);
          const context3 = BrowserContext2.from(result2.context);
          await context3._initializeHarFromOptions(options.recordHar);
          return context3;
        });
        await this._instrumentation.runAfterCreateBrowserContext(context2);
        return context2;
      }
      async connect(optionsOrEndpoint, options) {
        if (typeof optionsOrEndpoint === "string")
          return await this._connect({ ...options, endpoint: optionsOrEndpoint });
        assert(optionsOrEndpoint.wsEndpoint, "options.wsEndpoint is required");
        return await this._connect({ ...options, endpoint: optionsOrEndpoint.wsEndpoint });
      }
      async _connect(params2) {
        return await this._wrapApiCall(async () => {
          const browser = await connectToBrowser(this._playwright, { browserName: this.name(), ...params2 });
          browser._connectToBrowserType(this, {}, void 0);
          return browser;
        });
      }
      async connectOverCDP(overloaded, options) {
        let endpointURL;
        let transport;
        let params2;
        if (typeof overloaded === "string") {
          endpointURL = overloaded;
          params2 = options ?? {};
        } else if (isConnectionTransport(overloaded)) {
          if (this.name() !== "chromium" && this.name() !== "webkit")
            throw new Error("Connecting over CDP is only supported in Chromium and WebKit.");
          if (this._connection.isRemote())
            throw new Error("Passing a ConnectionTransport to connectOverCDP is not supported when connecting remotely.");
          transport = overloaded;
          params2 = options ?? {};
        } else {
          endpointURL = "endpointURL" in overloaded ? overloaded.endpointURL : overloaded.wsEndpoint;
          assert(endpointURL, "Cannot connect over CDP without wsEndpoint.");
          params2 = overloaded;
        }
        if (endpointURL && this.name() !== "chromium" && this.name() !== "webkit")
          throw new Error("Connecting over CDP is only supported in Chromium and WebKit.");
        const result2 = await this._channel.connectOverCDP({
          endpointURL,
          transport,
          headers: params2.headers ? headersObjectToArray(params2.headers) : void 0,
          slowMo: params2.slowMo,
          timeout: new TimeoutSettings(this._platform).timeout(params2),
          isLocal: params2.isLocal,
          noDefaults: params2.noDefaults,
          artifactsDir: params2.artifactsDir
        });
        return await this._browserFromConnectResult(result2);
      }
      async _browserFromConnectResult(result2) {
        const browser = Browser2.from(result2.browser);
        browser._connectToBrowserType(this, {}, void 0);
        if (result2.defaultContext)
          await this._instrumentation.runAfterCreateBrowserContext(BrowserContext2.from(result2.defaultContext));
        return browser;
      }
      async _connectToWorker(endpoint, options = {}) {
        if (this.name() !== "chromium")
          throw new Error("Connecting to workers is only supported in Chromium.");
        const result2 = await this._channel.connectToWorker({
          endpoint,
          timeout: new TimeoutSettings(this._platform).timeout(options)
        });
        return Worker2.from(result2.worker);
      }
    };
  }
});

// packages/playwright-core/src/client/clientInstrumentation.ts
function createInstrumentation2() {
  const listeners = [];
  return new Proxy({}, {
    get: (obj, prop) => {
      if (typeof prop !== "string")
        return obj[prop];
      if (prop === "addListener")
        return (listener) => listeners.push(listener);
      if (prop === "removeListener")
        return (listener) => listeners.splice(listeners.indexOf(listener), 1);
      if (prop === "removeAllListeners")
        return () => listeners.splice(0, listeners.length);
      if (prop.startsWith("run")) {
        return async (...params2) => {
          for (const listener of listeners)
            await listener[prop]?.(...params2);
        };
      }
      if (prop.startsWith("on")) {
        return (...params2) => {
          for (const listener of listeners)
            listener[prop]?.(...params2);
        };
      }
      return obj[prop];
    }
  });
}
var init_clientInstrumentation = __esm({
  "packages/playwright-core/src/client/clientInstrumentation.ts"() {
    "use strict";
  }
});

// packages/playwright-core/src/client/electron.ts
var Electron2, ElectronApplication2;
var init_electron2 = __esm({
  "packages/playwright-core/src/client/electron.ts"() {
    "use strict";
    init_browserContext2();
    init_channelOwner();
    init_clientHelper();
    init_consoleMessage();
    init_errors2();
    init_events();
    init_jsHandle();
    init_waiter();
    init_timeoutSettings();
    Electron2 = class extends ChannelOwner {
      static from(electron) {
        return electron._object;
      }
      constructor(parent, type3, guid, initializer) {
        super(parent, type3, guid, initializer);
      }
      async launch(options = {}) {
        options = this._playwright.selectors._withSelectorOptions(options);
        const params2 = {
          ...await prepareBrowserContextParams(this._platform, options),
          env: envObjectToArray2(options.env ? options.env : this._platform.env),
          tracesDir: options.tracesDir,
          artifactsDir: options.artifactsDir,
          timeout: new TimeoutSettings(this._platform).launchTimeout(options)
        };
        const app = ElectronApplication2.from((await this._channel.launch(params2)).electronApplication);
        this._playwright.selectors._contextsForSelectors.add(app._context);
        app.once(Events.ElectronApplication.Close, () => this._playwright.selectors._contextsForSelectors.delete(app._context));
        await app._context._initializeHarFromOptions(options.recordHar);
        app._context.tracing._tracesDir = options.tracesDir;
        return app;
      }
    };
    ElectronApplication2 = class extends ChannelOwner {
      constructor(parent, type3, guid, initializer) {
        super(parent, type3, guid, initializer);
        this._windows = /* @__PURE__ */ new Set();
        this._timeoutSettings = new TimeoutSettings(this._platform);
        this._context = BrowserContext2.from(initializer.context);
        for (const page of this._context._pages)
          this._onPage(page);
        this._context.on(Events.BrowserContext.Page, (page) => this._onPage(page));
        this._channel.on("close", () => {
          this.emit(Events.ElectronApplication.Close);
        });
        this._channel.on("console", (event) => this.emit(Events.ElectronApplication.Console, new ConsoleMessage2(this._platform, event, null, null)));
        this._setEventToSubscriptionMapping(/* @__PURE__ */ new Map([
          [Events.ElectronApplication.Console, "console"]
        ]));
      }
      static from(electronApplication) {
        return electronApplication._object;
      }
      process() {
        return this._connection.toImpl?.(this)?.process();
      }
      _onPage(page) {
        this._windows.add(page);
        this.emit(Events.ElectronApplication.Window, page);
        page.once(Events.Page.Close, () => this._windows.delete(page));
      }
      windows() {
        return [...this._windows];
      }
      async firstWindow(options) {
        if (this._windows.size)
          return this._windows.values().next().value;
        return await this.waitForEvent("window", options);
      }
      context() {
        return this._context;
      }
      async [Symbol.asyncDispose]() {
        await this.close();
      }
      async close() {
        try {
          await this._context.close();
        } catch (e) {
          if (isTargetClosedError2(e))
            return;
          throw e;
        }
      }
      async waitForEvent(event, optionsOrPredicate = {}) {
        return await this._wrapApiCall(async () => {
          const timeout = this._timeoutSettings.timeout(typeof optionsOrPredicate === "function" ? {} : optionsOrPredicate);
          const predicate = typeof optionsOrPredicate === "function" ? optionsOrPredicate : optionsOrPredicate.predicate;
          const waiter = Waiter.createForEvent(this, event);
          waiter.rejectOnTimeout(timeout, `Timeout ${timeout}ms exceeded while waiting for event "${event}"`);
          if (event !== Events.ElectronApplication.Close)
            waiter.rejectOnEvent(this, Events.ElectronApplication.Close, () => new TargetClosedError2());
          const result2 = await waiter.waitForEvent(this, event, predicate);
          waiter.dispose();
          return result2;
        });
      }
      async browserWindow(page) {
        const result2 = await this._channel.browserWindow({ page: page._channel });
        return JSHandle2.from(result2.handle);
      }
      async evaluate(pageFunction, arg) {
        const result2 = await this._channel.evaluateExpression({ expression: String(pageFunction), isFunction: typeof pageFunction === "function", arg: serializeArgument(arg) });
        return parseResult(result2.value);
      }
      async evaluateHandle(pageFunction, arg) {
        const result2 = await this._channel.evaluateExpressionHandle({ expression: String(pageFunction), isFunction: typeof pageFunction === "function", arg: serializeArgument(arg) });
        return JSHandle2.from(result2.handle);
      }
    };
  }
});

// packages/playwright-core/src/client/jsonPipe.ts
var JsonPipe;
var init_jsonPipe = __esm({
  "packages/playwright-core/src/client/jsonPipe.ts"() {
    "use strict";
    init_channelOwner();
    JsonPipe = class extends ChannelOwner {
      static from(jsonPipe) {
        return jsonPipe._object;
      }
      constructor(parent, type3, guid, initializer) {
        super(parent, type3, guid, initializer);
      }
      channel() {
        return this._channel;
      }
    };
  }
});

// packages/playwright-core/src/client/localUtils.ts
var LocalUtils;
var init_localUtils2 = __esm({
  "packages/playwright-core/src/client/localUtils.ts"() {
    "use strict";
    init_channelOwner();
    LocalUtils = class extends ChannelOwner {
      constructor(parent, type3, guid, initializer) {
        super(parent, type3, guid, initializer);
        this.devices = {};
        for (const { name, descriptor } of initializer.deviceDescriptors)
          this.devices[name] = descriptor;
      }
      async zip(params2) {
        return await this._channel.zip(params2);
      }
      async harOpen(params2) {
        return await this._channel.harOpen(params2);
      }
      async harLookup(params2) {
        return await this._channel.harLookup(params2);
      }
      async harClose(params2) {
        return await this._channel.harClose(params2);
      }
      async harUnzip(params2) {
        return await this._channel.harUnzip(params2);
      }
      async tracingStarted(params2) {
        return await this._channel.tracingStarted(params2);
      }
      async traceDiscarded(params2) {
        return await this._channel.traceDiscarded(params2);
      }
      async addStackToTracingNoReply(params2) {
        return await this._channel.addStackToTracingNoReply(params2);
      }
    };
  }
});

// packages/playwright-core/src/client/selectors.ts
var Selectors2;
var init_selectors2 = __esm({
  "packages/playwright-core/src/client/selectors.ts"() {
    "use strict";
    init_clientHelper();
    init_locator();
    Selectors2 = class {
      constructor(platform) {
        this._selectorEngines = [];
        this._contextsForSelectors = /* @__PURE__ */ new Set();
        this._platform = platform;
      }
      async register(name, script, options = {}) {
        if (this._selectorEngines.some((engine) => engine.name === name))
          throw new Error(`selectors.register: "${name}" selector engine has been already registered`);
        const source11 = await evaluationScript(this._platform, script, void 0, false);
        const selectorEngine = { ...options, name, source: source11 };
        for (const context2 of this._contextsForSelectors)
          await context2._channel.registerSelectorEngine({ selectorEngine });
        this._selectorEngines.push(selectorEngine);
      }
      setTestIdAttribute(attributeName) {
        this._testIdAttributeName = attributeName;
        setTestIdAttribute(attributeName);
        for (const context2 of this._contextsForSelectors) {
          context2._options.testIdAttributeName = attributeName;
          context2._channel.setTestIdAttributeName({ testIdAttributeName: attributeName }).catch(() => {
          });
        }
      }
      _withSelectorOptions(options) {
        return { ...options, selectorEngines: this._selectorEngines, testIdAttributeName: this._testIdAttributeName };
      }
    };
  }
});

// packages/playwright-core/src/client/playwright.ts
var Playwright2;
var init_playwright2 = __esm({
  "packages/playwright-core/src/client/playwright.ts"() {
    "use strict";
    init_android2();
    init_browser2();
    init_browserType2();
    init_channelOwner();
    init_electron2();
    init_errors2();
    init_fetch2();
    init_selectors2();
    Playwright2 = class extends ChannelOwner {
      constructor(parent, type3, guid, initializer) {
        super(parent, type3, guid, initializer);
        this.request = new APIRequest(this);
        this.chromium = BrowserType2.from(initializer.chromium);
        this.chromium._playwright = this;
        this.firefox = BrowserType2.from(initializer.firefox);
        this.firefox._playwright = this;
        this.webkit = BrowserType2.from(initializer.webkit);
        this.webkit._playwright = this;
        this._android = Android2.from(initializer.android);
        this._android._playwright = this;
        this._electron = Electron2.from(initializer.electron);
        this._electron._playwright = this;
        this.devices = this._connection.localUtils()?.devices ?? {};
        this.selectors = new Selectors2(this._connection._platform);
        this.errors = { TimeoutError: TimeoutError2 };
      }
      static from(channel) {
        return channel._object;
      }
      _browserTypes() {
        return [this.chromium, this.firefox, this.webkit];
      }
      _preLaunchedBrowser() {
        const browser = Browser2.from(this._initializer.preLaunchedBrowser);
        browser._connectToBrowserType(this[browser._name], {}, void 0);
        return browser;
      }
      _allContexts() {
        return this._browserTypes().flatMap((type3) => [...type3._contexts]);
      }
      _allPages() {
        return this._allContexts().flatMap((context2) => context2.pages());
      }
    };
  }
});

// packages/playwright-core/src/client/connection.ts
function formatCallLog(platform, log2) {
  if (!log2 || !log2.some((l) => !!l))
    return "";
  return `
Call log:
${platform.colors.dim(log2.join("\n"))}
`;
}
var Root, DummyChannelOwner, Connection;
var init_connection = __esm({
  "packages/playwright-core/src/client/connection.ts"() {
    "use strict";
    init_stackTrace();
    init_eventEmitter();
    init_android2();
    init_artifact2();
    init_browser2();
    init_browserContext2();
    init_browserType2();
    init_cdpSession();
    init_channelOwner();
    init_clientInstrumentation();
    init_debugger2();
    init_dialog2();
    init_disposable3();
    init_electron2();
    init_elementHandle();
    init_errors2();
    init_fetch2();
    init_frame();
    init_jsHandle();
    init_jsonPipe();
    init_localUtils2();
    init_network3();
    init_page2();
    init_playwright2();
    init_stream();
    init_tracing2();
    init_worker();
    init_writableStream();
    init_validator();
    Root = class extends ChannelOwner {
      constructor(connection) {
        super(connection, "Root", "", {});
      }
      async initialize() {
        return Playwright2.from((await this._channel.initialize({
          sdkLanguage: "javascript"
        })).playwright);
      }
    };
    DummyChannelOwner = class extends ChannelOwner {
    };
    Connection = class extends EventEmitter3 {
      constructor(platform, localUtils, instrumentation, headers = []) {
        super(platform);
        this._objects = /* @__PURE__ */ new Map();
        this.onmessage = (message) => {
        };
        this._lastId = 0;
        this._callbacks = /* @__PURE__ */ new Map();
        this._isRemote = false;
        this._rawBuffers = false;
        this._tracingCount = 0;
        this._objectFactories = /* @__PURE__ */ new Map();
        this._instrumentation = instrumentation || createInstrumentation2();
        this._localUtils = localUtils;
        this._rootObject = new Root(this);
        this.headers = headers;
        this.registerObjectFactories({
          Android: (parent, type3, guid, init) => new Android2(parent, type3, guid, init),
          AndroidDevice: (parent, type3, guid, init) => new AndroidDevice2(parent, type3, guid, init),
          AndroidSocket: (parent, type3, guid, init) => new AndroidSocket(parent, type3, guid, init),
          APIRequestContext: (parent, type3, guid, init) => new APIRequestContext2(parent, type3, guid, init),
          Artifact: (parent, type3, guid, init) => new Artifact2(parent, type3, guid, init),
          BindingCall: (parent, type3, guid, init) => new BindingCall(parent, type3, guid, init),
          Browser: (parent, type3, guid, init) => new Browser2(parent, type3, guid, init),
          BrowserContext: (parent, type3, guid, init) => new BrowserContext2(parent, type3, guid, init),
          BrowserType: (parent, type3, guid, init) => new BrowserType2(parent, type3, guid, init),
          CDPSession: (parent, type3, guid, init) => new CDPSession2(parent, type3, guid, init),
          Debugger: (parent, type3, guid, init) => new Debugger2(parent, type3, guid, init),
          Dialog: (parent, type3, guid, init) => new Dialog2(parent, type3, guid, init),
          Disposable: (parent, type3, guid, init) => new DisposableObject2(parent, type3, guid, init),
          Electron: (parent, type3, guid, init) => new Electron2(parent, type3, guid, init),
          ElectronApplication: (parent, type3, guid, init) => new ElectronApplication2(parent, type3, guid, init),
          ElementHandle: (parent, type3, guid, init) => new ElementHandle2(parent, type3, guid, init),
          Frame: (parent, type3, guid, init) => new Frame2(parent, type3, guid, init),
          JSHandle: (parent, type3, guid, init) => new JSHandle2(parent, type3, guid, init),
          JsonPipe: (parent, type3, guid, init) => new JsonPipe(parent, type3, guid, init),
          LocalUtils: (parent, type3, guid, init) => {
            const result2 = new LocalUtils(parent, type3, guid, init);
            if (!this._localUtils)
              this._localUtils = result2;
            return result2;
          },
          Page: (parent, type3, guid, init) => new Page2(parent, type3, guid, init),
          Playwright: (parent, type3, guid, init) => new Playwright2(parent, type3, guid, init),
          Request: (parent, type3, guid, init) => new Request2(parent, type3, guid, init),
          Response: (parent, type3, guid, init) => new Response3(parent, type3, guid, init),
          Route: (parent, type3, guid, init) => new Route2(parent, type3, guid, init),
          Stream: (parent, type3, guid, init) => new Stream(parent, type3, guid, init),
          SocksSupport: (parent, type3, guid, init) => new DummyChannelOwner(parent, type3, guid, init),
          Tracing: (parent, type3, guid, init) => new Tracing2(parent, type3, guid, init),
          WebSocket: (parent, type3, guid, init) => new WebSocket2(parent, type3, guid, init),
          WebSocketRoute: (parent, type3, guid, init) => new WebSocketRoute(parent, type3, guid, init),
          Worker: (parent, type3, guid, init) => new Worker2(parent, type3, guid, init),
          WritableStream: (parent, type3, guid, init) => new WritableStream(parent, type3, guid, init)
        });
      }
      registerObjectFactories(factories) {
        for (const [type3, factory] of Object.entries(factories))
          this._objectFactories.set(type3, factory);
      }
      markAsRemote() {
        this._isRemote = true;
      }
      isRemote() {
        return this._isRemote;
      }
      useRawBuffers() {
        this._rawBuffers = true;
      }
      rawBuffers() {
        return this._rawBuffers;
      }
      localUtils() {
        return this._localUtils;
      }
      async initializePlaywright() {
        return await this._rootObject.initialize();
      }
      getObjectWithKnownName(guid) {
        return this._objects.get(guid);
      }
      setIsTracing(isTracing) {
        if (isTracing)
          this._tracingCount++;
        else
          this._tracingCount--;
      }
      async sendMessageToServer(object, method, params2, options) {
        if (method === "__waitInfo__" && (this._closedError || object._wasCollected))
          return;
        if (this._closedError)
          throw this._closedError;
        if (object._wasCollected)
          throw new Error("The object has been collected to prevent unbounded heap growth.");
        const guid = object._guid;
        const type3 = object._type;
        const id = ++this._lastId;
        const message = { id, guid, method, params: params2 };
        if (this._platform.isLogEnabled("channel")) {
          this._platform.log("channel", "SEND> " + JSON.stringify(message));
        }
        const location2 = options.frames?.[0] ? { file: options.frames[0].file, line: options.frames[0].line, column: options.frames[0].column } : void 0;
        const metadata = { title: options.title, location: location2, internal: options.internal, stepId: options.stepId };
        if (this._tracingCount && options.frames && type3 !== "LocalUtils")
          this._localUtils?.addStackToTracingNoReply({ callData: { stack: options.frames ?? [], id } }).catch(() => {
          });
        this._platform.zones.empty.run(() => this.onmessage({ ...message, metadata }));
        if (method === "__waitInfo__")
          return;
        return await new Promise((resolve, reject) => this._callbacks.set(id, { resolve, reject, title: options.title, type: type3, method }));
      }
      _validatorFromWireContext() {
        return {
          tChannelImpl: this._tChannelImplFromWire.bind(this),
          binary: this._rawBuffers ? "buffer" : "fromBase64",
          isUnderTest: () => this._platform.isUnderTest()
        };
      }
      dispatch(message) {
        if (this._closedError)
          return;
        const { id, guid, method, params: params2, result: result2, error, errorDetails, log: log2 } = message;
        if (id) {
          if (this._platform.isLogEnabled("channel"))
            this._platform.log("channel", "<RECV " + JSON.stringify(message));
          const callback = this._callbacks.get(id);
          if (!callback)
            throw new Error(`Cannot find command to respond: ${id}`);
          this._callbacks.delete(id);
          if (error && !result2) {
            const parsedError = parseError2(error);
            parsedError.log = log2 || [];
            rewriteErrorMessage(parsedError, parsedError.message + formatCallLog(this._platform, log2));
            const detailsValidator = maybeFindValidator(callback.type, callback.method, "ErrorDetails");
            if (detailsValidator)
              parsedError.details = detailsValidator(errorDetails ?? {}, "", this._validatorFromWireContext());
            callback.reject(parsedError);
          } else {
            const validator2 = findValidator(callback.type, callback.method, "Result");
            callback.resolve(validator2(result2, "", this._validatorFromWireContext()));
          }
          return;
        }
        if (this._platform.isLogEnabled("channel"))
          this._platform.log("channel", "<EVENT " + JSON.stringify(message));
        if (method === "__create__") {
          this._createRemoteObject(guid, params2.type, params2.guid, params2.initializer);
          return;
        }
        const object = this._objects.get(guid);
        if (!object)
          throw new Error(`Cannot find object to "${method}": ${guid}`);
        if (method === "__adopt__") {
          const child = this._objects.get(params2.guid);
          if (!child)
            throw new Error(`Unknown new child: ${params2.guid}`);
          object._adopt(child);
          return;
        }
        if (method === "__dispose__") {
          object._dispose(params2.reason);
          return;
        }
        const validator = findValidator(object._type, method, "Event");
        object._channel.emit(method, validator(params2, "", this._validatorFromWireContext()));
      }
      close(cause) {
        if (this._closedError)
          return;
        this._closedError = new TargetClosedError2(cause);
        for (const callback of this._callbacks.values())
          callback.reject(this._closedError);
        this._callbacks.clear();
        this.emit("close");
      }
      _tChannelImplFromWire(names, arg, path59, context2) {
        if (arg && typeof arg === "object" && typeof arg.guid === "string") {
          const object = this._objects.get(arg.guid);
          if (!object)
            throw new Error(`Object with guid ${arg.guid} was not bound in the connection`);
          if (names !== "*" && !names.includes(object._type))
            throw new ValidationError(`${path59}: expected channel ${names.toString()}`);
          return object._channel;
        }
        throw new ValidationError(`${path59}: expected channel ${names.toString()}`);
      }
      _createRemoteObject(parentGuid, type3, guid, initializer) {
        const parent = this._objects.get(parentGuid);
        if (!parent)
          throw new Error(`Cannot find parent object ${parentGuid} to create ${guid}`);
        const validator = findValidator(type3, "", "Initializer");
        initializer = validator(initializer, "", this._validatorFromWireContext());
        const factory = this._objectFactories.get(type3);
        if (!factory)
          throw new Error("Missing type " + type3);
        return factory(parent, type3, guid, initializer);
      }
    };
  }
});

// packages/playwright-core/src/inprocess.ts
var inprocess_exports = {};
__export(inprocess_exports, {
  createInProcessPlaywright: () => createInProcessPlaywright,
  playwright: () => playwright
});
function createInProcessPlaywright() {
  const playwright2 = createPlaywright({ sdkLanguage: process.env.PW_LANG_NAME || "javascript", isClientCollocatedWithServer: true });
  const clientConnection = new Connection(nodePlatform(packageRoot));
  clientConnection.useRawBuffers();
  const dispatcherConnection = new DispatcherConnection(
    true
    /* in process */
  );
  dispatcherConnection.onmessage = (message) => clientConnection.dispatch(message);
  clientConnection.onmessage = (message) => dispatcherConnection.dispatch(message);
  const rootScope = new RootDispatcher(dispatcherConnection);
  new PlaywrightDispatcher(rootScope, playwright2);
  const playwrightAPI = clientConnection.getObjectWithKnownName("Playwright");
  playwrightAPI.chromium._serverLauncher = new BrowserServerLauncherImpl("chromium");
  playwrightAPI.firefox._serverLauncher = new BrowserServerLauncherImpl("firefox");
  playwrightAPI.webkit._serverLauncher = new BrowserServerLauncherImpl("webkit");
  playwrightAPI._android._serverLauncher = new AndroidServerLauncherImpl();
  dispatcherConnection.onmessage = (message) => setImmediate(() => clientConnection.dispatch(message));
  clientConnection.onmessage = (message) => setImmediate(() => dispatcherConnection.dispatch(message));
  clientConnection.toImpl = (x) => {
    if (x instanceof Connection)
      return x === clientConnection ? dispatcherConnection : void 0;
    if (!x)
      return dispatcherConnection._dispatcherByGuid.get("");
    return dispatcherConnection._dispatcherByGuid.get(x._guid)._object;
  };
  return playwrightAPI;
}
var playwright;
var init_inprocess = __esm({
  "packages/playwright-core/src/inprocess.ts"() {
    "use strict";
    init_nodePlatform();
    init_androidServerImpl();
    init_browserServerImpl();
    init_server();
    init_connection();
    init_package();
    playwright = createInProcessPlaywright();
  }
});

// packages/playwright-core/src/tools/backend/utils.ts
async function waitForCompletion(tab2, callback) {
  const requests2 = [];
  const requestListener = (request2) => requests2.push(request2);
  const disposeListeners = () => {
    tab2.page.off("request", requestListener);
  };
  tab2.page.on("request", requestListener);
  let result2;
  try {
    result2 = await callback();
    await tab2.waitForTimeout(500);
  } finally {
    disposeListeners();
  }
  const requestedNavigation = requests2.some((request2) => request2.isNavigationRequest());
  if (requestedNavigation) {
    await tab2.page.mainFrame().waitForLoadState("load", { timeout: 1e4 }).catch(() => {
    });
    return result2;
  }
  const promises = [];
  for (const request2 of requests2) {
    if (["document", "stylesheet", "script", "xhr", "fetch"].includes(request2.resourceType()))
      promises.push(request2.response().then((r) => r?.finished()).catch(() => {
      }));
    else
      promises.push(request2.response().catch(() => {
      }));
  }
  const timeout = new Promise((resolve) => setTimeout(resolve, 5e3));
  await Promise.race([Promise.all(promises), timeout]);
  if (requests2.length)
    await tab2.waitForTimeout(500);
  return result2;
}
function eventWaiter(page, event, timeout) {
  const disposables = [];
  const eventPromise = new Promise((resolve, reject) => {
    page.on(event, resolve);
    disposables.push(() => page.off(event, resolve));
  });
  let abort;
  const abortPromise = new Promise((resolve, reject) => {
    abort = () => resolve(void 0);
  });
  const timeoutPromise = new Promise((f) => {
    const timeoutId = setTimeout(() => f(void 0), timeout);
    disposables.push(() => clearTimeout(timeoutId));
  });
  return {
    promise: Promise.race([eventPromise, abortPromise, timeoutPromise]).finally(() => disposables.forEach((dispose) => dispose())),
    abort
  };
}
var init_utils3 = __esm({
  "packages/playwright-core/src/tools/backend/utils.ts"() {
    "use strict";
  }
});

// packages/playwright-core/src/tools/backend/logFile.ts
var import_fs41, import_path38, debug5, LogFile;
var init_logFile = __esm({
  "packages/playwright-core/src/tools/backend/logFile.ts"() {
    "use strict";
    import_fs41 = __toESM(require("fs"));
    import_path38 = __toESM(require("path"));
    debug5 = require("./utilsBundle").debug;
    LogFile = class {
      constructor(context2, startTime, filePrefix, title) {
        this._stopped = false;
        this._line = 0;
        this._entries = 0;
        this._lastLine = 0;
        this._lastEntries = 0;
        this._writeChain = Promise.resolve();
        this._context = context2;
        this._startTime = startTime;
        this._filePrefix = filePrefix;
        this._title = title;
      }
      appendLine(wallTime, text2) {
        this._writeChain = this._writeChain.then(() => this._write(wallTime, text2)).catch((e) => debug5("pw:tools:error")(e));
      }
      stop() {
        this._stopped = true;
      }
      async take(relativeTo) {
        const logChunk = await this._take();
        if (!logChunk)
          return void 0;
        const logFilePath = relativeTo ? import_path38.default.relative(relativeTo, logChunk.file) : logChunk.file;
        const lineRange = logChunk.fromLine === logChunk.toLine ? `#L${logChunk.fromLine}` : `#L${logChunk.fromLine}-L${logChunk.toLine}`;
        return `${logFilePath}${lineRange}`;
      }
      async _take() {
        await this._writeChain;
        if (!this._file || this._entries === this._lastEntries)
          return void 0;
        const chunk = {
          type: this._title.toLowerCase(),
          file: this._file,
          fromLine: this._lastLine + 1,
          toLine: this._line,
          entryCount: this._entries - this._lastEntries
        };
        this._lastLine = this._line;
        this._lastEntries = this._entries;
        return chunk;
      }
      async _write(wallTime, text2) {
        if (this._stopped)
          return;
        this._file ??= await this._context.outputFile({ prefix: this._filePrefix, ext: "log", date: new Date(this._startTime) }, { origin: "code" });
        const relativeTime = Math.round(wallTime - this._startTime);
        const logLine = `[${String(relativeTime).padStart(8, " ")}ms] ${text2}
`;
        await import_fs41.default.promises.appendFile(this._file, logLine);
        const lineCount = logLine.split("\n").length - 1;
        this._line += lineCount;
        this._entries++;
      }
    };
  }
});

// packages/playwright-core/src/tools/backend/tool.ts
function defineTool(tool) {
  return tool;
}
function defineTabTool(tool) {
  return {
    ...tool,
    handle: async (context2, params2, response2, signal) => {
      const tab2 = await context2.ensureTab();
      const modalStates = tab2.modalStates().map((state) => state.type);
      if (tool.clearsModalState && !modalStates.includes(tool.clearsModalState))
        response2.addError(`Error: The tool "${tool.schema.name}" can only be used when there is related modal state present.`);
      else if (!tool.clearsModalState && modalStates.length)
        response2.addError(`Error: Tool "${tool.schema.name}" does not handle the modal state.`);
      else
        return tool.handle(tab2, params2, response2, signal);
    }
  };
}
var init_tool = __esm({
  "packages/playwright-core/src/tools/backend/tool.ts"() {
    "use strict";
  }
});

// packages/playwright-core/src/tools/backend/dialogs.ts
var z, handleDialog, dialogs_default;
var init_dialogs = __esm({
  "packages/playwright-core/src/tools/backend/dialogs.ts"() {
    "use strict";
    init_tool();
    z = require("./utilsBundle").z;
    handleDialog = defineTabTool({
      capability: "core",
      schema: {
        name: "browser_handle_dialog",
        title: "Handle a dialog",
        description: "Handle a dialog",
        inputSchema: z.object({
          accept: z.boolean().describe("Whether to accept the dialog."),
          promptText: z.string().optional().describe("The text of the prompt in case of a prompt dialog.")
        }),
        type: "action"
      },
      handle: async (tab2, params2, response2) => {
        const dialogState = tab2.modalStates().find((state) => state.type === "dialog");
        if (!dialogState)
          throw new Error("No dialog visible");
        tab2.clearModalState(dialogState);
        await tab2.waitForCompletion(async () => {
          if (params2.accept)
            await dialogState.dialog.accept(params2.promptText);
          else
            await dialogState.dialog.dismiss();
        });
      },
      clearsModalState: "dialog"
    });
    dialogs_default = [
      handleDialog
    ];
  }
});

// packages/playwright-core/src/tools/backend/snapshot.ts
var z2, elementTargetDescription, optionalElementSchema, elementSchema, snapshot, clickSchema, click, drag, hover, selectOptionSchema, selectOption, generateLocator, check, uncheck, snapshot_default;
var init_snapshot = __esm({
  "packages/playwright-core/src/tools/backend/snapshot.ts"() {
    "use strict";
    init_stringUtils();
    init_tool();
    z2 = require("./utilsBundle").z;
    elementTargetDescription = "Exact target element reference from the page snapshot, or a unique element selector";
    optionalElementSchema = z2.object({
      element: z2.string().optional().describe("Human-readable element description used to obtain permission to interact with the element"),
      target: z2.string().optional().describe(elementTargetDescription)
    });
    elementSchema = z2.object({
      element: z2.string().optional().describe("Human-readable element description used to obtain permission to interact with the element"),
      target: z2.string().describe(elementTargetDescription)
    });
    snapshot = defineTabTool({
      capability: "core",
      schema: {
        name: "browser_snapshot",
        title: "Page snapshot",
        description: "Capture accessibility snapshot of the current page, this is better than screenshot",
        inputSchema: z2.object({
          target: z2.string().optional().describe(elementTargetDescription),
          filename: z2.string().optional().describe("Save snapshot to markdown file instead of returning it in the response."),
          depth: z2.number().optional().describe("Limit the depth of the snapshot tree"),
          boxes: z2.boolean().optional().describe("Include each element's bounding box as [box=x,y,width,height] in the snapshot. Coordinates are viewport-relative, in CSS pixels (Element.getBoundingClientRect)")
        }),
        type: "readOnly"
      },
      handle: async (tab2, params2, response2) => {
        let resolved = { locator: void 0, resolved: "" };
        if (params2.target)
          resolved = await tab2.targetLocator({ target: params2.target });
        response2.setIncludeFullSnapshot(params2.filename, resolved.locator, params2.depth, params2.boxes);
      }
    });
    clickSchema = elementSchema.extend({
      doubleClick: z2.boolean().optional().describe("Whether to perform a double click instead of a single click"),
      button: z2.enum(["left", "right", "middle"]).optional().describe("Button to click, defaults to left"),
      modifiers: z2.array(z2.enum(["Alt", "Control", "ControlOrMeta", "Meta", "Shift"])).optional().describe("Modifier keys to press")
    });
    click = defineTabTool({
      capability: "core",
      schema: {
        name: "browser_click",
        title: "Click",
        description: "Perform click on a web page",
        inputSchema: clickSchema,
        type: "input"
      },
      handle: async (tab2, params2, response2) => {
        response2.setIncludeSnapshot();
        const { locator: locator2, resolved } = await tab2.targetLocator(params2);
        const options = {
          button: params2.button,
          modifiers: params2.modifiers,
          ...tab2.actionTimeoutOptions
        };
        const optionsArg = formatObjectOrVoid(options);
        if (params2.doubleClick)
          response2.addCode(`await page.${resolved}.dblclick(${optionsArg});`);
        else
          response2.addCode(`await page.${resolved}.click(${optionsArg});`);
        await tab2.waitForCompletion(async () => {
          if (params2.doubleClick)
            await locator2.dblclick(options);
          else
            await locator2.click(options);
        });
      }
    });
    drag = defineTabTool({
      capability: "core",
      schema: {
        name: "browser_drag",
        title: "Drag mouse",
        description: "Perform drag and drop between two elements",
        inputSchema: z2.object({
          startElement: z2.string().optional().describe("Human-readable source element description used to obtain the permission to interact with the element"),
          startTarget: z2.string().describe(elementTargetDescription),
          endElement: z2.string().optional().describe("Human-readable target element description used to obtain the permission to interact with the element"),
          endTarget: z2.string().describe(elementTargetDescription)
        }),
        type: "input"
      },
      handle: async (tab2, params2, response2) => {
        response2.setIncludeSnapshot();
        const [start3, end] = await tab2.targetLocators([
          { target: params2.startTarget, element: params2.startElement },
          { target: params2.endTarget, element: params2.endElement }
        ]);
        await tab2.waitForCompletion(async () => {
          await start3.locator.dragTo(end.locator, tab2.actionTimeoutOptions);
        });
        response2.addCode(`await page.${start3.resolved}.dragTo(page.${end.resolved});`);
      }
    });
    hover = defineTabTool({
      capability: "core",
      schema: {
        name: "browser_hover",
        title: "Hover mouse",
        description: "Hover over element on page",
        inputSchema: elementSchema,
        type: "input"
      },
      handle: async (tab2, params2, response2) => {
        response2.setIncludeSnapshot();
        const { locator: locator2, resolved } = await tab2.targetLocator(params2);
        response2.addCode(`await page.${resolved}.hover();`);
        await locator2.hover(tab2.actionTimeoutOptions);
      }
    });
    selectOptionSchema = elementSchema.extend({
      values: z2.array(z2.string()).describe("Array of values to select in the dropdown. This can be a single value or multiple values.")
    });
    selectOption = defineTabTool({
      capability: "core",
      schema: {
        name: "browser_select_option",
        title: "Select option",
        description: "Select an option in a dropdown",
        inputSchema: selectOptionSchema,
        type: "input"
      },
      handle: async (tab2, params2, response2) => {
        response2.setIncludeSnapshot();
        const { locator: locator2, resolved } = await tab2.targetLocator(params2);
        response2.addCode(`await page.${resolved}.selectOption(${formatObject(params2.values)});`);
        await locator2.selectOption(params2.values, tab2.actionTimeoutOptions);
      }
    });
    generateLocator = defineTabTool({
      capability: "testing",
      schema: {
        name: "browser_generate_locator",
        title: "Create locator for element",
        description: "Generate locator for the given element to use in tests",
        inputSchema: elementSchema,
        type: "readOnly"
      },
      handle: async (tab2, params2, response2) => {
        const { resolved } = await tab2.targetLocator(params2);
        response2.addTextResult(resolved);
      }
    });
    check = defineTabTool({
      capability: "core-input",
      skillOnly: true,
      schema: {
        name: "browser_check",
        title: "Check",
        description: "Check a checkbox or radio button",
        inputSchema: elementSchema,
        type: "input"
      },
      handle: async (tab2, params2, response2) => {
        const { locator: locator2, resolved } = await tab2.targetLocator(params2);
        response2.addCode(`await page.${resolved}.check();`);
        await locator2.check(tab2.actionTimeoutOptions);
      }
    });
    uncheck = defineTabTool({
      capability: "core-input",
      skillOnly: true,
      schema: {
        name: "browser_uncheck",
        title: "Uncheck",
        description: "Uncheck a checkbox or radio button",
        inputSchema: elementSchema,
        type: "input"
      },
      handle: async (tab2, params2, response2) => {
        const { locator: locator2, resolved } = await tab2.targetLocator(params2);
        response2.addCode(`await page.${resolved}.uncheck();`);
        await locator2.uncheck(tab2.actionTimeoutOptions);
      }
    });
    snapshot_default = [
      snapshot,
      click,
      drag,
      hover,
      selectOption,
      generateLocator,
      check,
      uncheck
    ];
  }
});

// packages/playwright-core/src/tools/backend/files.ts
var z3, uploadFile, drop, files_default;
var init_files = __esm({
  "packages/playwright-core/src/tools/backend/files.ts"() {
    "use strict";
    init_stringUtils();
    init_tool();
    init_snapshot();
    z3 = require("./utilsBundle").z;
    uploadFile = defineTabTool({
      capability: "core",
      schema: {
        name: "browser_file_upload",
        title: "Upload files",
        description: "Upload one or multiple files",
        inputSchema: z3.object({
          paths: z3.array(z3.string()).optional().describe("The absolute paths to the files to upload. Can be single file or multiple files. If omitted, file chooser is cancelled.")
        }),
        type: "action"
      },
      handle: async (tab2, params2, response2) => {
        response2.setIncludeSnapshot();
        const modalState = tab2.modalStates().find((state) => state.type === "fileChooser");
        if (!modalState)
          throw new Error("No file chooser visible");
        if (params2.paths)
          await Promise.all(params2.paths.map((filePath) => response2.resolveClientFilename(filePath)));
        response2.addCode(`await fileChooser.setFiles(${JSON.stringify(params2.paths)})`);
        tab2.clearModalState(modalState);
        await tab2.waitForCompletion(async () => {
          if (params2.paths)
            await modalState.fileChooser.setFiles(params2.paths);
        });
      },
      clearsModalState: "fileChooser"
    });
    drop = defineTabTool({
      capability: "core",
      schema: {
        name: "browser_drop",
        title: "Drop files or data onto an element",
        description: 'Drop files or MIME-typed data onto an element, as if dragged from outside the page. At least one of "paths" or "data" must be provided.',
        inputSchema: elementSchema.extend({
          paths: z3.array(z3.string()).optional().describe("Absolute paths to files to drop onto the element."),
          data: z3.record(z3.string(), z3.string()).optional().describe('Data to drop, as a map of MIME type to string value (e.g. {"text/plain": "hello", "text/uri-list": "https://example.com"}).')
        }),
        type: "action"
      },
      handle: async (tab2, params2, response2) => {
        if (!params2.paths?.length && !params2.data)
          throw new Error('At least one of "paths" or "data" must be provided.');
        response2.setIncludeSnapshot();
        const { locator: locator2, resolved } = await tab2.targetLocator(params2);
        if (params2.paths)
          await Promise.all(params2.paths.map((p) => response2.resolveClientFilename(p)));
        const payload = {};
        if (params2.paths?.length)
          payload.files = params2.paths.length === 1 ? params2.paths[0] : params2.paths;
        if (params2.data)
          payload.data = params2.data;
        await tab2.waitForCompletion(async () => {
          await locator2.drop(payload, tab2.actionTimeoutOptions);
        });
        response2.addCode(`await page.${resolved}.drop(${formatObject(payload)});`);
      }
    });
    files_default = [
      uploadFile,
      drop
    ];
  }
});

// packages/playwright-core/src/tools/backend/tab.ts
function messageToConsoleMessage(message) {
  return {
    type: message.type(),
    timestamp: message.timestamp(),
    text: message.text(),
    toString: () => `[${message.type().toUpperCase()}] ${message.text()} @ ${message.location().url}:${message.location().lineNumber}`
  };
}
function pageErrorToConsoleMessage(errorOrValue) {
  if (errorOrValue instanceof Error) {
    return {
      type: "error",
      timestamp: Date.now(),
      text: errorOrValue.message,
      toString: () => errorOrValue.stack || errorOrValue.message
    };
  }
  return {
    type: "error",
    timestamp: Date.now(),
    text: String(errorOrValue),
    toString: () => String(errorOrValue)
  };
}
function renderModalStates(config, modalStates) {
  const result2 = [];
  if (modalStates.length === 0)
    result2.push("- There is no modal state present");
  for (const state of modalStates)
    result2.push(`- [${state.description}]: can be handled by ${config.skillMode ? state.clearedBy.skill : state.clearedBy.tool}`);
  return result2;
}
function shouldIncludeMessage(thresholdLevel, type3) {
  const messageLevel = consoleLevelForMessageType(type3);
  return consoleMessageLevels.indexOf(messageLevel) <= consoleMessageLevels.indexOf(thresholdLevel || "info");
}
function consoleLevelForMessageType(type3) {
  switch (type3) {
    case "assert":
    case "error":
      return "error";
    case "warning":
      return "warning";
    case "count":
    case "dir":
    case "dirxml":
    case "info":
    case "log":
    case "table":
    case "time":
    case "timeEnd":
      return "info";
    case "clear":
    case "debug":
    case "endGroup":
    case "profile":
    case "profileEnd":
    case "startGroup":
    case "startGroupCollapsed":
    case "trace":
      return "debug";
    default:
      return "info";
  }
}
function sanitizeForFilePath2(s) {
  const sanitize = (s2) => s2.replace(/[\x00-\x2C\x2E-\x2F\x3A-\x40\x5B-\x60\x7B-\x7F]+/g, "-");
  const separator = s.lastIndexOf(".");
  if (separator === -1)
    return sanitize(s);
  return sanitize(s.substring(0, separator)) + "." + sanitize(s.substring(separator + 1));
}
function tabHeaderEquals(a, b) {
  return a.title === b.title && a.url === b.url && a.current === b.current && a.crashed === b.crashed && a.console.errors === b.console.errors && a.console.warnings === b.console.warnings && a.console.total === b.console.total;
}
var import_events28, debug6, TabEvents, Tab, consoleMessageLevels, tabSymbol;
var init_tab = __esm({
  "packages/playwright-core/src/tools/backend/tab.ts"() {
    "use strict";
    import_events28 = require("events");
    init_locatorGenerators();
    init_locatorParser();
    init_manualPromise();
    init_eventsHelper();
    init_disposable();
    init_utils3();
    init_logFile();
    init_dialogs();
    init_files();
    debug6 = require("./utilsBundle").debug;
    TabEvents = {
      modalState: "modalState"
    };
    Tab = class _Tab extends import_events28.EventEmitter {
      constructor(context2, page, onPageClose) {
        super();
        this._lastHeader = { title: "about:blank", url: "about:blank", current: false, crashed: false, console: { total: 0, warnings: 0, errors: 0 } };
        this._downloads = [];
        this._requests = [];
        this.crashed = false;
        this._modalStates = [];
        this._recentEventEntries = [];
        this.context = context2;
        this.page = page;
        this._onPageClose = onPageClose;
        const p = page;
        this._disposables = [
          eventsHelper.addEventListener(p, "console", (event) => this._handleConsoleMessage(messageToConsoleMessage(event))),
          eventsHelper.addEventListener(p, "pageerror", (error) => this._handleConsoleMessage(pageErrorToConsoleMessage(error))),
          eventsHelper.addEventListener(p, "request", (request2) => this._handleRequest(request2)),
          eventsHelper.addEventListener(p, "response", (response2) => this._handleResponse(response2)),
          eventsHelper.addEventListener(p, "requestfailed", (request2) => this._handleRequestFailed(request2)),
          eventsHelper.addEventListener(p, "close", () => this._onClose()),
          eventsHelper.addEventListener(p, "crash", () => {
            this.crashed = true;
          }),
          eventsHelper.addEventListener(p, "filechooser", (chooser) => {
            this.setModalState({
              type: "fileChooser",
              description: "File chooser",
              fileChooser: chooser,
              clearedBy: { tool: uploadFile.schema.name, skill: "upload" }
            });
          }),
          eventsHelper.addEventListener(p, "dialog", (dialog) => this._dialogShown(dialog)),
          eventsHelper.addEventListener(p, "download", (download) => {
            void this._downloadStarted(download);
          })
        ];
        page[tabSymbol] = this;
        const wallTime = Date.now();
        this._consoleLog = new LogFile(this.context, wallTime, "console", "Console");
        this._initializedPromise = this._initialize();
        this.actionTimeoutOptions = { timeout: context2.config.timeouts?.action };
        this.navigationTimeoutOptions = { timeout: context2.config.timeouts?.navigation };
        this.expectTimeoutOptions = { timeout: context2.config.timeouts?.expect };
      }
      async dispose() {
        await disposeAll(this._disposables);
        this._consoleLog.stop();
      }
      static forPage(page) {
        return page[tabSymbol];
      }
      static async collectConsoleMessages(page) {
        const result2 = [];
        const messages = await page.consoleMessages().catch(() => []);
        for (const message of messages)
          result2.push(messageToConsoleMessage(message));
        const errors = await page.pageErrors().catch(() => []);
        for (const error of errors)
          result2.push(pageErrorToConsoleMessage(error));
        return result2;
      }
      async _initialize() {
        for (const message of await _Tab.collectConsoleMessages(this.page))
          this._handleConsoleMessage(message);
        const requests2 = await this.page.requests().catch(() => []);
        for (const request2 of requests2.filter((r) => r.existingResponse() || r.failure()))
          this._requests.push(request2);
        for (const initPage of this.context.config.browser?.initPage || []) {
          try {
            const { default: func } = require(initPage);
            await func({ page: this.page });
          } catch (e) {
            const reason = e instanceof Error ? e.message : String(e);
            throw new Error(`Failed to load init page "${initPage}": ${reason}`, { cause: e });
          }
        }
      }
      modalStates() {
        return this._modalStates;
      }
      setModalState(modalState) {
        this._modalStates.push(modalState);
        this.emit(TabEvents.modalState, modalState);
      }
      clearModalState(modalState) {
        this._modalStates = this._modalStates.filter((state) => state !== modalState);
      }
      _dialogShown(dialog) {
        this.setModalState({
          type: "dialog",
          description: `"${dialog.type()}" dialog with message "${dialog.message()}"`,
          dialog,
          clearedBy: { tool: handleDialog.schema.name, skill: "dialog-accept or dialog-dismiss" }
        });
      }
      async _downloadStarted(download) {
        const outputFile2 = await this.context.outputFile({ suggestedFilename: sanitizeForFilePath2(download.suggestedFilename()), prefix: "download", ext: "bin" }, { origin: "code" });
        const entry = {
          download,
          finished: false,
          outputFile: outputFile2
        };
        this._downloads.push(entry);
        this._addLogEntry({ type: "download-start", wallTime: Date.now(), download: entry });
        await download.saveAs(entry.outputFile);
        entry.finished = true;
        this._addLogEntry({ type: "download-finish", wallTime: Date.now(), download: entry });
      }
      _clearCollectedArtifacts() {
        this._downloads.length = 0;
        this._requests.length = 0;
        this._recentEventEntries.length = 0;
        this._resetLogs();
      }
      _resetLogs() {
        const wallTime = Date.now();
        this._consoleLog.stop();
        this._consoleLog = new LogFile(this.context, wallTime, "console", "Console");
      }
      _handleRequest(request2) {
        this._requests.push(request2);
        const wallTime = request2.timing().startTime || Date.now();
        this._addLogEntry({ type: "request", wallTime, request: request2 });
      }
      _handleResponse(response2) {
        const timing = response2.request().timing();
        const wallTime = timing.responseStart + timing.startTime;
        this._addLogEntry({ type: "request", wallTime, request: response2.request() });
      }
      _handleRequestFailed(request2) {
        this._requests.push(request2);
        const timing = request2.timing();
        const wallTime = timing.responseEnd + timing.startTime;
        this._addLogEntry({ type: "request", wallTime, request: request2 });
      }
      _handleConsoleMessage(message) {
        const wallTime = message.timestamp;
        this._addLogEntry({ type: "console", wallTime, message });
        if (shouldIncludeMessage(this.context.config.console?.level, message.type))
          this._consoleLog.appendLine(wallTime, message.toString());
      }
      logErrorMessage(text2) {
        this._handleConsoleMessage(pageErrorToConsoleMessage(new Error(text2)));
      }
      _addLogEntry(entry) {
        this._recentEventEntries.push(entry);
      }
      _onClose() {
        this._clearCollectedArtifacts();
        this._onPageClose(this);
      }
      async headerSnapshot() {
        let title;
        let consoleCounts = { total: 0, errors: 0, warnings: 0 };
        if (!this.crashed) {
          await this._raceAgainstModalStates(async () => {
            title = await this.page.title();
          });
          consoleCounts = await this.consoleMessageCount();
        }
        const newHeader = {
          title: title ?? "",
          url: this.page.url(),
          current: this.isCurrentTab(),
          crashed: this.crashed,
          console: consoleCounts
        };
        if (!tabHeaderEquals(this._lastHeader, newHeader)) {
          this._lastHeader = newHeader;
          return { ...this._lastHeader, changed: true };
        }
        return { ...this._lastHeader, changed: false };
      }
      isCurrentTab() {
        return this === this.context.currentTab();
      }
      async waitForLoadState(state, options) {
        await this._initializedPromise;
        await this.page.waitForLoadState(state, options).catch((e) => debug6("pw:tools:error")(e));
      }
      async checkUrlAndNavigate(url2) {
        try {
          new URL(url2);
        } catch (e) {
          if (url2.startsWith("localhost"))
            url2 = "http://" + url2;
          else
            url2 = "https://" + url2;
        }
        this.context.checkUrlAllowed(url2);
        await this.navigate(url2);
        return url2;
      }
      async navigate(url2) {
        await this._initializedPromise;
        this._clearCollectedArtifacts();
        const { promise: downloadEvent, abort: abortDownloadEvent } = eventWaiter(this.page, "download", 3e3);
        try {
          await this.page.goto(url2, { waitUntil: "domcontentloaded", ...this.navigationTimeoutOptions });
          abortDownloadEvent();
        } catch (_e) {
          const e = _e;
          const mightBeDownload = e.message.includes("net::ERR_ABORTED") || e.message.includes("Download is starting");
          if (!mightBeDownload)
            throw e;
          const download = await downloadEvent;
          if (!download)
            throw e;
          await new Promise((resolve) => setTimeout(resolve, 500));
          return;
        }
        await this.waitForLoadState("load", { timeout: 5e3 });
      }
      async consoleMessageCount() {
        await this._initializedPromise;
        const messages = await this.page.consoleMessages({ filter: "since-navigation" });
        const pageErrors = await this.page.pageErrors({ filter: "since-navigation" });
        let errors = pageErrors.length;
        let warnings = 0;
        for (const message of messages) {
          if (message.type() === "error")
            errors++;
          else if (message.type() === "warning")
            warnings++;
        }
        return { total: messages.length + pageErrors.length, errors, warnings };
      }
      async consoleMessages(level, all) {
        await this._initializedPromise;
        const result2 = [];
        const messages = await this.page.consoleMessages({ filter: all ? "all" : "since-navigation" });
        for (const message of messages) {
          const cm = messageToConsoleMessage(message);
          if (shouldIncludeMessage(level, cm.type))
            result2.push(cm);
        }
        if (shouldIncludeMessage(level, "error")) {
          const errors = await this.page.pageErrors({ filter: all ? "all" : "since-navigation" });
          for (const error of errors)
            result2.push(pageErrorToConsoleMessage(error));
        }
        return result2;
      }
      async clearConsoleMessages() {
        await this._initializedPromise;
        await Promise.all([
          this.page.clearConsoleMessages(),
          this.page.clearPageErrors()
        ]);
      }
      async requests() {
        await this._initializedPromise;
        return this._requests;
      }
      async clearRequests() {
        await this._initializedPromise;
        this._requests.length = 0;
      }
      async captureSnapshot(root, depth, boxes, relativeTo) {
        await this._initializedPromise;
        let tabSnapshot;
        const modalStates = await this._raceAgainstModalStates(async () => {
          const ariaSnapshot = root ? await root.ariaSnapshot({ mode: "ai", depth, boxes }) : await this.page.ariaSnapshot({ mode: "ai", depth, boxes });
          tabSnapshot = {
            ariaSnapshot,
            modalStates: [],
            events: []
          };
        });
        if (tabSnapshot) {
          tabSnapshot.consoleLink = await this._consoleLog.take(relativeTo);
          tabSnapshot.events = this._recentEventEntries;
          this._recentEventEntries = [];
        }
        return tabSnapshot ?? {
          ariaSnapshot: "",
          modalStates,
          events: []
        };
      }
      _javaScriptBlocked() {
        return this._modalStates.some((state) => state.type === "dialog");
      }
      async _raceAgainstModalStates(action) {
        if (this.modalStates().length)
          return this.modalStates();
        const promise = new ManualPromise();
        const listener = (modalState) => promise.resolve([modalState]);
        this.once(TabEvents.modalState, listener);
        return await Promise.race([
          action().then(() => {
            this.off(TabEvents.modalState, listener);
            return [];
          }),
          promise
        ]);
      }
      async waitForCompletion(callback) {
        await this._initializedPromise;
        await this._raceAgainstModalStates(() => waitForCompletion(this, callback));
      }
      async targetLocator(params2) {
        await this._initializedPromise;
        return (await this.targetLocators([params2]))[0];
      }
      async targetLocators(params2) {
        await this._initializedPromise;
        return Promise.all(params2.map(async (param) => {
          if (!param.target.match(/^(f\d+)?e\d+$/)) {
            const selector = locatorOrSelectorAsSelector("javascript", param.target, this.context.config.testIdAttribute || "data-testid");
            const handle = await this.page.$(selector);
            if (!handle)
              throw new Error(`"${param.target}" does not match any elements.`);
            handle.dispose().catch(() => {
            });
            return { locator: this.page.locator(selector), resolved: asLocator("javascript", selector) };
          } else {
            try {
              let locator2 = this.page.locator(`aria-ref=${param.target}`);
              if (param.element)
                locator2 = locator2.describe(param.element);
              const resolved = await locator2.normalize();
              return { locator: locator2, resolved: resolved.toString() };
            } catch (e) {
              throw new Error(`Ref ${param.target} not found in the current page snapshot. Try capturing new snapshot.`);
            }
          }
        }));
      }
      async waitForTimeout(time) {
        if (this._javaScriptBlocked()) {
          await new Promise((f) => setTimeout(f, time));
          return;
        }
        await this.page.evaluate((ms) => new Promise((f) => setTimeout(f, ms)), time).catch(() => {
        });
      }
    };
    consoleMessageLevels = ["error", "warning", "info", "debug"];
    tabSymbol = Symbol("tabSymbol");
  }
});

// packages/playwright-core/src/tools/backend/context.ts
function originOrHostGlob(originOrHost) {
  const wildcardPortMatch = originOrHost.match(/^(https?:\/\/[^/:]+):\*$/);
  if (wildcardPortMatch)
    return `${wildcardPortMatch[1]}:*/**`;
  try {
    const url2 = new URL(originOrHost);
    if (url2.origin !== "null")
      return `${url2.origin}/**`;
  } catch {
  }
  return `*://${originOrHost}/**`;
}
async function workspaceFile(options, fileName, perCallWorkspaceDir) {
  const workspace = perCallWorkspaceDir ?? options.cwd;
  const resolvedName = import_path39.default.resolve(workspace, fileName);
  await checkFile(options, resolvedName, { origin: "llm" });
  return resolvedName;
}
function outputDir(options) {
  if (options.config.outputDir)
    return import_path39.default.resolve(options.config.outputDir);
  const baseName = options.config.skillMode ? ".playwright-cli" : ".playwright-mcp";
  if (isSystemDirectory(options.cwd) || !isWritable(options.cwd))
    return import_path39.default.join(import_os19.default.tmpdir(), baseName);
  return import_path39.default.join(options.cwd, baseName);
}
async function outputFile(options, fileName, flags) {
  const resolvedFile = import_path39.default.resolve(outputDir(options), fileName);
  await checkFile(options, resolvedFile, flags);
  await import_fs42.default.promises.mkdir(import_path39.default.dirname(resolvedFile), { recursive: true });
  debug7("pw:mcp:file")(resolvedFile);
  return resolvedFile;
}
async function checkFile(options, resolvedFilename, flags) {
  if (flags.origin === "code" || options.config.allowUnrestrictedFileAccess || options.config.skillMode)
    return;
  const output = outputDir(options);
  const workspace = options.cwd;
  if (!isPathInside(output, resolvedFilename) && !isPathInside(workspace, resolvedFilename))
    throw new Error(`File access denied: ${resolvedFilename} is outside allowed roots. Allowed roots: ${output}, ${workspace}`);
}
var import_fs42, import_os19, import_path39, debug7, testDebug, Context;
var init_context = __esm({
  "packages/playwright-core/src/tools/backend/context.ts"() {
    "use strict";
    import_fs42 = __toESM(require("fs"));
    import_os19 = __toESM(require("os"));
    import_path39 = __toESM(require("path"));
    init_stringUtils();
    init_disposable();
    init_eventsHelper();
    init_fileUtils();
    init_inprocess();
    init_tab();
    debug7 = require("./utilsBundle").debug;
    testDebug = debug7("pw:mcp:test");
    Context = class {
      constructor(browserContext, options) {
        this._tabs = [];
        this._routes = [];
        this._disposables = [];
        this._pendingUnhandledRejections = [];
        this._unhandledRejectionListeners = /* @__PURE__ */ new Set();
        this._onUnhandledRejection = (reason) => {
          this._pendingUnhandledRejections.push(reason);
          for (const listener of this._unhandledRejectionListeners)
            listener(reason);
        };
        this.config = options.config;
        this.sessionLog = options.sessionLog;
        this.options = options;
        this._rawBrowserContext = browserContext;
        testDebug("create context");
        process.on("unhandledRejection", this._onUnhandledRejection);
      }
      async dispose() {
        process.off("unhandledRejection", this._onUnhandledRejection);
        await disposeAll(this._disposables);
        for (const tab2 of this._tabs)
          await tab2.dispose();
        this._tabs.length = 0;
        this._currentTab = void 0;
        await this.stopVideoRecording();
      }
      drainPendingUnhandledRejections() {
        const reasons = this._pendingUnhandledRejections.slice();
        this._pendingUnhandledRejections.length = 0;
        return reasons;
      }
      onUnhandledRejection(listener) {
        this._unhandledRejectionListeners.add(listener);
        return () => this._unhandledRejectionListeners.delete(listener);
      }
      debugger() {
        return this._rawBrowserContext.debugger;
      }
      tabs() {
        return this._tabs;
      }
      currentTab() {
        return this._currentTab;
      }
      currentTabOrDie() {
        if (!this._currentTab)
          throw new Error("No open pages available.");
        return this._currentTab;
      }
      async newTab() {
        const browserContext = await this.ensureBrowserContext();
        const page = await browserContext.newPage();
        this._currentTab = this._tabs.find((t) => t.page === page);
        return this._currentTab;
      }
      async selectTab(index) {
        const tab2 = this._tabs[index];
        if (!tab2)
          throw new Error(`Tab ${index} not found`);
        await tab2.page.bringToFront();
        this._currentTab = tab2;
        return tab2;
      }
      async ensureTab() {
        await this.ensureBrowserContext();
        const crashed = this._currentTab?.crashed;
        if (crashed) {
          await this._currentTab.page.close().catch(() => {
          });
          this._currentTab = void 0;
        }
        if (!this._currentTab)
          await this.newTab();
        if (crashed)
          this._currentTab.logErrorMessage("Page crashed and was reset to about:blank.");
        return this._currentTab;
      }
      async closeTab(index) {
        const tab2 = index === void 0 ? this._currentTab : this._tabs[index];
        if (!tab2)
          throw new Error(`Tab ${index} not found`);
        const url2 = tab2.page.url();
        await tab2.page.close();
        return url2;
      }
      async workspaceFile(fileName, perCallWorkspaceDir) {
        return await workspaceFile(this.options, fileName, perCallWorkspaceDir);
      }
      async outputFile(template, options) {
        const baseName = template.suggestedFilename || `${template.prefix}-${(template.date ?? /* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-")}${template.ext ? "." + template.ext : ""}`;
        return await outputFile(this.options, baseName, options);
      }
      async startVideoRecording(fileName, params2) {
        if (this._video)
          throw new Error("Video recording has already been started.");
        this._video = { params: params2, fileName, fileNames: [] };
        const browserContext = await this.ensureBrowserContext();
        for (const page of browserContext.pages())
          await this._startPageVideo(page);
      }
      async stopVideoRecording() {
        if (!this._video)
          return [];
        const video = this._video;
        for (const page of this._rawBrowserContext.pages())
          await page.screencast.stop();
        this._video = void 0;
        return [...video.fileNames];
      }
      async _startPageVideo(page) {
        if (!this._video)
          return;
        const suffix = this._video.fileNames.length ? `-${this._video.fileNames.length}` : "";
        let fileName = this._video.fileName;
        if (fileName && suffix) {
          const ext = import_path39.default.extname(fileName);
          fileName = import_path39.default.basename(fileName, ext) + suffix + ext;
        }
        this._video.fileNames.push(fileName);
        await page.screencast.start({ path: fileName, ...this._video.params });
      }
      _onPageCreated(page) {
        const tab2 = new Tab(this, page, (tab3) => this._onPageClosed(tab3));
        this._tabs.push(tab2);
        if (!this._currentTab)
          this._currentTab = tab2;
        this._startPageVideo(page).catch(() => {
        });
      }
      _onPageClosed(tab2) {
        const index = this._tabs.indexOf(tab2);
        if (index === -1)
          return;
        this._tabs.splice(index, 1);
        if (this._currentTab === tab2)
          this._currentTab = this._tabs[Math.min(index, this._tabs.length - 1)];
      }
      routes() {
        return this._routes;
      }
      async addRoute(entry) {
        const browserContext = await this.ensureBrowserContext();
        await browserContext.route(entry.pattern, entry.handler);
        this._routes.push(entry);
      }
      async removeRoute(pattern) {
        let removed = 0;
        const browserContext = await this.ensureBrowserContext();
        if (pattern) {
          const toRemove = this._routes.filter((r) => r.pattern === pattern);
          for (const route2 of toRemove)
            await browserContext.unroute(route2.pattern, route2.handler);
          this._routes = this._routes.filter((r) => r.pattern !== pattern);
          removed = toRemove.length;
        } else {
          for (const route2 of this._routes)
            await browserContext.unroute(route2.pattern, route2.handler);
          removed = this._routes.length;
          this._routes = [];
        }
        return removed;
      }
      isRunningTool() {
        return this._runningToolName !== void 0;
      }
      setRunningTool(name) {
        this._runningToolName = name;
      }
      async _setupRequestInterception(context2) {
        if (this.config.network?.allowedOrigins?.length) {
          this._disposables.push(await context2.route("**", (route2) => route2.abort("blockedbyclient")));
          for (const origin of this.config.network.allowedOrigins) {
            const glob = originOrHostGlob(origin);
            this._disposables.push(await context2.route(glob, (route2) => route2.continue()));
          }
        }
        if (this.config.network?.blockedOrigins?.length) {
          for (const origin of this.config.network.blockedOrigins)
            this._disposables.push(await context2.route(originOrHostGlob(origin), (route2) => route2.abort("blockedbyclient")));
        }
      }
      async ensureBrowserContext() {
        if (this._browserContextPromise)
          return this._browserContextPromise;
        this._browserContextPromise = this._initializeBrowserContext();
        return this._browserContextPromise;
      }
      async _initializeBrowserContext() {
        if (this.config.testIdAttribute)
          playwright.selectors.setTestIdAttribute(this.config.testIdAttribute);
        const browserContext = this._rawBrowserContext;
        await this._setupRequestInterception(browserContext);
        for (const initScript of this.config.browser?.initScript || [])
          this._disposables.push(await browserContext.addInitScript({ path: import_path39.default.resolve(this.options.cwd, initScript) }));
        for (const page of browserContext.pages())
          this._onPageCreated(page);
        this._disposables.push(eventsHelper.addEventListener(browserContext, "page", (page) => this._onPageCreated(page)));
        return browserContext;
      }
      checkUrlAllowed(url2) {
        if (this.config.allowUnrestrictedFileAccess)
          return;
        if (!URL.canParse(url2))
          return;
        if (new URL(url2).protocol === "file:")
          throw new Error(`Access to "file:" protocol is blocked. Attempted URL: "${url2}"`);
      }
      lookupSecret(secretName) {
        if (!this.config.secrets?.[secretName])
          return { value: secretName, code: escapeWithQuotes(secretName, "'") };
        return {
          value: this.config.secrets[secretName],
          code: `process.env['${secretName}']`
        };
      }
    };
  }
});

// packages/playwright-core/src/tools/backend/screenshot.ts
function scaleImageToFitMessage(buffer, imageType) {
  const image = imageType === "png" ? PNG4.sync.read(buffer) : jpegjs5.decode(buffer, { maxMemoryUsageInMB: 512 });
  const pixels = image.width * image.height;
  const shrink = Math.min(1568 / image.width, 1568 / image.height, Math.sqrt(1.15 * 1024 * 1024 / pixels));
  if (shrink > 1)
    return buffer;
  const width = image.width * shrink | 0;
  const height = image.height * shrink | 0;
  const scaledImage = scaleImageToSize(image, { width, height });
  return imageType === "png" ? PNG4.sync.write(scaledImage) : jpegjs5.encode(scaledImage, 80).data;
}
var jpegjs5, PNG4, z4, screenshotSchema, screenshot, screenshot_default;
var init_screenshot = __esm({
  "packages/playwright-core/src/tools/backend/screenshot.ts"() {
    "use strict";
    init_stringUtils();
    init_imageUtils();
    init_tool();
    init_snapshot();
    jpegjs5 = require("./utilsBundle").jpegjs;
    ({ PNG: PNG4 } = require("./utilsBundle"));
    z4 = require("./utilsBundle").z;
    screenshotSchema = optionalElementSchema.extend({
      type: z4.enum(["png", "jpeg"]).default("png").describe("Image format for the screenshot. Default is png."),
      filename: z4.string().optional().describe("File name to save the screenshot to. Defaults to `page-{timestamp}.{png|jpeg}` if not specified. Prefer relative file names to stay within the output directory."),
      fullPage: z4.boolean().optional().describe("When true, takes a screenshot of the full scrollable page, instead of the currently visible viewport. Cannot be used with element screenshots.")
    });
    screenshot = defineTabTool({
      capability: "core",
      schema: {
        name: "browser_take_screenshot",
        title: "Take a screenshot",
        description: `Take a screenshot of the current page. You can't perform actions based on the screenshot, use browser_snapshot for actions.`,
        inputSchema: screenshotSchema,
        type: "readOnly"
      },
      handle: async (tab2, params2, response2) => {
        if (params2.fullPage && params2.target)
          throw new Error("fullPage cannot be used with element screenshots.");
        const fileType = params2.type || "png";
        const options = {
          type: fileType,
          quality: fileType === "png" ? void 0 : 90,
          scale: "css",
          ...tab2.actionTimeoutOptions,
          ...params2.fullPage !== void 0 && { fullPage: params2.fullPage }
        };
        const screenshotTargetLabel = params2.target ? params2.element || "element" : params2.fullPage ? "full page" : "viewport";
        const target = params2.target ? await tab2.targetLocator({ element: params2.element, target: params2.target }) : null;
        const data = target ? await target.locator.screenshot(options) : await tab2.page.screenshot(options);
        const resolvedFile = await response2.resolveClientFile({ prefix: target ? "element" : "page", ext: fileType, suggestedFilename: params2.filename }, `Screenshot of ${screenshotTargetLabel}`);
        response2.addCode(`// Screenshot ${screenshotTargetLabel} and save it as ${resolvedFile.relativeName}`);
        if (target)
          response2.addCode(`await page.${target.resolved}.screenshot(${formatObject({ ...options, path: resolvedFile.relativeName })});`);
        else
          response2.addCode(`await page.screenshot(${formatObject({ ...options, path: resolvedFile.relativeName })});`);
        await response2.addFileResult(resolvedFile, data);
        if (!params2.filename)
          await response2.registerImageResult(data, fileType);
      }
    });
    screenshot_default = [
      screenshot
    ];
  }
});

// packages/playwright-core/src/tools/backend/response.ts
function renderTabMarkdown(tab2) {
  const lines = [`- Page URL: ${tab2.url}`];
  if (tab2.title)
    lines.push(`- Page Title: ${tab2.title}`);
  if (tab2.crashed)
    lines.push(`- Page status: crashed`);
  if (tab2.console.errors || tab2.console.warnings)
    lines.push(`- Console: ${tab2.console.errors} errors, ${tab2.console.warnings} warnings`);
  return lines;
}
function renderTabsMarkdown(tabs) {
  if (!tabs.length)
    return ["No open tabs. Navigate to a URL to create one."];
  const lines = [];
  for (let i = 0; i < tabs.length; i++) {
    const tab2 = tabs[i];
    const current = tab2.current ? " (current)" : "";
    const crashed = tab2.crashed ? " [crashed]" : "";
    lines.push(`- ${i}:${current} [${tab2.title}](${tab2.url})${crashed}`);
  }
  return lines;
}
function sanitizeUnicode(text2) {
  return text2.toWellFormed?.() ?? text2;
}
async function listFilesRecursive(dir) {
  const entries = await import_fs43.default.promises.readdir(dir, { recursive: true, withFileTypes: true });
  const files = entries.filter((e) => e.isFile());
  return Promise.all(files.map(async (e) => {
    const full = import_path40.default.join(e.parentPath, e.name);
    const { size, mtimeMs } = await import_fs43.default.promises.stat(full);
    return { path: full, size, mtimeMs };
  }));
}
function parseSections(text2) {
  const sections = /* @__PURE__ */ new Map();
  const sectionHeaders = text2.split(/^### /m).slice(1);
  for (const section of sectionHeaders) {
    const firstNewlineIndex = section.indexOf("\n");
    if (firstNewlineIndex === -1)
      continue;
    const sectionName = section.substring(0, firstNewlineIndex);
    const sectionContent = section.substring(firstNewlineIndex + 1).trim();
    sections.set(sectionName, sectionContent);
  }
  return sections;
}
function parseResponse(response2, cwd) {
  if (response2.content?.[0].type !== "text")
    return void 0;
  const text2 = response2.content[0].text;
  const sections = parseSections(text2);
  const error = sections.get("Error");
  const result2 = sections.get("Result");
  const code = sections.get("Ran Playwright code");
  const tabs = sections.get("Open tabs");
  const page = sections.get("Page");
  const snapshotSection = sections.get("Snapshot");
  const events = sections.get("Events");
  const modalState = sections.get("Modal state");
  const paused = sections.get("Paused");
  const codeNoFrame = code?.replace(/^```js\n/, "").replace(/\n```$/, "");
  const isError4 = response2.isError;
  const attachments = response2.content.length > 1 ? response2.content.slice(1) : void 0;
  let snapshot3;
  let inlineSnapshot;
  if (snapshotSection) {
    const match = snapshotSection.match(/\[Snapshot\]\(([^)]+)\)/);
    if (match) {
      if (cwd) {
        try {
          snapshot3 = import_fs43.default.readFileSync(import_path40.default.resolve(cwd, match[1]), "utf-8");
        } catch {
        }
      }
    } else {
      inlineSnapshot = snapshotSection.replace(/^```yaml\n?/, "").replace(/\n?```$/, "");
    }
  }
  return {
    result: result2,
    error,
    code: codeNoFrame,
    tabs,
    page,
    snapshot: snapshot3,
    inlineSnapshot,
    events,
    modalState,
    paused,
    isError: isError4,
    attachments,
    text: text2
  };
}
var import_fs43, import_path40, debug8, requestDebug, Response4;
var init_response = __esm({
  "packages/playwright-core/src/tools/backend/response.ts"() {
    "use strict";
    import_fs43 = __toESM(require("fs"));
    import_path40 = __toESM(require("path"));
    init_tab();
    init_screenshot();
    init_context();
    debug8 = require("./utilsBundle").debug;
    requestDebug = debug8("pw:mcp:request");
    Response4 = class {
      constructor(context2, toolName, toolArgs, options) {
        this._results = [];
        this._errors = [];
        this._code = [];
        this._includeSnapshot = "none";
        this._isClose = false;
        this._imageResults = [];
        this._writtenFiles = /* @__PURE__ */ new Set();
        this._context = context2;
        this.toolName = toolName;
        this.toolArgs = toolArgs;
        this._clientWorkspace = options?.relativeTo ?? context2.options.cwd;
        this._json = options?.json ?? false;
        this._raw = this._json || (options?.raw ?? false);
      }
      _computeRelativeTo(fileName) {
        const rel = import_path40.default.relative(this._clientWorkspace, fileName);
        if (import_path40.default.dirname(rel) === "." && !rel.startsWith("."))
          return "./" + rel;
        return rel;
      }
      async resolveClientFile(template, title) {
        let fileName;
        if (template.suggestedFilename)
          fileName = await this.resolveClientFilename(template.suggestedFilename);
        else
          fileName = await this._context.outputFile(template, { origin: "llm" });
        const relativeName = this._computeRelativeTo(fileName);
        const printableLink = `- [${title}](${relativeName})`;
        return { fileName, relativeName, printableLink };
      }
      async resolveClientFilename(filename) {
        return await this._context.workspaceFile(filename, this._clientWorkspace);
      }
      addTextResult(text2) {
        this._results.push(text2);
      }
      async addResult(title, data, file) {
        if (file.suggestedFilename || typeof data !== "string") {
          const resolvedFile = await this.resolveClientFile(file, title);
          await this.addFileResult(resolvedFile, data);
        } else {
          this.addTextResult(data);
        }
      }
      async _writeFile(resolvedFile, data) {
        if (typeof data === "string")
          await import_fs43.default.promises.writeFile(resolvedFile.fileName, this._redactSecrets(data), "utf-8");
        else if (data)
          await import_fs43.default.promises.writeFile(resolvedFile.fileName, data);
        this._writtenFiles.add(import_path40.default.resolve(resolvedFile.fileName));
      }
      async addFileResult(resolvedFile, data) {
        await this._writeFile(resolvedFile, data);
        this.addTextResult(resolvedFile.printableLink);
      }
      addFileLink(title, fileName) {
        const relativeName = this._computeRelativeTo(fileName);
        this.addTextResult(`- [${title}](${relativeName})`);
      }
      async registerImageResult(data, imageType) {
        this._imageResults.push({ data, imageType });
      }
      setClose() {
        this._isClose = true;
      }
      addError(error) {
        this._errors.push(error);
      }
      addCode(code) {
        this._code.push(code);
      }
      setIncludeSnapshot() {
        this._includeSnapshot = this._context.config.snapshot?.mode ?? "full";
      }
      setIncludeFullSnapshot(includeSnapshotFileName, root, depth, boxes) {
        this._includeSnapshot = "explicit";
        this._includeSnapshotFileName = includeSnapshotFileName;
        this._includeSnapshotDepth = depth;
        this._includeSnapshotBoxes = boxes;
        this._includeSnapshotRoot = root;
      }
      _redactSecrets(text2) {
        for (const [secretName, secretValue] of Object.entries(this._context.config.secrets ?? {})) {
          if (!secretValue)
            continue;
          text2 = text2.replaceAll(secretValue, `<secret>${secretName}</secret>`);
        }
        return text2;
      }
      async serialize() {
        const allSections = await this._build();
        await this._enforceOutputBudget();
        const rawSections = ["Error", "Result", "Snapshot"];
        const sections = this._raw ? allSections.filter((section) => rawSections.includes(section.title)) : allSections;
        let serializedText;
        if (this._json) {
          const payload = {};
          const isError4 = sections.some((section) => section.isError);
          if (isError4)
            payload.isError = true;
          for (const section of sections) {
            if (!section.content.length)
              continue;
            const key = section.title.toLowerCase();
            if (key === "snapshot") {
              const match = section.content[0]?.match(/^- \[Snapshot\]\(([^)]+)\)$/);
              payload.snapshot = match ? { file: match[1] } : section.content.join("\n");
            } else {
              payload[key] = section.content.join("\n");
            }
          }
          serializedText = JSON.stringify(payload, null, 2);
        } else {
          const text2 = [];
          for (const section of sections) {
            if (!section.content.length)
              continue;
            if (!this._raw) {
              text2.push(`### ${section.title}`);
              if (section.codeframe)
                text2.push(`\`\`\`${section.codeframe}`);
              text2.push(...section.content);
              if (section.codeframe)
                text2.push("```");
            } else {
              text2.push(...section.content);
            }
          }
          serializedText = text2.join("\n");
        }
        const content = [
          {
            type: "text",
            text: sanitizeUnicode(this._redactSecrets(serializedText))
          }
        ];
        if (this._context.config.imageResponses !== "omit") {
          for (const imageResult of this._imageResults) {
            const scaledData = scaleImageToFitMessage(imageResult.data, imageResult.imageType);
            content.push({ type: "image", data: scaledData.toString("base64"), mimeType: imageResult.imageType === "png" ? "image/png" : "image/jpeg" });
          }
        }
        return {
          content,
          ...this._isClose ? { isClose: true } : {},
          ...sections.some((section) => section.isError) ? { isError: true } : {}
        };
      }
      async _enforceOutputBudget() {
        const maxSize = this._context.config.outputMaxSize;
        if (!maxSize)
          return;
        const dir = outputDir(this._context.options);
        let entries;
        try {
          entries = await listFilesRecursive(dir);
        } catch {
          return;
        }
        let total = 0;
        for (const e of entries)
          total += e.size;
        if (total <= maxSize)
          return;
        entries.sort((a, b) => a.mtimeMs - b.mtimeMs);
        for (const entry of entries) {
          if (total <= maxSize)
            break;
          if (this._writtenFiles.has(entry.path))
            continue;
          try {
            await import_fs43.default.promises.unlink(entry.path);
            total -= entry.size;
          } catch (error) {
            requestDebug("output-budget unlink failed %s: %s", entry.path, error);
          }
        }
      }
      async _build() {
        const sections = [];
        const addSection = (title, content, codeframe) => {
          const section = { title, content, isError: title === "Error", codeframe };
          sections.push(section);
          return content;
        };
        if (this._errors.length)
          addSection("Error", this._errors);
        if (this._results.length)
          addSection("Result", this._results);
        if (this._context.config.codegen !== "none" && this._code.length)
          addSection("Ran Playwright code", this._code, "js");
        const tabSnapshot = this._context.currentTab() ? await this._context.currentTabOrDie().captureSnapshot(this._includeSnapshotRoot, this._includeSnapshotDepth, this._includeSnapshotBoxes, this._clientWorkspace) : void 0;
        const tabHeaders = await Promise.all(this._context.tabs().map((tab2) => tab2.headerSnapshot()));
        if (this._includeSnapshot !== "none" || tabHeaders.some((header) => header.changed)) {
          if (tabHeaders.length !== 1)
            addSection("Open tabs", renderTabsMarkdown(tabHeaders));
          addSection("Page", renderTabMarkdown(tabHeaders.find((h) => h.current) ?? tabHeaders[0]));
        }
        if (tabSnapshot?.modalStates.length)
          addSection("Modal state", renderModalStates(this._context.config, tabSnapshot.modalStates));
        if (tabSnapshot && this._includeSnapshot !== "none") {
          if (this._includeSnapshot !== "explicit" || this._includeSnapshotFileName) {
            const suggestedFilename = this._includeSnapshotFileName === "<auto>" ? void 0 : this._includeSnapshotFileName;
            const resolvedFile = await this.resolveClientFile({ prefix: "page", ext: "yml", suggestedFilename }, "Snapshot");
            await this._writeFile(resolvedFile, tabSnapshot.ariaSnapshot);
            addSection("Snapshot", [resolvedFile.printableLink]);
          } else {
            addSection("Snapshot", [tabSnapshot.ariaSnapshot], "yaml");
          }
        }
        const text2 = [];
        if (tabSnapshot?.consoleLink)
          text2.push(`- New console entries: ${tabSnapshot.consoleLink}`);
        if (tabSnapshot?.events.filter((event) => event.type !== "request").length) {
          for (const event of tabSnapshot.events) {
            if (event.type === "download-start")
              text2.push(`- Downloading file ${event.download.download.suggestedFilename()} ...`);
            else if (event.type === "download-finish")
              text2.push(`- Downloaded file ${event.download.download.suggestedFilename()} to "${this._computeRelativeTo(event.download.outputFile)}"`);
          }
        }
        if (text2.length)
          addSection("Events", text2);
        const pausedDetails = this._context.debugger().pausedDetails();
        if (pausedDetails) {
          addSection("Paused", [
            `- ${pausedDetails.title} at ${this._computeRelativeTo(pausedDetails.location.file)}${pausedDetails.location.line ? ":" + pausedDetails.location.line : ""}`,
            "- Use any tools to explore and interact, resume by calling resume/step-over/pause-at"
          ]);
        }
        return sections;
      }
    };
  }
});

// packages/playwright-core/src/tools/backend/sessionLog.ts
var import_fs44, import_path41, debug9, SessionLog;
var init_sessionLog = __esm({
  "packages/playwright-core/src/tools/backend/sessionLog.ts"() {
    "use strict";
    import_fs44 = __toESM(require("fs"));
    import_path41 = __toESM(require("path"));
    init_context();
    init_response();
    debug9 = require("./utilsBundle").debug;
    SessionLog = class _SessionLog {
      constructor(sessionFolder, cwd) {
        this._sessionFileQueue = Promise.resolve();
        this._folder = sessionFolder;
        this._file = import_path41.default.join(this._folder, "session.md");
        this._cwd = cwd;
      }
      static async create(config, cwd) {
        const sessionFolder = await outputFile({ config, cwd }, `session-${Date.now()}`, { origin: "code" });
        await import_fs44.default.promises.mkdir(sessionFolder, { recursive: true });
        console.error(`Session: ${sessionFolder}`);
        return new _SessionLog(sessionFolder, cwd);
      }
      logResponse(toolName, toolArgs, responseObject) {
        const parsed = { ...parseResponse(responseObject, this._cwd), text: void 0 };
        const lines = [""];
        lines.push(
          `### Tool call: ${toolName}`,
          `- Args`,
          "```json",
          JSON.stringify(toolArgs, null, 2),
          "```"
        );
        if (parsed) {
          lines.push(`- Result`);
          lines.push("```json");
          lines.push(JSON.stringify(parsed, null, 2));
          lines.push("```");
        }
        lines.push("");
        this._sessionFileQueue = this._sessionFileQueue.then(() => import_fs44.default.promises.appendFile(this._file, lines.join("\n"))).catch((e) => debug9("pw:tools:error")(e));
      }
    };
  }
});

// packages/playwright-core/src/tools/backend/browserBackend.ts
function formatRejectionReason(reason) {
  if (reason instanceof Error)
    return reason.stack ?? reason.message;
  return String(reason);
}
var z5, debug10, BrowserBackend;
var init_browserBackend = __esm({
  "packages/playwright-core/src/tools/backend/browserBackend.ts"() {
    "use strict";
    init_context();
    init_response();
    init_sessionLog();
    z5 = require("./utilsBundle").z;
    debug10 = require("./utilsBundle").debug;
    BrowserBackend = class {
      constructor(config, browserContext, tools) {
        this._disconnected = false;
        this._config = config;
        this._tools = tools;
        this.browserContext = browserContext;
        const markDisconnected = () => {
          this._disconnected = true;
        };
        this.browserContext.once("close", markDisconnected);
        this.browserContext.browser()?.once("disconnected", markDisconnected);
      }
      async initialize(clientInfo) {
        this._sessionLog = this._config.saveSession ? await SessionLog.create(this._config, clientInfo.cwd) : void 0;
        this._context = new Context(this.browserContext, {
          config: this._config,
          sessionLog: this._sessionLog,
          cwd: clientInfo.cwd
        });
      }
      async dispose() {
        await this._context?.dispose().catch((e) => debug10("pw:tools:error")(e));
      }
      async callTool(name, rawArguments = {}, signal) {
        const json = !!rawArguments._meta?.json;
        const formatError = (message) => ({
          content: [{ type: "text", text: json ? JSON.stringify({ isError: true, error: message }, null, 2) : `### Error
${message}` }],
          isError: true
        });
        const tool = this._tools.find((tool2) => tool2.schema.name === name);
        if (!tool)
          return formatError(`Tool "${name}" not found`);
        let parsedArguments;
        try {
          parsedArguments = tool.schema.inputSchema.parse(rawArguments);
        } catch (error) {
          if (error instanceof z5.ZodError)
            return formatError(`Invalid arguments for tool "${name}":
${z5.prettifyError(error)}`);
          throw error;
        }
        const cwd = rawArguments._meta?.cwd;
        const raw = !!rawArguments._meta?.raw;
        const context2 = this._context;
        const response2 = new Response4(context2, name, parsedArguments, { relativeTo: cwd, raw, json });
        context2.setRunningTool(name);
        let responseObject;
        try {
          await tool.handle(context2, parsedArguments, response2, signal);
          for (const reason of context2.drainPendingUnhandledRejections())
            response2.addError(formatRejectionReason(reason));
          responseObject = await response2.serialize();
          this._sessionLog?.logResponse(name, parsedArguments, responseObject);
        } catch (error) {
          const messages = [String(error), ...context2.drainPendingUnhandledRejections().map(formatRejectionReason)];
          responseObject = formatError(messages.join("\n\n"));
        } finally {
          context2.setRunningTool(void 0);
        }
        if (this._disconnected)
          responseObject.isClose = true;
        return responseObject;
      }
    };
  }
});

// packages/playwright-core/src/tools/backend/common.ts
var z6, close, resize, common_default;
var init_common = __esm({
  "packages/playwright-core/src/tools/backend/common.ts"() {
    "use strict";
    init_tool();
    init_response();
    z6 = require("./utilsBundle").z;
    close = defineTool({
      capability: "core",
      schema: {
        name: "browser_close",
        title: "Close browser",
        description: "Close the page",
        inputSchema: z6.object({}),
        type: "action"
      },
      handle: async (context2, params2, response2) => {
        const result2 = renderTabsMarkdown([]);
        response2.addTextResult(result2.join("\n"));
        response2.addCode(`await page.close()`);
        response2.setClose();
      }
    });
    resize = defineTabTool({
      capability: "core",
      schema: {
        name: "browser_resize",
        title: "Resize browser window",
        description: "Resize the browser window",
        inputSchema: z6.object({
          width: z6.number().describe("Width of the browser window"),
          height: z6.number().describe("Height of the browser window")
        }),
        type: "action"
      },
      handle: async (tab2, params2, response2) => {
        response2.addCode(`await page.setViewportSize({ width: ${params2.width}, height: ${params2.height} });`);
        await tab2.page.setViewportSize({ width: params2.width, height: params2.height });
      }
    });
    common_default = [
      close,
      resize
    ];
  }
});

// packages/playwright-core/src/tools/backend/config.ts
var z7, configShow, config_default;
var init_config = __esm({
  "packages/playwright-core/src/tools/backend/config.ts"() {
    "use strict";
    init_tool();
    z7 = require("./utilsBundle").z;
    configShow = defineTool({
      capability: "config",
      schema: {
        name: "browser_get_config",
        title: "Get config",
        description: "Get the final resolved config after merging CLI options, environment variables and config file.",
        inputSchema: z7.object({}),
        type: "readOnly"
      },
      handle: async (context2, params2, response2) => {
        response2.addTextResult(JSON.stringify(context2.config, null, 2));
      }
    });
    config_default = [
      configShow
    ];
  }
});

// packages/playwright-core/src/tools/backend/console.ts
var z8, console2, consoleClear, console_default;
var init_console2 = __esm({
  "packages/playwright-core/src/tools/backend/console.ts"() {
    "use strict";
    init_tool();
    z8 = require("./utilsBundle").z;
    console2 = defineTabTool({
      capability: "core",
      schema: {
        name: "browser_console_messages",
        title: "Get console messages",
        description: "Returns all console messages",
        inputSchema: z8.object({
          level: z8.enum(["error", "warning", "info", "debug"]).default("info").describe('Level of the console messages to return. Each level includes the messages of more severe levels. Defaults to "info".'),
          all: z8.boolean().optional().describe("Return all console messages since the beginning of the session, not just since the last navigation. Defaults to false."),
          filename: z8.string().optional().describe("Filename to save the console messages to. If not provided, messages are returned as text.")
        }),
        type: "readOnly"
      },
      handle: async (tab2, params2, response2) => {
        const count = await tab2.consoleMessageCount();
        const header = [`Total messages: ${count.total} (Errors: ${count.errors}, Warnings: ${count.warnings})`];
        const messages = await tab2.consoleMessages(params2.level, params2.all);
        if (messages.length !== count.total)
          header.push(`Returning ${messages.length} messages for level "${params2.level}"`);
        const text2 = [...header, "", ...messages.map((message) => message.toString())].join("\n");
        await response2.addResult("Console", text2, { prefix: "console", ext: "log", suggestedFilename: params2.filename });
      }
    });
    consoleClear = defineTabTool({
      capability: "core",
      skillOnly: true,
      schema: {
        name: "browser_console_clear",
        title: "Clear console messages",
        description: "Clear all console messages",
        inputSchema: z8.object({}),
        type: "readOnly"
      },
      handle: async (tab2) => {
        await tab2.clearConsoleMessages();
      }
    });
    console_default = [
      console2,
      consoleClear
    ];
  }
});

// packages/playwright-core/src/tools/backend/cookies.ts
var z9, cookieList, cookieGet, cookieSet, cookieDelete, cookieClear, cookies_default;
var init_cookies = __esm({
  "packages/playwright-core/src/tools/backend/cookies.ts"() {
    "use strict";
    init_tool();
    z9 = require("./utilsBundle").z;
    cookieList = defineTool({
      capability: "storage",
      schema: {
        name: "browser_cookie_list",
        title: "List cookies",
        description: "List all cookies (optionally filtered by domain/path)",
        inputSchema: z9.object({
          domain: z9.string().optional().describe("Filter cookies by domain"),
          path: z9.string().optional().describe("Filter cookies by path")
        }),
        type: "readOnly"
      },
      handle: async (context2, params2, response2) => {
        const browserContext = await context2.ensureBrowserContext();
        let cookies = await browserContext.cookies();
        if (params2.domain)
          cookies = cookies.filter((c) => c.domain.includes(params2.domain));
        if (params2.path)
          cookies = cookies.filter((c) => c.path.startsWith(params2.path));
        if (cookies.length === 0)
          response2.addTextResult("No cookies found");
        else
          response2.addTextResult(cookies.map((c) => `${c.name}=${c.value} (domain: ${c.domain}, path: ${c.path})`).join("\n"));
        response2.addCode(`await page.context().cookies();`);
      }
    });
    cookieGet = defineTool({
      capability: "storage",
      schema: {
        name: "browser_cookie_get",
        title: "Get cookie",
        description: "Get a specific cookie by name",
        inputSchema: z9.object({
          name: z9.string().describe("Cookie name to get")
        }),
        type: "readOnly"
      },
      handle: async (context2, params2, response2) => {
        const browserContext = await context2.ensureBrowserContext();
        const cookies = await browserContext.cookies();
        const cookie = cookies.find((c) => c.name === params2.name);
        if (!cookie)
          response2.addTextResult(`Cookie '${params2.name}' not found`);
        else
          response2.addTextResult(`${cookie.name}=${cookie.value} (domain: ${cookie.domain}, path: ${cookie.path}, httpOnly: ${cookie.httpOnly}, secure: ${cookie.secure}, sameSite: ${cookie.sameSite})`);
        response2.addCode(`await page.context().cookies();`);
      }
    });
    cookieSet = defineTool({
      capability: "storage",
      schema: {
        name: "browser_cookie_set",
        title: "Set cookie",
        description: "Set a cookie with optional flags (domain, path, expires, httpOnly, secure, sameSite)",
        inputSchema: z9.object({
          name: z9.string().describe("Cookie name"),
          value: z9.string().describe("Cookie value"),
          domain: z9.string().optional().describe("Cookie domain"),
          path: z9.string().optional().describe("Cookie path"),
          expires: z9.number().optional().describe("Cookie expiration as Unix timestamp"),
          httpOnly: z9.boolean().optional().describe("Whether the cookie is HTTP only"),
          secure: z9.boolean().optional().describe("Whether the cookie is secure"),
          sameSite: z9.enum(["Strict", "Lax", "None"]).optional().describe("Cookie SameSite attribute")
        }),
        type: "action"
      },
      handle: async (context2, params2, response2) => {
        const browserContext = await context2.ensureBrowserContext();
        const tab2 = await context2.ensureTab();
        const url2 = new URL(tab2.page.url());
        const cookie = {
          name: params2.name,
          value: params2.value,
          domain: params2.domain || url2.hostname,
          path: params2.path || "/"
        };
        if (params2.expires !== void 0)
          cookie.expires = params2.expires;
        if (params2.httpOnly !== void 0)
          cookie.httpOnly = params2.httpOnly;
        if (params2.secure !== void 0)
          cookie.secure = params2.secure;
        if (params2.sameSite !== void 0)
          cookie.sameSite = params2.sameSite;
        await browserContext.addCookies([cookie]);
        response2.addCode(`await page.context().addCookies([${JSON.stringify(cookie)}]);`);
      }
    });
    cookieDelete = defineTool({
      capability: "storage",
      schema: {
        name: "browser_cookie_delete",
        title: "Delete cookie",
        description: "Delete a specific cookie",
        inputSchema: z9.object({
          name: z9.string().describe("Cookie name to delete")
        }),
        type: "action"
      },
      handle: async (context2, params2, response2) => {
        const browserContext = await context2.ensureBrowserContext();
        await browserContext.clearCookies({ name: params2.name });
        response2.addCode(`await page.context().clearCookies({ name: '${params2.name}' });`);
      }
    });
    cookieClear = defineTool({
      capability: "storage",
      schema: {
        name: "browser_cookie_clear",
        title: "Clear cookies",
        description: "Clear all cookies",
        inputSchema: z9.object({}),
        type: "action"
      },
      handle: async (context2, params2, response2) => {
        const browserContext = await context2.ensureBrowserContext();
        await browserContext.clearCookies();
        response2.addCode(`await page.context().clearCookies();`);
      }
    });
    cookies_default = [
      cookieList,
      cookieGet,
      cookieSet,
      cookieDelete,
      cookieClear
    ];
  }
});

// packages/playwright-core/src/tools/backend/devtools.ts
var import_child_process3, z10, resume, highlight, hideHighlight, annotate, devtools_default;
var init_devtools = __esm({
  "packages/playwright-core/src/tools/backend/devtools.ts"() {
    "use strict";
    import_child_process3 = require("child_process");
    init_package();
    init_tool();
    init_snapshot();
    z10 = require("./utilsBundle").z;
    resume = defineTool({
      capability: "devtools",
      schema: {
        name: "browser_resume",
        title: "Resume paused script execution",
        description: "Resume script execution after it was paused. When called with step set to true, execution will pause again before the next action.",
        inputSchema: z10.object({
          step: z10.boolean().optional().describe("When true, execution will pause again before the next action, allowing step-by-step debugging."),
          location: z10.string().optional().describe('Pause execution at a specific <file>:<line>, e.g. "example.spec.ts:42".')
        }),
        type: "action"
      },
      handle: async (context2, params2, response2) => {
        const browserContext = await context2.ensureBrowserContext();
        const pausedPromise = new Promise((resolve) => {
          const listener = () => {
            if (browserContext.debugger.pausedDetails()) {
              browserContext.debugger.off("pausedstatechanged", listener);
              resolve();
            }
          };
          browserContext.debugger.on("pausedstatechanged", listener);
        });
        if (params2.location) {
          const [file, lineStr] = params2.location.split(":");
          let location2;
          if (lineStr) {
            const line = Number(lineStr);
            if (isNaN(line))
              throw new Error(`Invalid location "${params2.location}", expected format is <file>:<line>, e.g. "example.spec.ts:42"`);
            location2 = { file, line };
          } else {
            location2 = { file: params2.location };
          }
          await browserContext.debugger.runTo(location2);
        } else if (params2.step) {
          await browserContext.debugger.next();
        } else {
          await browserContext.debugger.resume();
        }
        await pausedPromise;
      }
    });
    highlight = defineTabTool({
      capability: "devtools",
      schema: {
        name: "browser_highlight",
        title: "Highlight element",
        description: "Show a persistent highlight overlay around the element on the page.",
        inputSchema: elementSchema.extend({
          style: z10.string().optional().describe('Additional inline CSS applied to the highlight overlay, e.g. "outline: 2px dashed red".')
        }),
        type: "readOnly"
      },
      handle: async (tab2, params2, response2) => {
        const { locator: locator2 } = await tab2.targetLocator(params2);
        await locator2.highlight({ style: params2.style });
        response2.addTextResult(`Highlighted ${locator2}`);
      }
    });
    hideHighlight = defineTabTool({
      capability: "devtools",
      schema: {
        name: "browser_hide_highlight",
        title: "Hide element highlight",
        description: "Remove a highlight overlay previously added for the element.",
        inputSchema: optionalElementSchema.extend({
          element: z10.string().optional().describe("Human-readable element description used when adding the highlight; must match the value passed to browser_highlight.")
        }),
        type: "readOnly"
      },
      handle: async (tab2, params2, response2) => {
        if (params2.target) {
          const { locator: locator2 } = await tab2.targetLocator({ target: params2.target, element: params2.element });
          await locator2.hideHighlight();
          response2.addTextResult(`Hid highlight for ${locator2}`);
        } else {
          await tab2.page.hideHighlight();
          response2.addTextResult(`Hid page highlight`);
        }
      }
    });
    annotate = defineTabTool({
      capability: "devtools",
      schema: {
        name: "browser_annotate",
        title: "Annotate the current page",
        description: "Open the Playwright Dashboard in annotation mode for the current page and wait for the user to draw annotations. Returns the annotated screenshot, ARIA snapshot, and the list of annotations.",
        inputSchema: z10.object({}),
        type: "readOnly"
      },
      handle: async (tab2, params2, response2, signal) => {
        const pageId4 = tab2.page._guid;
        const daemonScript = libPath("entry", "dashboardApp.js");
        const daemonArgs = [daemonScript, `--pageId=${pageId4}`];
        const daemon = (0, import_child_process3.spawn)(process.execPath, daemonArgs, { detached: true, stdio: "ignore" });
        daemon.unref();
        const client = (0, import_child_process3.spawn)(process.execPath, [...daemonArgs, "--annotate"], {
          stdio: ["pipe", "pipe", "inherit"]
        });
        const onAbort = () => client.kill();
        signal?.addEventListener("abort", onAbort);
        const stdoutChunks = [];
        client.stdout.on("data", (chunk) => stdoutChunks.push(chunk));
        const exitCode = await new Promise((resolve) => client.on("exit", (code) => resolve(code)));
        signal?.removeEventListener("abort", onAbort);
        if (signal?.aborted) {
          response2.addTextResult("Annotation cancelled.");
          return;
        }
        if (exitCode !== 0) {
          response2.addError(`Annotation client exited with code ${exitCode}`);
          return;
        }
        const text2 = Buffer.concat(stdoutChunks).toString("utf8").trim();
        if (!text2) {
          response2.addTextResult("No annotations were submitted.");
          return;
        }
        const result2 = JSON.parse(text2);
        if (result2.type !== "submitted" || result2.frames.length === 0) {
          response2.addTextResult("No annotations were submitted.");
          return;
        }
        const { frames, feedback } = result2;
        const date = /* @__PURE__ */ new Date();
        if (feedback)
          response2.addTextResult(feedback);
        const multi = frames.length > 1;
        for (let i = 0; i < frames.length; i++) {
          const frame = frames[i];
          const idx = i + 1;
          const session2 = frame.sessionTitle || "session";
          const tab3 = frame.title || "tab";
          response2.addTextResult(`${multi ? `## Screenshot ${idx}
` : ""}${session2} / ${tab3} @ ${frame.url} (${frame.viewportWidth}x${frame.viewportHeight})`);
          for (const a of frame.annotations)
            response2.addTextResult(`  { x: ${a.x}, y: ${a.y}, width: ${a.width}, height: ${a.height} }: ${a.text}`);
          if (frame.data)
            await response2.addResult(`Annotation image${multi ? " " + idx : ""}`, Buffer.from(frame.data, "base64"), { prefix: `annotations${multi ? "-" + idx : ""}`, ext: "png", date });
          if (frame.ariaSnapshot)
            await response2.addResult(`Annotation snapshot${multi ? " " + idx : ""}`, Buffer.from(frame.ariaSnapshot, "utf8"), { prefix: `annotations${multi ? "-" + idx : ""}`, ext: "yaml", date });
        }
      }
    });
    devtools_default = [resume, highlight, hideHighlight, annotate];
  }
});

// packages/playwright-core/src/tools/backend/evaluate.ts
var z11, evaluateSchema, evaluate2, evaluate_default;
var init_evaluate = __esm({
  "packages/playwright-core/src/tools/backend/evaluate.ts"() {
    "use strict";
    init_stringUtils();
    init_tool();
    init_snapshot();
    z11 = require("./utilsBundle").z;
    evaluateSchema = optionalElementSchema.extend({
      function: z11.string().describe("() => { /* code */ } or (element) => { /* code */ } when element is provided"),
      filename: z11.string().optional().describe("Filename to save the result to. If not provided, result is returned as text.")
    });
    evaluate2 = defineTabTool({
      capability: "core",
      schema: {
        name: "browser_evaluate",
        title: "Evaluate JavaScript",
        description: "Evaluate JavaScript expression on page or element",
        inputSchema: evaluateSchema,
        type: "action"
      },
      handle: async (tab, params, response) => {
        let locator;
        const expression = params.function;
        if (params.target)
          locator = await tab.targetLocator({ target: params.target, element: params.element || "element" });
        await tab.waitForCompletion(async () => {
          let evalResult;
          if (locator?.locator) {
            evalResult = await locator.locator.evaluate(async (element, expr) => {
              const value = eval(`(${expr})`);
              const isFunction = typeof value === "function";
              const result = await (isFunction ? value(element) : value);
              return { result, isFunction };
            }, expression);
          } else {
            evalResult = await tab.page.evaluate(async (expr) => {
              const value = eval(`(${expr})`);
              const isFunction = typeof value === "function";
              const result = await (isFunction ? value() : value);
              return { result, isFunction };
            }, expression);
          }
          const codeExpression = evalResult.isFunction ? expression : `() => (${expression})`;
          if (locator)
            response.addCode(`await page.${locator.resolved}.evaluate(${escapeWithQuotes(codeExpression)});`);
          else
            response.addCode(`await page.evaluate(${escapeWithQuotes(codeExpression)});`);
          const text = JSON.stringify(evalResult.result, null, 2) ?? "undefined";
          await response.addResult("Evaluation result", text, { prefix: "result", ext: "json", suggestedFilename: params.filename });
        }).catch((e) => {
          response.addError(e instanceof Error ? e.message : String(e));
        });
      }
    });
    evaluate_default = [
      evaluate2
    ];
  }
});

// packages/playwright-core/src/tools/backend/form.ts
var z12, fillForm, form_default;
var init_form = __esm({
  "packages/playwright-core/src/tools/backend/form.ts"() {
    "use strict";
    init_stringUtils();
    init_tool();
    init_snapshot();
    z12 = require("./utilsBundle").z;
    fillForm = defineTabTool({
      capability: "core",
      schema: {
        name: "browser_fill_form",
        title: "Fill form",
        description: "Fill multiple form fields",
        inputSchema: z12.object({
          fields: z12.array(elementSchema.extend({
            name: z12.string().describe("Human-readable field name"),
            type: z12.enum(["textbox", "checkbox", "radio", "combobox", "slider"]).describe("Type of the field"),
            value: z12.string().describe("Value to fill in the field. If the field is a checkbox, the value should be `true` or `false`. If the field is a combobox, the value should be the text of the option.")
          })).describe("Fields to fill in")
        }),
        type: "input"
      },
      handle: async (tab2, params2, response2) => {
        for (const field of params2.fields) {
          const { locator: locator2, resolved } = await tab2.targetLocator({ element: field.name, target: field.target });
          const locatorSource = `await page.${resolved}`;
          if (field.type === "textbox" || field.type === "slider") {
            const secret = tab2.context.lookupSecret(field.value);
            await locator2.fill(secret.value, tab2.actionTimeoutOptions);
            response2.addCode(`${locatorSource}.fill(${secret.code});`);
          } else if (field.type === "checkbox" || field.type === "radio") {
            await locator2.setChecked(field.value === "true", tab2.actionTimeoutOptions);
            response2.addCode(`${locatorSource}.setChecked(${field.value});`);
          } else if (field.type === "combobox") {
            await locator2.selectOption({ label: field.value }, tab2.actionTimeoutOptions);
            response2.addCode(`${locatorSource}.selectOption(${escapeWithQuotes(field.value)});`);
          }
        }
      }
    });
    form_default = [
      fillForm
    ];
  }
});

// packages/playwright-core/src/tools/backend/keyboard.ts
var z13, press, pressSequentially, typeSchema, type, keydown, keyup, keyboard_default;
var init_keyboard = __esm({
  "packages/playwright-core/src/tools/backend/keyboard.ts"() {
    "use strict";
    init_tool();
    init_snapshot();
    z13 = require("./utilsBundle").z;
    press = defineTabTool({
      capability: "core-input",
      schema: {
        name: "browser_press_key",
        title: "Press a key",
        description: "Press a key on the keyboard",
        inputSchema: z13.object({
          key: z13.string().describe("Name of the key to press or a character to generate, such as `ArrowLeft` or `a`")
        }),
        type: "input"
      },
      handle: async (tab2, params2, response2) => {
        response2.addCode(`// Press ${params2.key}`);
        response2.addCode(`await page.keyboard.press('${params2.key}');`);
        if (params2.key === "Enter") {
          response2.setIncludeSnapshot();
          await tab2.waitForCompletion(async () => {
            await tab2.page.keyboard.press("Enter");
          });
        } else {
          await tab2.page.keyboard.press(params2.key);
        }
      }
    });
    pressSequentially = defineTabTool({
      capability: "core-input",
      skillOnly: true,
      schema: {
        name: "browser_press_sequentially",
        title: "Type text key by key",
        description: "Type text key by key on the keyboard",
        inputSchema: z13.object({
          text: z13.string().describe("Text to type"),
          submit: z13.boolean().optional().describe("Whether to submit entered text (press Enter after)")
        }),
        type: "input"
      },
      handle: async (tab2, params2, response2) => {
        response2.addCode(`// Press ${params2.text}`);
        response2.addCode(`await page.keyboard.type('${params2.text}');`);
        await tab2.page.keyboard.type(params2.text);
        if (params2.submit) {
          response2.addCode(`await page.keyboard.press('Enter');`);
          response2.setIncludeSnapshot();
          await tab2.waitForCompletion(async () => {
            await tab2.page.keyboard.press("Enter");
          });
        }
      }
    });
    typeSchema = elementSchema.extend({
      text: z13.string().describe("Text to type into the element"),
      submit: z13.boolean().optional().describe("Whether to submit entered text (press Enter after)"),
      slowly: z13.boolean().optional().describe("Whether to type one character at a time. Useful for triggering key handlers in the page. By default entire text is filled in at once.")
    });
    type = defineTabTool({
      capability: "core-input",
      schema: {
        name: "browser_type",
        title: "Type text",
        description: "Type text into editable element",
        inputSchema: typeSchema,
        type: "input"
      },
      handle: async (tab2, params2, response2) => {
        const { locator: locator2, resolved } = await tab2.targetLocator(params2);
        const secret = tab2.context.lookupSecret(params2.text);
        const action = async () => {
          if (params2.slowly) {
            response2.setIncludeSnapshot();
            response2.addCode(`await page.${resolved}.pressSequentially(${secret.code});`);
            await locator2.pressSequentially(secret.value, tab2.actionTimeoutOptions);
          } else {
            response2.addCode(`await page.${resolved}.fill(${secret.code});`);
            await locator2.fill(secret.value, tab2.actionTimeoutOptions);
          }
          if (params2.submit) {
            response2.setIncludeSnapshot();
            response2.addCode(`await page.${resolved}.press('Enter');`);
            await locator2.press("Enter", tab2.actionTimeoutOptions);
          }
        };
        if (params2.submit || params2.slowly)
          await tab2.waitForCompletion(action);
        else
          await action();
      }
    });
    keydown = defineTabTool({
      capability: "core-input",
      skillOnly: true,
      schema: {
        name: "browser_keydown",
        title: "Press a key down",
        description: "Press a key down on the keyboard",
        inputSchema: z13.object({
          key: z13.string().describe("Name of the key to press or a character to generate, such as `ArrowLeft` or `a`")
        }),
        type: "input"
      },
      handle: async (tab2, params2, response2) => {
        response2.addCode(`await page.keyboard.down('${params2.key}');`);
        await tab2.page.keyboard.down(params2.key);
      }
    });
    keyup = defineTabTool({
      capability: "core-input",
      skillOnly: true,
      schema: {
        name: "browser_keyup",
        title: "Press a key up",
        description: "Press a key up on the keyboard",
        inputSchema: z13.object({
          key: z13.string().describe("Name of the key to press or a character to generate, such as `ArrowLeft` or `a`")
        }),
        type: "input"
      },
      handle: async (tab2, params2, response2) => {
        response2.addCode(`await page.keyboard.up('${params2.key}');`);
        await tab2.page.keyboard.up(params2.key);
      }
    });
    keyboard_default = [
      press,
      type,
      pressSequentially,
      keydown,
      keyup
    ];
  }
});

// packages/playwright-core/src/tools/backend/mouse.ts
var z14, mouseMove, mouseDown, mouseUp, mouseWheel, mouseClick, mouseDrag, mouse_default;
var init_mouse = __esm({
  "packages/playwright-core/src/tools/backend/mouse.ts"() {
    "use strict";
    init_stringUtils();
    init_tool();
    z14 = require("./utilsBundle").z;
    mouseMove = defineTabTool({
      capability: "vision",
      schema: {
        name: "browser_mouse_move_xy",
        title: "Move mouse",
        description: "Move mouse to a given position",
        inputSchema: z14.object({
          x: z14.number().describe("X coordinate"),
          y: z14.number().describe("Y coordinate")
        }),
        type: "input"
      },
      handle: async (tab2, params2, response2) => {
        response2.addCode(`// Move mouse to (${params2.x}, ${params2.y})`);
        response2.addCode(`await page.mouse.move(${params2.x}, ${params2.y});`);
        await tab2.page.mouse.move(params2.x, params2.y);
      }
    });
    mouseDown = defineTabTool({
      capability: "vision",
      schema: {
        name: "browser_mouse_down",
        title: "Press mouse down",
        description: "Press mouse down",
        inputSchema: z14.object({
          button: z14.enum(["left", "right", "middle"]).optional().describe("Button to press, defaults to left")
        }),
        type: "input"
      },
      handle: async (tab2, params2, response2) => {
        const options = { button: params2.button };
        const optionsArg = formatObjectOrVoid(options);
        response2.addCode(`// Press mouse down`);
        response2.addCode(`await page.mouse.down(${optionsArg});`);
        await tab2.page.mouse.down(options);
      }
    });
    mouseUp = defineTabTool({
      capability: "vision",
      schema: {
        name: "browser_mouse_up",
        title: "Press mouse up",
        description: "Press mouse up",
        inputSchema: z14.object({
          button: z14.enum(["left", "right", "middle"]).optional().describe("Button to press, defaults to left")
        }),
        type: "input"
      },
      handle: async (tab2, params2, response2) => {
        const options = { button: params2.button };
        const optionsArg = formatObjectOrVoid(options);
        response2.addCode(`// Press mouse up`);
        response2.addCode(`await page.mouse.up(${optionsArg});`);
        await tab2.page.mouse.up(options);
      }
    });
    mouseWheel = defineTabTool({
      capability: "vision",
      schema: {
        name: "browser_mouse_wheel",
        title: "Scroll mouse wheel",
        description: "Scroll mouse wheel",
        inputSchema: z14.object({
          deltaX: z14.number().default(0).describe("X delta"),
          deltaY: z14.number().default(0).describe("Y delta")
        }),
        type: "input"
      },
      handle: async (tab2, params2, response2) => {
        response2.addCode(`// Scroll mouse wheel`);
        response2.addCode(`await page.mouse.wheel(${params2.deltaX}, ${params2.deltaY});`);
        await tab2.page.mouse.wheel(params2.deltaX, params2.deltaY);
      }
    });
    mouseClick = defineTabTool({
      capability: "vision",
      schema: {
        name: "browser_mouse_click_xy",
        title: "Click",
        description: "Click mouse button at a given position",
        inputSchema: z14.object({
          x: z14.number().describe("X coordinate"),
          y: z14.number().describe("Y coordinate"),
          button: z14.enum(["left", "right", "middle"]).optional().describe("Button to click, defaults to left"),
          clickCount: z14.number().optional().describe("Number of clicks, defaults to 1"),
          delay: z14.number().optional().describe("Time to wait between mouse down and mouse up in milliseconds, defaults to 0")
        }),
        type: "input"
      },
      handle: async (tab2, params2, response2) => {
        response2.setIncludeSnapshot();
        const options = {
          button: params2.button,
          clickCount: params2.clickCount,
          delay: params2.delay
        };
        const formatted = formatObjectOrVoid(options);
        const optionsArg = formatted ? `, ${formatted}` : "";
        response2.addCode(`// Click mouse at coordinates (${params2.x}, ${params2.y})`);
        response2.addCode(`await page.mouse.click(${params2.x}, ${params2.y}${optionsArg});`);
        await tab2.waitForCompletion(async () => {
          await tab2.page.mouse.click(params2.x, params2.y, options);
        });
      }
    });
    mouseDrag = defineTabTool({
      capability: "vision",
      schema: {
        name: "browser_mouse_drag_xy",
        title: "Drag mouse",
        description: "Drag left mouse button to a given position",
        inputSchema: z14.object({
          startX: z14.number().describe("Start X coordinate"),
          startY: z14.number().describe("Start Y coordinate"),
          endX: z14.number().describe("End X coordinate"),
          endY: z14.number().describe("End Y coordinate")
        }),
        type: "input"
      },
      handle: async (tab2, params2, response2) => {
        response2.setIncludeSnapshot();
        response2.addCode(`// Drag mouse from (${params2.startX}, ${params2.startY}) to (${params2.endX}, ${params2.endY})`);
        response2.addCode(`await page.mouse.move(${params2.startX}, ${params2.startY});`);
        response2.addCode(`await page.mouse.down();`);
        response2.addCode(`await page.mouse.move(${params2.endX}, ${params2.endY});`);
        response2.addCode(`await page.mouse.up();`);
        await tab2.waitForCompletion(async () => {
          await tab2.page.mouse.move(params2.startX, params2.startY);
          await tab2.page.mouse.down();
          await tab2.page.mouse.move(params2.endX, params2.endY);
          await tab2.page.mouse.up();
        });
      }
    });
    mouse_default = [
      mouseMove,
      mouseClick,
      mouseDrag,
      mouseDown,
      mouseUp,
      mouseWheel
    ];
  }
});

// packages/playwright-core/src/tools/backend/navigate.ts
var z15, navigate, goBack, goForward, reload, navigate_default;
var init_navigate = __esm({
  "packages/playwright-core/src/tools/backend/navigate.ts"() {
    "use strict";
    init_tool();
    z15 = require("./utilsBundle").z;
    navigate = defineTool({
      capability: "core-navigation",
      schema: {
        name: "browser_navigate",
        title: "Navigate to a URL",
        description: "Navigate to a URL",
        inputSchema: z15.object({
          url: z15.string().describe("The URL to navigate to")
        }),
        type: "action"
      },
      handle: async (context2, params2, response2) => {
        const tab2 = await context2.ensureTab();
        const url2 = await tab2.checkUrlAndNavigate(params2.url);
        response2.setIncludeSnapshot();
        response2.addCode(`await page.goto('${url2}');`);
      }
    });
    goBack = defineTabTool({
      capability: "core-navigation",
      schema: {
        name: "browser_navigate_back",
        title: "Go back",
        description: "Go back to the previous page in the history",
        inputSchema: z15.object({}),
        type: "action"
      },
      handle: async (tab2, params2, response2) => {
        await tab2.page.goBack({ waitUntil: "commit", ...tab2.navigationTimeoutOptions });
        response2.setIncludeSnapshot();
        response2.addCode(`await page.goBack();`);
      }
    });
    goForward = defineTabTool({
      capability: "core-navigation",
      skillOnly: true,
      schema: {
        name: "browser_navigate_forward",
        title: "Go forward",
        description: "Go forward to the next page in the history",
        inputSchema: z15.object({}),
        type: "action"
      },
      handle: async (tab2, params2, response2) => {
        await tab2.page.goForward({ waitUntil: "commit", ...tab2.navigationTimeoutOptions });
        response2.setIncludeSnapshot();
        response2.addCode(`await page.goForward();`);
      }
    });
    reload = defineTabTool({
      capability: "core-navigation",
      skillOnly: true,
      schema: {
        name: "browser_reload",
        title: "Reload the page",
        description: "Reload the current page",
        inputSchema: z15.object({}),
        type: "action"
      },
      handle: async (tab2, params2, response2) => {
        await tab2.page.reload(tab2.navigationTimeoutOptions);
        response2.setIncludeSnapshot();
        response2.addCode(`await page.reload();`);
      }
    });
    navigate_default = [
      navigate,
      goBack,
      goForward,
      reload
    ];
  }
});

// packages/playwright-core/src/tools/backend/network.ts
function isSuccessfulResponse(request2) {
  if (request2.failure())
    return false;
  const response2 = request2.existingResponse();
  return !!response2 && response2.status() < 400;
}
function isFetch(request2) {
  return ["fetch", "xhr"].includes(request2.resourceType());
}
function renderRequestLine(request2) {
  const response2 = request2.existingResponse();
  let line = `[${request2.method().toUpperCase()}] ${request2.url()}`;
  if (response2)
    line += ` => [${response2.status()}] ${response2.statusText()}`;
  else if (request2.failure())
    line += ` => [FAILED] ${request2.failure()?.errorText ?? "Unknown error"}`;
  return line;
}
function renderRequestDetails(index, request2, skillMode) {
  const httpResponse = request2.existingResponse();
  const responseHeaders = httpResponse?.headers();
  const lines = [];
  lines.push(`#${index} [${request2.method().toUpperCase()}] ${request2.url()}`);
  lines.push("");
  lines.push("  General");
  if (httpResponse)
    lines.push(`    status:    [${httpResponse.status()}] ${httpResponse.statusText()}`);
  else if (request2.failure())
    lines.push(`    status:    [FAILED] ${request2.failure()?.errorText ?? "Unknown error"}`);
  const duration = computeDurationMs(request2);
  if (duration !== void 0)
    lines.push(`    duration:  ${duration}ms`);
  lines.push(`    type:      ${request2.resourceType()}`);
  const contentType = responseHeaders?.["content-type"];
  if (contentType)
    lines.push(`    mimeType:  ${contentType.split(";")[0].trim()}`);
  appendHeaderSection(lines, "Request headers", request2.headers());
  if (responseHeaders)
    appendHeaderSection(lines, "Response headers", responseHeaders);
  const hints = [];
  if (request2.postData())
    hints.push(partHint(skillMode, "request-body", index));
  if (canHaveResponseBody(httpResponse))
    hints.push(partHint(skillMode, "response-body", index));
  if (hints.length)
    lines.push("", ...hints);
  return lines.join("\n");
}
function partHint(skillMode, part, index) {
  const subject = part === "request-body" ? "request body" : "response body";
  return skillMode ? `Run \`${part} ${index}\` to read the ${subject}.` : `Call browser_network_request with part="${part}" to read the ${subject}.`;
}
function canHaveResponseBody(httpResponse) {
  if (!httpResponse)
    return false;
  const status = httpResponse.status();
  return status !== 204 && status !== 304 && !(status >= 100 && status < 200);
}
function appendHeaderSection(lines, title, headers) {
  const entries = Object.entries(headers);
  if (!entries.length)
    return;
  lines.push("");
  lines.push(`  ${title}`);
  for (const [k, v] of entries)
    lines.push(`    ${k}: ${v}`);
}
function computeDurationMs(request2) {
  const timing = request2.timing();
  if (!timing || timing.responseEnd < 0)
    return void 0;
  return Math.round(timing.responseEnd);
}
async function renderRequestPart(request2, part, response2, suggestedFilename) {
  if (part === "request-headers") {
    await response2.addResult("Request headers", renderHeaders(request2.headers()), { prefix: "request", ext: "txt", suggestedFilename });
    return;
  }
  if (part === "request-body") {
    const data = request2.postData();
    if (data !== null)
      await response2.addResult("Request body", data, { prefix: "request", ext: "txt", suggestedFilename });
    return;
  }
  const httpResponse = request2.existingResponse();
  if (!httpResponse)
    return;
  if (part === "response-headers") {
    await response2.addResult("Response headers", renderHeaders(httpResponse.headers()), { prefix: "response", ext: "txt", suggestedFilename });
    return;
  }
  const contentType = httpResponse.headers()["content-type"];
  if (isTextualMimeType(contentType ?? "")) {
    let text2;
    try {
      text2 = await httpResponse.text();
    } catch {
      return;
    }
    await response2.addResult("Response body", text2, { prefix: "response", ext: "txt", suggestedFilename });
    return;
  }
  const path59 = await saveResponseBody(request2, response2, suggestedFilename);
  if (path59 !== void 0)
    response2.addTextResult(path59);
}
function renderHeaders(headers) {
  return Object.entries(headers).map(([k, v]) => `${k}: ${v}`).join("\n");
}
async function saveResponseBody(request2, response2, suggestedFilename) {
  const httpResponse = request2.existingResponse();
  if (!canHaveResponseBody(httpResponse))
    return void 0;
  let body;
  try {
    body = await httpResponse.body();
  } catch {
    return void 0;
  }
  if (!body.length)
    return void 0;
  const ext = getExtensionForMimeType(httpResponse.headers()["content-type"]);
  const resolved = await response2.resolveClientFile({ prefix: "response", ext, suggestedFilename }, "Response body");
  await import_fs45.default.promises.writeFile(resolved.fileName, body);
  return resolved.relativeName;
}
var import_fs45, z16, requests, REQUEST_PARTS, request, networkClear, networkStateSet, network_default;
var init_network4 = __esm({
  "packages/playwright-core/src/tools/backend/network.ts"() {
    "use strict";
    import_fs45 = __toESM(require("fs"));
    init_mimeType();
    init_rtti();
    init_tool();
    z16 = require("./utilsBundle").z;
    requests = defineTabTool({
      capability: "core",
      schema: {
        name: "browser_network_requests",
        title: "List network requests",
        description: "Returns a numbered list of network requests since loading the page. Use browser_network_request with the number to get full details.",
        inputSchema: z16.object({
          static: z16.boolean().default(false).describe("Whether to include successful static resources like images, fonts, scripts, etc. Defaults to false."),
          filter: z16.string().optional().refine((v) => !v || isRegexString(v), { message: "Invalid regular expression" }).describe('Only return requests whose URL matches this regexp (e.g. "/api/.*user").'),
          filename: z16.string().optional().describe("Filename to save the network requests to. If not provided, requests are returned as text.")
        }),
        type: "readOnly"
      },
      handle: async (tab2, params2, response2) => {
        const allRequests = await tab2.requests();
        const filter = params2.filter ? new RegExp(params2.filter) : void 0;
        const lines = [];
        let hiddenStaticCount = 0;
        for (let i = 0; i < allRequests.length; i++) {
          const request2 = allRequests[i];
          if (!params2.static && !isFetch(request2) && isSuccessfulResponse(request2)) {
            hiddenStaticCount++;
            continue;
          }
          if (filter) {
            filter.lastIndex = 0;
            if (!filter.test(request2.url()))
              continue;
          }
          lines.push(`${i + 1}. ${renderRequestLine(request2)}`);
        }
        if (hiddenStaticCount > 0) {
          const optionName = tab2.context.config.skillMode ? "--static" : '"static"';
          lines.push(`
Note: ${hiddenStaticCount} static request${hiddenStaticCount === 1 ? "" : "s"} not shown, run with ${optionName} option to see ${hiddenStaticCount === 1 ? "it" : "them"}.`);
        }
        await response2.addResult("Network", lines.join("\n"), { prefix: "network", ext: "log", suggestedFilename: params2.filename });
      }
    });
    REQUEST_PARTS = ["request-headers", "request-body", "response-headers", "response-body"];
    request = defineTabTool({
      capability: "core",
      schema: {
        name: "browser_network_request",
        title: "Show network request details",
        description: "Returns full details (headers and body) of a single network request, or a single part if `part` is set. Use the number from browser_network_requests.",
        inputSchema: z16.object({
          index: z16.number().int().min(1).describe("1-based index of the request, as printed by browser_network_requests."),
          part: z16.enum(REQUEST_PARTS).optional().describe("Return only this part of the request. Omit to return full details."),
          filename: z16.string().optional().describe("Filename to save the result to. If not provided, output is returned as text.")
        }),
        type: "readOnly"
      },
      handle: async (tab2, params2, response2) => {
        const allRequests = await tab2.requests();
        const request2 = allRequests[params2.index - 1];
        if (!request2) {
          response2.addError(`Request #${params2.index} not found. Use browser_network_requests to see available indexes.`);
          return;
        }
        if (params2.part) {
          await renderRequestPart(request2, params2.part, response2, params2.filename);
          return;
        }
        await response2.addResult("Request", renderRequestDetails(params2.index, request2, !!tab2.context.config.skillMode), { prefix: "request", ext: "log", suggestedFilename: params2.filename });
      }
    });
    networkClear = defineTabTool({
      capability: "core",
      skillOnly: true,
      schema: {
        name: "browser_network_clear",
        title: "Clear network requests",
        description: "Clear all network requests",
        inputSchema: z16.object({}),
        type: "readOnly"
      },
      handle: async (tab2, params2, response2) => {
        await tab2.clearRequests();
      }
    });
    networkStateSet = defineTool({
      capability: "network",
      schema: {
        name: "browser_network_state_set",
        title: "Set network state",
        description: "Sets the browser network state to online or offline. When offline, all network requests will fail.",
        inputSchema: z16.object({
          state: z16.enum(["online", "offline"]).describe('Set to "offline" to simulate offline mode, "online" to restore network connectivity')
        }),
        type: "action"
      },
      handle: async (context2, params2, response2) => {
        const browserContext = await context2.ensureBrowserContext();
        const offline = params2.state === "offline";
        await browserContext.setOffline(offline);
        response2.addTextResult(`Network is now ${params2.state}`);
        response2.addCode(`await page.context().setOffline(${offline});`);
      }
    });
    network_default = [
      requests,
      request,
      networkClear,
      networkStateSet
    ];
  }
});

// packages/playwright-core/src/tools/backend/pdf.ts
var z17, pdfSchema, pdf, pdf_default;
var init_pdf = __esm({
  "packages/playwright-core/src/tools/backend/pdf.ts"() {
    "use strict";
    init_stringUtils();
    init_tool();
    z17 = require("./utilsBundle").z;
    pdfSchema = z17.object({
      filename: z17.string().optional().describe("File name to save the pdf to. Defaults to `page-{timestamp}.pdf` if not specified. Prefer relative file names to stay within the output directory.")
    });
    pdf = defineTabTool({
      capability: "pdf",
      schema: {
        name: "browser_pdf_save",
        title: "Save as PDF",
        description: "Save page as PDF",
        inputSchema: pdfSchema,
        type: "readOnly"
      },
      handle: async (tab2, params2, response2) => {
        const data = await tab2.page.pdf();
        const result2 = await response2.resolveClientFile({ prefix: "page", ext: "pdf", suggestedFilename: params2.filename }, "Page as pdf");
        await response2.addFileResult(result2, data);
        response2.addCode(`await page.pdf(${formatObject({ path: result2.relativeName })});`);
      }
    });
    pdf_default = [
      pdf
    ];
  }
});

// packages/playwright-core/src/tools/backend/route.ts
var z18, route, routeList, unroute, route_default;
var init_route = __esm({
  "packages/playwright-core/src/tools/backend/route.ts"() {
    "use strict";
    init_tool();
    z18 = require("./utilsBundle").z;
    route = defineTool({
      capability: "network",
      schema: {
        name: "browser_route",
        title: "Mock network requests",
        description: "Set up a route to mock network requests matching a URL pattern",
        inputSchema: z18.object({
          pattern: z18.string().describe('URL pattern to match (e.g., "**/api/users", "**/*.{png,jpg}")'),
          status: z18.number().optional().describe("HTTP status code to return (default: 200)"),
          body: z18.string().optional().describe("Response body (text or JSON string)"),
          contentType: z18.string().optional().describe('Content-Type header (e.g., "application/json", "text/html")'),
          headers: z18.array(z18.string()).optional().describe('Headers to add in "Name: Value" format'),
          removeHeaders: z18.string().optional().describe("Comma-separated list of header names to remove from request")
        }),
        type: "action"
      },
      handle: async (context2, params2, response2) => {
        const addHeaders = params2.headers ? Object.fromEntries(params2.headers.map((h) => {
          const colonIndex = h.indexOf(":");
          return [h.substring(0, colonIndex).trim(), h.substring(colonIndex + 1).trim()];
        })) : void 0;
        const removeHeaders = params2.removeHeaders ? params2.removeHeaders.split(",").map((h) => h.trim()) : void 0;
        const handler = async (route2) => {
          if (params2.body !== void 0 || params2.status !== void 0) {
            await route2.fulfill({
              status: params2.status ?? 200,
              contentType: params2.contentType,
              body: params2.body
            });
            return;
          }
          const headers = { ...route2.request().headers() };
          if (addHeaders) {
            for (const [key, value2] of Object.entries(addHeaders))
              headers[key] = value2;
          }
          if (removeHeaders) {
            for (const header of removeHeaders)
              delete headers[header.toLowerCase()];
          }
          await route2.continue({ headers });
        };
        const entry = {
          pattern: params2.pattern,
          status: params2.status,
          body: params2.body,
          contentType: params2.contentType,
          addHeaders,
          removeHeaders,
          handler
        };
        await context2.addRoute(entry);
        response2.addTextResult(`Route added for pattern: ${params2.pattern}`);
        response2.addCode(`await page.context().route('${params2.pattern}', async route => { /* route handler */ });`);
      }
    });
    routeList = defineTool({
      capability: "network",
      schema: {
        name: "browser_route_list",
        title: "List network routes",
        description: "List all active network routes",
        inputSchema: z18.object({}),
        type: "readOnly"
      },
      handle: async (context2, params2, response2) => {
        const routes = context2.routes();
        if (routes.length === 0) {
          response2.addTextResult("No active routes");
          return;
        }
        const lines = [];
        for (let i = 0; i < routes.length; i++) {
          const route2 = routes[i];
          const details = [];
          if (route2.status !== void 0)
            details.push(`status=${route2.status}`);
          if (route2.body !== void 0)
            details.push(`body=${route2.body.length > 50 ? route2.body.substring(0, 50) + "..." : route2.body}`);
          if (route2.contentType)
            details.push(`contentType=${route2.contentType}`);
          if (route2.addHeaders)
            details.push(`addHeaders=${JSON.stringify(route2.addHeaders)}`);
          if (route2.removeHeaders)
            details.push(`removeHeaders=${route2.removeHeaders.join(",")}`);
          const detailsStr = details.length ? ` (${details.join(", ")})` : "";
          lines.push(`${i + 1}. ${route2.pattern}${detailsStr}`);
        }
        response2.addTextResult(lines.join("\n"));
      }
    });
    unroute = defineTool({
      capability: "network",
      schema: {
        name: "browser_unroute",
        title: "Remove network routes",
        description: "Remove network routes matching a pattern (or all routes if no pattern specified)",
        inputSchema: z18.object({
          pattern: z18.string().optional().describe("URL pattern to unroute (omit to remove all routes)")
        }),
        type: "action"
      },
      handle: async (context2, params2, response2) => {
        const removed = await context2.removeRoute(params2.pattern);
        if (params2.pattern)
          response2.addTextResult(`Removed ${removed} route(s) for pattern: ${params2.pattern}`);
        else
          response2.addTextResult(`Removed all ${removed} route(s)`);
      }
    });
    route_default = [
      route,
      routeList,
      unroute
    ];
  }
});

// packages/playwright-core/src/tools/backend/runCode.ts
var import_fs46, import_vm, z19, codeSchema, runCode, runCode_default;
var init_runCode = __esm({
  "packages/playwright-core/src/tools/backend/runCode.ts"() {
    "use strict";
    import_fs46 = __toESM(require("fs"));
    import_vm = __toESM(require("vm"));
    init_manualPromise();
    init_tool();
    z19 = require("./utilsBundle").z;
    codeSchema = z19.object({
      code: z19.string().optional().describe(`A JavaScript function containing Playwright code to execute. It will be invoked with a single argument, page, which you can use for any page interaction. For example: \`async (page) => { await page.getByRole('button', { name: 'Submit' }).click(); return await page.title(); }\``),
      filename: z19.string().optional().describe("Load code from the specified file. If both code and filename are provided, code will be ignored.")
    });
    runCode = defineTabTool({
      capability: "core",
      schema: {
        name: "browser_run_code_unsafe",
        title: "Run Playwright code (unsafe)",
        description: "Run a Playwright code snippet. Unsafe: executes arbitrary JavaScript in the Playwright server process and is RCE-equivalent.",
        inputSchema: codeSchema,
        type: "action"
      },
      handle: async (tab2, params2, response2) => {
        let code = params2.code;
        if (params2.filename) {
          const resolvedPath = await response2.resolveClientFilename(params2.filename);
          code = await import_fs46.default.promises.readFile(resolvedPath, "utf-8");
        }
        response2.addCode(`await (${code})(page);`);
        const __end__ = new ManualPromise();
        const context2 = {
          page: tab2.page,
          __end__
        };
        import_vm.default.createContext(context2);
        const unsubscribe = tab2.context.onUnhandledRejection((reason) => {
          if (!__end__.isDone())
            __end__.reject(reason instanceof Error ? reason : new Error(String(reason)));
        });
        try {
          await tab2.waitForCompletion(async () => {
            context2.__fn__ = import_vm.default.runInContext("(" + code + ")", context2);
            const snippet = "(async () => {\n  try {\n    const result = await __fn__(page);\n    __end__.resolve(JSON.stringify(result));\n  } catch (e) {\n    __end__.reject(e);\n  }\n})()";
            const iifePromise = import_vm.default.runInContext(snippet, context2);
            await Promise.race([iifePromise, __end__]);
            const result2 = await __end__;
            if (typeof result2 === "string")
              response2.addTextResult(result2);
          });
        } finally {
          unsubscribe();
        }
      }
    });
    runCode_default = [
      runCode
    ];
  }
});

// packages/playwright-core/src/tools/backend/storage.ts
var z20, storageState, setStorageState, storage_default;
var init_storage = __esm({
  "packages/playwright-core/src/tools/backend/storage.ts"() {
    "use strict";
    init_tool();
    z20 = require("./utilsBundle").z;
    storageState = defineTool({
      capability: "storage",
      schema: {
        name: "browser_storage_state",
        title: "Save storage state",
        description: "Save storage state (cookies, local storage) to a file for later reuse",
        inputSchema: z20.object({
          filename: z20.string().optional().describe("File name to save the storage state to. Defaults to `storage-state-{timestamp}.json` if not specified.")
        }),
        type: "readOnly"
      },
      handle: async (context2, params2, response2) => {
        const browserContext = await context2.ensureBrowserContext();
        const state = await browserContext.storageState();
        const serializedState = JSON.stringify(state, null, 2);
        const resolvedFile = await response2.resolveClientFile({ prefix: "storage-state", ext: "json", suggestedFilename: params2.filename }, "Storage state");
        response2.addCode(`await page.context().storageState({ path: '${resolvedFile.relativeName}' });`);
        await response2.addFileResult(resolvedFile, serializedState);
      }
    });
    setStorageState = defineTool({
      capability: "storage",
      schema: {
        name: "browser_set_storage_state",
        title: "Restore storage state",
        description: "Restore storage state (cookies, local storage) from a file. This clears existing cookies and local storage before restoring.",
        inputSchema: z20.object({
          filename: z20.string().describe("Path to the storage state file to restore from")
        }),
        type: "action"
      },
      handle: async (context2, params2, response2) => {
        const browserContext = await context2.ensureBrowserContext();
        const resolvedFilename = await response2.resolveClientFilename(params2.filename);
        await browserContext.setStorageState(resolvedFilename);
        response2.addTextResult(`Storage state restored from ${params2.filename}`);
        response2.addCode(`await page.context().setStorageState('${params2.filename}');`);
      }
    });
    storage_default = [
      storageState,
      setStorageState
    ];
  }
});

// packages/playwright-core/src/tools/backend/tabs.ts
var z21, browserTabs, tabs_default;
var init_tabs = __esm({
  "packages/playwright-core/src/tools/backend/tabs.ts"() {
    "use strict";
    init_tool();
    init_response();
    z21 = require("./utilsBundle").z;
    browserTabs = defineTool({
      capability: "core-tabs",
      schema: {
        name: "browser_tabs",
        title: "Manage tabs",
        description: "List, create, close, or select a browser tab.",
        inputSchema: z21.object({
          action: z21.enum(["list", "new", "close", "select"]).describe("Operation to perform"),
          index: z21.number().optional().describe("Tab index, used for close/select. If omitted for close, current tab is closed."),
          url: z21.string().optional().describe("URL to navigate to in the new tab, used for new.")
        }),
        type: "action"
      },
      handle: async (context2, params2, response2) => {
        switch (params2.action) {
          case "list": {
            await context2.ensureTab();
            break;
          }
          case "new": {
            const tab2 = await context2.newTab();
            if (params2.url) {
              const url2 = await tab2.checkUrlAndNavigate(params2.url);
              response2.setIncludeSnapshot();
              response2.addCode(`await page.goto('${url2}');`);
            }
            break;
          }
          case "close": {
            await context2.closeTab(params2.index);
            break;
          }
          case "select": {
            if (params2.index === void 0)
              throw new Error("Tab index is required");
            await context2.selectTab(params2.index);
            break;
          }
        }
        const tabHeaders = await Promise.all(context2.tabs().map((tab2) => tab2.headerSnapshot()));
        const result2 = renderTabsMarkdown(tabHeaders);
        response2.addTextResult(result2.join("\n"));
      }
    });
    tabs_default = [
      browserTabs
    ];
  }
});

// packages/playwright-core/src/tools/backend/tracing.ts
var z22, tracingStart, tracingStop, tracing_default, traceLegendSymbol;
var init_tracing3 = __esm({
  "packages/playwright-core/src/tools/backend/tracing.ts"() {
    "use strict";
    init_tool();
    z22 = require("./utilsBundle").z;
    tracingStart = defineTool({
      capability: "devtools",
      schema: {
        name: "browser_start_tracing",
        title: "Start tracing",
        description: "Start trace recording",
        inputSchema: z22.object({}),
        type: "readOnly"
      },
      handle: async (context2, params2, response2) => {
        const browserContext = await context2.ensureBrowserContext();
        const tracesDir = await context2.outputFile({ prefix: "", suggestedFilename: `traces`, ext: "" }, { origin: "code" });
        const name = "trace-" + Date.now();
        await browserContext.tracing.start({
          name,
          screenshots: true,
          snapshots: true,
          live: true
        });
        response2.addTextResult(`Trace recording started`);
        response2.addFileLink("Action log", `${tracesDir}/${name}.trace`);
        response2.addFileLink("Network log", `${tracesDir}/${name}.network`);
        response2.addFileLink("Resources", `${tracesDir}/resources`);
        browserContext.tracing[traceLegendSymbol] = { tracesDir, name };
      }
    });
    tracingStop = defineTool({
      capability: "devtools",
      schema: {
        name: "browser_stop_tracing",
        title: "Stop tracing",
        description: "Stop trace recording",
        inputSchema: z22.object({}),
        type: "readOnly"
      },
      handle: async (context2, params2, response2) => {
        const browserContext = await context2.ensureBrowserContext();
        await browserContext.tracing.stop();
        const traceLegend = browserContext.tracing[traceLegendSymbol];
        if (!traceLegend)
          throw new Error("Tracing is not started");
        delete browserContext.tracing[traceLegendSymbol];
        response2.addTextResult(`Trace recording stopped.`);
        response2.addFileLink("Trace", `${traceLegend.tracesDir}/${traceLegend.name}.trace`);
        response2.addFileLink("Network log", `${traceLegend.tracesDir}/${traceLegend.name}.network`);
        response2.addFileLink("Resources", `${traceLegend.tracesDir}/resources`);
      }
    });
    tracing_default = [
      tracingStart,
      tracingStop
    ];
    traceLegendSymbol = Symbol("tracesDir");
  }
});

// packages/playwright-core/src/tools/backend/verify.ts
var z23, verifyElement, verifyText, verifyList, verifyValue, verify_default;
var init_verify = __esm({
  "packages/playwright-core/src/tools/backend/verify.ts"() {
    "use strict";
    init_stringUtils();
    init_tool();
    z23 = require("./utilsBundle").z;
    verifyElement = defineTabTool({
      capability: "testing",
      schema: {
        name: "browser_verify_element_visible",
        title: "Verify element visible",
        description: "Verify element is visible on the page",
        inputSchema: z23.object({
          role: z23.string().describe('ROLE of the element. Can be found in the snapshot like this: `- {ROLE} "Accessible Name":`'),
          accessibleName: z23.string().describe('ACCESSIBLE_NAME of the element. Can be found in the snapshot like this: `- role "{ACCESSIBLE_NAME}"`')
        }),
        type: "assertion"
      },
      handle: async (tab2, params2, response2) => {
        for (const frame of tab2.page.frames()) {
          const locator2 = frame.getByRole(params2.role, { name: params2.accessibleName });
          if (await locator2.count() > 0) {
            const resolved = await locator2.normalize();
            response2.addCode(`await expect(page.${resolved}).toBeVisible();`);
            response2.addTextResult("Done");
            return;
          }
        }
        response2.addError(`Element with role "${params2.role}" and accessible name "${params2.accessibleName}" not found`);
      }
    });
    verifyText = defineTabTool({
      capability: "testing",
      schema: {
        name: "browser_verify_text_visible",
        title: "Verify text visible",
        description: `Verify text is visible on the page. Prefer ${verifyElement.schema.name} if possible.`,
        inputSchema: z23.object({
          text: z23.string().describe('TEXT to verify. Can be found in the snapshot like this: `- role "Accessible Name": {TEXT}` or like this: `- text: {TEXT}`')
        }),
        type: "assertion"
      },
      handle: async (tab2, params2, response2) => {
        for (const frame of tab2.page.frames()) {
          const locator2 = frame.getByText(params2.text).filter({ visible: true });
          if (await locator2.count() > 0) {
            const resolved = await locator2.normalize();
            response2.addCode(`await expect(page.${resolved}).toBeVisible();`);
            response2.addTextResult("Done");
            return;
          }
        }
        response2.addError("Text not found");
      }
    });
    verifyList = defineTabTool({
      capability: "testing",
      schema: {
        name: "browser_verify_list_visible",
        title: "Verify list visible",
        description: "Verify list is visible on the page",
        inputSchema: z23.object({
          element: z23.string().describe("Human-readable list description"),
          target: z23.string().describe("Exact target element reference that points to the list"),
          items: z23.array(z23.string()).describe("Items to verify")
        }),
        type: "assertion"
      },
      handle: async (tab2, params2, response2) => {
        const { locator: locator2 } = await tab2.targetLocator(params2);
        const itemTexts = [];
        for (const item of params2.items) {
          const itemLocator = locator2.getByText(item);
          if (await itemLocator.count() === 0) {
            response2.addError(`Item "${item}" not found`);
            return;
          }
          itemTexts.push(await itemLocator.textContent(tab2.expectTimeoutOptions));
        }
        const ariaSnapshot = `\`
- list:
${itemTexts.map((t) => `  - listitem: ${escapeWithQuotes(t, '"')}`).join("\n")}
\``;
        response2.addCode(`await expect(page.locator('body')).toMatchAriaSnapshot(${ariaSnapshot});`);
        response2.addTextResult("Done");
      }
    });
    verifyValue = defineTabTool({
      capability: "testing",
      schema: {
        name: "browser_verify_value",
        title: "Verify value",
        description: "Verify element value",
        inputSchema: z23.object({
          type: z23.enum(["textbox", "checkbox", "radio", "combobox", "slider"]).describe("Type of the element"),
          element: z23.string().describe("Human-readable element description"),
          target: z23.string().describe("Exact target element reference from the page snapshot"),
          value: z23.string().describe('Value to verify. For checkbox, use "true" or "false".')
        }),
        type: "assertion"
      },
      handle: async (tab2, params2, response2) => {
        const { locator: locator2, resolved } = await tab2.targetLocator(params2);
        const locatorSource = `page.${resolved}`;
        if (params2.type === "textbox" || params2.type === "slider" || params2.type === "combobox") {
          const value2 = await locator2.inputValue(tab2.expectTimeoutOptions);
          if (value2 !== params2.value) {
            response2.addError(`Expected value "${params2.value}", but got "${value2}"`);
            return;
          }
          response2.addCode(`await expect(${locatorSource}).toHaveValue(${escapeWithQuotes(params2.value)});`);
        } else if (params2.type === "checkbox" || params2.type === "radio") {
          const value2 = await locator2.isChecked(tab2.expectTimeoutOptions);
          if (value2 !== (params2.value === "true")) {
            response2.addError(`Expected value "${params2.value}", but got "${value2}"`);
            return;
          }
          const matcher = value2 ? "toBeChecked" : "not.toBeChecked";
          response2.addCode(`await expect(${locatorSource}).${matcher}();`);
        }
        response2.addTextResult("Done");
      }
    });
    verify_default = [
      verifyElement,
      verifyText,
      verifyList,
      verifyValue
    ];
  }
});

// packages/playwright-core/src/tools/backend/video.ts
var z24, videoStart, videoStop, videoChapter, actionPosition, actionCursor, videoShowActions, videoHideActions, video_default;
var init_video2 = __esm({
  "packages/playwright-core/src/tools/backend/video.ts"() {
    "use strict";
    init_tool();
    z24 = require("./utilsBundle").z;
    videoStart = defineTool({
      capability: "devtools",
      schema: {
        name: "browser_start_video",
        title: "Start video",
        description: "Start video recording",
        inputSchema: z24.object({
          filename: z24.string().optional().describe("Filename to save the video."),
          size: z24.object({
            width: z24.number().describe("Video width"),
            height: z24.number().describe("Video height")
          }).optional().describe("Video size")
        }),
        type: "readOnly"
      },
      handle: async (context2, params2, response2) => {
        const resolvedFile = await response2.resolveClientFile({ prefix: "video", ext: "webm", suggestedFilename: params2.filename }, "Video");
        await context2.startVideoRecording(resolvedFile.fileName, { size: params2.size });
        response2.addTextResult("Video recording started.");
      }
    });
    videoStop = defineTool({
      capability: "devtools",
      schema: {
        name: "browser_stop_video",
        title: "Stop video",
        description: "Stop video recording",
        inputSchema: z24.object({}),
        type: "readOnly"
      },
      handle: async (context2, params2, response2) => {
        const fileNames = await context2.stopVideoRecording();
        if (!fileNames.length) {
          response2.addTextResult("No videos were recorded.");
          return;
        }
        for (const fileName of fileNames) {
          const resolvedFile = await response2.resolveClientFile({
            prefix: "video",
            ext: "webm",
            suggestedFilename: fileName
          }, "Video");
          await response2.addFileResult(resolvedFile, null);
        }
      }
    });
    videoChapter = defineTool({
      capability: "devtools",
      schema: {
        name: "browser_video_chapter",
        title: "Video chapter",
        description: "Add a chapter marker to the video recording. Shows a full-screen chapter card with blurred backdrop.",
        inputSchema: z24.object({
          title: z24.string().describe("Chapter title"),
          description: z24.string().optional().describe("Chapter description"),
          duration: z24.number().optional().describe("Duration in milliseconds to show the chapter card")
        }),
        type: "readOnly"
      },
      handle: async (context2, params2, response2) => {
        const tab2 = context2.currentTabOrDie();
        await tab2.page.screencast.showChapter(params2.title, {
          description: params2.description,
          duration: params2.duration
        });
        response2.addTextResult(`Chapter '${params2.title}' added.`);
      }
    });
    actionPosition = z24.enum(["top-left", "top", "top-right", "bottom-left", "bottom", "bottom-right"]);
    actionCursor = z24.enum(["none", "pointer"]);
    videoShowActions = defineTool({
      capability: "devtools",
      schema: {
        name: "browser_video_show_actions",
        title: "Show action overlays",
        description: "Annotate subsequent actions performed on the page with a callout that names the action and highlights the target element. Useful while video recording or screencasting.",
        inputSchema: z24.object({
          duration: z24.number().optional().describe("How long each action annotation stays on screen, in milliseconds. Defaults to 500."),
          position: actionPosition.optional().describe("Where to place the action title relative to the page. Defaults to top-right."),
          cursor: actionCursor.optional().describe('Cursor decoration for pointer actions. "pointer" (default) animates a mouse pointer from the previous action point to the next one; "none" disables the cursor decoration.')
        }),
        type: "readOnly"
      },
      handle: async (context2, params2, response2) => {
        const tab2 = context2.currentTabOrDie();
        await tab2.page.screencast.showActions({
          duration: params2.duration,
          position: params2.position,
          cursor: params2.cursor
        });
        response2.addTextResult("Action annotations enabled.");
      }
    });
    videoHideActions = defineTool({
      capability: "devtools",
      schema: {
        name: "browser_video_hide_actions",
        title: "Hide action overlays",
        description: "Stop annotating actions performed on the page.",
        inputSchema: z24.object({}),
        type: "readOnly"
      },
      handle: async (context2, params2, response2) => {
        const tab2 = context2.currentTabOrDie();
        await tab2.page.screencast.hideActions();
        response2.addTextResult("Action annotations disabled.");
      }
    });
    video_default = [
      videoStart,
      videoStop,
      videoChapter,
      videoShowActions,
      videoHideActions
    ];
  }
});

// packages/playwright-core/src/tools/backend/wait.ts
var z25, wait, wait_default;
var init_wait = __esm({
  "packages/playwright-core/src/tools/backend/wait.ts"() {
    "use strict";
    init_tool();
    z25 = require("./utilsBundle").z;
    wait = defineTool({
      capability: "core",
      schema: {
        name: "browser_wait_for",
        title: "Wait for",
        description: "Wait for text to appear or disappear or a specified time to pass",
        inputSchema: z25.object({
          time: z25.number().optional().describe("The time to wait in seconds"),
          text: z25.string().optional().describe("The text to wait for"),
          textGone: z25.string().optional().describe("The text to wait for to disappear")
        }),
        type: "assertion"
      },
      handle: async (context2, params2, response2) => {
        if (!params2.text && !params2.textGone && !params2.time)
          throw new Error("Either time, text or textGone must be provided");
        if (params2.time) {
          response2.addCode(`await new Promise(f => setTimeout(f, ${params2.time} * 1000));`);
          await new Promise((f) => setTimeout(f, Math.min(3e4, params2.time * 1e3)));
        }
        const tab2 = context2.currentTabOrDie();
        const locator2 = params2.text ? tab2.page.getByText(params2.text).first() : void 0;
        const goneLocator = params2.textGone ? tab2.page.getByText(params2.textGone).first() : void 0;
        if (goneLocator) {
          response2.addCode(`await page.getByText(${JSON.stringify(params2.textGone)}).first().waitFor({ state: 'hidden' });`);
          await goneLocator.waitFor({ state: "hidden" });
        }
        if (locator2) {
          response2.addCode(`await page.getByText(${JSON.stringify(params2.text)}).first().waitFor({ state: 'visible' });`);
          await locator2.waitFor({ state: "visible" });
        }
        response2.addTextResult(`Waited for ${params2.text || params2.textGone || params2.time}`);
        response2.setIncludeSnapshot();
      }
    });
    wait_default = [
      wait
    ];
  }
});

// packages/playwright-core/src/tools/backend/webstorage.ts
var z26, localStorageList, localStorageGet, localStorageSet, localStorageDelete, localStorageClear, sessionStorageList, sessionStorageGet, sessionStorageSet, sessionStorageDelete, sessionStorageClear, webstorage_default;
var init_webstorage = __esm({
  "packages/playwright-core/src/tools/backend/webstorage.ts"() {
    "use strict";
    init_tool();
    z26 = require("./utilsBundle").z;
    localStorageList = defineTabTool({
      capability: "storage",
      schema: {
        name: "browser_localstorage_list",
        title: "List localStorage",
        description: "List all localStorage key-value pairs",
        inputSchema: z26.object({}),
        type: "readOnly"
      },
      handle: async (tab2, params2, response2) => {
        const items = await tab2.page.localStorage.items();
        if (items.length === 0)
          response2.addTextResult("No localStorage items found");
        else
          response2.addTextResult(items.map((item) => `${item.name}=${item.value}`).join("\n"));
        response2.addCode(`await page.localStorage.items();`);
      }
    });
    localStorageGet = defineTabTool({
      capability: "storage",
      schema: {
        name: "browser_localstorage_get",
        title: "Get localStorage item",
        description: "Get a localStorage item by key",
        inputSchema: z26.object({
          key: z26.string().describe("Key to get")
        }),
        type: "readOnly"
      },
      handle: async (tab2, params2, response2) => {
        const value2 = await tab2.page.localStorage.getItem(params2.key);
        if (value2 === null)
          response2.addTextResult(`localStorage key '${params2.key}' not found`);
        else
          response2.addTextResult(`${params2.key}=${value2}`);
        response2.addCode(`await page.localStorage.getItem('${params2.key}');`);
      }
    });
    localStorageSet = defineTabTool({
      capability: "storage",
      schema: {
        name: "browser_localstorage_set",
        title: "Set localStorage item",
        description: "Set a localStorage item",
        inputSchema: z26.object({
          key: z26.string().describe("Key to set"),
          value: z26.string().describe("Value to set")
        }),
        type: "action"
      },
      handle: async (tab2, params2, response2) => {
        await tab2.page.localStorage.setItem(params2.key, params2.value);
        response2.addCode(`await page.localStorage.setItem('${params2.key}', '${params2.value}');`);
      }
    });
    localStorageDelete = defineTabTool({
      capability: "storage",
      schema: {
        name: "browser_localstorage_delete",
        title: "Delete localStorage item",
        description: "Delete a localStorage item",
        inputSchema: z26.object({
          key: z26.string().describe("Key to delete")
        }),
        type: "action"
      },
      handle: async (tab2, params2, response2) => {
        await tab2.page.localStorage.removeItem(params2.key);
        response2.addCode(`await page.localStorage.removeItem('${params2.key}');`);
      }
    });
    localStorageClear = defineTabTool({
      capability: "storage",
      schema: {
        name: "browser_localstorage_clear",
        title: "Clear localStorage",
        description: "Clear all localStorage",
        inputSchema: z26.object({}),
        type: "action"
      },
      handle: async (tab2, params2, response2) => {
        await tab2.page.localStorage.clear();
        response2.addCode(`await page.localStorage.clear();`);
      }
    });
    sessionStorageList = defineTabTool({
      capability: "storage",
      schema: {
        name: "browser_sessionstorage_list",
        title: "List sessionStorage",
        description: "List all sessionStorage key-value pairs",
        inputSchema: z26.object({}),
        type: "readOnly"
      },
      handle: async (tab2, params2, response2) => {
        const items = await tab2.page.sessionStorage.items();
        if (items.length === 0)
          response2.addTextResult("No sessionStorage items found");
        else
          response2.addTextResult(items.map((item) => `${item.name}=${item.value}`).join("\n"));
        response2.addCode(`await page.sessionStorage.items();`);
      }
    });
    sessionStorageGet = defineTabTool({
      capability: "storage",
      schema: {
        name: "browser_sessionstorage_get",
        title: "Get sessionStorage item",
        description: "Get a sessionStorage item by key",
        inputSchema: z26.object({
          key: z26.string().describe("Key to get")
        }),
        type: "readOnly"
      },
      handle: async (tab2, params2, response2) => {
        const value2 = await tab2.page.sessionStorage.getItem(params2.key);
        if (value2 === null)
          response2.addTextResult(`sessionStorage key '${params2.key}' not found`);
        else
          response2.addTextResult(`${params2.key}=${value2}`);
        response2.addCode(`await page.sessionStorage.getItem('${params2.key}');`);
      }
    });
    sessionStorageSet = defineTabTool({
      capability: "storage",
      schema: {
        name: "browser_sessionstorage_set",
        title: "Set sessionStorage item",
        description: "Set a sessionStorage item",
        inputSchema: z26.object({
          key: z26.string().describe("Key to set"),
          value: z26.string().describe("Value to set")
        }),
        type: "action"
      },
      handle: async (tab2, params2, response2) => {
        await tab2.page.sessionStorage.setItem(params2.key, params2.value);
        response2.addCode(`await page.sessionStorage.setItem('${params2.key}', '${params2.value}');`);
      }
    });
    sessionStorageDelete = defineTabTool({
      capability: "storage",
      schema: {
        name: "browser_sessionstorage_delete",
        title: "Delete sessionStorage item",
        description: "Delete a sessionStorage item",
        inputSchema: z26.object({
          key: z26.string().describe("Key to delete")
        }),
        type: "action"
      },
      handle: async (tab2, params2, response2) => {
        await tab2.page.sessionStorage.removeItem(params2.key);
        response2.addCode(`await page.sessionStorage.removeItem('${params2.key}');`);
      }
    });
    sessionStorageClear = defineTabTool({
      capability: "storage",
      schema: {
        name: "browser_sessionstorage_clear",
        title: "Clear sessionStorage",
        description: "Clear all sessionStorage",
        inputSchema: z26.object({}),
        type: "action"
      },
      handle: async (tab2, params2, response2) => {
        await tab2.page.sessionStorage.clear();
        response2.addCode(`await page.sessionStorage.clear();`);
      }
    });
    webstorage_default = [
      localStorageList,
      localStorageGet,
      localStorageSet,
      localStorageDelete,
      localStorageClear,
      sessionStorageList,
      sessionStorageGet,
      sessionStorageSet,
      sessionStorageDelete,
      sessionStorageClear
    ];
  }
});

// packages/playwright-core/src/tools/backend/tools.ts
function filteredTools(config) {
  return browserTools.filter((tool) => tool.capability.startsWith("core") || config.capabilities?.includes(tool.capability)).filter((tool) => !tool.skillOnly).map((tool) => ({
    ...tool,
    schema: {
      ...tool.schema,
      // Note: we first ensure that "selector" property is present, so that we can omit() it without an error.
      inputSchema: tool.schema.inputSchema.extend({ selector: z27.string(), startSelector: z27.string(), endSelector: z27.string() }).omit({ selector: true, startSelector: true, endSelector: true })
    }
  }));
}
var z27, browserTools;
var init_tools = __esm({
  "packages/playwright-core/src/tools/backend/tools.ts"() {
    "use strict";
    init_common();
    init_config();
    init_console2();
    init_cookies();
    init_devtools();
    init_dialogs();
    init_evaluate();
    init_files();
    init_form();
    init_keyboard();
    init_mouse();
    init_navigate();
    init_network4();
    init_pdf();
    init_route();
    init_runCode();
    init_snapshot();
    init_screenshot();
    init_storage();
    init_tabs();
    init_tracing3();
    init_verify();
    init_video2();
    init_wait();
    init_webstorage();
    z27 = require("./utilsBundle").z;
    browserTools = [
      ...common_default,
      ...config_default,
      ...console_default,
      ...cookies_default,
      ...devtools_default,
      ...dialogs_default,
      ...evaluate_default,
      ...files_default,
      ...form_default,
      ...keyboard_default,
      ...mouse_default,
      ...navigate_default,
      ...network_default,
      ...pdf_default,
      ...route_default,
      ...runCode_default,
      ...screenshot_default,
      ...snapshot_default,
      ...storage_default,
      ...tabs_default,
      ...tracing_default,
      ...verify_default,
      ...video_default,
      ...wait_default,
      ...webstorage_default
    ];
  }
});

// packages/playwright-core/src/tools/cli-daemon/command.ts
function declareCommand(command) {
  return command;
}
function parseCommand(command, args) {
  const optionsObject = { ...args };
  delete optionsObject["_"];
  const optionsSchema = (command.options ?? kEmptyOptions).strict();
  const options = zodParse(optionsSchema, optionsObject, "option");
  const argsSchema = (command.args ?? kEmptyArgs).strict();
  const argNames = [...Object.keys(argsSchema.shape)];
  const argv = args["_"].slice(1);
  if (argv.length > argNames.length)
    throw new Error(`error: too many arguments: expected ${argNames.length}, received ${argv.length}`);
  const argsObject = {};
  argNames.forEach((name, index) => argsObject[name] = argv[index]);
  const parsedArgsObject = zodParse(argsSchema, argsObject, "argument");
  const toolName = typeof command.toolName === "function" ? command.toolName({ ...parsedArgsObject, ...options }) : command.toolName;
  const toolParams = command.toolParams({ ...parsedArgsObject, ...options });
  return { toolName, toolParams };
}
function zodParse(schema, data, type3) {
  try {
    return schema.parse(data);
  } catch (e) {
    throw new Error(e.issues.map((issue) => {
      const keys = issue.code === "unrecognized_keys" ? issue.keys : [""];
      const props = keys.map((key) => [...issue.path, key].filter(Boolean).join("."));
      return props.map((prop) => {
        const label = type3 === "option" ? `'--${prop}' option` : `'${prop}' argument`;
        switch (issue.code) {
          case "invalid_type":
            return "error: " + label + ": " + issue.message.replace(/Invalid input:/, "").trim();
          case "unrecognized_keys":
            return "error: unknown " + label;
          default:
            return "error: " + label + ": " + issue.message;
        }
      });
    }).flat().join("\n"));
  }
}
var z28, kEmptyOptions, kEmptyArgs;
var init_command = __esm({
  "packages/playwright-core/src/tools/cli-daemon/command.ts"() {
    "use strict";
    z28 = require("./utilsBundle").z;
    kEmptyOptions = z28.object({});
    kEmptyArgs = z28.object({});
  }
});

// packages/playwright-core/src/tools/cli-client/minimist.ts
function minimist(args, opts) {
  if (!opts)
    opts = {};
  const bools = {};
  const strings = {};
  for (const key of toArray(opts.boolean))
    bools[key] = true;
  for (const key of toArray(opts.string))
    strings[key] = true;
  const argv = { _: [] };
  function setArg(key, val) {
    if (argv[key] === void 0 || bools[key] || typeof argv[key] === "boolean")
      argv[key] = val;
    else if (Array.isArray(argv[key]))
      argv[key].push(val);
    else
      argv[key] = [argv[key], val];
  }
  let notFlags = [];
  const doubleDashIndex = args.indexOf("--");
  if (doubleDashIndex !== -1) {
    notFlags = args.slice(doubleDashIndex + 1);
    args = args.slice(0, doubleDashIndex);
  }
  for (let i = 0; i < args.length; i++) {
    const arg = args[i];
    let key;
    let next;
    if (/^--.+=/.test(arg)) {
      const m = arg.match(/^--([^=]+)=([\s\S]*)$/);
      key = m[1];
      if (bools[key])
        throw new Error(`boolean option '--${key}' should not be passed with '=value', use '--${key}' or '--no-${key}' instead`);
      setArg(key, m[2]);
    } else if (/^--no-.+/.test(arg)) {
      key = arg.match(/^--no-(.+)/)[1];
      setArg(key, false);
    } else if (/^--.+/.test(arg)) {
      key = arg.match(/^--(.+)/)[1];
      next = args[i + 1];
      if (next !== void 0 && !/^(-|--)[^-]/.test(next) && !bools[key]) {
        setArg(key, next);
        i += 1;
      } else if (/^(true|false)$/.test(next)) {
        setArg(key, next === "true");
        i += 1;
      } else {
        setArg(key, strings[key] ? "" : true);
      }
    } else if (/^-[^-]+/.test(arg)) {
      const letters = arg.slice(1, -1).split("");
      let broken = false;
      for (let j = 0; j < letters.length; j++) {
        next = arg.slice(j + 2);
        if (next === "-") {
          setArg(letters[j], next);
          continue;
        }
        if (/[A-Za-z]/.test(letters[j]) && next[0] === "=") {
          setArg(letters[j], next.slice(1));
          broken = true;
          break;
        }
        if (/[A-Za-z]/.test(letters[j]) && /-?\d+(\.\d*)?(e-?\d+)?$/.test(next)) {
          setArg(letters[j], next);
          broken = true;
          break;
        }
        if (letters[j + 1] && letters[j + 1].match(/\W/)) {
          setArg(letters[j], arg.slice(j + 2));
          broken = true;
          break;
        } else {
          setArg(letters[j], strings[letters[j]] ? "" : true);
        }
      }
      key = arg.slice(-1)[0];
      if (!broken && key !== "-") {
        if (args[i + 1] && !/^(-|--)[^-]/.test(args[i + 1]) && !bools[key]) {
          setArg(key, args[i + 1]);
          i += 1;
        } else if (args[i + 1] && /^(true|false)$/.test(args[i + 1])) {
          setArg(key, args[i + 1] === "true");
          i += 1;
        } else {
          setArg(key, strings[key] ? "" : true);
        }
      }
    } else {
      argv._.push(arg);
    }
  }
  for (const k of notFlags)
    argv._.push(k);
  return argv;
}
function toArray(value2) {
  if (!value2)
    return [];
  return Array.isArray(value2) ? value2 : [value2];
}
var init_minimist = __esm({
  "packages/playwright-core/src/tools/cli-client/minimist.ts"() {
    "use strict";
  }
});

// packages/playwright-core/src/tools/cli-daemon/commands.ts
var z29, elementTargetDescription2, numberArg, stringArrayArg, open3, attach, close2, detach, goto, goBack2, goForward2, reload2, pressKey, type2, keydown2, keyup2, mouseMove2, mouseDown2, mouseUp2, mouseWheel2, click2, doubleClick, drag2, drop2, fill, hover2, select, fileUpload, check2, uncheck2, snapshot2, generateLocator2, highlight2, evaluate3, dialogAccept, dialogDismiss, resize2, runCode2, tabList, tabNew, tabClose, tabSelect, stateLoad, stateSave, cookieList2, cookieGet2, cookieSet2, cookieDelete2, cookieClear2, localStorageList2, localStorageGet2, localStorageSet2, localStorageDelete2, localStorageClear2, sessionStorageList2, sessionStorageGet2, sessionStorageSet2, sessionStorageDelete2, sessionStorageClear2, routeMock, routeList2, unroute2, networkStateSet2, screenshot2, pdfSave, consoleList, networkRequests, filenameOption, networkRequest, networkRequestHeaders, networkRequestBody, networkResponseHeaders, networkResponseBody, tracingStart2, tracingStop2, videoStart2, videoStop2, videoChapter2, actionPositionArg, actionCursorArg, videoShowActions2, videoHideActions2, dashboardShow, resume2, stepOver, pauseAt, sessionList, sessionCloseAll, killAll, deleteData, configPrint, install, installBrowser, tray, commandsArray, commands;
var init_commands = __esm({
  "packages/playwright-core/src/tools/cli-daemon/commands.ts"() {
    "use strict";
    init_command();
    z29 = require("./utilsBundle").z;
    elementTargetDescription2 = "Exact target element reference from the page snapshot, or a unique element selector";
    numberArg = z29.preprocess((val, ctx) => {
      const number = Number(val);
      if (Number.isNaN(number)) {
        ctx.issues.push({
          code: "custom",
          message: `expected number, received '${val}'`,
          input: val
        });
      }
      return number;
    }, z29.number());
    stringArrayArg = z29.union([z29.string(), z29.array(z29.string())]).transform((v) => Array.isArray(v) ? v : [v]);
    open3 = declareCommand({
      name: "open",
      description: "Open the browser",
      category: "core",
      args: z29.object({
        url: z29.string().optional().describe("The URL to navigate to")
      }),
      options: z29.object({
        browser: z29.string().optional().describe("Browser or chrome channel to use, possible values: chrome, firefox, webkit, msedge."),
        config: z29.string().optional().describe("Path to the configuration file, defaults to .playwright/cli.config.json"),
        headed: z29.boolean().optional().describe("Run browser in headed mode"),
        persistent: z29.boolean().optional().describe("Use persistent browser profile"),
        profile: z29.string().optional().describe("Path to a persistent user data directory.")
      }),
      toolName: "",
      toolParams: () => ({})
    });
    attach = declareCommand({
      name: "attach",
      description: "Attach to a running Playwright browser",
      category: "core",
      args: z29.object({
        name: z29.string().optional().describe("Bound browser name to attach to")
      }),
      options: z29.object({
        cdp: z29.string().optional().describe("Connect to an existing browser via CDP endpoint URL."),
        endpoint: z29.string().optional().describe("Playwright browser server endpoint to attach to."),
        extension: z29.union([z29.boolean(), z29.string()]).optional().describe("Connect to browser extension, optionally specify browser name (e.g. --extension=chrome)"),
        config: z29.string().optional().describe("Path to the configuration file, defaults to .playwright/cli.config.json"),
        session: z29.string().optional().describe('Session name (defaults to bound browser name or "default")')
      }),
      toolName: "browser_snapshot",
      toolParams: () => ({ filename: "<auto>" })
    });
    close2 = declareCommand({
      name: "close",
      description: "Close the browser",
      category: "core",
      args: z29.object({}),
      toolName: "",
      toolParams: () => ({})
    });
    detach = declareCommand({
      name: "detach",
      description: "Detach from an attached browser",
      category: "core",
      args: z29.object({}),
      toolName: "",
      toolParams: () => ({})
    });
    goto = declareCommand({
      name: "goto",
      description: "Navigate to a URL",
      category: "core",
      args: z29.object({
        url: z29.string().describe("The URL to navigate to")
      }),
      toolName: "browser_navigate",
      toolParams: ({ url: url2 }) => ({ url: url2 })
    });
    goBack2 = declareCommand({
      name: "go-back",
      description: "Go back to the previous page",
      category: "navigation",
      args: z29.object({}),
      toolName: "browser_navigate_back",
      toolParams: () => ({})
    });
    goForward2 = declareCommand({
      name: "go-forward",
      description: "Go forward to the next page",
      category: "navigation",
      args: z29.object({}),
      toolName: "browser_navigate_forward",
      toolParams: () => ({})
    });
    reload2 = declareCommand({
      name: "reload",
      description: "Reload the current page",
      category: "navigation",
      args: z29.object({}),
      toolName: "browser_reload",
      toolParams: () => ({})
    });
    pressKey = declareCommand({
      name: "press",
      description: "Press a key on the keyboard, `a`, `ArrowLeft`",
      category: "keyboard",
      args: z29.object({
        key: z29.string().describe("Name of the key to press or a character to generate, such as `ArrowLeft` or `a`")
      }),
      toolName: "browser_press_key",
      toolParams: ({ key }) => ({ key })
    });
    type2 = declareCommand({
      name: "type",
      description: "Type text into editable element",
      category: "core",
      args: z29.object({
        text: z29.string().describe("Text to type into the element")
      }),
      options: z29.object({
        submit: z29.boolean().optional().describe("Whether to submit entered text (press Enter after)")
      }),
      toolName: "browser_press_sequentially",
      toolParams: ({ text: text2, submit }) => ({ text: text2, submit })
    });
    keydown2 = declareCommand({
      name: "keydown",
      description: "Press a key down on the keyboard",
      category: "keyboard",
      args: z29.object({
        key: z29.string().describe("Name of the key to press or a character to generate, such as `ArrowLeft` or `a`")
      }),
      toolName: "browser_keydown",
      toolParams: ({ key }) => ({ key })
    });
    keyup2 = declareCommand({
      name: "keyup",
      description: "Press a key up on the keyboard",
      category: "keyboard",
      args: z29.object({
        key: z29.string().describe("Name of the key to press or a character to generate, such as `ArrowLeft` or `a`")
      }),
      toolName: "browser_keyup",
      toolParams: ({ key }) => ({ key })
    });
    mouseMove2 = declareCommand({
      name: "mousemove",
      description: "Move mouse to a given position",
      category: "mouse",
      args: z29.object({
        x: numberArg.describe("X coordinate"),
        y: numberArg.describe("Y coordinate")
      }),
      toolName: "browser_mouse_move_xy",
      toolParams: ({ x, y }) => ({ x, y })
    });
    mouseDown2 = declareCommand({
      name: "mousedown",
      description: "Press mouse down",
      category: "mouse",
      args: z29.object({
        button: z29.string().optional().describe("Button to press, defaults to left")
      }),
      toolName: "browser_mouse_down",
      toolParams: ({ button }) => ({ button })
    });
    mouseUp2 = declareCommand({
      name: "mouseup",
      description: "Press mouse up",
      category: "mouse",
      args: z29.object({
        button: z29.string().optional().describe("Button to press, defaults to left")
      }),
      toolName: "browser_mouse_up",
      toolParams: ({ button }) => ({ button })
    });
    mouseWheel2 = declareCommand({
      name: "mousewheel",
      description: "Scroll mouse wheel",
      category: "mouse",
      args: z29.object({
        dx: numberArg.describe("X delta"),
        dy: numberArg.describe("Y delta")
      }),
      toolName: "browser_mouse_wheel",
      toolParams: ({ dx: deltaX, dy: deltaY }) => ({ deltaX, deltaY })
    });
    click2 = declareCommand({
      name: "click",
      description: "Perform click on a web page",
      category: "core",
      args: z29.object({
        target: z29.string().describe(elementTargetDescription2),
        button: z29.string().optional().describe("Button to click, defaults to left")
      }),
      options: z29.object({
        modifiers: stringArrayArg.optional().describe("Modifier key to press (repeatable)")
      }),
      toolName: "browser_click",
      toolParams: ({ target, button, modifiers }) => ({ target, button, modifiers })
    });
    doubleClick = declareCommand({
      name: "dblclick",
      description: "Perform double click on a web page",
      category: "core",
      args: z29.object({
        target: z29.string().describe(elementTargetDescription2),
        button: z29.string().optional().describe("Button to click, defaults to left")
      }),
      options: z29.object({
        modifiers: stringArrayArg.optional().describe("Modifier key to press (repeatable)")
      }),
      toolName: "browser_click",
      toolParams: ({ target, button, modifiers }) => ({ target, button, modifiers, doubleClick: true })
    });
    drag2 = declareCommand({
      name: "drag",
      description: "Perform drag and drop between two elements",
      category: "core",
      args: z29.object({
        startTarget: z29.string().describe("Exact source element reference from the page snapshot, or a unique element selector"),
        endTarget: z29.string().describe(elementTargetDescription2)
      }),
      toolName: "browser_drag",
      toolParams: ({ startTarget, endTarget }) => ({ startTarget, endTarget })
    });
    drop2 = declareCommand({
      name: "drop",
      description: "Drop files or data onto an element",
      category: "core",
      args: z29.object({
        target: z29.string().describe(elementTargetDescription2)
      }),
      options: z29.object({
        path: stringArrayArg.optional().describe("Absolute path to a file to drop onto the element (repeatable)"),
        data: stringArrayArg.optional().describe('Data to drop in "mime/type=value" format, e.g. --data "text/plain=hello" (repeatable)')
      }),
      toolName: "browser_drop",
      toolParams: ({ target, path: path59, data }) => {
        let dataMap;
        if (data) {
          dataMap = {};
          for (const entry of data) {
            const idx = entry.indexOf("=");
            if (idx === -1)
              throw new Error(`--data must be in "mime/type=value" format, got: ${entry}`);
            dataMap[entry.slice(0, idx)] = entry.slice(idx + 1);
          }
        }
        return { target, paths: path59, data: dataMap };
      }
    });
    fill = declareCommand({
      name: "fill",
      description: "Fill text into editable element",
      category: "core",
      args: z29.object({
        target: z29.string().describe(elementTargetDescription2),
        text: z29.string().describe("Text to fill into the element")
      }),
      options: z29.object({
        submit: z29.boolean().optional().describe("Whether to submit entered text (press Enter after)")
      }),
      toolName: "browser_type",
      toolParams: ({ target, text: text2, submit }) => ({ target, text: text2, submit })
    });
    hover2 = declareCommand({
      name: "hover",
      description: "Hover over element on page",
      category: "core",
      args: z29.object({
        target: z29.string().describe(elementTargetDescription2)
      }),
      toolName: "browser_hover",
      toolParams: ({ target }) => ({ target })
    });
    select = declareCommand({
      name: "select",
      description: "Select an option in a dropdown",
      category: "core",
      args: z29.object({
        target: z29.string().describe(elementTargetDescription2),
        val: z29.string().describe("Value to select in the dropdown")
      }),
      toolName: "browser_select_option",
      toolParams: ({ target, val: value2 }) => ({ target, values: [value2] })
    });
    fileUpload = declareCommand({
      name: "upload",
      description: "Upload one or multiple files",
      category: "core",
      args: z29.object({
        file: z29.string().describe("The absolute paths to the files to upload")
      }),
      toolName: "browser_file_upload",
      toolParams: ({ file }) => ({ paths: [file] })
    });
    check2 = declareCommand({
      name: "check",
      description: "Check a checkbox or radio button",
      category: "core",
      args: z29.object({
        target: z29.string().describe(elementTargetDescription2)
      }),
      toolName: "browser_check",
      toolParams: ({ target }) => ({ target })
    });
    uncheck2 = declareCommand({
      name: "uncheck",
      description: "Uncheck a checkbox or radio button",
      category: "core",
      args: z29.object({
        target: z29.string().describe(elementTargetDescription2)
      }),
      toolName: "browser_uncheck",
      toolParams: ({ target }) => ({ target })
    });
    snapshot2 = declareCommand({
      name: "snapshot",
      description: "Capture page snapshot to obtain element ref",
      category: "core",
      args: z29.object({
        target: z29.string().optional().describe("Element reference from the previous page snapshot, or a unique element selector for the root element to capture a partial snapshot instead of the whole page")
      }),
      options: z29.object({
        filename: z29.string().optional().describe("Save snapshot to markdown file instead of returning it in the response."),
        depth: numberArg.optional().describe("Limit snapshot depth, unlimited by default."),
        boxes: z29.boolean().optional().describe("Include each element's bounding box as [box=x,y,width,height] in the snapshot. Coordinates are viewport-relative, in CSS pixels (Element.getBoundingClientRect).")
      }),
      toolName: "browser_snapshot",
      toolParams: ({ filename, target, depth, boxes }) => ({ filename, target, depth, boxes })
    });
    generateLocator2 = declareCommand({
      name: "generate-locator",
      description: "Generate a Playwright locator for the given element",
      category: "devtools",
      args: z29.object({
        target: z29.string().describe(elementTargetDescription2)
      }),
      toolName: "browser_generate_locator",
      toolParams: ({ target }) => ({ target })
    });
    highlight2 = declareCommand({
      name: "highlight",
      description: "Show (or with --hide, remove) a highlight overlay for an element; `--hide` without a target hides all page highlights.",
      category: "devtools",
      args: z29.object({
        target: z29.string().optional().describe(elementTargetDescription2)
      }),
      options: z29.object({
        hide: z29.boolean().optional().describe("Hide a previously added highlight for this element, or all page highlights when no element is given"),
        style: z29.string().optional().describe('Additional inline CSS applied to the highlight overlay, e.g. "outline: 2px dashed red"')
      }),
      toolName: ({ hide }) => hide ? "browser_hide_highlight" : "browser_highlight",
      toolParams: ({ target, style }) => ({ target, style })
    });
    evaluate3 = declareCommand({
      name: "eval",
      description: "Evaluate JavaScript expression on page or element",
      category: "core",
      args: z29.object({
        func: z29.string().describe("() => { /* code */ } or (element) => { /* code */ } when element is provided"),
        target: z29.string().optional().describe(elementTargetDescription2)
      }),
      options: z29.object({
        filename: z29.string().optional().describe("Save evaluation result to a file instead of returning it in the response.")
      }),
      toolName: "browser_evaluate",
      toolParams: ({ func, target, filename }) => ({ function: func, filename, target })
    });
    dialogAccept = declareCommand({
      name: "dialog-accept",
      description: "Accept a dialog",
      category: "core",
      args: z29.object({
        prompt: z29.string().optional().describe("The text of the prompt in case of a prompt dialog.")
      }),
      toolName: "browser_handle_dialog",
      toolParams: ({ prompt: promptText }) => ({ accept: true, promptText })
    });
    dialogDismiss = declareCommand({
      name: "dialog-dismiss",
      description: "Dismiss a dialog",
      category: "core",
      args: z29.object({}),
      toolName: "browser_handle_dialog",
      toolParams: () => ({ accept: false })
    });
    resize2 = declareCommand({
      name: "resize",
      description: "Resize the browser window",
      category: "core",
      args: z29.object({
        w: numberArg.describe("Width of the browser window"),
        h: numberArg.describe("Height of the browser window")
      }),
      toolName: "browser_resize",
      toolParams: ({ w: width, h: height }) => ({ width, height })
    });
    runCode2 = declareCommand({
      name: "run-code",
      description: "Run Playwright code snippet",
      category: "devtools",
      args: z29.object({
        code: z29.string().optional().describe("A JavaScript function containing Playwright code to execute. It will be invoked with a single argument, page, which you can use for any page interaction.")
      }),
      options: z29.object({
        filename: z29.string().optional().describe("Load code from the specified file.")
      }),
      toolName: "browser_run_code_unsafe",
      toolParams: ({ code, filename }) => ({ code, filename })
    });
    tabList = declareCommand({
      name: "tab-list",
      description: "List all tabs",
      category: "tabs",
      args: z29.object({}),
      toolName: "browser_tabs",
      toolParams: () => ({ action: "list" })
    });
    tabNew = declareCommand({
      name: "tab-new",
      description: "Create a new tab",
      category: "tabs",
      args: z29.object({
        url: z29.string().optional().describe("The URL to navigate to in the new tab. If omitted, the new tab will be blank.")
      }),
      toolName: "browser_tabs",
      toolParams: ({ url: url2 }) => ({ action: "new", url: url2 })
    });
    tabClose = declareCommand({
      name: "tab-close",
      description: "Close a browser tab",
      category: "tabs",
      args: z29.object({
        index: numberArg.optional().describe("Tab index. If omitted, current tab is closed.")
      }),
      toolName: "browser_tabs",
      toolParams: ({ index }) => ({ action: "close", index })
    });
    tabSelect = declareCommand({
      name: "tab-select",
      description: "Select a browser tab",
      category: "tabs",
      args: z29.object({
        index: numberArg.describe("Tab index")
      }),
      toolName: "browser_tabs",
      toolParams: ({ index }) => ({ action: "select", index })
    });
    stateLoad = declareCommand({
      name: "state-load",
      description: "Loads browser storage (authentication) state from a file",
      category: "storage",
      args: z29.object({
        filename: z29.string().describe("File name to load the storage state from.")
      }),
      toolName: "browser_set_storage_state",
      toolParams: ({ filename }) => ({ filename })
    });
    stateSave = declareCommand({
      name: "state-save",
      description: "Saves the current storage (authentication) state to a file",
      category: "storage",
      args: z29.object({
        filename: z29.string().optional().describe("File name to save the storage state to.")
      }),
      toolName: "browser_storage_state",
      toolParams: ({ filename }) => ({ filename })
    });
    cookieList2 = declareCommand({
      name: "cookie-list",
      description: "List all cookies (optionally filtered by domain/path)",
      category: "storage",
      raw: true,
      args: z29.object({}),
      options: z29.object({
        domain: z29.string().optional().describe("Filter cookies by domain"),
        path: z29.string().optional().describe("Filter cookies by path")
      }),
      toolName: "browser_cookie_list",
      toolParams: ({ domain, path: path59 }) => ({ domain, path: path59 })
    });
    cookieGet2 = declareCommand({
      name: "cookie-get",
      description: "Get a specific cookie by name",
      category: "storage",
      raw: true,
      args: z29.object({
        name: z29.string().describe("Cookie name")
      }),
      toolName: "browser_cookie_get",
      toolParams: ({ name }) => ({ name })
    });
    cookieSet2 = declareCommand({
      name: "cookie-set",
      description: "Set a cookie with optional flags",
      category: "storage",
      args: z29.object({
        name: z29.string().describe("Cookie name"),
        value: z29.string().describe("Cookie value")
      }),
      options: z29.object({
        domain: z29.string().optional().describe("Cookie domain"),
        path: z29.string().optional().describe("Cookie path"),
        expires: numberArg.optional().describe("Cookie expiration as Unix timestamp"),
        httpOnly: z29.boolean().optional().describe("Whether the cookie is HTTP only"),
        secure: z29.boolean().optional().describe("Whether the cookie is secure"),
        sameSite: z29.enum(["Strict", "Lax", "None"]).optional().describe("Cookie SameSite attribute")
      }),
      toolName: "browser_cookie_set",
      toolParams: ({ name, value: value2, domain, path: path59, expires, httpOnly, secure, sameSite }) => ({ name, value: value2, domain, path: path59, expires, httpOnly, secure, sameSite })
    });
    cookieDelete2 = declareCommand({
      name: "cookie-delete",
      description: "Delete a specific cookie",
      category: "storage",
      args: z29.object({
        name: z29.string().describe("Cookie name")
      }),
      toolName: "browser_cookie_delete",
      toolParams: ({ name }) => ({ name })
    });
    cookieClear2 = declareCommand({
      name: "cookie-clear",
      description: "Clear all cookies",
      category: "storage",
      args: z29.object({}),
      toolName: "browser_cookie_clear",
      toolParams: () => ({})
    });
    localStorageList2 = declareCommand({
      name: "localstorage-list",
      description: "List all localStorage key-value pairs",
      category: "storage",
      raw: true,
      args: z29.object({}),
      toolName: "browser_localstorage_list",
      toolParams: () => ({})
    });
    localStorageGet2 = declareCommand({
      name: "localstorage-get",
      description: "Get a localStorage item by key",
      category: "storage",
      raw: true,
      args: z29.object({
        key: z29.string().describe("Key to get")
      }),
      toolName: "browser_localstorage_get",
      toolParams: ({ key }) => ({ key })
    });
    localStorageSet2 = declareCommand({
      name: "localstorage-set",
      description: "Set a localStorage item",
      category: "storage",
      args: z29.object({
        key: z29.string().describe("Key to set"),
        value: z29.string().describe("Value to set")
      }),
      toolName: "browser_localstorage_set",
      toolParams: ({ key, value: value2 }) => ({ key, value: value2 })
    });
    localStorageDelete2 = declareCommand({
      name: "localstorage-delete",
      description: "Delete a localStorage item",
      category: "storage",
      args: z29.object({
        key: z29.string().describe("Key to delete")
      }),
      toolName: "browser_localstorage_delete",
      toolParams: ({ key }) => ({ key })
    });
    localStorageClear2 = declareCommand({
      name: "localstorage-clear",
      description: "Clear all localStorage",
      category: "storage",
      args: z29.object({}),
      toolName: "browser_localstorage_clear",
      toolParams: () => ({})
    });
    sessionStorageList2 = declareCommand({
      name: "sessionstorage-list",
      description: "List all sessionStorage key-value pairs",
      category: "storage",
      raw: true,
      args: z29.object({}),
      toolName: "browser_sessionstorage_list",
      toolParams: () => ({})
    });
    sessionStorageGet2 = declareCommand({
      name: "sessionstorage-get",
      description: "Get a sessionStorage item by key",
      category: "storage",
      raw: true,
      args: z29.object({
        key: z29.string().describe("Key to get")
      }),
      toolName: "browser_sessionstorage_get",
      toolParams: ({ key }) => ({ key })
    });
    sessionStorageSet2 = declareCommand({
      name: "sessionstorage-set",
      description: "Set a sessionStorage item",
      category: "storage",
      args: z29.object({
        key: z29.string().describe("Key to set"),
        value: z29.string().describe("Value to set")
      }),
      toolName: "browser_sessionstorage_set",
      toolParams: ({ key, value: value2 }) => ({ key, value: value2 })
    });
    sessionStorageDelete2 = declareCommand({
      name: "sessionstorage-delete",
      description: "Delete a sessionStorage item",
      category: "storage",
      args: z29.object({
        key: z29.string().describe("Key to delete")
      }),
      toolName: "browser_sessionstorage_delete",
      toolParams: ({ key }) => ({ key })
    });
    sessionStorageClear2 = declareCommand({
      name: "sessionstorage-clear",
      description: "Clear all sessionStorage",
      category: "storage",
      args: z29.object({}),
      toolName: "browser_sessionstorage_clear",
      toolParams: () => ({})
    });
    routeMock = declareCommand({
      name: "route",
      description: "Mock network requests matching a URL pattern",
      category: "network",
      args: z29.object({
        pattern: z29.string().describe('URL pattern to match (e.g., "**/api/users")')
      }),
      options: z29.object({
        status: numberArg.optional().describe("HTTP status code (default: 200)"),
        body: z29.string().optional().describe("Response body (text or JSON string)"),
        ["content-type"]: z29.string().optional().describe("Content-Type header"),
        header: stringArrayArg.optional().describe('Header to add in "Name: Value" format (repeatable)'),
        ["remove-header"]: z29.string().optional().describe("Comma-separated header names to remove")
      }),
      toolName: "browser_route",
      toolParams: ({ pattern, status, body, ["content-type"]: contentType, header: headers, ["remove-header"]: removeHeaders }) => ({
        pattern,
        status,
        body,
        contentType,
        headers,
        removeHeaders
      })
    });
    routeList2 = declareCommand({
      name: "route-list",
      description: "List all active network routes",
      category: "network",
      raw: true,
      args: z29.object({}),
      toolName: "browser_route_list",
      toolParams: () => ({})
    });
    unroute2 = declareCommand({
      name: "unroute",
      description: "Remove routes matching a pattern (or all routes)",
      category: "network",
      args: z29.object({
        pattern: z29.string().optional().describe("URL pattern to unroute (omit to remove all)")
      }),
      toolName: "browser_unroute",
      toolParams: ({ pattern }) => ({ pattern })
    });
    networkStateSet2 = declareCommand({
      name: "network-state-set",
      description: "Set the browser network state to online or offline",
      category: "network",
      args: z29.object({
        state: z29.enum(["online", "offline"]).describe('Set to "offline" to simulate offline mode, "online" to restore network connectivity')
      }),
      toolName: "browser_network_state_set",
      toolParams: ({ state }) => ({ state })
    });
    screenshot2 = declareCommand({
      name: "screenshot",
      description: "screenshot of the current page or element",
      category: "export",
      args: z29.object({
        target: z29.string().optional().describe(elementTargetDescription2)
      }),
      options: z29.object({
        filename: z29.string().optional().describe("File name to save the screenshot to. Defaults to `page-{timestamp}.{png|jpeg}` if not specified."),
        ["full-page"]: z29.boolean().optional().describe("When true, takes a screenshot of the full scrollable page, instead of the currently visible viewport.")
      }),
      toolName: "browser_take_screenshot",
      toolParams: ({ target, filename, ["full-page"]: fullPage }) => ({ filename, target, fullPage })
    });
    pdfSave = declareCommand({
      name: "pdf",
      description: "Save page as PDF",
      category: "export",
      args: z29.object({}),
      options: z29.object({
        filename: z29.string().optional().describe("File name to save the pdf to. Defaults to `page-{timestamp}.pdf` if not specified.")
      }),
      toolName: "browser_pdf_save",
      toolParams: ({ filename }) => ({ filename })
    });
    consoleList = declareCommand({
      name: "console",
      description: "List console messages",
      category: "devtools",
      args: z29.object({
        ["min-level"]: z29.string().optional().describe('Level of the console messages to return. Each level includes the messages of more severe levels. Defaults to "info".')
      }),
      options: z29.object({
        clear: z29.boolean().optional().describe("Whether to clear the console list")
      }),
      toolName: ({ clear }) => clear ? "browser_console_clear" : "browser_console_messages",
      toolParams: ({ ["min-level"]: level, clear }) => clear ? {} : { level }
    });
    networkRequests = declareCommand({
      name: "requests",
      description: "List all network requests since loading the page. Each request is numbered for use with the `request` command.",
      category: "network",
      args: z29.object({}),
      options: z29.object({
        static: z29.boolean().optional().describe("Whether to include successful static resources like images, fonts, scripts, etc. Defaults to false."),
        filter: z29.string().optional().describe('Only return requests whose URL matches this regexp (e.g. "/api/.*user").'),
        clear: z29.boolean().optional().describe("Whether to clear the network list")
      }),
      toolName: ({ clear }) => clear ? "browser_network_clear" : "browser_network_requests",
      toolParams: ({ static: s, filter, clear }) => clear ? {} : { static: s, filter }
    });
    filenameOption = z29.string().optional().describe("Filename to save the result to. If not provided, output is returned as text.");
    networkRequest = declareCommand({
      name: "request",
      description: "Show full details (headers, body, response) of a single network request by its number from the `requests` command.",
      category: "network",
      args: z29.object({
        index: numberArg.describe("1-based number of the request as listed by `requests`")
      }),
      options: z29.object({
        filename: filenameOption
      }),
      toolName: "browser_network_request",
      toolParams: ({ index, filename }) => ({ index, filename })
    });
    networkRequestHeaders = declareCommand({
      name: "request-headers",
      description: "Print only the request headers for a single network request by its number from the `requests` command.",
      category: "network",
      raw: true,
      args: z29.object({
        index: numberArg.describe("1-based number of the request as listed by `requests`")
      }),
      options: z29.object({
        filename: filenameOption
      }),
      toolName: "browser_network_request",
      toolParams: ({ index, filename }) => ({ index, part: "request-headers", filename })
    });
    networkRequestBody = declareCommand({
      name: "request-body",
      description: "Print only the request body for a single network request by its number from the `requests` command.",
      category: "network",
      raw: true,
      args: z29.object({
        index: numberArg.describe("1-based number of the request as listed by `requests`")
      }),
      options: z29.object({
        filename: filenameOption
      }),
      toolName: "browser_network_request",
      toolParams: ({ index, filename }) => ({ index, part: "request-body", filename })
    });
    networkResponseHeaders = declareCommand({
      name: "response-headers",
      description: "Print only the response headers for a single network request by its number from the `requests` command.",
      category: "network",
      raw: true,
      args: z29.object({
        index: numberArg.describe("1-based number of the request as listed by `requests`")
      }),
      options: z29.object({
        filename: filenameOption
      }),
      toolName: "browser_network_request",
      toolParams: ({ index, filename }) => ({ index, part: "response-headers", filename })
    });
    networkResponseBody = declareCommand({
      name: "response-body",
      description: "Print the response body for a single network request by its number from the `requests` command. Textual bodies are inlined; binary bodies are saved to a file and the path is printed.",
      category: "network",
      raw: true,
      args: z29.object({
        index: numberArg.describe("1-based number of the request as listed by `requests`")
      }),
      options: z29.object({
        filename: filenameOption
      }),
      toolName: "browser_network_request",
      toolParams: ({ index, filename }) => ({ index, part: "response-body", filename })
    });
    tracingStart2 = declareCommand({
      name: "tracing-start",
      description: "Start trace recording",
      category: "devtools",
      args: z29.object({}),
      toolName: "browser_start_tracing",
      toolParams: () => ({})
    });
    tracingStop2 = declareCommand({
      name: "tracing-stop",
      description: "Stop trace recording",
      category: "devtools",
      args: z29.object({}),
      toolName: "browser_stop_tracing",
      toolParams: () => ({})
    });
    videoStart2 = declareCommand({
      name: "video-start",
      description: "Start video recording",
      category: "devtools",
      args: z29.object({
        filename: z29.string().optional().describe("Filename to save the video.")
      }),
      options: z29.object({
        size: z29.string().optional().describe('Video frame size, e.g. "800x600". If not specified, the size of the recorded video will fit 800x800.')
      }),
      toolName: "browser_start_video",
      toolParams: ({ filename, size }) => {
        const parsedSize = size ? size.split("x").map(Number) : void 0;
        return { filename, size: parsedSize ? { width: parsedSize[0], height: parsedSize[1] } : void 0 };
      }
    });
    videoStop2 = declareCommand({
      name: "video-stop",
      description: "Stop video recording",
      category: "devtools",
      toolName: "browser_stop_video",
      toolParams: () => ({})
    });
    videoChapter2 = declareCommand({
      name: "video-chapter",
      description: "Add a chapter marker to the video recording",
      category: "devtools",
      args: z29.object({
        title: z29.string().describe("Chapter title.")
      }),
      options: z29.object({
        description: z29.string().optional().describe("Chapter description."),
        duration: numberArg.optional().describe("Duration in milliseconds to show the chapter card.")
      }),
      toolName: "browser_video_chapter",
      toolParams: ({ title, description, duration }) => ({ title, description, duration })
    });
    actionPositionArg = z29.enum(["top-left", "top", "top-right", "bottom-left", "bottom", "bottom-right"]);
    actionCursorArg = z29.enum(["none", "pointer"]);
    videoShowActions2 = declareCommand({
      name: "video-show-actions",
      description: "Annotate subsequent CLI/MCP actions on the page with a callout that names the action and highlights the target element",
      category: "devtools",
      args: z29.object({}),
      options: z29.object({
        duration: numberArg.optional().describe("How long each action annotation stays on screen, in milliseconds. Defaults to 500."),
        position: actionPositionArg.optional().describe("Where to place the action title: top-left, top, top-right, bottom-left, bottom, bottom-right. Defaults to top-right."),
        cursor: actionCursorArg.optional().describe('Cursor decoration: "pointer" (default) animates a mouse pointer between action points; "none" disables it.')
      }),
      toolName: "browser_video_show_actions",
      toolParams: ({ duration, position, cursor }) => ({ duration, position, cursor })
    });
    videoHideActions2 = declareCommand({
      name: "video-hide-actions",
      description: "Stop annotating actions performed on the page",
      category: "devtools",
      toolName: "browser_video_hide_actions",
      toolParams: () => ({})
    });
    dashboardShow = declareCommand({
      name: "show",
      description: "Show Playwright Dashboard",
      category: "devtools",
      raw: true,
      args: z29.object({}),
      options: z29.object({
        port: numberArg.optional().describe("Start as a blocking HTTP server on this port (use 0 for a random port)"),
        host: z29.string().optional().describe("Host to bind to when using --port (defaults to localhost)"),
        annotate: z29.boolean().optional().describe("Switch the dashboard into annotation mode."),
        kill: z29.boolean().optional().describe("Kill the dashboard daemon.")
      }),
      toolName: ({ annotate: annotate2 }) => annotate2 ? "browser_annotate" : "",
      toolParams: () => ({})
    });
    resume2 = declareCommand({
      name: "resume",
      description: "Resume the test execution",
      category: "devtools",
      args: z29.object({}),
      toolName: "browser_resume",
      toolParams: ({ step }) => ({ step })
    });
    stepOver = declareCommand({
      name: "step-over",
      description: "Step over the next call in the test",
      category: "devtools",
      args: z29.object({}),
      toolName: "browser_resume",
      toolParams: ({}) => ({ step: true })
    });
    pauseAt = declareCommand({
      name: "pause-at",
      description: "Run the test up to a specific location and pause there",
      category: "devtools",
      args: z29.object({
        location: z29.string().describe('Location to pause at. Format is <file>:<line>, e.g. "example.spec.ts:42".')
      }),
      toolName: "browser_resume",
      toolParams: ({ location: location2 }) => ({ location: location2 })
    });
    sessionList = declareCommand({
      name: "list",
      description: "List browser sessions",
      category: "browsers",
      args: z29.object({}),
      options: z29.object({
        all: z29.boolean().optional().describe("List all browser sessions across all workspaces")
      }),
      toolName: "",
      toolParams: () => ({})
    });
    sessionCloseAll = declareCommand({
      name: "close-all",
      description: "Close all browser sessions",
      category: "browsers",
      toolName: "",
      toolParams: () => ({})
    });
    killAll = declareCommand({
      name: "kill-all",
      description: "Forcefully kill all browser sessions (for stale/zombie processes)",
      category: "browsers",
      toolName: "",
      toolParams: () => ({})
    });
    deleteData = declareCommand({
      name: "delete-data",
      description: "Delete session data",
      category: "core",
      toolName: "",
      toolParams: () => ({})
    });
    configPrint = declareCommand({
      name: "config-print",
      description: "Print the final resolved config after merging CLI options, environment variables and config file.",
      category: "config",
      hidden: true,
      toolName: "browser_get_config",
      toolParams: () => ({})
    });
    install = declareCommand({
      name: "install",
      description: "Initialize workspace",
      category: "install",
      args: z29.object({}),
      options: z29.object({
        skills: z29.string().optional().describe("Install skills, possible values: claude (default), agents.")
      }),
      toolName: "",
      toolParams: () => ({})
    });
    installBrowser = declareCommand({
      name: "install-browser",
      description: "Install browser",
      category: "install",
      args: z29.object({
        browser: z29.string().optional().describe("Browser to install")
      }),
      options: z29.object({
        ["with-deps"]: z29.boolean().optional().describe("Install system dependencies for browsers"),
        ["dry-run"]: z29.boolean().optional().describe("Do not execute installation, only print information"),
        list: z29.boolean().optional().describe("Prints list of browsers from all Playwright installations"),
        force: z29.boolean().optional().describe("Force reinstall of already installed browsers"),
        ["only-shell"]: z29.boolean().optional().describe("Only install headless shell when installing Chromium"),
        ["no-shell"]: z29.boolean().optional().describe("Do not install Chromium headless shell")
      }),
      toolName: "",
      toolParams: () => ({})
    });
    tray = declareCommand({
      name: "tray",
      description: "Run tray",
      category: "config",
      hidden: true,
      toolName: "",
      toolParams: () => ({})
    });
    commandsArray = [
      // core category
      open3,
      attach,
      close2,
      detach,
      goto,
      type2,
      click2,
      doubleClick,
      fill,
      drag2,
      drop2,
      hover2,
      select,
      fileUpload,
      check2,
      uncheck2,
      snapshot2,
      evaluate3,
      consoleList,
      dialogAccept,
      dialogDismiss,
      resize2,
      runCode2,
      deleteData,
      // navigation category
      goBack2,
      goForward2,
      reload2,
      // keyboard category
      pressKey,
      keydown2,
      keyup2,
      // mouse category
      mouseMove2,
      mouseDown2,
      mouseUp2,
      mouseWheel2,
      // export category
      screenshot2,
      pdfSave,
      // tabs category
      tabList,
      tabNew,
      tabClose,
      tabSelect,
      // storage category
      stateLoad,
      stateSave,
      cookieList2,
      cookieGet2,
      cookieSet2,
      cookieDelete2,
      cookieClear2,
      localStorageList2,
      localStorageGet2,
      localStorageSet2,
      localStorageDelete2,
      localStorageClear2,
      sessionStorageList2,
      sessionStorageGet2,
      sessionStorageSet2,
      sessionStorageDelete2,
      sessionStorageClear2,
      // network category
      networkRequests,
      networkRequest,
      networkRequestHeaders,
      networkRequestBody,
      networkResponseHeaders,
      networkResponseBody,
      routeMock,
      routeList2,
      unroute2,
      networkStateSet2,
      // config category
      configPrint,
      // install category
      install,
      installBrowser,
      // devtools category
      tracingStart2,
      tracingStop2,
      videoStart2,
      videoStop2,
      videoChapter2,
      videoShowActions2,
      videoHideActions2,
      dashboardShow,
      pauseAt,
      resume2,
      stepOver,
      generateLocator2,
      highlight2,
      // session category
      sessionList,
      sessionCloseAll,
      killAll,
      // Hidden commands
      tray
    ];
    commands = Object.fromEntries(commandsArray.map((cmd) => [cmd.name, cmd]));
  }
});

// packages/playwright-core/src/tools/trace/traceSnapshot.ts
async function traceSnapshot(actionId, options) {
  const trace = await loadTrace();
  const action = trace.resolveActionId(actionId);
  if (!action) {
    console.error(`Action '${actionId}' not found.`);
    process.exitCode = 1;
    return;
  }
  const pageId4 = action.pageId;
  if (!pageId4) {
    console.error(`Action '${actionId}' has no associated page.`);
    process.exitCode = 1;
    return;
  }
  const callId = action.callId;
  const storage = trace.loader.storage();
  let snapshotName;
  let renderer;
  if (options.name) {
    snapshotName = options.name;
    renderer = storage.snapshotByName(pageId4, `${snapshotName}@${callId}`);
  } else {
    for (const candidate of ["input", "before", "after"]) {
      renderer = storage.snapshotByName(pageId4, `${candidate}@${callId}`);
      if (renderer) {
        snapshotName = candidate;
        break;
      }
    }
  }
  if (!renderer || !snapshotName) {
    console.error(`No snapshot found for action '${actionId}'.`);
    process.exitCode = 1;
    return;
  }
  const snapshotKey = `${snapshotName}@${callId}`;
  const server = await serveTraceSnapshot(storage, trace.loader, pageId4, snapshotKey);
  if (options.serve) {
    console.log(`Serving snapshot at ${server.url}`);
    await new Promise(() => {
    });
    return;
  }
  await runCommandOnSnapshot(server, options.browserArgs || []);
}
async function serveTraceSnapshot(storage, loader, pageId4, snapshotKey) {
  const snapshotServer = new SnapshotServer(storage, (sha1) => loader.resourceForSha1(sha1));
  const httpServer = new HttpServer();
  httpServer.routePrefix("/snapshot/", (request2, response2) => {
    const url2 = new URL("http://localhost" + request2.url);
    const pageOrFrameId = url2.pathname.substring("/snapshot/".length);
    const searchParams = url2.searchParams;
    searchParams.set("name", snapshotKey);
    const snapshotResponse = snapshotServer.serveSnapshot(pageOrFrameId, searchParams, url2.href);
    response2.statusCode = snapshotResponse.status;
    snapshotResponse.headers.forEach((value2, key) => response2.setHeader(key, value2));
    snapshotResponse.text().then((text2) => response2.end(text2));
    return true;
  });
  httpServer.routePath("/__pwsnapshot/sw.js", (_request, response2) => {
    response2.statusCode = 200;
    response2.setHeader("Content-Type", "application/javascript");
    response2.setHeader("Service-Worker-Allowed", "/");
    response2.end(`(${snapshotServiceWorker.toString()})();`);
    return true;
  });
  httpServer.routePath("/__pwsnapshot/resource", (request2, response2) => {
    const url2 = new URL("http://localhost" + request2.url);
    const frame = new URL(url2.searchParams.get("frame"));
    const snapshotUrl2 = "http://localhost" + frame.pathname + frame.search;
    const requestUrl = url2.searchParams.get("url");
    const method = url2.searchParams.get("method");
    snapshotServer.serveResource([requestUrl], method, snapshotUrl2).then(async (resp) => {
      response2.statusCode = resp.status;
      resp.headers.forEach((value2, key) => response2.appendHeader(key, value2));
      response2.end(Buffer.from(await resp.arrayBuffer()));
    }).catch(() => {
      response2.statusCode = 500;
      response2.end();
    });
    return true;
  });
  const startTime = Date.now();
  const snapshotUrl = `/snapshot/${pageId4}?name=${encodeURIComponent(snapshotKey)}`;
  httpServer.routePrefix("/", (_request, response2) => {
    response2.statusCode = 200;
    response2.setHeader("Content-Type", "text/html; charset=utf-8");
    response2.end(`<!DOCTYPE html><html><body><script>(${bootstrapSnapshotPage.toString()})(${JSON.stringify(`/__pwsnapshot/sw.js?v=${startTime}`)}, ${JSON.stringify(snapshotUrl)});</script></body></html>`);
    return true;
  });
  await httpServer.start({ preferredPort: 0 });
  return { url: httpServer.urlPrefix("human-readable"), stop: () => httpServer.stop() };
}
function snapshotServiceWorker() {
  const sw = self;
  sw.addEventListener("install", () => sw.skipWaiting());
  sw.addEventListener("activate", (event) => event.waitUntil(sw.clients.claim()));
  sw.addEventListener("fetch", (event) => {
    const requestUrl = new URL(event.request.url);
    if (requestUrl.origin === sw.location.origin)
      return;
    event.respondWith((async () => {
      const client = event.clientId ? await sw.clients.get(event.clientId) : null;
      if (!client)
        return new Response("No client", { status: 500 });
      const params2 = new URLSearchParams({
        frame: client.url,
        url: event.request.url,
        method: event.request.method
      });
      return fetch("/__pwsnapshot/resource?" + params2.toString());
    })());
  });
}
async function bootstrapSnapshotPage(swUrl, snapshotUrl) {
  await navigator.serviceWorker.register(swUrl, { scope: "/" });
  await navigator.serviceWorker.ready;
  if (!navigator.serviceWorker.controller)
    await new Promise((resolve) => navigator.serviceWorker.addEventListener("controllerchange", resolve, { once: true }));
  location.replace(snapshotUrl);
}
async function runCommandOnSnapshot(server, browserArgs) {
  const browser = await playwright.chromium.launch({ headless: true });
  const context2 = await browser.newContext();
  const page = await context2.newPage();
  await page.goto(server.url);
  await page.waitForURL((url2) => new URL(url2).pathname.startsWith("/snapshot/"));
  const backend = new BrowserBackend({
    snapshot: { mode: "full" },
    outputMode: "file",
    skillMode: true
  }, context2, browserTools);
  await backend.initialize({ cwd: process.cwd(), clientName: "playwright-cli" });
  try {
    if (!browserArgs.length)
      browserArgs = ["snapshot"];
    const args = minimist(browserArgs, { string: ["_"] });
    const command = commands[args._[0]];
    if (!command)
      throw new Error(`Unknown command: ${args._[0]}`);
    const { toolName, toolParams } = parseCommand(command, args);
    const result2 = await backend.callTool(toolName, toolParams);
    const text2 = result2.content[0]?.type === "text" ? result2.content[0].text : void 0;
    if (text2)
      console.log(text2);
    if (result2.isError) {
      console.error("Command failed.");
      process.exitCode = 1;
    }
  } catch (e) {
    console.error(e.message);
    process.exitCode = 1;
  } finally {
    await server.stop().catch((e) => console.error(e));
    await gracefullyCloseAll();
  }
}
var init_traceSnapshot = __esm({
  "packages/playwright-core/src/tools/trace/traceSnapshot.ts"() {
    "use strict";
    init_processLauncher();
    init_httpServer();
    init_snapshotServer();
    init_browserBackend();
    init_tools();
    init_inprocess();
    init_command();
    init_minimist();
    init_commands();
    init_traceUtils2();
  }
});

// packages/playwright-core/src/tools/trace/traceScreenshot.ts
async function traceScreenshot(actionId, options) {
  const trace = await loadTrace();
  const action = trace.resolveActionId(actionId);
  if (!action) {
    console.error(`Action '${actionId}' not found.`);
    process.exitCode = 1;
    return;
  }
  const pageId4 = action.pageId;
  if (!pageId4) {
    console.error(`Action '${actionId}' has no associated page.`);
    process.exitCode = 1;
    return;
  }
  const callId = action.callId;
  const storage = trace.loader.storage();
  const snapshotNames = ["input", "before", "after"];
  let sha1;
  for (const name of snapshotNames) {
    const renderer = storage.snapshotByName(pageId4, `${name}@${callId}`);
    sha1 = renderer?.closestScreenshot();
    if (sha1)
      break;
  }
  if (!sha1) {
    console.error(`No screenshot found for action '${actionId}'.`);
    process.exitCode = 1;
    return;
  }
  const blob = await trace.loader.resourceForSha1(sha1);
  if (!blob) {
    console.error(`Screenshot resource not found.`);
    process.exitCode = 1;
    return;
  }
  const defaultName = `screenshot-${actionId}.png`;
  const buffer = Buffer.from(await blob.arrayBuffer());
  const outFile = await saveOutputFile(defaultName, buffer, options.output);
  console.log(`  Screenshot saved to ${outFile}`);
}
var init_traceScreenshot = __esm({
  "packages/playwright-core/src/tools/trace/traceScreenshot.ts"() {
    "use strict";
    init_traceUtils2();
  }
});

// packages/playwright-core/src/tools/trace/traceAttachments.ts
async function traceAttachments() {
  const trace = await loadTrace();
  if (!trace.model.attachments.length) {
    console.log("  No attachments");
    return;
  }
  console.log(`  ${"#".padStart(4)} ${"Name".padEnd(40)} ${"Content-Type".padEnd(30)} ${"Action".padEnd(8)}`);
  console.log(`  ${"\u2500".repeat(4)} ${"\u2500".repeat(40)} ${"\u2500".repeat(30)} ${"\u2500".repeat(8)}`);
  for (let i = 0; i < trace.model.attachments.length; i++) {
    const a = trace.model.attachments[i];
    const actionOrdinal = trace.callIdToOrdinal.get(a.callId);
    console.log(`  ${(i + 1 + ".").padStart(4)} ${a.name.padEnd(40)} ${a.contentType.padEnd(30)} ${(actionOrdinal !== void 0 ? String(actionOrdinal) : a.callId).padEnd(8)}`);
  }
}
async function traceAttachment(attachmentId, options) {
  const trace = await loadTrace();
  const ordinal = parseInt(attachmentId, 10);
  const attachment = !isNaN(ordinal) && ordinal >= 1 && ordinal <= trace.model.attachments.length ? trace.model.attachments[ordinal - 1] : void 0;
  if (!attachment) {
    console.error(`Attachment '${attachmentId}' not found. Use 'trace attachments' to see available attachments.`);
    process.exitCode = 1;
    return;
  }
  let content;
  if (attachment.sha1) {
    const blob = await trace.loader.resourceForSha1(attachment.sha1);
    if (blob)
      content = Buffer.from(await blob.arrayBuffer());
  } else if (attachment.base64) {
    content = Buffer.from(attachment.base64, "base64");
  }
  if (!content) {
    console.error(`Could not extract attachment content.`);
    process.exitCode = 1;
    return;
  }
  const outFile = await saveOutputFile(attachment.name, content, options.output);
  console.log(`  Attachment saved to ${outFile}`);
}
var init_traceAttachments = __esm({
  "packages/playwright-core/src/tools/trace/traceAttachments.ts"() {
    "use strict";
    init_traceUtils2();
  }
});

// packages/playwright-core/src/tools/trace/installSkill.ts
async function installSkill() {
  const cwd = process.cwd();
  const skillSource = libPath("tools", "trace", "SKILL.md");
  const destDir = import_path42.default.join(cwd, ".claude", "skills", "playwright-trace");
  await import_fs47.default.promises.mkdir(destDir, { recursive: true });
  const destFile = import_path42.default.join(destDir, "SKILL.md");
  await import_fs47.default.promises.copyFile(skillSource, destFile);
  console.log(`\u2705 Skill installed to \`${import_path42.default.relative(cwd, destFile)}\`.`);
}
var import_fs47, import_path42;
var init_installSkill = __esm({
  "packages/playwright-core/src/tools/trace/installSkill.ts"() {
    "use strict";
    import_fs47 = __toESM(require("fs"));
    import_path42 = __toESM(require("path"));
    init_package();
  }
});

// packages/playwright-core/src/tools/trace/traceCli.ts
function addTraceCommands(program4, logErrorAndExit2) {
  const traceCommand = program4.command("trace").description("inspect trace files from the command line");
  traceCommand.command("open <trace>").description("extract trace file for inspection").action(async (trace) => {
    traceOpen(trace).catch(logErrorAndExit2);
  });
  traceCommand.command("close").description("remove extracted trace data").action(async () => {
    closeTrace().catch(logErrorAndExit2);
  });
  traceCommand.command("actions").description("list actions in the trace").option("--grep <pattern>", "filter actions by title pattern").option("--errors-only", "only show failed actions").action(async (options) => {
    traceActions(options).catch(logErrorAndExit2);
  });
  traceCommand.command("action <action-id>").description("show details of a specific action").action(async (actionId) => {
    traceAction(actionId).catch(logErrorAndExit2);
  });
  traceCommand.command("requests").description("show network requests").option("--grep <pattern>", "filter by URL pattern").option("--method <method>", "filter by HTTP method").option("--status <code>", "filter by status code").option("--failed", "only show failed requests (status >= 400)").action(async (options) => {
    traceRequests(options).catch(logErrorAndExit2);
  });
  traceCommand.command("request <request-id>").description("show details of a specific network request").action(async (requestId) => {
    traceRequest(requestId).catch(logErrorAndExit2);
  });
  traceCommand.command("console").description("show console messages").option("--errors-only", "only show errors").option("--warnings", "show errors and warnings").option("--browser", "only browser console messages").option("--stdio", "only stdout/stderr").action(async (options) => {
    traceConsole(options).catch(logErrorAndExit2);
  });
  traceCommand.command("errors").description("show errors with stack traces").action(async () => {
    traceErrors().catch(logErrorAndExit2);
  });
  traceCommand.command("snapshot <action-id>").description("run a playwright-cli command against a DOM snapshot").option("--name <name>", "snapshot phase: before, input, or after").option("--serve", "serve snapshot on localhost and keep running").allowUnknownOption(true).allowExcessArguments(true).action(async (actionId, options, cmd) => {
    try {
      const browserArgs = cmd.args.slice(1);
      await traceSnapshot(actionId, { ...options, browserArgs });
    } catch (e) {
      logErrorAndExit2(e);
    }
  });
  traceCommand.command("screenshot <action-id>").description("save screencast screenshot for an action").option("-o, --output <path>", "output file path").action(async (actionId, options) => {
    traceScreenshot(actionId, options).catch(logErrorAndExit2);
  });
  traceCommand.command("attachments").description("list trace attachments").action(async () => {
    traceAttachments().catch(logErrorAndExit2);
  });
  traceCommand.command("attachment <attachment-id>").description("extract a trace attachment by its number").option("-o, --output <path>", "output file path").action(async (attachmentId, options) => {
    traceAttachment(attachmentId, options).catch(logErrorAndExit2);
  });
  traceCommand.command("install-skill").description("install SKILL.md for LLM integration").action(async () => {
    installSkill().catch(logErrorAndExit2);
  });
}
var init_traceCli = __esm({
  "packages/playwright-core/src/tools/trace/traceCli.ts"() {
    "use strict";
    init_traceOpen();
    init_traceUtils2();
    init_traceActions();
    init_traceActions();
    init_traceRequests();
    init_traceRequests();
    init_traceConsole();
    init_traceErrors();
    init_traceSnapshot();
    init_traceScreenshot();
    init_traceAttachments();
    init_traceAttachments();
    init_installSkill();
  }
});

// packages/playwright-core/src/cli/driver.ts
function printApiJson() {
  console.log(JSON.stringify(require(import_path43.default.join(packageRoot, "api.json"))));
}
function runDriver() {
  const dispatcherConnection = new DispatcherConnection();
  new RootDispatcher(dispatcherConnection, async (rootScope, { sdkLanguage }) => {
    const playwright2 = createPlaywright({ sdkLanguage, isClientCollocatedWithServer: true });
    return new PlaywrightDispatcher(rootScope, playwright2);
  });
  const transport = new PipeTransport(process.stdout, process.stdin);
  transport.onmessage = (message) => dispatcherConnection.dispatch(JSON.parse(message));
  const isJavaScriptLanguageBinding = !process.env.PW_LANG_NAME || process.env.PW_LANG_NAME === "javascript";
  const replacer = !isJavaScriptLanguageBinding && String.prototype.toWellFormed ? (key, value2) => {
    if (typeof value2 === "string")
      return value2.toWellFormed();
    return value2;
  } : void 0;
  dispatcherConnection.onmessage = (message) => transport.send(JSON.stringify(message, replacer));
  transport.onclose = () => {
    dispatcherConnection.onmessage = () => {
    };
    gracefullyProcessExitDoNotHang(0);
  };
  process.on("SIGINT", () => {
  });
}
async function runServer(options) {
  const {
    port,
    host,
    path: path59 = "/",
    maxConnections = Infinity,
    extension,
    artifactsDir,
    unsafe
  } = options;
  const server = new PlaywrightServer({ mode: extension ? "extension" : "default", path: path59, maxConnections, artifactsDir, unsafe });
  const wsEndpoint = await server.listen(port, host);
  process.on("exit", () => server.close().catch(console.error));
  console.log("Listening on " + wsEndpoint);
  process.stdin.on("close", () => gracefullyProcessExitDoNotHang(0));
}
async function launchBrowserServer(browserName, configFile) {
  let options = {};
  if (configFile)
    options = JSON.parse(import_fs48.default.readFileSync(configFile).toString());
  const browserType = playwright[browserName];
  const server = await browserType.launchServer(options);
  console.log(server.wsEndpoint());
}
var import_fs48, import_path43;
var init_driver = __esm({
  "packages/playwright-core/src/cli/driver.ts"() {
    "use strict";
    import_fs48 = __toESM(require("fs"));
    import_path43 = __toESM(require("path"));
    init_pipeTransport();
    init_processLauncher();
    init_package();
    init_inprocess();
    init_playwrightServer();
    init_server();
  }
});

// packages/playwright-core/src/cli/installActions.ts
function printInstalledBrowsers(browsers) {
  const browserPaths = /* @__PURE__ */ new Set();
  for (const browser of browsers)
    browserPaths.add(browser.browserPath);
  console.log(`  Browsers:`);
  for (const browserPath of [...browserPaths].sort())
    console.log(`    ${browserPath}`);
  console.log(`  References:`);
  const references = /* @__PURE__ */ new Set();
  for (const browser of browsers)
    references.add(browser.referenceDir);
  for (const reference of [...references].sort())
    console.log(`    ${reference}`);
}
function printGroupedByPlaywrightVersion(browsers) {
  const dirToVersion = /* @__PURE__ */ new Map();
  for (const browser of browsers) {
    if (dirToVersion.has(browser.referenceDir))
      continue;
    const packageJSON2 = require(import_path44.default.join(browser.referenceDir, "package.json"));
    const version3 = packageJSON2.version;
    dirToVersion.set(browser.referenceDir, version3);
  }
  const groupedByPlaywrightMinorVersion = /* @__PURE__ */ new Map();
  for (const browser of browsers) {
    const version3 = dirToVersion.get(browser.referenceDir);
    let entries = groupedByPlaywrightMinorVersion.get(version3);
    if (!entries) {
      entries = [];
      groupedByPlaywrightMinorVersion.set(version3, entries);
    }
    entries.push(browser);
  }
  const sortedVersions = [...groupedByPlaywrightMinorVersion.keys()].sort((a, b) => {
    const aComponents = a.split(".");
    const bComponents = b.split(".");
    const aMajor = parseInt(aComponents[0], 10);
    const bMajor = parseInt(bComponents[0], 10);
    if (aMajor !== bMajor)
      return aMajor - bMajor;
    const aMinor = parseInt(aComponents[1], 10);
    const bMinor = parseInt(bComponents[1], 10);
    if (aMinor !== bMinor)
      return aMinor - bMinor;
    return aComponents.slice(2).join(".").localeCompare(bComponents.slice(2).join("."));
  });
  for (const version3 of sortedVersions) {
    console.log(`
Playwright version: ${version3}`);
    printInstalledBrowsers(groupedByPlaywrightMinorVersion.get(version3));
  }
}
async function markDockerImage(dockerImageNameTemplate) {
  assert(dockerImageNameTemplate, "dockerImageNameTemplate is required");
  await writeDockerVersion(dockerImageNameTemplate);
}
async function installBrowsers(args, options) {
  if (options.progress === false)
    process.env.PLAYWRIGHT_DOWNLOAD_NO_PROGRESS = "1";
  if (isLikelyNpxGlobal()) {
    console.error(wrapInASCIIBox([
      `WARNING: It looks like you are running 'npx playwright install' without first`,
      `installing your project's dependencies.`,
      ``,
      `To avoid unexpected behavior, please install your dependencies first, and`,
      `then run Playwright's install command:`,
      ``,
      `    npm install`,
      `    npx playwright install`,
      ``,
      `If your project does not yet depend on Playwright, first install the`,
      `applicable npm package (most commonly @playwright/test), and`,
      `then run Playwright's install command to download the browsers:`,
      ``,
      `    npm install @playwright/test`,
      `    npx playwright install`,
      ``
    ].join("\n"), 1));
  }
  if (options.shell === false && options.onlyShell)
    throw new Error(`Only one of --no-shell and --only-shell can be specified`);
  const shell = options.shell === false ? "no" : options.onlyShell ? "only" : void 0;
  const executables = registry.resolveBrowsers(args, { shell });
  if (options.withDeps)
    await registry.installDeps(executables, !!options.dryRun);
  if (options.dryRun && options.list)
    throw new Error(`Only one of --dry-run and --list can be specified`);
  if (options.dryRun) {
    for (const executable of executables) {
      console.log(registry.calculateDownloadTitle(executable));
      console.log(`  Install location:    ${executable.directory ?? "<system>"}`);
      if (executable.downloadURLs?.length) {
        const [url2, ...fallbacks] = executable.downloadURLs;
        console.log(`  Download url:        ${url2}`);
        for (let i = 0; i < fallbacks.length; ++i)
          console.log(`  Download fallback ${i + 1}: ${fallbacks[i]}`);
      }
      console.log(``);
    }
  } else if (options.list) {
    const browsers = await registry.listInstalledBrowsers();
    printGroupedByPlaywrightVersion(browsers);
  } else {
    await registry.install(executables, { force: options.force });
    await registry.validateHostRequirementsForExecutablesIfNeeded(executables, process.env.PW_LANG_NAME || "javascript").catch((e) => {
      e.name = "Playwright Host validation warning";
      console.error(e);
    });
  }
}
async function uninstallBrowsers(options) {
  delete process.env.PLAYWRIGHT_SKIP_BROWSER_GC;
  await registry.uninstall(!!options.all).then(({ numberOfBrowsersLeft }) => {
    if (!options.all && numberOfBrowsersLeft > 0) {
      console.log("Successfully uninstalled Playwright browsers for the current Playwright installation.");
      console.log(`There are still ${numberOfBrowsersLeft} browsers left, used by other Playwright installations.
To uninstall Playwright browsers for all installations, re-run with --all flag.`);
    }
  });
}
async function installDeps(args, options) {
  await registry.installDeps(registry.resolveBrowsers(args, {}), !!options.dryRun);
}
var import_path44;
var init_installActions = __esm({
  "packages/playwright-core/src/cli/installActions.ts"() {
    "use strict";
    import_path44 = __toESM(require("path"));
    init_ascii();
    init_env();
    init_assert();
    init_registry();
  }
});

// packages/playwright-core/src/cli/browserActions.ts
async function launchContext(options, extraOptions) {
  validateOptions(options);
  const browserType = lookupBrowserType(options);
  const launchOptions = extraOptions;
  if (options.channel)
    launchOptions.channel = options.channel;
  launchOptions.handleSIGINT = false;
  const contextOptions = (
    // Copy the device descriptor since we have to compare and modify the options.
    options.device ? { ...playwright.devices[options.device] } : {}
  );
  if (!extraOptions.headless)
    contextOptions.deviceScaleFactor = import_os20.default.platform() === "darwin" ? 2 : 1;
  if (browserType.name() === "webkit" && process.platform === "linux") {
    delete contextOptions.hasTouch;
    delete contextOptions.isMobile;
  }
  if (options.blockServiceWorkers)
    contextOptions.serviceWorkers = "block";
  if (options.proxyServer) {
    launchOptions.proxy = {
      server: options.proxyServer
    };
    if (options.proxyBypass)
      launchOptions.proxy.bypass = options.proxyBypass;
  }
  if (options.viewportSize) {
    try {
      const [width, height] = options.viewportSize.split(",").map((n) => +n);
      if (isNaN(width) || isNaN(height))
        throw new Error("bad values");
      contextOptions.viewport = { width, height };
    } catch (e) {
      throw new Error('Invalid viewport size format: use "width,height", for example --viewport-size="800,600"');
    }
  }
  if (options.geolocation) {
    try {
      const [latitude, longitude] = options.geolocation.split(",").map((n) => parseFloat(n.trim()));
      contextOptions.geolocation = {
        latitude,
        longitude
      };
    } catch (e) {
      throw new Error('Invalid geolocation format, should be "lat,long". For example --geolocation="37.819722,-122.478611"');
    }
    contextOptions.permissions = ["geolocation"];
  }
  if (options.userAgent)
    contextOptions.userAgent = options.userAgent;
  if (options.lang)
    contextOptions.locale = options.lang;
  if (options.colorScheme)
    contextOptions.colorScheme = options.colorScheme;
  if (options.timezone)
    contextOptions.timezoneId = options.timezone;
  if (options.loadStorage)
    contextOptions.storageState = options.loadStorage;
  if (options.ignoreHttpsErrors)
    contextOptions.ignoreHTTPSErrors = true;
  if (options.saveHar) {
    contextOptions.recordHar = { path: import_path45.default.resolve(process.cwd(), options.saveHar), mode: "minimal" };
    if (options.saveHarGlob)
      contextOptions.recordHar.urlFilter = options.saveHarGlob;
    contextOptions.serviceWorkers = "block";
  }
  let browser;
  let context2;
  if (options.userDataDir) {
    context2 = await browserType.launchPersistentContext(options.userDataDir, { ...launchOptions, ...contextOptions });
    browser = context2.browser();
  } else {
    browser = await browserType.launch(launchOptions);
    context2 = await browser.newContext(contextOptions);
  }
  let closingBrowser = false;
  async function closeBrowser() {
    if (closingBrowser)
      return;
    closingBrowser = true;
    if (options.saveStorage)
      await context2.storageState({ path: options.saveStorage }).catch((e) => null);
    if (options.saveHar)
      await context2.close();
    await browser.close();
  }
  context2.on("page", (page) => {
    page.on("dialog", () => {
    });
    page.on("close", () => {
      const hasPage = browser.contexts().some((context3) => context3.pages().length > 0);
      if (hasPage)
        return;
      closeBrowser().catch(() => {
      });
    });
  });
  process.on("SIGINT", async () => {
    await closeBrowser();
    gracefullyProcessExitDoNotHang(130);
  });
  const timeout = options.timeout ? parseInt(options.timeout, 10) : 0;
  context2.setDefaultTimeout(timeout);
  context2.setDefaultNavigationTimeout(timeout);
  delete launchOptions.headless;
  delete launchOptions.executablePath;
  delete launchOptions.handleSIGINT;
  delete contextOptions.deviceScaleFactor;
  return { browser, browserName: browserType.name(), context: context2, contextOptions, launchOptions, closeBrowser };
}
async function openPage(context2, url2) {
  let page = context2.pages()[0];
  if (!page)
    page = await context2.newPage();
  if (url2) {
    if (import_fs49.default.existsSync(url2))
      url2 = "file://" + import_path45.default.resolve(url2);
    else if (!url2.startsWith("http") && !url2.startsWith("file://") && !url2.startsWith("about:") && !url2.startsWith("data:"))
      url2 = "http://" + url2;
    await page.goto(url2);
  }
  return page;
}
async function open4(options, url2) {
  const { context: context2 } = await launchContext(options, { headless: !!process.env.PWTEST_CLI_HEADLESS, executablePath: process.env.PWTEST_CLI_EXECUTABLE_PATH });
  await context2._exposeConsoleApi();
  await openPage(context2, url2);
}
async function codegen(options, url2) {
  const { target: language, output: outputFile2, testIdAttribute: testIdAttributeName2 } = options;
  const tracesDir = import_path45.default.join(import_os20.default.tmpdir(), `playwright-recorder-trace-${Date.now()}`);
  const { context: context2, browser, launchOptions, contextOptions, closeBrowser } = await launchContext(options, {
    headless: !!process.env.PWTEST_CLI_HEADLESS,
    executablePath: process.env.PWTEST_CLI_EXECUTABLE_PATH,
    tracesDir
  });
  const donePromise = new ManualPromise();
  maybeSetupTestHooks(browser, closeBrowser, donePromise);
  dotenv.config({ path: "playwright.env" });
  await context2._enableRecorder({
    language,
    launchOptions,
    contextOptions,
    device: options.device,
    saveStorage: options.saveStorage,
    mode: "recording",
    testIdAttributeName: testIdAttributeName2,
    outputFile: outputFile2 ? import_path45.default.resolve(outputFile2) : void 0,
    handleSIGINT: false
  });
  await openPage(context2, url2);
  donePromise.resolve();
}
async function maybeSetupTestHooks(browser, closeBrowser, donePromise) {
  if (!process.env.PWTEST_CLI_IS_UNDER_TEST)
    return;
  const logs = [];
  debug11.log = (...args) => {
    const line = require("util").format(...args) + "\n";
    logs.push(line);
    process.stderr.write(line);
  };
  browser.on("disconnected", () => {
    const hasCrashLine = logs.some((line) => line.includes("process did exit:") && !line.includes("process did exit: exitCode=0, signal=null"));
    if (hasCrashLine) {
      process.stderr.write("Detected browser crash.\n");
      gracefullyProcessExitDoNotHang(1);
    }
  });
  const close3 = async () => {
    await donePromise;
    await closeBrowser();
  };
  if (process.env.PWTEST_CLI_EXIT_AFTER_TIMEOUT) {
    setTimeout(close3, +process.env.PWTEST_CLI_EXIT_AFTER_TIMEOUT);
    return;
  }
  let stdin = "";
  process.stdin.on("data", (data) => {
    stdin += data.toString();
    if (stdin.startsWith("exit")) {
      process.stdin.destroy();
      close3();
    }
  });
}
async function waitForPage(page, captureOptions) {
  if (captureOptions.waitForSelector) {
    console.log(`Waiting for selector ${captureOptions.waitForSelector}...`);
    await page.waitForSelector(captureOptions.waitForSelector);
  }
  if (captureOptions.waitForTimeout) {
    console.log(`Waiting for timeout ${captureOptions.waitForTimeout}...`);
    await page.waitForTimeout(parseInt(captureOptions.waitForTimeout, 10));
  }
}
async function screenshot3(options, captureOptions, url2, path59) {
  const { context: context2 } = await launchContext(options, { headless: true });
  console.log("Navigating to " + url2);
  const page = await openPage(context2, url2);
  await waitForPage(page, captureOptions);
  console.log("Capturing screenshot into " + path59);
  await page.screenshot({ path: path59, fullPage: !!captureOptions.fullPage });
  await page.close();
}
async function pdf2(options, captureOptions, url2, path59) {
  if (options.browser !== "chromium")
    throw new Error("PDF creation is only working with Chromium");
  const { context: context2 } = await launchContext({ ...options, browser: "chromium" }, { headless: true });
  console.log("Navigating to " + url2);
  const page = await openPage(context2, url2);
  await waitForPage(page, captureOptions);
  console.log("Saving as pdf into " + path59);
  await page.pdf({ path: path59, format: captureOptions.paperFormat });
  await page.close();
}
function lookupBrowserType(options) {
  let name = options.browser;
  if (options.device) {
    const device = playwright.devices[options.device];
    name = device.defaultBrowserType;
  }
  let browserType;
  switch (name) {
    case "chromium":
      browserType = playwright.chromium;
      break;
    case "webkit":
      browserType = playwright.webkit;
      break;
    case "firefox":
      browserType = playwright.firefox;
      break;
    case "cr":
      browserType = playwright.chromium;
      break;
    case "wk":
      browserType = playwright.webkit;
      break;
    case "ff":
      browserType = playwright.firefox;
      break;
  }
  if (browserType)
    return browserType;
  program.help();
}
function validateOptions(options) {
  if (options.device && !(options.device in playwright.devices)) {
    const lines = [`Device descriptor not found: '${options.device}', available devices are:`];
    for (const name in playwright.devices)
      lines.push(`  "${name}"`);
    throw new Error(lines.join("\n"));
  }
  if (options.colorScheme && !["light", "dark"].includes(options.colorScheme))
    throw new Error('Invalid color scheme, should be one of "light", "dark"');
}
var import_fs49, import_os20, import_path45, debug11, dotenv, program;
var init_browserActions = __esm({
  "packages/playwright-core/src/cli/browserActions.ts"() {
    "use strict";
    import_fs49 = __toESM(require("fs"));
    import_os20 = __toESM(require("os"));
    import_path45 = __toESM(require("path"));
    init_processLauncher();
    init_manualPromise();
    init_inprocess();
    debug11 = require("./utilsBundle").debug;
    dotenv = require("./utilsBundle").dotenv;
    ({ program } = require("./utilsBundle"));
  }
});

// packages/playwright-core/src/tools/utils/extension.ts
async function isPlaywrightExtensionInstalled(userDataDir) {
  let entries;
  try {
    entries = await import_fs50.default.promises.readdir(userDataDir);
  } catch {
    return false;
  }
  for (const entry of entries) {
    if (entry !== "Default" && !entry.startsWith("Profile "))
      continue;
    if (await isExtensionInstalledInProfile(import_path46.default.join(userDataDir, entry)))
      return true;
  }
  return false;
}
async function isExtensionInstalledInProfile(profileDir2) {
  if (await pathExists(import_path46.default.join(profileDir2, "Extensions", playwrightExtensionId)))
    return true;
  try {
    const prefs = await import_fs50.default.promises.readFile(import_path46.default.join(profileDir2, "Preferences"), "utf-8");
    return prefs.includes(`"${playwrightExtensionId}"`);
  } catch {
    return false;
  }
}
async function pathExists(p) {
  try {
    await import_fs50.default.promises.access(p);
    return true;
  } catch {
    return false;
  }
}
var import_fs50, import_path46, playwrightExtensionId, playwrightExtensionInstallUrl;
var init_extension = __esm({
  "packages/playwright-core/src/tools/utils/extension.ts"() {
    "use strict";
    import_fs50 = __toESM(require("fs"));
    import_path46 = __toESM(require("path"));
    playwrightExtensionId = "mmlmfjhmonkocbjadbfplnigmagldckm";
    playwrightExtensionInstallUrl = `https://chromewebstore.google.com/detail/playwright-extension/${playwrightExtensionId}`;
  }
});

// packages/playwright-core/src/tools/cli-client/channelSessions.ts
function isKnownChannel(name) {
  return channelToUserDataDir.has(name);
}
async function listChannelSessions() {
  if (process.env.PWTEST_CLI_CHANNEL_SCAN_DISABLED_FOR_TEST)
    return [];
  const result2 = [];
  for (const [channel, dirs] of channelToUserDataDir) {
    const userDataDir = dirs[process.platform];
    if (!userDataDir)
      continue;
    if (!await pathExists2(userDataDir))
      continue;
    const [endpoint, extensionInstalled] = await Promise.all([
      readEndpoint(userDataDir),
      isPlaywrightExtensionInstalled(userDataDir)
    ]);
    result2.push({ channel, userDataDir, endpoint, extensionInstalled });
  }
  return result2;
}
async function pathExists2(p) {
  try {
    await import_fs51.default.promises.access(p);
    return true;
  } catch {
    return false;
  }
}
async function readEndpoint(userDataDir) {
  let contents;
  try {
    contents = await import_fs51.default.promises.readFile(import_path47.default.join(userDataDir, "DevToolsActivePort"), "utf-8");
  } catch {
    return void 0;
  }
  const port = parseInt(contents.trim().split("\n")[0], 10);
  if (!Number.isFinite(port))
    return void 0;
  if (!await isPortOpen(port))
    return void 0;
  return `http://localhost:${port}`;
}
async function isPortOpen(port) {
  return new Promise((resolve) => {
    const socket = import_net8.default.createConnection(port, "127.0.0.1");
    const done = (value2) => {
      socket.destroy();
      resolve(value2);
    };
    socket.once("connect", () => done(true));
    socket.once("error", () => done(false));
    socket.setTimeout(250, () => done(false));
  });
}
var import_fs51, import_net8, import_os21, import_path47, channelToUserDataDir;
var init_channelSessions = __esm({
  "packages/playwright-core/src/tools/cli-client/channelSessions.ts"() {
    "use strict";
    import_fs51 = __toESM(require("fs"));
    import_net8 = __toESM(require("net"));
    import_os21 = __toESM(require("os"));
    import_path47 = __toESM(require("path"));
    init_extension();
    channelToUserDataDir = /* @__PURE__ */ new Map([
      ["chrome", {
        "linux": import_path47.default.join(import_os21.default.homedir(), ".config", "google-chrome"),
        "darwin": import_path47.default.join(import_os21.default.homedir(), "Library", "Application Support", "Google", "Chrome"),
        "win32": import_path47.default.join(process.env.LOCALAPPDATA || import_path47.default.join(import_os21.default.homedir(), "AppData", "Local"), "Google", "Chrome", "User Data")
      }],
      ["chrome-beta", {
        "linux": import_path47.default.join(import_os21.default.homedir(), ".config", "google-chrome-beta"),
        "darwin": import_path47.default.join(import_os21.default.homedir(), "Library", "Application Support", "Google", "Chrome Beta"),
        "win32": import_path47.default.join(process.env.LOCALAPPDATA || import_path47.default.join(import_os21.default.homedir(), "AppData", "Local"), "Google", "Chrome Beta", "User Data")
      }],
      ["chrome-dev", {
        "linux": import_path47.default.join(import_os21.default.homedir(), ".config", "google-chrome-unstable"),
        "darwin": import_path47.default.join(import_os21.default.homedir(), "Library", "Application Support", "Google", "Chrome Dev"),
        "win32": import_path47.default.join(process.env.LOCALAPPDATA || import_path47.default.join(import_os21.default.homedir(), "AppData", "Local"), "Google", "Chrome Dev", "User Data")
      }],
      ["chrome-canary", {
        "linux": import_path47.default.join(import_os21.default.homedir(), ".config", "google-chrome-canary"),
        "darwin": import_path47.default.join(import_os21.default.homedir(), "Library", "Application Support", "Google", "Chrome Canary"),
        "win32": import_path47.default.join(process.env.LOCALAPPDATA || import_path47.default.join(import_os21.default.homedir(), "AppData", "Local"), "Google", "Chrome SxS", "User Data")
      }],
      ["msedge", {
        "linux": import_path47.default.join(import_os21.default.homedir(), ".config", "microsoft-edge"),
        "darwin": import_path47.default.join(import_os21.default.homedir(), "Library", "Application Support", "Microsoft Edge"),
        "win32": import_path47.default.join(process.env.LOCALAPPDATA || import_path47.default.join(import_os21.default.homedir(), "AppData", "Local"), "Microsoft", "Edge", "User Data")
      }],
      ["msedge-beta", {
        "linux": import_path47.default.join(import_os21.default.homedir(), ".config", "microsoft-edge-beta"),
        "darwin": import_path47.default.join(import_os21.default.homedir(), "Library", "Application Support", "Microsoft Edge Beta"),
        "win32": import_path47.default.join(process.env.LOCALAPPDATA || import_path47.default.join(import_os21.default.homedir(), "AppData", "Local"), "Microsoft", "Edge Beta", "User Data")
      }],
      ["msedge-dev", {
        "linux": import_path47.default.join(import_os21.default.homedir(), ".config", "microsoft-edge-dev"),
        "darwin": import_path47.default.join(import_os21.default.homedir(), "Library", "Application Support", "Microsoft Edge Dev"),
        "win32": import_path47.default.join(process.env.LOCALAPPDATA || import_path47.default.join(import_os21.default.homedir(), "AppData", "Local"), "Microsoft", "Edge Dev", "User Data")
      }],
      ["msedge-canary", {
        "linux": import_path47.default.join(import_os21.default.homedir(), ".config", "microsoft-edge-canary"),
        "darwin": import_path47.default.join(import_os21.default.homedir(), "Library", "Application Support", "Microsoft Edge Canary"),
        "win32": import_path47.default.join(process.env.LOCALAPPDATA || import_path47.default.join(import_os21.default.homedir(), "AppData", "Local"), "Microsoft", "Edge SxS", "User Data")
      }]
    ]);
  }
});

// packages/playwright-core/src/tools/cli-client/output.ts
function parseJsonText(text2) {
  try {
    return JSON.parse(text2);
  } catch {
    return text2;
  }
}
function renderBrowser(browser) {
  const lines = [`- ${browser.name}:`];
  lines.push(`  - status: ${browser.status}`);
  if (browser.status === "open" && !browser.compatible)
    lines.push(`  - version: v${browser.version} [incompatible please re-open]`);
  if (browser.browserType)
    lines.push(`  - browser-type: ${browser.browserType}${browser.attached ? " (attached)" : ""}`);
  if (!browser.attached) {
    if (browser.userDataDir === null)
      lines.push(`  - user-data-dir: <in-memory>`);
    else
      lines.push(`  - user-data-dir: ${browser.userDataDir}`);
    if (browser.headed !== void 0)
      lines.push(`  - headed: ${browser.headed}`);
  }
  return lines.join("\n");
}
function renderServer(server) {
  const lines = [`- browser "${server.title}":`];
  lines.push(`  - browser: ${server.browser.browserName}`);
  lines.push(`  - version: v${server.playwrightVersion}`);
  if (server.browser.userDataDir)
    lines.push(`  - data-dir: ${server.browser.userDataDir}`);
  else
    lines.push(`  - data-dir: <in-memory>`);
  lines.push(`  - run \`playwright-cli attach "${server.title}"\` to attach`);
  return lines.join("\n");
}
function renderChannelSession(session2) {
  const lines = [`- ${session2.channel}:`];
  lines.push(`  - data-dir: ${session2.userDataDir}`);
  if (session2.extensionInstalled)
    lines.push(`  - attach (extension): \`playwright-cli attach --extension=${session2.channel}\``);
  else
    lines.push(`  - attach (extension): install at ${playwrightExtensionInstallUrl}`);
  if (session2.endpoint) {
    lines.push(`  - attach (remote debugging): \`playwright-cli attach --cdp=${session2.channel}\``);
  } else {
    const inspectScheme = session2.channel.startsWith("msedge") ? "edge" : "chrome";
    lines.push(`  - attach (remote debugging): enable at ${inspectScheme}://inspect/#remote-debugging`);
  }
  return lines.join("\n");
}
var import_path48, TextOutput, JsonOutput;
var init_output = __esm({
  "packages/playwright-core/src/tools/cli-client/output.ts"() {
    "use strict";
    import_path48 = __toESM(require("path"));
    init_extension();
    TextOutput = class {
      constructor() {
        this.json = false;
      }
      version(v) {
        console.log(v);
      }
      help(text2) {
        console.log(text2);
      }
      errorUnknownCommand(name, globalHelp) {
        console.error(`Unknown command: ${name}
`);
        console.log(globalHelp);
        return process.exit(1);
      }
      errorUnknownOption(opts, commandHelp) {
        console.error(`Unknown option${opts.length > 1 ? "s" : ""}: ${opts.map((f) => `--${f}`).join(", ")}`);
        console.log("");
        console.log(commandHelp);
        return process.exit(1);
      }
      errorTooManyArguments(expected, received, commandHelp) {
        console.error(`error: too many arguments: expected ${expected}, received ${received}`);
        console.log("");
        console.log(commandHelp);
        return process.exit(1);
      }
      errorAttachConflict() {
        console.error(`Error: only one of [name], --cdp, --endpoint, or --extension can be specified`);
        return process.exit(1);
      }
      errorDetachNotAttached(session2) {
        console.error(`Error: session '${session2}' was not attached; use \`playwright-cli${session2 !== "default" ? ` -s=${session2}` : ""} close\` to stop it.`);
        return process.exit(1);
      }
      errorBrowserNotOpenForTool(session2) {
        console.log(`The browser '${session2}' is not open, please run open first`);
        console.log("");
        console.log(`  playwright-cli${session2 !== "default" ? ` -s=${session2}` : ""} open [params]`);
        return process.exit(1);
      }
      errorAttachNoTarget() {
        console.error(`Error: no target specified for attach command; use one of [name], --cdp, --endpoint, or --extension to specify the target to attach to.`);
        return process.exit(1);
      }
      list({ all, browsers, servers, channelSessions }) {
        const byWorkspace = /* @__PURE__ */ new Map();
        for (const browser of browsers) {
          let list = byWorkspace.get(browser.workspace);
          if (!list) {
            list = [];
            byWorkspace.set(browser.workspace, list);
          }
          list.push(browser);
        }
        let count = 0;
        for (const [workspaceKey, list] of byWorkspace) {
          if (count === 0)
            console.log("### Browsers");
          if (all)
            console.log(`${import_path48.default.relative(process.cwd(), workspaceKey) || "/"}:`);
          for (const browser of list)
            console.log(renderBrowser(browser));
          count += list.length;
        }
        if (!all) {
          if (!count)
            console.log("  (no browsers)");
          return;
        }
        if (servers?.length) {
          if (count)
            console.log("");
          console.log("### Browser servers available for attach");
          const serversByWorkspace = /* @__PURE__ */ new Map();
          for (const server of servers) {
            let list = serversByWorkspace.get(server.workspaceDir ?? "");
            if (!list) {
              list = [];
              serversByWorkspace.set(server.workspaceDir ?? "", list);
            }
            list.push(server);
          }
          for (const [workspaceKey, list] of serversByWorkspace) {
            if (workspaceKey)
              console.log(`${import_path48.default.relative(process.cwd(), workspaceKey) || "/"}:`);
            for (const server of list)
              console.log(renderServer(server));
          }
          count += servers.length;
        }
        if (!count)
          console.log("  (no browsers)");
        if (channelSessions?.length) {
          console.log("");
          console.log("### Browsers available to attach via CDP");
          for (const session2 of channelSessions)
            console.log(renderChannelSession(session2));
        }
      }
      closeAll(_sessions) {
      }
      deleteData(session2, result2) {
        if (!result2.existed) {
          console.log(`No user data found for browser '${session2}'.`);
          return;
        }
        if (result2.deletedUserDataDir)
          console.log(`Deleted user data for browser '${session2}'.`);
      }
      killAll(pids) {
        for (const pid of pids)
          console.log(`Killed daemon process ${pid}`);
        if (pids.length === 0)
          console.log("No daemon processes found.");
        else
          console.log(`Killed ${pids.length} daemon process${pids.length === 1 ? "" : "es"}.`);
      }
      open(session2, pid, toolResult) {
        console.log(`### Browser \`${session2}\` opened with pid ${pid}.`);
        if (toolResult)
          console.log(toolResult);
      }
      attach(session2, pid, endpoint, toolResult) {
        if (endpoint) {
          console.log(`### Session \`${session2}\` created, attached to \`${endpoint}\`.`);
          console.log(`Run commands with: playwright-cli --s=${session2} <command>`);
          console.log("");
        } else {
          console.log(`### Browser \`${session2}\` opened with pid ${pid}.`);
        }
        if (toolResult)
          console.log(toolResult);
      }
      close(session2, wasOpen) {
        if (!wasOpen) {
          console.log(`Browser '${session2}' is not open.`);
          return;
        }
        console.log(`Browser '${session2}' closed
`);
      }
      detach(session2, wasAttached) {
        if (!wasAttached) {
          console.log(`Browser '${session2}' is not attached.`);
          return;
        }
        console.log(`Browser '${session2}' detached
`);
      }
      installed() {
      }
      show(_session, pid) {
        if (process.env.PWTEST_PRINT_DASHBOARD_PID_FOR_TEST)
          console.log(`### Dashboard opened with pid ${pid}.`);
      }
      toolResult(text2) {
        console.log(text2);
      }
      installStdio() {
        return "inherit";
      }
    };
    JsonOutput = class {
      constructor() {
        this.json = true;
      }
      version(v) {
        this._emit({ version: v });
      }
      help(text2) {
        this._emit({ help: text2 });
      }
      errorUnknownCommand(name, _globalHelp) {
        this._emit({ isError: true, error: `Unknown command: ${name}` });
        return process.exit(1);
      }
      errorUnknownOption(opts, _commandHelp) {
        this._emit({ isError: true, error: `Unknown option${opts.length > 1 ? "s" : ""}: ${opts.map((f) => `--${f}`).join(", ")}` });
        return process.exit(1);
      }
      errorTooManyArguments(expected, received, _commandHelp) {
        this._emit({ isError: true, error: `error: too many arguments: expected ${expected}, received ${received}` });
        return process.exit(1);
      }
      errorAttachConflict() {
        this._emit({ isError: true, error: `only one of [name], --cdp, --endpoint, or --extension can be specified` });
        return process.exit(1);
      }
      errorDetachNotAttached(session2) {
        this._emit({ isError: true, error: `session '${session2}' was not attached; use close to stop it.` });
        return process.exit(1);
      }
      errorBrowserNotOpenForTool(session2) {
        this._emit({ isError: true, error: `The browser '${session2}' is not open, please run open first` });
        return process.exit(1);
      }
      errorAttachNoTarget() {
        this._emit({ isError: true, error: `no target specified for attach command; use one of [name], --cdp, --endpoint, or --extension to specify the target to attach to.` });
        return process.exit(1);
      }
      list({ all, browsers, servers, channelSessions }) {
        const payload = { browsers };
        if (all) {
          payload.servers = servers ?? [];
          payload.channelSessions = channelSessions ?? [];
        }
        this._emit(payload);
      }
      closeAll(sessions) {
        this._emit({ closed: sessions });
      }
      deleteData(session2, result2) {
        this._emit({ session: session2, deleted: result2.existed });
      }
      killAll(pids) {
        this._emit({ killed: pids.length, pids });
      }
      open(session2, pid, toolResult) {
        this._emit({ session: session2, pid, result: parseJsonText(toolResult) });
      }
      attach(session2, pid, endpoint, toolResult) {
        this._emit({
          session: session2,
          pid,
          ...endpoint ? { endpoint } : {},
          result: parseJsonText(toolResult)
        });
      }
      close(session2, wasOpen) {
        this._emit({ session: session2, status: wasOpen ? "closed" : "not-open" });
      }
      detach(session2, wasAttached) {
        this._emit({ session: session2, status: wasAttached ? "detached" : "not-attached" });
      }
      installed() {
        this._emit({ installed: true });
      }
      show(session2, pid) {
        this._emit({ session: session2, pid });
      }
      toolResult(text2) {
        console.log(text2);
      }
      installStdio() {
        return "ignore";
      }
      _emit(value2) {
        console.log(JSON.stringify(value2, null, 2));
      }
    };
  }
});

// packages/playwright-core/src/tools/cli-client/registry.ts
function clientKey(clientInfo) {
  return clientInfo.workspaceDir || clientInfo.workspaceDirHash;
}
function createClientInfo() {
  const workspaceDir = findWorkspaceDir(process.cwd());
  const version3 = process.env.PLAYWRIGHT_CLI_VERSION_FOR_TEST || packageJSON.version;
  const hash = import_crypto26.default.createHash("sha1");
  hash.update(workspaceDir || packageRoot);
  const workspaceDirHash = hash.digest("hex").substring(0, 16);
  return {
    version: version3,
    workspaceDir,
    workspaceDirHash,
    daemonProfilesDir: daemonProfilesDir(workspaceDirHash),
    homeDir: import_os22.default.homedir()
  };
}
function findWorkspaceDir(startDir) {
  let dir = startDir;
  for (let i = 0; i < 10; i++) {
    if (import_fs52.default.existsSync(import_path49.default.join(dir, ".playwright")))
      return dir;
    const parentDir = import_path49.default.dirname(dir);
    if (parentDir === dir)
      break;
    dir = parentDir;
  }
  return void 0;
}
function explicitSessionName(sessionName) {
  return sessionName || process.env.PLAYWRIGHT_CLI_SESSION;
}
function resolveSessionName(sessionName) {
  return explicitSessionName(sessionName) || "default";
}
var import_crypto26, import_fs52, import_os22, import_path49, Registry2, baseDaemonDir, daemonProfilesDir;
var init_registry2 = __esm({
  "packages/playwright-core/src/tools/cli-client/registry.ts"() {
    "use strict";
    import_crypto26 = __toESM(require("crypto"));
    import_fs52 = __toESM(require("fs"));
    import_os22 = __toESM(require("os"));
    import_path49 = __toESM(require("path"));
    init_package();
    Registry2 = class _Registry {
      constructor(files) {
        this._files = files;
      }
      entry(clientInfo, sessionName) {
        const key = clientKey(clientInfo);
        const entries = this._files.get(key) || [];
        return entries.find((entry) => entry.config.name === sessionName);
      }
      entries(clientInfo) {
        return this._files.get(clientKey(clientInfo)) || [];
      }
      entryMap() {
        return this._files;
      }
      async loadEntry(clientInfo, sessionName) {
        const entry = await _Registry._loadSessionEntry(clientInfo.daemonProfilesDir, sessionName + ".session");
        if (!entry)
          throw new Error(`Could not start the session "${sessionName}"`);
        const key = clientKey(clientInfo);
        let list = this._files.get(key);
        if (!list) {
          list = [];
          this._files.set(key, list);
        }
        const oldIndex = list.findIndex((e) => e.config.name === sessionName);
        if (oldIndex !== -1)
          list.splice(oldIndex, 1);
        list.push(entry);
        return entry;
      }
      static async _loadSessionEntry(daemonDir, file) {
        try {
          const fileName = import_path49.default.join(daemonDir, file);
          const data = await import_fs52.default.promises.readFile(fileName, "utf-8");
          const config = JSON.parse(data);
          if (!config.name)
            config.name = import_path49.default.basename(file, ".session");
          if (!config.timestamp)
            config.timestamp = 0;
          return { file: fileName, config, daemonDir };
        } catch {
          return void 0;
        }
      }
      static async load() {
        const sessions = /* @__PURE__ */ new Map();
        const hashDirs = await import_fs52.default.promises.readdir(baseDaemonDir).catch(() => []);
        for (const workspaceDirHash of hashDirs) {
          const daemonDir = import_path49.default.join(baseDaemonDir, workspaceDirHash);
          const stat = await import_fs52.default.promises.stat(daemonDir);
          if (!stat.isDirectory())
            continue;
          const files = await import_fs52.default.promises.readdir(daemonDir).catch(() => []);
          for (const file of files) {
            if (!file.endsWith(".session"))
              continue;
            const entry = await _Registry._loadSessionEntry(daemonDir, file);
            if (!entry)
              continue;
            const key = entry.config.workspaceDir || workspaceDirHash;
            let list = sessions.get(key);
            if (!list) {
              list = [];
              sessions.set(key, list);
            }
            list.push(entry);
          }
        }
        return new _Registry(sessions);
      }
    };
    baseDaemonDir = (() => {
      if (process.env.PWTEST_DAEMON_SESSION_DIR)
        return process.env.PWTEST_DAEMON_SESSION_DIR;
      let localCacheDir;
      if (process.platform === "linux")
        localCacheDir = process.env.XDG_CACHE_HOME || import_path49.default.join(import_os22.default.homedir(), ".cache");
      if (process.platform === "darwin")
        localCacheDir = import_path49.default.join(import_os22.default.homedir(), "Library", "Caches");
      if (process.platform === "win32")
        localCacheDir = process.env.LOCALAPPDATA || import_path49.default.join(import_os22.default.homedir(), "AppData", "Local");
      if (!localCacheDir)
        throw new Error("Unsupported platform: " + process.platform);
      return import_path49.default.join(localCacheDir, "ms-playwright", "daemon");
    })();
    daemonProfilesDir = (workspaceDirHash) => {
      return import_path49.default.join(baseDaemonDir, workspaceDirHash);
    };
  }
});

// packages/playwright-core/src/tools/utils/socketConnection.ts
function compareSemver(a, b) {
  const aBase = a.replace(/-.*$/, "");
  const bBase = b.replace(/-.*$/, "");
  const aParts = aBase.split(".").map(Number);
  const bParts = bBase.split(".").map(Number);
  for (let i = 0; i < 3; i++) {
    if (aParts[i] > bParts[i])
      return 1;
    if (aParts[i] < bParts[i])
      return -1;
  }
  const aTimestamp = parseSuffixTimestamp(a);
  const bTimestamp = parseSuffixTimestamp(b);
  if (aTimestamp > bTimestamp)
    return 1;
  if (aTimestamp < bTimestamp)
    return -1;
  return 0;
}
function parseSuffixTimestamp(version3) {
  const match = version3.match(/^\d+\.\d+\.\d+-(?:alpha|beta)-(.+)$/);
  if (!match)
    return Infinity;
  const suffix = match[1];
  if (/^\d{4}-\d{2}-\d{2}$/.test(suffix))
    return new Date(suffix).getTime();
  return Number(suffix);
}
var SocketConnection;
var init_socketConnection = __esm({
  "packages/playwright-core/src/tools/utils/socketConnection.ts"() {
    "use strict";
    SocketConnection = class {
      constructor(socket) {
        this._pendingBuffers = [];
        this._socket = socket;
        socket.on("data", (buffer) => this._onData(buffer));
        socket.on("close", () => {
          this.onclose?.();
        });
        socket.on("error", (e) => console.error(`error: ${e.message}`));
      }
      async send(message) {
        await new Promise((resolve, reject) => {
          this._socket.write(`${JSON.stringify(message)}
`, (error) => {
            if (error)
              reject(error);
            else
              resolve(void 0);
          });
        });
      }
      close() {
        this._socket.destroy();
      }
      _onData(buffer) {
        let end = buffer.indexOf("\n");
        if (end === -1) {
          this._pendingBuffers.push(buffer);
          return;
        }
        this._pendingBuffers.push(buffer.slice(0, end));
        const message = Buffer.concat(this._pendingBuffers).toString();
        this._dispatchMessage(message);
        let start3 = end + 1;
        end = buffer.indexOf("\n", start3);
        while (end !== -1) {
          const message2 = buffer.toString(void 0, start3, end);
          this._dispatchMessage(message2);
          start3 = end + 1;
          end = buffer.indexOf("\n", start3);
        }
        this._pendingBuffers = [buffer.slice(start3)];
      }
      _dispatchMessage(message) {
        try {
          this.onmessage?.(JSON.parse(message));
        } catch (e) {
          console.error("failed to dispatch message", e);
        }
      }
    };
  }
});

// packages/playwright-core/src/tools/cli-client/session.ts
var import_child_process4, import_fs53, import_net9, import_os23, import_path50, Session2, SocketConnectionClient;
var init_session = __esm({
  "packages/playwright-core/src/tools/cli-client/session.ts"() {
    "use strict";
    import_child_process4 = require("child_process");
    import_fs53 = __toESM(require("fs"));
    import_net9 = __toESM(require("net"));
    import_os23 = __toESM(require("os"));
    import_path50 = __toESM(require("path"));
    init_package();
    init_socketConnection();
    init_registry2();
    Session2 = class {
      constructor(sessionFile) {
        this.config = sessionFile.config;
        this.name = this.config.name;
        this._sessionFile = sessionFile;
      }
      isCompatible(clientInfo) {
        return compareSemver(clientInfo.version, this.config.version) >= 0;
      }
      async run(clientInfo, args, options) {
        if (!this.isCompatible(clientInfo))
          throw new Error(`Client is v${clientInfo.version}, session '${this.name}' is v${this.config.version}. Run

  playwright-cli${this.name !== "default" ? ` -s=${this.name}` : ""} open

to restart the browser session.`);
        const { socket } = await this._connect();
        if (!socket)
          throw new Error(`Browser '${this.name}' is not open. Run

  playwright-cli${this.name !== "default" ? ` -s=${this.name}` : ""} open

to start the browser session.`);
        return await SocketConnectionClient.sendAndClose(socket, "run", { args, cwd: process.cwd(), raw: options?.raw, json: options?.json });
      }
      async stop() {
        if (!await this.canConnect())
          return { wasOpen: false };
        await this._stopDaemon();
        return { wasOpen: true };
      }
      async deleteData() {
        await this.stop();
        const dataDirs = await import_fs53.default.promises.readdir(this._sessionFile.daemonDir).catch(() => []);
        const matchingEntries = dataDirs.filter((file) => file === `${this.name}.session` || file.startsWith(`ud-${this.name}-`));
        if (matchingEntries.length === 0)
          return { existed: false, deletedUserDataDir: false };
        let deletedUserDataDir = false;
        for (const entry of matchingEntries) {
          const userDataDir = import_path50.default.resolve(this._sessionFile.daemonDir, entry);
          for (let i = 0; i < 5; i++) {
            try {
              await import_fs53.default.promises.rm(userDataDir, { recursive: true });
              if (entry.startsWith("ud-"))
                deletedUserDataDir = true;
              break;
            } catch (e) {
              if (e.code === "ENOENT")
                break;
              await new Promise((resolve) => setTimeout(resolve, 1e3));
              if (i === 4)
                throw e;
            }
          }
        }
        return { existed: true, deletedUserDataDir };
      }
      async _connect() {
        return await new Promise((resolve) => {
          const socket = import_net9.default.createConnection(this.config.socketPath, () => {
            resolve({ socket });
          });
          socket.on("error", (error) => {
            if (import_os23.default.platform() !== "win32")
              void import_fs53.default.promises.unlink(this.config.socketPath).catch(() => {
              }).then(() => resolve({ error }));
            else
              resolve({ error });
          });
        });
      }
      async canConnect() {
        const { socket } = await this._connect();
        if (socket) {
          socket.destroy();
          return true;
        }
        return false;
      }
      static async startDaemon(clientInfo, cliArgs, mode) {
        await import_fs53.default.promises.mkdir(clientInfo.daemonProfilesDir, { recursive: true });
        const cliPath = libPath("entry", "cliDaemon.js");
        const sessionName = resolveSessionName(cliArgs.session);
        const errLog = import_path50.default.join(clientInfo.daemonProfilesDir, sessionName + ".err");
        const err = import_fs53.default.openSync(errLog, "w");
        const args = [
          cliPath,
          sessionName
        ];
        if (cliArgs.headed)
          args.push("--headed");
        if (cliArgs.browser)
          args.push(`--browser=${cliArgs.browser}`);
        if (cliArgs.persistent)
          args.push("--persistent");
        if (cliArgs.profile)
          args.push(`--profile=${cliArgs.profile}`);
        if (cliArgs.config)
          args.push(`--config=${cliArgs.config}`);
        if (cliArgs.extension)
          args.push("--extension");
        else if (cliArgs.cdp)
          args.push(`--cdp=${cliArgs.cdp}`);
        else if (cliArgs.endpoint)
          args.push(`--endpoint=${cliArgs.endpoint}`);
        const child = (0, import_child_process4.spawn)(process.execPath, args, {
          detached: true,
          stdio: ["ignore", "pipe", err],
          cwd: process.cwd()
          // Will be used as root.
        });
        let signalled = false;
        const sigintHandler2 = () => {
          signalled = true;
          child.kill("SIGINT");
        };
        const sigtermHandler2 = () => {
          signalled = true;
          child.kill("SIGTERM");
        };
        process.on("SIGINT", sigintHandler2);
        process.on("SIGTERM", sigtermHandler2);
        let outLog = "";
        const rejectWithPid = (reject, message) => reject(Object.assign(new Error(`Daemon pid=${child.pid}: ${message}`), { daemonPid: child.pid }));
        await new Promise((resolve, reject) => {
          child.stdout.on("data", (data) => {
            outLog += data.toString();
            if (outLog.includes("Daemon listening on"))
              resolve();
          });
          child.on("close", (code) => {
            if (!signalled) {
              const errLogContent = import_fs53.default.readFileSync(errLog, "utf-8");
              rejectWithPid(reject, `Daemon process exited with code ${code}` + (outLog ? "\n" + outLog : "") + (errLogContent ? "\n" + errLogContent : ""));
            }
          });
        });
        process.off("SIGINT", sigintHandler2);
        process.off("SIGTERM", sigtermHandler2);
        child.stdout.destroy();
        child.unref();
        return { pid: child.pid, sessionName, endpoint: cliArgs.endpoint };
      }
      async _stopDaemon() {
        const { socket } = await this._connect();
        if (!socket)
          return;
        let error;
        await SocketConnectionClient.sendAndClose(socket, "stop", {}).catch((e) => error = e);
        if (error && !error?.message?.includes("Session closed"))
          throw error;
      }
      async deleteSessionConfig() {
        await import_fs53.default.promises.rm(this._sessionFile.file).catch(() => {
        });
      }
    };
    SocketConnectionClient = class _SocketConnectionClient {
      constructor(socket) {
        this._nextMessageId = 1;
        this._callbacks = /* @__PURE__ */ new Map();
        this._connection = new SocketConnection(socket);
        this._connection.onmessage = (message) => this._onMessage(message);
        this._connection.onclose = () => this._rejectCallbacks();
      }
      async send(method, params2 = {}) {
        const messageId = this._nextMessageId++;
        const message = {
          id: messageId,
          method,
          params: params2
        };
        const responsePromise = new Promise((resolve, reject) => {
          this._callbacks.set(messageId, { resolve, reject, method, params: params2 });
        });
        const [result2] = await Promise.all([responsePromise, this._connection.send(message)]);
        return result2;
      }
      static async sendAndClose(socket, method, params2 = {}) {
        const connection = new _SocketConnectionClient(socket);
        try {
          return await connection.send(method, params2);
        } finally {
          connection.close();
        }
      }
      close() {
        this._connection.close();
      }
      _onMessage(object) {
        if (object.id && this._callbacks.has(object.id)) {
          const callback = this._callbacks.get(object.id);
          this._callbacks.delete(object.id);
          if (object.error)
            callback.reject(new Error(object.error));
          else
            callback.resolve(object.result);
        } else if (object.id) {
          throw new Error(`Unexpected message id: ${object.id}`);
        } else {
          throw new Error(`Unexpected message without id: ${JSON.stringify(object)}`);
        }
      }
      _rejectCallbacks() {
        for (const callback of this._callbacks.values())
          callback.reject(new Error("Session closed"));
        this._callbacks.clear();
      }
    };
  }
});

// packages/playwright-core/src/tools/cli-client/program.ts
async function program2(options) {
  const clientInfo = createClientInfo();
  const help = require(libPath("tools", "cli-client", "help.json"));
  const argv = process.argv.slice(2);
  const boolean = [...help.booleanOptions, ...booleanOptions];
  const args = minimist(argv, { boolean, string: ["_"] });
  if (args.s) {
    args.session = args.s;
    delete args.s;
  }
  const output = args.json ? new JsonOutput() : new TextOutput();
  const commandName = args._?.[0];
  if (args.version || args.v) {
    output.version(options?.embedderVersion ?? clientInfo.version);
    process.exit(0);
  }
  const command = commandName && help.commands[commandName];
  if (args.help || args.h || !commandName) {
    if (command) {
      output.help(command.help);
    } else {
      const lines = ["playwright-cli - run playwright mcp commands from terminal"];
      if (process.env.CLAUDECODE || process.env.COPILOT_CLI)
        lines.push(`Agent skill: ${import_path51.default.relative(process.cwd(), libPath("tools", "cli-client", "skill", "SKILL.md"))}`);
      lines.push(help.global);
      output.help(lines.join("\n\n"));
    }
    process.exit(0);
  }
  if (!command)
    output.errorUnknownCommand(commandName, help.global);
  validateFlags(args, command, output);
  validateArgs(args, command, output);
  const registry2 = await Registry2.load();
  const sessionName = resolveSessionName(args.session);
  switch (commandName) {
    case "list": {
      const data = await collectList(registry2, clientInfo, !!args.all);
      output.list(data);
      return;
    }
    case "close-all": {
      const entries = registry2.entries(clientInfo);
      const closed = [];
      for (const entry of entries) {
        await new Session2(entry).stop();
        closed.push(entry.config.name);
      }
      output.closeAll(closed);
      return;
    }
    case "delete-data": {
      const entry = registry2.entry(clientInfo, sessionName);
      if (!entry) {
        output.deleteData(sessionName, { existed: false, deletedUserDataDir: false });
        return;
      }
      const result2 = await new Session2(entry).deleteData();
      output.deleteData(sessionName, result2);
      return;
    }
    case "kill-all": {
      const pids = await killAllDaemons();
      output.killAll(pids);
      return;
    }
    case "open": {
      const { pid } = await startSession(sessionName, registry2, clientInfo, args, "open");
      const newEntry = await registry2.loadEntry(clientInfo, sessionName);
      const params2 = args._.slice(1);
      const toolText = await runInSessionOrStop(newEntry, clientInfo, { _: ["goto", ...params2.length ? params2 : ["about:blank"]] }, output);
      output.open(sessionName, pid, toolText);
      return;
    }
    case "attach": {
      const attachTarget = args._[1];
      const targetCount = (attachTarget ? 1 : 0) + (args.cdp ? 1 : 0) + (args.endpoint ? 1 : 0) + (args.extension ? 1 : 0);
      if (targetCount > 1)
        output.errorAttachConflict();
      if (attachTarget)
        args.endpoint = attachTarget;
      const extensionChannel = typeof args.extension === "string" ? args.extension : void 0;
      if (extensionChannel) {
        args.browser = extensionChannel;
        args.extension = true;
      }
      const cdpChannel = typeof args.cdp === "string" && isKnownChannel(args.cdp) ? args.cdp : void 0;
      const targetName = attachTarget ?? cdpChannel ?? extensionChannel ?? args.endpoint ?? args.cdp;
      if (!targetName)
        output.errorAttachNoTarget();
      const attachSessionName = explicitSessionName(args.session) ?? attachTarget ?? cdpChannel ?? extensionChannel ?? sessionName;
      args.session = attachSessionName;
      const { pid } = await startSession(attachSessionName, registry2, clientInfo, args, "attach");
      const newEntry = await registry2.loadEntry(clientInfo, attachSessionName);
      const toolText = await runInSessionOrStop(newEntry, clientInfo, { _: ["snapshot"], filename: "<auto>" }, output);
      output.attach(attachSessionName, pid, targetName, toolText);
      return;
    }
    case "close": {
      const closeEntry = registry2.entry(clientInfo, sessionName);
      const { wasOpen } = closeEntry ? await new Session2(closeEntry).stop() : { wasOpen: false };
      output.close(sessionName, wasOpen);
      return;
    }
    case "detach": {
      const detachEntry = registry2.entry(clientInfo, sessionName);
      if (detachEntry && !detachEntry.config.attached)
        output.errorDetachNotAttached(sessionName);
      const { wasOpen } = detachEntry ? await new Session2(detachEntry).stop() : { wasOpen: false };
      output.detach(sessionName, wasOpen);
      return;
    }
    case "install":
      await runInitWorkspace(args, output);
      output.installed();
      return;
    case "install-browser":
      await installBrowser2();
      output.installed();
      return;
    case "show": {
      const daemonScript = libPath("entry", "dashboardApp.js");
      const daemonArgs = [
        daemonScript,
        `--workspaceDir=${clientInfo.workspaceDir ?? ""}`
      ];
      const explicit = explicitSessionName(args.session);
      if (explicit)
        daemonArgs.push(`--sessionName=${explicit}`);
      if (args.port !== void 0)
        daemonArgs.push(`--port=${args.port}`);
      if (args.host !== void 0)
        daemonArgs.push(`--host=${args.host}`);
      if (args.kill) {
        daemonArgs.push(`--kill`);
        const child2 = (0, import_child_process5.spawn)(process.execPath, daemonArgs, { stdio: "ignore" });
        await new Promise((resolve) => child2.on("exit", () => resolve()));
        return;
      }
      if (args.annotate) {
        const entry = registry2.entry(clientInfo, sessionName);
        if (!entry)
          output.errorBrowserNotOpenForTool(sessionName);
        args.raw = true;
        const text2 = await runInSession(entry, clientInfo, args, output);
        output.toolResult(text2);
        return;
      }
      const foreground = args.port !== void 0;
      const child = (0, import_child_process5.spawn)(process.execPath, daemonArgs, {
        detached: !foreground,
        stdio: foreground ? "inherit" : ["pipe", "pipe", "ignore"]
      });
      if (foreground) {
        await new Promise((resolve) => child.on("exit", () => resolve()));
        return;
      }
      const timer = setTimeout(() => child.stdin.destroy(), 6e4);
      child.unref();
      let daemonPid;
      try {
        await new Promise((resolve, reject) => {
          let outLog = "";
          child.stdout.on("data", (data) => {
            outLog += data.toString();
            const match = outLog.match(/Dashboard is running pid=(\d+)/);
            if (match) {
              daemonPid = Number(match[1]);
              resolve();
            }
          });
          child.once("exit", (code, signal) => reject(new Error(`Dashboard daemon exited (code=${code}, signal=${signal}) before signaling READY${outLog ? "\n" + outLog : ""}`)));
        });
      } finally {
        clearTimeout(timer);
        child.removeAllListeners("exit");
        child.stdin.destroy();
        child.stdout.destroy();
      }
      output.show(sessionName, daemonPid);
      return;
    }
    default: {
      const entry = registry2.entry(clientInfo, sessionName);
      if (!entry)
        output.errorBrowserNotOpenForTool(sessionName);
      if (command.raw)
        args.raw = true;
      const text2 = await runInSession(entry, clientInfo, args, output);
      output.toolResult(text2);
    }
  }
}
async function startSession(sessionName, registry2, clientInfo, args, mode) {
  const entry = registry2.entry(clientInfo, sessionName);
  if (entry)
    await new Session2(entry).stop();
  return await Session2.startDaemon(clientInfo, args, mode);
}
async function runInSession(entry, clientInfo, args, output) {
  const raw = !!args.raw;
  for (const globalOption of globalOptions)
    delete args[globalOption];
  const session2 = new Session2(entry);
  const result2 = await session2.run(clientInfo, args, { raw, json: output.json });
  return result2.text;
}
async function runInSessionOrStop(entry, clientInfo, args, output) {
  try {
    return await runInSession(entry, clientInfo, args, output);
  } catch (e) {
    await new Session2(entry).stop().catch(() => {
    });
    throw e;
  }
}
async function runInitWorkspace(args, output) {
  const cliPath = libPath("entry", "cliDaemon.js");
  const daemonArgs = [cliPath, "--init-workspace", ...args.skills ? ["--init-skills", String(args.skills)] : []];
  await new Promise((resolve, reject) => {
    const child = (0, import_child_process5.spawn)(process.execPath, daemonArgs, {
      stdio: output.installStdio(),
      cwd: process.cwd()
    });
    child.on("close", (code) => {
      if (code === 0)
        resolve();
      else
        reject(new Error(`Workspace initialization failed with exit code ${code}`));
    });
  });
}
async function installBrowser2() {
  const argv = process.argv.map((arg) => arg === "install-browser" ? "install" : arg);
  const { libCli } = (init_coreBundle(), __toCommonJS(coreBundle_exports));
  const { program: program4 } = require("./utilsBundle");
  if (!program4.version())
    libCli.decorateProgram(program4);
  program4.parse(argv);
}
async function killAllDaemons() {
  const platform = import_os24.default.platform();
  const pidFilterEnv = process.env.PWTEST_KILL_ALL_PID_FILTER_FOR_TEST;
  const pidFilter = pidFilterEnv ? new Set(pidFilterEnv.split(",").map((p) => parseInt(p, 10)).filter((n) => !isNaN(n))) : void 0;
  const killed = [];
  try {
    if (platform === "win32") {
      const clauses = [`(${daemonProcessPatterns.map((p) => `$_.CommandLine -like '*${p}*'`).join(" -or ")})`];
      if (pidFilter)
        clauses.push(`(${[...pidFilter].map((p) => `$_.ProcessId -eq ${p}`).join(" -or ")})`);
      const whereClause = clauses.join(" -and ");
      const result2 = (0, import_child_process5.execSync)(
        `powershell -NoProfile -NonInteractive -Command "Get-CimInstance Win32_Process | Where-Object { ${whereClause} } | ForEach-Object { Stop-Process -Id $_.ProcessId -Force -ErrorAction SilentlyContinue; $_.ProcessId }"`,
        { encoding: "utf-8" }
      );
      const pids = result2.split("\n").map((line) => line.trim()).filter((line) => /^\d+$/.test(line));
      for (const pid of pids)
        killed.push(parseInt(pid, 10));
    } else {
      const result2 = (0, import_child_process5.execSync)("ps auxww", { encoding: "utf-8" });
      const lines = result2.split("\n");
      for (const line of lines) {
        if (daemonProcessPatterns.some((p) => line.includes(p))) {
          const parts = line.trim().split(/\s+/);
          const pid = parts[1];
          if (pid && /^\d+$/.test(pid)) {
            const numericPid = parseInt(pid, 10);
            if (pidFilter && !pidFilter.has(numericPid))
              continue;
            try {
              process.kill(numericPid, "SIGKILL");
              killed.push(numericPid);
            } catch {
            }
          }
        }
      }
    }
  } catch (e) {
  }
  return killed;
}
async function collectList(registry2, clientInfo, all) {
  const browsers = [];
  const entries = registry2.entryMap();
  const serverEntries = await serverRegistry.list();
  const key = clientKey(clientInfo);
  for (const [workspaceKey, list] of entries) {
    if (!all && workspaceKey !== key)
      continue;
    for (const entry of list) {
      const session2 = new Session2(entry);
      const canConnect = await session2.canConnect();
      if (!canConnect) {
        await session2.deleteSessionConfig();
        continue;
      }
      const config = session2.config;
      const channel = config.browser?.launchOptions.channel ?? config.browser?.browserName;
      browsers.push({
        name: session2.name,
        workspace: workspaceKey,
        status: canConnect ? "open" : "closed",
        browserType: channel,
        userDataDir: config.browser?.userDataDir ?? null,
        headed: config.browser ? !config.browser.launchOptions.headless : void 0,
        persistent: !!config.cli.persistent,
        attached: !!config.attached,
        compatible: session2.isCompatible(clientInfo),
        version: config.version
      });
    }
  }
  if (!all)
    return { all, browsers };
  const servers = [...serverEntries.values()].flat();
  return { all, browsers, servers, channelSessions: await listChannelSessions() };
}
function validateFlags(args, command, output) {
  const unknownFlags = [];
  for (const key of Object.keys(args)) {
    if (key === "_")
      continue;
    if (globalOptions.includes(key))
      continue;
    if (!(key in command.flags))
      unknownFlags.push(key);
  }
  if (unknownFlags.length)
    output.errorUnknownOption(unknownFlags, command.help);
}
function validateArgs(args, command, output) {
  const positional = args._.slice(1);
  if (positional.length > command.args.length)
    output.errorTooManyArguments(command.args.length, positional.length, command.help);
}
var import_child_process5, import_os24, import_path51, globalOptions, booleanOptions, daemonProcessPatterns;
var init_program = __esm({
  "packages/playwright-core/src/tools/cli-client/program.ts"() {
    "use strict";
    import_child_process5 = require("child_process");
    import_os24 = __toESM(require("os"));
    import_path51 = __toESM(require("path"));
    init_channelSessions();
    init_output();
    init_registry2();
    init_session();
    init_package();
    init_serverRegistry();
    init_minimist();
    globalOptions = [
      "json",
      "raw",
      "session"
    ];
    booleanOptions = [
      "all",
      "help",
      "json",
      "raw",
      "version"
    ];
    daemonProcessPatterns = ["run-mcp-server", "run-cli-server", "cli-daemon", "cliDaemon.js", "dashboardApp.js"];
  }
});

// packages/playwright-core/src/cli/program.ts
var program_exports = {};
__export(program_exports, {
  decorateProgram: () => decorateProgram
});
function decorateProgram(program4) {
  program4.version("Version " + (process.env.PW_CLI_DISPLAY_VERSION || packageJSON.version)).name(buildBasePlaywrightCLICommand(process.env.PW_LANG_NAME));
  program4.command("mark-docker-image [dockerImageNameTemplate]", { hidden: true }).description("mark docker image").allowUnknownOption(true).action(async function(dockerImageNameTemplate) {
    markDockerImage(dockerImageNameTemplate).catch(logErrorAndExit);
  });
  commandWithOpenOptions("open [url]", "open page in browser specified via -b, --browser", []).action(async function(url2, options) {
    open4(options, url2).catch(logErrorAndExit);
  }).addHelpText("afterAll", `
  Examples:

    $ open
    $ open -b webkit https://example.com`);
  commandWithOpenOptions(
    "codegen [url]",
    "open page and generate code for user actions",
    [
      ["-o, --output <file name>", "saves the generated script to a file"],
      ["--target <language>", `language to generate, one of javascript, playwright-test, python, python-async, python-pytest, csharp, csharp-mstest, csharp-nunit, csharp-xunit, java, java-junit`, codegenId()],
      ["--test-id-attribute <attributeName>", "use the specified attribute to generate data test ID selectors"]
    ]
  ).action(async function(url2, options) {
    await codegen(options, url2);
  }).addHelpText("afterAll", `
  Examples:

    $ codegen
    $ codegen --target=python
    $ codegen -b webkit https://example.com`);
  program4.command("install [browser...]").description("ensure browsers necessary for this version of Playwright are installed").option("--with-deps", "install system dependencies for browsers").option("--dry-run", "do not execute installation, only print information").option("--list", "prints list of browsers from all playwright installations").option("--force", "force reinstall of already installed browsers").option("--only-shell", "only install headless shell when installing chromium").option("--no-shell", "do not install chromium headless shell").option("--no-progress", "do not show download progress bars").action(async function(args, options) {
    try {
      await installBrowsers(args, options);
    } catch (e) {
      console.log(`Failed to install browsers
${e}`);
      gracefullyProcessExitDoNotHang(1);
    }
  }).addHelpText("afterAll", `

  Examples:
    - $ install
      Install default browsers.

    - $ install chrome firefox
      Install custom browsers, supports chromium, firefox, webkit, chromium-headless-shell.`);
  program4.command("uninstall").description("Removes browsers used by this installation of Playwright from the system (chromium, firefox, webkit, ffmpeg). This does not include branded channels.").option("--all", "Removes all browsers used by any Playwright installation from the system.").action(async (options) => {
    uninstallBrowsers(options).catch(logErrorAndExit);
  });
  program4.command("install-deps [browser...]").description("install dependencies necessary to run browsers (will ask for sudo permissions)").option("--dry-run", "Do not modify the system. On Linux, simulate the install via apt-get and exit with a non-zero code if any required packages are missing; on Windows, print the install command.").action(async function(args, options) {
    try {
      await installDeps(args, options);
    } catch (e) {
      console.log(`Failed to install browser dependencies
${e}`);
      gracefullyProcessExitDoNotHang(1);
    }
  }).addHelpText("afterAll", `
  Examples:
    - $ install-deps
      Install dependencies for default browsers.

    - $ install-deps chrome firefox
      Install dependencies for specific browsers, supports chromium, firefox, webkit, chromium-headless-shell.

    - $ install-deps --dry-run
      Report which required system dependencies are missing without modifying the system. Exits non-zero if any are missing. Useful for non-interactive verification scripts.`);
  const browsers = [
    { alias: "cr", name: "Chromium", type: "chromium" },
    { alias: "ff", name: "Firefox", type: "firefox" },
    { alias: "wk", name: "WebKit", type: "webkit" }
  ];
  for (const { alias, name, type: type3 } of browsers) {
    commandWithOpenOptions(`${alias} [url]`, `open page in ${name}`, []).action(async function(url2, options) {
      open4({ ...options, browser: type3 }, url2).catch(logErrorAndExit);
    }).addHelpText("afterAll", `
  Examples:

    $ ${alias} https://example.com`);
  }
  commandWithOpenOptions(
    "screenshot <url> <filename>",
    "capture a page screenshot",
    [
      ["--wait-for-selector <selector>", "wait for selector before taking a screenshot"],
      ["--wait-for-timeout <timeout>", "wait for timeout in milliseconds before taking a screenshot"],
      ["--full-page", "whether to take a full page screenshot (entire scrollable area)"]
    ]
  ).action(async function(url2, filename, command) {
    screenshot3(command, command, url2, filename).catch(logErrorAndExit);
  }).addHelpText("afterAll", `
  Examples:

    $ screenshot -b webkit https://example.com example.png`);
  commandWithOpenOptions(
    "pdf <url> <filename>",
    "save page as pdf",
    [
      ["--paper-format <format>", "paper format: Letter, Legal, Tabloid, Ledger, A0, A1, A2, A3, A4, A5, A6"],
      ["--wait-for-selector <selector>", "wait for given selector before saving as pdf"],
      ["--wait-for-timeout <timeout>", "wait for given timeout in milliseconds before saving as pdf"]
    ]
  ).action(async function(url2, filename, options) {
    pdf2(options, options, url2, filename).catch(logErrorAndExit);
  }).addHelpText("afterAll", `
  Examples:

    $ pdf https://example.com example.pdf`);
  program4.command("run-driver", { hidden: true }).action(async function(options) {
    runDriver();
  });
  program4.command("run-server", { hidden: true }).option("--port <port>", "Server port").option("--host <host>", "Server host").option("--path <path>", "Endpoint Path", "/").option("--max-clients <maxClients>", "Maximum clients").option("--mode <mode>", 'Server mode, either "default" or "extension"').option("--artifacts-dir <artifactsDir>", "Artifacts directory").option("--unsafe", "Allow clients to set unsafe launch options (args, executablePath, ignoreAllDefaultArgs, etc)").action(async function(options) {
    runServer({
      port: options.port ? +options.port : void 0,
      host: options.host,
      path: options.path,
      maxConnections: options.maxClients ? +options.maxClients : Infinity,
      extension: options.mode === "extension" || !!process.env.PW_EXTENSION_MODE,
      artifactsDir: options.artifactsDir,
      unsafe: !!options.unsafe
    }).catch(logErrorAndExit);
  });
  program4.command("print-api-json", { hidden: true }).action(async function(options) {
    printApiJson();
  });
  program4.command("launch-server", { hidden: true }).requiredOption("--browser <browserName>", 'Browser name, one of "chromium", "firefox" or "webkit"').option("--config <path-to-config-file>", "JSON file with launchServer options").action(async function(options) {
    launchBrowserServer(options.browser, options.config);
  });
  program4.command("show-trace [trace]").option("-b, --browser <browserType>", "browser to use, one of cr, chromium, ff, firefox, wk, webkit", "chromium").option("-h, --host <host>", "Host to serve trace on; specifying this option opens trace in a browser tab").option("-p, --port <port>", "Port to serve trace on, 0 for any free port; specifying this option opens trace in a browser tab").option("--stdin", "Accept trace URLs over stdin to update the viewer").description("show trace viewer").action(async function(trace, options) {
    if (options.browser === "cr")
      options.browser = "chromium";
    if (options.browser === "ff")
      options.browser = "firefox";
    if (options.browser === "wk")
      options.browser = "webkit";
    const openOptions = {
      host: options.host,
      port: +options.port,
      isServer: !!options.stdin
    };
    if (options.port !== void 0 || options.host !== void 0)
      runTraceInBrowser(trace, openOptions).catch(logErrorAndExit);
    else
      runTraceViewerApp(trace, options.browser, openOptions).catch(logErrorAndExit);
  }).addHelpText("afterAll", `
  Examples:

    $ show-trace
    $ show-trace https://example.com/trace.zip`);
  addTraceCommands(program4, logErrorAndExit);
  program4.command("cli", { hidden: true }).allowExcessArguments(true).allowUnknownOption(true).helpOption(false).action(async (options) => {
    process.argv.splice(process.argv.indexOf("cli"), 1);
    program2().catch(logErrorAndExit);
  });
}
function logErrorAndExit(e) {
  if (process.env.PWDEBUGIMPL)
    console.error(e);
  else
    console.error(e.name + ": " + e.message);
  gracefullyProcessExitDoNotHang(1);
}
function codegenId() {
  return process.env.PW_LANG_NAME || "playwright-test";
}
function commandWithOpenOptions(command, description, options) {
  let result2 = program3.command(command).description(description);
  for (const option of options)
    result2 = result2.option(option[0], ...option.slice(1));
  return result2.option("-b, --browser <browserType>", "browser to use, one of cr, chromium, ff, firefox, wk, webkit", "chromium").option("--block-service-workers", "block service workers").option("--channel <channel>", 'Chromium distribution channel, "chrome", "chrome-beta", "msedge-dev", etc').option("--color-scheme <scheme>", 'emulate preferred color scheme, "light" or "dark"').option("--device <deviceName>", 'emulate device, for example  "iPhone 11"').option("--geolocation <coordinates>", 'specify geolocation coordinates, for example "37.819722,-122.478611"').option("--ignore-https-errors", "ignore https errors").option("--load-storage <filename>", "load context storage state from the file, previously saved with --save-storage").option("--lang <language>", 'specify language / locale, for example "en-GB"').option("--proxy-server <proxy>", 'specify proxy server, for example "http://myproxy:3128" or "socks5://myproxy:8080"').option("--proxy-bypass <bypass>", 'comma-separated domains to bypass proxy, for example ".com,chromium.org,.domain.com"').option("--save-har <filename>", "save HAR file with all network activity at the end").option("--save-har-glob <glob pattern>", "filter entries in the HAR by matching url against this glob pattern").option("--save-storage <filename>", "save context storage state at the end, for later use with --load-storage").option("--timezone <time zone>", 'time zone to emulate, for example "Europe/Rome"').option("--timeout <timeout>", "timeout for Playwright actions in milliseconds, no timeout by default").option("--user-agent <ua string>", "specify user agent string").option("--user-data-dir <directory>", "use the specified user data directory instead of a new context").option("--viewport-size <size>", 'specify browser viewport size in pixels, for example "1280, 720"');
}
function buildBasePlaywrightCLICommand(cliTargetLang) {
  switch (cliTargetLang) {
    case "python":
      return `playwright`;
    case "java":
      return `mvn exec:java -e -D exec.mainClass=com.microsoft.playwright.CLI -D exec.args="...options.."`;
    case "csharp":
      return `pwsh bin/Debug/netX/playwright.ps1`;
    default: {
      const packageManagerCommand = getPackageManagerExecCommand();
      return `${packageManagerCommand} playwright`;
    }
  }
}
var program3;
var init_program2 = __esm({
  "packages/playwright-core/src/cli/program.ts"() {
    "use strict";
    init_bootstrap();
    init_processLauncher();
    init_env();
    init_package();
    init_traceCli();
    init_driver();
    init_installActions();
    init_browserActions();
    init_installActions();
    init_traceViewer();
    init_browserActions();
    init_program();
    ({ program: program3 } = require("./utilsBundle"));
  }
});

// packages/playwright-core/src/cli/programWithTestStub.ts
var programWithTestStub_exports = {};
__export(programWithTestStub_exports, {
  decorateProgram: () => decorateProgram2
});
function printPlaywrightTestError(command) {
  const packages = [];
  for (const pkg of ["playwright", "playwright-chromium", "playwright-firefox", "playwright-webkit"]) {
    try {
      require.resolve(pkg);
      packages.push(pkg);
    } catch (e) {
    }
  }
  if (!packages.length)
    packages.push("playwright");
  const packageManager = getPackageManager();
  if (packageManager === "yarn") {
    console.error(`Please install @playwright/test package before running "yarn playwright ${command}"`);
    console.error(`  yarn remove ${packages.join(" ")}`);
    console.error("  yarn add -D @playwright/test");
  } else if (packageManager === "pnpm") {
    console.error(`Please install @playwright/test package before running "pnpm exec playwright ${command}"`);
    console.error(`  pnpm remove ${packages.join(" ")}`);
    console.error("  pnpm add -D @playwright/test");
  } else {
    console.error(`Please install @playwright/test package before running "npx playwright ${command}"`);
    console.error(`  npm uninstall ${packages.join(" ")}`);
    console.error("  npm install -D @playwright/test");
  }
}
function addExternalPlaywrightTestCommands(program4) {
  for (const [command, description] of kExternalPlaywrightTestCommands) {
    const playwrightTest = program4.command(command).allowUnknownOption(true).allowExcessArguments(true);
    playwrightTest.description(`${description} Available in @playwright/test package.`);
    playwrightTest.action(async () => {
      printPlaywrightTestError(command);
      gracefullyProcessExitDoNotHang(1);
    });
  }
}
function decorateProgram2(program4) {
  if (!process.env.PW_LANG_NAME)
    addExternalPlaywrightTestCommands(program4);
}
var kExternalPlaywrightTestCommands;
var init_programWithTestStub = __esm({
  "packages/playwright-core/src/cli/programWithTestStub.ts"() {
    "use strict";
    init_processLauncher();
    init_env();
    kExternalPlaywrightTestCommands = [
      ["test", "Run tests with Playwright Test."],
      ["show-report", "Show Playwright Test HTML report."],
      ["merge-reports", "Merge Playwright Test Blob reports"]
    ];
  }
});

// packages/playwright-core/src/outofprocess.ts
var outofprocess_exports = {};
__export(outofprocess_exports, {
  start: () => start
});
async function start(env = {}) {
  const client = new PlaywrightClient(env);
  const playwright2 = await client._playwright;
  playwright2.driverProcess = client._driverProcess;
  return { playwright: playwright2, stop: () => client.stop() };
}
var childProcess4, import_path52, PlaywrightClient;
var init_outofprocess = __esm({
  "packages/playwright-core/src/outofprocess.ts"() {
    "use strict";
    childProcess4 = __toESM(require("child_process"));
    import_path52 = __toESM(require("path"));
    init_pipeTransport();
    init_nodePlatform();
    init_manualPromise();
    init_connection();
    init_package();
    PlaywrightClient = class {
      constructor(env) {
        this._closePromise = new ManualPromise();
        this._driverProcess = childProcess4.fork(import_path52.default.join(packageRoot, "cli.js"), ["run-driver"], {
          stdio: "pipe",
          detached: true,
          env: {
            ...process.env,
            ...env
          }
        });
        this._driverProcess.unref();
        this._driverProcess.stderr.on("data", (data) => process.stderr.write(data));
        const connection = new Connection(nodePlatform(packageRoot));
        const transport = new PipeTransport(this._driverProcess.stdin, this._driverProcess.stdout);
        connection.onmessage = (message) => transport.send(JSON.stringify(message));
        transport.onmessage = (message) => connection.dispatch(JSON.parse(message));
        transport.onclose = () => this._closePromise.resolve();
        this._playwright = connection.initializePlaywright();
      }
      async stop() {
        this._driverProcess.stdin.destroy();
        this._driverProcess.stdout.destroy();
        this._driverProcess.stderr.destroy();
        await this._closePromise;
      }
    };
  }
});

// packages/playwright-core/src/tools/mcp/log.ts
function logUnhandledError(error) {
  errorDebug(error);
}
var debug12, errorDebug, testDebug2;
var init_log = __esm({
  "packages/playwright-core/src/tools/mcp/log.ts"() {
    "use strict";
    debug12 = require("./utilsBundle").debug;
    errorDebug = debug12("pw:mcp:error");
    testDebug2 = debug12("pw:mcp:test");
  }
});

// packages/playwright-core/src/tools/mcp/watchdog.ts
function setupExitWatchdog() {
  let isExiting = false;
  const handleExit = async (signal) => {
    if (isExiting)
      return;
    isExiting = true;
    setTimeout(() => process.exit(0), 15e3);
    testDebug2("gracefully closing " + gracefullyCloseSet.size);
    await gracefullyCloseAll();
    process.exit(0);
  };
  process.stdin.on("close", () => handleExit("close"));
  process.on("SIGINT", () => handleExit("SIGINT"));
  process.on("SIGTERM", () => handleExit("SIGTERM"));
}
var init_watchdog = __esm({
  "packages/playwright-core/src/tools/mcp/watchdog.ts"() {
    "use strict";
    init_processLauncher();
    init_log();
  }
});

// packages/playwright-core/src/tools/utils/mcp/http.ts
async function startMcpHttpServer(config, serverBackendFactory, allowedHosts) {
  const httpServer = createHttpServer();
  await startHttpServer(httpServer, config);
  return await installHttpTransport(httpServer, serverBackendFactory, allowedHosts);
}
function addressToString(address, options) {
  (0, import_assert54.default)(address, "Could not bind server socket");
  if (typeof address === "string")
    throw new Error("Unexpected address type: " + address);
  let host = urlHostFromAddress(address);
  if (options.normalizeLoopback && (host === "0.0.0.0" || host === "[::]" || host === "[::1]" || host === "127.0.0.1"))
    host = "localhost";
  return `${options.protocol}://${host}:${address.port}`;
}
async function installHttpTransport(httpServer, serverBackendFactory, allowedHosts) {
  const url2 = addressToString(httpServer.address(), { protocol: "http", normalizeLoopback: true });
  const host = new URL(url2).host;
  allowedHosts = (allowedHosts || [host]).map((h) => h.toLowerCase());
  const allowAnyHost = allowedHosts.includes("*");
  const sseSessions = /* @__PURE__ */ new Map();
  const streamableSessions = /* @__PURE__ */ new Map();
  httpServer.on("request", async (req, res) => {
    if (!allowAnyHost) {
      const host2 = req.headers.host?.toLowerCase();
      if (!host2) {
        res.statusCode = 400;
        return res.end("Missing host");
      }
      if (!allowedHosts.includes(host2)) {
        res.statusCode = 403;
        return res.end("Access is only allowed at " + allowedHosts.join(", "));
      }
    }
    const url3 = new URL(`http://localhost${req.url}`);
    if (url3.pathname === "/killkillkill") {
      if (req.method !== "POST" || req.headers["x-pw-mcp-kill"] !== "1") {
        res.statusCode = 405;
        return res.end();
      }
      res.statusCode = 200;
      res.end("Killing process");
      process.emit("SIGINT");
      return;
    }
    if (url3.pathname.startsWith("/sse"))
      await handleSSE(serverBackendFactory, req, res, url3, sseSessions);
    else
      await handleStreamable(serverBackendFactory, req, res, streamableSessions);
  });
  return url2;
}
async function handleSSE(serverBackendFactory, req, res, url2, sessions) {
  if (req.method === "POST") {
    const sessionId = url2.searchParams.get("sessionId");
    if (!sessionId) {
      res.statusCode = 400;
      return res.end("Missing sessionId");
    }
    const transport = sessions.get(sessionId);
    if (!transport) {
      res.statusCode = 404;
      return res.end("Session not found");
    }
    return await transport.handlePostMessage(req, res);
  } else if (req.method === "GET") {
    const transport = new SSEServerTransport("/sse", res);
    sessions.set(transport.sessionId, transport);
    testDebug3(`create SSE session`);
    await connect(serverBackendFactory, transport, false);
    res.on("close", () => {
      testDebug3(`delete SSE session`);
      sessions.delete(transport.sessionId);
    });
    return;
  }
  res.statusCode = 405;
  res.end("Method not allowed");
}
async function handleStreamable(serverBackendFactory, req, res, sessions) {
  const sessionId = req.headers["mcp-session-id"];
  if (sessionId) {
    const transport = sessions.get(sessionId);
    if (!transport) {
      res.statusCode = 404;
      res.end("Session not found");
      return;
    }
    return await transport.handleRequest(req, res);
  }
  if (req.method === "POST") {
    const transport = new StreamableHTTPServerTransport({
      sessionIdGenerator: () => import_crypto27.default.randomUUID(),
      onsessioninitialized: async (sessionId2) => {
        testDebug3(`create http session`);
        await connect(serverBackendFactory, transport, true);
        sessions.set(sessionId2, transport);
      }
    });
    transport.onclose = () => {
      if (!transport.sessionId)
        return;
      sessions.delete(transport.sessionId);
      testDebug3(`delete http session`);
    };
    await transport.handleRequest(req, res);
    return;
  }
  res.statusCode = 400;
  res.end("Invalid request");
}
var import_assert54, import_crypto27, debug13, SSEServerTransport, StreamableHTTPServerTransport, testDebug3;
var init_http = __esm({
  "packages/playwright-core/src/tools/utils/mcp/http.ts"() {
    "use strict";
    import_assert54 = __toESM(require("assert"));
    import_crypto27 = __toESM(require("crypto"));
    init_httpServer();
    init_network();
    init_server2();
    debug13 = require("./utilsBundle").debug;
    ({ SSEServerTransport } = require("./utilsBundle"));
    ({ StreamableHTTPServerTransport } = require("./utilsBundle"));
    testDebug3 = debug13("pw:mcp:test");
  }
});

// packages/playwright-core/src/tools/utils/mcp/tool.ts
function toMcpTool(tool) {
  const readOnly = tool.type === "readOnly" || tool.type === "assertion";
  return {
    name: tool.name,
    description: tool.description,
    inputSchema: zod.toJSONSchema(tool.inputSchema),
    annotations: {
      title: tool.title,
      readOnlyHint: readOnly,
      destructiveHint: !readOnly,
      openWorldHint: true
    }
  };
}
var zod;
var init_tool2 = __esm({
  "packages/playwright-core/src/tools/utils/mcp/tool.ts"() {
    "use strict";
    zod = require("./utilsBundle").z;
  }
});

// packages/playwright-core/src/tools/utils/mcp/server.ts
async function connect(factory, transport, runHeartbeat) {
  const server = createServer(factory.name, factory.version, factory, runHeartbeat);
  await server.connect(transport);
}
function createServer(name, version3, factory, runHeartbeat) {
  const server = new Server({ name, version: version3 }, {
    capabilities: {
      tools: {}
    }
  });
  server.setRequestHandler(ListToolsRequestSchema, async () => {
    serverDebug("listTools");
    return { tools: factory.toolSchemas.map((s) => toMcpTool(s)) };
  });
  let backendPromise;
  const onClose = () => backendPromise?.then((b) => backendManager.disposeBackend(b)).catch(serverDebug);
  addServerListener(server, "close", onClose);
  server.setRequestHandler(CallToolRequestSchema, async (request2, extra) => {
    serverDebug("callTool", request2);
    try {
      if (!backendPromise) {
        backendPromise = initializeServer(server, factory, runHeartbeat).catch((e) => {
          backendPromise = void 0;
          throw e;
        });
      }
      const backend = await backendPromise;
      const toolResult = await backend.callTool(request2.params.name, request2.params.arguments || {}, extra.signal);
      if (toolResult.isClose) {
        await backendManager.disposeBackend(backend).catch(serverDebug);
        backendPromise = void 0;
        delete toolResult.isClose;
      }
      const mergedResult = mergeTextParts(toolResult);
      serverDebugResponse("callResult", mergedResult);
      return mergedResult;
    } catch (error) {
      return {
        content: [{ type: "text", text: "### Error\n" + String(error) }],
        isError: true
      };
    }
  });
  return server;
}
function addServerListener(server, event, listener) {
  const oldListener = server[`on${event}`];
  server[`on${event}`] = () => {
    oldListener?.();
    listener();
  };
}
async function start2(serverBackendFactory, options = {}) {
  if (options.port === void 0) {
    const transport = new StdioServerTransport();
    process.stdin.on("end", () => void transport.close());
    await connect(serverBackendFactory, transport, false);
    return;
  }
  const url2 = await startMcpHttpServer(options, serverBackendFactory, options.allowedHosts);
  const mcpConfig = { mcpServers: {} };
  mcpConfig.mcpServers[serverBackendFactory.nameInConfig] = {
    url: `${url2}/mcp`
  };
  const message = [
    `Listening on ${url2}`,
    "Put this in your client config:",
    JSON.stringify(mcpConfig, void 0, 2),
    "For legacy SSE transport support, you can use the /sse endpoint instead."
  ].join("\n");
  console.error(message);
}
function firstRootPath(roots) {
  return allRootPaths(roots)[0];
}
function allRootPaths(roots) {
  const paths = [];
  for (const root of roots) {
    const url2 = new URL(root.uri);
    let rootPath;
    try {
      rootPath = (0, import_url2.fileURLToPath)(url2);
    } catch (e) {
      if (e.code === "ERR_INVALID_FILE_URL_PATH" && process.platform === "win32")
        rootPath = decodeURIComponent(url2.pathname);
    }
    if (!rootPath)
      continue;
    paths.push(rootPath);
  }
  if (paths.length === 0)
    paths.push(process.cwd());
  return paths;
}
function mergeTextParts(result2) {
  const content = [];
  const testParts = [];
  for (const part of result2.content) {
    if (part.type === "text") {
      testParts.push(part.text);
      continue;
    }
    if (testParts.length > 0) {
      content.push({ type: "text", text: testParts.join("\n") });
      testParts.length = 0;
    }
    content.push(part);
  }
  if (testParts.length > 0)
    content.push({ type: "text", text: testParts.join("\n") });
  return {
    ...result2,
    content
  };
}
var import_url2, CallToolRequestSchema, ListToolsRequestSchema, debug14, Server, StdioServerTransport, serverDebug, serverDebugResponse, BackendManager, backendManager, initializeServer, startHeartbeat;
var init_server2 = __esm({
  "packages/playwright-core/src/tools/utils/mcp/server.ts"() {
    "use strict";
    import_url2 = require("url");
    init_http();
    init_tool2();
    ({ CallToolRequestSchema, ListToolsRequestSchema } = require("./utilsBundle"));
    debug14 = require("./utilsBundle").debug;
    ({ Server } = require("./utilsBundle"));
    ({ StdioServerTransport } = require("./utilsBundle"));
    serverDebug = debug14("pw:mcp:server");
    serverDebugResponse = debug14("pw:mcp:server:response");
    BackendManager = class {
      constructor() {
        this._backends = /* @__PURE__ */ new Map();
      }
      async createBackend(factory, clientInfo) {
        const backend = await factory.create(clientInfo);
        await backend.initialize?.(clientInfo);
        this._backends.set(backend, factory);
        return backend;
      }
      async disposeBackend(backend) {
        const factory = this._backends.get(backend);
        if (!factory)
          return;
        await backend.dispose?.();
        await factory.disposed(backend).catch(serverDebug);
        this._backends.delete(backend);
      }
    };
    backendManager = new BackendManager();
    initializeServer = async (server, factory, runHeartbeat) => {
      const capabilities = server.getClientCapabilities();
      let clientRoots = [];
      if (capabilities?.roots) {
        const { roots } = await server.listRoots().catch((e) => {
          serverDebug(e);
          return { roots: [] };
        });
        clientRoots = roots;
      }
      const clientInfo = {
        cwd: firstRootPath(clientRoots),
        clientName: server.getClientVersion()?.name ?? "Playwright MCP"
      };
      const backend = await backendManager.createBackend(factory, clientInfo);
      if (runHeartbeat)
        startHeartbeat(server);
      return backend;
    };
    startHeartbeat = (server) => {
      const beat = () => {
        Promise.race([
          server.ping(),
          new Promise((_, reject) => setTimeout(() => reject(new Error("ping timeout")), 5e3))
        ]).then(() => {
          setTimeout(beat, 3e3);
        }).catch(() => {
          void server.close();
        });
      };
      beat();
    };
  }
});

// packages/playwright-core/src/tools/mcp/configIni.ts
function configFromIniFile(filePath) {
  const content = import_fs54.default.readFileSync(filePath, "utf8");
  const parsed = ini.parse(content);
  return iniEntriesToConfig(parsed);
}
function iniEntriesToConfig(entries) {
  const config = {};
  for (const [targetPath, rawValue] of Object.entries(entries)) {
    const type3 = longhandTypes[targetPath];
    const value2 = type3 ? coerceToType(rawValue, type3) : coerceIniValue(rawValue);
    setNestedValue(config, targetPath, value2);
  }
  return config;
}
function coerceToType(value2, type3) {
  switch (type3) {
    case "string":
      return String(value2);
    case "number":
      return Number(value2);
    case "boolean":
      if (typeof value2 === "boolean")
        return value2;
      return value2 === "true" || value2 === "1";
    case "string[]":
      if (Array.isArray(value2))
        return value2.map(String);
      return [String(value2)];
    case "size": {
      if (typeof value2 === "string" && value2.includes("x")) {
        const [w, h] = value2.split("x").map(Number);
        if (!isNaN(w) && !isNaN(h) && w > 0 && h > 0)
          return { width: w, height: h };
      }
      return void 0;
    }
  }
}
function coerceIniValue(value2) {
  if (typeof value2 !== "string")
    return value2;
  const trimmed = value2.trim();
  if (trimmed === "")
    return trimmed;
  const num = Number(trimmed);
  if (!isNaN(num))
    return num;
  return value2;
}
function setNestedValue(obj, dotPath, value2) {
  const parts = dotPath.split(".");
  let current = obj;
  for (let i = 0; i < parts.length - 1; i++) {
    const part = parts[i];
    if (!(part in current) || typeof current[part] !== "object" || current[part] === null)
      current[part] = {};
    current = current[part];
  }
  current[parts[parts.length - 1]] = value2;
}
var import_fs54, ini, longhandTypes;
var init_configIni = __esm({
  "packages/playwright-core/src/tools/mcp/configIni.ts"() {
    "use strict";
    import_fs54 = __toESM(require("fs"));
    ini = require("./utilsBundle").ini;
    longhandTypes = {
      // browser direct
      "browser.browserName": "string",
      "browser.isolated": "boolean",
      "browser.userDataDir": "string",
      "browser.cdpEndpoint": "string",
      "browser.cdpTimeout": "number",
      "browser.remoteEndpoint": "string",
      "browser.initPage": "string[]",
      "browser.initScript": "string[]",
      // browser.launchOptions
      "browser.launchOptions.channel": "string",
      "browser.launchOptions.headless": "boolean",
      "browser.launchOptions.executablePath": "string",
      "browser.launchOptions.chromiumSandbox": "boolean",
      "browser.launchOptions.args": "string[]",
      "browser.launchOptions.downloadsPath": "string",
      "browser.launchOptions.handleSIGHUP": "boolean",
      "browser.launchOptions.handleSIGINT": "boolean",
      "browser.launchOptions.handleSIGTERM": "boolean",
      "browser.launchOptions.slowMo": "number",
      "browser.launchOptions.timeout": "number",
      "browser.launchOptions.tracesDir": "string",
      "browser.launchOptions.proxy.server": "string",
      "browser.launchOptions.proxy.bypass": "string",
      "browser.launchOptions.proxy.username": "string",
      "browser.launchOptions.proxy.password": "string",
      // browser.contextOptions
      "browser.contextOptions.acceptDownloads": "boolean",
      "browser.contextOptions.baseURL": "string",
      "browser.contextOptions.bypassCSP": "boolean",
      "browser.contextOptions.colorScheme": "string",
      "browser.contextOptions.contrast": "string",
      "browser.contextOptions.deviceScaleFactor": "number",
      "browser.contextOptions.forcedColors": "string",
      "browser.contextOptions.hasTouch": "boolean",
      "browser.contextOptions.ignoreHTTPSErrors": "boolean",
      "browser.contextOptions.isMobile": "boolean",
      "browser.contextOptions.javaScriptEnabled": "boolean",
      "browser.contextOptions.locale": "string",
      "browser.contextOptions.offline": "boolean",
      "browser.contextOptions.permissions": "string[]",
      "browser.contextOptions.reducedMotion": "string",
      "browser.contextOptions.screen": "size",
      "browser.contextOptions.serviceWorkers": "string",
      "browser.contextOptions.storageState": "string",
      "browser.contextOptions.strictSelectors": "boolean",
      "browser.contextOptions.timezoneId": "string",
      "browser.contextOptions.userAgent": "string",
      "browser.contextOptions.viewport": "size",
      // top-level
      "extension": "boolean",
      "capabilities": "string[]",
      "saveSession": "boolean",
      "saveVideo": "size",
      "sharedBrowserContext": "boolean",
      "outputDir": "string",
      "outputMaxSize": "number",
      "imageResponses": "string",
      "allowUnrestrictedFileAccess": "boolean",
      "codegen": "string",
      "testIdAttribute": "string",
      // server
      "server.port": "number",
      "server.host": "string",
      "server.allowedHosts": "string[]",
      // console
      "console.level": "string",
      // network
      "network.allowedOrigins": "string[]",
      "network.blockedOrigins": "string[]",
      // timeouts
      "timeouts.action": "number",
      "timeouts.navigation": "number",
      // snapshot
      "snapshot.mode": "string"
    };
  }
});

// packages/playwright-core/src/tools/mcp/config.ts
async function fileExistsAsync(resolved) {
  try {
    return (await import_fs55.default.promises.stat(resolved)).isFile();
  } catch {
    return false;
  }
}
async function resolveConfig(config) {
  const merged = mergeConfig(defaultConfig, config);
  const browser = await validateBrowserConfig(merged.browser);
  return { ...merged, browser };
}
async function resolveCLIConfigForMCP(cliOptions, env) {
  const envOverrides = configFromEnv(env);
  const cliOverrides = configFromCLIOptions(cliOptions);
  const configFile = cliOverrides.configFile ?? envOverrides.configFile;
  const configInFile = await loadConfig(configFile);
  const configDir = configFile ? import_path53.default.dirname(import_path53.default.resolve(configFile)) : process.cwd();
  let result2 = defaultConfig;
  result2 = mergeConfig(result2, resolveConfigPaths(configInFile, configDir));
  result2 = mergeConfig(result2, resolveConfigPaths(envOverrides, process.cwd()));
  result2 = mergeConfig(result2, resolveConfigPaths(cliOverrides, process.cwd()));
  const browser = await validateBrowserConfig(result2.browser);
  if (browser.launchOptions.headless === void 0)
    browser.launchOptions.headless = import_os25.default.platform() === "linux" && !process.env.DISPLAY;
  validateOutputDir(result2.outputDir);
  return { ...result2, browser, configFile };
}
function validateOutputDir(outputDir2) {
  if (!outputDir2)
    return;
  if (isSystemDirectory(outputDir2))
    throw new Error(`--output-dir cannot point to a system directory: ${import_path53.default.resolve(outputDir2)}.`);
}
async function resolveCLIConfigForCLI(daemonProfilesDir2, sessionName, options, env) {
  const config = options.config ? import_path53.default.resolve(options.config) : void 0;
  try {
    const defaultConfigFile2 = import_path53.default.resolve(".playwright", "cli.config.json");
    if (!config && import_fs55.default.existsSync(defaultConfigFile2))
      options.config = defaultConfigFile2;
  } catch {
  }
  const daemonOverrides = configFromCLIOptions({
    endpoint: options.endpoint,
    cdpEndpoint: options.cdp,
    config: options.config,
    browser: options.browser,
    headless: options.headed ? false : void 0,
    extension: options.extension,
    userDataDir: options.profile,
    snapshotMode: "full"
  });
  const envOverrides = configFromEnv(env);
  const configFile = daemonOverrides.configFile ?? envOverrides.configFile;
  const configInFile = await loadConfig(configFile);
  const configDir = configFile ? import_path53.default.dirname(import_path53.default.resolve(configFile)) : process.cwd();
  const globalConfigPath = import_path53.default.join((env ?? process.env)["PWTEST_CLI_GLOBAL_CONFIG"] ?? import_os25.default.homedir(), ".playwright", "cli.config.json");
  const globalConfigExists = import_fs55.default.existsSync(globalConfigPath);
  const globalConfigInFile = await loadConfig(globalConfigExists ? globalConfigPath : void 0);
  const globalConfigDir = globalConfigExists ? import_path53.default.dirname(globalConfigPath) : process.cwd();
  let result2 = defaultConfig;
  result2 = mergeConfig(result2, resolveConfigPaths(globalConfigInFile, globalConfigDir));
  result2 = mergeConfig(result2, resolveConfigPaths(configInFile, configDir));
  result2 = mergeConfig(result2, resolveConfigPaths(envOverrides, process.cwd()));
  result2 = mergeConfig(result2, resolveConfigPaths(daemonOverrides, process.cwd()));
  if (result2.browser.isolated === void 0)
    result2.browser.isolated = !options.profile && !options.persistent && !result2.browser.userDataDir && !result2.browser.remoteEndpoint && !result2.browser.cdpEndpoint && !result2.extension;
  if (result2.browser.launchOptions.headless === void 0)
    result2.browser.launchOptions.headless = true;
  const browser = await validateBrowserConfig(result2.browser);
  validateOutputDir(result2.outputDir);
  if (!result2.extension && !browser.isolated && !browser.userDataDir && !browser.remoteEndpoint && !browser.cdpEndpoint) {
    const browserToken = browser.launchOptions?.channel ?? browser?.browserName;
    const userDataDir = import_path53.default.resolve(daemonProfilesDir2, `ud-${sessionName}-${browserToken}`);
    browser.userDataDir = userDataDir;
  }
  return { ...result2, browser, configFile, skillMode: true };
}
function resolveExtensionOptions(cliOptions) {
  const browser = cliOptions.browser ?? envToString(process.env.PLAYWRIGHT_MCP_BROWSER);
  const { channel } = resolveBrowserParam(browser);
  const executablePath = cliOptions.executablePath ?? envToString(process.env.PLAYWRIGHT_MCP_EXECUTABLE_PATH);
  return { channel: channel ?? "chrome", executablePath };
}
async function validateBrowserConfig(browser) {
  let browserName = browser.browserName;
  if (!browserName) {
    browserName = "chromium";
    if (browser.launchOptions.channel === void 0)
      browser.launchOptions.channel = "chrome";
  }
  if (browser.browserName === "chromium" && browser.launchOptions.chromiumSandbox === void 0) {
    if (process.platform === "linux")
      browser.launchOptions.chromiumSandbox = browser.launchOptions.channel !== "chromium" && browser.launchOptions.channel !== "chrome-for-testing";
    else
      browser.launchOptions.chromiumSandbox = true;
  }
  if (browser.isolated && browser.userDataDir)
    throw new Error("Browser userDataDir is not supported in isolated mode.");
  if (browser.initScript) {
    for (const script of browser.initScript) {
      if (!await fileExistsAsync(script))
        throw new Error(`Init script file does not exist: ${script}`);
    }
  }
  if (browser.initPage) {
    for (const page of browser.initPage) {
      if (!await fileExistsAsync(page))
        throw new Error(`Init page file does not exist: ${page}`);
    }
  }
  if (browser.contextOptions.viewport === void 0) {
    if (browser.launchOptions.headless)
      browser.contextOptions.viewport = { width: 1280, height: 720 };
    else
      browser.contextOptions.viewport = null;
  }
  if (browserName === "chromium") {
    browser.launchOptions.args = browser.launchOptions.args ?? [];
    if (!browser.launchOptions.args.some((a) => a.includes("--disable-blink-features")))
      browser.launchOptions.args.push(`--disable-blink-features=AutomationControlled`);
  }
  return { ...browser, browserName };
}
function resolveBrowserParam(browserOption) {
  switch (browserOption) {
    case "chrome":
    case "chrome-beta":
    case "chrome-canary":
    case "chrome-dev":
    case "msedge":
    case "msedge-beta":
    case "msedge-canary":
    case "msedge-dev":
      return { browserName: "chromium", channel: browserOption };
    case "chromium":
      return { browserName: "chromium", channel: "chrome-for-testing" };
    case "firefox":
      return { browserName: "firefox" };
    case "moz-firefox":
    case "moz-firefox-beta":
    case "moz-firefox-nightly":
      return { browserName: "firefox", channel: browserOption };
    case "webkit":
      return { browserName: "webkit" };
    default:
      return {};
  }
}
function configFromCLIOptions(cliOptions) {
  const { browserName, channel } = resolveBrowserParam(cliOptions.browser);
  const launchOptions = {
    channel,
    executablePath: cliOptions.executablePath,
    headless: cliOptions.headless
  };
  if (cliOptions.sandbox !== void 0)
    launchOptions.chromiumSandbox = cliOptions.sandbox;
  if (cliOptions.device && cliOptions.cdpEndpoint)
    throw new Error("Device emulation is not supported with cdpEndpoint.");
  const contextOptions = cliOptions.device ? playwright.devices[cliOptions.device] : {};
  if (cliOptions.proxyServer) {
    const proxy = { server: cliOptions.proxyServer };
    if (cliOptions.proxyBypass)
      proxy.bypass = cliOptions.proxyBypass;
    launchOptions.proxy = proxy;
    contextOptions.proxy = proxy;
  }
  if (cliOptions.storageState)
    contextOptions.storageState = cliOptions.storageState;
  if (cliOptions.userAgent)
    contextOptions.userAgent = cliOptions.userAgent;
  if (cliOptions.viewportSize)
    contextOptions.viewport = cliOptions.viewportSize;
  if (cliOptions.ignoreHttpsErrors)
    contextOptions.ignoreHTTPSErrors = true;
  if (cliOptions.blockServiceWorkers)
    contextOptions.serviceWorkers = "block";
  if (cliOptions.grantPermissions)
    contextOptions.permissions = cliOptions.grantPermissions;
  const config = {
    browser: {
      browserName,
      isolated: cliOptions.isolated,
      userDataDir: cliOptions.userDataDir,
      launchOptions,
      contextOptions,
      cdpEndpoint: cliOptions.cdpEndpoint,
      cdpHeaders: cliOptions.cdpHeader,
      cdpTimeout: cliOptions.cdpTimeout,
      initPage: cliOptions.initPage,
      initScript: cliOptions.initScript,
      remoteEndpoint: cliOptions.endpoint
    },
    extension: cliOptions.extension,
    server: {
      port: cliOptions.port,
      host: cliOptions.host,
      allowedHosts: cliOptions.allowedHosts
    },
    capabilities: cliOptions.caps,
    console: {
      level: cliOptions.consoleLevel
    },
    network: {
      allowedOrigins: cliOptions.allowedOrigins,
      blockedOrigins: cliOptions.blockedOrigins
    },
    allowUnrestrictedFileAccess: cliOptions.allowUnrestrictedFileAccess,
    codegen: cliOptions.codegen,
    saveSession: cliOptions.saveSession,
    secrets: cliOptions.secrets,
    sharedBrowserContext: cliOptions.sharedBrowserContext,
    snapshot: cliOptions.snapshotMode ? { mode: cliOptions.snapshotMode } : void 0,
    outputDir: cliOptions.outputDir,
    outputMaxSize: cliOptions.outputMaxSize,
    imageResponses: cliOptions.imageResponses,
    testIdAttribute: cliOptions.testIdAttribute,
    timeouts: {
      action: cliOptions.timeoutAction,
      navigation: cliOptions.timeoutNavigation
    }
  };
  if (cliOptions.remoteHeader)
    config.browser.remoteHeaders = cliOptions.remoteHeader;
  return { ...config, configFile: cliOptions.config };
}
function configFromEnv(env) {
  const e = env ?? process.env;
  const options = {};
  options.allowedHosts = commaSeparatedList(e.PLAYWRIGHT_MCP_ALLOWED_HOSTS);
  options.allowedOrigins = semicolonSeparatedList(e.PLAYWRIGHT_MCP_ALLOWED_ORIGINS);
  options.allowUnrestrictedFileAccess = envToBoolean(e.PLAYWRIGHT_MCP_ALLOW_UNRESTRICTED_FILE_ACCESS);
  options.blockedOrigins = semicolonSeparatedList(e.PLAYWRIGHT_MCP_BLOCKED_ORIGINS);
  options.blockServiceWorkers = envToBoolean(e.PLAYWRIGHT_MCP_BLOCK_SERVICE_WORKERS);
  options.browser = envToString(e.PLAYWRIGHT_MCP_BROWSER);
  options.caps = commaSeparatedList(e.PLAYWRIGHT_MCP_CAPS);
  options.cdpEndpoint = envToString(e.PLAYWRIGHT_MCP_CDP_ENDPOINT);
  options.cdpHeader = headerParser(envToString(e.PLAYWRIGHT_MCP_CDP_HEADERS));
  options.cdpTimeout = numberParser(e.PLAYWRIGHT_MCP_CDP_TIMEOUT);
  options.config = envToString(e.PLAYWRIGHT_MCP_CONFIG);
  if (e.PLAYWRIGHT_MCP_CONSOLE_LEVEL)
    options.consoleLevel = enumParser("--console-level", ["error", "warning", "info", "debug"], e.PLAYWRIGHT_MCP_CONSOLE_LEVEL);
  options.device = envToString(e.PLAYWRIGHT_MCP_DEVICE);
  options.executablePath = envToString(e.PLAYWRIGHT_MCP_EXECUTABLE_PATH);
  options.extension = envToBoolean(e.PLAYWRIGHT_MCP_EXTENSION);
  options.grantPermissions = commaSeparatedList(e.PLAYWRIGHT_MCP_GRANT_PERMISSIONS);
  options.headless = envToBoolean(e.PLAYWRIGHT_MCP_HEADLESS);
  options.host = envToString(e.PLAYWRIGHT_MCP_HOST);
  options.ignoreHttpsErrors = envToBoolean(e.PLAYWRIGHT_MCP_IGNORE_HTTPS_ERRORS);
  const initPage = envToString(e.PLAYWRIGHT_MCP_INIT_PAGE);
  if (initPage)
    options.initPage = [initPage];
  const initScript = envToString(e.PLAYWRIGHT_MCP_INIT_SCRIPT);
  if (initScript)
    options.initScript = [initScript];
  options.isolated = envToBoolean(e.PLAYWRIGHT_MCP_ISOLATED);
  if (e.PLAYWRIGHT_MCP_IMAGE_RESPONSES)
    options.imageResponses = enumParser("--image-responses", ["allow", "omit"], e.PLAYWRIGHT_MCP_IMAGE_RESPONSES);
  options.sandbox = envToBoolean(e.PLAYWRIGHT_MCP_SANDBOX);
  options.outputDir = envToString(e.PLAYWRIGHT_MCP_OUTPUT_DIR);
  options.outputMaxSize = numberParser(e.PLAYWRIGHT_MCP_OUTPUT_MAX_SIZE);
  options.port = numberParser(e.PLAYWRIGHT_MCP_PORT);
  options.proxyBypass = envToString(e.PLAYWRIGHT_MCP_PROXY_BYPASS);
  options.proxyServer = envToString(e.PLAYWRIGHT_MCP_PROXY_SERVER);
  options.remoteHeader = headerParser(envToString(e.PLAYWRIGHT_MCP_REMOTE_HEADERS));
  options.secrets = dotenvFileLoader(e.PLAYWRIGHT_MCP_SECRETS_FILE);
  options.storageState = envToString(e.PLAYWRIGHT_MCP_STORAGE_STATE);
  options.testIdAttribute = envToString(e.PLAYWRIGHT_MCP_TEST_ID_ATTRIBUTE);
  options.timeoutAction = numberParser(e.PLAYWRIGHT_MCP_TIMEOUT_ACTION);
  options.timeoutNavigation = numberParser(e.PLAYWRIGHT_MCP_TIMEOUT_NAVIGATION);
  options.userAgent = envToString(e.PLAYWRIGHT_MCP_USER_AGENT);
  options.userDataDir = envToString(e.PLAYWRIGHT_MCP_USER_DATA_DIR);
  options.viewportSize = resolutionParser("--viewport-size", e.PLAYWRIGHT_MCP_VIEWPORT_SIZE);
  return configFromCLIOptions(options);
}
async function loadConfig(configFile) {
  if (!configFile)
    return {};
  if (configFile.endsWith(".ini"))
    return configFromIniFile(configFile);
  try {
    const data = await import_fs55.default.promises.readFile(configFile, "utf8");
    return JSON.parse(data.charCodeAt(0) === 65279 ? data.slice(1) : data);
  } catch {
    return configFromIniFile(configFile);
  }
}
function resolveConfigPaths(config, baseDir) {
  if (config.browser?.initPage)
    config.browser.initPage = config.browser.initPage.map((p) => import_path53.default.resolve(baseDir, p));
  if (config.browser?.initScript)
    config.browser.initScript = config.browser.initScript.map((p) => import_path53.default.resolve(baseDir, p));
  return config;
}
function pickDefined(obj) {
  return Object.fromEntries(
    Object.entries(obj ?? {}).filter(([_, v]) => v !== void 0)
  );
}
function mergeConfig(base, overrides) {
  const browser = {
    ...pickDefined(base.browser),
    ...pickDefined(overrides.browser),
    browserName: overrides.browser?.browserName ?? base.browser?.browserName,
    isolated: overrides.browser?.isolated ?? base.browser?.isolated,
    launchOptions: {
      ...pickDefined(base.browser?.launchOptions),
      ...pickDefined(overrides.browser?.launchOptions)
    },
    contextOptions: {
      ...pickDefined(base.browser?.contextOptions),
      ...pickDefined(overrides.browser?.contextOptions)
    }
  };
  if (browser.browserName !== "chromium" && browser.launchOptions && !browser.launchOptions.channel?.startsWith("moz-"))
    delete browser.launchOptions.channel;
  return {
    ...pickDefined(base),
    ...pickDefined(overrides),
    browser,
    console: {
      ...pickDefined(base.console),
      ...pickDefined(overrides.console)
    },
    network: {
      ...pickDefined(base.network),
      ...pickDefined(overrides.network)
    },
    server: {
      ...pickDefined(base.server),
      ...pickDefined(overrides.server)
    },
    snapshot: {
      ...pickDefined(base.snapshot),
      ...pickDefined(overrides.snapshot)
    },
    timeouts: {
      ...pickDefined(base.timeouts),
      ...pickDefined(overrides.timeouts)
    }
  };
}
function semicolonSeparatedList(value2) {
  if (!value2)
    return void 0;
  return value2.split(";").map((v) => v.trim());
}
function commaSeparatedList(value2) {
  if (!value2)
    return void 0;
  return value2.split(",").map((v) => v.trim());
}
function dotenvFileLoader(value2) {
  if (!value2)
    return void 0;
  return dotenv2.parse(import_fs55.default.readFileSync(value2, "utf8"));
}
function numberParser(value2) {
  if (!value2)
    return void 0;
  return +value2;
}
function resolutionParser(name, value2) {
  if (!value2)
    return void 0;
  if (value2.includes("x")) {
    const [width, height] = value2.split("x").map((v) => +v);
    if (isNaN(width) || isNaN(height) || width <= 0 || height <= 0)
      throw new Error(`Invalid resolution format: use ${name}="800x600"`);
    return { width, height };
  }
  if (value2.includes(",")) {
    const [width, height] = value2.split(",").map((v) => +v);
    if (isNaN(width) || isNaN(height) || width <= 0 || height <= 0)
      throw new Error(`Invalid resolution format: use ${name}="800x600"`);
    return { width, height };
  }
  throw new Error(`Invalid resolution format: use ${name}="800x600"`);
}
function headerParser(arg, previous) {
  if (!arg)
    return previous;
  const result2 = { ...previous ?? {} };
  const colonIndex = arg.indexOf(":");
  const name = colonIndex === -1 ? arg.trim() : arg.substring(0, colonIndex).trim();
  const value2 = colonIndex === -1 ? "" : arg.substring(colonIndex + 1).trim();
  result2[name] = value2;
  return result2;
}
function enumParser(name, options, value2) {
  if (!options.includes(value2))
    throw new Error(`Invalid ${name}: ${value2}. Valid values are: ${options.join(", ")}`);
  return value2;
}
function envToBoolean(value2) {
  if (value2 === "true" || value2 === "1")
    return true;
  if (value2 === "false" || value2 === "0")
    return false;
  return void 0;
}
function envToString(value2) {
  return value2 ? value2.trim() : void 0;
}
var import_fs55, import_path53, import_os25, dotenv2, defaultConfig;
var init_config2 = __esm({
  "packages/playwright-core/src/tools/mcp/config.ts"() {
    "use strict";
    import_fs55 = __toESM(require("fs"));
    import_path53 = __toESM(require("path"));
    import_os25 = __toESM(require("os"));
    init_fileUtils();
    init_inprocess();
    init_configIni();
    dotenv2 = require("./utilsBundle").dotenv;
    defaultConfig = {
      browser: {
        launchOptions: {},
        contextOptions: {}
      },
      timeouts: {
        action: 5e3,
        navigation: 6e4,
        expect: 5e3
      }
    };
  }
});

// packages/playwright-core/src/tools/mcp/cdpRelayV1.ts
var ExtensionProtocolV1;
var init_cdpRelayV1 = __esm({
  "packages/playwright-core/src/tools/mcp/cdpRelayV1.ts"() {
    "use strict";
    ExtensionProtocolV1 = class {
      constructor(sendCommand) {
        this._sendToCDPClient = null;
        this._nextSessionId = 1;
        this._sendCommand = sendCommand;
      }
      connectOverCDP(sendToCDPClient) {
        this._sendToCDPClient = sendToCDPClient;
      }
      handleExtensionEvent(method, params2) {
        switch (method) {
          case "forwardCDPEvent": {
            const p = params2;
            const sessionId = p.sessionId || this._connectedTabInfo?.sessionId;
            this._sendToCDPClient?.({
              sessionId,
              method: p.method,
              params: p.params
            });
            break;
          }
        }
      }
      async handleCDPCommand(method, params2, sessionId) {
        switch (method) {
          case "Target.setAutoAttach": {
            if (sessionId)
              return void 0;
            const { targetInfo } = await this._sendCommand("attachToTab", {});
            this._connectedTabInfo = {
              targetInfo,
              sessionId: `pw-tab-${this._nextSessionId++}`
            };
            this._sendToCDPClient?.({
              method: "Target.attachedToTarget",
              params: {
                sessionId: this._connectedTabInfo.sessionId,
                targetInfo: {
                  ...this._connectedTabInfo.targetInfo,
                  attached: true
                },
                waitingForDebugger: false
              }
            });
            return { result: {} };
          }
          case "Target.getTargetInfo": {
            return { result: this._connectedTabInfo?.targetInfo };
          }
          case "Target.createTarget": {
            throw new Error("Tab creation is not supported yet.");
          }
        }
        return void 0;
      }
      async forwardToExtension(method, params2, sessionId) {
        if (this._connectedTabInfo?.sessionId === sessionId)
          sessionId = void 0;
        return await this._sendCommand("forwardCDPCommand", { sessionId, method, params: params2 });
      }
      ready() {
        return Promise.resolve();
      }
      onExtensionDisconnect(_reason) {
      }
    };
  }
});

// packages/playwright-core/src/tools/mcp/browserModel.ts
var BrowserModel;
var init_browserModel = __esm({
  "packages/playwright-core/src/tools/mcp/browserModel.ts"() {
    "use strict";
    init_log();
    BrowserModel = class {
      constructor(sendToExtension) {
        // Set only while a Playwright CDP connection is attached (see
        // `connectOverCDP`). Before that, any attempt to emit to Playwright is a
        // no-op â€” the model is observation-only during the extension handshake.
        this._sendToCDPClient = null;
        // Tabs observed via chrome.tabs.onCreated, whether or not the debugger is attached yet.
        this._knownTabs = /* @__PURE__ */ new Map();
        // Subset of _knownTabs we've attached the debugger to and assigned a sessionId.
        this._tabSessions = /* @__PURE__ */ new Map();
        this._autoAttach = false;
        this._nextSessionId = 1;
        this._sendToExtension = sendToExtension;
      }
      // Wires the model's CDP output sink. Called by the handler once the
      // extension handshake is done and a Playwright CDP client is ready to
      // receive events. Before this call the model is observation-only â€”
      // `Target.attachedToTarget` etc. would be answered into a black hole.
      connectOverCDP(sendToCDPClient) {
        this._sendToCDPClient = sendToCDPClient;
      }
      _emit(message) {
        this._sendToCDPClient?.(message);
      }
      // â”€â”€â”€ Extension â†’ model inputs â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€
      onTabCreated(tab2) {
        if (tab2.id === void 0)
          return;
        this._knownTabs.set(tab2.id, tab2);
        if (this._autoAttach)
          void this._attachTab(tab2.id).catch(logUnhandledError);
      }
      onTabRemoved(tabId) {
        this._knownTabs.delete(tabId);
        this._detachTab(tabId);
      }
      onDebuggerEvent(source11, method, params2) {
        if (source11.tabId === void 0)
          return;
        const tabSession = this._tabSessions.get(source11.tabId);
        if (!tabSession)
          return;
        const childSessionId = params2?.sessionId;
        if (method === "Target.attachedToTarget" && childSessionId)
          tabSession.childSessions.add(childSessionId);
        else if (method === "Target.detachedFromTarget" && childSessionId)
          tabSession.childSessions.delete(childSessionId);
        const sessionId = source11.sessionId || tabSession.sessionId;
        this._emit({ sessionId, method, params: params2 });
      }
      onDebuggerDetach(source11) {
        if (source11.tabId !== void 0)
          this._detachTab(source11.tabId);
      }
      // â”€â”€â”€ Playwright â†’ model commands â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€
      // Turn auto-attach on and attach to every tab we already know about.
      // Called in response to Playwright's `Target.setAutoAttach` on the root session.
      async enableAutoAttach() {
        this._autoAttach = true;
        const tabIds = [...this._knownTabs.keys()];
        await Promise.all(tabIds.map((tabId) => this._attachTab(tabId).catch(logUnhandledError)));
      }
      async createTarget(url2) {
        const tab2 = await this._sendToExtension("chrome.tabs.create", [{ url: url2 }]);
        if (tab2?.id === void 0)
          throw new Error("Failed to create tab");
        this._knownTabs.set(tab2.id, tab2);
        const tabSession = await this._attachTab(tab2.id);
        return { targetId: tabSession.targetInfo?.targetId };
      }
      async closeTarget(targetId) {
        const tabSession = targetId ? this._findTabSession((s) => s.targetInfo?.targetId === targetId) : void 0;
        if (!tabSession)
          return { success: false };
        await this._sendToExtension("chrome.tabs.remove", [tabSession.tabId]);
        return { success: true };
      }
      getTargetInfo(sessionId) {
        if (!sessionId)
          return void 0;
        return this._findTabSession((s) => s.sessionId === sessionId)?.targetInfo;
      }
      // Forward a browser-level CDP command (Storage.*, Browser.*, etc.) that is
      // not associated with a specific tab. chrome.debugger.sendCommand requires a
      // target, so we route through any attached tab; the command itself is
      // browser-scoped and returns the same result regardless of which tab is used.
      async sendBrowserCommand(method, params2) {
        const tabSession = this._tabSessions.values().next().value;
        if (!tabSession)
          throw new Error(`No attached tab to forward browser-level command: ${method}`);
        return await this._sendToExtension("chrome.debugger.sendCommand", [
          { tabId: tabSession.tabId },
          method,
          params2
        ]);
      }
      // Forward a CDP command from Playwright to the tab its sessionId resolves to.
      async sendCommand(sessionId, method, params2) {
        let tabSession = this._findTabSession((s) => s.sessionId === sessionId);
        let cdpSessionId;
        if (!tabSession) {
          tabSession = this._findTabSession((s) => s.childSessions.has(sessionId));
          cdpSessionId = sessionId;
        }
        if (!tabSession)
          throw new Error(`No tab found for sessionId: ${sessionId}`);
        return await this._sendToExtension("chrome.debugger.sendCommand", [
          { tabId: tabSession.tabId, sessionId: cdpSessionId },
          method,
          params2
        ]);
      }
      // â”€â”€â”€ Internals â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€
      async _attachTab(tabId) {
        const existing = this._tabSessions.get(tabId);
        if (existing)
          return existing;
        await this._sendToExtension("chrome.debugger.attach", [{ tabId }, "1.3"]);
        const result2 = await this._sendToExtension("chrome.debugger.sendCommand", [
          { tabId },
          "Target.getTargetInfo"
        ]);
        const targetInfo = result2?.targetInfo;
        const sessionId = `pw-tab-${this._nextSessionId++}`;
        const tabSession = { tabId, sessionId, targetInfo, childSessions: /* @__PURE__ */ new Set() };
        this._tabSessions.set(tabId, tabSession);
        this._emit({
          method: "Target.attachedToTarget",
          params: {
            sessionId,
            targetInfo: { ...targetInfo, attached: true },
            waitingForDebugger: false
          }
        });
        return tabSession;
      }
      _detachTab(tabId) {
        const tabSession = this._tabSessions.get(tabId);
        if (!tabSession)
          return;
        this._tabSessions.delete(tabId);
        this._emit({
          method: "Target.detachedFromTarget",
          params: {
            sessionId: tabSession.sessionId,
            targetId: tabSession.targetInfo?.targetId
          }
        });
      }
      _findTabSession(predicate) {
        for (const session2 of this._tabSessions.values()) {
          if (predicate(session2))
            return session2;
        }
        return void 0;
      }
    };
  }
});

// packages/playwright-core/src/tools/mcp/cdpRelayV2.ts
var ExtensionProtocolV2;
var init_cdpRelayV2 = __esm({
  "packages/playwright-core/src/tools/mcp/cdpRelayV2.ts"() {
    "use strict";
    init_manualPromise();
    init_log();
    init_browserModel();
    ExtensionProtocolV2 = class {
      constructor(sendCommand) {
        // Resolved by `extension.initialized`. Purely a handshake signal for the
        // relay â€” the model itself is oblivious to this phase.
        this._ready = new ManualPromise();
        this._model = new BrowserModel(sendCommand);
        void this._ready.catch(logUnhandledError);
      }
      ready() {
        return this._ready;
      }
      connectOverCDP(sendToCDPClient) {
        this._model.connectOverCDP(sendToCDPClient);
      }
      onExtensionDisconnect(reason) {
        if (!this._ready.isDone())
          this._ready.reject(new Error(`Extension disconnected before initialization: ${reason}`));
      }
      handleExtensionEvent(method, params2) {
        switch (method) {
          case "chrome.debugger.onEvent": {
            const [source11, cdpMethod, cdpParams] = params2;
            this._model.onDebuggerEvent(source11, cdpMethod, cdpParams);
            break;
          }
          case "chrome.debugger.onDetach": {
            const [source11] = params2;
            this._model.onDebuggerDetach(source11);
            break;
          }
          case "chrome.tabs.onCreated": {
            const [tab2] = params2;
            this._model.onTabCreated(tab2);
            break;
          }
          case "chrome.tabs.onRemoved": {
            const [tabId] = params2;
            this._model.onTabRemoved(tabId);
            break;
          }
          case "extension.initialized": {
            this._ready.resolve();
            break;
          }
        }
      }
      async handleCDPCommand(method, params2, sessionId) {
        switch (method) {
          case "Target.setAutoAttach": {
            if (sessionId)
              return void 0;
            await this._model.enableAutoAttach();
            return { result: {} };
          }
          case "Target.createTarget":
            return { result: await this._model.createTarget(params2?.url) };
          case "Target.closeTarget":
            return { result: await this._model.closeTarget(params2?.targetId) };
          case "Target.getTargetInfo":
            return { result: this._model.getTargetInfo(sessionId) };
        }
        return void 0;
      }
      async forwardToExtension(method, params2, sessionId) {
        if (!sessionId)
          return await this._model.sendBrowserCommand(method, params2);
        return await this._model.sendCommand(sessionId, method, params2);
      }
    };
  }
});

// packages/playwright-core/src/tools/mcp/protocol.ts
var DEFAULT_VERSION;
var init_protocol = __esm({
  "packages/playwright-core/src/tools/mcp/protocol.ts"() {
    "use strict";
    DEFAULT_VERSION = 2;
  }
});

// packages/playwright-core/src/tools/mcp/cdpRelay.ts
var import_child_process6, import_os26, debug15, ws3, wsServer3, debugLogger2, CDPRelayServer, ExtensionConnection;
var init_cdpRelay = __esm({
  "packages/playwright-core/src/tools/mcp/cdpRelay.ts"() {
    "use strict";
    import_child_process6 = require("child_process");
    import_os26 = __toESM(require("os"));
    init_manualPromise();
    init_registry();
    init_extension();
    init_http();
    init_log();
    init_cdpRelayV1();
    init_cdpRelayV2();
    init_protocol();
    debug15 = require("./utilsBundle").debug;
    ws3 = require("./utilsBundle").ws;
    ({ wsServer: wsServer3 } = require("./utilsBundle"));
    debugLogger2 = debug15("pw:mcp:relay");
    CDPRelayServer = class {
      constructor(server, browserChannel, executablePath) {
        this._cdpConnection = null;
        this._extensionConnection = null;
        this._extensionConnectionPromise = new ManualPromise();
        this._wsHost = addressToString(server.address(), { protocol: "ws" });
        this._browserChannel = browserChannel;
        this._executablePath = executablePath;
        this._protocolVersion = parseInt(process.env.PLAYWRIGHT_EXTENSION_PROTOCOL ?? DEFAULT_VERSION.toString(), 10);
        const sendCommand = (method, params2) => {
          if (!this._extensionConnection)
            throw new Error("Extension not connected");
          return this._extensionConnection.send(method, params2);
        };
        if (this._protocolVersion >= 2)
          this._handler = new ExtensionProtocolV2(sendCommand);
        else
          this._handler = new ExtensionProtocolV1(sendCommand);
        const uuid = crypto.randomUUID();
        this._cdpPath = `/cdp/${uuid}`;
        this._extensionPath = `/extension/${uuid}`;
        void this._extensionConnectionPromise.catch(logUnhandledError);
        this._wss = new wsServer3({ server });
        this._wss.on("connection", this._onConnection.bind(this));
      }
      cdpEndpoint() {
        return `${this._wsHost}${this._cdpPath}`;
      }
      extensionEndpoint() {
        return `${this._wsHost}${this._extensionPath}`;
      }
      async establishExtensionConnection(clientName) {
        debugLogger2("Establishing extension connection");
        this._openConnectPageInBrowser(clientName);
        debugLogger2("Waiting for incoming extension connection");
        await this._extensionConnectionPromise;
        await this._handler.ready();
        debugLogger2("Extension connection established");
      }
      _openConnectPageInBrowser(clientName) {
        const mcpRelayEndpoint = `${this._wsHost}${this._extensionPath}`;
        const url2 = new URL(`chrome-extension://${playwrightExtensionId}/connect.html`);
        url2.searchParams.set("mcpRelayUrl", mcpRelayEndpoint);
        const client = {
          name: clientName,
          // Not used anymore.
          version: void 0
        };
        url2.searchParams.set("client", JSON.stringify(client));
        url2.searchParams.set("protocolVersion", this._protocolVersion.toString());
        const token = process.env.PLAYWRIGHT_MCP_EXTENSION_TOKEN;
        if (token)
          url2.searchParams.set("token", token);
        const href = url2.toString();
        const channel = registry.isChromiumAlias(this._browserChannel) ? "chromium" : this._browserChannel;
        let executablePath = this._executablePath;
        if (!executablePath) {
          const executableInfo = registry.findExecutable(channel);
          if (!executableInfo)
            throw new Error(`Unsupported channel: "${this._browserChannel}"`);
          executablePath = executableInfo.executablePath();
          if (!executablePath)
            throw new Error(`"${this._browserChannel}" executable not found. Make sure it is installed at a standard location.`);
        }
        const args = [];
        const userDataDir = process.env.PWTEST_EXTENSION_USER_DATA_DIR;
        if (userDataDir)
          args.push(`--user-data-dir=${userDataDir}`);
        if (import_os26.default.platform() === "linux" && channel === "chromium")
          args.push("--no-sandbox");
        args.push(href);
        (0, import_child_process6.spawn)(executablePath, args, {
          windowsHide: true,
          detached: true,
          shell: false,
          stdio: "ignore"
        });
      }
      stop() {
        this._closeConnections("Server stopped");
        this._wss.close();
      }
      _closeConnections(reason) {
        this._closeCDPConnection(reason);
        this._closeExtensionConnection(reason);
      }
      _onConnection(ws4, request2) {
        const url2 = new URL(`http://localhost${request2.url}`);
        debugLogger2(`New connection to ${url2.pathname}`);
        if (url2.pathname === this._cdpPath) {
          this._handlePlaywrightConnection(ws4);
        } else if (url2.pathname === this._extensionPath) {
          this._handleExtensionConnection(ws4);
        } else {
          debugLogger2(`Invalid path: ${url2.pathname}`);
          ws4.close(4004, "Invalid path");
        }
      }
      _handlePlaywrightConnection(ws4) {
        if (!this._extensionConnection) {
          debugLogger2("Rejecting Playwright connection: extension not connected");
          ws4.close(1e3, "Extension not connected");
          return;
        }
        if (this._cdpConnection) {
          debugLogger2("Rejecting second Playwright connection");
          ws4.close(1e3, "Another CDP client already connected");
          return;
        }
        this._cdpConnection = ws4;
        this._handler.connectOverCDP((msg) => this._sendToCDPClient(msg));
        ws4.on("message", async (data) => {
          try {
            await this._handlePlaywrightMessage(JSON.parse(data.toString()));
          } catch (error) {
            debugLogger2(`Error while handling Playwright message
${data.toString()}
`, error);
          }
        });
        ws4.on("close", () => {
          this._closeExtensionConnection("Playwright client disconnected");
          debugLogger2("Playwright WebSocket closed");
        });
        ws4.on("error", (error) => {
          debugLogger2("Playwright WebSocket error:", error);
        });
        debugLogger2("Playwright MCP connected");
      }
      _closeExtensionConnection(reason) {
        this._extensionConnection?.close(reason);
        if (!this._extensionConnectionPromise.isDone())
          this._extensionConnectionPromise.reject(new Error(reason));
      }
      _closeCDPConnection(reason) {
        if (this._cdpConnection?.readyState === ws3.OPEN)
          this._cdpConnection.close(1e3, reason);
      }
      _handleExtensionConnection(ws4) {
        if (this._extensionConnection) {
          ws4.close(1e3, "Another extension connection already established");
          return;
        }
        this._extensionConnection = new ExtensionConnection(ws4);
        this._extensionConnection.onclose = (reason) => {
          debugLogger2("Extension WebSocket closed:", reason);
          this._handler.onExtensionDisconnect(reason);
          this._closeCDPConnection(`Extension disconnected: ${reason}`);
        };
        this._extensionConnection.onmessage = (method, params2) => this._handler.handleExtensionEvent(method, params2);
        this._extensionConnectionPromise.resolve();
      }
      async _handlePlaywrightMessage(message) {
        debugLogger2("\u2190 Playwright:", `${message.method} (id=${message.id})`);
        const { id, sessionId, method, params: params2 } = message;
        try {
          const result2 = await this._handleCDPCommand(method, params2, sessionId);
          this._sendToCDPClient({ id, sessionId, result: result2 });
        } catch (e) {
          debugLogger2("Error in the extension:", e);
          this._sendToCDPClient({
            id,
            sessionId,
            error: { message: e.message }
          });
        }
      }
      async _handleCDPCommand(method, params2, sessionId) {
        switch (method) {
          case "Browser.getVersion": {
            return {
              protocolVersion: "1.3",
              product: "Chrome/Extension-Bridge",
              userAgent: "CDP-Bridge-Server/1.0.0"
            };
          }
          case "Browser.setDownloadBehavior": {
            return {};
          }
        }
        const handled = await this._handler.handleCDPCommand(method, params2, sessionId);
        if (handled)
          return handled.result;
        return await this._handler.forwardToExtension(method, params2, sessionId);
      }
      _sendToCDPClient(message) {
        debugLogger2("\u2192 Playwright:", `${message.method ?? `response(id=${message.id})`}`);
        this._cdpConnection?.send(JSON.stringify(message));
      }
    };
    ExtensionConnection = class {
      constructor(ws4) {
        this._callbacks = /* @__PURE__ */ new Map();
        this._lastId = 0;
        this._ws = ws4;
        this._ws.on("message", this._onMessage.bind(this));
        this._ws.on("close", this._onClose.bind(this));
        this._ws.on("error", this._onError.bind(this));
      }
      async send(method, params2) {
        if (this._ws.readyState !== ws3.OPEN)
          throw new Error(`Unexpected WebSocket state: ${this._ws.readyState}`);
        const id = ++this._lastId;
        this._ws.send(JSON.stringify({ id, method, params: params2 }));
        const error = new Error(`Protocol error: ${method}`);
        return new Promise((resolve, reject) => {
          this._callbacks.set(id, { resolve, reject, error });
        });
      }
      close(message) {
        debugLogger2("closing extension connection:", message);
        if (this._ws.readyState === ws3.OPEN)
          this._ws.close(1e3, message);
      }
      _onMessage(event) {
        const eventData = event.toString();
        let parsedJson;
        try {
          parsedJson = JSON.parse(eventData);
        } catch (e) {
          debugLogger2(`<closing ws> Closing websocket due to malformed JSON. eventData=${eventData} e=${e?.message}`);
          this._ws.close();
          return;
        }
        try {
          this._handleParsedMessage(parsedJson);
        } catch (e) {
          debugLogger2(`<closing ws> Closing websocket due to failed onmessage callback. eventData=${eventData} e=${e?.message}`);
          this._ws.close();
        }
      }
      _handleParsedMessage(object) {
        if (object.id && this._callbacks.has(object.id)) {
          const callback = this._callbacks.get(object.id);
          this._callbacks.delete(object.id);
          if (object.error) {
            const error = callback.error;
            error.message = object.error;
            callback.reject(error);
          } else {
            callback.resolve(object.result);
          }
        } else if (object.id) {
          debugLogger2("\u2190 Extension: unexpected response", object);
        } else {
          this.onmessage?.(object.method, object.params);
        }
      }
      _onClose(event) {
        debugLogger2(`<ws closed> code=${event.code} reason=${event.reason}`);
        this._dispose();
        this.onclose?.(event.reason);
      }
      _onError(event) {
        debugLogger2(`<ws error> message=${event.message} type=${event.type} target=${event.target}`);
        this._dispose();
      }
      _dispose() {
        for (const callback of this._callbacks.values())
          callback.reject(new Error("WebSocket closed"));
        this._callbacks.clear();
      }
    };
  }
});

// packages/playwright-core/src/tools/mcp/extensionContextFactory.ts
async function createExtensionBrowser(channel, executablePath, clientName) {
  if (!executablePath) {
    const userDataDir = process.env.PWTEST_EXTENSION_USER_DATA_DIR ?? defaultUserDataDirForChannel(channel);
    if (userDataDir && !await isPlaywrightExtensionInstalled(userDataDir))
      throw new Error(`Playwright Extension not found in "${userDataDir}". Install it from ${playwrightExtensionInstallUrl}`);
  }
  const httpServer = createHttpServer();
  await startHttpServer(httpServer, {});
  const relay = new CDPRelayServer(httpServer, channel, executablePath);
  debugLogger3(`CDP relay server started, extension endpoint: ${relay.extensionEndpoint()}.`);
  try {
    await relay.establishExtensionConnection(clientName);
    return await playwright.chromium.connectOverCDP(relay.cdpEndpoint(), { isLocal: true, timeout: 0 });
  } catch (error) {
    relay.stop();
    httpServer.close();
    throw error;
  }
}
var debug16, debugLogger3;
var init_extensionContextFactory = __esm({
  "packages/playwright-core/src/tools/mcp/extensionContextFactory.ts"() {
    "use strict";
    init_network();
    init_chromiumChannels();
    init_inprocess();
    init_extension();
    init_cdpRelay();
    debug16 = require("./utilsBundle").debug;
    debugLogger3 = debug16("pw:mcp:relay");
  }
});

// packages/playwright-core/src/tools/utils/connect.ts
async function connectToBrowserAcrossVersions(descriptor) {
  const pw = require(descriptor.playwrightLib);
  const browserType = pw[descriptor.browser.browserName];
  return await browserType.connect(descriptor.endpoint ?? descriptor.pipeName);
}
var init_connect2 = __esm({
  "packages/playwright-core/src/tools/utils/connect.ts"() {
    "use strict";
  }
});

// packages/playwright-core/src/tools/mcp/browserFactory.ts
async function createBrowserWithInfo(config, clientInfo, cliOptions) {
  if (config.browser.remoteEndpoint)
    return await createRemoteBrowser(config);
  let browser;
  let canBind = false;
  let ownership = "own";
  if (config.browser.cdpEndpoint) {
    browser = await createCDPBrowser(config, clientInfo);
    canBind = true;
    ownership = "attached";
  } else if (config.browser.isolated) {
    browser = await createIsolatedBrowser(config, clientInfo);
    canBind = true;
    ownership = "own";
  } else if (config.extension) {
    const { channel, executablePath } = resolveExtensionOptions(cliOptions);
    browser = await createExtensionBrowser(channel, executablePath, clientInfo.clientName);
    ownership = "attached";
  } else {
    browser = await createPersistentBrowser(config, clientInfo);
    canBind = true;
    ownership = "own";
  }
  return { browser, browserInfo: browserInfo(browser, config), canBind, ownership };
}
function browserInfo(browser, config) {
  return {
    // eslint-disable-next-line no-restricted-syntax
    guid: browser._guid,
    browserName: config.browser.browserName,
    launchOptions: config.browser.launchOptions,
    userDataDir: config.browser.userDataDir
  };
}
async function createIsolatedBrowser(config, clientInfo) {
  testDebug2("create browser (isolated)");
  const browserType = playwright[config.browser.browserName];
  const tracesDir = await computeTracesDir(config, clientInfo);
  const browser = await browserType.launch({
    tracesDir,
    ...config.browser.launchOptions,
    handleSIGINT: false,
    handleSIGTERM: false
  }).catch((error) => {
    throwIfExecutableMissing(error, config);
    throw error;
  });
  return browser;
}
async function createCDPBrowser(config, clientInfo) {
  testDebug2("create browser (cdp)");
  const artifactsDir = await computeTracesDir(config, clientInfo);
  const browser = await playwright.chromium.connectOverCDP(config.browser.cdpEndpoint, {
    headers: config.browser.cdpHeaders,
    timeout: config.browser.cdpTimeout,
    artifactsDir
  });
  return browser;
}
async function createRemoteBrowser(config) {
  testDebug2("create browser (remote)");
  const remote = config.browser.remoteEndpoint;
  const remoteHeaders = config.browser.remoteHeaders;
  const remoteOptions = typeof remote === "string" ? { endpoint: remote, headers: remoteHeaders } : { ...remote, headers: { ...remoteHeaders, ...remote.headers } };
  const descriptor = await serverRegistry.find(remoteOptions.endpoint);
  if (descriptor) {
    const browser2 = await connectToBrowserAcrossVersions(descriptor);
    return {
      browser: browser2,
      browserInfo: {
        guid: descriptor.browser.guid,
        browserName: descriptor.browser.browserName,
        launchOptions: descriptor.browser.launchOptions,
        userDataDir: descriptor.browser.userDataDir
      },
      canBind: false,
      ownership: "attached"
    };
  }
  const playwrightObject = playwright;
  const browser = await connectToBrowser(playwrightObject, remoteOptions);
  browser._connectToBrowserType(playwrightObject[browser._browserName], {}, void 0);
  if (!browser.contexts().length)
    await browser.newContext(config.browser.contextOptions);
  return { browser, browserInfo: browserInfo(browser, config), canBind: false, ownership: "attached" };
}
async function createPersistentBrowser(config, clientInfo) {
  testDebug2("create browser (persistent)");
  const userDataDir = config.browser.userDataDir ?? await createUserDataDir(config, clientInfo);
  const tracesDir = await computeTracesDir(config, clientInfo);
  if (await isProfileLocked5Times(userDataDir))
    throw new Error(`Browser is already in use for ${userDataDir}, use --isolated to run multiple instances of the same browser`);
  const browserType = playwright[config.browser.browserName];
  const configIgnoreDefaultArgs = config.browser.launchOptions?.ignoreDefaultArgs;
  const launchOptions = {
    tracesDir,
    ...config.browser.launchOptions,
    ...config.browser.contextOptions,
    handleSIGINT: false,
    handleSIGTERM: false,
    ignoreDefaultArgs: configIgnoreDefaultArgs === true ? true : [
      "--disable-extensions",
      ...Array.isArray(configIgnoreDefaultArgs) ? configIgnoreDefaultArgs : []
    ]
  };
  try {
    const browserContext = await browserType.launchPersistentContext(userDataDir, launchOptions);
    const browser = browserContext.browser();
    return browser;
  } catch (error) {
    throwIfExecutableMissing(error, config);
    if (error.message.includes("cannot open shared object file: No such file or directory")) {
      const browserName = launchOptions.channel ?? config.browser.browserName;
      throw new Error(`Missing system dependencies required to run browser ${browserName}. Install them with: sudo npx playwright install-deps ${browserName}`);
    }
    if (error.message.includes("ProcessSingleton") || error.message.includes("exitCode=21"))
      throw new Error(`Browser is already in use for ${userDataDir}, use --isolated to run multiple instances of the same browser`);
    throw error;
  }
}
async function createUserDataDir(config, clientInfo) {
  const dir = process.env.PWMCP_PROFILES_DIR_FOR_TEST ?? import_path54.default.join(defaultCacheDirectory, "ms-playwright-mcp");
  const browserToken = config.browser.launchOptions?.channel ?? config.browser?.browserName;
  const rootPathToken = createHash(clientInfo.cwd);
  const result2 = import_path54.default.join(dir, `mcp-${browserToken}-${rootPathToken}`);
  await import_fs56.default.promises.mkdir(result2, { recursive: true });
  return result2;
}
function createHash(data) {
  return import_crypto28.default.createHash("sha256").update(data).digest("hex").slice(0, 7);
}
async function computeTracesDir(config, clientInfo) {
  return import_path54.default.resolve(outputDir({ config, cwd: clientInfo.cwd }), "traces");
}
async function isProfileLocked5Times(userDataDir) {
  for (let i = 0; i < 5; i++) {
    if (!isProfileLocked(userDataDir))
      return false;
    await new Promise((f) => setTimeout(f, 1e3));
  }
  return true;
}
function isProfileLocked(userDataDir) {
  const lockFile = process.platform === "win32" ? "lockfile" : "SingletonLock";
  const lockPath = import_path54.default.join(userDataDir, lockFile);
  if (process.platform === "win32") {
    try {
      const fd = import_fs56.default.openSync(lockPath, "r+");
      import_fs56.default.closeSync(fd);
      return false;
    } catch (e) {
      return e.code !== "ENOENT";
    }
  }
  try {
    const target = import_fs56.default.readlinkSync(lockPath);
    const pid = parseInt(target.split("-").pop() || "", 10);
    if (isNaN(pid))
      return false;
    process.kill(pid, 0);
    return true;
  } catch {
    return false;
  }
}
function throwIfExecutableMissing(error, config) {
  if (!error.message.includes(`Executable doesn't exist`))
    return;
  const target = error.message.includes("ffmpeg") ? "ffmpeg" : config.browser.launchOptions?.channel ?? config.browser.browserName;
  const label = target === "ffmpeg" ? "FFmpeg" : `Browser "${target}"`;
  if (config.skillMode)
    throw new Error(`${label} is not installed. Run \`playwright-cli install-browser ${target}\` to install`);
  throw new Error(`${label} is not installed. Run \`npx @playwright/mcp install-browser ${target}\` to install`);
}
var import_crypto28, import_fs56, import_path54;
var init_browserFactory = __esm({
  "packages/playwright-core/src/tools/mcp/browserFactory.ts"() {
    "use strict";
    import_crypto28 = __toESM(require("crypto"));
    import_fs56 = __toESM(require("fs"));
    import_path54 = __toESM(require("path"));
    init_inprocess();
    init_registry();
    init_log();
    init_context();
    init_extensionContextFactory();
    init_connect2();
    init_serverRegistry();
    init_config2();
    init_connect();
  }
});

// packages/playwright-core/src/tools/mcp/index.ts
async function createConnection(userConfig = {}, contextGetter) {
  const config = await resolveConfig(userConfig);
  const tools = filteredTools(config);
  const backendFactory = {
    name: "api",
    nameInConfig: "api",
    version: packageJSON.version,
    toolSchemas: tools.map((tool) => tool.schema),
    create: async (clientInfo) => {
      const browser = contextGetter ? new SimpleBrowser(await contextGetter()) : (await createBrowserWithInfo(config, clientInfo, {})).browser;
      const context2 = config.browser.isolated ? await browser.newContext(config.browser.contextOptions) : browser.contexts()[0];
      return new BrowserBackend(config, context2, tools);
    },
    disposed: async () => {
    }
  };
  return createServer("api", packageJSON.version, backendFactory, false);
}
var SimpleBrowser;
var init_mcp = __esm({
  "packages/playwright-core/src/tools/mcp/index.ts"() {
    "use strict";
    init_config2();
    init_tools();
    init_browserFactory();
    init_browserBackend();
    init_server2();
    init_package();
    SimpleBrowser = class {
      constructor(context2) {
        this._context = context2;
      }
      contexts() {
        return [this._context];
      }
      async newContext() {
        throw new Error("Creating a new context is not supported in SimpleBrowserContextFactory.");
      }
    };
  }
});

// packages/playwright-core/src/tools/mcp/program.ts
function decorateMCPCommand(command) {
  command.option("--allowed-hosts <hosts...>", "comma-separated list of hosts this server is allowed to serve from. Defaults to the host the server is bound to. Pass '*' to disable the host check.", commaSeparatedList).option("--allowed-origins <origins>", "semicolon-separated list of TRUSTED origins to allow the browser to request. Default is to allow all.\nImportant: *does not* serve as a security boundary and *does not* affect redirects. ", semicolonSeparatedList).option("--allow-unrestricted-file-access", "allow access to files outside of the workspace roots. Also allows unrestricted access to file:// URLs. By default access to file system is restricted to workspace root directories (or cwd if no roots are configured) only, and navigation to file:// URLs is blocked.").option("--blocked-origins <origins>", "semicolon-separated list of origins to block the browser from requesting. Blocklist is evaluated before allowlist. If used without the allowlist, requests not matching the blocklist are still allowed.\nImportant: *does not* serve as a security boundary and *does not* affect redirects.", semicolonSeparatedList).option("--block-service-workers", "block service workers").option("--browser <browser>", "browser or chrome channel to use, possible values: chrome, firefox, webkit, msedge.").option("--caps <caps>", "comma-separated list of additional capabilities to enable, possible values: vision, pdf, devtools.", commaSeparatedList).option("--cdp-endpoint <endpoint>", "CDP endpoint to connect to.").option("--cdp-header <headers...>", "CDP headers to send with the connect request, multiple can be specified.", headerParser).option("--cdp-timeout <timeout>", "timeout in milliseconds for connecting to CDP endpoint, defaults to 30000ms", numberParser).option("--codegen <lang>", 'specify the language to use for code generation, possible values: "typescript", "none". Default is "typescript".', enumParser.bind(null, "--codegen", ["none", "typescript"])).option("--config <path>", "path to the configuration file.").option("--console-level <level>", 'level of console messages to return: "error", "warning", "info", "debug". Each level includes the messages of more severe levels.', enumParser.bind(null, "--console-level", ["error", "warning", "info", "debug"])).option("--device <device>", 'device to emulate, for example: "iPhone 15"').option("--executable-path <path>", "path to the browser executable.").option("--extension", 'Connect to a running browser instance (Edge/Chrome only). Requires the "Playwright Extension" to be installed.').option("--endpoint <endpoint>", "Bound browser endpoint to connect to.").option("--grant-permissions <permissions...>", 'List of permissions to grant to the browser context, for example "geolocation", "clipboard-read", "clipboard-write".', commaSeparatedList).option("--headless", "run browser in headless mode, headed by default").option("--host <host>", "host to bind server to. Default is localhost. Use 0.0.0.0 to bind to all interfaces.").option("--ignore-https-errors", "ignore https errors").option("--init-page <path...>", "path to TypeScript file to evaluate on Playwright page object").option("--init-script <path...>", "path to JavaScript file to add as an initialization script. The script will be evaluated in every page before any of the page's scripts. Can be specified multiple times.").option("--isolated", "keep the browser profile in memory, do not save it to disk.").option("--image-responses <mode>", 'whether to send image responses to the client. Can be "allow" or "omit", Defaults to "allow".', enumParser.bind(null, "--image-responses", ["allow", "omit"])).option("--no-sandbox", "disable the sandbox for all process types that are normally sandboxed.").option("--output-dir <path>", "path to the directory for output files.").option("--output-max-size <bytes>", "Threshold for evicting old output files, in bytes.", numberParser).option("--output-mode <mode>", 'whether to save snapshots, console messages, network logs to a file or to the standard output. Can be "file" or "stdout". Default is "stdout".', enumParser.bind(null, "--output-mode", ["file", "stdout"])).option("--port <port>", "port to listen on for SSE transport.").option("--proxy-bypass <bypass>", 'comma-separated domains to bypass proxy, for example ".com,chromium.org,.domain.com"').option("--proxy-server <proxy>", 'specify proxy server, for example "http://myproxy:3128" or "socks5://myproxy:8080"').addOption(new ProgramOption("--remote-header <headers...>", "headers to send with the remote endpoint connect request, multiple can be specified.").argParser(headerParser).hideHelp()).option("--sandbox", "enable the sandbox for all process types that are normally not sandboxed.").option("--save-session", "Whether to save the Playwright MCP session into the output directory.").option("--secrets <path>", "path to a file containing secrets in the dotenv format", dotenvFileLoader).option("--shared-browser-context", "reuse the same browser context between all connected HTTP clients.").option("--snapshot-mode <mode>", 'when taking snapshots for responses, specifies the mode to use. Can be "full" or "none". Default is "full".').option("--storage-state <path>", "path to the storage state file for isolated sessions.").option("--test-id-attribute <attribute>", 'specify the attribute to use for test ids, defaults to "data-testid"').option("--timeout-action <timeout>", "specify action timeout in milliseconds, defaults to 5000ms", numberParser).option("--timeout-navigation <timeout>", "specify navigation timeout in milliseconds, defaults to 60000ms", numberParser).option("--user-agent <ua string>", "specify user agent string").option("--user-data-dir <path>", "path to the user data directory. If not specified, a temporary directory will be created.").option("--viewport-size <size>", 'specify browser viewport size in pixels, for example "1280x720"', resolutionParser.bind(null, "--viewport-size")).addOption(new ProgramOption("--vision", "Legacy option, use --caps=vision instead").hideHelp()).action(async (options) => {
    options.sandbox = options.sandbox === true ? void 0 : false;
    setupExitWatchdog();
    if (options.vision) {
      console.error("The --vision option is deprecated, use --caps=vision instead");
      options.caps ??= [];
      options.caps.push("vision");
    }
    if (options.caps?.includes("tracing"))
      options.caps.push("devtools");
    const config = await resolveCLIConfigForMCP(options);
    const tools = filteredTools(config);
    const useSharedBrowser = config.sharedBrowserContext || config.browser.isolated;
    let sharedBrowserPromise;
    let clientCount = 0;
    const clientNameCounters = /* @__PURE__ */ new Map();
    const factory = {
      name: "Playwright",
      nameInConfig: "playwright",
      version: version2,
      toolSchemas: tools.map((tool) => tool.schema),
      create: async (clientInfo) => {
        if (useSharedBrowser && !sharedBrowserPromise) {
          sharedBrowserPromise = (async () => {
            const { browser: browser2, canBind: canBind2 } = await createBrowserWithInfo(config, clientInfo, options);
            if (canBind2)
              await browser2.bind(clientInfo.clientName, { workspaceDir: clientInfo.cwd });
            return browser2;
          })().catch((error) => {
            sharedBrowserPromise = void 0;
            throw error;
          });
        }
        clientCount++;
        const { browser, canBind } = sharedBrowserPromise ? { browser: await sharedBrowserPromise, canBind: false } : await createBrowserWithInfo(config, clientInfo, options);
        if (canBind) {
          const count = (clientNameCounters.get(clientInfo.clientName) ?? 0) + 1;
          clientNameCounters.set(clientInfo.clientName, count);
          const sessionName = count > 1 ? `${clientInfo.clientName} (${count})` : clientInfo.clientName;
          await browser.bind(sessionName, { workspaceDir: clientInfo.cwd });
        }
        const browserContext = config.browser.isolated ? await browser.newContext(config.browser.contextOptions) : browser.contexts()[0];
        return new BrowserBackend(config, browserContext, tools);
      },
      disposed: async (backend) => {
        clientCount--;
        if (sharedBrowserPromise && clientCount > 0)
          return;
        testDebug2("close browser");
        sharedBrowserPromise = void 0;
        const browserContext = backend.browserContext;
        await browserContext.close().catch(() => {
        });
        await browserContext.browser()?.close().catch(() => {
        });
      }
    };
    await start2(factory, config.server);
  });
}
var ProgramOption, version2;
var init_program3 = __esm({
  "packages/playwright-core/src/tools/mcp/program.ts"() {
    "use strict";
    init_server2();
    init_config2();
    init_watchdog();
    init_browserFactory();
    init_browserBackend();
    init_tools();
    init_log();
    init_package();
    ({ ProgramOption } = require("./utilsBundle"));
    version2 = packageJSON.version;
  }
});

// packages/playwright-core/src/tools/cli-daemon/helpGenerator.ts
function commandArgs(command) {
  const args = [];
  const shape = command.args ? command.args.shape : {};
  for (const [name, schema] of Object.entries(shape)) {
    const zodSchema = schema;
    const description = zodSchema.description ?? "";
    args.push({ name, description, optional: zodSchema.safeParse(void 0).success });
  }
  return args;
}
function commandArgsText(args) {
  return args.map((a) => a.optional ? `[${a.name}]` : `<${a.name}>`).join(" ");
}
function generateCommandHelp(command) {
  const args = commandArgs(command);
  const lines = [
    `playwright-cli ${command.name} ${commandArgsText(args)}`,
    "",
    command.description,
    ""
  ];
  if (args.length) {
    lines.push("Arguments:");
    lines.push(...args.map((a) => formatWithGap(`  ${a.optional ? `[${a.name}]` : `<${a.name}>`}`, a.description.toLowerCase())));
  }
  if (command.options) {
    lines.push("Options:");
    const optionsShape = command.options.shape;
    for (const [name, schema] of Object.entries(optionsShape)) {
      const zodSchema = schema;
      const description = (zodSchema.description ?? "").toLowerCase();
      lines.push(formatWithGap(`  --${name}`, description));
    }
  }
  return lines.join("\n");
}
function generateHelp() {
  const lines = [];
  lines.push("Usage: playwright-cli <command> [args] [options]");
  lines.push("Usage: playwright-cli -s=<session> <command> [args] [options]");
  const commandsByCategory = /* @__PURE__ */ new Map();
  for (const c of categories)
    commandsByCategory.set(c.name, []);
  for (const command of Object.values(commands)) {
    if (command.hidden)
      continue;
    commandsByCategory.get(command.category).push(command);
  }
  for (const c of categories) {
    const cc = commandsByCategory.get(c.name);
    if (!cc.length)
      continue;
    lines.push(`
${c.title}:`);
    for (const command of cc)
      lines.push(generateHelpEntry(command));
  }
  lines.push("\nGlobal options:");
  lines.push(formatWithGap("  --help [command]", "print help"));
  lines.push(formatWithGap("  --json", "output response as JSON"));
  lines.push(formatWithGap("  --raw", "output only the result value, without status and code"));
  lines.push(formatWithGap("  --version", "print version"));
  return lines.join("\n");
}
function generateHelpEntry(command) {
  const args = commandArgs(command);
  const prefix = `  ${command.name} ${commandArgsText(args)}`;
  const suffix = command.description.toLowerCase();
  return formatWithGap(prefix, suffix);
}
function unwrapZodType(schema) {
  if ("unwrap" in schema && typeof schema.unwrap === "function")
    return unwrapZodType(schema.unwrap());
  return schema;
}
function isBooleanSchema(schema) {
  return unwrapZodType(schema) instanceof z30.ZodBoolean;
}
function generateHelpJSON() {
  const booleanOptions2 = /* @__PURE__ */ new Set();
  const commandEntries = {};
  for (const [name, command] of Object.entries(commands)) {
    const flags = {};
    if (command.options) {
      const optionsShape = command.options.shape;
      for (const [flagName, schema] of Object.entries(optionsShape)) {
        const isBoolean = isBooleanSchema(schema);
        flags[flagName] = isBoolean ? "boolean" : "string";
        if (isBoolean)
          booleanOptions2.add(flagName);
      }
    }
    const args = command.args ? Object.keys(command.args.shape) : [];
    commandEntries[name] = { help: generateCommandHelp(command), flags, args };
    if (command.raw)
      commandEntries[name].raw = true;
  }
  return {
    global: generateHelp(),
    commands: commandEntries,
    booleanOptions: [...booleanOptions2]
  };
}
function formatWithGap(prefix, text2, threshold = 30) {
  const indent = Math.max(1, threshold - prefix.length);
  return prefix + " ".repeat(indent) + text2;
}
var z30, categories;
var init_helpGenerator = __esm({
  "packages/playwright-core/src/tools/cli-daemon/helpGenerator.ts"() {
    "use strict";
    init_commands();
    z30 = require("./utilsBundle").z;
    categories = [
      { name: "core", title: "Core" },
      { name: "navigation", title: "Navigation" },
      { name: "keyboard", title: "Keyboard" },
      { name: "mouse", title: "Mouse" },
      { name: "export", title: "Save as" },
      { name: "tabs", title: "Tabs" },
      { name: "storage", title: "Storage" },
      { name: "network", title: "Network" },
      { name: "devtools", title: "DevTools" },
      { name: "install", title: "Install" },
      { name: "config", title: "Configuration" },
      { name: "browsers", title: "Browser sessions" }
    ];
  }
});

// packages/playwright-core/src/tools/cli-daemon/daemon.ts
async function socketExists(socketPath) {
  try {
    const stat = await import_fs57.default.promises.stat(socketPath);
    if (stat?.isSocket())
      return true;
  } catch (e) {
  }
  return false;
}
async function startCliDaemonServer(sessionName, browserContext, browserInfo2, contextConfig, clientInfo, mcpClientInfo, options) {
  const sessionConfig = createSessionConfig(clientInfo, sessionName, browserInfo2, options);
  const { socketPath } = sessionConfig;
  if (process.platform !== "win32" && await socketExists(socketPath)) {
    try {
      await import_fs57.default.promises.unlink(socketPath);
    } catch (error) {
      throw error;
    }
  }
  const backend = new BrowserBackend(contextConfig, browserContext, browserTools);
  await backend.initialize(mcpClientInfo);
  if (browserContext.isClosed())
    throw new Error("Browser context was closed before the daemon could start");
  const server = import_net10.default.createServer((socket) => {
    const connection = new SocketConnection(socket);
    const abortController = new AbortController();
    connection.onclose = () => abortController.abort();
    connection.onmessage = async (message) => {
      const { id, method, params: params2 } = message;
      try {
        if (method === "stop") {
          await deleteSessionFile(clientInfo, sessionConfig);
          const sendAck = async () => connection.send({ id, result: "ok" }).catch(() => {
          });
          if (options?.exitOnClose)
            gracefullyProcessExitDoNotHang(0, () => sendAck());
          else
            await sendAck();
        } else if (method === "run") {
          const { toolName, toolParams } = parseCliCommand(params2.args);
          toolParams._meta = { cwd: params2.cwd, raw: params2.raw || params2.json, json: !!params2.json };
          const response2 = await backend.callTool(toolName, toolParams, abortController.signal);
          await connection.send({ id, result: formatResult(response2) });
        } else {
          throw new Error(`Unknown method: ${method}`);
        }
      } catch (e) {
        const error = process.env.PWDEBUGIMPL ? e.stack || e.message : e.message;
        connection.send({ id, error }).catch(() => {
        });
      }
    };
  });
  decorateServer(server);
  browserContext.on("close", () => Promise.resolve().then(async () => {
    await deleteSessionFile(clientInfo, sessionConfig);
    if (options?.exitOnClose)
      gracefullyProcessExitDoNotHang(0);
  }));
  await new Promise((resolve, reject) => {
    server.on("error", reject);
    server.listen(socketPath, () => resolve());
  });
  await saveSessionFile(clientInfo, sessionConfig);
  return socketPath;
}
async function saveSessionFile(clientInfo, sessionConfig) {
  await import_fs57.default.promises.mkdir(clientInfo.daemonProfilesDir, { recursive: true });
  const sessionFile = import_path55.default.join(clientInfo.daemonProfilesDir, `${sessionConfig.name}.session`);
  await import_fs57.default.promises.writeFile(sessionFile, JSON.stringify(sessionConfig, null, 2));
}
async function deleteSessionFile(clientInfo, sessionConfig) {
  await import_fs57.default.promises.unlink(sessionConfig.socketPath).catch(() => {
  });
  if (!sessionConfig.cli.persistent) {
    const sessionFile = import_path55.default.join(clientInfo.daemonProfilesDir, `${sessionConfig.name}.session`);
    await import_fs57.default.promises.rm(sessionFile).catch(() => {
    });
  }
}
function formatResult(result2) {
  const isError4 = result2.isError;
  const text2 = result2.content[0].type === "text" ? result2.content[0].text : void 0;
  return { isError: isError4, text: text2 };
}
function parseCliCommand(args) {
  const command = commands[args._[0]];
  if (!command)
    throw new Error("Command is required");
  return parseCommand(command, args);
}
function daemonSocketPath(clientInfo, sessionName) {
  return makeSocketPath("cli", `${clientInfo.workspaceDirHash}-${sessionName}`);
}
function createSessionConfig(clientInfo, sessionName, browserInfo2, options = {}) {
  return {
    name: sessionName,
    version: clientInfo.version,
    timestamp: Date.now(),
    socketPath: daemonSocketPath(clientInfo, sessionName),
    workspaceDir: clientInfo.workspaceDir,
    attached: options.ownership === "attached" ? true : void 0,
    cli: { persistent: options.persistent },
    browser: {
      browserName: browserInfo2.browserName,
      launchOptions: browserInfo2.launchOptions,
      userDataDir: browserInfo2.userDataDir
    }
  };
}
var import_fs57, import_net10, import_path55;
var init_daemon = __esm({
  "packages/playwright-core/src/tools/cli-daemon/daemon.ts"() {
    "use strict";
    import_fs57 = __toESM(require("fs"));
    import_net10 = __toESM(require("net"));
    import_path55 = __toESM(require("path"));
    init_network();
    init_fileUtils();
    init_processLauncher();
    init_browserBackend();
    init_tools();
    init_command();
    init_commands();
    init_socketConnection();
  }
});

// packages/playwright-core/src/tools/cli-daemon/program.ts
function decorateProgram3(program4) {
  program4.argument("[session-name]", "name of the session to create or connect to", "default").option("--headed", "run in headed mode (non-headless)").option("--extension", "run with the extension").option("--browser <name>", "browser to use (chromium, chrome, firefox, webkit)").option("--persistent", "use a persistent browser context").option("--profile <path>", "path to the user data dir").option("--config <path>", "path to the config file; by default uses .playwright/cli.config.json in the project directory and ~/.playwright/cli.config.json as global config").option("--cdp <url>", "connect to an existing browser via CDP endpoint URL").option("--endpoint <endpoint>", "attach to a running Playwright browser endpoint").option("--init-workspace", "initialize workspace").option("--init-skills <value>", 'install skills for the given agent type ("claude" or "agents")').action(async (sessionName, options) => {
    if (options.initWorkspace) {
      await initWorkspace(options.initSkills);
      return;
    }
    setupExitWatchdog();
    const clientInfo = createClientInfo();
    const mcpConfig = await resolveCLIConfigForCLI(clientInfo.daemonProfilesDir, sessionName, options);
    const mcpClientInfo = {
      cwd: process.cwd(),
      clientName: guessClientName()
    };
    try {
      const { browser, browserInfo: browserInfo2, canBind, ownership } = await createBrowserWithInfo(mcpConfig, mcpClientInfo, options);
      if (canBind)
        await browser.bind(sessionName, { workspaceDir: clientInfo.workspaceDir });
      const browserContext = mcpConfig.browser.isolated ? await browser.newContext(mcpConfig.browser.contextOptions) : browser.contexts()[0];
      if (!browserContext)
        throw new Error("Error: unable to connect to a browser that does not have any contexts");
      const persistent = options.persistent || options.profile || mcpConfig.browser.userDataDir ? true : void 0;
      const socketPath = await startCliDaemonServer(sessionName, browserContext, browserInfo2, mcpConfig, clientInfo, mcpClientInfo, { persistent, exitOnClose: true, ownership });
      console.log(`Daemon listening on ${socketPath}
`);
    } catch (error) {
      console.log(error);
      gracefullyProcessExitDoNotHang(1);
    }
  });
}
function defaultConfigFile() {
  return import_path56.default.resolve(".playwright", "cli.config.json");
}
function globalConfigFile() {
  return import_path56.default.join(process.env["PWTEST_CLI_GLOBAL_CONFIG"] ?? import_os27.default.homedir(), ".playwright", "cli.config.json");
}
async function initWorkspace(initSkills) {
  const cwd = process.cwd();
  const playwrightDir = import_path56.default.join(cwd, ".playwright");
  await import_fs58.default.promises.mkdir(playwrightDir, { recursive: true });
  console.log(`\u2705 Workspace initialized at \`${cwd}\`.`);
  if (initSkills) {
    const skillSourceDir = libPath("tools", "cli-client", "skill");
    const target = initSkills === "agents" ? "agents" : "claude";
    const skillDestDir = import_path56.default.join(cwd, `.${target}`, "skills", "playwright-cli");
    if (!import_fs58.default.existsSync(skillSourceDir)) {
      console.error("\u274C Skills source directory not found:", skillSourceDir);
      process.exit(1);
    }
    await import_fs58.default.promises.cp(skillSourceDir, skillDestDir, { recursive: true });
    console.log(`\u2705 Skills installed to \`${import_path56.default.relative(cwd, skillDestDir)}\`.`);
  }
  await ensureConfiguredBrowserInstalled();
}
async function ensureConfiguredBrowserInstalled() {
  if (getAsBooleanFromENV("PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD"))
    return;
  if (import_fs58.default.existsSync(defaultConfigFile()) || import_fs58.default.existsSync(globalConfigFile())) {
    const clientInfo = createClientInfo();
    const config = await resolveCLIConfigForCLI(clientInfo.daemonProfilesDir, "default", {});
    const browserName = config.browser.browserName;
    const channel = config.browser.launchOptions.channel;
    if (!channel || channel.startsWith("chromium"))
      await resolveAndInstall(channel ?? browserName);
  } else {
    const channel = await findOrInstallDefaultBrowser();
    if (channel !== "chrome")
      await createDefaultConfig(channel);
  }
}
async function findOrInstallDefaultBrowser() {
  const channels = ["chrome", "msedge"];
  for (const channel of channels) {
    const executable = registry.findExecutable(channel);
    if (!executable?.executablePath())
      continue;
    await resolveAndInstall("ffmpeg");
    console.log(`\u2705 Found ${channel}, will use it as the default browser.`);
    return channel;
  }
  await resolveAndInstall("chromium");
  return "chromium";
}
async function resolveAndInstall(nameOrChannel) {
  const executables = registry.resolveBrowsers([nameOrChannel], { shell: "no" });
  await registry.install(executables);
}
async function createDefaultConfig(channel) {
  const config = {
    browser: {
      browserName: "chromium",
      launchOptions: { channel }
    }
  };
  await import_fs58.default.promises.writeFile(defaultConfigFile(), JSON.stringify(config, null, 2));
  console.log(`\u2705 Created default config for ${channel} at ${import_path56.default.relative(process.cwd(), defaultConfigFile())}.`);
}
var import_fs58, import_os27, import_path56;
var init_program4 = __esm({
  "packages/playwright-core/src/tools/cli-daemon/program.ts"() {
    "use strict";
    import_fs58 = __toESM(require("fs"));
    import_os27 = __toESM(require("os"));
    import_path56 = __toESM(require("path"));
    init_env();
    init_processLauncher();
    init_package();
    init_daemon();
    init_watchdog();
    init_browserFactory();
    init_config2();
    init_registry2();
    init_registry();
  }
});

// packages/playwright-core/src/tools/dashboard/sessionProvider.ts
var SessionProviderEvent;
var init_sessionProvider = __esm({
  "packages/playwright-core/src/tools/dashboard/sessionProvider.ts"() {
    "use strict";
    SessionProviderEvent = {
      SessionsChanged: "sessionsChanged",
      TabsChanged: "tabsChanged",
      ContextClosed: "contextClosed",
      AttachRequested: "attachRequested"
    };
  }
});

// packages/playwright-core/src/tools/dashboard/dashboardController.ts
function browserId(browser) {
  return browser._guid;
}
function pageId(p) {
  return p._guid;
}
function contextId(c) {
  return c._guid;
}
async function faviconUrl(page) {
  const url2 = page.evaluate(async () => {
    const response2 = await fetch(document.querySelector('link[rel~="icon"]')?.href ?? "/favicon.ico");
    if (!response2.ok)
      return void 0;
    const blob = await response2.blob();
    if (!blob.type.startsWith("image/"))
      return void 0;
    return await new Promise((resolve, reject) => {
      const reader = new FileReader();
      reader.onloadend = () => resolve(reader.result);
      reader.onerror = reject;
      reader.readAsDataURL(blob);
    });
  }).catch(() => void 0);
  const timeout = new Promise((resolve) => setTimeout(() => resolve(void 0), 3e3));
  return await Promise.race([url2, timeout]);
}
var import_path57, import_os28, import_fs59, import_crypto29, import_child_process7, DashboardConnection, AttachedPage;
var init_dashboardController = __esm({
  "packages/playwright-core/src/tools/dashboard/dashboardController.ts"() {
    "use strict";
    import_path57 = __toESM(require("path"));
    import_os28 = __toESM(require("os"));
    import_fs59 = __toESM(require("fs"));
    import_crypto29 = __toESM(require("crypto"));
    import_child_process7 = require("child_process");
    init_manualPromise();
    init_eventsHelper();
    init_registry2();
    init_sessionProvider();
    DashboardConnection = class {
      constructor(provider, onclose, onconnected) {
        this._pushTabsScheduled = false;
        this._visible = true;
        this._streams = /* @__PURE__ */ new Map();
        this._provider = provider;
        this._onclose = onclose;
        this._onconnected = onconnected;
        this._recordingDir = import_fs59.default.mkdtempSync(import_path57.default.join(import_os28.default.tmpdir(), "playwright-recordings-"));
      }
      onconnect() {
        this._provider.on(SessionProviderEvent.SessionsChanged, () => {
          this._pushSessions();
          void this._tryRevealPending();
        });
        this._provider.on(SessionProviderEvent.TabsChanged, () => {
          this._pushTabs();
          void this._tryRevealPending();
        });
        this._provider.on(SessionProviderEvent.ContextClosed, (context2) => {
          if (this._attachedPage?.page.context() === context2) {
            this._attachedPage.dispose();
            this._attachedPage = void 0;
          }
        });
        this._provider.on(SessionProviderEvent.AttachRequested, (page) => {
          void this._switchAttachedTo(page);
        });
        this._provider.start();
        this._onconnected?.();
      }
      onclose() {
        this._provider.dispose();
        this._attachedPage?.dispose();
        this._attachedPage = void 0;
        this._pendingReveal?.done.reject(new Error("Dashboard connection closed"));
        this._pendingReveal = void 0;
        this._resolvePendingAnnotate({ type: "cancelled" });
        for (const stream3 of this._streams.values()) {
          void stream3.handle.close().catch(() => {
          }).then(() => import_fs59.default.promises.unlink(stream3.path)).catch(() => {
          });
        }
        this._streams.clear();
        void import_fs59.default.promises.rm(this._recordingDir, { recursive: true, force: true }).catch(() => {
        });
        this._onclose();
      }
      async dispatch(method, params2) {
        const handler = this[method];
        if (typeof handler === "function")
          return handler.call(this, params2);
        const attached = this._attachedPage;
        if (!attached)
          return;
        const onAtt = attached[method];
        if (typeof onAtt === "function")
          return onAtt.call(attached, params2);
      }
      async selectTab(params2) {
        const page = this._provider.findPage(params2);
        if (page)
          await this._switchAttachedTo(page);
        this._pushTabs();
      }
      async newTab(params2) {
        const context2 = this._provider.findContext(params2);
        if (!context2)
          return;
        const page = await context2.newPage();
        await this._switchAttachedTo(page);
        this._pushTabs();
      }
      async closeTab(params2) {
        const page = this._provider.findPage(params2);
        await page?.close({ reason: "Closed in Dashboard" });
      }
      async closeSession(params2) {
        await this._provider.closeSession(params2.browser);
      }
      async setVisible(params2) {
        if (this._visible === params2.visible)
          return;
        this._visible = params2.visible;
        await this._attachedPage?.setScreencastActive(params2.visible);
      }
      revealSession(sessionName, workspaceDir) {
        const existing = this._pendingReveal;
        if (existing && existing.pageId === void 0 && existing.sessionName === sessionName && existing.workspaceDir === workspaceDir)
          return existing.done;
        existing?.done.reject(new Error("Reveal superseded"));
        const done = new ManualPromise();
        this._pendingReveal = { sessionName, workspaceDir, done };
        void this._tryRevealPending();
        return done;
      }
      revealPage(pageId4) {
        const existing = this._pendingReveal;
        if (existing && existing.pageId === pageId4)
          return existing.done;
        existing?.done.reject(new Error("Reveal superseded"));
        const done = new ManualPromise();
        this._pendingReveal = { pageId: pageId4, done };
        void this._tryRevealPending();
        return done;
      }
      async _tryRevealPending() {
        const pending = this._pendingReveal;
        if (!pending)
          return;
        const allPages = this._provider.contextEntries().flatMap((e) => e.context.pages().map((page2) => ({ entry: e, page: page2 })));
        let page;
        if (pending.pageId !== void 0) {
          page = allPages.find(({ page: p }) => pageId(p) === pending.pageId)?.page;
        } else if (pending.sessionName !== void 0) {
          page = allPages.find(({ entry }) => entry.descriptor.title === pending.sessionName && (pending.workspaceDir === void 0 || entry.descriptor.workspaceDir === pending.workspaceDir))?.page;
        }
        if (!page)
          return;
        this._pendingReveal = void 0;
        try {
          await this._switchAttachedTo(page);
          this._pushTabs();
          pending.done.resolve();
        } catch (e) {
          pending.done.reject(e instanceof Error ? e : new Error(String(e)));
          throw e;
        }
      }
      async submitAnnotation(params2) {
        this._resolvePendingAnnotate({ type: "submitted", frames: params2.frames, feedback: params2.feedback });
      }
      async cancelAnnotation() {
        this._resolvePendingAnnotate({ type: "cancelled" });
      }
      async reveal(params2) {
        switch (import_os28.default.platform()) {
          case "darwin":
            (0, import_child_process7.execFile)("open", ["-R", params2.path]);
            break;
          case "win32":
            (0, import_child_process7.execFile)("explorer", ["/select,", params2.path]);
            break;
          case "linux":
            (0, import_child_process7.execFile)("xdg-open", [import_path57.default.dirname(params2.path)]);
            break;
        }
      }
      async readStream(params2) {
        const stream3 = this._streams.get(params2.streamId);
        if (!stream3)
          throw new Error(`Unknown stream: ${params2.streamId}`);
        const buffer = Buffer.alloc(256 * 1024);
        const { bytesRead } = await stream3.handle.read(buffer, 0, buffer.length);
        if (bytesRead === 0) {
          this._streams.delete(params2.streamId);
          await stream3.handle.close().catch(() => {
          });
          await import_fs59.default.promises.unlink(stream3.path).catch(() => {
          });
          return { data: "", eof: true };
        }
        return { data: buffer.subarray(0, bytesRead).toString("base64"), eof: false };
      }
      visible() {
        return this._visible;
      }
      emitSessions(sessions) {
        this.sendEvent?.("sessions", { sessions, clientInfo: createClientInfo() });
      }
      emitTabs(tabs) {
        this.sendEvent?.("tabs", { tabs });
      }
      emitFrame(data, viewportWidth, viewportHeight) {
        this.sendEvent?.("frame", { data, viewportWidth, viewportHeight });
      }
      emitAnnotate({ signal }) {
        return new Promise((resolve) => {
          if (signal.aborted) {
            resolve({ type: "cancelled" });
            return;
          }
          this._resolvePendingAnnotate({ type: "cancelled" });
          const onAbort = () => {
            if (this._pendingAnnotate !== pending)
              return;
            this._pendingAnnotate = void 0;
            pending.dispose();
            this.sendEvent?.("cancelAnnotate", {});
            resolve({ type: "cancelled" });
          };
          const pending = {
            resolve,
            dispose: () => signal.removeEventListener("abort", onAbort)
          };
          this._pendingAnnotate = pending;
          signal.addEventListener("abort", onAbort);
          this._tryFireAnnotate();
        });
      }
      _tryFireAnnotate() {
        if (!this._pendingAnnotate || !this._attachedPage)
          return;
        this.sendEvent?.("annotate", {});
      }
      _resolvePendingAnnotate(result2) {
        this._pendingAnnotate?.resolve(result2);
        this._pendingAnnotate?.dispose();
        this._pendingAnnotate = void 0;
      }
      artifactsDirFor(context2) {
        for (const entry of this._provider.contextEntries()) {
          if (entry.context === context2)
            return entry.descriptor.browser.launchOptions.artifactsDir ?? this._recordingDir;
        }
        return this._recordingDir;
      }
      _pushTabs() {
        if (this._pushTabsScheduled)
          return;
        this._pushTabsScheduled = true;
        queueMicrotask(async () => {
          this._pushTabsScheduled = false;
          try {
            const tabs = await this._aggregateTabs();
            this.emitTabs(tabs);
          } catch {
          }
        });
      }
      _pushSessions() {
        void (async () => {
          try {
            const sessions = await this._provider.sessions();
            this.emitSessions(sessions);
          } catch {
          }
        })();
      }
      async _aggregateTabs() {
        const attachedPage = this._attachedPage?.page;
        const tasks = [];
        for (const { browser, context: context2 } of this._provider.contextEntries()) {
          for (const page of context2.pages()) {
            tasks.push((async () => ({
              browser: browserId(browser),
              context: contextId(context2),
              page: pageId(page),
              title: await page.title().catch(() => ""),
              url: page.url(),
              selected: page === attachedPage,
              faviconUrl: await faviconUrl(page)
            }))());
          }
        }
        return await Promise.all(tasks);
      }
      async _switchAttachedTo(page) {
        if (this._attachedPage?.page === page)
          return;
        this._attachedPage?.dispose();
        const attached = new AttachedPage(this, page);
        this._attachedPage = attached;
        try {
          await attached.init();
        } catch (e) {
          if (this._attachedPage === attached)
            this._attachedPage = void 0;
          attached.dispose();
          throw e;
        }
        if (this._attachedPage === attached)
          this._tryFireAnnotate();
      }
      _handleAttachedPageClose(context2) {
        this._attachedPage?.dispose();
        this._attachedPage = void 0;
        const next = context2.pages()[0];
        if (next)
          void this._switchAttachedTo(next);
        this._pushTabs();
      }
    };
    AttachedPage = class {
      constructor(owner, page) {
        this._listeners = [];
        this._screencastRunning = false;
        this._recordingPath = null;
        this._disposed = false;
        this._owner = owner;
        this._page = page;
      }
      get page() {
        return this._page;
      }
      async init() {
        this._listeners.push(
          eventsHelper.addEventListener(this._page, "close", () => {
            this._owner._handleAttachedPageClose(this._page.context());
          }),
          eventsHelper.addEventListener(this._page, "framenavigated", (frame) => {
            if (frame === this._page.mainFrame())
              this._owner._pushTabs();
          })
        );
        this._owner._pushTabs();
        if (this._owner.visible()) {
          this._screencastRunning = true;
          await this._startScreencast(this._page);
        }
      }
      dispose() {
        this._disposed = true;
        this._listeners.forEach((d) => d.dispose());
        this._listeners = [];
        if (this._screencastRunning)
          this._page.screencast.stop().catch(() => {
          });
        this._screencastRunning = false;
        this._recordingPath = null;
      }
      async setScreencastActive(active) {
        if (active && !this._screencastRunning) {
          this._screencastRunning = true;
          await this._startScreencast(this._page);
        } else if (!active && this._screencastRunning) {
          this._screencastRunning = false;
          await this._page.screencast.stop().catch(() => {
          });
        }
      }
      async navigate(params2) {
        if (!params2.url)
          return;
        await this._page.goto(params2.url);
      }
      async back() {
        await this._page.goBack();
      }
      async forward() {
        await this._page.goForward();
      }
      async reload() {
        await this._page.reload();
      }
      async mousemove(params2) {
        await this._page.mouse.move(params2.x, params2.y);
      }
      async mousedown(params2) {
        await this._page.mouse.move(params2.x, params2.y);
        await this._page.mouse.down({ button: params2.button || "left" });
      }
      async mouseup(params2) {
        await this._page.mouse.move(params2.x, params2.y);
        await this._page.mouse.up({ button: params2.button || "left" });
      }
      async wheel(params2) {
        await this._page.mouse.wheel(params2.deltaX, params2.deltaY);
      }
      async keydown(params2) {
        await this._page.keyboard.down(params2.key);
      }
      async keyup(params2) {
        await this._page.keyboard.up(params2.key);
      }
      async startRecording() {
        const artifactsDir = this._owner.artifactsDirFor(this._page.context());
        this._recordingPath = import_path57.default.join(artifactsDir, `recording-${Date.now()}.webm`);
        if (this._screencastRunning)
          await this._restartScreencast(this._page);
      }
      async stopRecording() {
        const p = this._recordingPath;
        if (!p)
          throw new Error("No recording in progress");
        this._recordingPath = null;
        if (this._screencastRunning)
          await this._restartScreencast(this._page);
        const handle = await import_fs59.default.promises.open(p, "r");
        const streamId = import_crypto29.default.randomUUID();
        this._owner._streams.set(streamId, { handle, path: p });
        return { streamId };
      }
      async screenshot() {
        const buffer = await this._page.screenshot({ type: "png" });
        const ariaSnapshot = await this._page.ariaSnapshot({ boxes: true, mode: "ai" });
        const vp = await this._viewportSize();
        return {
          data: buffer.toString("base64"),
          viewportWidth: vp.width,
          viewportHeight: vp.height,
          ariaSnapshot
        };
      }
      async _viewportSize() {
        const vp = this._page.viewportSize();
        if (vp)
          return vp;
        return await this._page.evaluate(() => ({ width: window.innerWidth, height: window.innerHeight }));
      }
      async _startScreencast(page) {
        await page.screencast.start({
          onFrame: ({ data, viewportWidth, viewportHeight }) => {
            if (this._disposed)
              return;
            this._owner.emitFrame(data.toString("base64"), viewportWidth, viewportHeight);
          },
          size: { width: 1280, height: 800 },
          ...this._recordingPath ? { path: this._recordingPath } : {}
        });
      }
      async _restartScreencast(page) {
        await page.screencast.stop().catch(() => {
        });
        await this._startScreencast(page);
      }
    };
  }
});

// packages/playwright-core/src/tools/dashboard/registrySessionProvider.ts
function pageId2(p) {
  return p._guid;
}
function contextId2(c) {
  return c._guid;
}
var import_events29, BrowserTracker, RegistrySessionProvider;
var init_registrySessionProvider = __esm({
  "packages/playwright-core/src/tools/dashboard/registrySessionProvider.ts"() {
    "use strict";
    import_events29 = require("events");
    init_eventsHelper();
    init_connect2();
    init_serverRegistry();
    init_sessionProvider();
    BrowserTracker = class _BrowserTracker {
      constructor(descriptor, browser, callbacks) {
        this._contextListeners = /* @__PURE__ */ new Map();
        this._browserListeners = [];
        this.descriptor = descriptor;
        this.browser = browser;
        this._callbacks = callbacks;
      }
      static async create(descriptor, callbacks) {
        try {
          const browser = await connectToBrowserAcrossVersions(descriptor);
          const slot = new _BrowserTracker(descriptor, browser, callbacks);
          for (const context2 of browser.contexts())
            slot._wireContext(context2);
          slot._browserListeners.push(eventsHelper.addEventListener(browser, "context", (context2) => {
            slot._wireContext(context2);
          }));
          return slot;
        } catch {
          return void 0;
        }
      }
      contexts() {
        return this.browser.contexts();
      }
      dispose() {
        this._browserListeners.forEach((d) => d.dispose());
        this._browserListeners = [];
        for (const listeners of this._contextListeners.values())
          listeners.forEach((d) => d.dispose());
        this._contextListeners.clear();
        void this.browser.close().catch(() => {
        });
      }
      _wireContext(context2) {
        if (this._contextListeners.has(context2))
          return;
        const onTabsChanged = () => this._callbacks.onTabsChanged();
        const listeners = [
          eventsHelper.addEventListener(context2, "page", onTabsChanged),
          eventsHelper.addEventListener(context2, "pageload", onTabsChanged),
          eventsHelper.addEventListener(context2, "pageclose", onTabsChanged),
          eventsHelper.addEventListener(context2, "framenavigated", (frame) => {
            if (frame === frame.page().mainFrame())
              this._callbacks.onTabsChanged();
          }),
          eventsHelper.addEventListener(context2, "close", () => {
            const ls = this._contextListeners.get(context2);
            if (ls) {
              ls.forEach((d) => d.dispose());
              this._contextListeners.delete(context2);
            }
            this._callbacks.onContextClosed(context2);
            this._callbacks.onTabsChanged();
          })
        ];
        this._contextListeners.set(context2, listeners);
        this._callbacks.onTabsChanged();
      }
    };
    RegistrySessionProvider = class extends import_events29.EventEmitter {
      constructor() {
        super(...arguments);
        this._trackers = /* @__PURE__ */ new Map();
        this._pushSessionsScheduled = false;
        this._scheduleSessions = () => {
          if (this._pushSessionsScheduled)
            return;
          this._pushSessionsScheduled = true;
          queueMicrotask(async () => {
            this._pushSessionsScheduled = false;
            try {
              const sessions = await this.sessions();
              await this._reconcile(sessions);
              this.emit(SessionProviderEvent.SessionsChanged);
              this.emit(SessionProviderEvent.TabsChanged);
            } catch {
            }
          });
        };
      }
      start() {
        this._serverRegistryDispose = serverRegistry.watch();
        serverRegistry.on("added", this._scheduleSessions);
        serverRegistry.on("removed", this._scheduleSessions);
        serverRegistry.on("changed", this._scheduleSessions);
        this._scheduleSessions();
      }
      dispose() {
        serverRegistry.off("added", this._scheduleSessions);
        serverRegistry.off("removed", this._scheduleSessions);
        serverRegistry.off("changed", this._scheduleSessions);
        this._serverRegistryDispose?.();
        this._serverRegistryDispose = void 0;
        for (const tracker of this._trackers.values())
          tracker.dispose();
        this._trackers.clear();
        this.removeAllListeners();
      }
      async sessions() {
        const byWs = await serverRegistry.list();
        const sessions = [];
        for (const list of byWs.values()) {
          for (const status of list) {
            if (status.title.startsWith("--playwright-internal"))
              continue;
            sessions.push(status);
          }
        }
        return sessions;
      }
      contextEntries() {
        const entries = [];
        for (const tracker of this._trackers.values()) {
          for (const context2 of tracker.contexts())
            entries.push({ browser: tracker.browser, context: context2, descriptor: tracker.descriptor });
        }
        return entries;
      }
      findContext(params2) {
        const tracker = this._trackers.get(params2.browser);
        if (!tracker)
          return void 0;
        return tracker.contexts().find((c) => contextId2(c) === params2.context);
      }
      findPage(params2) {
        const context2 = this.findContext(params2);
        return context2?.pages().find((p) => pageId2(p) === params2.page);
      }
      async closeSession(browserId2) {
        const descriptor = serverRegistry.readDescriptor(browserId2);
        const browser = await connectToBrowserAcrossVersions(descriptor);
        try {
          await Promise.all(browser.contexts().map((context2) => context2.close()));
          await browser.close();
        } catch {
        }
      }
      async _reconcile(sessions) {
        const connectable = /* @__PURE__ */ new Map();
        for (const status of sessions)
          connectable.set(status.browser.guid, status);
        for (const [guid, tracker] of this._trackers) {
          if (connectable.has(guid))
            continue;
          tracker.dispose();
          this._trackers.delete(guid);
        }
        for (const [guid, status] of connectable) {
          if (this._trackers.has(guid))
            continue;
          const tracker = await BrowserTracker.create(status, {
            onTabsChanged: () => this.emit(SessionProviderEvent.TabsChanged),
            onContextClosed: (context2) => this.emit(SessionProviderEvent.ContextClosed, context2)
          });
          if (!tracker)
            continue;
          if (this._trackers.has(guid)) {
            tracker.dispose();
            continue;
          }
          this._trackers.set(guid, tracker);
        }
      }
    };
  }
});

// packages/playwright-core/src/tools/dashboard/identitySessionProvider.ts
function synthesiseDescriptor(browser) {
  const browserName = browser.browserType().name();
  const browserInfo2 = {
    // eslint-disable-next-line no-restricted-syntax -- _guid is very conservative.
    guid: browser._guid,
    browserName,
    launchOptions: {}
  };
  return {
    title: "Playwright",
    playwrightVersion: packageJSON.version,
    playwrightLib: packageRoot,
    browser: browserInfo2
  };
}
function pageId3(p) {
  return p._guid;
}
function contextId3(c) {
  return c._guid;
}
var import_events30, IdentitySessionProvider;
var init_identitySessionProvider = __esm({
  "packages/playwright-core/src/tools/dashboard/identitySessionProvider.ts"() {
    "use strict";
    import_events30 = require("events");
    init_eventsHelper();
    init_package();
    init_sessionProvider();
    IdentitySessionProvider = class extends import_events30.EventEmitter {
      constructor(context2) {
        super();
        this._listeners = [];
        this._closed = false;
        const browser = context2.browser();
        if (!browser)
          throw new Error("SingleContextDashboardProvider requires a context with an attached browser");
        this._context = context2;
        this._browser = browser;
        this._descriptor = synthesiseDescriptor(browser);
      }
      start() {
        const emitTabsChanged = () => this.emit(SessionProviderEvent.TabsChanged);
        this._listeners.push(
          eventsHelper.addEventListener(this._context, "page", emitTabsChanged),
          eventsHelper.addEventListener(this._context, "pageload", emitTabsChanged),
          eventsHelper.addEventListener(this._context, "pageclose", emitTabsChanged),
          eventsHelper.addEventListener(this._context, "framenavigated", (frame) => {
            if (frame === frame.page().mainFrame())
              this.emit(SessionProviderEvent.TabsChanged);
          }),
          eventsHelper.addEventListener(this._context, "close", () => {
            this._closed = true;
            this.emit(SessionProviderEvent.ContextClosed, this._context);
            this.emit(SessionProviderEvent.TabsChanged);
          })
        );
        this.emit(SessionProviderEvent.SessionsChanged);
        this.emit(SessionProviderEvent.TabsChanged);
        const firstPage = this._context.pages()[0];
        if (firstPage)
          this.emit(SessionProviderEvent.AttachRequested, firstPage);
      }
      dispose() {
        this._listeners.forEach((d) => d.dispose());
        this._listeners = [];
        this.removeAllListeners();
      }
      async sessions() {
        return this._closed ? [] : [this._descriptor];
      }
      contextEntries() {
        if (this._closed)
          return [];
        return [{ browser: this._browser, context: this._context, descriptor: this._descriptor }];
      }
      findContext(params2) {
        if (this._closed)
          return void 0;
        if (params2.browser !== this._descriptor.browser.guid)
          return void 0;
        if (contextId3(this._context) !== params2.context)
          return void 0;
        return this._context;
      }
      findPage(params2) {
        const context2 = this.findContext(params2);
        return context2?.pages().find((p) => pageId3(p) === params2.page);
      }
      async closeSession() {
      }
    };
  }
});

// packages/playwright-core/src/tools/dashboard/dashboardApp.ts
async function startDashboardServer(provider, options) {
  const dashboardDir = libPath("vite", "dashboard");
  const httpServer = new HttpServer(dashboardDir);
  const connections = /* @__PURE__ */ new Set();
  let connectionLanded = new ManualPromise();
  httpServer.createWebSocket(() => {
    let connection;
    connection = new DashboardConnection(provider, () => {
      connections.delete(connection);
      if (connections.size === 0)
        connectionLanded = new ManualPromise();
    }, () => {
      connectionLanded.resolve();
    });
    connections.add(connection);
    return connection;
  });
  const wsGuid = httpServer.wsGuid();
  httpServer.routePath("/", (_, response2) => {
    response2.statusCode = 302;
    response2.setHeader("Location", `/index.html?ws=${wsGuid}`);
    response2.end();
    return true;
  });
  if (false)
    await attachDashboardDevServer(httpServer);
  else
    attachDashboardStaticServer(httpServer, dashboardDir);
  await httpServer.start({ port: options.port, host: options.host });
  const reveal = async (next) => {
    await connectionLanded;
    await Promise.all([...connections].map(async (c) => {
      if (next.pageId)
        await c.revealPage(next.pageId);
      else if (next.sessionName)
        await c.revealSession(next.sessionName, next.workspaceDir);
    }));
  };
  const triggerAnnotate = async (cancellation) => {
    await connectionLanded;
    if (cancellation.aborted || connections.size === 0)
      return { type: "cancelled" };
    return await Promise.race([...connections].map((c) => c.emitAnnotate({ signal: cancellation })));
  };
  const close3 = async () => {
    for (const c of connections)
      c.close?.();
    await httpServer.stop();
  };
  return { url: httpServer.urlPrefix("human-readable"), reveal, triggerAnnotate, close: close3 };
}
function attachDashboardStaticServer(httpServer, dashboardDir) {
  httpServer.routePrefix("/", (request2, response2) => {
    const pathname = new URL(request2.url, `http://${request2.headers.host}`).pathname;
    const filePath = pathname === "/" ? "index.html" : pathname.substring(1);
    const resolved = import_path58.default.join(dashboardDir, filePath);
    return httpServer.serveFile(request2, response2, resolved);
  });
}
async function innerOpenDashboardApp(options) {
  const server = await startDashboardServer(new RegistrySessionProvider(), options);
  void server.reveal(options).catch(() => {
  });
  const { page } = await launchApp2("dashboard", { onClose: () => gracefullyProcessExitDoNotHang(0) });
  await page.goto(server.url);
  return { page, server };
}
async function launchApp2(appName, options) {
  const channel = findChromiumChannelBestEffort("javascript");
  const context2 = await playwright.chromium.launchPersistentContext("", {
    ignoreDefaultArgs: ["--enable-automation"],
    channel,
    headless: !!process.env.PWTEST_DASHBOARD_APP_BIND_TITLE,
    args: [
      "--app=data:text/html,",
      "--test-type=",
      `--window-size=1280,800`,
      `--window-position=100,100`
    ],
    viewport: null
  });
  if (process.env.PWTEST_DASHBOARD_APP_BIND_TITLE)
    await context2.browser()?.bind(process.env.PWTEST_DASHBOARD_APP_BIND_TITLE, { workspaceDir: process.cwd() });
  const [page] = context2.pages();
  if (process.platform === "darwin") {
    context2.on("page", async (newPage) => {
      if (newPage.mainFrame().url() === "chrome://new-tab-page/") {
        await page.bringToFront();
        await newPage.close();
      }
    });
  }
  page.on("close", () => options?.onClose?.());
  const image = await import_fs60.default.promises.readFile(libPath("tools", "dashboard", "appIcon.png"));
  await page._setDockTile?.(image);
  await syncLocalStorageWithSettings2(page, appName);
  return { context: context2, page };
}
async function syncLocalStorageWithSettings2(page, appName) {
  const settingsFile = process.env.PWTEST_DASHBOARD_SETTINGS_FILE ?? import_path58.default.join(registryDirectory, ".settings", `${appName}.json`);
  await page.exposeBinding("_saveSerializedSettings", (_, settings2) => {
    import_fs60.default.mkdirSync(import_path58.default.dirname(settingsFile), { recursive: true });
    import_fs60.default.writeFileSync(settingsFile, settings2);
  });
  const settings = await import_fs60.default.promises.readFile(settingsFile, "utf-8").catch(() => "{}");
  await page.addInitScript(
    `(${String((settings2) => {
      if (location && location.protocol === "data:")
        return;
      if (window.top !== window)
        return;
      Object.entries(settings2).map(([k, v]) => localStorage[k] = v);
      window.saveSettings = () => {
        window._saveSerializedSettings(JSON.stringify({ ...localStorage }));
      };
    })})(${settings});
  `
  );
}
function dashboardSocketPath() {
  return makeSocketPath("dashboard", "app");
}
function parseOpenArgs() {
  const args = minimist(process.argv.slice(2), { string: ["sessionName", "workspaceDir", "host", "pageId"], boolean: ["annotate", "kill"] });
  const portStr = args.port;
  return {
    sessionName: args.sessionName,
    workspaceDir: args.workspaceDir,
    pageId: args.pageId,
    port: portStr !== void 0 ? Number(portStr) : void 0,
    host: args.host,
    annotate: !!args.annotate,
    kill: !!args.kill
  };
}
async function acquireSingleton(options) {
  const socketPath = dashboardSocketPath();
  if (process.platform !== "win32")
    await import_fs60.default.promises.mkdir(import_path58.default.dirname(socketPath), { recursive: true });
  return await new Promise((resolve, reject) => {
    const server = import_net11.default.createServer();
    server.listen(socketPath, () => resolve({ role: "winner", server }));
    server.on("error", (err) => {
      if (err.code !== "EADDRINUSE" && err.code !== "EEXIST")
        return reject(err);
      let ackBuffer = "";
      const client = import_net11.default.connect(socketPath, () => {
        client.write(JSON.stringify(options) + "\n");
      });
      client.on("data", (chunk) => {
        ackBuffer += chunk.toString();
      });
      client.on("end", () => {
        try {
          const { pid } = JSON.parse(ackBuffer.trim());
          resolve({ role: "loser", daemonPid: pid });
        } catch (e) {
          reject(e);
        }
      });
      client.on("error", () => {
        if (process.platform !== "win32")
          import_fs60.default.unlinkSync(socketPath);
        server.listen(socketPath, () => resolve({ role: "winner", server }));
      });
    });
  });
}
async function openDashboardApp() {
  const options = parseOpenArgs();
  if (options.kill) {
    await runKillClient();
    return;
  }
  if (options.annotate) {
    await runAnnotateClient(options);
    return;
  }
  process.on("unhandledRejection", (error) => {
    console.error("Unhandled promise rejection:", error);
  });
  if (options.port !== void 0) {
    const server2 = await startDashboardServer(new RegistrySessionProvider(), options);
    void server2.reveal(options).catch(() => {
    });
    console.log(`Listening on ${server2.url}`);
    await new Promise((f) => process.stdout.write("", f));
    selfDestructOnParentGone();
    return;
  }
  const stopSelfDestruct = selfDestructOnParentGone();
  const acquired = await acquireSingleton(options);
  if (acquired.role === "loser") {
    stopSelfDestruct();
    console.log(`Dashboard is running pid=${acquired.daemonPid}`);
    await new Promise((f) => process.stdout.write("", f));
    return;
  }
  const { server } = acquired;
  process.on("exit", () => server.close());
  try {
    await startApp(server, options);
    stopSelfDestruct();
    console.log(`Dashboard is running pid=${process.pid}`);
  } catch (error) {
    console.log(error);
    gracefullyProcessExitDoNotHang(1);
  }
}
async function startApp(server, options) {
  const statePromise = innerOpenDashboardApp(options);
  server.on("connection", (socket) => {
    let buffer = "";
    socket.on("data", async (data) => {
      buffer += data.toString();
      const newlineIndex = buffer.indexOf("\n");
      if (newlineIndex === -1)
        return;
      const line = buffer.slice(0, newlineIndex);
      buffer = buffer.slice(newlineIndex + 1);
      let parsed;
      try {
        parsed = JSON.parse(line);
      } catch {
      }
      if (!parsed) {
        socket.end();
        return;
      }
      const { page, server: dashboard } = await statePromise;
      if (parsed.annotate) {
        const cancellation = new AbortController();
        socket.on("close", () => cancellation.abort());
        socket.on("error", () => cancellation.abort());
        try {
          await page?.bringToFront();
          await dashboard.reveal(parsed);
          const result2 = await dashboard.triggerAnnotate(cancellation.signal);
          socket.end(JSON.stringify(result2));
        } catch (e) {
          socket.end(e);
        }
      } else if (parsed.kill) {
        await dashboard.close().catch(() => {
        });
        gracefullyProcessExitDoNotHang(0, () => new Promise((r) => socket.end(r)));
      } else {
        try {
          await page?.bringToFront();
          await dashboard.reveal(parsed);
          socket.end(JSON.stringify({ pid: process.pid }) + "\n");
        } catch (e) {
          socket.end(e);
        }
      }
    });
  });
  await statePromise;
}
async function openDashboardForContext(context2) {
  const server = await startDashboardServer(new IdentitySessionProvider(context2), {});
  let closed = false;
  const close3 = async () => {
    if (closed)
      return;
    closed = true;
    await server.close();
  };
  const { page } = await launchApp2("dashboard", { onClose: () => {
    void close3();
  } });
  context2.on("close", () => {
    void close3();
  });
  await page.goto(server.url);
}
async function runKillClient() {
  const socketPath = dashboardSocketPath();
  await new Promise((resolve) => {
    const client = import_net11.default.connect(socketPath);
    client.once("connect", () => {
      client.write(JSON.stringify({ kill: true }) + "\n");
    });
    client.once("end", () => resolve());
    client.once("error", () => resolve());
  });
}
async function runAnnotateClient(options) {
  selfDestructOnParentGone();
  const socketPath = dashboardSocketPath();
  const tryConnect = () => new Promise((resolve) => {
    const s = import_net11.default.connect(socketPath);
    const onError = () => {
      s.destroy();
      resolve(void 0);
    };
    s.once("connect", () => {
      s.off("error", onError);
      resolve(s);
    });
    s.once("error", onError);
  });
  const deadline = Date.now() + 15e3;
  let socket;
  while (Date.now() < deadline) {
    socket = await tryConnect();
    if (socket)
      break;
    await new Promise((r) => setTimeout(r, 200));
  }
  if (!socket) {
    console.error("Dashboard did not start in time.");
    gracefullyProcessExitDoNotHang(1);
    return;
  }
  socket.write(JSON.stringify(options) + "\n");
  const chunks = [];
  await new Promise((resolve, reject) => {
    socket.on("data", (chunk) => chunks.push(chunk));
    socket.on("end", () => resolve());
    socket.on("error", reject);
  });
  socket.destroy();
  const text2 = Buffer.concat(chunks).toString();
  if (!text2)
    return;
  console.log(text2);
}
function selfDestructOnParentGone() {
  const onClose = () => gracefullyProcessExitDoNotHang(0);
  process.stdin.on("close", onClose);
  return () => process.stdin.off("close", onClose);
}
var import_fs60, import_path58, import_net11;
var init_dashboardApp = __esm({
  "packages/playwright-core/src/tools/dashboard/dashboardApp.ts"() {
    "use strict";
    import_fs60 = __toESM(require("fs"));
    import_path58 = __toESM(require("path"));
    import_net11 = __toESM(require("net"));
    init_httpServer();
    init_fileUtils();
    init_processLauncher();
    init_manualPromise();
    init_package();
    init_inprocess();
    init_registry();
    init_minimist();
    init_dashboardController();
    init_registrySessionProvider();
    init_identitySessionProvider();
  }
});

// packages/playwright-core/src/tools/index.ts
var tools_exports = {};
__export(tools_exports, {
  BrowserBackend: () => BrowserBackend,
  DirTraceLoaderBackend: () => DirTraceLoaderBackend,
  Tab: () => Tab,
  browserTools: () => browserTools,
  cliProgram: () => program2,
  compareSemver: () => compareSemver,
  createConnection: () => createConnection,
  decorateCliDaemonProgram: () => decorateProgram3,
  decorateMCPCommand: () => decorateMCPCommand,
  extractTrace: () => extractTrace,
  filteredTools: () => filteredTools,
  generateHelp: () => generateHelp,
  generateHelpJSON: () => generateHelpJSON,
  isProfileLocked: () => isProfileLocked,
  isSystemDirectory: () => isSystemDirectory,
  openDashboardApp: () => openDashboardApp,
  openDashboardForContext: () => openDashboardForContext,
  outputDir: () => outputDir,
  parseResponse: () => parseResponse,
  resolveCLIConfigForCLI: () => resolveCLIConfigForCLI,
  resolveCLIConfigForMCP: () => resolveCLIConfigForMCP,
  setupExitWatchdog: () => setupExitWatchdog,
  start: () => start2
});
var init_tools2 = __esm({
  "packages/playwright-core/src/tools/index.ts"() {
    "use strict";
    init_watchdog();
    init_browserBackend();
    init_response();
    init_tab();
    init_tools();
    init_server2();
    init_mcp();
    init_config2();
    init_context();
    init_fileUtils();
    init_browserFactory();
    init_socketConnection();
    init_traceParser();
    init_program3();
    init_program();
    init_helpGenerator();
    init_program4();
    init_dashboardApp();
  }
});

// packages/playwright-core/src/coreBundle.ts
var coreBundle_exports = {};
__export(coreBundle_exports, {
  clientEventEmitter: () => EventEmitter3,
  getPlaywrightVersion: () => getPlaywrightVersion,
  getUserAgent: () => getUserAgent,
  inprocess: () => inprocess_exports,
  iso: () => isomorphic_exports,
  libCli: () => program_exports,
  libCliTestStub: () => programWithTestStub_exports,
  oop: () => outofprocess_exports,
  registry: () => registry_exports,
  remote: () => playwrightServer_exports,
  server: () => server_exports,
  tools: () => tools_exports,
  utils: () => utils_exports
});
module.exports = __toCommonJS(coreBundle_exports);
var init_coreBundle = __esm({
  "packages/playwright-core/src/coreBundle.ts"() {
    init_isomorphic();
    init_utils();
    init_eventEmitter();
    init_program2();
    init_programWithTestStub();
    init_inprocess();
    init_outofprocess();
    init_playwrightServer();
    init_registry();
    init_server();
    init_tools2();
    init_userAgent();
  }
});
init_coreBundle();
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  clientEventEmitter,
  getPlaywrightVersion,
  getUserAgent,
  inprocess,
  iso,
  libCli,
  libCliTestStub,
  oop,
  registry,
  remote,
  server,
  tools,
  utils
});
/**
 * @license
 * Copyright 2024 Google Inc.
 * Modifications copyright (c) Microsoft Corporation.
 * SPDX-License-Identifier: Apache-2.0
 */
/**
 * @license
 * Copyright 2023 Google Inc.
 * SPDX-License-Identifier: Apache-2.0
 */
"use strict";
var import_coreBundle = require("../coreBundle");
const { program } = require("../utilsBundle");
import_coreBundle.tools.decorateCliDaemonProgram(program);
void program.parseAsync();
"use strict";
var import_coreBundle = require("../coreBundle");
import_coreBundle.tools.openDashboardApp();
"use strict";
var import_coreBundle = require("../coreBundle");
var import_package = require("../package");
const { program } = require("../utilsBundle");
const p = program.version("Version " + import_package.packageJSON.version).name("Playwright MCP");
import_coreBundle.tools.decorateMCPCommand(p);
program.parseAsync(process.argv).catch((e) => {
  console.error(e.message);
  import_coreBundle.utils.gracefullyProcessExitDoNotHang(1);
});
"use strict";
var import_coreBundle = require("../coreBundle");
import_coreBundle.registry.runOopDownloadBrowserMain();
"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  // If the importer is in node compatibility mode or this is not an ESM
  // file that has been converted to a CommonJS file using a Babel-
  // compatible transform (i.e. "__esModule" has not been set), then set
  // "default" to the CommonJS "module.exports" for node compatibility.
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var package_exports = {};
__export(package_exports, {
  binPath: () => binPath,
  libPath: () => libPath,
  packageJSON: () => packageJSON,
  packageRoot: () => packageRoot
});
module.exports = __toCommonJS(package_exports);
var import_path = __toESM(require("path"));
const packageRoot = import_path.default.join(__dirname, "..");
const packageJSON = require(import_path.default.join(packageRoot, "package.json"));
const binPath = import_path.default.join(packageRoot, "bin");
function libPath(...parts) {
  return import_path.default.join(packageRoot, "lib", ...parts);
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  binPath,
  libPath,
  packageJSON,
  packageRoot
});
‰PNG

   IHDR  �  �   €¿6Ì   bKGD ÿ ÿ ÿ ½§“  @jIDATxÚí�xTuÖÿ±®[Þu÷Ý]}Ýý$3“™dæÞ”I(
’éýÞ™Ä‚eWv×ºvQì(Rj ˆ‚"†$®ºE×FUQP)iªé½$ó?7$ÂÔdÊ½3ßÏóœv2sçÞó�ó;­[7                                                                                                                                                                                                                                                                                                    øe¹òZYYf•lªêsY™rž¢<ÓŠ«   0£º]œ>M¹äê±é¾Ž–6I±_6#ë.\$   çâëvaúe­?ñ8WH”›T¯egà‚  hA^–UJ<Ú¬ûY“¼L}/®  ¤ºxÌT®'ó…+ -"2.Ý'Ÿ–ù\=  HaÒ&gl‹D<:äF6É¦Ê®ÀU €T‹>Ê³në¬x´YÏÅÑô™š|\M  H¥èc’bGW¤åHk¼¼I>#ëF\Q  HÓ5¶hˆÇ�y™�zFžÁ• €d�>¦(7FS@ZDd¬Ì'4!âê @Ás&FÏÿ“l‹úfã×B%U´älr}šòu…úR\u  �0^¯÷"�ŽŸLÂák3ÙxõöX‰G»
­ÝÙ¯eÿŸ   H�ž›Ð^<4çñ«ÇËšc- -ZÇz¾’ÕŸ  HÖà¶·Á2žÏÝñh³%²Óò2¥Ÿ  Hu¡÷$ÛÏ�"‘ŸŠ§€œ)óMoÎ˜®‡O  $ å=žì}¨ì»)ÞâÑÞÒ§¨¾@r  DŒVç½œcGI+Í8�HiM®ï“¿¢ÎÂ§  bŒ>ü#ÅC}ƒiw¢Åãì‘V‰â”bFÖ­ø¤  @Dô,¼å²ós¼O>–Ù$i›èK[àH  D£sÿµ£x0f×Ia^•˜äÇ#­Œ½²*->9  H ………“`lì( Ê‘½Ä(?ViÉš32ŸÅ'  ‰Š>ôœ÷¼èCHž—(ŠY@~¬ÒR®N›«¹Ÿ$  ÄVÏ/9/y>Ä²_r(9³2WqJ>]õ>M  ˆ—xù<Ñ‡ü¥ìÍR�¹‘-é³rød  öÑÇlBOJQ@ÎD#²&ÙtÕ|º  +ñ0pW�Xï(™-Ü*Uñ8'™¬Ü®œ¡añI @”¡ÒÝ‡ýE4¶}g2Hk4ÒL}#Õ=g^†O  ¢Ã$uÅCcužœn²ÈÙñ¥òcòrõ½øØ  ‹dëÜFÑ‡ò±ÞÉ&’ì;Ó2¯Ã   �=¾ÒóÕ~{?JU{“Y@ÎŒC‘	ãP>Gï  DH®Þñ{‹Sç_9í®'ó%»€ü8œQ.ôŽ`ß  „‹¿©»‚)ž)¨Mñ87?¢8œQ–u?î  }|µÎÿñ•4F—Än{ÆE¹z(î  ð'Å\_â¡ñZKitIlíÊMªij;î  87ú˜æO@2žÍk„xœ/$Êé¬w  åi]µÏÿñUÆaˆF ŽöŒÍå™.ÜA €”…Õ»¯÷'ŒÛvDØô±•#QìSLW>ƒ;	 �ŠÇWÿòÛ<ø´ÇWX�RùEYVÖê Rm¡ý·$'T_€0t""™ 8!+SÎCC"  ¹�¯üâ¡vÚŽ]�ã«®ÙxYsÚÔŒµŠòL+î4 @Ò¡Ñó‹ý_=QÐ ˆî¬-ŠJë6ªÛÅ¸ë  Òƒój‹¦ {Ï÷ÁñÇfLŠ¬LõIZ¹ºî@ €d!¡xÐoó Õq¬û84ÆTH¨9“Ê€wÊ§gŽÖ–i†»  5ùº£x¸LNß¸á×‡“�ïr«ô©ÊZùõ=Ý|Ý.Ä�	 59z·¢½ph._™Íì[h-òýý¾^pì‰*ž@G\4R^V®6á. ˆ3úh·¶öq‹Í·Ð^ì[`ØbÚÑJ8sqlK<"Ÿªz_>]mÄ ÓñÕWCÌNßvýYáì÷@8o1F&%ò“iS”+)g2Ç\ €„1Ê¡Ï¯°ÏŽ6sg_8lñw¼ŸL›¦üF>CõhÏñ9¿Â ˆ9;n2ü|ÓëCßðÆ“þÄC0ÓÓ8i‰­áö•ÈÊ2ÿ�†E @ÔYãõ^JÂ1|ó`Û÷d¾e�_ñøÔ1Ð×»?¤>Øñ(S•7�­Î¢­Ò^…» Ð)–×^Ò*[á¬q°Õ·Àæ?ú˜5¬œ°ÄM6Måc«´?Zµv}‹ Tæ_ŸûNîïñT  ‚²ñ–ÂË6¶ßA‚±©M8Úl­Ûät|õÇ‡óà„%nÊW5ç
Èù¶™l~v•ö~v~^í{hbì,}+úþTS™Ç²Uùº¦�Ð5�ÅVå}H¿ÿš­Ô~K¿.gª´ÿ${š"B®5ß{Í¿r$Û:
G›}åô|µ�LýRœ°ÄMóVn(éh§ZÞt¦2ÿ¯-¢R¡½OÓ¹hÞé}evež‘©Ö>D‚1Oˆìèº5Ep�›²«ò&z+¼ájQ±éz»zÓ`Ûˆc�„C0ú3¾…Ž¯þã)„–~©o¤âÌ6Ò·éwØê¼g™ê¼rª

RBXFu»0§2GAb1ˆ®ÁóleÞ¿)‚ØµëZ�ÿ<‡pxíý¶¶½GâÐL8Úl½Ûðøê%”ïJÞäe™Ñ�@¶ƒ„e�±Ð¯�’£½1»ZÛ/·*·Gá§…’™4ÌÎfžóvAN‹PTæ?Fïe6½·/ÈÅøú�PWh»Ã{�„ÐàÕ]¾y°}Ù·áˆF{[á2ë(NXâ¦šÍÄC@‚Ùi²-dŸ·D/Â±�ÿGct|3˜©*Ði*sóÕyòÜŠÜßÑÉK¢™�`«Ù+4okeÌÛyZÊGdªó�=ý…~ÿÌ™ü„ö}²Õd?$ô:Ujï†'qŽ6¬Ú-ƒíe$‡#Ž6[l/ò/ ¶"_Ï—åpÂRÏTä&Z@:cÇÉö’m#khK>´Jí7-îGÛÛšÇ‘Ì{¦<Ê[ðh æ4zíi›Ù§ÜÅúÎŠF›Õz,£�y7ö‡–üÜ,…Å#%�¢±¥ðn &l¿Þþ[�?ol]nn#[Å
È}÷À	KÜ32áœ¥ckáé@TEƒ¢Œ›Ï$Äí'£%ííGq@éõ¼
NXâ–9‡…c–ŠÑ1¼èah¶²=H¢±”|S,Dãl÷ù [KŸG ñ%pÀÒßnÈTäÁ1KÇ–Ã‚ˆØp½ãÊ:¯å…úA–%þ:ÄciÁºÏçÜ|œ°Ä-mRœ²´ì}xD”»ý·uó=5^Ó‡ë=æ=‚lY<ÅC°åN}@¹ûþ|8a©ç?Ê³à”%U…•?'u+ƒxþªÁ1z,ã«d~¨Æm¶–ç{¤²`llîSë1�§j§åÔ°w°M0üYã k\$`ù.Yï�ÿ�ºe½Žü‡ÄÊxÇ¦œƒ¬3›Rã6Ì1®ó˜›Ö{LÈ‘®©d~½n�õ¶ú›W$]tAà$œÏÕyÍÓûÝ.¼ï`×¥£Õ{-q�zOàîó$,pÀ·qé>¦ùI•ñVjN9¾YGâ$Ï·ùD­×¼™„åƒ:¯õ‰šÁ¦±¿_íÐ¨ç­kYG’P¼CÇQkj<¦ýëÜÆæÎ^‡6«!§/ù–\¾û:ò’·ôÉÈHO@òoK)ñXË4]ušç‹Š©™ŽzŽRŽ`s�×¼¸Îc™C"õLÝ Ó��ns®àÀcõ~hÁÒ/ê‡X¯ipÛþ\ë¶L¨s[Þ®u›W�Àm"¨uÓ©h¿ßŽ¶ip|Ž±–ÙuèÿHæüÇL5œ²ÔŽ°h¤KjEƒ,%±v¨D¦‰œùIJB¾ýÓ¯»„H†gm(Ä€¾éï$‘ÚGÐ†“ÂQ“ \‰x/m£7ö²‰Êw-�¬ïYpÂ7õÜl8e©YE¾2%„#GïV°~ÄWnë
18Ýd²º8äAÖ)ß]hGÿ‡ô÷¡§ÃKÐÔê_$µpx½Þ‹X½{*£ç›É|‹Ý–­púÑµõqÈƒ|dúîü¡ÈH>ÿ1E	‡,=Û›ô‘«ç„£Íò–Mpú±ÈƒÄV@>·_òÜìÿ�ºeÌBþC‚¶*¹ÕcÔ¨5z~w{yŸ³ÖÃáGßbØ"Œ/	X¾K6hd6œ°Ôû?ÞDþCz	tmuRë£s2íÅC°ÙN[~ô­6†y�uA¶
¦~Q',åüÇx²-ÙWÚ2z·¥£€<owÔÁáÇ¤Ê,!ù���H K>ÿ1Mg,É$oxRˆFÇñd¸Ù¹?Fy�cËÌ½		t©›òU²$#�¼¢$ÞÚQ@]áìc”‰Á1V¨üÇwõ†–zÿÇ¼\8cI–ðj»'w–ÁÝ»£€g£<HÊy©ù2¨€ØG1pÂ¶�ÿ�¨ë6ªÛ…I- ™E|� r
?6mY$ÿ!,–’¿,‡#–°É�ÿ�è.tíÊ¤ï‘ÓÔÝ¶Âö¶Æc:g£±&Qž‹l}íÇ.Là•º©^cà�%™ÿÐÎM‰&${:
ÈJ·y'œ}l,šãÝ…æÄEÖÀû?æÞˆºÔMóòíy<Uä»ŽòoÝ g£=+QaÆV°üÇÓé',aëY¢€3–ìV—"Â}ÔQ@Ê�V4J`¼û>xý†Gs¤ßD7AÞÔ£Dqªg©âXÏRåá´‰‡È±ž æº¦dùôL8c©F •ZUªÈœŽò‹«Ž>v¶!Jý +‚ì?¬×óÒZa+ˆBúÕÎŒç´u™wnÔpöýþŠ<~4×é¬¡¦�ªÇúÔÉÆi¶�Èé>N–4’9ù‰ÚñÂO/N•#¬;>˜}ôü18zñ�wÿ,HáBÚÒc¬L¢!¯Ù”ù×›H|Á#³pÇT�÷©M+UíVÀJY@˜ùX_‹
,ñOãý£ÿR^3JyE<Þ½‘ŽÁ‰>ÞwŠû|ŸŽ¤”OÔ3×É.‹F S»lÏæÕÑ‘×IÉå?&"ÿ!á
¬WSG@Œžþ~ÄcÞg/Þñî5žà	ôW‡õkbø¤òñ>õŒñüòñØ™ë´rdïµREy±tä®Ôw…¿‡îK,–Šm¤‹ÇX«ycPyRd#L„Ü„â…œ:�‰??á8×4Fî´�_¹z¼¬Yôù�9,±TèÕº¥4•woÇ‡í—Syc™ñtM@Vé@ìú‘â©ÀJ+Í8¨¾Ù´-QÂqž�5þ�Vª<$êüG%±D­Y[¡½<Å„ÿcÝ¥•	6�·¥ëÅÌÄG”Ä—�Én¤#¤&±ˆÇY£#´ŒÑyõÝE˜hO›œG,]kè–jhükçMå5p‡àèck��ìò'ÁèÂKtV÷ñéÍ™÷õ«�pt0å×Ö¯UTëk‘ÿ�°åU¦œ€tÜ‹Þf4éõ$½øÆ»×‡è@ÿØ50ÑÍ§²†é·‹]<Ú,sxQc÷ÙiÑ¬¯}ù	È£©' :·ÛßƒµÊmÙGË5·�;Æþn0©: �UVòêAÖ`â±U£çß§ef/Ñïdîáô¿o¢†V/£ãn¥_"ÛÚàºš,.Ç_™·è·Š¡»](6`‘ÿ�¬iªóõ)' þv£ög©‡£�íšÛÎ”ó~ÃO —üñší®�ŸÒ¶ì:'a­çwS„;›ŽI«Š¹ßDzo*Žÿaõžbú’óý;KüM�Ž–©†ÜÐ=ÁZéS”pÄN ç¼�ó«”�Ö±î'ÎO¤Û‘H�õx÷NŒ5ùÒ©* ÷ß[ÿoÎ4¯*ëzsÛdg!jøU÷Y¼^ïEÑ¼WsL®ž$F�´F'Ñ�Dîë_×=�ù#å+j8béÚºn©
£ãWt|˜
‘Håx÷Å¶¢ 2è±ì¸�#ÑÜdÚJ÷Ì)º�Ê4E.Y<îYµž¿Öß0Ð®šb»!aëkßÌ�#–®½–ÊR†DzÆ»GXÎÛHK0ñìšçâ;DQuwÿ¬Þ]Åš¼Ê„Ü»þ:ºWF±s½‰úD$`.í‘Àü+	ÛˆÔJfú{˜Vz�HÓX“Ú#LK¿#˜ŒrWiœMSÜÃèžÝ•9Z^Ëžîâ›‘MEþCÒ	ôÊÜü—Ößƒô>gE"=æcMÂÏƒ¬	Q�õ‰#~%¼ÂnÍWŠ«§Éy5Ý·ÿ�†ˆ´Œ=‰gþãUä?$lÇÔêKSV@Ô^ï¥ôÐïø=ë@Gº˜Æ»¯â‚ÏÀzwÐ€8÷|ÈšÓ'gl••©^•ÍPiEr;_@÷îÈ®Wl¹šhjðÑ¸å?æa}­„mI·T‡ªf–#‘.î±&ËC,‘zuX¿„ö1ô(‘ŸL›¢\©(Ï|Pþºü—	�FZúKÎ¯.ŒÄ²îP§h8aiï ÑóÓü=Dë=&,˜Šu$ÌrÞP3°^¾£¯ˆ–E¥7§MÊØ&Ÿ–9§ç¬Ì>‰™²à)¦{øpWD$	uŠààˆ¥l•yvˆŽûS€Ñî[àäC5š�.åÍ_t8jî´º6Æj¼û"[ðúC÷ôí„Ù¥òãéSU_Å;:¡üž™îãN�‘Wýe@CÌó¯ià„%Ü@¨®èû¿)/ ¬‘Ïó÷ •;m5‰óìÔr�eG¹Ë^_læ¶¿^S‘7`Ö…qŒµÑº„÷¶‡s$±0IÙÑsbÆYYæ¿IP¬q(SÚ•±(=K3bšÑ¼…ü‡„mu78‘n6ºö¦|„á1Ÿ¦’æó\VúŸÜ÷ÁœÍ"Þº!â<ˆ;´€³³B	ˆýIF’û¿[r'S3ÖÊ§«Æ¥ÍÕÄ¤²K£ãŸìôÔÞQµ1ŒÌà„%}|¥�
õø1ñ¸ÌoC¡Û|"ÅæT5ç1ú€·mºÏâØž�³¡¿ß©ÂƒÆA]+ámÙç&ÂXE'é“»(:©H/Ï*ŽÖ½-ŒUauü'�‹ëD¬Æ¾Ë¦#ÿ!ézeÞ�PŽ³‰taêùÐr�y[²‹Æ·ùÈÎ¼í»c³Öè:¦sYÛ>IÛ•=*¡Æ»¯QÂ+XÆK2ÉH°è¤ÇíU]ú‚Tì¸’:×¿ïŒˆ¤OÈÚ“NþÙß.eË­Êíå8[µÂ;ü=<¯&ad�Ûrt‰Ûºi4å,úùca:’­Â.VÇÝœ«wü¾µçà¬€ÌtÙÖÆj¼ûrWðÞ¶�I'çE'´±o·¬Lù¶¬\mê\Ç:7¤Sƒïé“’^MÆ—HØ6A5ÚG Vë¯ý%íf>FšœZá±|?Ói«3¹a:Ž}”€}›"³¿Ð¸UÇë•]Ìe´ÿó«=æ½]86* ËÁKx?t¥€€ø™L#ÐW+¦+Ÿ‘M•]AÉúÇïR7r§£=Þ¤çDœ0(&]?ÈÊd¬HzM«ÝæÞæ¬µC,Îp�-N�i¨t�ftn�V;ü’¥Ï·¶ý]¯Ùµ»ëãÝÈÒ= ï*L997wÒâ�•]òY7vóu»0`ÁH±7«3¥½i¥ª½Ñ|Ír¬¯•z}ã¼ºy¾ÔßÃ³ÂmÞ.öÄ÷·åàGnkÃ6Ç†ìðFY4µ	ã³Œ"»VîémÿÖ·¥1–ãÝ†È¼qãu)- ~Æ¬4QW|ƒ�;ÑLÖ\í§`dFÄ£ÞŸË�ê1Væä?�ÿH¶<H€·s\"ÌƒxÌ?q[6<js4äêùðß:n=•tN&Â	Gv]ŒÖê„³�‘?L¥¾M±ï.Th…J O»íZG 1¡%Q4×ê 52~(›‘9˜¢“Xƒ7-Ò($óÃ¶hFLÌ|Ñæ?Ž²óò×2³ú,e§^³ˆ-½v3¾ß§ì¸k?fÊú.e_í½Œ�[ð-}ß•ÂãKê ~È5{çooríA?Æ±ÏyKãT»}m¡!ì;)Â¨FÖgñQûÆ Ö»rÚ~ÆÇœ5jâêo¼»0p1”€Œ¹óˆEØ¹ÙiÊ�¬ÏU°Tã´ˆDD¢µ;�Æ¼ˆÉ!îeËû~Æ<T¼Pãµm¡œ_Ø×ƒõ8¶2/^ÊL¼f‰Îú:¾šµüÍú» =§âa˜N.çÍÛÊ)úÑ™¹pw=ì'±øEÎºcwÔÇ½ ü<«‰ÛºŽ75Çr¼»ÐhJ@žø[oˆC'£“¥Š#ò1L}Ö�E5Œ1xÇzZIÆÁhü\EyÂÇ·Ÿ`göYÌüÉ´”Ž­OEm!×`[3¦ÿ‚ìùù�I- ÕùC �êåü¿yÞ—<ÈŠ2()½#Ì›ö¸Ð FGo�Ñ¯}¢½‡Û­{äw¶V^íŽõx÷5|è�{ïË‡ De¤¼)½$k‡jd¯g;ïK‹l¼fk4~NÖëÙ‰úæ¼Ÿ}©ÿGŒÓ¹7{åÏ±Û,«²çôú29ç_ü”"°€öwCL‰S?ˆÐù^lq´&¾ùiž¾o_ïOã_hÀÝÐÒã²¯‰ÇšÛUœ!¤€üñÁ\@,r'%‡/±�4;BÏhk£ÑÏB\ã¾ôˆO¹‡kÌ…££³¬fg÷ú*Y„©Ö®�J!ÓÈ_åïFèot‰g‚¼·ž?Úú³k„¨HHð«�Þ„N¾"z=ëFX]�BåW,Þ{c‡ñî+BìlÈ£Ùpú±ß[NK¦”Gºœÿ˜çüÇœüUŒ—Ž–â-m„é«ìùÚmI�ÿ(�J„ÎƒÔø»	Öx,â&"^ËÞ¿;®gÅ�¹o³š¹ÝëcØ³aÐ¹ÇX_:t¡)>ÁÀÉKÄ2fÆ-ÿq„y¢på8š.mfuÐ”]³Xâó¯ŒPˆzÚÛâ¼'½ÆcÚßÈóW‰ášhuÞË�Fî;Š<ŽÇsÍí!ºÐø´ÎY"–57ù�
íFæD�ì^ýç-åÂÒ�ÃòË…èd?ÈígÜLQ^àh­× Oô5¹ÛêœFGk'b_®lêÐ…^R@z?§„s–Æ1˜�©Œ±“{­÷2ÆÊí­x´�‡fYÃVåï–ØñÕ? a~ÛÔhµ.Þå¼­�æÔ©=!Q×ã·í�õQhìLd±-´€hFgÀAKÀ¨ÿ$¶	Þ©}?¥#«Ób�³æul–RÉ/S•7êv„ûÔÿš[ëÖD5Öx,«ây¤Uc·ÿ¶Ökù"Þï³¡]?H¨1&‚ÉÆÈà %`ÊY1\_[ÚïCÆÿŸÓ¬ÞýMÛžM¿�ªm½;Ÿ&khæ[º0æþÌ|0n€FçDönaêt <hÔÍíØÂVæ/…ò]¶ª÷ÿƒ2„ŸHÐß>Úf¯MðÜ«Óu^ëDß¨QÇê½ûºu»°f�åùµnó©D¼ÇÚÖrÞÆÁ¡WÙ
ç,S¿™ç6ñÚ%çŠw€Æõ¼IBq£¶ÐþÛÎ>ªbî7T6o¡sÙž˜‰È{íùø’•P…Hò Â7?¶0w*žÇ9A&îŽµ–×þ,Zïycaáeä¼§R•Õ±‹d‹€lcŒÉ:â‚s–Ä€ÇØ«Lé+t“·=ŸßQþòÎHƒ†ƒ°öZØD»óü­¿î²ÝnZEïç”ˆEäy¨B¤"¢çýn)t[¶‹it;3-«q[‡u&*D£Îcy„*¾Ö­�0žïNÑG8s°Ø�HÁdÓ¢¿¾–yµ÷gmœ&Y%D
ñ+gw^Ý•œˆ¦ˆd¿0àSÑF ÕÚ~P„È�±¦‰ñ+È7÷&Š ¶ÔyÍS¾dœ *<fCýë5�nsî¯ÙÓà6ÝK‚1ƒ¶ ~M^ûcÕ�ñî5aÌÁ‚€H$ÿñjtóÌ[ùõ›«N8¦ê6jÔ…‰ð9&WOò¯0ú(õšPÏŠH»Ö÷x+b?&)	�±Üö@ÇXbú¶žŒVCkn…£¬Pò‰"Ó¼•=ñ¨ÔÔÜh™,ä(Äà'²u\?rþõÑ–sî¤÷w@dòÔ ô,¼å2!!çïƒþŠ&åÂÑÇÖVó¡äc'DìÖc‚<Êå¤ùÿUWçf»MÄâ+hÈè/[£‘®G"O\(®z5èì1–ŽÝß‡ü¼Ý^'[[Å…žÄ›ŠûÐ¥fò²ÌX9·mLuÞLjÈóä¼�ó+‘{ßÁè»Ø‹B½,ÂR+‘ÈÁ¾}
%è´€pÎ ÇXM8ÆŠ­}ãÒC@’ÀT³™x8ºÓdË©ÜttKÂ7�Ñ‰Fï1:¹Ûî4.IùîëP�c%²©0l¹SAþ£³¶‹œ_-?º™ù'óëxûu1_ÐUÉžÛkeâÇ·ç;¡]K¹9þ>à­Žpô±³p&ñ""nëY*Ã1Œ�,¡ŽïÇè×¼xE'j#?°K=#w˜V$T<(™ßsVáeP€®÷ƒ8}È´ ê8œ}llY8‚DÔ¦˜‘)Æ¾†–èD˜íëíz­Gà�Î‰°ó´µ‰»Ny³áý£Sañ“–}ãþF¼ó6$Óc& ÅaD èD³eÎaÅ>ã©éœÜÉ¨nFÿƒÙé(ä‰VdUæÙáý£…Ìö÷›�®½pö±±pv�|‚#,Q¯Åe*ò¤¶ób§ðÍ›Ž»®WU÷ŠJŸ‰°É“F |Ò¹%TÜ¡íÙ�ÝÑ¬¬ÐñÖ@òj·õ8ü		Eki“2¤&£¦ª@Wøia§˜æê¿§�»;%"¯ôþ,îï½Zû*¼~),,¼˜>Ìmþ>à‰[~bäSŒ2oÿGy–ÔÄ_îäuê=¹Aûž6â)¿ä+néTänýñ~¯9UZ+¼~ÔÏ2Ý£ƒŒ69§]ûÜ^Æ8wä@D»¾öu6Ù¤ct²ŒšGÑ(öÞaæN. ± “ÇX'ãøÞöª+Ô—ÂãG™ìb.#Ðà´%në&8ýèÚga	È@_÷—á¬EgãÒ©4/™¤£ýÐVÙ•ûNîï—örÙä/š"‘¹ùßÆquíTxûØ%Ó—øû€o³¸¶Àé'F@dcäpØbËLV¦’xøiÀÓ®iË�hË´—œãCÎì‰L@Æô�Û¨÷ì·ó{ÁÓÇ*™nàoô!ç6€ã�¿€d¾]ÿÇLuJHÇqèmÑIvEöÎ¬Ð�0
9³p*¯u5¼|,»K½¿ ‹ý}È¥N’é	�Ü”pÚbËÌÍ†pÜ-®]ÎN¸æ}övËjapbXbâŽÇcc!�.¹^>æÉt~–ßÙ5”Yë1�„ó�_–`ýŸÉ‚ÓSÿå? açÓfÅåÌã…‹Þñ}Ðj¬Šü†¿ž¹¹¿ƒ‡�µ€øë}ÈïòVt¦GM@ta	ˆe”Ž[D–>U	aèltòVþzvlÿìÍß2ÆÑÉÌ¾±í©Ì¯‚w�ÐŒ›õþäZ=H¬kb“5¹þ1Ž[D–1ù�(E'ûÙWzÎ>\¼˜å;™—c›HGïG<£�û¯�¢�/xóf@ü"�??˜Ç-¦üÇ›ÈÄ&w’·7†ÿþVì=�#J‡ãXbæ¾‡ Äg˜¢`ÞS Ç-–üÇxœ½$-ÿ9xõ¸'Ó¹±˜�•˜qî‹lÅ¾
»É÷¤ÕæË}*¯	Î[$ù�i*8c)ö­TjUðèq&³ˆïhÖÿ(»Éô(/”ZL¢ñ/»Á7Ââð±í®uÆ¨|8o‘˜òU²ä,o¼yâJz«E!kÝæ£‚.ˆSï[(ˆ‡]çc³eÒ~¯³ò‘¾pÞ"1õ¼8dé%ë‡Á“'îk@ AcaçMNù®ËtÈnt…l²Ê¼·ÿ1Q~¸O­âmmZ©ê‡îdÍÉ.=JäpÆì’ï[Ñ÷§ðä	„Õ»¿	¼òÖ‚($áp›OÌqÚ6¸æpÇ<dþ©h£(Çy¼˜ÝÐö5FîtÖßÔ+Æ²{–*Ž
Ë–’M@deÈHÎªó_‚Oü1VÀ9ÿ“œØ¦�zÍekÌ‰@8Î:gÎ¾WŒ•„âHÀ×ì±íUŽìµ^Vš¹­G‰ìt2ˆê5Yj#é+z¥Áƒ'˜Ö�é;8‹æõäBG¦æÿò–-½\ûb„grKîIáŠH÷ñé¢<"R5ýÎëWßdÚžñ|^}ZIÆAaºDóV.œ²´’çïÀ{‹šÒûH ç0Ùa¯…Xœo«Üæ}n³k_»kµZcàîÒÚ{æšr¶p¤g‰â¤(�±^È«‹8¢²9�¨þÞ¿V6V³Y8î’‚xÐõ‡C–˜eÏ×à¹E‚0¥7ÐÎc*9m^ç1ƒhüu”9íõmÍû�5¸ít/8çh°˜ë®ÓM+Ué1ÖÑ@KÈÂµ¬›ÛÏå4Ð{Üß}œ8s'òé™pÊ’Ê}h×wó�û¼�D'ÓuîÇ9�iTd	¶Æc:Ôu4·SéœL ëÙº2,'›^’µC´£=F®ëŠ€œ�˜øS™wÜ ™m$qMõYælä?$f#à±Å—ù%�Ûï4ê�*ŒR:
ù„r”$§ëÁ}Äù¼P×SUÌý&\Ç*T7‰¶;»$k{´ä<lÙ¥xª 6½Dµ;‘y f~œ²„Öï²³ÙŸÃc‹³"kd ‡}†+5+²„#«	Ž–#«:æãÂ¾˜£F]îæ6å“5âÝ.ói†XvÇLDÎšëtÖŸÖ+ÆäÔ¥•fˆÛ1ÝDä?$•û¨Ò>O-R´:ïåô0ï”Yã6I±¾Ž¦û¬Îm”ãÓ·¯÷§�ä°ª˜2Gnu�ÄXMcì¤Ãq—Ã±_ùhŸµBÔcBìJ…åYpÌÒ±ãÚ*íUðÔb®ÈÒñOz¨Ÿ²¥TEÖÉ›,®/Yß§Ýwa9K»ã°¨§ÔR'ºš·í‰·ˆœ“Œ¿]·#ã…œÆ–‚ƒ(&ã3_gá˜¥24±*ÿxh‘“SèúU Qï‚}ç1ïMþQ$$&çlaì}—ŽüÂîyCžlÛ˜HéP*|´]©p§“ñÂúZä?¤cšÊ<Z¹î©@ïp«sSR‰Çc6Û}Q¹Ž÷ôðKy3Šº_‚¾õg5m‹ˆœÓÈxƒq{Æ³ZÊ�¨öÐN�°“ñi“3à˜¥cÿ‚g–Š€X­¿…¬ðX·%£x¬w›NW8�\ô„ØýD¸NPV’µMôû2J•;­ MtbäNfý¥p­blv]¨FÆä?¤“<¯Ööƒg–’ˆèÜzHn_2îN¯bÝkÈÝv)ïóyu’:8Qó7ÖÀ{¨"m½îÍb“–èÄkýA9ª VVªÚEÑÉ9Ë»²Þ@þC¹�jí§ðÈ£gá-—Ñ¸)ÐƒùoMª¥Sµëø¨$8}ØSyÿ6@Bßê�+g*ÿ§Ý�t:ªN�¨ïÑû8&nAá|ê?oQ¼ÄnŽi—Ä	8h)$ÏtðÈ„ÊW‡zsé(ƒ–NOñ¨ñ˜–Æ$Š3¸Uá'†‡¥2&�FŸâïý
¥Î$(::ºM¶\ìÑ	cvfî0­`'^»��¯Ý
g-J[O,U„f8¿"Ð8Êá¨—|ÞƒÆ“l¼¥ð²X\¾‡f3¡`=J'$1½–ª—”ÓYG¨÷O3Öþ�Õq7“˜Tê/•±ofž*üŒy­÷Jr\Gá¼Å`ù8biçBtÁ:šJ»KÂÒ\ÏÙ‹b[ÑÆo;‘NçôRÞ³T~L]®þßp¯ƒ×ë½ˆ1¸´tŒô5¥.‰DXbî(;Âø5[Òo1ûVÁ8ò„t�¯ÄÐÄ¤(ë¼;ÝbtI6¡^ë1Í�õµ£dóûa'ÒGçÖKi‡FÚåÚÎ^aì=‰‰—"Ü2zï[E�¸œ;Ù‡uKØWzF¹“}pðˆ>@˜¨uÞîôÜPW!Á9YÂÑ•¯°ðâØ7!ìDú½ýë¤¶ˆI6=sj4®S¶Ñ­¢a<~ëR.ñŠ‰�J™o¶®ež¿n;7ÿÛ–íxpøÑ¶åˆ>’*
	Ü\(Lë¥„úAIEÞè–ì,DÐ¹ïÇ)6;}“xãÉž/Ë%% ÂÝpò!E'4“M£ãx!:¡ã®F±G'¬Ã¹›}€¢“}–Pt²Î?;?òLðºI„ÖnÿY°‡ùV‹s«dÄÃmY¿J6®ÈßõºÎÈùJmVßÇƒo‰½Ø·À:°ÅôÏh$·VÃ’>]]Ã<\K©pK2^Ç½ \OÓ›…èäõ‚äQ*qî#o)<nBâöà|ÀY%Q•Õx½©o¼®Yv‘÷m×ç³Ã7ßnò-²ë|[££=~woIîïQ*?’6Wse¬¯gKÒ¹¥ÂÍ’(žÐï£ìŠü:DXÉó�ð¶I+"îª ½!M4òý°¸çæ¯ãu­ê¼æßÕ{,�l×7/¶ùŒŽ6è I
HKR}’bWÏY±)‰šŸÓqÒøJI”
²m`Ÿ¸€�Ýë+r–G çÙÇð²IL¦‘¿*Øƒz£Éµ]ÌUY›ûÄT4™Œë½æÊ�ywÛÏ\Úîˆ*”-´ùº¿œ.]™’Ñ ®P_šˆ{³}©pk2þ”¨ÅÄÄ�bï0}ÇŒ¿v;/¿â¡mÖTææÃË&{bàG{0Þál¢ÜRã6mŽöµ¨¿ÉpE5R^e%	ç)?÷K§.l¬ðYµd¤uÊífm™ög‰¾OÏ¬>[*¼Eü¥Â®]Ìý†ÏZ“ñ©X*ü¼k*@ê­Í`�«²<æýâ+Ý5ßÓÕ·îëÖí‚:�É[çµü{½Û¼/œŸûµË‘€<vw/IÈ™ã¬Œò×å¿Óm+$ãéöîÖèä¸dJ…Ï$ãO%¹xœÐ¼­•Á¹¦-•1zþP Àjâö¬ó˜›D´$ê„�„¯3ïuGK”ay¦Æk^K"t:ÒŸý-oŒH@ª¯ yi‘�éeÚËÅxÿ
ËÂ(wâ¤ÜÉaß½è£§ks¿~)[~Íbr¶;“pâîXxÕƒÖßþ-ØM?Ún¯QôñAØQ�¥S.ãÆ¯åCj8<�Ÿ¿0Yh-òÉ%ÖdzïAå+‰/Dm¥Âzî€èÅëØÌŽ¸°5:9.qÙ«ªîõxÔÔã‚P£:–ðÖ�¢¯Õì�4¸mŠ�eœeP.ãt´~$‰tÁ®<;)¤u§úiùôÌ›¤rSËÍæŸ¥Â4�z	Ê·¢‹ó0û7ã2vò5É–`Ùîýp¥)Jfß#Ø76*í=Eù�„–ö’ œ</Ê>ü’�íVJ€*Œ5‰õkøÊ©�H@Ênï—4Ò¶W>M9YŠ÷¸ÐË£1¸o£ûü-º§÷ˆVHF.*™$& µ‰ªÚb9ÊÒó7»±�&ng"ó!”¿øFx�kÜFuý Ë4:Îj$Q‰ëëù†‹,‘þ©£(¹¤-/2MõY¼{E¢‰ŸRá“¢è~’íÒS™o�´}�-Øþ˜ÍÑ�°ü‡×´w�Û|$‘QÐ>²<HËX“§ÕI)"='*ŽÉgfJ†û^(¦{0Ýã¯�mK@µVSÚïSIæ>*µïÁs‚XÃM?§zm°›}ž§öFÓ–D˜ûç¾I) ?i©Þë6ªÛÅIõEªØÍRîäŠP>Šy©°Ùµ—}­×b‰&Î�«+òäðœ �ˆpº±�»éWx¬ÛRU@–9"k(üØ90y¤íH‹ª´ä35†d|„¤±ZñË¶­gçç¯“påÕóð˜à|	1¾<ßÀ��Úè÷DåAÓ=£NzéNÑHúTÕ{ŽÏùURó¹dÂÊ¾¬‡*¤=P¼ˆ©Ô”°xl¥Äù/à-�ÑóåÁ€�îå$Ž§š€t&R:üÚ¤�v}OÊË²^H…gDíõ^ª6òÏD'üÊp¦
kìÎ˜Wú,•|ã`e¾^D¹Mß²–{¼f×®ÎtuKÝ"íY@ÃÓRD@ÎkMÌ8$/Sß›JÏLë�Ò[è¹y“l÷yGV÷é3Uù;¤ßuž÷<$÷�Z•ò‹‹Êi�Í©$ Ë#¬(ØÐÇ²SJ@ÎVkMÊøA6]õ·”{xhäN¶ÑÕ‹ž‘‘ÌPëBö�Þ+’ddÉAÍ?
®†wáe=ýCÕÉÓ¸“ÚT�Hçb	öæ�×¥¤€´‡¢(Ï|&Ù*¶‚æKÞé}%[­��T«µwÁ+‚ˆ QÚCC�ïŽs:Rª¼7ÜåRíMý’"¥E¤%GRB9*ý•—i’vj«ö=íoi¥ë‹RIÂ–y+¼Á#‚È¿Méø'C%§§�ˆ|éˆükä]½R^@ÚWm¥MQ6Ð|­‡’eFvu¯ŒÖˆã`Žj?©®ÎÍ†'�?ÎÒ»§†‘ò‘•�(çýÄYäëñ²âgP#• ©˜‘u+-k¹PJÏ„ð�œ©ÎwÒ(ó¤8†$‚QíOÁ‚®…æÚá—„šÜ+Ø.ûúT‘E�8Æºù‘\ˆFh1ùVˆLþ0Iõ±Š[�WDŽu
ÙŽØ2ø5m§¼t]DZ:s¹E¡Dd’3ùGž,ëÄ1Ö»ƒ@("0õ›9KéÛïCT:Ú'‘G]Ú*íUô:¼4ûi:9Ô])´¢ö8[�¯�çÑ{˜tÞËI$¾
%"Ï;ìu417iK|WuâK°�)Ð™•„ûÙùÎ¬*ÿ3²ñLUÞ-šÊÜ|v6ûóhßß½_ïýKúYyôsn§œÆ«´ë¢.w›·]=�¢Ž0Á4œE=�Ø�õk“XD:S�5kXD&›ª
ÇÉ	y‡Frö´ˆ)o6S¥}Z(5Í®Ì»Q3ÎTå^Ç¼�§m3Íü‚k˜ª]k41Œþîˆ‘d³è÷KRäH*Ì%QyKQub†¦Øq%g­%"7™][háÓ‰d�H—L�Yw;Ð×÷ùLˆDS½ÊÀ‘'ÎŽäTæ(àå@ìEäÌ  "RH³³¾óXö%›€¬îDS¡`3oé‘ašy¹pä	³üÛáÝ@\È)týŠDbi(É£Õ¸_ñæm)?K0Û@_ïTŠ€ù9œxâòoÁ«�¸¢.ôþ¢u=hÈQÖÕ\rUh}íê\2ýD!�óe*8óÄX½PD �âŽÜlþ	­­GDî°:7P…VrŒƒ§ï‹:! ‚]÷lÃ�)g#ÿ‘ˆns¡\ž$šBJ»DžGD®1ò‡V¸-›R5™Þ2dñ†ë þòo!ÿÿ£«ü{áÀ€8’ëzþ¦p÷I¿á´­—z¿ÈwB2ÝÖ¹(ÄõÑ8g)•=î¢´ïÑ™à¹€xò"zþZˆ]áˆˆÕÄý°ÊcÙ!eùÜQÜ)ùÀ=Ð×c,fdµ™|F&z|­6çíä^E$
kæÿ_8£OÎŽ@qØj¤ºåp×¹’^Áîù{Ä£­ÿc§?;„Q%@Ô^LGZÏ‘@4…#"ÅF×�/Ü–ÍR‘Ïì�‹BÒñ3:BÆÌÏƒc��5ùðP@y§'�Øn42ØÌm]é¶lO•(ä•a(ëí9	ù�ø�*Ñ>¯¤%"Ô¹n©o›=vfžÖ!é4uZD¸‘©�PW ÿ§¤yÞ¿i½ð…ðH@šB¢ãx‡í‘ÉCVGÍ·Ë÷â_6Õù(ä#ç@ŸbLê®¾Í|ù�8tš¯AÒHÆjý5%Øg†Ú·ÞÑn1»—óæÍÉ–Yl+ö½a7ù
FœJIGù�Jä?b*UÚí¹U¹=à}@ÒÐZîûy$""˜ÑÄíù§ËZ³Öc>"6ù6Ì!‹‹¬E¾wìßV‡/»í½y_ú¸Ô›Ö›69N>Æv³ßÎï�’‘4:÷ š§U©�6Âêjüœ·lS	ðúB„"Õv£ï‹�Lr~ß�f°yo÷ñéÍ)•ÿ˜©†“���¦	»¸�ÜÑˆ×{)«ãï‰4?ÒÞþjq6~ÀYë×¸-=ê}ak‰îb»Î÷®Ãè{Øjû}¨íS“J’57Ž>v6Þ¤­ƒo'Gº®³B"X#x<5'~ÊÛ6|ë6ïYç6ŸŠ¥h#YÖyÌÇVðæíó\¶š?›‡ºòúÓK²¶§‚xt'ÆiÀÑÇ&iþ<
HMh8#%Ú�‘t³‡nTä÷�¶Ûk+8kÍBÞº‘:nÿÎmÙGârœœÿéu<‰€`æsÑñXÓZ�é$ý™£k<æ«xËîÏxë¦JÎVû¬ÍQç2q»¢õÏšÙu2mbÆ¡d�ô)ÈÄhÆU	œ Dv1—ÁèøghÚocÔµˆMã±íí>AžÔ•Y³4pöQ�<òfb@" ~¢µ‘HBRÞ•\Iì$£ç>¢ü»½{i—DävÝ†«ÇË’6©®~3N?ª–7�‚ „æµÞ•ÃèÜ“³þôŒÓN˜`![ Ìý"Ñ°	«~Û^$5NfÒ;Ú•_ùHr&Õ»�—Qú?¢wl•_UøiáÅp Dˆ°Z7[Çõ;ó­ŸŸE¶2F¢²«uü,Vï¾;Ûèê¥Õ¿$Økk}M]ú¹Š—ØI·¾všN?z9�hË´—À %Z*º(`õžbVÇÝLG_�Ò‘Ò$²
ŠÞoÙå~fŸ;53º—·üjàÿCÿíM‡©Œ�{�¢›‡è×ÔÅ|AûÈ"Òh‰þíuUDdã4›’j}-òÑ:¶zâ@Ã¸+HvvUDäã4›“f}í<ä?º>¢$or ¤ ŒÁíêòš‘o–•dm“üúÚ9 ëcÙG£Ú
€T‘3C$»*"M²	Òn4”•a|{—Äc~Þ‹xš H1´vûÏH¾îr�ˆ‘;-+ÉÜ%ÙüÇk„ sv*»üÚ'ð$�¢äê¿'Ø�ã,ùËl£$óoåB"_uˆ5à9<A ¤úQV1×—Dàx4J‹•Oç× ÿ‘ä6_»)ûvÓX¡™O €*³ÜÃ¢ÕŸ¢zàÚõRéX—OGþ#"{³`5ëqL÷z½á© ü("zþåh‰HÖÅÝKd§Å. ª9È„mÓú~Á˜¹ù¡šU )ˆð­’œÿü¨‰ÈPóŽž¥Š£¢ÎÌÇø’0ì(ûhÑ2jd�[Xˆñ$ € ß.©ûýÝ¨Mñ5ñÇ©áP”£OzNT@Bæ;ò707Zk„¡¡8¶ „D»"ŒQ‰æÜ.å½kº‹,/"/Ï‚@³òkÓ.˜ƒt/”Òm�&A @xôíëý)9þ�£)"Â‘VZ©xSeÎa!þF’Tj�1�}Ñú¹¡I 9¬á¦ŸÓqÖâèNv5)^Ì©ÖÇ&v}mº�Aþã|{£××Œ×þ=}VM4Ôó>< €N£t8þ‡œÉ£¾áð&ÓÖ´Rå�D	HÚ$ä?:DØQ…ôe�kvÊÐw?  Ë‰õÖ½&ÑÝgBÝëÊ§
„ÜHS¼DQ®†p´‰Çì>_2\KÔ!|.;„½2¸ë Ñ=Ò¢¥Uä`š£.$vÇù8fóÕãâ˜ÿx#âQ¥ÝÉÞ¯ÿâÇÏ‚[“crõÄ� ˆ�ˆœéX?‹u¼YÃ[Ò&ª~ˆ}þC&ÌrJeá8Â¼Üÿcª°:Ôîúÿ«KÊ   ÜHÄSLg_¬öºg×Õ¥—ªb6Ý7mrFª
GSöL:®r;¶·»Þ§ÉFb®  n¨�^yë®w_¬,ó®õi•û¢- 3S0ÿñzÁ
–Ï)dÐó»5N�» wZ{E^‰¥ˆ´ÉEe%ªÝÑ�¬¹)“ÿhfg÷úŠù£yµŸëú…Æà¼w1  ¡0:~h,�´ÚLí5ïTŒÉ®íÊ�FªøJV“þ¨Š™Õ{{³µÖÏul¢<Öµ×{)î\ €8Ž´tÞî¬Žÿ$Ö"Òb&×qa4
uµïï>6²†Äô)Ê¤NŽ³“®YH�€ý^7_Ÿ­ãúán ˆJÄ2:÷_)"9!Îñ‡PTòRvCÏÅñ°Ö×ÎÒ$Ý1óf¯•ÌÃÅKYw,ÀujÖø)êBï/p“ D�p¶Í‰¾aqÝªß$“½!˜˜¨ßÌI’•²ÚÍÌØëþ«ñØkC\—Í½Ç€»  )çŽMâ-$-br½y{Æ³ùëÓJU{º�Oo™Ü}‚Lê«dkÙñý1·›×ÓuuN
¹aîD €$FÃÓñÉ#äÐ%BHZÌÊÍ¼çº:ÕËùß1sz­jY�$‰(#ïójïÏ™‘?¢Þ�ua¿_ÿ¡FÇeâî $¬�»B£ç&�ƒ;ž0!9;ƒ‹;Í£
¥'‹²3ú.b*òÈaŸÁò¦ì+}¾`Ÿ»nsEô:#|o›XïÁÝ HJ2‹øt´5S8bI¸�œSÙÅ�ÒÜ`mdï7,c_î·8»¼Ïvnþ·-N]è§ˆžPœ ³‘�Ce¶“¯YÄŽ¸„nZÃØ�‡»ðú¢<­Ýþ3Üa €¤§¥ìWï.F‡‹JHü‹‹OÃ»öÐj×zöÏÆìýºÏ™Ç1£|Æ<7`óòuŸg�í·„×o‰Ïç-ÿß“—j)ú2û^ý2v¸ùf¨­�q:�„‘»ˆÀÜ{…1$tLøKÜQ €”#×ìý9Â'Èn½�ˆÇöÓQÕ(­Î{9î  @Ê#ì¡c˜ÁÑß€˜TÖ@×ç~LÍ € dsÂ7lr˜!´…ªªhW‡—¸w  „�à0…i±ŒÁ=]˜›RÂaà¿§®þq9z·w  tQLÈ¡ê4:~rG&;„÷§Ñy
m  @ŒP{³¨Óúrºÿ�çì­ØÆ–9UF~ D  �dÝj:êÎêùÙÂnomtW¯•"ªt|z   2²‹¼Ï”Cy¶ÅaŸÙžx4®Éoªšbuî÷èç�ÖèÝ7B0  @ªÐ¸ù“«§0�¶eì¼�OÇG¯µ8yÿuÈ¯'§¿KXºrŒ|KR¿%ÒY@{PæÑß/šúèXm‰E>k¸éç¸à  �‚½ŒÕúëö†                                                                                                                                                                                                                                                            €³üF£P«–    IEND®B`‚{
  "Blackberry PlayBook": {
    "userAgent": "Mozilla/5.0 (PlayBook; U; RIM Tablet OS 2.1.0; en-US) AppleWebKit/536.2+ (KHTML like Gecko) Version/26.5 Safari/536.2+",
    "viewport": {
      "width": 600,
      "height": 1024
    },
    "deviceScaleFactor": 1,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "webkit"
  },
  "Blackberry PlayBook landscape": {
    "userAgent": "Mozilla/5.0 (PlayBook; U; RIM Tablet OS 2.1.0; en-US) AppleWebKit/536.2+ (KHTML like Gecko) Version/26.5 Safari/536.2+",
    "viewport": {
      "width": 1024,
      "height": 600
    },
    "deviceScaleFactor": 1,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "webkit"
  },
  "BlackBerry Z30": {
    "userAgent": "Mozilla/5.0 (BB10; Touch) AppleWebKit/537.10+ (KHTML, like Gecko) Version/26.5 Mobile Safari/537.10+",
    "viewport": {
      "width": 360,
      "height": 640
    },
    "deviceScaleFactor": 2,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "webkit"
  },
  "BlackBerry Z30 landscape": {
    "userAgent": "Mozilla/5.0 (BB10; Touch) AppleWebKit/537.10+ (KHTML, like Gecko) Version/26.5 Mobile Safari/537.10+",
    "viewport": {
      "width": 640,
      "height": 360
    },
    "deviceScaleFactor": 2,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "webkit"
  },
  "Galaxy Note 3": {
    "userAgent": "Mozilla/5.0 (Linux; U; Android 4.3; en-us; SM-N900T Build/JSS15J) AppleWebKit/534.30 (KHTML, like Gecko) Version/26.5 Mobile Safari/534.30",
    "viewport": {
      "width": 360,
      "height": 640
    },
    "deviceScaleFactor": 3,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "webkit"
  },
  "Galaxy Note 3 landscape": {
    "userAgent": "Mozilla/5.0 (Linux; U; Android 4.3; en-us; SM-N900T Build/JSS15J) AppleWebKit/534.30 (KHTML, like Gecko) Version/26.5 Mobile Safari/534.30",
    "viewport": {
      "width": 640,
      "height": 360
    },
    "deviceScaleFactor": 3,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "webkit"
  },
  "Galaxy Note II": {
    "userAgent": "Mozilla/5.0 (Linux; U; Android 4.1; en-us; GT-N7100 Build/JRO03C) AppleWebKit/534.30 (KHTML, like Gecko) Version/26.5 Mobile Safari/534.30",
    "viewport": {
      "width": 360,
      "height": 640
    },
    "deviceScaleFactor": 2,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "webkit"
  },
  "Galaxy Note II landscape": {
    "userAgent": "Mozilla/5.0 (Linux; U; Android 4.1; en-us; GT-N7100 Build/JRO03C) AppleWebKit/534.30 (KHTML, like Gecko) Version/26.5 Mobile Safari/534.30",
    "viewport": {
      "width": 640,
      "height": 360
    },
    "deviceScaleFactor": 2,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "webkit"
  },
  "Galaxy S III": {
    "userAgent": "Mozilla/5.0 (Linux; U; Android 4.0; en-us; GT-I9300 Build/IMM76D) AppleWebKit/534.30 (KHTML, like Gecko) Version/26.5 Mobile Safari/534.30",
    "viewport": {
      "width": 360,
      "height": 640
    },
    "deviceScaleFactor": 2,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "webkit"
  },
  "Galaxy S III landscape": {
    "userAgent": "Mozilla/5.0 (Linux; U; Android 4.0; en-us; GT-I9300 Build/IMM76D) AppleWebKit/534.30 (KHTML, like Gecko) Version/26.5 Mobile Safari/534.30",
    "viewport": {
      "width": 640,
      "height": 360
    },
    "deviceScaleFactor": 2,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "webkit"
  },
  "Galaxy S5": {
    "userAgent": "Mozilla/5.0 (Linux; Android 5.0; SM-G900P Build/LRX21T) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
    "viewport": {
      "width": 360,
      "height": 640
    },
    "deviceScaleFactor": 3,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "chromium"
  },
  "Galaxy S5 landscape": {
    "userAgent": "Mozilla/5.0 (Linux; Android 5.0; SM-G900P Build/LRX21T) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
    "viewport": {
      "width": 640,
      "height": 360
    },
    "deviceScaleFactor": 3,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "chromium"
  },
  "Galaxy S8": {
    "userAgent": "Mozilla/5.0 (Linux; Android 7.0; SM-G950U Build/NRD90M) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
    "viewport": {
      "width": 360,
      "height": 740
    },
    "deviceScaleFactor": 3,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "chromium"
  },
  "Galaxy S8 landscape": {
    "userAgent": "Mozilla/5.0 (Linux; Android 7.0; SM-G950U Build/NRD90M) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
    "viewport": {
      "width": 740,
      "height": 360
    },
    "deviceScaleFactor": 3,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "chromium"
  },
  "Galaxy S9+": {
    "userAgent": "Mozilla/5.0 (Linux; Android 8.0.0; SM-G965U Build/R16NW) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
    "viewport": {
      "width": 320,
      "height": 658
    },
    "deviceScaleFactor": 4.5,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "chromium"
  },
  "Galaxy S9+ landscape": {
    "userAgent": "Mozilla/5.0 (Linux; Android 8.0.0; SM-G965U Build/R16NW) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
    "viewport": {
      "width": 658,
      "height": 320
    },
    "deviceScaleFactor": 4.5,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "chromium"
  },
  "Galaxy S24": {
    "userAgent": "Mozilla/5.0 (Linux; Android 14; SM-S921U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
    "viewport": {
      "width": 360,
      "height": 780
    },
    "deviceScaleFactor": 3,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "chromium"
  },
  "Galaxy S24 landscape": {
    "userAgent": "Mozilla/5.0 (Linux; Android 14; SM-S921U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
    "viewport": {
      "width": 780,
      "height": 360
    },
    "deviceScaleFactor": 3,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "chromium"
  },
  "Galaxy A55": {
    "userAgent": "Mozilla/5.0 (Linux; Android 14; SM-A556B) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
    "viewport": {
      "width": 480,
      "height": 1040
    },
    "deviceScaleFactor": 2.25,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "chromium"
  },
  "Galaxy A55 landscape": {
    "userAgent": "Mozilla/5.0 (Linux; Android 14; SM-A556B) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
    "viewport": {
      "width": 1040,
      "height": 480
    },
    "deviceScaleFactor": 2.25,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "chromium"
  },
  "Galaxy Tab S4": {
    "userAgent": "Mozilla/5.0 (Linux; Android 8.1.0; SM-T837A) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Safari/537.36",
    "viewport": {
      "width": 712,
      "height": 1138
    },
    "deviceScaleFactor": 2.25,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "chromium"
  },
  "Galaxy Tab S4 landscape": {
    "userAgent": "Mozilla/5.0 (Linux; Android 8.1.0; SM-T837A) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Safari/537.36",
    "viewport": {
      "width": 1138,
      "height": 712
    },
    "deviceScaleFactor": 2.25,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "chromium"
  },
  "Galaxy Tab S9": {
    "userAgent": "Mozilla/5.0 (Linux; Android 14; SM-X710) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Safari/537.36",
    "viewport": {
      "width": 640,
      "height": 1024
    },
    "deviceScaleFactor": 2.5,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "chromium"
  },
  "Galaxy Tab S9 landscape": {
    "userAgent": "Mozilla/5.0 (Linux; Android 14; SM-X710) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Safari/537.36",
    "viewport": {
      "width": 1024,
      "height": 640
    },
    "deviceScaleFactor": 2.5,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "chromium"
  },
  "Galaxy Z Fold 6": {
    "userAgent": "Mozilla/5.0 (Linux; Android 10; SM-F956U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
    "screen": {
      "width": 928,
      "height": 1080
    },
    "viewport": {
      "width": 928,
      "height": 1004
    },
    "deviceScaleFactor": 2,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "chromium"
  },
  "Galaxy Z Fold 6 landscape": {
    "userAgent": "Mozilla/5.0 (Linux; Android 10; SM-F956U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
    "screen": {
      "width": 1080,
      "height": 928
    },
    "viewport": {
      "width": 1028,
      "height": 876
    },
    "deviceScaleFactor": 2,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "chromium"
  },
  "Galaxy Z Fold 6 Cover": {
    "userAgent": "Mozilla/5.0 (Linux; Android 10; SM-F956U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
    "screen": {
      "width": 484,
      "height": 1188
    },
    "viewport": {
      "width": 484,
      "height": 1112
    },
    "deviceScaleFactor": 2,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "chromium"
  },
  "Galaxy Z Fold 6 Cover landscape": {
    "userAgent": "Mozilla/5.0 (Linux; Android 10; SM-F956U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
    "screen": {
      "width": 1188,
      "height": 484
    },
    "viewport": {
      "width": 1136,
      "height": 432
    },
    "deviceScaleFactor": 2,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "chromium"
  },
  "Galaxy Z Fold 7": {
    "userAgent": "Mozilla/5.0 (Linux; Android 10; SM-F966U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
    "screen": {
      "width": 984,
      "height": 1092
    },
    "viewport": {
      "width": 984,
      "height": 1016
    },
    "deviceScaleFactor": 2,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "chromium"
  },
  "Galaxy Z Fold 7 landscape": {
    "userAgent": "Mozilla/5.0 (Linux; Android 10; SM-F966U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
    "screen": {
      "width": 1092,
      "height": 984
    },
    "viewport": {
      "width": 1040,
      "height": 932
    },
    "deviceScaleFactor": 2,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "chromium"
  },
  "Galaxy Z Fold 7 Cover": {
    "userAgent": "Mozilla/5.0 (Linux; Android 10; SM-F966U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
    "screen": {
      "width": 360,
      "height": 840
    },
    "viewport": {
      "width": 360,
      "height": 764
    },
    "deviceScaleFactor": 3,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "chromium"
  },
  "Galaxy Z Fold 7 Cover landscape": {
    "userAgent": "Mozilla/5.0 (Linux; Android 10; SM-F966U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
    "screen": {
      "width": 840,
      "height": 360
    },
    "viewport": {
      "width": 788,
      "height": 308
    },
    "deviceScaleFactor": 3,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "chromium"
  },
  "Galaxy Z Flip 6": {
    "userAgent": "Mozilla/5.0 (Linux; Android 10; SM-F741U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
    "screen": {
      "width": 360,
      "height": 880
    },
    "viewport": {
      "width": 360,
      "height": 804
    },
    "deviceScaleFactor": 3,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "chromium"
  },
  "Galaxy Z Flip 6 landscape": {
    "userAgent": "Mozilla/5.0 (Linux; Android 10; SM-F741U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
    "screen": {
      "width": 880,
      "height": 360
    },
    "viewport": {
      "width": 828,
      "height": 308
    },
    "deviceScaleFactor": 3,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "chromium"
  },
  "Galaxy Z Flip 6 Cover": {
    "userAgent": "Mozilla/5.0 (Linux; Android 10; SM-F741U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
    "screen": {
      "width": 360,
      "height": 374
    },
    "viewport": {
      "width": 360,
      "height": 298
    },
    "deviceScaleFactor": 2,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "chromium"
  },
  "Galaxy Z Flip 6 Cover landscape": {
    "userAgent": "Mozilla/5.0 (Linux; Android 10; SM-F741U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
    "screen": {
      "width": 374,
      "height": 360
    },
    "viewport": {
      "width": 322,
      "height": 308
    },
    "deviceScaleFactor": 2,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "chromium"
  },
  "Galaxy Z Flip 7": {
    "userAgent": "Mozilla/5.0 (Linux; Android 10; SM-F761U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
    "screen": {
      "width": 360,
      "height": 840
    },
    "viewport": {
      "width": 360,
      "height": 764
    },
    "deviceScaleFactor": 3,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "chromium"
  },
  "Galaxy Z Flip 7 landscape": {
    "userAgent": "Mozilla/5.0 (Linux; Android 10; SM-F761U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
    "screen": {
      "width": 840,
      "height": 360
    },
    "viewport": {
      "width": 788,
      "height": 308
    },
    "deviceScaleFactor": 3,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "chromium"
  },
  "Galaxy Z Flip 7 Cover": {
    "userAgent": "Mozilla/5.0 (Linux; Android 10; SM-F761U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
    "screen": {
      "width": 474,
      "height": 524
    },
    "viewport": {
      "width": 474,
      "height": 448
    },
    "deviceScaleFactor": 2,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "chromium"
  },
  "Galaxy Z Flip 7 Cover landscape": {
    "userAgent": "Mozilla/5.0 (Linux; Android 10; SM-F761U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
    "screen": {
      "width": 524,
      "height": 474
    },
    "viewport": {
      "width": 472,
      "height": 422
    },
    "deviceScaleFactor": 2,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "chromium"
  },
  "iPad (gen 5)": {
    "userAgent": "Mozilla/5.0 (iPad; CPU OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
    "viewport": {
      "width": 768,
      "height": 1024
    },
    "deviceScaleFactor": 2,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "webkit"
  },
  "iPad (gen 5) landscape": {
    "userAgent": "Mozilla/5.0 (iPad; CPU OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
    "viewport": {
      "width": 1024,
      "height": 768
    },
    "deviceScaleFactor": 2,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "webkit"
  },
  "iPad (gen 6)": {
    "userAgent": "Mozilla/5.0 (iPad; CPU OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
    "viewport": {
      "width": 768,
      "height": 1024
    },
    "deviceScaleFactor": 2,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "webkit"
  },
  "iPad (gen 6) landscape": {
    "userAgent": "Mozilla/5.0 (iPad; CPU OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
    "viewport": {
      "width": 1024,
      "height": 768
    },
    "deviceScaleFactor": 2,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "webkit"
  },
  "iPad (gen 7)": {
    "userAgent": "Mozilla/5.0 (iPad; CPU OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
    "viewport": {
      "width": 810,
      "height": 1080
    },
    "deviceScaleFactor": 2,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "webkit"
  },
  "iPad (gen 7) landscape": {
    "userAgent": "Mozilla/5.0 (iPad; CPU OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
    "viewport": {
      "width": 1080,
      "height": 810
    },
    "deviceScaleFactor": 2,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "webkit"
  },
  "iPad (gen 11)": {
    "userAgent": "Mozilla/5.0 (iPad; CPU OS 18_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/19E241 Safari/604.1",
    "viewport": {
      "width": 656,
      "height": 944
    },
    "deviceScaleFactor": 2.5,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "webkit"
  },
  "iPad (gen 11) landscape": {
    "userAgent": "Mozilla/5.0 (iPad; CPU OS 18_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/19E241 Safari/604.1",
    "viewport": {
      "width": 944,
      "height": 656
    },
    "deviceScaleFactor": 2.5,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "webkit"
  },
  "iPad Mini": {
    "userAgent": "Mozilla/5.0 (iPad; CPU OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
    "viewport": {
      "width": 768,
      "height": 1024
    },
    "deviceScaleFactor": 2,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "webkit"
  },
  "iPad Mini landscape": {
    "userAgent": "Mozilla/5.0 (iPad; CPU OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
    "viewport": {
      "width": 1024,
      "height": 768
    },
    "deviceScaleFactor": 2,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "webkit"
  },
  "iPad Pro 11": {
    "userAgent": "Mozilla/5.0 (iPad; CPU OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
    "viewport": {
      "width": 834,
      "height": 1194
    },
    "deviceScaleFactor": 2,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "webkit"
  },
  "iPad Pro 11 landscape": {
    "userAgent": "Mozilla/5.0 (iPad; CPU OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
    "viewport": {
      "width": 1194,
      "height": 834
    },
    "deviceScaleFactor": 2,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "webkit"
  },
  "iPhone 6": {
    "userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/26.5 Mobile/15A372 Safari/604.1",
    "viewport": {
      "width": 375,
      "height": 667
    },
    "deviceScaleFactor": 2,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "webkit"
  },
  "iPhone 6 landscape": {
    "userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/26.5 Mobile/15A372 Safari/604.1",
    "viewport": {
      "width": 667,
      "height": 375
    },
    "deviceScaleFactor": 2,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "webkit"
  },
  "iPhone 6 Plus": {
    "userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/26.5 Mobile/15A372 Safari/604.1",
    "viewport": {
      "width": 414,
      "height": 736
    },
    "deviceScaleFactor": 3,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "webkit"
  },
  "iPhone 6 Plus landscape": {
    "userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/26.5 Mobile/15A372 Safari/604.1",
    "viewport": {
      "width": 736,
      "height": 414
    },
    "deviceScaleFactor": 3,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "webkit"
  },
  "iPhone 7": {
    "userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/26.5 Mobile/15A372 Safari/604.1",
    "viewport": {
      "width": 375,
      "height": 667
    },
    "deviceScaleFactor": 2,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "webkit"
  },
  "iPhone 7 landscape": {
    "userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/26.5 Mobile/15A372 Safari/604.1",
    "viewport": {
      "width": 667,
      "height": 375
    },
    "deviceScaleFactor": 2,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "webkit"
  },
  "iPhone 7 Plus": {
    "userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/26.5 Mobile/15A372 Safari/604.1",
    "viewport": {
      "width": 414,
      "height": 736
    },
    "deviceScaleFactor": 3,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "webkit"
  },
  "iPhone 7 Plus landscape": {
    "userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/26.5 Mobile/15A372 Safari/604.1",
    "viewport": {
      "width": 736,
      "height": 414
    },
    "deviceScaleFactor": 3,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "webkit"
  },
  "iPhone 8": {
    "userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/26.5 Mobile/15A372 Safari/604.1",
    "viewport": {
      "width": 375,
      "height": 667
    },
    "deviceScaleFactor": 2,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "webkit"
  },
  "iPhone 8 landscape": {
    "userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/26.5 Mobile/15A372 Safari/604.1",
    "viewport": {
      "width": 667,
      "height": 375
    },
    "deviceScaleFactor": 2,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "webkit"
  },
  "iPhone 8 Plus": {
    "userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/26.5 Mobile/15A372 Safari/604.1",
    "viewport": {
      "width": 414,
      "height": 736
    },
    "deviceScaleFactor": 3,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "webkit"
  },
  "iPhone 8 Plus landscape": {
    "userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/26.5 Mobile/15A372 Safari/604.1",
    "viewport": {
      "width": 736,
      "height": 414
    },
    "deviceScaleFactor": 3,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "webkit"
  },
  "iPhone SE": {
    "userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 10_3_1 like Mac OS X) AppleWebKit/603.1.30 (KHTML, like Gecko) Version/26.5 Mobile/14E304 Safari/602.1",
    "viewport": {
      "width": 320,
      "height": 568
    },
    "deviceScaleFactor": 2,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "webkit"
  },
  "iPhone SE landscape": {
    "userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 10_3_1 like Mac OS X) AppleWebKit/603.1.30 (KHTML, like Gecko) Version/26.5 Mobile/14E304 Safari/602.1",
    "viewport": {
      "width": 568,
      "height": 320
    },
    "deviceScaleFactor": 2,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "webkit"
  },
  "iPhone SE (3rd gen)": {
    "userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_5 like Mac OS X) AppleWebKit/603.1.30 (KHTML, like Gecko) Version/26.5 Mobile/19E241 Safari/602.1",
    "viewport": {
      "width": 375,
      "height": 667
    },
    "deviceScaleFactor": 2,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "webkit"
  },
  "iPhone SE (3rd gen) landscape": {
    "userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_5 like Mac OS X) AppleWebKit/603.1.30 (KHTML, like Gecko) Version/26.5 Mobile/19E241 Safari/602.1",
    "viewport": {
      "width": 667,
      "height": 375
    },
    "deviceScaleFactor": 2,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "webkit"
  },
  "iPhone X": {
    "userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/26.5 Mobile/15A372 Safari/604.1",
    "viewport": {
      "width": 375,
      "height": 812
    },
    "deviceScaleFactor": 3,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "webkit"
  },
  "iPhone X landscape": {
    "userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/26.5 Mobile/15A372 Safari/604.1",
    "viewport": {
      "width": 812,
      "height": 375
    },
    "deviceScaleFactor": 3,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "webkit"
  },
  "iPhone XR": {
    "userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 12_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
    "viewport": {
      "width": 414,
      "height": 896
    },
    "deviceScaleFactor": 3,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "webkit"
  },
  "iPhone XR landscape": {
    "userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 12_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
    "viewport": {
      "width": 896,
      "height": 414
    },
    "deviceScaleFactor": 3,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "webkit"
  },
  "iPhone 11": {
    "userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
    "screen": {
      "width": 414,
      "height": 896
    },
    "viewport": {
      "width": 414,
      "height": 715
    },
    "deviceScaleFactor": 2,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "webkit"
  },
  "iPhone 11 landscape": {
    "userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
    "screen": {
      "width": 414,
      "height": 896
    },
    "viewport": {
      "width": 800,
      "height": 364
    },
    "deviceScaleFactor": 2,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "webkit"
  },
  "iPhone 11 Pro": {
    "userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
    "screen": {
      "width": 375,
      "height": 812
    },
    "viewport": {
      "width": 375,
      "height": 635
    },
    "deviceScaleFactor": 3,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "webkit"
  },
  "iPhone 11 Pro landscape": {
    "userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
    "screen": {
      "width": 375,
      "height": 812
    },
    "viewport": {
      "width": 724,
      "height": 325
    },
    "deviceScaleFactor": 3,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "webkit"
  },
  "iPhone 11 Pro Max": {
    "userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
    "screen": {
      "width": 414,
      "height": 896
    },
    "viewport": {
      "width": 414,
      "height": 715
    },
    "deviceScaleFactor": 3,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "webkit"
  },
  "iPhone 11 Pro Max landscape": {
    "userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
    "screen": {
      "width": 414,
      "height": 896
    },
    "viewport": {
      "width": 808,
      "height": 364
    },
    "deviceScaleFactor": 3,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "webkit"
  },
  "iPhone 12": {
    "userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
    "screen": {
      "width": 390,
      "height": 844
    },
    "viewport": {
      "width": 390,
      "height": 664
    },
    "deviceScaleFactor": 3,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "webkit"
  },
  "iPhone 12 landscape": {
    "userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
    "screen": {
      "width": 390,
      "height": 844
    },
    "viewport": {
      "width": 750,
      "height": 340
    },
    "deviceScaleFactor": 3,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "webkit"
  },
  "iPhone 12 Pro": {
    "userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
    "screen": {
      "width": 390,
      "height": 844
    },
    "viewport": {
      "width": 390,
      "height": 664
    },
    "deviceScaleFactor": 3,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "webkit"
  },
  "iPhone 12 Pro landscape": {
    "userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
    "screen": {
      "width": 390,
      "height": 844
    },
    "viewport": {
      "width": 750,
      "height": 340
    },
    "deviceScaleFactor": 3,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "webkit"
  },
  "iPhone 12 Pro Max": {
    "userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
    "screen": {
      "width": 428,
      "height": 926
    },
    "viewport": {
      "width": 428,
      "height": 746
    },
    "deviceScaleFactor": 3,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "webkit"
  },
  "iPhone 12 Pro Max landscape": {
    "userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
    "screen": {
      "width": 428,
      "height": 926
    },
    "viewport": {
      "width": 832,
      "height": 378
    },
    "deviceScaleFactor": 3,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "webkit"
  },
  "iPhone 12 Mini": {
    "userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
    "screen": {
      "width": 375,
      "height": 812
    },
    "viewport": {
      "width": 375,
      "height": 629
    },
    "deviceScaleFactor": 3,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "webkit"
  },
  "iPhone 12 Mini landscape": {
    "userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
    "screen": {
      "width": 375,
      "height": 812
    },
    "viewport": {
      "width": 712,
      "height": 325
    },
    "deviceScaleFactor": 3,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "webkit"
  },
  "iPhone 13": {
    "userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 15_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
    "screen": {
      "width": 390,
      "height": 844
    },
    "viewport": {
      "width": 390,
      "height": 664
    },
    "deviceScaleFactor": 3,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "webkit"
  },
  "iPhone 13 landscape": {
    "userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 15_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
    "screen": {
      "width": 390,
      "height": 844
    },
    "viewport": {
      "width": 750,
      "height": 342
    },
    "deviceScaleFactor": 3,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "webkit"
  },
  "iPhone 13 Pro": {
    "userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 15_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
    "screen": {
      "width": 390,
      "height": 844
    },
    "viewport": {
      "width": 390,
      "height": 664
    },
    "deviceScaleFactor": 3,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "webkit"
  },
  "iPhone 13 Pro landscape": {
    "userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 15_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
    "screen": {
      "width": 390,
      "height": 844
    },
    "viewport": {
      "width": 750,
      "height": 342
    },
    "deviceScaleFactor": 3,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "webkit"
  },
  "iPhone 13 Pro Max": {
    "userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 15_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
    "screen": {
      "width": 428,
      "height": 926
    },
    "viewport": {
      "width": 428,
      "height": 746
    },
    "deviceScaleFactor": 3,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "webkit"
  },
  "iPhone 13 Pro Max landscape": {
    "userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 15_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
    "screen": {
      "width": 428,
      "height": 926
    },
    "viewport": {
      "width": 832,
      "height": 380
    },
    "deviceScaleFactor": 3,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "webkit"
  },
  "iPhone 13 Mini": {
    "userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 15_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
    "screen": {
      "width": 375,
      "height": 812
    },
    "viewport": {
      "width": 375,
      "height": 629
    },
    "deviceScaleFactor": 3,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "webkit"
  },
  "iPhone 13 Mini landscape": {
    "userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 15_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
    "screen": {
      "width": 375,
      "height": 812
    },
    "viewport": {
      "width": 712,
      "height": 327
    },
    "deviceScaleFactor": 3,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "webkit"
  },
  "iPhone 14": {
    "userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 16_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
    "screen": {
      "width": 390,
      "height": 844
    },
    "viewport": {
      "width": 390,
      "height": 664
    },
    "deviceScaleFactor": 3,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "webkit"
  },
  "iPhone 14 landscape": {
    "userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 16_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
    "screen": {
      "width": 390,
      "height": 844
    },
    "viewport": {
      "width": 750,
      "height": 340
    },
    "deviceScaleFactor": 3,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "webkit"
  },
  "iPhone 14 Plus": {
    "userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 16_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
    "screen": {
      "width": 428,
      "height": 926
    },
    "viewport": {
      "width": 428,
      "height": 746
    },
    "deviceScaleFactor": 3,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "webkit"
  },
  "iPhone 14 Plus landscape": {
    "userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 16_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
    "screen": {
      "width": 428,
      "height": 926
    },
    "viewport": {
      "width": 832,
      "height": 378
    },
    "deviceScaleFactor": 3,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "webkit"
  },
  "iPhone 14 Pro": {
    "userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 16_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
    "screen": {
      "width": 393,
      "height": 852
    },
    "viewport": {
      "width": 393,
      "height": 660
    },
    "deviceScaleFactor": 3,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "webkit"
  },
  "iPhone 14 Pro landscape": {
    "userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 16_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
    "screen": {
      "width": 393,
      "height": 852
    },
    "viewport": {
      "width": 734,
      "height": 343
    },
    "deviceScaleFactor": 3,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "webkit"
  },
  "iPhone 14 Pro Max": {
    "userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 16_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
    "screen": {
      "width": 430,
      "height": 932
    },
    "viewport": {
      "width": 430,
      "height": 740
    },
    "deviceScaleFactor": 3,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "webkit"
  },
  "iPhone 14 Pro Max landscape": {
    "userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 16_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
    "screen": {
      "width": 430,
      "height": 932
    },
    "viewport": {
      "width": 814,
      "height": 380
    },
    "deviceScaleFactor": 3,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "webkit"
  },
  "iPhone 15": {
    "userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 17_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
    "screen": {
      "width": 393,
      "height": 852
    },
    "viewport": {
      "width": 393,
      "height": 659
    },
    "deviceScaleFactor": 3,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "webkit"
  },
  "iPhone 15 landscape": {
    "userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 17_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
    "screen": {
      "width": 393,
      "height": 852
    },
    "viewport": {
      "width": 734,
      "height": 343
    },
    "deviceScaleFactor": 3,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "webkit"
  },
  "iPhone 15 Plus": {
    "userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 17_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
    "screen": {
      "width": 430,
      "height": 932
    },
    "viewport": {
      "width": 430,
      "height": 739
    },
    "deviceScaleFactor": 3,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "webkit"
  },
  "iPhone 15 Plus landscape": {
    "userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 17_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
    "screen": {
      "width": 430,
      "height": 932
    },
    "viewport": {
      "width": 814,
      "height": 380
    },
    "deviceScaleFactor": 3,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "webkit"
  },
  "iPhone 15 Pro": {
    "userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 17_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
    "screen": {
      "width": 393,
      "height": 852
    },
    "viewport": {
      "width": 393,
      "height": 659
    },
    "deviceScaleFactor": 3,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "webkit"
  },
  "iPhone 15 Pro landscape": {
    "userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 17_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
    "screen": {
      "width": 393,
      "height": 852
    },
    "viewport": {
      "width": 734,
      "height": 343
    },
    "deviceScaleFactor": 3,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "webkit"
  },
  "iPhone 15 Pro Max": {
    "userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 17_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
    "screen": {
      "width": 430,
      "height": 932
    },
    "viewport": {
      "width": 430,
      "height": 739
    },
    "deviceScaleFactor": 3,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "webkit"
  },
  "iPhone 15 Pro Max landscape": {
    "userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 17_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
    "screen": {
      "width": 430,
      "height": 932
    },
    "viewport": {
      "width": 814,
      "height": 380
    },
    "deviceScaleFactor": 3,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "webkit"
  },
  "iPhone 16": {
    "userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
    "screen": {
      "width": 393,
      "height": 852
    },
    "viewport": {
      "width": 393,
      "height": 659
    },
    "deviceScaleFactor": 3,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "webkit"
  },
  "iPhone 16 landscape": {
    "userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
    "screen": {
      "width": 393,
      "height": 852
    },
    "viewport": {
      "width": 734,
      "height": 343
    },
    "deviceScaleFactor": 3,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "webkit"
  },
  "iPhone 16 Plus": {
    "userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
    "screen": {
      "width": 430,
      "height": 932
    },
    "viewport": {
      "width": 430,
      "height": 739
    },
    "deviceScaleFactor": 3,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "webkit"
  },
  "iPhone 16 Plus landscape": {
    "userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
    "screen": {
      "width": 430,
      "height": 932
    },
    "viewport": {
      "width": 814,
      "height": 380
    },
    "deviceScaleFactor": 3,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "webkit"
  },
  "iPhone 16 Pro": {
    "userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
    "screen": {
      "width": 402,
      "height": 874
    },
    "viewport": {
      "width": 402,
      "height": 681
    },
    "deviceScaleFactor": 3,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "webkit"
  },
  "iPhone 16 Pro landscape": {
    "userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
    "screen": {
      "width": 402,
      "height": 874
    },
    "viewport": {
      "width": 756,
      "height": 352
    },
    "deviceScaleFactor": 3,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "webkit"
  },
  "iPhone 16 Pro Max": {
    "userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
    "screen": {
      "width": 440,
      "height": 956
    },
    "viewport": {
      "width": 440,
      "height": 763
    },
    "deviceScaleFactor": 3,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "webkit"
  },
  "iPhone 16 Pro Max landscape": {
    "userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
    "screen": {
      "width": 440,
      "height": 956
    },
    "viewport": {
      "width": 838,
      "height": 390
    },
    "deviceScaleFactor": 3,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "webkit"
  },
  "iPhone 16e": {
    "userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
    "screen": {
      "width": 390,
      "height": 844
    },
    "viewport": {
      "width": 390,
      "height": 651
    },
    "deviceScaleFactor": 3,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "webkit"
  },
  "iPhone 16e landscape": {
    "userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
    "screen": {
      "width": 390,
      "height": 844
    },
    "viewport": {
      "width": 726,
      "height": 340
    },
    "deviceScaleFactor": 3,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "webkit"
  },
  "iPhone 17": {
    "userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
    "screen": {
      "width": 402,
      "height": 874
    },
    "viewport": {
      "width": 402,
      "height": 681
    },
    "deviceScaleFactor": 3,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "webkit"
  },
  "iPhone 17 landscape": {
    "userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
    "screen": {
      "width": 402,
      "height": 874
    },
    "viewport": {
      "width": 756,
      "height": 352
    },
    "deviceScaleFactor": 3,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "webkit"
  },
  "iPhone Air": {
    "userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
    "screen": {
      "width": 420,
      "height": 912
    },
    "viewport": {
      "width": 420,
      "height": 719
    },
    "deviceScaleFactor": 3,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "webkit"
  },
  "iPhone Air landscape": {
    "userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
    "screen": {
      "width": 420,
      "height": 912
    },
    "viewport": {
      "width": 794,
      "height": 370
    },
    "deviceScaleFactor": 3,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "webkit"
  },
  "iPhone 17 Pro": {
    "userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
    "screen": {
      "width": 402,
      "height": 874
    },
    "viewport": {
      "width": 402,
      "height": 681
    },
    "deviceScaleFactor": 3,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "webkit"
  },
  "iPhone 17 Pro landscape": {
    "userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
    "screen": {
      "width": 402,
      "height": 874
    },
    "viewport": {
      "width": 756,
      "height": 352
    },
    "deviceScaleFactor": 3,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "webkit"
  },
  "iPhone 17 Pro Max": {
    "userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
    "screen": {
      "width": 440,
      "height": 956
    },
    "viewport": {
      "width": 440,
      "height": 763
    },
    "deviceScaleFactor": 3,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "webkit"
  },
  "iPhone 17 Pro Max landscape": {
    "userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
    "screen": {
      "width": 440,
      "height": 956
    },
    "viewport": {
      "width": 838,
      "height": 390
    },
    "deviceScaleFactor": 3,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "webkit"
  },
  "iPhone 17e": {
    "userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
    "screen": {
      "width": 390,
      "height": 844
    },
    "viewport": {
      "width": 390,
      "height": 651
    },
    "deviceScaleFactor": 3,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "webkit"
  },
  "iPhone 17e landscape": {
    "userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",
    "screen": {
      "width": 390,
      "height": 844
    },
    "viewport": {
      "width": 726,
      "height": 340
    },
    "deviceScaleFactor": 3,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "webkit"
  },
  "Kindle Fire HDX": {
    "userAgent": "Mozilla/5.0 (Linux; U; en-us; KFAPWI Build/JDQ39) AppleWebKit/535.19 (KHTML, like Gecko) Silk/3.13 Safari/535.19 Silk-Accelerated=true",
    "viewport": {
      "width": 800,
      "height": 1280
    },
    "deviceScaleFactor": 2,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "webkit"
  },
  "Kindle Fire HDX landscape": {
    "userAgent": "Mozilla/5.0 (Linux; U; en-us; KFAPWI Build/JDQ39) AppleWebKit/535.19 (KHTML, like Gecko) Silk/3.13 Safari/535.19 Silk-Accelerated=true",
    "viewport": {
      "width": 1280,
      "height": 800
    },
    "deviceScaleFactor": 2,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "webkit"
  },
  "LG Optimus L70": {
    "userAgent": "Mozilla/5.0 (Linux; U; Android 4.4.2; en-us; LGMS323 Build/KOT49I.MS32310c) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/149.0.7827.55 Mobile Safari/537.36",
    "viewport": {
      "width": 384,
      "height": 640
    },
    "deviceScaleFactor": 1.25,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "chromium"
  },
  "LG Optimus L70 landscape": {
    "userAgent": "Mozilla/5.0 (Linux; U; Android 4.4.2; en-us; LGMS323 Build/KOT49I.MS32310c) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/149.0.7827.55 Mobile Safari/537.36",
    "viewport": {
      "width": 640,
      "height": 384
    },
    "deviceScaleFactor": 1.25,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "chromium"
  },
  "Microsoft Lumia 550": {
    "userAgent": "Mozilla/5.0 (Windows Phone 10.0; Android 4.2.1; Microsoft; Lumia 550) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36 Edge/14.14263",
    "viewport": {
      "width": 360,
      "height": 640
    },
    "deviceScaleFactor": 2,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "chromium"
  },
  "Microsoft Lumia 550 landscape": {
    "userAgent": "Mozilla/5.0 (Windows Phone 10.0; Android 4.2.1; Microsoft; Lumia 550) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36 Edge/14.14263",
    "viewport": {
      "width": 640,
      "height": 360
    },
    "deviceScaleFactor": 2,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "chromium"
  },
  "Microsoft Lumia 950": {
    "userAgent": "Mozilla/5.0 (Windows Phone 10.0; Android 4.2.1; Microsoft; Lumia 950) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36 Edge/14.14263",
    "viewport": {
      "width": 360,
      "height": 640
    },
    "deviceScaleFactor": 4,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "chromium"
  },
  "Microsoft Lumia 950 landscape": {
    "userAgent": "Mozilla/5.0 (Windows Phone 10.0; Android 4.2.1; Microsoft; Lumia 950) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36 Edge/14.14263",
    "viewport": {
      "width": 640,
      "height": 360
    },
    "deviceScaleFactor": 4,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "chromium"
  },
  "Nexus 10": {
    "userAgent": "Mozilla/5.0 (Linux; Android 6.0.1; Nexus 10 Build/MOB31T) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Safari/537.36",
    "viewport": {
      "width": 800,
      "height": 1280
    },
    "deviceScaleFactor": 2,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "chromium"
  },
  "Nexus 10 landscape": {
    "userAgent": "Mozilla/5.0 (Linux; Android 6.0.1; Nexus 10 Build/MOB31T) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Safari/537.36",
    "viewport": {
      "width": 1280,
      "height": 800
    },
    "deviceScaleFactor": 2,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "chromium"
  },
  "Nexus 4": {
    "userAgent": "Mozilla/5.0 (Linux; Android 4.4.2; Nexus 4 Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
    "viewport": {
      "width": 384,
      "height": 640
    },
    "deviceScaleFactor": 2,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "chromium"
  },
  "Nexus 4 landscape": {
    "userAgent": "Mozilla/5.0 (Linux; Android 4.4.2; Nexus 4 Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
    "viewport": {
      "width": 640,
      "height": 384
    },
    "deviceScaleFactor": 2,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "chromium"
  },
  "Nexus 5": {
    "userAgent": "Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
    "viewport": {
      "width": 360,
      "height": 640
    },
    "deviceScaleFactor": 3,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "chromium"
  },
  "Nexus 5 landscape": {
    "userAgent": "Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
    "viewport": {
      "width": 640,
      "height": 360
    },
    "deviceScaleFactor": 3,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "chromium"
  },
  "Nexus 5X": {
    "userAgent": "Mozilla/5.0 (Linux; Android 8.0.0; Nexus 5X Build/OPR4.170623.006) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
    "viewport": {
      "width": 412,
      "height": 732
    },
    "deviceScaleFactor": 2.625,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "chromium"
  },
  "Nexus 5X landscape": {
    "userAgent": "Mozilla/5.0 (Linux; Android 8.0.0; Nexus 5X Build/OPR4.170623.006) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
    "viewport": {
      "width": 732,
      "height": 412
    },
    "deviceScaleFactor": 2.625,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "chromium"
  },
  "Nexus 6": {
    "userAgent": "Mozilla/5.0 (Linux; Android 7.1.1; Nexus 6 Build/N6F26U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
    "viewport": {
      "width": 412,
      "height": 732
    },
    "deviceScaleFactor": 3.5,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "chromium"
  },
  "Nexus 6 landscape": {
    "userAgent": "Mozilla/5.0 (Linux; Android 7.1.1; Nexus 6 Build/N6F26U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
    "viewport": {
      "width": 732,
      "height": 412
    },
    "deviceScaleFactor": 3.5,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "chromium"
  },
  "Nexus 6P": {
    "userAgent": "Mozilla/5.0 (Linux; Android 8.0.0; Nexus 6P Build/OPP3.170518.006) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
    "viewport": {
      "width": 412,
      "height": 732
    },
    "deviceScaleFactor": 3.5,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "chromium"
  },
  "Nexus 6P landscape": {
    "userAgent": "Mozilla/5.0 (Linux; Android 8.0.0; Nexus 6P Build/OPP3.170518.006) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
    "viewport": {
      "width": 732,
      "height": 412
    },
    "deviceScaleFactor": 3.5,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "chromium"
  },
  "Nexus 7": {
    "userAgent": "Mozilla/5.0 (Linux; Android 6.0.1; Nexus 7 Build/MOB30X) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Safari/537.36",
    "viewport": {
      "width": 600,
      "height": 960
    },
    "deviceScaleFactor": 2,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "chromium"
  },
  "Nexus 7 landscape": {
    "userAgent": "Mozilla/5.0 (Linux; Android 6.0.1; Nexus 7 Build/MOB30X) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Safari/537.36",
    "viewport": {
      "width": 960,
      "height": 600
    },
    "deviceScaleFactor": 2,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "chromium"
  },
  "Nokia Lumia 520": {
    "userAgent": "Mozilla/5.0 (compatible; MSIE 10.0; Windows Phone 8.0; Trident/6.0; IEMobile/10.0; ARM; Touch; NOKIA; Lumia 520)",
    "viewport": {
      "width": 320,
      "height": 533
    },
    "deviceScaleFactor": 1.5,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "chromium"
  },
  "Nokia Lumia 520 landscape": {
    "userAgent": "Mozilla/5.0 (compatible; MSIE 10.0; Windows Phone 8.0; Trident/6.0; IEMobile/10.0; ARM; Touch; NOKIA; Lumia 520)",
    "viewport": {
      "width": 533,
      "height": 320
    },
    "deviceScaleFactor": 1.5,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "chromium"
  },
  "Nokia N9": {
    "userAgent": "Mozilla/5.0 (MeeGo; NokiaN9) AppleWebKit/534.13 (KHTML, like Gecko) NokiaBrowser/8.5.0 Mobile Safari/534.13",
    "viewport": {
      "width": 480,
      "height": 854
    },
    "deviceScaleFactor": 1,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "webkit"
  },
  "Nokia N9 landscape": {
    "userAgent": "Mozilla/5.0 (MeeGo; NokiaN9) AppleWebKit/534.13 (KHTML, like Gecko) NokiaBrowser/8.5.0 Mobile Safari/534.13",
    "viewport": {
      "width": 854,
      "height": 480
    },
    "deviceScaleFactor": 1,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "webkit"
  },
  "Pixel 2": {
    "userAgent": "Mozilla/5.0 (Linux; Android 8.0; Pixel 2 Build/OPD3.170816.012) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
    "viewport": {
      "width": 411,
      "height": 731
    },
    "deviceScaleFactor": 2.625,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "chromium"
  },
  "Pixel 2 landscape": {
    "userAgent": "Mozilla/5.0 (Linux; Android 8.0; Pixel 2 Build/OPD3.170816.012) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
    "viewport": {
      "width": 731,
      "height": 411
    },
    "deviceScaleFactor": 2.625,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "chromium"
  },
  "Pixel 2 XL": {
    "userAgent": "Mozilla/5.0 (Linux; Android 8.0.0; Pixel 2 XL Build/OPD1.170816.004) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
    "viewport": {
      "width": 411,
      "height": 823
    },
    "deviceScaleFactor": 3.5,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "chromium"
  },
  "Pixel 2 XL landscape": {
    "userAgent": "Mozilla/5.0 (Linux; Android 8.0.0; Pixel 2 XL Build/OPD1.170816.004) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
    "viewport": {
      "width": 823,
      "height": 411
    },
    "deviceScaleFactor": 3.5,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "chromium"
  },
  "Pixel 3": {
    "userAgent": "Mozilla/5.0 (Linux; Android 9; Pixel 3 Build/PQ1A.181105.017.A1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
    "viewport": {
      "width": 393,
      "height": 786
    },
    "deviceScaleFactor": 2.75,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "chromium"
  },
  "Pixel 3 landscape": {
    "userAgent": "Mozilla/5.0 (Linux; Android 9; Pixel 3 Build/PQ1A.181105.017.A1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
    "viewport": {
      "width": 786,
      "height": 393
    },
    "deviceScaleFactor": 2.75,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "chromium"
  },
  "Pixel 4": {
    "userAgent": "Mozilla/5.0 (Linux; Android 10; Pixel 4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
    "viewport": {
      "width": 353,
      "height": 745
    },
    "deviceScaleFactor": 3,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "chromium"
  },
  "Pixel 4 landscape": {
    "userAgent": "Mozilla/5.0 (Linux; Android 10; Pixel 4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
    "viewport": {
      "width": 745,
      "height": 353
    },
    "deviceScaleFactor": 3,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "chromium"
  },
  "Pixel 4a (5G)": {
    "userAgent": "Mozilla/5.0 (Linux; Android 11; Pixel 4a (5G)) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
    "screen": {
      "width": 412,
      "height": 892
    },
    "viewport": {
      "width": 412,
      "height": 765
    },
    "deviceScaleFactor": 2.63,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "chromium"
  },
  "Pixel 4a (5G) landscape": {
    "userAgent": "Mozilla/5.0 (Linux; Android 11; Pixel 4a (5G)) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
    "screen": {
      "height": 892,
      "width": 412
    },
    "viewport": {
      "width": 840,
      "height": 312
    },
    "deviceScaleFactor": 2.63,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "chromium"
  },
  "Pixel 5": {
    "userAgent": "Mozilla/5.0 (Linux; Android 11; Pixel 5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
    "screen": {
      "width": 393,
      "height": 851
    },
    "viewport": {
      "width": 393,
      "height": 727
    },
    "deviceScaleFactor": 2.75,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "chromium"
  },
  "Pixel 5 landscape": {
    "userAgent": "Mozilla/5.0 (Linux; Android 11; Pixel 5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
    "screen": {
      "width": 851,
      "height": 393
    },
    "viewport": {
      "width": 802,
      "height": 293
    },
    "deviceScaleFactor": 2.75,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "chromium"
  },
  "Pixel 6": {
    "userAgent": "Mozilla/5.0 (Linux; Android 12; Pixel 6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
    "screen": {
      "width": 412,
      "height": 915
    },
    "viewport": {
      "width": 412,
      "height": 839
    },
    "deviceScaleFactor": 2.625,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "chromium"
  },
  "Pixel 6 landscape": {
    "userAgent": "Mozilla/5.0 (Linux; Android 12; Pixel 6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
    "screen": {
      "width": 915,
      "height": 412
    },
    "viewport": {
      "width": 863,
      "height": 360
    },
    "deviceScaleFactor": 2.625,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "chromium"
  },
  "Pixel 6 Pro": {
    "userAgent": "Mozilla/5.0 (Linux; Android 12; Pixel 6 Pro) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
    "screen": {
      "width": 412,
      "height": 892
    },
    "viewport": {
      "width": 412,
      "height": 816
    },
    "deviceScaleFactor": 3.5,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "chromium"
  },
  "Pixel 6 Pro landscape": {
    "userAgent": "Mozilla/5.0 (Linux; Android 12; Pixel 6 Pro) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
    "screen": {
      "width": 892,
      "height": 412
    },
    "viewport": {
      "width": 840,
      "height": 360
    },
    "deviceScaleFactor": 3.5,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "chromium"
  },
  "Pixel 6a": {
    "userAgent": "Mozilla/5.0 (Linux; Android 12; Pixel 6a) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
    "screen": {
      "width": 412,
      "height": 915
    },
    "viewport": {
      "width": 412,
      "height": 839
    },
    "deviceScaleFactor": 2.625,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "chromium"
  },
  "Pixel 6a landscape": {
    "userAgent": "Mozilla/5.0 (Linux; Android 12; Pixel 6a) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
    "screen": {
      "width": 915,
      "height": 412
    },
    "viewport": {
      "width": 863,
      "height": 360
    },
    "deviceScaleFactor": 2.625,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "chromium"
  },
  "Pixel 7": {
    "userAgent": "Mozilla/5.0 (Linux; Android 14; Pixel 7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
    "screen": {
      "width": 412,
      "height": 915
    },
    "viewport": {
      "width": 412,
      "height": 839
    },
    "deviceScaleFactor": 2.625,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "chromium"
  },
  "Pixel 7 landscape": {
    "userAgent": "Mozilla/5.0 (Linux; Android 14; Pixel 7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
    "screen": {
      "width": 915,
      "height": 412
    },
    "viewport": {
      "width": 863,
      "height": 360
    },
    "deviceScaleFactor": 2.625,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "chromium"
  },
  "Pixel 7 Pro": {
    "userAgent": "Mozilla/5.0 (Linux; Android 13; Pixel 7 Pro) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
    "screen": {
      "width": 412,
      "height": 892
    },
    "viewport": {
      "width": 412,
      "height": 816
    },
    "deviceScaleFactor": 3.5,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "chromium"
  },
  "Pixel 7 Pro landscape": {
    "userAgent": "Mozilla/5.0 (Linux; Android 13; Pixel 7 Pro) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
    "screen": {
      "width": 892,
      "height": 412
    },
    "viewport": {
      "width": 840,
      "height": 360
    },
    "deviceScaleFactor": 3.5,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "chromium"
  },
  "Pixel 7a": {
    "userAgent": "Mozilla/5.0 (Linux; Android 13; Pixel 7a) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
    "screen": {
      "width": 412,
      "height": 915
    },
    "viewport": {
      "width": 412,
      "height": 839
    },
    "deviceScaleFactor": 2.625,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "chromium"
  },
  "Pixel 7a landscape": {
    "userAgent": "Mozilla/5.0 (Linux; Android 13; Pixel 7a) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
    "screen": {
      "width": 915,
      "height": 412
    },
    "viewport": {
      "width": 863,
      "height": 360
    },
    "deviceScaleFactor": 2.625,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "chromium"
  },
  "Pixel 8": {
    "userAgent": "Mozilla/5.0 (Linux; Android 14; Pixel 8) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
    "screen": {
      "width": 412,
      "height": 915
    },
    "viewport": {
      "width": 412,
      "height": 839
    },
    "deviceScaleFactor": 2.625,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "chromium"
  },
  "Pixel 8 landscape": {
    "userAgent": "Mozilla/5.0 (Linux; Android 14; Pixel 8) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
    "screen": {
      "width": 915,
      "height": 412
    },
    "viewport": {
      "width": 863,
      "height": 360
    },
    "deviceScaleFactor": 2.625,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "chromium"
  },
  "Pixel 8 Pro": {
    "userAgent": "Mozilla/5.0 (Linux; Android 14; Pixel 8 Pro) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
    "screen": {
      "width": 448,
      "height": 997
    },
    "viewport": {
      "width": 448,
      "height": 921
    },
    "deviceScaleFactor": 3,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "chromium"
  },
  "Pixel 8 Pro landscape": {
    "userAgent": "Mozilla/5.0 (Linux; Android 14; Pixel 8 Pro) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
    "screen": {
      "width": 997,
      "height": 448
    },
    "viewport": {
      "width": 945,
      "height": 396
    },
    "deviceScaleFactor": 3,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "chromium"
  },
  "Pixel 8a": {
    "userAgent": "Mozilla/5.0 (Linux; Android 14; Pixel 8a) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
    "screen": {
      "width": 412,
      "height": 915
    },
    "viewport": {
      "width": 412,
      "height": 839
    },
    "deviceScaleFactor": 2.625,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "chromium"
  },
  "Pixel 8a landscape": {
    "userAgent": "Mozilla/5.0 (Linux; Android 14; Pixel 8a) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
    "screen": {
      "width": 915,
      "height": 412
    },
    "viewport": {
      "width": 863,
      "height": 360
    },
    "deviceScaleFactor": 2.625,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "chromium"
  },
  "Pixel 9": {
    "userAgent": "Mozilla/5.0 (Linux; Android 14; Pixel 9) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
    "screen": {
      "width": 360,
      "height": 808
    },
    "viewport": {
      "width": 360,
      "height": 732
    },
    "deviceScaleFactor": 3,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "chromium"
  },
  "Pixel 9 landscape": {
    "userAgent": "Mozilla/5.0 (Linux; Android 14; Pixel 9) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
    "screen": {
      "width": 808,
      "height": 360
    },
    "viewport": {
      "width": 756,
      "height": 308
    },
    "deviceScaleFactor": 3,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "chromium"
  },
  "Pixel 9 Pro": {
    "userAgent": "Mozilla/5.0 (Linux; Android 14; Pixel 9 Pro) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
    "screen": {
      "width": 427,
      "height": 952
    },
    "viewport": {
      "width": 427,
      "height": 876
    },
    "deviceScaleFactor": 3,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "chromium"
  },
  "Pixel 9 Pro landscape": {
    "userAgent": "Mozilla/5.0 (Linux; Android 14; Pixel 9 Pro) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
    "screen": {
      "width": 952,
      "height": 427
    },
    "viewport": {
      "width": 900,
      "height": 375
    },
    "deviceScaleFactor": 3,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "chromium"
  },
  "Pixel 9 Pro XL": {
    "userAgent": "Mozilla/5.0 (Linux; Android 14; Pixel 9 Pro XL) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
    "screen": {
      "width": 448,
      "height": 997
    },
    "viewport": {
      "width": 448,
      "height": 921
    },
    "deviceScaleFactor": 3,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "chromium"
  },
  "Pixel 9 Pro XL landscape": {
    "userAgent": "Mozilla/5.0 (Linux; Android 14; Pixel 9 Pro XL) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
    "screen": {
      "width": 997,
      "height": 448
    },
    "viewport": {
      "width": 945,
      "height": 396
    },
    "deviceScaleFactor": 3,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "chromium"
  },
  "Pixel 10": {
    "userAgent": "Mozilla/5.0 (Linux; Android 16; Pixel 10) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
    "screen": {
      "width": 360,
      "height": 808
    },
    "viewport": {
      "width": 360,
      "height": 732
    },
    "deviceScaleFactor": 3,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "chromium"
  },
  "Pixel 10 landscape": {
    "userAgent": "Mozilla/5.0 (Linux; Android 16; Pixel 10) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
    "screen": {
      "width": 808,
      "height": 360
    },
    "viewport": {
      "width": 756,
      "height": 308
    },
    "deviceScaleFactor": 3,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "chromium"
  },
  "Pixel 10 Pro": {
    "userAgent": "Mozilla/5.0 (Linux; Android 16; Pixel 10 Pro) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
    "screen": {
      "width": 427,
      "height": 952
    },
    "viewport": {
      "width": 427,
      "height": 876
    },
    "deviceScaleFactor": 3,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "chromium"
  },
  "Pixel 10 Pro landscape": {
    "userAgent": "Mozilla/5.0 (Linux; Android 16; Pixel 10 Pro) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
    "screen": {
      "width": 952,
      "height": 427
    },
    "viewport": {
      "width": 900,
      "height": 375
    },
    "deviceScaleFactor": 3,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "chromium"
  },
  "Pixel 10 Pro XL": {
    "userAgent": "Mozilla/5.0 (Linux; Android 16; Pixel 10 Pro XL) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
    "screen": {
      "width": 448,
      "height": 997
    },
    "viewport": {
      "width": 448,
      "height": 921
    },
    "deviceScaleFactor": 3,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "chromium"
  },
  "Pixel 10 Pro XL landscape": {
    "userAgent": "Mozilla/5.0 (Linux; Android 16; Pixel 10 Pro XL) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
    "screen": {
      "width": 997,
      "height": 448
    },
    "viewport": {
      "width": 945,
      "height": 396
    },
    "deviceScaleFactor": 3,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "chromium"
  },
  "Moto G4": {
    "userAgent": "Mozilla/5.0 (Linux; Android 7.0; Moto G (4)) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
    "viewport": {
      "width": 360,
      "height": 640
    },
    "deviceScaleFactor": 3,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "chromium"
  },
  "Moto G4 landscape": {
    "userAgent": "Mozilla/5.0 (Linux; Android 7.0; Moto G (4)) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Mobile Safari/537.36",
    "viewport": {
      "width": 640,
      "height": 360
    },
    "deviceScaleFactor": 3,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "chromium"
  },
  "Desktop Chrome HiDPI": {
    "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Safari/537.36",
    "screen": {
      "width": 1792,
      "height": 1120
    },
    "viewport": {
      "width": 1280,
      "height": 720
    },
    "deviceScaleFactor": 2,
    "isMobile": false,
    "hasTouch": false,
    "defaultBrowserType": "chromium"
  },
  "Desktop Edge HiDPI": {
    "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Safari/537.36 Edg/149.0.7827.55",
    "screen": {
      "width": 1792,
      "height": 1120
    },
    "viewport": {
      "width": 1280,
      "height": 720
    },
    "deviceScaleFactor": 2,
    "isMobile": false,
    "hasTouch": false,
    "defaultBrowserType": "chromium"
  },
  "Desktop Firefox HiDPI": {
    "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:151.0) Gecko/20100101 Firefox/151.0",
    "screen": {
      "width": 1792,
      "height": 1120
    },
    "viewport": {
      "width": 1280,
      "height": 720
    },
    "deviceScaleFactor": 2,
    "isMobile": false,
    "hasTouch": false,
    "defaultBrowserType": "firefox"
  },
  "Desktop Safari": {
    "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Safari/605.1.15",
    "screen": {
      "width": 1792,
      "height": 1120
    },
    "viewport": {
      "width": 1280,
      "height": 720
    },
    "deviceScaleFactor": 2,
    "isMobile": false,
    "hasTouch": false,
    "defaultBrowserType": "webkit"
  },
  "Desktop Chrome": {
    "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Safari/537.36",
    "screen": {
      "width": 1920,
      "height": 1080
    },
    "viewport": {
      "width": 1280,
      "height": 720
    },
    "deviceScaleFactor": 1,
    "isMobile": false,
    "hasTouch": false,
    "defaultBrowserType": "chromium"
  },
  "Desktop Edge": {
    "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.7827.55 Safari/537.36 Edg/149.0.7827.55",
    "screen": {
      "width": 1920,
      "height": 1080
    },
    "viewport": {
      "width": 1280,
      "height": 720
    },
    "deviceScaleFactor": 1,
    "isMobile": false,
    "hasTouch": false,
    "defaultBrowserType": "chromium"
  },
  "Desktop Firefox": {
    "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:151.0) Gecko/20100101 Firefox/151.0",
    "screen": {
      "width": 1920,
      "height": 1080
    },
    "viewport": {
      "width": 1280,
      "height": 720
    },
    "deviceScaleFactor": 1,
    "isMobile": false,
    "hasTouch": false,
    "defaultBrowserType": "firefox"
  }
}"use strict";

// packages/playwright-core/src/server/electron/loader.ts
var import_electron = require("electron");

// packages/playwright-core/src/server/chromium/chromiumSwitches.ts
var disabledFeatures = [
  // See https://github.com/microsoft/playwright/issues/14047
  "AvoidUnnecessaryBeforeUnloadCheckSync",
  // See https://github.com/microsoft/playwright/issues/38568
  "BoundaryEventDispatchTracksNodeRemoval",
  "DestroyProfileOnBrowserClose",
  // See https://github.com/microsoft/playwright/pull/13854
  "DialMediaRouteProvider",
  "GlobalMediaControls",
  // See https://github.com/microsoft/playwright/pull/27605
  "HttpsUpgrades",
  // Hides the Lens feature in the URL address bar. Its not working in unofficial builds.
  "LensOverlay",
  // See https://github.com/microsoft/playwright/pull/8162
  "MediaRouter",
  // See https://github.com/microsoft/playwright/issues/28023
  "PaintHolding",
  // See https://github.com/microsoft/playwright/issues/32230
  "ThirdPartyStoragePartitioning",
  // See https://github.com/microsoft/playwright/issues/16126
  "Translate",
  // See https://issues.chromium.org/u/1/issues/435410220
  "AutoDeElevate",
  // See https://github.com/microsoft/playwright/issues/37714
  "RenderDocument",
  // Prevents downloading optimization hints on startup.
  "OptimizationHints",
  // Disables forced sign-in in Edge.
  "msForceBrowserSignIn",
  // Disables updating the preferred version in LaunchServices preferences on mac.
  "msEdgeUpdateLaunchServicesPreferredVersion"
].filter(Boolean);
var chromiumSwitches = (options) => [
  "--disable-field-trial-config",
  // https://source.chromium.org/chromium/chromium/src/+/main:testing/variations/README.md
  "--disable-background-networking",
  "--disable-background-timer-throttling",
  "--disable-backgrounding-occluded-windows",
  "--disable-back-forward-cache",
  // Avoids surprises like main request not being intercepted during page.goBack().
  "--disable-breakpad",
  "--disable-client-side-phishing-detection",
  "--disable-component-extensions-with-background-pages",
  "--disable-component-update",
  // Avoids unneeded network activity after startup.
  "--no-default-browser-check",
  "--disable-default-apps",
  "--disable-dev-shm-usage",
  "--disable-edgeupdater",
  // Disables Edge-specific updater on mac.
  "--disable-extensions",
  "--disable-features=" + disabledFeatures.join(","),
  process.env.PLAYWRIGHT_LEGACY_SCREENSHOT ? "" : "--enable-features=CDPScreenshotNewSurface",
  "--allow-pre-commit-input",
  "--disable-hang-monitor",
  "--disable-ipc-flooding-protection",
  "--disable-popup-blocking",
  "--disable-prompt-on-repost",
  "--disable-renderer-backgrounding",
  "--force-color-profile=srgb",
  "--metrics-recording-only",
  "--no-first-run",
  "--password-store=basic",
  "--use-mock-keychain",
  // See https://chromium-review.googlesource.com/c/chromium/src/+/2436773
  "--no-service-autorun",
  "--export-tagged-pdf",
  // https://chromium-review.googlesource.com/c/chromium/src/+/4853540
  "--disable-search-engine-choice-screen",
  // https://issues.chromium.org/41491762
  "--unsafely-disable-devtools-self-xss-warnings",
  // Edge can potentially restart on Windows (msRelaunchNoCompatLayer) which looses its file descriptors (stdout/stderr) and CDP (3/4). Disable until fixed upstream.
  "--edge-skip-compat-layer-relaunch",
  // This disables Chrome for Testing infobar that is visible in the persistent context.
  // The switch is ignored everywhere else, including Chromium/Chrome/Edge.
  "--disable-infobars",
  // Less annoying popups.
  "--disable-search-engine-choice-screen",
  // Prevents the "three dots" menu crash in IdentityManager::HasPrimaryAccount for ephemeral contexts.
  options?.android ? "" : "--disable-sync"
].filter(Boolean);

// packages/playwright-core/src/server/electron/loader.ts
process.argv.splice(1, process.argv.indexOf("--remote-debugging-port=0"));
for (const arg of chromiumSwitches()) {
  const match = arg.match(/--([^=]*)=?(.*)/);
  import_electron.app.commandLine.appendSwitch(match[1], match[2]);
}
var originalWhenReady = import_electron.app.whenReady();
var originalEmit = import_electron.app.emit.bind(import_electron.app);
var readyEventArgs;
import_electron.app.emit = (event, ...args) => {
  if (event === "ready") {
    readyEventArgs = args;
    return import_electron.app.listenerCount("ready") > 0;
  }
  return originalEmit(event, ...args);
};
var isReady = false;
var whenReadyCallback;
var whenReadyPromise = new Promise((f) => whenReadyCallback = f);
import_electron.app.isReady = () => isReady;
import_electron.app.whenReady = () => whenReadyPromise;
globalThis.__playwright_run = async () => {
  const event = await originalWhenReady;
  isReady = true;
  whenReadyCallback(event);
  originalEmit("ready", ...readyEventArgs);
};
"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __commonJS = (cb, mod) => function __require() {
  return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
};
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  // If the importer is in node compatibility mode or this is not an ESM
  // file that has been converted to a CommonJS file using a Babel-
  // compatible transform (i.e. "__esModule" has not been set), then set
  // "default" to the CommonJS "module.exports" for node compatibility.
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);

// node_modules/readdirp/node_modules/picomatch/lib/constants.js
var require_constants = __commonJS({
  "node_modules/readdirp/node_modules/picomatch/lib/constants.js"(exports2, module2) {
    "use strict";
    var path3 = require("path");
    var WIN_SLASH = "\\\\/";
    var WIN_NO_SLASH = `[^${WIN_SLASH}]`;
    var DEFAULT_MAX_EXTGLOB_RECURSION = 0;
    var DOT_LITERAL = "\\.";
    var PLUS_LITERAL = "\\+";
    var QMARK_LITERAL = "\\?";
    var SLASH_LITERAL = "\\/";
    var ONE_CHAR = "(?=.)";
    var QMARK = "[^/]";
    var END_ANCHOR = `(?:${SLASH_LITERAL}|$)`;
    var START_ANCHOR = `(?:^|${SLASH_LITERAL})`;
    var DOTS_SLASH = `${DOT_LITERAL}{1,2}${END_ANCHOR}`;
    var NO_DOT = `(?!${DOT_LITERAL})`;
    var NO_DOTS = `(?!${START_ANCHOR}${DOTS_SLASH})`;
    var NO_DOT_SLASH = `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`;
    var NO_DOTS_SLASH = `(?!${DOTS_SLASH})`;
    var QMARK_NO_DOT = `[^.${SLASH_LITERAL}]`;
    var STAR = `${QMARK}*?`;
    var POSIX_CHARS = {
      DOT_LITERAL,
      PLUS_LITERAL,
      QMARK_LITERAL,
      SLASH_LITERAL,
      ONE_CHAR,
      QMARK,
      END_ANCHOR,
      DOTS_SLASH,
      NO_DOT,
      NO_DOTS,
      NO_DOT_SLASH,
      NO_DOTS_SLASH,
      QMARK_NO_DOT,
      STAR,
      START_ANCHOR
    };
    var WINDOWS_CHARS = {
      ...POSIX_CHARS,
      SLASH_LITERAL: `[${WIN_SLASH}]`,
      QMARK: WIN_NO_SLASH,
      STAR: `${WIN_NO_SLASH}*?`,
      DOTS_SLASH: `${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$)`,
      NO_DOT: `(?!${DOT_LITERAL})`,
      NO_DOTS: `(?!(?:^|[${WIN_SLASH}])${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
      NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}(?:[${WIN_SLASH}]|$))`,
      NO_DOTS_SLASH: `(?!${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
      QMARK_NO_DOT: `[^.${WIN_SLASH}]`,
      START_ANCHOR: `(?:^|[${WIN_SLASH}])`,
      END_ANCHOR: `(?:[${WIN_SLASH}]|$)`
    };
    var POSIX_REGEX_SOURCE = {
      __proto__: null,
      alnum: "a-zA-Z0-9",
      alpha: "a-zA-Z",
      ascii: "\\x00-\\x7F",
      blank: " \\t",
      cntrl: "\\x00-\\x1F\\x7F",
      digit: "0-9",
      graph: "\\x21-\\x7E",
      lower: "a-z",
      print: "\\x20-\\x7E ",
      punct: "\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",
      space: " \\t\\r\\n\\v\\f",
      upper: "A-Z",
      word: "A-Za-z0-9_",
      xdigit: "A-Fa-f0-9"
    };
    module2.exports = {
      DEFAULT_MAX_EXTGLOB_RECURSION,
      MAX_LENGTH: 1024 * 64,
      POSIX_REGEX_SOURCE,
      // regular expressions
      REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g,
      REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/,
      REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/,
      REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g,
      REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g,
      REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g,
      // Replace globs with equivalent patterns to reduce parsing time.
      REPLACEMENTS: {
        __proto__: null,
        "***": "*",
        "**/**": "**",
        "**/**/**": "**"
      },
      // Digits
      CHAR_0: 48,
      /* 0 */
      CHAR_9: 57,
      /* 9 */
      // Alphabet chars.
      CHAR_UPPERCASE_A: 65,
      /* A */
      CHAR_LOWERCASE_A: 97,
      /* a */
      CHAR_UPPERCASE_Z: 90,
      /* Z */
      CHAR_LOWERCASE_Z: 122,
      /* z */
      CHAR_LEFT_PARENTHESES: 40,
      /* ( */
      CHAR_RIGHT_PARENTHESES: 41,
      /* ) */
      CHAR_ASTERISK: 42,
      /* * */
      // Non-alphabetic chars.
      CHAR_AMPERSAND: 38,
      /* & */
      CHAR_AT: 64,
      /* @ */
      CHAR_BACKWARD_SLASH: 92,
      /* \ */
      CHAR_CARRIAGE_RETURN: 13,
      /* \r */
      CHAR_CIRCUMFLEX_ACCENT: 94,
      /* ^ */
      CHAR_COLON: 58,
      /* : */
      CHAR_COMMA: 44,
      /* , */
      CHAR_DOT: 46,
      /* . */
      CHAR_DOUBLE_QUOTE: 34,
      /* " */
      CHAR_EQUAL: 61,
      /* = */
      CHAR_EXCLAMATION_MARK: 33,
      /* ! */
      CHAR_FORM_FEED: 12,
      /* \f */
      CHAR_FORWARD_SLASH: 47,
      /* / */
      CHAR_GRAVE_ACCENT: 96,
      /* ` */
      CHAR_HASH: 35,
      /* # */
      CHAR_HYPHEN_MINUS: 45,
      /* - */
      CHAR_LEFT_ANGLE_BRACKET: 60,
      /* < */
      CHAR_LEFT_CURLY_BRACE: 123,
      /* { */
      CHAR_LEFT_SQUARE_BRACKET: 91,
      /* [ */
      CHAR_LINE_FEED: 10,
      /* \n */
      CHAR_NO_BREAK_SPACE: 160,
      /* \u00A0 */
      CHAR_PERCENT: 37,
      /* % */
      CHAR_PLUS: 43,
      /* + */
      CHAR_QUESTION_MARK: 63,
      /* ? */
      CHAR_RIGHT_ANGLE_BRACKET: 62,
      /* > */
      CHAR_RIGHT_CURLY_BRACE: 125,
      /* } */
      CHAR_RIGHT_SQUARE_BRACKET: 93,
      /* ] */
      CHAR_SEMICOLON: 59,
      /* ; */
      CHAR_SINGLE_QUOTE: 39,
      /* ' */
      CHAR_SPACE: 32,
      /*   */
      CHAR_TAB: 9,
      /* \t */
      CHAR_UNDERSCORE: 95,
      /* _ */
      CHAR_VERTICAL_LINE: 124,
      /* | */
      CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279,
      /* \uFEFF */
      SEP: path3.sep,
      /**
       * Create EXTGLOB_CHARS
       */
      extglobChars(chars) {
        return {
          "!": { type: "negate", open: "(?:(?!(?:", close: `))${chars.STAR})` },
          "?": { type: "qmark", open: "(?:", close: ")?" },
          "+": { type: "plus", open: "(?:", close: ")+" },
          "*": { type: "star", open: "(?:", close: ")*" },
          "@": { type: "at", open: "(?:", close: ")" }
        };
      },
      /**
       * Create GLOB_CHARS
       */
      globChars(win32) {
        return win32 === true ? WINDOWS_CHARS : POSIX_CHARS;
      }
    };
  }
});

// node_modules/readdirp/node_modules/picomatch/lib/utils.js
var require_utils = __commonJS({
  "node_modules/readdirp/node_modules/picomatch/lib/utils.js"(exports2) {
    "use strict";
    var path3 = require("path");
    var win32 = process.platform === "win32";
    var {
      REGEX_BACKSLASH,
      REGEX_REMOVE_BACKSLASH,
      REGEX_SPECIAL_CHARS,
      REGEX_SPECIAL_CHARS_GLOBAL
    } = require_constants();
    exports2.isObject = (val) => val !== null && typeof val === "object" && !Array.isArray(val);
    exports2.hasRegexChars = (str) => REGEX_SPECIAL_CHARS.test(str);
    exports2.isRegexChar = (str) => str.length === 1 && exports2.hasRegexChars(str);
    exports2.escapeRegex = (str) => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, "\\$1");
    exports2.toPosixSlashes = (str) => str.replace(REGEX_BACKSLASH, "/");
    exports2.removeBackslashes = (str) => {
      return str.replace(REGEX_REMOVE_BACKSLASH, (match) => {
        return match === "\\" ? "" : match;
      });
    };
    exports2.supportsLookbehinds = () => {
      const segs = process.version.slice(1).split(".").map(Number);
      if (segs.length === 3 && segs[0] >= 9 || segs[0] === 8 && segs[1] >= 10) {
        return true;
      }
      return false;
    };
    exports2.isWindows = (options) => {
      if (options && typeof options.windows === "boolean") {
        return options.windows;
      }
      return win32 === true || path3.sep === "\\";
    };
    exports2.escapeLast = (input, char, lastIdx) => {
      const idx = input.lastIndexOf(char, lastIdx);
      if (idx === -1) return input;
      if (input[idx - 1] === "\\") return exports2.escapeLast(input, char, idx - 1);
      return `${input.slice(0, idx)}\\${input.slice(idx)}`;
    };
    exports2.removePrefix = (input, state = {}) => {
      let output = input;
      if (output.startsWith("./")) {
        output = output.slice(2);
        state.prefix = "./";
      }
      return output;
    };
    exports2.wrapOutput = (input, state = {}, options = {}) => {
      const prepend = options.contains ? "" : "^";
      const append = options.contains ? "" : "$";
      let output = `${prepend}(?:${input})${append}`;
      if (state.negated === true) {
        output = `(?:^(?!${output}).*$)`;
      }
      return output;
    };
  }
});

// node_modules/readdirp/node_modules/picomatch/lib/scan.js
var require_scan = __commonJS({
  "node_modules/readdirp/node_modules/picomatch/lib/scan.js"(exports2, module2) {
    "use strict";
    var utils = require_utils();
    var {
      CHAR_ASTERISK,
      /* * */
      CHAR_AT,
      /* @ */
      CHAR_BACKWARD_SLASH,
      /* \ */
      CHAR_COMMA,
      /* , */
      CHAR_DOT,
      /* . */
      CHAR_EXCLAMATION_MARK,
      /* ! */
      CHAR_FORWARD_SLASH,
      /* / */
      CHAR_LEFT_CURLY_BRACE,
      /* { */
      CHAR_LEFT_PARENTHESES,
      /* ( */
      CHAR_LEFT_SQUARE_BRACKET,
      /* [ */
      CHAR_PLUS,
      /* + */
      CHAR_QUESTION_MARK,
      /* ? */
      CHAR_RIGHT_CURLY_BRACE,
      /* } */
      CHAR_RIGHT_PARENTHESES,
      /* ) */
      CHAR_RIGHT_SQUARE_BRACKET
      /* ] */
    } = require_constants();
    var isPathSeparator = (code) => {
      return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH;
    };
    var depth = (token) => {
      if (token.isPrefix !== true) {
        token.depth = token.isGlobstar ? Infinity : 1;
      }
    };
    var scan = (input, options) => {
      const opts = options || {};
      const length = input.length - 1;
      const scanToEnd = opts.parts === true || opts.scanToEnd === true;
      const slashes = [];
      const tokens = [];
      const parts = [];
      let str = input;
      let index = -1;
      let start = 0;
      let lastIndex = 0;
      let isBrace = false;
      let isBracket = false;
      let isGlob = false;
      let isExtglob = false;
      let isGlobstar = false;
      let braceEscaped = false;
      let backslashes = false;
      let negated = false;
      let negatedExtglob = false;
      let finished = false;
      let braces = 0;
      let prev;
      let code;
      let token = { value: "", depth: 0, isGlob: false };
      const eos = () => index >= length;
      const peek = () => str.charCodeAt(index + 1);
      const advance = () => {
        prev = code;
        return str.charCodeAt(++index);
      };
      while (index < length) {
        code = advance();
        let next;
        if (code === CHAR_BACKWARD_SLASH) {
          backslashes = token.backslashes = true;
          code = advance();
          if (code === CHAR_LEFT_CURLY_BRACE) {
            braceEscaped = true;
          }
          continue;
        }
        if (braceEscaped === true || code === CHAR_LEFT_CURLY_BRACE) {
          braces++;
          while (eos() !== true && (code = advance())) {
            if (code === CHAR_BACKWARD_SLASH) {
              backslashes = token.backslashes = true;
              advance();
              continue;
            }
            if (code === CHAR_LEFT_CURLY_BRACE) {
              braces++;
              continue;
            }
            if (braceEscaped !== true && code === CHAR_DOT && (code = advance()) === CHAR_DOT) {
              isBrace = token.isBrace = true;
              isGlob = token.isGlob = true;
              finished = true;
              if (scanToEnd === true) {
                continue;
              }
              break;
            }
            if (braceEscaped !== true && code === CHAR_COMMA) {
              isBrace = token.isBrace = true;
              isGlob = token.isGlob = true;
              finished = true;
              if (scanToEnd === true) {
                continue;
              }
              break;
            }
            if (code === CHAR_RIGHT_CURLY_BRACE) {
              braces--;
              if (braces === 0) {
                braceEscaped = false;
                isBrace = token.isBrace = true;
                finished = true;
                break;
              }
            }
          }
          if (scanToEnd === true) {
            continue;
          }
          break;
        }
        if (code === CHAR_FORWARD_SLASH) {
          slashes.push(index);
          tokens.push(token);
          token = { value: "", depth: 0, isGlob: false };
          if (finished === true) continue;
          if (prev === CHAR_DOT && index === start + 1) {
            start += 2;
            continue;
          }
          lastIndex = index + 1;
          continue;
        }
        if (opts.noext !== true) {
          const isExtglobChar = code === CHAR_PLUS || code === CHAR_AT || code === CHAR_ASTERISK || code === CHAR_QUESTION_MARK || code === CHAR_EXCLAMATION_MARK;
          if (isExtglobChar === true && peek() === CHAR_LEFT_PARENTHESES) {
            isGlob = token.isGlob = true;
            isExtglob = token.isExtglob = true;
            finished = true;
            if (code === CHAR_EXCLAMATION_MARK && index === start) {
              negatedExtglob = true;
            }
            if (scanToEnd === true) {
              while (eos() !== true && (code = advance())) {
                if (code === CHAR_BACKWARD_SLASH) {
                  backslashes = token.backslashes = true;
                  code = advance();
                  continue;
                }
                if (code === CHAR_RIGHT_PARENTHESES) {
                  isGlob = token.isGlob = true;
                  finished = true;
                  break;
                }
              }
              continue;
            }
            break;
          }
        }
        if (code === CHAR_ASTERISK) {
          if (prev === CHAR_ASTERISK) isGlobstar = token.isGlobstar = true;
          isGlob = token.isGlob = true;
          finished = true;
          if (scanToEnd === true) {
            continue;
          }
          break;
        }
        if (code === CHAR_QUESTION_MARK) {
          isGlob = token.isGlob = true;
          finished = true;
          if (scanToEnd === true) {
            continue;
          }
          break;
        }
        if (code === CHAR_LEFT_SQUARE_BRACKET) {
          while (eos() !== true && (next = advance())) {
            if (next === CHAR_BACKWARD_SLASH) {
              backslashes = token.backslashes = true;
              advance();
              continue;
            }
            if (next === CHAR_RIGHT_SQUARE_BRACKET) {
              isBracket = token.isBracket = true;
              isGlob = token.isGlob = true;
              finished = true;
              break;
            }
          }
          if (scanToEnd === true) {
            continue;
          }
          break;
        }
        if (opts.nonegate !== true && code === CHAR_EXCLAMATION_MARK && index === start) {
          negated = token.negated = true;
          start++;
          continue;
        }
        if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES) {
          isGlob = token.isGlob = true;
          if (scanToEnd === true) {
            while (eos() !== true && (code = advance())) {
              if (code === CHAR_LEFT_PARENTHESES) {
                backslashes = token.backslashes = true;
                code = advance();
                continue;
              }
              if (code === CHAR_RIGHT_PARENTHESES) {
                finished = true;
                break;
              }
            }
            continue;
          }
          break;
        }
        if (isGlob === true) {
          finished = true;
          if (scanToEnd === true) {
            continue;
          }
          break;
        }
      }
      if (opts.noext === true) {
        isExtglob = false;
        isGlob = false;
      }
      let base = str;
      let prefix = "";
      let glob = "";
      if (start > 0) {
        prefix = str.slice(0, start);
        str = str.slice(start);
        lastIndex -= start;
      }
      if (base && isGlob === true && lastIndex > 0) {
        base = str.slice(0, lastIndex);
        glob = str.slice(lastIndex);
      } else if (isGlob === true) {
        base = "";
        glob = str;
      } else {
        base = str;
      }
      if (base && base !== "" && base !== "/" && base !== str) {
        if (isPathSeparator(base.charCodeAt(base.length - 1))) {
          base = base.slice(0, -1);
        }
      }
      if (opts.unescape === true) {
        if (glob) glob = utils.removeBackslashes(glob);
        if (base && backslashes === true) {
          base = utils.removeBackslashes(base);
        }
      }
      const state = {
        prefix,
        input,
        start,
        base,
        glob,
        isBrace,
        isBracket,
        isGlob,
        isExtglob,
        isGlobstar,
        negated,
        negatedExtglob
      };
      if (opts.tokens === true) {
        state.maxDepth = 0;
        if (!isPathSeparator(code)) {
          tokens.push(token);
        }
        state.tokens = tokens;
      }
      if (opts.parts === true || opts.tokens === true) {
        let prevIndex;
        for (let idx = 0; idx < slashes.length; idx++) {
          const n = prevIndex ? prevIndex + 1 : start;
          const i = slashes[idx];
          const value = input.slice(n, i);
          if (opts.tokens) {
            if (idx === 0 && start !== 0) {
              tokens[idx].isPrefix = true;
              tokens[idx].value = prefix;
            } else {
              tokens[idx].value = value;
            }
            depth(tokens[idx]);
            state.maxDepth += tokens[idx].depth;
          }
          if (idx !== 0 || value !== "") {
            parts.push(value);
          }
          prevIndex = i;
        }
        if (prevIndex && prevIndex + 1 < input.length) {
          const value = input.slice(prevIndex + 1);
          parts.push(value);
          if (opts.tokens) {
            tokens[tokens.length - 1].value = value;
            depth(tokens[tokens.length - 1]);
            state.maxDepth += tokens[tokens.length - 1].depth;
          }
        }
        state.slashes = slashes;
        state.parts = parts;
      }
      return state;
    };
    module2.exports = scan;
  }
});

// node_modules/readdirp/node_modules/picomatch/lib/parse.js
var require_parse = __commonJS({
  "node_modules/readdirp/node_modules/picomatch/lib/parse.js"(exports2, module2) {
    "use strict";
    var constants = require_constants();
    var utils = require_utils();
    var {
      MAX_LENGTH,
      POSIX_REGEX_SOURCE,
      REGEX_NON_SPECIAL_CHARS,
      REGEX_SPECIAL_CHARS_BACKREF,
      REPLACEMENTS
    } = constants;
    var expandRange = (args, options) => {
      if (typeof options.expandRange === "function") {
        return options.expandRange(...args, options);
      }
      args.sort();
      const value = `[${args.join("-")}]`;
      try {
        new RegExp(value);
      } catch (ex) {
        return args.map((v) => utils.escapeRegex(v)).join("..");
      }
      return value;
    };
    var syntaxError = (type, char) => {
      return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`;
    };
    var splitTopLevel = (input) => {
      const parts = [];
      let bracket = 0;
      let paren = 0;
      let quote = 0;
      let value = "";
      let escaped = false;
      for (const ch of input) {
        if (escaped === true) {
          value += ch;
          escaped = false;
          continue;
        }
        if (ch === "\\") {
          value += ch;
          escaped = true;
          continue;
        }
        if (ch === '"') {
          quote = quote === 1 ? 0 : 1;
          value += ch;
          continue;
        }
        if (quote === 0) {
          if (ch === "[") {
            bracket++;
          } else if (ch === "]" && bracket > 0) {
            bracket--;
          } else if (bracket === 0) {
            if (ch === "(") {
              paren++;
            } else if (ch === ")" && paren > 0) {
              paren--;
            } else if (ch === "|" && paren === 0) {
              parts.push(value);
              value = "";
              continue;
            }
          }
        }
        value += ch;
      }
      parts.push(value);
      return parts;
    };
    var isPlainBranch = (branch) => {
      let escaped = false;
      for (const ch of branch) {
        if (escaped === true) {
          escaped = false;
          continue;
        }
        if (ch === "\\") {
          escaped = true;
          continue;
        }
        if (/[?*+@!()[\]{}]/.test(ch)) {
          return false;
        }
      }
      return true;
    };
    var normalizeSimpleBranch = (branch) => {
      let value = branch.trim();
      let changed = true;
      while (changed === true) {
        changed = false;
        if (/^@\([^\\()[\]{}|]+\)$/.test(value)) {
          value = value.slice(2, -1);
          changed = true;
        }
      }
      if (!isPlainBranch(value)) {
        return;
      }
      return value.replace(/\\(.)/g, "$1");
    };
    var hasRepeatedCharPrefixOverlap = (branches) => {
      const values = branches.map(normalizeSimpleBranch).filter(Boolean);
      for (let i = 0; i < values.length; i++) {
        for (let j = i + 1; j < values.length; j++) {
          const a = values[i];
          const b = values[j];
          const char = a[0];
          if (!char || a !== char.repeat(a.length) || b !== char.repeat(b.length)) {
            continue;
          }
          if (a === b || a.startsWith(b) || b.startsWith(a)) {
            return true;
          }
        }
      }
      return false;
    };
    var parseRepeatedExtglob = (pattern, requireEnd = true) => {
      if (pattern[0] !== "+" && pattern[0] !== "*" || pattern[1] !== "(") {
        return;
      }
      let bracket = 0;
      let paren = 0;
      let quote = 0;
      let escaped = false;
      for (let i = 1; i < pattern.length; i++) {
        const ch = pattern[i];
        if (escaped === true) {
          escaped = false;
          continue;
        }
        if (ch === "\\") {
          escaped = true;
          continue;
        }
        if (ch === '"') {
          quote = quote === 1 ? 0 : 1;
          continue;
        }
        if (quote === 1) {
          continue;
        }
        if (ch === "[") {
          bracket++;
          continue;
        }
        if (ch === "]" && bracket > 0) {
          bracket--;
          continue;
        }
        if (bracket > 0) {
          continue;
        }
        if (ch === "(") {
          paren++;
          continue;
        }
        if (ch === ")") {
          paren--;
          if (paren === 0) {
            if (requireEnd === true && i !== pattern.length - 1) {
              return;
            }
            return {
              type: pattern[0],
              body: pattern.slice(2, i),
              end: i
            };
          }
        }
      }
    };
    var getStarExtglobSequenceOutput = (pattern) => {
      let index = 0;
      const chars = [];
      while (index < pattern.length) {
        const match = parseRepeatedExtglob(pattern.slice(index), false);
        if (!match || match.type !== "*") {
          return;
        }
        const branches = splitTopLevel(match.body).map((branch2) => branch2.trim());
        if (branches.length !== 1) {
          return;
        }
        const branch = normalizeSimpleBranch(branches[0]);
        if (!branch || branch.length !== 1) {
          return;
        }
        chars.push(branch);
        index += match.end + 1;
      }
      if (chars.length < 1) {
        return;
      }
      const source = chars.length === 1 ? utils.escapeRegex(chars[0]) : `[${chars.map((ch) => utils.escapeRegex(ch)).join("")}]`;
      return `${source}*`;
    };
    var repeatedExtglobRecursion = (pattern) => {
      let depth = 0;
      let value = pattern.trim();
      let match = parseRepeatedExtglob(value);
      while (match) {
        depth++;
        value = match.body.trim();
        match = parseRepeatedExtglob(value);
      }
      return depth;
    };
    var analyzeRepeatedExtglob = (body, options) => {
      if (options.maxExtglobRecursion === false) {
        return { risky: false };
      }
      const max = typeof options.maxExtglobRecursion === "number" ? options.maxExtglobRecursion : constants.DEFAULT_MAX_EXTGLOB_RECURSION;
      const branches = splitTopLevel(body).map((branch) => branch.trim());
      if (branches.length > 1) {
        if (branches.some((branch) => branch === "") || branches.some((branch) => /^[*?]+$/.test(branch)) || hasRepeatedCharPrefixOverlap(branches)) {
          return { risky: true };
        }
      }
      for (const branch of branches) {
        const safeOutput = getStarExtglobSequenceOutput(branch);
        if (safeOutput) {
          return { risky: true, safeOutput };
        }
        if (repeatedExtglobRecursion(branch) > max) {
          return { risky: true };
        }
      }
      return { risky: false };
    };
    var parse = (input, options) => {
      if (typeof input !== "string") {
        throw new TypeError("Expected a string");
      }
      input = REPLACEMENTS[input] || input;
      const opts = { ...options };
      const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
      let len = input.length;
      if (len > max) {
        throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
      }
      const bos = { type: "bos", value: "", output: opts.prepend || "" };
      const tokens = [bos];
      const capture = opts.capture ? "" : "?:";
      const win32 = utils.isWindows(options);
      const PLATFORM_CHARS = constants.globChars(win32);
      const EXTGLOB_CHARS = constants.extglobChars(PLATFORM_CHARS);
      const {
        DOT_LITERAL,
        PLUS_LITERAL,
        SLASH_LITERAL,
        ONE_CHAR,
        DOTS_SLASH,
        NO_DOT,
        NO_DOT_SLASH,
        NO_DOTS_SLASH,
        QMARK,
        QMARK_NO_DOT,
        STAR,
        START_ANCHOR
      } = PLATFORM_CHARS;
      const globstar = (opts2) => {
        return `(${capture}(?:(?!${START_ANCHOR}${opts2.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
      };
      const nodot = opts.dot ? "" : NO_DOT;
      const qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT;
      let star = opts.bash === true ? globstar(opts) : STAR;
      if (opts.capture) {
        star = `(${star})`;
      }
      if (typeof opts.noext === "boolean") {
        opts.noextglob = opts.noext;
      }
      const state = {
        input,
        index: -1,
        start: 0,
        dot: opts.dot === true,
        consumed: "",
        output: "",
        prefix: "",
        backtrack: false,
        negated: false,
        brackets: 0,
        braces: 0,
        parens: 0,
        quotes: 0,
        globstar: false,
        tokens
      };
      input = utils.removePrefix(input, state);
      len = input.length;
      const extglobs = [];
      const braces = [];
      const stack = [];
      let prev = bos;
      let value;
      const eos = () => state.index === len - 1;
      const peek = state.peek = (n = 1) => input[state.index + n];
      const advance = state.advance = () => input[++state.index] || "";
      const remaining = () => input.slice(state.index + 1);
      const consume = (value2 = "", num = 0) => {
        state.consumed += value2;
        state.index += num;
      };
      const append = (token) => {
        state.output += token.output != null ? token.output : token.value;
        consume(token.value);
      };
      const negate = () => {
        let count = 1;
        while (peek() === "!" && (peek(2) !== "(" || peek(3) === "?")) {
          advance();
          state.start++;
          count++;
        }
        if (count % 2 === 0) {
          return false;
        }
        state.negated = true;
        state.start++;
        return true;
      };
      const increment = (type) => {
        state[type]++;
        stack.push(type);
      };
      const decrement = (type) => {
        state[type]--;
        stack.pop();
      };
      const push = (tok) => {
        if (prev.type === "globstar") {
          const isBrace = state.braces > 0 && (tok.type === "comma" || tok.type === "brace");
          const isExtglob = tok.extglob === true || extglobs.length && (tok.type === "pipe" || tok.type === "paren");
          if (tok.type !== "slash" && tok.type !== "paren" && !isBrace && !isExtglob) {
            state.output = state.output.slice(0, -prev.output.length);
            prev.type = "star";
            prev.value = "*";
            prev.output = star;
            state.output += prev.output;
          }
        }
        if (extglobs.length && tok.type !== "paren") {
          extglobs[extglobs.length - 1].inner += tok.value;
        }
        if (tok.value || tok.output) append(tok);
        if (prev && prev.type === "text" && tok.type === "text") {
          prev.value += tok.value;
          prev.output = (prev.output || "") + tok.value;
          return;
        }
        tok.prev = prev;
        tokens.push(tok);
        prev = tok;
      };
      const extglobOpen = (type, value2) => {
        const token = { ...EXTGLOB_CHARS[value2], conditions: 1, inner: "" };
        token.prev = prev;
        token.parens = state.parens;
        token.output = state.output;
        token.startIndex = state.index;
        token.tokensIndex = tokens.length;
        const output = (opts.capture ? "(" : "") + token.open;
        increment("parens");
        push({ type, value: value2, output: state.output ? "" : ONE_CHAR });
        push({ type: "paren", extglob: true, value: advance(), output });
        extglobs.push(token);
      };
      const extglobClose = (token) => {
        const literal = input.slice(token.startIndex, state.index + 1);
        const body = input.slice(token.startIndex + 2, state.index);
        const analysis = analyzeRepeatedExtglob(body, opts);
        if ((token.type === "plus" || token.type === "star") && analysis.risky) {
          const safeOutput = analysis.safeOutput ? (token.output ? "" : ONE_CHAR) + (opts.capture ? `(${analysis.safeOutput})` : analysis.safeOutput) : void 0;
          const open = tokens[token.tokensIndex];
          open.type = "text";
          open.value = literal;
          open.output = safeOutput || utils.escapeRegex(literal);
          for (let i = token.tokensIndex + 1; i < tokens.length; i++) {
            tokens[i].value = "";
            tokens[i].output = "";
            delete tokens[i].suffix;
          }
          state.output = token.output + open.output;
          state.backtrack = true;
          push({ type: "paren", extglob: true, value, output: "" });
          decrement("parens");
          return;
        }
        let output = token.close + (opts.capture ? ")" : "");
        let rest;
        if (token.type === "negate") {
          let extglobStar = star;
          if (token.inner && token.inner.length > 1 && token.inner.includes("/")) {
            extglobStar = globstar(opts);
          }
          if (extglobStar !== star || eos() || /^\)+$/.test(remaining())) {
            output = token.close = `)$))${extglobStar}`;
          }
          if (token.inner.includes("*") && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) {
            const expression = parse(rest, { ...options, fastpaths: false }).output;
            output = token.close = `)${expression})${extglobStar})`;
          }
          if (token.prev.type === "bos") {
            state.negatedExtglob = true;
          }
        }
        push({ type: "paren", extglob: true, value, output });
        decrement("parens");
      };
      if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input)) {
        let backslashes = false;
        let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index) => {
          if (first === "\\") {
            backslashes = true;
            return m;
          }
          if (first === "?") {
            if (esc) {
              return esc + first + (rest ? QMARK.repeat(rest.length) : "");
            }
            if (index === 0) {
              return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : "");
            }
            return QMARK.repeat(chars.length);
          }
          if (first === ".") {
            return DOT_LITERAL.repeat(chars.length);
          }
          if (first === "*") {
            if (esc) {
              return esc + first + (rest ? star : "");
            }
            return star;
          }
          return esc ? m : `\\${m}`;
        });
        if (backslashes === true) {
          if (opts.unescape === true) {
            output = output.replace(/\\/g, "");
          } else {
            output = output.replace(/\\+/g, (m) => {
              return m.length % 2 === 0 ? "\\\\" : m ? "\\" : "";
            });
          }
        }
        if (output === input && opts.contains === true) {
          state.output = input;
          return state;
        }
        state.output = utils.wrapOutput(output, state, options);
        return state;
      }
      while (!eos()) {
        value = advance();
        if (value === "\0") {
          continue;
        }
        if (value === "\\") {
          const next = peek();
          if (next === "/" && opts.bash !== true) {
            continue;
          }
          if (next === "." || next === ";") {
            continue;
          }
          if (!next) {
            value += "\\";
            push({ type: "text", value });
            continue;
          }
          const match = /^\\+/.exec(remaining());
          let slashes = 0;
          if (match && match[0].length > 2) {
            slashes = match[0].length;
            state.index += slashes;
            if (slashes % 2 !== 0) {
              value += "\\";
            }
          }
          if (opts.unescape === true) {
            value = advance();
          } else {
            value += advance();
          }
          if (state.brackets === 0) {
            push({ type: "text", value });
            continue;
          }
        }
        if (state.brackets > 0 && (value !== "]" || prev.value === "[" || prev.value === "[^")) {
          if (opts.posix !== false && value === ":") {
            const inner = prev.value.slice(1);
            if (inner.includes("[")) {
              prev.posix = true;
              if (inner.includes(":")) {
                const idx = prev.value.lastIndexOf("[");
                const pre = prev.value.slice(0, idx);
                const rest2 = prev.value.slice(idx + 2);
                const posix = POSIX_REGEX_SOURCE[rest2];
                if (posix) {
                  prev.value = pre + posix;
                  state.backtrack = true;
                  advance();
                  if (!bos.output && tokens.indexOf(prev) === 1) {
                    bos.output = ONE_CHAR;
                  }
                  continue;
                }
              }
            }
          }
          if (value === "[" && peek() !== ":" || value === "-" && peek() === "]") {
            value = `\\${value}`;
          }
          if (value === "]" && (prev.value === "[" || prev.value === "[^")) {
            value = `\\${value}`;
          }
          if (opts.posix === true && value === "!" && prev.value === "[") {
            value = "^";
          }
          prev.value += value;
          append({ value });
          continue;
        }
        if (state.quotes === 1 && value !== '"') {
          value = utils.escapeRegex(value);
          prev.value += value;
          append({ value });
          continue;
        }
        if (value === '"') {
          state.quotes = state.quotes === 1 ? 0 : 1;
          if (opts.keepQuotes === true) {
            push({ type: "text", value });
          }
          continue;
        }
        if (value === "(") {
          increment("parens");
          push({ type: "paren", value });
          continue;
        }
        if (value === ")") {
          if (state.parens === 0 && opts.strictBrackets === true) {
            throw new SyntaxError(syntaxError("opening", "("));
          }
          const extglob = extglobs[extglobs.length - 1];
          if (extglob && state.parens === extglob.parens + 1) {
            extglobClose(extglobs.pop());
            continue;
          }
          push({ type: "paren", value, output: state.parens ? ")" : "\\)" });
          decrement("parens");
          continue;
        }
        if (value === "[") {
          if (opts.nobracket === true || !remaining().includes("]")) {
            if (opts.nobracket !== true && opts.strictBrackets === true) {
              throw new SyntaxError(syntaxError("closing", "]"));
            }
            value = `\\${value}`;
          } else {
            increment("brackets");
          }
          push({ type: "bracket", value });
          continue;
        }
        if (value === "]") {
          if (opts.nobracket === true || prev && prev.type === "bracket" && prev.value.length === 1) {
            push({ type: "text", value, output: `\\${value}` });
            continue;
          }
          if (state.brackets === 0) {
            if (opts.strictBrackets === true) {
              throw new SyntaxError(syntaxError("opening", "["));
            }
            push({ type: "text", value, output: `\\${value}` });
            continue;
          }
          decrement("brackets");
          const prevValue = prev.value.slice(1);
          if (prev.posix !== true && prevValue[0] === "^" && !prevValue.includes("/")) {
            value = `/${value}`;
          }
          prev.value += value;
          append({ value });
          if (opts.literalBrackets === false || utils.hasRegexChars(prevValue)) {
            continue;
          }
          const escaped = utils.escapeRegex(prev.value);
          state.output = state.output.slice(0, -prev.value.length);
          if (opts.literalBrackets === true) {
            state.output += escaped;
            prev.value = escaped;
            continue;
          }
          prev.value = `(${capture}${escaped}|${prev.value})`;
          state.output += prev.value;
          continue;
        }
        if (value === "{" && opts.nobrace !== true) {
          increment("braces");
          const open = {
            type: "brace",
            value,
            output: "(",
            outputIndex: state.output.length,
            tokensIndex: state.tokens.length
          };
          braces.push(open);
          push(open);
          continue;
        }
        if (value === "}") {
          const brace = braces[braces.length - 1];
          if (opts.nobrace === true || !brace) {
            push({ type: "text", value, output: value });
            continue;
          }
          let output = ")";
          if (brace.dots === true) {
            const arr = tokens.slice();
            const range = [];
            for (let i = arr.length - 1; i >= 0; i--) {
              tokens.pop();
              if (arr[i].type === "brace") {
                break;
              }
              if (arr[i].type !== "dots") {
                range.unshift(arr[i].value);
              }
            }
            output = expandRange(range, opts);
            state.backtrack = true;
          }
          if (brace.comma !== true && brace.dots !== true) {
            const out = state.output.slice(0, brace.outputIndex);
            const toks = state.tokens.slice(brace.tokensIndex);
            brace.value = brace.output = "\\{";
            value = output = "\\}";
            state.output = out;
            for (const t of toks) {
              state.output += t.output || t.value;
            }
          }
          push({ type: "brace", value, output });
          decrement("braces");
          braces.pop();
          continue;
        }
        if (value === "|") {
          if (extglobs.length > 0) {
            extglobs[extglobs.length - 1].conditions++;
          }
          push({ type: "text", value });
          continue;
        }
        if (value === ",") {
          let output = value;
          const brace = braces[braces.length - 1];
          if (brace && stack[stack.length - 1] === "braces") {
            brace.comma = true;
            output = "|";
          }
          push({ type: "comma", value, output });
          continue;
        }
        if (value === "/") {
          if (prev.type === "dot" && state.index === state.start + 1) {
            state.start = state.index + 1;
            state.consumed = "";
            state.output = "";
            tokens.pop();
            prev = bos;
            continue;
          }
          push({ type: "slash", value, output: SLASH_LITERAL });
          continue;
        }
        if (value === ".") {
          if (state.braces > 0 && prev.type === "dot") {
            if (prev.value === ".") prev.output = DOT_LITERAL;
            const brace = braces[braces.length - 1];
            prev.type = "dots";
            prev.output += value;
            prev.value += value;
            brace.dots = true;
            continue;
          }
          if (state.braces + state.parens === 0 && prev.type !== "bos" && prev.type !== "slash") {
            push({ type: "text", value, output: DOT_LITERAL });
            continue;
          }
          push({ type: "dot", value, output: DOT_LITERAL });
          continue;
        }
        if (value === "?") {
          const isGroup = prev && prev.value === "(";
          if (!isGroup && opts.noextglob !== true && peek() === "(" && peek(2) !== "?") {
            extglobOpen("qmark", value);
            continue;
          }
          if (prev && prev.type === "paren") {
            const next = peek();
            let output = value;
            if (next === "<" && !utils.supportsLookbehinds()) {
              throw new Error("Node.js v10 or higher is required for regex lookbehinds");
            }
            if (prev.value === "(" && !/[!=<:]/.test(next) || next === "<" && !/<([!=]|\w+>)/.test(remaining())) {
              output = `\\${value}`;
            }
            push({ type: "text", value, output });
            continue;
          }
          if (opts.dot !== true && (prev.type === "slash" || prev.type === "bos")) {
            push({ type: "qmark", value, output: QMARK_NO_DOT });
            continue;
          }
          push({ type: "qmark", value, output: QMARK });
          continue;
        }
        if (value === "!") {
          if (opts.noextglob !== true && peek() === "(") {
            if (peek(2) !== "?" || !/[!=<:]/.test(peek(3))) {
              extglobOpen("negate", value);
              continue;
            }
          }
          if (opts.nonegate !== true && state.index === 0) {
            negate();
            continue;
          }
        }
        if (value === "+") {
          if (opts.noextglob !== true && peek() === "(" && peek(2) !== "?") {
            extglobOpen("plus", value);
            continue;
          }
          if (prev && prev.value === "(" || opts.regex === false) {
            push({ type: "plus", value, output: PLUS_LITERAL });
            continue;
          }
          if (prev && (prev.type === "bracket" || prev.type === "paren" || prev.type === "brace") || state.parens > 0) {
            push({ type: "plus", value });
            continue;
          }
          push({ type: "plus", value: PLUS_LITERAL });
          continue;
        }
        if (value === "@") {
          if (opts.noextglob !== true && peek() === "(" && peek(2) !== "?") {
            push({ type: "at", extglob: true, value, output: "" });
            continue;
          }
          push({ type: "text", value });
          continue;
        }
        if (value !== "*") {
          if (value === "$" || value === "^") {
            value = `\\${value}`;
          }
          const match = REGEX_NON_SPECIAL_CHARS.exec(remaining());
          if (match) {
            value += match[0];
            state.index += match[0].length;
          }
          push({ type: "text", value });
          continue;
        }
        if (prev && (prev.type === "globstar" || prev.star === true)) {
          prev.type = "star";
          prev.star = true;
          prev.value += value;
          prev.output = star;
          state.backtrack = true;
          state.globstar = true;
          consume(value);
          continue;
        }
        let rest = remaining();
        if (opts.noextglob !== true && /^\([^?]/.test(rest)) {
          extglobOpen("star", value);
          continue;
        }
        if (prev.type === "star") {
          if (opts.noglobstar === true) {
            consume(value);
            continue;
          }
          const prior = prev.prev;
          const before = prior.prev;
          const isStart = prior.type === "slash" || prior.type === "bos";
          const afterStar = before && (before.type === "star" || before.type === "globstar");
          if (opts.bash === true && (!isStart || rest[0] && rest[0] !== "/")) {
            push({ type: "star", value, output: "" });
            continue;
          }
          const isBrace = state.braces > 0 && (prior.type === "comma" || prior.type === "brace");
          const isExtglob = extglobs.length && (prior.type === "pipe" || prior.type === "paren");
          if (!isStart && prior.type !== "paren" && !isBrace && !isExtglob) {
            push({ type: "star", value, output: "" });
            continue;
          }
          while (rest.slice(0, 3) === "/**") {
            const after = input[state.index + 4];
            if (after && after !== "/") {
              break;
            }
            rest = rest.slice(3);
            consume("/**", 3);
          }
          if (prior.type === "bos" && eos()) {
            prev.type = "globstar";
            prev.value += value;
            prev.output = globstar(opts);
            state.output = prev.output;
            state.globstar = true;
            consume(value);
            continue;
          }
          if (prior.type === "slash" && prior.prev.type !== "bos" && !afterStar && eos()) {
            state.output = state.output.slice(0, -(prior.output + prev.output).length);
            prior.output = `(?:${prior.output}`;
            prev.type = "globstar";
            prev.output = globstar(opts) + (opts.strictSlashes ? ")" : "|$)");
            prev.value += value;
            state.globstar = true;
            state.output += prior.output + prev.output;
            consume(value);
            continue;
          }
          if (prior.type === "slash" && prior.prev.type !== "bos" && rest[0] === "/") {
            const end = rest[1] !== void 0 ? "|$" : "";
            state.output = state.output.slice(0, -(prior.output + prev.output).length);
            prior.output = `(?:${prior.output}`;
            prev.type = "globstar";
            prev.output = `${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`;
            prev.value += value;
            state.output += prior.output + prev.output;
            state.globstar = true;
            consume(value + advance());
            push({ type: "slash", value: "/", output: "" });
            continue;
          }
          if (prior.type === "bos" && rest[0] === "/") {
            prev.type = "globstar";
            prev.value += value;
            prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`;
            state.output = prev.output;
            state.globstar = true;
            consume(value + advance());
            push({ type: "slash", value: "/", output: "" });
            continue;
          }
          state.output = state.output.slice(0, -prev.output.length);
          prev.type = "globstar";
          prev.output = globstar(opts);
          prev.value += value;
          state.output += prev.output;
          state.globstar = true;
          consume(value);
          continue;
        }
        const token = { type: "star", value, output: star };
        if (opts.bash === true) {
          token.output = ".*?";
          if (prev.type === "bos" || prev.type === "slash") {
            token.output = nodot + token.output;
          }
          push(token);
          continue;
        }
        if (prev && (prev.type === "bracket" || prev.type === "paren") && opts.regex === true) {
          token.output = value;
          push(token);
          continue;
        }
        if (state.index === state.start || prev.type === "slash" || prev.type === "dot") {
          if (prev.type === "dot") {
            state.output += NO_DOT_SLASH;
            prev.output += NO_DOT_SLASH;
          } else if (opts.dot === true) {
            state.output += NO_DOTS_SLASH;
            prev.output += NO_DOTS_SLASH;
          } else {
            state.output += nodot;
            prev.output += nodot;
          }
          if (peek() !== "*") {
            state.output += ONE_CHAR;
            prev.output += ONE_CHAR;
          }
        }
        push(token);
      }
      while (state.brackets > 0) {
        if (opts.strictBrackets === true) throw new SyntaxError(syntaxError("closing", "]"));
        state.output = utils.escapeLast(state.output, "[");
        decrement("brackets");
      }
      while (state.parens > 0) {
        if (opts.strictBrackets === true) throw new SyntaxError(syntaxError("closing", ")"));
        state.output = utils.escapeLast(state.output, "(");
        decrement("parens");
      }
      while (state.braces > 0) {
        if (opts.strictBrackets === true) throw new SyntaxError(syntaxError("closing", "}"));
        state.output = utils.escapeLast(state.output, "{");
        decrement("braces");
      }
      if (opts.strictSlashes !== true && (prev.type === "star" || prev.type === "bracket")) {
        push({ type: "maybe_slash", value: "", output: `${SLASH_LITERAL}?` });
      }
      if (state.backtrack === true) {
        state.output = "";
        for (const token of state.tokens) {
          state.output += token.output != null ? token.output : token.value;
          if (token.suffix) {
            state.output += token.suffix;
          }
        }
      }
      return state;
    };
    parse.fastpaths = (input, options) => {
      const opts = { ...options };
      const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
      const len = input.length;
      if (len > max) {
        throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
      }
      input = REPLACEMENTS[input] || input;
      const win32 = utils.isWindows(options);
      const {
        DOT_LITERAL,
        SLASH_LITERAL,
        ONE_CHAR,
        DOTS_SLASH,
        NO_DOT,
        NO_DOTS,
        NO_DOTS_SLASH,
        STAR,
        START_ANCHOR
      } = constants.globChars(win32);
      const nodot = opts.dot ? NO_DOTS : NO_DOT;
      const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT;
      const capture = opts.capture ? "" : "?:";
      const state = { negated: false, prefix: "" };
      let star = opts.bash === true ? ".*?" : STAR;
      if (opts.capture) {
        star = `(${star})`;
      }
      const globstar = (opts2) => {
        if (opts2.noglobstar === true) return star;
        return `(${capture}(?:(?!${START_ANCHOR}${opts2.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
      };
      const create = (str) => {
        switch (str) {
          case "*":
            return `${nodot}${ONE_CHAR}${star}`;
          case ".*":
            return `${DOT_LITERAL}${ONE_CHAR}${star}`;
          case "*.*":
            return `${nodot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
          case "*/*":
            return `${nodot}${star}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star}`;
          case "**":
            return nodot + globstar(opts);
          case "**/*":
            return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star}`;
          case "**/*.*":
            return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
          case "**/.*":
            return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`;
          default: {
            const match = /^(.*?)\.(\w+)$/.exec(str);
            if (!match) return;
            const source2 = create(match[1]);
            if (!source2) return;
            return source2 + DOT_LITERAL + match[2];
          }
        }
      };
      const output = utils.removePrefix(input, state);
      let source = create(output);
      if (source && opts.strictSlashes !== true) {
        source += `${SLASH_LITERAL}?`;
      }
      return source;
    };
    module2.exports = parse;
  }
});

// node_modules/readdirp/node_modules/picomatch/lib/picomatch.js
var require_picomatch = __commonJS({
  "node_modules/readdirp/node_modules/picomatch/lib/picomatch.js"(exports2, module2) {
    "use strict";
    var path3 = require("path");
    var scan = require_scan();
    var parse = require_parse();
    var utils = require_utils();
    var constants = require_constants();
    var isObject = (val) => val && typeof val === "object" && !Array.isArray(val);
    var picomatch = (glob, options, returnState = false) => {
      if (Array.isArray(glob)) {
        const fns = glob.map((input) => picomatch(input, options, returnState));
        const arrayMatcher = (str) => {
          for (const isMatch of fns) {
            const state2 = isMatch(str);
            if (state2) return state2;
          }
          return false;
        };
        return arrayMatcher;
      }
      const isState = isObject(glob) && glob.tokens && glob.input;
      if (glob === "" || typeof glob !== "string" && !isState) {
        throw new TypeError("Expected pattern to be a non-empty string");
      }
      const opts = options || {};
      const posix = utils.isWindows(options);
      const regex = isState ? picomatch.compileRe(glob, options) : picomatch.makeRe(glob, options, false, true);
      const state = regex.state;
      delete regex.state;
      let isIgnored = () => false;
      if (opts.ignore) {
        const ignoreOpts = { ...options, ignore: null, onMatch: null, onResult: null };
        isIgnored = picomatch(opts.ignore, ignoreOpts, returnState);
      }
      const matcher = (input, returnObject = false) => {
        const { isMatch, match, output } = picomatch.test(input, regex, options, { glob, posix });
        const result = { glob, state, regex, posix, input, output, match, isMatch };
        if (typeof opts.onResult === "function") {
          opts.onResult(result);
        }
        if (isMatch === false) {
          result.isMatch = false;
          return returnObject ? result : false;
        }
        if (isIgnored(input)) {
          if (typeof opts.onIgnore === "function") {
            opts.onIgnore(result);
          }
          result.isMatch = false;
          return returnObject ? result : false;
        }
        if (typeof opts.onMatch === "function") {
          opts.onMatch(result);
        }
        return returnObject ? result : true;
      };
      if (returnState) {
        matcher.state = state;
      }
      return matcher;
    };
    picomatch.test = (input, regex, options, { glob, posix } = {}) => {
      if (typeof input !== "string") {
        throw new TypeError("Expected input to be a string");
      }
      if (input === "") {
        return { isMatch: false, output: "" };
      }
      const opts = options || {};
      const format = opts.format || (posix ? utils.toPosixSlashes : null);
      let match = input === glob;
      let output = match && format ? format(input) : input;
      if (match === false) {
        output = format ? format(input) : input;
        match = output === glob;
      }
      if (match === false || opts.capture === true) {
        if (opts.matchBase === true || opts.basename === true) {
          match = picomatch.matchBase(input, regex, options, posix);
        } else {
          match = regex.exec(output);
        }
      }
      return { isMatch: Boolean(match), match, output };
    };
    picomatch.matchBase = (input, glob, options, posix = utils.isWindows(options)) => {
      const regex = glob instanceof RegExp ? glob : picomatch.makeRe(glob, options);
      return regex.test(path3.basename(input));
    };
    picomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str);
    picomatch.parse = (pattern, options) => {
      if (Array.isArray(pattern)) return pattern.map((p) => picomatch.parse(p, options));
      return parse(pattern, { ...options, fastpaths: false });
    };
    picomatch.scan = (input, options) => scan(input, options);
    picomatch.compileRe = (state, options, returnOutput = false, returnState = false) => {
      if (returnOutput === true) {
        return state.output;
      }
      const opts = options || {};
      const prepend = opts.contains ? "" : "^";
      const append = opts.contains ? "" : "$";
      let source = `${prepend}(?:${state.output})${append}`;
      if (state && state.negated === true) {
        source = `^(?!${source}).*$`;
      }
      const regex = picomatch.toRegex(source, options);
      if (returnState === true) {
        regex.state = state;
      }
      return regex;
    };
    picomatch.makeRe = (input, options = {}, returnOutput = false, returnState = false) => {
      if (!input || typeof input !== "string") {
        throw new TypeError("Expected a non-empty string");
      }
      let parsed = { negated: false, fastpaths: true };
      if (options.fastpaths !== false && (input[0] === "." || input[0] === "*")) {
        parsed.output = parse.fastpaths(input, options);
      }
      if (!parsed.output) {
        parsed = parse(input, options);
      }
      return picomatch.compileRe(parsed, options, returnOutput, returnState);
    };
    picomatch.toRegex = (source, options) => {
      try {
        const opts = options || {};
        return new RegExp(source, opts.flags || (opts.nocase ? "i" : ""));
      } catch (err) {
        if (options && options.debug === true) throw err;
        return /$^/;
      }
    };
    picomatch.constants = constants;
    module2.exports = picomatch;
  }
});

// node_modules/readdirp/node_modules/picomatch/index.js
var require_picomatch2 = __commonJS({
  "node_modules/readdirp/node_modules/picomatch/index.js"(exports2, module2) {
    "use strict";
    module2.exports = require_picomatch();
  }
});

// node_modules/readdirp/index.js
var require_readdirp = __commonJS({
  "node_modules/readdirp/index.js"(exports2, module2) {
    "use strict";
    var fs2 = require("fs");
    var { Readable } = require("stream");
    var sysPath = require("path");
    var { promisify } = require("util");
    var picomatch = require_picomatch2();
    var readdir = promisify(fs2.readdir);
    var stat = promisify(fs2.stat);
    var lstat = promisify(fs2.lstat);
    var realpath = promisify(fs2.realpath);
    var BANG = "!";
    var RECURSIVE_ERROR_CODE = "READDIRP_RECURSIVE_ERROR";
    var NORMAL_FLOW_ERRORS = /* @__PURE__ */ new Set(["ENOENT", "EPERM", "EACCES", "ELOOP", RECURSIVE_ERROR_CODE]);
    var FILE_TYPE = "files";
    var DIR_TYPE = "directories";
    var FILE_DIR_TYPE = "files_directories";
    var EVERYTHING_TYPE = "all";
    var ALL_TYPES = [FILE_TYPE, DIR_TYPE, FILE_DIR_TYPE, EVERYTHING_TYPE];
    var isNormalFlowError = (error) => NORMAL_FLOW_ERRORS.has(error.code);
    var [maj, min] = process.versions.node.split(".").slice(0, 2).map((n) => Number.parseInt(n, 10));
    var wantBigintFsStats = process.platform === "win32" && (maj > 10 || maj === 10 && min >= 5);
    var normalizeFilter = (filter) => {
      if (filter === void 0) return;
      if (typeof filter === "function") return filter;
      if (typeof filter === "string") {
        const glob = picomatch(filter.trim());
        return (entry) => glob(entry.basename);
      }
      if (Array.isArray(filter)) {
        const positive = [];
        const negative = [];
        for (const item of filter) {
          const trimmed = item.trim();
          if (trimmed.charAt(0) === BANG) {
            negative.push(picomatch(trimmed.slice(1)));
          } else {
            positive.push(picomatch(trimmed));
          }
        }
        if (negative.length > 0) {
          if (positive.length > 0) {
            return (entry) => positive.some((f) => f(entry.basename)) && !negative.some((f) => f(entry.basename));
          }
          return (entry) => !negative.some((f) => f(entry.basename));
        }
        return (entry) => positive.some((f) => f(entry.basename));
      }
    };
    var ReaddirpStream = class _ReaddirpStream extends Readable {
      static get defaultOptions() {
        return {
          root: ".",
          /* eslint-disable no-unused-vars */
          fileFilter: (path3) => true,
          directoryFilter: (path3) => true,
          /* eslint-enable no-unused-vars */
          type: FILE_TYPE,
          lstat: false,
          depth: 2147483648,
          alwaysStat: false
        };
      }
      constructor(options = {}) {
        super({
          objectMode: true,
          autoDestroy: true,
          highWaterMark: options.highWaterMark || 4096
        });
        const opts = { ..._ReaddirpStream.defaultOptions, ...options };
        const { root, type } = opts;
        this._fileFilter = normalizeFilter(opts.fileFilter);
        this._directoryFilter = normalizeFilter(opts.directoryFilter);
        const statMethod = opts.lstat ? lstat : stat;
        if (wantBigintFsStats) {
          this._stat = (path3) => statMethod(path3, { bigint: true });
        } else {
          this._stat = statMethod;
        }
        this._maxDepth = opts.depth;
        this._wantsDir = [DIR_TYPE, FILE_DIR_TYPE, EVERYTHING_TYPE].includes(type);
        this._wantsFile = [FILE_TYPE, FILE_DIR_TYPE, EVERYTHING_TYPE].includes(type);
        this._wantsEverything = type === EVERYTHING_TYPE;
        this._root = sysPath.resolve(root);
        this._isDirent = "Dirent" in fs2 && !opts.alwaysStat;
        this._statsProp = this._isDirent ? "dirent" : "stats";
        this._rdOptions = { encoding: "utf8", withFileTypes: this._isDirent };
        this.parents = [this._exploreDir(root, 1)];
        this.reading = false;
        this.parent = void 0;
      }
      async _read(batch) {
        if (this.reading) return;
        this.reading = true;
        try {
          while (!this.destroyed && batch > 0) {
            const { path: path3, depth, files = [] } = this.parent || {};
            if (files.length > 0) {
              const slice = files.splice(0, batch).map((dirent) => this._formatEntry(dirent, path3));
              for (const entry of await Promise.all(slice)) {
                if (this.destroyed) return;
                const entryType = await this._getEntryType(entry);
                if (entryType === "directory" && this._directoryFilter(entry)) {
                  if (depth <= this._maxDepth) {
                    this.parents.push(this._exploreDir(entry.fullPath, depth + 1));
                  }
                  if (this._wantsDir) {
                    this.push(entry);
                    batch--;
                  }
                } else if ((entryType === "file" || this._includeAsFile(entry)) && this._fileFilter(entry)) {
                  if (this._wantsFile) {
                    this.push(entry);
                    batch--;
                  }
                }
              }
            } else {
              const parent = this.parents.pop();
              if (!parent) {
                this.push(null);
                break;
              }
              this.parent = await parent;
              if (this.destroyed) return;
            }
          }
        } catch (error) {
          this.destroy(error);
        } finally {
          this.reading = false;
        }
      }
      async _exploreDir(path3, depth) {
        let files;
        try {
          files = await readdir(path3, this._rdOptions);
        } catch (error) {
          this._onError(error);
        }
        return { files, depth, path: path3 };
      }
      async _formatEntry(dirent, path3) {
        let entry;
        try {
          const basename = this._isDirent ? dirent.name : dirent;
          const fullPath = sysPath.resolve(sysPath.join(path3, basename));
          entry = { path: sysPath.relative(this._root, fullPath), fullPath, basename };
          entry[this._statsProp] = this._isDirent ? dirent : await this._stat(fullPath);
        } catch (err) {
          this._onError(err);
        }
        return entry;
      }
      _onError(err) {
        if (isNormalFlowError(err) && !this.destroyed) {
          this.emit("warn", err);
        } else {
          this.destroy(err);
        }
      }
      async _getEntryType(entry) {
        const stats = entry && entry[this._statsProp];
        if (!stats) {
          return;
        }
        if (stats.isFile()) {
          return "file";
        }
        if (stats.isDirectory()) {
          return "directory";
        }
        if (stats && stats.isSymbolicLink()) {
          const full = entry.fullPath;
          try {
            const entryRealPath = await realpath(full);
            const entryRealPathStats = await lstat(entryRealPath);
            if (entryRealPathStats.isFile()) {
              return "file";
            }
            if (entryRealPathStats.isDirectory()) {
              const len = entryRealPath.length;
              if (full.startsWith(entryRealPath) && full.substr(len, 1) === sysPath.sep) {
                const recursiveError = new Error(
                  `Circular symlink detected: "${full}" points to "${entryRealPath}"`
                );
                recursiveError.code = RECURSIVE_ERROR_CODE;
                return this._onError(recursiveError);
              }
              return "directory";
            }
          } catch (error) {
            this._onError(error);
          }
        }
      }
      _includeAsFile(entry) {
        const stats = entry && entry[this._statsProp];
        return stats && this._wantsEverything && !stats.isDirectory();
      }
    };
    var readdirp = (root, options = {}) => {
      let type = options.entryType || options.type;
      if (type === "both") type = FILE_DIR_TYPE;
      if (type) options.type = type;
      if (!root) {
        throw new Error("readdirp: root argument is required. Usage: readdirp(root, options)");
      } else if (typeof root !== "string") {
        throw new TypeError("readdirp: root argument must be a string. Usage: readdirp(root, options)");
      } else if (type && !ALL_TYPES.includes(type)) {
        throw new Error(`readdirp: Invalid type passed. Use one of ${ALL_TYPES.join(", ")}`);
      }
      options.root = root;
      return new ReaddirpStream(options);
    };
    var readdirpPromise = (root, options = {}) => {
      return new Promise((resolve, reject) => {
        const files = [];
        readdirp(root, options).on("data", (entry) => files.push(entry)).on("end", () => resolve(files)).on("error", (error) => reject(error));
      });
    };
    readdirp.promise = readdirpPromise;
    readdirp.ReaddirpStream = ReaddirpStream;
    readdirp.default = readdirp;
    module2.exports = readdirp;
  }
});

// node_modules/anymatch/node_modules/picomatch/lib/constants.js
var require_constants2 = __commonJS({
  "node_modules/anymatch/node_modules/picomatch/lib/constants.js"(exports2, module2) {
    "use strict";
    var path3 = require("path");
    var WIN_SLASH = "\\\\/";
    var WIN_NO_SLASH = `[^${WIN_SLASH}]`;
    var DEFAULT_MAX_EXTGLOB_RECURSION = 0;
    var DOT_LITERAL = "\\.";
    var PLUS_LITERAL = "\\+";
    var QMARK_LITERAL = "\\?";
    var SLASH_LITERAL = "\\/";
    var ONE_CHAR = "(?=.)";
    var QMARK = "[^/]";
    var END_ANCHOR = `(?:${SLASH_LITERAL}|$)`;
    var START_ANCHOR = `(?:^|${SLASH_LITERAL})`;
    var DOTS_SLASH = `${DOT_LITERAL}{1,2}${END_ANCHOR}`;
    var NO_DOT = `(?!${DOT_LITERAL})`;
    var NO_DOTS = `(?!${START_ANCHOR}${DOTS_SLASH})`;
    var NO_DOT_SLASH = `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`;
    var NO_DOTS_SLASH = `(?!${DOTS_SLASH})`;
    var QMARK_NO_DOT = `[^.${SLASH_LITERAL}]`;
    var STAR = `${QMARK}*?`;
    var POSIX_CHARS = {
      DOT_LITERAL,
      PLUS_LITERAL,
      QMARK_LITERAL,
      SLASH_LITERAL,
      ONE_CHAR,
      QMARK,
      END_ANCHOR,
      DOTS_SLASH,
      NO_DOT,
      NO_DOTS,
      NO_DOT_SLASH,
      NO_DOTS_SLASH,
      QMARK_NO_DOT,
      STAR,
      START_ANCHOR
    };
    var WINDOWS_CHARS = {
      ...POSIX_CHARS,
      SLASH_LITERAL: `[${WIN_SLASH}]`,
      QMARK: WIN_NO_SLASH,
      STAR: `${WIN_NO_SLASH}*?`,
      DOTS_SLASH: `${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$)`,
      NO_DOT: `(?!${DOT_LITERAL})`,
      NO_DOTS: `(?!(?:^|[${WIN_SLASH}])${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
      NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}(?:[${WIN_SLASH}]|$))`,
      NO_DOTS_SLASH: `(?!${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
      QMARK_NO_DOT: `[^.${WIN_SLASH}]`,
      START_ANCHOR: `(?:^|[${WIN_SLASH}])`,
      END_ANCHOR: `(?:[${WIN_SLASH}]|$)`
    };
    var POSIX_REGEX_SOURCE = {
      __proto__: null,
      alnum: "a-zA-Z0-9",
      alpha: "a-zA-Z",
      ascii: "\\x00-\\x7F",
      blank: " \\t",
      cntrl: "\\x00-\\x1F\\x7F",
      digit: "0-9",
      graph: "\\x21-\\x7E",
      lower: "a-z",
      print: "\\x20-\\x7E ",
      punct: "\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",
      space: " \\t\\r\\n\\v\\f",
      upper: "A-Z",
      word: "A-Za-z0-9_",
      xdigit: "A-Fa-f0-9"
    };
    module2.exports = {
      DEFAULT_MAX_EXTGLOB_RECURSION,
      MAX_LENGTH: 1024 * 64,
      POSIX_REGEX_SOURCE,
      // regular expressions
      REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g,
      REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/,
      REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/,
      REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g,
      REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g,
      REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g,
      // Replace globs with equivalent patterns to reduce parsing time.
      REPLACEMENTS: {
        __proto__: null,
        "***": "*",
        "**/**": "**",
        "**/**/**": "**"
      },
      // Digits
      CHAR_0: 48,
      /* 0 */
      CHAR_9: 57,
      /* 9 */
      // Alphabet chars.
      CHAR_UPPERCASE_A: 65,
      /* A */
      CHAR_LOWERCASE_A: 97,
      /* a */
      CHAR_UPPERCASE_Z: 90,
      /* Z */
      CHAR_LOWERCASE_Z: 122,
      /* z */
      CHAR_LEFT_PARENTHESES: 40,
      /* ( */
      CHAR_RIGHT_PARENTHESES: 41,
      /* ) */
      CHAR_ASTERISK: 42,
      /* * */
      // Non-alphabetic chars.
      CHAR_AMPERSAND: 38,
      /* & */
      CHAR_AT: 64,
      /* @ */
      CHAR_BACKWARD_SLASH: 92,
      /* \ */
      CHAR_CARRIAGE_RETURN: 13,
      /* \r */
      CHAR_CIRCUMFLEX_ACCENT: 94,
      /* ^ */
      CHAR_COLON: 58,
      /* : */
      CHAR_COMMA: 44,
      /* , */
      CHAR_DOT: 46,
      /* . */
      CHAR_DOUBLE_QUOTE: 34,
      /* " */
      CHAR_EQUAL: 61,
      /* = */
      CHAR_EXCLAMATION_MARK: 33,
      /* ! */
      CHAR_FORM_FEED: 12,
      /* \f */
      CHAR_FORWARD_SLASH: 47,
      /* / */
      CHAR_GRAVE_ACCENT: 96,
      /* ` */
      CHAR_HASH: 35,
      /* # */
      CHAR_HYPHEN_MINUS: 45,
      /* - */
      CHAR_LEFT_ANGLE_BRACKET: 60,
      /* < */
      CHAR_LEFT_CURLY_BRACE: 123,
      /* { */
      CHAR_LEFT_SQUARE_BRACKET: 91,
      /* [ */
      CHAR_LINE_FEED: 10,
      /* \n */
      CHAR_NO_BREAK_SPACE: 160,
      /* \u00A0 */
      CHAR_PERCENT: 37,
      /* % */
      CHAR_PLUS: 43,
      /* + */
      CHAR_QUESTION_MARK: 63,
      /* ? */
      CHAR_RIGHT_ANGLE_BRACKET: 62,
      /* > */
      CHAR_RIGHT_CURLY_BRACE: 125,
      /* } */
      CHAR_RIGHT_SQUARE_BRACKET: 93,
      /* ] */
      CHAR_SEMICOLON: 59,
      /* ; */
      CHAR_SINGLE_QUOTE: 39,
      /* ' */
      CHAR_SPACE: 32,
      /*   */
      CHAR_TAB: 9,
      /* \t */
      CHAR_UNDERSCORE: 95,
      /* _ */
      CHAR_VERTICAL_LINE: 124,
      /* | */
      CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279,
      /* \uFEFF */
      SEP: path3.sep,
      /**
       * Create EXTGLOB_CHARS
       */
      extglobChars(chars) {
        return {
          "!": { type: "negate", open: "(?:(?!(?:", close: `))${chars.STAR})` },
          "?": { type: "qmark", open: "(?:", close: ")?" },
          "+": { type: "plus", open: "(?:", close: ")+" },
          "*": { type: "star", open: "(?:", close: ")*" },
          "@": { type: "at", open: "(?:", close: ")" }
        };
      },
      /**
       * Create GLOB_CHARS
       */
      globChars(win32) {
        return win32 === true ? WINDOWS_CHARS : POSIX_CHARS;
      }
    };
  }
});

// node_modules/anymatch/node_modules/picomatch/lib/utils.js
var require_utils2 = __commonJS({
  "node_modules/anymatch/node_modules/picomatch/lib/utils.js"(exports2) {
    "use strict";
    var path3 = require("path");
    var win32 = process.platform === "win32";
    var {
      REGEX_BACKSLASH,
      REGEX_REMOVE_BACKSLASH,
      REGEX_SPECIAL_CHARS,
      REGEX_SPECIAL_CHARS_GLOBAL
    } = require_constants2();
    exports2.isObject = (val) => val !== null && typeof val === "object" && !Array.isArray(val);
    exports2.hasRegexChars = (str) => REGEX_SPECIAL_CHARS.test(str);
    exports2.isRegexChar = (str) => str.length === 1 && exports2.hasRegexChars(str);
    exports2.escapeRegex = (str) => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, "\\$1");
    exports2.toPosixSlashes = (str) => str.replace(REGEX_BACKSLASH, "/");
    exports2.removeBackslashes = (str) => {
      return str.replace(REGEX_REMOVE_BACKSLASH, (match) => {
        return match === "\\" ? "" : match;
      });
    };
    exports2.supportsLookbehinds = () => {
      const segs = process.version.slice(1).split(".").map(Number);
      if (segs.length === 3 && segs[0] >= 9 || segs[0] === 8 && segs[1] >= 10) {
        return true;
      }
      return false;
    };
    exports2.isWindows = (options) => {
      if (options && typeof options.windows === "boolean") {
        return options.windows;
      }
      return win32 === true || path3.sep === "\\";
    };
    exports2.escapeLast = (input, char, lastIdx) => {
      const idx = input.lastIndexOf(char, lastIdx);
      if (idx === -1) return input;
      if (input[idx - 1] === "\\") return exports2.escapeLast(input, char, idx - 1);
      return `${input.slice(0, idx)}\\${input.slice(idx)}`;
    };
    exports2.removePrefix = (input, state = {}) => {
      let output = input;
      if (output.startsWith("./")) {
        output = output.slice(2);
        state.prefix = "./";
      }
      return output;
    };
    exports2.wrapOutput = (input, state = {}, options = {}) => {
      const prepend = options.contains ? "" : "^";
      const append = options.contains ? "" : "$";
      let output = `${prepend}(?:${input})${append}`;
      if (state.negated === true) {
        output = `(?:^(?!${output}).*$)`;
      }
      return output;
    };
  }
});

// node_modules/anymatch/node_modules/picomatch/lib/scan.js
var require_scan2 = __commonJS({
  "node_modules/anymatch/node_modules/picomatch/lib/scan.js"(exports2, module2) {
    "use strict";
    var utils = require_utils2();
    var {
      CHAR_ASTERISK,
      /* * */
      CHAR_AT,
      /* @ */
      CHAR_BACKWARD_SLASH,
      /* \ */
      CHAR_COMMA,
      /* , */
      CHAR_DOT,
      /* . */
      CHAR_EXCLAMATION_MARK,
      /* ! */
      CHAR_FORWARD_SLASH,
      /* / */
      CHAR_LEFT_CURLY_BRACE,
      /* { */
      CHAR_LEFT_PARENTHESES,
      /* ( */
      CHAR_LEFT_SQUARE_BRACKET,
      /* [ */
      CHAR_PLUS,
      /* + */
      CHAR_QUESTION_MARK,
      /* ? */
      CHAR_RIGHT_CURLY_BRACE,
      /* } */
      CHAR_RIGHT_PARENTHESES,
      /* ) */
      CHAR_RIGHT_SQUARE_BRACKET
      /* ] */
    } = require_constants2();
    var isPathSeparator = (code) => {
      return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH;
    };
    var depth = (token) => {
      if (token.isPrefix !== true) {
        token.depth = token.isGlobstar ? Infinity : 1;
      }
    };
    var scan = (input, options) => {
      const opts = options || {};
      const length = input.length - 1;
      const scanToEnd = opts.parts === true || opts.scanToEnd === true;
      const slashes = [];
      const tokens = [];
      const parts = [];
      let str = input;
      let index = -1;
      let start = 0;
      let lastIndex = 0;
      let isBrace = false;
      let isBracket = false;
      let isGlob = false;
      let isExtglob = false;
      let isGlobstar = false;
      let braceEscaped = false;
      let backslashes = false;
      let negated = false;
      let negatedExtglob = false;
      let finished = false;
      let braces = 0;
      let prev;
      let code;
      let token = { value: "", depth: 0, isGlob: false };
      const eos = () => index >= length;
      const peek = () => str.charCodeAt(index + 1);
      const advance = () => {
        prev = code;
        return str.charCodeAt(++index);
      };
      while (index < length) {
        code = advance();
        let next;
        if (code === CHAR_BACKWARD_SLASH) {
          backslashes = token.backslashes = true;
          code = advance();
          if (code === CHAR_LEFT_CURLY_BRACE) {
            braceEscaped = true;
          }
          continue;
        }
        if (braceEscaped === true || code === CHAR_LEFT_CURLY_BRACE) {
          braces++;
          while (eos() !== true && (code = advance())) {
            if (code === CHAR_BACKWARD_SLASH) {
              backslashes = token.backslashes = true;
              advance();
              continue;
            }
            if (code === CHAR_LEFT_CURLY_BRACE) {
              braces++;
              continue;
            }
            if (braceEscaped !== true && code === CHAR_DOT && (code = advance()) === CHAR_DOT) {
              isBrace = token.isBrace = true;
              isGlob = token.isGlob = true;
              finished = true;
              if (scanToEnd === true) {
                continue;
              }
              break;
            }
            if (braceEscaped !== true && code === CHAR_COMMA) {
              isBrace = token.isBrace = true;
              isGlob = token.isGlob = true;
              finished = true;
              if (scanToEnd === true) {
                continue;
              }
              break;
            }
            if (code === CHAR_RIGHT_CURLY_BRACE) {
              braces--;
              if (braces === 0) {
                braceEscaped = false;
                isBrace = token.isBrace = true;
                finished = true;
                break;
              }
            }
          }
          if (scanToEnd === true) {
            continue;
          }
          break;
        }
        if (code === CHAR_FORWARD_SLASH) {
          slashes.push(index);
          tokens.push(token);
          token = { value: "", depth: 0, isGlob: false };
          if (finished === true) continue;
          if (prev === CHAR_DOT && index === start + 1) {
            start += 2;
            continue;
          }
          lastIndex = index + 1;
          continue;
        }
        if (opts.noext !== true) {
          const isExtglobChar = code === CHAR_PLUS || code === CHAR_AT || code === CHAR_ASTERISK || code === CHAR_QUESTION_MARK || code === CHAR_EXCLAMATION_MARK;
          if (isExtglobChar === true && peek() === CHAR_LEFT_PARENTHESES) {
            isGlob = token.isGlob = true;
            isExtglob = token.isExtglob = true;
            finished = true;
            if (code === CHAR_EXCLAMATION_MARK && index === start) {
              negatedExtglob = true;
            }
            if (scanToEnd === true) {
              while (eos() !== true && (code = advance())) {
                if (code === CHAR_BACKWARD_SLASH) {
                  backslashes = token.backslashes = true;
                  code = advance();
                  continue;
                }
                if (code === CHAR_RIGHT_PARENTHESES) {
                  isGlob = token.isGlob = true;
                  finished = true;
                  break;
                }
              }
              continue;
            }
            break;
          }
        }
        if (code === CHAR_ASTERISK) {
          if (prev === CHAR_ASTERISK) isGlobstar = token.isGlobstar = true;
          isGlob = token.isGlob = true;
          finished = true;
          if (scanToEnd === true) {
            continue;
          }
          break;
        }
        if (code === CHAR_QUESTION_MARK) {
          isGlob = token.isGlob = true;
          finished = true;
          if (scanToEnd === true) {
            continue;
          }
          break;
        }
        if (code === CHAR_LEFT_SQUARE_BRACKET) {
          while (eos() !== true && (next = advance())) {
            if (next === CHAR_BACKWARD_SLASH) {
              backslashes = token.backslashes = true;
              advance();
              continue;
            }
            if (next === CHAR_RIGHT_SQUARE_BRACKET) {
              isBracket = token.isBracket = true;
              isGlob = token.isGlob = true;
              finished = true;
              break;
            }
          }
          if (scanToEnd === true) {
            continue;
          }
          break;
        }
        if (opts.nonegate !== true && code === CHAR_EXCLAMATION_MARK && index === start) {
          negated = token.negated = true;
          start++;
          continue;
        }
        if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES) {
          isGlob = token.isGlob = true;
          if (scanToEnd === true) {
            while (eos() !== true && (code = advance())) {
              if (code === CHAR_LEFT_PARENTHESES) {
                backslashes = token.backslashes = true;
                code = advance();
                continue;
              }
              if (code === CHAR_RIGHT_PARENTHESES) {
                finished = true;
                break;
              }
            }
            continue;
          }
          break;
        }
        if (isGlob === true) {
          finished = true;
          if (scanToEnd === true) {
            continue;
          }
          break;
        }
      }
      if (opts.noext === true) {
        isExtglob = false;
        isGlob = false;
      }
      let base = str;
      let prefix = "";
      let glob = "";
      if (start > 0) {
        prefix = str.slice(0, start);
        str = str.slice(start);
        lastIndex -= start;
      }
      if (base && isGlob === true && lastIndex > 0) {
        base = str.slice(0, lastIndex);
        glob = str.slice(lastIndex);
      } else if (isGlob === true) {
        base = "";
        glob = str;
      } else {
        base = str;
      }
      if (base && base !== "" && base !== "/" && base !== str) {
        if (isPathSeparator(base.charCodeAt(base.length - 1))) {
          base = base.slice(0, -1);
        }
      }
      if (opts.unescape === true) {
        if (glob) glob = utils.removeBackslashes(glob);
        if (base && backslashes === true) {
          base = utils.removeBackslashes(base);
        }
      }
      const state = {
        prefix,
        input,
        start,
        base,
        glob,
        isBrace,
        isBracket,
        isGlob,
        isExtglob,
        isGlobstar,
        negated,
        negatedExtglob
      };
      if (opts.tokens === true) {
        state.maxDepth = 0;
        if (!isPathSeparator(code)) {
          tokens.push(token);
        }
        state.tokens = tokens;
      }
      if (opts.parts === true || opts.tokens === true) {
        let prevIndex;
        for (let idx = 0; idx < slashes.length; idx++) {
          const n = prevIndex ? prevIndex + 1 : start;
          const i = slashes[idx];
          const value = input.slice(n, i);
          if (opts.tokens) {
            if (idx === 0 && start !== 0) {
              tokens[idx].isPrefix = true;
              tokens[idx].value = prefix;
            } else {
              tokens[idx].value = value;
            }
            depth(tokens[idx]);
            state.maxDepth += tokens[idx].depth;
          }
          if (idx !== 0 || value !== "") {
            parts.push(value);
          }
          prevIndex = i;
        }
        if (prevIndex && prevIndex + 1 < input.length) {
          const value = input.slice(prevIndex + 1);
          parts.push(value);
          if (opts.tokens) {
            tokens[tokens.length - 1].value = value;
            depth(tokens[tokens.length - 1]);
            state.maxDepth += tokens[tokens.length - 1].depth;
          }
        }
        state.slashes = slashes;
        state.parts = parts;
      }
      return state;
    };
    module2.exports = scan;
  }
});

// node_modules/anymatch/node_modules/picomatch/lib/parse.js
var require_parse2 = __commonJS({
  "node_modules/anymatch/node_modules/picomatch/lib/parse.js"(exports2, module2) {
    "use strict";
    var constants = require_constants2();
    var utils = require_utils2();
    var {
      MAX_LENGTH,
      POSIX_REGEX_SOURCE,
      REGEX_NON_SPECIAL_CHARS,
      REGEX_SPECIAL_CHARS_BACKREF,
      REPLACEMENTS
    } = constants;
    var expandRange = (args, options) => {
      if (typeof options.expandRange === "function") {
        return options.expandRange(...args, options);
      }
      args.sort();
      const value = `[${args.join("-")}]`;
      try {
        new RegExp(value);
      } catch (ex) {
        return args.map((v) => utils.escapeRegex(v)).join("..");
      }
      return value;
    };
    var syntaxError = (type, char) => {
      return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`;
    };
    var splitTopLevel = (input) => {
      const parts = [];
      let bracket = 0;
      let paren = 0;
      let quote = 0;
      let value = "";
      let escaped = false;
      for (const ch of input) {
        if (escaped === true) {
          value += ch;
          escaped = false;
          continue;
        }
        if (ch === "\\") {
          value += ch;
          escaped = true;
          continue;
        }
        if (ch === '"') {
          quote = quote === 1 ? 0 : 1;
          value += ch;
          continue;
        }
        if (quote === 0) {
          if (ch === "[") {
            bracket++;
          } else if (ch === "]" && bracket > 0) {
            bracket--;
          } else if (bracket === 0) {
            if (ch === "(") {
              paren++;
            } else if (ch === ")" && paren > 0) {
              paren--;
            } else if (ch === "|" && paren === 0) {
              parts.push(value);
              value = "";
              continue;
            }
          }
        }
        value += ch;
      }
      parts.push(value);
      return parts;
    };
    var isPlainBranch = (branch) => {
      let escaped = false;
      for (const ch of branch) {
        if (escaped === true) {
          escaped = false;
          continue;
        }
        if (ch === "\\") {
          escaped = true;
          continue;
        }
        if (/[?*+@!()[\]{}]/.test(ch)) {
          return false;
        }
      }
      return true;
    };
    var normalizeSimpleBranch = (branch) => {
      let value = branch.trim();
      let changed = true;
      while (changed === true) {
        changed = false;
        if (/^@\([^\\()[\]{}|]+\)$/.test(value)) {
          value = value.slice(2, -1);
          changed = true;
        }
      }
      if (!isPlainBranch(value)) {
        return;
      }
      return value.replace(/\\(.)/g, "$1");
    };
    var hasRepeatedCharPrefixOverlap = (branches) => {
      const values = branches.map(normalizeSimpleBranch).filter(Boolean);
      for (let i = 0; i < values.length; i++) {
        for (let j = i + 1; j < values.length; j++) {
          const a = values[i];
          const b = values[j];
          const char = a[0];
          if (!char || a !== char.repeat(a.length) || b !== char.repeat(b.length)) {
            continue;
          }
          if (a === b || a.startsWith(b) || b.startsWith(a)) {
            return true;
          }
        }
      }
      return false;
    };
    var parseRepeatedExtglob = (pattern, requireEnd = true) => {
      if (pattern[0] !== "+" && pattern[0] !== "*" || pattern[1] !== "(") {
        return;
      }
      let bracket = 0;
      let paren = 0;
      let quote = 0;
      let escaped = false;
      for (let i = 1; i < pattern.length; i++) {
        const ch = pattern[i];
        if (escaped === true) {
          escaped = false;
          continue;
        }
        if (ch === "\\") {
          escaped = true;
          continue;
        }
        if (ch === '"') {
          quote = quote === 1 ? 0 : 1;
          continue;
        }
        if (quote === 1) {
          continue;
        }
        if (ch === "[") {
          bracket++;
          continue;
        }
        if (ch === "]" && bracket > 0) {
          bracket--;
          continue;
        }
        if (bracket > 0) {
          continue;
        }
        if (ch === "(") {
          paren++;
          continue;
        }
        if (ch === ")") {
          paren--;
          if (paren === 0) {
            if (requireEnd === true && i !== pattern.length - 1) {
              return;
            }
            return {
              type: pattern[0],
              body: pattern.slice(2, i),
              end: i
            };
          }
        }
      }
    };
    var getStarExtglobSequenceOutput = (pattern) => {
      let index = 0;
      const chars = [];
      while (index < pattern.length) {
        const match = parseRepeatedExtglob(pattern.slice(index), false);
        if (!match || match.type !== "*") {
          return;
        }
        const branches = splitTopLevel(match.body).map((branch2) => branch2.trim());
        if (branches.length !== 1) {
          return;
        }
        const branch = normalizeSimpleBranch(branches[0]);
        if (!branch || branch.length !== 1) {
          return;
        }
        chars.push(branch);
        index += match.end + 1;
      }
      if (chars.length < 1) {
        return;
      }
      const source = chars.length === 1 ? utils.escapeRegex(chars[0]) : `[${chars.map((ch) => utils.escapeRegex(ch)).join("")}]`;
      return `${source}*`;
    };
    var repeatedExtglobRecursion = (pattern) => {
      let depth = 0;
      let value = pattern.trim();
      let match = parseRepeatedExtglob(value);
      while (match) {
        depth++;
        value = match.body.trim();
        match = parseRepeatedExtglob(value);
      }
      return depth;
    };
    var analyzeRepeatedExtglob = (body, options) => {
      if (options.maxExtglobRecursion === false) {
        return { risky: false };
      }
      const max = typeof options.maxExtglobRecursion === "number" ? options.maxExtglobRecursion : constants.DEFAULT_MAX_EXTGLOB_RECURSION;
      const branches = splitTopLevel(body).map((branch) => branch.trim());
      if (branches.length > 1) {
        if (branches.some((branch) => branch === "") || branches.some((branch) => /^[*?]+$/.test(branch)) || hasRepeatedCharPrefixOverlap(branches)) {
          return { risky: true };
        }
      }
      for (const branch of branches) {
        const safeOutput = getStarExtglobSequenceOutput(branch);
        if (safeOutput) {
          return { risky: true, safeOutput };
        }
        if (repeatedExtglobRecursion(branch) > max) {
          return { risky: true };
        }
      }
      return { risky: false };
    };
    var parse = (input, options) => {
      if (typeof input !== "string") {
        throw new TypeError("Expected a string");
      }
      input = REPLACEMENTS[input] || input;
      const opts = { ...options };
      const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
      let len = input.length;
      if (len > max) {
        throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
      }
      const bos = { type: "bos", value: "", output: opts.prepend || "" };
      const tokens = [bos];
      const capture = opts.capture ? "" : "?:";
      const win32 = utils.isWindows(options);
      const PLATFORM_CHARS = constants.globChars(win32);
      const EXTGLOB_CHARS = constants.extglobChars(PLATFORM_CHARS);
      const {
        DOT_LITERAL,
        PLUS_LITERAL,
        SLASH_LITERAL,
        ONE_CHAR,
        DOTS_SLASH,
        NO_DOT,
        NO_DOT_SLASH,
        NO_DOTS_SLASH,
        QMARK,
        QMARK_NO_DOT,
        STAR,
        START_ANCHOR
      } = PLATFORM_CHARS;
      const globstar = (opts2) => {
        return `(${capture}(?:(?!${START_ANCHOR}${opts2.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
      };
      const nodot = opts.dot ? "" : NO_DOT;
      const qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT;
      let star = opts.bash === true ? globstar(opts) : STAR;
      if (opts.capture) {
        star = `(${star})`;
      }
      if (typeof opts.noext === "boolean") {
        opts.noextglob = opts.noext;
      }
      const state = {
        input,
        index: -1,
        start: 0,
        dot: opts.dot === true,
        consumed: "",
        output: "",
        prefix: "",
        backtrack: false,
        negated: false,
        brackets: 0,
        braces: 0,
        parens: 0,
        quotes: 0,
        globstar: false,
        tokens
      };
      input = utils.removePrefix(input, state);
      len = input.length;
      const extglobs = [];
      const braces = [];
      const stack = [];
      let prev = bos;
      let value;
      const eos = () => state.index === len - 1;
      const peek = state.peek = (n = 1) => input[state.index + n];
      const advance = state.advance = () => input[++state.index] || "";
      const remaining = () => input.slice(state.index + 1);
      const consume = (value2 = "", num = 0) => {
        state.consumed += value2;
        state.index += num;
      };
      const append = (token) => {
        state.output += token.output != null ? token.output : token.value;
        consume(token.value);
      };
      const negate = () => {
        let count = 1;
        while (peek() === "!" && (peek(2) !== "(" || peek(3) === "?")) {
          advance();
          state.start++;
          count++;
        }
        if (count % 2 === 0) {
          return false;
        }
        state.negated = true;
        state.start++;
        return true;
      };
      const increment = (type) => {
        state[type]++;
        stack.push(type);
      };
      const decrement = (type) => {
        state[type]--;
        stack.pop();
      };
      const push = (tok) => {
        if (prev.type === "globstar") {
          const isBrace = state.braces > 0 && (tok.type === "comma" || tok.type === "brace");
          const isExtglob = tok.extglob === true || extglobs.length && (tok.type === "pipe" || tok.type === "paren");
          if (tok.type !== "slash" && tok.type !== "paren" && !isBrace && !isExtglob) {
            state.output = state.output.slice(0, -prev.output.length);
            prev.type = "star";
            prev.value = "*";
            prev.output = star;
            state.output += prev.output;
          }
        }
        if (extglobs.length && tok.type !== "paren") {
          extglobs[extglobs.length - 1].inner += tok.value;
        }
        if (tok.value || tok.output) append(tok);
        if (prev && prev.type === "text" && tok.type === "text") {
          prev.value += tok.value;
          prev.output = (prev.output || "") + tok.value;
          return;
        }
        tok.prev = prev;
        tokens.push(tok);
        prev = tok;
      };
      const extglobOpen = (type, value2) => {
        const token = { ...EXTGLOB_CHARS[value2], conditions: 1, inner: "" };
        token.prev = prev;
        token.parens = state.parens;
        token.output = state.output;
        token.startIndex = state.index;
        token.tokensIndex = tokens.length;
        const output = (opts.capture ? "(" : "") + token.open;
        increment("parens");
        push({ type, value: value2, output: state.output ? "" : ONE_CHAR });
        push({ type: "paren", extglob: true, value: advance(), output });
        extglobs.push(token);
      };
      const extglobClose = (token) => {
        const literal = input.slice(token.startIndex, state.index + 1);
        const body = input.slice(token.startIndex + 2, state.index);
        const analysis = analyzeRepeatedExtglob(body, opts);
        if ((token.type === "plus" || token.type === "star") && analysis.risky) {
          const safeOutput = analysis.safeOutput ? (token.output ? "" : ONE_CHAR) + (opts.capture ? `(${analysis.safeOutput})` : analysis.safeOutput) : void 0;
          const open = tokens[token.tokensIndex];
          open.type = "text";
          open.value = literal;
          open.output = safeOutput || utils.escapeRegex(literal);
          for (let i = token.tokensIndex + 1; i < tokens.length; i++) {
            tokens[i].value = "";
            tokens[i].output = "";
            delete tokens[i].suffix;
          }
          state.output = token.output + open.output;
          state.backtrack = true;
          push({ type: "paren", extglob: true, value, output: "" });
          decrement("parens");
          return;
        }
        let output = token.close + (opts.capture ? ")" : "");
        let rest;
        if (token.type === "negate") {
          let extglobStar = star;
          if (token.inner && token.inner.length > 1 && token.inner.includes("/")) {
            extglobStar = globstar(opts);
          }
          if (extglobStar !== star || eos() || /^\)+$/.test(remaining())) {
            output = token.close = `)$))${extglobStar}`;
          }
          if (token.inner.includes("*") && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) {
            const expression = parse(rest, { ...options, fastpaths: false }).output;
            output = token.close = `)${expression})${extglobStar})`;
          }
          if (token.prev.type === "bos") {
            state.negatedExtglob = true;
          }
        }
        push({ type: "paren", extglob: true, value, output });
        decrement("parens");
      };
      if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input)) {
        let backslashes = false;
        let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index) => {
          if (first === "\\") {
            backslashes = true;
            return m;
          }
          if (first === "?") {
            if (esc) {
              return esc + first + (rest ? QMARK.repeat(rest.length) : "");
            }
            if (index === 0) {
              return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : "");
            }
            return QMARK.repeat(chars.length);
          }
          if (first === ".") {
            return DOT_LITERAL.repeat(chars.length);
          }
          if (first === "*") {
            if (esc) {
              return esc + first + (rest ? star : "");
            }
            return star;
          }
          return esc ? m : `\\${m}`;
        });
        if (backslashes === true) {
          if (opts.unescape === true) {
            output = output.replace(/\\/g, "");
          } else {
            output = output.replace(/\\+/g, (m) => {
              return m.length % 2 === 0 ? "\\\\" : m ? "\\" : "";
            });
          }
        }
        if (output === input && opts.contains === true) {
          state.output = input;
          return state;
        }
        state.output = utils.wrapOutput(output, state, options);
        return state;
      }
      while (!eos()) {
        value = advance();
        if (value === "\0") {
          continue;
        }
        if (value === "\\") {
          const next = peek();
          if (next === "/" && opts.bash !== true) {
            continue;
          }
          if (next === "." || next === ";") {
            continue;
          }
          if (!next) {
            value += "\\";
            push({ type: "text", value });
            continue;
          }
          const match = /^\\+/.exec(remaining());
          let slashes = 0;
          if (match && match[0].length > 2) {
            slashes = match[0].length;
            state.index += slashes;
            if (slashes % 2 !== 0) {
              value += "\\";
            }
          }
          if (opts.unescape === true) {
            value = advance();
          } else {
            value += advance();
          }
          if (state.brackets === 0) {
            push({ type: "text", value });
            continue;
          }
        }
        if (state.brackets > 0 && (value !== "]" || prev.value === "[" || prev.value === "[^")) {
          if (opts.posix !== false && value === ":") {
            const inner = prev.value.slice(1);
            if (inner.includes("[")) {
              prev.posix = true;
              if (inner.includes(":")) {
                const idx = prev.value.lastIndexOf("[");
                const pre = prev.value.slice(0, idx);
                const rest2 = prev.value.slice(idx + 2);
                const posix = POSIX_REGEX_SOURCE[rest2];
                if (posix) {
                  prev.value = pre + posix;
                  state.backtrack = true;
                  advance();
                  if (!bos.output && tokens.indexOf(prev) === 1) {
                    bos.output = ONE_CHAR;
                  }
                  continue;
                }
              }
            }
          }
          if (value === "[" && peek() !== ":" || value === "-" && peek() === "]") {
            value = `\\${value}`;
          }
          if (value === "]" && (prev.value === "[" || prev.value === "[^")) {
            value = `\\${value}`;
          }
          if (opts.posix === true && value === "!" && prev.value === "[") {
            value = "^";
          }
          prev.value += value;
          append({ value });
          continue;
        }
        if (state.quotes === 1 && value !== '"') {
          value = utils.escapeRegex(value);
          prev.value += value;
          append({ value });
          continue;
        }
        if (value === '"') {
          state.quotes = state.quotes === 1 ? 0 : 1;
          if (opts.keepQuotes === true) {
            push({ type: "text", value });
          }
          continue;
        }
        if (value === "(") {
          increment("parens");
          push({ type: "paren", value });
          continue;
        }
        if (value === ")") {
          if (state.parens === 0 && opts.strictBrackets === true) {
            throw new SyntaxError(syntaxError("opening", "("));
          }
          const extglob = extglobs[extglobs.length - 1];
          if (extglob && state.parens === extglob.parens + 1) {
            extglobClose(extglobs.pop());
            continue;
          }
          push({ type: "paren", value, output: state.parens ? ")" : "\\)" });
          decrement("parens");
          continue;
        }
        if (value === "[") {
          if (opts.nobracket === true || !remaining().includes("]")) {
            if (opts.nobracket !== true && opts.strictBrackets === true) {
              throw new SyntaxError(syntaxError("closing", "]"));
            }
            value = `\\${value}`;
          } else {
            increment("brackets");
          }
          push({ type: "bracket", value });
          continue;
        }
        if (value === "]") {
          if (opts.nobracket === true || prev && prev.type === "bracket" && prev.value.length === 1) {
            push({ type: "text", value, output: `\\${value}` });
            continue;
          }
          if (state.brackets === 0) {
            if (opts.strictBrackets === true) {
              throw new SyntaxError(syntaxError("opening", "["));
            }
            push({ type: "text", value, output: `\\${value}` });
            continue;
          }
          decrement("brackets");
          const prevValue = prev.value.slice(1);
          if (prev.posix !== true && prevValue[0] === "^" && !prevValue.includes("/")) {
            value = `/${value}`;
          }
          prev.value += value;
          append({ value });
          if (opts.literalBrackets === false || utils.hasRegexChars(prevValue)) {
            continue;
          }
          const escaped = utils.escapeRegex(prev.value);
          state.output = state.output.slice(0, -prev.value.length);
          if (opts.literalBrackets === true) {
            state.output += escaped;
            prev.value = escaped;
            continue;
          }
          prev.value = `(${capture}${escaped}|${prev.value})`;
          state.output += prev.value;
          continue;
        }
        if (value === "{" && opts.nobrace !== true) {
          increment("braces");
          const open = {
            type: "brace",
            value,
            output: "(",
            outputIndex: state.output.length,
            tokensIndex: state.tokens.length
          };
          braces.push(open);
          push(open);
          continue;
        }
        if (value === "}") {
          const brace = braces[braces.length - 1];
          if (opts.nobrace === true || !brace) {
            push({ type: "text", value, output: value });
            continue;
          }
          let output = ")";
          if (brace.dots === true) {
            const arr = tokens.slice();
            const range = [];
            for (let i = arr.length - 1; i >= 0; i--) {
              tokens.pop();
              if (arr[i].type === "brace") {
                break;
              }
              if (arr[i].type !== "dots") {
                range.unshift(arr[i].value);
              }
            }
            output = expandRange(range, opts);
            state.backtrack = true;
          }
          if (brace.comma !== true && brace.dots !== true) {
            const out = state.output.slice(0, brace.outputIndex);
            const toks = state.tokens.slice(brace.tokensIndex);
            brace.value = brace.output = "\\{";
            value = output = "\\}";
            state.output = out;
            for (const t of toks) {
              state.output += t.output || t.value;
            }
          }
          push({ type: "brace", value, output });
          decrement("braces");
          braces.pop();
          continue;
        }
        if (value === "|") {
          if (extglobs.length > 0) {
            extglobs[extglobs.length - 1].conditions++;
          }
          push({ type: "text", value });
          continue;
        }
        if (value === ",") {
          let output = value;
          const brace = braces[braces.length - 1];
          if (brace && stack[stack.length - 1] === "braces") {
            brace.comma = true;
            output = "|";
          }
          push({ type: "comma", value, output });
          continue;
        }
        if (value === "/") {
          if (prev.type === "dot" && state.index === state.start + 1) {
            state.start = state.index + 1;
            state.consumed = "";
            state.output = "";
            tokens.pop();
            prev = bos;
            continue;
          }
          push({ type: "slash", value, output: SLASH_LITERAL });
          continue;
        }
        if (value === ".") {
          if (state.braces > 0 && prev.type === "dot") {
            if (prev.value === ".") prev.output = DOT_LITERAL;
            const brace = braces[braces.length - 1];
            prev.type = "dots";
            prev.output += value;
            prev.value += value;
            brace.dots = true;
            continue;
          }
          if (state.braces + state.parens === 0 && prev.type !== "bos" && prev.type !== "slash") {
            push({ type: "text", value, output: DOT_LITERAL });
            continue;
          }
          push({ type: "dot", value, output: DOT_LITERAL });
          continue;
        }
        if (value === "?") {
          const isGroup = prev && prev.value === "(";
          if (!isGroup && opts.noextglob !== true && peek() === "(" && peek(2) !== "?") {
            extglobOpen("qmark", value);
            continue;
          }
          if (prev && prev.type === "paren") {
            const next = peek();
            let output = value;
            if (next === "<" && !utils.supportsLookbehinds()) {
              throw new Error("Node.js v10 or higher is required for regex lookbehinds");
            }
            if (prev.value === "(" && !/[!=<:]/.test(next) || next === "<" && !/<([!=]|\w+>)/.test(remaining())) {
              output = `\\${value}`;
            }
            push({ type: "text", value, output });
            continue;
          }
          if (opts.dot !== true && (prev.type === "slash" || prev.type === "bos")) {
            push({ type: "qmark", value, output: QMARK_NO_DOT });
            continue;
          }
          push({ type: "qmark", value, output: QMARK });
          continue;
        }
        if (value === "!") {
          if (opts.noextglob !== true && peek() === "(") {
            if (peek(2) !== "?" || !/[!=<:]/.test(peek(3))) {
              extglobOpen("negate", value);
              continue;
            }
          }
          if (opts.nonegate !== true && state.index === 0) {
            negate();
            continue;
          }
        }
        if (value === "+") {
          if (opts.noextglob !== true && peek() === "(" && peek(2) !== "?") {
            extglobOpen("plus", value);
            continue;
          }
          if (prev && prev.value === "(" || opts.regex === false) {
            push({ type: "plus", value, output: PLUS_LITERAL });
            continue;
          }
          if (prev && (prev.type === "bracket" || prev.type === "paren" || prev.type === "brace") || state.parens > 0) {
            push({ type: "plus", value });
            continue;
          }
          push({ type: "plus", value: PLUS_LITERAL });
          continue;
        }
        if (value === "@") {
          if (opts.noextglob !== true && peek() === "(" && peek(2) !== "?") {
            push({ type: "at", extglob: true, value, output: "" });
            continue;
          }
          push({ type: "text", value });
          continue;
        }
        if (value !== "*") {
          if (value === "$" || value === "^") {
            value = `\\${value}`;
          }
          const match = REGEX_NON_SPECIAL_CHARS.exec(remaining());
          if (match) {
            value += match[0];
            state.index += match[0].length;
          }
          push({ type: "text", value });
          continue;
        }
        if (prev && (prev.type === "globstar" || prev.star === true)) {
          prev.type = "star";
          prev.star = true;
          prev.value += value;
          prev.output = star;
          state.backtrack = true;
          state.globstar = true;
          consume(value);
          continue;
        }
        let rest = remaining();
        if (opts.noextglob !== true && /^\([^?]/.test(rest)) {
          extglobOpen("star", value);
          continue;
        }
        if (prev.type === "star") {
          if (opts.noglobstar === true) {
            consume(value);
            continue;
          }
          const prior = prev.prev;
          const before = prior.prev;
          const isStart = prior.type === "slash" || prior.type === "bos";
          const afterStar = before && (before.type === "star" || before.type === "globstar");
          if (opts.bash === true && (!isStart || rest[0] && rest[0] !== "/")) {
            push({ type: "star", value, output: "" });
            continue;
          }
          const isBrace = state.braces > 0 && (prior.type === "comma" || prior.type === "brace");
          const isExtglob = extglobs.length && (prior.type === "pipe" || prior.type === "paren");
          if (!isStart && prior.type !== "paren" && !isBrace && !isExtglob) {
            push({ type: "star", value, output: "" });
            continue;
          }
          while (rest.slice(0, 3) === "/**") {
            const after = input[state.index + 4];
            if (after && after !== "/") {
              break;
            }
            rest = rest.slice(3);
            consume("/**", 3);
          }
          if (prior.type === "bos" && eos()) {
            prev.type = "globstar";
            prev.value += value;
            prev.output = globstar(opts);
            state.output = prev.output;
            state.globstar = true;
            consume(value);
            continue;
          }
          if (prior.type === "slash" && prior.prev.type !== "bos" && !afterStar && eos()) {
            state.output = state.output.slice(0, -(prior.output + prev.output).length);
            prior.output = `(?:${prior.output}`;
            prev.type = "globstar";
            prev.output = globstar(opts) + (opts.strictSlashes ? ")" : "|$)");
            prev.value += value;
            state.globstar = true;
            state.output += prior.output + prev.output;
            consume(value);
            continue;
          }
          if (prior.type === "slash" && prior.prev.type !== "bos" && rest[0] === "/") {
            const end = rest[1] !== void 0 ? "|$" : "";
            state.output = state.output.slice(0, -(prior.output + prev.output).length);
            prior.output = `(?:${prior.output}`;
            prev.type = "globstar";
            prev.output = `${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`;
            prev.value += value;
            state.output += prior.output + prev.output;
            state.globstar = true;
            consume(value + advance());
            push({ type: "slash", value: "/", output: "" });
            continue;
          }
          if (prior.type === "bos" && rest[0] === "/") {
            prev.type = "globstar";
            prev.value += value;
            prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`;
            state.output = prev.output;
            state.globstar = true;
            consume(value + advance());
            push({ type: "slash", value: "/", output: "" });
            continue;
          }
          state.output = state.output.slice(0, -prev.output.length);
          prev.type = "globstar";
          prev.output = globstar(opts);
          prev.value += value;
          state.output += prev.output;
          state.globstar = true;
          consume(value);
          continue;
        }
        const token = { type: "star", value, output: star };
        if (opts.bash === true) {
          token.output = ".*?";
          if (prev.type === "bos" || prev.type === "slash") {
            token.output = nodot + token.output;
          }
          push(token);
          continue;
        }
        if (prev && (prev.type === "bracket" || prev.type === "paren") && opts.regex === true) {
          token.output = value;
          push(token);
          continue;
        }
        if (state.index === state.start || prev.type === "slash" || prev.type === "dot") {
          if (prev.type === "dot") {
            state.output += NO_DOT_SLASH;
            prev.output += NO_DOT_SLASH;
          } else if (opts.dot === true) {
            state.output += NO_DOTS_SLASH;
            prev.output += NO_DOTS_SLASH;
          } else {
            state.output += nodot;
            prev.output += nodot;
          }
          if (peek() !== "*") {
            state.output += ONE_CHAR;
            prev.output += ONE_CHAR;
          }
        }
        push(token);
      }
      while (state.brackets > 0) {
        if (opts.strictBrackets === true) throw new SyntaxError(syntaxError("closing", "]"));
        state.output = utils.escapeLast(state.output, "[");
        decrement("brackets");
      }
      while (state.parens > 0) {
        if (opts.strictBrackets === true) throw new SyntaxError(syntaxError("closing", ")"));
        state.output = utils.escapeLast(state.output, "(");
        decrement("parens");
      }
      while (state.braces > 0) {
        if (opts.strictBrackets === true) throw new SyntaxError(syntaxError("closing", "}"));
        state.output = utils.escapeLast(state.output, "{");
        decrement("braces");
      }
      if (opts.strictSlashes !== true && (prev.type === "star" || prev.type === "bracket")) {
        push({ type: "maybe_slash", value: "", output: `${SLASH_LITERAL}?` });
      }
      if (state.backtrack === true) {
        state.output = "";
        for (const token of state.tokens) {
          state.output += token.output != null ? token.output : token.value;
          if (token.suffix) {
            state.output += token.suffix;
          }
        }
      }
      return state;
    };
    parse.fastpaths = (input, options) => {
      const opts = { ...options };
      const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
      const len = input.length;
      if (len > max) {
        throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
      }
      input = REPLACEMENTS[input] || input;
      const win32 = utils.isWindows(options);
      const {
        DOT_LITERAL,
        SLASH_LITERAL,
        ONE_CHAR,
        DOTS_SLASH,
        NO_DOT,
        NO_DOTS,
        NO_DOTS_SLASH,
        STAR,
        START_ANCHOR
      } = constants.globChars(win32);
      const nodot = opts.dot ? NO_DOTS : NO_DOT;
      const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT;
      const capture = opts.capture ? "" : "?:";
      const state = { negated: false, prefix: "" };
      let star = opts.bash === true ? ".*?" : STAR;
      if (opts.capture) {
        star = `(${star})`;
      }
      const globstar = (opts2) => {
        if (opts2.noglobstar === true) return star;
        return `(${capture}(?:(?!${START_ANCHOR}${opts2.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
      };
      const create = (str) => {
        switch (str) {
          case "*":
            return `${nodot}${ONE_CHAR}${star}`;
          case ".*":
            return `${DOT_LITERAL}${ONE_CHAR}${star}`;
          case "*.*":
            return `${nodot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
          case "*/*":
            return `${nodot}${star}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star}`;
          case "**":
            return nodot + globstar(opts);
          case "**/*":
            return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star}`;
          case "**/*.*":
            return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
          case "**/.*":
            return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`;
          default: {
            const match = /^(.*?)\.(\w+)$/.exec(str);
            if (!match) return;
            const source2 = create(match[1]);
            if (!source2) return;
            return source2 + DOT_LITERAL + match[2];
          }
        }
      };
      const output = utils.removePrefix(input, state);
      let source = create(output);
      if (source && opts.strictSlashes !== true) {
        source += `${SLASH_LITERAL}?`;
      }
      return source;
    };
    module2.exports = parse;
  }
});

// node_modules/anymatch/node_modules/picomatch/lib/picomatch.js
var require_picomatch3 = __commonJS({
  "node_modules/anymatch/node_modules/picomatch/lib/picomatch.js"(exports2, module2) {
    "use strict";
    var path3 = require("path");
    var scan = require_scan2();
    var parse = require_parse2();
    var utils = require_utils2();
    var constants = require_constants2();
    var isObject = (val) => val && typeof val === "object" && !Array.isArray(val);
    var picomatch = (glob, options, returnState = false) => {
      if (Array.isArray(glob)) {
        const fns = glob.map((input) => picomatch(input, options, returnState));
        const arrayMatcher = (str) => {
          for (const isMatch of fns) {
            const state2 = isMatch(str);
            if (state2) return state2;
          }
          return false;
        };
        return arrayMatcher;
      }
      const isState = isObject(glob) && glob.tokens && glob.input;
      if (glob === "" || typeof glob !== "string" && !isState) {
        throw new TypeError("Expected pattern to be a non-empty string");
      }
      const opts = options || {};
      const posix = utils.isWindows(options);
      const regex = isState ? picomatch.compileRe(glob, options) : picomatch.makeRe(glob, options, false, true);
      const state = regex.state;
      delete regex.state;
      let isIgnored = () => false;
      if (opts.ignore) {
        const ignoreOpts = { ...options, ignore: null, onMatch: null, onResult: null };
        isIgnored = picomatch(opts.ignore, ignoreOpts, returnState);
      }
      const matcher = (input, returnObject = false) => {
        const { isMatch, match, output } = picomatch.test(input, regex, options, { glob, posix });
        const result = { glob, state, regex, posix, input, output, match, isMatch };
        if (typeof opts.onResult === "function") {
          opts.onResult(result);
        }
        if (isMatch === false) {
          result.isMatch = false;
          return returnObject ? result : false;
        }
        if (isIgnored(input)) {
          if (typeof opts.onIgnore === "function") {
            opts.onIgnore(result);
          }
          result.isMatch = false;
          return returnObject ? result : false;
        }
        if (typeof opts.onMatch === "function") {
          opts.onMatch(result);
        }
        return returnObject ? result : true;
      };
      if (returnState) {
        matcher.state = state;
      }
      return matcher;
    };
    picomatch.test = (input, regex, options, { glob, posix } = {}) => {
      if (typeof input !== "string") {
        throw new TypeError("Expected input to be a string");
      }
      if (input === "") {
        return { isMatch: false, output: "" };
      }
      const opts = options || {};
      const format = opts.format || (posix ? utils.toPosixSlashes : null);
      let match = input === glob;
      let output = match && format ? format(input) : input;
      if (match === false) {
        output = format ? format(input) : input;
        match = output === glob;
      }
      if (match === false || opts.capture === true) {
        if (opts.matchBase === true || opts.basename === true) {
          match = picomatch.matchBase(input, regex, options, posix);
        } else {
          match = regex.exec(output);
        }
      }
      return { isMatch: Boolean(match), match, output };
    };
    picomatch.matchBase = (input, glob, options, posix = utils.isWindows(options)) => {
      const regex = glob instanceof RegExp ? glob : picomatch.makeRe(glob, options);
      return regex.test(path3.basename(input));
    };
    picomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str);
    picomatch.parse = (pattern, options) => {
      if (Array.isArray(pattern)) return pattern.map((p) => picomatch.parse(p, options));
      return parse(pattern, { ...options, fastpaths: false });
    };
    picomatch.scan = (input, options) => scan(input, options);
    picomatch.compileRe = (state, options, returnOutput = false, returnState = false) => {
      if (returnOutput === true) {
        return state.output;
      }
      const opts = options || {};
      const prepend = opts.contains ? "" : "^";
      const append = opts.contains ? "" : "$";
      let source = `${prepend}(?:${state.output})${append}`;
      if (state && state.negated === true) {
        source = `^(?!${source}).*$`;
      }
      const regex = picomatch.toRegex(source, options);
      if (returnState === true) {
        regex.state = state;
      }
      return regex;
    };
    picomatch.makeRe = (input, options = {}, returnOutput = false, returnState = false) => {
      if (!input || typeof input !== "string") {
        throw new TypeError("Expected a non-empty string");
      }
      let parsed = { negated: false, fastpaths: true };
      if (options.fastpaths !== false && (input[0] === "." || input[0] === "*")) {
        parsed.output = parse.fastpaths(input, options);
      }
      if (!parsed.output) {
        parsed = parse(input, options);
      }
      return picomatch.compileRe(parsed, options, returnOutput, returnState);
    };
    picomatch.toRegex = (source, options) => {
      try {
        const opts = options || {};
        return new RegExp(source, opts.flags || (opts.nocase ? "i" : ""));
      } catch (err) {
        if (options && options.debug === true) throw err;
        return /$^/;
      }
    };
    picomatch.constants = constants;
    module2.exports = picomatch;
  }
});

// node_modules/anymatch/node_modules/picomatch/index.js
var require_picomatch4 = __commonJS({
  "node_modules/anymatch/node_modules/picomatch/index.js"(exports2, module2) {
    "use strict";
    module2.exports = require_picomatch3();
  }
});

// node_modules/normalize-path/index.js
var require_normalize_path = __commonJS({
  "node_modules/normalize-path/index.js"(exports2, module2) {
    module2.exports = function(path3, stripTrailing) {
      if (typeof path3 !== "string") {
        throw new TypeError("expected path to be a string");
      }
      if (path3 === "\\" || path3 === "/") return "/";
      var len = path3.length;
      if (len <= 1) return path3;
      var prefix = "";
      if (len > 4 && path3[3] === "\\") {
        var ch = path3[2];
        if ((ch === "?" || ch === ".") && path3.slice(0, 2) === "\\\\") {
          path3 = path3.slice(2);
          prefix = "//";
        }
      }
      var segs = path3.split(/[/\\]+/);
      if (stripTrailing !== false && segs[segs.length - 1] === "") {
        segs.pop();
      }
      return prefix + segs.join("/");
    };
  }
});

// node_modules/anymatch/index.js
var require_anymatch = __commonJS({
  "node_modules/anymatch/index.js"(exports2, module2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    var picomatch = require_picomatch4();
    var normalizePath = require_normalize_path();
    var BANG = "!";
    var DEFAULT_OPTIONS = { returnIndex: false };
    var arrify = (item) => Array.isArray(item) ? item : [item];
    var createPattern = (matcher, options) => {
      if (typeof matcher === "function") {
        return matcher;
      }
      if (typeof matcher === "string") {
        const glob = picomatch(matcher, options);
        return (string) => matcher === string || glob(string);
      }
      if (matcher instanceof RegExp) {
        return (string) => matcher.test(string);
      }
      return (string) => false;
    };
    var matchPatterns = (patterns, negPatterns, args, returnIndex) => {
      const isList = Array.isArray(args);
      const _path = isList ? args[0] : args;
      if (!isList && typeof _path !== "string") {
        throw new TypeError("anymatch: second argument must be a string: got " + Object.prototype.toString.call(_path));
      }
      const path3 = normalizePath(_path, false);
      for (let index = 0; index < negPatterns.length; index++) {
        const nglob = negPatterns[index];
        if (nglob(path3)) {
          return returnIndex ? -1 : false;
        }
      }
      const applied = isList && [path3].concat(args.slice(1));
      for (let index = 0; index < patterns.length; index++) {
        const pattern = patterns[index];
        if (isList ? pattern(...applied) : pattern(path3)) {
          return returnIndex ? index : true;
        }
      }
      return returnIndex ? -1 : false;
    };
    var anymatch = (matchers, testString, options = DEFAULT_OPTIONS) => {
      if (matchers == null) {
        throw new TypeError("anymatch: specify first argument");
      }
      const opts = typeof options === "boolean" ? { returnIndex: options } : options;
      const returnIndex = opts.returnIndex || false;
      const mtchers = arrify(matchers);
      const negatedGlobs = mtchers.filter((item) => typeof item === "string" && item.charAt(0) === BANG).map((item) => item.slice(1)).map((item) => picomatch(item, opts));
      const patterns = mtchers.filter((item) => typeof item !== "string" || typeof item === "string" && item.charAt(0) !== BANG).map((matcher) => createPattern(matcher, opts));
      if (testString == null) {
        return (testString2, ri = false) => {
          const returnIndex2 = typeof ri === "boolean" ? ri : false;
          return matchPatterns(patterns, negatedGlobs, testString2, returnIndex2);
        };
      }
      return matchPatterns(patterns, negatedGlobs, testString, returnIndex);
    };
    anymatch.default = anymatch;
    module2.exports = anymatch;
  }
});

// node_modules/is-extglob/index.js
var require_is_extglob = __commonJS({
  "node_modules/is-extglob/index.js"(exports2, module2) {
    module2.exports = function isExtglob(str) {
      if (typeof str !== "string" || str === "") {
        return false;
      }
      var match;
      while (match = /(\\).|([@?!+*]\(.*\))/g.exec(str)) {
        if (match[2]) return true;
        str = str.slice(match.index + match[0].length);
      }
      return false;
    };
  }
});

// node_modules/is-glob/index.js
var require_is_glob = __commonJS({
  "node_modules/is-glob/index.js"(exports2, module2) {
    var isExtglob = require_is_extglob();
    var chars = { "{": "}", "(": ")", "[": "]" };
    var strictCheck = function(str) {
      if (str[0] === "!") {
        return true;
      }
      var index = 0;
      var pipeIndex = -2;
      var closeSquareIndex = -2;
      var closeCurlyIndex = -2;
      var closeParenIndex = -2;
      var backSlashIndex = -2;
      while (index < str.length) {
        if (str[index] === "*") {
          return true;
        }
        if (str[index + 1] === "?" && /[\].+)]/.test(str[index])) {
          return true;
        }
        if (closeSquareIndex !== -1 && str[index] === "[" && str[index + 1] !== "]") {
          if (closeSquareIndex < index) {
            closeSquareIndex = str.indexOf("]", index);
          }
          if (closeSquareIndex > index) {
            if (backSlashIndex === -1 || backSlashIndex > closeSquareIndex) {
              return true;
            }
            backSlashIndex = str.indexOf("\\", index);
            if (backSlashIndex === -1 || backSlashIndex > closeSquareIndex) {
              return true;
            }
          }
        }
        if (closeCurlyIndex !== -1 && str[index] === "{" && str[index + 1] !== "}") {
          closeCurlyIndex = str.indexOf("}", index);
          if (closeCurlyIndex > index) {
            backSlashIndex = str.indexOf("\\", index);
            if (backSlashIndex === -1 || backSlashIndex > closeCurlyIndex) {
              return true;
            }
          }
        }
        if (closeParenIndex !== -1 && str[index] === "(" && str[index + 1] === "?" && /[:!=]/.test(str[index + 2]) && str[index + 3] !== ")") {
          closeParenIndex = str.indexOf(")", index);
          if (closeParenIndex > index) {
            backSlashIndex = str.indexOf("\\", index);
            if (backSlashIndex === -1 || backSlashIndex > closeParenIndex) {
              return true;
            }
          }
        }
        if (pipeIndex !== -1 && str[index] === "(" && str[index + 1] !== "|") {
          if (pipeIndex < index) {
            pipeIndex = str.indexOf("|", index);
          }
          if (pipeIndex !== -1 && str[pipeIndex + 1] !== ")") {
            closeParenIndex = str.indexOf(")", pipeIndex);
            if (closeParenIndex > pipeIndex) {
              backSlashIndex = str.indexOf("\\", pipeIndex);
              if (backSlashIndex === -1 || backSlashIndex > closeParenIndex) {
                return true;
              }
            }
          }
        }
        if (str[index] === "\\") {
          var open = str[index + 1];
          index += 2;
          var close = chars[open];
          if (close) {
            var n = str.indexOf(close, index);
            if (n !== -1) {
              index = n + 1;
            }
          }
          if (str[index] === "!") {
            return true;
          }
        } else {
          index++;
        }
      }
      return false;
    };
    var relaxedCheck = function(str) {
      if (str[0] === "!") {
        return true;
      }
      var index = 0;
      while (index < str.length) {
        if (/[*?{}()[\]]/.test(str[index])) {
          return true;
        }
        if (str[index] === "\\") {
          var open = str[index + 1];
          index += 2;
          var close = chars[open];
          if (close) {
            var n = str.indexOf(close, index);
            if (n !== -1) {
              index = n + 1;
            }
          }
          if (str[index] === "!") {
            return true;
          }
        } else {
          index++;
        }
      }
      return false;
    };
    module2.exports = function isGlob(str, options) {
      if (typeof str !== "string" || str === "") {
        return false;
      }
      if (isExtglob(str)) {
        return true;
      }
      var check = strictCheck;
      if (options && options.strict === false) {
        check = relaxedCheck;
      }
      return check(str);
    };
  }
});

// node_modules/glob-parent/index.js
var require_glob_parent = __commonJS({
  "node_modules/glob-parent/index.js"(exports2, module2) {
    "use strict";
    var isGlob = require_is_glob();
    var pathPosixDirname = require("path").posix.dirname;
    var isWin32 = require("os").platform() === "win32";
    var slash = "/";
    var backslash = /\\/g;
    var enclosure = /[\{\[].*[\}\]]$/;
    var globby = /(^|[^\\])([\{\[]|\([^\)]+$)/;
    var escaped = /\\([\!\*\?\|\[\]\(\)\{\}])/g;
    module2.exports = function globParent(str, opts) {
      var options = Object.assign({ flipBackslashes: true }, opts);
      if (options.flipBackslashes && isWin32 && str.indexOf(slash) < 0) {
        str = str.replace(backslash, slash);
      }
      if (enclosure.test(str)) {
        str += slash;
      }
      str += "a";
      do {
        str = pathPosixDirname(str);
      } while (isGlob(str) || globby.test(str));
      return str.replace(escaped, "$1");
    };
  }
});

// node_modules/braces/lib/utils.js
var require_utils3 = __commonJS({
  "node_modules/braces/lib/utils.js"(exports2) {
    "use strict";
    exports2.isInteger = (num) => {
      if (typeof num === "number") {
        return Number.isInteger(num);
      }
      if (typeof num === "string" && num.trim() !== "") {
        return Number.isInteger(Number(num));
      }
      return false;
    };
    exports2.find = (node, type) => node.nodes.find((node2) => node2.type === type);
    exports2.exceedsLimit = (min, max, step = 1, limit) => {
      if (limit === false) return false;
      if (!exports2.isInteger(min) || !exports2.isInteger(max)) return false;
      return (Number(max) - Number(min)) / Number(step) >= limit;
    };
    exports2.escapeNode = (block, n = 0, type) => {
      const node = block.nodes[n];
      if (!node) return;
      if (type && node.type === type || node.type === "open" || node.type === "close") {
        if (node.escaped !== true) {
          node.value = "\\" + node.value;
          node.escaped = true;
        }
      }
    };
    exports2.encloseBrace = (node) => {
      if (node.type !== "brace") return false;
      if (node.commas >> 0 + node.ranges >> 0 === 0) {
        node.invalid = true;
        return true;
      }
      return false;
    };
    exports2.isInvalidBrace = (block) => {
      if (block.type !== "brace") return false;
      if (block.invalid === true || block.dollar) return true;
      if (block.commas >> 0 + block.ranges >> 0 === 0) {
        block.invalid = true;
        return true;
      }
      if (block.open !== true || block.close !== true) {
        block.invalid = true;
        return true;
      }
      return false;
    };
    exports2.isOpenOrClose = (node) => {
      if (node.type === "open" || node.type === "close") {
        return true;
      }
      return node.open === true || node.close === true;
    };
    exports2.reduce = (nodes) => nodes.reduce((acc, node) => {
      if (node.type === "text") acc.push(node.value);
      if (node.type === "range") node.type = "text";
      return acc;
    }, []);
    exports2.flatten = (...args) => {
      const result = [];
      const flat = (arr) => {
        for (let i = 0; i < arr.length; i++) {
          const ele = arr[i];
          if (Array.isArray(ele)) {
            flat(ele);
            continue;
          }
          if (ele !== void 0) {
            result.push(ele);
          }
        }
        return result;
      };
      flat(args);
      return result;
    };
  }
});

// node_modules/braces/lib/stringify.js
var require_stringify = __commonJS({
  "node_modules/braces/lib/stringify.js"(exports2, module2) {
    "use strict";
    var utils = require_utils3();
    module2.exports = (ast, options = {}) => {
      const stringify = (node, parent = {}) => {
        const invalidBlock = options.escapeInvalid && utils.isInvalidBrace(parent);
        const invalidNode = node.invalid === true && options.escapeInvalid === true;
        let output = "";
        if (node.value) {
          if ((invalidBlock || invalidNode) && utils.isOpenOrClose(node)) {
            return "\\" + node.value;
          }
          return node.value;
        }
        if (node.value) {
          return node.value;
        }
        if (node.nodes) {
          for (const child of node.nodes) {
            output += stringify(child);
          }
        }
        return output;
      };
      return stringify(ast);
    };
  }
});

// node_modules/is-number/index.js
var require_is_number = __commonJS({
  "node_modules/is-number/index.js"(exports2, module2) {
    "use strict";
    module2.exports = function(num) {
      if (typeof num === "number") {
        return num - num === 0;
      }
      if (typeof num === "string" && num.trim() !== "") {
        return Number.isFinite ? Number.isFinite(+num) : isFinite(+num);
      }
      return false;
    };
  }
});

// node_modules/to-regex-range/index.js
var require_to_regex_range = __commonJS({
  "node_modules/to-regex-range/index.js"(exports2, module2) {
    "use strict";
    var isNumber = require_is_number();
    var toRegexRange = (min, max, options) => {
      if (isNumber(min) === false) {
        throw new TypeError("toRegexRange: expected the first argument to be a number");
      }
      if (max === void 0 || min === max) {
        return String(min);
      }
      if (isNumber(max) === false) {
        throw new TypeError("toRegexRange: expected the second argument to be a number.");
      }
      let opts = { relaxZeros: true, ...options };
      if (typeof opts.strictZeros === "boolean") {
        opts.relaxZeros = opts.strictZeros === false;
      }
      let relax = String(opts.relaxZeros);
      let shorthand = String(opts.shorthand);
      let capture = String(opts.capture);
      let wrap = String(opts.wrap);
      let cacheKey = min + ":" + max + "=" + relax + shorthand + capture + wrap;
      if (toRegexRange.cache.hasOwnProperty(cacheKey)) {
        return toRegexRange.cache[cacheKey].result;
      }
      let a = Math.min(min, max);
      let b = Math.max(min, max);
      if (Math.abs(a - b) === 1) {
        let result = min + "|" + max;
        if (opts.capture) {
          return `(${result})`;
        }
        if (opts.wrap === false) {
          return result;
        }
        return `(?:${result})`;
      }
      let isPadded = hasPadding(min) || hasPadding(max);
      let state = { min, max, a, b };
      let positives = [];
      let negatives = [];
      if (isPadded) {
        state.isPadded = isPadded;
        state.maxLen = String(state.max).length;
      }
      if (a < 0) {
        let newMin = b < 0 ? Math.abs(b) : 1;
        negatives = splitToPatterns(newMin, Math.abs(a), state, opts);
        a = state.a = 0;
      }
      if (b >= 0) {
        positives = splitToPatterns(a, b, state, opts);
      }
      state.negatives = negatives;
      state.positives = positives;
      state.result = collatePatterns(negatives, positives, opts);
      if (opts.capture === true) {
        state.result = `(${state.result})`;
      } else if (opts.wrap !== false && positives.length + negatives.length > 1) {
        state.result = `(?:${state.result})`;
      }
      toRegexRange.cache[cacheKey] = state;
      return state.result;
    };
    function collatePatterns(neg, pos, options) {
      let onlyNegative = filterPatterns(neg, pos, "-", false, options) || [];
      let onlyPositive = filterPatterns(pos, neg, "", false, options) || [];
      let intersected = filterPatterns(neg, pos, "-?", true, options) || [];
      let subpatterns = onlyNegative.concat(intersected).concat(onlyPositive);
      return subpatterns.join("|");
    }
    function splitToRanges(min, max) {
      let nines = 1;
      let zeros = 1;
      let stop = countNines(min, nines);
      let stops = /* @__PURE__ */ new Set([max]);
      while (min <= stop && stop <= max) {
        stops.add(stop);
        nines += 1;
        stop = countNines(min, nines);
      }
      stop = countZeros(max + 1, zeros) - 1;
      while (min < stop && stop <= max) {
        stops.add(stop);
        zeros += 1;
        stop = countZeros(max + 1, zeros) - 1;
      }
      stops = [...stops];
      stops.sort(compare);
      return stops;
    }
    function rangeToPattern(start, stop, options) {
      if (start === stop) {
        return { pattern: start, count: [], digits: 0 };
      }
      let zipped = zip(start, stop);
      let digits = zipped.length;
      let pattern = "";
      let count = 0;
      for (let i = 0; i < digits; i++) {
        let [startDigit, stopDigit] = zipped[i];
        if (startDigit === stopDigit) {
          pattern += startDigit;
        } else if (startDigit !== "0" || stopDigit !== "9") {
          pattern += toCharacterClass(startDigit, stopDigit, options);
        } else {
          count++;
        }
      }
      if (count) {
        pattern += options.shorthand === true ? "\\d" : "[0-9]";
      }
      return { pattern, count: [count], digits };
    }
    function splitToPatterns(min, max, tok, options) {
      let ranges = splitToRanges(min, max);
      let tokens = [];
      let start = min;
      let prev;
      for (let i = 0; i < ranges.length; i++) {
        let max2 = ranges[i];
        let obj = rangeToPattern(String(start), String(max2), options);
        let zeros = "";
        if (!tok.isPadded && prev && prev.pattern === obj.pattern) {
          if (prev.count.length > 1) {
            prev.count.pop();
          }
          prev.count.push(obj.count[0]);
          prev.string = prev.pattern + toQuantifier(prev.count);
          start = max2 + 1;
          continue;
        }
        if (tok.isPadded) {
          zeros = padZeros(max2, tok, options);
        }
        obj.string = zeros + obj.pattern + toQuantifier(obj.count);
        tokens.push(obj);
        start = max2 + 1;
        prev = obj;
      }
      return tokens;
    }
    function filterPatterns(arr, comparison, prefix, intersection, options) {
      let result = [];
      for (let ele of arr) {
        let { string } = ele;
        if (!intersection && !contains(comparison, "string", string)) {
          result.push(prefix + string);
        }
        if (intersection && contains(comparison, "string", string)) {
          result.push(prefix + string);
        }
      }
      return result;
    }
    function zip(a, b) {
      let arr = [];
      for (let i = 0; i < a.length; i++) arr.push([a[i], b[i]]);
      return arr;
    }
    function compare(a, b) {
      return a > b ? 1 : b > a ? -1 : 0;
    }
    function contains(arr, key, val) {
      return arr.some((ele) => ele[key] === val);
    }
    function countNines(min, len) {
      return Number(String(min).slice(0, -len) + "9".repeat(len));
    }
    function countZeros(integer, zeros) {
      return integer - integer % Math.pow(10, zeros);
    }
    function toQuantifier(digits) {
      let [start = 0, stop = ""] = digits;
      if (stop || start > 1) {
        return `{${start + (stop ? "," + stop : "")}}`;
      }
      return "";
    }
    function toCharacterClass(a, b, options) {
      return `[${a}${b - a === 1 ? "" : "-"}${b}]`;
    }
    function hasPadding(str) {
      return /^-?(0+)\d/.test(str);
    }
    function padZeros(value, tok, options) {
      if (!tok.isPadded) {
        return value;
      }
      let diff = Math.abs(tok.maxLen - String(value).length);
      let relax = options.relaxZeros !== false;
      switch (diff) {
        case 0:
          return "";
        case 1:
          return relax ? "0?" : "0";
        case 2:
          return relax ? "0{0,2}" : "00";
        default: {
          return relax ? `0{0,${diff}}` : `0{${diff}}`;
        }
      }
    }
    toRegexRange.cache = {};
    toRegexRange.clearCache = () => toRegexRange.cache = {};
    module2.exports = toRegexRange;
  }
});

// node_modules/fill-range/index.js
var require_fill_range = __commonJS({
  "node_modules/fill-range/index.js"(exports2, module2) {
    "use strict";
    var util = require("util");
    var toRegexRange = require_to_regex_range();
    var isObject = (val) => val !== null && typeof val === "object" && !Array.isArray(val);
    var transform = (toNumber) => {
      return (value) => toNumber === true ? Number(value) : String(value);
    };
    var isValidValue = (value) => {
      return typeof value === "number" || typeof value === "string" && value !== "";
    };
    var isNumber = (num) => Number.isInteger(+num);
    var zeros = (input) => {
      let value = `${input}`;
      let index = -1;
      if (value[0] === "-") value = value.slice(1);
      if (value === "0") return false;
      while (value[++index] === "0") ;
      return index > 0;
    };
    var stringify = (start, end, options) => {
      if (typeof start === "string" || typeof end === "string") {
        return true;
      }
      return options.stringify === true;
    };
    var pad = (input, maxLength, toNumber) => {
      if (maxLength > 0) {
        let dash = input[0] === "-" ? "-" : "";
        if (dash) input = input.slice(1);
        input = dash + input.padStart(dash ? maxLength - 1 : maxLength, "0");
      }
      if (toNumber === false) {
        return String(input);
      }
      return input;
    };
    var toMaxLen = (input, maxLength) => {
      let negative = input[0] === "-" ? "-" : "";
      if (negative) {
        input = input.slice(1);
        maxLength--;
      }
      while (input.length < maxLength) input = "0" + input;
      return negative ? "-" + input : input;
    };
    var toSequence = (parts, options, maxLen) => {
      parts.negatives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
      parts.positives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
      let prefix = options.capture ? "" : "?:";
      let positives = "";
      let negatives = "";
      let result;
      if (parts.positives.length) {
        positives = parts.positives.map((v) => toMaxLen(String(v), maxLen)).join("|");
      }
      if (parts.negatives.length) {
        negatives = `-(${prefix}${parts.negatives.map((v) => toMaxLen(String(v), maxLen)).join("|")})`;
      }
      if (positives && negatives) {
        result = `${positives}|${negatives}`;
      } else {
        result = positives || negatives;
      }
      if (options.wrap) {
        return `(${prefix}${result})`;
      }
      return result;
    };
    var toRange = (a, b, isNumbers, options) => {
      if (isNumbers) {
        return toRegexRange(a, b, { wrap: false, ...options });
      }
      let start = String.fromCharCode(a);
      if (a === b) return start;
      let stop = String.fromCharCode(b);
      return `[${start}-${stop}]`;
    };
    var toRegex = (start, end, options) => {
      if (Array.isArray(start)) {
        let wrap = options.wrap === true;
        let prefix = options.capture ? "" : "?:";
        return wrap ? `(${prefix}${start.join("|")})` : start.join("|");
      }
      return toRegexRange(start, end, options);
    };
    var rangeError = (...args) => {
      return new RangeError("Invalid range arguments: " + util.inspect(...args));
    };
    var invalidRange = (start, end, options) => {
      if (options.strictRanges === true) throw rangeError([start, end]);
      return [];
    };
    var invalidStep = (step, options) => {
      if (options.strictRanges === true) {
        throw new TypeError(`Expected step "${step}" to be a number`);
      }
      return [];
    };
    var fillNumbers = (start, end, step = 1, options = {}) => {
      let a = Number(start);
      let b = Number(end);
      if (!Number.isInteger(a) || !Number.isInteger(b)) {
        if (options.strictRanges === true) throw rangeError([start, end]);
        return [];
      }
      if (a === 0) a = 0;
      if (b === 0) b = 0;
      let descending = a > b;
      let startString = String(start);
      let endString = String(end);
      let stepString = String(step);
      step = Math.max(Math.abs(step), 1);
      let padded = zeros(startString) || zeros(endString) || zeros(stepString);
      let maxLen = padded ? Math.max(startString.length, endString.length, stepString.length) : 0;
      let toNumber = padded === false && stringify(start, end, options) === false;
      let format = options.transform || transform(toNumber);
      if (options.toRegex && step === 1) {
        return toRange(toMaxLen(start, maxLen), toMaxLen(end, maxLen), true, options);
      }
      let parts = { negatives: [], positives: [] };
      let push = (num) => parts[num < 0 ? "negatives" : "positives"].push(Math.abs(num));
      let range = [];
      let index = 0;
      while (descending ? a >= b : a <= b) {
        if (options.toRegex === true && step > 1) {
          push(a);
        } else {
          range.push(pad(format(a, index), maxLen, toNumber));
        }
        a = descending ? a - step : a + step;
        index++;
      }
      if (options.toRegex === true) {
        return step > 1 ? toSequence(parts, options, maxLen) : toRegex(range, null, { wrap: false, ...options });
      }
      return range;
    };
    var fillLetters = (start, end, step = 1, options = {}) => {
      if (!isNumber(start) && start.length > 1 || !isNumber(end) && end.length > 1) {
        return invalidRange(start, end, options);
      }
      let format = options.transform || ((val) => String.fromCharCode(val));
      let a = `${start}`.charCodeAt(0);
      let b = `${end}`.charCodeAt(0);
      let descending = a > b;
      let min = Math.min(a, b);
      let max = Math.max(a, b);
      if (options.toRegex && step === 1) {
        return toRange(min, max, false, options);
      }
      let range = [];
      let index = 0;
      while (descending ? a >= b : a <= b) {
        range.push(format(a, index));
        a = descending ? a - step : a + step;
        index++;
      }
      if (options.toRegex === true) {
        return toRegex(range, null, { wrap: false, options });
      }
      return range;
    };
    var fill = (start, end, step, options = {}) => {
      if (end == null && isValidValue(start)) {
        return [start];
      }
      if (!isValidValue(start) || !isValidValue(end)) {
        return invalidRange(start, end, options);
      }
      if (typeof step === "function") {
        return fill(start, end, 1, { transform: step });
      }
      if (isObject(step)) {
        return fill(start, end, 0, step);
      }
      let opts = { ...options };
      if (opts.capture === true) opts.wrap = true;
      step = step || opts.step || 1;
      if (!isNumber(step)) {
        if (step != null && !isObject(step)) return invalidStep(step, opts);
        return fill(start, end, 1, step);
      }
      if (isNumber(start) && isNumber(end)) {
        return fillNumbers(start, end, step, opts);
      }
      return fillLetters(start, end, Math.max(Math.abs(step), 1), opts);
    };
    module2.exports = fill;
  }
});

// node_modules/braces/lib/compile.js
var require_compile = __commonJS({
  "node_modules/braces/lib/compile.js"(exports2, module2) {
    "use strict";
    var fill = require_fill_range();
    var utils = require_utils3();
    var compile = (ast, options = {}) => {
      const walk = (node, parent = {}) => {
        const invalidBlock = utils.isInvalidBrace(parent);
        const invalidNode = node.invalid === true && options.escapeInvalid === true;
        const invalid = invalidBlock === true || invalidNode === true;
        const prefix = options.escapeInvalid === true ? "\\" : "";
        let output = "";
        if (node.isOpen === true) {
          return prefix + node.value;
        }
        if (node.isClose === true) {
          console.log("node.isClose", prefix, node.value);
          return prefix + node.value;
        }
        if (node.type === "open") {
          return invalid ? prefix + node.value : "(";
        }
        if (node.type === "close") {
          return invalid ? prefix + node.value : ")";
        }
        if (node.type === "comma") {
          return node.prev.type === "comma" ? "" : invalid ? node.value : "|";
        }
        if (node.value) {
          return node.value;
        }
        if (node.nodes && node.ranges > 0) {
          const args = utils.reduce(node.nodes);
          const range = fill(...args, { ...options, wrap: false, toRegex: true, strictZeros: true });
          if (range.length !== 0) {
            return args.length > 1 && range.length > 1 ? `(${range})` : range;
          }
        }
        if (node.nodes) {
          for (const child of node.nodes) {
            output += walk(child, node);
          }
        }
        return output;
      };
      return walk(ast);
    };
    module2.exports = compile;
  }
});

// node_modules/braces/lib/expand.js
var require_expand = __commonJS({
  "node_modules/braces/lib/expand.js"(exports2, module2) {
    "use strict";
    var fill = require_fill_range();
    var stringify = require_stringify();
    var utils = require_utils3();
    var append = (queue = "", stash = "", enclose = false) => {
      const result = [];
      queue = [].concat(queue);
      stash = [].concat(stash);
      if (!stash.length) return queue;
      if (!queue.length) {
        return enclose ? utils.flatten(stash).map((ele) => `{${ele}}`) : stash;
      }
      for (const item of queue) {
        if (Array.isArray(item)) {
          for (const value of item) {
            result.push(append(value, stash, enclose));
          }
        } else {
          for (let ele of stash) {
            if (enclose === true && typeof ele === "string") ele = `{${ele}}`;
            result.push(Array.isArray(ele) ? append(item, ele, enclose) : item + ele);
          }
        }
      }
      return utils.flatten(result);
    };
    var expand = (ast, options = {}) => {
      const rangeLimit = options.rangeLimit === void 0 ? 1e3 : options.rangeLimit;
      const walk = (node, parent = {}) => {
        node.queue = [];
        let p = parent;
        let q = parent.queue;
        while (p.type !== "brace" && p.type !== "root" && p.parent) {
          p = p.parent;
          q = p.queue;
        }
        if (node.invalid || node.dollar) {
          q.push(append(q.pop(), stringify(node, options)));
          return;
        }
        if (node.type === "brace" && node.invalid !== true && node.nodes.length === 2) {
          q.push(append(q.pop(), ["{}"]));
          return;
        }
        if (node.nodes && node.ranges > 0) {
          const args = utils.reduce(node.nodes);
          if (utils.exceedsLimit(...args, options.step, rangeLimit)) {
            throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");
          }
          let range = fill(...args, options);
          if (range.length === 0) {
            range = stringify(node, options);
          }
          q.push(append(q.pop(), range));
          node.nodes = [];
          return;
        }
        const enclose = utils.encloseBrace(node);
        let queue = node.queue;
        let block = node;
        while (block.type !== "brace" && block.type !== "root" && block.parent) {
          block = block.parent;
          queue = block.queue;
        }
        for (let i = 0; i < node.nodes.length; i++) {
          const child = node.nodes[i];
          if (child.type === "comma" && node.type === "brace") {
            if (i === 1) queue.push("");
            queue.push("");
            continue;
          }
          if (child.type === "close") {
            q.push(append(q.pop(), queue, enclose));
            continue;
          }
          if (child.value && child.type !== "open") {
            queue.push(append(queue.pop(), child.value));
            continue;
          }
          if (child.nodes) {
            walk(child, node);
          }
        }
        return queue;
      };
      return utils.flatten(walk(ast));
    };
    module2.exports = expand;
  }
});

// node_modules/braces/lib/constants.js
var require_constants3 = __commonJS({
  "node_modules/braces/lib/constants.js"(exports2, module2) {
    "use strict";
    module2.exports = {
      MAX_LENGTH: 1e4,
      // Digits
      CHAR_0: "0",
      /* 0 */
      CHAR_9: "9",
      /* 9 */
      // Alphabet chars.
      CHAR_UPPERCASE_A: "A",
      /* A */
      CHAR_LOWERCASE_A: "a",
      /* a */
      CHAR_UPPERCASE_Z: "Z",
      /* Z */
      CHAR_LOWERCASE_Z: "z",
      /* z */
      CHAR_LEFT_PARENTHESES: "(",
      /* ( */
      CHAR_RIGHT_PARENTHESES: ")",
      /* ) */
      CHAR_ASTERISK: "*",
      /* * */
      // Non-alphabetic chars.
      CHAR_AMPERSAND: "&",
      /* & */
      CHAR_AT: "@",
      /* @ */
      CHAR_BACKSLASH: "\\",
      /* \ */
      CHAR_BACKTICK: "`",
      /* ` */
      CHAR_CARRIAGE_RETURN: "\r",
      /* \r */
      CHAR_CIRCUMFLEX_ACCENT: "^",
      /* ^ */
      CHAR_COLON: ":",
      /* : */
      CHAR_COMMA: ",",
      /* , */
      CHAR_DOLLAR: "$",
      /* . */
      CHAR_DOT: ".",
      /* . */
      CHAR_DOUBLE_QUOTE: '"',
      /* " */
      CHAR_EQUAL: "=",
      /* = */
      CHAR_EXCLAMATION_MARK: "!",
      /* ! */
      CHAR_FORM_FEED: "\f",
      /* \f */
      CHAR_FORWARD_SLASH: "/",
      /* / */
      CHAR_HASH: "#",
      /* # */
      CHAR_HYPHEN_MINUS: "-",
      /* - */
      CHAR_LEFT_ANGLE_BRACKET: "<",
      /* < */
      CHAR_LEFT_CURLY_BRACE: "{",
      /* { */
      CHAR_LEFT_SQUARE_BRACKET: "[",
      /* [ */
      CHAR_LINE_FEED: "\n",
      /* \n */
      CHAR_NO_BREAK_SPACE: "\xA0",
      /* \u00A0 */
      CHAR_PERCENT: "%",
      /* % */
      CHAR_PLUS: "+",
      /* + */
      CHAR_QUESTION_MARK: "?",
      /* ? */
      CHAR_RIGHT_ANGLE_BRACKET: ">",
      /* > */
      CHAR_RIGHT_CURLY_BRACE: "}",
      /* } */
      CHAR_RIGHT_SQUARE_BRACKET: "]",
      /* ] */
      CHAR_SEMICOLON: ";",
      /* ; */
      CHAR_SINGLE_QUOTE: "'",
      /* ' */
      CHAR_SPACE: " ",
      /*   */
      CHAR_TAB: "	",
      /* \t */
      CHAR_UNDERSCORE: "_",
      /* _ */
      CHAR_VERTICAL_LINE: "|",
      /* | */
      CHAR_ZERO_WIDTH_NOBREAK_SPACE: "\uFEFF"
      /* \uFEFF */
    };
  }
});

// node_modules/braces/lib/parse.js
var require_parse3 = __commonJS({
  "node_modules/braces/lib/parse.js"(exports2, module2) {
    "use strict";
    var stringify = require_stringify();
    var {
      MAX_LENGTH,
      CHAR_BACKSLASH,
      /* \ */
      CHAR_BACKTICK,
      /* ` */
      CHAR_COMMA,
      /* , */
      CHAR_DOT,
      /* . */
      CHAR_LEFT_PARENTHESES,
      /* ( */
      CHAR_RIGHT_PARENTHESES,
      /* ) */
      CHAR_LEFT_CURLY_BRACE,
      /* { */
      CHAR_RIGHT_CURLY_BRACE,
      /* } */
      CHAR_LEFT_SQUARE_BRACKET,
      /* [ */
      CHAR_RIGHT_SQUARE_BRACKET,
      /* ] */
      CHAR_DOUBLE_QUOTE,
      /* " */
      CHAR_SINGLE_QUOTE,
      /* ' */
      CHAR_NO_BREAK_SPACE,
      CHAR_ZERO_WIDTH_NOBREAK_SPACE
    } = require_constants3();
    var parse = (input, options = {}) => {
      if (typeof input !== "string") {
        throw new TypeError("Expected a string");
      }
      const opts = options || {};
      const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
      if (input.length > max) {
        throw new SyntaxError(`Input length (${input.length}), exceeds max characters (${max})`);
      }
      const ast = { type: "root", input, nodes: [] };
      const stack = [ast];
      let block = ast;
      let prev = ast;
      let brackets = 0;
      const length = input.length;
      let index = 0;
      let depth = 0;
      let value;
      const advance = () => input[index++];
      const push = (node) => {
        if (node.type === "text" && prev.type === "dot") {
          prev.type = "text";
        }
        if (prev && prev.type === "text" && node.type === "text") {
          prev.value += node.value;
          return;
        }
        block.nodes.push(node);
        node.parent = block;
        node.prev = prev;
        prev = node;
        return node;
      };
      push({ type: "bos" });
      while (index < length) {
        block = stack[stack.length - 1];
        value = advance();
        if (value === CHAR_ZERO_WIDTH_NOBREAK_SPACE || value === CHAR_NO_BREAK_SPACE) {
          continue;
        }
        if (value === CHAR_BACKSLASH) {
          push({ type: "text", value: (options.keepEscaping ? value : "") + advance() });
          continue;
        }
        if (value === CHAR_RIGHT_SQUARE_BRACKET) {
          push({ type: "text", value: "\\" + value });
          continue;
        }
        if (value === CHAR_LEFT_SQUARE_BRACKET) {
          brackets++;
          let next;
          while (index < length && (next = advance())) {
            value += next;
            if (next === CHAR_LEFT_SQUARE_BRACKET) {
              brackets++;
              continue;
            }
            if (next === CHAR_BACKSLASH) {
              value += advance();
              continue;
            }
            if (next === CHAR_RIGHT_SQUARE_BRACKET) {
              brackets--;
              if (brackets === 0) {
                break;
              }
            }
          }
          push({ type: "text", value });
          continue;
        }
        if (value === CHAR_LEFT_PARENTHESES) {
          block = push({ type: "paren", nodes: [] });
          stack.push(block);
          push({ type: "text", value });
          continue;
        }
        if (value === CHAR_RIGHT_PARENTHESES) {
          if (block.type !== "paren") {
            push({ type: "text", value });
            continue;
          }
          block = stack.pop();
          push({ type: "text", value });
          block = stack[stack.length - 1];
          continue;
        }
        if (value === CHAR_DOUBLE_QUOTE || value === CHAR_SINGLE_QUOTE || value === CHAR_BACKTICK) {
          const open = value;
          let next;
          if (options.keepQuotes !== true) {
            value = "";
          }
          while (index < length && (next = advance())) {
            if (next === CHAR_BACKSLASH) {
              value += next + advance();
              continue;
            }
            if (next === open) {
              if (options.keepQuotes === true) value += next;
              break;
            }
            value += next;
          }
          push({ type: "text", value });
          continue;
        }
        if (value === CHAR_LEFT_CURLY_BRACE) {
          depth++;
          const dollar = prev.value && prev.value.slice(-1) === "$" || block.dollar === true;
          const brace = {
            type: "brace",
            open: true,
            close: false,
            dollar,
            depth,
            commas: 0,
            ranges: 0,
            nodes: []
          };
          block = push(brace);
          stack.push(block);
          push({ type: "open", value });
          continue;
        }
        if (value === CHAR_RIGHT_CURLY_BRACE) {
          if (block.type !== "brace") {
            push({ type: "text", value });
            continue;
          }
          const type = "close";
          block = stack.pop();
          block.close = true;
          push({ type, value });
          depth--;
          block = stack[stack.length - 1];
          continue;
        }
        if (value === CHAR_COMMA && depth > 0) {
          if (block.ranges > 0) {
            block.ranges = 0;
            const open = block.nodes.shift();
            block.nodes = [open, { type: "text", value: stringify(block) }];
          }
          push({ type: "comma", value });
          block.commas++;
          continue;
        }
        if (value === CHAR_DOT && depth > 0 && block.commas === 0) {
          const siblings = block.nodes;
          if (depth === 0 || siblings.length === 0) {
            push({ type: "text", value });
            continue;
          }
          if (prev.type === "dot") {
            block.range = [];
            prev.value += value;
            prev.type = "range";
            if (block.nodes.length !== 3 && block.nodes.length !== 5) {
              block.invalid = true;
              block.ranges = 0;
              prev.type = "text";
              continue;
            }
            block.ranges++;
            block.args = [];
            continue;
          }
          if (prev.type === "range") {
            siblings.pop();
            const before = siblings[siblings.length - 1];
            before.value += prev.value + value;
            prev = before;
            block.ranges--;
            continue;
          }
          push({ type: "dot", value });
          continue;
        }
        push({ type: "text", value });
      }
      do {
        block = stack.pop();
        if (block.type !== "root") {
          block.nodes.forEach((node) => {
            if (!node.nodes) {
              if (node.type === "open") node.isOpen = true;
              if (node.type === "close") node.isClose = true;
              if (!node.nodes) node.type = "text";
              node.invalid = true;
            }
          });
          const parent = stack[stack.length - 1];
          const index2 = parent.nodes.indexOf(block);
          parent.nodes.splice(index2, 1, ...block.nodes);
        }
      } while (stack.length > 0);
      push({ type: "eos" });
      return ast;
    };
    module2.exports = parse;
  }
});

// node_modules/braces/index.js
var require_braces = __commonJS({
  "node_modules/braces/index.js"(exports2, module2) {
    "use strict";
    var stringify = require_stringify();
    var compile = require_compile();
    var expand = require_expand();
    var parse = require_parse3();
    var braces = (input, options = {}) => {
      let output = [];
      if (Array.isArray(input)) {
        for (const pattern of input) {
          const result = braces.create(pattern, options);
          if (Array.isArray(result)) {
            output.push(...result);
          } else {
            output.push(result);
          }
        }
      } else {
        output = [].concat(braces.create(input, options));
      }
      if (options && options.expand === true && options.nodupes === true) {
        output = [...new Set(output)];
      }
      return output;
    };
    braces.parse = (input, options = {}) => parse(input, options);
    braces.stringify = (input, options = {}) => {
      if (typeof input === "string") {
        return stringify(braces.parse(input, options), options);
      }
      return stringify(input, options);
    };
    braces.compile = (input, options = {}) => {
      if (typeof input === "string") {
        input = braces.parse(input, options);
      }
      return compile(input, options);
    };
    braces.expand = (input, options = {}) => {
      if (typeof input === "string") {
        input = braces.parse(input, options);
      }
      let result = expand(input, options);
      if (options.noempty === true) {
        result = result.filter(Boolean);
      }
      if (options.nodupes === true) {
        result = [...new Set(result)];
      }
      return result;
    };
    braces.create = (input, options = {}) => {
      if (input === "" || input.length < 3) {
        return [input];
      }
      return options.expand !== true ? braces.compile(input, options) : braces.expand(input, options);
    };
    module2.exports = braces;
  }
});

// node_modules/binary-extensions/binary-extensions.json
var require_binary_extensions = __commonJS({
  "node_modules/binary-extensions/binary-extensions.json"(exports2, module2) {
    module2.exports = [
      "3dm",
      "3ds",
      "3g2",
      "3gp",
      "7z",
      "a",
      "aac",
      "adp",
      "afdesign",
      "afphoto",
      "afpub",
      "ai",
      "aif",
      "aiff",
      "alz",
      "ape",
      "apk",
      "appimage",
      "ar",
      "arj",
      "asf",
      "au",
      "avi",
      "bak",
      "baml",
      "bh",
      "bin",
      "bk",
      "bmp",
      "btif",
      "bz2",
      "bzip2",
      "cab",
      "caf",
      "cgm",
      "class",
      "cmx",
      "cpio",
      "cr2",
      "cur",
      "dat",
      "dcm",
      "deb",
      "dex",
      "djvu",
      "dll",
      "dmg",
      "dng",
      "doc",
      "docm",
      "docx",
      "dot",
      "dotm",
      "dra",
      "DS_Store",
      "dsk",
      "dts",
      "dtshd",
      "dvb",
      "dwg",
      "dxf",
      "ecelp4800",
      "ecelp7470",
      "ecelp9600",
      "egg",
      "eol",
      "eot",
      "epub",
      "exe",
      "f4v",
      "fbs",
      "fh",
      "fla",
      "flac",
      "flatpak",
      "fli",
      "flv",
      "fpx",
      "fst",
      "fvt",
      "g3",
      "gh",
      "gif",
      "graffle",
      "gz",
      "gzip",
      "h261",
      "h263",
      "h264",
      "icns",
      "ico",
      "ief",
      "img",
      "ipa",
      "iso",
      "jar",
      "jpeg",
      "jpg",
      "jpgv",
      "jpm",
      "jxr",
      "key",
      "ktx",
      "lha",
      "lib",
      "lvp",
      "lz",
      "lzh",
      "lzma",
      "lzo",
      "m3u",
      "m4a",
      "m4v",
      "mar",
      "mdi",
      "mht",
      "mid",
      "midi",
      "mj2",
      "mka",
      "mkv",
      "mmr",
      "mng",
      "mobi",
      "mov",
      "movie",
      "mp3",
      "mp4",
      "mp4a",
      "mpeg",
      "mpg",
      "mpga",
      "mxu",
      "nef",
      "npx",
      "numbers",
      "nupkg",
      "o",
      "odp",
      "ods",
      "odt",
      "oga",
      "ogg",
      "ogv",
      "otf",
      "ott",
      "pages",
      "pbm",
      "pcx",
      "pdb",
      "pdf",
      "pea",
      "pgm",
      "pic",
      "png",
      "pnm",
      "pot",
      "potm",
      "potx",
      "ppa",
      "ppam",
      "ppm",
      "pps",
      "ppsm",
      "ppsx",
      "ppt",
      "pptm",
      "pptx",
      "psd",
      "pya",
      "pyc",
      "pyo",
      "pyv",
      "qt",
      "rar",
      "ras",
      "raw",
      "resources",
      "rgb",
      "rip",
      "rlc",
      "rmf",
      "rmvb",
      "rpm",
      "rtf",
      "rz",
      "s3m",
      "s7z",
      "scpt",
      "sgi",
      "shar",
      "snap",
      "sil",
      "sketch",
      "slk",
      "smv",
      "snk",
      "so",
      "stl",
      "suo",
      "sub",
      "swf",
      "tar",
      "tbz",
      "tbz2",
      "tga",
      "tgz",
      "thmx",
      "tif",
      "tiff",
      "tlz",
      "ttc",
      "ttf",
      "txz",
      "udf",
      "uvh",
      "uvi",
      "uvm",
      "uvp",
      "uvs",
      "uvu",
      "viv",
      "vob",
      "war",
      "wav",
      "wax",
      "wbmp",
      "wdp",
      "weba",
      "webm",
      "webp",
      "whl",
      "wim",
      "wm",
      "wma",
      "wmv",
      "wmx",
      "woff",
      "woff2",
      "wrm",
      "wvx",
      "xbm",
      "xif",
      "xla",
      "xlam",
      "xls",
      "xlsb",
      "xlsm",
      "xlsx",
      "xlt",
      "xltm",
      "xltx",
      "xm",
      "xmind",
      "xpi",
      "xpm",
      "xwd",
      "xz",
      "z",
      "zip",
      "zipx"
    ];
  }
});

// node_modules/binary-extensions/index.js
var require_binary_extensions2 = __commonJS({
  "node_modules/binary-extensions/index.js"(exports2, module2) {
    module2.exports = require_binary_extensions();
  }
});

// node_modules/is-binary-path/index.js
var require_is_binary_path = __commonJS({
  "node_modules/is-binary-path/index.js"(exports2, module2) {
    "use strict";
    var path3 = require("path");
    var binaryExtensions = require_binary_extensions2();
    var extensions = new Set(binaryExtensions);
    module2.exports = (filePath) => extensions.has(path3.extname(filePath).slice(1).toLowerCase());
  }
});

// node_modules/chokidar/lib/constants.js
var require_constants4 = __commonJS({
  "node_modules/chokidar/lib/constants.js"(exports2) {
    "use strict";
    var { sep } = require("path");
    var { platform } = process;
    var os2 = require("os");
    exports2.EV_ALL = "all";
    exports2.EV_READY = "ready";
    exports2.EV_ADD = "add";
    exports2.EV_CHANGE = "change";
    exports2.EV_ADD_DIR = "addDir";
    exports2.EV_UNLINK = "unlink";
    exports2.EV_UNLINK_DIR = "unlinkDir";
    exports2.EV_RAW = "raw";
    exports2.EV_ERROR = "error";
    exports2.STR_DATA = "data";
    exports2.STR_END = "end";
    exports2.STR_CLOSE = "close";
    exports2.FSEVENT_CREATED = "created";
    exports2.FSEVENT_MODIFIED = "modified";
    exports2.FSEVENT_DELETED = "deleted";
    exports2.FSEVENT_MOVED = "moved";
    exports2.FSEVENT_CLONED = "cloned";
    exports2.FSEVENT_UNKNOWN = "unknown";
    exports2.FSEVENT_FLAG_MUST_SCAN_SUBDIRS = 1;
    exports2.FSEVENT_TYPE_FILE = "file";
    exports2.FSEVENT_TYPE_DIRECTORY = "directory";
    exports2.FSEVENT_TYPE_SYMLINK = "symlink";
    exports2.KEY_LISTENERS = "listeners";
    exports2.KEY_ERR = "errHandlers";
    exports2.KEY_RAW = "rawEmitters";
    exports2.HANDLER_KEYS = [exports2.KEY_LISTENERS, exports2.KEY_ERR, exports2.KEY_RAW];
    exports2.DOT_SLASH = `.${sep}`;
    exports2.BACK_SLASH_RE = /\\/g;
    exports2.DOUBLE_SLASH_RE = /\/\//;
    exports2.SLASH_OR_BACK_SLASH_RE = /[/\\]/;
    exports2.DOT_RE = /\..*\.(sw[px])$|~$|\.subl.*\.tmp/;
    exports2.REPLACER_RE = /^\.[/\\]/;
    exports2.SLASH = "/";
    exports2.SLASH_SLASH = "//";
    exports2.BRACE_START = "{";
    exports2.BANG = "!";
    exports2.ONE_DOT = ".";
    exports2.TWO_DOTS = "..";
    exports2.STAR = "*";
    exports2.GLOBSTAR = "**";
    exports2.ROOT_GLOBSTAR = "/**/*";
    exports2.SLASH_GLOBSTAR = "/**";
    exports2.DIR_SUFFIX = "Dir";
    exports2.ANYMATCH_OPTS = { dot: true };
    exports2.STRING_TYPE = "string";
    exports2.FUNCTION_TYPE = "function";
    exports2.EMPTY_STR = "";
    exports2.EMPTY_FN = () => {
    };
    exports2.IDENTITY_FN = (val) => val;
    exports2.isWindows = platform === "win32";
    exports2.isMacos = platform === "darwin";
    exports2.isLinux = platform === "linux";
    exports2.isIBMi = os2.type() === "OS400";
  }
});

// node_modules/chokidar/lib/nodefs-handler.js
var require_nodefs_handler = __commonJS({
  "node_modules/chokidar/lib/nodefs-handler.js"(exports2, module2) {
    "use strict";
    var fs2 = require("fs");
    var sysPath = require("path");
    var { promisify } = require("util");
    var isBinaryPath = require_is_binary_path();
    var {
      isWindows,
      isLinux,
      EMPTY_FN,
      EMPTY_STR,
      KEY_LISTENERS,
      KEY_ERR,
      KEY_RAW,
      HANDLER_KEYS,
      EV_CHANGE,
      EV_ADD,
      EV_ADD_DIR,
      EV_ERROR,
      STR_DATA,
      STR_END,
      BRACE_START,
      STAR
    } = require_constants4();
    var THROTTLE_MODE_WATCH = "watch";
    var open = promisify(fs2.open);
    var stat = promisify(fs2.stat);
    var lstat = promisify(fs2.lstat);
    var close = promisify(fs2.close);
    var fsrealpath = promisify(fs2.realpath);
    var statMethods = { lstat, stat };
    var foreach = (val, fn) => {
      if (val instanceof Set) {
        val.forEach(fn);
      } else {
        fn(val);
      }
    };
    var addAndConvert = (main, prop, item) => {
      let container = main[prop];
      if (!(container instanceof Set)) {
        main[prop] = container = /* @__PURE__ */ new Set([container]);
      }
      container.add(item);
    };
    var clearItem = (cont) => (key) => {
      const set = cont[key];
      if (set instanceof Set) {
        set.clear();
      } else {
        delete cont[key];
      }
    };
    var delFromSet = (main, prop, item) => {
      const container = main[prop];
      if (container instanceof Set) {
        container.delete(item);
      } else if (container === item) {
        delete main[prop];
      }
    };
    var isEmptySet = (val) => val instanceof Set ? val.size === 0 : !val;
    var FsWatchInstances = /* @__PURE__ */ new Map();
    function createFsWatchInstance(path3, options, listener, errHandler, emitRaw) {
      const handleEvent = (rawEvent, evPath) => {
        listener(path3);
        emitRaw(rawEvent, evPath, { watchedPath: path3 });
        if (evPath && path3 !== evPath) {
          fsWatchBroadcast(
            sysPath.resolve(path3, evPath),
            KEY_LISTENERS,
            sysPath.join(path3, evPath)
          );
        }
      };
      try {
        return fs2.watch(path3, options, handleEvent);
      } catch (error) {
        errHandler(error);
      }
    }
    var fsWatchBroadcast = (fullPath, type, val1, val2, val3) => {
      const cont = FsWatchInstances.get(fullPath);
      if (!cont) return;
      foreach(cont[type], (listener) => {
        listener(val1, val2, val3);
      });
    };
    var setFsWatchListener = (path3, fullPath, options, handlers) => {
      const { listener, errHandler, rawEmitter } = handlers;
      let cont = FsWatchInstances.get(fullPath);
      let watcher;
      if (!options.persistent) {
        watcher = createFsWatchInstance(
          path3,
          options,
          listener,
          errHandler,
          rawEmitter
        );
        return watcher.close.bind(watcher);
      }
      if (cont) {
        addAndConvert(cont, KEY_LISTENERS, listener);
        addAndConvert(cont, KEY_ERR, errHandler);
        addAndConvert(cont, KEY_RAW, rawEmitter);
      } else {
        watcher = createFsWatchInstance(
          path3,
          options,
          fsWatchBroadcast.bind(null, fullPath, KEY_LISTENERS),
          errHandler,
          // no need to use broadcast here
          fsWatchBroadcast.bind(null, fullPath, KEY_RAW)
        );
        if (!watcher) return;
        watcher.on(EV_ERROR, async (error) => {
          const broadcastErr = fsWatchBroadcast.bind(null, fullPath, KEY_ERR);
          cont.watcherUnusable = true;
          if (isWindows && error.code === "EPERM") {
            try {
              const fd = await open(path3, "r");
              await close(fd);
              broadcastErr(error);
            } catch (err) {
            }
          } else {
            broadcastErr(error);
          }
        });
        cont = {
          listeners: listener,
          errHandlers: errHandler,
          rawEmitters: rawEmitter,
          watcher
        };
        FsWatchInstances.set(fullPath, cont);
      }
      return () => {
        delFromSet(cont, KEY_LISTENERS, listener);
        delFromSet(cont, KEY_ERR, errHandler);
        delFromSet(cont, KEY_RAW, rawEmitter);
        if (isEmptySet(cont.listeners)) {
          cont.watcher.close();
          FsWatchInstances.delete(fullPath);
          HANDLER_KEYS.forEach(clearItem(cont));
          cont.watcher = void 0;
          Object.freeze(cont);
        }
      };
    };
    var FsWatchFileInstances = /* @__PURE__ */ new Map();
    var setFsWatchFileListener = (path3, fullPath, options, handlers) => {
      const { listener, rawEmitter } = handlers;
      let cont = FsWatchFileInstances.get(fullPath);
      let listeners = /* @__PURE__ */ new Set();
      let rawEmitters = /* @__PURE__ */ new Set();
      const copts = cont && cont.options;
      if (copts && (copts.persistent < options.persistent || copts.interval > options.interval)) {
        listeners = cont.listeners;
        rawEmitters = cont.rawEmitters;
        fs2.unwatchFile(fullPath);
        cont = void 0;
      }
      if (cont) {
        addAndConvert(cont, KEY_LISTENERS, listener);
        addAndConvert(cont, KEY_RAW, rawEmitter);
      } else {
        cont = {
          listeners: listener,
          rawEmitters: rawEmitter,
          options,
          watcher: fs2.watchFile(fullPath, options, (curr, prev) => {
            foreach(cont.rawEmitters, (rawEmitter2) => {
              rawEmitter2(EV_CHANGE, fullPath, { curr, prev });
            });
            const currmtime = curr.mtimeMs;
            if (curr.size !== prev.size || currmtime > prev.mtimeMs || currmtime === 0) {
              foreach(cont.listeners, (listener2) => listener2(path3, curr));
            }
          })
        };
        FsWatchFileInstances.set(fullPath, cont);
      }
      return () => {
        delFromSet(cont, KEY_LISTENERS, listener);
        delFromSet(cont, KEY_RAW, rawEmitter);
        if (isEmptySet(cont.listeners)) {
          FsWatchFileInstances.delete(fullPath);
          fs2.unwatchFile(fullPath);
          cont.options = cont.watcher = void 0;
          Object.freeze(cont);
        }
      };
    };
    var NodeFsHandler = class {
      /**
       * @param {import("../index").FSWatcher} fsW
       */
      constructor(fsW) {
        this.fsw = fsW;
        this._boundHandleError = (error) => fsW._handleError(error);
      }
      /**
       * Watch file for changes with fs_watchFile or fs_watch.
       * @param {String} path to file or dir
       * @param {Function} listener on fs change
       * @returns {Function} closer for the watcher instance
       */
      _watchWithNodeFs(path3, listener) {
        const opts = this.fsw.options;
        const directory = sysPath.dirname(path3);
        const basename = sysPath.basename(path3);
        const parent = this.fsw._getWatchedDir(directory);
        parent.add(basename);
        const absolutePath = sysPath.resolve(path3);
        const options = { persistent: opts.persistent };
        if (!listener) listener = EMPTY_FN;
        let closer;
        if (opts.usePolling) {
          options.interval = opts.enableBinaryInterval && isBinaryPath(basename) ? opts.binaryInterval : opts.interval;
          closer = setFsWatchFileListener(path3, absolutePath, options, {
            listener,
            rawEmitter: this.fsw._emitRaw
          });
        } else {
          closer = setFsWatchListener(path3, absolutePath, options, {
            listener,
            errHandler: this._boundHandleError,
            rawEmitter: this.fsw._emitRaw
          });
        }
        return closer;
      }
      /**
       * Watch a file and emit add event if warranted.
       * @param {Path} file Path
       * @param {fs.Stats} stats result of fs_stat
       * @param {Boolean} initialAdd was the file added at watch instantiation?
       * @returns {Function} closer for the watcher instance
       */
      _handleFile(file, stats, initialAdd) {
        if (this.fsw.closed) {
          return;
        }
        const dirname = sysPath.dirname(file);
        const basename = sysPath.basename(file);
        const parent = this.fsw._getWatchedDir(dirname);
        let prevStats = stats;
        if (parent.has(basename)) return;
        const listener = async (path3, newStats) => {
          if (!this.fsw._throttle(THROTTLE_MODE_WATCH, file, 5)) return;
          if (!newStats || newStats.mtimeMs === 0) {
            try {
              const newStats2 = await stat(file);
              if (this.fsw.closed) return;
              const at = newStats2.atimeMs;
              const mt = newStats2.mtimeMs;
              if (!at || at <= mt || mt !== prevStats.mtimeMs) {
                this.fsw._emit(EV_CHANGE, file, newStats2);
              }
              if (isLinux && prevStats.ino !== newStats2.ino) {
                this.fsw._closeFile(path3);
                prevStats = newStats2;
                this.fsw._addPathCloser(path3, this._watchWithNodeFs(file, listener));
              } else {
                prevStats = newStats2;
              }
            } catch (error) {
              this.fsw._remove(dirname, basename);
            }
          } else if (parent.has(basename)) {
            const at = newStats.atimeMs;
            const mt = newStats.mtimeMs;
            if (!at || at <= mt || mt !== prevStats.mtimeMs) {
              this.fsw._emit(EV_CHANGE, file, newStats);
            }
            prevStats = newStats;
          }
        };
        const closer = this._watchWithNodeFs(file, listener);
        if (!(initialAdd && this.fsw.options.ignoreInitial) && this.fsw._isntIgnored(file)) {
          if (!this.fsw._throttle(EV_ADD, file, 0)) return;
          this.fsw._emit(EV_ADD, file, stats);
        }
        return closer;
      }
      /**
       * Handle symlinks encountered while reading a dir.
       * @param {Object} entry returned by readdirp
       * @param {String} directory path of dir being read
       * @param {String} path of this item
       * @param {String} item basename of this item
       * @returns {Promise<Boolean>} true if no more processing is needed for this entry.
       */
      async _handleSymlink(entry, directory, path3, item) {
        if (this.fsw.closed) {
          return;
        }
        const full = entry.fullPath;
        const dir = this.fsw._getWatchedDir(directory);
        if (!this.fsw.options.followSymlinks) {
          this.fsw._incrReadyCount();
          let linkPath;
          try {
            linkPath = await fsrealpath(path3);
          } catch (e) {
            this.fsw._emitReady();
            return true;
          }
          if (this.fsw.closed) return;
          if (dir.has(item)) {
            if (this.fsw._symlinkPaths.get(full) !== linkPath) {
              this.fsw._symlinkPaths.set(full, linkPath);
              this.fsw._emit(EV_CHANGE, path3, entry.stats);
            }
          } else {
            dir.add(item);
            this.fsw._symlinkPaths.set(full, linkPath);
            this.fsw._emit(EV_ADD, path3, entry.stats);
          }
          this.fsw._emitReady();
          return true;
        }
        if (this.fsw._symlinkPaths.has(full)) {
          return true;
        }
        this.fsw._symlinkPaths.set(full, true);
      }
      _handleRead(directory, initialAdd, wh, target, dir, depth, throttler) {
        directory = sysPath.join(directory, EMPTY_STR);
        if (!wh.hasGlob) {
          throttler = this.fsw._throttle("readdir", directory, 1e3);
          if (!throttler) return;
        }
        const previous = this.fsw._getWatchedDir(wh.path);
        const current = /* @__PURE__ */ new Set();
        let stream = this.fsw._readdirp(directory, {
          fileFilter: (entry) => wh.filterPath(entry),
          directoryFilter: (entry) => wh.filterDir(entry),
          depth: 0
        }).on(STR_DATA, async (entry) => {
          if (this.fsw.closed) {
            stream = void 0;
            return;
          }
          const item = entry.path;
          let path3 = sysPath.join(directory, item);
          current.add(item);
          if (entry.stats.isSymbolicLink() && await this._handleSymlink(entry, directory, path3, item)) {
            return;
          }
          if (this.fsw.closed) {
            stream = void 0;
            return;
          }
          if (item === target || !target && !previous.has(item)) {
            this.fsw._incrReadyCount();
            path3 = sysPath.join(dir, sysPath.relative(dir, path3));
            this._addToNodeFs(path3, initialAdd, wh, depth + 1);
          }
        }).on(EV_ERROR, this._boundHandleError);
        return new Promise(
          (resolve) => stream.once(STR_END, () => {
            if (this.fsw.closed) {
              stream = void 0;
              return;
            }
            const wasThrottled = throttler ? throttler.clear() : false;
            resolve();
            previous.getChildren().filter((item) => {
              return item !== directory && !current.has(item) && // in case of intersecting globs;
              // a path may have been filtered out of this readdir, but
              // shouldn't be removed because it matches a different glob
              (!wh.hasGlob || wh.filterPath({
                fullPath: sysPath.resolve(directory, item)
              }));
            }).forEach((item) => {
              this.fsw._remove(directory, item);
            });
            stream = void 0;
            if (wasThrottled) this._handleRead(directory, false, wh, target, dir, depth, throttler);
          })
        );
      }
      /**
       * Read directory to add / remove files from `@watched` list and re-read it on change.
       * @param {String} dir fs path
       * @param {fs.Stats} stats
       * @param {Boolean} initialAdd
       * @param {Number} depth relative to user-supplied path
       * @param {String} target child path targeted for watch
       * @param {Object} wh Common watch helpers for this path
       * @param {String} realpath
       * @returns {Promise<Function>} closer for the watcher instance.
       */
      async _handleDir(dir, stats, initialAdd, depth, target, wh, realpath) {
        const parentDir = this.fsw._getWatchedDir(sysPath.dirname(dir));
        const tracked = parentDir.has(sysPath.basename(dir));
        if (!(initialAdd && this.fsw.options.ignoreInitial) && !target && !tracked) {
          if (!wh.hasGlob || wh.globFilter(dir)) this.fsw._emit(EV_ADD_DIR, dir, stats);
        }
        parentDir.add(sysPath.basename(dir));
        this.fsw._getWatchedDir(dir);
        let throttler;
        let closer;
        const oDepth = this.fsw.options.depth;
        if ((oDepth == null || depth <= oDepth) && !this.fsw._symlinkPaths.has(realpath)) {
          if (!target) {
            await this._handleRead(dir, initialAdd, wh, target, dir, depth, throttler);
            if (this.fsw.closed) return;
          }
          closer = this._watchWithNodeFs(dir, (dirPath, stats2) => {
            if (stats2 && stats2.mtimeMs === 0) return;
            this._handleRead(dirPath, false, wh, target, dir, depth, throttler);
          });
        }
        return closer;
      }
      /**
       * Handle added file, directory, or glob pattern.
       * Delegates call to _handleFile / _handleDir after checks.
       * @param {String} path to file or ir
       * @param {Boolean} initialAdd was the file added at watch instantiation?
       * @param {Object} priorWh depth relative to user-supplied path
       * @param {Number} depth Child path actually targeted for watch
       * @param {String=} target Child path actually targeted for watch
       * @returns {Promise}
       */
      async _addToNodeFs(path3, initialAdd, priorWh, depth, target) {
        const ready = this.fsw._emitReady;
        if (this.fsw._isIgnored(path3) || this.fsw.closed) {
          ready();
          return false;
        }
        const wh = this.fsw._getWatchHelpers(path3, depth);
        if (!wh.hasGlob && priorWh) {
          wh.hasGlob = priorWh.hasGlob;
          wh.globFilter = priorWh.globFilter;
          wh.filterPath = (entry) => priorWh.filterPath(entry);
          wh.filterDir = (entry) => priorWh.filterDir(entry);
        }
        try {
          const stats = await statMethods[wh.statMethod](wh.watchPath);
          if (this.fsw.closed) return;
          if (this.fsw._isIgnored(wh.watchPath, stats)) {
            ready();
            return false;
          }
          const follow = this.fsw.options.followSymlinks && !path3.includes(STAR) && !path3.includes(BRACE_START);
          let closer;
          if (stats.isDirectory()) {
            const absPath = sysPath.resolve(path3);
            const targetPath = follow ? await fsrealpath(path3) : path3;
            if (this.fsw.closed) return;
            closer = await this._handleDir(wh.watchPath, stats, initialAdd, depth, target, wh, targetPath);
            if (this.fsw.closed) return;
            if (absPath !== targetPath && targetPath !== void 0) {
              this.fsw._symlinkPaths.set(absPath, targetPath);
            }
          } else if (stats.isSymbolicLink()) {
            const targetPath = follow ? await fsrealpath(path3) : path3;
            if (this.fsw.closed) return;
            const parent = sysPath.dirname(wh.watchPath);
            this.fsw._getWatchedDir(parent).add(wh.watchPath);
            this.fsw._emit(EV_ADD, wh.watchPath, stats);
            closer = await this._handleDir(parent, stats, initialAdd, depth, path3, wh, targetPath);
            if (this.fsw.closed) return;
            if (targetPath !== void 0) {
              this.fsw._symlinkPaths.set(sysPath.resolve(path3), targetPath);
            }
          } else {
            closer = this._handleFile(wh.watchPath, stats, initialAdd);
          }
          ready();
          this.fsw._addPathCloser(path3, closer);
          return false;
        } catch (error) {
          if (this.fsw._handleError(error)) {
            ready();
            return path3;
          }
        }
      }
    };
    module2.exports = NodeFsHandler;
  }
});

// node_modules/chokidar/lib/fsevents-handler.js
var require_fsevents_handler = __commonJS({
  "node_modules/chokidar/lib/fsevents-handler.js"(exports2, module2) {
    "use strict";
    var fs2 = require("fs");
    var sysPath = require("path");
    var { promisify } = require("util");
    var fsevents;
    try {
      fsevents = require("fsevents");
    } catch (error) {
      if (process.env.CHOKIDAR_PRINT_FSEVENTS_REQUIRE_ERROR) console.error(error);
    }
    if (fsevents) {
      const mtch = process.version.match(/v(\d+)\.(\d+)/);
      if (mtch && mtch[1] && mtch[2]) {
        const maj = Number.parseInt(mtch[1], 10);
        const min = Number.parseInt(mtch[2], 10);
        if (maj === 8 && min < 16) {
          fsevents = void 0;
        }
      }
    }
    var {
      EV_ADD,
      EV_CHANGE,
      EV_ADD_DIR,
      EV_UNLINK,
      EV_ERROR,
      STR_DATA,
      STR_END,
      FSEVENT_CREATED,
      FSEVENT_MODIFIED,
      FSEVENT_DELETED,
      FSEVENT_MOVED,
      // FSEVENT_CLONED,
      FSEVENT_UNKNOWN,
      FSEVENT_FLAG_MUST_SCAN_SUBDIRS,
      FSEVENT_TYPE_FILE,
      FSEVENT_TYPE_DIRECTORY,
      FSEVENT_TYPE_SYMLINK,
      ROOT_GLOBSTAR,
      DIR_SUFFIX,
      DOT_SLASH,
      FUNCTION_TYPE,
      EMPTY_FN,
      IDENTITY_FN
    } = require_constants4();
    var Depth = (value) => isNaN(value) ? {} : { depth: value };
    var stat = promisify(fs2.stat);
    var lstat = promisify(fs2.lstat);
    var realpath = promisify(fs2.realpath);
    var statMethods = { stat, lstat };
    var FSEventsWatchers = /* @__PURE__ */ new Map();
    var consolidateThreshhold = 10;
    var wrongEventFlags = /* @__PURE__ */ new Set([
      69888,
      70400,
      71424,
      72704,
      73472,
      131328,
      131840,
      262912
    ]);
    var createFSEventsInstance = (path3, callback) => {
      const stop = fsevents.watch(path3, callback);
      return { stop };
    };
    function setFSEventsListener(path3, realPath, listener, rawEmitter) {
      let watchPath = sysPath.extname(realPath) ? sysPath.dirname(realPath) : realPath;
      const parentPath = sysPath.dirname(watchPath);
      let cont = FSEventsWatchers.get(watchPath);
      if (couldConsolidate(parentPath)) {
        watchPath = parentPath;
      }
      const resolvedPath = sysPath.resolve(path3);
      const hasSymlink = resolvedPath !== realPath;
      const filteredListener = (fullPath, flags, info) => {
        if (hasSymlink) fullPath = fullPath.replace(realPath, resolvedPath);
        if (fullPath === resolvedPath || !fullPath.indexOf(resolvedPath + sysPath.sep)) listener(fullPath, flags, info);
      };
      let watchedParent = false;
      for (const watchedPath of FSEventsWatchers.keys()) {
        if (realPath.indexOf(sysPath.resolve(watchedPath) + sysPath.sep) === 0) {
          watchPath = watchedPath;
          cont = FSEventsWatchers.get(watchPath);
          watchedParent = true;
          break;
        }
      }
      if (cont || watchedParent) {
        cont.listeners.add(filteredListener);
      } else {
        cont = {
          listeners: /* @__PURE__ */ new Set([filteredListener]),
          rawEmitter,
          watcher: createFSEventsInstance(watchPath, (fullPath, flags) => {
            if (!cont.listeners.size) return;
            if (flags & FSEVENT_FLAG_MUST_SCAN_SUBDIRS) return;
            const info = fsevents.getInfo(fullPath, flags);
            cont.listeners.forEach((list) => {
              list(fullPath, flags, info);
            });
            cont.rawEmitter(info.event, fullPath, info);
          })
        };
        FSEventsWatchers.set(watchPath, cont);
      }
      return () => {
        const lst = cont.listeners;
        lst.delete(filteredListener);
        if (!lst.size) {
          FSEventsWatchers.delete(watchPath);
          if (cont.watcher) return cont.watcher.stop().then(() => {
            cont.rawEmitter = cont.watcher = void 0;
            Object.freeze(cont);
          });
        }
      };
    }
    var couldConsolidate = (path3) => {
      let count = 0;
      for (const watchPath of FSEventsWatchers.keys()) {
        if (watchPath.indexOf(path3) === 0) {
          count++;
          if (count >= consolidateThreshhold) {
            return true;
          }
        }
      }
      return false;
    };
    var canUse = () => fsevents && FSEventsWatchers.size < 128;
    var calcDepth = (path3, root) => {
      let i = 0;
      while (!path3.indexOf(root) && (path3 = sysPath.dirname(path3)) !== root) i++;
      return i;
    };
    var sameTypes = (info, stats) => info.type === FSEVENT_TYPE_DIRECTORY && stats.isDirectory() || info.type === FSEVENT_TYPE_SYMLINK && stats.isSymbolicLink() || info.type === FSEVENT_TYPE_FILE && stats.isFile();
    var FsEventsHandler = class {
      /**
       * @param {import('../index').FSWatcher} fsw
       */
      constructor(fsw) {
        this.fsw = fsw;
      }
      checkIgnored(path3, stats) {
        const ipaths = this.fsw._ignoredPaths;
        if (this.fsw._isIgnored(path3, stats)) {
          ipaths.add(path3);
          if (stats && stats.isDirectory()) {
            ipaths.add(path3 + ROOT_GLOBSTAR);
          }
          return true;
        }
        ipaths.delete(path3);
        ipaths.delete(path3 + ROOT_GLOBSTAR);
      }
      addOrChange(path3, fullPath, realPath, parent, watchedDir, item, info, opts) {
        const event = watchedDir.has(item) ? EV_CHANGE : EV_ADD;
        this.handleEvent(event, path3, fullPath, realPath, parent, watchedDir, item, info, opts);
      }
      async checkExists(path3, fullPath, realPath, parent, watchedDir, item, info, opts) {
        try {
          const stats = await stat(path3);
          if (this.fsw.closed) return;
          if (sameTypes(info, stats)) {
            this.addOrChange(path3, fullPath, realPath, parent, watchedDir, item, info, opts);
          } else {
            this.handleEvent(EV_UNLINK, path3, fullPath, realPath, parent, watchedDir, item, info, opts);
          }
        } catch (error) {
          if (error.code === "EACCES") {
            this.addOrChange(path3, fullPath, realPath, parent, watchedDir, item, info, opts);
          } else {
            this.handleEvent(EV_UNLINK, path3, fullPath, realPath, parent, watchedDir, item, info, opts);
          }
        }
      }
      handleEvent(event, path3, fullPath, realPath, parent, watchedDir, item, info, opts) {
        if (this.fsw.closed || this.checkIgnored(path3)) return;
        if (event === EV_UNLINK) {
          const isDirectory = info.type === FSEVENT_TYPE_DIRECTORY;
          if (isDirectory || watchedDir.has(item)) {
            this.fsw._remove(parent, item, isDirectory);
          }
        } else {
          if (event === EV_ADD) {
            if (info.type === FSEVENT_TYPE_DIRECTORY) this.fsw._getWatchedDir(path3);
            if (info.type === FSEVENT_TYPE_SYMLINK && opts.followSymlinks) {
              const curDepth = opts.depth === void 0 ? void 0 : calcDepth(fullPath, realPath) + 1;
              return this._addToFsEvents(path3, false, true, curDepth);
            }
            this.fsw._getWatchedDir(parent).add(item);
          }
          const eventName = info.type === FSEVENT_TYPE_DIRECTORY ? event + DIR_SUFFIX : event;
          this.fsw._emit(eventName, path3);
          if (eventName === EV_ADD_DIR) this._addToFsEvents(path3, false, true);
        }
      }
      /**
       * Handle symlinks encountered during directory scan
       * @param {String} watchPath  - file/dir path to be watched with fsevents
       * @param {String} realPath   - real path (in case of symlinks)
       * @param {Function} transform  - path transformer
       * @param {Function} globFilter - path filter in case a glob pattern was provided
       * @returns {Function} closer for the watcher instance
      */
      _watchWithFsEvents(watchPath, realPath, transform, globFilter) {
        if (this.fsw.closed || this.fsw._isIgnored(watchPath)) return;
        const opts = this.fsw.options;
        const watchCallback = async (fullPath, flags, info) => {
          if (this.fsw.closed) return;
          if (opts.depth !== void 0 && calcDepth(fullPath, realPath) > opts.depth) return;
          const path3 = transform(sysPath.join(
            watchPath,
            sysPath.relative(watchPath, fullPath)
          ));
          if (globFilter && !globFilter(path3)) return;
          const parent = sysPath.dirname(path3);
          const item = sysPath.basename(path3);
          const watchedDir = this.fsw._getWatchedDir(
            info.type === FSEVENT_TYPE_DIRECTORY ? path3 : parent
          );
          if (wrongEventFlags.has(flags) || info.event === FSEVENT_UNKNOWN) {
            if (typeof opts.ignored === FUNCTION_TYPE) {
              let stats;
              try {
                stats = await stat(path3);
              } catch (error) {
              }
              if (this.fsw.closed) return;
              if (this.checkIgnored(path3, stats)) return;
              if (sameTypes(info, stats)) {
                this.addOrChange(path3, fullPath, realPath, parent, watchedDir, item, info, opts);
              } else {
                this.handleEvent(EV_UNLINK, path3, fullPath, realPath, parent, watchedDir, item, info, opts);
              }
            } else {
              this.checkExists(path3, fullPath, realPath, parent, watchedDir, item, info, opts);
            }
          } else {
            switch (info.event) {
              case FSEVENT_CREATED:
              case FSEVENT_MODIFIED:
                return this.addOrChange(path3, fullPath, realPath, parent, watchedDir, item, info, opts);
              case FSEVENT_DELETED:
              case FSEVENT_MOVED:
                return this.checkExists(path3, fullPath, realPath, parent, watchedDir, item, info, opts);
            }
          }
        };
        const closer = setFSEventsListener(
          watchPath,
          realPath,
          watchCallback,
          this.fsw._emitRaw
        );
        this.fsw._emitReady();
        return closer;
      }
      /**
       * Handle symlinks encountered during directory scan
       * @param {String} linkPath path to symlink
       * @param {String} fullPath absolute path to the symlink
       * @param {Function} transform pre-existing path transformer
       * @param {Number} curDepth level of subdirectories traversed to where symlink is
       * @returns {Promise<void>}
       */
      async _handleFsEventsSymlink(linkPath, fullPath, transform, curDepth) {
        if (this.fsw.closed || this.fsw._symlinkPaths.has(fullPath)) return;
        this.fsw._symlinkPaths.set(fullPath, true);
        this.fsw._incrReadyCount();
        try {
          const linkTarget = await realpath(linkPath);
          if (this.fsw.closed) return;
          if (this.fsw._isIgnored(linkTarget)) {
            return this.fsw._emitReady();
          }
          this.fsw._incrReadyCount();
          this._addToFsEvents(linkTarget || linkPath, (path3) => {
            let aliasedPath = linkPath;
            if (linkTarget && linkTarget !== DOT_SLASH) {
              aliasedPath = path3.replace(linkTarget, linkPath);
            } else if (path3 !== DOT_SLASH) {
              aliasedPath = sysPath.join(linkPath, path3);
            }
            return transform(aliasedPath);
          }, false, curDepth);
        } catch (error) {
          if (this.fsw._handleError(error)) {
            return this.fsw._emitReady();
          }
        }
      }
      /**
       *
       * @param {Path} newPath
       * @param {fs.Stats} stats
       */
      emitAdd(newPath, stats, processPath, opts, forceAdd) {
        const pp = processPath(newPath);
        const isDir = stats.isDirectory();
        const dirObj = this.fsw._getWatchedDir(sysPath.dirname(pp));
        const base = sysPath.basename(pp);
        if (isDir) this.fsw._getWatchedDir(pp);
        if (dirObj.has(base)) return;
        dirObj.add(base);
        if (!opts.ignoreInitial || forceAdd === true) {
          this.fsw._emit(isDir ? EV_ADD_DIR : EV_ADD, pp, stats);
        }
      }
      initWatch(realPath, path3, wh, processPath) {
        if (this.fsw.closed) return;
        const closer = this._watchWithFsEvents(
          wh.watchPath,
          sysPath.resolve(realPath || wh.watchPath),
          processPath,
          wh.globFilter
        );
        this.fsw._addPathCloser(path3, closer);
      }
      /**
       * Handle added path with fsevents
       * @param {String} path file/dir path or glob pattern
       * @param {Function|Boolean=} transform converts working path to what the user expects
       * @param {Boolean=} forceAdd ensure add is emitted
       * @param {Number=} priorDepth Level of subdirectories already traversed.
       * @returns {Promise<void>}
       */
      async _addToFsEvents(path3, transform, forceAdd, priorDepth) {
        if (this.fsw.closed) {
          return;
        }
        const opts = this.fsw.options;
        const processPath = typeof transform === FUNCTION_TYPE ? transform : IDENTITY_FN;
        const wh = this.fsw._getWatchHelpers(path3);
        try {
          const stats = await statMethods[wh.statMethod](wh.watchPath);
          if (this.fsw.closed) return;
          if (this.fsw._isIgnored(wh.watchPath, stats)) {
            throw null;
          }
          if (stats.isDirectory()) {
            if (!wh.globFilter) this.emitAdd(processPath(path3), stats, processPath, opts, forceAdd);
            if (priorDepth && priorDepth > opts.depth) return;
            this.fsw._readdirp(wh.watchPath, {
              fileFilter: (entry) => wh.filterPath(entry),
              directoryFilter: (entry) => wh.filterDir(entry),
              ...Depth(opts.depth - (priorDepth || 0))
            }).on(STR_DATA, (entry) => {
              if (this.fsw.closed) {
                return;
              }
              if (entry.stats.isDirectory() && !wh.filterPath(entry)) return;
              const joinedPath = sysPath.join(wh.watchPath, entry.path);
              const { fullPath } = entry;
              if (wh.followSymlinks && entry.stats.isSymbolicLink()) {
                const curDepth = opts.depth === void 0 ? void 0 : calcDepth(joinedPath, sysPath.resolve(wh.watchPath)) + 1;
                this._handleFsEventsSymlink(joinedPath, fullPath, processPath, curDepth);
              } else {
                this.emitAdd(joinedPath, entry.stats, processPath, opts, forceAdd);
              }
            }).on(EV_ERROR, EMPTY_FN).on(STR_END, () => {
              this.fsw._emitReady();
            });
          } else {
            this.emitAdd(wh.watchPath, stats, processPath, opts, forceAdd);
            this.fsw._emitReady();
          }
        } catch (error) {
          if (!error || this.fsw._handleError(error)) {
            this.fsw._emitReady();
            this.fsw._emitReady();
          }
        }
        if (opts.persistent && forceAdd !== true) {
          if (typeof transform === FUNCTION_TYPE) {
            this.initWatch(void 0, path3, wh, processPath);
          } else {
            let realPath;
            try {
              realPath = await realpath(wh.watchPath);
            } catch (e) {
            }
            this.initWatch(realPath, path3, wh, processPath);
          }
        }
      }
    };
    module2.exports = FsEventsHandler;
    module2.exports.canUse = canUse;
  }
});

// node_modules/chokidar/index.js
var require_chokidar = __commonJS({
  "node_modules/chokidar/index.js"(exports2) {
    "use strict";
    var { EventEmitter: EventEmitter2 } = require("events");
    var fs2 = require("fs");
    var sysPath = require("path");
    var { promisify } = require("util");
    var readdirp = require_readdirp();
    var anymatch = require_anymatch().default;
    var globParent = require_glob_parent();
    var isGlob = require_is_glob();
    var braces = require_braces();
    var normalizePath = require_normalize_path();
    var NodeFsHandler = require_nodefs_handler();
    var FsEventsHandler = require_fsevents_handler();
    var {
      EV_ALL,
      EV_READY,
      EV_ADD,
      EV_CHANGE,
      EV_UNLINK,
      EV_ADD_DIR,
      EV_UNLINK_DIR,
      EV_RAW,
      EV_ERROR,
      STR_CLOSE,
      STR_END,
      BACK_SLASH_RE,
      DOUBLE_SLASH_RE,
      SLASH_OR_BACK_SLASH_RE,
      DOT_RE,
      REPLACER_RE,
      SLASH,
      SLASH_SLASH,
      BRACE_START,
      BANG,
      ONE_DOT,
      TWO_DOTS,
      GLOBSTAR,
      SLASH_GLOBSTAR,
      ANYMATCH_OPTS,
      STRING_TYPE,
      FUNCTION_TYPE,
      EMPTY_STR,
      EMPTY_FN,
      isWindows,
      isMacos,
      isIBMi
    } = require_constants4();
    var stat = promisify(fs2.stat);
    var readdir = promisify(fs2.readdir);
    var arrify = (value = []) => Array.isArray(value) ? value : [value];
    var flatten = (list, result = []) => {
      list.forEach((item) => {
        if (Array.isArray(item)) {
          flatten(item, result);
        } else {
          result.push(item);
        }
      });
      return result;
    };
    var unifyPaths = (paths_) => {
      const paths = flatten(arrify(paths_));
      if (!paths.every((p) => typeof p === STRING_TYPE)) {
        throw new TypeError(`Non-string provided as watch path: ${paths}`);
      }
      return paths.map(normalizePathToUnix);
    };
    var toUnix = (string) => {
      let str = string.replace(BACK_SLASH_RE, SLASH);
      let prepend = false;
      if (str.startsWith(SLASH_SLASH)) {
        prepend = true;
      }
      while (str.match(DOUBLE_SLASH_RE)) {
        str = str.replace(DOUBLE_SLASH_RE, SLASH);
      }
      if (prepend) {
        str = SLASH + str;
      }
      return str;
    };
    var normalizePathToUnix = (path3) => toUnix(sysPath.normalize(toUnix(path3)));
    var normalizeIgnored = (cwd = EMPTY_STR) => (path3) => {
      if (typeof path3 !== STRING_TYPE) return path3;
      return normalizePathToUnix(sysPath.isAbsolute(path3) ? path3 : sysPath.join(cwd, path3));
    };
    var getAbsolutePath = (path3, cwd) => {
      if (sysPath.isAbsolute(path3)) {
        return path3;
      }
      if (path3.startsWith(BANG)) {
        return BANG + sysPath.join(cwd, path3.slice(1));
      }
      return sysPath.join(cwd, path3);
    };
    var undef = (opts, key) => opts[key] === void 0;
    var DirEntry = class {
      /**
       * @param {Path} dir
       * @param {Function} removeWatcher
       */
      constructor(dir, removeWatcher) {
        this.path = dir;
        this._removeWatcher = removeWatcher;
        this.items = /* @__PURE__ */ new Set();
      }
      add(item) {
        const { items } = this;
        if (!items) return;
        if (item !== ONE_DOT && item !== TWO_DOTS) items.add(item);
      }
      async remove(item) {
        const { items } = this;
        if (!items) return;
        items.delete(item);
        if (items.size > 0) return;
        const dir = this.path;
        try {
          await readdir(dir);
        } catch (err) {
          if (this._removeWatcher) {
            this._removeWatcher(sysPath.dirname(dir), sysPath.basename(dir));
          }
        }
      }
      has(item) {
        const { items } = this;
        if (!items) return;
        return items.has(item);
      }
      /**
       * @returns {Array<String>}
       */
      getChildren() {
        const { items } = this;
        if (!items) return;
        return [...items.values()];
      }
      dispose() {
        this.items.clear();
        delete this.path;
        delete this._removeWatcher;
        delete this.items;
        Object.freeze(this);
      }
    };
    var STAT_METHOD_F = "stat";
    var STAT_METHOD_L = "lstat";
    var WatchHelper = class {
      constructor(path3, watchPath, follow, fsw) {
        this.fsw = fsw;
        this.path = path3 = path3.replace(REPLACER_RE, EMPTY_STR);
        this.watchPath = watchPath;
        this.fullWatchPath = sysPath.resolve(watchPath);
        this.hasGlob = watchPath !== path3;
        if (path3 === EMPTY_STR) this.hasGlob = false;
        this.globSymlink = this.hasGlob && follow ? void 0 : false;
        this.globFilter = this.hasGlob ? anymatch(path3, void 0, ANYMATCH_OPTS) : false;
        this.dirParts = this.getDirParts(path3);
        this.dirParts.forEach((parts) => {
          if (parts.length > 1) parts.pop();
        });
        this.followSymlinks = follow;
        this.statMethod = follow ? STAT_METHOD_F : STAT_METHOD_L;
      }
      checkGlobSymlink(entry) {
        if (this.globSymlink === void 0) {
          this.globSymlink = entry.fullParentDir === this.fullWatchPath ? false : { realPath: entry.fullParentDir, linkPath: this.fullWatchPath };
        }
        if (this.globSymlink) {
          return entry.fullPath.replace(this.globSymlink.realPath, this.globSymlink.linkPath);
        }
        return entry.fullPath;
      }
      entryPath(entry) {
        return sysPath.join(
          this.watchPath,
          sysPath.relative(this.watchPath, this.checkGlobSymlink(entry))
        );
      }
      filterPath(entry) {
        const { stats } = entry;
        if (stats && stats.isSymbolicLink()) return this.filterDir(entry);
        const resolvedPath = this.entryPath(entry);
        const matchesGlob = this.hasGlob && typeof this.globFilter === FUNCTION_TYPE ? this.globFilter(resolvedPath) : true;
        return matchesGlob && this.fsw._isntIgnored(resolvedPath, stats) && this.fsw._hasReadPermissions(stats);
      }
      getDirParts(path3) {
        if (!this.hasGlob) return [];
        const parts = [];
        const expandedPath = path3.includes(BRACE_START) ? braces.expand(path3) : [path3];
        expandedPath.forEach((path4) => {
          parts.push(sysPath.relative(this.watchPath, path4).split(SLASH_OR_BACK_SLASH_RE));
        });
        return parts;
      }
      filterDir(entry) {
        if (this.hasGlob) {
          const entryParts = this.getDirParts(this.checkGlobSymlink(entry));
          let globstar = false;
          this.unmatchedGlob = !this.dirParts.some((parts) => {
            return parts.every((part, i) => {
              if (part === GLOBSTAR) globstar = true;
              return globstar || !entryParts[0][i] || anymatch(part, entryParts[0][i], ANYMATCH_OPTS);
            });
          });
        }
        return !this.unmatchedGlob && this.fsw._isntIgnored(this.entryPath(entry), entry.stats);
      }
    };
    var FSWatcher = class extends EventEmitter2 {
      // Not indenting methods for history sake; for now.
      constructor(_opts) {
        super();
        const opts = {};
        if (_opts) Object.assign(opts, _opts);
        this._watched = /* @__PURE__ */ new Map();
        this._closers = /* @__PURE__ */ new Map();
        this._ignoredPaths = /* @__PURE__ */ new Set();
        this._throttled = /* @__PURE__ */ new Map();
        this._symlinkPaths = /* @__PURE__ */ new Map();
        this._streams = /* @__PURE__ */ new Set();
        this.closed = false;
        if (undef(opts, "persistent")) opts.persistent = true;
        if (undef(opts, "ignoreInitial")) opts.ignoreInitial = false;
        if (undef(opts, "ignorePermissionErrors")) opts.ignorePermissionErrors = false;
        if (undef(opts, "interval")) opts.interval = 100;
        if (undef(opts, "binaryInterval")) opts.binaryInterval = 300;
        if (undef(opts, "disableGlobbing")) opts.disableGlobbing = false;
        opts.enableBinaryInterval = opts.binaryInterval !== opts.interval;
        if (undef(opts, "useFsEvents")) opts.useFsEvents = !opts.usePolling;
        const canUseFsEvents = FsEventsHandler.canUse();
        if (!canUseFsEvents) opts.useFsEvents = false;
        if (undef(opts, "usePolling") && !opts.useFsEvents) {
          opts.usePolling = isMacos;
        }
        if (isIBMi) {
          opts.usePolling = true;
        }
        const envPoll = process.env.CHOKIDAR_USEPOLLING;
        if (envPoll !== void 0) {
          const envLower = envPoll.toLowerCase();
          if (envLower === "false" || envLower === "0") {
            opts.usePolling = false;
          } else if (envLower === "true" || envLower === "1") {
            opts.usePolling = true;
          } else {
            opts.usePolling = !!envLower;
          }
        }
        const envInterval = process.env.CHOKIDAR_INTERVAL;
        if (envInterval) {
          opts.interval = Number.parseInt(envInterval, 10);
        }
        if (undef(opts, "atomic")) opts.atomic = !opts.usePolling && !opts.useFsEvents;
        if (opts.atomic) this._pendingUnlinks = /* @__PURE__ */ new Map();
        if (undef(opts, "followSymlinks")) opts.followSymlinks = true;
        if (undef(opts, "awaitWriteFinish")) opts.awaitWriteFinish = false;
        if (opts.awaitWriteFinish === true) opts.awaitWriteFinish = {};
        const awf = opts.awaitWriteFinish;
        if (awf) {
          if (!awf.stabilityThreshold) awf.stabilityThreshold = 2e3;
          if (!awf.pollInterval) awf.pollInterval = 100;
          this._pendingWrites = /* @__PURE__ */ new Map();
        }
        if (opts.ignored) opts.ignored = arrify(opts.ignored);
        let readyCalls = 0;
        this._emitReady = () => {
          readyCalls++;
          if (readyCalls >= this._readyCount) {
            this._emitReady = EMPTY_FN;
            this._readyEmitted = true;
            process.nextTick(() => this.emit(EV_READY));
          }
        };
        this._emitRaw = (...args) => this.emit(EV_RAW, ...args);
        this._readyEmitted = false;
        this.options = opts;
        if (opts.useFsEvents) {
          this._fsEventsHandler = new FsEventsHandler(this);
        } else {
          this._nodeFsHandler = new NodeFsHandler(this);
        }
        Object.freeze(opts);
      }
      // Public methods
      /**
       * Adds paths to be watched on an existing FSWatcher instance
       * @param {Path|Array<Path>} paths_
       * @param {String=} _origAdd private; for handling non-existent paths to be watched
       * @param {Boolean=} _internal private; indicates a non-user add
       * @returns {FSWatcher} for chaining
       */
      add(paths_, _origAdd, _internal) {
        const { cwd, disableGlobbing } = this.options;
        this.closed = false;
        let paths = unifyPaths(paths_);
        if (cwd) {
          paths = paths.map((path3) => {
            const absPath = getAbsolutePath(path3, cwd);
            if (disableGlobbing || !isGlob(path3)) {
              return absPath;
            }
            return normalizePath(absPath);
          });
        }
        paths = paths.filter((path3) => {
          if (path3.startsWith(BANG)) {
            this._ignoredPaths.add(path3.slice(1));
            return false;
          }
          this._ignoredPaths.delete(path3);
          this._ignoredPaths.delete(path3 + SLASH_GLOBSTAR);
          this._userIgnored = void 0;
          return true;
        });
        if (this.options.useFsEvents && this._fsEventsHandler) {
          if (!this._readyCount) this._readyCount = paths.length;
          if (this.options.persistent) this._readyCount += paths.length;
          paths.forEach((path3) => this._fsEventsHandler._addToFsEvents(path3));
        } else {
          if (!this._readyCount) this._readyCount = 0;
          this._readyCount += paths.length;
          Promise.all(
            paths.map(async (path3) => {
              const res = await this._nodeFsHandler._addToNodeFs(path3, !_internal, 0, 0, _origAdd);
              if (res) this._emitReady();
              return res;
            })
          ).then((results) => {
            if (this.closed) return;
            results.filter((item) => item).forEach((item) => {
              this.add(sysPath.dirname(item), sysPath.basename(_origAdd || item));
            });
          });
        }
        return this;
      }
      /**
       * Close watchers or start ignoring events from specified paths.
       * @param {Path|Array<Path>} paths_ - string or array of strings, file/directory paths and/or globs
       * @returns {FSWatcher} for chaining
      */
      unwatch(paths_) {
        if (this.closed) return this;
        const paths = unifyPaths(paths_);
        const { cwd } = this.options;
        paths.forEach((path3) => {
          if (!sysPath.isAbsolute(path3) && !this._closers.has(path3)) {
            if (cwd) path3 = sysPath.join(cwd, path3);
            path3 = sysPath.resolve(path3);
          }
          this._closePath(path3);
          this._ignoredPaths.add(path3);
          if (this._watched.has(path3)) {
            this._ignoredPaths.add(path3 + SLASH_GLOBSTAR);
          }
          this._userIgnored = void 0;
        });
        return this;
      }
      /**
       * Close watchers and remove all listeners from watched paths.
       * @returns {Promise<void>}.
      */
      close() {
        if (this.closed) return this._closePromise;
        this.closed = true;
        this.removeAllListeners();
        const closers = [];
        this._closers.forEach((closerList) => closerList.forEach((closer) => {
          const promise = closer();
          if (promise instanceof Promise) closers.push(promise);
        }));
        this._streams.forEach((stream) => stream.destroy());
        this._userIgnored = void 0;
        this._readyCount = 0;
        this._readyEmitted = false;
        this._watched.forEach((dirent) => dirent.dispose());
        ["closers", "watched", "streams", "symlinkPaths", "throttled"].forEach((key) => {
          this[`_${key}`].clear();
        });
        this._closePromise = closers.length ? Promise.all(closers).then(() => void 0) : Promise.resolve();
        return this._closePromise;
      }
      /**
       * Expose list of watched paths
       * @returns {Object} for chaining
      */
      getWatched() {
        const watchList = {};
        this._watched.forEach((entry, dir) => {
          const key = this.options.cwd ? sysPath.relative(this.options.cwd, dir) : dir;
          watchList[key || ONE_DOT] = entry.getChildren().sort();
        });
        return watchList;
      }
      emitWithAll(event, args) {
        this.emit(...args);
        if (event !== EV_ERROR) this.emit(EV_ALL, ...args);
      }
      // Common helpers
      // --------------
      /**
       * Normalize and emit events.
       * Calling _emit DOES NOT MEAN emit() would be called!
       * @param {EventName} event Type of event
       * @param {Path} path File or directory path
       * @param {*=} val1 arguments to be passed with event
       * @param {*=} val2
       * @param {*=} val3
       * @returns the error if defined, otherwise the value of the FSWatcher instance's `closed` flag
       */
      async _emit(event, path3, val1, val2, val3) {
        if (this.closed) return;
        const opts = this.options;
        if (isWindows) path3 = sysPath.normalize(path3);
        if (opts.cwd) path3 = sysPath.relative(opts.cwd, path3);
        const args = [event, path3];
        if (val3 !== void 0) args.push(val1, val2, val3);
        else if (val2 !== void 0) args.push(val1, val2);
        else if (val1 !== void 0) args.push(val1);
        const awf = opts.awaitWriteFinish;
        let pw;
        if (awf && (pw = this._pendingWrites.get(path3))) {
          pw.lastChange = /* @__PURE__ */ new Date();
          return this;
        }
        if (opts.atomic) {
          if (event === EV_UNLINK) {
            this._pendingUnlinks.set(path3, args);
            setTimeout(() => {
              this._pendingUnlinks.forEach((entry, path4) => {
                this.emit(...entry);
                this.emit(EV_ALL, ...entry);
                this._pendingUnlinks.delete(path4);
              });
            }, typeof opts.atomic === "number" ? opts.atomic : 100);
            return this;
          }
          if (event === EV_ADD && this._pendingUnlinks.has(path3)) {
            event = args[0] = EV_CHANGE;
            this._pendingUnlinks.delete(path3);
          }
        }
        if (awf && (event === EV_ADD || event === EV_CHANGE) && this._readyEmitted) {
          const awfEmit = (err, stats) => {
            if (err) {
              event = args[0] = EV_ERROR;
              args[1] = err;
              this.emitWithAll(event, args);
            } else if (stats) {
              if (args.length > 2) {
                args[2] = stats;
              } else {
                args.push(stats);
              }
              this.emitWithAll(event, args);
            }
          };
          this._awaitWriteFinish(path3, awf.stabilityThreshold, event, awfEmit);
          return this;
        }
        if (event === EV_CHANGE) {
          const isThrottled = !this._throttle(EV_CHANGE, path3, 50);
          if (isThrottled) return this;
        }
        if (opts.alwaysStat && val1 === void 0 && (event === EV_ADD || event === EV_ADD_DIR || event === EV_CHANGE)) {
          const fullPath = opts.cwd ? sysPath.join(opts.cwd, path3) : path3;
          let stats;
          try {
            stats = await stat(fullPath);
          } catch (err) {
          }
          if (!stats || this.closed) return;
          args.push(stats);
        }
        this.emitWithAll(event, args);
        return this;
      }
      /**
       * Common handler for errors
       * @param {Error} error
       * @returns {Error|Boolean} The error if defined, otherwise the value of the FSWatcher instance's `closed` flag
       */
      _handleError(error) {
        const code = error && error.code;
        if (error && code !== "ENOENT" && code !== "ENOTDIR" && (!this.options.ignorePermissionErrors || code !== "EPERM" && code !== "EACCES")) {
          this.emit(EV_ERROR, error);
        }
        return error || this.closed;
      }
      /**
       * Helper utility for throttling
       * @param {ThrottleType} actionType type being throttled
       * @param {Path} path being acted upon
       * @param {Number} timeout duration of time to suppress duplicate actions
       * @returns {Object|false} tracking object or false if action should be suppressed
       */
      _throttle(actionType, path3, timeout) {
        if (!this._throttled.has(actionType)) {
          this._throttled.set(actionType, /* @__PURE__ */ new Map());
        }
        const action = this._throttled.get(actionType);
        const actionPath = action.get(path3);
        if (actionPath) {
          actionPath.count++;
          return false;
        }
        let timeoutObject;
        const clear = () => {
          const item = action.get(path3);
          const count = item ? item.count : 0;
          action.delete(path3);
          clearTimeout(timeoutObject);
          if (item) clearTimeout(item.timeoutObject);
          return count;
        };
        timeoutObject = setTimeout(clear, timeout);
        const thr = { timeoutObject, clear, count: 0 };
        action.set(path3, thr);
        return thr;
      }
      _incrReadyCount() {
        return this._readyCount++;
      }
      /**
       * Awaits write operation to finish.
       * Polls a newly created file for size variations. When files size does not change for 'threshold' milliseconds calls callback.
       * @param {Path} path being acted upon
       * @param {Number} threshold Time in milliseconds a file size must be fixed before acknowledging write OP is finished
       * @param {EventName} event
       * @param {Function} awfEmit Callback to be called when ready for event to be emitted.
       */
      _awaitWriteFinish(path3, threshold, event, awfEmit) {
        let timeoutHandler;
        let fullPath = path3;
        if (this.options.cwd && !sysPath.isAbsolute(path3)) {
          fullPath = sysPath.join(this.options.cwd, path3);
        }
        const now = /* @__PURE__ */ new Date();
        const awaitWriteFinish = (prevStat) => {
          fs2.stat(fullPath, (err, curStat) => {
            if (err || !this._pendingWrites.has(path3)) {
              if (err && err.code !== "ENOENT") awfEmit(err);
              return;
            }
            const now2 = Number(/* @__PURE__ */ new Date());
            if (prevStat && curStat.size !== prevStat.size) {
              this._pendingWrites.get(path3).lastChange = now2;
            }
            const pw = this._pendingWrites.get(path3);
            const df = now2 - pw.lastChange;
            if (df >= threshold) {
              this._pendingWrites.delete(path3);
              awfEmit(void 0, curStat);
            } else {
              timeoutHandler = setTimeout(
                awaitWriteFinish,
                this.options.awaitWriteFinish.pollInterval,
                curStat
              );
            }
          });
        };
        if (!this._pendingWrites.has(path3)) {
          this._pendingWrites.set(path3, {
            lastChange: now,
            cancelWait: () => {
              this._pendingWrites.delete(path3);
              clearTimeout(timeoutHandler);
              return event;
            }
          });
          timeoutHandler = setTimeout(
            awaitWriteFinish,
            this.options.awaitWriteFinish.pollInterval
          );
        }
      }
      _getGlobIgnored() {
        return [...this._ignoredPaths.values()];
      }
      /**
       * Determines whether user has asked to ignore this path.
       * @param {Path} path filepath or dir
       * @param {fs.Stats=} stats result of fs.stat
       * @returns {Boolean}
       */
      _isIgnored(path3, stats) {
        if (this.options.atomic && DOT_RE.test(path3)) return true;
        if (!this._userIgnored) {
          const { cwd } = this.options;
          const ign = this.options.ignored;
          const ignored = ign && ign.map(normalizeIgnored(cwd));
          const paths = arrify(ignored).filter((path4) => typeof path4 === STRING_TYPE && !isGlob(path4)).map((path4) => path4 + SLASH_GLOBSTAR);
          const list = this._getGlobIgnored().map(normalizeIgnored(cwd)).concat(ignored, paths);
          this._userIgnored = anymatch(list, void 0, ANYMATCH_OPTS);
        }
        return this._userIgnored([path3, stats]);
      }
      _isntIgnored(path3, stat2) {
        return !this._isIgnored(path3, stat2);
      }
      /**
       * Provides a set of common helpers and properties relating to symlink and glob handling.
       * @param {Path} path file, directory, or glob pattern being watched
       * @param {Number=} depth at any depth > 0, this isn't a glob
       * @returns {WatchHelper} object containing helpers for this path
       */
      _getWatchHelpers(path3, depth) {
        const watchPath = depth || this.options.disableGlobbing || !isGlob(path3) ? path3 : globParent(path3);
        const follow = this.options.followSymlinks;
        return new WatchHelper(path3, watchPath, follow, this);
      }
      // Directory helpers
      // -----------------
      /**
       * Provides directory tracking objects
       * @param {String} directory path of the directory
       * @returns {DirEntry} the directory's tracking object
       */
      _getWatchedDir(directory) {
        if (!this._boundRemove) this._boundRemove = this._remove.bind(this);
        const dir = sysPath.resolve(directory);
        if (!this._watched.has(dir)) this._watched.set(dir, new DirEntry(dir, this._boundRemove));
        return this._watched.get(dir);
      }
      // File helpers
      // ------------
      /**
       * Check for read permissions.
       * Based on this answer on SO: https://stackoverflow.com/a/11781404/1358405
       * @param {fs.Stats} stats - object, result of fs_stat
       * @returns {Boolean} indicates whether the file can be read
      */
      _hasReadPermissions(stats) {
        if (this.options.ignorePermissionErrors) return true;
        const md = stats && Number.parseInt(stats.mode, 10);
        const st = md & 511;
        const it = Number.parseInt(st.toString(8)[0], 10);
        return Boolean(4 & it);
      }
      /**
       * Handles emitting unlink events for
       * files and directories, and via recursion, for
       * files and directories within directories that are unlinked
       * @param {String} directory within which the following item is located
       * @param {String} item      base path of item/directory
       * @returns {void}
      */
      _remove(directory, item, isDirectory) {
        const path3 = sysPath.join(directory, item);
        const fullPath = sysPath.resolve(path3);
        isDirectory = isDirectory != null ? isDirectory : this._watched.has(path3) || this._watched.has(fullPath);
        if (!this._throttle("remove", path3, 100)) return;
        if (!isDirectory && !this.options.useFsEvents && this._watched.size === 1) {
          this.add(directory, item, true);
        }
        const wp = this._getWatchedDir(path3);
        const nestedDirectoryChildren = wp.getChildren();
        nestedDirectoryChildren.forEach((nested) => this._remove(path3, nested));
        const parent = this._getWatchedDir(directory);
        const wasTracked = parent.has(item);
        parent.remove(item);
        if (this._symlinkPaths.has(fullPath)) {
          this._symlinkPaths.delete(fullPath);
        }
        let relPath = path3;
        if (this.options.cwd) relPath = sysPath.relative(this.options.cwd, path3);
        if (this.options.awaitWriteFinish && this._pendingWrites.has(relPath)) {
          const event = this._pendingWrites.get(relPath).cancelWait();
          if (event === EV_ADD) return;
        }
        this._watched.delete(path3);
        this._watched.delete(fullPath);
        const eventName = isDirectory ? EV_UNLINK_DIR : EV_UNLINK;
        if (wasTracked && !this._isIgnored(path3)) this._emit(eventName, path3);
        if (!this.options.useFsEvents) {
          this._closePath(path3);
        }
      }
      /**
       * Closes all watchers for a path
       * @param {Path} path
       */
      _closePath(path3) {
        this._closeFile(path3);
        const dir = sysPath.dirname(path3);
        this._getWatchedDir(dir).remove(sysPath.basename(path3));
      }
      /**
       * Closes only file-specific watchers
       * @param {Path} path
       */
      _closeFile(path3) {
        const closers = this._closers.get(path3);
        if (!closers) return;
        closers.forEach((closer) => closer());
        this._closers.delete(path3);
      }
      /**
       *
       * @param {Path} path
       * @param {Function} closer
       */
      _addPathCloser(path3, closer) {
        if (!closer) return;
        let list = this._closers.get(path3);
        if (!list) {
          list = [];
          this._closers.set(path3, list);
        }
        list.push(closer);
      }
      _readdirp(root, opts) {
        if (this.closed) return;
        const options = { type: EV_ALL, alwaysStat: true, lstat: true, ...opts };
        let stream = readdirp(root, options);
        this._streams.add(stream);
        stream.once(STR_CLOSE, () => {
          stream = void 0;
        });
        stream.once(STR_END, () => {
          if (stream) {
            this._streams.delete(stream);
            stream = void 0;
          }
        });
        return stream;
      }
    };
    exports2.FSWatcher = FSWatcher;
    var watch = (paths, options) => {
      const watcher = new FSWatcher(options);
      watcher.add(paths);
      return watcher;
    };
    exports2.watch = watch;
  }
});

// packages/playwright-core/src/serverRegistry.ts
var serverRegistry_exports = {};
__export(serverRegistry_exports, {
  serverRegistry: () => serverRegistry
});
module.exports = __toCommonJS(serverRegistry_exports);
var import_events = require("events");
var import_fs = __toESM(require("fs"));
var import_net = __toESM(require("net"));
var import_path2 = __toESM(require("path"));
var import_os = __toESM(require("os"));
var import_chokidar = __toESM(require_chokidar());

// packages/playwright-core/src/package.ts
var import_path = __toESM(require("path"));
var packageRoot = import_path.default.join(__dirname, "..");
var packageJSON = require(import_path.default.join(packageRoot, "package.json"));
var binPath = import_path.default.join(packageRoot, "bin");

// packages/playwright-core/src/serverRegistry.ts
var packageVersion = packageJSON.version;
var ServerRegistry = class extends import_events.EventEmitter {
  constructor() {
    super(...arguments);
    this._descriptors = /* @__PURE__ */ new Map();
    this._watcherRefs = 0;
  }
  on(event, listener) {
    return super.on(event, listener);
  }
  off(event, listener) {
    return super.off(event, listener);
  }
  watch() {
    this._watcherRefs++;
    if (!this._watcher)
      this._startWatcher();
    let disposed = false;
    return () => {
      if (disposed)
        return;
      disposed = true;
      this._watcherRefs--;
      if (this._watcherRefs === 0)
        this._stopWatcher();
    };
  }
  ready() {
    return this._ready ?? Promise.resolve();
  }
  async list() {
    const ownWatcher = !this._watcher;
    let dispose;
    if (ownWatcher)
      dispose = this.watch();
    try {
      await this._ready;
      const statuses = await Promise.all(
        [...this._descriptors.values()].map(async (descriptor) => {
          const canConnect = await canConnectTo(descriptor);
          return { descriptor, canConnect };
        })
      );
      const result = /* @__PURE__ */ new Map();
      for (const { descriptor, canConnect } of statuses) {
        if (!canConnect) {
          await import_fs.default.promises.unlink(import_path2.default.join(this._browsersDir(), descriptor.browser.guid)).catch(() => {
          });
          continue;
        }
        const key = descriptor.workspaceDir ?? "";
        let list = result.get(key);
        if (!list) {
          list = [];
          result.set(key, list);
        }
        list.push(descriptor);
      }
      return result;
    } finally {
      dispose?.();
    }
  }
  async create(browser, endpoint) {
    const file = import_path2.default.join(this._browsersDir(), browser.guid);
    await import_fs.default.promises.mkdir(this._browsersDir(), { recursive: true });
    const descriptor = {
      playwrightVersion: packageVersion,
      playwrightLib: packageRoot,
      title: endpoint.title,
      browser,
      endpoint: endpoint.endpoint,
      workspaceDir: endpoint.workspaceDir
    };
    await import_fs.default.promises.writeFile(file, JSON.stringify(descriptor, null, 2), "utf-8");
  }
  async delete(guid) {
    const file = import_path2.default.join(this._browsersDir(), guid);
    await import_fs.default.promises.unlink(file).catch(() => {
    });
  }
  async deleteUserData(guid) {
    const filePath = import_path2.default.join(this._browsersDir(), guid);
    const content = await import_fs.default.promises.readFile(filePath, "utf-8");
    const descriptor = JSON.parse(content);
    if (descriptor.browser.userDataDir)
      await import_fs.default.promises.rm(descriptor.browser.userDataDir, { recursive: true, force: true });
    await import_fs.default.promises.unlink(filePath);
  }
  readDescriptor(guid) {
    const cached = this._descriptors.get(guid);
    if (cached)
      return cached;
    const filePath = import_path2.default.join(this._browsersDir(), guid);
    const content = import_fs.default.readFileSync(filePath, "utf-8");
    return JSON.parse(content);
  }
  async find(name) {
    const entries = await this.list();
    for (const [, browsers] of entries) {
      for (const browser of browsers) {
        if (browser.title === name)
          return browser;
      }
    }
    return null;
  }
  _browsersDir() {
    return process.env.PWTEST_SERVER_REGISTRY || registryDirectory;
  }
  _startWatcher() {
    const dir = this._browsersDir();
    try {
      import_fs.default.mkdirSync(dir, { recursive: true });
    } catch {
    }
    const watcher = import_chokidar.default.watch(dir, {
      ignoreInitial: false,
      depth: 0,
      awaitWriteFinish: { stabilityThreshold: 50, pollInterval: 20 }
    });
    this._watcher = watcher;
    this._ready = new Promise((resolve, reject) => {
      watcher.once("ready", () => resolve());
      watcher.once("error", reject);
    });
    watcher.on("add", (file) => this._onAddOrChange(file, "added"));
    watcher.on("change", (file) => this._onAddOrChange(file, "changed"));
    watcher.on("unlink", (file) => {
      const guid = import_path2.default.basename(file);
      if (this._descriptors.delete(guid))
        this.emit("removed", guid);
    });
  }
  _onAddOrChange(file, event) {
    const guid = import_path2.default.basename(file);
    let descriptor;
    try {
      descriptor = JSON.parse(import_fs.default.readFileSync(file, "utf-8"));
    } catch {
      return;
    }
    this._descriptors.set(guid, descriptor);
    this.emit(event, descriptor);
  }
  _stopWatcher() {
    const watcher = this._watcher;
    this._watcher = void 0;
    this._ready = void 0;
    this._descriptors.clear();
    void watcher?.close();
  }
};
async function canConnectTo(descriptor) {
  if (!descriptor.endpoint)
    return false;
  if (descriptor.endpoint.startsWith("ws://") || descriptor.endpoint.startsWith("wss://")) {
    return await new Promise((resolve) => {
      const url = new URL(descriptor.endpoint);
      const socket = import_net.default.createConnection(Number(url.port), url.hostname, () => {
        socket.destroy();
        resolve(true);
      });
      socket.on("error", () => resolve(false));
    });
  }
  return await new Promise((resolve) => {
    const socket = import_net.default.createConnection(descriptor.endpoint ?? descriptor.pipeName, () => {
      socket.destroy();
      resolve(true);
    });
    socket.on("error", () => resolve(false));
  });
}
var defaultCacheDirectory = (() => {
  if (process.platform === "linux")
    return process.env.XDG_CACHE_HOME || import_path2.default.join(import_os.default.homedir(), ".cache");
  if (process.platform === "darwin")
    return import_path2.default.join(import_os.default.homedir(), "Library", "Caches");
  if (process.platform === "win32")
    return process.env.LOCALAPPDATA || import_path2.default.join(import_os.default.homedir(), "AppData", "Local");
  throw new Error("Unsupported platform: " + process.platform);
})();
var registryDirectory = import_path2.default.join(defaultCacheDirectory, "ms-playwright", "b");
var serverRegistry = new ServerRegistry();
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  serverRegistry
});
/*! Bundled license information:

normalize-path/index.js:
  (*!
   * normalize-path <https://github.com/jonschlinkert/normalize-path>
   *
   * Copyright (c) 2014-2018, Jon Schlinkert.
   * Released under the MIT License.
   *)

is-extglob/index.js:
  (*!
   * is-extglob <https://github.com/jonschlinkert/is-extglob>
   *
   * Copyright (c) 2014-2016, Jon Schlinkert.
   * Licensed under the MIT License.
   *)

is-glob/index.js:
  (*!
   * is-glob <https://github.com/jonschlinkert/is-glob>
   *
   * Copyright (c) 2014-2017, Jon Schlinkert.
   * Released under the MIT License.
   *)

is-number/index.js:
  (*!
   * is-number <https://github.com/jonschlinkert/is-number>
   *
   * Copyright (c) 2014-present, Jon Schlinkert.
   * Released under the MIT License.
   *)

to-regex-range/index.js:
  (*!
   * to-regex-range <https://github.com/micromatch/to-regex-range>
   *
   * Copyright (c) 2015-present, Jon Schlinkert.
   * Released under the MIT License.
   *)

fill-range/index.js:
  (*!
   * fill-range <https://github.com/jonschlinkert/fill-range>
   *
   * Copyright (c) 2014-present, Jon Schlinkert.
   * Licensed under the MIT License.
   *)
*/
packages/playwright-core/lib/serverRegistry.js

THIRD-PARTY SOFTWARE NOTICES AND INFORMATION

The following npm packages are inlined into this bundle.

- anymatch@3.1.3 (https://github.com/micromatch/anymatch)
- binary-extensions@2.3.0 (https://github.com/sindresorhus/binary-extensions)
- braces@3.0.3 (https://github.com/micromatch/braces)
- chokidar@3.6.0 (https://github.com/paulmillr/chokidar)
- fill-range@7.1.1 (https://github.com/jonschlinkert/fill-range)
- glob-parent@5.1.2 (https://github.com/gulpjs/glob-parent)
- is-binary-path@2.1.0 (https://github.com/sindresorhus/is-binary-path)
- is-extglob@2.1.1 (https://github.com/jonschlinkert/is-extglob)
- is-glob@4.0.3 (https://github.com/micromatch/is-glob)
- is-number@7.0.0 (https://github.com/jonschlinkert/is-number)
- normalize-path@3.0.0 (https://github.com/jonschlinkert/normalize-path)
- picomatch@2.3.2 (https://github.com/micromatch/picomatch)
- readdirp@3.6.0 (https://github.com/paulmillr/readdirp)
- to-regex-range@5.0.1 (https://github.com/micromatch/to-regex-range)

%% anymatch@3.1.3 NOTICES AND INFORMATION BEGIN HERE
=========================================
The ISC License

Copyright (c) 2019 Elan Shanker, Paul Miller (https://paulmillr.com)

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
=========================================
END OF anymatch@3.1.3 NOTICES AND INFORMATION

%% binary-extensions@2.3.0 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License

Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
Copyright (c) Paul Miller (https://paulmillr.com)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF binary-extensions@2.3.0 NOTICES AND INFORMATION

%% braces@3.0.3 NOTICES AND INFORMATION BEGIN HERE
=========================================
The MIT License (MIT)

Copyright (c) 2014-present, Jon Schlinkert.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
=========================================
END OF braces@3.0.3 NOTICES AND INFORMATION

%% chokidar@3.6.0 NOTICES AND INFORMATION BEGIN HERE
=========================================
The MIT License (MIT)

Copyright (c) 2012-2019 Paul Miller (https://paulmillr.com), Elan Shanker

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the â€œSoftwareâ€�), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED â€œAS ISâ€�, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
=========================================
END OF chokidar@3.6.0 NOTICES AND INFORMATION

%% fill-range@7.1.1 NOTICES AND INFORMATION BEGIN HERE
=========================================
The MIT License (MIT)

Copyright (c) 2014-present, Jon Schlinkert.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
=========================================
END OF fill-range@7.1.1 NOTICES AND INFORMATION

%% glob-parent@5.1.2 NOTICES AND INFORMATION BEGIN HERE
=========================================
The ISC License

Copyright (c) 2015, 2019 Elan Shanker

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
=========================================
END OF glob-parent@5.1.2 NOTICES AND INFORMATION

%% is-binary-path@2.1.0 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License

Copyright (c) 2019 Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com), Paul Miller (https://paulmillr.com)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF is-binary-path@2.1.0 NOTICES AND INFORMATION

%% is-extglob@2.1.1 NOTICES AND INFORMATION BEGIN HERE
=========================================
The MIT License (MIT)

Copyright (c) 2014-2016, Jon Schlinkert

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
=========================================
END OF is-extglob@2.1.1 NOTICES AND INFORMATION

%% is-glob@4.0.3 NOTICES AND INFORMATION BEGIN HERE
=========================================
The MIT License (MIT)

Copyright (c) 2014-2017, Jon Schlinkert.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
=========================================
END OF is-glob@4.0.3 NOTICES AND INFORMATION

%% is-number@7.0.0 NOTICES AND INFORMATION BEGIN HERE
=========================================
The MIT License (MIT)

Copyright (c) 2014-present, Jon Schlinkert.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
=========================================
END OF is-number@7.0.0 NOTICES AND INFORMATION

%% normalize-path@3.0.0 NOTICES AND INFORMATION BEGIN HERE
=========================================
The MIT License (MIT)

Copyright (c) 2014-2018, Jon Schlinkert.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
=========================================
END OF normalize-path@3.0.0 NOTICES AND INFORMATION

%% picomatch@2.3.2 NOTICES AND INFORMATION BEGIN HERE
=========================================
The MIT License (MIT)

Copyright (c) 2017-present, Jon Schlinkert.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
=========================================
END OF picomatch@2.3.2 NOTICES AND INFORMATION

%% readdirp@3.6.0 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License

Copyright (c) 2012-2019 Thorsten Lorenz, Paul Miller (https://paulmillr.com)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
=========================================
END OF readdirp@3.6.0 NOTICES AND INFORMATION

%% to-regex-range@5.0.1 NOTICES AND INFORMATION BEGIN HERE
=========================================
The MIT License (MIT)

Copyright (c) 2015-present, Jon Schlinkert.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
=========================================
END OF to-regex-range@5.0.1 NOTICES AND INFORMATION

SUMMARY
=========================================
Total Packages: 14
========================================="use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  // If the importer is in node compatibility mode or this is not an ESM
  // file that has been converted to a CommonJS file using a Babel-
  // compatible transform (i.e. "__esModule" has not been set), then set
  // "default" to the CommonJS "module.exports" for node compatibility.
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var channelSessions_exports = {};
__export(channelSessions_exports, {
  isKnownChannel: () => isKnownChannel,
  listChannelSessions: () => listChannelSessions
});
module.exports = __toCommonJS(channelSessions_exports);
var import_fs = __toESM(require("fs"));
var import_net = __toESM(require("net"));
var import_os = __toESM(require("os"));
var import_path = __toESM(require("path"));
var import_extension = require("../utils/extension");
function isKnownChannel(name) {
  return channelToUserDataDir.has(name);
}
async function listChannelSessions() {
  if (process.env.PWTEST_CLI_CHANNEL_SCAN_DISABLED_FOR_TEST)
    return [];
  const result = [];
  for (const [channel, dirs] of channelToUserDataDir) {
    const userDataDir = dirs[process.platform];
    if (!userDataDir)
      continue;
    if (!await pathExists(userDataDir))
      continue;
    const [endpoint, extensionInstalled] = await Promise.all([
      readEndpoint(userDataDir),
      (0, import_extension.isPlaywrightExtensionInstalled)(userDataDir)
    ]);
    result.push({ channel, userDataDir, endpoint, extensionInstalled });
  }
  return result;
}
async function pathExists(p) {
  try {
    await import_fs.default.promises.access(p);
    return true;
  } catch {
    return false;
  }
}
async function readEndpoint(userDataDir) {
  let contents;
  try {
    contents = await import_fs.default.promises.readFile(import_path.default.join(userDataDir, "DevToolsActivePort"), "utf-8");
  } catch {
    return void 0;
  }
  const port = parseInt(contents.trim().split("\n")[0], 10);
  if (!Number.isFinite(port))
    return void 0;
  if (!await isPortOpen(port))
    return void 0;
  return `http://localhost:${port}`;
}
async function isPortOpen(port) {
  return new Promise((resolve) => {
    const socket = import_net.default.createConnection(port, "127.0.0.1");
    const done = (value) => {
      socket.destroy();
      resolve(value);
    };
    socket.once("connect", () => done(true));
    socket.once("error", () => done(false));
    socket.setTimeout(250, () => done(false));
  });
}
const channelToUserDataDir = /* @__PURE__ */ new Map([
  ["chrome", {
    "linux": import_path.default.join(import_os.default.homedir(), ".config", "google-chrome"),
    "darwin": import_path.default.join(import_os.default.homedir(), "Library", "Application Support", "Google", "Chrome"),
    "win32": import_path.default.join(process.env.LOCALAPPDATA || import_path.default.join(import_os.default.homedir(), "AppData", "Local"), "Google", "Chrome", "User Data")
  }],
  ["chrome-beta", {
    "linux": import_path.default.join(import_os.default.homedir(), ".config", "google-chrome-beta"),
    "darwin": import_path.default.join(import_os.default.homedir(), "Library", "Application Support", "Google", "Chrome Beta"),
    "win32": import_path.default.join(process.env.LOCALAPPDATA || import_path.default.join(import_os.default.homedir(), "AppData", "Local"), "Google", "Chrome Beta", "User Data")
  }],
  ["chrome-dev", {
    "linux": import_path.default.join(import_os.default.homedir(), ".config", "google-chrome-unstable"),
    "darwin": import_path.default.join(import_os.default.homedir(), "Library", "Application Support", "Google", "Chrome Dev"),
    "win32": import_path.default.join(process.env.LOCALAPPDATA || import_path.default.join(import_os.default.homedir(), "AppData", "Local"), "Google", "Chrome Dev", "User Data")
  }],
  ["chrome-canary", {
    "linux": import_path.default.join(import_os.default.homedir(), ".config", "google-chrome-canary"),
    "darwin": import_path.default.join(import_os.default.homedir(), "Library", "Application Support", "Google", "Chrome Canary"),
    "win32": import_path.default.join(process.env.LOCALAPPDATA || import_path.default.join(import_os.default.homedir(), "AppData", "Local"), "Google", "Chrome SxS", "User Data")
  }],
  ["msedge", {
    "linux": import_path.default.join(import_os.default.homedir(), ".config", "microsoft-edge"),
    "darwin": import_path.default.join(import_os.default.homedir(), "Library", "Application Support", "Microsoft Edge"),
    "win32": import_path.default.join(process.env.LOCALAPPDATA || import_path.default.join(import_os.default.homedir(), "AppData", "Local"), "Microsoft", "Edge", "User Data")
  }],
  ["msedge-beta", {
    "linux": import_path.default.join(import_os.default.homedir(), ".config", "microsoft-edge-beta"),
    "darwin": import_path.default.join(import_os.default.homedir(), "Library", "Application Support", "Microsoft Edge Beta"),
    "win32": import_path.default.join(process.env.LOCALAPPDATA || import_path.default.join(import_os.default.homedir(), "AppData", "Local"), "Microsoft", "Edge Beta", "User Data")
  }],
  ["msedge-dev", {
    "linux": import_path.default.join(import_os.default.homedir(), ".config", "microsoft-edge-dev"),
    "darwin": import_path.default.join(import_os.default.homedir(), "Library", "Application Support", "Microsoft Edge Dev"),
    "win32": import_path.default.join(process.env.LOCALAPPDATA || import_path.default.join(import_os.default.homedir(), "AppData", "Local"), "Microsoft", "Edge Dev", "User Data")
  }],
  ["msedge-canary", {
    "linux": import_path.default.join(import_os.default.homedir(), ".config", "microsoft-edge-canary"),
    "darwin": import_path.default.join(import_os.default.homedir(), "Library", "Application Support", "Microsoft Edge Canary"),
    "win32": import_path.default.join(process.env.LOCALAPPDATA || import_path.default.join(import_os.default.homedir(), "AppData", "Local"), "Microsoft", "Edge SxS", "User Data")
  }]
]);
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  isKnownChannel,
  listChannelSessions
});
"use strict";
var import_program = require("./program");
(0, import_program.program)().catch((e) => {
  console.error(e.message);
  process.exit(1);
});
{
  "global": "Usage: playwright-cli <command> [args] [options]\nUsage: playwright-cli -s=<session> <command> [args] [options]\n\nCore:\n  open [url]                  open the browser\n  attach [name]               attach to a running playwright browser\n  close                       close the browser\n  detach                      detach from an attached browser\n  goto <url>                  navigate to a url\n  type <text>                 type text into editable element\n  click <target> [button]     perform click on a web page\n  dblclick <target> [button]  perform double click on a web page\n  fill <target> <text>        fill text into editable element\n  drag <startTarget> <endTarget> perform drag and drop between two elements\n  drop <target>               drop files or data onto an element\n  hover <target>              hover over element on page\n  select <target> <val>       select an option in a dropdown\n  upload <file>               upload one or multiple files\n  check <target>              check a checkbox or radio button\n  uncheck <target>            uncheck a checkbox or radio button\n  snapshot [target]           capture page snapshot to obtain element ref\n  eval <func> [target]        evaluate javascript expression on page or element\n  dialog-accept [prompt]      accept a dialog\n  dialog-dismiss              dismiss a dialog\n  resize <w> <h>              resize the browser window\n  delete-data                 delete session data\n\nNavigation:\n  go-back                     go back to the previous page\n  go-forward                  go forward to the next page\n  reload                      reload the current page\n\nKeyboard:\n  press <key>                 press a key on the keyboard, `a`, `arrowleft`\n  keydown <key>               press a key down on the keyboard\n  keyup <key>                 press a key up on the keyboard\n\nMouse:\n  mousemove <x> <y>           move mouse to a given position\n  mousedown [button]          press mouse down\n  mouseup [button]            press mouse up\n  mousewheel <dx> <dy>        scroll mouse wheel\n\nSave as:\n  screenshot [target]         screenshot of the current page or element\n  pdf                         save page as pdf\n\nTabs:\n  tab-list                    list all tabs\n  tab-new [url]               create a new tab\n  tab-close [index]           close a browser tab\n  tab-select <index>          select a browser tab\n\nStorage:\n  state-load <filename>       loads browser storage (authentication) state from a file\n  state-save [filename]       saves the current storage (authentication) state to a file\n  cookie-list                 list all cookies (optionally filtered by domain/path)\n  cookie-get <name>           get a specific cookie by name\n  cookie-set <name> <value>   set a cookie with optional flags\n  cookie-delete <name>        delete a specific cookie\n  cookie-clear                clear all cookies\n  localstorage-list           list all localstorage key-value pairs\n  localstorage-get <key>      get a localstorage item by key\n  localstorage-set <key> <value> set a localstorage item\n  localstorage-delete <key>   delete a localstorage item\n  localstorage-clear          clear all localstorage\n  sessionstorage-list         list all sessionstorage key-value pairs\n  sessionstorage-get <key>    get a sessionstorage item by key\n  sessionstorage-set <key> <value> set a sessionstorage item\n  sessionstorage-delete <key> delete a sessionstorage item\n  sessionstorage-clear        clear all sessionstorage\n\nNetwork:\n  requests                    list all network requests since loading the page. each request is numbered for use with the `request` command.\n  request <index>             show full details (headers, body, response) of a single network request by its number from the `requests` command.\n  request-headers <index>     print only the request headers for a single network request by its number from the `requests` command.\n  request-body <index>        print only the request body for a single network request by its number from the `requests` command.\n  response-headers <index>    print only the response headers for a single network request by its number from the `requests` command.\n  response-body <index>       print the response body for a single network request by its number from the `requests` command. textual bodies are inlined; binary bodies are saved to a file and the path is printed.\n  route <pattern>             mock network requests matching a url pattern\n  route-list                  list all active network routes\n  unroute [pattern]           remove routes matching a pattern (or all routes)\n  network-state-set <state>   set the browser network state to online or offline\n\nDevTools:\n  console [min-level]         list console messages\n  run-code [code]             run playwright code snippet\n  tracing-start               start trace recording\n  tracing-stop                stop trace recording\n  video-start [filename]      start video recording\n  video-stop                  stop video recording\n  video-chapter <title>       add a chapter marker to the video recording\n  video-show-actions          annotate subsequent cli/mcp actions on the page with a callout that names the action and highlights the target element\n  video-hide-actions          stop annotating actions performed on the page\n  show                        show playwright dashboard\n  pause-at <location>         run the test up to a specific location and pause there\n  resume                      resume the test execution\n  step-over                   step over the next call in the test\n  generate-locator <target>   generate a playwright locator for the given element\n  highlight [target]          show (or with --hide, remove) a highlight overlay for an element; `--hide` without a target hides all page highlights.\n\nInstall:\n  install                     initialize workspace\n  install-browser [browser]   install browser\n\nBrowser sessions:\n  list                        list browser sessions\n  close-all                   close all browser sessions\n  kill-all                    forcefully kill all browser sessions (for stale/zombie processes)\n\nGlobal options:\n  --help [command]            print help\n  --json                      output response as JSON\n  --raw                       output only the result value, without status and code\n  --version                   print version",
  "commands": {
    "open": {
      "help": "playwright-cli open [url]\n\nOpen the browser\n\nArguments:\n  [url]                       the url to navigate to\nOptions:\n  --browser                   browser or chrome channel to use, possible values: chrome, firefox, webkit, msedge.\n  --config                    path to the configuration file, defaults to .playwright/cli.config.json\n  --headed                    run browser in headed mode\n  --persistent                use persistent browser profile\n  --profile                   path to a persistent user data directory.",
      "flags": {
        "browser": "string",
        "config": "string",
        "headed": "boolean",
        "persistent": "boolean",
        "profile": "string"
      },
      "args": [
        "url"
      ]
    },
    "attach": {
      "help": "playwright-cli attach [name]\n\nAttach to a running Playwright browser\n\nArguments:\n  [name]                      bound browser name to attach to\nOptions:\n  --cdp                       connect to an existing browser via cdp endpoint url.\n  --endpoint                  playwright browser server endpoint to attach to.\n  --extension                 connect to browser extension, optionally specify browser name (e.g. --extension=chrome)\n  --config                    path to the configuration file, defaults to .playwright/cli.config.json\n  --session                   session name (defaults to bound browser name or \"default\")",
      "flags": {
        "cdp": "string",
        "endpoint": "string",
        "extension": "string",
        "config": "string",
        "session": "string"
      },
      "args": [
        "name"
      ]
    },
    "close": {
      "help": "playwright-cli close \n\nClose the browser\n",
      "flags": {},
      "args": []
    },
    "detach": {
      "help": "playwright-cli detach \n\nDetach from an attached browser\n",
      "flags": {},
      "args": []
    },
    "goto": {
      "help": "playwright-cli goto <url>\n\nNavigate to a URL\n\nArguments:\n  <url>                       the url to navigate to",
      "flags": {},
      "args": [
        "url"
      ]
    },
    "type": {
      "help": "playwright-cli type <text>\n\nType text into editable element\n\nArguments:\n  <text>                      text to type into the element\nOptions:\n  --submit                    whether to submit entered text (press enter after)",
      "flags": {
        "submit": "boolean"
      },
      "args": [
        "text"
      ]
    },
    "click": {
      "help": "playwright-cli click <target> [button]\n\nPerform click on a web page\n\nArguments:\n  <target>                    exact target element reference from the page snapshot, or a unique element selector\n  [button]                    button to click, defaults to left\nOptions:\n  --modifiers                 modifier key to press (repeatable)",
      "flags": {
        "modifiers": "string"
      },
      "args": [
        "target",
        "button"
      ]
    },
    "dblclick": {
      "help": "playwright-cli dblclick <target> [button]\n\nPerform double click on a web page\n\nArguments:\n  <target>                    exact target element reference from the page snapshot, or a unique element selector\n  [button]                    button to click, defaults to left\nOptions:\n  --modifiers                 modifier key to press (repeatable)",
      "flags": {
        "modifiers": "string"
      },
      "args": [
        "target",
        "button"
      ]
    },
    "fill": {
      "help": "playwright-cli fill <target> <text>\n\nFill text into editable element\n\nArguments:\n  <target>                    exact target element reference from the page snapshot, or a unique element selector\n  <text>                      text to fill into the element\nOptions:\n  --submit                    whether to submit entered text (press enter after)",
      "flags": {
        "submit": "boolean"
      },
      "args": [
        "target",
        "text"
      ]
    },
    "drag": {
      "help": "playwright-cli drag <startTarget> <endTarget>\n\nPerform drag and drop between two elements\n\nArguments:\n  <startTarget>               exact source element reference from the page snapshot, or a unique element selector\n  <endTarget>                 exact target element reference from the page snapshot, or a unique element selector",
      "flags": {},
      "args": [
        "startTarget",
        "endTarget"
      ]
    },
    "drop": {
      "help": "playwright-cli drop <target>\n\nDrop files or data onto an element\n\nArguments:\n  <target>                    exact target element reference from the page snapshot, or a unique element selector\nOptions:\n  --path                      absolute path to a file to drop onto the element (repeatable)\n  --data                      data to drop in \"mime/type=value\" format, e.g. --data \"text/plain=hello\" (repeatable)",
      "flags": {
        "path": "string",
        "data": "string"
      },
      "args": [
        "target"
      ]
    },
    "hover": {
      "help": "playwright-cli hover <target>\n\nHover over element on page\n\nArguments:\n  <target>                    exact target element reference from the page snapshot, or a unique element selector",
      "flags": {},
      "args": [
        "target"
      ]
    },
    "select": {
      "help": "playwright-cli select <target> <val>\n\nSelect an option in a dropdown\n\nArguments:\n  <target>                    exact target element reference from the page snapshot, or a unique element selector\n  <val>                       value to select in the dropdown",
      "flags": {},
      "args": [
        "target",
        "val"
      ]
    },
    "upload": {
      "help": "playwright-cli upload <file>\n\nUpload one or multiple files\n\nArguments:\n  <file>                      the absolute paths to the files to upload",
      "flags": {},
      "args": [
        "file"
      ]
    },
    "check": {
      "help": "playwright-cli check <target>\n\nCheck a checkbox or radio button\n\nArguments:\n  <target>                    exact target element reference from the page snapshot, or a unique element selector",
      "flags": {},
      "args": [
        "target"
      ]
    },
    "uncheck": {
      "help": "playwright-cli uncheck <target>\n\nUncheck a checkbox or radio button\n\nArguments:\n  <target>                    exact target element reference from the page snapshot, or a unique element selector",
      "flags": {},
      "args": [
        "target"
      ]
    },
    "snapshot": {
      "help": "playwright-cli snapshot [target]\n\nCapture page snapshot to obtain element ref\n\nArguments:\n  [target]                    element reference from the previous page snapshot, or a unique element selector for the root element to capture a partial snapshot instead of the whole page\nOptions:\n  --filename                  save snapshot to markdown file instead of returning it in the response.\n  --depth                     limit snapshot depth, unlimited by default.\n  --boxes                     include each element's bounding box as [box=x,y,width,height] in the snapshot. coordinates are viewport-relative, in css pixels (element.getboundingclientrect).",
      "flags": {
        "filename": "string",
        "depth": "string",
        "boxes": "boolean"
      },
      "args": [
        "target"
      ]
    },
    "eval": {
      "help": "playwright-cli eval <func> [target]\n\nEvaluate JavaScript expression on page or element\n\nArguments:\n  <func>                      () => { /* code */ } or (element) => { /* code */ } when element is provided\n  [target]                    exact target element reference from the page snapshot, or a unique element selector\nOptions:\n  --filename                  save evaluation result to a file instead of returning it in the response.",
      "flags": {
        "filename": "string"
      },
      "args": [
        "func",
        "target"
      ]
    },
    "console": {
      "help": "playwright-cli console [min-level]\n\nList console messages\n\nArguments:\n  [min-level]                 level of the console messages to return. each level includes the messages of more severe levels. defaults to \"info\".\nOptions:\n  --clear                     whether to clear the console list",
      "flags": {
        "clear": "boolean"
      },
      "args": [
        "min-level"
      ]
    },
    "dialog-accept": {
      "help": "playwright-cli dialog-accept [prompt]\n\nAccept a dialog\n\nArguments:\n  [prompt]                    the text of the prompt in case of a prompt dialog.",
      "flags": {},
      "args": [
        "prompt"
      ]
    },
    "dialog-dismiss": {
      "help": "playwright-cli dialog-dismiss \n\nDismiss a dialog\n",
      "flags": {},
      "args": []
    },
    "resize": {
      "help": "playwright-cli resize <w> <h>\n\nResize the browser window\n\nArguments:\n  <w>                         width of the browser window\n  <h>                         height of the browser window",
      "flags": {},
      "args": [
        "w",
        "h"
      ]
    },
    "run-code": {
      "help": "playwright-cli run-code [code]\n\nRun Playwright code snippet\n\nArguments:\n  [code]                      a javascript function containing playwright code to execute. it will be invoked with a single argument, page, which you can use for any page interaction.\nOptions:\n  --filename                  load code from the specified file.",
      "flags": {
        "filename": "string"
      },
      "args": [
        "code"
      ]
    },
    "delete-data": {
      "help": "playwright-cli delete-data \n\nDelete session data\n",
      "flags": {},
      "args": []
    },
    "go-back": {
      "help": "playwright-cli go-back \n\nGo back to the previous page\n",
      "flags": {},
      "args": []
    },
    "go-forward": {
      "help": "playwright-cli go-forward \n\nGo forward to the next page\n",
      "flags": {},
      "args": []
    },
    "reload": {
      "help": "playwright-cli reload \n\nReload the current page\n",
      "flags": {},
      "args": []
    },
    "press": {
      "help": "playwright-cli press <key>\n\nPress a key on the keyboard, `a`, `ArrowLeft`\n\nArguments:\n  <key>                       name of the key to press or a character to generate, such as `arrowleft` or `a`",
      "flags": {},
      "args": [
        "key"
      ]
    },
    "keydown": {
      "help": "playwright-cli keydown <key>\n\nPress a key down on the keyboard\n\nArguments:\n  <key>                       name of the key to press or a character to generate, such as `arrowleft` or `a`",
      "flags": {},
      "args": [
        "key"
      ]
    },
    "keyup": {
      "help": "playwright-cli keyup <key>\n\nPress a key up on the keyboard\n\nArguments:\n  <key>                       name of the key to press or a character to generate, such as `arrowleft` or `a`",
      "flags": {},
      "args": [
        "key"
      ]
    },
    "mousemove": {
      "help": "playwright-cli mousemove <x> <y>\n\nMove mouse to a given position\n\nArguments:\n  <x>                         x coordinate\n  <y>                         y coordinate",
      "flags": {},
      "args": [
        "x",
        "y"
      ]
    },
    "mousedown": {
      "help": "playwright-cli mousedown [button]\n\nPress mouse down\n\nArguments:\n  [button]                    button to press, defaults to left",
      "flags": {},
      "args": [
        "button"
      ]
    },
    "mouseup": {
      "help": "playwright-cli mouseup [button]\n\nPress mouse up\n\nArguments:\n  [button]                    button to press, defaults to left",
      "flags": {},
      "args": [
        "button"
      ]
    },
    "mousewheel": {
      "help": "playwright-cli mousewheel <dx> <dy>\n\nScroll mouse wheel\n\nArguments:\n  <dx>                        x delta\n  <dy>                        y delta",
      "flags": {},
      "args": [
        "dx",
        "dy"
      ]
    },
    "screenshot": {
      "help": "playwright-cli screenshot [target]\n\nscreenshot of the current page or element\n\nArguments:\n  [target]                    exact target element reference from the page snapshot, or a unique element selector\nOptions:\n  --filename                  file name to save the screenshot to. defaults to `page-{timestamp}.{png|jpeg}` if not specified.\n  --full-page                 when true, takes a screenshot of the full scrollable page, instead of the currently visible viewport.",
      "flags": {
        "filename": "string",
        "full-page": "boolean"
      },
      "args": [
        "target"
      ]
    },
    "pdf": {
      "help": "playwright-cli pdf \n\nSave page as PDF\n\nOptions:\n  --filename                  file name to save the pdf to. defaults to `page-{timestamp}.pdf` if not specified.",
      "flags": {
        "filename": "string"
      },
      "args": []
    },
    "tab-list": {
      "help": "playwright-cli tab-list \n\nList all tabs\n",
      "flags": {},
      "args": []
    },
    "tab-new": {
      "help": "playwright-cli tab-new [url]\n\nCreate a new tab\n\nArguments:\n  [url]                       the url to navigate to in the new tab. if omitted, the new tab will be blank.",
      "flags": {},
      "args": [
        "url"
      ]
    },
    "tab-close": {
      "help": "playwright-cli tab-close [index]\n\nClose a browser tab\n\nArguments:\n  [index]                     tab index. if omitted, current tab is closed.",
      "flags": {},
      "args": [
        "index"
      ]
    },
    "tab-select": {
      "help": "playwright-cli tab-select <index>\n\nSelect a browser tab\n\nArguments:\n  <index>                     tab index",
      "flags": {},
      "args": [
        "index"
      ]
    },
    "state-load": {
      "help": "playwright-cli state-load <filename>\n\nLoads browser storage (authentication) state from a file\n\nArguments:\n  <filename>                  file name to load the storage state from.",
      "flags": {},
      "args": [
        "filename"
      ]
    },
    "state-save": {
      "help": "playwright-cli state-save [filename]\n\nSaves the current storage (authentication) state to a file\n\nArguments:\n  [filename]                  file name to save the storage state to.",
      "flags": {},
      "args": [
        "filename"
      ]
    },
    "cookie-list": {
      "help": "playwright-cli cookie-list \n\nList all cookies (optionally filtered by domain/path)\n\nOptions:\n  --domain                    filter cookies by domain\n  --path                      filter cookies by path",
      "flags": {
        "domain": "string",
        "path": "string"
      },
      "args": [],
      "raw": true
    },
    "cookie-get": {
      "help": "playwright-cli cookie-get <name>\n\nGet a specific cookie by name\n\nArguments:\n  <name>                      cookie name",
      "flags": {},
      "args": [
        "name"
      ],
      "raw": true
    },
    "cookie-set": {
      "help": "playwright-cli cookie-set <name> <value>\n\nSet a cookie with optional flags\n\nArguments:\n  <name>                      cookie name\n  <value>                     cookie value\nOptions:\n  --domain                    cookie domain\n  --path                      cookie path\n  --expires                   cookie expiration as unix timestamp\n  --httpOnly                  whether the cookie is http only\n  --secure                    whether the cookie is secure\n  --sameSite                  cookie samesite attribute",
      "flags": {
        "domain": "string",
        "path": "string",
        "expires": "string",
        "httpOnly": "boolean",
        "secure": "boolean",
        "sameSite": "string"
      },
      "args": [
        "name",
        "value"
      ]
    },
    "cookie-delete": {
      "help": "playwright-cli cookie-delete <name>\n\nDelete a specific cookie\n\nArguments:\n  <name>                      cookie name",
      "flags": {},
      "args": [
        "name"
      ]
    },
    "cookie-clear": {
      "help": "playwright-cli cookie-clear \n\nClear all cookies\n",
      "flags": {},
      "args": []
    },
    "localstorage-list": {
      "help": "playwright-cli localstorage-list \n\nList all localStorage key-value pairs\n",
      "flags": {},
      "args": [],
      "raw": true
    },
    "localstorage-get": {
      "help": "playwright-cli localstorage-get <key>\n\nGet a localStorage item by key\n\nArguments:\n  <key>                       key to get",
      "flags": {},
      "args": [
        "key"
      ],
      "raw": true
    },
    "localstorage-set": {
      "help": "playwright-cli localstorage-set <key> <value>\n\nSet a localStorage item\n\nArguments:\n  <key>                       key to set\n  <value>                     value to set",
      "flags": {},
      "args": [
        "key",
        "value"
      ]
    },
    "localstorage-delete": {
      "help": "playwright-cli localstorage-delete <key>\n\nDelete a localStorage item\n\nArguments:\n  <key>                       key to delete",
      "flags": {},
      "args": [
        "key"
      ]
    },
    "localstorage-clear": {
      "help": "playwright-cli localstorage-clear \n\nClear all localStorage\n",
      "flags": {},
      "args": []
    },
    "sessionstorage-list": {
      "help": "playwright-cli sessionstorage-list \n\nList all sessionStorage key-value pairs\n",
      "flags": {},
      "args": [],
      "raw": true
    },
    "sessionstorage-get": {
      "help": "playwright-cli sessionstorage-get <key>\n\nGet a sessionStorage item by key\n\nArguments:\n  <key>                       key to get",
      "flags": {},
      "args": [
        "key"
      ],
      "raw": true
    },
    "sessionstorage-set": {
      "help": "playwright-cli sessionstorage-set <key> <value>\n\nSet a sessionStorage item\n\nArguments:\n  <key>                       key to set\n  <value>                     value to set",
      "flags": {},
      "args": [
        "key",
        "value"
      ]
    },
    "sessionstorage-delete": {
      "help": "playwright-cli sessionstorage-delete <key>\n\nDelete a sessionStorage item\n\nArguments:\n  <key>                       key to delete",
      "flags": {},
      "args": [
        "key"
      ]
    },
    "sessionstorage-clear": {
      "help": "playwright-cli sessionstorage-clear \n\nClear all sessionStorage\n",
      "flags": {},
      "args": []
    },
    "requests": {
      "help": "playwright-cli requests \n\nList all network requests since loading the page. Each request is numbered for use with the `request` command.\n\nOptions:\n  --static                    whether to include successful static resources like images, fonts, scripts, etc. defaults to false.\n  --filter                    only return requests whose url matches this regexp (e.g. \"/api/.*user\").\n  --clear                     whether to clear the network list",
      "flags": {
        "static": "boolean",
        "filter": "string",
        "clear": "boolean"
      },
      "args": []
    },
    "request": {
      "help": "playwright-cli request <index>\n\nShow full details (headers, body, response) of a single network request by its number from the `requests` command.\n\nArguments:\n  <index>                     1-based number of the request as listed by `requests`\nOptions:\n  --filename                  filename to save the result to. if not provided, output is returned as text.",
      "flags": {
        "filename": "string"
      },
      "args": [
        "index"
      ]
    },
    "request-headers": {
      "help": "playwright-cli request-headers <index>\n\nPrint only the request headers for a single network request by its number from the `requests` command.\n\nArguments:\n  <index>                     1-based number of the request as listed by `requests`\nOptions:\n  --filename                  filename to save the result to. if not provided, output is returned as text.",
      "flags": {
        "filename": "string"
      },
      "args": [
        "index"
      ],
      "raw": true
    },
    "request-body": {
      "help": "playwright-cli request-body <index>\n\nPrint only the request body for a single network request by its number from the `requests` command.\n\nArguments:\n  <index>                     1-based number of the request as listed by `requests`\nOptions:\n  --filename                  filename to save the result to. if not provided, output is returned as text.",
      "flags": {
        "filename": "string"
      },
      "args": [
        "index"
      ],
      "raw": true
    },
    "response-headers": {
      "help": "playwright-cli response-headers <index>\n\nPrint only the response headers for a single network request by its number from the `requests` command.\n\nArguments:\n  <index>                     1-based number of the request as listed by `requests`\nOptions:\n  --filename                  filename to save the result to. if not provided, output is returned as text.",
      "flags": {
        "filename": "string"
      },
      "args": [
        "index"
      ],
      "raw": true
    },
    "response-body": {
      "help": "playwright-cli response-body <index>\n\nPrint the response body for a single network request by its number from the `requests` command. Textual bodies are inlined; binary bodies are saved to a file and the path is printed.\n\nArguments:\n  <index>                     1-based number of the request as listed by `requests`\nOptions:\n  --filename                  filename to save the result to. if not provided, output is returned as text.",
      "flags": {
        "filename": "string"
      },
      "args": [
        "index"
      ],
      "raw": true
    },
    "route": {
      "help": "playwright-cli route <pattern>\n\nMock network requests matching a URL pattern\n\nArguments:\n  <pattern>                   url pattern to match (e.g., \"**/api/users\")\nOptions:\n  --status                    http status code (default: 200)\n  --body                      response body (text or json string)\n  --content-type              content-type header\n  --header                    header to add in \"name: value\" format (repeatable)\n  --remove-header             comma-separated header names to remove",
      "flags": {
        "status": "string",
        "body": "string",
        "content-type": "string",
        "header": "string",
        "remove-header": "string"
      },
      "args": [
        "pattern"
      ]
    },
    "route-list": {
      "help": "playwright-cli route-list \n\nList all active network routes\n",
      "flags": {},
      "args": [],
      "raw": true
    },
    "unroute": {
      "help": "playwright-cli unroute [pattern]\n\nRemove routes matching a pattern (or all routes)\n\nArguments:\n  [pattern]                   url pattern to unroute (omit to remove all)",
      "flags": {},
      "args": [
        "pattern"
      ]
    },
    "network-state-set": {
      "help": "playwright-cli network-state-set <state>\n\nSet the browser network state to online or offline\n\nArguments:\n  <state>                     set to \"offline\" to simulate offline mode, \"online\" to restore network connectivity",
      "flags": {},
      "args": [
        "state"
      ]
    },
    "config-print": {
      "help": "playwright-cli config-print \n\nPrint the final resolved config after merging CLI options, environment variables and config file.\n",
      "flags": {},
      "args": []
    },
    "install": {
      "help": "playwright-cli install \n\nInitialize workspace\n\nOptions:\n  --skills                    install skills, possible values: claude (default), agents.",
      "flags": {
        "skills": "string"
      },
      "args": []
    },
    "install-browser": {
      "help": "playwright-cli install-browser [browser]\n\nInstall browser\n\nArguments:\n  [browser]                   browser to install\nOptions:\n  --with-deps                 install system dependencies for browsers\n  --dry-run                   do not execute installation, only print information\n  --list                      prints list of browsers from all playwright installations\n  --force                     force reinstall of already installed browsers\n  --only-shell                only install headless shell when installing chromium\n  --no-shell                  do not install chromium headless shell",
      "flags": {
        "with-deps": "boolean",
        "dry-run": "boolean",
        "list": "boolean",
        "force": "boolean",
        "only-shell": "boolean",
        "no-shell": "boolean"
      },
      "args": [
        "browser"
      ]
    },
    "tracing-start": {
      "help": "playwright-cli tracing-start \n\nStart trace recording\n",
      "flags": {},
      "args": []
    },
    "tracing-stop": {
      "help": "playwright-cli tracing-stop \n\nStop trace recording\n",
      "flags": {},
      "args": []
    },
    "video-start": {
      "help": "playwright-cli video-start [filename]\n\nStart video recording\n\nArguments:\n  [filename]                  filename to save the video.\nOptions:\n  --size                      video frame size, e.g. \"800x600\". if not specified, the size of the recorded video will fit 800x800.",
      "flags": {
        "size": "string"
      },
      "args": [
        "filename"
      ]
    },
    "video-stop": {
      "help": "playwright-cli video-stop \n\nStop video recording\n",
      "flags": {},
      "args": []
    },
    "video-chapter": {
      "help": "playwright-cli video-chapter <title>\n\nAdd a chapter marker to the video recording\n\nArguments:\n  <title>                     chapter title.\nOptions:\n  --description               chapter description.\n  --duration                  duration in milliseconds to show the chapter card.",
      "flags": {
        "description": "string",
        "duration": "string"
      },
      "args": [
        "title"
      ]
    },
    "video-show-actions": {
      "help": "playwright-cli video-show-actions \n\nAnnotate subsequent CLI/MCP actions on the page with a callout that names the action and highlights the target element\n\nOptions:\n  --duration                  how long each action annotation stays on screen, in milliseconds. defaults to 500.\n  --position                  where to place the action title: top-left, top, top-right, bottom-left, bottom, bottom-right. defaults to top-right.\n  --cursor                    cursor decoration: \"pointer\" (default) animates a mouse pointer between action points; \"none\" disables it.",
      "flags": {
        "duration": "string",
        "position": "string",
        "cursor": "string"
      },
      "args": []
    },
    "video-hide-actions": {
      "help": "playwright-cli video-hide-actions \n\nStop annotating actions performed on the page\n",
      "flags": {},
      "args": []
    },
    "show": {
      "help": "playwright-cli show \n\nShow Playwright Dashboard\n\nOptions:\n  --port                      start as a blocking http server on this port (use 0 for a random port)\n  --host                      host to bind to when using --port (defaults to localhost)\n  --annotate                  switch the dashboard into annotation mode.\n  --kill                      kill the dashboard daemon.",
      "flags": {
        "port": "string",
        "host": "string",
        "annotate": "boolean",
        "kill": "boolean"
      },
      "args": [],
      "raw": true
    },
    "pause-at": {
      "help": "playwright-cli pause-at <location>\n\nRun the test up to a specific location and pause there\n\nArguments:\n  <location>                  location to pause at. format is <file>:<line>, e.g. \"example.spec.ts:42\".",
      "flags": {},
      "args": [
        "location"
      ]
    },
    "resume": {
      "help": "playwright-cli resume \n\nResume the test execution\n",
      "flags": {},
      "args": []
    },
    "step-over": {
      "help": "playwright-cli step-over \n\nStep over the next call in the test\n",
      "flags": {},
      "args": []
    },
    "generate-locator": {
      "help": "playwright-cli generate-locator <target>\n\nGenerate a Playwright locator for the given element\n\nArguments:\n  <target>                    exact target element reference from the page snapshot, or a unique element selector",
      "flags": {},
      "args": [
        "target"
      ]
    },
    "highlight": {
      "help": "playwright-cli highlight [target]\n\nShow (or with --hide, remove) a highlight overlay for an element; `--hide` without a target hides all page highlights.\n\nArguments:\n  [target]                    exact target element reference from the page snapshot, or a unique element selector\nOptions:\n  --hide                      hide a previously added highlight for this element, or all page highlights when no element is given\n  --style                     additional inline css applied to the highlight overlay, e.g. \"outline: 2px dashed red\"",
      "flags": {
        "hide": "boolean",
        "style": "string"
      },
      "args": [
        "target"
      ]
    },
    "list": {
      "help": "playwright-cli list \n\nList browser sessions\n\nOptions:\n  --all                       list all browser sessions across all workspaces",
      "flags": {
        "all": "boolean"
      },
      "args": []
    },
    "close-all": {
      "help": "playwright-cli close-all \n\nClose all browser sessions\n",
      "flags": {},
      "args": []
    },
    "kill-all": {
      "help": "playwright-cli kill-all \n\nForcefully kill all browser sessions (for stale/zombie processes)\n",
      "flags": {},
      "args": []
    },
    "tray": {
      "help": "playwright-cli tray \n\nRun tray\n",
      "flags": {},
      "args": []
    }
  },
  "booleanOptions": [
    "headed",
    "persistent",
    "submit",
    "boxes",
    "clear",
    "full-page",
    "httpOnly",
    "secure",
    "static",
    "with-deps",
    "dry-run",
    "list",
    "force",
    "only-shell",
    "no-shell",
    "annotate",
    "kill",
    "hide",
    "all"
  ]
}"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var minimist_exports = {};
__export(minimist_exports, {
  minimist: () => minimist
});
module.exports = __toCommonJS(minimist_exports);
function minimist(args, opts) {
  if (!opts)
    opts = {};
  const bools = {};
  const strings = {};
  for (const key of toArray(opts.boolean))
    bools[key] = true;
  for (const key of toArray(opts.string))
    strings[key] = true;
  const argv = { _: [] };
  function setArg(key, val) {
    if (argv[key] === void 0 || bools[key] || typeof argv[key] === "boolean")
      argv[key] = val;
    else if (Array.isArray(argv[key]))
      argv[key].push(val);
    else
      argv[key] = [argv[key], val];
  }
  let notFlags = [];
  const doubleDashIndex = args.indexOf("--");
  if (doubleDashIndex !== -1) {
    notFlags = args.slice(doubleDashIndex + 1);
    args = args.slice(0, doubleDashIndex);
  }
  for (let i = 0; i < args.length; i++) {
    const arg = args[i];
    let key;
    let next;
    if (/^--.+=/.test(arg)) {
      const m = arg.match(/^--([^=]+)=([\s\S]*)$/);
      key = m[1];
      if (bools[key])
        throw new Error(`boolean option '--${key}' should not be passed with '=value', use '--${key}' or '--no-${key}' instead`);
      setArg(key, m[2]);
    } else if (/^--no-.+/.test(arg)) {
      key = arg.match(/^--no-(.+)/)[1];
      setArg(key, false);
    } else if (/^--.+/.test(arg)) {
      key = arg.match(/^--(.+)/)[1];
      next = args[i + 1];
      if (next !== void 0 && !/^(-|--)[^-]/.test(next) && !bools[key]) {
        setArg(key, next);
        i += 1;
      } else if (/^(true|false)$/.test(next)) {
        setArg(key, next === "true");
        i += 1;
      } else {
        setArg(key, strings[key] ? "" : true);
      }
    } else if (/^-[^-]+/.test(arg)) {
      const letters = arg.slice(1, -1).split("");
      let broken = false;
      for (let j = 0; j < letters.length; j++) {
        next = arg.slice(j + 2);
        if (next === "-") {
          setArg(letters[j], next);
          continue;
        }
        if (/[A-Za-z]/.test(letters[j]) && next[0] === "=") {
          setArg(letters[j], next.slice(1));
          broken = true;
          break;
        }
        if (/[A-Za-z]/.test(letters[j]) && /-?\d+(\.\d*)?(e-?\d+)?$/.test(next)) {
          setArg(letters[j], next);
          broken = true;
          break;
        }
        if (letters[j + 1] && letters[j + 1].match(/\W/)) {
          setArg(letters[j], arg.slice(j + 2));
          broken = true;
          break;
        } else {
          setArg(letters[j], strings[letters[j]] ? "" : true);
        }
      }
      key = arg.slice(-1)[0];
      if (!broken && key !== "-") {
        if (args[i + 1] && !/^(-|--)[^-]/.test(args[i + 1]) && !bools[key]) {
          setArg(key, args[i + 1]);
          i += 1;
        } else if (args[i + 1] && /^(true|false)$/.test(args[i + 1])) {
          setArg(key, args[i + 1] === "true");
          i += 1;
        } else {
          setArg(key, strings[key] ? "" : true);
        }
      }
    } else {
      argv._.push(arg);
    }
  }
  for (const k of notFlags)
    argv._.push(k);
  return argv;
}
function toArray(value) {
  if (!value)
    return [];
  return Array.isArray(value) ? value : [value];
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  minimist
});
"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  // If the importer is in node compatibility mode or this is not an ESM
  // file that has been converted to a CommonJS file using a Babel-
  // compatible transform (i.e. "__esModule" has not been set), then set
  // "default" to the CommonJS "module.exports" for node compatibility.
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var output_exports = {};
__export(output_exports, {
  JsonOutput: () => JsonOutput,
  TextOutput: () => TextOutput
});
module.exports = __toCommonJS(output_exports);
var import_path = __toESM(require("path"));
var import_extension = require("../utils/extension");
class TextOutput {
  constructor() {
    this.json = false;
  }
  version(v) {
    console.log(v);
  }
  help(text) {
    console.log(text);
  }
  errorUnknownCommand(name, globalHelp) {
    console.error(`Unknown command: ${name}
`);
    console.log(globalHelp);
    return process.exit(1);
  }
  errorUnknownOption(opts, commandHelp) {
    console.error(`Unknown option${opts.length > 1 ? "s" : ""}: ${opts.map((f) => `--${f}`).join(", ")}`);
    console.log("");
    console.log(commandHelp);
    return process.exit(1);
  }
  errorTooManyArguments(expected, received, commandHelp) {
    console.error(`error: too many arguments: expected ${expected}, received ${received}`);
    console.log("");
    console.log(commandHelp);
    return process.exit(1);
  }
  errorAttachConflict() {
    console.error(`Error: only one of [name], --cdp, --endpoint, or --extension can be specified`);
    return process.exit(1);
  }
  errorDetachNotAttached(session) {
    console.error(`Error: session '${session}' was not attached; use \`playwright-cli${session !== "default" ? ` -s=${session}` : ""} close\` to stop it.`);
    return process.exit(1);
  }
  errorBrowserNotOpenForTool(session) {
    console.log(`The browser '${session}' is not open, please run open first`);
    console.log("");
    console.log(`  playwright-cli${session !== "default" ? ` -s=${session}` : ""} open [params]`);
    return process.exit(1);
  }
  errorAttachNoTarget() {
    console.error(`Error: no target specified for attach command; use one of [name], --cdp, --endpoint, or --extension to specify the target to attach to.`);
    return process.exit(1);
  }
  list({ all, browsers, servers, channelSessions }) {
    const byWorkspace = /* @__PURE__ */ new Map();
    for (const browser of browsers) {
      let list = byWorkspace.get(browser.workspace);
      if (!list) {
        list = [];
        byWorkspace.set(browser.workspace, list);
      }
      list.push(browser);
    }
    let count = 0;
    for (const [workspaceKey, list] of byWorkspace) {
      if (count === 0)
        console.log("### Browsers");
      if (all)
        console.log(`${import_path.default.relative(process.cwd(), workspaceKey) || "/"}:`);
      for (const browser of list)
        console.log(renderBrowser(browser));
      count += list.length;
    }
    if (!all) {
      if (!count)
        console.log("  (no browsers)");
      return;
    }
    if (servers?.length) {
      if (count)
        console.log("");
      console.log("### Browser servers available for attach");
      const serversByWorkspace = /* @__PURE__ */ new Map();
      for (const server of servers) {
        let list = serversByWorkspace.get(server.workspaceDir ?? "");
        if (!list) {
          list = [];
          serversByWorkspace.set(server.workspaceDir ?? "", list);
        }
        list.push(server);
      }
      for (const [workspaceKey, list] of serversByWorkspace) {
        if (workspaceKey)
          console.log(`${import_path.default.relative(process.cwd(), workspaceKey) || "/"}:`);
        for (const server of list)
          console.log(renderServer(server));
      }
      count += servers.length;
    }
    if (!count)
      console.log("  (no browsers)");
    if (channelSessions?.length) {
      console.log("");
      console.log("### Browsers available to attach via CDP");
      for (const session of channelSessions)
        console.log(renderChannelSession(session));
    }
  }
  closeAll(_sessions) {
  }
  deleteData(session, result) {
    if (!result.existed) {
      console.log(`No user data found for browser '${session}'.`);
      return;
    }
    if (result.deletedUserDataDir)
      console.log(`Deleted user data for browser '${session}'.`);
  }
  killAll(pids) {
    for (const pid of pids)
      console.log(`Killed daemon process ${pid}`);
    if (pids.length === 0)
      console.log("No daemon processes found.");
    else
      console.log(`Killed ${pids.length} daemon process${pids.length === 1 ? "" : "es"}.`);
  }
  open(session, pid, toolResult) {
    console.log(`### Browser \`${session}\` opened with pid ${pid}.`);
    if (toolResult)
      console.log(toolResult);
  }
  attach(session, pid, endpoint, toolResult) {
    if (endpoint) {
      console.log(`### Session \`${session}\` created, attached to \`${endpoint}\`.`);
      console.log(`Run commands with: playwright-cli --s=${session} <command>`);
      console.log("");
    } else {
      console.log(`### Browser \`${session}\` opened with pid ${pid}.`);
    }
    if (toolResult)
      console.log(toolResult);
  }
  close(session, wasOpen) {
    if (!wasOpen) {
      console.log(`Browser '${session}' is not open.`);
      return;
    }
    console.log(`Browser '${session}' closed
`);
  }
  detach(session, wasAttached) {
    if (!wasAttached) {
      console.log(`Browser '${session}' is not attached.`);
      return;
    }
    console.log(`Browser '${session}' detached
`);
  }
  installed() {
  }
  show(_session, pid) {
    if (process.env.PWTEST_PRINT_DASHBOARD_PID_FOR_TEST)
      console.log(`### Dashboard opened with pid ${pid}.`);
  }
  toolResult(text) {
    console.log(text);
  }
  installStdio() {
    return "inherit";
  }
}
class JsonOutput {
  constructor() {
    this.json = true;
  }
  version(v) {
    this._emit({ version: v });
  }
  help(text) {
    this._emit({ help: text });
  }
  errorUnknownCommand(name, _globalHelp) {
    this._emit({ isError: true, error: `Unknown command: ${name}` });
    return process.exit(1);
  }
  errorUnknownOption(opts, _commandHelp) {
    this._emit({ isError: true, error: `Unknown option${opts.length > 1 ? "s" : ""}: ${opts.map((f) => `--${f}`).join(", ")}` });
    return process.exit(1);
  }
  errorTooManyArguments(expected, received, _commandHelp) {
    this._emit({ isError: true, error: `error: too many arguments: expected ${expected}, received ${received}` });
    return process.exit(1);
  }
  errorAttachConflict() {
    this._emit({ isError: true, error: `only one of [name], --cdp, --endpoint, or --extension can be specified` });
    return process.exit(1);
  }
  errorDetachNotAttached(session) {
    this._emit({ isError: true, error: `session '${session}' was not attached; use close to stop it.` });
    return process.exit(1);
  }
  errorBrowserNotOpenForTool(session) {
    this._emit({ isError: true, error: `The browser '${session}' is not open, please run open first` });
    return process.exit(1);
  }
  errorAttachNoTarget() {
    this._emit({ isError: true, error: `no target specified for attach command; use one of [name], --cdp, --endpoint, or --extension to specify the target to attach to.` });
    return process.exit(1);
  }
  list({ all, browsers, servers, channelSessions }) {
    const payload = { browsers };
    if (all) {
      payload.servers = servers ?? [];
      payload.channelSessions = channelSessions ?? [];
    }
    this._emit(payload);
  }
  closeAll(sessions) {
    this._emit({ closed: sessions });
  }
  deleteData(session, result) {
    this._emit({ session, deleted: result.existed });
  }
  killAll(pids) {
    this._emit({ killed: pids.length, pids });
  }
  open(session, pid, toolResult) {
    this._emit({ session, pid, result: parseJsonText(toolResult) });
  }
  attach(session, pid, endpoint, toolResult) {
    this._emit({
      session,
      pid,
      ...endpoint ? { endpoint } : {},
      result: parseJsonText(toolResult)
    });
  }
  close(session, wasOpen) {
    this._emit({ session, status: wasOpen ? "closed" : "not-open" });
  }
  detach(session, wasAttached) {
    this._emit({ session, status: wasAttached ? "detached" : "not-attached" });
  }
  installed() {
    this._emit({ installed: true });
  }
  show(session, pid) {
    this._emit({ session, pid });
  }
  toolResult(text) {
    console.log(text);
  }
  installStdio() {
    return "ignore";
  }
  _emit(value) {
    console.log(JSON.stringify(value, null, 2));
  }
}
function parseJsonText(text) {
  try {
    return JSON.parse(text);
  } catch {
    return text;
  }
}
function renderBrowser(browser) {
  const lines = [`- ${browser.name}:`];
  lines.push(`  - status: ${browser.status}`);
  if (browser.status === "open" && !browser.compatible)
    lines.push(`  - version: v${browser.version} [incompatible please re-open]`);
  if (browser.browserType)
    lines.push(`  - browser-type: ${browser.browserType}${browser.attached ? " (attached)" : ""}`);
  if (!browser.attached) {
    if (browser.userDataDir === null)
      lines.push(`  - user-data-dir: <in-memory>`);
    else
      lines.push(`  - user-data-dir: ${browser.userDataDir}`);
    if (browser.headed !== void 0)
      lines.push(`  - headed: ${browser.headed}`);
  }
  return lines.join("\n");
}
function renderServer(server) {
  const lines = [`- browser "${server.title}":`];
  lines.push(`  - browser: ${server.browser.browserName}`);
  lines.push(`  - version: v${server.playwrightVersion}`);
  if (server.browser.userDataDir)
    lines.push(`  - data-dir: ${server.browser.userDataDir}`);
  else
    lines.push(`  - data-dir: <in-memory>`);
  lines.push(`  - run \`playwright-cli attach "${server.title}"\` to attach`);
  return lines.join("\n");
}
function renderChannelSession(session) {
  const lines = [`- ${session.channel}:`];
  lines.push(`  - data-dir: ${session.userDataDir}`);
  if (session.extensionInstalled)
    lines.push(`  - attach (extension): \`playwright-cli attach --extension=${session.channel}\``);
  else
    lines.push(`  - attach (extension): install at ${import_extension.playwrightExtensionInstallUrl}`);
  if (session.endpoint) {
    lines.push(`  - attach (remote debugging): \`playwright-cli attach --cdp=${session.channel}\``);
  } else {
    const inspectScheme = session.channel.startsWith("msedge") ? "edge" : "chrome";
    lines.push(`  - attach (remote debugging): enable at ${inspectScheme}://inspect/#remote-debugging`);
  }
  return lines.join("\n");
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  JsonOutput,
  TextOutput
});
"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  // If the importer is in node compatibility mode or this is not an ESM
  // file that has been converted to a CommonJS file using a Babel-
  // compatible transform (i.e. "__esModule" has not been set), then set
  // "default" to the CommonJS "module.exports" for node compatibility.
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var program_exports = {};
__export(program_exports, {
  calculateSha1: () => calculateSha1,
  program: () => program
});
module.exports = __toCommonJS(program_exports);
var import_child_process = require("child_process");
var import_crypto = __toESM(require("crypto"));
var import_os = __toESM(require("os"));
var import_path = __toESM(require("path"));
var import_channelSessions = require("./channelSessions");
var import_output = require("./output");
var import_registry = require("./registry");
var import_session = require("./session");
var import_package = require("../../package");
var import_serverRegistry = require("../../serverRegistry");
var import_minimist = require("./minimist");
const globalOptions = [
  "json",
  "raw",
  "session"
];
const booleanOptions = [
  "all",
  "help",
  "json",
  "raw",
  "version"
];
async function program(options) {
  const clientInfo = (0, import_registry.createClientInfo)();
  const help = require((0, import_package.libPath)("tools", "cli-client", "help.json"));
  const argv = process.argv.slice(2);
  const boolean = [...help.booleanOptions, ...booleanOptions];
  const args = (0, import_minimist.minimist)(argv, { boolean, string: ["_"] });
  if (args.s) {
    args.session = args.s;
    delete args.s;
  }
  const output = args.json ? new import_output.JsonOutput() : new import_output.TextOutput();
  const commandName = args._?.[0];
  if (args.version || args.v) {
    output.version(options?.embedderVersion ?? clientInfo.version);
    process.exit(0);
  }
  const command = commandName && help.commands[commandName];
  if (args.help || args.h || !commandName) {
    if (command) {
      output.help(command.help);
    } else {
      const lines = ["playwright-cli - run playwright mcp commands from terminal"];
      if (process.env.CLAUDECODE || process.env.COPILOT_CLI)
        lines.push(`Agent skill: ${import_path.default.relative(process.cwd(), (0, import_package.libPath)("tools", "cli-client", "skill", "SKILL.md"))}`);
      lines.push(help.global);
      output.help(lines.join("\n\n"));
    }
    process.exit(0);
  }
  if (!command)
    output.errorUnknownCommand(commandName, help.global);
  validateFlags(args, command, output);
  validateArgs(args, command, output);
  const registry = await import_registry.Registry.load();
  const sessionName = (0, import_registry.resolveSessionName)(args.session);
  switch (commandName) {
    case "list": {
      const data = await collectList(registry, clientInfo, !!args.all);
      output.list(data);
      return;
    }
    case "close-all": {
      const entries = registry.entries(clientInfo);
      const closed = [];
      for (const entry of entries) {
        await new import_session.Session(entry).stop();
        closed.push(entry.config.name);
      }
      output.closeAll(closed);
      return;
    }
    case "delete-data": {
      const entry = registry.entry(clientInfo, sessionName);
      if (!entry) {
        output.deleteData(sessionName, { existed: false, deletedUserDataDir: false });
        return;
      }
      const result = await new import_session.Session(entry).deleteData();
      output.deleteData(sessionName, result);
      return;
    }
    case "kill-all": {
      const pids = await killAllDaemons();
      output.killAll(pids);
      return;
    }
    case "open": {
      const { pid } = await startSession(sessionName, registry, clientInfo, args, "open");
      const newEntry = await registry.loadEntry(clientInfo, sessionName);
      const params = args._.slice(1);
      const toolText = await runInSessionOrStop(newEntry, clientInfo, { _: ["goto", ...params.length ? params : ["about:blank"]] }, output);
      output.open(sessionName, pid, toolText);
      return;
    }
    case "attach": {
      const attachTarget = args._[1];
      const targetCount = (attachTarget ? 1 : 0) + (args.cdp ? 1 : 0) + (args.endpoint ? 1 : 0) + (args.extension ? 1 : 0);
      if (targetCount > 1)
        output.errorAttachConflict();
      if (attachTarget)
        args.endpoint = attachTarget;
      const extensionChannel = typeof args.extension === "string" ? args.extension : void 0;
      if (extensionChannel) {
        args.browser = extensionChannel;
        args.extension = true;
      }
      const cdpChannel = typeof args.cdp === "string" && (0, import_channelSessions.isKnownChannel)(args.cdp) ? args.cdp : void 0;
      const targetName = attachTarget ?? cdpChannel ?? extensionChannel ?? args.endpoint ?? args.cdp;
      if (!targetName)
        output.errorAttachNoTarget();
      const attachSessionName = (0, import_registry.explicitSessionName)(args.session) ?? attachTarget ?? cdpChannel ?? extensionChannel ?? sessionName;
      args.session = attachSessionName;
      const { pid } = await startSession(attachSessionName, registry, clientInfo, args, "attach");
      const newEntry = await registry.loadEntry(clientInfo, attachSessionName);
      const toolText = await runInSessionOrStop(newEntry, clientInfo, { _: ["snapshot"], filename: "<auto>" }, output);
      output.attach(attachSessionName, pid, targetName, toolText);
      return;
    }
    case "close": {
      const closeEntry = registry.entry(clientInfo, sessionName);
      const { wasOpen } = closeEntry ? await new import_session.Session(closeEntry).stop() : { wasOpen: false };
      output.close(sessionName, wasOpen);
      return;
    }
    case "detach": {
      const detachEntry = registry.entry(clientInfo, sessionName);
      if (detachEntry && !detachEntry.config.attached)
        output.errorDetachNotAttached(sessionName);
      const { wasOpen } = detachEntry ? await new import_session.Session(detachEntry).stop() : { wasOpen: false };
      output.detach(sessionName, wasOpen);
      return;
    }
    case "install":
      await runInitWorkspace(args, output);
      output.installed();
      return;
    case "install-browser":
      await installBrowser();
      output.installed();
      return;
    case "show": {
      const daemonScript = (0, import_package.libPath)("entry", "dashboardApp.js");
      const daemonArgs = [
        daemonScript,
        `--workspaceDir=${clientInfo.workspaceDir ?? ""}`
      ];
      const explicit = (0, import_registry.explicitSessionName)(args.session);
      if (explicit)
        daemonArgs.push(`--sessionName=${explicit}`);
      if (args.port !== void 0)
        daemonArgs.push(`--port=${args.port}`);
      if (args.host !== void 0)
        daemonArgs.push(`--host=${args.host}`);
      if (args.kill) {
        daemonArgs.push(`--kill`);
        const child2 = (0, import_child_process.spawn)(process.execPath, daemonArgs, { stdio: "ignore" });
        await new Promise((resolve) => child2.on("exit", () => resolve()));
        return;
      }
      if (args.annotate) {
        const entry = registry.entry(clientInfo, sessionName);
        if (!entry)
          output.errorBrowserNotOpenForTool(sessionName);
        args.raw = true;
        const text = await runInSession(entry, clientInfo, args, output);
        output.toolResult(text);
        return;
      }
      const foreground = args.port !== void 0;
      const child = (0, import_child_process.spawn)(process.execPath, daemonArgs, {
        detached: !foreground,
        stdio: foreground ? "inherit" : ["pipe", "pipe", "ignore"]
      });
      if (foreground) {
        await new Promise((resolve) => child.on("exit", () => resolve()));
        return;
      }
      const timer = setTimeout(() => child.stdin.destroy(), 6e4);
      child.unref();
      let daemonPid;
      try {
        await new Promise((resolve, reject) => {
          let outLog = "";
          child.stdout.on("data", (data) => {
            outLog += data.toString();
            const match = outLog.match(/Dashboard is running pid=(\d+)/);
            if (match) {
              daemonPid = Number(match[1]);
              resolve();
            }
          });
          child.once("exit", (code, signal) => reject(new Error(`Dashboard daemon exited (code=${code}, signal=${signal}) before signaling READY${outLog ? "\n" + outLog : ""}`)));
        });
      } finally {
        clearTimeout(timer);
        child.removeAllListeners("exit");
        child.stdin.destroy();
        child.stdout.destroy();
      }
      output.show(sessionName, daemonPid);
      return;
    }
    default: {
      const entry = registry.entry(clientInfo, sessionName);
      if (!entry)
        output.errorBrowserNotOpenForTool(sessionName);
      if (command.raw)
        args.raw = true;
      const text = await runInSession(entry, clientInfo, args, output);
      output.toolResult(text);
    }
  }
}
async function startSession(sessionName, registry, clientInfo, args, mode) {
  const entry = registry.entry(clientInfo, sessionName);
  if (entry)
    await new import_session.Session(entry).stop();
  return await import_session.Session.startDaemon(clientInfo, args, mode);
}
async function runInSession(entry, clientInfo, args, output) {
  const raw = !!args.raw;
  for (const globalOption of globalOptions)
    delete args[globalOption];
  const session = new import_session.Session(entry);
  const result = await session.run(clientInfo, args, { raw, json: output.json });
  return result.text;
}
async function runInSessionOrStop(entry, clientInfo, args, output) {
  try {
    return await runInSession(entry, clientInfo, args, output);
  } catch (e) {
    await new import_session.Session(entry).stop().catch(() => {
    });
    throw e;
  }
}
async function runInitWorkspace(args, output) {
  const cliPath = (0, import_package.libPath)("entry", "cliDaemon.js");
  const daemonArgs = [cliPath, "--init-workspace", ...args.skills ? ["--init-skills", String(args.skills)] : []];
  await new Promise((resolve, reject) => {
    const child = (0, import_child_process.spawn)(process.execPath, daemonArgs, {
      stdio: output.installStdio(),
      cwd: process.cwd()
    });
    child.on("close", (code) => {
      if (code === 0)
        resolve();
      else
        reject(new Error(`Workspace initialization failed with exit code ${code}`));
    });
  });
}
async function installBrowser() {
  const argv = process.argv.map((arg) => arg === "install-browser" ? "install" : arg);
  const { libCli } = require("../../coreBundle.js");
  const { program: program2 } = require("../../utilsBundle.js");
  if (!program2.version())
    libCli.decorateProgram(program2);
  program2.parse(argv);
}
const daemonProcessPatterns = ["run-mcp-server", "run-cli-server", "cli-daemon", "cliDaemon.js", "dashboardApp.js"];
async function killAllDaemons() {
  const platform = import_os.default.platform();
  const pidFilterEnv = process.env.PWTEST_KILL_ALL_PID_FILTER_FOR_TEST;
  const pidFilter = pidFilterEnv ? new Set(pidFilterEnv.split(",").map((p) => parseInt(p, 10)).filter((n) => !isNaN(n))) : void 0;
  const killed = [];
  try {
    if (platform === "win32") {
      const clauses = [`(${daemonProcessPatterns.map((p) => `$_.CommandLine -like '*${p}*'`).join(" -or ")})`];
      if (pidFilter)
        clauses.push(`(${[...pidFilter].map((p) => `$_.ProcessId -eq ${p}`).join(" -or ")})`);
      const whereClause = clauses.join(" -and ");
      const result = (0, import_child_process.execSync)(
        `powershell -NoProfile -NonInteractive -Command "Get-CimInstance Win32_Process | Where-Object { ${whereClause} } | ForEach-Object { Stop-Process -Id $_.ProcessId -Force -ErrorAction SilentlyContinue; $_.ProcessId }"`,
        { encoding: "utf-8" }
      );
      const pids = result.split("\n").map((line) => line.trim()).filter((line) => /^\d+$/.test(line));
      for (const pid of pids)
        killed.push(parseInt(pid, 10));
    } else {
      const result = (0, import_child_process.execSync)("ps auxww", { encoding: "utf-8" });
      const lines = result.split("\n");
      for (const line of lines) {
        if (daemonProcessPatterns.some((p) => line.includes(p))) {
          const parts = line.trim().split(/\s+/);
          const pid = parts[1];
          if (pid && /^\d+$/.test(pid)) {
            const numericPid = parseInt(pid, 10);
            if (pidFilter && !pidFilter.has(numericPid))
              continue;
            try {
              process.kill(numericPid, "SIGKILL");
              killed.push(numericPid);
            } catch {
            }
          }
        }
      }
    }
  } catch (e) {
  }
  return killed;
}
async function collectList(registry, clientInfo, all) {
  const browsers = [];
  const entries = registry.entryMap();
  const serverEntries = await import_serverRegistry.serverRegistry.list();
  const key = (0, import_registry.clientKey)(clientInfo);
  for (const [workspaceKey, list] of entries) {
    if (!all && workspaceKey !== key)
      continue;
    for (const entry of list) {
      const session = new import_session.Session(entry);
      const canConnect = await session.canConnect();
      if (!canConnect) {
        await session.deleteSessionConfig();
        continue;
      }
      const config = session.config;
      const channel = config.browser?.launchOptions.channel ?? config.browser?.browserName;
      browsers.push({
        name: session.name,
        workspace: workspaceKey,
        status: canConnect ? "open" : "closed",
        browserType: channel,
        userDataDir: config.browser?.userDataDir ?? null,
        headed: config.browser ? !config.browser.launchOptions.headless : void 0,
        persistent: !!config.cli.persistent,
        attached: !!config.attached,
        compatible: session.isCompatible(clientInfo),
        version: config.version
      });
    }
  }
  if (!all)
    return { all, browsers };
  const servers = [...serverEntries.values()].flat();
  return { all, browsers, servers, channelSessions: await (0, import_channelSessions.listChannelSessions)() };
}
function validateFlags(args, command, output) {
  const unknownFlags = [];
  for (const key of Object.keys(args)) {
    if (key === "_")
      continue;
    if (globalOptions.includes(key))
      continue;
    if (!(key in command.flags))
      unknownFlags.push(key);
  }
  if (unknownFlags.length)
    output.errorUnknownOption(unknownFlags, command.help);
}
function validateArgs(args, command, output) {
  const positional = args._.slice(1);
  if (positional.length > command.args.length)
    output.errorTooManyArguments(command.args.length, positional.length, command.help);
}
function calculateSha1(buffer) {
  const hash = import_crypto.default.createHash("sha1");
  hash.update(buffer);
  return hash.digest("hex");
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  calculateSha1,
  program
});
"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  // If the importer is in node compatibility mode or this is not an ESM
  // file that has been converted to a CommonJS file using a Babel-
  // compatible transform (i.e. "__esModule" has not been set), then set
  // "default" to the CommonJS "module.exports" for node compatibility.
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var registry_exports = {};
__export(registry_exports, {
  Registry: () => Registry,
  baseDaemonDir: () => baseDaemonDir,
  clientKey: () => clientKey,
  createClientInfo: () => createClientInfo,
  explicitSessionName: () => explicitSessionName,
  resolveSessionName: () => resolveSessionName
});
module.exports = __toCommonJS(registry_exports);
var import_crypto = __toESM(require("crypto"));
var import_fs = __toESM(require("fs"));
var import_os = __toESM(require("os"));
var import_path = __toESM(require("path"));
var import_package = require("../../package");
function clientKey(clientInfo) {
  return clientInfo.workspaceDir || clientInfo.workspaceDirHash;
}
class Registry {
  constructor(files) {
    this._files = files;
  }
  entry(clientInfo, sessionName) {
    const key = clientKey(clientInfo);
    const entries = this._files.get(key) || [];
    return entries.find((entry) => entry.config.name === sessionName);
  }
  entries(clientInfo) {
    return this._files.get(clientKey(clientInfo)) || [];
  }
  entryMap() {
    return this._files;
  }
  async loadEntry(clientInfo, sessionName) {
    const entry = await Registry._loadSessionEntry(clientInfo.daemonProfilesDir, sessionName + ".session");
    if (!entry)
      throw new Error(`Could not start the session "${sessionName}"`);
    const key = clientKey(clientInfo);
    let list = this._files.get(key);
    if (!list) {
      list = [];
      this._files.set(key, list);
    }
    const oldIndex = list.findIndex((e) => e.config.name === sessionName);
    if (oldIndex !== -1)
      list.splice(oldIndex, 1);
    list.push(entry);
    return entry;
  }
  static async _loadSessionEntry(daemonDir, file) {
    try {
      const fileName = import_path.default.join(daemonDir, file);
      const data = await import_fs.default.promises.readFile(fileName, "utf-8");
      const config = JSON.parse(data);
      if (!config.name)
        config.name = import_path.default.basename(file, ".session");
      if (!config.timestamp)
        config.timestamp = 0;
      return { file: fileName, config, daemonDir };
    } catch {
      return void 0;
    }
  }
  static async load() {
    const sessions = /* @__PURE__ */ new Map();
    const hashDirs = await import_fs.default.promises.readdir(baseDaemonDir).catch(() => []);
    for (const workspaceDirHash of hashDirs) {
      const daemonDir = import_path.default.join(baseDaemonDir, workspaceDirHash);
      const stat = await import_fs.default.promises.stat(daemonDir);
      if (!stat.isDirectory())
        continue;
      const files = await import_fs.default.promises.readdir(daemonDir).catch(() => []);
      for (const file of files) {
        if (!file.endsWith(".session"))
          continue;
        const entry = await Registry._loadSessionEntry(daemonDir, file);
        if (!entry)
          continue;
        const key = entry.config.workspaceDir || workspaceDirHash;
        let list = sessions.get(key);
        if (!list) {
          list = [];
          sessions.set(key, list);
        }
        list.push(entry);
      }
    }
    return new Registry(sessions);
  }
}
const baseDaemonDir = (() => {
  if (process.env.PWTEST_DAEMON_SESSION_DIR)
    return process.env.PWTEST_DAEMON_SESSION_DIR;
  let localCacheDir;
  if (process.platform === "linux")
    localCacheDir = process.env.XDG_CACHE_HOME || import_path.default.join(import_os.default.homedir(), ".cache");
  if (process.platform === "darwin")
    localCacheDir = import_path.default.join(import_os.default.homedir(), "Library", "Caches");
  if (process.platform === "win32")
    localCacheDir = process.env.LOCALAPPDATA || import_path.default.join(import_os.default.homedir(), "AppData", "Local");
  if (!localCacheDir)
    throw new Error("Unsupported platform: " + process.platform);
  return import_path.default.join(localCacheDir, "ms-playwright", "daemon");
})();
function createClientInfo() {
  const workspaceDir = findWorkspaceDir(process.cwd());
  const version = process.env.PLAYWRIGHT_CLI_VERSION_FOR_TEST || import_package.packageJSON.version;
  const hash = import_crypto.default.createHash("sha1");
  hash.update(workspaceDir || import_package.packageRoot);
  const workspaceDirHash = hash.digest("hex").substring(0, 16);
  return {
    version,
    workspaceDir,
    workspaceDirHash,
    daemonProfilesDir: daemonProfilesDir(workspaceDirHash),
    homeDir: import_os.default.homedir()
  };
}
function findWorkspaceDir(startDir) {
  let dir = startDir;
  for (let i = 0; i < 10; i++) {
    if (import_fs.default.existsSync(import_path.default.join(dir, ".playwright")))
      return dir;
    const parentDir = import_path.default.dirname(dir);
    if (parentDir === dir)
      break;
    dir = parentDir;
  }
  return void 0;
}
const daemonProfilesDir = (workspaceDirHash) => {
  return import_path.default.join(baseDaemonDir, workspaceDirHash);
};
function explicitSessionName(sessionName) {
  return sessionName || process.env.PLAYWRIGHT_CLI_SESSION;
}
function resolveSessionName(sessionName) {
  return explicitSessionName(sessionName) || "default";
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  Registry,
  baseDaemonDir,
  clientKey,
  createClientInfo,
  explicitSessionName,
  resolveSessionName
});
"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  // If the importer is in node compatibility mode or this is not an ESM
  // file that has been converted to a CommonJS file using a Babel-
  // compatible transform (i.e. "__esModule" has not been set), then set
  // "default" to the CommonJS "module.exports" for node compatibility.
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var session_exports = {};
__export(session_exports, {
  Session: () => Session
});
module.exports = __toCommonJS(session_exports);
var import_child_process = require("child_process");
var import_fs = __toESM(require("fs"));
var import_net = __toESM(require("net"));
var import_os = __toESM(require("os"));
var import_path = __toESM(require("path"));
var import_package = require("../../package");
var import_socketConnection = require("../utils/socketConnection");
var import_registry = require("./registry");
class Session {
  constructor(sessionFile) {
    this.config = sessionFile.config;
    this.name = this.config.name;
    this._sessionFile = sessionFile;
  }
  isCompatible(clientInfo) {
    return (0, import_socketConnection.compareSemver)(clientInfo.version, this.config.version) >= 0;
  }
  async run(clientInfo, args, options) {
    if (!this.isCompatible(clientInfo))
      throw new Error(`Client is v${clientInfo.version}, session '${this.name}' is v${this.config.version}. Run

  playwright-cli${this.name !== "default" ? ` -s=${this.name}` : ""} open

to restart the browser session.`);
    const { socket } = await this._connect();
    if (!socket)
      throw new Error(`Browser '${this.name}' is not open. Run

  playwright-cli${this.name !== "default" ? ` -s=${this.name}` : ""} open

to start the browser session.`);
    return await SocketConnectionClient.sendAndClose(socket, "run", { args, cwd: process.cwd(), raw: options?.raw, json: options?.json });
  }
  async stop() {
    if (!await this.canConnect())
      return { wasOpen: false };
    await this._stopDaemon();
    return { wasOpen: true };
  }
  async deleteData() {
    await this.stop();
    const dataDirs = await import_fs.default.promises.readdir(this._sessionFile.daemonDir).catch(() => []);
    const matchingEntries = dataDirs.filter((file) => file === `${this.name}.session` || file.startsWith(`ud-${this.name}-`));
    if (matchingEntries.length === 0)
      return { existed: false, deletedUserDataDir: false };
    let deletedUserDataDir = false;
    for (const entry of matchingEntries) {
      const userDataDir = import_path.default.resolve(this._sessionFile.daemonDir, entry);
      for (let i = 0; i < 5; i++) {
        try {
          await import_fs.default.promises.rm(userDataDir, { recursive: true });
          if (entry.startsWith("ud-"))
            deletedUserDataDir = true;
          break;
        } catch (e) {
          if (e.code === "ENOENT")
            break;
          await new Promise((resolve) => setTimeout(resolve, 1e3));
          if (i === 4)
            throw e;
        }
      }
    }
    return { existed: true, deletedUserDataDir };
  }
  async _connect() {
    return await new Promise((resolve) => {
      const socket = import_net.default.createConnection(this.config.socketPath, () => {
        resolve({ socket });
      });
      socket.on("error", (error) => {
        if (import_os.default.platform() !== "win32")
          void import_fs.default.promises.unlink(this.config.socketPath).catch(() => {
          }).then(() => resolve({ error }));
        else
          resolve({ error });
      });
    });
  }
  async canConnect() {
    const { socket } = await this._connect();
    if (socket) {
      socket.destroy();
      return true;
    }
    return false;
  }
  static async startDaemon(clientInfo, cliArgs, mode) {
    await import_fs.default.promises.mkdir(clientInfo.daemonProfilesDir, { recursive: true });
    const cliPath = (0, import_package.libPath)("entry", "cliDaemon.js");
    const sessionName = (0, import_registry.resolveSessionName)(cliArgs.session);
    const errLog = import_path.default.join(clientInfo.daemonProfilesDir, sessionName + ".err");
    const err = import_fs.default.openSync(errLog, "w");
    const args = [
      cliPath,
      sessionName
    ];
    if (cliArgs.headed)
      args.push("--headed");
    if (cliArgs.browser)
      args.push(`--browser=${cliArgs.browser}`);
    if (cliArgs.persistent)
      args.push("--persistent");
    if (cliArgs.profile)
      args.push(`--profile=${cliArgs.profile}`);
    if (cliArgs.config)
      args.push(`--config=${cliArgs.config}`);
    if (cliArgs.extension)
      args.push("--extension");
    else if (cliArgs.cdp)
      args.push(`--cdp=${cliArgs.cdp}`);
    else if (cliArgs.endpoint)
      args.push(`--endpoint=${cliArgs.endpoint}`);
    const child = (0, import_child_process.spawn)(process.execPath, args, {
      detached: true,
      stdio: ["ignore", "pipe", err],
      cwd: process.cwd()
      // Will be used as root.
    });
    let signalled = false;
    const sigintHandler = () => {
      signalled = true;
      child.kill("SIGINT");
    };
    const sigtermHandler = () => {
      signalled = true;
      child.kill("SIGTERM");
    };
    process.on("SIGINT", sigintHandler);
    process.on("SIGTERM", sigtermHandler);
    let outLog = "";
    const rejectWithPid = (reject, message) => reject(Object.assign(new Error(`Daemon pid=${child.pid}: ${message}`), { daemonPid: child.pid }));
    await new Promise((resolve, reject) => {
      child.stdout.on("data", (data) => {
        outLog += data.toString();
        if (outLog.includes("Daemon listening on"))
          resolve();
      });
      child.on("close", (code) => {
        if (!signalled) {
          const errLogContent = import_fs.default.readFileSync(errLog, "utf-8");
          rejectWithPid(reject, `Daemon process exited with code ${code}` + (outLog ? "\n" + outLog : "") + (errLogContent ? "\n" + errLogContent : ""));
        }
      });
    });
    process.off("SIGINT", sigintHandler);
    process.off("SIGTERM", sigtermHandler);
    child.stdout.destroy();
    child.unref();
    return { pid: child.pid, sessionName, endpoint: cliArgs.endpoint };
  }
  async _stopDaemon() {
    const { socket } = await this._connect();
    if (!socket)
      return;
    let error;
    await SocketConnectionClient.sendAndClose(socket, "stop", {}).catch((e) => error = e);
    if (error && !error?.message?.includes("Session closed"))
      throw error;
  }
  async deleteSessionConfig() {
    await import_fs.default.promises.rm(this._sessionFile.file).catch(() => {
    });
  }
}
class SocketConnectionClient {
  constructor(socket) {
    this._nextMessageId = 1;
    this._callbacks = /* @__PURE__ */ new Map();
    this._connection = new import_socketConnection.SocketConnection(socket);
    this._connection.onmessage = (message) => this._onMessage(message);
    this._connection.onclose = () => this._rejectCallbacks();
  }
  async send(method, params = {}) {
    const messageId = this._nextMessageId++;
    const message = {
      id: messageId,
      method,
      params
    };
    const responsePromise = new Promise((resolve, reject) => {
      this._callbacks.set(messageId, { resolve, reject, method, params });
    });
    const [result] = await Promise.all([responsePromise, this._connection.send(message)]);
    return result;
  }
  static async sendAndClose(socket, method, params = {}) {
    const connection = new SocketConnectionClient(socket);
    try {
      return await connection.send(method, params);
    } finally {
      connection.close();
    }
  }
  close() {
    this._connection.close();
  }
  _onMessage(object) {
    if (object.id && this._callbacks.has(object.id)) {
      const callback = this._callbacks.get(object.id);
      this._callbacks.delete(object.id);
      if (object.error)
        callback.reject(new Error(object.error));
      else
        callback.resolve(object.result);
    } else if (object.id) {
      throw new Error(`Unexpected message id: ${object.id}`);
    } else {
      throw new Error(`Unexpected message without id: ${JSON.stringify(object)}`);
    }
  }
  _rejectCallbacks() {
    for (const callback of this._callbacks.values())
      callback.reject(new Error("Session closed"));
    this._callbacks.clear();
  }
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  Session
});
---
name: playwright-cli
description: Automate browser interactions, test web pages and work with Playwright tests.
allowed-tools: Bash(playwright-cli:*) Bash(npx:*) Bash(npm:*)
---

# Browser Automation with playwright-cli

## Quick start

```bash
# open new browser
playwright-cli open
# navigate to a page
playwright-cli goto https://playwright.dev
# interact with the page using refs from the snapshot
playwright-cli click e15
playwright-cli type "page.click"
playwright-cli press Enter
# take a screenshot (rarely used, as snapshot is more common)
playwright-cli screenshot
# close the browser
playwright-cli close
```

## Commands

### Core

```bash
playwright-cli open
# open and navigate right away
playwright-cli open https://example.com/
playwright-cli goto https://playwright.dev
playwright-cli type "search query"
playwright-cli click e3
playwright-cli dblclick e7
# --submit presses Enter after filling the element
playwright-cli fill e5 "user@example.com"  --submit
playwright-cli drag e2 e8
# drop files or data onto an element (from outside the page)
playwright-cli drop e4 --path=./image.png
playwright-cli drop e4 --data="text/plain=hello world"
playwright-cli hover e4
playwright-cli select e9 "option-value"
playwright-cli upload ./document.pdf
playwright-cli check e12
playwright-cli uncheck e12
playwright-cli snapshot
playwright-cli eval "document.title"
playwright-cli eval "el => el.textContent" e5
# get element id, class, or any attribute not visible in the snapshot
playwright-cli eval "el => el.id" e5
playwright-cli eval "el => el.getAttribute('data-testid')" e5
playwright-cli dialog-accept
playwright-cli dialog-accept "confirmation text"
playwright-cli dialog-dismiss
playwright-cli resize 1920 1080
playwright-cli close
```

### Navigation

```bash
playwright-cli go-back
playwright-cli go-forward
playwright-cli reload
```

### Keyboard

```bash
playwright-cli press Enter
playwright-cli press ArrowDown
playwright-cli keydown Shift
playwright-cli keyup Shift
```

### Mouse

```bash
playwright-cli mousemove 150 300
playwright-cli mousedown
playwright-cli mousedown right
playwright-cli mouseup
playwright-cli mouseup right
playwright-cli mousewheel 0 100
```

### Save as

```bash
playwright-cli screenshot
playwright-cli screenshot e5
playwright-cli screenshot --filename=page.png
playwright-cli pdf --filename=page.pdf
```

### Tabs

```bash
playwright-cli tab-list
playwright-cli tab-new
playwright-cli tab-new https://example.com/page
playwright-cli tab-close
playwright-cli tab-close 2
playwright-cli tab-select 0
```

### Storage

```bash
playwright-cli state-save
playwright-cli state-save auth.json
playwright-cli state-load auth.json

# Cookies
playwright-cli cookie-list
playwright-cli cookie-list --domain=example.com
playwright-cli cookie-get session_id
playwright-cli cookie-set session_id abc123
playwright-cli cookie-set session_id abc123 --domain=example.com --httpOnly --secure
playwright-cli cookie-delete session_id
playwright-cli cookie-clear

# LocalStorage
playwright-cli localstorage-list
playwright-cli localstorage-get theme
playwright-cli localstorage-set theme dark
playwright-cli localstorage-delete theme
playwright-cli localstorage-clear

# SessionStorage
playwright-cli sessionstorage-list
playwright-cli sessionstorage-get step
playwright-cli sessionstorage-set step 3
playwright-cli sessionstorage-delete step
playwright-cli sessionstorage-clear
```

### Network

```bash
playwright-cli route "**/*.jpg" --status=404
playwright-cli route "https://api.example.com/**" --body='{"mock": true}'
playwright-cli route-list
playwright-cli unroute "**/*.jpg"
playwright-cli unroute
```

### DevTools

```bash
playwright-cli console
playwright-cli console warning
playwright-cli requests
playwright-cli request 5
playwright-cli run-code "async page => await page.context().grantPermissions(['geolocation'])"
playwright-cli run-code --filename=script.js
playwright-cli tracing-start
playwright-cli tracing-stop
playwright-cli video-start video.webm
playwright-cli video-chapter "Chapter Title" --description="Details" --duration=2000
playwright-cli video-stop

# annotate each subsequent action (click, type, ...) with a callout naming the action and highlighting the target
playwright-cli video-show-actions --duration=600 --position=top-right
playwright-cli video-hide-actions

# launch the dashboard for UI review / design feedback â€” user annotates the page, you receive the annotated screenshot, snapshot, and notes
playwright-cli show --annotate

# generate a Playwright locator for an element from its ref or selector
playwright-cli generate-locator e5 --raw

# show a persistent highlight overlay for an element, optionally with a custom style
playwright-cli highlight e5
playwright-cli highlight e5 --style="outline: 3px dashed red"
# hide a single element highlight, or all page highlights when no target is given
playwright-cli highlight e5 --hide
playwright-cli highlight --hide
```

## Raw output

The global `--raw` option strips page status, generated code, and snapshot sections from the output, returning only the result value. Use it to pipe command output into other tools. Commands that don't produce output return nothing.

```bash
playwright-cli --raw eval "JSON.stringify(performance.timing)" | jq '.loadEventEnd - .navigationStart'
playwright-cli --raw eval "JSON.stringify([...document.querySelectorAll('a')].map(a => a.href))" > links.json
playwright-cli --raw snapshot > before.yml
playwright-cli click e5
playwright-cli --raw snapshot > after.yml
diff before.yml after.yml
TOKEN=$(playwright-cli --raw cookie-get session_id)
playwright-cli --raw localstorage-get theme
```

For structured output wrapping every reply as JSON, pass --json
```bash
playwright-cli list --json
```

## Open parameters
```bash
# Use specific browser when creating session
playwright-cli open --browser=chrome
playwright-cli open --browser=firefox
playwright-cli open --browser=webkit
playwright-cli open --browser=msedge

# Use persistent profile (by default profile is in-memory)
playwright-cli open --persistent
# Use persistent profile with custom directory
playwright-cli open --profile=/path/to/profile

# Connect to browser via Playwright Extension
playwright-cli attach --extension=chrome

# Connect to a running Chrome or Edge by channel name
playwright-cli attach --cdp=chrome
playwright-cli attach --cdp=msedge

# Connect to a running browser via CDP endpoint
playwright-cli attach --cdp=http://localhost:9222

# Start with config file
playwright-cli open --config=my-config.json

# Close the browser
playwright-cli close
# Detach from an attached browser (leaves the external browser running)
playwright-cli -s=msedge detach
# Delete user data for the default session
playwright-cli delete-data
```

## URLs with `&` on Windows

On Windows, `cmd.exe` and PowerShell treat `&` as a command separator, so URLs with multiple query parameters get truncated before `playwright-cli` runs. Escape `&` with `^&` in `cmd.exe`, or use `--%` in PowerShell:

```batch
playwright-cli goto "https://example.com/?a=1^&b=2"
```

```powershell
playwright-cli --% goto "https://example.com/?a=1&b=2"
```

## Snapshots

After each command, playwright-cli provides a snapshot of the current browser state.

```bash
> playwright-cli goto https://example.com
### Page
- Page URL: https://example.com/
- Page Title: Example Domain
### Snapshot
[Snapshot](.playwright-cli/page-2026-02-14T19-22-42-679Z.yml)
```

You can also take a snapshot on demand using `playwright-cli snapshot` command. All the options below can be combined as needed.

```bash
# default - save to a file with timestamp-based name
playwright-cli snapshot

# save to file, use when snapshot is a part of the workflow result
playwright-cli snapshot --filename=after-click.yaml

# snapshot an element instead of the whole page
playwright-cli snapshot "#main"

# limit snapshot depth for efficiency, take a partial snapshot afterwards
playwright-cli snapshot --depth=4
playwright-cli snapshot e34

# include each element's bounding box as [box=x,y,width,height]
playwright-cli snapshot --boxes
```

## Targeting elements

By default, use refs from the snapshot to interact with page elements.

```bash
# get snapshot with refs
playwright-cli snapshot

# interact using a ref
playwright-cli click e15
```

You can also use css selectors or Playwright locators.

```bash
# css selector
playwright-cli click "#main > button.submit"

# role locator
playwright-cli click "getByRole('button', { name: 'Submit' })"

# test id
playwright-cli click "getByTestId('submit-button')"
```

## Browser Sessions

```bash
# create new browser session named "mysession" with persistent profile
playwright-cli -s=mysession open example.com --persistent
# same with manually specified profile directory (use when requested explicitly)
playwright-cli -s=mysession open example.com --profile=/path/to/profile
playwright-cli -s=mysession click e6
playwright-cli -s=mysession close  # stop a named browser
playwright-cli -s=mysession delete-data  # delete user data for persistent session

playwright-cli list
# Close all browsers
playwright-cli close-all
# Forcefully kill all browser processes
playwright-cli kill-all
```

## Installation

If global `playwright-cli` command is not available, try a local version via `npx playwright-cli`:

```bash
npx --no-install playwright-cli --version
```

When local version is available, use `npx playwright-cli` in all commands. Otherwise, install `playwright-cli` as a global command:

```bash
npm install -g @playwright/cli@latest
```

## Example: Form submission

```bash
playwright-cli open https://example.com/form
playwright-cli snapshot

playwright-cli fill e1 "user@example.com"
playwright-cli fill e2 "password123"
playwright-cli click e3
playwright-cli snapshot
playwright-cli close
```

## Example: Multi-tab workflow

```bash
playwright-cli open https://example.com
playwright-cli tab-new https://example.com/other
playwright-cli tab-list
playwright-cli tab-select 0
playwright-cli snapshot
playwright-cli close
```

## Example: Debugging with DevTools

```bash
playwright-cli open https://example.com
playwright-cli click e4
playwright-cli fill e7 "test"
playwright-cli console
playwright-cli requests
playwright-cli close
```

```bash
playwright-cli open https://example.com
playwright-cli tracing-start
playwright-cli click e4
playwright-cli fill e7 "test"
playwright-cli tracing-stop
playwright-cli close
```

## Example: Interactive session

Ask the user for UI review or design feedback. The user draws boxes on the live page and types comments; you receive the annotated screenshot, the snapshot of the marked region, and the user's notes. Use this whenever the user asks for "UI review", "design feedback", or to "ask the user what they think / want / mean":

```bash
playwright-cli open https://example.com
playwright-cli show --annotate
```

## Specific tasks

* **Running and Debugging Playwright tests** [references/playwright-tests.md](references/playwright-tests.md)
* **Request mocking** [references/request-mocking.md](references/request-mocking.md)
* **Running Playwright code** [references/running-code.md](references/running-code.md)
* **Browser session management** [references/session-management.md](references/session-management.md)
* **Spec-driven testing (plan / generate / heal)** [references/spec-driven-testing.md](references/spec-driven-testing.md)
* **Storage state (cookies, localStorage)** [references/storage-state.md](references/storage-state.md)
* **Test generation** [references/test-generation.md](references/test-generation.md)
* **Tracing** [references/tracing.md](references/tracing.md)
* **Video recording** [references/video-recording.md](references/video-recording.md)
* **Inspecting element attributes** [references/element-attributes.md](references/element-attributes.md)
# Inspecting Element Attributes

When the snapshot doesn't show an element's `id`, `class`, `data-*` attributes, or other DOM properties, use `eval` to inspect them.

## Examples

```bash
playwright-cli snapshot
# snapshot shows a button as e7 but doesn't reveal its id or data attributes

# get the element's id
playwright-cli eval "el => el.id" e7

# get all CSS classes
playwright-cli eval "el => el.className" e7

# get a specific attribute
playwright-cli eval "el => el.getAttribute('data-testid')" e7
playwright-cli eval "el => el.getAttribute('aria-label')" e7

# get a computed style property
playwright-cli eval "el => getComputedStyle(el).display" e7
```
# Running Playwright Tests

To run Playwright tests, use the `npx playwright test` command, or a package manager script. To avoid opening the interactive html report, use `PLAYWRIGHT_HTML_OPEN=never` environment variable.

```bash
# Run all tests
PLAYWRIGHT_HTML_OPEN=never npx playwright test

# Run all tests through a custom npm script
PLAYWRIGHT_HTML_OPEN=never npm run special-test-command
```

# Debugging Playwright Tests

To debug a failing Playwright test, run it with `--debug=cli` option. This command will pause the test at the start and print the debugging instructions.

**IMPORTANT**: run the command in the background and check the output until "Debugging Instructions" is printed. Make sure to stop the command after you have finished.

Once instructions containing a session name are printed, use `playwright-cli` to attach the session and explore the page.

```bash
# Run the test
PLAYWRIGHT_HTML_OPEN=never npx playwright test --debug=cli
# ...
# ... debugging instructions for "tw-abcdef" session ...
# ...

# Attach to the test
playwright-cli attach tw-abcdef
```

Keep the test running in the background while you explore and look for a fix.
The test is paused at the start, so you should step over or pause at a particular location
where the problem is most likely to be.

Every action you perform with `playwright-cli` generates corresponding Playwright TypeScript code.
This code appears in the output and can be copied directly into the test. Most of the time, a specific locator or an expectation should be updated, but it could also be a bug in the app. Use your judgement.

After fixing the test, stop the background test run. Rerun to check that test passes.
# Request Mocking

Intercept, mock, modify, and block network requests.

## CLI Route Commands

```bash
# Mock with custom status
playwright-cli route "**/*.jpg" --status=404

# Mock with JSON body
playwright-cli route "**/api/users" --body='[{"id":1,"name":"Alice"}]' --content-type=application/json

# Mock with custom headers
playwright-cli route "**/api/data" --body='{"ok":true}' --header="X-Custom: value"

# Remove headers from requests
playwright-cli route "**/*" --remove-header=cookie,authorization

# List active routes
playwright-cli route-list

# Remove a route or all routes
playwright-cli unroute "**/*.jpg"
playwright-cli unroute
```

## URL Patterns

```
**/api/users           - Exact path match
**/api/*/details       - Wildcard in path
**/*.{png,jpg,jpeg}    - Match file extensions
**/search?q=*          - Match query parameters
```

## Advanced Mocking with run-code

For conditional responses, request body inspection, response modification, or delays:

### Conditional Response Based on Request

```bash
playwright-cli run-code "async page => {
  await page.route('**/api/login', route => {
    const body = route.request().postDataJSON();
    if (body.username === 'admin') {
      route.fulfill({ body: JSON.stringify({ token: 'mock-token' }) });
    } else {
      route.fulfill({ status: 401, body: JSON.stringify({ error: 'Invalid' }) });
    }
  });
}"
```

### Modify Real Response

```bash
playwright-cli run-code "async page => {
  await page.route('**/api/user', async route => {
    const response = await route.fetch();
    const json = await response.json();
    json.isPremium = true;
    await route.fulfill({ response, json });
  });
}"
```

### Simulate Network Failures

```bash
playwright-cli run-code "async page => {
  await page.route('**/api/offline', route => route.abort('internetdisconnected'));
}"
# Options: connectionrefused, timedout, connectionreset, internetdisconnected
```

### Delayed Response

```bash
playwright-cli run-code "async page => {
  await page.route('**/api/slow', async route => {
    await new Promise(r => setTimeout(r, 3000));
    route.fulfill({ body: JSON.stringify({ data: 'loaded' }) });
  });
}"
```
# Running Custom Playwright Code

Use `run-code` to execute arbitrary Playwright code for advanced scenarios not covered by CLI commands.

## Syntax

```bash
playwright-cli run-code "async page => {
  // Your Playwright code here
  // Access page.context() for browser context operations
}"
```

You can also load the function from a file:

```bash
playwright-cli run-code --filename=./my-script.js
```


The code must be a single function expression, it is wrapped in `(...)` and evaluated.
import/export/require syntax is not supported.

## Geolocation

```bash
# Grant geolocation permission and set location
playwright-cli run-code "async page => {
  await page.context().grantPermissions(['geolocation']);
  await page.context().setGeolocation({ latitude: 37.7749, longitude: -122.4194 });
}"

# Set location to London
playwright-cli run-code "async page => {
  await page.context().grantPermissions(['geolocation']);
  await page.context().setGeolocation({ latitude: 51.5074, longitude: -0.1278 });
}"

# Clear geolocation override
playwright-cli run-code "async page => {
  await page.context().clearPermissions();
}"
```

## Permissions

```bash
# Grant multiple permissions
playwright-cli run-code "async page => {
  await page.context().grantPermissions([
    'geolocation',
    'notifications',
    'camera',
    'microphone'
  ]);
}"

# Grant permissions for specific origin
playwright-cli run-code "async page => {
  await page.context().grantPermissions(['clipboard-read'], {
    origin: 'https://example.com'
  });
}"
```

## Media Emulation

```bash
# Emulate dark color scheme
playwright-cli run-code "async page => {
  await page.emulateMedia({ colorScheme: 'dark' });
}"

# Emulate light color scheme
playwright-cli run-code "async page => {
  await page.emulateMedia({ colorScheme: 'light' });
}"

# Emulate reduced motion
playwright-cli run-code "async page => {
  await page.emulateMedia({ reducedMotion: 'reduce' });
}"

# Emulate print media
playwright-cli run-code "async page => {
  await page.emulateMedia({ media: 'print' });
}"
```

## Wait Strategies

```bash
# Wait for network idle
playwright-cli run-code "async page => {
  await page.waitForLoadState('networkidle');
}"

# Wait for specific element
playwright-cli run-code "async page => {
  await page.locator('.loading').waitFor({ state: 'hidden' });
}"

# Wait for function to return true
playwright-cli run-code "async page => {
  await page.waitForFunction(() => window.appReady === true);
}"

# Wait with timeout
playwright-cli run-code "async page => {
  await page.locator('.result').waitFor({ timeout: 10000 });
}"
```

## Frames and Iframes

```bash
# Work with iframe
playwright-cli run-code "async page => {
  const frame = page.locator('iframe#my-iframe').contentFrame();
  await frame.locator('button').click();
}"

# Get all frames
playwright-cli run-code "async page => {
  const frames = page.frames();
  return frames.map(f => f.url());
}"
```

## File Downloads

```bash
# Handle file download
playwright-cli run-code "async page => {
  const downloadPromise = page.waitForEvent('download');
  await page.getByRole('link', { name: 'Download' }).click();
  const download = await downloadPromise;
  await download.saveAs('./downloaded-file.pdf');
  return download.suggestedFilename();
}"
```

## Clipboard

```bash
# Read clipboard (requires permission)
playwright-cli run-code "async page => {
  await page.context().grantPermissions(['clipboard-read']);
  return await page.evaluate(() => navigator.clipboard.readText());
}"

# Write to clipboard
playwright-cli run-code "async page => {
  await page.evaluate(text => navigator.clipboard.writeText(text), 'Hello clipboard!');
}"
```

## Page Information

```bash
# Get page title
playwright-cli run-code "async page => {
  return await page.title();
}"

# Get current URL
playwright-cli run-code "async page => {
  return page.url();
}"

# Get page content
playwright-cli run-code "async page => {
  return await page.content();
}"

# Get viewport size
playwright-cli run-code "async page => {
  return page.viewportSize();
}"
```

## JavaScript Execution

```bash
# Execute JavaScript and return result
playwright-cli run-code "async page => {
  return await page.evaluate(() => {
    return {
      userAgent: navigator.userAgent,
      language: navigator.language,
      cookiesEnabled: navigator.cookieEnabled
    };
  });
}"

# Pass arguments to evaluate
playwright-cli run-code "async page => {
  const multiplier = 5;
  return await page.evaluate(m => document.querySelectorAll('li').length * m, multiplier);
}"
```

## Error Handling

```bash
# Try-catch in run-code
playwright-cli run-code "async page => {
  try {
    await page.getByRole('button', { name: 'Submit' }).click({ timeout: 1000 });
    return 'clicked';
  } catch (e) {
    return 'element not found';
  }
}"
```

## Complex Workflows

```bash
# Login and save state
playwright-cli run-code "async page => {
  await page.goto('https://example.com/login');
  await page.getByRole('textbox', { name: 'Email' }).fill('user@example.com');
  await page.getByRole('textbox', { name: 'Password' }).fill('secret');
  await page.getByRole('button', { name: 'Sign in' }).click();
  await page.waitForURL('**/dashboard');
  await page.context().storageState({ path: 'auth.json' });
  return 'Login successful';
}"

# Scrape data from multiple pages
playwright-cli run-code "async page => {
  const results = [];
  for (let i = 1; i <= 3; i++) {
    await page.goto(\`https://example.com/page/\${i}\`);
    const items = await page.locator('.item').allTextContents();
    results.push(...items);
  }
  return results;
}"
```
# Browser Session Management

Run multiple isolated browser sessions concurrently with state persistence.

## Named Browser Sessions

Use `-s` flag to isolate browser contexts:

```bash
# Browser 1: Authentication flow
playwright-cli -s=auth open https://app.example.com/login

# Browser 2: Public browsing (separate cookies, storage)
playwright-cli -s=public open https://example.com

# Commands are isolated by browser session
playwright-cli -s=auth fill e1 "user@example.com"
playwright-cli -s=public snapshot
```

## Browser Session Isolation Properties

Each browser session has independent:
- Cookies
- LocalStorage / SessionStorage
- IndexedDB
- Cache
- Browsing history
- Open tabs

## Browser Session Commands

```bash
# List all browser sessions
playwright-cli list

# Stop a browser session (close the browser)
playwright-cli close                # stop the default browser
playwright-cli -s=mysession close   # stop a named browser

# Stop all browser sessions
playwright-cli close-all

# Forcefully kill all daemon processes (for stale/zombie processes)
playwright-cli kill-all

# Delete browser session user data (profile directory)
playwright-cli delete-data                # delete default browser data
playwright-cli -s=mysession delete-data   # delete named browser data
```

## Environment Variable

Set a default browser session name via environment variable:

```bash
export PLAYWRIGHT_CLI_SESSION="mysession"
playwright-cli open example.com  # Uses "mysession" automatically
```

## Common Patterns

### Concurrent Scraping

```bash
#!/bin/bash
# Scrape multiple sites concurrently

# Start all browsers
playwright-cli -s=site1 open https://site1.com &
playwright-cli -s=site2 open https://site2.com &
playwright-cli -s=site3 open https://site3.com &
wait

# Take snapshots from each
playwright-cli -s=site1 snapshot
playwright-cli -s=site2 snapshot
playwright-cli -s=site3 snapshot

# Cleanup
playwright-cli close-all
```

### A/B Testing Sessions

```bash
# Test different user experiences
playwright-cli -s=variant-a open "https://app.com?variant=a"
playwright-cli -s=variant-b open "https://app.com?variant=b"

# Compare
playwright-cli -s=variant-a screenshot
playwright-cli -s=variant-b screenshot
```

### Persistent Profile

By default, browser profile is kept in memory only. Use `--persistent` flag on `open` to persist the browser profile to disk:

```bash
# Use persistent profile (auto-generated location)
playwright-cli open https://example.com --persistent

# Use persistent profile with custom directory
playwright-cli open https://example.com --profile=/path/to/profile
```

## Attaching to a Running Browser

Use `attach` to connect to a browser that is already running, instead of launching a new one.

### Attach by channel name

Connect to a running Chrome or Edge instance by its channel name. The browser must have remote debugging enabled â€” navigate to `chrome://inspect/#remote-debugging` in the target browser and check "Allow remote debugging for this browser instance".

```bash
# Attach to Chrome
playwright-cli attach --cdp=chrome

# Attach to Chrome Canary
playwright-cli attach --cdp=chrome-canary

# Attach to Microsoft Edge
playwright-cli attach --cdp=msedge

# Attach to Edge Dev
playwright-cli attach --cdp=msedge-dev
```

Supported channels: `chrome`, `chrome-beta`, `chrome-dev`, `chrome-canary`, `msedge`, `msedge-beta`, `msedge-dev`, `msedge-canary`.

When `--session` is not provided, the session is named after the channel (e.g. `--cdp=msedge` creates a session called `msedge`), so parallel attaches to Chrome and Edge don't collide on `default`. Pass `--session=<name>` to override.

### Attach via CDP endpoint

Connect to a browser that exposes a Chrome DevTools Protocol endpoint:

```bash
playwright-cli attach --cdp=http://localhost:9222
```

### Attach via browser extension

Connect to a browser with the Playwright extension installed:

```bash
playwright-cli attach --extension
```

### Detach

Tear down an attached session without affecting the external browser:

```bash
# Detach the default attached session
playwright-cli detach

# Detach a specific attached session
playwright-cli -s=msedge detach
```

`detach` only works on sessions created via `attach`. For sessions created via `open`, use `close`.

## Default Browser Session

When `-s` is omitted, commands use the default browser session:

```bash
# These use the same default browser session
playwright-cli open https://example.com
playwright-cli snapshot
playwright-cli close  # Stops default browser
```

## Browser Session Configuration

Configure a browser session with specific settings when opening:

```bash
# Open with config file
playwright-cli open https://example.com --config=.playwright/my-cli.json

# Open with specific browser
playwright-cli open https://example.com --browser=firefox

# Open in headed mode
playwright-cli open https://example.com --headed

# Open with persistent profile
playwright-cli open https://example.com --persistent
```

## Best Practices

### 1. Name Browser Sessions Semantically

```bash
# GOOD: Clear purpose
playwright-cli -s=github-auth open https://github.com
playwright-cli -s=docs-scrape open https://docs.example.com

# AVOID: Generic names
playwright-cli -s=s1 open https://github.com
```

### 2. Always Clean Up

```bash
# Stop browsers when done
playwright-cli -s=auth close
playwright-cli -s=scrape close

# Or stop all at once
playwright-cli close-all

# If browsers become unresponsive or zombie processes remain
playwright-cli kill-all
```

### 3. Delete Stale Browser Data

```bash
# Remove old browser data to free disk space
playwright-cli -s=oldsession delete-data
```
# Spec-driven testing (plan â†’ generate â†’ heal)

End-to-end workflow for authoring and maintaining Playwright tests using `playwright-cli`. The three sections below can be used independently:

- **Planning** â€” explore the app, produce a spec file describing what to test.
- **Generate** â€” turn a spec into Playwright test files. Update the spec if it's vague or stale.
- **Heal** â€” diagnose failing tests, fix the code, reconcile the spec with reality.

All three lean on the same mechanic: run `npx playwright test --debug=cli` in the background, then `playwright-cli attach tw-XXXX` to drive the paused page interactively. See [playwright-tests.md](playwright-tests.md) for the debug/attach mechanics and [test-generation.md](test-generation.md) for how every `playwright-cli` action emits Playwright TypeScript.

---

## 1. Planning

Goal: produce a spec file (e.g. `specs/<feature>.plan.md`) that enumerates the scenarios to test. **Always** write the spec to a file.

### 1.1 Prerequisite: workspace

Check the workspace has Playwright installed before anything else:

```bash
# Either of these confirms a workspace:
test -f playwright.config.ts || test -f playwright.config.js
npx --no-install playwright --version
```

If there is no Playwright install, bootstrap one and let the user pick the defaults:

```bash
npm init playwright@latest
```

### 1.2 Prerequisite: seed test

A **seed test** is a minimal test that lands the page in the state every scenario starts from: navigation to the app, any required login, feature flags, etc. Scenarios assume a fresh start *after* the seed. `--debug=cli` pauses *inside* this test, so the seed is where every planning and generation session begins.

Minimum viable seed:

```ts
// tests/seed.spec.ts
import { test } from '@playwright/test';

test('seed', async ({ page }) => {
  await page.goto('https://example.com/');
});
```

Preferred â€” push navigation into a fixture so scenario tests reuse it:

```ts
// tests/fixtures.ts
import { test as baseTest } from '@playwright/test';
export { expect } from '@playwright/test';

export const test = baseTest.extend({
  page: async ({ page }, use) => {
    await page.goto('https://example.com/');
    await use(page);
  },
});
```

```ts
// tests/seed.spec.ts
import { test } from './fixtures';

test('seed', async ({ page }) => {
  // Fixture already navigates. This empty body tells agents where to start.
});
```

If no seed exists, create one that at least navigates to the app.

### 1.3 Explore the app

Launch the app via the seed in the background and attach:

```bash
PLAYWRIGHT_HTML_OPEN=never npx playwright test tests/seed.spec.ts --debug=cli
# wait for "Debugging Instructions" and the session name tw-XXXX
playwright-cli attach tw-XXXX
```

Resume so the seed runs, then probe the app:

```bash
playwright-cli resume                   # resume so that seed test runs fully
playwright-cli snapshot                 # inventory of interactive elements
playwright-cli click e5                 # follow a flow
playwright-cli eval "location.href"     # read URL / state
playwright-cli show --annotate          # ask the user to point at something
```

Map out:

- Interactive surfaces (forms, buttons, lists, filters, modals).
- Primary user journeys end-to-end.
- Edge cases: empty states, validation errors, very long input, boundary values.
- Persistence: reload, local/session storage, URL fragments.
- Navigation: which controls change the URL, back/forward behaviour.

**Important**: Do not just open the app url with playwright-cli, always go through the test to capture any custom setup done there.
**Important**: Stop the background test when done exploring.

### 1.4 Write the spec file

Save under `specs/<feature>.plan.md`. Use this structure:

```markdown
# <Feature> Test Plan

## Application Overview

<One paragraph describing what the feature does and why it matters.>

## Test Scenarios

### 1. <Group Name>

**Seed:** `tests/seed.spec.ts`

#### 1.1. <kebab-case-scenario-name>

**File:** `tests/<group>/<kebab-case-scenario-name>.spec.ts`

**Steps:**
  1. <Concrete user step>
    - expect: <observable outcome>
    - expect: <another observable outcome>
  2. <Next step>
    - expect: <outcome>

#### 1.2. <next-scenario>
...

### 2. <Next Group>

**Seed:** `tests/seed.spec.ts`
...
```

Guidelines:

- Each scenario is independent and starts from the seed's fresh state â€” never chain scenarios.
- Scenario names are kebab-case and match the test file name (`should-add-single-todo` â†’ `should-add-single-todo.spec.ts`).
- Cover happy path, edge cases, validation, negative flows, persistence.
- Write steps at the user level ("Type 'Buy milk' into the input"), not the API level ("call `fill`").
- Put observable outcomes in `- expect:` bullets; each becomes an assertion during generation.

---

## 2. Generate

Goal: take a spec file and produce Playwright test files. Optionally update the spec if it has drifted.

### 2.1 Inputs

- **Spec file**, e.g. `specs/basic-operations.plan.md`.
- **Target**: either a single scenario (e.g. `1.2`), a whole group (`1`), or all.
- **Seed file**, read from the `**Seed:**` line of the scenario's group.

### 2.2 Generate one scenario

For each target scenario, in sequence (never in parallel â€” scenarios share the seed session):

```bash
PLAYWRIGHT_HTML_OPEN=never npx playwright test <seed-file> --debug=cli   # background
playwright-cli attach tw-XXXX
# resume
```

**Do not** just open the app url with playwright-cli, always go through the test to capture any custom setup done there.

Walk the scenario's `Steps:` one by one with `playwright-cli`, treating the spec as the plan and the live app as the source of truth. If a step is vague ("click the button" â€” which button?), references an element that no longer exists, or contradicts the app's actual behaviour, use your judgement: update the spec to match what the app really does, then keep going. Editing the spec mid-generation is expected.

Every action prints the equivalent Playwright TypeScript (see [test-generation.md](test-generation.md)):

```bash
playwright-cli snapshot                         # find refs
playwright-cli fill e3 "John Doe"               # -> page.getByRole('textbox', {...}).fill(...)
playwright-cli press Enter
playwright-cli click e7
```

For each `- expect:` bullet, add an explicit assertion. See [test-generation.md](test-generation.md) for details.

Collect the generated code and write the test file at the path given in the spec:

```ts
// spec: specs/basic-operations.plan.md
// seed: tests/seed.spec.ts
import { test, expect } from './fixtures';   // or '@playwright/test' if no fixtures file

test.describe('Signing in and out', () => {
  test('should sign in', async ({ page }) => {
    // 1. Navigate to the application
    // (handled by the seed fixture)

    // 2. Type 'John Doe' into the username field
    await page.getByRole('textbox', { name: 'username' }).fill('John Doe');

    // 3. Type password
    await page.getByRole('textbox', { name: 'password' }).fill('TestPassword');

    // 4. Press Enter to submit
    await page.getByRole('textbox', { name: 'password' }).press('Enter');

    await expect(page.getByRole('heading')).toContainText('Welcome, John Doe!');
  });
});
```

Rules:

- **One test per file.** File path, describe name, and test name come verbatim from the spec (minus the ordinal).
- Prefix each numbered step with a `// N. <step text>` comment before its actions.
- Use the describe group name verbatim from the spec (no `1.` ordinal).
- Import from `./fixtures` if the project has one; otherwise `@playwright/test`.
- **Important**: close the CLI session and stop the background test before moving to the next scenario.

### 2.3 Generate multiple scenarios

Loop 2.2 over the targeted scenarios one at a time, restarting the seed between each so every test starts from a clean page. This is safe to parallelise due to unique generated session names - just make sure each test run is stopped.

### 2.4 Run generated tests

After generation, run the new tests once:

```bash
PLAYWRIGHT_HTML_OPEN=never npx playwright test tests/<group>/<scenario>.spec.ts
```

Any failure goes to Section 3.

---

## 3. Heal

Goal: fix failing tests, and update the spec if the app's intended behaviour changed.

### 3.1 Find failing tests

```bash
PLAYWRIGHT_HTML_OPEN=never npx playwright test
```

Record the list of failing `<file>:<line>` entries and process them one at a time. Do not attempt parallel fixes â€” shared state and the single CLI session make that fragile.

### 3.2 Debug one failure

Run the single failing test in debug mode in the background, then attach:

```bash
PLAYWRIGHT_HTML_OPEN=never npx playwright test tests/<group>/<scenario>.spec.ts:<line> --debug=cli
# wait for "Debugging Instructions" and the tw-XXXX session name
playwright-cli attach tw-XXXX
```

The test is paused at the start. Step forward or run to until just before the failing action or assertion, then diagnose:

```bash
playwright-cli snapshot                # did the element change / move / rename?
playwright-cli console                 # app-side errors?
playwright-cli requests                # failed request? wrong payload?
playwright-cli show --annotate         # ask the user to point somewhere
```

Common causes: selector drift, new wrapper element, label/ARIA rename, timing (transition, async load), assertion text updated in the app, test data leaking between runs.

Rehearse the corrected interaction with `playwright-cli` â€” the generated code in the output is what you paste back into the test.

### 3.3 Apply the fix

Edit the test file: update the locator, assertion, step order, or inputs to match the corrected behaviour. Stop the background debug run. Rerun the single test to confirm green.

Never skip hooks or add sleeps as a fix. Never use `networkidle`.

### 3.4 Reconcile with the spec

Open the spec referenced by the `// spec:` header in the test file and locate the scenario that matches the test.

- **Fix was purely technical** (locator drift, better assertion shape) and the spec's user-level behaviour still matches the app â†’ leave the spec alone.
- **Fix changed user-visible steps, inputs, order, or expected outcomes** that the spec describes â†’ update the spec to match reality. Keep the scenario id and file path stable; only the step / expect lines change.
- **Unclear whether the app change is intentional** (spec is stale) **or a regression** (test was right, app is wrong) â†’ **stop and ask the user**. Provide:
  - the scenario id (e.g. `2.3`),
  - the spec lines that no longer match,
  - the observed app behaviour (quote a snapshot excerpt or a concrete outcome).

Only after the user answers, either update the spec (intentional change) or file/flag the test as covering a bug (regression).

### 3.5 Iteration and giving up

- Fix failures one at a time; rerun after each.
- If after thorough investigation you are confident the test is correct but the app is wrong *and* the user has confirmed it's a bug: mark the test `test.fixme(...)` with a comment pointing at the user's decision or issue link. Never silently skip.

---

## Cross-references

| For... | See |
|---|---|
| `--debug=cli` / attach mechanics | [playwright-tests.md](playwright-tests.md) |
| How `playwright-cli` actions become TS | [test-generation.md](test-generation.md) |
| Mocking requests during exploration/generation | [request-mocking.md](request-mocking.md) |
| Managing the CLI browser session | [session-management.md](session-management.md) |
# Storage Management

Manage cookies, localStorage, sessionStorage, and browser storage state.

## Storage State

Save and restore complete browser state including cookies and storage.

### Save Storage State

```bash
# Save to auto-generated filename (storage-state-{timestamp}.json)
playwright-cli state-save

# Save to specific filename
playwright-cli state-save my-auth-state.json
```

### Restore Storage State

```bash
# Load storage state from file
playwright-cli state-load my-auth-state.json

# Reload page to apply cookies
playwright-cli open https://example.com
```

### Storage State File Format

The saved file contains:

```json
{
  "cookies": [
    {
      "name": "session_id",
      "value": "abc123",
      "domain": "example.com",
      "path": "/",
      "expires": 1893456000,
      "httpOnly": true,
      "secure": true,
      "sameSite": "Lax"
    }
  ],
  "origins": [
    {
      "origin": "https://example.com",
      "localStorage": [
        { "name": "theme", "value": "dark" },
        { "name": "user_id", "value": "12345" }
      ]
    }
  ]
}
```

## Cookies

### List All Cookies

```bash
playwright-cli cookie-list
```

### Filter Cookies by Domain

```bash
playwright-cli cookie-list --domain=example.com
```

### Filter Cookies by Path

```bash
playwright-cli cookie-list --path=/api
```

### Get Specific Cookie

```bash
playwright-cli cookie-get session_id
```

### Set a Cookie

```bash
# Basic cookie
playwright-cli cookie-set session abc123

# Cookie with options
playwright-cli cookie-set session abc123 --domain=example.com --path=/ --httpOnly --secure --sameSite=Lax

# Cookie with expiration (Unix timestamp)
playwright-cli cookie-set remember_me token123 --expires=1893456000
```

### Delete a Cookie

```bash
playwright-cli cookie-delete session_id
```

### Clear All Cookies

```bash
playwright-cli cookie-clear
```

### Advanced: Multiple Cookies or Custom Options

For complex scenarios like adding multiple cookies at once, use `run-code`:

```bash
playwright-cli run-code "async page => {
  await page.context().addCookies([
    { name: 'session_id', value: 'sess_abc123', domain: 'example.com', path: '/', httpOnly: true },
    { name: 'preferences', value: JSON.stringify({ theme: 'dark' }), domain: 'example.com', path: '/' }
  ]);
}"
```

## Local Storage

### List All localStorage Items

```bash
playwright-cli localstorage-list
```

### Get Single Value

```bash
playwright-cli localstorage-get token
```

### Set Value

```bash
playwright-cli localstorage-set theme dark
```

### Set JSON Value

```bash
playwright-cli localstorage-set user_settings '{"theme":"dark","language":"en"}'
```

### Delete Single Item

```bash
playwright-cli localstorage-delete token
```

### Clear All localStorage

```bash
playwright-cli localstorage-clear
```

### Advanced: Multiple Operations

For complex scenarios like setting multiple values at once, use `run-code`:

```bash
playwright-cli run-code "async page => {
  await page.evaluate(() => {
    localStorage.setItem('token', 'jwt_abc123');
    localStorage.setItem('user_id', '12345');
    localStorage.setItem('expires_at', Date.now() + 3600000);
  });
}"
```

## Session Storage

### List All sessionStorage Items

```bash
playwright-cli sessionstorage-list
```

### Get Single Value

```bash
playwright-cli sessionstorage-get form_data
```

### Set Value

```bash
playwright-cli sessionstorage-set step 3
```

### Delete Single Item

```bash
playwright-cli sessionstorage-delete step
```

### Clear sessionStorage

```bash
playwright-cli sessionstorage-clear
```

## IndexedDB

### List Databases

```bash
playwright-cli run-code "async page => {
  return await page.evaluate(async () => {
    const databases = await indexedDB.databases();
    return databases;
  });
}"
```

### Delete Database

```bash
playwright-cli run-code "async page => {
  await page.evaluate(() => {
    indexedDB.deleteDatabase('myDatabase');
  });
}"
```

## Common Patterns

### Authentication State Reuse

```bash
# Step 1: Login and save state
playwright-cli open https://app.example.com/login
playwright-cli snapshot
playwright-cli fill e1 "user@example.com"
playwright-cli fill e2 "password123"
playwright-cli click e3

# Save the authenticated state
playwright-cli state-save auth.json

# Step 2: Later, restore state and skip login
playwright-cli state-load auth.json
playwright-cli open https://app.example.com/dashboard
# Already logged in!
```

### Save and Restore Roundtrip

```bash
# Set up authentication state
playwright-cli open https://example.com
playwright-cli eval "() => { document.cookie = 'session=abc123'; localStorage.setItem('user', 'john'); }"

# Save state to file
playwright-cli state-save my-session.json

# ... later, in a new session ...

# Restore state
playwright-cli state-load my-session.json
playwright-cli open https://example.com
# Cookies and localStorage are restored!
```

## Security Notes

- Never commit storage state files containing auth tokens
- Add `*.auth-state.json` to `.gitignore`
- Delete state files after automation completes
- Use environment variables for sensitive data
- By default, sessions run in-memory mode which is safer for sensitive operations
# Test Generation

Generate Playwright test code automatically as you interact with the browser.

## How It Works

Every action you perform with `playwright-cli` generates corresponding Playwright TypeScript code.
This code appears in the output and can be copied directly into your test files.

## Example Workflow

```bash
# Start a session
playwright-cli open https://example.com/login

# Take a snapshot to see elements
playwright-cli snapshot
# Output shows: e1 [textbox "Email"], e2 [textbox "Password"], e3 [button "Sign In"]

# Fill form fields - generates code automatically
playwright-cli fill e1 "user@example.com"
# Ran Playwright code:
# await page.getByRole('textbox', { name: 'Email' }).fill('user@example.com');

playwright-cli fill e2 "password123"
# Ran Playwright code:
# await page.getByRole('textbox', { name: 'Password' }).fill('password123');

playwright-cli click e3
# Ran Playwright code:
# await page.getByRole('button', { name: 'Sign In' }).click();
```

## Building a Test File

Collect the generated code into a Playwright test:

```typescript
import { test, expect } from '@playwright/test';

test('login flow', async ({ page }) => {
  // Generated code from playwright-cli session:
  await page.goto('https://example.com/login');
  await page.getByRole('textbox', { name: 'Email' }).fill('user@example.com');
  await page.getByRole('textbox', { name: 'Password' }).fill('password123');
  await page.getByRole('button', { name: 'Sign In' }).click();

  // Add assertions
  await expect(page).toHaveURL(/.*dashboard/);
});
```

## Best Practices

### 1. Use Semantic Locators

The generated code uses role-based locators when possible, which are more resilient:

```typescript
// Generated (good - semantic)
await page.getByRole('button', { name: 'Submit' }).click();

// Avoid (fragile - CSS selectors)
await page.locator('#submit-btn').click();
```

### 2. Explore Before Recording

Take snapshots to understand the page structure before recording actions:

```bash
playwright-cli open https://example.com
playwright-cli snapshot
# Review the element structure
playwright-cli click e5
```

### 3. Add Assertions Manually

Generated code captures actions but not assertions. Add expectations in your test using one of the recommended matchers:

- `toBeVisible()` â€” element is rendered and visible
- `toHaveText(text)` â€” element text content matches
- `toHaveValue(value) / toBeEmpty()` â€” input/select value matches
- `toBeChecked() / toBeUnchecked()` â€” checkbox state matches
- `toMatchAriaSnapshot(snapshot)` â€” page (or locator) matches a partial accessibility snapshot

Use `playwright-cli generate-locator <target>` to produce the locator expression for the assertion, and the snapshot/eval commands to capture the expected value.

When asserting text content, make sure that generated locator does not contain text from the element itself. `getByTestId()` or `getByLabel()` usually work well with asserting text. When locator is text-based, prefer `toBeVisible()` instead.

Snapshot to be matched does not have to contain all the information - only capture what's necessary for the assertion. You can use regular expressions for unstable values.

```bash
# Get a stable locator for an element ref to use in the assertion
playwright-cli --raw generate-locator e5
# getByRole('button', { name: 'Submit' })

# Capture expected text content for toHaveText
playwright-cli --raw eval "el => el.textContent" e5

# Capture expected input value for toHaveValue/toBeEmpty
playwright-cli --raw eval "el => el.value" e5

# Capture expected aria snapshot for toMatchAriaSnapshot/toBeChecked
# (whole page, or use a ref to scope to a region)
playwright-cli --raw snapshot
playwright-cli --raw snapshot e5
```

```typescript
// Generated action
await page.getByRole('button', { name: 'Submit' }).click();

// Manual assertions using the outputs above:
await expect(page.getByRole('alert', { name: 'Success' })).toBeVisible();
await expect(page.getByTestId('main-header')).toHaveText('Welcome, user');
await expect(page.getByRole('textbox', { name: 'Email' })).toHaveValue('user@example.com');
await expect(page.getByRole('checkbox', { name: 'Enable notifications' })).toBeChecked();

// toMatchAriaSnapshot on the whole page, finds a matching region
await expect(page).toMatchAriaSnapshot(`
  - heading "Welcome, user"
  - link /\\d+ new messages?/
  - button "Sign out"
`);

// toMatchAriaSnapshot scoped to a region
await expect(page.getByRole('navigation')).toMatchAriaSnapshot(`
  - link "Home"
  - link /\\d+ new messages?/
  - link "Profile"
`);
```
# Tracing

Capture detailed execution traces for debugging and analysis. Traces include DOM snapshots, screenshots, network activity, and console logs.

## Basic Usage

```bash
# Start trace recording
playwright-cli tracing-start

# Perform actions
playwright-cli open https://example.com
playwright-cli click e1
playwright-cli fill e2 "test"

# Stop trace recording
playwright-cli tracing-stop
```

## Trace Output Files

When you start tracing, Playwright creates a `traces/` directory with several files:

### `trace-{timestamp}.trace`

**Action log** - The main trace file containing:
- Every action performed (clicks, fills, navigations)
- DOM snapshots before and after each action
- Screenshots at each step
- Timing information
- Console messages
- Source locations

### `trace-{timestamp}.network`

**Network log** - Complete network activity:
- All HTTP requests and responses
- Request headers and bodies
- Response headers and bodies
- Timing (DNS, connect, TLS, TTFB, download)
- Resource sizes
- Failed requests and errors

### `resources/`

**Resources directory** - Cached resources:
- Images, fonts, stylesheets, scripts
- Response bodies for replay
- Assets needed to reconstruct page state

## What Traces Capture

| Category | Details |
|----------|---------|
| **Actions** | Clicks, fills, hovers, keyboard input, navigations |
| **DOM** | Full DOM snapshot before/after each action |
| **Screenshots** | Visual state at each step |
| **Network** | All requests, responses, headers, bodies, timing |
| **Console** | All console.log, warn, error messages |
| **Timing** | Precise timing for each operation |

## Use Cases

### Debugging Failed Actions

```bash
playwright-cli tracing-start
playwright-cli open https://app.example.com

# This click fails - why?
playwright-cli click e5

playwright-cli tracing-stop
# Open trace to see DOM state when click was attempted
```

### Analyzing Performance

```bash
playwright-cli tracing-start
playwright-cli open https://slow-site.com
playwright-cli tracing-stop

# View network waterfall to identify slow resources
```

### Capturing Evidence

```bash
# Record a complete user flow for documentation
playwright-cli tracing-start

playwright-cli open https://app.example.com/checkout
playwright-cli fill e1 "4111111111111111"
playwright-cli fill e2 "12/25"
playwright-cli fill e3 "123"
playwright-cli click e4

playwright-cli tracing-stop
# Trace shows exact sequence of events
```

## Trace vs Video vs Screenshot

| Feature | Trace | Video | Screenshot |
|---------|-------|-------|------------|
| **Format** | .trace file | .webm video | .png/.jpeg image |
| **DOM inspection** | Yes | No | No |
| **Network details** | Yes | No | No |
| **Step-by-step replay** | Yes | Continuous | Single frame |
| **File size** | Medium | Large | Small |
| **Best for** | Debugging | Demos | Quick capture |

## Best Practices

### 1. Start Tracing Before the Problem

```bash
# Trace the entire flow, not just the failing step
playwright-cli tracing-start
playwright-cli open https://example.com
# ... all steps leading to the issue ...
playwright-cli tracing-stop
```

### 2. Clean Up Old Traces

Traces can consume significant disk space:

```bash
# Remove traces older than 7 days
find .playwright-cli/traces -mtime +7 -delete
```

## Limitations

- Traces add overhead to automation
- Large traces can consume significant disk space
- Some dynamic content may not replay perfectly
# Video Recording

Capture browser automation sessions as video for debugging, documentation, or verification. Produces WebM (VP8/VP9 codec).

## Basic Recording

```bash
# Open browser first
playwright-cli open

# Start recording
playwright-cli video-start demo.webm

# Add a chapter marker for section transitions
playwright-cli video-chapter "Getting Started" --description="Opening the homepage" --duration=2000

# Navigate and perform actions
playwright-cli goto https://example.com
playwright-cli snapshot
playwright-cli click e1

# Add another chapter
playwright-cli video-chapter "Filling Form" --description="Entering test data" --duration=2000
playwright-cli fill e2 "test input"

# Stop and save
playwright-cli video-stop
```

## Best Practices

### 1. Use Descriptive Filenames

```bash
# Include context in filename
playwright-cli video-start recordings/login-flow-2024-01-15.webm
playwright-cli video-start recordings/checkout-test-run-42.webm
```

### 2. Record entire hero scripts.

When recording a video for the user or as a proof of work, it is best to create a code snippet and execute it with run-code.
It allows inserting appropriate pauses between the actions and annotating the video. There are new Playwright APIs for that.

1) Perform scenario using CLI and take note of all locators and actions. You'll need those locators to request their bounding boxes for highlight.
2) Create a file with the intended script for video (below). Use pressSequentially w/ delay for nice typing, make reasonable pauses.
3) Use playwright-cli run-code --filename your-script.js

**Important**: Overlays are `pointer-events: none` â€” they do not interfere with page interactions. You can safely keep sticky overlays visible while clicking, filling, or performing any actions on the page.

```js
async page => {
  await page.screencast.start({ path: 'video.webm', size: { width: 1280, height: 800 } });
  await page.goto('https://demo.playwright.dev/todomvc');

  // Show a chapter card â€” blurs the page and shows a dialog.
  // Blocks until duration expires, then auto-removes.
  // Use this for simple use cases, but always feel free to hand-craft your own beautiful
  // overlay via await page.screencast.showOverlay().
  await page.screencast.showChapter('Adding Todo Items', {
    description: 'We will add several items to the todo list.',
    duration: 2000,
  });

  // Perform action
  await page.getByRole('textbox', { name: 'What needs to be done?' }).pressSequentially('Walk the dog', { delay: 60 });
  await page.getByRole('textbox', { name: 'What needs to be done?' }).press('Enter');
  await page.waitForTimeout(1000);

  // Show next chapter
  await page.screencast.showChapter('Verifying Results', {
    description: 'Checking the item appeared in the list.',
    duration: 2000,
  });

  // Add a sticky annotation that stays while you perform actions.
  // Overlays are pointer-events: none, so they won't block clicks.
  const annotation = await page.screencast.showOverlay(`
    <div style="position: absolute; top: 8px; right: 8px;
      padding: 6px 12px; background: rgba(0,0,0,0.7);
      border-radius: 8px; font-size: 13px; color: white;">
      âœ“ Item added successfully
    </div>
  `);

  // Perform more actions while the annotation is visible
  await page.getByRole('textbox', { name: 'What needs to be done?' }).pressSequentially('Buy groceries', { delay: 60 });
  await page.getByRole('textbox', { name: 'What needs to be done?' }).press('Enter');
  await page.waitForTimeout(1500);

  // Remove the annotation when done
  await annotation.dispose();

  // You can also highlight relevant locators and provide contextual annotations.
  const bounds = await page.getByText('Walk the dog').boundingBox();
  await page.screencast.showOverlay(`
    <div style="position: absolute;
      top: ${bounds.y}px;
      left: ${bounds.x}px;
      width: ${bounds.width}px;
      height: ${bounds.height}px;
      border: 1px solid red;">
    </div>
    <div style="position: absolute;
      top: ${bounds.y + bounds.height + 5}px;
      left: ${bounds.x + bounds.width / 2}px;
      transform: translateX(-50%);
      padding: 6px;
      background: #808080;
      border-radius: 10px;
      font-size: 14px;
      color: white;">Check it out, it is right above this text
    </div>
  `, { duration: 2000 });

  await page.screencast.stop();
}
```

Embrace creativity, overlays are powerful.

### Overlay API Summary

| Method | Use Case |
|--------|----------|
| `page.screencast.showChapter(title, { description?, duration?, styleSheet? })` | Full-screen chapter card with blurred backdrop â€” ideal for section transitions |
| `page.screencast.showOverlay(html, { duration? })` | Custom HTML overlay â€” use for callouts, labels, highlights |
| `disposable.dispose()` | Remove a sticky overlay added without duration |
| `page.screencast.hideOverlays()` / `page.screencast.showOverlays()` | Temporarily hide/show all overlays |

## Tracing vs Video

| Feature | Video | Tracing |
|---------|-------|---------|
| Output | WebM file | Trace file (viewable in Trace Viewer) |
| Shows | Visual recording | DOM snapshots, network, console, actions |
| Use case | Demos, documentation | Debugging, analysis |
| Size | Larger | Smaller |

## Limitations

- Recording adds slight overhead to automation
- Large recordings can consume significant disk space
‰PNG

   IHDR  �  �   €¿6Ì   bKGD ÿ ÿ ÿ ½§“    IDATxœìÝy|Õ•/ðß¹U½hµ-¯ï–dy‘1B€˜Äf‹m™BH$“õÍda2Iž3ÉLÂl«Ù2!�ÉXHbw,ÛDv[6–,¯26xßd[KoUuÏûÃ2È²¶nUwuKçûùh2ªî¾u,ºûÔ­{ï¹€B!„B!„B!„B!„B!„B!„B!„B!„B!„B!„B!„B!„B!„B!„B!„Bt�R}ÂÙW.žÆŽ}€ù �`<€œTÇ!„®Àn€÷XI†ùlÝŸË·¦2€”%�Yó�Oà{ |6UçBˆAæMü¨aeå©8YÒHYÙ�¾èð#÷ã©8ŸBrÐƒþ¦áÿ§¶v©•Ì%õ}æ‹”¶+ š›Ìó!„81þÂ�è¢ú—^:–¬s¨d5\Vv§Ïpœg$y!Dê1á2DýÏÍ\¼ØŸ¬s$-�D‡¹—	—%«}!„½ ºDwþ#iÍ'£Ñ™Ÿ[x�Rx'Yí!„è3éê«Ÿ­u»á¤ô@Â=�ä!„é€ õ›$5ì®YóL'¢Mn·+„"qd%n¯q½BP×»Ý¦Bˆ~Òú:·›tÿéy®·)„¢_˜y¾Ûmºž@4Áí6…Bô³ëßÍ¦ÛpV‚/�èž²7ÖU?Õæj`B‘¡f_~kšÅà/�q'€@Ü��ív\®¢—Î_È	¼l¯V|MÃŠªnÇ#„ÉÌù7ÌQP/ˆ;!Ô¯¬tõ;?i	ã•ä!„}Ó°òÙ÷4ôçD½ŽÅóB G$y!Dß5¬|ö= �z‡÷	D9ÿÏë„"ÓÃóïNÏˆõÉ¢C!„ˆ“c½ŽÁóÒPSÞêuB‘iÒá»Óó"„"3IB‘I B!"	D!DB$�!„Hˆ$!„	‘"„"!’@„B$DˆBˆ„HB‘I B!"	D!DB$�!„Hˆ$!„	‘"„"!’@„B$DˆBˆ„HB‘I B!"	D!DB$�!„Hˆ$!„	‘"„"!’@„B$DˆBˆ„HB‘I B!"	D!DB$�!„Hˆ$!„	‘"„"!’@„B$DˆBˆ„HB‘I B!"	D!DB$�!„Hˆ$!„	‘"„"!’@„B$DˆBˆ„HB‘I B!"	D!DB$�!„Hˆ$!„	‘"„"!’@„B$DˆBˆ„HB‘Óë „è�YÌRÖKvÔž¤L6‚æò ­nkøVC«×ñ	1�IDd¬Ù÷Í×¢#[¬�UÊƒáØNV¬5º°ÕŽ™úèŒïz£™$‘±ZŒèë:¦³»zLÛN Ö¹wÊƒ%k'=97˜êØ„$�ˆŒTøHÉOìˆ5±·çYáXµí=Pòdii*âb0‘"2CY1ûûút;ê	Ÿ¯+|xÚ�ÉKˆÁFˆÈ8…KKîîîÖUw´£ÍXØZV¼tÆ/’—ƒ�$‘qì˜þûD^Çi‰þ|ê#Ó—¹“ƒ‘Lãi¯ðª«Ùvö7˜øJ«ähk[lwA¢m1±ÖèâÉN{oç¡­çc	l7cb0‘"ÒÚœ¹7ulõgÄ
‚Õÿví°uÎä‘E{TeÖìëõ¿E!¹…%Òš6�§ | ¸ |Ø²c£ÜjÛŽ8£�=á]S–Î¼À­6…L$�ˆ´5kÞ‚…LüùS¿G.Ü»{Çr²œPä­ÂÇ¦ßênËB|’@DZš4÷+A"ú�S¿s–�QèìdœK;lD›c(|tú£Éh_ˆ�JˆHK¹¾_0éÔïÑ²½{ØaJÚ	™mŽÞ1å¡’ºi�OËKÚy„@$�ˆtD:­Ž•5¬ù¬TœØ
ÅJ£!çPñcÓoHÅù„Èd’@DÚ)�·à: ÓOýîLhÞæXN\ûÃ‰é`¤9V5õ¡’ÊT�SˆL$	D¤&úAÇß£³ö§¼"3#Š-˜ü@ñ‡%O–LJõù…È’@DZ™ù¹…pñG³çU<vÄ:aí˜º´äß¼ŠAˆt%	D¤2ðãŽ¿ÇÊöïbÍž¾OÙak‰ý`òýÅ»‹þ0kzï¯bp�"ÒFé¼ESˆqÚàulô±1^ÅÓ™µÇE›Â…OÊëX„H’@DúPúë ŒS¿:#ÂMŽåä{ÑØaŠ¶Eo™ü@ñÁ¢‡§Ï÷:!¼$	D¤…¹sçš`úrÇc±óö·°ÛKÏ]bGìQ‘P´zÊƒ%oO|ª,%SŒ…H7’@DZ8j»ÀØŽÇl[z13`…cŸä#'ö><ý),‘â¤bp‘"Ò}­ãïÎ„ï;¶ã÷*žx°Ö*Ú½eòðâcÅ�Í¼Íëx„HI Âs3ç.CÀ•�Åfd^…u;fç†O„?ùþâSŸ˜~³×ñ‘l’@„çÈïÜÀ×ñ˜e†=[ûÑ_vÔ;ýÓäû‹w>>ër¯ã"Y$�¯·w<àLl~_Û:#n_õÄŽÚã¢ÇC+&ß_¼{êã3/ó:!Ü&	DxjÖ¼?C@QÇcVÉ¡õ¾´£ö¸Ø‰ð+S,©/YZr‘×ñá–õA™G‘þjçc1_xlWÏÍh'glÍjk‰½1ùþâEKg|Ãë�„è/I Â3“æ~%Èàë;³'�øPgÈì«DÙQ{t¤%òÐÄß¶=2ã‘IOÎMy±H!Ü 	Dx&ßl¹ ÓVš[%½
'åtLgGZ#wêæ½-S™þòôÇ¦Oô:&!â!	Dxˆw>b›Ñô^<˜l;f¬5zU[klçä‡§­—Í¬D¦�•³Âe×^›‹àšŽÇôøæ½Ží$eßóLÀ“ÝfÍ±�ªÉ÷µ(¿Q¡óÍ»w~qãàé–‰Œ"=á	+ì¿
@î©ßÏ3l\YÐ<ÒÃ�ÒŠm9y±¶ØWœƒ¡ý“,ÞQøhÉOf.›9 Ç†Dæ‘"<Á„›`˜ÒøI°_5Zð~ND¾ ;a²Ãö”hsìŸ[öFÃS.©-Z:ó+`ùì
ïÉ-,‘re×^›mGøê/¢8a°f@ës[½-­±Ö*Ö;À“ï�ú˜zÈØfTaùÎúç]·×D¼ŽO>’@DÊÝç×³¡Åú£bíò5¹¦î3í°¡Cötø)©Ý?™òà´íd¨çsƒþ{7Ü¶a¯×ñ‰ÁAˆH™o¾fAý|$¼8dëÓ{ó¬6�¢Ê|¬YYak€6µF8ùþ¢ãdšo‚Æƒ›wm\Ž%Ð½6"D$�ˆ¤Ûuó5ÓÐ?0ð%VûÌï³¿Ž”ÛWn±£ÎPD�«ýY9WÏ.-kA¿ÃD«ð†yïÔÞUky£$�ˆ¤ùðækf1ènþ†Û'l„ºÓ.ƒ± pØŒyã@fM Èh1æ1 kNœSQö.€w@üŽ²ù�õ7­?ìm¤©Qúbé0#˜á�.&¦"&ÃdP ÛÀj½AÎ×/Zÿ�×±f
I ÂUÐî›¯�ðß¸œ êøx›íœñšºÑ2þë6Ã4 Ì.•†00À|0Á1³+Êv°AêHS�6ø½�jwfò­¯9Us&9Ž1‡ˆæ€ysÅDqû[’Ñ~)Ã  ^ä@ý¤´òü/Ö/\ûœwÑgI Â‹ûsUø»A? ¸´»ç…lûŒc5£åö•ÛÌ¬¸>Ú“˜LŒ@¥�Ù¥e!<ƒm¬°M1¶iâ-«]gOÌ‰ío¸©!-ºŒ3—]0F™˜F¬‹ˆyÍ0Gk#N^ÒÄÕd64ÿ¡¤òS¶,|÷h2bH$�ˆ~ùðæ«¦‚ÍÛ@á;ŒF§ÛSEwz\sÃÉrŠ3�t%„9Ä˜Ã ˆ©ýÖ£‚a1»¢ì ûì!¢}½P{ˆô1ÍF³RÜ‡ÚXSˆ³ÃÇý{ý­}{™öÜ§ó²Ês¢FžVN‘9TÁÉcÐYŒh±Ð8&:ïÔ[Ž)¾LÑ"äûØ^`©+`’@DÜv/^œ¥UèóºÀç>¾'Ð³�sæí«½C8”±wJÒ–ðõþ¤þÂh søÔ- 0˜	Ö ˆ ¨Ö`vEY@çévCÑ±�`Gà@CAÐàö‡Oþ_\J=!Ð�Ò+I ¢OxÉõaCíEJáVFø‹ÊíýU§ëjüãÍ1!Wâ3ü”‘ü/ÙøÛ2 �ö:‚L 	DtkûUWüyêºv÷¦µIa\÷7¨zfk†¥Ïìi¼>¢¥AŠ3ø‚Iï}|Ü·^õ`'	Dœfßß\;ÂÒú2º–�ëä'š4:
;gž;>B“)KÜÖ>}WôA¦ö�¼Ó¹í‹¯©4ß¢•ú¼f]ÖjÙùAÃ 7’FG]�ì–y"I n``¿×1dy§õ€µý¦«o&Íç0Ð¤ ÂšùÝ¢Š—ß¥ž¦¥±†EWÌô“º•ó5Pli>9–ñÑí¥�‡DÝÂ8¹€°³µ£düÃmFÀ)¹ûÒ_$	¤O$�t£qñUŸÝªñ²vtàã£'¿·,º[ˆB
Ø¢zEx5fŸ›QY™6+XwÎ�Ô£‚ŸÕÚø,ˆÏcp¡fŒÖÌ~«óTÚN4†‹)$¢è.N¹¦@ê_¹Í'½W0XHÈ»­6s•]=Æ ˜9[E`.°ºwó�WÚ:B„]Ši3@k‰ðŽq¸­ar�ûå¶_Q­f1Ñ9P<ÅaLc2ƒG…Á“ùÎ‰»¯äh†áâUl¸‹ÙWŽ�pHÆ?\gÊ º+K¤/$�taë‚+Îqùñ¾Ž&ƒÇ€1Æ_àv0€áAl^t¥&P„01BD!¤Á!t¼«ö4c1rXq4²™�†Ÿ‰ƒÌðÅ4p²Ÿê¹Âa7÷9gÎ¾ú`˜$·Ì€|¤Ý MÚçu™@Þm”|nÁp©¯Wh«ìåî /ŠÁY`d( TˆçŒâ‚gøxxâôÿM‡OŽ„�·±Íˆu1þ±~¸Œ¸Í˜î^b~Cz }!	¤ÝÌ¹‹Ç(å¬x\›Æ¯ãñšÃ€éÂ—QDwÝ5Z?LˆÛ\(_"NŠÕ~¾Vê`õ�ì×ŽLûï Œ Kö›>³fU‚ºš}E
Ø”)¼nóeÉø‡ø”™³,SmÐQžBD—žúÿwØ*ÇËXÒ�{	äÌñ�æ,îý¶�ˆ)‚òËÇÙÌØâu™BÞqû¨öÍ.MÃ¼$hæ~Å;Ý”/i”„®óMWÆ¬ Hé+I û¨ÖFŒÉG$%b�.¾üãÑÝøG}�T‰p›Œ¸ˆ°Õë2…$�v4�~€ý<S§Ÿ]�®n_À†¡²€ÐmR@ÑEš%�ô‘$�vDtÚ´=Mõ*–tas?{ Ý ËBw)CAù¯Ã8[HI9…ù@Ç_£|ÆÆ7ƒNûŠû„_ÛÕøÇ‰,<w›Ü¾rÕ±º…u‡¼"SHiÇ�Jf% Ø	&�¨Óõ<«†HïÃmR}×UÒûˆƒ¼óÚ‘¢ýèðeÙèÎxÓÅú ÊaF"w×»º} Û‡¤É�A”¡¢|Íõ·©¨a)Ç Ù'ËRpLí³ýV�vœ€K³š“BÆ?ÜC2+.’@Ú°¿ãwÄZ‹r.“¿lN¬¼{´›X[ó½›�ED0ÿAßÁ!­¾úQc(bæ Ùþó‘Î_ÇpBNqÓ~kBS0Æ‘³XsÚôÜ•OA™iNÆÓ Í^Ç�Iä+²�ã¨J}ü¥·Á2F#ËÃ€Òˆf†Añ¥�h73°vf¥>�(“(gà­qgQØ7ÖüôE�l³~äT³~$‚Šçœƒ�‘³�Œ¶m;/I!÷™ô>ÜFë¼Ž “H9¥ �8íëäÿZ8ó‚tÐqâL Žæ.ÇNØ$„U
—×(â@,ogð•‰gSÌ(t£IÒd˜ëÇæ®gÆ‘÷ÃSŽ²-+×�¶!åÛ]ÅDj½"“Hß·]Cyy„Ó6„ÒD­^Å“Nœ®vƒêA¬›é¿Ç²S7¦dúÌ¹kŠŽd­š2…bF—ûºô—±iÄ”ÜfædµßBÊ›Ú,¾ Lßu;ê?_Ìë82‰$�Ž:ÕÀ9ÁªÅ«PÒ‰ƒøÊštwûj_^jf`u~cî³òÌÃÙ#{v¿Qàõñ%ùëŠ>#¥÷ç¿2ä#ìIï#Nòîëˆi[Ç_7Û©ýBHgñWŒuSegnrk`‘ç³+X=¥)~oÓ�œ1¹ÕÓÓïOÙ¬LßuñZ¯CÈ4òìˆN/að—˜Ê»HþB N&³�ã ]- €�¹Éë��aØy&íS{ò&uzÈx˜¶A!�“·%	#Á<DLp%†¨™“óâô`øêÍGbvl„möDÊ·»‹Ò‰“|=vÀ¬¶v¬¡Xg«1`fPœS� >÷@ˆv“@ve%g™ää×N>Hûs'àä¿kô’Ö¼Æ††òò»>Ó¯Xx–¡q!1]âŒO8MFöŸK†è«7·cÖÐDÛéõ<Ù¾Ö]l:�Xq’w`lPéÓ–=+£™XÇ½?ú@£û¸¤»t"à¨Ïý)Ò¹ë§¢ý¹C z@kõ`ÃêòMñ´±yEå~ U ª°dÉJßØp	�neà ñÀÛÊ—³¢Äß:SÌ±Ü¯ïÃo‚Ô ¿®qÓöÚ›jOxD¦‘1�V”7ØÕñØ1¦ãÞD“~úRÞ=ÖÍ ºå4¹<Q‰9�ã·{r_Ð–QT¿²âÛñ&�3,Y¢ëWV½Z·²ò&§ˆ@÷ˆ»ëDQ#;kýä#Éš�%ÓwÝEÀ¯cÈD’@ÎtÚ}Ð-6d ½]_ncYÝ<§9àþú�@,ïMãðEõ«*ïj¨)?Ðû+â³±ú¹Ýu++¾¢9¼ïëÍ½¹c­ÃÝŽ |R@ÑUšdV"$�tÆ§¿‘VÅÌAûê»ÓÝ qy)0
bëZ¾°#éÛÖWWla5}„Ÿˆë|m|¡á3Ü-ÌI3 ë?ÜDŽ–X	�r¦ÓÞH¶1&ášæ3zÝË¼»r0ÇîòxÂ±hP´%òm»©eÛäûŠš§>T²ºø±™·aIrÆõjjjìúêÊ_Ñ žRÿŠ²7�?ìf,fÐ89¨$ÜmnÍ—[X	�Ò‰6Ô:àôoI‡Ô€\ëë×Qo«Ò­nÑ÷e%§£À`Ø–“Å>>þý„!S£“ï/Þ]øðô§
+<×íóÕUW¼ 5.Cç,{`4�è3ý}~~o|ÿp½³ëö¹U� I �´¤ïìxl«£…“TD9¦Õî—b¾í·7gG	Ôk7Áé¡âhFwùå@–»=�î°feGíqÑ¶è-ÑzÝ¤ûŠZ§<TòjácÓï˜¹l¦+3¢VW®aR×èó­©à¦±®•Å‘¤ÜEà×¼Ž!SÉ;±KTð”S¿­Žê+�±7ˆ"uô=[µýOÈ?ú#ík†*´1¸×)«Žæn/;,t?P~(àÍFRŽåä8–s)€Kc-X:ùþâ½†iÔ°Áÿµãë[8ÝXýÌ›³._p31=‡>\ˆï�`Ì4ÂŽåô«Æ3)‚á—�­›Xë¯cÈTòNìÖ0cñ©ßWFÍñ·ûcÌ÷¶ž""m1ŽosŒÿ1ó·8j8º)e~�ßÚ ¨·6€Ã€ÑÅ_ÂêáöÖá$¬‰k�µÇÙQû ·L¼¯0júÌõÊGUùNöýµwÕÆ5Ø½±ºêÅÙóÞÃÀ?ôåùþ–ü½áà±~U6¦¸ËBØyÛë 2•$�.°£_G‡EZ6`²¢`âaX½"€¢¶=Ú8VU¾•1s€‚öŸŽZ¼Ê€&àZ ¸Äß÷+c‡5:ó¢Ûîn�!µeÜûH[:³b¸0ª¢¿™|ñ!Ã4Vj¥î{ÿÎ†>ªXM??ê+¸À…½=×ÿîØ1‘Ïï×œ)_â.¯Ùðåº8&EˆŽ$�tÁ|äÚXÁ‘6 9§ŽíÓêèXrÒ*� MÔ¼ÏQGª-ƒVEÍ‰6�‹“?Y`~›A«™°j¤ÕôNMM�]zù‚_ƒéZðè1}ýZëî6Vw=;Þeí½“Ñ§z'“î-
“ßØ Lõ?Ž9jiwƒ¬555ö¬Ï-º‹×¢—Ï…|¹†é;j[±á‰Æ)Ý¥‰dü£äÝØ…ÚÚ¥VéåßcÞ©c¯EþBÐûq"Š49tøMÛˆTÆ|ã[5òtµVå}0V�x•ŸÍêÚUågÎ$cº ¾œeï` Ï·VN•wï|'¥»…†_æÍ‚vl'¶s!€‰vß;éwÅM†©^u‚ô¯»nß|Ú-��«+êfÍ_ð �¾×[»æñœcvNb	„‚á—õnRšk¼Ž!“IéÞ«ÀÇ	ä%[�ÿ‚7q´|­ÿ5G²)]û{D«¼Úg¯¬_^ÞãÚƒ²²;}19 ®ðÛÃã-¸áh†Ù©SW»@ÈŸ~·¯âÁÌpbv�Ã„°`â½…–ò›L¿zšƒÖÃ�·46Û¿ô¾
B�ÛÜ¶ŽÈ‹œ—XÅwÙ¾ÖuvÄ—õ¦×Ad2I Ý R¯r‡51­ü jsRW¦+"':²Å¦Ë¢þa�6�ÄÉ�ïÎƒß‡xE«AÆêºêò�]4×­hAÓed_ä³ßW¬§ôþŠÓ9`˜�ú Ý­ióg^¤'ÚÖ>mësì0Î¡üfòÅlßÖWÌwÏzŽ>rKO¯¥C9£•©lmë¸?{)M }À‡}Ð�,â�:f‡¦l¶”�LÇâ}ùö		cBÄOyöD&œ•º ]±nëõoÈ¦qý 	¤!Õön–Î
øhpù«££à¸š@`tl—m4=3ƒïÚjºN­ ^hµVzuÃŠª: ñB}ÄÎÍ âïdY�ØûDwêmhænW©·ù¼¿õ—,¬AvÄ>ËŽØ_ŠNß	Uª,“ý‡}û††|GŽƒe;¿Æ€Ù¬‹ûïžôõ{Ñ˜³•×™†ã¾‰ &žú/Úñ¿,C­‰ƒðöœ�kTŸ8¾‡'„§‚/‰Ÿ2ÿè'I Ýh\¾<Z:Á; Í=u¬:jð-.®9sçß5û'Ø]Ï”²xGV“æUæ±‘ïÔÖ.ue.ìœ¹7uˆnþq¶µU�KiÃa>m«”în_@«9°z =Ñ¶öÅ} 4æ Ã<n†rû7ŽÌQ‡rÆ€aù›-Š/�(SA™ÉY÷Ë6íÀ[CaSþ'Á8;á†ŽúõòQ… 0
Ckéâ£Aô,Cu)~Õë2�$�Ñ«Ì˜{ê÷åQsÒ-þ¨kL�a{Ò§}ôá«–o" ¡Ì« µZ[êµ†šr×V/wäøè®2,3­iýùjïx«Ç2€{ =afØ¶5Ôö9ï8Ó°í?DÄþøJ2&éö£	ë†nÄÚ!ƒ1ÕÅv	Û³ÏçíÙ@QëZº¬i8Ov­}w8Dúu¯ƒÈt’@zÄ¯uœkd*Fê°<Ò•Ö	ô­l{Üä(îùï¨ùŸuÕU‡Üh·'sæÞ0t¤¢oþ8;<†¹#Í0Û'õTê½Å—ÙƒènqlÇç œÐ¾ÛÓw©ÍxÓ©8k…ŒK]m¸³í¹çó®œ0]qðUŒ‹^‚ô)ŸôÖ{Þ“½~ú)]þc¦¥œó-àôý@êm•Øšn0³qMÀþaE~ø3n¶Û�©Yt÷}¹áQÌ½—-é�Ó!gôTd±ÅLM¬�Ìto¡æí¹5ú�ã.¤�‘ðz”¸X”Å/Žù¯¹Žé2hý²×’@zðÖ[åat*´öÇˆß•ÞGGšYYŒeÛ_ý·ÛîèÙ…Ÿ¿ñWÙáï3¸_õ˜NÑø¸xbçAõŽZ2pH:1|
ª«Ú1ñbnå¿oÀêásOŽ„§Øöìóñì˜ý¤±/åçîÄ!-	Är«õ2ƒ/?õû>MÃ"p¶Ûç²´¾uëâ«>iÎ¼Â?Uïv³ím7^õ�£í»¸ï•ÛûÄaEªÇ[ú­¦ÜÂê3Øÿ"ÂÌ8Šª³âP ´Ãá(€:0×3Ñ&#Ö-`Ä¢‰Fx,1�Ë„pf…ƒøëegˆ/ì;Hà.ë²¥Àž†ëë<:÷€"	¤¤õrVô_�íÓjÿÙÊqoÐ±Gs±fc×¶¯zª¹àÐßž¿4¾�m»ñêÛ5øßmæ‚d”‚tÀð¡çHÈœƒèné÷öµŒãôì˜&>˜ ð2f<Ï¶YÝ×‰‹/665Û³”¦ë |@B³÷  ÇÍ	¨½7‚�òò@z”œ½êI ½Ø°ºj[éü…�èPêã‰¨™û³¬ä})2³²�Û²�ŽúÒ¶ÅW¯°mûîUÕûúú]žå¨Ð?Z¤¾hk=,i�âãºX=%‹ä³š(ÁôëcÚª_½�†Ñ�R�·ïy—òòrÀ†öŸ_–^~CC}—_}•š«¶    IDATƒ�b¼:ü]Ì=z\î÷F“Œ¸EHèe÷Ôï-c4e©0C»2–Ð=6mÍ×@©k¶Üxe+½GŒµ~Ó$ß![Ù{L`¤¥iŠ‚žã€>PIH‡F€t³; «âä`zO³°iK˜ò+PâãÌo¬ÃÞà+Ú6þÃÍiáõÕÏÖ¸mö•‹ÿE;ÎnFœ‰€·ä~SC54><×­¸ú J­±U)<ß€&	¤4è%ê�@ àC¦}ãÉÅ¹ó½ÅÀÈóÅ .ð}‹-@'Wv\/œú«}‡u[IÜ]™wÑ«þÌ¾¢¾ÿçlú‹†Uå�.†tšº?—oð7¥—ßð°zÀØ¸X>ò"|m÷œ¢Ïý¥NÊ·»F®û ÐTð §mkûxØßÿÅÂa†îa¯–�Ö¯ñ�!±)æ×ß¿qNÕsÐÏ5?½©¯~v9üÑY ž�ë…šüX9²©»òy&Eç$�ôAmíR‹€g;ÛlÓh€Â^Å”Næöï]“’ B¿Æ?t~­µ^?»²lOiåy�Ï®8ÿÆ9Us†ºåGê_zéXÉPc!@Äç®¬9Ül¾“Œ˜:±ÇW•‚ó’@úˆ˜Ê;û@+Ïç³§‹ž.û±ß f|nUÍ€±ÄôU€Ëµ6ŽÌ®([{NEÙoÎ©,»ØÍÞIyy¹S¿²âÛ ÿS<¯£êQÃ�ï„ºaeÃMoÅ=�@tOH³�®pÚ¿ù“:Ãià�’ˆ$Vß5 ”1ðcfüuveÙ¾ÒŠóŸ8ç™ón*}±Ô•÷týÊªÿOO„�øŠÐj®uãÜÝžƒXn_¹LHÕÔÔØ<×ñØnMšhÐ_Ñô–Xna%Ä—ºíkÇøv&ú_ŠúŸÖ;Y’øwDý§K¿à¥>¿`]~2¯4,mžëýi"’@â¢Î¸�õjÌ<ÚÕ3“Þ>õîÝ…<ˆ¦ß“I’§÷NJËœSQ¶¬´â¼;g.»`L\--Y¢á�Þ
àÃ¾<�·ä•HNAQÆ
¹}å>I qay„�=öM&"™§ÚSº q3³Ì/¯ëÖHèÃÐ{fWœÿfiEÙOg=sîù}é�Ô¿ôÒ1"¾}¹�©abOÖf7‚î‚Ü¾JI q¨©©±Á8­à¡˜ÇYíñ*¦tÀ½Œ’gÙò6‹—ÛåÛ]b ü)~©H­™]Z¶vÅy˜ýÌùSRù‰n+ûÖUW½ÆÓ}9­Ïw½X)€¨2¹}•òÉŽ“Òü8:]M=6ã/å0€ôvi™ãê?OBRºÿyâFt+ˆŸö³sèÔØIiÅóæþeîiÐ6ðCœÜ–¹Gz_pÀ®n™ ð‹²÷GrH‰Ó†ÕUÛ ¼ÕñØË8 YÝÚ�,©eRÃŸqIW¡}ì„ W65µ|4vrîsçŽÝ¼¢r?3?Ôk+ƒ›}[ÝŒY=áf{âcòÉN Ov>ö–cìõ"–tÐÛ­úlI qqqó(/?5vâØj÷ìŠ²wÔW÷cÃ½i£³£.Æ±·DO^áb{¢ƒ´¼ÑšîËø“ò9¿E‡ýîoóO½(ß±<èþ¦ÔK
É–1�¸¤púnª( Ÿ@Àù]wèä^ìÍæV~?ËFC~1ZÍÓ÷Ù‚YÍ.�šþ»ü¦rÙO Iä“�€“UM¹¢ã10öhõ�W1y«çQ�KÞfñHÓt÷
0Äþ�Ûr	Ý²w$¾¶{.?ü*ÆE6‚àð¡À—ÎÄŠíß»Ô–èÂ §&1=Ì„Û:ûM[`Äýy!v{×¿´×ËB�|;ãîç{F™
†oPý½ùôL	SB £‰Nø¶0ðI$²ÏÈiè¯ïÝøÞvW¢]’KÃÕ­ª|ÀÛ�b	í÷($Ïô¶_TÐVRË¤�|ï£7„j]„~' „Çû�è‰$�~ â{;{¨- ÷[h¥°�‚xÌÉÃïGH=Þ¾Ê�é»™ Õ±Ã•^1ÐòË�þñY+8²À¸SÇÞ±Õx� pÊ÷zöL{z0ˆp\ùPaQëpT·dúeÐ÷@\B §njpmFÑ5é�ôCmíR‹	v>þ§¨oPÕÇÒ ë�…ïD‡â'áÔvó ˆ‘ò}SrŽŽÚæ§ì=†©b©>w¢ŸeÊGÒ~Äë¹Üé'Ûá¥>E?ðÑþèÏFÍ)_ÚÍÄ:ßÃÐ’.:úpØï¼e£zzžÑ8`|ŠÂ:‰²—� gx¤Éž~¸ÙÖ’ïhk;éYœKzn¡×ê­]çuƒ�\îôÓ–ÕUGÁxªóñò°ïpWÏ4Qëï¢�C·5goOÐC™
:œ�ò}Sb£›>ÚuÏ8,¼>~Rî3
ò—ÏÖy�¶uÞvÓg6§S¥à¸þÃý_^Ç0XHqƒ¢ß8mð¼"fLeP‹G%…œÛ·ó‹'²r_�YºOCŸ[¿²r€n×ÀPØÌ%£·¹Zî²Ù	Ó‰œ‹&Ãh,(
VO-Ê}aV~Þ›3š²��Øê÷ö)“<� aÈ º>(v¦Æ·/»H˜\ò¸ ¾ºbKéüË ú›ŽÇ—EÍÃ7¬<¯ârSŒéÈßµ²i•§¿ÐÊ¸¯aEyÇýz÷Q¤,Ž?Éa~„5Sìüý;ýo�›Þc\'üþ·Çø�“rÂ‰ƒÖÔ£a;'4Â¶ìÜTm¦húM(#�ºCŠ€ßÉÊóÔ‘â­Í_)åÜŒ½ºÊ¨oÊM«•:”<ÉDëlóƒ{B~?�~¢(û±ºê§º*ÙsQv€”% ˆŽ<>Éÿñ¹ÞiÀØ5d´±ëä:Î²BöÌÃ{ìÑÍ¹ÅFi['íó"ã®h%åÈÚ�’w­KV—oš=oa9nîxüÙ˜ÿÀ¬Ð«¸úÉy ØóZÌxÁÏÆOkW•Ÿèö™DGÐÃ¾ ÊöµvJ§6;–�åLkÚcl-ˆ#‹|ŒÂ¾lßÚ±Å>ŒE Ú›v¸ÍÎo+°µ5ÜÍÁxI ýÇÀ“R¶=µä]ë"2è—¬y1:ôBþ1¯ó[ÇðÐ^š~‘%­YïmrÔw6®¬XÛûôÑž*¸PÄ‚?å³yžv +wk�+mÑ�ì³&" €D�©M�Ö”£Y¶/2Ö±œ`Âí’$09ô€×A62ˆî¢+* ªè|ü·aF¦3(ôÓÖìç<óâ¾% ZõXÎÞ8êÍ]<'fwÆµlq»]r0·ÌÌúsÑ”¼JƒCÖLkÊj¾Ó4M¤â›0`øM�’ñ�þ`àåº›Öºº�ˆè�\ö¸L)üBk,B‡ä¼Æ2Æ·f©=¹Ð	ÝJI)¢Ð¿‡wTþ¹òâ{¡ÞÝSÄØ››‡³ú[Œðy»Gæî™‘ÔóÐÑ¬‚Àëã @¬í©Ç?p¦6!æ�Œt,+§§×ÊôÝþ#âÿô:†ÁHz .;Ùág:ÿ‡Ö@.zßýÕSŠ­Õæ%O¾ülœÉ€â÷…WMY£Iyóï·c±áöìƒ¯1p$%'dRfã°I�S'å½03gÈë3Žg±Íov5UØÌ’ÒO¯×-\÷Š×AFòÎM"ónfç: Ý?¤ièûŽÙ8Å°Ór@]�´A¸âÖÊZÁËŽÞCª‡ëR†v´“Õý“’'<éÐ'r¦øFreÁteà
b\Ù^2<éŸjõõ¿=nè©)hö¤æì¢#¶�éØN¾�õý¢õ¯C¬¤’uÕå;A|ÆjØŸ·ù')BZÖf2úAQùòW}ýÆÕÏÐãV¤ûŽ%Ú~91'1>Û°ºrM}uå¯êVV^lXz$1Ý¢GìNU,æ®ü‰Á•S¦æ>?3ÈªY!½jä»Ø\‹RÃ@Aà7ë¯_íuƒ•ô@’$lD~�egÝà£í:-À¬¶üÛæ™±bC;ƒIê¯EË^þm?›a ;”t÷ÕlCö‹ÃS&Öý\ñcÓoØvÇægà½šg�¨hÿAé¼ES 0Œy _…T¬ß‰©lÚ‘ý	Þ‘}ò÷|{7Moù€¦¶8Ïž¢Œ^C”l©%^Ç0˜I$I—/oóÏ:4d; ´©Ö«mY”s…+�õ8Æ¿o˜·,DÛ¬??]<¢«‡ëWU¼__]±´~eÅM¹­Æ(0Íè€j‘ªñ«fs<¿3ìbýô¸xé¤,~nÌfÞ‘ý*,Ú@§$†ŒAom\¸v¥×QfÒI¢ú‹Ïy¼ô�ú» .ëxüÇ¡ úÏœˆÖÌž'pCáã—•»³@ƒ¹Ç¢væ��"x:•@Û:`7ÞÐc/ð­·ÊÃ Vµÿ`æÜÅcÓ¾œI}àù ’¿®‡a``:ö�œÎ �åEQx¶Ú+†âÑ½51�‘æ%^Ç0Øyþ6 -Y¢™é�ï¶iX­mz¾W³l(Zöç?ºÖ s—ë-ü ®ð[ø‘ñ†³<¿Š¶ÂVÑ”G¦�QA¹'5åêVUý¡~eÅMÃ­¦‘¤Ô¥üK{ï$5ÿ¦°1u¹ŸâÊ1—ðÒñ#ù¹Ñ›y{n¢TÀNIiƒÞÚ°¸¶Úë(;é�$ÙÆUÏÔÌž¿¨’Á;ÿM›oÚÓCìcsÊK� 1Ø0øF7ÛÔDÛN]‘*�ëýQL"Ê±O~Ã2ð™ƒ¹ªqbêW¤wf·Y·>:£±ñë›~ïkkjjl mÿùÇ²¹×ŽˆùÌËÀ4„k œív¼g"…ýÁéØœÎ˜º"u4«¥c"S¡RƒwˆuÜÿÝ„û$�¤€¥øÛ¦¦Ë€Ó“ÅÏÛÎ¿dE˜©‡xI¢Ô–¯ht«=¾óNßÚ£»Ï=liäióG×å/ÏK�‰n�5qÌ@¬5ò‹�¹mû×â_÷ÒAmÍG ”·ÿÐì+ž«Wã
 Hþ<][åàýìóøý“ƒñ4<ºƒg„öÐä¶\d;3ÐaÃ³àí7®[áuBHJl^Q¹¿tÞ‚¿Ñ�7ÚjÄ&mn›nØ)Ÿ•ejó®þ¶±}Ñ3AÆ75ñ•[švOÎ«È©äÑ�á­
œ4fŠ¶FÿXôØôæíwl~É­fëVT®°À¯g_~këÐ§ˆp-ƒ¯0É¥óôÄÑÀTü50•ÿ:ðq˜&…ÖcZ[ÆDÇÁÔ)‰!YúÇ^Ç NrýÊ·tþÂ¸†HëWVš"@³æ/ü3§ÍxR ?=$ÜBÌ)ÛþÖ jœöÌò¢x_·sîÜ =*ûkZã‹Ì<Gƒ³;?ç„e!êôœ~yá!lËöþ6Ö)d�öçš_h¼cky²ÏuÚTaæ+AHý~19Î!*iÛŽâ…|{:(ÜÂx®îÆÚ¼#]xý}+=�2ãkÚp6¢ÃÐÝ-ë_ó¢šS5+Kñ¯úúÔ†ÅWÍ0™î àúˆÖ“ÙÑ=¾MRˆöÒ»¸äP.¶MJŸÂ«X‹õ¿…�Î4~}“{“
ºP¿ªâ} K,�4÷+Á\ÿ‰KÓ\	`f2Ïý‘6c×æ�Bm> `c\¨NÍlmâ±‘Ñðñ4¤ïä[+þ¯ƒ“HŠÍž·è›Lü`çãwdYÛçû¬¸{ñRD‘’g–w{?|Ã­—çä†Ô�ŽR7;¬ÏaF\eÊcŽÆqËêñ9­ÙŒo^øa<Í¦)°?;xOã]›<ù’šõ¹ëF“2.%Ðµú|ç1³”ÈÖM(m¥ÂV#cE “òºÃx¸îÆÚozF:ñúûVz )V·ªâáÒË.<¹Úùc�…}EŸô9»ó¡Ç'óüŠèÝÎÇ¶,ºr¶RÆ·Xë«uˆÏŽ�Ø…¯eÉsÃ„Ç@›‘^;�ž‰Ü=ù¡â‹v~cÛe ÔÔl\ýüA´Æ/^¼ØØ|‚?I¬¯dà
ÎG*z!U€ºÜOq].@`Lo}“.=úI FÒÏÝf4k­dæUš‘’zÌ¶þ)µ¾óýïoµúG?•ms�å¿ûƒ4ÿ÷ŽÅó†hö}ƒA‹5ô,ÍhíÎ—9Á$‚ÝÃ@:¸¸)+F¦çæqvÈ¾tòÓvª?ØìøòŽC^ÄP^^î x³ýçç%Ÿ[0Ü§ðÙö©ÂWñìÕ› ¡±]tÉÑñð8y  )ü²áÆ5¼ŽCœ.]ïuh_yvƒîè|<¦•ÿîÖ`„èÌ’ßnqÀÿÕæq‹ù76ë2Í¸}Ž¾ôB.Û›Þ%žì¨5Á:¦ö>2óû^Ç [VW­_YU^¿ªò®ú••´â9 ßMŒ¿ I(Ð96²‰n>�BR{Ä}A@c(xâw^Ç!Î$	Ä#WU,ðdçã;¾4äOZeXOVÛ§øz*ëÞîìc&|îm)žl;f´5üÛ)•¬™ôÛ9é4S‰VTm¨_YuOÝªÊÏjËNÀõÌx„ýmœæ4ÿ…®;8à.k†¥§ñêÆ+=oHñQÎw lî||•eLÚà˜Û<Éþ>$0ã’¦”Í\î+;Ÿ�ÖE�Mÿ‘×±t¥¡¦¼µneåóWU~«¾º²P+£àoÓ‹ ÚúÜ�ÉaºîÀ+¸ðØeHE%â>áçë®û³×Qˆ®IñP]õSmJó Îø—6ñ6wzV¿)"˜}H"W}˜	 ´¥‘Ñ{&ý®øháÃÓ\-ã¶†å�õ+«¨[UqmØ'¨yÌüo Ôuû¢QÑZÜþáNŒ�~6…¡ö&Ä0þ�×AˆîÉ4Þ4pÎ¼EWhâ—pæ`%?•9ä'�qUW[-!§ç¡"à›—îE‹‘Yu 	#ÛØbøôïh\ïu<ñ˜}ù‚QÌøLû`üµ0yÍ?¼ÃŸÂÉº—iƒ€lXTû^Ç‘Î¼þ¾•HØ°ªb@ÿÔÅCôµ6'RT?ù�ÞßZÌÀ5û‡¤ w1vÈ.‰6ëu“ïŸ¶«ðÑ·xS_ÕUWª_YU^qå7Õ7>ü1}õÃã˜þÒ,y X7¬ ï^¯ƒ=“’&êWVü’€3JŒÇ´òÝÑ–íg¢V/âJ”Ÿˆz¿Øùì‡I›±œ|ØQkb´9òÔ¤û‹›Š—Îø–¤ùÔxÍ®8ÿÆÙ¥euþÆzRlV|gÍe5™Õ5„$�¤v†w |ÆþÎ­²îlÎR 8D½F}LÏŠf¶epiçDíaá–ÈÏ'›™òÐ´Úâ¥%_§¾ÊrwÊ–•™ýLÙ÷fW•m¸©*›’ÆÕ/XWëu¢w’@ÒHCyyþØb€7u~¬™‘ýí– QÈ‹ØèËl, _jL§²ýÃ6VÈ:/Ü[:ñ¾Âè”GJÞ˜úÄô›Á©ÿ¬Í\6Ó_ZuþU¥ç?aØÂ�1-ÕqÄisŽöÿÜë Dß¤ww{ªé¥c³.¿þJbã5t*ý}X«¼»Z²ÚÎ7§²zo¢úš@&4™(°}h2{®¡•i´­}º5v€‹&Þ;õéüŠ¡ÏøU€^›æLÙP~S¹ëFÏ­8w¢fº„Íã:ho6,K�­ n{ë¦·Ò§Ò¦è‘$�4´±ú¹Ý3ç-þŒAÎkÜiû¥ã9·ŸÈŠ=ži2 ¼Š±/ˆ€€a ÚËl,fàK»
ð»Âƒ)Š,õ”ßPÜ Ð °E½ß<»â¼wÚNŒF(Þ˜ÛÌÃÎÎÚ»j{Í¤eËÊ†Ä|\H¬Š˜¹�@³ þ´ŒÁÓ}çEÀoÞ[´f�×qˆ¾“’¦V•Xzù¢+Á\à´i¼aÀ[s0ÿÑ!Ñ}Yì¤ã èG²Õk€Oì	"kŠBXy¿ÑT2ø‚§oJH„|€æ˜Ç€	€k0»¢¬@@+Í 88¹«a.€! ², ›ôÉLqr %3FGŒ÷lù¥×aˆøÈH«¯®ØÂÌ—ØÛù10¿r"0v»6·xZŸù•‚êÃl,hà–Ò¢rFR˜Á¸vµÍ0
Àæ (0Àœ,EsÆF^.¢Á·5ÜÔà~M/‘T’@ÒÜÆUU›‰ŒKº«qôÓVÉŠ˜¹i|	šÕ‡5! péÙÈNÑžZ©DŠ`</h›ÆèÛo\×ý*y‘¶Þ§u ª«.ßi.¨¾«ÇŸˆø‹þ)Ü¤ç­ aôm>«fÜºsàõBÌ Ü)î–Õ-Zû¸×qˆÄHÉ›WTî›¡‹ZÞÕã¶{ks–yêƒTÇÖƒ¨O+Óàâ²1ÔX_¸¾ÀÀú÷¸…€Æì�ùu¯ã‰“’A—/o.ª®%Ð}]=üw5'®°üÛH«íþ²Œ>~‰2ã[[G&7˜3³âÿ,"ZñÞ¹å�f¯‰“’aÊËË�º•ßó� ºœ/ÿDØ,¾ãDv¸™Õ®ÔF×=¿ê[…^ (9èÇÔH·Û¶gRÃ/ã�Ó·dµyæ“’¡êWU=Êš.Ðå,¬fBî×[‚“þ'æßA ´X˜•môý‹ô‡ï�¥í´€¾ë<}W `Ü·áÆµOx†è?I lãêŠ:m üßÝ=çÙˆ9õ¦æ¬àk–¿� O‹Ó£/Szä„7ìÏ¤EÔ]3³dü£“7ù¡×AwHÉp5å­õ+«¾ÂÄ×ØÓÍÓè�°9óËÍÙN£6¶{•HñõBn‚‚P�sýÇ@÷�6ÍE²Þcà�2@l¬®z1l†g2á!t³&$þ±5PôÅælz×6·Iq˜È2Œ>÷Bbd`ÆÞQ»¶2Ÿ|Ä €Íšùº�×¿3pëÕB™}y'NÓ¸|y3€¿-½ü†ÇI«cÂe]=ÏŒÿù‹às~ýþQßP…³5§`¹¦‰V×åž´2ÐÈ><oðAL›ó�	'¬(µeÜ¥¼¬ÿøˆR‹6.Z#‹y‡@õÕÏÖøì¬Ë|ž÷ 4£»ç®Ž©)«cYð+mÝ´?åsr³£œ´÷FÀPð9KŸ¬qNÊÀ>˜x2ÄÞ.rXð/“cö›áXNF%™¾ `}­nÑšU^"Ü'	d ÛX]õ"–,yyÖu×ð# v÷Ü˜V¾GBþâGÚÿ”ÏÙ}]ÐŽœ­8?zˆfÝˆ‰€hêØ^#Ào8æY¯Z¾^¬PÌÌ	nû~ÛÔÝSÒ·`Ë™dÀ »ë­=c§M10Hè–,Ñ�* U¥—/¼Œï ¸@ §—½eãß²>ðÑ‹üz¡áXãÆpÒ¾pÀ¯à;UV�M²c€c²Âû¸VöV[¡ÖRC¶:jTûyÇÄûÏðm>%{Th[(÷hq¼¯õ‚òPFÚlHè	~U·hí¿z‡HI ƒH}uåk ^›yÅâÃÑ73ñ—|è½TU¼S“^qqÞ4•À}êÝø__ì\ÚÕáq®‘$¾Á>}—qß†kæu"¹dŠÈ Ô°¢¼©nUÅCõ++?eÂæ¯¼ cÉ</Û™ð ß0=¹neå,Eü÷ñ´‘õrÑÓï;ž¤]cïí+&~¢nQí÷½ŽC$ß ¿LëW>¿À“ ž\¼x±±ù˜]L sIÑ¹Ìú\€¦ ‹^nyur'“Å6¥i+4ô›õÕU‡:?±®ºò¡ÒË^Æ•}kZ™Ù«‹TÛe[£ŽíÄSJù²gù&~¢¾nÝ×±0“F«D¢$�ˆ�”——; 6·ÿ<Ýñ±YŸ»n´A¾±úä†F`"Ep†€á¸V8®-:®sí¦­Ï?ßÇi™À·1¨�v^ìŽjóçg¿^ÜÔvñVÒ¶öÇq®”0¨�u¿bz ®¾ö»X‚�¹­¤8ƒ$Ñ'W?@R�ÕUW*�·à.=Û××Ç¹oN;ØzÑ¶m§×ôÞÁX¾�€{6Ü¸ön¯ã©5ø.“DZª_Uõ�ÅóÕ�ónáQ2Ok|uff¥]§(™Xiúñ†Eµ’<!I "m´Zùßðv<¯1e�É[3ù°2�®—¶§fpÐŒDx_àî÷ËTÝÁJˆH»j~Ñ–± Àîx^§æž•WS2}¾Ö$…Ög¦ßõ±ÖW&cÆQ~{è¯ë¿ó¦$�ALˆH+5å@zºÙ,«;Ôê’ûr‰éóù')´>ë?ØF#žýxý¿­þ¥×±oIi§¾úÙZ&ÜÄ9›Ç1‚9/ÍáG¶gûÂôòí|Â·†þß„UõS?ñè¦ê³<$�ˆ´´±ºòü-âý’Ò ì?OÌ=0v3”Òé¤DsàÎÀŠòÆ¼W±lìÛuÏWý-–,‘©ºBˆH_õ++aÆ÷y­ùÞ¨éyo”3}¾f·ãêöœA³Ea2�¦=üÂ¨­x½à�ú?W~Òóí$�ˆ´¶qUåïˆèG‰¼VÏyiFN�sw¥b\{ îÿAGýoòïÇ£=ÙËêWVþØëxDz‘"Ò^]uÅ¿|7¸ò%MFpEá¤ì­w>#”„ð>2 Ê·k:¨_þ®.?ë|Ž©oÖ­ªøg¯CéGˆÈõ+«îøf 	mÃë{Øä¼—J³²[Gl'åþØ)‚
ˆ�Óažç§ÍyEÌêŠ�++e?Ñ¥ñŽƒCýÊªr­p5€Äªñj�ÿõqEùoL?á7ƒÈÅ_Ð„›íyÂ¦ÍxyÔ&]qÖ\¶Um\õL�×a¸»ðþ  	žIDAT‰ô%	Dd”†•ÑÚø4€]‰¶A'üÃ²_,“÷^á‡~_`Ÿã#™<}—ûyÝ�7ùñ	ÓøÃ¬™Äô"|Ñê«+¶x›Ho’@DÆiX]¾ÉÒ|>/ô§u gBöÓÇæ½7õCŸ?p ?‰$2£™·åÖèÇ'Á»C/ƒ‰é§u«*®«é¥¤î#†Ì{×`Ëêª£ ®Ÿ=Ñw|âÛ¯ä4jÞ„œç§ÃÛº'vîCô,v¸ÏéD
Ê—Qõ¯ñÖœÍxcØyˆsOÓ—êVU¬ò20‘Y¤"2×­¬¸—.°­¿�ûrÇe½T2vHui(çÄð�¦ÏìÓ_¦Lßuh7êó^çÇ'äá/#>ƒ˜‘×þH—ÖKòqÊ�w¾Ý«[Q¹næÜÅeÊgÿ ï¢¿ïkKåøÞ?Ë‡ñ°§ße•ôY*2FÛÜe7ÃÈJëñ�ŽûÖñš¡ùØ‘U
Ðø�gÐw6®¬ø£gÑ‰Œ&	D5å­ þ¾tÞõ¿g2$àb7Ú5ß:É|(²¬§œØ+:dX¾ÈYŽõñvºiØqQ›°1¯	†”²Egü-ˆéEÒê^)ßëE€b`H»w¾ýQ¿ê¹z —–Î_x€0Ò•†¤v™Ü1A ú¬Ð¾Øôƒ!�Í%Ó`€Ïrå<	£#h26ñ¶<�-¹³Q¥]?;üýú••/¦8@1 I×¯¬ü}Ù¼ÅU1Òßð}€‡¹yµ?{lpÿä�O˜oïÄä¶Ý49ìð0k4üz<òzh¢?,X´ƒ[ÌƒØvd�Ç�Àd€.íá5!~ÝËÿ÷]5¿Oh1¦�IVíªò þ©lÞâ{“•H>ÒlNÆ†!“yÃ���e;ûxdl/ÆDN¨Ûä<+ˆ öÁ¯ý d3q.Cˆ`hƒ XÐˆ@Ó	Ž-h1£tÂ`óûùP`8ù§À¡ %}ˆ,
ÐcÊQ¿–ÛUÂm’@Ä€wZ"QÎwÀø&€±É>/‡Œ±ø k,>Èêqc“ö_&€ÎÉm|§çÄ#Æ„Çç×«Ÿ‹k‡G!úJˆ4ÚÉ¯æÎ�û›£æ°k@t'€+1°¦³71óãóþ†•åzŒØ$�ˆA§¦¦Æð€ç¦váDSánC‡+þ´ž	äµO¿õVy\Û‘(I bPÛüJå ~àç¥—ßpX]Âõ`Ìö:¶Þð€g�ÿmX]¹ÆëxÄà#	Dˆ“¸¾úÙZ µ ~^:oÑ(}=W‚éSHÞŒª8ñ&-Qy]uÅ»�Ý…‡$�Ñ…úUïø-ðÿÛ»Ÿ¹ï:ŽãïÏw¶»´6-M1
­ 4iµé†@Ñ‹
=¸A±Ålt=˜zÉ¡§Zý<zH½TêMAVwµ‰ˆÙmŒx²°jÒl¢�ñ`DÍF
Mb¬™™ïÇCWŠ6ùì÷;_wæñ€=æó}1dçÉÌÎ�øÆÂÂBïÜÕÁcUÝŒÉG"âý#˜QGÄïR¤Ÿ×)ŸŠáàÔÙ—_º<‚ëÂ-x‹‹‹Ãˆ8½ùóÍˆˆÇ?¾pï ×dX÷ŽT åêá±'G~wDìŒˆ;oñø~D\I‘6êÈ—RÄù”óz®òúôÌðüÚ±c­~‹"l…€@�ÍWt½²ùó6�?õÔ]ýÁ;ë›igêßöaY¹N7966?U¶%�l>r¸êz´eœ^ÿÀ	 E€"@ ˆ€ PD@ ("   Š E€"@ ˆ€ PD@ ("   Š E€"@ ˆ€ PD@ ("   Š E€"@ ˆ€ PD@ ("   Š E€"@ ˆ€ PD@ ("   Š E:ÈÞ'îîzÀv³û“‡ïézCç™šé?Úõ€íæ®þ?:¿ïì< u®žîzÀv“SîzCç‰Ïì�;¸¿ë ÛÅæ}æ3]ïè> 3UTÇEà�í�;¸¿ŠêxDLw½eªñs\‹;nó_=PEõËÙ¹C/¤ßzg×O-^o|À6´÷‰…»«Þ`6ªôùxë‘GA<òÕ¦w5�‰¸í€D¼uƒ<›S<[Ý1ŒÙ¹CØ®†‘¶xFúsKþSóOa¥øcãg°E¹ñûææ’ójãg°%9ÇJÓg6�^TKMŸ	ÀÖôr¼Ôô™�ä7+?¸'›>€B)VO¿¼üZÓÇ¶ò2Þ:ê/GDÝÆÙ Ü–Q­�ƒ{mzå¿ýë{ztWD|¸�ó¸E)žõÄò·Û8ºµ7N¿~ÿ—ÂSY ÝÉùõ½½¯´u|kY[{¡ÓÿülÊñ³¶®Àu2fn~z}qñf[hå)¬Û¸páÍïûØw‡wÞ¸/">[' ÿ[)ž¿¿ÿú^YY¹Ñæ…Fv‡¾ïÀücQW_Ï)?9ªkL”«)ÅWÏütéW£¹ÜˆíŸûÌž:ÅÁœó\D¼/"Œ_*p{®GÄ¥ˆ|)¥jµÊñÃÍ·QŒŒ§”˜H³s‡r“ç½º²äw‰‰óÿðqî lC@ ˆ€ PD@ ("   Š E€"@ ˆ€ PD@ ("   Š E€"@ ˆïqfdö˜ßUG<WåêS9òžˆxW×›ÆÄß#âµÈñãTå£gN,ot=ˆÉ  ŒÄìÜüBäôb¤ØÑõ–±–ãZªâÈ™Kßïz
ãO@hÝìÜüBDú^øÿ6*9¥øœˆÐ6¿Ð´jß�ù]¹N¿÷ÈcÔòÕ©©©Ý¿þÉâ•®—0¾ü�VÕÏ‰GÒ=ƒÁð‹]¯`¼	­J9=Ùõ†	æ¶§UBÛêzÀÄÊ±»ë	Œ7¡]9r×&VÊn{Z% ´*¥t±ë“ËmO»„Våœ�w½aråc]/`¼	­JU>9®u½c½1ÝízãM@hÕ™Ë©Š#þ2B9ç|díÔ±¿u=„ñÖëz ãïòÅóçÞ»ûƒëùi¦ë=cî�œóá³«ËK]aü	#qùâùs<2ûb]ç7#ÇŽÍ7Nw½kL\�g#åoM÷OŸ>ù£µ®                              À¿ ^…`µˆ	b¯    IEND®B`‚---
name: playwright-trace
description: Inspect Playwright trace files from the command line â€” list actions, view requests, console, errors, snapshots and screenshots.
allowed-tools: Bash(npx:*)
---

# Playwright Trace CLI

Inspect `.zip` trace files produced by Playwright tests without opening a browser.

## Workflow

1. Start with `trace open <trace.zip>` to extract the trace and see its metadata.
2. Use `trace actions` to see all actions with their action IDs.
3. Use `trace action <action-id>` to drill into a specific action â€” see parameters, logs, source location, and available snapshots.
4. Use `trace requests`, `trace console`, or `trace errors` for cross-cutting views.
5. Use `trace snapshot <action-id>` to get the DOM snapshot, or run a browser command against it.
6. Use `trace close` to remove the extracted trace data when done.

All commands after `open` operate on the currently opened trace â€” no need to pass the trace file again. Opening a new trace replaces the previous one.

## Commands

### Open a trace

```bash
# Extract trace and show metadata: browser, viewport, duration, action/error counts
npx playwright trace open <trace.zip>
```

### Close a trace

```bash
# Remove extracted trace data
npx playwright trace close
```

### Actions

```bash
# List all actions as a tree with action IDs and timing
npx playwright trace actions

# Filter by action title (regex, case-insensitive)
npx playwright trace actions --grep "click"

# Only failed actions
npx playwright trace actions --errors-only
```

### Action details

```bash
# Show full details for one action: params, result, logs, source, snapshots
npx playwright trace action <action-id>
```

The `action` command displays available snapshot phases (before, input, after) and the exact command to extract them.

### Requests

```bash
# All network requests: method, status, URL, duration, size
npx playwright trace requests

# Filter by URL pattern
npx playwright trace requests --grep "api"

# Filter by HTTP method
npx playwright trace requests --method POST

# Only failed requests (status >= 400)
npx playwright trace requests --failed
```

### Request details

```bash
# Show full details for one request: headers, body, security
npx playwright trace request <request-id>
```

### Console

```bash
# All console messages and stdout/stderr
npx playwright trace console

# Only errors
npx playwright trace console --errors-only

# Only browser console (no stdout/stderr)
npx playwright trace console --browser

# Only stdout/stderr (no browser console)
npx playwright trace console --stdio
```

### Errors

```bash
# All errors with stack traces and associated actions
npx playwright trace errors
```

### Snapshots

The `snapshot` command loads the DOM snapshot for an action into a headless browser and runs a single browser command against it. Without a browser command, it returns the accessibility snapshot.

```bash
# Get the accessibility snapshot (default)
npx playwright trace snapshot <action-id>

# Use a specific phase
npx playwright trace snapshot <action-id> --name before

# Run eval to query the DOM
npx playwright trace snapshot <action-id> -- eval "document.title"
npx playwright trace snapshot <action-id> -- eval "document.querySelector('#error').textContent"

# Eval on a specific element ref (from the snapshot)
npx playwright trace snapshot <action-id> -- eval "el => el.getAttribute('data-testid')" e5

# Take a screenshot of the snapshot
npx playwright trace snapshot <action-id> -- screenshot

# Redirect output to a file
npx playwright trace snapshot <action-id> -- eval "document.body.outerHTML" --filename=page.html
npx playwright trace snapshot <action-id> -- screenshot --filename=screenshot.png
```

Only three browser commands are useful on a frozen snapshot: `snapshot`, `eval`, and `screenshot`.

### Attachments

```bash
# List all trace attachments
npx playwright trace attachments

# Extract an attachment by its number
npx playwright trace attachment 1
npx playwright trace attachment 1 -o out.png
```

## Typical investigation

```bash
# 1. Open the trace and see what's inside
npx playwright trace open test-results/my-test/trace.zip

# 2. What actions ran?
npx playwright trace actions

# 3. Which action failed?
npx playwright trace actions --errors-only

# 4. What went wrong?
npx playwright trace action 12

# 5. What did the page look like at that moment?
npx playwright trace snapshot 12

# 6. Query the DOM for more detail
npx playwright trace snapshot 12 -- eval "document.querySelector('.error-message').textContent"

# 7. Any relevant network failures?
npx playwright trace requests --failed

# 8. Any console errors?
npx playwright trace console --errors-only
```
"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  // If the importer is in node compatibility mode or this is not an ESM
  // file that has been converted to a CommonJS file using a Babel-
  // compatible transform (i.e. "__esModule" has not been set), then set
  // "default" to the CommonJS "module.exports" for node compatibility.
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var extension_exports = {};
__export(extension_exports, {
  isPlaywrightExtensionInstalled: () => isPlaywrightExtensionInstalled,
  playwrightExtensionId: () => playwrightExtensionId,
  playwrightExtensionInstallUrl: () => playwrightExtensionInstallUrl
});
module.exports = __toCommonJS(extension_exports);
var import_fs = __toESM(require("fs"));
var import_path = __toESM(require("path"));
const playwrightExtensionId = "mmlmfjhmonkocbjadbfplnigmagldckm";
const playwrightExtensionInstallUrl = `https://chromewebstore.google.com/detail/playwright-extension/${playwrightExtensionId}`;
async function isPlaywrightExtensionInstalled(userDataDir) {
  let entries;
  try {
    entries = await import_fs.default.promises.readdir(userDataDir);
  } catch {
    return false;
  }
  for (const entry of entries) {
    if (entry !== "Default" && !entry.startsWith("Profile "))
      continue;
    if (await isExtensionInstalledInProfile(import_path.default.join(userDataDir, entry)))
      return true;
  }
  return false;
}
async function isExtensionInstalledInProfile(profileDir) {
  if (await pathExists(import_path.default.join(profileDir, "Extensions", playwrightExtensionId)))
    return true;
  try {
    const prefs = await import_fs.default.promises.readFile(import_path.default.join(profileDir, "Preferences"), "utf-8");
    return prefs.includes(`"${playwrightExtensionId}"`);
  } catch {
    return false;
  }
}
async function pathExists(p) {
  try {
    await import_fs.default.promises.access(p);
    return true;
  } catch {
    return false;
  }
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  isPlaywrightExtensionInstalled,
  playwrightExtensionId,
  playwrightExtensionInstallUrl
});
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var socketConnection_exports = {};
__export(socketConnection_exports, {
  SocketConnection: () => SocketConnection,
  compareSemver: () => compareSemver
});
module.exports = __toCommonJS(socketConnection_exports);
class SocketConnection {
  constructor(socket) {
    this._pendingBuffers = [];
    this._socket = socket;
    socket.on("data", (buffer) => this._onData(buffer));
    socket.on("close", () => {
      this.onclose?.();
    });
    socket.on("error", (e) => console.error(`error: ${e.message}`));
  }
  async send(message) {
    await new Promise((resolve, reject) => {
      this._socket.write(`${JSON.stringify(message)}
`, (error) => {
        if (error)
          reject(error);
        else
          resolve(void 0);
      });
    });
  }
  close() {
    this._socket.destroy();
  }
  _onData(buffer) {
    let end = buffer.indexOf("\n");
    if (end === -1) {
      this._pendingBuffers.push(buffer);
      return;
    }
    this._pendingBuffers.push(buffer.slice(0, end));
    const message = Buffer.concat(this._pendingBuffers).toString();
    this._dispatchMessage(message);
    let start = end + 1;
    end = buffer.indexOf("\n", start);
    while (end !== -1) {
      const message2 = buffer.toString(void 0, start, end);
      this._dispatchMessage(message2);
      start = end + 1;
      end = buffer.indexOf("\n", start);
    }
    this._pendingBuffers = [buffer.slice(start)];
  }
  _dispatchMessage(message) {
    try {
      this.onmessage?.(JSON.parse(message));
    } catch (e) {
      console.error("failed to dispatch message", e);
    }
  }
}
function compareSemver(a, b) {
  const aBase = a.replace(/-.*$/, "");
  const bBase = b.replace(/-.*$/, "");
  const aParts = aBase.split(".").map(Number);
  const bParts = bBase.split(".").map(Number);
  for (let i = 0; i < 3; i++) {
    if (aParts[i] > bParts[i])
      return 1;
    if (aParts[i] < bParts[i])
      return -1;
  }
  const aTimestamp = parseSuffixTimestamp(a);
  const bTimestamp = parseSuffixTimestamp(b);
  if (aTimestamp > bTimestamp)
    return 1;
  if (aTimestamp < bTimestamp)
    return -1;
  return 0;
}
function parseSuffixTimestamp(version) {
  const match = version.match(/^\d+\.\d+\.\d+-(?:alpha|beta)-(.+)$/);
  if (!match)
    return Infinity;
  const suffix = match[1];
  if (/^\d{4}-\d{2}-\d{2}$/.test(suffix))
    return new Date(suffix).getTime();
  return Number(suffix);
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  SocketConnection,
  compareSemver
});
"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __commonJS = (cb, mod) => function __require() {
  return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
};
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  // If the importer is in node compatibility mode or this is not an ESM
  // file that has been converted to a CommonJS file using a Babel-
  // compatible transform (i.e. "__esModule" has not been set), then set
  // "default" to the CommonJS "module.exports" for node compatibility.
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);

// node_modules/colors/lib/styles.js
var require_styles = __commonJS({
  "node_modules/colors/lib/styles.js"(exports2, module2) {
    var styles = {};
    module2["exports"] = styles;
    var codes = {
      reset: [0, 0],
      bold: [1, 22],
      dim: [2, 22],
      italic: [3, 23],
      underline: [4, 24],
      inverse: [7, 27],
      hidden: [8, 28],
      strikethrough: [9, 29],
      black: [30, 39],
      red: [31, 39],
      green: [32, 39],
      yellow: [33, 39],
      blue: [34, 39],
      magenta: [35, 39],
      cyan: [36, 39],
      white: [37, 39],
      gray: [90, 39],
      grey: [90, 39],
      brightRed: [91, 39],
      brightGreen: [92, 39],
      brightYellow: [93, 39],
      brightBlue: [94, 39],
      brightMagenta: [95, 39],
      brightCyan: [96, 39],
      brightWhite: [97, 39],
      bgBlack: [40, 49],
      bgRed: [41, 49],
      bgGreen: [42, 49],
      bgYellow: [43, 49],
      bgBlue: [44, 49],
      bgMagenta: [45, 49],
      bgCyan: [46, 49],
      bgWhite: [47, 49],
      bgGray: [100, 49],
      bgGrey: [100, 49],
      bgBrightRed: [101, 49],
      bgBrightGreen: [102, 49],
      bgBrightYellow: [103, 49],
      bgBrightBlue: [104, 49],
      bgBrightMagenta: [105, 49],
      bgBrightCyan: [106, 49],
      bgBrightWhite: [107, 49],
      // legacy styles for colors pre v1.0.0
      blackBG: [40, 49],
      redBG: [41, 49],
      greenBG: [42, 49],
      yellowBG: [43, 49],
      blueBG: [44, 49],
      magentaBG: [45, 49],
      cyanBG: [46, 49],
      whiteBG: [47, 49]
    };
    Object.keys(codes).forEach(function(key) {
      var val = codes[key];
      var style = styles[key] = [];
      style.open = "\x1B[" + val[0] + "m";
      style.close = "\x1B[" + val[1] + "m";
    });
  }
});

// node_modules/colors/lib/system/has-flag.js
var require_has_flag = __commonJS({
  "node_modules/colors/lib/system/has-flag.js"(exports2, module2) {
    "use strict";
    module2.exports = function(flag, argv) {
      argv = argv || process.argv;
      var terminatorPos = argv.indexOf("--");
      var prefix = /^-{1,2}/.test(flag) ? "" : "--";
      var pos = argv.indexOf(prefix + flag);
      return pos !== -1 && (terminatorPos === -1 ? true : pos < terminatorPos);
    };
  }
});

// node_modules/colors/lib/system/supports-colors.js
var require_supports_colors = __commonJS({
  "node_modules/colors/lib/system/supports-colors.js"(exports2, module2) {
    "use strict";
    var os = require("os");
    var hasFlag = require_has_flag();
    var env = process.env;
    var forceColor = void 0;
    if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false")) {
      forceColor = false;
    } else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
      forceColor = true;
    }
    if ("FORCE_COLOR" in env) {
      forceColor = env.FORCE_COLOR.length === 0 || parseInt(env.FORCE_COLOR, 10) !== 0;
    }
    function translateLevel(level) {
      if (level === 0) {
        return false;
      }
      return {
        level,
        hasBasic: true,
        has256: level >= 2,
        has16m: level >= 3
      };
    }
    function supportsColor(stream) {
      if (forceColor === false) {
        return 0;
      }
      if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
        return 3;
      }
      if (hasFlag("color=256")) {
        return 2;
      }
      if (stream && !stream.isTTY && forceColor !== true) {
        return 0;
      }
      var min = forceColor ? 1 : 0;
      if (process.platform === "win32") {
        var osRelease = os.release().split(".");
        if (Number(process.versions.node.split(".")[0]) >= 8 && Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
          return Number(osRelease[2]) >= 14931 ? 3 : 2;
        }
        return 1;
      }
      if ("CI" in env) {
        if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI"].some(function(sign) {
          return sign in env;
        }) || env.CI_NAME === "codeship") {
          return 1;
        }
        return min;
      }
      if ("TEAMCITY_VERSION" in env) {
        return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
      }
      if ("TERM_PROGRAM" in env) {
        var version2 = parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
        switch (env.TERM_PROGRAM) {
          case "iTerm.app":
            return version2 >= 3 ? 3 : 2;
          case "Hyper":
            return 3;
          case "Apple_Terminal":
            return 2;
        }
      }
      if (/-256(color)?$/i.test(env.TERM)) {
        return 2;
      }
      if (/^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
        return 1;
      }
      if ("COLORTERM" in env) {
        return 1;
      }
      if (env.TERM === "dumb") {
        return min;
      }
      return min;
    }
    function getSupportLevel(stream) {
      var level = supportsColor(stream);
      return translateLevel(level);
    }
    module2.exports = {
      supportsColor: getSupportLevel,
      stdout: getSupportLevel(process.stdout),
      stderr: getSupportLevel(process.stderr)
    };
  }
});

// node_modules/colors/lib/custom/trap.js
var require_trap = __commonJS({
  "node_modules/colors/lib/custom/trap.js"(exports2, module2) {
    module2["exports"] = function runTheTrap(text, options2) {
      var result = "";
      text = text || "Run the trap, drop the bass";
      text = text.split("");
      var trap = {
        a: ["@", "\u0104", "\u023A", "\u0245", "\u0394", "\u039B", "\u0414"],
        b: ["\xDF", "\u0181", "\u0243", "\u026E", "\u03B2", "\u0E3F"],
        c: ["\xA9", "\u023B", "\u03FE"],
        d: ["\xD0", "\u018A", "\u0500", "\u0501", "\u0502", "\u0503"],
        e: [
          "\xCB",
          "\u0115",
          "\u018E",
          "\u0258",
          "\u03A3",
          "\u03BE",
          "\u04BC",
          "\u0A6C"
        ],
        f: ["\u04FA"],
        g: ["\u0262"],
        h: ["\u0126", "\u0195", "\u04A2", "\u04BA", "\u04C7", "\u050A"],
        i: ["\u0F0F"],
        j: ["\u0134"],
        k: ["\u0138", "\u04A0", "\u04C3", "\u051E"],
        l: ["\u0139"],
        m: ["\u028D", "\u04CD", "\u04CE", "\u0520", "\u0521", "\u0D69"],
        n: ["\xD1", "\u014B", "\u019D", "\u0376", "\u03A0", "\u048A"],
        o: [
          "\xD8",
          "\xF5",
          "\xF8",
          "\u01FE",
          "\u0298",
          "\u047A",
          "\u05DD",
          "\u06DD",
          "\u0E4F"
        ],
        p: ["\u01F7", "\u048E"],
        q: ["\u09CD"],
        r: ["\xAE", "\u01A6", "\u0210", "\u024C", "\u0280", "\u042F"],
        s: ["\xA7", "\u03DE", "\u03DF", "\u03E8"],
        t: ["\u0141", "\u0166", "\u0373"],
        u: ["\u01B1", "\u054D"],
        v: ["\u05D8"],
        w: ["\u0428", "\u0460", "\u047C", "\u0D70"],
        x: ["\u04B2", "\u04FE", "\u04FC", "\u04FD"],
        y: ["\xA5", "\u04B0", "\u04CB"],
        z: ["\u01B5", "\u0240"]
      };
      text.forEach(function(c) {
        c = c.toLowerCase();
        var chars = trap[c] || [" "];
        var rand = Math.floor(Math.random() * chars.length);
        if (typeof trap[c] !== "undefined") {
          result += trap[c][rand];
        } else {
          result += c;
        }
      });
      return result;
    };
  }
});

// node_modules/colors/lib/custom/zalgo.js
var require_zalgo = __commonJS({
  "node_modules/colors/lib/custom/zalgo.js"(exports2, module2) {
    module2["exports"] = function zalgo(text, options2) {
      text = text || "   he is here   ";
      var soul = {
        "up": [
          "\u030D",
          "\u030E",
          "\u0304",
          "\u0305",
          "\u033F",
          "\u0311",
          "\u0306",
          "\u0310",
          "\u0352",
          "\u0357",
          "\u0351",
          "\u0307",
          "\u0308",
          "\u030A",
          "\u0342",
          "\u0313",
          "\u0308",
          "\u034A",
          "\u034B",
          "\u034C",
          "\u0303",
          "\u0302",
          "\u030C",
          "\u0350",
          "\u0300",
          "\u0301",
          "\u030B",
          "\u030F",
          "\u0312",
          "\u0313",
          "\u0314",
          "\u033D",
          "\u0309",
          "\u0363",
          "\u0364",
          "\u0365",
          "\u0366",
          "\u0367",
          "\u0368",
          "\u0369",
          "\u036A",
          "\u036B",
          "\u036C",
          "\u036D",
          "\u036E",
          "\u036F",
          "\u033E",
          "\u035B",
          "\u0346",
          "\u031A"
        ],
        "down": [
          "\u0316",
          "\u0317",
          "\u0318",
          "\u0319",
          "\u031C",
          "\u031D",
          "\u031E",
          "\u031F",
          "\u0320",
          "\u0324",
          "\u0325",
          "\u0326",
          "\u0329",
          "\u032A",
          "\u032B",
          "\u032C",
          "\u032D",
          "\u032E",
          "\u032F",
          "\u0330",
          "\u0331",
          "\u0332",
          "\u0333",
          "\u0339",
          "\u033A",
          "\u033B",
          "\u033C",
          "\u0345",
          "\u0347",
          "\u0348",
          "\u0349",
          "\u034D",
          "\u034E",
          "\u0353",
          "\u0354",
          "\u0355",
          "\u0356",
          "\u0359",
          "\u035A",
          "\u0323"
        ],
        "mid": [
          "\u0315",
          "\u031B",
          "\u0300",
          "\u0301",
          "\u0358",
          "\u0321",
          "\u0322",
          "\u0327",
          "\u0328",
          "\u0334",
          "\u0335",
          "\u0336",
          "\u035C",
          "\u035D",
          "\u035E",
          "\u035F",
          "\u0360",
          "\u0362",
          "\u0338",
          "\u0337",
          "\u0361",
          " \u0489"
        ]
      };
      var all = [].concat(soul.up, soul.down, soul.mid);
      function randomNumber(range) {
        var r = Math.floor(Math.random() * range);
        return r;
      }
      function isChar(character) {
        var bool = false;
        all.filter(function(i) {
          bool = i === character;
        });
        return bool;
      }
      function heComes(text2, options3) {
        var result = "";
        var counts;
        var l;
        options3 = options3 || {};
        options3["up"] = typeof options3["up"] !== "undefined" ? options3["up"] : true;
        options3["mid"] = typeof options3["mid"] !== "undefined" ? options3["mid"] : true;
        options3["down"] = typeof options3["down"] !== "undefined" ? options3["down"] : true;
        options3["size"] = typeof options3["size"] !== "undefined" ? options3["size"] : "maxi";
        text2 = text2.split("");
        for (l in text2) {
          if (isChar(l)) {
            continue;
          }
          result = result + text2[l];
          counts = { "up": 0, "down": 0, "mid": 0 };
          switch (options3.size) {
            case "mini":
              counts.up = randomNumber(8);
              counts.mid = randomNumber(2);
              counts.down = randomNumber(8);
              break;
            case "maxi":
              counts.up = randomNumber(16) + 3;
              counts.mid = randomNumber(4) + 1;
              counts.down = randomNumber(64) + 3;
              break;
            default:
              counts.up = randomNumber(8) + 1;
              counts.mid = randomNumber(6) / 2;
              counts.down = randomNumber(8) + 1;
              break;
          }
          var arr = ["up", "mid", "down"];
          for (var d in arr) {
            var index = arr[d];
            for (var i = 0; i <= counts[index]; i++) {
              if (options3[index]) {
                result = result + soul[index][randomNumber(soul[index].length)];
              }
            }
          }
        }
        return result;
      }
      return heComes(text, options2);
    };
  }
});

// node_modules/colors/lib/maps/america.js
var require_america = __commonJS({
  "node_modules/colors/lib/maps/america.js"(exports2, module2) {
    module2["exports"] = function(colors2) {
      return function(letter, i, exploded) {
        if (letter === " ") return letter;
        switch (i % 3) {
          case 0:
            return colors2.red(letter);
          case 1:
            return colors2.white(letter);
          case 2:
            return colors2.blue(letter);
        }
      };
    };
  }
});

// node_modules/colors/lib/maps/zebra.js
var require_zebra = __commonJS({
  "node_modules/colors/lib/maps/zebra.js"(exports2, module2) {
    module2["exports"] = function(colors2) {
      return function(letter, i, exploded) {
        return i % 2 === 0 ? letter : colors2.inverse(letter);
      };
    };
  }
});

// node_modules/colors/lib/maps/rainbow.js
var require_rainbow = __commonJS({
  "node_modules/colors/lib/maps/rainbow.js"(exports2, module2) {
    module2["exports"] = function(colors2) {
      var rainbowColors = ["red", "yellow", "green", "blue", "magenta"];
      return function(letter, i, exploded) {
        if (letter === " ") {
          return letter;
        } else {
          return colors2[rainbowColors[i++ % rainbowColors.length]](letter);
        }
      };
    };
  }
});

// node_modules/colors/lib/maps/random.js
var require_random = __commonJS({
  "node_modules/colors/lib/maps/random.js"(exports2, module2) {
    module2["exports"] = function(colors2) {
      var available = [
        "underline",
        "inverse",
        "grey",
        "yellow",
        "red",
        "green",
        "blue",
        "white",
        "cyan",
        "magenta",
        "brightYellow",
        "brightRed",
        "brightGreen",
        "brightBlue",
        "brightWhite",
        "brightCyan",
        "brightMagenta"
      ];
      return function(letter, i, exploded) {
        return letter === " " ? letter : colors2[available[Math.round(Math.random() * (available.length - 2))]](letter);
      };
    };
  }
});

// node_modules/colors/lib/colors.js
var require_colors = __commonJS({
  "node_modules/colors/lib/colors.js"(exports2, module2) {
    var colors2 = {};
    module2["exports"] = colors2;
    colors2.themes = {};
    var util2 = require("util");
    var ansiStyles = colors2.styles = require_styles();
    var defineProps = Object.defineProperties;
    var newLineRegex = new RegExp(/[\r\n]+/g);
    colors2.supportsColor = require_supports_colors().supportsColor;
    if (typeof colors2.enabled === "undefined") {
      colors2.enabled = colors2.supportsColor() !== false;
    }
    colors2.enable = function() {
      colors2.enabled = true;
    };
    colors2.disable = function() {
      colors2.enabled = false;
    };
    colors2.stripColors = colors2.strip = function(str) {
      return ("" + str).replace(/\x1B\[\d+m/g, "");
    };
    var stylize = colors2.stylize = function stylize2(str, style) {
      if (!colors2.enabled) {
        return str + "";
      }
      var styleMap = ansiStyles[style];
      if (!styleMap && style in colors2) {
        return colors2[style](str);
      }
      return styleMap.open + str + styleMap.close;
    };
    var matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g;
    var escapeStringRegexp = function(str) {
      if (typeof str !== "string") {
        throw new TypeError("Expected a string");
      }
      return str.replace(matchOperatorsRe, "\\$&");
    };
    function build(_styles) {
      var builder = function builder2() {
        return applyStyle.apply(builder2, arguments);
      };
      builder._styles = _styles;
      builder.__proto__ = proto;
      return builder;
    }
    var styles = (function() {
      var ret = {};
      ansiStyles.grey = ansiStyles.gray;
      Object.keys(ansiStyles).forEach(function(key) {
        ansiStyles[key].closeRe = new RegExp(escapeStringRegexp(ansiStyles[key].close), "g");
        ret[key] = {
          get: function() {
            return build(this._styles.concat(key));
          }
        };
      });
      return ret;
    })();
    var proto = defineProps(function colors3() {
    }, styles);
    function applyStyle() {
      var args = Array.prototype.slice.call(arguments);
      var str = args.map(function(arg) {
        if (arg != null && arg.constructor === String) {
          return arg;
        } else {
          return util2.inspect(arg);
        }
      }).join(" ");
      if (!colors2.enabled || !str) {
        return str;
      }
      var newLinesPresent = str.indexOf("\n") != -1;
      var nestedStyles = this._styles;
      var i = nestedStyles.length;
      while (i--) {
        var code = ansiStyles[nestedStyles[i]];
        str = code.open + str.replace(code.closeRe, code.open) + code.close;
        if (newLinesPresent) {
          str = str.replace(newLineRegex, function(match) {
            return code.close + match + code.open;
          });
        }
      }
      return str;
    }
    colors2.setTheme = function(theme) {
      if (typeof theme === "string") {
        console.log("colors.setTheme now only accepts an object, not a string.  If you are trying to set a theme from a file, it is now your (the caller's) responsibility to require the file.  The old syntax looked like colors.setTheme(__dirname + '/../themes/generic-logging.js'); The new syntax looks like colors.setTheme(require(__dirname + '/../themes/generic-logging.js'));");
        return;
      }
      for (var style in theme) {
        (function(style2) {
          colors2[style2] = function(str) {
            if (typeof theme[style2] === "object") {
              var out = str;
              for (var i in theme[style2]) {
                out = colors2[theme[style2][i]](out);
              }
              return out;
            }
            return colors2[theme[style2]](str);
          };
        })(style);
      }
    };
    function init() {
      var ret = {};
      Object.keys(styles).forEach(function(name) {
        ret[name] = {
          get: function() {
            return build([name]);
          }
        };
      });
      return ret;
    }
    var sequencer = function sequencer2(map3, str) {
      var exploded = str.split("");
      exploded = exploded.map(map3);
      return exploded.join("");
    };
    colors2.trap = require_trap();
    colors2.zalgo = require_zalgo();
    colors2.maps = {};
    colors2.maps.america = require_america()(colors2);
    colors2.maps.zebra = require_zebra()(colors2);
    colors2.maps.rainbow = require_rainbow()(colors2);
    colors2.maps.random = require_random()(colors2);
    for (map2 in colors2.maps) {
      (function(map3) {
        colors2[map3] = function(str) {
          return sequencer(colors2.maps[map3], str);
        };
      })(map2);
    }
    var map2;
    defineProps(colors2, init());
  }
});

// node_modules/colors/safe.js
var require_safe = __commonJS({
  "node_modules/colors/safe.js"(exports2, module2) {
    var colors2 = require_colors();
    module2["exports"] = colors2;
  }
});

// node_modules/ms/index.js
var require_ms = __commonJS({
  "node_modules/ms/index.js"(exports2, module2) {
    var s = 1e3;
    var m = s * 60;
    var h = m * 60;
    var d = h * 24;
    var w = d * 7;
    var y = d * 365.25;
    module2.exports = function(val, options2) {
      options2 = options2 || {};
      var type = typeof val;
      if (type === "string" && val.length > 0) {
        return parse3(val);
      } else if (type === "number" && isFinite(val)) {
        return options2.long ? fmtLong(val) : fmtShort(val);
      }
      throw new Error(
        "val is not a non-empty string or a valid number. val=" + JSON.stringify(val)
      );
    };
    function parse3(str) {
      str = String(str);
      if (str.length > 100) {
        return;
      }
      var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
        str
      );
      if (!match) {
        return;
      }
      var n = parseFloat(match[1]);
      var type = (match[2] || "ms").toLowerCase();
      switch (type) {
        case "years":
        case "year":
        case "yrs":
        case "yr":
        case "y":
          return n * y;
        case "weeks":
        case "week":
        case "w":
          return n * w;
        case "days":
        case "day":
        case "d":
          return n * d;
        case "hours":
        case "hour":
        case "hrs":
        case "hr":
        case "h":
          return n * h;
        case "minutes":
        case "minute":
        case "mins":
        case "min":
        case "m":
          return n * m;
        case "seconds":
        case "second":
        case "secs":
        case "sec":
        case "s":
          return n * s;
        case "milliseconds":
        case "millisecond":
        case "msecs":
        case "msec":
        case "ms":
          return n;
        default:
          return void 0;
      }
    }
    function fmtShort(ms) {
      var msAbs = Math.abs(ms);
      if (msAbs >= d) {
        return Math.round(ms / d) + "d";
      }
      if (msAbs >= h) {
        return Math.round(ms / h) + "h";
      }
      if (msAbs >= m) {
        return Math.round(ms / m) + "m";
      }
      if (msAbs >= s) {
        return Math.round(ms / s) + "s";
      }
      return ms + "ms";
    }
    function fmtLong(ms) {
      var msAbs = Math.abs(ms);
      if (msAbs >= d) {
        return plural(ms, msAbs, d, "day");
      }
      if (msAbs >= h) {
        return plural(ms, msAbs, h, "hour");
      }
      if (msAbs >= m) {
        return plural(ms, msAbs, m, "minute");
      }
      if (msAbs >= s) {
        return plural(ms, msAbs, s, "second");
      }
      return ms + " ms";
    }
    function plural(ms, msAbs, n, name) {
      var isPlural = msAbs >= n * 1.5;
      return Math.round(ms / n) + " " + name + (isPlural ? "s" : "");
    }
  }
});

// node_modules/debug/src/common.js
var require_common = __commonJS({
  "node_modules/debug/src/common.js"(exports2, module2) {
    function setup(env) {
      createDebug.debug = createDebug;
      createDebug.default = createDebug;
      createDebug.coerce = coerce;
      createDebug.disable = disable;
      createDebug.enable = enable;
      createDebug.enabled = enabled;
      createDebug.humanize = require_ms();
      createDebug.destroy = destroy;
      Object.keys(env).forEach((key) => {
        createDebug[key] = env[key];
      });
      createDebug.names = [];
      createDebug.skips = [];
      createDebug.formatters = {};
      function selectColor(namespace) {
        let hash2 = 0;
        for (let i = 0; i < namespace.length; i++) {
          hash2 = (hash2 << 5) - hash2 + namespace.charCodeAt(i);
          hash2 |= 0;
        }
        return createDebug.colors[Math.abs(hash2) % createDebug.colors.length];
      }
      createDebug.selectColor = selectColor;
      function createDebug(namespace) {
        let prevTime;
        let enableOverride = null;
        let namespacesCache;
        let enabledCache;
        function debug2(...args) {
          if (!debug2.enabled) {
            return;
          }
          const self = debug2;
          const curr = Number(/* @__PURE__ */ new Date());
          const ms = curr - (prevTime || curr);
          self.diff = ms;
          self.prev = prevTime;
          self.curr = curr;
          prevTime = curr;
          args[0] = createDebug.coerce(args[0]);
          if (typeof args[0] !== "string") {
            args.unshift("%O");
          }
          let index = 0;
          args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {
            if (match === "%%") {
              return "%";
            }
            index++;
            const formatter = createDebug.formatters[format];
            if (typeof formatter === "function") {
              const val = args[index];
              match = formatter.call(self, val);
              args.splice(index, 1);
              index--;
            }
            return match;
          });
          createDebug.formatArgs.call(self, args);
          const logFn = self.log || createDebug.log;
          logFn.apply(self, args);
        }
        debug2.namespace = namespace;
        debug2.useColors = createDebug.useColors();
        debug2.color = createDebug.selectColor(namespace);
        debug2.extend = extend2;
        debug2.destroy = createDebug.destroy;
        Object.defineProperty(debug2, "enabled", {
          enumerable: true,
          configurable: false,
          get: () => {
            if (enableOverride !== null) {
              return enableOverride;
            }
            if (namespacesCache !== createDebug.namespaces) {
              namespacesCache = createDebug.namespaces;
              enabledCache = createDebug.enabled(namespace);
            }
            return enabledCache;
          },
          set: (v) => {
            enableOverride = v;
          }
        });
        if (typeof createDebug.init === "function") {
          createDebug.init(debug2);
        }
        return debug2;
      }
      function extend2(namespace, delimiter) {
        const newDebug = createDebug(this.namespace + (typeof delimiter === "undefined" ? ":" : delimiter) + namespace);
        newDebug.log = this.log;
        return newDebug;
      }
      function enable(namespaces) {
        createDebug.save(namespaces);
        createDebug.namespaces = namespaces;
        createDebug.names = [];
        createDebug.skips = [];
        const split = (typeof namespaces === "string" ? namespaces : "").trim().replace(/\s+/g, ",").split(",").filter(Boolean);
        for (const ns of split) {
          if (ns[0] === "-") {
            createDebug.skips.push(ns.slice(1));
          } else {
            createDebug.names.push(ns);
          }
        }
      }
      function matchesTemplate(search, template) {
        let searchIndex = 0;
        let templateIndex = 0;
        let starIndex = -1;
        let matchIndex = 0;
        while (searchIndex < search.length) {
          if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === "*")) {
            if (template[templateIndex] === "*") {
              starIndex = templateIndex;
              matchIndex = searchIndex;
              templateIndex++;
            } else {
              searchIndex++;
              templateIndex++;
            }
          } else if (starIndex !== -1) {
            templateIndex = starIndex + 1;
            matchIndex++;
            searchIndex = matchIndex;
          } else {
            return false;
          }
        }
        while (templateIndex < template.length && template[templateIndex] === "*") {
          templateIndex++;
        }
        return templateIndex === template.length;
      }
      function disable() {
        const namespaces = [
          ...createDebug.names,
          ...createDebug.skips.map((namespace) => "-" + namespace)
        ].join(",");
        createDebug.enable("");
        return namespaces;
      }
      function enabled(name) {
        for (const skip of createDebug.skips) {
          if (matchesTemplate(name, skip)) {
            return false;
          }
        }
        for (const ns of createDebug.names) {
          if (matchesTemplate(name, ns)) {
            return true;
          }
        }
        return false;
      }
      function coerce(val) {
        if (val instanceof Error) {
          return val.stack || val.message;
        }
        return val;
      }
      function destroy() {
        console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
      }
      createDebug.enable(createDebug.load());
      return createDebug;
    }
    module2.exports = setup;
  }
});

// node_modules/debug/src/browser.js
var require_browser = __commonJS({
  "node_modules/debug/src/browser.js"(exports2, module2) {
    exports2.formatArgs = formatArgs;
    exports2.save = save;
    exports2.load = load;
    exports2.useColors = useColors;
    exports2.storage = localstorage();
    exports2.destroy = /* @__PURE__ */ (() => {
      let warned = false;
      return () => {
        if (!warned) {
          warned = true;
          console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
        }
      };
    })();
    exports2.colors = [
      "#0000CC",
      "#0000FF",
      "#0033CC",
      "#0033FF",
      "#0066CC",
      "#0066FF",
      "#0099CC",
      "#0099FF",
      "#00CC00",
      "#00CC33",
      "#00CC66",
      "#00CC99",
      "#00CCCC",
      "#00CCFF",
      "#3300CC",
      "#3300FF",
      "#3333CC",
      "#3333FF",
      "#3366CC",
      "#3366FF",
      "#3399CC",
      "#3399FF",
      "#33CC00",
      "#33CC33",
      "#33CC66",
      "#33CC99",
      "#33CCCC",
      "#33CCFF",
      "#6600CC",
      "#6600FF",
      "#6633CC",
      "#6633FF",
      "#66CC00",
      "#66CC33",
      "#9900CC",
      "#9900FF",
      "#9933CC",
      "#9933FF",
      "#99CC00",
      "#99CC33",
      "#CC0000",
      "#CC0033",
      "#CC0066",
      "#CC0099",
      "#CC00CC",
      "#CC00FF",
      "#CC3300",
      "#CC3333",
      "#CC3366",
      "#CC3399",
      "#CC33CC",
      "#CC33FF",
      "#CC6600",
      "#CC6633",
      "#CC9900",
      "#CC9933",
      "#CCCC00",
      "#CCCC33",
      "#FF0000",
      "#FF0033",
      "#FF0066",
      "#FF0099",
      "#FF00CC",
      "#FF00FF",
      "#FF3300",
      "#FF3333",
      "#FF3366",
      "#FF3399",
      "#FF33CC",
      "#FF33FF",
      "#FF6600",
      "#FF6633",
      "#FF9900",
      "#FF9933",
      "#FFCC00",
      "#FFCC33"
    ];
    function useColors() {
      if (typeof window !== "undefined" && window.process && (window.process.type === "renderer" || window.process.__nwjs)) {
        return true;
      }
      if (typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
        return false;
      }
      let m;
      return typeof document !== "undefined" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773
      typeof window !== "undefined" && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31?
      // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
      typeof navigator !== "undefined" && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(m[1], 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker
      typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
    }
    function formatArgs(args) {
      args[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + args[0] + (this.useColors ? "%c " : " ") + "+" + module2.exports.humanize(this.diff);
      if (!this.useColors) {
        return;
      }
      const c = "color: " + this.color;
      args.splice(1, 0, c, "color: inherit");
      let index = 0;
      let lastC = 0;
      args[0].replace(/%[a-zA-Z%]/g, (match) => {
        if (match === "%%") {
          return;
        }
        index++;
        if (match === "%c") {
          lastC = index;
        }
      });
      args.splice(lastC, 0, c);
    }
    exports2.log = console.debug || console.log || (() => {
    });
    function save(namespaces) {
      try {
        if (namespaces) {
          exports2.storage.setItem("debug", namespaces);
        } else {
          exports2.storage.removeItem("debug");
        }
      } catch (error48) {
      }
    }
    function load() {
      let r;
      try {
        r = exports2.storage.getItem("debug") || exports2.storage.getItem("DEBUG");
      } catch (error48) {
      }
      if (!r && typeof process !== "undefined" && "env" in process) {
        r = process.env.DEBUG;
      }
      return r;
    }
    function localstorage() {
      try {
        return localStorage;
      } catch (error48) {
      }
    }
    module2.exports = require_common()(exports2);
    var { formatters } = module2.exports;
    formatters.j = function(v) {
      try {
        return JSON.stringify(v);
      } catch (error48) {
        return "[UnexpectedJSONParseError]: " + error48.message;
      }
    };
  }
});

// node_modules/has-flag/index.js
var require_has_flag2 = __commonJS({
  "node_modules/has-flag/index.js"(exports2, module2) {
    "use strict";
    module2.exports = (flag, argv = process.argv) => {
      const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
      const position = argv.indexOf(prefix + flag);
      const terminatorPosition = argv.indexOf("--");
      return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
    };
  }
});

// node_modules/supports-color/index.js
var require_supports_color = __commonJS({
  "node_modules/supports-color/index.js"(exports2, module2) {
    "use strict";
    var os = require("os");
    var tty = require("tty");
    var hasFlag = require_has_flag2();
    var { env } = process;
    var flagForceColor;
    if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
      flagForceColor = 0;
    } else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
      flagForceColor = 1;
    }
    function envForceColor() {
      if ("FORCE_COLOR" in env) {
        if (env.FORCE_COLOR === "true") {
          return 1;
        }
        if (env.FORCE_COLOR === "false") {
          return 0;
        }
        return env.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);
      }
    }
    function translateLevel(level) {
      if (level === 0) {
        return false;
      }
      return {
        level,
        hasBasic: true,
        has256: level >= 2,
        has16m: level >= 3
      };
    }
    function supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
      const noFlagForceColor = envForceColor();
      if (noFlagForceColor !== void 0) {
        flagForceColor = noFlagForceColor;
      }
      const forceColor = sniffFlags ? flagForceColor : noFlagForceColor;
      if (forceColor === 0) {
        return 0;
      }
      if (sniffFlags) {
        if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
          return 3;
        }
        if (hasFlag("color=256")) {
          return 2;
        }
      }
      if (haveStream && !streamIsTTY && forceColor === void 0) {
        return 0;
      }
      const min = forceColor || 0;
      if (env.TERM === "dumb") {
        return min;
      }
      if (process.platform === "win32") {
        const osRelease = os.release().split(".");
        if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
          return Number(osRelease[2]) >= 14931 ? 3 : 2;
        }
        return 1;
      }
      if ("CI" in env) {
        if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "GITHUB_ACTIONS", "BUILDKITE", "DRONE"].some((sign) => sign in env) || env.CI_NAME === "codeship") {
          return 1;
        }
        return min;
      }
      if ("TEAMCITY_VERSION" in env) {
        return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
      }
      if (env.COLORTERM === "truecolor") {
        return 3;
      }
      if ("TERM_PROGRAM" in env) {
        const version2 = Number.parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
        switch (env.TERM_PROGRAM) {
          case "iTerm.app":
            return version2 >= 3 ? 3 : 2;
          case "Apple_Terminal":
            return 2;
        }
      }
      if (/-256(color)?$/i.test(env.TERM)) {
        return 2;
      }
      if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
        return 1;
      }
      if ("COLORTERM" in env) {
        return 1;
      }
      return min;
    }
    function getSupportLevel(stream, options2 = {}) {
      const level = supportsColor(stream, {
        streamIsTTY: stream && stream.isTTY,
        ...options2
      });
      return translateLevel(level);
    }
    module2.exports = {
      supportsColor: getSupportLevel,
      stdout: getSupportLevel({ isTTY: tty.isatty(1) }),
      stderr: getSupportLevel({ isTTY: tty.isatty(2) })
    };
  }
});

// node_modules/debug/src/node.js
var require_node = __commonJS({
  "node_modules/debug/src/node.js"(exports2, module2) {
    var tty = require("tty");
    var util2 = require("util");
    exports2.init = init;
    exports2.log = log;
    exports2.formatArgs = formatArgs;
    exports2.save = save;
    exports2.load = load;
    exports2.useColors = useColors;
    exports2.destroy = util2.deprecate(
      () => {
      },
      "Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."
    );
    exports2.colors = [6, 2, 3, 4, 5, 1];
    try {
      const supportsColor = require_supports_color();
      if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {
        exports2.colors = [
          20,
          21,
          26,
          27,
          32,
          33,
          38,
          39,
          40,
          41,
          42,
          43,
          44,
          45,
          56,
          57,
          62,
          63,
          68,
          69,
          74,
          75,
          76,
          77,
          78,
          79,
          80,
          81,
          92,
          93,
          98,
          99,
          112,
          113,
          128,
          129,
          134,
          135,
          148,
          149,
          160,
          161,
          162,
          163,
          164,
          165,
          166,
          167,
          168,
          169,
          170,
          171,
          172,
          173,
          178,
          179,
          184,
          185,
          196,
          197,
          198,
          199,
          200,
          201,
          202,
          203,
          204,
          205,
          206,
          207,
          208,
          209,
          214,
          215,
          220,
          221
        ];
      }
    } catch (error48) {
    }
    exports2.inspectOpts = Object.keys(process.env).filter((key) => {
      return /^debug_/i.test(key);
    }).reduce((obj, key) => {
      const prop = key.substring(6).toLowerCase().replace(/_([a-z])/g, (_, k) => {
        return k.toUpperCase();
      });
      let val = process.env[key];
      if (/^(yes|on|true|enabled)$/i.test(val)) {
        val = true;
      } else if (/^(no|off|false|disabled)$/i.test(val)) {
        val = false;
      } else if (val === "null") {
        val = null;
      } else {
        val = Number(val);
      }
      obj[prop] = val;
      return obj;
    }, {});
    function useColors() {
      return "colors" in exports2.inspectOpts ? Boolean(exports2.inspectOpts.colors) : tty.isatty(process.stderr.fd);
    }
    function formatArgs(args) {
      const { namespace: name, useColors: useColors2 } = this;
      if (useColors2) {
        const c = this.color;
        const colorCode = "\x1B[3" + (c < 8 ? c : "8;5;" + c);
        const prefix = `  ${colorCode};1m${name} \x1B[0m`;
        args[0] = prefix + args[0].split("\n").join("\n" + prefix);
        args.push(colorCode + "m+" + module2.exports.humanize(this.diff) + "\x1B[0m");
      } else {
        args[0] = getDate() + name + " " + args[0];
      }
    }
    function getDate() {
      if (exports2.inspectOpts.hideDate) {
        return "";
      }
      return (/* @__PURE__ */ new Date()).toISOString() + " ";
    }
    function log(...args) {
      return process.stderr.write(util2.formatWithOptions(exports2.inspectOpts, ...args) + "\n");
    }
    function save(namespaces) {
      if (namespaces) {
        process.env.DEBUG = namespaces;
      } else {
        delete process.env.DEBUG;
      }
    }
    function load() {
      return process.env.DEBUG;
    }
    function init(debug2) {
      debug2.inspectOpts = {};
      const keys = Object.keys(exports2.inspectOpts);
      for (let i = 0; i < keys.length; i++) {
        debug2.inspectOpts[keys[i]] = exports2.inspectOpts[keys[i]];
      }
    }
    module2.exports = require_common()(exports2);
    var { formatters } = module2.exports;
    formatters.o = function(v) {
      this.inspectOpts.colors = this.useColors;
      return util2.inspect(v, this.inspectOpts).split("\n").map((str) => str.trim()).join(" ");
    };
    formatters.O = function(v) {
      this.inspectOpts.colors = this.useColors;
      return util2.inspect(v, this.inspectOpts);
    };
  }
});

// node_modules/debug/src/index.js
var require_src = __commonJS({
  "node_modules/debug/src/index.js"(exports2, module2) {
    if (typeof process === "undefined" || process.type === "renderer" || process.browser === true || process.__nwjs) {
      module2.exports = require_browser();
    } else {
      module2.exports = require_node();
    }
  }
});

// node_modules/ini/lib/ini.js
var require_ini = __commonJS({
  "node_modules/ini/lib/ini.js"(exports2, module2) {
    var { hasOwnProperty } = Object.prototype;
    var encode3 = (obj, opt = {}) => {
      if (typeof opt === "string") {
        opt = { section: opt };
      }
      opt.align = opt.align === true;
      opt.newline = opt.newline === true;
      opt.sort = opt.sort === true;
      opt.whitespace = opt.whitespace === true || opt.align === true;
      opt.platform = opt.platform || typeof process !== "undefined" && process.platform;
      opt.bracketedArray = opt.bracketedArray !== false;
      const eol = opt.platform === "win32" ? "\r\n" : "\n";
      const separator = opt.whitespace ? " = " : "=";
      const children = [];
      const keys = opt.sort ? Object.keys(obj).sort() : Object.keys(obj);
      let padToChars = 0;
      if (opt.align) {
        padToChars = safe(
          keys.filter((k) => obj[k] === null || Array.isArray(obj[k]) || typeof obj[k] !== "object").map((k) => Array.isArray(obj[k]) ? `${k}[]` : k).concat([""]).reduce((a, b) => safe(a).length >= safe(b).length ? a : b)
        ).length;
      }
      let out = "";
      const arraySuffix = opt.bracketedArray ? "[]" : "";
      for (const k of keys) {
        const val = obj[k];
        if (val && Array.isArray(val)) {
          for (const item of val) {
            out += safe(`${k}${arraySuffix}`).padEnd(padToChars, " ") + separator + safe(item) + eol;
          }
        } else if (val && typeof val === "object") {
          children.push(k);
        } else {
          out += safe(k).padEnd(padToChars, " ") + separator + safe(val) + eol;
        }
      }
      if (opt.section && out.length) {
        out = "[" + safe(opt.section) + "]" + (opt.newline ? eol + eol : eol) + out;
      }
      for (const k of children) {
        const nk = splitSections(k, ".").join("\\.");
        const section = (opt.section ? opt.section + "." : "") + nk;
        const child = encode3(obj[k], {
          ...opt,
          section
        });
        if (out.length && child.length) {
          out += eol;
        }
        out += child;
      }
      return out;
    };
    function splitSections(str, separator) {
      var lastMatchIndex = 0;
      var lastSeparatorIndex = 0;
      var nextIndex = 0;
      var sections = [];
      do {
        nextIndex = str.indexOf(separator, lastMatchIndex);
        if (nextIndex !== -1) {
          lastMatchIndex = nextIndex + separator.length;
          if (nextIndex > 0 && str[nextIndex - 1] === "\\") {
            continue;
          }
          sections.push(str.slice(lastSeparatorIndex, nextIndex));
          lastSeparatorIndex = nextIndex + separator.length;
        }
      } while (nextIndex !== -1);
      sections.push(str.slice(lastSeparatorIndex));
      return sections;
    }
    var decode3 = (str, opt = {}) => {
      opt.bracketedArray = opt.bracketedArray !== false;
      const out = /* @__PURE__ */ Object.create(null);
      let p = out;
      let section = null;
      const re = /^\[([^\]]*)\]\s*$|^([^=]+)(=(.*))?$/i;
      const lines = str.split(/[\r\n]+/g);
      const duplicates = {};
      for (const line of lines) {
        if (!line || line.match(/^\s*[;#]/) || line.match(/^\s*$/)) {
          continue;
        }
        const match = line.match(re);
        if (!match) {
          continue;
        }
        if (match[1] !== void 0) {
          section = unsafe(match[1]);
          if (section === "__proto__") {
            p = /* @__PURE__ */ Object.create(null);
            continue;
          }
          p = out[section] = out[section] || /* @__PURE__ */ Object.create(null);
          continue;
        }
        const keyRaw = unsafe(match[2]);
        let isArray;
        if (opt.bracketedArray) {
          isArray = keyRaw.length > 2 && keyRaw.slice(-2) === "[]";
        } else {
          duplicates[keyRaw] = (duplicates?.[keyRaw] || 0) + 1;
          isArray = duplicates[keyRaw] > 1;
        }
        const key = isArray && keyRaw.endsWith("[]") ? keyRaw.slice(0, -2) : keyRaw;
        if (key === "__proto__") {
          continue;
        }
        const valueRaw = match[3] ? unsafe(match[4]) : true;
        const value = valueRaw === "true" || valueRaw === "false" || valueRaw === "null" ? JSON.parse(valueRaw) : valueRaw;
        if (isArray) {
          if (!hasOwnProperty.call(p, key)) {
            p[key] = [];
          } else if (!Array.isArray(p[key])) {
            p[key] = [p[key]];
          }
        }
        if (Array.isArray(p[key])) {
          p[key].push(value);
        } else {
          p[key] = value;
        }
      }
      const remove = [];
      for (const k of Object.keys(out)) {
        if (!hasOwnProperty.call(out, k) || typeof out[k] !== "object" || Array.isArray(out[k])) {
          continue;
        }
        const parts = splitSections(k, ".");
        p = out;
        const l = parts.pop();
        const nl = l.replace(/\\\./g, ".");
        for (const part of parts) {
          if (part === "__proto__") {
            continue;
          }
          if (!hasOwnProperty.call(p, part) || typeof p[part] !== "object") {
            p[part] = /* @__PURE__ */ Object.create(null);
          }
          p = p[part];
        }
        if (p === out && nl === l) {
          continue;
        }
        p[nl] = out[k];
        remove.push(k);
      }
      for (const del of remove) {
        delete out[del];
      }
      return out;
    };
    var isQuoted = (val) => {
      return val.startsWith('"') && val.endsWith('"') || val.startsWith("'") && val.endsWith("'");
    };
    var safe = (val) => {
      if (typeof val !== "string" || val.match(/[=\r\n]/) || val.match(/^\[/) || val.length > 1 && isQuoted(val) || val !== val.trim()) {
        return JSON.stringify(val);
      }
      return val.split(";").join("\\;").split("#").join("\\#");
    };
    var unsafe = (val) => {
      val = (val || "").trim();
      if (isQuoted(val)) {
        if (val.charAt(0) === "'") {
          val = val.slice(1, -1);
        }
        try {
          val = JSON.parse(val);
        } catch {
        }
      } else {
        let esc2 = false;
        let unesc = "";
        for (let i = 0, l = val.length; i < l; i++) {
          const c = val.charAt(i);
          if (esc2) {
            if ("\\;#".indexOf(c) !== -1) {
              unesc += c;
            } else {
              unesc += "\\" + c;
            }
            esc2 = false;
          } else if (";#".indexOf(c) !== -1) {
            break;
          } else if (c === "\\") {
            esc2 = true;
          } else {
            unesc += c;
          }
        }
        if (esc2) {
          unesc += "\\";
        }
        return unesc.trim();
      }
      return val;
    };
    module2.exports = {
      parse: decode3,
      decode: decode3,
      stringify: encode3,
      encode: encode3,
      safe,
      unsafe
    };
  }
});

// node_modules/dotenv/package.json
var require_package = __commonJS({
  "node_modules/dotenv/package.json"(exports2, module2) {
    module2.exports = {
      name: "dotenv",
      version: "16.6.1",
      description: "Loads environment variables from .env file",
      main: "lib/main.js",
      types: "lib/main.d.ts",
      exports: {
        ".": {
          types: "./lib/main.d.ts",
          require: "./lib/main.js",
          default: "./lib/main.js"
        },
        "./config": "./config.js",
        "./config.js": "./config.js",
        "./lib/env-options": "./lib/env-options.js",
        "./lib/env-options.js": "./lib/env-options.js",
        "./lib/cli-options": "./lib/cli-options.js",
        "./lib/cli-options.js": "./lib/cli-options.js",
        "./package.json": "./package.json"
      },
      scripts: {
        "dts-check": "tsc --project tests/types/tsconfig.json",
        lint: "standard",
        pretest: "npm run lint && npm run dts-check",
        test: "tap run --allow-empty-coverage --disable-coverage --timeout=60000",
        "test:coverage": "tap run --show-full-coverage --timeout=60000 --coverage-report=text --coverage-report=lcov",
        prerelease: "npm test",
        release: "standard-version"
      },
      repository: {
        type: "git",
        url: "git://github.com/motdotla/dotenv.git"
      },
      homepage: "https://github.com/motdotla/dotenv#readme",
      funding: "https://dotenvx.com",
      keywords: [
        "dotenv",
        "env",
        ".env",
        "environment",
        "variables",
        "config",
        "settings"
      ],
      readmeFilename: "README.md",
      license: "BSD-2-Clause",
      devDependencies: {
        "@types/node": "^18.11.3",
        decache: "^4.6.2",
        sinon: "^14.0.1",
        standard: "^17.0.0",
        "standard-version": "^9.5.0",
        tap: "^19.2.0",
        typescript: "^4.8.4"
      },
      engines: {
        node: ">=12"
      },
      browser: {
        fs: false
      }
    };
  }
});

// node_modules/dotenv/lib/main.js
var require_main = __commonJS({
  "node_modules/dotenv/lib/main.js"(exports2, module2) {
    var fs = require("fs");
    var path = require("path");
    var os = require("os");
    var crypto4 = require("crypto");
    var packageJson = require_package();
    var version2 = packageJson.version;
    var LINE = /(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;
    function parse3(src) {
      const obj = {};
      let lines = src.toString();
      lines = lines.replace(/\r\n?/mg, "\n");
      let match;
      while ((match = LINE.exec(lines)) != null) {
        const key = match[1];
        let value = match[2] || "";
        value = value.trim();
        const maybeQuote = value[0];
        value = value.replace(/^(['"`])([\s\S]*)\1$/mg, "$2");
        if (maybeQuote === '"') {
          value = value.replace(/\\n/g, "\n");
          value = value.replace(/\\r/g, "\r");
        }
        obj[key] = value;
      }
      return obj;
    }
    function _parseVault(options2) {
      options2 = options2 || {};
      const vaultPath = _vaultPath(options2);
      options2.path = vaultPath;
      const result = DotenvModule.configDotenv(options2);
      if (!result.parsed) {
        const err = new Error(`MISSING_DATA: Cannot parse ${vaultPath} for an unknown reason`);
        err.code = "MISSING_DATA";
        throw err;
      }
      const keys = _dotenvKey(options2).split(",");
      const length = keys.length;
      let decrypted;
      for (let i = 0; i < length; i++) {
        try {
          const key = keys[i].trim();
          const attrs = _instructions(result, key);
          decrypted = DotenvModule.decrypt(attrs.ciphertext, attrs.key);
          break;
        } catch (error48) {
          if (i + 1 >= length) {
            throw error48;
          }
        }
      }
      return DotenvModule.parse(decrypted);
    }
    function _warn(message) {
      console.log(`[dotenv@${version2}][WARN] ${message}`);
    }
    function _debug(message) {
      console.log(`[dotenv@${version2}][DEBUG] ${message}`);
    }
    function _log(message) {
      console.log(`[dotenv@${version2}] ${message}`);
    }
    function _dotenvKey(options2) {
      if (options2 && options2.DOTENV_KEY && options2.DOTENV_KEY.length > 0) {
        return options2.DOTENV_KEY;
      }
      if (process.env.DOTENV_KEY && process.env.DOTENV_KEY.length > 0) {
        return process.env.DOTENV_KEY;
      }
      return "";
    }
    function _instructions(result, dotenvKey) {
      let uri;
      try {
        uri = new URL(dotenvKey);
      } catch (error48) {
        if (error48.code === "ERR_INVALID_URL") {
          const err = new Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development");
          err.code = "INVALID_DOTENV_KEY";
          throw err;
        }
        throw error48;
      }
      const key = uri.password;
      if (!key) {
        const err = new Error("INVALID_DOTENV_KEY: Missing key part");
        err.code = "INVALID_DOTENV_KEY";
        throw err;
      }
      const environment = uri.searchParams.get("environment");
      if (!environment) {
        const err = new Error("INVALID_DOTENV_KEY: Missing environment part");
        err.code = "INVALID_DOTENV_KEY";
        throw err;
      }
      const environmentKey = `DOTENV_VAULT_${environment.toUpperCase()}`;
      const ciphertext = result.parsed[environmentKey];
      if (!ciphertext) {
        const err = new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${environmentKey} in your .env.vault file.`);
        err.code = "NOT_FOUND_DOTENV_ENVIRONMENT";
        throw err;
      }
      return { ciphertext, key };
    }
    function _vaultPath(options2) {
      let possibleVaultPath = null;
      if (options2 && options2.path && options2.path.length > 0) {
        if (Array.isArray(options2.path)) {
          for (const filepath of options2.path) {
            if (fs.existsSync(filepath)) {
              possibleVaultPath = filepath.endsWith(".vault") ? filepath : `${filepath}.vault`;
            }
          }
        } else {
          possibleVaultPath = options2.path.endsWith(".vault") ? options2.path : `${options2.path}.vault`;
        }
      } else {
        possibleVaultPath = path.resolve(process.cwd(), ".env.vault");
      }
      if (fs.existsSync(possibleVaultPath)) {
        return possibleVaultPath;
      }
      return null;
    }
    function _resolveHome(envPath) {
      return envPath[0] === "~" ? path.join(os.homedir(), envPath.slice(1)) : envPath;
    }
    function _configVault(options2) {
      const debug2 = Boolean(options2 && options2.debug);
      const quiet = options2 && "quiet" in options2 ? options2.quiet : true;
      if (debug2 || !quiet) {
        _log("Loading env from encrypted .env.vault");
      }
      const parsed = DotenvModule._parseVault(options2);
      let processEnv = process.env;
      if (options2 && options2.processEnv != null) {
        processEnv = options2.processEnv;
      }
      DotenvModule.populate(processEnv, parsed, options2);
      return { parsed };
    }
    function configDotenv(options2) {
      const dotenvPath = path.resolve(process.cwd(), ".env");
      let encoding = "utf8";
      const debug2 = Boolean(options2 && options2.debug);
      const quiet = options2 && "quiet" in options2 ? options2.quiet : true;
      if (options2 && options2.encoding) {
        encoding = options2.encoding;
      } else {
        if (debug2) {
          _debug("No encoding is specified. UTF-8 is used by default");
        }
      }
      let optionPaths = [dotenvPath];
      if (options2 && options2.path) {
        if (!Array.isArray(options2.path)) {
          optionPaths = [_resolveHome(options2.path)];
        } else {
          optionPaths = [];
          for (const filepath of options2.path) {
            optionPaths.push(_resolveHome(filepath));
          }
        }
      }
      let lastError;
      const parsedAll = {};
      for (const path2 of optionPaths) {
        try {
          const parsed = DotenvModule.parse(fs.readFileSync(path2, { encoding }));
          DotenvModule.populate(parsedAll, parsed, options2);
        } catch (e) {
          if (debug2) {
            _debug(`Failed to load ${path2} ${e.message}`);
          }
          lastError = e;
        }
      }
      let processEnv = process.env;
      if (options2 && options2.processEnv != null) {
        processEnv = options2.processEnv;
      }
      DotenvModule.populate(processEnv, parsedAll, options2);
      if (debug2 || !quiet) {
        const keysCount = Object.keys(parsedAll).length;
        const shortPaths = [];
        for (const filePath of optionPaths) {
          try {
            const relative = path.relative(process.cwd(), filePath);
            shortPaths.push(relative);
          } catch (e) {
            if (debug2) {
              _debug(`Failed to load ${filePath} ${e.message}`);
            }
            lastError = e;
          }
        }
        _log(`injecting env (${keysCount}) from ${shortPaths.join(",")}`);
      }
      if (lastError) {
        return { parsed: parsedAll, error: lastError };
      } else {
        return { parsed: parsedAll };
      }
    }
    function config2(options2) {
      if (_dotenvKey(options2).length === 0) {
        return DotenvModule.configDotenv(options2);
      }
      const vaultPath = _vaultPath(options2);
      if (!vaultPath) {
        _warn(`You set DOTENV_KEY but you are missing a .env.vault file at ${vaultPath}. Did you forget to build it?`);
        return DotenvModule.configDotenv(options2);
      }
      return DotenvModule._configVault(options2);
    }
    function decrypt(encrypted, keyStr) {
      const key = Buffer.from(keyStr.slice(-64), "hex");
      let ciphertext = Buffer.from(encrypted, "base64");
      const nonce = ciphertext.subarray(0, 12);
      const authTag = ciphertext.subarray(-16);
      ciphertext = ciphertext.subarray(12, -16);
      try {
        const aesgcm = crypto4.createDecipheriv("aes-256-gcm", key, nonce);
        aesgcm.setAuthTag(authTag);
        return `${aesgcm.update(ciphertext)}${aesgcm.final()}`;
      } catch (error48) {
        const isRange = error48 instanceof RangeError;
        const invalidKeyLength = error48.message === "Invalid key length";
        const decryptionFailed = error48.message === "Unsupported state or unable to authenticate data";
        if (isRange || invalidKeyLength) {
          const err = new Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");
          err.code = "INVALID_DOTENV_KEY";
          throw err;
        } else if (decryptionFailed) {
          const err = new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");
          err.code = "DECRYPTION_FAILED";
          throw err;
        } else {
          throw error48;
        }
      }
    }
    function populate(processEnv, parsed, options2 = {}) {
      const debug2 = Boolean(options2 && options2.debug);
      const override = Boolean(options2 && options2.override);
      if (typeof parsed !== "object") {
        const err = new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");
        err.code = "OBJECT_REQUIRED";
        throw err;
      }
      for (const key of Object.keys(parsed)) {
        if (Object.prototype.hasOwnProperty.call(processEnv, key)) {
          if (override === true) {
            processEnv[key] = parsed[key];
          }
          if (debug2) {
            if (override === true) {
              _debug(`"${key}" is already defined and WAS overwritten`);
            } else {
              _debug(`"${key}" is already defined and was NOT overwritten`);
            }
          }
        } else {
          processEnv[key] = parsed[key];
        }
      }
    }
    var DotenvModule = {
      configDotenv,
      _configVault,
      _parseVault,
      config: config2,
      decrypt,
      parse: parse3,
      populate
    };
    module2.exports.configDotenv = DotenvModule.configDotenv;
    module2.exports._configVault = DotenvModule._configVault;
    module2.exports._parseVault = DotenvModule._parseVault;
    module2.exports.config = DotenvModule.config;
    module2.exports.decrypt = DotenvModule.decrypt;
    module2.exports.parse = DotenvModule.parse;
    module2.exports.populate = DotenvModule.populate;
    module2.exports = DotenvModule;
  }
});

// node_modules/agent-base/dist/helpers.js
var require_helpers = __commonJS({
  "node_modules/agent-base/dist/helpers.js"(exports2) {
    "use strict";
    var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) {
      if (k2 === void 0) k2 = k;
      var desc = Object.getOwnPropertyDescriptor(m, k);
      if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
        desc = { enumerable: true, get: function() {
          return m[k];
        } };
      }
      Object.defineProperty(o, k2, desc);
    }) : (function(o, m, k, k2) {
      if (k2 === void 0) k2 = k;
      o[k2] = m[k];
    }));
    var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) {
      Object.defineProperty(o, "default", { enumerable: true, value: v });
    }) : function(o, v) {
      o["default"] = v;
    });
    var __importStar = exports2 && exports2.__importStar || function(mod) {
      if (mod && mod.__esModule) return mod;
      var result = {};
      if (mod != null) {
        for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
      }
      __setModuleDefault(result, mod);
      return result;
    };
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.req = exports2.json = exports2.toBuffer = void 0;
    var http = __importStar(require("http"));
    var https = __importStar(require("https"));
    async function toBuffer(stream) {
      let length = 0;
      const chunks = [];
      for await (const chunk of stream) {
        length += chunk.length;
        chunks.push(chunk);
      }
      return Buffer.concat(chunks, length);
    }
    exports2.toBuffer = toBuffer;
    async function json2(stream) {
      const buf = await toBuffer(stream);
      const str = buf.toString("utf8");
      try {
        return JSON.parse(str);
      } catch (_err) {
        const err = _err;
        err.message += ` (input: ${str})`;
        throw err;
      }
    }
    exports2.json = json2;
    function req(url2, opts = {}) {
      const href = typeof url2 === "string" ? url2 : url2.href;
      const req2 = (href.startsWith("https:") ? https : http).request(url2, opts);
      const promise2 = new Promise((resolve, reject) => {
        req2.once("response", resolve).once("error", reject).end();
      });
      req2.then = promise2.then.bind(promise2);
      return req2;
    }
    exports2.req = req;
  }
});

// node_modules/agent-base/dist/index.js
var require_dist = __commonJS({
  "node_modules/agent-base/dist/index.js"(exports2) {
    "use strict";
    var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) {
      if (k2 === void 0) k2 = k;
      var desc = Object.getOwnPropertyDescriptor(m, k);
      if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
        desc = { enumerable: true, get: function() {
          return m[k];
        } };
      }
      Object.defineProperty(o, k2, desc);
    }) : (function(o, m, k, k2) {
      if (k2 === void 0) k2 = k;
      o[k2] = m[k];
    }));
    var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) {
      Object.defineProperty(o, "default", { enumerable: true, value: v });
    }) : function(o, v) {
      o["default"] = v;
    });
    var __importStar = exports2 && exports2.__importStar || function(mod) {
      if (mod && mod.__esModule) return mod;
      var result = {};
      if (mod != null) {
        for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
      }
      __setModuleDefault(result, mod);
      return result;
    };
    var __exportStar = exports2 && exports2.__exportStar || function(m, exports3) {
      for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p)) __createBinding(exports3, m, p);
    };
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.Agent = void 0;
    var net = __importStar(require("net"));
    var http = __importStar(require("http"));
    var https_1 = require("https");
    __exportStar(require_helpers(), exports2);
    var INTERNAL = Symbol("AgentBaseInternalState");
    var Agent = class extends http.Agent {
      constructor(opts) {
        super(opts);
        this[INTERNAL] = {};
      }
      /**
       * Determine whether this is an `http` or `https` request.
       */
      isSecureEndpoint(options2) {
        if (options2) {
          if (typeof options2.secureEndpoint === "boolean") {
            return options2.secureEndpoint;
          }
          if (typeof options2.protocol === "string") {
            return options2.protocol === "https:";
          }
        }
        const { stack } = new Error();
        if (typeof stack !== "string")
          return false;
        return stack.split("\n").some((l) => l.indexOf("(https.js:") !== -1 || l.indexOf("node:https:") !== -1);
      }
      // In order to support async signatures in `connect()` and Node's native
      // connection pooling in `http.Agent`, the array of sockets for each origin
      // has to be updated synchronously. This is so the length of the array is
      // accurate when `addRequest()` is next called. We achieve this by creating a
      // fake socket and adding it to `sockets[origin]` and incrementing
      // `totalSocketCount`.
      incrementSockets(name) {
        if (this.maxSockets === Infinity && this.maxTotalSockets === Infinity) {
          return null;
        }
        if (!this.sockets[name]) {
          this.sockets[name] = [];
        }
        const fakeSocket = new net.Socket({ writable: false });
        this.sockets[name].push(fakeSocket);
        this.totalSocketCount++;
        return fakeSocket;
      }
      decrementSockets(name, socket) {
        if (!this.sockets[name] || socket === null) {
          return;
        }
        const sockets = this.sockets[name];
        const index = sockets.indexOf(socket);
        if (index !== -1) {
          sockets.splice(index, 1);
          this.totalSocketCount--;
          if (sockets.length === 0) {
            delete this.sockets[name];
          }
        }
      }
      // In order to properly update the socket pool, we need to call `getName()` on
      // the core `https.Agent` if it is a secureEndpoint.
      getName(options2) {
        const secureEndpoint = this.isSecureEndpoint(options2);
        if (secureEndpoint) {
          return https_1.Agent.prototype.getName.call(this, options2);
        }
        return super.getName(options2);
      }
      createSocket(req, options2, cb) {
        const connectOpts = {
          ...options2,
          secureEndpoint: this.isSecureEndpoint(options2)
        };
        const name = this.getName(connectOpts);
        const fakeSocket = this.incrementSockets(name);
        Promise.resolve().then(() => this.connect(req, connectOpts)).then((socket) => {
          this.decrementSockets(name, fakeSocket);
          if (socket instanceof http.Agent) {
            try {
              return socket.addRequest(req, connectOpts);
            } catch (err) {
              return cb(err);
            }
          }
          this[INTERNAL].currentSocket = socket;
          super.createSocket(req, options2, cb);
        }, (err) => {
          this.decrementSockets(name, fakeSocket);
          cb(err);
        });
      }
      createConnection() {
        const socket = this[INTERNAL].currentSocket;
        this[INTERNAL].currentSocket = void 0;
        if (!socket) {
          throw new Error("No socket was returned in the `connect()` function");
        }
        return socket;
      }
      get defaultPort() {
        return this[INTERNAL].defaultPort ?? (this.protocol === "https:" ? 443 : 80);
      }
      set defaultPort(v) {
        if (this[INTERNAL]) {
          this[INTERNAL].defaultPort = v;
        }
      }
      get protocol() {
        return this[INTERNAL].protocol ?? (this.isSecureEndpoint() ? "https:" : "http:");
      }
      set protocol(v) {
        if (this[INTERNAL]) {
          this[INTERNAL].protocol = v;
        }
      }
    };
    exports2.Agent = Agent;
  }
});

// node_modules/https-proxy-agent/dist/parse-proxy-response.js
var require_parse_proxy_response = __commonJS({
  "node_modules/https-proxy-agent/dist/parse-proxy-response.js"(exports2) {
    "use strict";
    var __importDefault = exports2 && exports2.__importDefault || function(mod) {
      return mod && mod.__esModule ? mod : { "default": mod };
    };
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.parseProxyResponse = void 0;
    var debug_1 = __importDefault(require_src());
    var debug2 = (0, debug_1.default)("https-proxy-agent:parse-proxy-response");
    function parseProxyResponse(socket) {
      return new Promise((resolve, reject) => {
        let buffersLength = 0;
        const buffers = [];
        function read() {
          const b = socket.read();
          if (b)
            ondata(b);
          else
            socket.once("readable", read);
        }
        function cleanup() {
          socket.removeListener("end", onend);
          socket.removeListener("error", onerror);
          socket.removeListener("readable", read);
        }
        function onend() {
          cleanup();
          debug2("onend");
          reject(new Error("Proxy connection ended before receiving CONNECT response"));
        }
        function onerror(err) {
          cleanup();
          debug2("onerror %o", err);
          reject(err);
        }
        function ondata(b) {
          buffers.push(b);
          buffersLength += b.length;
          const buffered = Buffer.concat(buffers, buffersLength);
          const endOfHeaders = buffered.indexOf("\r\n\r\n");
          if (endOfHeaders === -1) {
            debug2("have not received end of HTTP headers yet...");
            read();
            return;
          }
          const headerParts = buffered.slice(0, endOfHeaders).toString("ascii").split("\r\n");
          const firstLine = headerParts.shift();
          if (!firstLine) {
            socket.destroy();
            return reject(new Error("No header received from proxy CONNECT response"));
          }
          const firstLineParts = firstLine.split(" ");
          const statusCode = +firstLineParts[1];
          const statusText = firstLineParts.slice(2).join(" ");
          const headers = {};
          for (const header of headerParts) {
            if (!header)
              continue;
            const firstColon = header.indexOf(":");
            if (firstColon === -1) {
              socket.destroy();
              return reject(new Error(`Invalid header from proxy CONNECT response: "${header}"`));
            }
            const key = header.slice(0, firstColon).toLowerCase();
            const value = header.slice(firstColon + 1).trimStart();
            const current = headers[key];
            if (typeof current === "string") {
              headers[key] = [current, value];
            } else if (Array.isArray(current)) {
              current.push(value);
            } else {
              headers[key] = value;
            }
          }
          debug2("got proxy server response: %o %o", firstLine, headers);
          cleanup();
          resolve({
            connect: {
              statusCode,
              statusText,
              headers
            },
            buffered
          });
        }
        socket.on("error", onerror);
        socket.on("end", onend);
        read();
      });
    }
    exports2.parseProxyResponse = parseProxyResponse;
  }
});

// node_modules/https-proxy-agent/dist/index.js
var require_dist2 = __commonJS({
  "node_modules/https-proxy-agent/dist/index.js"(exports2) {
    "use strict";
    var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) {
      if (k2 === void 0) k2 = k;
      var desc = Object.getOwnPropertyDescriptor(m, k);
      if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
        desc = { enumerable: true, get: function() {
          return m[k];
        } };
      }
      Object.defineProperty(o, k2, desc);
    }) : (function(o, m, k, k2) {
      if (k2 === void 0) k2 = k;
      o[k2] = m[k];
    }));
    var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) {
      Object.defineProperty(o, "default", { enumerable: true, value: v });
    }) : function(o, v) {
      o["default"] = v;
    });
    var __importStar = exports2 && exports2.__importStar || function(mod) {
      if (mod && mod.__esModule) return mod;
      var result = {};
      if (mod != null) {
        for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
      }
      __setModuleDefault(result, mod);
      return result;
    };
    var __importDefault = exports2 && exports2.__importDefault || function(mod) {
      return mod && mod.__esModule ? mod : { "default": mod };
    };
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.HttpsProxyAgent = void 0;
    var net = __importStar(require("net"));
    var tls = __importStar(require("tls"));
    var assert_1 = __importDefault(require("assert"));
    var debug_1 = __importDefault(require_src());
    var agent_base_1 = require_dist();
    var url_1 = require("url");
    var parse_proxy_response_1 = require_parse_proxy_response();
    var debug2 = (0, debug_1.default)("https-proxy-agent");
    var setServernameFromNonIpHost = (options2) => {
      if (options2.servername === void 0 && options2.host && !net.isIP(options2.host)) {
        return {
          ...options2,
          servername: options2.host
        };
      }
      return options2;
    };
    var HttpsProxyAgent2 = class extends agent_base_1.Agent {
      constructor(proxy, opts) {
        super(opts);
        this.options = { path: void 0 };
        this.proxy = typeof proxy === "string" ? new url_1.URL(proxy) : proxy;
        this.proxyHeaders = opts?.headers ?? {};
        debug2("Creating new HttpsProxyAgent instance: %o", this.proxy.href);
        const host = (this.proxy.hostname || this.proxy.host).replace(/^\[|\]$/g, "");
        const port = this.proxy.port ? parseInt(this.proxy.port, 10) : this.proxy.protocol === "https:" ? 443 : 80;
        this.connectOpts = {
          // Attempt to negotiate http/1.1 for proxy servers that support http/2
          ALPNProtocols: ["http/1.1"],
          ...opts ? omit2(opts, "headers") : null,
          host,
          port
        };
      }
      /**
       * Called when the node-core HTTP client library is creating a
       * new HTTP request.
       */
      async connect(req, opts) {
        const { proxy } = this;
        if (!opts.host) {
          throw new TypeError('No "host" provided');
        }
        let socket;
        if (proxy.protocol === "https:") {
          debug2("Creating `tls.Socket`: %o", this.connectOpts);
          socket = tls.connect(setServernameFromNonIpHost(this.connectOpts));
        } else {
          debug2("Creating `net.Socket`: %o", this.connectOpts);
          socket = net.connect(this.connectOpts);
        }
        const headers = typeof this.proxyHeaders === "function" ? this.proxyHeaders() : { ...this.proxyHeaders };
        const host = net.isIPv6(opts.host) ? `[${opts.host}]` : opts.host;
        let payload = `CONNECT ${host}:${opts.port} HTTP/1.1\r
`;
        if (proxy.username || proxy.password) {
          const auth2 = `${decodeURIComponent(proxy.username)}:${decodeURIComponent(proxy.password)}`;
          headers["Proxy-Authorization"] = `Basic ${Buffer.from(auth2).toString("base64")}`;
        }
        headers.Host = `${host}:${opts.port}`;
        if (!headers["Proxy-Connection"]) {
          headers["Proxy-Connection"] = this.keepAlive ? "Keep-Alive" : "close";
        }
        for (const name of Object.keys(headers)) {
          payload += `${name}: ${headers[name]}\r
`;
        }
        const proxyResponsePromise = (0, parse_proxy_response_1.parseProxyResponse)(socket);
        socket.write(`${payload}\r
`);
        const { connect, buffered } = await proxyResponsePromise;
        req.emit("proxyConnect", connect);
        this.emit("proxyConnect", connect, req);
        if (connect.statusCode === 200) {
          req.once("socket", resume);
          if (opts.secureEndpoint) {
            debug2("Upgrading socket connection to TLS");
            return tls.connect({
              ...omit2(setServernameFromNonIpHost(opts), "host", "path", "port"),
              socket
            });
          }
          return socket;
        }
        socket.destroy();
        const fakeSocket = new net.Socket({ writable: false });
        fakeSocket.readable = true;
        req.once("socket", (s) => {
          debug2("Replaying proxy buffer for failed request");
          (0, assert_1.default)(s.listenerCount("data") > 0);
          s.push(buffered);
          s.push(null);
        });
        return fakeSocket;
      }
    };
    HttpsProxyAgent2.protocols = ["http", "https"];
    exports2.HttpsProxyAgent = HttpsProxyAgent2;
    function resume(socket) {
      socket.resume();
    }
    function omit2(obj, ...keys) {
      const ret = {};
      let key;
      for (key in obj) {
        if (!keys.includes(key)) {
          ret[key] = obj[key];
        }
      }
      return ret;
    }
  }
});

// node_modules/jpeg-js/lib/encoder.js
var require_encoder = __commonJS({
  "node_modules/jpeg-js/lib/encoder.js"(exports2, module2) {
    var btoa2 = btoa2 || function(buf) {
      return Buffer.from(buf).toString("base64");
    };
    function JPEGEncoder(quality) {
      var self = this;
      var fround = Math.round;
      var ffloor = Math.floor;
      var YTable = new Array(64);
      var UVTable = new Array(64);
      var fdtbl_Y = new Array(64);
      var fdtbl_UV = new Array(64);
      var YDC_HT;
      var UVDC_HT;
      var YAC_HT;
      var UVAC_HT;
      var bitcode = new Array(65535);
      var category = new Array(65535);
      var outputfDCTQuant = new Array(64);
      var DU = new Array(64);
      var byteout = [];
      var bytenew = 0;
      var bytepos = 7;
      var YDU = new Array(64);
      var UDU = new Array(64);
      var VDU = new Array(64);
      var clt = new Array(256);
      var RGB_YUV_TABLE = new Array(2048);
      var currentQuality;
      var ZigZag = [
        0,
        1,
        5,
        6,
        14,
        15,
        27,
        28,
        2,
        4,
        7,
        13,
        16,
        26,
        29,
        42,
        3,
        8,
        12,
        17,
        25,
        30,
        41,
        43,
        9,
        11,
        18,
        24,
        31,
        40,
        44,
        53,
        10,
        19,
        23,
        32,
        39,
        45,
        52,
        54,
        20,
        22,
        33,
        38,
        46,
        51,
        55,
        60,
        21,
        34,
        37,
        47,
        50,
        56,
        59,
        61,
        35,
        36,
        48,
        49,
        57,
        58,
        62,
        63
      ];
      var std_dc_luminance_nrcodes = [0, 0, 1, 5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0];
      var std_dc_luminance_values = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11];
      var std_ac_luminance_nrcodes = [0, 0, 2, 1, 3, 3, 2, 4, 3, 5, 5, 4, 4, 0, 0, 1, 125];
      var std_ac_luminance_values = [
        1,
        2,
        3,
        0,
        4,
        17,
        5,
        18,
        33,
        49,
        65,
        6,
        19,
        81,
        97,
        7,
        34,
        113,
        20,
        50,
        129,
        145,
        161,
        8,
        35,
        66,
        177,
        193,
        21,
        82,
        209,
        240,
        36,
        51,
        98,
        114,
        130,
        9,
        10,
        22,
        23,
        24,
        25,
        26,
        37,
        38,
        39,
        40,
        41,
        42,
        52,
        53,
        54,
        55,
        56,
        57,
        58,
        67,
        68,
        69,
        70,
        71,
        72,
        73,
        74,
        83,
        84,
        85,
        86,
        87,
        88,
        89,
        90,
        99,
        100,
        101,
        102,
        103,
        104,
        105,
        106,
        115,
        116,
        117,
        118,
        119,
        120,
        121,
        122,
        131,
        132,
        133,
        134,
        135,
        136,
        137,
        138,
        146,
        147,
        148,
        149,
        150,
        151,
        152,
        153,
        154,
        162,
        163,
        164,
        165,
        166,
        167,
        168,
        169,
        170,
        178,
        179,
        180,
        181,
        182,
        183,
        184,
        185,
        186,
        194,
        195,
        196,
        197,
        198,
        199,
        200,
        201,
        202,
        210,
        211,
        212,
        213,
        214,
        215,
        216,
        217,
        218,
        225,
        226,
        227,
        228,
        229,
        230,
        231,
        232,
        233,
        234,
        241,
        242,
        243,
        244,
        245,
        246,
        247,
        248,
        249,
        250
      ];
      var std_dc_chrominance_nrcodes = [0, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0];
      var std_dc_chrominance_values = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11];
      var std_ac_chrominance_nrcodes = [0, 0, 2, 1, 2, 4, 4, 3, 4, 7, 5, 4, 4, 0, 1, 2, 119];
      var std_ac_chrominance_values = [
        0,
        1,
        2,
        3,
        17,
        4,
        5,
        33,
        49,
        6,
        18,
        65,
        81,
        7,
        97,
        113,
        19,
        34,
        50,
        129,
        8,
        20,
        66,
        145,
        161,
        177,
        193,
        9,
        35,
        51,
        82,
        240,
        21,
        98,
        114,
        209,
        10,
        22,
        36,
        52,
        225,
        37,
        241,
        23,
        24,
        25,
        26,
        38,
        39,
        40,
        41,
        42,
        53,
        54,
        55,
        56,
        57,
        58,
        67,
        68,
        69,
        70,
        71,
        72,
        73,
        74,
        83,
        84,
        85,
        86,
        87,
        88,
        89,
        90,
        99,
        100,
        101,
        102,
        103,
        104,
        105,
        106,
        115,
        116,
        117,
        118,
        119,
        120,
        121,
        122,
        130,
        131,
        132,
        133,
        134,
        135,
        136,
        137,
        138,
        146,
        147,
        148,
        149,
        150,
        151,
        152,
        153,
        154,
        162,
        163,
        164,
        165,
        166,
        167,
        168,
        169,
        170,
        178,
        179,
        180,
        181,
        182,
        183,
        184,
        185,
        186,
        194,
        195,
        196,
        197,
        198,
        199,
        200,
        201,
        202,
        210,
        211,
        212,
        213,
        214,
        215,
        216,
        217,
        218,
        226,
        227,
        228,
        229,
        230,
        231,
        232,
        233,
        234,
        242,
        243,
        244,
        245,
        246,
        247,
        248,
        249,
        250
      ];
      function initQuantTables(sf) {
        var YQT = [
          16,
          11,
          10,
          16,
          24,
          40,
          51,
          61,
          12,
          12,
          14,
          19,
          26,
          58,
          60,
          55,
          14,
          13,
          16,
          24,
          40,
          57,
          69,
          56,
          14,
          17,
          22,
          29,
          51,
          87,
          80,
          62,
          18,
          22,
          37,
          56,
          68,
          109,
          103,
          77,
          24,
          35,
          55,
          64,
          81,
          104,
          113,
          92,
          49,
          64,
          78,
          87,
          103,
          121,
          120,
          101,
          72,
          92,
          95,
          98,
          112,
          100,
          103,
          99
        ];
        for (var i = 0; i < 64; i++) {
          var t = ffloor((YQT[i] * sf + 50) / 100);
          if (t < 1) {
            t = 1;
          } else if (t > 255) {
            t = 255;
          }
          YTable[ZigZag[i]] = t;
        }
        var UVQT = [
          17,
          18,
          24,
          47,
          99,
          99,
          99,
          99,
          18,
          21,
          26,
          66,
          99,
          99,
          99,
          99,
          24,
          26,
          56,
          99,
          99,
          99,
          99,
          99,
          47,
          66,
          99,
          99,
          99,
          99,
          99,
          99,
          99,
          99,
          99,
          99,
          99,
          99,
          99,
          99,
          99,
          99,
          99,
          99,
          99,
          99,
          99,
          99,
          99,
          99,
          99,
          99,
          99,
          99,
          99,
          99,
          99,
          99,
          99,
          99,
          99,
          99,
          99,
          99
        ];
        for (var j = 0; j < 64; j++) {
          var u = ffloor((UVQT[j] * sf + 50) / 100);
          if (u < 1) {
            u = 1;
          } else if (u > 255) {
            u = 255;
          }
          UVTable[ZigZag[j]] = u;
        }
        var aasf = [
          1,
          1.387039845,
          1.306562965,
          1.175875602,
          1,
          0.785694958,
          0.5411961,
          0.275899379
        ];
        var k = 0;
        for (var row = 0; row < 8; row++) {
          for (var col = 0; col < 8; col++) {
            fdtbl_Y[k] = 1 / (YTable[ZigZag[k]] * aasf[row] * aasf[col] * 8);
            fdtbl_UV[k] = 1 / (UVTable[ZigZag[k]] * aasf[row] * aasf[col] * 8);
            k++;
          }
        }
      }
      function computeHuffmanTbl(nrcodes, std_table) {
        var codevalue = 0;
        var pos_in_table = 0;
        var HT = new Array();
        for (var k = 1; k <= 16; k++) {
          for (var j = 1; j <= nrcodes[k]; j++) {
            HT[std_table[pos_in_table]] = [];
            HT[std_table[pos_in_table]][0] = codevalue;
            HT[std_table[pos_in_table]][1] = k;
            pos_in_table++;
            codevalue++;
          }
          codevalue *= 2;
        }
        return HT;
      }
      function initHuffmanTbl() {
        YDC_HT = computeHuffmanTbl(std_dc_luminance_nrcodes, std_dc_luminance_values);
        UVDC_HT = computeHuffmanTbl(std_dc_chrominance_nrcodes, std_dc_chrominance_values);
        YAC_HT = computeHuffmanTbl(std_ac_luminance_nrcodes, std_ac_luminance_values);
        UVAC_HT = computeHuffmanTbl(std_ac_chrominance_nrcodes, std_ac_chrominance_values);
      }
      function initCategoryNumber() {
        var nrlower = 1;
        var nrupper = 2;
        for (var cat = 1; cat <= 15; cat++) {
          for (var nr = nrlower; nr < nrupper; nr++) {
            category[32767 + nr] = cat;
            bitcode[32767 + nr] = [];
            bitcode[32767 + nr][1] = cat;
            bitcode[32767 + nr][0] = nr;
          }
          for (var nrneg = -(nrupper - 1); nrneg <= -nrlower; nrneg++) {
            category[32767 + nrneg] = cat;
            bitcode[32767 + nrneg] = [];
            bitcode[32767 + nrneg][1] = cat;
            bitcode[32767 + nrneg][0] = nrupper - 1 + nrneg;
          }
          nrlower <<= 1;
          nrupper <<= 1;
        }
      }
      function initRGBYUVTable() {
        for (var i = 0; i < 256; i++) {
          RGB_YUV_TABLE[i] = 19595 * i;
          RGB_YUV_TABLE[i + 256 >> 0] = 38470 * i;
          RGB_YUV_TABLE[i + 512 >> 0] = 7471 * i + 32768;
          RGB_YUV_TABLE[i + 768 >> 0] = -11059 * i;
          RGB_YUV_TABLE[i + 1024 >> 0] = -21709 * i;
          RGB_YUV_TABLE[i + 1280 >> 0] = 32768 * i + 8421375;
          RGB_YUV_TABLE[i + 1536 >> 0] = -27439 * i;
          RGB_YUV_TABLE[i + 1792 >> 0] = -5329 * i;
        }
      }
      function writeBits(bs) {
        var value = bs[0];
        var posval = bs[1] - 1;
        while (posval >= 0) {
          if (value & 1 << posval) {
            bytenew |= 1 << bytepos;
          }
          posval--;
          bytepos--;
          if (bytepos < 0) {
            if (bytenew == 255) {
              writeByte(255);
              writeByte(0);
            } else {
              writeByte(bytenew);
            }
            bytepos = 7;
            bytenew = 0;
          }
        }
      }
      function writeByte(value) {
        byteout.push(value);
      }
      function writeWord(value) {
        writeByte(value >> 8 & 255);
        writeByte(value & 255);
      }
      function fDCTQuant(data, fdtbl) {
        var d0, d1, d2, d3, d4, d5, d6, d7;
        var dataOff = 0;
        var i;
        var I8 = 8;
        var I64 = 64;
        for (i = 0; i < I8; ++i) {
          d0 = data[dataOff];
          d1 = data[dataOff + 1];
          d2 = data[dataOff + 2];
          d3 = data[dataOff + 3];
          d4 = data[dataOff + 4];
          d5 = data[dataOff + 5];
          d6 = data[dataOff + 6];
          d7 = data[dataOff + 7];
          var tmp0 = d0 + d7;
          var tmp7 = d0 - d7;
          var tmp1 = d1 + d6;
          var tmp6 = d1 - d6;
          var tmp2 = d2 + d5;
          var tmp5 = d2 - d5;
          var tmp3 = d3 + d4;
          var tmp4 = d3 - d4;
          var tmp10 = tmp0 + tmp3;
          var tmp13 = tmp0 - tmp3;
          var tmp11 = tmp1 + tmp2;
          var tmp12 = tmp1 - tmp2;
          data[dataOff] = tmp10 + tmp11;
          data[dataOff + 4] = tmp10 - tmp11;
          var z1 = (tmp12 + tmp13) * 0.707106781;
          data[dataOff + 2] = tmp13 + z1;
          data[dataOff + 6] = tmp13 - z1;
          tmp10 = tmp4 + tmp5;
          tmp11 = tmp5 + tmp6;
          tmp12 = tmp6 + tmp7;
          var z5 = (tmp10 - tmp12) * 0.382683433;
          var z2 = 0.5411961 * tmp10 + z5;
          var z4 = 1.306562965 * tmp12 + z5;
          var z3 = tmp11 * 0.707106781;
          var z11 = tmp7 + z3;
          var z13 = tmp7 - z3;
          data[dataOff + 5] = z13 + z2;
          data[dataOff + 3] = z13 - z2;
          data[dataOff + 1] = z11 + z4;
          data[dataOff + 7] = z11 - z4;
          dataOff += 8;
        }
        dataOff = 0;
        for (i = 0; i < I8; ++i) {
          d0 = data[dataOff];
          d1 = data[dataOff + 8];
          d2 = data[dataOff + 16];
          d3 = data[dataOff + 24];
          d4 = data[dataOff + 32];
          d5 = data[dataOff + 40];
          d6 = data[dataOff + 48];
          d7 = data[dataOff + 56];
          var tmp0p2 = d0 + d7;
          var tmp7p2 = d0 - d7;
          var tmp1p2 = d1 + d6;
          var tmp6p2 = d1 - d6;
          var tmp2p2 = d2 + d5;
          var tmp5p2 = d2 - d5;
          var tmp3p2 = d3 + d4;
          var tmp4p2 = d3 - d4;
          var tmp10p2 = tmp0p2 + tmp3p2;
          var tmp13p2 = tmp0p2 - tmp3p2;
          var tmp11p2 = tmp1p2 + tmp2p2;
          var tmp12p2 = tmp1p2 - tmp2p2;
          data[dataOff] = tmp10p2 + tmp11p2;
          data[dataOff + 32] = tmp10p2 - tmp11p2;
          var z1p2 = (tmp12p2 + tmp13p2) * 0.707106781;
          data[dataOff + 16] = tmp13p2 + z1p2;
          data[dataOff + 48] = tmp13p2 - z1p2;
          tmp10p2 = tmp4p2 + tmp5p2;
          tmp11p2 = tmp5p2 + tmp6p2;
          tmp12p2 = tmp6p2 + tmp7p2;
          var z5p2 = (tmp10p2 - tmp12p2) * 0.382683433;
          var z2p2 = 0.5411961 * tmp10p2 + z5p2;
          var z4p2 = 1.306562965 * tmp12p2 + z5p2;
          var z3p2 = tmp11p2 * 0.707106781;
          var z11p2 = tmp7p2 + z3p2;
          var z13p2 = tmp7p2 - z3p2;
          data[dataOff + 40] = z13p2 + z2p2;
          data[dataOff + 24] = z13p2 - z2p2;
          data[dataOff + 8] = z11p2 + z4p2;
          data[dataOff + 56] = z11p2 - z4p2;
          dataOff++;
        }
        var fDCTQuant2;
        for (i = 0; i < I64; ++i) {
          fDCTQuant2 = data[i] * fdtbl[i];
          outputfDCTQuant[i] = fDCTQuant2 > 0 ? fDCTQuant2 + 0.5 | 0 : fDCTQuant2 - 0.5 | 0;
        }
        return outputfDCTQuant;
      }
      function writeAPP0() {
        writeWord(65504);
        writeWord(16);
        writeByte(74);
        writeByte(70);
        writeByte(73);
        writeByte(70);
        writeByte(0);
        writeByte(1);
        writeByte(1);
        writeByte(0);
        writeWord(1);
        writeWord(1);
        writeByte(0);
        writeByte(0);
      }
      function writeAPP1(exifBuffer) {
        if (!exifBuffer) return;
        writeWord(65505);
        if (exifBuffer[0] === 69 && exifBuffer[1] === 120 && exifBuffer[2] === 105 && exifBuffer[3] === 102) {
          writeWord(exifBuffer.length + 2);
        } else {
          writeWord(exifBuffer.length + 5 + 2);
          writeByte(69);
          writeByte(120);
          writeByte(105);
          writeByte(102);
          writeByte(0);
        }
        for (var i = 0; i < exifBuffer.length; i++) {
          writeByte(exifBuffer[i]);
        }
      }
      function writeSOF0(width, height) {
        writeWord(65472);
        writeWord(17);
        writeByte(8);
        writeWord(height);
        writeWord(width);
        writeByte(3);
        writeByte(1);
        writeByte(17);
        writeByte(0);
        writeByte(2);
        writeByte(17);
        writeByte(1);
        writeByte(3);
        writeByte(17);
        writeByte(1);
      }
      function writeDQT() {
        writeWord(65499);
        writeWord(132);
        writeByte(0);
        for (var i = 0; i < 64; i++) {
          writeByte(YTable[i]);
        }
        writeByte(1);
        for (var j = 0; j < 64; j++) {
          writeByte(UVTable[j]);
        }
      }
      function writeDHT() {
        writeWord(65476);
        writeWord(418);
        writeByte(0);
        for (var i = 0; i < 16; i++) {
          writeByte(std_dc_luminance_nrcodes[i + 1]);
        }
        for (var j = 0; j <= 11; j++) {
          writeByte(std_dc_luminance_values[j]);
        }
        writeByte(16);
        for (var k = 0; k < 16; k++) {
          writeByte(std_ac_luminance_nrcodes[k + 1]);
        }
        for (var l = 0; l <= 161; l++) {
          writeByte(std_ac_luminance_values[l]);
        }
        writeByte(1);
        for (var m = 0; m < 16; m++) {
          writeByte(std_dc_chrominance_nrcodes[m + 1]);
        }
        for (var n = 0; n <= 11; n++) {
          writeByte(std_dc_chrominance_values[n]);
        }
        writeByte(17);
        for (var o = 0; o < 16; o++) {
          writeByte(std_ac_chrominance_nrcodes[o + 1]);
        }
        for (var p = 0; p <= 161; p++) {
          writeByte(std_ac_chrominance_values[p]);
        }
      }
      function writeCOM(comments) {
        if (typeof comments === "undefined" || comments.constructor !== Array) return;
        comments.forEach((e) => {
          if (typeof e !== "string") return;
          writeWord(65534);
          var l = e.length;
          writeWord(l + 2);
          var i;
          for (i = 0; i < l; i++)
            writeByte(e.charCodeAt(i));
        });
      }
      function writeSOS() {
        writeWord(65498);
        writeWord(12);
        writeByte(3);
        writeByte(1);
        writeByte(0);
        writeByte(2);
        writeByte(17);
        writeByte(3);
        writeByte(17);
        writeByte(0);
        writeByte(63);
        writeByte(0);
      }
      function processDU(CDU, fdtbl, DC, HTDC, HTAC) {
        var EOB = HTAC[0];
        var M16zeroes = HTAC[240];
        var pos;
        var I16 = 16;
        var I63 = 63;
        var I64 = 64;
        var DU_DCT = fDCTQuant(CDU, fdtbl);
        for (var j = 0; j < I64; ++j) {
          DU[ZigZag[j]] = DU_DCT[j];
        }
        var Diff2 = DU[0] - DC;
        DC = DU[0];
        if (Diff2 == 0) {
          writeBits(HTDC[0]);
        } else {
          pos = 32767 + Diff2;
          writeBits(HTDC[category[pos]]);
          writeBits(bitcode[pos]);
        }
        var end0pos = 63;
        for (; end0pos > 0 && DU[end0pos] == 0; end0pos--) {
        }
        ;
        if (end0pos == 0) {
          writeBits(EOB);
          return DC;
        }
        var i = 1;
        var lng;
        while (i <= end0pos) {
          var startpos = i;
          for (; DU[i] == 0 && i <= end0pos; ++i) {
          }
          var nrzeroes = i - startpos;
          if (nrzeroes >= I16) {
            lng = nrzeroes >> 4;
            for (var nrmarker = 1; nrmarker <= lng; ++nrmarker)
              writeBits(M16zeroes);
            nrzeroes = nrzeroes & 15;
          }
          pos = 32767 + DU[i];
          writeBits(HTAC[(nrzeroes << 4) + category[pos]]);
          writeBits(bitcode[pos]);
          i++;
        }
        if (end0pos != I63) {
          writeBits(EOB);
        }
        return DC;
      }
      function initCharLookupTable() {
        var sfcc = String.fromCharCode;
        for (var i = 0; i < 256; i++) {
          clt[i] = sfcc(i);
        }
      }
      this.encode = function(image, quality2) {
        var time_start = (/* @__PURE__ */ new Date()).getTime();
        if (quality2) setQuality(quality2);
        byteout = new Array();
        bytenew = 0;
        bytepos = 7;
        writeWord(65496);
        writeAPP0();
        writeCOM(image.comments);
        writeAPP1(image.exifBuffer);
        writeDQT();
        writeSOF0(image.width, image.height);
        writeDHT();
        writeSOS();
        var DCY = 0;
        var DCU = 0;
        var DCV = 0;
        bytenew = 0;
        bytepos = 7;
        this.encode.displayName = "_encode_";
        var imageData = image.data;
        var width = image.width;
        var height = image.height;
        var quadWidth = width * 4;
        var tripleWidth = width * 3;
        var x, y = 0;
        var r, g, b;
        var start, p, col, row, pos;
        while (y < height) {
          x = 0;
          while (x < quadWidth) {
            start = quadWidth * y + x;
            p = start;
            col = -1;
            row = 0;
            for (pos = 0; pos < 64; pos++) {
              row = pos >> 3;
              col = (pos & 7) * 4;
              p = start + row * quadWidth + col;
              if (y + row >= height) {
                p -= quadWidth * (y + 1 + row - height);
              }
              if (x + col >= quadWidth) {
                p -= x + col - quadWidth + 4;
              }
              r = imageData[p++];
              g = imageData[p++];
              b = imageData[p++];
              YDU[pos] = (RGB_YUV_TABLE[r] + RGB_YUV_TABLE[g + 256 >> 0] + RGB_YUV_TABLE[b + 512 >> 0] >> 16) - 128;
              UDU[pos] = (RGB_YUV_TABLE[r + 768 >> 0] + RGB_YUV_TABLE[g + 1024 >> 0] + RGB_YUV_TABLE[b + 1280 >> 0] >> 16) - 128;
              VDU[pos] = (RGB_YUV_TABLE[r + 1280 >> 0] + RGB_YUV_TABLE[g + 1536 >> 0] + RGB_YUV_TABLE[b + 1792 >> 0] >> 16) - 128;
            }
            DCY = processDU(YDU, fdtbl_Y, DCY, YDC_HT, YAC_HT);
            DCU = processDU(UDU, fdtbl_UV, DCU, UVDC_HT, UVAC_HT);
            DCV = processDU(VDU, fdtbl_UV, DCV, UVDC_HT, UVAC_HT);
            x += 32;
          }
          y += 8;
        }
        if (bytepos >= 0) {
          var fillbits = [];
          fillbits[1] = bytepos + 1;
          fillbits[0] = (1 << bytepos + 1) - 1;
          writeBits(fillbits);
        }
        writeWord(65497);
        if (typeof module2 === "undefined") return new Uint8Array(byteout);
        return Buffer.from(byteout);
        var jpegDataUri = "data:image/jpeg;base64," + btoa2(byteout.join(""));
        byteout = [];
        var duration3 = (/* @__PURE__ */ new Date()).getTime() - time_start;
        return jpegDataUri;
      };
      function setQuality(quality2) {
        if (quality2 <= 0) {
          quality2 = 1;
        }
        if (quality2 > 100) {
          quality2 = 100;
        }
        if (currentQuality == quality2) return;
        var sf = 0;
        if (quality2 < 50) {
          sf = Math.floor(5e3 / quality2);
        } else {
          sf = Math.floor(200 - quality2 * 2);
        }
        initQuantTables(sf);
        currentQuality = quality2;
      }
      function init() {
        var time_start = (/* @__PURE__ */ new Date()).getTime();
        if (!quality) quality = 50;
        initCharLookupTable();
        initHuffmanTbl();
        initCategoryNumber();
        initRGBYUVTable();
        setQuality(quality);
        var duration3 = (/* @__PURE__ */ new Date()).getTime() - time_start;
      }
      init();
    }
    if (typeof module2 !== "undefined") {
      module2.exports = encode3;
    } else if (typeof window !== "undefined") {
      window["jpeg-js"] = window["jpeg-js"] || {};
      window["jpeg-js"].encode = encode3;
    }
    function encode3(imgData, qu) {
      if (typeof qu === "undefined") qu = 50;
      var encoder = new JPEGEncoder(qu);
      var data = encoder.encode(imgData, qu);
      return {
        data,
        width: imgData.width,
        height: imgData.height
      };
    }
  }
});

// node_modules/jpeg-js/lib/decoder.js
var require_decoder = __commonJS({
  "node_modules/jpeg-js/lib/decoder.js"(exports2, module2) {
    var JpegImage = (function jpegImage() {
      "use strict";
      var dctZigZag = new Int32Array([
        0,
        1,
        8,
        16,
        9,
        2,
        3,
        10,
        17,
        24,
        32,
        25,
        18,
        11,
        4,
        5,
        12,
        19,
        26,
        33,
        40,
        48,
        41,
        34,
        27,
        20,
        13,
        6,
        7,
        14,
        21,
        28,
        35,
        42,
        49,
        56,
        57,
        50,
        43,
        36,
        29,
        22,
        15,
        23,
        30,
        37,
        44,
        51,
        58,
        59,
        52,
        45,
        38,
        31,
        39,
        46,
        53,
        60,
        61,
        54,
        47,
        55,
        62,
        63
      ]);
      var dctCos1 = 4017;
      var dctSin1 = 799;
      var dctCos3 = 3406;
      var dctSin3 = 2276;
      var dctCos6 = 1567;
      var dctSin6 = 3784;
      var dctSqrt2 = 5793;
      var dctSqrt1d2 = 2896;
      function constructor() {
      }
      function buildHuffmanTable(codeLengths, values) {
        var k = 0, code = [], i, j, length = 16;
        while (length > 0 && !codeLengths[length - 1])
          length--;
        code.push({ children: [], index: 0 });
        var p = code[0], q;
        for (i = 0; i < length; i++) {
          for (j = 0; j < codeLengths[i]; j++) {
            p = code.pop();
            p.children[p.index] = values[k];
            while (p.index > 0) {
              if (code.length === 0)
                throw new Error("Could not recreate Huffman Table");
              p = code.pop();
            }
            p.index++;
            code.push(p);
            while (code.length <= i) {
              code.push(q = { children: [], index: 0 });
              p.children[p.index] = q.children;
              p = q;
            }
            k++;
          }
          if (i + 1 < length) {
            code.push(q = { children: [], index: 0 });
            p.children[p.index] = q.children;
            p = q;
          }
        }
        return code[0].children;
      }
      function decodeScan(data, offset, frame, components, resetInterval, spectralStart, spectralEnd, successivePrev, successive, opts) {
        var precision = frame.precision;
        var samplesPerLine = frame.samplesPerLine;
        var scanLines = frame.scanLines;
        var mcusPerLine = frame.mcusPerLine;
        var progressive = frame.progressive;
        var maxH = frame.maxH, maxV = frame.maxV;
        var startOffset = offset, bitsData = 0, bitsCount = 0;
        function readBit() {
          if (bitsCount > 0) {
            bitsCount--;
            return bitsData >> bitsCount & 1;
          }
          bitsData = data[offset++];
          if (bitsData == 255) {
            var nextByte = data[offset++];
            if (nextByte) {
              throw new Error("unexpected marker: " + (bitsData << 8 | nextByte).toString(16));
            }
          }
          bitsCount = 7;
          return bitsData >>> 7;
        }
        function decodeHuffman(tree) {
          var node = tree, bit;
          while ((bit = readBit()) !== null) {
            node = node[bit];
            if (typeof node === "number")
              return node;
            if (typeof node !== "object")
              throw new Error("invalid huffman sequence");
          }
          return null;
        }
        function receive(length) {
          var n2 = 0;
          while (length > 0) {
            var bit = readBit();
            if (bit === null) return;
            n2 = n2 << 1 | bit;
            length--;
          }
          return n2;
        }
        function receiveAndExtend(length) {
          var n2 = receive(length);
          if (n2 >= 1 << length - 1)
            return n2;
          return n2 + (-1 << length) + 1;
        }
        function decodeBaseline(component2, zz) {
          var t = decodeHuffman(component2.huffmanTableDC);
          var diff2 = t === 0 ? 0 : receiveAndExtend(t);
          zz[0] = component2.pred += diff2;
          var k2 = 1;
          while (k2 < 64) {
            var rs = decodeHuffman(component2.huffmanTableAC);
            var s = rs & 15, r = rs >> 4;
            if (s === 0) {
              if (r < 15)
                break;
              k2 += 16;
              continue;
            }
            k2 += r;
            var z2 = dctZigZag[k2];
            zz[z2] = receiveAndExtend(s);
            k2++;
          }
        }
        function decodeDCFirst(component2, zz) {
          var t = decodeHuffman(component2.huffmanTableDC);
          var diff2 = t === 0 ? 0 : receiveAndExtend(t) << successive;
          zz[0] = component2.pred += diff2;
        }
        function decodeDCSuccessive(component2, zz) {
          zz[0] |= readBit() << successive;
        }
        var eobrun = 0;
        function decodeACFirst(component2, zz) {
          if (eobrun > 0) {
            eobrun--;
            return;
          }
          var k2 = spectralStart, e = spectralEnd;
          while (k2 <= e) {
            var rs = decodeHuffman(component2.huffmanTableAC);
            var s = rs & 15, r = rs >> 4;
            if (s === 0) {
              if (r < 15) {
                eobrun = receive(r) + (1 << r) - 1;
                break;
              }
              k2 += 16;
              continue;
            }
            k2 += r;
            var z2 = dctZigZag[k2];
            zz[z2] = receiveAndExtend(s) * (1 << successive);
            k2++;
          }
        }
        var successiveACState = 0, successiveACNextValue;
        function decodeACSuccessive(component2, zz) {
          var k2 = spectralStart, e = spectralEnd, r = 0;
          while (k2 <= e) {
            var z2 = dctZigZag[k2];
            var direction = zz[z2] < 0 ? -1 : 1;
            switch (successiveACState) {
              case 0:
                var rs = decodeHuffman(component2.huffmanTableAC);
                var s = rs & 15, r = rs >> 4;
                if (s === 0) {
                  if (r < 15) {
                    eobrun = receive(r) + (1 << r);
                    successiveACState = 4;
                  } else {
                    r = 16;
                    successiveACState = 1;
                  }
                } else {
                  if (s !== 1)
                    throw new Error("invalid ACn encoding");
                  successiveACNextValue = receiveAndExtend(s);
                  successiveACState = r ? 2 : 3;
                }
                continue;
              case 1:
              // skipping r zero items
              case 2:
                if (zz[z2])
                  zz[z2] += (readBit() << successive) * direction;
                else {
                  r--;
                  if (r === 0)
                    successiveACState = successiveACState == 2 ? 3 : 0;
                }
                break;
              case 3:
                if (zz[z2])
                  zz[z2] += (readBit() << successive) * direction;
                else {
                  zz[z2] = successiveACNextValue << successive;
                  successiveACState = 0;
                }
                break;
              case 4:
                if (zz[z2])
                  zz[z2] += (readBit() << successive) * direction;
                break;
            }
            k2++;
          }
          if (successiveACState === 4) {
            eobrun--;
            if (eobrun === 0)
              successiveACState = 0;
          }
        }
        function decodeMcu(component2, decode4, mcu2, row, col) {
          var mcuRow = mcu2 / mcusPerLine | 0;
          var mcuCol = mcu2 % mcusPerLine;
          var blockRow = mcuRow * component2.v + row;
          var blockCol = mcuCol * component2.h + col;
          if (component2.blocks[blockRow] === void 0 && opts.tolerantDecoding)
            return;
          decode4(component2, component2.blocks[blockRow][blockCol]);
        }
        function decodeBlock(component2, decode4, mcu2) {
          var blockRow = mcu2 / component2.blocksPerLine | 0;
          var blockCol = mcu2 % component2.blocksPerLine;
          if (component2.blocks[blockRow] === void 0 && opts.tolerantDecoding)
            return;
          decode4(component2, component2.blocks[blockRow][blockCol]);
        }
        var componentsLength = components.length;
        var component, i, j, k, n;
        var decodeFn;
        if (progressive) {
          if (spectralStart === 0)
            decodeFn = successivePrev === 0 ? decodeDCFirst : decodeDCSuccessive;
          else
            decodeFn = successivePrev === 0 ? decodeACFirst : decodeACSuccessive;
        } else {
          decodeFn = decodeBaseline;
        }
        var mcu = 0, marker;
        var mcuExpected;
        if (componentsLength == 1) {
          mcuExpected = components[0].blocksPerLine * components[0].blocksPerColumn;
        } else {
          mcuExpected = mcusPerLine * frame.mcusPerColumn;
        }
        if (!resetInterval) resetInterval = mcuExpected;
        var h, v;
        while (mcu < mcuExpected) {
          for (i = 0; i < componentsLength; i++)
            components[i].pred = 0;
          eobrun = 0;
          if (componentsLength == 1) {
            component = components[0];
            for (n = 0; n < resetInterval; n++) {
              decodeBlock(component, decodeFn, mcu);
              mcu++;
            }
          } else {
            for (n = 0; n < resetInterval; n++) {
              for (i = 0; i < componentsLength; i++) {
                component = components[i];
                h = component.h;
                v = component.v;
                for (j = 0; j < v; j++) {
                  for (k = 0; k < h; k++) {
                    decodeMcu(component, decodeFn, mcu, j, k);
                  }
                }
              }
              mcu++;
              if (mcu === mcuExpected) break;
            }
          }
          if (mcu === mcuExpected) {
            do {
              if (data[offset] === 255) {
                if (data[offset + 1] !== 0) {
                  break;
                }
              }
              offset += 1;
            } while (offset < data.length - 2);
          }
          bitsCount = 0;
          marker = data[offset] << 8 | data[offset + 1];
          if (marker < 65280) {
            throw new Error("marker was not found");
          }
          if (marker >= 65488 && marker <= 65495) {
            offset += 2;
          } else
            break;
        }
        return offset - startOffset;
      }
      function buildComponentData(frame, component) {
        var lines = [];
        var blocksPerLine = component.blocksPerLine;
        var blocksPerColumn = component.blocksPerColumn;
        var samplesPerLine = blocksPerLine << 3;
        var R = new Int32Array(64), r = new Uint8Array(64);
        function quantizeAndInverse(zz, dataOut, dataIn) {
          var qt = component.quantizationTable;
          var v0, v1, v2, v3, v4, v5, v6, v7, t;
          var p = dataIn;
          var i2;
          for (i2 = 0; i2 < 64; i2++)
            p[i2] = zz[i2] * qt[i2];
          for (i2 = 0; i2 < 8; ++i2) {
            var row = 8 * i2;
            if (p[1 + row] == 0 && p[2 + row] == 0 && p[3 + row] == 0 && p[4 + row] == 0 && p[5 + row] == 0 && p[6 + row] == 0 && p[7 + row] == 0) {
              t = dctSqrt2 * p[0 + row] + 512 >> 10;
              p[0 + row] = t;
              p[1 + row] = t;
              p[2 + row] = t;
              p[3 + row] = t;
              p[4 + row] = t;
              p[5 + row] = t;
              p[6 + row] = t;
              p[7 + row] = t;
              continue;
            }
            v0 = dctSqrt2 * p[0 + row] + 128 >> 8;
            v1 = dctSqrt2 * p[4 + row] + 128 >> 8;
            v2 = p[2 + row];
            v3 = p[6 + row];
            v4 = dctSqrt1d2 * (p[1 + row] - p[7 + row]) + 128 >> 8;
            v7 = dctSqrt1d2 * (p[1 + row] + p[7 + row]) + 128 >> 8;
            v5 = p[3 + row] << 4;
            v6 = p[5 + row] << 4;
            t = v0 - v1 + 1 >> 1;
            v0 = v0 + v1 + 1 >> 1;
            v1 = t;
            t = v2 * dctSin6 + v3 * dctCos6 + 128 >> 8;
            v2 = v2 * dctCos6 - v3 * dctSin6 + 128 >> 8;
            v3 = t;
            t = v4 - v6 + 1 >> 1;
            v4 = v4 + v6 + 1 >> 1;
            v6 = t;
            t = v7 + v5 + 1 >> 1;
            v5 = v7 - v5 + 1 >> 1;
            v7 = t;
            t = v0 - v3 + 1 >> 1;
            v0 = v0 + v3 + 1 >> 1;
            v3 = t;
            t = v1 - v2 + 1 >> 1;
            v1 = v1 + v2 + 1 >> 1;
            v2 = t;
            t = v4 * dctSin3 + v7 * dctCos3 + 2048 >> 12;
            v4 = v4 * dctCos3 - v7 * dctSin3 + 2048 >> 12;
            v7 = t;
            t = v5 * dctSin1 + v6 * dctCos1 + 2048 >> 12;
            v5 = v5 * dctCos1 - v6 * dctSin1 + 2048 >> 12;
            v6 = t;
            p[0 + row] = v0 + v7;
            p[7 + row] = v0 - v7;
            p[1 + row] = v1 + v6;
            p[6 + row] = v1 - v6;
            p[2 + row] = v2 + v5;
            p[5 + row] = v2 - v5;
            p[3 + row] = v3 + v4;
            p[4 + row] = v3 - v4;
          }
          for (i2 = 0; i2 < 8; ++i2) {
            var col = i2;
            if (p[1 * 8 + col] == 0 && p[2 * 8 + col] == 0 && p[3 * 8 + col] == 0 && p[4 * 8 + col] == 0 && p[5 * 8 + col] == 0 && p[6 * 8 + col] == 0 && p[7 * 8 + col] == 0) {
              t = dctSqrt2 * dataIn[i2 + 0] + 8192 >> 14;
              p[0 * 8 + col] = t;
              p[1 * 8 + col] = t;
              p[2 * 8 + col] = t;
              p[3 * 8 + col] = t;
              p[4 * 8 + col] = t;
              p[5 * 8 + col] = t;
              p[6 * 8 + col] = t;
              p[7 * 8 + col] = t;
              continue;
            }
            v0 = dctSqrt2 * p[0 * 8 + col] + 2048 >> 12;
            v1 = dctSqrt2 * p[4 * 8 + col] + 2048 >> 12;
            v2 = p[2 * 8 + col];
            v3 = p[6 * 8 + col];
            v4 = dctSqrt1d2 * (p[1 * 8 + col] - p[7 * 8 + col]) + 2048 >> 12;
            v7 = dctSqrt1d2 * (p[1 * 8 + col] + p[7 * 8 + col]) + 2048 >> 12;
            v5 = p[3 * 8 + col];
            v6 = p[5 * 8 + col];
            t = v0 - v1 + 1 >> 1;
            v0 = v0 + v1 + 1 >> 1;
            v1 = t;
            t = v2 * dctSin6 + v3 * dctCos6 + 2048 >> 12;
            v2 = v2 * dctCos6 - v3 * dctSin6 + 2048 >> 12;
            v3 = t;
            t = v4 - v6 + 1 >> 1;
            v4 = v4 + v6 + 1 >> 1;
            v6 = t;
            t = v7 + v5 + 1 >> 1;
            v5 = v7 - v5 + 1 >> 1;
            v7 = t;
            t = v0 - v3 + 1 >> 1;
            v0 = v0 + v3 + 1 >> 1;
            v3 = t;
            t = v1 - v2 + 1 >> 1;
            v1 = v1 + v2 + 1 >> 1;
            v2 = t;
            t = v4 * dctSin3 + v7 * dctCos3 + 2048 >> 12;
            v4 = v4 * dctCos3 - v7 * dctSin3 + 2048 >> 12;
            v7 = t;
            t = v5 * dctSin1 + v6 * dctCos1 + 2048 >> 12;
            v5 = v5 * dctCos1 - v6 * dctSin1 + 2048 >> 12;
            v6 = t;
            p[0 * 8 + col] = v0 + v7;
            p[7 * 8 + col] = v0 - v7;
            p[1 * 8 + col] = v1 + v6;
            p[6 * 8 + col] = v1 - v6;
            p[2 * 8 + col] = v2 + v5;
            p[5 * 8 + col] = v2 - v5;
            p[3 * 8 + col] = v3 + v4;
            p[4 * 8 + col] = v3 - v4;
          }
          for (i2 = 0; i2 < 64; ++i2) {
            var sample2 = 128 + (p[i2] + 8 >> 4);
            dataOut[i2] = sample2 < 0 ? 0 : sample2 > 255 ? 255 : sample2;
          }
        }
        requestMemoryAllocation(samplesPerLine * blocksPerColumn * 8);
        var i, j;
        for (var blockRow = 0; blockRow < blocksPerColumn; blockRow++) {
          var scanLine = blockRow << 3;
          for (i = 0; i < 8; i++)
            lines.push(new Uint8Array(samplesPerLine));
          for (var blockCol = 0; blockCol < blocksPerLine; blockCol++) {
            quantizeAndInverse(component.blocks[blockRow][blockCol], r, R);
            var offset = 0, sample = blockCol << 3;
            for (j = 0; j < 8; j++) {
              var line = lines[scanLine + j];
              for (i = 0; i < 8; i++)
                line[sample + i] = r[offset++];
            }
          }
        }
        return lines;
      }
      function clampTo8bit(a) {
        return a < 0 ? 0 : a > 255 ? 255 : a;
      }
      constructor.prototype = {
        load: function load(path) {
          var xhr = new XMLHttpRequest();
          xhr.open("GET", path, true);
          xhr.responseType = "arraybuffer";
          xhr.onload = (function() {
            var data = new Uint8Array(xhr.response || xhr.mozResponseArrayBuffer);
            this.parse(data);
            if (this.onload)
              this.onload();
          }).bind(this);
          xhr.send(null);
        },
        parse: function parse3(data) {
          var maxResolutionInPixels = this.opts.maxResolutionInMP * 1e3 * 1e3;
          var offset = 0, length = data.length;
          function readUint16() {
            var value = data[offset] << 8 | data[offset + 1];
            offset += 2;
            return value;
          }
          function readDataBlock() {
            var length2 = readUint16();
            var array2 = data.subarray(offset, offset + length2 - 2);
            offset += array2.length;
            return array2;
          }
          function prepareComponents(frame2) {
            var maxH2 = 1, maxV2 = 1;
            var component2, componentId2;
            for (componentId2 in frame2.components) {
              if (frame2.components.hasOwnProperty(componentId2)) {
                component2 = frame2.components[componentId2];
                if (maxH2 < component2.h) maxH2 = component2.h;
                if (maxV2 < component2.v) maxV2 = component2.v;
              }
            }
            var mcusPerLine = Math.ceil(frame2.samplesPerLine / 8 / maxH2);
            var mcusPerColumn = Math.ceil(frame2.scanLines / 8 / maxV2);
            for (componentId2 in frame2.components) {
              if (frame2.components.hasOwnProperty(componentId2)) {
                component2 = frame2.components[componentId2];
                var blocksPerLine = Math.ceil(Math.ceil(frame2.samplesPerLine / 8) * component2.h / maxH2);
                var blocksPerColumn = Math.ceil(Math.ceil(frame2.scanLines / 8) * component2.v / maxV2);
                var blocksPerLineForMcu = mcusPerLine * component2.h;
                var blocksPerColumnForMcu = mcusPerColumn * component2.v;
                var blocksToAllocate = blocksPerColumnForMcu * blocksPerLineForMcu;
                var blocks = [];
                requestMemoryAllocation(blocksToAllocate * 256);
                for (var i2 = 0; i2 < blocksPerColumnForMcu; i2++) {
                  var row = [];
                  for (var j2 = 0; j2 < blocksPerLineForMcu; j2++)
                    row.push(new Int32Array(64));
                  blocks.push(row);
                }
                component2.blocksPerLine = blocksPerLine;
                component2.blocksPerColumn = blocksPerColumn;
                component2.blocks = blocks;
              }
            }
            frame2.maxH = maxH2;
            frame2.maxV = maxV2;
            frame2.mcusPerLine = mcusPerLine;
            frame2.mcusPerColumn = mcusPerColumn;
          }
          var jfif = null;
          var adobe = null;
          var pixels = null;
          var frame, resetInterval;
          var quantizationTables = [], frames = [];
          var huffmanTablesAC = [], huffmanTablesDC = [];
          var fileMarker = readUint16();
          var malformedDataOffset = -1;
          this.comments = [];
          if (fileMarker != 65496) {
            throw new Error("SOI not found");
          }
          fileMarker = readUint16();
          while (fileMarker != 65497) {
            var i, j, l;
            switch (fileMarker) {
              case 65280:
                break;
              case 65504:
              // APP0 (Application Specific)
              case 65505:
              // APP1
              case 65506:
              // APP2
              case 65507:
              // APP3
              case 65508:
              // APP4
              case 65509:
              // APP5
              case 65510:
              // APP6
              case 65511:
              // APP7
              case 65512:
              // APP8
              case 65513:
              // APP9
              case 65514:
              // APP10
              case 65515:
              // APP11
              case 65516:
              // APP12
              case 65517:
              // APP13
              case 65518:
              // APP14
              case 65519:
              // APP15
              case 65534:
                var appData = readDataBlock();
                if (fileMarker === 65534) {
                  var comment = String.fromCharCode.apply(null, appData);
                  this.comments.push(comment);
                }
                if (fileMarker === 65504) {
                  if (appData[0] === 74 && appData[1] === 70 && appData[2] === 73 && appData[3] === 70 && appData[4] === 0) {
                    jfif = {
                      version: { major: appData[5], minor: appData[6] },
                      densityUnits: appData[7],
                      xDensity: appData[8] << 8 | appData[9],
                      yDensity: appData[10] << 8 | appData[11],
                      thumbWidth: appData[12],
                      thumbHeight: appData[13],
                      thumbData: appData.subarray(14, 14 + 3 * appData[12] * appData[13])
                    };
                  }
                }
                if (fileMarker === 65505) {
                  if (appData[0] === 69 && appData[1] === 120 && appData[2] === 105 && appData[3] === 102 && appData[4] === 0) {
                    this.exifBuffer = appData.subarray(5, appData.length);
                  }
                }
                if (fileMarker === 65518) {
                  if (appData[0] === 65 && appData[1] === 100 && appData[2] === 111 && appData[3] === 98 && appData[4] === 101 && appData[5] === 0) {
                    adobe = {
                      version: appData[6],
                      flags0: appData[7] << 8 | appData[8],
                      flags1: appData[9] << 8 | appData[10],
                      transformCode: appData[11]
                    };
                  }
                }
                break;
              case 65499:
                var quantizationTablesLength = readUint16();
                var quantizationTablesEnd = quantizationTablesLength + offset - 2;
                while (offset < quantizationTablesEnd) {
                  var quantizationTableSpec = data[offset++];
                  requestMemoryAllocation(64 * 4);
                  var tableData = new Int32Array(64);
                  if (quantizationTableSpec >> 4 === 0) {
                    for (j = 0; j < 64; j++) {
                      var z2 = dctZigZag[j];
                      tableData[z2] = data[offset++];
                    }
                  } else if (quantizationTableSpec >> 4 === 1) {
                    for (j = 0; j < 64; j++) {
                      var z2 = dctZigZag[j];
                      tableData[z2] = readUint16();
                    }
                  } else
                    throw new Error("DQT: invalid table spec");
                  quantizationTables[quantizationTableSpec & 15] = tableData;
                }
                break;
              case 65472:
              // SOF0 (Start of Frame, Baseline DCT)
              case 65473:
              // SOF1 (Start of Frame, Extended DCT)
              case 65474:
                readUint16();
                frame = {};
                frame.extended = fileMarker === 65473;
                frame.progressive = fileMarker === 65474;
                frame.precision = data[offset++];
                frame.scanLines = readUint16();
                frame.samplesPerLine = readUint16();
                frame.components = {};
                frame.componentsOrder = [];
                var pixelsInFrame = frame.scanLines * frame.samplesPerLine;
                if (pixelsInFrame > maxResolutionInPixels) {
                  var exceededAmount = Math.ceil((pixelsInFrame - maxResolutionInPixels) / 1e6);
                  throw new Error(`maxResolutionInMP limit exceeded by ${exceededAmount}MP`);
                }
                var componentsCount = data[offset++], componentId;
                var maxH = 0, maxV = 0;
                for (i = 0; i < componentsCount; i++) {
                  componentId = data[offset];
                  var h = data[offset + 1] >> 4;
                  var v = data[offset + 1] & 15;
                  var qId = data[offset + 2];
                  if (h <= 0 || v <= 0) {
                    throw new Error("Invalid sampling factor, expected values above 0");
                  }
                  frame.componentsOrder.push(componentId);
                  frame.components[componentId] = {
                    h,
                    v,
                    quantizationIdx: qId
                  };
                  offset += 3;
                }
                prepareComponents(frame);
                frames.push(frame);
                break;
              case 65476:
                var huffmanLength = readUint16();
                for (i = 2; i < huffmanLength; ) {
                  var huffmanTableSpec = data[offset++];
                  var codeLengths = new Uint8Array(16);
                  var codeLengthSum = 0;
                  for (j = 0; j < 16; j++, offset++) {
                    codeLengthSum += codeLengths[j] = data[offset];
                  }
                  requestMemoryAllocation(16 + codeLengthSum);
                  var huffmanValues = new Uint8Array(codeLengthSum);
                  for (j = 0; j < codeLengthSum; j++, offset++)
                    huffmanValues[j] = data[offset];
                  i += 17 + codeLengthSum;
                  (huffmanTableSpec >> 4 === 0 ? huffmanTablesDC : huffmanTablesAC)[huffmanTableSpec & 15] = buildHuffmanTable(codeLengths, huffmanValues);
                }
                break;
              case 65501:
                readUint16();
                resetInterval = readUint16();
                break;
              case 65500:
                readUint16();
                readUint16();
                break;
              case 65498:
                var scanLength = readUint16();
                var selectorsCount = data[offset++];
                var components = [], component;
                for (i = 0; i < selectorsCount; i++) {
                  component = frame.components[data[offset++]];
                  var tableSpec = data[offset++];
                  component.huffmanTableDC = huffmanTablesDC[tableSpec >> 4];
                  component.huffmanTableAC = huffmanTablesAC[tableSpec & 15];
                  components.push(component);
                }
                var spectralStart = data[offset++];
                var spectralEnd = data[offset++];
                var successiveApproximation = data[offset++];
                var processed = decodeScan(
                  data,
                  offset,
                  frame,
                  components,
                  resetInterval,
                  spectralStart,
                  spectralEnd,
                  successiveApproximation >> 4,
                  successiveApproximation & 15,
                  this.opts
                );
                offset += processed;
                break;
              case 65535:
                if (data[offset] !== 255) {
                  offset--;
                }
                break;
              default:
                if (data[offset - 3] == 255 && data[offset - 2] >= 192 && data[offset - 2] <= 254) {
                  offset -= 3;
                  break;
                } else if (fileMarker === 224 || fileMarker == 225) {
                  if (malformedDataOffset !== -1) {
                    throw new Error(`first unknown JPEG marker at offset ${malformedDataOffset.toString(16)}, second unknown JPEG marker ${fileMarker.toString(16)} at offset ${(offset - 1).toString(16)}`);
                  }
                  malformedDataOffset = offset - 1;
                  const nextOffset = readUint16();
                  if (data[offset + nextOffset - 2] === 255) {
                    offset += nextOffset - 2;
                    break;
                  }
                }
                throw new Error("unknown JPEG marker " + fileMarker.toString(16));
            }
            fileMarker = readUint16();
          }
          if (frames.length != 1)
            throw new Error("only single frame JPEGs supported");
          for (var i = 0; i < frames.length; i++) {
            var cp = frames[i].components;
            for (var j in cp) {
              cp[j].quantizationTable = quantizationTables[cp[j].quantizationIdx];
              delete cp[j].quantizationIdx;
            }
          }
          this.width = frame.samplesPerLine;
          this.height = frame.scanLines;
          this.jfif = jfif;
          this.adobe = adobe;
          this.components = [];
          for (var i = 0; i < frame.componentsOrder.length; i++) {
            var component = frame.components[frame.componentsOrder[i]];
            this.components.push({
              lines: buildComponentData(frame, component),
              scaleX: component.h / frame.maxH,
              scaleY: component.v / frame.maxV
            });
          }
        },
        getData: function getData(width, height) {
          var scaleX = this.width / width, scaleY = this.height / height;
          var component1, component2, component3, component4;
          var component1Line, component2Line, component3Line, component4Line;
          var x, y;
          var offset = 0;
          var Y, Cb, Cr, K, C, M, Ye, R, G, B;
          var colorTransform;
          var dataLength = width * height * this.components.length;
          requestMemoryAllocation(dataLength);
          var data = new Uint8Array(dataLength);
          switch (this.components.length) {
            case 1:
              component1 = this.components[0];
              for (y = 0; y < height; y++) {
                component1Line = component1.lines[0 | y * component1.scaleY * scaleY];
                for (x = 0; x < width; x++) {
                  Y = component1Line[0 | x * component1.scaleX * scaleX];
                  data[offset++] = Y;
                }
              }
              break;
            case 2:
              component1 = this.components[0];
              component2 = this.components[1];
              for (y = 0; y < height; y++) {
                component1Line = component1.lines[0 | y * component1.scaleY * scaleY];
                component2Line = component2.lines[0 | y * component2.scaleY * scaleY];
                for (x = 0; x < width; x++) {
                  Y = component1Line[0 | x * component1.scaleX * scaleX];
                  data[offset++] = Y;
                  Y = component2Line[0 | x * component2.scaleX * scaleX];
                  data[offset++] = Y;
                }
              }
              break;
            case 3:
              colorTransform = true;
              if (this.adobe && this.adobe.transformCode)
                colorTransform = true;
              else if (typeof this.opts.colorTransform !== "undefined")
                colorTransform = !!this.opts.colorTransform;
              component1 = this.components[0];
              component2 = this.components[1];
              component3 = this.components[2];
              for (y = 0; y < height; y++) {
                component1Line = component1.lines[0 | y * component1.scaleY * scaleY];
                component2Line = component2.lines[0 | y * component2.scaleY * scaleY];
                component3Line = component3.lines[0 | y * component3.scaleY * scaleY];
                for (x = 0; x < width; x++) {
                  if (!colorTransform) {
                    R = component1Line[0 | x * component1.scaleX * scaleX];
                    G = component2Line[0 | x * component2.scaleX * scaleX];
                    B = component3Line[0 | x * component3.scaleX * scaleX];
                  } else {
                    Y = component1Line[0 | x * component1.scaleX * scaleX];
                    Cb = component2Line[0 | x * component2.scaleX * scaleX];
                    Cr = component3Line[0 | x * component3.scaleX * scaleX];
                    R = clampTo8bit(Y + 1.402 * (Cr - 128));
                    G = clampTo8bit(Y - 0.3441363 * (Cb - 128) - 0.71413636 * (Cr - 128));
                    B = clampTo8bit(Y + 1.772 * (Cb - 128));
                  }
                  data[offset++] = R;
                  data[offset++] = G;
                  data[offset++] = B;
                }
              }
              break;
            case 4:
              if (!this.adobe)
                throw new Error("Unsupported color mode (4 components)");
              colorTransform = false;
              if (this.adobe && this.adobe.transformCode)
                colorTransform = true;
              else if (typeof this.opts.colorTransform !== "undefined")
                colorTransform = !!this.opts.colorTransform;
              component1 = this.components[0];
              component2 = this.components[1];
              component3 = this.components[2];
              component4 = this.components[3];
              for (y = 0; y < height; y++) {
                component1Line = component1.lines[0 | y * component1.scaleY * scaleY];
                component2Line = component2.lines[0 | y * component2.scaleY * scaleY];
                component3Line = component3.lines[0 | y * component3.scaleY * scaleY];
                component4Line = component4.lines[0 | y * component4.scaleY * scaleY];
                for (x = 0; x < width; x++) {
                  if (!colorTransform) {
                    C = component1Line[0 | x * component1.scaleX * scaleX];
                    M = component2Line[0 | x * component2.scaleX * scaleX];
                    Ye = component3Line[0 | x * component3.scaleX * scaleX];
                    K = component4Line[0 | x * component4.scaleX * scaleX];
                  } else {
                    Y = component1Line[0 | x * component1.scaleX * scaleX];
                    Cb = component2Line[0 | x * component2.scaleX * scaleX];
                    Cr = component3Line[0 | x * component3.scaleX * scaleX];
                    K = component4Line[0 | x * component4.scaleX * scaleX];
                    C = 255 - clampTo8bit(Y + 1.402 * (Cr - 128));
                    M = 255 - clampTo8bit(Y - 0.3441363 * (Cb - 128) - 0.71413636 * (Cr - 128));
                    Ye = 255 - clampTo8bit(Y + 1.772 * (Cb - 128));
                  }
                  data[offset++] = 255 - C;
                  data[offset++] = 255 - M;
                  data[offset++] = 255 - Ye;
                  data[offset++] = 255 - K;
                }
              }
              break;
            default:
              throw new Error("Unsupported color mode");
          }
          return data;
        },
        copyToImageData: function copyToImageData(imageData, formatAsRGBA) {
          var width = imageData.width, height = imageData.height;
          var imageDataArray = imageData.data;
          var data = this.getData(width, height);
          var i = 0, j = 0, x, y;
          var Y, K, C, M, R, G, B;
          switch (this.components.length) {
            case 1:
              for (y = 0; y < height; y++) {
                for (x = 0; x < width; x++) {
                  Y = data[i++];
                  imageDataArray[j++] = Y;
                  imageDataArray[j++] = Y;
                  imageDataArray[j++] = Y;
                  if (formatAsRGBA) {
                    imageDataArray[j++] = 255;
                  }
                }
              }
              break;
            case 3:
              for (y = 0; y < height; y++) {
                for (x = 0; x < width; x++) {
                  R = data[i++];
                  G = data[i++];
                  B = data[i++];
                  imageDataArray[j++] = R;
                  imageDataArray[j++] = G;
                  imageDataArray[j++] = B;
                  if (formatAsRGBA) {
                    imageDataArray[j++] = 255;
                  }
                }
              }
              break;
            case 4:
              for (y = 0; y < height; y++) {
                for (x = 0; x < width; x++) {
                  C = data[i++];
                  M = data[i++];
                  Y = data[i++];
                  K = data[i++];
                  R = 255 - clampTo8bit(C * (1 - K / 255) + K);
                  G = 255 - clampTo8bit(M * (1 - K / 255) + K);
                  B = 255 - clampTo8bit(Y * (1 - K / 255) + K);
                  imageDataArray[j++] = R;
                  imageDataArray[j++] = G;
                  imageDataArray[j++] = B;
                  if (formatAsRGBA) {
                    imageDataArray[j++] = 255;
                  }
                }
              }
              break;
            default:
              throw new Error("Unsupported color mode");
          }
        }
      };
      var totalBytesAllocated = 0;
      var maxMemoryUsageBytes = 0;
      function requestMemoryAllocation(increaseAmount = 0) {
        var totalMemoryImpactBytes = totalBytesAllocated + increaseAmount;
        if (totalMemoryImpactBytes > maxMemoryUsageBytes) {
          var exceededAmount = Math.ceil((totalMemoryImpactBytes - maxMemoryUsageBytes) / 1024 / 1024);
          throw new Error(`maxMemoryUsageInMB limit exceeded by at least ${exceededAmount}MB`);
        }
        totalBytesAllocated = totalMemoryImpactBytes;
      }
      constructor.resetMaxMemoryUsage = function(maxMemoryUsageBytes_) {
        totalBytesAllocated = 0;
        maxMemoryUsageBytes = maxMemoryUsageBytes_;
      };
      constructor.getBytesAllocated = function() {
        return totalBytesAllocated;
      };
      constructor.requestMemoryAllocation = requestMemoryAllocation;
      return constructor;
    })();
    if (typeof module2 !== "undefined") {
      module2.exports = decode3;
    } else if (typeof window !== "undefined") {
      window["jpeg-js"] = window["jpeg-js"] || {};
      window["jpeg-js"].decode = decode3;
    }
    function decode3(jpegData, userOpts = {}) {
      var defaultOpts = {
        // "undefined" means "Choose whether to transform colors based on the imageâ€™s color model."
        colorTransform: void 0,
        useTArray: false,
        formatAsRGBA: true,
        tolerantDecoding: true,
        maxResolutionInMP: 100,
        // Don't decode more than 100 megapixels
        maxMemoryUsageInMB: 512
        // Don't decode if memory footprint is more than 512MB
      };
      var opts = { ...defaultOpts, ...userOpts };
      var arr = new Uint8Array(jpegData);
      var decoder = new JpegImage();
      decoder.opts = opts;
      JpegImage.resetMaxMemoryUsage(opts.maxMemoryUsageInMB * 1024 * 1024);
      decoder.parse(arr);
      var channels = opts.formatAsRGBA ? 4 : 3;
      var bytesNeeded = decoder.width * decoder.height * channels;
      try {
        JpegImage.requestMemoryAllocation(bytesNeeded);
        var image = {
          width: decoder.width,
          height: decoder.height,
          exifBuffer: decoder.exifBuffer,
          data: opts.useTArray ? new Uint8Array(bytesNeeded) : Buffer.alloc(bytesNeeded)
        };
        if (decoder.comments.length > 0) {
          image["comments"] = decoder.comments;
        }
      } catch (err) {
        if (err instanceof RangeError) {
          throw new Error("Could not allocate enough memory for the image. Required: " + bytesNeeded);
        }
        if (err instanceof ReferenceError) {
          if (err.message === "Buffer is not defined") {
            throw new Error("Buffer is not globally defined in this environment. Consider setting useTArray to true");
          }
        }
        throw err;
      }
      decoder.copyToImageData(image, opts.formatAsRGBA);
      return image;
    }
  }
});

// node_modules/jpeg-js/index.js
var require_jpeg_js = __commonJS({
  "node_modules/jpeg-js/index.js"(exports2, module2) {
    var encode3 = require_encoder();
    var decode3 = require_decoder();
    module2.exports = {
      encode: encode3,
      decode: decode3
    };
  }
});

// node_modules/mime/Mime.js
var require_Mime = __commonJS({
  "node_modules/mime/Mime.js"(exports2, module2) {
    "use strict";
    function Mime() {
      this._types = /* @__PURE__ */ Object.create(null);
      this._extensions = /* @__PURE__ */ Object.create(null);
      for (let i = 0; i < arguments.length; i++) {
        this.define(arguments[i]);
      }
      this.define = this.define.bind(this);
      this.getType = this.getType.bind(this);
      this.getExtension = this.getExtension.bind(this);
    }
    Mime.prototype.define = function(typeMap, force) {
      for (let type in typeMap) {
        let extensions = typeMap[type].map(function(t) {
          return t.toLowerCase();
        });
        type = type.toLowerCase();
        for (let i = 0; i < extensions.length; i++) {
          const ext = extensions[i];
          if (ext[0] === "*") {
            continue;
          }
          if (!force && ext in this._types) {
            throw new Error(
              'Attempt to change mapping for "' + ext + '" extension from "' + this._types[ext] + '" to "' + type + '". Pass `force=true` to allow this, otherwise remove "' + ext + '" from the list of extensions for "' + type + '".'
            );
          }
          this._types[ext] = type;
        }
        if (force || !this._extensions[type]) {
          const ext = extensions[0];
          this._extensions[type] = ext[0] !== "*" ? ext : ext.substr(1);
        }
      }
    };
    Mime.prototype.getType = function(path) {
      path = String(path);
      let last = path.replace(/^.*[/\\]/, "").toLowerCase();
      let ext = last.replace(/^.*\./, "").toLowerCase();
      let hasPath = last.length < path.length;
      let hasDot = ext.length < last.length - 1;
      return (hasDot || !hasPath) && this._types[ext] || null;
    };
    Mime.prototype.getExtension = function(type) {
      type = /^\s*([^;\s]*)/.test(type) && RegExp.$1;
      return type && this._extensions[type.toLowerCase()] || null;
    };
    module2.exports = Mime;
  }
});

// node_modules/mime/types/standard.js
var require_standard = __commonJS({
  "node_modules/mime/types/standard.js"(exports2, module2) {
    module2.exports = { "application/andrew-inset": ["ez"], "application/applixware": ["aw"], "application/atom+xml": ["atom"], "application/atomcat+xml": ["atomcat"], "application/atomdeleted+xml": ["atomdeleted"], "application/atomsvc+xml": ["atomsvc"], "application/atsc-dwd+xml": ["dwd"], "application/atsc-held+xml": ["held"], "application/atsc-rsat+xml": ["rsat"], "application/bdoc": ["bdoc"], "application/calendar+xml": ["xcs"], "application/ccxml+xml": ["ccxml"], "application/cdfx+xml": ["cdfx"], "application/cdmi-capability": ["cdmia"], "application/cdmi-container": ["cdmic"], "application/cdmi-domain": ["cdmid"], "application/cdmi-object": ["cdmio"], "application/cdmi-queue": ["cdmiq"], "application/cu-seeme": ["cu"], "application/dash+xml": ["mpd"], "application/davmount+xml": ["davmount"], "application/docbook+xml": ["dbk"], "application/dssc+der": ["dssc"], "application/dssc+xml": ["xdssc"], "application/ecmascript": ["es", "ecma"], "application/emma+xml": ["emma"], "application/emotionml+xml": ["emotionml"], "application/epub+zip": ["epub"], "application/exi": ["exi"], "application/express": ["exp"], "application/fdt+xml": ["fdt"], "application/font-tdpfr": ["pfr"], "application/geo+json": ["geojson"], "application/gml+xml": ["gml"], "application/gpx+xml": ["gpx"], "application/gxf": ["gxf"], "application/gzip": ["gz"], "application/hjson": ["hjson"], "application/hyperstudio": ["stk"], "application/inkml+xml": ["ink", "inkml"], "application/ipfix": ["ipfix"], "application/its+xml": ["its"], "application/java-archive": ["jar", "war", "ear"], "application/java-serialized-object": ["ser"], "application/java-vm": ["class"], "application/javascript": ["js", "mjs"], "application/json": ["json", "map"], "application/json5": ["json5"], "application/jsonml+json": ["jsonml"], "application/ld+json": ["jsonld"], "application/lgr+xml": ["lgr"], "application/lost+xml": ["lostxml"], "application/mac-binhex40": ["hqx"], "application/mac-compactpro": ["cpt"], "application/mads+xml": ["mads"], "application/manifest+json": ["webmanifest"], "application/marc": ["mrc"], "application/marcxml+xml": ["mrcx"], "application/mathematica": ["ma", "nb", "mb"], "application/mathml+xml": ["mathml"], "application/mbox": ["mbox"], "application/mediaservercontrol+xml": ["mscml"], "application/metalink+xml": ["metalink"], "application/metalink4+xml": ["meta4"], "application/mets+xml": ["mets"], "application/mmt-aei+xml": ["maei"], "application/mmt-usd+xml": ["musd"], "application/mods+xml": ["mods"], "application/mp21": ["m21", "mp21"], "application/mp4": ["mp4s", "m4p"], "application/msword": ["doc", "dot"], "application/mxf": ["mxf"], "application/n-quads": ["nq"], "application/n-triples": ["nt"], "application/node": ["cjs"], "application/octet-stream": ["bin", "dms", "lrf", "mar", "so", "dist", "distz", "pkg", "bpk", "dump", "elc", "deploy", "exe", "dll", "deb", "dmg", "iso", "img", "msi", "msp", "msm", "buffer"], "application/oda": ["oda"], "application/oebps-package+xml": ["opf"], "application/ogg": ["ogx"], "application/omdoc+xml": ["omdoc"], "application/onenote": ["onetoc", "onetoc2", "onetmp", "onepkg"], "application/oxps": ["oxps"], "application/p2p-overlay+xml": ["relo"], "application/patch-ops-error+xml": ["xer"], "application/pdf": ["pdf"], "application/pgp-encrypted": ["pgp"], "application/pgp-signature": ["asc", "sig"], "application/pics-rules": ["prf"], "application/pkcs10": ["p10"], "application/pkcs7-mime": ["p7m", "p7c"], "application/pkcs7-signature": ["p7s"], "application/pkcs8": ["p8"], "application/pkix-attr-cert": ["ac"], "application/pkix-cert": ["cer"], "application/pkix-crl": ["crl"], "application/pkix-pkipath": ["pkipath"], "application/pkixcmp": ["pki"], "application/pls+xml": ["pls"], "application/postscript": ["ai", "eps", "ps"], "application/provenance+xml": ["provx"], "application/pskc+xml": ["pskcxml"], "application/raml+yaml": ["raml"], "application/rdf+xml": ["rdf", "owl"], "application/reginfo+xml": ["rif"], "application/relax-ng-compact-syntax": ["rnc"], "application/resource-lists+xml": ["rl"], "application/resource-lists-diff+xml": ["rld"], "application/rls-services+xml": ["rs"], "application/route-apd+xml": ["rapd"], "application/route-s-tsid+xml": ["sls"], "application/route-usd+xml": ["rusd"], "application/rpki-ghostbusters": ["gbr"], "application/rpki-manifest": ["mft"], "application/rpki-roa": ["roa"], "application/rsd+xml": ["rsd"], "application/rss+xml": ["rss"], "application/rtf": ["rtf"], "application/sbml+xml": ["sbml"], "application/scvp-cv-request": ["scq"], "application/scvp-cv-response": ["scs"], "application/scvp-vp-request": ["spq"], "application/scvp-vp-response": ["spp"], "application/sdp": ["sdp"], "application/senml+xml": ["senmlx"], "application/sensml+xml": ["sensmlx"], "application/set-payment-initiation": ["setpay"], "application/set-registration-initiation": ["setreg"], "application/shf+xml": ["shf"], "application/sieve": ["siv", "sieve"], "application/smil+xml": ["smi", "smil"], "application/sparql-query": ["rq"], "application/sparql-results+xml": ["srx"], "application/srgs": ["gram"], "application/srgs+xml": ["grxml"], "application/sru+xml": ["sru"], "application/ssdl+xml": ["ssdl"], "application/ssml+xml": ["ssml"], "application/swid+xml": ["swidtag"], "application/tei+xml": ["tei", "teicorpus"], "application/thraud+xml": ["tfi"], "application/timestamped-data": ["tsd"], "application/toml": ["toml"], "application/trig": ["trig"], "application/ttml+xml": ["ttml"], "application/ubjson": ["ubj"], "application/urc-ressheet+xml": ["rsheet"], "application/urc-targetdesc+xml": ["td"], "application/voicexml+xml": ["vxml"], "application/wasm": ["wasm"], "application/widget": ["wgt"], "application/winhlp": ["hlp"], "application/wsdl+xml": ["wsdl"], "application/wspolicy+xml": ["wspolicy"], "application/xaml+xml": ["xaml"], "application/xcap-att+xml": ["xav"], "application/xcap-caps+xml": ["xca"], "application/xcap-diff+xml": ["xdf"], "application/xcap-el+xml": ["xel"], "application/xcap-ns+xml": ["xns"], "application/xenc+xml": ["xenc"], "application/xhtml+xml": ["xhtml", "xht"], "application/xliff+xml": ["xlf"], "application/xml": ["xml", "xsl", "xsd", "rng"], "application/xml-dtd": ["dtd"], "application/xop+xml": ["xop"], "application/xproc+xml": ["xpl"], "application/xslt+xml": ["*xsl", "xslt"], "application/xspf+xml": ["xspf"], "application/xv+xml": ["mxml", "xhvml", "xvml", "xvm"], "application/yang": ["yang"], "application/yin+xml": ["yin"], "application/zip": ["zip"], "audio/3gpp": ["*3gpp"], "audio/adpcm": ["adp"], "audio/amr": ["amr"], "audio/basic": ["au", "snd"], "audio/midi": ["mid", "midi", "kar", "rmi"], "audio/mobile-xmf": ["mxmf"], "audio/mp3": ["*mp3"], "audio/mp4": ["m4a", "mp4a"], "audio/mpeg": ["mpga", "mp2", "mp2a", "mp3", "m2a", "m3a"], "audio/ogg": ["oga", "ogg", "spx", "opus"], "audio/s3m": ["s3m"], "audio/silk": ["sil"], "audio/wav": ["wav"], "audio/wave": ["*wav"], "audio/webm": ["weba"], "audio/xm": ["xm"], "font/collection": ["ttc"], "font/otf": ["otf"], "font/ttf": ["ttf"], "font/woff": ["woff"], "font/woff2": ["woff2"], "image/aces": ["exr"], "image/apng": ["apng"], "image/avif": ["avif"], "image/bmp": ["bmp"], "image/cgm": ["cgm"], "image/dicom-rle": ["drle"], "image/emf": ["emf"], "image/fits": ["fits"], "image/g3fax": ["g3"], "image/gif": ["gif"], "image/heic": ["heic"], "image/heic-sequence": ["heics"], "image/heif": ["heif"], "image/heif-sequence": ["heifs"], "image/hej2k": ["hej2"], "image/hsj2": ["hsj2"], "image/ief": ["ief"], "image/jls": ["jls"], "image/jp2": ["jp2", "jpg2"], "image/jpeg": ["jpeg", "jpg", "jpe"], "image/jph": ["jph"], "image/jphc": ["jhc"], "image/jpm": ["jpm"], "image/jpx": ["jpx", "jpf"], "image/jxr": ["jxr"], "image/jxra": ["jxra"], "image/jxrs": ["jxrs"], "image/jxs": ["jxs"], "image/jxsc": ["jxsc"], "image/jxsi": ["jxsi"], "image/jxss": ["jxss"], "image/ktx": ["ktx"], "image/ktx2": ["ktx2"], "image/png": ["png"], "image/sgi": ["sgi"], "image/svg+xml": ["svg", "svgz"], "image/t38": ["t38"], "image/tiff": ["tif", "tiff"], "image/tiff-fx": ["tfx"], "image/webp": ["webp"], "image/wmf": ["wmf"], "message/disposition-notification": ["disposition-notification"], "message/global": ["u8msg"], "message/global-delivery-status": ["u8dsn"], "message/global-disposition-notification": ["u8mdn"], "message/global-headers": ["u8hdr"], "message/rfc822": ["eml", "mime"], "model/3mf": ["3mf"], "model/gltf+json": ["gltf"], "model/gltf-binary": ["glb"], "model/iges": ["igs", "iges"], "model/mesh": ["msh", "mesh", "silo"], "model/mtl": ["mtl"], "model/obj": ["obj"], "model/step+xml": ["stpx"], "model/step+zip": ["stpz"], "model/step-xml+zip": ["stpxz"], "model/stl": ["stl"], "model/vrml": ["wrl", "vrml"], "model/x3d+binary": ["*x3db", "x3dbz"], "model/x3d+fastinfoset": ["x3db"], "model/x3d+vrml": ["*x3dv", "x3dvz"], "model/x3d+xml": ["x3d", "x3dz"], "model/x3d-vrml": ["x3dv"], "text/cache-manifest": ["appcache", "manifest"], "text/calendar": ["ics", "ifb"], "text/coffeescript": ["coffee", "litcoffee"], "text/css": ["css"], "text/csv": ["csv"], "text/html": ["html", "htm", "shtml"], "text/jade": ["jade"], "text/jsx": ["jsx"], "text/less": ["less"], "text/markdown": ["markdown", "md"], "text/mathml": ["mml"], "text/mdx": ["mdx"], "text/n3": ["n3"], "text/plain": ["txt", "text", "conf", "def", "list", "log", "in", "ini"], "text/richtext": ["rtx"], "text/rtf": ["*rtf"], "text/sgml": ["sgml", "sgm"], "text/shex": ["shex"], "text/slim": ["slim", "slm"], "text/spdx": ["spdx"], "text/stylus": ["stylus", "styl"], "text/tab-separated-values": ["tsv"], "text/troff": ["t", "tr", "roff", "man", "me", "ms"], "text/turtle": ["ttl"], "text/uri-list": ["uri", "uris", "urls"], "text/vcard": ["vcard"], "text/vtt": ["vtt"], "text/xml": ["*xml"], "text/yaml": ["yaml", "yml"], "video/3gpp": ["3gp", "3gpp"], "video/3gpp2": ["3g2"], "video/h261": ["h261"], "video/h263": ["h263"], "video/h264": ["h264"], "video/iso.segment": ["m4s"], "video/jpeg": ["jpgv"], "video/jpm": ["*jpm", "jpgm"], "video/mj2": ["mj2", "mjp2"], "video/mp2t": ["ts"], "video/mp4": ["mp4", "mp4v", "mpg4"], "video/mpeg": ["mpeg", "mpg", "mpe", "m1v", "m2v"], "video/ogg": ["ogv"], "video/quicktime": ["qt", "mov"], "video/webm": ["webm"] };
  }
});

// node_modules/mime/types/other.js
var require_other = __commonJS({
  "node_modules/mime/types/other.js"(exports2, module2) {
    module2.exports = { "application/prs.cww": ["cww"], "application/vnd.1000minds.decision-model+xml": ["1km"], "application/vnd.3gpp.pic-bw-large": ["plb"], "application/vnd.3gpp.pic-bw-small": ["psb"], "application/vnd.3gpp.pic-bw-var": ["pvb"], "application/vnd.3gpp2.tcap": ["tcap"], "application/vnd.3m.post-it-notes": ["pwn"], "application/vnd.accpac.simply.aso": ["aso"], "application/vnd.accpac.simply.imp": ["imp"], "application/vnd.acucobol": ["acu"], "application/vnd.acucorp": ["atc", "acutc"], "application/vnd.adobe.air-application-installer-package+zip": ["air"], "application/vnd.adobe.formscentral.fcdt": ["fcdt"], "application/vnd.adobe.fxp": ["fxp", "fxpl"], "application/vnd.adobe.xdp+xml": ["xdp"], "application/vnd.adobe.xfdf": ["xfdf"], "application/vnd.ahead.space": ["ahead"], "application/vnd.airzip.filesecure.azf": ["azf"], "application/vnd.airzip.filesecure.azs": ["azs"], "application/vnd.amazon.ebook": ["azw"], "application/vnd.americandynamics.acc": ["acc"], "application/vnd.amiga.ami": ["ami"], "application/vnd.android.package-archive": ["apk"], "application/vnd.anser-web-certificate-issue-initiation": ["cii"], "application/vnd.anser-web-funds-transfer-initiation": ["fti"], "application/vnd.antix.game-component": ["atx"], "application/vnd.apple.installer+xml": ["mpkg"], "application/vnd.apple.keynote": ["key"], "application/vnd.apple.mpegurl": ["m3u8"], "application/vnd.apple.numbers": ["numbers"], "application/vnd.apple.pages": ["pages"], "application/vnd.apple.pkpass": ["pkpass"], "application/vnd.aristanetworks.swi": ["swi"], "application/vnd.astraea-software.iota": ["iota"], "application/vnd.audiograph": ["aep"], "application/vnd.balsamiq.bmml+xml": ["bmml"], "application/vnd.blueice.multipass": ["mpm"], "application/vnd.bmi": ["bmi"], "application/vnd.businessobjects": ["rep"], "application/vnd.chemdraw+xml": ["cdxml"], "application/vnd.chipnuts.karaoke-mmd": ["mmd"], "application/vnd.cinderella": ["cdy"], "application/vnd.citationstyles.style+xml": ["csl"], "application/vnd.claymore": ["cla"], "application/vnd.cloanto.rp9": ["rp9"], "application/vnd.clonk.c4group": ["c4g", "c4d", "c4f", "c4p", "c4u"], "application/vnd.cluetrust.cartomobile-config": ["c11amc"], "application/vnd.cluetrust.cartomobile-config-pkg": ["c11amz"], "application/vnd.commonspace": ["csp"], "application/vnd.contact.cmsg": ["cdbcmsg"], "application/vnd.cosmocaller": ["cmc"], "application/vnd.crick.clicker": ["clkx"], "application/vnd.crick.clicker.keyboard": ["clkk"], "application/vnd.crick.clicker.palette": ["clkp"], "application/vnd.crick.clicker.template": ["clkt"], "application/vnd.crick.clicker.wordbank": ["clkw"], "application/vnd.criticaltools.wbs+xml": ["wbs"], "application/vnd.ctc-posml": ["pml"], "application/vnd.cups-ppd": ["ppd"], "application/vnd.curl.car": ["car"], "application/vnd.curl.pcurl": ["pcurl"], "application/vnd.dart": ["dart"], "application/vnd.data-vision.rdz": ["rdz"], "application/vnd.dbf": ["dbf"], "application/vnd.dece.data": ["uvf", "uvvf", "uvd", "uvvd"], "application/vnd.dece.ttml+xml": ["uvt", "uvvt"], "application/vnd.dece.unspecified": ["uvx", "uvvx"], "application/vnd.dece.zip": ["uvz", "uvvz"], "application/vnd.denovo.fcselayout-link": ["fe_launch"], "application/vnd.dna": ["dna"], "application/vnd.dolby.mlp": ["mlp"], "application/vnd.dpgraph": ["dpg"], "application/vnd.dreamfactory": ["dfac"], "application/vnd.ds-keypoint": ["kpxx"], "application/vnd.dvb.ait": ["ait"], "application/vnd.dvb.service": ["svc"], "application/vnd.dynageo": ["geo"], "application/vnd.ecowin.chart": ["mag"], "application/vnd.enliven": ["nml"], "application/vnd.epson.esf": ["esf"], "application/vnd.epson.msf": ["msf"], "application/vnd.epson.quickanime": ["qam"], "application/vnd.epson.salt": ["slt"], "application/vnd.epson.ssf": ["ssf"], "application/vnd.eszigno3+xml": ["es3", "et3"], "application/vnd.ezpix-album": ["ez2"], "application/vnd.ezpix-package": ["ez3"], "application/vnd.fdf": ["fdf"], "application/vnd.fdsn.mseed": ["mseed"], "application/vnd.fdsn.seed": ["seed", "dataless"], "application/vnd.flographit": ["gph"], "application/vnd.fluxtime.clip": ["ftc"], "application/vnd.framemaker": ["fm", "frame", "maker", "book"], "application/vnd.frogans.fnc": ["fnc"], "application/vnd.frogans.ltf": ["ltf"], "application/vnd.fsc.weblaunch": ["fsc"], "application/vnd.fujitsu.oasys": ["oas"], "application/vnd.fujitsu.oasys2": ["oa2"], "application/vnd.fujitsu.oasys3": ["oa3"], "application/vnd.fujitsu.oasysgp": ["fg5"], "application/vnd.fujitsu.oasysprs": ["bh2"], "application/vnd.fujixerox.ddd": ["ddd"], "application/vnd.fujixerox.docuworks": ["xdw"], "application/vnd.fujixerox.docuworks.binder": ["xbd"], "application/vnd.fuzzysheet": ["fzs"], "application/vnd.genomatix.tuxedo": ["txd"], "application/vnd.geogebra.file": ["ggb"], "application/vnd.geogebra.tool": ["ggt"], "application/vnd.geometry-explorer": ["gex", "gre"], "application/vnd.geonext": ["gxt"], "application/vnd.geoplan": ["g2w"], "application/vnd.geospace": ["g3w"], "application/vnd.gmx": ["gmx"], "application/vnd.google-apps.document": ["gdoc"], "application/vnd.google-apps.presentation": ["gslides"], "application/vnd.google-apps.spreadsheet": ["gsheet"], "application/vnd.google-earth.kml+xml": ["kml"], "application/vnd.google-earth.kmz": ["kmz"], "application/vnd.grafeq": ["gqf", "gqs"], "application/vnd.groove-account": ["gac"], "application/vnd.groove-help": ["ghf"], "application/vnd.groove-identity-message": ["gim"], "application/vnd.groove-injector": ["grv"], "application/vnd.groove-tool-message": ["gtm"], "application/vnd.groove-tool-template": ["tpl"], "application/vnd.groove-vcard": ["vcg"], "application/vnd.hal+xml": ["hal"], "application/vnd.handheld-entertainment+xml": ["zmm"], "application/vnd.hbci": ["hbci"], "application/vnd.hhe.lesson-player": ["les"], "application/vnd.hp-hpgl": ["hpgl"], "application/vnd.hp-hpid": ["hpid"], "application/vnd.hp-hps": ["hps"], "application/vnd.hp-jlyt": ["jlt"], "application/vnd.hp-pcl": ["pcl"], "application/vnd.hp-pclxl": ["pclxl"], "application/vnd.hydrostatix.sof-data": ["sfd-hdstx"], "application/vnd.ibm.minipay": ["mpy"], "application/vnd.ibm.modcap": ["afp", "listafp", "list3820"], "application/vnd.ibm.rights-management": ["irm"], "application/vnd.ibm.secure-container": ["sc"], "application/vnd.iccprofile": ["icc", "icm"], "application/vnd.igloader": ["igl"], "application/vnd.immervision-ivp": ["ivp"], "application/vnd.immervision-ivu": ["ivu"], "application/vnd.insors.igm": ["igm"], "application/vnd.intercon.formnet": ["xpw", "xpx"], "application/vnd.intergeo": ["i2g"], "application/vnd.intu.qbo": ["qbo"], "application/vnd.intu.qfx": ["qfx"], "application/vnd.ipunplugged.rcprofile": ["rcprofile"], "application/vnd.irepository.package+xml": ["irp"], "application/vnd.is-xpr": ["xpr"], "application/vnd.isac.fcs": ["fcs"], "application/vnd.jam": ["jam"], "application/vnd.jcp.javame.midlet-rms": ["rms"], "application/vnd.jisp": ["jisp"], "application/vnd.joost.joda-archive": ["joda"], "application/vnd.kahootz": ["ktz", "ktr"], "application/vnd.kde.karbon": ["karbon"], "application/vnd.kde.kchart": ["chrt"], "application/vnd.kde.kformula": ["kfo"], "application/vnd.kde.kivio": ["flw"], "application/vnd.kde.kontour": ["kon"], "application/vnd.kde.kpresenter": ["kpr", "kpt"], "application/vnd.kde.kspread": ["ksp"], "application/vnd.kde.kword": ["kwd", "kwt"], "application/vnd.kenameaapp": ["htke"], "application/vnd.kidspiration": ["kia"], "application/vnd.kinar": ["kne", "knp"], "application/vnd.koan": ["skp", "skd", "skt", "skm"], "application/vnd.kodak-descriptor": ["sse"], "application/vnd.las.las+xml": ["lasxml"], "application/vnd.llamagraphics.life-balance.desktop": ["lbd"], "application/vnd.llamagraphics.life-balance.exchange+xml": ["lbe"], "application/vnd.lotus-1-2-3": ["123"], "application/vnd.lotus-approach": ["apr"], "application/vnd.lotus-freelance": ["pre"], "application/vnd.lotus-notes": ["nsf"], "application/vnd.lotus-organizer": ["org"], "application/vnd.lotus-screencam": ["scm"], "application/vnd.lotus-wordpro": ["lwp"], "application/vnd.macports.portpkg": ["portpkg"], "application/vnd.mapbox-vector-tile": ["mvt"], "application/vnd.mcd": ["mcd"], "application/vnd.medcalcdata": ["mc1"], "application/vnd.mediastation.cdkey": ["cdkey"], "application/vnd.mfer": ["mwf"], "application/vnd.mfmp": ["mfm"], "application/vnd.micrografx.flo": ["flo"], "application/vnd.micrografx.igx": ["igx"], "application/vnd.mif": ["mif"], "application/vnd.mobius.daf": ["daf"], "application/vnd.mobius.dis": ["dis"], "application/vnd.mobius.mbk": ["mbk"], "application/vnd.mobius.mqy": ["mqy"], "application/vnd.mobius.msl": ["msl"], "application/vnd.mobius.plc": ["plc"], "application/vnd.mobius.txf": ["txf"], "application/vnd.mophun.application": ["mpn"], "application/vnd.mophun.certificate": ["mpc"], "application/vnd.mozilla.xul+xml": ["xul"], "application/vnd.ms-artgalry": ["cil"], "application/vnd.ms-cab-compressed": ["cab"], "application/vnd.ms-excel": ["xls", "xlm", "xla", "xlc", "xlt", "xlw"], "application/vnd.ms-excel.addin.macroenabled.12": ["xlam"], "application/vnd.ms-excel.sheet.binary.macroenabled.12": ["xlsb"], "application/vnd.ms-excel.sheet.macroenabled.12": ["xlsm"], "application/vnd.ms-excel.template.macroenabled.12": ["xltm"], "application/vnd.ms-fontobject": ["eot"], "application/vnd.ms-htmlhelp": ["chm"], "application/vnd.ms-ims": ["ims"], "application/vnd.ms-lrm": ["lrm"], "application/vnd.ms-officetheme": ["thmx"], "application/vnd.ms-outlook": ["msg"], "application/vnd.ms-pki.seccat": ["cat"], "application/vnd.ms-pki.stl": ["*stl"], "application/vnd.ms-powerpoint": ["ppt", "pps", "pot"], "application/vnd.ms-powerpoint.addin.macroenabled.12": ["ppam"], "application/vnd.ms-powerpoint.presentation.macroenabled.12": ["pptm"], "application/vnd.ms-powerpoint.slide.macroenabled.12": ["sldm"], "application/vnd.ms-powerpoint.slideshow.macroenabled.12": ["ppsm"], "application/vnd.ms-powerpoint.template.macroenabled.12": ["potm"], "application/vnd.ms-project": ["mpp", "mpt"], "application/vnd.ms-word.document.macroenabled.12": ["docm"], "application/vnd.ms-word.template.macroenabled.12": ["dotm"], "application/vnd.ms-works": ["wps", "wks", "wcm", "wdb"], "application/vnd.ms-wpl": ["wpl"], "application/vnd.ms-xpsdocument": ["xps"], "application/vnd.mseq": ["mseq"], "application/vnd.musician": ["mus"], "application/vnd.muvee.style": ["msty"], "application/vnd.mynfc": ["taglet"], "application/vnd.neurolanguage.nlu": ["nlu"], "application/vnd.nitf": ["ntf", "nitf"], "application/vnd.noblenet-directory": ["nnd"], "application/vnd.noblenet-sealer": ["nns"], "application/vnd.noblenet-web": ["nnw"], "application/vnd.nokia.n-gage.ac+xml": ["*ac"], "application/vnd.nokia.n-gage.data": ["ngdat"], "application/vnd.nokia.n-gage.symbian.install": ["n-gage"], "application/vnd.nokia.radio-preset": ["rpst"], "application/vnd.nokia.radio-presets": ["rpss"], "application/vnd.novadigm.edm": ["edm"], "application/vnd.novadigm.edx": ["edx"], "application/vnd.novadigm.ext": ["ext"], "application/vnd.oasis.opendocument.chart": ["odc"], "application/vnd.oasis.opendocument.chart-template": ["otc"], "application/vnd.oasis.opendocument.database": ["odb"], "application/vnd.oasis.opendocument.formula": ["odf"], "application/vnd.oasis.opendocument.formula-template": ["odft"], "application/vnd.oasis.opendocument.graphics": ["odg"], "application/vnd.oasis.opendocument.graphics-template": ["otg"], "application/vnd.oasis.opendocument.image": ["odi"], "application/vnd.oasis.opendocument.image-template": ["oti"], "application/vnd.oasis.opendocument.presentation": ["odp"], "application/vnd.oasis.opendocument.presentation-template": ["otp"], "application/vnd.oasis.opendocument.spreadsheet": ["ods"], "application/vnd.oasis.opendocument.spreadsheet-template": ["ots"], "application/vnd.oasis.opendocument.text": ["odt"], "application/vnd.oasis.opendocument.text-master": ["odm"], "application/vnd.oasis.opendocument.text-template": ["ott"], "application/vnd.oasis.opendocument.text-web": ["oth"], "application/vnd.olpc-sugar": ["xo"], "application/vnd.oma.dd2+xml": ["dd2"], "application/vnd.openblox.game+xml": ["obgx"], "application/vnd.openofficeorg.extension": ["oxt"], "application/vnd.openstreetmap.data+xml": ["osm"], "application/vnd.openxmlformats-officedocument.presentationml.presentation": ["pptx"], "application/vnd.openxmlformats-officedocument.presentationml.slide": ["sldx"], "application/vnd.openxmlformats-officedocument.presentationml.slideshow": ["ppsx"], "application/vnd.openxmlformats-officedocument.presentationml.template": ["potx"], "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": ["xlsx"], "application/vnd.openxmlformats-officedocument.spreadsheetml.template": ["xltx"], "application/vnd.openxmlformats-officedocument.wordprocessingml.document": ["docx"], "application/vnd.openxmlformats-officedocument.wordprocessingml.template": ["dotx"], "application/vnd.osgeo.mapguide.package": ["mgp"], "application/vnd.osgi.dp": ["dp"], "application/vnd.osgi.subsystem": ["esa"], "application/vnd.palm": ["pdb", "pqa", "oprc"], "application/vnd.pawaafile": ["paw"], "application/vnd.pg.format": ["str"], "application/vnd.pg.osasli": ["ei6"], "application/vnd.picsel": ["efif"], "application/vnd.pmi.widget": ["wg"], "application/vnd.pocketlearn": ["plf"], "application/vnd.powerbuilder6": ["pbd"], "application/vnd.previewsystems.box": ["box"], "application/vnd.proteus.magazine": ["mgz"], "application/vnd.publishare-delta-tree": ["qps"], "application/vnd.pvi.ptid1": ["ptid"], "application/vnd.quark.quarkxpress": ["qxd", "qxt", "qwd", "qwt", "qxl", "qxb"], "application/vnd.rar": ["rar"], "application/vnd.realvnc.bed": ["bed"], "application/vnd.recordare.musicxml": ["mxl"], "application/vnd.recordare.musicxml+xml": ["musicxml"], "application/vnd.rig.cryptonote": ["cryptonote"], "application/vnd.rim.cod": ["cod"], "application/vnd.rn-realmedia": ["rm"], "application/vnd.rn-realmedia-vbr": ["rmvb"], "application/vnd.route66.link66+xml": ["link66"], "application/vnd.sailingtracker.track": ["st"], "application/vnd.seemail": ["see"], "application/vnd.sema": ["sema"], "application/vnd.semd": ["semd"], "application/vnd.semf": ["semf"], "application/vnd.shana.informed.formdata": ["ifm"], "application/vnd.shana.informed.formtemplate": ["itp"], "application/vnd.shana.informed.interchange": ["iif"], "application/vnd.shana.informed.package": ["ipk"], "application/vnd.simtech-mindmapper": ["twd", "twds"], "application/vnd.smaf": ["mmf"], "application/vnd.smart.teacher": ["teacher"], "application/vnd.software602.filler.form+xml": ["fo"], "application/vnd.solent.sdkm+xml": ["sdkm", "sdkd"], "application/vnd.spotfire.dxp": ["dxp"], "application/vnd.spotfire.sfs": ["sfs"], "application/vnd.stardivision.calc": ["sdc"], "application/vnd.stardivision.draw": ["sda"], "application/vnd.stardivision.impress": ["sdd"], "application/vnd.stardivision.math": ["smf"], "application/vnd.stardivision.writer": ["sdw", "vor"], "application/vnd.stardivision.writer-global": ["sgl"], "application/vnd.stepmania.package": ["smzip"], "application/vnd.stepmania.stepchart": ["sm"], "application/vnd.sun.wadl+xml": ["wadl"], "application/vnd.sun.xml.calc": ["sxc"], "application/vnd.sun.xml.calc.template": ["stc"], "application/vnd.sun.xml.draw": ["sxd"], "application/vnd.sun.xml.draw.template": ["std"], "application/vnd.sun.xml.impress": ["sxi"], "application/vnd.sun.xml.impress.template": ["sti"], "application/vnd.sun.xml.math": ["sxm"], "application/vnd.sun.xml.writer": ["sxw"], "application/vnd.sun.xml.writer.global": ["sxg"], "application/vnd.sun.xml.writer.template": ["stw"], "application/vnd.sus-calendar": ["sus", "susp"], "application/vnd.svd": ["svd"], "application/vnd.symbian.install": ["sis", "sisx"], "application/vnd.syncml+xml": ["xsm"], "application/vnd.syncml.dm+wbxml": ["bdm"], "application/vnd.syncml.dm+xml": ["xdm"], "application/vnd.syncml.dmddf+xml": ["ddf"], "application/vnd.tao.intent-module-archive": ["tao"], "application/vnd.tcpdump.pcap": ["pcap", "cap", "dmp"], "application/vnd.tmobile-livetv": ["tmo"], "application/vnd.trid.tpt": ["tpt"], "application/vnd.triscape.mxs": ["mxs"], "application/vnd.trueapp": ["tra"], "application/vnd.ufdl": ["ufd", "ufdl"], "application/vnd.uiq.theme": ["utz"], "application/vnd.umajin": ["umj"], "application/vnd.unity": ["unityweb"], "application/vnd.uoml+xml": ["uoml"], "application/vnd.vcx": ["vcx"], "application/vnd.visio": ["vsd", "vst", "vss", "vsw"], "application/vnd.visionary": ["vis"], "application/vnd.vsf": ["vsf"], "application/vnd.wap.wbxml": ["wbxml"], "application/vnd.wap.wmlc": ["wmlc"], "application/vnd.wap.wmlscriptc": ["wmlsc"], "application/vnd.webturbo": ["wtb"], "application/vnd.wolfram.player": ["nbp"], "application/vnd.wordperfect": ["wpd"], "application/vnd.wqd": ["wqd"], "application/vnd.wt.stf": ["stf"], "application/vnd.xara": ["xar"], "application/vnd.xfdl": ["xfdl"], "application/vnd.yamaha.hv-dic": ["hvd"], "application/vnd.yamaha.hv-script": ["hvs"], "application/vnd.yamaha.hv-voice": ["hvp"], "application/vnd.yamaha.openscoreformat": ["osf"], "application/vnd.yamaha.openscoreformat.osfpvg+xml": ["osfpvg"], "application/vnd.yamaha.smaf-audio": ["saf"], "application/vnd.yamaha.smaf-phrase": ["spf"], "application/vnd.yellowriver-custom-menu": ["cmp"], "application/vnd.zul": ["zir", "zirz"], "application/vnd.zzazz.deck+xml": ["zaz"], "application/x-7z-compressed": ["7z"], "application/x-abiword": ["abw"], "application/x-ace-compressed": ["ace"], "application/x-apple-diskimage": ["*dmg"], "application/x-arj": ["arj"], "application/x-authorware-bin": ["aab", "x32", "u32", "vox"], "application/x-authorware-map": ["aam"], "application/x-authorware-seg": ["aas"], "application/x-bcpio": ["bcpio"], "application/x-bdoc": ["*bdoc"], "application/x-bittorrent": ["torrent"], "application/x-blorb": ["blb", "blorb"], "application/x-bzip": ["bz"], "application/x-bzip2": ["bz2", "boz"], "application/x-cbr": ["cbr", "cba", "cbt", "cbz", "cb7"], "application/x-cdlink": ["vcd"], "application/x-cfs-compressed": ["cfs"], "application/x-chat": ["chat"], "application/x-chess-pgn": ["pgn"], "application/x-chrome-extension": ["crx"], "application/x-cocoa": ["cco"], "application/x-conference": ["nsc"], "application/x-cpio": ["cpio"], "application/x-csh": ["csh"], "application/x-debian-package": ["*deb", "udeb"], "application/x-dgc-compressed": ["dgc"], "application/x-director": ["dir", "dcr", "dxr", "cst", "cct", "cxt", "w3d", "fgd", "swa"], "application/x-doom": ["wad"], "application/x-dtbncx+xml": ["ncx"], "application/x-dtbook+xml": ["dtb"], "application/x-dtbresource+xml": ["res"], "application/x-dvi": ["dvi"], "application/x-envoy": ["evy"], "application/x-eva": ["eva"], "application/x-font-bdf": ["bdf"], "application/x-font-ghostscript": ["gsf"], "application/x-font-linux-psf": ["psf"], "application/x-font-pcf": ["pcf"], "application/x-font-snf": ["snf"], "application/x-font-type1": ["pfa", "pfb", "pfm", "afm"], "application/x-freearc": ["arc"], "application/x-futuresplash": ["spl"], "application/x-gca-compressed": ["gca"], "application/x-glulx": ["ulx"], "application/x-gnumeric": ["gnumeric"], "application/x-gramps-xml": ["gramps"], "application/x-gtar": ["gtar"], "application/x-hdf": ["hdf"], "application/x-httpd-php": ["php"], "application/x-install-instructions": ["install"], "application/x-iso9660-image": ["*iso"], "application/x-iwork-keynote-sffkey": ["*key"], "application/x-iwork-numbers-sffnumbers": ["*numbers"], "application/x-iwork-pages-sffpages": ["*pages"], "application/x-java-archive-diff": ["jardiff"], "application/x-java-jnlp-file": ["jnlp"], "application/x-keepass2": ["kdbx"], "application/x-latex": ["latex"], "application/x-lua-bytecode": ["luac"], "application/x-lzh-compressed": ["lzh", "lha"], "application/x-makeself": ["run"], "application/x-mie": ["mie"], "application/x-mobipocket-ebook": ["prc", "mobi"], "application/x-ms-application": ["application"], "application/x-ms-shortcut": ["lnk"], "application/x-ms-wmd": ["wmd"], "application/x-ms-wmz": ["wmz"], "application/x-ms-xbap": ["xbap"], "application/x-msaccess": ["mdb"], "application/x-msbinder": ["obd"], "application/x-mscardfile": ["crd"], "application/x-msclip": ["clp"], "application/x-msdos-program": ["*exe"], "application/x-msdownload": ["*exe", "*dll", "com", "bat", "*msi"], "application/x-msmediaview": ["mvb", "m13", "m14"], "application/x-msmetafile": ["*wmf", "*wmz", "*emf", "emz"], "application/x-msmoney": ["mny"], "application/x-mspublisher": ["pub"], "application/x-msschedule": ["scd"], "application/x-msterminal": ["trm"], "application/x-mswrite": ["wri"], "application/x-netcdf": ["nc", "cdf"], "application/x-ns-proxy-autoconfig": ["pac"], "application/x-nzb": ["nzb"], "application/x-perl": ["pl", "pm"], "application/x-pilot": ["*prc", "*pdb"], "application/x-pkcs12": ["p12", "pfx"], "application/x-pkcs7-certificates": ["p7b", "spc"], "application/x-pkcs7-certreqresp": ["p7r"], "application/x-rar-compressed": ["*rar"], "application/x-redhat-package-manager": ["rpm"], "application/x-research-info-systems": ["ris"], "application/x-sea": ["sea"], "application/x-sh": ["sh"], "application/x-shar": ["shar"], "application/x-shockwave-flash": ["swf"], "application/x-silverlight-app": ["xap"], "application/x-sql": ["sql"], "application/x-stuffit": ["sit"], "application/x-stuffitx": ["sitx"], "application/x-subrip": ["srt"], "application/x-sv4cpio": ["sv4cpio"], "application/x-sv4crc": ["sv4crc"], "application/x-t3vm-image": ["t3"], "application/x-tads": ["gam"], "application/x-tar": ["tar"], "application/x-tcl": ["tcl", "tk"], "application/x-tex": ["tex"], "application/x-tex-tfm": ["tfm"], "application/x-texinfo": ["texinfo", "texi"], "application/x-tgif": ["*obj"], "application/x-ustar": ["ustar"], "application/x-virtualbox-hdd": ["hdd"], "application/x-virtualbox-ova": ["ova"], "application/x-virtualbox-ovf": ["ovf"], "application/x-virtualbox-vbox": ["vbox"], "application/x-virtualbox-vbox-extpack": ["vbox-extpack"], "application/x-virtualbox-vdi": ["vdi"], "application/x-virtualbox-vhd": ["vhd"], "application/x-virtualbox-vmdk": ["vmdk"], "application/x-wais-source": ["src"], "application/x-web-app-manifest+json": ["webapp"], "application/x-x509-ca-cert": ["der", "crt", "pem"], "application/x-xfig": ["fig"], "application/x-xliff+xml": ["*xlf"], "application/x-xpinstall": ["xpi"], "application/x-xz": ["xz"], "application/x-zmachine": ["z1", "z2", "z3", "z4", "z5", "z6", "z7", "z8"], "audio/vnd.dece.audio": ["uva", "uvva"], "audio/vnd.digital-winds": ["eol"], "audio/vnd.dra": ["dra"], "audio/vnd.dts": ["dts"], "audio/vnd.dts.hd": ["dtshd"], "audio/vnd.lucent.voice": ["lvp"], "audio/vnd.ms-playready.media.pya": ["pya"], "audio/vnd.nuera.ecelp4800": ["ecelp4800"], "audio/vnd.nuera.ecelp7470": ["ecelp7470"], "audio/vnd.nuera.ecelp9600": ["ecelp9600"], "audio/vnd.rip": ["rip"], "audio/x-aac": ["aac"], "audio/x-aiff": ["aif", "aiff", "aifc"], "audio/x-caf": ["caf"], "audio/x-flac": ["flac"], "audio/x-m4a": ["*m4a"], "audio/x-matroska": ["mka"], "audio/x-mpegurl": ["m3u"], "audio/x-ms-wax": ["wax"], "audio/x-ms-wma": ["wma"], "audio/x-pn-realaudio": ["ram", "ra"], "audio/x-pn-realaudio-plugin": ["rmp"], "audio/x-realaudio": ["*ra"], "audio/x-wav": ["*wav"], "chemical/x-cdx": ["cdx"], "chemical/x-cif": ["cif"], "chemical/x-cmdf": ["cmdf"], "chemical/x-cml": ["cml"], "chemical/x-csml": ["csml"], "chemical/x-xyz": ["xyz"], "image/prs.btif": ["btif"], "image/prs.pti": ["pti"], "image/vnd.adobe.photoshop": ["psd"], "image/vnd.airzip.accelerator.azv": ["azv"], "image/vnd.dece.graphic": ["uvi", "uvvi", "uvg", "uvvg"], "image/vnd.djvu": ["djvu", "djv"], "image/vnd.dvb.subtitle": ["*sub"], "image/vnd.dwg": ["dwg"], "image/vnd.dxf": ["dxf"], "image/vnd.fastbidsheet": ["fbs"], "image/vnd.fpx": ["fpx"], "image/vnd.fst": ["fst"], "image/vnd.fujixerox.edmics-mmr": ["mmr"], "image/vnd.fujixerox.edmics-rlc": ["rlc"], "image/vnd.microsoft.icon": ["ico"], "image/vnd.ms-dds": ["dds"], "image/vnd.ms-modi": ["mdi"], "image/vnd.ms-photo": ["wdp"], "image/vnd.net-fpx": ["npx"], "image/vnd.pco.b16": ["b16"], "image/vnd.tencent.tap": ["tap"], "image/vnd.valve.source.texture": ["vtf"], "image/vnd.wap.wbmp": ["wbmp"], "image/vnd.xiff": ["xif"], "image/vnd.zbrush.pcx": ["pcx"], "image/x-3ds": ["3ds"], "image/x-cmu-raster": ["ras"], "image/x-cmx": ["cmx"], "image/x-freehand": ["fh", "fhc", "fh4", "fh5", "fh7"], "image/x-icon": ["*ico"], "image/x-jng": ["jng"], "image/x-mrsid-image": ["sid"], "image/x-ms-bmp": ["*bmp"], "image/x-pcx": ["*pcx"], "image/x-pict": ["pic", "pct"], "image/x-portable-anymap": ["pnm"], "image/x-portable-bitmap": ["pbm"], "image/x-portable-graymap": ["pgm"], "image/x-portable-pixmap": ["ppm"], "image/x-rgb": ["rgb"], "image/x-tga": ["tga"], "image/x-xbitmap": ["xbm"], "image/x-xpixmap": ["xpm"], "image/x-xwindowdump": ["xwd"], "message/vnd.wfa.wsc": ["wsc"], "model/vnd.collada+xml": ["dae"], "model/vnd.dwf": ["dwf"], "model/vnd.gdl": ["gdl"], "model/vnd.gtw": ["gtw"], "model/vnd.mts": ["mts"], "model/vnd.opengex": ["ogex"], "model/vnd.parasolid.transmit.binary": ["x_b"], "model/vnd.parasolid.transmit.text": ["x_t"], "model/vnd.sap.vds": ["vds"], "model/vnd.usdz+zip": ["usdz"], "model/vnd.valve.source.compiled-map": ["bsp"], "model/vnd.vtu": ["vtu"], "text/prs.lines.tag": ["dsc"], "text/vnd.curl": ["curl"], "text/vnd.curl.dcurl": ["dcurl"], "text/vnd.curl.mcurl": ["mcurl"], "text/vnd.curl.scurl": ["scurl"], "text/vnd.dvb.subtitle": ["sub"], "text/vnd.fly": ["fly"], "text/vnd.fmi.flexstor": ["flx"], "text/vnd.graphviz": ["gv"], "text/vnd.in3d.3dml": ["3dml"], "text/vnd.in3d.spot": ["spot"], "text/vnd.sun.j2me.app-descriptor": ["jad"], "text/vnd.wap.wml": ["wml"], "text/vnd.wap.wmlscript": ["wmls"], "text/x-asm": ["s", "asm"], "text/x-c": ["c", "cc", "cxx", "cpp", "h", "hh", "dic"], "text/x-component": ["htc"], "text/x-fortran": ["f", "for", "f77", "f90"], "text/x-handlebars-template": ["hbs"], "text/x-java-source": ["java"], "text/x-lua": ["lua"], "text/x-markdown": ["mkd"], "text/x-nfo": ["nfo"], "text/x-opml": ["opml"], "text/x-org": ["*org"], "text/x-pascal": ["p", "pas"], "text/x-processing": ["pde"], "text/x-sass": ["sass"], "text/x-scss": ["scss"], "text/x-setext": ["etx"], "text/x-sfv": ["sfv"], "text/x-suse-ymp": ["ymp"], "text/x-uuencode": ["uu"], "text/x-vcalendar": ["vcs"], "text/x-vcard": ["vcf"], "video/vnd.dece.hd": ["uvh", "uvvh"], "video/vnd.dece.mobile": ["uvm", "uvvm"], "video/vnd.dece.pd": ["uvp", "uvvp"], "video/vnd.dece.sd": ["uvs", "uvvs"], "video/vnd.dece.video": ["uvv", "uvvv"], "video/vnd.dvb.file": ["dvb"], "video/vnd.fvt": ["fvt"], "video/vnd.mpegurl": ["mxu", "m4u"], "video/vnd.ms-playready.media.pyv": ["pyv"], "video/vnd.uvvu.mp4": ["uvu", "uvvu"], "video/vnd.vivo": ["viv"], "video/x-f4v": ["f4v"], "video/x-fli": ["fli"], "video/x-flv": ["flv"], "video/x-m4v": ["m4v"], "video/x-matroska": ["mkv", "mk3d", "mks"], "video/x-mng": ["mng"], "video/x-ms-asf": ["asf", "asx"], "video/x-ms-vob": ["vob"], "video/x-ms-wm": ["wm"], "video/x-ms-wmv": ["wmv"], "video/x-ms-wmx": ["wmx"], "video/x-ms-wvx": ["wvx"], "video/x-msvideo": ["avi"], "video/x-sgi-movie": ["movie"], "video/x-smv": ["smv"], "x-conference/x-cooltalk": ["ice"] };
  }
});

// node_modules/mime/index.js
var require_mime = __commonJS({
  "node_modules/mime/index.js"(exports2, module2) {
    "use strict";
    var Mime = require_Mime();
    module2.exports = new Mime(require_standard(), require_other());
  }
});

// node_modules/concat-map/index.js
var require_concat_map = __commonJS({
  "node_modules/concat-map/index.js"(exports2, module2) {
    module2.exports = function(xs, fn) {
      var res = [];
      for (var i = 0; i < xs.length; i++) {
        var x = fn(xs[i], i);
        if (isArray(x)) res.push.apply(res, x);
        else res.push(x);
      }
      return res;
    };
    var isArray = Array.isArray || function(xs) {
      return Object.prototype.toString.call(xs) === "[object Array]";
    };
  }
});

// node_modules/balanced-match/index.js
var require_balanced_match = __commonJS({
  "node_modules/balanced-match/index.js"(exports2, module2) {
    "use strict";
    module2.exports = balanced;
    function balanced(a, b, str) {
      if (a instanceof RegExp) a = maybeMatch(a, str);
      if (b instanceof RegExp) b = maybeMatch(b, str);
      var r = range(a, b, str);
      return r && {
        start: r[0],
        end: r[1],
        pre: str.slice(0, r[0]),
        body: str.slice(r[0] + a.length, r[1]),
        post: str.slice(r[1] + b.length)
      };
    }
    function maybeMatch(reg, str) {
      var m = str.match(reg);
      return m ? m[0] : null;
    }
    balanced.range = range;
    function range(a, b, str) {
      var begs, beg, left, right, result;
      var ai = str.indexOf(a);
      var bi = str.indexOf(b, ai + 1);
      var i = ai;
      if (ai >= 0 && bi > 0) {
        if (a === b) {
          return [ai, bi];
        }
        begs = [];
        left = str.length;
        while (i >= 0 && !result) {
          if (i == ai) {
            begs.push(i);
            ai = str.indexOf(a, i + 1);
          } else if (begs.length == 1) {
            result = [begs.pop(), bi];
          } else {
            beg = begs.pop();
            if (beg < left) {
              left = beg;
              right = bi;
            }
            bi = str.indexOf(b, i + 1);
          }
          i = ai < bi && ai >= 0 ? ai : bi;
        }
        if (begs.length) {
          result = [left, right];
        }
      }
      return result;
    }
  }
});

// node_modules/brace-expansion/index.js
var require_brace_expansion = __commonJS({
  "node_modules/brace-expansion/index.js"(exports2, module2) {
    var concatMap = require_concat_map();
    var balanced = require_balanced_match();
    module2.exports = expandTop;
    var escSlash = "\0SLASH" + Math.random() + "\0";
    var escOpen = "\0OPEN" + Math.random() + "\0";
    var escClose = "\0CLOSE" + Math.random() + "\0";
    var escComma = "\0COMMA" + Math.random() + "\0";
    var escPeriod = "\0PERIOD" + Math.random() + "\0";
    function numeric(str) {
      return parseInt(str, 10) == str ? parseInt(str, 10) : str.charCodeAt(0);
    }
    function escapeBraces(str) {
      return str.split("\\\\").join(escSlash).split("\\{").join(escOpen).split("\\}").join(escClose).split("\\,").join(escComma).split("\\.").join(escPeriod);
    }
    function unescapeBraces(str) {
      return str.split(escSlash).join("\\").split(escOpen).join("{").split(escClose).join("}").split(escComma).join(",").split(escPeriod).join(".");
    }
    function parseCommaParts(str) {
      if (!str)
        return [""];
      var parts = [];
      var m = balanced("{", "}", str);
      if (!m)
        return str.split(",");
      var pre = m.pre;
      var body = m.body;
      var post = m.post;
      var p = pre.split(",");
      p[p.length - 1] += "{" + body + "}";
      var postParts = parseCommaParts(post);
      if (post.length) {
        p[p.length - 1] += postParts.shift();
        p.push.apply(p, postParts);
      }
      parts.push.apply(parts, p);
      return parts;
    }
    function expandTop(str) {
      if (!str)
        return [];
      if (str.substr(0, 2) === "{}") {
        str = "\\{\\}" + str.substr(2);
      }
      return expand(escapeBraces(str), true).map(unescapeBraces);
    }
    function embrace(str) {
      return "{" + str + "}";
    }
    function isPadded(el) {
      return /^-?0\d/.test(el);
    }
    function lte(i, y) {
      return i <= y;
    }
    function gte(i, y) {
      return i >= y;
    }
    function expand(str, isTop) {
      var expansions = [];
      var m = balanced("{", "}", str);
      if (!m || /\$$/.test(m.pre)) return [str];
      var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
      var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
      var isSequence = isNumericSequence || isAlphaSequence;
      var isOptions = m.body.indexOf(",") >= 0;
      if (!isSequence && !isOptions) {
        if (m.post.match(/,(?!,).*\}/)) {
          str = m.pre + "{" + m.body + escClose + m.post;
          return expand(str);
        }
        return [str];
      }
      var n;
      if (isSequence) {
        n = m.body.split(/\.\./);
      } else {
        n = parseCommaParts(m.body);
        if (n.length === 1) {
          n = expand(n[0], false).map(embrace);
          if (n.length === 1) {
            var post = m.post.length ? expand(m.post, false) : [""];
            return post.map(function(p) {
              return m.pre + n[0] + p;
            });
          }
        }
      }
      var pre = m.pre;
      var post = m.post.length ? expand(m.post, false) : [""];
      var N;
      if (isSequence) {
        var x = numeric(n[0]);
        var y = numeric(n[1]);
        var width = Math.max(n[0].length, n[1].length);
        var incr = n.length == 3 ? Math.abs(numeric(n[2])) : 1;
        var test = lte;
        var reverse = y < x;
        if (reverse) {
          incr *= -1;
          test = gte;
        }
        var pad = n.some(isPadded);
        N = [];
        for (var i = x; test(i, y); i += incr) {
          var c;
          if (isAlphaSequence) {
            c = String.fromCharCode(i);
            if (c === "\\")
              c = "";
          } else {
            c = String(i);
            if (pad) {
              var need = width - c.length;
              if (need > 0) {
                var z2 = new Array(need + 1).join("0");
                if (i < 0)
                  c = "-" + z2 + c.slice(1);
                else
                  c = z2 + c;
              }
            }
          }
          N.push(c);
        }
      } else {
        N = concatMap(n, function(el) {
          return expand(el, false);
        });
      }
      for (var j = 0; j < N.length; j++) {
        for (var k = 0; k < post.length; k++) {
          var expansion = pre + N[j] + post[k];
          if (!isTop || isSequence || expansion)
            expansions.push(expansion);
        }
      }
      return expansions;
    }
  }
});

// node_modules/minimatch/minimatch.js
var require_minimatch = __commonJS({
  "node_modules/minimatch/minimatch.js"(exports2, module2) {
    module2.exports = minimatch2;
    minimatch2.Minimatch = Minimatch;
    var path = (function() {
      try {
        return require("path");
      } catch (e) {
      }
    })() || {
      sep: "/"
    };
    minimatch2.sep = path.sep;
    var GLOBSTAR = minimatch2.GLOBSTAR = Minimatch.GLOBSTAR = {};
    var expand = require_brace_expansion();
    var plTypes = {
      "!": { open: "(?:(?!(?:", close: "))[^/]*?)" },
      "?": { open: "(?:", close: ")?" },
      "+": { open: "(?:", close: ")+" },
      "*": { open: "(?:", close: ")*" },
      "@": { open: "(?:", close: ")" }
    };
    var qmark = "[^/]";
    var star = qmark + "*?";
    var twoStarDot = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?";
    var twoStarNoDot = "(?:(?!(?:\\/|^)\\.).)*?";
    var reSpecials = charSet("().*{}+?[]^$\\!");
    function charSet(s) {
      return s.split("").reduce(function(set2, c) {
        set2[c] = true;
        return set2;
      }, {});
    }
    var slashSplit = /\/+/;
    minimatch2.filter = filter;
    function filter(pattern, options2) {
      options2 = options2 || {};
      return function(p, i, list) {
        return minimatch2(p, pattern, options2);
      };
    }
    function ext(a, b) {
      b = b || {};
      var t = {};
      Object.keys(a).forEach(function(k) {
        t[k] = a[k];
      });
      Object.keys(b).forEach(function(k) {
        t[k] = b[k];
      });
      return t;
    }
    minimatch2.defaults = function(def) {
      if (!def || typeof def !== "object" || !Object.keys(def).length) {
        return minimatch2;
      }
      var orig = minimatch2;
      var m = function minimatch3(p, pattern, options2) {
        return orig(p, pattern, ext(def, options2));
      };
      m.Minimatch = function Minimatch2(pattern, options2) {
        return new orig.Minimatch(pattern, ext(def, options2));
      };
      m.Minimatch.defaults = function defaults(options2) {
        return orig.defaults(ext(def, options2)).Minimatch;
      };
      m.filter = function filter2(pattern, options2) {
        return orig.filter(pattern, ext(def, options2));
      };
      m.defaults = function defaults(options2) {
        return orig.defaults(ext(def, options2));
      };
      m.makeRe = function makeRe2(pattern, options2) {
        return orig.makeRe(pattern, ext(def, options2));
      };
      m.braceExpand = function braceExpand2(pattern, options2) {
        return orig.braceExpand(pattern, ext(def, options2));
      };
      m.match = function(list, pattern, options2) {
        return orig.match(list, pattern, ext(def, options2));
      };
      return m;
    };
    Minimatch.defaults = function(def) {
      return minimatch2.defaults(def).Minimatch;
    };
    function minimatch2(p, pattern, options2) {
      assertValidPattern(pattern);
      if (!options2) options2 = {};
      if (!options2.nocomment && pattern.charAt(0) === "#") {
        return false;
      }
      return new Minimatch(pattern, options2).match(p);
    }
    function Minimatch(pattern, options2) {
      if (!(this instanceof Minimatch)) {
        return new Minimatch(pattern, options2);
      }
      assertValidPattern(pattern);
      if (!options2) options2 = {};
      pattern = pattern.trim();
      if (!options2.allowWindowsEscape && path.sep !== "/") {
        pattern = pattern.split(path.sep).join("/");
      }
      this.options = options2;
      this.maxGlobstarRecursion = options2.maxGlobstarRecursion !== void 0 ? options2.maxGlobstarRecursion : 200;
      this.set = [];
      this.pattern = pattern;
      this.regexp = null;
      this.negate = false;
      this.comment = false;
      this.empty = false;
      this.partial = !!options2.partial;
      this.make();
    }
    Minimatch.prototype.debug = function() {
    };
    Minimatch.prototype.make = make;
    function make() {
      var pattern = this.pattern;
      var options2 = this.options;
      if (!options2.nocomment && pattern.charAt(0) === "#") {
        this.comment = true;
        return;
      }
      if (!pattern) {
        this.empty = true;
        return;
      }
      this.parseNegate();
      var set2 = this.globSet = this.braceExpand();
      if (options2.debug) this.debug = function debug2() {
        console.error.apply(console, arguments);
      };
      this.debug(this.pattern, set2);
      set2 = this.globParts = set2.map(function(s) {
        return s.split(slashSplit);
      });
      this.debug(this.pattern, set2);
      set2 = set2.map(function(s, si, set3) {
        return s.map(this.parse, this);
      }, this);
      this.debug(this.pattern, set2);
      set2 = set2.filter(function(s) {
        return s.indexOf(false) === -1;
      });
      this.debug(this.pattern, set2);
      this.set = set2;
    }
    Minimatch.prototype.parseNegate = parseNegate;
    function parseNegate() {
      var pattern = this.pattern;
      var negate = false;
      var options2 = this.options;
      var negateOffset = 0;
      if (options2.nonegate) return;
      for (var i = 0, l = pattern.length; i < l && pattern.charAt(i) === "!"; i++) {
        negate = !negate;
        negateOffset++;
      }
      if (negateOffset) this.pattern = pattern.substr(negateOffset);
      this.negate = negate;
    }
    minimatch2.braceExpand = function(pattern, options2) {
      return braceExpand(pattern, options2);
    };
    Minimatch.prototype.braceExpand = braceExpand;
    function braceExpand(pattern, options2) {
      if (!options2) {
        if (this instanceof Minimatch) {
          options2 = this.options;
        } else {
          options2 = {};
        }
      }
      pattern = typeof pattern === "undefined" ? this.pattern : pattern;
      assertValidPattern(pattern);
      if (options2.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) {
        return [pattern];
      }
      return expand(pattern);
    }
    var MAX_PATTERN_LENGTH = 1024 * 64;
    var assertValidPattern = function(pattern) {
      if (typeof pattern !== "string") {
        throw new TypeError("invalid pattern");
      }
      if (pattern.length > MAX_PATTERN_LENGTH) {
        throw new TypeError("pattern is too long");
      }
    };
    Minimatch.prototype.parse = parse3;
    var SUBPARSE = {};
    function parse3(pattern, isSub) {
      assertValidPattern(pattern);
      var options2 = this.options;
      if (pattern === "**") {
        if (!options2.noglobstar)
          return GLOBSTAR;
        else
          pattern = "*";
      }
      if (pattern === "") return "";
      var re = "";
      var hasMagic = !!options2.nocase;
      var escaping = false;
      var patternListStack = [];
      var negativeLists = [];
      var stateChar;
      var inClass = false;
      var reClassStart = -1;
      var classStart = -1;
      var patternStart = pattern.charAt(0) === "." ? "" : options2.dot ? "(?!(?:^|\\/)\\.{1,2}(?:$|\\/))" : "(?!\\.)";
      var self = this;
      function clearStateChar() {
        if (stateChar) {
          switch (stateChar) {
            case "*":
              re += star;
              hasMagic = true;
              break;
            case "?":
              re += qmark;
              hasMagic = true;
              break;
            default:
              re += "\\" + stateChar;
              break;
          }
          self.debug("clearStateChar %j %j", stateChar, re);
          stateChar = false;
        }
      }
      for (var i = 0, len = pattern.length, c; i < len && (c = pattern.charAt(i)); i++) {
        this.debug("%s	%s %s %j", pattern, i, re, c);
        if (escaping && reSpecials[c]) {
          re += "\\" + c;
          escaping = false;
          continue;
        }
        switch (c) {
          /* istanbul ignore next */
          case "/": {
            return false;
          }
          case "\\":
            clearStateChar();
            escaping = true;
            continue;
          // the various stateChar values
          // for the "extglob" stuff.
          case "?":
          case "*":
          case "+":
          case "@":
          case "!":
            this.debug("%s	%s %s %j <-- stateChar", pattern, i, re, c);
            if (inClass) {
              this.debug("  in class");
              if (c === "!" && i === classStart + 1) c = "^";
              re += c;
              continue;
            }
            if (c === "*" && stateChar === "*") continue;
            self.debug("call clearStateChar %j", stateChar);
            clearStateChar();
            stateChar = c;
            if (options2.noext) clearStateChar();
            continue;
          case "(":
            if (inClass) {
              re += "(";
              continue;
            }
            if (!stateChar) {
              re += "\\(";
              continue;
            }
            patternListStack.push({
              type: stateChar,
              start: i - 1,
              reStart: re.length,
              open: plTypes[stateChar].open,
              close: plTypes[stateChar].close
            });
            re += stateChar === "!" ? "(?:(?!(?:" : "(?:";
            this.debug("plType %j %j", stateChar, re);
            stateChar = false;
            continue;
          case ")":
            if (inClass || !patternListStack.length) {
              re += "\\)";
              continue;
            }
            clearStateChar();
            hasMagic = true;
            var pl = patternListStack.pop();
            re += pl.close;
            if (pl.type === "!") {
              negativeLists.push(pl);
            }
            pl.reEnd = re.length;
            continue;
          case "|":
            if (inClass || !patternListStack.length || escaping) {
              re += "\\|";
              escaping = false;
              continue;
            }
            clearStateChar();
            re += "|";
            continue;
          // these are mostly the same in regexp and glob
          case "[":
            clearStateChar();
            if (inClass) {
              re += "\\" + c;
              continue;
            }
            inClass = true;
            classStart = i;
            reClassStart = re.length;
            re += c;
            continue;
          case "]":
            if (i === classStart + 1 || !inClass) {
              re += "\\" + c;
              escaping = false;
              continue;
            }
            var cs = pattern.substring(classStart + 1, i);
            try {
              RegExp("[" + cs + "]");
            } catch (er) {
              var sp = this.parse(cs, SUBPARSE);
              re = re.substr(0, reClassStart) + "\\[" + sp[0] + "\\]";
              hasMagic = hasMagic || sp[1];
              inClass = false;
              continue;
            }
            hasMagic = true;
            inClass = false;
            re += c;
            continue;
          default:
            clearStateChar();
            if (escaping) {
              escaping = false;
            } else if (reSpecials[c] && !(c === "^" && inClass)) {
              re += "\\";
            }
            re += c;
        }
      }
      if (inClass) {
        cs = pattern.substr(classStart + 1);
        sp = this.parse(cs, SUBPARSE);
        re = re.substr(0, reClassStart) + "\\[" + sp[0];
        hasMagic = hasMagic || sp[1];
      }
      for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) {
        var tail = re.slice(pl.reStart + pl.open.length);
        this.debug("setting tail", re, pl);
        tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, function(_, $1, $2) {
          if (!$2) {
            $2 = "\\";
          }
          return $1 + $1 + $2 + "|";
        });
        this.debug("tail=%j\n   %s", tail, tail, pl, re);
        var t = pl.type === "*" ? star : pl.type === "?" ? qmark : "\\" + pl.type;
        hasMagic = true;
        re = re.slice(0, pl.reStart) + t + "\\(" + tail;
      }
      clearStateChar();
      if (escaping) {
        re += "\\\\";
      }
      var addPatternStart = false;
      switch (re.charAt(0)) {
        case "[":
        case ".":
        case "(":
          addPatternStart = true;
      }
      for (var n = negativeLists.length - 1; n > -1; n--) {
        var nl = negativeLists[n];
        var nlBefore = re.slice(0, nl.reStart);
        var nlFirst = re.slice(nl.reStart, nl.reEnd - 8);
        var nlLast = re.slice(nl.reEnd - 8, nl.reEnd);
        var nlAfter = re.slice(nl.reEnd);
        nlLast += nlAfter;
        var openParensBefore = nlBefore.split("(").length - 1;
        var cleanAfter = nlAfter;
        for (i = 0; i < openParensBefore; i++) {
          cleanAfter = cleanAfter.replace(/\)[+*?]?/, "");
        }
        nlAfter = cleanAfter;
        var dollar = "";
        if (nlAfter === "" && isSub !== SUBPARSE) {
          dollar = "$";
        }
        var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast;
        re = newRe;
      }
      if (re !== "" && hasMagic) {
        re = "(?=.)" + re;
      }
      if (addPatternStart) {
        re = patternStart + re;
      }
      if (isSub === SUBPARSE) {
        return [re, hasMagic];
      }
      if (!hasMagic) {
        return globUnescape(pattern);
      }
      var flags = options2.nocase ? "i" : "";
      try {
        var regExp = new RegExp("^" + re + "$", flags);
      } catch (er) {
        return new RegExp("$.");
      }
      regExp._glob = pattern;
      regExp._src = re;
      return regExp;
    }
    minimatch2.makeRe = function(pattern, options2) {
      return new Minimatch(pattern, options2 || {}).makeRe();
    };
    Minimatch.prototype.makeRe = makeRe;
    function makeRe() {
      if (this.regexp || this.regexp === false) return this.regexp;
      var set2 = this.set;
      if (!set2.length) {
        this.regexp = false;
        return this.regexp;
      }
      var options2 = this.options;
      var twoStar = options2.noglobstar ? star : options2.dot ? twoStarDot : twoStarNoDot;
      var flags = options2.nocase ? "i" : "";
      var re = set2.map(function(pattern) {
        return pattern.map(function(p) {
          return p === GLOBSTAR ? twoStar : typeof p === "string" ? regExpEscape(p) : p._src;
        }).join("\\/");
      }).join("|");
      re = "^(?:" + re + ")$";
      if (this.negate) re = "^(?!" + re + ").*$";
      try {
        this.regexp = new RegExp(re, flags);
      } catch (ex) {
        this.regexp = false;
      }
      return this.regexp;
    }
    minimatch2.match = function(list, pattern, options2) {
      options2 = options2 || {};
      var mm = new Minimatch(pattern, options2);
      list = list.filter(function(f) {
        return mm.match(f);
      });
      if (mm.options.nonull && !list.length) {
        list.push(pattern);
      }
      return list;
    };
    Minimatch.prototype.match = function match(f, partial2) {
      if (typeof partial2 === "undefined") partial2 = this.partial;
      this.debug("match", f, this.pattern);
      if (this.comment) return false;
      if (this.empty) return f === "";
      if (f === "/" && partial2) return true;
      var options2 = this.options;
      if (path.sep !== "/") {
        f = f.split(path.sep).join("/");
      }
      f = f.split(slashSplit);
      this.debug(this.pattern, "split", f);
      var set2 = this.set;
      this.debug(this.pattern, "set", set2);
      var filename;
      var i;
      for (i = f.length - 1; i >= 0; i--) {
        filename = f[i];
        if (filename) break;
      }
      for (i = 0; i < set2.length; i++) {
        var pattern = set2[i];
        var file2 = f;
        if (options2.matchBase && pattern.length === 1) {
          file2 = [filename];
        }
        var hit = this.matchOne(file2, pattern, partial2);
        if (hit) {
          if (options2.flipNegate) return true;
          return !this.negate;
        }
      }
      if (options2.flipNegate) return false;
      return this.negate;
    };
    Minimatch.prototype.matchOne = function(file2, pattern, partial2) {
      if (pattern.indexOf(GLOBSTAR) !== -1) {
        return this._matchGlobstar(file2, pattern, partial2, 0, 0);
      }
      return this._matchOne(file2, pattern, partial2, 0, 0);
    };
    Minimatch.prototype._matchGlobstar = function(file2, pattern, partial2, fileIndex, patternIndex) {
      var i;
      var firstgs = -1;
      for (i = patternIndex; i < pattern.length; i++) {
        if (pattern[i] === GLOBSTAR) {
          firstgs = i;
          break;
        }
      }
      var lastgs = -1;
      for (i = pattern.length - 1; i >= 0; i--) {
        if (pattern[i] === GLOBSTAR) {
          lastgs = i;
          break;
        }
      }
      var head = pattern.slice(patternIndex, firstgs);
      var body = partial2 ? pattern.slice(firstgs + 1) : pattern.slice(firstgs + 1, lastgs);
      var tail = partial2 ? [] : pattern.slice(lastgs + 1);
      if (head.length) {
        var fileHead = file2.slice(fileIndex, fileIndex + head.length);
        if (!this._matchOne(fileHead, head, partial2, 0, 0)) {
          return false;
        }
        fileIndex += head.length;
      }
      var fileTailMatch = 0;
      if (tail.length) {
        if (tail.length + fileIndex > file2.length) return false;
        var tailStart = file2.length - tail.length;
        if (this._matchOne(file2, tail, partial2, tailStart, 0)) {
          fileTailMatch = tail.length;
        } else {
          if (file2[file2.length - 1] !== "" || fileIndex + tail.length === file2.length) {
            return false;
          }
          tailStart--;
          if (!this._matchOne(file2, tail, partial2, tailStart, 0)) {
            return false;
          }
          fileTailMatch = tail.length + 1;
        }
      }
      if (!body.length) {
        var sawSome = !!fileTailMatch;
        for (i = fileIndex; i < file2.length - fileTailMatch; i++) {
          var f = String(file2[i]);
          sawSome = true;
          if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") {
            return false;
          }
        }
        return partial2 || sawSome;
      }
      var bodySegments = [[[], 0]];
      var currentBody = bodySegments[0];
      var nonGsParts = 0;
      var nonGsPartsSums = [0];
      for (var bi = 0; bi < body.length; bi++) {
        var b = body[bi];
        if (b === GLOBSTAR) {
          nonGsPartsSums.push(nonGsParts);
          currentBody = [[], 0];
          bodySegments.push(currentBody);
        } else {
          currentBody[0].push(b);
          nonGsParts++;
        }
      }
      var idx = bodySegments.length - 1;
      var fileLength = file2.length - fileTailMatch;
      for (var si = 0; si < bodySegments.length; si++) {
        bodySegments[si][1] = fileLength - (nonGsPartsSums[idx--] + bodySegments[si][0].length);
      }
      return !!this._matchGlobStarBodySections(
        file2,
        bodySegments,
        fileIndex,
        0,
        partial2,
        0,
        !!fileTailMatch
      );
    };
    Minimatch.prototype._matchGlobStarBodySections = function(file2, bodySegments, fileIndex, bodyIndex, partial2, globStarDepth, sawTail) {
      var bs = bodySegments[bodyIndex];
      if (!bs) {
        for (var i = fileIndex; i < file2.length; i++) {
          sawTail = true;
          var f = file2[i];
          if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") {
            return false;
          }
        }
        return sawTail;
      }
      var body = bs[0];
      var after = bs[1];
      while (fileIndex <= after) {
        var m = this._matchOne(
          file2.slice(0, fileIndex + body.length),
          body,
          partial2,
          fileIndex,
          0
        );
        if (m && globStarDepth < this.maxGlobstarRecursion) {
          var sub = this._matchGlobStarBodySections(
            file2,
            bodySegments,
            fileIndex + body.length,
            bodyIndex + 1,
            partial2,
            globStarDepth + 1,
            sawTail
          );
          if (sub !== false) {
            return sub;
          }
        }
        var f = file2[fileIndex];
        if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") {
          return false;
        }
        fileIndex++;
      }
      return partial2 || null;
    };
    Minimatch.prototype._matchOne = function(file2, pattern, partial2, fileIndex, patternIndex) {
      var fi, pi, fl, pl;
      for (fi = fileIndex, pi = patternIndex, fl = file2.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
        this.debug("matchOne loop");
        var p = pattern[pi];
        var f = file2[fi];
        this.debug(pattern, p, f);
        if (p === false || p === GLOBSTAR) return false;
        var hit;
        if (typeof p === "string") {
          hit = f === p;
          this.debug("string match", p, f, hit);
        } else {
          hit = f.match(p);
          this.debug("pattern match", p, f, hit);
        }
        if (!hit) return false;
      }
      if (fi === fl && pi === pl) {
        return true;
      } else if (fi === fl) {
        return partial2;
      } else if (pi === pl) {
        return fi === fl - 1 && file2[fi] === "";
      }
      throw new Error("wtf?");
    };
    function globUnescape(s) {
      return s.replace(/\\(.)/g, "$1");
    }
    function regExpEscape(s) {
      return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
    }
  }
});

// node_modules/is-docker/index.js
var require_is_docker = __commonJS({
  "node_modules/is-docker/index.js"(exports2, module2) {
    "use strict";
    var fs = require("fs");
    var isDocker;
    function hasDockerEnv() {
      try {
        fs.statSync("/.dockerenv");
        return true;
      } catch (_) {
        return false;
      }
    }
    function hasDockerCGroup() {
      try {
        return fs.readFileSync("/proc/self/cgroup", "utf8").includes("docker");
      } catch (_) {
        return false;
      }
    }
    module2.exports = () => {
      if (isDocker === void 0) {
        isDocker = hasDockerEnv() || hasDockerCGroup();
      }
      return isDocker;
    };
  }
});

// node_modules/is-wsl/index.js
var require_is_wsl = __commonJS({
  "node_modules/is-wsl/index.js"(exports2, module2) {
    "use strict";
    var os = require("os");
    var fs = require("fs");
    var isDocker = require_is_docker();
    var isWsl = () => {
      if (process.platform !== "linux") {
        return false;
      }
      if (os.release().toLowerCase().includes("microsoft")) {
        if (isDocker()) {
          return false;
        }
        return true;
      }
      try {
        return fs.readFileSync("/proc/version", "utf8").toLowerCase().includes("microsoft") ? !isDocker() : false;
      } catch (_) {
        return false;
      }
    };
    if (process.env.__IS_WSL_TEST__) {
      module2.exports = isWsl;
    } else {
      module2.exports = isWsl();
    }
  }
});

// node_modules/define-lazy-prop/index.js
var require_define_lazy_prop = __commonJS({
  "node_modules/define-lazy-prop/index.js"(exports2, module2) {
    "use strict";
    module2.exports = (object3, propertyName, fn) => {
      const define = (value) => Object.defineProperty(object3, propertyName, { value, enumerable: true, writable: true });
      Object.defineProperty(object3, propertyName, {
        configurable: true,
        enumerable: true,
        get() {
          const result = fn();
          define(result);
          return result;
        },
        set(value) {
          define(value);
        }
      });
      return object3;
    };
  }
});

// node_modules/open/index.js
var require_open = __commonJS({
  "node_modules/open/index.js"(exports2, module2) {
    var path = require("path");
    var childProcess = require("child_process");
    var { promises: fs, constants: fsConstants } = require("fs");
    var isWsl = require_is_wsl();
    var isDocker = require_is_docker();
    var defineLazyProperty = require_define_lazy_prop();
    var localXdgOpenPath = path.join(__dirname, "xdg-open");
    var { platform, arch } = process;
    var getWslDrivesMountPoint = /* @__PURE__ */ (() => {
      const defaultMountPoint = "/mnt/";
      let mountPoint;
      return async function() {
        if (mountPoint) {
          return mountPoint;
        }
        const configFilePath = "/etc/wsl.conf";
        let isConfigFileExists = false;
        try {
          await fs.access(configFilePath, fsConstants.F_OK);
          isConfigFileExists = true;
        } catch {
        }
        if (!isConfigFileExists) {
          return defaultMountPoint;
        }
        const configContent = await fs.readFile(configFilePath, { encoding: "utf8" });
        const configMountPoint = /(?<!#.*)root\s*=\s*(?<mountPoint>.*)/g.exec(configContent);
        if (!configMountPoint) {
          return defaultMountPoint;
        }
        mountPoint = configMountPoint.groups.mountPoint.trim();
        mountPoint = mountPoint.endsWith("/") ? mountPoint : `${mountPoint}/`;
        return mountPoint;
      };
    })();
    var pTryEach = async (array2, mapper) => {
      let latestError;
      for (const item of array2) {
        try {
          return await mapper(item);
        } catch (error48) {
          latestError = error48;
        }
      }
      throw latestError;
    };
    var baseOpen = async (options2) => {
      options2 = {
        wait: false,
        background: false,
        newInstance: false,
        allowNonzeroExitCode: false,
        ...options2
      };
      if (Array.isArray(options2.app)) {
        return pTryEach(options2.app, (singleApp) => baseOpen({
          ...options2,
          app: singleApp
        }));
      }
      let { name: app, arguments: appArguments = [] } = options2.app || {};
      appArguments = [...appArguments];
      if (Array.isArray(app)) {
        return pTryEach(app, (appName) => baseOpen({
          ...options2,
          app: {
            name: appName,
            arguments: appArguments
          }
        }));
      }
      let command;
      const cliArguments = [];
      const childProcessOptions = {};
      if (platform === "darwin") {
        command = "open";
        if (options2.wait) {
          cliArguments.push("--wait-apps");
        }
        if (options2.background) {
          cliArguments.push("--background");
        }
        if (options2.newInstance) {
          cliArguments.push("--new");
        }
        if (app) {
          cliArguments.push("-a", app);
        }
      } else if (platform === "win32" || isWsl && !isDocker()) {
        const mountPoint = await getWslDrivesMountPoint();
        command = isWsl ? `${mountPoint}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe` : `${process.env.SYSTEMROOT}\\System32\\WindowsPowerShell\\v1.0\\powershell`;
        cliArguments.push(
          "-NoProfile",
          "-NonInteractive",
          "\u2013ExecutionPolicy",
          "Bypass",
          "-EncodedCommand"
        );
        if (!isWsl) {
          childProcessOptions.windowsVerbatimArguments = true;
        }
        const encodedArguments = ["Start"];
        if (options2.wait) {
          encodedArguments.push("-Wait");
        }
        if (app) {
          encodedArguments.push(`"\`"${app}\`""`, "-ArgumentList");
          if (options2.target) {
            appArguments.unshift(options2.target);
          }
        } else if (options2.target) {
          encodedArguments.push(`"${options2.target}"`);
        }
        if (appArguments.length > 0) {
          appArguments = appArguments.map((arg) => `"\`"${arg}\`""`);
          encodedArguments.push(appArguments.join(","));
        }
        options2.target = Buffer.from(encodedArguments.join(" "), "utf16le").toString("base64");
      } else {
        if (app) {
          command = app;
        } else {
          const isBundled = !__dirname || __dirname === "/";
          let exeLocalXdgOpen = false;
          try {
            await fs.access(localXdgOpenPath, fsConstants.X_OK);
            exeLocalXdgOpen = true;
          } catch {
          }
          const useSystemXdgOpen = process.versions.electron || platform === "android" || isBundled || !exeLocalXdgOpen;
          command = useSystemXdgOpen ? "xdg-open" : localXdgOpenPath;
        }
        if (appArguments.length > 0) {
          cliArguments.push(...appArguments);
        }
        if (!options2.wait) {
          childProcessOptions.stdio = "ignore";
          childProcessOptions.detached = true;
        }
      }
      if (options2.target) {
        cliArguments.push(options2.target);
      }
      if (platform === "darwin" && appArguments.length > 0) {
        cliArguments.push("--args", ...appArguments);
      }
      const subprocess = childProcess.spawn(command, cliArguments, childProcessOptions);
      if (options2.wait) {
        return new Promise((resolve, reject) => {
          subprocess.once("error", reject);
          subprocess.once("close", (exitCode) => {
            if (options2.allowNonzeroExitCode && exitCode > 0) {
              reject(new Error(`Exited with code ${exitCode}`));
              return;
            }
            resolve(subprocess);
          });
        });
      }
      subprocess.unref();
      return subprocess;
    };
    var open2 = (target, options2) => {
      if (typeof target !== "string") {
        throw new TypeError("Expected a `target`");
      }
      return baseOpen({
        ...options2,
        target
      });
    };
    var openApp = (name, options2) => {
      if (typeof name !== "string") {
        throw new TypeError("Expected a `name`");
      }
      const { arguments: appArguments = [] } = options2 || {};
      if (appArguments !== void 0 && appArguments !== null && !Array.isArray(appArguments)) {
        throw new TypeError("Expected `appArguments` as Array type");
      }
      return baseOpen({
        ...options2,
        app: {
          name,
          arguments: appArguments
        }
      });
    };
    function detectArchBinary(binary) {
      if (typeof binary === "string" || Array.isArray(binary)) {
        return binary;
      }
      const { [arch]: archBinary } = binary;
      if (!archBinary) {
        throw new Error(`${arch} is not supported`);
      }
      return archBinary;
    }
    function detectPlatformBinary({ [platform]: platformBinary }, { wsl }) {
      if (wsl && isWsl) {
        return detectArchBinary(wsl);
      }
      if (!platformBinary) {
        throw new Error(`${platform} is not supported`);
      }
      return detectArchBinary(platformBinary);
    }
    var apps = {};
    defineLazyProperty(apps, "chrome", () => detectPlatformBinary({
      darwin: "google chrome",
      win32: "chrome",
      linux: ["google-chrome", "google-chrome-stable", "chromium"]
    }, {
      wsl: {
        ia32: "/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe",
        x64: ["/mnt/c/Program Files/Google/Chrome/Application/chrome.exe", "/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"]
      }
    }));
    defineLazyProperty(apps, "firefox", () => detectPlatformBinary({
      darwin: "firefox",
      win32: "C:\\Program Files\\Mozilla Firefox\\firefox.exe",
      linux: "firefox"
    }, {
      wsl: "/mnt/c/Program Files/Mozilla Firefox/firefox.exe"
    }));
    defineLazyProperty(apps, "edge", () => detectPlatformBinary({
      darwin: "microsoft edge",
      win32: "msedge",
      linux: ["microsoft-edge", "microsoft-edge-dev"]
    }, {
      wsl: "/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"
    }));
    open2.apps = apps;
    open2.openApp = openApp;
    module2.exports = open2;
  }
});

// node_modules/pngjs/lib/chunkstream.js
var require_chunkstream = __commonJS({
  "node_modules/pngjs/lib/chunkstream.js"(exports2, module2) {
    "use strict";
    var util2 = require("util");
    var Stream = require("stream");
    var ChunkStream = module2.exports = function() {
      Stream.call(this);
      this._buffers = [];
      this._buffered = 0;
      this._reads = [];
      this._paused = false;
      this._encoding = "utf8";
      this.writable = true;
    };
    util2.inherits(ChunkStream, Stream);
    ChunkStream.prototype.read = function(length, callback) {
      this._reads.push({
        length: Math.abs(length),
        // if length < 0 then at most this length
        allowLess: length < 0,
        func: callback
      });
      process.nextTick(
        function() {
          this._process();
          if (this._paused && this._reads && this._reads.length > 0) {
            this._paused = false;
            this.emit("drain");
          }
        }.bind(this)
      );
    };
    ChunkStream.prototype.write = function(data, encoding) {
      if (!this.writable) {
        this.emit("error", new Error("Stream not writable"));
        return false;
      }
      let dataBuffer;
      if (Buffer.isBuffer(data)) {
        dataBuffer = data;
      } else {
        dataBuffer = Buffer.from(data, encoding || this._encoding);
      }
      this._buffers.push(dataBuffer);
      this._buffered += dataBuffer.length;
      this._process();
      if (this._reads && this._reads.length === 0) {
        this._paused = true;
      }
      return this.writable && !this._paused;
    };
    ChunkStream.prototype.end = function(data, encoding) {
      if (data) {
        this.write(data, encoding);
      }
      this.writable = false;
      if (!this._buffers) {
        return;
      }
      if (this._buffers.length === 0) {
        this._end();
      } else {
        this._buffers.push(null);
        this._process();
      }
    };
    ChunkStream.prototype.destroySoon = ChunkStream.prototype.end;
    ChunkStream.prototype._end = function() {
      if (this._reads.length > 0) {
        this.emit("error", new Error("Unexpected end of input"));
      }
      this.destroy();
    };
    ChunkStream.prototype.destroy = function() {
      if (!this._buffers) {
        return;
      }
      this.writable = false;
      this._reads = null;
      this._buffers = null;
      this.emit("close");
    };
    ChunkStream.prototype._processReadAllowingLess = function(read) {
      this._reads.shift();
      let smallerBuf = this._buffers[0];
      if (smallerBuf.length > read.length) {
        this._buffered -= read.length;
        this._buffers[0] = smallerBuf.slice(read.length);
        read.func.call(this, smallerBuf.slice(0, read.length));
      } else {
        this._buffered -= smallerBuf.length;
        this._buffers.shift();
        read.func.call(this, smallerBuf);
      }
    };
    ChunkStream.prototype._processRead = function(read) {
      this._reads.shift();
      let pos = 0;
      let count = 0;
      let data = Buffer.alloc(read.length);
      while (pos < read.length) {
        let buf = this._buffers[count++];
        let len = Math.min(buf.length, read.length - pos);
        buf.copy(data, pos, 0, len);
        pos += len;
        if (len !== buf.length) {
          this._buffers[--count] = buf.slice(len);
        }
      }
      if (count > 0) {
        this._buffers.splice(0, count);
      }
      this._buffered -= read.length;
      read.func.call(this, data);
    };
    ChunkStream.prototype._process = function() {
      try {
        while (this._buffered > 0 && this._reads && this._reads.length > 0) {
          let read = this._reads[0];
          if (read.allowLess) {
            this._processReadAllowingLess(read);
          } else if (this._buffered >= read.length) {
            this._processRead(read);
          } else {
            break;
          }
        }
        if (this._buffers && !this.writable) {
          this._end();
        }
      } catch (ex) {
        this.emit("error", ex);
      }
    };
  }
});

// node_modules/pngjs/lib/interlace.js
var require_interlace = __commonJS({
  "node_modules/pngjs/lib/interlace.js"(exports2) {
    "use strict";
    var imagePasses = [
      {
        // pass 1 - 1px
        x: [0],
        y: [0]
      },
      {
        // pass 2 - 1px
        x: [4],
        y: [0]
      },
      {
        // pass 3 - 2px
        x: [0, 4],
        y: [4]
      },
      {
        // pass 4 - 4px
        x: [2, 6],
        y: [0, 4]
      },
      {
        // pass 5 - 8px
        x: [0, 2, 4, 6],
        y: [2, 6]
      },
      {
        // pass 6 - 16px
        x: [1, 3, 5, 7],
        y: [0, 2, 4, 6]
      },
      {
        // pass 7 - 32px
        x: [0, 1, 2, 3, 4, 5, 6, 7],
        y: [1, 3, 5, 7]
      }
    ];
    exports2.getImagePasses = function(width, height) {
      let images = [];
      let xLeftOver = width % 8;
      let yLeftOver = height % 8;
      let xRepeats = (width - xLeftOver) / 8;
      let yRepeats = (height - yLeftOver) / 8;
      for (let i = 0; i < imagePasses.length; i++) {
        let pass = imagePasses[i];
        let passWidth = xRepeats * pass.x.length;
        let passHeight = yRepeats * pass.y.length;
        for (let j = 0; j < pass.x.length; j++) {
          if (pass.x[j] < xLeftOver) {
            passWidth++;
          } else {
            break;
          }
        }
        for (let j = 0; j < pass.y.length; j++) {
          if (pass.y[j] < yLeftOver) {
            passHeight++;
          } else {
            break;
          }
        }
        if (passWidth > 0 && passHeight > 0) {
          images.push({ width: passWidth, height: passHeight, index: i });
        }
      }
      return images;
    };
    exports2.getInterlaceIterator = function(width) {
      return function(x, y, pass) {
        let outerXLeftOver = x % imagePasses[pass].x.length;
        let outerX = (x - outerXLeftOver) / imagePasses[pass].x.length * 8 + imagePasses[pass].x[outerXLeftOver];
        let outerYLeftOver = y % imagePasses[pass].y.length;
        let outerY = (y - outerYLeftOver) / imagePasses[pass].y.length * 8 + imagePasses[pass].y[outerYLeftOver];
        return outerX * 4 + outerY * width * 4;
      };
    };
  }
});

// node_modules/pngjs/lib/paeth-predictor.js
var require_paeth_predictor = __commonJS({
  "node_modules/pngjs/lib/paeth-predictor.js"(exports2, module2) {
    "use strict";
    module2.exports = function paethPredictor(left, above, upLeft) {
      let paeth = left + above - upLeft;
      let pLeft = Math.abs(paeth - left);
      let pAbove = Math.abs(paeth - above);
      let pUpLeft = Math.abs(paeth - upLeft);
      if (pLeft <= pAbove && pLeft <= pUpLeft) {
        return left;
      }
      if (pAbove <= pUpLeft) {
        return above;
      }
      return upLeft;
    };
  }
});

// node_modules/pngjs/lib/filter-parse.js
var require_filter_parse = __commonJS({
  "node_modules/pngjs/lib/filter-parse.js"(exports2, module2) {
    "use strict";
    var interlaceUtils = require_interlace();
    var paethPredictor = require_paeth_predictor();
    function getByteWidth(width, bpp, depth) {
      let byteWidth = width * bpp;
      if (depth !== 8) {
        byteWidth = Math.ceil(byteWidth / (8 / depth));
      }
      return byteWidth;
    }
    var Filter = module2.exports = function(bitmapInfo, dependencies) {
      let width = bitmapInfo.width;
      let height = bitmapInfo.height;
      let interlace = bitmapInfo.interlace;
      let bpp = bitmapInfo.bpp;
      let depth = bitmapInfo.depth;
      this.read = dependencies.read;
      this.write = dependencies.write;
      this.complete = dependencies.complete;
      this._imageIndex = 0;
      this._images = [];
      if (interlace) {
        let passes = interlaceUtils.getImagePasses(width, height);
        for (let i = 0; i < passes.length; i++) {
          this._images.push({
            byteWidth: getByteWidth(passes[i].width, bpp, depth),
            height: passes[i].height,
            lineIndex: 0
          });
        }
      } else {
        this._images.push({
          byteWidth: getByteWidth(width, bpp, depth),
          height,
          lineIndex: 0
        });
      }
      if (depth === 8) {
        this._xComparison = bpp;
      } else if (depth === 16) {
        this._xComparison = bpp * 2;
      } else {
        this._xComparison = 1;
      }
    };
    Filter.prototype.start = function() {
      this.read(
        this._images[this._imageIndex].byteWidth + 1,
        this._reverseFilterLine.bind(this)
      );
    };
    Filter.prototype._unFilterType1 = function(rawData, unfilteredLine, byteWidth) {
      let xComparison = this._xComparison;
      let xBiggerThan = xComparison - 1;
      for (let x = 0; x < byteWidth; x++) {
        let rawByte = rawData[1 + x];
        let f1Left = x > xBiggerThan ? unfilteredLine[x - xComparison] : 0;
        unfilteredLine[x] = rawByte + f1Left;
      }
    };
    Filter.prototype._unFilterType2 = function(rawData, unfilteredLine, byteWidth) {
      let lastLine = this._lastLine;
      for (let x = 0; x < byteWidth; x++) {
        let rawByte = rawData[1 + x];
        let f2Up = lastLine ? lastLine[x] : 0;
        unfilteredLine[x] = rawByte + f2Up;
      }
    };
    Filter.prototype._unFilterType3 = function(rawData, unfilteredLine, byteWidth) {
      let xComparison = this._xComparison;
      let xBiggerThan = xComparison - 1;
      let lastLine = this._lastLine;
      for (let x = 0; x < byteWidth; x++) {
        let rawByte = rawData[1 + x];
        let f3Up = lastLine ? lastLine[x] : 0;
        let f3Left = x > xBiggerThan ? unfilteredLine[x - xComparison] : 0;
        let f3Add = Math.floor((f3Left + f3Up) / 2);
        unfilteredLine[x] = rawByte + f3Add;
      }
    };
    Filter.prototype._unFilterType4 = function(rawData, unfilteredLine, byteWidth) {
      let xComparison = this._xComparison;
      let xBiggerThan = xComparison - 1;
      let lastLine = this._lastLine;
      for (let x = 0; x < byteWidth; x++) {
        let rawByte = rawData[1 + x];
        let f4Up = lastLine ? lastLine[x] : 0;
        let f4Left = x > xBiggerThan ? unfilteredLine[x - xComparison] : 0;
        let f4UpLeft = x > xBiggerThan && lastLine ? lastLine[x - xComparison] : 0;
        let f4Add = paethPredictor(f4Left, f4Up, f4UpLeft);
        unfilteredLine[x] = rawByte + f4Add;
      }
    };
    Filter.prototype._reverseFilterLine = function(rawData) {
      let filter = rawData[0];
      let unfilteredLine;
      let currentImage = this._images[this._imageIndex];
      let byteWidth = currentImage.byteWidth;
      if (filter === 0) {
        unfilteredLine = rawData.slice(1, byteWidth + 1);
      } else {
        unfilteredLine = Buffer.alloc(byteWidth);
        switch (filter) {
          case 1:
            this._unFilterType1(rawData, unfilteredLine, byteWidth);
            break;
          case 2:
            this._unFilterType2(rawData, unfilteredLine, byteWidth);
            break;
          case 3:
            this._unFilterType3(rawData, unfilteredLine, byteWidth);
            break;
          case 4:
            this._unFilterType4(rawData, unfilteredLine, byteWidth);
            break;
          default:
            throw new Error("Unrecognised filter type - " + filter);
        }
      }
      this.write(unfilteredLine);
      currentImage.lineIndex++;
      if (currentImage.lineIndex >= currentImage.height) {
        this._lastLine = null;
        this._imageIndex++;
        currentImage = this._images[this._imageIndex];
      } else {
        this._lastLine = unfilteredLine;
      }
      if (currentImage) {
        this.read(currentImage.byteWidth + 1, this._reverseFilterLine.bind(this));
      } else {
        this._lastLine = null;
        this.complete();
      }
    };
  }
});

// node_modules/pngjs/lib/filter-parse-async.js
var require_filter_parse_async = __commonJS({
  "node_modules/pngjs/lib/filter-parse-async.js"(exports2, module2) {
    "use strict";
    var util2 = require("util");
    var ChunkStream = require_chunkstream();
    var Filter = require_filter_parse();
    var FilterAsync = module2.exports = function(bitmapInfo) {
      ChunkStream.call(this);
      let buffers = [];
      let that = this;
      this._filter = new Filter(bitmapInfo, {
        read: this.read.bind(this),
        write: function(buffer) {
          buffers.push(buffer);
        },
        complete: function() {
          that.emit("complete", Buffer.concat(buffers));
        }
      });
      this._filter.start();
    };
    util2.inherits(FilterAsync, ChunkStream);
  }
});

// node_modules/pngjs/lib/constants.js
var require_constants = __commonJS({
  "node_modules/pngjs/lib/constants.js"(exports2, module2) {
    "use strict";
    module2.exports = {
      PNG_SIGNATURE: [137, 80, 78, 71, 13, 10, 26, 10],
      TYPE_IHDR: 1229472850,
      TYPE_IEND: 1229278788,
      TYPE_IDAT: 1229209940,
      TYPE_PLTE: 1347179589,
      TYPE_tRNS: 1951551059,
      // eslint-disable-line camelcase
      TYPE_gAMA: 1732332865,
      // eslint-disable-line camelcase
      // color-type bits
      COLORTYPE_GRAYSCALE: 0,
      COLORTYPE_PALETTE: 1,
      COLORTYPE_COLOR: 2,
      COLORTYPE_ALPHA: 4,
      // e.g. grayscale and alpha
      // color-type combinations
      COLORTYPE_PALETTE_COLOR: 3,
      COLORTYPE_COLOR_ALPHA: 6,
      COLORTYPE_TO_BPP_MAP: {
        0: 1,
        2: 3,
        3: 1,
        4: 2,
        6: 4
      },
      GAMMA_DIVISION: 1e5
    };
  }
});

// node_modules/pngjs/lib/crc.js
var require_crc = __commonJS({
  "node_modules/pngjs/lib/crc.js"(exports2, module2) {
    "use strict";
    var crcTable = [];
    (function() {
      for (let i = 0; i < 256; i++) {
        let currentCrc = i;
        for (let j = 0; j < 8; j++) {
          if (currentCrc & 1) {
            currentCrc = 3988292384 ^ currentCrc >>> 1;
          } else {
            currentCrc = currentCrc >>> 1;
          }
        }
        crcTable[i] = currentCrc;
      }
    })();
    var CrcCalculator = module2.exports = function() {
      this._crc = -1;
    };
    CrcCalculator.prototype.write = function(data) {
      for (let i = 0; i < data.length; i++) {
        this._crc = crcTable[(this._crc ^ data[i]) & 255] ^ this._crc >>> 8;
      }
      return true;
    };
    CrcCalculator.prototype.crc32 = function() {
      return this._crc ^ -1;
    };
    CrcCalculator.crc32 = function(buf) {
      let crc = -1;
      for (let i = 0; i < buf.length; i++) {
        crc = crcTable[(crc ^ buf[i]) & 255] ^ crc >>> 8;
      }
      return crc ^ -1;
    };
  }
});

// node_modules/pngjs/lib/parser.js
var require_parser = __commonJS({
  "node_modules/pngjs/lib/parser.js"(exports2, module2) {
    "use strict";
    var constants = require_constants();
    var CrcCalculator = require_crc();
    var Parser = module2.exports = function(options2, dependencies) {
      this._options = options2;
      options2.checkCRC = options2.checkCRC !== false;
      this._hasIHDR = false;
      this._hasIEND = false;
      this._emittedHeadersFinished = false;
      this._palette = [];
      this._colorType = 0;
      this._chunks = {};
      this._chunks[constants.TYPE_IHDR] = this._handleIHDR.bind(this);
      this._chunks[constants.TYPE_IEND] = this._handleIEND.bind(this);
      this._chunks[constants.TYPE_IDAT] = this._handleIDAT.bind(this);
      this._chunks[constants.TYPE_PLTE] = this._handlePLTE.bind(this);
      this._chunks[constants.TYPE_tRNS] = this._handleTRNS.bind(this);
      this._chunks[constants.TYPE_gAMA] = this._handleGAMA.bind(this);
      this.read = dependencies.read;
      this.error = dependencies.error;
      this.metadata = dependencies.metadata;
      this.gamma = dependencies.gamma;
      this.transColor = dependencies.transColor;
      this.palette = dependencies.palette;
      this.parsed = dependencies.parsed;
      this.inflateData = dependencies.inflateData;
      this.finished = dependencies.finished;
      this.simpleTransparency = dependencies.simpleTransparency;
      this.headersFinished = dependencies.headersFinished || function() {
      };
    };
    Parser.prototype.start = function() {
      this.read(constants.PNG_SIGNATURE.length, this._parseSignature.bind(this));
    };
    Parser.prototype._parseSignature = function(data) {
      let signature = constants.PNG_SIGNATURE;
      for (let i = 0; i < signature.length; i++) {
        if (data[i] !== signature[i]) {
          this.error(new Error("Invalid file signature"));
          return;
        }
      }
      this.read(8, this._parseChunkBegin.bind(this));
    };
    Parser.prototype._parseChunkBegin = function(data) {
      let length = data.readUInt32BE(0);
      let type = data.readUInt32BE(4);
      let name = "";
      for (let i = 4; i < 8; i++) {
        name += String.fromCharCode(data[i]);
      }
      let ancillary = Boolean(data[4] & 32);
      if (!this._hasIHDR && type !== constants.TYPE_IHDR) {
        this.error(new Error("Expected IHDR on beggining"));
        return;
      }
      this._crc = new CrcCalculator();
      this._crc.write(Buffer.from(name));
      if (this._chunks[type]) {
        return this._chunks[type](length);
      }
      if (!ancillary) {
        this.error(new Error("Unsupported critical chunk type " + name));
        return;
      }
      this.read(length + 4, this._skipChunk.bind(this));
    };
    Parser.prototype._skipChunk = function() {
      this.read(8, this._parseChunkBegin.bind(this));
    };
    Parser.prototype._handleChunkEnd = function() {
      this.read(4, this._parseChunkEnd.bind(this));
    };
    Parser.prototype._parseChunkEnd = function(data) {
      let fileCrc = data.readInt32BE(0);
      let calcCrc = this._crc.crc32();
      if (this._options.checkCRC && calcCrc !== fileCrc) {
        this.error(new Error("Crc error - " + fileCrc + " - " + calcCrc));
        return;
      }
      if (!this._hasIEND) {
        this.read(8, this._parseChunkBegin.bind(this));
      }
    };
    Parser.prototype._handleIHDR = function(length) {
      this.read(length, this._parseIHDR.bind(this));
    };
    Parser.prototype._parseIHDR = function(data) {
      this._crc.write(data);
      let width = data.readUInt32BE(0);
      let height = data.readUInt32BE(4);
      let depth = data[8];
      let colorType = data[9];
      let compr = data[10];
      let filter = data[11];
      let interlace = data[12];
      if (depth !== 8 && depth !== 4 && depth !== 2 && depth !== 1 && depth !== 16) {
        this.error(new Error("Unsupported bit depth " + depth));
        return;
      }
      if (!(colorType in constants.COLORTYPE_TO_BPP_MAP)) {
        this.error(new Error("Unsupported color type"));
        return;
      }
      if (compr !== 0) {
        this.error(new Error("Unsupported compression method"));
        return;
      }
      if (filter !== 0) {
        this.error(new Error("Unsupported filter method"));
        return;
      }
      if (interlace !== 0 && interlace !== 1) {
        this.error(new Error("Unsupported interlace method"));
        return;
      }
      this._colorType = colorType;
      let bpp = constants.COLORTYPE_TO_BPP_MAP[this._colorType];
      this._hasIHDR = true;
      this.metadata({
        width,
        height,
        depth,
        interlace: Boolean(interlace),
        palette: Boolean(colorType & constants.COLORTYPE_PALETTE),
        color: Boolean(colorType & constants.COLORTYPE_COLOR),
        alpha: Boolean(colorType & constants.COLORTYPE_ALPHA),
        bpp,
        colorType
      });
      this._handleChunkEnd();
    };
    Parser.prototype._handlePLTE = function(length) {
      this.read(length, this._parsePLTE.bind(this));
    };
    Parser.prototype._parsePLTE = function(data) {
      this._crc.write(data);
      let entries = Math.floor(data.length / 3);
      for (let i = 0; i < entries; i++) {
        this._palette.push([data[i * 3], data[i * 3 + 1], data[i * 3 + 2], 255]);
      }
      this.palette(this._palette);
      this._handleChunkEnd();
    };
    Parser.prototype._handleTRNS = function(length) {
      this.simpleTransparency();
      this.read(length, this._parseTRNS.bind(this));
    };
    Parser.prototype._parseTRNS = function(data) {
      this._crc.write(data);
      if (this._colorType === constants.COLORTYPE_PALETTE_COLOR) {
        if (this._palette.length === 0) {
          this.error(new Error("Transparency chunk must be after palette"));
          return;
        }
        if (data.length > this._palette.length) {
          this.error(new Error("More transparent colors than palette size"));
          return;
        }
        for (let i = 0; i < data.length; i++) {
          this._palette[i][3] = data[i];
        }
        this.palette(this._palette);
      }
      if (this._colorType === constants.COLORTYPE_GRAYSCALE) {
        this.transColor([data.readUInt16BE(0)]);
      }
      if (this._colorType === constants.COLORTYPE_COLOR) {
        this.transColor([
          data.readUInt16BE(0),
          data.readUInt16BE(2),
          data.readUInt16BE(4)
        ]);
      }
      this._handleChunkEnd();
    };
    Parser.prototype._handleGAMA = function(length) {
      this.read(length, this._parseGAMA.bind(this));
    };
    Parser.prototype._parseGAMA = function(data) {
      this._crc.write(data);
      this.gamma(data.readUInt32BE(0) / constants.GAMMA_DIVISION);
      this._handleChunkEnd();
    };
    Parser.prototype._handleIDAT = function(length) {
      if (!this._emittedHeadersFinished) {
        this._emittedHeadersFinished = true;
        this.headersFinished();
      }
      this.read(-length, this._parseIDAT.bind(this, length));
    };
    Parser.prototype._parseIDAT = function(length, data) {
      this._crc.write(data);
      if (this._colorType === constants.COLORTYPE_PALETTE_COLOR && this._palette.length === 0) {
        throw new Error("Expected palette not found");
      }
      this.inflateData(data);
      let leftOverLength = length - data.length;
      if (leftOverLength > 0) {
        this._handleIDAT(leftOverLength);
      } else {
        this._handleChunkEnd();
      }
    };
    Parser.prototype._handleIEND = function(length) {
      this.read(length, this._parseIEND.bind(this));
    };
    Parser.prototype._parseIEND = function(data) {
      this._crc.write(data);
      this._hasIEND = true;
      this._handleChunkEnd();
      if (this.finished) {
        this.finished();
      }
    };
  }
});

// node_modules/pngjs/lib/bitmapper.js
var require_bitmapper = __commonJS({
  "node_modules/pngjs/lib/bitmapper.js"(exports2) {
    "use strict";
    var interlaceUtils = require_interlace();
    var pixelBppMapper = [
      // 0 - dummy entry
      function() {
      },
      // 1 - L
      // 0: 0, 1: 0, 2: 0, 3: 0xff
      function(pxData, data, pxPos, rawPos) {
        if (rawPos === data.length) {
          throw new Error("Ran out of data");
        }
        let pixel = data[rawPos];
        pxData[pxPos] = pixel;
        pxData[pxPos + 1] = pixel;
        pxData[pxPos + 2] = pixel;
        pxData[pxPos + 3] = 255;
      },
      // 2 - LA
      // 0: 0, 1: 0, 2: 0, 3: 1
      function(pxData, data, pxPos, rawPos) {
        if (rawPos + 1 >= data.length) {
          throw new Error("Ran out of data");
        }
        let pixel = data[rawPos];
        pxData[pxPos] = pixel;
        pxData[pxPos + 1] = pixel;
        pxData[pxPos + 2] = pixel;
        pxData[pxPos + 3] = data[rawPos + 1];
      },
      // 3 - RGB
      // 0: 0, 1: 1, 2: 2, 3: 0xff
      function(pxData, data, pxPos, rawPos) {
        if (rawPos + 2 >= data.length) {
          throw new Error("Ran out of data");
        }
        pxData[pxPos] = data[rawPos];
        pxData[pxPos + 1] = data[rawPos + 1];
        pxData[pxPos + 2] = data[rawPos + 2];
        pxData[pxPos + 3] = 255;
      },
      // 4 - RGBA
      // 0: 0, 1: 1, 2: 2, 3: 3
      function(pxData, data, pxPos, rawPos) {
        if (rawPos + 3 >= data.length) {
          throw new Error("Ran out of data");
        }
        pxData[pxPos] = data[rawPos];
        pxData[pxPos + 1] = data[rawPos + 1];
        pxData[pxPos + 2] = data[rawPos + 2];
        pxData[pxPos + 3] = data[rawPos + 3];
      }
    ];
    var pixelBppCustomMapper = [
      // 0 - dummy entry
      function() {
      },
      // 1 - L
      // 0: 0, 1: 0, 2: 0, 3: 0xff
      function(pxData, pixelData, pxPos, maxBit) {
        let pixel = pixelData[0];
        pxData[pxPos] = pixel;
        pxData[pxPos + 1] = pixel;
        pxData[pxPos + 2] = pixel;
        pxData[pxPos + 3] = maxBit;
      },
      // 2 - LA
      // 0: 0, 1: 0, 2: 0, 3: 1
      function(pxData, pixelData, pxPos) {
        let pixel = pixelData[0];
        pxData[pxPos] = pixel;
        pxData[pxPos + 1] = pixel;
        pxData[pxPos + 2] = pixel;
        pxData[pxPos + 3] = pixelData[1];
      },
      // 3 - RGB
      // 0: 0, 1: 1, 2: 2, 3: 0xff
      function(pxData, pixelData, pxPos, maxBit) {
        pxData[pxPos] = pixelData[0];
        pxData[pxPos + 1] = pixelData[1];
        pxData[pxPos + 2] = pixelData[2];
        pxData[pxPos + 3] = maxBit;
      },
      // 4 - RGBA
      // 0: 0, 1: 1, 2: 2, 3: 3
      function(pxData, pixelData, pxPos) {
        pxData[pxPos] = pixelData[0];
        pxData[pxPos + 1] = pixelData[1];
        pxData[pxPos + 2] = pixelData[2];
        pxData[pxPos + 3] = pixelData[3];
      }
    ];
    function bitRetriever(data, depth) {
      let leftOver = [];
      let i = 0;
      function split() {
        if (i === data.length) {
          throw new Error("Ran out of data");
        }
        let byte = data[i];
        i++;
        let byte8, byte7, byte6, byte5, byte4, byte3, byte2, byte1;
        switch (depth) {
          default:
            throw new Error("unrecognised depth");
          case 16:
            byte2 = data[i];
            i++;
            leftOver.push((byte << 8) + byte2);
            break;
          case 4:
            byte2 = byte & 15;
            byte1 = byte >> 4;
            leftOver.push(byte1, byte2);
            break;
          case 2:
            byte4 = byte & 3;
            byte3 = byte >> 2 & 3;
            byte2 = byte >> 4 & 3;
            byte1 = byte >> 6 & 3;
            leftOver.push(byte1, byte2, byte3, byte4);
            break;
          case 1:
            byte8 = byte & 1;
            byte7 = byte >> 1 & 1;
            byte6 = byte >> 2 & 1;
            byte5 = byte >> 3 & 1;
            byte4 = byte >> 4 & 1;
            byte3 = byte >> 5 & 1;
            byte2 = byte >> 6 & 1;
            byte1 = byte >> 7 & 1;
            leftOver.push(byte1, byte2, byte3, byte4, byte5, byte6, byte7, byte8);
            break;
        }
      }
      return {
        get: function(count) {
          while (leftOver.length < count) {
            split();
          }
          let returner = leftOver.slice(0, count);
          leftOver = leftOver.slice(count);
          return returner;
        },
        resetAfterLine: function() {
          leftOver.length = 0;
        },
        end: function() {
          if (i !== data.length) {
            throw new Error("extra data found");
          }
        }
      };
    }
    function mapImage8Bit(image, pxData, getPxPos, bpp, data, rawPos) {
      let imageWidth = image.width;
      let imageHeight = image.height;
      let imagePass = image.index;
      for (let y = 0; y < imageHeight; y++) {
        for (let x = 0; x < imageWidth; x++) {
          let pxPos = getPxPos(x, y, imagePass);
          pixelBppMapper[bpp](pxData, data, pxPos, rawPos);
          rawPos += bpp;
        }
      }
      return rawPos;
    }
    function mapImageCustomBit(image, pxData, getPxPos, bpp, bits, maxBit) {
      let imageWidth = image.width;
      let imageHeight = image.height;
      let imagePass = image.index;
      for (let y = 0; y < imageHeight; y++) {
        for (let x = 0; x < imageWidth; x++) {
          let pixelData = bits.get(bpp);
          let pxPos = getPxPos(x, y, imagePass);
          pixelBppCustomMapper[bpp](pxData, pixelData, pxPos, maxBit);
        }
        bits.resetAfterLine();
      }
    }
    exports2.dataToBitMap = function(data, bitmapInfo) {
      let width = bitmapInfo.width;
      let height = bitmapInfo.height;
      let depth = bitmapInfo.depth;
      let bpp = bitmapInfo.bpp;
      let interlace = bitmapInfo.interlace;
      let bits;
      if (depth !== 8) {
        bits = bitRetriever(data, depth);
      }
      let pxData;
      if (depth <= 8) {
        pxData = Buffer.alloc(width * height * 4);
      } else {
        pxData = new Uint16Array(width * height * 4);
      }
      let maxBit = Math.pow(2, depth) - 1;
      let rawPos = 0;
      let images;
      let getPxPos;
      if (interlace) {
        images = interlaceUtils.getImagePasses(width, height);
        getPxPos = interlaceUtils.getInterlaceIterator(width, height);
      } else {
        let nonInterlacedPxPos = 0;
        getPxPos = function() {
          let returner = nonInterlacedPxPos;
          nonInterlacedPxPos += 4;
          return returner;
        };
        images = [{ width, height }];
      }
      for (let imageIndex = 0; imageIndex < images.length; imageIndex++) {
        if (depth === 8) {
          rawPos = mapImage8Bit(
            images[imageIndex],
            pxData,
            getPxPos,
            bpp,
            data,
            rawPos
          );
        } else {
          mapImageCustomBit(
            images[imageIndex],
            pxData,
            getPxPos,
            bpp,
            bits,
            maxBit
          );
        }
      }
      if (depth === 8) {
        if (rawPos !== data.length) {
          throw new Error("extra data found");
        }
      } else {
        bits.end();
      }
      return pxData;
    };
  }
});

// node_modules/pngjs/lib/format-normaliser.js
var require_format_normaliser = __commonJS({
  "node_modules/pngjs/lib/format-normaliser.js"(exports2, module2) {
    "use strict";
    function dePalette(indata, outdata, width, height, palette) {
      let pxPos = 0;
      for (let y = 0; y < height; y++) {
        for (let x = 0; x < width; x++) {
          let color = palette[indata[pxPos]];
          if (!color) {
            throw new Error("index " + indata[pxPos] + " not in palette");
          }
          for (let i = 0; i < 4; i++) {
            outdata[pxPos + i] = color[i];
          }
          pxPos += 4;
        }
      }
    }
    function replaceTransparentColor(indata, outdata, width, height, transColor) {
      let pxPos = 0;
      for (let y = 0; y < height; y++) {
        for (let x = 0; x < width; x++) {
          let makeTrans = false;
          if (transColor.length === 1) {
            if (transColor[0] === indata[pxPos]) {
              makeTrans = true;
            }
          } else if (transColor[0] === indata[pxPos] && transColor[1] === indata[pxPos + 1] && transColor[2] === indata[pxPos + 2]) {
            makeTrans = true;
          }
          if (makeTrans) {
            for (let i = 0; i < 4; i++) {
              outdata[pxPos + i] = 0;
            }
          }
          pxPos += 4;
        }
      }
    }
    function scaleDepth(indata, outdata, width, height, depth) {
      let maxOutSample = 255;
      let maxInSample = Math.pow(2, depth) - 1;
      let pxPos = 0;
      for (let y = 0; y < height; y++) {
        for (let x = 0; x < width; x++) {
          for (let i = 0; i < 4; i++) {
            outdata[pxPos + i] = Math.floor(
              indata[pxPos + i] * maxOutSample / maxInSample + 0.5
            );
          }
          pxPos += 4;
        }
      }
    }
    module2.exports = function(indata, imageData, skipRescale = false) {
      let depth = imageData.depth;
      let width = imageData.width;
      let height = imageData.height;
      let colorType = imageData.colorType;
      let transColor = imageData.transColor;
      let palette = imageData.palette;
      let outdata = indata;
      if (colorType === 3) {
        dePalette(indata, outdata, width, height, palette);
      } else {
        if (transColor) {
          replaceTransparentColor(indata, outdata, width, height, transColor);
        }
        if (depth !== 8 && !skipRescale) {
          if (depth === 16) {
            outdata = Buffer.alloc(width * height * 4);
          }
          scaleDepth(indata, outdata, width, height, depth);
        }
      }
      return outdata;
    };
  }
});

// node_modules/pngjs/lib/parser-async.js
var require_parser_async = __commonJS({
  "node_modules/pngjs/lib/parser-async.js"(exports2, module2) {
    "use strict";
    var util2 = require("util");
    var zlib = require("zlib");
    var ChunkStream = require_chunkstream();
    var FilterAsync = require_filter_parse_async();
    var Parser = require_parser();
    var bitmapper = require_bitmapper();
    var formatNormaliser = require_format_normaliser();
    var ParserAsync = module2.exports = function(options2) {
      ChunkStream.call(this);
      this._parser = new Parser(options2, {
        read: this.read.bind(this),
        error: this._handleError.bind(this),
        metadata: this._handleMetaData.bind(this),
        gamma: this.emit.bind(this, "gamma"),
        palette: this._handlePalette.bind(this),
        transColor: this._handleTransColor.bind(this),
        finished: this._finished.bind(this),
        inflateData: this._inflateData.bind(this),
        simpleTransparency: this._simpleTransparency.bind(this),
        headersFinished: this._headersFinished.bind(this)
      });
      this._options = options2;
      this.writable = true;
      this._parser.start();
    };
    util2.inherits(ParserAsync, ChunkStream);
    ParserAsync.prototype._handleError = function(err) {
      this.emit("error", err);
      this.writable = false;
      this.destroy();
      if (this._inflate && this._inflate.destroy) {
        this._inflate.destroy();
      }
      if (this._filter) {
        this._filter.destroy();
        this._filter.on("error", function() {
        });
      }
      this.errord = true;
    };
    ParserAsync.prototype._inflateData = function(data) {
      if (!this._inflate) {
        if (this._bitmapInfo.interlace) {
          this._inflate = zlib.createInflate();
          this._inflate.on("error", this.emit.bind(this, "error"));
          this._filter.on("complete", this._complete.bind(this));
          this._inflate.pipe(this._filter);
        } else {
          let rowSize = (this._bitmapInfo.width * this._bitmapInfo.bpp * this._bitmapInfo.depth + 7 >> 3) + 1;
          let imageSize = rowSize * this._bitmapInfo.height;
          let chunkSize = Math.max(imageSize, zlib.Z_MIN_CHUNK);
          this._inflate = zlib.createInflate({ chunkSize });
          let leftToInflate = imageSize;
          let emitError = this.emit.bind(this, "error");
          this._inflate.on("error", function(err) {
            if (!leftToInflate) {
              return;
            }
            emitError(err);
          });
          this._filter.on("complete", this._complete.bind(this));
          let filterWrite = this._filter.write.bind(this._filter);
          this._inflate.on("data", function(chunk) {
            if (!leftToInflate) {
              return;
            }
            if (chunk.length > leftToInflate) {
              chunk = chunk.slice(0, leftToInflate);
            }
            leftToInflate -= chunk.length;
            filterWrite(chunk);
          });
          this._inflate.on("end", this._filter.end.bind(this._filter));
        }
      }
      this._inflate.write(data);
    };
    ParserAsync.prototype._handleMetaData = function(metaData) {
      this._metaData = metaData;
      this._bitmapInfo = Object.create(metaData);
      this._filter = new FilterAsync(this._bitmapInfo);
    };
    ParserAsync.prototype._handleTransColor = function(transColor) {
      this._bitmapInfo.transColor = transColor;
    };
    ParserAsync.prototype._handlePalette = function(palette) {
      this._bitmapInfo.palette = palette;
    };
    ParserAsync.prototype._simpleTransparency = function() {
      this._metaData.alpha = true;
    };
    ParserAsync.prototype._headersFinished = function() {
      this.emit("metadata", this._metaData);
    };
    ParserAsync.prototype._finished = function() {
      if (this.errord) {
        return;
      }
      if (!this._inflate) {
        this.emit("error", "No Inflate block");
      } else {
        this._inflate.end();
      }
    };
    ParserAsync.prototype._complete = function(filteredData) {
      if (this.errord) {
        return;
      }
      let normalisedBitmapData;
      try {
        let bitmapData = bitmapper.dataToBitMap(filteredData, this._bitmapInfo);
        normalisedBitmapData = formatNormaliser(
          bitmapData,
          this._bitmapInfo,
          this._options.skipRescale
        );
        bitmapData = null;
      } catch (ex) {
        this._handleError(ex);
        return;
      }
      this.emit("parsed", normalisedBitmapData);
    };
  }
});

// node_modules/pngjs/lib/bitpacker.js
var require_bitpacker = __commonJS({
  "node_modules/pngjs/lib/bitpacker.js"(exports2, module2) {
    "use strict";
    var constants = require_constants();
    module2.exports = function(dataIn, width, height, options2) {
      let outHasAlpha = [constants.COLORTYPE_COLOR_ALPHA, constants.COLORTYPE_ALPHA].indexOf(
        options2.colorType
      ) !== -1;
      if (options2.colorType === options2.inputColorType) {
        let bigEndian = (function() {
          let buffer = new ArrayBuffer(2);
          new DataView(buffer).setInt16(
            0,
            256,
            true
            /* littleEndian */
          );
          return new Int16Array(buffer)[0] !== 256;
        })();
        if (options2.bitDepth === 8 || options2.bitDepth === 16 && bigEndian) {
          return dataIn;
        }
      }
      let data = options2.bitDepth !== 16 ? dataIn : new Uint16Array(dataIn.buffer);
      let maxValue = 255;
      let inBpp = constants.COLORTYPE_TO_BPP_MAP[options2.inputColorType];
      if (inBpp === 4 && !options2.inputHasAlpha) {
        inBpp = 3;
      }
      let outBpp = constants.COLORTYPE_TO_BPP_MAP[options2.colorType];
      if (options2.bitDepth === 16) {
        maxValue = 65535;
        outBpp *= 2;
      }
      let outData = Buffer.alloc(width * height * outBpp);
      let inIndex = 0;
      let outIndex = 0;
      let bgColor = options2.bgColor || {};
      if (bgColor.red === void 0) {
        bgColor.red = maxValue;
      }
      if (bgColor.green === void 0) {
        bgColor.green = maxValue;
      }
      if (bgColor.blue === void 0) {
        bgColor.blue = maxValue;
      }
      function getRGBA() {
        let red;
        let green;
        let blue;
        let alpha = maxValue;
        switch (options2.inputColorType) {
          case constants.COLORTYPE_COLOR_ALPHA:
            alpha = data[inIndex + 3];
            red = data[inIndex];
            green = data[inIndex + 1];
            blue = data[inIndex + 2];
            break;
          case constants.COLORTYPE_COLOR:
            red = data[inIndex];
            green = data[inIndex + 1];
            blue = data[inIndex + 2];
            break;
          case constants.COLORTYPE_ALPHA:
            alpha = data[inIndex + 1];
            red = data[inIndex];
            green = red;
            blue = red;
            break;
          case constants.COLORTYPE_GRAYSCALE:
            red = data[inIndex];
            green = red;
            blue = red;
            break;
          default:
            throw new Error(
              "input color type:" + options2.inputColorType + " is not supported at present"
            );
        }
        if (options2.inputHasAlpha) {
          if (!outHasAlpha) {
            alpha /= maxValue;
            red = Math.min(
              Math.max(Math.round((1 - alpha) * bgColor.red + alpha * red), 0),
              maxValue
            );
            green = Math.min(
              Math.max(Math.round((1 - alpha) * bgColor.green + alpha * green), 0),
              maxValue
            );
            blue = Math.min(
              Math.max(Math.round((1 - alpha) * bgColor.blue + alpha * blue), 0),
              maxValue
            );
          }
        }
        return { red, green, blue, alpha };
      }
      for (let y = 0; y < height; y++) {
        for (let x = 0; x < width; x++) {
          let rgba = getRGBA(data, inIndex);
          switch (options2.colorType) {
            case constants.COLORTYPE_COLOR_ALPHA:
            case constants.COLORTYPE_COLOR:
              if (options2.bitDepth === 8) {
                outData[outIndex] = rgba.red;
                outData[outIndex + 1] = rgba.green;
                outData[outIndex + 2] = rgba.blue;
                if (outHasAlpha) {
                  outData[outIndex + 3] = rgba.alpha;
                }
              } else {
                outData.writeUInt16BE(rgba.red, outIndex);
                outData.writeUInt16BE(rgba.green, outIndex + 2);
                outData.writeUInt16BE(rgba.blue, outIndex + 4);
                if (outHasAlpha) {
                  outData.writeUInt16BE(rgba.alpha, outIndex + 6);
                }
              }
              break;
            case constants.COLORTYPE_ALPHA:
            case constants.COLORTYPE_GRAYSCALE: {
              let grayscale = (rgba.red + rgba.green + rgba.blue) / 3;
              if (options2.bitDepth === 8) {
                outData[outIndex] = grayscale;
                if (outHasAlpha) {
                  outData[outIndex + 1] = rgba.alpha;
                }
              } else {
                outData.writeUInt16BE(grayscale, outIndex);
                if (outHasAlpha) {
                  outData.writeUInt16BE(rgba.alpha, outIndex + 2);
                }
              }
              break;
            }
            default:
              throw new Error("unrecognised color Type " + options2.colorType);
          }
          inIndex += inBpp;
          outIndex += outBpp;
        }
      }
      return outData;
    };
  }
});

// node_modules/pngjs/lib/filter-pack.js
var require_filter_pack = __commonJS({
  "node_modules/pngjs/lib/filter-pack.js"(exports2, module2) {
    "use strict";
    var paethPredictor = require_paeth_predictor();
    function filterNone(pxData, pxPos, byteWidth, rawData, rawPos) {
      for (let x = 0; x < byteWidth; x++) {
        rawData[rawPos + x] = pxData[pxPos + x];
      }
    }
    function filterSumNone(pxData, pxPos, byteWidth) {
      let sum = 0;
      let length = pxPos + byteWidth;
      for (let i = pxPos; i < length; i++) {
        sum += Math.abs(pxData[i]);
      }
      return sum;
    }
    function filterSub(pxData, pxPos, byteWidth, rawData, rawPos, bpp) {
      for (let x = 0; x < byteWidth; x++) {
        let left = x >= bpp ? pxData[pxPos + x - bpp] : 0;
        let val = pxData[pxPos + x] - left;
        rawData[rawPos + x] = val;
      }
    }
    function filterSumSub(pxData, pxPos, byteWidth, bpp) {
      let sum = 0;
      for (let x = 0; x < byteWidth; x++) {
        let left = x >= bpp ? pxData[pxPos + x - bpp] : 0;
        let val = pxData[pxPos + x] - left;
        sum += Math.abs(val);
      }
      return sum;
    }
    function filterUp(pxData, pxPos, byteWidth, rawData, rawPos) {
      for (let x = 0; x < byteWidth; x++) {
        let up = pxPos > 0 ? pxData[pxPos + x - byteWidth] : 0;
        let val = pxData[pxPos + x] - up;
        rawData[rawPos + x] = val;
      }
    }
    function filterSumUp(pxData, pxPos, byteWidth) {
      let sum = 0;
      let length = pxPos + byteWidth;
      for (let x = pxPos; x < length; x++) {
        let up = pxPos > 0 ? pxData[x - byteWidth] : 0;
        let val = pxData[x] - up;
        sum += Math.abs(val);
      }
      return sum;
    }
    function filterAvg(pxData, pxPos, byteWidth, rawData, rawPos, bpp) {
      for (let x = 0; x < byteWidth; x++) {
        let left = x >= bpp ? pxData[pxPos + x - bpp] : 0;
        let up = pxPos > 0 ? pxData[pxPos + x - byteWidth] : 0;
        let val = pxData[pxPos + x] - (left + up >> 1);
        rawData[rawPos + x] = val;
      }
    }
    function filterSumAvg(pxData, pxPos, byteWidth, bpp) {
      let sum = 0;
      for (let x = 0; x < byteWidth; x++) {
        let left = x >= bpp ? pxData[pxPos + x - bpp] : 0;
        let up = pxPos > 0 ? pxData[pxPos + x - byteWidth] : 0;
        let val = pxData[pxPos + x] - (left + up >> 1);
        sum += Math.abs(val);
      }
      return sum;
    }
    function filterPaeth(pxData, pxPos, byteWidth, rawData, rawPos, bpp) {
      for (let x = 0; x < byteWidth; x++) {
        let left = x >= bpp ? pxData[pxPos + x - bpp] : 0;
        let up = pxPos > 0 ? pxData[pxPos + x - byteWidth] : 0;
        let upleft = pxPos > 0 && x >= bpp ? pxData[pxPos + x - (byteWidth + bpp)] : 0;
        let val = pxData[pxPos + x] - paethPredictor(left, up, upleft);
        rawData[rawPos + x] = val;
      }
    }
    function filterSumPaeth(pxData, pxPos, byteWidth, bpp) {
      let sum = 0;
      for (let x = 0; x < byteWidth; x++) {
        let left = x >= bpp ? pxData[pxPos + x - bpp] : 0;
        let up = pxPos > 0 ? pxData[pxPos + x - byteWidth] : 0;
        let upleft = pxPos > 0 && x >= bpp ? pxData[pxPos + x - (byteWidth + bpp)] : 0;
        let val = pxData[pxPos + x] - paethPredictor(left, up, upleft);
        sum += Math.abs(val);
      }
      return sum;
    }
    var filters = {
      0: filterNone,
      1: filterSub,
      2: filterUp,
      3: filterAvg,
      4: filterPaeth
    };
    var filterSums = {
      0: filterSumNone,
      1: filterSumSub,
      2: filterSumUp,
      3: filterSumAvg,
      4: filterSumPaeth
    };
    module2.exports = function(pxData, width, height, options2, bpp) {
      let filterTypes;
      if (!("filterType" in options2) || options2.filterType === -1) {
        filterTypes = [0, 1, 2, 3, 4];
      } else if (typeof options2.filterType === "number") {
        filterTypes = [options2.filterType];
      } else {
        throw new Error("unrecognised filter types");
      }
      if (options2.bitDepth === 16) {
        bpp *= 2;
      }
      let byteWidth = width * bpp;
      let rawPos = 0;
      let pxPos = 0;
      let rawData = Buffer.alloc((byteWidth + 1) * height);
      let sel = filterTypes[0];
      for (let y = 0; y < height; y++) {
        if (filterTypes.length > 1) {
          let min = Infinity;
          for (let i = 0; i < filterTypes.length; i++) {
            let sum = filterSums[filterTypes[i]](pxData, pxPos, byteWidth, bpp);
            if (sum < min) {
              sel = filterTypes[i];
              min = sum;
            }
          }
        }
        rawData[rawPos] = sel;
        rawPos++;
        filters[sel](pxData, pxPos, byteWidth, rawData, rawPos, bpp);
        rawPos += byteWidth;
        pxPos += byteWidth;
      }
      return rawData;
    };
  }
});

// node_modules/pngjs/lib/packer.js
var require_packer = __commonJS({
  "node_modules/pngjs/lib/packer.js"(exports2, module2) {
    "use strict";
    var constants = require_constants();
    var CrcStream = require_crc();
    var bitPacker = require_bitpacker();
    var filter = require_filter_pack();
    var zlib = require("zlib");
    var Packer = module2.exports = function(options2) {
      this._options = options2;
      options2.deflateChunkSize = options2.deflateChunkSize || 32 * 1024;
      options2.deflateLevel = options2.deflateLevel != null ? options2.deflateLevel : 9;
      options2.deflateStrategy = options2.deflateStrategy != null ? options2.deflateStrategy : 3;
      options2.inputHasAlpha = options2.inputHasAlpha != null ? options2.inputHasAlpha : true;
      options2.deflateFactory = options2.deflateFactory || zlib.createDeflate;
      options2.bitDepth = options2.bitDepth || 8;
      options2.colorType = typeof options2.colorType === "number" ? options2.colorType : constants.COLORTYPE_COLOR_ALPHA;
      options2.inputColorType = typeof options2.inputColorType === "number" ? options2.inputColorType : constants.COLORTYPE_COLOR_ALPHA;
      if ([
        constants.COLORTYPE_GRAYSCALE,
        constants.COLORTYPE_COLOR,
        constants.COLORTYPE_COLOR_ALPHA,
        constants.COLORTYPE_ALPHA
      ].indexOf(options2.colorType) === -1) {
        throw new Error(
          "option color type:" + options2.colorType + " is not supported at present"
        );
      }
      if ([
        constants.COLORTYPE_GRAYSCALE,
        constants.COLORTYPE_COLOR,
        constants.COLORTYPE_COLOR_ALPHA,
        constants.COLORTYPE_ALPHA
      ].indexOf(options2.inputColorType) === -1) {
        throw new Error(
          "option input color type:" + options2.inputColorType + " is not supported at present"
        );
      }
      if (options2.bitDepth !== 8 && options2.bitDepth !== 16) {
        throw new Error(
          "option bit depth:" + options2.bitDepth + " is not supported at present"
        );
      }
    };
    Packer.prototype.getDeflateOptions = function() {
      return {
        chunkSize: this._options.deflateChunkSize,
        level: this._options.deflateLevel,
        strategy: this._options.deflateStrategy
      };
    };
    Packer.prototype.createDeflate = function() {
      return this._options.deflateFactory(this.getDeflateOptions());
    };
    Packer.prototype.filterData = function(data, width, height) {
      let packedData = bitPacker(data, width, height, this._options);
      let bpp = constants.COLORTYPE_TO_BPP_MAP[this._options.colorType];
      let filteredData = filter(packedData, width, height, this._options, bpp);
      return filteredData;
    };
    Packer.prototype._packChunk = function(type, data) {
      let len = data ? data.length : 0;
      let buf = Buffer.alloc(len + 12);
      buf.writeUInt32BE(len, 0);
      buf.writeUInt32BE(type, 4);
      if (data) {
        data.copy(buf, 8);
      }
      buf.writeInt32BE(
        CrcStream.crc32(buf.slice(4, buf.length - 4)),
        buf.length - 4
      );
      return buf;
    };
    Packer.prototype.packGAMA = function(gamma) {
      let buf = Buffer.alloc(4);
      buf.writeUInt32BE(Math.floor(gamma * constants.GAMMA_DIVISION), 0);
      return this._packChunk(constants.TYPE_gAMA, buf);
    };
    Packer.prototype.packIHDR = function(width, height) {
      let buf = Buffer.alloc(13);
      buf.writeUInt32BE(width, 0);
      buf.writeUInt32BE(height, 4);
      buf[8] = this._options.bitDepth;
      buf[9] = this._options.colorType;
      buf[10] = 0;
      buf[11] = 0;
      buf[12] = 0;
      return this._packChunk(constants.TYPE_IHDR, buf);
    };
    Packer.prototype.packIDAT = function(data) {
      return this._packChunk(constants.TYPE_IDAT, data);
    };
    Packer.prototype.packIEND = function() {
      return this._packChunk(constants.TYPE_IEND, null);
    };
  }
});

// node_modules/pngjs/lib/packer-async.js
var require_packer_async = __commonJS({
  "node_modules/pngjs/lib/packer-async.js"(exports2, module2) {
    "use strict";
    var util2 = require("util");
    var Stream = require("stream");
    var constants = require_constants();
    var Packer = require_packer();
    var PackerAsync = module2.exports = function(opt) {
      Stream.call(this);
      let options2 = opt || {};
      this._packer = new Packer(options2);
      this._deflate = this._packer.createDeflate();
      this.readable = true;
    };
    util2.inherits(PackerAsync, Stream);
    PackerAsync.prototype.pack = function(data, width, height, gamma) {
      this.emit("data", Buffer.from(constants.PNG_SIGNATURE));
      this.emit("data", this._packer.packIHDR(width, height));
      if (gamma) {
        this.emit("data", this._packer.packGAMA(gamma));
      }
      let filteredData = this._packer.filterData(data, width, height);
      this._deflate.on("error", this.emit.bind(this, "error"));
      this._deflate.on(
        "data",
        function(compressedData) {
          this.emit("data", this._packer.packIDAT(compressedData));
        }.bind(this)
      );
      this._deflate.on(
        "end",
        function() {
          this.emit("data", this._packer.packIEND());
          this.emit("end");
        }.bind(this)
      );
      this._deflate.end(filteredData);
    };
  }
});

// node_modules/pngjs/lib/sync-inflate.js
var require_sync_inflate = __commonJS({
  "node_modules/pngjs/lib/sync-inflate.js"(exports2, module2) {
    "use strict";
    var assert2 = require("assert").ok;
    var zlib = require("zlib");
    var util2 = require("util");
    var kMaxLength = require("buffer").kMaxLength;
    function Inflate(opts) {
      if (!(this instanceof Inflate)) {
        return new Inflate(opts);
      }
      if (opts && opts.chunkSize < zlib.Z_MIN_CHUNK) {
        opts.chunkSize = zlib.Z_MIN_CHUNK;
      }
      zlib.Inflate.call(this, opts);
      this._offset = this._offset === void 0 ? this._outOffset : this._offset;
      this._buffer = this._buffer || this._outBuffer;
      if (opts && opts.maxLength != null) {
        this._maxLength = opts.maxLength;
      }
    }
    function createInflate(opts) {
      return new Inflate(opts);
    }
    function _close(engine, callback) {
      if (callback) {
        process.nextTick(callback);
      }
      if (!engine._handle) {
        return;
      }
      engine._handle.close();
      engine._handle = null;
    }
    Inflate.prototype._processChunk = function(chunk, flushFlag, asyncCb) {
      if (typeof asyncCb === "function") {
        return zlib.Inflate._processChunk.call(this, chunk, flushFlag, asyncCb);
      }
      let self = this;
      let availInBefore = chunk && chunk.length;
      let availOutBefore = this._chunkSize - this._offset;
      let leftToInflate = this._maxLength;
      let inOff = 0;
      let buffers = [];
      let nread = 0;
      let error48;
      this.on("error", function(err) {
        error48 = err;
      });
      function handleChunk(availInAfter, availOutAfter) {
        if (self._hadError) {
          return;
        }
        let have = availOutBefore - availOutAfter;
        assert2(have >= 0, "have should not go down");
        if (have > 0) {
          let out = self._buffer.slice(self._offset, self._offset + have);
          self._offset += have;
          if (out.length > leftToInflate) {
            out = out.slice(0, leftToInflate);
          }
          buffers.push(out);
          nread += out.length;
          leftToInflate -= out.length;
          if (leftToInflate === 0) {
            return false;
          }
        }
        if (availOutAfter === 0 || self._offset >= self._chunkSize) {
          availOutBefore = self._chunkSize;
          self._offset = 0;
          self._buffer = Buffer.allocUnsafe(self._chunkSize);
        }
        if (availOutAfter === 0) {
          inOff += availInBefore - availInAfter;
          availInBefore = availInAfter;
          return true;
        }
        return false;
      }
      assert2(this._handle, "zlib binding closed");
      let res;
      do {
        res = this._handle.writeSync(
          flushFlag,
          chunk,
          // in
          inOff,
          // in_off
          availInBefore,
          // in_len
          this._buffer,
          // out
          this._offset,
          //out_off
          availOutBefore
        );
        res = res || this._writeState;
      } while (!this._hadError && handleChunk(res[0], res[1]));
      if (this._hadError) {
        throw error48;
      }
      if (nread >= kMaxLength) {
        _close(this);
        throw new RangeError(
          "Cannot create final Buffer. It would be larger than 0x" + kMaxLength.toString(16) + " bytes"
        );
      }
      let buf = Buffer.concat(buffers, nread);
      _close(this);
      return buf;
    };
    util2.inherits(Inflate, zlib.Inflate);
    function zlibBufferSync(engine, buffer) {
      if (typeof buffer === "string") {
        buffer = Buffer.from(buffer);
      }
      if (!(buffer instanceof Buffer)) {
        throw new TypeError("Not a string or buffer");
      }
      let flushFlag = engine._finishFlushFlag;
      if (flushFlag == null) {
        flushFlag = zlib.Z_FINISH;
      }
      return engine._processChunk(buffer, flushFlag);
    }
    function inflateSync(buffer, opts) {
      return zlibBufferSync(new Inflate(opts), buffer);
    }
    module2.exports = exports2 = inflateSync;
    exports2.Inflate = Inflate;
    exports2.createInflate = createInflate;
    exports2.inflateSync = inflateSync;
  }
});

// node_modules/pngjs/lib/sync-reader.js
var require_sync_reader = __commonJS({
  "node_modules/pngjs/lib/sync-reader.js"(exports2, module2) {
    "use strict";
    var SyncReader = module2.exports = function(buffer) {
      this._buffer = buffer;
      this._reads = [];
    };
    SyncReader.prototype.read = function(length, callback) {
      this._reads.push({
        length: Math.abs(length),
        // if length < 0 then at most this length
        allowLess: length < 0,
        func: callback
      });
    };
    SyncReader.prototype.process = function() {
      while (this._reads.length > 0 && this._buffer.length) {
        let read = this._reads[0];
        if (this._buffer.length && (this._buffer.length >= read.length || read.allowLess)) {
          this._reads.shift();
          let buf = this._buffer;
          this._buffer = buf.slice(read.length);
          read.func.call(this, buf.slice(0, read.length));
        } else {
          break;
        }
      }
      if (this._reads.length > 0) {
        throw new Error("There are some read requests waitng on finished stream");
      }
      if (this._buffer.length > 0) {
        throw new Error("unrecognised content at end of stream");
      }
    };
  }
});

// node_modules/pngjs/lib/filter-parse-sync.js
var require_filter_parse_sync = __commonJS({
  "node_modules/pngjs/lib/filter-parse-sync.js"(exports2) {
    "use strict";
    var SyncReader = require_sync_reader();
    var Filter = require_filter_parse();
    exports2.process = function(inBuffer, bitmapInfo) {
      let outBuffers = [];
      let reader = new SyncReader(inBuffer);
      let filter = new Filter(bitmapInfo, {
        read: reader.read.bind(reader),
        write: function(bufferPart) {
          outBuffers.push(bufferPart);
        },
        complete: function() {
        }
      });
      filter.start();
      reader.process();
      return Buffer.concat(outBuffers);
    };
  }
});

// node_modules/pngjs/lib/parser-sync.js
var require_parser_sync = __commonJS({
  "node_modules/pngjs/lib/parser-sync.js"(exports2, module2) {
    "use strict";
    var hasSyncZlib = true;
    var zlib = require("zlib");
    var inflateSync = require_sync_inflate();
    if (!zlib.deflateSync) {
      hasSyncZlib = false;
    }
    var SyncReader = require_sync_reader();
    var FilterSync = require_filter_parse_sync();
    var Parser = require_parser();
    var bitmapper = require_bitmapper();
    var formatNormaliser = require_format_normaliser();
    module2.exports = function(buffer, options2) {
      if (!hasSyncZlib) {
        throw new Error(
          "To use the sync capability of this library in old node versions, please pin pngjs to v2.3.0"
        );
      }
      let err;
      function handleError(_err_) {
        err = _err_;
      }
      let metaData;
      function handleMetaData(_metaData_) {
        metaData = _metaData_;
      }
      function handleTransColor(transColor) {
        metaData.transColor = transColor;
      }
      function handlePalette(palette) {
        metaData.palette = palette;
      }
      function handleSimpleTransparency() {
        metaData.alpha = true;
      }
      let gamma;
      function handleGamma(_gamma_) {
        gamma = _gamma_;
      }
      let inflateDataList = [];
      function handleInflateData(inflatedData2) {
        inflateDataList.push(inflatedData2);
      }
      let reader = new SyncReader(buffer);
      let parser = new Parser(options2, {
        read: reader.read.bind(reader),
        error: handleError,
        metadata: handleMetaData,
        gamma: handleGamma,
        palette: handlePalette,
        transColor: handleTransColor,
        inflateData: handleInflateData,
        simpleTransparency: handleSimpleTransparency
      });
      parser.start();
      reader.process();
      if (err) {
        throw err;
      }
      let inflateData = Buffer.concat(inflateDataList);
      inflateDataList.length = 0;
      let inflatedData;
      if (metaData.interlace) {
        inflatedData = zlib.inflateSync(inflateData);
      } else {
        let rowSize = (metaData.width * metaData.bpp * metaData.depth + 7 >> 3) + 1;
        let imageSize = rowSize * metaData.height;
        inflatedData = inflateSync(inflateData, {
          chunkSize: imageSize,
          maxLength: imageSize
        });
      }
      inflateData = null;
      if (!inflatedData || !inflatedData.length) {
        throw new Error("bad png - invalid inflate data response");
      }
      let unfilteredData = FilterSync.process(inflatedData, metaData);
      inflateData = null;
      let bitmapData = bitmapper.dataToBitMap(unfilteredData, metaData);
      unfilteredData = null;
      let normalisedBitmapData = formatNormaliser(
        bitmapData,
        metaData,
        options2.skipRescale
      );
      metaData.data = normalisedBitmapData;
      metaData.gamma = gamma || 0;
      return metaData;
    };
  }
});

// node_modules/pngjs/lib/packer-sync.js
var require_packer_sync = __commonJS({
  "node_modules/pngjs/lib/packer-sync.js"(exports2, module2) {
    "use strict";
    var hasSyncZlib = true;
    var zlib = require("zlib");
    if (!zlib.deflateSync) {
      hasSyncZlib = false;
    }
    var constants = require_constants();
    var Packer = require_packer();
    module2.exports = function(metaData, opt) {
      if (!hasSyncZlib) {
        throw new Error(
          "To use the sync capability of this library in old node versions, please pin pngjs to v2.3.0"
        );
      }
      let options2 = opt || {};
      let packer = new Packer(options2);
      let chunks = [];
      chunks.push(Buffer.from(constants.PNG_SIGNATURE));
      chunks.push(packer.packIHDR(metaData.width, metaData.height));
      if (metaData.gamma) {
        chunks.push(packer.packGAMA(metaData.gamma));
      }
      let filteredData = packer.filterData(
        metaData.data,
        metaData.width,
        metaData.height
      );
      let compressedData = zlib.deflateSync(
        filteredData,
        packer.getDeflateOptions()
      );
      filteredData = null;
      if (!compressedData || !compressedData.length) {
        throw new Error("bad png - invalid compressed data response");
      }
      chunks.push(packer.packIDAT(compressedData));
      chunks.push(packer.packIEND());
      return Buffer.concat(chunks);
    };
  }
});

// node_modules/pngjs/lib/png-sync.js
var require_png_sync = __commonJS({
  "node_modules/pngjs/lib/png-sync.js"(exports2) {
    "use strict";
    var parse3 = require_parser_sync();
    var pack = require_packer_sync();
    exports2.read = function(buffer, options2) {
      return parse3(buffer, options2 || {});
    };
    exports2.write = function(png, options2) {
      return pack(png, options2);
    };
  }
});

// node_modules/pngjs/lib/png.js
var require_png = __commonJS({
  "node_modules/pngjs/lib/png.js"(exports2) {
    "use strict";
    var util2 = require("util");
    var Stream = require("stream");
    var Parser = require_parser_async();
    var Packer = require_packer_async();
    var PNGSync = require_png_sync();
    var PNG2 = exports2.PNG = function(options2) {
      Stream.call(this);
      options2 = options2 || {};
      this.width = options2.width | 0;
      this.height = options2.height | 0;
      this.data = this.width > 0 && this.height > 0 ? Buffer.alloc(4 * this.width * this.height) : null;
      if (options2.fill && this.data) {
        this.data.fill(0);
      }
      this.gamma = 0;
      this.readable = this.writable = true;
      this._parser = new Parser(options2);
      this._parser.on("error", this.emit.bind(this, "error"));
      this._parser.on("close", this._handleClose.bind(this));
      this._parser.on("metadata", this._metadata.bind(this));
      this._parser.on("gamma", this._gamma.bind(this));
      this._parser.on(
        "parsed",
        function(data) {
          this.data = data;
          this.emit("parsed", data);
        }.bind(this)
      );
      this._packer = new Packer(options2);
      this._packer.on("data", this.emit.bind(this, "data"));
      this._packer.on("end", this.emit.bind(this, "end"));
      this._parser.on("close", this._handleClose.bind(this));
      this._packer.on("error", this.emit.bind(this, "error"));
    };
    util2.inherits(PNG2, Stream);
    PNG2.sync = PNGSync;
    PNG2.prototype.pack = function() {
      if (!this.data || !this.data.length) {
        this.emit("error", "No data provided");
        return this;
      }
      process.nextTick(
        function() {
          this._packer.pack(this.data, this.width, this.height, this.gamma);
        }.bind(this)
      );
      return this;
    };
    PNG2.prototype.parse = function(data, callback) {
      if (callback) {
        let onParsed, onError;
        onParsed = function(parsedData) {
          this.removeListener("error", onError);
          this.data = parsedData;
          callback(null, this);
        }.bind(this);
        onError = function(err) {
          this.removeListener("parsed", onParsed);
          callback(err, null);
        }.bind(this);
        this.once("parsed", onParsed);
        this.once("error", onError);
      }
      this.end(data);
      return this;
    };
    PNG2.prototype.write = function(data) {
      this._parser.write(data);
      return true;
    };
    PNG2.prototype.end = function(data) {
      this._parser.end(data);
    };
    PNG2.prototype._metadata = function(metadata) {
      this.width = metadata.width;
      this.height = metadata.height;
      this.emit("metadata", metadata);
    };
    PNG2.prototype._gamma = function(gamma) {
      this.gamma = gamma;
    };
    PNG2.prototype._handleClose = function() {
      if (!this._parser.writable && !this._packer.readable) {
        this.emit("close");
      }
    };
    PNG2.bitblt = function(src, dst, srcX, srcY, width, height, deltaX, deltaY) {
      srcX |= 0;
      srcY |= 0;
      width |= 0;
      height |= 0;
      deltaX |= 0;
      deltaY |= 0;
      if (srcX > src.width || srcY > src.height || srcX + width > src.width || srcY + height > src.height) {
        throw new Error("bitblt reading outside image");
      }
      if (deltaX > dst.width || deltaY > dst.height || deltaX + width > dst.width || deltaY + height > dst.height) {
        throw new Error("bitblt writing outside image");
      }
      for (let y = 0; y < height; y++) {
        src.data.copy(
          dst.data,
          (deltaY + y) * dst.width + deltaX << 2,
          (srcY + y) * src.width + srcX << 2,
          (srcY + y) * src.width + srcX + width << 2
        );
      }
    };
    PNG2.prototype.bitblt = function(dst, srcX, srcY, width, height, deltaX, deltaY) {
      PNG2.bitblt(this, dst, srcX, srcY, width, height, deltaX, deltaY);
      return this;
    };
    PNG2.adjustGamma = function(src) {
      if (src.gamma) {
        for (let y = 0; y < src.height; y++) {
          for (let x = 0; x < src.width; x++) {
            let idx = src.width * y + x << 2;
            for (let i = 0; i < 3; i++) {
              let sample = src.data[idx + i] / 255;
              sample = Math.pow(sample, 1 / 2.2 / src.gamma);
              src.data[idx + i] = Math.round(sample * 255);
            }
          }
        }
        src.gamma = 0;
      }
    };
    PNG2.prototype.adjustGamma = function() {
      PNG2.adjustGamma(this);
    };
  }
});

// node_modules/commander/lib/error.js
var require_error = __commonJS({
  "node_modules/commander/lib/error.js"(exports2) {
    var CommanderError2 = class extends Error {
      /**
       * Constructs the CommanderError class
       * @param {number} exitCode suggested exit code which could be used with process.exit
       * @param {string} code an id string representing the error
       * @param {string} message human-readable description of the error
       */
      constructor(exitCode, code, message) {
        super(message);
        Error.captureStackTrace(this, this.constructor);
        this.name = this.constructor.name;
        this.code = code;
        this.exitCode = exitCode;
        this.nestedError = void 0;
      }
    };
    var InvalidArgumentError2 = class extends CommanderError2 {
      /**
       * Constructs the InvalidArgumentError class
       * @param {string} [message] explanation of why argument is invalid
       */
      constructor(message) {
        super(1, "commander.invalidArgument", message);
        Error.captureStackTrace(this, this.constructor);
        this.name = this.constructor.name;
      }
    };
    exports2.CommanderError = CommanderError2;
    exports2.InvalidArgumentError = InvalidArgumentError2;
  }
});

// node_modules/commander/lib/argument.js
var require_argument = __commonJS({
  "node_modules/commander/lib/argument.js"(exports2) {
    var { InvalidArgumentError: InvalidArgumentError2 } = require_error();
    var Argument2 = class {
      /**
       * Initialize a new command argument with the given name and description.
       * The default is that the argument is required, and you can explicitly
       * indicate this with <> around the name. Put [] around the name for an optional argument.
       *
       * @param {string} name
       * @param {string} [description]
       */
      constructor(name, description) {
        this.description = description || "";
        this.variadic = false;
        this.parseArg = void 0;
        this.defaultValue = void 0;
        this.defaultValueDescription = void 0;
        this.argChoices = void 0;
        switch (name[0]) {
          case "<":
            this.required = true;
            this._name = name.slice(1, -1);
            break;
          case "[":
            this.required = false;
            this._name = name.slice(1, -1);
            break;
          default:
            this.required = true;
            this._name = name;
            break;
        }
        if (this._name.length > 3 && this._name.slice(-3) === "...") {
          this.variadic = true;
          this._name = this._name.slice(0, -3);
        }
      }
      /**
       * Return argument name.
       *
       * @return {string}
       */
      name() {
        return this._name;
      }
      /**
       * @package
       */
      _concatValue(value, previous) {
        if (previous === this.defaultValue || !Array.isArray(previous)) {
          return [value];
        }
        return previous.concat(value);
      }
      /**
       * Set the default value, and optionally supply the description to be displayed in the help.
       *
       * @param {*} value
       * @param {string} [description]
       * @return {Argument}
       */
      default(value, description) {
        this.defaultValue = value;
        this.defaultValueDescription = description;
        return this;
      }
      /**
       * Set the custom handler for processing CLI command arguments into argument values.
       *
       * @param {Function} [fn]
       * @return {Argument}
       */
      argParser(fn) {
        this.parseArg = fn;
        return this;
      }
      /**
       * Only allow argument value to be one of choices.
       *
       * @param {string[]} values
       * @return {Argument}
       */
      choices(values) {
        this.argChoices = values.slice();
        this.parseArg = (arg, previous) => {
          if (!this.argChoices.includes(arg)) {
            throw new InvalidArgumentError2(
              `Allowed choices are ${this.argChoices.join(", ")}.`
            );
          }
          if (this.variadic) {
            return this._concatValue(arg, previous);
          }
          return arg;
        };
        return this;
      }
      /**
       * Make argument required.
       *
       * @returns {Argument}
       */
      argRequired() {
        this.required = true;
        return this;
      }
      /**
       * Make argument optional.
       *
       * @returns {Argument}
       */
      argOptional() {
        this.required = false;
        return this;
      }
    };
    function humanReadableArgName(arg) {
      const nameOutput = arg.name() + (arg.variadic === true ? "..." : "");
      return arg.required ? "<" + nameOutput + ">" : "[" + nameOutput + "]";
    }
    exports2.Argument = Argument2;
    exports2.humanReadableArgName = humanReadableArgName;
  }
});

// node_modules/commander/lib/help.js
var require_help = __commonJS({
  "node_modules/commander/lib/help.js"(exports2) {
    var { humanReadableArgName } = require_argument();
    var Help2 = class {
      constructor() {
        this.helpWidth = void 0;
        this.minWidthToWrap = 40;
        this.sortSubcommands = false;
        this.sortOptions = false;
        this.showGlobalOptions = false;
      }
      /**
       * prepareContext is called by Commander after applying overrides from `Command.configureHelp()`
       * and just before calling `formatHelp()`.
       *
       * Commander just uses the helpWidth and the rest is provided for optional use by more complex subclasses.
       *
       * @param {{ error?: boolean, helpWidth?: number, outputHasColors?: boolean }} contextOptions
       */
      prepareContext(contextOptions) {
        this.helpWidth = this.helpWidth ?? contextOptions.helpWidth ?? 80;
      }
      /**
       * Get an array of the visible subcommands. Includes a placeholder for the implicit help command, if there is one.
       *
       * @param {Command} cmd
       * @returns {Command[]}
       */
      visibleCommands(cmd) {
        const visibleCommands = cmd.commands.filter((cmd2) => !cmd2._hidden);
        const helpCommand = cmd._getHelpCommand();
        if (helpCommand && !helpCommand._hidden) {
          visibleCommands.push(helpCommand);
        }
        if (this.sortSubcommands) {
          visibleCommands.sort((a, b) => {
            return a.name().localeCompare(b.name());
          });
        }
        return visibleCommands;
      }
      /**
       * Compare options for sort.
       *
       * @param {Option} a
       * @param {Option} b
       * @returns {number}
       */
      compareOptions(a, b) {
        const getSortKey = (option) => {
          return option.short ? option.short.replace(/^-/, "") : option.long.replace(/^--/, "");
        };
        return getSortKey(a).localeCompare(getSortKey(b));
      }
      /**
       * Get an array of the visible options. Includes a placeholder for the implicit help option, if there is one.
       *
       * @param {Command} cmd
       * @returns {Option[]}
       */
      visibleOptions(cmd) {
        const visibleOptions = cmd.options.filter((option) => !option.hidden);
        const helpOption = cmd._getHelpOption();
        if (helpOption && !helpOption.hidden) {
          const removeShort = helpOption.short && cmd._findOption(helpOption.short);
          const removeLong = helpOption.long && cmd._findOption(helpOption.long);
          if (!removeShort && !removeLong) {
            visibleOptions.push(helpOption);
          } else if (helpOption.long && !removeLong) {
            visibleOptions.push(
              cmd.createOption(helpOption.long, helpOption.description)
            );
          } else if (helpOption.short && !removeShort) {
            visibleOptions.push(
              cmd.createOption(helpOption.short, helpOption.description)
            );
          }
        }
        if (this.sortOptions) {
          visibleOptions.sort(this.compareOptions);
        }
        return visibleOptions;
      }
      /**
       * Get an array of the visible global options. (Not including help.)
       *
       * @param {Command} cmd
       * @returns {Option[]}
       */
      visibleGlobalOptions(cmd) {
        if (!this.showGlobalOptions) return [];
        const globalOptions = [];
        for (let ancestorCmd = cmd.parent; ancestorCmd; ancestorCmd = ancestorCmd.parent) {
          const visibleOptions = ancestorCmd.options.filter(
            (option) => !option.hidden
          );
          globalOptions.push(...visibleOptions);
        }
        if (this.sortOptions) {
          globalOptions.sort(this.compareOptions);
        }
        return globalOptions;
      }
      /**
       * Get an array of the arguments if any have a description.
       *
       * @param {Command} cmd
       * @returns {Argument[]}
       */
      visibleArguments(cmd) {
        if (cmd._argsDescription) {
          cmd.registeredArguments.forEach((argument) => {
            argument.description = argument.description || cmd._argsDescription[argument.name()] || "";
          });
        }
        if (cmd.registeredArguments.find((argument) => argument.description)) {
          return cmd.registeredArguments;
        }
        return [];
      }
      /**
       * Get the command term to show in the list of subcommands.
       *
       * @param {Command} cmd
       * @returns {string}
       */
      subcommandTerm(cmd) {
        const args = cmd.registeredArguments.map((arg) => humanReadableArgName(arg)).join(" ");
        return cmd._name + (cmd._aliases[0] ? "|" + cmd._aliases[0] : "") + (cmd.options.length ? " [options]" : "") + // simplistic check for non-help option
        (args ? " " + args : "");
      }
      /**
       * Get the option term to show in the list of options.
       *
       * @param {Option} option
       * @returns {string}
       */
      optionTerm(option) {
        return option.flags;
      }
      /**
       * Get the argument term to show in the list of arguments.
       *
       * @param {Argument} argument
       * @returns {string}
       */
      argumentTerm(argument) {
        return argument.name();
      }
      /**
       * Get the longest command term length.
       *
       * @param {Command} cmd
       * @param {Help} helper
       * @returns {number}
       */
      longestSubcommandTermLength(cmd, helper) {
        return helper.visibleCommands(cmd).reduce((max, command) => {
          return Math.max(
            max,
            this.displayWidth(
              helper.styleSubcommandTerm(helper.subcommandTerm(command))
            )
          );
        }, 0);
      }
      /**
       * Get the longest option term length.
       *
       * @param {Command} cmd
       * @param {Help} helper
       * @returns {number}
       */
      longestOptionTermLength(cmd, helper) {
        return helper.visibleOptions(cmd).reduce((max, option) => {
          return Math.max(
            max,
            this.displayWidth(helper.styleOptionTerm(helper.optionTerm(option)))
          );
        }, 0);
      }
      /**
       * Get the longest global option term length.
       *
       * @param {Command} cmd
       * @param {Help} helper
       * @returns {number}
       */
      longestGlobalOptionTermLength(cmd, helper) {
        return helper.visibleGlobalOptions(cmd).reduce((max, option) => {
          return Math.max(
            max,
            this.displayWidth(helper.styleOptionTerm(helper.optionTerm(option)))
          );
        }, 0);
      }
      /**
       * Get the longest argument term length.
       *
       * @param {Command} cmd
       * @param {Help} helper
       * @returns {number}
       */
      longestArgumentTermLength(cmd, helper) {
        return helper.visibleArguments(cmd).reduce((max, argument) => {
          return Math.max(
            max,
            this.displayWidth(
              helper.styleArgumentTerm(helper.argumentTerm(argument))
            )
          );
        }, 0);
      }
      /**
       * Get the command usage to be displayed at the top of the built-in help.
       *
       * @param {Command} cmd
       * @returns {string}
       */
      commandUsage(cmd) {
        let cmdName = cmd._name;
        if (cmd._aliases[0]) {
          cmdName = cmdName + "|" + cmd._aliases[0];
        }
        let ancestorCmdNames = "";
        for (let ancestorCmd = cmd.parent; ancestorCmd; ancestorCmd = ancestorCmd.parent) {
          ancestorCmdNames = ancestorCmd.name() + " " + ancestorCmdNames;
        }
        return ancestorCmdNames + cmdName + " " + cmd.usage();
      }
      /**
       * Get the description for the command.
       *
       * @param {Command} cmd
       * @returns {string}
       */
      commandDescription(cmd) {
        return cmd.description();
      }
      /**
       * Get the subcommand summary to show in the list of subcommands.
       * (Fallback to description for backwards compatibility.)
       *
       * @param {Command} cmd
       * @returns {string}
       */
      subcommandDescription(cmd) {
        return cmd.summary() || cmd.description();
      }
      /**
       * Get the option description to show in the list of options.
       *
       * @param {Option} option
       * @return {string}
       */
      optionDescription(option) {
        const extraInfo = [];
        if (option.argChoices) {
          extraInfo.push(
            // use stringify to match the display of the default value
            `choices: ${option.argChoices.map((choice) => JSON.stringify(choice)).join(", ")}`
          );
        }
        if (option.defaultValue !== void 0) {
          const showDefault = option.required || option.optional || option.isBoolean() && typeof option.defaultValue === "boolean";
          if (showDefault) {
            extraInfo.push(
              `default: ${option.defaultValueDescription || JSON.stringify(option.defaultValue)}`
            );
          }
        }
        if (option.presetArg !== void 0 && option.optional) {
          extraInfo.push(`preset: ${JSON.stringify(option.presetArg)}`);
        }
        if (option.envVar !== void 0) {
          extraInfo.push(`env: ${option.envVar}`);
        }
        if (extraInfo.length > 0) {
          return `${option.description} (${extraInfo.join(", ")})`;
        }
        return option.description;
      }
      /**
       * Get the argument description to show in the list of arguments.
       *
       * @param {Argument} argument
       * @return {string}
       */
      argumentDescription(argument) {
        const extraInfo = [];
        if (argument.argChoices) {
          extraInfo.push(
            // use stringify to match the display of the default value
            `choices: ${argument.argChoices.map((choice) => JSON.stringify(choice)).join(", ")}`
          );
        }
        if (argument.defaultValue !== void 0) {
          extraInfo.push(
            `default: ${argument.defaultValueDescription || JSON.stringify(argument.defaultValue)}`
          );
        }
        if (extraInfo.length > 0) {
          const extraDescription = `(${extraInfo.join(", ")})`;
          if (argument.description) {
            return `${argument.description} ${extraDescription}`;
          }
          return extraDescription;
        }
        return argument.description;
      }
      /**
       * Generate the built-in help text.
       *
       * @param {Command} cmd
       * @param {Help} helper
       * @returns {string}
       */
      formatHelp(cmd, helper) {
        const termWidth = helper.padWidth(cmd, helper);
        const helpWidth = helper.helpWidth ?? 80;
        function callFormatItem(term, description) {
          return helper.formatItem(term, termWidth, description, helper);
        }
        let output = [
          `${helper.styleTitle("Usage:")} ${helper.styleUsage(helper.commandUsage(cmd))}`,
          ""
        ];
        const commandDescription = helper.commandDescription(cmd);
        if (commandDescription.length > 0) {
          output = output.concat([
            helper.boxWrap(
              helper.styleCommandDescription(commandDescription),
              helpWidth
            ),
            ""
          ]);
        }
        const argumentList = helper.visibleArguments(cmd).map((argument) => {
          return callFormatItem(
            helper.styleArgumentTerm(helper.argumentTerm(argument)),
            helper.styleArgumentDescription(helper.argumentDescription(argument))
          );
        });
        if (argumentList.length > 0) {
          output = output.concat([
            helper.styleTitle("Arguments:"),
            ...argumentList,
            ""
          ]);
        }
        const optionList = helper.visibleOptions(cmd).map((option) => {
          return callFormatItem(
            helper.styleOptionTerm(helper.optionTerm(option)),
            helper.styleOptionDescription(helper.optionDescription(option))
          );
        });
        if (optionList.length > 0) {
          output = output.concat([
            helper.styleTitle("Options:"),
            ...optionList,
            ""
          ]);
        }
        if (helper.showGlobalOptions) {
          const globalOptionList = helper.visibleGlobalOptions(cmd).map((option) => {
            return callFormatItem(
              helper.styleOptionTerm(helper.optionTerm(option)),
              helper.styleOptionDescription(helper.optionDescription(option))
            );
          });
          if (globalOptionList.length > 0) {
            output = output.concat([
              helper.styleTitle("Global Options:"),
              ...globalOptionList,
              ""
            ]);
          }
        }
        const commandList = helper.visibleCommands(cmd).map((cmd2) => {
          return callFormatItem(
            helper.styleSubcommandTerm(helper.subcommandTerm(cmd2)),
            helper.styleSubcommandDescription(helper.subcommandDescription(cmd2))
          );
        });
        if (commandList.length > 0) {
          output = output.concat([
            helper.styleTitle("Commands:"),
            ...commandList,
            ""
          ]);
        }
        return output.join("\n");
      }
      /**
       * Return display width of string, ignoring ANSI escape sequences. Used in padding and wrapping calculations.
       *
       * @param {string} str
       * @returns {number}
       */
      displayWidth(str) {
        return stripColor(str).length;
      }
      /**
       * Style the title for displaying in the help. Called with 'Usage:', 'Options:', etc.
       *
       * @param {string} str
       * @returns {string}
       */
      styleTitle(str) {
        return str;
      }
      styleUsage(str) {
        return str.split(" ").map((word) => {
          if (word === "[options]") return this.styleOptionText(word);
          if (word === "[command]") return this.styleSubcommandText(word);
          if (word[0] === "[" || word[0] === "<")
            return this.styleArgumentText(word);
          return this.styleCommandText(word);
        }).join(" ");
      }
      styleCommandDescription(str) {
        return this.styleDescriptionText(str);
      }
      styleOptionDescription(str) {
        return this.styleDescriptionText(str);
      }
      styleSubcommandDescription(str) {
        return this.styleDescriptionText(str);
      }
      styleArgumentDescription(str) {
        return this.styleDescriptionText(str);
      }
      styleDescriptionText(str) {
        return str;
      }
      styleOptionTerm(str) {
        return this.styleOptionText(str);
      }
      styleSubcommandTerm(str) {
        return str.split(" ").map((word) => {
          if (word === "[options]") return this.styleOptionText(word);
          if (word[0] === "[" || word[0] === "<")
            return this.styleArgumentText(word);
          return this.styleSubcommandText(word);
        }).join(" ");
      }
      styleArgumentTerm(str) {
        return this.styleArgumentText(str);
      }
      styleOptionText(str) {
        return str;
      }
      styleArgumentText(str) {
        return str;
      }
      styleSubcommandText(str) {
        return str;
      }
      styleCommandText(str) {
        return str;
      }
      /**
       * Calculate the pad width from the maximum term length.
       *
       * @param {Command} cmd
       * @param {Help} helper
       * @returns {number}
       */
      padWidth(cmd, helper) {
        return Math.max(
          helper.longestOptionTermLength(cmd, helper),
          helper.longestGlobalOptionTermLength(cmd, helper),
          helper.longestSubcommandTermLength(cmd, helper),
          helper.longestArgumentTermLength(cmd, helper)
        );
      }
      /**
       * Detect manually wrapped and indented strings by checking for line break followed by whitespace.
       *
       * @param {string} str
       * @returns {boolean}
       */
      preformatted(str) {
        return /\n[^\S\r\n]/.test(str);
      }
      /**
       * Format the "item", which consists of a term and description. Pad the term and wrap the description, indenting the following lines.
       *
       * So "TTT", 5, "DDD DDDD DD DDD" might be formatted for this.helpWidth=17 like so:
       *   TTT  DDD DDDD
       *        DD DDD
       *
       * @param {string} term
       * @param {number} termWidth
       * @param {string} description
       * @param {Help} helper
       * @returns {string}
       */
      formatItem(term, termWidth, description, helper) {
        const itemIndent = 2;
        const itemIndentStr = " ".repeat(itemIndent);
        if (!description) return itemIndentStr + term;
        const paddedTerm = term.padEnd(
          termWidth + term.length - helper.displayWidth(term)
        );
        const spacerWidth = 2;
        const helpWidth = this.helpWidth ?? 80;
        const remainingWidth = helpWidth - termWidth - spacerWidth - itemIndent;
        let formattedDescription;
        if (remainingWidth < this.minWidthToWrap || helper.preformatted(description)) {
          formattedDescription = description;
        } else {
          const wrappedDescription = helper.boxWrap(description, remainingWidth);
          formattedDescription = wrappedDescription.replace(
            /\n/g,
            "\n" + " ".repeat(termWidth + spacerWidth)
          );
        }
        return itemIndentStr + paddedTerm + " ".repeat(spacerWidth) + formattedDescription.replace(/\n/g, `
${itemIndentStr}`);
      }
      /**
       * Wrap a string at whitespace, preserving existing line breaks.
       * Wrapping is skipped if the width is less than `minWidthToWrap`.
       *
       * @param {string} str
       * @param {number} width
       * @returns {string}
       */
      boxWrap(str, width) {
        if (width < this.minWidthToWrap) return str;
        const rawLines = str.split(/\r\n|\n/);
        const chunkPattern = /[\s]*[^\s]+/g;
        const wrappedLines = [];
        rawLines.forEach((line) => {
          const chunks = line.match(chunkPattern);
          if (chunks === null) {
            wrappedLines.push("");
            return;
          }
          let sumChunks = [chunks.shift()];
          let sumWidth = this.displayWidth(sumChunks[0]);
          chunks.forEach((chunk) => {
            const visibleWidth = this.displayWidth(chunk);
            if (sumWidth + visibleWidth <= width) {
              sumChunks.push(chunk);
              sumWidth += visibleWidth;
              return;
            }
            wrappedLines.push(sumChunks.join(""));
            const nextChunk = chunk.trimStart();
            sumChunks = [nextChunk];
            sumWidth = this.displayWidth(nextChunk);
          });
          wrappedLines.push(sumChunks.join(""));
        });
        return wrappedLines.join("\n");
      }
    };
    function stripColor(str) {
      const sgrPattern = /\x1b\[\d*(;\d*)*m/g;
      return str.replace(sgrPattern, "");
    }
    exports2.Help = Help2;
    exports2.stripColor = stripColor;
  }
});

// node_modules/commander/lib/option.js
var require_option = __commonJS({
  "node_modules/commander/lib/option.js"(exports2) {
    var { InvalidArgumentError: InvalidArgumentError2 } = require_error();
    var Option2 = class {
      /**
       * Initialize a new `Option` with the given `flags` and `description`.
       *
       * @param {string} flags
       * @param {string} [description]
       */
      constructor(flags, description) {
        this.flags = flags;
        this.description = description || "";
        this.required = flags.includes("<");
        this.optional = flags.includes("[");
        this.variadic = /\w\.\.\.[>\]]$/.test(flags);
        this.mandatory = false;
        const optionFlags = splitOptionFlags(flags);
        this.short = optionFlags.shortFlag;
        this.long = optionFlags.longFlag;
        this.negate = false;
        if (this.long) {
          this.negate = this.long.startsWith("--no-");
        }
        this.defaultValue = void 0;
        this.defaultValueDescription = void 0;
        this.presetArg = void 0;
        this.envVar = void 0;
        this.parseArg = void 0;
        this.hidden = false;
        this.argChoices = void 0;
        this.conflictsWith = [];
        this.implied = void 0;
      }
      /**
       * Set the default value, and optionally supply the description to be displayed in the help.
       *
       * @param {*} value
       * @param {string} [description]
       * @return {Option}
       */
      default(value, description) {
        this.defaultValue = value;
        this.defaultValueDescription = description;
        return this;
      }
      /**
       * Preset to use when option used without option-argument, especially optional but also boolean and negated.
       * The custom processing (parseArg) is called.
       *
       * @example
       * new Option('--color').default('GREYSCALE').preset('RGB');
       * new Option('--donate [amount]').preset('20').argParser(parseFloat);
       *
       * @param {*} arg
       * @return {Option}
       */
      preset(arg) {
        this.presetArg = arg;
        return this;
      }
      /**
       * Add option name(s) that conflict with this option.
       * An error will be displayed if conflicting options are found during parsing.
       *
       * @example
       * new Option('--rgb').conflicts('cmyk');
       * new Option('--js').conflicts(['ts', 'jsx']);
       *
       * @param {(string | string[])} names
       * @return {Option}
       */
      conflicts(names) {
        this.conflictsWith = this.conflictsWith.concat(names);
        return this;
      }
      /**
       * Specify implied option values for when this option is set and the implied options are not.
       *
       * The custom processing (parseArg) is not called on the implied values.
       *
       * @example
       * program
       *   .addOption(new Option('--log', 'write logging information to file'))
       *   .addOption(new Option('--trace', 'log extra details').implies({ log: 'trace.txt' }));
       *
       * @param {object} impliedOptionValues
       * @return {Option}
       */
      implies(impliedOptionValues) {
        let newImplied = impliedOptionValues;
        if (typeof impliedOptionValues === "string") {
          newImplied = { [impliedOptionValues]: true };
        }
        this.implied = Object.assign(this.implied || {}, newImplied);
        return this;
      }
      /**
       * Set environment variable to check for option value.
       *
       * An environment variable is only used if when processed the current option value is
       * undefined, or the source of the current value is 'default' or 'config' or 'env'.
       *
       * @param {string} name
       * @return {Option}
       */
      env(name) {
        this.envVar = name;
        return this;
      }
      /**
       * Set the custom handler for processing CLI option arguments into option values.
       *
       * @param {Function} [fn]
       * @return {Option}
       */
      argParser(fn) {
        this.parseArg = fn;
        return this;
      }
      /**
       * Whether the option is mandatory and must have a value after parsing.
       *
       * @param {boolean} [mandatory=true]
       * @return {Option}
       */
      makeOptionMandatory(mandatory = true) {
        this.mandatory = !!mandatory;
        return this;
      }
      /**
       * Hide option in help.
       *
       * @param {boolean} [hide=true]
       * @return {Option}
       */
      hideHelp(hide = true) {
        this.hidden = !!hide;
        return this;
      }
      /**
       * @package
       */
      _concatValue(value, previous) {
        if (previous === this.defaultValue || !Array.isArray(previous)) {
          return [value];
        }
        return previous.concat(value);
      }
      /**
       * Only allow option value to be one of choices.
       *
       * @param {string[]} values
       * @return {Option}
       */
      choices(values) {
        this.argChoices = values.slice();
        this.parseArg = (arg, previous) => {
          if (!this.argChoices.includes(arg)) {
            throw new InvalidArgumentError2(
              `Allowed choices are ${this.argChoices.join(", ")}.`
            );
          }
          if (this.variadic) {
            return this._concatValue(arg, previous);
          }
          return arg;
        };
        return this;
      }
      /**
       * Return option name.
       *
       * @return {string}
       */
      name() {
        if (this.long) {
          return this.long.replace(/^--/, "");
        }
        return this.short.replace(/^-/, "");
      }
      /**
       * Return option name, in a camelcase format that can be used
       * as an object attribute key.
       *
       * @return {string}
       */
      attributeName() {
        if (this.negate) {
          return camelcase(this.name().replace(/^no-/, ""));
        }
        return camelcase(this.name());
      }
      /**
       * Check if `arg` matches the short or long flag.
       *
       * @param {string} arg
       * @return {boolean}
       * @package
       */
      is(arg) {
        return this.short === arg || this.long === arg;
      }
      /**
       * Return whether a boolean option.
       *
       * Options are one of boolean, negated, required argument, or optional argument.
       *
       * @return {boolean}
       * @package
       */
      isBoolean() {
        return !this.required && !this.optional && !this.negate;
      }
    };
    var DualOptions = class {
      /**
       * @param {Option[]} options
       */
      constructor(options2) {
        this.positiveOptions = /* @__PURE__ */ new Map();
        this.negativeOptions = /* @__PURE__ */ new Map();
        this.dualOptions = /* @__PURE__ */ new Set();
        options2.forEach((option) => {
          if (option.negate) {
            this.negativeOptions.set(option.attributeName(), option);
          } else {
            this.positiveOptions.set(option.attributeName(), option);
          }
        });
        this.negativeOptions.forEach((value, key) => {
          if (this.positiveOptions.has(key)) {
            this.dualOptions.add(key);
          }
        });
      }
      /**
       * Did the value come from the option, and not from possible matching dual option?
       *
       * @param {*} value
       * @param {Option} option
       * @returns {boolean}
       */
      valueFromOption(value, option) {
        const optionKey = option.attributeName();
        if (!this.dualOptions.has(optionKey)) return true;
        const preset = this.negativeOptions.get(optionKey).presetArg;
        const negativeValue = preset !== void 0 ? preset : false;
        return option.negate === (negativeValue === value);
      }
    };
    function camelcase(str) {
      return str.split("-").reduce((str2, word) => {
        return str2 + word[0].toUpperCase() + word.slice(1);
      });
    }
    function splitOptionFlags(flags) {
      let shortFlag;
      let longFlag;
      const shortFlagExp = /^-[^-]$/;
      const longFlagExp = /^--[^-]/;
      const flagParts = flags.split(/[ |,]+/).concat("guard");
      if (shortFlagExp.test(flagParts[0])) shortFlag = flagParts.shift();
      if (longFlagExp.test(flagParts[0])) longFlag = flagParts.shift();
      if (!shortFlag && shortFlagExp.test(flagParts[0]))
        shortFlag = flagParts.shift();
      if (!shortFlag && longFlagExp.test(flagParts[0])) {
        shortFlag = longFlag;
        longFlag = flagParts.shift();
      }
      if (flagParts[0].startsWith("-")) {
        const unsupportedFlag = flagParts[0];
        const baseError = `option creation failed due to '${unsupportedFlag}' in option flags '${flags}'`;
        if (/^-[^-][^-]/.test(unsupportedFlag))
          throw new Error(
            `${baseError}
- a short flag is a single dash and a single character
  - either use a single dash and a single character (for a short flag)
  - or use a double dash for a long option (and can have two, like '--ws, --workspace')`
          );
        if (shortFlagExp.test(unsupportedFlag))
          throw new Error(`${baseError}
- too many short flags`);
        if (longFlagExp.test(unsupportedFlag))
          throw new Error(`${baseError}
- too many long flags`);
        throw new Error(`${baseError}
- unrecognised flag format`);
      }
      if (shortFlag === void 0 && longFlag === void 0)
        throw new Error(
          `option creation failed due to no flags found in '${flags}'.`
        );
      return { shortFlag, longFlag };
    }
    exports2.Option = Option2;
    exports2.DualOptions = DualOptions;
  }
});

// node_modules/commander/lib/suggestSimilar.js
var require_suggestSimilar = __commonJS({
  "node_modules/commander/lib/suggestSimilar.js"(exports2) {
    var maxDistance = 3;
    function editDistance(a, b) {
      if (Math.abs(a.length - b.length) > maxDistance)
        return Math.max(a.length, b.length);
      const d = [];
      for (let i = 0; i <= a.length; i++) {
        d[i] = [i];
      }
      for (let j = 0; j <= b.length; j++) {
        d[0][j] = j;
      }
      for (let j = 1; j <= b.length; j++) {
        for (let i = 1; i <= a.length; i++) {
          let cost = 1;
          if (a[i - 1] === b[j - 1]) {
            cost = 0;
          } else {
            cost = 1;
          }
          d[i][j] = Math.min(
            d[i - 1][j] + 1,
            // deletion
            d[i][j - 1] + 1,
            // insertion
            d[i - 1][j - 1] + cost
            // substitution
          );
          if (i > 1 && j > 1 && a[i - 1] === b[j - 2] && a[i - 2] === b[j - 1]) {
            d[i][j] = Math.min(d[i][j], d[i - 2][j - 2] + 1);
          }
        }
      }
      return d[a.length][b.length];
    }
    function suggestSimilar(word, candidates) {
      if (!candidates || candidates.length === 0) return "";
      candidates = Array.from(new Set(candidates));
      const searchingOptions = word.startsWith("--");
      if (searchingOptions) {
        word = word.slice(2);
        candidates = candidates.map((candidate) => candidate.slice(2));
      }
      let similar = [];
      let bestDistance = maxDistance;
      const minSimilarity = 0.4;
      candidates.forEach((candidate) => {
        if (candidate.length <= 1) return;
        const distance = editDistance(word, candidate);
        const length = Math.max(word.length, candidate.length);
        const similarity = (length - distance) / length;
        if (similarity > minSimilarity) {
          if (distance < bestDistance) {
            bestDistance = distance;
            similar = [candidate];
          } else if (distance === bestDistance) {
            similar.push(candidate);
          }
        }
      });
      similar.sort((a, b) => a.localeCompare(b));
      if (searchingOptions) {
        similar = similar.map((candidate) => `--${candidate}`);
      }
      if (similar.length > 1) {
        return `
(Did you mean one of ${similar.join(", ")}?)`;
      }
      if (similar.length === 1) {
        return `
(Did you mean ${similar[0]}?)`;
      }
      return "";
    }
    exports2.suggestSimilar = suggestSimilar;
  }
});

// node_modules/commander/lib/command.js
var require_command = __commonJS({
  "node_modules/commander/lib/command.js"(exports2) {
    var EventEmitter = require("node:events").EventEmitter;
    var childProcess = require("node:child_process");
    var path = require("node:path");
    var fs = require("node:fs");
    var process5 = require("node:process");
    var { Argument: Argument2, humanReadableArgName } = require_argument();
    var { CommanderError: CommanderError2 } = require_error();
    var { Help: Help2, stripColor } = require_help();
    var { Option: Option2, DualOptions } = require_option();
    var { suggestSimilar } = require_suggestSimilar();
    var Command2 = class _Command extends EventEmitter {
      /**
       * Initialize a new `Command`.
       *
       * @param {string} [name]
       */
      constructor(name) {
        super();
        this.commands = [];
        this.options = [];
        this.parent = null;
        this._allowUnknownOption = false;
        this._allowExcessArguments = false;
        this.registeredArguments = [];
        this._args = this.registeredArguments;
        this.args = [];
        this.rawArgs = [];
        this.processedArgs = [];
        this._scriptPath = null;
        this._name = name || "";
        this._optionValues = {};
        this._optionValueSources = {};
        this._storeOptionsAsProperties = false;
        this._actionHandler = null;
        this._executableHandler = false;
        this._executableFile = null;
        this._executableDir = null;
        this._defaultCommandName = null;
        this._exitCallback = null;
        this._aliases = [];
        this._combineFlagAndOptionalValue = true;
        this._description = "";
        this._summary = "";
        this._argsDescription = void 0;
        this._enablePositionalOptions = false;
        this._passThroughOptions = false;
        this._lifeCycleHooks = {};
        this._showHelpAfterError = false;
        this._showSuggestionAfterError = true;
        this._savedState = null;
        this._outputConfiguration = {
          writeOut: (str) => process5.stdout.write(str),
          writeErr: (str) => process5.stderr.write(str),
          outputError: (str, write) => write(str),
          getOutHelpWidth: () => process5.stdout.isTTY ? process5.stdout.columns : void 0,
          getErrHelpWidth: () => process5.stderr.isTTY ? process5.stderr.columns : void 0,
          getOutHasColors: () => useColor() ?? (process5.stdout.isTTY && process5.stdout.hasColors?.()),
          getErrHasColors: () => useColor() ?? (process5.stderr.isTTY && process5.stderr.hasColors?.()),
          stripColor: (str) => stripColor(str)
        };
        this._hidden = false;
        this._helpOption = void 0;
        this._addImplicitHelpCommand = void 0;
        this._helpCommand = void 0;
        this._helpConfiguration = {};
      }
      /**
       * Copy settings that are useful to have in common across root command and subcommands.
       *
       * (Used internally when adding a command using `.command()` so subcommands inherit parent settings.)
       *
       * @param {Command} sourceCommand
       * @return {Command} `this` command for chaining
       */
      copyInheritedSettings(sourceCommand) {
        this._outputConfiguration = sourceCommand._outputConfiguration;
        this._helpOption = sourceCommand._helpOption;
        this._helpCommand = sourceCommand._helpCommand;
        this._helpConfiguration = sourceCommand._helpConfiguration;
        this._exitCallback = sourceCommand._exitCallback;
        this._storeOptionsAsProperties = sourceCommand._storeOptionsAsProperties;
        this._combineFlagAndOptionalValue = sourceCommand._combineFlagAndOptionalValue;
        this._allowExcessArguments = sourceCommand._allowExcessArguments;
        this._enablePositionalOptions = sourceCommand._enablePositionalOptions;
        this._showHelpAfterError = sourceCommand._showHelpAfterError;
        this._showSuggestionAfterError = sourceCommand._showSuggestionAfterError;
        return this;
      }
      /**
       * @returns {Command[]}
       * @private
       */
      _getCommandAndAncestors() {
        const result = [];
        for (let command = this; command; command = command.parent) {
          result.push(command);
        }
        return result;
      }
      /**
       * Define a command.
       *
       * There are two styles of command: pay attention to where to put the description.
       *
       * @example
       * // Command implemented using action handler (description is supplied separately to `.command`)
       * program
       *   .command('clone <source> [destination]')
       *   .description('clone a repository into a newly created directory')
       *   .action((source, destination) => {
       *     console.log('clone command called');
       *   });
       *
       * // Command implemented using separate executable file (description is second parameter to `.command`)
       * program
       *   .command('start <service>', 'start named service')
       *   .command('stop [service]', 'stop named service, or all if no name supplied');
       *
       * @param {string} nameAndArgs - command name and arguments, args are `<required>` or `[optional]` and last may also be `variadic...`
       * @param {(object | string)} [actionOptsOrExecDesc] - configuration options (for action), or description (for executable)
       * @param {object} [execOpts] - configuration options (for executable)
       * @return {Command} returns new command for action handler, or `this` for executable command
       */
      command(nameAndArgs, actionOptsOrExecDesc, execOpts) {
        let desc = actionOptsOrExecDesc;
        let opts = execOpts;
        if (typeof desc === "object" && desc !== null) {
          opts = desc;
          desc = null;
        }
        opts = opts || {};
        const [, name, args] = nameAndArgs.match(/([^ ]+) *(.*)/);
        const cmd = this.createCommand(name);
        if (desc) {
          cmd.description(desc);
          cmd._executableHandler = true;
        }
        if (opts.isDefault) this._defaultCommandName = cmd._name;
        cmd._hidden = !!(opts.noHelp || opts.hidden);
        cmd._executableFile = opts.executableFile || null;
        if (args) cmd.arguments(args);
        this._registerCommand(cmd);
        cmd.parent = this;
        cmd.copyInheritedSettings(this);
        if (desc) return this;
        return cmd;
      }
      /**
       * Factory routine to create a new unattached command.
       *
       * See .command() for creating an attached subcommand, which uses this routine to
       * create the command. You can override createCommand to customise subcommands.
       *
       * @param {string} [name]
       * @return {Command} new command
       */
      createCommand(name) {
        return new _Command(name);
      }
      /**
       * You can customise the help with a subclass of Help by overriding createHelp,
       * or by overriding Help properties using configureHelp().
       *
       * @return {Help}
       */
      createHelp() {
        return Object.assign(new Help2(), this.configureHelp());
      }
      /**
       * You can customise the help by overriding Help properties using configureHelp(),
       * or with a subclass of Help by overriding createHelp().
       *
       * @param {object} [configuration] - configuration options
       * @return {(Command | object)} `this` command for chaining, or stored configuration
       */
      configureHelp(configuration) {
        if (configuration === void 0) return this._helpConfiguration;
        this._helpConfiguration = configuration;
        return this;
      }
      /**
       * The default output goes to stdout and stderr. You can customise this for special
       * applications. You can also customise the display of errors by overriding outputError.
       *
       * The configuration properties are all functions:
       *
       *     // change how output being written, defaults to stdout and stderr
       *     writeOut(str)
       *     writeErr(str)
       *     // change how output being written for errors, defaults to writeErr
       *     outputError(str, write) // used for displaying errors and not used for displaying help
       *     // specify width for wrapping help
       *     getOutHelpWidth()
       *     getErrHelpWidth()
       *     // color support, currently only used with Help
       *     getOutHasColors()
       *     getErrHasColors()
       *     stripColor() // used to remove ANSI escape codes if output does not have colors
       *
       * @param {object} [configuration] - configuration options
       * @return {(Command | object)} `this` command for chaining, or stored configuration
       */
      configureOutput(configuration) {
        if (configuration === void 0) return this._outputConfiguration;
        Object.assign(this._outputConfiguration, configuration);
        return this;
      }
      /**
       * Display the help or a custom message after an error occurs.
       *
       * @param {(boolean|string)} [displayHelp]
       * @return {Command} `this` command for chaining
       */
      showHelpAfterError(displayHelp = true) {
        if (typeof displayHelp !== "string") displayHelp = !!displayHelp;
        this._showHelpAfterError = displayHelp;
        return this;
      }
      /**
       * Display suggestion of similar commands for unknown commands, or options for unknown options.
       *
       * @param {boolean} [displaySuggestion]
       * @return {Command} `this` command for chaining
       */
      showSuggestionAfterError(displaySuggestion = true) {
        this._showSuggestionAfterError = !!displaySuggestion;
        return this;
      }
      /**
       * Add a prepared subcommand.
       *
       * See .command() for creating an attached subcommand which inherits settings from its parent.
       *
       * @param {Command} cmd - new subcommand
       * @param {object} [opts] - configuration options
       * @return {Command} `this` command for chaining
       */
      addCommand(cmd, opts) {
        if (!cmd._name) {
          throw new Error(`Command passed to .addCommand() must have a name
- specify the name in Command constructor or using .name()`);
        }
        opts = opts || {};
        if (opts.isDefault) this._defaultCommandName = cmd._name;
        if (opts.noHelp || opts.hidden) cmd._hidden = true;
        this._registerCommand(cmd);
        cmd.parent = this;
        cmd._checkForBrokenPassThrough();
        return this;
      }
      /**
       * Factory routine to create a new unattached argument.
       *
       * See .argument() for creating an attached argument, which uses this routine to
       * create the argument. You can override createArgument to return a custom argument.
       *
       * @param {string} name
       * @param {string} [description]
       * @return {Argument} new argument
       */
      createArgument(name, description) {
        return new Argument2(name, description);
      }
      /**
       * Define argument syntax for command.
       *
       * The default is that the argument is required, and you can explicitly
       * indicate this with <> around the name. Put [] around the name for an optional argument.
       *
       * @example
       * program.argument('<input-file>');
       * program.argument('[output-file]');
       *
       * @param {string} name
       * @param {string} [description]
       * @param {(Function|*)} [fn] - custom argument processing function
       * @param {*} [defaultValue]
       * @return {Command} `this` command for chaining
       */
      argument(name, description, fn, defaultValue) {
        const argument = this.createArgument(name, description);
        if (typeof fn === "function") {
          argument.default(defaultValue).argParser(fn);
        } else {
          argument.default(fn);
        }
        this.addArgument(argument);
        return this;
      }
      /**
       * Define argument syntax for command, adding multiple at once (without descriptions).
       *
       * See also .argument().
       *
       * @example
       * program.arguments('<cmd> [env]');
       *
       * @param {string} names
       * @return {Command} `this` command for chaining
       */
      arguments(names) {
        names.trim().split(/ +/).forEach((detail) => {
          this.argument(detail);
        });
        return this;
      }
      /**
       * Define argument syntax for command, adding a prepared argument.
       *
       * @param {Argument} argument
       * @return {Command} `this` command for chaining
       */
      addArgument(argument) {
        const previousArgument = this.registeredArguments.slice(-1)[0];
        if (previousArgument && previousArgument.variadic) {
          throw new Error(
            `only the last argument can be variadic '${previousArgument.name()}'`
          );
        }
        if (argument.required && argument.defaultValue !== void 0 && argument.parseArg === void 0) {
          throw new Error(
            `a default value for a required argument is never used: '${argument.name()}'`
          );
        }
        this.registeredArguments.push(argument);
        return this;
      }
      /**
       * Customise or override default help command. By default a help command is automatically added if your command has subcommands.
       *
       * @example
       *    program.helpCommand('help [cmd]');
       *    program.helpCommand('help [cmd]', 'show help');
       *    program.helpCommand(false); // suppress default help command
       *    program.helpCommand(true); // add help command even if no subcommands
       *
       * @param {string|boolean} enableOrNameAndArgs - enable with custom name and/or arguments, or boolean to override whether added
       * @param {string} [description] - custom description
       * @return {Command} `this` command for chaining
       */
      helpCommand(enableOrNameAndArgs, description) {
        if (typeof enableOrNameAndArgs === "boolean") {
          this._addImplicitHelpCommand = enableOrNameAndArgs;
          return this;
        }
        enableOrNameAndArgs = enableOrNameAndArgs ?? "help [command]";
        const [, helpName, helpArgs] = enableOrNameAndArgs.match(/([^ ]+) *(.*)/);
        const helpDescription = description ?? "display help for command";
        const helpCommand = this.createCommand(helpName);
        helpCommand.helpOption(false);
        if (helpArgs) helpCommand.arguments(helpArgs);
        if (helpDescription) helpCommand.description(helpDescription);
        this._addImplicitHelpCommand = true;
        this._helpCommand = helpCommand;
        return this;
      }
      /**
       * Add prepared custom help command.
       *
       * @param {(Command|string|boolean)} helpCommand - custom help command, or deprecated enableOrNameAndArgs as for `.helpCommand()`
       * @param {string} [deprecatedDescription] - deprecated custom description used with custom name only
       * @return {Command} `this` command for chaining
       */
      addHelpCommand(helpCommand, deprecatedDescription) {
        if (typeof helpCommand !== "object") {
          this.helpCommand(helpCommand, deprecatedDescription);
          return this;
        }
        this._addImplicitHelpCommand = true;
        this._helpCommand = helpCommand;
        return this;
      }
      /**
       * Lazy create help command.
       *
       * @return {(Command|null)}
       * @package
       */
      _getHelpCommand() {
        const hasImplicitHelpCommand = this._addImplicitHelpCommand ?? (this.commands.length && !this._actionHandler && !this._findCommand("help"));
        if (hasImplicitHelpCommand) {
          if (this._helpCommand === void 0) {
            this.helpCommand(void 0, void 0);
          }
          return this._helpCommand;
        }
        return null;
      }
      /**
       * Add hook for life cycle event.
       *
       * @param {string} event
       * @param {Function} listener
       * @return {Command} `this` command for chaining
       */
      hook(event, listener) {
        const allowedValues = ["preSubcommand", "preAction", "postAction"];
        if (!allowedValues.includes(event)) {
          throw new Error(`Unexpected value for event passed to hook : '${event}'.
Expecting one of '${allowedValues.join("', '")}'`);
        }
        if (this._lifeCycleHooks[event]) {
          this._lifeCycleHooks[event].push(listener);
        } else {
          this._lifeCycleHooks[event] = [listener];
        }
        return this;
      }
      /**
       * Register callback to use as replacement for calling process.exit.
       *
       * @param {Function} [fn] optional callback which will be passed a CommanderError, defaults to throwing
       * @return {Command} `this` command for chaining
       */
      exitOverride(fn) {
        if (fn) {
          this._exitCallback = fn;
        } else {
          this._exitCallback = (err) => {
            if (err.code !== "commander.executeSubCommandAsync") {
              throw err;
            } else {
            }
          };
        }
        return this;
      }
      /**
       * Call process.exit, and _exitCallback if defined.
       *
       * @param {number} exitCode exit code for using with process.exit
       * @param {string} code an id string representing the error
       * @param {string} message human-readable description of the error
       * @return never
       * @private
       */
      _exit(exitCode, code, message) {
        if (this._exitCallback) {
          this._exitCallback(new CommanderError2(exitCode, code, message));
        }
        process5.exit(exitCode);
      }
      /**
       * Register callback `fn` for the command.
       *
       * @example
       * program
       *   .command('serve')
       *   .description('start service')
       *   .action(function() {
       *      // do work here
       *   });
       *
       * @param {Function} fn
       * @return {Command} `this` command for chaining
       */
      action(fn) {
        const listener = (args) => {
          const expectedArgsCount = this.registeredArguments.length;
          const actionArgs = args.slice(0, expectedArgsCount);
          if (this._storeOptionsAsProperties) {
            actionArgs[expectedArgsCount] = this;
          } else {
            actionArgs[expectedArgsCount] = this.opts();
          }
          actionArgs.push(this);
          return fn.apply(this, actionArgs);
        };
        this._actionHandler = listener;
        return this;
      }
      /**
       * Factory routine to create a new unattached option.
       *
       * See .option() for creating an attached option, which uses this routine to
       * create the option. You can override createOption to return a custom option.
       *
       * @param {string} flags
       * @param {string} [description]
       * @return {Option} new option
       */
      createOption(flags, description) {
        return new Option2(flags, description);
      }
      /**
       * Wrap parseArgs to catch 'commander.invalidArgument'.
       *
       * @param {(Option | Argument)} target
       * @param {string} value
       * @param {*} previous
       * @param {string} invalidArgumentMessage
       * @private
       */
      _callParseArg(target, value, previous, invalidArgumentMessage) {
        try {
          return target.parseArg(value, previous);
        } catch (err) {
          if (err.code === "commander.invalidArgument") {
            const message = `${invalidArgumentMessage} ${err.message}`;
            this.error(message, { exitCode: err.exitCode, code: err.code });
          }
          throw err;
        }
      }
      /**
       * Check for option flag conflicts.
       * Register option if no conflicts found, or throw on conflict.
       *
       * @param {Option} option
       * @private
       */
      _registerOption(option) {
        const matchingOption = option.short && this._findOption(option.short) || option.long && this._findOption(option.long);
        if (matchingOption) {
          const matchingFlag = option.long && this._findOption(option.long) ? option.long : option.short;
          throw new Error(`Cannot add option '${option.flags}'${this._name && ` to command '${this._name}'`} due to conflicting flag '${matchingFlag}'
-  already used by option '${matchingOption.flags}'`);
        }
        this.options.push(option);
      }
      /**
       * Check for command name and alias conflicts with existing commands.
       * Register command if no conflicts found, or throw on conflict.
       *
       * @param {Command} command
       * @private
       */
      _registerCommand(command) {
        const knownBy = (cmd) => {
          return [cmd.name()].concat(cmd.aliases());
        };
        const alreadyUsed = knownBy(command).find(
          (name) => this._findCommand(name)
        );
        if (alreadyUsed) {
          const existingCmd = knownBy(this._findCommand(alreadyUsed)).join("|");
          const newCmd = knownBy(command).join("|");
          throw new Error(
            `cannot add command '${newCmd}' as already have command '${existingCmd}'`
          );
        }
        this.commands.push(command);
      }
      /**
       * Add an option.
       *
       * @param {Option} option
       * @return {Command} `this` command for chaining
       */
      addOption(option) {
        this._registerOption(option);
        const oname = option.name();
        const name = option.attributeName();
        if (option.negate) {
          const positiveLongFlag = option.long.replace(/^--no-/, "--");
          if (!this._findOption(positiveLongFlag)) {
            this.setOptionValueWithSource(
              name,
              option.defaultValue === void 0 ? true : option.defaultValue,
              "default"
            );
          }
        } else if (option.defaultValue !== void 0) {
          this.setOptionValueWithSource(name, option.defaultValue, "default");
        }
        const handleOptionValue = (val, invalidValueMessage, valueSource) => {
          if (val == null && option.presetArg !== void 0) {
            val = option.presetArg;
          }
          const oldValue = this.getOptionValue(name);
          if (val !== null && option.parseArg) {
            val = this._callParseArg(option, val, oldValue, invalidValueMessage);
          } else if (val !== null && option.variadic) {
            val = option._concatValue(val, oldValue);
          }
          if (val == null) {
            if (option.negate) {
              val = false;
            } else if (option.isBoolean() || option.optional) {
              val = true;
            } else {
              val = "";
            }
          }
          this.setOptionValueWithSource(name, val, valueSource);
        };
        this.on("option:" + oname, (val) => {
          const invalidValueMessage = `error: option '${option.flags}' argument '${val}' is invalid.`;
          handleOptionValue(val, invalidValueMessage, "cli");
        });
        if (option.envVar) {
          this.on("optionEnv:" + oname, (val) => {
            const invalidValueMessage = `error: option '${option.flags}' value '${val}' from env '${option.envVar}' is invalid.`;
            handleOptionValue(val, invalidValueMessage, "env");
          });
        }
        return this;
      }
      /**
       * Internal implementation shared by .option() and .requiredOption()
       *
       * @return {Command} `this` command for chaining
       * @private
       */
      _optionEx(config2, flags, description, fn, defaultValue) {
        if (typeof flags === "object" && flags instanceof Option2) {
          throw new Error(
            "To add an Option object use addOption() instead of option() or requiredOption()"
          );
        }
        const option = this.createOption(flags, description);
        option.makeOptionMandatory(!!config2.mandatory);
        if (typeof fn === "function") {
          option.default(defaultValue).argParser(fn);
        } else if (fn instanceof RegExp) {
          const regex = fn;
          fn = (val, def) => {
            const m = regex.exec(val);
            return m ? m[0] : def;
          };
          option.default(defaultValue).argParser(fn);
        } else {
          option.default(fn);
        }
        return this.addOption(option);
      }
      /**
       * Define option with `flags`, `description`, and optional argument parsing function or `defaultValue` or both.
       *
       * The `flags` string contains the short and/or long flags, separated by comma, a pipe or space. A required
       * option-argument is indicated by `<>` and an optional option-argument by `[]`.
       *
       * See the README for more details, and see also addOption() and requiredOption().
       *
       * @example
       * program
       *     .option('-p, --pepper', 'add pepper')
       *     .option('--pt, --pizza-type <TYPE>', 'type of pizza') // required option-argument
       *     .option('-c, --cheese [CHEESE]', 'add extra cheese', 'mozzarella') // optional option-argument with default
       *     .option('-t, --tip <VALUE>', 'add tip to purchase cost', parseFloat) // custom parse function
       *
       * @param {string} flags
       * @param {string} [description]
       * @param {(Function|*)} [parseArg] - custom option processing function or default value
       * @param {*} [defaultValue]
       * @return {Command} `this` command for chaining
       */
      option(flags, description, parseArg, defaultValue) {
        return this._optionEx({}, flags, description, parseArg, defaultValue);
      }
      /**
       * Add a required option which must have a value after parsing. This usually means
       * the option must be specified on the command line. (Otherwise the same as .option().)
       *
       * The `flags` string contains the short and/or long flags, separated by comma, a pipe or space.
       *
       * @param {string} flags
       * @param {string} [description]
       * @param {(Function|*)} [parseArg] - custom option processing function or default value
       * @param {*} [defaultValue]
       * @return {Command} `this` command for chaining
       */
      requiredOption(flags, description, parseArg, defaultValue) {
        return this._optionEx(
          { mandatory: true },
          flags,
          description,
          parseArg,
          defaultValue
        );
      }
      /**
       * Alter parsing of short flags with optional values.
       *
       * @example
       * // for `.option('-f,--flag [value]'):
       * program.combineFlagAndOptionalValue(true);  // `-f80` is treated like `--flag=80`, this is the default behaviour
       * program.combineFlagAndOptionalValue(false) // `-fb` is treated like `-f -b`
       *
       * @param {boolean} [combine] - if `true` or omitted, an optional value can be specified directly after the flag.
       * @return {Command} `this` command for chaining
       */
      combineFlagAndOptionalValue(combine = true) {
        this._combineFlagAndOptionalValue = !!combine;
        return this;
      }
      /**
       * Allow unknown options on the command line.
       *
       * @param {boolean} [allowUnknown] - if `true` or omitted, no error will be thrown for unknown options.
       * @return {Command} `this` command for chaining
       */
      allowUnknownOption(allowUnknown = true) {
        this._allowUnknownOption = !!allowUnknown;
        return this;
      }
      /**
       * Allow excess command-arguments on the command line. Pass false to make excess arguments an error.
       *
       * @param {boolean} [allowExcess] - if `true` or omitted, no error will be thrown for excess arguments.
       * @return {Command} `this` command for chaining
       */
      allowExcessArguments(allowExcess = true) {
        this._allowExcessArguments = !!allowExcess;
        return this;
      }
      /**
       * Enable positional options. Positional means global options are specified before subcommands which lets
       * subcommands reuse the same option names, and also enables subcommands to turn on passThroughOptions.
       * The default behaviour is non-positional and global options may appear anywhere on the command line.
       *
       * @param {boolean} [positional]
       * @return {Command} `this` command for chaining
       */
      enablePositionalOptions(positional = true) {
        this._enablePositionalOptions = !!positional;
        return this;
      }
      /**
       * Pass through options that come after command-arguments rather than treat them as command-options,
       * so actual command-options come before command-arguments. Turning this on for a subcommand requires
       * positional options to have been enabled on the program (parent commands).
       * The default behaviour is non-positional and options may appear before or after command-arguments.
       *
       * @param {boolean} [passThrough] for unknown options.
       * @return {Command} `this` command for chaining
       */
      passThroughOptions(passThrough = true) {
        this._passThroughOptions = !!passThrough;
        this._checkForBrokenPassThrough();
        return this;
      }
      /**
       * @private
       */
      _checkForBrokenPassThrough() {
        if (this.parent && this._passThroughOptions && !this.parent._enablePositionalOptions) {
          throw new Error(
            `passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`
          );
        }
      }
      /**
       * Whether to store option values as properties on command object,
       * or store separately (specify false). In both cases the option values can be accessed using .opts().
       *
       * @param {boolean} [storeAsProperties=true]
       * @return {Command} `this` command for chaining
       */
      storeOptionsAsProperties(storeAsProperties = true) {
        if (this.options.length) {
          throw new Error("call .storeOptionsAsProperties() before adding options");
        }
        if (Object.keys(this._optionValues).length) {
          throw new Error(
            "call .storeOptionsAsProperties() before setting option values"
          );
        }
        this._storeOptionsAsProperties = !!storeAsProperties;
        return this;
      }
      /**
       * Retrieve option value.
       *
       * @param {string} key
       * @return {object} value
       */
      getOptionValue(key) {
        if (this._storeOptionsAsProperties) {
          return this[key];
        }
        return this._optionValues[key];
      }
      /**
       * Store option value.
       *
       * @param {string} key
       * @param {object} value
       * @return {Command} `this` command for chaining
       */
      setOptionValue(key, value) {
        return this.setOptionValueWithSource(key, value, void 0);
      }
      /**
       * Store option value and where the value came from.
       *
       * @param {string} key
       * @param {object} value
       * @param {string} source - expected values are default/config/env/cli/implied
       * @return {Command} `this` command for chaining
       */
      setOptionValueWithSource(key, value, source) {
        if (this._storeOptionsAsProperties) {
          this[key] = value;
        } else {
          this._optionValues[key] = value;
        }
        this._optionValueSources[key] = source;
        return this;
      }
      /**
       * Get source of option value.
       * Expected values are default | config | env | cli | implied
       *
       * @param {string} key
       * @return {string}
       */
      getOptionValueSource(key) {
        return this._optionValueSources[key];
      }
      /**
       * Get source of option value. See also .optsWithGlobals().
       * Expected values are default | config | env | cli | implied
       *
       * @param {string} key
       * @return {string}
       */
      getOptionValueSourceWithGlobals(key) {
        let source;
        this._getCommandAndAncestors().forEach((cmd) => {
          if (cmd.getOptionValueSource(key) !== void 0) {
            source = cmd.getOptionValueSource(key);
          }
        });
        return source;
      }
      /**
       * Get user arguments from implied or explicit arguments.
       * Side-effects: set _scriptPath if args included script. Used for default program name, and subcommand searches.
       *
       * @private
       */
      _prepareUserArgs(argv, parseOptions) {
        if (argv !== void 0 && !Array.isArray(argv)) {
          throw new Error("first parameter to parse must be array or undefined");
        }
        parseOptions = parseOptions || {};
        if (argv === void 0 && parseOptions.from === void 0) {
          if (process5.versions?.electron) {
            parseOptions.from = "electron";
          }
          const execArgv = process5.execArgv ?? [];
          if (execArgv.includes("-e") || execArgv.includes("--eval") || execArgv.includes("-p") || execArgv.includes("--print")) {
            parseOptions.from = "eval";
          }
        }
        if (argv === void 0) {
          argv = process5.argv;
        }
        this.rawArgs = argv.slice();
        let userArgs;
        switch (parseOptions.from) {
          case void 0:
          case "node":
            this._scriptPath = argv[1];
            userArgs = argv.slice(2);
            break;
          case "electron":
            if (process5.defaultApp) {
              this._scriptPath = argv[1];
              userArgs = argv.slice(2);
            } else {
              userArgs = argv.slice(1);
            }
            break;
          case "user":
            userArgs = argv.slice(0);
            break;
          case "eval":
            userArgs = argv.slice(1);
            break;
          default:
            throw new Error(
              `unexpected parse option { from: '${parseOptions.from}' }`
            );
        }
        if (!this._name && this._scriptPath)
          this.nameFromFilename(this._scriptPath);
        this._name = this._name || "program";
        return userArgs;
      }
      /**
       * Parse `argv`, setting options and invoking commands when defined.
       *
       * Use parseAsync instead of parse if any of your action handlers are async.
       *
       * Call with no parameters to parse `process.argv`. Detects Electron and special node options like `node --eval`. Easy mode!
       *
       * Or call with an array of strings to parse, and optionally where the user arguments start by specifying where the arguments are `from`:
       * - `'node'`: default, `argv[0]` is the application and `argv[1]` is the script being run, with user arguments after that
       * - `'electron'`: `argv[0]` is the application and `argv[1]` varies depending on whether the electron application is packaged
       * - `'user'`: just user arguments
       *
       * @example
       * program.parse(); // parse process.argv and auto-detect electron and special node flags
       * program.parse(process.argv); // assume argv[0] is app and argv[1] is script
       * program.parse(my-args, { from: 'user' }); // just user supplied arguments, nothing special about argv[0]
       *
       * @param {string[]} [argv] - optional, defaults to process.argv
       * @param {object} [parseOptions] - optionally specify style of options with from: node/user/electron
       * @param {string} [parseOptions.from] - where the args are from: 'node', 'user', 'electron'
       * @return {Command} `this` command for chaining
       */
      parse(argv, parseOptions) {
        this._prepareForParse();
        const userArgs = this._prepareUserArgs(argv, parseOptions);
        this._parseCommand([], userArgs);
        return this;
      }
      /**
       * Parse `argv`, setting options and invoking commands when defined.
       *
       * Call with no parameters to parse `process.argv`. Detects Electron and special node options like `node --eval`. Easy mode!
       *
       * Or call with an array of strings to parse, and optionally where the user arguments start by specifying where the arguments are `from`:
       * - `'node'`: default, `argv[0]` is the application and `argv[1]` is the script being run, with user arguments after that
       * - `'electron'`: `argv[0]` is the application and `argv[1]` varies depending on whether the electron application is packaged
       * - `'user'`: just user arguments
       *
       * @example
       * await program.parseAsync(); // parse process.argv and auto-detect electron and special node flags
       * await program.parseAsync(process.argv); // assume argv[0] is app and argv[1] is script
       * await program.parseAsync(my-args, { from: 'user' }); // just user supplied arguments, nothing special about argv[0]
       *
       * @param {string[]} [argv]
       * @param {object} [parseOptions]
       * @param {string} parseOptions.from - where the args are from: 'node', 'user', 'electron'
       * @return {Promise}
       */
      async parseAsync(argv, parseOptions) {
        this._prepareForParse();
        const userArgs = this._prepareUserArgs(argv, parseOptions);
        await this._parseCommand([], userArgs);
        return this;
      }
      _prepareForParse() {
        if (this._savedState === null) {
          this.saveStateBeforeParse();
        } else {
          this.restoreStateBeforeParse();
        }
      }
      /**
       * Called the first time parse is called to save state and allow a restore before subsequent calls to parse.
       * Not usually called directly, but available for subclasses to save their custom state.
       *
       * This is called in a lazy way. Only commands used in parsing chain will have state saved.
       */
      saveStateBeforeParse() {
        this._savedState = {
          // name is stable if supplied by author, but may be unspecified for root command and deduced during parsing
          _name: this._name,
          // option values before parse have default values (including false for negated options)
          // shallow clones
          _optionValues: { ...this._optionValues },
          _optionValueSources: { ...this._optionValueSources }
        };
      }
      /**
       * Restore state before parse for calls after the first.
       * Not usually called directly, but available for subclasses to save their custom state.
       *
       * This is called in a lazy way. Only commands used in parsing chain will have state restored.
       */
      restoreStateBeforeParse() {
        if (this._storeOptionsAsProperties)
          throw new Error(`Can not call parse again when storeOptionsAsProperties is true.
- either make a new Command for each call to parse, or stop storing options as properties`);
        this._name = this._savedState._name;
        this._scriptPath = null;
        this.rawArgs = [];
        this._optionValues = { ...this._savedState._optionValues };
        this._optionValueSources = { ...this._savedState._optionValueSources };
        this.args = [];
        this.processedArgs = [];
      }
      /**
       * Throw if expected executable is missing. Add lots of help for author.
       *
       * @param {string} executableFile
       * @param {string} executableDir
       * @param {string} subcommandName
       */
      _checkForMissingExecutable(executableFile, executableDir, subcommandName) {
        if (fs.existsSync(executableFile)) return;
        const executableDirMessage = executableDir ? `searched for local subcommand relative to directory '${executableDir}'` : "no directory for search for local subcommand, use .executableDir() to supply a custom directory";
        const executableMissing = `'${executableFile}' does not exist
 - if '${subcommandName}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
 - if the default executable name is not suitable, use the executableFile option to supply a custom name or path
 - ${executableDirMessage}`;
        throw new Error(executableMissing);
      }
      /**
       * Execute a sub-command executable.
       *
       * @private
       */
      _executeSubCommand(subcommand, args) {
        args = args.slice();
        let launchWithNode = false;
        const sourceExt = [".js", ".ts", ".tsx", ".mjs", ".cjs"];
        function findFile(baseDir, baseName) {
          const localBin = path.resolve(baseDir, baseName);
          if (fs.existsSync(localBin)) return localBin;
          if (sourceExt.includes(path.extname(baseName))) return void 0;
          const foundExt = sourceExt.find(
            (ext) => fs.existsSync(`${localBin}${ext}`)
          );
          if (foundExt) return `${localBin}${foundExt}`;
          return void 0;
        }
        this._checkForMissingMandatoryOptions();
        this._checkForConflictingOptions();
        let executableFile = subcommand._executableFile || `${this._name}-${subcommand._name}`;
        let executableDir = this._executableDir || "";
        if (this._scriptPath) {
          let resolvedScriptPath;
          try {
            resolvedScriptPath = fs.realpathSync(this._scriptPath);
          } catch {
            resolvedScriptPath = this._scriptPath;
          }
          executableDir = path.resolve(
            path.dirname(resolvedScriptPath),
            executableDir
          );
        }
        if (executableDir) {
          let localFile = findFile(executableDir, executableFile);
          if (!localFile && !subcommand._executableFile && this._scriptPath) {
            const legacyName = path.basename(
              this._scriptPath,
              path.extname(this._scriptPath)
            );
            if (legacyName !== this._name) {
              localFile = findFile(
                executableDir,
                `${legacyName}-${subcommand._name}`
              );
            }
          }
          executableFile = localFile || executableFile;
        }
        launchWithNode = sourceExt.includes(path.extname(executableFile));
        let proc;
        if (process5.platform !== "win32") {
          if (launchWithNode) {
            args.unshift(executableFile);
            args = incrementNodeInspectorPort(process5.execArgv).concat(args);
            proc = childProcess.spawn(process5.argv[0], args, { stdio: "inherit" });
          } else {
            proc = childProcess.spawn(executableFile, args, { stdio: "inherit" });
          }
        } else {
          this._checkForMissingExecutable(
            executableFile,
            executableDir,
            subcommand._name
          );
          args.unshift(executableFile);
          args = incrementNodeInspectorPort(process5.execArgv).concat(args);
          proc = childProcess.spawn(process5.execPath, args, { stdio: "inherit" });
        }
        if (!proc.killed) {
          const signals = ["SIGUSR1", "SIGUSR2", "SIGTERM", "SIGINT", "SIGHUP"];
          signals.forEach((signal) => {
            process5.on(signal, () => {
              if (proc.killed === false && proc.exitCode === null) {
                proc.kill(signal);
              }
            });
          });
        }
        const exitCallback = this._exitCallback;
        proc.on("close", (code) => {
          code = code ?? 1;
          if (!exitCallback) {
            process5.exit(code);
          } else {
            exitCallback(
              new CommanderError2(
                code,
                "commander.executeSubCommandAsync",
                "(close)"
              )
            );
          }
        });
        proc.on("error", (err) => {
          if (err.code === "ENOENT") {
            this._checkForMissingExecutable(
              executableFile,
              executableDir,
              subcommand._name
            );
          } else if (err.code === "EACCES") {
            throw new Error(`'${executableFile}' not executable`);
          }
          if (!exitCallback) {
            process5.exit(1);
          } else {
            const wrappedError = new CommanderError2(
              1,
              "commander.executeSubCommandAsync",
              "(error)"
            );
            wrappedError.nestedError = err;
            exitCallback(wrappedError);
          }
        });
        this.runningCommand = proc;
      }
      /**
       * @private
       */
      _dispatchSubcommand(commandName, operands, unknown2) {
        const subCommand = this._findCommand(commandName);
        if (!subCommand) this.help({ error: true });
        subCommand._prepareForParse();
        let promiseChain;
        promiseChain = this._chainOrCallSubCommandHook(
          promiseChain,
          subCommand,
          "preSubcommand"
        );
        promiseChain = this._chainOrCall(promiseChain, () => {
          if (subCommand._executableHandler) {
            this._executeSubCommand(subCommand, operands.concat(unknown2));
          } else {
            return subCommand._parseCommand(operands, unknown2);
          }
        });
        return promiseChain;
      }
      /**
       * Invoke help directly if possible, or dispatch if necessary.
       * e.g. help foo
       *
       * @private
       */
      _dispatchHelpCommand(subcommandName) {
        if (!subcommandName) {
          this.help();
        }
        const subCommand = this._findCommand(subcommandName);
        if (subCommand && !subCommand._executableHandler) {
          subCommand.help();
        }
        return this._dispatchSubcommand(
          subcommandName,
          [],
          [this._getHelpOption()?.long ?? this._getHelpOption()?.short ?? "--help"]
        );
      }
      /**
       * Check this.args against expected this.registeredArguments.
       *
       * @private
       */
      _checkNumberOfArguments() {
        this.registeredArguments.forEach((arg, i) => {
          if (arg.required && this.args[i] == null) {
            this.missingArgument(arg.name());
          }
        });
        if (this.registeredArguments.length > 0 && this.registeredArguments[this.registeredArguments.length - 1].variadic) {
          return;
        }
        if (this.args.length > this.registeredArguments.length) {
          this._excessArguments(this.args);
        }
      }
      /**
       * Process this.args using this.registeredArguments and save as this.processedArgs!
       *
       * @private
       */
      _processArguments() {
        const myParseArg = (argument, value, previous) => {
          let parsedValue = value;
          if (value !== null && argument.parseArg) {
            const invalidValueMessage = `error: command-argument value '${value}' is invalid for argument '${argument.name()}'.`;
            parsedValue = this._callParseArg(
              argument,
              value,
              previous,
              invalidValueMessage
            );
          }
          return parsedValue;
        };
        this._checkNumberOfArguments();
        const processedArgs = [];
        this.registeredArguments.forEach((declaredArg, index) => {
          let value = declaredArg.defaultValue;
          if (declaredArg.variadic) {
            if (index < this.args.length) {
              value = this.args.slice(index);
              if (declaredArg.parseArg) {
                value = value.reduce((processed, v) => {
                  return myParseArg(declaredArg, v, processed);
                }, declaredArg.defaultValue);
              }
            } else if (value === void 0) {
              value = [];
            }
          } else if (index < this.args.length) {
            value = this.args[index];
            if (declaredArg.parseArg) {
              value = myParseArg(declaredArg, value, declaredArg.defaultValue);
            }
          }
          processedArgs[index] = value;
        });
        this.processedArgs = processedArgs;
      }
      /**
       * Once we have a promise we chain, but call synchronously until then.
       *
       * @param {(Promise|undefined)} promise
       * @param {Function} fn
       * @return {(Promise|undefined)}
       * @private
       */
      _chainOrCall(promise2, fn) {
        if (promise2 && promise2.then && typeof promise2.then === "function") {
          return promise2.then(() => fn());
        }
        return fn();
      }
      /**
       *
       * @param {(Promise|undefined)} promise
       * @param {string} event
       * @return {(Promise|undefined)}
       * @private
       */
      _chainOrCallHooks(promise2, event) {
        let result = promise2;
        const hooks = [];
        this._getCommandAndAncestors().reverse().filter((cmd) => cmd._lifeCycleHooks[event] !== void 0).forEach((hookedCommand) => {
          hookedCommand._lifeCycleHooks[event].forEach((callback) => {
            hooks.push({ hookedCommand, callback });
          });
        });
        if (event === "postAction") {
          hooks.reverse();
        }
        hooks.forEach((hookDetail) => {
          result = this._chainOrCall(result, () => {
            return hookDetail.callback(hookDetail.hookedCommand, this);
          });
        });
        return result;
      }
      /**
       *
       * @param {(Promise|undefined)} promise
       * @param {Command} subCommand
       * @param {string} event
       * @return {(Promise|undefined)}
       * @private
       */
      _chainOrCallSubCommandHook(promise2, subCommand, event) {
        let result = promise2;
        if (this._lifeCycleHooks[event] !== void 0) {
          this._lifeCycleHooks[event].forEach((hook) => {
            result = this._chainOrCall(result, () => {
              return hook(this, subCommand);
            });
          });
        }
        return result;
      }
      /**
       * Process arguments in context of this command.
       * Returns action result, in case it is a promise.
       *
       * @private
       */
      _parseCommand(operands, unknown2) {
        const parsed = this.parseOptions(unknown2);
        this._parseOptionsEnv();
        this._parseOptionsImplied();
        operands = operands.concat(parsed.operands);
        unknown2 = parsed.unknown;
        this.args = operands.concat(unknown2);
        if (operands && this._findCommand(operands[0])) {
          return this._dispatchSubcommand(operands[0], operands.slice(1), unknown2);
        }
        if (this._getHelpCommand() && operands[0] === this._getHelpCommand().name()) {
          return this._dispatchHelpCommand(operands[1]);
        }
        if (this._defaultCommandName) {
          this._outputHelpIfRequested(unknown2);
          return this._dispatchSubcommand(
            this._defaultCommandName,
            operands,
            unknown2
          );
        }
        if (this.commands.length && this.args.length === 0 && !this._actionHandler && !this._defaultCommandName) {
          this.help({ error: true });
        }
        this._outputHelpIfRequested(parsed.unknown);
        this._checkForMissingMandatoryOptions();
        this._checkForConflictingOptions();
        const checkForUnknownOptions = () => {
          if (parsed.unknown.length > 0) {
            this.unknownOption(parsed.unknown[0]);
          }
        };
        const commandEvent = `command:${this.name()}`;
        if (this._actionHandler) {
          checkForUnknownOptions();
          this._processArguments();
          let promiseChain;
          promiseChain = this._chainOrCallHooks(promiseChain, "preAction");
          promiseChain = this._chainOrCall(
            promiseChain,
            () => this._actionHandler(this.processedArgs)
          );
          if (this.parent) {
            promiseChain = this._chainOrCall(promiseChain, () => {
              this.parent.emit(commandEvent, operands, unknown2);
            });
          }
          promiseChain = this._chainOrCallHooks(promiseChain, "postAction");
          return promiseChain;
        }
        if (this.parent && this.parent.listenerCount(commandEvent)) {
          checkForUnknownOptions();
          this._processArguments();
          this.parent.emit(commandEvent, operands, unknown2);
        } else if (operands.length) {
          if (this._findCommand("*")) {
            return this._dispatchSubcommand("*", operands, unknown2);
          }
          if (this.listenerCount("command:*")) {
            this.emit("command:*", operands, unknown2);
          } else if (this.commands.length) {
            this.unknownCommand();
          } else {
            checkForUnknownOptions();
            this._processArguments();
          }
        } else if (this.commands.length) {
          checkForUnknownOptions();
          this.help({ error: true });
        } else {
          checkForUnknownOptions();
          this._processArguments();
        }
      }
      /**
       * Find matching command.
       *
       * @private
       * @return {Command | undefined}
       */
      _findCommand(name) {
        if (!name) return void 0;
        return this.commands.find(
          (cmd) => cmd._name === name || cmd._aliases.includes(name)
        );
      }
      /**
       * Return an option matching `arg` if any.
       *
       * @param {string} arg
       * @return {Option}
       * @package
       */
      _findOption(arg) {
        return this.options.find((option) => option.is(arg));
      }
      /**
       * Display an error message if a mandatory option does not have a value.
       * Called after checking for help flags in leaf subcommand.
       *
       * @private
       */
      _checkForMissingMandatoryOptions() {
        this._getCommandAndAncestors().forEach((cmd) => {
          cmd.options.forEach((anOption) => {
            if (anOption.mandatory && cmd.getOptionValue(anOption.attributeName()) === void 0) {
              cmd.missingMandatoryOptionValue(anOption);
            }
          });
        });
      }
      /**
       * Display an error message if conflicting options are used together in this.
       *
       * @private
       */
      _checkForConflictingLocalOptions() {
        const definedNonDefaultOptions = this.options.filter((option) => {
          const optionKey = option.attributeName();
          if (this.getOptionValue(optionKey) === void 0) {
            return false;
          }
          return this.getOptionValueSource(optionKey) !== "default";
        });
        const optionsWithConflicting = definedNonDefaultOptions.filter(
          (option) => option.conflictsWith.length > 0
        );
        optionsWithConflicting.forEach((option) => {
          const conflictingAndDefined = definedNonDefaultOptions.find(
            (defined) => option.conflictsWith.includes(defined.attributeName())
          );
          if (conflictingAndDefined) {
            this._conflictingOption(option, conflictingAndDefined);
          }
        });
      }
      /**
       * Display an error message if conflicting options are used together.
       * Called after checking for help flags in leaf subcommand.
       *
       * @private
       */
      _checkForConflictingOptions() {
        this._getCommandAndAncestors().forEach((cmd) => {
          cmd._checkForConflictingLocalOptions();
        });
      }
      /**
       * Parse options from `argv` removing known options,
       * and return argv split into operands and unknown arguments.
       *
       * Side effects: modifies command by storing options. Does not reset state if called again.
       *
       * Examples:
       *
       *     argv => operands, unknown
       *     --known kkk op => [op], []
       *     op --known kkk => [op], []
       *     sub --unknown uuu op => [sub], [--unknown uuu op]
       *     sub -- --unknown uuu op => [sub --unknown uuu op], []
       *
       * @param {string[]} argv
       * @return {{operands: string[], unknown: string[]}}
       */
      parseOptions(argv) {
        const operands = [];
        const unknown2 = [];
        let dest = operands;
        const args = argv.slice();
        function maybeOption(arg) {
          return arg.length > 1 && arg[0] === "-";
        }
        let activeVariadicOption = null;
        while (args.length) {
          const arg = args.shift();
          if (arg === "--") {
            if (dest === unknown2) dest.push(arg);
            dest.push(...args);
            break;
          }
          if (activeVariadicOption && !maybeOption(arg)) {
            this.emit(`option:${activeVariadicOption.name()}`, arg);
            continue;
          }
          activeVariadicOption = null;
          if (maybeOption(arg)) {
            const option = this._findOption(arg);
            if (option) {
              if (option.required) {
                const value = args.shift();
                if (value === void 0) this.optionMissingArgument(option);
                this.emit(`option:${option.name()}`, value);
              } else if (option.optional) {
                let value = null;
                if (args.length > 0 && !maybeOption(args[0])) {
                  value = args.shift();
                }
                this.emit(`option:${option.name()}`, value);
              } else {
                this.emit(`option:${option.name()}`);
              }
              activeVariadicOption = option.variadic ? option : null;
              continue;
            }
          }
          if (arg.length > 2 && arg[0] === "-" && arg[1] !== "-") {
            const option = this._findOption(`-${arg[1]}`);
            if (option) {
              if (option.required || option.optional && this._combineFlagAndOptionalValue) {
                this.emit(`option:${option.name()}`, arg.slice(2));
              } else {
                this.emit(`option:${option.name()}`);
                args.unshift(`-${arg.slice(2)}`);
              }
              continue;
            }
          }
          if (/^--[^=]+=/.test(arg)) {
            const index = arg.indexOf("=");
            const option = this._findOption(arg.slice(0, index));
            if (option && (option.required || option.optional)) {
              this.emit(`option:${option.name()}`, arg.slice(index + 1));
              continue;
            }
          }
          if (maybeOption(arg)) {
            dest = unknown2;
          }
          if ((this._enablePositionalOptions || this._passThroughOptions) && operands.length === 0 && unknown2.length === 0) {
            if (this._findCommand(arg)) {
              operands.push(arg);
              if (args.length > 0) unknown2.push(...args);
              break;
            } else if (this._getHelpCommand() && arg === this._getHelpCommand().name()) {
              operands.push(arg);
              if (args.length > 0) operands.push(...args);
              break;
            } else if (this._defaultCommandName) {
              unknown2.push(arg);
              if (args.length > 0) unknown2.push(...args);
              break;
            }
          }
          if (this._passThroughOptions) {
            dest.push(arg);
            if (args.length > 0) dest.push(...args);
            break;
          }
          dest.push(arg);
        }
        return { operands, unknown: unknown2 };
      }
      /**
       * Return an object containing local option values as key-value pairs.
       *
       * @return {object}
       */
      opts() {
        if (this._storeOptionsAsProperties) {
          const result = {};
          const len = this.options.length;
          for (let i = 0; i < len; i++) {
            const key = this.options[i].attributeName();
            result[key] = key === this._versionOptionName ? this._version : this[key];
          }
          return result;
        }
        return this._optionValues;
      }
      /**
       * Return an object containing merged local and global option values as key-value pairs.
       *
       * @return {object}
       */
      optsWithGlobals() {
        return this._getCommandAndAncestors().reduce(
          (combinedOptions, cmd) => Object.assign(combinedOptions, cmd.opts()),
          {}
        );
      }
      /**
       * Display error message and exit (or call exitOverride).
       *
       * @param {string} message
       * @param {object} [errorOptions]
       * @param {string} [errorOptions.code] - an id string representing the error
       * @param {number} [errorOptions.exitCode] - used with process.exit
       */
      error(message, errorOptions) {
        this._outputConfiguration.outputError(
          `${message}
`,
          this._outputConfiguration.writeErr
        );
        if (typeof this._showHelpAfterError === "string") {
          this._outputConfiguration.writeErr(`${this._showHelpAfterError}
`);
        } else if (this._showHelpAfterError) {
          this._outputConfiguration.writeErr("\n");
          this.outputHelp({ error: true });
        }
        const config2 = errorOptions || {};
        const exitCode = config2.exitCode || 1;
        const code = config2.code || "commander.error";
        this._exit(exitCode, code, message);
      }
      /**
       * Apply any option related environment variables, if option does
       * not have a value from cli or client code.
       *
       * @private
       */
      _parseOptionsEnv() {
        this.options.forEach((option) => {
          if (option.envVar && option.envVar in process5.env) {
            const optionKey = option.attributeName();
            if (this.getOptionValue(optionKey) === void 0 || ["default", "config", "env"].includes(
              this.getOptionValueSource(optionKey)
            )) {
              if (option.required || option.optional) {
                this.emit(`optionEnv:${option.name()}`, process5.env[option.envVar]);
              } else {
                this.emit(`optionEnv:${option.name()}`);
              }
            }
          }
        });
      }
      /**
       * Apply any implied option values, if option is undefined or default value.
       *
       * @private
       */
      _parseOptionsImplied() {
        const dualHelper = new DualOptions(this.options);
        const hasCustomOptionValue = (optionKey) => {
          return this.getOptionValue(optionKey) !== void 0 && !["default", "implied"].includes(this.getOptionValueSource(optionKey));
        };
        this.options.filter(
          (option) => option.implied !== void 0 && hasCustomOptionValue(option.attributeName()) && dualHelper.valueFromOption(
            this.getOptionValue(option.attributeName()),
            option
          )
        ).forEach((option) => {
          Object.keys(option.implied).filter((impliedKey) => !hasCustomOptionValue(impliedKey)).forEach((impliedKey) => {
            this.setOptionValueWithSource(
              impliedKey,
              option.implied[impliedKey],
              "implied"
            );
          });
        });
      }
      /**
       * Argument `name` is missing.
       *
       * @param {string} name
       * @private
       */
      missingArgument(name) {
        const message = `error: missing required argument '${name}'`;
        this.error(message, { code: "commander.missingArgument" });
      }
      /**
       * `Option` is missing an argument.
       *
       * @param {Option} option
       * @private
       */
      optionMissingArgument(option) {
        const message = `error: option '${option.flags}' argument missing`;
        this.error(message, { code: "commander.optionMissingArgument" });
      }
      /**
       * `Option` does not have a value, and is a mandatory option.
       *
       * @param {Option} option
       * @private
       */
      missingMandatoryOptionValue(option) {
        const message = `error: required option '${option.flags}' not specified`;
        this.error(message, { code: "commander.missingMandatoryOptionValue" });
      }
      /**
       * `Option` conflicts with another option.
       *
       * @param {Option} option
       * @param {Option} conflictingOption
       * @private
       */
      _conflictingOption(option, conflictingOption) {
        const findBestOptionFromValue = (option2) => {
          const optionKey = option2.attributeName();
          const optionValue = this.getOptionValue(optionKey);
          const negativeOption = this.options.find(
            (target) => target.negate && optionKey === target.attributeName()
          );
          const positiveOption = this.options.find(
            (target) => !target.negate && optionKey === target.attributeName()
          );
          if (negativeOption && (negativeOption.presetArg === void 0 && optionValue === false || negativeOption.presetArg !== void 0 && optionValue === negativeOption.presetArg)) {
            return negativeOption;
          }
          return positiveOption || option2;
        };
        const getErrorMessage = (option2) => {
          const bestOption = findBestOptionFromValue(option2);
          const optionKey = bestOption.attributeName();
          const source = this.getOptionValueSource(optionKey);
          if (source === "env") {
            return `environment variable '${bestOption.envVar}'`;
          }
          return `option '${bestOption.flags}'`;
        };
        const message = `error: ${getErrorMessage(option)} cannot be used with ${getErrorMessage(conflictingOption)}`;
        this.error(message, { code: "commander.conflictingOption" });
      }
      /**
       * Unknown option `flag`.
       *
       * @param {string} flag
       * @private
       */
      unknownOption(flag) {
        if (this._allowUnknownOption) return;
        let suggestion = "";
        if (flag.startsWith("--") && this._showSuggestionAfterError) {
          let candidateFlags = [];
          let command = this;
          do {
            const moreFlags = command.createHelp().visibleOptions(command).filter((option) => option.long).map((option) => option.long);
            candidateFlags = candidateFlags.concat(moreFlags);
            command = command.parent;
          } while (command && !command._enablePositionalOptions);
          suggestion = suggestSimilar(flag, candidateFlags);
        }
        const message = `error: unknown option '${flag}'${suggestion}`;
        this.error(message, { code: "commander.unknownOption" });
      }
      /**
       * Excess arguments, more than expected.
       *
       * @param {string[]} receivedArgs
       * @private
       */
      _excessArguments(receivedArgs) {
        if (this._allowExcessArguments) return;
        const expected = this.registeredArguments.length;
        const s = expected === 1 ? "" : "s";
        const forSubcommand = this.parent ? ` for '${this.name()}'` : "";
        const message = `error: too many arguments${forSubcommand}. Expected ${expected} argument${s} but got ${receivedArgs.length}.`;
        this.error(message, { code: "commander.excessArguments" });
      }
      /**
       * Unknown command.
       *
       * @private
       */
      unknownCommand() {
        const unknownName = this.args[0];
        let suggestion = "";
        if (this._showSuggestionAfterError) {
          const candidateNames = [];
          this.createHelp().visibleCommands(this).forEach((command) => {
            candidateNames.push(command.name());
            if (command.alias()) candidateNames.push(command.alias());
          });
          suggestion = suggestSimilar(unknownName, candidateNames);
        }
        const message = `error: unknown command '${unknownName}'${suggestion}`;
        this.error(message, { code: "commander.unknownCommand" });
      }
      /**
       * Get or set the program version.
       *
       * This method auto-registers the "-V, --version" option which will print the version number.
       *
       * You can optionally supply the flags and description to override the defaults.
       *
       * @param {string} [str]
       * @param {string} [flags]
       * @param {string} [description]
       * @return {(this | string | undefined)} `this` command for chaining, or version string if no arguments
       */
      version(str, flags, description) {
        if (str === void 0) return this._version;
        this._version = str;
        flags = flags || "-V, --version";
        description = description || "output the version number";
        const versionOption = this.createOption(flags, description);
        this._versionOptionName = versionOption.attributeName();
        this._registerOption(versionOption);
        this.on("option:" + versionOption.name(), () => {
          this._outputConfiguration.writeOut(`${str}
`);
          this._exit(0, "commander.version", str);
        });
        return this;
      }
      /**
       * Set the description.
       *
       * @param {string} [str]
       * @param {object} [argsDescription]
       * @return {(string|Command)}
       */
      description(str, argsDescription) {
        if (str === void 0 && argsDescription === void 0)
          return this._description;
        this._description = str;
        if (argsDescription) {
          this._argsDescription = argsDescription;
        }
        return this;
      }
      /**
       * Set the summary. Used when listed as subcommand of parent.
       *
       * @param {string} [str]
       * @return {(string|Command)}
       */
      summary(str) {
        if (str === void 0) return this._summary;
        this._summary = str;
        return this;
      }
      /**
       * Set an alias for the command.
       *
       * You may call more than once to add multiple aliases. Only the first alias is shown in the auto-generated help.
       *
       * @param {string} [alias]
       * @return {(string|Command)}
       */
      alias(alias) {
        if (alias === void 0) return this._aliases[0];
        let command = this;
        if (this.commands.length !== 0 && this.commands[this.commands.length - 1]._executableHandler) {
          command = this.commands[this.commands.length - 1];
        }
        if (alias === command._name)
          throw new Error("Command alias can't be the same as its name");
        const matchingCommand = this.parent?._findCommand(alias);
        if (matchingCommand) {
          const existingCmd = [matchingCommand.name()].concat(matchingCommand.aliases()).join("|");
          throw new Error(
            `cannot add alias '${alias}' to command '${this.name()}' as already have command '${existingCmd}'`
          );
        }
        command._aliases.push(alias);
        return this;
      }
      /**
       * Set aliases for the command.
       *
       * Only the first alias is shown in the auto-generated help.
       *
       * @param {string[]} [aliases]
       * @return {(string[]|Command)}
       */
      aliases(aliases) {
        if (aliases === void 0) return this._aliases;
        aliases.forEach((alias) => this.alias(alias));
        return this;
      }
      /**
       * Set / get the command usage `str`.
       *
       * @param {string} [str]
       * @return {(string|Command)}
       */
      usage(str) {
        if (str === void 0) {
          if (this._usage) return this._usage;
          const args = this.registeredArguments.map((arg) => {
            return humanReadableArgName(arg);
          });
          return [].concat(
            this.options.length || this._helpOption !== null ? "[options]" : [],
            this.commands.length ? "[command]" : [],
            this.registeredArguments.length ? args : []
          ).join(" ");
        }
        this._usage = str;
        return this;
      }
      /**
       * Get or set the name of the command.
       *
       * @param {string} [str]
       * @return {(string|Command)}
       */
      name(str) {
        if (str === void 0) return this._name;
        this._name = str;
        return this;
      }
      /**
       * Set the name of the command from script filename, such as process.argv[1],
       * or require.main.filename, or __filename.
       *
       * (Used internally and public although not documented in README.)
       *
       * @example
       * program.nameFromFilename(require.main.filename);
       *
       * @param {string} filename
       * @return {Command}
       */
      nameFromFilename(filename) {
        this._name = path.basename(filename, path.extname(filename));
        return this;
      }
      /**
       * Get or set the directory for searching for executable subcommands of this command.
       *
       * @example
       * program.executableDir(__dirname);
       * // or
       * program.executableDir('subcommands');
       *
       * @param {string} [path]
       * @return {(string|null|Command)}
       */
      executableDir(path2) {
        if (path2 === void 0) return this._executableDir;
        this._executableDir = path2;
        return this;
      }
      /**
       * Return program help documentation.
       *
       * @param {{ error: boolean }} [contextOptions] - pass {error:true} to wrap for stderr instead of stdout
       * @return {string}
       */
      helpInformation(contextOptions) {
        const helper = this.createHelp();
        const context = this._getOutputContext(contextOptions);
        helper.prepareContext({
          error: context.error,
          helpWidth: context.helpWidth,
          outputHasColors: context.hasColors
        });
        const text = helper.formatHelp(this, helper);
        if (context.hasColors) return text;
        return this._outputConfiguration.stripColor(text);
      }
      /**
       * @typedef HelpContext
       * @type {object}
       * @property {boolean} error
       * @property {number} helpWidth
       * @property {boolean} hasColors
       * @property {function} write - includes stripColor if needed
       *
       * @returns {HelpContext}
       * @private
       */
      _getOutputContext(contextOptions) {
        contextOptions = contextOptions || {};
        const error48 = !!contextOptions.error;
        let baseWrite;
        let hasColors;
        let helpWidth;
        if (error48) {
          baseWrite = (str) => this._outputConfiguration.writeErr(str);
          hasColors = this._outputConfiguration.getErrHasColors();
          helpWidth = this._outputConfiguration.getErrHelpWidth();
        } else {
          baseWrite = (str) => this._outputConfiguration.writeOut(str);
          hasColors = this._outputConfiguration.getOutHasColors();
          helpWidth = this._outputConfiguration.getOutHelpWidth();
        }
        const write = (str) => {
          if (!hasColors) str = this._outputConfiguration.stripColor(str);
          return baseWrite(str);
        };
        return { error: error48, write, hasColors, helpWidth };
      }
      /**
       * Output help information for this command.
       *
       * Outputs built-in help, and custom text added using `.addHelpText()`.
       *
       * @param {{ error: boolean } | Function} [contextOptions] - pass {error:true} to write to stderr instead of stdout
       */
      outputHelp(contextOptions) {
        let deprecatedCallback;
        if (typeof contextOptions === "function") {
          deprecatedCallback = contextOptions;
          contextOptions = void 0;
        }
        const outputContext = this._getOutputContext(contextOptions);
        const eventContext = {
          error: outputContext.error,
          write: outputContext.write,
          command: this
        };
        this._getCommandAndAncestors().reverse().forEach((command) => command.emit("beforeAllHelp", eventContext));
        this.emit("beforeHelp", eventContext);
        let helpInformation = this.helpInformation({ error: outputContext.error });
        if (deprecatedCallback) {
          helpInformation = deprecatedCallback(helpInformation);
          if (typeof helpInformation !== "string" && !Buffer.isBuffer(helpInformation)) {
            throw new Error("outputHelp callback must return a string or a Buffer");
          }
        }
        outputContext.write(helpInformation);
        if (this._getHelpOption()?.long) {
          this.emit(this._getHelpOption().long);
        }
        this.emit("afterHelp", eventContext);
        this._getCommandAndAncestors().forEach(
          (command) => command.emit("afterAllHelp", eventContext)
        );
      }
      /**
       * You can pass in flags and a description to customise the built-in help option.
       * Pass in false to disable the built-in help option.
       *
       * @example
       * program.helpOption('-?, --help' 'show help'); // customise
       * program.helpOption(false); // disable
       *
       * @param {(string | boolean)} flags
       * @param {string} [description]
       * @return {Command} `this` command for chaining
       */
      helpOption(flags, description) {
        if (typeof flags === "boolean") {
          if (flags) {
            this._helpOption = this._helpOption ?? void 0;
          } else {
            this._helpOption = null;
          }
          return this;
        }
        flags = flags ?? "-h, --help";
        description = description ?? "display help for command";
        this._helpOption = this.createOption(flags, description);
        return this;
      }
      /**
       * Lazy create help option.
       * Returns null if has been disabled with .helpOption(false).
       *
       * @returns {(Option | null)} the help option
       * @package
       */
      _getHelpOption() {
        if (this._helpOption === void 0) {
          this.helpOption(void 0, void 0);
        }
        return this._helpOption;
      }
      /**
       * Supply your own option to use for the built-in help option.
       * This is an alternative to using helpOption() to customise the flags and description etc.
       *
       * @param {Option} option
       * @return {Command} `this` command for chaining
       */
      addHelpOption(option) {
        this._helpOption = option;
        return this;
      }
      /**
       * Output help information and exit.
       *
       * Outputs built-in help, and custom text added using `.addHelpText()`.
       *
       * @param {{ error: boolean }} [contextOptions] - pass {error:true} to write to stderr instead of stdout
       */
      help(contextOptions) {
        this.outputHelp(contextOptions);
        let exitCode = Number(process5.exitCode ?? 0);
        if (exitCode === 0 && contextOptions && typeof contextOptions !== "function" && contextOptions.error) {
          exitCode = 1;
        }
        this._exit(exitCode, "commander.help", "(outputHelp)");
      }
      /**
       * // Do a little typing to coordinate emit and listener for the help text events.
       * @typedef HelpTextEventContext
       * @type {object}
       * @property {boolean} error
       * @property {Command} command
       * @property {function} write
       */
      /**
       * Add additional text to be displayed with the built-in help.
       *
       * Position is 'before' or 'after' to affect just this command,
       * and 'beforeAll' or 'afterAll' to affect this command and all its subcommands.
       *
       * @param {string} position - before or after built-in help
       * @param {(string | Function)} text - string to add, or a function returning a string
       * @return {Command} `this` command for chaining
       */
      addHelpText(position, text) {
        const allowedValues = ["beforeAll", "before", "after", "afterAll"];
        if (!allowedValues.includes(position)) {
          throw new Error(`Unexpected value for position to addHelpText.
Expecting one of '${allowedValues.join("', '")}'`);
        }
        const helpEvent = `${position}Help`;
        this.on(helpEvent, (context) => {
          let helpStr;
          if (typeof text === "function") {
            helpStr = text({ error: context.error, command: context.command });
          } else {
            helpStr = text;
          }
          if (helpStr) {
            context.write(`${helpStr}
`);
          }
        });
        return this;
      }
      /**
       * Output help information if help flags specified
       *
       * @param {Array} args - array of options to search for help flags
       * @private
       */
      _outputHelpIfRequested(args) {
        const helpOption = this._getHelpOption();
        const helpRequested = helpOption && args.find((arg) => helpOption.is(arg));
        if (helpRequested) {
          this.outputHelp();
          this._exit(0, "commander.helpDisplayed", "(outputHelp)");
        }
      }
    };
    function incrementNodeInspectorPort(args) {
      return args.map((arg) => {
        if (!arg.startsWith("--inspect")) {
          return arg;
        }
        let debugOption;
        let debugHost = "127.0.0.1";
        let debugPort = "9229";
        let match;
        if ((match = arg.match(/^(--inspect(-brk)?)$/)) !== null) {
          debugOption = match[1];
        } else if ((match = arg.match(/^(--inspect(-brk|-port)?)=([^:]+)$/)) !== null) {
          debugOption = match[1];
          if (/^\d+$/.test(match[3])) {
            debugPort = match[3];
          } else {
            debugHost = match[3];
          }
        } else if ((match = arg.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/)) !== null) {
          debugOption = match[1];
          debugHost = match[3];
          debugPort = match[4];
        }
        if (debugOption && debugPort !== "0") {
          return `${debugOption}=${debugHost}:${parseInt(debugPort) + 1}`;
        }
        return arg;
      });
    }
    function useColor() {
      if (process5.env.NO_COLOR || process5.env.FORCE_COLOR === "0" || process5.env.FORCE_COLOR === "false")
        return false;
      if (process5.env.FORCE_COLOR || process5.env.CLICOLOR_FORCE !== void 0)
        return true;
      return void 0;
    }
    exports2.Command = Command2;
    exports2.useColor = useColor;
  }
});

// node_modules/commander/index.js
var require_commander = __commonJS({
  "node_modules/commander/index.js"(exports2) {
    var { Argument: Argument2 } = require_argument();
    var { Command: Command2 } = require_command();
    var { CommanderError: CommanderError2, InvalidArgumentError: InvalidArgumentError2 } = require_error();
    var { Help: Help2 } = require_help();
    var { Option: Option2 } = require_option();
    exports2.program = new Command2();
    exports2.createCommand = (name) => new Command2(name);
    exports2.createOption = (flags, description) => new Option2(flags, description);
    exports2.createArgument = (name, description) => new Argument2(name, description);
    exports2.Command = Command2;
    exports2.Option = Option2;
    exports2.Argument = Argument2;
    exports2.Help = Help2;
    exports2.CommanderError = CommanderError2;
    exports2.InvalidArgumentError = InvalidArgumentError2;
    exports2.InvalidOptionArgumentError = InvalidArgumentError2;
  }
});

// node_modules/progress/lib/node-progress.js
var require_node_progress = __commonJS({
  "node_modules/progress/lib/node-progress.js"(exports2, module2) {
    exports2 = module2.exports = ProgressBar;
    function ProgressBar(fmt, options2) {
      this.stream = options2.stream || process.stderr;
      if (typeof options2 == "number") {
        var total = options2;
        options2 = {};
        options2.total = total;
      } else {
        options2 = options2 || {};
        if ("string" != typeof fmt) throw new Error("format required");
        if ("number" != typeof options2.total) throw new Error("total required");
      }
      this.fmt = fmt;
      this.curr = options2.curr || 0;
      this.total = options2.total;
      this.width = options2.width || this.total;
      this.clear = options2.clear;
      this.chars = {
        complete: options2.complete || "=",
        incomplete: options2.incomplete || "-",
        head: options2.head || (options2.complete || "=")
      };
      this.renderThrottle = options2.renderThrottle !== 0 ? options2.renderThrottle || 16 : 0;
      this.lastRender = -Infinity;
      this.callback = options2.callback || function() {
      };
      this.tokens = {};
      this.lastDraw = "";
    }
    ProgressBar.prototype.tick = function(len, tokens) {
      if (len !== 0)
        len = len || 1;
      if ("object" == typeof len) tokens = len, len = 1;
      if (tokens) this.tokens = tokens;
      if (0 == this.curr) this.start = /* @__PURE__ */ new Date();
      this.curr += len;
      this.render();
      if (this.curr >= this.total) {
        this.render(void 0, true);
        this.complete = true;
        this.terminate();
        this.callback(this);
        return;
      }
    };
    ProgressBar.prototype.render = function(tokens, force) {
      force = force !== void 0 ? force : false;
      if (tokens) this.tokens = tokens;
      if (!this.stream.isTTY) return;
      var now = Date.now();
      var delta = now - this.lastRender;
      if (!force && delta < this.renderThrottle) {
        return;
      } else {
        this.lastRender = now;
      }
      var ratio = this.curr / this.total;
      ratio = Math.min(Math.max(ratio, 0), 1);
      var percent = Math.floor(ratio * 100);
      var incomplete, complete, completeLength;
      var elapsed = /* @__PURE__ */ new Date() - this.start;
      var eta = percent == 100 ? 0 : elapsed * (this.total / this.curr - 1);
      var rate = this.curr / (elapsed / 1e3);
      var str = this.fmt.replace(":current", this.curr).replace(":total", this.total).replace(":elapsed", isNaN(elapsed) ? "0.0" : (elapsed / 1e3).toFixed(1)).replace(":eta", isNaN(eta) || !isFinite(eta) ? "0.0" : (eta / 1e3).toFixed(1)).replace(":percent", percent.toFixed(0) + "%").replace(":rate", Math.round(rate));
      var availableSpace = Math.max(0, this.stream.columns - str.replace(":bar", "").length);
      if (availableSpace && process.platform === "win32") {
        availableSpace = availableSpace - 1;
      }
      var width = Math.min(this.width, availableSpace);
      completeLength = Math.round(width * ratio);
      complete = Array(Math.max(0, completeLength + 1)).join(this.chars.complete);
      incomplete = Array(Math.max(0, width - completeLength + 1)).join(this.chars.incomplete);
      if (completeLength > 0)
        complete = complete.slice(0, -1) + this.chars.head;
      str = str.replace(":bar", complete + incomplete);
      if (this.tokens) for (var key in this.tokens) str = str.replace(":" + key, this.tokens[key]);
      if (this.lastDraw !== str) {
        this.stream.cursorTo(0);
        this.stream.write(str);
        this.stream.clearLine(1);
        this.lastDraw = str;
      }
    };
    ProgressBar.prototype.update = function(ratio, tokens) {
      var goal = Math.floor(ratio * this.total);
      var delta = goal - this.curr;
      this.tick(delta, tokens);
    };
    ProgressBar.prototype.interrupt = function(message) {
      this.stream.clearLine();
      this.stream.cursorTo(0);
      this.stream.write(message);
      this.stream.write("\n");
      this.stream.write(this.lastDraw);
    };
    ProgressBar.prototype.terminate = function() {
      if (this.clear) {
        if (this.stream.clearLine) {
          this.stream.clearLine();
          this.stream.cursorTo(0);
        }
      } else {
        this.stream.write("\n");
      }
    };
  }
});

// node_modules/progress/index.js
var require_progress = __commonJS({
  "node_modules/progress/index.js"(exports2, module2) {
    module2.exports = require_node_progress();
  }
});

// node_modules/smart-buffer/build/utils.js
var require_utils = __commonJS({
  "node_modules/smart-buffer/build/utils.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    var buffer_1 = require("buffer");
    var ERRORS = {
      INVALID_ENCODING: "Invalid encoding provided. Please specify a valid encoding the internal Node.js Buffer supports.",
      INVALID_SMARTBUFFER_SIZE: "Invalid size provided. Size must be a valid integer greater than zero.",
      INVALID_SMARTBUFFER_BUFFER: "Invalid Buffer provided in SmartBufferOptions.",
      INVALID_SMARTBUFFER_OBJECT: "Invalid SmartBufferOptions object supplied to SmartBuffer constructor or factory methods.",
      INVALID_OFFSET: "An invalid offset value was provided.",
      INVALID_OFFSET_NON_NUMBER: "An invalid offset value was provided. A numeric value is required.",
      INVALID_LENGTH: "An invalid length value was provided.",
      INVALID_LENGTH_NON_NUMBER: "An invalid length value was provived. A numeric value is required.",
      INVALID_TARGET_OFFSET: "Target offset is beyond the bounds of the internal SmartBuffer data.",
      INVALID_TARGET_LENGTH: "Specified length value moves cursor beyong the bounds of the internal SmartBuffer data.",
      INVALID_READ_BEYOND_BOUNDS: "Attempted to read beyond the bounds of the managed data.",
      INVALID_WRITE_BEYOND_BOUNDS: "Attempted to write beyond the bounds of the managed data."
    };
    exports2.ERRORS = ERRORS;
    function checkEncoding(encoding) {
      if (!buffer_1.Buffer.isEncoding(encoding)) {
        throw new Error(ERRORS.INVALID_ENCODING);
      }
    }
    exports2.checkEncoding = checkEncoding;
    function isFiniteInteger(value) {
      return typeof value === "number" && isFinite(value) && isInteger(value);
    }
    exports2.isFiniteInteger = isFiniteInteger;
    function checkOffsetOrLengthValue(value, offset) {
      if (typeof value === "number") {
        if (!isFiniteInteger(value) || value < 0) {
          throw new Error(offset ? ERRORS.INVALID_OFFSET : ERRORS.INVALID_LENGTH);
        }
      } else {
        throw new Error(offset ? ERRORS.INVALID_OFFSET_NON_NUMBER : ERRORS.INVALID_LENGTH_NON_NUMBER);
      }
    }
    function checkLengthValue(length) {
      checkOffsetOrLengthValue(length, false);
    }
    exports2.checkLengthValue = checkLengthValue;
    function checkOffsetValue(offset) {
      checkOffsetOrLengthValue(offset, true);
    }
    exports2.checkOffsetValue = checkOffsetValue;
    function checkTargetOffset(offset, buff) {
      if (offset < 0 || offset > buff.length) {
        throw new Error(ERRORS.INVALID_TARGET_OFFSET);
      }
    }
    exports2.checkTargetOffset = checkTargetOffset;
    function isInteger(value) {
      return typeof value === "number" && isFinite(value) && Math.floor(value) === value;
    }
    function bigIntAndBufferInt64Check(bufferMethod) {
      if (typeof BigInt === "undefined") {
        throw new Error("Platform does not support JS BigInt type.");
      }
      if (typeof buffer_1.Buffer.prototype[bufferMethod] === "undefined") {
        throw new Error(`Platform does not support Buffer.prototype.${bufferMethod}.`);
      }
    }
    exports2.bigIntAndBufferInt64Check = bigIntAndBufferInt64Check;
  }
});

// node_modules/smart-buffer/build/smartbuffer.js
var require_smartbuffer = __commonJS({
  "node_modules/smart-buffer/build/smartbuffer.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    var utils_1 = require_utils();
    var DEFAULT_SMARTBUFFER_SIZE = 4096;
    var DEFAULT_SMARTBUFFER_ENCODING = "utf8";
    var SmartBuffer = class _SmartBuffer {
      /**
       * Creates a new SmartBuffer instance.
       *
       * @param options { SmartBufferOptions } The SmartBufferOptions to apply to this instance.
       */
      constructor(options2) {
        this.length = 0;
        this._encoding = DEFAULT_SMARTBUFFER_ENCODING;
        this._writeOffset = 0;
        this._readOffset = 0;
        if (_SmartBuffer.isSmartBufferOptions(options2)) {
          if (options2.encoding) {
            utils_1.checkEncoding(options2.encoding);
            this._encoding = options2.encoding;
          }
          if (options2.size) {
            if (utils_1.isFiniteInteger(options2.size) && options2.size > 0) {
              this._buff = Buffer.allocUnsafe(options2.size);
            } else {
              throw new Error(utils_1.ERRORS.INVALID_SMARTBUFFER_SIZE);
            }
          } else if (options2.buff) {
            if (Buffer.isBuffer(options2.buff)) {
              this._buff = options2.buff;
              this.length = options2.buff.length;
            } else {
              throw new Error(utils_1.ERRORS.INVALID_SMARTBUFFER_BUFFER);
            }
          } else {
            this._buff = Buffer.allocUnsafe(DEFAULT_SMARTBUFFER_SIZE);
          }
        } else {
          if (typeof options2 !== "undefined") {
            throw new Error(utils_1.ERRORS.INVALID_SMARTBUFFER_OBJECT);
          }
          this._buff = Buffer.allocUnsafe(DEFAULT_SMARTBUFFER_SIZE);
        }
      }
      /**
       * Creates a new SmartBuffer instance with the provided internal Buffer size and optional encoding.
       *
       * @param size { Number } The size of the internal Buffer.
       * @param encoding { String } The BufferEncoding to use for strings.
       *
       * @return { SmartBuffer }
       */
      static fromSize(size, encoding) {
        return new this({
          size,
          encoding
        });
      }
      /**
       * Creates a new SmartBuffer instance with the provided Buffer and optional encoding.
       *
       * @param buffer { Buffer } The Buffer to use as the internal Buffer value.
       * @param encoding { String } The BufferEncoding to use for strings.
       *
       * @return { SmartBuffer }
       */
      static fromBuffer(buff, encoding) {
        return new this({
          buff,
          encoding
        });
      }
      /**
       * Creates a new SmartBuffer instance with the provided SmartBufferOptions options.
       *
       * @param options { SmartBufferOptions } The options to use when creating the SmartBuffer instance.
       */
      static fromOptions(options2) {
        return new this(options2);
      }
      /**
       * Type checking function that determines if an object is a SmartBufferOptions object.
       */
      static isSmartBufferOptions(options2) {
        const castOptions = options2;
        return castOptions && (castOptions.encoding !== void 0 || castOptions.size !== void 0 || castOptions.buff !== void 0);
      }
      // Signed integers
      /**
       * Reads an Int8 value from the current read position or an optionally provided offset.
       *
       * @param offset { Number } The offset to read data from (optional)
       * @return { Number }
       */
      readInt8(offset) {
        return this._readNumberValue(Buffer.prototype.readInt8, 1, offset);
      }
      /**
       * Reads an Int16BE value from the current read position or an optionally provided offset.
       *
       * @param offset { Number } The offset to read data from (optional)
       * @return { Number }
       */
      readInt16BE(offset) {
        return this._readNumberValue(Buffer.prototype.readInt16BE, 2, offset);
      }
      /**
       * Reads an Int16LE value from the current read position or an optionally provided offset.
       *
       * @param offset { Number } The offset to read data from (optional)
       * @return { Number }
       */
      readInt16LE(offset) {
        return this._readNumberValue(Buffer.prototype.readInt16LE, 2, offset);
      }
      /**
       * Reads an Int32BE value from the current read position or an optionally provided offset.
       *
       * @param offset { Number } The offset to read data from (optional)
       * @return { Number }
       */
      readInt32BE(offset) {
        return this._readNumberValue(Buffer.prototype.readInt32BE, 4, offset);
      }
      /**
       * Reads an Int32LE value from the current read position or an optionally provided offset.
       *
       * @param offset { Number } The offset to read data from (optional)
       * @return { Number }
       */
      readInt32LE(offset) {
        return this._readNumberValue(Buffer.prototype.readInt32LE, 4, offset);
      }
      /**
       * Reads a BigInt64BE value from the current read position or an optionally provided offset.
       *
       * @param offset { Number } The offset to read data from (optional)
       * @return { BigInt }
       */
      readBigInt64BE(offset) {
        utils_1.bigIntAndBufferInt64Check("readBigInt64BE");
        return this._readNumberValue(Buffer.prototype.readBigInt64BE, 8, offset);
      }
      /**
       * Reads a BigInt64LE value from the current read position or an optionally provided offset.
       *
       * @param offset { Number } The offset to read data from (optional)
       * @return { BigInt }
       */
      readBigInt64LE(offset) {
        utils_1.bigIntAndBufferInt64Check("readBigInt64LE");
        return this._readNumberValue(Buffer.prototype.readBigInt64LE, 8, offset);
      }
      /**
       * Writes an Int8 value to the current write position (or at optional offset).
       *
       * @param value { Number } The value to write.
       * @param offset { Number } The offset to write the value at.
       *
       * @return this
       */
      writeInt8(value, offset) {
        this._writeNumberValue(Buffer.prototype.writeInt8, 1, value, offset);
        return this;
      }
      /**
       * Inserts an Int8 value at the given offset value.
       *
       * @param value { Number } The value to insert.
       * @param offset { Number } The offset to insert the value at.
       *
       * @return this
       */
      insertInt8(value, offset) {
        return this._insertNumberValue(Buffer.prototype.writeInt8, 1, value, offset);
      }
      /**
       * Writes an Int16BE value to the current write position (or at optional offset).
       *
       * @param value { Number } The value to write.
       * @param offset { Number } The offset to write the value at.
       *
       * @return this
       */
      writeInt16BE(value, offset) {
        return this._writeNumberValue(Buffer.prototype.writeInt16BE, 2, value, offset);
      }
      /**
       * Inserts an Int16BE value at the given offset value.
       *
       * @param value { Number } The value to insert.
       * @param offset { Number } The offset to insert the value at.
       *
       * @return this
       */
      insertInt16BE(value, offset) {
        return this._insertNumberValue(Buffer.prototype.writeInt16BE, 2, value, offset);
      }
      /**
       * Writes an Int16LE value to the current write position (or at optional offset).
       *
       * @param value { Number } The value to write.
       * @param offset { Number } The offset to write the value at.
       *
       * @return this
       */
      writeInt16LE(value, offset) {
        return this._writeNumberValue(Buffer.prototype.writeInt16LE, 2, value, offset);
      }
      /**
       * Inserts an Int16LE value at the given offset value.
       *
       * @param value { Number } The value to insert.
       * @param offset { Number } The offset to insert the value at.
       *
       * @return this
       */
      insertInt16LE(value, offset) {
        return this._insertNumberValue(Buffer.prototype.writeInt16LE, 2, value, offset);
      }
      /**
       * Writes an Int32BE value to the current write position (or at optional offset).
       *
       * @param value { Number } The value to write.
       * @param offset { Number } The offset to write the value at.
       *
       * @return this
       */
      writeInt32BE(value, offset) {
        return this._writeNumberValue(Buffer.prototype.writeInt32BE, 4, value, offset);
      }
      /**
       * Inserts an Int32BE value at the given offset value.
       *
       * @param value { Number } The value to insert.
       * @param offset { Number } The offset to insert the value at.
       *
       * @return this
       */
      insertInt32BE(value, offset) {
        return this._insertNumberValue(Buffer.prototype.writeInt32BE, 4, value, offset);
      }
      /**
       * Writes an Int32LE value to the current write position (or at optional offset).
       *
       * @param value { Number } The value to write.
       * @param offset { Number } The offset to write the value at.
       *
       * @return this
       */
      writeInt32LE(value, offset) {
        return this._writeNumberValue(Buffer.prototype.writeInt32LE, 4, value, offset);
      }
      /**
       * Inserts an Int32LE value at the given offset value.
       *
       * @param value { Number } The value to insert.
       * @param offset { Number } The offset to insert the value at.
       *
       * @return this
       */
      insertInt32LE(value, offset) {
        return this._insertNumberValue(Buffer.prototype.writeInt32LE, 4, value, offset);
      }
      /**
       * Writes a BigInt64BE value to the current write position (or at optional offset).
       *
       * @param value { BigInt } The value to write.
       * @param offset { Number } The offset to write the value at.
       *
       * @return this
       */
      writeBigInt64BE(value, offset) {
        utils_1.bigIntAndBufferInt64Check("writeBigInt64BE");
        return this._writeNumberValue(Buffer.prototype.writeBigInt64BE, 8, value, offset);
      }
      /**
       * Inserts a BigInt64BE value at the given offset value.
       *
       * @param value { BigInt } The value to insert.
       * @param offset { Number } The offset to insert the value at.
       *
       * @return this
       */
      insertBigInt64BE(value, offset) {
        utils_1.bigIntAndBufferInt64Check("writeBigInt64BE");
        return this._insertNumberValue(Buffer.prototype.writeBigInt64BE, 8, value, offset);
      }
      /**
       * Writes a BigInt64LE value to the current write position (or at optional offset).
       *
       * @param value { BigInt } The value to write.
       * @param offset { Number } The offset to write the value at.
       *
       * @return this
       */
      writeBigInt64LE(value, offset) {
        utils_1.bigIntAndBufferInt64Check("writeBigInt64LE");
        return this._writeNumberValue(Buffer.prototype.writeBigInt64LE, 8, value, offset);
      }
      /**
       * Inserts a Int64LE value at the given offset value.
       *
       * @param value { BigInt } The value to insert.
       * @param offset { Number } The offset to insert the value at.
       *
       * @return this
       */
      insertBigInt64LE(value, offset) {
        utils_1.bigIntAndBufferInt64Check("writeBigInt64LE");
        return this._insertNumberValue(Buffer.prototype.writeBigInt64LE, 8, value, offset);
      }
      // Unsigned Integers
      /**
       * Reads an UInt8 value from the current read position or an optionally provided offset.
       *
       * @param offset { Number } The offset to read data from (optional)
       * @return { Number }
       */
      readUInt8(offset) {
        return this._readNumberValue(Buffer.prototype.readUInt8, 1, offset);
      }
      /**
       * Reads an UInt16BE value from the current read position or an optionally provided offset.
       *
       * @param offset { Number } The offset to read data from (optional)
       * @return { Number }
       */
      readUInt16BE(offset) {
        return this._readNumberValue(Buffer.prototype.readUInt16BE, 2, offset);
      }
      /**
       * Reads an UInt16LE value from the current read position or an optionally provided offset.
       *
       * @param offset { Number } The offset to read data from (optional)
       * @return { Number }
       */
      readUInt16LE(offset) {
        return this._readNumberValue(Buffer.prototype.readUInt16LE, 2, offset);
      }
      /**
       * Reads an UInt32BE value from the current read position or an optionally provided offset.
       *
       * @param offset { Number } The offset to read data from (optional)
       * @return { Number }
       */
      readUInt32BE(offset) {
        return this._readNumberValue(Buffer.prototype.readUInt32BE, 4, offset);
      }
      /**
       * Reads an UInt32LE value from the current read position or an optionally provided offset.
       *
       * @param offset { Number } The offset to read data from (optional)
       * @return { Number }
       */
      readUInt32LE(offset) {
        return this._readNumberValue(Buffer.prototype.readUInt32LE, 4, offset);
      }
      /**
       * Reads a BigUInt64BE value from the current read position or an optionally provided offset.
       *
       * @param offset { Number } The offset to read data from (optional)
       * @return { BigInt }
       */
      readBigUInt64BE(offset) {
        utils_1.bigIntAndBufferInt64Check("readBigUInt64BE");
        return this._readNumberValue(Buffer.prototype.readBigUInt64BE, 8, offset);
      }
      /**
       * Reads a BigUInt64LE value from the current read position or an optionally provided offset.
       *
       * @param offset { Number } The offset to read data from (optional)
       * @return { BigInt }
       */
      readBigUInt64LE(offset) {
        utils_1.bigIntAndBufferInt64Check("readBigUInt64LE");
        return this._readNumberValue(Buffer.prototype.readBigUInt64LE, 8, offset);
      }
      /**
       * Writes an UInt8 value to the current write position (or at optional offset).
       *
       * @param value { Number } The value to write.
       * @param offset { Number } The offset to write the value at.
       *
       * @return this
       */
      writeUInt8(value, offset) {
        return this._writeNumberValue(Buffer.prototype.writeUInt8, 1, value, offset);
      }
      /**
       * Inserts an UInt8 value at the given offset value.
       *
       * @param value { Number } The value to insert.
       * @param offset { Number } The offset to insert the value at.
       *
       * @return this
       */
      insertUInt8(value, offset) {
        return this._insertNumberValue(Buffer.prototype.writeUInt8, 1, value, offset);
      }
      /**
       * Writes an UInt16BE value to the current write position (or at optional offset).
       *
       * @param value { Number } The value to write.
       * @param offset { Number } The offset to write the value at.
       *
       * @return this
       */
      writeUInt16BE(value, offset) {
        return this._writeNumberValue(Buffer.prototype.writeUInt16BE, 2, value, offset);
      }
      /**
       * Inserts an UInt16BE value at the given offset value.
       *
       * @param value { Number } The value to insert.
       * @param offset { Number } The offset to insert the value at.
       *
       * @return this
       */
      insertUInt16BE(value, offset) {
        return this._insertNumberValue(Buffer.prototype.writeUInt16BE, 2, value, offset);
      }
      /**
       * Writes an UInt16LE value to the current write position (or at optional offset).
       *
       * @param value { Number } The value to write.
       * @param offset { Number } The offset to write the value at.
       *
       * @return this
       */
      writeUInt16LE(value, offset) {
        return this._writeNumberValue(Buffer.prototype.writeUInt16LE, 2, value, offset);
      }
      /**
       * Inserts an UInt16LE value at the given offset value.
       *
       * @param value { Number } The value to insert.
       * @param offset { Number } The offset to insert the value at.
       *
       * @return this
       */
      insertUInt16LE(value, offset) {
        return this._insertNumberValue(Buffer.prototype.writeUInt16LE, 2, value, offset);
      }
      /**
       * Writes an UInt32BE value to the current write position (or at optional offset).
       *
       * @param value { Number } The value to write.
       * @param offset { Number } The offset to write the value at.
       *
       * @return this
       */
      writeUInt32BE(value, offset) {
        return this._writeNumberValue(Buffer.prototype.writeUInt32BE, 4, value, offset);
      }
      /**
       * Inserts an UInt32BE value at the given offset value.
       *
       * @param value { Number } The value to insert.
       * @param offset { Number } The offset to insert the value at.
       *
       * @return this
       */
      insertUInt32BE(value, offset) {
        return this._insertNumberValue(Buffer.prototype.writeUInt32BE, 4, value, offset);
      }
      /**
       * Writes an UInt32LE value to the current write position (or at optional offset).
       *
       * @param value { Number } The value to write.
       * @param offset { Number } The offset to write the value at.
       *
       * @return this
       */
      writeUInt32LE(value, offset) {
        return this._writeNumberValue(Buffer.prototype.writeUInt32LE, 4, value, offset);
      }
      /**
       * Inserts an UInt32LE value at the given offset value.
       *
       * @param value { Number } The value to insert.
       * @param offset { Number } The offset to insert the value at.
       *
       * @return this
       */
      insertUInt32LE(value, offset) {
        return this._insertNumberValue(Buffer.prototype.writeUInt32LE, 4, value, offset);
      }
      /**
       * Writes a BigUInt64BE value to the current write position (or at optional offset).
       *
       * @param value { Number } The value to write.
       * @param offset { Number } The offset to write the value at.
       *
       * @return this
       */
      writeBigUInt64BE(value, offset) {
        utils_1.bigIntAndBufferInt64Check("writeBigUInt64BE");
        return this._writeNumberValue(Buffer.prototype.writeBigUInt64BE, 8, value, offset);
      }
      /**
       * Inserts a BigUInt64BE value at the given offset value.
       *
       * @param value { Number } The value to insert.
       * @param offset { Number } The offset to insert the value at.
       *
       * @return this
       */
      insertBigUInt64BE(value, offset) {
        utils_1.bigIntAndBufferInt64Check("writeBigUInt64BE");
        return this._insertNumberValue(Buffer.prototype.writeBigUInt64BE, 8, value, offset);
      }
      /**
       * Writes a BigUInt64LE value to the current write position (or at optional offset).
       *
       * @param value { Number } The value to write.
       * @param offset { Number } The offset to write the value at.
       *
       * @return this
       */
      writeBigUInt64LE(value, offset) {
        utils_1.bigIntAndBufferInt64Check("writeBigUInt64LE");
        return this._writeNumberValue(Buffer.prototype.writeBigUInt64LE, 8, value, offset);
      }
      /**
       * Inserts a BigUInt64LE value at the given offset value.
       *
       * @param value { Number } The value to insert.
       * @param offset { Number } The offset to insert the value at.
       *
       * @return this
       */
      insertBigUInt64LE(value, offset) {
        utils_1.bigIntAndBufferInt64Check("writeBigUInt64LE");
        return this._insertNumberValue(Buffer.prototype.writeBigUInt64LE, 8, value, offset);
      }
      // Floating Point
      /**
       * Reads an FloatBE value from the current read position or an optionally provided offset.
       *
       * @param offset { Number } The offset to read data from (optional)
       * @return { Number }
       */
      readFloatBE(offset) {
        return this._readNumberValue(Buffer.prototype.readFloatBE, 4, offset);
      }
      /**
       * Reads an FloatLE value from the current read position or an optionally provided offset.
       *
       * @param offset { Number } The offset to read data from (optional)
       * @return { Number }
       */
      readFloatLE(offset) {
        return this._readNumberValue(Buffer.prototype.readFloatLE, 4, offset);
      }
      /**
       * Writes a FloatBE value to the current write position (or at optional offset).
       *
       * @param value { Number } The value to write.
       * @param offset { Number } The offset to write the value at.
       *
       * @return this
       */
      writeFloatBE(value, offset) {
        return this._writeNumberValue(Buffer.prototype.writeFloatBE, 4, value, offset);
      }
      /**
       * Inserts a FloatBE value at the given offset value.
       *
       * @param value { Number } The value to insert.
       * @param offset { Number } The offset to insert the value at.
       *
       * @return this
       */
      insertFloatBE(value, offset) {
        return this._insertNumberValue(Buffer.prototype.writeFloatBE, 4, value, offset);
      }
      /**
       * Writes a FloatLE value to the current write position (or at optional offset).
       *
       * @param value { Number } The value to write.
       * @param offset { Number } The offset to write the value at.
       *
       * @return this
       */
      writeFloatLE(value, offset) {
        return this._writeNumberValue(Buffer.prototype.writeFloatLE, 4, value, offset);
      }
      /**
       * Inserts a FloatLE value at the given offset value.
       *
       * @param value { Number } The value to insert.
       * @param offset { Number } The offset to insert the value at.
       *
       * @return this
       */
      insertFloatLE(value, offset) {
        return this._insertNumberValue(Buffer.prototype.writeFloatLE, 4, value, offset);
      }
      // Double Floating Point
      /**
       * Reads an DoublEBE value from the current read position or an optionally provided offset.
       *
       * @param offset { Number } The offset to read data from (optional)
       * @return { Number }
       */
      readDoubleBE(offset) {
        return this._readNumberValue(Buffer.prototype.readDoubleBE, 8, offset);
      }
      /**
       * Reads an DoubleLE value from the current read position or an optionally provided offset.
       *
       * @param offset { Number } The offset to read data from (optional)
       * @return { Number }
       */
      readDoubleLE(offset) {
        return this._readNumberValue(Buffer.prototype.readDoubleLE, 8, offset);
      }
      /**
       * Writes a DoubleBE value to the current write position (or at optional offset).
       *
       * @param value { Number } The value to write.
       * @param offset { Number } The offset to write the value at.
       *
       * @return this
       */
      writeDoubleBE(value, offset) {
        return this._writeNumberValue(Buffer.prototype.writeDoubleBE, 8, value, offset);
      }
      /**
       * Inserts a DoubleBE value at the given offset value.
       *
       * @param value { Number } The value to insert.
       * @param offset { Number } The offset to insert the value at.
       *
       * @return this
       */
      insertDoubleBE(value, offset) {
        return this._insertNumberValue(Buffer.prototype.writeDoubleBE, 8, value, offset);
      }
      /**
       * Writes a DoubleLE value to the current write position (or at optional offset).
       *
       * @param value { Number } The value to write.
       * @param offset { Number } The offset to write the value at.
       *
       * @return this
       */
      writeDoubleLE(value, offset) {
        return this._writeNumberValue(Buffer.prototype.writeDoubleLE, 8, value, offset);
      }
      /**
       * Inserts a DoubleLE value at the given offset value.
       *
       * @param value { Number } The value to insert.
       * @param offset { Number } The offset to insert the value at.
       *
       * @return this
       */
      insertDoubleLE(value, offset) {
        return this._insertNumberValue(Buffer.prototype.writeDoubleLE, 8, value, offset);
      }
      // Strings
      /**
       * Reads a String from the current read position.
       *
       * @param arg1 { Number | String } The number of bytes to read as a String, or the BufferEncoding to use for
       *             the string (Defaults to instance level encoding).
       * @param encoding { String } The BufferEncoding to use for the string (Defaults to instance level encoding).
       *
       * @return { String }
       */
      readString(arg1, encoding) {
        let lengthVal;
        if (typeof arg1 === "number") {
          utils_1.checkLengthValue(arg1);
          lengthVal = Math.min(arg1, this.length - this._readOffset);
        } else {
          encoding = arg1;
          lengthVal = this.length - this._readOffset;
        }
        if (typeof encoding !== "undefined") {
          utils_1.checkEncoding(encoding);
        }
        const value = this._buff.slice(this._readOffset, this._readOffset + lengthVal).toString(encoding || this._encoding);
        this._readOffset += lengthVal;
        return value;
      }
      /**
       * Inserts a String
       *
       * @param value { String } The String value to insert.
       * @param offset { Number } The offset to insert the string at.
       * @param encoding { String } The BufferEncoding to use for writing strings (defaults to instance encoding).
       *
       * @return this
       */
      insertString(value, offset, encoding) {
        utils_1.checkOffsetValue(offset);
        return this._handleString(value, true, offset, encoding);
      }
      /**
       * Writes a String
       *
       * @param value { String } The String value to write.
       * @param arg2 { Number | String } The offset to write the string at, or the BufferEncoding to use.
       * @param encoding { String } The BufferEncoding to use for writing strings (defaults to instance encoding).
       *
       * @return this
       */
      writeString(value, arg2, encoding) {
        return this._handleString(value, false, arg2, encoding);
      }
      /**
       * Reads a null-terminated String from the current read position.
       *
       * @param encoding { String } The BufferEncoding to use for the string (Defaults to instance level encoding).
       *
       * @return { String }
       */
      readStringNT(encoding) {
        if (typeof encoding !== "undefined") {
          utils_1.checkEncoding(encoding);
        }
        let nullPos = this.length;
        for (let i = this._readOffset; i < this.length; i++) {
          if (this._buff[i] === 0) {
            nullPos = i;
            break;
          }
        }
        const value = this._buff.slice(this._readOffset, nullPos);
        this._readOffset = nullPos + 1;
        return value.toString(encoding || this._encoding);
      }
      /**
       * Inserts a null-terminated String.
       *
       * @param value { String } The String value to write.
       * @param arg2 { Number | String } The offset to write the string to, or the BufferEncoding to use.
       * @param encoding { String } The BufferEncoding to use for writing strings (defaults to instance encoding).
       *
       * @return this
       */
      insertStringNT(value, offset, encoding) {
        utils_1.checkOffsetValue(offset);
        this.insertString(value, offset, encoding);
        this.insertUInt8(0, offset + value.length);
        return this;
      }
      /**
       * Writes a null-terminated String.
       *
       * @param value { String } The String value to write.
       * @param arg2 { Number | String } The offset to write the string to, or the BufferEncoding to use.
       * @param encoding { String } The BufferEncoding to use for writing strings (defaults to instance encoding).
       *
       * @return this
       */
      writeStringNT(value, arg2, encoding) {
        this.writeString(value, arg2, encoding);
        this.writeUInt8(0, typeof arg2 === "number" ? arg2 + value.length : this.writeOffset);
        return this;
      }
      // Buffers
      /**
       * Reads a Buffer from the internal read position.
       *
       * @param length { Number } The length of data to read as a Buffer.
       *
       * @return { Buffer }
       */
      readBuffer(length) {
        if (typeof length !== "undefined") {
          utils_1.checkLengthValue(length);
        }
        const lengthVal = typeof length === "number" ? length : this.length;
        const endPoint = Math.min(this.length, this._readOffset + lengthVal);
        const value = this._buff.slice(this._readOffset, endPoint);
        this._readOffset = endPoint;
        return value;
      }
      /**
       * Writes a Buffer to the current write position.
       *
       * @param value { Buffer } The Buffer to write.
       * @param offset { Number } The offset to write the Buffer to.
       *
       * @return this
       */
      insertBuffer(value, offset) {
        utils_1.checkOffsetValue(offset);
        return this._handleBuffer(value, true, offset);
      }
      /**
       * Writes a Buffer to the current write position.
       *
       * @param value { Buffer } The Buffer to write.
       * @param offset { Number } The offset to write the Buffer to.
       *
       * @return this
       */
      writeBuffer(value, offset) {
        return this._handleBuffer(value, false, offset);
      }
      /**
       * Reads a null-terminated Buffer from the current read poisiton.
       *
       * @return { Buffer }
       */
      readBufferNT() {
        let nullPos = this.length;
        for (let i = this._readOffset; i < this.length; i++) {
          if (this._buff[i] === 0) {
            nullPos = i;
            break;
          }
        }
        const value = this._buff.slice(this._readOffset, nullPos);
        this._readOffset = nullPos + 1;
        return value;
      }
      /**
       * Inserts a null-terminated Buffer.
       *
       * @param value { Buffer } The Buffer to write.
       * @param offset { Number } The offset to write the Buffer to.
       *
       * @return this
       */
      insertBufferNT(value, offset) {
        utils_1.checkOffsetValue(offset);
        this.insertBuffer(value, offset);
        this.insertUInt8(0, offset + value.length);
        return this;
      }
      /**
       * Writes a null-terminated Buffer.
       *
       * @param value { Buffer } The Buffer to write.
       * @param offset { Number } The offset to write the Buffer to.
       *
       * @return this
       */
      writeBufferNT(value, offset) {
        if (typeof offset !== "undefined") {
          utils_1.checkOffsetValue(offset);
        }
        this.writeBuffer(value, offset);
        this.writeUInt8(0, typeof offset === "number" ? offset + value.length : this._writeOffset);
        return this;
      }
      /**
       * Clears the SmartBuffer instance to its original empty state.
       */
      clear() {
        this._writeOffset = 0;
        this._readOffset = 0;
        this.length = 0;
        return this;
      }
      /**
       * Gets the remaining data left to be read from the SmartBuffer instance.
       *
       * @return { Number }
       */
      remaining() {
        return this.length - this._readOffset;
      }
      /**
       * Gets the current read offset value of the SmartBuffer instance.
       *
       * @return { Number }
       */
      get readOffset() {
        return this._readOffset;
      }
      /**
       * Sets the read offset value of the SmartBuffer instance.
       *
       * @param offset { Number } - The offset value to set.
       */
      set readOffset(offset) {
        utils_1.checkOffsetValue(offset);
        utils_1.checkTargetOffset(offset, this);
        this._readOffset = offset;
      }
      /**
       * Gets the current write offset value of the SmartBuffer instance.
       *
       * @return { Number }
       */
      get writeOffset() {
        return this._writeOffset;
      }
      /**
       * Sets the write offset value of the SmartBuffer instance.
       *
       * @param offset { Number } - The offset value to set.
       */
      set writeOffset(offset) {
        utils_1.checkOffsetValue(offset);
        utils_1.checkTargetOffset(offset, this);
        this._writeOffset = offset;
      }
      /**
       * Gets the currently set string encoding of the SmartBuffer instance.
       *
       * @return { BufferEncoding } The string Buffer encoding currently set.
       */
      get encoding() {
        return this._encoding;
      }
      /**
       * Sets the string encoding of the SmartBuffer instance.
       *
       * @param encoding { BufferEncoding } The string Buffer encoding to set.
       */
      set encoding(encoding) {
        utils_1.checkEncoding(encoding);
        this._encoding = encoding;
      }
      /**
       * Gets the underlying internal Buffer. (This includes unmanaged data in the Buffer)
       *
       * @return { Buffer } The Buffer value.
       */
      get internalBuffer() {
        return this._buff;
      }
      /**
       * Gets the value of the internal managed Buffer (Includes managed data only)
       *
       * @param { Buffer }
       */
      toBuffer() {
        return this._buff.slice(0, this.length);
      }
      /**
       * Gets the String value of the internal managed Buffer
       *
       * @param encoding { String } The BufferEncoding to display the Buffer as (defaults to instance level encoding).
       */
      toString(encoding) {
        const encodingVal = typeof encoding === "string" ? encoding : this._encoding;
        utils_1.checkEncoding(encodingVal);
        return this._buff.toString(encodingVal, 0, this.length);
      }
      /**
       * Destroys the SmartBuffer instance.
       */
      destroy() {
        this.clear();
        return this;
      }
      /**
       * Handles inserting and writing strings.
       *
       * @param value { String } The String value to insert.
       * @param isInsert { Boolean } True if inserting a string, false if writing.
       * @param arg2 { Number | String } The offset to insert the string at, or the BufferEncoding to use.
       * @param encoding { String } The BufferEncoding to use for writing strings (defaults to instance encoding).
       */
      _handleString(value, isInsert, arg3, encoding) {
        let offsetVal = this._writeOffset;
        let encodingVal = this._encoding;
        if (typeof arg3 === "number") {
          offsetVal = arg3;
        } else if (typeof arg3 === "string") {
          utils_1.checkEncoding(arg3);
          encodingVal = arg3;
        }
        if (typeof encoding === "string") {
          utils_1.checkEncoding(encoding);
          encodingVal = encoding;
        }
        const byteLength = Buffer.byteLength(value, encodingVal);
        if (isInsert) {
          this.ensureInsertable(byteLength, offsetVal);
        } else {
          this._ensureWriteable(byteLength, offsetVal);
        }
        this._buff.write(value, offsetVal, byteLength, encodingVal);
        if (isInsert) {
          this._writeOffset += byteLength;
        } else {
          if (typeof arg3 === "number") {
            this._writeOffset = Math.max(this._writeOffset, offsetVal + byteLength);
          } else {
            this._writeOffset += byteLength;
          }
        }
        return this;
      }
      /**
       * Handles writing or insert of a Buffer.
       *
       * @param value { Buffer } The Buffer to write.
       * @param offset { Number } The offset to write the Buffer to.
       */
      _handleBuffer(value, isInsert, offset) {
        const offsetVal = typeof offset === "number" ? offset : this._writeOffset;
        if (isInsert) {
          this.ensureInsertable(value.length, offsetVal);
        } else {
          this._ensureWriteable(value.length, offsetVal);
        }
        value.copy(this._buff, offsetVal);
        if (isInsert) {
          this._writeOffset += value.length;
        } else {
          if (typeof offset === "number") {
            this._writeOffset = Math.max(this._writeOffset, offsetVal + value.length);
          } else {
            this._writeOffset += value.length;
          }
        }
        return this;
      }
      /**
       * Ensures that the internal Buffer is large enough to read data.
       *
       * @param length { Number } The length of the data that needs to be read.
       * @param offset { Number } The offset of the data that needs to be read.
       */
      ensureReadable(length, offset) {
        let offsetVal = this._readOffset;
        if (typeof offset !== "undefined") {
          utils_1.checkOffsetValue(offset);
          offsetVal = offset;
        }
        if (offsetVal < 0 || offsetVal + length > this.length) {
          throw new Error(utils_1.ERRORS.INVALID_READ_BEYOND_BOUNDS);
        }
      }
      /**
       * Ensures that the internal Buffer is large enough to insert data.
       *
       * @param dataLength { Number } The length of the data that needs to be written.
       * @param offset { Number } The offset of the data to be written.
       */
      ensureInsertable(dataLength, offset) {
        utils_1.checkOffsetValue(offset);
        this._ensureCapacity(this.length + dataLength);
        if (offset < this.length) {
          this._buff.copy(this._buff, offset + dataLength, offset, this._buff.length);
        }
        if (offset + dataLength > this.length) {
          this.length = offset + dataLength;
        } else {
          this.length += dataLength;
        }
      }
      /**
       * Ensures that the internal Buffer is large enough to write data.
       *
       * @param dataLength { Number } The length of the data that needs to be written.
       * @param offset { Number } The offset of the data to be written (defaults to writeOffset).
       */
      _ensureWriteable(dataLength, offset) {
        const offsetVal = typeof offset === "number" ? offset : this._writeOffset;
        this._ensureCapacity(offsetVal + dataLength);
        if (offsetVal + dataLength > this.length) {
          this.length = offsetVal + dataLength;
        }
      }
      /**
       * Ensures that the internal Buffer is large enough to write at least the given amount of data.
       *
       * @param minLength { Number } The minimum length of the data needs to be written.
       */
      _ensureCapacity(minLength) {
        const oldLength = this._buff.length;
        if (minLength > oldLength) {
          let data = this._buff;
          let newLength = oldLength * 3 / 2 + 1;
          if (newLength < minLength) {
            newLength = minLength;
          }
          this._buff = Buffer.allocUnsafe(newLength);
          data.copy(this._buff, 0, 0, oldLength);
        }
      }
      /**
       * Reads a numeric number value using the provided function.
       *
       * @typeparam T { number | bigint } The type of the value to be read
       *
       * @param func { Function(offset: number) => number } The function to read data on the internal Buffer with.
       * @param byteSize { Number } The number of bytes read.
       * @param offset { Number } The offset to read from (optional). When this is not provided, the managed readOffset is used instead.
       *
       * @returns { T } the number value
       */
      _readNumberValue(func, byteSize, offset) {
        this.ensureReadable(byteSize, offset);
        const value = func.call(this._buff, typeof offset === "number" ? offset : this._readOffset);
        if (typeof offset === "undefined") {
          this._readOffset += byteSize;
        }
        return value;
      }
      /**
       * Inserts a numeric number value based on the given offset and value.
       *
       * @typeparam T { number | bigint } The type of the value to be written
       *
       * @param func { Function(offset: T, offset?) => number} The function to write data on the internal Buffer with.
       * @param byteSize { Number } The number of bytes written.
       * @param value { T } The number value to write.
       * @param offset { Number } the offset to write the number at (REQUIRED).
       *
       * @returns SmartBuffer this buffer
       */
      _insertNumberValue(func, byteSize, value, offset) {
        utils_1.checkOffsetValue(offset);
        this.ensureInsertable(byteSize, offset);
        func.call(this._buff, value, offset);
        this._writeOffset += byteSize;
        return this;
      }
      /**
       * Writes a numeric number value based on the given offset and value.
       *
       * @typeparam T { number | bigint } The type of the value to be written
       *
       * @param func { Function(offset: T, offset?) => number} The function to write data on the internal Buffer with.
       * @param byteSize { Number } The number of bytes written.
       * @param value { T } The number value to write.
       * @param offset { Number } the offset to write the number at (REQUIRED).
       *
       * @returns SmartBuffer this buffer
       */
      _writeNumberValue(func, byteSize, value, offset) {
        if (typeof offset === "number") {
          if (offset < 0) {
            throw new Error(utils_1.ERRORS.INVALID_WRITE_BEYOND_BOUNDS);
          }
          utils_1.checkOffsetValue(offset);
        }
        const offsetVal = typeof offset === "number" ? offset : this._writeOffset;
        this._ensureWriteable(byteSize, offsetVal);
        func.call(this._buff, value, offsetVal);
        if (typeof offset === "number") {
          this._writeOffset = Math.max(this._writeOffset, offsetVal + byteSize);
        } else {
          this._writeOffset += byteSize;
        }
        return this;
      }
    };
    exports2.SmartBuffer = SmartBuffer;
  }
});

// node_modules/socks/build/common/constants.js
var require_constants2 = __commonJS({
  "node_modules/socks/build/common/constants.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.SOCKS5_NO_ACCEPTABLE_AUTH = exports2.SOCKS5_CUSTOM_AUTH_END = exports2.SOCKS5_CUSTOM_AUTH_START = exports2.SOCKS_INCOMING_PACKET_SIZES = exports2.SocksClientState = exports2.Socks5Response = exports2.Socks5HostType = exports2.Socks5Auth = exports2.Socks4Response = exports2.SocksCommand = exports2.ERRORS = exports2.DEFAULT_TIMEOUT = void 0;
    var DEFAULT_TIMEOUT = 3e4;
    exports2.DEFAULT_TIMEOUT = DEFAULT_TIMEOUT;
    var ERRORS = {
      InvalidSocksCommand: "An invalid SOCKS command was provided. Valid options are connect, bind, and associate.",
      InvalidSocksCommandForOperation: "An invalid SOCKS command was provided. Only a subset of commands are supported for this operation.",
      InvalidSocksCommandChain: "An invalid SOCKS command was provided. Chaining currently only supports the connect command.",
      InvalidSocksClientOptionsDestination: "An invalid destination host was provided.",
      InvalidSocksClientOptionsExistingSocket: "An invalid existing socket was provided. This should be an instance of stream.Duplex.",
      InvalidSocksClientOptionsProxy: "Invalid SOCKS proxy details were provided.",
      InvalidSocksClientOptionsTimeout: "An invalid timeout value was provided. Please enter a value above 0 (in ms).",
      InvalidSocksClientOptionsProxiesLength: "At least two socks proxies must be provided for chaining.",
      InvalidSocksClientOptionsCustomAuthRange: "Custom auth must be a value between 0x80 and 0xFE.",
      InvalidSocksClientOptionsCustomAuthOptions: "When a custom_auth_method is provided, custom_auth_request_handler, custom_auth_response_size, and custom_auth_response_handler must also be provided and valid.",
      NegotiationError: "Negotiation error",
      SocketClosed: "Socket closed",
      ProxyConnectionTimedOut: "Proxy connection timed out",
      InternalError: "SocksClient internal error (this should not happen)",
      InvalidSocks4HandshakeResponse: "Received invalid Socks4 handshake response",
      Socks4ProxyRejectedConnection: "Socks4 Proxy rejected connection",
      InvalidSocks4IncomingConnectionResponse: "Socks4 invalid incoming connection response",
      Socks4ProxyRejectedIncomingBoundConnection: "Socks4 Proxy rejected incoming bound connection",
      InvalidSocks5InitialHandshakeResponse: "Received invalid Socks5 initial handshake response",
      InvalidSocks5IntiailHandshakeSocksVersion: "Received invalid Socks5 initial handshake (invalid socks version)",
      InvalidSocks5InitialHandshakeNoAcceptedAuthType: "Received invalid Socks5 initial handshake (no accepted authentication type)",
      InvalidSocks5InitialHandshakeUnknownAuthType: "Received invalid Socks5 initial handshake (unknown authentication type)",
      Socks5AuthenticationFailed: "Socks5 Authentication failed",
      InvalidSocks5FinalHandshake: "Received invalid Socks5 final handshake response",
      InvalidSocks5FinalHandshakeRejected: "Socks5 proxy rejected connection",
      InvalidSocks5IncomingConnectionResponse: "Received invalid Socks5 incoming connection response",
      Socks5ProxyRejectedIncomingBoundConnection: "Socks5 Proxy rejected incoming bound connection"
    };
    exports2.ERRORS = ERRORS;
    var SOCKS_INCOMING_PACKET_SIZES = {
      Socks5InitialHandshakeResponse: 2,
      Socks5UserPassAuthenticationResponse: 2,
      // Command response + incoming connection (bind)
      Socks5ResponseHeader: 5,
      // We need at least 5 to read the hostname length, then we wait for the address+port information.
      Socks5ResponseIPv4: 10,
      // 4 header + 4 ip + 2 port
      Socks5ResponseIPv6: 22,
      // 4 header + 16 ip + 2 port
      Socks5ResponseHostname: (hostNameLength) => hostNameLength + 7,
      // 4 header + 1 host length + host + 2 port
      // Command response + incoming connection (bind)
      Socks4Response: 8
      // 2 header + 2 port + 4 ip
    };
    exports2.SOCKS_INCOMING_PACKET_SIZES = SOCKS_INCOMING_PACKET_SIZES;
    var SocksCommand;
    (function(SocksCommand2) {
      SocksCommand2[SocksCommand2["connect"] = 1] = "connect";
      SocksCommand2[SocksCommand2["bind"] = 2] = "bind";
      SocksCommand2[SocksCommand2["associate"] = 3] = "associate";
    })(SocksCommand || (exports2.SocksCommand = SocksCommand = {}));
    var Socks4Response;
    (function(Socks4Response2) {
      Socks4Response2[Socks4Response2["Granted"] = 90] = "Granted";
      Socks4Response2[Socks4Response2["Failed"] = 91] = "Failed";
      Socks4Response2[Socks4Response2["Rejected"] = 92] = "Rejected";
      Socks4Response2[Socks4Response2["RejectedIdent"] = 93] = "RejectedIdent";
    })(Socks4Response || (exports2.Socks4Response = Socks4Response = {}));
    var Socks5Auth;
    (function(Socks5Auth2) {
      Socks5Auth2[Socks5Auth2["NoAuth"] = 0] = "NoAuth";
      Socks5Auth2[Socks5Auth2["GSSApi"] = 1] = "GSSApi";
      Socks5Auth2[Socks5Auth2["UserPass"] = 2] = "UserPass";
    })(Socks5Auth || (exports2.Socks5Auth = Socks5Auth = {}));
    var SOCKS5_CUSTOM_AUTH_START = 128;
    exports2.SOCKS5_CUSTOM_AUTH_START = SOCKS5_CUSTOM_AUTH_START;
    var SOCKS5_CUSTOM_AUTH_END = 254;
    exports2.SOCKS5_CUSTOM_AUTH_END = SOCKS5_CUSTOM_AUTH_END;
    var SOCKS5_NO_ACCEPTABLE_AUTH = 255;
    exports2.SOCKS5_NO_ACCEPTABLE_AUTH = SOCKS5_NO_ACCEPTABLE_AUTH;
    var Socks5Response;
    (function(Socks5Response2) {
      Socks5Response2[Socks5Response2["Granted"] = 0] = "Granted";
      Socks5Response2[Socks5Response2["Failure"] = 1] = "Failure";
      Socks5Response2[Socks5Response2["NotAllowed"] = 2] = "NotAllowed";
      Socks5Response2[Socks5Response2["NetworkUnreachable"] = 3] = "NetworkUnreachable";
      Socks5Response2[Socks5Response2["HostUnreachable"] = 4] = "HostUnreachable";
      Socks5Response2[Socks5Response2["ConnectionRefused"] = 5] = "ConnectionRefused";
      Socks5Response2[Socks5Response2["TTLExpired"] = 6] = "TTLExpired";
      Socks5Response2[Socks5Response2["CommandNotSupported"] = 7] = "CommandNotSupported";
      Socks5Response2[Socks5Response2["AddressNotSupported"] = 8] = "AddressNotSupported";
    })(Socks5Response || (exports2.Socks5Response = Socks5Response = {}));
    var Socks5HostType;
    (function(Socks5HostType2) {
      Socks5HostType2[Socks5HostType2["IPv4"] = 1] = "IPv4";
      Socks5HostType2[Socks5HostType2["Hostname"] = 3] = "Hostname";
      Socks5HostType2[Socks5HostType2["IPv6"] = 4] = "IPv6";
    })(Socks5HostType || (exports2.Socks5HostType = Socks5HostType = {}));
    var SocksClientState;
    (function(SocksClientState2) {
      SocksClientState2[SocksClientState2["Created"] = 0] = "Created";
      SocksClientState2[SocksClientState2["Connecting"] = 1] = "Connecting";
      SocksClientState2[SocksClientState2["Connected"] = 2] = "Connected";
      SocksClientState2[SocksClientState2["SentInitialHandshake"] = 3] = "SentInitialHandshake";
      SocksClientState2[SocksClientState2["ReceivedInitialHandshakeResponse"] = 4] = "ReceivedInitialHandshakeResponse";
      SocksClientState2[SocksClientState2["SentAuthentication"] = 5] = "SentAuthentication";
      SocksClientState2[SocksClientState2["ReceivedAuthenticationResponse"] = 6] = "ReceivedAuthenticationResponse";
      SocksClientState2[SocksClientState2["SentFinalHandshake"] = 7] = "SentFinalHandshake";
      SocksClientState2[SocksClientState2["ReceivedFinalResponse"] = 8] = "ReceivedFinalResponse";
      SocksClientState2[SocksClientState2["BoundWaitingForConnection"] = 9] = "BoundWaitingForConnection";
      SocksClientState2[SocksClientState2["Established"] = 10] = "Established";
      SocksClientState2[SocksClientState2["Disconnected"] = 11] = "Disconnected";
      SocksClientState2[SocksClientState2["Error"] = 99] = "Error";
    })(SocksClientState || (exports2.SocksClientState = SocksClientState = {}));
  }
});

// node_modules/socks/build/common/util.js
var require_util = __commonJS({
  "node_modules/socks/build/common/util.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.shuffleArray = exports2.SocksClientError = void 0;
    var SocksClientError = class extends Error {
      constructor(message, options2) {
        super(message);
        this.options = options2;
      }
    };
    exports2.SocksClientError = SocksClientError;
    function shuffleArray(array2) {
      for (let i = array2.length - 1; i > 0; i--) {
        const j = Math.floor(Math.random() * (i + 1));
        [array2[i], array2[j]] = [array2[j], array2[i]];
      }
    }
    exports2.shuffleArray = shuffleArray;
  }
});

// node_modules/ip-address/dist/address-error.js
var require_address_error = __commonJS({
  "node_modules/ip-address/dist/address-error.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.AddressError = void 0;
    var AddressError = class extends Error {
      constructor(message, parseMessage) {
        super(message);
        this.name = "AddressError";
        this.parseMessage = parseMessage;
      }
    };
    exports2.AddressError = AddressError;
  }
});

// node_modules/ip-address/dist/common.js
var require_common2 = __commonJS({
  "node_modules/ip-address/dist/common.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.isInSubnet = isInSubnet;
    exports2.isCorrect = isCorrect;
    exports2.prefixLengthFromMask = prefixLengthFromMask;
    exports2.numberToPaddedHex = numberToPaddedHex;
    exports2.stringToPaddedHex = stringToPaddedHex;
    exports2.testBit = testBit;
    var address_error_1 = require_address_error();
    function isInSubnet(address) {
      if (this.subnetMask < address.subnetMask) {
        return false;
      }
      if (this.mask(address.subnetMask) === address.mask()) {
        return true;
      }
      return false;
    }
    function isCorrect(defaultBits) {
      return function() {
        if (this.addressMinusSuffix !== this.correctForm()) {
          return false;
        }
        if (this.subnetMask === defaultBits && !this.parsedSubnet) {
          return true;
        }
        return this.parsedSubnet === String(this.subnetMask);
      };
    }
    function prefixLengthFromMask(value, totalBits) {
      const binary = value.toString(2).padStart(totalBits, "0");
      if (binary.length > totalBits) {
        throw new address_error_1.AddressError("Invalid subnet mask.");
      }
      const firstZero = binary.indexOf("0");
      if (firstZero === -1) {
        return totalBits;
      }
      if (binary.slice(firstZero).includes("1")) {
        throw new address_error_1.AddressError("Invalid subnet mask.");
      }
      return firstZero;
    }
    function numberToPaddedHex(number4) {
      return number4.toString(16).padStart(2, "0");
    }
    function stringToPaddedHex(numberString) {
      return numberToPaddedHex(parseInt(numberString, 10));
    }
    function testBit(binaryValue, position) {
      const { length } = binaryValue;
      if (position > length) {
        return false;
      }
      const positionInString = length - position;
      return binaryValue.substring(positionInString, positionInString + 1) === "1";
    }
  }
});

// node_modules/ip-address/dist/v4/constants.js
var require_constants3 = __commonJS({
  "node_modules/ip-address/dist/v4/constants.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.RE_SUBNET_STRING = exports2.RE_ADDRESS = exports2.GROUPS = exports2.BITS = void 0;
    exports2.BITS = 32;
    exports2.GROUPS = 4;
    exports2.RE_ADDRESS = /^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/g;
    exports2.RE_SUBNET_STRING = /\/\d{1,2}$/;
  }
});

// node_modules/ip-address/dist/ipv4.js
var require_ipv4 = __commonJS({
  "node_modules/ip-address/dist/ipv4.js"(exports2) {
    "use strict";
    var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) {
      if (k2 === void 0) k2 = k;
      var desc = Object.getOwnPropertyDescriptor(m, k);
      if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
        desc = { enumerable: true, get: function() {
          return m[k];
        } };
      }
      Object.defineProperty(o, k2, desc);
    }) : (function(o, m, k, k2) {
      if (k2 === void 0) k2 = k;
      o[k2] = m[k];
    }));
    var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) {
      Object.defineProperty(o, "default", { enumerable: true, value: v });
    }) : function(o, v) {
      o["default"] = v;
    });
    var __importStar = exports2 && exports2.__importStar || function(mod) {
      if (mod && mod.__esModule) return mod;
      var result = {};
      if (mod != null) {
        for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
      }
      __setModuleDefault(result, mod);
      return result;
    };
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.Address4 = void 0;
    var common = __importStar(require_common2());
    var constants = __importStar(require_constants3());
    var address_error_1 = require_address_error();
    var isCorrect4 = common.isCorrect(constants.BITS);
    var Address4 = class _Address4 {
      constructor(address) {
        this.groups = constants.GROUPS;
        this.parsedAddress = [];
        this.parsedSubnet = "";
        this.subnet = "/32";
        this.subnetMask = 32;
        this.v4 = true;
        this.isCorrect = isCorrect4;
        this.isInSubnet = common.isInSubnet;
        this.address = address;
        const subnet = constants.RE_SUBNET_STRING.exec(address);
        if (subnet) {
          this.parsedSubnet = subnet[0].replace("/", "");
          this.subnetMask = parseInt(this.parsedSubnet, 10);
          this.subnet = `/${this.subnetMask}`;
          if (this.subnetMask < 0 || this.subnetMask > constants.BITS) {
            throw new address_error_1.AddressError("Invalid subnet mask.");
          }
          address = address.replace(constants.RE_SUBNET_STRING, "");
        }
        this.addressMinusSuffix = address;
        this.parsedAddress = this.parse(address);
      }
      /**
       * Returns true if the given string is a valid IPv4 address (with optional
       * CIDR subnet), false otherwise. Host bits in the subnet portion are
       * allowed (e.g. `192.168.1.5/24` is valid); for strict network-address
       * validation compare `correctForm()` to `startAddress().correctForm()`,
       * or use `networkForm()`.
       */
      static isValid(address) {
        try {
          new _Address4(address);
          return true;
        } catch (e) {
          return false;
        }
      }
      /**
       * Parses an IPv4 address string into its four octet groups and stores the
       * result on `this.parsedAddress`. Called automatically by the constructor;
       * you typically don't need to call it directly. Throws `AddressError` if
       * the input is not a valid IPv4 address.
       */
      parse(address) {
        const groups = address.split(".");
        if (!address.match(constants.RE_ADDRESS)) {
          throw new address_error_1.AddressError("Invalid IPv4 address.");
        }
        return groups;
      }
      /**
       * Returns the address in correct form: octets joined with `.` and any
       * leading zeros stripped (e.g. `192.168.1.1`). For IPv4 this matches the
       * canonical dotted-decimal representation.
       */
      correctForm() {
        return this.parsedAddress.map((part) => parseInt(part, 10)).join(".");
      }
      /**
       * Construct an `Address4` from an address and a dotted-decimal subnet
       * mask given as separate strings (e.g. as returned by Node's
       * `os.networkInterfaces()`). Throws `AddressError` if the mask is
       * non-contiguous (e.g. `255.0.255.0`).
       * @example
       * var address = Address4.fromAddressAndMask('192.168.1.1', '255.255.255.0');
       * address.subnetMask; // 24
       */
      static fromAddressAndMask(address, mask) {
        const bits = common.prefixLengthFromMask(new _Address4(mask).bigInt(), constants.BITS);
        return new _Address4(`${address}/${bits}`);
      }
      /**
       * Construct an `Address4` from an address and a Cisco-style wildcard mask
       * given as separate strings (e.g. `0.0.0.255` for a `/24`). The wildcard
       * mask is the bitwise inverse of the subnet mask. Throws `AddressError`
       * if the mask is non-contiguous (e.g. `0.255.0.255`).
       * @example
       * var address = Address4.fromAddressAndWildcardMask('10.0.0.1', '0.0.0.255');
       * address.subnetMask; // 24
       */
      static fromAddressAndWildcardMask(address, wildcardMask) {
        const wildcard = new _Address4(wildcardMask).bigInt();
        const allOnes = (BigInt(1) << BigInt(constants.BITS)) - BigInt(1);
        const mask = wildcard ^ allOnes;
        const bits = common.prefixLengthFromMask(mask, constants.BITS);
        return new _Address4(`${address}/${bits}`);
      }
      /**
       * Construct an `Address4` from a wildcard pattern with trailing `*`
       * octets. The number of trailing wildcards determines the prefix
       * length: each `*` represents 8 bits.
       *
       * Only trailing whole-octet wildcards are supported. Partial-octet
       * wildcards (e.g. `192.168.0.1*`) and interior wildcards (e.g.
       * `192.*.0.1`) throw `AddressError`.
       * @example
       * Address4.fromWildcard('192.168.0.*').subnet;   // '/24'
       * Address4.fromWildcard('192.168.*.*').subnet;   // '/16'
       * Address4.fromWildcard('*.*.*.*').subnet;       // '/0'
       */
      static fromWildcard(input) {
        const groups = input.split(".");
        if (groups.length !== constants.GROUPS) {
          throw new address_error_1.AddressError("Wildcard pattern must have 4 octets");
        }
        let firstWildcard = -1;
        for (let i = 0; i < groups.length; i++) {
          if (groups[i] === "*") {
            if (firstWildcard === -1) {
              firstWildcard = i;
            }
          } else if (firstWildcard !== -1) {
            throw new address_error_1.AddressError("Wildcard `*` must only appear in trailing octets (e.g. `192.168.0.*`)");
          }
        }
        const trailing = firstWildcard === -1 ? 0 : groups.length - firstWildcard;
        const replaced = groups.map((g) => g === "*" ? "0" : g);
        const subnetBits = constants.BITS - trailing * 8;
        return new _Address4(`${replaced.join(".")}/${subnetBits}`);
      }
      /**
       * Converts a hex string to an IPv4 address object. Accepts 8 hex digits
       * with optional `:` separators (e.g. `'7f000001'` or `'7f:00:00:01'`).
       * Throws `AddressError` for any other length or for non-hex characters.
       * @param {string} hex - a hex string to convert
       * @returns {Address4}
       */
      static fromHex(hex3) {
        const stripped = hex3.replace(/:/g, "");
        if (!/^[0-9a-fA-F]{8}$/.test(stripped)) {
          throw new address_error_1.AddressError("IPv4 hex must be exactly 8 hex digits");
        }
        const groups = [];
        for (let i = 0; i < 8; i += 2) {
          groups.push(parseInt(stripped.slice(i, i + 2), 16));
        }
        return new _Address4(groups.join("."));
      }
      /**
       * Converts an integer into a IPv4 address object. The integer must be a
       * non-negative safe integer in the range `[0, 2**32 - 1]`; otherwise
       * `AddressError` is thrown.
       * @param {integer} integer - a number to convert
       * @returns {Address4}
       */
      static fromInteger(integer2) {
        if (!Number.isInteger(integer2) || integer2 < 0 || integer2 > 4294967295) {
          throw new address_error_1.AddressError("IPv4 integer must be in the range 0 to 2**32 - 1");
        }
        return _Address4.fromHex(integer2.toString(16).padStart(8, "0"));
      }
      /**
       * Return an address from in-addr.arpa form
       * @param {string} arpaFormAddress - an 'in-addr.arpa' form ipv4 address
       * @returns {Adress4}
       * @example
       * var address = Address4.fromArpa(42.2.0.192.in-addr.arpa.)
       * address.correctForm(); // '192.0.2.42'
       */
      static fromArpa(arpaFormAddress) {
        const leader = arpaFormAddress.replace(/(\.in-addr\.arpa)?\.$/, "");
        const address = leader.split(".").reverse().join(".");
        return new _Address4(address);
      }
      /**
       * Converts an IPv4 address object to a hex string
       * @returns {String}
       */
      toHex() {
        return this.parsedAddress.map((part) => common.stringToPaddedHex(part)).join(":");
      }
      /**
       * Converts an IPv4 address object to an array of bytes.
       *
       * To get a Node.js `Buffer`, wrap the result: `Buffer.from(address.toArray())`.
       * @returns {Array}
       */
      toArray() {
        return this.parsedAddress.map((part) => parseInt(part, 10));
      }
      /**
       * Converts an IPv4 address object to an IPv6 address group
       * @returns {String}
       */
      toGroup6() {
        const output = [];
        let i;
        for (i = 0; i < constants.GROUPS; i += 2) {
          output.push(`${common.stringToPaddedHex(this.parsedAddress[i])}${common.stringToPaddedHex(this.parsedAddress[i + 1])}`);
        }
        return output.join(":");
      }
      /**
       * Returns the address as a `bigint`
       * @returns {bigint}
       */
      bigInt() {
        return BigInt(`0x${this.parsedAddress.map((n) => common.stringToPaddedHex(n)).join("")}`);
      }
      /**
       * Helper function getting start address.
       * @returns {bigint}
       */
      _startAddress() {
        return BigInt(`0b${this.mask() + "0".repeat(constants.BITS - this.subnetMask)}`);
      }
      /**
       * The first address in the range given by this address' subnet.
       * Often referred to as the Network Address.
       * @returns {Address4}
       */
      startAddress() {
        return _Address4.fromBigInt(this._startAddress());
      }
      /**
       * The first host address in the range given by this address's subnet ie
       * the first address after the Network Address
       * @returns {Address4}
       */
      startAddressExclusive() {
        const adjust = BigInt("1");
        return _Address4.fromBigInt(this._startAddress() + adjust);
      }
      /**
       * Helper function getting end address.
       * @returns {bigint}
       */
      _endAddress() {
        return BigInt(`0b${this.mask() + "1".repeat(constants.BITS - this.subnetMask)}`);
      }
      /**
       * The last address in the range given by this address' subnet
       * Often referred to as the Broadcast
       * @returns {Address4}
       */
      endAddress() {
        return _Address4.fromBigInt(this._endAddress());
      }
      /**
       * The last host address in the range given by this address's subnet ie
       * the last address prior to the Broadcast Address
       * @returns {Address4}
       */
      endAddressExclusive() {
        const adjust = BigInt("1");
        return _Address4.fromBigInt(this._endAddress() - adjust);
      }
      /**
       * The dotted-decimal form of the subnet mask, e.g. `255.255.240.0` for
       * a `/20`. Returns an `Address4`; call `.correctForm()` for the string.
       * @returns {Address4}
       */
      subnetMaskAddress() {
        return _Address4.fromBigInt(BigInt(`0b${"1".repeat(this.subnetMask)}${"0".repeat(constants.BITS - this.subnetMask)}`));
      }
      /**
       * The Cisco-style wildcard mask, e.g. `0.0.0.255` for a `/24`. This is
       * the bitwise inverse of `subnetMaskAddress()`. Returns an `Address4`;
       * call `.correctForm()` for the string.
       * @returns {Address4}
       */
      wildcardMask() {
        return _Address4.fromBigInt(BigInt(`0b${"0".repeat(this.subnetMask)}${"1".repeat(constants.BITS - this.subnetMask)}`));
      }
      /**
       * The network address in CIDR string form, e.g. `192.168.1.0/24` for
       * `192.168.1.5/24`. For an address with no explicit subnet the prefix is
       * `/32`, e.g. `networkForm()` on `192.168.1.5` returns `192.168.1.5/32`.
       * @returns {string}
       */
      networkForm() {
        return `${this.startAddress().correctForm()}/${this.subnetMask}`;
      }
      /**
       * Converts a BigInt to a v4 address object. The value must be in the
       * range `[0, 2**32 - 1]`; otherwise `AddressError` is thrown.
       * @param {bigint} bigInt - a BigInt to convert
       * @returns {Address4}
       */
      static fromBigInt(bigInt) {
        if (bigInt < 0n || bigInt > 0xffffffffn) {
          throw new address_error_1.AddressError("IPv4 BigInt must be in the range 0 to 2**32 - 1");
        }
        return _Address4.fromHex(bigInt.toString(16).padStart(8, "0"));
      }
      /**
       * Convert a byte array to an Address4 object.
       *
       * To convert from a Node.js `Buffer`, spread it: `Address4.fromByteArray([...buf])`.
       * @param {Array<number>} bytes - an array of 4 bytes (0-255)
       * @returns {Address4}
       */
      static fromByteArray(bytes2) {
        if (bytes2.length !== 4) {
          throw new address_error_1.AddressError("IPv4 addresses require exactly 4 bytes");
        }
        for (let i = 0; i < bytes2.length; i++) {
          if (!Number.isInteger(bytes2[i]) || bytes2[i] < 0 || bytes2[i] > 255) {
            throw new address_error_1.AddressError("All bytes must be integers between 0 and 255");
          }
        }
        return this.fromUnsignedByteArray(bytes2);
      }
      /**
       * Convert an unsigned byte array to an Address4 object
       * @param {Array<number>} bytes - an array of 4 unsigned bytes (0-255)
       * @returns {Address4}
       */
      static fromUnsignedByteArray(bytes2) {
        if (bytes2.length !== 4) {
          throw new address_error_1.AddressError("IPv4 addresses require exactly 4 bytes");
        }
        const address = bytes2.join(".");
        return new _Address4(address);
      }
      /**
       * Returns the first n bits of the address, defaulting to the
       * subnet mask
       * @returns {String}
       */
      mask(mask) {
        if (mask === void 0) {
          mask = this.subnetMask;
        }
        return this.getBitsBase2(0, mask);
      }
      /**
       * Returns the bits in the given range as a base-2 string
       * @returns {string}
       */
      getBitsBase2(start, end) {
        return this.binaryZeroPad().slice(start, end);
      }
      /**
       * Return the reversed ip6.arpa form of the address
       * @param {Object} options
       * @param {boolean} options.omitSuffix - omit the "in-addr.arpa" suffix
       * @returns {String}
       */
      reverseForm(options2) {
        if (!options2) {
          options2 = {};
        }
        const reversed = this.correctForm().split(".").reverse().join(".");
        if (options2.omitSuffix) {
          return reversed;
        }
        return `${reversed}.in-addr.arpa.`;
      }
      /**
       * Returns true if the given address is a multicast address
       * @returns {boolean}
       */
      isMulticast() {
        return this.isInSubnet(MULTICAST_V4);
      }
      /**
       * Returns true if the address is in one of the [RFC 1918](https://datatracker.ietf.org/doc/html/rfc1918) private address ranges (`10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`).
       * @returns {boolean}
       */
      isPrivate() {
        return PRIVATE_V4.some((subnet) => this.isInSubnet(subnet));
      }
      /**
       * Returns true if the address is in the loopback range `127.0.0.0/8` ([RFC 1122](https://datatracker.ietf.org/doc/html/rfc1122)).
       * @returns {boolean}
       */
      isLoopback() {
        return this.isInSubnet(LOOPBACK_V4);
      }
      /**
       * Returns true if the address is in the link-local range `169.254.0.0/16` ([RFC 3927](https://datatracker.ietf.org/doc/html/rfc3927)).
       * @returns {boolean}
       */
      isLinkLocal() {
        return this.isInSubnet(LINK_LOCAL_V4);
      }
      /**
       * Returns true if the address is the unspecified address `0.0.0.0`.
       * @returns {boolean}
       */
      isUnspecified() {
        return this.isInSubnet(UNSPECIFIED_V4);
      }
      /**
       * Returns true if the address is the limited broadcast address `255.255.255.255` ([RFC 919](https://datatracker.ietf.org/doc/html/rfc919)).
       * @returns {boolean}
       */
      isBroadcast() {
        return this.isInSubnet(BROADCAST_V4);
      }
      /**
       * Returns true if the address is in the carrier-grade NAT range `100.64.0.0/10` ([RFC 6598](https://datatracker.ietf.org/doc/html/rfc6598)).
       * @returns {boolean}
       */
      isCGNAT() {
        return this.isInSubnet(CGNAT_V4);
      }
      /**
       * Returns a zero-padded base-2 string representation of the address
       * @returns {string}
       */
      binaryZeroPad() {
        if (this._binaryZeroPad === void 0) {
          this._binaryZeroPad = this.bigInt().toString(2).padStart(constants.BITS, "0");
        }
        return this._binaryZeroPad;
      }
      /**
       * Groups an IPv4 address for inclusion at the end of an IPv6 address
       * @returns {String}
       */
      groupForV6() {
        const segments = this.parsedAddress;
        return this.address.replace(constants.RE_ADDRESS, `<span class="hover-group group-v4 group-6">${segments.slice(0, 2).join(".")}</span>.<span class="hover-group group-v4 group-7">${segments.slice(2, 4).join(".")}</span>`);
      }
    };
    exports2.Address4 = Address4;
    var MULTICAST_V4 = new Address4("224.0.0.0/4");
    var PRIVATE_V4 = [
      new Address4("10.0.0.0/8"),
      new Address4("172.16.0.0/12"),
      new Address4("192.168.0.0/16")
    ];
    var LOOPBACK_V4 = new Address4("127.0.0.0/8");
    var LINK_LOCAL_V4 = new Address4("169.254.0.0/16");
    var UNSPECIFIED_V4 = new Address4("0.0.0.0/32");
    var BROADCAST_V4 = new Address4("255.255.255.255/32");
    var CGNAT_V4 = new Address4("100.64.0.0/10");
  }
});

// node_modules/ip-address/dist/v6/constants.js
var require_constants4 = __commonJS({
  "node_modules/ip-address/dist/v6/constants.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.RE_URL_WITH_PORT = exports2.RE_URL = exports2.RE_ZONE_STRING = exports2.RE_SUBNET_STRING = exports2.RE_BAD_ADDRESS = exports2.RE_BAD_CHARACTERS = exports2.TYPES = exports2.SCOPES = exports2.GROUPS = exports2.BITS = void 0;
    exports2.BITS = 128;
    exports2.GROUPS = 8;
    exports2.SCOPES = {
      0: "Reserved",
      1: "Interface local",
      2: "Link local",
      4: "Admin local",
      5: "Site local",
      8: "Organization local",
      14: "Global",
      15: "Reserved"
    };
    exports2.TYPES = {
      "ff01::1/128": "Multicast (All nodes on this interface)",
      "ff01::2/128": "Multicast (All routers on this interface)",
      "ff02::1/128": "Multicast (All nodes on this link)",
      "ff02::2/128": "Multicast (All routers on this link)",
      "ff05::2/128": "Multicast (All routers in this site)",
      "ff02::5/128": "Multicast (OSPFv3 AllSPF routers)",
      "ff02::6/128": "Multicast (OSPFv3 AllDR routers)",
      "ff02::9/128": "Multicast (RIP routers)",
      "ff02::a/128": "Multicast (EIGRP routers)",
      "ff02::d/128": "Multicast (PIM routers)",
      "ff02::16/128": "Multicast (MLDv2 reports)",
      "ff01::fb/128": "Multicast (mDNSv6)",
      "ff02::fb/128": "Multicast (mDNSv6)",
      "ff05::fb/128": "Multicast (mDNSv6)",
      "ff02::1:2/128": "Multicast (All DHCP servers and relay agents on this link)",
      "ff05::1:2/128": "Multicast (All DHCP servers and relay agents in this site)",
      "ff02::1:3/128": "Multicast (All DHCP servers on this link)",
      "ff05::1:3/128": "Multicast (All DHCP servers in this site)",
      "::/128": "Unspecified",
      "::1/128": "Loopback",
      "ff00::/8": "Multicast",
      "fe80::/10": "Link-local unicast",
      "fc00::/7": "Unique local",
      "2002::/16": "6to4",
      "2001:db8::/32": "Documentation",
      "64:ff9b::/96": "NAT64 (well-known)",
      "64:ff9b:1::/48": "NAT64 (local-use)"
    };
    exports2.RE_BAD_CHARACTERS = /([^0-9a-f:/%])/gi;
    exports2.RE_BAD_ADDRESS = /([0-9a-f]{5,}|:{3,}|[^:]:$|^:[^:]|\/$)/gi;
    exports2.RE_SUBNET_STRING = /\/\d{1,3}(?=%|$)/;
    exports2.RE_ZONE_STRING = /%.*$/;
    exports2.RE_URL = /^\[{0,1}([0-9a-f:]+)\]{0,1}/;
    exports2.RE_URL_WITH_PORT = /\[([0-9a-f:]+)\]:([0-9]{1,5})/;
  }
});

// node_modules/ip-address/dist/v6/helpers.js
var require_helpers2 = __commonJS({
  "node_modules/ip-address/dist/v6/helpers.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.escapeHtml = escapeHtml;
    exports2.spanAllZeroes = spanAllZeroes;
    exports2.spanAll = spanAll;
    exports2.spanLeadingZeroes = spanLeadingZeroes;
    exports2.simpleGroup = simpleGroup;
    function escapeHtml(s) {
      return s.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
    }
    function spanAllZeroes(s) {
      return escapeHtml(s).replace(/(0+)/g, '<span class="zero">$1</span>');
    }
    function spanAll(s, offset = 0) {
      const letters = s.split("");
      return letters.map((n, i) => `<span class="digit value-${escapeHtml(n)} position-${i + offset}">${spanAllZeroes(n)}</span>`).join("");
    }
    function spanLeadingZeroesSimple(group) {
      return escapeHtml(group).replace(/^(0+)/, '<span class="zero">$1</span>');
    }
    function spanLeadingZeroes(address) {
      const groups = address.split(":");
      return groups.map((g) => spanLeadingZeroesSimple(g)).join(":");
    }
    function simpleGroup(addressString, offset = 0) {
      const groups = addressString.split(":");
      return groups.map((g, i) => {
        if (/group-v4/.test(g)) {
          return g;
        }
        return `<span class="hover-group group-${i + offset}">${spanLeadingZeroesSimple(g)}</span>`;
      });
    }
  }
});

// node_modules/ip-address/dist/v6/regular-expressions.js
var require_regular_expressions = __commonJS({
  "node_modules/ip-address/dist/v6/regular-expressions.js"(exports2) {
    "use strict";
    var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) {
      if (k2 === void 0) k2 = k;
      var desc = Object.getOwnPropertyDescriptor(m, k);
      if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
        desc = { enumerable: true, get: function() {
          return m[k];
        } };
      }
      Object.defineProperty(o, k2, desc);
    }) : (function(o, m, k, k2) {
      if (k2 === void 0) k2 = k;
      o[k2] = m[k];
    }));
    var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) {
      Object.defineProperty(o, "default", { enumerable: true, value: v });
    }) : function(o, v) {
      o["default"] = v;
    });
    var __importStar = exports2 && exports2.__importStar || function(mod) {
      if (mod && mod.__esModule) return mod;
      var result = {};
      if (mod != null) {
        for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
      }
      __setModuleDefault(result, mod);
      return result;
    };
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.ADDRESS_BOUNDARY = void 0;
    exports2.groupPossibilities = groupPossibilities;
    exports2.padGroup = padGroup;
    exports2.simpleRegularExpression = simpleRegularExpression;
    exports2.possibleElisions = possibleElisions;
    var v6 = __importStar(require_constants4());
    function groupPossibilities(possibilities) {
      return `(${possibilities.join("|")})`;
    }
    function padGroup(group) {
      if (group.length < 4) {
        return `0{0,${4 - group.length}}${group}`;
      }
      return group;
    }
    exports2.ADDRESS_BOUNDARY = "[^A-Fa-f0-9:]";
    function simpleRegularExpression(groups) {
      const zeroIndexes = [];
      groups.forEach((group, i) => {
        const groupInteger = parseInt(group, 16);
        if (groupInteger === 0) {
          zeroIndexes.push(i);
        }
      });
      const possibilities = zeroIndexes.map((zeroIndex) => groups.map((group, i) => {
        if (i === zeroIndex) {
          const elision = i === 0 || i === v6.GROUPS - 1 ? ":" : "";
          return groupPossibilities([padGroup(group), elision]);
        }
        return padGroup(group);
      }).join(":"));
      possibilities.push(groups.map(padGroup).join(":"));
      return groupPossibilities(possibilities);
    }
    function possibleElisions(elidedGroups, moreLeft, moreRight) {
      const left = moreLeft ? "" : ":";
      const right = moreRight ? "" : ":";
      const possibilities = [];
      if (!moreLeft && !moreRight) {
        possibilities.push("::");
      }
      if (moreLeft && moreRight) {
        possibilities.push("");
      }
      if (moreRight && !moreLeft || !moreRight && moreLeft) {
        possibilities.push(":");
      }
      possibilities.push(`${left}(:0{1,4}){1,${elidedGroups - 1}}`);
      possibilities.push(`(0{1,4}:){1,${elidedGroups - 1}}${right}`);
      possibilities.push(`(0{1,4}:){${elidedGroups - 1}}0{1,4}`);
      for (let groups = 1; groups < elidedGroups - 1; groups++) {
        for (let position = 1; position < elidedGroups - groups; position++) {
          possibilities.push(`(0{1,4}:){${position}}:(0{1,4}:){${elidedGroups - position - groups - 1}}0{1,4}`);
        }
      }
      return groupPossibilities(possibilities);
    }
  }
});

// node_modules/ip-address/dist/ipv6.js
var require_ipv6 = __commonJS({
  "node_modules/ip-address/dist/ipv6.js"(exports2) {
    "use strict";
    var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) {
      if (k2 === void 0) k2 = k;
      var desc = Object.getOwnPropertyDescriptor(m, k);
      if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
        desc = { enumerable: true, get: function() {
          return m[k];
        } };
      }
      Object.defineProperty(o, k2, desc);
    }) : (function(o, m, k, k2) {
      if (k2 === void 0) k2 = k;
      o[k2] = m[k];
    }));
    var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) {
      Object.defineProperty(o, "default", { enumerable: true, value: v });
    }) : function(o, v) {
      o["default"] = v;
    });
    var __importStar = exports2 && exports2.__importStar || function(mod) {
      if (mod && mod.__esModule) return mod;
      var result = {};
      if (mod != null) {
        for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
      }
      __setModuleDefault(result, mod);
      return result;
    };
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.Address6 = void 0;
    var common = __importStar(require_common2());
    var constants4 = __importStar(require_constants3());
    var constants6 = __importStar(require_constants4());
    var helpers = __importStar(require_helpers2());
    var ipv4_1 = require_ipv4();
    var regular_expressions_1 = require_regular_expressions();
    var address_error_1 = require_address_error();
    var common_1 = require_common2();
    var isCorrect6 = common.isCorrect(constants6.BITS);
    function assert2(condition) {
      if (!condition) {
        throw new Error("Assertion failed.");
      }
    }
    function addCommas(number4) {
      const r = /(\d+)(\d{3})/;
      while (r.test(number4)) {
        number4 = number4.replace(r, "$1,$2");
      }
      return number4;
    }
    function spanLeadingZeroes4(n) {
      n = n.replace(/^(0{1,})([1-9]+)$/, '<span class="parse-error">$1</span>$2');
      n = n.replace(/^(0{1,})(0)$/, '<span class="parse-error">$1</span>$2');
      return n;
    }
    function compact(address, slice) {
      const s1 = [];
      const s2 = [];
      let i;
      for (i = 0; i < address.length; i++) {
        if (i < slice[0]) {
          s1.push(address[i]);
        } else if (i > slice[1]) {
          s2.push(address[i]);
        }
      }
      return s1.concat(["compact"]).concat(s2);
    }
    function paddedHex(octet) {
      return parseInt(octet, 16).toString(16).padStart(4, "0");
    }
    function unsignByte(b) {
      return b & 255;
    }
    var Address6 = class _Address6 {
      constructor(address, optionalGroups) {
        this.addressMinusSuffix = "";
        this.parsedSubnet = "";
        this.subnet = "/128";
        this.subnetMask = 128;
        this.v4 = false;
        this.zone = "";
        this.isInSubnet = common.isInSubnet;
        this.isCorrect = isCorrect6;
        if (optionalGroups === void 0) {
          this.groups = constants6.GROUPS;
        } else {
          this.groups = optionalGroups;
        }
        this.address = address;
        const subnet = constants6.RE_SUBNET_STRING.exec(address);
        if (subnet) {
          this.parsedSubnet = subnet[0].replace("/", "");
          this.subnetMask = parseInt(this.parsedSubnet, 10);
          this.subnet = `/${this.subnetMask}`;
          if (Number.isNaN(this.subnetMask) || this.subnetMask < 0 || this.subnetMask > constants6.BITS) {
            throw new address_error_1.AddressError("Invalid subnet mask.");
          }
          address = address.replace(constants6.RE_SUBNET_STRING, "");
        } else if (/\//.test(address)) {
          throw new address_error_1.AddressError("Invalid subnet mask.");
        }
        const zone = constants6.RE_ZONE_STRING.exec(address);
        if (zone) {
          this.zone = zone[0];
          address = address.replace(constants6.RE_ZONE_STRING, "");
        }
        this.addressMinusSuffix = address;
        this.parsedAddress = this.parse(this.addressMinusSuffix);
      }
      /**
       * Returns true if the given string is a valid IPv6 address (with optional
       * CIDR subnet and zone identifier), false otherwise. Host bits in the
       * subnet portion are allowed (e.g. `2001:db8::1/32` is valid); for strict
       * network-address validation compare `correctForm()` to
       * `startAddress().correctForm()`, or use `networkForm()`.
       */
      static isValid(address) {
        try {
          new _Address6(address);
          return true;
        } catch (e) {
          return false;
        }
      }
      /**
       * Convert a BigInt to a v6 address object. The value must be in the
       * range `[0, 2**128 - 1]`; otherwise `AddressError` is thrown.
       * @param {bigint} bigInt - a BigInt to convert
       * @returns {Address6}
       * @example
       * var bigInt = BigInt('1000000000000');
       * var address = Address6.fromBigInt(bigInt);
       * address.correctForm(); // '::e8:d4a5:1000'
       */
      static fromBigInt(bigInt) {
        if (bigInt < 0n || bigInt > (1n << BigInt(constants6.BITS)) - 1n) {
          throw new address_error_1.AddressError("IPv6 BigInt must be in the range 0 to 2**128 - 1");
        }
        const hex3 = bigInt.toString(16).padStart(32, "0");
        const groups = [];
        for (let i = 0; i < constants6.GROUPS; i++) {
          groups.push(hex3.slice(i * 4, (i + 1) * 4));
        }
        return new _Address6(groups.join(":"));
      }
      /**
       * Parse a URL (with optional bracketed host and port) into an address and
       * port. Returns either `{ address, port }` on success or
       * `{ error, address: null, port: null }` if the URL could not be parsed.
       * Ports are returned as numbers (or `null` if absent or out of range).
       * @example
       * var addressAndPort = Address6.fromURL('http://[ffff::]:8080/foo/');
       * addressAndPort.address.correctForm(); // 'ffff::'
       * addressAndPort.port; // 8080
       */
      static fromURL(url2) {
        let host;
        let port = null;
        let result;
        if (url2.indexOf("[") !== -1 && url2.indexOf("]:") !== -1) {
          result = constants6.RE_URL_WITH_PORT.exec(url2);
          if (result === null) {
            return {
              error: "failed to parse address with port",
              address: null,
              port: null
            };
          }
          host = result[1];
          port = result[2];
        } else if (url2.indexOf("/") !== -1) {
          url2 = url2.replace(/^[a-z0-9]+:\/\//, "");
          result = constants6.RE_URL.exec(url2);
          if (result === null) {
            return {
              error: "failed to parse address from URL",
              address: null,
              port: null
            };
          }
          host = result[1];
        } else {
          host = url2;
        }
        if (port) {
          port = parseInt(port, 10);
          if (port < 0 || port > 65536) {
            port = null;
          }
        } else {
          port = null;
        }
        return {
          address: new _Address6(host),
          port
        };
      }
      /**
       * Construct an `Address6` from an address and a hex subnet mask given as
       * separate strings (e.g. as returned by Node's `os.networkInterfaces()`).
       * Throws `AddressError` if the mask is non-contiguous (e.g.
       * `ffff::ffff`).
       * @example
       * var address = Address6.fromAddressAndMask('fe80::1', 'ffff:ffff:ffff:ffff::');
       * address.subnetMask; // 64
       */
      static fromAddressAndMask(address, mask) {
        const bits = common.prefixLengthFromMask(new _Address6(mask).bigInt(), constants6.BITS);
        return new _Address6(`${address}/${bits}`);
      }
      /**
       * Construct an `Address6` from an address and a Cisco-style wildcard mask
       * given as separate strings (e.g. `::ffff:ffff:ffff:ffff` for a `/64`).
       * The wildcard mask is the bitwise inverse of the subnet mask. Throws
       * `AddressError` if the mask is non-contiguous.
       * @example
       * var address = Address6.fromAddressAndWildcardMask('fe80::1', '::ffff:ffff:ffff:ffff');
       * address.subnetMask; // 64
       */
      static fromAddressAndWildcardMask(address, wildcardMask) {
        const wildcard = new _Address6(wildcardMask).bigInt();
        const allOnes = (BigInt(1) << BigInt(constants6.BITS)) - BigInt(1);
        const mask = wildcard ^ allOnes;
        const bits = common.prefixLengthFromMask(mask, constants6.BITS);
        return new _Address6(`${address}/${bits}`);
      }
      /**
       * Construct an `Address6` from a wildcard pattern with trailing `*`
       * groups. The number of trailing wildcards determines the prefix
       * length: each `*` represents 16 bits. `::` is expanded to zero groups
       * (not wildcards) before evaluating trailing wildcards.
       *
       * Only trailing whole-group wildcards are supported. Partial-group
       * wildcards (e.g. `2001:db8::0*`) and interior wildcards (e.g.
       * `*::1`) throw `AddressError`.
       * @example
       * Address6.fromWildcard('2001:db8:*:*:*:*:*:*').subnet;  // '/32'
       * Address6.fromWildcard('2001:db8::*').subnet;           // '/112'
       * Address6.fromWildcard('*:*:*:*:*:*:*:*').subnet;       // '/0'
       */
      static fromWildcard(input) {
        if (input.includes("%") || input.includes("/")) {
          throw new address_error_1.AddressError("Wildcard pattern must not include a zone or CIDR suffix");
        }
        const halves = input.split("::");
        if (halves.length > 2) {
          throw new address_error_1.AddressError("Wildcard pattern cannot contain more than one '::'");
        }
        let groups;
        if (halves.length === 2) {
          const left = halves[0] === "" ? [] : halves[0].split(":");
          const right = halves[1] === "" ? [] : halves[1].split(":");
          const remaining = constants6.GROUPS - left.length - right.length;
          if (remaining < 1) {
            throw new address_error_1.AddressError("Wildcard pattern with '::' has too many groups");
          }
          groups = [...left, ...new Array(remaining).fill("0"), ...right];
        } else {
          groups = input.split(":");
        }
        if (groups.length !== constants6.GROUPS) {
          throw new address_error_1.AddressError("Wildcard pattern must have 8 groups");
        }
        let firstWildcard = -1;
        for (let i = 0; i < groups.length; i++) {
          if (groups[i] === "*") {
            if (firstWildcard === -1) {
              firstWildcard = i;
            }
          } else if (firstWildcard !== -1) {
            throw new address_error_1.AddressError("Wildcard `*` must only appear in trailing groups (e.g. `2001:db8:*:*:*:*:*:*`)");
          }
        }
        const trailing = firstWildcard === -1 ? 0 : groups.length - firstWildcard;
        const replaced = groups.map((g) => g === "*" ? "0" : g);
        const subnetBits = constants6.BITS - trailing * 16;
        return new _Address6(`${replaced.join(":")}/${subnetBits}`);
      }
      /**
       * Create an IPv6-mapped address given an IPv4 address
       * @param {string} address - An IPv4 address string
       * @returns {Address6}
       * @example
       * var address = Address6.fromAddress4('192.168.0.1');
       * address.correctForm(); // '::ffff:c0a8:1'
       * address.to4in6(); // '::ffff:192.168.0.1'
       */
      static fromAddress4(address) {
        const address4 = new ipv4_1.Address4(address);
        const mask6 = constants6.BITS - (constants4.BITS - address4.subnetMask);
        return new _Address6(`::ffff:${address4.correctForm()}/${mask6}`);
      }
      /**
       * Return an address from ip6.arpa form
       * @param {string} arpaFormAddress - an 'ip6.arpa' form address
       * @returns {Adress6}
       * @example
       * var address = Address6.fromArpa(e.f.f.f.3.c.2.6.f.f.f.e.6.6.8.e.1.0.6.7.9.4.e.c.0.0.0.0.1.0.0.2.ip6.arpa.)
       * address.correctForm(); // '2001:0:ce49:7601:e866:efff:62c3:fffe'
       */
      static fromArpa(arpaFormAddress) {
        let address = arpaFormAddress.replace(/(\.ip6\.arpa)?\.$/, "");
        const semicolonAmount = 7;
        if (address.length !== 63) {
          throw new address_error_1.AddressError("Invalid 'ip6.arpa' form.");
        }
        const parts = address.split(".").reverse();
        for (let i = semicolonAmount; i > 0; i--) {
          const insertIndex = i * 4;
          parts.splice(insertIndex, 0, ":");
        }
        address = parts.join("");
        return new _Address6(address);
      }
      /**
       * Return the Microsoft UNC transcription of the address
       * @returns {String} the Microsoft UNC transcription of the address
       */
      microsoftTranscription() {
        return `${this.correctForm().replace(/:/g, "-")}.ipv6-literal.net`;
      }
      /**
       * Return the first n bits of the address, defaulting to the subnet mask
       * @param {number} [mask=subnet] - the number of bits to mask
       * @returns {String} the first n bits of the address as a string
       */
      mask(mask = this.subnetMask) {
        return this.getBitsBase2(0, mask);
      }
      /**
       * Return the number of possible subnets of a given size in the address
       * @param {number} [subnetSize=128] - the subnet size
       * @returns {String}
       */
      // TODO: probably useful to have a numeric version of this too
      possibleSubnets(subnetSize = 128) {
        const availableBits = constants6.BITS - this.subnetMask;
        const subnetBits = Math.abs(subnetSize - constants6.BITS);
        const subnetPowers = availableBits - subnetBits;
        if (subnetPowers < 0) {
          return "0";
        }
        return addCommas((BigInt("2") ** BigInt(subnetPowers)).toString(10));
      }
      /**
       * Helper function getting start address.
       * @returns {bigint}
       */
      _startAddress() {
        return BigInt(`0b${this.mask() + "0".repeat(constants6.BITS - this.subnetMask)}`);
      }
      /**
       * The first address in the range given by this address' subnet
       * Often referred to as the Network Address.
       * @returns {Address6}
       */
      startAddress() {
        return _Address6.fromBigInt(this._startAddress());
      }
      /**
       * The first host address in the range given by this address's subnet ie
       * the first address after the Network Address
       * @returns {Address6}
       */
      startAddressExclusive() {
        const adjust = BigInt("1");
        return _Address6.fromBigInt(this._startAddress() + adjust);
      }
      /**
       * Helper function getting end address.
       * @returns {bigint}
       */
      _endAddress() {
        return BigInt(`0b${this.mask() + "1".repeat(constants6.BITS - this.subnetMask)}`);
      }
      /**
       * The last address in the range given by this address' subnet
       * Often referred to as the Broadcast
       * @returns {Address6}
       */
      endAddress() {
        return _Address6.fromBigInt(this._endAddress());
      }
      /**
       * The last host address in the range given by this address's subnet ie
       * the last address prior to the Broadcast Address
       * @returns {Address6}
       */
      endAddressExclusive() {
        const adjust = BigInt("1");
        return _Address6.fromBigInt(this._endAddress() - adjust);
      }
      /**
       * The hex form of the subnet mask, e.g. `ffff:ffff:ffff:ffff::` for a
       * `/64`. Returns an `Address6`; call `.correctForm()` for the string.
       * @returns {Address6}
       */
      subnetMaskAddress() {
        return _Address6.fromBigInt(BigInt(`0b${"1".repeat(this.subnetMask)}${"0".repeat(constants6.BITS - this.subnetMask)}`));
      }
      /**
       * The Cisco-style wildcard mask, e.g. `::ffff:ffff:ffff:ffff` for a
       * `/64`. This is the bitwise inverse of `subnetMaskAddress()`. Returns
       * an `Address6`; call `.correctForm()` for the string.
       * @returns {Address6}
       */
      wildcardMask() {
        return _Address6.fromBigInt(BigInt(`0b${"0".repeat(this.subnetMask)}${"1".repeat(constants6.BITS - this.subnetMask)}`));
      }
      /**
       * The network address in CIDR string form, e.g. `2001:db8::/32` for
       * `2001:db8::1/32`. For an address with no explicit subnet the prefix
       * is `/128`, e.g. `networkForm()` on `2001:db8::1` returns
       * `2001:db8::1/128`.
       * @returns {string}
       */
      networkForm() {
        return `${this.startAddress().correctForm()}/${this.subnetMask}`;
      }
      /**
       * Return the scope of the address. The 4-bit scope field
       * ([RFC 4291 Â§2.7](https://datatracker.ietf.org/doc/html/rfc4291#section-2.7))
       * is only defined for multicast addresses; for unicast addresses the scope
       * is derived from the address type per
       * [RFC 4007 Â§6](https://datatracker.ietf.org/doc/html/rfc4007#section-6).
       * @returns {String}
       */
      getScope() {
        const type = this.getType();
        if (type === "Multicast" || type.startsWith("Multicast ")) {
          const scope = constants6.SCOPES[parseInt(this.getBits(12, 16).toString(10), 10)];
          return scope || "Unknown";
        }
        if (type === "Link-local unicast" || type === "Loopback") {
          return "Link local";
        }
        if (type === "Unspecified") {
          return "Unknown";
        }
        return "Global";
      }
      /**
       * Return the type of the address
       * @returns {String}
       */
      getType() {
        for (let i = 0; i < TYPE_SUBNETS.length; i++) {
          const entry = TYPE_SUBNETS[i];
          if (this.isInSubnet(entry[0])) {
            return entry[1];
          }
        }
        return "Global unicast";
      }
      /**
       * Return the bits in the given range as a BigInt
       * @returns {bigint}
       */
      getBits(start, end) {
        return BigInt(`0b${this.getBitsBase2(start, end)}`);
      }
      /**
       * Return the bits in the given range as a base-2 string
       * @returns {String}
       */
      getBitsBase2(start, end) {
        return this.binaryZeroPad().slice(start, end);
      }
      /**
       * Return the bits in the given range as a base-16 string
       * @returns {String}
       */
      getBitsBase16(start, end) {
        const length = end - start;
        if (length % 4 !== 0) {
          throw new Error("Length of bits to retrieve must be divisible by four");
        }
        return this.getBits(start, end).toString(16).padStart(length / 4, "0");
      }
      /**
       * Return the bits that are set past the subnet mask length
       * @returns {String}
       */
      getBitsPastSubnet() {
        return this.getBitsBase2(this.subnetMask, constants6.BITS);
      }
      /**
       * Return the reversed ip6.arpa form of the address
       * @param {Object} options
       * @param {boolean} options.omitSuffix - omit the "ip6.arpa" suffix
       * @returns {String}
       */
      reverseForm(options2) {
        if (!options2) {
          options2 = {};
        }
        const characters = Math.floor(this.subnetMask / 4);
        const reversed = this.canonicalForm().replace(/:/g, "").split("").slice(0, characters).reverse().join(".");
        if (characters > 0) {
          if (options2.omitSuffix) {
            return reversed;
          }
          return `${reversed}.ip6.arpa.`;
        }
        if (options2.omitSuffix) {
          return "";
        }
        return "ip6.arpa.";
      }
      /**
       * Returns the address in correct form, per
       * [RFC 5952](https://datatracker.ietf.org/doc/html/rfc5952): leading zeros
       * stripped, the longest run of zero groups collapsed to `::`, and hex digits
       * lowercased (e.g. `2001:db8::1`). This is the recommended form for display.
       */
      correctForm() {
        let i;
        let groups = [];
        let zeroCounter = 0;
        const zeroes = [];
        for (i = 0; i < this.parsedAddress.length; i++) {
          const value = parseInt(this.parsedAddress[i], 16);
          if (value === 0) {
            zeroCounter++;
          }
          if (value !== 0 && zeroCounter > 0) {
            if (zeroCounter > 1) {
              zeroes.push([i - zeroCounter, i - 1]);
            }
            zeroCounter = 0;
          }
        }
        if (zeroCounter > 1) {
          zeroes.push([this.parsedAddress.length - zeroCounter, this.parsedAddress.length - 1]);
        }
        const zeroLengths = zeroes.map((n) => n[1] - n[0] + 1);
        if (zeroes.length > 0) {
          const index = zeroLengths.indexOf(Math.max(...zeroLengths));
          groups = compact(this.parsedAddress, zeroes[index]);
        } else {
          groups = this.parsedAddress;
        }
        for (i = 0; i < groups.length; i++) {
          if (groups[i] !== "compact") {
            groups[i] = parseInt(groups[i], 16).toString(16);
          }
        }
        let correct = groups.join(":");
        correct = correct.replace(/^compact$/, "::");
        correct = correct.replace(/(^compact)|(compact$)/, ":");
        correct = correct.replace(/compact/, "");
        return correct;
      }
      /**
       * Return a zero-padded base-2 string representation of the address
       * @returns {String}
       * @example
       * var address = new Address6('2001:4860:4001:803::1011');
       * address.binaryZeroPad();
       * // '0010000000000001010010000110000001000000000000010000100000000011
       * //  0000000000000000000000000000000000000000000000000001000000010001'
       */
      binaryZeroPad() {
        if (this._binaryZeroPad === void 0) {
          this._binaryZeroPad = this.bigInt().toString(2).padStart(constants6.BITS, "0");
        }
        return this._binaryZeroPad;
      }
      /**
       * Parses a v4-in-v6 string (e.g. `::ffff:192.168.0.1`) by extracting the
       * trailing IPv4 address into `this.address4` / `this.parsedAddress4` and
       * returning the address with the v4 portion converted to two v6 groups.
       * Used internally by `parse()`.
       */
      // TODO: Improve the semantics of this helper function
      parse4in6(address) {
        if (address.indexOf(".") === -1) {
          return address;
        }
        const groups = address.split(":");
        const lastGroup = groups.slice(-1)[0];
        const address4 = lastGroup.match(constants4.RE_ADDRESS);
        if (address4) {
          this.parsedAddress4 = address4[0];
          this.address4 = new ipv4_1.Address4(this.parsedAddress4);
          for (let i = 0; i < this.address4.groups; i++) {
            if (/^0[0-9]+/.test(this.address4.parsedAddress[i])) {
              const highlighted = this.address4.parsedAddress.map(spanLeadingZeroes4).join(".");
              const prefix = groups.slice(0, -1).map(helpers.escapeHtml).join(":");
              const separator = groups.length > 1 ? ":" : "";
              throw new address_error_1.AddressError("IPv4 addresses can't have leading zeroes.", `${prefix}${separator}${highlighted}`);
            }
          }
          this.v4 = true;
          groups[groups.length - 1] = this.address4.toGroup6();
          address = groups.join(":");
        }
        return address;
      }
      /**
       * Parses an IPv6 address string into its 8 hexadecimal groups (expanding
       * any `::` elision and any trailing v4-in-v6 portion) and stores the result
       * on `this.parsedAddress`. Called automatically by the constructor; you
       * typically don't need to call it directly. Throws `AddressError` if the
       * input is malformed.
       */
      // TODO: Make private?
      parse(address) {
        address = this.parse4in6(address);
        const badCharacters = address.match(constants6.RE_BAD_CHARACTERS);
        if (badCharacters) {
          throw new address_error_1.AddressError(`Bad character${badCharacters.length > 1 ? "s" : ""} detected in address: ${badCharacters.join("")}`, address.replace(constants6.RE_BAD_CHARACTERS, '<span class="parse-error">$1</span>'));
        }
        const badAddress = address.match(constants6.RE_BAD_ADDRESS);
        if (badAddress) {
          throw new address_error_1.AddressError(`Address failed regex: ${badAddress.join("")}`, address.replace(constants6.RE_BAD_ADDRESS, '<span class="parse-error">$1</span>'));
        }
        let groups = [];
        const halves = address.split("::");
        if (halves.length === 2) {
          let first = halves[0].split(":");
          let last = halves[1].split(":");
          if (first.length === 1 && first[0] === "") {
            first = [];
          }
          if (last.length === 1 && last[0] === "") {
            last = [];
          }
          const remaining = this.groups - (first.length + last.length);
          if (!remaining) {
            throw new address_error_1.AddressError("Error parsing groups");
          }
          this.elidedGroups = remaining;
          this.elisionBegin = first.length;
          this.elisionEnd = first.length + this.elidedGroups;
          groups = groups.concat(first);
          for (let i = 0; i < remaining; i++) {
            groups.push("0");
          }
          groups = groups.concat(last);
        } else if (halves.length === 1) {
          groups = address.split(":");
          this.elidedGroups = 0;
        } else {
          throw new address_error_1.AddressError("Too many :: groups found");
        }
        groups = groups.map((group) => parseInt(group, 16).toString(16));
        if (groups.length !== this.groups) {
          throw new address_error_1.AddressError("Incorrect number of groups found");
        }
        return groups;
      }
      /**
       * Returns the canonical (fully expanded) form of the address: all 8 groups,
       * each padded to 4 hex digits, with no `::` collapsing
       * (e.g. `2001:0db8:0000:0000:0000:0000:0000:0001`). Useful for sorting and
       * byte-exact comparison.
       */
      canonicalForm() {
        return this.parsedAddress.map(paddedHex).join(":");
      }
      /**
       * Return the decimal form of the address
       * @returns {String}
       */
      decimal() {
        return this.parsedAddress.map((n) => parseInt(n, 16).toString(10).padStart(5, "0")).join(":");
      }
      /**
       * Return the address as a BigInt
       * @returns {bigint}
       */
      bigInt() {
        return BigInt(`0x${this.parsedAddress.map(paddedHex).join("")}`);
      }
      /**
       * Return the last two groups of this address as an IPv4 address string
       * @returns {Address4}
       * @example
       * var address = new Address6('2001:4860:4001::1825:bf11');
       * address.to4().correctForm(); // '24.37.191.17'
       */
      to4() {
        const binary = this.binaryZeroPad().split("");
        return ipv4_1.Address4.fromHex(BigInt(`0b${binary.slice(96, 128).join("")}`).toString(16).padStart(8, "0"));
      }
      /**
       * Return the v4-in-v6 form of the address
       * @returns {String}
       */
      to4in6() {
        const address4 = this.to4();
        const address6 = new _Address6(this.parsedAddress.slice(0, 6).join(":"), 6);
        const correct = address6.correctForm();
        let infix = "";
        if (!/:$/.test(correct)) {
          infix = ":";
        }
        return correct + infix + address4.address;
      }
      /**
       * Decodes the Teredo tunneling fields embedded in this address. Returns the
       * Teredo prefix, server IPv4, client IPv4, raw flag bits, cone-NAT flag,
       * UDP port, and Microsoft-format flag breakdown (reserved, universal/local,
       * group/individual, nonce). Only meaningful for addresses in `2001::/32`.
       */
      inspectTeredo() {
        const prefix = this.getBitsBase16(0, 32);
        const bitsForUdpPort = this.getBits(80, 96);
        const udpPort = (bitsForUdpPort ^ BigInt("0xffff")).toString();
        const server4 = ipv4_1.Address4.fromHex(this.getBitsBase16(32, 64));
        const bitsForClient4 = this.getBits(96, 128);
        const client4 = ipv4_1.Address4.fromHex((bitsForClient4 ^ BigInt("0xffffffff")).toString(16).padStart(8, "0"));
        const flagsBase2 = this.getBitsBase2(64, 80);
        const coneNat = (0, common_1.testBit)(flagsBase2, 15);
        const reserved = (0, common_1.testBit)(flagsBase2, 14);
        const groupIndividual = (0, common_1.testBit)(flagsBase2, 8);
        const universalLocal = (0, common_1.testBit)(flagsBase2, 9);
        const nonce = BigInt(`0b${flagsBase2.slice(2, 6) + flagsBase2.slice(8, 16)}`).toString(10);
        return {
          prefix: `${prefix.slice(0, 4)}:${prefix.slice(4, 8)}`,
          server4: server4.address,
          client4: client4.address,
          flags: flagsBase2,
          coneNat,
          microsoft: {
            reserved,
            universalLocal,
            groupIndividual,
            nonce
          },
          udpPort
        };
      }
      /**
       * Decodes the 6to4 tunneling fields embedded in this address. Returns the
       * 6to4 prefix and the embedded IPv4 gateway address. Only meaningful for
       * addresses in `2002::/16`.
       */
      inspect6to4() {
        const prefix = this.getBitsBase16(0, 16);
        const gateway = ipv4_1.Address4.fromHex(this.getBitsBase16(16, 48));
        return {
          prefix: prefix.slice(0, 4),
          gateway: gateway.address
        };
      }
      /**
       * Return a v6 6to4 address from a v6 v4inv6 address
       * @returns {Address6}
       */
      to6to4() {
        if (!this.is4()) {
          return null;
        }
        const addr6to4 = [
          "2002",
          this.getBitsBase16(96, 112),
          this.getBitsBase16(112, 128),
          "",
          "/16"
        ].join(":");
        return new _Address6(addr6to4);
      }
      /**
       * Embed an IPv4 address into a NAT64 IPv6 address using the encoding
       * defined by [RFC 6052](https://datatracker.ietf.org/doc/html/rfc6052).
       * The default prefix is the well-known prefix `64:ff9b::/96`. The prefix
       * length must be one of 32, 40, 48, 56, 64, or 96; for prefixes shorter
       * than /64 the IPv4 octets are split around the reserved bits 64â€“71.
       * @example
       * Address6.fromAddress4Nat64('192.0.2.33').correctForm(); // '64:ff9b::c000:221'
       * Address6.fromAddress4Nat64('192.0.2.33', '2001:db8::/32').correctForm(); // '2001:db8:c000:221::'
       */
      static fromAddress4Nat64(address, prefix = "64:ff9b::/96") {
        const v4 = new ipv4_1.Address4(address);
        const prefix6 = new _Address6(prefix);
        const pl = prefix6.subnetMask;
        if (pl !== 32 && pl !== 40 && pl !== 48 && pl !== 56 && pl !== 64 && pl !== 96) {
          throw new address_error_1.AddressError("NAT64 prefix length must be 32, 40, 48, 56, 64, or 96");
        }
        const prefixBits = prefix6.binaryZeroPad();
        const v4Bits = v4.binaryZeroPad();
        let bits;
        if (pl === 96) {
          bits = prefixBits.slice(0, 96) + v4Bits;
        } else {
          const beforeU = 64 - pl;
          bits = prefixBits.slice(0, pl) + v4Bits.slice(0, beforeU) + "00000000" + v4Bits.slice(beforeU) + "0".repeat(128 - 72 - (32 - beforeU));
        }
        const hex3 = BigInt(`0b${bits}`).toString(16).padStart(32, "0");
        const groups = [];
        for (let i = 0; i < 8; i++) {
          groups.push(hex3.slice(i * 4, (i + 1) * 4));
        }
        return new _Address6(groups.join(":"));
      }
      /**
       * Extract the embedded IPv4 address from a NAT64 IPv6 address using the
       * encoding defined by [RFC 6052](https://datatracker.ietf.org/doc/html/rfc6052).
       * The default prefix is the well-known prefix `64:ff9b::/96`. Returns
       * `null` if this address is not contained within the given prefix.
       * @example
       * new Address6('64:ff9b::c000:221').toAddress4Nat64()!.correctForm(); // '192.0.2.33'
       */
      toAddress4Nat64(prefix = "64:ff9b::/96") {
        const prefix6 = new _Address6(prefix);
        const pl = prefix6.subnetMask;
        if (pl !== 32 && pl !== 40 && pl !== 48 && pl !== 56 && pl !== 64 && pl !== 96) {
          throw new address_error_1.AddressError("NAT64 prefix length must be 32, 40, 48, 56, 64, or 96");
        }
        if (!this.isInSubnet(prefix6)) {
          return null;
        }
        const bits = this.binaryZeroPad();
        let v4Bits;
        if (pl === 96) {
          v4Bits = bits.slice(96, 128);
        } else {
          const beforeU = 64 - pl;
          v4Bits = bits.slice(pl, pl + beforeU) + bits.slice(72, 72 + (32 - beforeU));
        }
        const octets = [];
        for (let i = 0; i < 4; i++) {
          octets.push(parseInt(v4Bits.slice(i * 8, (i + 1) * 8), 2).toString());
        }
        return new ipv4_1.Address4(octets.join("."));
      }
      /**
       * Return a byte array.
       *
       * To get a Node.js `Buffer`, wrap the result: `Buffer.from(address.toByteArray())`.
       * @returns {Array}
       */
      toByteArray() {
        const valueWithoutPadding = this.bigInt().toString(16);
        const leadingPad = "0".repeat(valueWithoutPadding.length % 2);
        const value = `${leadingPad}${valueWithoutPadding}`;
        const bytes2 = [];
        for (let i = 0, length = value.length; i < length; i += 2) {
          bytes2.push(parseInt(value.substring(i, i + 2), 16));
        }
        return bytes2;
      }
      /**
       * Return an unsigned byte array.
       *
       * To get a Node.js `Buffer`, wrap the result: `Buffer.from(address.toUnsignedByteArray())`.
       * @returns {Array}
       */
      toUnsignedByteArray() {
        return this.toByteArray().map(unsignByte);
      }
      /**
       * Convert a byte array to an Address6 object.
       *
       * To convert from a Node.js `Buffer`, spread it: `Address6.fromByteArray([...buf])`.
       * @returns {Address6}
       */
      static fromByteArray(bytes2) {
        return this.fromUnsignedByteArray(bytes2.map(unsignByte));
      }
      /**
       * Convert an unsigned byte array to an Address6 object.
       *
       * To convert from a Node.js `Buffer`, spread it: `Address6.fromUnsignedByteArray([...buf])`.
       * @returns {Address6}
       */
      static fromUnsignedByteArray(bytes2) {
        const BYTE_MAX = BigInt("256");
        let result = BigInt("0");
        let multiplier = BigInt("1");
        for (let i = bytes2.length - 1; i >= 0; i--) {
          result += multiplier * BigInt(bytes2[i].toString(10));
          multiplier *= BYTE_MAX;
        }
        return _Address6.fromBigInt(result);
      }
      /**
       * Returns true if the address is in the canonical form, false otherwise
       * @returns {boolean}
       */
      isCanonical() {
        return this.addressMinusSuffix === this.canonicalForm();
      }
      /**
       * Returns true if the address is a link local address, false otherwise
       * @returns {boolean}
       */
      isLinkLocal() {
        if (this.getBitsBase2(0, 64) === "1111111010000000000000000000000000000000000000000000000000000000") {
          return true;
        }
        return false;
      }
      /**
       * Returns true if the address is a multicast address, false otherwise
       * @returns {boolean}
       */
      isMulticast() {
        const type = this.getType();
        return type === "Multicast" || type.startsWith("Multicast ");
      }
      /**
       * Returns true if the address was written in v4-in-v6 dotted-quad notation
       * (e.g. `::ffff:127.0.0.1`), false otherwise. This is a notation-level flag
       * and does not reflect whether the address bits lie in the IPv4-mapped
       * (`::ffff:0:0/96`) subnet â€” for that, see {@link isMapped4}.
       * @returns {boolean}
       */
      is4() {
        return this.v4;
      }
      /**
       * Returns true if the address is an IPv4-mapped IPv6 address in
       * `::ffff:0:0/96` ([RFC 4291 Â§2.5.5.2](https://datatracker.ietf.org/doc/html/rfc4291#section-2.5.5.2)),
       * false otherwise. Unlike {@link is4}, this checks the underlying address
       * bits rather than the textual notation, so `::ffff:127.0.0.1` and
       * `::ffff:7f00:1` both return true.
       * @returns {boolean}
       */
      isMapped4() {
        return this.isInSubnet(IPV4_MAPPED_SUBNET);
      }
      /**
       * Returns true if the address is a Teredo address, false otherwise
       * @returns {boolean}
       */
      isTeredo() {
        return this.isInSubnet(TEREDO_SUBNET);
      }
      /**
       * Returns true if the address is a 6to4 address, false otherwise
       * @returns {boolean}
       */
      is6to4() {
        return this.isInSubnet(SIX_TO_FOUR_SUBNET);
      }
      /**
       * Returns true if the address is a loopback address, false otherwise
       * @returns {boolean}
       */
      isLoopback() {
        return this.getType() === "Loopback";
      }
      /**
       * Returns true if the address is a Unique Local Address in `fc00::/7` ([RFC 4193](https://datatracker.ietf.org/doc/html/rfc4193)). ULAs are the IPv6 equivalent of IPv4 [RFC 1918](https://datatracker.ietf.org/doc/html/rfc1918) private addresses.
       * @returns {boolean}
       */
      isULA() {
        return this.isInSubnet(ULA_SUBNET);
      }
      /**
       * Returns true if the address is the unspecified address `::`.
       * @returns {boolean}
       */
      isUnspecified() {
        return this.getType() === "Unspecified";
      }
      /**
       * Returns true if the address is in the documentation prefix `2001:db8::/32` ([RFC 3849](https://datatracker.ietf.org/doc/html/rfc3849)).
       * @returns {boolean}
       */
      isDocumentation() {
        return this.isInSubnet(DOCUMENTATION_SUBNET);
      }
      // #endregion
      // #region HTML
      /**
       * Returns the address as an HTTP URL with the host bracketed, e.g.
       * `http://[2001:db8::1]/`. If `optionalPort` is provided it is appended,
       * e.g. `http://[2001:db8::1]:8080/`.
       */
      href(optionalPort) {
        if (optionalPort === void 0) {
          optionalPort = "";
        } else {
          optionalPort = `:${optionalPort}`;
        }
        return `http://[${this.correctForm()}]${optionalPort}/`;
      }
      /**
       * Returns an HTML `<a>` element whose `href` encodes the address in a URL
       * hash fragment (default prefix `/#address=`). Useful for linking between
       * pages of an address-inspector UI.
       * @param options.className - CSS class for the rendered `<a>` element
       * @param options.prefix - hash prefix prepended to the address (default `/#address=`)
       * @param options.v4 - when true, render the address in v4-in-v6 form
       */
      link(options2) {
        if (!options2) {
          options2 = {};
        }
        if (options2.className === void 0) {
          options2.className = "";
        }
        if (options2.prefix === void 0) {
          options2.prefix = "/#address=";
        }
        if (options2.v4 === void 0) {
          options2.v4 = false;
        }
        let formFunction = this.correctForm;
        if (options2.v4) {
          formFunction = this.to4in6;
        }
        const form = formFunction.call(this);
        const safeHref = helpers.escapeHtml(`${options2.prefix}${form}`);
        const safeForm = helpers.escapeHtml(form);
        if (options2.className) {
          const safeClass = helpers.escapeHtml(options2.className);
          return `<a href="${safeHref}" class="${safeClass}">${safeForm}</a>`;
        }
        return `<a href="${safeHref}">${safeForm}</a>`;
      }
      /**
       * Groups an address
       * @returns {String}
       */
      group() {
        if (this.elidedGroups === 0) {
          return helpers.simpleGroup(this.addressMinusSuffix).join(":");
        }
        assert2(typeof this.elidedGroups === "number");
        assert2(typeof this.elisionBegin === "number");
        const output = [];
        const [left, right] = this.addressMinusSuffix.split("::");
        if (left.length) {
          output.push(...helpers.simpleGroup(left));
        } else {
          output.push("");
        }
        const classes = ["hover-group"];
        for (let i = this.elisionBegin; i < this.elisionBegin + this.elidedGroups; i++) {
          classes.push(`group-${i}`);
        }
        output.push(`<span class="${classes.join(" ")}"></span>`);
        if (right.length) {
          output.push(...helpers.simpleGroup(right, this.elisionEnd));
        } else {
          output.push("");
        }
        if (this.is4()) {
          assert2(this.address4 instanceof ipv4_1.Address4);
          output.pop();
          output.push(this.address4.groupForV6());
        }
        return output.join(":");
      }
      // #endregion
      // #region Regular expressions
      /**
       * Generate a regular expression string that can be used to find or validate
       * all variations of this address
       * @param {boolean} substringSearch
       * @returns {string}
       */
      regularExpressionString(substringSearch = false) {
        let output = [];
        const address6 = new _Address6(this.correctForm());
        if (address6.elidedGroups === 0) {
          output.push((0, regular_expressions_1.simpleRegularExpression)(address6.parsedAddress));
        } else if (address6.elidedGroups === constants6.GROUPS) {
          output.push((0, regular_expressions_1.possibleElisions)(constants6.GROUPS));
        } else {
          const halves = address6.address.split("::");
          if (halves[0].length) {
            output.push((0, regular_expressions_1.simpleRegularExpression)(halves[0].split(":")));
          }
          assert2(typeof address6.elidedGroups === "number");
          output.push((0, regular_expressions_1.possibleElisions)(address6.elidedGroups, halves[0].length !== 0, halves[1].length !== 0));
          if (halves[1].length) {
            output.push((0, regular_expressions_1.simpleRegularExpression)(halves[1].split(":")));
          }
          output = [output.join(":")];
        }
        if (!substringSearch) {
          output = [
            "(?=^|",
            regular_expressions_1.ADDRESS_BOUNDARY,
            "|[^\\w\\:])(",
            ...output,
            ")(?=[^\\w\\:]|",
            regular_expressions_1.ADDRESS_BOUNDARY,
            "|$)"
          ];
        }
        return output.join("");
      }
      /**
       * Generate a regular expression that can be used to find or validate all
       * variations of this address.
       * @param {boolean} substringSearch
       * @returns {RegExp}
       */
      regularExpression(substringSearch = false) {
        return new RegExp(this.regularExpressionString(substringSearch), "i");
      }
    };
    exports2.Address6 = Address6;
    var TYPE_SUBNETS = Object.keys(constants6.TYPES).map((subnet) => [
      new Address6(subnet),
      constants6.TYPES[subnet]
    ]);
    var TEREDO_SUBNET = new Address6("2001::/32");
    var SIX_TO_FOUR_SUBNET = new Address6("2002::/16");
    var ULA_SUBNET = new Address6("fc00::/7");
    var DOCUMENTATION_SUBNET = new Address6("2001:db8::/32");
    var IPV4_MAPPED_SUBNET = new Address6("::ffff:0:0/96");
  }
});

// node_modules/ip-address/dist/ip-address.js
var require_ip_address = __commonJS({
  "node_modules/ip-address/dist/ip-address.js"(exports2) {
    "use strict";
    var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) {
      if (k2 === void 0) k2 = k;
      var desc = Object.getOwnPropertyDescriptor(m, k);
      if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
        desc = { enumerable: true, get: function() {
          return m[k];
        } };
      }
      Object.defineProperty(o, k2, desc);
    }) : (function(o, m, k, k2) {
      if (k2 === void 0) k2 = k;
      o[k2] = m[k];
    }));
    var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) {
      Object.defineProperty(o, "default", { enumerable: true, value: v });
    }) : function(o, v) {
      o["default"] = v;
    });
    var __importStar = exports2 && exports2.__importStar || function(mod) {
      if (mod && mod.__esModule) return mod;
      var result = {};
      if (mod != null) {
        for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
      }
      __setModuleDefault(result, mod);
      return result;
    };
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.v6 = exports2.AddressError = exports2.Address6 = exports2.Address4 = void 0;
    var ipv4_1 = require_ipv4();
    Object.defineProperty(exports2, "Address4", { enumerable: true, get: function() {
      return ipv4_1.Address4;
    } });
    var ipv6_1 = require_ipv6();
    Object.defineProperty(exports2, "Address6", { enumerable: true, get: function() {
      return ipv6_1.Address6;
    } });
    var address_error_1 = require_address_error();
    Object.defineProperty(exports2, "AddressError", { enumerable: true, get: function() {
      return address_error_1.AddressError;
    } });
    var helpers = __importStar(require_helpers2());
    exports2.v6 = { helpers };
  }
});

// node_modules/socks/build/common/helpers.js
var require_helpers3 = __commonJS({
  "node_modules/socks/build/common/helpers.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.ipToBuffer = exports2.int32ToIpv4 = exports2.ipv4ToInt32 = exports2.validateSocksClientChainOptions = exports2.validateSocksClientOptions = void 0;
    var util_1 = require_util();
    var constants_1 = require_constants2();
    var stream = require("stream");
    var ip_address_1 = require_ip_address();
    var net = require("net");
    function validateSocksClientOptions(options2, acceptedCommands = ["connect", "bind", "associate"]) {
      if (!constants_1.SocksCommand[options2.command]) {
        throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksCommand, options2);
      }
      if (acceptedCommands.indexOf(options2.command) === -1) {
        throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksCommandForOperation, options2);
      }
      if (!isValidSocksRemoteHost(options2.destination)) {
        throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksClientOptionsDestination, options2);
      }
      if (!isValidSocksProxy(options2.proxy)) {
        throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksClientOptionsProxy, options2);
      }
      validateCustomProxyAuth(options2.proxy, options2);
      if (options2.timeout && !isValidTimeoutValue(options2.timeout)) {
        throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksClientOptionsTimeout, options2);
      }
      if (options2.existing_socket && !(options2.existing_socket instanceof stream.Duplex)) {
        throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksClientOptionsExistingSocket, options2);
      }
    }
    exports2.validateSocksClientOptions = validateSocksClientOptions;
    function validateSocksClientChainOptions(options2) {
      if (options2.command !== "connect") {
        throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksCommandChain, options2);
      }
      if (!isValidSocksRemoteHost(options2.destination)) {
        throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksClientOptionsDestination, options2);
      }
      if (!(options2.proxies && Array.isArray(options2.proxies) && options2.proxies.length >= 2)) {
        throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksClientOptionsProxiesLength, options2);
      }
      options2.proxies.forEach((proxy) => {
        if (!isValidSocksProxy(proxy)) {
          throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksClientOptionsProxy, options2);
        }
        validateCustomProxyAuth(proxy, options2);
      });
      if (options2.timeout && !isValidTimeoutValue(options2.timeout)) {
        throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksClientOptionsTimeout, options2);
      }
    }
    exports2.validateSocksClientChainOptions = validateSocksClientChainOptions;
    function validateCustomProxyAuth(proxy, options2) {
      if (proxy.custom_auth_method !== void 0) {
        if (proxy.custom_auth_method < constants_1.SOCKS5_CUSTOM_AUTH_START || proxy.custom_auth_method > constants_1.SOCKS5_CUSTOM_AUTH_END) {
          throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksClientOptionsCustomAuthRange, options2);
        }
        if (proxy.custom_auth_request_handler === void 0 || typeof proxy.custom_auth_request_handler !== "function") {
          throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksClientOptionsCustomAuthOptions, options2);
        }
        if (proxy.custom_auth_response_size === void 0) {
          throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksClientOptionsCustomAuthOptions, options2);
        }
        if (proxy.custom_auth_response_handler === void 0 || typeof proxy.custom_auth_response_handler !== "function") {
          throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksClientOptionsCustomAuthOptions, options2);
        }
      }
    }
    function isValidSocksRemoteHost(remoteHost) {
      return remoteHost && typeof remoteHost.host === "string" && Buffer.byteLength(remoteHost.host) < 256 && typeof remoteHost.port === "number" && remoteHost.port >= 0 && remoteHost.port <= 65535;
    }
    function isValidSocksProxy(proxy) {
      return proxy && (typeof proxy.host === "string" || typeof proxy.ipaddress === "string") && typeof proxy.port === "number" && proxy.port >= 0 && proxy.port <= 65535 && (proxy.type === 4 || proxy.type === 5);
    }
    function isValidTimeoutValue(value) {
      return typeof value === "number" && value > 0;
    }
    function ipv4ToInt32(ip) {
      const address = new ip_address_1.Address4(ip);
      return address.toArray().reduce((acc, part) => (acc << 8) + part, 0) >>> 0;
    }
    exports2.ipv4ToInt32 = ipv4ToInt32;
    function int32ToIpv4(int322) {
      const octet1 = int322 >>> 24 & 255;
      const octet2 = int322 >>> 16 & 255;
      const octet3 = int322 >>> 8 & 255;
      const octet4 = int322 & 255;
      return [octet1, octet2, octet3, octet4].join(".");
    }
    exports2.int32ToIpv4 = int32ToIpv4;
    function ipToBuffer(ip) {
      if (net.isIPv4(ip)) {
        const address = new ip_address_1.Address4(ip);
        return Buffer.from(address.toArray());
      } else if (net.isIPv6(ip)) {
        const address = new ip_address_1.Address6(ip);
        return Buffer.from(address.canonicalForm().split(":").map((segment2) => segment2.padStart(4, "0")).join(""), "hex");
      } else {
        throw new Error("Invalid IP address format");
      }
    }
    exports2.ipToBuffer = ipToBuffer;
  }
});

// node_modules/socks/build/common/receivebuffer.js
var require_receivebuffer = __commonJS({
  "node_modules/socks/build/common/receivebuffer.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.ReceiveBuffer = void 0;
    var ReceiveBuffer = class {
      constructor(size = 4096) {
        this.buffer = Buffer.allocUnsafe(size);
        this.offset = 0;
        this.originalSize = size;
      }
      get length() {
        return this.offset;
      }
      append(data) {
        if (!Buffer.isBuffer(data)) {
          throw new Error("Attempted to append a non-buffer instance to ReceiveBuffer.");
        }
        if (this.offset + data.length >= this.buffer.length) {
          const tmp = this.buffer;
          this.buffer = Buffer.allocUnsafe(Math.max(this.buffer.length + this.originalSize, this.buffer.length + data.length));
          tmp.copy(this.buffer);
        }
        data.copy(this.buffer, this.offset);
        return this.offset += data.length;
      }
      peek(length) {
        if (length > this.offset) {
          throw new Error("Attempted to read beyond the bounds of the managed internal data.");
        }
        return this.buffer.slice(0, length);
      }
      get(length) {
        if (length > this.offset) {
          throw new Error("Attempted to read beyond the bounds of the managed internal data.");
        }
        const value = Buffer.allocUnsafe(length);
        this.buffer.slice(0, length).copy(value);
        this.buffer.copyWithin(0, length, length + this.offset - length);
        this.offset -= length;
        return value;
      }
    };
    exports2.ReceiveBuffer = ReceiveBuffer;
  }
});

// node_modules/socks/build/client/socksclient.js
var require_socksclient = __commonJS({
  "node_modules/socks/build/client/socksclient.js"(exports2) {
    "use strict";
    var __awaiter = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) {
      function adopt(value) {
        return value instanceof P ? value : new P(function(resolve) {
          resolve(value);
        });
      }
      return new (P || (P = Promise))(function(resolve, reject) {
        function fulfilled(value) {
          try {
            step(generator.next(value));
          } catch (e) {
            reject(e);
          }
        }
        function rejected(value) {
          try {
            step(generator["throw"](value));
          } catch (e) {
            reject(e);
          }
        }
        function step(result) {
          result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
        }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
      });
    };
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.SocksClientError = exports2.SocksClient = void 0;
    var events_1 = require("events");
    var net = require("net");
    var smart_buffer_1 = require_smartbuffer();
    var constants_1 = require_constants2();
    var helpers_1 = require_helpers3();
    var receivebuffer_1 = require_receivebuffer();
    var util_1 = require_util();
    Object.defineProperty(exports2, "SocksClientError", { enumerable: true, get: function() {
      return util_1.SocksClientError;
    } });
    var ip_address_1 = require_ip_address();
    var SocksClient = class _SocksClient extends events_1.EventEmitter {
      constructor(options2) {
        super();
        this.options = Object.assign({}, options2);
        (0, helpers_1.validateSocksClientOptions)(options2);
        this.setState(constants_1.SocksClientState.Created);
      }
      /**
       * Creates a new SOCKS connection.
       *
       * Note: Supports callbacks and promises. Only supports the connect command.
       * @param options { SocksClientOptions } Options.
       * @param callback { Function } An optional callback function.
       * @returns { Promise }
       */
      static createConnection(options2, callback) {
        return new Promise((resolve, reject) => {
          try {
            (0, helpers_1.validateSocksClientOptions)(options2, ["connect"]);
          } catch (err) {
            if (typeof callback === "function") {
              callback(err);
              return resolve(err);
            } else {
              return reject(err);
            }
          }
          const client = new _SocksClient(options2);
          client.connect(options2.existing_socket);
          client.once("established", (info) => {
            client.removeAllListeners();
            if (typeof callback === "function") {
              callback(null, info);
              resolve(info);
            } else {
              resolve(info);
            }
          });
          client.once("error", (err) => {
            client.removeAllListeners();
            if (typeof callback === "function") {
              callback(err);
              resolve(err);
            } else {
              reject(err);
            }
          });
        });
      }
      /**
       * Creates a new SOCKS connection chain to a destination host through 2 or more SOCKS proxies.
       *
       * Note: Supports callbacks and promises. Only supports the connect method.
       * Note: Implemented via createConnection() factory function.
       * @param options { SocksClientChainOptions } Options
       * @param callback { Function } An optional callback function.
       * @returns { Promise }
       */
      static createConnectionChain(options2, callback) {
        return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
          try {
            (0, helpers_1.validateSocksClientChainOptions)(options2);
          } catch (err) {
            if (typeof callback === "function") {
              callback(err);
              return resolve(err);
            } else {
              return reject(err);
            }
          }
          if (options2.randomizeChain) {
            (0, util_1.shuffleArray)(options2.proxies);
          }
          try {
            let sock;
            for (let i = 0; i < options2.proxies.length; i++) {
              const nextProxy = options2.proxies[i];
              const nextDestination = i === options2.proxies.length - 1 ? options2.destination : {
                host: options2.proxies[i + 1].host || options2.proxies[i + 1].ipaddress,
                port: options2.proxies[i + 1].port
              };
              const result = yield _SocksClient.createConnection({
                command: "connect",
                proxy: nextProxy,
                destination: nextDestination,
                existing_socket: sock
              });
              sock = sock || result.socket;
            }
            if (typeof callback === "function") {
              callback(null, { socket: sock });
              resolve({ socket: sock });
            } else {
              resolve({ socket: sock });
            }
          } catch (err) {
            if (typeof callback === "function") {
              callback(err);
              resolve(err);
            } else {
              reject(err);
            }
          }
        }));
      }
      /**
       * Creates a SOCKS UDP Frame.
       * @param options
       */
      static createUDPFrame(options2) {
        const buff = new smart_buffer_1.SmartBuffer();
        buff.writeUInt16BE(0);
        buff.writeUInt8(options2.frameNumber || 0);
        if (net.isIPv4(options2.remoteHost.host)) {
          buff.writeUInt8(constants_1.Socks5HostType.IPv4);
          buff.writeUInt32BE((0, helpers_1.ipv4ToInt32)(options2.remoteHost.host));
        } else if (net.isIPv6(options2.remoteHost.host)) {
          buff.writeUInt8(constants_1.Socks5HostType.IPv6);
          buff.writeBuffer((0, helpers_1.ipToBuffer)(options2.remoteHost.host));
        } else {
          buff.writeUInt8(constants_1.Socks5HostType.Hostname);
          buff.writeUInt8(Buffer.byteLength(options2.remoteHost.host));
          buff.writeString(options2.remoteHost.host);
        }
        buff.writeUInt16BE(options2.remoteHost.port);
        buff.writeBuffer(options2.data);
        return buff.toBuffer();
      }
      /**
       * Parses a SOCKS UDP frame.
       * @param data
       */
      static parseUDPFrame(data) {
        const buff = smart_buffer_1.SmartBuffer.fromBuffer(data);
        buff.readOffset = 2;
        const frameNumber = buff.readUInt8();
        const hostType = buff.readUInt8();
        let remoteHost;
        if (hostType === constants_1.Socks5HostType.IPv4) {
          remoteHost = (0, helpers_1.int32ToIpv4)(buff.readUInt32BE());
        } else if (hostType === constants_1.Socks5HostType.IPv6) {
          remoteHost = ip_address_1.Address6.fromByteArray(Array.from(buff.readBuffer(16))).canonicalForm();
        } else {
          remoteHost = buff.readString(buff.readUInt8());
        }
        const remotePort = buff.readUInt16BE();
        return {
          frameNumber,
          remoteHost: {
            host: remoteHost,
            port: remotePort
          },
          data: buff.readBuffer()
        };
      }
      /**
       * Internal state setter. If the SocksClient is in an error state, it cannot be changed to a non error state.
       */
      setState(newState) {
        if (this.state !== constants_1.SocksClientState.Error) {
          this.state = newState;
        }
      }
      /**
       * Starts the connection establishment to the proxy and destination.
       * @param existingSocket Connected socket to use instead of creating a new one (internal use).
       */
      connect(existingSocket) {
        this.onDataReceived = (data) => this.onDataReceivedHandler(data);
        this.onClose = () => this.onCloseHandler();
        this.onError = (err) => this.onErrorHandler(err);
        this.onConnect = () => this.onConnectHandler();
        const timer = setTimeout(() => this.onEstablishedTimeout(), this.options.timeout || constants_1.DEFAULT_TIMEOUT);
        if (timer.unref && typeof timer.unref === "function") {
          timer.unref();
        }
        if (existingSocket) {
          this.socket = existingSocket;
        } else {
          this.socket = new net.Socket();
        }
        this.socket.once("close", this.onClose);
        this.socket.once("error", this.onError);
        this.socket.once("connect", this.onConnect);
        this.socket.on("data", this.onDataReceived);
        this.setState(constants_1.SocksClientState.Connecting);
        this.receiveBuffer = new receivebuffer_1.ReceiveBuffer();
        if (existingSocket) {
          this.socket.emit("connect");
        } else {
          this.socket.connect(this.getSocketOptions());
          if (this.options.set_tcp_nodelay !== void 0 && this.options.set_tcp_nodelay !== null) {
            this.socket.setNoDelay(!!this.options.set_tcp_nodelay);
          }
        }
        this.prependOnceListener("established", (info) => {
          setImmediate(() => {
            if (this.receiveBuffer.length > 0) {
              const excessData = this.receiveBuffer.get(this.receiveBuffer.length);
              info.socket.emit("data", excessData);
            }
            info.socket.resume();
          });
        });
      }
      // Socket options (defaults host/port to options.proxy.host/options.proxy.port)
      getSocketOptions() {
        return Object.assign(Object.assign({}, this.options.socket_options), { host: this.options.proxy.host || this.options.proxy.ipaddress, port: this.options.proxy.port });
      }
      /**
       * Handles internal Socks timeout callback.
       * Note: If the Socks client is not BoundWaitingForConnection or Established, the connection will be closed.
       */
      onEstablishedTimeout() {
        if (this.state !== constants_1.SocksClientState.Established && this.state !== constants_1.SocksClientState.BoundWaitingForConnection) {
          this.closeSocket(constants_1.ERRORS.ProxyConnectionTimedOut);
        }
      }
      /**
       * Handles Socket connect event.
       */
      onConnectHandler() {
        this.setState(constants_1.SocksClientState.Connected);
        if (this.options.proxy.type === 4) {
          this.sendSocks4InitialHandshake();
        } else {
          this.sendSocks5InitialHandshake();
        }
        this.setState(constants_1.SocksClientState.SentInitialHandshake);
      }
      /**
       * Handles Socket data event.
       * @param data
       */
      onDataReceivedHandler(data) {
        this.receiveBuffer.append(data);
        this.processData();
      }
      /**
       * Handles processing of the data we have received.
       */
      processData() {
        while (this.state !== constants_1.SocksClientState.Established && this.state !== constants_1.SocksClientState.Error && this.receiveBuffer.length >= this.nextRequiredPacketBufferSize) {
          if (this.state === constants_1.SocksClientState.SentInitialHandshake) {
            if (this.options.proxy.type === 4) {
              this.handleSocks4FinalHandshakeResponse();
            } else {
              this.handleInitialSocks5HandshakeResponse();
            }
          } else if (this.state === constants_1.SocksClientState.SentAuthentication) {
            this.handleInitialSocks5AuthenticationHandshakeResponse();
          } else if (this.state === constants_1.SocksClientState.SentFinalHandshake) {
            this.handleSocks5FinalHandshakeResponse();
          } else if (this.state === constants_1.SocksClientState.BoundWaitingForConnection) {
            if (this.options.proxy.type === 4) {
              this.handleSocks4IncomingConnectionResponse();
            } else {
              this.handleSocks5IncomingConnectionResponse();
            }
          } else {
            this.closeSocket(constants_1.ERRORS.InternalError);
            break;
          }
        }
      }
      /**
       * Handles Socket close event.
       * @param had_error
       */
      onCloseHandler() {
        this.closeSocket(constants_1.ERRORS.SocketClosed);
      }
      /**
       * Handles Socket error event.
       * @param err
       */
      onErrorHandler(err) {
        this.closeSocket(err.message);
      }
      /**
       * Removes internal event listeners on the underlying Socket.
       */
      removeInternalSocketHandlers() {
        this.socket.pause();
        this.socket.removeListener("data", this.onDataReceived);
        this.socket.removeListener("close", this.onClose);
        this.socket.removeListener("error", this.onError);
        this.socket.removeListener("connect", this.onConnect);
      }
      /**
       * Closes and destroys the underlying Socket. Emits an error event.
       * @param err { String } An error string to include in error event.
       */
      closeSocket(err) {
        if (this.state !== constants_1.SocksClientState.Error) {
          this.setState(constants_1.SocksClientState.Error);
          this.socket.destroy();
          this.removeInternalSocketHandlers();
          this.emit("error", new util_1.SocksClientError(err, this.options));
        }
      }
      /**
       * Sends initial Socks v4 handshake request.
       */
      sendSocks4InitialHandshake() {
        const userId = this.options.proxy.userId || "";
        const buff = new smart_buffer_1.SmartBuffer();
        buff.writeUInt8(4);
        buff.writeUInt8(constants_1.SocksCommand[this.options.command]);
        buff.writeUInt16BE(this.options.destination.port);
        if (net.isIPv4(this.options.destination.host)) {
          buff.writeBuffer((0, helpers_1.ipToBuffer)(this.options.destination.host));
          buff.writeStringNT(userId);
        } else {
          buff.writeUInt8(0);
          buff.writeUInt8(0);
          buff.writeUInt8(0);
          buff.writeUInt8(1);
          buff.writeStringNT(userId);
          buff.writeStringNT(this.options.destination.host);
        }
        this.nextRequiredPacketBufferSize = constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks4Response;
        this.socket.write(buff.toBuffer());
      }
      /**
       * Handles Socks v4 handshake response.
       * @param data
       */
      handleSocks4FinalHandshakeResponse() {
        const data = this.receiveBuffer.get(8);
        if (data[1] !== constants_1.Socks4Response.Granted) {
          this.closeSocket(`${constants_1.ERRORS.Socks4ProxyRejectedConnection} - (${constants_1.Socks4Response[data[1]]})`);
        } else {
          if (constants_1.SocksCommand[this.options.command] === constants_1.SocksCommand.bind) {
            const buff = smart_buffer_1.SmartBuffer.fromBuffer(data);
            buff.readOffset = 2;
            const remoteHost = {
              port: buff.readUInt16BE(),
              host: (0, helpers_1.int32ToIpv4)(buff.readUInt32BE())
            };
            if (remoteHost.host === "0.0.0.0") {
              remoteHost.host = this.options.proxy.ipaddress;
            }
            this.setState(constants_1.SocksClientState.BoundWaitingForConnection);
            this.emit("bound", { remoteHost, socket: this.socket });
          } else {
            this.setState(constants_1.SocksClientState.Established);
            this.removeInternalSocketHandlers();
            this.emit("established", { socket: this.socket });
          }
        }
      }
      /**
       * Handles Socks v4 incoming connection request (BIND)
       * @param data
       */
      handleSocks4IncomingConnectionResponse() {
        const data = this.receiveBuffer.get(8);
        if (data[1] !== constants_1.Socks4Response.Granted) {
          this.closeSocket(`${constants_1.ERRORS.Socks4ProxyRejectedIncomingBoundConnection} - (${constants_1.Socks4Response[data[1]]})`);
        } else {
          const buff = smart_buffer_1.SmartBuffer.fromBuffer(data);
          buff.readOffset = 2;
          const remoteHost = {
            port: buff.readUInt16BE(),
            host: (0, helpers_1.int32ToIpv4)(buff.readUInt32BE())
          };
          this.setState(constants_1.SocksClientState.Established);
          this.removeInternalSocketHandlers();
          this.emit("established", { remoteHost, socket: this.socket });
        }
      }
      /**
       * Sends initial Socks v5 handshake request.
       */
      sendSocks5InitialHandshake() {
        const buff = new smart_buffer_1.SmartBuffer();
        const supportedAuthMethods = [constants_1.Socks5Auth.NoAuth];
        if (this.options.proxy.userId || this.options.proxy.password) {
          supportedAuthMethods.push(constants_1.Socks5Auth.UserPass);
        }
        if (this.options.proxy.custom_auth_method !== void 0) {
          supportedAuthMethods.push(this.options.proxy.custom_auth_method);
        }
        buff.writeUInt8(5);
        buff.writeUInt8(supportedAuthMethods.length);
        for (const authMethod of supportedAuthMethods) {
          buff.writeUInt8(authMethod);
        }
        this.nextRequiredPacketBufferSize = constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks5InitialHandshakeResponse;
        this.socket.write(buff.toBuffer());
        this.setState(constants_1.SocksClientState.SentInitialHandshake);
      }
      /**
       * Handles initial Socks v5 handshake response.
       * @param data
       */
      handleInitialSocks5HandshakeResponse() {
        const data = this.receiveBuffer.get(2);
        if (data[0] !== 5) {
          this.closeSocket(constants_1.ERRORS.InvalidSocks5IntiailHandshakeSocksVersion);
        } else if (data[1] === constants_1.SOCKS5_NO_ACCEPTABLE_AUTH) {
          this.closeSocket(constants_1.ERRORS.InvalidSocks5InitialHandshakeNoAcceptedAuthType);
        } else {
          if (data[1] === constants_1.Socks5Auth.NoAuth) {
            this.socks5ChosenAuthType = constants_1.Socks5Auth.NoAuth;
            this.sendSocks5CommandRequest();
          } else if (data[1] === constants_1.Socks5Auth.UserPass) {
            this.socks5ChosenAuthType = constants_1.Socks5Auth.UserPass;
            this.sendSocks5UserPassAuthentication();
          } else if (data[1] === this.options.proxy.custom_auth_method) {
            this.socks5ChosenAuthType = this.options.proxy.custom_auth_method;
            this.sendSocks5CustomAuthentication();
          } else {
            this.closeSocket(constants_1.ERRORS.InvalidSocks5InitialHandshakeUnknownAuthType);
          }
        }
      }
      /**
       * Sends Socks v5 user & password auth handshake.
       *
       * Note: No auth and user/pass are currently supported.
       */
      sendSocks5UserPassAuthentication() {
        const userId = this.options.proxy.userId || "";
        const password = this.options.proxy.password || "";
        const buff = new smart_buffer_1.SmartBuffer();
        buff.writeUInt8(1);
        buff.writeUInt8(Buffer.byteLength(userId));
        buff.writeString(userId);
        buff.writeUInt8(Buffer.byteLength(password));
        buff.writeString(password);
        this.nextRequiredPacketBufferSize = constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks5UserPassAuthenticationResponse;
        this.socket.write(buff.toBuffer());
        this.setState(constants_1.SocksClientState.SentAuthentication);
      }
      sendSocks5CustomAuthentication() {
        return __awaiter(this, void 0, void 0, function* () {
          this.nextRequiredPacketBufferSize = this.options.proxy.custom_auth_response_size;
          this.socket.write(yield this.options.proxy.custom_auth_request_handler());
          this.setState(constants_1.SocksClientState.SentAuthentication);
        });
      }
      handleSocks5CustomAuthHandshakeResponse(data) {
        return __awaiter(this, void 0, void 0, function* () {
          return yield this.options.proxy.custom_auth_response_handler(data);
        });
      }
      handleSocks5AuthenticationNoAuthHandshakeResponse(data) {
        return __awaiter(this, void 0, void 0, function* () {
          return data[1] === 0;
        });
      }
      handleSocks5AuthenticationUserPassHandshakeResponse(data) {
        return __awaiter(this, void 0, void 0, function* () {
          return data[1] === 0;
        });
      }
      /**
       * Handles Socks v5 auth handshake response.
       * @param data
       */
      handleInitialSocks5AuthenticationHandshakeResponse() {
        return __awaiter(this, void 0, void 0, function* () {
          this.setState(constants_1.SocksClientState.ReceivedAuthenticationResponse);
          let authResult = false;
          if (this.socks5ChosenAuthType === constants_1.Socks5Auth.NoAuth) {
            authResult = yield this.handleSocks5AuthenticationNoAuthHandshakeResponse(this.receiveBuffer.get(2));
          } else if (this.socks5ChosenAuthType === constants_1.Socks5Auth.UserPass) {
            authResult = yield this.handleSocks5AuthenticationUserPassHandshakeResponse(this.receiveBuffer.get(2));
          } else if (this.socks5ChosenAuthType === this.options.proxy.custom_auth_method) {
            authResult = yield this.handleSocks5CustomAuthHandshakeResponse(this.receiveBuffer.get(this.options.proxy.custom_auth_response_size));
          }
          if (!authResult) {
            this.closeSocket(constants_1.ERRORS.Socks5AuthenticationFailed);
          } else {
            this.sendSocks5CommandRequest();
          }
        });
      }
      /**
       * Sends Socks v5 final handshake request.
       */
      sendSocks5CommandRequest() {
        const buff = new smart_buffer_1.SmartBuffer();
        buff.writeUInt8(5);
        buff.writeUInt8(constants_1.SocksCommand[this.options.command]);
        buff.writeUInt8(0);
        if (net.isIPv4(this.options.destination.host)) {
          buff.writeUInt8(constants_1.Socks5HostType.IPv4);
          buff.writeBuffer((0, helpers_1.ipToBuffer)(this.options.destination.host));
        } else if (net.isIPv6(this.options.destination.host)) {
          buff.writeUInt8(constants_1.Socks5HostType.IPv6);
          buff.writeBuffer((0, helpers_1.ipToBuffer)(this.options.destination.host));
        } else {
          buff.writeUInt8(constants_1.Socks5HostType.Hostname);
          buff.writeUInt8(this.options.destination.host.length);
          buff.writeString(this.options.destination.host);
        }
        buff.writeUInt16BE(this.options.destination.port);
        this.nextRequiredPacketBufferSize = constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseHeader;
        this.socket.write(buff.toBuffer());
        this.setState(constants_1.SocksClientState.SentFinalHandshake);
      }
      /**
       * Handles Socks v5 final handshake response.
       * @param data
       */
      handleSocks5FinalHandshakeResponse() {
        const header = this.receiveBuffer.peek(5);
        if (header[0] !== 5 || header[1] !== constants_1.Socks5Response.Granted) {
          this.closeSocket(`${constants_1.ERRORS.InvalidSocks5FinalHandshakeRejected} - ${constants_1.Socks5Response[header[1]]}`);
        } else {
          const addressType = header[3];
          let remoteHost;
          let buff;
          if (addressType === constants_1.Socks5HostType.IPv4) {
            const dataNeeded = constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseIPv4;
            if (this.receiveBuffer.length < dataNeeded) {
              this.nextRequiredPacketBufferSize = dataNeeded;
              return;
            }
            buff = smart_buffer_1.SmartBuffer.fromBuffer(this.receiveBuffer.get(dataNeeded).slice(4));
            remoteHost = {
              host: (0, helpers_1.int32ToIpv4)(buff.readUInt32BE()),
              port: buff.readUInt16BE()
            };
            if (remoteHost.host === "0.0.0.0") {
              remoteHost.host = this.options.proxy.ipaddress;
            }
          } else if (addressType === constants_1.Socks5HostType.Hostname) {
            const hostLength = header[4];
            const dataNeeded = constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseHostname(hostLength);
            if (this.receiveBuffer.length < dataNeeded) {
              this.nextRequiredPacketBufferSize = dataNeeded;
              return;
            }
            buff = smart_buffer_1.SmartBuffer.fromBuffer(this.receiveBuffer.get(dataNeeded).slice(5));
            remoteHost = {
              host: buff.readString(hostLength),
              port: buff.readUInt16BE()
            };
          } else if (addressType === constants_1.Socks5HostType.IPv6) {
            const dataNeeded = constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseIPv6;
            if (this.receiveBuffer.length < dataNeeded) {
              this.nextRequiredPacketBufferSize = dataNeeded;
              return;
            }
            buff = smart_buffer_1.SmartBuffer.fromBuffer(this.receiveBuffer.get(dataNeeded).slice(4));
            remoteHost = {
              host: ip_address_1.Address6.fromByteArray(Array.from(buff.readBuffer(16))).canonicalForm(),
              port: buff.readUInt16BE()
            };
          }
          this.setState(constants_1.SocksClientState.ReceivedFinalResponse);
          if (constants_1.SocksCommand[this.options.command] === constants_1.SocksCommand.connect) {
            this.setState(constants_1.SocksClientState.Established);
            this.removeInternalSocketHandlers();
            this.emit("established", { remoteHost, socket: this.socket });
          } else if (constants_1.SocksCommand[this.options.command] === constants_1.SocksCommand.bind) {
            this.setState(constants_1.SocksClientState.BoundWaitingForConnection);
            this.nextRequiredPacketBufferSize = constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseHeader;
            this.emit("bound", { remoteHost, socket: this.socket });
          } else if (constants_1.SocksCommand[this.options.command] === constants_1.SocksCommand.associate) {
            this.setState(constants_1.SocksClientState.Established);
            this.removeInternalSocketHandlers();
            this.emit("established", {
              remoteHost,
              socket: this.socket
            });
          }
        }
      }
      /**
       * Handles Socks v5 incoming connection request (BIND).
       */
      handleSocks5IncomingConnectionResponse() {
        const header = this.receiveBuffer.peek(5);
        if (header[0] !== 5 || header[1] !== constants_1.Socks5Response.Granted) {
          this.closeSocket(`${constants_1.ERRORS.Socks5ProxyRejectedIncomingBoundConnection} - ${constants_1.Socks5Response[header[1]]}`);
        } else {
          const addressType = header[3];
          let remoteHost;
          let buff;
          if (addressType === constants_1.Socks5HostType.IPv4) {
            const dataNeeded = constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseIPv4;
            if (this.receiveBuffer.length < dataNeeded) {
              this.nextRequiredPacketBufferSize = dataNeeded;
              return;
            }
            buff = smart_buffer_1.SmartBuffer.fromBuffer(this.receiveBuffer.get(dataNeeded).slice(4));
            remoteHost = {
              host: (0, helpers_1.int32ToIpv4)(buff.readUInt32BE()),
              port: buff.readUInt16BE()
            };
            if (remoteHost.host === "0.0.0.0") {
              remoteHost.host = this.options.proxy.ipaddress;
            }
          } else if (addressType === constants_1.Socks5HostType.Hostname) {
            const hostLength = header[4];
            const dataNeeded = constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseHostname(hostLength);
            if (this.receiveBuffer.length < dataNeeded) {
              this.nextRequiredPacketBufferSize = dataNeeded;
              return;
            }
            buff = smart_buffer_1.SmartBuffer.fromBuffer(this.receiveBuffer.get(dataNeeded).slice(5));
            remoteHost = {
              host: buff.readString(hostLength),
              port: buff.readUInt16BE()
            };
          } else if (addressType === constants_1.Socks5HostType.IPv6) {
            const dataNeeded = constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseIPv6;
            if (this.receiveBuffer.length < dataNeeded) {
              this.nextRequiredPacketBufferSize = dataNeeded;
              return;
            }
            buff = smart_buffer_1.SmartBuffer.fromBuffer(this.receiveBuffer.get(dataNeeded).slice(4));
            remoteHost = {
              host: ip_address_1.Address6.fromByteArray(Array.from(buff.readBuffer(16))).canonicalForm(),
              port: buff.readUInt16BE()
            };
          }
          this.setState(constants_1.SocksClientState.Established);
          this.removeInternalSocketHandlers();
          this.emit("established", { remoteHost, socket: this.socket });
        }
      }
      get socksClientOptions() {
        return Object.assign({}, this.options);
      }
    };
    exports2.SocksClient = SocksClient;
  }
});

// node_modules/socks/build/index.js
var require_build = __commonJS({
  "node_modules/socks/build/index.js"(exports2) {
    "use strict";
    var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) {
      if (k2 === void 0) k2 = k;
      var desc = Object.getOwnPropertyDescriptor(m, k);
      if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
        desc = { enumerable: true, get: function() {
          return m[k];
        } };
      }
      Object.defineProperty(o, k2, desc);
    }) : (function(o, m, k, k2) {
      if (k2 === void 0) k2 = k;
      o[k2] = m[k];
    }));
    var __exportStar = exports2 && exports2.__exportStar || function(m, exports3) {
      for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p)) __createBinding(exports3, m, p);
    };
    Object.defineProperty(exports2, "__esModule", { value: true });
    __exportStar(require_socksclient(), exports2);
  }
});

// node_modules/socks-proxy-agent/dist/index.js
var require_dist3 = __commonJS({
  "node_modules/socks-proxy-agent/dist/index.js"(exports2) {
    "use strict";
    var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) {
      if (k2 === void 0) k2 = k;
      var desc = Object.getOwnPropertyDescriptor(m, k);
      if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
        desc = { enumerable: true, get: function() {
          return m[k];
        } };
      }
      Object.defineProperty(o, k2, desc);
    }) : (function(o, m, k, k2) {
      if (k2 === void 0) k2 = k;
      o[k2] = m[k];
    }));
    var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) {
      Object.defineProperty(o, "default", { enumerable: true, value: v });
    }) : function(o, v) {
      o["default"] = v;
    });
    var __importStar = exports2 && exports2.__importStar || function(mod) {
      if (mod && mod.__esModule) return mod;
      var result = {};
      if (mod != null) {
        for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
      }
      __setModuleDefault(result, mod);
      return result;
    };
    var __importDefault = exports2 && exports2.__importDefault || function(mod) {
      return mod && mod.__esModule ? mod : { "default": mod };
    };
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.SocksProxyAgent = void 0;
    var socks_1 = require_build();
    var agent_base_1 = require_dist();
    var debug_1 = __importDefault(require_src());
    var dns = __importStar(require("dns"));
    var net = __importStar(require("net"));
    var tls = __importStar(require("tls"));
    var url_1 = require("url");
    var debug2 = (0, debug_1.default)("socks-proxy-agent");
    var setServernameFromNonIpHost = (options2) => {
      if (options2.servername === void 0 && options2.host && !net.isIP(options2.host)) {
        return {
          ...options2,
          servername: options2.host
        };
      }
      return options2;
    };
    function parseSocksURL(url2) {
      let lookup = false;
      let type = 5;
      const host = url2.hostname;
      const port = parseInt(url2.port, 10) || 1080;
      switch (url2.protocol.replace(":", "")) {
        case "socks4":
          lookup = true;
          type = 4;
          break;
        // pass through
        case "socks4a":
          type = 4;
          break;
        case "socks5":
          lookup = true;
          type = 5;
          break;
        // pass through
        case "socks":
          type = 5;
          break;
        case "socks5h":
          type = 5;
          break;
        default:
          throw new TypeError(`A "socks" protocol must be specified! Got: ${String(url2.protocol)}`);
      }
      const proxy = {
        host,
        port,
        type
      };
      if (url2.username) {
        Object.defineProperty(proxy, "userId", {
          value: decodeURIComponent(url2.username),
          enumerable: false
        });
      }
      if (url2.password != null) {
        Object.defineProperty(proxy, "password", {
          value: decodeURIComponent(url2.password),
          enumerable: false
        });
      }
      return { lookup, proxy };
    }
    var SocksProxyAgent2 = class extends agent_base_1.Agent {
      constructor(uri, opts) {
        super(opts);
        const url2 = typeof uri === "string" ? new url_1.URL(uri) : uri;
        const { proxy, lookup } = parseSocksURL(url2);
        this.shouldLookup = lookup;
        this.proxy = proxy;
        this.timeout = opts?.timeout ?? null;
        this.socketOptions = opts?.socketOptions ?? null;
      }
      /**
       * Initiates a SOCKS connection to the specified SOCKS proxy server,
       * which in turn connects to the specified remote host and port.
       */
      async connect(req, opts) {
        const { shouldLookup, proxy, timeout } = this;
        if (!opts.host) {
          throw new Error("No `host` defined!");
        }
        let { host } = opts;
        const { port, lookup: lookupFn = dns.lookup } = opts;
        if (shouldLookup) {
          host = await new Promise((resolve, reject) => {
            lookupFn(host, {}, (err, res) => {
              if (err) {
                reject(err);
              } else {
                resolve(res);
              }
            });
          });
        }
        const socksOpts = {
          proxy,
          destination: {
            host,
            port: typeof port === "number" ? port : parseInt(port, 10)
          },
          command: "connect",
          timeout: timeout ?? void 0,
          // @ts-expect-error the type supplied by socks for socket_options is wider
          // than necessary since socks will always override the host and port
          socket_options: this.socketOptions ?? void 0
        };
        const cleanup = (tlsSocket) => {
          req.destroy();
          socket.destroy();
          if (tlsSocket)
            tlsSocket.destroy();
        };
        debug2("Creating socks proxy connection: %o", socksOpts);
        const { socket } = await socks_1.SocksClient.createConnection(socksOpts);
        debug2("Successfully created socks proxy connection");
        if (timeout !== null) {
          socket.setTimeout(timeout);
          socket.on("timeout", () => cleanup());
        }
        if (opts.secureEndpoint) {
          debug2("Upgrading socket connection to TLS");
          const tlsSocket = tls.connect({
            ...omit2(setServernameFromNonIpHost(opts), "host", "path", "port"),
            socket
          });
          tlsSocket.once("error", (error48) => {
            debug2("Socket TLS error", error48.message);
            cleanup(tlsSocket);
          });
          return tlsSocket;
        }
        return socket;
      }
    };
    SocksProxyAgent2.protocols = [
      "socks",
      "socks4",
      "socks4a",
      "socks5",
      "socks5h"
    ];
    exports2.SocksProxyAgent = SocksProxyAgent2;
    function omit2(obj, ...keys) {
      const ret = {};
      let key;
      for (key in obj) {
        if (!keys.includes(key)) {
          ret[key] = obj[key];
        }
      }
      return ret;
    }
  }
});

// node_modules/ws/lib/stream.js
var require_stream = __commonJS({
  "node_modules/ws/lib/stream.js"(exports2, module2) {
    "use strict";
    var { Duplex } = require("stream");
    function emitClose(stream) {
      stream.emit("close");
    }
    function duplexOnEnd() {
      if (!this.destroyed && this._writableState.finished) {
        this.destroy();
      }
    }
    function duplexOnError(err) {
      this.removeListener("error", duplexOnError);
      this.destroy();
      if (this.listenerCount("error") === 0) {
        this.emit("error", err);
      }
    }
    function createWebSocketStream2(ws2, options2) {
      let terminateOnDestroy = true;
      const duplex = new Duplex({
        ...options2,
        autoDestroy: false,
        emitClose: false,
        objectMode: false,
        writableObjectMode: false
      });
      ws2.on("message", function message(msg, isBinary) {
        const data = !isBinary && duplex._readableState.objectMode ? msg.toString() : msg;
        if (!duplex.push(data)) ws2.pause();
      });
      ws2.once("error", function error48(err) {
        if (duplex.destroyed) return;
        terminateOnDestroy = false;
        duplex.destroy(err);
      });
      ws2.once("close", function close() {
        if (duplex.destroyed) return;
        duplex.push(null);
      });
      duplex._destroy = function(err, callback) {
        if (ws2.readyState === ws2.CLOSED) {
          callback(err);
          process.nextTick(emitClose, duplex);
          return;
        }
        let called = false;
        ws2.once("error", function error48(err2) {
          called = true;
          callback(err2);
        });
        ws2.once("close", function close() {
          if (!called) callback(err);
          process.nextTick(emitClose, duplex);
        });
        if (terminateOnDestroy) ws2.terminate();
      };
      duplex._final = function(callback) {
        if (ws2.readyState === ws2.CONNECTING) {
          ws2.once("open", function open2() {
            duplex._final(callback);
          });
          return;
        }
        if (ws2._socket === null) return;
        if (ws2._socket._writableState.finished) {
          callback();
          if (duplex._readableState.endEmitted) duplex.destroy();
        } else {
          ws2._socket.once("finish", function finish() {
            callback();
          });
          ws2.close();
        }
      };
      duplex._read = function() {
        if (ws2.isPaused) ws2.resume();
      };
      duplex._write = function(chunk, encoding, callback) {
        if (ws2.readyState === ws2.CONNECTING) {
          ws2.once("open", function open2() {
            duplex._write(chunk, encoding, callback);
          });
          return;
        }
        ws2.send(chunk, callback);
      };
      duplex.on("end", duplexOnEnd);
      duplex.on("error", duplexOnError);
      return duplex;
    }
    module2.exports = createWebSocketStream2;
  }
});

// node_modules/ws/lib/constants.js
var require_constants5 = __commonJS({
  "node_modules/ws/lib/constants.js"(exports2, module2) {
    "use strict";
    module2.exports = {
      BINARY_TYPES: ["nodebuffer", "arraybuffer", "fragments"],
      EMPTY_BUFFER: Buffer.alloc(0),
      GUID: "258EAFA5-E914-47DA-95CA-C5AB0DC85B11",
      kForOnEventAttribute: Symbol("kIsForOnEventAttribute"),
      kListener: Symbol("kListener"),
      kStatusCode: Symbol("status-code"),
      kWebSocket: Symbol("websocket"),
      NOOP: () => {
      }
    };
  }
});

// node_modules/ws/lib/buffer-util.js
var require_buffer_util = __commonJS({
  "node_modules/ws/lib/buffer-util.js"(exports2, module2) {
    "use strict";
    var { EMPTY_BUFFER } = require_constants5();
    var FastBuffer = Buffer[Symbol.species];
    function concat(list, totalLength) {
      if (list.length === 0) return EMPTY_BUFFER;
      if (list.length === 1) return list[0];
      const target = Buffer.allocUnsafe(totalLength);
      let offset = 0;
      for (let i = 0; i < list.length; i++) {
        const buf = list[i];
        target.set(buf, offset);
        offset += buf.length;
      }
      if (offset < totalLength) {
        return new FastBuffer(target.buffer, target.byteOffset, offset);
      }
      return target;
    }
    function _mask(source, mask, output, offset, length) {
      for (let i = 0; i < length; i++) {
        output[offset + i] = source[i] ^ mask[i & 3];
      }
    }
    function _unmask(buffer, mask) {
      for (let i = 0; i < buffer.length; i++) {
        buffer[i] ^= mask[i & 3];
      }
    }
    function toArrayBuffer(buf) {
      if (buf.length === buf.buffer.byteLength) {
        return buf.buffer;
      }
      return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.length);
    }
    function toBuffer(data) {
      toBuffer.readOnly = true;
      if (Buffer.isBuffer(data)) return data;
      let buf;
      if (data instanceof ArrayBuffer) {
        buf = new FastBuffer(data);
      } else if (ArrayBuffer.isView(data)) {
        buf = new FastBuffer(data.buffer, data.byteOffset, data.byteLength);
      } else {
        buf = Buffer.from(data);
        toBuffer.readOnly = false;
      }
      return buf;
    }
    module2.exports = {
      concat,
      mask: _mask,
      toArrayBuffer,
      toBuffer,
      unmask: _unmask
    };
    if (!process.env.WS_NO_BUFFER_UTIL) {
      try {
        const bufferUtil = require("bufferutil");
        module2.exports.mask = function(source, mask, output, offset, length) {
          if (length < 48) _mask(source, mask, output, offset, length);
          else bufferUtil.mask(source, mask, output, offset, length);
        };
        module2.exports.unmask = function(buffer, mask) {
          if (buffer.length < 32) _unmask(buffer, mask);
          else bufferUtil.unmask(buffer, mask);
        };
      } catch (e) {
      }
    }
  }
});

// node_modules/ws/lib/limiter.js
var require_limiter = __commonJS({
  "node_modules/ws/lib/limiter.js"(exports2, module2) {
    "use strict";
    var kDone = Symbol("kDone");
    var kRun = Symbol("kRun");
    var Limiter = class {
      /**
       * Creates a new `Limiter`.
       *
       * @param {Number} [concurrency=Infinity] The maximum number of jobs allowed
       *     to run concurrently
       */
      constructor(concurrency) {
        this[kDone] = () => {
          this.pending--;
          this[kRun]();
        };
        this.concurrency = concurrency || Infinity;
        this.jobs = [];
        this.pending = 0;
      }
      /**
       * Adds a job to the queue.
       *
       * @param {Function} job The job to run
       * @public
       */
      add(job) {
        this.jobs.push(job);
        this[kRun]();
      }
      /**
       * Removes a job from the queue and runs it if possible.
       *
       * @private
       */
      [kRun]() {
        if (this.pending === this.concurrency) return;
        if (this.jobs.length) {
          const job = this.jobs.shift();
          this.pending++;
          job(this[kDone]);
        }
      }
    };
    module2.exports = Limiter;
  }
});

// node_modules/ws/lib/permessage-deflate.js
var require_permessage_deflate = __commonJS({
  "node_modules/ws/lib/permessage-deflate.js"(exports2, module2) {
    "use strict";
    var zlib = require("zlib");
    var bufferUtil = require_buffer_util();
    var Limiter = require_limiter();
    var { kStatusCode } = require_constants5();
    var FastBuffer = Buffer[Symbol.species];
    var TRAILER = Buffer.from([0, 0, 255, 255]);
    var kPerMessageDeflate = Symbol("permessage-deflate");
    var kTotalLength = Symbol("total-length");
    var kCallback = Symbol("callback");
    var kBuffers = Symbol("buffers");
    var kError = Symbol("error");
    var zlibLimiter;
    var PerMessageDeflate = class {
      /**
       * Creates a PerMessageDeflate instance.
       *
       * @param {Object} [options] Configuration options
       * @param {(Boolean|Number)} [options.clientMaxWindowBits] Advertise support
       *     for, or request, a custom client window size
       * @param {Boolean} [options.clientNoContextTakeover=false] Advertise/
       *     acknowledge disabling of client context takeover
       * @param {Number} [options.concurrencyLimit=10] The number of concurrent
       *     calls to zlib
       * @param {(Boolean|Number)} [options.serverMaxWindowBits] Request/confirm the
       *     use of a custom server window size
       * @param {Boolean} [options.serverNoContextTakeover=false] Request/accept
       *     disabling of server context takeover
       * @param {Number} [options.threshold=1024] Size (in bytes) below which
       *     messages should not be compressed if context takeover is disabled
       * @param {Object} [options.zlibDeflateOptions] Options to pass to zlib on
       *     deflate
       * @param {Object} [options.zlibInflateOptions] Options to pass to zlib on
       *     inflate
       * @param {Boolean} [isServer=false] Create the instance in either server or
       *     client mode
       * @param {Number} [maxPayload=0] The maximum allowed message length
       */
      constructor(options2, isServer, maxPayload) {
        this._maxPayload = maxPayload | 0;
        this._options = options2 || {};
        this._threshold = this._options.threshold !== void 0 ? this._options.threshold : 1024;
        this._isServer = !!isServer;
        this._deflate = null;
        this._inflate = null;
        this.params = null;
        if (!zlibLimiter) {
          const concurrency = this._options.concurrencyLimit !== void 0 ? this._options.concurrencyLimit : 10;
          zlibLimiter = new Limiter(concurrency);
        }
      }
      /**
       * @type {String}
       */
      static get extensionName() {
        return "permessage-deflate";
      }
      /**
       * Create an extension negotiation offer.
       *
       * @return {Object} Extension parameters
       * @public
       */
      offer() {
        const params = {};
        if (this._options.serverNoContextTakeover) {
          params.server_no_context_takeover = true;
        }
        if (this._options.clientNoContextTakeover) {
          params.client_no_context_takeover = true;
        }
        if (this._options.serverMaxWindowBits) {
          params.server_max_window_bits = this._options.serverMaxWindowBits;
        }
        if (this._options.clientMaxWindowBits) {
          params.client_max_window_bits = this._options.clientMaxWindowBits;
        } else if (this._options.clientMaxWindowBits == null) {
          params.client_max_window_bits = true;
        }
        return params;
      }
      /**
       * Accept an extension negotiation offer/response.
       *
       * @param {Array} configurations The extension negotiation offers/reponse
       * @return {Object} Accepted configuration
       * @public
       */
      accept(configurations) {
        configurations = this.normalizeParams(configurations);
        this.params = this._isServer ? this.acceptAsServer(configurations) : this.acceptAsClient(configurations);
        return this.params;
      }
      /**
       * Releases all resources used by the extension.
       *
       * @public
       */
      cleanup() {
        if (this._inflate) {
          this._inflate.close();
          this._inflate = null;
        }
        if (this._deflate) {
          const callback = this._deflate[kCallback];
          this._deflate.close();
          this._deflate = null;
          if (callback) {
            callback(
              new Error(
                "The deflate stream was closed while data was being processed"
              )
            );
          }
        }
      }
      /**
       *  Accept an extension negotiation offer.
       *
       * @param {Array} offers The extension negotiation offers
       * @return {Object} Accepted configuration
       * @private
       */
      acceptAsServer(offers) {
        const opts = this._options;
        const accepted = offers.find((params) => {
          if (opts.serverNoContextTakeover === false && params.server_no_context_takeover || params.server_max_window_bits && (opts.serverMaxWindowBits === false || typeof opts.serverMaxWindowBits === "number" && opts.serverMaxWindowBits > params.server_max_window_bits) || typeof opts.clientMaxWindowBits === "number" && !params.client_max_window_bits) {
            return false;
          }
          return true;
        });
        if (!accepted) {
          throw new Error("None of the extension offers can be accepted");
        }
        if (opts.serverNoContextTakeover) {
          accepted.server_no_context_takeover = true;
        }
        if (opts.clientNoContextTakeover) {
          accepted.client_no_context_takeover = true;
        }
        if (typeof opts.serverMaxWindowBits === "number") {
          accepted.server_max_window_bits = opts.serverMaxWindowBits;
        }
        if (typeof opts.clientMaxWindowBits === "number") {
          accepted.client_max_window_bits = opts.clientMaxWindowBits;
        } else if (accepted.client_max_window_bits === true || opts.clientMaxWindowBits === false) {
          delete accepted.client_max_window_bits;
        }
        return accepted;
      }
      /**
       * Accept the extension negotiation response.
       *
       * @param {Array} response The extension negotiation response
       * @return {Object} Accepted configuration
       * @private
       */
      acceptAsClient(response) {
        const params = response[0];
        if (this._options.clientNoContextTakeover === false && params.client_no_context_takeover) {
          throw new Error('Unexpected parameter "client_no_context_takeover"');
        }
        if (!params.client_max_window_bits) {
          if (typeof this._options.clientMaxWindowBits === "number") {
            params.client_max_window_bits = this._options.clientMaxWindowBits;
          }
        } else if (this._options.clientMaxWindowBits === false || typeof this._options.clientMaxWindowBits === "number" && params.client_max_window_bits > this._options.clientMaxWindowBits) {
          throw new Error(
            'Unexpected or invalid parameter "client_max_window_bits"'
          );
        }
        return params;
      }
      /**
       * Normalize parameters.
       *
       * @param {Array} configurations The extension negotiation offers/reponse
       * @return {Array} The offers/response with normalized parameters
       * @private
       */
      normalizeParams(configurations) {
        configurations.forEach((params) => {
          Object.keys(params).forEach((key) => {
            let value = params[key];
            if (value.length > 1) {
              throw new Error(`Parameter "${key}" must have only a single value`);
            }
            value = value[0];
            if (key === "client_max_window_bits") {
              if (value !== true) {
                const num = +value;
                if (!Number.isInteger(num) || num < 8 || num > 15) {
                  throw new TypeError(
                    `Invalid value for parameter "${key}": ${value}`
                  );
                }
                value = num;
              } else if (!this._isServer) {
                throw new TypeError(
                  `Invalid value for parameter "${key}": ${value}`
                );
              }
            } else if (key === "server_max_window_bits") {
              const num = +value;
              if (!Number.isInteger(num) || num < 8 || num > 15) {
                throw new TypeError(
                  `Invalid value for parameter "${key}": ${value}`
                );
              }
              value = num;
            } else if (key === "client_no_context_takeover" || key === "server_no_context_takeover") {
              if (value !== true) {
                throw new TypeError(
                  `Invalid value for parameter "${key}": ${value}`
                );
              }
            } else {
              throw new Error(`Unknown parameter "${key}"`);
            }
            params[key] = value;
          });
        });
        return configurations;
      }
      /**
       * Decompress data. Concurrency limited.
       *
       * @param {Buffer} data Compressed data
       * @param {Boolean} fin Specifies whether or not this is the last fragment
       * @param {Function} callback Callback
       * @public
       */
      decompress(data, fin, callback) {
        zlibLimiter.add((done) => {
          this._decompress(data, fin, (err, result) => {
            done();
            callback(err, result);
          });
        });
      }
      /**
       * Compress data. Concurrency limited.
       *
       * @param {(Buffer|String)} data Data to compress
       * @param {Boolean} fin Specifies whether or not this is the last fragment
       * @param {Function} callback Callback
       * @public
       */
      compress(data, fin, callback) {
        zlibLimiter.add((done) => {
          this._compress(data, fin, (err, result) => {
            done();
            callback(err, result);
          });
        });
      }
      /**
       * Decompress data.
       *
       * @param {Buffer} data Compressed data
       * @param {Boolean} fin Specifies whether or not this is the last fragment
       * @param {Function} callback Callback
       * @private
       */
      _decompress(data, fin, callback) {
        const endpoint = this._isServer ? "client" : "server";
        if (!this._inflate) {
          const key = `${endpoint}_max_window_bits`;
          const windowBits = typeof this.params[key] !== "number" ? zlib.Z_DEFAULT_WINDOWBITS : this.params[key];
          this._inflate = zlib.createInflateRaw({
            ...this._options.zlibInflateOptions,
            windowBits
          });
          this._inflate[kPerMessageDeflate] = this;
          this._inflate[kTotalLength] = 0;
          this._inflate[kBuffers] = [];
          this._inflate.on("error", inflateOnError);
          this._inflate.on("data", inflateOnData);
        }
        this._inflate[kCallback] = callback;
        this._inflate.write(data);
        if (fin) this._inflate.write(TRAILER);
        this._inflate.flush(() => {
          const err = this._inflate[kError];
          if (err) {
            this._inflate.close();
            this._inflate = null;
            callback(err);
            return;
          }
          const data2 = bufferUtil.concat(
            this._inflate[kBuffers],
            this._inflate[kTotalLength]
          );
          if (this._inflate._readableState.endEmitted) {
            this._inflate.close();
            this._inflate = null;
          } else {
            this._inflate[kTotalLength] = 0;
            this._inflate[kBuffers] = [];
            if (fin && this.params[`${endpoint}_no_context_takeover`]) {
              this._inflate.reset();
            }
          }
          callback(null, data2);
        });
      }
      /**
       * Compress data.
       *
       * @param {(Buffer|String)} data Data to compress
       * @param {Boolean} fin Specifies whether or not this is the last fragment
       * @param {Function} callback Callback
       * @private
       */
      _compress(data, fin, callback) {
        const endpoint = this._isServer ? "server" : "client";
        if (!this._deflate) {
          const key = `${endpoint}_max_window_bits`;
          const windowBits = typeof this.params[key] !== "number" ? zlib.Z_DEFAULT_WINDOWBITS : this.params[key];
          this._deflate = zlib.createDeflateRaw({
            ...this._options.zlibDeflateOptions,
            windowBits
          });
          this._deflate[kTotalLength] = 0;
          this._deflate[kBuffers] = [];
          this._deflate.on("data", deflateOnData);
        }
        this._deflate[kCallback] = callback;
        this._deflate.write(data);
        this._deflate.flush(zlib.Z_SYNC_FLUSH, () => {
          if (!this._deflate) {
            return;
          }
          let data2 = bufferUtil.concat(
            this._deflate[kBuffers],
            this._deflate[kTotalLength]
          );
          if (fin) {
            data2 = new FastBuffer(data2.buffer, data2.byteOffset, data2.length - 4);
          }
          this._deflate[kCallback] = null;
          this._deflate[kTotalLength] = 0;
          this._deflate[kBuffers] = [];
          if (fin && this.params[`${endpoint}_no_context_takeover`]) {
            this._deflate.reset();
          }
          callback(null, data2);
        });
      }
    };
    module2.exports = PerMessageDeflate;
    function deflateOnData(chunk) {
      this[kBuffers].push(chunk);
      this[kTotalLength] += chunk.length;
    }
    function inflateOnData(chunk) {
      this[kTotalLength] += chunk.length;
      if (this[kPerMessageDeflate]._maxPayload < 1 || this[kTotalLength] <= this[kPerMessageDeflate]._maxPayload) {
        this[kBuffers].push(chunk);
        return;
      }
      this[kError] = new RangeError("Max payload size exceeded");
      this[kError].code = "WS_ERR_UNSUPPORTED_MESSAGE_LENGTH";
      this[kError][kStatusCode] = 1009;
      this.removeListener("data", inflateOnData);
      this.reset();
    }
    function inflateOnError(err) {
      this[kPerMessageDeflate]._inflate = null;
      err[kStatusCode] = 1007;
      this[kCallback](err);
    }
  }
});

// node_modules/ws/lib/validation.js
var require_validation = __commonJS({
  "node_modules/ws/lib/validation.js"(exports2, module2) {
    "use strict";
    var { isUtf8 } = require("buffer");
    var tokenChars = [
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      // 0 - 15
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      // 16 - 31
      0,
      1,
      0,
      1,
      1,
      1,
      1,
      1,
      0,
      0,
      1,
      1,
      0,
      1,
      1,
      0,
      // 32 - 47
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      0,
      0,
      0,
      0,
      0,
      0,
      // 48 - 63
      0,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      // 64 - 79
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      0,
      0,
      0,
      1,
      1,
      // 80 - 95
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      // 96 - 111
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      0,
      1,
      0,
      1,
      0
      // 112 - 127
    ];
    function isValidStatusCode(code) {
      return code >= 1e3 && code <= 1014 && code !== 1004 && code !== 1005 && code !== 1006 || code >= 3e3 && code <= 4999;
    }
    function _isValidUTF8(buf) {
      const len = buf.length;
      let i = 0;
      while (i < len) {
        if ((buf[i] & 128) === 0) {
          i++;
        } else if ((buf[i] & 224) === 192) {
          if (i + 1 === len || (buf[i + 1] & 192) !== 128 || (buf[i] & 254) === 192) {
            return false;
          }
          i += 2;
        } else if ((buf[i] & 240) === 224) {
          if (i + 2 >= len || (buf[i + 1] & 192) !== 128 || (buf[i + 2] & 192) !== 128 || buf[i] === 224 && (buf[i + 1] & 224) === 128 || // Overlong
          buf[i] === 237 && (buf[i + 1] & 224) === 160) {
            return false;
          }
          i += 3;
        } else if ((buf[i] & 248) === 240) {
          if (i + 3 >= len || (buf[i + 1] & 192) !== 128 || (buf[i + 2] & 192) !== 128 || (buf[i + 3] & 192) !== 128 || buf[i] === 240 && (buf[i + 1] & 240) === 128 || // Overlong
          buf[i] === 244 && buf[i + 1] > 143 || buf[i] > 244) {
            return false;
          }
          i += 4;
        } else {
          return false;
        }
      }
      return true;
    }
    module2.exports = {
      isValidStatusCode,
      isValidUTF8: _isValidUTF8,
      tokenChars
    };
    if (isUtf8) {
      module2.exports.isValidUTF8 = function(buf) {
        return buf.length < 24 ? _isValidUTF8(buf) : isUtf8(buf);
      };
    } else if (!process.env.WS_NO_UTF_8_VALIDATE) {
      try {
        const isValidUTF8 = require("utf-8-validate");
        module2.exports.isValidUTF8 = function(buf) {
          return buf.length < 32 ? _isValidUTF8(buf) : isValidUTF8(buf);
        };
      } catch (e) {
      }
    }
  }
});

// node_modules/ws/lib/receiver.js
var require_receiver = __commonJS({
  "node_modules/ws/lib/receiver.js"(exports2, module2) {
    "use strict";
    var { Writable } = require("stream");
    var PerMessageDeflate = require_permessage_deflate();
    var {
      BINARY_TYPES,
      EMPTY_BUFFER,
      kStatusCode,
      kWebSocket
    } = require_constants5();
    var { concat, toArrayBuffer, unmask } = require_buffer_util();
    var { isValidStatusCode, isValidUTF8 } = require_validation();
    var FastBuffer = Buffer[Symbol.species];
    var GET_INFO = 0;
    var GET_PAYLOAD_LENGTH_16 = 1;
    var GET_PAYLOAD_LENGTH_64 = 2;
    var GET_MASK = 3;
    var GET_DATA = 4;
    var INFLATING = 5;
    var DEFER_EVENT = 6;
    var Receiver2 = class extends Writable {
      /**
       * Creates a Receiver instance.
       *
       * @param {Object} [options] Options object
       * @param {Boolean} [options.allowSynchronousEvents=true] Specifies whether
       *     any of the `'message'`, `'ping'`, and `'pong'` events can be emitted
       *     multiple times in the same tick
       * @param {String} [options.binaryType=nodebuffer] The type for binary data
       * @param {Object} [options.extensions] An object containing the negotiated
       *     extensions
       * @param {Boolean} [options.isServer=false] Specifies whether to operate in
       *     client or server mode
       * @param {Number} [options.maxPayload=0] The maximum allowed message length
       * @param {Boolean} [options.skipUTF8Validation=false] Specifies whether or
       *     not to skip UTF-8 validation for text and close messages
       */
      constructor(options2 = {}) {
        super();
        this._allowSynchronousEvents = options2.allowSynchronousEvents !== void 0 ? options2.allowSynchronousEvents : true;
        this._binaryType = options2.binaryType || BINARY_TYPES[0];
        this._extensions = options2.extensions || {};
        this._isServer = !!options2.isServer;
        this._maxPayload = options2.maxPayload | 0;
        this._skipUTF8Validation = !!options2.skipUTF8Validation;
        this[kWebSocket] = void 0;
        this._bufferedBytes = 0;
        this._buffers = [];
        this._compressed = false;
        this._payloadLength = 0;
        this._mask = void 0;
        this._fragmented = 0;
        this._masked = false;
        this._fin = false;
        this._opcode = 0;
        this._totalPayloadLength = 0;
        this._messageLength = 0;
        this._fragments = [];
        this._errored = false;
        this._loop = false;
        this._state = GET_INFO;
      }
      /**
       * Implements `Writable.prototype._write()`.
       *
       * @param {Buffer} chunk The chunk of data to write
       * @param {String} encoding The character encoding of `chunk`
       * @param {Function} cb Callback
       * @private
       */
      _write(chunk, encoding, cb) {
        if (this._opcode === 8 && this._state == GET_INFO) return cb();
        this._bufferedBytes += chunk.length;
        this._buffers.push(chunk);
        this.startLoop(cb);
      }
      /**
       * Consumes `n` bytes from the buffered data.
       *
       * @param {Number} n The number of bytes to consume
       * @return {Buffer} The consumed bytes
       * @private
       */
      consume(n) {
        this._bufferedBytes -= n;
        if (n === this._buffers[0].length) return this._buffers.shift();
        if (n < this._buffers[0].length) {
          const buf = this._buffers[0];
          this._buffers[0] = new FastBuffer(
            buf.buffer,
            buf.byteOffset + n,
            buf.length - n
          );
          return new FastBuffer(buf.buffer, buf.byteOffset, n);
        }
        const dst = Buffer.allocUnsafe(n);
        do {
          const buf = this._buffers[0];
          const offset = dst.length - n;
          if (n >= buf.length) {
            dst.set(this._buffers.shift(), offset);
          } else {
            dst.set(new Uint8Array(buf.buffer, buf.byteOffset, n), offset);
            this._buffers[0] = new FastBuffer(
              buf.buffer,
              buf.byteOffset + n,
              buf.length - n
            );
          }
          n -= buf.length;
        } while (n > 0);
        return dst;
      }
      /**
       * Starts the parsing loop.
       *
       * @param {Function} cb Callback
       * @private
       */
      startLoop(cb) {
        this._loop = true;
        do {
          switch (this._state) {
            case GET_INFO:
              this.getInfo(cb);
              break;
            case GET_PAYLOAD_LENGTH_16:
              this.getPayloadLength16(cb);
              break;
            case GET_PAYLOAD_LENGTH_64:
              this.getPayloadLength64(cb);
              break;
            case GET_MASK:
              this.getMask();
              break;
            case GET_DATA:
              this.getData(cb);
              break;
            case INFLATING:
            case DEFER_EVENT:
              this._loop = false;
              return;
          }
        } while (this._loop);
        if (!this._errored) cb();
      }
      /**
       * Reads the first two bytes of a frame.
       *
       * @param {Function} cb Callback
       * @private
       */
      getInfo(cb) {
        if (this._bufferedBytes < 2) {
          this._loop = false;
          return;
        }
        const buf = this.consume(2);
        if ((buf[0] & 48) !== 0) {
          const error48 = this.createError(
            RangeError,
            "RSV2 and RSV3 must be clear",
            true,
            1002,
            "WS_ERR_UNEXPECTED_RSV_2_3"
          );
          cb(error48);
          return;
        }
        const compressed = (buf[0] & 64) === 64;
        if (compressed && !this._extensions[PerMessageDeflate.extensionName]) {
          const error48 = this.createError(
            RangeError,
            "RSV1 must be clear",
            true,
            1002,
            "WS_ERR_UNEXPECTED_RSV_1"
          );
          cb(error48);
          return;
        }
        this._fin = (buf[0] & 128) === 128;
        this._opcode = buf[0] & 15;
        this._payloadLength = buf[1] & 127;
        if (this._opcode === 0) {
          if (compressed) {
            const error48 = this.createError(
              RangeError,
              "RSV1 must be clear",
              true,
              1002,
              "WS_ERR_UNEXPECTED_RSV_1"
            );
            cb(error48);
            return;
          }
          if (!this._fragmented) {
            const error48 = this.createError(
              RangeError,
              "invalid opcode 0",
              true,
              1002,
              "WS_ERR_INVALID_OPCODE"
            );
            cb(error48);
            return;
          }
          this._opcode = this._fragmented;
        } else if (this._opcode === 1 || this._opcode === 2) {
          if (this._fragmented) {
            const error48 = this.createError(
              RangeError,
              `invalid opcode ${this._opcode}`,
              true,
              1002,
              "WS_ERR_INVALID_OPCODE"
            );
            cb(error48);
            return;
          }
          this._compressed = compressed;
        } else if (this._opcode > 7 && this._opcode < 11) {
          if (!this._fin) {
            const error48 = this.createError(
              RangeError,
              "FIN must be set",
              true,
              1002,
              "WS_ERR_EXPECTED_FIN"
            );
            cb(error48);
            return;
          }
          if (compressed) {
            const error48 = this.createError(
              RangeError,
              "RSV1 must be clear",
              true,
              1002,
              "WS_ERR_UNEXPECTED_RSV_1"
            );
            cb(error48);
            return;
          }
          if (this._payloadLength > 125 || this._opcode === 8 && this._payloadLength === 1) {
            const error48 = this.createError(
              RangeError,
              `invalid payload length ${this._payloadLength}`,
              true,
              1002,
              "WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH"
            );
            cb(error48);
            return;
          }
        } else {
          const error48 = this.createError(
            RangeError,
            `invalid opcode ${this._opcode}`,
            true,
            1002,
            "WS_ERR_INVALID_OPCODE"
          );
          cb(error48);
          return;
        }
        if (!this._fin && !this._fragmented) this._fragmented = this._opcode;
        this._masked = (buf[1] & 128) === 128;
        if (this._isServer) {
          if (!this._masked) {
            const error48 = this.createError(
              RangeError,
              "MASK must be set",
              true,
              1002,
              "WS_ERR_EXPECTED_MASK"
            );
            cb(error48);
            return;
          }
        } else if (this._masked) {
          const error48 = this.createError(
            RangeError,
            "MASK must be clear",
            true,
            1002,
            "WS_ERR_UNEXPECTED_MASK"
          );
          cb(error48);
          return;
        }
        if (this._payloadLength === 126) this._state = GET_PAYLOAD_LENGTH_16;
        else if (this._payloadLength === 127) this._state = GET_PAYLOAD_LENGTH_64;
        else this.haveLength(cb);
      }
      /**
       * Gets extended payload length (7+16).
       *
       * @param {Function} cb Callback
       * @private
       */
      getPayloadLength16(cb) {
        if (this._bufferedBytes < 2) {
          this._loop = false;
          return;
        }
        this._payloadLength = this.consume(2).readUInt16BE(0);
        this.haveLength(cb);
      }
      /**
       * Gets extended payload length (7+64).
       *
       * @param {Function} cb Callback
       * @private
       */
      getPayloadLength64(cb) {
        if (this._bufferedBytes < 8) {
          this._loop = false;
          return;
        }
        const buf = this.consume(8);
        const num = buf.readUInt32BE(0);
        if (num > Math.pow(2, 53 - 32) - 1) {
          const error48 = this.createError(
            RangeError,
            "Unsupported WebSocket frame: payload length > 2^53 - 1",
            false,
            1009,
            "WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH"
          );
          cb(error48);
          return;
        }
        this._payloadLength = num * Math.pow(2, 32) + buf.readUInt32BE(4);
        this.haveLength(cb);
      }
      /**
       * Payload length has been read.
       *
       * @param {Function} cb Callback
       * @private
       */
      haveLength(cb) {
        if (this._payloadLength && this._opcode < 8) {
          this._totalPayloadLength += this._payloadLength;
          if (this._totalPayloadLength > this._maxPayload && this._maxPayload > 0) {
            const error48 = this.createError(
              RangeError,
              "Max payload size exceeded",
              false,
              1009,
              "WS_ERR_UNSUPPORTED_MESSAGE_LENGTH"
            );
            cb(error48);
            return;
          }
        }
        if (this._masked) this._state = GET_MASK;
        else this._state = GET_DATA;
      }
      /**
       * Reads mask bytes.
       *
       * @private
       */
      getMask() {
        if (this._bufferedBytes < 4) {
          this._loop = false;
          return;
        }
        this._mask = this.consume(4);
        this._state = GET_DATA;
      }
      /**
       * Reads data bytes.
       *
       * @param {Function} cb Callback
       * @private
       */
      getData(cb) {
        let data = EMPTY_BUFFER;
        if (this._payloadLength) {
          if (this._bufferedBytes < this._payloadLength) {
            this._loop = false;
            return;
          }
          data = this.consume(this._payloadLength);
          if (this._masked && (this._mask[0] | this._mask[1] | this._mask[2] | this._mask[3]) !== 0) {
            unmask(data, this._mask);
          }
        }
        if (this._opcode > 7) {
          this.controlMessage(data, cb);
          return;
        }
        if (this._compressed) {
          this._state = INFLATING;
          this.decompress(data, cb);
          return;
        }
        if (data.length) {
          this._messageLength = this._totalPayloadLength;
          this._fragments.push(data);
        }
        this.dataMessage(cb);
      }
      /**
       * Decompresses data.
       *
       * @param {Buffer} data Compressed data
       * @param {Function} cb Callback
       * @private
       */
      decompress(data, cb) {
        const perMessageDeflate = this._extensions[PerMessageDeflate.extensionName];
        perMessageDeflate.decompress(data, this._fin, (err, buf) => {
          if (err) return cb(err);
          if (buf.length) {
            this._messageLength += buf.length;
            if (this._messageLength > this._maxPayload && this._maxPayload > 0) {
              const error48 = this.createError(
                RangeError,
                "Max payload size exceeded",
                false,
                1009,
                "WS_ERR_UNSUPPORTED_MESSAGE_LENGTH"
              );
              cb(error48);
              return;
            }
            this._fragments.push(buf);
          }
          this.dataMessage(cb);
          if (this._state === GET_INFO) this.startLoop(cb);
        });
      }
      /**
       * Handles a data message.
       *
       * @param {Function} cb Callback
       * @private
       */
      dataMessage(cb) {
        if (!this._fin) {
          this._state = GET_INFO;
          return;
        }
        const messageLength = this._messageLength;
        const fragments = this._fragments;
        this._totalPayloadLength = 0;
        this._messageLength = 0;
        this._fragmented = 0;
        this._fragments = [];
        if (this._opcode === 2) {
          let data;
          if (this._binaryType === "nodebuffer") {
            data = concat(fragments, messageLength);
          } else if (this._binaryType === "arraybuffer") {
            data = toArrayBuffer(concat(fragments, messageLength));
          } else {
            data = fragments;
          }
          if (this._allowSynchronousEvents) {
            this.emit("message", data, true);
            this._state = GET_INFO;
          } else {
            this._state = DEFER_EVENT;
            setImmediate(() => {
              this.emit("message", data, true);
              this._state = GET_INFO;
              this.startLoop(cb);
            });
          }
        } else {
          const buf = concat(fragments, messageLength);
          if (!this._skipUTF8Validation && !isValidUTF8(buf)) {
            const error48 = this.createError(
              Error,
              "invalid UTF-8 sequence",
              true,
              1007,
              "WS_ERR_INVALID_UTF8"
            );
            cb(error48);
            return;
          }
          if (this._state === INFLATING || this._allowSynchronousEvents) {
            this.emit("message", buf, false);
            this._state = GET_INFO;
          } else {
            this._state = DEFER_EVENT;
            setImmediate(() => {
              this.emit("message", buf, false);
              this._state = GET_INFO;
              this.startLoop(cb);
            });
          }
        }
      }
      /**
       * Handles a control message.
       *
       * @param {Buffer} data Data to handle
       * @return {(Error|RangeError|undefined)} A possible error
       * @private
       */
      controlMessage(data, cb) {
        if (this._opcode === 8) {
          if (data.length === 0) {
            this._loop = false;
            this.emit("conclude", 1005, EMPTY_BUFFER);
            this.end();
          } else {
            const code = data.readUInt16BE(0);
            if (!isValidStatusCode(code)) {
              const error48 = this.createError(
                RangeError,
                `invalid status code ${code}`,
                true,
                1002,
                "WS_ERR_INVALID_CLOSE_CODE"
              );
              cb(error48);
              return;
            }
            const buf = new FastBuffer(
              data.buffer,
              data.byteOffset + 2,
              data.length - 2
            );
            if (!this._skipUTF8Validation && !isValidUTF8(buf)) {
              const error48 = this.createError(
                Error,
                "invalid UTF-8 sequence",
                true,
                1007,
                "WS_ERR_INVALID_UTF8"
              );
              cb(error48);
              return;
            }
            this._loop = false;
            this.emit("conclude", code, buf);
            this.end();
          }
          this._state = GET_INFO;
          return;
        }
        if (this._allowSynchronousEvents) {
          this.emit(this._opcode === 9 ? "ping" : "pong", data);
          this._state = GET_INFO;
        } else {
          this._state = DEFER_EVENT;
          setImmediate(() => {
            this.emit(this._opcode === 9 ? "ping" : "pong", data);
            this._state = GET_INFO;
            this.startLoop(cb);
          });
        }
      }
      /**
       * Builds an error object.
       *
       * @param {function(new:Error|RangeError)} ErrorCtor The error constructor
       * @param {String} message The error message
       * @param {Boolean} prefix Specifies whether or not to add a default prefix to
       *     `message`
       * @param {Number} statusCode The status code
       * @param {String} errorCode The exposed error code
       * @return {(Error|RangeError)} The error
       * @private
       */
      createError(ErrorCtor, message, prefix, statusCode, errorCode) {
        this._loop = false;
        this._errored = true;
        const err = new ErrorCtor(
          prefix ? `Invalid WebSocket frame: ${message}` : message
        );
        Error.captureStackTrace(err, this.createError);
        err.code = errorCode;
        err[kStatusCode] = statusCode;
        return err;
      }
    };
    module2.exports = Receiver2;
  }
});

// node_modules/ws/lib/sender.js
var require_sender = __commonJS({
  "node_modules/ws/lib/sender.js"(exports2, module2) {
    "use strict";
    var { Duplex } = require("stream");
    var { randomFillSync } = require("crypto");
    var PerMessageDeflate = require_permessage_deflate();
    var { EMPTY_BUFFER } = require_constants5();
    var { isValidStatusCode } = require_validation();
    var { mask: applyMask, toBuffer } = require_buffer_util();
    var kByteLength = Symbol("kByteLength");
    var maskBuffer = Buffer.alloc(4);
    var RANDOM_POOL_SIZE = 8 * 1024;
    var randomPool;
    var randomPoolPointer = RANDOM_POOL_SIZE;
    var Sender2 = class _Sender {
      /**
       * Creates a Sender instance.
       *
       * @param {Duplex} socket The connection socket
       * @param {Object} [extensions] An object containing the negotiated extensions
       * @param {Function} [generateMask] The function used to generate the masking
       *     key
       */
      constructor(socket, extensions, generateMask) {
        this._extensions = extensions || {};
        if (generateMask) {
          this._generateMask = generateMask;
          this._maskBuffer = Buffer.alloc(4);
        }
        this._socket = socket;
        this._firstFragment = true;
        this._compress = false;
        this._bufferedBytes = 0;
        this._deflating = false;
        this._queue = [];
      }
      /**
       * Frames a piece of data according to the HyBi WebSocket protocol.
       *
       * @param {(Buffer|String)} data The data to frame
       * @param {Object} options Options object
       * @param {Boolean} [options.fin=false] Specifies whether or not to set the
       *     FIN bit
       * @param {Function} [options.generateMask] The function used to generate the
       *     masking key
       * @param {Boolean} [options.mask=false] Specifies whether or not to mask
       *     `data`
       * @param {Buffer} [options.maskBuffer] The buffer used to store the masking
       *     key
       * @param {Number} options.opcode The opcode
       * @param {Boolean} [options.readOnly=false] Specifies whether `data` can be
       *     modified
       * @param {Boolean} [options.rsv1=false] Specifies whether or not to set the
       *     RSV1 bit
       * @return {(Buffer|String)[]} The framed data
       * @public
       */
      static frame(data, options2) {
        let mask;
        let merge2 = false;
        let offset = 2;
        let skipMasking = false;
        if (options2.mask) {
          mask = options2.maskBuffer || maskBuffer;
          if (options2.generateMask) {
            options2.generateMask(mask);
          } else {
            if (randomPoolPointer === RANDOM_POOL_SIZE) {
              if (randomPool === void 0) {
                randomPool = Buffer.alloc(RANDOM_POOL_SIZE);
              }
              randomFillSync(randomPool, 0, RANDOM_POOL_SIZE);
              randomPoolPointer = 0;
            }
            mask[0] = randomPool[randomPoolPointer++];
            mask[1] = randomPool[randomPoolPointer++];
            mask[2] = randomPool[randomPoolPointer++];
            mask[3] = randomPool[randomPoolPointer++];
          }
          skipMasking = (mask[0] | mask[1] | mask[2] | mask[3]) === 0;
          offset = 6;
        }
        let dataLength;
        if (typeof data === "string") {
          if ((!options2.mask || skipMasking) && options2[kByteLength] !== void 0) {
            dataLength = options2[kByteLength];
          } else {
            data = Buffer.from(data);
            dataLength = data.length;
          }
        } else {
          dataLength = data.length;
          merge2 = options2.mask && options2.readOnly && !skipMasking;
        }
        let payloadLength = dataLength;
        if (dataLength >= 65536) {
          offset += 8;
          payloadLength = 127;
        } else if (dataLength > 125) {
          offset += 2;
          payloadLength = 126;
        }
        const target = Buffer.allocUnsafe(merge2 ? dataLength + offset : offset);
        target[0] = options2.fin ? options2.opcode | 128 : options2.opcode;
        if (options2.rsv1) target[0] |= 64;
        target[1] = payloadLength;
        if (payloadLength === 126) {
          target.writeUInt16BE(dataLength, 2);
        } else if (payloadLength === 127) {
          target[2] = target[3] = 0;
          target.writeUIntBE(dataLength, 4, 6);
        }
        if (!options2.mask) return [target, data];
        target[1] |= 128;
        target[offset - 4] = mask[0];
        target[offset - 3] = mask[1];
        target[offset - 2] = mask[2];
        target[offset - 1] = mask[3];
        if (skipMasking) return [target, data];
        if (merge2) {
          applyMask(data, mask, target, offset, dataLength);
          return [target];
        }
        applyMask(data, mask, data, 0, dataLength);
        return [target, data];
      }
      /**
       * Sends a close message to the other peer.
       *
       * @param {Number} [code] The status code component of the body
       * @param {(String|Buffer)} [data] The message component of the body
       * @param {Boolean} [mask=false] Specifies whether or not to mask the message
       * @param {Function} [cb] Callback
       * @public
       */
      close(code, data, mask, cb) {
        let buf;
        if (code === void 0) {
          buf = EMPTY_BUFFER;
        } else if (typeof code !== "number" || !isValidStatusCode(code)) {
          throw new TypeError("First argument must be a valid error code number");
        } else if (data === void 0 || !data.length) {
          buf = Buffer.allocUnsafe(2);
          buf.writeUInt16BE(code, 0);
        } else {
          const length = Buffer.byteLength(data);
          if (length > 123) {
            throw new RangeError("The message must not be greater than 123 bytes");
          }
          buf = Buffer.allocUnsafe(2 + length);
          buf.writeUInt16BE(code, 0);
          if (typeof data === "string") {
            buf.write(data, 2);
          } else {
            buf.set(data, 2);
          }
        }
        const options2 = {
          [kByteLength]: buf.length,
          fin: true,
          generateMask: this._generateMask,
          mask,
          maskBuffer: this._maskBuffer,
          opcode: 8,
          readOnly: false,
          rsv1: false
        };
        if (this._deflating) {
          this.enqueue([this.dispatch, buf, false, options2, cb]);
        } else {
          this.sendFrame(_Sender.frame(buf, options2), cb);
        }
      }
      /**
       * Sends a ping message to the other peer.
       *
       * @param {*} data The message to send
       * @param {Boolean} [mask=false] Specifies whether or not to mask `data`
       * @param {Function} [cb] Callback
       * @public
       */
      ping(data, mask, cb) {
        let byteLength;
        let readOnly;
        if (typeof data === "string") {
          byteLength = Buffer.byteLength(data);
          readOnly = false;
        } else {
          data = toBuffer(data);
          byteLength = data.length;
          readOnly = toBuffer.readOnly;
        }
        if (byteLength > 125) {
          throw new RangeError("The data size must not be greater than 125 bytes");
        }
        const options2 = {
          [kByteLength]: byteLength,
          fin: true,
          generateMask: this._generateMask,
          mask,
          maskBuffer: this._maskBuffer,
          opcode: 9,
          readOnly,
          rsv1: false
        };
        if (this._deflating) {
          this.enqueue([this.dispatch, data, false, options2, cb]);
        } else {
          this.sendFrame(_Sender.frame(data, options2), cb);
        }
      }
      /**
       * Sends a pong message to the other peer.
       *
       * @param {*} data The message to send
       * @param {Boolean} [mask=false] Specifies whether or not to mask `data`
       * @param {Function} [cb] Callback
       * @public
       */
      pong(data, mask, cb) {
        let byteLength;
        let readOnly;
        if (typeof data === "string") {
          byteLength = Buffer.byteLength(data);
          readOnly = false;
        } else {
          data = toBuffer(data);
          byteLength = data.length;
          readOnly = toBuffer.readOnly;
        }
        if (byteLength > 125) {
          throw new RangeError("The data size must not be greater than 125 bytes");
        }
        const options2 = {
          [kByteLength]: byteLength,
          fin: true,
          generateMask: this._generateMask,
          mask,
          maskBuffer: this._maskBuffer,
          opcode: 10,
          readOnly,
          rsv1: false
        };
        if (this._deflating) {
          this.enqueue([this.dispatch, data, false, options2, cb]);
        } else {
          this.sendFrame(_Sender.frame(data, options2), cb);
        }
      }
      /**
       * Sends a data message to the other peer.
       *
       * @param {*} data The message to send
       * @param {Object} options Options object
       * @param {Boolean} [options.binary=false] Specifies whether `data` is binary
       *     or text
       * @param {Boolean} [options.compress=false] Specifies whether or not to
       *     compress `data`
       * @param {Boolean} [options.fin=false] Specifies whether the fragment is the
       *     last one
       * @param {Boolean} [options.mask=false] Specifies whether or not to mask
       *     `data`
       * @param {Function} [cb] Callback
       * @public
       */
      send(data, options2, cb) {
        const perMessageDeflate = this._extensions[PerMessageDeflate.extensionName];
        let opcode = options2.binary ? 2 : 1;
        let rsv1 = options2.compress;
        let byteLength;
        let readOnly;
        if (typeof data === "string") {
          byteLength = Buffer.byteLength(data);
          readOnly = false;
        } else {
          data = toBuffer(data);
          byteLength = data.length;
          readOnly = toBuffer.readOnly;
        }
        if (this._firstFragment) {
          this._firstFragment = false;
          if (rsv1 && perMessageDeflate && perMessageDeflate.params[perMessageDeflate._isServer ? "server_no_context_takeover" : "client_no_context_takeover"]) {
            rsv1 = byteLength >= perMessageDeflate._threshold;
          }
          this._compress = rsv1;
        } else {
          rsv1 = false;
          opcode = 0;
        }
        if (options2.fin) this._firstFragment = true;
        if (perMessageDeflate) {
          const opts = {
            [kByteLength]: byteLength,
            fin: options2.fin,
            generateMask: this._generateMask,
            mask: options2.mask,
            maskBuffer: this._maskBuffer,
            opcode,
            readOnly,
            rsv1
          };
          if (this._deflating) {
            this.enqueue([this.dispatch, data, this._compress, opts, cb]);
          } else {
            this.dispatch(data, this._compress, opts, cb);
          }
        } else {
          this.sendFrame(
            _Sender.frame(data, {
              [kByteLength]: byteLength,
              fin: options2.fin,
              generateMask: this._generateMask,
              mask: options2.mask,
              maskBuffer: this._maskBuffer,
              opcode,
              readOnly,
              rsv1: false
            }),
            cb
          );
        }
      }
      /**
       * Dispatches a message.
       *
       * @param {(Buffer|String)} data The message to send
       * @param {Boolean} [compress=false] Specifies whether or not to compress
       *     `data`
       * @param {Object} options Options object
       * @param {Boolean} [options.fin=false] Specifies whether or not to set the
       *     FIN bit
       * @param {Function} [options.generateMask] The function used to generate the
       *     masking key
       * @param {Boolean} [options.mask=false] Specifies whether or not to mask
       *     `data`
       * @param {Buffer} [options.maskBuffer] The buffer used to store the masking
       *     key
       * @param {Number} options.opcode The opcode
       * @param {Boolean} [options.readOnly=false] Specifies whether `data` can be
       *     modified
       * @param {Boolean} [options.rsv1=false] Specifies whether or not to set the
       *     RSV1 bit
       * @param {Function} [cb] Callback
       * @private
       */
      dispatch(data, compress, options2, cb) {
        if (!compress) {
          this.sendFrame(_Sender.frame(data, options2), cb);
          return;
        }
        const perMessageDeflate = this._extensions[PerMessageDeflate.extensionName];
        this._bufferedBytes += options2[kByteLength];
        this._deflating = true;
        perMessageDeflate.compress(data, options2.fin, (_, buf) => {
          if (this._socket.destroyed) {
            const err = new Error(
              "The socket was closed while data was being compressed"
            );
            if (typeof cb === "function") cb(err);
            for (let i = 0; i < this._queue.length; i++) {
              const params = this._queue[i];
              const callback = params[params.length - 1];
              if (typeof callback === "function") callback(err);
            }
            return;
          }
          this._bufferedBytes -= options2[kByteLength];
          this._deflating = false;
          options2.readOnly = false;
          this.sendFrame(_Sender.frame(buf, options2), cb);
          this.dequeue();
        });
      }
      /**
       * Executes queued send operations.
       *
       * @private
       */
      dequeue() {
        while (!this._deflating && this._queue.length) {
          const params = this._queue.shift();
          this._bufferedBytes -= params[3][kByteLength];
          Reflect.apply(params[0], this, params.slice(1));
        }
      }
      /**
       * Enqueues a send operation.
       *
       * @param {Array} params Send operation parameters.
       * @private
       */
      enqueue(params) {
        this._bufferedBytes += params[3][kByteLength];
        this._queue.push(params);
      }
      /**
       * Sends a frame.
       *
       * @param {Buffer[]} list The frame to send
       * @param {Function} [cb] Callback
       * @private
       */
      sendFrame(list, cb) {
        if (list.length === 2) {
          this._socket.cork();
          this._socket.write(list[0]);
          this._socket.write(list[1], cb);
          this._socket.uncork();
        } else {
          this._socket.write(list[0], cb);
        }
      }
    };
    module2.exports = Sender2;
  }
});

// node_modules/ws/lib/event-target.js
var require_event_target = __commonJS({
  "node_modules/ws/lib/event-target.js"(exports2, module2) {
    "use strict";
    var { kForOnEventAttribute, kListener } = require_constants5();
    var kCode = Symbol("kCode");
    var kData = Symbol("kData");
    var kError = Symbol("kError");
    var kMessage = Symbol("kMessage");
    var kReason = Symbol("kReason");
    var kTarget = Symbol("kTarget");
    var kType = Symbol("kType");
    var kWasClean = Symbol("kWasClean");
    var Event2 = class {
      /**
       * Create a new `Event`.
       *
       * @param {String} type The name of the event
       * @throws {TypeError} If the `type` argument is not specified
       */
      constructor(type) {
        this[kTarget] = null;
        this[kType] = type;
      }
      /**
       * @type {*}
       */
      get target() {
        return this[kTarget];
      }
      /**
       * @type {String}
       */
      get type() {
        return this[kType];
      }
    };
    Object.defineProperty(Event2.prototype, "target", { enumerable: true });
    Object.defineProperty(Event2.prototype, "type", { enumerable: true });
    var CloseEvent = class extends Event2 {
      /**
       * Create a new `CloseEvent`.
       *
       * @param {String} type The name of the event
       * @param {Object} [options] A dictionary object that allows for setting
       *     attributes via object members of the same name
       * @param {Number} [options.code=0] The status code explaining why the
       *     connection was closed
       * @param {String} [options.reason=''] A human-readable string explaining why
       *     the connection was closed
       * @param {Boolean} [options.wasClean=false] Indicates whether or not the
       *     connection was cleanly closed
       */
      constructor(type, options2 = {}) {
        super(type);
        this[kCode] = options2.code === void 0 ? 0 : options2.code;
        this[kReason] = options2.reason === void 0 ? "" : options2.reason;
        this[kWasClean] = options2.wasClean === void 0 ? false : options2.wasClean;
      }
      /**
       * @type {Number}
       */
      get code() {
        return this[kCode];
      }
      /**
       * @type {String}
       */
      get reason() {
        return this[kReason];
      }
      /**
       * @type {Boolean}
       */
      get wasClean() {
        return this[kWasClean];
      }
    };
    Object.defineProperty(CloseEvent.prototype, "code", { enumerable: true });
    Object.defineProperty(CloseEvent.prototype, "reason", { enumerable: true });
    Object.defineProperty(CloseEvent.prototype, "wasClean", { enumerable: true });
    var ErrorEvent2 = class extends Event2 {
      /**
       * Create a new `ErrorEvent`.
       *
       * @param {String} type The name of the event
       * @param {Object} [options] A dictionary object that allows for setting
       *     attributes via object members of the same name
       * @param {*} [options.error=null] The error that generated this event
       * @param {String} [options.message=''] The error message
       */
      constructor(type, options2 = {}) {
        super(type);
        this[kError] = options2.error === void 0 ? null : options2.error;
        this[kMessage] = options2.message === void 0 ? "" : options2.message;
      }
      /**
       * @type {*}
       */
      get error() {
        return this[kError];
      }
      /**
       * @type {String}
       */
      get message() {
        return this[kMessage];
      }
    };
    Object.defineProperty(ErrorEvent2.prototype, "error", { enumerable: true });
    Object.defineProperty(ErrorEvent2.prototype, "message", { enumerable: true });
    var MessageEvent2 = class extends Event2 {
      /**
       * Create a new `MessageEvent`.
       *
       * @param {String} type The name of the event
       * @param {Object} [options] A dictionary object that allows for setting
       *     attributes via object members of the same name
       * @param {*} [options.data=null] The message content
       */
      constructor(type, options2 = {}) {
        super(type);
        this[kData] = options2.data === void 0 ? null : options2.data;
      }
      /**
       * @type {*}
       */
      get data() {
        return this[kData];
      }
    };
    Object.defineProperty(MessageEvent2.prototype, "data", { enumerable: true });
    var EventTarget2 = {
      /**
       * Register an event listener.
       *
       * @param {String} type A string representing the event type to listen for
       * @param {(Function|Object)} handler The listener to add
       * @param {Object} [options] An options object specifies characteristics about
       *     the event listener
       * @param {Boolean} [options.once=false] A `Boolean` indicating that the
       *     listener should be invoked at most once after being added. If `true`,
       *     the listener would be automatically removed when invoked.
       * @public
       */
      addEventListener(type, handler, options2 = {}) {
        for (const listener of this.listeners(type)) {
          if (!options2[kForOnEventAttribute] && listener[kListener] === handler && !listener[kForOnEventAttribute]) {
            return;
          }
        }
        let wrapper;
        if (type === "message") {
          wrapper = function onMessage(data, isBinary) {
            const event = new MessageEvent2("message", {
              data: isBinary ? data : data.toString()
            });
            event[kTarget] = this;
            callListener(handler, this, event);
          };
        } else if (type === "close") {
          wrapper = function onClose(code, message) {
            const event = new CloseEvent("close", {
              code,
              reason: message.toString(),
              wasClean: this._closeFrameReceived && this._closeFrameSent
            });
            event[kTarget] = this;
            callListener(handler, this, event);
          };
        } else if (type === "error") {
          wrapper = function onError(error48) {
            const event = new ErrorEvent2("error", {
              error: error48,
              message: error48.message
            });
            event[kTarget] = this;
            callListener(handler, this, event);
          };
        } else if (type === "open") {
          wrapper = function onOpen() {
            const event = new Event2("open");
            event[kTarget] = this;
            callListener(handler, this, event);
          };
        } else {
          return;
        }
        wrapper[kForOnEventAttribute] = !!options2[kForOnEventAttribute];
        wrapper[kListener] = handler;
        if (options2.once) {
          this.once(type, wrapper);
        } else {
          this.on(type, wrapper);
        }
      },
      /**
       * Remove an event listener.
       *
       * @param {String} type A string representing the event type to remove
       * @param {(Function|Object)} handler The listener to remove
       * @public
       */
      removeEventListener(type, handler) {
        for (const listener of this.listeners(type)) {
          if (listener[kListener] === handler && !listener[kForOnEventAttribute]) {
            this.removeListener(type, listener);
            break;
          }
        }
      }
    };
    module2.exports = {
      CloseEvent,
      ErrorEvent: ErrorEvent2,
      Event: Event2,
      EventTarget: EventTarget2,
      MessageEvent: MessageEvent2
    };
    function callListener(listener, thisArg, event) {
      if (typeof listener === "object" && listener.handleEvent) {
        listener.handleEvent.call(listener, event);
      } else {
        listener.call(thisArg, event);
      }
    }
  }
});

// node_modules/ws/lib/extension.js
var require_extension = __commonJS({
  "node_modules/ws/lib/extension.js"(exports2, module2) {
    "use strict";
    var { tokenChars } = require_validation();
    function push(dest, name, elem) {
      if (dest[name] === void 0) dest[name] = [elem];
      else dest[name].push(elem);
    }
    function parse3(header) {
      const offers = /* @__PURE__ */ Object.create(null);
      let params = /* @__PURE__ */ Object.create(null);
      let mustUnescape = false;
      let isEscaping = false;
      let inQuotes = false;
      let extensionName;
      let paramName;
      let start = -1;
      let code = -1;
      let end = -1;
      let i = 0;
      for (; i < header.length; i++) {
        code = header.charCodeAt(i);
        if (extensionName === void 0) {
          if (end === -1 && tokenChars[code] === 1) {
            if (start === -1) start = i;
          } else if (i !== 0 && (code === 32 || code === 9)) {
            if (end === -1 && start !== -1) end = i;
          } else if (code === 59 || code === 44) {
            if (start === -1) {
              throw new SyntaxError(`Unexpected character at index ${i}`);
            }
            if (end === -1) end = i;
            const name = header.slice(start, end);
            if (code === 44) {
              push(offers, name, params);
              params = /* @__PURE__ */ Object.create(null);
            } else {
              extensionName = name;
            }
            start = end = -1;
          } else {
            throw new SyntaxError(`Unexpected character at index ${i}`);
          }
        } else if (paramName === void 0) {
          if (end === -1 && tokenChars[code] === 1) {
            if (start === -1) start = i;
          } else if (code === 32 || code === 9) {
            if (end === -1 && start !== -1) end = i;
          } else if (code === 59 || code === 44) {
            if (start === -1) {
              throw new SyntaxError(`Unexpected character at index ${i}`);
            }
            if (end === -1) end = i;
            push(params, header.slice(start, end), true);
            if (code === 44) {
              push(offers, extensionName, params);
              params = /* @__PURE__ */ Object.create(null);
              extensionName = void 0;
            }
            start = end = -1;
          } else if (code === 61 && start !== -1 && end === -1) {
            paramName = header.slice(start, i);
            start = end = -1;
          } else {
            throw new SyntaxError(`Unexpected character at index ${i}`);
          }
        } else {
          if (isEscaping) {
            if (tokenChars[code] !== 1) {
              throw new SyntaxError(`Unexpected character at index ${i}`);
            }
            if (start === -1) start = i;
            else if (!mustUnescape) mustUnescape = true;
            isEscaping = false;
          } else if (inQuotes) {
            if (tokenChars[code] === 1) {
              if (start === -1) start = i;
            } else if (code === 34 && start !== -1) {
              inQuotes = false;
              end = i;
            } else if (code === 92) {
              isEscaping = true;
            } else {
              throw new SyntaxError(`Unexpected character at index ${i}`);
            }
          } else if (code === 34 && header.charCodeAt(i - 1) === 61) {
            inQuotes = true;
          } else if (end === -1 && tokenChars[code] === 1) {
            if (start === -1) start = i;
          } else if (start !== -1 && (code === 32 || code === 9)) {
            if (end === -1) end = i;
          } else if (code === 59 || code === 44) {
            if (start === -1) {
              throw new SyntaxError(`Unexpected character at index ${i}`);
            }
            if (end === -1) end = i;
            let value = header.slice(start, end);
            if (mustUnescape) {
              value = value.replace(/\\/g, "");
              mustUnescape = false;
            }
            push(params, paramName, value);
            if (code === 44) {
              push(offers, extensionName, params);
              params = /* @__PURE__ */ Object.create(null);
              extensionName = void 0;
            }
            paramName = void 0;
            start = end = -1;
          } else {
            throw new SyntaxError(`Unexpected character at index ${i}`);
          }
        }
      }
      if (start === -1 || inQuotes || code === 32 || code === 9) {
        throw new SyntaxError("Unexpected end of input");
      }
      if (end === -1) end = i;
      const token = header.slice(start, end);
      if (extensionName === void 0) {
        push(offers, token, params);
      } else {
        if (paramName === void 0) {
          push(params, token, true);
        } else if (mustUnescape) {
          push(params, paramName, token.replace(/\\/g, ""));
        } else {
          push(params, paramName, token);
        }
        push(offers, extensionName, params);
      }
      return offers;
    }
    function format(extensions) {
      return Object.keys(extensions).map((extension) => {
        let configurations = extensions[extension];
        if (!Array.isArray(configurations)) configurations = [configurations];
        return configurations.map((params) => {
          return [extension].concat(
            Object.keys(params).map((k) => {
              let values = params[k];
              if (!Array.isArray(values)) values = [values];
              return values.map((v) => v === true ? k : `${k}=${v}`).join("; ");
            })
          ).join("; ");
        }).join(", ");
      }).join(", ");
    }
    module2.exports = { format, parse: parse3 };
  }
});

// node_modules/ws/lib/websocket.js
var require_websocket = __commonJS({
  "node_modules/ws/lib/websocket.js"(exports2, module2) {
    "use strict";
    var EventEmitter = require("events");
    var https = require("https");
    var http = require("http");
    var net = require("net");
    var tls = require("tls");
    var { randomBytes, createHash } = require("crypto");
    var { Duplex, Readable: Readable2 } = require("stream");
    var { URL: URL3 } = require("url");
    var PerMessageDeflate = require_permessage_deflate();
    var Receiver2 = require_receiver();
    var Sender2 = require_sender();
    var {
      BINARY_TYPES,
      EMPTY_BUFFER,
      GUID,
      kForOnEventAttribute,
      kListener,
      kStatusCode,
      kWebSocket,
      NOOP
    } = require_constants5();
    var {
      EventTarget: { addEventListener, removeEventListener }
    } = require_event_target();
    var { format, parse: parse3 } = require_extension();
    var { toBuffer } = require_buffer_util();
    var closeTimeout = 30 * 1e3;
    var kAborted = Symbol("kAborted");
    var protocolVersions = [8, 13];
    var readyStates = ["CONNECTING", "OPEN", "CLOSING", "CLOSED"];
    var subprotocolRegex = /^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/;
    var WebSocket2 = class _WebSocket extends EventEmitter {
      /**
       * Create a new `WebSocket`.
       *
       * @param {(String|URL)} address The URL to which to connect
       * @param {(String|String[])} [protocols] The subprotocols
       * @param {Object} [options] Connection options
       */
      constructor(address, protocols, options2) {
        super();
        this._binaryType = BINARY_TYPES[0];
        this._closeCode = 1006;
        this._closeFrameReceived = false;
        this._closeFrameSent = false;
        this._closeMessage = EMPTY_BUFFER;
        this._closeTimer = null;
        this._extensions = {};
        this._paused = false;
        this._protocol = "";
        this._readyState = _WebSocket.CONNECTING;
        this._receiver = null;
        this._sender = null;
        this._socket = null;
        if (address !== null) {
          this._bufferedAmount = 0;
          this._isServer = false;
          this._redirects = 0;
          if (protocols === void 0) {
            protocols = [];
          } else if (!Array.isArray(protocols)) {
            if (typeof protocols === "object" && protocols !== null) {
              options2 = protocols;
              protocols = [];
            } else {
              protocols = [protocols];
            }
          }
          initAsClient(this, address, protocols, options2);
        } else {
          this._autoPong = options2.autoPong;
          this._isServer = true;
        }
      }
      /**
       * This deviates from the WHATWG interface since ws doesn't support the
       * required default "blob" type (instead we define a custom "nodebuffer"
       * type).
       *
       * @type {String}
       */
      get binaryType() {
        return this._binaryType;
      }
      set binaryType(type) {
        if (!BINARY_TYPES.includes(type)) return;
        this._binaryType = type;
        if (this._receiver) this._receiver._binaryType = type;
      }
      /**
       * @type {Number}
       */
      get bufferedAmount() {
        if (!this._socket) return this._bufferedAmount;
        return this._socket._writableState.length + this._sender._bufferedBytes;
      }
      /**
       * @type {String}
       */
      get extensions() {
        return Object.keys(this._extensions).join();
      }
      /**
       * @type {Boolean}
       */
      get isPaused() {
        return this._paused;
      }
      /**
       * @type {Function}
       */
      /* istanbul ignore next */
      get onclose() {
        return null;
      }
      /**
       * @type {Function}
       */
      /* istanbul ignore next */
      get onerror() {
        return null;
      }
      /**
       * @type {Function}
       */
      /* istanbul ignore next */
      get onopen() {
        return null;
      }
      /**
       * @type {Function}
       */
      /* istanbul ignore next */
      get onmessage() {
        return null;
      }
      /**
       * @type {String}
       */
      get protocol() {
        return this._protocol;
      }
      /**
       * @type {Number}
       */
      get readyState() {
        return this._readyState;
      }
      /**
       * @type {String}
       */
      get url() {
        return this._url;
      }
      /**
       * Set up the socket and the internal resources.
       *
       * @param {Duplex} socket The network socket between the server and client
       * @param {Buffer} head The first packet of the upgraded stream
       * @param {Object} options Options object
       * @param {Boolean} [options.allowSynchronousEvents=false] Specifies whether
       *     any of the `'message'`, `'ping'`, and `'pong'` events can be emitted
       *     multiple times in the same tick
       * @param {Function} [options.generateMask] The function used to generate the
       *     masking key
       * @param {Number} [options.maxPayload=0] The maximum allowed message size
       * @param {Boolean} [options.skipUTF8Validation=false] Specifies whether or
       *     not to skip UTF-8 validation for text and close messages
       * @private
       */
      setSocket(socket, head, options2) {
        const receiver = new Receiver2({
          allowSynchronousEvents: options2.allowSynchronousEvents,
          binaryType: this.binaryType,
          extensions: this._extensions,
          isServer: this._isServer,
          maxPayload: options2.maxPayload,
          skipUTF8Validation: options2.skipUTF8Validation
        });
        this._sender = new Sender2(socket, this._extensions, options2.generateMask);
        this._receiver = receiver;
        this._socket = socket;
        receiver[kWebSocket] = this;
        socket[kWebSocket] = this;
        receiver.on("conclude", receiverOnConclude);
        receiver.on("drain", receiverOnDrain);
        receiver.on("error", receiverOnError);
        receiver.on("message", receiverOnMessage);
        receiver.on("ping", receiverOnPing);
        receiver.on("pong", receiverOnPong);
        if (socket.setTimeout) socket.setTimeout(0);
        if (socket.setNoDelay) socket.setNoDelay();
        if (head.length > 0) socket.unshift(head);
        socket.on("close", socketOnClose);
        socket.on("data", socketOnData);
        socket.on("end", socketOnEnd);
        socket.on("error", socketOnError);
        this._readyState = _WebSocket.OPEN;
        this.emit("open");
      }
      /**
       * Emit the `'close'` event.
       *
       * @private
       */
      emitClose() {
        if (!this._socket) {
          this._readyState = _WebSocket.CLOSED;
          this.emit("close", this._closeCode, this._closeMessage);
          return;
        }
        if (this._extensions[PerMessageDeflate.extensionName]) {
          this._extensions[PerMessageDeflate.extensionName].cleanup();
        }
        this._receiver.removeAllListeners();
        this._readyState = _WebSocket.CLOSED;
        this.emit("close", this._closeCode, this._closeMessage);
      }
      /**
       * Start a closing handshake.
       *
       *          +----------+   +-----------+   +----------+
       *     - - -|ws.close()|-->|close frame|-->|ws.close()|- - -
       *    |     +----------+   +-----------+   +----------+     |
       *          +----------+   +-----------+         |
       * CLOSING  |ws.close()|<--|close frame|<--+-----+       CLOSING
       *          +----------+   +-----------+   |
       *    |           |                        |   +---+        |
       *                +------------------------+-->|fin| - - - -
       *    |         +---+                      |   +---+
       *     - - - - -|fin|<---------------------+
       *              +---+
       *
       * @param {Number} [code] Status code explaining why the connection is closing
       * @param {(String|Buffer)} [data] The reason why the connection is
       *     closing
       * @public
       */
      close(code, data) {
        if (this.readyState === _WebSocket.CLOSED) return;
        if (this.readyState === _WebSocket.CONNECTING) {
          const msg = "WebSocket was closed before the connection was established";
          abortHandshake(this, this._req, msg);
          return;
        }
        if (this.readyState === _WebSocket.CLOSING) {
          if (this._closeFrameSent && (this._closeFrameReceived || this._receiver._writableState.errorEmitted)) {
            this._socket.end();
          }
          return;
        }
        this._readyState = _WebSocket.CLOSING;
        this._sender.close(code, data, !this._isServer, (err) => {
          if (err) return;
          this._closeFrameSent = true;
          if (this._closeFrameReceived || this._receiver._writableState.errorEmitted) {
            this._socket.end();
          }
        });
        this._closeTimer = setTimeout(
          this._socket.destroy.bind(this._socket),
          closeTimeout
        );
      }
      /**
       * Pause the socket.
       *
       * @public
       */
      pause() {
        if (this.readyState === _WebSocket.CONNECTING || this.readyState === _WebSocket.CLOSED) {
          return;
        }
        this._paused = true;
        this._socket.pause();
      }
      /**
       * Send a ping.
       *
       * @param {*} [data] The data to send
       * @param {Boolean} [mask] Indicates whether or not to mask `data`
       * @param {Function} [cb] Callback which is executed when the ping is sent
       * @public
       */
      ping(data, mask, cb) {
        if (this.readyState === _WebSocket.CONNECTING) {
          throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");
        }
        if (typeof data === "function") {
          cb = data;
          data = mask = void 0;
        } else if (typeof mask === "function") {
          cb = mask;
          mask = void 0;
        }
        if (typeof data === "number") data = data.toString();
        if (this.readyState !== _WebSocket.OPEN) {
          sendAfterClose(this, data, cb);
          return;
        }
        if (mask === void 0) mask = !this._isServer;
        this._sender.ping(data || EMPTY_BUFFER, mask, cb);
      }
      /**
       * Send a pong.
       *
       * @param {*} [data] The data to send
       * @param {Boolean} [mask] Indicates whether or not to mask `data`
       * @param {Function} [cb] Callback which is executed when the pong is sent
       * @public
       */
      pong(data, mask, cb) {
        if (this.readyState === _WebSocket.CONNECTING) {
          throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");
        }
        if (typeof data === "function") {
          cb = data;
          data = mask = void 0;
        } else if (typeof mask === "function") {
          cb = mask;
          mask = void 0;
        }
        if (typeof data === "number") data = data.toString();
        if (this.readyState !== _WebSocket.OPEN) {
          sendAfterClose(this, data, cb);
          return;
        }
        if (mask === void 0) mask = !this._isServer;
        this._sender.pong(data || EMPTY_BUFFER, mask, cb);
      }
      /**
       * Resume the socket.
       *
       * @public
       */
      resume() {
        if (this.readyState === _WebSocket.CONNECTING || this.readyState === _WebSocket.CLOSED) {
          return;
        }
        this._paused = false;
        if (!this._receiver._writableState.needDrain) this._socket.resume();
      }
      /**
       * Send a data message.
       *
       * @param {*} data The message to send
       * @param {Object} [options] Options object
       * @param {Boolean} [options.binary] Specifies whether `data` is binary or
       *     text
       * @param {Boolean} [options.compress] Specifies whether or not to compress
       *     `data`
       * @param {Boolean} [options.fin=true] Specifies whether the fragment is the
       *     last one
       * @param {Boolean} [options.mask] Specifies whether or not to mask `data`
       * @param {Function} [cb] Callback which is executed when data is written out
       * @public
       */
      send(data, options2, cb) {
        if (this.readyState === _WebSocket.CONNECTING) {
          throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");
        }
        if (typeof options2 === "function") {
          cb = options2;
          options2 = {};
        }
        if (typeof data === "number") data = data.toString();
        if (this.readyState !== _WebSocket.OPEN) {
          sendAfterClose(this, data, cb);
          return;
        }
        const opts = {
          binary: typeof data !== "string",
          mask: !this._isServer,
          compress: true,
          fin: true,
          ...options2
        };
        if (!this._extensions[PerMessageDeflate.extensionName]) {
          opts.compress = false;
        }
        this._sender.send(data || EMPTY_BUFFER, opts, cb);
      }
      /**
       * Forcibly close the connection.
       *
       * @public
       */
      terminate() {
        if (this.readyState === _WebSocket.CLOSED) return;
        if (this.readyState === _WebSocket.CONNECTING) {
          const msg = "WebSocket was closed before the connection was established";
          abortHandshake(this, this._req, msg);
          return;
        }
        if (this._socket) {
          this._readyState = _WebSocket.CLOSING;
          this._socket.destroy();
        }
      }
    };
    Object.defineProperty(WebSocket2, "CONNECTING", {
      enumerable: true,
      value: readyStates.indexOf("CONNECTING")
    });
    Object.defineProperty(WebSocket2.prototype, "CONNECTING", {
      enumerable: true,
      value: readyStates.indexOf("CONNECTING")
    });
    Object.defineProperty(WebSocket2, "OPEN", {
      enumerable: true,
      value: readyStates.indexOf("OPEN")
    });
    Object.defineProperty(WebSocket2.prototype, "OPEN", {
      enumerable: true,
      value: readyStates.indexOf("OPEN")
    });
    Object.defineProperty(WebSocket2, "CLOSING", {
      enumerable: true,
      value: readyStates.indexOf("CLOSING")
    });
    Object.defineProperty(WebSocket2.prototype, "CLOSING", {
      enumerable: true,
      value: readyStates.indexOf("CLOSING")
    });
    Object.defineProperty(WebSocket2, "CLOSED", {
      enumerable: true,
      value: readyStates.indexOf("CLOSED")
    });
    Object.defineProperty(WebSocket2.prototype, "CLOSED", {
      enumerable: true,
      value: readyStates.indexOf("CLOSED")
    });
    [
      "binaryType",
      "bufferedAmount",
      "extensions",
      "isPaused",
      "protocol",
      "readyState",
      "url"
    ].forEach((property) => {
      Object.defineProperty(WebSocket2.prototype, property, { enumerable: true });
    });
    ["open", "error", "close", "message"].forEach((method) => {
      Object.defineProperty(WebSocket2.prototype, `on${method}`, {
        enumerable: true,
        get() {
          for (const listener of this.listeners(method)) {
            if (listener[kForOnEventAttribute]) return listener[kListener];
          }
          return null;
        },
        set(handler) {
          for (const listener of this.listeners(method)) {
            if (listener[kForOnEventAttribute]) {
              this.removeListener(method, listener);
              break;
            }
          }
          if (typeof handler !== "function") return;
          this.addEventListener(method, handler, {
            [kForOnEventAttribute]: true
          });
        }
      });
    });
    WebSocket2.prototype.addEventListener = addEventListener;
    WebSocket2.prototype.removeEventListener = removeEventListener;
    module2.exports = WebSocket2;
    function initAsClient(websocket, address, protocols, options2) {
      const opts = {
        allowSynchronousEvents: true,
        autoPong: true,
        protocolVersion: protocolVersions[1],
        maxPayload: 100 * 1024 * 1024,
        skipUTF8Validation: false,
        perMessageDeflate: true,
        followRedirects: false,
        maxRedirects: 10,
        ...options2,
        socketPath: void 0,
        hostname: void 0,
        protocol: void 0,
        timeout: void 0,
        method: "GET",
        host: void 0,
        path: void 0,
        port: void 0
      };
      websocket._autoPong = opts.autoPong;
      if (!protocolVersions.includes(opts.protocolVersion)) {
        throw new RangeError(
          `Unsupported protocol version: ${opts.protocolVersion} (supported versions: ${protocolVersions.join(", ")})`
        );
      }
      let parsedUrl;
      if (address instanceof URL3) {
        parsedUrl = address;
      } else {
        try {
          parsedUrl = new URL3(address);
        } catch (e) {
          throw new SyntaxError(`Invalid URL: ${address}`);
        }
      }
      if (parsedUrl.protocol === "http:") {
        parsedUrl.protocol = "ws:";
      } else if (parsedUrl.protocol === "https:") {
        parsedUrl.protocol = "wss:";
      }
      websocket._url = parsedUrl.href;
      const isSecure = parsedUrl.protocol === "wss:";
      const isIpcUrl = parsedUrl.protocol === "ws+unix:";
      let invalidUrlMessage;
      if (parsedUrl.protocol !== "ws:" && !isSecure && !isIpcUrl) {
        invalidUrlMessage = `The URL's protocol must be one of "ws:", "wss:", "http:", "https", or "ws+unix:"`;
      } else if (isIpcUrl && !parsedUrl.pathname) {
        invalidUrlMessage = "The URL's pathname is empty";
      } else if (parsedUrl.hash) {
        invalidUrlMessage = "The URL contains a fragment identifier";
      }
      if (invalidUrlMessage) {
        const err = new SyntaxError(invalidUrlMessage);
        if (websocket._redirects === 0) {
          throw err;
        } else {
          emitErrorAndClose(websocket, err);
          return;
        }
      }
      const defaultPort = isSecure ? 443 : 80;
      const key = randomBytes(16).toString("base64");
      const request = isSecure ? https.request : http.request;
      const protocolSet = /* @__PURE__ */ new Set();
      let perMessageDeflate;
      opts.createConnection = opts.createConnection || (isSecure ? tlsConnect : netConnect);
      opts.defaultPort = opts.defaultPort || defaultPort;
      opts.port = parsedUrl.port || defaultPort;
      opts.host = parsedUrl.hostname.startsWith("[") ? parsedUrl.hostname.slice(1, -1) : parsedUrl.hostname;
      opts.headers = {
        ...opts.headers,
        "Sec-WebSocket-Version": opts.protocolVersion,
        "Sec-WebSocket-Key": key,
        Connection: "Upgrade",
        Upgrade: "websocket"
      };
      opts.path = parsedUrl.pathname + parsedUrl.search;
      opts.timeout = opts.handshakeTimeout;
      if (opts.perMessageDeflate) {
        perMessageDeflate = new PerMessageDeflate(
          opts.perMessageDeflate !== true ? opts.perMessageDeflate : {},
          false,
          opts.maxPayload
        );
        opts.headers["Sec-WebSocket-Extensions"] = format({
          [PerMessageDeflate.extensionName]: perMessageDeflate.offer()
        });
      }
      if (protocols.length) {
        for (const protocol of protocols) {
          if (typeof protocol !== "string" || !subprotocolRegex.test(protocol) || protocolSet.has(protocol)) {
            throw new SyntaxError(
              "An invalid or duplicated subprotocol was specified"
            );
          }
          protocolSet.add(protocol);
        }
        opts.headers["Sec-WebSocket-Protocol"] = protocols.join(",");
      }
      if (opts.origin) {
        if (opts.protocolVersion < 13) {
          opts.headers["Sec-WebSocket-Origin"] = opts.origin;
        } else {
          opts.headers.Origin = opts.origin;
        }
      }
      if (parsedUrl.username || parsedUrl.password) {
        opts.auth = `${parsedUrl.username}:${parsedUrl.password}`;
      }
      if (isIpcUrl) {
        const parts = opts.path.split(":");
        opts.socketPath = parts[0];
        opts.path = parts[1];
      }
      let req;
      if (opts.followRedirects) {
        if (websocket._redirects === 0) {
          websocket._originalIpc = isIpcUrl;
          websocket._originalSecure = isSecure;
          websocket._originalHostOrSocketPath = isIpcUrl ? opts.socketPath : parsedUrl.host;
          const headers = options2 && options2.headers;
          options2 = { ...options2, headers: {} };
          if (headers) {
            for (const [key2, value] of Object.entries(headers)) {
              options2.headers[key2.toLowerCase()] = value;
            }
          }
        } else if (websocket.listenerCount("redirect") === 0) {
          const isSameHost = isIpcUrl ? websocket._originalIpc ? opts.socketPath === websocket._originalHostOrSocketPath : false : websocket._originalIpc ? false : parsedUrl.host === websocket._originalHostOrSocketPath;
          if (!isSameHost || websocket._originalSecure && !isSecure) {
            delete opts.headers.authorization;
            delete opts.headers.cookie;
            if (!isSameHost) delete opts.headers.host;
            opts.auth = void 0;
          }
        }
        if (opts.auth && !options2.headers.authorization) {
          options2.headers.authorization = "Basic " + Buffer.from(opts.auth).toString("base64");
        }
        req = websocket._req = request(opts);
        if (websocket._redirects) {
          websocket.emit("redirect", websocket.url, req);
        }
      } else {
        req = websocket._req = request(opts);
      }
      if (opts.timeout) {
        req.on("timeout", () => {
          abortHandshake(websocket, req, "Opening handshake has timed out");
        });
      }
      req.on("error", (err) => {
        if (req === null || req[kAborted]) return;
        req = websocket._req = null;
        emitErrorAndClose(websocket, err);
      });
      req.on("response", (res) => {
        const location = res.headers.location;
        const statusCode = res.statusCode;
        if (location && opts.followRedirects && statusCode >= 300 && statusCode < 400) {
          if (++websocket._redirects > opts.maxRedirects) {
            abortHandshake(websocket, req, "Maximum redirects exceeded");
            return;
          }
          req.abort();
          let addr;
          try {
            addr = new URL3(location, address);
          } catch (e) {
            const err = new SyntaxError(`Invalid URL: ${location}`);
            emitErrorAndClose(websocket, err);
            return;
          }
          initAsClient(websocket, addr, protocols, options2);
        } else if (!websocket.emit("unexpected-response", req, res)) {
          abortHandshake(
            websocket,
            req,
            `Unexpected server response: ${res.statusCode}`
          );
        }
      });
      req.on("upgrade", (res, socket, head) => {
        websocket.emit("upgrade", res);
        if (websocket.readyState !== WebSocket2.CONNECTING) return;
        req = websocket._req = null;
        const upgrade = res.headers.upgrade;
        if (upgrade === void 0 || upgrade.toLowerCase() !== "websocket") {
          abortHandshake(websocket, socket, "Invalid Upgrade header");
          return;
        }
        const digest = createHash("sha1").update(key + GUID).digest("base64");
        if (res.headers["sec-websocket-accept"] !== digest) {
          abortHandshake(websocket, socket, "Invalid Sec-WebSocket-Accept header");
          return;
        }
        const serverProt = res.headers["sec-websocket-protocol"];
        let protError;
        if (serverProt !== void 0) {
          if (!protocolSet.size) {
            protError = "Server sent a subprotocol but none was requested";
          } else if (!protocolSet.has(serverProt)) {
            protError = "Server sent an invalid subprotocol";
          }
        } else if (protocolSet.size) {
          protError = "Server sent no subprotocol";
        }
        if (protError) {
          abortHandshake(websocket, socket, protError);
          return;
        }
        if (serverProt) websocket._protocol = serverProt;
        const secWebSocketExtensions = res.headers["sec-websocket-extensions"];
        if (secWebSocketExtensions !== void 0) {
          if (!perMessageDeflate) {
            const message = "Server sent a Sec-WebSocket-Extensions header but no extension was requested";
            abortHandshake(websocket, socket, message);
            return;
          }
          let extensions;
          try {
            extensions = parse3(secWebSocketExtensions);
          } catch (err) {
            const message = "Invalid Sec-WebSocket-Extensions header";
            abortHandshake(websocket, socket, message);
            return;
          }
          const extensionNames = Object.keys(extensions);
          if (extensionNames.length !== 1 || extensionNames[0] !== PerMessageDeflate.extensionName) {
            const message = "Server indicated an extension that was not requested";
            abortHandshake(websocket, socket, message);
            return;
          }
          try {
            perMessageDeflate.accept(extensions[PerMessageDeflate.extensionName]);
          } catch (err) {
            const message = "Invalid Sec-WebSocket-Extensions header";
            abortHandshake(websocket, socket, message);
            return;
          }
          websocket._extensions[PerMessageDeflate.extensionName] = perMessageDeflate;
        }
        websocket.setSocket(socket, head, {
          allowSynchronousEvents: opts.allowSynchronousEvents,
          generateMask: opts.generateMask,
          maxPayload: opts.maxPayload,
          skipUTF8Validation: opts.skipUTF8Validation
        });
      });
      if (opts.finishRequest) {
        opts.finishRequest(req, websocket);
      } else {
        req.end();
      }
    }
    function emitErrorAndClose(websocket, err) {
      websocket._readyState = WebSocket2.CLOSING;
      websocket.emit("error", err);
      websocket.emitClose();
    }
    function netConnect(options2) {
      options2.path = options2.socketPath;
      return net.connect(options2);
    }
    function tlsConnect(options2) {
      options2.path = void 0;
      if (!options2.servername && options2.servername !== "") {
        options2.servername = net.isIP(options2.host) ? "" : options2.host;
      }
      return tls.connect(options2);
    }
    function abortHandshake(websocket, stream, message) {
      websocket._readyState = WebSocket2.CLOSING;
      const err = new Error(message);
      Error.captureStackTrace(err, abortHandshake);
      if (stream.setHeader) {
        stream[kAborted] = true;
        stream.abort();
        if (stream.socket && !stream.socket.destroyed) {
          stream.socket.destroy();
        }
        process.nextTick(emitErrorAndClose, websocket, err);
      } else {
        stream.destroy(err);
        stream.once("error", websocket.emit.bind(websocket, "error"));
        stream.once("close", websocket.emitClose.bind(websocket));
      }
    }
    function sendAfterClose(websocket, data, cb) {
      if (data) {
        const length = toBuffer(data).length;
        if (websocket._socket) websocket._sender._bufferedBytes += length;
        else websocket._bufferedAmount += length;
      }
      if (cb) {
        const err = new Error(
          `WebSocket is not open: readyState ${websocket.readyState} (${readyStates[websocket.readyState]})`
        );
        process.nextTick(cb, err);
      }
    }
    function receiverOnConclude(code, reason) {
      const websocket = this[kWebSocket];
      websocket._closeFrameReceived = true;
      websocket._closeMessage = reason;
      websocket._closeCode = code;
      if (websocket._socket[kWebSocket] === void 0) return;
      websocket._socket.removeListener("data", socketOnData);
      process.nextTick(resume, websocket._socket);
      if (code === 1005) websocket.close();
      else websocket.close(code, reason);
    }
    function receiverOnDrain() {
      const websocket = this[kWebSocket];
      if (!websocket.isPaused) websocket._socket.resume();
    }
    function receiverOnError(err) {
      const websocket = this[kWebSocket];
      if (websocket._socket[kWebSocket] !== void 0) {
        websocket._socket.removeListener("data", socketOnData);
        process.nextTick(resume, websocket._socket);
        websocket.close(err[kStatusCode]);
      }
      websocket.emit("error", err);
    }
    function receiverOnFinish() {
      this[kWebSocket].emitClose();
    }
    function receiverOnMessage(data, isBinary) {
      this[kWebSocket].emit("message", data, isBinary);
    }
    function receiverOnPing(data) {
      const websocket = this[kWebSocket];
      if (websocket._autoPong) websocket.pong(data, !this._isServer, NOOP);
      websocket.emit("ping", data);
    }
    function receiverOnPong(data) {
      this[kWebSocket].emit("pong", data);
    }
    function resume(stream) {
      stream.resume();
    }
    function socketOnClose() {
      const websocket = this[kWebSocket];
      this.removeListener("close", socketOnClose);
      this.removeListener("data", socketOnData);
      this.removeListener("end", socketOnEnd);
      websocket._readyState = WebSocket2.CLOSING;
      let chunk;
      if (!this._readableState.endEmitted && !websocket._closeFrameReceived && !websocket._receiver._writableState.errorEmitted && (chunk = websocket._socket.read()) !== null) {
        websocket._receiver.write(chunk);
      }
      websocket._receiver.end();
      this[kWebSocket] = void 0;
      clearTimeout(websocket._closeTimer);
      if (websocket._receiver._writableState.finished || websocket._receiver._writableState.errorEmitted) {
        websocket.emitClose();
      } else {
        websocket._receiver.on("error", receiverOnFinish);
        websocket._receiver.on("finish", receiverOnFinish);
      }
    }
    function socketOnData(chunk) {
      if (!this[kWebSocket]._receiver.write(chunk)) {
        this.pause();
      }
    }
    function socketOnEnd() {
      const websocket = this[kWebSocket];
      websocket._readyState = WebSocket2.CLOSING;
      websocket._receiver.end();
      this.end();
    }
    function socketOnError() {
      const websocket = this[kWebSocket];
      this.removeListener("error", socketOnError);
      this.on("error", NOOP);
      if (websocket) {
        websocket._readyState = WebSocket2.CLOSING;
        this.destroy();
      }
    }
  }
});

// node_modules/ws/lib/subprotocol.js
var require_subprotocol = __commonJS({
  "node_modules/ws/lib/subprotocol.js"(exports2, module2) {
    "use strict";
    var { tokenChars } = require_validation();
    function parse3(header) {
      const protocols = /* @__PURE__ */ new Set();
      let start = -1;
      let end = -1;
      let i = 0;
      for (i; i < header.length; i++) {
        const code = header.charCodeAt(i);
        if (end === -1 && tokenChars[code] === 1) {
          if (start === -1) start = i;
        } else if (i !== 0 && (code === 32 || code === 9)) {
          if (end === -1 && start !== -1) end = i;
        } else if (code === 44) {
          if (start === -1) {
            throw new SyntaxError(`Unexpected character at index ${i}`);
          }
          if (end === -1) end = i;
          const protocol2 = header.slice(start, end);
          if (protocols.has(protocol2)) {
            throw new SyntaxError(`The "${protocol2}" subprotocol is duplicated`);
          }
          protocols.add(protocol2);
          start = end = -1;
        } else {
          throw new SyntaxError(`Unexpected character at index ${i}`);
        }
      }
      if (start === -1 || end !== -1) {
        throw new SyntaxError("Unexpected end of input");
      }
      const protocol = header.slice(start, i);
      if (protocols.has(protocol)) {
        throw new SyntaxError(`The "${protocol}" subprotocol is duplicated`);
      }
      protocols.add(protocol);
      return protocols;
    }
    module2.exports = { parse: parse3 };
  }
});

// node_modules/ws/lib/websocket-server.js
var require_websocket_server = __commonJS({
  "node_modules/ws/lib/websocket-server.js"(exports2, module2) {
    "use strict";
    var EventEmitter = require("events");
    var http = require("http");
    var { Duplex } = require("stream");
    var { createHash } = require("crypto");
    var extension = require_extension();
    var PerMessageDeflate = require_permessage_deflate();
    var subprotocol = require_subprotocol();
    var WebSocket2 = require_websocket();
    var { GUID, kWebSocket } = require_constants5();
    var keyRegex = /^[+/0-9A-Za-z]{22}==$/;
    var RUNNING = 0;
    var CLOSING = 1;
    var CLOSED = 2;
    var WebSocketServer2 = class extends EventEmitter {
      /**
       * Create a `WebSocketServer` instance.
       *
       * @param {Object} options Configuration options
       * @param {Boolean} [options.allowSynchronousEvents=true] Specifies whether
       *     any of the `'message'`, `'ping'`, and `'pong'` events can be emitted
       *     multiple times in the same tick
       * @param {Boolean} [options.autoPong=true] Specifies whether or not to
       *     automatically send a pong in response to a ping
       * @param {Number} [options.backlog=511] The maximum length of the queue of
       *     pending connections
       * @param {Boolean} [options.clientTracking=true] Specifies whether or not to
       *     track clients
       * @param {Function} [options.handleProtocols] A hook to handle protocols
       * @param {String} [options.host] The hostname where to bind the server
       * @param {Number} [options.maxPayload=104857600] The maximum allowed message
       *     size
       * @param {Boolean} [options.noServer=false] Enable no server mode
       * @param {String} [options.path] Accept only connections matching this path
       * @param {(Boolean|Object)} [options.perMessageDeflate=false] Enable/disable
       *     permessage-deflate
       * @param {Number} [options.port] The port where to bind the server
       * @param {(http.Server|https.Server)} [options.server] A pre-created HTTP/S
       *     server to use
       * @param {Boolean} [options.skipUTF8Validation=false] Specifies whether or
       *     not to skip UTF-8 validation for text and close messages
       * @param {Function} [options.verifyClient] A hook to reject connections
       * @param {Function} [options.WebSocket=WebSocket] Specifies the `WebSocket`
       *     class to use. It must be the `WebSocket` class or class that extends it
       * @param {Function} [callback] A listener for the `listening` event
       */
      constructor(options2, callback) {
        super();
        options2 = {
          allowSynchronousEvents: true,
          autoPong: true,
          maxPayload: 100 * 1024 * 1024,
          skipUTF8Validation: false,
          perMessageDeflate: false,
          handleProtocols: null,
          clientTracking: true,
          verifyClient: null,
          noServer: false,
          backlog: null,
          // use default (511 as implemented in net.js)
          server: null,
          host: null,
          path: null,
          port: null,
          WebSocket: WebSocket2,
          ...options2
        };
        if (options2.port == null && !options2.server && !options2.noServer || options2.port != null && (options2.server || options2.noServer) || options2.server && options2.noServer) {
          throw new TypeError(
            'One and only one of the "port", "server", or "noServer" options must be specified'
          );
        }
        if (options2.port != null) {
          this._server = http.createServer((req, res) => {
            const body = http.STATUS_CODES[426];
            res.writeHead(426, {
              "Content-Length": body.length,
              "Content-Type": "text/plain"
            });
            res.end(body);
          });
          this._server.listen(
            options2.port,
            options2.host,
            options2.backlog,
            callback
          );
        } else if (options2.server) {
          this._server = options2.server;
        }
        if (this._server) {
          const emitConnection = this.emit.bind(this, "connection");
          this._removeListeners = addListeners(this._server, {
            listening: this.emit.bind(this, "listening"),
            error: this.emit.bind(this, "error"),
            upgrade: (req, socket, head) => {
              this.handleUpgrade(req, socket, head, emitConnection);
            }
          });
        }
        if (options2.perMessageDeflate === true) options2.perMessageDeflate = {};
        if (options2.clientTracking) {
          this.clients = /* @__PURE__ */ new Set();
          this._shouldEmitClose = false;
        }
        this.options = options2;
        this._state = RUNNING;
      }
      /**
       * Returns the bound address, the address family name, and port of the server
       * as reported by the operating system if listening on an IP socket.
       * If the server is listening on a pipe or UNIX domain socket, the name is
       * returned as a string.
       *
       * @return {(Object|String|null)} The address of the server
       * @public
       */
      address() {
        if (this.options.noServer) {
          throw new Error('The server is operating in "noServer" mode');
        }
        if (!this._server) return null;
        return this._server.address();
      }
      /**
       * Stop the server from accepting new connections and emit the `'close'` event
       * when all existing connections are closed.
       *
       * @param {Function} [cb] A one-time listener for the `'close'` event
       * @public
       */
      close(cb) {
        if (this._state === CLOSED) {
          if (cb) {
            this.once("close", () => {
              cb(new Error("The server is not running"));
            });
          }
          process.nextTick(emitClose, this);
          return;
        }
        if (cb) this.once("close", cb);
        if (this._state === CLOSING) return;
        this._state = CLOSING;
        if (this.options.noServer || this.options.server) {
          if (this._server) {
            this._removeListeners();
            this._removeListeners = this._server = null;
          }
          if (this.clients) {
            if (!this.clients.size) {
              process.nextTick(emitClose, this);
            } else {
              this._shouldEmitClose = true;
            }
          } else {
            process.nextTick(emitClose, this);
          }
        } else {
          const server = this._server;
          this._removeListeners();
          this._removeListeners = this._server = null;
          server.close(() => {
            emitClose(this);
          });
        }
      }
      /**
       * See if a given request should be handled by this server instance.
       *
       * @param {http.IncomingMessage} req Request object to inspect
       * @return {Boolean} `true` if the request is valid, else `false`
       * @public
       */
      shouldHandle(req) {
        if (this.options.path) {
          const index = req.url.indexOf("?");
          const pathname = index !== -1 ? req.url.slice(0, index) : req.url;
          if (pathname !== this.options.path) return false;
        }
        return true;
      }
      /**
       * Handle a HTTP Upgrade request.
       *
       * @param {http.IncomingMessage} req The request object
       * @param {Duplex} socket The network socket between the server and client
       * @param {Buffer} head The first packet of the upgraded stream
       * @param {Function} cb Callback
       * @public
       */
      handleUpgrade(req, socket, head, cb) {
        socket.on("error", socketOnError);
        const key = req.headers["sec-websocket-key"];
        const upgrade = req.headers.upgrade;
        const version2 = +req.headers["sec-websocket-version"];
        if (req.method !== "GET") {
          const message = "Invalid HTTP method";
          abortHandshakeOrEmitwsClientError(this, req, socket, 405, message);
          return;
        }
        if (upgrade === void 0 || upgrade.toLowerCase() !== "websocket") {
          const message = "Invalid Upgrade header";
          abortHandshakeOrEmitwsClientError(this, req, socket, 400, message);
          return;
        }
        if (key === void 0 || !keyRegex.test(key)) {
          const message = "Missing or invalid Sec-WebSocket-Key header";
          abortHandshakeOrEmitwsClientError(this, req, socket, 400, message);
          return;
        }
        if (version2 !== 8 && version2 !== 13) {
          const message = "Missing or invalid Sec-WebSocket-Version header";
          abortHandshakeOrEmitwsClientError(this, req, socket, 400, message);
          return;
        }
        if (!this.shouldHandle(req)) {
          abortHandshake(socket, 400);
          return;
        }
        const secWebSocketProtocol = req.headers["sec-websocket-protocol"];
        let protocols = /* @__PURE__ */ new Set();
        if (secWebSocketProtocol !== void 0) {
          try {
            protocols = subprotocol.parse(secWebSocketProtocol);
          } catch (err) {
            const message = "Invalid Sec-WebSocket-Protocol header";
            abortHandshakeOrEmitwsClientError(this, req, socket, 400, message);
            return;
          }
        }
        const secWebSocketExtensions = req.headers["sec-websocket-extensions"];
        const extensions = {};
        if (this.options.perMessageDeflate && secWebSocketExtensions !== void 0) {
          const perMessageDeflate = new PerMessageDeflate(
            this.options.perMessageDeflate,
            true,
            this.options.maxPayload
          );
          try {
            const offers = extension.parse(secWebSocketExtensions);
            if (offers[PerMessageDeflate.extensionName]) {
              perMessageDeflate.accept(offers[PerMessageDeflate.extensionName]);
              extensions[PerMessageDeflate.extensionName] = perMessageDeflate;
            }
          } catch (err) {
            const message = "Invalid or unacceptable Sec-WebSocket-Extensions header";
            abortHandshakeOrEmitwsClientError(this, req, socket, 400, message);
            return;
          }
        }
        if (this.options.verifyClient) {
          const info = {
            origin: req.headers[`${version2 === 8 ? "sec-websocket-origin" : "origin"}`],
            secure: !!(req.socket.authorized || req.socket.encrypted),
            req
          };
          if (this.options.verifyClient.length === 2) {
            this.options.verifyClient(info, (verified, code, message, headers) => {
              if (!verified) {
                return abortHandshake(socket, code || 401, message, headers);
              }
              this.completeUpgrade(
                extensions,
                key,
                protocols,
                req,
                socket,
                head,
                cb
              );
            });
            return;
          }
          if (!this.options.verifyClient(info)) return abortHandshake(socket, 401);
        }
        this.completeUpgrade(extensions, key, protocols, req, socket, head, cb);
      }
      /**
       * Upgrade the connection to WebSocket.
       *
       * @param {Object} extensions The accepted extensions
       * @param {String} key The value of the `Sec-WebSocket-Key` header
       * @param {Set} protocols The subprotocols
       * @param {http.IncomingMessage} req The request object
       * @param {Duplex} socket The network socket between the server and client
       * @param {Buffer} head The first packet of the upgraded stream
       * @param {Function} cb Callback
       * @throws {Error} If called more than once with the same socket
       * @private
       */
      completeUpgrade(extensions, key, protocols, req, socket, head, cb) {
        if (!socket.readable || !socket.writable) return socket.destroy();
        if (socket[kWebSocket]) {
          throw new Error(
            "server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration"
          );
        }
        if (this._state > RUNNING) return abortHandshake(socket, 503);
        const digest = createHash("sha1").update(key + GUID).digest("base64");
        const headers = [
          "HTTP/1.1 101 Switching Protocols",
          "Upgrade: websocket",
          "Connection: Upgrade",
          `Sec-WebSocket-Accept: ${digest}`
        ];
        const ws2 = new this.options.WebSocket(null, void 0, this.options);
        if (protocols.size) {
          const protocol = this.options.handleProtocols ? this.options.handleProtocols(protocols, req) : protocols.values().next().value;
          if (protocol) {
            headers.push(`Sec-WebSocket-Protocol: ${protocol}`);
            ws2._protocol = protocol;
          }
        }
        if (extensions[PerMessageDeflate.extensionName]) {
          const params = extensions[PerMessageDeflate.extensionName].params;
          const value = extension.format({
            [PerMessageDeflate.extensionName]: [params]
          });
          headers.push(`Sec-WebSocket-Extensions: ${value}`);
          ws2._extensions = extensions;
        }
        this.emit("headers", headers, req);
        socket.write(headers.concat("\r\n").join("\r\n"));
        socket.removeListener("error", socketOnError);
        ws2.setSocket(socket, head, {
          allowSynchronousEvents: this.options.allowSynchronousEvents,
          maxPayload: this.options.maxPayload,
          skipUTF8Validation: this.options.skipUTF8Validation
        });
        if (this.clients) {
          this.clients.add(ws2);
          ws2.on("close", () => {
            this.clients.delete(ws2);
            if (this._shouldEmitClose && !this.clients.size) {
              process.nextTick(emitClose, this);
            }
          });
        }
        cb(ws2, req);
      }
    };
    module2.exports = WebSocketServer2;
    function addListeners(server, map2) {
      for (const event of Object.keys(map2)) server.on(event, map2[event]);
      return function removeListeners() {
        for (const event of Object.keys(map2)) {
          server.removeListener(event, map2[event]);
        }
      };
    }
    function emitClose(server) {
      server._state = CLOSED;
      server.emit("close");
    }
    function socketOnError() {
      this.destroy();
    }
    function abortHandshake(socket, code, message, headers) {
      message = message || http.STATUS_CODES[code];
      headers = {
        Connection: "close",
        "Content-Type": "text/html",
        "Content-Length": Buffer.byteLength(message),
        ...headers
      };
      socket.once("finish", socket.destroy);
      socket.end(
        `HTTP/1.1 ${code} ${http.STATUS_CODES[code]}\r
` + Object.keys(headers).map((h) => `${h}: ${headers[h]}`).join("\r\n") + "\r\n\r\n" + message
      );
    }
    function abortHandshakeOrEmitwsClientError(server, req, socket, code, message) {
      if (server.listenerCount("wsClientError")) {
        const err = new Error(message);
        Error.captureStackTrace(err, abortHandshakeOrEmitwsClientError);
        server.emit("wsClientError", err, socket, req);
      } else {
        abortHandshake(socket, code, message);
      }
    }
  }
});

// node_modules/yaml/dist/nodes/identity.js
var require_identity = __commonJS({
  "node_modules/yaml/dist/nodes/identity.js"(exports2) {
    "use strict";
    var ALIAS = Symbol.for("yaml.alias");
    var DOC = Symbol.for("yaml.document");
    var MAP = Symbol.for("yaml.map");
    var PAIR = Symbol.for("yaml.pair");
    var SCALAR = Symbol.for("yaml.scalar");
    var SEQ = Symbol.for("yaml.seq");
    var NODE_TYPE = Symbol.for("yaml.node.type");
    var isAlias = (node) => !!node && typeof node === "object" && node[NODE_TYPE] === ALIAS;
    var isDocument = (node) => !!node && typeof node === "object" && node[NODE_TYPE] === DOC;
    var isMap = (node) => !!node && typeof node === "object" && node[NODE_TYPE] === MAP;
    var isPair = (node) => !!node && typeof node === "object" && node[NODE_TYPE] === PAIR;
    var isScalar = (node) => !!node && typeof node === "object" && node[NODE_TYPE] === SCALAR;
    var isSeq = (node) => !!node && typeof node === "object" && node[NODE_TYPE] === SEQ;
    function isCollection(node) {
      if (node && typeof node === "object")
        switch (node[NODE_TYPE]) {
          case MAP:
          case SEQ:
            return true;
        }
      return false;
    }
    function isNode(node) {
      if (node && typeof node === "object")
        switch (node[NODE_TYPE]) {
          case ALIAS:
          case MAP:
          case SCALAR:
          case SEQ:
            return true;
        }
      return false;
    }
    var hasAnchor = (node) => (isScalar(node) || isCollection(node)) && !!node.anchor;
    exports2.ALIAS = ALIAS;
    exports2.DOC = DOC;
    exports2.MAP = MAP;
    exports2.NODE_TYPE = NODE_TYPE;
    exports2.PAIR = PAIR;
    exports2.SCALAR = SCALAR;
    exports2.SEQ = SEQ;
    exports2.hasAnchor = hasAnchor;
    exports2.isAlias = isAlias;
    exports2.isCollection = isCollection;
    exports2.isDocument = isDocument;
    exports2.isMap = isMap;
    exports2.isNode = isNode;
    exports2.isPair = isPair;
    exports2.isScalar = isScalar;
    exports2.isSeq = isSeq;
  }
});

// node_modules/yaml/dist/visit.js
var require_visit = __commonJS({
  "node_modules/yaml/dist/visit.js"(exports2) {
    "use strict";
    var identity = require_identity();
    var BREAK = Symbol("break visit");
    var SKIP = Symbol("skip children");
    var REMOVE = Symbol("remove node");
    function visit(node, visitor) {
      const visitor_ = initVisitor(visitor);
      if (identity.isDocument(node)) {
        const cd = visit_(null, node.contents, visitor_, Object.freeze([node]));
        if (cd === REMOVE)
          node.contents = null;
      } else
        visit_(null, node, visitor_, Object.freeze([]));
    }
    visit.BREAK = BREAK;
    visit.SKIP = SKIP;
    visit.REMOVE = REMOVE;
    function visit_(key, node, visitor, path) {
      const ctrl = callVisitor(key, node, visitor, path);
      if (identity.isNode(ctrl) || identity.isPair(ctrl)) {
        replaceNode(key, path, ctrl);
        return visit_(key, ctrl, visitor, path);
      }
      if (typeof ctrl !== "symbol") {
        if (identity.isCollection(node)) {
          path = Object.freeze(path.concat(node));
          for (let i = 0; i < node.items.length; ++i) {
            const ci = visit_(i, node.items[i], visitor, path);
            if (typeof ci === "number")
              i = ci - 1;
            else if (ci === BREAK)
              return BREAK;
            else if (ci === REMOVE) {
              node.items.splice(i, 1);
              i -= 1;
            }
          }
        } else if (identity.isPair(node)) {
          path = Object.freeze(path.concat(node));
          const ck = visit_("key", node.key, visitor, path);
          if (ck === BREAK)
            return BREAK;
          else if (ck === REMOVE)
            node.key = null;
          const cv = visit_("value", node.value, visitor, path);
          if (cv === BREAK)
            return BREAK;
          else if (cv === REMOVE)
            node.value = null;
        }
      }
      return ctrl;
    }
    async function visitAsync(node, visitor) {
      const visitor_ = initVisitor(visitor);
      if (identity.isDocument(node)) {
        const cd = await visitAsync_(null, node.contents, visitor_, Object.freeze([node]));
        if (cd === REMOVE)
          node.contents = null;
      } else
        await visitAsync_(null, node, visitor_, Object.freeze([]));
    }
    visitAsync.BREAK = BREAK;
    visitAsync.SKIP = SKIP;
    visitAsync.REMOVE = REMOVE;
    async function visitAsync_(key, node, visitor, path) {
      const ctrl = await callVisitor(key, node, visitor, path);
      if (identity.isNode(ctrl) || identity.isPair(ctrl)) {
        replaceNode(key, path, ctrl);
        return visitAsync_(key, ctrl, visitor, path);
      }
      if (typeof ctrl !== "symbol") {
        if (identity.isCollection(node)) {
          path = Object.freeze(path.concat(node));
          for (let i = 0; i < node.items.length; ++i) {
            const ci = await visitAsync_(i, node.items[i], visitor, path);
            if (typeof ci === "number")
              i = ci - 1;
            else if (ci === BREAK)
              return BREAK;
            else if (ci === REMOVE) {
              node.items.splice(i, 1);
              i -= 1;
            }
          }
        } else if (identity.isPair(node)) {
          path = Object.freeze(path.concat(node));
          const ck = await visitAsync_("key", node.key, visitor, path);
          if (ck === BREAK)
            return BREAK;
          else if (ck === REMOVE)
            node.key = null;
          const cv = await visitAsync_("value", node.value, visitor, path);
          if (cv === BREAK)
            return BREAK;
          else if (cv === REMOVE)
            node.value = null;
        }
      }
      return ctrl;
    }
    function initVisitor(visitor) {
      if (typeof visitor === "object" && (visitor.Collection || visitor.Node || visitor.Value)) {
        return Object.assign({
          Alias: visitor.Node,
          Map: visitor.Node,
          Scalar: visitor.Node,
          Seq: visitor.Node
        }, visitor.Value && {
          Map: visitor.Value,
          Scalar: visitor.Value,
          Seq: visitor.Value
        }, visitor.Collection && {
          Map: visitor.Collection,
          Seq: visitor.Collection
        }, visitor);
      }
      return visitor;
    }
    function callVisitor(key, node, visitor, path) {
      if (typeof visitor === "function")
        return visitor(key, node, path);
      if (identity.isMap(node))
        return visitor.Map?.(key, node, path);
      if (identity.isSeq(node))
        return visitor.Seq?.(key, node, path);
      if (identity.isPair(node))
        return visitor.Pair?.(key, node, path);
      if (identity.isScalar(node))
        return visitor.Scalar?.(key, node, path);
      if (identity.isAlias(node))
        return visitor.Alias?.(key, node, path);
      return void 0;
    }
    function replaceNode(key, path, node) {
      const parent = path[path.length - 1];
      if (identity.isCollection(parent)) {
        parent.items[key] = node;
      } else if (identity.isPair(parent)) {
        if (key === "key")
          parent.key = node;
        else
          parent.value = node;
      } else if (identity.isDocument(parent)) {
        parent.contents = node;
      } else {
        const pt = identity.isAlias(parent) ? "alias" : "scalar";
        throw new Error(`Cannot replace node with ${pt} parent`);
      }
    }
    exports2.visit = visit;
    exports2.visitAsync = visitAsync;
  }
});

// node_modules/yaml/dist/doc/directives.js
var require_directives = __commonJS({
  "node_modules/yaml/dist/doc/directives.js"(exports2) {
    "use strict";
    var identity = require_identity();
    var visit = require_visit();
    var escapeChars = {
      "!": "%21",
      ",": "%2C",
      "[": "%5B",
      "]": "%5D",
      "{": "%7B",
      "}": "%7D"
    };
    var escapeTagName = (tn) => tn.replace(/[!,[\]{}]/g, (ch) => escapeChars[ch]);
    var Directives = class _Directives {
      constructor(yaml2, tags) {
        this.docStart = null;
        this.docEnd = false;
        this.yaml = Object.assign({}, _Directives.defaultYaml, yaml2);
        this.tags = Object.assign({}, _Directives.defaultTags, tags);
      }
      clone() {
        const copy = new _Directives(this.yaml, this.tags);
        copy.docStart = this.docStart;
        return copy;
      }
      /**
       * During parsing, get a Directives instance for the current document and
       * update the stream state according to the current version's spec.
       */
      atDocument() {
        const res = new _Directives(this.yaml, this.tags);
        switch (this.yaml.version) {
          case "1.1":
            this.atNextDocument = true;
            break;
          case "1.2":
            this.atNextDocument = false;
            this.yaml = {
              explicit: _Directives.defaultYaml.explicit,
              version: "1.2"
            };
            this.tags = Object.assign({}, _Directives.defaultTags);
            break;
        }
        return res;
      }
      /**
       * @param onError - May be called even if the action was successful
       * @returns `true` on success
       */
      add(line, onError) {
        if (this.atNextDocument) {
          this.yaml = { explicit: _Directives.defaultYaml.explicit, version: "1.1" };
          this.tags = Object.assign({}, _Directives.defaultTags);
          this.atNextDocument = false;
        }
        const parts = line.trim().split(/[ \t]+/);
        const name = parts.shift();
        switch (name) {
          case "%TAG": {
            if (parts.length !== 2) {
              onError(0, "%TAG directive should contain exactly two parts");
              if (parts.length < 2)
                return false;
            }
            const [handle, prefix] = parts;
            this.tags[handle] = prefix;
            return true;
          }
          case "%YAML": {
            this.yaml.explicit = true;
            if (parts.length !== 1) {
              onError(0, "%YAML directive should contain exactly one part");
              return false;
            }
            const [version2] = parts;
            if (version2 === "1.1" || version2 === "1.2") {
              this.yaml.version = version2;
              return true;
            } else {
              const isValid2 = /^\d+\.\d+$/.test(version2);
              onError(6, `Unsupported YAML version ${version2}`, isValid2);
              return false;
            }
          }
          default:
            onError(0, `Unknown directive ${name}`, true);
            return false;
        }
      }
      /**
       * Resolves a tag, matching handles to those defined in %TAG directives.
       *
       * @returns Resolved tag, which may also be the non-specific tag `'!'` or a
       *   `'!local'` tag, or `null` if unresolvable.
       */
      tagName(source, onError) {
        if (source === "!")
          return "!";
        if (source[0] !== "!") {
          onError(`Not a valid tag: ${source}`);
          return null;
        }
        if (source[1] === "<") {
          const verbatim = source.slice(2, -1);
          if (verbatim === "!" || verbatim === "!!") {
            onError(`Verbatim tags aren't resolved, so ${source} is invalid.`);
            return null;
          }
          if (source[source.length - 1] !== ">")
            onError("Verbatim tags must end with a >");
          return verbatim;
        }
        const [, handle, suffix] = source.match(/^(.*!)([^!]*)$/s);
        if (!suffix)
          onError(`The ${source} tag has no suffix`);
        const prefix = this.tags[handle];
        if (prefix) {
          try {
            return prefix + decodeURIComponent(suffix);
          } catch (error48) {
            onError(String(error48));
            return null;
          }
        }
        if (handle === "!")
          return source;
        onError(`Could not resolve tag: ${source}`);
        return null;
      }
      /**
       * Given a fully resolved tag, returns its printable string form,
       * taking into account current tag prefixes and defaults.
       */
      tagString(tag) {
        for (const [handle, prefix] of Object.entries(this.tags)) {
          if (tag.startsWith(prefix))
            return handle + escapeTagName(tag.substring(prefix.length));
        }
        return tag[0] === "!" ? tag : `!<${tag}>`;
      }
      toString(doc) {
        const lines = this.yaml.explicit ? [`%YAML ${this.yaml.version || "1.2"}`] : [];
        const tagEntries = Object.entries(this.tags);
        let tagNames;
        if (doc && tagEntries.length > 0 && identity.isNode(doc.contents)) {
          const tags = {};
          visit.visit(doc.contents, (_key, node) => {
            if (identity.isNode(node) && node.tag)
              tags[node.tag] = true;
          });
          tagNames = Object.keys(tags);
        } else
          tagNames = [];
        for (const [handle, prefix] of tagEntries) {
          if (handle === "!!" && prefix === "tag:yaml.org,2002:")
            continue;
          if (!doc || tagNames.some((tn) => tn.startsWith(prefix)))
            lines.push(`%TAG ${handle} ${prefix}`);
        }
        return lines.join("\n");
      }
    };
    Directives.defaultYaml = { explicit: false, version: "1.2" };
    Directives.defaultTags = { "!!": "tag:yaml.org,2002:" };
    exports2.Directives = Directives;
  }
});

// node_modules/yaml/dist/doc/anchors.js
var require_anchors = __commonJS({
  "node_modules/yaml/dist/doc/anchors.js"(exports2) {
    "use strict";
    var identity = require_identity();
    var visit = require_visit();
    function anchorIsValid(anchor) {
      if (/[\x00-\x19\s,[\]{}]/.test(anchor)) {
        const sa = JSON.stringify(anchor);
        const msg = `Anchor must not contain whitespace or control characters: ${sa}`;
        throw new Error(msg);
      }
      return true;
    }
    function anchorNames(root) {
      const anchors = /* @__PURE__ */ new Set();
      visit.visit(root, {
        Value(_key, node) {
          if (node.anchor)
            anchors.add(node.anchor);
        }
      });
      return anchors;
    }
    function findNewAnchor(prefix, exclude) {
      for (let i = 1; true; ++i) {
        const name = `${prefix}${i}`;
        if (!exclude.has(name))
          return name;
      }
    }
    function createNodeAnchors(doc, prefix) {
      const aliasObjects = [];
      const sourceObjects = /* @__PURE__ */ new Map();
      let prevAnchors = null;
      return {
        onAnchor: (source) => {
          aliasObjects.push(source);
          prevAnchors ?? (prevAnchors = anchorNames(doc));
          const anchor = findNewAnchor(prefix, prevAnchors);
          prevAnchors.add(anchor);
          return anchor;
        },
        /**
         * With circular references, the source node is only resolved after all
         * of its child nodes are. This is why anchors are set only after all of
         * the nodes have been created.
         */
        setAnchors: () => {
          for (const source of aliasObjects) {
            const ref = sourceObjects.get(source);
            if (typeof ref === "object" && ref.anchor && (identity.isScalar(ref.node) || identity.isCollection(ref.node))) {
              ref.node.anchor = ref.anchor;
            } else {
              const error48 = new Error("Failed to resolve repeated object (this should not happen)");
              error48.source = source;
              throw error48;
            }
          }
        },
        sourceObjects
      };
    }
    exports2.anchorIsValid = anchorIsValid;
    exports2.anchorNames = anchorNames;
    exports2.createNodeAnchors = createNodeAnchors;
    exports2.findNewAnchor = findNewAnchor;
  }
});

// node_modules/yaml/dist/doc/applyReviver.js
var require_applyReviver = __commonJS({
  "node_modules/yaml/dist/doc/applyReviver.js"(exports2) {
    "use strict";
    function applyReviver(reviver, obj, key, val) {
      if (val && typeof val === "object") {
        if (Array.isArray(val)) {
          for (let i = 0, len = val.length; i < len; ++i) {
            const v0 = val[i];
            const v1 = applyReviver(reviver, val, String(i), v0);
            if (v1 === void 0)
              delete val[i];
            else if (v1 !== v0)
              val[i] = v1;
          }
        } else if (val instanceof Map) {
          for (const k of Array.from(val.keys())) {
            const v0 = val.get(k);
            const v1 = applyReviver(reviver, val, k, v0);
            if (v1 === void 0)
              val.delete(k);
            else if (v1 !== v0)
              val.set(k, v1);
          }
        } else if (val instanceof Set) {
          for (const v0 of Array.from(val)) {
            const v1 = applyReviver(reviver, val, v0, v0);
            if (v1 === void 0)
              val.delete(v0);
            else if (v1 !== v0) {
              val.delete(v0);
              val.add(v1);
            }
          }
        } else {
          for (const [k, v0] of Object.entries(val)) {
            const v1 = applyReviver(reviver, val, k, v0);
            if (v1 === void 0)
              delete val[k];
            else if (v1 !== v0)
              val[k] = v1;
          }
        }
      }
      return reviver.call(obj, key, val);
    }
    exports2.applyReviver = applyReviver;
  }
});

// node_modules/yaml/dist/nodes/toJS.js
var require_toJS = __commonJS({
  "node_modules/yaml/dist/nodes/toJS.js"(exports2) {
    "use strict";
    var identity = require_identity();
    function toJS(value, arg, ctx) {
      if (Array.isArray(value))
        return value.map((v, i) => toJS(v, String(i), ctx));
      if (value && typeof value.toJSON === "function") {
        if (!ctx || !identity.hasAnchor(value))
          return value.toJSON(arg, ctx);
        const data = { aliasCount: 0, count: 1, res: void 0 };
        ctx.anchors.set(value, data);
        ctx.onCreate = (res2) => {
          data.res = res2;
          delete ctx.onCreate;
        };
        const res = value.toJSON(arg, ctx);
        if (ctx.onCreate)
          ctx.onCreate(res);
        return res;
      }
      if (typeof value === "bigint" && !ctx?.keep)
        return Number(value);
      return value;
    }
    exports2.toJS = toJS;
  }
});

// node_modules/yaml/dist/nodes/Node.js
var require_Node = __commonJS({
  "node_modules/yaml/dist/nodes/Node.js"(exports2) {
    "use strict";
    var applyReviver = require_applyReviver();
    var identity = require_identity();
    var toJS = require_toJS();
    var NodeBase = class {
      constructor(type) {
        Object.defineProperty(this, identity.NODE_TYPE, { value: type });
      }
      /** Create a copy of this node.  */
      clone() {
        const copy = Object.create(Object.getPrototypeOf(this), Object.getOwnPropertyDescriptors(this));
        if (this.range)
          copy.range = this.range.slice();
        return copy;
      }
      /** A plain JavaScript representation of this node. */
      toJS(doc, { mapAsMap, maxAliasCount, onAnchor, reviver } = {}) {
        if (!identity.isDocument(doc))
          throw new TypeError("A document argument is required");
        const ctx = {
          anchors: /* @__PURE__ */ new Map(),
          doc,
          keep: true,
          mapAsMap: mapAsMap === true,
          mapKeyWarned: false,
          maxAliasCount: typeof maxAliasCount === "number" ? maxAliasCount : 100
        };
        const res = toJS.toJS(this, "", ctx);
        if (typeof onAnchor === "function")
          for (const { count, res: res2 } of ctx.anchors.values())
            onAnchor(res2, count);
        return typeof reviver === "function" ? applyReviver.applyReviver(reviver, { "": res }, "", res) : res;
      }
    };
    exports2.NodeBase = NodeBase;
  }
});

// node_modules/yaml/dist/nodes/Alias.js
var require_Alias = __commonJS({
  "node_modules/yaml/dist/nodes/Alias.js"(exports2) {
    "use strict";
    var anchors = require_anchors();
    var visit = require_visit();
    var identity = require_identity();
    var Node = require_Node();
    var toJS = require_toJS();
    var Alias = class extends Node.NodeBase {
      constructor(source) {
        super(identity.ALIAS);
        this.source = source;
        Object.defineProperty(this, "tag", {
          set() {
            throw new Error("Alias nodes cannot have tags");
          }
        });
      }
      /**
       * Resolve the value of this alias within `doc`, finding the last
       * instance of the `source` anchor before this node.
       */
      resolve(doc, ctx) {
        let nodes;
        if (ctx?.aliasResolveCache) {
          nodes = ctx.aliasResolveCache;
        } else {
          nodes = [];
          visit.visit(doc, {
            Node: (_key, node) => {
              if (identity.isAlias(node) || identity.hasAnchor(node))
                nodes.push(node);
            }
          });
          if (ctx)
            ctx.aliasResolveCache = nodes;
        }
        let found = void 0;
        for (const node of nodes) {
          if (node === this)
            break;
          if (node.anchor === this.source)
            found = node;
        }
        return found;
      }
      toJSON(_arg, ctx) {
        if (!ctx)
          return { source: this.source };
        const { anchors: anchors2, doc, maxAliasCount } = ctx;
        const source = this.resolve(doc, ctx);
        if (!source) {
          const msg = `Unresolved alias (the anchor must be set before the alias): ${this.source}`;
          throw new ReferenceError(msg);
        }
        let data = anchors2.get(source);
        if (!data) {
          toJS.toJS(source, null, ctx);
          data = anchors2.get(source);
        }
        if (data?.res === void 0) {
          const msg = "This should not happen: Alias anchor was not resolved?";
          throw new ReferenceError(msg);
        }
        if (maxAliasCount >= 0) {
          data.count += 1;
          if (data.aliasCount === 0)
            data.aliasCount = getAliasCount(doc, source, anchors2);
          if (data.count * data.aliasCount > maxAliasCount) {
            const msg = "Excessive alias count indicates a resource exhaustion attack";
            throw new ReferenceError(msg);
          }
        }
        return data.res;
      }
      toString(ctx, _onComment, _onChompKeep) {
        const src = `*${this.source}`;
        if (ctx) {
          anchors.anchorIsValid(this.source);
          if (ctx.options.verifyAliasOrder && !ctx.anchors.has(this.source)) {
            const msg = `Unresolved alias (the anchor must be set before the alias): ${this.source}`;
            throw new Error(msg);
          }
          if (ctx.implicitKey)
            return `${src} `;
        }
        return src;
      }
    };
    function getAliasCount(doc, node, anchors2) {
      if (identity.isAlias(node)) {
        const source = node.resolve(doc);
        const anchor = anchors2 && source && anchors2.get(source);
        return anchor ? anchor.count * anchor.aliasCount : 0;
      } else if (identity.isCollection(node)) {
        let count = 0;
        for (const item of node.items) {
          const c = getAliasCount(doc, item, anchors2);
          if (c > count)
            count = c;
        }
        return count;
      } else if (identity.isPair(node)) {
        const kc = getAliasCount(doc, node.key, anchors2);
        const vc = getAliasCount(doc, node.value, anchors2);
        return Math.max(kc, vc);
      }
      return 1;
    }
    exports2.Alias = Alias;
  }
});

// node_modules/yaml/dist/nodes/Scalar.js
var require_Scalar = __commonJS({
  "node_modules/yaml/dist/nodes/Scalar.js"(exports2) {
    "use strict";
    var identity = require_identity();
    var Node = require_Node();
    var toJS = require_toJS();
    var isScalarValue = (value) => !value || typeof value !== "function" && typeof value !== "object";
    var Scalar = class extends Node.NodeBase {
      constructor(value) {
        super(identity.SCALAR);
        this.value = value;
      }
      toJSON(arg, ctx) {
        return ctx?.keep ? this.value : toJS.toJS(this.value, arg, ctx);
      }
      toString() {
        return String(this.value);
      }
    };
    Scalar.BLOCK_FOLDED = "BLOCK_FOLDED";
    Scalar.BLOCK_LITERAL = "BLOCK_LITERAL";
    Scalar.PLAIN = "PLAIN";
    Scalar.QUOTE_DOUBLE = "QUOTE_DOUBLE";
    Scalar.QUOTE_SINGLE = "QUOTE_SINGLE";
    exports2.Scalar = Scalar;
    exports2.isScalarValue = isScalarValue;
  }
});

// node_modules/yaml/dist/doc/createNode.js
var require_createNode = __commonJS({
  "node_modules/yaml/dist/doc/createNode.js"(exports2) {
    "use strict";
    var Alias = require_Alias();
    var identity = require_identity();
    var Scalar = require_Scalar();
    var defaultTagPrefix = "tag:yaml.org,2002:";
    function findTagObject(value, tagName, tags) {
      if (tagName) {
        const match = tags.filter((t) => t.tag === tagName);
        const tagObj = match.find((t) => !t.format) ?? match[0];
        if (!tagObj)
          throw new Error(`Tag ${tagName} not found`);
        return tagObj;
      }
      return tags.find((t) => t.identify?.(value) && !t.format);
    }
    function createNode(value, tagName, ctx) {
      if (identity.isDocument(value))
        value = value.contents;
      if (identity.isNode(value))
        return value;
      if (identity.isPair(value)) {
        const map2 = ctx.schema[identity.MAP].createNode?.(ctx.schema, null, ctx);
        map2.items.push(value);
        return map2;
      }
      if (value instanceof String || value instanceof Number || value instanceof Boolean || typeof BigInt !== "undefined" && value instanceof BigInt) {
        value = value.valueOf();
      }
      const { aliasDuplicateObjects, onAnchor, onTagObj, schema, sourceObjects } = ctx;
      let ref = void 0;
      if (aliasDuplicateObjects && value && typeof value === "object") {
        ref = sourceObjects.get(value);
        if (ref) {
          ref.anchor ?? (ref.anchor = onAnchor(value));
          return new Alias.Alias(ref.anchor);
        } else {
          ref = { anchor: null, node: null };
          sourceObjects.set(value, ref);
        }
      }
      if (tagName?.startsWith("!!"))
        tagName = defaultTagPrefix + tagName.slice(2);
      let tagObj = findTagObject(value, tagName, schema.tags);
      if (!tagObj) {
        if (value && typeof value.toJSON === "function") {
          value = value.toJSON();
        }
        if (!value || typeof value !== "object") {
          const node2 = new Scalar.Scalar(value);
          if (ref)
            ref.node = node2;
          return node2;
        }
        tagObj = value instanceof Map ? schema[identity.MAP] : Symbol.iterator in Object(value) ? schema[identity.SEQ] : schema[identity.MAP];
      }
      if (onTagObj) {
        onTagObj(tagObj);
        delete ctx.onTagObj;
      }
      const node = tagObj?.createNode ? tagObj.createNode(ctx.schema, value, ctx) : typeof tagObj?.nodeClass?.from === "function" ? tagObj.nodeClass.from(ctx.schema, value, ctx) : new Scalar.Scalar(value);
      if (tagName)
        node.tag = tagName;
      else if (!tagObj.default)
        node.tag = tagObj.tag;
      if (ref)
        ref.node = node;
      return node;
    }
    exports2.createNode = createNode;
  }
});

// node_modules/yaml/dist/nodes/Collection.js
var require_Collection = __commonJS({
  "node_modules/yaml/dist/nodes/Collection.js"(exports2) {
    "use strict";
    var createNode = require_createNode();
    var identity = require_identity();
    var Node = require_Node();
    function collectionFromPath(schema, path, value) {
      let v = value;
      for (let i = path.length - 1; i >= 0; --i) {
        const k = path[i];
        if (typeof k === "number" && Number.isInteger(k) && k >= 0) {
          const a = [];
          a[k] = v;
          v = a;
        } else {
          v = /* @__PURE__ */ new Map([[k, v]]);
        }
      }
      return createNode.createNode(v, void 0, {
        aliasDuplicateObjects: false,
        keepUndefined: false,
        onAnchor: () => {
          throw new Error("This should not happen, please report a bug.");
        },
        schema,
        sourceObjects: /* @__PURE__ */ new Map()
      });
    }
    var isEmptyPath = (path) => path == null || typeof path === "object" && !!path[Symbol.iterator]().next().done;
    var Collection = class extends Node.NodeBase {
      constructor(type, schema) {
        super(type);
        Object.defineProperty(this, "schema", {
          value: schema,
          configurable: true,
          enumerable: false,
          writable: true
        });
      }
      /**
       * Create a copy of this collection.
       *
       * @param schema - If defined, overwrites the original's schema
       */
      clone(schema) {
        const copy = Object.create(Object.getPrototypeOf(this), Object.getOwnPropertyDescriptors(this));
        if (schema)
          copy.schema = schema;
        copy.items = copy.items.map((it) => identity.isNode(it) || identity.isPair(it) ? it.clone(schema) : it);
        if (this.range)
          copy.range = this.range.slice();
        return copy;
      }
      /**
       * Adds a value to the collection. For `!!map` and `!!omap` the value must
       * be a Pair instance or a `{ key, value }` object, which may not have a key
       * that already exists in the map.
       */
      addIn(path, value) {
        if (isEmptyPath(path))
          this.add(value);
        else {
          const [key, ...rest] = path;
          const node = this.get(key, true);
          if (identity.isCollection(node))
            node.addIn(rest, value);
          else if (node === void 0 && this.schema)
            this.set(key, collectionFromPath(this.schema, rest, value));
          else
            throw new Error(`Expected YAML collection at ${key}. Remaining path: ${rest}`);
        }
      }
      /**
       * Removes a value from the collection.
       * @returns `true` if the item was found and removed.
       */
      deleteIn(path) {
        const [key, ...rest] = path;
        if (rest.length === 0)
          return this.delete(key);
        const node = this.get(key, true);
        if (identity.isCollection(node))
          return node.deleteIn(rest);
        else
          throw new Error(`Expected YAML collection at ${key}. Remaining path: ${rest}`);
      }
      /**
       * Returns item at `key`, or `undefined` if not found. By default unwraps
       * scalar values from their surrounding node; to disable set `keepScalar` to
       * `true` (collections are always returned intact).
       */
      getIn(path, keepScalar) {
        const [key, ...rest] = path;
        const node = this.get(key, true);
        if (rest.length === 0)
          return !keepScalar && identity.isScalar(node) ? node.value : node;
        else
          return identity.isCollection(node) ? node.getIn(rest, keepScalar) : void 0;
      }
      hasAllNullValues(allowScalar) {
        return this.items.every((node) => {
          if (!identity.isPair(node))
            return false;
          const n = node.value;
          return n == null || allowScalar && identity.isScalar(n) && n.value == null && !n.commentBefore && !n.comment && !n.tag;
        });
      }
      /**
       * Checks if the collection includes a value with the key `key`.
       */
      hasIn(path) {
        const [key, ...rest] = path;
        if (rest.length === 0)
          return this.has(key);
        const node = this.get(key, true);
        return identity.isCollection(node) ? node.hasIn(rest) : false;
      }
      /**
       * Sets a value in this collection. For `!!set`, `value` needs to be a
       * boolean to add/remove the item from the set.
       */
      setIn(path, value) {
        const [key, ...rest] = path;
        if (rest.length === 0) {
          this.set(key, value);
        } else {
          const node = this.get(key, true);
          if (identity.isCollection(node))
            node.setIn(rest, value);
          else if (node === void 0 && this.schema)
            this.set(key, collectionFromPath(this.schema, rest, value));
          else
            throw new Error(`Expected YAML collection at ${key}. Remaining path: ${rest}`);
        }
      }
    };
    exports2.Collection = Collection;
    exports2.collectionFromPath = collectionFromPath;
    exports2.isEmptyPath = isEmptyPath;
  }
});

// node_modules/yaml/dist/stringify/stringifyComment.js
var require_stringifyComment = __commonJS({
  "node_modules/yaml/dist/stringify/stringifyComment.js"(exports2) {
    "use strict";
    var stringifyComment = (str) => str.replace(/^(?!$)(?: $)?/gm, "#");
    function indentComment(comment, indent) {
      if (/^\n+$/.test(comment))
        return comment.substring(1);
      return indent ? comment.replace(/^(?! *$)/gm, indent) : comment;
    }
    var lineComment = (str, indent, comment) => str.endsWith("\n") ? indentComment(comment, indent) : comment.includes("\n") ? "\n" + indentComment(comment, indent) : (str.endsWith(" ") ? "" : " ") + comment;
    exports2.indentComment = indentComment;
    exports2.lineComment = lineComment;
    exports2.stringifyComment = stringifyComment;
  }
});

// node_modules/yaml/dist/stringify/foldFlowLines.js
var require_foldFlowLines = __commonJS({
  "node_modules/yaml/dist/stringify/foldFlowLines.js"(exports2) {
    "use strict";
    var FOLD_FLOW = "flow";
    var FOLD_BLOCK = "block";
    var FOLD_QUOTED = "quoted";
    function foldFlowLines(text, indent, mode = "flow", { indentAtStart, lineWidth = 80, minContentWidth = 20, onFold, onOverflow } = {}) {
      if (!lineWidth || lineWidth < 0)
        return text;
      if (lineWidth < minContentWidth)
        minContentWidth = 0;
      const endStep = Math.max(1 + minContentWidth, 1 + lineWidth - indent.length);
      if (text.length <= endStep)
        return text;
      const folds = [];
      const escapedFolds = {};
      let end = lineWidth - indent.length;
      if (typeof indentAtStart === "number") {
        if (indentAtStart > lineWidth - Math.max(2, minContentWidth))
          folds.push(0);
        else
          end = lineWidth - indentAtStart;
      }
      let split = void 0;
      let prev = void 0;
      let overflow = false;
      let i = -1;
      let escStart = -1;
      let escEnd = -1;
      if (mode === FOLD_BLOCK) {
        i = consumeMoreIndentedLines(text, i, indent.length);
        if (i !== -1)
          end = i + endStep;
      }
      for (let ch; ch = text[i += 1]; ) {
        if (mode === FOLD_QUOTED && ch === "\\") {
          escStart = i;
          switch (text[i + 1]) {
            case "x":
              i += 3;
              break;
            case "u":
              i += 5;
              break;
            case "U":
              i += 9;
              break;
            default:
              i += 1;
          }
          escEnd = i;
        }
        if (ch === "\n") {
          if (mode === FOLD_BLOCK)
            i = consumeMoreIndentedLines(text, i, indent.length);
          end = i + indent.length + endStep;
          split = void 0;
        } else {
          if (ch === " " && prev && prev !== " " && prev !== "\n" && prev !== "	") {
            const next = text[i + 1];
            if (next && next !== " " && next !== "\n" && next !== "	")
              split = i;
          }
          if (i >= end) {
            if (split) {
              folds.push(split);
              end = split + endStep;
              split = void 0;
            } else if (mode === FOLD_QUOTED) {
              while (prev === " " || prev === "	") {
                prev = ch;
                ch = text[i += 1];
                overflow = true;
              }
              const j = i > escEnd + 1 ? i - 2 : escStart - 1;
              if (escapedFolds[j])
                return text;
              folds.push(j);
              escapedFolds[j] = true;
              end = j + endStep;
              split = void 0;
            } else {
              overflow = true;
            }
          }
        }
        prev = ch;
      }
      if (overflow && onOverflow)
        onOverflow();
      if (folds.length === 0)
        return text;
      if (onFold)
        onFold();
      let res = text.slice(0, folds[0]);
      for (let i2 = 0; i2 < folds.length; ++i2) {
        const fold = folds[i2];
        const end2 = folds[i2 + 1] || text.length;
        if (fold === 0)
          res = `
${indent}${text.slice(0, end2)}`;
        else {
          if (mode === FOLD_QUOTED && escapedFolds[fold])
            res += `${text[fold]}\\`;
          res += `
${indent}${text.slice(fold + 1, end2)}`;
        }
      }
      return res;
    }
    function consumeMoreIndentedLines(text, i, indent) {
      let end = i;
      let start = i + 1;
      let ch = text[start];
      while (ch === " " || ch === "	") {
        if (i < start + indent) {
          ch = text[++i];
        } else {
          do {
            ch = text[++i];
          } while (ch && ch !== "\n");
          end = i;
          start = i + 1;
          ch = text[start];
        }
      }
      return end;
    }
    exports2.FOLD_BLOCK = FOLD_BLOCK;
    exports2.FOLD_FLOW = FOLD_FLOW;
    exports2.FOLD_QUOTED = FOLD_QUOTED;
    exports2.foldFlowLines = foldFlowLines;
  }
});

// node_modules/yaml/dist/stringify/stringifyString.js
var require_stringifyString = __commonJS({
  "node_modules/yaml/dist/stringify/stringifyString.js"(exports2) {
    "use strict";
    var Scalar = require_Scalar();
    var foldFlowLines = require_foldFlowLines();
    var getFoldOptions = (ctx, isBlock) => ({
      indentAtStart: isBlock ? ctx.indent.length : ctx.indentAtStart,
      lineWidth: ctx.options.lineWidth,
      minContentWidth: ctx.options.minContentWidth
    });
    var containsDocumentMarker = (str) => /^(%|---|\.\.\.)/m.test(str);
    function lineLengthOverLimit(str, lineWidth, indentLength) {
      if (!lineWidth || lineWidth < 0)
        return false;
      const limit = lineWidth - indentLength;
      const strLen = str.length;
      if (strLen <= limit)
        return false;
      for (let i = 0, start = 0; i < strLen; ++i) {
        if (str[i] === "\n") {
          if (i - start > limit)
            return true;
          start = i + 1;
          if (strLen - start <= limit)
            return false;
        }
      }
      return true;
    }
    function doubleQuotedString(value, ctx) {
      const json2 = JSON.stringify(value);
      if (ctx.options.doubleQuotedAsJSON)
        return json2;
      const { implicitKey } = ctx;
      const minMultiLineLength = ctx.options.doubleQuotedMinMultiLineLength;
      const indent = ctx.indent || (containsDocumentMarker(value) ? "  " : "");
      let str = "";
      let start = 0;
      for (let i = 0, ch = json2[i]; ch; ch = json2[++i]) {
        if (ch === " " && json2[i + 1] === "\\" && json2[i + 2] === "n") {
          str += json2.slice(start, i) + "\\ ";
          i += 1;
          start = i;
          ch = "\\";
        }
        if (ch === "\\")
          switch (json2[i + 1]) {
            case "u":
              {
                str += json2.slice(start, i);
                const code = json2.substr(i + 2, 4);
                switch (code) {
                  case "0000":
                    str += "\\0";
                    break;
                  case "0007":
                    str += "\\a";
                    break;
                  case "000b":
                    str += "\\v";
                    break;
                  case "001b":
                    str += "\\e";
                    break;
                  case "0085":
                    str += "\\N";
                    break;
                  case "00a0":
                    str += "\\_";
                    break;
                  case "2028":
                    str += "\\L";
                    break;
                  case "2029":
                    str += "\\P";
                    break;
                  default:
                    if (code.substr(0, 2) === "00")
                      str += "\\x" + code.substr(2);
                    else
                      str += json2.substr(i, 6);
                }
                i += 5;
                start = i + 1;
              }
              break;
            case "n":
              if (implicitKey || json2[i + 2] === '"' || json2.length < minMultiLineLength) {
                i += 1;
              } else {
                str += json2.slice(start, i) + "\n\n";
                while (json2[i + 2] === "\\" && json2[i + 3] === "n" && json2[i + 4] !== '"') {
                  str += "\n";
                  i += 2;
                }
                str += indent;
                if (json2[i + 2] === " ")
                  str += "\\";
                i += 1;
                start = i + 1;
              }
              break;
            default:
              i += 1;
          }
      }
      str = start ? str + json2.slice(start) : json2;
      return implicitKey ? str : foldFlowLines.foldFlowLines(str, indent, foldFlowLines.FOLD_QUOTED, getFoldOptions(ctx, false));
    }
    function singleQuotedString(value, ctx) {
      if (ctx.options.singleQuote === false || ctx.implicitKey && value.includes("\n") || /[ \t]\n|\n[ \t]/.test(value))
        return doubleQuotedString(value, ctx);
      const indent = ctx.indent || (containsDocumentMarker(value) ? "  " : "");
      const res = "'" + value.replace(/'/g, "''").replace(/\n+/g, `$&
${indent}`) + "'";
      return ctx.implicitKey ? res : foldFlowLines.foldFlowLines(res, indent, foldFlowLines.FOLD_FLOW, getFoldOptions(ctx, false));
    }
    function quotedString(value, ctx) {
      const { singleQuote } = ctx.options;
      let qs;
      if (singleQuote === false)
        qs = doubleQuotedString;
      else {
        const hasDouble = value.includes('"');
        const hasSingle = value.includes("'");
        if (hasDouble && !hasSingle)
          qs = singleQuotedString;
        else if (hasSingle && !hasDouble)
          qs = doubleQuotedString;
        else
          qs = singleQuote ? singleQuotedString : doubleQuotedString;
      }
      return qs(value, ctx);
    }
    var blockEndNewlines;
    try {
      blockEndNewlines = new RegExp("(^|(?<!\n))\n+(?!\n|$)", "g");
    } catch {
      blockEndNewlines = /\n+(?!\n|$)/g;
    }
    function blockString({ comment, type, value }, ctx, onComment, onChompKeep) {
      const { blockQuote, commentString, lineWidth } = ctx.options;
      if (!blockQuote || /\n[\t ]+$/.test(value)) {
        return quotedString(value, ctx);
      }
      const indent = ctx.indent || (ctx.forceBlockIndent || containsDocumentMarker(value) ? "  " : "");
      const literal2 = blockQuote === "literal" ? true : blockQuote === "folded" || type === Scalar.Scalar.BLOCK_FOLDED ? false : type === Scalar.Scalar.BLOCK_LITERAL ? true : !lineLengthOverLimit(value, lineWidth, indent.length);
      if (!value)
        return literal2 ? "|\n" : ">\n";
      let chomp;
      let endStart;
      for (endStart = value.length; endStart > 0; --endStart) {
        const ch = value[endStart - 1];
        if (ch !== "\n" && ch !== "	" && ch !== " ")
          break;
      }
      let end = value.substring(endStart);
      const endNlPos = end.indexOf("\n");
      if (endNlPos === -1) {
        chomp = "-";
      } else if (value === end || endNlPos !== end.length - 1) {
        chomp = "+";
        if (onChompKeep)
          onChompKeep();
      } else {
        chomp = "";
      }
      if (end) {
        value = value.slice(0, -end.length);
        if (end[end.length - 1] === "\n")
          end = end.slice(0, -1);
        end = end.replace(blockEndNewlines, `$&${indent}`);
      }
      let startWithSpace = false;
      let startEnd;
      let startNlPos = -1;
      for (startEnd = 0; startEnd < value.length; ++startEnd) {
        const ch = value[startEnd];
        if (ch === " ")
          startWithSpace = true;
        else if (ch === "\n")
          startNlPos = startEnd;
        else
          break;
      }
      let start = value.substring(0, startNlPos < startEnd ? startNlPos + 1 : startEnd);
      if (start) {
        value = value.substring(start.length);
        start = start.replace(/\n+/g, `$&${indent}`);
      }
      const indentSize = indent ? "2" : "1";
      let header = (startWithSpace ? indentSize : "") + chomp;
      if (comment) {
        header += " " + commentString(comment.replace(/ ?[\r\n]+/g, " "));
        if (onComment)
          onComment();
      }
      if (!literal2) {
        const foldedValue = value.replace(/\n+/g, "\n$&").replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g, "$1$2").replace(/\n+/g, `$&${indent}`);
        let literalFallback = false;
        const foldOptions = getFoldOptions(ctx, true);
        if (blockQuote !== "folded" && type !== Scalar.Scalar.BLOCK_FOLDED) {
          foldOptions.onOverflow = () => {
            literalFallback = true;
          };
        }
        const body = foldFlowLines.foldFlowLines(`${start}${foldedValue}${end}`, indent, foldFlowLines.FOLD_BLOCK, foldOptions);
        if (!literalFallback)
          return `>${header}
${indent}${body}`;
      }
      value = value.replace(/\n+/g, `$&${indent}`);
      return `|${header}
${indent}${start}${value}${end}`;
    }
    function plainString(item, ctx, onComment, onChompKeep) {
      const { type, value } = item;
      const { actualString, implicitKey, indent, indentStep, inFlow } = ctx;
      if (implicitKey && value.includes("\n") || inFlow && /[[\]{},]/.test(value)) {
        return quotedString(value, ctx);
      }
      if (/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(value)) {
        return implicitKey || inFlow || !value.includes("\n") ? quotedString(value, ctx) : blockString(item, ctx, onComment, onChompKeep);
      }
      if (!implicitKey && !inFlow && type !== Scalar.Scalar.PLAIN && value.includes("\n")) {
        return blockString(item, ctx, onComment, onChompKeep);
      }
      if (containsDocumentMarker(value)) {
        if (indent === "") {
          ctx.forceBlockIndent = true;
          return blockString(item, ctx, onComment, onChompKeep);
        } else if (implicitKey && indent === indentStep) {
          return quotedString(value, ctx);
        }
      }
      const str = value.replace(/\n+/g, `$&
${indent}`);
      if (actualString) {
        const test = (tag) => tag.default && tag.tag !== "tag:yaml.org,2002:str" && tag.test?.test(str);
        const { compat, tags } = ctx.doc.schema;
        if (tags.some(test) || compat?.some(test))
          return quotedString(value, ctx);
      }
      return implicitKey ? str : foldFlowLines.foldFlowLines(str, indent, foldFlowLines.FOLD_FLOW, getFoldOptions(ctx, false));
    }
    function stringifyString(item, ctx, onComment, onChompKeep) {
      const { implicitKey, inFlow } = ctx;
      const ss = typeof item.value === "string" ? item : Object.assign({}, item, { value: String(item.value) });
      let { type } = item;
      if (type !== Scalar.Scalar.QUOTE_DOUBLE) {
        if (/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(ss.value))
          type = Scalar.Scalar.QUOTE_DOUBLE;
      }
      const _stringify = (_type) => {
        switch (_type) {
          case Scalar.Scalar.BLOCK_FOLDED:
          case Scalar.Scalar.BLOCK_LITERAL:
            return implicitKey || inFlow ? quotedString(ss.value, ctx) : blockString(ss, ctx, onComment, onChompKeep);
          case Scalar.Scalar.QUOTE_DOUBLE:
            return doubleQuotedString(ss.value, ctx);
          case Scalar.Scalar.QUOTE_SINGLE:
            return singleQuotedString(ss.value, ctx);
          case Scalar.Scalar.PLAIN:
            return plainString(ss, ctx, onComment, onChompKeep);
          default:
            return null;
        }
      };
      let res = _stringify(type);
      if (res === null) {
        const { defaultKeyType, defaultStringType } = ctx.options;
        const t = implicitKey && defaultKeyType || defaultStringType;
        res = _stringify(t);
        if (res === null)
          throw new Error(`Unsupported default string type ${t}`);
      }
      return res;
    }
    exports2.stringifyString = stringifyString;
  }
});

// node_modules/yaml/dist/stringify/stringify.js
var require_stringify = __commonJS({
  "node_modules/yaml/dist/stringify/stringify.js"(exports2) {
    "use strict";
    var anchors = require_anchors();
    var identity = require_identity();
    var stringifyComment = require_stringifyComment();
    var stringifyString = require_stringifyString();
    function createStringifyContext(doc, options2) {
      const opt = Object.assign({
        blockQuote: true,
        commentString: stringifyComment.stringifyComment,
        defaultKeyType: null,
        defaultStringType: "PLAIN",
        directives: null,
        doubleQuotedAsJSON: false,
        doubleQuotedMinMultiLineLength: 40,
        falseStr: "false",
        flowCollectionPadding: true,
        indentSeq: true,
        lineWidth: 80,
        minContentWidth: 20,
        nullStr: "null",
        simpleKeys: false,
        singleQuote: null,
        trailingComma: false,
        trueStr: "true",
        verifyAliasOrder: true
      }, doc.schema.toStringOptions, options2);
      let inFlow;
      switch (opt.collectionStyle) {
        case "block":
          inFlow = false;
          break;
        case "flow":
          inFlow = true;
          break;
        default:
          inFlow = null;
      }
      return {
        anchors: /* @__PURE__ */ new Set(),
        doc,
        flowCollectionPadding: opt.flowCollectionPadding ? " " : "",
        indent: "",
        indentStep: typeof opt.indent === "number" ? " ".repeat(opt.indent) : "  ",
        inFlow,
        options: opt
      };
    }
    function getTagObject(tags, item) {
      if (item.tag) {
        const match = tags.filter((t) => t.tag === item.tag);
        if (match.length > 0)
          return match.find((t) => t.format === item.format) ?? match[0];
      }
      let tagObj = void 0;
      let obj;
      if (identity.isScalar(item)) {
        obj = item.value;
        let match = tags.filter((t) => t.identify?.(obj));
        if (match.length > 1) {
          const testMatch = match.filter((t) => t.test);
          if (testMatch.length > 0)
            match = testMatch;
        }
        tagObj = match.find((t) => t.format === item.format) ?? match.find((t) => !t.format);
      } else {
        obj = item;
        tagObj = tags.find((t) => t.nodeClass && obj instanceof t.nodeClass);
      }
      if (!tagObj) {
        const name = obj?.constructor?.name ?? (obj === null ? "null" : typeof obj);
        throw new Error(`Tag not resolved for ${name} value`);
      }
      return tagObj;
    }
    function stringifyProps(node, tagObj, { anchors: anchors$1, doc }) {
      if (!doc.directives)
        return "";
      const props = [];
      const anchor = (identity.isScalar(node) || identity.isCollection(node)) && node.anchor;
      if (anchor && anchors.anchorIsValid(anchor)) {
        anchors$1.add(anchor);
        props.push(`&${anchor}`);
      }
      const tag = node.tag ?? (tagObj.default ? null : tagObj.tag);
      if (tag)
        props.push(doc.directives.tagString(tag));
      return props.join(" ");
    }
    function stringify(item, ctx, onComment, onChompKeep) {
      if (identity.isPair(item))
        return item.toString(ctx, onComment, onChompKeep);
      if (identity.isAlias(item)) {
        if (ctx.doc.directives)
          return item.toString(ctx);
        if (ctx.resolvedAliases?.has(item)) {
          throw new TypeError(`Cannot stringify circular structure without alias nodes`);
        } else {
          if (ctx.resolvedAliases)
            ctx.resolvedAliases.add(item);
          else
            ctx.resolvedAliases = /* @__PURE__ */ new Set([item]);
          item = item.resolve(ctx.doc);
        }
      }
      let tagObj = void 0;
      const node = identity.isNode(item) ? item : ctx.doc.createNode(item, { onTagObj: (o) => tagObj = o });
      tagObj ?? (tagObj = getTagObject(ctx.doc.schema.tags, node));
      const props = stringifyProps(node, tagObj, ctx);
      if (props.length > 0)
        ctx.indentAtStart = (ctx.indentAtStart ?? 0) + props.length + 1;
      const str = typeof tagObj.stringify === "function" ? tagObj.stringify(node, ctx, onComment, onChompKeep) : identity.isScalar(node) ? stringifyString.stringifyString(node, ctx, onComment, onChompKeep) : node.toString(ctx, onComment, onChompKeep);
      if (!props)
        return str;
      return identity.isScalar(node) || str[0] === "{" || str[0] === "[" ? `${props} ${str}` : `${props}
${ctx.indent}${str}`;
    }
    exports2.createStringifyContext = createStringifyContext;
    exports2.stringify = stringify;
  }
});

// node_modules/yaml/dist/stringify/stringifyPair.js
var require_stringifyPair = __commonJS({
  "node_modules/yaml/dist/stringify/stringifyPair.js"(exports2) {
    "use strict";
    var identity = require_identity();
    var Scalar = require_Scalar();
    var stringify = require_stringify();
    var stringifyComment = require_stringifyComment();
    function stringifyPair({ key, value }, ctx, onComment, onChompKeep) {
      const { allNullValues, doc, indent, indentStep, options: { commentString, indentSeq, simpleKeys } } = ctx;
      let keyComment = identity.isNode(key) && key.comment || null;
      if (simpleKeys) {
        if (keyComment) {
          throw new Error("With simple keys, key nodes cannot have comments");
        }
        if (identity.isCollection(key) || !identity.isNode(key) && typeof key === "object") {
          const msg = "With simple keys, collection cannot be used as a key value";
          throw new Error(msg);
        }
      }
      let explicitKey = !simpleKeys && (!key || keyComment && value == null && !ctx.inFlow || identity.isCollection(key) || (identity.isScalar(key) ? key.type === Scalar.Scalar.BLOCK_FOLDED || key.type === Scalar.Scalar.BLOCK_LITERAL : typeof key === "object"));
      ctx = Object.assign({}, ctx, {
        allNullValues: false,
        implicitKey: !explicitKey && (simpleKeys || !allNullValues),
        indent: indent + indentStep
      });
      let keyCommentDone = false;
      let chompKeep = false;
      let str = stringify.stringify(key, ctx, () => keyCommentDone = true, () => chompKeep = true);
      if (!explicitKey && !ctx.inFlow && str.length > 1024) {
        if (simpleKeys)
          throw new Error("With simple keys, single line scalar must not span more than 1024 characters");
        explicitKey = true;
      }
      if (ctx.inFlow) {
        if (allNullValues || value == null) {
          if (keyCommentDone && onComment)
            onComment();
          return str === "" ? "?" : explicitKey ? `? ${str}` : str;
        }
      } else if (allNullValues && !simpleKeys || value == null && explicitKey) {
        str = `? ${str}`;
        if (keyComment && !keyCommentDone) {
          str += stringifyComment.lineComment(str, ctx.indent, commentString(keyComment));
        } else if (chompKeep && onChompKeep)
          onChompKeep();
        return str;
      }
      if (keyCommentDone)
        keyComment = null;
      if (explicitKey) {
        if (keyComment)
          str += stringifyComment.lineComment(str, ctx.indent, commentString(keyComment));
        str = `? ${str}
${indent}:`;
      } else {
        str = `${str}:`;
        if (keyComment)
          str += stringifyComment.lineComment(str, ctx.indent, commentString(keyComment));
      }
      let vsb, vcb, valueComment;
      if (identity.isNode(value)) {
        vsb = !!value.spaceBefore;
        vcb = value.commentBefore;
        valueComment = value.comment;
      } else {
        vsb = false;
        vcb = null;
        valueComment = null;
        if (value && typeof value === "object")
          value = doc.createNode(value);
      }
      ctx.implicitKey = false;
      if (!explicitKey && !keyComment && identity.isScalar(value))
        ctx.indentAtStart = str.length + 1;
      chompKeep = false;
      if (!indentSeq && indentStep.length >= 2 && !ctx.inFlow && !explicitKey && identity.isSeq(value) && !value.flow && !value.tag && !value.anchor) {
        ctx.indent = ctx.indent.substring(2);
      }
      let valueCommentDone = false;
      const valueStr = stringify.stringify(value, ctx, () => valueCommentDone = true, () => chompKeep = true);
      let ws2 = " ";
      if (keyComment || vsb || vcb) {
        ws2 = vsb ? "\n" : "";
        if (vcb) {
          const cs = commentString(vcb);
          ws2 += `
${stringifyComment.indentComment(cs, ctx.indent)}`;
        }
        if (valueStr === "" && !ctx.inFlow) {
          if (ws2 === "\n" && valueComment)
            ws2 = "\n\n";
        } else {
          ws2 += `
${ctx.indent}`;
        }
      } else if (!explicitKey && identity.isCollection(value)) {
        const vs0 = valueStr[0];
        const nl0 = valueStr.indexOf("\n");
        const hasNewline = nl0 !== -1;
        const flow = ctx.inFlow ?? value.flow ?? value.items.length === 0;
        if (hasNewline || !flow) {
          let hasPropsLine = false;
          if (hasNewline && (vs0 === "&" || vs0 === "!")) {
            let sp0 = valueStr.indexOf(" ");
            if (vs0 === "&" && sp0 !== -1 && sp0 < nl0 && valueStr[sp0 + 1] === "!") {
              sp0 = valueStr.indexOf(" ", sp0 + 1);
            }
            if (sp0 === -1 || nl0 < sp0)
              hasPropsLine = true;
          }
          if (!hasPropsLine)
            ws2 = `
${ctx.indent}`;
        }
      } else if (valueStr === "" || valueStr[0] === "\n") {
        ws2 = "";
      }
      str += ws2 + valueStr;
      if (ctx.inFlow) {
        if (valueCommentDone && onComment)
          onComment();
      } else if (valueComment && !valueCommentDone) {
        str += stringifyComment.lineComment(str, ctx.indent, commentString(valueComment));
      } else if (chompKeep && onChompKeep) {
        onChompKeep();
      }
      return str;
    }
    exports2.stringifyPair = stringifyPair;
  }
});

// node_modules/yaml/dist/log.js
var require_log = __commonJS({
  "node_modules/yaml/dist/log.js"(exports2) {
    "use strict";
    var node_process = require("process");
    function debug2(logLevel, ...messages) {
      if (logLevel === "debug")
        console.log(...messages);
    }
    function warn(logLevel, warning) {
      if (logLevel === "debug" || logLevel === "warn") {
        if (typeof node_process.emitWarning === "function")
          node_process.emitWarning(warning);
        else
          console.warn(warning);
      }
    }
    exports2.debug = debug2;
    exports2.warn = warn;
  }
});

// node_modules/yaml/dist/schema/yaml-1.1/merge.js
var require_merge = __commonJS({
  "node_modules/yaml/dist/schema/yaml-1.1/merge.js"(exports2) {
    "use strict";
    var identity = require_identity();
    var Scalar = require_Scalar();
    var MERGE_KEY = "<<";
    var merge2 = {
      identify: (value) => value === MERGE_KEY || typeof value === "symbol" && value.description === MERGE_KEY,
      default: "key",
      tag: "tag:yaml.org,2002:merge",
      test: /^<<$/,
      resolve: () => Object.assign(new Scalar.Scalar(Symbol(MERGE_KEY)), {
        addToJSMap: addMergeToJSMap
      }),
      stringify: () => MERGE_KEY
    };
    var isMergeKey = (ctx, key) => (merge2.identify(key) || identity.isScalar(key) && (!key.type || key.type === Scalar.Scalar.PLAIN) && merge2.identify(key.value)) && ctx?.doc.schema.tags.some((tag) => tag.tag === merge2.tag && tag.default);
    function addMergeToJSMap(ctx, map2, value) {
      value = ctx && identity.isAlias(value) ? value.resolve(ctx.doc) : value;
      if (identity.isSeq(value))
        for (const it of value.items)
          mergeValue(ctx, map2, it);
      else if (Array.isArray(value))
        for (const it of value)
          mergeValue(ctx, map2, it);
      else
        mergeValue(ctx, map2, value);
    }
    function mergeValue(ctx, map2, value) {
      const source = ctx && identity.isAlias(value) ? value.resolve(ctx.doc) : value;
      if (!identity.isMap(source))
        throw new Error("Merge sources must be maps or map aliases");
      const srcMap = source.toJSON(null, ctx, Map);
      for (const [key, value2] of srcMap) {
        if (map2 instanceof Map) {
          if (!map2.has(key))
            map2.set(key, value2);
        } else if (map2 instanceof Set) {
          map2.add(key);
        } else if (!Object.prototype.hasOwnProperty.call(map2, key)) {
          Object.defineProperty(map2, key, {
            value: value2,
            writable: true,
            enumerable: true,
            configurable: true
          });
        }
      }
      return map2;
    }
    exports2.addMergeToJSMap = addMergeToJSMap;
    exports2.isMergeKey = isMergeKey;
    exports2.merge = merge2;
  }
});

// node_modules/yaml/dist/nodes/addPairToJSMap.js
var require_addPairToJSMap = __commonJS({
  "node_modules/yaml/dist/nodes/addPairToJSMap.js"(exports2) {
    "use strict";
    var log = require_log();
    var merge2 = require_merge();
    var stringify = require_stringify();
    var identity = require_identity();
    var toJS = require_toJS();
    function addPairToJSMap(ctx, map2, { key, value }) {
      if (identity.isNode(key) && key.addToJSMap)
        key.addToJSMap(ctx, map2, value);
      else if (merge2.isMergeKey(ctx, key))
        merge2.addMergeToJSMap(ctx, map2, value);
      else {
        const jsKey = toJS.toJS(key, "", ctx);
        if (map2 instanceof Map) {
          map2.set(jsKey, toJS.toJS(value, jsKey, ctx));
        } else if (map2 instanceof Set) {
          map2.add(jsKey);
        } else {
          const stringKey = stringifyKey(key, jsKey, ctx);
          const jsValue = toJS.toJS(value, stringKey, ctx);
          if (stringKey in map2)
            Object.defineProperty(map2, stringKey, {
              value: jsValue,
              writable: true,
              enumerable: true,
              configurable: true
            });
          else
            map2[stringKey] = jsValue;
        }
      }
      return map2;
    }
    function stringifyKey(key, jsKey, ctx) {
      if (jsKey === null)
        return "";
      if (typeof jsKey !== "object")
        return String(jsKey);
      if (identity.isNode(key) && ctx?.doc) {
        const strCtx = stringify.createStringifyContext(ctx.doc, {});
        strCtx.anchors = /* @__PURE__ */ new Set();
        for (const node of ctx.anchors.keys())
          strCtx.anchors.add(node.anchor);
        strCtx.inFlow = true;
        strCtx.inStringifyKey = true;
        const strKey = key.toString(strCtx);
        if (!ctx.mapKeyWarned) {
          let jsonStr = JSON.stringify(strKey);
          if (jsonStr.length > 40)
            jsonStr = jsonStr.substring(0, 36) + '..."';
          log.warn(ctx.doc.options.logLevel, `Keys with collection values will be stringified due to JS Object restrictions: ${jsonStr}. Set mapAsMap: true to use object keys.`);
          ctx.mapKeyWarned = true;
        }
        return strKey;
      }
      return JSON.stringify(jsKey);
    }
    exports2.addPairToJSMap = addPairToJSMap;
  }
});

// node_modules/yaml/dist/nodes/Pair.js
var require_Pair = __commonJS({
  "node_modules/yaml/dist/nodes/Pair.js"(exports2) {
    "use strict";
    var createNode = require_createNode();
    var stringifyPair = require_stringifyPair();
    var addPairToJSMap = require_addPairToJSMap();
    var identity = require_identity();
    function createPair(key, value, ctx) {
      const k = createNode.createNode(key, void 0, ctx);
      const v = createNode.createNode(value, void 0, ctx);
      return new Pair(k, v);
    }
    var Pair = class _Pair {
      constructor(key, value = null) {
        Object.defineProperty(this, identity.NODE_TYPE, { value: identity.PAIR });
        this.key = key;
        this.value = value;
      }
      clone(schema) {
        let { key, value } = this;
        if (identity.isNode(key))
          key = key.clone(schema);
        if (identity.isNode(value))
          value = value.clone(schema);
        return new _Pair(key, value);
      }
      toJSON(_, ctx) {
        const pair = ctx?.mapAsMap ? /* @__PURE__ */ new Map() : {};
        return addPairToJSMap.addPairToJSMap(ctx, pair, this);
      }
      toString(ctx, onComment, onChompKeep) {
        return ctx?.doc ? stringifyPair.stringifyPair(this, ctx, onComment, onChompKeep) : JSON.stringify(this);
      }
    };
    exports2.Pair = Pair;
    exports2.createPair = createPair;
  }
});

// node_modules/yaml/dist/stringify/stringifyCollection.js
var require_stringifyCollection = __commonJS({
  "node_modules/yaml/dist/stringify/stringifyCollection.js"(exports2) {
    "use strict";
    var identity = require_identity();
    var stringify = require_stringify();
    var stringifyComment = require_stringifyComment();
    function stringifyCollection(collection, ctx, options2) {
      const flow = ctx.inFlow ?? collection.flow;
      const stringify2 = flow ? stringifyFlowCollection : stringifyBlockCollection;
      return stringify2(collection, ctx, options2);
    }
    function stringifyBlockCollection({ comment, items }, ctx, { blockItemPrefix, flowChars, itemIndent, onChompKeep, onComment }) {
      const { indent, options: { commentString } } = ctx;
      const itemCtx = Object.assign({}, ctx, { indent: itemIndent, type: null });
      let chompKeep = false;
      const lines = [];
      for (let i = 0; i < items.length; ++i) {
        const item = items[i];
        let comment2 = null;
        if (identity.isNode(item)) {
          if (!chompKeep && item.spaceBefore)
            lines.push("");
          addCommentBefore(ctx, lines, item.commentBefore, chompKeep);
          if (item.comment)
            comment2 = item.comment;
        } else if (identity.isPair(item)) {
          const ik = identity.isNode(item.key) ? item.key : null;
          if (ik) {
            if (!chompKeep && ik.spaceBefore)
              lines.push("");
            addCommentBefore(ctx, lines, ik.commentBefore, chompKeep);
          }
        }
        chompKeep = false;
        let str2 = stringify.stringify(item, itemCtx, () => comment2 = null, () => chompKeep = true);
        if (comment2)
          str2 += stringifyComment.lineComment(str2, itemIndent, commentString(comment2));
        if (chompKeep && comment2)
          chompKeep = false;
        lines.push(blockItemPrefix + str2);
      }
      let str;
      if (lines.length === 0) {
        str = flowChars.start + flowChars.end;
      } else {
        str = lines[0];
        for (let i = 1; i < lines.length; ++i) {
          const line = lines[i];
          str += line ? `
${indent}${line}` : "\n";
        }
      }
      if (comment) {
        str += "\n" + stringifyComment.indentComment(commentString(comment), indent);
        if (onComment)
          onComment();
      } else if (chompKeep && onChompKeep)
        onChompKeep();
      return str;
    }
    function stringifyFlowCollection({ items }, ctx, { flowChars, itemIndent }) {
      const { indent, indentStep, flowCollectionPadding: fcPadding, options: { commentString } } = ctx;
      itemIndent += indentStep;
      const itemCtx = Object.assign({}, ctx, {
        indent: itemIndent,
        inFlow: true,
        type: null
      });
      let reqNewline = false;
      let linesAtValue = 0;
      const lines = [];
      for (let i = 0; i < items.length; ++i) {
        const item = items[i];
        let comment = null;
        if (identity.isNode(item)) {
          if (item.spaceBefore)
            lines.push("");
          addCommentBefore(ctx, lines, item.commentBefore, false);
          if (item.comment)
            comment = item.comment;
        } else if (identity.isPair(item)) {
          const ik = identity.isNode(item.key) ? item.key : null;
          if (ik) {
            if (ik.spaceBefore)
              lines.push("");
            addCommentBefore(ctx, lines, ik.commentBefore, false);
            if (ik.comment)
              reqNewline = true;
          }
          const iv = identity.isNode(item.value) ? item.value : null;
          if (iv) {
            if (iv.comment)
              comment = iv.comment;
            if (iv.commentBefore)
              reqNewline = true;
          } else if (item.value == null && ik?.comment) {
            comment = ik.comment;
          }
        }
        if (comment)
          reqNewline = true;
        let str = stringify.stringify(item, itemCtx, () => comment = null);
        reqNewline || (reqNewline = lines.length > linesAtValue || str.includes("\n"));
        if (i < items.length - 1) {
          str += ",";
        } else if (ctx.options.trailingComma) {
          if (ctx.options.lineWidth > 0) {
            reqNewline || (reqNewline = lines.reduce((sum, line) => sum + line.length + 2, 2) + (str.length + 2) > ctx.options.lineWidth);
          }
          if (reqNewline) {
            str += ",";
          }
        }
        if (comment)
          str += stringifyComment.lineComment(str, itemIndent, commentString(comment));
        lines.push(str);
        linesAtValue = lines.length;
      }
      const { start, end } = flowChars;
      if (lines.length === 0) {
        return start + end;
      } else {
        if (!reqNewline) {
          const len = lines.reduce((sum, line) => sum + line.length + 2, 2);
          reqNewline = ctx.options.lineWidth > 0 && len > ctx.options.lineWidth;
        }
        if (reqNewline) {
          let str = start;
          for (const line of lines)
            str += line ? `
${indentStep}${indent}${line}` : "\n";
          return `${str}
${indent}${end}`;
        } else {
          return `${start}${fcPadding}${lines.join(" ")}${fcPadding}${end}`;
        }
      }
    }
    function addCommentBefore({ indent, options: { commentString } }, lines, comment, chompKeep) {
      if (comment && chompKeep)
        comment = comment.replace(/^\n+/, "");
      if (comment) {
        const ic = stringifyComment.indentComment(commentString(comment), indent);
        lines.push(ic.trimStart());
      }
    }
    exports2.stringifyCollection = stringifyCollection;
  }
});

// node_modules/yaml/dist/nodes/YAMLMap.js
var require_YAMLMap = __commonJS({
  "node_modules/yaml/dist/nodes/YAMLMap.js"(exports2) {
    "use strict";
    var stringifyCollection = require_stringifyCollection();
    var addPairToJSMap = require_addPairToJSMap();
    var Collection = require_Collection();
    var identity = require_identity();
    var Pair = require_Pair();
    var Scalar = require_Scalar();
    function findPair(items, key) {
      const k = identity.isScalar(key) ? key.value : key;
      for (const it of items) {
        if (identity.isPair(it)) {
          if (it.key === key || it.key === k)
            return it;
          if (identity.isScalar(it.key) && it.key.value === k)
            return it;
        }
      }
      return void 0;
    }
    var YAMLMap = class extends Collection.Collection {
      static get tagName() {
        return "tag:yaml.org,2002:map";
      }
      constructor(schema) {
        super(identity.MAP, schema);
        this.items = [];
      }
      /**
       * A generic collection parsing method that can be extended
       * to other node classes that inherit from YAMLMap
       */
      static from(schema, obj, ctx) {
        const { keepUndefined, replacer } = ctx;
        const map2 = new this(schema);
        const add = (key, value) => {
          if (typeof replacer === "function")
            value = replacer.call(obj, key, value);
          else if (Array.isArray(replacer) && !replacer.includes(key))
            return;
          if (value !== void 0 || keepUndefined)
            map2.items.push(Pair.createPair(key, value, ctx));
        };
        if (obj instanceof Map) {
          for (const [key, value] of obj)
            add(key, value);
        } else if (obj && typeof obj === "object") {
          for (const key of Object.keys(obj))
            add(key, obj[key]);
        }
        if (typeof schema.sortMapEntries === "function") {
          map2.items.sort(schema.sortMapEntries);
        }
        return map2;
      }
      /**
       * Adds a value to the collection.
       *
       * @param overwrite - If not set `true`, using a key that is already in the
       *   collection will throw. Otherwise, overwrites the previous value.
       */
      add(pair, overwrite) {
        let _pair;
        if (identity.isPair(pair))
          _pair = pair;
        else if (!pair || typeof pair !== "object" || !("key" in pair)) {
          _pair = new Pair.Pair(pair, pair?.value);
        } else
          _pair = new Pair.Pair(pair.key, pair.value);
        const prev = findPair(this.items, _pair.key);
        const sortEntries = this.schema?.sortMapEntries;
        if (prev) {
          if (!overwrite)
            throw new Error(`Key ${_pair.key} already set`);
          if (identity.isScalar(prev.value) && Scalar.isScalarValue(_pair.value))
            prev.value.value = _pair.value;
          else
            prev.value = _pair.value;
        } else if (sortEntries) {
          const i = this.items.findIndex((item) => sortEntries(_pair, item) < 0);
          if (i === -1)
            this.items.push(_pair);
          else
            this.items.splice(i, 0, _pair);
        } else {
          this.items.push(_pair);
        }
      }
      delete(key) {
        const it = findPair(this.items, key);
        if (!it)
          return false;
        const del = this.items.splice(this.items.indexOf(it), 1);
        return del.length > 0;
      }
      get(key, keepScalar) {
        const it = findPair(this.items, key);
        const node = it?.value;
        return (!keepScalar && identity.isScalar(node) ? node.value : node) ?? void 0;
      }
      has(key) {
        return !!findPair(this.items, key);
      }
      set(key, value) {
        this.add(new Pair.Pair(key, value), true);
      }
      /**
       * @param ctx - Conversion context, originally set in Document#toJS()
       * @param {Class} Type - If set, forces the returned collection type
       * @returns Instance of Type, Map, or Object
       */
      toJSON(_, ctx, Type) {
        const map2 = Type ? new Type() : ctx?.mapAsMap ? /* @__PURE__ */ new Map() : {};
        if (ctx?.onCreate)
          ctx.onCreate(map2);
        for (const item of this.items)
          addPairToJSMap.addPairToJSMap(ctx, map2, item);
        return map2;
      }
      toString(ctx, onComment, onChompKeep) {
        if (!ctx)
          return JSON.stringify(this);
        for (const item of this.items) {
          if (!identity.isPair(item))
            throw new Error(`Map items must all be pairs; found ${JSON.stringify(item)} instead`);
        }
        if (!ctx.allNullValues && this.hasAllNullValues(false))
          ctx = Object.assign({}, ctx, { allNullValues: true });
        return stringifyCollection.stringifyCollection(this, ctx, {
          blockItemPrefix: "",
          flowChars: { start: "{", end: "}" },
          itemIndent: ctx.indent || "",
          onChompKeep,
          onComment
        });
      }
    };
    exports2.YAMLMap = YAMLMap;
    exports2.findPair = findPair;
  }
});

// node_modules/yaml/dist/schema/common/map.js
var require_map = __commonJS({
  "node_modules/yaml/dist/schema/common/map.js"(exports2) {
    "use strict";
    var identity = require_identity();
    var YAMLMap = require_YAMLMap();
    var map2 = {
      collection: "map",
      default: true,
      nodeClass: YAMLMap.YAMLMap,
      tag: "tag:yaml.org,2002:map",
      resolve(map3, onError) {
        if (!identity.isMap(map3))
          onError("Expected a mapping for this tag");
        return map3;
      },
      createNode: (schema, obj, ctx) => YAMLMap.YAMLMap.from(schema, obj, ctx)
    };
    exports2.map = map2;
  }
});

// node_modules/yaml/dist/nodes/YAMLSeq.js
var require_YAMLSeq = __commonJS({
  "node_modules/yaml/dist/nodes/YAMLSeq.js"(exports2) {
    "use strict";
    var createNode = require_createNode();
    var stringifyCollection = require_stringifyCollection();
    var Collection = require_Collection();
    var identity = require_identity();
    var Scalar = require_Scalar();
    var toJS = require_toJS();
    var YAMLSeq = class extends Collection.Collection {
      static get tagName() {
        return "tag:yaml.org,2002:seq";
      }
      constructor(schema) {
        super(identity.SEQ, schema);
        this.items = [];
      }
      add(value) {
        this.items.push(value);
      }
      /**
       * Removes a value from the collection.
       *
       * `key` must contain a representation of an integer for this to succeed.
       * It may be wrapped in a `Scalar`.
       *
       * @returns `true` if the item was found and removed.
       */
      delete(key) {
        const idx = asItemIndex(key);
        if (typeof idx !== "number")
          return false;
        const del = this.items.splice(idx, 1);
        return del.length > 0;
      }
      get(key, keepScalar) {
        const idx = asItemIndex(key);
        if (typeof idx !== "number")
          return void 0;
        const it = this.items[idx];
        return !keepScalar && identity.isScalar(it) ? it.value : it;
      }
      /**
       * Checks if the collection includes a value with the key `key`.
       *
       * `key` must contain a representation of an integer for this to succeed.
       * It may be wrapped in a `Scalar`.
       */
      has(key) {
        const idx = asItemIndex(key);
        return typeof idx === "number" && idx < this.items.length;
      }
      /**
       * Sets a value in this collection. For `!!set`, `value` needs to be a
       * boolean to add/remove the item from the set.
       *
       * If `key` does not contain a representation of an integer, this will throw.
       * It may be wrapped in a `Scalar`.
       */
      set(key, value) {
        const idx = asItemIndex(key);
        if (typeof idx !== "number")
          throw new Error(`Expected a valid index, not ${key}.`);
        const prev = this.items[idx];
        if (identity.isScalar(prev) && Scalar.isScalarValue(value))
          prev.value = value;
        else
          this.items[idx] = value;
      }
      toJSON(_, ctx) {
        const seq = [];
        if (ctx?.onCreate)
          ctx.onCreate(seq);
        let i = 0;
        for (const item of this.items)
          seq.push(toJS.toJS(item, String(i++), ctx));
        return seq;
      }
      toString(ctx, onComment, onChompKeep) {
        if (!ctx)
          return JSON.stringify(this);
        return stringifyCollection.stringifyCollection(this, ctx, {
          blockItemPrefix: "- ",
          flowChars: { start: "[", end: "]" },
          itemIndent: (ctx.indent || "") + "  ",
          onChompKeep,
          onComment
        });
      }
      static from(schema, obj, ctx) {
        const { replacer } = ctx;
        const seq = new this(schema);
        if (obj && Symbol.iterator in Object(obj)) {
          let i = 0;
          for (let it of obj) {
            if (typeof replacer === "function") {
              const key = obj instanceof Set ? it : String(i++);
              it = replacer.call(obj, key, it);
            }
            seq.items.push(createNode.createNode(it, void 0, ctx));
          }
        }
        return seq;
      }
    };
    function asItemIndex(key) {
      let idx = identity.isScalar(key) ? key.value : key;
      if (idx && typeof idx === "string")
        idx = Number(idx);
      return typeof idx === "number" && Number.isInteger(idx) && idx >= 0 ? idx : null;
    }
    exports2.YAMLSeq = YAMLSeq;
  }
});

// node_modules/yaml/dist/schema/common/seq.js
var require_seq = __commonJS({
  "node_modules/yaml/dist/schema/common/seq.js"(exports2) {
    "use strict";
    var identity = require_identity();
    var YAMLSeq = require_YAMLSeq();
    var seq = {
      collection: "seq",
      default: true,
      nodeClass: YAMLSeq.YAMLSeq,
      tag: "tag:yaml.org,2002:seq",
      resolve(seq2, onError) {
        if (!identity.isSeq(seq2))
          onError("Expected a sequence for this tag");
        return seq2;
      },
      createNode: (schema, obj, ctx) => YAMLSeq.YAMLSeq.from(schema, obj, ctx)
    };
    exports2.seq = seq;
  }
});

// node_modules/yaml/dist/schema/common/string.js
var require_string = __commonJS({
  "node_modules/yaml/dist/schema/common/string.js"(exports2) {
    "use strict";
    var stringifyString = require_stringifyString();
    var string4 = {
      identify: (value) => typeof value === "string",
      default: true,
      tag: "tag:yaml.org,2002:str",
      resolve: (str) => str,
      stringify(item, ctx, onComment, onChompKeep) {
        ctx = Object.assign({ actualString: true }, ctx);
        return stringifyString.stringifyString(item, ctx, onComment, onChompKeep);
      }
    };
    exports2.string = string4;
  }
});

// node_modules/yaml/dist/schema/common/null.js
var require_null = __commonJS({
  "node_modules/yaml/dist/schema/common/null.js"(exports2) {
    "use strict";
    var Scalar = require_Scalar();
    var nullTag = {
      identify: (value) => value == null,
      createNode: () => new Scalar.Scalar(null),
      default: true,
      tag: "tag:yaml.org,2002:null",
      test: /^(?:~|[Nn]ull|NULL)?$/,
      resolve: () => new Scalar.Scalar(null),
      stringify: ({ source }, ctx) => typeof source === "string" && nullTag.test.test(source) ? source : ctx.options.nullStr
    };
    exports2.nullTag = nullTag;
  }
});

// node_modules/yaml/dist/schema/core/bool.js
var require_bool = __commonJS({
  "node_modules/yaml/dist/schema/core/bool.js"(exports2) {
    "use strict";
    var Scalar = require_Scalar();
    var boolTag = {
      identify: (value) => typeof value === "boolean",
      default: true,
      tag: "tag:yaml.org,2002:bool",
      test: /^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,
      resolve: (str) => new Scalar.Scalar(str[0] === "t" || str[0] === "T"),
      stringify({ source, value }, ctx) {
        if (source && boolTag.test.test(source)) {
          const sv = source[0] === "t" || source[0] === "T";
          if (value === sv)
            return source;
        }
        return value ? ctx.options.trueStr : ctx.options.falseStr;
      }
    };
    exports2.boolTag = boolTag;
  }
});

// node_modules/yaml/dist/stringify/stringifyNumber.js
var require_stringifyNumber = __commonJS({
  "node_modules/yaml/dist/stringify/stringifyNumber.js"(exports2) {
    "use strict";
    function stringifyNumber({ format, minFractionDigits, tag, value }) {
      if (typeof value === "bigint")
        return String(value);
      const num = typeof value === "number" ? value : Number(value);
      if (!isFinite(num))
        return isNaN(num) ? ".nan" : num < 0 ? "-.inf" : ".inf";
      let n = Object.is(value, -0) ? "-0" : JSON.stringify(value);
      if (!format && minFractionDigits && (!tag || tag === "tag:yaml.org,2002:float") && /^\d/.test(n)) {
        let i = n.indexOf(".");
        if (i < 0) {
          i = n.length;
          n += ".";
        }
        let d = minFractionDigits - (n.length - i - 1);
        while (d-- > 0)
          n += "0";
      }
      return n;
    }
    exports2.stringifyNumber = stringifyNumber;
  }
});

// node_modules/yaml/dist/schema/core/float.js
var require_float = __commonJS({
  "node_modules/yaml/dist/schema/core/float.js"(exports2) {
    "use strict";
    var Scalar = require_Scalar();
    var stringifyNumber = require_stringifyNumber();
    var floatNaN = {
      identify: (value) => typeof value === "number",
      default: true,
      tag: "tag:yaml.org,2002:float",
      test: /^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,
      resolve: (str) => str.slice(-3).toLowerCase() === "nan" ? NaN : str[0] === "-" ? Number.NEGATIVE_INFINITY : Number.POSITIVE_INFINITY,
      stringify: stringifyNumber.stringifyNumber
    };
    var floatExp = {
      identify: (value) => typeof value === "number",
      default: true,
      tag: "tag:yaml.org,2002:float",
      format: "EXP",
      test: /^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,
      resolve: (str) => parseFloat(str),
      stringify(node) {
        const num = Number(node.value);
        return isFinite(num) ? num.toExponential() : stringifyNumber.stringifyNumber(node);
      }
    };
    var float = {
      identify: (value) => typeof value === "number",
      default: true,
      tag: "tag:yaml.org,2002:float",
      test: /^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,
      resolve(str) {
        const node = new Scalar.Scalar(parseFloat(str));
        const dot = str.indexOf(".");
        if (dot !== -1 && str[str.length - 1] === "0")
          node.minFractionDigits = str.length - dot - 1;
        return node;
      },
      stringify: stringifyNumber.stringifyNumber
    };
    exports2.float = float;
    exports2.floatExp = floatExp;
    exports2.floatNaN = floatNaN;
  }
});

// node_modules/yaml/dist/schema/core/int.js
var require_int = __commonJS({
  "node_modules/yaml/dist/schema/core/int.js"(exports2) {
    "use strict";
    var stringifyNumber = require_stringifyNumber();
    var intIdentify = (value) => typeof value === "bigint" || Number.isInteger(value);
    var intResolve = (str, offset, radix, { intAsBigInt }) => intAsBigInt ? BigInt(str) : parseInt(str.substring(offset), radix);
    function intStringify(node, radix, prefix) {
      const { value } = node;
      if (intIdentify(value) && value >= 0)
        return prefix + value.toString(radix);
      return stringifyNumber.stringifyNumber(node);
    }
    var intOct = {
      identify: (value) => intIdentify(value) && value >= 0,
      default: true,
      tag: "tag:yaml.org,2002:int",
      format: "OCT",
      test: /^0o[0-7]+$/,
      resolve: (str, _onError2, opt) => intResolve(str, 2, 8, opt),
      stringify: (node) => intStringify(node, 8, "0o")
    };
    var int2 = {
      identify: intIdentify,
      default: true,
      tag: "tag:yaml.org,2002:int",
      test: /^[-+]?[0-9]+$/,
      resolve: (str, _onError2, opt) => intResolve(str, 0, 10, opt),
      stringify: stringifyNumber.stringifyNumber
    };
    var intHex = {
      identify: (value) => intIdentify(value) && value >= 0,
      default: true,
      tag: "tag:yaml.org,2002:int",
      format: "HEX",
      test: /^0x[0-9a-fA-F]+$/,
      resolve: (str, _onError2, opt) => intResolve(str, 2, 16, opt),
      stringify: (node) => intStringify(node, 16, "0x")
    };
    exports2.int = int2;
    exports2.intHex = intHex;
    exports2.intOct = intOct;
  }
});

// node_modules/yaml/dist/schema/core/schema.js
var require_schema = __commonJS({
  "node_modules/yaml/dist/schema/core/schema.js"(exports2) {
    "use strict";
    var map2 = require_map();
    var _null4 = require_null();
    var seq = require_seq();
    var string4 = require_string();
    var bool = require_bool();
    var float = require_float();
    var int2 = require_int();
    var schema = [
      map2.map,
      seq.seq,
      string4.string,
      _null4.nullTag,
      bool.boolTag,
      int2.intOct,
      int2.int,
      int2.intHex,
      float.floatNaN,
      float.floatExp,
      float.float
    ];
    exports2.schema = schema;
  }
});

// node_modules/yaml/dist/schema/json/schema.js
var require_schema2 = __commonJS({
  "node_modules/yaml/dist/schema/json/schema.js"(exports2) {
    "use strict";
    var Scalar = require_Scalar();
    var map2 = require_map();
    var seq = require_seq();
    function intIdentify(value) {
      return typeof value === "bigint" || Number.isInteger(value);
    }
    var stringifyJSON = ({ value }) => JSON.stringify(value);
    var jsonScalars = [
      {
        identify: (value) => typeof value === "string",
        default: true,
        tag: "tag:yaml.org,2002:str",
        resolve: (str) => str,
        stringify: stringifyJSON
      },
      {
        identify: (value) => value == null,
        createNode: () => new Scalar.Scalar(null),
        default: true,
        tag: "tag:yaml.org,2002:null",
        test: /^null$/,
        resolve: () => null,
        stringify: stringifyJSON
      },
      {
        identify: (value) => typeof value === "boolean",
        default: true,
        tag: "tag:yaml.org,2002:bool",
        test: /^true$|^false$/,
        resolve: (str) => str === "true",
        stringify: stringifyJSON
      },
      {
        identify: intIdentify,
        default: true,
        tag: "tag:yaml.org,2002:int",
        test: /^-?(?:0|[1-9][0-9]*)$/,
        resolve: (str, _onError2, { intAsBigInt }) => intAsBigInt ? BigInt(str) : parseInt(str, 10),
        stringify: ({ value }) => intIdentify(value) ? value.toString() : JSON.stringify(value)
      },
      {
        identify: (value) => typeof value === "number",
        default: true,
        tag: "tag:yaml.org,2002:float",
        test: /^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,
        resolve: (str) => parseFloat(str),
        stringify: stringifyJSON
      }
    ];
    var jsonError = {
      default: true,
      tag: "",
      test: /^/,
      resolve(str, onError) {
        onError(`Unresolved plain scalar ${JSON.stringify(str)}`);
        return str;
      }
    };
    var schema = [map2.map, seq.seq].concat(jsonScalars, jsonError);
    exports2.schema = schema;
  }
});

// node_modules/yaml/dist/schema/yaml-1.1/binary.js
var require_binary = __commonJS({
  "node_modules/yaml/dist/schema/yaml-1.1/binary.js"(exports2) {
    "use strict";
    var node_buffer = require("buffer");
    var Scalar = require_Scalar();
    var stringifyString = require_stringifyString();
    var binary = {
      identify: (value) => value instanceof Uint8Array,
      // Buffer inherits from Uint8Array
      default: false,
      tag: "tag:yaml.org,2002:binary",
      /**
       * Returns a Buffer in node and an Uint8Array in browsers
       *
       * To use the resulting buffer as an image, you'll want to do something like:
       *
       *   const blob = new Blob([buffer], { type: 'image/jpeg' })
       *   document.querySelector('#photo').src = URL.createObjectURL(blob)
       */
      resolve(src, onError) {
        if (typeof node_buffer.Buffer === "function") {
          return node_buffer.Buffer.from(src, "base64");
        } else if (typeof atob === "function") {
          const str = atob(src.replace(/[\n\r]/g, ""));
          const buffer = new Uint8Array(str.length);
          for (let i = 0; i < str.length; ++i)
            buffer[i] = str.charCodeAt(i);
          return buffer;
        } else {
          onError("This environment does not support reading binary tags; either Buffer or atob is required");
          return src;
        }
      },
      stringify({ comment, type, value }, ctx, onComment, onChompKeep) {
        if (!value)
          return "";
        const buf = value;
        let str;
        if (typeof node_buffer.Buffer === "function") {
          str = buf instanceof node_buffer.Buffer ? buf.toString("base64") : node_buffer.Buffer.from(buf.buffer).toString("base64");
        } else if (typeof btoa === "function") {
          let s = "";
          for (let i = 0; i < buf.length; ++i)
            s += String.fromCharCode(buf[i]);
          str = btoa(s);
        } else {
          throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");
        }
        type ?? (type = Scalar.Scalar.BLOCK_LITERAL);
        if (type !== Scalar.Scalar.QUOTE_DOUBLE) {
          const lineWidth = Math.max(ctx.options.lineWidth - ctx.indent.length, ctx.options.minContentWidth);
          const n = Math.ceil(str.length / lineWidth);
          const lines = new Array(n);
          for (let i = 0, o = 0; i < n; ++i, o += lineWidth) {
            lines[i] = str.substr(o, lineWidth);
          }
          str = lines.join(type === Scalar.Scalar.BLOCK_LITERAL ? "\n" : " ");
        }
        return stringifyString.stringifyString({ comment, type, value: str }, ctx, onComment, onChompKeep);
      }
    };
    exports2.binary = binary;
  }
});

// node_modules/yaml/dist/schema/yaml-1.1/pairs.js
var require_pairs = __commonJS({
  "node_modules/yaml/dist/schema/yaml-1.1/pairs.js"(exports2) {
    "use strict";
    var identity = require_identity();
    var Pair = require_Pair();
    var Scalar = require_Scalar();
    var YAMLSeq = require_YAMLSeq();
    function resolvePairs(seq, onError) {
      if (identity.isSeq(seq)) {
        for (let i = 0; i < seq.items.length; ++i) {
          let item = seq.items[i];
          if (identity.isPair(item))
            continue;
          else if (identity.isMap(item)) {
            if (item.items.length > 1)
              onError("Each pair must have its own sequence indicator");
            const pair = item.items[0] || new Pair.Pair(new Scalar.Scalar(null));
            if (item.commentBefore)
              pair.key.commentBefore = pair.key.commentBefore ? `${item.commentBefore}
${pair.key.commentBefore}` : item.commentBefore;
            if (item.comment) {
              const cn = pair.value ?? pair.key;
              cn.comment = cn.comment ? `${item.comment}
${cn.comment}` : item.comment;
            }
            item = pair;
          }
          seq.items[i] = identity.isPair(item) ? item : new Pair.Pair(item);
        }
      } else
        onError("Expected a sequence for this tag");
      return seq;
    }
    function createPairs(schema, iterable, ctx) {
      const { replacer } = ctx;
      const pairs2 = new YAMLSeq.YAMLSeq(schema);
      pairs2.tag = "tag:yaml.org,2002:pairs";
      let i = 0;
      if (iterable && Symbol.iterator in Object(iterable))
        for (let it of iterable) {
          if (typeof replacer === "function")
            it = replacer.call(iterable, String(i++), it);
          let key, value;
          if (Array.isArray(it)) {
            if (it.length === 2) {
              key = it[0];
              value = it[1];
            } else
              throw new TypeError(`Expected [key, value] tuple: ${it}`);
          } else if (it && it instanceof Object) {
            const keys = Object.keys(it);
            if (keys.length === 1) {
              key = keys[0];
              value = it[key];
            } else {
              throw new TypeError(`Expected tuple with one key, not ${keys.length} keys`);
            }
          } else {
            key = it;
          }
          pairs2.items.push(Pair.createPair(key, value, ctx));
        }
      return pairs2;
    }
    var pairs = {
      collection: "seq",
      default: false,
      tag: "tag:yaml.org,2002:pairs",
      resolve: resolvePairs,
      createNode: createPairs
    };
    exports2.createPairs = createPairs;
    exports2.pairs = pairs;
    exports2.resolvePairs = resolvePairs;
  }
});

// node_modules/yaml/dist/schema/yaml-1.1/omap.js
var require_omap = __commonJS({
  "node_modules/yaml/dist/schema/yaml-1.1/omap.js"(exports2) {
    "use strict";
    var identity = require_identity();
    var toJS = require_toJS();
    var YAMLMap = require_YAMLMap();
    var YAMLSeq = require_YAMLSeq();
    var pairs = require_pairs();
    var YAMLOMap = class _YAMLOMap extends YAMLSeq.YAMLSeq {
      constructor() {
        super();
        this.add = YAMLMap.YAMLMap.prototype.add.bind(this);
        this.delete = YAMLMap.YAMLMap.prototype.delete.bind(this);
        this.get = YAMLMap.YAMLMap.prototype.get.bind(this);
        this.has = YAMLMap.YAMLMap.prototype.has.bind(this);
        this.set = YAMLMap.YAMLMap.prototype.set.bind(this);
        this.tag = _YAMLOMap.tag;
      }
      /**
       * If `ctx` is given, the return type is actually `Map<unknown, unknown>`,
       * but TypeScript won't allow widening the signature of a child method.
       */
      toJSON(_, ctx) {
        if (!ctx)
          return super.toJSON(_);
        const map2 = /* @__PURE__ */ new Map();
        if (ctx?.onCreate)
          ctx.onCreate(map2);
        for (const pair of this.items) {
          let key, value;
          if (identity.isPair(pair)) {
            key = toJS.toJS(pair.key, "", ctx);
            value = toJS.toJS(pair.value, key, ctx);
          } else {
            key = toJS.toJS(pair, "", ctx);
          }
          if (map2.has(key))
            throw new Error("Ordered maps must not include duplicate keys");
          map2.set(key, value);
        }
        return map2;
      }
      static from(schema, iterable, ctx) {
        const pairs$1 = pairs.createPairs(schema, iterable, ctx);
        const omap2 = new this();
        omap2.items = pairs$1.items;
        return omap2;
      }
    };
    YAMLOMap.tag = "tag:yaml.org,2002:omap";
    var omap = {
      collection: "seq",
      identify: (value) => value instanceof Map,
      nodeClass: YAMLOMap,
      default: false,
      tag: "tag:yaml.org,2002:omap",
      resolve(seq, onError) {
        const pairs$1 = pairs.resolvePairs(seq, onError);
        const seenKeys = [];
        for (const { key } of pairs$1.items) {
          if (identity.isScalar(key)) {
            if (seenKeys.includes(key.value)) {
              onError(`Ordered maps must not include duplicate keys: ${key.value}`);
            } else {
              seenKeys.push(key.value);
            }
          }
        }
        return Object.assign(new YAMLOMap(), pairs$1);
      },
      createNode: (schema, iterable, ctx) => YAMLOMap.from(schema, iterable, ctx)
    };
    exports2.YAMLOMap = YAMLOMap;
    exports2.omap = omap;
  }
});

// node_modules/yaml/dist/schema/yaml-1.1/bool.js
var require_bool2 = __commonJS({
  "node_modules/yaml/dist/schema/yaml-1.1/bool.js"(exports2) {
    "use strict";
    var Scalar = require_Scalar();
    function boolStringify({ value, source }, ctx) {
      const boolObj = value ? trueTag : falseTag;
      if (source && boolObj.test.test(source))
        return source;
      return value ? ctx.options.trueStr : ctx.options.falseStr;
    }
    var trueTag = {
      identify: (value) => value === true,
      default: true,
      tag: "tag:yaml.org,2002:bool",
      test: /^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,
      resolve: () => new Scalar.Scalar(true),
      stringify: boolStringify
    };
    var falseTag = {
      identify: (value) => value === false,
      default: true,
      tag: "tag:yaml.org,2002:bool",
      test: /^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,
      resolve: () => new Scalar.Scalar(false),
      stringify: boolStringify
    };
    exports2.falseTag = falseTag;
    exports2.trueTag = trueTag;
  }
});

// node_modules/yaml/dist/schema/yaml-1.1/float.js
var require_float2 = __commonJS({
  "node_modules/yaml/dist/schema/yaml-1.1/float.js"(exports2) {
    "use strict";
    var Scalar = require_Scalar();
    var stringifyNumber = require_stringifyNumber();
    var floatNaN = {
      identify: (value) => typeof value === "number",
      default: true,
      tag: "tag:yaml.org,2002:float",
      test: /^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,
      resolve: (str) => str.slice(-3).toLowerCase() === "nan" ? NaN : str[0] === "-" ? Number.NEGATIVE_INFINITY : Number.POSITIVE_INFINITY,
      stringify: stringifyNumber.stringifyNumber
    };
    var floatExp = {
      identify: (value) => typeof value === "number",
      default: true,
      tag: "tag:yaml.org,2002:float",
      format: "EXP",
      test: /^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,
      resolve: (str) => parseFloat(str.replace(/_/g, "")),
      stringify(node) {
        const num = Number(node.value);
        return isFinite(num) ? num.toExponential() : stringifyNumber.stringifyNumber(node);
      }
    };
    var float = {
      identify: (value) => typeof value === "number",
      default: true,
      tag: "tag:yaml.org,2002:float",
      test: /^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,
      resolve(str) {
        const node = new Scalar.Scalar(parseFloat(str.replace(/_/g, "")));
        const dot = str.indexOf(".");
        if (dot !== -1) {
          const f = str.substring(dot + 1).replace(/_/g, "");
          if (f[f.length - 1] === "0")
            node.minFractionDigits = f.length;
        }
        return node;
      },
      stringify: stringifyNumber.stringifyNumber
    };
    exports2.float = float;
    exports2.floatExp = floatExp;
    exports2.floatNaN = floatNaN;
  }
});

// node_modules/yaml/dist/schema/yaml-1.1/int.js
var require_int2 = __commonJS({
  "node_modules/yaml/dist/schema/yaml-1.1/int.js"(exports2) {
    "use strict";
    var stringifyNumber = require_stringifyNumber();
    var intIdentify = (value) => typeof value === "bigint" || Number.isInteger(value);
    function intResolve(str, offset, radix, { intAsBigInt }) {
      const sign = str[0];
      if (sign === "-" || sign === "+")
        offset += 1;
      str = str.substring(offset).replace(/_/g, "");
      if (intAsBigInt) {
        switch (radix) {
          case 2:
            str = `0b${str}`;
            break;
          case 8:
            str = `0o${str}`;
            break;
          case 16:
            str = `0x${str}`;
            break;
        }
        const n2 = BigInt(str);
        return sign === "-" ? BigInt(-1) * n2 : n2;
      }
      const n = parseInt(str, radix);
      return sign === "-" ? -1 * n : n;
    }
    function intStringify(node, radix, prefix) {
      const { value } = node;
      if (intIdentify(value)) {
        const str = value.toString(radix);
        return value < 0 ? "-" + prefix + str.substr(1) : prefix + str;
      }
      return stringifyNumber.stringifyNumber(node);
    }
    var intBin = {
      identify: intIdentify,
      default: true,
      tag: "tag:yaml.org,2002:int",
      format: "BIN",
      test: /^[-+]?0b[0-1_]+$/,
      resolve: (str, _onError2, opt) => intResolve(str, 2, 2, opt),
      stringify: (node) => intStringify(node, 2, "0b")
    };
    var intOct = {
      identify: intIdentify,
      default: true,
      tag: "tag:yaml.org,2002:int",
      format: "OCT",
      test: /^[-+]?0[0-7_]+$/,
      resolve: (str, _onError2, opt) => intResolve(str, 1, 8, opt),
      stringify: (node) => intStringify(node, 8, "0")
    };
    var int2 = {
      identify: intIdentify,
      default: true,
      tag: "tag:yaml.org,2002:int",
      test: /^[-+]?[0-9][0-9_]*$/,
      resolve: (str, _onError2, opt) => intResolve(str, 0, 10, opt),
      stringify: stringifyNumber.stringifyNumber
    };
    var intHex = {
      identify: intIdentify,
      default: true,
      tag: "tag:yaml.org,2002:int",
      format: "HEX",
      test: /^[-+]?0x[0-9a-fA-F_]+$/,
      resolve: (str, _onError2, opt) => intResolve(str, 2, 16, opt),
      stringify: (node) => intStringify(node, 16, "0x")
    };
    exports2.int = int2;
    exports2.intBin = intBin;
    exports2.intHex = intHex;
    exports2.intOct = intOct;
  }
});

// node_modules/yaml/dist/schema/yaml-1.1/set.js
var require_set = __commonJS({
  "node_modules/yaml/dist/schema/yaml-1.1/set.js"(exports2) {
    "use strict";
    var identity = require_identity();
    var Pair = require_Pair();
    var YAMLMap = require_YAMLMap();
    var YAMLSet = class _YAMLSet extends YAMLMap.YAMLMap {
      constructor(schema) {
        super(schema);
        this.tag = _YAMLSet.tag;
      }
      add(key) {
        let pair;
        if (identity.isPair(key))
          pair = key;
        else if (key && typeof key === "object" && "key" in key && "value" in key && key.value === null)
          pair = new Pair.Pair(key.key, null);
        else
          pair = new Pair.Pair(key, null);
        const prev = YAMLMap.findPair(this.items, pair.key);
        if (!prev)
          this.items.push(pair);
      }
      /**
       * If `keepPair` is `true`, returns the Pair matching `key`.
       * Otherwise, returns the value of that Pair's key.
       */
      get(key, keepPair) {
        const pair = YAMLMap.findPair(this.items, key);
        return !keepPair && identity.isPair(pair) ? identity.isScalar(pair.key) ? pair.key.value : pair.key : pair;
      }
      set(key, value) {
        if (typeof value !== "boolean")
          throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof value}`);
        const prev = YAMLMap.findPair(this.items, key);
        if (prev && !value) {
          this.items.splice(this.items.indexOf(prev), 1);
        } else if (!prev && value) {
          this.items.push(new Pair.Pair(key));
        }
      }
      toJSON(_, ctx) {
        return super.toJSON(_, ctx, Set);
      }
      toString(ctx, onComment, onChompKeep) {
        if (!ctx)
          return JSON.stringify(this);
        if (this.hasAllNullValues(true))
          return super.toString(Object.assign({}, ctx, { allNullValues: true }), onComment, onChompKeep);
        else
          throw new Error("Set items must all have null values");
      }
      static from(schema, iterable, ctx) {
        const { replacer } = ctx;
        const set3 = new this(schema);
        if (iterable && Symbol.iterator in Object(iterable))
          for (let value of iterable) {
            if (typeof replacer === "function")
              value = replacer.call(iterable, value, value);
            set3.items.push(Pair.createPair(value, null, ctx));
          }
        return set3;
      }
    };
    YAMLSet.tag = "tag:yaml.org,2002:set";
    var set2 = {
      collection: "map",
      identify: (value) => value instanceof Set,
      nodeClass: YAMLSet,
      default: false,
      tag: "tag:yaml.org,2002:set",
      createNode: (schema, iterable, ctx) => YAMLSet.from(schema, iterable, ctx),
      resolve(map2, onError) {
        if (identity.isMap(map2)) {
          if (map2.hasAllNullValues(true))
            return Object.assign(new YAMLSet(), map2);
          else
            onError("Set items must all have null values");
        } else
          onError("Expected a mapping for this tag");
        return map2;
      }
    };
    exports2.YAMLSet = YAMLSet;
    exports2.set = set2;
  }
});

// node_modules/yaml/dist/schema/yaml-1.1/timestamp.js
var require_timestamp = __commonJS({
  "node_modules/yaml/dist/schema/yaml-1.1/timestamp.js"(exports2) {
    "use strict";
    var stringifyNumber = require_stringifyNumber();
    function parseSexagesimal(str, asBigInt) {
      const sign = str[0];
      const parts = sign === "-" || sign === "+" ? str.substring(1) : str;
      const num = (n) => asBigInt ? BigInt(n) : Number(n);
      const res = parts.replace(/_/g, "").split(":").reduce((res2, p) => res2 * num(60) + num(p), num(0));
      return sign === "-" ? num(-1) * res : res;
    }
    function stringifySexagesimal(node) {
      let { value } = node;
      let num = (n) => n;
      if (typeof value === "bigint")
        num = (n) => BigInt(n);
      else if (isNaN(value) || !isFinite(value))
        return stringifyNumber.stringifyNumber(node);
      let sign = "";
      if (value < 0) {
        sign = "-";
        value *= num(-1);
      }
      const _60 = num(60);
      const parts = [value % _60];
      if (value < 60) {
        parts.unshift(0);
      } else {
        value = (value - parts[0]) / _60;
        parts.unshift(value % _60);
        if (value >= 60) {
          value = (value - parts[0]) / _60;
          parts.unshift(value);
        }
      }
      return sign + parts.map((n) => String(n).padStart(2, "0")).join(":").replace(/000000\d*$/, "");
    }
    var intTime = {
      identify: (value) => typeof value === "bigint" || Number.isInteger(value),
      default: true,
      tag: "tag:yaml.org,2002:int",
      format: "TIME",
      test: /^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,
      resolve: (str, _onError2, { intAsBigInt }) => parseSexagesimal(str, intAsBigInt),
      stringify: stringifySexagesimal
    };
    var floatTime = {
      identify: (value) => typeof value === "number",
      default: true,
      tag: "tag:yaml.org,2002:float",
      format: "TIME",
      test: /^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,
      resolve: (str) => parseSexagesimal(str, false),
      stringify: stringifySexagesimal
    };
    var timestamp = {
      identify: (value) => value instanceof Date,
      default: true,
      tag: "tag:yaml.org,2002:timestamp",
      // If the time zone is omitted, the timestamp is assumed to be specified in UTC. The time part
      // may be omitted altogether, resulting in a date format. In such a case, the time part is
      // assumed to be 00:00:00Z (start of day, UTC).
      test: RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),
      resolve(str) {
        const match = str.match(timestamp.test);
        if (!match)
          throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");
        const [, year, month, day, hour, minute, second] = match.map(Number);
        const millisec = match[7] ? Number((match[7] + "00").substr(1, 3)) : 0;
        let date5 = Date.UTC(year, month - 1, day, hour || 0, minute || 0, second || 0, millisec);
        const tz = match[8];
        if (tz && tz !== "Z") {
          let d = parseSexagesimal(tz, false);
          if (Math.abs(d) < 30)
            d *= 60;
          date5 -= 6e4 * d;
        }
        return new Date(date5);
      },
      stringify: ({ value }) => value?.toISOString().replace(/(T00:00:00)?\.000Z$/, "") ?? ""
    };
    exports2.floatTime = floatTime;
    exports2.intTime = intTime;
    exports2.timestamp = timestamp;
  }
});

// node_modules/yaml/dist/schema/yaml-1.1/schema.js
var require_schema3 = __commonJS({
  "node_modules/yaml/dist/schema/yaml-1.1/schema.js"(exports2) {
    "use strict";
    var map2 = require_map();
    var _null4 = require_null();
    var seq = require_seq();
    var string4 = require_string();
    var binary = require_binary();
    var bool = require_bool2();
    var float = require_float2();
    var int2 = require_int2();
    var merge2 = require_merge();
    var omap = require_omap();
    var pairs = require_pairs();
    var set2 = require_set();
    var timestamp = require_timestamp();
    var schema = [
      map2.map,
      seq.seq,
      string4.string,
      _null4.nullTag,
      bool.trueTag,
      bool.falseTag,
      int2.intBin,
      int2.intOct,
      int2.int,
      int2.intHex,
      float.floatNaN,
      float.floatExp,
      float.float,
      binary.binary,
      merge2.merge,
      omap.omap,
      pairs.pairs,
      set2.set,
      timestamp.intTime,
      timestamp.floatTime,
      timestamp.timestamp
    ];
    exports2.schema = schema;
  }
});

// node_modules/yaml/dist/schema/tags.js
var require_tags = __commonJS({
  "node_modules/yaml/dist/schema/tags.js"(exports2) {
    "use strict";
    var map2 = require_map();
    var _null4 = require_null();
    var seq = require_seq();
    var string4 = require_string();
    var bool = require_bool();
    var float = require_float();
    var int2 = require_int();
    var schema = require_schema();
    var schema$1 = require_schema2();
    var binary = require_binary();
    var merge2 = require_merge();
    var omap = require_omap();
    var pairs = require_pairs();
    var schema$2 = require_schema3();
    var set2 = require_set();
    var timestamp = require_timestamp();
    var schemas = /* @__PURE__ */ new Map([
      ["core", schema.schema],
      ["failsafe", [map2.map, seq.seq, string4.string]],
      ["json", schema$1.schema],
      ["yaml11", schema$2.schema],
      ["yaml-1.1", schema$2.schema]
    ]);
    var tagsByName = {
      binary: binary.binary,
      bool: bool.boolTag,
      float: float.float,
      floatExp: float.floatExp,
      floatNaN: float.floatNaN,
      floatTime: timestamp.floatTime,
      int: int2.int,
      intHex: int2.intHex,
      intOct: int2.intOct,
      intTime: timestamp.intTime,
      map: map2.map,
      merge: merge2.merge,
      null: _null4.nullTag,
      omap: omap.omap,
      pairs: pairs.pairs,
      seq: seq.seq,
      set: set2.set,
      timestamp: timestamp.timestamp
    };
    var coreKnownTags = {
      "tag:yaml.org,2002:binary": binary.binary,
      "tag:yaml.org,2002:merge": merge2.merge,
      "tag:yaml.org,2002:omap": omap.omap,
      "tag:yaml.org,2002:pairs": pairs.pairs,
      "tag:yaml.org,2002:set": set2.set,
      "tag:yaml.org,2002:timestamp": timestamp.timestamp
    };
    function getTags(customTags, schemaName, addMergeTag) {
      const schemaTags = schemas.get(schemaName);
      if (schemaTags && !customTags) {
        return addMergeTag && !schemaTags.includes(merge2.merge) ? schemaTags.concat(merge2.merge) : schemaTags.slice();
      }
      let tags = schemaTags;
      if (!tags) {
        if (Array.isArray(customTags))
          tags = [];
        else {
          const keys = Array.from(schemas.keys()).filter((key) => key !== "yaml11").map((key) => JSON.stringify(key)).join(", ");
          throw new Error(`Unknown schema "${schemaName}"; use one of ${keys} or define customTags array`);
        }
      }
      if (Array.isArray(customTags)) {
        for (const tag of customTags)
          tags = tags.concat(tag);
      } else if (typeof customTags === "function") {
        tags = customTags(tags.slice());
      }
      if (addMergeTag)
        tags = tags.concat(merge2.merge);
      return tags.reduce((tags2, tag) => {
        const tagObj = typeof tag === "string" ? tagsByName[tag] : tag;
        if (!tagObj) {
          const tagName = JSON.stringify(tag);
          const keys = Object.keys(tagsByName).map((key) => JSON.stringify(key)).join(", ");
          throw new Error(`Unknown custom tag ${tagName}; use one of ${keys}`);
        }
        if (!tags2.includes(tagObj))
          tags2.push(tagObj);
        return tags2;
      }, []);
    }
    exports2.coreKnownTags = coreKnownTags;
    exports2.getTags = getTags;
  }
});

// node_modules/yaml/dist/schema/Schema.js
var require_Schema = __commonJS({
  "node_modules/yaml/dist/schema/Schema.js"(exports2) {
    "use strict";
    var identity = require_identity();
    var map2 = require_map();
    var seq = require_seq();
    var string4 = require_string();
    var tags = require_tags();
    var sortMapEntriesByKey = (a, b) => a.key < b.key ? -1 : a.key > b.key ? 1 : 0;
    var Schema = class _Schema {
      constructor({ compat, customTags, merge: merge2, resolveKnownTags, schema, sortMapEntries, toStringDefaults }) {
        this.compat = Array.isArray(compat) ? tags.getTags(compat, "compat") : compat ? tags.getTags(null, compat) : null;
        this.name = typeof schema === "string" && schema || "core";
        this.knownTags = resolveKnownTags ? tags.coreKnownTags : {};
        this.tags = tags.getTags(customTags, this.name, merge2);
        this.toStringOptions = toStringDefaults ?? null;
        Object.defineProperty(this, identity.MAP, { value: map2.map });
        Object.defineProperty(this, identity.SCALAR, { value: string4.string });
        Object.defineProperty(this, identity.SEQ, { value: seq.seq });
        this.sortMapEntries = typeof sortMapEntries === "function" ? sortMapEntries : sortMapEntries === true ? sortMapEntriesByKey : null;
      }
      clone() {
        const copy = Object.create(_Schema.prototype, Object.getOwnPropertyDescriptors(this));
        copy.tags = this.tags.slice();
        return copy;
      }
    };
    exports2.Schema = Schema;
  }
});

// node_modules/yaml/dist/stringify/stringifyDocument.js
var require_stringifyDocument = __commonJS({
  "node_modules/yaml/dist/stringify/stringifyDocument.js"(exports2) {
    "use strict";
    var identity = require_identity();
    var stringify = require_stringify();
    var stringifyComment = require_stringifyComment();
    function stringifyDocument(doc, options2) {
      const lines = [];
      let hasDirectives = options2.directives === true;
      if (options2.directives !== false && doc.directives) {
        const dir = doc.directives.toString(doc);
        if (dir) {
          lines.push(dir);
          hasDirectives = true;
        } else if (doc.directives.docStart)
          hasDirectives = true;
      }
      if (hasDirectives)
        lines.push("---");
      const ctx = stringify.createStringifyContext(doc, options2);
      const { commentString } = ctx.options;
      if (doc.commentBefore) {
        if (lines.length !== 1)
          lines.unshift("");
        const cs = commentString(doc.commentBefore);
        lines.unshift(stringifyComment.indentComment(cs, ""));
      }
      let chompKeep = false;
      let contentComment = null;
      if (doc.contents) {
        if (identity.isNode(doc.contents)) {
          if (doc.contents.spaceBefore && hasDirectives)
            lines.push("");
          if (doc.contents.commentBefore) {
            const cs = commentString(doc.contents.commentBefore);
            lines.push(stringifyComment.indentComment(cs, ""));
          }
          ctx.forceBlockIndent = !!doc.comment;
          contentComment = doc.contents.comment;
        }
        const onChompKeep = contentComment ? void 0 : () => chompKeep = true;
        let body = stringify.stringify(doc.contents, ctx, () => contentComment = null, onChompKeep);
        if (contentComment)
          body += stringifyComment.lineComment(body, "", commentString(contentComment));
        if ((body[0] === "|" || body[0] === ">") && lines[lines.length - 1] === "---") {
          lines[lines.length - 1] = `--- ${body}`;
        } else
          lines.push(body);
      } else {
        lines.push(stringify.stringify(doc.contents, ctx));
      }
      if (doc.directives?.docEnd) {
        if (doc.comment) {
          const cs = commentString(doc.comment);
          if (cs.includes("\n")) {
            lines.push("...");
            lines.push(stringifyComment.indentComment(cs, ""));
          } else {
            lines.push(`... ${cs}`);
          }
        } else {
          lines.push("...");
        }
      } else {
        let dc = doc.comment;
        if (dc && chompKeep)
          dc = dc.replace(/^\n+/, "");
        if (dc) {
          if ((!chompKeep || contentComment) && lines[lines.length - 1] !== "")
            lines.push("");
          lines.push(stringifyComment.indentComment(commentString(dc), ""));
        }
      }
      return lines.join("\n") + "\n";
    }
    exports2.stringifyDocument = stringifyDocument;
  }
});

// node_modules/yaml/dist/doc/Document.js
var require_Document = __commonJS({
  "node_modules/yaml/dist/doc/Document.js"(exports2) {
    "use strict";
    var Alias = require_Alias();
    var Collection = require_Collection();
    var identity = require_identity();
    var Pair = require_Pair();
    var toJS = require_toJS();
    var Schema = require_Schema();
    var stringifyDocument = require_stringifyDocument();
    var anchors = require_anchors();
    var applyReviver = require_applyReviver();
    var createNode = require_createNode();
    var directives = require_directives();
    var Document = class _Document {
      constructor(value, replacer, options2) {
        this.commentBefore = null;
        this.comment = null;
        this.errors = [];
        this.warnings = [];
        Object.defineProperty(this, identity.NODE_TYPE, { value: identity.DOC });
        let _replacer = null;
        if (typeof replacer === "function" || Array.isArray(replacer)) {
          _replacer = replacer;
        } else if (options2 === void 0 && replacer) {
          options2 = replacer;
          replacer = void 0;
        }
        const opt = Object.assign({
          intAsBigInt: false,
          keepSourceTokens: false,
          logLevel: "warn",
          prettyErrors: true,
          strict: true,
          stringKeys: false,
          uniqueKeys: true,
          version: "1.2"
        }, options2);
        this.options = opt;
        let { version: version2 } = opt;
        if (options2?._directives) {
          this.directives = options2._directives.atDocument();
          if (this.directives.yaml.explicit)
            version2 = this.directives.yaml.version;
        } else
          this.directives = new directives.Directives({ version: version2 });
        this.setSchema(version2, options2);
        this.contents = value === void 0 ? null : this.createNode(value, _replacer, options2);
      }
      /**
       * Create a deep copy of this Document and its contents.
       *
       * Custom Node values that inherit from `Object` still refer to their original instances.
       */
      clone() {
        const copy = Object.create(_Document.prototype, {
          [identity.NODE_TYPE]: { value: identity.DOC }
        });
        copy.commentBefore = this.commentBefore;
        copy.comment = this.comment;
        copy.errors = this.errors.slice();
        copy.warnings = this.warnings.slice();
        copy.options = Object.assign({}, this.options);
        if (this.directives)
          copy.directives = this.directives.clone();
        copy.schema = this.schema.clone();
        copy.contents = identity.isNode(this.contents) ? this.contents.clone(copy.schema) : this.contents;
        if (this.range)
          copy.range = this.range.slice();
        return copy;
      }
      /** Adds a value to the document. */
      add(value) {
        if (assertCollection(this.contents))
          this.contents.add(value);
      }
      /** Adds a value to the document. */
      addIn(path, value) {
        if (assertCollection(this.contents))
          this.contents.addIn(path, value);
      }
      /**
       * Create a new `Alias` node, ensuring that the target `node` has the required anchor.
       *
       * If `node` already has an anchor, `name` is ignored.
       * Otherwise, the `node.anchor` value will be set to `name`,
       * or if an anchor with that name is already present in the document,
       * `name` will be used as a prefix for a new unique anchor.
       * If `name` is undefined, the generated anchor will use 'a' as a prefix.
       */
      createAlias(node, name) {
        if (!node.anchor) {
          const prev = anchors.anchorNames(this);
          node.anchor = // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
          !name || prev.has(name) ? anchors.findNewAnchor(name || "a", prev) : name;
        }
        return new Alias.Alias(node.anchor);
      }
      createNode(value, replacer, options2) {
        let _replacer = void 0;
        if (typeof replacer === "function") {
          value = replacer.call({ "": value }, "", value);
          _replacer = replacer;
        } else if (Array.isArray(replacer)) {
          const keyToStr = (v) => typeof v === "number" || v instanceof String || v instanceof Number;
          const asStr = replacer.filter(keyToStr).map(String);
          if (asStr.length > 0)
            replacer = replacer.concat(asStr);
          _replacer = replacer;
        } else if (options2 === void 0 && replacer) {
          options2 = replacer;
          replacer = void 0;
        }
        const { aliasDuplicateObjects, anchorPrefix, flow, keepUndefined, onTagObj, tag } = options2 ?? {};
        const { onAnchor, setAnchors, sourceObjects } = anchors.createNodeAnchors(
          this,
          // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
          anchorPrefix || "a"
        );
        const ctx = {
          aliasDuplicateObjects: aliasDuplicateObjects ?? true,
          keepUndefined: keepUndefined ?? false,
          onAnchor,
          onTagObj,
          replacer: _replacer,
          schema: this.schema,
          sourceObjects
        };
        const node = createNode.createNode(value, tag, ctx);
        if (flow && identity.isCollection(node))
          node.flow = true;
        setAnchors();
        return node;
      }
      /**
       * Convert a key and a value into a `Pair` using the current schema,
       * recursively wrapping all values as `Scalar` or `Collection` nodes.
       */
      createPair(key, value, options2 = {}) {
        const k = this.createNode(key, null, options2);
        const v = this.createNode(value, null, options2);
        return new Pair.Pair(k, v);
      }
      /**
       * Removes a value from the document.
       * @returns `true` if the item was found and removed.
       */
      delete(key) {
        return assertCollection(this.contents) ? this.contents.delete(key) : false;
      }
      /**
       * Removes a value from the document.
       * @returns `true` if the item was found and removed.
       */
      deleteIn(path) {
        if (Collection.isEmptyPath(path)) {
          if (this.contents == null)
            return false;
          this.contents = null;
          return true;
        }
        return assertCollection(this.contents) ? this.contents.deleteIn(path) : false;
      }
      /**
       * Returns item at `key`, or `undefined` if not found. By default unwraps
       * scalar values from their surrounding node; to disable set `keepScalar` to
       * `true` (collections are always returned intact).
       */
      get(key, keepScalar) {
        return identity.isCollection(this.contents) ? this.contents.get(key, keepScalar) : void 0;
      }
      /**
       * Returns item at `path`, or `undefined` if not found. By default unwraps
       * scalar values from their surrounding node; to disable set `keepScalar` to
       * `true` (collections are always returned intact).
       */
      getIn(path, keepScalar) {
        if (Collection.isEmptyPath(path))
          return !keepScalar && identity.isScalar(this.contents) ? this.contents.value : this.contents;
        return identity.isCollection(this.contents) ? this.contents.getIn(path, keepScalar) : void 0;
      }
      /**
       * Checks if the document includes a value with the key `key`.
       */
      has(key) {
        return identity.isCollection(this.contents) ? this.contents.has(key) : false;
      }
      /**
       * Checks if the document includes a value at `path`.
       */
      hasIn(path) {
        if (Collection.isEmptyPath(path))
          return this.contents !== void 0;
        return identity.isCollection(this.contents) ? this.contents.hasIn(path) : false;
      }
      /**
       * Sets a value in this document. For `!!set`, `value` needs to be a
       * boolean to add/remove the item from the set.
       */
      set(key, value) {
        if (this.contents == null) {
          this.contents = Collection.collectionFromPath(this.schema, [key], value);
        } else if (assertCollection(this.contents)) {
          this.contents.set(key, value);
        }
      }
      /**
       * Sets a value in this document. For `!!set`, `value` needs to be a
       * boolean to add/remove the item from the set.
       */
      setIn(path, value) {
        if (Collection.isEmptyPath(path)) {
          this.contents = value;
        } else if (this.contents == null) {
          this.contents = Collection.collectionFromPath(this.schema, Array.from(path), value);
        } else if (assertCollection(this.contents)) {
          this.contents.setIn(path, value);
        }
      }
      /**
       * Change the YAML version and schema used by the document.
       * A `null` version disables support for directives, explicit tags, anchors, and aliases.
       * It also requires the `schema` option to be given as a `Schema` instance value.
       *
       * Overrides all previously set schema options.
       */
      setSchema(version2, options2 = {}) {
        if (typeof version2 === "number")
          version2 = String(version2);
        let opt;
        switch (version2) {
          case "1.1":
            if (this.directives)
              this.directives.yaml.version = "1.1";
            else
              this.directives = new directives.Directives({ version: "1.1" });
            opt = { resolveKnownTags: false, schema: "yaml-1.1" };
            break;
          case "1.2":
          case "next":
            if (this.directives)
              this.directives.yaml.version = version2;
            else
              this.directives = new directives.Directives({ version: version2 });
            opt = { resolveKnownTags: true, schema: "core" };
            break;
          case null:
            if (this.directives)
              delete this.directives;
            opt = null;
            break;
          default: {
            const sv = JSON.stringify(version2);
            throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${sv}`);
          }
        }
        if (options2.schema instanceof Object)
          this.schema = options2.schema;
        else if (opt)
          this.schema = new Schema.Schema(Object.assign(opt, options2));
        else
          throw new Error(`With a null YAML version, the { schema: Schema } option is required`);
      }
      // json & jsonArg are only used from toJSON()
      toJS({ json: json2, jsonArg, mapAsMap, maxAliasCount, onAnchor, reviver } = {}) {
        const ctx = {
          anchors: /* @__PURE__ */ new Map(),
          doc: this,
          keep: !json2,
          mapAsMap: mapAsMap === true,
          mapKeyWarned: false,
          maxAliasCount: typeof maxAliasCount === "number" ? maxAliasCount : 100
        };
        const res = toJS.toJS(this.contents, jsonArg ?? "", ctx);
        if (typeof onAnchor === "function")
          for (const { count, res: res2 } of ctx.anchors.values())
            onAnchor(res2, count);
        return typeof reviver === "function" ? applyReviver.applyReviver(reviver, { "": res }, "", res) : res;
      }
      /**
       * A JSON representation of the document `contents`.
       *
       * @param jsonArg Used by `JSON.stringify` to indicate the array index or
       *   property name.
       */
      toJSON(jsonArg, onAnchor) {
        return this.toJS({ json: true, jsonArg, mapAsMap: false, onAnchor });
      }
      /** A YAML representation of the document. */
      toString(options2 = {}) {
        if (this.errors.length > 0)
          throw new Error("Document with errors cannot be stringified");
        if ("indent" in options2 && (!Number.isInteger(options2.indent) || Number(options2.indent) <= 0)) {
          const s = JSON.stringify(options2.indent);
          throw new Error(`"indent" option must be a positive integer, not ${s}`);
        }
        return stringifyDocument.stringifyDocument(this, options2);
      }
    };
    function assertCollection(contents) {
      if (identity.isCollection(contents))
        return true;
      throw new Error("Expected a YAML collection as document contents");
    }
    exports2.Document = Document;
  }
});

// node_modules/yaml/dist/errors.js
var require_errors = __commonJS({
  "node_modules/yaml/dist/errors.js"(exports2) {
    "use strict";
    var YAMLError = class extends Error {
      constructor(name, pos, code, message) {
        super();
        this.name = name;
        this.code = code;
        this.message = message;
        this.pos = pos;
      }
    };
    var YAMLParseError = class extends YAMLError {
      constructor(pos, code, message) {
        super("YAMLParseError", pos, code, message);
      }
    };
    var YAMLWarning = class extends YAMLError {
      constructor(pos, code, message) {
        super("YAMLWarning", pos, code, message);
      }
    };
    var prettifyError2 = (src, lc) => (error48) => {
      if (error48.pos[0] === -1)
        return;
      error48.linePos = error48.pos.map((pos) => lc.linePos(pos));
      const { line, col } = error48.linePos[0];
      error48.message += ` at line ${line}, column ${col}`;
      let ci = col - 1;
      let lineStr = src.substring(lc.lineStarts[line - 1], lc.lineStarts[line]).replace(/[\n\r]+$/, "");
      if (ci >= 60 && lineStr.length > 80) {
        const trimStart = Math.min(ci - 39, lineStr.length - 79);
        lineStr = "\u2026" + lineStr.substring(trimStart);
        ci -= trimStart - 1;
      }
      if (lineStr.length > 80)
        lineStr = lineStr.substring(0, 79) + "\u2026";
      if (line > 1 && /^ *$/.test(lineStr.substring(0, ci))) {
        let prev = src.substring(lc.lineStarts[line - 2], lc.lineStarts[line - 1]);
        if (prev.length > 80)
          prev = prev.substring(0, 79) + "\u2026\n";
        lineStr = prev + lineStr;
      }
      if (/[^ ]/.test(lineStr)) {
        let count = 1;
        const end = error48.linePos[1];
        if (end?.line === line && end.col > col) {
          count = Math.max(1, Math.min(end.col - col, 80 - ci));
        }
        const pointer = " ".repeat(ci) + "^".repeat(count);
        error48.message += `:

${lineStr}
${pointer}
`;
      }
    };
    exports2.YAMLError = YAMLError;
    exports2.YAMLParseError = YAMLParseError;
    exports2.YAMLWarning = YAMLWarning;
    exports2.prettifyError = prettifyError2;
  }
});

// node_modules/yaml/dist/compose/resolve-props.js
var require_resolve_props = __commonJS({
  "node_modules/yaml/dist/compose/resolve-props.js"(exports2) {
    "use strict";
    function resolveProps(tokens, { flow, indicator, next, offset, onError, parentIndent, startOnNewline }) {
      let spaceBefore = false;
      let atNewline = startOnNewline;
      let hasSpace = startOnNewline;
      let comment = "";
      let commentSep = "";
      let hasNewline = false;
      let reqSpace = false;
      let tab = null;
      let anchor = null;
      let tag = null;
      let newlineAfterProp = null;
      let comma = null;
      let found = null;
      let start = null;
      for (const token of tokens) {
        if (reqSpace) {
          if (token.type !== "space" && token.type !== "newline" && token.type !== "comma")
            onError(token.offset, "MISSING_CHAR", "Tags and anchors must be separated from the next token by white space");
          reqSpace = false;
        }
        if (tab) {
          if (atNewline && token.type !== "comment" && token.type !== "newline") {
            onError(tab, "TAB_AS_INDENT", "Tabs are not allowed as indentation");
          }
          tab = null;
        }
        switch (token.type) {
          case "space":
            if (!flow && (indicator !== "doc-start" || next?.type !== "flow-collection") && token.source.includes("	")) {
              tab = token;
            }
            hasSpace = true;
            break;
          case "comment": {
            if (!hasSpace)
              onError(token, "MISSING_CHAR", "Comments must be separated from other tokens by white space characters");
            const cb = token.source.substring(1) || " ";
            if (!comment)
              comment = cb;
            else
              comment += commentSep + cb;
            commentSep = "";
            atNewline = false;
            break;
          }
          case "newline":
            if (atNewline) {
              if (comment)
                comment += token.source;
              else if (!found || indicator !== "seq-item-ind")
                spaceBefore = true;
            } else
              commentSep += token.source;
            atNewline = true;
            hasNewline = true;
            if (anchor || tag)
              newlineAfterProp = token;
            hasSpace = true;
            break;
          case "anchor":
            if (anchor)
              onError(token, "MULTIPLE_ANCHORS", "A node can have at most one anchor");
            if (token.source.endsWith(":"))
              onError(token.offset + token.source.length - 1, "BAD_ALIAS", "Anchor ending in : is ambiguous", true);
            anchor = token;
            start ?? (start = token.offset);
            atNewline = false;
            hasSpace = false;
            reqSpace = true;
            break;
          case "tag": {
            if (tag)
              onError(token, "MULTIPLE_TAGS", "A node can have at most one tag");
            tag = token;
            start ?? (start = token.offset);
            atNewline = false;
            hasSpace = false;
            reqSpace = true;
            break;
          }
          case indicator:
            if (anchor || tag)
              onError(token, "BAD_PROP_ORDER", `Anchors and tags must be after the ${token.source} indicator`);
            if (found)
              onError(token, "UNEXPECTED_TOKEN", `Unexpected ${token.source} in ${flow ?? "collection"}`);
            found = token;
            atNewline = indicator === "seq-item-ind" || indicator === "explicit-key-ind";
            hasSpace = false;
            break;
          case "comma":
            if (flow) {
              if (comma)
                onError(token, "UNEXPECTED_TOKEN", `Unexpected , in ${flow}`);
              comma = token;
              atNewline = false;
              hasSpace = false;
              break;
            }
          // else fallthrough
          default:
            onError(token, "UNEXPECTED_TOKEN", `Unexpected ${token.type} token`);
            atNewline = false;
            hasSpace = false;
        }
      }
      const last = tokens[tokens.length - 1];
      const end = last ? last.offset + last.source.length : offset;
      if (reqSpace && next && next.type !== "space" && next.type !== "newline" && next.type !== "comma" && (next.type !== "scalar" || next.source !== "")) {
        onError(next.offset, "MISSING_CHAR", "Tags and anchors must be separated from the next token by white space");
      }
      if (tab && (atNewline && tab.indent <= parentIndent || next?.type === "block-map" || next?.type === "block-seq"))
        onError(tab, "TAB_AS_INDENT", "Tabs are not allowed as indentation");
      return {
        comma,
        found,
        spaceBefore,
        comment,
        hasNewline,
        anchor,
        tag,
        newlineAfterProp,
        end,
        start: start ?? end
      };
    }
    exports2.resolveProps = resolveProps;
  }
});

// node_modules/yaml/dist/compose/util-contains-newline.js
var require_util_contains_newline = __commonJS({
  "node_modules/yaml/dist/compose/util-contains-newline.js"(exports2) {
    "use strict";
    function containsNewline(key) {
      if (!key)
        return null;
      switch (key.type) {
        case "alias":
        case "scalar":
        case "double-quoted-scalar":
        case "single-quoted-scalar":
          if (key.source.includes("\n"))
            return true;
          if (key.end) {
            for (const st of key.end)
              if (st.type === "newline")
                return true;
          }
          return false;
        case "flow-collection":
          for (const it of key.items) {
            for (const st of it.start)
              if (st.type === "newline")
                return true;
            if (it.sep) {
              for (const st of it.sep)
                if (st.type === "newline")
                  return true;
            }
            if (containsNewline(it.key) || containsNewline(it.value))
              return true;
          }
          return false;
        default:
          return true;
      }
    }
    exports2.containsNewline = containsNewline;
  }
});

// node_modules/yaml/dist/compose/util-flow-indent-check.js
var require_util_flow_indent_check = __commonJS({
  "node_modules/yaml/dist/compose/util-flow-indent-check.js"(exports2) {
    "use strict";
    var utilContainsNewline = require_util_contains_newline();
    function flowIndentCheck(indent, fc, onError) {
      if (fc?.type === "flow-collection") {
        const end = fc.end[0];
        if (end.indent === indent && (end.source === "]" || end.source === "}") && utilContainsNewline.containsNewline(fc)) {
          const msg = "Flow end indicator should be more indented than parent";
          onError(end, "BAD_INDENT", msg, true);
        }
      }
    }
    exports2.flowIndentCheck = flowIndentCheck;
  }
});

// node_modules/yaml/dist/compose/util-map-includes.js
var require_util_map_includes = __commonJS({
  "node_modules/yaml/dist/compose/util-map-includes.js"(exports2) {
    "use strict";
    var identity = require_identity();
    function mapIncludes(ctx, items, search) {
      const { uniqueKeys } = ctx.options;
      if (uniqueKeys === false)
        return false;
      const isEqual = typeof uniqueKeys === "function" ? uniqueKeys : (a, b) => a === b || identity.isScalar(a) && identity.isScalar(b) && a.value === b.value;
      return items.some((pair) => isEqual(pair.key, search));
    }
    exports2.mapIncludes = mapIncludes;
  }
});

// node_modules/yaml/dist/compose/resolve-block-map.js
var require_resolve_block_map = __commonJS({
  "node_modules/yaml/dist/compose/resolve-block-map.js"(exports2) {
    "use strict";
    var Pair = require_Pair();
    var YAMLMap = require_YAMLMap();
    var resolveProps = require_resolve_props();
    var utilContainsNewline = require_util_contains_newline();
    var utilFlowIndentCheck = require_util_flow_indent_check();
    var utilMapIncludes = require_util_map_includes();
    var startColMsg = "All mapping items must start at the same column";
    function resolveBlockMap({ composeNode, composeEmptyNode }, ctx, bm, onError, tag) {
      const NodeClass = tag?.nodeClass ?? YAMLMap.YAMLMap;
      const map2 = new NodeClass(ctx.schema);
      if (ctx.atRoot)
        ctx.atRoot = false;
      let offset = bm.offset;
      let commentEnd = null;
      for (const collItem of bm.items) {
        const { start, key, sep, value } = collItem;
        const keyProps = resolveProps.resolveProps(start, {
          indicator: "explicit-key-ind",
          next: key ?? sep?.[0],
          offset,
          onError,
          parentIndent: bm.indent,
          startOnNewline: true
        });
        const implicitKey = !keyProps.found;
        if (implicitKey) {
          if (key) {
            if (key.type === "block-seq")
              onError(offset, "BLOCK_AS_IMPLICIT_KEY", "A block sequence may not be used as an implicit map key");
            else if ("indent" in key && key.indent !== bm.indent)
              onError(offset, "BAD_INDENT", startColMsg);
          }
          if (!keyProps.anchor && !keyProps.tag && !sep) {
            commentEnd = keyProps.end;
            if (keyProps.comment) {
              if (map2.comment)
                map2.comment += "\n" + keyProps.comment;
              else
                map2.comment = keyProps.comment;
            }
            continue;
          }
          if (keyProps.newlineAfterProp || utilContainsNewline.containsNewline(key)) {
            onError(key ?? start[start.length - 1], "MULTILINE_IMPLICIT_KEY", "Implicit keys need to be on a single line");
          }
        } else if (keyProps.found?.indent !== bm.indent) {
          onError(offset, "BAD_INDENT", startColMsg);
        }
        ctx.atKey = true;
        const keyStart = keyProps.end;
        const keyNode = key ? composeNode(ctx, key, keyProps, onError) : composeEmptyNode(ctx, keyStart, start, null, keyProps, onError);
        if (ctx.schema.compat)
          utilFlowIndentCheck.flowIndentCheck(bm.indent, key, onError);
        ctx.atKey = false;
        if (utilMapIncludes.mapIncludes(ctx, map2.items, keyNode))
          onError(keyStart, "DUPLICATE_KEY", "Map keys must be unique");
        const valueProps = resolveProps.resolveProps(sep ?? [], {
          indicator: "map-value-ind",
          next: value,
          offset: keyNode.range[2],
          onError,
          parentIndent: bm.indent,
          startOnNewline: !key || key.type === "block-scalar"
        });
        offset = valueProps.end;
        if (valueProps.found) {
          if (implicitKey) {
            if (value?.type === "block-map" && !valueProps.hasNewline)
              onError(offset, "BLOCK_AS_IMPLICIT_KEY", "Nested mappings are not allowed in compact mappings");
            if (ctx.options.strict && keyProps.start < valueProps.found.offset - 1024)
              onError(keyNode.range, "KEY_OVER_1024_CHARS", "The : indicator must be at most 1024 chars after the start of an implicit block mapping key");
          }
          const valueNode = value ? composeNode(ctx, value, valueProps, onError) : composeEmptyNode(ctx, offset, sep, null, valueProps, onError);
          if (ctx.schema.compat)
            utilFlowIndentCheck.flowIndentCheck(bm.indent, value, onError);
          offset = valueNode.range[2];
          const pair = new Pair.Pair(keyNode, valueNode);
          if (ctx.options.keepSourceTokens)
            pair.srcToken = collItem;
          map2.items.push(pair);
        } else {
          if (implicitKey)
            onError(keyNode.range, "MISSING_CHAR", "Implicit map keys need to be followed by map values");
          if (valueProps.comment) {
            if (keyNode.comment)
              keyNode.comment += "\n" + valueProps.comment;
            else
              keyNode.comment = valueProps.comment;
          }
          const pair = new Pair.Pair(keyNode);
          if (ctx.options.keepSourceTokens)
            pair.srcToken = collItem;
          map2.items.push(pair);
        }
      }
      if (commentEnd && commentEnd < offset)
        onError(commentEnd, "IMPOSSIBLE", "Map comment with trailing content");
      map2.range = [bm.offset, offset, commentEnd ?? offset];
      return map2;
    }
    exports2.resolveBlockMap = resolveBlockMap;
  }
});

// node_modules/yaml/dist/compose/resolve-block-seq.js
var require_resolve_block_seq = __commonJS({
  "node_modules/yaml/dist/compose/resolve-block-seq.js"(exports2) {
    "use strict";
    var YAMLSeq = require_YAMLSeq();
    var resolveProps = require_resolve_props();
    var utilFlowIndentCheck = require_util_flow_indent_check();
    function resolveBlockSeq({ composeNode, composeEmptyNode }, ctx, bs, onError, tag) {
      const NodeClass = tag?.nodeClass ?? YAMLSeq.YAMLSeq;
      const seq = new NodeClass(ctx.schema);
      if (ctx.atRoot)
        ctx.atRoot = false;
      if (ctx.atKey)
        ctx.atKey = false;
      let offset = bs.offset;
      let commentEnd = null;
      for (const { start, value } of bs.items) {
        const props = resolveProps.resolveProps(start, {
          indicator: "seq-item-ind",
          next: value,
          offset,
          onError,
          parentIndent: bs.indent,
          startOnNewline: true
        });
        if (!props.found) {
          if (props.anchor || props.tag || value) {
            if (value?.type === "block-seq")
              onError(props.end, "BAD_INDENT", "All sequence items must start at the same column");
            else
              onError(offset, "MISSING_CHAR", "Sequence item without - indicator");
          } else {
            commentEnd = props.end;
            if (props.comment)
              seq.comment = props.comment;
            continue;
          }
        }
        const node = value ? composeNode(ctx, value, props, onError) : composeEmptyNode(ctx, props.end, start, null, props, onError);
        if (ctx.schema.compat)
          utilFlowIndentCheck.flowIndentCheck(bs.indent, value, onError);
        offset = node.range[2];
        seq.items.push(node);
      }
      seq.range = [bs.offset, offset, commentEnd ?? offset];
      return seq;
    }
    exports2.resolveBlockSeq = resolveBlockSeq;
  }
});

// node_modules/yaml/dist/compose/resolve-end.js
var require_resolve_end = __commonJS({
  "node_modules/yaml/dist/compose/resolve-end.js"(exports2) {
    "use strict";
    function resolveEnd(end, offset, reqSpace, onError) {
      let comment = "";
      if (end) {
        let hasSpace = false;
        let sep = "";
        for (const token of end) {
          const { source, type } = token;
          switch (type) {
            case "space":
              hasSpace = true;
              break;
            case "comment": {
              if (reqSpace && !hasSpace)
                onError(token, "MISSING_CHAR", "Comments must be separated from other tokens by white space characters");
              const cb = source.substring(1) || " ";
              if (!comment)
                comment = cb;
              else
                comment += sep + cb;
              sep = "";
              break;
            }
            case "newline":
              if (comment)
                sep += source;
              hasSpace = true;
              break;
            default:
              onError(token, "UNEXPECTED_TOKEN", `Unexpected ${type} at node end`);
          }
          offset += source.length;
        }
      }
      return { comment, offset };
    }
    exports2.resolveEnd = resolveEnd;
  }
});

// node_modules/yaml/dist/compose/resolve-flow-collection.js
var require_resolve_flow_collection = __commonJS({
  "node_modules/yaml/dist/compose/resolve-flow-collection.js"(exports2) {
    "use strict";
    var identity = require_identity();
    var Pair = require_Pair();
    var YAMLMap = require_YAMLMap();
    var YAMLSeq = require_YAMLSeq();
    var resolveEnd = require_resolve_end();
    var resolveProps = require_resolve_props();
    var utilContainsNewline = require_util_contains_newline();
    var utilMapIncludes = require_util_map_includes();
    var blockMsg = "Block collections are not allowed within flow collections";
    var isBlock = (token) => token && (token.type === "block-map" || token.type === "block-seq");
    function resolveFlowCollection({ composeNode, composeEmptyNode }, ctx, fc, onError, tag) {
      const isMap = fc.start.source === "{";
      const fcName = isMap ? "flow map" : "flow sequence";
      const NodeClass = tag?.nodeClass ?? (isMap ? YAMLMap.YAMLMap : YAMLSeq.YAMLSeq);
      const coll = new NodeClass(ctx.schema);
      coll.flow = true;
      const atRoot = ctx.atRoot;
      if (atRoot)
        ctx.atRoot = false;
      if (ctx.atKey)
        ctx.atKey = false;
      let offset = fc.offset + fc.start.source.length;
      for (let i = 0; i < fc.items.length; ++i) {
        const collItem = fc.items[i];
        const { start, key, sep, value } = collItem;
        const props = resolveProps.resolveProps(start, {
          flow: fcName,
          indicator: "explicit-key-ind",
          next: key ?? sep?.[0],
          offset,
          onError,
          parentIndent: fc.indent,
          startOnNewline: false
        });
        if (!props.found) {
          if (!props.anchor && !props.tag && !sep && !value) {
            if (i === 0 && props.comma)
              onError(props.comma, "UNEXPECTED_TOKEN", `Unexpected , in ${fcName}`);
            else if (i < fc.items.length - 1)
              onError(props.start, "UNEXPECTED_TOKEN", `Unexpected empty item in ${fcName}`);
            if (props.comment) {
              if (coll.comment)
                coll.comment += "\n" + props.comment;
              else
                coll.comment = props.comment;
            }
            offset = props.end;
            continue;
          }
          if (!isMap && ctx.options.strict && utilContainsNewline.containsNewline(key))
            onError(
              key,
              // checked by containsNewline()
              "MULTILINE_IMPLICIT_KEY",
              "Implicit keys of flow sequence pairs need to be on a single line"
            );
        }
        if (i === 0) {
          if (props.comma)
            onError(props.comma, "UNEXPECTED_TOKEN", `Unexpected , in ${fcName}`);
        } else {
          if (!props.comma)
            onError(props.start, "MISSING_CHAR", `Missing , between ${fcName} items`);
          if (props.comment) {
            let prevItemComment = "";
            loop: for (const st of start) {
              switch (st.type) {
                case "comma":
                case "space":
                  break;
                case "comment":
                  prevItemComment = st.source.substring(1);
                  break loop;
                default:
                  break loop;
              }
            }
            if (prevItemComment) {
              let prev = coll.items[coll.items.length - 1];
              if (identity.isPair(prev))
                prev = prev.value ?? prev.key;
              if (prev.comment)
                prev.comment += "\n" + prevItemComment;
              else
                prev.comment = prevItemComment;
              props.comment = props.comment.substring(prevItemComment.length + 1);
            }
          }
        }
        if (!isMap && !sep && !props.found) {
          const valueNode = value ? composeNode(ctx, value, props, onError) : composeEmptyNode(ctx, props.end, sep, null, props, onError);
          coll.items.push(valueNode);
          offset = valueNode.range[2];
          if (isBlock(value))
            onError(valueNode.range, "BLOCK_IN_FLOW", blockMsg);
        } else {
          ctx.atKey = true;
          const keyStart = props.end;
          const keyNode = key ? composeNode(ctx, key, props, onError) : composeEmptyNode(ctx, keyStart, start, null, props, onError);
          if (isBlock(key))
            onError(keyNode.range, "BLOCK_IN_FLOW", blockMsg);
          ctx.atKey = false;
          const valueProps = resolveProps.resolveProps(sep ?? [], {
            flow: fcName,
            indicator: "map-value-ind",
            next: value,
            offset: keyNode.range[2],
            onError,
            parentIndent: fc.indent,
            startOnNewline: false
          });
          if (valueProps.found) {
            if (!isMap && !props.found && ctx.options.strict) {
              if (sep)
                for (const st of sep) {
                  if (st === valueProps.found)
                    break;
                  if (st.type === "newline") {
                    onError(st, "MULTILINE_IMPLICIT_KEY", "Implicit keys of flow sequence pairs need to be on a single line");
                    break;
                  }
                }
              if (props.start < valueProps.found.offset - 1024)
                onError(valueProps.found, "KEY_OVER_1024_CHARS", "The : indicator must be at most 1024 chars after the start of an implicit flow sequence key");
            }
          } else if (value) {
            if ("source" in value && value.source?.[0] === ":")
              onError(value, "MISSING_CHAR", `Missing space after : in ${fcName}`);
            else
              onError(valueProps.start, "MISSING_CHAR", `Missing , or : between ${fcName} items`);
          }
          const valueNode = value ? composeNode(ctx, value, valueProps, onError) : valueProps.found ? composeEmptyNode(ctx, valueProps.end, sep, null, valueProps, onError) : null;
          if (valueNode) {
            if (isBlock(value))
              onError(valueNode.range, "BLOCK_IN_FLOW", blockMsg);
          } else if (valueProps.comment) {
            if (keyNode.comment)
              keyNode.comment += "\n" + valueProps.comment;
            else
              keyNode.comment = valueProps.comment;
          }
          const pair = new Pair.Pair(keyNode, valueNode);
          if (ctx.options.keepSourceTokens)
            pair.srcToken = collItem;
          if (isMap) {
            const map2 = coll;
            if (utilMapIncludes.mapIncludes(ctx, map2.items, keyNode))
              onError(keyStart, "DUPLICATE_KEY", "Map keys must be unique");
            map2.items.push(pair);
          } else {
            const map2 = new YAMLMap.YAMLMap(ctx.schema);
            map2.flow = true;
            map2.items.push(pair);
            const endRange = (valueNode ?? keyNode).range;
            map2.range = [keyNode.range[0], endRange[1], endRange[2]];
            coll.items.push(map2);
          }
          offset = valueNode ? valueNode.range[2] : valueProps.end;
        }
      }
      const expectedEnd = isMap ? "}" : "]";
      const [ce, ...ee] = fc.end;
      let cePos = offset;
      if (ce?.source === expectedEnd)
        cePos = ce.offset + ce.source.length;
      else {
        const name = fcName[0].toUpperCase() + fcName.substring(1);
        const msg = atRoot ? `${name} must end with a ${expectedEnd}` : `${name} in block collection must be sufficiently indented and end with a ${expectedEnd}`;
        onError(offset, atRoot ? "MISSING_CHAR" : "BAD_INDENT", msg);
        if (ce && ce.source.length !== 1)
          ee.unshift(ce);
      }
      if (ee.length > 0) {
        const end = resolveEnd.resolveEnd(ee, cePos, ctx.options.strict, onError);
        if (end.comment) {
          if (coll.comment)
            coll.comment += "\n" + end.comment;
          else
            coll.comment = end.comment;
        }
        coll.range = [fc.offset, cePos, end.offset];
      } else {
        coll.range = [fc.offset, cePos, cePos];
      }
      return coll;
    }
    exports2.resolveFlowCollection = resolveFlowCollection;
  }
});

// node_modules/yaml/dist/compose/compose-collection.js
var require_compose_collection = __commonJS({
  "node_modules/yaml/dist/compose/compose-collection.js"(exports2) {
    "use strict";
    var identity = require_identity();
    var Scalar = require_Scalar();
    var YAMLMap = require_YAMLMap();
    var YAMLSeq = require_YAMLSeq();
    var resolveBlockMap = require_resolve_block_map();
    var resolveBlockSeq = require_resolve_block_seq();
    var resolveFlowCollection = require_resolve_flow_collection();
    function resolveCollection(CN, ctx, token, onError, tagName, tag) {
      const coll = token.type === "block-map" ? resolveBlockMap.resolveBlockMap(CN, ctx, token, onError, tag) : token.type === "block-seq" ? resolveBlockSeq.resolveBlockSeq(CN, ctx, token, onError, tag) : resolveFlowCollection.resolveFlowCollection(CN, ctx, token, onError, tag);
      const Coll = coll.constructor;
      if (tagName === "!" || tagName === Coll.tagName) {
        coll.tag = Coll.tagName;
        return coll;
      }
      if (tagName)
        coll.tag = tagName;
      return coll;
    }
    function composeCollection(CN, ctx, token, props, onError) {
      const tagToken = props.tag;
      const tagName = !tagToken ? null : ctx.directives.tagName(tagToken.source, (msg) => onError(tagToken, "TAG_RESOLVE_FAILED", msg));
      if (token.type === "block-seq") {
        const { anchor, newlineAfterProp: nl } = props;
        const lastProp = anchor && tagToken ? anchor.offset > tagToken.offset ? anchor : tagToken : anchor ?? tagToken;
        if (lastProp && (!nl || nl.offset < lastProp.offset)) {
          const message = "Missing newline after block sequence props";
          onError(lastProp, "MISSING_CHAR", message);
        }
      }
      const expType = token.type === "block-map" ? "map" : token.type === "block-seq" ? "seq" : token.start.source === "{" ? "map" : "seq";
      if (!tagToken || !tagName || tagName === "!" || tagName === YAMLMap.YAMLMap.tagName && expType === "map" || tagName === YAMLSeq.YAMLSeq.tagName && expType === "seq") {
        return resolveCollection(CN, ctx, token, onError, tagName);
      }
      let tag = ctx.schema.tags.find((t) => t.tag === tagName && t.collection === expType);
      if (!tag) {
        const kt = ctx.schema.knownTags[tagName];
        if (kt?.collection === expType) {
          ctx.schema.tags.push(Object.assign({}, kt, { default: false }));
          tag = kt;
        } else {
          if (kt) {
            onError(tagToken, "BAD_COLLECTION_TYPE", `${kt.tag} used for ${expType} collection, but expects ${kt.collection ?? "scalar"}`, true);
          } else {
            onError(tagToken, "TAG_RESOLVE_FAILED", `Unresolved tag: ${tagName}`, true);
          }
          return resolveCollection(CN, ctx, token, onError, tagName);
        }
      }
      const coll = resolveCollection(CN, ctx, token, onError, tagName, tag);
      const res = tag.resolve?.(coll, (msg) => onError(tagToken, "TAG_RESOLVE_FAILED", msg), ctx.options) ?? coll;
      const node = identity.isNode(res) ? res : new Scalar.Scalar(res);
      node.range = coll.range;
      node.tag = tagName;
      if (tag?.format)
        node.format = tag.format;
      return node;
    }
    exports2.composeCollection = composeCollection;
  }
});

// node_modules/yaml/dist/compose/resolve-block-scalar.js
var require_resolve_block_scalar = __commonJS({
  "node_modules/yaml/dist/compose/resolve-block-scalar.js"(exports2) {
    "use strict";
    var Scalar = require_Scalar();
    function resolveBlockScalar(ctx, scalar, onError) {
      const start = scalar.offset;
      const header = parseBlockScalarHeader(scalar, ctx.options.strict, onError);
      if (!header)
        return { value: "", type: null, comment: "", range: [start, start, start] };
      const type = header.mode === ">" ? Scalar.Scalar.BLOCK_FOLDED : Scalar.Scalar.BLOCK_LITERAL;
      const lines = scalar.source ? splitLines3(scalar.source) : [];
      let chompStart = lines.length;
      for (let i = lines.length - 1; i >= 0; --i) {
        const content = lines[i][1];
        if (content === "" || content === "\r")
          chompStart = i;
        else
          break;
      }
      if (chompStart === 0) {
        const value2 = header.chomp === "+" && lines.length > 0 ? "\n".repeat(Math.max(1, lines.length - 1)) : "";
        let end2 = start + header.length;
        if (scalar.source)
          end2 += scalar.source.length;
        return { value: value2, type, comment: header.comment, range: [start, end2, end2] };
      }
      let trimIndent = scalar.indent + header.indent;
      let offset = scalar.offset + header.length;
      let contentStart = 0;
      for (let i = 0; i < chompStart; ++i) {
        const [indent, content] = lines[i];
        if (content === "" || content === "\r") {
          if (header.indent === 0 && indent.length > trimIndent)
            trimIndent = indent.length;
        } else {
          if (indent.length < trimIndent) {
            const message = "Block scalars with more-indented leading empty lines must use an explicit indentation indicator";
            onError(offset + indent.length, "MISSING_CHAR", message);
          }
          if (header.indent === 0)
            trimIndent = indent.length;
          contentStart = i;
          if (trimIndent === 0 && !ctx.atRoot) {
            const message = "Block scalar values in collections must be indented";
            onError(offset, "BAD_INDENT", message);
          }
          break;
        }
        offset += indent.length + content.length + 1;
      }
      for (let i = lines.length - 1; i >= chompStart; --i) {
        if (lines[i][0].length > trimIndent)
          chompStart = i + 1;
      }
      let value = "";
      let sep = "";
      let prevMoreIndented = false;
      for (let i = 0; i < contentStart; ++i)
        value += lines[i][0].slice(trimIndent) + "\n";
      for (let i = contentStart; i < chompStart; ++i) {
        let [indent, content] = lines[i];
        offset += indent.length + content.length + 1;
        const crlf = content[content.length - 1] === "\r";
        if (crlf)
          content = content.slice(0, -1);
        if (content && indent.length < trimIndent) {
          const src = header.indent ? "explicit indentation indicator" : "first line";
          const message = `Block scalar lines must not be less indented than their ${src}`;
          onError(offset - content.length - (crlf ? 2 : 1), "BAD_INDENT", message);
          indent = "";
        }
        if (type === Scalar.Scalar.BLOCK_LITERAL) {
          value += sep + indent.slice(trimIndent) + content;
          sep = "\n";
        } else if (indent.length > trimIndent || content[0] === "	") {
          if (sep === " ")
            sep = "\n";
          else if (!prevMoreIndented && sep === "\n")
            sep = "\n\n";
          value += sep + indent.slice(trimIndent) + content;
          sep = "\n";
          prevMoreIndented = true;
        } else if (content === "") {
          if (sep === "\n")
            value += "\n";
          else
            sep = "\n";
        } else {
          value += sep + content;
          sep = " ";
          prevMoreIndented = false;
        }
      }
      switch (header.chomp) {
        case "-":
          break;
        case "+":
          for (let i = chompStart; i < lines.length; ++i)
            value += "\n" + lines[i][0].slice(trimIndent);
          if (value[value.length - 1] !== "\n")
            value += "\n";
          break;
        default:
          value += "\n";
      }
      const end = start + header.length + scalar.source.length;
      return { value, type, comment: header.comment, range: [start, end, end] };
    }
    function parseBlockScalarHeader({ offset, props }, strict, onError) {
      if (props[0].type !== "block-scalar-header") {
        onError(props[0], "IMPOSSIBLE", "Block scalar header not found");
        return null;
      }
      const { source } = props[0];
      const mode = source[0];
      let indent = 0;
      let chomp = "";
      let error48 = -1;
      for (let i = 1; i < source.length; ++i) {
        const ch = source[i];
        if (!chomp && (ch === "-" || ch === "+"))
          chomp = ch;
        else {
          const n = Number(ch);
          if (!indent && n)
            indent = n;
          else if (error48 === -1)
            error48 = offset + i;
        }
      }
      if (error48 !== -1)
        onError(error48, "UNEXPECTED_TOKEN", `Block scalar header includes extra characters: ${source}`);
      let hasSpace = false;
      let comment = "";
      let length = source.length;
      for (let i = 1; i < props.length; ++i) {
        const token = props[i];
        switch (token.type) {
          case "space":
            hasSpace = true;
          // fallthrough
          case "newline":
            length += token.source.length;
            break;
          case "comment":
            if (strict && !hasSpace) {
              const message = "Comments must be separated from other tokens by white space characters";
              onError(token, "MISSING_CHAR", message);
            }
            length += token.source.length;
            comment = token.source.substring(1);
            break;
          case "error":
            onError(token, "UNEXPECTED_TOKEN", token.message);
            length += token.source.length;
            break;
          /* istanbul ignore next should not happen */
          default: {
            const message = `Unexpected token in block scalar header: ${token.type}`;
            onError(token, "UNEXPECTED_TOKEN", message);
            const ts = token.source;
            if (ts && typeof ts === "string")
              length += ts.length;
          }
        }
      }
      return { mode, indent, chomp, comment, length };
    }
    function splitLines3(source) {
      const split = source.split(/\n( *)/);
      const first = split[0];
      const m = first.match(/^( *)/);
      const line0 = m?.[1] ? [m[1], first.slice(m[1].length)] : ["", first];
      const lines = [line0];
      for (let i = 1; i < split.length; i += 2)
        lines.push([split[i], split[i + 1]]);
      return lines;
    }
    exports2.resolveBlockScalar = resolveBlockScalar;
  }
});

// node_modules/yaml/dist/compose/resolve-flow-scalar.js
var require_resolve_flow_scalar = __commonJS({
  "node_modules/yaml/dist/compose/resolve-flow-scalar.js"(exports2) {
    "use strict";
    var Scalar = require_Scalar();
    var resolveEnd = require_resolve_end();
    function resolveFlowScalar(scalar, strict, onError) {
      const { offset, type, source, end } = scalar;
      let _type;
      let value;
      const _onError2 = (rel, code, msg) => onError(offset + rel, code, msg);
      switch (type) {
        case "scalar":
          _type = Scalar.Scalar.PLAIN;
          value = plainValue(source, _onError2);
          break;
        case "single-quoted-scalar":
          _type = Scalar.Scalar.QUOTE_SINGLE;
          value = singleQuotedValue(source, _onError2);
          break;
        case "double-quoted-scalar":
          _type = Scalar.Scalar.QUOTE_DOUBLE;
          value = doubleQuotedValue(source, _onError2);
          break;
        /* istanbul ignore next should not happen */
        default:
          onError(scalar, "UNEXPECTED_TOKEN", `Expected a flow scalar value, but found: ${type}`);
          return {
            value: "",
            type: null,
            comment: "",
            range: [offset, offset + source.length, offset + source.length]
          };
      }
      const valueEnd = offset + source.length;
      const re = resolveEnd.resolveEnd(end, valueEnd, strict, onError);
      return {
        value,
        type: _type,
        comment: re.comment,
        range: [offset, valueEnd, re.offset]
      };
    }
    function plainValue(source, onError) {
      let badChar = "";
      switch (source[0]) {
        /* istanbul ignore next should not happen */
        case "	":
          badChar = "a tab character";
          break;
        case ",":
          badChar = "flow indicator character ,";
          break;
        case "%":
          badChar = "directive indicator character %";
          break;
        case "|":
        case ">": {
          badChar = `block scalar indicator ${source[0]}`;
          break;
        }
        case "@":
        case "`": {
          badChar = `reserved character ${source[0]}`;
          break;
        }
      }
      if (badChar)
        onError(0, "BAD_SCALAR_START", `Plain value cannot start with ${badChar}`);
      return foldLines(source);
    }
    function singleQuotedValue(source, onError) {
      if (source[source.length - 1] !== "'" || source.length === 1)
        onError(source.length, "MISSING_CHAR", "Missing closing 'quote");
      return foldLines(source.slice(1, -1)).replace(/''/g, "'");
    }
    function foldLines(source) {
      let first, line;
      try {
        first = new RegExp("(.*?)(?<![ 	])[ 	]*\r?\n", "sy");
        line = new RegExp("[ 	]*(.*?)(?:(?<![ 	])[ 	]*)?\r?\n", "sy");
      } catch {
        first = /(.*?)[ \t]*\r?\n/sy;
        line = /[ \t]*(.*?)[ \t]*\r?\n/sy;
      }
      let match = first.exec(source);
      if (!match)
        return source;
      let res = match[1];
      let sep = " ";
      let pos = first.lastIndex;
      line.lastIndex = pos;
      while (match = line.exec(source)) {
        if (match[1] === "") {
          if (sep === "\n")
            res += sep;
          else
            sep = "\n";
        } else {
          res += sep + match[1];
          sep = " ";
        }
        pos = line.lastIndex;
      }
      const last = /[ \t]*(.*)/sy;
      last.lastIndex = pos;
      match = last.exec(source);
      return res + sep + (match?.[1] ?? "");
    }
    function doubleQuotedValue(source, onError) {
      let res = "";
      for (let i = 1; i < source.length - 1; ++i) {
        const ch = source[i];
        if (ch === "\r" && source[i + 1] === "\n")
          continue;
        if (ch === "\n") {
          const { fold, offset } = foldNewline(source, i);
          res += fold;
          i = offset;
        } else if (ch === "\\") {
          let next = source[++i];
          const cc = escapeCodes[next];
          if (cc)
            res += cc;
          else if (next === "\n") {
            next = source[i + 1];
            while (next === " " || next === "	")
              next = source[++i + 1];
          } else if (next === "\r" && source[i + 1] === "\n") {
            next = source[++i + 1];
            while (next === " " || next === "	")
              next = source[++i + 1];
          } else if (next === "x" || next === "u" || next === "U") {
            const length = { x: 2, u: 4, U: 8 }[next];
            res += parseCharCode(source, i + 1, length, onError);
            i += length;
          } else {
            const raw = source.substr(i - 1, 2);
            onError(i - 1, "BAD_DQ_ESCAPE", `Invalid escape sequence ${raw}`);
            res += raw;
          }
        } else if (ch === " " || ch === "	") {
          const wsStart = i;
          let next = source[i + 1];
          while (next === " " || next === "	")
            next = source[++i + 1];
          if (next !== "\n" && !(next === "\r" && source[i + 2] === "\n"))
            res += i > wsStart ? source.slice(wsStart, i + 1) : ch;
        } else {
          res += ch;
        }
      }
      if (source[source.length - 1] !== '"' || source.length === 1)
        onError(source.length, "MISSING_CHAR", 'Missing closing "quote');
      return res;
    }
    function foldNewline(source, offset) {
      let fold = "";
      let ch = source[offset + 1];
      while (ch === " " || ch === "	" || ch === "\n" || ch === "\r") {
        if (ch === "\r" && source[offset + 2] !== "\n")
          break;
        if (ch === "\n")
          fold += "\n";
        offset += 1;
        ch = source[offset + 1];
      }
      if (!fold)
        fold = " ";
      return { fold, offset };
    }
    var escapeCodes = {
      "0": "\0",
      // null character
      a: "\x07",
      // bell character
      b: "\b",
      // backspace
      e: "\x1B",
      // escape character
      f: "\f",
      // form feed
      n: "\n",
      // line feed
      r: "\r",
      // carriage return
      t: "	",
      // horizontal tab
      v: "\v",
      // vertical tab
      N: "\x85",
      // Unicode next line
      _: "\xA0",
      // Unicode non-breaking space
      L: "\u2028",
      // Unicode line separator
      P: "\u2029",
      // Unicode paragraph separator
      " ": " ",
      '"': '"',
      "/": "/",
      "\\": "\\",
      "	": "	"
    };
    function parseCharCode(source, offset, length, onError) {
      const cc = source.substr(offset, length);
      const ok = cc.length === length && /^[0-9a-fA-F]+$/.test(cc);
      const code = ok ? parseInt(cc, 16) : NaN;
      if (isNaN(code)) {
        const raw = source.substr(offset - 2, length + 2);
        onError(offset - 2, "BAD_DQ_ESCAPE", `Invalid escape sequence ${raw}`);
        return raw;
      }
      return String.fromCodePoint(code);
    }
    exports2.resolveFlowScalar = resolveFlowScalar;
  }
});

// node_modules/yaml/dist/compose/compose-scalar.js
var require_compose_scalar = __commonJS({
  "node_modules/yaml/dist/compose/compose-scalar.js"(exports2) {
    "use strict";
    var identity = require_identity();
    var Scalar = require_Scalar();
    var resolveBlockScalar = require_resolve_block_scalar();
    var resolveFlowScalar = require_resolve_flow_scalar();
    function composeScalar(ctx, token, tagToken, onError) {
      const { value, type, comment, range } = token.type === "block-scalar" ? resolveBlockScalar.resolveBlockScalar(ctx, token, onError) : resolveFlowScalar.resolveFlowScalar(token, ctx.options.strict, onError);
      const tagName = tagToken ? ctx.directives.tagName(tagToken.source, (msg) => onError(tagToken, "TAG_RESOLVE_FAILED", msg)) : null;
      let tag;
      if (ctx.options.stringKeys && ctx.atKey) {
        tag = ctx.schema[identity.SCALAR];
      } else if (tagName)
        tag = findScalarTagByName(ctx.schema, value, tagName, tagToken, onError);
      else if (token.type === "scalar")
        tag = findScalarTagByTest(ctx, value, token, onError);
      else
        tag = ctx.schema[identity.SCALAR];
      let scalar;
      try {
        const res = tag.resolve(value, (msg) => onError(tagToken ?? token, "TAG_RESOLVE_FAILED", msg), ctx.options);
        scalar = identity.isScalar(res) ? res : new Scalar.Scalar(res);
      } catch (error48) {
        const msg = error48 instanceof Error ? error48.message : String(error48);
        onError(tagToken ?? token, "TAG_RESOLVE_FAILED", msg);
        scalar = new Scalar.Scalar(value);
      }
      scalar.range = range;
      scalar.source = value;
      if (type)
        scalar.type = type;
      if (tagName)
        scalar.tag = tagName;
      if (tag.format)
        scalar.format = tag.format;
      if (comment)
        scalar.comment = comment;
      return scalar;
    }
    function findScalarTagByName(schema, value, tagName, tagToken, onError) {
      if (tagName === "!")
        return schema[identity.SCALAR];
      const matchWithTest = [];
      for (const tag of schema.tags) {
        if (!tag.collection && tag.tag === tagName) {
          if (tag.default && tag.test)
            matchWithTest.push(tag);
          else
            return tag;
        }
      }
      for (const tag of matchWithTest)
        if (tag.test?.test(value))
          return tag;
      const kt = schema.knownTags[tagName];
      if (kt && !kt.collection) {
        schema.tags.push(Object.assign({}, kt, { default: false, test: void 0 }));
        return kt;
      }
      onError(tagToken, "TAG_RESOLVE_FAILED", `Unresolved tag: ${tagName}`, tagName !== "tag:yaml.org,2002:str");
      return schema[identity.SCALAR];
    }
    function findScalarTagByTest({ atKey, directives, schema }, value, token, onError) {
      const tag = schema.tags.find((tag2) => (tag2.default === true || atKey && tag2.default === "key") && tag2.test?.test(value)) || schema[identity.SCALAR];
      if (schema.compat) {
        const compat = schema.compat.find((tag2) => tag2.default && tag2.test?.test(value)) ?? schema[identity.SCALAR];
        if (tag.tag !== compat.tag) {
          const ts = directives.tagString(tag.tag);
          const cs = directives.tagString(compat.tag);
          const msg = `Value may be parsed as either ${ts} or ${cs}`;
          onError(token, "TAG_RESOLVE_FAILED", msg, true);
        }
      }
      return tag;
    }
    exports2.composeScalar = composeScalar;
  }
});

// node_modules/yaml/dist/compose/util-empty-scalar-position.js
var require_util_empty_scalar_position = __commonJS({
  "node_modules/yaml/dist/compose/util-empty-scalar-position.js"(exports2) {
    "use strict";
    function emptyScalarPosition(offset, before, pos) {
      if (before) {
        pos ?? (pos = before.length);
        for (let i = pos - 1; i >= 0; --i) {
          let st = before[i];
          switch (st.type) {
            case "space":
            case "comment":
            case "newline":
              offset -= st.source.length;
              continue;
          }
          st = before[++i];
          while (st?.type === "space") {
            offset += st.source.length;
            st = before[++i];
          }
          break;
        }
      }
      return offset;
    }
    exports2.emptyScalarPosition = emptyScalarPosition;
  }
});

// node_modules/yaml/dist/compose/compose-node.js
var require_compose_node = __commonJS({
  "node_modules/yaml/dist/compose/compose-node.js"(exports2) {
    "use strict";
    var Alias = require_Alias();
    var identity = require_identity();
    var composeCollection = require_compose_collection();
    var composeScalar = require_compose_scalar();
    var resolveEnd = require_resolve_end();
    var utilEmptyScalarPosition = require_util_empty_scalar_position();
    var CN = { composeNode, composeEmptyNode };
    function composeNode(ctx, token, props, onError) {
      const atKey = ctx.atKey;
      const { spaceBefore, comment, anchor, tag } = props;
      let node;
      let isSrcToken = true;
      switch (token.type) {
        case "alias":
          node = composeAlias(ctx, token, onError);
          if (anchor || tag)
            onError(token, "ALIAS_PROPS", "An alias node must not specify any properties");
          break;
        case "scalar":
        case "single-quoted-scalar":
        case "double-quoted-scalar":
        case "block-scalar":
          node = composeScalar.composeScalar(ctx, token, tag, onError);
          if (anchor)
            node.anchor = anchor.source.substring(1);
          break;
        case "block-map":
        case "block-seq":
        case "flow-collection":
          try {
            node = composeCollection.composeCollection(CN, ctx, token, props, onError);
            if (anchor)
              node.anchor = anchor.source.substring(1);
          } catch (error48) {
            const message = error48 instanceof Error ? error48.message : String(error48);
            onError(token, "RESOURCE_EXHAUSTION", message);
          }
          break;
        default: {
          const message = token.type === "error" ? token.message : `Unsupported token (type: ${token.type})`;
          onError(token, "UNEXPECTED_TOKEN", message);
          isSrcToken = false;
        }
      }
      node ?? (node = composeEmptyNode(ctx, token.offset, void 0, null, props, onError));
      if (anchor && node.anchor === "")
        onError(anchor, "BAD_ALIAS", "Anchor cannot be an empty string");
      if (atKey && ctx.options.stringKeys && (!identity.isScalar(node) || typeof node.value !== "string" || node.tag && node.tag !== "tag:yaml.org,2002:str")) {
        const msg = "With stringKeys, all keys must be strings";
        onError(tag ?? token, "NON_STRING_KEY", msg);
      }
      if (spaceBefore)
        node.spaceBefore = true;
      if (comment) {
        if (token.type === "scalar" && token.source === "")
          node.comment = comment;
        else
          node.commentBefore = comment;
      }
      if (ctx.options.keepSourceTokens && isSrcToken)
        node.srcToken = token;
      return node;
    }
    function composeEmptyNode(ctx, offset, before, pos, { spaceBefore, comment, anchor, tag, end }, onError) {
      const token = {
        type: "scalar",
        offset: utilEmptyScalarPosition.emptyScalarPosition(offset, before, pos),
        indent: -1,
        source: ""
      };
      const node = composeScalar.composeScalar(ctx, token, tag, onError);
      if (anchor) {
        node.anchor = anchor.source.substring(1);
        if (node.anchor === "")
          onError(anchor, "BAD_ALIAS", "Anchor cannot be an empty string");
      }
      if (spaceBefore)
        node.spaceBefore = true;
      if (comment) {
        node.comment = comment;
        node.range[2] = end;
      }
      return node;
    }
    function composeAlias({ options: options2 }, { offset, source, end }, onError) {
      const alias = new Alias.Alias(source.substring(1));
      if (alias.source === "")
        onError(offset, "BAD_ALIAS", "Alias cannot be an empty string");
      if (alias.source.endsWith(":"))
        onError(offset + source.length - 1, "BAD_ALIAS", "Alias ending in : is ambiguous", true);
      const valueEnd = offset + source.length;
      const re = resolveEnd.resolveEnd(end, valueEnd, options2.strict, onError);
      alias.range = [offset, valueEnd, re.offset];
      if (re.comment)
        alias.comment = re.comment;
      return alias;
    }
    exports2.composeEmptyNode = composeEmptyNode;
    exports2.composeNode = composeNode;
  }
});

// node_modules/yaml/dist/compose/compose-doc.js
var require_compose_doc = __commonJS({
  "node_modules/yaml/dist/compose/compose-doc.js"(exports2) {
    "use strict";
    var Document = require_Document();
    var composeNode = require_compose_node();
    var resolveEnd = require_resolve_end();
    var resolveProps = require_resolve_props();
    function composeDoc(options2, directives, { offset, start, value, end }, onError) {
      const opts = Object.assign({ _directives: directives }, options2);
      const doc = new Document.Document(void 0, opts);
      const ctx = {
        atKey: false,
        atRoot: true,
        directives: doc.directives,
        options: doc.options,
        schema: doc.schema
      };
      const props = resolveProps.resolveProps(start, {
        indicator: "doc-start",
        next: value ?? end?.[0],
        offset,
        onError,
        parentIndent: 0,
        startOnNewline: true
      });
      if (props.found) {
        doc.directives.docStart = true;
        if (value && (value.type === "block-map" || value.type === "block-seq") && !props.hasNewline)
          onError(props.end, "MISSING_CHAR", "Block collection cannot start on same line with directives-end marker");
      }
      doc.contents = value ? composeNode.composeNode(ctx, value, props, onError) : composeNode.composeEmptyNode(ctx, props.end, start, null, props, onError);
      const contentEnd = doc.contents.range[2];
      const re = resolveEnd.resolveEnd(end, contentEnd, false, onError);
      if (re.comment)
        doc.comment = re.comment;
      doc.range = [offset, contentEnd, re.offset];
      return doc;
    }
    exports2.composeDoc = composeDoc;
  }
});

// node_modules/yaml/dist/compose/composer.js
var require_composer = __commonJS({
  "node_modules/yaml/dist/compose/composer.js"(exports2) {
    "use strict";
    var node_process = require("process");
    var directives = require_directives();
    var Document = require_Document();
    var errors = require_errors();
    var identity = require_identity();
    var composeDoc = require_compose_doc();
    var resolveEnd = require_resolve_end();
    function getErrorPos(src) {
      if (typeof src === "number")
        return [src, src + 1];
      if (Array.isArray(src))
        return src.length === 2 ? src : [src[0], src[1]];
      const { offset, source } = src;
      return [offset, offset + (typeof source === "string" ? source.length : 1)];
    }
    function parsePrelude(prelude) {
      let comment = "";
      let atComment = false;
      let afterEmptyLine = false;
      for (let i = 0; i < prelude.length; ++i) {
        const source = prelude[i];
        switch (source[0]) {
          case "#":
            comment += (comment === "" ? "" : afterEmptyLine ? "\n\n" : "\n") + (source.substring(1) || " ");
            atComment = true;
            afterEmptyLine = false;
            break;
          case "%":
            if (prelude[i + 1]?.[0] !== "#")
              i += 1;
            atComment = false;
            break;
          default:
            if (!atComment)
              afterEmptyLine = true;
            atComment = false;
        }
      }
      return { comment, afterEmptyLine };
    }
    var Composer = class {
      constructor(options2 = {}) {
        this.doc = null;
        this.atDirectives = false;
        this.prelude = [];
        this.errors = [];
        this.warnings = [];
        this.onError = (source, code, message, warning) => {
          const pos = getErrorPos(source);
          if (warning)
            this.warnings.push(new errors.YAMLWarning(pos, code, message));
          else
            this.errors.push(new errors.YAMLParseError(pos, code, message));
        };
        this.directives = new directives.Directives({ version: options2.version || "1.2" });
        this.options = options2;
      }
      decorate(doc, afterDoc) {
        const { comment, afterEmptyLine } = parsePrelude(this.prelude);
        if (comment) {
          const dc = doc.contents;
          if (afterDoc) {
            doc.comment = doc.comment ? `${doc.comment}
${comment}` : comment;
          } else if (afterEmptyLine || doc.directives.docStart || !dc) {
            doc.commentBefore = comment;
          } else if (identity.isCollection(dc) && !dc.flow && dc.items.length > 0) {
            let it = dc.items[0];
            if (identity.isPair(it))
              it = it.key;
            const cb = it.commentBefore;
            it.commentBefore = cb ? `${comment}
${cb}` : comment;
          } else {
            const cb = dc.commentBefore;
            dc.commentBefore = cb ? `${comment}
${cb}` : comment;
          }
        }
        if (afterDoc) {
          Array.prototype.push.apply(doc.errors, this.errors);
          Array.prototype.push.apply(doc.warnings, this.warnings);
        } else {
          doc.errors = this.errors;
          doc.warnings = this.warnings;
        }
        this.prelude = [];
        this.errors = [];
        this.warnings = [];
      }
      /**
       * Current stream status information.
       *
       * Mostly useful at the end of input for an empty stream.
       */
      streamInfo() {
        return {
          comment: parsePrelude(this.prelude).comment,
          directives: this.directives,
          errors: this.errors,
          warnings: this.warnings
        };
      }
      /**
       * Compose tokens into documents.
       *
       * @param forceDoc - If the stream contains no document, still emit a final document including any comments and directives that would be applied to a subsequent document.
       * @param endOffset - Should be set if `forceDoc` is also set, to set the document range end and to indicate errors correctly.
       */
      *compose(tokens, forceDoc = false, endOffset = -1) {
        for (const token of tokens)
          yield* this.next(token);
        yield* this.end(forceDoc, endOffset);
      }
      /** Advance the composer by one CST token. */
      *next(token) {
        if (node_process.env.LOG_STREAM)
          console.dir(token, { depth: null });
        switch (token.type) {
          case "directive":
            this.directives.add(token.source, (offset, message, warning) => {
              const pos = getErrorPos(token);
              pos[0] += offset;
              this.onError(pos, "BAD_DIRECTIVE", message, warning);
            });
            this.prelude.push(token.source);
            this.atDirectives = true;
            break;
          case "document": {
            const doc = composeDoc.composeDoc(this.options, this.directives, token, this.onError);
            if (this.atDirectives && !doc.directives.docStart)
              this.onError(token, "MISSING_CHAR", "Missing directives-end/doc-start indicator line");
            this.decorate(doc, false);
            if (this.doc)
              yield this.doc;
            this.doc = doc;
            this.atDirectives = false;
            break;
          }
          case "byte-order-mark":
          case "space":
            break;
          case "comment":
          case "newline":
            this.prelude.push(token.source);
            break;
          case "error": {
            const msg = token.source ? `${token.message}: ${JSON.stringify(token.source)}` : token.message;
            const error48 = new errors.YAMLParseError(getErrorPos(token), "UNEXPECTED_TOKEN", msg);
            if (this.atDirectives || !this.doc)
              this.errors.push(error48);
            else
              this.doc.errors.push(error48);
            break;
          }
          case "doc-end": {
            if (!this.doc) {
              const msg = "Unexpected doc-end without preceding document";
              this.errors.push(new errors.YAMLParseError(getErrorPos(token), "UNEXPECTED_TOKEN", msg));
              break;
            }
            this.doc.directives.docEnd = true;
            const end = resolveEnd.resolveEnd(token.end, token.offset + token.source.length, this.doc.options.strict, this.onError);
            this.decorate(this.doc, true);
            if (end.comment) {
              const dc = this.doc.comment;
              this.doc.comment = dc ? `${dc}
${end.comment}` : end.comment;
            }
            this.doc.range[2] = end.offset;
            break;
          }
          default:
            this.errors.push(new errors.YAMLParseError(getErrorPos(token), "UNEXPECTED_TOKEN", `Unsupported token ${token.type}`));
        }
      }
      /**
       * Call at end of input to yield any remaining document.
       *
       * @param forceDoc - If the stream contains no document, still emit a final document including any comments and directives that would be applied to a subsequent document.
       * @param endOffset - Should be set if `forceDoc` is also set, to set the document range end and to indicate errors correctly.
       */
      *end(forceDoc = false, endOffset = -1) {
        if (this.doc) {
          this.decorate(this.doc, true);
          yield this.doc;
          this.doc = null;
        } else if (forceDoc) {
          const opts = Object.assign({ _directives: this.directives }, this.options);
          const doc = new Document.Document(void 0, opts);
          if (this.atDirectives)
            this.onError(endOffset, "MISSING_CHAR", "Missing directives-end indicator line");
          doc.range = [0, endOffset, endOffset];
          this.decorate(doc, false);
          yield doc;
        }
      }
    };
    exports2.Composer = Composer;
  }
});

// node_modules/yaml/dist/parse/cst-scalar.js
var require_cst_scalar = __commonJS({
  "node_modules/yaml/dist/parse/cst-scalar.js"(exports2) {
    "use strict";
    var resolveBlockScalar = require_resolve_block_scalar();
    var resolveFlowScalar = require_resolve_flow_scalar();
    var errors = require_errors();
    var stringifyString = require_stringifyString();
    function resolveAsScalar(token, strict = true, onError) {
      if (token) {
        const _onError2 = (pos, code, message) => {
          const offset = typeof pos === "number" ? pos : Array.isArray(pos) ? pos[0] : pos.offset;
          if (onError)
            onError(offset, code, message);
          else
            throw new errors.YAMLParseError([offset, offset + 1], code, message);
        };
        switch (token.type) {
          case "scalar":
          case "single-quoted-scalar":
          case "double-quoted-scalar":
            return resolveFlowScalar.resolveFlowScalar(token, strict, _onError2);
          case "block-scalar":
            return resolveBlockScalar.resolveBlockScalar({ options: { strict } }, token, _onError2);
        }
      }
      return null;
    }
    function createScalarToken(value, context) {
      const { implicitKey = false, indent, inFlow = false, offset = -1, type = "PLAIN" } = context;
      const source = stringifyString.stringifyString({ type, value }, {
        implicitKey,
        indent: indent > 0 ? " ".repeat(indent) : "",
        inFlow,
        options: { blockQuote: true, lineWidth: -1 }
      });
      const end = context.end ?? [
        { type: "newline", offset: -1, indent, source: "\n" }
      ];
      switch (source[0]) {
        case "|":
        case ">": {
          const he = source.indexOf("\n");
          const head = source.substring(0, he);
          const body = source.substring(he + 1) + "\n";
          const props = [
            { type: "block-scalar-header", offset, indent, source: head }
          ];
          if (!addEndtoBlockProps(props, end))
            props.push({ type: "newline", offset: -1, indent, source: "\n" });
          return { type: "block-scalar", offset, indent, props, source: body };
        }
        case '"':
          return { type: "double-quoted-scalar", offset, indent, source, end };
        case "'":
          return { type: "single-quoted-scalar", offset, indent, source, end };
        default:
          return { type: "scalar", offset, indent, source, end };
      }
    }
    function setScalarValue(token, value, context = {}) {
      let { afterKey = false, implicitKey = false, inFlow = false, type } = context;
      let indent = "indent" in token ? token.indent : null;
      if (afterKey && typeof indent === "number")
        indent += 2;
      if (!type)
        switch (token.type) {
          case "single-quoted-scalar":
            type = "QUOTE_SINGLE";
            break;
          case "double-quoted-scalar":
            type = "QUOTE_DOUBLE";
            break;
          case "block-scalar": {
            const header = token.props[0];
            if (header.type !== "block-scalar-header")
              throw new Error("Invalid block scalar header");
            type = header.source[0] === ">" ? "BLOCK_FOLDED" : "BLOCK_LITERAL";
            break;
          }
          default:
            type = "PLAIN";
        }
      const source = stringifyString.stringifyString({ type, value }, {
        implicitKey: implicitKey || indent === null,
        indent: indent !== null && indent > 0 ? " ".repeat(indent) : "",
        inFlow,
        options: { blockQuote: true, lineWidth: -1 }
      });
      switch (source[0]) {
        case "|":
        case ">":
          setBlockScalarValue(token, source);
          break;
        case '"':
          setFlowScalarValue(token, source, "double-quoted-scalar");
          break;
        case "'":
          setFlowScalarValue(token, source, "single-quoted-scalar");
          break;
        default:
          setFlowScalarValue(token, source, "scalar");
      }
    }
    function setBlockScalarValue(token, source) {
      const he = source.indexOf("\n");
      const head = source.substring(0, he);
      const body = source.substring(he + 1) + "\n";
      if (token.type === "block-scalar") {
        const header = token.props[0];
        if (header.type !== "block-scalar-header")
          throw new Error("Invalid block scalar header");
        header.source = head;
        token.source = body;
      } else {
        const { offset } = token;
        const indent = "indent" in token ? token.indent : -1;
        const props = [
          { type: "block-scalar-header", offset, indent, source: head }
        ];
        if (!addEndtoBlockProps(props, "end" in token ? token.end : void 0))
          props.push({ type: "newline", offset: -1, indent, source: "\n" });
        for (const key of Object.keys(token))
          if (key !== "type" && key !== "offset")
            delete token[key];
        Object.assign(token, { type: "block-scalar", indent, props, source: body });
      }
    }
    function addEndtoBlockProps(props, end) {
      if (end)
        for (const st of end)
          switch (st.type) {
            case "space":
            case "comment":
              props.push(st);
              break;
            case "newline":
              props.push(st);
              return true;
          }
      return false;
    }
    function setFlowScalarValue(token, source, type) {
      switch (token.type) {
        case "scalar":
        case "double-quoted-scalar":
        case "single-quoted-scalar":
          token.type = type;
          token.source = source;
          break;
        case "block-scalar": {
          const end = token.props.slice(1);
          let oa = source.length;
          if (token.props[0].type === "block-scalar-header")
            oa -= token.props[0].source.length;
          for (const tok of end)
            tok.offset += oa;
          delete token.props;
          Object.assign(token, { type, source, end });
          break;
        }
        case "block-map":
        case "block-seq": {
          const offset = token.offset + source.length;
          const nl = { type: "newline", offset, indent: token.indent, source: "\n" };
          delete token.items;
          Object.assign(token, { type, source, end: [nl] });
          break;
        }
        default: {
          const indent = "indent" in token ? token.indent : -1;
          const end = "end" in token && Array.isArray(token.end) ? token.end.filter((st) => st.type === "space" || st.type === "comment" || st.type === "newline") : [];
          for (const key of Object.keys(token))
            if (key !== "type" && key !== "offset")
              delete token[key];
          Object.assign(token, { type, indent, source, end });
        }
      }
    }
    exports2.createScalarToken = createScalarToken;
    exports2.resolveAsScalar = resolveAsScalar;
    exports2.setScalarValue = setScalarValue;
  }
});

// node_modules/yaml/dist/parse/cst-stringify.js
var require_cst_stringify = __commonJS({
  "node_modules/yaml/dist/parse/cst-stringify.js"(exports2) {
    "use strict";
    var stringify = (cst) => "type" in cst ? stringifyToken(cst) : stringifyItem(cst);
    function stringifyToken(token) {
      switch (token.type) {
        case "block-scalar": {
          let res = "";
          for (const tok of token.props)
            res += stringifyToken(tok);
          return res + token.source;
        }
        case "block-map":
        case "block-seq": {
          let res = "";
          for (const item of token.items)
            res += stringifyItem(item);
          return res;
        }
        case "flow-collection": {
          let res = token.start.source;
          for (const item of token.items)
            res += stringifyItem(item);
          for (const st of token.end)
            res += st.source;
          return res;
        }
        case "document": {
          let res = stringifyItem(token);
          if (token.end)
            for (const st of token.end)
              res += st.source;
          return res;
        }
        default: {
          let res = token.source;
          if ("end" in token && token.end)
            for (const st of token.end)
              res += st.source;
          return res;
        }
      }
    }
    function stringifyItem({ start, key, sep, value }) {
      let res = "";
      for (const st of start)
        res += st.source;
      if (key)
        res += stringifyToken(key);
      if (sep)
        for (const st of sep)
          res += st.source;
      if (value)
        res += stringifyToken(value);
      return res;
    }
    exports2.stringify = stringify;
  }
});

// node_modules/yaml/dist/parse/cst-visit.js
var require_cst_visit = __commonJS({
  "node_modules/yaml/dist/parse/cst-visit.js"(exports2) {
    "use strict";
    var BREAK = Symbol("break visit");
    var SKIP = Symbol("skip children");
    var REMOVE = Symbol("remove item");
    function visit(cst, visitor) {
      if ("type" in cst && cst.type === "document")
        cst = { start: cst.start, value: cst.value };
      _visit(Object.freeze([]), cst, visitor);
    }
    visit.BREAK = BREAK;
    visit.SKIP = SKIP;
    visit.REMOVE = REMOVE;
    visit.itemAtPath = (cst, path) => {
      let item = cst;
      for (const [field, index] of path) {
        const tok = item?.[field];
        if (tok && "items" in tok) {
          item = tok.items[index];
        } else
          return void 0;
      }
      return item;
    };
    visit.parentCollection = (cst, path) => {
      const parent = visit.itemAtPath(cst, path.slice(0, -1));
      const field = path[path.length - 1][0];
      const coll = parent?.[field];
      if (coll && "items" in coll)
        return coll;
      throw new Error("Parent collection not found");
    };
    function _visit(path, item, visitor) {
      let ctrl = visitor(item, path);
      if (typeof ctrl === "symbol")
        return ctrl;
      for (const field of ["key", "value"]) {
        const token = item[field];
        if (token && "items" in token) {
          for (let i = 0; i < token.items.length; ++i) {
            const ci = _visit(Object.freeze(path.concat([[field, i]])), token.items[i], visitor);
            if (typeof ci === "number")
              i = ci - 1;
            else if (ci === BREAK)
              return BREAK;
            else if (ci === REMOVE) {
              token.items.splice(i, 1);
              i -= 1;
            }
          }
          if (typeof ctrl === "function" && field === "key")
            ctrl = ctrl(item, path);
        }
      }
      return typeof ctrl === "function" ? ctrl(item, path) : ctrl;
    }
    exports2.visit = visit;
  }
});

// node_modules/yaml/dist/parse/cst.js
var require_cst = __commonJS({
  "node_modules/yaml/dist/parse/cst.js"(exports2) {
    "use strict";
    var cstScalar = require_cst_scalar();
    var cstStringify = require_cst_stringify();
    var cstVisit = require_cst_visit();
    var BOM = "\uFEFF";
    var DOCUMENT = "";
    var FLOW_END = "";
    var SCALAR = "";
    var isCollection = (token) => !!token && "items" in token;
    var isScalar = (token) => !!token && (token.type === "scalar" || token.type === "single-quoted-scalar" || token.type === "double-quoted-scalar" || token.type === "block-scalar");
    function prettyToken(token) {
      switch (token) {
        case BOM:
          return "<BOM>";
        case DOCUMENT:
          return "<DOC>";
        case FLOW_END:
          return "<FLOW_END>";
        case SCALAR:
          return "<SCALAR>";
        default:
          return JSON.stringify(token);
      }
    }
    function tokenType(source) {
      switch (source) {
        case BOM:
          return "byte-order-mark";
        case DOCUMENT:
          return "doc-mode";
        case FLOW_END:
          return "flow-error-end";
        case SCALAR:
          return "scalar";
        case "---":
          return "doc-start";
        case "...":
          return "doc-end";
        case "":
        case "\n":
        case "\r\n":
          return "newline";
        case "-":
          return "seq-item-ind";
        case "?":
          return "explicit-key-ind";
        case ":":
          return "map-value-ind";
        case "{":
          return "flow-map-start";
        case "}":
          return "flow-map-end";
        case "[":
          return "flow-seq-start";
        case "]":
          return "flow-seq-end";
        case ",":
          return "comma";
      }
      switch (source[0]) {
        case " ":
        case "	":
          return "space";
        case "#":
          return "comment";
        case "%":
          return "directive-line";
        case "*":
          return "alias";
        case "&":
          return "anchor";
        case "!":
          return "tag";
        case "'":
          return "single-quoted-scalar";
        case '"':
          return "double-quoted-scalar";
        case "|":
        case ">":
          return "block-scalar-header";
      }
      return null;
    }
    exports2.createScalarToken = cstScalar.createScalarToken;
    exports2.resolveAsScalar = cstScalar.resolveAsScalar;
    exports2.setScalarValue = cstScalar.setScalarValue;
    exports2.stringify = cstStringify.stringify;
    exports2.visit = cstVisit.visit;
    exports2.BOM = BOM;
    exports2.DOCUMENT = DOCUMENT;
    exports2.FLOW_END = FLOW_END;
    exports2.SCALAR = SCALAR;
    exports2.isCollection = isCollection;
    exports2.isScalar = isScalar;
    exports2.prettyToken = prettyToken;
    exports2.tokenType = tokenType;
  }
});

// node_modules/yaml/dist/parse/lexer.js
var require_lexer = __commonJS({
  "node_modules/yaml/dist/parse/lexer.js"(exports2) {
    "use strict";
    var cst = require_cst();
    function isEmpty(ch) {
      switch (ch) {
        case void 0:
        case " ":
        case "\n":
        case "\r":
        case "	":
          return true;
        default:
          return false;
      }
    }
    var hexDigits = new Set("0123456789ABCDEFabcdef");
    var tagChars = new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()");
    var flowIndicatorChars = new Set(",[]{}");
    var invalidAnchorChars = new Set(" ,[]{}\n\r	");
    var isNotAnchorChar = (ch) => !ch || invalidAnchorChars.has(ch);
    var Lexer = class {
      constructor() {
        this.atEnd = false;
        this.blockScalarIndent = -1;
        this.blockScalarKeep = false;
        this.buffer = "";
        this.flowKey = false;
        this.flowLevel = 0;
        this.indentNext = 0;
        this.indentValue = 0;
        this.lineEndPos = null;
        this.next = null;
        this.pos = 0;
      }
      /**
       * Generate YAML tokens from the `source` string. If `incomplete`,
       * a part of the last line may be left as a buffer for the next call.
       *
       * @returns A generator of lexical tokens
       */
      *lex(source, incomplete = false) {
        if (source) {
          if (typeof source !== "string")
            throw TypeError("source is not a string");
          this.buffer = this.buffer ? this.buffer + source : source;
          this.lineEndPos = null;
        }
        this.atEnd = !incomplete;
        let next = this.next ?? "stream";
        while (next && (incomplete || this.hasChars(1)))
          next = yield* this.parseNext(next);
      }
      atLineEnd() {
        let i = this.pos;
        let ch = this.buffer[i];
        while (ch === " " || ch === "	")
          ch = this.buffer[++i];
        if (!ch || ch === "#" || ch === "\n")
          return true;
        if (ch === "\r")
          return this.buffer[i + 1] === "\n";
        return false;
      }
      charAt(n) {
        return this.buffer[this.pos + n];
      }
      continueScalar(offset) {
        let ch = this.buffer[offset];
        if (this.indentNext > 0) {
          let indent = 0;
          while (ch === " ")
            ch = this.buffer[++indent + offset];
          if (ch === "\r") {
            const next = this.buffer[indent + offset + 1];
            if (next === "\n" || !next && !this.atEnd)
              return offset + indent + 1;
          }
          return ch === "\n" || indent >= this.indentNext || !ch && !this.atEnd ? offset + indent : -1;
        }
        if (ch === "-" || ch === ".") {
          const dt = this.buffer.substr(offset, 3);
          if ((dt === "---" || dt === "...") && isEmpty(this.buffer[offset + 3]))
            return -1;
        }
        return offset;
      }
      getLine() {
        let end = this.lineEndPos;
        if (typeof end !== "number" || end !== -1 && end < this.pos) {
          end = this.buffer.indexOf("\n", this.pos);
          this.lineEndPos = end;
        }
        if (end === -1)
          return this.atEnd ? this.buffer.substring(this.pos) : null;
        if (this.buffer[end - 1] === "\r")
          end -= 1;
        return this.buffer.substring(this.pos, end);
      }
      hasChars(n) {
        return this.pos + n <= this.buffer.length;
      }
      setNext(state) {
        this.buffer = this.buffer.substring(this.pos);
        this.pos = 0;
        this.lineEndPos = null;
        this.next = state;
        return null;
      }
      peek(n) {
        return this.buffer.substr(this.pos, n);
      }
      *parseNext(next) {
        switch (next) {
          case "stream":
            return yield* this.parseStream();
          case "line-start":
            return yield* this.parseLineStart();
          case "block-start":
            return yield* this.parseBlockStart();
          case "doc":
            return yield* this.parseDocument();
          case "flow":
            return yield* this.parseFlowCollection();
          case "quoted-scalar":
            return yield* this.parseQuotedScalar();
          case "block-scalar":
            return yield* this.parseBlockScalar();
          case "plain-scalar":
            return yield* this.parsePlainScalar();
        }
      }
      *parseStream() {
        let line = this.getLine();
        if (line === null)
          return this.setNext("stream");
        if (line[0] === cst.BOM) {
          yield* this.pushCount(1);
          line = line.substring(1);
        }
        if (line[0] === "%") {
          let dirEnd = line.length;
          let cs = line.indexOf("#");
          while (cs !== -1) {
            const ch = line[cs - 1];
            if (ch === " " || ch === "	") {
              dirEnd = cs - 1;
              break;
            } else {
              cs = line.indexOf("#", cs + 1);
            }
          }
          while (true) {
            const ch = line[dirEnd - 1];
            if (ch === " " || ch === "	")
              dirEnd -= 1;
            else
              break;
          }
          const n = (yield* this.pushCount(dirEnd)) + (yield* this.pushSpaces(true));
          yield* this.pushCount(line.length - n);
          this.pushNewline();
          return "stream";
        }
        if (this.atLineEnd()) {
          const sp = yield* this.pushSpaces(true);
          yield* this.pushCount(line.length - sp);
          yield* this.pushNewline();
          return "stream";
        }
        yield cst.DOCUMENT;
        return yield* this.parseLineStart();
      }
      *parseLineStart() {
        const ch = this.charAt(0);
        if (!ch && !this.atEnd)
          return this.setNext("line-start");
        if (ch === "-" || ch === ".") {
          if (!this.atEnd && !this.hasChars(4))
            return this.setNext("line-start");
          const s = this.peek(3);
          if ((s === "---" || s === "...") && isEmpty(this.charAt(3))) {
            yield* this.pushCount(3);
            this.indentValue = 0;
            this.indentNext = 0;
            return s === "---" ? "doc" : "stream";
          }
        }
        this.indentValue = yield* this.pushSpaces(false);
        if (this.indentNext > this.indentValue && !isEmpty(this.charAt(1)))
          this.indentNext = this.indentValue;
        return yield* this.parseBlockStart();
      }
      *parseBlockStart() {
        const [ch0, ch1] = this.peek(2);
        if (!ch1 && !this.atEnd)
          return this.setNext("block-start");
        if ((ch0 === "-" || ch0 === "?" || ch0 === ":") && isEmpty(ch1)) {
          const n = (yield* this.pushCount(1)) + (yield* this.pushSpaces(true));
          this.indentNext = this.indentValue + 1;
          this.indentValue += n;
          return yield* this.parseBlockStart();
        }
        return "doc";
      }
      *parseDocument() {
        yield* this.pushSpaces(true);
        const line = this.getLine();
        if (line === null)
          return this.setNext("doc");
        let n = yield* this.pushIndicators();
        switch (line[n]) {
          case "#":
            yield* this.pushCount(line.length - n);
          // fallthrough
          case void 0:
            yield* this.pushNewline();
            return yield* this.parseLineStart();
          case "{":
          case "[":
            yield* this.pushCount(1);
            this.flowKey = false;
            this.flowLevel = 1;
            return "flow";
          case "}":
          case "]":
            yield* this.pushCount(1);
            return "doc";
          case "*":
            yield* this.pushUntil(isNotAnchorChar);
            return "doc";
          case '"':
          case "'":
            return yield* this.parseQuotedScalar();
          case "|":
          case ">":
            n += yield* this.parseBlockScalarHeader();
            n += yield* this.pushSpaces(true);
            yield* this.pushCount(line.length - n);
            yield* this.pushNewline();
            return yield* this.parseBlockScalar();
          default:
            return yield* this.parsePlainScalar();
        }
      }
      *parseFlowCollection() {
        let nl, sp;
        let indent = -1;
        do {
          nl = yield* this.pushNewline();
          if (nl > 0) {
            sp = yield* this.pushSpaces(false);
            this.indentValue = indent = sp;
          } else {
            sp = 0;
          }
          sp += yield* this.pushSpaces(true);
        } while (nl + sp > 0);
        const line = this.getLine();
        if (line === null)
          return this.setNext("flow");
        if (indent !== -1 && indent < this.indentNext && line[0] !== "#" || indent === 0 && (line.startsWith("---") || line.startsWith("...")) && isEmpty(line[3])) {
          const atFlowEndMarker = indent === this.indentNext - 1 && this.flowLevel === 1 && (line[0] === "]" || line[0] === "}");
          if (!atFlowEndMarker) {
            this.flowLevel = 0;
            yield cst.FLOW_END;
            return yield* this.parseLineStart();
          }
        }
        let n = 0;
        while (line[n] === ",") {
          n += yield* this.pushCount(1);
          n += yield* this.pushSpaces(true);
          this.flowKey = false;
        }
        n += yield* this.pushIndicators();
        switch (line[n]) {
          case void 0:
            return "flow";
          case "#":
            yield* this.pushCount(line.length - n);
            return "flow";
          case "{":
          case "[":
            yield* this.pushCount(1);
            this.flowKey = false;
            this.flowLevel += 1;
            return "flow";
          case "}":
          case "]":
            yield* this.pushCount(1);
            this.flowKey = true;
            this.flowLevel -= 1;
            return this.flowLevel ? "flow" : "doc";
          case "*":
            yield* this.pushUntil(isNotAnchorChar);
            return "flow";
          case '"':
          case "'":
            this.flowKey = true;
            return yield* this.parseQuotedScalar();
          case ":": {
            const next = this.charAt(1);
            if (this.flowKey || isEmpty(next) || next === ",") {
              this.flowKey = false;
              yield* this.pushCount(1);
              yield* this.pushSpaces(true);
              return "flow";
            }
          }
          // fallthrough
          default:
            this.flowKey = false;
            return yield* this.parsePlainScalar();
        }
      }
      *parseQuotedScalar() {
        const quote = this.charAt(0);
        let end = this.buffer.indexOf(quote, this.pos + 1);
        if (quote === "'") {
          while (end !== -1 && this.buffer[end + 1] === "'")
            end = this.buffer.indexOf("'", end + 2);
        } else {
          while (end !== -1) {
            let n = 0;
            while (this.buffer[end - 1 - n] === "\\")
              n += 1;
            if (n % 2 === 0)
              break;
            end = this.buffer.indexOf('"', end + 1);
          }
        }
        const qb = this.buffer.substring(0, end);
        let nl = qb.indexOf("\n", this.pos);
        if (nl !== -1) {
          while (nl !== -1) {
            const cs = this.continueScalar(nl + 1);
            if (cs === -1)
              break;
            nl = qb.indexOf("\n", cs);
          }
          if (nl !== -1) {
            end = nl - (qb[nl - 1] === "\r" ? 2 : 1);
          }
        }
        if (end === -1) {
          if (!this.atEnd)
            return this.setNext("quoted-scalar");
          end = this.buffer.length;
        }
        yield* this.pushToIndex(end + 1, false);
        return this.flowLevel ? "flow" : "doc";
      }
      *parseBlockScalarHeader() {
        this.blockScalarIndent = -1;
        this.blockScalarKeep = false;
        let i = this.pos;
        while (true) {
          const ch = this.buffer[++i];
          if (ch === "+")
            this.blockScalarKeep = true;
          else if (ch > "0" && ch <= "9")
            this.blockScalarIndent = Number(ch) - 1;
          else if (ch !== "-")
            break;
        }
        return yield* this.pushUntil((ch) => isEmpty(ch) || ch === "#");
      }
      *parseBlockScalar() {
        let nl = this.pos - 1;
        let indent = 0;
        let ch;
        loop: for (let i2 = this.pos; ch = this.buffer[i2]; ++i2) {
          switch (ch) {
            case " ":
              indent += 1;
              break;
            case "\n":
              nl = i2;
              indent = 0;
              break;
            case "\r": {
              const next = this.buffer[i2 + 1];
              if (!next && !this.atEnd)
                return this.setNext("block-scalar");
              if (next === "\n")
                break;
            }
            // fallthrough
            default:
              break loop;
          }
        }
        if (!ch && !this.atEnd)
          return this.setNext("block-scalar");
        if (indent >= this.indentNext) {
          if (this.blockScalarIndent === -1)
            this.indentNext = indent;
          else {
            this.indentNext = this.blockScalarIndent + (this.indentNext === 0 ? 1 : this.indentNext);
          }
          do {
            const cs = this.continueScalar(nl + 1);
            if (cs === -1)
              break;
            nl = this.buffer.indexOf("\n", cs);
          } while (nl !== -1);
          if (nl === -1) {
            if (!this.atEnd)
              return this.setNext("block-scalar");
            nl = this.buffer.length;
          }
        }
        let i = nl + 1;
        ch = this.buffer[i];
        while (ch === " ")
          ch = this.buffer[++i];
        if (ch === "	") {
          while (ch === "	" || ch === " " || ch === "\r" || ch === "\n")
            ch = this.buffer[++i];
          nl = i - 1;
        } else if (!this.blockScalarKeep) {
          do {
            let i2 = nl - 1;
            let ch2 = this.buffer[i2];
            if (ch2 === "\r")
              ch2 = this.buffer[--i2];
            const lastChar = i2;
            while (ch2 === " ")
              ch2 = this.buffer[--i2];
            if (ch2 === "\n" && i2 >= this.pos && i2 + 1 + indent > lastChar)
              nl = i2;
            else
              break;
          } while (true);
        }
        yield cst.SCALAR;
        yield* this.pushToIndex(nl + 1, true);
        return yield* this.parseLineStart();
      }
      *parsePlainScalar() {
        const inFlow = this.flowLevel > 0;
        let end = this.pos - 1;
        let i = this.pos - 1;
        let ch;
        while (ch = this.buffer[++i]) {
          if (ch === ":") {
            const next = this.buffer[i + 1];
            if (isEmpty(next) || inFlow && flowIndicatorChars.has(next))
              break;
            end = i;
          } else if (isEmpty(ch)) {
            let next = this.buffer[i + 1];
            if (ch === "\r") {
              if (next === "\n") {
                i += 1;
                ch = "\n";
                next = this.buffer[i + 1];
              } else
                end = i;
            }
            if (next === "#" || inFlow && flowIndicatorChars.has(next))
              break;
            if (ch === "\n") {
              const cs = this.continueScalar(i + 1);
              if (cs === -1)
                break;
              i = Math.max(i, cs - 2);
            }
          } else {
            if (inFlow && flowIndicatorChars.has(ch))
              break;
            end = i;
          }
        }
        if (!ch && !this.atEnd)
          return this.setNext("plain-scalar");
        yield cst.SCALAR;
        yield* this.pushToIndex(end + 1, true);
        return inFlow ? "flow" : "doc";
      }
      *pushCount(n) {
        if (n > 0) {
          yield this.buffer.substr(this.pos, n);
          this.pos += n;
          return n;
        }
        return 0;
      }
      *pushToIndex(i, allowEmpty) {
        const s = this.buffer.slice(this.pos, i);
        if (s) {
          yield s;
          this.pos += s.length;
          return s.length;
        } else if (allowEmpty)
          yield "";
        return 0;
      }
      *pushIndicators() {
        switch (this.charAt(0)) {
          case "!":
            return (yield* this.pushTag()) + (yield* this.pushSpaces(true)) + (yield* this.pushIndicators());
          case "&":
            return (yield* this.pushUntil(isNotAnchorChar)) + (yield* this.pushSpaces(true)) + (yield* this.pushIndicators());
          case "-":
          // this is an error
          case "?":
          // this is an error outside flow collections
          case ":": {
            const inFlow = this.flowLevel > 0;
            const ch1 = this.charAt(1);
            if (isEmpty(ch1) || inFlow && flowIndicatorChars.has(ch1)) {
              if (!inFlow)
                this.indentNext = this.indentValue + 1;
              else if (this.flowKey)
                this.flowKey = false;
              return (yield* this.pushCount(1)) + (yield* this.pushSpaces(true)) + (yield* this.pushIndicators());
            }
          }
        }
        return 0;
      }
      *pushTag() {
        if (this.charAt(1) === "<") {
          let i = this.pos + 2;
          let ch = this.buffer[i];
          while (!isEmpty(ch) && ch !== ">")
            ch = this.buffer[++i];
          return yield* this.pushToIndex(ch === ">" ? i + 1 : i, false);
        } else {
          let i = this.pos + 1;
          let ch = this.buffer[i];
          while (ch) {
            if (tagChars.has(ch))
              ch = this.buffer[++i];
            else if (ch === "%" && hexDigits.has(this.buffer[i + 1]) && hexDigits.has(this.buffer[i + 2])) {
              ch = this.buffer[i += 3];
            } else
              break;
          }
          return yield* this.pushToIndex(i, false);
        }
      }
      *pushNewline() {
        const ch = this.buffer[this.pos];
        if (ch === "\n")
          return yield* this.pushCount(1);
        else if (ch === "\r" && this.charAt(1) === "\n")
          return yield* this.pushCount(2);
        else
          return 0;
      }
      *pushSpaces(allowTabs) {
        let i = this.pos - 1;
        let ch;
        do {
          ch = this.buffer[++i];
        } while (ch === " " || allowTabs && ch === "	");
        const n = i - this.pos;
        if (n > 0) {
          yield this.buffer.substr(this.pos, n);
          this.pos = i;
        }
        return n;
      }
      *pushUntil(test) {
        let i = this.pos;
        let ch = this.buffer[i];
        while (!test(ch))
          ch = this.buffer[++i];
        return yield* this.pushToIndex(i, false);
      }
    };
    exports2.Lexer = Lexer;
  }
});

// node_modules/yaml/dist/parse/line-counter.js
var require_line_counter = __commonJS({
  "node_modules/yaml/dist/parse/line-counter.js"(exports2) {
    "use strict";
    var LineCounter = class {
      constructor() {
        this.lineStarts = [];
        this.addNewLine = (offset) => this.lineStarts.push(offset);
        this.linePos = (offset) => {
          let low = 0;
          let high = this.lineStarts.length;
          while (low < high) {
            const mid = low + high >> 1;
            if (this.lineStarts[mid] < offset)
              low = mid + 1;
            else
              high = mid;
          }
          if (this.lineStarts[low] === offset)
            return { line: low + 1, col: 1 };
          if (low === 0)
            return { line: 0, col: offset };
          const start = this.lineStarts[low - 1];
          return { line: low, col: offset - start + 1 };
        };
      }
    };
    exports2.LineCounter = LineCounter;
  }
});

// node_modules/yaml/dist/parse/parser.js
var require_parser2 = __commonJS({
  "node_modules/yaml/dist/parse/parser.js"(exports2) {
    "use strict";
    var node_process = require("process");
    var cst = require_cst();
    var lexer = require_lexer();
    function includesToken(list, type) {
      for (let i = 0; i < list.length; ++i)
        if (list[i].type === type)
          return true;
      return false;
    }
    function findNonEmptyIndex(list) {
      for (let i = 0; i < list.length; ++i) {
        switch (list[i].type) {
          case "space":
          case "comment":
          case "newline":
            break;
          default:
            return i;
        }
      }
      return -1;
    }
    function isFlowToken(token) {
      switch (token?.type) {
        case "alias":
        case "scalar":
        case "single-quoted-scalar":
        case "double-quoted-scalar":
        case "flow-collection":
          return true;
        default:
          return false;
      }
    }
    function getPrevProps(parent) {
      switch (parent.type) {
        case "document":
          return parent.start;
        case "block-map": {
          const it = parent.items[parent.items.length - 1];
          return it.sep ?? it.start;
        }
        case "block-seq":
          return parent.items[parent.items.length - 1].start;
        /* istanbul ignore next should not happen */
        default:
          return [];
      }
    }
    function getFirstKeyStartProps(prev) {
      if (prev.length === 0)
        return [];
      let i = prev.length;
      loop: while (--i >= 0) {
        switch (prev[i].type) {
          case "doc-start":
          case "explicit-key-ind":
          case "map-value-ind":
          case "seq-item-ind":
          case "newline":
            break loop;
        }
      }
      while (prev[++i]?.type === "space") {
      }
      return prev.splice(i, prev.length);
    }
    function fixFlowSeqItems(fc) {
      if (fc.start.type === "flow-seq-start") {
        for (const it of fc.items) {
          if (it.sep && !it.value && !includesToken(it.start, "explicit-key-ind") && !includesToken(it.sep, "map-value-ind")) {
            if (it.key)
              it.value = it.key;
            delete it.key;
            if (isFlowToken(it.value)) {
              if (it.value.end)
                Array.prototype.push.apply(it.value.end, it.sep);
              else
                it.value.end = it.sep;
            } else
              Array.prototype.push.apply(it.start, it.sep);
            delete it.sep;
          }
        }
      }
    }
    var Parser = class {
      /**
       * @param onNewLine - If defined, called separately with the start position of
       *   each new line (in `parse()`, including the start of input).
       */
      constructor(onNewLine) {
        this.atNewLine = true;
        this.atScalar = false;
        this.indent = 0;
        this.offset = 0;
        this.onKeyLine = false;
        this.stack = [];
        this.source = "";
        this.type = "";
        this.lexer = new lexer.Lexer();
        this.onNewLine = onNewLine;
      }
      /**
       * Parse `source` as a YAML stream.
       * If `incomplete`, a part of the last line may be left as a buffer for the next call.
       *
       * Errors are not thrown, but yielded as `{ type: 'error', message }` tokens.
       *
       * @returns A generator of tokens representing each directive, document, and other structure.
       */
      *parse(source, incomplete = false) {
        if (this.onNewLine && this.offset === 0)
          this.onNewLine(0);
        for (const lexeme of this.lexer.lex(source, incomplete))
          yield* this.next(lexeme);
        if (!incomplete)
          yield* this.end();
      }
      /**
       * Advance the parser by the `source` of one lexical token.
       */
      *next(source) {
        this.source = source;
        if (node_process.env.LOG_TOKENS)
          console.log("|", cst.prettyToken(source));
        if (this.atScalar) {
          this.atScalar = false;
          yield* this.step();
          this.offset += source.length;
          return;
        }
        const type = cst.tokenType(source);
        if (!type) {
          const message = `Not a YAML token: ${source}`;
          yield* this.pop({ type: "error", offset: this.offset, message, source });
          this.offset += source.length;
        } else if (type === "scalar") {
          this.atNewLine = false;
          this.atScalar = true;
          this.type = "scalar";
        } else {
          this.type = type;
          yield* this.step();
          switch (type) {
            case "newline":
              this.atNewLine = true;
              this.indent = 0;
              if (this.onNewLine)
                this.onNewLine(this.offset + source.length);
              break;
            case "space":
              if (this.atNewLine && source[0] === " ")
                this.indent += source.length;
              break;
            case "explicit-key-ind":
            case "map-value-ind":
            case "seq-item-ind":
              if (this.atNewLine)
                this.indent += source.length;
              break;
            case "doc-mode":
            case "flow-error-end":
              return;
            default:
              this.atNewLine = false;
          }
          this.offset += source.length;
        }
      }
      /** Call at end of input to push out any remaining constructions */
      *end() {
        while (this.stack.length > 0)
          yield* this.pop();
      }
      get sourceToken() {
        const st = {
          type: this.type,
          offset: this.offset,
          indent: this.indent,
          source: this.source
        };
        return st;
      }
      *step() {
        const top = this.peek(1);
        if (this.type === "doc-end" && top?.type !== "doc-end") {
          while (this.stack.length > 0)
            yield* this.pop();
          this.stack.push({
            type: "doc-end",
            offset: this.offset,
            source: this.source
          });
          return;
        }
        if (!top)
          return yield* this.stream();
        switch (top.type) {
          case "document":
            return yield* this.document(top);
          case "alias":
          case "scalar":
          case "single-quoted-scalar":
          case "double-quoted-scalar":
            return yield* this.scalar(top);
          case "block-scalar":
            return yield* this.blockScalar(top);
          case "block-map":
            return yield* this.blockMap(top);
          case "block-seq":
            return yield* this.blockSequence(top);
          case "flow-collection":
            return yield* this.flowCollection(top);
          case "doc-end":
            return yield* this.documentEnd(top);
        }
        yield* this.pop();
      }
      peek(n) {
        return this.stack[this.stack.length - n];
      }
      *pop(error48) {
        const token = error48 ?? this.stack.pop();
        if (!token) {
          const message = "Tried to pop an empty stack";
          yield { type: "error", offset: this.offset, source: "", message };
        } else if (this.stack.length === 0) {
          yield token;
        } else {
          const top = this.peek(1);
          if (token.type === "block-scalar") {
            token.indent = "indent" in top ? top.indent : 0;
          } else if (token.type === "flow-collection" && top.type === "document") {
            token.indent = 0;
          }
          if (token.type === "flow-collection")
            fixFlowSeqItems(token);
          switch (top.type) {
            case "document":
              top.value = token;
              break;
            case "block-scalar":
              top.props.push(token);
              break;
            case "block-map": {
              const it = top.items[top.items.length - 1];
              if (it.value) {
                top.items.push({ start: [], key: token, sep: [] });
                this.onKeyLine = true;
                return;
              } else if (it.sep) {
                it.value = token;
              } else {
                Object.assign(it, { key: token, sep: [] });
                this.onKeyLine = !it.explicitKey;
                return;
              }
              break;
            }
            case "block-seq": {
              const it = top.items[top.items.length - 1];
              if (it.value)
                top.items.push({ start: [], value: token });
              else
                it.value = token;
              break;
            }
            case "flow-collection": {
              const it = top.items[top.items.length - 1];
              if (!it || it.value)
                top.items.push({ start: [], key: token, sep: [] });
              else if (it.sep)
                it.value = token;
              else
                Object.assign(it, { key: token, sep: [] });
              return;
            }
            /* istanbul ignore next should not happen */
            default:
              yield* this.pop();
              yield* this.pop(token);
          }
          if ((top.type === "document" || top.type === "block-map" || top.type === "block-seq") && (token.type === "block-map" || token.type === "block-seq")) {
            const last = token.items[token.items.length - 1];
            if (last && !last.sep && !last.value && last.start.length > 0 && findNonEmptyIndex(last.start) === -1 && (token.indent === 0 || last.start.every((st) => st.type !== "comment" || st.indent < token.indent))) {
              if (top.type === "document")
                top.end = last.start;
              else
                top.items.push({ start: last.start });
              token.items.splice(-1, 1);
            }
          }
        }
      }
      *stream() {
        switch (this.type) {
          case "directive-line":
            yield { type: "directive", offset: this.offset, source: this.source };
            return;
          case "byte-order-mark":
          case "space":
          case "comment":
          case "newline":
            yield this.sourceToken;
            return;
          case "doc-mode":
          case "doc-start": {
            const doc = {
              type: "document",
              offset: this.offset,
              start: []
            };
            if (this.type === "doc-start")
              doc.start.push(this.sourceToken);
            this.stack.push(doc);
            return;
          }
        }
        yield {
          type: "error",
          offset: this.offset,
          message: `Unexpected ${this.type} token in YAML stream`,
          source: this.source
        };
      }
      *document(doc) {
        if (doc.value)
          return yield* this.lineEnd(doc);
        switch (this.type) {
          case "doc-start": {
            if (findNonEmptyIndex(doc.start) !== -1) {
              yield* this.pop();
              yield* this.step();
            } else
              doc.start.push(this.sourceToken);
            return;
          }
          case "anchor":
          case "tag":
          case "space":
          case "comment":
          case "newline":
            doc.start.push(this.sourceToken);
            return;
        }
        const bv = this.startBlockValue(doc);
        if (bv)
          this.stack.push(bv);
        else {
          yield {
            type: "error",
            offset: this.offset,
            message: `Unexpected ${this.type} token in YAML document`,
            source: this.source
          };
        }
      }
      *scalar(scalar) {
        if (this.type === "map-value-ind") {
          const prev = getPrevProps(this.peek(2));
          const start = getFirstKeyStartProps(prev);
          let sep;
          if (scalar.end) {
            sep = scalar.end;
            sep.push(this.sourceToken);
            delete scalar.end;
          } else
            sep = [this.sourceToken];
          const map2 = {
            type: "block-map",
            offset: scalar.offset,
            indent: scalar.indent,
            items: [{ start, key: scalar, sep }]
          };
          this.onKeyLine = true;
          this.stack[this.stack.length - 1] = map2;
        } else
          yield* this.lineEnd(scalar);
      }
      *blockScalar(scalar) {
        switch (this.type) {
          case "space":
          case "comment":
          case "newline":
            scalar.props.push(this.sourceToken);
            return;
          case "scalar":
            scalar.source = this.source;
            this.atNewLine = true;
            this.indent = 0;
            if (this.onNewLine) {
              let nl = this.source.indexOf("\n") + 1;
              while (nl !== 0) {
                this.onNewLine(this.offset + nl);
                nl = this.source.indexOf("\n", nl) + 1;
              }
            }
            yield* this.pop();
            break;
          /* istanbul ignore next should not happen */
          default:
            yield* this.pop();
            yield* this.step();
        }
      }
      *blockMap(map2) {
        const it = map2.items[map2.items.length - 1];
        switch (this.type) {
          case "newline":
            this.onKeyLine = false;
            if (it.value) {
              const end = "end" in it.value ? it.value.end : void 0;
              const last = Array.isArray(end) ? end[end.length - 1] : void 0;
              if (last?.type === "comment")
                end?.push(this.sourceToken);
              else
                map2.items.push({ start: [this.sourceToken] });
            } else if (it.sep) {
              it.sep.push(this.sourceToken);
            } else {
              it.start.push(this.sourceToken);
            }
            return;
          case "space":
          case "comment":
            if (it.value) {
              map2.items.push({ start: [this.sourceToken] });
            } else if (it.sep) {
              it.sep.push(this.sourceToken);
            } else {
              if (this.atIndentedComment(it.start, map2.indent)) {
                const prev = map2.items[map2.items.length - 2];
                const end = prev?.value?.end;
                if (Array.isArray(end)) {
                  Array.prototype.push.apply(end, it.start);
                  end.push(this.sourceToken);
                  map2.items.pop();
                  return;
                }
              }
              it.start.push(this.sourceToken);
            }
            return;
        }
        if (this.indent >= map2.indent) {
          const atMapIndent = !this.onKeyLine && this.indent === map2.indent;
          const atNextItem = atMapIndent && (it.sep || it.explicitKey) && this.type !== "seq-item-ind";
          let start = [];
          if (atNextItem && it.sep && !it.value) {
            const nl = [];
            for (let i = 0; i < it.sep.length; ++i) {
              const st = it.sep[i];
              switch (st.type) {
                case "newline":
                  nl.push(i);
                  break;
                case "space":
                  break;
                case "comment":
                  if (st.indent > map2.indent)
                    nl.length = 0;
                  break;
                default:
                  nl.length = 0;
              }
            }
            if (nl.length >= 2)
              start = it.sep.splice(nl[1]);
          }
          switch (this.type) {
            case "anchor":
            case "tag":
              if (atNextItem || it.value) {
                start.push(this.sourceToken);
                map2.items.push({ start });
                this.onKeyLine = true;
              } else if (it.sep) {
                it.sep.push(this.sourceToken);
              } else {
                it.start.push(this.sourceToken);
              }
              return;
            case "explicit-key-ind":
              if (!it.sep && !it.explicitKey) {
                it.start.push(this.sourceToken);
                it.explicitKey = true;
              } else if (atNextItem || it.value) {
                start.push(this.sourceToken);
                map2.items.push({ start, explicitKey: true });
              } else {
                this.stack.push({
                  type: "block-map",
                  offset: this.offset,
                  indent: this.indent,
                  items: [{ start: [this.sourceToken], explicitKey: true }]
                });
              }
              this.onKeyLine = true;
              return;
            case "map-value-ind":
              if (it.explicitKey) {
                if (!it.sep) {
                  if (includesToken(it.start, "newline")) {
                    Object.assign(it, { key: null, sep: [this.sourceToken] });
                  } else {
                    const start2 = getFirstKeyStartProps(it.start);
                    this.stack.push({
                      type: "block-map",
                      offset: this.offset,
                      indent: this.indent,
                      items: [{ start: start2, key: null, sep: [this.sourceToken] }]
                    });
                  }
                } else if (it.value) {
                  map2.items.push({ start: [], key: null, sep: [this.sourceToken] });
                } else if (includesToken(it.sep, "map-value-ind")) {
                  this.stack.push({
                    type: "block-map",
                    offset: this.offset,
                    indent: this.indent,
                    items: [{ start, key: null, sep: [this.sourceToken] }]
                  });
                } else if (isFlowToken(it.key) && !includesToken(it.sep, "newline")) {
                  const start2 = getFirstKeyStartProps(it.start);
                  const key = it.key;
                  const sep = it.sep;
                  sep.push(this.sourceToken);
                  delete it.key;
                  delete it.sep;
                  this.stack.push({
                    type: "block-map",
                    offset: this.offset,
                    indent: this.indent,
                    items: [{ start: start2, key, sep }]
                  });
                } else if (start.length > 0) {
                  it.sep = it.sep.concat(start, this.sourceToken);
                } else {
                  it.sep.push(this.sourceToken);
                }
              } else {
                if (!it.sep) {
                  Object.assign(it, { key: null, sep: [this.sourceToken] });
                } else if (it.value || atNextItem) {
                  map2.items.push({ start, key: null, sep: [this.sourceToken] });
                } else if (includesToken(it.sep, "map-value-ind")) {
                  this.stack.push({
                    type: "block-map",
                    offset: this.offset,
                    indent: this.indent,
                    items: [{ start: [], key: null, sep: [this.sourceToken] }]
                  });
                } else {
                  it.sep.push(this.sourceToken);
                }
              }
              this.onKeyLine = true;
              return;
            case "alias":
            case "scalar":
            case "single-quoted-scalar":
            case "double-quoted-scalar": {
              const fs = this.flowScalar(this.type);
              if (atNextItem || it.value) {
                map2.items.push({ start, key: fs, sep: [] });
                this.onKeyLine = true;
              } else if (it.sep) {
                this.stack.push(fs);
              } else {
                Object.assign(it, { key: fs, sep: [] });
                this.onKeyLine = true;
              }
              return;
            }
            default: {
              const bv = this.startBlockValue(map2);
              if (bv) {
                if (bv.type === "block-seq") {
                  if (!it.explicitKey && it.sep && !includesToken(it.sep, "newline")) {
                    yield* this.pop({
                      type: "error",
                      offset: this.offset,
                      message: "Unexpected block-seq-ind on same line with key",
                      source: this.source
                    });
                    return;
                  }
                } else if (atMapIndent) {
                  map2.items.push({ start });
                }
                this.stack.push(bv);
                return;
              }
            }
          }
        }
        yield* this.pop();
        yield* this.step();
      }
      *blockSequence(seq) {
        const it = seq.items[seq.items.length - 1];
        switch (this.type) {
          case "newline":
            if (it.value) {
              const end = "end" in it.value ? it.value.end : void 0;
              const last = Array.isArray(end) ? end[end.length - 1] : void 0;
              if (last?.type === "comment")
                end?.push(this.sourceToken);
              else
                seq.items.push({ start: [this.sourceToken] });
            } else
              it.start.push(this.sourceToken);
            return;
          case "space":
          case "comment":
            if (it.value)
              seq.items.push({ start: [this.sourceToken] });
            else {
              if (this.atIndentedComment(it.start, seq.indent)) {
                const prev = seq.items[seq.items.length - 2];
                const end = prev?.value?.end;
                if (Array.isArray(end)) {
                  Array.prototype.push.apply(end, it.start);
                  end.push(this.sourceToken);
                  seq.items.pop();
                  return;
                }
              }
              it.start.push(this.sourceToken);
            }
            return;
          case "anchor":
          case "tag":
            if (it.value || this.indent <= seq.indent)
              break;
            it.start.push(this.sourceToken);
            return;
          case "seq-item-ind":
            if (this.indent !== seq.indent)
              break;
            if (it.value || includesToken(it.start, "seq-item-ind"))
              seq.items.push({ start: [this.sourceToken] });
            else
              it.start.push(this.sourceToken);
            return;
        }
        if (this.indent > seq.indent) {
          const bv = this.startBlockValue(seq);
          if (bv) {
            this.stack.push(bv);
            return;
          }
        }
        yield* this.pop();
        yield* this.step();
      }
      *flowCollection(fc) {
        const it = fc.items[fc.items.length - 1];
        if (this.type === "flow-error-end") {
          let top;
          do {
            yield* this.pop();
            top = this.peek(1);
          } while (top?.type === "flow-collection");
        } else if (fc.end.length === 0) {
          switch (this.type) {
            case "comma":
            case "explicit-key-ind":
              if (!it || it.sep)
                fc.items.push({ start: [this.sourceToken] });
              else
                it.start.push(this.sourceToken);
              return;
            case "map-value-ind":
              if (!it || it.value)
                fc.items.push({ start: [], key: null, sep: [this.sourceToken] });
              else if (it.sep)
                it.sep.push(this.sourceToken);
              else
                Object.assign(it, { key: null, sep: [this.sourceToken] });
              return;
            case "space":
            case "comment":
            case "newline":
            case "anchor":
            case "tag":
              if (!it || it.value)
                fc.items.push({ start: [this.sourceToken] });
              else if (it.sep)
                it.sep.push(this.sourceToken);
              else
                it.start.push(this.sourceToken);
              return;
            case "alias":
            case "scalar":
            case "single-quoted-scalar":
            case "double-quoted-scalar": {
              const fs = this.flowScalar(this.type);
              if (!it || it.value)
                fc.items.push({ start: [], key: fs, sep: [] });
              else if (it.sep)
                this.stack.push(fs);
              else
                Object.assign(it, { key: fs, sep: [] });
              return;
            }
            case "flow-map-end":
            case "flow-seq-end":
              fc.end.push(this.sourceToken);
              return;
          }
          const bv = this.startBlockValue(fc);
          if (bv)
            this.stack.push(bv);
          else {
            yield* this.pop();
            yield* this.step();
          }
        } else {
          const parent = this.peek(2);
          if (parent.type === "block-map" && (this.type === "map-value-ind" && parent.indent === fc.indent || this.type === "newline" && !parent.items[parent.items.length - 1].sep)) {
            yield* this.pop();
            yield* this.step();
          } else if (this.type === "map-value-ind" && parent.type !== "flow-collection") {
            const prev = getPrevProps(parent);
            const start = getFirstKeyStartProps(prev);
            fixFlowSeqItems(fc);
            const sep = fc.end.splice(1, fc.end.length);
            sep.push(this.sourceToken);
            const map2 = {
              type: "block-map",
              offset: fc.offset,
              indent: fc.indent,
              items: [{ start, key: fc, sep }]
            };
            this.onKeyLine = true;
            this.stack[this.stack.length - 1] = map2;
          } else {
            yield* this.lineEnd(fc);
          }
        }
      }
      flowScalar(type) {
        if (this.onNewLine) {
          let nl = this.source.indexOf("\n") + 1;
          while (nl !== 0) {
            this.onNewLine(this.offset + nl);
            nl = this.source.indexOf("\n", nl) + 1;
          }
        }
        return {
          type,
          offset: this.offset,
          indent: this.indent,
          source: this.source
        };
      }
      startBlockValue(parent) {
        switch (this.type) {
          case "alias":
          case "scalar":
          case "single-quoted-scalar":
          case "double-quoted-scalar":
            return this.flowScalar(this.type);
          case "block-scalar-header":
            return {
              type: "block-scalar",
              offset: this.offset,
              indent: this.indent,
              props: [this.sourceToken],
              source: ""
            };
          case "flow-map-start":
          case "flow-seq-start":
            return {
              type: "flow-collection",
              offset: this.offset,
              indent: this.indent,
              start: this.sourceToken,
              items: [],
              end: []
            };
          case "seq-item-ind":
            return {
              type: "block-seq",
              offset: this.offset,
              indent: this.indent,
              items: [{ start: [this.sourceToken] }]
            };
          case "explicit-key-ind": {
            this.onKeyLine = true;
            const prev = getPrevProps(parent);
            const start = getFirstKeyStartProps(prev);
            start.push(this.sourceToken);
            return {
              type: "block-map",
              offset: this.offset,
              indent: this.indent,
              items: [{ start, explicitKey: true }]
            };
          }
          case "map-value-ind": {
            this.onKeyLine = true;
            const prev = getPrevProps(parent);
            const start = getFirstKeyStartProps(prev);
            return {
              type: "block-map",
              offset: this.offset,
              indent: this.indent,
              items: [{ start, key: null, sep: [this.sourceToken] }]
            };
          }
        }
        return null;
      }
      atIndentedComment(start, indent) {
        if (this.type !== "comment")
          return false;
        if (this.indent <= indent)
          return false;
        return start.every((st) => st.type === "newline" || st.type === "space");
      }
      *documentEnd(docEnd) {
        if (this.type !== "doc-mode") {
          if (docEnd.end)
            docEnd.end.push(this.sourceToken);
          else
            docEnd.end = [this.sourceToken];
          if (this.type === "newline")
            yield* this.pop();
        }
      }
      *lineEnd(token) {
        switch (this.type) {
          case "comma":
          case "doc-start":
          case "doc-end":
          case "flow-seq-end":
          case "flow-map-end":
          case "map-value-ind":
            yield* this.pop();
            yield* this.step();
            break;
          case "newline":
            this.onKeyLine = false;
          // fallthrough
          case "space":
          case "comment":
          default:
            if (token.end)
              token.end.push(this.sourceToken);
            else
              token.end = [this.sourceToken];
            if (this.type === "newline")
              yield* this.pop();
        }
      }
    };
    exports2.Parser = Parser;
  }
});

// node_modules/yaml/dist/public-api.js
var require_public_api = __commonJS({
  "node_modules/yaml/dist/public-api.js"(exports2) {
    "use strict";
    var composer = require_composer();
    var Document = require_Document();
    var errors = require_errors();
    var log = require_log();
    var identity = require_identity();
    var lineCounter = require_line_counter();
    var parser = require_parser2();
    function parseOptions(options2) {
      const prettyErrors = options2.prettyErrors !== false;
      const lineCounter$1 = options2.lineCounter || prettyErrors && new lineCounter.LineCounter() || null;
      return { lineCounter: lineCounter$1, prettyErrors };
    }
    function parseAllDocuments(source, options2 = {}) {
      const { lineCounter: lineCounter2, prettyErrors } = parseOptions(options2);
      const parser$1 = new parser.Parser(lineCounter2?.addNewLine);
      const composer$1 = new composer.Composer(options2);
      const docs = Array.from(composer$1.compose(parser$1.parse(source)));
      if (prettyErrors && lineCounter2)
        for (const doc of docs) {
          doc.errors.forEach(errors.prettifyError(source, lineCounter2));
          doc.warnings.forEach(errors.prettifyError(source, lineCounter2));
        }
      if (docs.length > 0)
        return docs;
      return Object.assign([], { empty: true }, composer$1.streamInfo());
    }
    function parseDocument(source, options2 = {}) {
      const { lineCounter: lineCounter2, prettyErrors } = parseOptions(options2);
      const parser$1 = new parser.Parser(lineCounter2?.addNewLine);
      const composer$1 = new composer.Composer(options2);
      let doc = null;
      for (const _doc of composer$1.compose(parser$1.parse(source), true, source.length)) {
        if (!doc)
          doc = _doc;
        else if (doc.options.logLevel !== "silent") {
          doc.errors.push(new errors.YAMLParseError(_doc.range.slice(0, 2), "MULTIPLE_DOCS", "Source contains multiple documents; please use YAML.parseAllDocuments()"));
          break;
        }
      }
      if (prettyErrors && lineCounter2) {
        doc.errors.forEach(errors.prettifyError(source, lineCounter2));
        doc.warnings.forEach(errors.prettifyError(source, lineCounter2));
      }
      return doc;
    }
    function parse3(src, reviver, options2) {
      let _reviver = void 0;
      if (typeof reviver === "function") {
        _reviver = reviver;
      } else if (options2 === void 0 && reviver && typeof reviver === "object") {
        options2 = reviver;
      }
      const doc = parseDocument(src, options2);
      if (!doc)
        return null;
      doc.warnings.forEach((warning) => log.warn(doc.options.logLevel, warning));
      if (doc.errors.length > 0) {
        if (doc.options.logLevel !== "silent")
          throw doc.errors[0];
        else
          doc.errors = [];
      }
      return doc.toJS(Object.assign({ reviver: _reviver }, options2));
    }
    function stringify(value, replacer, options2) {
      let _replacer = null;
      if (typeof replacer === "function" || Array.isArray(replacer)) {
        _replacer = replacer;
      } else if (options2 === void 0 && replacer) {
        options2 = replacer;
      }
      if (typeof options2 === "string")
        options2 = options2.length;
      if (typeof options2 === "number") {
        const indent = Math.round(options2);
        options2 = indent < 1 ? void 0 : indent > 8 ? { indent: 8 } : { indent };
      }
      if (value === void 0) {
        const { keepUndefined } = options2 ?? replacer ?? {};
        if (!keepUndefined)
          return void 0;
      }
      if (identity.isDocument(value) && !_replacer)
        return value.toString(options2);
      return new Document.Document(value, _replacer, options2).toString(options2);
    }
    exports2.parse = parse3;
    exports2.parseAllDocuments = parseAllDocuments;
    exports2.parseDocument = parseDocument;
    exports2.stringify = stringify;
  }
});

// node_modules/yaml/dist/index.js
var require_dist4 = __commonJS({
  "node_modules/yaml/dist/index.js"(exports2) {
    "use strict";
    var composer = require_composer();
    var Document = require_Document();
    var Schema = require_Schema();
    var errors = require_errors();
    var Alias = require_Alias();
    var identity = require_identity();
    var Pair = require_Pair();
    var Scalar = require_Scalar();
    var YAMLMap = require_YAMLMap();
    var YAMLSeq = require_YAMLSeq();
    var cst = require_cst();
    var lexer = require_lexer();
    var lineCounter = require_line_counter();
    var parser = require_parser2();
    var publicApi = require_public_api();
    var visit = require_visit();
    exports2.Composer = composer.Composer;
    exports2.Document = Document.Document;
    exports2.Schema = Schema.Schema;
    exports2.YAMLError = errors.YAMLError;
    exports2.YAMLParseError = errors.YAMLParseError;
    exports2.YAMLWarning = errors.YAMLWarning;
    exports2.Alias = Alias.Alias;
    exports2.isAlias = identity.isAlias;
    exports2.isCollection = identity.isCollection;
    exports2.isDocument = identity.isDocument;
    exports2.isMap = identity.isMap;
    exports2.isNode = identity.isNode;
    exports2.isPair = identity.isPair;
    exports2.isScalar = identity.isScalar;
    exports2.isSeq = identity.isSeq;
    exports2.Pair = Pair.Pair;
    exports2.Scalar = Scalar.Scalar;
    exports2.YAMLMap = YAMLMap.YAMLMap;
    exports2.YAMLSeq = YAMLSeq.YAMLSeq;
    exports2.CST = cst;
    exports2.Lexer = lexer.Lexer;
    exports2.LineCounter = lineCounter.LineCounter;
    exports2.Parser = parser.Parser;
    exports2.parse = publicApi.parse;
    exports2.parseAllDocuments = publicApi.parseAllDocuments;
    exports2.parseDocument = publicApi.parseDocument;
    exports2.stringify = publicApi.stringify;
    exports2.visit = visit.visit;
    exports2.visitAsync = visit.visitAsync;
  }
});

// node_modules/json5/lib/unicode.js
var require_unicode = __commonJS({
  "node_modules/json5/lib/unicode.js"(exports2, module2) {
    module2.exports.Space_Separator = /[\u1680\u2000-\u200A\u202F\u205F\u3000]/;
    module2.exports.ID_Start = /[\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\u0561-\u0587\u05D0-\u05EA\u05F0-\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-\u08BD\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\u0D05-\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\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\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-\u1877\u1880-\u1884\u1887-\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\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\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\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\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\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\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-\uAB65\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]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/;
    module2.exports.ID_Continue = /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\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\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\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\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/;
  }
});

// node_modules/json5/lib/util.js
var require_util2 = __commonJS({
  "node_modules/json5/lib/util.js"(exports2, module2) {
    var unicode = require_unicode();
    module2.exports = {
      isSpaceSeparator(c) {
        return typeof c === "string" && unicode.Space_Separator.test(c);
      },
      isIdStartChar(c) {
        return typeof c === "string" && (c >= "a" && c <= "z" || c >= "A" && c <= "Z" || c === "$" || c === "_" || unicode.ID_Start.test(c));
      },
      isIdContinueChar(c) {
        return typeof c === "string" && (c >= "a" && c <= "z" || c >= "A" && c <= "Z" || c >= "0" && c <= "9" || c === "$" || c === "_" || c === "\u200C" || c === "\u200D" || unicode.ID_Continue.test(c));
      },
      isDigit(c) {
        return typeof c === "string" && /[0-9]/.test(c);
      },
      isHexDigit(c) {
        return typeof c === "string" && /[0-9A-Fa-f]/.test(c);
      }
    };
  }
});

// node_modules/json5/lib/parse.js
var require_parse = __commonJS({
  "node_modules/json5/lib/parse.js"(exports2, module2) {
    var util2 = require_util2();
    var source;
    var parseState;
    var stack;
    var pos;
    var line;
    var column;
    var token;
    var key;
    var root;
    module2.exports = function parse3(text, reviver) {
      source = String(text);
      parseState = "start";
      stack = [];
      pos = 0;
      line = 1;
      column = 0;
      token = void 0;
      key = void 0;
      root = void 0;
      do {
        token = lex();
        parseStates[parseState]();
      } while (token.type !== "eof");
      if (typeof reviver === "function") {
        return internalize({ "": root }, "", reviver);
      }
      return root;
    };
    function internalize(holder, name, reviver) {
      const value = holder[name];
      if (value != null && typeof value === "object") {
        if (Array.isArray(value)) {
          for (let i = 0; i < value.length; i++) {
            const key2 = String(i);
            const replacement = internalize(value, key2, reviver);
            if (replacement === void 0) {
              delete value[key2];
            } else {
              Object.defineProperty(value, key2, {
                value: replacement,
                writable: true,
                enumerable: true,
                configurable: true
              });
            }
          }
        } else {
          for (const key2 in value) {
            const replacement = internalize(value, key2, reviver);
            if (replacement === void 0) {
              delete value[key2];
            } else {
              Object.defineProperty(value, key2, {
                value: replacement,
                writable: true,
                enumerable: true,
                configurable: true
              });
            }
          }
        }
      }
      return reviver.call(holder, name, value);
    }
    var lexState;
    var buffer;
    var doubleQuote;
    var sign;
    var c;
    function lex() {
      lexState = "default";
      buffer = "";
      doubleQuote = false;
      sign = 1;
      for (; ; ) {
        c = peek();
        const token2 = lexStates[lexState]();
        if (token2) {
          return token2;
        }
      }
    }
    function peek() {
      if (source[pos]) {
        return String.fromCodePoint(source.codePointAt(pos));
      }
    }
    function read() {
      const c2 = peek();
      if (c2 === "\n") {
        line++;
        column = 0;
      } else if (c2) {
        column += c2.length;
      } else {
        column++;
      }
      if (c2) {
        pos += c2.length;
      }
      return c2;
    }
    var lexStates = {
      default() {
        switch (c) {
          case "	":
          case "\v":
          case "\f":
          case " ":
          case "\xA0":
          case "\uFEFF":
          case "\n":
          case "\r":
          case "\u2028":
          case "\u2029":
            read();
            return;
          case "/":
            read();
            lexState = "comment";
            return;
          case void 0:
            read();
            return newToken("eof");
        }
        if (util2.isSpaceSeparator(c)) {
          read();
          return;
        }
        return lexStates[parseState]();
      },
      comment() {
        switch (c) {
          case "*":
            read();
            lexState = "multiLineComment";
            return;
          case "/":
            read();
            lexState = "singleLineComment";
            return;
        }
        throw invalidChar(read());
      },
      multiLineComment() {
        switch (c) {
          case "*":
            read();
            lexState = "multiLineCommentAsterisk";
            return;
          case void 0:
            throw invalidChar(read());
        }
        read();
      },
      multiLineCommentAsterisk() {
        switch (c) {
          case "*":
            read();
            return;
          case "/":
            read();
            lexState = "default";
            return;
          case void 0:
            throw invalidChar(read());
        }
        read();
        lexState = "multiLineComment";
      },
      singleLineComment() {
        switch (c) {
          case "\n":
          case "\r":
          case "\u2028":
          case "\u2029":
            read();
            lexState = "default";
            return;
          case void 0:
            read();
            return newToken("eof");
        }
        read();
      },
      value() {
        switch (c) {
          case "{":
          case "[":
            return newToken("punctuator", read());
          case "n":
            read();
            literal2("ull");
            return newToken("null", null);
          case "t":
            read();
            literal2("rue");
            return newToken("boolean", true);
          case "f":
            read();
            literal2("alse");
            return newToken("boolean", false);
          case "-":
          case "+":
            if (read() === "-") {
              sign = -1;
            }
            lexState = "sign";
            return;
          case ".":
            buffer = read();
            lexState = "decimalPointLeading";
            return;
          case "0":
            buffer = read();
            lexState = "zero";
            return;
          case "1":
          case "2":
          case "3":
          case "4":
          case "5":
          case "6":
          case "7":
          case "8":
          case "9":
            buffer = read();
            lexState = "decimalInteger";
            return;
          case "I":
            read();
            literal2("nfinity");
            return newToken("numeric", Infinity);
          case "N":
            read();
            literal2("aN");
            return newToken("numeric", NaN);
          case '"':
          case "'":
            doubleQuote = read() === '"';
            buffer = "";
            lexState = "string";
            return;
        }
        throw invalidChar(read());
      },
      identifierNameStartEscape() {
        if (c !== "u") {
          throw invalidChar(read());
        }
        read();
        const u = unicodeEscape();
        switch (u) {
          case "$":
          case "_":
            break;
          default:
            if (!util2.isIdStartChar(u)) {
              throw invalidIdentifier();
            }
            break;
        }
        buffer += u;
        lexState = "identifierName";
      },
      identifierName() {
        switch (c) {
          case "$":
          case "_":
          case "\u200C":
          case "\u200D":
            buffer += read();
            return;
          case "\\":
            read();
            lexState = "identifierNameEscape";
            return;
        }
        if (util2.isIdContinueChar(c)) {
          buffer += read();
          return;
        }
        return newToken("identifier", buffer);
      },
      identifierNameEscape() {
        if (c !== "u") {
          throw invalidChar(read());
        }
        read();
        const u = unicodeEscape();
        switch (u) {
          case "$":
          case "_":
          case "\u200C":
          case "\u200D":
            break;
          default:
            if (!util2.isIdContinueChar(u)) {
              throw invalidIdentifier();
            }
            break;
        }
        buffer += u;
        lexState = "identifierName";
      },
      sign() {
        switch (c) {
          case ".":
            buffer = read();
            lexState = "decimalPointLeading";
            return;
          case "0":
            buffer = read();
            lexState = "zero";
            return;
          case "1":
          case "2":
          case "3":
          case "4":
          case "5":
          case "6":
          case "7":
          case "8":
          case "9":
            buffer = read();
            lexState = "decimalInteger";
            return;
          case "I":
            read();
            literal2("nfinity");
            return newToken("numeric", sign * Infinity);
          case "N":
            read();
            literal2("aN");
            return newToken("numeric", NaN);
        }
        throw invalidChar(read());
      },
      zero() {
        switch (c) {
          case ".":
            buffer += read();
            lexState = "decimalPoint";
            return;
          case "e":
          case "E":
            buffer += read();
            lexState = "decimalExponent";
            return;
          case "x":
          case "X":
            buffer += read();
            lexState = "hexadecimal";
            return;
        }
        return newToken("numeric", sign * 0);
      },
      decimalInteger() {
        switch (c) {
          case ".":
            buffer += read();
            lexState = "decimalPoint";
            return;
          case "e":
          case "E":
            buffer += read();
            lexState = "decimalExponent";
            return;
        }
        if (util2.isDigit(c)) {
          buffer += read();
          return;
        }
        return newToken("numeric", sign * Number(buffer));
      },
      decimalPointLeading() {
        if (util2.isDigit(c)) {
          buffer += read();
          lexState = "decimalFraction";
          return;
        }
        throw invalidChar(read());
      },
      decimalPoint() {
        switch (c) {
          case "e":
          case "E":
            buffer += read();
            lexState = "decimalExponent";
            return;
        }
        if (util2.isDigit(c)) {
          buffer += read();
          lexState = "decimalFraction";
          return;
        }
        return newToken("numeric", sign * Number(buffer));
      },
      decimalFraction() {
        switch (c) {
          case "e":
          case "E":
            buffer += read();
            lexState = "decimalExponent";
            return;
        }
        if (util2.isDigit(c)) {
          buffer += read();
          return;
        }
        return newToken("numeric", sign * Number(buffer));
      },
      decimalExponent() {
        switch (c) {
          case "+":
          case "-":
            buffer += read();
            lexState = "decimalExponentSign";
            return;
        }
        if (util2.isDigit(c)) {
          buffer += read();
          lexState = "decimalExponentInteger";
          return;
        }
        throw invalidChar(read());
      },
      decimalExponentSign() {
        if (util2.isDigit(c)) {
          buffer += read();
          lexState = "decimalExponentInteger";
          return;
        }
        throw invalidChar(read());
      },
      decimalExponentInteger() {
        if (util2.isDigit(c)) {
          buffer += read();
          return;
        }
        return newToken("numeric", sign * Number(buffer));
      },
      hexadecimal() {
        if (util2.isHexDigit(c)) {
          buffer += read();
          lexState = "hexadecimalInteger";
          return;
        }
        throw invalidChar(read());
      },
      hexadecimalInteger() {
        if (util2.isHexDigit(c)) {
          buffer += read();
          return;
        }
        return newToken("numeric", sign * Number(buffer));
      },
      string() {
        switch (c) {
          case "\\":
            read();
            buffer += escape2();
            return;
          case '"':
            if (doubleQuote) {
              read();
              return newToken("string", buffer);
            }
            buffer += read();
            return;
          case "'":
            if (!doubleQuote) {
              read();
              return newToken("string", buffer);
            }
            buffer += read();
            return;
          case "\n":
          case "\r":
            throw invalidChar(read());
          case "\u2028":
          case "\u2029":
            separatorChar(c);
            break;
          case void 0:
            throw invalidChar(read());
        }
        buffer += read();
      },
      start() {
        switch (c) {
          case "{":
          case "[":
            return newToken("punctuator", read());
        }
        lexState = "value";
      },
      beforePropertyName() {
        switch (c) {
          case "$":
          case "_":
            buffer = read();
            lexState = "identifierName";
            return;
          case "\\":
            read();
            lexState = "identifierNameStartEscape";
            return;
          case "}":
            return newToken("punctuator", read());
          case '"':
          case "'":
            doubleQuote = read() === '"';
            lexState = "string";
            return;
        }
        if (util2.isIdStartChar(c)) {
          buffer += read();
          lexState = "identifierName";
          return;
        }
        throw invalidChar(read());
      },
      afterPropertyName() {
        if (c === ":") {
          return newToken("punctuator", read());
        }
        throw invalidChar(read());
      },
      beforePropertyValue() {
        lexState = "value";
      },
      afterPropertyValue() {
        switch (c) {
          case ",":
          case "}":
            return newToken("punctuator", read());
        }
        throw invalidChar(read());
      },
      beforeArrayValue() {
        if (c === "]") {
          return newToken("punctuator", read());
        }
        lexState = "value";
      },
      afterArrayValue() {
        switch (c) {
          case ",":
          case "]":
            return newToken("punctuator", read());
        }
        throw invalidChar(read());
      },
      end() {
        throw invalidChar(read());
      }
    };
    function newToken(type, value) {
      return {
        type,
        value,
        line,
        column
      };
    }
    function literal2(s) {
      for (const c2 of s) {
        const p = peek();
        if (p !== c2) {
          throw invalidChar(read());
        }
        read();
      }
    }
    function escape2() {
      const c2 = peek();
      switch (c2) {
        case "b":
          read();
          return "\b";
        case "f":
          read();
          return "\f";
        case "n":
          read();
          return "\n";
        case "r":
          read();
          return "\r";
        case "t":
          read();
          return "	";
        case "v":
          read();
          return "\v";
        case "0":
          read();
          if (util2.isDigit(peek())) {
            throw invalidChar(read());
          }
          return "\0";
        case "x":
          read();
          return hexEscape();
        case "u":
          read();
          return unicodeEscape();
        case "\n":
        case "\u2028":
        case "\u2029":
          read();
          return "";
        case "\r":
          read();
          if (peek() === "\n") {
            read();
          }
          return "";
        case "1":
        case "2":
        case "3":
        case "4":
        case "5":
        case "6":
        case "7":
        case "8":
        case "9":
          throw invalidChar(read());
        case void 0:
          throw invalidChar(read());
      }
      return read();
    }
    function hexEscape() {
      let buffer2 = "";
      let c2 = peek();
      if (!util2.isHexDigit(c2)) {
        throw invalidChar(read());
      }
      buffer2 += read();
      c2 = peek();
      if (!util2.isHexDigit(c2)) {
        throw invalidChar(read());
      }
      buffer2 += read();
      return String.fromCodePoint(parseInt(buffer2, 16));
    }
    function unicodeEscape() {
      let buffer2 = "";
      let count = 4;
      while (count-- > 0) {
        const c2 = peek();
        if (!util2.isHexDigit(c2)) {
          throw invalidChar(read());
        }
        buffer2 += read();
      }
      return String.fromCodePoint(parseInt(buffer2, 16));
    }
    var parseStates = {
      start() {
        if (token.type === "eof") {
          throw invalidEOF();
        }
        push();
      },
      beforePropertyName() {
        switch (token.type) {
          case "identifier":
          case "string":
            key = token.value;
            parseState = "afterPropertyName";
            return;
          case "punctuator":
            pop();
            return;
          case "eof":
            throw invalidEOF();
        }
      },
      afterPropertyName() {
        if (token.type === "eof") {
          throw invalidEOF();
        }
        parseState = "beforePropertyValue";
      },
      beforePropertyValue() {
        if (token.type === "eof") {
          throw invalidEOF();
        }
        push();
      },
      beforeArrayValue() {
        if (token.type === "eof") {
          throw invalidEOF();
        }
        if (token.type === "punctuator" && token.value === "]") {
          pop();
          return;
        }
        push();
      },
      afterPropertyValue() {
        if (token.type === "eof") {
          throw invalidEOF();
        }
        switch (token.value) {
          case ",":
            parseState = "beforePropertyName";
            return;
          case "}":
            pop();
        }
      },
      afterArrayValue() {
        if (token.type === "eof") {
          throw invalidEOF();
        }
        switch (token.value) {
          case ",":
            parseState = "beforeArrayValue";
            return;
          case "]":
            pop();
        }
      },
      end() {
      }
    };
    function push() {
      let value;
      switch (token.type) {
        case "punctuator":
          switch (token.value) {
            case "{":
              value = {};
              break;
            case "[":
              value = [];
              break;
          }
          break;
        case "null":
        case "boolean":
        case "numeric":
        case "string":
          value = token.value;
          break;
      }
      if (root === void 0) {
        root = value;
      } else {
        const parent = stack[stack.length - 1];
        if (Array.isArray(parent)) {
          parent.push(value);
        } else {
          Object.defineProperty(parent, key, {
            value,
            writable: true,
            enumerable: true,
            configurable: true
          });
        }
      }
      if (value !== null && typeof value === "object") {
        stack.push(value);
        if (Array.isArray(value)) {
          parseState = "beforeArrayValue";
        } else {
          parseState = "beforePropertyName";
        }
      } else {
        const current = stack[stack.length - 1];
        if (current == null) {
          parseState = "end";
        } else if (Array.isArray(current)) {
          parseState = "afterArrayValue";
        } else {
          parseState = "afterPropertyValue";
        }
      }
    }
    function pop() {
      stack.pop();
      const current = stack[stack.length - 1];
      if (current == null) {
        parseState = "end";
      } else if (Array.isArray(current)) {
        parseState = "afterArrayValue";
      } else {
        parseState = "afterPropertyValue";
      }
    }
    function invalidChar(c2) {
      if (c2 === void 0) {
        return syntaxError2(`JSON5: invalid end of input at ${line}:${column}`);
      }
      return syntaxError2(`JSON5: invalid character '${formatChar(c2)}' at ${line}:${column}`);
    }
    function invalidEOF() {
      return syntaxError2(`JSON5: invalid end of input at ${line}:${column}`);
    }
    function invalidIdentifier() {
      column -= 5;
      return syntaxError2(`JSON5: invalid identifier character at ${line}:${column}`);
    }
    function separatorChar(c2) {
      console.warn(`JSON5: '${formatChar(c2)}' in strings is not valid ECMAScript; consider escaping`);
    }
    function formatChar(c2) {
      const replacements = {
        "'": "\\'",
        '"': '\\"',
        "\\": "\\\\",
        "\b": "\\b",
        "\f": "\\f",
        "\n": "\\n",
        "\r": "\\r",
        "	": "\\t",
        "\v": "\\v",
        "\0": "\\0",
        "\u2028": "\\u2028",
        "\u2029": "\\u2029"
      };
      if (replacements[c2]) {
        return replacements[c2];
      }
      if (c2 < " ") {
        const hexString = c2.charCodeAt(0).toString(16);
        return "\\x" + ("00" + hexString).substring(hexString.length);
      }
      return c2;
    }
    function syntaxError2(message) {
      const err = new SyntaxError(message);
      err.lineNumber = line;
      err.columnNumber = column;
      return err;
    }
  }
});

// node_modules/json5/lib/stringify.js
var require_stringify2 = __commonJS({
  "node_modules/json5/lib/stringify.js"(exports2, module2) {
    var util2 = require_util2();
    module2.exports = function stringify(value, replacer, space) {
      const stack = [];
      let indent = "";
      let propertyList;
      let replacerFunc;
      let gap = "";
      let quote;
      if (replacer != null && typeof replacer === "object" && !Array.isArray(replacer)) {
        space = replacer.space;
        quote = replacer.quote;
        replacer = replacer.replacer;
      }
      if (typeof replacer === "function") {
        replacerFunc = replacer;
      } else if (Array.isArray(replacer)) {
        propertyList = [];
        for (const v of replacer) {
          let item;
          if (typeof v === "string") {
            item = v;
          } else if (typeof v === "number" || v instanceof String || v instanceof Number) {
            item = String(v);
          }
          if (item !== void 0 && propertyList.indexOf(item) < 0) {
            propertyList.push(item);
          }
        }
      }
      if (space instanceof Number) {
        space = Number(space);
      } else if (space instanceof String) {
        space = String(space);
      }
      if (typeof space === "number") {
        if (space > 0) {
          space = Math.min(10, Math.floor(space));
          gap = "          ".substr(0, space);
        }
      } else if (typeof space === "string") {
        gap = space.substr(0, 10);
      }
      return serializeProperty("", { "": value });
      function serializeProperty(key, holder) {
        let value2 = holder[key];
        if (value2 != null) {
          if (typeof value2.toJSON5 === "function") {
            value2 = value2.toJSON5(key);
          } else if (typeof value2.toJSON === "function") {
            value2 = value2.toJSON(key);
          }
        }
        if (replacerFunc) {
          value2 = replacerFunc.call(holder, key, value2);
        }
        if (value2 instanceof Number) {
          value2 = Number(value2);
        } else if (value2 instanceof String) {
          value2 = String(value2);
        } else if (value2 instanceof Boolean) {
          value2 = value2.valueOf();
        }
        switch (value2) {
          case null:
            return "null";
          case true:
            return "true";
          case false:
            return "false";
        }
        if (typeof value2 === "string") {
          return quoteString(value2, false);
        }
        if (typeof value2 === "number") {
          return String(value2);
        }
        if (typeof value2 === "object") {
          return Array.isArray(value2) ? serializeArray(value2) : serializeObject(value2);
        }
        return void 0;
      }
      function quoteString(value2) {
        const quotes = {
          "'": 0.1,
          '"': 0.2
        };
        const replacements = {
          "'": "\\'",
          '"': '\\"',
          "\\": "\\\\",
          "\b": "\\b",
          "\f": "\\f",
          "\n": "\\n",
          "\r": "\\r",
          "	": "\\t",
          "\v": "\\v",
          "\0": "\\0",
          "\u2028": "\\u2028",
          "\u2029": "\\u2029"
        };
        let product = "";
        for (let i = 0; i < value2.length; i++) {
          const c = value2[i];
          switch (c) {
            case "'":
            case '"':
              quotes[c]++;
              product += c;
              continue;
            case "\0":
              if (util2.isDigit(value2[i + 1])) {
                product += "\\x00";
                continue;
              }
          }
          if (replacements[c]) {
            product += replacements[c];
            continue;
          }
          if (c < " ") {
            let hexString = c.charCodeAt(0).toString(16);
            product += "\\x" + ("00" + hexString).substring(hexString.length);
            continue;
          }
          product += c;
        }
        const quoteChar = quote || Object.keys(quotes).reduce((a, b) => quotes[a] < quotes[b] ? a : b);
        product = product.replace(new RegExp(quoteChar, "g"), replacements[quoteChar]);
        return quoteChar + product + quoteChar;
      }
      function serializeObject(value2) {
        if (stack.indexOf(value2) >= 0) {
          throw TypeError("Converting circular structure to JSON5");
        }
        stack.push(value2);
        let stepback = indent;
        indent = indent + gap;
        let keys = propertyList || Object.keys(value2);
        let partial2 = [];
        for (const key of keys) {
          const propertyString = serializeProperty(key, value2);
          if (propertyString !== void 0) {
            let member = serializeKey(key) + ":";
            if (gap !== "") {
              member += " ";
            }
            member += propertyString;
            partial2.push(member);
          }
        }
        let final;
        if (partial2.length === 0) {
          final = "{}";
        } else {
          let properties;
          if (gap === "") {
            properties = partial2.join(",");
            final = "{" + properties + "}";
          } else {
            let separator = ",\n" + indent;
            properties = partial2.join(separator);
            final = "{\n" + indent + properties + ",\n" + stepback + "}";
          }
        }
        stack.pop();
        indent = stepback;
        return final;
      }
      function serializeKey(key) {
        if (key.length === 0) {
          return quoteString(key, true);
        }
        const firstChar = String.fromCodePoint(key.codePointAt(0));
        if (!util2.isIdStartChar(firstChar)) {
          return quoteString(key, true);
        }
        for (let i = firstChar.length; i < key.length; i++) {
          if (!util2.isIdContinueChar(String.fromCodePoint(key.codePointAt(i)))) {
            return quoteString(key, true);
          }
        }
        return key;
      }
      function serializeArray(value2) {
        if (stack.indexOf(value2) >= 0) {
          throw TypeError("Converting circular structure to JSON5");
        }
        stack.push(value2);
        let stepback = indent;
        indent = indent + gap;
        let partial2 = [];
        for (let i = 0; i < value2.length; i++) {
          const propertyString = serializeProperty(String(i), value2);
          partial2.push(propertyString !== void 0 ? propertyString : "null");
        }
        let final;
        if (partial2.length === 0) {
          final = "[]";
        } else {
          if (gap === "") {
            let properties = partial2.join(",");
            final = "[" + properties + "]";
          } else {
            let separator = ",\n" + indent;
            let properties = partial2.join(separator);
            final = "[\n" + indent + properties + ",\n" + stepback + "]";
          }
        }
        stack.pop();
        indent = stepback;
        return final;
      }
    };
  }
});

// node_modules/json5/lib/index.js
var require_lib = __commonJS({
  "node_modules/json5/lib/index.js"(exports2, module2) {
    var parse3 = require_parse();
    var stringify = require_stringify2();
    var JSON5 = {
      parse: parse3,
      stringify
    };
    module2.exports = JSON5;
  }
});

// node_modules/source-map/lib/base64.js
var require_base64 = __commonJS({
  "node_modules/source-map/lib/base64.js"(exports2) {
    var intToCharMap = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");
    exports2.encode = function(number4) {
      if (0 <= number4 && number4 < intToCharMap.length) {
        return intToCharMap[number4];
      }
      throw new TypeError("Must be between 0 and 63: " + number4);
    };
    exports2.decode = function(charCode) {
      var bigA = 65;
      var bigZ = 90;
      var littleA = 97;
      var littleZ = 122;
      var zero = 48;
      var nine = 57;
      var plus = 43;
      var slash = 47;
      var littleOffset = 26;
      var numberOffset = 52;
      if (bigA <= charCode && charCode <= bigZ) {
        return charCode - bigA;
      }
      if (littleA <= charCode && charCode <= littleZ) {
        return charCode - littleA + littleOffset;
      }
      if (zero <= charCode && charCode <= nine) {
        return charCode - zero + numberOffset;
      }
      if (charCode == plus) {
        return 62;
      }
      if (charCode == slash) {
        return 63;
      }
      return -1;
    };
  }
});

// node_modules/source-map/lib/base64-vlq.js
var require_base64_vlq = __commonJS({
  "node_modules/source-map/lib/base64-vlq.js"(exports2) {
    var base643 = require_base64();
    var VLQ_BASE_SHIFT = 5;
    var VLQ_BASE = 1 << VLQ_BASE_SHIFT;
    var VLQ_BASE_MASK = VLQ_BASE - 1;
    var VLQ_CONTINUATION_BIT = VLQ_BASE;
    function toVLQSigned(aValue) {
      return aValue < 0 ? (-aValue << 1) + 1 : (aValue << 1) + 0;
    }
    function fromVLQSigned(aValue) {
      var isNegative = (aValue & 1) === 1;
      var shifted = aValue >> 1;
      return isNegative ? -shifted : shifted;
    }
    exports2.encode = function base64VLQ_encode(aValue) {
      var encoded = "";
      var digit;
      var vlq = toVLQSigned(aValue);
      do {
        digit = vlq & VLQ_BASE_MASK;
        vlq >>>= VLQ_BASE_SHIFT;
        if (vlq > 0) {
          digit |= VLQ_CONTINUATION_BIT;
        }
        encoded += base643.encode(digit);
      } while (vlq > 0);
      return encoded;
    };
    exports2.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) {
      var strLen = aStr.length;
      var result = 0;
      var shift = 0;
      var continuation, digit;
      do {
        if (aIndex >= strLen) {
          throw new Error("Expected more digits in base 64 VLQ value.");
        }
        digit = base643.decode(aStr.charCodeAt(aIndex++));
        if (digit === -1) {
          throw new Error("Invalid base64 digit: " + aStr.charAt(aIndex - 1));
        }
        continuation = !!(digit & VLQ_CONTINUATION_BIT);
        digit &= VLQ_BASE_MASK;
        result = result + (digit << shift);
        shift += VLQ_BASE_SHIFT;
      } while (continuation);
      aOutParam.value = fromVLQSigned(result);
      aOutParam.rest = aIndex;
    };
  }
});

// node_modules/source-map/lib/util.js
var require_util3 = __commonJS({
  "node_modules/source-map/lib/util.js"(exports2) {
    function getArg(aArgs, aName, aDefaultValue) {
      if (aName in aArgs) {
        return aArgs[aName];
      } else if (arguments.length === 3) {
        return aDefaultValue;
      } else {
        throw new Error('"' + aName + '" is a required argument.');
      }
    }
    exports2.getArg = getArg;
    var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/;
    var dataUrlRegexp = /^data:.+\,.+$/;
    function urlParse(aUrl) {
      var match = aUrl.match(urlRegexp);
      if (!match) {
        return null;
      }
      return {
        scheme: match[1],
        auth: match[2],
        host: match[3],
        port: match[4],
        path: match[5]
      };
    }
    exports2.urlParse = urlParse;
    function urlGenerate(aParsedUrl) {
      var url2 = "";
      if (aParsedUrl.scheme) {
        url2 += aParsedUrl.scheme + ":";
      }
      url2 += "//";
      if (aParsedUrl.auth) {
        url2 += aParsedUrl.auth + "@";
      }
      if (aParsedUrl.host) {
        url2 += aParsedUrl.host;
      }
      if (aParsedUrl.port) {
        url2 += ":" + aParsedUrl.port;
      }
      if (aParsedUrl.path) {
        url2 += aParsedUrl.path;
      }
      return url2;
    }
    exports2.urlGenerate = urlGenerate;
    function normalize(aPath) {
      var path = aPath;
      var url2 = urlParse(aPath);
      if (url2) {
        if (!url2.path) {
          return aPath;
        }
        path = url2.path;
      }
      var isAbsolute = exports2.isAbsolute(path);
      var parts = path.split(/\/+/);
      for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {
        part = parts[i];
        if (part === ".") {
          parts.splice(i, 1);
        } else if (part === "..") {
          up++;
        } else if (up > 0) {
          if (part === "") {
            parts.splice(i + 1, up);
            up = 0;
          } else {
            parts.splice(i, 2);
            up--;
          }
        }
      }
      path = parts.join("/");
      if (path === "") {
        path = isAbsolute ? "/" : ".";
      }
      if (url2) {
        url2.path = path;
        return urlGenerate(url2);
      }
      return path;
    }
    exports2.normalize = normalize;
    function join(aRoot, aPath) {
      if (aRoot === "") {
        aRoot = ".";
      }
      if (aPath === "") {
        aPath = ".";
      }
      var aPathUrl = urlParse(aPath);
      var aRootUrl = urlParse(aRoot);
      if (aRootUrl) {
        aRoot = aRootUrl.path || "/";
      }
      if (aPathUrl && !aPathUrl.scheme) {
        if (aRootUrl) {
          aPathUrl.scheme = aRootUrl.scheme;
        }
        return urlGenerate(aPathUrl);
      }
      if (aPathUrl || aPath.match(dataUrlRegexp)) {
        return aPath;
      }
      if (aRootUrl && !aRootUrl.host && !aRootUrl.path) {
        aRootUrl.host = aPath;
        return urlGenerate(aRootUrl);
      }
      var joined = aPath.charAt(0) === "/" ? aPath : normalize(aRoot.replace(/\/+$/, "") + "/" + aPath);
      if (aRootUrl) {
        aRootUrl.path = joined;
        return urlGenerate(aRootUrl);
      }
      return joined;
    }
    exports2.join = join;
    exports2.isAbsolute = function(aPath) {
      return aPath.charAt(0) === "/" || urlRegexp.test(aPath);
    };
    function relative(aRoot, aPath) {
      if (aRoot === "") {
        aRoot = ".";
      }
      aRoot = aRoot.replace(/\/$/, "");
      var level = 0;
      while (aPath.indexOf(aRoot + "/") !== 0) {
        var index = aRoot.lastIndexOf("/");
        if (index < 0) {
          return aPath;
        }
        aRoot = aRoot.slice(0, index);
        if (aRoot.match(/^([^\/]+:\/)?\/*$/)) {
          return aPath;
        }
        ++level;
      }
      return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1);
    }
    exports2.relative = relative;
    var supportsNullProto = (function() {
      var obj = /* @__PURE__ */ Object.create(null);
      return !("__proto__" in obj);
    })();
    function identity(s) {
      return s;
    }
    function toSetString(aStr) {
      if (isProtoString(aStr)) {
        return "$" + aStr;
      }
      return aStr;
    }
    exports2.toSetString = supportsNullProto ? identity : toSetString;
    function fromSetString(aStr) {
      if (isProtoString(aStr)) {
        return aStr.slice(1);
      }
      return aStr;
    }
    exports2.fromSetString = supportsNullProto ? identity : fromSetString;
    function isProtoString(s) {
      if (!s) {
        return false;
      }
      var length = s.length;
      if (length < 9) {
        return false;
      }
      if (s.charCodeAt(length - 1) !== 95 || s.charCodeAt(length - 2) !== 95 || s.charCodeAt(length - 3) !== 111 || s.charCodeAt(length - 4) !== 116 || s.charCodeAt(length - 5) !== 111 || s.charCodeAt(length - 6) !== 114 || s.charCodeAt(length - 7) !== 112 || s.charCodeAt(length - 8) !== 95 || s.charCodeAt(length - 9) !== 95) {
        return false;
      }
      for (var i = length - 10; i >= 0; i--) {
        if (s.charCodeAt(i) !== 36) {
          return false;
        }
      }
      return true;
    }
    function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) {
      var cmp = strcmp(mappingA.source, mappingB.source);
      if (cmp !== 0) {
        return cmp;
      }
      cmp = mappingA.originalLine - mappingB.originalLine;
      if (cmp !== 0) {
        return cmp;
      }
      cmp = mappingA.originalColumn - mappingB.originalColumn;
      if (cmp !== 0 || onlyCompareOriginal) {
        return cmp;
      }
      cmp = mappingA.generatedColumn - mappingB.generatedColumn;
      if (cmp !== 0) {
        return cmp;
      }
      cmp = mappingA.generatedLine - mappingB.generatedLine;
      if (cmp !== 0) {
        return cmp;
      }
      return strcmp(mappingA.name, mappingB.name);
    }
    exports2.compareByOriginalPositions = compareByOriginalPositions;
    function compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) {
      var cmp = mappingA.generatedLine - mappingB.generatedLine;
      if (cmp !== 0) {
        return cmp;
      }
      cmp = mappingA.generatedColumn - mappingB.generatedColumn;
      if (cmp !== 0 || onlyCompareGenerated) {
        return cmp;
      }
      cmp = strcmp(mappingA.source, mappingB.source);
      if (cmp !== 0) {
        return cmp;
      }
      cmp = mappingA.originalLine - mappingB.originalLine;
      if (cmp !== 0) {
        return cmp;
      }
      cmp = mappingA.originalColumn - mappingB.originalColumn;
      if (cmp !== 0) {
        return cmp;
      }
      return strcmp(mappingA.name, mappingB.name);
    }
    exports2.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated;
    function strcmp(aStr1, aStr2) {
      if (aStr1 === aStr2) {
        return 0;
      }
      if (aStr1 === null) {
        return 1;
      }
      if (aStr2 === null) {
        return -1;
      }
      if (aStr1 > aStr2) {
        return 1;
      }
      return -1;
    }
    function compareByGeneratedPositionsInflated(mappingA, mappingB) {
      var cmp = mappingA.generatedLine - mappingB.generatedLine;
      if (cmp !== 0) {
        return cmp;
      }
      cmp = mappingA.generatedColumn - mappingB.generatedColumn;
      if (cmp !== 0) {
        return cmp;
      }
      cmp = strcmp(mappingA.source, mappingB.source);
      if (cmp !== 0) {
        return cmp;
      }
      cmp = mappingA.originalLine - mappingB.originalLine;
      if (cmp !== 0) {
        return cmp;
      }
      cmp = mappingA.originalColumn - mappingB.originalColumn;
      if (cmp !== 0) {
        return cmp;
      }
      return strcmp(mappingA.name, mappingB.name);
    }
    exports2.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated;
    function parseSourceMapInput(str) {
      return JSON.parse(str.replace(/^\)]}'[^\n]*\n/, ""));
    }
    exports2.parseSourceMapInput = parseSourceMapInput;
    function computeSourceURL(sourceRoot, sourceURL, sourceMapURL) {
      sourceURL = sourceURL || "";
      if (sourceRoot) {
        if (sourceRoot[sourceRoot.length - 1] !== "/" && sourceURL[0] !== "/") {
          sourceRoot += "/";
        }
        sourceURL = sourceRoot + sourceURL;
      }
      if (sourceMapURL) {
        var parsed = urlParse(sourceMapURL);
        if (!parsed) {
          throw new Error("sourceMapURL could not be parsed");
        }
        if (parsed.path) {
          var index = parsed.path.lastIndexOf("/");
          if (index >= 0) {
            parsed.path = parsed.path.substring(0, index + 1);
          }
        }
        sourceURL = join(urlGenerate(parsed), sourceURL);
      }
      return normalize(sourceURL);
    }
    exports2.computeSourceURL = computeSourceURL;
  }
});

// node_modules/source-map/lib/array-set.js
var require_array_set = __commonJS({
  "node_modules/source-map/lib/array-set.js"(exports2) {
    var util2 = require_util3();
    var has = Object.prototype.hasOwnProperty;
    var hasNativeMap = typeof Map !== "undefined";
    function ArraySet() {
      this._array = [];
      this._set = hasNativeMap ? /* @__PURE__ */ new Map() : /* @__PURE__ */ Object.create(null);
    }
    ArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) {
      var set2 = new ArraySet();
      for (var i = 0, len = aArray.length; i < len; i++) {
        set2.add(aArray[i], aAllowDuplicates);
      }
      return set2;
    };
    ArraySet.prototype.size = function ArraySet_size() {
      return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length;
    };
    ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) {
      var sStr = hasNativeMap ? aStr : util2.toSetString(aStr);
      var isDuplicate = hasNativeMap ? this.has(aStr) : has.call(this._set, sStr);
      var idx = this._array.length;
      if (!isDuplicate || aAllowDuplicates) {
        this._array.push(aStr);
      }
      if (!isDuplicate) {
        if (hasNativeMap) {
          this._set.set(aStr, idx);
        } else {
          this._set[sStr] = idx;
        }
      }
    };
    ArraySet.prototype.has = function ArraySet_has(aStr) {
      if (hasNativeMap) {
        return this._set.has(aStr);
      } else {
        var sStr = util2.toSetString(aStr);
        return has.call(this._set, sStr);
      }
    };
    ArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) {
      if (hasNativeMap) {
        var idx = this._set.get(aStr);
        if (idx >= 0) {
          return idx;
        }
      } else {
        var sStr = util2.toSetString(aStr);
        if (has.call(this._set, sStr)) {
          return this._set[sStr];
        }
      }
      throw new Error('"' + aStr + '" is not in the set.');
    };
    ArraySet.prototype.at = function ArraySet_at(aIdx) {
      if (aIdx >= 0 && aIdx < this._array.length) {
        return this._array[aIdx];
      }
      throw new Error("No element indexed by " + aIdx);
    };
    ArraySet.prototype.toArray = function ArraySet_toArray() {
      return this._array.slice();
    };
    exports2.ArraySet = ArraySet;
  }
});

// node_modules/source-map/lib/mapping-list.js
var require_mapping_list = __commonJS({
  "node_modules/source-map/lib/mapping-list.js"(exports2) {
    var util2 = require_util3();
    function generatedPositionAfter(mappingA, mappingB) {
      var lineA = mappingA.generatedLine;
      var lineB = mappingB.generatedLine;
      var columnA = mappingA.generatedColumn;
      var columnB = mappingB.generatedColumn;
      return lineB > lineA || lineB == lineA && columnB >= columnA || util2.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0;
    }
    function MappingList() {
      this._array = [];
      this._sorted = true;
      this._last = { generatedLine: -1, generatedColumn: 0 };
    }
    MappingList.prototype.unsortedForEach = function MappingList_forEach(aCallback, aThisArg) {
      this._array.forEach(aCallback, aThisArg);
    };
    MappingList.prototype.add = function MappingList_add(aMapping) {
      if (generatedPositionAfter(this._last, aMapping)) {
        this._last = aMapping;
        this._array.push(aMapping);
      } else {
        this._sorted = false;
        this._array.push(aMapping);
      }
    };
    MappingList.prototype.toArray = function MappingList_toArray() {
      if (!this._sorted) {
        this._array.sort(util2.compareByGeneratedPositionsInflated);
        this._sorted = true;
      }
      return this._array;
    };
    exports2.MappingList = MappingList;
  }
});

// node_modules/source-map/lib/source-map-generator.js
var require_source_map_generator = __commonJS({
  "node_modules/source-map/lib/source-map-generator.js"(exports2) {
    var base64VLQ = require_base64_vlq();
    var util2 = require_util3();
    var ArraySet = require_array_set().ArraySet;
    var MappingList = require_mapping_list().MappingList;
    function SourceMapGenerator(aArgs) {
      if (!aArgs) {
        aArgs = {};
      }
      this._file = util2.getArg(aArgs, "file", null);
      this._sourceRoot = util2.getArg(aArgs, "sourceRoot", null);
      this._skipValidation = util2.getArg(aArgs, "skipValidation", false);
      this._sources = new ArraySet();
      this._names = new ArraySet();
      this._mappings = new MappingList();
      this._sourcesContents = null;
    }
    SourceMapGenerator.prototype._version = 3;
    SourceMapGenerator.fromSourceMap = function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) {
      var sourceRoot = aSourceMapConsumer.sourceRoot;
      var generator = new SourceMapGenerator({
        file: aSourceMapConsumer.file,
        sourceRoot
      });
      aSourceMapConsumer.eachMapping(function(mapping) {
        var newMapping = {
          generated: {
            line: mapping.generatedLine,
            column: mapping.generatedColumn
          }
        };
        if (mapping.source != null) {
          newMapping.source = mapping.source;
          if (sourceRoot != null) {
            newMapping.source = util2.relative(sourceRoot, newMapping.source);
          }
          newMapping.original = {
            line: mapping.originalLine,
            column: mapping.originalColumn
          };
          if (mapping.name != null) {
            newMapping.name = mapping.name;
          }
        }
        generator.addMapping(newMapping);
      });
      aSourceMapConsumer.sources.forEach(function(sourceFile) {
        var sourceRelative = sourceFile;
        if (sourceRoot !== null) {
          sourceRelative = util2.relative(sourceRoot, sourceFile);
        }
        if (!generator._sources.has(sourceRelative)) {
          generator._sources.add(sourceRelative);
        }
        var content = aSourceMapConsumer.sourceContentFor(sourceFile);
        if (content != null) {
          generator.setSourceContent(sourceFile, content);
        }
      });
      return generator;
    };
    SourceMapGenerator.prototype.addMapping = function SourceMapGenerator_addMapping(aArgs) {
      var generated = util2.getArg(aArgs, "generated");
      var original = util2.getArg(aArgs, "original", null);
      var source = util2.getArg(aArgs, "source", null);
      var name = util2.getArg(aArgs, "name", null);
      if (!this._skipValidation) {
        this._validateMapping(generated, original, source, name);
      }
      if (source != null) {
        source = String(source);
        if (!this._sources.has(source)) {
          this._sources.add(source);
        }
      }
      if (name != null) {
        name = String(name);
        if (!this._names.has(name)) {
          this._names.add(name);
        }
      }
      this._mappings.add({
        generatedLine: generated.line,
        generatedColumn: generated.column,
        originalLine: original != null && original.line,
        originalColumn: original != null && original.column,
        source,
        name
      });
    };
    SourceMapGenerator.prototype.setSourceContent = function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) {
      var source = aSourceFile;
      if (this._sourceRoot != null) {
        source = util2.relative(this._sourceRoot, source);
      }
      if (aSourceContent != null) {
        if (!this._sourcesContents) {
          this._sourcesContents = /* @__PURE__ */ Object.create(null);
        }
        this._sourcesContents[util2.toSetString(source)] = aSourceContent;
      } else if (this._sourcesContents) {
        delete this._sourcesContents[util2.toSetString(source)];
        if (Object.keys(this._sourcesContents).length === 0) {
          this._sourcesContents = null;
        }
      }
    };
    SourceMapGenerator.prototype.applySourceMap = function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) {
      var sourceFile = aSourceFile;
      if (aSourceFile == null) {
        if (aSourceMapConsumer.file == null) {
          throw new Error(
            `SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`
          );
        }
        sourceFile = aSourceMapConsumer.file;
      }
      var sourceRoot = this._sourceRoot;
      if (sourceRoot != null) {
        sourceFile = util2.relative(sourceRoot, sourceFile);
      }
      var newSources = new ArraySet();
      var newNames = new ArraySet();
      this._mappings.unsortedForEach(function(mapping) {
        if (mapping.source === sourceFile && mapping.originalLine != null) {
          var original = aSourceMapConsumer.originalPositionFor({
            line: mapping.originalLine,
            column: mapping.originalColumn
          });
          if (original.source != null) {
            mapping.source = original.source;
            if (aSourceMapPath != null) {
              mapping.source = util2.join(aSourceMapPath, mapping.source);
            }
            if (sourceRoot != null) {
              mapping.source = util2.relative(sourceRoot, mapping.source);
            }
            mapping.originalLine = original.line;
            mapping.originalColumn = original.column;
            if (original.name != null) {
              mapping.name = original.name;
            }
          }
        }
        var source = mapping.source;
        if (source != null && !newSources.has(source)) {
          newSources.add(source);
        }
        var name = mapping.name;
        if (name != null && !newNames.has(name)) {
          newNames.add(name);
        }
      }, this);
      this._sources = newSources;
      this._names = newNames;
      aSourceMapConsumer.sources.forEach(function(sourceFile2) {
        var content = aSourceMapConsumer.sourceContentFor(sourceFile2);
        if (content != null) {
          if (aSourceMapPath != null) {
            sourceFile2 = util2.join(aSourceMapPath, sourceFile2);
          }
          if (sourceRoot != null) {
            sourceFile2 = util2.relative(sourceRoot, sourceFile2);
          }
          this.setSourceContent(sourceFile2, content);
        }
      }, this);
    };
    SourceMapGenerator.prototype._validateMapping = function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource, aName) {
      if (aOriginal && typeof aOriginal.line !== "number" && typeof aOriginal.column !== "number") {
        throw new Error(
          "original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values."
        );
      }
      if (aGenerated && "line" in aGenerated && "column" in aGenerated && aGenerated.line > 0 && aGenerated.column >= 0 && !aOriginal && !aSource && !aName) {
        return;
      } else if (aGenerated && "line" in aGenerated && "column" in aGenerated && aOriginal && "line" in aOriginal && "column" in aOriginal && aGenerated.line > 0 && aGenerated.column >= 0 && aOriginal.line > 0 && aOriginal.column >= 0 && aSource) {
        return;
      } else {
        throw new Error("Invalid mapping: " + JSON.stringify({
          generated: aGenerated,
          source: aSource,
          original: aOriginal,
          name: aName
        }));
      }
    };
    SourceMapGenerator.prototype._serializeMappings = function SourceMapGenerator_serializeMappings() {
      var previousGeneratedColumn = 0;
      var previousGeneratedLine = 1;
      var previousOriginalColumn = 0;
      var previousOriginalLine = 0;
      var previousName = 0;
      var previousSource = 0;
      var result = "";
      var next;
      var mapping;
      var nameIdx;
      var sourceIdx;
      var mappings = this._mappings.toArray();
      for (var i = 0, len = mappings.length; i < len; i++) {
        mapping = mappings[i];
        next = "";
        if (mapping.generatedLine !== previousGeneratedLine) {
          previousGeneratedColumn = 0;
          while (mapping.generatedLine !== previousGeneratedLine) {
            next += ";";
            previousGeneratedLine++;
          }
        } else {
          if (i > 0) {
            if (!util2.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) {
              continue;
            }
            next += ",";
          }
        }
        next += base64VLQ.encode(mapping.generatedColumn - previousGeneratedColumn);
        previousGeneratedColumn = mapping.generatedColumn;
        if (mapping.source != null) {
          sourceIdx = this._sources.indexOf(mapping.source);
          next += base64VLQ.encode(sourceIdx - previousSource);
          previousSource = sourceIdx;
          next += base64VLQ.encode(mapping.originalLine - 1 - previousOriginalLine);
          previousOriginalLine = mapping.originalLine - 1;
          next += base64VLQ.encode(mapping.originalColumn - previousOriginalColumn);
          previousOriginalColumn = mapping.originalColumn;
          if (mapping.name != null) {
            nameIdx = this._names.indexOf(mapping.name);
            next += base64VLQ.encode(nameIdx - previousName);
            previousName = nameIdx;
          }
        }
        result += next;
      }
      return result;
    };
    SourceMapGenerator.prototype._generateSourcesContent = function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) {
      return aSources.map(function(source) {
        if (!this._sourcesContents) {
          return null;
        }
        if (aSourceRoot != null) {
          source = util2.relative(aSourceRoot, source);
        }
        var key = util2.toSetString(source);
        return Object.prototype.hasOwnProperty.call(this._sourcesContents, key) ? this._sourcesContents[key] : null;
      }, this);
    };
    SourceMapGenerator.prototype.toJSON = function SourceMapGenerator_toJSON() {
      var map2 = {
        version: this._version,
        sources: this._sources.toArray(),
        names: this._names.toArray(),
        mappings: this._serializeMappings()
      };
      if (this._file != null) {
        map2.file = this._file;
      }
      if (this._sourceRoot != null) {
        map2.sourceRoot = this._sourceRoot;
      }
      if (this._sourcesContents) {
        map2.sourcesContent = this._generateSourcesContent(map2.sources, map2.sourceRoot);
      }
      return map2;
    };
    SourceMapGenerator.prototype.toString = function SourceMapGenerator_toString() {
      return JSON.stringify(this.toJSON());
    };
    exports2.SourceMapGenerator = SourceMapGenerator;
  }
});

// node_modules/source-map/lib/binary-search.js
var require_binary_search = __commonJS({
  "node_modules/source-map/lib/binary-search.js"(exports2) {
    exports2.GREATEST_LOWER_BOUND = 1;
    exports2.LEAST_UPPER_BOUND = 2;
    function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) {
      var mid = Math.floor((aHigh - aLow) / 2) + aLow;
      var cmp = aCompare(aNeedle, aHaystack[mid], true);
      if (cmp === 0) {
        return mid;
      } else if (cmp > 0) {
        if (aHigh - mid > 1) {
          return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias);
        }
        if (aBias == exports2.LEAST_UPPER_BOUND) {
          return aHigh < aHaystack.length ? aHigh : -1;
        } else {
          return mid;
        }
      } else {
        if (mid - aLow > 1) {
          return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias);
        }
        if (aBias == exports2.LEAST_UPPER_BOUND) {
          return mid;
        } else {
          return aLow < 0 ? -1 : aLow;
        }
      }
    }
    exports2.search = function search(aNeedle, aHaystack, aCompare, aBias) {
      if (aHaystack.length === 0) {
        return -1;
      }
      var index = recursiveSearch(
        -1,
        aHaystack.length,
        aNeedle,
        aHaystack,
        aCompare,
        aBias || exports2.GREATEST_LOWER_BOUND
      );
      if (index < 0) {
        return -1;
      }
      while (index - 1 >= 0) {
        if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) {
          break;
        }
        --index;
      }
      return index;
    };
  }
});

// node_modules/source-map/lib/quick-sort.js
var require_quick_sort = __commonJS({
  "node_modules/source-map/lib/quick-sort.js"(exports2) {
    function swap(ary, x, y) {
      var temp = ary[x];
      ary[x] = ary[y];
      ary[y] = temp;
    }
    function randomIntInRange(low, high) {
      return Math.round(low + Math.random() * (high - low));
    }
    function doQuickSort(ary, comparator, p, r) {
      if (p < r) {
        var pivotIndex = randomIntInRange(p, r);
        var i = p - 1;
        swap(ary, pivotIndex, r);
        var pivot = ary[r];
        for (var j = p; j < r; j++) {
          if (comparator(ary[j], pivot) <= 0) {
            i += 1;
            swap(ary, i, j);
          }
        }
        swap(ary, i + 1, j);
        var q = i + 1;
        doQuickSort(ary, comparator, p, q - 1);
        doQuickSort(ary, comparator, q + 1, r);
      }
    }
    exports2.quickSort = function(ary, comparator) {
      doQuickSort(ary, comparator, 0, ary.length - 1);
    };
  }
});

// node_modules/source-map/lib/source-map-consumer.js
var require_source_map_consumer = __commonJS({
  "node_modules/source-map/lib/source-map-consumer.js"(exports2) {
    var util2 = require_util3();
    var binarySearch = require_binary_search();
    var ArraySet = require_array_set().ArraySet;
    var base64VLQ = require_base64_vlq();
    var quickSort = require_quick_sort().quickSort;
    function SourceMapConsumer(aSourceMap, aSourceMapURL) {
      var sourceMap = aSourceMap;
      if (typeof aSourceMap === "string") {
        sourceMap = util2.parseSourceMapInput(aSourceMap);
      }
      return sourceMap.sections != null ? new IndexedSourceMapConsumer(sourceMap, aSourceMapURL) : new BasicSourceMapConsumer(sourceMap, aSourceMapURL);
    }
    SourceMapConsumer.fromSourceMap = function(aSourceMap, aSourceMapURL) {
      return BasicSourceMapConsumer.fromSourceMap(aSourceMap, aSourceMapURL);
    };
    SourceMapConsumer.prototype._version = 3;
    SourceMapConsumer.prototype.__generatedMappings = null;
    Object.defineProperty(SourceMapConsumer.prototype, "_generatedMappings", {
      configurable: true,
      enumerable: true,
      get: function() {
        if (!this.__generatedMappings) {
          this._parseMappings(this._mappings, this.sourceRoot);
        }
        return this.__generatedMappings;
      }
    });
    SourceMapConsumer.prototype.__originalMappings = null;
    Object.defineProperty(SourceMapConsumer.prototype, "_originalMappings", {
      configurable: true,
      enumerable: true,
      get: function() {
        if (!this.__originalMappings) {
          this._parseMappings(this._mappings, this.sourceRoot);
        }
        return this.__originalMappings;
      }
    });
    SourceMapConsumer.prototype._charIsMappingSeparator = function SourceMapConsumer_charIsMappingSeparator(aStr, index) {
      var c = aStr.charAt(index);
      return c === ";" || c === ",";
    };
    SourceMapConsumer.prototype._parseMappings = function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {
      throw new Error("Subclasses must implement _parseMappings");
    };
    SourceMapConsumer.GENERATED_ORDER = 1;
    SourceMapConsumer.ORIGINAL_ORDER = 2;
    SourceMapConsumer.GREATEST_LOWER_BOUND = 1;
    SourceMapConsumer.LEAST_UPPER_BOUND = 2;
    SourceMapConsumer.prototype.eachMapping = function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) {
      var context = aContext || null;
      var order = aOrder || SourceMapConsumer.GENERATED_ORDER;
      var mappings;
      switch (order) {
        case SourceMapConsumer.GENERATED_ORDER:
          mappings = this._generatedMappings;
          break;
        case SourceMapConsumer.ORIGINAL_ORDER:
          mappings = this._originalMappings;
          break;
        default:
          throw new Error("Unknown order of iteration.");
      }
      var sourceRoot = this.sourceRoot;
      mappings.map(function(mapping) {
        var source = mapping.source === null ? null : this._sources.at(mapping.source);
        source = util2.computeSourceURL(sourceRoot, source, this._sourceMapURL);
        return {
          source,
          generatedLine: mapping.generatedLine,
          generatedColumn: mapping.generatedColumn,
          originalLine: mapping.originalLine,
          originalColumn: mapping.originalColumn,
          name: mapping.name === null ? null : this._names.at(mapping.name)
        };
      }, this).forEach(aCallback, context);
    };
    SourceMapConsumer.prototype.allGeneratedPositionsFor = function SourceMapConsumer_allGeneratedPositionsFor(aArgs) {
      var line = util2.getArg(aArgs, "line");
      var needle = {
        source: util2.getArg(aArgs, "source"),
        originalLine: line,
        originalColumn: util2.getArg(aArgs, "column", 0)
      };
      needle.source = this._findSourceIndex(needle.source);
      if (needle.source < 0) {
        return [];
      }
      var mappings = [];
      var index = this._findMapping(
        needle,
        this._originalMappings,
        "originalLine",
        "originalColumn",
        util2.compareByOriginalPositions,
        binarySearch.LEAST_UPPER_BOUND
      );
      if (index >= 0) {
        var mapping = this._originalMappings[index];
        if (aArgs.column === void 0) {
          var originalLine = mapping.originalLine;
          while (mapping && mapping.originalLine === originalLine) {
            mappings.push({
              line: util2.getArg(mapping, "generatedLine", null),
              column: util2.getArg(mapping, "generatedColumn", null),
              lastColumn: util2.getArg(mapping, "lastGeneratedColumn", null)
            });
            mapping = this._originalMappings[++index];
          }
        } else {
          var originalColumn = mapping.originalColumn;
          while (mapping && mapping.originalLine === line && mapping.originalColumn == originalColumn) {
            mappings.push({
              line: util2.getArg(mapping, "generatedLine", null),
              column: util2.getArg(mapping, "generatedColumn", null),
              lastColumn: util2.getArg(mapping, "lastGeneratedColumn", null)
            });
            mapping = this._originalMappings[++index];
          }
        }
      }
      return mappings;
    };
    exports2.SourceMapConsumer = SourceMapConsumer;
    function BasicSourceMapConsumer(aSourceMap, aSourceMapURL) {
      var sourceMap = aSourceMap;
      if (typeof aSourceMap === "string") {
        sourceMap = util2.parseSourceMapInput(aSourceMap);
      }
      var version2 = util2.getArg(sourceMap, "version");
      var sources = util2.getArg(sourceMap, "sources");
      var names = util2.getArg(sourceMap, "names", []);
      var sourceRoot = util2.getArg(sourceMap, "sourceRoot", null);
      var sourcesContent = util2.getArg(sourceMap, "sourcesContent", null);
      var mappings = util2.getArg(sourceMap, "mappings");
      var file2 = util2.getArg(sourceMap, "file", null);
      if (version2 != this._version) {
        throw new Error("Unsupported version: " + version2);
      }
      if (sourceRoot) {
        sourceRoot = util2.normalize(sourceRoot);
      }
      sources = sources.map(String).map(util2.normalize).map(function(source) {
        return sourceRoot && util2.isAbsolute(sourceRoot) && util2.isAbsolute(source) ? util2.relative(sourceRoot, source) : source;
      });
      this._names = ArraySet.fromArray(names.map(String), true);
      this._sources = ArraySet.fromArray(sources, true);
      this._absoluteSources = this._sources.toArray().map(function(s) {
        return util2.computeSourceURL(sourceRoot, s, aSourceMapURL);
      });
      this.sourceRoot = sourceRoot;
      this.sourcesContent = sourcesContent;
      this._mappings = mappings;
      this._sourceMapURL = aSourceMapURL;
      this.file = file2;
    }
    BasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);
    BasicSourceMapConsumer.prototype.consumer = SourceMapConsumer;
    BasicSourceMapConsumer.prototype._findSourceIndex = function(aSource) {
      var relativeSource = aSource;
      if (this.sourceRoot != null) {
        relativeSource = util2.relative(this.sourceRoot, relativeSource);
      }
      if (this._sources.has(relativeSource)) {
        return this._sources.indexOf(relativeSource);
      }
      var i;
      for (i = 0; i < this._absoluteSources.length; ++i) {
        if (this._absoluteSources[i] == aSource) {
          return i;
        }
      }
      return -1;
    };
    BasicSourceMapConsumer.fromSourceMap = function SourceMapConsumer_fromSourceMap(aSourceMap, aSourceMapURL) {
      var smc = Object.create(BasicSourceMapConsumer.prototype);
      var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true);
      var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true);
      smc.sourceRoot = aSourceMap._sourceRoot;
      smc.sourcesContent = aSourceMap._generateSourcesContent(
        smc._sources.toArray(),
        smc.sourceRoot
      );
      smc.file = aSourceMap._file;
      smc._sourceMapURL = aSourceMapURL;
      smc._absoluteSources = smc._sources.toArray().map(function(s) {
        return util2.computeSourceURL(smc.sourceRoot, s, aSourceMapURL);
      });
      var generatedMappings = aSourceMap._mappings.toArray().slice();
      var destGeneratedMappings = smc.__generatedMappings = [];
      var destOriginalMappings = smc.__originalMappings = [];
      for (var i = 0, length = generatedMappings.length; i < length; i++) {
        var srcMapping = generatedMappings[i];
        var destMapping = new Mapping();
        destMapping.generatedLine = srcMapping.generatedLine;
        destMapping.generatedColumn = srcMapping.generatedColumn;
        if (srcMapping.source) {
          destMapping.source = sources.indexOf(srcMapping.source);
          destMapping.originalLine = srcMapping.originalLine;
          destMapping.originalColumn = srcMapping.originalColumn;
          if (srcMapping.name) {
            destMapping.name = names.indexOf(srcMapping.name);
          }
          destOriginalMappings.push(destMapping);
        }
        destGeneratedMappings.push(destMapping);
      }
      quickSort(smc.__originalMappings, util2.compareByOriginalPositions);
      return smc;
    };
    BasicSourceMapConsumer.prototype._version = 3;
    Object.defineProperty(BasicSourceMapConsumer.prototype, "sources", {
      get: function() {
        return this._absoluteSources.slice();
      }
    });
    function Mapping() {
      this.generatedLine = 0;
      this.generatedColumn = 0;
      this.source = null;
      this.originalLine = null;
      this.originalColumn = null;
      this.name = null;
    }
    BasicSourceMapConsumer.prototype._parseMappings = function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {
      var generatedLine = 1;
      var previousGeneratedColumn = 0;
      var previousOriginalLine = 0;
      var previousOriginalColumn = 0;
      var previousSource = 0;
      var previousName = 0;
      var length = aStr.length;
      var index = 0;
      var cachedSegments = {};
      var temp = {};
      var originalMappings = [];
      var generatedMappings = [];
      var mapping, str, segment2, end, value;
      while (index < length) {
        if (aStr.charAt(index) === ";") {
          generatedLine++;
          index++;
          previousGeneratedColumn = 0;
        } else if (aStr.charAt(index) === ",") {
          index++;
        } else {
          mapping = new Mapping();
          mapping.generatedLine = generatedLine;
          for (end = index; end < length; end++) {
            if (this._charIsMappingSeparator(aStr, end)) {
              break;
            }
          }
          str = aStr.slice(index, end);
          segment2 = cachedSegments[str];
          if (segment2) {
            index += str.length;
          } else {
            segment2 = [];
            while (index < end) {
              base64VLQ.decode(aStr, index, temp);
              value = temp.value;
              index = temp.rest;
              segment2.push(value);
            }
            if (segment2.length === 2) {
              throw new Error("Found a source, but no line and column");
            }
            if (segment2.length === 3) {
              throw new Error("Found a source and line, but no column");
            }
            cachedSegments[str] = segment2;
          }
          mapping.generatedColumn = previousGeneratedColumn + segment2[0];
          previousGeneratedColumn = mapping.generatedColumn;
          if (segment2.length > 1) {
            mapping.source = previousSource + segment2[1];
            previousSource += segment2[1];
            mapping.originalLine = previousOriginalLine + segment2[2];
            previousOriginalLine = mapping.originalLine;
            mapping.originalLine += 1;
            mapping.originalColumn = previousOriginalColumn + segment2[3];
            previousOriginalColumn = mapping.originalColumn;
            if (segment2.length > 4) {
              mapping.name = previousName + segment2[4];
              previousName += segment2[4];
            }
          }
          generatedMappings.push(mapping);
          if (typeof mapping.originalLine === "number") {
            originalMappings.push(mapping);
          }
        }
      }
      quickSort(generatedMappings, util2.compareByGeneratedPositionsDeflated);
      this.__generatedMappings = generatedMappings;
      quickSort(originalMappings, util2.compareByOriginalPositions);
      this.__originalMappings = originalMappings;
    };
    BasicSourceMapConsumer.prototype._findMapping = function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName, aColumnName, aComparator, aBias) {
      if (aNeedle[aLineName] <= 0) {
        throw new TypeError("Line must be greater than or equal to 1, got " + aNeedle[aLineName]);
      }
      if (aNeedle[aColumnName] < 0) {
        throw new TypeError("Column must be greater than or equal to 0, got " + aNeedle[aColumnName]);
      }
      return binarySearch.search(aNeedle, aMappings, aComparator, aBias);
    };
    BasicSourceMapConsumer.prototype.computeColumnSpans = function SourceMapConsumer_computeColumnSpans() {
      for (var index = 0; index < this._generatedMappings.length; ++index) {
        var mapping = this._generatedMappings[index];
        if (index + 1 < this._generatedMappings.length) {
          var nextMapping = this._generatedMappings[index + 1];
          if (mapping.generatedLine === nextMapping.generatedLine) {
            mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1;
            continue;
          }
        }
        mapping.lastGeneratedColumn = Infinity;
      }
    };
    BasicSourceMapConsumer.prototype.originalPositionFor = function SourceMapConsumer_originalPositionFor(aArgs) {
      var needle = {
        generatedLine: util2.getArg(aArgs, "line"),
        generatedColumn: util2.getArg(aArgs, "column")
      };
      var index = this._findMapping(
        needle,
        this._generatedMappings,
        "generatedLine",
        "generatedColumn",
        util2.compareByGeneratedPositionsDeflated,
        util2.getArg(aArgs, "bias", SourceMapConsumer.GREATEST_LOWER_BOUND)
      );
      if (index >= 0) {
        var mapping = this._generatedMappings[index];
        if (mapping.generatedLine === needle.generatedLine) {
          var source = util2.getArg(mapping, "source", null);
          if (source !== null) {
            source = this._sources.at(source);
            source = util2.computeSourceURL(this.sourceRoot, source, this._sourceMapURL);
          }
          var name = util2.getArg(mapping, "name", null);
          if (name !== null) {
            name = this._names.at(name);
          }
          return {
            source,
            line: util2.getArg(mapping, "originalLine", null),
            column: util2.getArg(mapping, "originalColumn", null),
            name
          };
        }
      }
      return {
        source: null,
        line: null,
        column: null,
        name: null
      };
    };
    BasicSourceMapConsumer.prototype.hasContentsOfAllSources = function BasicSourceMapConsumer_hasContentsOfAllSources() {
      if (!this.sourcesContent) {
        return false;
      }
      return this.sourcesContent.length >= this._sources.size() && !this.sourcesContent.some(function(sc) {
        return sc == null;
      });
    };
    BasicSourceMapConsumer.prototype.sourceContentFor = function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {
      if (!this.sourcesContent) {
        return null;
      }
      var index = this._findSourceIndex(aSource);
      if (index >= 0) {
        return this.sourcesContent[index];
      }
      var relativeSource = aSource;
      if (this.sourceRoot != null) {
        relativeSource = util2.relative(this.sourceRoot, relativeSource);
      }
      var url2;
      if (this.sourceRoot != null && (url2 = util2.urlParse(this.sourceRoot))) {
        var fileUriAbsPath = relativeSource.replace(/^file:\/\//, "");
        if (url2.scheme == "file" && this._sources.has(fileUriAbsPath)) {
          return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)];
        }
        if ((!url2.path || url2.path == "/") && this._sources.has("/" + relativeSource)) {
          return this.sourcesContent[this._sources.indexOf("/" + relativeSource)];
        }
      }
      if (nullOnMissing) {
        return null;
      } else {
        throw new Error('"' + relativeSource + '" is not in the SourceMap.');
      }
    };
    BasicSourceMapConsumer.prototype.generatedPositionFor = function SourceMapConsumer_generatedPositionFor(aArgs) {
      var source = util2.getArg(aArgs, "source");
      source = this._findSourceIndex(source);
      if (source < 0) {
        return {
          line: null,
          column: null,
          lastColumn: null
        };
      }
      var needle = {
        source,
        originalLine: util2.getArg(aArgs, "line"),
        originalColumn: util2.getArg(aArgs, "column")
      };
      var index = this._findMapping(
        needle,
        this._originalMappings,
        "originalLine",
        "originalColumn",
        util2.compareByOriginalPositions,
        util2.getArg(aArgs, "bias", SourceMapConsumer.GREATEST_LOWER_BOUND)
      );
      if (index >= 0) {
        var mapping = this._originalMappings[index];
        if (mapping.source === needle.source) {
          return {
            line: util2.getArg(mapping, "generatedLine", null),
            column: util2.getArg(mapping, "generatedColumn", null),
            lastColumn: util2.getArg(mapping, "lastGeneratedColumn", null)
          };
        }
      }
      return {
        line: null,
        column: null,
        lastColumn: null
      };
    };
    exports2.BasicSourceMapConsumer = BasicSourceMapConsumer;
    function IndexedSourceMapConsumer(aSourceMap, aSourceMapURL) {
      var sourceMap = aSourceMap;
      if (typeof aSourceMap === "string") {
        sourceMap = util2.parseSourceMapInput(aSourceMap);
      }
      var version2 = util2.getArg(sourceMap, "version");
      var sections = util2.getArg(sourceMap, "sections");
      if (version2 != this._version) {
        throw new Error("Unsupported version: " + version2);
      }
      this._sources = new ArraySet();
      this._names = new ArraySet();
      var lastOffset = {
        line: -1,
        column: 0
      };
      this._sections = sections.map(function(s) {
        if (s.url) {
          throw new Error("Support for url field in sections not implemented.");
        }
        var offset = util2.getArg(s, "offset");
        var offsetLine = util2.getArg(offset, "line");
        var offsetColumn = util2.getArg(offset, "column");
        if (offsetLine < lastOffset.line || offsetLine === lastOffset.line && offsetColumn < lastOffset.column) {
          throw new Error("Section offsets must be ordered and non-overlapping.");
        }
        lastOffset = offset;
        return {
          generatedOffset: {
            // The offset fields are 0-based, but we use 1-based indices when
            // encoding/decoding from VLQ.
            generatedLine: offsetLine + 1,
            generatedColumn: offsetColumn + 1
          },
          consumer: new SourceMapConsumer(util2.getArg(s, "map"), aSourceMapURL)
        };
      });
    }
    IndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);
    IndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer;
    IndexedSourceMapConsumer.prototype._version = 3;
    Object.defineProperty(IndexedSourceMapConsumer.prototype, "sources", {
      get: function() {
        var sources = [];
        for (var i = 0; i < this._sections.length; i++) {
          for (var j = 0; j < this._sections[i].consumer.sources.length; j++) {
            sources.push(this._sections[i].consumer.sources[j]);
          }
        }
        return sources;
      }
    });
    IndexedSourceMapConsumer.prototype.originalPositionFor = function IndexedSourceMapConsumer_originalPositionFor(aArgs) {
      var needle = {
        generatedLine: util2.getArg(aArgs, "line"),
        generatedColumn: util2.getArg(aArgs, "column")
      };
      var sectionIndex = binarySearch.search(
        needle,
        this._sections,
        function(needle2, section2) {
          var cmp = needle2.generatedLine - section2.generatedOffset.generatedLine;
          if (cmp) {
            return cmp;
          }
          return needle2.generatedColumn - section2.generatedOffset.generatedColumn;
        }
      );
      var section = this._sections[sectionIndex];
      if (!section) {
        return {
          source: null,
          line: null,
          column: null,
          name: null
        };
      }
      return section.consumer.originalPositionFor({
        line: needle.generatedLine - (section.generatedOffset.generatedLine - 1),
        column: needle.generatedColumn - (section.generatedOffset.generatedLine === needle.generatedLine ? section.generatedOffset.generatedColumn - 1 : 0),
        bias: aArgs.bias
      });
    };
    IndexedSourceMapConsumer.prototype.hasContentsOfAllSources = function IndexedSourceMapConsumer_hasContentsOfAllSources() {
      return this._sections.every(function(s) {
        return s.consumer.hasContentsOfAllSources();
      });
    };
    IndexedSourceMapConsumer.prototype.sourceContentFor = function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {
      for (var i = 0; i < this._sections.length; i++) {
        var section = this._sections[i];
        var content = section.consumer.sourceContentFor(aSource, true);
        if (content) {
          return content;
        }
      }
      if (nullOnMissing) {
        return null;
      } else {
        throw new Error('"' + aSource + '" is not in the SourceMap.');
      }
    };
    IndexedSourceMapConsumer.prototype.generatedPositionFor = function IndexedSourceMapConsumer_generatedPositionFor(aArgs) {
      for (var i = 0; i < this._sections.length; i++) {
        var section = this._sections[i];
        if (section.consumer._findSourceIndex(util2.getArg(aArgs, "source")) === -1) {
          continue;
        }
        var generatedPosition = section.consumer.generatedPositionFor(aArgs);
        if (generatedPosition) {
          var ret = {
            line: generatedPosition.line + (section.generatedOffset.generatedLine - 1),
            column: generatedPosition.column + (section.generatedOffset.generatedLine === generatedPosition.line ? section.generatedOffset.generatedColumn - 1 : 0)
          };
          return ret;
        }
      }
      return {
        line: null,
        column: null
      };
    };
    IndexedSourceMapConsumer.prototype._parseMappings = function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) {
      this.__generatedMappings = [];
      this.__originalMappings = [];
      for (var i = 0; i < this._sections.length; i++) {
        var section = this._sections[i];
        var sectionMappings = section.consumer._generatedMappings;
        for (var j = 0; j < sectionMappings.length; j++) {
          var mapping = sectionMappings[j];
          var source = section.consumer._sources.at(mapping.source);
          source = util2.computeSourceURL(section.consumer.sourceRoot, source, this._sourceMapURL);
          this._sources.add(source);
          source = this._sources.indexOf(source);
          var name = null;
          if (mapping.name) {
            name = section.consumer._names.at(mapping.name);
            this._names.add(name);
            name = this._names.indexOf(name);
          }
          var adjustedMapping = {
            source,
            generatedLine: mapping.generatedLine + (section.generatedOffset.generatedLine - 1),
            generatedColumn: mapping.generatedColumn + (section.generatedOffset.generatedLine === mapping.generatedLine ? section.generatedOffset.generatedColumn - 1 : 0),
            originalLine: mapping.originalLine,
            originalColumn: mapping.originalColumn,
            name
          };
          this.__generatedMappings.push(adjustedMapping);
          if (typeof adjustedMapping.originalLine === "number") {
            this.__originalMappings.push(adjustedMapping);
          }
        }
      }
      quickSort(this.__generatedMappings, util2.compareByGeneratedPositionsDeflated);
      quickSort(this.__originalMappings, util2.compareByOriginalPositions);
    };
    exports2.IndexedSourceMapConsumer = IndexedSourceMapConsumer;
  }
});

// node_modules/source-map/lib/source-node.js
var require_source_node = __commonJS({
  "node_modules/source-map/lib/source-node.js"(exports2) {
    var SourceMapGenerator = require_source_map_generator().SourceMapGenerator;
    var util2 = require_util3();
    var REGEX_NEWLINE = /(\r?\n)/;
    var NEWLINE_CODE = 10;
    var isSourceNode = "$$$isSourceNode$$$";
    function SourceNode(aLine, aColumn, aSource, aChunks, aName) {
      this.children = [];
      this.sourceContents = {};
      this.line = aLine == null ? null : aLine;
      this.column = aColumn == null ? null : aColumn;
      this.source = aSource == null ? null : aSource;
      this.name = aName == null ? null : aName;
      this[isSourceNode] = true;
      if (aChunks != null) this.add(aChunks);
    }
    SourceNode.fromStringWithSourceMap = function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) {
      var node = new SourceNode();
      var remainingLines = aGeneratedCode.split(REGEX_NEWLINE);
      var remainingLinesIndex = 0;
      var shiftNextLine = function() {
        var lineContents = getNextLine();
        var newLine = getNextLine() || "";
        return lineContents + newLine;
        function getNextLine() {
          return remainingLinesIndex < remainingLines.length ? remainingLines[remainingLinesIndex++] : void 0;
        }
      };
      var lastGeneratedLine = 1, lastGeneratedColumn = 0;
      var lastMapping = null;
      aSourceMapConsumer.eachMapping(function(mapping) {
        if (lastMapping !== null) {
          if (lastGeneratedLine < mapping.generatedLine) {
            addMappingWithCode(lastMapping, shiftNextLine());
            lastGeneratedLine++;
            lastGeneratedColumn = 0;
          } else {
            var nextLine = remainingLines[remainingLinesIndex] || "";
            var code = nextLine.substr(0, mapping.generatedColumn - lastGeneratedColumn);
            remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn - lastGeneratedColumn);
            lastGeneratedColumn = mapping.generatedColumn;
            addMappingWithCode(lastMapping, code);
            lastMapping = mapping;
            return;
          }
        }
        while (lastGeneratedLine < mapping.generatedLine) {
          node.add(shiftNextLine());
          lastGeneratedLine++;
        }
        if (lastGeneratedColumn < mapping.generatedColumn) {
          var nextLine = remainingLines[remainingLinesIndex] || "";
          node.add(nextLine.substr(0, mapping.generatedColumn));
          remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn);
          lastGeneratedColumn = mapping.generatedColumn;
        }
        lastMapping = mapping;
      }, this);
      if (remainingLinesIndex < remainingLines.length) {
        if (lastMapping) {
          addMappingWithCode(lastMapping, shiftNextLine());
        }
        node.add(remainingLines.splice(remainingLinesIndex).join(""));
      }
      aSourceMapConsumer.sources.forEach(function(sourceFile) {
        var content = aSourceMapConsumer.sourceContentFor(sourceFile);
        if (content != null) {
          if (aRelativePath != null) {
            sourceFile = util2.join(aRelativePath, sourceFile);
          }
          node.setSourceContent(sourceFile, content);
        }
      });
      return node;
      function addMappingWithCode(mapping, code) {
        if (mapping === null || mapping.source === void 0) {
          node.add(code);
        } else {
          var source = aRelativePath ? util2.join(aRelativePath, mapping.source) : mapping.source;
          node.add(new SourceNode(
            mapping.originalLine,
            mapping.originalColumn,
            source,
            code,
            mapping.name
          ));
        }
      }
    };
    SourceNode.prototype.add = function SourceNode_add(aChunk) {
      if (Array.isArray(aChunk)) {
        aChunk.forEach(function(chunk) {
          this.add(chunk);
        }, this);
      } else if (aChunk[isSourceNode] || typeof aChunk === "string") {
        if (aChunk) {
          this.children.push(aChunk);
        }
      } else {
        throw new TypeError(
          "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk
        );
      }
      return this;
    };
    SourceNode.prototype.prepend = function SourceNode_prepend(aChunk) {
      if (Array.isArray(aChunk)) {
        for (var i = aChunk.length - 1; i >= 0; i--) {
          this.prepend(aChunk[i]);
        }
      } else if (aChunk[isSourceNode] || typeof aChunk === "string") {
        this.children.unshift(aChunk);
      } else {
        throw new TypeError(
          "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk
        );
      }
      return this;
    };
    SourceNode.prototype.walk = function SourceNode_walk(aFn) {
      var chunk;
      for (var i = 0, len = this.children.length; i < len; i++) {
        chunk = this.children[i];
        if (chunk[isSourceNode]) {
          chunk.walk(aFn);
        } else {
          if (chunk !== "") {
            aFn(chunk, {
              source: this.source,
              line: this.line,
              column: this.column,
              name: this.name
            });
          }
        }
      }
    };
    SourceNode.prototype.join = function SourceNode_join(aSep) {
      var newChildren;
      var i;
      var len = this.children.length;
      if (len > 0) {
        newChildren = [];
        for (i = 0; i < len - 1; i++) {
          newChildren.push(this.children[i]);
          newChildren.push(aSep);
        }
        newChildren.push(this.children[i]);
        this.children = newChildren;
      }
      return this;
    };
    SourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) {
      var lastChild = this.children[this.children.length - 1];
      if (lastChild[isSourceNode]) {
        lastChild.replaceRight(aPattern, aReplacement);
      } else if (typeof lastChild === "string") {
        this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement);
      } else {
        this.children.push("".replace(aPattern, aReplacement));
      }
      return this;
    };
    SourceNode.prototype.setSourceContent = function SourceNode_setSourceContent(aSourceFile, aSourceContent) {
      this.sourceContents[util2.toSetString(aSourceFile)] = aSourceContent;
    };
    SourceNode.prototype.walkSourceContents = function SourceNode_walkSourceContents(aFn) {
      for (var i = 0, len = this.children.length; i < len; i++) {
        if (this.children[i][isSourceNode]) {
          this.children[i].walkSourceContents(aFn);
        }
      }
      var sources = Object.keys(this.sourceContents);
      for (var i = 0, len = sources.length; i < len; i++) {
        aFn(util2.fromSetString(sources[i]), this.sourceContents[sources[i]]);
      }
    };
    SourceNode.prototype.toString = function SourceNode_toString() {
      var str = "";
      this.walk(function(chunk) {
        str += chunk;
      });
      return str;
    };
    SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) {
      var generated = {
        code: "",
        line: 1,
        column: 0
      };
      var map2 = new SourceMapGenerator(aArgs);
      var sourceMappingActive = false;
      var lastOriginalSource = null;
      var lastOriginalLine = null;
      var lastOriginalColumn = null;
      var lastOriginalName = null;
      this.walk(function(chunk, original) {
        generated.code += chunk;
        if (original.source !== null && original.line !== null && original.column !== null) {
          if (lastOriginalSource !== original.source || lastOriginalLine !== original.line || lastOriginalColumn !== original.column || lastOriginalName !== original.name) {
            map2.addMapping({
              source: original.source,
              original: {
                line: original.line,
                column: original.column
              },
              generated: {
                line: generated.line,
                column: generated.column
              },
              name: original.name
            });
          }
          lastOriginalSource = original.source;
          lastOriginalLine = original.line;
          lastOriginalColumn = original.column;
          lastOriginalName = original.name;
          sourceMappingActive = true;
        } else if (sourceMappingActive) {
          map2.addMapping({
            generated: {
              line: generated.line,
              column: generated.column
            }
          });
          lastOriginalSource = null;
          sourceMappingActive = false;
        }
        for (var idx = 0, length = chunk.length; idx < length; idx++) {
          if (chunk.charCodeAt(idx) === NEWLINE_CODE) {
            generated.line++;
            generated.column = 0;
            if (idx + 1 === length) {
              lastOriginalSource = null;
              sourceMappingActive = false;
            } else if (sourceMappingActive) {
              map2.addMapping({
                source: original.source,
                original: {
                  line: original.line,
                  column: original.column
                },
                generated: {
                  line: generated.line,
                  column: generated.column
                },
                name: original.name
              });
            }
          } else {
            generated.column++;
          }
        }
      });
      this.walkSourceContents(function(sourceFile, sourceContent) {
        map2.setSourceContent(sourceFile, sourceContent);
      });
      return { code: generated.code, map: map2 };
    };
    exports2.SourceNode = SourceNode;
  }
});

// node_modules/source-map/source-map.js
var require_source_map = __commonJS({
  "node_modules/source-map/source-map.js"(exports2) {
    exports2.SourceMapGenerator = require_source_map_generator().SourceMapGenerator;
    exports2.SourceMapConsumer = require_source_map_consumer().SourceMapConsumer;
    exports2.SourceNode = require_source_node().SourceNode;
  }
});

// node_modules/buffer-from/index.js
var require_buffer_from = __commonJS({
  "node_modules/buffer-from/index.js"(exports2, module2) {
    var toString = Object.prototype.toString;
    var isModern = typeof Buffer !== "undefined" && typeof Buffer.alloc === "function" && typeof Buffer.allocUnsafe === "function" && typeof Buffer.from === "function";
    function isArrayBuffer(input) {
      return toString.call(input).slice(8, -1) === "ArrayBuffer";
    }
    function fromArrayBuffer(obj, byteOffset, length) {
      byteOffset >>>= 0;
      var maxLength = obj.byteLength - byteOffset;
      if (maxLength < 0) {
        throw new RangeError("'offset' is out of bounds");
      }
      if (length === void 0) {
        length = maxLength;
      } else {
        length >>>= 0;
        if (length > maxLength) {
          throw new RangeError("'length' is out of bounds");
        }
      }
      return isModern ? Buffer.from(obj.slice(byteOffset, byteOffset + length)) : new Buffer(new Uint8Array(obj.slice(byteOffset, byteOffset + length)));
    }
    function fromString(string4, encoding) {
      if (typeof encoding !== "string" || encoding === "") {
        encoding = "utf8";
      }
      if (!Buffer.isEncoding(encoding)) {
        throw new TypeError('"encoding" must be a valid string encoding');
      }
      return isModern ? Buffer.from(string4, encoding) : new Buffer(string4, encoding);
    }
    function bufferFrom(value, encodingOrOffset, length) {
      if (typeof value === "number") {
        throw new TypeError('"value" argument must not be a number');
      }
      if (isArrayBuffer(value)) {
        return fromArrayBuffer(value, encodingOrOffset, length);
      }
      if (typeof value === "string") {
        return fromString(value, encodingOrOffset);
      }
      return isModern ? Buffer.from(value) : new Buffer(value);
    }
    module2.exports = bufferFrom;
  }
});

// node_modules/source-map-support/source-map-support.js
var require_source_map_support = __commonJS({
  "node_modules/source-map-support/source-map-support.js"(exports2, module2) {
    var SourceMapConsumer = require_source_map().SourceMapConsumer;
    var path = require("path");
    var fs;
    try {
      fs = require("fs");
      if (!fs.existsSync || !fs.readFileSync) {
        fs = null;
      }
    } catch (err) {
    }
    var bufferFrom = require_buffer_from();
    function dynamicRequire(mod, request) {
      return mod.require(request);
    }
    var errorFormatterInstalled = false;
    var uncaughtShimInstalled = false;
    var emptyCacheBetweenOperations = false;
    var environment = "auto";
    var fileContentsCache = {};
    var sourceMapCache = {};
    var reSourceMap = /^data:application\/json[^,]+base64,/;
    var retrieveFileHandlers = [];
    var retrieveMapHandlers = [];
    function isInBrowser() {
      if (environment === "browser")
        return true;
      if (environment === "node")
        return false;
      return typeof window !== "undefined" && typeof XMLHttpRequest === "function" && !(window.require && window.module && window.process && window.process.type === "renderer");
    }
    function hasGlobalProcessEventEmitter() {
      return typeof process === "object" && process !== null && typeof process.on === "function";
    }
    function globalProcessVersion() {
      if (typeof process === "object" && process !== null) {
        return process.version;
      } else {
        return "";
      }
    }
    function globalProcessStderr() {
      if (typeof process === "object" && process !== null) {
        return process.stderr;
      }
    }
    function globalProcessExit(code) {
      if (typeof process === "object" && process !== null && typeof process.exit === "function") {
        return process.exit(code);
      }
    }
    function handlerExec(list) {
      return function(arg) {
        for (var i = 0; i < list.length; i++) {
          var ret = list[i](arg);
          if (ret) {
            return ret;
          }
        }
        return null;
      };
    }
    var retrieveFile = handlerExec(retrieveFileHandlers);
    retrieveFileHandlers.push(function(path2) {
      path2 = path2.trim();
      if (/^file:/.test(path2)) {
        path2 = path2.replace(/file:\/\/\/(\w:)?/, function(protocol, drive) {
          return drive ? "" : (
            // file:///C:/dir/file -> C:/dir/file
            "/"
          );
        });
      }
      if (path2 in fileContentsCache) {
        return fileContentsCache[path2];
      }
      var contents = "";
      try {
        if (!fs) {
          var xhr = new XMLHttpRequest();
          xhr.open(
            "GET",
            path2,
            /** async */
            false
          );
          xhr.send(null);
          if (xhr.readyState === 4 && xhr.status === 200) {
            contents = xhr.responseText;
          }
        } else if (fs.existsSync(path2)) {
          contents = fs.readFileSync(path2, "utf8");
        }
      } catch (er) {
      }
      return fileContentsCache[path2] = contents;
    });
    function supportRelativeURL(file2, url2) {
      if (!file2) return url2;
      var dir = path.dirname(file2);
      var match = /^\w+:\/\/[^\/]*/.exec(dir);
      var protocol = match ? match[0] : "";
      var startPath = dir.slice(protocol.length);
      if (protocol && /^\/\w\:/.test(startPath)) {
        protocol += "/";
        return protocol + path.resolve(dir.slice(protocol.length), url2).replace(/\\/g, "/");
      }
      return protocol + path.resolve(dir.slice(protocol.length), url2);
    }
    function retrieveSourceMapURL(source) {
      var fileData;
      if (isInBrowser()) {
        try {
          var xhr = new XMLHttpRequest();
          xhr.open("GET", source, false);
          xhr.send(null);
          fileData = xhr.readyState === 4 ? xhr.responseText : null;
          var sourceMapHeader = xhr.getResponseHeader("SourceMap") || xhr.getResponseHeader("X-SourceMap");
          if (sourceMapHeader) {
            return sourceMapHeader;
          }
        } catch (e) {
        }
      }
      fileData = retrieveFile(source);
      var re = /(?:\/\/[@#][\s]*sourceMappingURL=([^\s'"]+)[\s]*$)|(?:\/\*[@#][\s]*sourceMappingURL=([^\s*'"]+)[\s]*(?:\*\/)[\s]*$)/mg;
      var lastMatch, match;
      while (match = re.exec(fileData)) lastMatch = match;
      if (!lastMatch) return null;
      return lastMatch[1];
    }
    var retrieveSourceMap = handlerExec(retrieveMapHandlers);
    retrieveMapHandlers.push(function(source) {
      var sourceMappingURL = retrieveSourceMapURL(source);
      if (!sourceMappingURL) return null;
      var sourceMapData;
      if (reSourceMap.test(sourceMappingURL)) {
        var rawData = sourceMappingURL.slice(sourceMappingURL.indexOf(",") + 1);
        sourceMapData = bufferFrom(rawData, "base64").toString();
        sourceMappingURL = source;
      } else {
        sourceMappingURL = supportRelativeURL(source, sourceMappingURL);
        sourceMapData = retrieveFile(sourceMappingURL);
      }
      if (!sourceMapData) {
        return null;
      }
      return {
        url: sourceMappingURL,
        map: sourceMapData
      };
    });
    function mapSourcePosition(position) {
      var sourceMap = sourceMapCache[position.source];
      if (!sourceMap) {
        var urlAndMap = retrieveSourceMap(position.source);
        if (urlAndMap) {
          sourceMap = sourceMapCache[position.source] = {
            url: urlAndMap.url,
            map: new SourceMapConsumer(urlAndMap.map)
          };
          if (sourceMap.map.sourcesContent) {
            sourceMap.map.sources.forEach(function(source, i) {
              var contents = sourceMap.map.sourcesContent[i];
              if (contents) {
                var url2 = supportRelativeURL(sourceMap.url, source);
                fileContentsCache[url2] = contents;
              }
            });
          }
        } else {
          sourceMap = sourceMapCache[position.source] = {
            url: null,
            map: null
          };
        }
      }
      if (sourceMap && sourceMap.map && typeof sourceMap.map.originalPositionFor === "function") {
        var originalPosition = sourceMap.map.originalPositionFor(position);
        if (originalPosition.source !== null) {
          originalPosition.source = supportRelativeURL(
            sourceMap.url,
            originalPosition.source
          );
          return originalPosition;
        }
      }
      return position;
    }
    function mapEvalOrigin(origin) {
      var match = /^eval at ([^(]+) \((.+):(\d+):(\d+)\)$/.exec(origin);
      if (match) {
        var position = mapSourcePosition({
          source: match[2],
          line: +match[3],
          column: match[4] - 1
        });
        return "eval at " + match[1] + " (" + position.source + ":" + position.line + ":" + (position.column + 1) + ")";
      }
      match = /^eval at ([^(]+) \((.+)\)$/.exec(origin);
      if (match) {
        return "eval at " + match[1] + " (" + mapEvalOrigin(match[2]) + ")";
      }
      return origin;
    }
    function CallSiteToString() {
      var fileName;
      var fileLocation = "";
      if (this.isNative()) {
        fileLocation = "native";
      } else {
        fileName = this.getScriptNameOrSourceURL();
        if (!fileName && this.isEval()) {
          fileLocation = this.getEvalOrigin();
          fileLocation += ", ";
        }
        if (fileName) {
          fileLocation += fileName;
        } else {
          fileLocation += "<anonymous>";
        }
        var lineNumber = this.getLineNumber();
        if (lineNumber != null) {
          fileLocation += ":" + lineNumber;
          var columnNumber = this.getColumnNumber();
          if (columnNumber) {
            fileLocation += ":" + columnNumber;
          }
        }
      }
      var line = "";
      var functionName = this.getFunctionName();
      var addSuffix = true;
      var isConstructor = this.isConstructor();
      var isMethodCall = !(this.isToplevel() || isConstructor);
      if (isMethodCall) {
        var typeName = this.getTypeName();
        if (typeName === "[object Object]") {
          typeName = "null";
        }
        var methodName = this.getMethodName();
        if (functionName) {
          if (typeName && functionName.indexOf(typeName) != 0) {
            line += typeName + ".";
          }
          line += functionName;
          if (methodName && functionName.indexOf("." + methodName) != functionName.length - methodName.length - 1) {
            line += " [as " + methodName + "]";
          }
        } else {
          line += typeName + "." + (methodName || "<anonymous>");
        }
      } else if (isConstructor) {
        line += "new " + (functionName || "<anonymous>");
      } else if (functionName) {
        line += functionName;
      } else {
        line += fileLocation;
        addSuffix = false;
      }
      if (addSuffix) {
        line += " (" + fileLocation + ")";
      }
      return line;
    }
    function cloneCallSite(frame) {
      var object3 = {};
      Object.getOwnPropertyNames(Object.getPrototypeOf(frame)).forEach(function(name) {
        object3[name] = /^(?:is|get)/.test(name) ? function() {
          return frame[name].call(frame);
        } : frame[name];
      });
      object3.toString = CallSiteToString;
      return object3;
    }
    function wrapCallSite(frame, state) {
      if (state === void 0) {
        state = { nextPosition: null, curPosition: null };
      }
      if (frame.isNative()) {
        state.curPosition = null;
        return frame;
      }
      var source = frame.getFileName() || frame.getScriptNameOrSourceURL();
      if (source) {
        var line = frame.getLineNumber();
        var column = frame.getColumnNumber() - 1;
        var noHeader = /^v(10\.1[6-9]|10\.[2-9][0-9]|10\.[0-9]{3,}|1[2-9]\d*|[2-9]\d|\d{3,}|11\.11)/;
        var headerLength = noHeader.test(globalProcessVersion()) ? 0 : 62;
        if (line === 1 && column > headerLength && !isInBrowser() && !frame.isEval()) {
          column -= headerLength;
        }
        var position = mapSourcePosition({
          source,
          line,
          column
        });
        state.curPosition = position;
        frame = cloneCallSite(frame);
        var originalFunctionName = frame.getFunctionName;
        frame.getFunctionName = function() {
          if (state.nextPosition == null) {
            return originalFunctionName();
          }
          return state.nextPosition.name || originalFunctionName();
        };
        frame.getFileName = function() {
          return position.source;
        };
        frame.getLineNumber = function() {
          return position.line;
        };
        frame.getColumnNumber = function() {
          return position.column + 1;
        };
        frame.getScriptNameOrSourceURL = function() {
          return position.source;
        };
        return frame;
      }
      var origin = frame.isEval() && frame.getEvalOrigin();
      if (origin) {
        origin = mapEvalOrigin(origin);
        frame = cloneCallSite(frame);
        frame.getEvalOrigin = function() {
          return origin;
        };
        return frame;
      }
      return frame;
    }
    function prepareStackTrace(error48, stack) {
      if (emptyCacheBetweenOperations) {
        fileContentsCache = {};
        sourceMapCache = {};
      }
      var name = error48.name || "Error";
      var message = error48.message || "";
      var errorString = name + ": " + message;
      var state = { nextPosition: null, curPosition: null };
      var processedStack = [];
      for (var i = stack.length - 1; i >= 0; i--) {
        processedStack.push("\n    at " + wrapCallSite(stack[i], state));
        state.nextPosition = state.curPosition;
      }
      state.curPosition = state.nextPosition = null;
      return errorString + processedStack.reverse().join("");
    }
    function getErrorSource(error48) {
      var match = /\n    at [^(]+ \((.*):(\d+):(\d+)\)/.exec(error48.stack);
      if (match) {
        var source = match[1];
        var line = +match[2];
        var column = +match[3];
        var contents = fileContentsCache[source];
        if (!contents && fs && fs.existsSync(source)) {
          try {
            contents = fs.readFileSync(source, "utf8");
          } catch (er) {
            contents = "";
          }
        }
        if (contents) {
          var code = contents.split(/(?:\r\n|\r|\n)/)[line - 1];
          if (code) {
            return source + ":" + line + "\n" + code + "\n" + new Array(column).join(" ") + "^";
          }
        }
      }
      return null;
    }
    function printErrorAndExit(error48) {
      var source = getErrorSource(error48);
      var stderr = globalProcessStderr();
      if (stderr && stderr._handle && stderr._handle.setBlocking) {
        stderr._handle.setBlocking(true);
      }
      if (source) {
        console.error();
        console.error(source);
      }
      console.error(error48.stack);
      globalProcessExit(1);
    }
    function shimEmitUncaughtException() {
      var origEmit = process.emit;
      process.emit = function(type) {
        if (type === "uncaughtException") {
          var hasStack = arguments[1] && arguments[1].stack;
          var hasListeners = this.listeners(type).length > 0;
          if (hasStack && !hasListeners) {
            return printErrorAndExit(arguments[1]);
          }
        }
        return origEmit.apply(this, arguments);
      };
    }
    var originalRetrieveFileHandlers = retrieveFileHandlers.slice(0);
    var originalRetrieveMapHandlers = retrieveMapHandlers.slice(0);
    exports2.wrapCallSite = wrapCallSite;
    exports2.getErrorSource = getErrorSource;
    exports2.mapSourcePosition = mapSourcePosition;
    exports2.retrieveSourceMap = retrieveSourceMap;
    exports2.install = function(options2) {
      options2 = options2 || {};
      if (options2.environment) {
        environment = options2.environment;
        if (["node", "browser", "auto"].indexOf(environment) === -1) {
          throw new Error("environment " + environment + " was unknown. Available options are {auto, browser, node}");
        }
      }
      if (options2.retrieveFile) {
        if (options2.overrideRetrieveFile) {
          retrieveFileHandlers.length = 0;
        }
        retrieveFileHandlers.unshift(options2.retrieveFile);
      }
      if (options2.retrieveSourceMap) {
        if (options2.overrideRetrieveSourceMap) {
          retrieveMapHandlers.length = 0;
        }
        retrieveMapHandlers.unshift(options2.retrieveSourceMap);
      }
      if (options2.hookRequire && !isInBrowser()) {
        var Module = dynamicRequire(module2, "module");
        var $compile = Module.prototype._compile;
        if (!$compile.__sourceMapSupport) {
          Module.prototype._compile = function(content, filename) {
            fileContentsCache[filename] = content;
            sourceMapCache[filename] = void 0;
            return $compile.call(this, content, filename);
          };
          Module.prototype._compile.__sourceMapSupport = true;
        }
      }
      if (!emptyCacheBetweenOperations) {
        emptyCacheBetweenOperations = "emptyCacheBetweenOperations" in options2 ? options2.emptyCacheBetweenOperations : false;
      }
      if (!errorFormatterInstalled) {
        errorFormatterInstalled = true;
        Error.prepareStackTrace = prepareStackTrace;
      }
      if (!uncaughtShimInstalled) {
        var installHandler = "handleUncaughtExceptions" in options2 ? options2.handleUncaughtExceptions : true;
        try {
          var worker_threads = dynamicRequire(module2, "worker_threads");
          if (worker_threads.isMainThread === false) {
            installHandler = false;
          }
        } catch (e) {
        }
        if (installHandler && hasGlobalProcessEventEmitter()) {
          uncaughtShimInstalled = true;
          shimEmitUncaughtException();
        }
      }
    };
    exports2.resetRetrieveHandlers = function() {
      retrieveFileHandlers.length = 0;
      retrieveMapHandlers.length = 0;
      retrieveFileHandlers = originalRetrieveFileHandlers.slice(0);
      retrieveMapHandlers = originalRetrieveMapHandlers.slice(0);
      retrieveSourceMap = handlerExec(retrieveMapHandlers);
      retrieveFile = handlerExec(retrieveFileHandlers);
    };
  }
});

// node_modules/ansi-colors/symbols.js
var require_symbols = __commonJS({
  "node_modules/ansi-colors/symbols.js"(exports2, module2) {
    "use strict";
    var isHyper = typeof process !== "undefined" && process.env.TERM_PROGRAM === "Hyper";
    var isWindows = typeof process !== "undefined" && process.platform === "win32";
    var isLinux = typeof process !== "undefined" && process.platform === "linux";
    var common = {
      ballotDisabled: "\u2612",
      ballotOff: "\u2610",
      ballotOn: "\u2611",
      bullet: "\u2022",
      bulletWhite: "\u25E6",
      fullBlock: "\u2588",
      heart: "\u2764",
      identicalTo: "\u2261",
      line: "\u2500",
      mark: "\u203B",
      middot: "\xB7",
      minus: "\uFF0D",
      multiplication: "\xD7",
      obelus: "\xF7",
      pencilDownRight: "\u270E",
      pencilRight: "\u270F",
      pencilUpRight: "\u2710",
      percent: "%",
      pilcrow2: "\u2761",
      pilcrow: "\xB6",
      plusMinus: "\xB1",
      question: "?",
      section: "\xA7",
      starsOff: "\u2606",
      starsOn: "\u2605",
      upDownArrow: "\u2195"
    };
    var windows = Object.assign({}, common, {
      check: "\u221A",
      cross: "\xD7",
      ellipsisLarge: "...",
      ellipsis: "...",
      info: "i",
      questionSmall: "?",
      pointer: ">",
      pointerSmall: "\xBB",
      radioOff: "( )",
      radioOn: "(*)",
      warning: "\u203C"
    });
    var other = Object.assign({}, common, {
      ballotCross: "\u2718",
      check: "\u2714",
      cross: "\u2716",
      ellipsisLarge: "\u22EF",
      ellipsis: "\u2026",
      info: "\u2139",
      questionFull: "\uFF1F",
      questionSmall: "\uFE56",
      pointer: isLinux ? "\u25B8" : "\u276F",
      pointerSmall: isLinux ? "\u2023" : "\u203A",
      radioOff: "\u25EF",
      radioOn: "\u25C9",
      warning: "\u26A0"
    });
    module2.exports = isWindows && !isHyper ? windows : other;
    Reflect.defineProperty(module2.exports, "common", { enumerable: false, value: common });
    Reflect.defineProperty(module2.exports, "windows", { enumerable: false, value: windows });
    Reflect.defineProperty(module2.exports, "other", { enumerable: false, value: other });
  }
});

// node_modules/ansi-colors/index.js
var require_ansi_colors = __commonJS({
  "node_modules/ansi-colors/index.js"(exports2, module2) {
    "use strict";
    var isObject2 = (val) => val !== null && typeof val === "object" && !Array.isArray(val);
    var ANSI_REGEX = /[\u001b\u009b][[\]#;?()]*(?:(?:(?:[^\W_]*;?[^\W_]*)\u0007)|(?:(?:[0-9]{1,4}(;[0-9]{0,4})*)?[~0-9=<>cf-nqrtyA-PRZ]))/g;
    var hasColor = () => {
      if (typeof process !== "undefined") {
        return process.env.FORCE_COLOR !== "0";
      }
      return false;
    };
    var create = () => {
      const colors2 = {
        enabled: hasColor(),
        visible: true,
        styles: {},
        keys: {}
      };
      const ansi = (style2) => {
        let open2 = style2.open = `\x1B[${style2.codes[0]}m`;
        let close = style2.close = `\x1B[${style2.codes[1]}m`;
        let regex = style2.regex = new RegExp(`\\u001b\\[${style2.codes[1]}m`, "g");
        style2.wrap = (input, newline) => {
          if (input.includes(close)) input = input.replace(regex, close + open2);
          let output = open2 + input + close;
          return newline ? output.replace(/\r*\n/g, `${close}$&${open2}`) : output;
        };
        return style2;
      };
      const wrap = (style2, input, newline) => {
        return typeof style2 === "function" ? style2(input) : style2.wrap(input, newline);
      };
      const style = (input, stack) => {
        if (input === "" || input == null) return "";
        if (colors2.enabled === false) return input;
        if (colors2.visible === false) return "";
        let str = "" + input;
        let nl = str.includes("\n");
        let n = stack.length;
        if (n > 0 && stack.includes("unstyle")) {
          stack = [.../* @__PURE__ */ new Set(["unstyle", ...stack])].reverse();
        }
        while (n-- > 0) str = wrap(colors2.styles[stack[n]], str, nl);
        return str;
      };
      const define = (name, codes, type) => {
        colors2.styles[name] = ansi({ name, codes });
        let keys = colors2.keys[type] || (colors2.keys[type] = []);
        keys.push(name);
        Reflect.defineProperty(colors2, name, {
          configurable: true,
          enumerable: true,
          set(value) {
            colors2.alias(name, value);
          },
          get() {
            let color = (input) => style(input, color.stack);
            Reflect.setPrototypeOf(color, colors2);
            color.stack = this.stack ? this.stack.concat(name) : [name];
            return color;
          }
        });
      };
      define("reset", [0, 0], "modifier");
      define("bold", [1, 22], "modifier");
      define("dim", [2, 22], "modifier");
      define("italic", [3, 23], "modifier");
      define("underline", [4, 24], "modifier");
      define("inverse", [7, 27], "modifier");
      define("hidden", [8, 28], "modifier");
      define("strikethrough", [9, 29], "modifier");
      define("black", [30, 39], "color");
      define("red", [31, 39], "color");
      define("green", [32, 39], "color");
      define("yellow", [33, 39], "color");
      define("blue", [34, 39], "color");
      define("magenta", [35, 39], "color");
      define("cyan", [36, 39], "color");
      define("white", [37, 39], "color");
      define("gray", [90, 39], "color");
      define("grey", [90, 39], "color");
      define("bgBlack", [40, 49], "bg");
      define("bgRed", [41, 49], "bg");
      define("bgGreen", [42, 49], "bg");
      define("bgYellow", [43, 49], "bg");
      define("bgBlue", [44, 49], "bg");
      define("bgMagenta", [45, 49], "bg");
      define("bgCyan", [46, 49], "bg");
      define("bgWhite", [47, 49], "bg");
      define("blackBright", [90, 39], "bright");
      define("redBright", [91, 39], "bright");
      define("greenBright", [92, 39], "bright");
      define("yellowBright", [93, 39], "bright");
      define("blueBright", [94, 39], "bright");
      define("magentaBright", [95, 39], "bright");
      define("cyanBright", [96, 39], "bright");
      define("whiteBright", [97, 39], "bright");
      define("bgBlackBright", [100, 49], "bgBright");
      define("bgRedBright", [101, 49], "bgBright");
      define("bgGreenBright", [102, 49], "bgBright");
      define("bgYellowBright", [103, 49], "bgBright");
      define("bgBlueBright", [104, 49], "bgBright");
      define("bgMagentaBright", [105, 49], "bgBright");
      define("bgCyanBright", [106, 49], "bgBright");
      define("bgWhiteBright", [107, 49], "bgBright");
      colors2.ansiRegex = ANSI_REGEX;
      colors2.hasColor = colors2.hasAnsi = (str) => {
        colors2.ansiRegex.lastIndex = 0;
        return typeof str === "string" && str !== "" && colors2.ansiRegex.test(str);
      };
      colors2.alias = (name, color) => {
        let fn = typeof color === "string" ? colors2[color] : color;
        if (typeof fn !== "function") {
          throw new TypeError("Expected alias to be the name of an existing color (string) or a function");
        }
        if (!fn.stack) {
          Reflect.defineProperty(fn, "name", { value: name });
          colors2.styles[name] = fn;
          fn.stack = [name];
        }
        Reflect.defineProperty(colors2, name, {
          configurable: true,
          enumerable: true,
          set(value) {
            colors2.alias(name, value);
          },
          get() {
            let color2 = (input) => style(input, color2.stack);
            Reflect.setPrototypeOf(color2, colors2);
            color2.stack = this.stack ? this.stack.concat(fn.stack) : fn.stack;
            return color2;
          }
        });
      };
      colors2.theme = (custom2) => {
        if (!isObject2(custom2)) throw new TypeError("Expected theme to be an object");
        for (let name of Object.keys(custom2)) {
          colors2.alias(name, custom2[name]);
        }
        return colors2;
      };
      colors2.alias("unstyle", (str) => {
        if (typeof str === "string" && str !== "") {
          colors2.ansiRegex.lastIndex = 0;
          return str.replace(colors2.ansiRegex, "");
        }
        return "";
      });
      colors2.alias("noop", (str) => str);
      colors2.none = colors2.clear = colors2.noop;
      colors2.stripColor = colors2.unstyle;
      colors2.symbols = require_symbols();
      colors2.define = define;
      return colors2;
    };
    module2.exports = create();
    module2.exports.create = create;
  }
});

// node_modules/enquirer/lib/utils.js
var require_utils2 = __commonJS({
  "node_modules/enquirer/lib/utils.js"(exports2) {
    "use strict";
    var toString = Object.prototype.toString;
    var colors2 = require_ansi_colors();
    var called = false;
    var fns = [];
    var complements = {
      "yellow": "blue",
      "cyan": "red",
      "green": "magenta",
      "black": "white",
      "blue": "yellow",
      "red": "cyan",
      "magenta": "green",
      "white": "black"
    };
    exports2.longest = (arr, prop) => {
      return arr.reduce((a, v) => Math.max(a, prop ? v[prop].length : v.length), 0);
    };
    exports2.hasColor = (str) => !!str && colors2.hasColor(str);
    var isObject2 = exports2.isObject = (val) => {
      return val !== null && typeof val === "object" && !Array.isArray(val);
    };
    exports2.nativeType = (val) => {
      return toString.call(val).slice(8, -1).toLowerCase().replace(/\s/g, "");
    };
    exports2.isAsyncFn = (val) => {
      return exports2.nativeType(val) === "asyncfunction";
    };
    exports2.isPrimitive = (val) => {
      return val != null && typeof val !== "object" && typeof val !== "function";
    };
    exports2.resolve = (context, value, ...rest) => {
      if (typeof value === "function") {
        return value.call(context, ...rest);
      }
      return value;
    };
    exports2.scrollDown = (choices = []) => [...choices.slice(1), choices[0]];
    exports2.scrollUp = (choices = []) => [choices.pop(), ...choices];
    exports2.reorder = (arr = []) => {
      let res = arr.slice();
      res.sort((a, b) => {
        if (a.index > b.index) return 1;
        if (a.index < b.index) return -1;
        return 0;
      });
      return res;
    };
    exports2.swap = (arr, index, pos) => {
      let len = arr.length;
      let idx = pos === len ? 0 : pos < 0 ? len - 1 : pos;
      let choice = arr[index];
      arr[index] = arr[idx];
      arr[idx] = choice;
    };
    exports2.width = (stream, fallback = 80) => {
      let columns = stream && stream.columns ? stream.columns : fallback;
      if (stream && typeof stream.getWindowSize === "function") {
        columns = stream.getWindowSize()[0];
      }
      if (process.platform === "win32") {
        return columns - 1;
      }
      return columns;
    };
    exports2.height = (stream, fallback = 20) => {
      let rows = stream && stream.rows ? stream.rows : fallback;
      if (stream && typeof stream.getWindowSize === "function") {
        rows = stream.getWindowSize()[1];
      }
      return rows;
    };
    exports2.wordWrap = (str, options2 = {}) => {
      if (!str) return str;
      if (typeof options2 === "number") {
        options2 = { width: options2 };
      }
      let { indent = "", newline = "\n" + indent, width = 80 } = options2;
      let spaces = (newline + indent).match(/[^\S\n]/g) || [];
      width -= spaces.length;
      let source = `.{1,${width}}([\\s\\u200B]+|$)|[^\\s\\u200B]+?([\\s\\u200B]+|$)`;
      let output = str.trim();
      let regex = new RegExp(source, "g");
      let lines = output.match(regex) || [];
      lines = lines.map((line) => line.replace(/\n$/, ""));
      if (options2.padEnd) lines = lines.map((line) => line.padEnd(width, " "));
      if (options2.padStart) lines = lines.map((line) => line.padStart(width, " "));
      return indent + lines.join(newline);
    };
    exports2.unmute = (color) => {
      let name = color.stack.find((n) => colors2.keys.color.includes(n));
      if (name) {
        return colors2[name];
      }
      let bg = color.stack.find((n) => n.slice(2) === "bg");
      if (bg) {
        return colors2[name.slice(2)];
      }
      return (str) => str;
    };
    exports2.pascal = (str) => str ? str[0].toUpperCase() + str.slice(1) : "";
    exports2.inverse = (color) => {
      if (!color || !color.stack) return color;
      let name = color.stack.find((n) => colors2.keys.color.includes(n));
      if (name) {
        let col = colors2["bg" + exports2.pascal(name)];
        return col ? col.black : color;
      }
      let bg = color.stack.find((n) => n.slice(0, 2) === "bg");
      if (bg) {
        return colors2[bg.slice(2).toLowerCase()] || color;
      }
      return colors2.none;
    };
    exports2.complement = (color) => {
      if (!color || !color.stack) return color;
      let name = color.stack.find((n) => colors2.keys.color.includes(n));
      let bg = color.stack.find((n) => n.slice(0, 2) === "bg");
      if (name && !bg) {
        return colors2[complements[name] || name];
      }
      if (bg) {
        let lower = bg.slice(2).toLowerCase();
        let comp = complements[lower];
        if (!comp) return color;
        return colors2["bg" + exports2.pascal(comp)] || color;
      }
      return colors2.none;
    };
    exports2.meridiem = (date5) => {
      let hours = date5.getHours();
      let minutes = date5.getMinutes();
      let ampm = hours >= 12 ? "pm" : "am";
      hours = hours % 12;
      let hrs = hours === 0 ? 12 : hours;
      let min = minutes < 10 ? "0" + minutes : minutes;
      return hrs + ":" + min + " " + ampm;
    };
    exports2.set = (obj = {}, prop = "", val) => {
      return prop.split(".").reduce((acc, k, i, arr) => {
        let value = arr.length - 1 > i ? acc[k] || {} : val;
        if (!exports2.isObject(value) && i < arr.length - 1) value = {};
        return acc[k] = value;
      }, obj);
    };
    exports2.get = (obj = {}, prop = "", fallback) => {
      let value = obj[prop] == null ? prop.split(".").reduce((acc, k) => acc && acc[k], obj) : obj[prop];
      return value == null ? fallback : value;
    };
    exports2.mixin = (target, b) => {
      if (!isObject2(target)) return b;
      if (!isObject2(b)) return target;
      for (let key of Object.keys(b)) {
        let desc = Object.getOwnPropertyDescriptor(b, key);
        if (desc.hasOwnProperty("value")) {
          if (target.hasOwnProperty(key) && isObject2(desc.value)) {
            let existing = Object.getOwnPropertyDescriptor(target, key);
            if (isObject2(existing.value)) {
              target[key] = exports2.merge({}, target[key], b[key]);
            } else {
              Reflect.defineProperty(target, key, desc);
            }
          } else {
            Reflect.defineProperty(target, key, desc);
          }
        } else {
          Reflect.defineProperty(target, key, desc);
        }
      }
      return target;
    };
    exports2.merge = (...args) => {
      let target = {};
      for (let ele of args) exports2.mixin(target, ele);
      return target;
    };
    exports2.mixinEmitter = (obj, emitter) => {
      let proto = emitter.constructor.prototype;
      for (let key of Object.keys(proto)) {
        let val = proto[key];
        if (typeof val === "function") {
          exports2.define(obj, key, val.bind(emitter));
        } else {
          exports2.define(obj, key, val);
        }
      }
    };
    exports2.onExit = (callback) => {
      const onExit2 = (quit, code) => {
        if (called) return;
        called = true;
        fns.forEach((fn) => fn());
        if (quit === true) {
          process.exit(128 + code);
        }
      };
      if (fns.length === 0) {
        process.once("SIGTERM", onExit2.bind(null, true, 15));
        process.once("SIGINT", onExit2.bind(null, true, 2));
        process.once("exit", onExit2);
      }
      fns.push(callback);
    };
    exports2.define = (obj, key, value) => {
      Reflect.defineProperty(obj, key, { value });
    };
    exports2.defineExport = (obj, key, fn) => {
      let custom2;
      Reflect.defineProperty(obj, key, {
        enumerable: true,
        configurable: true,
        set(val) {
          custom2 = val;
        },
        get() {
          return custom2 ? custom2() : fn();
        }
      });
    };
  }
});

// node_modules/enquirer/lib/combos.js
var require_combos = __commonJS({
  "node_modules/enquirer/lib/combos.js"(exports2) {
    "use strict";
    exports2.ctrl = {
      a: "first",
      b: "backward",
      c: "cancel",
      d: "deleteForward",
      e: "last",
      f: "forward",
      g: "reset",
      i: "tab",
      k: "cutForward",
      l: "reset",
      n: "newItem",
      m: "cancel",
      j: "submit",
      p: "search",
      r: "remove",
      s: "save",
      u: "undo",
      w: "cutLeft",
      x: "toggleCursor",
      v: "paste"
    };
    exports2.shift = {
      up: "shiftUp",
      down: "shiftDown",
      left: "shiftLeft",
      right: "shiftRight",
      tab: "prev"
    };
    exports2.fn = {
      up: "pageUp",
      down: "pageDown",
      left: "pageLeft",
      right: "pageRight",
      delete: "deleteForward"
    };
    exports2.option = {
      b: "backward",
      f: "forward",
      d: "cutRight",
      left: "cutLeft",
      up: "altUp",
      down: "altDown"
    };
    exports2.keys = {
      pageup: "pageUp",
      // <fn>+<up> (mac), <Page Up> (windows)
      pagedown: "pageDown",
      // <fn>+<down> (mac), <Page Down> (windows)
      home: "home",
      // <fn>+<left> (mac), <home> (windows)
      end: "end",
      // <fn>+<right> (mac), <end> (windows)
      cancel: "cancel",
      delete: "deleteForward",
      backspace: "delete",
      down: "down",
      enter: "submit",
      escape: "cancel",
      left: "left",
      space: "space",
      number: "number",
      return: "submit",
      right: "right",
      tab: "next",
      up: "up"
    };
  }
});

// node_modules/enquirer/lib/keypress.js
var require_keypress = __commonJS({
  "node_modules/enquirer/lib/keypress.js"(exports2, module2) {
    "use strict";
    var readline = require("readline");
    var combos = require_combos();
    var metaKeyCodeRe = /^(?:\x1b)([a-zA-Z0-9])$/;
    var fnKeyRe = /^(?:\x1b+)(O|N|\[|\[\[)(?:(\d+)(?:;(\d+))?([~^$])|(?:1;)?(\d+)?([a-zA-Z]))/;
    var keyName = {
      /* xterm/gnome ESC O letter */
      "OP": "f1",
      "OQ": "f2",
      "OR": "f3",
      "OS": "f4",
      /* xterm/rxvt ESC [ number ~ */
      "[11~": "f1",
      "[12~": "f2",
      "[13~": "f3",
      "[14~": "f4",
      /* from Cygwin and used in libuv */
      "[[A": "f1",
      "[[B": "f2",
      "[[C": "f3",
      "[[D": "f4",
      "[[E": "f5",
      /* common */
      "[15~": "f5",
      "[17~": "f6",
      "[18~": "f7",
      "[19~": "f8",
      "[20~": "f9",
      "[21~": "f10",
      "[23~": "f11",
      "[24~": "f12",
      /* xterm ESC [ letter */
      "[A": "up",
      "[B": "down",
      "[C": "right",
      "[D": "left",
      "[E": "clear",
      "[F": "end",
      "[H": "home",
      /* xterm/gnome ESC O letter */
      "OA": "up",
      "OB": "down",
      "OC": "right",
      "OD": "left",
      "OE": "clear",
      "OF": "end",
      "OH": "home",
      /* xterm/rxvt ESC [ number ~ */
      "[1~": "home",
      "[2~": "insert",
      "[3~": "delete",
      "[4~": "end",
      "[5~": "pageup",
      "[6~": "pagedown",
      /* putty */
      "[[5~": "pageup",
      "[[6~": "pagedown",
      /* rxvt */
      "[7~": "home",
      "[8~": "end",
      /* rxvt keys with modifiers */
      "[a": "up",
      "[b": "down",
      "[c": "right",
      "[d": "left",
      "[e": "clear",
      "[2$": "insert",
      "[3$": "delete",
      "[5$": "pageup",
      "[6$": "pagedown",
      "[7$": "home",
      "[8$": "end",
      "Oa": "up",
      "Ob": "down",
      "Oc": "right",
      "Od": "left",
      "Oe": "clear",
      "[2^": "insert",
      "[3^": "delete",
      "[5^": "pageup",
      "[6^": "pagedown",
      "[7^": "home",
      "[8^": "end",
      /* misc. */
      "[Z": "tab"
    };
    function isShiftKey(code) {
      return ["[a", "[b", "[c", "[d", "[e", "[2$", "[3$", "[5$", "[6$", "[7$", "[8$", "[Z"].includes(code);
    }
    function isCtrlKey(code) {
      return ["Oa", "Ob", "Oc", "Od", "Oe", "[2^", "[3^", "[5^", "[6^", "[7^", "[8^"].includes(code);
    }
    var keypress = (s = "", event = {}) => {
      let parts;
      let key = {
        name: event.name,
        ctrl: false,
        meta: false,
        shift: false,
        option: false,
        sequence: s,
        raw: s,
        ...event
      };
      if (Buffer.isBuffer(s)) {
        if (s[0] > 127 && s[1] === void 0) {
          s[0] -= 128;
          s = "\x1B" + String(s);
        } else {
          s = String(s);
        }
      } else if (s !== void 0 && typeof s !== "string") {
        s = String(s);
      } else if (!s) {
        s = key.sequence || "";
      }
      key.sequence = key.sequence || s || key.name;
      if (s === "\r") {
        key.raw = void 0;
        key.name = "return";
      } else if (s === "\n") {
        key.name = "enter";
      } else if (s === "	") {
        key.name = "tab";
      } else if (s === "\b" || s === "\x7F" || s === "\x1B\x7F" || s === "\x1B\b") {
        key.name = "backspace";
        key.meta = s.charAt(0) === "\x1B";
      } else if (s === "\x1B" || s === "\x1B\x1B") {
        key.name = "escape";
        key.meta = s.length === 2;
      } else if (s === " " || s === "\x1B ") {
        key.name = "space";
        key.meta = s.length === 2;
      } else if (s <= "") {
        key.name = String.fromCharCode(s.charCodeAt(0) + "a".charCodeAt(0) - 1);
        key.ctrl = true;
      } else if (s.length === 1 && s >= "0" && s <= "9") {
        key.name = "number";
      } else if (s.length === 1 && s >= "a" && s <= "z") {
        key.name = s;
      } else if (s.length === 1 && s >= "A" && s <= "Z") {
        key.name = s.toLowerCase();
        key.shift = true;
      } else if (parts = metaKeyCodeRe.exec(s)) {
        key.meta = true;
        key.shift = /^[A-Z]$/.test(parts[1]);
      } else if (parts = fnKeyRe.exec(s)) {
        let segs = [...s];
        if (segs[0] === "\x1B" && segs[1] === "\x1B") {
          key.option = true;
        }
        let code = [parts[1], parts[2], parts[4], parts[6]].filter(Boolean).join("");
        let modifier = (parts[3] || parts[5] || 1) - 1;
        key.ctrl = !!(modifier & 4);
        key.meta = !!(modifier & 10);
        key.shift = !!(modifier & 1);
        key.code = code;
        key.name = keyName[code];
        key.shift = isShiftKey(code) || key.shift;
        key.ctrl = isCtrlKey(code) || key.ctrl;
      }
      return key;
    };
    keypress.listen = (options2 = {}, onKeypress) => {
      let { stdin } = options2;
      if (!stdin || stdin !== process.stdin && !stdin.isTTY) {
        throw new Error("Invalid stream passed");
      }
      let rl = readline.createInterface({ terminal: true, input: stdin });
      readline.emitKeypressEvents(stdin, rl);
      let on = (buf, key) => onKeypress(buf, keypress(buf, key), rl);
      let isRaw = stdin.isRaw;
      if (stdin.isTTY) stdin.setRawMode(true);
      stdin.on("keypress", on);
      rl.resume();
      let off = () => {
        if (stdin.isTTY) stdin.setRawMode(isRaw);
        stdin.removeListener("keypress", on);
        rl.pause();
        rl.close();
      };
      return off;
    };
    keypress.action = (buf, key, customActions) => {
      let obj = { ...combos, ...customActions };
      if (key.ctrl) {
        key.action = obj.ctrl[key.name];
        return key;
      }
      if (key.option && obj.option) {
        key.action = obj.option[key.name];
        return key;
      }
      if (key.shift) {
        key.action = obj.shift[key.name];
        return key;
      }
      key.action = obj.keys[key.name];
      return key;
    };
    module2.exports = keypress;
  }
});

// node_modules/enquirer/lib/timer.js
var require_timer = __commonJS({
  "node_modules/enquirer/lib/timer.js"(exports2, module2) {
    "use strict";
    module2.exports = (prompt) => {
      prompt.timers = prompt.timers || {};
      let timers = prompt.options.timers;
      if (!timers) return;
      for (let key of Object.keys(timers)) {
        let opts = timers[key];
        if (typeof opts === "number") {
          opts = { interval: opts };
        }
        create(prompt, key, opts);
      }
    };
    function create(prompt, name, options2 = {}) {
      let timer = prompt.timers[name] = { name, start: Date.now(), ms: 0, tick: 0 };
      let ms = options2.interval || 120;
      timer.frames = options2.frames || [];
      timer.loading = true;
      let interval = setInterval(() => {
        timer.ms = Date.now() - timer.start;
        timer.tick++;
        prompt.render();
      }, ms);
      timer.stop = () => {
        timer.loading = false;
        clearInterval(interval);
      };
      Reflect.defineProperty(timer, "interval", { value: interval });
      prompt.once("close", () => timer.stop());
      return timer.stop;
    }
  }
});

// node_modules/enquirer/lib/state.js
var require_state = __commonJS({
  "node_modules/enquirer/lib/state.js"(exports2, module2) {
    "use strict";
    var { define, width } = require_utils2();
    var State = class {
      constructor(prompt) {
        let options2 = prompt.options;
        define(this, "_prompt", prompt);
        this.type = prompt.type;
        this.name = prompt.name;
        this.message = "";
        this.header = "";
        this.footer = "";
        this.error = "";
        this.hint = "";
        this.input = "";
        this.cursor = 0;
        this.index = 0;
        this.lines = 0;
        this.tick = 0;
        this.prompt = "";
        this.buffer = "";
        this.width = width(options2.stdout || process.stdout);
        Object.assign(this, options2);
        this.name = this.name || this.message;
        this.message = this.message || this.name;
        this.symbols = prompt.symbols;
        this.styles = prompt.styles;
        this.required = /* @__PURE__ */ new Set();
        this.cancelled = false;
        this.submitted = false;
      }
      clone() {
        let state = { ...this };
        state.status = this.status;
        state.buffer = Buffer.from(state.buffer);
        delete state.clone;
        return state;
      }
      set color(val) {
        this._color = val;
      }
      get color() {
        let styles = this.prompt.styles;
        if (this.cancelled) return styles.cancelled;
        if (this.submitted) return styles.submitted;
        let color = this._color || styles[this.status];
        return typeof color === "function" ? color : styles.pending;
      }
      set loading(value) {
        this._loading = value;
      }
      get loading() {
        if (typeof this._loading === "boolean") return this._loading;
        if (this.loadingChoices) return "choices";
        return false;
      }
      get status() {
        if (this.cancelled) return "cancelled";
        if (this.submitted) return "submitted";
        return "pending";
      }
    };
    module2.exports = State;
  }
});

// node_modules/enquirer/lib/styles.js
var require_styles2 = __commonJS({
  "node_modules/enquirer/lib/styles.js"(exports2, module2) {
    "use strict";
    var utils = require_utils2();
    var colors2 = require_ansi_colors();
    var styles = {
      default: colors2.noop,
      noop: colors2.noop,
      /**
       * Modifiers
       */
      set inverse(custom2) {
        this._inverse = custom2;
      },
      get inverse() {
        return this._inverse || utils.inverse(this.primary);
      },
      set complement(custom2) {
        this._complement = custom2;
      },
      get complement() {
        return this._complement || utils.complement(this.primary);
      },
      /**
       * Main color
       */
      primary: colors2.cyan,
      /**
       * Main palette
       */
      success: colors2.green,
      danger: colors2.magenta,
      strong: colors2.bold,
      warning: colors2.yellow,
      muted: colors2.dim,
      disabled: colors2.gray,
      dark: colors2.dim.gray,
      underline: colors2.underline,
      set info(custom2) {
        this._info = custom2;
      },
      get info() {
        return this._info || this.primary;
      },
      set em(custom2) {
        this._em = custom2;
      },
      get em() {
        return this._em || this.primary.underline;
      },
      set heading(custom2) {
        this._heading = custom2;
      },
      get heading() {
        return this._heading || this.muted.underline;
      },
      /**
       * Statuses
       */
      set pending(custom2) {
        this._pending = custom2;
      },
      get pending() {
        return this._pending || this.primary;
      },
      set submitted(custom2) {
        this._submitted = custom2;
      },
      get submitted() {
        return this._submitted || this.success;
      },
      set cancelled(custom2) {
        this._cancelled = custom2;
      },
      get cancelled() {
        return this._cancelled || this.danger;
      },
      /**
       * Special styling
       */
      set typing(custom2) {
        this._typing = custom2;
      },
      get typing() {
        return this._typing || this.dim;
      },
      set placeholder(custom2) {
        this._placeholder = custom2;
      },
      get placeholder() {
        return this._placeholder || this.primary.dim;
      },
      set highlight(custom2) {
        this._highlight = custom2;
      },
      get highlight() {
        return this._highlight || this.inverse;
      }
    };
    styles.merge = (options2 = {}) => {
      if (options2.styles && typeof options2.styles.enabled === "boolean") {
        colors2.enabled = options2.styles.enabled;
      }
      if (options2.styles && typeof options2.styles.visible === "boolean") {
        colors2.visible = options2.styles.visible;
      }
      let result = utils.merge({}, styles, options2.styles);
      delete result.merge;
      for (let key of Object.keys(colors2)) {
        if (!result.hasOwnProperty(key)) {
          Reflect.defineProperty(result, key, { get: () => colors2[key] });
        }
      }
      for (let key of Object.keys(colors2.styles)) {
        if (!result.hasOwnProperty(key)) {
          Reflect.defineProperty(result, key, { get: () => colors2[key] });
        }
      }
      return result;
    };
    module2.exports = styles;
  }
});

// node_modules/enquirer/lib/symbols.js
var require_symbols2 = __commonJS({
  "node_modules/enquirer/lib/symbols.js"(exports2, module2) {
    "use strict";
    var isWindows = process.platform === "win32";
    var colors2 = require_ansi_colors();
    var utils = require_utils2();
    var symbols = {
      ...colors2.symbols,
      upDownDoubleArrow: "\u21D5",
      upDownDoubleArrow2: "\u2B0D",
      upDownArrow: "\u2195",
      asterisk: "*",
      asterism: "\u2042",
      bulletWhite: "\u25E6",
      electricArrow: "\u2301",
      ellipsisLarge: "\u22EF",
      ellipsisSmall: "\u2026",
      fullBlock: "\u2588",
      identicalTo: "\u2261",
      indicator: colors2.symbols.check,
      leftAngle: "\u2039",
      mark: "\u203B",
      minus: "\u2212",
      multiplication: "\xD7",
      obelus: "\xF7",
      percent: "%",
      pilcrow: "\xB6",
      pilcrow2: "\u2761",
      pencilUpRight: "\u2710",
      pencilDownRight: "\u270E",
      pencilRight: "\u270F",
      plus: "+",
      plusMinus: "\xB1",
      pointRight: "\u261E",
      rightAngle: "\u203A",
      section: "\xA7",
      hexagon: { off: "\u2B21", on: "\u2B22", disabled: "\u2B22" },
      ballot: { on: "\u2611", off: "\u2610", disabled: "\u2612" },
      stars: { on: "\u2605", off: "\u2606", disabled: "\u2606" },
      folder: { on: "\u25BC", off: "\u25B6", disabled: "\u25B6" },
      prefix: {
        pending: colors2.symbols.question,
        submitted: colors2.symbols.check,
        cancelled: colors2.symbols.cross
      },
      separator: {
        pending: colors2.symbols.pointerSmall,
        submitted: colors2.symbols.middot,
        cancelled: colors2.symbols.middot
      },
      radio: {
        off: isWindows ? "( )" : "\u25EF",
        on: isWindows ? "(*)" : "\u25C9",
        disabled: isWindows ? "(|)" : "\u24BE"
      },
      numbers: ["\u24EA", "\u2460", "\u2461", "\u2462", "\u2463", "\u2464", "\u2465", "\u2466", "\u2467", "\u2468", "\u2469", "\u246A", "\u246B", "\u246C", "\u246D", "\u246E", "\u246F", "\u2470", "\u2471", "\u2472", "\u2473", "\u3251", "\u3252", "\u3253", "\u3254", "\u3255", "\u3256", "\u3257", "\u3258", "\u3259", "\u325A", "\u325B", "\u325C", "\u325D", "\u325E", "\u325F", "\u32B1", "\u32B2", "\u32B3", "\u32B4", "\u32B5", "\u32B6", "\u32B7", "\u32B8", "\u32B9", "\u32BA", "\u32BB", "\u32BC", "\u32BD", "\u32BE", "\u32BF"]
    };
    symbols.merge = (options2) => {
      let result = utils.merge({}, colors2.symbols, symbols, options2.symbols);
      delete result.merge;
      return result;
    };
    module2.exports = symbols;
  }
});

// node_modules/enquirer/lib/theme.js
var require_theme = __commonJS({
  "node_modules/enquirer/lib/theme.js"(exports2, module2) {
    "use strict";
    var styles = require_styles2();
    var symbols = require_symbols2();
    var utils = require_utils2();
    module2.exports = (prompt) => {
      prompt.options = utils.merge({}, prompt.options.theme, prompt.options);
      prompt.symbols = symbols.merge(prompt.options);
      prompt.styles = styles.merge(prompt.options);
    };
  }
});

// node_modules/enquirer/lib/ansi.js
var require_ansi = __commonJS({
  "node_modules/enquirer/lib/ansi.js"(exports2, module2) {
    "use strict";
    var isTerm = process.env.TERM_PROGRAM === "Apple_Terminal";
    var colors2 = require_ansi_colors();
    var utils = require_utils2();
    var ansi = module2.exports = exports2;
    var ESC = "\x1B[";
    var BEL = "\x07";
    var hidden = false;
    var code = ansi.code = {
      bell: BEL,
      beep: BEL,
      beginning: `${ESC}G`,
      down: `${ESC}J`,
      esc: ESC,
      getPosition: `${ESC}6n`,
      hide: `${ESC}?25l`,
      line: `${ESC}2K`,
      lineEnd: `${ESC}K`,
      lineStart: `${ESC}1K`,
      restorePosition: ESC + (isTerm ? "8" : "u"),
      savePosition: ESC + (isTerm ? "7" : "s"),
      screen: `${ESC}2J`,
      show: `${ESC}?25h`,
      up: `${ESC}1J`
    };
    var cursor = ansi.cursor = {
      get hidden() {
        return hidden;
      },
      hide() {
        hidden = true;
        return code.hide;
      },
      show() {
        hidden = false;
        return code.show;
      },
      forward: (count = 1) => `${ESC}${count}C`,
      backward: (count = 1) => `${ESC}${count}D`,
      nextLine: (count = 1) => `${ESC}E`.repeat(count),
      prevLine: (count = 1) => `${ESC}F`.repeat(count),
      up: (count = 1) => count ? `${ESC}${count}A` : "",
      down: (count = 1) => count ? `${ESC}${count}B` : "",
      right: (count = 1) => count ? `${ESC}${count}C` : "",
      left: (count = 1) => count ? `${ESC}${count}D` : "",
      to(x, y) {
        return y ? `${ESC}${y + 1};${x + 1}H` : `${ESC}${x + 1}G`;
      },
      move(x = 0, y = 0) {
        let res = "";
        res += x < 0 ? cursor.left(-x) : x > 0 ? cursor.right(x) : "";
        res += y < 0 ? cursor.up(-y) : y > 0 ? cursor.down(y) : "";
        return res;
      },
      restore(state = {}) {
        let { after, cursor: cursor2, initial, input, prompt, size, value } = state;
        initial = utils.isPrimitive(initial) ? String(initial) : "";
        input = utils.isPrimitive(input) ? String(input) : "";
        value = utils.isPrimitive(value) ? String(value) : "";
        if (size) {
          let codes = ansi.cursor.up(size) + ansi.cursor.to(prompt.length);
          let diff2 = input.length - cursor2;
          if (diff2 > 0) {
            codes += ansi.cursor.left(diff2);
          }
          return codes;
        }
        if (value || after) {
          let pos = !input && !!initial ? -initial.length : -input.length + cursor2;
          if (after) pos -= after.length;
          if (input === "" && initial && !prompt.includes(initial)) {
            pos += initial.length;
          }
          return ansi.cursor.move(pos);
        }
      }
    };
    var erase = ansi.erase = {
      screen: code.screen,
      up: code.up,
      down: code.down,
      line: code.line,
      lineEnd: code.lineEnd,
      lineStart: code.lineStart,
      lines(n) {
        let str = "";
        for (let i = 0; i < n; i++) {
          str += ansi.erase.line + (i < n - 1 ? ansi.cursor.up(1) : "");
        }
        if (n) str += ansi.code.beginning;
        return str;
      }
    };
    ansi.clear = (input = "", columns = process.stdout.columns) => {
      if (!columns) return erase.line + cursor.to(0);
      let width = (str) => [...colors2.unstyle(str)].length;
      let lines = input.split(/\r?\n/);
      let rows = 0;
      for (let line of lines) {
        rows += 1 + Math.floor(Math.max(width(line) - 1, 0) / columns);
      }
      return (erase.line + cursor.prevLine()).repeat(rows - 1) + erase.line + cursor.to(0);
    };
  }
});

// node_modules/enquirer/lib/prompt.js
var require_prompt = __commonJS({
  "node_modules/enquirer/lib/prompt.js"(exports2, module2) {
    "use strict";
    var Events = require("events");
    var colors2 = require_ansi_colors();
    var keypress = require_keypress();
    var timer = require_timer();
    var State = require_state();
    var theme = require_theme();
    var utils = require_utils2();
    var ansi = require_ansi();
    var Prompt = class _Prompt extends Events {
      constructor(options2 = {}) {
        super();
        this.name = options2.name;
        this.type = options2.type;
        this.options = options2;
        theme(this);
        timer(this);
        this.state = new State(this);
        this.initial = [options2.initial, options2.default].find((v) => v != null);
        this.stdout = options2.stdout || process.stdout;
        this.stdin = options2.stdin || process.stdin;
        this.scale = options2.scale || 1;
        this.term = this.options.term || process.env.TERM_PROGRAM;
        this.margin = margin(this.options.margin);
        this.setMaxListeners(0);
        setOptions(this);
      }
      async keypress(input, event = {}) {
        this.keypressed = true;
        let key = keypress.action(input, keypress(input, event), this.options.actions);
        this.state.keypress = key;
        this.emit("keypress", input, key);
        this.emit("state", this.state.clone());
        let fn = this.options[key.action] || this[key.action] || this.dispatch;
        if (typeof fn === "function") {
          return await fn.call(this, input, key);
        }
        this.alert();
      }
      alert() {
        delete this.state.alert;
        if (this.options.show === false) {
          this.emit("alert");
        } else {
          this.stdout.write(ansi.code.beep);
        }
      }
      cursorHide() {
        this.stdout.write(ansi.cursor.hide());
        utils.onExit(() => this.cursorShow());
      }
      cursorShow() {
        this.stdout.write(ansi.cursor.show());
      }
      write(str) {
        if (!str) return;
        if (this.stdout && this.state.show !== false) {
          this.stdout.write(str);
        }
        this.state.buffer += str;
      }
      clear(lines = 0) {
        let buffer = this.state.buffer;
        this.state.buffer = "";
        if (!buffer && !lines || this.options.show === false) return;
        this.stdout.write(ansi.cursor.down(lines) + ansi.clear(buffer, this.width));
      }
      restore() {
        if (this.state.closed || this.options.show === false) return;
        let { prompt, after, rest } = this.sections();
        let { cursor, initial = "", input = "", value = "" } = this;
        let size = this.state.size = rest.length;
        let state = { after, cursor, initial, input, prompt, size, value };
        let codes = ansi.cursor.restore(state);
        if (codes) {
          this.stdout.write(codes);
        }
      }
      sections() {
        let { buffer, input, prompt } = this.state;
        prompt = colors2.unstyle(prompt);
        let buf = colors2.unstyle(buffer);
        let idx = buf.indexOf(prompt);
        let header = buf.slice(0, idx);
        let rest = buf.slice(idx);
        let lines = rest.split("\n");
        let first = lines[0];
        let last = lines[lines.length - 1];
        let promptLine = prompt + (input ? " " + input : "");
        let len = promptLine.length;
        let after = len < first.length ? first.slice(len + 1) : "";
        return { header, prompt: first, after, rest: lines.slice(1), last };
      }
      async submit() {
        this.state.submitted = true;
        this.state.validating = true;
        if (this.options.onSubmit) {
          await this.options.onSubmit.call(this, this.name, this.value, this);
        }
        let result = this.state.error || await this.validate(this.value, this.state);
        if (result !== true) {
          let error48 = "\n" + this.symbols.pointer + " ";
          if (typeof result === "string") {
            error48 += result.trim();
          } else {
            error48 += "Invalid input";
          }
          this.state.error = "\n" + this.styles.danger(error48);
          this.state.submitted = false;
          await this.render();
          await this.alert();
          this.state.validating = false;
          this.state.error = void 0;
          return;
        }
        this.state.validating = false;
        await this.render();
        await this.close();
        this.value = await this.result(this.value);
        this.emit("submit", this.value);
      }
      async cancel(err) {
        this.state.cancelled = this.state.submitted = true;
        await this.render();
        await this.close();
        if (typeof this.options.onCancel === "function") {
          await this.options.onCancel.call(this, this.name, this.value, this);
        }
        this.emit("cancel", await this.error(err));
      }
      async close() {
        this.state.closed = true;
        try {
          let sections = this.sections();
          let lines = Math.ceil(sections.prompt.length / this.width);
          if (sections.rest) {
            this.write(ansi.cursor.down(sections.rest.length));
          }
          this.write("\n".repeat(lines));
        } catch (err) {
        }
        this.emit("close");
      }
      start() {
        if (!this.stop && this.options.show !== false) {
          this.stop = keypress.listen(this, this.keypress.bind(this));
          this.once("close", this.stop);
        }
      }
      async skip() {
        this.skipped = this.options.skip === true;
        if (typeof this.options.skip === "function") {
          this.skipped = await this.options.skip.call(this, this.name, this.value);
        }
        return this.skipped;
      }
      async initialize() {
        let { format, options: options2, result } = this;
        this.format = () => format.call(this, this.value);
        this.result = () => result.call(this, this.value);
        if (typeof options2.initial === "function") {
          this.initial = await options2.initial.call(this, this);
        }
        if (typeof options2.onRun === "function") {
          await options2.onRun.call(this, this);
        }
        if (typeof options2.onSubmit === "function") {
          let onSubmit = options2.onSubmit.bind(this);
          let submit = this.submit.bind(this);
          delete this.options.onSubmit;
          this.submit = async () => {
            await onSubmit(this.name, this.value, this);
            return submit();
          };
        }
        await this.start();
        await this.render();
      }
      render() {
        throw new Error("expected prompt to have a custom render method");
      }
      run() {
        return new Promise(async (resolve, reject) => {
          this.once("submit", resolve);
          this.once("cancel", reject);
          if (await this.skip()) {
            this.render = () => {
            };
            return this.submit();
          }
          await this.initialize();
          this.emit("run");
        });
      }
      async element(name, choice, i) {
        let { options: options2, state, symbols, timers } = this;
        let timer2 = timers && timers[name];
        state.timer = timer2;
        let value = options2[name] || state[name] || symbols[name];
        let val = choice && choice[name] != null ? choice[name] : await value;
        if (val === "") return val;
        let res = await this.resolve(val, state, choice, i);
        if (!res && choice && choice[name]) {
          return this.resolve(value, state, choice, i);
        }
        return res;
      }
      async prefix() {
        let element = await this.element("prefix") || this.symbols;
        let timer2 = this.timers && this.timers.prefix;
        let state = this.state;
        state.timer = timer2;
        if (utils.isObject(element)) element = element[state.status] || element.pending;
        if (!utils.hasColor(element)) {
          let style = this.styles[state.status] || this.styles.pending;
          return style(element);
        }
        return element;
      }
      async message() {
        let message = await this.element("message");
        if (!utils.hasColor(message)) {
          return this.styles.strong(message);
        }
        return message;
      }
      async separator() {
        let element = await this.element("separator") || this.symbols;
        let timer2 = this.timers && this.timers.separator;
        let state = this.state;
        state.timer = timer2;
        let value = element[state.status] || element.pending || state.separator;
        let ele = await this.resolve(value, state);
        if (utils.isObject(ele)) ele = ele[state.status] || ele.pending;
        if (!utils.hasColor(ele)) {
          return this.styles.muted(ele);
        }
        return ele;
      }
      async pointer(choice, i) {
        let val = await this.element("pointer", choice, i);
        if (typeof val === "string" && utils.hasColor(val)) {
          return val;
        }
        if (val) {
          let styles = this.styles;
          let focused = this.index === i;
          let style = focused ? styles.primary : (val2) => val2;
          let ele = await this.resolve(val[focused ? "on" : "off"] || val, this.state);
          let styled = !utils.hasColor(ele) ? style(ele) : ele;
          return focused ? styled : " ".repeat(ele.length);
        }
      }
      async indicator(choice, i) {
        let val = await this.element("indicator", choice, i);
        if (typeof val === "string" && utils.hasColor(val)) {
          return val;
        }
        if (val) {
          let styles = this.styles;
          let enabled = choice.enabled === true;
          let style = enabled ? styles.success : styles.dark;
          let ele = val[enabled ? "on" : "off"] || val;
          return !utils.hasColor(ele) ? style(ele) : ele;
        }
        return "";
      }
      body() {
        return null;
      }
      footer() {
        if (this.state.status === "pending") {
          return this.element("footer");
        }
      }
      header() {
        if (this.state.status === "pending") {
          return this.element("header");
        }
      }
      async hint() {
        if (this.state.status === "pending" && !this.isValue(this.state.input)) {
          let hint = await this.element("hint");
          if (!utils.hasColor(hint)) {
            return this.styles.muted(hint);
          }
          return hint;
        }
      }
      error(err) {
        return !this.state.submitted ? err || this.state.error : "";
      }
      format(value) {
        return value;
      }
      result(value) {
        return value;
      }
      validate(value) {
        if (this.options.required === true) {
          return this.isValue(value);
        }
        return true;
      }
      isValue(value) {
        return value != null && value !== "";
      }
      resolve(value, ...args) {
        return utils.resolve(this, value, ...args);
      }
      get base() {
        return _Prompt.prototype;
      }
      get style() {
        return this.styles[this.state.status];
      }
      get height() {
        return this.options.rows || utils.height(this.stdout, 25);
      }
      get width() {
        return this.options.columns || utils.width(this.stdout, 80);
      }
      get size() {
        return { width: this.width, height: this.height };
      }
      set cursor(value) {
        this.state.cursor = value;
      }
      get cursor() {
        return this.state.cursor;
      }
      set input(value) {
        this.state.input = value;
      }
      get input() {
        return this.state.input;
      }
      set value(value) {
        this.state.value = value;
      }
      get value() {
        let { input, value } = this.state;
        let result = [value, input].find(this.isValue.bind(this));
        return this.isValue(result) ? result : this.initial;
      }
      static get prompt() {
        return (options2) => new this(options2).run();
      }
    };
    function setOptions(prompt) {
      let isValidKey = (key) => {
        return prompt[key] === void 0 || typeof prompt[key] === "function";
      };
      let ignore = [
        "actions",
        "choices",
        "initial",
        "margin",
        "roles",
        "styles",
        "symbols",
        "theme",
        "timers",
        "value"
      ];
      let ignoreFn = [
        "body",
        "footer",
        "error",
        "header",
        "hint",
        "indicator",
        "message",
        "prefix",
        "separator",
        "skip"
      ];
      for (let key of Object.keys(prompt.options)) {
        if (ignore.includes(key)) continue;
        if (/^on[A-Z]/.test(key)) continue;
        let option = prompt.options[key];
        if (typeof option === "function" && isValidKey(key)) {
          if (!ignoreFn.includes(key)) {
            prompt[key] = option.bind(prompt);
          }
        } else if (typeof prompt[key] !== "function") {
          prompt[key] = option;
        }
      }
    }
    function margin(value) {
      if (typeof value === "number") {
        value = [value, value, value, value];
      }
      let arr = [].concat(value || []);
      let pad = (i) => i % 2 === 0 ? "\n" : " ";
      let res = [];
      for (let i = 0; i < 4; i++) {
        let char = pad(i);
        if (arr[i]) {
          res.push(char.repeat(arr[i]));
        } else {
          res.push("");
        }
      }
      return res;
    }
    module2.exports = Prompt;
  }
});

// node_modules/enquirer/lib/roles.js
var require_roles = __commonJS({
  "node_modules/enquirer/lib/roles.js"(exports2, module2) {
    "use strict";
    var utils = require_utils2();
    var roles = {
      default(prompt, choice) {
        return choice;
      },
      checkbox(prompt, choice) {
        throw new Error("checkbox role is not implemented yet");
      },
      editable(prompt, choice) {
        throw new Error("editable role is not implemented yet");
      },
      expandable(prompt, choice) {
        throw new Error("expandable role is not implemented yet");
      },
      heading(prompt, choice) {
        choice.disabled = "";
        choice.indicator = [choice.indicator, " "].find((v) => v != null);
        choice.message = choice.message || "";
        return choice;
      },
      input(prompt, choice) {
        throw new Error("input role is not implemented yet");
      },
      option(prompt, choice) {
        return roles.default(prompt, choice);
      },
      radio(prompt, choice) {
        throw new Error("radio role is not implemented yet");
      },
      separator(prompt, choice) {
        choice.disabled = "";
        choice.indicator = [choice.indicator, " "].find((v) => v != null);
        choice.message = choice.message || prompt.symbols.line.repeat(5);
        return choice;
      },
      spacer(prompt, choice) {
        return choice;
      }
    };
    module2.exports = (name, options2 = {}) => {
      let role = utils.merge({}, roles, options2.roles);
      return role[name] || role.default;
    };
  }
});

// node_modules/enquirer/lib/types/array.js
var require_array = __commonJS({
  "node_modules/enquirer/lib/types/array.js"(exports2, module2) {
    "use strict";
    var colors2 = require_ansi_colors();
    var Prompt = require_prompt();
    var roles = require_roles();
    var utils = require_utils2();
    var { reorder, scrollUp, scrollDown, isObject: isObject2, swap } = utils;
    var ArrayPrompt = class extends Prompt {
      constructor(options2) {
        super(options2);
        this.cursorHide();
        this.maxSelected = options2.maxSelected || Infinity;
        this.multiple = options2.multiple || false;
        this.initial = options2.initial || 0;
        this.delay = options2.delay || 0;
        this.longest = 0;
        this.num = "";
      }
      async initialize() {
        if (typeof this.options.initial === "function") {
          this.initial = await this.options.initial.call(this);
        }
        await this.reset(true);
        await super.initialize();
      }
      async reset() {
        let { choices, initial, autofocus, suggest } = this.options;
        this.state._choices = [];
        this.state.choices = [];
        this.choices = await Promise.all(await this.toChoices(choices));
        this.choices.forEach((ch) => ch.enabled = false);
        if (typeof suggest !== "function" && this.selectable.length === 0) {
          throw new Error("At least one choice must be selectable");
        }
        if (isObject2(initial)) initial = Object.keys(initial);
        if (Array.isArray(initial)) {
          if (autofocus != null) this.index = this.findIndex(autofocus);
          initial.forEach((v) => this.enable(this.find(v)));
          await this.render();
        } else {
          if (autofocus != null) initial = autofocus;
          if (typeof initial === "string") initial = this.findIndex(initial);
          if (typeof initial === "number" && initial > -1) {
            this.index = Math.max(0, Math.min(initial, this.choices.length));
            this.enable(this.find(this.index));
          }
        }
        if (this.isDisabled(this.focused)) {
          await this.down();
        }
      }
      async toChoices(value, parent) {
        this.state.loadingChoices = true;
        let choices = [];
        let index = 0;
        let toChoices = async (items, parent2) => {
          if (typeof items === "function") items = await items.call(this);
          if (items instanceof Promise) items = await items;
          for (let i = 0; i < items.length; i++) {
            let choice = items[i] = await this.toChoice(items[i], index++, parent2);
            choices.push(choice);
            if (choice.choices) {
              await toChoices(choice.choices, choice);
            }
          }
          return choices;
        };
        return toChoices(value, parent).then((choices2) => {
          this.state.loadingChoices = false;
          return choices2;
        });
      }
      async toChoice(ele, i, parent) {
        if (typeof ele === "function") ele = await ele.call(this, this);
        if (ele instanceof Promise) ele = await ele;
        if (typeof ele === "string") ele = { name: ele };
        if (ele.normalized) return ele;
        ele.normalized = true;
        let origVal = ele.value;
        let role = roles(ele.role, this.options);
        ele = role(this, ele);
        if (typeof ele.disabled === "string" && !ele.hint) {
          ele.hint = ele.disabled;
          ele.disabled = true;
        }
        if (ele.disabled === true && ele.hint == null) {
          ele.hint = "(disabled)";
        }
        if (ele.index != null) return ele;
        ele.name = ele.name || ele.key || ele.title || ele.value || ele.message;
        ele.message = ele.message || ele.name || "";
        ele.value = [ele.value, ele.name].find(this.isValue.bind(this));
        ele.input = "";
        ele.index = i;
        ele.cursor = 0;
        utils.define(ele, "parent", parent);
        ele.level = parent ? parent.level + 1 : 1;
        if (ele.indent == null) {
          ele.indent = parent ? parent.indent + "  " : ele.indent || "";
        }
        ele.path = parent ? parent.path + "." + ele.name : ele.name;
        ele.enabled = !!(this.multiple && !this.isDisabled(ele) && (ele.enabled || this.isSelected(ele)));
        if (!this.isDisabled(ele)) {
          this.longest = Math.max(this.longest, colors2.unstyle(ele.message).length);
        }
        let choice = { ...ele };
        ele.reset = (input = choice.input, value = choice.value) => {
          for (let key of Object.keys(choice)) ele[key] = choice[key];
          ele.input = input;
          ele.value = value;
        };
        if (origVal == null && typeof ele.initial === "function") {
          ele.input = await ele.initial.call(this, this.state, ele, i);
        }
        return ele;
      }
      async onChoice(choice, i) {
        this.emit("choice", choice, i, this);
        if (typeof choice.onChoice === "function") {
          await choice.onChoice.call(this, this.state, choice, i);
        }
      }
      async addChoice(ele, i, parent) {
        let choice = await this.toChoice(ele, i, parent);
        this.choices.push(choice);
        this.index = this.choices.length - 1;
        this.limit = this.choices.length;
        return choice;
      }
      async newItem(item, i, parent) {
        let ele = { name: "New choice name?", editable: true, newChoice: true, ...item };
        let choice = await this.addChoice(ele, i, parent);
        choice.updateChoice = () => {
          delete choice.newChoice;
          choice.name = choice.message = choice.input;
          choice.input = "";
          choice.cursor = 0;
        };
        return this.render();
      }
      indent(choice) {
        if (choice.indent == null) {
          return choice.level > 1 ? "  ".repeat(choice.level - 1) : "";
        }
        return choice.indent;
      }
      dispatch(s, key) {
        if (this.multiple && this[key.name]) return this[key.name]();
        this.alert();
      }
      focus(choice, enabled) {
        if (typeof enabled !== "boolean") enabled = choice.enabled;
        if (enabled && !choice.enabled && this.selected.length >= this.maxSelected) {
          return this.alert();
        }
        this.index = choice.index;
        choice.enabled = enabled && !this.isDisabled(choice);
        return choice;
      }
      space() {
        if (!this.multiple) return this.alert();
        this.toggle(this.focused);
        return this.render();
      }
      a() {
        if (this.maxSelected < this.choices.length) return this.alert();
        let enabled = this.selectable.every((ch) => ch.enabled);
        this.choices.forEach((ch) => ch.enabled = !enabled);
        return this.render();
      }
      i() {
        if (this.choices.length - this.selected.length > this.maxSelected) {
          return this.alert();
        }
        this.choices.forEach((ch) => ch.enabled = !ch.enabled);
        return this.render();
      }
      g(choice = this.focused) {
        if (!this.choices.some((ch) => !!ch.parent)) return this.a();
        this.toggle(choice.parent && !choice.choices ? choice.parent : choice);
        return this.render();
      }
      toggle(choice, enabled) {
        if (!choice.enabled && this.selected.length >= this.maxSelected) {
          return this.alert();
        }
        if (typeof enabled !== "boolean") enabled = !choice.enabled;
        choice.enabled = enabled;
        if (choice.choices) {
          choice.choices.forEach((ch) => this.toggle(ch, enabled));
        }
        let parent = choice.parent;
        while (parent) {
          let choices = parent.choices.filter((ch) => this.isDisabled(ch));
          parent.enabled = choices.every((ch) => ch.enabled === true);
          parent = parent.parent;
        }
        reset(this, this.choices);
        this.emit("toggle", choice, this);
        return choice;
      }
      enable(choice) {
        if (this.selected.length >= this.maxSelected) return this.alert();
        choice.enabled = !this.isDisabled(choice);
        choice.choices && choice.choices.forEach(this.enable.bind(this));
        return choice;
      }
      disable(choice) {
        choice.enabled = false;
        choice.choices && choice.choices.forEach(this.disable.bind(this));
        return choice;
      }
      number(n) {
        this.num += n;
        let number4 = (num) => {
          let i = Number(num);
          if (i > this.choices.length - 1) return this.alert();
          let focused = this.focused;
          let choice = this.choices.find((ch) => i === ch.index);
          if (!choice.enabled && this.selected.length >= this.maxSelected) {
            return this.alert();
          }
          if (this.visible.indexOf(choice) === -1) {
            let choices = reorder(this.choices);
            let actualIdx = choices.indexOf(choice);
            if (focused.index > actualIdx) {
              let start = choices.slice(actualIdx, actualIdx + this.limit);
              let end = choices.filter((ch) => !start.includes(ch));
              this.choices = start.concat(end);
            } else {
              let pos = actualIdx - this.limit + 1;
              this.choices = choices.slice(pos).concat(choices.slice(0, pos));
            }
          }
          this.index = this.choices.indexOf(choice);
          this.toggle(this.focused);
          return this.render();
        };
        clearTimeout(this.numberTimeout);
        return new Promise((resolve) => {
          let len = this.choices.length;
          let num = this.num;
          let handle = (val = false, res) => {
            clearTimeout(this.numberTimeout);
            if (val) res = number4(num);
            this.num = "";
            resolve(res);
          };
          if (num === "0" || num.length === 1 && Number(num + "0") > len) {
            return handle(true);
          }
          if (Number(num) > len) {
            return handle(false, this.alert());
          }
          this.numberTimeout = setTimeout(() => handle(true), this.delay);
        });
      }
      home() {
        this.choices = reorder(this.choices);
        this.index = 0;
        return this.render();
      }
      end() {
        let pos = this.choices.length - this.limit;
        let choices = reorder(this.choices);
        this.choices = choices.slice(pos).concat(choices.slice(0, pos));
        this.index = this.limit - 1;
        return this.render();
      }
      first() {
        this.index = 0;
        return this.render();
      }
      last() {
        this.index = this.visible.length - 1;
        return this.render();
      }
      prev() {
        if (this.visible.length <= 1) return this.alert();
        return this.up();
      }
      next() {
        if (this.visible.length <= 1) return this.alert();
        return this.down();
      }
      right() {
        if (this.cursor >= this.input.length) return this.alert();
        this.cursor++;
        return this.render();
      }
      left() {
        if (this.cursor <= 0) return this.alert();
        this.cursor--;
        return this.render();
      }
      up() {
        let len = this.choices.length;
        let vis = this.visible.length;
        let idx = this.index;
        if (this.options.scroll === false && idx === 0) {
          return this.alert();
        }
        if (len > vis && idx === 0) {
          return this.scrollUp();
        }
        this.index = (idx - 1 % len + len) % len;
        if (this.isDisabled()) {
          return this.up();
        }
        return this.render();
      }
      down() {
        let len = this.choices.length;
        let vis = this.visible.length;
        let idx = this.index;
        if (this.options.scroll === false && idx === vis - 1) {
          return this.alert();
        }
        if (len > vis && idx === vis - 1) {
          return this.scrollDown();
        }
        this.index = (idx + 1) % len;
        if (this.isDisabled()) {
          return this.down();
        }
        return this.render();
      }
      scrollUp(i = 0) {
        this.choices = scrollUp(this.choices);
        this.index = i;
        if (this.isDisabled()) {
          return this.up();
        }
        return this.render();
      }
      scrollDown(i = this.visible.length - 1) {
        this.choices = scrollDown(this.choices);
        this.index = i;
        if (this.isDisabled()) {
          return this.down();
        }
        return this.render();
      }
      async shiftUp() {
        if (this.options.sort === true) {
          this.sorting = true;
          this.swap(this.index - 1);
          await this.up();
          this.sorting = false;
          return;
        }
        return this.scrollUp(this.index);
      }
      async shiftDown() {
        if (this.options.sort === true) {
          this.sorting = true;
          this.swap(this.index + 1);
          await this.down();
          this.sorting = false;
          return;
        }
        return this.scrollDown(this.index);
      }
      pageUp() {
        if (this.visible.length <= 1) return this.alert();
        this.limit = Math.max(this.limit - 1, 0);
        this.index = Math.min(this.limit - 1, this.index);
        this._limit = this.limit;
        if (this.isDisabled()) {
          return this.up();
        }
        return this.render();
      }
      pageDown() {
        if (this.visible.length >= this.choices.length) return this.alert();
        this.index = Math.max(0, this.index);
        this.limit = Math.min(this.limit + 1, this.choices.length);
        this._limit = this.limit;
        if (this.isDisabled()) {
          return this.down();
        }
        return this.render();
      }
      swap(pos) {
        swap(this.choices, this.index, pos);
      }
      isDisabled(choice = this.focused) {
        let keys = ["disabled", "collapsed", "hidden", "completing", "readonly"];
        if (choice && keys.some((key) => choice[key] === true)) {
          return true;
        }
        return choice && choice.role === "heading";
      }
      isEnabled(choice = this.focused) {
        if (Array.isArray(choice)) return choice.every((ch) => this.isEnabled(ch));
        if (choice.choices) {
          let choices = choice.choices.filter((ch) => !this.isDisabled(ch));
          return choice.enabled && choices.every((ch) => this.isEnabled(ch));
        }
        return choice.enabled && !this.isDisabled(choice);
      }
      isChoice(choice, value) {
        return choice.name === value || choice.index === Number(value);
      }
      isSelected(choice) {
        if (Array.isArray(this.initial)) {
          return this.initial.some((value) => this.isChoice(choice, value));
        }
        return this.isChoice(choice, this.initial);
      }
      map(names = [], prop = "value") {
        return [].concat(names || []).reduce((acc, name) => {
          acc[name] = this.find(name, prop);
          return acc;
        }, {});
      }
      filter(value, prop) {
        let isChoice = (ele, i) => [ele.name, i].includes(value);
        let fn = typeof value === "function" ? value : isChoice;
        let choices = this.options.multiple ? this.state._choices : this.choices;
        let result = choices.filter(fn);
        if (prop) {
          return result.map((ch) => ch[prop]);
        }
        return result;
      }
      find(value, prop) {
        if (isObject2(value)) return prop ? value[prop] : value;
        let isChoice = (ele, i) => [ele.name, i].includes(value);
        let fn = typeof value === "function" ? value : isChoice;
        let choice = this.choices.find(fn);
        if (choice) {
          return prop ? choice[prop] : choice;
        }
      }
      findIndex(value) {
        return this.choices.indexOf(this.find(value));
      }
      async submit() {
        let choice = this.focused;
        if (!choice) return this.alert();
        if (choice.newChoice) {
          if (!choice.input) return this.alert();
          choice.updateChoice();
          return this.render();
        }
        if (this.choices.some((ch) => ch.newChoice)) {
          return this.alert();
        }
        let { reorder: reorder2, sort } = this.options;
        let multi = this.multiple === true;
        let value = this.selected;
        if (value === void 0) {
          return this.alert();
        }
        if (Array.isArray(value) && reorder2 !== false && sort !== true) {
          value = utils.reorder(value);
        }
        this.value = multi ? value.map((ch) => ch.name) : value.name;
        return super.submit();
      }
      set choices(choices = []) {
        this.state._choices = this.state._choices || [];
        this.state.choices = choices;
        for (let choice of choices) {
          if (!this.state._choices.some((ch) => ch.name === choice.name)) {
            this.state._choices.push(choice);
          }
        }
        if (!this._initial && this.options.initial) {
          this._initial = true;
          let init = this.initial;
          if (typeof init === "string" || typeof init === "number") {
            let choice = this.find(init);
            if (choice) {
              this.initial = choice.index;
              this.focus(choice, true);
            }
          }
        }
      }
      get choices() {
        return reset(this, this.state.choices || []);
      }
      set visible(visible) {
        this.state.visible = visible;
      }
      get visible() {
        return (this.state.visible || this.choices).slice(0, this.limit);
      }
      set limit(num) {
        this.state.limit = num;
      }
      get limit() {
        let { state, options: options2, choices } = this;
        let limit = state.limit || this._limit || options2.limit || choices.length;
        return Math.min(limit, this.height);
      }
      set value(value) {
        super.value = value;
      }
      get value() {
        if (typeof super.value !== "string" && super.value === this.initial) {
          return this.input;
        }
        return super.value;
      }
      set index(i) {
        this.state.index = i;
      }
      get index() {
        return Math.max(0, this.state ? this.state.index : 0);
      }
      get enabled() {
        return this.filter(this.isEnabled.bind(this));
      }
      get focused() {
        let choice = this.choices[this.index];
        if (choice && this.state.submitted && this.multiple !== true) {
          choice.enabled = true;
        }
        return choice;
      }
      get selectable() {
        return this.choices.filter((choice) => !this.isDisabled(choice));
      }
      get selected() {
        return this.multiple ? this.enabled : this.focused;
      }
    };
    function reset(prompt, choices) {
      if (choices instanceof Promise) return choices;
      if (typeof choices === "function") {
        if (utils.isAsyncFn(choices)) return choices;
        choices = choices.call(prompt, prompt);
      }
      for (let choice of choices) {
        if (Array.isArray(choice.choices)) {
          let items = choice.choices.filter((ch) => !prompt.isDisabled(ch));
          choice.enabled = items.every((ch) => ch.enabled === true);
        }
        if (prompt.isDisabled(choice) === true) {
          delete choice.enabled;
        }
      }
      return choices;
    }
    module2.exports = ArrayPrompt;
  }
});

// node_modules/enquirer/lib/prompts/select.js
var require_select = __commonJS({
  "node_modules/enquirer/lib/prompts/select.js"(exports2, module2) {
    "use strict";
    var ArrayPrompt = require_array();
    var utils = require_utils2();
    var SelectPrompt = class extends ArrayPrompt {
      constructor(options2) {
        super(options2);
        this.emptyError = this.options.emptyError || "No items were selected";
      }
      async dispatch(s, key) {
        if (this.multiple) {
          return this[key.name] ? await this[key.name](s, key) : await super.dispatch(s, key);
        }
        this.alert();
      }
      separator() {
        if (this.options.separator) return super.separator();
        let sep = this.styles.muted(this.symbols.ellipsis);
        return this.state.submitted ? super.separator() : sep;
      }
      pointer(choice, i) {
        return !this.multiple || this.options.pointer ? super.pointer(choice, i) : "";
      }
      indicator(choice, i) {
        return this.multiple ? super.indicator(choice, i) : "";
      }
      choiceMessage(choice, i) {
        let message = this.resolve(choice.message, this.state, choice, i);
        if (choice.role === "heading" && !utils.hasColor(message)) {
          message = this.styles.strong(message);
        }
        return this.resolve(message, this.state, choice, i);
      }
      choiceSeparator() {
        return ":";
      }
      async renderChoice(choice, i) {
        await this.onChoice(choice, i);
        let focused = this.index === i;
        let pointer = await this.pointer(choice, i);
        let check2 = await this.indicator(choice, i) + (choice.pad || "");
        let hint = await this.resolve(choice.hint, this.state, choice, i);
        if (hint && !utils.hasColor(hint)) {
          hint = this.styles.muted(hint);
        }
        let ind = this.indent(choice);
        let msg = await this.choiceMessage(choice, i);
        let line = () => [this.margin[3], ind + pointer + check2, msg, this.margin[1], hint].filter(Boolean).join(" ");
        if (choice.role === "heading") {
          return line();
        }
        if (choice.disabled) {
          if (!utils.hasColor(msg)) {
            msg = this.styles.disabled(msg);
          }
          return line();
        }
        if (focused) {
          msg = this.styles.em(msg);
        }
        return line();
      }
      async renderChoices() {
        if (this.state.loading === "choices") {
          return this.styles.warning("Loading choices");
        }
        if (this.state.submitted) return "";
        let choices = this.visible.map(async (ch, i) => await this.renderChoice(ch, i));
        let visible = await Promise.all(choices);
        if (!visible.length) visible.push(this.styles.danger("No matching choices"));
        let result = this.margin[0] + visible.join("\n");
        let header;
        if (this.options.choicesHeader) {
          header = await this.resolve(this.options.choicesHeader, this.state);
        }
        return [header, result].filter(Boolean).join("\n");
      }
      format() {
        if (!this.state.submitted || this.state.cancelled) return "";
        if (Array.isArray(this.selected)) {
          return this.selected.map((choice) => this.styles.primary(choice.name)).join(", ");
        }
        return this.styles.primary(this.selected.name);
      }
      async render() {
        let { submitted, size } = this.state;
        let prompt = "";
        let header = await this.header();
        let prefix = await this.prefix();
        let separator = await this.separator();
        let message = await this.message();
        if (this.options.promptLine !== false) {
          prompt = [prefix, message, separator, ""].join(" ");
          this.state.prompt = prompt;
        }
        let output = await this.format();
        let help = await this.error() || await this.hint();
        let body = await this.renderChoices();
        let footer = await this.footer();
        if (output) prompt += output;
        if (help && !prompt.includes(help)) prompt += " " + help;
        if (submitted && !output && !body.trim() && this.multiple && this.emptyError != null) {
          prompt += this.styles.danger(this.emptyError);
        }
        this.clear(size);
        this.write([header, prompt, body, footer].filter(Boolean).join("\n"));
        this.write(this.margin[2]);
        this.restore();
      }
    };
    module2.exports = SelectPrompt;
  }
});

// node_modules/enquirer/lib/prompts/autocomplete.js
var require_autocomplete = __commonJS({
  "node_modules/enquirer/lib/prompts/autocomplete.js"(exports2, module2) {
    "use strict";
    var Select = require_select();
    var highlight = (input, color) => {
      let val = input.toLowerCase();
      return (str) => {
        let s = str.toLowerCase();
        let i = s.indexOf(val);
        let colored = color(str.slice(i, i + val.length));
        return i >= 0 ? str.slice(0, i) + colored + str.slice(i + val.length) : str;
      };
    };
    var AutoComplete = class extends Select {
      constructor(options2) {
        super(options2);
        this.cursorShow();
      }
      moveCursor(n) {
        this.state.cursor += n;
      }
      dispatch(ch) {
        return this.append(ch);
      }
      space(ch) {
        return this.options.multiple ? super.space(ch) : this.append(ch);
      }
      append(ch) {
        let { cursor, input } = this.state;
        this.input = input.slice(0, cursor) + ch + input.slice(cursor);
        this.moveCursor(1);
        return this.complete();
      }
      delete() {
        let { cursor, input } = this.state;
        if (!input) return this.alert();
        this.input = input.slice(0, cursor - 1) + input.slice(cursor);
        this.moveCursor(-1);
        return this.complete();
      }
      deleteForward() {
        let { cursor, input } = this.state;
        if (input[cursor] === void 0) return this.alert();
        this.input = `${input}`.slice(0, cursor) + `${input}`.slice(cursor + 1);
        return this.complete();
      }
      number(ch) {
        return this.append(ch);
      }
      async complete() {
        this.completing = true;
        this.choices = await this.suggest(this.input, this.state._choices);
        this.state.limit = void 0;
        this.index = Math.min(Math.max(this.visible.length - 1, 0), this.index);
        await this.render();
        this.completing = false;
      }
      suggest(input = this.input, choices = this.state._choices) {
        if (typeof this.options.suggest === "function") {
          return this.options.suggest.call(this, input, choices);
        }
        let str = input.toLowerCase();
        return choices.filter((ch) => ch.message.toLowerCase().includes(str));
      }
      pointer() {
        return "";
      }
      format() {
        if (!this.focused) return this.input;
        if (this.options.multiple && this.state.submitted) {
          return this.selected.map((ch) => this.styles.primary(ch.message)).join(", ");
        }
        if (this.state.submitted) {
          let value = this.value = this.input = this.focused.value;
          return this.styles.primary(value);
        }
        return this.input;
      }
      async render() {
        if (this.state.status !== "pending") return super.render();
        let style = this.options.highlight ? this.options.highlight.bind(this) : this.styles.placeholder;
        let color = highlight(this.input, style);
        let choices = this.choices;
        this.choices = choices.map((ch) => ({ ...ch, message: color(ch.message) }));
        await super.render();
        this.choices = choices;
      }
      submit() {
        if (this.options.multiple) {
          this.value = this.selected.map((ch) => ch.name);
        }
        return super.submit();
      }
    };
    module2.exports = AutoComplete;
  }
});

// node_modules/enquirer/lib/placeholder.js
var require_placeholder = __commonJS({
  "node_modules/enquirer/lib/placeholder.js"(exports2, module2) {
    "use strict";
    var utils = require_utils2();
    module2.exports = (prompt, options2 = {}) => {
      prompt.cursorHide();
      let { input = "", initial = "", pos, showCursor = true, color } = options2;
      let style = color || prompt.styles.placeholder;
      let inverse = utils.inverse(prompt.styles.primary);
      let blinker = (str) => inverse(prompt.styles.black(str));
      let output = input;
      let char = " ";
      let reverse = blinker(char);
      if (prompt.blink && prompt.blink.off === true) {
        blinker = (str) => str;
        reverse = "";
      }
      if (showCursor && pos === 0 && initial === "" && input === "") {
        return blinker(char);
      }
      if (showCursor && pos === 0 && (input === initial || input === "")) {
        return blinker(initial[0]) + style(initial.slice(1));
      }
      initial = utils.isPrimitive(initial) ? `${initial}` : "";
      input = utils.isPrimitive(input) ? `${input}` : "";
      let placeholder = initial && initial.startsWith(input) && initial !== input;
      let cursor = placeholder ? blinker(initial[input.length]) : reverse;
      if (pos !== input.length && showCursor === true) {
        output = input.slice(0, pos) + blinker(input[pos]) + input.slice(pos + 1);
        cursor = "";
      }
      if (showCursor === false) {
        cursor = "";
      }
      if (placeholder) {
        let raw = prompt.styles.unstyle(output + cursor);
        return output + cursor + style(initial.slice(raw.length));
      }
      return output + cursor;
    };
  }
});

// node_modules/enquirer/lib/prompts/form.js
var require_form = __commonJS({
  "node_modules/enquirer/lib/prompts/form.js"(exports2, module2) {
    "use strict";
    var colors2 = require_ansi_colors();
    var SelectPrompt = require_select();
    var placeholder = require_placeholder();
    var FormPrompt = class extends SelectPrompt {
      constructor(options2) {
        super({ ...options2, multiple: true });
        this.type = "form";
        this.initial = this.options.initial;
        this.align = [this.options.align, "right"].find((v) => v != null);
        this.emptyError = "";
        this.values = {};
      }
      async reset(first) {
        await super.reset();
        if (first === true) this._index = this.index;
        this.index = this._index;
        this.values = {};
        this.choices.forEach((choice) => choice.reset && choice.reset());
        return this.render();
      }
      dispatch(char) {
        return !!char && this.append(char);
      }
      append(char) {
        let choice = this.focused;
        if (!choice) return this.alert();
        let { cursor, input } = choice;
        choice.value = choice.input = input.slice(0, cursor) + char + input.slice(cursor);
        choice.cursor++;
        return this.render();
      }
      delete() {
        let choice = this.focused;
        if (!choice || choice.cursor <= 0) return this.alert();
        let { cursor, input } = choice;
        choice.value = choice.input = input.slice(0, cursor - 1) + input.slice(cursor);
        choice.cursor--;
        return this.render();
      }
      deleteForward() {
        let choice = this.focused;
        if (!choice) return this.alert();
        let { cursor, input } = choice;
        if (input[cursor] === void 0) return this.alert();
        let str = `${input}`.slice(0, cursor) + `${input}`.slice(cursor + 1);
        choice.value = choice.input = str;
        return this.render();
      }
      right() {
        let choice = this.focused;
        if (!choice) return this.alert();
        if (choice.cursor >= choice.input.length) return this.alert();
        choice.cursor++;
        return this.render();
      }
      left() {
        let choice = this.focused;
        if (!choice) return this.alert();
        if (choice.cursor <= 0) return this.alert();
        choice.cursor--;
        return this.render();
      }
      space(ch, key) {
        return this.dispatch(ch, key);
      }
      number(ch, key) {
        return this.dispatch(ch, key);
      }
      next() {
        let ch = this.focused;
        if (!ch) return this.alert();
        let { initial, input } = ch;
        if (initial && initial.startsWith(input) && input !== initial) {
          ch.value = ch.input = initial;
          ch.cursor = ch.value.length;
          return this.render();
        }
        return super.next();
      }
      prev() {
        let ch = this.focused;
        if (!ch) return this.alert();
        if (ch.cursor === 0) return super.prev();
        ch.value = ch.input = "";
        ch.cursor = 0;
        return this.render();
      }
      separator() {
        return "";
      }
      format(value) {
        return !this.state.submitted ? super.format(value) : "";
      }
      pointer() {
        return "";
      }
      indicator(choice) {
        return choice.input ? "\u29BF" : "\u2299";
      }
      async choiceSeparator(choice, i) {
        let sep = await this.resolve(choice.separator, this.state, choice, i) || ":";
        return sep ? " " + this.styles.disabled(sep) : "";
      }
      async renderChoice(choice, i) {
        await this.onChoice(choice, i);
        let { state, styles } = this;
        let { cursor, initial = "", name, hint, input = "" } = choice;
        let { muted, submitted, primary, danger } = styles;
        let help = hint;
        let focused = this.index === i;
        let validate2 = choice.validate || (() => true);
        let sep = await this.choiceSeparator(choice, i);
        let msg = choice.message;
        if (this.align === "right") msg = msg.padStart(this.longest + 1, " ");
        if (this.align === "left") msg = msg.padEnd(this.longest + 1, " ");
        let value = this.values[name] = input || initial;
        let color = input ? "success" : "dark";
        if (await validate2.call(choice, value, this.state) !== true) {
          color = "danger";
        }
        let style = styles[color];
        let indicator = style(await this.indicator(choice, i)) + (choice.pad || "");
        let indent = this.indent(choice);
        let line = () => [indent, indicator, msg + sep, input, help].filter(Boolean).join(" ");
        if (state.submitted) {
          msg = colors2.unstyle(msg);
          input = submitted(input);
          help = "";
          return line();
        }
        if (choice.format) {
          input = await choice.format.call(this, input, choice, i);
        } else {
          let color2 = this.styles.muted;
          let options2 = { input, initial, pos: cursor, showCursor: focused, color: color2 };
          input = placeholder(this, options2);
        }
        if (!this.isValue(input)) {
          input = this.styles.muted(this.symbols.ellipsis);
        }
        if (choice.result) {
          this.values[name] = await choice.result.call(this, value, choice, i);
        }
        if (focused) {
          msg = primary(msg);
        }
        if (choice.error) {
          input += (input ? " " : "") + danger(choice.error.trim());
        } else if (choice.hint) {
          input += (input ? " " : "") + muted(choice.hint.trim());
        }
        return line();
      }
      async submit() {
        this.value = this.values;
        return super.base.submit.call(this);
      }
    };
    module2.exports = FormPrompt;
  }
});

// node_modules/enquirer/lib/types/auth.js
var require_auth = __commonJS({
  "node_modules/enquirer/lib/types/auth.js"(exports2, module2) {
    "use strict";
    var FormPrompt = require_form();
    var defaultAuthenticate = () => {
      throw new Error("expected prompt to have a custom authenticate method");
    };
    var factory = (authenticate = defaultAuthenticate) => {
      class AuthPrompt extends FormPrompt {
        constructor(options2) {
          super(options2);
        }
        async submit() {
          this.value = await authenticate.call(this, this.values, this.state);
          super.base.submit.call(this);
        }
        static create(authenticate2) {
          return factory(authenticate2);
        }
      }
      return AuthPrompt;
    };
    module2.exports = factory();
  }
});

// node_modules/enquirer/lib/prompts/basicauth.js
var require_basicauth = __commonJS({
  "node_modules/enquirer/lib/prompts/basicauth.js"(exports2, module2) {
    "use strict";
    var AuthPrompt = require_auth();
    function defaultAuthenticate(value, state) {
      if (value.username === this.options.username && value.password === this.options.password) {
        return true;
      }
      return false;
    }
    var factory = (authenticate = defaultAuthenticate) => {
      const choices = [
        { name: "username", message: "username" },
        {
          name: "password",
          message: "password",
          format(input) {
            if (this.options.showPassword) {
              return input;
            }
            let color = this.state.submitted ? this.styles.primary : this.styles.muted;
            return color(this.symbols.asterisk.repeat(input.length));
          }
        }
      ];
      class BasicAuthPrompt extends AuthPrompt.create(authenticate) {
        constructor(options2) {
          super({ ...options2, choices });
        }
        static create(authenticate2) {
          return factory(authenticate2);
        }
      }
      return BasicAuthPrompt;
    };
    module2.exports = factory();
  }
});

// node_modules/enquirer/lib/types/boolean.js
var require_boolean = __commonJS({
  "node_modules/enquirer/lib/types/boolean.js"(exports2, module2) {
    "use strict";
    var Prompt = require_prompt();
    var { isPrimitive, hasColor } = require_utils2();
    var BooleanPrompt = class extends Prompt {
      constructor(options2) {
        super(options2);
        this.cursorHide();
      }
      async initialize() {
        let initial = await this.resolve(this.initial, this.state);
        this.input = await this.cast(initial);
        await super.initialize();
      }
      dispatch(ch) {
        if (!this.isValue(ch)) return this.alert();
        this.input = ch;
        return this.submit();
      }
      format(value) {
        let { styles, state } = this;
        return !state.submitted ? styles.primary(value) : styles.success(value);
      }
      cast(input) {
        return this.isTrue(input);
      }
      isTrue(input) {
        return /^[ty1]/i.test(input);
      }
      isFalse(input) {
        return /^[fn0]/i.test(input);
      }
      isValue(value) {
        return isPrimitive(value) && (this.isTrue(value) || this.isFalse(value));
      }
      async hint() {
        if (this.state.status === "pending") {
          let hint = await this.element("hint");
          if (!hasColor(hint)) {
            return this.styles.muted(hint);
          }
          return hint;
        }
      }
      async render() {
        let { input, size } = this.state;
        let prefix = await this.prefix();
        let sep = await this.separator();
        let msg = await this.message();
        let hint = this.styles.muted(this.default);
        let promptLine = [prefix, msg, hint, sep].filter(Boolean).join(" ");
        this.state.prompt = promptLine;
        let header = await this.header();
        let value = this.value = this.cast(input);
        let output = await this.format(value);
        let help = await this.error() || await this.hint();
        let footer = await this.footer();
        if (help && !promptLine.includes(help)) output += " " + help;
        promptLine += " " + output;
        this.clear(size);
        this.write([header, promptLine, footer].filter(Boolean).join("\n"));
        this.restore();
      }
      set value(value) {
        super.value = value;
      }
      get value() {
        return this.cast(super.value);
      }
    };
    module2.exports = BooleanPrompt;
  }
});

// node_modules/enquirer/lib/prompts/confirm.js
var require_confirm = __commonJS({
  "node_modules/enquirer/lib/prompts/confirm.js"(exports2, module2) {
    "use strict";
    var BooleanPrompt = require_boolean();
    var ConfirmPrompt = class extends BooleanPrompt {
      constructor(options2) {
        super(options2);
        this.default = this.options.default || (this.initial ? "(Y/n)" : "(y/N)");
      }
    };
    module2.exports = ConfirmPrompt;
  }
});

// node_modules/enquirer/lib/prompts/editable.js
var require_editable = __commonJS({
  "node_modules/enquirer/lib/prompts/editable.js"(exports2, module2) {
    "use strict";
    var Select = require_select();
    var Form = require_form();
    var form = Form.prototype;
    var Editable = class extends Select {
      constructor(options2) {
        super({ ...options2, multiple: true });
        this.align = [this.options.align, "left"].find((v) => v != null);
        this.emptyError = "";
        this.values = {};
      }
      dispatch(char, key) {
        let choice = this.focused;
        let parent = choice.parent || {};
        if (!choice.editable && !parent.editable) {
          if (char === "a" || char === "i") return super[char]();
        }
        return form.dispatch.call(this, char, key);
      }
      append(char, key) {
        return form.append.call(this, char, key);
      }
      delete(char, key) {
        return form.delete.call(this, char, key);
      }
      space(char) {
        return this.focused.editable ? this.append(char) : super.space();
      }
      number(char) {
        return this.focused.editable ? this.append(char) : super.number(char);
      }
      next() {
        return this.focused.editable ? form.next.call(this) : super.next();
      }
      prev() {
        return this.focused.editable ? form.prev.call(this) : super.prev();
      }
      async indicator(choice, i) {
        let symbol2 = choice.indicator || "";
        let value = choice.editable ? symbol2 : super.indicator(choice, i);
        return await this.resolve(value, this.state, choice, i) || "";
      }
      indent(choice) {
        return choice.role === "heading" ? "" : choice.editable ? " " : "  ";
      }
      async renderChoice(choice, i) {
        choice.indent = "";
        if (choice.editable) return form.renderChoice.call(this, choice, i);
        return super.renderChoice(choice, i);
      }
      error() {
        return "";
      }
      footer() {
        return this.state.error;
      }
      async validate() {
        let result = true;
        for (let choice of this.choices) {
          if (typeof choice.validate !== "function") {
            continue;
          }
          if (choice.role === "heading") {
            continue;
          }
          let val = choice.parent ? this.value[choice.parent.name] : this.value;
          if (choice.editable) {
            val = choice.value === choice.name ? choice.initial || "" : choice.value;
          } else if (!this.isDisabled(choice)) {
            val = choice.enabled === true;
          }
          result = await choice.validate(val, this.state);
          if (result !== true) {
            break;
          }
        }
        if (result !== true) {
          this.state.error = typeof result === "string" ? result : "Invalid Input";
        }
        return result;
      }
      submit() {
        if (this.focused.newChoice === true) return super.submit();
        if (this.choices.some((ch) => ch.newChoice)) {
          return this.alert();
        }
        this.value = {};
        for (let choice of this.choices) {
          let val = choice.parent ? this.value[choice.parent.name] : this.value;
          if (choice.role === "heading") {
            this.value[choice.name] = {};
            continue;
          }
          if (choice.editable) {
            val[choice.name] = choice.value === choice.name ? choice.initial || "" : choice.value;
          } else if (!this.isDisabled(choice)) {
            val[choice.name] = choice.enabled === true;
          }
        }
        return this.base.submit.call(this);
      }
    };
    module2.exports = Editable;
  }
});

// node_modules/enquirer/lib/types/string.js
var require_string2 = __commonJS({
  "node_modules/enquirer/lib/types/string.js"(exports2, module2) {
    "use strict";
    var Prompt = require_prompt();
    var placeholder = require_placeholder();
    var { isPrimitive } = require_utils2();
    var StringPrompt = class extends Prompt {
      constructor(options2) {
        super(options2);
        this.initial = isPrimitive(this.initial) ? String(this.initial) : "";
        if (this.initial) this.cursorHide();
        this.state.prevCursor = 0;
        this.state.clipboard = [];
      }
      async keypress(input, key = {}) {
        let prev = this.state.prevKeypress;
        this.state.prevKeypress = key;
        if (this.options.multiline === true && key.name === "return") {
          if (!prev || prev.name !== "return") {
            return this.append("\n", key);
          }
        }
        return super.keypress(input, key);
      }
      moveCursor(n) {
        this.cursor += n;
      }
      reset() {
        this.input = this.value = "";
        this.cursor = 0;
        return this.render();
      }
      dispatch(ch, key) {
        if (!ch || key.ctrl || key.code) return this.alert();
        this.append(ch);
      }
      append(ch) {
        let { cursor, input } = this.state;
        this.input = `${input}`.slice(0, cursor) + ch + `${input}`.slice(cursor);
        this.moveCursor(String(ch).length);
        this.render();
      }
      insert(str) {
        this.append(str);
      }
      delete() {
        let { cursor, input } = this.state;
        if (cursor <= 0) return this.alert();
        this.input = `${input}`.slice(0, cursor - 1) + `${input}`.slice(cursor);
        this.moveCursor(-1);
        this.render();
      }
      deleteForward() {
        let { cursor, input } = this.state;
        if (input[cursor] === void 0) return this.alert();
        this.input = `${input}`.slice(0, cursor) + `${input}`.slice(cursor + 1);
        this.render();
      }
      cutForward() {
        let pos = this.cursor;
        if (this.input.length <= pos) return this.alert();
        this.state.clipboard.push(this.input.slice(pos));
        this.input = this.input.slice(0, pos);
        this.render();
      }
      cutLeft() {
        let pos = this.cursor;
        if (pos === 0) return this.alert();
        let before = this.input.slice(0, pos);
        let after = this.input.slice(pos);
        let words = before.split(" ");
        this.state.clipboard.push(words.pop());
        this.input = words.join(" ");
        this.cursor = this.input.length;
        this.input += after;
        this.render();
      }
      paste() {
        if (!this.state.clipboard.length) return this.alert();
        this.insert(this.state.clipboard.pop());
        this.render();
      }
      toggleCursor() {
        if (this.state.prevCursor) {
          this.cursor = this.state.prevCursor;
          this.state.prevCursor = 0;
        } else {
          this.state.prevCursor = this.cursor;
          this.cursor = 0;
        }
        this.render();
      }
      first() {
        this.cursor = 0;
        this.render();
      }
      last() {
        this.cursor = this.input.length - 1;
        this.render();
      }
      next() {
        let init = this.initial != null ? String(this.initial) : "";
        if (!init || !init.startsWith(this.input)) return this.alert();
        this.input = this.initial;
        this.cursor = this.initial.length;
        this.render();
      }
      prev() {
        if (!this.input) return this.alert();
        this.reset();
      }
      backward() {
        return this.left();
      }
      forward() {
        return this.right();
      }
      right() {
        if (this.cursor >= this.input.length) return this.alert();
        this.moveCursor(1);
        return this.render();
      }
      left() {
        if (this.cursor <= 0) return this.alert();
        this.moveCursor(-1);
        return this.render();
      }
      isValue(value) {
        return !!value;
      }
      async format(input = this.value) {
        let initial = await this.resolve(this.initial, this.state);
        if (!this.state.submitted) {
          return placeholder(this, { input, initial, pos: this.cursor });
        }
        return this.styles.submitted(input || initial);
      }
      async render() {
        let size = this.state.size;
        let prefix = await this.prefix();
        let separator = await this.separator();
        let message = await this.message();
        let prompt = [prefix, message, separator].filter(Boolean).join(" ");
        this.state.prompt = prompt;
        let header = await this.header();
        let output = await this.format();
        let help = await this.error() || await this.hint();
        let footer = await this.footer();
        if (help && !output.includes(help)) output += " " + help;
        prompt += " " + output;
        this.clear(size);
        this.write([header, prompt, footer].filter(Boolean).join("\n"));
        this.restore();
      }
    };
    module2.exports = StringPrompt;
  }
});

// node_modules/enquirer/lib/completer.js
var require_completer = __commonJS({
  "node_modules/enquirer/lib/completer.js"(exports2, module2) {
    "use strict";
    var unique = (arr) => arr.filter((v, i) => arr.lastIndexOf(v) === i);
    var compact = (arr) => unique(arr).filter(Boolean);
    module2.exports = (action, data = {}, value = "") => {
      let { past = [], present = "" } = data;
      let rest, prev;
      switch (action) {
        case "prev":
        case "undo":
          rest = past.slice(0, past.length - 1);
          prev = past[past.length - 1] || "";
          return {
            past: compact([value, ...rest]),
            present: prev
          };
        case "next":
        case "redo":
          rest = past.slice(1);
          prev = past[0] || "";
          return {
            past: compact([...rest, value]),
            present: prev
          };
        case "save":
          return {
            past: compact([...past, value]),
            present: ""
          };
        case "remove":
          prev = compact(past.filter((v) => v !== value));
          present = "";
          if (prev.length) {
            present = prev.pop();
          }
          return {
            past: prev,
            present
          };
        default: {
          throw new Error(`Invalid action: "${action}"`);
        }
      }
    };
  }
});

// node_modules/enquirer/lib/prompts/input.js
var require_input = __commonJS({
  "node_modules/enquirer/lib/prompts/input.js"(exports2, module2) {
    "use strict";
    var Prompt = require_string2();
    var completer = require_completer();
    var Input = class extends Prompt {
      constructor(options2) {
        super(options2);
        let history = this.options.history;
        if (history && history.store) {
          let initial = history.values || this.initial;
          this.autosave = !!history.autosave;
          this.store = history.store;
          this.data = this.store.get("values") || { past: [], present: initial };
          this.initial = this.data.present || this.data.past[this.data.past.length - 1];
        }
      }
      completion(action) {
        if (!this.store) return this.alert();
        this.data = completer(action, this.data, this.input);
        if (!this.data.present) return this.alert();
        this.input = this.data.present;
        this.cursor = this.input.length;
        return this.render();
      }
      altUp() {
        return this.completion("prev");
      }
      altDown() {
        return this.completion("next");
      }
      prev() {
        this.save();
        return super.prev();
      }
      save() {
        if (!this.store) return;
        this.data = completer("save", this.data, this.input);
        this.store.set("values", this.data);
      }
      submit() {
        if (this.store && this.autosave === true) {
          this.save();
        }
        return super.submit();
      }
    };
    module2.exports = Input;
  }
});

// node_modules/enquirer/lib/prompts/invisible.js
var require_invisible = __commonJS({
  "node_modules/enquirer/lib/prompts/invisible.js"(exports2, module2) {
    "use strict";
    var StringPrompt = require_string2();
    var InvisiblePrompt = class extends StringPrompt {
      format() {
        return "";
      }
    };
    module2.exports = InvisiblePrompt;
  }
});

// node_modules/enquirer/lib/prompts/list.js
var require_list = __commonJS({
  "node_modules/enquirer/lib/prompts/list.js"(exports2, module2) {
    "use strict";
    var StringPrompt = require_string2();
    var ListPrompt = class extends StringPrompt {
      constructor(options2 = {}) {
        super(options2);
        this.sep = this.options.separator || /, */;
        this.initial = options2.initial || "";
      }
      split(input = this.value) {
        return input ? String(input).split(this.sep) : [];
      }
      format() {
        let style = this.state.submitted ? this.styles.primary : (val) => val;
        return this.list.map(style).join(", ");
      }
      async submit(value) {
        let result = this.state.error || await this.validate(this.list, this.state);
        if (result !== true) {
          this.state.error = result;
          return super.submit();
        }
        this.value = this.list;
        return super.submit();
      }
      get list() {
        return this.split();
      }
    };
    module2.exports = ListPrompt;
  }
});

// node_modules/enquirer/lib/prompts/multiselect.js
var require_multiselect = __commonJS({
  "node_modules/enquirer/lib/prompts/multiselect.js"(exports2, module2) {
    "use strict";
    var Select = require_select();
    var MultiSelect = class extends Select {
      constructor(options2) {
        super({ ...options2, multiple: true });
      }
    };
    module2.exports = MultiSelect;
  }
});

// node_modules/enquirer/lib/types/number.js
var require_number = __commonJS({
  "node_modules/enquirer/lib/types/number.js"(exports2, module2) {
    "use strict";
    var StringPrompt = require_string2();
    var NumberPrompt = class extends StringPrompt {
      constructor(options2 = {}) {
        super({ style: "number", ...options2 });
        this.min = this.isValue(options2.min) ? this.toNumber(options2.min) : -Infinity;
        this.max = this.isValue(options2.max) ? this.toNumber(options2.max) : Infinity;
        this.delay = options2.delay != null ? options2.delay : 1e3;
        this.float = options2.float !== false;
        this.round = options2.round === true || options2.float === false;
        this.major = options2.major || 10;
        this.minor = options2.minor || 1;
        this.initial = options2.initial != null ? options2.initial : "";
        this.input = String(this.initial);
        this.cursor = this.input.length;
        this.cursorShow();
      }
      append(ch) {
        if (!/[-+.]/.test(ch) || ch === "." && this.input.includes(".")) {
          return this.alert("invalid number");
        }
        return super.append(ch);
      }
      number(ch) {
        return super.append(ch);
      }
      next() {
        if (this.input && this.input !== this.initial) return this.alert();
        if (!this.isValue(this.initial)) return this.alert();
        this.input = this.initial;
        this.cursor = String(this.initial).length;
        return this.render();
      }
      up(number4) {
        let step = number4 || this.minor;
        let num = this.toNumber(this.input);
        if (num > this.max + step) return this.alert();
        this.input = `${num + step}`;
        return this.render();
      }
      down(number4) {
        let step = number4 || this.minor;
        let num = this.toNumber(this.input);
        if (num < this.min - step) return this.alert();
        this.input = `${num - step}`;
        return this.render();
      }
      shiftDown() {
        return this.down(this.major);
      }
      shiftUp() {
        return this.up(this.major);
      }
      format(input = this.input) {
        if (typeof this.options.format === "function") {
          return this.options.format.call(this, input);
        }
        return this.styles.info(input);
      }
      toNumber(value = "") {
        return this.float ? +value : Math.round(+value);
      }
      isValue(value) {
        return /^[-+]?[0-9]+((\.)|(\.[0-9]+))?$/.test(value);
      }
      submit() {
        let value = [this.input, this.initial].find((v) => this.isValue(v));
        this.value = this.toNumber(value || 0);
        return super.submit();
      }
    };
    module2.exports = NumberPrompt;
  }
});

// node_modules/enquirer/lib/prompts/numeral.js
var require_numeral = __commonJS({
  "node_modules/enquirer/lib/prompts/numeral.js"(exports2, module2) {
    module2.exports = require_number();
  }
});

// node_modules/enquirer/lib/prompts/password.js
var require_password = __commonJS({
  "node_modules/enquirer/lib/prompts/password.js"(exports2, module2) {
    "use strict";
    var StringPrompt = require_string2();
    var PasswordPrompt = class extends StringPrompt {
      constructor(options2) {
        super(options2);
        this.cursorShow();
      }
      format(input = this.input) {
        if (!this.keypressed) return "";
        let color = this.state.submitted ? this.styles.primary : this.styles.muted;
        return color(this.symbols.asterisk.repeat(input.length));
      }
    };
    module2.exports = PasswordPrompt;
  }
});

// node_modules/enquirer/lib/prompts/scale.js
var require_scale = __commonJS({
  "node_modules/enquirer/lib/prompts/scale.js"(exports2, module2) {
    "use strict";
    var colors2 = require_ansi_colors();
    var ArrayPrompt = require_array();
    var utils = require_utils2();
    var LikertScale = class extends ArrayPrompt {
      constructor(options2 = {}) {
        super(options2);
        this.widths = [].concat(options2.messageWidth || 50);
        this.align = [].concat(options2.align || "left");
        this.linebreak = options2.linebreak || false;
        this.edgeLength = options2.edgeLength || 3;
        this.newline = options2.newline || "\n   ";
        let start = options2.startNumber || 1;
        if (typeof this.scale === "number") {
          this.scaleKey = false;
          this.scale = Array(this.scale).fill(0).map((v, i) => ({ name: i + start }));
        }
      }
      async reset() {
        this.tableized = false;
        await super.reset();
        return this.render();
      }
      tableize() {
        if (this.tableized === true) return;
        this.tableized = true;
        let longest = 0;
        for (let ch of this.choices) {
          longest = Math.max(longest, ch.message.length);
          ch.scaleIndex = ch.initial || 2;
          ch.scale = [];
          for (let i = 0; i < this.scale.length; i++) {
            ch.scale.push({ index: i });
          }
        }
        this.widths[0] = Math.min(this.widths[0], longest + 3);
      }
      async dispatch(s, key) {
        if (this.multiple) {
          return this[key.name] ? await this[key.name](s, key) : await super.dispatch(s, key);
        }
        this.alert();
      }
      heading(msg, item, i) {
        return this.styles.strong(msg);
      }
      separator() {
        return this.styles.muted(this.symbols.ellipsis);
      }
      right() {
        let choice = this.focused;
        if (choice.scaleIndex >= this.scale.length - 1) return this.alert();
        choice.scaleIndex++;
        return this.render();
      }
      left() {
        let choice = this.focused;
        if (choice.scaleIndex <= 0) return this.alert();
        choice.scaleIndex--;
        return this.render();
      }
      indent() {
        return "";
      }
      format() {
        if (this.state.submitted) {
          let values = this.choices.map((ch) => this.styles.info(ch.index));
          return values.join(", ");
        }
        return "";
      }
      pointer() {
        return "";
      }
      /**
       * Render the scale "Key". Something like:
       * @return {String}
       */
      renderScaleKey() {
        if (this.scaleKey === false) return "";
        if (this.state.submitted) return "";
        let scale = this.scale.map((item) => `   ${item.name} - ${item.message}`);
        let key = ["", ...scale].map((item) => this.styles.muted(item));
        return key.join("\n");
      }
      /**
       * Render the heading row for the scale.
       * @return {String}
       */
      renderScaleHeading(max) {
        let keys = this.scale.map((ele) => ele.name);
        if (typeof this.options.renderScaleHeading === "function") {
          keys = this.options.renderScaleHeading.call(this, max);
        }
        let diff2 = this.scaleLength - keys.join("").length;
        let spacing = Math.round(diff2 / (keys.length - 1));
        let names = keys.map((key) => this.styles.strong(key));
        let headings = names.join(" ".repeat(spacing));
        let padding = " ".repeat(this.widths[0]);
        return this.margin[3] + padding + this.margin[1] + headings;
      }
      /**
       * Render a scale indicator => â—¯ or â—‰ by default
       */
      scaleIndicator(choice, item, i) {
        if (typeof this.options.scaleIndicator === "function") {
          return this.options.scaleIndicator.call(this, choice, item, i);
        }
        let enabled = choice.scaleIndex === item.index;
        if (item.disabled) return this.styles.hint(this.symbols.radio.disabled);
        if (enabled) return this.styles.success(this.symbols.radio.on);
        return this.symbols.radio.off;
      }
      /**
       * Render the actual scale => â—¯â”€â”€â”€â”€â—¯â”€â”€â”€â”€â—‰â”€â”€â”€â”€â—¯â”€â”€â”€â”€â—¯
       */
      renderScale(choice, i) {
        let scale = choice.scale.map((item) => this.scaleIndicator(choice, item, i));
        let padding = this.term === "Hyper" ? "" : " ";
        return scale.join(padding + this.symbols.line.repeat(this.edgeLength));
      }
      /**
       * Render a choice, including scale =>
       *   "The website is easy to navigate. â—¯â”€â”€â”€â—¯â”€â”€â”€â—‰â”€â”€â”€â—¯â”€â”€â”€â—¯"
       */
      async renderChoice(choice, i) {
        await this.onChoice(choice, i);
        let focused = this.index === i;
        let pointer = await this.pointer(choice, i);
        let hint = await choice.hint;
        if (hint && !utils.hasColor(hint)) {
          hint = this.styles.muted(hint);
        }
        let pad = (str) => this.margin[3] + str.replace(/\s+$/, "").padEnd(this.widths[0], " ");
        let newline = this.newline;
        let ind = this.indent(choice);
        let message = await this.resolve(choice.message, this.state, choice, i);
        let scale = await this.renderScale(choice, i);
        let margin = this.margin[1] + this.margin[3];
        this.scaleLength = colors2.unstyle(scale).length;
        this.widths[0] = Math.min(this.widths[0], this.width - this.scaleLength - margin.length);
        let msg = utils.wordWrap(message, { width: this.widths[0], newline });
        let lines = msg.split("\n").map((line) => pad(line) + this.margin[1]);
        if (focused) {
          scale = this.styles.info(scale);
          lines = lines.map((line) => this.styles.info(line));
        }
        lines[0] += scale;
        if (this.linebreak) lines.push("");
        return [ind + pointer, lines.join("\n")].filter(Boolean);
      }
      async renderChoices() {
        if (this.state.submitted) return "";
        this.tableize();
        let choices = this.visible.map(async (ch, i) => await this.renderChoice(ch, i));
        let visible = await Promise.all(choices);
        let heading = await this.renderScaleHeading();
        return this.margin[0] + [heading, ...visible.map((v) => v.join(" "))].join("\n");
      }
      async render() {
        let { submitted, size } = this.state;
        let prefix = await this.prefix();
        let separator = await this.separator();
        let message = await this.message();
        let prompt = "";
        if (this.options.promptLine !== false) {
          prompt = [prefix, message, separator, ""].join(" ");
          this.state.prompt = prompt;
        }
        let header = await this.header();
        let output = await this.format();
        let key = await this.renderScaleKey();
        let help = await this.error() || await this.hint();
        let body = await this.renderChoices();
        let footer = await this.footer();
        let err = this.emptyError;
        if (output) prompt += output;
        if (help && !prompt.includes(help)) prompt += " " + help;
        if (submitted && !output && !body.trim() && this.multiple && err != null) {
          prompt += this.styles.danger(err);
        }
        this.clear(size);
        this.write([header, prompt, key, body, footer].filter(Boolean).join("\n"));
        if (!this.state.submitted) {
          this.write(this.margin[2]);
        }
        this.restore();
      }
      submit() {
        this.value = {};
        for (let choice of this.choices) {
          this.value[choice.name] = choice.scaleIndex;
        }
        return this.base.submit.call(this);
      }
    };
    module2.exports = LikertScale;
  }
});

// node_modules/enquirer/lib/interpolate.js
var require_interpolate = __commonJS({
  "node_modules/enquirer/lib/interpolate.js"(exports2, module2) {
    "use strict";
    var colors2 = require_ansi_colors();
    var clean = (str = "") => {
      return typeof str === "string" ? str.replace(/^['"]|['"]$/g, "") : "";
    };
    var Item = class {
      constructor(token) {
        this.name = token.key;
        this.field = token.field || {};
        this.value = clean(token.initial || this.field.initial || "");
        this.message = token.message || this.name;
        this.cursor = 0;
        this.input = "";
        this.lines = [];
      }
    };
    var tokenize2 = async (options2 = {}, defaults = {}, fn = (token) => token) => {
      let unique = /* @__PURE__ */ new Set();
      let fields = options2.fields || [];
      let input = options2.template;
      let tabstops = [];
      let items = [];
      let keys = [];
      let line = 1;
      if (typeof input === "function") {
        input = await input();
      }
      let i = -1;
      let next = () => input[++i];
      let peek = () => input[i + 1];
      let push = (token) => {
        token.line = line;
        tabstops.push(token);
      };
      push({ type: "bos", value: "" });
      while (i < input.length - 1) {
        let value = next();
        if (/^[^\S\n ]$/.test(value)) {
          push({ type: "text", value });
          continue;
        }
        if (value === "\n") {
          push({ type: "newline", value });
          line++;
          continue;
        }
        if (value === "\\") {
          value += next();
          push({ type: "text", value });
          continue;
        }
        if ((value === "$" || value === "#" || value === "{") && peek() === "{") {
          let n = next();
          value += n;
          let token = { type: "template", open: value, inner: "", close: "", value };
          let ch;
          while (ch = next()) {
            if (ch === "}") {
              if (peek() === "}") ch += next();
              token.value += ch;
              token.close = ch;
              break;
            }
            if (ch === ":") {
              token.initial = "";
              token.key = token.inner;
            } else if (token.initial !== void 0) {
              token.initial += ch;
            }
            token.value += ch;
            token.inner += ch;
          }
          token.template = token.open + (token.initial || token.inner) + token.close;
          token.key = token.key || token.inner;
          if (defaults.hasOwnProperty(token.key)) {
            token.initial = defaults[token.key];
          }
          token = fn(token);
          push(token);
          keys.push(token.key);
          unique.add(token.key);
          let item = items.find((item2) => item2.name === token.key);
          token.field = fields.find((ch2) => ch2.name === token.key);
          if (!item) {
            item = new Item(token);
            items.push(item);
          }
          item.lines.push(token.line - 1);
          continue;
        }
        let last = tabstops[tabstops.length - 1];
        if (last.type === "text" && last.line === line) {
          last.value += value;
        } else {
          push({ type: "text", value });
        }
      }
      push({ type: "eos", value: "" });
      return { input, tabstops, unique, keys, items };
    };
    module2.exports = async (prompt) => {
      let options2 = prompt.options;
      let required2 = new Set(options2.required === true ? [] : options2.required || []);
      let defaults = { ...options2.values, ...options2.initial };
      let { tabstops, items, keys } = await tokenize2(options2, defaults);
      let result = createFn("result", prompt, options2);
      let format = createFn("format", prompt, options2);
      let isValid2 = createFn("validate", prompt, options2, true);
      let isVal = prompt.isValue.bind(prompt);
      return async (state = {}, submitted = false) => {
        let index = 0;
        state.required = required2;
        state.items = items;
        state.keys = keys;
        state.output = "";
        let validate2 = async (value, state2, item, index2) => {
          let error48 = await isValid2(value, state2, item, index2);
          if (error48 === false) {
            return "Invalid field " + item.name;
          }
          return error48;
        };
        for (let token of tabstops) {
          let value = token.value;
          let key = token.key;
          if (token.type !== "template") {
            if (value) state.output += value;
            continue;
          }
          if (token.type === "template") {
            let item = items.find((ch) => ch.name === key);
            if (options2.required === true) {
              state.required.add(item.name);
            }
            let val = [item.input, state.values[item.value], item.value, value].find(isVal);
            let field = item.field || {};
            let message = field.message || token.inner;
            if (submitted) {
              let error48 = await validate2(state.values[key], state, item, index);
              if (error48 && typeof error48 === "string" || error48 === false) {
                state.invalid.set(key, error48);
                continue;
              }
              state.invalid.delete(key);
              let res = await result(state.values[key], state, item, index);
              state.output += colors2.unstyle(res);
              continue;
            }
            item.placeholder = false;
            let before = value;
            value = await format(value, state, item, index);
            if (val !== value) {
              state.values[key] = val;
              value = prompt.styles.typing(val);
              state.missing.delete(message);
            } else {
              state.values[key] = void 0;
              val = `<${message}>`;
              value = prompt.styles.primary(val);
              item.placeholder = true;
              if (state.required.has(key)) {
                state.missing.add(message);
              }
            }
            if (state.missing.has(message) && state.validating) {
              value = prompt.styles.warning(val);
            }
            if (state.invalid.has(key) && state.validating) {
              value = prompt.styles.danger(val);
            }
            if (index === state.index) {
              if (before !== value) {
                value = prompt.styles.underline(value);
              } else {
                value = prompt.styles.heading(colors2.unstyle(value));
              }
            }
            index++;
          }
          if (value) {
            state.output += value;
          }
        }
        let lines = state.output.split("\n").map((l) => " " + l);
        let len = items.length;
        let done = 0;
        for (let item of items) {
          if (state.invalid.has(item.name)) {
            item.lines.forEach((i) => {
              if (lines[i][0] !== " ") return;
              lines[i] = state.styles.danger(state.symbols.bullet) + lines[i].slice(1);
            });
          }
          if (prompt.isValue(state.values[item.name])) {
            done++;
          }
        }
        state.completed = (done / len * 100).toFixed(0);
        state.output = lines.join("\n");
        return state.output;
      };
    };
    function createFn(prop, prompt, options2, fallback) {
      return (value, state, item, index) => {
        if (typeof item.field[prop] === "function") {
          return item.field[prop].call(prompt, value, state, item, index);
        }
        return [fallback, value].find((v) => prompt.isValue(v));
      };
    }
  }
});

// node_modules/enquirer/lib/prompts/snippet.js
var require_snippet = __commonJS({
  "node_modules/enquirer/lib/prompts/snippet.js"(exports2, module2) {
    "use strict";
    var colors2 = require_ansi_colors();
    var interpolate = require_interpolate();
    var Prompt = require_prompt();
    var SnippetPrompt = class extends Prompt {
      constructor(options2) {
        super(options2);
        this.cursorHide();
        this.reset(true);
      }
      async initialize() {
        this.interpolate = await interpolate(this);
        await super.initialize();
      }
      async reset(first) {
        this.state.keys = [];
        this.state.invalid = /* @__PURE__ */ new Map();
        this.state.missing = /* @__PURE__ */ new Set();
        this.state.completed = 0;
        this.state.values = {};
        if (first !== true) {
          await this.initialize();
          await this.render();
        }
      }
      moveCursor(n) {
        let item = this.getItem();
        this.cursor += n;
        item.cursor += n;
      }
      dispatch(ch, key) {
        if (!key.code && !key.ctrl && ch != null && this.getItem()) {
          this.append(ch, key);
          return;
        }
        this.alert();
      }
      append(ch, key) {
        let item = this.getItem();
        let prefix = item.input.slice(0, this.cursor);
        let suffix = item.input.slice(this.cursor);
        this.input = item.input = `${prefix}${ch}${suffix}`;
        this.moveCursor(1);
        this.render();
      }
      delete() {
        let item = this.getItem();
        if (this.cursor <= 0 || !item.input) return this.alert();
        let suffix = item.input.slice(this.cursor);
        let prefix = item.input.slice(0, this.cursor - 1);
        this.input = item.input = `${prefix}${suffix}`;
        this.moveCursor(-1);
        this.render();
      }
      increment(i) {
        return i >= this.state.keys.length - 1 ? 0 : i + 1;
      }
      decrement(i) {
        return i <= 0 ? this.state.keys.length - 1 : i - 1;
      }
      first() {
        this.state.index = 0;
        this.render();
      }
      last() {
        this.state.index = this.state.keys.length - 1;
        this.render();
      }
      right() {
        if (this.cursor >= this.input.length) return this.alert();
        this.moveCursor(1);
        this.render();
      }
      left() {
        if (this.cursor <= 0) return this.alert();
        this.moveCursor(-1);
        this.render();
      }
      prev() {
        this.state.index = this.decrement(this.state.index);
        this.getItem();
        this.render();
      }
      next() {
        this.state.index = this.increment(this.state.index);
        this.getItem();
        this.render();
      }
      up() {
        this.prev();
      }
      down() {
        this.next();
      }
      format(value) {
        let color = this.state.completed < 100 ? this.styles.warning : this.styles.success;
        if (this.state.submitted === true && this.state.completed !== 100) {
          color = this.styles.danger;
        }
        return color(`${this.state.completed}% completed`);
      }
      async render() {
        let { index, keys = [], submitted, size } = this.state;
        let newline = [this.options.newline, "\n"].find((v) => v != null);
        let prefix = await this.prefix();
        let separator = await this.separator();
        let message = await this.message();
        let prompt = [prefix, message, separator].filter(Boolean).join(" ");
        this.state.prompt = prompt;
        let header = await this.header();
        let error48 = await this.error() || "";
        let hint = await this.hint() || "";
        let body = submitted ? "" : await this.interpolate(this.state);
        let key = this.state.key = keys[index] || "";
        let input = await this.format(key);
        let footer = await this.footer();
        if (input) prompt += " " + input;
        if (hint && !input && this.state.completed === 0) prompt += " " + hint;
        this.clear(size);
        let lines = [header, prompt, body, footer, error48.trim()];
        this.write(lines.filter(Boolean).join(newline));
        this.restore();
      }
      getItem(name) {
        let { items, keys, index } = this.state;
        let item = items.find((ch) => ch.name === keys[index]);
        if (item && item.input != null) {
          this.input = item.input;
          this.cursor = item.cursor;
        }
        return item;
      }
      async submit() {
        if (typeof this.interpolate !== "function") await this.initialize();
        await this.interpolate(this.state, true);
        let { invalid, missing, output, values } = this.state;
        if (invalid.size) {
          let err = "";
          for (let [key, value] of invalid) err += `Invalid ${key}: ${value}
`;
          this.state.error = err;
          return super.submit();
        }
        if (missing.size) {
          this.state.error = "Required: " + [...missing.keys()].join(", ");
          return super.submit();
        }
        let lines = colors2.unstyle(output).split("\n");
        let result = lines.map((v) => v.slice(1)).join("\n");
        this.value = { values, result };
        return super.submit();
      }
    };
    module2.exports = SnippetPrompt;
  }
});

// node_modules/enquirer/lib/prompts/sort.js
var require_sort = __commonJS({
  "node_modules/enquirer/lib/prompts/sort.js"(exports2, module2) {
    "use strict";
    var hint = "(Use <shift>+<up/down> to sort)";
    var Prompt = require_select();
    var Sort = class extends Prompt {
      constructor(options2) {
        super({ ...options2, reorder: false, sort: true, multiple: true });
        this.state.hint = [this.options.hint, hint].find(this.isValue.bind(this));
      }
      indicator() {
        return "";
      }
      async renderChoice(choice, i) {
        let str = await super.renderChoice(choice, i);
        let sym = this.symbols.identicalTo + " ";
        let pre = this.index === i && this.sorting ? this.styles.muted(sym) : "  ";
        if (this.options.drag === false) pre = "";
        if (this.options.numbered === true) {
          return pre + `${i + 1} - ` + str;
        }
        return pre + str;
      }
      get selected() {
        return this.choices;
      }
      submit() {
        this.value = this.choices.map((choice) => choice.value);
        return super.submit();
      }
    };
    module2.exports = Sort;
  }
});

// node_modules/enquirer/lib/prompts/survey.js
var require_survey = __commonJS({
  "node_modules/enquirer/lib/prompts/survey.js"(exports2, module2) {
    "use strict";
    var ArrayPrompt = require_array();
    var Survey = class extends ArrayPrompt {
      constructor(options2 = {}) {
        super(options2);
        this.emptyError = options2.emptyError || "No items were selected";
        this.term = process.env.TERM_PROGRAM;
        if (!this.options.header) {
          let header = ["", "4 - Strongly Agree", "3 - Agree", "2 - Neutral", "1 - Disagree", "0 - Strongly Disagree", ""];
          header = header.map((ele) => this.styles.muted(ele));
          this.state.header = header.join("\n   ");
        }
      }
      async toChoices(...args) {
        if (this.createdScales) return false;
        this.createdScales = true;
        let choices = await super.toChoices(...args);
        for (let choice of choices) {
          choice.scale = createScale(5, this.options);
          choice.scaleIdx = 2;
        }
        return choices;
      }
      dispatch() {
        this.alert();
      }
      space() {
        let choice = this.focused;
        let ele = choice.scale[choice.scaleIdx];
        let selected = ele.selected;
        choice.scale.forEach((e) => e.selected = false);
        ele.selected = !selected;
        return this.render();
      }
      indicator() {
        return "";
      }
      pointer() {
        return "";
      }
      separator() {
        return this.styles.muted(this.symbols.ellipsis);
      }
      right() {
        let choice = this.focused;
        if (choice.scaleIdx >= choice.scale.length - 1) return this.alert();
        choice.scaleIdx++;
        return this.render();
      }
      left() {
        let choice = this.focused;
        if (choice.scaleIdx <= 0) return this.alert();
        choice.scaleIdx--;
        return this.render();
      }
      indent() {
        return "   ";
      }
      async renderChoice(item, i) {
        await this.onChoice(item, i);
        let focused = this.index === i;
        let isHyper = this.term === "Hyper";
        let n = !isHyper ? 8 : 9;
        let s = !isHyper ? " " : "";
        let ln = this.symbols.line.repeat(n);
        let sp = " ".repeat(n + (isHyper ? 0 : 1));
        let dot = (enabled) => (enabled ? this.styles.success("\u25C9") : "\u25EF") + s;
        let num = i + 1 + ".";
        let color = focused ? this.styles.heading : this.styles.noop;
        let msg = await this.resolve(item.message, this.state, item, i);
        let indent = this.indent(item);
        let scale = indent + item.scale.map((e, i2) => dot(i2 === item.scaleIdx)).join(ln);
        let val = (i2) => i2 === item.scaleIdx ? color(i2) : i2;
        let next = indent + item.scale.map((e, i2) => val(i2)).join(sp);
        let line = () => [num, msg].filter(Boolean).join(" ");
        let lines = () => [line(), scale, next, " "].filter(Boolean).join("\n");
        if (focused) {
          scale = this.styles.cyan(scale);
          next = this.styles.cyan(next);
        }
        return lines();
      }
      async renderChoices() {
        if (this.state.submitted) return "";
        let choices = this.visible.map(async (ch, i) => await this.renderChoice(ch, i));
        let visible = await Promise.all(choices);
        if (!visible.length) visible.push(this.styles.danger("No matching choices"));
        return visible.join("\n");
      }
      format() {
        if (this.state.submitted) {
          let values = this.choices.map((ch) => this.styles.info(ch.scaleIdx));
          return values.join(", ");
        }
        return "";
      }
      async render() {
        let { submitted, size } = this.state;
        let prefix = await this.prefix();
        let separator = await this.separator();
        let message = await this.message();
        let prompt = [prefix, message, separator].filter(Boolean).join(" ");
        this.state.prompt = prompt;
        let header = await this.header();
        let output = await this.format();
        let help = await this.error() || await this.hint();
        let body = await this.renderChoices();
        let footer = await this.footer();
        if (output || !help) prompt += " " + output;
        if (help && !prompt.includes(help)) prompt += " " + help;
        if (submitted && !output && !body && this.multiple && this.type !== "form") {
          prompt += this.styles.danger(this.emptyError);
        }
        this.clear(size);
        this.write([prompt, header, body, footer].filter(Boolean).join("\n"));
        this.restore();
      }
      submit() {
        this.value = {};
        for (let choice of this.choices) {
          this.value[choice.name] = choice.scaleIdx;
        }
        return this.base.submit.call(this);
      }
    };
    function createScale(n, options2 = {}) {
      if (Array.isArray(options2.scale)) {
        return options2.scale.map((ele) => ({ ...ele }));
      }
      let scale = [];
      for (let i = 1; i < n + 1; i++) scale.push({ i, selected: false });
      return scale;
    }
    module2.exports = Survey;
  }
});

// node_modules/enquirer/lib/prompts/text.js
var require_text = __commonJS({
  "node_modules/enquirer/lib/prompts/text.js"(exports2, module2) {
    module2.exports = require_input();
  }
});

// node_modules/enquirer/lib/prompts/toggle.js
var require_toggle = __commonJS({
  "node_modules/enquirer/lib/prompts/toggle.js"(exports2, module2) {
    "use strict";
    var BooleanPrompt = require_boolean();
    var TogglePrompt = class extends BooleanPrompt {
      async initialize() {
        await super.initialize();
        this.value = this.initial = !!this.options.initial;
        this.disabled = this.options.disabled || "no";
        this.enabled = this.options.enabled || "yes";
        await this.render();
      }
      reset() {
        this.value = this.initial;
        this.render();
      }
      delete() {
        this.alert();
      }
      toggle() {
        this.value = !this.value;
        this.render();
      }
      enable() {
        if (this.value === true) return this.alert();
        this.value = true;
        this.render();
      }
      disable() {
        if (this.value === false) return this.alert();
        this.value = false;
        this.render();
      }
      up() {
        this.toggle();
      }
      down() {
        this.toggle();
      }
      right() {
        this.toggle();
      }
      left() {
        this.toggle();
      }
      next() {
        this.toggle();
      }
      prev() {
        this.toggle();
      }
      dispatch(ch = "", key) {
        switch (ch.toLowerCase()) {
          case " ":
            return this.toggle();
          case "1":
          case "y":
          case "t":
            return this.enable();
          case "0":
          case "n":
          case "f":
            return this.disable();
          default: {
            return this.alert();
          }
        }
      }
      format() {
        let active = (str) => this.styles.primary.underline(str);
        let value = [
          this.value ? this.disabled : active(this.disabled),
          this.value ? active(this.enabled) : this.enabled
        ];
        return value.join(this.styles.muted(" / "));
      }
      async render() {
        let { size } = this.state;
        let header = await this.header();
        let prefix = await this.prefix();
        let separator = await this.separator();
        let message = await this.message();
        let output = await this.format();
        let help = await this.error() || await this.hint();
        let footer = await this.footer();
        let prompt = [prefix, message, separator, output].join(" ");
        this.state.prompt = prompt;
        if (help && !prompt.includes(help)) prompt += " " + help;
        this.clear(size);
        this.write([header, prompt, footer].filter(Boolean).join("\n"));
        this.write(this.margin[2]);
        this.restore();
      }
    };
    module2.exports = TogglePrompt;
  }
});

// node_modules/enquirer/lib/prompts/quiz.js
var require_quiz = __commonJS({
  "node_modules/enquirer/lib/prompts/quiz.js"(exports2, module2) {
    "use strict";
    var SelectPrompt = require_select();
    var Quiz = class extends SelectPrompt {
      constructor(options2) {
        super(options2);
        if (typeof this.options.correctChoice !== "number" || this.options.correctChoice < 0) {
          throw new Error("Please specify the index of the correct answer from the list of choices");
        }
      }
      async toChoices(value, parent) {
        let choices = await super.toChoices(value, parent);
        if (choices.length < 2) {
          throw new Error("Please give at least two choices to the user");
        }
        if (this.options.correctChoice > choices.length) {
          throw new Error("Please specify the index of the correct answer from the list of choices");
        }
        return choices;
      }
      check(state) {
        return state.index === this.options.correctChoice;
      }
      async result(selected) {
        return {
          selectedAnswer: selected,
          correctAnswer: this.options.choices[this.options.correctChoice].value,
          correct: await this.check(this.state)
        };
      }
    };
    module2.exports = Quiz;
  }
});

// node_modules/enquirer/lib/prompts/index.js
var require_prompts = __commonJS({
  "node_modules/enquirer/lib/prompts/index.js"(exports2) {
    "use strict";
    var utils = require_utils2();
    var define = (key, fn) => {
      utils.defineExport(exports2, key, fn);
      utils.defineExport(exports2, key.toLowerCase(), fn);
    };
    define("AutoComplete", () => require_autocomplete());
    define("BasicAuth", () => require_basicauth());
    define("Confirm", () => require_confirm());
    define("Editable", () => require_editable());
    define("Form", () => require_form());
    define("Input", () => require_input());
    define("Invisible", () => require_invisible());
    define("List", () => require_list());
    define("MultiSelect", () => require_multiselect());
    define("Numeral", () => require_numeral());
    define("Password", () => require_password());
    define("Scale", () => require_scale());
    define("Select", () => require_select());
    define("Snippet", () => require_snippet());
    define("Sort", () => require_sort());
    define("Survey", () => require_survey());
    define("Text", () => require_text());
    define("Toggle", () => require_toggle());
    define("Quiz", () => require_quiz());
  }
});

// node_modules/enquirer/lib/types/index.js
var require_types = __commonJS({
  "node_modules/enquirer/lib/types/index.js"(exports2, module2) {
    module2.exports = {
      ArrayPrompt: require_array(),
      AuthPrompt: require_auth(),
      BooleanPrompt: require_boolean(),
      NumberPrompt: require_number(),
      StringPrompt: require_string2()
    };
  }
});

// node_modules/enquirer/index.js
var require_enquirer = __commonJS({
  "node_modules/enquirer/index.js"(exports2, module2) {
    "use strict";
    var assert2 = require("assert");
    var Events = require("events");
    var utils = require_utils2();
    var Enquirer = class extends Events {
      constructor(options2, answers) {
        super();
        this.options = utils.merge({}, options2);
        this.answers = { ...answers };
      }
      /**
       * Register a custom prompt type.
       *
       * ```js
       * const Enquirer = require('enquirer');
       * const enquirer = new Enquirer();
       * enquirer.register('customType', require('./custom-prompt'));
       * ```
       * @name register()
       * @param {String} `type`
       * @param {Function|Prompt} `fn` `Prompt` class, or a function that returns a `Prompt` class.
       * @return {Object} Returns the Enquirer instance
       * @api public
       */
      register(type, fn) {
        if (utils.isObject(type)) {
          for (let key of Object.keys(type)) this.register(key, type[key]);
          return this;
        }
        assert2.equal(typeof fn, "function", "expected a function");
        let name = type.toLowerCase();
        if (fn.prototype instanceof this.Prompt) {
          this.prompts[name] = fn;
        } else {
          this.prompts[name] = fn(this.Prompt, this);
        }
        return this;
      }
      /**
       * Prompt function that takes a "question" object or array of question objects,
       * and returns an object with responses from the user.
       *
       * ```js
       * const Enquirer = require('enquirer');
       * const enquirer = new Enquirer();
       *
       * const response = await enquirer.prompt({
       *   type: 'input',
       *   name: 'username',
       *   message: 'What is your username?'
       * });
       * console.log(response);
       * ```
       * @name prompt()
       * @param {Array|Object} `questions` Options objects for one or more prompts to run.
       * @return {Promise} Promise that returns an "answers" object with the user's responses.
       * @api public
       */
      async prompt(questions = []) {
        for (let question of [].concat(questions)) {
          try {
            if (typeof question === "function") question = await question.call(this);
            await this.ask(utils.merge({}, this.options, question));
          } catch (err) {
            return Promise.reject(err);
          }
        }
        return this.answers;
      }
      async ask(question) {
        if (typeof question === "function") {
          question = await question.call(this);
        }
        let opts = utils.merge({}, this.options, question);
        let { type, name } = question;
        let { set: set2, get } = utils;
        if (typeof type === "function") {
          type = await type.call(this, question, this.answers);
        }
        if (!type) return this.answers[name];
        assert2(this.prompts[type], `Prompt "${type}" is not registered`);
        let prompt = new this.prompts[type](opts);
        let value = get(this.answers, name);
        prompt.state.answers = this.answers;
        prompt.enquirer = this;
        if (name) {
          prompt.on("submit", (value2) => {
            this.emit("answer", name, value2, prompt);
            set2(this.answers, name, value2);
          });
        }
        let emit = prompt.emit.bind(prompt);
        prompt.emit = (...args) => {
          this.emit.call(this, ...args);
          return emit(...args);
        };
        this.emit("prompt", prompt, this);
        if (opts.autofill && value != null) {
          prompt.value = prompt.input = value;
          if (opts.autofill === "show") {
            await prompt.submit();
          }
        } else {
          value = prompt.value = await prompt.run();
        }
        return value;
      }
      /**
       * Use an enquirer plugin.
       *
       * ```js
       * const Enquirer = require('enquirer');
       * const enquirer = new Enquirer();
       * const plugin = enquirer => {
       *   // do stuff to enquire instance
       * };
       * enquirer.use(plugin);
       * ```
       * @name use()
       * @param {Function} `plugin` Plugin function that takes an instance of Enquirer.
       * @return {Object} Returns the Enquirer instance.
       * @api public
       */
      use(plugin) {
        plugin.call(this, this);
        return this;
      }
      set Prompt(value) {
        this._Prompt = value;
      }
      get Prompt() {
        return this._Prompt || this.constructor.Prompt;
      }
      get prompts() {
        return this.constructor.prompts;
      }
      static set Prompt(value) {
        this._Prompt = value;
      }
      static get Prompt() {
        return this._Prompt || require_prompt();
      }
      static get prompts() {
        return require_prompts();
      }
      static get types() {
        return require_types();
      }
      /**
       * Prompt function that takes a "question" object or array of question objects,
       * and returns an object with responses from the user.
       *
       * ```js
       * const { prompt } = require('enquirer');
       * const response = await prompt({
       *   type: 'input',
       *   name: 'username',
       *   message: 'What is your username?'
       * });
       * console.log(response);
       * ```
       * @name Enquirer#prompt
       * @param {Array|Object} `questions` Options objects for one or more prompts to run.
       * @return {Promise} Promise that returns an "answers" object with the user's responses.
       * @api public
       */
      static get prompt() {
        const fn = (questions, ...rest) => {
          let enquirer2 = new this(...rest);
          let emit = enquirer2.emit.bind(enquirer2);
          enquirer2.emit = (...args) => {
            fn.emit(...args);
            return emit(...args);
          };
          return enquirer2.prompt(questions);
        };
        utils.mixinEmitter(fn, new Events());
        return fn;
      }
    };
    utils.mixinEmitter(Enquirer, new Events());
    var prompts = Enquirer.prompts;
    for (let name of Object.keys(prompts)) {
      let key = name.toLowerCase();
      let run = (options2) => new prompts[name](options2).run();
      Enquirer.prompt[key] = run;
      Enquirer[key] = run;
      if (!Enquirer[name]) {
        Reflect.defineProperty(Enquirer, name, { get: () => prompts[name] });
      }
    }
    var exp = (name) => {
      utils.defineExport(Enquirer, name, () => Enquirer.types[name]);
    };
    exp("ArrayPrompt");
    exp("AuthPrompt");
    exp("BooleanPrompt");
    exp("NumberPrompt");
    exp("StringPrompt");
    module2.exports = Enquirer;
  }
});

// node_modules/readdirp/node_modules/picomatch/lib/constants.js
var require_constants6 = __commonJS({
  "node_modules/readdirp/node_modules/picomatch/lib/constants.js"(exports2, module2) {
    "use strict";
    var path = require("path");
    var WIN_SLASH = "\\\\/";
    var WIN_NO_SLASH = `[^${WIN_SLASH}]`;
    var DEFAULT_MAX_EXTGLOB_RECURSION = 0;
    var DOT_LITERAL = "\\.";
    var PLUS_LITERAL = "\\+";
    var QMARK_LITERAL = "\\?";
    var SLASH_LITERAL = "\\/";
    var ONE_CHAR = "(?=.)";
    var QMARK = "[^/]";
    var END_ANCHOR = `(?:${SLASH_LITERAL}|$)`;
    var START_ANCHOR = `(?:^|${SLASH_LITERAL})`;
    var DOTS_SLASH = `${DOT_LITERAL}{1,2}${END_ANCHOR}`;
    var NO_DOT = `(?!${DOT_LITERAL})`;
    var NO_DOTS = `(?!${START_ANCHOR}${DOTS_SLASH})`;
    var NO_DOT_SLASH = `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`;
    var NO_DOTS_SLASH = `(?!${DOTS_SLASH})`;
    var QMARK_NO_DOT = `[^.${SLASH_LITERAL}]`;
    var STAR = `${QMARK}*?`;
    var POSIX_CHARS = {
      DOT_LITERAL,
      PLUS_LITERAL,
      QMARK_LITERAL,
      SLASH_LITERAL,
      ONE_CHAR,
      QMARK,
      END_ANCHOR,
      DOTS_SLASH,
      NO_DOT,
      NO_DOTS,
      NO_DOT_SLASH,
      NO_DOTS_SLASH,
      QMARK_NO_DOT,
      STAR,
      START_ANCHOR
    };
    var WINDOWS_CHARS = {
      ...POSIX_CHARS,
      SLASH_LITERAL: `[${WIN_SLASH}]`,
      QMARK: WIN_NO_SLASH,
      STAR: `${WIN_NO_SLASH}*?`,
      DOTS_SLASH: `${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$)`,
      NO_DOT: `(?!${DOT_LITERAL})`,
      NO_DOTS: `(?!(?:^|[${WIN_SLASH}])${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
      NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}(?:[${WIN_SLASH}]|$))`,
      NO_DOTS_SLASH: `(?!${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
      QMARK_NO_DOT: `[^.${WIN_SLASH}]`,
      START_ANCHOR: `(?:^|[${WIN_SLASH}])`,
      END_ANCHOR: `(?:[${WIN_SLASH}]|$)`
    };
    var POSIX_REGEX_SOURCE = {
      __proto__: null,
      alnum: "a-zA-Z0-9",
      alpha: "a-zA-Z",
      ascii: "\\x00-\\x7F",
      blank: " \\t",
      cntrl: "\\x00-\\x1F\\x7F",
      digit: "0-9",
      graph: "\\x21-\\x7E",
      lower: "a-z",
      print: "\\x20-\\x7E ",
      punct: "\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",
      space: " \\t\\r\\n\\v\\f",
      upper: "A-Z",
      word: "A-Za-z0-9_",
      xdigit: "A-Fa-f0-9"
    };
    module2.exports = {
      DEFAULT_MAX_EXTGLOB_RECURSION,
      MAX_LENGTH: 1024 * 64,
      POSIX_REGEX_SOURCE,
      // regular expressions
      REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g,
      REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/,
      REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/,
      REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g,
      REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g,
      REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g,
      // Replace globs with equivalent patterns to reduce parsing time.
      REPLACEMENTS: {
        __proto__: null,
        "***": "*",
        "**/**": "**",
        "**/**/**": "**"
      },
      // Digits
      CHAR_0: 48,
      /* 0 */
      CHAR_9: 57,
      /* 9 */
      // Alphabet chars.
      CHAR_UPPERCASE_A: 65,
      /* A */
      CHAR_LOWERCASE_A: 97,
      /* a */
      CHAR_UPPERCASE_Z: 90,
      /* Z */
      CHAR_LOWERCASE_Z: 122,
      /* z */
      CHAR_LEFT_PARENTHESES: 40,
      /* ( */
      CHAR_RIGHT_PARENTHESES: 41,
      /* ) */
      CHAR_ASTERISK: 42,
      /* * */
      // Non-alphabetic chars.
      CHAR_AMPERSAND: 38,
      /* & */
      CHAR_AT: 64,
      /* @ */
      CHAR_BACKWARD_SLASH: 92,
      /* \ */
      CHAR_CARRIAGE_RETURN: 13,
      /* \r */
      CHAR_CIRCUMFLEX_ACCENT: 94,
      /* ^ */
      CHAR_COLON: 58,
      /* : */
      CHAR_COMMA: 44,
      /* , */
      CHAR_DOT: 46,
      /* . */
      CHAR_DOUBLE_QUOTE: 34,
      /* " */
      CHAR_EQUAL: 61,
      /* = */
      CHAR_EXCLAMATION_MARK: 33,
      /* ! */
      CHAR_FORM_FEED: 12,
      /* \f */
      CHAR_FORWARD_SLASH: 47,
      /* / */
      CHAR_GRAVE_ACCENT: 96,
      /* ` */
      CHAR_HASH: 35,
      /* # */
      CHAR_HYPHEN_MINUS: 45,
      /* - */
      CHAR_LEFT_ANGLE_BRACKET: 60,
      /* < */
      CHAR_LEFT_CURLY_BRACE: 123,
      /* { */
      CHAR_LEFT_SQUARE_BRACKET: 91,
      /* [ */
      CHAR_LINE_FEED: 10,
      /* \n */
      CHAR_NO_BREAK_SPACE: 160,
      /* \u00A0 */
      CHAR_PERCENT: 37,
      /* % */
      CHAR_PLUS: 43,
      /* + */
      CHAR_QUESTION_MARK: 63,
      /* ? */
      CHAR_RIGHT_ANGLE_BRACKET: 62,
      /* > */
      CHAR_RIGHT_CURLY_BRACE: 125,
      /* } */
      CHAR_RIGHT_SQUARE_BRACKET: 93,
      /* ] */
      CHAR_SEMICOLON: 59,
      /* ; */
      CHAR_SINGLE_QUOTE: 39,
      /* ' */
      CHAR_SPACE: 32,
      /*   */
      CHAR_TAB: 9,
      /* \t */
      CHAR_UNDERSCORE: 95,
      /* _ */
      CHAR_VERTICAL_LINE: 124,
      /* | */
      CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279,
      /* \uFEFF */
      SEP: path.sep,
      /**
       * Create EXTGLOB_CHARS
       */
      extglobChars(chars) {
        return {
          "!": { type: "negate", open: "(?:(?!(?:", close: `))${chars.STAR})` },
          "?": { type: "qmark", open: "(?:", close: ")?" },
          "+": { type: "plus", open: "(?:", close: ")+" },
          "*": { type: "star", open: "(?:", close: ")*" },
          "@": { type: "at", open: "(?:", close: ")" }
        };
      },
      /**
       * Create GLOB_CHARS
       */
      globChars(win32) {
        return win32 === true ? WINDOWS_CHARS : POSIX_CHARS;
      }
    };
  }
});

// node_modules/readdirp/node_modules/picomatch/lib/utils.js
var require_utils3 = __commonJS({
  "node_modules/readdirp/node_modules/picomatch/lib/utils.js"(exports2) {
    "use strict";
    var path = require("path");
    var win32 = process.platform === "win32";
    var {
      REGEX_BACKSLASH,
      REGEX_REMOVE_BACKSLASH,
      REGEX_SPECIAL_CHARS,
      REGEX_SPECIAL_CHARS_GLOBAL
    } = require_constants6();
    exports2.isObject = (val) => val !== null && typeof val === "object" && !Array.isArray(val);
    exports2.hasRegexChars = (str) => REGEX_SPECIAL_CHARS.test(str);
    exports2.isRegexChar = (str) => str.length === 1 && exports2.hasRegexChars(str);
    exports2.escapeRegex = (str) => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, "\\$1");
    exports2.toPosixSlashes = (str) => str.replace(REGEX_BACKSLASH, "/");
    exports2.removeBackslashes = (str) => {
      return str.replace(REGEX_REMOVE_BACKSLASH, (match) => {
        return match === "\\" ? "" : match;
      });
    };
    exports2.supportsLookbehinds = () => {
      const segs = process.version.slice(1).split(".").map(Number);
      if (segs.length === 3 && segs[0] >= 9 || segs[0] === 8 && segs[1] >= 10) {
        return true;
      }
      return false;
    };
    exports2.isWindows = (options2) => {
      if (options2 && typeof options2.windows === "boolean") {
        return options2.windows;
      }
      return win32 === true || path.sep === "\\";
    };
    exports2.escapeLast = (input, char, lastIdx) => {
      const idx = input.lastIndexOf(char, lastIdx);
      if (idx === -1) return input;
      if (input[idx - 1] === "\\") return exports2.escapeLast(input, char, idx - 1);
      return `${input.slice(0, idx)}\\${input.slice(idx)}`;
    };
    exports2.removePrefix = (input, state = {}) => {
      let output = input;
      if (output.startsWith("./")) {
        output = output.slice(2);
        state.prefix = "./";
      }
      return output;
    };
    exports2.wrapOutput = (input, state = {}, options2 = {}) => {
      const prepend = options2.contains ? "" : "^";
      const append = options2.contains ? "" : "$";
      let output = `${prepend}(?:${input})${append}`;
      if (state.negated === true) {
        output = `(?:^(?!${output}).*$)`;
      }
      return output;
    };
  }
});

// node_modules/readdirp/node_modules/picomatch/lib/scan.js
var require_scan = __commonJS({
  "node_modules/readdirp/node_modules/picomatch/lib/scan.js"(exports2, module2) {
    "use strict";
    var utils = require_utils3();
    var {
      CHAR_ASTERISK,
      /* * */
      CHAR_AT,
      /* @ */
      CHAR_BACKWARD_SLASH,
      /* \ */
      CHAR_COMMA,
      /* , */
      CHAR_DOT,
      /* . */
      CHAR_EXCLAMATION_MARK,
      /* ! */
      CHAR_FORWARD_SLASH,
      /* / */
      CHAR_LEFT_CURLY_BRACE,
      /* { */
      CHAR_LEFT_PARENTHESES,
      /* ( */
      CHAR_LEFT_SQUARE_BRACKET,
      /* [ */
      CHAR_PLUS,
      /* + */
      CHAR_QUESTION_MARK,
      /* ? */
      CHAR_RIGHT_CURLY_BRACE,
      /* } */
      CHAR_RIGHT_PARENTHESES,
      /* ) */
      CHAR_RIGHT_SQUARE_BRACKET
      /* ] */
    } = require_constants6();
    var isPathSeparator = (code) => {
      return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH;
    };
    var depth = (token) => {
      if (token.isPrefix !== true) {
        token.depth = token.isGlobstar ? Infinity : 1;
      }
    };
    var scan = (input, options2) => {
      const opts = options2 || {};
      const length = input.length - 1;
      const scanToEnd = opts.parts === true || opts.scanToEnd === true;
      const slashes = [];
      const tokens = [];
      const parts = [];
      let str = input;
      let index = -1;
      let start = 0;
      let lastIndex = 0;
      let isBrace = false;
      let isBracket = false;
      let isGlob = false;
      let isExtglob = false;
      let isGlobstar = false;
      let braceEscaped = false;
      let backslashes = false;
      let negated = false;
      let negatedExtglob = false;
      let finished = false;
      let braces = 0;
      let prev;
      let code;
      let token = { value: "", depth: 0, isGlob: false };
      const eos = () => index >= length;
      const peek = () => str.charCodeAt(index + 1);
      const advance = () => {
        prev = code;
        return str.charCodeAt(++index);
      };
      while (index < length) {
        code = advance();
        let next;
        if (code === CHAR_BACKWARD_SLASH) {
          backslashes = token.backslashes = true;
          code = advance();
          if (code === CHAR_LEFT_CURLY_BRACE) {
            braceEscaped = true;
          }
          continue;
        }
        if (braceEscaped === true || code === CHAR_LEFT_CURLY_BRACE) {
          braces++;
          while (eos() !== true && (code = advance())) {
            if (code === CHAR_BACKWARD_SLASH) {
              backslashes = token.backslashes = true;
              advance();
              continue;
            }
            if (code === CHAR_LEFT_CURLY_BRACE) {
              braces++;
              continue;
            }
            if (braceEscaped !== true && code === CHAR_DOT && (code = advance()) === CHAR_DOT) {
              isBrace = token.isBrace = true;
              isGlob = token.isGlob = true;
              finished = true;
              if (scanToEnd === true) {
                continue;
              }
              break;
            }
            if (braceEscaped !== true && code === CHAR_COMMA) {
              isBrace = token.isBrace = true;
              isGlob = token.isGlob = true;
              finished = true;
              if (scanToEnd === true) {
                continue;
              }
              break;
            }
            if (code === CHAR_RIGHT_CURLY_BRACE) {
              braces--;
              if (braces === 0) {
                braceEscaped = false;
                isBrace = token.isBrace = true;
                finished = true;
                break;
              }
            }
          }
          if (scanToEnd === true) {
            continue;
          }
          break;
        }
        if (code === CHAR_FORWARD_SLASH) {
          slashes.push(index);
          tokens.push(token);
          token = { value: "", depth: 0, isGlob: false };
          if (finished === true) continue;
          if (prev === CHAR_DOT && index === start + 1) {
            start += 2;
            continue;
          }
          lastIndex = index + 1;
          continue;
        }
        if (opts.noext !== true) {
          const isExtglobChar = code === CHAR_PLUS || code === CHAR_AT || code === CHAR_ASTERISK || code === CHAR_QUESTION_MARK || code === CHAR_EXCLAMATION_MARK;
          if (isExtglobChar === true && peek() === CHAR_LEFT_PARENTHESES) {
            isGlob = token.isGlob = true;
            isExtglob = token.isExtglob = true;
            finished = true;
            if (code === CHAR_EXCLAMATION_MARK && index === start) {
              negatedExtglob = true;
            }
            if (scanToEnd === true) {
              while (eos() !== true && (code = advance())) {
                if (code === CHAR_BACKWARD_SLASH) {
                  backslashes = token.backslashes = true;
                  code = advance();
                  continue;
                }
                if (code === CHAR_RIGHT_PARENTHESES) {
                  isGlob = token.isGlob = true;
                  finished = true;
                  break;
                }
              }
              continue;
            }
            break;
          }
        }
        if (code === CHAR_ASTERISK) {
          if (prev === CHAR_ASTERISK) isGlobstar = token.isGlobstar = true;
          isGlob = token.isGlob = true;
          finished = true;
          if (scanToEnd === true) {
            continue;
          }
          break;
        }
        if (code === CHAR_QUESTION_MARK) {
          isGlob = token.isGlob = true;
          finished = true;
          if (scanToEnd === true) {
            continue;
          }
          break;
        }
        if (code === CHAR_LEFT_SQUARE_BRACKET) {
          while (eos() !== true && (next = advance())) {
            if (next === CHAR_BACKWARD_SLASH) {
              backslashes = token.backslashes = true;
              advance();
              continue;
            }
            if (next === CHAR_RIGHT_SQUARE_BRACKET) {
              isBracket = token.isBracket = true;
              isGlob = token.isGlob = true;
              finished = true;
              break;
            }
          }
          if (scanToEnd === true) {
            continue;
          }
          break;
        }
        if (opts.nonegate !== true && code === CHAR_EXCLAMATION_MARK && index === start) {
          negated = token.negated = true;
          start++;
          continue;
        }
        if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES) {
          isGlob = token.isGlob = true;
          if (scanToEnd === true) {
            while (eos() !== true && (code = advance())) {
              if (code === CHAR_LEFT_PARENTHESES) {
                backslashes = token.backslashes = true;
                code = advance();
                continue;
              }
              if (code === CHAR_RIGHT_PARENTHESES) {
                finished = true;
                break;
              }
            }
            continue;
          }
          break;
        }
        if (isGlob === true) {
          finished = true;
          if (scanToEnd === true) {
            continue;
          }
          break;
        }
      }
      if (opts.noext === true) {
        isExtglob = false;
        isGlob = false;
      }
      let base = str;
      let prefix = "";
      let glob = "";
      if (start > 0) {
        prefix = str.slice(0, start);
        str = str.slice(start);
        lastIndex -= start;
      }
      if (base && isGlob === true && lastIndex > 0) {
        base = str.slice(0, lastIndex);
        glob = str.slice(lastIndex);
      } else if (isGlob === true) {
        base = "";
        glob = str;
      } else {
        base = str;
      }
      if (base && base !== "" && base !== "/" && base !== str) {
        if (isPathSeparator(base.charCodeAt(base.length - 1))) {
          base = base.slice(0, -1);
        }
      }
      if (opts.unescape === true) {
        if (glob) glob = utils.removeBackslashes(glob);
        if (base && backslashes === true) {
          base = utils.removeBackslashes(base);
        }
      }
      const state = {
        prefix,
        input,
        start,
        base,
        glob,
        isBrace,
        isBracket,
        isGlob,
        isExtglob,
        isGlobstar,
        negated,
        negatedExtglob
      };
      if (opts.tokens === true) {
        state.maxDepth = 0;
        if (!isPathSeparator(code)) {
          tokens.push(token);
        }
        state.tokens = tokens;
      }
      if (opts.parts === true || opts.tokens === true) {
        let prevIndex;
        for (let idx = 0; idx < slashes.length; idx++) {
          const n = prevIndex ? prevIndex + 1 : start;
          const i = slashes[idx];
          const value = input.slice(n, i);
          if (opts.tokens) {
            if (idx === 0 && start !== 0) {
              tokens[idx].isPrefix = true;
              tokens[idx].value = prefix;
            } else {
              tokens[idx].value = value;
            }
            depth(tokens[idx]);
            state.maxDepth += tokens[idx].depth;
          }
          if (idx !== 0 || value !== "") {
            parts.push(value);
          }
          prevIndex = i;
        }
        if (prevIndex && prevIndex + 1 < input.length) {
          const value = input.slice(prevIndex + 1);
          parts.push(value);
          if (opts.tokens) {
            tokens[tokens.length - 1].value = value;
            depth(tokens[tokens.length - 1]);
            state.maxDepth += tokens[tokens.length - 1].depth;
          }
        }
        state.slashes = slashes;
        state.parts = parts;
      }
      return state;
    };
    module2.exports = scan;
  }
});

// node_modules/readdirp/node_modules/picomatch/lib/parse.js
var require_parse2 = __commonJS({
  "node_modules/readdirp/node_modules/picomatch/lib/parse.js"(exports2, module2) {
    "use strict";
    var constants = require_constants6();
    var utils = require_utils3();
    var {
      MAX_LENGTH,
      POSIX_REGEX_SOURCE,
      REGEX_NON_SPECIAL_CHARS,
      REGEX_SPECIAL_CHARS_BACKREF,
      REPLACEMENTS
    } = constants;
    var expandRange = (args, options2) => {
      if (typeof options2.expandRange === "function") {
        return options2.expandRange(...args, options2);
      }
      args.sort();
      const value = `[${args.join("-")}]`;
      try {
        new RegExp(value);
      } catch (ex) {
        return args.map((v) => utils.escapeRegex(v)).join("..");
      }
      return value;
    };
    var syntaxError2 = (type, char) => {
      return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`;
    };
    var splitTopLevel = (input) => {
      const parts = [];
      let bracket = 0;
      let paren = 0;
      let quote = 0;
      let value = "";
      let escaped = false;
      for (const ch of input) {
        if (escaped === true) {
          value += ch;
          escaped = false;
          continue;
        }
        if (ch === "\\") {
          value += ch;
          escaped = true;
          continue;
        }
        if (ch === '"') {
          quote = quote === 1 ? 0 : 1;
          value += ch;
          continue;
        }
        if (quote === 0) {
          if (ch === "[") {
            bracket++;
          } else if (ch === "]" && bracket > 0) {
            bracket--;
          } else if (bracket === 0) {
            if (ch === "(") {
              paren++;
            } else if (ch === ")" && paren > 0) {
              paren--;
            } else if (ch === "|" && paren === 0) {
              parts.push(value);
              value = "";
              continue;
            }
          }
        }
        value += ch;
      }
      parts.push(value);
      return parts;
    };
    var isPlainBranch = (branch) => {
      let escaped = false;
      for (const ch of branch) {
        if (escaped === true) {
          escaped = false;
          continue;
        }
        if (ch === "\\") {
          escaped = true;
          continue;
        }
        if (/[?*+@!()[\]{}]/.test(ch)) {
          return false;
        }
      }
      return true;
    };
    var normalizeSimpleBranch = (branch) => {
      let value = branch.trim();
      let changed = true;
      while (changed === true) {
        changed = false;
        if (/^@\([^\\()[\]{}|]+\)$/.test(value)) {
          value = value.slice(2, -1);
          changed = true;
        }
      }
      if (!isPlainBranch(value)) {
        return;
      }
      return value.replace(/\\(.)/g, "$1");
    };
    var hasRepeatedCharPrefixOverlap = (branches) => {
      const values = branches.map(normalizeSimpleBranch).filter(Boolean);
      for (let i = 0; i < values.length; i++) {
        for (let j = i + 1; j < values.length; j++) {
          const a = values[i];
          const b = values[j];
          const char = a[0];
          if (!char || a !== char.repeat(a.length) || b !== char.repeat(b.length)) {
            continue;
          }
          if (a === b || a.startsWith(b) || b.startsWith(a)) {
            return true;
          }
        }
      }
      return false;
    };
    var parseRepeatedExtglob = (pattern, requireEnd = true) => {
      if (pattern[0] !== "+" && pattern[0] !== "*" || pattern[1] !== "(") {
        return;
      }
      let bracket = 0;
      let paren = 0;
      let quote = 0;
      let escaped = false;
      for (let i = 1; i < pattern.length; i++) {
        const ch = pattern[i];
        if (escaped === true) {
          escaped = false;
          continue;
        }
        if (ch === "\\") {
          escaped = true;
          continue;
        }
        if (ch === '"') {
          quote = quote === 1 ? 0 : 1;
          continue;
        }
        if (quote === 1) {
          continue;
        }
        if (ch === "[") {
          bracket++;
          continue;
        }
        if (ch === "]" && bracket > 0) {
          bracket--;
          continue;
        }
        if (bracket > 0) {
          continue;
        }
        if (ch === "(") {
          paren++;
          continue;
        }
        if (ch === ")") {
          paren--;
          if (paren === 0) {
            if (requireEnd === true && i !== pattern.length - 1) {
              return;
            }
            return {
              type: pattern[0],
              body: pattern.slice(2, i),
              end: i
            };
          }
        }
      }
    };
    var getStarExtglobSequenceOutput = (pattern) => {
      let index = 0;
      const chars = [];
      while (index < pattern.length) {
        const match = parseRepeatedExtglob(pattern.slice(index), false);
        if (!match || match.type !== "*") {
          return;
        }
        const branches = splitTopLevel(match.body).map((branch2) => branch2.trim());
        if (branches.length !== 1) {
          return;
        }
        const branch = normalizeSimpleBranch(branches[0]);
        if (!branch || branch.length !== 1) {
          return;
        }
        chars.push(branch);
        index += match.end + 1;
      }
      if (chars.length < 1) {
        return;
      }
      const source = chars.length === 1 ? utils.escapeRegex(chars[0]) : `[${chars.map((ch) => utils.escapeRegex(ch)).join("")}]`;
      return `${source}*`;
    };
    var repeatedExtglobRecursion = (pattern) => {
      let depth = 0;
      let value = pattern.trim();
      let match = parseRepeatedExtglob(value);
      while (match) {
        depth++;
        value = match.body.trim();
        match = parseRepeatedExtglob(value);
      }
      return depth;
    };
    var analyzeRepeatedExtglob = (body, options2) => {
      if (options2.maxExtglobRecursion === false) {
        return { risky: false };
      }
      const max = typeof options2.maxExtglobRecursion === "number" ? options2.maxExtglobRecursion : constants.DEFAULT_MAX_EXTGLOB_RECURSION;
      const branches = splitTopLevel(body).map((branch) => branch.trim());
      if (branches.length > 1) {
        if (branches.some((branch) => branch === "") || branches.some((branch) => /^[*?]+$/.test(branch)) || hasRepeatedCharPrefixOverlap(branches)) {
          return { risky: true };
        }
      }
      for (const branch of branches) {
        const safeOutput = getStarExtglobSequenceOutput(branch);
        if (safeOutput) {
          return { risky: true, safeOutput };
        }
        if (repeatedExtglobRecursion(branch) > max) {
          return { risky: true };
        }
      }
      return { risky: false };
    };
    var parse3 = (input, options2) => {
      if (typeof input !== "string") {
        throw new TypeError("Expected a string");
      }
      input = REPLACEMENTS[input] || input;
      const opts = { ...options2 };
      const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
      let len = input.length;
      if (len > max) {
        throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
      }
      const bos = { type: "bos", value: "", output: opts.prepend || "" };
      const tokens = [bos];
      const capture = opts.capture ? "" : "?:";
      const win32 = utils.isWindows(options2);
      const PLATFORM_CHARS = constants.globChars(win32);
      const EXTGLOB_CHARS = constants.extglobChars(PLATFORM_CHARS);
      const {
        DOT_LITERAL,
        PLUS_LITERAL,
        SLASH_LITERAL,
        ONE_CHAR,
        DOTS_SLASH,
        NO_DOT,
        NO_DOT_SLASH,
        NO_DOTS_SLASH,
        QMARK,
        QMARK_NO_DOT,
        STAR,
        START_ANCHOR
      } = PLATFORM_CHARS;
      const globstar = (opts2) => {
        return `(${capture}(?:(?!${START_ANCHOR}${opts2.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
      };
      const nodot = opts.dot ? "" : NO_DOT;
      const qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT;
      let star = opts.bash === true ? globstar(opts) : STAR;
      if (opts.capture) {
        star = `(${star})`;
      }
      if (typeof opts.noext === "boolean") {
        opts.noextglob = opts.noext;
      }
      const state = {
        input,
        index: -1,
        start: 0,
        dot: opts.dot === true,
        consumed: "",
        output: "",
        prefix: "",
        backtrack: false,
        negated: false,
        brackets: 0,
        braces: 0,
        parens: 0,
        quotes: 0,
        globstar: false,
        tokens
      };
      input = utils.removePrefix(input, state);
      len = input.length;
      const extglobs = [];
      const braces = [];
      const stack = [];
      let prev = bos;
      let value;
      const eos = () => state.index === len - 1;
      const peek = state.peek = (n = 1) => input[state.index + n];
      const advance = state.advance = () => input[++state.index] || "";
      const remaining = () => input.slice(state.index + 1);
      const consume = (value2 = "", num = 0) => {
        state.consumed += value2;
        state.index += num;
      };
      const append = (token) => {
        state.output += token.output != null ? token.output : token.value;
        consume(token.value);
      };
      const negate = () => {
        let count = 1;
        while (peek() === "!" && (peek(2) !== "(" || peek(3) === "?")) {
          advance();
          state.start++;
          count++;
        }
        if (count % 2 === 0) {
          return false;
        }
        state.negated = true;
        state.start++;
        return true;
      };
      const increment = (type) => {
        state[type]++;
        stack.push(type);
      };
      const decrement = (type) => {
        state[type]--;
        stack.pop();
      };
      const push = (tok) => {
        if (prev.type === "globstar") {
          const isBrace = state.braces > 0 && (tok.type === "comma" || tok.type === "brace");
          const isExtglob = tok.extglob === true || extglobs.length && (tok.type === "pipe" || tok.type === "paren");
          if (tok.type !== "slash" && tok.type !== "paren" && !isBrace && !isExtglob) {
            state.output = state.output.slice(0, -prev.output.length);
            prev.type = "star";
            prev.value = "*";
            prev.output = star;
            state.output += prev.output;
          }
        }
        if (extglobs.length && tok.type !== "paren") {
          extglobs[extglobs.length - 1].inner += tok.value;
        }
        if (tok.value || tok.output) append(tok);
        if (prev && prev.type === "text" && tok.type === "text") {
          prev.value += tok.value;
          prev.output = (prev.output || "") + tok.value;
          return;
        }
        tok.prev = prev;
        tokens.push(tok);
        prev = tok;
      };
      const extglobOpen = (type, value2) => {
        const token = { ...EXTGLOB_CHARS[value2], conditions: 1, inner: "" };
        token.prev = prev;
        token.parens = state.parens;
        token.output = state.output;
        token.startIndex = state.index;
        token.tokensIndex = tokens.length;
        const output = (opts.capture ? "(" : "") + token.open;
        increment("parens");
        push({ type, value: value2, output: state.output ? "" : ONE_CHAR });
        push({ type: "paren", extglob: true, value: advance(), output });
        extglobs.push(token);
      };
      const extglobClose = (token) => {
        const literal2 = input.slice(token.startIndex, state.index + 1);
        const body = input.slice(token.startIndex + 2, state.index);
        const analysis = analyzeRepeatedExtglob(body, opts);
        if ((token.type === "plus" || token.type === "star") && analysis.risky) {
          const safeOutput = analysis.safeOutput ? (token.output ? "" : ONE_CHAR) + (opts.capture ? `(${analysis.safeOutput})` : analysis.safeOutput) : void 0;
          const open2 = tokens[token.tokensIndex];
          open2.type = "text";
          open2.value = literal2;
          open2.output = safeOutput || utils.escapeRegex(literal2);
          for (let i = token.tokensIndex + 1; i < tokens.length; i++) {
            tokens[i].value = "";
            tokens[i].output = "";
            delete tokens[i].suffix;
          }
          state.output = token.output + open2.output;
          state.backtrack = true;
          push({ type: "paren", extglob: true, value, output: "" });
          decrement("parens");
          return;
        }
        let output = token.close + (opts.capture ? ")" : "");
        let rest;
        if (token.type === "negate") {
          let extglobStar = star;
          if (token.inner && token.inner.length > 1 && token.inner.includes("/")) {
            extglobStar = globstar(opts);
          }
          if (extglobStar !== star || eos() || /^\)+$/.test(remaining())) {
            output = token.close = `)$))${extglobStar}`;
          }
          if (token.inner.includes("*") && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) {
            const expression = parse3(rest, { ...options2, fastpaths: false }).output;
            output = token.close = `)${expression})${extglobStar})`;
          }
          if (token.prev.type === "bos") {
            state.negatedExtglob = true;
          }
        }
        push({ type: "paren", extglob: true, value, output });
        decrement("parens");
      };
      if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input)) {
        let backslashes = false;
        let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc2, chars, first, rest, index) => {
          if (first === "\\") {
            backslashes = true;
            return m;
          }
          if (first === "?") {
            if (esc2) {
              return esc2 + first + (rest ? QMARK.repeat(rest.length) : "");
            }
            if (index === 0) {
              return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : "");
            }
            return QMARK.repeat(chars.length);
          }
          if (first === ".") {
            return DOT_LITERAL.repeat(chars.length);
          }
          if (first === "*") {
            if (esc2) {
              return esc2 + first + (rest ? star : "");
            }
            return star;
          }
          return esc2 ? m : `\\${m}`;
        });
        if (backslashes === true) {
          if (opts.unescape === true) {
            output = output.replace(/\\/g, "");
          } else {
            output = output.replace(/\\+/g, (m) => {
              return m.length % 2 === 0 ? "\\\\" : m ? "\\" : "";
            });
          }
        }
        if (output === input && opts.contains === true) {
          state.output = input;
          return state;
        }
        state.output = utils.wrapOutput(output, state, options2);
        return state;
      }
      while (!eos()) {
        value = advance();
        if (value === "\0") {
          continue;
        }
        if (value === "\\") {
          const next = peek();
          if (next === "/" && opts.bash !== true) {
            continue;
          }
          if (next === "." || next === ";") {
            continue;
          }
          if (!next) {
            value += "\\";
            push({ type: "text", value });
            continue;
          }
          const match = /^\\+/.exec(remaining());
          let slashes = 0;
          if (match && match[0].length > 2) {
            slashes = match[0].length;
            state.index += slashes;
            if (slashes % 2 !== 0) {
              value += "\\";
            }
          }
          if (opts.unescape === true) {
            value = advance();
          } else {
            value += advance();
          }
          if (state.brackets === 0) {
            push({ type: "text", value });
            continue;
          }
        }
        if (state.brackets > 0 && (value !== "]" || prev.value === "[" || prev.value === "[^")) {
          if (opts.posix !== false && value === ":") {
            const inner = prev.value.slice(1);
            if (inner.includes("[")) {
              prev.posix = true;
              if (inner.includes(":")) {
                const idx = prev.value.lastIndexOf("[");
                const pre = prev.value.slice(0, idx);
                const rest2 = prev.value.slice(idx + 2);
                const posix = POSIX_REGEX_SOURCE[rest2];
                if (posix) {
                  prev.value = pre + posix;
                  state.backtrack = true;
                  advance();
                  if (!bos.output && tokens.indexOf(prev) === 1) {
                    bos.output = ONE_CHAR;
                  }
                  continue;
                }
              }
            }
          }
          if (value === "[" && peek() !== ":" || value === "-" && peek() === "]") {
            value = `\\${value}`;
          }
          if (value === "]" && (prev.value === "[" || prev.value === "[^")) {
            value = `\\${value}`;
          }
          if (opts.posix === true && value === "!" && prev.value === "[") {
            value = "^";
          }
          prev.value += value;
          append({ value });
          continue;
        }
        if (state.quotes === 1 && value !== '"') {
          value = utils.escapeRegex(value);
          prev.value += value;
          append({ value });
          continue;
        }
        if (value === '"') {
          state.quotes = state.quotes === 1 ? 0 : 1;
          if (opts.keepQuotes === true) {
            push({ type: "text", value });
          }
          continue;
        }
        if (value === "(") {
          increment("parens");
          push({ type: "paren", value });
          continue;
        }
        if (value === ")") {
          if (state.parens === 0 && opts.strictBrackets === true) {
            throw new SyntaxError(syntaxError2("opening", "("));
          }
          const extglob = extglobs[extglobs.length - 1];
          if (extglob && state.parens === extglob.parens + 1) {
            extglobClose(extglobs.pop());
            continue;
          }
          push({ type: "paren", value, output: state.parens ? ")" : "\\)" });
          decrement("parens");
          continue;
        }
        if (value === "[") {
          if (opts.nobracket === true || !remaining().includes("]")) {
            if (opts.nobracket !== true && opts.strictBrackets === true) {
              throw new SyntaxError(syntaxError2("closing", "]"));
            }
            value = `\\${value}`;
          } else {
            increment("brackets");
          }
          push({ type: "bracket", value });
          continue;
        }
        if (value === "]") {
          if (opts.nobracket === true || prev && prev.type === "bracket" && prev.value.length === 1) {
            push({ type: "text", value, output: `\\${value}` });
            continue;
          }
          if (state.brackets === 0) {
            if (opts.strictBrackets === true) {
              throw new SyntaxError(syntaxError2("opening", "["));
            }
            push({ type: "text", value, output: `\\${value}` });
            continue;
          }
          decrement("brackets");
          const prevValue = prev.value.slice(1);
          if (prev.posix !== true && prevValue[0] === "^" && !prevValue.includes("/")) {
            value = `/${value}`;
          }
          prev.value += value;
          append({ value });
          if (opts.literalBrackets === false || utils.hasRegexChars(prevValue)) {
            continue;
          }
          const escaped = utils.escapeRegex(prev.value);
          state.output = state.output.slice(0, -prev.value.length);
          if (opts.literalBrackets === true) {
            state.output += escaped;
            prev.value = escaped;
            continue;
          }
          prev.value = `(${capture}${escaped}|${prev.value})`;
          state.output += prev.value;
          continue;
        }
        if (value === "{" && opts.nobrace !== true) {
          increment("braces");
          const open2 = {
            type: "brace",
            value,
            output: "(",
            outputIndex: state.output.length,
            tokensIndex: state.tokens.length
          };
          braces.push(open2);
          push(open2);
          continue;
        }
        if (value === "}") {
          const brace = braces[braces.length - 1];
          if (opts.nobrace === true || !brace) {
            push({ type: "text", value, output: value });
            continue;
          }
          let output = ")";
          if (brace.dots === true) {
            const arr = tokens.slice();
            const range = [];
            for (let i = arr.length - 1; i >= 0; i--) {
              tokens.pop();
              if (arr[i].type === "brace") {
                break;
              }
              if (arr[i].type !== "dots") {
                range.unshift(arr[i].value);
              }
            }
            output = expandRange(range, opts);
            state.backtrack = true;
          }
          if (brace.comma !== true && brace.dots !== true) {
            const out = state.output.slice(0, brace.outputIndex);
            const toks = state.tokens.slice(brace.tokensIndex);
            brace.value = brace.output = "\\{";
            value = output = "\\}";
            state.output = out;
            for (const t of toks) {
              state.output += t.output || t.value;
            }
          }
          push({ type: "brace", value, output });
          decrement("braces");
          braces.pop();
          continue;
        }
        if (value === "|") {
          if (extglobs.length > 0) {
            extglobs[extglobs.length - 1].conditions++;
          }
          push({ type: "text", value });
          continue;
        }
        if (value === ",") {
          let output = value;
          const brace = braces[braces.length - 1];
          if (brace && stack[stack.length - 1] === "braces") {
            brace.comma = true;
            output = "|";
          }
          push({ type: "comma", value, output });
          continue;
        }
        if (value === "/") {
          if (prev.type === "dot" && state.index === state.start + 1) {
            state.start = state.index + 1;
            state.consumed = "";
            state.output = "";
            tokens.pop();
            prev = bos;
            continue;
          }
          push({ type: "slash", value, output: SLASH_LITERAL });
          continue;
        }
        if (value === ".") {
          if (state.braces > 0 && prev.type === "dot") {
            if (prev.value === ".") prev.output = DOT_LITERAL;
            const brace = braces[braces.length - 1];
            prev.type = "dots";
            prev.output += value;
            prev.value += value;
            brace.dots = true;
            continue;
          }
          if (state.braces + state.parens === 0 && prev.type !== "bos" && prev.type !== "slash") {
            push({ type: "text", value, output: DOT_LITERAL });
            continue;
          }
          push({ type: "dot", value, output: DOT_LITERAL });
          continue;
        }
        if (value === "?") {
          const isGroup = prev && prev.value === "(";
          if (!isGroup && opts.noextglob !== true && peek() === "(" && peek(2) !== "?") {
            extglobOpen("qmark", value);
            continue;
          }
          if (prev && prev.type === "paren") {
            const next = peek();
            let output = value;
            if (next === "<" && !utils.supportsLookbehinds()) {
              throw new Error("Node.js v10 or higher is required for regex lookbehinds");
            }
            if (prev.value === "(" && !/[!=<:]/.test(next) || next === "<" && !/<([!=]|\w+>)/.test(remaining())) {
              output = `\\${value}`;
            }
            push({ type: "text", value, output });
            continue;
          }
          if (opts.dot !== true && (prev.type === "slash" || prev.type === "bos")) {
            push({ type: "qmark", value, output: QMARK_NO_DOT });
            continue;
          }
          push({ type: "qmark", value, output: QMARK });
          continue;
        }
        if (value === "!") {
          if (opts.noextglob !== true && peek() === "(") {
            if (peek(2) !== "?" || !/[!=<:]/.test(peek(3))) {
              extglobOpen("negate", value);
              continue;
            }
          }
          if (opts.nonegate !== true && state.index === 0) {
            negate();
            continue;
          }
        }
        if (value === "+") {
          if (opts.noextglob !== true && peek() === "(" && peek(2) !== "?") {
            extglobOpen("plus", value);
            continue;
          }
          if (prev && prev.value === "(" || opts.regex === false) {
            push({ type: "plus", value, output: PLUS_LITERAL });
            continue;
          }
          if (prev && (prev.type === "bracket" || prev.type === "paren" || prev.type === "brace") || state.parens > 0) {
            push({ type: "plus", value });
            continue;
          }
          push({ type: "plus", value: PLUS_LITERAL });
          continue;
        }
        if (value === "@") {
          if (opts.noextglob !== true && peek() === "(" && peek(2) !== "?") {
            push({ type: "at", extglob: true, value, output: "" });
            continue;
          }
          push({ type: "text", value });
          continue;
        }
        if (value !== "*") {
          if (value === "$" || value === "^") {
            value = `\\${value}`;
          }
          const match = REGEX_NON_SPECIAL_CHARS.exec(remaining());
          if (match) {
            value += match[0];
            state.index += match[0].length;
          }
          push({ type: "text", value });
          continue;
        }
        if (prev && (prev.type === "globstar" || prev.star === true)) {
          prev.type = "star";
          prev.star = true;
          prev.value += value;
          prev.output = star;
          state.backtrack = true;
          state.globstar = true;
          consume(value);
          continue;
        }
        let rest = remaining();
        if (opts.noextglob !== true && /^\([^?]/.test(rest)) {
          extglobOpen("star", value);
          continue;
        }
        if (prev.type === "star") {
          if (opts.noglobstar === true) {
            consume(value);
            continue;
          }
          const prior = prev.prev;
          const before = prior.prev;
          const isStart = prior.type === "slash" || prior.type === "bos";
          const afterStar = before && (before.type === "star" || before.type === "globstar");
          if (opts.bash === true && (!isStart || rest[0] && rest[0] !== "/")) {
            push({ type: "star", value, output: "" });
            continue;
          }
          const isBrace = state.braces > 0 && (prior.type === "comma" || prior.type === "brace");
          const isExtglob = extglobs.length && (prior.type === "pipe" || prior.type === "paren");
          if (!isStart && prior.type !== "paren" && !isBrace && !isExtglob) {
            push({ type: "star", value, output: "" });
            continue;
          }
          while (rest.slice(0, 3) === "/**") {
            const after = input[state.index + 4];
            if (after && after !== "/") {
              break;
            }
            rest = rest.slice(3);
            consume("/**", 3);
          }
          if (prior.type === "bos" && eos()) {
            prev.type = "globstar";
            prev.value += value;
            prev.output = globstar(opts);
            state.output = prev.output;
            state.globstar = true;
            consume(value);
            continue;
          }
          if (prior.type === "slash" && prior.prev.type !== "bos" && !afterStar && eos()) {
            state.output = state.output.slice(0, -(prior.output + prev.output).length);
            prior.output = `(?:${prior.output}`;
            prev.type = "globstar";
            prev.output = globstar(opts) + (opts.strictSlashes ? ")" : "|$)");
            prev.value += value;
            state.globstar = true;
            state.output += prior.output + prev.output;
            consume(value);
            continue;
          }
          if (prior.type === "slash" && prior.prev.type !== "bos" && rest[0] === "/") {
            const end = rest[1] !== void 0 ? "|$" : "";
            state.output = state.output.slice(0, -(prior.output + prev.output).length);
            prior.output = `(?:${prior.output}`;
            prev.type = "globstar";
            prev.output = `${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`;
            prev.value += value;
            state.output += prior.output + prev.output;
            state.globstar = true;
            consume(value + advance());
            push({ type: "slash", value: "/", output: "" });
            continue;
          }
          if (prior.type === "bos" && rest[0] === "/") {
            prev.type = "globstar";
            prev.value += value;
            prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`;
            state.output = prev.output;
            state.globstar = true;
            consume(value + advance());
            push({ type: "slash", value: "/", output: "" });
            continue;
          }
          state.output = state.output.slice(0, -prev.output.length);
          prev.type = "globstar";
          prev.output = globstar(opts);
          prev.value += value;
          state.output += prev.output;
          state.globstar = true;
          consume(value);
          continue;
        }
        const token = { type: "star", value, output: star };
        if (opts.bash === true) {
          token.output = ".*?";
          if (prev.type === "bos" || prev.type === "slash") {
            token.output = nodot + token.output;
          }
          push(token);
          continue;
        }
        if (prev && (prev.type === "bracket" || prev.type === "paren") && opts.regex === true) {
          token.output = value;
          push(token);
          continue;
        }
        if (state.index === state.start || prev.type === "slash" || prev.type === "dot") {
          if (prev.type === "dot") {
            state.output += NO_DOT_SLASH;
            prev.output += NO_DOT_SLASH;
          } else if (opts.dot === true) {
            state.output += NO_DOTS_SLASH;
            prev.output += NO_DOTS_SLASH;
          } else {
            state.output += nodot;
            prev.output += nodot;
          }
          if (peek() !== "*") {
            state.output += ONE_CHAR;
            prev.output += ONE_CHAR;
          }
        }
        push(token);
      }
      while (state.brackets > 0) {
        if (opts.strictBrackets === true) throw new SyntaxError(syntaxError2("closing", "]"));
        state.output = utils.escapeLast(state.output, "[");
        decrement("brackets");
      }
      while (state.parens > 0) {
        if (opts.strictBrackets === true) throw new SyntaxError(syntaxError2("closing", ")"));
        state.output = utils.escapeLast(state.output, "(");
        decrement("parens");
      }
      while (state.braces > 0) {
        if (opts.strictBrackets === true) throw new SyntaxError(syntaxError2("closing", "}"));
        state.output = utils.escapeLast(state.output, "{");
        decrement("braces");
      }
      if (opts.strictSlashes !== true && (prev.type === "star" || prev.type === "bracket")) {
        push({ type: "maybe_slash", value: "", output: `${SLASH_LITERAL}?` });
      }
      if (state.backtrack === true) {
        state.output = "";
        for (const token of state.tokens) {
          state.output += token.output != null ? token.output : token.value;
          if (token.suffix) {
            state.output += token.suffix;
          }
        }
      }
      return state;
    };
    parse3.fastpaths = (input, options2) => {
      const opts = { ...options2 };
      const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
      const len = input.length;
      if (len > max) {
        throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
      }
      input = REPLACEMENTS[input] || input;
      const win32 = utils.isWindows(options2);
      const {
        DOT_LITERAL,
        SLASH_LITERAL,
        ONE_CHAR,
        DOTS_SLASH,
        NO_DOT,
        NO_DOTS,
        NO_DOTS_SLASH,
        STAR,
        START_ANCHOR
      } = constants.globChars(win32);
      const nodot = opts.dot ? NO_DOTS : NO_DOT;
      const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT;
      const capture = opts.capture ? "" : "?:";
      const state = { negated: false, prefix: "" };
      let star = opts.bash === true ? ".*?" : STAR;
      if (opts.capture) {
        star = `(${star})`;
      }
      const globstar = (opts2) => {
        if (opts2.noglobstar === true) return star;
        return `(${capture}(?:(?!${START_ANCHOR}${opts2.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
      };
      const create = (str) => {
        switch (str) {
          case "*":
            return `${nodot}${ONE_CHAR}${star}`;
          case ".*":
            return `${DOT_LITERAL}${ONE_CHAR}${star}`;
          case "*.*":
            return `${nodot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
          case "*/*":
            return `${nodot}${star}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star}`;
          case "**":
            return nodot + globstar(opts);
          case "**/*":
            return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star}`;
          case "**/*.*":
            return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
          case "**/.*":
            return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`;
          default: {
            const match = /^(.*?)\.(\w+)$/.exec(str);
            if (!match) return;
            const source2 = create(match[1]);
            if (!source2) return;
            return source2 + DOT_LITERAL + match[2];
          }
        }
      };
      const output = utils.removePrefix(input, state);
      let source = create(output);
      if (source && opts.strictSlashes !== true) {
        source += `${SLASH_LITERAL}?`;
      }
      return source;
    };
    module2.exports = parse3;
  }
});

// node_modules/readdirp/node_modules/picomatch/lib/picomatch.js
var require_picomatch = __commonJS({
  "node_modules/readdirp/node_modules/picomatch/lib/picomatch.js"(exports2, module2) {
    "use strict";
    var path = require("path");
    var scan = require_scan();
    var parse3 = require_parse2();
    var utils = require_utils3();
    var constants = require_constants6();
    var isObject2 = (val) => val && typeof val === "object" && !Array.isArray(val);
    var picomatch = (glob, options2, returnState = false) => {
      if (Array.isArray(glob)) {
        const fns = glob.map((input) => picomatch(input, options2, returnState));
        const arrayMatcher = (str) => {
          for (const isMatch of fns) {
            const state2 = isMatch(str);
            if (state2) return state2;
          }
          return false;
        };
        return arrayMatcher;
      }
      const isState = isObject2(glob) && glob.tokens && glob.input;
      if (glob === "" || typeof glob !== "string" && !isState) {
        throw new TypeError("Expected pattern to be a non-empty string");
      }
      const opts = options2 || {};
      const posix = utils.isWindows(options2);
      const regex = isState ? picomatch.compileRe(glob, options2) : picomatch.makeRe(glob, options2, false, true);
      const state = regex.state;
      delete regex.state;
      let isIgnored = () => false;
      if (opts.ignore) {
        const ignoreOpts = { ...options2, ignore: null, onMatch: null, onResult: null };
        isIgnored = picomatch(opts.ignore, ignoreOpts, returnState);
      }
      const matcher = (input, returnObject = false) => {
        const { isMatch, match, output } = picomatch.test(input, regex, options2, { glob, posix });
        const result = { glob, state, regex, posix, input, output, match, isMatch };
        if (typeof opts.onResult === "function") {
          opts.onResult(result);
        }
        if (isMatch === false) {
          result.isMatch = false;
          return returnObject ? result : false;
        }
        if (isIgnored(input)) {
          if (typeof opts.onIgnore === "function") {
            opts.onIgnore(result);
          }
          result.isMatch = false;
          return returnObject ? result : false;
        }
        if (typeof opts.onMatch === "function") {
          opts.onMatch(result);
        }
        return returnObject ? result : true;
      };
      if (returnState) {
        matcher.state = state;
      }
      return matcher;
    };
    picomatch.test = (input, regex, options2, { glob, posix } = {}) => {
      if (typeof input !== "string") {
        throw new TypeError("Expected input to be a string");
      }
      if (input === "") {
        return { isMatch: false, output: "" };
      }
      const opts = options2 || {};
      const format = opts.format || (posix ? utils.toPosixSlashes : null);
      let match = input === glob;
      let output = match && format ? format(input) : input;
      if (match === false) {
        output = format ? format(input) : input;
        match = output === glob;
      }
      if (match === false || opts.capture === true) {
        if (opts.matchBase === true || opts.basename === true) {
          match = picomatch.matchBase(input, regex, options2, posix);
        } else {
          match = regex.exec(output);
        }
      }
      return { isMatch: Boolean(match), match, output };
    };
    picomatch.matchBase = (input, glob, options2, posix = utils.isWindows(options2)) => {
      const regex = glob instanceof RegExp ? glob : picomatch.makeRe(glob, options2);
      return regex.test(path.basename(input));
    };
    picomatch.isMatch = (str, patterns, options2) => picomatch(patterns, options2)(str);
    picomatch.parse = (pattern, options2) => {
      if (Array.isArray(pattern)) return pattern.map((p) => picomatch.parse(p, options2));
      return parse3(pattern, { ...options2, fastpaths: false });
    };
    picomatch.scan = (input, options2) => scan(input, options2);
    picomatch.compileRe = (state, options2, returnOutput = false, returnState = false) => {
      if (returnOutput === true) {
        return state.output;
      }
      const opts = options2 || {};
      const prepend = opts.contains ? "" : "^";
      const append = opts.contains ? "" : "$";
      let source = `${prepend}(?:${state.output})${append}`;
      if (state && state.negated === true) {
        source = `^(?!${source}).*$`;
      }
      const regex = picomatch.toRegex(source, options2);
      if (returnState === true) {
        regex.state = state;
      }
      return regex;
    };
    picomatch.makeRe = (input, options2 = {}, returnOutput = false, returnState = false) => {
      if (!input || typeof input !== "string") {
        throw new TypeError("Expected a non-empty string");
      }
      let parsed = { negated: false, fastpaths: true };
      if (options2.fastpaths !== false && (input[0] === "." || input[0] === "*")) {
        parsed.output = parse3.fastpaths(input, options2);
      }
      if (!parsed.output) {
        parsed = parse3(input, options2);
      }
      return picomatch.compileRe(parsed, options2, returnOutput, returnState);
    };
    picomatch.toRegex = (source, options2) => {
      try {
        const opts = options2 || {};
        return new RegExp(source, opts.flags || (opts.nocase ? "i" : ""));
      } catch (err) {
        if (options2 && options2.debug === true) throw err;
        return /$^/;
      }
    };
    picomatch.constants = constants;
    module2.exports = picomatch;
  }
});

// node_modules/readdirp/node_modules/picomatch/index.js
var require_picomatch2 = __commonJS({
  "node_modules/readdirp/node_modules/picomatch/index.js"(exports2, module2) {
    "use strict";
    module2.exports = require_picomatch();
  }
});

// node_modules/readdirp/index.js
var require_readdirp = __commonJS({
  "node_modules/readdirp/index.js"(exports2, module2) {
    "use strict";
    var fs = require("fs");
    var { Readable: Readable2 } = require("stream");
    var sysPath = require("path");
    var { promisify } = require("util");
    var picomatch = require_picomatch2();
    var readdir = promisify(fs.readdir);
    var stat = promisify(fs.stat);
    var lstat = promisify(fs.lstat);
    var realpath = promisify(fs.realpath);
    var BANG = "!";
    var RECURSIVE_ERROR_CODE = "READDIRP_RECURSIVE_ERROR";
    var NORMAL_FLOW_ERRORS = /* @__PURE__ */ new Set(["ENOENT", "EPERM", "EACCES", "ELOOP", RECURSIVE_ERROR_CODE]);
    var FILE_TYPE = "files";
    var DIR_TYPE = "directories";
    var FILE_DIR_TYPE = "files_directories";
    var EVERYTHING_TYPE = "all";
    var ALL_TYPES = [FILE_TYPE, DIR_TYPE, FILE_DIR_TYPE, EVERYTHING_TYPE];
    var isNormalFlowError = (error48) => NORMAL_FLOW_ERRORS.has(error48.code);
    var [maj, min] = process.versions.node.split(".").slice(0, 2).map((n) => Number.parseInt(n, 10));
    var wantBigintFsStats = process.platform === "win32" && (maj > 10 || maj === 10 && min >= 5);
    var normalizeFilter = (filter) => {
      if (filter === void 0) return;
      if (typeof filter === "function") return filter;
      if (typeof filter === "string") {
        const glob = picomatch(filter.trim());
        return (entry) => glob(entry.basename);
      }
      if (Array.isArray(filter)) {
        const positive = [];
        const negative = [];
        for (const item of filter) {
          const trimmed = item.trim();
          if (trimmed.charAt(0) === BANG) {
            negative.push(picomatch(trimmed.slice(1)));
          } else {
            positive.push(picomatch(trimmed));
          }
        }
        if (negative.length > 0) {
          if (positive.length > 0) {
            return (entry) => positive.some((f) => f(entry.basename)) && !negative.some((f) => f(entry.basename));
          }
          return (entry) => !negative.some((f) => f(entry.basename));
        }
        return (entry) => positive.some((f) => f(entry.basename));
      }
    };
    var ReaddirpStream = class _ReaddirpStream extends Readable2 {
      static get defaultOptions() {
        return {
          root: ".",
          /* eslint-disable no-unused-vars */
          fileFilter: (path) => true,
          directoryFilter: (path) => true,
          /* eslint-enable no-unused-vars */
          type: FILE_TYPE,
          lstat: false,
          depth: 2147483648,
          alwaysStat: false
        };
      }
      constructor(options2 = {}) {
        super({
          objectMode: true,
          autoDestroy: true,
          highWaterMark: options2.highWaterMark || 4096
        });
        const opts = { ..._ReaddirpStream.defaultOptions, ...options2 };
        const { root, type } = opts;
        this._fileFilter = normalizeFilter(opts.fileFilter);
        this._directoryFilter = normalizeFilter(opts.directoryFilter);
        const statMethod = opts.lstat ? lstat : stat;
        if (wantBigintFsStats) {
          this._stat = (path) => statMethod(path, { bigint: true });
        } else {
          this._stat = statMethod;
        }
        this._maxDepth = opts.depth;
        this._wantsDir = [DIR_TYPE, FILE_DIR_TYPE, EVERYTHING_TYPE].includes(type);
        this._wantsFile = [FILE_TYPE, FILE_DIR_TYPE, EVERYTHING_TYPE].includes(type);
        this._wantsEverything = type === EVERYTHING_TYPE;
        this._root = sysPath.resolve(root);
        this._isDirent = "Dirent" in fs && !opts.alwaysStat;
        this._statsProp = this._isDirent ? "dirent" : "stats";
        this._rdOptions = { encoding: "utf8", withFileTypes: this._isDirent };
        this.parents = [this._exploreDir(root, 1)];
        this.reading = false;
        this.parent = void 0;
      }
      async _read(batch) {
        if (this.reading) return;
        this.reading = true;
        try {
          while (!this.destroyed && batch > 0) {
            const { path, depth, files = [] } = this.parent || {};
            if (files.length > 0) {
              const slice = files.splice(0, batch).map((dirent) => this._formatEntry(dirent, path));
              for (const entry of await Promise.all(slice)) {
                if (this.destroyed) return;
                const entryType = await this._getEntryType(entry);
                if (entryType === "directory" && this._directoryFilter(entry)) {
                  if (depth <= this._maxDepth) {
                    this.parents.push(this._exploreDir(entry.fullPath, depth + 1));
                  }
                  if (this._wantsDir) {
                    this.push(entry);
                    batch--;
                  }
                } else if ((entryType === "file" || this._includeAsFile(entry)) && this._fileFilter(entry)) {
                  if (this._wantsFile) {
                    this.push(entry);
                    batch--;
                  }
                }
              }
            } else {
              const parent = this.parents.pop();
              if (!parent) {
                this.push(null);
                break;
              }
              this.parent = await parent;
              if (this.destroyed) return;
            }
          }
        } catch (error48) {
          this.destroy(error48);
        } finally {
          this.reading = false;
        }
      }
      async _exploreDir(path, depth) {
        let files;
        try {
          files = await readdir(path, this._rdOptions);
        } catch (error48) {
          this._onError(error48);
        }
        return { files, depth, path };
      }
      async _formatEntry(dirent, path) {
        let entry;
        try {
          const basename = this._isDirent ? dirent.name : dirent;
          const fullPath = sysPath.resolve(sysPath.join(path, basename));
          entry = { path: sysPath.relative(this._root, fullPath), fullPath, basename };
          entry[this._statsProp] = this._isDirent ? dirent : await this._stat(fullPath);
        } catch (err) {
          this._onError(err);
        }
        return entry;
      }
      _onError(err) {
        if (isNormalFlowError(err) && !this.destroyed) {
          this.emit("warn", err);
        } else {
          this.destroy(err);
        }
      }
      async _getEntryType(entry) {
        const stats = entry && entry[this._statsProp];
        if (!stats) {
          return;
        }
        if (stats.isFile()) {
          return "file";
        }
        if (stats.isDirectory()) {
          return "directory";
        }
        if (stats && stats.isSymbolicLink()) {
          const full = entry.fullPath;
          try {
            const entryRealPath = await realpath(full);
            const entryRealPathStats = await lstat(entryRealPath);
            if (entryRealPathStats.isFile()) {
              return "file";
            }
            if (entryRealPathStats.isDirectory()) {
              const len = entryRealPath.length;
              if (full.startsWith(entryRealPath) && full.substr(len, 1) === sysPath.sep) {
                const recursiveError = new Error(
                  `Circular symlink detected: "${full}" points to "${entryRealPath}"`
                );
                recursiveError.code = RECURSIVE_ERROR_CODE;
                return this._onError(recursiveError);
              }
              return "directory";
            }
          } catch (error48) {
            this._onError(error48);
          }
        }
      }
      _includeAsFile(entry) {
        const stats = entry && entry[this._statsProp];
        return stats && this._wantsEverything && !stats.isDirectory();
      }
    };
    var readdirp = (root, options2 = {}) => {
      let type = options2.entryType || options2.type;
      if (type === "both") type = FILE_DIR_TYPE;
      if (type) options2.type = type;
      if (!root) {
        throw new Error("readdirp: root argument is required. Usage: readdirp(root, options)");
      } else if (typeof root !== "string") {
        throw new TypeError("readdirp: root argument must be a string. Usage: readdirp(root, options)");
      } else if (type && !ALL_TYPES.includes(type)) {
        throw new Error(`readdirp: Invalid type passed. Use one of ${ALL_TYPES.join(", ")}`);
      }
      options2.root = root;
      return new ReaddirpStream(options2);
    };
    var readdirpPromise = (root, options2 = {}) => {
      return new Promise((resolve, reject) => {
        const files = [];
        readdirp(root, options2).on("data", (entry) => files.push(entry)).on("end", () => resolve(files)).on("error", (error48) => reject(error48));
      });
    };
    readdirp.promise = readdirpPromise;
    readdirp.ReaddirpStream = ReaddirpStream;
    readdirp.default = readdirp;
    module2.exports = readdirp;
  }
});

// node_modules/anymatch/node_modules/picomatch/lib/constants.js
var require_constants7 = __commonJS({
  "node_modules/anymatch/node_modules/picomatch/lib/constants.js"(exports2, module2) {
    "use strict";
    var path = require("path");
    var WIN_SLASH = "\\\\/";
    var WIN_NO_SLASH = `[^${WIN_SLASH}]`;
    var DEFAULT_MAX_EXTGLOB_RECURSION = 0;
    var DOT_LITERAL = "\\.";
    var PLUS_LITERAL = "\\+";
    var QMARK_LITERAL = "\\?";
    var SLASH_LITERAL = "\\/";
    var ONE_CHAR = "(?=.)";
    var QMARK = "[^/]";
    var END_ANCHOR = `(?:${SLASH_LITERAL}|$)`;
    var START_ANCHOR = `(?:^|${SLASH_LITERAL})`;
    var DOTS_SLASH = `${DOT_LITERAL}{1,2}${END_ANCHOR}`;
    var NO_DOT = `(?!${DOT_LITERAL})`;
    var NO_DOTS = `(?!${START_ANCHOR}${DOTS_SLASH})`;
    var NO_DOT_SLASH = `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`;
    var NO_DOTS_SLASH = `(?!${DOTS_SLASH})`;
    var QMARK_NO_DOT = `[^.${SLASH_LITERAL}]`;
    var STAR = `${QMARK}*?`;
    var POSIX_CHARS = {
      DOT_LITERAL,
      PLUS_LITERAL,
      QMARK_LITERAL,
      SLASH_LITERAL,
      ONE_CHAR,
      QMARK,
      END_ANCHOR,
      DOTS_SLASH,
      NO_DOT,
      NO_DOTS,
      NO_DOT_SLASH,
      NO_DOTS_SLASH,
      QMARK_NO_DOT,
      STAR,
      START_ANCHOR
    };
    var WINDOWS_CHARS = {
      ...POSIX_CHARS,
      SLASH_LITERAL: `[${WIN_SLASH}]`,
      QMARK: WIN_NO_SLASH,
      STAR: `${WIN_NO_SLASH}*?`,
      DOTS_SLASH: `${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$)`,
      NO_DOT: `(?!${DOT_LITERAL})`,
      NO_DOTS: `(?!(?:^|[${WIN_SLASH}])${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
      NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}(?:[${WIN_SLASH}]|$))`,
      NO_DOTS_SLASH: `(?!${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
      QMARK_NO_DOT: `[^.${WIN_SLASH}]`,
      START_ANCHOR: `(?:^|[${WIN_SLASH}])`,
      END_ANCHOR: `(?:[${WIN_SLASH}]|$)`
    };
    var POSIX_REGEX_SOURCE = {
      __proto__: null,
      alnum: "a-zA-Z0-9",
      alpha: "a-zA-Z",
      ascii: "\\x00-\\x7F",
      blank: " \\t",
      cntrl: "\\x00-\\x1F\\x7F",
      digit: "0-9",
      graph: "\\x21-\\x7E",
      lower: "a-z",
      print: "\\x20-\\x7E ",
      punct: "\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",
      space: " \\t\\r\\n\\v\\f",
      upper: "A-Z",
      word: "A-Za-z0-9_",
      xdigit: "A-Fa-f0-9"
    };
    module2.exports = {
      DEFAULT_MAX_EXTGLOB_RECURSION,
      MAX_LENGTH: 1024 * 64,
      POSIX_REGEX_SOURCE,
      // regular expressions
      REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g,
      REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/,
      REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/,
      REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g,
      REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g,
      REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g,
      // Replace globs with equivalent patterns to reduce parsing time.
      REPLACEMENTS: {
        __proto__: null,
        "***": "*",
        "**/**": "**",
        "**/**/**": "**"
      },
      // Digits
      CHAR_0: 48,
      /* 0 */
      CHAR_9: 57,
      /* 9 */
      // Alphabet chars.
      CHAR_UPPERCASE_A: 65,
      /* A */
      CHAR_LOWERCASE_A: 97,
      /* a */
      CHAR_UPPERCASE_Z: 90,
      /* Z */
      CHAR_LOWERCASE_Z: 122,
      /* z */
      CHAR_LEFT_PARENTHESES: 40,
      /* ( */
      CHAR_RIGHT_PARENTHESES: 41,
      /* ) */
      CHAR_ASTERISK: 42,
      /* * */
      // Non-alphabetic chars.
      CHAR_AMPERSAND: 38,
      /* & */
      CHAR_AT: 64,
      /* @ */
      CHAR_BACKWARD_SLASH: 92,
      /* \ */
      CHAR_CARRIAGE_RETURN: 13,
      /* \r */
      CHAR_CIRCUMFLEX_ACCENT: 94,
      /* ^ */
      CHAR_COLON: 58,
      /* : */
      CHAR_COMMA: 44,
      /* , */
      CHAR_DOT: 46,
      /* . */
      CHAR_DOUBLE_QUOTE: 34,
      /* " */
      CHAR_EQUAL: 61,
      /* = */
      CHAR_EXCLAMATION_MARK: 33,
      /* ! */
      CHAR_FORM_FEED: 12,
      /* \f */
      CHAR_FORWARD_SLASH: 47,
      /* / */
      CHAR_GRAVE_ACCENT: 96,
      /* ` */
      CHAR_HASH: 35,
      /* # */
      CHAR_HYPHEN_MINUS: 45,
      /* - */
      CHAR_LEFT_ANGLE_BRACKET: 60,
      /* < */
      CHAR_LEFT_CURLY_BRACE: 123,
      /* { */
      CHAR_LEFT_SQUARE_BRACKET: 91,
      /* [ */
      CHAR_LINE_FEED: 10,
      /* \n */
      CHAR_NO_BREAK_SPACE: 160,
      /* \u00A0 */
      CHAR_PERCENT: 37,
      /* % */
      CHAR_PLUS: 43,
      /* + */
      CHAR_QUESTION_MARK: 63,
      /* ? */
      CHAR_RIGHT_ANGLE_BRACKET: 62,
      /* > */
      CHAR_RIGHT_CURLY_BRACE: 125,
      /* } */
      CHAR_RIGHT_SQUARE_BRACKET: 93,
      /* ] */
      CHAR_SEMICOLON: 59,
      /* ; */
      CHAR_SINGLE_QUOTE: 39,
      /* ' */
      CHAR_SPACE: 32,
      /*   */
      CHAR_TAB: 9,
      /* \t */
      CHAR_UNDERSCORE: 95,
      /* _ */
      CHAR_VERTICAL_LINE: 124,
      /* | */
      CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279,
      /* \uFEFF */
      SEP: path.sep,
      /**
       * Create EXTGLOB_CHARS
       */
      extglobChars(chars) {
        return {
          "!": { type: "negate", open: "(?:(?!(?:", close: `))${chars.STAR})` },
          "?": { type: "qmark", open: "(?:", close: ")?" },
          "+": { type: "plus", open: "(?:", close: ")+" },
          "*": { type: "star", open: "(?:", close: ")*" },
          "@": { type: "at", open: "(?:", close: ")" }
        };
      },
      /**
       * Create GLOB_CHARS
       */
      globChars(win32) {
        return win32 === true ? WINDOWS_CHARS : POSIX_CHARS;
      }
    };
  }
});

// node_modules/anymatch/node_modules/picomatch/lib/utils.js
var require_utils4 = __commonJS({
  "node_modules/anymatch/node_modules/picomatch/lib/utils.js"(exports2) {
    "use strict";
    var path = require("path");
    var win32 = process.platform === "win32";
    var {
      REGEX_BACKSLASH,
      REGEX_REMOVE_BACKSLASH,
      REGEX_SPECIAL_CHARS,
      REGEX_SPECIAL_CHARS_GLOBAL
    } = require_constants7();
    exports2.isObject = (val) => val !== null && typeof val === "object" && !Array.isArray(val);
    exports2.hasRegexChars = (str) => REGEX_SPECIAL_CHARS.test(str);
    exports2.isRegexChar = (str) => str.length === 1 && exports2.hasRegexChars(str);
    exports2.escapeRegex = (str) => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, "\\$1");
    exports2.toPosixSlashes = (str) => str.replace(REGEX_BACKSLASH, "/");
    exports2.removeBackslashes = (str) => {
      return str.replace(REGEX_REMOVE_BACKSLASH, (match) => {
        return match === "\\" ? "" : match;
      });
    };
    exports2.supportsLookbehinds = () => {
      const segs = process.version.slice(1).split(".").map(Number);
      if (segs.length === 3 && segs[0] >= 9 || segs[0] === 8 && segs[1] >= 10) {
        return true;
      }
      return false;
    };
    exports2.isWindows = (options2) => {
      if (options2 && typeof options2.windows === "boolean") {
        return options2.windows;
      }
      return win32 === true || path.sep === "\\";
    };
    exports2.escapeLast = (input, char, lastIdx) => {
      const idx = input.lastIndexOf(char, lastIdx);
      if (idx === -1) return input;
      if (input[idx - 1] === "\\") return exports2.escapeLast(input, char, idx - 1);
      return `${input.slice(0, idx)}\\${input.slice(idx)}`;
    };
    exports2.removePrefix = (input, state = {}) => {
      let output = input;
      if (output.startsWith("./")) {
        output = output.slice(2);
        state.prefix = "./";
      }
      return output;
    };
    exports2.wrapOutput = (input, state = {}, options2 = {}) => {
      const prepend = options2.contains ? "" : "^";
      const append = options2.contains ? "" : "$";
      let output = `${prepend}(?:${input})${append}`;
      if (state.negated === true) {
        output = `(?:^(?!${output}).*$)`;
      }
      return output;
    };
  }
});

// node_modules/anymatch/node_modules/picomatch/lib/scan.js
var require_scan2 = __commonJS({
  "node_modules/anymatch/node_modules/picomatch/lib/scan.js"(exports2, module2) {
    "use strict";
    var utils = require_utils4();
    var {
      CHAR_ASTERISK,
      /* * */
      CHAR_AT,
      /* @ */
      CHAR_BACKWARD_SLASH,
      /* \ */
      CHAR_COMMA,
      /* , */
      CHAR_DOT,
      /* . */
      CHAR_EXCLAMATION_MARK,
      /* ! */
      CHAR_FORWARD_SLASH,
      /* / */
      CHAR_LEFT_CURLY_BRACE,
      /* { */
      CHAR_LEFT_PARENTHESES,
      /* ( */
      CHAR_LEFT_SQUARE_BRACKET,
      /* [ */
      CHAR_PLUS,
      /* + */
      CHAR_QUESTION_MARK,
      /* ? */
      CHAR_RIGHT_CURLY_BRACE,
      /* } */
      CHAR_RIGHT_PARENTHESES,
      /* ) */
      CHAR_RIGHT_SQUARE_BRACKET
      /* ] */
    } = require_constants7();
    var isPathSeparator = (code) => {
      return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH;
    };
    var depth = (token) => {
      if (token.isPrefix !== true) {
        token.depth = token.isGlobstar ? Infinity : 1;
      }
    };
    var scan = (input, options2) => {
      const opts = options2 || {};
      const length = input.length - 1;
      const scanToEnd = opts.parts === true || opts.scanToEnd === true;
      const slashes = [];
      const tokens = [];
      const parts = [];
      let str = input;
      let index = -1;
      let start = 0;
      let lastIndex = 0;
      let isBrace = false;
      let isBracket = false;
      let isGlob = false;
      let isExtglob = false;
      let isGlobstar = false;
      let braceEscaped = false;
      let backslashes = false;
      let negated = false;
      let negatedExtglob = false;
      let finished = false;
      let braces = 0;
      let prev;
      let code;
      let token = { value: "", depth: 0, isGlob: false };
      const eos = () => index >= length;
      const peek = () => str.charCodeAt(index + 1);
      const advance = () => {
        prev = code;
        return str.charCodeAt(++index);
      };
      while (index < length) {
        code = advance();
        let next;
        if (code === CHAR_BACKWARD_SLASH) {
          backslashes = token.backslashes = true;
          code = advance();
          if (code === CHAR_LEFT_CURLY_BRACE) {
            braceEscaped = true;
          }
          continue;
        }
        if (braceEscaped === true || code === CHAR_LEFT_CURLY_BRACE) {
          braces++;
          while (eos() !== true && (code = advance())) {
            if (code === CHAR_BACKWARD_SLASH) {
              backslashes = token.backslashes = true;
              advance();
              continue;
            }
            if (code === CHAR_LEFT_CURLY_BRACE) {
              braces++;
              continue;
            }
            if (braceEscaped !== true && code === CHAR_DOT && (code = advance()) === CHAR_DOT) {
              isBrace = token.isBrace = true;
              isGlob = token.isGlob = true;
              finished = true;
              if (scanToEnd === true) {
                continue;
              }
              break;
            }
            if (braceEscaped !== true && code === CHAR_COMMA) {
              isBrace = token.isBrace = true;
              isGlob = token.isGlob = true;
              finished = true;
              if (scanToEnd === true) {
                continue;
              }
              break;
            }
            if (code === CHAR_RIGHT_CURLY_BRACE) {
              braces--;
              if (braces === 0) {
                braceEscaped = false;
                isBrace = token.isBrace = true;
                finished = true;
                break;
              }
            }
          }
          if (scanToEnd === true) {
            continue;
          }
          break;
        }
        if (code === CHAR_FORWARD_SLASH) {
          slashes.push(index);
          tokens.push(token);
          token = { value: "", depth: 0, isGlob: false };
          if (finished === true) continue;
          if (prev === CHAR_DOT && index === start + 1) {
            start += 2;
            continue;
          }
          lastIndex = index + 1;
          continue;
        }
        if (opts.noext !== true) {
          const isExtglobChar = code === CHAR_PLUS || code === CHAR_AT || code === CHAR_ASTERISK || code === CHAR_QUESTION_MARK || code === CHAR_EXCLAMATION_MARK;
          if (isExtglobChar === true && peek() === CHAR_LEFT_PARENTHESES) {
            isGlob = token.isGlob = true;
            isExtglob = token.isExtglob = true;
            finished = true;
            if (code === CHAR_EXCLAMATION_MARK && index === start) {
              negatedExtglob = true;
            }
            if (scanToEnd === true) {
              while (eos() !== true && (code = advance())) {
                if (code === CHAR_BACKWARD_SLASH) {
                  backslashes = token.backslashes = true;
                  code = advance();
                  continue;
                }
                if (code === CHAR_RIGHT_PARENTHESES) {
                  isGlob = token.isGlob = true;
                  finished = true;
                  break;
                }
              }
              continue;
            }
            break;
          }
        }
        if (code === CHAR_ASTERISK) {
          if (prev === CHAR_ASTERISK) isGlobstar = token.isGlobstar = true;
          isGlob = token.isGlob = true;
          finished = true;
          if (scanToEnd === true) {
            continue;
          }
          break;
        }
        if (code === CHAR_QUESTION_MARK) {
          isGlob = token.isGlob = true;
          finished = true;
          if (scanToEnd === true) {
            continue;
          }
          break;
        }
        if (code === CHAR_LEFT_SQUARE_BRACKET) {
          while (eos() !== true && (next = advance())) {
            if (next === CHAR_BACKWARD_SLASH) {
              backslashes = token.backslashes = true;
              advance();
              continue;
            }
            if (next === CHAR_RIGHT_SQUARE_BRACKET) {
              isBracket = token.isBracket = true;
              isGlob = token.isGlob = true;
              finished = true;
              break;
            }
          }
          if (scanToEnd === true) {
            continue;
          }
          break;
        }
        if (opts.nonegate !== true && code === CHAR_EXCLAMATION_MARK && index === start) {
          negated = token.negated = true;
          start++;
          continue;
        }
        if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES) {
          isGlob = token.isGlob = true;
          if (scanToEnd === true) {
            while (eos() !== true && (code = advance())) {
              if (code === CHAR_LEFT_PARENTHESES) {
                backslashes = token.backslashes = true;
                code = advance();
                continue;
              }
              if (code === CHAR_RIGHT_PARENTHESES) {
                finished = true;
                break;
              }
            }
            continue;
          }
          break;
        }
        if (isGlob === true) {
          finished = true;
          if (scanToEnd === true) {
            continue;
          }
          break;
        }
      }
      if (opts.noext === true) {
        isExtglob = false;
        isGlob = false;
      }
      let base = str;
      let prefix = "";
      let glob = "";
      if (start > 0) {
        prefix = str.slice(0, start);
        str = str.slice(start);
        lastIndex -= start;
      }
      if (base && isGlob === true && lastIndex > 0) {
        base = str.slice(0, lastIndex);
        glob = str.slice(lastIndex);
      } else if (isGlob === true) {
        base = "";
        glob = str;
      } else {
        base = str;
      }
      if (base && base !== "" && base !== "/" && base !== str) {
        if (isPathSeparator(base.charCodeAt(base.length - 1))) {
          base = base.slice(0, -1);
        }
      }
      if (opts.unescape === true) {
        if (glob) glob = utils.removeBackslashes(glob);
        if (base && backslashes === true) {
          base = utils.removeBackslashes(base);
        }
      }
      const state = {
        prefix,
        input,
        start,
        base,
        glob,
        isBrace,
        isBracket,
        isGlob,
        isExtglob,
        isGlobstar,
        negated,
        negatedExtglob
      };
      if (opts.tokens === true) {
        state.maxDepth = 0;
        if (!isPathSeparator(code)) {
          tokens.push(token);
        }
        state.tokens = tokens;
      }
      if (opts.parts === true || opts.tokens === true) {
        let prevIndex;
        for (let idx = 0; idx < slashes.length; idx++) {
          const n = prevIndex ? prevIndex + 1 : start;
          const i = slashes[idx];
          const value = input.slice(n, i);
          if (opts.tokens) {
            if (idx === 0 && start !== 0) {
              tokens[idx].isPrefix = true;
              tokens[idx].value = prefix;
            } else {
              tokens[idx].value = value;
            }
            depth(tokens[idx]);
            state.maxDepth += tokens[idx].depth;
          }
          if (idx !== 0 || value !== "") {
            parts.push(value);
          }
          prevIndex = i;
        }
        if (prevIndex && prevIndex + 1 < input.length) {
          const value = input.slice(prevIndex + 1);
          parts.push(value);
          if (opts.tokens) {
            tokens[tokens.length - 1].value = value;
            depth(tokens[tokens.length - 1]);
            state.maxDepth += tokens[tokens.length - 1].depth;
          }
        }
        state.slashes = slashes;
        state.parts = parts;
      }
      return state;
    };
    module2.exports = scan;
  }
});

// node_modules/anymatch/node_modules/picomatch/lib/parse.js
var require_parse3 = __commonJS({
  "node_modules/anymatch/node_modules/picomatch/lib/parse.js"(exports2, module2) {
    "use strict";
    var constants = require_constants7();
    var utils = require_utils4();
    var {
      MAX_LENGTH,
      POSIX_REGEX_SOURCE,
      REGEX_NON_SPECIAL_CHARS,
      REGEX_SPECIAL_CHARS_BACKREF,
      REPLACEMENTS
    } = constants;
    var expandRange = (args, options2) => {
      if (typeof options2.expandRange === "function") {
        return options2.expandRange(...args, options2);
      }
      args.sort();
      const value = `[${args.join("-")}]`;
      try {
        new RegExp(value);
      } catch (ex) {
        return args.map((v) => utils.escapeRegex(v)).join("..");
      }
      return value;
    };
    var syntaxError2 = (type, char) => {
      return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`;
    };
    var splitTopLevel = (input) => {
      const parts = [];
      let bracket = 0;
      let paren = 0;
      let quote = 0;
      let value = "";
      let escaped = false;
      for (const ch of input) {
        if (escaped === true) {
          value += ch;
          escaped = false;
          continue;
        }
        if (ch === "\\") {
          value += ch;
          escaped = true;
          continue;
        }
        if (ch === '"') {
          quote = quote === 1 ? 0 : 1;
          value += ch;
          continue;
        }
        if (quote === 0) {
          if (ch === "[") {
            bracket++;
          } else if (ch === "]" && bracket > 0) {
            bracket--;
          } else if (bracket === 0) {
            if (ch === "(") {
              paren++;
            } else if (ch === ")" && paren > 0) {
              paren--;
            } else if (ch === "|" && paren === 0) {
              parts.push(value);
              value = "";
              continue;
            }
          }
        }
        value += ch;
      }
      parts.push(value);
      return parts;
    };
    var isPlainBranch = (branch) => {
      let escaped = false;
      for (const ch of branch) {
        if (escaped === true) {
          escaped = false;
          continue;
        }
        if (ch === "\\") {
          escaped = true;
          continue;
        }
        if (/[?*+@!()[\]{}]/.test(ch)) {
          return false;
        }
      }
      return true;
    };
    var normalizeSimpleBranch = (branch) => {
      let value = branch.trim();
      let changed = true;
      while (changed === true) {
        changed = false;
        if (/^@\([^\\()[\]{}|]+\)$/.test(value)) {
          value = value.slice(2, -1);
          changed = true;
        }
      }
      if (!isPlainBranch(value)) {
        return;
      }
      return value.replace(/\\(.)/g, "$1");
    };
    var hasRepeatedCharPrefixOverlap = (branches) => {
      const values = branches.map(normalizeSimpleBranch).filter(Boolean);
      for (let i = 0; i < values.length; i++) {
        for (let j = i + 1; j < values.length; j++) {
          const a = values[i];
          const b = values[j];
          const char = a[0];
          if (!char || a !== char.repeat(a.length) || b !== char.repeat(b.length)) {
            continue;
          }
          if (a === b || a.startsWith(b) || b.startsWith(a)) {
            return true;
          }
        }
      }
      return false;
    };
    var parseRepeatedExtglob = (pattern, requireEnd = true) => {
      if (pattern[0] !== "+" && pattern[0] !== "*" || pattern[1] !== "(") {
        return;
      }
      let bracket = 0;
      let paren = 0;
      let quote = 0;
      let escaped = false;
      for (let i = 1; i < pattern.length; i++) {
        const ch = pattern[i];
        if (escaped === true) {
          escaped = false;
          continue;
        }
        if (ch === "\\") {
          escaped = true;
          continue;
        }
        if (ch === '"') {
          quote = quote === 1 ? 0 : 1;
          continue;
        }
        if (quote === 1) {
          continue;
        }
        if (ch === "[") {
          bracket++;
          continue;
        }
        if (ch === "]" && bracket > 0) {
          bracket--;
          continue;
        }
        if (bracket > 0) {
          continue;
        }
        if (ch === "(") {
          paren++;
          continue;
        }
        if (ch === ")") {
          paren--;
          if (paren === 0) {
            if (requireEnd === true && i !== pattern.length - 1) {
              return;
            }
            return {
              type: pattern[0],
              body: pattern.slice(2, i),
              end: i
            };
          }
        }
      }
    };
    var getStarExtglobSequenceOutput = (pattern) => {
      let index = 0;
      const chars = [];
      while (index < pattern.length) {
        const match = parseRepeatedExtglob(pattern.slice(index), false);
        if (!match || match.type !== "*") {
          return;
        }
        const branches = splitTopLevel(match.body).map((branch2) => branch2.trim());
        if (branches.length !== 1) {
          return;
        }
        const branch = normalizeSimpleBranch(branches[0]);
        if (!branch || branch.length !== 1) {
          return;
        }
        chars.push(branch);
        index += match.end + 1;
      }
      if (chars.length < 1) {
        return;
      }
      const source = chars.length === 1 ? utils.escapeRegex(chars[0]) : `[${chars.map((ch) => utils.escapeRegex(ch)).join("")}]`;
      return `${source}*`;
    };
    var repeatedExtglobRecursion = (pattern) => {
      let depth = 0;
      let value = pattern.trim();
      let match = parseRepeatedExtglob(value);
      while (match) {
        depth++;
        value = match.body.trim();
        match = parseRepeatedExtglob(value);
      }
      return depth;
    };
    var analyzeRepeatedExtglob = (body, options2) => {
      if (options2.maxExtglobRecursion === false) {
        return { risky: false };
      }
      const max = typeof options2.maxExtglobRecursion === "number" ? options2.maxExtglobRecursion : constants.DEFAULT_MAX_EXTGLOB_RECURSION;
      const branches = splitTopLevel(body).map((branch) => branch.trim());
      if (branches.length > 1) {
        if (branches.some((branch) => branch === "") || branches.some((branch) => /^[*?]+$/.test(branch)) || hasRepeatedCharPrefixOverlap(branches)) {
          return { risky: true };
        }
      }
      for (const branch of branches) {
        const safeOutput = getStarExtglobSequenceOutput(branch);
        if (safeOutput) {
          return { risky: true, safeOutput };
        }
        if (repeatedExtglobRecursion(branch) > max) {
          return { risky: true };
        }
      }
      return { risky: false };
    };
    var parse3 = (input, options2) => {
      if (typeof input !== "string") {
        throw new TypeError("Expected a string");
      }
      input = REPLACEMENTS[input] || input;
      const opts = { ...options2 };
      const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
      let len = input.length;
      if (len > max) {
        throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
      }
      const bos = { type: "bos", value: "", output: opts.prepend || "" };
      const tokens = [bos];
      const capture = opts.capture ? "" : "?:";
      const win32 = utils.isWindows(options2);
      const PLATFORM_CHARS = constants.globChars(win32);
      const EXTGLOB_CHARS = constants.extglobChars(PLATFORM_CHARS);
      const {
        DOT_LITERAL,
        PLUS_LITERAL,
        SLASH_LITERAL,
        ONE_CHAR,
        DOTS_SLASH,
        NO_DOT,
        NO_DOT_SLASH,
        NO_DOTS_SLASH,
        QMARK,
        QMARK_NO_DOT,
        STAR,
        START_ANCHOR
      } = PLATFORM_CHARS;
      const globstar = (opts2) => {
        return `(${capture}(?:(?!${START_ANCHOR}${opts2.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
      };
      const nodot = opts.dot ? "" : NO_DOT;
      const qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT;
      let star = opts.bash === true ? globstar(opts) : STAR;
      if (opts.capture) {
        star = `(${star})`;
      }
      if (typeof opts.noext === "boolean") {
        opts.noextglob = opts.noext;
      }
      const state = {
        input,
        index: -1,
        start: 0,
        dot: opts.dot === true,
        consumed: "",
        output: "",
        prefix: "",
        backtrack: false,
        negated: false,
        brackets: 0,
        braces: 0,
        parens: 0,
        quotes: 0,
        globstar: false,
        tokens
      };
      input = utils.removePrefix(input, state);
      len = input.length;
      const extglobs = [];
      const braces = [];
      const stack = [];
      let prev = bos;
      let value;
      const eos = () => state.index === len - 1;
      const peek = state.peek = (n = 1) => input[state.index + n];
      const advance = state.advance = () => input[++state.index] || "";
      const remaining = () => input.slice(state.index + 1);
      const consume = (value2 = "", num = 0) => {
        state.consumed += value2;
        state.index += num;
      };
      const append = (token) => {
        state.output += token.output != null ? token.output : token.value;
        consume(token.value);
      };
      const negate = () => {
        let count = 1;
        while (peek() === "!" && (peek(2) !== "(" || peek(3) === "?")) {
          advance();
          state.start++;
          count++;
        }
        if (count % 2 === 0) {
          return false;
        }
        state.negated = true;
        state.start++;
        return true;
      };
      const increment = (type) => {
        state[type]++;
        stack.push(type);
      };
      const decrement = (type) => {
        state[type]--;
        stack.pop();
      };
      const push = (tok) => {
        if (prev.type === "globstar") {
          const isBrace = state.braces > 0 && (tok.type === "comma" || tok.type === "brace");
          const isExtglob = tok.extglob === true || extglobs.length && (tok.type === "pipe" || tok.type === "paren");
          if (tok.type !== "slash" && tok.type !== "paren" && !isBrace && !isExtglob) {
            state.output = state.output.slice(0, -prev.output.length);
            prev.type = "star";
            prev.value = "*";
            prev.output = star;
            state.output += prev.output;
          }
        }
        if (extglobs.length && tok.type !== "paren") {
          extglobs[extglobs.length - 1].inner += tok.value;
        }
        if (tok.value || tok.output) append(tok);
        if (prev && prev.type === "text" && tok.type === "text") {
          prev.value += tok.value;
          prev.output = (prev.output || "") + tok.value;
          return;
        }
        tok.prev = prev;
        tokens.push(tok);
        prev = tok;
      };
      const extglobOpen = (type, value2) => {
        const token = { ...EXTGLOB_CHARS[value2], conditions: 1, inner: "" };
        token.prev = prev;
        token.parens = state.parens;
        token.output = state.output;
        token.startIndex = state.index;
        token.tokensIndex = tokens.length;
        const output = (opts.capture ? "(" : "") + token.open;
        increment("parens");
        push({ type, value: value2, output: state.output ? "" : ONE_CHAR });
        push({ type: "paren", extglob: true, value: advance(), output });
        extglobs.push(token);
      };
      const extglobClose = (token) => {
        const literal2 = input.slice(token.startIndex, state.index + 1);
        const body = input.slice(token.startIndex + 2, state.index);
        const analysis = analyzeRepeatedExtglob(body, opts);
        if ((token.type === "plus" || token.type === "star") && analysis.risky) {
          const safeOutput = analysis.safeOutput ? (token.output ? "" : ONE_CHAR) + (opts.capture ? `(${analysis.safeOutput})` : analysis.safeOutput) : void 0;
          const open2 = tokens[token.tokensIndex];
          open2.type = "text";
          open2.value = literal2;
          open2.output = safeOutput || utils.escapeRegex(literal2);
          for (let i = token.tokensIndex + 1; i < tokens.length; i++) {
            tokens[i].value = "";
            tokens[i].output = "";
            delete tokens[i].suffix;
          }
          state.output = token.output + open2.output;
          state.backtrack = true;
          push({ type: "paren", extglob: true, value, output: "" });
          decrement("parens");
          return;
        }
        let output = token.close + (opts.capture ? ")" : "");
        let rest;
        if (token.type === "negate") {
          let extglobStar = star;
          if (token.inner && token.inner.length > 1 && token.inner.includes("/")) {
            extglobStar = globstar(opts);
          }
          if (extglobStar !== star || eos() || /^\)+$/.test(remaining())) {
            output = token.close = `)$))${extglobStar}`;
          }
          if (token.inner.includes("*") && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) {
            const expression = parse3(rest, { ...options2, fastpaths: false }).output;
            output = token.close = `)${expression})${extglobStar})`;
          }
          if (token.prev.type === "bos") {
            state.negatedExtglob = true;
          }
        }
        push({ type: "paren", extglob: true, value, output });
        decrement("parens");
      };
      if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input)) {
        let backslashes = false;
        let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc2, chars, first, rest, index) => {
          if (first === "\\") {
            backslashes = true;
            return m;
          }
          if (first === "?") {
            if (esc2) {
              return esc2 + first + (rest ? QMARK.repeat(rest.length) : "");
            }
            if (index === 0) {
              return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : "");
            }
            return QMARK.repeat(chars.length);
          }
          if (first === ".") {
            return DOT_LITERAL.repeat(chars.length);
          }
          if (first === "*") {
            if (esc2) {
              return esc2 + first + (rest ? star : "");
            }
            return star;
          }
          return esc2 ? m : `\\${m}`;
        });
        if (backslashes === true) {
          if (opts.unescape === true) {
            output = output.replace(/\\/g, "");
          } else {
            output = output.replace(/\\+/g, (m) => {
              return m.length % 2 === 0 ? "\\\\" : m ? "\\" : "";
            });
          }
        }
        if (output === input && opts.contains === true) {
          state.output = input;
          return state;
        }
        state.output = utils.wrapOutput(output, state, options2);
        return state;
      }
      while (!eos()) {
        value = advance();
        if (value === "\0") {
          continue;
        }
        if (value === "\\") {
          const next = peek();
          if (next === "/" && opts.bash !== true) {
            continue;
          }
          if (next === "." || next === ";") {
            continue;
          }
          if (!next) {
            value += "\\";
            push({ type: "text", value });
            continue;
          }
          const match = /^\\+/.exec(remaining());
          let slashes = 0;
          if (match && match[0].length > 2) {
            slashes = match[0].length;
            state.index += slashes;
            if (slashes % 2 !== 0) {
              value += "\\";
            }
          }
          if (opts.unescape === true) {
            value = advance();
          } else {
            value += advance();
          }
          if (state.brackets === 0) {
            push({ type: "text", value });
            continue;
          }
        }
        if (state.brackets > 0 && (value !== "]" || prev.value === "[" || prev.value === "[^")) {
          if (opts.posix !== false && value === ":") {
            const inner = prev.value.slice(1);
            if (inner.includes("[")) {
              prev.posix = true;
              if (inner.includes(":")) {
                const idx = prev.value.lastIndexOf("[");
                const pre = prev.value.slice(0, idx);
                const rest2 = prev.value.slice(idx + 2);
                const posix = POSIX_REGEX_SOURCE[rest2];
                if (posix) {
                  prev.value = pre + posix;
                  state.backtrack = true;
                  advance();
                  if (!bos.output && tokens.indexOf(prev) === 1) {
                    bos.output = ONE_CHAR;
                  }
                  continue;
                }
              }
            }
          }
          if (value === "[" && peek() !== ":" || value === "-" && peek() === "]") {
            value = `\\${value}`;
          }
          if (value === "]" && (prev.value === "[" || prev.value === "[^")) {
            value = `\\${value}`;
          }
          if (opts.posix === true && value === "!" && prev.value === "[") {
            value = "^";
          }
          prev.value += value;
          append({ value });
          continue;
        }
        if (state.quotes === 1 && value !== '"') {
          value = utils.escapeRegex(value);
          prev.value += value;
          append({ value });
          continue;
        }
        if (value === '"') {
          state.quotes = state.quotes === 1 ? 0 : 1;
          if (opts.keepQuotes === true) {
            push({ type: "text", value });
          }
          continue;
        }
        if (value === "(") {
          increment("parens");
          push({ type: "paren", value });
          continue;
        }
        if (value === ")") {
          if (state.parens === 0 && opts.strictBrackets === true) {
            throw new SyntaxError(syntaxError2("opening", "("));
          }
          const extglob = extglobs[extglobs.length - 1];
          if (extglob && state.parens === extglob.parens + 1) {
            extglobClose(extglobs.pop());
            continue;
          }
          push({ type: "paren", value, output: state.parens ? ")" : "\\)" });
          decrement("parens");
          continue;
        }
        if (value === "[") {
          if (opts.nobracket === true || !remaining().includes("]")) {
            if (opts.nobracket !== true && opts.strictBrackets === true) {
              throw new SyntaxError(syntaxError2("closing", "]"));
            }
            value = `\\${value}`;
          } else {
            increment("brackets");
          }
          push({ type: "bracket", value });
          continue;
        }
        if (value === "]") {
          if (opts.nobracket === true || prev && prev.type === "bracket" && prev.value.length === 1) {
            push({ type: "text", value, output: `\\${value}` });
            continue;
          }
          if (state.brackets === 0) {
            if (opts.strictBrackets === true) {
              throw new SyntaxError(syntaxError2("opening", "["));
            }
            push({ type: "text", value, output: `\\${value}` });
            continue;
          }
          decrement("brackets");
          const prevValue = prev.value.slice(1);
          if (prev.posix !== true && prevValue[0] === "^" && !prevValue.includes("/")) {
            value = `/${value}`;
          }
          prev.value += value;
          append({ value });
          if (opts.literalBrackets === false || utils.hasRegexChars(prevValue)) {
            continue;
          }
          const escaped = utils.escapeRegex(prev.value);
          state.output = state.output.slice(0, -prev.value.length);
          if (opts.literalBrackets === true) {
            state.output += escaped;
            prev.value = escaped;
            continue;
          }
          prev.value = `(${capture}${escaped}|${prev.value})`;
          state.output += prev.value;
          continue;
        }
        if (value === "{" && opts.nobrace !== true) {
          increment("braces");
          const open2 = {
            type: "brace",
            value,
            output: "(",
            outputIndex: state.output.length,
            tokensIndex: state.tokens.length
          };
          braces.push(open2);
          push(open2);
          continue;
        }
        if (value === "}") {
          const brace = braces[braces.length - 1];
          if (opts.nobrace === true || !brace) {
            push({ type: "text", value, output: value });
            continue;
          }
          let output = ")";
          if (brace.dots === true) {
            const arr = tokens.slice();
            const range = [];
            for (let i = arr.length - 1; i >= 0; i--) {
              tokens.pop();
              if (arr[i].type === "brace") {
                break;
              }
              if (arr[i].type !== "dots") {
                range.unshift(arr[i].value);
              }
            }
            output = expandRange(range, opts);
            state.backtrack = true;
          }
          if (brace.comma !== true && brace.dots !== true) {
            const out = state.output.slice(0, brace.outputIndex);
            const toks = state.tokens.slice(brace.tokensIndex);
            brace.value = brace.output = "\\{";
            value = output = "\\}";
            state.output = out;
            for (const t of toks) {
              state.output += t.output || t.value;
            }
          }
          push({ type: "brace", value, output });
          decrement("braces");
          braces.pop();
          continue;
        }
        if (value === "|") {
          if (extglobs.length > 0) {
            extglobs[extglobs.length - 1].conditions++;
          }
          push({ type: "text", value });
          continue;
        }
        if (value === ",") {
          let output = value;
          const brace = braces[braces.length - 1];
          if (brace && stack[stack.length - 1] === "braces") {
            brace.comma = true;
            output = "|";
          }
          push({ type: "comma", value, output });
          continue;
        }
        if (value === "/") {
          if (prev.type === "dot" && state.index === state.start + 1) {
            state.start = state.index + 1;
            state.consumed = "";
            state.output = "";
            tokens.pop();
            prev = bos;
            continue;
          }
          push({ type: "slash", value, output: SLASH_LITERAL });
          continue;
        }
        if (value === ".") {
          if (state.braces > 0 && prev.type === "dot") {
            if (prev.value === ".") prev.output = DOT_LITERAL;
            const brace = braces[braces.length - 1];
            prev.type = "dots";
            prev.output += value;
            prev.value += value;
            brace.dots = true;
            continue;
          }
          if (state.braces + state.parens === 0 && prev.type !== "bos" && prev.type !== "slash") {
            push({ type: "text", value, output: DOT_LITERAL });
            continue;
          }
          push({ type: "dot", value, output: DOT_LITERAL });
          continue;
        }
        if (value === "?") {
          const isGroup = prev && prev.value === "(";
          if (!isGroup && opts.noextglob !== true && peek() === "(" && peek(2) !== "?") {
            extglobOpen("qmark", value);
            continue;
          }
          if (prev && prev.type === "paren") {
            const next = peek();
            let output = value;
            if (next === "<" && !utils.supportsLookbehinds()) {
              throw new Error("Node.js v10 or higher is required for regex lookbehinds");
            }
            if (prev.value === "(" && !/[!=<:]/.test(next) || next === "<" && !/<([!=]|\w+>)/.test(remaining())) {
              output = `\\${value}`;
            }
            push({ type: "text", value, output });
            continue;
          }
          if (opts.dot !== true && (prev.type === "slash" || prev.type === "bos")) {
            push({ type: "qmark", value, output: QMARK_NO_DOT });
            continue;
          }
          push({ type: "qmark", value, output: QMARK });
          continue;
        }
        if (value === "!") {
          if (opts.noextglob !== true && peek() === "(") {
            if (peek(2) !== "?" || !/[!=<:]/.test(peek(3))) {
              extglobOpen("negate", value);
              continue;
            }
          }
          if (opts.nonegate !== true && state.index === 0) {
            negate();
            continue;
          }
        }
        if (value === "+") {
          if (opts.noextglob !== true && peek() === "(" && peek(2) !== "?") {
            extglobOpen("plus", value);
            continue;
          }
          if (prev && prev.value === "(" || opts.regex === false) {
            push({ type: "plus", value, output: PLUS_LITERAL });
            continue;
          }
          if (prev && (prev.type === "bracket" || prev.type === "paren" || prev.type === "brace") || state.parens > 0) {
            push({ type: "plus", value });
            continue;
          }
          push({ type: "plus", value: PLUS_LITERAL });
          continue;
        }
        if (value === "@") {
          if (opts.noextglob !== true && peek() === "(" && peek(2) !== "?") {
            push({ type: "at", extglob: true, value, output: "" });
            continue;
          }
          push({ type: "text", value });
          continue;
        }
        if (value !== "*") {
          if (value === "$" || value === "^") {
            value = `\\${value}`;
          }
          const match = REGEX_NON_SPECIAL_CHARS.exec(remaining());
          if (match) {
            value += match[0];
            state.index += match[0].length;
          }
          push({ type: "text", value });
          continue;
        }
        if (prev && (prev.type === "globstar" || prev.star === true)) {
          prev.type = "star";
          prev.star = true;
          prev.value += value;
          prev.output = star;
          state.backtrack = true;
          state.globstar = true;
          consume(value);
          continue;
        }
        let rest = remaining();
        if (opts.noextglob !== true && /^\([^?]/.test(rest)) {
          extglobOpen("star", value);
          continue;
        }
        if (prev.type === "star") {
          if (opts.noglobstar === true) {
            consume(value);
            continue;
          }
          const prior = prev.prev;
          const before = prior.prev;
          const isStart = prior.type === "slash" || prior.type === "bos";
          const afterStar = before && (before.type === "star" || before.type === "globstar");
          if (opts.bash === true && (!isStart || rest[0] && rest[0] !== "/")) {
            push({ type: "star", value, output: "" });
            continue;
          }
          const isBrace = state.braces > 0 && (prior.type === "comma" || prior.type === "brace");
          const isExtglob = extglobs.length && (prior.type === "pipe" || prior.type === "paren");
          if (!isStart && prior.type !== "paren" && !isBrace && !isExtglob) {
            push({ type: "star", value, output: "" });
            continue;
          }
          while (rest.slice(0, 3) === "/**") {
            const after = input[state.index + 4];
            if (after && after !== "/") {
              break;
            }
            rest = rest.slice(3);
            consume("/**", 3);
          }
          if (prior.type === "bos" && eos()) {
            prev.type = "globstar";
            prev.value += value;
            prev.output = globstar(opts);
            state.output = prev.output;
            state.globstar = true;
            consume(value);
            continue;
          }
          if (prior.type === "slash" && prior.prev.type !== "bos" && !afterStar && eos()) {
            state.output = state.output.slice(0, -(prior.output + prev.output).length);
            prior.output = `(?:${prior.output}`;
            prev.type = "globstar";
            prev.output = globstar(opts) + (opts.strictSlashes ? ")" : "|$)");
            prev.value += value;
            state.globstar = true;
            state.output += prior.output + prev.output;
            consume(value);
            continue;
          }
          if (prior.type === "slash" && prior.prev.type !== "bos" && rest[0] === "/") {
            const end = rest[1] !== void 0 ? "|$" : "";
            state.output = state.output.slice(0, -(prior.output + prev.output).length);
            prior.output = `(?:${prior.output}`;
            prev.type = "globstar";
            prev.output = `${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`;
            prev.value += value;
            state.output += prior.output + prev.output;
            state.globstar = true;
            consume(value + advance());
            push({ type: "slash", value: "/", output: "" });
            continue;
          }
          if (prior.type === "bos" && rest[0] === "/") {
            prev.type = "globstar";
            prev.value += value;
            prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`;
            state.output = prev.output;
            state.globstar = true;
            consume(value + advance());
            push({ type: "slash", value: "/", output: "" });
            continue;
          }
          state.output = state.output.slice(0, -prev.output.length);
          prev.type = "globstar";
          prev.output = globstar(opts);
          prev.value += value;
          state.output += prev.output;
          state.globstar = true;
          consume(value);
          continue;
        }
        const token = { type: "star", value, output: star };
        if (opts.bash === true) {
          token.output = ".*?";
          if (prev.type === "bos" || prev.type === "slash") {
            token.output = nodot + token.output;
          }
          push(token);
          continue;
        }
        if (prev && (prev.type === "bracket" || prev.type === "paren") && opts.regex === true) {
          token.output = value;
          push(token);
          continue;
        }
        if (state.index === state.start || prev.type === "slash" || prev.type === "dot") {
          if (prev.type === "dot") {
            state.output += NO_DOT_SLASH;
            prev.output += NO_DOT_SLASH;
          } else if (opts.dot === true) {
            state.output += NO_DOTS_SLASH;
            prev.output += NO_DOTS_SLASH;
          } else {
            state.output += nodot;
            prev.output += nodot;
          }
          if (peek() !== "*") {
            state.output += ONE_CHAR;
            prev.output += ONE_CHAR;
          }
        }
        push(token);
      }
      while (state.brackets > 0) {
        if (opts.strictBrackets === true) throw new SyntaxError(syntaxError2("closing", "]"));
        state.output = utils.escapeLast(state.output, "[");
        decrement("brackets");
      }
      while (state.parens > 0) {
        if (opts.strictBrackets === true) throw new SyntaxError(syntaxError2("closing", ")"));
        state.output = utils.escapeLast(state.output, "(");
        decrement("parens");
      }
      while (state.braces > 0) {
        if (opts.strictBrackets === true) throw new SyntaxError(syntaxError2("closing", "}"));
        state.output = utils.escapeLast(state.output, "{");
        decrement("braces");
      }
      if (opts.strictSlashes !== true && (prev.type === "star" || prev.type === "bracket")) {
        push({ type: "maybe_slash", value: "", output: `${SLASH_LITERAL}?` });
      }
      if (state.backtrack === true) {
        state.output = "";
        for (const token of state.tokens) {
          state.output += token.output != null ? token.output : token.value;
          if (token.suffix) {
            state.output += token.suffix;
          }
        }
      }
      return state;
    };
    parse3.fastpaths = (input, options2) => {
      const opts = { ...options2 };
      const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
      const len = input.length;
      if (len > max) {
        throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
      }
      input = REPLACEMENTS[input] || input;
      const win32 = utils.isWindows(options2);
      const {
        DOT_LITERAL,
        SLASH_LITERAL,
        ONE_CHAR,
        DOTS_SLASH,
        NO_DOT,
        NO_DOTS,
        NO_DOTS_SLASH,
        STAR,
        START_ANCHOR
      } = constants.globChars(win32);
      const nodot = opts.dot ? NO_DOTS : NO_DOT;
      const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT;
      const capture = opts.capture ? "" : "?:";
      const state = { negated: false, prefix: "" };
      let star = opts.bash === true ? ".*?" : STAR;
      if (opts.capture) {
        star = `(${star})`;
      }
      const globstar = (opts2) => {
        if (opts2.noglobstar === true) return star;
        return `(${capture}(?:(?!${START_ANCHOR}${opts2.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
      };
      const create = (str) => {
        switch (str) {
          case "*":
            return `${nodot}${ONE_CHAR}${star}`;
          case ".*":
            return `${DOT_LITERAL}${ONE_CHAR}${star}`;
          case "*.*":
            return `${nodot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
          case "*/*":
            return `${nodot}${star}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star}`;
          case "**":
            return nodot + globstar(opts);
          case "**/*":
            return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star}`;
          case "**/*.*":
            return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
          case "**/.*":
            return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`;
          default: {
            const match = /^(.*?)\.(\w+)$/.exec(str);
            if (!match) return;
            const source2 = create(match[1]);
            if (!source2) return;
            return source2 + DOT_LITERAL + match[2];
          }
        }
      };
      const output = utils.removePrefix(input, state);
      let source = create(output);
      if (source && opts.strictSlashes !== true) {
        source += `${SLASH_LITERAL}?`;
      }
      return source;
    };
    module2.exports = parse3;
  }
});

// node_modules/anymatch/node_modules/picomatch/lib/picomatch.js
var require_picomatch3 = __commonJS({
  "node_modules/anymatch/node_modules/picomatch/lib/picomatch.js"(exports2, module2) {
    "use strict";
    var path = require("path");
    var scan = require_scan2();
    var parse3 = require_parse3();
    var utils = require_utils4();
    var constants = require_constants7();
    var isObject2 = (val) => val && typeof val === "object" && !Array.isArray(val);
    var picomatch = (glob, options2, returnState = false) => {
      if (Array.isArray(glob)) {
        const fns = glob.map((input) => picomatch(input, options2, returnState));
        const arrayMatcher = (str) => {
          for (const isMatch of fns) {
            const state2 = isMatch(str);
            if (state2) return state2;
          }
          return false;
        };
        return arrayMatcher;
      }
      const isState = isObject2(glob) && glob.tokens && glob.input;
      if (glob === "" || typeof glob !== "string" && !isState) {
        throw new TypeError("Expected pattern to be a non-empty string");
      }
      const opts = options2 || {};
      const posix = utils.isWindows(options2);
      const regex = isState ? picomatch.compileRe(glob, options2) : picomatch.makeRe(glob, options2, false, true);
      const state = regex.state;
      delete regex.state;
      let isIgnored = () => false;
      if (opts.ignore) {
        const ignoreOpts = { ...options2, ignore: null, onMatch: null, onResult: null };
        isIgnored = picomatch(opts.ignore, ignoreOpts, returnState);
      }
      const matcher = (input, returnObject = false) => {
        const { isMatch, match, output } = picomatch.test(input, regex, options2, { glob, posix });
        const result = { glob, state, regex, posix, input, output, match, isMatch };
        if (typeof opts.onResult === "function") {
          opts.onResult(result);
        }
        if (isMatch === false) {
          result.isMatch = false;
          return returnObject ? result : false;
        }
        if (isIgnored(input)) {
          if (typeof opts.onIgnore === "function") {
            opts.onIgnore(result);
          }
          result.isMatch = false;
          return returnObject ? result : false;
        }
        if (typeof opts.onMatch === "function") {
          opts.onMatch(result);
        }
        return returnObject ? result : true;
      };
      if (returnState) {
        matcher.state = state;
      }
      return matcher;
    };
    picomatch.test = (input, regex, options2, { glob, posix } = {}) => {
      if (typeof input !== "string") {
        throw new TypeError("Expected input to be a string");
      }
      if (input === "") {
        return { isMatch: false, output: "" };
      }
      const opts = options2 || {};
      const format = opts.format || (posix ? utils.toPosixSlashes : null);
      let match = input === glob;
      let output = match && format ? format(input) : input;
      if (match === false) {
        output = format ? format(input) : input;
        match = output === glob;
      }
      if (match === false || opts.capture === true) {
        if (opts.matchBase === true || opts.basename === true) {
          match = picomatch.matchBase(input, regex, options2, posix);
        } else {
          match = regex.exec(output);
        }
      }
      return { isMatch: Boolean(match), match, output };
    };
    picomatch.matchBase = (input, glob, options2, posix = utils.isWindows(options2)) => {
      const regex = glob instanceof RegExp ? glob : picomatch.makeRe(glob, options2);
      return regex.test(path.basename(input));
    };
    picomatch.isMatch = (str, patterns, options2) => picomatch(patterns, options2)(str);
    picomatch.parse = (pattern, options2) => {
      if (Array.isArray(pattern)) return pattern.map((p) => picomatch.parse(p, options2));
      return parse3(pattern, { ...options2, fastpaths: false });
    };
    picomatch.scan = (input, options2) => scan(input, options2);
    picomatch.compileRe = (state, options2, returnOutput = false, returnState = false) => {
      if (returnOutput === true) {
        return state.output;
      }
      const opts = options2 || {};
      const prepend = opts.contains ? "" : "^";
      const append = opts.contains ? "" : "$";
      let source = `${prepend}(?:${state.output})${append}`;
      if (state && state.negated === true) {
        source = `^(?!${source}).*$`;
      }
      const regex = picomatch.toRegex(source, options2);
      if (returnState === true) {
        regex.state = state;
      }
      return regex;
    };
    picomatch.makeRe = (input, options2 = {}, returnOutput = false, returnState = false) => {
      if (!input || typeof input !== "string") {
        throw new TypeError("Expected a non-empty string");
      }
      let parsed = { negated: false, fastpaths: true };
      if (options2.fastpaths !== false && (input[0] === "." || input[0] === "*")) {
        parsed.output = parse3.fastpaths(input, options2);
      }
      if (!parsed.output) {
        parsed = parse3(input, options2);
      }
      return picomatch.compileRe(parsed, options2, returnOutput, returnState);
    };
    picomatch.toRegex = (source, options2) => {
      try {
        const opts = options2 || {};
        return new RegExp(source, opts.flags || (opts.nocase ? "i" : ""));
      } catch (err) {
        if (options2 && options2.debug === true) throw err;
        return /$^/;
      }
    };
    picomatch.constants = constants;
    module2.exports = picomatch;
  }
});

// node_modules/anymatch/node_modules/picomatch/index.js
var require_picomatch4 = __commonJS({
  "node_modules/anymatch/node_modules/picomatch/index.js"(exports2, module2) {
    "use strict";
    module2.exports = require_picomatch3();
  }
});

// node_modules/normalize-path/index.js
var require_normalize_path = __commonJS({
  "node_modules/normalize-path/index.js"(exports2, module2) {
    module2.exports = function(path, stripTrailing) {
      if (typeof path !== "string") {
        throw new TypeError("expected path to be a string");
      }
      if (path === "\\" || path === "/") return "/";
      var len = path.length;
      if (len <= 1) return path;
      var prefix = "";
      if (len > 4 && path[3] === "\\") {
        var ch = path[2];
        if ((ch === "?" || ch === ".") && path.slice(0, 2) === "\\\\") {
          path = path.slice(2);
          prefix = "//";
        }
      }
      var segs = path.split(/[/\\]+/);
      if (stripTrailing !== false && segs[segs.length - 1] === "") {
        segs.pop();
      }
      return prefix + segs.join("/");
    };
  }
});

// node_modules/anymatch/index.js
var require_anymatch = __commonJS({
  "node_modules/anymatch/index.js"(exports2, module2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    var picomatch = require_picomatch4();
    var normalizePath = require_normalize_path();
    var BANG = "!";
    var DEFAULT_OPTIONS = { returnIndex: false };
    var arrify = (item) => Array.isArray(item) ? item : [item];
    var createPattern = (matcher, options2) => {
      if (typeof matcher === "function") {
        return matcher;
      }
      if (typeof matcher === "string") {
        const glob = picomatch(matcher, options2);
        return (string4) => matcher === string4 || glob(string4);
      }
      if (matcher instanceof RegExp) {
        return (string4) => matcher.test(string4);
      }
      return (string4) => false;
    };
    var matchPatterns = (patterns, negPatterns, args, returnIndex) => {
      const isList = Array.isArray(args);
      const _path = isList ? args[0] : args;
      if (!isList && typeof _path !== "string") {
        throw new TypeError("anymatch: second argument must be a string: got " + Object.prototype.toString.call(_path));
      }
      const path = normalizePath(_path, false);
      for (let index = 0; index < negPatterns.length; index++) {
        const nglob = negPatterns[index];
        if (nglob(path)) {
          return returnIndex ? -1 : false;
        }
      }
      const applied = isList && [path].concat(args.slice(1));
      for (let index = 0; index < patterns.length; index++) {
        const pattern = patterns[index];
        if (isList ? pattern(...applied) : pattern(path)) {
          return returnIndex ? index : true;
        }
      }
      return returnIndex ? -1 : false;
    };
    var anymatch = (matchers, testString, options2 = DEFAULT_OPTIONS) => {
      if (matchers == null) {
        throw new TypeError("anymatch: specify first argument");
      }
      const opts = typeof options2 === "boolean" ? { returnIndex: options2 } : options2;
      const returnIndex = opts.returnIndex || false;
      const mtchers = arrify(matchers);
      const negatedGlobs = mtchers.filter((item) => typeof item === "string" && item.charAt(0) === BANG).map((item) => item.slice(1)).map((item) => picomatch(item, opts));
      const patterns = mtchers.filter((item) => typeof item !== "string" || typeof item === "string" && item.charAt(0) !== BANG).map((matcher) => createPattern(matcher, opts));
      if (testString == null) {
        return (testString2, ri = false) => {
          const returnIndex2 = typeof ri === "boolean" ? ri : false;
          return matchPatterns(patterns, negatedGlobs, testString2, returnIndex2);
        };
      }
      return matchPatterns(patterns, negatedGlobs, testString, returnIndex);
    };
    anymatch.default = anymatch;
    module2.exports = anymatch;
  }
});

// node_modules/is-extglob/index.js
var require_is_extglob = __commonJS({
  "node_modules/is-extglob/index.js"(exports2, module2) {
    module2.exports = function isExtglob(str) {
      if (typeof str !== "string" || str === "") {
        return false;
      }
      var match;
      while (match = /(\\).|([@?!+*]\(.*\))/g.exec(str)) {
        if (match[2]) return true;
        str = str.slice(match.index + match[0].length);
      }
      return false;
    };
  }
});

// node_modules/is-glob/index.js
var require_is_glob = __commonJS({
  "node_modules/is-glob/index.js"(exports2, module2) {
    var isExtglob = require_is_extglob();
    var chars = { "{": "}", "(": ")", "[": "]" };
    var strictCheck = function(str) {
      if (str[0] === "!") {
        return true;
      }
      var index = 0;
      var pipeIndex = -2;
      var closeSquareIndex = -2;
      var closeCurlyIndex = -2;
      var closeParenIndex = -2;
      var backSlashIndex = -2;
      while (index < str.length) {
        if (str[index] === "*") {
          return true;
        }
        if (str[index + 1] === "?" && /[\].+)]/.test(str[index])) {
          return true;
        }
        if (closeSquareIndex !== -1 && str[index] === "[" && str[index + 1] !== "]") {
          if (closeSquareIndex < index) {
            closeSquareIndex = str.indexOf("]", index);
          }
          if (closeSquareIndex > index) {
            if (backSlashIndex === -1 || backSlashIndex > closeSquareIndex) {
              return true;
            }
            backSlashIndex = str.indexOf("\\", index);
            if (backSlashIndex === -1 || backSlashIndex > closeSquareIndex) {
              return true;
            }
          }
        }
        if (closeCurlyIndex !== -1 && str[index] === "{" && str[index + 1] !== "}") {
          closeCurlyIndex = str.indexOf("}", index);
          if (closeCurlyIndex > index) {
            backSlashIndex = str.indexOf("\\", index);
            if (backSlashIndex === -1 || backSlashIndex > closeCurlyIndex) {
              return true;
            }
          }
        }
        if (closeParenIndex !== -1 && str[index] === "(" && str[index + 1] === "?" && /[:!=]/.test(str[index + 2]) && str[index + 3] !== ")") {
          closeParenIndex = str.indexOf(")", index);
          if (closeParenIndex > index) {
            backSlashIndex = str.indexOf("\\", index);
            if (backSlashIndex === -1 || backSlashIndex > closeParenIndex) {
              return true;
            }
          }
        }
        if (pipeIndex !== -1 && str[index] === "(" && str[index + 1] !== "|") {
          if (pipeIndex < index) {
            pipeIndex = str.indexOf("|", index);
          }
          if (pipeIndex !== -1 && str[pipeIndex + 1] !== ")") {
            closeParenIndex = str.indexOf(")", pipeIndex);
            if (closeParenIndex > pipeIndex) {
              backSlashIndex = str.indexOf("\\", pipeIndex);
              if (backSlashIndex === -1 || backSlashIndex > closeParenIndex) {
                return true;
              }
            }
          }
        }
        if (str[index] === "\\") {
          var open2 = str[index + 1];
          index += 2;
          var close = chars[open2];
          if (close) {
            var n = str.indexOf(close, index);
            if (n !== -1) {
              index = n + 1;
            }
          }
          if (str[index] === "!") {
            return true;
          }
        } else {
          index++;
        }
      }
      return false;
    };
    var relaxedCheck = function(str) {
      if (str[0] === "!") {
        return true;
      }
      var index = 0;
      while (index < str.length) {
        if (/[*?{}()[\]]/.test(str[index])) {
          return true;
        }
        if (str[index] === "\\") {
          var open2 = str[index + 1];
          index += 2;
          var close = chars[open2];
          if (close) {
            var n = str.indexOf(close, index);
            if (n !== -1) {
              index = n + 1;
            }
          }
          if (str[index] === "!") {
            return true;
          }
        } else {
          index++;
        }
      }
      return false;
    };
    module2.exports = function isGlob(str, options2) {
      if (typeof str !== "string" || str === "") {
        return false;
      }
      if (isExtglob(str)) {
        return true;
      }
      var check2 = strictCheck;
      if (options2 && options2.strict === false) {
        check2 = relaxedCheck;
      }
      return check2(str);
    };
  }
});

// node_modules/glob-parent/index.js
var require_glob_parent = __commonJS({
  "node_modules/glob-parent/index.js"(exports2, module2) {
    "use strict";
    var isGlob = require_is_glob();
    var pathPosixDirname = require("path").posix.dirname;
    var isWin32 = require("os").platform() === "win32";
    var slash = "/";
    var backslash = /\\/g;
    var enclosure = /[\{\[].*[\}\]]$/;
    var globby = /(^|[^\\])([\{\[]|\([^\)]+$)/;
    var escaped = /\\([\!\*\?\|\[\]\(\)\{\}])/g;
    module2.exports = function globParent(str, opts) {
      var options2 = Object.assign({ flipBackslashes: true }, opts);
      if (options2.flipBackslashes && isWin32 && str.indexOf(slash) < 0) {
        str = str.replace(backslash, slash);
      }
      if (enclosure.test(str)) {
        str += slash;
      }
      str += "a";
      do {
        str = pathPosixDirname(str);
      } while (isGlob(str) || globby.test(str));
      return str.replace(escaped, "$1");
    };
  }
});

// node_modules/braces/lib/utils.js
var require_utils5 = __commonJS({
  "node_modules/braces/lib/utils.js"(exports2) {
    "use strict";
    exports2.isInteger = (num) => {
      if (typeof num === "number") {
        return Number.isInteger(num);
      }
      if (typeof num === "string" && num.trim() !== "") {
        return Number.isInteger(Number(num));
      }
      return false;
    };
    exports2.find = (node, type) => node.nodes.find((node2) => node2.type === type);
    exports2.exceedsLimit = (min, max, step = 1, limit) => {
      if (limit === false) return false;
      if (!exports2.isInteger(min) || !exports2.isInteger(max)) return false;
      return (Number(max) - Number(min)) / Number(step) >= limit;
    };
    exports2.escapeNode = (block, n = 0, type) => {
      const node = block.nodes[n];
      if (!node) return;
      if (type && node.type === type || node.type === "open" || node.type === "close") {
        if (node.escaped !== true) {
          node.value = "\\" + node.value;
          node.escaped = true;
        }
      }
    };
    exports2.encloseBrace = (node) => {
      if (node.type !== "brace") return false;
      if (node.commas >> 0 + node.ranges >> 0 === 0) {
        node.invalid = true;
        return true;
      }
      return false;
    };
    exports2.isInvalidBrace = (block) => {
      if (block.type !== "brace") return false;
      if (block.invalid === true || block.dollar) return true;
      if (block.commas >> 0 + block.ranges >> 0 === 0) {
        block.invalid = true;
        return true;
      }
      if (block.open !== true || block.close !== true) {
        block.invalid = true;
        return true;
      }
      return false;
    };
    exports2.isOpenOrClose = (node) => {
      if (node.type === "open" || node.type === "close") {
        return true;
      }
      return node.open === true || node.close === true;
    };
    exports2.reduce = (nodes) => nodes.reduce((acc, node) => {
      if (node.type === "text") acc.push(node.value);
      if (node.type === "range") node.type = "text";
      return acc;
    }, []);
    exports2.flatten = (...args) => {
      const result = [];
      const flat = (arr) => {
        for (let i = 0; i < arr.length; i++) {
          const ele = arr[i];
          if (Array.isArray(ele)) {
            flat(ele);
            continue;
          }
          if (ele !== void 0) {
            result.push(ele);
          }
        }
        return result;
      };
      flat(args);
      return result;
    };
  }
});

// node_modules/braces/lib/stringify.js
var require_stringify3 = __commonJS({
  "node_modules/braces/lib/stringify.js"(exports2, module2) {
    "use strict";
    var utils = require_utils5();
    module2.exports = (ast, options2 = {}) => {
      const stringify = (node, parent = {}) => {
        const invalidBlock = options2.escapeInvalid && utils.isInvalidBrace(parent);
        const invalidNode = node.invalid === true && options2.escapeInvalid === true;
        let output = "";
        if (node.value) {
          if ((invalidBlock || invalidNode) && utils.isOpenOrClose(node)) {
            return "\\" + node.value;
          }
          return node.value;
        }
        if (node.value) {
          return node.value;
        }
        if (node.nodes) {
          for (const child of node.nodes) {
            output += stringify(child);
          }
        }
        return output;
      };
      return stringify(ast);
    };
  }
});

// node_modules/is-number/index.js
var require_is_number = __commonJS({
  "node_modules/is-number/index.js"(exports2, module2) {
    "use strict";
    module2.exports = function(num) {
      if (typeof num === "number") {
        return num - num === 0;
      }
      if (typeof num === "string" && num.trim() !== "") {
        return Number.isFinite ? Number.isFinite(+num) : isFinite(+num);
      }
      return false;
    };
  }
});

// node_modules/to-regex-range/index.js
var require_to_regex_range = __commonJS({
  "node_modules/to-regex-range/index.js"(exports2, module2) {
    "use strict";
    var isNumber = require_is_number();
    var toRegexRange = (min, max, options2) => {
      if (isNumber(min) === false) {
        throw new TypeError("toRegexRange: expected the first argument to be a number");
      }
      if (max === void 0 || min === max) {
        return String(min);
      }
      if (isNumber(max) === false) {
        throw new TypeError("toRegexRange: expected the second argument to be a number.");
      }
      let opts = { relaxZeros: true, ...options2 };
      if (typeof opts.strictZeros === "boolean") {
        opts.relaxZeros = opts.strictZeros === false;
      }
      let relax = String(opts.relaxZeros);
      let shorthand = String(opts.shorthand);
      let capture = String(opts.capture);
      let wrap = String(opts.wrap);
      let cacheKey2 = min + ":" + max + "=" + relax + shorthand + capture + wrap;
      if (toRegexRange.cache.hasOwnProperty(cacheKey2)) {
        return toRegexRange.cache[cacheKey2].result;
      }
      let a = Math.min(min, max);
      let b = Math.max(min, max);
      if (Math.abs(a - b) === 1) {
        let result = min + "|" + max;
        if (opts.capture) {
          return `(${result})`;
        }
        if (opts.wrap === false) {
          return result;
        }
        return `(?:${result})`;
      }
      let isPadded = hasPadding(min) || hasPadding(max);
      let state = { min, max, a, b };
      let positives = [];
      let negatives = [];
      if (isPadded) {
        state.isPadded = isPadded;
        state.maxLen = String(state.max).length;
      }
      if (a < 0) {
        let newMin = b < 0 ? Math.abs(b) : 1;
        negatives = splitToPatterns(newMin, Math.abs(a), state, opts);
        a = state.a = 0;
      }
      if (b >= 0) {
        positives = splitToPatterns(a, b, state, opts);
      }
      state.negatives = negatives;
      state.positives = positives;
      state.result = collatePatterns(negatives, positives, opts);
      if (opts.capture === true) {
        state.result = `(${state.result})`;
      } else if (opts.wrap !== false && positives.length + negatives.length > 1) {
        state.result = `(?:${state.result})`;
      }
      toRegexRange.cache[cacheKey2] = state;
      return state.result;
    };
    function collatePatterns(neg, pos, options2) {
      let onlyNegative = filterPatterns(neg, pos, "-", false, options2) || [];
      let onlyPositive = filterPatterns(pos, neg, "", false, options2) || [];
      let intersected = filterPatterns(neg, pos, "-?", true, options2) || [];
      let subpatterns = onlyNegative.concat(intersected).concat(onlyPositive);
      return subpatterns.join("|");
    }
    function splitToRanges(min, max) {
      let nines = 1;
      let zeros = 1;
      let stop = countNines(min, nines);
      let stops = /* @__PURE__ */ new Set([max]);
      while (min <= stop && stop <= max) {
        stops.add(stop);
        nines += 1;
        stop = countNines(min, nines);
      }
      stop = countZeros(max + 1, zeros) - 1;
      while (min < stop && stop <= max) {
        stops.add(stop);
        zeros += 1;
        stop = countZeros(max + 1, zeros) - 1;
      }
      stops = [...stops];
      stops.sort(compare);
      return stops;
    }
    function rangeToPattern(start, stop, options2) {
      if (start === stop) {
        return { pattern: start, count: [], digits: 0 };
      }
      let zipped = zip(start, stop);
      let digits = zipped.length;
      let pattern = "";
      let count = 0;
      for (let i = 0; i < digits; i++) {
        let [startDigit, stopDigit] = zipped[i];
        if (startDigit === stopDigit) {
          pattern += startDigit;
        } else if (startDigit !== "0" || stopDigit !== "9") {
          pattern += toCharacterClass(startDigit, stopDigit, options2);
        } else {
          count++;
        }
      }
      if (count) {
        pattern += options2.shorthand === true ? "\\d" : "[0-9]";
      }
      return { pattern, count: [count], digits };
    }
    function splitToPatterns(min, max, tok, options2) {
      let ranges = splitToRanges(min, max);
      let tokens = [];
      let start = min;
      let prev;
      for (let i = 0; i < ranges.length; i++) {
        let max2 = ranges[i];
        let obj = rangeToPattern(String(start), String(max2), options2);
        let zeros = "";
        if (!tok.isPadded && prev && prev.pattern === obj.pattern) {
          if (prev.count.length > 1) {
            prev.count.pop();
          }
          prev.count.push(obj.count[0]);
          prev.string = prev.pattern + toQuantifier(prev.count);
          start = max2 + 1;
          continue;
        }
        if (tok.isPadded) {
          zeros = padZeros(max2, tok, options2);
        }
        obj.string = zeros + obj.pattern + toQuantifier(obj.count);
        tokens.push(obj);
        start = max2 + 1;
        prev = obj;
      }
      return tokens;
    }
    function filterPatterns(arr, comparison, prefix, intersection2, options2) {
      let result = [];
      for (let ele of arr) {
        let { string: string4 } = ele;
        if (!intersection2 && !contains(comparison, "string", string4)) {
          result.push(prefix + string4);
        }
        if (intersection2 && contains(comparison, "string", string4)) {
          result.push(prefix + string4);
        }
      }
      return result;
    }
    function zip(a, b) {
      let arr = [];
      for (let i = 0; i < a.length; i++) arr.push([a[i], b[i]]);
      return arr;
    }
    function compare(a, b) {
      return a > b ? 1 : b > a ? -1 : 0;
    }
    function contains(arr, key, val) {
      return arr.some((ele) => ele[key] === val);
    }
    function countNines(min, len) {
      return Number(String(min).slice(0, -len) + "9".repeat(len));
    }
    function countZeros(integer2, zeros) {
      return integer2 - integer2 % Math.pow(10, zeros);
    }
    function toQuantifier(digits) {
      let [start = 0, stop = ""] = digits;
      if (stop || start > 1) {
        return `{${start + (stop ? "," + stop : "")}}`;
      }
      return "";
    }
    function toCharacterClass(a, b, options2) {
      return `[${a}${b - a === 1 ? "" : "-"}${b}]`;
    }
    function hasPadding(str) {
      return /^-?(0+)\d/.test(str);
    }
    function padZeros(value, tok, options2) {
      if (!tok.isPadded) {
        return value;
      }
      let diff2 = Math.abs(tok.maxLen - String(value).length);
      let relax = options2.relaxZeros !== false;
      switch (diff2) {
        case 0:
          return "";
        case 1:
          return relax ? "0?" : "0";
        case 2:
          return relax ? "0{0,2}" : "00";
        default: {
          return relax ? `0{0,${diff2}}` : `0{${diff2}}`;
        }
      }
    }
    toRegexRange.cache = {};
    toRegexRange.clearCache = () => toRegexRange.cache = {};
    module2.exports = toRegexRange;
  }
});

// node_modules/fill-range/index.js
var require_fill_range = __commonJS({
  "node_modules/fill-range/index.js"(exports2, module2) {
    "use strict";
    var util2 = require("util");
    var toRegexRange = require_to_regex_range();
    var isObject2 = (val) => val !== null && typeof val === "object" && !Array.isArray(val);
    var transform2 = (toNumber) => {
      return (value) => toNumber === true ? Number(value) : String(value);
    };
    var isValidValue = (value) => {
      return typeof value === "number" || typeof value === "string" && value !== "";
    };
    var isNumber = (num) => Number.isInteger(+num);
    var zeros = (input) => {
      let value = `${input}`;
      let index = -1;
      if (value[0] === "-") value = value.slice(1);
      if (value === "0") return false;
      while (value[++index] === "0") ;
      return index > 0;
    };
    var stringify = (start, end, options2) => {
      if (typeof start === "string" || typeof end === "string") {
        return true;
      }
      return options2.stringify === true;
    };
    var pad = (input, maxLength, toNumber) => {
      if (maxLength > 0) {
        let dash = input[0] === "-" ? "-" : "";
        if (dash) input = input.slice(1);
        input = dash + input.padStart(dash ? maxLength - 1 : maxLength, "0");
      }
      if (toNumber === false) {
        return String(input);
      }
      return input;
    };
    var toMaxLen = (input, maxLength) => {
      let negative = input[0] === "-" ? "-" : "";
      if (negative) {
        input = input.slice(1);
        maxLength--;
      }
      while (input.length < maxLength) input = "0" + input;
      return negative ? "-" + input : input;
    };
    var toSequence = (parts, options2, maxLen) => {
      parts.negatives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
      parts.positives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
      let prefix = options2.capture ? "" : "?:";
      let positives = "";
      let negatives = "";
      let result;
      if (parts.positives.length) {
        positives = parts.positives.map((v) => toMaxLen(String(v), maxLen)).join("|");
      }
      if (parts.negatives.length) {
        negatives = `-(${prefix}${parts.negatives.map((v) => toMaxLen(String(v), maxLen)).join("|")})`;
      }
      if (positives && negatives) {
        result = `${positives}|${negatives}`;
      } else {
        result = positives || negatives;
      }
      if (options2.wrap) {
        return `(${prefix}${result})`;
      }
      return result;
    };
    var toRange = (a, b, isNumbers, options2) => {
      if (isNumbers) {
        return toRegexRange(a, b, { wrap: false, ...options2 });
      }
      let start = String.fromCharCode(a);
      if (a === b) return start;
      let stop = String.fromCharCode(b);
      return `[${start}-${stop}]`;
    };
    var toRegex = (start, end, options2) => {
      if (Array.isArray(start)) {
        let wrap = options2.wrap === true;
        let prefix = options2.capture ? "" : "?:";
        return wrap ? `(${prefix}${start.join("|")})` : start.join("|");
      }
      return toRegexRange(start, end, options2);
    };
    var rangeError = (...args) => {
      return new RangeError("Invalid range arguments: " + util2.inspect(...args));
    };
    var invalidRange = (start, end, options2) => {
      if (options2.strictRanges === true) throw rangeError([start, end]);
      return [];
    };
    var invalidStep = (step, options2) => {
      if (options2.strictRanges === true) {
        throw new TypeError(`Expected step "${step}" to be a number`);
      }
      return [];
    };
    var fillNumbers = (start, end, step = 1, options2 = {}) => {
      let a = Number(start);
      let b = Number(end);
      if (!Number.isInteger(a) || !Number.isInteger(b)) {
        if (options2.strictRanges === true) throw rangeError([start, end]);
        return [];
      }
      if (a === 0) a = 0;
      if (b === 0) b = 0;
      let descending = a > b;
      let startString = String(start);
      let endString = String(end);
      let stepString = String(step);
      step = Math.max(Math.abs(step), 1);
      let padded = zeros(startString) || zeros(endString) || zeros(stepString);
      let maxLen = padded ? Math.max(startString.length, endString.length, stepString.length) : 0;
      let toNumber = padded === false && stringify(start, end, options2) === false;
      let format = options2.transform || transform2(toNumber);
      if (options2.toRegex && step === 1) {
        return toRange(toMaxLen(start, maxLen), toMaxLen(end, maxLen), true, options2);
      }
      let parts = { negatives: [], positives: [] };
      let push = (num) => parts[num < 0 ? "negatives" : "positives"].push(Math.abs(num));
      let range = [];
      let index = 0;
      while (descending ? a >= b : a <= b) {
        if (options2.toRegex === true && step > 1) {
          push(a);
        } else {
          range.push(pad(format(a, index), maxLen, toNumber));
        }
        a = descending ? a - step : a + step;
        index++;
      }
      if (options2.toRegex === true) {
        return step > 1 ? toSequence(parts, options2, maxLen) : toRegex(range, null, { wrap: false, ...options2 });
      }
      return range;
    };
    var fillLetters = (start, end, step = 1, options2 = {}) => {
      if (!isNumber(start) && start.length > 1 || !isNumber(end) && end.length > 1) {
        return invalidRange(start, end, options2);
      }
      let format = options2.transform || ((val) => String.fromCharCode(val));
      let a = `${start}`.charCodeAt(0);
      let b = `${end}`.charCodeAt(0);
      let descending = a > b;
      let min = Math.min(a, b);
      let max = Math.max(a, b);
      if (options2.toRegex && step === 1) {
        return toRange(min, max, false, options2);
      }
      let range = [];
      let index = 0;
      while (descending ? a >= b : a <= b) {
        range.push(format(a, index));
        a = descending ? a - step : a + step;
        index++;
      }
      if (options2.toRegex === true) {
        return toRegex(range, null, { wrap: false, options: options2 });
      }
      return range;
    };
    var fill = (start, end, step, options2 = {}) => {
      if (end == null && isValidValue(start)) {
        return [start];
      }
      if (!isValidValue(start) || !isValidValue(end)) {
        return invalidRange(start, end, options2);
      }
      if (typeof step === "function") {
        return fill(start, end, 1, { transform: step });
      }
      if (isObject2(step)) {
        return fill(start, end, 0, step);
      }
      let opts = { ...options2 };
      if (opts.capture === true) opts.wrap = true;
      step = step || opts.step || 1;
      if (!isNumber(step)) {
        if (step != null && !isObject2(step)) return invalidStep(step, opts);
        return fill(start, end, 1, step);
      }
      if (isNumber(start) && isNumber(end)) {
        return fillNumbers(start, end, step, opts);
      }
      return fillLetters(start, end, Math.max(Math.abs(step), 1), opts);
    };
    module2.exports = fill;
  }
});

// node_modules/braces/lib/compile.js
var require_compile = __commonJS({
  "node_modules/braces/lib/compile.js"(exports2, module2) {
    "use strict";
    var fill = require_fill_range();
    var utils = require_utils5();
    var compile = (ast, options2 = {}) => {
      const walk = (node, parent = {}) => {
        const invalidBlock = utils.isInvalidBrace(parent);
        const invalidNode = node.invalid === true && options2.escapeInvalid === true;
        const invalid = invalidBlock === true || invalidNode === true;
        const prefix = options2.escapeInvalid === true ? "\\" : "";
        let output = "";
        if (node.isOpen === true) {
          return prefix + node.value;
        }
        if (node.isClose === true) {
          console.log("node.isClose", prefix, node.value);
          return prefix + node.value;
        }
        if (node.type === "open") {
          return invalid ? prefix + node.value : "(";
        }
        if (node.type === "close") {
          return invalid ? prefix + node.value : ")";
        }
        if (node.type === "comma") {
          return node.prev.type === "comma" ? "" : invalid ? node.value : "|";
        }
        if (node.value) {
          return node.value;
        }
        if (node.nodes && node.ranges > 0) {
          const args = utils.reduce(node.nodes);
          const range = fill(...args, { ...options2, wrap: false, toRegex: true, strictZeros: true });
          if (range.length !== 0) {
            return args.length > 1 && range.length > 1 ? `(${range})` : range;
          }
        }
        if (node.nodes) {
          for (const child of node.nodes) {
            output += walk(child, node);
          }
        }
        return output;
      };
      return walk(ast);
    };
    module2.exports = compile;
  }
});

// node_modules/braces/lib/expand.js
var require_expand = __commonJS({
  "node_modules/braces/lib/expand.js"(exports2, module2) {
    "use strict";
    var fill = require_fill_range();
    var stringify = require_stringify3();
    var utils = require_utils5();
    var append = (queue = "", stash = "", enclose = false) => {
      const result = [];
      queue = [].concat(queue);
      stash = [].concat(stash);
      if (!stash.length) return queue;
      if (!queue.length) {
        return enclose ? utils.flatten(stash).map((ele) => `{${ele}}`) : stash;
      }
      for (const item of queue) {
        if (Array.isArray(item)) {
          for (const value of item) {
            result.push(append(value, stash, enclose));
          }
        } else {
          for (let ele of stash) {
            if (enclose === true && typeof ele === "string") ele = `{${ele}}`;
            result.push(Array.isArray(ele) ? append(item, ele, enclose) : item + ele);
          }
        }
      }
      return utils.flatten(result);
    };
    var expand = (ast, options2 = {}) => {
      const rangeLimit = options2.rangeLimit === void 0 ? 1e3 : options2.rangeLimit;
      const walk = (node, parent = {}) => {
        node.queue = [];
        let p = parent;
        let q = parent.queue;
        while (p.type !== "brace" && p.type !== "root" && p.parent) {
          p = p.parent;
          q = p.queue;
        }
        if (node.invalid || node.dollar) {
          q.push(append(q.pop(), stringify(node, options2)));
          return;
        }
        if (node.type === "brace" && node.invalid !== true && node.nodes.length === 2) {
          q.push(append(q.pop(), ["{}"]));
          return;
        }
        if (node.nodes && node.ranges > 0) {
          const args = utils.reduce(node.nodes);
          if (utils.exceedsLimit(...args, options2.step, rangeLimit)) {
            throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");
          }
          let range = fill(...args, options2);
          if (range.length === 0) {
            range = stringify(node, options2);
          }
          q.push(append(q.pop(), range));
          node.nodes = [];
          return;
        }
        const enclose = utils.encloseBrace(node);
        let queue = node.queue;
        let block = node;
        while (block.type !== "brace" && block.type !== "root" && block.parent) {
          block = block.parent;
          queue = block.queue;
        }
        for (let i = 0; i < node.nodes.length; i++) {
          const child = node.nodes[i];
          if (child.type === "comma" && node.type === "brace") {
            if (i === 1) queue.push("");
            queue.push("");
            continue;
          }
          if (child.type === "close") {
            q.push(append(q.pop(), queue, enclose));
            continue;
          }
          if (child.value && child.type !== "open") {
            queue.push(append(queue.pop(), child.value));
            continue;
          }
          if (child.nodes) {
            walk(child, node);
          }
        }
        return queue;
      };
      return utils.flatten(walk(ast));
    };
    module2.exports = expand;
  }
});

// node_modules/braces/lib/constants.js
var require_constants8 = __commonJS({
  "node_modules/braces/lib/constants.js"(exports2, module2) {
    "use strict";
    module2.exports = {
      MAX_LENGTH: 1e4,
      // Digits
      CHAR_0: "0",
      /* 0 */
      CHAR_9: "9",
      /* 9 */
      // Alphabet chars.
      CHAR_UPPERCASE_A: "A",
      /* A */
      CHAR_LOWERCASE_A: "a",
      /* a */
      CHAR_UPPERCASE_Z: "Z",
      /* Z */
      CHAR_LOWERCASE_Z: "z",
      /* z */
      CHAR_LEFT_PARENTHESES: "(",
      /* ( */
      CHAR_RIGHT_PARENTHESES: ")",
      /* ) */
      CHAR_ASTERISK: "*",
      /* * */
      // Non-alphabetic chars.
      CHAR_AMPERSAND: "&",
      /* & */
      CHAR_AT: "@",
      /* @ */
      CHAR_BACKSLASH: "\\",
      /* \ */
      CHAR_BACKTICK: "`",
      /* ` */
      CHAR_CARRIAGE_RETURN: "\r",
      /* \r */
      CHAR_CIRCUMFLEX_ACCENT: "^",
      /* ^ */
      CHAR_COLON: ":",
      /* : */
      CHAR_COMMA: ",",
      /* , */
      CHAR_DOLLAR: "$",
      /* . */
      CHAR_DOT: ".",
      /* . */
      CHAR_DOUBLE_QUOTE: '"',
      /* " */
      CHAR_EQUAL: "=",
      /* = */
      CHAR_EXCLAMATION_MARK: "!",
      /* ! */
      CHAR_FORM_FEED: "\f",
      /* \f */
      CHAR_FORWARD_SLASH: "/",
      /* / */
      CHAR_HASH: "#",
      /* # */
      CHAR_HYPHEN_MINUS: "-",
      /* - */
      CHAR_LEFT_ANGLE_BRACKET: "<",
      /* < */
      CHAR_LEFT_CURLY_BRACE: "{",
      /* { */
      CHAR_LEFT_SQUARE_BRACKET: "[",
      /* [ */
      CHAR_LINE_FEED: "\n",
      /* \n */
      CHAR_NO_BREAK_SPACE: "\xA0",
      /* \u00A0 */
      CHAR_PERCENT: "%",
      /* % */
      CHAR_PLUS: "+",
      /* + */
      CHAR_QUESTION_MARK: "?",
      /* ? */
      CHAR_RIGHT_ANGLE_BRACKET: ">",
      /* > */
      CHAR_RIGHT_CURLY_BRACE: "}",
      /* } */
      CHAR_RIGHT_SQUARE_BRACKET: "]",
      /* ] */
      CHAR_SEMICOLON: ";",
      /* ; */
      CHAR_SINGLE_QUOTE: "'",
      /* ' */
      CHAR_SPACE: " ",
      /*   */
      CHAR_TAB: "	",
      /* \t */
      CHAR_UNDERSCORE: "_",
      /* _ */
      CHAR_VERTICAL_LINE: "|",
      /* | */
      CHAR_ZERO_WIDTH_NOBREAK_SPACE: "\uFEFF"
      /* \uFEFF */
    };
  }
});

// node_modules/braces/lib/parse.js
var require_parse4 = __commonJS({
  "node_modules/braces/lib/parse.js"(exports2, module2) {
    "use strict";
    var stringify = require_stringify3();
    var {
      MAX_LENGTH,
      CHAR_BACKSLASH,
      /* \ */
      CHAR_BACKTICK,
      /* ` */
      CHAR_COMMA,
      /* , */
      CHAR_DOT,
      /* . */
      CHAR_LEFT_PARENTHESES,
      /* ( */
      CHAR_RIGHT_PARENTHESES,
      /* ) */
      CHAR_LEFT_CURLY_BRACE,
      /* { */
      CHAR_RIGHT_CURLY_BRACE,
      /* } */
      CHAR_LEFT_SQUARE_BRACKET,
      /* [ */
      CHAR_RIGHT_SQUARE_BRACKET,
      /* ] */
      CHAR_DOUBLE_QUOTE,
      /* " */
      CHAR_SINGLE_QUOTE,
      /* ' */
      CHAR_NO_BREAK_SPACE,
      CHAR_ZERO_WIDTH_NOBREAK_SPACE
    } = require_constants8();
    var parse3 = (input, options2 = {}) => {
      if (typeof input !== "string") {
        throw new TypeError("Expected a string");
      }
      const opts = options2 || {};
      const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
      if (input.length > max) {
        throw new SyntaxError(`Input length (${input.length}), exceeds max characters (${max})`);
      }
      const ast = { type: "root", input, nodes: [] };
      const stack = [ast];
      let block = ast;
      let prev = ast;
      let brackets = 0;
      const length = input.length;
      let index = 0;
      let depth = 0;
      let value;
      const advance = () => input[index++];
      const push = (node) => {
        if (node.type === "text" && prev.type === "dot") {
          prev.type = "text";
        }
        if (prev && prev.type === "text" && node.type === "text") {
          prev.value += node.value;
          return;
        }
        block.nodes.push(node);
        node.parent = block;
        node.prev = prev;
        prev = node;
        return node;
      };
      push({ type: "bos" });
      while (index < length) {
        block = stack[stack.length - 1];
        value = advance();
        if (value === CHAR_ZERO_WIDTH_NOBREAK_SPACE || value === CHAR_NO_BREAK_SPACE) {
          continue;
        }
        if (value === CHAR_BACKSLASH) {
          push({ type: "text", value: (options2.keepEscaping ? value : "") + advance() });
          continue;
        }
        if (value === CHAR_RIGHT_SQUARE_BRACKET) {
          push({ type: "text", value: "\\" + value });
          continue;
        }
        if (value === CHAR_LEFT_SQUARE_BRACKET) {
          brackets++;
          let next;
          while (index < length && (next = advance())) {
            value += next;
            if (next === CHAR_LEFT_SQUARE_BRACKET) {
              brackets++;
              continue;
            }
            if (next === CHAR_BACKSLASH) {
              value += advance();
              continue;
            }
            if (next === CHAR_RIGHT_SQUARE_BRACKET) {
              brackets--;
              if (brackets === 0) {
                break;
              }
            }
          }
          push({ type: "text", value });
          continue;
        }
        if (value === CHAR_LEFT_PARENTHESES) {
          block = push({ type: "paren", nodes: [] });
          stack.push(block);
          push({ type: "text", value });
          continue;
        }
        if (value === CHAR_RIGHT_PARENTHESES) {
          if (block.type !== "paren") {
            push({ type: "text", value });
            continue;
          }
          block = stack.pop();
          push({ type: "text", value });
          block = stack[stack.length - 1];
          continue;
        }
        if (value === CHAR_DOUBLE_QUOTE || value === CHAR_SINGLE_QUOTE || value === CHAR_BACKTICK) {
          const open2 = value;
          let next;
          if (options2.keepQuotes !== true) {
            value = "";
          }
          while (index < length && (next = advance())) {
            if (next === CHAR_BACKSLASH) {
              value += next + advance();
              continue;
            }
            if (next === open2) {
              if (options2.keepQuotes === true) value += next;
              break;
            }
            value += next;
          }
          push({ type: "text", value });
          continue;
        }
        if (value === CHAR_LEFT_CURLY_BRACE) {
          depth++;
          const dollar = prev.value && prev.value.slice(-1) === "$" || block.dollar === true;
          const brace = {
            type: "brace",
            open: true,
            close: false,
            dollar,
            depth,
            commas: 0,
            ranges: 0,
            nodes: []
          };
          block = push(brace);
          stack.push(block);
          push({ type: "open", value });
          continue;
        }
        if (value === CHAR_RIGHT_CURLY_BRACE) {
          if (block.type !== "brace") {
            push({ type: "text", value });
            continue;
          }
          const type = "close";
          block = stack.pop();
          block.close = true;
          push({ type, value });
          depth--;
          block = stack[stack.length - 1];
          continue;
        }
        if (value === CHAR_COMMA && depth > 0) {
          if (block.ranges > 0) {
            block.ranges = 0;
            const open2 = block.nodes.shift();
            block.nodes = [open2, { type: "text", value: stringify(block) }];
          }
          push({ type: "comma", value });
          block.commas++;
          continue;
        }
        if (value === CHAR_DOT && depth > 0 && block.commas === 0) {
          const siblings = block.nodes;
          if (depth === 0 || siblings.length === 0) {
            push({ type: "text", value });
            continue;
          }
          if (prev.type === "dot") {
            block.range = [];
            prev.value += value;
            prev.type = "range";
            if (block.nodes.length !== 3 && block.nodes.length !== 5) {
              block.invalid = true;
              block.ranges = 0;
              prev.type = "text";
              continue;
            }
            block.ranges++;
            block.args = [];
            continue;
          }
          if (prev.type === "range") {
            siblings.pop();
            const before = siblings[siblings.length - 1];
            before.value += prev.value + value;
            prev = before;
            block.ranges--;
            continue;
          }
          push({ type: "dot", value });
          continue;
        }
        push({ type: "text", value });
      }
      do {
        block = stack.pop();
        if (block.type !== "root") {
          block.nodes.forEach((node) => {
            if (!node.nodes) {
              if (node.type === "open") node.isOpen = true;
              if (node.type === "close") node.isClose = true;
              if (!node.nodes) node.type = "text";
              node.invalid = true;
            }
          });
          const parent = stack[stack.length - 1];
          const index2 = parent.nodes.indexOf(block);
          parent.nodes.splice(index2, 1, ...block.nodes);
        }
      } while (stack.length > 0);
      push({ type: "eos" });
      return ast;
    };
    module2.exports = parse3;
  }
});

// node_modules/braces/index.js
var require_braces = __commonJS({
  "node_modules/braces/index.js"(exports2, module2) {
    "use strict";
    var stringify = require_stringify3();
    var compile = require_compile();
    var expand = require_expand();
    var parse3 = require_parse4();
    var braces = (input, options2 = {}) => {
      let output = [];
      if (Array.isArray(input)) {
        for (const pattern of input) {
          const result = braces.create(pattern, options2);
          if (Array.isArray(result)) {
            output.push(...result);
          } else {
            output.push(result);
          }
        }
      } else {
        output = [].concat(braces.create(input, options2));
      }
      if (options2 && options2.expand === true && options2.nodupes === true) {
        output = [...new Set(output)];
      }
      return output;
    };
    braces.parse = (input, options2 = {}) => parse3(input, options2);
    braces.stringify = (input, options2 = {}) => {
      if (typeof input === "string") {
        return stringify(braces.parse(input, options2), options2);
      }
      return stringify(input, options2);
    };
    braces.compile = (input, options2 = {}) => {
      if (typeof input === "string") {
        input = braces.parse(input, options2);
      }
      return compile(input, options2);
    };
    braces.expand = (input, options2 = {}) => {
      if (typeof input === "string") {
        input = braces.parse(input, options2);
      }
      let result = expand(input, options2);
      if (options2.noempty === true) {
        result = result.filter(Boolean);
      }
      if (options2.nodupes === true) {
        result = [...new Set(result)];
      }
      return result;
    };
    braces.create = (input, options2 = {}) => {
      if (input === "" || input.length < 3) {
        return [input];
      }
      return options2.expand !== true ? braces.compile(input, options2) : braces.expand(input, options2);
    };
    module2.exports = braces;
  }
});

// node_modules/binary-extensions/binary-extensions.json
var require_binary_extensions = __commonJS({
  "node_modules/binary-extensions/binary-extensions.json"(exports2, module2) {
    module2.exports = [
      "3dm",
      "3ds",
      "3g2",
      "3gp",
      "7z",
      "a",
      "aac",
      "adp",
      "afdesign",
      "afphoto",
      "afpub",
      "ai",
      "aif",
      "aiff",
      "alz",
      "ape",
      "apk",
      "appimage",
      "ar",
      "arj",
      "asf",
      "au",
      "avi",
      "bak",
      "baml",
      "bh",
      "bin",
      "bk",
      "bmp",
      "btif",
      "bz2",
      "bzip2",
      "cab",
      "caf",
      "cgm",
      "class",
      "cmx",
      "cpio",
      "cr2",
      "cur",
      "dat",
      "dcm",
      "deb",
      "dex",
      "djvu",
      "dll",
      "dmg",
      "dng",
      "doc",
      "docm",
      "docx",
      "dot",
      "dotm",
      "dra",
      "DS_Store",
      "dsk",
      "dts",
      "dtshd",
      "dvb",
      "dwg",
      "dxf",
      "ecelp4800",
      "ecelp7470",
      "ecelp9600",
      "egg",
      "eol",
      "eot",
      "epub",
      "exe",
      "f4v",
      "fbs",
      "fh",
      "fla",
      "flac",
      "flatpak",
      "fli",
      "flv",
      "fpx",
      "fst",
      "fvt",
      "g3",
      "gh",
      "gif",
      "graffle",
      "gz",
      "gzip",
      "h261",
      "h263",
      "h264",
      "icns",
      "ico",
      "ief",
      "img",
      "ipa",
      "iso",
      "jar",
      "jpeg",
      "jpg",
      "jpgv",
      "jpm",
      "jxr",
      "key",
      "ktx",
      "lha",
      "lib",
      "lvp",
      "lz",
      "lzh",
      "lzma",
      "lzo",
      "m3u",
      "m4a",
      "m4v",
      "mar",
      "mdi",
      "mht",
      "mid",
      "midi",
      "mj2",
      "mka",
      "mkv",
      "mmr",
      "mng",
      "mobi",
      "mov",
      "movie",
      "mp3",
      "mp4",
      "mp4a",
      "mpeg",
      "mpg",
      "mpga",
      "mxu",
      "nef",
      "npx",
      "numbers",
      "nupkg",
      "o",
      "odp",
      "ods",
      "odt",
      "oga",
      "ogg",
      "ogv",
      "otf",
      "ott",
      "pages",
      "pbm",
      "pcx",
      "pdb",
      "pdf",
      "pea",
      "pgm",
      "pic",
      "png",
      "pnm",
      "pot",
      "potm",
      "potx",
      "ppa",
      "ppam",
      "ppm",
      "pps",
      "ppsm",
      "ppsx",
      "ppt",
      "pptm",
      "pptx",
      "psd",
      "pya",
      "pyc",
      "pyo",
      "pyv",
      "qt",
      "rar",
      "ras",
      "raw",
      "resources",
      "rgb",
      "rip",
      "rlc",
      "rmf",
      "rmvb",
      "rpm",
      "rtf",
      "rz",
      "s3m",
      "s7z",
      "scpt",
      "sgi",
      "shar",
      "snap",
      "sil",
      "sketch",
      "slk",
      "smv",
      "snk",
      "so",
      "stl",
      "suo",
      "sub",
      "swf",
      "tar",
      "tbz",
      "tbz2",
      "tga",
      "tgz",
      "thmx",
      "tif",
      "tiff",
      "tlz",
      "ttc",
      "ttf",
      "txz",
      "udf",
      "uvh",
      "uvi",
      "uvm",
      "uvp",
      "uvs",
      "uvu",
      "viv",
      "vob",
      "war",
      "wav",
      "wax",
      "wbmp",
      "wdp",
      "weba",
      "webm",
      "webp",
      "whl",
      "wim",
      "wm",
      "wma",
      "wmv",
      "wmx",
      "woff",
      "woff2",
      "wrm",
      "wvx",
      "xbm",
      "xif",
      "xla",
      "xlam",
      "xls",
      "xlsb",
      "xlsm",
      "xlsx",
      "xlt",
      "xltm",
      "xltx",
      "xm",
      "xmind",
      "xpi",
      "xpm",
      "xwd",
      "xz",
      "z",
      "zip",
      "zipx"
    ];
  }
});

// node_modules/binary-extensions/index.js
var require_binary_extensions2 = __commonJS({
  "node_modules/binary-extensions/index.js"(exports2, module2) {
    module2.exports = require_binary_extensions();
  }
});

// node_modules/is-binary-path/index.js
var require_is_binary_path = __commonJS({
  "node_modules/is-binary-path/index.js"(exports2, module2) {
    "use strict";
    var path = require("path");
    var binaryExtensions = require_binary_extensions2();
    var extensions = new Set(binaryExtensions);
    module2.exports = (filePath) => extensions.has(path.extname(filePath).slice(1).toLowerCase());
  }
});

// node_modules/chokidar/lib/constants.js
var require_constants9 = __commonJS({
  "node_modules/chokidar/lib/constants.js"(exports2) {
    "use strict";
    var { sep } = require("path");
    var { platform } = process;
    var os = require("os");
    exports2.EV_ALL = "all";
    exports2.EV_READY = "ready";
    exports2.EV_ADD = "add";
    exports2.EV_CHANGE = "change";
    exports2.EV_ADD_DIR = "addDir";
    exports2.EV_UNLINK = "unlink";
    exports2.EV_UNLINK_DIR = "unlinkDir";
    exports2.EV_RAW = "raw";
    exports2.EV_ERROR = "error";
    exports2.STR_DATA = "data";
    exports2.STR_END = "end";
    exports2.STR_CLOSE = "close";
    exports2.FSEVENT_CREATED = "created";
    exports2.FSEVENT_MODIFIED = "modified";
    exports2.FSEVENT_DELETED = "deleted";
    exports2.FSEVENT_MOVED = "moved";
    exports2.FSEVENT_CLONED = "cloned";
    exports2.FSEVENT_UNKNOWN = "unknown";
    exports2.FSEVENT_FLAG_MUST_SCAN_SUBDIRS = 1;
    exports2.FSEVENT_TYPE_FILE = "file";
    exports2.FSEVENT_TYPE_DIRECTORY = "directory";
    exports2.FSEVENT_TYPE_SYMLINK = "symlink";
    exports2.KEY_LISTENERS = "listeners";
    exports2.KEY_ERR = "errHandlers";
    exports2.KEY_RAW = "rawEmitters";
    exports2.HANDLER_KEYS = [exports2.KEY_LISTENERS, exports2.KEY_ERR, exports2.KEY_RAW];
    exports2.DOT_SLASH = `.${sep}`;
    exports2.BACK_SLASH_RE = /\\/g;
    exports2.DOUBLE_SLASH_RE = /\/\//;
    exports2.SLASH_OR_BACK_SLASH_RE = /[/\\]/;
    exports2.DOT_RE = /\..*\.(sw[px])$|~$|\.subl.*\.tmp/;
    exports2.REPLACER_RE = /^\.[/\\]/;
    exports2.SLASH = "/";
    exports2.SLASH_SLASH = "//";
    exports2.BRACE_START = "{";
    exports2.BANG = "!";
    exports2.ONE_DOT = ".";
    exports2.TWO_DOTS = "..";
    exports2.STAR = "*";
    exports2.GLOBSTAR = "**";
    exports2.ROOT_GLOBSTAR = "/**/*";
    exports2.SLASH_GLOBSTAR = "/**";
    exports2.DIR_SUFFIX = "Dir";
    exports2.ANYMATCH_OPTS = { dot: true };
    exports2.STRING_TYPE = "string";
    exports2.FUNCTION_TYPE = "function";
    exports2.EMPTY_STR = "";
    exports2.EMPTY_FN = () => {
    };
    exports2.IDENTITY_FN = (val) => val;
    exports2.isWindows = platform === "win32";
    exports2.isMacos = platform === "darwin";
    exports2.isLinux = platform === "linux";
    exports2.isIBMi = os.type() === "OS400";
  }
});

// node_modules/chokidar/lib/nodefs-handler.js
var require_nodefs_handler = __commonJS({
  "node_modules/chokidar/lib/nodefs-handler.js"(exports2, module2) {
    "use strict";
    var fs = require("fs");
    var sysPath = require("path");
    var { promisify } = require("util");
    var isBinaryPath = require_is_binary_path();
    var {
      isWindows,
      isLinux,
      EMPTY_FN,
      EMPTY_STR,
      KEY_LISTENERS,
      KEY_ERR,
      KEY_RAW,
      HANDLER_KEYS,
      EV_CHANGE,
      EV_ADD,
      EV_ADD_DIR,
      EV_ERROR,
      STR_DATA,
      STR_END,
      BRACE_START,
      STAR
    } = require_constants9();
    var THROTTLE_MODE_WATCH = "watch";
    var open2 = promisify(fs.open);
    var stat = promisify(fs.stat);
    var lstat = promisify(fs.lstat);
    var close = promisify(fs.close);
    var fsrealpath = promisify(fs.realpath);
    var statMethods = { lstat, stat };
    var foreach = (val, fn) => {
      if (val instanceof Set) {
        val.forEach(fn);
      } else {
        fn(val);
      }
    };
    var addAndConvert = (main, prop, item) => {
      let container = main[prop];
      if (!(container instanceof Set)) {
        main[prop] = container = /* @__PURE__ */ new Set([container]);
      }
      container.add(item);
    };
    var clearItem = (cont) => (key) => {
      const set2 = cont[key];
      if (set2 instanceof Set) {
        set2.clear();
      } else {
        delete cont[key];
      }
    };
    var delFromSet = (main, prop, item) => {
      const container = main[prop];
      if (container instanceof Set) {
        container.delete(item);
      } else if (container === item) {
        delete main[prop];
      }
    };
    var isEmptySet = (val) => val instanceof Set ? val.size === 0 : !val;
    var FsWatchInstances = /* @__PURE__ */ new Map();
    function createFsWatchInstance(path, options2, listener, errHandler, emitRaw) {
      const handleEvent = (rawEvent, evPath) => {
        listener(path);
        emitRaw(rawEvent, evPath, { watchedPath: path });
        if (evPath && path !== evPath) {
          fsWatchBroadcast(
            sysPath.resolve(path, evPath),
            KEY_LISTENERS,
            sysPath.join(path, evPath)
          );
        }
      };
      try {
        return fs.watch(path, options2, handleEvent);
      } catch (error48) {
        errHandler(error48);
      }
    }
    var fsWatchBroadcast = (fullPath, type, val1, val2, val3) => {
      const cont = FsWatchInstances.get(fullPath);
      if (!cont) return;
      foreach(cont[type], (listener) => {
        listener(val1, val2, val3);
      });
    };
    var setFsWatchListener = (path, fullPath, options2, handlers) => {
      const { listener, errHandler, rawEmitter } = handlers;
      let cont = FsWatchInstances.get(fullPath);
      let watcher;
      if (!options2.persistent) {
        watcher = createFsWatchInstance(
          path,
          options2,
          listener,
          errHandler,
          rawEmitter
        );
        return watcher.close.bind(watcher);
      }
      if (cont) {
        addAndConvert(cont, KEY_LISTENERS, listener);
        addAndConvert(cont, KEY_ERR, errHandler);
        addAndConvert(cont, KEY_RAW, rawEmitter);
      } else {
        watcher = createFsWatchInstance(
          path,
          options2,
          fsWatchBroadcast.bind(null, fullPath, KEY_LISTENERS),
          errHandler,
          // no need to use broadcast here
          fsWatchBroadcast.bind(null, fullPath, KEY_RAW)
        );
        if (!watcher) return;
        watcher.on(EV_ERROR, async (error48) => {
          const broadcastErr = fsWatchBroadcast.bind(null, fullPath, KEY_ERR);
          cont.watcherUnusable = true;
          if (isWindows && error48.code === "EPERM") {
            try {
              const fd = await open2(path, "r");
              await close(fd);
              broadcastErr(error48);
            } catch (err) {
            }
          } else {
            broadcastErr(error48);
          }
        });
        cont = {
          listeners: listener,
          errHandlers: errHandler,
          rawEmitters: rawEmitter,
          watcher
        };
        FsWatchInstances.set(fullPath, cont);
      }
      return () => {
        delFromSet(cont, KEY_LISTENERS, listener);
        delFromSet(cont, KEY_ERR, errHandler);
        delFromSet(cont, KEY_RAW, rawEmitter);
        if (isEmptySet(cont.listeners)) {
          cont.watcher.close();
          FsWatchInstances.delete(fullPath);
          HANDLER_KEYS.forEach(clearItem(cont));
          cont.watcher = void 0;
          Object.freeze(cont);
        }
      };
    };
    var FsWatchFileInstances = /* @__PURE__ */ new Map();
    var setFsWatchFileListener = (path, fullPath, options2, handlers) => {
      const { listener, rawEmitter } = handlers;
      let cont = FsWatchFileInstances.get(fullPath);
      let listeners = /* @__PURE__ */ new Set();
      let rawEmitters = /* @__PURE__ */ new Set();
      const copts = cont && cont.options;
      if (copts && (copts.persistent < options2.persistent || copts.interval > options2.interval)) {
        listeners = cont.listeners;
        rawEmitters = cont.rawEmitters;
        fs.unwatchFile(fullPath);
        cont = void 0;
      }
      if (cont) {
        addAndConvert(cont, KEY_LISTENERS, listener);
        addAndConvert(cont, KEY_RAW, rawEmitter);
      } else {
        cont = {
          listeners: listener,
          rawEmitters: rawEmitter,
          options: options2,
          watcher: fs.watchFile(fullPath, options2, (curr, prev) => {
            foreach(cont.rawEmitters, (rawEmitter2) => {
              rawEmitter2(EV_CHANGE, fullPath, { curr, prev });
            });
            const currmtime = curr.mtimeMs;
            if (curr.size !== prev.size || currmtime > prev.mtimeMs || currmtime === 0) {
              foreach(cont.listeners, (listener2) => listener2(path, curr));
            }
          })
        };
        FsWatchFileInstances.set(fullPath, cont);
      }
      return () => {
        delFromSet(cont, KEY_LISTENERS, listener);
        delFromSet(cont, KEY_RAW, rawEmitter);
        if (isEmptySet(cont.listeners)) {
          FsWatchFileInstances.delete(fullPath);
          fs.unwatchFile(fullPath);
          cont.options = cont.watcher = void 0;
          Object.freeze(cont);
        }
      };
    };
    var NodeFsHandler = class {
      /**
       * @param {import("../index").FSWatcher} fsW
       */
      constructor(fsW) {
        this.fsw = fsW;
        this._boundHandleError = (error48) => fsW._handleError(error48);
      }
      /**
       * Watch file for changes with fs_watchFile or fs_watch.
       * @param {String} path to file or dir
       * @param {Function} listener on fs change
       * @returns {Function} closer for the watcher instance
       */
      _watchWithNodeFs(path, listener) {
        const opts = this.fsw.options;
        const directory = sysPath.dirname(path);
        const basename = sysPath.basename(path);
        const parent = this.fsw._getWatchedDir(directory);
        parent.add(basename);
        const absolutePath = sysPath.resolve(path);
        const options2 = { persistent: opts.persistent };
        if (!listener) listener = EMPTY_FN;
        let closer;
        if (opts.usePolling) {
          options2.interval = opts.enableBinaryInterval && isBinaryPath(basename) ? opts.binaryInterval : opts.interval;
          closer = setFsWatchFileListener(path, absolutePath, options2, {
            listener,
            rawEmitter: this.fsw._emitRaw
          });
        } else {
          closer = setFsWatchListener(path, absolutePath, options2, {
            listener,
            errHandler: this._boundHandleError,
            rawEmitter: this.fsw._emitRaw
          });
        }
        return closer;
      }
      /**
       * Watch a file and emit add event if warranted.
       * @param {Path} file Path
       * @param {fs.Stats} stats result of fs_stat
       * @param {Boolean} initialAdd was the file added at watch instantiation?
       * @returns {Function} closer for the watcher instance
       */
      _handleFile(file2, stats, initialAdd) {
        if (this.fsw.closed) {
          return;
        }
        const dirname = sysPath.dirname(file2);
        const basename = sysPath.basename(file2);
        const parent = this.fsw._getWatchedDir(dirname);
        let prevStats = stats;
        if (parent.has(basename)) return;
        const listener = async (path, newStats) => {
          if (!this.fsw._throttle(THROTTLE_MODE_WATCH, file2, 5)) return;
          if (!newStats || newStats.mtimeMs === 0) {
            try {
              const newStats2 = await stat(file2);
              if (this.fsw.closed) return;
              const at = newStats2.atimeMs;
              const mt = newStats2.mtimeMs;
              if (!at || at <= mt || mt !== prevStats.mtimeMs) {
                this.fsw._emit(EV_CHANGE, file2, newStats2);
              }
              if (isLinux && prevStats.ino !== newStats2.ino) {
                this.fsw._closeFile(path);
                prevStats = newStats2;
                this.fsw._addPathCloser(path, this._watchWithNodeFs(file2, listener));
              } else {
                prevStats = newStats2;
              }
            } catch (error48) {
              this.fsw._remove(dirname, basename);
            }
          } else if (parent.has(basename)) {
            const at = newStats.atimeMs;
            const mt = newStats.mtimeMs;
            if (!at || at <= mt || mt !== prevStats.mtimeMs) {
              this.fsw._emit(EV_CHANGE, file2, newStats);
            }
            prevStats = newStats;
          }
        };
        const closer = this._watchWithNodeFs(file2, listener);
        if (!(initialAdd && this.fsw.options.ignoreInitial) && this.fsw._isntIgnored(file2)) {
          if (!this.fsw._throttle(EV_ADD, file2, 0)) return;
          this.fsw._emit(EV_ADD, file2, stats);
        }
        return closer;
      }
      /**
       * Handle symlinks encountered while reading a dir.
       * @param {Object} entry returned by readdirp
       * @param {String} directory path of dir being read
       * @param {String} path of this item
       * @param {String} item basename of this item
       * @returns {Promise<Boolean>} true if no more processing is needed for this entry.
       */
      async _handleSymlink(entry, directory, path, item) {
        if (this.fsw.closed) {
          return;
        }
        const full = entry.fullPath;
        const dir = this.fsw._getWatchedDir(directory);
        if (!this.fsw.options.followSymlinks) {
          this.fsw._incrReadyCount();
          let linkPath;
          try {
            linkPath = await fsrealpath(path);
          } catch (e) {
            this.fsw._emitReady();
            return true;
          }
          if (this.fsw.closed) return;
          if (dir.has(item)) {
            if (this.fsw._symlinkPaths.get(full) !== linkPath) {
              this.fsw._symlinkPaths.set(full, linkPath);
              this.fsw._emit(EV_CHANGE, path, entry.stats);
            }
          } else {
            dir.add(item);
            this.fsw._symlinkPaths.set(full, linkPath);
            this.fsw._emit(EV_ADD, path, entry.stats);
          }
          this.fsw._emitReady();
          return true;
        }
        if (this.fsw._symlinkPaths.has(full)) {
          return true;
        }
        this.fsw._symlinkPaths.set(full, true);
      }
      _handleRead(directory, initialAdd, wh, target, dir, depth, throttler) {
        directory = sysPath.join(directory, EMPTY_STR);
        if (!wh.hasGlob) {
          throttler = this.fsw._throttle("readdir", directory, 1e3);
          if (!throttler) return;
        }
        const previous = this.fsw._getWatchedDir(wh.path);
        const current = /* @__PURE__ */ new Set();
        let stream = this.fsw._readdirp(directory, {
          fileFilter: (entry) => wh.filterPath(entry),
          directoryFilter: (entry) => wh.filterDir(entry),
          depth: 0
        }).on(STR_DATA, async (entry) => {
          if (this.fsw.closed) {
            stream = void 0;
            return;
          }
          const item = entry.path;
          let path = sysPath.join(directory, item);
          current.add(item);
          if (entry.stats.isSymbolicLink() && await this._handleSymlink(entry, directory, path, item)) {
            return;
          }
          if (this.fsw.closed) {
            stream = void 0;
            return;
          }
          if (item === target || !target && !previous.has(item)) {
            this.fsw._incrReadyCount();
            path = sysPath.join(dir, sysPath.relative(dir, path));
            this._addToNodeFs(path, initialAdd, wh, depth + 1);
          }
        }).on(EV_ERROR, this._boundHandleError);
        return new Promise(
          (resolve) => stream.once(STR_END, () => {
            if (this.fsw.closed) {
              stream = void 0;
              return;
            }
            const wasThrottled = throttler ? throttler.clear() : false;
            resolve();
            previous.getChildren().filter((item) => {
              return item !== directory && !current.has(item) && // in case of intersecting globs;
              // a path may have been filtered out of this readdir, but
              // shouldn't be removed because it matches a different glob
              (!wh.hasGlob || wh.filterPath({
                fullPath: sysPath.resolve(directory, item)
              }));
            }).forEach((item) => {
              this.fsw._remove(directory, item);
            });
            stream = void 0;
            if (wasThrottled) this._handleRead(directory, false, wh, target, dir, depth, throttler);
          })
        );
      }
      /**
       * Read directory to add / remove files from `@watched` list and re-read it on change.
       * @param {String} dir fs path
       * @param {fs.Stats} stats
       * @param {Boolean} initialAdd
       * @param {Number} depth relative to user-supplied path
       * @param {String} target child path targeted for watch
       * @param {Object} wh Common watch helpers for this path
       * @param {String} realpath
       * @returns {Promise<Function>} closer for the watcher instance.
       */
      async _handleDir(dir, stats, initialAdd, depth, target, wh, realpath) {
        const parentDir = this.fsw._getWatchedDir(sysPath.dirname(dir));
        const tracked = parentDir.has(sysPath.basename(dir));
        if (!(initialAdd && this.fsw.options.ignoreInitial) && !target && !tracked) {
          if (!wh.hasGlob || wh.globFilter(dir)) this.fsw._emit(EV_ADD_DIR, dir, stats);
        }
        parentDir.add(sysPath.basename(dir));
        this.fsw._getWatchedDir(dir);
        let throttler;
        let closer;
        const oDepth = this.fsw.options.depth;
        if ((oDepth == null || depth <= oDepth) && !this.fsw._symlinkPaths.has(realpath)) {
          if (!target) {
            await this._handleRead(dir, initialAdd, wh, target, dir, depth, throttler);
            if (this.fsw.closed) return;
          }
          closer = this._watchWithNodeFs(dir, (dirPath, stats2) => {
            if (stats2 && stats2.mtimeMs === 0) return;
            this._handleRead(dirPath, false, wh, target, dir, depth, throttler);
          });
        }
        return closer;
      }
      /**
       * Handle added file, directory, or glob pattern.
       * Delegates call to _handleFile / _handleDir after checks.
       * @param {String} path to file or ir
       * @param {Boolean} initialAdd was the file added at watch instantiation?
       * @param {Object} priorWh depth relative to user-supplied path
       * @param {Number} depth Child path actually targeted for watch
       * @param {String=} target Child path actually targeted for watch
       * @returns {Promise}
       */
      async _addToNodeFs(path, initialAdd, priorWh, depth, target) {
        const ready = this.fsw._emitReady;
        if (this.fsw._isIgnored(path) || this.fsw.closed) {
          ready();
          return false;
        }
        const wh = this.fsw._getWatchHelpers(path, depth);
        if (!wh.hasGlob && priorWh) {
          wh.hasGlob = priorWh.hasGlob;
          wh.globFilter = priorWh.globFilter;
          wh.filterPath = (entry) => priorWh.filterPath(entry);
          wh.filterDir = (entry) => priorWh.filterDir(entry);
        }
        try {
          const stats = await statMethods[wh.statMethod](wh.watchPath);
          if (this.fsw.closed) return;
          if (this.fsw._isIgnored(wh.watchPath, stats)) {
            ready();
            return false;
          }
          const follow = this.fsw.options.followSymlinks && !path.includes(STAR) && !path.includes(BRACE_START);
          let closer;
          if (stats.isDirectory()) {
            const absPath = sysPath.resolve(path);
            const targetPath = follow ? await fsrealpath(path) : path;
            if (this.fsw.closed) return;
            closer = await this._handleDir(wh.watchPath, stats, initialAdd, depth, target, wh, targetPath);
            if (this.fsw.closed) return;
            if (absPath !== targetPath && targetPath !== void 0) {
              this.fsw._symlinkPaths.set(absPath, targetPath);
            }
          } else if (stats.isSymbolicLink()) {
            const targetPath = follow ? await fsrealpath(path) : path;
            if (this.fsw.closed) return;
            const parent = sysPath.dirname(wh.watchPath);
            this.fsw._getWatchedDir(parent).add(wh.watchPath);
            this.fsw._emit(EV_ADD, wh.watchPath, stats);
            closer = await this._handleDir(parent, stats, initialAdd, depth, path, wh, targetPath);
            if (this.fsw.closed) return;
            if (targetPath !== void 0) {
              this.fsw._symlinkPaths.set(sysPath.resolve(path), targetPath);
            }
          } else {
            closer = this._handleFile(wh.watchPath, stats, initialAdd);
          }
          ready();
          this.fsw._addPathCloser(path, closer);
          return false;
        } catch (error48) {
          if (this.fsw._handleError(error48)) {
            ready();
            return path;
          }
        }
      }
    };
    module2.exports = NodeFsHandler;
  }
});

// node_modules/chokidar/lib/fsevents-handler.js
var require_fsevents_handler = __commonJS({
  "node_modules/chokidar/lib/fsevents-handler.js"(exports2, module2) {
    "use strict";
    var fs = require("fs");
    var sysPath = require("path");
    var { promisify } = require("util");
    var fsevents;
    try {
      fsevents = require("fsevents");
    } catch (error48) {
      if (process.env.CHOKIDAR_PRINT_FSEVENTS_REQUIRE_ERROR) console.error(error48);
    }
    if (fsevents) {
      const mtch = process.version.match(/v(\d+)\.(\d+)/);
      if (mtch && mtch[1] && mtch[2]) {
        const maj = Number.parseInt(mtch[1], 10);
        const min = Number.parseInt(mtch[2], 10);
        if (maj === 8 && min < 16) {
          fsevents = void 0;
        }
      }
    }
    var {
      EV_ADD,
      EV_CHANGE,
      EV_ADD_DIR,
      EV_UNLINK,
      EV_ERROR,
      STR_DATA,
      STR_END,
      FSEVENT_CREATED,
      FSEVENT_MODIFIED,
      FSEVENT_DELETED,
      FSEVENT_MOVED,
      // FSEVENT_CLONED,
      FSEVENT_UNKNOWN,
      FSEVENT_FLAG_MUST_SCAN_SUBDIRS,
      FSEVENT_TYPE_FILE,
      FSEVENT_TYPE_DIRECTORY,
      FSEVENT_TYPE_SYMLINK,
      ROOT_GLOBSTAR,
      DIR_SUFFIX,
      DOT_SLASH,
      FUNCTION_TYPE,
      EMPTY_FN,
      IDENTITY_FN
    } = require_constants9();
    var Depth = (value) => isNaN(value) ? {} : { depth: value };
    var stat = promisify(fs.stat);
    var lstat = promisify(fs.lstat);
    var realpath = promisify(fs.realpath);
    var statMethods = { stat, lstat };
    var FSEventsWatchers = /* @__PURE__ */ new Map();
    var consolidateThreshhold = 10;
    var wrongEventFlags = /* @__PURE__ */ new Set([
      69888,
      70400,
      71424,
      72704,
      73472,
      131328,
      131840,
      262912
    ]);
    var createFSEventsInstance = (path, callback) => {
      const stop = fsevents.watch(path, callback);
      return { stop };
    };
    function setFSEventsListener(path, realPath, listener, rawEmitter) {
      let watchPath = sysPath.extname(realPath) ? sysPath.dirname(realPath) : realPath;
      const parentPath = sysPath.dirname(watchPath);
      let cont = FSEventsWatchers.get(watchPath);
      if (couldConsolidate(parentPath)) {
        watchPath = parentPath;
      }
      const resolvedPath = sysPath.resolve(path);
      const hasSymlink = resolvedPath !== realPath;
      const filteredListener = (fullPath, flags, info) => {
        if (hasSymlink) fullPath = fullPath.replace(realPath, resolvedPath);
        if (fullPath === resolvedPath || !fullPath.indexOf(resolvedPath + sysPath.sep)) listener(fullPath, flags, info);
      };
      let watchedParent = false;
      for (const watchedPath of FSEventsWatchers.keys()) {
        if (realPath.indexOf(sysPath.resolve(watchedPath) + sysPath.sep) === 0) {
          watchPath = watchedPath;
          cont = FSEventsWatchers.get(watchPath);
          watchedParent = true;
          break;
        }
      }
      if (cont || watchedParent) {
        cont.listeners.add(filteredListener);
      } else {
        cont = {
          listeners: /* @__PURE__ */ new Set([filteredListener]),
          rawEmitter,
          watcher: createFSEventsInstance(watchPath, (fullPath, flags) => {
            if (!cont.listeners.size) return;
            if (flags & FSEVENT_FLAG_MUST_SCAN_SUBDIRS) return;
            const info = fsevents.getInfo(fullPath, flags);
            cont.listeners.forEach((list) => {
              list(fullPath, flags, info);
            });
            cont.rawEmitter(info.event, fullPath, info);
          })
        };
        FSEventsWatchers.set(watchPath, cont);
      }
      return () => {
        const lst = cont.listeners;
        lst.delete(filteredListener);
        if (!lst.size) {
          FSEventsWatchers.delete(watchPath);
          if (cont.watcher) return cont.watcher.stop().then(() => {
            cont.rawEmitter = cont.watcher = void 0;
            Object.freeze(cont);
          });
        }
      };
    }
    var couldConsolidate = (path) => {
      let count = 0;
      for (const watchPath of FSEventsWatchers.keys()) {
        if (watchPath.indexOf(path) === 0) {
          count++;
          if (count >= consolidateThreshhold) {
            return true;
          }
        }
      }
      return false;
    };
    var canUse = () => fsevents && FSEventsWatchers.size < 128;
    var calcDepth = (path, root) => {
      let i = 0;
      while (!path.indexOf(root) && (path = sysPath.dirname(path)) !== root) i++;
      return i;
    };
    var sameTypes = (info, stats) => info.type === FSEVENT_TYPE_DIRECTORY && stats.isDirectory() || info.type === FSEVENT_TYPE_SYMLINK && stats.isSymbolicLink() || info.type === FSEVENT_TYPE_FILE && stats.isFile();
    var FsEventsHandler = class {
      /**
       * @param {import('../index').FSWatcher} fsw
       */
      constructor(fsw) {
        this.fsw = fsw;
      }
      checkIgnored(path, stats) {
        const ipaths = this.fsw._ignoredPaths;
        if (this.fsw._isIgnored(path, stats)) {
          ipaths.add(path);
          if (stats && stats.isDirectory()) {
            ipaths.add(path + ROOT_GLOBSTAR);
          }
          return true;
        }
        ipaths.delete(path);
        ipaths.delete(path + ROOT_GLOBSTAR);
      }
      addOrChange(path, fullPath, realPath, parent, watchedDir, item, info, opts) {
        const event = watchedDir.has(item) ? EV_CHANGE : EV_ADD;
        this.handleEvent(event, path, fullPath, realPath, parent, watchedDir, item, info, opts);
      }
      async checkExists(path, fullPath, realPath, parent, watchedDir, item, info, opts) {
        try {
          const stats = await stat(path);
          if (this.fsw.closed) return;
          if (sameTypes(info, stats)) {
            this.addOrChange(path, fullPath, realPath, parent, watchedDir, item, info, opts);
          } else {
            this.handleEvent(EV_UNLINK, path, fullPath, realPath, parent, watchedDir, item, info, opts);
          }
        } catch (error48) {
          if (error48.code === "EACCES") {
            this.addOrChange(path, fullPath, realPath, parent, watchedDir, item, info, opts);
          } else {
            this.handleEvent(EV_UNLINK, path, fullPath, realPath, parent, watchedDir, item, info, opts);
          }
        }
      }
      handleEvent(event, path, fullPath, realPath, parent, watchedDir, item, info, opts) {
        if (this.fsw.closed || this.checkIgnored(path)) return;
        if (event === EV_UNLINK) {
          const isDirectory = info.type === FSEVENT_TYPE_DIRECTORY;
          if (isDirectory || watchedDir.has(item)) {
            this.fsw._remove(parent, item, isDirectory);
          }
        } else {
          if (event === EV_ADD) {
            if (info.type === FSEVENT_TYPE_DIRECTORY) this.fsw._getWatchedDir(path);
            if (info.type === FSEVENT_TYPE_SYMLINK && opts.followSymlinks) {
              const curDepth = opts.depth === void 0 ? void 0 : calcDepth(fullPath, realPath) + 1;
              return this._addToFsEvents(path, false, true, curDepth);
            }
            this.fsw._getWatchedDir(parent).add(item);
          }
          const eventName = info.type === FSEVENT_TYPE_DIRECTORY ? event + DIR_SUFFIX : event;
          this.fsw._emit(eventName, path);
          if (eventName === EV_ADD_DIR) this._addToFsEvents(path, false, true);
        }
      }
      /**
       * Handle symlinks encountered during directory scan
       * @param {String} watchPath  - file/dir path to be watched with fsevents
       * @param {String} realPath   - real path (in case of symlinks)
       * @param {Function} transform  - path transformer
       * @param {Function} globFilter - path filter in case a glob pattern was provided
       * @returns {Function} closer for the watcher instance
      */
      _watchWithFsEvents(watchPath, realPath, transform2, globFilter) {
        if (this.fsw.closed || this.fsw._isIgnored(watchPath)) return;
        const opts = this.fsw.options;
        const watchCallback = async (fullPath, flags, info) => {
          if (this.fsw.closed) return;
          if (opts.depth !== void 0 && calcDepth(fullPath, realPath) > opts.depth) return;
          const path = transform2(sysPath.join(
            watchPath,
            sysPath.relative(watchPath, fullPath)
          ));
          if (globFilter && !globFilter(path)) return;
          const parent = sysPath.dirname(path);
          const item = sysPath.basename(path);
          const watchedDir = this.fsw._getWatchedDir(
            info.type === FSEVENT_TYPE_DIRECTORY ? path : parent
          );
          if (wrongEventFlags.has(flags) || info.event === FSEVENT_UNKNOWN) {
            if (typeof opts.ignored === FUNCTION_TYPE) {
              let stats;
              try {
                stats = await stat(path);
              } catch (error48) {
              }
              if (this.fsw.closed) return;
              if (this.checkIgnored(path, stats)) return;
              if (sameTypes(info, stats)) {
                this.addOrChange(path, fullPath, realPath, parent, watchedDir, item, info, opts);
              } else {
                this.handleEvent(EV_UNLINK, path, fullPath, realPath, parent, watchedDir, item, info, opts);
              }
            } else {
              this.checkExists(path, fullPath, realPath, parent, watchedDir, item, info, opts);
            }
          } else {
            switch (info.event) {
              case FSEVENT_CREATED:
              case FSEVENT_MODIFIED:
                return this.addOrChange(path, fullPath, realPath, parent, watchedDir, item, info, opts);
              case FSEVENT_DELETED:
              case FSEVENT_MOVED:
                return this.checkExists(path, fullPath, realPath, parent, watchedDir, item, info, opts);
            }
          }
        };
        const closer = setFSEventsListener(
          watchPath,
          realPath,
          watchCallback,
          this.fsw._emitRaw
        );
        this.fsw._emitReady();
        return closer;
      }
      /**
       * Handle symlinks encountered during directory scan
       * @param {String} linkPath path to symlink
       * @param {String} fullPath absolute path to the symlink
       * @param {Function} transform pre-existing path transformer
       * @param {Number} curDepth level of subdirectories traversed to where symlink is
       * @returns {Promise<void>}
       */
      async _handleFsEventsSymlink(linkPath, fullPath, transform2, curDepth) {
        if (this.fsw.closed || this.fsw._symlinkPaths.has(fullPath)) return;
        this.fsw._symlinkPaths.set(fullPath, true);
        this.fsw._incrReadyCount();
        try {
          const linkTarget = await realpath(linkPath);
          if (this.fsw.closed) return;
          if (this.fsw._isIgnored(linkTarget)) {
            return this.fsw._emitReady();
          }
          this.fsw._incrReadyCount();
          this._addToFsEvents(linkTarget || linkPath, (path) => {
            let aliasedPath = linkPath;
            if (linkTarget && linkTarget !== DOT_SLASH) {
              aliasedPath = path.replace(linkTarget, linkPath);
            } else if (path !== DOT_SLASH) {
              aliasedPath = sysPath.join(linkPath, path);
            }
            return transform2(aliasedPath);
          }, false, curDepth);
        } catch (error48) {
          if (this.fsw._handleError(error48)) {
            return this.fsw._emitReady();
          }
        }
      }
      /**
       *
       * @param {Path} newPath
       * @param {fs.Stats} stats
       */
      emitAdd(newPath, stats, processPath, opts, forceAdd) {
        const pp = processPath(newPath);
        const isDir = stats.isDirectory();
        const dirObj = this.fsw._getWatchedDir(sysPath.dirname(pp));
        const base = sysPath.basename(pp);
        if (isDir) this.fsw._getWatchedDir(pp);
        if (dirObj.has(base)) return;
        dirObj.add(base);
        if (!opts.ignoreInitial || forceAdd === true) {
          this.fsw._emit(isDir ? EV_ADD_DIR : EV_ADD, pp, stats);
        }
      }
      initWatch(realPath, path, wh, processPath) {
        if (this.fsw.closed) return;
        const closer = this._watchWithFsEvents(
          wh.watchPath,
          sysPath.resolve(realPath || wh.watchPath),
          processPath,
          wh.globFilter
        );
        this.fsw._addPathCloser(path, closer);
      }
      /**
       * Handle added path with fsevents
       * @param {String} path file/dir path or glob pattern
       * @param {Function|Boolean=} transform converts working path to what the user expects
       * @param {Boolean=} forceAdd ensure add is emitted
       * @param {Number=} priorDepth Level of subdirectories already traversed.
       * @returns {Promise<void>}
       */
      async _addToFsEvents(path, transform2, forceAdd, priorDepth) {
        if (this.fsw.closed) {
          return;
        }
        const opts = this.fsw.options;
        const processPath = typeof transform2 === FUNCTION_TYPE ? transform2 : IDENTITY_FN;
        const wh = this.fsw._getWatchHelpers(path);
        try {
          const stats = await statMethods[wh.statMethod](wh.watchPath);
          if (this.fsw.closed) return;
          if (this.fsw._isIgnored(wh.watchPath, stats)) {
            throw null;
          }
          if (stats.isDirectory()) {
            if (!wh.globFilter) this.emitAdd(processPath(path), stats, processPath, opts, forceAdd);
            if (priorDepth && priorDepth > opts.depth) return;
            this.fsw._readdirp(wh.watchPath, {
              fileFilter: (entry) => wh.filterPath(entry),
              directoryFilter: (entry) => wh.filterDir(entry),
              ...Depth(opts.depth - (priorDepth || 0))
            }).on(STR_DATA, (entry) => {
              if (this.fsw.closed) {
                return;
              }
              if (entry.stats.isDirectory() && !wh.filterPath(entry)) return;
              const joinedPath = sysPath.join(wh.watchPath, entry.path);
              const { fullPath } = entry;
              if (wh.followSymlinks && entry.stats.isSymbolicLink()) {
                const curDepth = opts.depth === void 0 ? void 0 : calcDepth(joinedPath, sysPath.resolve(wh.watchPath)) + 1;
                this._handleFsEventsSymlink(joinedPath, fullPath, processPath, curDepth);
              } else {
                this.emitAdd(joinedPath, entry.stats, processPath, opts, forceAdd);
              }
            }).on(EV_ERROR, EMPTY_FN).on(STR_END, () => {
              this.fsw._emitReady();
            });
          } else {
            this.emitAdd(wh.watchPath, stats, processPath, opts, forceAdd);
            this.fsw._emitReady();
          }
        } catch (error48) {
          if (!error48 || this.fsw._handleError(error48)) {
            this.fsw._emitReady();
            this.fsw._emitReady();
          }
        }
        if (opts.persistent && forceAdd !== true) {
          if (typeof transform2 === FUNCTION_TYPE) {
            this.initWatch(void 0, path, wh, processPath);
          } else {
            let realPath;
            try {
              realPath = await realpath(wh.watchPath);
            } catch (e) {
            }
            this.initWatch(realPath, path, wh, processPath);
          }
        }
      }
    };
    module2.exports = FsEventsHandler;
    module2.exports.canUse = canUse;
  }
});

// node_modules/chokidar/index.js
var require_chokidar = __commonJS({
  "node_modules/chokidar/index.js"(exports2) {
    "use strict";
    var { EventEmitter } = require("events");
    var fs = require("fs");
    var sysPath = require("path");
    var { promisify } = require("util");
    var readdirp = require_readdirp();
    var anymatch = require_anymatch().default;
    var globParent = require_glob_parent();
    var isGlob = require_is_glob();
    var braces = require_braces();
    var normalizePath = require_normalize_path();
    var NodeFsHandler = require_nodefs_handler();
    var FsEventsHandler = require_fsevents_handler();
    var {
      EV_ALL,
      EV_READY,
      EV_ADD,
      EV_CHANGE,
      EV_UNLINK,
      EV_ADD_DIR,
      EV_UNLINK_DIR,
      EV_RAW,
      EV_ERROR,
      STR_CLOSE,
      STR_END,
      BACK_SLASH_RE,
      DOUBLE_SLASH_RE,
      SLASH_OR_BACK_SLASH_RE,
      DOT_RE,
      REPLACER_RE,
      SLASH,
      SLASH_SLASH,
      BRACE_START,
      BANG,
      ONE_DOT,
      TWO_DOTS,
      GLOBSTAR,
      SLASH_GLOBSTAR,
      ANYMATCH_OPTS,
      STRING_TYPE,
      FUNCTION_TYPE,
      EMPTY_STR,
      EMPTY_FN,
      isWindows,
      isMacos,
      isIBMi
    } = require_constants9();
    var stat = promisify(fs.stat);
    var readdir = promisify(fs.readdir);
    var arrify = (value = []) => Array.isArray(value) ? value : [value];
    var flatten = (list, result = []) => {
      list.forEach((item) => {
        if (Array.isArray(item)) {
          flatten(item, result);
        } else {
          result.push(item);
        }
      });
      return result;
    };
    var unifyPaths = (paths_) => {
      const paths = flatten(arrify(paths_));
      if (!paths.every((p) => typeof p === STRING_TYPE)) {
        throw new TypeError(`Non-string provided as watch path: ${paths}`);
      }
      return paths.map(normalizePathToUnix);
    };
    var toUnix = (string4) => {
      let str = string4.replace(BACK_SLASH_RE, SLASH);
      let prepend = false;
      if (str.startsWith(SLASH_SLASH)) {
        prepend = true;
      }
      while (str.match(DOUBLE_SLASH_RE)) {
        str = str.replace(DOUBLE_SLASH_RE, SLASH);
      }
      if (prepend) {
        str = SLASH + str;
      }
      return str;
    };
    var normalizePathToUnix = (path) => toUnix(sysPath.normalize(toUnix(path)));
    var normalizeIgnored = (cwd = EMPTY_STR) => (path) => {
      if (typeof path !== STRING_TYPE) return path;
      return normalizePathToUnix(sysPath.isAbsolute(path) ? path : sysPath.join(cwd, path));
    };
    var getAbsolutePath = (path, cwd) => {
      if (sysPath.isAbsolute(path)) {
        return path;
      }
      if (path.startsWith(BANG)) {
        return BANG + sysPath.join(cwd, path.slice(1));
      }
      return sysPath.join(cwd, path);
    };
    var undef = (opts, key) => opts[key] === void 0;
    var DirEntry = class {
      /**
       * @param {Path} dir
       * @param {Function} removeWatcher
       */
      constructor(dir, removeWatcher) {
        this.path = dir;
        this._removeWatcher = removeWatcher;
        this.items = /* @__PURE__ */ new Set();
      }
      add(item) {
        const { items } = this;
        if (!items) return;
        if (item !== ONE_DOT && item !== TWO_DOTS) items.add(item);
      }
      async remove(item) {
        const { items } = this;
        if (!items) return;
        items.delete(item);
        if (items.size > 0) return;
        const dir = this.path;
        try {
          await readdir(dir);
        } catch (err) {
          if (this._removeWatcher) {
            this._removeWatcher(sysPath.dirname(dir), sysPath.basename(dir));
          }
        }
      }
      has(item) {
        const { items } = this;
        if (!items) return;
        return items.has(item);
      }
      /**
       * @returns {Array<String>}
       */
      getChildren() {
        const { items } = this;
        if (!items) return;
        return [...items.values()];
      }
      dispose() {
        this.items.clear();
        delete this.path;
        delete this._removeWatcher;
        delete this.items;
        Object.freeze(this);
      }
    };
    var STAT_METHOD_F = "stat";
    var STAT_METHOD_L = "lstat";
    var WatchHelper = class {
      constructor(path, watchPath, follow, fsw) {
        this.fsw = fsw;
        this.path = path = path.replace(REPLACER_RE, EMPTY_STR);
        this.watchPath = watchPath;
        this.fullWatchPath = sysPath.resolve(watchPath);
        this.hasGlob = watchPath !== path;
        if (path === EMPTY_STR) this.hasGlob = false;
        this.globSymlink = this.hasGlob && follow ? void 0 : false;
        this.globFilter = this.hasGlob ? anymatch(path, void 0, ANYMATCH_OPTS) : false;
        this.dirParts = this.getDirParts(path);
        this.dirParts.forEach((parts) => {
          if (parts.length > 1) parts.pop();
        });
        this.followSymlinks = follow;
        this.statMethod = follow ? STAT_METHOD_F : STAT_METHOD_L;
      }
      checkGlobSymlink(entry) {
        if (this.globSymlink === void 0) {
          this.globSymlink = entry.fullParentDir === this.fullWatchPath ? false : { realPath: entry.fullParentDir, linkPath: this.fullWatchPath };
        }
        if (this.globSymlink) {
          return entry.fullPath.replace(this.globSymlink.realPath, this.globSymlink.linkPath);
        }
        return entry.fullPath;
      }
      entryPath(entry) {
        return sysPath.join(
          this.watchPath,
          sysPath.relative(this.watchPath, this.checkGlobSymlink(entry))
        );
      }
      filterPath(entry) {
        const { stats } = entry;
        if (stats && stats.isSymbolicLink()) return this.filterDir(entry);
        const resolvedPath = this.entryPath(entry);
        const matchesGlob = this.hasGlob && typeof this.globFilter === FUNCTION_TYPE ? this.globFilter(resolvedPath) : true;
        return matchesGlob && this.fsw._isntIgnored(resolvedPath, stats) && this.fsw._hasReadPermissions(stats);
      }
      getDirParts(path) {
        if (!this.hasGlob) return [];
        const parts = [];
        const expandedPath = path.includes(BRACE_START) ? braces.expand(path) : [path];
        expandedPath.forEach((path2) => {
          parts.push(sysPath.relative(this.watchPath, path2).split(SLASH_OR_BACK_SLASH_RE));
        });
        return parts;
      }
      filterDir(entry) {
        if (this.hasGlob) {
          const entryParts = this.getDirParts(this.checkGlobSymlink(entry));
          let globstar = false;
          this.unmatchedGlob = !this.dirParts.some((parts) => {
            return parts.every((part, i) => {
              if (part === GLOBSTAR) globstar = true;
              return globstar || !entryParts[0][i] || anymatch(part, entryParts[0][i], ANYMATCH_OPTS);
            });
          });
        }
        return !this.unmatchedGlob && this.fsw._isntIgnored(this.entryPath(entry), entry.stats);
      }
    };
    var FSWatcher = class extends EventEmitter {
      // Not indenting methods for history sake; for now.
      constructor(_opts) {
        super();
        const opts = {};
        if (_opts) Object.assign(opts, _opts);
        this._watched = /* @__PURE__ */ new Map();
        this._closers = /* @__PURE__ */ new Map();
        this._ignoredPaths = /* @__PURE__ */ new Set();
        this._throttled = /* @__PURE__ */ new Map();
        this._symlinkPaths = /* @__PURE__ */ new Map();
        this._streams = /* @__PURE__ */ new Set();
        this.closed = false;
        if (undef(opts, "persistent")) opts.persistent = true;
        if (undef(opts, "ignoreInitial")) opts.ignoreInitial = false;
        if (undef(opts, "ignorePermissionErrors")) opts.ignorePermissionErrors = false;
        if (undef(opts, "interval")) opts.interval = 100;
        if (undef(opts, "binaryInterval")) opts.binaryInterval = 300;
        if (undef(opts, "disableGlobbing")) opts.disableGlobbing = false;
        opts.enableBinaryInterval = opts.binaryInterval !== opts.interval;
        if (undef(opts, "useFsEvents")) opts.useFsEvents = !opts.usePolling;
        const canUseFsEvents = FsEventsHandler.canUse();
        if (!canUseFsEvents) opts.useFsEvents = false;
        if (undef(opts, "usePolling") && !opts.useFsEvents) {
          opts.usePolling = isMacos;
        }
        if (isIBMi) {
          opts.usePolling = true;
        }
        const envPoll = process.env.CHOKIDAR_USEPOLLING;
        if (envPoll !== void 0) {
          const envLower = envPoll.toLowerCase();
          if (envLower === "false" || envLower === "0") {
            opts.usePolling = false;
          } else if (envLower === "true" || envLower === "1") {
            opts.usePolling = true;
          } else {
            opts.usePolling = !!envLower;
          }
        }
        const envInterval = process.env.CHOKIDAR_INTERVAL;
        if (envInterval) {
          opts.interval = Number.parseInt(envInterval, 10);
        }
        if (undef(opts, "atomic")) opts.atomic = !opts.usePolling && !opts.useFsEvents;
        if (opts.atomic) this._pendingUnlinks = /* @__PURE__ */ new Map();
        if (undef(opts, "followSymlinks")) opts.followSymlinks = true;
        if (undef(opts, "awaitWriteFinish")) opts.awaitWriteFinish = false;
        if (opts.awaitWriteFinish === true) opts.awaitWriteFinish = {};
        const awf = opts.awaitWriteFinish;
        if (awf) {
          if (!awf.stabilityThreshold) awf.stabilityThreshold = 2e3;
          if (!awf.pollInterval) awf.pollInterval = 100;
          this._pendingWrites = /* @__PURE__ */ new Map();
        }
        if (opts.ignored) opts.ignored = arrify(opts.ignored);
        let readyCalls = 0;
        this._emitReady = () => {
          readyCalls++;
          if (readyCalls >= this._readyCount) {
            this._emitReady = EMPTY_FN;
            this._readyEmitted = true;
            process.nextTick(() => this.emit(EV_READY));
          }
        };
        this._emitRaw = (...args) => this.emit(EV_RAW, ...args);
        this._readyEmitted = false;
        this.options = opts;
        if (opts.useFsEvents) {
          this._fsEventsHandler = new FsEventsHandler(this);
        } else {
          this._nodeFsHandler = new NodeFsHandler(this);
        }
        Object.freeze(opts);
      }
      // Public methods
      /**
       * Adds paths to be watched on an existing FSWatcher instance
       * @param {Path|Array<Path>} paths_
       * @param {String=} _origAdd private; for handling non-existent paths to be watched
       * @param {Boolean=} _internal private; indicates a non-user add
       * @returns {FSWatcher} for chaining
       */
      add(paths_, _origAdd, _internal) {
        const { cwd, disableGlobbing } = this.options;
        this.closed = false;
        let paths = unifyPaths(paths_);
        if (cwd) {
          paths = paths.map((path) => {
            const absPath = getAbsolutePath(path, cwd);
            if (disableGlobbing || !isGlob(path)) {
              return absPath;
            }
            return normalizePath(absPath);
          });
        }
        paths = paths.filter((path) => {
          if (path.startsWith(BANG)) {
            this._ignoredPaths.add(path.slice(1));
            return false;
          }
          this._ignoredPaths.delete(path);
          this._ignoredPaths.delete(path + SLASH_GLOBSTAR);
          this._userIgnored = void 0;
          return true;
        });
        if (this.options.useFsEvents && this._fsEventsHandler) {
          if (!this._readyCount) this._readyCount = paths.length;
          if (this.options.persistent) this._readyCount += paths.length;
          paths.forEach((path) => this._fsEventsHandler._addToFsEvents(path));
        } else {
          if (!this._readyCount) this._readyCount = 0;
          this._readyCount += paths.length;
          Promise.all(
            paths.map(async (path) => {
              const res = await this._nodeFsHandler._addToNodeFs(path, !_internal, 0, 0, _origAdd);
              if (res) this._emitReady();
              return res;
            })
          ).then((results) => {
            if (this.closed) return;
            results.filter((item) => item).forEach((item) => {
              this.add(sysPath.dirname(item), sysPath.basename(_origAdd || item));
            });
          });
        }
        return this;
      }
      /**
       * Close watchers or start ignoring events from specified paths.
       * @param {Path|Array<Path>} paths_ - string or array of strings, file/directory paths and/or globs
       * @returns {FSWatcher} for chaining
      */
      unwatch(paths_) {
        if (this.closed) return this;
        const paths = unifyPaths(paths_);
        const { cwd } = this.options;
        paths.forEach((path) => {
          if (!sysPath.isAbsolute(path) && !this._closers.has(path)) {
            if (cwd) path = sysPath.join(cwd, path);
            path = sysPath.resolve(path);
          }
          this._closePath(path);
          this._ignoredPaths.add(path);
          if (this._watched.has(path)) {
            this._ignoredPaths.add(path + SLASH_GLOBSTAR);
          }
          this._userIgnored = void 0;
        });
        return this;
      }
      /**
       * Close watchers and remove all listeners from watched paths.
       * @returns {Promise<void>}.
      */
      close() {
        if (this.closed) return this._closePromise;
        this.closed = true;
        this.removeAllListeners();
        const closers = [];
        this._closers.forEach((closerList) => closerList.forEach((closer) => {
          const promise2 = closer();
          if (promise2 instanceof Promise) closers.push(promise2);
        }));
        this._streams.forEach((stream) => stream.destroy());
        this._userIgnored = void 0;
        this._readyCount = 0;
        this._readyEmitted = false;
        this._watched.forEach((dirent) => dirent.dispose());
        ["closers", "watched", "streams", "symlinkPaths", "throttled"].forEach((key) => {
          this[`_${key}`].clear();
        });
        this._closePromise = closers.length ? Promise.all(closers).then(() => void 0) : Promise.resolve();
        return this._closePromise;
      }
      /**
       * Expose list of watched paths
       * @returns {Object} for chaining
      */
      getWatched() {
        const watchList = {};
        this._watched.forEach((entry, dir) => {
          const key = this.options.cwd ? sysPath.relative(this.options.cwd, dir) : dir;
          watchList[key || ONE_DOT] = entry.getChildren().sort();
        });
        return watchList;
      }
      emitWithAll(event, args) {
        this.emit(...args);
        if (event !== EV_ERROR) this.emit(EV_ALL, ...args);
      }
      // Common helpers
      // --------------
      /**
       * Normalize and emit events.
       * Calling _emit DOES NOT MEAN emit() would be called!
       * @param {EventName} event Type of event
       * @param {Path} path File or directory path
       * @param {*=} val1 arguments to be passed with event
       * @param {*=} val2
       * @param {*=} val3
       * @returns the error if defined, otherwise the value of the FSWatcher instance's `closed` flag
       */
      async _emit(event, path, val1, val2, val3) {
        if (this.closed) return;
        const opts = this.options;
        if (isWindows) path = sysPath.normalize(path);
        if (opts.cwd) path = sysPath.relative(opts.cwd, path);
        const args = [event, path];
        if (val3 !== void 0) args.push(val1, val2, val3);
        else if (val2 !== void 0) args.push(val1, val2);
        else if (val1 !== void 0) args.push(val1);
        const awf = opts.awaitWriteFinish;
        let pw;
        if (awf && (pw = this._pendingWrites.get(path))) {
          pw.lastChange = /* @__PURE__ */ new Date();
          return this;
        }
        if (opts.atomic) {
          if (event === EV_UNLINK) {
            this._pendingUnlinks.set(path, args);
            setTimeout(() => {
              this._pendingUnlinks.forEach((entry, path2) => {
                this.emit(...entry);
                this.emit(EV_ALL, ...entry);
                this._pendingUnlinks.delete(path2);
              });
            }, typeof opts.atomic === "number" ? opts.atomic : 100);
            return this;
          }
          if (event === EV_ADD && this._pendingUnlinks.has(path)) {
            event = args[0] = EV_CHANGE;
            this._pendingUnlinks.delete(path);
          }
        }
        if (awf && (event === EV_ADD || event === EV_CHANGE) && this._readyEmitted) {
          const awfEmit = (err, stats) => {
            if (err) {
              event = args[0] = EV_ERROR;
              args[1] = err;
              this.emitWithAll(event, args);
            } else if (stats) {
              if (args.length > 2) {
                args[2] = stats;
              } else {
                args.push(stats);
              }
              this.emitWithAll(event, args);
            }
          };
          this._awaitWriteFinish(path, awf.stabilityThreshold, event, awfEmit);
          return this;
        }
        if (event === EV_CHANGE) {
          const isThrottled = !this._throttle(EV_CHANGE, path, 50);
          if (isThrottled) return this;
        }
        if (opts.alwaysStat && val1 === void 0 && (event === EV_ADD || event === EV_ADD_DIR || event === EV_CHANGE)) {
          const fullPath = opts.cwd ? sysPath.join(opts.cwd, path) : path;
          let stats;
          try {
            stats = await stat(fullPath);
          } catch (err) {
          }
          if (!stats || this.closed) return;
          args.push(stats);
        }
        this.emitWithAll(event, args);
        return this;
      }
      /**
       * Common handler for errors
       * @param {Error} error
       * @returns {Error|Boolean} The error if defined, otherwise the value of the FSWatcher instance's `closed` flag
       */
      _handleError(error48) {
        const code = error48 && error48.code;
        if (error48 && code !== "ENOENT" && code !== "ENOTDIR" && (!this.options.ignorePermissionErrors || code !== "EPERM" && code !== "EACCES")) {
          this.emit(EV_ERROR, error48);
        }
        return error48 || this.closed;
      }
      /**
       * Helper utility for throttling
       * @param {ThrottleType} actionType type being throttled
       * @param {Path} path being acted upon
       * @param {Number} timeout duration of time to suppress duplicate actions
       * @returns {Object|false} tracking object or false if action should be suppressed
       */
      _throttle(actionType, path, timeout) {
        if (!this._throttled.has(actionType)) {
          this._throttled.set(actionType, /* @__PURE__ */ new Map());
        }
        const action = this._throttled.get(actionType);
        const actionPath = action.get(path);
        if (actionPath) {
          actionPath.count++;
          return false;
        }
        let timeoutObject;
        const clear = () => {
          const item = action.get(path);
          const count = item ? item.count : 0;
          action.delete(path);
          clearTimeout(timeoutObject);
          if (item) clearTimeout(item.timeoutObject);
          return count;
        };
        timeoutObject = setTimeout(clear, timeout);
        const thr = { timeoutObject, clear, count: 0 };
        action.set(path, thr);
        return thr;
      }
      _incrReadyCount() {
        return this._readyCount++;
      }
      /**
       * Awaits write operation to finish.
       * Polls a newly created file for size variations. When files size does not change for 'threshold' milliseconds calls callback.
       * @param {Path} path being acted upon
       * @param {Number} threshold Time in milliseconds a file size must be fixed before acknowledging write OP is finished
       * @param {EventName} event
       * @param {Function} awfEmit Callback to be called when ready for event to be emitted.
       */
      _awaitWriteFinish(path, threshold, event, awfEmit) {
        let timeoutHandler;
        let fullPath = path;
        if (this.options.cwd && !sysPath.isAbsolute(path)) {
          fullPath = sysPath.join(this.options.cwd, path);
        }
        const now = /* @__PURE__ */ new Date();
        const awaitWriteFinish = (prevStat) => {
          fs.stat(fullPath, (err, curStat) => {
            if (err || !this._pendingWrites.has(path)) {
              if (err && err.code !== "ENOENT") awfEmit(err);
              return;
            }
            const now2 = Number(/* @__PURE__ */ new Date());
            if (prevStat && curStat.size !== prevStat.size) {
              this._pendingWrites.get(path).lastChange = now2;
            }
            const pw = this._pendingWrites.get(path);
            const df = now2 - pw.lastChange;
            if (df >= threshold) {
              this._pendingWrites.delete(path);
              awfEmit(void 0, curStat);
            } else {
              timeoutHandler = setTimeout(
                awaitWriteFinish,
                this.options.awaitWriteFinish.pollInterval,
                curStat
              );
            }
          });
        };
        if (!this._pendingWrites.has(path)) {
          this._pendingWrites.set(path, {
            lastChange: now,
            cancelWait: () => {
              this._pendingWrites.delete(path);
              clearTimeout(timeoutHandler);
              return event;
            }
          });
          timeoutHandler = setTimeout(
            awaitWriteFinish,
            this.options.awaitWriteFinish.pollInterval
          );
        }
      }
      _getGlobIgnored() {
        return [...this._ignoredPaths.values()];
      }
      /**
       * Determines whether user has asked to ignore this path.
       * @param {Path} path filepath or dir
       * @param {fs.Stats=} stats result of fs.stat
       * @returns {Boolean}
       */
      _isIgnored(path, stats) {
        if (this.options.atomic && DOT_RE.test(path)) return true;
        if (!this._userIgnored) {
          const { cwd } = this.options;
          const ign = this.options.ignored;
          const ignored = ign && ign.map(normalizeIgnored(cwd));
          const paths = arrify(ignored).filter((path2) => typeof path2 === STRING_TYPE && !isGlob(path2)).map((path2) => path2 + SLASH_GLOBSTAR);
          const list = this._getGlobIgnored().map(normalizeIgnored(cwd)).concat(ignored, paths);
          this._userIgnored = anymatch(list, void 0, ANYMATCH_OPTS);
        }
        return this._userIgnored([path, stats]);
      }
      _isntIgnored(path, stat2) {
        return !this._isIgnored(path, stat2);
      }
      /**
       * Provides a set of common helpers and properties relating to symlink and glob handling.
       * @param {Path} path file, directory, or glob pattern being watched
       * @param {Number=} depth at any depth > 0, this isn't a glob
       * @returns {WatchHelper} object containing helpers for this path
       */
      _getWatchHelpers(path, depth) {
        const watchPath = depth || this.options.disableGlobbing || !isGlob(path) ? path : globParent(path);
        const follow = this.options.followSymlinks;
        return new WatchHelper(path, watchPath, follow, this);
      }
      // Directory helpers
      // -----------------
      /**
       * Provides directory tracking objects
       * @param {String} directory path of the directory
       * @returns {DirEntry} the directory's tracking object
       */
      _getWatchedDir(directory) {
        if (!this._boundRemove) this._boundRemove = this._remove.bind(this);
        const dir = sysPath.resolve(directory);
        if (!this._watched.has(dir)) this._watched.set(dir, new DirEntry(dir, this._boundRemove));
        return this._watched.get(dir);
      }
      // File helpers
      // ------------
      /**
       * Check for read permissions.
       * Based on this answer on SO: https://stackoverflow.com/a/11781404/1358405
       * @param {fs.Stats} stats - object, result of fs_stat
       * @returns {Boolean} indicates whether the file can be read
      */
      _hasReadPermissions(stats) {
        if (this.options.ignorePermissionErrors) return true;
        const md = stats && Number.parseInt(stats.mode, 10);
        const st = md & 511;
        const it = Number.parseInt(st.toString(8)[0], 10);
        return Boolean(4 & it);
      }
      /**
       * Handles emitting unlink events for
       * files and directories, and via recursion, for
       * files and directories within directories that are unlinked
       * @param {String} directory within which the following item is located
       * @param {String} item      base path of item/directory
       * @returns {void}
      */
      _remove(directory, item, isDirectory) {
        const path = sysPath.join(directory, item);
        const fullPath = sysPath.resolve(path);
        isDirectory = isDirectory != null ? isDirectory : this._watched.has(path) || this._watched.has(fullPath);
        if (!this._throttle("remove", path, 100)) return;
        if (!isDirectory && !this.options.useFsEvents && this._watched.size === 1) {
          this.add(directory, item, true);
        }
        const wp = this._getWatchedDir(path);
        const nestedDirectoryChildren = wp.getChildren();
        nestedDirectoryChildren.forEach((nested) => this._remove(path, nested));
        const parent = this._getWatchedDir(directory);
        const wasTracked = parent.has(item);
        parent.remove(item);
        if (this._symlinkPaths.has(fullPath)) {
          this._symlinkPaths.delete(fullPath);
        }
        let relPath = path;
        if (this.options.cwd) relPath = sysPath.relative(this.options.cwd, path);
        if (this.options.awaitWriteFinish && this._pendingWrites.has(relPath)) {
          const event = this._pendingWrites.get(relPath).cancelWait();
          if (event === EV_ADD) return;
        }
        this._watched.delete(path);
        this._watched.delete(fullPath);
        const eventName = isDirectory ? EV_UNLINK_DIR : EV_UNLINK;
        if (wasTracked && !this._isIgnored(path)) this._emit(eventName, path);
        if (!this.options.useFsEvents) {
          this._closePath(path);
        }
      }
      /**
       * Closes all watchers for a path
       * @param {Path} path
       */
      _closePath(path) {
        this._closeFile(path);
        const dir = sysPath.dirname(path);
        this._getWatchedDir(dir).remove(sysPath.basename(path));
      }
      /**
       * Closes only file-specific watchers
       * @param {Path} path
       */
      _closeFile(path) {
        const closers = this._closers.get(path);
        if (!closers) return;
        closers.forEach((closer) => closer());
        this._closers.delete(path);
      }
      /**
       *
       * @param {Path} path
       * @param {Function} closer
       */
      _addPathCloser(path, closer) {
        if (!closer) return;
        let list = this._closers.get(path);
        if (!list) {
          list = [];
          this._closers.set(path, list);
        }
        list.push(closer);
      }
      _readdirp(root, opts) {
        if (this.closed) return;
        const options2 = { type: EV_ALL, alwaysStat: true, lstat: true, ...opts };
        let stream = readdirp(root, options2);
        this._streams.add(stream);
        stream.once(STR_CLOSE, () => {
          stream = void 0;
        });
        stream.once(STR_END, () => {
          if (stream) {
            this._streams.delete(stream);
            stream = void 0;
          }
        });
        return stream;
      }
    };
    exports2.FSWatcher = FSWatcher;
    var watch = (paths, options2) => {
      const watcher = new FSWatcher(options2);
      watcher.add(paths);
      return watcher;
    };
    exports2.watch = watch;
  }
});

// node_modules/buffer-crc32/index.js
var require_buffer_crc32 = __commonJS({
  "node_modules/buffer-crc32/index.js"(exports2, module2) {
    var Buffer2 = require("buffer").Buffer;
    var CRC_TABLE = [
      0,
      1996959894,
      3993919788,
      2567524794,
      124634137,
      1886057615,
      3915621685,
      2657392035,
      249268274,
      2044508324,
      3772115230,
      2547177864,
      162941995,
      2125561021,
      3887607047,
      2428444049,
      498536548,
      1789927666,
      4089016648,
      2227061214,
      450548861,
      1843258603,
      4107580753,
      2211677639,
      325883990,
      1684777152,
      4251122042,
      2321926636,
      335633487,
      1661365465,
      4195302755,
      2366115317,
      997073096,
      1281953886,
      3579855332,
      2724688242,
      1006888145,
      1258607687,
      3524101629,
      2768942443,
      901097722,
      1119000684,
      3686517206,
      2898065728,
      853044451,
      1172266101,
      3705015759,
      2882616665,
      651767980,
      1373503546,
      3369554304,
      3218104598,
      565507253,
      1454621731,
      3485111705,
      3099436303,
      671266974,
      1594198024,
      3322730930,
      2970347812,
      795835527,
      1483230225,
      3244367275,
      3060149565,
      1994146192,
      31158534,
      2563907772,
      4023717930,
      1907459465,
      112637215,
      2680153253,
      3904427059,
      2013776290,
      251722036,
      2517215374,
      3775830040,
      2137656763,
      141376813,
      2439277719,
      3865271297,
      1802195444,
      476864866,
      2238001368,
      4066508878,
      1812370925,
      453092731,
      2181625025,
      4111451223,
      1706088902,
      314042704,
      2344532202,
      4240017532,
      1658658271,
      366619977,
      2362670323,
      4224994405,
      1303535960,
      984961486,
      2747007092,
      3569037538,
      1256170817,
      1037604311,
      2765210733,
      3554079995,
      1131014506,
      879679996,
      2909243462,
      3663771856,
      1141124467,
      855842277,
      2852801631,
      3708648649,
      1342533948,
      654459306,
      3188396048,
      3373015174,
      1466479909,
      544179635,
      3110523913,
      3462522015,
      1591671054,
      702138776,
      2966460450,
      3352799412,
      1504918807,
      783551873,
      3082640443,
      3233442989,
      3988292384,
      2596254646,
      62317068,
      1957810842,
      3939845945,
      2647816111,
      81470997,
      1943803523,
      3814918930,
      2489596804,
      225274430,
      2053790376,
      3826175755,
      2466906013,
      167816743,
      2097651377,
      4027552580,
      2265490386,
      503444072,
      1762050814,
      4150417245,
      2154129355,
      426522225,
      1852507879,
      4275313526,
      2312317920,
      282753626,
      1742555852,
      4189708143,
      2394877945,
      397917763,
      1622183637,
      3604390888,
      2714866558,
      953729732,
      1340076626,
      3518719985,
      2797360999,
      1068828381,
      1219638859,
      3624741850,
      2936675148,
      906185462,
      1090812512,
      3747672003,
      2825379669,
      829329135,
      1181335161,
      3412177804,
      3160834842,
      628085408,
      1382605366,
      3423369109,
      3138078467,
      570562233,
      1426400815,
      3317316542,
      2998733608,
      733239954,
      1555261956,
      3268935591,
      3050360625,
      752459403,
      1541320221,
      2607071920,
      3965973030,
      1969922972,
      40735498,
      2617837225,
      3943577151,
      1913087877,
      83908371,
      2512341634,
      3803740692,
      2075208622,
      213261112,
      2463272603,
      3855990285,
      2094854071,
      198958881,
      2262029012,
      4057260610,
      1759359992,
      534414190,
      2176718541,
      4139329115,
      1873836001,
      414664567,
      2282248934,
      4279200368,
      1711684554,
      285281116,
      2405801727,
      4167216745,
      1634467795,
      376229701,
      2685067896,
      3608007406,
      1308918612,
      956543938,
      2808555105,
      3495958263,
      1231636301,
      1047427035,
      2932959818,
      3654703836,
      1088359270,
      936918e3,
      2847714899,
      3736837829,
      1202900863,
      817233897,
      3183342108,
      3401237130,
      1404277552,
      615818150,
      3134207493,
      3453421203,
      1423857449,
      601450431,
      3009837614,
      3294710456,
      1567103746,
      711928724,
      3020668471,
      3272380065,
      1510334235,
      755167117
    ];
    if (typeof Int32Array !== "undefined") {
      CRC_TABLE = new Int32Array(CRC_TABLE);
    }
    function ensureBuffer(input) {
      if (Buffer2.isBuffer(input)) {
        return input;
      }
      var hasNewBufferAPI = typeof Buffer2.alloc === "function" && typeof Buffer2.from === "function";
      if (typeof input === "number") {
        return hasNewBufferAPI ? Buffer2.alloc(input) : new Buffer2(input);
      } else if (typeof input === "string") {
        return hasNewBufferAPI ? Buffer2.from(input) : new Buffer2(input);
      } else {
        throw new Error("input must be buffer, number, or string, received " + typeof input);
      }
    }
    function bufferizeInt(num) {
      var tmp = ensureBuffer(4);
      tmp.writeInt32BE(num, 0);
      return tmp;
    }
    function _crc32(buf, previous) {
      buf = ensureBuffer(buf);
      if (Buffer2.isBuffer(previous)) {
        previous = previous.readUInt32BE(0);
      }
      var crc = ~~previous ^ -1;
      for (var n = 0; n < buf.length; n++) {
        crc = CRC_TABLE[(crc ^ buf[n]) & 255] ^ crc >>> 8;
      }
      return crc ^ -1;
    }
    function crc32() {
      return bufferizeInt(_crc32.apply(null, arguments));
    }
    crc32.signed = function() {
      return _crc32.apply(null, arguments);
    };
    crc32.unsigned = function() {
      return _crc32.apply(null, arguments) >>> 0;
    };
    module2.exports = crc32;
  }
});

// node_modules/yazl/index.js
var require_yazl = __commonJS({
  "node_modules/yazl/index.js"(exports2) {
    var fs = require("fs");
    var Transform = require("stream").Transform;
    var PassThrough2 = require("stream").PassThrough;
    var zlib = require("zlib");
    var util2 = require("util");
    var EventEmitter = require("events").EventEmitter;
    var crc32 = require_buffer_crc32();
    exports2.ZipFile = ZipFile;
    exports2.dateToDosDateTime = dateToDosDateTime;
    util2.inherits(ZipFile, EventEmitter);
    function ZipFile() {
      this.outputStream = new PassThrough2();
      this.entries = [];
      this.outputStreamCursor = 0;
      this.ended = false;
      this.allDone = false;
      this.forceZip64Eocd = false;
    }
    ZipFile.prototype.addFile = function(realPath, metadataPath, options2) {
      var self = this;
      metadataPath = validateMetadataPath(metadataPath, false);
      if (options2 == null) options2 = {};
      var entry = new Entry(metadataPath, false, options2);
      self.entries.push(entry);
      fs.stat(realPath, function(err, stats) {
        if (err) return self.emit("error", err);
        if (!stats.isFile()) return self.emit("error", new Error("not a file: " + realPath));
        entry.uncompressedSize = stats.size;
        if (options2.mtime == null) entry.setLastModDate(stats.mtime);
        if (options2.mode == null) entry.setFileAttributesMode(stats.mode);
        entry.setFileDataPumpFunction(function() {
          var readStream = fs.createReadStream(realPath);
          entry.state = Entry.FILE_DATA_IN_PROGRESS;
          readStream.on("error", function(err2) {
            self.emit("error", err2);
          });
          pumpFileDataReadStream(self, entry, readStream);
        });
        pumpEntries(self);
      });
    };
    ZipFile.prototype.addReadStream = function(readStream, metadataPath, options2) {
      var self = this;
      metadataPath = validateMetadataPath(metadataPath, false);
      if (options2 == null) options2 = {};
      var entry = new Entry(metadataPath, false, options2);
      self.entries.push(entry);
      entry.setFileDataPumpFunction(function() {
        entry.state = Entry.FILE_DATA_IN_PROGRESS;
        pumpFileDataReadStream(self, entry, readStream);
      });
      pumpEntries(self);
    };
    ZipFile.prototype.addBuffer = function(buffer, metadataPath, options2) {
      var self = this;
      metadataPath = validateMetadataPath(metadataPath, false);
      if (buffer.length > 1073741823) throw new Error("buffer too large: " + buffer.length + " > 1073741823");
      if (options2 == null) options2 = {};
      if (options2.size != null) throw new Error("options.size not allowed");
      var entry = new Entry(metadataPath, false, options2);
      entry.uncompressedSize = buffer.length;
      entry.crc32 = crc32.unsigned(buffer);
      entry.crcAndFileSizeKnown = true;
      self.entries.push(entry);
      if (!entry.compress) {
        setCompressedBuffer(buffer);
      } else {
        zlib.deflateRaw(buffer, function(err, compressedBuffer) {
          setCompressedBuffer(compressedBuffer);
        });
      }
      function setCompressedBuffer(compressedBuffer) {
        entry.compressedSize = compressedBuffer.length;
        entry.setFileDataPumpFunction(function() {
          writeToOutputStream(self, compressedBuffer);
          writeToOutputStream(self, entry.getDataDescriptor());
          entry.state = Entry.FILE_DATA_DONE;
          setImmediate(function() {
            pumpEntries(self);
          });
        });
        pumpEntries(self);
      }
    };
    ZipFile.prototype.addEmptyDirectory = function(metadataPath, options2) {
      var self = this;
      metadataPath = validateMetadataPath(metadataPath, true);
      if (options2 == null) options2 = {};
      if (options2.size != null) throw new Error("options.size not allowed");
      if (options2.compress != null) throw new Error("options.compress not allowed");
      var entry = new Entry(metadataPath, true, options2);
      self.entries.push(entry);
      entry.setFileDataPumpFunction(function() {
        writeToOutputStream(self, entry.getDataDescriptor());
        entry.state = Entry.FILE_DATA_DONE;
        pumpEntries(self);
      });
      pumpEntries(self);
    };
    var eocdrSignatureBuffer = bufferFrom([80, 75, 5, 6]);
    ZipFile.prototype.end = function(options2, finalSizeCallback) {
      if (typeof options2 === "function") {
        finalSizeCallback = options2;
        options2 = null;
      }
      if (options2 == null) options2 = {};
      if (this.ended) return;
      this.ended = true;
      this.finalSizeCallback = finalSizeCallback;
      this.forceZip64Eocd = !!options2.forceZip64Format;
      if (options2.comment) {
        if (typeof options2.comment === "string") {
          this.comment = encodeCp437(options2.comment);
        } else {
          this.comment = options2.comment;
        }
        if (this.comment.length > 65535) throw new Error("comment is too large");
        if (bufferIncludes(this.comment, eocdrSignatureBuffer)) throw new Error("comment contains end of central directory record signature");
      } else {
        this.comment = EMPTY_BUFFER;
      }
      pumpEntries(this);
    };
    function writeToOutputStream(self, buffer) {
      self.outputStream.write(buffer);
      self.outputStreamCursor += buffer.length;
    }
    function pumpFileDataReadStream(self, entry, readStream) {
      var crc32Watcher = new Crc32Watcher();
      var uncompressedSizeCounter = new ByteCounter();
      var compressor = entry.compress ? new zlib.DeflateRaw() : new PassThrough2();
      var compressedSizeCounter = new ByteCounter();
      readStream.pipe(crc32Watcher).pipe(uncompressedSizeCounter).pipe(compressor).pipe(compressedSizeCounter).pipe(self.outputStream, { end: false });
      compressedSizeCounter.on("end", function() {
        entry.crc32 = crc32Watcher.crc32;
        if (entry.uncompressedSize == null) {
          entry.uncompressedSize = uncompressedSizeCounter.byteCount;
        } else {
          if (entry.uncompressedSize !== uncompressedSizeCounter.byteCount) return self.emit("error", new Error("file data stream has unexpected number of bytes"));
        }
        entry.compressedSize = compressedSizeCounter.byteCount;
        self.outputStreamCursor += entry.compressedSize;
        writeToOutputStream(self, entry.getDataDescriptor());
        entry.state = Entry.FILE_DATA_DONE;
        pumpEntries(self);
      });
    }
    function pumpEntries(self) {
      if (self.allDone) return;
      if (self.ended && self.finalSizeCallback != null) {
        var finalSize = calculateFinalSize(self);
        if (finalSize != null) {
          self.finalSizeCallback(finalSize);
          self.finalSizeCallback = null;
        }
      }
      var entry = getFirstNotDoneEntry();
      function getFirstNotDoneEntry() {
        for (var i = 0; i < self.entries.length; i++) {
          var entry2 = self.entries[i];
          if (entry2.state < Entry.FILE_DATA_DONE) return entry2;
        }
        return null;
      }
      if (entry != null) {
        if (entry.state < Entry.READY_TO_PUMP_FILE_DATA) return;
        if (entry.state === Entry.FILE_DATA_IN_PROGRESS) return;
        entry.relativeOffsetOfLocalHeader = self.outputStreamCursor;
        var localFileHeader = entry.getLocalFileHeader();
        writeToOutputStream(self, localFileHeader);
        entry.doFileDataPump();
      } else {
        if (self.ended) {
          self.offsetOfStartOfCentralDirectory = self.outputStreamCursor;
          self.entries.forEach(function(entry2) {
            var centralDirectoryRecord = entry2.getCentralDirectoryRecord();
            writeToOutputStream(self, centralDirectoryRecord);
          });
          writeToOutputStream(self, getEndOfCentralDirectoryRecord(self));
          self.outputStream.end();
          self.allDone = true;
        }
      }
    }
    function calculateFinalSize(self) {
      var pretendOutputCursor = 0;
      var centralDirectorySize = 0;
      for (var i = 0; i < self.entries.length; i++) {
        var entry = self.entries[i];
        if (entry.compress) return -1;
        if (entry.state >= Entry.READY_TO_PUMP_FILE_DATA) {
          if (entry.uncompressedSize == null) return -1;
        } else {
          if (entry.uncompressedSize == null) return null;
        }
        entry.relativeOffsetOfLocalHeader = pretendOutputCursor;
        var useZip64Format = entry.useZip64Format();
        pretendOutputCursor += LOCAL_FILE_HEADER_FIXED_SIZE + entry.utf8FileName.length;
        pretendOutputCursor += entry.uncompressedSize;
        if (!entry.crcAndFileSizeKnown) {
          if (useZip64Format) {
            pretendOutputCursor += ZIP64_DATA_DESCRIPTOR_SIZE;
          } else {
            pretendOutputCursor += DATA_DESCRIPTOR_SIZE;
          }
        }
        centralDirectorySize += CENTRAL_DIRECTORY_RECORD_FIXED_SIZE + entry.utf8FileName.length + entry.fileComment.length;
        if (useZip64Format) {
          centralDirectorySize += ZIP64_EXTENDED_INFORMATION_EXTRA_FIELD_SIZE;
        }
      }
      var endOfCentralDirectorySize = 0;
      if (self.forceZip64Eocd || self.entries.length >= 65535 || centralDirectorySize >= 65535 || pretendOutputCursor >= 4294967295) {
        endOfCentralDirectorySize += ZIP64_END_OF_CENTRAL_DIRECTORY_RECORD_SIZE + ZIP64_END_OF_CENTRAL_DIRECTORY_LOCATOR_SIZE;
      }
      endOfCentralDirectorySize += END_OF_CENTRAL_DIRECTORY_RECORD_SIZE + self.comment.length;
      return pretendOutputCursor + centralDirectorySize + endOfCentralDirectorySize;
    }
    var ZIP64_END_OF_CENTRAL_DIRECTORY_RECORD_SIZE = 56;
    var ZIP64_END_OF_CENTRAL_DIRECTORY_LOCATOR_SIZE = 20;
    var END_OF_CENTRAL_DIRECTORY_RECORD_SIZE = 22;
    function getEndOfCentralDirectoryRecord(self, actuallyJustTellMeHowLongItWouldBe) {
      var needZip64Format = false;
      var normalEntriesLength = self.entries.length;
      if (self.forceZip64Eocd || self.entries.length >= 65535) {
        normalEntriesLength = 65535;
        needZip64Format = true;
      }
      var sizeOfCentralDirectory = self.outputStreamCursor - self.offsetOfStartOfCentralDirectory;
      var normalSizeOfCentralDirectory = sizeOfCentralDirectory;
      if (self.forceZip64Eocd || sizeOfCentralDirectory >= 4294967295) {
        normalSizeOfCentralDirectory = 4294967295;
        needZip64Format = true;
      }
      var normalOffsetOfStartOfCentralDirectory = self.offsetOfStartOfCentralDirectory;
      if (self.forceZip64Eocd || self.offsetOfStartOfCentralDirectory >= 4294967295) {
        normalOffsetOfStartOfCentralDirectory = 4294967295;
        needZip64Format = true;
      }
      if (actuallyJustTellMeHowLongItWouldBe) {
        if (needZip64Format) {
          return ZIP64_END_OF_CENTRAL_DIRECTORY_RECORD_SIZE + ZIP64_END_OF_CENTRAL_DIRECTORY_LOCATOR_SIZE + END_OF_CENTRAL_DIRECTORY_RECORD_SIZE;
        } else {
          return END_OF_CENTRAL_DIRECTORY_RECORD_SIZE;
        }
      }
      var eocdrBuffer = bufferAlloc(END_OF_CENTRAL_DIRECTORY_RECORD_SIZE + self.comment.length);
      eocdrBuffer.writeUInt32LE(101010256, 0);
      eocdrBuffer.writeUInt16LE(0, 4);
      eocdrBuffer.writeUInt16LE(0, 6);
      eocdrBuffer.writeUInt16LE(normalEntriesLength, 8);
      eocdrBuffer.writeUInt16LE(normalEntriesLength, 10);
      eocdrBuffer.writeUInt32LE(normalSizeOfCentralDirectory, 12);
      eocdrBuffer.writeUInt32LE(normalOffsetOfStartOfCentralDirectory, 16);
      eocdrBuffer.writeUInt16LE(self.comment.length, 20);
      self.comment.copy(eocdrBuffer, 22);
      if (!needZip64Format) return eocdrBuffer;
      var zip64EocdrBuffer = bufferAlloc(ZIP64_END_OF_CENTRAL_DIRECTORY_RECORD_SIZE);
      zip64EocdrBuffer.writeUInt32LE(101075792, 0);
      writeUInt64LE(zip64EocdrBuffer, ZIP64_END_OF_CENTRAL_DIRECTORY_RECORD_SIZE - 12, 4);
      zip64EocdrBuffer.writeUInt16LE(VERSION_MADE_BY, 12);
      zip64EocdrBuffer.writeUInt16LE(VERSION_NEEDED_TO_EXTRACT_ZIP64, 14);
      zip64EocdrBuffer.writeUInt32LE(0, 16);
      zip64EocdrBuffer.writeUInt32LE(0, 20);
      writeUInt64LE(zip64EocdrBuffer, self.entries.length, 24);
      writeUInt64LE(zip64EocdrBuffer, self.entries.length, 32);
      writeUInt64LE(zip64EocdrBuffer, sizeOfCentralDirectory, 40);
      writeUInt64LE(zip64EocdrBuffer, self.offsetOfStartOfCentralDirectory, 48);
      var zip64EocdlBuffer = bufferAlloc(ZIP64_END_OF_CENTRAL_DIRECTORY_LOCATOR_SIZE);
      zip64EocdlBuffer.writeUInt32LE(117853008, 0);
      zip64EocdlBuffer.writeUInt32LE(0, 4);
      writeUInt64LE(zip64EocdlBuffer, self.outputStreamCursor, 8);
      zip64EocdlBuffer.writeUInt32LE(1, 16);
      return Buffer.concat([
        zip64EocdrBuffer,
        zip64EocdlBuffer,
        eocdrBuffer
      ]);
    }
    function validateMetadataPath(metadataPath, isDirectory) {
      if (metadataPath === "") throw new Error("empty metadataPath");
      metadataPath = metadataPath.replace(/\\/g, "/");
      if (/^[a-zA-Z]:/.test(metadataPath) || /^\//.test(metadataPath)) throw new Error("absolute path: " + metadataPath);
      if (metadataPath.split("/").indexOf("..") !== -1) throw new Error("invalid relative path: " + metadataPath);
      var looksLikeDirectory = /\/$/.test(metadataPath);
      if (isDirectory) {
        if (!looksLikeDirectory) metadataPath += "/";
      } else {
        if (looksLikeDirectory) throw new Error("file path cannot end with '/': " + metadataPath);
      }
      return metadataPath;
    }
    var EMPTY_BUFFER = bufferAlloc(0);
    function Entry(metadataPath, isDirectory, options2) {
      this.utf8FileName = bufferFrom(metadataPath);
      if (this.utf8FileName.length > 65535) throw new Error("utf8 file name too long. " + utf8FileName.length + " > 65535");
      this.isDirectory = isDirectory;
      this.state = Entry.WAITING_FOR_METADATA;
      this.setLastModDate(options2.mtime != null ? options2.mtime : /* @__PURE__ */ new Date());
      if (options2.mode != null) {
        this.setFileAttributesMode(options2.mode);
      } else {
        this.setFileAttributesMode(isDirectory ? 16893 : 33204);
      }
      if (isDirectory) {
        this.crcAndFileSizeKnown = true;
        this.crc32 = 0;
        this.uncompressedSize = 0;
        this.compressedSize = 0;
      } else {
        this.crcAndFileSizeKnown = false;
        this.crc32 = null;
        this.uncompressedSize = null;
        this.compressedSize = null;
        if (options2.size != null) this.uncompressedSize = options2.size;
      }
      if (isDirectory) {
        this.compress = false;
      } else {
        this.compress = true;
        if (options2.compress != null) this.compress = !!options2.compress;
      }
      this.forceZip64Format = !!options2.forceZip64Format;
      if (options2.fileComment) {
        if (typeof options2.fileComment === "string") {
          this.fileComment = bufferFrom(options2.fileComment, "utf-8");
        } else {
          this.fileComment = options2.fileComment;
        }
        if (this.fileComment.length > 65535) throw new Error("fileComment is too large");
      } else {
        this.fileComment = EMPTY_BUFFER;
      }
    }
    Entry.WAITING_FOR_METADATA = 0;
    Entry.READY_TO_PUMP_FILE_DATA = 1;
    Entry.FILE_DATA_IN_PROGRESS = 2;
    Entry.FILE_DATA_DONE = 3;
    Entry.prototype.setLastModDate = function(date5) {
      var dosDateTime = dateToDosDateTime(date5);
      this.lastModFileTime = dosDateTime.time;
      this.lastModFileDate = dosDateTime.date;
    };
    Entry.prototype.setFileAttributesMode = function(mode) {
      if ((mode & 65535) !== mode) throw new Error("invalid mode. expected: 0 <= " + mode + " <= 65535");
      this.externalFileAttributes = mode << 16 >>> 0;
    };
    Entry.prototype.setFileDataPumpFunction = function(doFileDataPump) {
      this.doFileDataPump = doFileDataPump;
      this.state = Entry.READY_TO_PUMP_FILE_DATA;
    };
    Entry.prototype.useZip64Format = function() {
      return this.forceZip64Format || this.uncompressedSize != null && this.uncompressedSize > 4294967294 || this.compressedSize != null && this.compressedSize > 4294967294 || this.relativeOffsetOfLocalHeader != null && this.relativeOffsetOfLocalHeader > 4294967294;
    };
    var LOCAL_FILE_HEADER_FIXED_SIZE = 30;
    var VERSION_NEEDED_TO_EXTRACT_UTF8 = 20;
    var VERSION_NEEDED_TO_EXTRACT_ZIP64 = 45;
    var VERSION_MADE_BY = 3 << 8 | 63;
    var FILE_NAME_IS_UTF8 = 1 << 11;
    var UNKNOWN_CRC32_AND_FILE_SIZES = 1 << 3;
    Entry.prototype.getLocalFileHeader = function() {
      var crc322 = 0;
      var compressedSize = 0;
      var uncompressedSize = 0;
      if (this.crcAndFileSizeKnown) {
        crc322 = this.crc32;
        compressedSize = this.compressedSize;
        uncompressedSize = this.uncompressedSize;
      }
      var fixedSizeStuff = bufferAlloc(LOCAL_FILE_HEADER_FIXED_SIZE);
      var generalPurposeBitFlag = FILE_NAME_IS_UTF8;
      if (!this.crcAndFileSizeKnown) generalPurposeBitFlag |= UNKNOWN_CRC32_AND_FILE_SIZES;
      fixedSizeStuff.writeUInt32LE(67324752, 0);
      fixedSizeStuff.writeUInt16LE(VERSION_NEEDED_TO_EXTRACT_UTF8, 4);
      fixedSizeStuff.writeUInt16LE(generalPurposeBitFlag, 6);
      fixedSizeStuff.writeUInt16LE(this.getCompressionMethod(), 8);
      fixedSizeStuff.writeUInt16LE(this.lastModFileTime, 10);
      fixedSizeStuff.writeUInt16LE(this.lastModFileDate, 12);
      fixedSizeStuff.writeUInt32LE(crc322, 14);
      fixedSizeStuff.writeUInt32LE(compressedSize, 18);
      fixedSizeStuff.writeUInt32LE(uncompressedSize, 22);
      fixedSizeStuff.writeUInt16LE(this.utf8FileName.length, 26);
      fixedSizeStuff.writeUInt16LE(0, 28);
      return Buffer.concat([
        fixedSizeStuff,
        // file name (variable size)
        this.utf8FileName
        // extra field (variable size)
        // no extra fields
      ]);
    };
    var DATA_DESCRIPTOR_SIZE = 16;
    var ZIP64_DATA_DESCRIPTOR_SIZE = 24;
    Entry.prototype.getDataDescriptor = function() {
      if (this.crcAndFileSizeKnown) {
        return EMPTY_BUFFER;
      }
      if (!this.useZip64Format()) {
        var buffer = bufferAlloc(DATA_DESCRIPTOR_SIZE);
        buffer.writeUInt32LE(134695760, 0);
        buffer.writeUInt32LE(this.crc32, 4);
        buffer.writeUInt32LE(this.compressedSize, 8);
        buffer.writeUInt32LE(this.uncompressedSize, 12);
        return buffer;
      } else {
        var buffer = bufferAlloc(ZIP64_DATA_DESCRIPTOR_SIZE);
        buffer.writeUInt32LE(134695760, 0);
        buffer.writeUInt32LE(this.crc32, 4);
        writeUInt64LE(buffer, this.compressedSize, 8);
        writeUInt64LE(buffer, this.uncompressedSize, 16);
        return buffer;
      }
    };
    var CENTRAL_DIRECTORY_RECORD_FIXED_SIZE = 46;
    var ZIP64_EXTENDED_INFORMATION_EXTRA_FIELD_SIZE = 28;
    Entry.prototype.getCentralDirectoryRecord = function() {
      var fixedSizeStuff = bufferAlloc(CENTRAL_DIRECTORY_RECORD_FIXED_SIZE);
      var generalPurposeBitFlag = FILE_NAME_IS_UTF8;
      if (!this.crcAndFileSizeKnown) generalPurposeBitFlag |= UNKNOWN_CRC32_AND_FILE_SIZES;
      var normalCompressedSize = this.compressedSize;
      var normalUncompressedSize = this.uncompressedSize;
      var normalRelativeOffsetOfLocalHeader = this.relativeOffsetOfLocalHeader;
      var versionNeededToExtract;
      var zeiefBuffer;
      if (this.useZip64Format()) {
        normalCompressedSize = 4294967295;
        normalUncompressedSize = 4294967295;
        normalRelativeOffsetOfLocalHeader = 4294967295;
        versionNeededToExtract = VERSION_NEEDED_TO_EXTRACT_ZIP64;
        zeiefBuffer = bufferAlloc(ZIP64_EXTENDED_INFORMATION_EXTRA_FIELD_SIZE);
        zeiefBuffer.writeUInt16LE(1, 0);
        zeiefBuffer.writeUInt16LE(ZIP64_EXTENDED_INFORMATION_EXTRA_FIELD_SIZE - 4, 2);
        writeUInt64LE(zeiefBuffer, this.uncompressedSize, 4);
        writeUInt64LE(zeiefBuffer, this.compressedSize, 12);
        writeUInt64LE(zeiefBuffer, this.relativeOffsetOfLocalHeader, 20);
      } else {
        versionNeededToExtract = VERSION_NEEDED_TO_EXTRACT_UTF8;
        zeiefBuffer = EMPTY_BUFFER;
      }
      fixedSizeStuff.writeUInt32LE(33639248, 0);
      fixedSizeStuff.writeUInt16LE(VERSION_MADE_BY, 4);
      fixedSizeStuff.writeUInt16LE(versionNeededToExtract, 6);
      fixedSizeStuff.writeUInt16LE(generalPurposeBitFlag, 8);
      fixedSizeStuff.writeUInt16LE(this.getCompressionMethod(), 10);
      fixedSizeStuff.writeUInt16LE(this.lastModFileTime, 12);
      fixedSizeStuff.writeUInt16LE(this.lastModFileDate, 14);
      fixedSizeStuff.writeUInt32LE(this.crc32, 16);
      fixedSizeStuff.writeUInt32LE(normalCompressedSize, 20);
      fixedSizeStuff.writeUInt32LE(normalUncompressedSize, 24);
      fixedSizeStuff.writeUInt16LE(this.utf8FileName.length, 28);
      fixedSizeStuff.writeUInt16LE(zeiefBuffer.length, 30);
      fixedSizeStuff.writeUInt16LE(this.fileComment.length, 32);
      fixedSizeStuff.writeUInt16LE(0, 34);
      fixedSizeStuff.writeUInt16LE(0, 36);
      fixedSizeStuff.writeUInt32LE(this.externalFileAttributes, 38);
      fixedSizeStuff.writeUInt32LE(normalRelativeOffsetOfLocalHeader, 42);
      return Buffer.concat([
        fixedSizeStuff,
        // file name (variable size)
        this.utf8FileName,
        // extra field (variable size)
        zeiefBuffer,
        // file comment (variable size)
        this.fileComment
      ]);
    };
    Entry.prototype.getCompressionMethod = function() {
      var NO_COMPRESSION = 0;
      var DEFLATE_COMPRESSION = 8;
      return this.compress ? DEFLATE_COMPRESSION : NO_COMPRESSION;
    };
    function dateToDosDateTime(jsDate) {
      var date5 = 0;
      date5 |= jsDate.getDate() & 31;
      date5 |= (jsDate.getMonth() + 1 & 15) << 5;
      date5 |= (jsDate.getFullYear() - 1980 & 127) << 9;
      var time3 = 0;
      time3 |= Math.floor(jsDate.getSeconds() / 2);
      time3 |= (jsDate.getMinutes() & 63) << 5;
      time3 |= (jsDate.getHours() & 31) << 11;
      return { date: date5, time: time3 };
    }
    function writeUInt64LE(buffer, n, offset) {
      var high = Math.floor(n / 4294967296);
      var low = n % 4294967296;
      buffer.writeUInt32LE(low, offset);
      buffer.writeUInt32LE(high, offset + 4);
    }
    util2.inherits(ByteCounter, Transform);
    function ByteCounter(options2) {
      Transform.call(this, options2);
      this.byteCount = 0;
    }
    ByteCounter.prototype._transform = function(chunk, encoding, cb) {
      this.byteCount += chunk.length;
      cb(null, chunk);
    };
    util2.inherits(Crc32Watcher, Transform);
    function Crc32Watcher(options2) {
      Transform.call(this, options2);
      this.crc32 = 0;
    }
    Crc32Watcher.prototype._transform = function(chunk, encoding, cb) {
      this.crc32 = crc32.unsigned(chunk, this.crc32);
      cb(null, chunk);
    };
    var cp437 = "\0\u263A\u263B\u2665\u2666\u2663\u2660\u2022\u25D8\u25CB\u25D9\u2642\u2640\u266A\u266B\u263C\u25BA\u25C4\u2195\u203C\xB6\xA7\u25AC\u21A8\u2191\u2193\u2192\u2190\u221F\u2194\u25B2\u25BC !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u2302\xC7\xFC\xE9\xE2\xE4\xE0\xE5\xE7\xEA\xEB\xE8\xEF\xEE\xEC\xC4\xC5\xC9\xE6\xC6\xF4\xF6\xF2\xFB\xF9\xFF\xD6\xDC\xA2\xA3\xA5\u20A7\u0192\xE1\xED\xF3\xFA\xF1\xD1\xAA\xBA\xBF\u2310\xAC\xBD\xBC\xA1\xAB\xBB\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u03B1\xDF\u0393\u03C0\u03A3\u03C3\xB5\u03C4\u03A6\u0398\u03A9\u03B4\u221E\u03C6\u03B5\u2229\u2261\xB1\u2265\u2264\u2320\u2321\xF7\u2248\xB0\u2219\xB7\u221A\u207F\xB2\u25A0\xA0";
    if (cp437.length !== 256) throw new Error("assertion failure");
    var reverseCp437 = null;
    function encodeCp437(string4) {
      if (/^[\x20-\x7e]*$/.test(string4)) {
        return bufferFrom(string4, "utf-8");
      }
      if (reverseCp437 == null) {
        reverseCp437 = {};
        for (var i = 0; i < cp437.length; i++) {
          reverseCp437[cp437[i]] = i;
        }
      }
      var result = bufferAlloc(string4.length);
      for (var i = 0; i < string4.length; i++) {
        var b = reverseCp437[string4[i]];
        if (b == null) throw new Error("character not encodable in CP437: " + JSON.stringify(string4[i]));
        result[i] = b;
      }
      return result;
    }
    function bufferAlloc(size) {
      bufferAlloc = modern;
      try {
        return bufferAlloc(size);
      } catch (e) {
        bufferAlloc = legacy;
        return bufferAlloc(size);
      }
      function modern(size2) {
        return Buffer.allocUnsafe(size2);
      }
      function legacy(size2) {
        return new Buffer(size2);
      }
    }
    function bufferFrom(something, encoding) {
      bufferFrom = modern;
      try {
        return bufferFrom(something, encoding);
      } catch (e) {
        bufferFrom = legacy;
        return bufferFrom(something, encoding);
      }
      function modern(something2, encoding2) {
        return Buffer.from(something2, encoding2);
      }
      function legacy(something2, encoding2) {
        return new Buffer(something2, encoding2);
      }
    }
    function bufferIncludes(buffer, content) {
      bufferIncludes = modern;
      try {
        return bufferIncludes(buffer, content);
      } catch (e) {
        bufferIncludes = legacy;
        return bufferIncludes(buffer, content);
      }
      function modern(buffer2, content2) {
        return buffer2.includes(content2);
      }
      function legacy(buffer2, content2) {
        for (var i = 0; i <= buffer2.length - content2.length; i++) {
          for (var j = 0; ; j++) {
            if (j === content2.length) return true;
            if (buffer2[i + j] !== content2[j]) break;
          }
        }
        return false;
      }
    }
  }
});

// node_modules/pend/index.js
var require_pend = __commonJS({
  "node_modules/pend/index.js"(exports2, module2) {
    module2.exports = Pend;
    function Pend() {
      this.pending = 0;
      this.max = Infinity;
      this.listeners = [];
      this.waiting = [];
      this.error = null;
    }
    Pend.prototype.go = function(fn) {
      if (this.pending < this.max) {
        pendGo(this, fn);
      } else {
        this.waiting.push(fn);
      }
    };
    Pend.prototype.wait = function(cb) {
      if (this.pending === 0) {
        cb(this.error);
      } else {
        this.listeners.push(cb);
      }
    };
    Pend.prototype.hold = function() {
      return pendHold(this);
    };
    function pendHold(self) {
      self.pending += 1;
      var called = false;
      return onCb;
      function onCb(err) {
        if (called) throw new Error("callback called twice");
        called = true;
        self.error = self.error || err;
        self.pending -= 1;
        if (self.waiting.length > 0 && self.pending < self.max) {
          pendGo(self, self.waiting.shift());
        } else if (self.pending === 0) {
          var listeners = self.listeners;
          self.listeners = [];
          listeners.forEach(cbListener);
        }
      }
      function cbListener(listener) {
        listener(self.error);
      }
    }
    function pendGo(self, fn) {
      fn(pendHold(self));
    }
  }
});

// node_modules/yauzl/fd-slicer.js
var require_fd_slicer = __commonJS({
  "node_modules/yauzl/fd-slicer.js"(exports2) {
    var fs = require("fs");
    var util2 = require("util");
    var stream = require("stream");
    var Readable2 = stream.Readable;
    var PassThrough2 = stream.PassThrough;
    var Pend = require_pend();
    var EventEmitter = require("events").EventEmitter;
    exports2.BufferSlicer = BufferSlicer;
    exports2.FdSlicer = FdSlicer;
    util2.inherits(FdSlicer, EventEmitter);
    function FdSlicer(fd) {
      EventEmitter.call(this);
      this.fd = fd;
      this.pend = new Pend();
      this.pend.max = 1;
      this.refCount = 0;
    }
    FdSlicer.prototype.read = function(buffer, offset, length, position, callback) {
      var self = this;
      self.pend.go(function(cb) {
        fs.read(self.fd, buffer, offset, length, position, function(err, bytesRead, buffer2) {
          cb();
          callback(err, bytesRead, buffer2);
        });
      });
    };
    FdSlicer.prototype.createReadStream = function(options2) {
      return new ReadStream(this, options2);
    };
    FdSlicer.prototype.ref = function() {
      this.refCount += 1;
    };
    FdSlicer.prototype.unref = function() {
      var self = this;
      self.refCount -= 1;
      if (self.refCount < 0) throw new Error("invalid unref");
      if (self.refCount > 0) return;
      fs.close(self.fd, onCloseDone);
      function onCloseDone(err) {
        if (err) {
          self.emit("error", err);
        } else {
          self.emit("close");
        }
      }
    };
    util2.inherits(ReadStream, Readable2);
    function ReadStream(context, options2) {
      options2 = options2 || {};
      Readable2.call(this, options2);
      this.context = context;
      this.context.ref();
      this.start = options2.start || 0;
      this.endOffset = options2.end;
      this.pos = this.start;
    }
    ReadStream.prototype._read = function(n) {
      var self = this;
      var toRead = Math.min(self._readableState.highWaterMark, n);
      if (self.endOffset != null) {
        toRead = Math.min(toRead, self.endOffset - self.pos);
      }
      if (toRead <= 0) {
        self.push(null);
        this._cleanup();
        return;
      }
      self.context.pend.go(function(cb) {
        var buffer = Buffer.allocUnsafe(toRead);
        fs.read(self.context.fd, buffer, 0, toRead, self.pos, function(err, bytesRead) {
          if (err) {
            self.destroy(err);
          } else if (bytesRead === 0) {
            self.push(null);
            self._cleanup();
          } else {
            self.pos += bytesRead;
            self.push(buffer.slice(0, bytesRead));
          }
          cb();
        });
      });
    };
    ReadStream.prototype._destroy = function(err, cb) {
      this._cleanup();
      cb(err);
    };
    ReadStream.prototype._cleanup = function() {
      if (this.context != null) {
        this.context.unref();
        this.context = null;
      }
    };
    util2.inherits(BufferSlicer, EventEmitter);
    function BufferSlicer(buffer) {
      EventEmitter.call(this);
      this.refCount = 0;
      this.buffer = buffer;
    }
    BufferSlicer.prototype.read = function(buffer, offset, length, position, callback) {
      if (!(0 <= offset && offset <= buffer.length)) throw new RangeError("offset outside buffer: 0 <= " + offset + " <= " + buffer.length);
      if (position < 0) throw new RangeError("position is negative: " + position);
      if (offset + length > buffer.length) {
        length = buffer.length - offset;
      }
      if (position + length > this.buffer.length) {
        length = this.buffer.length - position;
      }
      if (length <= 0) {
        setImmediate(function() {
          callback(null, 0);
        });
        return;
      }
      this.buffer.copy(buffer, offset, position, position + length);
      setImmediate(function() {
        callback(null, length);
      });
    };
    BufferSlicer.prototype.createReadStream = function(options2) {
      options2 = options2 || {};
      var readStream = new PassThrough2(options2);
      readStream.start = options2.start || 0;
      readStream.endOffset = options2.end;
      readStream.pos = readStream.endOffset || this.buffer.length;
      var entireSlice = this.buffer.slice(readStream.start, readStream.pos);
      var maxChunkSize = 65536;
      var offset = 0;
      while (true) {
        var nextOffset = offset + maxChunkSize;
        if (nextOffset >= entireSlice.length) {
          if (offset < entireSlice.length) {
            readStream.write(entireSlice.slice(offset, entireSlice.length));
          }
          break;
        }
        readStream.write(entireSlice.slice(offset, nextOffset));
        offset = nextOffset;
      }
      readStream.end();
      return readStream;
    };
    BufferSlicer.prototype.ref = function() {
      this.refCount += 1;
    };
    BufferSlicer.prototype.unref = function() {
      this.refCount -= 1;
      if (this.refCount < 0) {
        throw new Error("invalid unref");
      }
    };
  }
});

// node_modules/yauzl/crc32.js
var require_crc32 = __commonJS({
  "node_modules/yauzl/crc32.js"(exports2, module2) {
    var CRC_TABLE = new Int32Array([
      0,
      1996959894,
      3993919788,
      2567524794,
      124634137,
      1886057615,
      3915621685,
      2657392035,
      249268274,
      2044508324,
      3772115230,
      2547177864,
      162941995,
      2125561021,
      3887607047,
      2428444049,
      498536548,
      1789927666,
      4089016648,
      2227061214,
      450548861,
      1843258603,
      4107580753,
      2211677639,
      325883990,
      1684777152,
      4251122042,
      2321926636,
      335633487,
      1661365465,
      4195302755,
      2366115317,
      997073096,
      1281953886,
      3579855332,
      2724688242,
      1006888145,
      1258607687,
      3524101629,
      2768942443,
      901097722,
      1119000684,
      3686517206,
      2898065728,
      853044451,
      1172266101,
      3705015759,
      2882616665,
      651767980,
      1373503546,
      3369554304,
      3218104598,
      565507253,
      1454621731,
      3485111705,
      3099436303,
      671266974,
      1594198024,
      3322730930,
      2970347812,
      795835527,
      1483230225,
      3244367275,
      3060149565,
      1994146192,
      31158534,
      2563907772,
      4023717930,
      1907459465,
      112637215,
      2680153253,
      3904427059,
      2013776290,
      251722036,
      2517215374,
      3775830040,
      2137656763,
      141376813,
      2439277719,
      3865271297,
      1802195444,
      476864866,
      2238001368,
      4066508878,
      1812370925,
      453092731,
      2181625025,
      4111451223,
      1706088902,
      314042704,
      2344532202,
      4240017532,
      1658658271,
      366619977,
      2362670323,
      4224994405,
      1303535960,
      984961486,
      2747007092,
      3569037538,
      1256170817,
      1037604311,
      2765210733,
      3554079995,
      1131014506,
      879679996,
      2909243462,
      3663771856,
      1141124467,
      855842277,
      2852801631,
      3708648649,
      1342533948,
      654459306,
      3188396048,
      3373015174,
      1466479909,
      544179635,
      3110523913,
      3462522015,
      1591671054,
      702138776,
      2966460450,
      3352799412,
      1504918807,
      783551873,
      3082640443,
      3233442989,
      3988292384,
      2596254646,
      62317068,
      1957810842,
      3939845945,
      2647816111,
      81470997,
      1943803523,
      3814918930,
      2489596804,
      225274430,
      2053790376,
      3826175755,
      2466906013,
      167816743,
      2097651377,
      4027552580,
      2265490386,
      503444072,
      1762050814,
      4150417245,
      2154129355,
      426522225,
      1852507879,
      4275313526,
      2312317920,
      282753626,
      1742555852,
      4189708143,
      2394877945,
      397917763,
      1622183637,
      3604390888,
      2714866558,
      953729732,
      1340076626,
      3518719985,
      2797360999,
      1068828381,
      1219638859,
      3624741850,
      2936675148,
      906185462,
      1090812512,
      3747672003,
      2825379669,
      829329135,
      1181335161,
      3412177804,
      3160834842,
      628085408,
      1382605366,
      3423369109,
      3138078467,
      570562233,
      1426400815,
      3317316542,
      2998733608,
      733239954,
      1555261956,
      3268935591,
      3050360625,
      752459403,
      1541320221,
      2607071920,
      3965973030,
      1969922972,
      40735498,
      2617837225,
      3943577151,
      1913087877,
      83908371,
      2512341634,
      3803740692,
      2075208622,
      213261112,
      2463272603,
      3855990285,
      2094854071,
      198958881,
      2262029012,
      4057260610,
      1759359992,
      534414190,
      2176718541,
      4139329115,
      1873836001,
      414664567,
      2282248934,
      4279200368,
      1711684554,
      285281116,
      2405801727,
      4167216745,
      1634467795,
      376229701,
      2685067896,
      3608007406,
      1308918612,
      956543938,
      2808555105,
      3495958263,
      1231636301,
      1047427035,
      2932959818,
      3654703836,
      1088359270,
      936918e3,
      2847714899,
      3736837829,
      1202900863,
      817233897,
      3183342108,
      3401237130,
      1404277552,
      615818150,
      3134207493,
      3453421203,
      1423857449,
      601450431,
      3009837614,
      3294710456,
      1567103746,
      711928724,
      3020668471,
      3272380065,
      1510334235,
      755167117
    ]);
    function crc32(buf) {
      let crc = -1;
      for (let x of buf) {
        crc = CRC_TABLE[(crc ^ x) & 255] ^ crc >>> 8;
      }
      return (crc ^ -1) >>> 0;
    }
    module2.exports = crc32;
  }
});

// node_modules/yauzl/index.js
var require_yauzl = __commonJS({
  "node_modules/yauzl/index.js"(exports2) {
    var fs = require("fs");
    var zlib = require("zlib");
    var fd_slicer = require_fd_slicer();
    var util2 = require("util");
    var EventEmitter = require("events").EventEmitter;
    var Transform = require("stream").Transform;
    var PassThrough2 = require("stream").PassThrough;
    var Writable = require("stream").Writable;
    var crc32 = typeof zlib.crc32 === "function" ? zlib.crc32 : require_crc32();
    exports2.open = open2;
    exports2.fromFd = fromFd;
    exports2.fromBuffer = fromBuffer;
    exports2.fromRandomAccessReader = fromRandomAccessReader;
    exports2.dosDateTimeToDate = dosDateTimeToDate;
    exports2.getFileNameLowLevel = getFileNameLowLevel;
    exports2.validateFileName = validateFileName;
    exports2.parseExtraFields = parseExtraFields;
    exports2.ZipFile = ZipFile;
    exports2.Entry = Entry;
    exports2.LocalFileHeader = LocalFileHeader;
    exports2.RandomAccessReader = RandomAccessReader;
    function open2(path, options2, callback) {
      if (typeof options2 === "function") {
        callback = options2;
        options2 = null;
      }
      if (options2 == null) options2 = {};
      if (options2.autoClose == null) options2.autoClose = true;
      if (options2.lazyEntries == null) options2.lazyEntries = false;
      if (options2.decodeStrings == null) options2.decodeStrings = true;
      if (options2.validateEntrySizes == null) options2.validateEntrySizes = true;
      if (options2.strictFileNames == null) options2.strictFileNames = false;
      if (callback == null) callback = defaultCallback;
      fs.open(path, "r", function(err, fd) {
        if (err) return callback(err);
        fromFd(fd, options2, function(err2, zipfile) {
          if (err2) fs.close(fd, defaultCallback);
          callback(err2, zipfile);
        });
      });
    }
    function fromFd(fd, options2, callback) {
      if (typeof options2 === "function") {
        callback = options2;
        options2 = null;
      }
      if (options2 == null) options2 = {};
      if (options2.autoClose == null) options2.autoClose = false;
      if (options2.lazyEntries == null) options2.lazyEntries = false;
      if (options2.decodeStrings == null) options2.decodeStrings = true;
      if (options2.validateEntrySizes == null) options2.validateEntrySizes = true;
      if (options2.strictFileNames == null) options2.strictFileNames = false;
      if (callback == null) callback = defaultCallback;
      fs.fstat(fd, function(err, stats) {
        if (err) return callback(err);
        var reader = new fd_slicer.FdSlicer(fd);
        fromRandomAccessReader(reader, stats.size, options2, callback);
      });
    }
    function fromBuffer(buffer, options2, callback) {
      if (typeof options2 === "function") {
        callback = options2;
        options2 = null;
      }
      if (options2 == null) options2 = {};
      options2.autoClose = false;
      if (options2.lazyEntries == null) options2.lazyEntries = false;
      if (options2.decodeStrings == null) options2.decodeStrings = true;
      if (options2.validateEntrySizes == null) options2.validateEntrySizes = true;
      if (options2.strictFileNames == null) options2.strictFileNames = false;
      var reader = new fd_slicer.BufferSlicer(buffer);
      fromRandomAccessReader(reader, buffer.length, options2, callback);
    }
    function fromRandomAccessReader(reader, totalSize, options2, callback) {
      if (typeof options2 === "function") {
        callback = options2;
        options2 = null;
      }
      if (options2 == null) options2 = {};
      if (options2.autoClose == null) options2.autoClose = true;
      if (options2.lazyEntries == null) options2.lazyEntries = false;
      if (options2.decodeStrings == null) options2.decodeStrings = true;
      var decodeStrings = !!options2.decodeStrings;
      if (options2.validateEntrySizes == null) options2.validateEntrySizes = true;
      if (options2.strictFileNames == null) options2.strictFileNames = false;
      if (callback == null) callback = defaultCallback;
      if (typeof totalSize !== "number") throw new Error("expected totalSize parameter to be a number");
      if (totalSize > Number.MAX_SAFE_INTEGER) {
        throw new Error("zip file too large. only file sizes up to 2^52 are supported due to JavaScript's Number type being an IEEE 754 double.");
      }
      reader.ref();
      var eocdrWithoutCommentSize = 22;
      var zip64EocdlSize = 20;
      var maxCommentSize = 65535;
      var bufferSize = Math.min(zip64EocdlSize + eocdrWithoutCommentSize + maxCommentSize, totalSize);
      var buffer = newBuffer(bufferSize);
      var bufferReadStart = totalSize - buffer.length;
      readAndAssertNoEof(reader, buffer, 0, bufferSize, bufferReadStart, function(err) {
        if (err) return callback(err);
        for (var i = bufferSize - eocdrWithoutCommentSize; i >= 0; i -= 1) {
          if (buffer.readUInt32LE(i) !== 101010256) continue;
          var eocdrBuffer = buffer.subarray(i);
          var diskNumber = eocdrBuffer.readUInt16LE(4);
          var entryCount = eocdrBuffer.readUInt16LE(10);
          var centralDirectoryOffset = eocdrBuffer.readUInt32LE(16);
          var commentLength = eocdrBuffer.readUInt16LE(20);
          var expectedCommentLength = eocdrBuffer.length - eocdrWithoutCommentSize;
          if (commentLength !== expectedCommentLength) {
            return callback(new Error("Invalid comment length. Expected: " + expectedCommentLength + ". Found: " + commentLength + ". Are there extra bytes at the end of the file? Or is the end of central dir signature `PK\u263A\u263B` in the comment?"));
          }
          var comment = decodeStrings ? decodeBuffer(eocdrBuffer.subarray(22), false) : eocdrBuffer.subarray(22);
          if (i - zip64EocdlSize >= 0 && buffer.readUInt32LE(i - zip64EocdlSize) === 117853008) {
            var zip64EocdlBuffer = buffer.subarray(i - zip64EocdlSize, i - zip64EocdlSize + zip64EocdlSize);
            var zip64EocdrOffset = readUInt64LE(zip64EocdlBuffer, 8);
            var zip64EocdrBuffer = newBuffer(56);
            return readAndAssertNoEof(reader, zip64EocdrBuffer, 0, zip64EocdrBuffer.length, zip64EocdrOffset, function(err2) {
              if (err2) return callback(err2);
              if (zip64EocdrBuffer.readUInt32LE(0) !== 101075792) {
                return callback(new Error("invalid zip64 end of central directory record signature"));
              }
              diskNumber = zip64EocdrBuffer.readUInt32LE(16);
              if (diskNumber !== 0) {
                return callback(new Error("multi-disk zip files are not supported: found disk number: " + diskNumber));
              }
              entryCount = readUInt64LE(zip64EocdrBuffer, 32);
              centralDirectoryOffset = readUInt64LE(zip64EocdrBuffer, 48);
              return callback(null, new ZipFile(reader, centralDirectoryOffset, totalSize, entryCount, comment, options2.autoClose, options2.lazyEntries, decodeStrings, options2.validateEntrySizes, options2.strictFileNames));
            });
          }
          if (diskNumber !== 0) {
            return callback(new Error("multi-disk zip files are not supported: found disk number: " + diskNumber));
          }
          return callback(null, new ZipFile(reader, centralDirectoryOffset, totalSize, entryCount, comment, options2.autoClose, options2.lazyEntries, decodeStrings, options2.validateEntrySizes, options2.strictFileNames));
        }
        callback(new Error("End of central directory record signature not found. Either not a zip file, or file is truncated."));
      });
    }
    util2.inherits(ZipFile, EventEmitter);
    function ZipFile(reader, centralDirectoryOffset, fileSize, entryCount, comment, autoClose, lazyEntries, decodeStrings, validateEntrySizes, strictFileNames) {
      var self = this;
      EventEmitter.call(self);
      self.reader = reader;
      self.reader.on("error", function(err) {
        emitError(self, err);
      });
      self.reader.once("close", function() {
        self.emit("close");
      });
      self.readEntryCursor = centralDirectoryOffset;
      self.fileSize = fileSize;
      self.entryCount = entryCount;
      self.comment = comment;
      self.entriesRead = 0;
      self.autoClose = !!autoClose;
      self.lazyEntries = !!lazyEntries;
      self.decodeStrings = !!decodeStrings;
      self.validateEntrySizes = !!validateEntrySizes;
      self.strictFileNames = !!strictFileNames;
      self.isOpen = true;
      self.emittedError = false;
      if (!self.lazyEntries) self._readEntry();
    }
    ZipFile.prototype.close = function() {
      if (!this.isOpen) return;
      this.isOpen = false;
      this.reader.unref();
    };
    function emitErrorAndAutoClose(self, err) {
      if (self.autoClose) self.close();
      emitError(self, err);
    }
    function emitError(self, err) {
      if (self.emittedError) return;
      self.emittedError = true;
      self.emit("error", err);
    }
    ZipFile.prototype.readEntry = function() {
      if (!this.lazyEntries) throw new Error("readEntry() called without lazyEntries:true");
      this._readEntry();
    };
    ZipFile.prototype._readEntry = function() {
      var self = this;
      if (self.entryCount === self.entriesRead) {
        setImmediate(function() {
          if (self.autoClose) self.close();
          if (self.emittedError) return;
          self.emit("end");
        });
        return;
      }
      if (self.emittedError) return;
      var buffer = newBuffer(46);
      readAndAssertNoEof(self.reader, buffer, 0, buffer.length, self.readEntryCursor, function(err) {
        if (err) return emitErrorAndAutoClose(self, err);
        if (self.emittedError) return;
        var entry = new Entry();
        var signature = buffer.readUInt32LE(0);
        if (signature !== 33639248) return emitErrorAndAutoClose(self, new Error("invalid central directory file header signature: 0x" + signature.toString(16)));
        entry.versionMadeBy = buffer.readUInt16LE(4);
        entry.versionNeededToExtract = buffer.readUInt16LE(6);
        entry.generalPurposeBitFlag = buffer.readUInt16LE(8);
        entry.compressionMethod = buffer.readUInt16LE(10);
        entry.lastModFileTime = buffer.readUInt16LE(12);
        entry.lastModFileDate = buffer.readUInt16LE(14);
        entry.crc32 = buffer.readUInt32LE(16);
        entry.compressedSize = buffer.readUInt32LE(20);
        entry.uncompressedSize = buffer.readUInt32LE(24);
        entry.fileNameLength = buffer.readUInt16LE(28);
        entry.extraFieldLength = buffer.readUInt16LE(30);
        entry.fileCommentLength = buffer.readUInt16LE(32);
        entry.internalFileAttributes = buffer.readUInt16LE(36);
        entry.externalFileAttributes = buffer.readUInt32LE(38);
        entry.relativeOffsetOfLocalHeader = buffer.readUInt32LE(42);
        if (entry.generalPurposeBitFlag & 64) return emitErrorAndAutoClose(self, new Error("strong encryption is not supported"));
        self.readEntryCursor += 46;
        buffer = newBuffer(entry.fileNameLength + entry.extraFieldLength + entry.fileCommentLength);
        readAndAssertNoEof(self.reader, buffer, 0, buffer.length, self.readEntryCursor, function(err2) {
          if (err2) return emitErrorAndAutoClose(self, err2);
          if (self.emittedError) return;
          entry.fileNameRaw = buffer.subarray(0, entry.fileNameLength);
          var fileCommentStart = entry.fileNameLength + entry.extraFieldLength;
          entry.extraFieldRaw = buffer.subarray(entry.fileNameLength, fileCommentStart);
          entry.fileCommentRaw = buffer.subarray(fileCommentStart, fileCommentStart + entry.fileCommentLength);
          try {
            entry.extraFields = parseExtraFields(entry.extraFieldRaw);
          } catch (err3) {
            return emitErrorAndAutoClose(self, err3);
          }
          if (self.decodeStrings) {
            var isUtf8 = (entry.generalPurposeBitFlag & 2048) !== 0;
            entry.fileComment = decodeBuffer(entry.fileCommentRaw, isUtf8);
            entry.fileName = getFileNameLowLevel(entry.generalPurposeBitFlag, entry.fileNameRaw, entry.extraFields, self.strictFileNames);
            var errorMessage = validateFileName(entry.fileName);
            if (errorMessage != null) return emitErrorAndAutoClose(self, new Error(errorMessage));
          } else {
            entry.fileComment = entry.fileCommentRaw;
            entry.fileName = entry.fileNameRaw;
          }
          entry.comment = entry.fileComment;
          self.readEntryCursor += buffer.length;
          self.entriesRead += 1;
          for (var i = 0; i < entry.extraFields.length; i++) {
            var extraField = entry.extraFields[i];
            if (extraField.id !== 1) continue;
            var zip64EiefBuffer = extraField.data;
            var index = 0;
            if (entry.uncompressedSize === 4294967295) {
              if (index + 8 > zip64EiefBuffer.length) {
                return emitErrorAndAutoClose(self, new Error("zip64 extended information extra field does not include uncompressed size"));
              }
              entry.uncompressedSize = readUInt64LE(zip64EiefBuffer, index);
              index += 8;
            }
            if (entry.compressedSize === 4294967295) {
              if (index + 8 > zip64EiefBuffer.length) {
                return emitErrorAndAutoClose(self, new Error("zip64 extended information extra field does not include compressed size"));
              }
              entry.compressedSize = readUInt64LE(zip64EiefBuffer, index);
              index += 8;
            }
            if (entry.relativeOffsetOfLocalHeader === 4294967295) {
              if (index + 8 > zip64EiefBuffer.length) {
                return emitErrorAndAutoClose(self, new Error("zip64 extended information extra field does not include relative header offset"));
              }
              entry.relativeOffsetOfLocalHeader = readUInt64LE(zip64EiefBuffer, index);
              index += 8;
            }
            break;
          }
          if (self.validateEntrySizes && entry.compressionMethod === 0) {
            var expectedCompressedSize = entry.uncompressedSize;
            if (entry.isEncrypted()) {
              expectedCompressedSize += 12;
            }
            if (entry.compressedSize !== expectedCompressedSize) {
              var msg = "compressed/uncompressed size mismatch for stored file: " + entry.compressedSize + " != " + entry.uncompressedSize;
              return emitErrorAndAutoClose(self, new Error(msg));
            }
          }
          self.emit("entry", entry);
          if (!self.lazyEntries) self._readEntry();
        });
      });
    };
    ZipFile.prototype.openReadStream = function(entry, options2, callback) {
      var self = this;
      var relativeStart = 0;
      var relativeEnd = entry.compressedSize;
      if (callback == null) {
        callback = options2;
        options2 = null;
      }
      if (options2 == null) {
        options2 = {};
      } else {
        if (options2.decodeFileData === false) {
          if (options2.decrypt != null) {
            throw new Error("cannot use options.decrypt when options.decodeFileData === false");
          }
          if (options2.decompress != null) {
            throw new Error("cannot use options.decompress when options.decodeFileData === false");
          }
        } else {
          if (options2.decrypt != null) {
            if (!entry.isEncrypted()) {
              throw new Error("options.decrypt can only be specified for encrypted entries. See also option decodeFileData.");
            }
            if (options2.decrypt !== false) throw new Error("invalid options.decrypt value: " + options2.decrypt);
            if (entry.isCompressed()) {
              if (options2.decompress !== false) throw new Error("entry is encrypted and compressed, and options.decompress !== false. See also option decodeFileData.");
            }
          }
          if (options2.decompress != null) {
            if (!entry.isCompressed()) {
              throw new Error("options.decompress can only be specified for compressed entries. See also option decodeFileData.");
            }
            if (!(options2.decompress === false || options2.decompress === true)) {
              throw new Error("invalid options.decompress value: " + options2.decompress);
            }
            decompress = options2.decompress;
          }
        }
        if (options2.start != null) {
          relativeStart = options2.start;
          if (relativeStart < 0) throw new Error("options.start < 0");
          if (relativeStart > entry.compressedSize) throw new Error("options.start > entry.compressedSize");
        }
        if (options2.end != null) {
          relativeEnd = options2.end;
          if (relativeEnd < 0) throw new Error("options.end < 0");
          if (relativeEnd > entry.compressedSize) throw new Error("options.end > entry.compressedSize");
          if (relativeEnd < relativeStart) throw new Error("options.end < options.start");
        }
      }
      var rawMode = options2.decodeFileData === false || // Explicitly requested raw.
      (entry.compressionMethod === 0 || // Naturally without compression.
      entry.compressionMethod === 8 && options2.decompress === false) && (!entry.isEncrypted() || // Naturally without encryption.
      options2.decrypt === false);
      if (options2.start != null || options2.end != null) {
        if (!rawMode) throw new Error("start/end range require options.decodeFileData === false for non-trivial encoded entries.");
      }
      if (!self.isOpen) return callback(new Error("closed"));
      if (entry.isEncrypted() && !rawMode) {
        if (options2.decrypt !== false) return callback(new Error("entry is encrypted, and options.decodeFileData !== false"));
      }
      var decompress;
      if (rawMode) {
        decompress = false;
      } else if (entry.compressionMethod === 8) {
        decompress = options2.decodeFileData !== true;
      } else {
        return callback(new Error("unsupported compression method: " + entry.compressionMethod));
      }
      self.readLocalFileHeader(entry, { minimal: true }, function(err, localFileHeader) {
        if (err) return callback(err);
        self.openReadStreamLowLevel(
          localFileHeader.fileDataStart,
          entry.compressedSize,
          relativeStart,
          relativeEnd,
          decompress,
          entry.uncompressedSize,
          callback
        );
      });
    };
    ZipFile.prototype.openReadStreamLowLevel = function(fileDataStart, compressedSize, relativeStart, relativeEnd, decompress, uncompressedSize, callback) {
      var self = this;
      var fileDataEnd = fileDataStart + compressedSize;
      var readStream = self.reader.createReadStream({
        start: fileDataStart + relativeStart,
        end: fileDataStart + relativeEnd
      });
      var endpointStream = readStream;
      if (decompress) {
        var destroyed = false;
        var inflateFilter = zlib.createInflateRaw();
        readStream.on("error", function(err) {
          setImmediate(function() {
            if (!destroyed) inflateFilter.emit("error", err);
          });
        });
        readStream.pipe(inflateFilter);
        if (self.validateEntrySizes) {
          endpointStream = new AssertByteCountStream(uncompressedSize);
          inflateFilter.on("error", function(err) {
            setImmediate(function() {
              if (!destroyed) endpointStream.emit("error", err);
            });
          });
          inflateFilter.pipe(endpointStream);
        } else {
          endpointStream = inflateFilter;
        }
        installDestroyFn(endpointStream, function() {
          destroyed = true;
          if (inflateFilter !== endpointStream) inflateFilter.unpipe(endpointStream);
          readStream.unpipe(inflateFilter);
          readStream.destroy();
        });
      }
      callback(null, endpointStream);
    };
    ZipFile.prototype.readLocalFileHeader = function(entry, options2, callback) {
      var self = this;
      if (callback == null) {
        callback = options2;
        options2 = null;
      }
      if (options2 == null) options2 = {};
      self.reader.ref();
      var buffer = newBuffer(30);
      readAndAssertNoEof(self.reader, buffer, 0, buffer.length, entry.relativeOffsetOfLocalHeader, function(err) {
        try {
          if (err) return callback(err);
          var signature = buffer.readUInt32LE(0);
          if (signature !== 67324752) {
            return callback(new Error("invalid local file header signature: 0x" + signature.toString(16)));
          }
          var fileNameLength = buffer.readUInt16LE(26);
          var extraFieldLength = buffer.readUInt16LE(28);
          var fileDataStart = entry.relativeOffsetOfLocalHeader + 30 + fileNameLength + extraFieldLength;
          if (fileDataStart + entry.compressedSize > self.fileSize) {
            return callback(new Error("file data overflows file bounds: " + fileDataStart + " + " + entry.compressedSize + " > " + self.fileSize));
          }
          if (options2.minimal) {
            return callback(null, { fileDataStart });
          }
          var localFileHeader = new LocalFileHeader();
          localFileHeader.fileDataStart = fileDataStart;
          localFileHeader.versionNeededToExtract = buffer.readUInt16LE(4);
          localFileHeader.generalPurposeBitFlag = buffer.readUInt16LE(6);
          localFileHeader.compressionMethod = buffer.readUInt16LE(8);
          localFileHeader.lastModFileTime = buffer.readUInt16LE(10);
          localFileHeader.lastModFileDate = buffer.readUInt16LE(12);
          localFileHeader.crc32 = buffer.readUInt32LE(14);
          localFileHeader.compressedSize = buffer.readUInt32LE(18);
          localFileHeader.uncompressedSize = buffer.readUInt32LE(22);
          localFileHeader.fileNameLength = fileNameLength;
          localFileHeader.extraFieldLength = extraFieldLength;
          buffer = newBuffer(fileNameLength + extraFieldLength);
          self.reader.ref();
          readAndAssertNoEof(self.reader, buffer, 0, buffer.length, entry.relativeOffsetOfLocalHeader + 30, function(err2) {
            try {
              if (err2) return callback(err2);
              localFileHeader.fileName = buffer.subarray(0, fileNameLength);
              localFileHeader.extraField = buffer.subarray(fileNameLength);
              return callback(null, localFileHeader);
            } finally {
              self.reader.unref();
            }
          });
        } finally {
          self.reader.unref();
        }
      });
    };
    function Entry() {
    }
    Entry.prototype.getLastModDate = function(options2) {
      if (options2 == null) options2 = {};
      if (!options2.forceDosFormat) {
        for (var i = 0; i < this.extraFields.length; i++) {
          var extraField = this.extraFields[i];
          if (extraField.id === 21589) {
            var data = extraField.data;
            if (data.length < 5) continue;
            var flags = data[0];
            var HAS_MTIME = 1;
            if (!(flags & HAS_MTIME)) continue;
            var posixTimestamp = data.readInt32LE(1);
            return new Date(posixTimestamp * 1e3);
          } else if (extraField.id === 10) {
            var data = extraField.data;
            if (data.length !== 32) continue;
            if (data.readUInt16LE(4) !== 1) continue;
            if (data.readUInt16LE(6) !== 24) continue;
            var hundredNanoSecondsSince1601 = data.readUInt32LE(8) + 4294967296 * data.readInt32LE(12);
            var millisecondsSince1970 = hundredNanoSecondsSince1601 / 1e4 - 116444736e5;
            return new Date(millisecondsSince1970);
          }
        }
      }
      return dosDateTimeToDate(this.lastModFileDate, this.lastModFileTime, options2.timezone);
    };
    Entry.prototype.canDecodeFileData = function() {
      return !this.isEncrypted() && (this.compressionMethod === 0 || this.compressionMethod === 8);
    };
    Entry.prototype.isEncrypted = function() {
      return (this.generalPurposeBitFlag & 1) !== 0;
    };
    Entry.prototype.isCompressed = function() {
      return this.compressionMethod === 8;
    };
    function LocalFileHeader() {
    }
    function dosDateTimeToDate(date5, time3, timezone) {
      var day = date5 & 31;
      var month = (date5 >> 5 & 15) - 1;
      var year = (date5 >> 9 & 127) + 1980;
      var millisecond = 0;
      var second = (time3 & 31) * 2;
      var minute = time3 >> 5 & 63;
      var hour = time3 >> 11 & 31;
      if (timezone == null || timezone === "local") {
        return new Date(year, month, day, hour, minute, second, millisecond);
      } else if (timezone === "UTC") {
        return new Date(Date.UTC(year, month, day, hour, minute, second, millisecond));
      } else {
        throw new Error("unrecognized options.timezone: " + options.timezone);
      }
    }
    function getFileNameLowLevel(generalPurposeBitFlag, fileNameBuffer, extraFields, strictFileNames) {
      var fileName = null;
      for (var i = 0; i < extraFields.length; i++) {
        var extraField = extraFields[i];
        if (extraField.id === 28789) {
          if (extraField.data.length < 6) {
            continue;
          }
          if (extraField.data.readUInt8(0) !== 1) {
            continue;
          }
          var oldNameCrc32 = extraField.data.readUInt32LE(1);
          if (crc32(fileNameBuffer) !== oldNameCrc32) {
            continue;
          }
          fileName = decodeBuffer(extraField.data.subarray(5), true);
          break;
        }
      }
      if (fileName == null) {
        var isUtf8 = (generalPurposeBitFlag & 2048) !== 0;
        fileName = decodeBuffer(fileNameBuffer, isUtf8);
      }
      if (!strictFileNames) {
        fileName = fileName.replace(/\\/g, "/");
      }
      return fileName;
    }
    function validateFileName(fileName) {
      if (fileName.indexOf("\\") !== -1) {
        return "invalid characters in fileName: " + fileName;
      }
      if (/^[a-zA-Z]:/.test(fileName) || /^\//.test(fileName)) {
        return "absolute path: " + fileName;
      }
      if (fileName.split("/").indexOf("..") !== -1) {
        return "invalid relative path: " + fileName;
      }
      return null;
    }
    function parseExtraFields(extraFieldBuffer) {
      var extraFields = [];
      var i = 0;
      while (i < extraFieldBuffer.length - 3) {
        var headerId = extraFieldBuffer.readUInt16LE(i + 0);
        var dataSize = extraFieldBuffer.readUInt16LE(i + 2);
        var dataStart = i + 4;
        var dataEnd = dataStart + dataSize;
        if (dataEnd > extraFieldBuffer.length) throw new Error("extra field length exceeds extra field buffer size");
        var dataBuffer = extraFieldBuffer.subarray(dataStart, dataEnd);
        extraFields.push({
          id: headerId,
          data: dataBuffer
        });
        i = dataEnd;
      }
      return extraFields;
    }
    function readAndAssertNoEof(reader, buffer, offset, length, position, callback) {
      if (length === 0) {
        return setImmediate(function() {
          callback(null, newBuffer(0));
        });
      }
      reader.read(buffer, offset, length, position, function(err, bytesRead) {
        if (err) return callback(err);
        if (bytesRead < length) {
          return callback(new Error("unexpected EOF"));
        }
        callback();
      });
    }
    util2.inherits(AssertByteCountStream, Transform);
    function AssertByteCountStream(byteCount) {
      Transform.call(this);
      this.actualByteCount = 0;
      this.expectedByteCount = byteCount;
    }
    AssertByteCountStream.prototype._transform = function(chunk, encoding, cb) {
      this.actualByteCount += chunk.length;
      if (this.actualByteCount > this.expectedByteCount) {
        var msg = "too many bytes in the stream. expected " + this.expectedByteCount + ". got at least " + this.actualByteCount;
        return cb(new Error(msg));
      }
      cb(null, chunk);
    };
    AssertByteCountStream.prototype._flush = function(cb) {
      if (this.actualByteCount < this.expectedByteCount) {
        var msg = "not enough bytes in the stream. expected " + this.expectedByteCount + ". got only " + this.actualByteCount;
        return cb(new Error(msg));
      }
      cb();
    };
    util2.inherits(RandomAccessReader, EventEmitter);
    function RandomAccessReader() {
      EventEmitter.call(this);
      this.refCount = 0;
    }
    RandomAccessReader.prototype.ref = function() {
      this.refCount += 1;
    };
    RandomAccessReader.prototype.unref = function() {
      var self = this;
      self.refCount -= 1;
      if (self.refCount > 0) return;
      if (self.refCount < 0) throw new Error("invalid unref");
      self.close(onCloseDone);
      function onCloseDone(err) {
        if (err) return self.emit("error", err);
        self.emit("close");
      }
    };
    RandomAccessReader.prototype.createReadStream = function(options2) {
      if (options2 == null) options2 = {};
      var start = options2.start;
      var end = options2.end;
      if (start === end) {
        var emptyStream = new PassThrough2();
        setImmediate(function() {
          emptyStream.end();
        });
        return emptyStream;
      }
      var stream = this._readStreamForRange(start, end);
      var destroyed = false;
      var refUnrefFilter = new RefUnrefFilter(this);
      stream.on("error", function(err) {
        setImmediate(function() {
          if (!destroyed) refUnrefFilter.emit("error", err);
        });
      });
      installDestroyFn(refUnrefFilter, function() {
        stream.unpipe(refUnrefFilter);
        refUnrefFilter.unref();
        stream.destroy();
      });
      var byteCounter = new AssertByteCountStream(end - start);
      refUnrefFilter.on("error", function(err) {
        setImmediate(function() {
          if (!destroyed) byteCounter.emit("error", err);
        });
      });
      installDestroyFn(byteCounter, function() {
        destroyed = true;
        refUnrefFilter.unpipe(byteCounter);
        refUnrefFilter.destroy();
      });
      return stream.pipe(refUnrefFilter).pipe(byteCounter);
    };
    RandomAccessReader.prototype._readStreamForRange = function(start, end) {
      throw new Error("not implemented");
    };
    RandomAccessReader.prototype.read = function(buffer, offset, length, position, callback) {
      var readStream = this.createReadStream({ start: position, end: position + length });
      var writeStream = new Writable();
      var written = 0;
      writeStream._write = function(chunk, encoding, cb) {
        chunk.copy(buffer, offset + written, 0, chunk.length);
        written += chunk.length;
        cb();
      };
      writeStream.on("finish", callback);
      readStream.on("error", function(error48) {
        callback(error48);
      });
      readStream.pipe(writeStream);
    };
    RandomAccessReader.prototype.close = function(callback) {
      setImmediate(callback);
    };
    util2.inherits(RefUnrefFilter, PassThrough2);
    function RefUnrefFilter(context) {
      PassThrough2.call(this);
      this.context = context;
      this.context.ref();
      this.unreffedYet = false;
    }
    RefUnrefFilter.prototype._flush = function(cb) {
      this.unref();
      cb();
    };
    RefUnrefFilter.prototype.unref = function(cb) {
      if (this.unreffedYet) return;
      this.unreffedYet = true;
      this.context.unref();
    };
    var cp437 = "\0\u263A\u263B\u2665\u2666\u2663\u2660\u2022\u25D8\u25CB\u25D9\u2642\u2640\u266A\u266B\u263C\u25BA\u25C4\u2195\u203C\xB6\xA7\u25AC\u21A8\u2191\u2193\u2192\u2190\u221F\u2194\u25B2\u25BC !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u2302\xC7\xFC\xE9\xE2\xE4\xE0\xE5\xE7\xEA\xEB\xE8\xEF\xEE\xEC\xC4\xC5\xC9\xE6\xC6\xF4\xF6\xF2\xFB\xF9\xFF\xD6\xDC\xA2\xA3\xA5\u20A7\u0192\xE1\xED\xF3\xFA\xF1\xD1\xAA\xBA\xBF\u2310\xAC\xBD\xBC\xA1\xAB\xBB\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u03B1\xDF\u0393\u03C0\u03A3\u03C3\xB5\u03C4\u03A6\u0398\u03A9\u03B4\u221E\u03C6\u03B5\u2229\u2261\xB1\u2265\u2264\u2320\u2321\xF7\u2248\xB0\u2219\xB7\u221A\u207F\xB2\u25A0\xA0";
    function decodeBuffer(buffer, isUtf8) {
      if (isUtf8) {
        return buffer.toString("utf8");
      } else {
        var result = "";
        for (var i = 0; i < buffer.length; i++) {
          result += cp437[buffer[i]];
        }
        return result;
      }
    }
    function readUInt64LE(buffer, offset) {
      var lower32 = buffer.readUInt32LE(offset);
      var upper32 = buffer.readUInt32LE(offset + 4);
      return upper32 * 4294967296 + lower32;
    }
    var newBuffer;
    if (typeof Buffer.allocUnsafe === "function") {
      newBuffer = function(len) {
        return Buffer.allocUnsafe(len);
      };
    } else {
      newBuffer = function(len) {
        return new Buffer(len);
      };
    }
    function installDestroyFn(stream, fn) {
      if (typeof stream.destroy === "function") {
        stream._destroy = function(err, cb) {
          fn();
          if (cb != null) cb(err);
        };
      } else {
        stream.destroy = fn;
      }
    }
    function defaultCallback(err) {
      if (err) throw err;
    }
  }
});

// node_modules/graceful-fs/polyfills.js
var require_polyfills = __commonJS({
  "node_modules/graceful-fs/polyfills.js"(exports2, module2) {
    var constants = require("constants");
    var origCwd = process.cwd;
    var cwd = null;
    var platform = process.env.GRACEFUL_FS_PLATFORM || process.platform;
    process.cwd = function() {
      if (!cwd)
        cwd = origCwd.call(process);
      return cwd;
    };
    try {
      process.cwd();
    } catch (er) {
    }
    if (typeof process.chdir === "function") {
      chdir = process.chdir;
      process.chdir = function(d) {
        cwd = null;
        chdir.call(process, d);
      };
      if (Object.setPrototypeOf) Object.setPrototypeOf(process.chdir, chdir);
    }
    var chdir;
    module2.exports = patch;
    function patch(fs) {
      if (constants.hasOwnProperty("O_SYMLINK") && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) {
        patchLchmod(fs);
      }
      if (!fs.lutimes) {
        patchLutimes(fs);
      }
      fs.chown = chownFix(fs.chown);
      fs.fchown = chownFix(fs.fchown);
      fs.lchown = chownFix(fs.lchown);
      fs.chmod = chmodFix(fs.chmod);
      fs.fchmod = chmodFix(fs.fchmod);
      fs.lchmod = chmodFix(fs.lchmod);
      fs.chownSync = chownFixSync(fs.chownSync);
      fs.fchownSync = chownFixSync(fs.fchownSync);
      fs.lchownSync = chownFixSync(fs.lchownSync);
      fs.chmodSync = chmodFixSync(fs.chmodSync);
      fs.fchmodSync = chmodFixSync(fs.fchmodSync);
      fs.lchmodSync = chmodFixSync(fs.lchmodSync);
      fs.stat = statFix(fs.stat);
      fs.fstat = statFix(fs.fstat);
      fs.lstat = statFix(fs.lstat);
      fs.statSync = statFixSync(fs.statSync);
      fs.fstatSync = statFixSync(fs.fstatSync);
      fs.lstatSync = statFixSync(fs.lstatSync);
      if (fs.chmod && !fs.lchmod) {
        fs.lchmod = function(path, mode, cb) {
          if (cb) process.nextTick(cb);
        };
        fs.lchmodSync = function() {
        };
      }
      if (fs.chown && !fs.lchown) {
        fs.lchown = function(path, uid, gid, cb) {
          if (cb) process.nextTick(cb);
        };
        fs.lchownSync = function() {
        };
      }
      if (platform === "win32") {
        fs.rename = typeof fs.rename !== "function" ? fs.rename : (function(fs$rename) {
          function rename(from, to, cb) {
            var start = Date.now();
            var backoff = 0;
            fs$rename(from, to, function CB(er) {
              if (er && (er.code === "EACCES" || er.code === "EPERM") && Date.now() - start < 6e4) {
                setTimeout(function() {
                  fs.stat(to, function(stater, st) {
                    if (stater && stater.code === "ENOENT")
                      fs$rename(from, to, CB);
                    else
                      cb(er);
                  });
                }, backoff);
                if (backoff < 100)
                  backoff += 10;
                return;
              }
              if (cb) cb(er);
            });
          }
          if (Object.setPrototypeOf) Object.setPrototypeOf(rename, fs$rename);
          return rename;
        })(fs.rename);
      }
      fs.read = typeof fs.read !== "function" ? fs.read : (function(fs$read) {
        function read(fd, buffer, offset, length, position, callback_) {
          var callback;
          if (callback_ && typeof callback_ === "function") {
            var eagCounter = 0;
            callback = function(er, _, __) {
              if (er && er.code === "EAGAIN" && eagCounter < 10) {
                eagCounter++;
                return fs$read.call(fs, fd, buffer, offset, length, position, callback);
              }
              callback_.apply(this, arguments);
            };
          }
          return fs$read.call(fs, fd, buffer, offset, length, position, callback);
        }
        if (Object.setPrototypeOf) Object.setPrototypeOf(read, fs$read);
        return read;
      })(fs.read);
      fs.readSync = typeof fs.readSync !== "function" ? fs.readSync : /* @__PURE__ */ (function(fs$readSync) {
        return function(fd, buffer, offset, length, position) {
          var eagCounter = 0;
          while (true) {
            try {
              return fs$readSync.call(fs, fd, buffer, offset, length, position);
            } catch (er) {
              if (er.code === "EAGAIN" && eagCounter < 10) {
                eagCounter++;
                continue;
              }
              throw er;
            }
          }
        };
      })(fs.readSync);
      function patchLchmod(fs2) {
        fs2.lchmod = function(path, mode, callback) {
          fs2.open(
            path,
            constants.O_WRONLY | constants.O_SYMLINK,
            mode,
            function(err, fd) {
              if (err) {
                if (callback) callback(err);
                return;
              }
              fs2.fchmod(fd, mode, function(err2) {
                fs2.close(fd, function(err22) {
                  if (callback) callback(err2 || err22);
                });
              });
            }
          );
        };
        fs2.lchmodSync = function(path, mode) {
          var fd = fs2.openSync(path, constants.O_WRONLY | constants.O_SYMLINK, mode);
          var threw = true;
          var ret;
          try {
            ret = fs2.fchmodSync(fd, mode);
            threw = false;
          } finally {
            if (threw) {
              try {
                fs2.closeSync(fd);
              } catch (er) {
              }
            } else {
              fs2.closeSync(fd);
            }
          }
          return ret;
        };
      }
      function patchLutimes(fs2) {
        if (constants.hasOwnProperty("O_SYMLINK") && fs2.futimes) {
          fs2.lutimes = function(path, at, mt, cb) {
            fs2.open(path, constants.O_SYMLINK, function(er, fd) {
              if (er) {
                if (cb) cb(er);
                return;
              }
              fs2.futimes(fd, at, mt, function(er2) {
                fs2.close(fd, function(er22) {
                  if (cb) cb(er2 || er22);
                });
              });
            });
          };
          fs2.lutimesSync = function(path, at, mt) {
            var fd = fs2.openSync(path, constants.O_SYMLINK);
            var ret;
            var threw = true;
            try {
              ret = fs2.futimesSync(fd, at, mt);
              threw = false;
            } finally {
              if (threw) {
                try {
                  fs2.closeSync(fd);
                } catch (er) {
                }
              } else {
                fs2.closeSync(fd);
              }
            }
            return ret;
          };
        } else if (fs2.futimes) {
          fs2.lutimes = function(_a2, _b, _c, cb) {
            if (cb) process.nextTick(cb);
          };
          fs2.lutimesSync = function() {
          };
        }
      }
      function chmodFix(orig) {
        if (!orig) return orig;
        return function(target, mode, cb) {
          return orig.call(fs, target, mode, function(er) {
            if (chownErOk(er)) er = null;
            if (cb) cb.apply(this, arguments);
          });
        };
      }
      function chmodFixSync(orig) {
        if (!orig) return orig;
        return function(target, mode) {
          try {
            return orig.call(fs, target, mode);
          } catch (er) {
            if (!chownErOk(er)) throw er;
          }
        };
      }
      function chownFix(orig) {
        if (!orig) return orig;
        return function(target, uid, gid, cb) {
          return orig.call(fs, target, uid, gid, function(er) {
            if (chownErOk(er)) er = null;
            if (cb) cb.apply(this, arguments);
          });
        };
      }
      function chownFixSync(orig) {
        if (!orig) return orig;
        return function(target, uid, gid) {
          try {
            return orig.call(fs, target, uid, gid);
          } catch (er) {
            if (!chownErOk(er)) throw er;
          }
        };
      }
      function statFix(orig) {
        if (!orig) return orig;
        return function(target, options2, cb) {
          if (typeof options2 === "function") {
            cb = options2;
            options2 = null;
          }
          function callback(er, stats) {
            if (stats) {
              if (stats.uid < 0) stats.uid += 4294967296;
              if (stats.gid < 0) stats.gid += 4294967296;
            }
            if (cb) cb.apply(this, arguments);
          }
          return options2 ? orig.call(fs, target, options2, callback) : orig.call(fs, target, callback);
        };
      }
      function statFixSync(orig) {
        if (!orig) return orig;
        return function(target, options2) {
          var stats = options2 ? orig.call(fs, target, options2) : orig.call(fs, target);
          if (stats) {
            if (stats.uid < 0) stats.uid += 4294967296;
            if (stats.gid < 0) stats.gid += 4294967296;
          }
          return stats;
        };
      }
      function chownErOk(er) {
        if (!er)
          return true;
        if (er.code === "ENOSYS")
          return true;
        var nonroot = !process.getuid || process.getuid() !== 0;
        if (nonroot) {
          if (er.code === "EINVAL" || er.code === "EPERM")
            return true;
        }
        return false;
      }
    }
  }
});

// node_modules/graceful-fs/legacy-streams.js
var require_legacy_streams = __commonJS({
  "node_modules/graceful-fs/legacy-streams.js"(exports2, module2) {
    var Stream = require("stream").Stream;
    module2.exports = legacy;
    function legacy(fs) {
      return {
        ReadStream,
        WriteStream
      };
      function ReadStream(path, options2) {
        if (!(this instanceof ReadStream)) return new ReadStream(path, options2);
        Stream.call(this);
        var self = this;
        this.path = path;
        this.fd = null;
        this.readable = true;
        this.paused = false;
        this.flags = "r";
        this.mode = 438;
        this.bufferSize = 64 * 1024;
        options2 = options2 || {};
        var keys = Object.keys(options2);
        for (var index = 0, length = keys.length; index < length; index++) {
          var key = keys[index];
          this[key] = options2[key];
        }
        if (this.encoding) this.setEncoding(this.encoding);
        if (this.start !== void 0) {
          if ("number" !== typeof this.start) {
            throw TypeError("start must be a Number");
          }
          if (this.end === void 0) {
            this.end = Infinity;
          } else if ("number" !== typeof this.end) {
            throw TypeError("end must be a Number");
          }
          if (this.start > this.end) {
            throw new Error("start must be <= end");
          }
          this.pos = this.start;
        }
        if (this.fd !== null) {
          process.nextTick(function() {
            self._read();
          });
          return;
        }
        fs.open(this.path, this.flags, this.mode, function(err, fd) {
          if (err) {
            self.emit("error", err);
            self.readable = false;
            return;
          }
          self.fd = fd;
          self.emit("open", fd);
          self._read();
        });
      }
      function WriteStream(path, options2) {
        if (!(this instanceof WriteStream)) return new WriteStream(path, options2);
        Stream.call(this);
        this.path = path;
        this.fd = null;
        this.writable = true;
        this.flags = "w";
        this.encoding = "binary";
        this.mode = 438;
        this.bytesWritten = 0;
        options2 = options2 || {};
        var keys = Object.keys(options2);
        for (var index = 0, length = keys.length; index < length; index++) {
          var key = keys[index];
          this[key] = options2[key];
        }
        if (this.start !== void 0) {
          if ("number" !== typeof this.start) {
            throw TypeError("start must be a Number");
          }
          if (this.start < 0) {
            throw new Error("start must be >= zero");
          }
          this.pos = this.start;
        }
        this.busy = false;
        this._queue = [];
        if (this.fd === null) {
          this._open = fs.open;
          this._queue.push([this._open, this.path, this.flags, this.mode, void 0]);
          this.flush();
        }
      }
    }
  }
});

// node_modules/graceful-fs/clone.js
var require_clone = __commonJS({
  "node_modules/graceful-fs/clone.js"(exports2, module2) {
    "use strict";
    module2.exports = clone2;
    var getPrototypeOf = Object.getPrototypeOf || function(obj) {
      return obj.__proto__;
    };
    function clone2(obj) {
      if (obj === null || typeof obj !== "object")
        return obj;
      if (obj instanceof Object)
        var copy = { __proto__: getPrototypeOf(obj) };
      else
        var copy = /* @__PURE__ */ Object.create(null);
      Object.getOwnPropertyNames(obj).forEach(function(key) {
        Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key));
      });
      return copy;
    }
  }
});

// node_modules/graceful-fs/graceful-fs.js
var require_graceful_fs = __commonJS({
  "node_modules/graceful-fs/graceful-fs.js"(exports2, module2) {
    var fs = require("fs");
    var polyfills = require_polyfills();
    var legacy = require_legacy_streams();
    var clone2 = require_clone();
    var util2 = require("util");
    var gracefulQueue;
    var previousSymbol;
    if (typeof Symbol === "function" && typeof Symbol.for === "function") {
      gracefulQueue = Symbol.for("graceful-fs.queue");
      previousSymbol = Symbol.for("graceful-fs.previous");
    } else {
      gracefulQueue = "___graceful-fs.queue";
      previousSymbol = "___graceful-fs.previous";
    }
    function noop2() {
    }
    function publishQueue(context, queue2) {
      Object.defineProperty(context, gracefulQueue, {
        get: function() {
          return queue2;
        }
      });
    }
    var debug2 = noop2;
    if (util2.debuglog)
      debug2 = util2.debuglog("gfs4");
    else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || ""))
      debug2 = function() {
        var m = util2.format.apply(util2, arguments);
        m = "GFS4: " + m.split(/\n/).join("\nGFS4: ");
        console.error(m);
      };
    if (!fs[gracefulQueue]) {
      queue = global[gracefulQueue] || [];
      publishQueue(fs, queue);
      fs.close = (function(fs$close) {
        function close(fd, cb) {
          return fs$close.call(fs, fd, function(err) {
            if (!err) {
              resetQueue();
            }
            if (typeof cb === "function")
              cb.apply(this, arguments);
          });
        }
        Object.defineProperty(close, previousSymbol, {
          value: fs$close
        });
        return close;
      })(fs.close);
      fs.closeSync = (function(fs$closeSync) {
        function closeSync(fd) {
          fs$closeSync.apply(fs, arguments);
          resetQueue();
        }
        Object.defineProperty(closeSync, previousSymbol, {
          value: fs$closeSync
        });
        return closeSync;
      })(fs.closeSync);
      if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) {
        process.on("exit", function() {
          debug2(fs[gracefulQueue]);
          require("assert").equal(fs[gracefulQueue].length, 0);
        });
      }
    }
    var queue;
    if (!global[gracefulQueue]) {
      publishQueue(global, fs[gracefulQueue]);
    }
    module2.exports = patch(clone2(fs));
    if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs.__patched) {
      module2.exports = patch(fs);
      fs.__patched = true;
    }
    function patch(fs2) {
      polyfills(fs2);
      fs2.gracefulify = patch;
      fs2.createReadStream = createReadStream;
      fs2.createWriteStream = createWriteStream;
      var fs$readFile = fs2.readFile;
      fs2.readFile = readFile;
      function readFile(path, options2, cb) {
        if (typeof options2 === "function")
          cb = options2, options2 = null;
        return go$readFile(path, options2, cb);
        function go$readFile(path2, options3, cb2, startTime) {
          return fs$readFile(path2, options3, function(err) {
            if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
              enqueue([go$readFile, [path2, options3, cb2], err, startTime || Date.now(), Date.now()]);
            else {
              if (typeof cb2 === "function")
                cb2.apply(this, arguments);
            }
          });
        }
      }
      var fs$writeFile = fs2.writeFile;
      fs2.writeFile = writeFile;
      function writeFile(path, data, options2, cb) {
        if (typeof options2 === "function")
          cb = options2, options2 = null;
        return go$writeFile(path, data, options2, cb);
        function go$writeFile(path2, data2, options3, cb2, startTime) {
          return fs$writeFile(path2, data2, options3, function(err) {
            if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
              enqueue([go$writeFile, [path2, data2, options3, cb2], err, startTime || Date.now(), Date.now()]);
            else {
              if (typeof cb2 === "function")
                cb2.apply(this, arguments);
            }
          });
        }
      }
      var fs$appendFile = fs2.appendFile;
      if (fs$appendFile)
        fs2.appendFile = appendFile;
      function appendFile(path, data, options2, cb) {
        if (typeof options2 === "function")
          cb = options2, options2 = null;
        return go$appendFile(path, data, options2, cb);
        function go$appendFile(path2, data2, options3, cb2, startTime) {
          return fs$appendFile(path2, data2, options3, function(err) {
            if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
              enqueue([go$appendFile, [path2, data2, options3, cb2], err, startTime || Date.now(), Date.now()]);
            else {
              if (typeof cb2 === "function")
                cb2.apply(this, arguments);
            }
          });
        }
      }
      var fs$copyFile = fs2.copyFile;
      if (fs$copyFile)
        fs2.copyFile = copyFile;
      function copyFile(src, dest, flags, cb) {
        if (typeof flags === "function") {
          cb = flags;
          flags = 0;
        }
        return go$copyFile(src, dest, flags, cb);
        function go$copyFile(src2, dest2, flags2, cb2, startTime) {
          return fs$copyFile(src2, dest2, flags2, function(err) {
            if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
              enqueue([go$copyFile, [src2, dest2, flags2, cb2], err, startTime || Date.now(), Date.now()]);
            else {
              if (typeof cb2 === "function")
                cb2.apply(this, arguments);
            }
          });
        }
      }
      var fs$readdir = fs2.readdir;
      fs2.readdir = readdir;
      var noReaddirOptionVersions = /^v[0-5]\./;
      function readdir(path, options2, cb) {
        if (typeof options2 === "function")
          cb = options2, options2 = null;
        var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(path2, options3, cb2, startTime) {
          return fs$readdir(path2, fs$readdirCallback(
            path2,
            options3,
            cb2,
            startTime
          ));
        } : function go$readdir2(path2, options3, cb2, startTime) {
          return fs$readdir(path2, options3, fs$readdirCallback(
            path2,
            options3,
            cb2,
            startTime
          ));
        };
        return go$readdir(path, options2, cb);
        function fs$readdirCallback(path2, options3, cb2, startTime) {
          return function(err, files) {
            if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
              enqueue([
                go$readdir,
                [path2, options3, cb2],
                err,
                startTime || Date.now(),
                Date.now()
              ]);
            else {
              if (files && files.sort)
                files.sort();
              if (typeof cb2 === "function")
                cb2.call(this, err, files);
            }
          };
        }
      }
      if (process.version.substr(0, 4) === "v0.8") {
        var legStreams = legacy(fs2);
        ReadStream = legStreams.ReadStream;
        WriteStream = legStreams.WriteStream;
      }
      var fs$ReadStream = fs2.ReadStream;
      if (fs$ReadStream) {
        ReadStream.prototype = Object.create(fs$ReadStream.prototype);
        ReadStream.prototype.open = ReadStream$open;
      }
      var fs$WriteStream = fs2.WriteStream;
      if (fs$WriteStream) {
        WriteStream.prototype = Object.create(fs$WriteStream.prototype);
        WriteStream.prototype.open = WriteStream$open;
      }
      Object.defineProperty(fs2, "ReadStream", {
        get: function() {
          return ReadStream;
        },
        set: function(val) {
          ReadStream = val;
        },
        enumerable: true,
        configurable: true
      });
      Object.defineProperty(fs2, "WriteStream", {
        get: function() {
          return WriteStream;
        },
        set: function(val) {
          WriteStream = val;
        },
        enumerable: true,
        configurable: true
      });
      var FileReadStream = ReadStream;
      Object.defineProperty(fs2, "FileReadStream", {
        get: function() {
          return FileReadStream;
        },
        set: function(val) {
          FileReadStream = val;
        },
        enumerable: true,
        configurable: true
      });
      var FileWriteStream = WriteStream;
      Object.defineProperty(fs2, "FileWriteStream", {
        get: function() {
          return FileWriteStream;
        },
        set: function(val) {
          FileWriteStream = val;
        },
        enumerable: true,
        configurable: true
      });
      function ReadStream(path, options2) {
        if (this instanceof ReadStream)
          return fs$ReadStream.apply(this, arguments), this;
        else
          return ReadStream.apply(Object.create(ReadStream.prototype), arguments);
      }
      function ReadStream$open() {
        var that = this;
        open2(that.path, that.flags, that.mode, function(err, fd) {
          if (err) {
            if (that.autoClose)
              that.destroy();
            that.emit("error", err);
          } else {
            that.fd = fd;
            that.emit("open", fd);
            that.read();
          }
        });
      }
      function WriteStream(path, options2) {
        if (this instanceof WriteStream)
          return fs$WriteStream.apply(this, arguments), this;
        else
          return WriteStream.apply(Object.create(WriteStream.prototype), arguments);
      }
      function WriteStream$open() {
        var that = this;
        open2(that.path, that.flags, that.mode, function(err, fd) {
          if (err) {
            that.destroy();
            that.emit("error", err);
          } else {
            that.fd = fd;
            that.emit("open", fd);
          }
        });
      }
      function createReadStream(path, options2) {
        return new fs2.ReadStream(path, options2);
      }
      function createWriteStream(path, options2) {
        return new fs2.WriteStream(path, options2);
      }
      var fs$open = fs2.open;
      fs2.open = open2;
      function open2(path, flags, mode, cb) {
        if (typeof mode === "function")
          cb = mode, mode = null;
        return go$open(path, flags, mode, cb);
        function go$open(path2, flags2, mode2, cb2, startTime) {
          return fs$open(path2, flags2, mode2, function(err, fd) {
            if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
              enqueue([go$open, [path2, flags2, mode2, cb2], err, startTime || Date.now(), Date.now()]);
            else {
              if (typeof cb2 === "function")
                cb2.apply(this, arguments);
            }
          });
        }
      }
      return fs2;
    }
    function enqueue(elem) {
      debug2("ENQUEUE", elem[0].name, elem[1]);
      fs[gracefulQueue].push(elem);
      retry2();
    }
    var retryTimer;
    function resetQueue() {
      var now = Date.now();
      for (var i = 0; i < fs[gracefulQueue].length; ++i) {
        if (fs[gracefulQueue][i].length > 2) {
          fs[gracefulQueue][i][3] = now;
          fs[gracefulQueue][i][4] = now;
        }
      }
      retry2();
    }
    function retry2() {
      clearTimeout(retryTimer);
      retryTimer = void 0;
      if (fs[gracefulQueue].length === 0)
        return;
      var elem = fs[gracefulQueue].shift();
      var fn = elem[0];
      var args = elem[1];
      var err = elem[2];
      var startTime = elem[3];
      var lastTime = elem[4];
      if (startTime === void 0) {
        debug2("RETRY", fn.name, args);
        fn.apply(null, args);
      } else if (Date.now() - startTime >= 6e4) {
        debug2("TIMEOUT", fn.name, args);
        var cb = args.pop();
        if (typeof cb === "function")
          cb.call(null, err);
      } else {
        var sinceAttempt = Date.now() - lastTime;
        var sinceStart = Math.max(lastTime - startTime, 1);
        var desiredDelay = Math.min(sinceStart * 1.2, 100);
        if (sinceAttempt >= desiredDelay) {
          debug2("RETRY", fn.name, args);
          fn.apply(null, args.concat([startTime]));
        } else {
          fs[gracefulQueue].push(elem);
        }
      }
      if (retryTimer === void 0) {
        retryTimer = setTimeout(retry2, 0);
      }
    }
  }
});

// node_modules/retry/lib/retry_operation.js
var require_retry_operation = __commonJS({
  "node_modules/retry/lib/retry_operation.js"(exports2, module2) {
    function RetryOperation(timeouts, options2) {
      if (typeof options2 === "boolean") {
        options2 = { forever: options2 };
      }
      this._originalTimeouts = JSON.parse(JSON.stringify(timeouts));
      this._timeouts = timeouts;
      this._options = options2 || {};
      this._maxRetryTime = options2 && options2.maxRetryTime || Infinity;
      this._fn = null;
      this._errors = [];
      this._attempts = 1;
      this._operationTimeout = null;
      this._operationTimeoutCb = null;
      this._timeout = null;
      this._operationStart = null;
      if (this._options.forever) {
        this._cachedTimeouts = this._timeouts.slice(0);
      }
    }
    module2.exports = RetryOperation;
    RetryOperation.prototype.reset = function() {
      this._attempts = 1;
      this._timeouts = this._originalTimeouts;
    };
    RetryOperation.prototype.stop = function() {
      if (this._timeout) {
        clearTimeout(this._timeout);
      }
      this._timeouts = [];
      this._cachedTimeouts = null;
    };
    RetryOperation.prototype.retry = function(err) {
      if (this._timeout) {
        clearTimeout(this._timeout);
      }
      if (!err) {
        return false;
      }
      var currentTime = (/* @__PURE__ */ new Date()).getTime();
      if (err && currentTime - this._operationStart >= this._maxRetryTime) {
        this._errors.unshift(new Error("RetryOperation timeout occurred"));
        return false;
      }
      this._errors.push(err);
      var timeout = this._timeouts.shift();
      if (timeout === void 0) {
        if (this._cachedTimeouts) {
          this._errors.splice(this._errors.length - 1, this._errors.length);
          this._timeouts = this._cachedTimeouts.slice(0);
          timeout = this._timeouts.shift();
        } else {
          return false;
        }
      }
      var self = this;
      var timer = setTimeout(function() {
        self._attempts++;
        if (self._operationTimeoutCb) {
          self._timeout = setTimeout(function() {
            self._operationTimeoutCb(self._attempts);
          }, self._operationTimeout);
          if (self._options.unref) {
            self._timeout.unref();
          }
        }
        self._fn(self._attempts);
      }, timeout);
      if (this._options.unref) {
        timer.unref();
      }
      return true;
    };
    RetryOperation.prototype.attempt = function(fn, timeoutOps) {
      this._fn = fn;
      if (timeoutOps) {
        if (timeoutOps.timeout) {
          this._operationTimeout = timeoutOps.timeout;
        }
        if (timeoutOps.cb) {
          this._operationTimeoutCb = timeoutOps.cb;
        }
      }
      var self = this;
      if (this._operationTimeoutCb) {
        this._timeout = setTimeout(function() {
          self._operationTimeoutCb();
        }, self._operationTimeout);
      }
      this._operationStart = (/* @__PURE__ */ new Date()).getTime();
      this._fn(this._attempts);
    };
    RetryOperation.prototype.try = function(fn) {
      console.log("Using RetryOperation.try() is deprecated");
      this.attempt(fn);
    };
    RetryOperation.prototype.start = function(fn) {
      console.log("Using RetryOperation.start() is deprecated");
      this.attempt(fn);
    };
    RetryOperation.prototype.start = RetryOperation.prototype.try;
    RetryOperation.prototype.errors = function() {
      return this._errors;
    };
    RetryOperation.prototype.attempts = function() {
      return this._attempts;
    };
    RetryOperation.prototype.mainError = function() {
      if (this._errors.length === 0) {
        return null;
      }
      var counts = {};
      var mainError = null;
      var mainErrorCount = 0;
      for (var i = 0; i < this._errors.length; i++) {
        var error48 = this._errors[i];
        var message = error48.message;
        var count = (counts[message] || 0) + 1;
        counts[message] = count;
        if (count >= mainErrorCount) {
          mainError = error48;
          mainErrorCount = count;
        }
      }
      return mainError;
    };
  }
});

// node_modules/retry/lib/retry.js
var require_retry = __commonJS({
  "node_modules/retry/lib/retry.js"(exports2) {
    var RetryOperation = require_retry_operation();
    exports2.operation = function(options2) {
      var timeouts = exports2.timeouts(options2);
      return new RetryOperation(timeouts, {
        forever: options2 && options2.forever,
        unref: options2 && options2.unref,
        maxRetryTime: options2 && options2.maxRetryTime
      });
    };
    exports2.timeouts = function(options2) {
      if (options2 instanceof Array) {
        return [].concat(options2);
      }
      var opts = {
        retries: 10,
        factor: 2,
        minTimeout: 1 * 1e3,
        maxTimeout: Infinity,
        randomize: false
      };
      for (var key in options2) {
        opts[key] = options2[key];
      }
      if (opts.minTimeout > opts.maxTimeout) {
        throw new Error("minTimeout is greater than maxTimeout");
      }
      var timeouts = [];
      for (var i = 0; i < opts.retries; i++) {
        timeouts.push(this.createTimeout(i, opts));
      }
      if (options2 && options2.forever && !timeouts.length) {
        timeouts.push(this.createTimeout(i, opts));
      }
      timeouts.sort(function(a, b) {
        return a - b;
      });
      return timeouts;
    };
    exports2.createTimeout = function(attempt, opts) {
      var random2 = opts.randomize ? Math.random() + 1 : 1;
      var timeout = Math.round(random2 * opts.minTimeout * Math.pow(opts.factor, attempt));
      timeout = Math.min(timeout, opts.maxTimeout);
      return timeout;
    };
    exports2.wrap = function(obj, options2, methods) {
      if (options2 instanceof Array) {
        methods = options2;
        options2 = null;
      }
      if (!methods) {
        methods = [];
        for (var key in obj) {
          if (typeof obj[key] === "function") {
            methods.push(key);
          }
        }
      }
      for (var i = 0; i < methods.length; i++) {
        var method = methods[i];
        var original = obj[method];
        obj[method] = function retryWrapper(original2) {
          var op = exports2.operation(options2);
          var args = Array.prototype.slice.call(arguments, 1);
          var callback = args.pop();
          args.push(function(err) {
            if (op.retry(err)) {
              return;
            }
            if (err) {
              arguments[0] = op.mainError();
            }
            callback.apply(this, arguments);
          });
          op.attempt(function() {
            original2.apply(obj, args);
          });
        }.bind(obj, original);
        obj[method].options = options2;
      }
    };
  }
});

// node_modules/retry/index.js
var require_retry2 = __commonJS({
  "node_modules/retry/index.js"(exports2, module2) {
    module2.exports = require_retry();
  }
});

// node_modules/signal-exit/signals.js
var require_signals = __commonJS({
  "node_modules/signal-exit/signals.js"(exports2, module2) {
    module2.exports = [
      "SIGABRT",
      "SIGALRM",
      "SIGHUP",
      "SIGINT",
      "SIGTERM"
    ];
    if (process.platform !== "win32") {
      module2.exports.push(
        "SIGVTALRM",
        "SIGXCPU",
        "SIGXFSZ",
        "SIGUSR2",
        "SIGTRAP",
        "SIGSYS",
        "SIGQUIT",
        "SIGIOT"
        // should detect profiler and enable/disable accordingly.
        // see #21
        // 'SIGPROF'
      );
    }
    if (process.platform === "linux") {
      module2.exports.push(
        "SIGIO",
        "SIGPOLL",
        "SIGPWR",
        "SIGSTKFLT",
        "SIGUNUSED"
      );
    }
  }
});

// node_modules/signal-exit/index.js
var require_signal_exit = __commonJS({
  "node_modules/signal-exit/index.js"(exports2, module2) {
    var process5 = global.process;
    var processOk = function(process6) {
      return process6 && typeof process6 === "object" && typeof process6.removeListener === "function" && typeof process6.emit === "function" && typeof process6.reallyExit === "function" && typeof process6.listeners === "function" && typeof process6.kill === "function" && typeof process6.pid === "number" && typeof process6.on === "function";
    };
    if (!processOk(process5)) {
      module2.exports = function() {
        return function() {
        };
      };
    } else {
      assert2 = require("assert");
      signals = require_signals();
      isWin2 = /^win/i.test(process5.platform);
      EE = require("events");
      if (typeof EE !== "function") {
        EE = EE.EventEmitter;
      }
      if (process5.__signal_exit_emitter__) {
        emitter = process5.__signal_exit_emitter__;
      } else {
        emitter = process5.__signal_exit_emitter__ = new EE();
        emitter.count = 0;
        emitter.emitted = {};
      }
      if (!emitter.infinite) {
        emitter.setMaxListeners(Infinity);
        emitter.infinite = true;
      }
      module2.exports = function(cb, opts) {
        if (!processOk(global.process)) {
          return function() {
          };
        }
        assert2.equal(typeof cb, "function", "a callback must be provided for exit handler");
        if (loaded === false) {
          load();
        }
        var ev = "exit";
        if (opts && opts.alwaysLast) {
          ev = "afterexit";
        }
        var remove = function() {
          emitter.removeListener(ev, cb);
          if (emitter.listeners("exit").length === 0 && emitter.listeners("afterexit").length === 0) {
            unload();
          }
        };
        emitter.on(ev, cb);
        return remove;
      };
      unload = function unload2() {
        if (!loaded || !processOk(global.process)) {
          return;
        }
        loaded = false;
        signals.forEach(function(sig) {
          try {
            process5.removeListener(sig, sigListeners[sig]);
          } catch (er) {
          }
        });
        process5.emit = originalProcessEmit;
        process5.reallyExit = originalProcessReallyExit;
        emitter.count -= 1;
      };
      module2.exports.unload = unload;
      emit = function emit2(event, code, signal) {
        if (emitter.emitted[event]) {
          return;
        }
        emitter.emitted[event] = true;
        emitter.emit(event, code, signal);
      };
      sigListeners = {};
      signals.forEach(function(sig) {
        sigListeners[sig] = function listener() {
          if (!processOk(global.process)) {
            return;
          }
          var listeners = process5.listeners(sig);
          if (listeners.length === emitter.count) {
            unload();
            emit("exit", null, sig);
            emit("afterexit", null, sig);
            if (isWin2 && sig === "SIGHUP") {
              sig = "SIGINT";
            }
            process5.kill(process5.pid, sig);
          }
        };
      });
      module2.exports.signals = function() {
        return signals;
      };
      loaded = false;
      load = function load2() {
        if (loaded || !processOk(global.process)) {
          return;
        }
        loaded = true;
        emitter.count += 1;
        signals = signals.filter(function(sig) {
          try {
            process5.on(sig, sigListeners[sig]);
            return true;
          } catch (er) {
            return false;
          }
        });
        process5.emit = processEmit;
        process5.reallyExit = processReallyExit;
      };
      module2.exports.load = load;
      originalProcessReallyExit = process5.reallyExit;
      processReallyExit = function processReallyExit2(code) {
        if (!processOk(global.process)) {
          return;
        }
        process5.exitCode = code || /* istanbul ignore next */
        0;
        emit("exit", process5.exitCode, null);
        emit("afterexit", process5.exitCode, null);
        originalProcessReallyExit.call(process5, process5.exitCode);
      };
      originalProcessEmit = process5.emit;
      processEmit = function processEmit2(ev, arg) {
        if (ev === "exit" && processOk(global.process)) {
          if (arg !== void 0) {
            process5.exitCode = arg;
          }
          var ret = originalProcessEmit.apply(this, arguments);
          emit("exit", process5.exitCode, null);
          emit("afterexit", process5.exitCode, null);
          return ret;
        } else {
          return originalProcessEmit.apply(this, arguments);
        }
      };
    }
    var assert2;
    var signals;
    var isWin2;
    var EE;
    var emitter;
    var unload;
    var emit;
    var sigListeners;
    var loaded;
    var load;
    var originalProcessReallyExit;
    var processReallyExit;
    var originalProcessEmit;
    var processEmit;
  }
});

// node_modules/wrappy/wrappy.js
var require_wrappy = __commonJS({
  "node_modules/wrappy/wrappy.js"(exports2, module2) {
    module2.exports = wrappy;
    function wrappy(fn, cb) {
      if (fn && cb) return wrappy(fn)(cb);
      if (typeof fn !== "function")
        throw new TypeError("need wrapper function");
      Object.keys(fn).forEach(function(k) {
        wrapper[k] = fn[k];
      });
      return wrapper;
      function wrapper() {
        var args = new Array(arguments.length);
        for (var i = 0; i < args.length; i++) {
          args[i] = arguments[i];
        }
        var ret = fn.apply(this, args);
        var cb2 = args[args.length - 1];
        if (typeof ret === "function" && ret !== cb2) {
          Object.keys(cb2).forEach(function(k) {
            ret[k] = cb2[k];
          });
        }
        return ret;
      }
    }
  }
});

// node_modules/once/once.js
var require_once = __commonJS({
  "node_modules/once/once.js"(exports2, module2) {
    var wrappy = require_wrappy();
    module2.exports = wrappy(once);
    module2.exports.strict = wrappy(onceStrict);
    once.proto = once(function() {
      Object.defineProperty(Function.prototype, "once", {
        value: function() {
          return once(this);
        },
        configurable: true
      });
      Object.defineProperty(Function.prototype, "onceStrict", {
        value: function() {
          return onceStrict(this);
        },
        configurable: true
      });
    });
    function once(fn) {
      var f = function() {
        if (f.called) return f.value;
        f.called = true;
        return f.value = fn.apply(this, arguments);
      };
      f.called = false;
      return f;
    }
    function onceStrict(fn) {
      var f = function() {
        if (f.called)
          throw new Error(f.onceError);
        f.called = true;
        return f.value = fn.apply(this, arguments);
      };
      var name = fn.name || "Function wrapped with `once`";
      f.onceError = name + " shouldn't be called more than once";
      f.called = false;
      return f;
    }
  }
});

// node_modules/end-of-stream/index.js
var require_end_of_stream = __commonJS({
  "node_modules/end-of-stream/index.js"(exports2, module2) {
    var once = require_once();
    var noop2 = function() {
    };
    var qnt = global.Bare ? queueMicrotask : process.nextTick.bind(process);
    var isRequest = function(stream) {
      return stream.setHeader && typeof stream.abort === "function";
    };
    var isChildProcess = function(stream) {
      return stream.stdio && Array.isArray(stream.stdio) && stream.stdio.length === 3;
    };
    var eos = function(stream, opts, callback) {
      if (typeof opts === "function") return eos(stream, null, opts);
      if (!opts) opts = {};
      callback = once(callback || noop2);
      var ws2 = stream._writableState;
      var rs = stream._readableState;
      var readable = opts.readable || opts.readable !== false && stream.readable;
      var writable = opts.writable || opts.writable !== false && stream.writable;
      var cancelled = false;
      var onlegacyfinish = function() {
        if (!stream.writable) onfinish();
      };
      var onfinish = function() {
        writable = false;
        if (!readable) callback.call(stream);
      };
      var onend = function() {
        readable = false;
        if (!writable) callback.call(stream);
      };
      var onexit = function(exitCode) {
        callback.call(stream, exitCode ? new Error("exited with error code: " + exitCode) : null);
      };
      var onerror = function(err) {
        callback.call(stream, err);
      };
      var onclose = function() {
        qnt(onclosenexttick);
      };
      var onclosenexttick = function() {
        if (cancelled) return;
        if (readable && !(rs && (rs.ended && !rs.destroyed))) return callback.call(stream, new Error("premature close"));
        if (writable && !(ws2 && (ws2.ended && !ws2.destroyed))) return callback.call(stream, new Error("premature close"));
      };
      var onrequest = function() {
        stream.req.on("finish", onfinish);
      };
      if (isRequest(stream)) {
        stream.on("complete", onfinish);
        stream.on("abort", onclose);
        if (stream.req) onrequest();
        else stream.on("request", onrequest);
      } else if (writable && !ws2) {
        stream.on("end", onlegacyfinish);
        stream.on("close", onlegacyfinish);
      }
      if (isChildProcess(stream)) stream.on("exit", onexit);
      stream.on("end", onend);
      stream.on("finish", onfinish);
      if (opts.error !== false) stream.on("error", onerror);
      stream.on("close", onclose);
      return function() {
        cancelled = true;
        stream.removeListener("complete", onfinish);
        stream.removeListener("abort", onclose);
        stream.removeListener("request", onrequest);
        if (stream.req) stream.req.removeListener("finish", onfinish);
        stream.removeListener("end", onlegacyfinish);
        stream.removeListener("close", onlegacyfinish);
        stream.removeListener("finish", onfinish);
        stream.removeListener("exit", onexit);
        stream.removeListener("end", onend);
        stream.removeListener("error", onerror);
        stream.removeListener("close", onclose);
      };
    };
    module2.exports = eos;
  }
});

// node_modules/pump/index.js
var require_pump = __commonJS({
  "node_modules/pump/index.js"(exports2, module2) {
    var once = require_once();
    var eos = require_end_of_stream();
    var fs;
    try {
      fs = require("fs");
    } catch (e) {
    }
    var noop2 = function() {
    };
    var ancient = typeof process === "undefined" ? false : /^v?\.0/.test(process.version);
    var isFn = function(fn) {
      return typeof fn === "function";
    };
    var isFS = function(stream) {
      if (!ancient) return false;
      if (!fs) return false;
      return (stream instanceof (fs.ReadStream || noop2) || stream instanceof (fs.WriteStream || noop2)) && isFn(stream.close);
    };
    var isRequest = function(stream) {
      return stream.setHeader && isFn(stream.abort);
    };
    var destroyer = function(stream, reading, writing, callback) {
      callback = once(callback);
      var closed = false;
      stream.on("close", function() {
        closed = true;
      });
      eos(stream, { readable: reading, writable: writing }, function(err) {
        if (err) return callback(err);
        closed = true;
        callback();
      });
      var destroyed = false;
      return function(err) {
        if (closed) return;
        if (destroyed) return;
        destroyed = true;
        if (isFS(stream)) return stream.close(noop2);
        if (isRequest(stream)) return stream.abort();
        if (isFn(stream.destroy)) return stream.destroy();
        callback(err || new Error("stream was destroyed"));
      };
    };
    var call = function(fn) {
      fn();
    };
    var pipe2 = function(from, to) {
      return from.pipe(to);
    };
    var pump = function() {
      var streams = Array.prototype.slice.call(arguments);
      var callback = isFn(streams[streams.length - 1] || noop2) && streams.pop() || noop2;
      if (Array.isArray(streams[0])) streams = streams[0];
      if (streams.length < 2) throw new Error("pump requires two streams per minimum");
      var error48;
      var destroys = streams.map(function(stream, i) {
        var reading = i < streams.length - 1;
        var writing = i > 0;
        return destroyer(stream, reading, writing, function(err) {
          if (!error48) error48 = err;
          if (err) destroys.forEach(call);
          if (reading) return;
          destroys.forEach(call);
          callback(error48);
        });
      });
      return streams.reduce(pipe2);
    };
    module2.exports = pump;
  }
});

// node_modules/get-stream/buffer-stream.js
var require_buffer_stream = __commonJS({
  "node_modules/get-stream/buffer-stream.js"(exports2, module2) {
    "use strict";
    var { PassThrough: PassThroughStream } = require("stream");
    module2.exports = (options2) => {
      options2 = { ...options2 };
      const { array: array2 } = options2;
      let { encoding } = options2;
      const isBuffer = encoding === "buffer";
      let objectMode = false;
      if (array2) {
        objectMode = !(encoding || isBuffer);
      } else {
        encoding = encoding || "utf8";
      }
      if (isBuffer) {
        encoding = null;
      }
      const stream = new PassThroughStream({ objectMode });
      if (encoding) {
        stream.setEncoding(encoding);
      }
      let length = 0;
      const chunks = [];
      stream.on("data", (chunk) => {
        chunks.push(chunk);
        if (objectMode) {
          length = chunks.length;
        } else {
          length += chunk.length;
        }
      });
      stream.getBufferedValue = () => {
        if (array2) {
          return chunks;
        }
        return isBuffer ? Buffer.concat(chunks, length) : chunks.join("");
      };
      stream.getBufferedLength = () => length;
      return stream;
    };
  }
});

// node_modules/get-stream/index.js
var require_get_stream = __commonJS({
  "node_modules/get-stream/index.js"(exports2, module2) {
    "use strict";
    var { constants: BufferConstants } = require("buffer");
    var pump = require_pump();
    var bufferStream = require_buffer_stream();
    var MaxBufferError = class extends Error {
      constructor() {
        super("maxBuffer exceeded");
        this.name = "MaxBufferError";
      }
    };
    async function getStream2(inputStream, options2) {
      if (!inputStream) {
        return Promise.reject(new Error("Expected a stream"));
      }
      options2 = {
        maxBuffer: Infinity,
        ...options2
      };
      const { maxBuffer } = options2;
      let stream;
      await new Promise((resolve, reject) => {
        const rejectPromise = (error48) => {
          if (error48 && stream.getBufferedLength() <= BufferConstants.MAX_LENGTH) {
            error48.bufferedData = stream.getBufferedValue();
          }
          reject(error48);
        };
        stream = pump(inputStream, bufferStream(options2), (error48) => {
          if (error48) {
            rejectPromise(error48);
            return;
          }
          resolve();
        });
        stream.on("data", () => {
          if (stream.getBufferedLength() > maxBuffer) {
            rejectPromise(new MaxBufferError());
          }
        });
      });
      return stream.getBufferedValue();
    }
    module2.exports = getStream2;
    module2.exports.default = getStream2;
    module2.exports.buffer = (stream, options2) => getStream2(stream, { ...options2, encoding: "buffer" });
    module2.exports.array = (stream, options2) => getStream2(stream, { ...options2, array: true });
    module2.exports.MaxBufferError = MaxBufferError;
  }
});

// node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/code.js
var require_code = __commonJS({
  "node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/code.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.regexpCode = exports2.getEsmExportName = exports2.getProperty = exports2.safeStringify = exports2.stringify = exports2.strConcat = exports2.addCodeArg = exports2.str = exports2._ = exports2.nil = exports2._Code = exports2.Name = exports2.IDENTIFIER = exports2._CodeOrName = void 0;
    var _CodeOrName = class {
    };
    exports2._CodeOrName = _CodeOrName;
    exports2.IDENTIFIER = /^[a-z$_][a-z$_0-9]*$/i;
    var Name = class extends _CodeOrName {
      constructor(s) {
        super();
        if (!exports2.IDENTIFIER.test(s))
          throw new Error("CodeGen: name must be a valid identifier");
        this.str = s;
      }
      toString() {
        return this.str;
      }
      emptyStr() {
        return false;
      }
      get names() {
        return { [this.str]: 1 };
      }
    };
    exports2.Name = Name;
    var _Code = class extends _CodeOrName {
      constructor(code) {
        super();
        this._items = typeof code === "string" ? [code] : code;
      }
      toString() {
        return this.str;
      }
      emptyStr() {
        if (this._items.length > 1)
          return false;
        const item = this._items[0];
        return item === "" || item === '""';
      }
      get str() {
        var _a2;
        return (_a2 = this._str) !== null && _a2 !== void 0 ? _a2 : this._str = this._items.reduce((s, c) => `${s}${c}`, "");
      }
      get names() {
        var _a2;
        return (_a2 = this._names) !== null && _a2 !== void 0 ? _a2 : this._names = this._items.reduce((names, c) => {
          if (c instanceof Name)
            names[c.str] = (names[c.str] || 0) + 1;
          return names;
        }, {});
      }
    };
    exports2._Code = _Code;
    exports2.nil = new _Code("");
    function _(strs, ...args) {
      const code = [strs[0]];
      let i = 0;
      while (i < args.length) {
        addCodeArg(code, args[i]);
        code.push(strs[++i]);
      }
      return new _Code(code);
    }
    exports2._ = _;
    var plus = new _Code("+");
    function str(strs, ...args) {
      const expr = [safeStringify(strs[0])];
      let i = 0;
      while (i < args.length) {
        expr.push(plus);
        addCodeArg(expr, args[i]);
        expr.push(plus, safeStringify(strs[++i]));
      }
      optimize(expr);
      return new _Code(expr);
    }
    exports2.str = str;
    function addCodeArg(code, arg) {
      if (arg instanceof _Code)
        code.push(...arg._items);
      else if (arg instanceof Name)
        code.push(arg);
      else
        code.push(interpolate(arg));
    }
    exports2.addCodeArg = addCodeArg;
    function optimize(expr) {
      let i = 1;
      while (i < expr.length - 1) {
        if (expr[i] === plus) {
          const res = mergeExprItems(expr[i - 1], expr[i + 1]);
          if (res !== void 0) {
            expr.splice(i - 1, 3, res);
            continue;
          }
          expr[i++] = "+";
        }
        i++;
      }
    }
    function mergeExprItems(a, b) {
      if (b === '""')
        return a;
      if (a === '""')
        return b;
      if (typeof a == "string") {
        if (b instanceof Name || a[a.length - 1] !== '"')
          return;
        if (typeof b != "string")
          return `${a.slice(0, -1)}${b}"`;
        if (b[0] === '"')
          return a.slice(0, -1) + b.slice(1);
        return;
      }
      if (typeof b == "string" && b[0] === '"' && !(a instanceof Name))
        return `"${a}${b.slice(1)}`;
      return;
    }
    function strConcat(c1, c2) {
      return c2.emptyStr() ? c1 : c1.emptyStr() ? c2 : str`${c1}${c2}`;
    }
    exports2.strConcat = strConcat;
    function interpolate(x) {
      return typeof x == "number" || typeof x == "boolean" || x === null ? x : safeStringify(Array.isArray(x) ? x.join(",") : x);
    }
    function stringify(x) {
      return new _Code(safeStringify(x));
    }
    exports2.stringify = stringify;
    function safeStringify(x) {
      return JSON.stringify(x).replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029");
    }
    exports2.safeStringify = safeStringify;
    function getProperty(key) {
      return typeof key == "string" && exports2.IDENTIFIER.test(key) ? new _Code(`.${key}`) : _`[${key}]`;
    }
    exports2.getProperty = getProperty;
    function getEsmExportName(key) {
      if (typeof key == "string" && exports2.IDENTIFIER.test(key)) {
        return new _Code(`${key}`);
      }
      throw new Error(`CodeGen: invalid export name: ${key}, use explicit $id name mapping`);
    }
    exports2.getEsmExportName = getEsmExportName;
    function regexpCode(rx) {
      return new _Code(rx.toString());
    }
    exports2.regexpCode = regexpCode;
  }
});

// node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/scope.js
var require_scope = __commonJS({
  "node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/scope.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.ValueScope = exports2.ValueScopeName = exports2.Scope = exports2.varKinds = exports2.UsedValueState = void 0;
    var code_1 = require_code();
    var ValueError = class extends Error {
      constructor(name) {
        super(`CodeGen: "code" for ${name} not defined`);
        this.value = name.value;
      }
    };
    var UsedValueState;
    (function(UsedValueState2) {
      UsedValueState2[UsedValueState2["Started"] = 0] = "Started";
      UsedValueState2[UsedValueState2["Completed"] = 1] = "Completed";
    })(UsedValueState || (exports2.UsedValueState = UsedValueState = {}));
    exports2.varKinds = {
      const: new code_1.Name("const"),
      let: new code_1.Name("let"),
      var: new code_1.Name("var")
    };
    var Scope = class {
      constructor({ prefixes, parent } = {}) {
        this._names = {};
        this._prefixes = prefixes;
        this._parent = parent;
      }
      toName(nameOrPrefix) {
        return nameOrPrefix instanceof code_1.Name ? nameOrPrefix : this.name(nameOrPrefix);
      }
      name(prefix) {
        return new code_1.Name(this._newName(prefix));
      }
      _newName(prefix) {
        const ng = this._names[prefix] || this._nameGroup(prefix);
        return `${prefix}${ng.index++}`;
      }
      _nameGroup(prefix) {
        var _a2, _b;
        if (((_b = (_a2 = this._parent) === null || _a2 === void 0 ? void 0 : _a2._prefixes) === null || _b === void 0 ? void 0 : _b.has(prefix)) || this._prefixes && !this._prefixes.has(prefix)) {
          throw new Error(`CodeGen: prefix "${prefix}" is not allowed in this scope`);
        }
        return this._names[prefix] = { prefix, index: 0 };
      }
    };
    exports2.Scope = Scope;
    var ValueScopeName = class extends code_1.Name {
      constructor(prefix, nameStr) {
        super(nameStr);
        this.prefix = prefix;
      }
      setValue(value, { property, itemIndex }) {
        this.value = value;
        this.scopePath = (0, code_1._)`.${new code_1.Name(property)}[${itemIndex}]`;
      }
    };
    exports2.ValueScopeName = ValueScopeName;
    var line = (0, code_1._)`\n`;
    var ValueScope = class extends Scope {
      constructor(opts) {
        super(opts);
        this._values = {};
        this._scope = opts.scope;
        this.opts = { ...opts, _n: opts.lines ? line : code_1.nil };
      }
      get() {
        return this._scope;
      }
      name(prefix) {
        return new ValueScopeName(prefix, this._newName(prefix));
      }
      value(nameOrPrefix, value) {
        var _a2;
        if (value.ref === void 0)
          throw new Error("CodeGen: ref must be passed in value");
        const name = this.toName(nameOrPrefix);
        const { prefix } = name;
        const valueKey = (_a2 = value.key) !== null && _a2 !== void 0 ? _a2 : value.ref;
        let vs = this._values[prefix];
        if (vs) {
          const _name = vs.get(valueKey);
          if (_name)
            return _name;
        } else {
          vs = this._values[prefix] = /* @__PURE__ */ new Map();
        }
        vs.set(valueKey, name);
        const s = this._scope[prefix] || (this._scope[prefix] = []);
        const itemIndex = s.length;
        s[itemIndex] = value.ref;
        name.setValue(value, { property: prefix, itemIndex });
        return name;
      }
      getValue(prefix, keyOrRef) {
        const vs = this._values[prefix];
        if (!vs)
          return;
        return vs.get(keyOrRef);
      }
      scopeRefs(scopeName, values = this._values) {
        return this._reduceValues(values, (name) => {
          if (name.scopePath === void 0)
            throw new Error(`CodeGen: name "${name}" has no value`);
          return (0, code_1._)`${scopeName}${name.scopePath}`;
        });
      }
      scopeCode(values = this._values, usedValues, getCode) {
        return this._reduceValues(values, (name) => {
          if (name.value === void 0)
            throw new Error(`CodeGen: name "${name}" has no value`);
          return name.value.code;
        }, usedValues, getCode);
      }
      _reduceValues(values, valueCode, usedValues = {}, getCode) {
        let code = code_1.nil;
        for (const prefix in values) {
          const vs = values[prefix];
          if (!vs)
            continue;
          const nameSet = usedValues[prefix] = usedValues[prefix] || /* @__PURE__ */ new Map();
          vs.forEach((name) => {
            if (nameSet.has(name))
              return;
            nameSet.set(name, UsedValueState.Started);
            let c = valueCode(name);
            if (c) {
              const def = this.opts.es5 ? exports2.varKinds.var : exports2.varKinds.const;
              code = (0, code_1._)`${code}${def} ${name} = ${c};${this.opts._n}`;
            } else if (c = getCode === null || getCode === void 0 ? void 0 : getCode(name)) {
              code = (0, code_1._)`${code}${c}${this.opts._n}`;
            } else {
              throw new ValueError(name);
            }
            nameSet.set(name, UsedValueState.Completed);
          });
        }
        return code;
      }
    };
    exports2.ValueScope = ValueScope;
  }
});

// node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js
var require_codegen = __commonJS({
  "node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.or = exports2.and = exports2.not = exports2.CodeGen = exports2.operators = exports2.varKinds = exports2.ValueScopeName = exports2.ValueScope = exports2.Scope = exports2.Name = exports2.regexpCode = exports2.stringify = exports2.getProperty = exports2.nil = exports2.strConcat = exports2.str = exports2._ = void 0;
    var code_1 = require_code();
    var scope_1 = require_scope();
    var code_2 = require_code();
    Object.defineProperty(exports2, "_", { enumerable: true, get: function() {
      return code_2._;
    } });
    Object.defineProperty(exports2, "str", { enumerable: true, get: function() {
      return code_2.str;
    } });
    Object.defineProperty(exports2, "strConcat", { enumerable: true, get: function() {
      return code_2.strConcat;
    } });
    Object.defineProperty(exports2, "nil", { enumerable: true, get: function() {
      return code_2.nil;
    } });
    Object.defineProperty(exports2, "getProperty", { enumerable: true, get: function() {
      return code_2.getProperty;
    } });
    Object.defineProperty(exports2, "stringify", { enumerable: true, get: function() {
      return code_2.stringify;
    } });
    Object.defineProperty(exports2, "regexpCode", { enumerable: true, get: function() {
      return code_2.regexpCode;
    } });
    Object.defineProperty(exports2, "Name", { enumerable: true, get: function() {
      return code_2.Name;
    } });
    var scope_2 = require_scope();
    Object.defineProperty(exports2, "Scope", { enumerable: true, get: function() {
      return scope_2.Scope;
    } });
    Object.defineProperty(exports2, "ValueScope", { enumerable: true, get: function() {
      return scope_2.ValueScope;
    } });
    Object.defineProperty(exports2, "ValueScopeName", { enumerable: true, get: function() {
      return scope_2.ValueScopeName;
    } });
    Object.defineProperty(exports2, "varKinds", { enumerable: true, get: function() {
      return scope_2.varKinds;
    } });
    exports2.operators = {
      GT: new code_1._Code(">"),
      GTE: new code_1._Code(">="),
      LT: new code_1._Code("<"),
      LTE: new code_1._Code("<="),
      EQ: new code_1._Code("==="),
      NEQ: new code_1._Code("!=="),
      NOT: new code_1._Code("!"),
      OR: new code_1._Code("||"),
      AND: new code_1._Code("&&"),
      ADD: new code_1._Code("+")
    };
    var Node = class {
      optimizeNodes() {
        return this;
      }
      optimizeNames(_names, _constants) {
        return this;
      }
    };
    var Def = class extends Node {
      constructor(varKind, name, rhs) {
        super();
        this.varKind = varKind;
        this.name = name;
        this.rhs = rhs;
      }
      render({ es5, _n }) {
        const varKind = es5 ? scope_1.varKinds.var : this.varKind;
        const rhs = this.rhs === void 0 ? "" : ` = ${this.rhs}`;
        return `${varKind} ${this.name}${rhs};` + _n;
      }
      optimizeNames(names, constants) {
        if (!names[this.name.str])
          return;
        if (this.rhs)
          this.rhs = optimizeExpr(this.rhs, names, constants);
        return this;
      }
      get names() {
        return this.rhs instanceof code_1._CodeOrName ? this.rhs.names : {};
      }
    };
    var Assign = class extends Node {
      constructor(lhs, rhs, sideEffects) {
        super();
        this.lhs = lhs;
        this.rhs = rhs;
        this.sideEffects = sideEffects;
      }
      render({ _n }) {
        return `${this.lhs} = ${this.rhs};` + _n;
      }
      optimizeNames(names, constants) {
        if (this.lhs instanceof code_1.Name && !names[this.lhs.str] && !this.sideEffects)
          return;
        this.rhs = optimizeExpr(this.rhs, names, constants);
        return this;
      }
      get names() {
        const names = this.lhs instanceof code_1.Name ? {} : { ...this.lhs.names };
        return addExprNames(names, this.rhs);
      }
    };
    var AssignOp = class extends Assign {
      constructor(lhs, op, rhs, sideEffects) {
        super(lhs, rhs, sideEffects);
        this.op = op;
      }
      render({ _n }) {
        return `${this.lhs} ${this.op}= ${this.rhs};` + _n;
      }
    };
    var Label = class extends Node {
      constructor(label) {
        super();
        this.label = label;
        this.names = {};
      }
      render({ _n }) {
        return `${this.label}:` + _n;
      }
    };
    var Break = class extends Node {
      constructor(label) {
        super();
        this.label = label;
        this.names = {};
      }
      render({ _n }) {
        const label = this.label ? ` ${this.label}` : "";
        return `break${label};` + _n;
      }
    };
    var Throw = class extends Node {
      constructor(error48) {
        super();
        this.error = error48;
      }
      render({ _n }) {
        return `throw ${this.error};` + _n;
      }
      get names() {
        return this.error.names;
      }
    };
    var AnyCode = class extends Node {
      constructor(code) {
        super();
        this.code = code;
      }
      render({ _n }) {
        return `${this.code};` + _n;
      }
      optimizeNodes() {
        return `${this.code}` ? this : void 0;
      }
      optimizeNames(names, constants) {
        this.code = optimizeExpr(this.code, names, constants);
        return this;
      }
      get names() {
        return this.code instanceof code_1._CodeOrName ? this.code.names : {};
      }
    };
    var ParentNode = class extends Node {
      constructor(nodes = []) {
        super();
        this.nodes = nodes;
      }
      render(opts) {
        return this.nodes.reduce((code, n) => code + n.render(opts), "");
      }
      optimizeNodes() {
        const { nodes } = this;
        let i = nodes.length;
        while (i--) {
          const n = nodes[i].optimizeNodes();
          if (Array.isArray(n))
            nodes.splice(i, 1, ...n);
          else if (n)
            nodes[i] = n;
          else
            nodes.splice(i, 1);
        }
        return nodes.length > 0 ? this : void 0;
      }
      optimizeNames(names, constants) {
        const { nodes } = this;
        let i = nodes.length;
        while (i--) {
          const n = nodes[i];
          if (n.optimizeNames(names, constants))
            continue;
          subtractNames(names, n.names);
          nodes.splice(i, 1);
        }
        return nodes.length > 0 ? this : void 0;
      }
      get names() {
        return this.nodes.reduce((names, n) => addNames(names, n.names), {});
      }
    };
    var BlockNode = class extends ParentNode {
      render(opts) {
        return "{" + opts._n + super.render(opts) + "}" + opts._n;
      }
    };
    var Root = class extends ParentNode {
    };
    var Else = class extends BlockNode {
    };
    Else.kind = "else";
    var If = class _If extends BlockNode {
      constructor(condition, nodes) {
        super(nodes);
        this.condition = condition;
      }
      render(opts) {
        let code = `if(${this.condition})` + super.render(opts);
        if (this.else)
          code += "else " + this.else.render(opts);
        return code;
      }
      optimizeNodes() {
        super.optimizeNodes();
        const cond = this.condition;
        if (cond === true)
          return this.nodes;
        let e = this.else;
        if (e) {
          const ns = e.optimizeNodes();
          e = this.else = Array.isArray(ns) ? new Else(ns) : ns;
        }
        if (e) {
          if (cond === false)
            return e instanceof _If ? e : e.nodes;
          if (this.nodes.length)
            return this;
          return new _If(not(cond), e instanceof _If ? [e] : e.nodes);
        }
        if (cond === false || !this.nodes.length)
          return void 0;
        return this;
      }
      optimizeNames(names, constants) {
        var _a2;
        this.else = (_a2 = this.else) === null || _a2 === void 0 ? void 0 : _a2.optimizeNames(names, constants);
        if (!(super.optimizeNames(names, constants) || this.else))
          return;
        this.condition = optimizeExpr(this.condition, names, constants);
        return this;
      }
      get names() {
        const names = super.names;
        addExprNames(names, this.condition);
        if (this.else)
          addNames(names, this.else.names);
        return names;
      }
    };
    If.kind = "if";
    var For = class extends BlockNode {
    };
    For.kind = "for";
    var ForLoop = class extends For {
      constructor(iteration) {
        super();
        this.iteration = iteration;
      }
      render(opts) {
        return `for(${this.iteration})` + super.render(opts);
      }
      optimizeNames(names, constants) {
        if (!super.optimizeNames(names, constants))
          return;
        this.iteration = optimizeExpr(this.iteration, names, constants);
        return this;
      }
      get names() {
        return addNames(super.names, this.iteration.names);
      }
    };
    var ForRange = class extends For {
      constructor(varKind, name, from, to) {
        super();
        this.varKind = varKind;
        this.name = name;
        this.from = from;
        this.to = to;
      }
      render(opts) {
        const varKind = opts.es5 ? scope_1.varKinds.var : this.varKind;
        const { name, from, to } = this;
        return `for(${varKind} ${name}=${from}; ${name}<${to}; ${name}++)` + super.render(opts);
      }
      get names() {
        const names = addExprNames(super.names, this.from);
        return addExprNames(names, this.to);
      }
    };
    var ForIter = class extends For {
      constructor(loop, varKind, name, iterable) {
        super();
        this.loop = loop;
        this.varKind = varKind;
        this.name = name;
        this.iterable = iterable;
      }
      render(opts) {
        return `for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})` + super.render(opts);
      }
      optimizeNames(names, constants) {
        if (!super.optimizeNames(names, constants))
          return;
        this.iterable = optimizeExpr(this.iterable, names, constants);
        return this;
      }
      get names() {
        return addNames(super.names, this.iterable.names);
      }
    };
    var Func = class extends BlockNode {
      constructor(name, args, async) {
        super();
        this.name = name;
        this.args = args;
        this.async = async;
      }
      render(opts) {
        const _async = this.async ? "async " : "";
        return `${_async}function ${this.name}(${this.args})` + super.render(opts);
      }
    };
    Func.kind = "func";
    var Return = class extends ParentNode {
      render(opts) {
        return "return " + super.render(opts);
      }
    };
    Return.kind = "return";
    var Try = class extends BlockNode {
      render(opts) {
        let code = "try" + super.render(opts);
        if (this.catch)
          code += this.catch.render(opts);
        if (this.finally)
          code += this.finally.render(opts);
        return code;
      }
      optimizeNodes() {
        var _a2, _b;
        super.optimizeNodes();
        (_a2 = this.catch) === null || _a2 === void 0 ? void 0 : _a2.optimizeNodes();
        (_b = this.finally) === null || _b === void 0 ? void 0 : _b.optimizeNodes();
        return this;
      }
      optimizeNames(names, constants) {
        var _a2, _b;
        super.optimizeNames(names, constants);
        (_a2 = this.catch) === null || _a2 === void 0 ? void 0 : _a2.optimizeNames(names, constants);
        (_b = this.finally) === null || _b === void 0 ? void 0 : _b.optimizeNames(names, constants);
        return this;
      }
      get names() {
        const names = super.names;
        if (this.catch)
          addNames(names, this.catch.names);
        if (this.finally)
          addNames(names, this.finally.names);
        return names;
      }
    };
    var Catch = class extends BlockNode {
      constructor(error48) {
        super();
        this.error = error48;
      }
      render(opts) {
        return `catch(${this.error})` + super.render(opts);
      }
    };
    Catch.kind = "catch";
    var Finally = class extends BlockNode {
      render(opts) {
        return "finally" + super.render(opts);
      }
    };
    Finally.kind = "finally";
    var CodeGen = class {
      constructor(extScope, opts = {}) {
        this._values = {};
        this._blockStarts = [];
        this._constants = {};
        this.opts = { ...opts, _n: opts.lines ? "\n" : "" };
        this._extScope = extScope;
        this._scope = new scope_1.Scope({ parent: extScope });
        this._nodes = [new Root()];
      }
      toString() {
        return this._root.render(this.opts);
      }
      // returns unique name in the internal scope
      name(prefix) {
        return this._scope.name(prefix);
      }
      // reserves unique name in the external scope
      scopeName(prefix) {
        return this._extScope.name(prefix);
      }
      // reserves unique name in the external scope and assigns value to it
      scopeValue(prefixOrName, value) {
        const name = this._extScope.value(prefixOrName, value);
        const vs = this._values[name.prefix] || (this._values[name.prefix] = /* @__PURE__ */ new Set());
        vs.add(name);
        return name;
      }
      getScopeValue(prefix, keyOrRef) {
        return this._extScope.getValue(prefix, keyOrRef);
      }
      // return code that assigns values in the external scope to the names that are used internally
      // (same names that were returned by gen.scopeName or gen.scopeValue)
      scopeRefs(scopeName) {
        return this._extScope.scopeRefs(scopeName, this._values);
      }
      scopeCode() {
        return this._extScope.scopeCode(this._values);
      }
      _def(varKind, nameOrPrefix, rhs, constant) {
        const name = this._scope.toName(nameOrPrefix);
        if (rhs !== void 0 && constant)
          this._constants[name.str] = rhs;
        this._leafNode(new Def(varKind, name, rhs));
        return name;
      }
      // `const` declaration (`var` in es5 mode)
      const(nameOrPrefix, rhs, _constant) {
        return this._def(scope_1.varKinds.const, nameOrPrefix, rhs, _constant);
      }
      // `let` declaration with optional assignment (`var` in es5 mode)
      let(nameOrPrefix, rhs, _constant) {
        return this._def(scope_1.varKinds.let, nameOrPrefix, rhs, _constant);
      }
      // `var` declaration with optional assignment
      var(nameOrPrefix, rhs, _constant) {
        return this._def(scope_1.varKinds.var, nameOrPrefix, rhs, _constant);
      }
      // assignment code
      assign(lhs, rhs, sideEffects) {
        return this._leafNode(new Assign(lhs, rhs, sideEffects));
      }
      // `+=` code
      add(lhs, rhs) {
        return this._leafNode(new AssignOp(lhs, exports2.operators.ADD, rhs));
      }
      // appends passed SafeExpr to code or executes Block
      code(c) {
        if (typeof c == "function")
          c();
        else if (c !== code_1.nil)
          this._leafNode(new AnyCode(c));
        return this;
      }
      // returns code for object literal for the passed argument list of key-value pairs
      object(...keyValues) {
        const code = ["{"];
        for (const [key, value] of keyValues) {
          if (code.length > 1)
            code.push(",");
          code.push(key);
          if (key !== value || this.opts.es5) {
            code.push(":");
            (0, code_1.addCodeArg)(code, value);
          }
        }
        code.push("}");
        return new code_1._Code(code);
      }
      // `if` clause (or statement if `thenBody` and, optionally, `elseBody` are passed)
      if(condition, thenBody, elseBody) {
        this._blockNode(new If(condition));
        if (thenBody && elseBody) {
          this.code(thenBody).else().code(elseBody).endIf();
        } else if (thenBody) {
          this.code(thenBody).endIf();
        } else if (elseBody) {
          throw new Error('CodeGen: "else" body without "then" body');
        }
        return this;
      }
      // `else if` clause - invalid without `if` or after `else` clauses
      elseIf(condition) {
        return this._elseNode(new If(condition));
      }
      // `else` clause - only valid after `if` or `else if` clauses
      else() {
        return this._elseNode(new Else());
      }
      // end `if` statement (needed if gen.if was used only with condition)
      endIf() {
        return this._endBlockNode(If, Else);
      }
      _for(node, forBody) {
        this._blockNode(node);
        if (forBody)
          this.code(forBody).endFor();
        return this;
      }
      // a generic `for` clause (or statement if `forBody` is passed)
      for(iteration, forBody) {
        return this._for(new ForLoop(iteration), forBody);
      }
      // `for` statement for a range of values
      forRange(nameOrPrefix, from, to, forBody, varKind = this.opts.es5 ? scope_1.varKinds.var : scope_1.varKinds.let) {
        const name = this._scope.toName(nameOrPrefix);
        return this._for(new ForRange(varKind, name, from, to), () => forBody(name));
      }
      // `for-of` statement (in es5 mode replace with a normal for loop)
      forOf(nameOrPrefix, iterable, forBody, varKind = scope_1.varKinds.const) {
        const name = this._scope.toName(nameOrPrefix);
        if (this.opts.es5) {
          const arr = iterable instanceof code_1.Name ? iterable : this.var("_arr", iterable);
          return this.forRange("_i", 0, (0, code_1._)`${arr}.length`, (i) => {
            this.var(name, (0, code_1._)`${arr}[${i}]`);
            forBody(name);
          });
        }
        return this._for(new ForIter("of", varKind, name, iterable), () => forBody(name));
      }
      // `for-in` statement.
      // With option `ownProperties` replaced with a `for-of` loop for object keys
      forIn(nameOrPrefix, obj, forBody, varKind = this.opts.es5 ? scope_1.varKinds.var : scope_1.varKinds.const) {
        if (this.opts.ownProperties) {
          return this.forOf(nameOrPrefix, (0, code_1._)`Object.keys(${obj})`, forBody);
        }
        const name = this._scope.toName(nameOrPrefix);
        return this._for(new ForIter("in", varKind, name, obj), () => forBody(name));
      }
      // end `for` loop
      endFor() {
        return this._endBlockNode(For);
      }
      // `label` statement
      label(label) {
        return this._leafNode(new Label(label));
      }
      // `break` statement
      break(label) {
        return this._leafNode(new Break(label));
      }
      // `return` statement
      return(value) {
        const node = new Return();
        this._blockNode(node);
        this.code(value);
        if (node.nodes.length !== 1)
          throw new Error('CodeGen: "return" should have one node');
        return this._endBlockNode(Return);
      }
      // `try` statement
      try(tryBody, catchCode, finallyCode) {
        if (!catchCode && !finallyCode)
          throw new Error('CodeGen: "try" without "catch" and "finally"');
        const node = new Try();
        this._blockNode(node);
        this.code(tryBody);
        if (catchCode) {
          const error48 = this.name("e");
          this._currNode = node.catch = new Catch(error48);
          catchCode(error48);
        }
        if (finallyCode) {
          this._currNode = node.finally = new Finally();
          this.code(finallyCode);
        }
        return this._endBlockNode(Catch, Finally);
      }
      // `throw` statement
      throw(error48) {
        return this._leafNode(new Throw(error48));
      }
      // start self-balancing block
      block(body, nodeCount) {
        this._blockStarts.push(this._nodes.length);
        if (body)
          this.code(body).endBlock(nodeCount);
        return this;
      }
      // end the current self-balancing block
      endBlock(nodeCount) {
        const len = this._blockStarts.pop();
        if (len === void 0)
          throw new Error("CodeGen: not in self-balancing block");
        const toClose = this._nodes.length - len;
        if (toClose < 0 || nodeCount !== void 0 && toClose !== nodeCount) {
          throw new Error(`CodeGen: wrong number of nodes: ${toClose} vs ${nodeCount} expected`);
        }
        this._nodes.length = len;
        return this;
      }
      // `function` heading (or definition if funcBody is passed)
      func(name, args = code_1.nil, async, funcBody) {
        this._blockNode(new Func(name, args, async));
        if (funcBody)
          this.code(funcBody).endFunc();
        return this;
      }
      // end function definition
      endFunc() {
        return this._endBlockNode(Func);
      }
      optimize(n = 1) {
        while (n-- > 0) {
          this._root.optimizeNodes();
          this._root.optimizeNames(this._root.names, this._constants);
        }
      }
      _leafNode(node) {
        this._currNode.nodes.push(node);
        return this;
      }
      _blockNode(node) {
        this._currNode.nodes.push(node);
        this._nodes.push(node);
      }
      _endBlockNode(N1, N2) {
        const n = this._currNode;
        if (n instanceof N1 || N2 && n instanceof N2) {
          this._nodes.pop();
          return this;
        }
        throw new Error(`CodeGen: not in block "${N2 ? `${N1.kind}/${N2.kind}` : N1.kind}"`);
      }
      _elseNode(node) {
        const n = this._currNode;
        if (!(n instanceof If)) {
          throw new Error('CodeGen: "else" without "if"');
        }
        this._currNode = n.else = node;
        return this;
      }
      get _root() {
        return this._nodes[0];
      }
      get _currNode() {
        const ns = this._nodes;
        return ns[ns.length - 1];
      }
      set _currNode(node) {
        const ns = this._nodes;
        ns[ns.length - 1] = node;
      }
    };
    exports2.CodeGen = CodeGen;
    function addNames(names, from) {
      for (const n in from)
        names[n] = (names[n] || 0) + (from[n] || 0);
      return names;
    }
    function addExprNames(names, from) {
      return from instanceof code_1._CodeOrName ? addNames(names, from.names) : names;
    }
    function optimizeExpr(expr, names, constants) {
      if (expr instanceof code_1.Name)
        return replaceName(expr);
      if (!canOptimize(expr))
        return expr;
      return new code_1._Code(expr._items.reduce((items, c) => {
        if (c instanceof code_1.Name)
          c = replaceName(c);
        if (c instanceof code_1._Code)
          items.push(...c._items);
        else
          items.push(c);
        return items;
      }, []));
      function replaceName(n) {
        const c = constants[n.str];
        if (c === void 0 || names[n.str] !== 1)
          return n;
        delete names[n.str];
        return c;
      }
      function canOptimize(e) {
        return e instanceof code_1._Code && e._items.some((c) => c instanceof code_1.Name && names[c.str] === 1 && constants[c.str] !== void 0);
      }
    }
    function subtractNames(names, from) {
      for (const n in from)
        names[n] = (names[n] || 0) - (from[n] || 0);
    }
    function not(x) {
      return typeof x == "boolean" || typeof x == "number" || x === null ? !x : (0, code_1._)`!${par(x)}`;
    }
    exports2.not = not;
    var andCode = mappend(exports2.operators.AND);
    function and(...args) {
      return args.reduce(andCode);
    }
    exports2.and = and;
    var orCode = mappend(exports2.operators.OR);
    function or(...args) {
      return args.reduce(orCode);
    }
    exports2.or = or;
    function mappend(op) {
      return (x, y) => x === code_1.nil ? y : y === code_1.nil ? x : (0, code_1._)`${par(x)} ${op} ${par(y)}`;
    }
    function par(x) {
      return x instanceof code_1.Name ? x : (0, code_1._)`(${x})`;
    }
  }
});

// node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/util.js
var require_util4 = __commonJS({
  "node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/util.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.checkStrictMode = exports2.getErrorPath = exports2.Type = exports2.useFunc = exports2.setEvaluated = exports2.evaluatedPropsToName = exports2.mergeEvaluated = exports2.eachItem = exports2.unescapeJsonPointer = exports2.escapeJsonPointer = exports2.escapeFragment = exports2.unescapeFragment = exports2.schemaRefOrVal = exports2.schemaHasRulesButRef = exports2.schemaHasRules = exports2.checkUnknownRules = exports2.alwaysValidSchema = exports2.toHash = void 0;
    var codegen_1 = require_codegen();
    var code_1 = require_code();
    function toHash(arr) {
      const hash2 = {};
      for (const item of arr)
        hash2[item] = true;
      return hash2;
    }
    exports2.toHash = toHash;
    function alwaysValidSchema(it, schema) {
      if (typeof schema == "boolean")
        return schema;
      if (Object.keys(schema).length === 0)
        return true;
      checkUnknownRules(it, schema);
      return !schemaHasRules(schema, it.self.RULES.all);
    }
    exports2.alwaysValidSchema = alwaysValidSchema;
    function checkUnknownRules(it, schema = it.schema) {
      const { opts, self } = it;
      if (!opts.strictSchema)
        return;
      if (typeof schema === "boolean")
        return;
      const rules = self.RULES.keywords;
      for (const key in schema) {
        if (!rules[key])
          checkStrictMode(it, `unknown keyword: "${key}"`);
      }
    }
    exports2.checkUnknownRules = checkUnknownRules;
    function schemaHasRules(schema, rules) {
      if (typeof schema == "boolean")
        return !schema;
      for (const key in schema)
        if (rules[key])
          return true;
      return false;
    }
    exports2.schemaHasRules = schemaHasRules;
    function schemaHasRulesButRef(schema, RULES) {
      if (typeof schema == "boolean")
        return !schema;
      for (const key in schema)
        if (key !== "$ref" && RULES.all[key])
          return true;
      return false;
    }
    exports2.schemaHasRulesButRef = schemaHasRulesButRef;
    function schemaRefOrVal({ topSchemaRef, schemaPath }, schema, keyword, $data) {
      if (!$data) {
        if (typeof schema == "number" || typeof schema == "boolean")
          return schema;
        if (typeof schema == "string")
          return (0, codegen_1._)`${schema}`;
      }
      return (0, codegen_1._)`${topSchemaRef}${schemaPath}${(0, codegen_1.getProperty)(keyword)}`;
    }
    exports2.schemaRefOrVal = schemaRefOrVal;
    function unescapeFragment(str) {
      return unescapeJsonPointer(decodeURIComponent(str));
    }
    exports2.unescapeFragment = unescapeFragment;
    function escapeFragment(str) {
      return encodeURIComponent(escapeJsonPointer(str));
    }
    exports2.escapeFragment = escapeFragment;
    function escapeJsonPointer(str) {
      if (typeof str == "number")
        return `${str}`;
      return str.replace(/~/g, "~0").replace(/\//g, "~1");
    }
    exports2.escapeJsonPointer = escapeJsonPointer;
    function unescapeJsonPointer(str) {
      return str.replace(/~1/g, "/").replace(/~0/g, "~");
    }
    exports2.unescapeJsonPointer = unescapeJsonPointer;
    function eachItem(xs, f) {
      if (Array.isArray(xs)) {
        for (const x of xs)
          f(x);
      } else {
        f(xs);
      }
    }
    exports2.eachItem = eachItem;
    function makeMergeEvaluated({ mergeNames, mergeToName, mergeValues: mergeValues3, resultToName }) {
      return (gen, from, to, toName) => {
        const res = to === void 0 ? from : to instanceof codegen_1.Name ? (from instanceof codegen_1.Name ? mergeNames(gen, from, to) : mergeToName(gen, from, to), to) : from instanceof codegen_1.Name ? (mergeToName(gen, to, from), from) : mergeValues3(from, to);
        return toName === codegen_1.Name && !(res instanceof codegen_1.Name) ? resultToName(gen, res) : res;
      };
    }
    exports2.mergeEvaluated = {
      props: makeMergeEvaluated({
        mergeNames: (gen, from, to) => gen.if((0, codegen_1._)`${to} !== true && ${from} !== undefined`, () => {
          gen.if((0, codegen_1._)`${from} === true`, () => gen.assign(to, true), () => gen.assign(to, (0, codegen_1._)`${to} || {}`).code((0, codegen_1._)`Object.assign(${to}, ${from})`));
        }),
        mergeToName: (gen, from, to) => gen.if((0, codegen_1._)`${to} !== true`, () => {
          if (from === true) {
            gen.assign(to, true);
          } else {
            gen.assign(to, (0, codegen_1._)`${to} || {}`);
            setEvaluated(gen, to, from);
          }
        }),
        mergeValues: (from, to) => from === true ? true : { ...from, ...to },
        resultToName: evaluatedPropsToName
      }),
      items: makeMergeEvaluated({
        mergeNames: (gen, from, to) => gen.if((0, codegen_1._)`${to} !== true && ${from} !== undefined`, () => gen.assign(to, (0, codegen_1._)`${from} === true ? true : ${to} > ${from} ? ${to} : ${from}`)),
        mergeToName: (gen, from, to) => gen.if((0, codegen_1._)`${to} !== true`, () => gen.assign(to, from === true ? true : (0, codegen_1._)`${to} > ${from} ? ${to} : ${from}`)),
        mergeValues: (from, to) => from === true ? true : Math.max(from, to),
        resultToName: (gen, items) => gen.var("items", items)
      })
    };
    function evaluatedPropsToName(gen, ps) {
      if (ps === true)
        return gen.var("props", true);
      const props = gen.var("props", (0, codegen_1._)`{}`);
      if (ps !== void 0)
        setEvaluated(gen, props, ps);
      return props;
    }
    exports2.evaluatedPropsToName = evaluatedPropsToName;
    function setEvaluated(gen, props, ps) {
      Object.keys(ps).forEach((p) => gen.assign((0, codegen_1._)`${props}${(0, codegen_1.getProperty)(p)}`, true));
    }
    exports2.setEvaluated = setEvaluated;
    var snippets = {};
    function useFunc(gen, f) {
      return gen.scopeValue("func", {
        ref: f,
        code: snippets[f.code] || (snippets[f.code] = new code_1._Code(f.code))
      });
    }
    exports2.useFunc = useFunc;
    var Type;
    (function(Type2) {
      Type2[Type2["Num"] = 0] = "Num";
      Type2[Type2["Str"] = 1] = "Str";
    })(Type || (exports2.Type = Type = {}));
    function getErrorPath(dataProp, dataPropType, jsPropertySyntax) {
      if (dataProp instanceof codegen_1.Name) {
        const isNumber = dataPropType === Type.Num;
        return jsPropertySyntax ? isNumber ? (0, codegen_1._)`"[" + ${dataProp} + "]"` : (0, codegen_1._)`"['" + ${dataProp} + "']"` : isNumber ? (0, codegen_1._)`"/" + ${dataProp}` : (0, codegen_1._)`"/" + ${dataProp}.replace(/~/g, "~0").replace(/\\//g, "~1")`;
      }
      return jsPropertySyntax ? (0, codegen_1.getProperty)(dataProp).toString() : "/" + escapeJsonPointer(dataProp);
    }
    exports2.getErrorPath = getErrorPath;
    function checkStrictMode(it, msg, mode = it.opts.strictSchema) {
      if (!mode)
        return;
      msg = `strict mode: ${msg}`;
      if (mode === true)
        throw new Error(msg);
      it.self.logger.warn(msg);
    }
    exports2.checkStrictMode = checkStrictMode;
  }
});

// node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/names.js
var require_names = __commonJS({
  "node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/names.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    var codegen_1 = require_codegen();
    var names = {
      // validation function arguments
      data: new codegen_1.Name("data"),
      // data passed to validation function
      // args passed from referencing schema
      valCxt: new codegen_1.Name("valCxt"),
      // validation/data context - should not be used directly, it is destructured to the names below
      instancePath: new codegen_1.Name("instancePath"),
      parentData: new codegen_1.Name("parentData"),
      parentDataProperty: new codegen_1.Name("parentDataProperty"),
      rootData: new codegen_1.Name("rootData"),
      // root data - same as the data passed to the first/top validation function
      dynamicAnchors: new codegen_1.Name("dynamicAnchors"),
      // used to support recursiveRef and dynamicRef
      // function scoped variables
      vErrors: new codegen_1.Name("vErrors"),
      // null or array of validation errors
      errors: new codegen_1.Name("errors"),
      // counter of validation errors
      this: new codegen_1.Name("this"),
      // "globals"
      self: new codegen_1.Name("self"),
      scope: new codegen_1.Name("scope"),
      // JTD serialize/parse name for JSON string and position
      json: new codegen_1.Name("json"),
      jsonPos: new codegen_1.Name("jsonPos"),
      jsonLen: new codegen_1.Name("jsonLen"),
      jsonPart: new codegen_1.Name("jsonPart")
    };
    exports2.default = names;
  }
});

// node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/errors.js
var require_errors2 = __commonJS({
  "node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/errors.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.extendErrors = exports2.resetErrorsCount = exports2.reportExtraError = exports2.reportError = exports2.keyword$DataError = exports2.keywordError = void 0;
    var codegen_1 = require_codegen();
    var util_1 = require_util4();
    var names_1 = require_names();
    exports2.keywordError = {
      message: ({ keyword }) => (0, codegen_1.str)`must pass "${keyword}" keyword validation`
    };
    exports2.keyword$DataError = {
      message: ({ keyword, schemaType }) => schemaType ? (0, codegen_1.str)`"${keyword}" keyword must be ${schemaType} ($data)` : (0, codegen_1.str)`"${keyword}" keyword is invalid ($data)`
    };
    function reportError(cxt, error48 = exports2.keywordError, errorPaths, overrideAllErrors) {
      const { it } = cxt;
      const { gen, compositeRule, allErrors } = it;
      const errObj = errorObjectCode(cxt, error48, errorPaths);
      if (overrideAllErrors !== null && overrideAllErrors !== void 0 ? overrideAllErrors : compositeRule || allErrors) {
        addError(gen, errObj);
      } else {
        returnErrors(it, (0, codegen_1._)`[${errObj}]`);
      }
    }
    exports2.reportError = reportError;
    function reportExtraError(cxt, error48 = exports2.keywordError, errorPaths) {
      const { it } = cxt;
      const { gen, compositeRule, allErrors } = it;
      const errObj = errorObjectCode(cxt, error48, errorPaths);
      addError(gen, errObj);
      if (!(compositeRule || allErrors)) {
        returnErrors(it, names_1.default.vErrors);
      }
    }
    exports2.reportExtraError = reportExtraError;
    function resetErrorsCount(gen, errsCount) {
      gen.assign(names_1.default.errors, errsCount);
      gen.if((0, codegen_1._)`${names_1.default.vErrors} !== null`, () => gen.if(errsCount, () => gen.assign((0, codegen_1._)`${names_1.default.vErrors}.length`, errsCount), () => gen.assign(names_1.default.vErrors, null)));
    }
    exports2.resetErrorsCount = resetErrorsCount;
    function extendErrors({ gen, keyword, schemaValue, data, errsCount, it }) {
      if (errsCount === void 0)
        throw new Error("ajv implementation error");
      const err = gen.name("err");
      gen.forRange("i", errsCount, names_1.default.errors, (i) => {
        gen.const(err, (0, codegen_1._)`${names_1.default.vErrors}[${i}]`);
        gen.if((0, codegen_1._)`${err}.instancePath === undefined`, () => gen.assign((0, codegen_1._)`${err}.instancePath`, (0, codegen_1.strConcat)(names_1.default.instancePath, it.errorPath)));
        gen.assign((0, codegen_1._)`${err}.schemaPath`, (0, codegen_1.str)`${it.errSchemaPath}/${keyword}`);
        if (it.opts.verbose) {
          gen.assign((0, codegen_1._)`${err}.schema`, schemaValue);
          gen.assign((0, codegen_1._)`${err}.data`, data);
        }
      });
    }
    exports2.extendErrors = extendErrors;
    function addError(gen, errObj) {
      const err = gen.const("err", errObj);
      gen.if((0, codegen_1._)`${names_1.default.vErrors} === null`, () => gen.assign(names_1.default.vErrors, (0, codegen_1._)`[${err}]`), (0, codegen_1._)`${names_1.default.vErrors}.push(${err})`);
      gen.code((0, codegen_1._)`${names_1.default.errors}++`);
    }
    function returnErrors(it, errs) {
      const { gen, validateName, schemaEnv } = it;
      if (schemaEnv.$async) {
        gen.throw((0, codegen_1._)`new ${it.ValidationError}(${errs})`);
      } else {
        gen.assign((0, codegen_1._)`${validateName}.errors`, errs);
        gen.return(false);
      }
    }
    var E = {
      keyword: new codegen_1.Name("keyword"),
      schemaPath: new codegen_1.Name("schemaPath"),
      // also used in JTD errors
      params: new codegen_1.Name("params"),
      propertyName: new codegen_1.Name("propertyName"),
      message: new codegen_1.Name("message"),
      schema: new codegen_1.Name("schema"),
      parentSchema: new codegen_1.Name("parentSchema")
    };
    function errorObjectCode(cxt, error48, errorPaths) {
      const { createErrors } = cxt.it;
      if (createErrors === false)
        return (0, codegen_1._)`{}`;
      return errorObject(cxt, error48, errorPaths);
    }
    function errorObject(cxt, error48, errorPaths = {}) {
      const { gen, it } = cxt;
      const keyValues = [
        errorInstancePath(it, errorPaths),
        errorSchemaPath(cxt, errorPaths)
      ];
      extraErrorProps(cxt, error48, keyValues);
      return gen.object(...keyValues);
    }
    function errorInstancePath({ errorPath }, { instancePath }) {
      const instPath = instancePath ? (0, codegen_1.str)`${errorPath}${(0, util_1.getErrorPath)(instancePath, util_1.Type.Str)}` : errorPath;
      return [names_1.default.instancePath, (0, codegen_1.strConcat)(names_1.default.instancePath, instPath)];
    }
    function errorSchemaPath({ keyword, it: { errSchemaPath } }, { schemaPath, parentSchema }) {
      let schPath = parentSchema ? errSchemaPath : (0, codegen_1.str)`${errSchemaPath}/${keyword}`;
      if (schemaPath) {
        schPath = (0, codegen_1.str)`${schPath}${(0, util_1.getErrorPath)(schemaPath, util_1.Type.Str)}`;
      }
      return [E.schemaPath, schPath];
    }
    function extraErrorProps(cxt, { params, message }, keyValues) {
      const { keyword, data, schemaValue, it } = cxt;
      const { opts, propertyName, topSchemaRef, schemaPath } = it;
      keyValues.push([E.keyword, keyword], [E.params, typeof params == "function" ? params(cxt) : params || (0, codegen_1._)`{}`]);
      if (opts.messages) {
        keyValues.push([E.message, typeof message == "function" ? message(cxt) : message]);
      }
      if (opts.verbose) {
        keyValues.push([E.schema, schemaValue], [E.parentSchema, (0, codegen_1._)`${topSchemaRef}${schemaPath}`], [names_1.default.data, data]);
      }
      if (propertyName)
        keyValues.push([E.propertyName, propertyName]);
    }
  }
});

// node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/boolSchema.js
var require_boolSchema = __commonJS({
  "node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/boolSchema.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.boolOrEmptySchema = exports2.topBoolOrEmptySchema = void 0;
    var errors_1 = require_errors2();
    var codegen_1 = require_codegen();
    var names_1 = require_names();
    var boolError = {
      message: "boolean schema is false"
    };
    function topBoolOrEmptySchema(it) {
      const { gen, schema, validateName } = it;
      if (schema === false) {
        falseSchemaError(it, false);
      } else if (typeof schema == "object" && schema.$async === true) {
        gen.return(names_1.default.data);
      } else {
        gen.assign((0, codegen_1._)`${validateName}.errors`, null);
        gen.return(true);
      }
    }
    exports2.topBoolOrEmptySchema = topBoolOrEmptySchema;
    function boolOrEmptySchema(it, valid) {
      const { gen, schema } = it;
      if (schema === false) {
        gen.var(valid, false);
        falseSchemaError(it);
      } else {
        gen.var(valid, true);
      }
    }
    exports2.boolOrEmptySchema = boolOrEmptySchema;
    function falseSchemaError(it, overrideAllErrors) {
      const { gen, data } = it;
      const cxt = {
        gen,
        keyword: "false schema",
        data,
        schema: false,
        schemaCode: false,
        schemaValue: false,
        params: {},
        it
      };
      (0, errors_1.reportError)(cxt, boolError, void 0, overrideAllErrors);
    }
  }
});

// node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/rules.js
var require_rules = __commonJS({
  "node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/rules.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.getRules = exports2.isJSONType = void 0;
    var _jsonTypes = ["string", "number", "integer", "boolean", "null", "object", "array"];
    var jsonTypes = new Set(_jsonTypes);
    function isJSONType(x) {
      return typeof x == "string" && jsonTypes.has(x);
    }
    exports2.isJSONType = isJSONType;
    function getRules() {
      const groups = {
        number: { type: "number", rules: [] },
        string: { type: "string", rules: [] },
        array: { type: "array", rules: [] },
        object: { type: "object", rules: [] }
      };
      return {
        types: { ...groups, integer: true, boolean: true, null: true },
        rules: [{ rules: [] }, groups.number, groups.string, groups.array, groups.object],
        post: { rules: [] },
        all: {},
        keywords: {}
      };
    }
    exports2.getRules = getRules;
  }
});

// node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/applicability.js
var require_applicability = __commonJS({
  "node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/applicability.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.shouldUseRule = exports2.shouldUseGroup = exports2.schemaHasRulesForType = void 0;
    function schemaHasRulesForType({ schema, self }, type) {
      const group = self.RULES.types[type];
      return group && group !== true && shouldUseGroup(schema, group);
    }
    exports2.schemaHasRulesForType = schemaHasRulesForType;
    function shouldUseGroup(schema, group) {
      return group.rules.some((rule) => shouldUseRule(schema, rule));
    }
    exports2.shouldUseGroup = shouldUseGroup;
    function shouldUseRule(schema, rule) {
      var _a2;
      return schema[rule.keyword] !== void 0 || ((_a2 = rule.definition.implements) === null || _a2 === void 0 ? void 0 : _a2.some((kwd) => schema[kwd] !== void 0));
    }
    exports2.shouldUseRule = shouldUseRule;
  }
});

// node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/dataType.js
var require_dataType = __commonJS({
  "node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/dataType.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.reportTypeError = exports2.checkDataTypes = exports2.checkDataType = exports2.coerceAndCheckDataType = exports2.getJSONTypes = exports2.getSchemaTypes = exports2.DataType = void 0;
    var rules_1 = require_rules();
    var applicability_1 = require_applicability();
    var errors_1 = require_errors2();
    var codegen_1 = require_codegen();
    var util_1 = require_util4();
    var DataType;
    (function(DataType2) {
      DataType2[DataType2["Correct"] = 0] = "Correct";
      DataType2[DataType2["Wrong"] = 1] = "Wrong";
    })(DataType || (exports2.DataType = DataType = {}));
    function getSchemaTypes(schema) {
      const types = getJSONTypes(schema.type);
      const hasNull = types.includes("null");
      if (hasNull) {
        if (schema.nullable === false)
          throw new Error("type: null contradicts nullable: false");
      } else {
        if (!types.length && schema.nullable !== void 0) {
          throw new Error('"nullable" cannot be used without "type"');
        }
        if (schema.nullable === true)
          types.push("null");
      }
      return types;
    }
    exports2.getSchemaTypes = getSchemaTypes;
    function getJSONTypes(ts) {
      const types = Array.isArray(ts) ? ts : ts ? [ts] : [];
      if (types.every(rules_1.isJSONType))
        return types;
      throw new Error("type must be JSONType or JSONType[]: " + types.join(","));
    }
    exports2.getJSONTypes = getJSONTypes;
    function coerceAndCheckDataType(it, types) {
      const { gen, data, opts } = it;
      const coerceTo = coerceToTypes(types, opts.coerceTypes);
      const checkTypes = types.length > 0 && !(coerceTo.length === 0 && types.length === 1 && (0, applicability_1.schemaHasRulesForType)(it, types[0]));
      if (checkTypes) {
        const wrongType = checkDataTypes(types, data, opts.strictNumbers, DataType.Wrong);
        gen.if(wrongType, () => {
          if (coerceTo.length)
            coerceData(it, types, coerceTo);
          else
            reportTypeError(it);
        });
      }
      return checkTypes;
    }
    exports2.coerceAndCheckDataType = coerceAndCheckDataType;
    var COERCIBLE = /* @__PURE__ */ new Set(["string", "number", "integer", "boolean", "null"]);
    function coerceToTypes(types, coerceTypes) {
      return coerceTypes ? types.filter((t) => COERCIBLE.has(t) || coerceTypes === "array" && t === "array") : [];
    }
    function coerceData(it, types, coerceTo) {
      const { gen, data, opts } = it;
      const dataType = gen.let("dataType", (0, codegen_1._)`typeof ${data}`);
      const coerced = gen.let("coerced", (0, codegen_1._)`undefined`);
      if (opts.coerceTypes === "array") {
        gen.if((0, codegen_1._)`${dataType} == 'object' && Array.isArray(${data}) && ${data}.length == 1`, () => gen.assign(data, (0, codegen_1._)`${data}[0]`).assign(dataType, (0, codegen_1._)`typeof ${data}`).if(checkDataTypes(types, data, opts.strictNumbers), () => gen.assign(coerced, data)));
      }
      gen.if((0, codegen_1._)`${coerced} !== undefined`);
      for (const t of coerceTo) {
        if (COERCIBLE.has(t) || t === "array" && opts.coerceTypes === "array") {
          coerceSpecificType(t);
        }
      }
      gen.else();
      reportTypeError(it);
      gen.endIf();
      gen.if((0, codegen_1._)`${coerced} !== undefined`, () => {
        gen.assign(data, coerced);
        assignParentData(it, coerced);
      });
      function coerceSpecificType(t) {
        switch (t) {
          case "string":
            gen.elseIf((0, codegen_1._)`${dataType} == "number" || ${dataType} == "boolean"`).assign(coerced, (0, codegen_1._)`"" + ${data}`).elseIf((0, codegen_1._)`${data} === null`).assign(coerced, (0, codegen_1._)`""`);
            return;
          case "number":
            gen.elseIf((0, codegen_1._)`${dataType} == "boolean" || ${data} === null
              || (${dataType} == "string" && ${data} && ${data} == +${data})`).assign(coerced, (0, codegen_1._)`+${data}`);
            return;
          case "integer":
            gen.elseIf((0, codegen_1._)`${dataType} === "boolean" || ${data} === null
              || (${dataType} === "string" && ${data} && ${data} == +${data} && !(${data} % 1))`).assign(coerced, (0, codegen_1._)`+${data}`);
            return;
          case "boolean":
            gen.elseIf((0, codegen_1._)`${data} === "false" || ${data} === 0 || ${data} === null`).assign(coerced, false).elseIf((0, codegen_1._)`${data} === "true" || ${data} === 1`).assign(coerced, true);
            return;
          case "null":
            gen.elseIf((0, codegen_1._)`${data} === "" || ${data} === 0 || ${data} === false`);
            gen.assign(coerced, null);
            return;
          case "array":
            gen.elseIf((0, codegen_1._)`${dataType} === "string" || ${dataType} === "number"
              || ${dataType} === "boolean" || ${data} === null`).assign(coerced, (0, codegen_1._)`[${data}]`);
        }
      }
    }
    function assignParentData({ gen, parentData, parentDataProperty }, expr) {
      gen.if((0, codegen_1._)`${parentData} !== undefined`, () => gen.assign((0, codegen_1._)`${parentData}[${parentDataProperty}]`, expr));
    }
    function checkDataType(dataType, data, strictNums, correct = DataType.Correct) {
      const EQ = correct === DataType.Correct ? codegen_1.operators.EQ : codegen_1.operators.NEQ;
      let cond;
      switch (dataType) {
        case "null":
          return (0, codegen_1._)`${data} ${EQ} null`;
        case "array":
          cond = (0, codegen_1._)`Array.isArray(${data})`;
          break;
        case "object":
          cond = (0, codegen_1._)`${data} && typeof ${data} == "object" && !Array.isArray(${data})`;
          break;
        case "integer":
          cond = numCond((0, codegen_1._)`!(${data} % 1) && !isNaN(${data})`);
          break;
        case "number":
          cond = numCond();
          break;
        default:
          return (0, codegen_1._)`typeof ${data} ${EQ} ${dataType}`;
      }
      return correct === DataType.Correct ? cond : (0, codegen_1.not)(cond);
      function numCond(_cond = codegen_1.nil) {
        return (0, codegen_1.and)((0, codegen_1._)`typeof ${data} == "number"`, _cond, strictNums ? (0, codegen_1._)`isFinite(${data})` : codegen_1.nil);
      }
    }
    exports2.checkDataType = checkDataType;
    function checkDataTypes(dataTypes, data, strictNums, correct) {
      if (dataTypes.length === 1) {
        return checkDataType(dataTypes[0], data, strictNums, correct);
      }
      let cond;
      const types = (0, util_1.toHash)(dataTypes);
      if (types.array && types.object) {
        const notObj = (0, codegen_1._)`typeof ${data} != "object"`;
        cond = types.null ? notObj : (0, codegen_1._)`!${data} || ${notObj}`;
        delete types.null;
        delete types.array;
        delete types.object;
      } else {
        cond = codegen_1.nil;
      }
      if (types.number)
        delete types.integer;
      for (const t in types)
        cond = (0, codegen_1.and)(cond, checkDataType(t, data, strictNums, correct));
      return cond;
    }
    exports2.checkDataTypes = checkDataTypes;
    var typeError = {
      message: ({ schema }) => `must be ${schema}`,
      params: ({ schema, schemaValue }) => typeof schema == "string" ? (0, codegen_1._)`{type: ${schema}}` : (0, codegen_1._)`{type: ${schemaValue}}`
    };
    function reportTypeError(it) {
      const cxt = getTypeErrorContext(it);
      (0, errors_1.reportError)(cxt, typeError);
    }
    exports2.reportTypeError = reportTypeError;
    function getTypeErrorContext(it) {
      const { gen, data, schema } = it;
      const schemaCode = (0, util_1.schemaRefOrVal)(it, schema, "type");
      return {
        gen,
        keyword: "type",
        data,
        schema: schema.type,
        schemaCode,
        schemaValue: schemaCode,
        parentSchema: schema,
        params: {},
        it
      };
    }
  }
});

// node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/defaults.js
var require_defaults = __commonJS({
  "node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/defaults.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.assignDefaults = void 0;
    var codegen_1 = require_codegen();
    var util_1 = require_util4();
    function assignDefaults(it, ty) {
      const { properties, items } = it.schema;
      if (ty === "object" && properties) {
        for (const key in properties) {
          assignDefault(it, key, properties[key].default);
        }
      } else if (ty === "array" && Array.isArray(items)) {
        items.forEach((sch, i) => assignDefault(it, i, sch.default));
      }
    }
    exports2.assignDefaults = assignDefaults;
    function assignDefault(it, prop, defaultValue) {
      const { gen, compositeRule, data, opts } = it;
      if (defaultValue === void 0)
        return;
      const childData = (0, codegen_1._)`${data}${(0, codegen_1.getProperty)(prop)}`;
      if (compositeRule) {
        (0, util_1.checkStrictMode)(it, `default is ignored for: ${childData}`);
        return;
      }
      let condition = (0, codegen_1._)`${childData} === undefined`;
      if (opts.useDefaults === "empty") {
        condition = (0, codegen_1._)`${condition} || ${childData} === null || ${childData} === ""`;
      }
      gen.if(condition, (0, codegen_1._)`${childData} = ${(0, codegen_1.stringify)(defaultValue)}`);
    }
  }
});

// node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/code.js
var require_code2 = __commonJS({
  "node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/code.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.validateUnion = exports2.validateArray = exports2.usePattern = exports2.callValidateCode = exports2.schemaProperties = exports2.allSchemaProperties = exports2.noPropertyInData = exports2.propertyInData = exports2.isOwnProperty = exports2.hasPropFunc = exports2.reportMissingProp = exports2.checkMissingProp = exports2.checkReportMissingProp = void 0;
    var codegen_1 = require_codegen();
    var util_1 = require_util4();
    var names_1 = require_names();
    var util_2 = require_util4();
    function checkReportMissingProp(cxt, prop) {
      const { gen, data, it } = cxt;
      gen.if(noPropertyInData(gen, data, prop, it.opts.ownProperties), () => {
        cxt.setParams({ missingProperty: (0, codegen_1._)`${prop}` }, true);
        cxt.error();
      });
    }
    exports2.checkReportMissingProp = checkReportMissingProp;
    function checkMissingProp({ gen, data, it: { opts } }, properties, missing) {
      return (0, codegen_1.or)(...properties.map((prop) => (0, codegen_1.and)(noPropertyInData(gen, data, prop, opts.ownProperties), (0, codegen_1._)`${missing} = ${prop}`)));
    }
    exports2.checkMissingProp = checkMissingProp;
    function reportMissingProp(cxt, missing) {
      cxt.setParams({ missingProperty: missing }, true);
      cxt.error();
    }
    exports2.reportMissingProp = reportMissingProp;
    function hasPropFunc(gen) {
      return gen.scopeValue("func", {
        // eslint-disable-next-line @typescript-eslint/unbound-method
        ref: Object.prototype.hasOwnProperty,
        code: (0, codegen_1._)`Object.prototype.hasOwnProperty`
      });
    }
    exports2.hasPropFunc = hasPropFunc;
    function isOwnProperty(gen, data, property) {
      return (0, codegen_1._)`${hasPropFunc(gen)}.call(${data}, ${property})`;
    }
    exports2.isOwnProperty = isOwnProperty;
    function propertyInData(gen, data, property, ownProperties) {
      const cond = (0, codegen_1._)`${data}${(0, codegen_1.getProperty)(property)} !== undefined`;
      return ownProperties ? (0, codegen_1._)`${cond} && ${isOwnProperty(gen, data, property)}` : cond;
    }
    exports2.propertyInData = propertyInData;
    function noPropertyInData(gen, data, property, ownProperties) {
      const cond = (0, codegen_1._)`${data}${(0, codegen_1.getProperty)(property)} === undefined`;
      return ownProperties ? (0, codegen_1.or)(cond, (0, codegen_1.not)(isOwnProperty(gen, data, property))) : cond;
    }
    exports2.noPropertyInData = noPropertyInData;
    function allSchemaProperties(schemaMap) {
      return schemaMap ? Object.keys(schemaMap).filter((p) => p !== "__proto__") : [];
    }
    exports2.allSchemaProperties = allSchemaProperties;
    function schemaProperties(it, schemaMap) {
      return allSchemaProperties(schemaMap).filter((p) => !(0, util_1.alwaysValidSchema)(it, schemaMap[p]));
    }
    exports2.schemaProperties = schemaProperties;
    function callValidateCode({ schemaCode, data, it: { gen, topSchemaRef, schemaPath, errorPath }, it }, func, context, passSchema) {
      const dataAndSchema = passSchema ? (0, codegen_1._)`${schemaCode}, ${data}, ${topSchemaRef}${schemaPath}` : data;
      const valCxt = [
        [names_1.default.instancePath, (0, codegen_1.strConcat)(names_1.default.instancePath, errorPath)],
        [names_1.default.parentData, it.parentData],
        [names_1.default.parentDataProperty, it.parentDataProperty],
        [names_1.default.rootData, names_1.default.rootData]
      ];
      if (it.opts.dynamicRef)
        valCxt.push([names_1.default.dynamicAnchors, names_1.default.dynamicAnchors]);
      const args = (0, codegen_1._)`${dataAndSchema}, ${gen.object(...valCxt)}`;
      return context !== codegen_1.nil ? (0, codegen_1._)`${func}.call(${context}, ${args})` : (0, codegen_1._)`${func}(${args})`;
    }
    exports2.callValidateCode = callValidateCode;
    var newRegExp = (0, codegen_1._)`new RegExp`;
    function usePattern({ gen, it: { opts } }, pattern) {
      const u = opts.unicodeRegExp ? "u" : "";
      const { regExp } = opts.code;
      const rx = regExp(pattern, u);
      return gen.scopeValue("pattern", {
        key: rx.toString(),
        ref: rx,
        code: (0, codegen_1._)`${regExp.code === "new RegExp" ? newRegExp : (0, util_2.useFunc)(gen, regExp)}(${pattern}, ${u})`
      });
    }
    exports2.usePattern = usePattern;
    function validateArray(cxt) {
      const { gen, data, keyword, it } = cxt;
      const valid = gen.name("valid");
      if (it.allErrors) {
        const validArr = gen.let("valid", true);
        validateItems(() => gen.assign(validArr, false));
        return validArr;
      }
      gen.var(valid, true);
      validateItems(() => gen.break());
      return valid;
      function validateItems(notValid) {
        const len = gen.const("len", (0, codegen_1._)`${data}.length`);
        gen.forRange("i", 0, len, (i) => {
          cxt.subschema({
            keyword,
            dataProp: i,
            dataPropType: util_1.Type.Num
          }, valid);
          gen.if((0, codegen_1.not)(valid), notValid);
        });
      }
    }
    exports2.validateArray = validateArray;
    function validateUnion(cxt) {
      const { gen, schema, keyword, it } = cxt;
      if (!Array.isArray(schema))
        throw new Error("ajv implementation error");
      const alwaysValid = schema.some((sch) => (0, util_1.alwaysValidSchema)(it, sch));
      if (alwaysValid && !it.opts.unevaluated)
        return;
      const valid = gen.let("valid", false);
      const schValid = gen.name("_valid");
      gen.block(() => schema.forEach((_sch, i) => {
        const schCxt = cxt.subschema({
          keyword,
          schemaProp: i,
          compositeRule: true
        }, schValid);
        gen.assign(valid, (0, codegen_1._)`${valid} || ${schValid}`);
        const merged = cxt.mergeValidEvaluated(schCxt, schValid);
        if (!merged)
          gen.if((0, codegen_1.not)(valid));
      }));
      cxt.result(valid, () => cxt.reset(), () => cxt.error(true));
    }
    exports2.validateUnion = validateUnion;
  }
});

// node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/keyword.js
var require_keyword = __commonJS({
  "node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/keyword.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.validateKeywordUsage = exports2.validSchemaType = exports2.funcKeywordCode = exports2.macroKeywordCode = void 0;
    var codegen_1 = require_codegen();
    var names_1 = require_names();
    var code_1 = require_code2();
    var errors_1 = require_errors2();
    function macroKeywordCode(cxt, def) {
      const { gen, keyword, schema, parentSchema, it } = cxt;
      const macroSchema = def.macro.call(it.self, schema, parentSchema, it);
      const schemaRef = useKeyword(gen, keyword, macroSchema);
      if (it.opts.validateSchema !== false)
        it.self.validateSchema(macroSchema, true);
      const valid = gen.name("valid");
      cxt.subschema({
        schema: macroSchema,
        schemaPath: codegen_1.nil,
        errSchemaPath: `${it.errSchemaPath}/${keyword}`,
        topSchemaRef: schemaRef,
        compositeRule: true
      }, valid);
      cxt.pass(valid, () => cxt.error(true));
    }
    exports2.macroKeywordCode = macroKeywordCode;
    function funcKeywordCode(cxt, def) {
      var _a2;
      const { gen, keyword, schema, parentSchema, $data, it } = cxt;
      checkAsyncKeyword(it, def);
      const validate2 = !$data && def.compile ? def.compile.call(it.self, schema, parentSchema, it) : def.validate;
      const validateRef = useKeyword(gen, keyword, validate2);
      const valid = gen.let("valid");
      cxt.block$data(valid, validateKeyword);
      cxt.ok((_a2 = def.valid) !== null && _a2 !== void 0 ? _a2 : valid);
      function validateKeyword() {
        if (def.errors === false) {
          assignValid();
          if (def.modifying)
            modifyData(cxt);
          reportErrs(() => cxt.error());
        } else {
          const ruleErrs = def.async ? validateAsync() : validateSync();
          if (def.modifying)
            modifyData(cxt);
          reportErrs(() => addErrs(cxt, ruleErrs));
        }
      }
      function validateAsync() {
        const ruleErrs = gen.let("ruleErrs", null);
        gen.try(() => assignValid((0, codegen_1._)`await `), (e) => gen.assign(valid, false).if((0, codegen_1._)`${e} instanceof ${it.ValidationError}`, () => gen.assign(ruleErrs, (0, codegen_1._)`${e}.errors`), () => gen.throw(e)));
        return ruleErrs;
      }
      function validateSync() {
        const validateErrs = (0, codegen_1._)`${validateRef}.errors`;
        gen.assign(validateErrs, null);
        assignValid(codegen_1.nil);
        return validateErrs;
      }
      function assignValid(_await = def.async ? (0, codegen_1._)`await ` : codegen_1.nil) {
        const passCxt = it.opts.passContext ? names_1.default.this : names_1.default.self;
        const passSchema = !("compile" in def && !$data || def.schema === false);
        gen.assign(valid, (0, codegen_1._)`${_await}${(0, code_1.callValidateCode)(cxt, validateRef, passCxt, passSchema)}`, def.modifying);
      }
      function reportErrs(errors) {
        var _a3;
        gen.if((0, codegen_1.not)((_a3 = def.valid) !== null && _a3 !== void 0 ? _a3 : valid), errors);
      }
    }
    exports2.funcKeywordCode = funcKeywordCode;
    function modifyData(cxt) {
      const { gen, data, it } = cxt;
      gen.if(it.parentData, () => gen.assign(data, (0, codegen_1._)`${it.parentData}[${it.parentDataProperty}]`));
    }
    function addErrs(cxt, errs) {
      const { gen } = cxt;
      gen.if((0, codegen_1._)`Array.isArray(${errs})`, () => {
        gen.assign(names_1.default.vErrors, (0, codegen_1._)`${names_1.default.vErrors} === null ? ${errs} : ${names_1.default.vErrors}.concat(${errs})`).assign(names_1.default.errors, (0, codegen_1._)`${names_1.default.vErrors}.length`);
        (0, errors_1.extendErrors)(cxt);
      }, () => cxt.error());
    }
    function checkAsyncKeyword({ schemaEnv }, def) {
      if (def.async && !schemaEnv.$async)
        throw new Error("async keyword in sync schema");
    }
    function useKeyword(gen, keyword, result) {
      if (result === void 0)
        throw new Error(`keyword "${keyword}" failed to compile`);
      return gen.scopeValue("keyword", typeof result == "function" ? { ref: result } : { ref: result, code: (0, codegen_1.stringify)(result) });
    }
    function validSchemaType(schema, schemaType, allowUndefined = false) {
      return !schemaType.length || schemaType.some((st) => st === "array" ? Array.isArray(schema) : st === "object" ? schema && typeof schema == "object" && !Array.isArray(schema) : typeof schema == st || allowUndefined && typeof schema == "undefined");
    }
    exports2.validSchemaType = validSchemaType;
    function validateKeywordUsage({ schema, opts, self, errSchemaPath }, def, keyword) {
      if (Array.isArray(def.keyword) ? !def.keyword.includes(keyword) : def.keyword !== keyword) {
        throw new Error("ajv implementation error");
      }
      const deps = def.dependencies;
      if (deps === null || deps === void 0 ? void 0 : deps.some((kwd) => !Object.prototype.hasOwnProperty.call(schema, kwd))) {
        throw new Error(`parent schema must have dependencies of ${keyword}: ${deps.join(",")}`);
      }
      if (def.validateSchema) {
        const valid = def.validateSchema(schema[keyword]);
        if (!valid) {
          const msg = `keyword "${keyword}" value is invalid at path "${errSchemaPath}": ` + self.errorsText(def.validateSchema.errors);
          if (opts.validateSchema === "log")
            self.logger.error(msg);
          else
            throw new Error(msg);
        }
      }
    }
    exports2.validateKeywordUsage = validateKeywordUsage;
  }
});

// node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/subschema.js
var require_subschema = __commonJS({
  "node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/subschema.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.extendSubschemaMode = exports2.extendSubschemaData = exports2.getSubschema = void 0;
    var codegen_1 = require_codegen();
    var util_1 = require_util4();
    function getSubschema(it, { keyword, schemaProp, schema, schemaPath, errSchemaPath, topSchemaRef }) {
      if (keyword !== void 0 && schema !== void 0) {
        throw new Error('both "keyword" and "schema" passed, only one allowed');
      }
      if (keyword !== void 0) {
        const sch = it.schema[keyword];
        return schemaProp === void 0 ? {
          schema: sch,
          schemaPath: (0, codegen_1._)`${it.schemaPath}${(0, codegen_1.getProperty)(keyword)}`,
          errSchemaPath: `${it.errSchemaPath}/${keyword}`
        } : {
          schema: sch[schemaProp],
          schemaPath: (0, codegen_1._)`${it.schemaPath}${(0, codegen_1.getProperty)(keyword)}${(0, codegen_1.getProperty)(schemaProp)}`,
          errSchemaPath: `${it.errSchemaPath}/${keyword}/${(0, util_1.escapeFragment)(schemaProp)}`
        };
      }
      if (schema !== void 0) {
        if (schemaPath === void 0 || errSchemaPath === void 0 || topSchemaRef === void 0) {
          throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');
        }
        return {
          schema,
          schemaPath,
          topSchemaRef,
          errSchemaPath
        };
      }
      throw new Error('either "keyword" or "schema" must be passed');
    }
    exports2.getSubschema = getSubschema;
    function extendSubschemaData(subschema, it, { dataProp, dataPropType: dpType, data, dataTypes, propertyName }) {
      if (data !== void 0 && dataProp !== void 0) {
        throw new Error('both "data" and "dataProp" passed, only one allowed');
      }
      const { gen } = it;
      if (dataProp !== void 0) {
        const { errorPath, dataPathArr, opts } = it;
        const nextData = gen.let("data", (0, codegen_1._)`${it.data}${(0, codegen_1.getProperty)(dataProp)}`, true);
        dataContextProps(nextData);
        subschema.errorPath = (0, codegen_1.str)`${errorPath}${(0, util_1.getErrorPath)(dataProp, dpType, opts.jsPropertySyntax)}`;
        subschema.parentDataProperty = (0, codegen_1._)`${dataProp}`;
        subschema.dataPathArr = [...dataPathArr, subschema.parentDataProperty];
      }
      if (data !== void 0) {
        const nextData = data instanceof codegen_1.Name ? data : gen.let("data", data, true);
        dataContextProps(nextData);
        if (propertyName !== void 0)
          subschema.propertyName = propertyName;
      }
      if (dataTypes)
        subschema.dataTypes = dataTypes;
      function dataContextProps(_nextData) {
        subschema.data = _nextData;
        subschema.dataLevel = it.dataLevel + 1;
        subschema.dataTypes = [];
        it.definedProperties = /* @__PURE__ */ new Set();
        subschema.parentData = it.data;
        subschema.dataNames = [...it.dataNames, _nextData];
      }
    }
    exports2.extendSubschemaData = extendSubschemaData;
    function extendSubschemaMode(subschema, { jtdDiscriminator, jtdMetadata, compositeRule, createErrors, allErrors }) {
      if (compositeRule !== void 0)
        subschema.compositeRule = compositeRule;
      if (createErrors !== void 0)
        subschema.createErrors = createErrors;
      if (allErrors !== void 0)
        subschema.allErrors = allErrors;
      subschema.jtdDiscriminator = jtdDiscriminator;
      subschema.jtdMetadata = jtdMetadata;
    }
    exports2.extendSubschemaMode = extendSubschemaMode;
  }
});

// node_modules/fast-deep-equal/index.js
var require_fast_deep_equal = __commonJS({
  "node_modules/fast-deep-equal/index.js"(exports2, module2) {
    "use strict";
    module2.exports = function equal(a, b) {
      if (a === b) return true;
      if (a && b && typeof a == "object" && typeof b == "object") {
        if (a.constructor !== b.constructor) return false;
        var length, i, keys;
        if (Array.isArray(a)) {
          length = a.length;
          if (length != b.length) return false;
          for (i = length; i-- !== 0; )
            if (!equal(a[i], b[i])) return false;
          return true;
        }
        if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;
        if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();
        if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();
        keys = Object.keys(a);
        length = keys.length;
        if (length !== Object.keys(b).length) return false;
        for (i = length; i-- !== 0; )
          if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;
        for (i = length; i-- !== 0; ) {
          var key = keys[i];
          if (!equal(a[key], b[key])) return false;
        }
        return true;
      }
      return a !== a && b !== b;
    };
  }
});

// node_modules/@modelcontextprotocol/sdk/node_modules/json-schema-traverse/index.js
var require_json_schema_traverse = __commonJS({
  "node_modules/@modelcontextprotocol/sdk/node_modules/json-schema-traverse/index.js"(exports2, module2) {
    "use strict";
    var traverse = module2.exports = function(schema, opts, cb) {
      if (typeof opts == "function") {
        cb = opts;
        opts = {};
      }
      cb = opts.cb || cb;
      var pre = typeof cb == "function" ? cb : cb.pre || function() {
      };
      var post = cb.post || function() {
      };
      _traverse(opts, pre, post, schema, "", schema);
    };
    traverse.keywords = {
      additionalItems: true,
      items: true,
      contains: true,
      additionalProperties: true,
      propertyNames: true,
      not: true,
      if: true,
      then: true,
      else: true
    };
    traverse.arrayKeywords = {
      items: true,
      allOf: true,
      anyOf: true,
      oneOf: true
    };
    traverse.propsKeywords = {
      $defs: true,
      definitions: true,
      properties: true,
      patternProperties: true,
      dependencies: true
    };
    traverse.skipKeywords = {
      default: true,
      enum: true,
      const: true,
      required: true,
      maximum: true,
      minimum: true,
      exclusiveMaximum: true,
      exclusiveMinimum: true,
      multipleOf: true,
      maxLength: true,
      minLength: true,
      pattern: true,
      format: true,
      maxItems: true,
      minItems: true,
      uniqueItems: true,
      maxProperties: true,
      minProperties: true
    };
    function _traverse(opts, pre, post, schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex) {
      if (schema && typeof schema == "object" && !Array.isArray(schema)) {
        pre(schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex);
        for (var key in schema) {
          var sch = schema[key];
          if (Array.isArray(sch)) {
            if (key in traverse.arrayKeywords) {
              for (var i = 0; i < sch.length; i++)
                _traverse(opts, pre, post, sch[i], jsonPtr + "/" + key + "/" + i, rootSchema, jsonPtr, key, schema, i);
            }
          } else if (key in traverse.propsKeywords) {
            if (sch && typeof sch == "object") {
              for (var prop in sch)
                _traverse(opts, pre, post, sch[prop], jsonPtr + "/" + key + "/" + escapeJsonPtr(prop), rootSchema, jsonPtr, key, schema, prop);
            }
          } else if (key in traverse.keywords || opts.allKeys && !(key in traverse.skipKeywords)) {
            _traverse(opts, pre, post, sch, jsonPtr + "/" + key, rootSchema, jsonPtr, key, schema);
          }
        }
        post(schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex);
      }
    }
    function escapeJsonPtr(str) {
      return str.replace(/~/g, "~0").replace(/\//g, "~1");
    }
  }
});

// node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/resolve.js
var require_resolve = __commonJS({
  "node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/resolve.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.getSchemaRefs = exports2.resolveUrl = exports2.normalizeId = exports2._getFullPath = exports2.getFullPath = exports2.inlineRef = void 0;
    var util_1 = require_util4();
    var equal = require_fast_deep_equal();
    var traverse = require_json_schema_traverse();
    var SIMPLE_INLINED = /* @__PURE__ */ new Set([
      "type",
      "format",
      "pattern",
      "maxLength",
      "minLength",
      "maxProperties",
      "minProperties",
      "maxItems",
      "minItems",
      "maximum",
      "minimum",
      "uniqueItems",
      "multipleOf",
      "required",
      "enum",
      "const"
    ]);
    function inlineRef(schema, limit = true) {
      if (typeof schema == "boolean")
        return true;
      if (limit === true)
        return !hasRef(schema);
      if (!limit)
        return false;
      return countKeys(schema) <= limit;
    }
    exports2.inlineRef = inlineRef;
    var REF_KEYWORDS = /* @__PURE__ */ new Set([
      "$ref",
      "$recursiveRef",
      "$recursiveAnchor",
      "$dynamicRef",
      "$dynamicAnchor"
    ]);
    function hasRef(schema) {
      for (const key in schema) {
        if (REF_KEYWORDS.has(key))
          return true;
        const sch = schema[key];
        if (Array.isArray(sch) && sch.some(hasRef))
          return true;
        if (typeof sch == "object" && hasRef(sch))
          return true;
      }
      return false;
    }
    function countKeys(schema) {
      let count = 0;
      for (const key in schema) {
        if (key === "$ref")
          return Infinity;
        count++;
        if (SIMPLE_INLINED.has(key))
          continue;
        if (typeof schema[key] == "object") {
          (0, util_1.eachItem)(schema[key], (sch) => count += countKeys(sch));
        }
        if (count === Infinity)
          return Infinity;
      }
      return count;
    }
    function getFullPath(resolver, id = "", normalize) {
      if (normalize !== false)
        id = normalizeId(id);
      const p = resolver.parse(id);
      return _getFullPath(resolver, p);
    }
    exports2.getFullPath = getFullPath;
    function _getFullPath(resolver, p) {
      const serialized = resolver.serialize(p);
      return serialized.split("#")[0] + "#";
    }
    exports2._getFullPath = _getFullPath;
    var TRAILING_SLASH_HASH = /#\/?$/;
    function normalizeId(id) {
      return id ? id.replace(TRAILING_SLASH_HASH, "") : "";
    }
    exports2.normalizeId = normalizeId;
    function resolveUrl(resolver, baseId, id) {
      id = normalizeId(id);
      return resolver.resolve(baseId, id);
    }
    exports2.resolveUrl = resolveUrl;
    var ANCHOR = /^[a-z_][-a-z0-9._]*$/i;
    function getSchemaRefs(schema, baseId) {
      if (typeof schema == "boolean")
        return {};
      const { schemaId, uriResolver } = this.opts;
      const schId = normalizeId(schema[schemaId] || baseId);
      const baseIds = { "": schId };
      const pathPrefix = getFullPath(uriResolver, schId, false);
      const localRefs = {};
      const schemaRefs = /* @__PURE__ */ new Set();
      traverse(schema, { allKeys: true }, (sch, jsonPtr, _, parentJsonPtr) => {
        if (parentJsonPtr === void 0)
          return;
        const fullPath = pathPrefix + jsonPtr;
        let innerBaseId = baseIds[parentJsonPtr];
        if (typeof sch[schemaId] == "string")
          innerBaseId = addRef.call(this, sch[schemaId]);
        addAnchor.call(this, sch.$anchor);
        addAnchor.call(this, sch.$dynamicAnchor);
        baseIds[jsonPtr] = innerBaseId;
        function addRef(ref) {
          const _resolve = this.opts.uriResolver.resolve;
          ref = normalizeId(innerBaseId ? _resolve(innerBaseId, ref) : ref);
          if (schemaRefs.has(ref))
            throw ambiguos(ref);
          schemaRefs.add(ref);
          let schOrRef = this.refs[ref];
          if (typeof schOrRef == "string")
            schOrRef = this.refs[schOrRef];
          if (typeof schOrRef == "object") {
            checkAmbiguosRef(sch, schOrRef.schema, ref);
          } else if (ref !== normalizeId(fullPath)) {
            if (ref[0] === "#") {
              checkAmbiguosRef(sch, localRefs[ref], ref);
              localRefs[ref] = sch;
            } else {
              this.refs[ref] = fullPath;
            }
          }
          return ref;
        }
        function addAnchor(anchor) {
          if (typeof anchor == "string") {
            if (!ANCHOR.test(anchor))
              throw new Error(`invalid anchor "${anchor}"`);
            addRef.call(this, `#${anchor}`);
          }
        }
      });
      return localRefs;
      function checkAmbiguosRef(sch1, sch2, ref) {
        if (sch2 !== void 0 && !equal(sch1, sch2))
          throw ambiguos(ref);
      }
      function ambiguos(ref) {
        return new Error(`reference "${ref}" resolves to more than one schema`);
      }
    }
    exports2.getSchemaRefs = getSchemaRefs;
  }
});

// node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/index.js
var require_validate = __commonJS({
  "node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/index.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.getData = exports2.KeywordCxt = exports2.validateFunctionCode = void 0;
    var boolSchema_1 = require_boolSchema();
    var dataType_1 = require_dataType();
    var applicability_1 = require_applicability();
    var dataType_2 = require_dataType();
    var defaults_1 = require_defaults();
    var keyword_1 = require_keyword();
    var subschema_1 = require_subschema();
    var codegen_1 = require_codegen();
    var names_1 = require_names();
    var resolve_1 = require_resolve();
    var util_1 = require_util4();
    var errors_1 = require_errors2();
    function validateFunctionCode(it) {
      if (isSchemaObj(it)) {
        checkKeywords(it);
        if (schemaCxtHasRules(it)) {
          topSchemaObjCode(it);
          return;
        }
      }
      validateFunction(it, () => (0, boolSchema_1.topBoolOrEmptySchema)(it));
    }
    exports2.validateFunctionCode = validateFunctionCode;
    function validateFunction({ gen, validateName, schema, schemaEnv, opts }, body) {
      if (opts.code.es5) {
        gen.func(validateName, (0, codegen_1._)`${names_1.default.data}, ${names_1.default.valCxt}`, schemaEnv.$async, () => {
          gen.code((0, codegen_1._)`"use strict"; ${funcSourceUrl(schema, opts)}`);
          destructureValCxtES5(gen, opts);
          gen.code(body);
        });
      } else {
        gen.func(validateName, (0, codegen_1._)`${names_1.default.data}, ${destructureValCxt(opts)}`, schemaEnv.$async, () => gen.code(funcSourceUrl(schema, opts)).code(body));
      }
    }
    function destructureValCxt(opts) {
      return (0, codegen_1._)`{${names_1.default.instancePath}="", ${names_1.default.parentData}, ${names_1.default.parentDataProperty}, ${names_1.default.rootData}=${names_1.default.data}${opts.dynamicRef ? (0, codegen_1._)`, ${names_1.default.dynamicAnchors}={}` : codegen_1.nil}}={}`;
    }
    function destructureValCxtES5(gen, opts) {
      gen.if(names_1.default.valCxt, () => {
        gen.var(names_1.default.instancePath, (0, codegen_1._)`${names_1.default.valCxt}.${names_1.default.instancePath}`);
        gen.var(names_1.default.parentData, (0, codegen_1._)`${names_1.default.valCxt}.${names_1.default.parentData}`);
        gen.var(names_1.default.parentDataProperty, (0, codegen_1._)`${names_1.default.valCxt}.${names_1.default.parentDataProperty}`);
        gen.var(names_1.default.rootData, (0, codegen_1._)`${names_1.default.valCxt}.${names_1.default.rootData}`);
        if (opts.dynamicRef)
          gen.var(names_1.default.dynamicAnchors, (0, codegen_1._)`${names_1.default.valCxt}.${names_1.default.dynamicAnchors}`);
      }, () => {
        gen.var(names_1.default.instancePath, (0, codegen_1._)`""`);
        gen.var(names_1.default.parentData, (0, codegen_1._)`undefined`);
        gen.var(names_1.default.parentDataProperty, (0, codegen_1._)`undefined`);
        gen.var(names_1.default.rootData, names_1.default.data);
        if (opts.dynamicRef)
          gen.var(names_1.default.dynamicAnchors, (0, codegen_1._)`{}`);
      });
    }
    function topSchemaObjCode(it) {
      const { schema, opts, gen } = it;
      validateFunction(it, () => {
        if (opts.$comment && schema.$comment)
          commentKeyword(it);
        checkNoDefault(it);
        gen.let(names_1.default.vErrors, null);
        gen.let(names_1.default.errors, 0);
        if (opts.unevaluated)
          resetEvaluated(it);
        typeAndKeywords(it);
        returnResults(it);
      });
      return;
    }
    function resetEvaluated(it) {
      const { gen, validateName } = it;
      it.evaluated = gen.const("evaluated", (0, codegen_1._)`${validateName}.evaluated`);
      gen.if((0, codegen_1._)`${it.evaluated}.dynamicProps`, () => gen.assign((0, codegen_1._)`${it.evaluated}.props`, (0, codegen_1._)`undefined`));
      gen.if((0, codegen_1._)`${it.evaluated}.dynamicItems`, () => gen.assign((0, codegen_1._)`${it.evaluated}.items`, (0, codegen_1._)`undefined`));
    }
    function funcSourceUrl(schema, opts) {
      const schId = typeof schema == "object" && schema[opts.schemaId];
      return schId && (opts.code.source || opts.code.process) ? (0, codegen_1._)`/*# sourceURL=${schId} */` : codegen_1.nil;
    }
    function subschemaCode(it, valid) {
      if (isSchemaObj(it)) {
        checkKeywords(it);
        if (schemaCxtHasRules(it)) {
          subSchemaObjCode(it, valid);
          return;
        }
      }
      (0, boolSchema_1.boolOrEmptySchema)(it, valid);
    }
    function schemaCxtHasRules({ schema, self }) {
      if (typeof schema == "boolean")
        return !schema;
      for (const key in schema)
        if (self.RULES.all[key])
          return true;
      return false;
    }
    function isSchemaObj(it) {
      return typeof it.schema != "boolean";
    }
    function subSchemaObjCode(it, valid) {
      const { schema, gen, opts } = it;
      if (opts.$comment && schema.$comment)
        commentKeyword(it);
      updateContext(it);
      checkAsyncSchema(it);
      const errsCount = gen.const("_errs", names_1.default.errors);
      typeAndKeywords(it, errsCount);
      gen.var(valid, (0, codegen_1._)`${errsCount} === ${names_1.default.errors}`);
    }
    function checkKeywords(it) {
      (0, util_1.checkUnknownRules)(it);
      checkRefsAndKeywords(it);
    }
    function typeAndKeywords(it, errsCount) {
      if (it.opts.jtd)
        return schemaKeywords(it, [], false, errsCount);
      const types = (0, dataType_1.getSchemaTypes)(it.schema);
      const checkedTypes = (0, dataType_1.coerceAndCheckDataType)(it, types);
      schemaKeywords(it, types, !checkedTypes, errsCount);
    }
    function checkRefsAndKeywords(it) {
      const { schema, errSchemaPath, opts, self } = it;
      if (schema.$ref && opts.ignoreKeywordsWithRef && (0, util_1.schemaHasRulesButRef)(schema, self.RULES)) {
        self.logger.warn(`$ref: keywords ignored in schema at path "${errSchemaPath}"`);
      }
    }
    function checkNoDefault(it) {
      const { schema, opts } = it;
      if (schema.default !== void 0 && opts.useDefaults && opts.strictSchema) {
        (0, util_1.checkStrictMode)(it, "default is ignored in the schema root");
      }
    }
    function updateContext(it) {
      const schId = it.schema[it.opts.schemaId];
      if (schId)
        it.baseId = (0, resolve_1.resolveUrl)(it.opts.uriResolver, it.baseId, schId);
    }
    function checkAsyncSchema(it) {
      if (it.schema.$async && !it.schemaEnv.$async)
        throw new Error("async schema in sync schema");
    }
    function commentKeyword({ gen, schemaEnv, schema, errSchemaPath, opts }) {
      const msg = schema.$comment;
      if (opts.$comment === true) {
        gen.code((0, codegen_1._)`${names_1.default.self}.logger.log(${msg})`);
      } else if (typeof opts.$comment == "function") {
        const schemaPath = (0, codegen_1.str)`${errSchemaPath}/$comment`;
        const rootName = gen.scopeValue("root", { ref: schemaEnv.root });
        gen.code((0, codegen_1._)`${names_1.default.self}.opts.$comment(${msg}, ${schemaPath}, ${rootName}.schema)`);
      }
    }
    function returnResults(it) {
      const { gen, schemaEnv, validateName, ValidationError, opts } = it;
      if (schemaEnv.$async) {
        gen.if((0, codegen_1._)`${names_1.default.errors} === 0`, () => gen.return(names_1.default.data), () => gen.throw((0, codegen_1._)`new ${ValidationError}(${names_1.default.vErrors})`));
      } else {
        gen.assign((0, codegen_1._)`${validateName}.errors`, names_1.default.vErrors);
        if (opts.unevaluated)
          assignEvaluated(it);
        gen.return((0, codegen_1._)`${names_1.default.errors} === 0`);
      }
    }
    function assignEvaluated({ gen, evaluated, props, items }) {
      if (props instanceof codegen_1.Name)
        gen.assign((0, codegen_1._)`${evaluated}.props`, props);
      if (items instanceof codegen_1.Name)
        gen.assign((0, codegen_1._)`${evaluated}.items`, items);
    }
    function schemaKeywords(it, types, typeErrors, errsCount) {
      const { gen, schema, data, allErrors, opts, self } = it;
      const { RULES } = self;
      if (schema.$ref && (opts.ignoreKeywordsWithRef || !(0, util_1.schemaHasRulesButRef)(schema, RULES))) {
        gen.block(() => keywordCode(it, "$ref", RULES.all.$ref.definition));
        return;
      }
      if (!opts.jtd)
        checkStrictTypes(it, types);
      gen.block(() => {
        for (const group of RULES.rules)
          groupKeywords(group);
        groupKeywords(RULES.post);
      });
      function groupKeywords(group) {
        if (!(0, applicability_1.shouldUseGroup)(schema, group))
          return;
        if (group.type) {
          gen.if((0, dataType_2.checkDataType)(group.type, data, opts.strictNumbers));
          iterateKeywords(it, group);
          if (types.length === 1 && types[0] === group.type && typeErrors) {
            gen.else();
            (0, dataType_2.reportTypeError)(it);
          }
          gen.endIf();
        } else {
          iterateKeywords(it, group);
        }
        if (!allErrors)
          gen.if((0, codegen_1._)`${names_1.default.errors} === ${errsCount || 0}`);
      }
    }
    function iterateKeywords(it, group) {
      const { gen, schema, opts: { useDefaults } } = it;
      if (useDefaults)
        (0, defaults_1.assignDefaults)(it, group.type);
      gen.block(() => {
        for (const rule of group.rules) {
          if ((0, applicability_1.shouldUseRule)(schema, rule)) {
            keywordCode(it, rule.keyword, rule.definition, group.type);
          }
        }
      });
    }
    function checkStrictTypes(it, types) {
      if (it.schemaEnv.meta || !it.opts.strictTypes)
        return;
      checkContextTypes(it, types);
      if (!it.opts.allowUnionTypes)
        checkMultipleTypes(it, types);
      checkKeywordTypes(it, it.dataTypes);
    }
    function checkContextTypes(it, types) {
      if (!types.length)
        return;
      if (!it.dataTypes.length) {
        it.dataTypes = types;
        return;
      }
      types.forEach((t) => {
        if (!includesType(it.dataTypes, t)) {
          strictTypesError(it, `type "${t}" not allowed by context "${it.dataTypes.join(",")}"`);
        }
      });
      narrowSchemaTypes(it, types);
    }
    function checkMultipleTypes(it, ts) {
      if (ts.length > 1 && !(ts.length === 2 && ts.includes("null"))) {
        strictTypesError(it, "use allowUnionTypes to allow union type keyword");
      }
    }
    function checkKeywordTypes(it, ts) {
      const rules = it.self.RULES.all;
      for (const keyword in rules) {
        const rule = rules[keyword];
        if (typeof rule == "object" && (0, applicability_1.shouldUseRule)(it.schema, rule)) {
          const { type } = rule.definition;
          if (type.length && !type.some((t) => hasApplicableType(ts, t))) {
            strictTypesError(it, `missing type "${type.join(",")}" for keyword "${keyword}"`);
          }
        }
      }
    }
    function hasApplicableType(schTs, kwdT) {
      return schTs.includes(kwdT) || kwdT === "number" && schTs.includes("integer");
    }
    function includesType(ts, t) {
      return ts.includes(t) || t === "integer" && ts.includes("number");
    }
    function narrowSchemaTypes(it, withTypes) {
      const ts = [];
      for (const t of it.dataTypes) {
        if (includesType(withTypes, t))
          ts.push(t);
        else if (withTypes.includes("integer") && t === "number")
          ts.push("integer");
      }
      it.dataTypes = ts;
    }
    function strictTypesError(it, msg) {
      const schemaPath = it.schemaEnv.baseId + it.errSchemaPath;
      msg += ` at "${schemaPath}" (strictTypes)`;
      (0, util_1.checkStrictMode)(it, msg, it.opts.strictTypes);
    }
    var KeywordCxt = class {
      constructor(it, def, keyword) {
        (0, keyword_1.validateKeywordUsage)(it, def, keyword);
        this.gen = it.gen;
        this.allErrors = it.allErrors;
        this.keyword = keyword;
        this.data = it.data;
        this.schema = it.schema[keyword];
        this.$data = def.$data && it.opts.$data && this.schema && this.schema.$data;
        this.schemaValue = (0, util_1.schemaRefOrVal)(it, this.schema, keyword, this.$data);
        this.schemaType = def.schemaType;
        this.parentSchema = it.schema;
        this.params = {};
        this.it = it;
        this.def = def;
        if (this.$data) {
          this.schemaCode = it.gen.const("vSchema", getData(this.$data, it));
        } else {
          this.schemaCode = this.schemaValue;
          if (!(0, keyword_1.validSchemaType)(this.schema, def.schemaType, def.allowUndefined)) {
            throw new Error(`${keyword} value must be ${JSON.stringify(def.schemaType)}`);
          }
        }
        if ("code" in def ? def.trackErrors : def.errors !== false) {
          this.errsCount = it.gen.const("_errs", names_1.default.errors);
        }
      }
      result(condition, successAction, failAction) {
        this.failResult((0, codegen_1.not)(condition), successAction, failAction);
      }
      failResult(condition, successAction, failAction) {
        this.gen.if(condition);
        if (failAction)
          failAction();
        else
          this.error();
        if (successAction) {
          this.gen.else();
          successAction();
          if (this.allErrors)
            this.gen.endIf();
        } else {
          if (this.allErrors)
            this.gen.endIf();
          else
            this.gen.else();
        }
      }
      pass(condition, failAction) {
        this.failResult((0, codegen_1.not)(condition), void 0, failAction);
      }
      fail(condition) {
        if (condition === void 0) {
          this.error();
          if (!this.allErrors)
            this.gen.if(false);
          return;
        }
        this.gen.if(condition);
        this.error();
        if (this.allErrors)
          this.gen.endIf();
        else
          this.gen.else();
      }
      fail$data(condition) {
        if (!this.$data)
          return this.fail(condition);
        const { schemaCode } = this;
        this.fail((0, codegen_1._)`${schemaCode} !== undefined && (${(0, codegen_1.or)(this.invalid$data(), condition)})`);
      }
      error(append, errorParams, errorPaths) {
        if (errorParams) {
          this.setParams(errorParams);
          this._error(append, errorPaths);
          this.setParams({});
          return;
        }
        this._error(append, errorPaths);
      }
      _error(append, errorPaths) {
        ;
        (append ? errors_1.reportExtraError : errors_1.reportError)(this, this.def.error, errorPaths);
      }
      $dataError() {
        (0, errors_1.reportError)(this, this.def.$dataError || errors_1.keyword$DataError);
      }
      reset() {
        if (this.errsCount === void 0)
          throw new Error('add "trackErrors" to keyword definition');
        (0, errors_1.resetErrorsCount)(this.gen, this.errsCount);
      }
      ok(cond) {
        if (!this.allErrors)
          this.gen.if(cond);
      }
      setParams(obj, assign) {
        if (assign)
          Object.assign(this.params, obj);
        else
          this.params = obj;
      }
      block$data(valid, codeBlock, $dataValid = codegen_1.nil) {
        this.gen.block(() => {
          this.check$data(valid, $dataValid);
          codeBlock();
        });
      }
      check$data(valid = codegen_1.nil, $dataValid = codegen_1.nil) {
        if (!this.$data)
          return;
        const { gen, schemaCode, schemaType, def } = this;
        gen.if((0, codegen_1.or)((0, codegen_1._)`${schemaCode} === undefined`, $dataValid));
        if (valid !== codegen_1.nil)
          gen.assign(valid, true);
        if (schemaType.length || def.validateSchema) {
          gen.elseIf(this.invalid$data());
          this.$dataError();
          if (valid !== codegen_1.nil)
            gen.assign(valid, false);
        }
        gen.else();
      }
      invalid$data() {
        const { gen, schemaCode, schemaType, def, it } = this;
        return (0, codegen_1.or)(wrong$DataType(), invalid$DataSchema());
        function wrong$DataType() {
          if (schemaType.length) {
            if (!(schemaCode instanceof codegen_1.Name))
              throw new Error("ajv implementation error");
            const st = Array.isArray(schemaType) ? schemaType : [schemaType];
            return (0, codegen_1._)`${(0, dataType_2.checkDataTypes)(st, schemaCode, it.opts.strictNumbers, dataType_2.DataType.Wrong)}`;
          }
          return codegen_1.nil;
        }
        function invalid$DataSchema() {
          if (def.validateSchema) {
            const validateSchemaRef = gen.scopeValue("validate$data", { ref: def.validateSchema });
            return (0, codegen_1._)`!${validateSchemaRef}(${schemaCode})`;
          }
          return codegen_1.nil;
        }
      }
      subschema(appl, valid) {
        const subschema = (0, subschema_1.getSubschema)(this.it, appl);
        (0, subschema_1.extendSubschemaData)(subschema, this.it, appl);
        (0, subschema_1.extendSubschemaMode)(subschema, appl);
        const nextContext = { ...this.it, ...subschema, items: void 0, props: void 0 };
        subschemaCode(nextContext, valid);
        return nextContext;
      }
      mergeEvaluated(schemaCxt, toName) {
        const { it, gen } = this;
        if (!it.opts.unevaluated)
          return;
        if (it.props !== true && schemaCxt.props !== void 0) {
          it.props = util_1.mergeEvaluated.props(gen, schemaCxt.props, it.props, toName);
        }
        if (it.items !== true && schemaCxt.items !== void 0) {
          it.items = util_1.mergeEvaluated.items(gen, schemaCxt.items, it.items, toName);
        }
      }
      mergeValidEvaluated(schemaCxt, valid) {
        const { it, gen } = this;
        if (it.opts.unevaluated && (it.props !== true || it.items !== true)) {
          gen.if(valid, () => this.mergeEvaluated(schemaCxt, codegen_1.Name));
          return true;
        }
      }
    };
    exports2.KeywordCxt = KeywordCxt;
    function keywordCode(it, keyword, def, ruleType) {
      const cxt = new KeywordCxt(it, def, keyword);
      if ("code" in def) {
        def.code(cxt, ruleType);
      } else if (cxt.$data && def.validate) {
        (0, keyword_1.funcKeywordCode)(cxt, def);
      } else if ("macro" in def) {
        (0, keyword_1.macroKeywordCode)(cxt, def);
      } else if (def.compile || def.validate) {
        (0, keyword_1.funcKeywordCode)(cxt, def);
      }
    }
    var JSON_POINTER = /^\/(?:[^~]|~0|~1)*$/;
    var RELATIVE_JSON_POINTER = /^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;
    function getData($data, { dataLevel, dataNames, dataPathArr }) {
      let jsonPointer;
      let data;
      if ($data === "")
        return names_1.default.rootData;
      if ($data[0] === "/") {
        if (!JSON_POINTER.test($data))
          throw new Error(`Invalid JSON-pointer: ${$data}`);
        jsonPointer = $data;
        data = names_1.default.rootData;
      } else {
        const matches = RELATIVE_JSON_POINTER.exec($data);
        if (!matches)
          throw new Error(`Invalid JSON-pointer: ${$data}`);
        const up = +matches[1];
        jsonPointer = matches[2];
        if (jsonPointer === "#") {
          if (up >= dataLevel)
            throw new Error(errorMsg("property/index", up));
          return dataPathArr[dataLevel - up];
        }
        if (up > dataLevel)
          throw new Error(errorMsg("data", up));
        data = dataNames[dataLevel - up];
        if (!jsonPointer)
          return data;
      }
      let expr = data;
      const segments = jsonPointer.split("/");
      for (const segment2 of segments) {
        if (segment2) {
          data = (0, codegen_1._)`${data}${(0, codegen_1.getProperty)((0, util_1.unescapeJsonPointer)(segment2))}`;
          expr = (0, codegen_1._)`${expr} && ${data}`;
        }
      }
      return expr;
      function errorMsg(pointerType, up) {
        return `Cannot access ${pointerType} ${up} levels up, current level is ${dataLevel}`;
      }
    }
    exports2.getData = getData;
  }
});

// node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/runtime/validation_error.js
var require_validation_error = __commonJS({
  "node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/runtime/validation_error.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    var ValidationError = class extends Error {
      constructor(errors) {
        super("validation failed");
        this.errors = errors;
        this.ajv = this.validation = true;
      }
    };
    exports2.default = ValidationError;
  }
});

// node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/ref_error.js
var require_ref_error = __commonJS({
  "node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/ref_error.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    var resolve_1 = require_resolve();
    var MissingRefError = class extends Error {
      constructor(resolver, baseId, ref, msg) {
        super(msg || `can't resolve reference ${ref} from id ${baseId}`);
        this.missingRef = (0, resolve_1.resolveUrl)(resolver, baseId, ref);
        this.missingSchema = (0, resolve_1.normalizeId)((0, resolve_1.getFullPath)(resolver, this.missingRef));
      }
    };
    exports2.default = MissingRefError;
  }
});

// node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/index.js
var require_compile2 = __commonJS({
  "node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/index.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.resolveSchema = exports2.getCompilingSchema = exports2.resolveRef = exports2.compileSchema = exports2.SchemaEnv = void 0;
    var codegen_1 = require_codegen();
    var validation_error_1 = require_validation_error();
    var names_1 = require_names();
    var resolve_1 = require_resolve();
    var util_1 = require_util4();
    var validate_1 = require_validate();
    var SchemaEnv = class {
      constructor(env) {
        var _a2;
        this.refs = {};
        this.dynamicAnchors = {};
        let schema;
        if (typeof env.schema == "object")
          schema = env.schema;
        this.schema = env.schema;
        this.schemaId = env.schemaId;
        this.root = env.root || this;
        this.baseId = (_a2 = env.baseId) !== null && _a2 !== void 0 ? _a2 : (0, resolve_1.normalizeId)(schema === null || schema === void 0 ? void 0 : schema[env.schemaId || "$id"]);
        this.schemaPath = env.schemaPath;
        this.localRefs = env.localRefs;
        this.meta = env.meta;
        this.$async = schema === null || schema === void 0 ? void 0 : schema.$async;
        this.refs = {};
      }
    };
    exports2.SchemaEnv = SchemaEnv;
    function compileSchema(sch) {
      const _sch = getCompilingSchema.call(this, sch);
      if (_sch)
        return _sch;
      const rootId = (0, resolve_1.getFullPath)(this.opts.uriResolver, sch.root.baseId);
      const { es5, lines } = this.opts.code;
      const { ownProperties } = this.opts;
      const gen = new codegen_1.CodeGen(this.scope, { es5, lines, ownProperties });
      let _ValidationError;
      if (sch.$async) {
        _ValidationError = gen.scopeValue("Error", {
          ref: validation_error_1.default,
          code: (0, codegen_1._)`require("ajv/dist/runtime/validation_error").default`
        });
      }
      const validateName = gen.scopeName("validate");
      sch.validateName = validateName;
      const schemaCxt = {
        gen,
        allErrors: this.opts.allErrors,
        data: names_1.default.data,
        parentData: names_1.default.parentData,
        parentDataProperty: names_1.default.parentDataProperty,
        dataNames: [names_1.default.data],
        dataPathArr: [codegen_1.nil],
        // TODO can its length be used as dataLevel if nil is removed?
        dataLevel: 0,
        dataTypes: [],
        definedProperties: /* @__PURE__ */ new Set(),
        topSchemaRef: gen.scopeValue("schema", this.opts.code.source === true ? { ref: sch.schema, code: (0, codegen_1.stringify)(sch.schema) } : { ref: sch.schema }),
        validateName,
        ValidationError: _ValidationError,
        schema: sch.schema,
        schemaEnv: sch,
        rootId,
        baseId: sch.baseId || rootId,
        schemaPath: codegen_1.nil,
        errSchemaPath: sch.schemaPath || (this.opts.jtd ? "" : "#"),
        errorPath: (0, codegen_1._)`""`,
        opts: this.opts,
        self: this
      };
      let sourceCode;
      try {
        this._compilations.add(sch);
        (0, validate_1.validateFunctionCode)(schemaCxt);
        gen.optimize(this.opts.code.optimize);
        const validateCode = gen.toString();
        sourceCode = `${gen.scopeRefs(names_1.default.scope)}return ${validateCode}`;
        if (this.opts.code.process)
          sourceCode = this.opts.code.process(sourceCode, sch);
        const makeValidate = new Function(`${names_1.default.self}`, `${names_1.default.scope}`, sourceCode);
        const validate2 = makeValidate(this, this.scope.get());
        this.scope.value(validateName, { ref: validate2 });
        validate2.errors = null;
        validate2.schema = sch.schema;
        validate2.schemaEnv = sch;
        if (sch.$async)
          validate2.$async = true;
        if (this.opts.code.source === true) {
          validate2.source = { validateName, validateCode, scopeValues: gen._values };
        }
        if (this.opts.unevaluated) {
          const { props, items } = schemaCxt;
          validate2.evaluated = {
            props: props instanceof codegen_1.Name ? void 0 : props,
            items: items instanceof codegen_1.Name ? void 0 : items,
            dynamicProps: props instanceof codegen_1.Name,
            dynamicItems: items instanceof codegen_1.Name
          };
          if (validate2.source)
            validate2.source.evaluated = (0, codegen_1.stringify)(validate2.evaluated);
        }
        sch.validate = validate2;
        return sch;
      } catch (e) {
        delete sch.validate;
        delete sch.validateName;
        if (sourceCode)
          this.logger.error("Error compiling schema, function code:", sourceCode);
        throw e;
      } finally {
        this._compilations.delete(sch);
      }
    }
    exports2.compileSchema = compileSchema;
    function resolveRef2(root, baseId, ref) {
      var _a2;
      ref = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, ref);
      const schOrFunc = root.refs[ref];
      if (schOrFunc)
        return schOrFunc;
      let _sch = resolve.call(this, root, ref);
      if (_sch === void 0) {
        const schema = (_a2 = root.localRefs) === null || _a2 === void 0 ? void 0 : _a2[ref];
        const { schemaId } = this.opts;
        if (schema)
          _sch = new SchemaEnv({ schema, schemaId, root, baseId });
      }
      if (_sch === void 0)
        return;
      return root.refs[ref] = inlineOrCompile.call(this, _sch);
    }
    exports2.resolveRef = resolveRef2;
    function inlineOrCompile(sch) {
      if ((0, resolve_1.inlineRef)(sch.schema, this.opts.inlineRefs))
        return sch.schema;
      return sch.validate ? sch : compileSchema.call(this, sch);
    }
    function getCompilingSchema(schEnv) {
      for (const sch of this._compilations) {
        if (sameSchemaEnv(sch, schEnv))
          return sch;
      }
    }
    exports2.getCompilingSchema = getCompilingSchema;
    function sameSchemaEnv(s1, s2) {
      return s1.schema === s2.schema && s1.root === s2.root && s1.baseId === s2.baseId;
    }
    function resolve(root, ref) {
      let sch;
      while (typeof (sch = this.refs[ref]) == "string")
        ref = sch;
      return sch || this.schemas[ref] || resolveSchema.call(this, root, ref);
    }
    function resolveSchema(root, ref) {
      const p = this.opts.uriResolver.parse(ref);
      const refPath = (0, resolve_1._getFullPath)(this.opts.uriResolver, p);
      let baseId = (0, resolve_1.getFullPath)(this.opts.uriResolver, root.baseId, void 0);
      if (Object.keys(root.schema).length > 0 && refPath === baseId) {
        return getJsonPointer.call(this, p, root);
      }
      const id = (0, resolve_1.normalizeId)(refPath);
      const schOrRef = this.refs[id] || this.schemas[id];
      if (typeof schOrRef == "string") {
        const sch = resolveSchema.call(this, root, schOrRef);
        if (typeof (sch === null || sch === void 0 ? void 0 : sch.schema) !== "object")
          return;
        return getJsonPointer.call(this, p, sch);
      }
      if (typeof (schOrRef === null || schOrRef === void 0 ? void 0 : schOrRef.schema) !== "object")
        return;
      if (!schOrRef.validate)
        compileSchema.call(this, schOrRef);
      if (id === (0, resolve_1.normalizeId)(ref)) {
        const { schema } = schOrRef;
        const { schemaId } = this.opts;
        const schId = schema[schemaId];
        if (schId)
          baseId = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, schId);
        return new SchemaEnv({ schema, schemaId, root, baseId });
      }
      return getJsonPointer.call(this, p, schOrRef);
    }
    exports2.resolveSchema = resolveSchema;
    var PREVENT_SCOPE_CHANGE = /* @__PURE__ */ new Set([
      "properties",
      "patternProperties",
      "enum",
      "dependencies",
      "definitions"
    ]);
    function getJsonPointer(parsedRef, { baseId, schema, root }) {
      var _a2;
      if (((_a2 = parsedRef.fragment) === null || _a2 === void 0 ? void 0 : _a2[0]) !== "/")
        return;
      for (const part of parsedRef.fragment.slice(1).split("/")) {
        if (typeof schema === "boolean")
          return;
        const partSchema = schema[(0, util_1.unescapeFragment)(part)];
        if (partSchema === void 0)
          return;
        schema = partSchema;
        const schId = typeof schema === "object" && schema[this.opts.schemaId];
        if (!PREVENT_SCOPE_CHANGE.has(part) && schId) {
          baseId = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, schId);
        }
      }
      let env;
      if (typeof schema != "boolean" && schema.$ref && !(0, util_1.schemaHasRulesButRef)(schema, this.RULES)) {
        const $ref = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, schema.$ref);
        env = resolveSchema.call(this, root, $ref);
      }
      const { schemaId } = this.opts;
      env = env || new SchemaEnv({ schema, schemaId, root, baseId });
      if (env.schema !== env.root.schema)
        return env;
      return void 0;
    }
  }
});

// node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/refs/data.json
var require_data = __commonJS({
  "node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/refs/data.json"(exports2, module2) {
    module2.exports = {
      $id: "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",
      description: "Meta-schema for $data reference (JSON AnySchema extension proposal)",
      type: "object",
      required: ["$data"],
      properties: {
        $data: {
          type: "string",
          anyOf: [{ format: "relative-json-pointer" }, { format: "json-pointer" }]
        }
      },
      additionalProperties: false
    };
  }
});

// node_modules/fast-uri/lib/utils.js
var require_utils6 = __commonJS({
  "node_modules/fast-uri/lib/utils.js"(exports2, module2) {
    "use strict";
    var isUUID = RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu);
    var isIPv4 = RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);
    var isHexPair = RegExp.prototype.test.bind(/^[\da-f]{2}$/iu);
    var isUnreserved = RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu);
    var isPathCharacter = RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);
    function stringArrayToHexStripped(input) {
      let acc = "";
      let code = 0;
      let i = 0;
      for (i = 0; i < input.length; i++) {
        code = input[i].charCodeAt(0);
        if (code === 48) {
          continue;
        }
        if (!(code >= 48 && code <= 57 || code >= 65 && code <= 70 || code >= 97 && code <= 102)) {
          return "";
        }
        acc += input[i];
        break;
      }
      for (i += 1; i < input.length; i++) {
        code = input[i].charCodeAt(0);
        if (!(code >= 48 && code <= 57 || code >= 65 && code <= 70 || code >= 97 && code <= 102)) {
          return "";
        }
        acc += input[i];
      }
      return acc;
    }
    var nonSimpleDomain = RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);
    function consumeIsZone(buffer) {
      buffer.length = 0;
      return true;
    }
    function consumeHextets(buffer, address, output) {
      if (buffer.length) {
        const hex3 = stringArrayToHexStripped(buffer);
        if (hex3 !== "") {
          address.push(hex3);
        } else {
          output.error = true;
          return false;
        }
        buffer.length = 0;
      }
      return true;
    }
    function getIPV6(input) {
      let tokenCount = 0;
      const output = { error: false, address: "", zone: "" };
      const address = [];
      const buffer = [];
      let endipv6Encountered = false;
      let endIpv6 = false;
      let consume = consumeHextets;
      for (let i = 0; i < input.length; i++) {
        const cursor = input[i];
        if (cursor === "[" || cursor === "]") {
          continue;
        }
        if (cursor === ":") {
          if (endipv6Encountered === true) {
            endIpv6 = true;
          }
          if (!consume(buffer, address, output)) {
            break;
          }
          if (++tokenCount > 7) {
            output.error = true;
            break;
          }
          if (i > 0 && input[i - 1] === ":") {
            endipv6Encountered = true;
          }
          address.push(":");
          continue;
        } else if (cursor === "%") {
          if (!consume(buffer, address, output)) {
            break;
          }
          consume = consumeIsZone;
        } else {
          buffer.push(cursor);
          continue;
        }
      }
      if (buffer.length) {
        if (consume === consumeIsZone) {
          output.zone = buffer.join("");
        } else if (endIpv6) {
          address.push(buffer.join(""));
        } else {
          address.push(stringArrayToHexStripped(buffer));
        }
      }
      output.address = address.join("");
      return output;
    }
    function normalizeIPv6(host) {
      if (findToken(host, ":") < 2) {
        return { host, isIPV6: false };
      }
      const ipv63 = getIPV6(host);
      if (!ipv63.error) {
        let newHost = ipv63.address;
        let escapedHost = ipv63.address;
        if (ipv63.zone) {
          newHost += "%" + ipv63.zone;
          escapedHost += "%25" + ipv63.zone;
        }
        return { host: newHost, isIPV6: true, escapedHost };
      } else {
        return { host, isIPV6: false };
      }
    }
    function findToken(str, token) {
      let ind = 0;
      for (let i = 0; i < str.length; i++) {
        if (str[i] === token) ind++;
      }
      return ind;
    }
    function removeDotSegments(path) {
      let input = path;
      const output = [];
      let nextSlash = -1;
      let len = 0;
      while (len = input.length) {
        if (len === 1) {
          if (input === ".") {
            break;
          } else if (input === "/") {
            output.push("/");
            break;
          } else {
            output.push(input);
            break;
          }
        } else if (len === 2) {
          if (input[0] === ".") {
            if (input[1] === ".") {
              break;
            } else if (input[1] === "/") {
              input = input.slice(2);
              continue;
            }
          } else if (input[0] === "/") {
            if (input[1] === "." || input[1] === "/") {
              output.push("/");
              break;
            }
          }
        } else if (len === 3) {
          if (input === "/..") {
            if (output.length !== 0) {
              output.pop();
            }
            output.push("/");
            break;
          }
        }
        if (input[0] === ".") {
          if (input[1] === ".") {
            if (input[2] === "/") {
              input = input.slice(3);
              continue;
            }
          } else if (input[1] === "/") {
            input = input.slice(2);
            continue;
          }
        } else if (input[0] === "/") {
          if (input[1] === ".") {
            if (input[2] === "/") {
              input = input.slice(2);
              continue;
            } else if (input[2] === ".") {
              if (input[3] === "/") {
                input = input.slice(3);
                if (output.length !== 0) {
                  output.pop();
                }
                continue;
              }
            }
          }
        }
        if ((nextSlash = input.indexOf("/", 1)) === -1) {
          output.push(input);
          break;
        } else {
          output.push(input.slice(0, nextSlash));
          input = input.slice(nextSlash);
        }
      }
      return output.join("");
    }
    var HOST_DELIMS = { "@": "%40", "/": "%2F", "?": "%3F", "#": "%23", ":": "%3A" };
    var HOST_DELIM_RE = /[@/?#:]/g;
    var HOST_DELIM_NO_COLON_RE = /[@/?#]/g;
    function reescapeHostDelimiters(host, isIP) {
      const re = isIP ? HOST_DELIM_NO_COLON_RE : HOST_DELIM_RE;
      re.lastIndex = 0;
      return host.replace(re, (ch) => HOST_DELIMS[ch]);
    }
    function normalizePercentEncoding(input, decodeUnreserved = false) {
      if (input.indexOf("%") === -1) {
        return input;
      }
      let output = "";
      for (let i = 0; i < input.length; i++) {
        if (input[i] === "%" && i + 2 < input.length) {
          const hex3 = input.slice(i + 1, i + 3);
          if (isHexPair(hex3)) {
            const normalizedHex = hex3.toUpperCase();
            const decoded = String.fromCharCode(parseInt(normalizedHex, 16));
            if (decodeUnreserved && isUnreserved(decoded)) {
              output += decoded;
            } else {
              output += "%" + normalizedHex;
            }
            i += 2;
            continue;
          }
        }
        output += input[i];
      }
      return output;
    }
    function normalizePathEncoding(input) {
      let output = "";
      for (let i = 0; i < input.length; i++) {
        if (input[i] === "%" && i + 2 < input.length) {
          const hex3 = input.slice(i + 1, i + 3);
          if (isHexPair(hex3)) {
            const normalizedHex = hex3.toUpperCase();
            const decoded = String.fromCharCode(parseInt(normalizedHex, 16));
            if (decoded !== "." && isUnreserved(decoded)) {
              output += decoded;
            } else {
              output += "%" + normalizedHex;
            }
            i += 2;
            continue;
          }
        }
        if (isPathCharacter(input[i])) {
          output += input[i];
        } else {
          output += escape(input[i]);
        }
      }
      return output;
    }
    function escapePreservingEscapes(input) {
      let output = "";
      for (let i = 0; i < input.length; i++) {
        if (input[i] === "%" && i + 2 < input.length) {
          const hex3 = input.slice(i + 1, i + 3);
          if (isHexPair(hex3)) {
            output += "%" + hex3.toUpperCase();
            i += 2;
            continue;
          }
        }
        output += escape(input[i]);
      }
      return output;
    }
    function recomposeAuthority(component) {
      const uriTokens = [];
      if (component.userinfo !== void 0) {
        uriTokens.push(component.userinfo);
        uriTokens.push("@");
      }
      if (component.host !== void 0) {
        let host = unescape(component.host);
        if (!isIPv4(host)) {
          const ipV6res = normalizeIPv6(host);
          if (ipV6res.isIPV6 === true) {
            host = `[${ipV6res.escapedHost}]`;
          } else {
            host = reescapeHostDelimiters(host, false);
          }
        }
        uriTokens.push(host);
      }
      if (typeof component.port === "number" || typeof component.port === "string") {
        uriTokens.push(":");
        uriTokens.push(String(component.port));
      }
      return uriTokens.length ? uriTokens.join("") : void 0;
    }
    module2.exports = {
      nonSimpleDomain,
      recomposeAuthority,
      reescapeHostDelimiters,
      normalizePercentEncoding,
      normalizePathEncoding,
      escapePreservingEscapes,
      removeDotSegments,
      isIPv4,
      isUUID,
      normalizeIPv6,
      stringArrayToHexStripped
    };
  }
});

// node_modules/fast-uri/lib/schemes.js
var require_schemes = __commonJS({
  "node_modules/fast-uri/lib/schemes.js"(exports2, module2) {
    "use strict";
    var { isUUID } = require_utils6();
    var URN_REG = /([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;
    var supportedSchemeNames = (
      /** @type {const} */
      [
        "http",
        "https",
        "ws",
        "wss",
        "urn",
        "urn:uuid"
      ]
    );
    function isValidSchemeName(name) {
      return supportedSchemeNames.indexOf(
        /** @type {*} */
        name
      ) !== -1;
    }
    function wsIsSecure(wsComponent) {
      if (wsComponent.secure === true) {
        return true;
      } else if (wsComponent.secure === false) {
        return false;
      } else if (wsComponent.scheme) {
        return wsComponent.scheme.length === 3 && (wsComponent.scheme[0] === "w" || wsComponent.scheme[0] === "W") && (wsComponent.scheme[1] === "s" || wsComponent.scheme[1] === "S") && (wsComponent.scheme[2] === "s" || wsComponent.scheme[2] === "S");
      } else {
        return false;
      }
    }
    function httpParse(component) {
      if (!component.host) {
        component.error = component.error || "HTTP URIs must have a host.";
      }
      return component;
    }
    function httpSerialize(component) {
      const secure = String(component.scheme).toLowerCase() === "https";
      if (component.port === (secure ? 443 : 80) || component.port === "") {
        component.port = void 0;
      }
      if (!component.path) {
        component.path = "/";
      }
      return component;
    }
    function wsParse(wsComponent) {
      wsComponent.secure = wsIsSecure(wsComponent);
      wsComponent.resourceName = (wsComponent.path || "/") + (wsComponent.query ? "?" + wsComponent.query : "");
      wsComponent.path = void 0;
      wsComponent.query = void 0;
      return wsComponent;
    }
    function wsSerialize(wsComponent) {
      if (wsComponent.port === (wsIsSecure(wsComponent) ? 443 : 80) || wsComponent.port === "") {
        wsComponent.port = void 0;
      }
      if (typeof wsComponent.secure === "boolean") {
        wsComponent.scheme = wsComponent.secure ? "wss" : "ws";
        wsComponent.secure = void 0;
      }
      if (wsComponent.resourceName) {
        const [path, query] = wsComponent.resourceName.split("?");
        wsComponent.path = path && path !== "/" ? path : void 0;
        wsComponent.query = query;
        wsComponent.resourceName = void 0;
      }
      wsComponent.fragment = void 0;
      return wsComponent;
    }
    function urnParse(urnComponent, options2) {
      if (!urnComponent.path) {
        urnComponent.error = "URN can not be parsed";
        return urnComponent;
      }
      const matches = urnComponent.path.match(URN_REG);
      if (matches) {
        const scheme = options2.scheme || urnComponent.scheme || "urn";
        urnComponent.nid = matches[1].toLowerCase();
        urnComponent.nss = matches[2];
        const urnScheme = `${scheme}:${options2.nid || urnComponent.nid}`;
        const schemeHandler = getSchemeHandler(urnScheme);
        urnComponent.path = void 0;
        if (schemeHandler) {
          urnComponent = schemeHandler.parse(urnComponent, options2);
        }
      } else {
        urnComponent.error = urnComponent.error || "URN can not be parsed.";
      }
      return urnComponent;
    }
    function urnSerialize(urnComponent, options2) {
      if (urnComponent.nid === void 0) {
        throw new Error("URN without nid cannot be serialized");
      }
      const scheme = options2.scheme || urnComponent.scheme || "urn";
      const nid = urnComponent.nid.toLowerCase();
      const urnScheme = `${scheme}:${options2.nid || nid}`;
      const schemeHandler = getSchemeHandler(urnScheme);
      if (schemeHandler) {
        urnComponent = schemeHandler.serialize(urnComponent, options2);
      }
      const uriComponent = urnComponent;
      const nss = urnComponent.nss;
      uriComponent.path = `${nid || options2.nid}:${nss}`;
      options2.skipEscape = true;
      return uriComponent;
    }
    function urnuuidParse(urnComponent, options2) {
      const uuidComponent = urnComponent;
      uuidComponent.uuid = uuidComponent.nss;
      uuidComponent.nss = void 0;
      if (!options2.tolerant && (!uuidComponent.uuid || !isUUID(uuidComponent.uuid))) {
        uuidComponent.error = uuidComponent.error || "UUID is not valid.";
      }
      return uuidComponent;
    }
    function urnuuidSerialize(uuidComponent) {
      const urnComponent = uuidComponent;
      urnComponent.nss = (uuidComponent.uuid || "").toLowerCase();
      return urnComponent;
    }
    var http = (
      /** @type {SchemeHandler} */
      {
        scheme: "http",
        domainHost: true,
        parse: httpParse,
        serialize: httpSerialize
      }
    );
    var https = (
      /** @type {SchemeHandler} */
      {
        scheme: "https",
        domainHost: http.domainHost,
        parse: httpParse,
        serialize: httpSerialize
      }
    );
    var ws2 = (
      /** @type {SchemeHandler} */
      {
        scheme: "ws",
        domainHost: true,
        parse: wsParse,
        serialize: wsSerialize
      }
    );
    var wss = (
      /** @type {SchemeHandler} */
      {
        scheme: "wss",
        domainHost: ws2.domainHost,
        parse: ws2.parse,
        serialize: ws2.serialize
      }
    );
    var urn = (
      /** @type {SchemeHandler} */
      {
        scheme: "urn",
        parse: urnParse,
        serialize: urnSerialize,
        skipNormalize: true
      }
    );
    var urnuuid = (
      /** @type {SchemeHandler} */
      {
        scheme: "urn:uuid",
        parse: urnuuidParse,
        serialize: urnuuidSerialize,
        skipNormalize: true
      }
    );
    var SCHEMES = (
      /** @type {Record<SchemeName, SchemeHandler>} */
      {
        http,
        https,
        ws: ws2,
        wss,
        urn,
        "urn:uuid": urnuuid
      }
    );
    Object.setPrototypeOf(SCHEMES, null);
    function getSchemeHandler(scheme) {
      return scheme && (SCHEMES[
        /** @type {SchemeName} */
        scheme
      ] || SCHEMES[
        /** @type {SchemeName} */
        scheme.toLowerCase()
      ]) || void 0;
    }
    module2.exports = {
      wsIsSecure,
      SCHEMES,
      isValidSchemeName,
      getSchemeHandler
    };
  }
});

// node_modules/fast-uri/index.js
var require_fast_uri = __commonJS({
  "node_modules/fast-uri/index.js"(exports2, module2) {
    "use strict";
    var { normalizeIPv6, removeDotSegments, recomposeAuthority, normalizePercentEncoding, normalizePathEncoding, escapePreservingEscapes, reescapeHostDelimiters, isIPv4, nonSimpleDomain } = require_utils6();
    var { SCHEMES, getSchemeHandler } = require_schemes();
    function normalize(uri, options2) {
      if (typeof uri === "string") {
        uri = /** @type {T} */
        normalizeString(uri, options2);
      } else if (typeof uri === "object") {
        uri = /** @type {T} */
        parse3(serialize(uri, options2), options2);
      }
      return uri;
    }
    function resolve(baseURI, relativeURI, options2) {
      const schemelessOptions = options2 ? Object.assign({ scheme: "null" }, options2) : { scheme: "null" };
      const resolved = resolveComponent(parse3(baseURI, schemelessOptions), parse3(relativeURI, schemelessOptions), schemelessOptions, true);
      schemelessOptions.skipEscape = true;
      return serialize(resolved, schemelessOptions);
    }
    function resolveComponent(base, relative, options2, skipNormalization) {
      const target = {};
      if (!skipNormalization) {
        base = parse3(serialize(base, options2), options2);
        relative = parse3(serialize(relative, options2), options2);
      }
      options2 = options2 || {};
      if (!options2.tolerant && relative.scheme) {
        target.scheme = relative.scheme;
        target.userinfo = relative.userinfo;
        target.host = relative.host;
        target.port = relative.port;
        target.path = removeDotSegments(relative.path || "");
        target.query = relative.query;
      } else {
        if (relative.userinfo !== void 0 || relative.host !== void 0 || relative.port !== void 0) {
          target.userinfo = relative.userinfo;
          target.host = relative.host;
          target.port = relative.port;
          target.path = removeDotSegments(relative.path || "");
          target.query = relative.query;
        } else {
          if (!relative.path) {
            target.path = base.path;
            if (relative.query !== void 0) {
              target.query = relative.query;
            } else {
              target.query = base.query;
            }
          } else {
            if (relative.path[0] === "/") {
              target.path = removeDotSegments(relative.path);
            } else {
              if ((base.userinfo !== void 0 || base.host !== void 0 || base.port !== void 0) && !base.path) {
                target.path = "/" + relative.path;
              } else if (!base.path) {
                target.path = relative.path;
              } else {
                target.path = base.path.slice(0, base.path.lastIndexOf("/") + 1) + relative.path;
              }
              target.path = removeDotSegments(target.path);
            }
            target.query = relative.query;
          }
          target.userinfo = base.userinfo;
          target.host = base.host;
          target.port = base.port;
        }
        target.scheme = base.scheme;
      }
      target.fragment = relative.fragment;
      return target;
    }
    function equal(uriA, uriB, options2) {
      const normalizedA = normalizeComparableURI(uriA, options2);
      const normalizedB = normalizeComparableURI(uriB, options2);
      return normalizedA !== void 0 && normalizedB !== void 0 && normalizedA.toLowerCase() === normalizedB.toLowerCase();
    }
    function serialize(cmpts, opts) {
      const component = {
        host: cmpts.host,
        scheme: cmpts.scheme,
        userinfo: cmpts.userinfo,
        port: cmpts.port,
        path: cmpts.path,
        query: cmpts.query,
        nid: cmpts.nid,
        nss: cmpts.nss,
        uuid: cmpts.uuid,
        fragment: cmpts.fragment,
        reference: cmpts.reference,
        resourceName: cmpts.resourceName,
        secure: cmpts.secure,
        error: ""
      };
      const options2 = Object.assign({}, opts);
      const uriTokens = [];
      const schemeHandler = getSchemeHandler(options2.scheme || component.scheme);
      if (schemeHandler && schemeHandler.serialize) schemeHandler.serialize(component, options2);
      if (component.path !== void 0) {
        if (!options2.skipEscape) {
          component.path = escapePreservingEscapes(component.path);
          if (component.scheme !== void 0) {
            component.path = component.path.split("%3A").join(":");
          }
        } else {
          component.path = normalizePercentEncoding(component.path);
        }
      }
      if (options2.reference !== "suffix" && component.scheme) {
        uriTokens.push(component.scheme, ":");
      }
      const authority = recomposeAuthority(component);
      if (authority !== void 0) {
        if (options2.reference !== "suffix") {
          uriTokens.push("//");
        }
        uriTokens.push(authority);
        if (component.path && component.path[0] !== "/") {
          uriTokens.push("/");
        }
      }
      if (component.path !== void 0) {
        let s = component.path;
        if (!options2.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) {
          s = removeDotSegments(s);
        }
        if (authority === void 0 && s[0] === "/" && s[1] === "/") {
          s = "/%2F" + s.slice(2);
        }
        uriTokens.push(s);
      }
      if (component.query !== void 0) {
        uriTokens.push("?", component.query);
      }
      if (component.fragment !== void 0) {
        uriTokens.push("#", component.fragment);
      }
      return uriTokens.join("");
    }
    var URI_PARSE = /^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;
    function getParseError(parsed, matches) {
      if (matches[2] !== void 0 && parsed.path && parsed.path[0] !== "/") {
        return 'URI path must start with "/" when authority is present.';
      }
      if (typeof parsed.port === "number" && (parsed.port < 0 || parsed.port > 65535)) {
        return "URI port is malformed.";
      }
      return void 0;
    }
    function parseWithStatus(uri, opts) {
      const options2 = Object.assign({}, opts);
      const parsed = {
        scheme: void 0,
        userinfo: void 0,
        host: "",
        port: void 0,
        path: "",
        query: void 0,
        fragment: void 0
      };
      let malformedAuthorityOrPort = false;
      let isIP = false;
      if (options2.reference === "suffix") {
        if (options2.scheme) {
          uri = options2.scheme + ":" + uri;
        } else {
          uri = "//" + uri;
        }
      }
      const matches = uri.match(URI_PARSE);
      if (matches) {
        parsed.scheme = matches[1];
        parsed.userinfo = matches[3];
        parsed.host = matches[4];
        parsed.port = parseInt(matches[5], 10);
        parsed.path = matches[6] || "";
        parsed.query = matches[7];
        parsed.fragment = matches[8];
        if (isNaN(parsed.port)) {
          parsed.port = matches[5];
        }
        const parseError = getParseError(parsed, matches);
        if (parseError !== void 0) {
          parsed.error = parsed.error || parseError;
          malformedAuthorityOrPort = true;
        }
        if (parsed.host) {
          const ipv4result = isIPv4(parsed.host);
          if (ipv4result === false) {
            const ipv6result = normalizeIPv6(parsed.host);
            parsed.host = ipv6result.host.toLowerCase();
            isIP = ipv6result.isIPV6;
          } else {
            isIP = true;
          }
        }
        if (parsed.scheme === void 0 && parsed.userinfo === void 0 && parsed.host === void 0 && parsed.port === void 0 && parsed.query === void 0 && !parsed.path) {
          parsed.reference = "same-document";
        } else if (parsed.scheme === void 0) {
          parsed.reference = "relative";
        } else if (parsed.fragment === void 0) {
          parsed.reference = "absolute";
        } else {
          parsed.reference = "uri";
        }
        if (options2.reference && options2.reference !== "suffix" && options2.reference !== parsed.reference) {
          parsed.error = parsed.error || "URI is not a " + options2.reference + " reference.";
        }
        const schemeHandler = getSchemeHandler(options2.scheme || parsed.scheme);
        if (!options2.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport)) {
          if (parsed.host && (options2.domainHost || schemeHandler && schemeHandler.domainHost) && isIP === false && nonSimpleDomain(parsed.host)) {
            try {
              parsed.host = URL.domainToASCII(parsed.host.toLowerCase());
            } catch (e) {
              parsed.error = parsed.error || "Host's domain name can not be converted to ASCII: " + e;
            }
          }
        }
        if (!schemeHandler || schemeHandler && !schemeHandler.skipNormalize) {
          if (uri.indexOf("%") !== -1) {
            if (parsed.scheme !== void 0) {
              parsed.scheme = unescape(parsed.scheme);
            }
            if (parsed.host !== void 0) {
              parsed.host = reescapeHostDelimiters(unescape(parsed.host), isIP);
            }
          }
          if (parsed.path) {
            parsed.path = normalizePathEncoding(parsed.path);
          }
          if (parsed.fragment) {
            try {
              parsed.fragment = encodeURI(decodeURIComponent(parsed.fragment));
            } catch {
              parsed.error = parsed.error || "URI malformed";
            }
          }
        }
        if (schemeHandler && schemeHandler.parse) {
          schemeHandler.parse(parsed, options2);
        }
      } else {
        parsed.error = parsed.error || "URI can not be parsed.";
      }
      return { parsed, malformedAuthorityOrPort };
    }
    function parse3(uri, opts) {
      return parseWithStatus(uri, opts).parsed;
    }
    function normalizeString(uri, opts) {
      return normalizeStringWithStatus(uri, opts).normalized;
    }
    function normalizeStringWithStatus(uri, opts) {
      const { parsed, malformedAuthorityOrPort } = parseWithStatus(uri, opts);
      return {
        normalized: malformedAuthorityOrPort ? uri : serialize(parsed, opts),
        malformedAuthorityOrPort
      };
    }
    function normalizeComparableURI(uri, opts) {
      if (typeof uri === "string") {
        const { normalized, malformedAuthorityOrPort } = normalizeStringWithStatus(uri, opts);
        return malformedAuthorityOrPort ? void 0 : normalized;
      }
      if (typeof uri === "object") {
        return serialize(uri, opts);
      }
    }
    var fastUri = {
      SCHEMES,
      normalize,
      resolve,
      resolveComponent,
      equal,
      serialize,
      parse: parse3
    };
    module2.exports = fastUri;
    module2.exports.default = fastUri;
    module2.exports.fastUri = fastUri;
  }
});

// node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/runtime/uri.js
var require_uri = __commonJS({
  "node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/runtime/uri.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    var uri = require_fast_uri();
    uri.code = 'require("ajv/dist/runtime/uri").default';
    exports2.default = uri;
  }
});

// node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/core.js
var require_core = __commonJS({
  "node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/core.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.CodeGen = exports2.Name = exports2.nil = exports2.stringify = exports2.str = exports2._ = exports2.KeywordCxt = void 0;
    var validate_1 = require_validate();
    Object.defineProperty(exports2, "KeywordCxt", { enumerable: true, get: function() {
      return validate_1.KeywordCxt;
    } });
    var codegen_1 = require_codegen();
    Object.defineProperty(exports2, "_", { enumerable: true, get: function() {
      return codegen_1._;
    } });
    Object.defineProperty(exports2, "str", { enumerable: true, get: function() {
      return codegen_1.str;
    } });
    Object.defineProperty(exports2, "stringify", { enumerable: true, get: function() {
      return codegen_1.stringify;
    } });
    Object.defineProperty(exports2, "nil", { enumerable: true, get: function() {
      return codegen_1.nil;
    } });
    Object.defineProperty(exports2, "Name", { enumerable: true, get: function() {
      return codegen_1.Name;
    } });
    Object.defineProperty(exports2, "CodeGen", { enumerable: true, get: function() {
      return codegen_1.CodeGen;
    } });
    var validation_error_1 = require_validation_error();
    var ref_error_1 = require_ref_error();
    var rules_1 = require_rules();
    var compile_1 = require_compile2();
    var codegen_2 = require_codegen();
    var resolve_1 = require_resolve();
    var dataType_1 = require_dataType();
    var util_1 = require_util4();
    var $dataRefSchema = require_data();
    var uri_1 = require_uri();
    var defaultRegExp = (str, flags) => new RegExp(str, flags);
    defaultRegExp.code = "new RegExp";
    var META_IGNORE_OPTIONS = ["removeAdditional", "useDefaults", "coerceTypes"];
    var EXT_SCOPE_NAMES = /* @__PURE__ */ new Set([
      "validate",
      "serialize",
      "parse",
      "wrapper",
      "root",
      "schema",
      "keyword",
      "pattern",
      "formats",
      "validate$data",
      "func",
      "obj",
      "Error"
    ]);
    var removedOptions = {
      errorDataPath: "",
      format: "`validateFormats: false` can be used instead.",
      nullable: '"nullable" keyword is supported by default.',
      jsonPointers: "Deprecated jsPropertySyntax can be used instead.",
      extendRefs: "Deprecated ignoreKeywordsWithRef can be used instead.",
      missingRefs: "Pass empty schema with $id that should be ignored to ajv.addSchema.",
      processCode: "Use option `code: {process: (code, schemaEnv: object) => string}`",
      sourceCode: "Use option `code: {source: true}`",
      strictDefaults: "It is default now, see option `strict`.",
      strictKeywords: "It is default now, see option `strict`.",
      uniqueItems: '"uniqueItems" keyword is always validated.',
      unknownFormats: "Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",
      cache: "Map is used as cache, schema object as key.",
      serialize: "Map is used as cache, schema object as key.",
      ajvErrors: "It is default now."
    };
    var deprecatedOptions = {
      ignoreKeywordsWithRef: "",
      jsPropertySyntax: "",
      unicode: '"minLength"/"maxLength" account for unicode characters by default.'
    };
    var MAX_EXPRESSION = 200;
    function requiredOptions(o) {
      var _a2, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0;
      const s = o.strict;
      const _optz = (_a2 = o.code) === null || _a2 === void 0 ? void 0 : _a2.optimize;
      const optimize = _optz === true || _optz === void 0 ? 1 : _optz || 0;
      const regExp = (_c = (_b = o.code) === null || _b === void 0 ? void 0 : _b.regExp) !== null && _c !== void 0 ? _c : defaultRegExp;
      const uriResolver = (_d = o.uriResolver) !== null && _d !== void 0 ? _d : uri_1.default;
      return {
        strictSchema: (_f = (_e = o.strictSchema) !== null && _e !== void 0 ? _e : s) !== null && _f !== void 0 ? _f : true,
        strictNumbers: (_h = (_g = o.strictNumbers) !== null && _g !== void 0 ? _g : s) !== null && _h !== void 0 ? _h : true,
        strictTypes: (_k = (_j = o.strictTypes) !== null && _j !== void 0 ? _j : s) !== null && _k !== void 0 ? _k : "log",
        strictTuples: (_m = (_l = o.strictTuples) !== null && _l !== void 0 ? _l : s) !== null && _m !== void 0 ? _m : "log",
        strictRequired: (_p = (_o = o.strictRequired) !== null && _o !== void 0 ? _o : s) !== null && _p !== void 0 ? _p : false,
        code: o.code ? { ...o.code, optimize, regExp } : { optimize, regExp },
        loopRequired: (_q = o.loopRequired) !== null && _q !== void 0 ? _q : MAX_EXPRESSION,
        loopEnum: (_r = o.loopEnum) !== null && _r !== void 0 ? _r : MAX_EXPRESSION,
        meta: (_s = o.meta) !== null && _s !== void 0 ? _s : true,
        messages: (_t = o.messages) !== null && _t !== void 0 ? _t : true,
        inlineRefs: (_u = o.inlineRefs) !== null && _u !== void 0 ? _u : true,
        schemaId: (_v = o.schemaId) !== null && _v !== void 0 ? _v : "$id",
        addUsedSchema: (_w = o.addUsedSchema) !== null && _w !== void 0 ? _w : true,
        validateSchema: (_x = o.validateSchema) !== null && _x !== void 0 ? _x : true,
        validateFormats: (_y = o.validateFormats) !== null && _y !== void 0 ? _y : true,
        unicodeRegExp: (_z = o.unicodeRegExp) !== null && _z !== void 0 ? _z : true,
        int32range: (_0 = o.int32range) !== null && _0 !== void 0 ? _0 : true,
        uriResolver
      };
    }
    var Ajv2 = class {
      constructor(opts = {}) {
        this.schemas = {};
        this.refs = {};
        this.formats = {};
        this._compilations = /* @__PURE__ */ new Set();
        this._loading = {};
        this._cache = /* @__PURE__ */ new Map();
        opts = this.opts = { ...opts, ...requiredOptions(opts) };
        const { es5, lines } = this.opts.code;
        this.scope = new codegen_2.ValueScope({ scope: {}, prefixes: EXT_SCOPE_NAMES, es5, lines });
        this.logger = getLogger(opts.logger);
        const formatOpt = opts.validateFormats;
        opts.validateFormats = false;
        this.RULES = (0, rules_1.getRules)();
        checkOptions.call(this, removedOptions, opts, "NOT SUPPORTED");
        checkOptions.call(this, deprecatedOptions, opts, "DEPRECATED", "warn");
        this._metaOpts = getMetaSchemaOptions.call(this);
        if (opts.formats)
          addInitialFormats.call(this);
        this._addVocabularies();
        this._addDefaultMetaSchema();
        if (opts.keywords)
          addInitialKeywords.call(this, opts.keywords);
        if (typeof opts.meta == "object")
          this.addMetaSchema(opts.meta);
        addInitialSchemas.call(this);
        opts.validateFormats = formatOpt;
      }
      _addVocabularies() {
        this.addKeyword("$async");
      }
      _addDefaultMetaSchema() {
        const { $data, meta: meta3, schemaId } = this.opts;
        let _dataRefSchema = $dataRefSchema;
        if (schemaId === "id") {
          _dataRefSchema = { ...$dataRefSchema };
          _dataRefSchema.id = _dataRefSchema.$id;
          delete _dataRefSchema.$id;
        }
        if (meta3 && $data)
          this.addMetaSchema(_dataRefSchema, _dataRefSchema[schemaId], false);
      }
      defaultMeta() {
        const { meta: meta3, schemaId } = this.opts;
        return this.opts.defaultMeta = typeof meta3 == "object" ? meta3[schemaId] || meta3 : void 0;
      }
      validate(schemaKeyRef, data) {
        let v;
        if (typeof schemaKeyRef == "string") {
          v = this.getSchema(schemaKeyRef);
          if (!v)
            throw new Error(`no schema with key or ref "${schemaKeyRef}"`);
        } else {
          v = this.compile(schemaKeyRef);
        }
        const valid = v(data);
        if (!("$async" in v))
          this.errors = v.errors;
        return valid;
      }
      compile(schema, _meta) {
        const sch = this._addSchema(schema, _meta);
        return sch.validate || this._compileSchemaEnv(sch);
      }
      compileAsync(schema, meta3) {
        if (typeof this.opts.loadSchema != "function") {
          throw new Error("options.loadSchema should be a function");
        }
        const { loadSchema } = this.opts;
        return runCompileAsync.call(this, schema, meta3);
        async function runCompileAsync(_schema, _meta) {
          await loadMetaSchema.call(this, _schema.$schema);
          const sch = this._addSchema(_schema, _meta);
          return sch.validate || _compileAsync.call(this, sch);
        }
        async function loadMetaSchema($ref) {
          if ($ref && !this.getSchema($ref)) {
            await runCompileAsync.call(this, { $ref }, true);
          }
        }
        async function _compileAsync(sch) {
          try {
            return this._compileSchemaEnv(sch);
          } catch (e) {
            if (!(e instanceof ref_error_1.default))
              throw e;
            checkLoaded.call(this, e);
            await loadMissingSchema.call(this, e.missingSchema);
            return _compileAsync.call(this, sch);
          }
        }
        function checkLoaded({ missingSchema: ref, missingRef }) {
          if (this.refs[ref]) {
            throw new Error(`AnySchema ${ref} is loaded but ${missingRef} cannot be resolved`);
          }
        }
        async function loadMissingSchema(ref) {
          const _schema = await _loadSchema.call(this, ref);
          if (!this.refs[ref])
            await loadMetaSchema.call(this, _schema.$schema);
          if (!this.refs[ref])
            this.addSchema(_schema, ref, meta3);
        }
        async function _loadSchema(ref) {
          const p = this._loading[ref];
          if (p)
            return p;
          try {
            return await (this._loading[ref] = loadSchema(ref));
          } finally {
            delete this._loading[ref];
          }
        }
      }
      // Adds schema to the instance
      addSchema(schema, key, _meta, _validateSchema = this.opts.validateSchema) {
        if (Array.isArray(schema)) {
          for (const sch of schema)
            this.addSchema(sch, void 0, _meta, _validateSchema);
          return this;
        }
        let id;
        if (typeof schema === "object") {
          const { schemaId } = this.opts;
          id = schema[schemaId];
          if (id !== void 0 && typeof id != "string") {
            throw new Error(`schema ${schemaId} must be string`);
          }
        }
        key = (0, resolve_1.normalizeId)(key || id);
        this._checkUnique(key);
        this.schemas[key] = this._addSchema(schema, _meta, key, _validateSchema, true);
        return this;
      }
      // Add schema that will be used to validate other schemas
      // options in META_IGNORE_OPTIONS are alway set to false
      addMetaSchema(schema, key, _validateSchema = this.opts.validateSchema) {
        this.addSchema(schema, key, true, _validateSchema);
        return this;
      }
      //  Validate schema against its meta-schema
      validateSchema(schema, throwOrLogError) {
        if (typeof schema == "boolean")
          return true;
        let $schema;
        $schema = schema.$schema;
        if ($schema !== void 0 && typeof $schema != "string") {
          throw new Error("$schema must be a string");
        }
        $schema = $schema || this.opts.defaultMeta || this.defaultMeta();
        if (!$schema) {
          this.logger.warn("meta-schema not available");
          this.errors = null;
          return true;
        }
        const valid = this.validate($schema, schema);
        if (!valid && throwOrLogError) {
          const message = "schema is invalid: " + this.errorsText();
          if (this.opts.validateSchema === "log")
            this.logger.error(message);
          else
            throw new Error(message);
        }
        return valid;
      }
      // Get compiled schema by `key` or `ref`.
      // (`key` that was passed to `addSchema` or full schema reference - `schema.$id` or resolved id)
      getSchema(keyRef) {
        let sch;
        while (typeof (sch = getSchEnv.call(this, keyRef)) == "string")
          keyRef = sch;
        if (sch === void 0) {
          const { schemaId } = this.opts;
          const root = new compile_1.SchemaEnv({ schema: {}, schemaId });
          sch = compile_1.resolveSchema.call(this, root, keyRef);
          if (!sch)
            return;
          this.refs[keyRef] = sch;
        }
        return sch.validate || this._compileSchemaEnv(sch);
      }
      // Remove cached schema(s).
      // If no parameter is passed all schemas but meta-schemas are removed.
      // If RegExp is passed all schemas with key/id matching pattern but meta-schemas are removed.
      // Even if schema is referenced by other schemas it still can be removed as other schemas have local references.
      removeSchema(schemaKeyRef) {
        if (schemaKeyRef instanceof RegExp) {
          this._removeAllSchemas(this.schemas, schemaKeyRef);
          this._removeAllSchemas(this.refs, schemaKeyRef);
          return this;
        }
        switch (typeof schemaKeyRef) {
          case "undefined":
            this._removeAllSchemas(this.schemas);
            this._removeAllSchemas(this.refs);
            this._cache.clear();
            return this;
          case "string": {
            const sch = getSchEnv.call(this, schemaKeyRef);
            if (typeof sch == "object")
              this._cache.delete(sch.schema);
            delete this.schemas[schemaKeyRef];
            delete this.refs[schemaKeyRef];
            return this;
          }
          case "object": {
            const cacheKey2 = schemaKeyRef;
            this._cache.delete(cacheKey2);
            let id = schemaKeyRef[this.opts.schemaId];
            if (id) {
              id = (0, resolve_1.normalizeId)(id);
              delete this.schemas[id];
              delete this.refs[id];
            }
            return this;
          }
          default:
            throw new Error("ajv.removeSchema: invalid parameter");
        }
      }
      // add "vocabulary" - a collection of keywords
      addVocabulary(definitions) {
        for (const def of definitions)
          this.addKeyword(def);
        return this;
      }
      addKeyword(kwdOrDef, def) {
        let keyword;
        if (typeof kwdOrDef == "string") {
          keyword = kwdOrDef;
          if (typeof def == "object") {
            this.logger.warn("these parameters are deprecated, see docs for addKeyword");
            def.keyword = keyword;
          }
        } else if (typeof kwdOrDef == "object" && def === void 0) {
          def = kwdOrDef;
          keyword = def.keyword;
          if (Array.isArray(keyword) && !keyword.length) {
            throw new Error("addKeywords: keyword must be string or non-empty array");
          }
        } else {
          throw new Error("invalid addKeywords parameters");
        }
        checkKeyword.call(this, keyword, def);
        if (!def) {
          (0, util_1.eachItem)(keyword, (kwd) => addRule.call(this, kwd));
          return this;
        }
        keywordMetaschema.call(this, def);
        const definition = {
          ...def,
          type: (0, dataType_1.getJSONTypes)(def.type),
          schemaType: (0, dataType_1.getJSONTypes)(def.schemaType)
        };
        (0, util_1.eachItem)(keyword, definition.type.length === 0 ? (k) => addRule.call(this, k, definition) : (k) => definition.type.forEach((t) => addRule.call(this, k, definition, t)));
        return this;
      }
      getKeyword(keyword) {
        const rule = this.RULES.all[keyword];
        return typeof rule == "object" ? rule.definition : !!rule;
      }
      // Remove keyword
      removeKeyword(keyword) {
        const { RULES } = this;
        delete RULES.keywords[keyword];
        delete RULES.all[keyword];
        for (const group of RULES.rules) {
          const i = group.rules.findIndex((rule) => rule.keyword === keyword);
          if (i >= 0)
            group.rules.splice(i, 1);
        }
        return this;
      }
      // Add format
      addFormat(name, format) {
        if (typeof format == "string")
          format = new RegExp(format);
        this.formats[name] = format;
        return this;
      }
      errorsText(errors = this.errors, { separator = ", ", dataVar = "data" } = {}) {
        if (!errors || errors.length === 0)
          return "No errors";
        return errors.map((e) => `${dataVar}${e.instancePath} ${e.message}`).reduce((text, msg) => text + separator + msg);
      }
      $dataMetaSchema(metaSchema, keywordsJsonPointers) {
        const rules = this.RULES.all;
        metaSchema = JSON.parse(JSON.stringify(metaSchema));
        for (const jsonPointer of keywordsJsonPointers) {
          const segments = jsonPointer.split("/").slice(1);
          let keywords = metaSchema;
          for (const seg of segments)
            keywords = keywords[seg];
          for (const key in rules) {
            const rule = rules[key];
            if (typeof rule != "object")
              continue;
            const { $data } = rule.definition;
            const schema = keywords[key];
            if ($data && schema)
              keywords[key] = schemaOrData(schema);
          }
        }
        return metaSchema;
      }
      _removeAllSchemas(schemas, regex) {
        for (const keyRef in schemas) {
          const sch = schemas[keyRef];
          if (!regex || regex.test(keyRef)) {
            if (typeof sch == "string") {
              delete schemas[keyRef];
            } else if (sch && !sch.meta) {
              this._cache.delete(sch.schema);
              delete schemas[keyRef];
            }
          }
        }
      }
      _addSchema(schema, meta3, baseId, validateSchema = this.opts.validateSchema, addSchema = this.opts.addUsedSchema) {
        let id;
        const { schemaId } = this.opts;
        if (typeof schema == "object") {
          id = schema[schemaId];
        } else {
          if (this.opts.jtd)
            throw new Error("schema must be object");
          else if (typeof schema != "boolean")
            throw new Error("schema must be object or boolean");
        }
        let sch = this._cache.get(schema);
        if (sch !== void 0)
          return sch;
        baseId = (0, resolve_1.normalizeId)(id || baseId);
        const localRefs = resolve_1.getSchemaRefs.call(this, schema, baseId);
        sch = new compile_1.SchemaEnv({ schema, schemaId, meta: meta3, baseId, localRefs });
        this._cache.set(sch.schema, sch);
        if (addSchema && !baseId.startsWith("#")) {
          if (baseId)
            this._checkUnique(baseId);
          this.refs[baseId] = sch;
        }
        if (validateSchema)
          this.validateSchema(schema, true);
        return sch;
      }
      _checkUnique(id) {
        if (this.schemas[id] || this.refs[id]) {
          throw new Error(`schema with key or id "${id}" already exists`);
        }
      }
      _compileSchemaEnv(sch) {
        if (sch.meta)
          this._compileMetaSchema(sch);
        else
          compile_1.compileSchema.call(this, sch);
        if (!sch.validate)
          throw new Error("ajv implementation error");
        return sch.validate;
      }
      _compileMetaSchema(sch) {
        const currentOpts = this.opts;
        this.opts = this._metaOpts;
        try {
          compile_1.compileSchema.call(this, sch);
        } finally {
          this.opts = currentOpts;
        }
      }
    };
    Ajv2.ValidationError = validation_error_1.default;
    Ajv2.MissingRefError = ref_error_1.default;
    exports2.default = Ajv2;
    function checkOptions(checkOpts, options2, msg, log = "error") {
      for (const key in checkOpts) {
        const opt = key;
        if (opt in options2)
          this.logger[log](`${msg}: option ${key}. ${checkOpts[opt]}`);
      }
    }
    function getSchEnv(keyRef) {
      keyRef = (0, resolve_1.normalizeId)(keyRef);
      return this.schemas[keyRef] || this.refs[keyRef];
    }
    function addInitialSchemas() {
      const optsSchemas = this.opts.schemas;
      if (!optsSchemas)
        return;
      if (Array.isArray(optsSchemas))
        this.addSchema(optsSchemas);
      else
        for (const key in optsSchemas)
          this.addSchema(optsSchemas[key], key);
    }
    function addInitialFormats() {
      for (const name in this.opts.formats) {
        const format = this.opts.formats[name];
        if (format)
          this.addFormat(name, format);
      }
    }
    function addInitialKeywords(defs) {
      if (Array.isArray(defs)) {
        this.addVocabulary(defs);
        return;
      }
      this.logger.warn("keywords option as map is deprecated, pass array");
      for (const keyword in defs) {
        const def = defs[keyword];
        if (!def.keyword)
          def.keyword = keyword;
        this.addKeyword(def);
      }
    }
    function getMetaSchemaOptions() {
      const metaOpts = { ...this.opts };
      for (const opt of META_IGNORE_OPTIONS)
        delete metaOpts[opt];
      return metaOpts;
    }
    var noLogs = { log() {
    }, warn() {
    }, error() {
    } };
    function getLogger(logger) {
      if (logger === false)
        return noLogs;
      if (logger === void 0)
        return console;
      if (logger.log && logger.warn && logger.error)
        return logger;
      throw new Error("logger must implement log, warn and error methods");
    }
    var KEYWORD_NAME = /^[a-z_$][a-z0-9_$:-]*$/i;
    function checkKeyword(keyword, def) {
      const { RULES } = this;
      (0, util_1.eachItem)(keyword, (kwd) => {
        if (RULES.keywords[kwd])
          throw new Error(`Keyword ${kwd} is already defined`);
        if (!KEYWORD_NAME.test(kwd))
          throw new Error(`Keyword ${kwd} has invalid name`);
      });
      if (!def)
        return;
      if (def.$data && !("code" in def || "validate" in def)) {
        throw new Error('$data keyword must have "code" or "validate" function');
      }
    }
    function addRule(keyword, definition, dataType) {
      var _a2;
      const post = definition === null || definition === void 0 ? void 0 : definition.post;
      if (dataType && post)
        throw new Error('keyword with "post" flag cannot have "type"');
      const { RULES } = this;
      let ruleGroup = post ? RULES.post : RULES.rules.find(({ type: t }) => t === dataType);
      if (!ruleGroup) {
        ruleGroup = { type: dataType, rules: [] };
        RULES.rules.push(ruleGroup);
      }
      RULES.keywords[keyword] = true;
      if (!definition)
        return;
      const rule = {
        keyword,
        definition: {
          ...definition,
          type: (0, dataType_1.getJSONTypes)(definition.type),
          schemaType: (0, dataType_1.getJSONTypes)(definition.schemaType)
        }
      };
      if (definition.before)
        addBeforeRule.call(this, ruleGroup, rule, definition.before);
      else
        ruleGroup.rules.push(rule);
      RULES.all[keyword] = rule;
      (_a2 = definition.implements) === null || _a2 === void 0 ? void 0 : _a2.forEach((kwd) => this.addKeyword(kwd));
    }
    function addBeforeRule(ruleGroup, rule, before) {
      const i = ruleGroup.rules.findIndex((_rule) => _rule.keyword === before);
      if (i >= 0) {
        ruleGroup.rules.splice(i, 0, rule);
      } else {
        ruleGroup.rules.push(rule);
        this.logger.warn(`rule ${before} is not defined`);
      }
    }
    function keywordMetaschema(def) {
      let { metaSchema } = def;
      if (metaSchema === void 0)
        return;
      if (def.$data && this.opts.$data)
        metaSchema = schemaOrData(metaSchema);
      def.validateSchema = this.compile(metaSchema, true);
    }
    var $dataRef = {
      $ref: "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"
    };
    function schemaOrData(schema) {
      return { anyOf: [schema, $dataRef] };
    }
  }
});

// node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/core/id.js
var require_id = __commonJS({
  "node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/core/id.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    var def = {
      keyword: "id",
      code() {
        throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID');
      }
    };
    exports2.default = def;
  }
});

// node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/core/ref.js
var require_ref = __commonJS({
  "node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/core/ref.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.callRef = exports2.getValidate = void 0;
    var ref_error_1 = require_ref_error();
    var code_1 = require_code2();
    var codegen_1 = require_codegen();
    var names_1 = require_names();
    var compile_1 = require_compile2();
    var util_1 = require_util4();
    var def = {
      keyword: "$ref",
      schemaType: "string",
      code(cxt) {
        const { gen, schema: $ref, it } = cxt;
        const { baseId, schemaEnv: env, validateName, opts, self } = it;
        const { root } = env;
        if (($ref === "#" || $ref === "#/") && baseId === root.baseId)
          return callRootRef();
        const schOrEnv = compile_1.resolveRef.call(self, root, baseId, $ref);
        if (schOrEnv === void 0)
          throw new ref_error_1.default(it.opts.uriResolver, baseId, $ref);
        if (schOrEnv instanceof compile_1.SchemaEnv)
          return callValidate(schOrEnv);
        return inlineRefSchema(schOrEnv);
        function callRootRef() {
          if (env === root)
            return callRef(cxt, validateName, env, env.$async);
          const rootName = gen.scopeValue("root", { ref: root });
          return callRef(cxt, (0, codegen_1._)`${rootName}.validate`, root, root.$async);
        }
        function callValidate(sch) {
          const v = getValidate(cxt, sch);
          callRef(cxt, v, sch, sch.$async);
        }
        function inlineRefSchema(sch) {
          const schName = gen.scopeValue("schema", opts.code.source === true ? { ref: sch, code: (0, codegen_1.stringify)(sch) } : { ref: sch });
          const valid = gen.name("valid");
          const schCxt = cxt.subschema({
            schema: sch,
            dataTypes: [],
            schemaPath: codegen_1.nil,
            topSchemaRef: schName,
            errSchemaPath: $ref
          }, valid);
          cxt.mergeEvaluated(schCxt);
          cxt.ok(valid);
        }
      }
    };
    function getValidate(cxt, sch) {
      const { gen } = cxt;
      return sch.validate ? gen.scopeValue("validate", { ref: sch.validate }) : (0, codegen_1._)`${gen.scopeValue("wrapper", { ref: sch })}.validate`;
    }
    exports2.getValidate = getValidate;
    function callRef(cxt, v, sch, $async) {
      const { gen, it } = cxt;
      const { allErrors, schemaEnv: env, opts } = it;
      const passCxt = opts.passContext ? names_1.default.this : codegen_1.nil;
      if ($async)
        callAsyncRef();
      else
        callSyncRef();
      function callAsyncRef() {
        if (!env.$async)
          throw new Error("async schema referenced by sync schema");
        const valid = gen.let("valid");
        gen.try(() => {
          gen.code((0, codegen_1._)`await ${(0, code_1.callValidateCode)(cxt, v, passCxt)}`);
          addEvaluatedFrom(v);
          if (!allErrors)
            gen.assign(valid, true);
        }, (e) => {
          gen.if((0, codegen_1._)`!(${e} instanceof ${it.ValidationError})`, () => gen.throw(e));
          addErrorsFrom(e);
          if (!allErrors)
            gen.assign(valid, false);
        });
        cxt.ok(valid);
      }
      function callSyncRef() {
        cxt.result((0, code_1.callValidateCode)(cxt, v, passCxt), () => addEvaluatedFrom(v), () => addErrorsFrom(v));
      }
      function addErrorsFrom(source) {
        const errs = (0, codegen_1._)`${source}.errors`;
        gen.assign(names_1.default.vErrors, (0, codegen_1._)`${names_1.default.vErrors} === null ? ${errs} : ${names_1.default.vErrors}.concat(${errs})`);
        gen.assign(names_1.default.errors, (0, codegen_1._)`${names_1.default.vErrors}.length`);
      }
      function addEvaluatedFrom(source) {
        var _a2;
        if (!it.opts.unevaluated)
          return;
        const schEvaluated = (_a2 = sch === null || sch === void 0 ? void 0 : sch.validate) === null || _a2 === void 0 ? void 0 : _a2.evaluated;
        if (it.props !== true) {
          if (schEvaluated && !schEvaluated.dynamicProps) {
            if (schEvaluated.props !== void 0) {
              it.props = util_1.mergeEvaluated.props(gen, schEvaluated.props, it.props);
            }
          } else {
            const props = gen.var("props", (0, codegen_1._)`${source}.evaluated.props`);
            it.props = util_1.mergeEvaluated.props(gen, props, it.props, codegen_1.Name);
          }
        }
        if (it.items !== true) {
          if (schEvaluated && !schEvaluated.dynamicItems) {
            if (schEvaluated.items !== void 0) {
              it.items = util_1.mergeEvaluated.items(gen, schEvaluated.items, it.items);
            }
          } else {
            const items = gen.var("items", (0, codegen_1._)`${source}.evaluated.items`);
            it.items = util_1.mergeEvaluated.items(gen, items, it.items, codegen_1.Name);
          }
        }
      }
    }
    exports2.callRef = callRef;
    exports2.default = def;
  }
});

// node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/core/index.js
var require_core2 = __commonJS({
  "node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/core/index.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    var id_1 = require_id();
    var ref_1 = require_ref();
    var core = [
      "$schema",
      "$id",
      "$defs",
      "$vocabulary",
      { keyword: "$comment" },
      "definitions",
      id_1.default,
      ref_1.default
    ];
    exports2.default = core;
  }
});

// node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/limitNumber.js
var require_limitNumber = __commonJS({
  "node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/limitNumber.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    var codegen_1 = require_codegen();
    var ops = codegen_1.operators;
    var KWDs = {
      maximum: { okStr: "<=", ok: ops.LTE, fail: ops.GT },
      minimum: { okStr: ">=", ok: ops.GTE, fail: ops.LT },
      exclusiveMaximum: { okStr: "<", ok: ops.LT, fail: ops.GTE },
      exclusiveMinimum: { okStr: ">", ok: ops.GT, fail: ops.LTE }
    };
    var error48 = {
      message: ({ keyword, schemaCode }) => (0, codegen_1.str)`must be ${KWDs[keyword].okStr} ${schemaCode}`,
      params: ({ keyword, schemaCode }) => (0, codegen_1._)`{comparison: ${KWDs[keyword].okStr}, limit: ${schemaCode}}`
    };
    var def = {
      keyword: Object.keys(KWDs),
      type: "number",
      schemaType: "number",
      $data: true,
      error: error48,
      code(cxt) {
        const { keyword, data, schemaCode } = cxt;
        cxt.fail$data((0, codegen_1._)`${data} ${KWDs[keyword].fail} ${schemaCode} || isNaN(${data})`);
      }
    };
    exports2.default = def;
  }
});

// node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/multipleOf.js
var require_multipleOf = __commonJS({
  "node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/multipleOf.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    var codegen_1 = require_codegen();
    var error48 = {
      message: ({ schemaCode }) => (0, codegen_1.str)`must be multiple of ${schemaCode}`,
      params: ({ schemaCode }) => (0, codegen_1._)`{multipleOf: ${schemaCode}}`
    };
    var def = {
      keyword: "multipleOf",
      type: "number",
      schemaType: "number",
      $data: true,
      error: error48,
      code(cxt) {
        const { gen, data, schemaCode, it } = cxt;
        const prec = it.opts.multipleOfPrecision;
        const res = gen.let("res");
        const invalid = prec ? (0, codegen_1._)`Math.abs(Math.round(${res}) - ${res}) > 1e-${prec}` : (0, codegen_1._)`${res} !== parseInt(${res})`;
        cxt.fail$data((0, codegen_1._)`(${schemaCode} === 0 || (${res} = ${data}/${schemaCode}, ${invalid}))`);
      }
    };
    exports2.default = def;
  }
});

// node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/runtime/ucs2length.js
var require_ucs2length = __commonJS({
  "node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/runtime/ucs2length.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    function ucs2length(str) {
      const len = str.length;
      let length = 0;
      let pos = 0;
      let value;
      while (pos < len) {
        length++;
        value = str.charCodeAt(pos++);
        if (value >= 55296 && value <= 56319 && pos < len) {
          value = str.charCodeAt(pos);
          if ((value & 64512) === 56320)
            pos++;
        }
      }
      return length;
    }
    exports2.default = ucs2length;
    ucs2length.code = 'require("ajv/dist/runtime/ucs2length").default';
  }
});

// node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/limitLength.js
var require_limitLength = __commonJS({
  "node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/limitLength.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    var codegen_1 = require_codegen();
    var util_1 = require_util4();
    var ucs2length_1 = require_ucs2length();
    var error48 = {
      message({ keyword, schemaCode }) {
        const comp = keyword === "maxLength" ? "more" : "fewer";
        return (0, codegen_1.str)`must NOT have ${comp} than ${schemaCode} characters`;
      },
      params: ({ schemaCode }) => (0, codegen_1._)`{limit: ${schemaCode}}`
    };
    var def = {
      keyword: ["maxLength", "minLength"],
      type: "string",
      schemaType: "number",
      $data: true,
      error: error48,
      code(cxt) {
        const { keyword, data, schemaCode, it } = cxt;
        const op = keyword === "maxLength" ? codegen_1.operators.GT : codegen_1.operators.LT;
        const len = it.opts.unicode === false ? (0, codegen_1._)`${data}.length` : (0, codegen_1._)`${(0, util_1.useFunc)(cxt.gen, ucs2length_1.default)}(${data})`;
        cxt.fail$data((0, codegen_1._)`${len} ${op} ${schemaCode}`);
      }
    };
    exports2.default = def;
  }
});

// node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/pattern.js
var require_pattern = __commonJS({
  "node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/pattern.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    var code_1 = require_code2();
    var util_1 = require_util4();
    var codegen_1 = require_codegen();
    var error48 = {
      message: ({ schemaCode }) => (0, codegen_1.str)`must match pattern "${schemaCode}"`,
      params: ({ schemaCode }) => (0, codegen_1._)`{pattern: ${schemaCode}}`
    };
    var def = {
      keyword: "pattern",
      type: "string",
      schemaType: "string",
      $data: true,
      error: error48,
      code(cxt) {
        const { gen, data, $data, schema, schemaCode, it } = cxt;
        const u = it.opts.unicodeRegExp ? "u" : "";
        if ($data) {
          const { regExp } = it.opts.code;
          const regExpCode = regExp.code === "new RegExp" ? (0, codegen_1._)`new RegExp` : (0, util_1.useFunc)(gen, regExp);
          const valid = gen.let("valid");
          gen.try(() => gen.assign(valid, (0, codegen_1._)`${regExpCode}(${schemaCode}, ${u}).test(${data})`), () => gen.assign(valid, false));
          cxt.fail$data((0, codegen_1._)`!${valid}`);
        } else {
          const regExp = (0, code_1.usePattern)(cxt, schema);
          cxt.fail$data((0, codegen_1._)`!${regExp}.test(${data})`);
        }
      }
    };
    exports2.default = def;
  }
});

// node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/limitProperties.js
var require_limitProperties = __commonJS({
  "node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/limitProperties.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    var codegen_1 = require_codegen();
    var error48 = {
      message({ keyword, schemaCode }) {
        const comp = keyword === "maxProperties" ? "more" : "fewer";
        return (0, codegen_1.str)`must NOT have ${comp} than ${schemaCode} properties`;
      },
      params: ({ schemaCode }) => (0, codegen_1._)`{limit: ${schemaCode}}`
    };
    var def = {
      keyword: ["maxProperties", "minProperties"],
      type: "object",
      schemaType: "number",
      $data: true,
      error: error48,
      code(cxt) {
        const { keyword, data, schemaCode } = cxt;
        const op = keyword === "maxProperties" ? codegen_1.operators.GT : codegen_1.operators.LT;
        cxt.fail$data((0, codegen_1._)`Object.keys(${data}).length ${op} ${schemaCode}`);
      }
    };
    exports2.default = def;
  }
});

// node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/required.js
var require_required = __commonJS({
  "node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/required.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    var code_1 = require_code2();
    var codegen_1 = require_codegen();
    var util_1 = require_util4();
    var error48 = {
      message: ({ params: { missingProperty } }) => (0, codegen_1.str)`must have required property '${missingProperty}'`,
      params: ({ params: { missingProperty } }) => (0, codegen_1._)`{missingProperty: ${missingProperty}}`
    };
    var def = {
      keyword: "required",
      type: "object",
      schemaType: "array",
      $data: true,
      error: error48,
      code(cxt) {
        const { gen, schema, schemaCode, data, $data, it } = cxt;
        const { opts } = it;
        if (!$data && schema.length === 0)
          return;
        const useLoop = schema.length >= opts.loopRequired;
        if (it.allErrors)
          allErrorsMode();
        else
          exitOnErrorMode();
        if (opts.strictRequired) {
          const props = cxt.parentSchema.properties;
          const { definedProperties } = cxt.it;
          for (const requiredKey of schema) {
            if ((props === null || props === void 0 ? void 0 : props[requiredKey]) === void 0 && !definedProperties.has(requiredKey)) {
              const schemaPath = it.schemaEnv.baseId + it.errSchemaPath;
              const msg = `required property "${requiredKey}" is not defined at "${schemaPath}" (strictRequired)`;
              (0, util_1.checkStrictMode)(it, msg, it.opts.strictRequired);
            }
          }
        }
        function allErrorsMode() {
          if (useLoop || $data) {
            cxt.block$data(codegen_1.nil, loopAllRequired);
          } else {
            for (const prop of schema) {
              (0, code_1.checkReportMissingProp)(cxt, prop);
            }
          }
        }
        function exitOnErrorMode() {
          const missing = gen.let("missing");
          if (useLoop || $data) {
            const valid = gen.let("valid", true);
            cxt.block$data(valid, () => loopUntilMissing(missing, valid));
            cxt.ok(valid);
          } else {
            gen.if((0, code_1.checkMissingProp)(cxt, schema, missing));
            (0, code_1.reportMissingProp)(cxt, missing);
            gen.else();
          }
        }
        function loopAllRequired() {
          gen.forOf("prop", schemaCode, (prop) => {
            cxt.setParams({ missingProperty: prop });
            gen.if((0, code_1.noPropertyInData)(gen, data, prop, opts.ownProperties), () => cxt.error());
          });
        }
        function loopUntilMissing(missing, valid) {
          cxt.setParams({ missingProperty: missing });
          gen.forOf(missing, schemaCode, () => {
            gen.assign(valid, (0, code_1.propertyInData)(gen, data, missing, opts.ownProperties));
            gen.if((0, codegen_1.not)(valid), () => {
              cxt.error();
              gen.break();
            });
          }, codegen_1.nil);
        }
      }
    };
    exports2.default = def;
  }
});

// node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/limitItems.js
var require_limitItems = __commonJS({
  "node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/limitItems.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    var codegen_1 = require_codegen();
    var error48 = {
      message({ keyword, schemaCode }) {
        const comp = keyword === "maxItems" ? "more" : "fewer";
        return (0, codegen_1.str)`must NOT have ${comp} than ${schemaCode} items`;
      },
      params: ({ schemaCode }) => (0, codegen_1._)`{limit: ${schemaCode}}`
    };
    var def = {
      keyword: ["maxItems", "minItems"],
      type: "array",
      schemaType: "number",
      $data: true,
      error: error48,
      code(cxt) {
        const { keyword, data, schemaCode } = cxt;
        const op = keyword === "maxItems" ? codegen_1.operators.GT : codegen_1.operators.LT;
        cxt.fail$data((0, codegen_1._)`${data}.length ${op} ${schemaCode}`);
      }
    };
    exports2.default = def;
  }
});

// node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/runtime/equal.js
var require_equal = __commonJS({
  "node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/runtime/equal.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    var equal = require_fast_deep_equal();
    equal.code = 'require("ajv/dist/runtime/equal").default';
    exports2.default = equal;
  }
});

// node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js
var require_uniqueItems = __commonJS({
  "node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    var dataType_1 = require_dataType();
    var codegen_1 = require_codegen();
    var util_1 = require_util4();
    var equal_1 = require_equal();
    var error48 = {
      message: ({ params: { i, j } }) => (0, codegen_1.str)`must NOT have duplicate items (items ## ${j} and ${i} are identical)`,
      params: ({ params: { i, j } }) => (0, codegen_1._)`{i: ${i}, j: ${j}}`
    };
    var def = {
      keyword: "uniqueItems",
      type: "array",
      schemaType: "boolean",
      $data: true,
      error: error48,
      code(cxt) {
        const { gen, data, $data, schema, parentSchema, schemaCode, it } = cxt;
        if (!$data && !schema)
          return;
        const valid = gen.let("valid");
        const itemTypes = parentSchema.items ? (0, dataType_1.getSchemaTypes)(parentSchema.items) : [];
        cxt.block$data(valid, validateUniqueItems, (0, codegen_1._)`${schemaCode} === false`);
        cxt.ok(valid);
        function validateUniqueItems() {
          const i = gen.let("i", (0, codegen_1._)`${data}.length`);
          const j = gen.let("j");
          cxt.setParams({ i, j });
          gen.assign(valid, true);
          gen.if((0, codegen_1._)`${i} > 1`, () => (canOptimize() ? loopN : loopN2)(i, j));
        }
        function canOptimize() {
          return itemTypes.length > 0 && !itemTypes.some((t) => t === "object" || t === "array");
        }
        function loopN(i, j) {
          const item = gen.name("item");
          const wrongType = (0, dataType_1.checkDataTypes)(itemTypes, item, it.opts.strictNumbers, dataType_1.DataType.Wrong);
          const indices = gen.const("indices", (0, codegen_1._)`{}`);
          gen.for((0, codegen_1._)`;${i}--;`, () => {
            gen.let(item, (0, codegen_1._)`${data}[${i}]`);
            gen.if(wrongType, (0, codegen_1._)`continue`);
            if (itemTypes.length > 1)
              gen.if((0, codegen_1._)`typeof ${item} == "string"`, (0, codegen_1._)`${item} += "_"`);
            gen.if((0, codegen_1._)`typeof ${indices}[${item}] == "number"`, () => {
              gen.assign(j, (0, codegen_1._)`${indices}[${item}]`);
              cxt.error();
              gen.assign(valid, false).break();
            }).code((0, codegen_1._)`${indices}[${item}] = ${i}`);
          });
        }
        function loopN2(i, j) {
          const eql = (0, util_1.useFunc)(gen, equal_1.default);
          const outer = gen.name("outer");
          gen.label(outer).for((0, codegen_1._)`;${i}--;`, () => gen.for((0, codegen_1._)`${j} = ${i}; ${j}--;`, () => gen.if((0, codegen_1._)`${eql}(${data}[${i}], ${data}[${j}])`, () => {
            cxt.error();
            gen.assign(valid, false).break(outer);
          })));
        }
      }
    };
    exports2.default = def;
  }
});

// node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/const.js
var require_const = __commonJS({
  "node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/const.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    var codegen_1 = require_codegen();
    var util_1 = require_util4();
    var equal_1 = require_equal();
    var error48 = {
      message: "must be equal to constant",
      params: ({ schemaCode }) => (0, codegen_1._)`{allowedValue: ${schemaCode}}`
    };
    var def = {
      keyword: "const",
      $data: true,
      error: error48,
      code(cxt) {
        const { gen, data, $data, schemaCode, schema } = cxt;
        if ($data || schema && typeof schema == "object") {
          cxt.fail$data((0, codegen_1._)`!${(0, util_1.useFunc)(gen, equal_1.default)}(${data}, ${schemaCode})`);
        } else {
          cxt.fail((0, codegen_1._)`${schema} !== ${data}`);
        }
      }
    };
    exports2.default = def;
  }
});

// node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/enum.js
var require_enum = __commonJS({
  "node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/enum.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    var codegen_1 = require_codegen();
    var util_1 = require_util4();
    var equal_1 = require_equal();
    var error48 = {
      message: "must be equal to one of the allowed values",
      params: ({ schemaCode }) => (0, codegen_1._)`{allowedValues: ${schemaCode}}`
    };
    var def = {
      keyword: "enum",
      schemaType: "array",
      $data: true,
      error: error48,
      code(cxt) {
        const { gen, data, $data, schema, schemaCode, it } = cxt;
        if (!$data && schema.length === 0)
          throw new Error("enum must have non-empty array");
        const useLoop = schema.length >= it.opts.loopEnum;
        let eql;
        const getEql = () => eql !== null && eql !== void 0 ? eql : eql = (0, util_1.useFunc)(gen, equal_1.default);
        let valid;
        if (useLoop || $data) {
          valid = gen.let("valid");
          cxt.block$data(valid, loopEnum);
        } else {
          if (!Array.isArray(schema))
            throw new Error("ajv implementation error");
          const vSchema = gen.const("vSchema", schemaCode);
          valid = (0, codegen_1.or)(...schema.map((_x, i) => equalCode(vSchema, i)));
        }
        cxt.pass(valid);
        function loopEnum() {
          gen.assign(valid, false);
          gen.forOf("v", schemaCode, (v) => gen.if((0, codegen_1._)`${getEql()}(${data}, ${v})`, () => gen.assign(valid, true).break()));
        }
        function equalCode(vSchema, i) {
          const sch = schema[i];
          return typeof sch === "object" && sch !== null ? (0, codegen_1._)`${getEql()}(${data}, ${vSchema}[${i}])` : (0, codegen_1._)`${data} === ${sch}`;
        }
      }
    };
    exports2.default = def;
  }
});

// node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/index.js
var require_validation2 = __commonJS({
  "node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/index.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    var limitNumber_1 = require_limitNumber();
    var multipleOf_1 = require_multipleOf();
    var limitLength_1 = require_limitLength();
    var pattern_1 = require_pattern();
    var limitProperties_1 = require_limitProperties();
    var required_1 = require_required();
    var limitItems_1 = require_limitItems();
    var uniqueItems_1 = require_uniqueItems();
    var const_1 = require_const();
    var enum_1 = require_enum();
    var validation = [
      // number
      limitNumber_1.default,
      multipleOf_1.default,
      // string
      limitLength_1.default,
      pattern_1.default,
      // object
      limitProperties_1.default,
      required_1.default,
      // array
      limitItems_1.default,
      uniqueItems_1.default,
      // any
      { keyword: "type", schemaType: ["string", "array"] },
      { keyword: "nullable", schemaType: "boolean" },
      const_1.default,
      enum_1.default
    ];
    exports2.default = validation;
  }
});

// node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js
var require_additionalItems = __commonJS({
  "node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.validateAdditionalItems = void 0;
    var codegen_1 = require_codegen();
    var util_1 = require_util4();
    var error48 = {
      message: ({ params: { len } }) => (0, codegen_1.str)`must NOT have more than ${len} items`,
      params: ({ params: { len } }) => (0, codegen_1._)`{limit: ${len}}`
    };
    var def = {
      keyword: "additionalItems",
      type: "array",
      schemaType: ["boolean", "object"],
      before: "uniqueItems",
      error: error48,
      code(cxt) {
        const { parentSchema, it } = cxt;
        const { items } = parentSchema;
        if (!Array.isArray(items)) {
          (0, util_1.checkStrictMode)(it, '"additionalItems" is ignored when "items" is not an array of schemas');
          return;
        }
        validateAdditionalItems(cxt, items);
      }
    };
    function validateAdditionalItems(cxt, items) {
      const { gen, schema, data, keyword, it } = cxt;
      it.items = true;
      const len = gen.const("len", (0, codegen_1._)`${data}.length`);
      if (schema === false) {
        cxt.setParams({ len: items.length });
        cxt.pass((0, codegen_1._)`${len} <= ${items.length}`);
      } else if (typeof schema == "object" && !(0, util_1.alwaysValidSchema)(it, schema)) {
        const valid = gen.var("valid", (0, codegen_1._)`${len} <= ${items.length}`);
        gen.if((0, codegen_1.not)(valid), () => validateItems(valid));
        cxt.ok(valid);
      }
      function validateItems(valid) {
        gen.forRange("i", items.length, len, (i) => {
          cxt.subschema({ keyword, dataProp: i, dataPropType: util_1.Type.Num }, valid);
          if (!it.allErrors)
            gen.if((0, codegen_1.not)(valid), () => gen.break());
        });
      }
    }
    exports2.validateAdditionalItems = validateAdditionalItems;
    exports2.default = def;
  }
});

// node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/items.js
var require_items = __commonJS({
  "node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/items.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.validateTuple = void 0;
    var codegen_1 = require_codegen();
    var util_1 = require_util4();
    var code_1 = require_code2();
    var def = {
      keyword: "items",
      type: "array",
      schemaType: ["object", "array", "boolean"],
      before: "uniqueItems",
      code(cxt) {
        const { schema, it } = cxt;
        if (Array.isArray(schema))
          return validateTuple(cxt, "additionalItems", schema);
        it.items = true;
        if ((0, util_1.alwaysValidSchema)(it, schema))
          return;
        cxt.ok((0, code_1.validateArray)(cxt));
      }
    };
    function validateTuple(cxt, extraItems, schArr = cxt.schema) {
      const { gen, parentSchema, data, keyword, it } = cxt;
      checkStrictTuple(parentSchema);
      if (it.opts.unevaluated && schArr.length && it.items !== true) {
        it.items = util_1.mergeEvaluated.items(gen, schArr.length, it.items);
      }
      const valid = gen.name("valid");
      const len = gen.const("len", (0, codegen_1._)`${data}.length`);
      schArr.forEach((sch, i) => {
        if ((0, util_1.alwaysValidSchema)(it, sch))
          return;
        gen.if((0, codegen_1._)`${len} > ${i}`, () => cxt.subschema({
          keyword,
          schemaProp: i,
          dataProp: i
        }, valid));
        cxt.ok(valid);
      });
      function checkStrictTuple(sch) {
        const { opts, errSchemaPath } = it;
        const l = schArr.length;
        const fullTuple = l === sch.minItems && (l === sch.maxItems || sch[extraItems] === false);
        if (opts.strictTuples && !fullTuple) {
          const msg = `"${keyword}" is ${l}-tuple, but minItems or maxItems/${extraItems} are not specified or different at path "${errSchemaPath}"`;
          (0, util_1.checkStrictMode)(it, msg, opts.strictTuples);
        }
      }
    }
    exports2.validateTuple = validateTuple;
    exports2.default = def;
  }
});

// node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js
var require_prefixItems = __commonJS({
  "node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    var items_1 = require_items();
    var def = {
      keyword: "prefixItems",
      type: "array",
      schemaType: ["array"],
      before: "uniqueItems",
      code: (cxt) => (0, items_1.validateTuple)(cxt, "items")
    };
    exports2.default = def;
  }
});

// node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/items2020.js
var require_items2020 = __commonJS({
  "node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/items2020.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    var codegen_1 = require_codegen();
    var util_1 = require_util4();
    var code_1 = require_code2();
    var additionalItems_1 = require_additionalItems();
    var error48 = {
      message: ({ params: { len } }) => (0, codegen_1.str)`must NOT have more than ${len} items`,
      params: ({ params: { len } }) => (0, codegen_1._)`{limit: ${len}}`
    };
    var def = {
      keyword: "items",
      type: "array",
      schemaType: ["object", "boolean"],
      before: "uniqueItems",
      error: error48,
      code(cxt) {
        const { schema, parentSchema, it } = cxt;
        const { prefixItems } = parentSchema;
        it.items = true;
        if ((0, util_1.alwaysValidSchema)(it, schema))
          return;
        if (prefixItems)
          (0, additionalItems_1.validateAdditionalItems)(cxt, prefixItems);
        else
          cxt.ok((0, code_1.validateArray)(cxt));
      }
    };
    exports2.default = def;
  }
});

// node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/contains.js
var require_contains = __commonJS({
  "node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/contains.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    var codegen_1 = require_codegen();
    var util_1 = require_util4();
    var error48 = {
      message: ({ params: { min, max } }) => max === void 0 ? (0, codegen_1.str)`must contain at least ${min} valid item(s)` : (0, codegen_1.str)`must contain at least ${min} and no more than ${max} valid item(s)`,
      params: ({ params: { min, max } }) => max === void 0 ? (0, codegen_1._)`{minContains: ${min}}` : (0, codegen_1._)`{minContains: ${min}, maxContains: ${max}}`
    };
    var def = {
      keyword: "contains",
      type: "array",
      schemaType: ["object", "boolean"],
      before: "uniqueItems",
      trackErrors: true,
      error: error48,
      code(cxt) {
        const { gen, schema, parentSchema, data, it } = cxt;
        let min;
        let max;
        const { minContains, maxContains } = parentSchema;
        if (it.opts.next) {
          min = minContains === void 0 ? 1 : minContains;
          max = maxContains;
        } else {
          min = 1;
        }
        const len = gen.const("len", (0, codegen_1._)`${data}.length`);
        cxt.setParams({ min, max });
        if (max === void 0 && min === 0) {
          (0, util_1.checkStrictMode)(it, `"minContains" == 0 without "maxContains": "contains" keyword ignored`);
          return;
        }
        if (max !== void 0 && min > max) {
          (0, util_1.checkStrictMode)(it, `"minContains" > "maxContains" is always invalid`);
          cxt.fail();
          return;
        }
        if ((0, util_1.alwaysValidSchema)(it, schema)) {
          let cond = (0, codegen_1._)`${len} >= ${min}`;
          if (max !== void 0)
            cond = (0, codegen_1._)`${cond} && ${len} <= ${max}`;
          cxt.pass(cond);
          return;
        }
        it.items = true;
        const valid = gen.name("valid");
        if (max === void 0 && min === 1) {
          validateItems(valid, () => gen.if(valid, () => gen.break()));
        } else if (min === 0) {
          gen.let(valid, true);
          if (max !== void 0)
            gen.if((0, codegen_1._)`${data}.length > 0`, validateItemsWithCount);
        } else {
          gen.let(valid, false);
          validateItemsWithCount();
        }
        cxt.result(valid, () => cxt.reset());
        function validateItemsWithCount() {
          const schValid = gen.name("_valid");
          const count = gen.let("count", 0);
          validateItems(schValid, () => gen.if(schValid, () => checkLimits(count)));
        }
        function validateItems(_valid, block) {
          gen.forRange("i", 0, len, (i) => {
            cxt.subschema({
              keyword: "contains",
              dataProp: i,
              dataPropType: util_1.Type.Num,
              compositeRule: true
            }, _valid);
            block();
          });
        }
        function checkLimits(count) {
          gen.code((0, codegen_1._)`${count}++`);
          if (max === void 0) {
            gen.if((0, codegen_1._)`${count} >= ${min}`, () => gen.assign(valid, true).break());
          } else {
            gen.if((0, codegen_1._)`${count} > ${max}`, () => gen.assign(valid, false).break());
            if (min === 1)
              gen.assign(valid, true);
            else
              gen.if((0, codegen_1._)`${count} >= ${min}`, () => gen.assign(valid, true));
          }
        }
      }
    };
    exports2.default = def;
  }
});

// node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/dependencies.js
var require_dependencies = __commonJS({
  "node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/dependencies.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.validateSchemaDeps = exports2.validatePropertyDeps = exports2.error = void 0;
    var codegen_1 = require_codegen();
    var util_1 = require_util4();
    var code_1 = require_code2();
    exports2.error = {
      message: ({ params: { property, depsCount, deps } }) => {
        const property_ies = depsCount === 1 ? "property" : "properties";
        return (0, codegen_1.str)`must have ${property_ies} ${deps} when property ${property} is present`;
      },
      params: ({ params: { property, depsCount, deps, missingProperty } }) => (0, codegen_1._)`{property: ${property},
    missingProperty: ${missingProperty},
    depsCount: ${depsCount},
    deps: ${deps}}`
      // TODO change to reference
    };
    var def = {
      keyword: "dependencies",
      type: "object",
      schemaType: "object",
      error: exports2.error,
      code(cxt) {
        const [propDeps, schDeps] = splitDependencies(cxt);
        validatePropertyDeps(cxt, propDeps);
        validateSchemaDeps(cxt, schDeps);
      }
    };
    function splitDependencies({ schema }) {
      const propertyDeps = {};
      const schemaDeps = {};
      for (const key in schema) {
        if (key === "__proto__")
          continue;
        const deps = Array.isArray(schema[key]) ? propertyDeps : schemaDeps;
        deps[key] = schema[key];
      }
      return [propertyDeps, schemaDeps];
    }
    function validatePropertyDeps(cxt, propertyDeps = cxt.schema) {
      const { gen, data, it } = cxt;
      if (Object.keys(propertyDeps).length === 0)
        return;
      const missing = gen.let("missing");
      for (const prop in propertyDeps) {
        const deps = propertyDeps[prop];
        if (deps.length === 0)
          continue;
        const hasProperty = (0, code_1.propertyInData)(gen, data, prop, it.opts.ownProperties);
        cxt.setParams({
          property: prop,
          depsCount: deps.length,
          deps: deps.join(", ")
        });
        if (it.allErrors) {
          gen.if(hasProperty, () => {
            for (const depProp of deps) {
              (0, code_1.checkReportMissingProp)(cxt, depProp);
            }
          });
        } else {
          gen.if((0, codegen_1._)`${hasProperty} && (${(0, code_1.checkMissingProp)(cxt, deps, missing)})`);
          (0, code_1.reportMissingProp)(cxt, missing);
          gen.else();
        }
      }
    }
    exports2.validatePropertyDeps = validatePropertyDeps;
    function validateSchemaDeps(cxt, schemaDeps = cxt.schema) {
      const { gen, data, keyword, it } = cxt;
      const valid = gen.name("valid");
      for (const prop in schemaDeps) {
        if ((0, util_1.alwaysValidSchema)(it, schemaDeps[prop]))
          continue;
        gen.if(
          (0, code_1.propertyInData)(gen, data, prop, it.opts.ownProperties),
          () => {
            const schCxt = cxt.subschema({ keyword, schemaProp: prop }, valid);
            cxt.mergeValidEvaluated(schCxt, valid);
          },
          () => gen.var(valid, true)
          // TODO var
        );
        cxt.ok(valid);
      }
    }
    exports2.validateSchemaDeps = validateSchemaDeps;
    exports2.default = def;
  }
});

// node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js
var require_propertyNames = __commonJS({
  "node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    var codegen_1 = require_codegen();
    var util_1 = require_util4();
    var error48 = {
      message: "property name must be valid",
      params: ({ params }) => (0, codegen_1._)`{propertyName: ${params.propertyName}}`
    };
    var def = {
      keyword: "propertyNames",
      type: "object",
      schemaType: ["object", "boolean"],
      error: error48,
      code(cxt) {
        const { gen, schema, data, it } = cxt;
        if ((0, util_1.alwaysValidSchema)(it, schema))
          return;
        const valid = gen.name("valid");
        gen.forIn("key", data, (key) => {
          cxt.setParams({ propertyName: key });
          cxt.subschema({
            keyword: "propertyNames",
            data: key,
            dataTypes: ["string"],
            propertyName: key,
            compositeRule: true
          }, valid);
          gen.if((0, codegen_1.not)(valid), () => {
            cxt.error(true);
            if (!it.allErrors)
              gen.break();
          });
        });
        cxt.ok(valid);
      }
    };
    exports2.default = def;
  }
});

// node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js
var require_additionalProperties = __commonJS({
  "node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    var code_1 = require_code2();
    var codegen_1 = require_codegen();
    var names_1 = require_names();
    var util_1 = require_util4();
    var error48 = {
      message: "must NOT have additional properties",
      params: ({ params }) => (0, codegen_1._)`{additionalProperty: ${params.additionalProperty}}`
    };
    var def = {
      keyword: "additionalProperties",
      type: ["object"],
      schemaType: ["boolean", "object"],
      allowUndefined: true,
      trackErrors: true,
      error: error48,
      code(cxt) {
        const { gen, schema, parentSchema, data, errsCount, it } = cxt;
        if (!errsCount)
          throw new Error("ajv implementation error");
        const { allErrors, opts } = it;
        it.props = true;
        if (opts.removeAdditional !== "all" && (0, util_1.alwaysValidSchema)(it, schema))
          return;
        const props = (0, code_1.allSchemaProperties)(parentSchema.properties);
        const patProps = (0, code_1.allSchemaProperties)(parentSchema.patternProperties);
        checkAdditionalProperties();
        cxt.ok((0, codegen_1._)`${errsCount} === ${names_1.default.errors}`);
        function checkAdditionalProperties() {
          gen.forIn("key", data, (key) => {
            if (!props.length && !patProps.length)
              additionalPropertyCode(key);
            else
              gen.if(isAdditional(key), () => additionalPropertyCode(key));
          });
        }
        function isAdditional(key) {
          let definedProp;
          if (props.length > 8) {
            const propsSchema = (0, util_1.schemaRefOrVal)(it, parentSchema.properties, "properties");
            definedProp = (0, code_1.isOwnProperty)(gen, propsSchema, key);
          } else if (props.length) {
            definedProp = (0, codegen_1.or)(...props.map((p) => (0, codegen_1._)`${key} === ${p}`));
          } else {
            definedProp = codegen_1.nil;
          }
          if (patProps.length) {
            definedProp = (0, codegen_1.or)(definedProp, ...patProps.map((p) => (0, codegen_1._)`${(0, code_1.usePattern)(cxt, p)}.test(${key})`));
          }
          return (0, codegen_1.not)(definedProp);
        }
        function deleteAdditional(key) {
          gen.code((0, codegen_1._)`delete ${data}[${key}]`);
        }
        function additionalPropertyCode(key) {
          if (opts.removeAdditional === "all" || opts.removeAdditional && schema === false) {
            deleteAdditional(key);
            return;
          }
          if (schema === false) {
            cxt.setParams({ additionalProperty: key });
            cxt.error();
            if (!allErrors)
              gen.break();
            return;
          }
          if (typeof schema == "object" && !(0, util_1.alwaysValidSchema)(it, schema)) {
            const valid = gen.name("valid");
            if (opts.removeAdditional === "failing") {
              applyAdditionalSchema(key, valid, false);
              gen.if((0, codegen_1.not)(valid), () => {
                cxt.reset();
                deleteAdditional(key);
              });
            } else {
              applyAdditionalSchema(key, valid);
              if (!allErrors)
                gen.if((0, codegen_1.not)(valid), () => gen.break());
            }
          }
        }
        function applyAdditionalSchema(key, valid, errors) {
          const subschema = {
            keyword: "additionalProperties",
            dataProp: key,
            dataPropType: util_1.Type.Str
          };
          if (errors === false) {
            Object.assign(subschema, {
              compositeRule: true,
              createErrors: false,
              allErrors: false
            });
          }
          cxt.subschema(subschema, valid);
        }
      }
    };
    exports2.default = def;
  }
});

// node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/properties.js
var require_properties = __commonJS({
  "node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/properties.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    var validate_1 = require_validate();
    var code_1 = require_code2();
    var util_1 = require_util4();
    var additionalProperties_1 = require_additionalProperties();
    var def = {
      keyword: "properties",
      type: "object",
      schemaType: "object",
      code(cxt) {
        const { gen, schema, parentSchema, data, it } = cxt;
        if (it.opts.removeAdditional === "all" && parentSchema.additionalProperties === void 0) {
          additionalProperties_1.default.code(new validate_1.KeywordCxt(it, additionalProperties_1.default, "additionalProperties"));
        }
        const allProps = (0, code_1.allSchemaProperties)(schema);
        for (const prop of allProps) {
          it.definedProperties.add(prop);
        }
        if (it.opts.unevaluated && allProps.length && it.props !== true) {
          it.props = util_1.mergeEvaluated.props(gen, (0, util_1.toHash)(allProps), it.props);
        }
        const properties = allProps.filter((p) => !(0, util_1.alwaysValidSchema)(it, schema[p]));
        if (properties.length === 0)
          return;
        const valid = gen.name("valid");
        for (const prop of properties) {
          if (hasDefault(prop)) {
            applyPropertySchema(prop);
          } else {
            gen.if((0, code_1.propertyInData)(gen, data, prop, it.opts.ownProperties));
            applyPropertySchema(prop);
            if (!it.allErrors)
              gen.else().var(valid, true);
            gen.endIf();
          }
          cxt.it.definedProperties.add(prop);
          cxt.ok(valid);
        }
        function hasDefault(prop) {
          return it.opts.useDefaults && !it.compositeRule && schema[prop].default !== void 0;
        }
        function applyPropertySchema(prop) {
          cxt.subschema({
            keyword: "properties",
            schemaProp: prop,
            dataProp: prop
          }, valid);
        }
      }
    };
    exports2.default = def;
  }
});

// node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js
var require_patternProperties = __commonJS({
  "node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    var code_1 = require_code2();
    var codegen_1 = require_codegen();
    var util_1 = require_util4();
    var util_2 = require_util4();
    var def = {
      keyword: "patternProperties",
      type: "object",
      schemaType: "object",
      code(cxt) {
        const { gen, schema, data, parentSchema, it } = cxt;
        const { opts } = it;
        const patterns = (0, code_1.allSchemaProperties)(schema);
        const alwaysValidPatterns = patterns.filter((p) => (0, util_1.alwaysValidSchema)(it, schema[p]));
        if (patterns.length === 0 || alwaysValidPatterns.length === patterns.length && (!it.opts.unevaluated || it.props === true)) {
          return;
        }
        const checkProperties = opts.strictSchema && !opts.allowMatchingProperties && parentSchema.properties;
        const valid = gen.name("valid");
        if (it.props !== true && !(it.props instanceof codegen_1.Name)) {
          it.props = (0, util_2.evaluatedPropsToName)(gen, it.props);
        }
        const { props } = it;
        validatePatternProperties();
        function validatePatternProperties() {
          for (const pat of patterns) {
            if (checkProperties)
              checkMatchingProperties(pat);
            if (it.allErrors) {
              validateProperties(pat);
            } else {
              gen.var(valid, true);
              validateProperties(pat);
              gen.if(valid);
            }
          }
        }
        function checkMatchingProperties(pat) {
          for (const prop in checkProperties) {
            if (new RegExp(pat).test(prop)) {
              (0, util_1.checkStrictMode)(it, `property ${prop} matches pattern ${pat} (use allowMatchingProperties)`);
            }
          }
        }
        function validateProperties(pat) {
          gen.forIn("key", data, (key) => {
            gen.if((0, codegen_1._)`${(0, code_1.usePattern)(cxt, pat)}.test(${key})`, () => {
              const alwaysValid = alwaysValidPatterns.includes(pat);
              if (!alwaysValid) {
                cxt.subschema({
                  keyword: "patternProperties",
                  schemaProp: pat,
                  dataProp: key,
                  dataPropType: util_2.Type.Str
                }, valid);
              }
              if (it.opts.unevaluated && props !== true) {
                gen.assign((0, codegen_1._)`${props}[${key}]`, true);
              } else if (!alwaysValid && !it.allErrors) {
                gen.if((0, codegen_1.not)(valid), () => gen.break());
              }
            });
          });
        }
      }
    };
    exports2.default = def;
  }
});

// node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/not.js
var require_not = __commonJS({
  "node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/not.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    var util_1 = require_util4();
    var def = {
      keyword: "not",
      schemaType: ["object", "boolean"],
      trackErrors: true,
      code(cxt) {
        const { gen, schema, it } = cxt;
        if ((0, util_1.alwaysValidSchema)(it, schema)) {
          cxt.fail();
          return;
        }
        const valid = gen.name("valid");
        cxt.subschema({
          keyword: "not",
          compositeRule: true,
          createErrors: false,
          allErrors: false
        }, valid);
        cxt.failResult(valid, () => cxt.reset(), () => cxt.error());
      },
      error: { message: "must NOT be valid" }
    };
    exports2.default = def;
  }
});

// node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/anyOf.js
var require_anyOf = __commonJS({
  "node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/anyOf.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    var code_1 = require_code2();
    var def = {
      keyword: "anyOf",
      schemaType: "array",
      trackErrors: true,
      code: code_1.validateUnion,
      error: { message: "must match a schema in anyOf" }
    };
    exports2.default = def;
  }
});

// node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/oneOf.js
var require_oneOf = __commonJS({
  "node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/oneOf.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    var codegen_1 = require_codegen();
    var util_1 = require_util4();
    var error48 = {
      message: "must match exactly one schema in oneOf",
      params: ({ params }) => (0, codegen_1._)`{passingSchemas: ${params.passing}}`
    };
    var def = {
      keyword: "oneOf",
      schemaType: "array",
      trackErrors: true,
      error: error48,
      code(cxt) {
        const { gen, schema, parentSchema, it } = cxt;
        if (!Array.isArray(schema))
          throw new Error("ajv implementation error");
        if (it.opts.discriminator && parentSchema.discriminator)
          return;
        const schArr = schema;
        const valid = gen.let("valid", false);
        const passing = gen.let("passing", null);
        const schValid = gen.name("_valid");
        cxt.setParams({ passing });
        gen.block(validateOneOf);
        cxt.result(valid, () => cxt.reset(), () => cxt.error(true));
        function validateOneOf() {
          schArr.forEach((sch, i) => {
            let schCxt;
            if ((0, util_1.alwaysValidSchema)(it, sch)) {
              gen.var(schValid, true);
            } else {
              schCxt = cxt.subschema({
                keyword: "oneOf",
                schemaProp: i,
                compositeRule: true
              }, schValid);
            }
            if (i > 0) {
              gen.if((0, codegen_1._)`${schValid} && ${valid}`).assign(valid, false).assign(passing, (0, codegen_1._)`[${passing}, ${i}]`).else();
            }
            gen.if(schValid, () => {
              gen.assign(valid, true);
              gen.assign(passing, i);
              if (schCxt)
                cxt.mergeEvaluated(schCxt, codegen_1.Name);
            });
          });
        }
      }
    };
    exports2.default = def;
  }
});

// node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/allOf.js
var require_allOf = __commonJS({
  "node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/allOf.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    var util_1 = require_util4();
    var def = {
      keyword: "allOf",
      schemaType: "array",
      code(cxt) {
        const { gen, schema, it } = cxt;
        if (!Array.isArray(schema))
          throw new Error("ajv implementation error");
        const valid = gen.name("valid");
        schema.forEach((sch, i) => {
          if ((0, util_1.alwaysValidSchema)(it, sch))
            return;
          const schCxt = cxt.subschema({ keyword: "allOf", schemaProp: i }, valid);
          cxt.ok(valid);
          cxt.mergeEvaluated(schCxt);
        });
      }
    };
    exports2.default = def;
  }
});

// node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/if.js
var require_if = __commonJS({
  "node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/if.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    var codegen_1 = require_codegen();
    var util_1 = require_util4();
    var error48 = {
      message: ({ params }) => (0, codegen_1.str)`must match "${params.ifClause}" schema`,
      params: ({ params }) => (0, codegen_1._)`{failingKeyword: ${params.ifClause}}`
    };
    var def = {
      keyword: "if",
      schemaType: ["object", "boolean"],
      trackErrors: true,
      error: error48,
      code(cxt) {
        const { gen, parentSchema, it } = cxt;
        if (parentSchema.then === void 0 && parentSchema.else === void 0) {
          (0, util_1.checkStrictMode)(it, '"if" without "then" and "else" is ignored');
        }
        const hasThen = hasSchema(it, "then");
        const hasElse = hasSchema(it, "else");
        if (!hasThen && !hasElse)
          return;
        const valid = gen.let("valid", true);
        const schValid = gen.name("_valid");
        validateIf();
        cxt.reset();
        if (hasThen && hasElse) {
          const ifClause = gen.let("ifClause");
          cxt.setParams({ ifClause });
          gen.if(schValid, validateClause("then", ifClause), validateClause("else", ifClause));
        } else if (hasThen) {
          gen.if(schValid, validateClause("then"));
        } else {
          gen.if((0, codegen_1.not)(schValid), validateClause("else"));
        }
        cxt.pass(valid, () => cxt.error(true));
        function validateIf() {
          const schCxt = cxt.subschema({
            keyword: "if",
            compositeRule: true,
            createErrors: false,
            allErrors: false
          }, schValid);
          cxt.mergeEvaluated(schCxt);
        }
        function validateClause(keyword, ifClause) {
          return () => {
            const schCxt = cxt.subschema({ keyword }, schValid);
            gen.assign(valid, schValid);
            cxt.mergeValidEvaluated(schCxt, valid);
            if (ifClause)
              gen.assign(ifClause, (0, codegen_1._)`${keyword}`);
            else
              cxt.setParams({ ifClause: keyword });
          };
        }
      }
    };
    function hasSchema(it, keyword) {
      const schema = it.schema[keyword];
      return schema !== void 0 && !(0, util_1.alwaysValidSchema)(it, schema);
    }
    exports2.default = def;
  }
});

// node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/thenElse.js
var require_thenElse = __commonJS({
  "node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/thenElse.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    var util_1 = require_util4();
    var def = {
      keyword: ["then", "else"],
      schemaType: ["object", "boolean"],
      code({ keyword, parentSchema, it }) {
        if (parentSchema.if === void 0)
          (0, util_1.checkStrictMode)(it, `"${keyword}" without "if" is ignored`);
      }
    };
    exports2.default = def;
  }
});

// node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/index.js
var require_applicator = __commonJS({
  "node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/index.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    var additionalItems_1 = require_additionalItems();
    var prefixItems_1 = require_prefixItems();
    var items_1 = require_items();
    var items2020_1 = require_items2020();
    var contains_1 = require_contains();
    var dependencies_1 = require_dependencies();
    var propertyNames_1 = require_propertyNames();
    var additionalProperties_1 = require_additionalProperties();
    var properties_1 = require_properties();
    var patternProperties_1 = require_patternProperties();
    var not_1 = require_not();
    var anyOf_1 = require_anyOf();
    var oneOf_1 = require_oneOf();
    var allOf_1 = require_allOf();
    var if_1 = require_if();
    var thenElse_1 = require_thenElse();
    function getApplicator(draft2020 = false) {
      const applicator = [
        // any
        not_1.default,
        anyOf_1.default,
        oneOf_1.default,
        allOf_1.default,
        if_1.default,
        thenElse_1.default,
        // object
        propertyNames_1.default,
        additionalProperties_1.default,
        dependencies_1.default,
        properties_1.default,
        patternProperties_1.default
      ];
      if (draft2020)
        applicator.push(prefixItems_1.default, items2020_1.default);
      else
        applicator.push(additionalItems_1.default, items_1.default);
      applicator.push(contains_1.default);
      return applicator;
    }
    exports2.default = getApplicator;
  }
});

// node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/format/format.js
var require_format = __commonJS({
  "node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/format/format.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    var codegen_1 = require_codegen();
    var error48 = {
      message: ({ schemaCode }) => (0, codegen_1.str)`must match format "${schemaCode}"`,
      params: ({ schemaCode }) => (0, codegen_1._)`{format: ${schemaCode}}`
    };
    var def = {
      keyword: "format",
      type: ["number", "string"],
      schemaType: "string",
      $data: true,
      error: error48,
      code(cxt, ruleType) {
        const { gen, data, $data, schema, schemaCode, it } = cxt;
        const { opts, errSchemaPath, schemaEnv, self } = it;
        if (!opts.validateFormats)
          return;
        if ($data)
          validate$DataFormat();
        else
          validateFormat();
        function validate$DataFormat() {
          const fmts = gen.scopeValue("formats", {
            ref: self.formats,
            code: opts.code.formats
          });
          const fDef = gen.const("fDef", (0, codegen_1._)`${fmts}[${schemaCode}]`);
          const fType = gen.let("fType");
          const format = gen.let("format");
          gen.if((0, codegen_1._)`typeof ${fDef} == "object" && !(${fDef} instanceof RegExp)`, () => gen.assign(fType, (0, codegen_1._)`${fDef}.type || "string"`).assign(format, (0, codegen_1._)`${fDef}.validate`), () => gen.assign(fType, (0, codegen_1._)`"string"`).assign(format, fDef));
          cxt.fail$data((0, codegen_1.or)(unknownFmt(), invalidFmt()));
          function unknownFmt() {
            if (opts.strictSchema === false)
              return codegen_1.nil;
            return (0, codegen_1._)`${schemaCode} && !${format}`;
          }
          function invalidFmt() {
            const callFormat = schemaEnv.$async ? (0, codegen_1._)`(${fDef}.async ? await ${format}(${data}) : ${format}(${data}))` : (0, codegen_1._)`${format}(${data})`;
            const validData = (0, codegen_1._)`(typeof ${format} == "function" ? ${callFormat} : ${format}.test(${data}))`;
            return (0, codegen_1._)`${format} && ${format} !== true && ${fType} === ${ruleType} && !${validData}`;
          }
        }
        function validateFormat() {
          const formatDef = self.formats[schema];
          if (!formatDef) {
            unknownFormat();
            return;
          }
          if (formatDef === true)
            return;
          const [fmtType, format, fmtRef] = getFormat(formatDef);
          if (fmtType === ruleType)
            cxt.pass(validCondition());
          function unknownFormat() {
            if (opts.strictSchema === false) {
              self.logger.warn(unknownMsg());
              return;
            }
            throw new Error(unknownMsg());
            function unknownMsg() {
              return `unknown format "${schema}" ignored in schema at path "${errSchemaPath}"`;
            }
          }
          function getFormat(fmtDef) {
            const code = fmtDef instanceof RegExp ? (0, codegen_1.regexpCode)(fmtDef) : opts.code.formats ? (0, codegen_1._)`${opts.code.formats}${(0, codegen_1.getProperty)(schema)}` : void 0;
            const fmt = gen.scopeValue("formats", { key: schema, ref: fmtDef, code });
            if (typeof fmtDef == "object" && !(fmtDef instanceof RegExp)) {
              return [fmtDef.type || "string", fmtDef.validate, (0, codegen_1._)`${fmt}.validate`];
            }
            return ["string", fmtDef, fmt];
          }
          function validCondition() {
            if (typeof formatDef == "object" && !(formatDef instanceof RegExp) && formatDef.async) {
              if (!schemaEnv.$async)
                throw new Error("async format in sync schema");
              return (0, codegen_1._)`await ${fmtRef}(${data})`;
            }
            return typeof format == "function" ? (0, codegen_1._)`${fmtRef}(${data})` : (0, codegen_1._)`${fmtRef}.test(${data})`;
          }
        }
      }
    };
    exports2.default = def;
  }
});

// node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/format/index.js
var require_format2 = __commonJS({
  "node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/format/index.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    var format_1 = require_format();
    var format = [format_1.default];
    exports2.default = format;
  }
});

// node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/metadata.js
var require_metadata = __commonJS({
  "node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/metadata.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.contentVocabulary = exports2.metadataVocabulary = void 0;
    exports2.metadataVocabulary = [
      "title",
      "description",
      "default",
      "deprecated",
      "readOnly",
      "writeOnly",
      "examples"
    ];
    exports2.contentVocabulary = [
      "contentMediaType",
      "contentEncoding",
      "contentSchema"
    ];
  }
});

// node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/draft7.js
var require_draft7 = __commonJS({
  "node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/draft7.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    var core_1 = require_core2();
    var validation_1 = require_validation2();
    var applicator_1 = require_applicator();
    var format_1 = require_format2();
    var metadata_1 = require_metadata();
    var draft7Vocabularies = [
      core_1.default,
      validation_1.default,
      (0, applicator_1.default)(),
      format_1.default,
      metadata_1.metadataVocabulary,
      metadata_1.contentVocabulary
    ];
    exports2.default = draft7Vocabularies;
  }
});

// node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/discriminator/types.js
var require_types2 = __commonJS({
  "node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/discriminator/types.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.DiscrError = void 0;
    var DiscrError;
    (function(DiscrError2) {
      DiscrError2["Tag"] = "tag";
      DiscrError2["Mapping"] = "mapping";
    })(DiscrError || (exports2.DiscrError = DiscrError = {}));
  }
});

// node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/discriminator/index.js
var require_discriminator = __commonJS({
  "node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/discriminator/index.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    var codegen_1 = require_codegen();
    var types_1 = require_types2();
    var compile_1 = require_compile2();
    var ref_error_1 = require_ref_error();
    var util_1 = require_util4();
    var error48 = {
      message: ({ params: { discrError, tagName } }) => discrError === types_1.DiscrError.Tag ? `tag "${tagName}" must be string` : `value of tag "${tagName}" must be in oneOf`,
      params: ({ params: { discrError, tag, tagName } }) => (0, codegen_1._)`{error: ${discrError}, tag: ${tagName}, tagValue: ${tag}}`
    };
    var def = {
      keyword: "discriminator",
      type: "object",
      schemaType: "object",
      error: error48,
      code(cxt) {
        const { gen, data, schema, parentSchema, it } = cxt;
        const { oneOf } = parentSchema;
        if (!it.opts.discriminator) {
          throw new Error("discriminator: requires discriminator option");
        }
        const tagName = schema.propertyName;
        if (typeof tagName != "string")
          throw new Error("discriminator: requires propertyName");
        if (schema.mapping)
          throw new Error("discriminator: mapping is not supported");
        if (!oneOf)
          throw new Error("discriminator: requires oneOf keyword");
        const valid = gen.let("valid", false);
        const tag = gen.const("tag", (0, codegen_1._)`${data}${(0, codegen_1.getProperty)(tagName)}`);
        gen.if((0, codegen_1._)`typeof ${tag} == "string"`, () => validateMapping(), () => cxt.error(false, { discrError: types_1.DiscrError.Tag, tag, tagName }));
        cxt.ok(valid);
        function validateMapping() {
          const mapping = getMapping();
          gen.if(false);
          for (const tagValue in mapping) {
            gen.elseIf((0, codegen_1._)`${tag} === ${tagValue}`);
            gen.assign(valid, applyTagSchema(mapping[tagValue]));
          }
          gen.else();
          cxt.error(false, { discrError: types_1.DiscrError.Mapping, tag, tagName });
          gen.endIf();
        }
        function applyTagSchema(schemaProp) {
          const _valid = gen.name("valid");
          const schCxt = cxt.subschema({ keyword: "oneOf", schemaProp }, _valid);
          cxt.mergeEvaluated(schCxt, codegen_1.Name);
          return _valid;
        }
        function getMapping() {
          var _a2;
          const oneOfMapping = {};
          const topRequired = hasRequired(parentSchema);
          let tagRequired = true;
          for (let i = 0; i < oneOf.length; i++) {
            let sch = oneOf[i];
            if ((sch === null || sch === void 0 ? void 0 : sch.$ref) && !(0, util_1.schemaHasRulesButRef)(sch, it.self.RULES)) {
              const ref = sch.$ref;
              sch = compile_1.resolveRef.call(it.self, it.schemaEnv.root, it.baseId, ref);
              if (sch instanceof compile_1.SchemaEnv)
                sch = sch.schema;
              if (sch === void 0)
                throw new ref_error_1.default(it.opts.uriResolver, it.baseId, ref);
            }
            const propSch = (_a2 = sch === null || sch === void 0 ? void 0 : sch.properties) === null || _a2 === void 0 ? void 0 : _a2[tagName];
            if (typeof propSch != "object") {
              throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${tagName}"`);
            }
            tagRequired = tagRequired && (topRequired || hasRequired(sch));
            addMappings(propSch, i);
          }
          if (!tagRequired)
            throw new Error(`discriminator: "${tagName}" must be required`);
          return oneOfMapping;
          function hasRequired({ required: required2 }) {
            return Array.isArray(required2) && required2.includes(tagName);
          }
          function addMappings(sch, i) {
            if (sch.const) {
              addMapping(sch.const, i);
            } else if (sch.enum) {
              for (const tagValue of sch.enum) {
                addMapping(tagValue, i);
              }
            } else {
              throw new Error(`discriminator: "properties/${tagName}" must have "const" or "enum"`);
            }
          }
          function addMapping(tagValue, i) {
            if (typeof tagValue != "string" || tagValue in oneOfMapping) {
              throw new Error(`discriminator: "${tagName}" values must be unique strings`);
            }
            oneOfMapping[tagValue] = i;
          }
        }
      }
    };
    exports2.default = def;
  }
});

// node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/refs/json-schema-draft-07.json
var require_json_schema_draft_07 = __commonJS({
  "node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/refs/json-schema-draft-07.json"(exports2, module2) {
    module2.exports = {
      $schema: "http://json-schema.org/draft-07/schema#",
      $id: "http://json-schema.org/draft-07/schema#",
      title: "Core schema meta-schema",
      definitions: {
        schemaArray: {
          type: "array",
          minItems: 1,
          items: { $ref: "#" }
        },
        nonNegativeInteger: {
          type: "integer",
          minimum: 0
        },
        nonNegativeIntegerDefault0: {
          allOf: [{ $ref: "#/definitions/nonNegativeInteger" }, { default: 0 }]
        },
        simpleTypes: {
          enum: ["array", "boolean", "integer", "null", "number", "object", "string"]
        },
        stringArray: {
          type: "array",
          items: { type: "string" },
          uniqueItems: true,
          default: []
        }
      },
      type: ["object", "boolean"],
      properties: {
        $id: {
          type: "string",
          format: "uri-reference"
        },
        $schema: {
          type: "string",
          format: "uri"
        },
        $ref: {
          type: "string",
          format: "uri-reference"
        },
        $comment: {
          type: "string"
        },
        title: {
          type: "string"
        },
        description: {
          type: "string"
        },
        default: true,
        readOnly: {
          type: "boolean",
          default: false
        },
        examples: {
          type: "array",
          items: true
        },
        multipleOf: {
          type: "number",
          exclusiveMinimum: 0
        },
        maximum: {
          type: "number"
        },
        exclusiveMaximum: {
          type: "number"
        },
        minimum: {
          type: "number"
        },
        exclusiveMinimum: {
          type: "number"
        },
        maxLength: { $ref: "#/definitions/nonNegativeInteger" },
        minLength: { $ref: "#/definitions/nonNegativeIntegerDefault0" },
        pattern: {
          type: "string",
          format: "regex"
        },
        additionalItems: { $ref: "#" },
        items: {
          anyOf: [{ $ref: "#" }, { $ref: "#/definitions/schemaArray" }],
          default: true
        },
        maxItems: { $ref: "#/definitions/nonNegativeInteger" },
        minItems: { $ref: "#/definitions/nonNegativeIntegerDefault0" },
        uniqueItems: {
          type: "boolean",
          default: false
        },
        contains: { $ref: "#" },
        maxProperties: { $ref: "#/definitions/nonNegativeInteger" },
        minProperties: { $ref: "#/definitions/nonNegativeIntegerDefault0" },
        required: { $ref: "#/definitions/stringArray" },
        additionalProperties: { $ref: "#" },
        definitions: {
          type: "object",
          additionalProperties: { $ref: "#" },
          default: {}
        },
        properties: {
          type: "object",
          additionalProperties: { $ref: "#" },
          default: {}
        },
        patternProperties: {
          type: "object",
          additionalProperties: { $ref: "#" },
          propertyNames: { format: "regex" },
          default: {}
        },
        dependencies: {
          type: "object",
          additionalProperties: {
            anyOf: [{ $ref: "#" }, { $ref: "#/definitions/stringArray" }]
          }
        },
        propertyNames: { $ref: "#" },
        const: true,
        enum: {
          type: "array",
          items: true,
          minItems: 1,
          uniqueItems: true
        },
        type: {
          anyOf: [
            { $ref: "#/definitions/simpleTypes" },
            {
              type: "array",
              items: { $ref: "#/definitions/simpleTypes" },
              minItems: 1,
              uniqueItems: true
            }
          ]
        },
        format: { type: "string" },
        contentMediaType: { type: "string" },
        contentEncoding: { type: "string" },
        if: { $ref: "#" },
        then: { $ref: "#" },
        else: { $ref: "#" },
        allOf: { $ref: "#/definitions/schemaArray" },
        anyOf: { $ref: "#/definitions/schemaArray" },
        oneOf: { $ref: "#/definitions/schemaArray" },
        not: { $ref: "#" }
      },
      default: true
    };
  }
});

// node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/ajv.js
var require_ajv = __commonJS({
  "node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/ajv.js"(exports2, module2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.MissingRefError = exports2.ValidationError = exports2.CodeGen = exports2.Name = exports2.nil = exports2.stringify = exports2.str = exports2._ = exports2.KeywordCxt = exports2.Ajv = void 0;
    var core_1 = require_core();
    var draft7_1 = require_draft7();
    var discriminator_1 = require_discriminator();
    var draft7MetaSchema = require_json_schema_draft_07();
    var META_SUPPORT_DATA = ["/properties"];
    var META_SCHEMA_ID = "http://json-schema.org/draft-07/schema";
    var Ajv2 = class extends core_1.default {
      _addVocabularies() {
        super._addVocabularies();
        draft7_1.default.forEach((v) => this.addVocabulary(v));
        if (this.opts.discriminator)
          this.addKeyword(discriminator_1.default);
      }
      _addDefaultMetaSchema() {
        super._addDefaultMetaSchema();
        if (!this.opts.meta)
          return;
        const metaSchema = this.opts.$data ? this.$dataMetaSchema(draft7MetaSchema, META_SUPPORT_DATA) : draft7MetaSchema;
        this.addMetaSchema(metaSchema, META_SCHEMA_ID, false);
        this.refs["http://json-schema.org/schema"] = META_SCHEMA_ID;
      }
      defaultMeta() {
        return this.opts.defaultMeta = super.defaultMeta() || (this.getSchema(META_SCHEMA_ID) ? META_SCHEMA_ID : void 0);
      }
    };
    exports2.Ajv = Ajv2;
    module2.exports = exports2 = Ajv2;
    module2.exports.Ajv = Ajv2;
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.default = Ajv2;
    var validate_1 = require_validate();
    Object.defineProperty(exports2, "KeywordCxt", { enumerable: true, get: function() {
      return validate_1.KeywordCxt;
    } });
    var codegen_1 = require_codegen();
    Object.defineProperty(exports2, "_", { enumerable: true, get: function() {
      return codegen_1._;
    } });
    Object.defineProperty(exports2, "str", { enumerable: true, get: function() {
      return codegen_1.str;
    } });
    Object.defineProperty(exports2, "stringify", { enumerable: true, get: function() {
      return codegen_1.stringify;
    } });
    Object.defineProperty(exports2, "nil", { enumerable: true, get: function() {
      return codegen_1.nil;
    } });
    Object.defineProperty(exports2, "Name", { enumerable: true, get: function() {
      return codegen_1.Name;
    } });
    Object.defineProperty(exports2, "CodeGen", { enumerable: true, get: function() {
      return codegen_1.CodeGen;
    } });
    var validation_error_1 = require_validation_error();
    Object.defineProperty(exports2, "ValidationError", { enumerable: true, get: function() {
      return validation_error_1.default;
    } });
    var ref_error_1 = require_ref_error();
    Object.defineProperty(exports2, "MissingRefError", { enumerable: true, get: function() {
      return ref_error_1.default;
    } });
  }
});

// node_modules/ajv-formats/dist/formats.js
var require_formats = __commonJS({
  "node_modules/ajv-formats/dist/formats.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.formatNames = exports2.fastFormats = exports2.fullFormats = void 0;
    function fmtDef(validate2, compare) {
      return { validate: validate2, compare };
    }
    exports2.fullFormats = {
      // date: http://tools.ietf.org/html/rfc3339#section-5.6
      date: fmtDef(date5, compareDate),
      // date-time: http://tools.ietf.org/html/rfc3339#section-5.6
      time: fmtDef(getTime(true), compareTime),
      "date-time": fmtDef(getDateTime(true), compareDateTime),
      "iso-time": fmtDef(getTime(), compareIsoTime),
      "iso-date-time": fmtDef(getDateTime(), compareIsoDateTime),
      // duration: https://tools.ietf.org/html/rfc3339#appendix-A
      duration: /^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,
      uri,
      "uri-reference": /^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,
      // uri-template: https://tools.ietf.org/html/rfc6570
      "uri-template": /^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,
      // For the source: https://gist.github.com/dperini/729294
      // For test cases: https://mathiasbynens.be/demo/url-regex
      url: /^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,
      email: /^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,
      hostname: /^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,
      // optimized https://www.safaribooksonline.com/library/view/regular-expressions-cookbook/9780596802837/ch07s16.html
      ipv4: /^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,
      ipv6: /^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,
      regex,
      // uuid: http://tools.ietf.org/html/rfc4122
      uuid: /^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,
      // JSON-pointer: https://tools.ietf.org/html/rfc6901
      // uri fragment: https://tools.ietf.org/html/rfc3986#appendix-A
      "json-pointer": /^(?:\/(?:[^~/]|~0|~1)*)*$/,
      "json-pointer-uri-fragment": /^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,
      // relative JSON-pointer: http://tools.ietf.org/html/draft-luff-relative-json-pointer-00
      "relative-json-pointer": /^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,
      // the following formats are used by the openapi specification: https://spec.openapis.org/oas/v3.0.0#data-types
      // byte: https://github.com/miguelmota/is-base64
      byte,
      // signed 32 bit integer
      int32: { type: "number", validate: validateInt32 },
      // signed 64 bit integer
      int64: { type: "number", validate: validateInt64 },
      // C-type float
      float: { type: "number", validate: validateNumber },
      // C-type double
      double: { type: "number", validate: validateNumber },
      // hint to the UI to hide input strings
      password: true,
      // unchecked string payload
      binary: true
    };
    exports2.fastFormats = {
      ...exports2.fullFormats,
      date: fmtDef(/^\d\d\d\d-[0-1]\d-[0-3]\d$/, compareDate),
      time: fmtDef(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i, compareTime),
      "date-time": fmtDef(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i, compareDateTime),
      "iso-time": fmtDef(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i, compareIsoTime),
      "iso-date-time": fmtDef(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i, compareIsoDateTime),
      // uri: https://github.com/mafintosh/is-my-json-valid/blob/master/formats.js
      uri: /^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,
      "uri-reference": /^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,
      // email (sources from jsen validator):
      // http://stackoverflow.com/questions/201323/using-a-regular-expression-to-validate-an-email-address#answer-8829363
      // http://www.w3.org/TR/html5/forms.html#valid-e-mail-address (search for 'wilful violation')
      email: /^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i
    };
    exports2.formatNames = Object.keys(exports2.fullFormats);
    function isLeapYear(year) {
      return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);
    }
    var DATE = /^(\d\d\d\d)-(\d\d)-(\d\d)$/;
    var DAYS = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
    function date5(str) {
      const matches = DATE.exec(str);
      if (!matches)
        return false;
      const year = +matches[1];
      const month = +matches[2];
      const day = +matches[3];
      return month >= 1 && month <= 12 && day >= 1 && day <= (month === 2 && isLeapYear(year) ? 29 : DAYS[month]);
    }
    function compareDate(d1, d2) {
      if (!(d1 && d2))
        return void 0;
      if (d1 > d2)
        return 1;
      if (d1 < d2)
        return -1;
      return 0;
    }
    var TIME = /^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;
    function getTime(strictTimeZone) {
      return function time3(str) {
        const matches = TIME.exec(str);
        if (!matches)
          return false;
        const hr = +matches[1];
        const min = +matches[2];
        const sec = +matches[3];
        const tz = matches[4];
        const tzSign = matches[5] === "-" ? -1 : 1;
        const tzH = +(matches[6] || 0);
        const tzM = +(matches[7] || 0);
        if (tzH > 23 || tzM > 59 || strictTimeZone && !tz)
          return false;
        if (hr <= 23 && min <= 59 && sec < 60)
          return true;
        const utcMin = min - tzM * tzSign;
        const utcHr = hr - tzH * tzSign - (utcMin < 0 ? 1 : 0);
        return (utcHr === 23 || utcHr === -1) && (utcMin === 59 || utcMin === -1) && sec < 61;
      };
    }
    function compareTime(s1, s2) {
      if (!(s1 && s2))
        return void 0;
      const t1 = (/* @__PURE__ */ new Date("2020-01-01T" + s1)).valueOf();
      const t2 = (/* @__PURE__ */ new Date("2020-01-01T" + s2)).valueOf();
      if (!(t1 && t2))
        return void 0;
      return t1 - t2;
    }
    function compareIsoTime(t1, t2) {
      if (!(t1 && t2))
        return void 0;
      const a1 = TIME.exec(t1);
      const a2 = TIME.exec(t2);
      if (!(a1 && a2))
        return void 0;
      t1 = a1[1] + a1[2] + a1[3];
      t2 = a2[1] + a2[2] + a2[3];
      if (t1 > t2)
        return 1;
      if (t1 < t2)
        return -1;
      return 0;
    }
    var DATE_TIME_SEPARATOR = /t|\s/i;
    function getDateTime(strictTimeZone) {
      const time3 = getTime(strictTimeZone);
      return function date_time(str) {
        const dateTime = str.split(DATE_TIME_SEPARATOR);
        return dateTime.length === 2 && date5(dateTime[0]) && time3(dateTime[1]);
      };
    }
    function compareDateTime(dt1, dt2) {
      if (!(dt1 && dt2))
        return void 0;
      const d1 = new Date(dt1).valueOf();
      const d2 = new Date(dt2).valueOf();
      if (!(d1 && d2))
        return void 0;
      return d1 - d2;
    }
    function compareIsoDateTime(dt1, dt2) {
      if (!(dt1 && dt2))
        return void 0;
      const [d1, t1] = dt1.split(DATE_TIME_SEPARATOR);
      const [d2, t2] = dt2.split(DATE_TIME_SEPARATOR);
      const res = compareDate(d1, d2);
      if (res === void 0)
        return void 0;
      return res || compareTime(t1, t2);
    }
    var NOT_URI_FRAGMENT = /\/|:/;
    var URI = /^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;
    function uri(str) {
      return NOT_URI_FRAGMENT.test(str) && URI.test(str);
    }
    var BYTE = /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;
    function byte(str) {
      BYTE.lastIndex = 0;
      return BYTE.test(str);
    }
    var MIN_INT32 = -(2 ** 31);
    var MAX_INT32 = 2 ** 31 - 1;
    function validateInt32(value) {
      return Number.isInteger(value) && value <= MAX_INT32 && value >= MIN_INT32;
    }
    function validateInt64(value) {
      return Number.isInteger(value);
    }
    function validateNumber() {
      return true;
    }
    var Z_ANCHOR = /[^\\]\\Z/;
    function regex(str) {
      if (Z_ANCHOR.test(str))
        return false;
      try {
        new RegExp(str);
        return true;
      } catch (e) {
        return false;
      }
    }
  }
});

// node_modules/ajv-formats/node_modules/ajv/dist/compile/codegen/code.js
var require_code3 = __commonJS({
  "node_modules/ajv-formats/node_modules/ajv/dist/compile/codegen/code.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.regexpCode = exports2.getEsmExportName = exports2.getProperty = exports2.safeStringify = exports2.stringify = exports2.strConcat = exports2.addCodeArg = exports2.str = exports2._ = exports2.nil = exports2._Code = exports2.Name = exports2.IDENTIFIER = exports2._CodeOrName = void 0;
    var _CodeOrName = class {
    };
    exports2._CodeOrName = _CodeOrName;
    exports2.IDENTIFIER = /^[a-z$_][a-z$_0-9]*$/i;
    var Name = class extends _CodeOrName {
      constructor(s) {
        super();
        if (!exports2.IDENTIFIER.test(s))
          throw new Error("CodeGen: name must be a valid identifier");
        this.str = s;
      }
      toString() {
        return this.str;
      }
      emptyStr() {
        return false;
      }
      get names() {
        return { [this.str]: 1 };
      }
    };
    exports2.Name = Name;
    var _Code = class extends _CodeOrName {
      constructor(code) {
        super();
        this._items = typeof code === "string" ? [code] : code;
      }
      toString() {
        return this.str;
      }
      emptyStr() {
        if (this._items.length > 1)
          return false;
        const item = this._items[0];
        return item === "" || item === '""';
      }
      get str() {
        var _a2;
        return (_a2 = this._str) !== null && _a2 !== void 0 ? _a2 : this._str = this._items.reduce((s, c) => `${s}${c}`, "");
      }
      get names() {
        var _a2;
        return (_a2 = this._names) !== null && _a2 !== void 0 ? _a2 : this._names = this._items.reduce((names, c) => {
          if (c instanceof Name)
            names[c.str] = (names[c.str] || 0) + 1;
          return names;
        }, {});
      }
    };
    exports2._Code = _Code;
    exports2.nil = new _Code("");
    function _(strs, ...args) {
      const code = [strs[0]];
      let i = 0;
      while (i < args.length) {
        addCodeArg(code, args[i]);
        code.push(strs[++i]);
      }
      return new _Code(code);
    }
    exports2._ = _;
    var plus = new _Code("+");
    function str(strs, ...args) {
      const expr = [safeStringify(strs[0])];
      let i = 0;
      while (i < args.length) {
        expr.push(plus);
        addCodeArg(expr, args[i]);
        expr.push(plus, safeStringify(strs[++i]));
      }
      optimize(expr);
      return new _Code(expr);
    }
    exports2.str = str;
    function addCodeArg(code, arg) {
      if (arg instanceof _Code)
        code.push(...arg._items);
      else if (arg instanceof Name)
        code.push(arg);
      else
        code.push(interpolate(arg));
    }
    exports2.addCodeArg = addCodeArg;
    function optimize(expr) {
      let i = 1;
      while (i < expr.length - 1) {
        if (expr[i] === plus) {
          const res = mergeExprItems(expr[i - 1], expr[i + 1]);
          if (res !== void 0) {
            expr.splice(i - 1, 3, res);
            continue;
          }
          expr[i++] = "+";
        }
        i++;
      }
    }
    function mergeExprItems(a, b) {
      if (b === '""')
        return a;
      if (a === '""')
        return b;
      if (typeof a == "string") {
        if (b instanceof Name || a[a.length - 1] !== '"')
          return;
        if (typeof b != "string")
          return `${a.slice(0, -1)}${b}"`;
        if (b[0] === '"')
          return a.slice(0, -1) + b.slice(1);
        return;
      }
      if (typeof b == "string" && b[0] === '"' && !(a instanceof Name))
        return `"${a}${b.slice(1)}`;
      return;
    }
    function strConcat(c1, c2) {
      return c2.emptyStr() ? c1 : c1.emptyStr() ? c2 : str`${c1}${c2}`;
    }
    exports2.strConcat = strConcat;
    function interpolate(x) {
      return typeof x == "number" || typeof x == "boolean" || x === null ? x : safeStringify(Array.isArray(x) ? x.join(",") : x);
    }
    function stringify(x) {
      return new _Code(safeStringify(x));
    }
    exports2.stringify = stringify;
    function safeStringify(x) {
      return JSON.stringify(x).replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029");
    }
    exports2.safeStringify = safeStringify;
    function getProperty(key) {
      return typeof key == "string" && exports2.IDENTIFIER.test(key) ? new _Code(`.${key}`) : _`[${key}]`;
    }
    exports2.getProperty = getProperty;
    function getEsmExportName(key) {
      if (typeof key == "string" && exports2.IDENTIFIER.test(key)) {
        return new _Code(`${key}`);
      }
      throw new Error(`CodeGen: invalid export name: ${key}, use explicit $id name mapping`);
    }
    exports2.getEsmExportName = getEsmExportName;
    function regexpCode(rx) {
      return new _Code(rx.toString());
    }
    exports2.regexpCode = regexpCode;
  }
});

// node_modules/ajv-formats/node_modules/ajv/dist/compile/codegen/scope.js
var require_scope2 = __commonJS({
  "node_modules/ajv-formats/node_modules/ajv/dist/compile/codegen/scope.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.ValueScope = exports2.ValueScopeName = exports2.Scope = exports2.varKinds = exports2.UsedValueState = void 0;
    var code_1 = require_code3();
    var ValueError = class extends Error {
      constructor(name) {
        super(`CodeGen: "code" for ${name} not defined`);
        this.value = name.value;
      }
    };
    var UsedValueState;
    (function(UsedValueState2) {
      UsedValueState2[UsedValueState2["Started"] = 0] = "Started";
      UsedValueState2[UsedValueState2["Completed"] = 1] = "Completed";
    })(UsedValueState || (exports2.UsedValueState = UsedValueState = {}));
    exports2.varKinds = {
      const: new code_1.Name("const"),
      let: new code_1.Name("let"),
      var: new code_1.Name("var")
    };
    var Scope = class {
      constructor({ prefixes, parent } = {}) {
        this._names = {};
        this._prefixes = prefixes;
        this._parent = parent;
      }
      toName(nameOrPrefix) {
        return nameOrPrefix instanceof code_1.Name ? nameOrPrefix : this.name(nameOrPrefix);
      }
      name(prefix) {
        return new code_1.Name(this._newName(prefix));
      }
      _newName(prefix) {
        const ng = this._names[prefix] || this._nameGroup(prefix);
        return `${prefix}${ng.index++}`;
      }
      _nameGroup(prefix) {
        var _a2, _b;
        if (((_b = (_a2 = this._parent) === null || _a2 === void 0 ? void 0 : _a2._prefixes) === null || _b === void 0 ? void 0 : _b.has(prefix)) || this._prefixes && !this._prefixes.has(prefix)) {
          throw new Error(`CodeGen: prefix "${prefix}" is not allowed in this scope`);
        }
        return this._names[prefix] = { prefix, index: 0 };
      }
    };
    exports2.Scope = Scope;
    var ValueScopeName = class extends code_1.Name {
      constructor(prefix, nameStr) {
        super(nameStr);
        this.prefix = prefix;
      }
      setValue(value, { property, itemIndex }) {
        this.value = value;
        this.scopePath = (0, code_1._)`.${new code_1.Name(property)}[${itemIndex}]`;
      }
    };
    exports2.ValueScopeName = ValueScopeName;
    var line = (0, code_1._)`\n`;
    var ValueScope = class extends Scope {
      constructor(opts) {
        super(opts);
        this._values = {};
        this._scope = opts.scope;
        this.opts = { ...opts, _n: opts.lines ? line : code_1.nil };
      }
      get() {
        return this._scope;
      }
      name(prefix) {
        return new ValueScopeName(prefix, this._newName(prefix));
      }
      value(nameOrPrefix, value) {
        var _a2;
        if (value.ref === void 0)
          throw new Error("CodeGen: ref must be passed in value");
        const name = this.toName(nameOrPrefix);
        const { prefix } = name;
        const valueKey = (_a2 = value.key) !== null && _a2 !== void 0 ? _a2 : value.ref;
        let vs = this._values[prefix];
        if (vs) {
          const _name = vs.get(valueKey);
          if (_name)
            return _name;
        } else {
          vs = this._values[prefix] = /* @__PURE__ */ new Map();
        }
        vs.set(valueKey, name);
        const s = this._scope[prefix] || (this._scope[prefix] = []);
        const itemIndex = s.length;
        s[itemIndex] = value.ref;
        name.setValue(value, { property: prefix, itemIndex });
        return name;
      }
      getValue(prefix, keyOrRef) {
        const vs = this._values[prefix];
        if (!vs)
          return;
        return vs.get(keyOrRef);
      }
      scopeRefs(scopeName, values = this._values) {
        return this._reduceValues(values, (name) => {
          if (name.scopePath === void 0)
            throw new Error(`CodeGen: name "${name}" has no value`);
          return (0, code_1._)`${scopeName}${name.scopePath}`;
        });
      }
      scopeCode(values = this._values, usedValues, getCode) {
        return this._reduceValues(values, (name) => {
          if (name.value === void 0)
            throw new Error(`CodeGen: name "${name}" has no value`);
          return name.value.code;
        }, usedValues, getCode);
      }
      _reduceValues(values, valueCode, usedValues = {}, getCode) {
        let code = code_1.nil;
        for (const prefix in values) {
          const vs = values[prefix];
          if (!vs)
            continue;
          const nameSet = usedValues[prefix] = usedValues[prefix] || /* @__PURE__ */ new Map();
          vs.forEach((name) => {
            if (nameSet.has(name))
              return;
            nameSet.set(name, UsedValueState.Started);
            let c = valueCode(name);
            if (c) {
              const def = this.opts.es5 ? exports2.varKinds.var : exports2.varKinds.const;
              code = (0, code_1._)`${code}${def} ${name} = ${c};${this.opts._n}`;
            } else if (c = getCode === null || getCode === void 0 ? void 0 : getCode(name)) {
              code = (0, code_1._)`${code}${c}${this.opts._n}`;
            } else {
              throw new ValueError(name);
            }
            nameSet.set(name, UsedValueState.Completed);
          });
        }
        return code;
      }
    };
    exports2.ValueScope = ValueScope;
  }
});

// node_modules/ajv-formats/node_modules/ajv/dist/compile/codegen/index.js
var require_codegen2 = __commonJS({
  "node_modules/ajv-formats/node_modules/ajv/dist/compile/codegen/index.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.or = exports2.and = exports2.not = exports2.CodeGen = exports2.operators = exports2.varKinds = exports2.ValueScopeName = exports2.ValueScope = exports2.Scope = exports2.Name = exports2.regexpCode = exports2.stringify = exports2.getProperty = exports2.nil = exports2.strConcat = exports2.str = exports2._ = void 0;
    var code_1 = require_code3();
    var scope_1 = require_scope2();
    var code_2 = require_code3();
    Object.defineProperty(exports2, "_", { enumerable: true, get: function() {
      return code_2._;
    } });
    Object.defineProperty(exports2, "str", { enumerable: true, get: function() {
      return code_2.str;
    } });
    Object.defineProperty(exports2, "strConcat", { enumerable: true, get: function() {
      return code_2.strConcat;
    } });
    Object.defineProperty(exports2, "nil", { enumerable: true, get: function() {
      return code_2.nil;
    } });
    Object.defineProperty(exports2, "getProperty", { enumerable: true, get: function() {
      return code_2.getProperty;
    } });
    Object.defineProperty(exports2, "stringify", { enumerable: true, get: function() {
      return code_2.stringify;
    } });
    Object.defineProperty(exports2, "regexpCode", { enumerable: true, get: function() {
      return code_2.regexpCode;
    } });
    Object.defineProperty(exports2, "Name", { enumerable: true, get: function() {
      return code_2.Name;
    } });
    var scope_2 = require_scope2();
    Object.defineProperty(exports2, "Scope", { enumerable: true, get: function() {
      return scope_2.Scope;
    } });
    Object.defineProperty(exports2, "ValueScope", { enumerable: true, get: function() {
      return scope_2.ValueScope;
    } });
    Object.defineProperty(exports2, "ValueScopeName", { enumerable: true, get: function() {
      return scope_2.ValueScopeName;
    } });
    Object.defineProperty(exports2, "varKinds", { enumerable: true, get: function() {
      return scope_2.varKinds;
    } });
    exports2.operators = {
      GT: new code_1._Code(">"),
      GTE: new code_1._Code(">="),
      LT: new code_1._Code("<"),
      LTE: new code_1._Code("<="),
      EQ: new code_1._Code("==="),
      NEQ: new code_1._Code("!=="),
      NOT: new code_1._Code("!"),
      OR: new code_1._Code("||"),
      AND: new code_1._Code("&&"),
      ADD: new code_1._Code("+")
    };
    var Node = class {
      optimizeNodes() {
        return this;
      }
      optimizeNames(_names, _constants) {
        return this;
      }
    };
    var Def = class extends Node {
      constructor(varKind, name, rhs) {
        super();
        this.varKind = varKind;
        this.name = name;
        this.rhs = rhs;
      }
      render({ es5, _n }) {
        const varKind = es5 ? scope_1.varKinds.var : this.varKind;
        const rhs = this.rhs === void 0 ? "" : ` = ${this.rhs}`;
        return `${varKind} ${this.name}${rhs};` + _n;
      }
      optimizeNames(names, constants) {
        if (!names[this.name.str])
          return;
        if (this.rhs)
          this.rhs = optimizeExpr(this.rhs, names, constants);
        return this;
      }
      get names() {
        return this.rhs instanceof code_1._CodeOrName ? this.rhs.names : {};
      }
    };
    var Assign = class extends Node {
      constructor(lhs, rhs, sideEffects) {
        super();
        this.lhs = lhs;
        this.rhs = rhs;
        this.sideEffects = sideEffects;
      }
      render({ _n }) {
        return `${this.lhs} = ${this.rhs};` + _n;
      }
      optimizeNames(names, constants) {
        if (this.lhs instanceof code_1.Name && !names[this.lhs.str] && !this.sideEffects)
          return;
        this.rhs = optimizeExpr(this.rhs, names, constants);
        return this;
      }
      get names() {
        const names = this.lhs instanceof code_1.Name ? {} : { ...this.lhs.names };
        return addExprNames(names, this.rhs);
      }
    };
    var AssignOp = class extends Assign {
      constructor(lhs, op, rhs, sideEffects) {
        super(lhs, rhs, sideEffects);
        this.op = op;
      }
      render({ _n }) {
        return `${this.lhs} ${this.op}= ${this.rhs};` + _n;
      }
    };
    var Label = class extends Node {
      constructor(label) {
        super();
        this.label = label;
        this.names = {};
      }
      render({ _n }) {
        return `${this.label}:` + _n;
      }
    };
    var Break = class extends Node {
      constructor(label) {
        super();
        this.label = label;
        this.names = {};
      }
      render({ _n }) {
        const label = this.label ? ` ${this.label}` : "";
        return `break${label};` + _n;
      }
    };
    var Throw = class extends Node {
      constructor(error48) {
        super();
        this.error = error48;
      }
      render({ _n }) {
        return `throw ${this.error};` + _n;
      }
      get names() {
        return this.error.names;
      }
    };
    var AnyCode = class extends Node {
      constructor(code) {
        super();
        this.code = code;
      }
      render({ _n }) {
        return `${this.code};` + _n;
      }
      optimizeNodes() {
        return `${this.code}` ? this : void 0;
      }
      optimizeNames(names, constants) {
        this.code = optimizeExpr(this.code, names, constants);
        return this;
      }
      get names() {
        return this.code instanceof code_1._CodeOrName ? this.code.names : {};
      }
    };
    var ParentNode = class extends Node {
      constructor(nodes = []) {
        super();
        this.nodes = nodes;
      }
      render(opts) {
        return this.nodes.reduce((code, n) => code + n.render(opts), "");
      }
      optimizeNodes() {
        const { nodes } = this;
        let i = nodes.length;
        while (i--) {
          const n = nodes[i].optimizeNodes();
          if (Array.isArray(n))
            nodes.splice(i, 1, ...n);
          else if (n)
            nodes[i] = n;
          else
            nodes.splice(i, 1);
        }
        return nodes.length > 0 ? this : void 0;
      }
      optimizeNames(names, constants) {
        const { nodes } = this;
        let i = nodes.length;
        while (i--) {
          const n = nodes[i];
          if (n.optimizeNames(names, constants))
            continue;
          subtractNames(names, n.names);
          nodes.splice(i, 1);
        }
        return nodes.length > 0 ? this : void 0;
      }
      get names() {
        return this.nodes.reduce((names, n) => addNames(names, n.names), {});
      }
    };
    var BlockNode = class extends ParentNode {
      render(opts) {
        return "{" + opts._n + super.render(opts) + "}" + opts._n;
      }
    };
    var Root = class extends ParentNode {
    };
    var Else = class extends BlockNode {
    };
    Else.kind = "else";
    var If = class _If extends BlockNode {
      constructor(condition, nodes) {
        super(nodes);
        this.condition = condition;
      }
      render(opts) {
        let code = `if(${this.condition})` + super.render(opts);
        if (this.else)
          code += "else " + this.else.render(opts);
        return code;
      }
      optimizeNodes() {
        super.optimizeNodes();
        const cond = this.condition;
        if (cond === true)
          return this.nodes;
        let e = this.else;
        if (e) {
          const ns = e.optimizeNodes();
          e = this.else = Array.isArray(ns) ? new Else(ns) : ns;
        }
        if (e) {
          if (cond === false)
            return e instanceof _If ? e : e.nodes;
          if (this.nodes.length)
            return this;
          return new _If(not(cond), e instanceof _If ? [e] : e.nodes);
        }
        if (cond === false || !this.nodes.length)
          return void 0;
        return this;
      }
      optimizeNames(names, constants) {
        var _a2;
        this.else = (_a2 = this.else) === null || _a2 === void 0 ? void 0 : _a2.optimizeNames(names, constants);
        if (!(super.optimizeNames(names, constants) || this.else))
          return;
        this.condition = optimizeExpr(this.condition, names, constants);
        return this;
      }
      get names() {
        const names = super.names;
        addExprNames(names, this.condition);
        if (this.else)
          addNames(names, this.else.names);
        return names;
      }
    };
    If.kind = "if";
    var For = class extends BlockNode {
    };
    For.kind = "for";
    var ForLoop = class extends For {
      constructor(iteration) {
        super();
        this.iteration = iteration;
      }
      render(opts) {
        return `for(${this.iteration})` + super.render(opts);
      }
      optimizeNames(names, constants) {
        if (!super.optimizeNames(names, constants))
          return;
        this.iteration = optimizeExpr(this.iteration, names, constants);
        return this;
      }
      get names() {
        return addNames(super.names, this.iteration.names);
      }
    };
    var ForRange = class extends For {
      constructor(varKind, name, from, to) {
        super();
        this.varKind = varKind;
        this.name = name;
        this.from = from;
        this.to = to;
      }
      render(opts) {
        const varKind = opts.es5 ? scope_1.varKinds.var : this.varKind;
        const { name, from, to } = this;
        return `for(${varKind} ${name}=${from}; ${name}<${to}; ${name}++)` + super.render(opts);
      }
      get names() {
        const names = addExprNames(super.names, this.from);
        return addExprNames(names, this.to);
      }
    };
    var ForIter = class extends For {
      constructor(loop, varKind, name, iterable) {
        super();
        this.loop = loop;
        this.varKind = varKind;
        this.name = name;
        this.iterable = iterable;
      }
      render(opts) {
        return `for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})` + super.render(opts);
      }
      optimizeNames(names, constants) {
        if (!super.optimizeNames(names, constants))
          return;
        this.iterable = optimizeExpr(this.iterable, names, constants);
        return this;
      }
      get names() {
        return addNames(super.names, this.iterable.names);
      }
    };
    var Func = class extends BlockNode {
      constructor(name, args, async) {
        super();
        this.name = name;
        this.args = args;
        this.async = async;
      }
      render(opts) {
        const _async = this.async ? "async " : "";
        return `${_async}function ${this.name}(${this.args})` + super.render(opts);
      }
    };
    Func.kind = "func";
    var Return = class extends ParentNode {
      render(opts) {
        return "return " + super.render(opts);
      }
    };
    Return.kind = "return";
    var Try = class extends BlockNode {
      render(opts) {
        let code = "try" + super.render(opts);
        if (this.catch)
          code += this.catch.render(opts);
        if (this.finally)
          code += this.finally.render(opts);
        return code;
      }
      optimizeNodes() {
        var _a2, _b;
        super.optimizeNodes();
        (_a2 = this.catch) === null || _a2 === void 0 ? void 0 : _a2.optimizeNodes();
        (_b = this.finally) === null || _b === void 0 ? void 0 : _b.optimizeNodes();
        return this;
      }
      optimizeNames(names, constants) {
        var _a2, _b;
        super.optimizeNames(names, constants);
        (_a2 = this.catch) === null || _a2 === void 0 ? void 0 : _a2.optimizeNames(names, constants);
        (_b = this.finally) === null || _b === void 0 ? void 0 : _b.optimizeNames(names, constants);
        return this;
      }
      get names() {
        const names = super.names;
        if (this.catch)
          addNames(names, this.catch.names);
        if (this.finally)
          addNames(names, this.finally.names);
        return names;
      }
    };
    var Catch = class extends BlockNode {
      constructor(error48) {
        super();
        this.error = error48;
      }
      render(opts) {
        return `catch(${this.error})` + super.render(opts);
      }
    };
    Catch.kind = "catch";
    var Finally = class extends BlockNode {
      render(opts) {
        return "finally" + super.render(opts);
      }
    };
    Finally.kind = "finally";
    var CodeGen = class {
      constructor(extScope, opts = {}) {
        this._values = {};
        this._blockStarts = [];
        this._constants = {};
        this.opts = { ...opts, _n: opts.lines ? "\n" : "" };
        this._extScope = extScope;
        this._scope = new scope_1.Scope({ parent: extScope });
        this._nodes = [new Root()];
      }
      toString() {
        return this._root.render(this.opts);
      }
      // returns unique name in the internal scope
      name(prefix) {
        return this._scope.name(prefix);
      }
      // reserves unique name in the external scope
      scopeName(prefix) {
        return this._extScope.name(prefix);
      }
      // reserves unique name in the external scope and assigns value to it
      scopeValue(prefixOrName, value) {
        const name = this._extScope.value(prefixOrName, value);
        const vs = this._values[name.prefix] || (this._values[name.prefix] = /* @__PURE__ */ new Set());
        vs.add(name);
        return name;
      }
      getScopeValue(prefix, keyOrRef) {
        return this._extScope.getValue(prefix, keyOrRef);
      }
      // return code that assigns values in the external scope to the names that are used internally
      // (same names that were returned by gen.scopeName or gen.scopeValue)
      scopeRefs(scopeName) {
        return this._extScope.scopeRefs(scopeName, this._values);
      }
      scopeCode() {
        return this._extScope.scopeCode(this._values);
      }
      _def(varKind, nameOrPrefix, rhs, constant) {
        const name = this._scope.toName(nameOrPrefix);
        if (rhs !== void 0 && constant)
          this._constants[name.str] = rhs;
        this._leafNode(new Def(varKind, name, rhs));
        return name;
      }
      // `const` declaration (`var` in es5 mode)
      const(nameOrPrefix, rhs, _constant) {
        return this._def(scope_1.varKinds.const, nameOrPrefix, rhs, _constant);
      }
      // `let` declaration with optional assignment (`var` in es5 mode)
      let(nameOrPrefix, rhs, _constant) {
        return this._def(scope_1.varKinds.let, nameOrPrefix, rhs, _constant);
      }
      // `var` declaration with optional assignment
      var(nameOrPrefix, rhs, _constant) {
        return this._def(scope_1.varKinds.var, nameOrPrefix, rhs, _constant);
      }
      // assignment code
      assign(lhs, rhs, sideEffects) {
        return this._leafNode(new Assign(lhs, rhs, sideEffects));
      }
      // `+=` code
      add(lhs, rhs) {
        return this._leafNode(new AssignOp(lhs, exports2.operators.ADD, rhs));
      }
      // appends passed SafeExpr to code or executes Block
      code(c) {
        if (typeof c == "function")
          c();
        else if (c !== code_1.nil)
          this._leafNode(new AnyCode(c));
        return this;
      }
      // returns code for object literal for the passed argument list of key-value pairs
      object(...keyValues) {
        const code = ["{"];
        for (const [key, value] of keyValues) {
          if (code.length > 1)
            code.push(",");
          code.push(key);
          if (key !== value || this.opts.es5) {
            code.push(":");
            (0, code_1.addCodeArg)(code, value);
          }
        }
        code.push("}");
        return new code_1._Code(code);
      }
      // `if` clause (or statement if `thenBody` and, optionally, `elseBody` are passed)
      if(condition, thenBody, elseBody) {
        this._blockNode(new If(condition));
        if (thenBody && elseBody) {
          this.code(thenBody).else().code(elseBody).endIf();
        } else if (thenBody) {
          this.code(thenBody).endIf();
        } else if (elseBody) {
          throw new Error('CodeGen: "else" body without "then" body');
        }
        return this;
      }
      // `else if` clause - invalid without `if` or after `else` clauses
      elseIf(condition) {
        return this._elseNode(new If(condition));
      }
      // `else` clause - only valid after `if` or `else if` clauses
      else() {
        return this._elseNode(new Else());
      }
      // end `if` statement (needed if gen.if was used only with condition)
      endIf() {
        return this._endBlockNode(If, Else);
      }
      _for(node, forBody) {
        this._blockNode(node);
        if (forBody)
          this.code(forBody).endFor();
        return this;
      }
      // a generic `for` clause (or statement if `forBody` is passed)
      for(iteration, forBody) {
        return this._for(new ForLoop(iteration), forBody);
      }
      // `for` statement for a range of values
      forRange(nameOrPrefix, from, to, forBody, varKind = this.opts.es5 ? scope_1.varKinds.var : scope_1.varKinds.let) {
        const name = this._scope.toName(nameOrPrefix);
        return this._for(new ForRange(varKind, name, from, to), () => forBody(name));
      }
      // `for-of` statement (in es5 mode replace with a normal for loop)
      forOf(nameOrPrefix, iterable, forBody, varKind = scope_1.varKinds.const) {
        const name = this._scope.toName(nameOrPrefix);
        if (this.opts.es5) {
          const arr = iterable instanceof code_1.Name ? iterable : this.var("_arr", iterable);
          return this.forRange("_i", 0, (0, code_1._)`${arr}.length`, (i) => {
            this.var(name, (0, code_1._)`${arr}[${i}]`);
            forBody(name);
          });
        }
        return this._for(new ForIter("of", varKind, name, iterable), () => forBody(name));
      }
      // `for-in` statement.
      // With option `ownProperties` replaced with a `for-of` loop for object keys
      forIn(nameOrPrefix, obj, forBody, varKind = this.opts.es5 ? scope_1.varKinds.var : scope_1.varKinds.const) {
        if (this.opts.ownProperties) {
          return this.forOf(nameOrPrefix, (0, code_1._)`Object.keys(${obj})`, forBody);
        }
        const name = this._scope.toName(nameOrPrefix);
        return this._for(new ForIter("in", varKind, name, obj), () => forBody(name));
      }
      // end `for` loop
      endFor() {
        return this._endBlockNode(For);
      }
      // `label` statement
      label(label) {
        return this._leafNode(new Label(label));
      }
      // `break` statement
      break(label) {
        return this._leafNode(new Break(label));
      }
      // `return` statement
      return(value) {
        const node = new Return();
        this._blockNode(node);
        this.code(value);
        if (node.nodes.length !== 1)
          throw new Error('CodeGen: "return" should have one node');
        return this._endBlockNode(Return);
      }
      // `try` statement
      try(tryBody, catchCode, finallyCode) {
        if (!catchCode && !finallyCode)
          throw new Error('CodeGen: "try" without "catch" and "finally"');
        const node = new Try();
        this._blockNode(node);
        this.code(tryBody);
        if (catchCode) {
          const error48 = this.name("e");
          this._currNode = node.catch = new Catch(error48);
          catchCode(error48);
        }
        if (finallyCode) {
          this._currNode = node.finally = new Finally();
          this.code(finallyCode);
        }
        return this._endBlockNode(Catch, Finally);
      }
      // `throw` statement
      throw(error48) {
        return this._leafNode(new Throw(error48));
      }
      // start self-balancing block
      block(body, nodeCount) {
        this._blockStarts.push(this._nodes.length);
        if (body)
          this.code(body).endBlock(nodeCount);
        return this;
      }
      // end the current self-balancing block
      endBlock(nodeCount) {
        const len = this._blockStarts.pop();
        if (len === void 0)
          throw new Error("CodeGen: not in self-balancing block");
        const toClose = this._nodes.length - len;
        if (toClose < 0 || nodeCount !== void 0 && toClose !== nodeCount) {
          throw new Error(`CodeGen: wrong number of nodes: ${toClose} vs ${nodeCount} expected`);
        }
        this._nodes.length = len;
        return this;
      }
      // `function` heading (or definition if funcBody is passed)
      func(name, args = code_1.nil, async, funcBody) {
        this._blockNode(new Func(name, args, async));
        if (funcBody)
          this.code(funcBody).endFunc();
        return this;
      }
      // end function definition
      endFunc() {
        return this._endBlockNode(Func);
      }
      optimize(n = 1) {
        while (n-- > 0) {
          this._root.optimizeNodes();
          this._root.optimizeNames(this._root.names, this._constants);
        }
      }
      _leafNode(node) {
        this._currNode.nodes.push(node);
        return this;
      }
      _blockNode(node) {
        this._currNode.nodes.push(node);
        this._nodes.push(node);
      }
      _endBlockNode(N1, N2) {
        const n = this._currNode;
        if (n instanceof N1 || N2 && n instanceof N2) {
          this._nodes.pop();
          return this;
        }
        throw new Error(`CodeGen: not in block "${N2 ? `${N1.kind}/${N2.kind}` : N1.kind}"`);
      }
      _elseNode(node) {
        const n = this._currNode;
        if (!(n instanceof If)) {
          throw new Error('CodeGen: "else" without "if"');
        }
        this._currNode = n.else = node;
        return this;
      }
      get _root() {
        return this._nodes[0];
      }
      get _currNode() {
        const ns = this._nodes;
        return ns[ns.length - 1];
      }
      set _currNode(node) {
        const ns = this._nodes;
        ns[ns.length - 1] = node;
      }
    };
    exports2.CodeGen = CodeGen;
    function addNames(names, from) {
      for (const n in from)
        names[n] = (names[n] || 0) + (from[n] || 0);
      return names;
    }
    function addExprNames(names, from) {
      return from instanceof code_1._CodeOrName ? addNames(names, from.names) : names;
    }
    function optimizeExpr(expr, names, constants) {
      if (expr instanceof code_1.Name)
        return replaceName(expr);
      if (!canOptimize(expr))
        return expr;
      return new code_1._Code(expr._items.reduce((items, c) => {
        if (c instanceof code_1.Name)
          c = replaceName(c);
        if (c instanceof code_1._Code)
          items.push(...c._items);
        else
          items.push(c);
        return items;
      }, []));
      function replaceName(n) {
        const c = constants[n.str];
        if (c === void 0 || names[n.str] !== 1)
          return n;
        delete names[n.str];
        return c;
      }
      function canOptimize(e) {
        return e instanceof code_1._Code && e._items.some((c) => c instanceof code_1.Name && names[c.str] === 1 && constants[c.str] !== void 0);
      }
    }
    function subtractNames(names, from) {
      for (const n in from)
        names[n] = (names[n] || 0) - (from[n] || 0);
    }
    function not(x) {
      return typeof x == "boolean" || typeof x == "number" || x === null ? !x : (0, code_1._)`!${par(x)}`;
    }
    exports2.not = not;
    var andCode = mappend(exports2.operators.AND);
    function and(...args) {
      return args.reduce(andCode);
    }
    exports2.and = and;
    var orCode = mappend(exports2.operators.OR);
    function or(...args) {
      return args.reduce(orCode);
    }
    exports2.or = or;
    function mappend(op) {
      return (x, y) => x === code_1.nil ? y : y === code_1.nil ? x : (0, code_1._)`${par(x)} ${op} ${par(y)}`;
    }
    function par(x) {
      return x instanceof code_1.Name ? x : (0, code_1._)`(${x})`;
    }
  }
});

// node_modules/ajv-formats/node_modules/ajv/dist/compile/util.js
var require_util5 = __commonJS({
  "node_modules/ajv-formats/node_modules/ajv/dist/compile/util.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.checkStrictMode = exports2.getErrorPath = exports2.Type = exports2.useFunc = exports2.setEvaluated = exports2.evaluatedPropsToName = exports2.mergeEvaluated = exports2.eachItem = exports2.unescapeJsonPointer = exports2.escapeJsonPointer = exports2.escapeFragment = exports2.unescapeFragment = exports2.schemaRefOrVal = exports2.schemaHasRulesButRef = exports2.schemaHasRules = exports2.checkUnknownRules = exports2.alwaysValidSchema = exports2.toHash = void 0;
    var codegen_1 = require_codegen2();
    var code_1 = require_code3();
    function toHash(arr) {
      const hash2 = {};
      for (const item of arr)
        hash2[item] = true;
      return hash2;
    }
    exports2.toHash = toHash;
    function alwaysValidSchema(it, schema) {
      if (typeof schema == "boolean")
        return schema;
      if (Object.keys(schema).length === 0)
        return true;
      checkUnknownRules(it, schema);
      return !schemaHasRules(schema, it.self.RULES.all);
    }
    exports2.alwaysValidSchema = alwaysValidSchema;
    function checkUnknownRules(it, schema = it.schema) {
      const { opts, self } = it;
      if (!opts.strictSchema)
        return;
      if (typeof schema === "boolean")
        return;
      const rules = self.RULES.keywords;
      for (const key in schema) {
        if (!rules[key])
          checkStrictMode(it, `unknown keyword: "${key}"`);
      }
    }
    exports2.checkUnknownRules = checkUnknownRules;
    function schemaHasRules(schema, rules) {
      if (typeof schema == "boolean")
        return !schema;
      for (const key in schema)
        if (rules[key])
          return true;
      return false;
    }
    exports2.schemaHasRules = schemaHasRules;
    function schemaHasRulesButRef(schema, RULES) {
      if (typeof schema == "boolean")
        return !schema;
      for (const key in schema)
        if (key !== "$ref" && RULES.all[key])
          return true;
      return false;
    }
    exports2.schemaHasRulesButRef = schemaHasRulesButRef;
    function schemaRefOrVal({ topSchemaRef, schemaPath }, schema, keyword, $data) {
      if (!$data) {
        if (typeof schema == "number" || typeof schema == "boolean")
          return schema;
        if (typeof schema == "string")
          return (0, codegen_1._)`${schema}`;
      }
      return (0, codegen_1._)`${topSchemaRef}${schemaPath}${(0, codegen_1.getProperty)(keyword)}`;
    }
    exports2.schemaRefOrVal = schemaRefOrVal;
    function unescapeFragment(str) {
      return unescapeJsonPointer(decodeURIComponent(str));
    }
    exports2.unescapeFragment = unescapeFragment;
    function escapeFragment(str) {
      return encodeURIComponent(escapeJsonPointer(str));
    }
    exports2.escapeFragment = escapeFragment;
    function escapeJsonPointer(str) {
      if (typeof str == "number")
        return `${str}`;
      return str.replace(/~/g, "~0").replace(/\//g, "~1");
    }
    exports2.escapeJsonPointer = escapeJsonPointer;
    function unescapeJsonPointer(str) {
      return str.replace(/~1/g, "/").replace(/~0/g, "~");
    }
    exports2.unescapeJsonPointer = unescapeJsonPointer;
    function eachItem(xs, f) {
      if (Array.isArray(xs)) {
        for (const x of xs)
          f(x);
      } else {
        f(xs);
      }
    }
    exports2.eachItem = eachItem;
    function makeMergeEvaluated({ mergeNames, mergeToName, mergeValues: mergeValues3, resultToName }) {
      return (gen, from, to, toName) => {
        const res = to === void 0 ? from : to instanceof codegen_1.Name ? (from instanceof codegen_1.Name ? mergeNames(gen, from, to) : mergeToName(gen, from, to), to) : from instanceof codegen_1.Name ? (mergeToName(gen, to, from), from) : mergeValues3(from, to);
        return toName === codegen_1.Name && !(res instanceof codegen_1.Name) ? resultToName(gen, res) : res;
      };
    }
    exports2.mergeEvaluated = {
      props: makeMergeEvaluated({
        mergeNames: (gen, from, to) => gen.if((0, codegen_1._)`${to} !== true && ${from} !== undefined`, () => {
          gen.if((0, codegen_1._)`${from} === true`, () => gen.assign(to, true), () => gen.assign(to, (0, codegen_1._)`${to} || {}`).code((0, codegen_1._)`Object.assign(${to}, ${from})`));
        }),
        mergeToName: (gen, from, to) => gen.if((0, codegen_1._)`${to} !== true`, () => {
          if (from === true) {
            gen.assign(to, true);
          } else {
            gen.assign(to, (0, codegen_1._)`${to} || {}`);
            setEvaluated(gen, to, from);
          }
        }),
        mergeValues: (from, to) => from === true ? true : { ...from, ...to },
        resultToName: evaluatedPropsToName
      }),
      items: makeMergeEvaluated({
        mergeNames: (gen, from, to) => gen.if((0, codegen_1._)`${to} !== true && ${from} !== undefined`, () => gen.assign(to, (0, codegen_1._)`${from} === true ? true : ${to} > ${from} ? ${to} : ${from}`)),
        mergeToName: (gen, from, to) => gen.if((0, codegen_1._)`${to} !== true`, () => gen.assign(to, from === true ? true : (0, codegen_1._)`${to} > ${from} ? ${to} : ${from}`)),
        mergeValues: (from, to) => from === true ? true : Math.max(from, to),
        resultToName: (gen, items) => gen.var("items", items)
      })
    };
    function evaluatedPropsToName(gen, ps) {
      if (ps === true)
        return gen.var("props", true);
      const props = gen.var("props", (0, codegen_1._)`{}`);
      if (ps !== void 0)
        setEvaluated(gen, props, ps);
      return props;
    }
    exports2.evaluatedPropsToName = evaluatedPropsToName;
    function setEvaluated(gen, props, ps) {
      Object.keys(ps).forEach((p) => gen.assign((0, codegen_1._)`${props}${(0, codegen_1.getProperty)(p)}`, true));
    }
    exports2.setEvaluated = setEvaluated;
    var snippets = {};
    function useFunc(gen, f) {
      return gen.scopeValue("func", {
        ref: f,
        code: snippets[f.code] || (snippets[f.code] = new code_1._Code(f.code))
      });
    }
    exports2.useFunc = useFunc;
    var Type;
    (function(Type2) {
      Type2[Type2["Num"] = 0] = "Num";
      Type2[Type2["Str"] = 1] = "Str";
    })(Type || (exports2.Type = Type = {}));
    function getErrorPath(dataProp, dataPropType, jsPropertySyntax) {
      if (dataProp instanceof codegen_1.Name) {
        const isNumber = dataPropType === Type.Num;
        return jsPropertySyntax ? isNumber ? (0, codegen_1._)`"[" + ${dataProp} + "]"` : (0, codegen_1._)`"['" + ${dataProp} + "']"` : isNumber ? (0, codegen_1._)`"/" + ${dataProp}` : (0, codegen_1._)`"/" + ${dataProp}.replace(/~/g, "~0").replace(/\\//g, "~1")`;
      }
      return jsPropertySyntax ? (0, codegen_1.getProperty)(dataProp).toString() : "/" + escapeJsonPointer(dataProp);
    }
    exports2.getErrorPath = getErrorPath;
    function checkStrictMode(it, msg, mode = it.opts.strictSchema) {
      if (!mode)
        return;
      msg = `strict mode: ${msg}`;
      if (mode === true)
        throw new Error(msg);
      it.self.logger.warn(msg);
    }
    exports2.checkStrictMode = checkStrictMode;
  }
});

// node_modules/ajv-formats/node_modules/ajv/dist/compile/names.js
var require_names2 = __commonJS({
  "node_modules/ajv-formats/node_modules/ajv/dist/compile/names.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    var codegen_1 = require_codegen2();
    var names = {
      // validation function arguments
      data: new codegen_1.Name("data"),
      // data passed to validation function
      // args passed from referencing schema
      valCxt: new codegen_1.Name("valCxt"),
      // validation/data context - should not be used directly, it is destructured to the names below
      instancePath: new codegen_1.Name("instancePath"),
      parentData: new codegen_1.Name("parentData"),
      parentDataProperty: new codegen_1.Name("parentDataProperty"),
      rootData: new codegen_1.Name("rootData"),
      // root data - same as the data passed to the first/top validation function
      dynamicAnchors: new codegen_1.Name("dynamicAnchors"),
      // used to support recursiveRef and dynamicRef
      // function scoped variables
      vErrors: new codegen_1.Name("vErrors"),
      // null or array of validation errors
      errors: new codegen_1.Name("errors"),
      // counter of validation errors
      this: new codegen_1.Name("this"),
      // "globals"
      self: new codegen_1.Name("self"),
      scope: new codegen_1.Name("scope"),
      // JTD serialize/parse name for JSON string and position
      json: new codegen_1.Name("json"),
      jsonPos: new codegen_1.Name("jsonPos"),
      jsonLen: new codegen_1.Name("jsonLen"),
      jsonPart: new codegen_1.Name("jsonPart")
    };
    exports2.default = names;
  }
});

// node_modules/ajv-formats/node_modules/ajv/dist/compile/errors.js
var require_errors3 = __commonJS({
  "node_modules/ajv-formats/node_modules/ajv/dist/compile/errors.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.extendErrors = exports2.resetErrorsCount = exports2.reportExtraError = exports2.reportError = exports2.keyword$DataError = exports2.keywordError = void 0;
    var codegen_1 = require_codegen2();
    var util_1 = require_util5();
    var names_1 = require_names2();
    exports2.keywordError = {
      message: ({ keyword }) => (0, codegen_1.str)`must pass "${keyword}" keyword validation`
    };
    exports2.keyword$DataError = {
      message: ({ keyword, schemaType }) => schemaType ? (0, codegen_1.str)`"${keyword}" keyword must be ${schemaType} ($data)` : (0, codegen_1.str)`"${keyword}" keyword is invalid ($data)`
    };
    function reportError(cxt, error48 = exports2.keywordError, errorPaths, overrideAllErrors) {
      const { it } = cxt;
      const { gen, compositeRule, allErrors } = it;
      const errObj = errorObjectCode(cxt, error48, errorPaths);
      if (overrideAllErrors !== null && overrideAllErrors !== void 0 ? overrideAllErrors : compositeRule || allErrors) {
        addError(gen, errObj);
      } else {
        returnErrors(it, (0, codegen_1._)`[${errObj}]`);
      }
    }
    exports2.reportError = reportError;
    function reportExtraError(cxt, error48 = exports2.keywordError, errorPaths) {
      const { it } = cxt;
      const { gen, compositeRule, allErrors } = it;
      const errObj = errorObjectCode(cxt, error48, errorPaths);
      addError(gen, errObj);
      if (!(compositeRule || allErrors)) {
        returnErrors(it, names_1.default.vErrors);
      }
    }
    exports2.reportExtraError = reportExtraError;
    function resetErrorsCount(gen, errsCount) {
      gen.assign(names_1.default.errors, errsCount);
      gen.if((0, codegen_1._)`${names_1.default.vErrors} !== null`, () => gen.if(errsCount, () => gen.assign((0, codegen_1._)`${names_1.default.vErrors}.length`, errsCount), () => gen.assign(names_1.default.vErrors, null)));
    }
    exports2.resetErrorsCount = resetErrorsCount;
    function extendErrors({ gen, keyword, schemaValue, data, errsCount, it }) {
      if (errsCount === void 0)
        throw new Error("ajv implementation error");
      const err = gen.name("err");
      gen.forRange("i", errsCount, names_1.default.errors, (i) => {
        gen.const(err, (0, codegen_1._)`${names_1.default.vErrors}[${i}]`);
        gen.if((0, codegen_1._)`${err}.instancePath === undefined`, () => gen.assign((0, codegen_1._)`${err}.instancePath`, (0, codegen_1.strConcat)(names_1.default.instancePath, it.errorPath)));
        gen.assign((0, codegen_1._)`${err}.schemaPath`, (0, codegen_1.str)`${it.errSchemaPath}/${keyword}`);
        if (it.opts.verbose) {
          gen.assign((0, codegen_1._)`${err}.schema`, schemaValue);
          gen.assign((0, codegen_1._)`${err}.data`, data);
        }
      });
    }
    exports2.extendErrors = extendErrors;
    function addError(gen, errObj) {
      const err = gen.const("err", errObj);
      gen.if((0, codegen_1._)`${names_1.default.vErrors} === null`, () => gen.assign(names_1.default.vErrors, (0, codegen_1._)`[${err}]`), (0, codegen_1._)`${names_1.default.vErrors}.push(${err})`);
      gen.code((0, codegen_1._)`${names_1.default.errors}++`);
    }
    function returnErrors(it, errs) {
      const { gen, validateName, schemaEnv } = it;
      if (schemaEnv.$async) {
        gen.throw((0, codegen_1._)`new ${it.ValidationError}(${errs})`);
      } else {
        gen.assign((0, codegen_1._)`${validateName}.errors`, errs);
        gen.return(false);
      }
    }
    var E = {
      keyword: new codegen_1.Name("keyword"),
      schemaPath: new codegen_1.Name("schemaPath"),
      // also used in JTD errors
      params: new codegen_1.Name("params"),
      propertyName: new codegen_1.Name("propertyName"),
      message: new codegen_1.Name("message"),
      schema: new codegen_1.Name("schema"),
      parentSchema: new codegen_1.Name("parentSchema")
    };
    function errorObjectCode(cxt, error48, errorPaths) {
      const { createErrors } = cxt.it;
      if (createErrors === false)
        return (0, codegen_1._)`{}`;
      return errorObject(cxt, error48, errorPaths);
    }
    function errorObject(cxt, error48, errorPaths = {}) {
      const { gen, it } = cxt;
      const keyValues = [
        errorInstancePath(it, errorPaths),
        errorSchemaPath(cxt, errorPaths)
      ];
      extraErrorProps(cxt, error48, keyValues);
      return gen.object(...keyValues);
    }
    function errorInstancePath({ errorPath }, { instancePath }) {
      const instPath = instancePath ? (0, codegen_1.str)`${errorPath}${(0, util_1.getErrorPath)(instancePath, util_1.Type.Str)}` : errorPath;
      return [names_1.default.instancePath, (0, codegen_1.strConcat)(names_1.default.instancePath, instPath)];
    }
    function errorSchemaPath({ keyword, it: { errSchemaPath } }, { schemaPath, parentSchema }) {
      let schPath = parentSchema ? errSchemaPath : (0, codegen_1.str)`${errSchemaPath}/${keyword}`;
      if (schemaPath) {
        schPath = (0, codegen_1.str)`${schPath}${(0, util_1.getErrorPath)(schemaPath, util_1.Type.Str)}`;
      }
      return [E.schemaPath, schPath];
    }
    function extraErrorProps(cxt, { params, message }, keyValues) {
      const { keyword, data, schemaValue, it } = cxt;
      const { opts, propertyName, topSchemaRef, schemaPath } = it;
      keyValues.push([E.keyword, keyword], [E.params, typeof params == "function" ? params(cxt) : params || (0, codegen_1._)`{}`]);
      if (opts.messages) {
        keyValues.push([E.message, typeof message == "function" ? message(cxt) : message]);
      }
      if (opts.verbose) {
        keyValues.push([E.schema, schemaValue], [E.parentSchema, (0, codegen_1._)`${topSchemaRef}${schemaPath}`], [names_1.default.data, data]);
      }
      if (propertyName)
        keyValues.push([E.propertyName, propertyName]);
    }
  }
});

// node_modules/ajv-formats/node_modules/ajv/dist/compile/validate/boolSchema.js
var require_boolSchema2 = __commonJS({
  "node_modules/ajv-formats/node_modules/ajv/dist/compile/validate/boolSchema.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.boolOrEmptySchema = exports2.topBoolOrEmptySchema = void 0;
    var errors_1 = require_errors3();
    var codegen_1 = require_codegen2();
    var names_1 = require_names2();
    var boolError = {
      message: "boolean schema is false"
    };
    function topBoolOrEmptySchema(it) {
      const { gen, schema, validateName } = it;
      if (schema === false) {
        falseSchemaError(it, false);
      } else if (typeof schema == "object" && schema.$async === true) {
        gen.return(names_1.default.data);
      } else {
        gen.assign((0, codegen_1._)`${validateName}.errors`, null);
        gen.return(true);
      }
    }
    exports2.topBoolOrEmptySchema = topBoolOrEmptySchema;
    function boolOrEmptySchema(it, valid) {
      const { gen, schema } = it;
      if (schema === false) {
        gen.var(valid, false);
        falseSchemaError(it);
      } else {
        gen.var(valid, true);
      }
    }
    exports2.boolOrEmptySchema = boolOrEmptySchema;
    function falseSchemaError(it, overrideAllErrors) {
      const { gen, data } = it;
      const cxt = {
        gen,
        keyword: "false schema",
        data,
        schema: false,
        schemaCode: false,
        schemaValue: false,
        params: {},
        it
      };
      (0, errors_1.reportError)(cxt, boolError, void 0, overrideAllErrors);
    }
  }
});

// node_modules/ajv-formats/node_modules/ajv/dist/compile/rules.js
var require_rules2 = __commonJS({
  "node_modules/ajv-formats/node_modules/ajv/dist/compile/rules.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.getRules = exports2.isJSONType = void 0;
    var _jsonTypes = ["string", "number", "integer", "boolean", "null", "object", "array"];
    var jsonTypes = new Set(_jsonTypes);
    function isJSONType(x) {
      return typeof x == "string" && jsonTypes.has(x);
    }
    exports2.isJSONType = isJSONType;
    function getRules() {
      const groups = {
        number: { type: "number", rules: [] },
        string: { type: "string", rules: [] },
        array: { type: "array", rules: [] },
        object: { type: "object", rules: [] }
      };
      return {
        types: { ...groups, integer: true, boolean: true, null: true },
        rules: [{ rules: [] }, groups.number, groups.string, groups.array, groups.object],
        post: { rules: [] },
        all: {},
        keywords: {}
      };
    }
    exports2.getRules = getRules;
  }
});

// node_modules/ajv-formats/node_modules/ajv/dist/compile/validate/applicability.js
var require_applicability2 = __commonJS({
  "node_modules/ajv-formats/node_modules/ajv/dist/compile/validate/applicability.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.shouldUseRule = exports2.shouldUseGroup = exports2.schemaHasRulesForType = void 0;
    function schemaHasRulesForType({ schema, self }, type) {
      const group = self.RULES.types[type];
      return group && group !== true && shouldUseGroup(schema, group);
    }
    exports2.schemaHasRulesForType = schemaHasRulesForType;
    function shouldUseGroup(schema, group) {
      return group.rules.some((rule) => shouldUseRule(schema, rule));
    }
    exports2.shouldUseGroup = shouldUseGroup;
    function shouldUseRule(schema, rule) {
      var _a2;
      return schema[rule.keyword] !== void 0 || ((_a2 = rule.definition.implements) === null || _a2 === void 0 ? void 0 : _a2.some((kwd) => schema[kwd] !== void 0));
    }
    exports2.shouldUseRule = shouldUseRule;
  }
});

// node_modules/ajv-formats/node_modules/ajv/dist/compile/validate/dataType.js
var require_dataType2 = __commonJS({
  "node_modules/ajv-formats/node_modules/ajv/dist/compile/validate/dataType.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.reportTypeError = exports2.checkDataTypes = exports2.checkDataType = exports2.coerceAndCheckDataType = exports2.getJSONTypes = exports2.getSchemaTypes = exports2.DataType = void 0;
    var rules_1 = require_rules2();
    var applicability_1 = require_applicability2();
    var errors_1 = require_errors3();
    var codegen_1 = require_codegen2();
    var util_1 = require_util5();
    var DataType;
    (function(DataType2) {
      DataType2[DataType2["Correct"] = 0] = "Correct";
      DataType2[DataType2["Wrong"] = 1] = "Wrong";
    })(DataType || (exports2.DataType = DataType = {}));
    function getSchemaTypes(schema) {
      const types = getJSONTypes(schema.type);
      const hasNull = types.includes("null");
      if (hasNull) {
        if (schema.nullable === false)
          throw new Error("type: null contradicts nullable: false");
      } else {
        if (!types.length && schema.nullable !== void 0) {
          throw new Error('"nullable" cannot be used without "type"');
        }
        if (schema.nullable === true)
          types.push("null");
      }
      return types;
    }
    exports2.getSchemaTypes = getSchemaTypes;
    function getJSONTypes(ts) {
      const types = Array.isArray(ts) ? ts : ts ? [ts] : [];
      if (types.every(rules_1.isJSONType))
        return types;
      throw new Error("type must be JSONType or JSONType[]: " + types.join(","));
    }
    exports2.getJSONTypes = getJSONTypes;
    function coerceAndCheckDataType(it, types) {
      const { gen, data, opts } = it;
      const coerceTo = coerceToTypes(types, opts.coerceTypes);
      const checkTypes = types.length > 0 && !(coerceTo.length === 0 && types.length === 1 && (0, applicability_1.schemaHasRulesForType)(it, types[0]));
      if (checkTypes) {
        const wrongType = checkDataTypes(types, data, opts.strictNumbers, DataType.Wrong);
        gen.if(wrongType, () => {
          if (coerceTo.length)
            coerceData(it, types, coerceTo);
          else
            reportTypeError(it);
        });
      }
      return checkTypes;
    }
    exports2.coerceAndCheckDataType = coerceAndCheckDataType;
    var COERCIBLE = /* @__PURE__ */ new Set(["string", "number", "integer", "boolean", "null"]);
    function coerceToTypes(types, coerceTypes) {
      return coerceTypes ? types.filter((t) => COERCIBLE.has(t) || coerceTypes === "array" && t === "array") : [];
    }
    function coerceData(it, types, coerceTo) {
      const { gen, data, opts } = it;
      const dataType = gen.let("dataType", (0, codegen_1._)`typeof ${data}`);
      const coerced = gen.let("coerced", (0, codegen_1._)`undefined`);
      if (opts.coerceTypes === "array") {
        gen.if((0, codegen_1._)`${dataType} == 'object' && Array.isArray(${data}) && ${data}.length == 1`, () => gen.assign(data, (0, codegen_1._)`${data}[0]`).assign(dataType, (0, codegen_1._)`typeof ${data}`).if(checkDataTypes(types, data, opts.strictNumbers), () => gen.assign(coerced, data)));
      }
      gen.if((0, codegen_1._)`${coerced} !== undefined`);
      for (const t of coerceTo) {
        if (COERCIBLE.has(t) || t === "array" && opts.coerceTypes === "array") {
          coerceSpecificType(t);
        }
      }
      gen.else();
      reportTypeError(it);
      gen.endIf();
      gen.if((0, codegen_1._)`${coerced} !== undefined`, () => {
        gen.assign(data, coerced);
        assignParentData(it, coerced);
      });
      function coerceSpecificType(t) {
        switch (t) {
          case "string":
            gen.elseIf((0, codegen_1._)`${dataType} == "number" || ${dataType} == "boolean"`).assign(coerced, (0, codegen_1._)`"" + ${data}`).elseIf((0, codegen_1._)`${data} === null`).assign(coerced, (0, codegen_1._)`""`);
            return;
          case "number":
            gen.elseIf((0, codegen_1._)`${dataType} == "boolean" || ${data} === null
              || (${dataType} == "string" && ${data} && ${data} == +${data})`).assign(coerced, (0, codegen_1._)`+${data}`);
            return;
          case "integer":
            gen.elseIf((0, codegen_1._)`${dataType} === "boolean" || ${data} === null
              || (${dataType} === "string" && ${data} && ${data} == +${data} && !(${data} % 1))`).assign(coerced, (0, codegen_1._)`+${data}`);
            return;
          case "boolean":
            gen.elseIf((0, codegen_1._)`${data} === "false" || ${data} === 0 || ${data} === null`).assign(coerced, false).elseIf((0, codegen_1._)`${data} === "true" || ${data} === 1`).assign(coerced, true);
            return;
          case "null":
            gen.elseIf((0, codegen_1._)`${data} === "" || ${data} === 0 || ${data} === false`);
            gen.assign(coerced, null);
            return;
          case "array":
            gen.elseIf((0, codegen_1._)`${dataType} === "string" || ${dataType} === "number"
              || ${dataType} === "boolean" || ${data} === null`).assign(coerced, (0, codegen_1._)`[${data}]`);
        }
      }
    }
    function assignParentData({ gen, parentData, parentDataProperty }, expr) {
      gen.if((0, codegen_1._)`${parentData} !== undefined`, () => gen.assign((0, codegen_1._)`${parentData}[${parentDataProperty}]`, expr));
    }
    function checkDataType(dataType, data, strictNums, correct = DataType.Correct) {
      const EQ = correct === DataType.Correct ? codegen_1.operators.EQ : codegen_1.operators.NEQ;
      let cond;
      switch (dataType) {
        case "null":
          return (0, codegen_1._)`${data} ${EQ} null`;
        case "array":
          cond = (0, codegen_1._)`Array.isArray(${data})`;
          break;
        case "object":
          cond = (0, codegen_1._)`${data} && typeof ${data} == "object" && !Array.isArray(${data})`;
          break;
        case "integer":
          cond = numCond((0, codegen_1._)`!(${data} % 1) && !isNaN(${data})`);
          break;
        case "number":
          cond = numCond();
          break;
        default:
          return (0, codegen_1._)`typeof ${data} ${EQ} ${dataType}`;
      }
      return correct === DataType.Correct ? cond : (0, codegen_1.not)(cond);
      function numCond(_cond = codegen_1.nil) {
        return (0, codegen_1.and)((0, codegen_1._)`typeof ${data} == "number"`, _cond, strictNums ? (0, codegen_1._)`isFinite(${data})` : codegen_1.nil);
      }
    }
    exports2.checkDataType = checkDataType;
    function checkDataTypes(dataTypes, data, strictNums, correct) {
      if (dataTypes.length === 1) {
        return checkDataType(dataTypes[0], data, strictNums, correct);
      }
      let cond;
      const types = (0, util_1.toHash)(dataTypes);
      if (types.array && types.object) {
        const notObj = (0, codegen_1._)`typeof ${data} != "object"`;
        cond = types.null ? notObj : (0, codegen_1._)`!${data} || ${notObj}`;
        delete types.null;
        delete types.array;
        delete types.object;
      } else {
        cond = codegen_1.nil;
      }
      if (types.number)
        delete types.integer;
      for (const t in types)
        cond = (0, codegen_1.and)(cond, checkDataType(t, data, strictNums, correct));
      return cond;
    }
    exports2.checkDataTypes = checkDataTypes;
    var typeError = {
      message: ({ schema }) => `must be ${schema}`,
      params: ({ schema, schemaValue }) => typeof schema == "string" ? (0, codegen_1._)`{type: ${schema}}` : (0, codegen_1._)`{type: ${schemaValue}}`
    };
    function reportTypeError(it) {
      const cxt = getTypeErrorContext(it);
      (0, errors_1.reportError)(cxt, typeError);
    }
    exports2.reportTypeError = reportTypeError;
    function getTypeErrorContext(it) {
      const { gen, data, schema } = it;
      const schemaCode = (0, util_1.schemaRefOrVal)(it, schema, "type");
      return {
        gen,
        keyword: "type",
        data,
        schema: schema.type,
        schemaCode,
        schemaValue: schemaCode,
        parentSchema: schema,
        params: {},
        it
      };
    }
  }
});

// node_modules/ajv-formats/node_modules/ajv/dist/compile/validate/defaults.js
var require_defaults2 = __commonJS({
  "node_modules/ajv-formats/node_modules/ajv/dist/compile/validate/defaults.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.assignDefaults = void 0;
    var codegen_1 = require_codegen2();
    var util_1 = require_util5();
    function assignDefaults(it, ty) {
      const { properties, items } = it.schema;
      if (ty === "object" && properties) {
        for (const key in properties) {
          assignDefault(it, key, properties[key].default);
        }
      } else if (ty === "array" && Array.isArray(items)) {
        items.forEach((sch, i) => assignDefault(it, i, sch.default));
      }
    }
    exports2.assignDefaults = assignDefaults;
    function assignDefault(it, prop, defaultValue) {
      const { gen, compositeRule, data, opts } = it;
      if (defaultValue === void 0)
        return;
      const childData = (0, codegen_1._)`${data}${(0, codegen_1.getProperty)(prop)}`;
      if (compositeRule) {
        (0, util_1.checkStrictMode)(it, `default is ignored for: ${childData}`);
        return;
      }
      let condition = (0, codegen_1._)`${childData} === undefined`;
      if (opts.useDefaults === "empty") {
        condition = (0, codegen_1._)`${condition} || ${childData} === null || ${childData} === ""`;
      }
      gen.if(condition, (0, codegen_1._)`${childData} = ${(0, codegen_1.stringify)(defaultValue)}`);
    }
  }
});

// node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/code.js
var require_code4 = __commonJS({
  "node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/code.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.validateUnion = exports2.validateArray = exports2.usePattern = exports2.callValidateCode = exports2.schemaProperties = exports2.allSchemaProperties = exports2.noPropertyInData = exports2.propertyInData = exports2.isOwnProperty = exports2.hasPropFunc = exports2.reportMissingProp = exports2.checkMissingProp = exports2.checkReportMissingProp = void 0;
    var codegen_1 = require_codegen2();
    var util_1 = require_util5();
    var names_1 = require_names2();
    var util_2 = require_util5();
    function checkReportMissingProp(cxt, prop) {
      const { gen, data, it } = cxt;
      gen.if(noPropertyInData(gen, data, prop, it.opts.ownProperties), () => {
        cxt.setParams({ missingProperty: (0, codegen_1._)`${prop}` }, true);
        cxt.error();
      });
    }
    exports2.checkReportMissingProp = checkReportMissingProp;
    function checkMissingProp({ gen, data, it: { opts } }, properties, missing) {
      return (0, codegen_1.or)(...properties.map((prop) => (0, codegen_1.and)(noPropertyInData(gen, data, prop, opts.ownProperties), (0, codegen_1._)`${missing} = ${prop}`)));
    }
    exports2.checkMissingProp = checkMissingProp;
    function reportMissingProp(cxt, missing) {
      cxt.setParams({ missingProperty: missing }, true);
      cxt.error();
    }
    exports2.reportMissingProp = reportMissingProp;
    function hasPropFunc(gen) {
      return gen.scopeValue("func", {
        // eslint-disable-next-line @typescript-eslint/unbound-method
        ref: Object.prototype.hasOwnProperty,
        code: (0, codegen_1._)`Object.prototype.hasOwnProperty`
      });
    }
    exports2.hasPropFunc = hasPropFunc;
    function isOwnProperty(gen, data, property) {
      return (0, codegen_1._)`${hasPropFunc(gen)}.call(${data}, ${property})`;
    }
    exports2.isOwnProperty = isOwnProperty;
    function propertyInData(gen, data, property, ownProperties) {
      const cond = (0, codegen_1._)`${data}${(0, codegen_1.getProperty)(property)} !== undefined`;
      return ownProperties ? (0, codegen_1._)`${cond} && ${isOwnProperty(gen, data, property)}` : cond;
    }
    exports2.propertyInData = propertyInData;
    function noPropertyInData(gen, data, property, ownProperties) {
      const cond = (0, codegen_1._)`${data}${(0, codegen_1.getProperty)(property)} === undefined`;
      return ownProperties ? (0, codegen_1.or)(cond, (0, codegen_1.not)(isOwnProperty(gen, data, property))) : cond;
    }
    exports2.noPropertyInData = noPropertyInData;
    function allSchemaProperties(schemaMap) {
      return schemaMap ? Object.keys(schemaMap).filter((p) => p !== "__proto__") : [];
    }
    exports2.allSchemaProperties = allSchemaProperties;
    function schemaProperties(it, schemaMap) {
      return allSchemaProperties(schemaMap).filter((p) => !(0, util_1.alwaysValidSchema)(it, schemaMap[p]));
    }
    exports2.schemaProperties = schemaProperties;
    function callValidateCode({ schemaCode, data, it: { gen, topSchemaRef, schemaPath, errorPath }, it }, func, context, passSchema) {
      const dataAndSchema = passSchema ? (0, codegen_1._)`${schemaCode}, ${data}, ${topSchemaRef}${schemaPath}` : data;
      const valCxt = [
        [names_1.default.instancePath, (0, codegen_1.strConcat)(names_1.default.instancePath, errorPath)],
        [names_1.default.parentData, it.parentData],
        [names_1.default.parentDataProperty, it.parentDataProperty],
        [names_1.default.rootData, names_1.default.rootData]
      ];
      if (it.opts.dynamicRef)
        valCxt.push([names_1.default.dynamicAnchors, names_1.default.dynamicAnchors]);
      const args = (0, codegen_1._)`${dataAndSchema}, ${gen.object(...valCxt)}`;
      return context !== codegen_1.nil ? (0, codegen_1._)`${func}.call(${context}, ${args})` : (0, codegen_1._)`${func}(${args})`;
    }
    exports2.callValidateCode = callValidateCode;
    var newRegExp = (0, codegen_1._)`new RegExp`;
    function usePattern({ gen, it: { opts } }, pattern) {
      const u = opts.unicodeRegExp ? "u" : "";
      const { regExp } = opts.code;
      const rx = regExp(pattern, u);
      return gen.scopeValue("pattern", {
        key: rx.toString(),
        ref: rx,
        code: (0, codegen_1._)`${regExp.code === "new RegExp" ? newRegExp : (0, util_2.useFunc)(gen, regExp)}(${pattern}, ${u})`
      });
    }
    exports2.usePattern = usePattern;
    function validateArray(cxt) {
      const { gen, data, keyword, it } = cxt;
      const valid = gen.name("valid");
      if (it.allErrors) {
        const validArr = gen.let("valid", true);
        validateItems(() => gen.assign(validArr, false));
        return validArr;
      }
      gen.var(valid, true);
      validateItems(() => gen.break());
      return valid;
      function validateItems(notValid) {
        const len = gen.const("len", (0, codegen_1._)`${data}.length`);
        gen.forRange("i", 0, len, (i) => {
          cxt.subschema({
            keyword,
            dataProp: i,
            dataPropType: util_1.Type.Num
          }, valid);
          gen.if((0, codegen_1.not)(valid), notValid);
        });
      }
    }
    exports2.validateArray = validateArray;
    function validateUnion(cxt) {
      const { gen, schema, keyword, it } = cxt;
      if (!Array.isArray(schema))
        throw new Error("ajv implementation error");
      const alwaysValid = schema.some((sch) => (0, util_1.alwaysValidSchema)(it, sch));
      if (alwaysValid && !it.opts.unevaluated)
        return;
      const valid = gen.let("valid", false);
      const schValid = gen.name("_valid");
      gen.block(() => schema.forEach((_sch, i) => {
        const schCxt = cxt.subschema({
          keyword,
          schemaProp: i,
          compositeRule: true
        }, schValid);
        gen.assign(valid, (0, codegen_1._)`${valid} || ${schValid}`);
        const merged = cxt.mergeValidEvaluated(schCxt, schValid);
        if (!merged)
          gen.if((0, codegen_1.not)(valid));
      }));
      cxt.result(valid, () => cxt.reset(), () => cxt.error(true));
    }
    exports2.validateUnion = validateUnion;
  }
});

// node_modules/ajv-formats/node_modules/ajv/dist/compile/validate/keyword.js
var require_keyword2 = __commonJS({
  "node_modules/ajv-formats/node_modules/ajv/dist/compile/validate/keyword.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.validateKeywordUsage = exports2.validSchemaType = exports2.funcKeywordCode = exports2.macroKeywordCode = void 0;
    var codegen_1 = require_codegen2();
    var names_1 = require_names2();
    var code_1 = require_code4();
    var errors_1 = require_errors3();
    function macroKeywordCode(cxt, def) {
      const { gen, keyword, schema, parentSchema, it } = cxt;
      const macroSchema = def.macro.call(it.self, schema, parentSchema, it);
      const schemaRef = useKeyword(gen, keyword, macroSchema);
      if (it.opts.validateSchema !== false)
        it.self.validateSchema(macroSchema, true);
      const valid = gen.name("valid");
      cxt.subschema({
        schema: macroSchema,
        schemaPath: codegen_1.nil,
        errSchemaPath: `${it.errSchemaPath}/${keyword}`,
        topSchemaRef: schemaRef,
        compositeRule: true
      }, valid);
      cxt.pass(valid, () => cxt.error(true));
    }
    exports2.macroKeywordCode = macroKeywordCode;
    function funcKeywordCode(cxt, def) {
      var _a2;
      const { gen, keyword, schema, parentSchema, $data, it } = cxt;
      checkAsyncKeyword(it, def);
      const validate2 = !$data && def.compile ? def.compile.call(it.self, schema, parentSchema, it) : def.validate;
      const validateRef = useKeyword(gen, keyword, validate2);
      const valid = gen.let("valid");
      cxt.block$data(valid, validateKeyword);
      cxt.ok((_a2 = def.valid) !== null && _a2 !== void 0 ? _a2 : valid);
      function validateKeyword() {
        if (def.errors === false) {
          assignValid();
          if (def.modifying)
            modifyData(cxt);
          reportErrs(() => cxt.error());
        } else {
          const ruleErrs = def.async ? validateAsync() : validateSync();
          if (def.modifying)
            modifyData(cxt);
          reportErrs(() => addErrs(cxt, ruleErrs));
        }
      }
      function validateAsync() {
        const ruleErrs = gen.let("ruleErrs", null);
        gen.try(() => assignValid((0, codegen_1._)`await `), (e) => gen.assign(valid, false).if((0, codegen_1._)`${e} instanceof ${it.ValidationError}`, () => gen.assign(ruleErrs, (0, codegen_1._)`${e}.errors`), () => gen.throw(e)));
        return ruleErrs;
      }
      function validateSync() {
        const validateErrs = (0, codegen_1._)`${validateRef}.errors`;
        gen.assign(validateErrs, null);
        assignValid(codegen_1.nil);
        return validateErrs;
      }
      function assignValid(_await = def.async ? (0, codegen_1._)`await ` : codegen_1.nil) {
        const passCxt = it.opts.passContext ? names_1.default.this : names_1.default.self;
        const passSchema = !("compile" in def && !$data || def.schema === false);
        gen.assign(valid, (0, codegen_1._)`${_await}${(0, code_1.callValidateCode)(cxt, validateRef, passCxt, passSchema)}`, def.modifying);
      }
      function reportErrs(errors) {
        var _a3;
        gen.if((0, codegen_1.not)((_a3 = def.valid) !== null && _a3 !== void 0 ? _a3 : valid), errors);
      }
    }
    exports2.funcKeywordCode = funcKeywordCode;
    function modifyData(cxt) {
      const { gen, data, it } = cxt;
      gen.if(it.parentData, () => gen.assign(data, (0, codegen_1._)`${it.parentData}[${it.parentDataProperty}]`));
    }
    function addErrs(cxt, errs) {
      const { gen } = cxt;
      gen.if((0, codegen_1._)`Array.isArray(${errs})`, () => {
        gen.assign(names_1.default.vErrors, (0, codegen_1._)`${names_1.default.vErrors} === null ? ${errs} : ${names_1.default.vErrors}.concat(${errs})`).assign(names_1.default.errors, (0, codegen_1._)`${names_1.default.vErrors}.length`);
        (0, errors_1.extendErrors)(cxt);
      }, () => cxt.error());
    }
    function checkAsyncKeyword({ schemaEnv }, def) {
      if (def.async && !schemaEnv.$async)
        throw new Error("async keyword in sync schema");
    }
    function useKeyword(gen, keyword, result) {
      if (result === void 0)
        throw new Error(`keyword "${keyword}" failed to compile`);
      return gen.scopeValue("keyword", typeof result == "function" ? { ref: result } : { ref: result, code: (0, codegen_1.stringify)(result) });
    }
    function validSchemaType(schema, schemaType, allowUndefined = false) {
      return !schemaType.length || schemaType.some((st) => st === "array" ? Array.isArray(schema) : st === "object" ? schema && typeof schema == "object" && !Array.isArray(schema) : typeof schema == st || allowUndefined && typeof schema == "undefined");
    }
    exports2.validSchemaType = validSchemaType;
    function validateKeywordUsage({ schema, opts, self, errSchemaPath }, def, keyword) {
      if (Array.isArray(def.keyword) ? !def.keyword.includes(keyword) : def.keyword !== keyword) {
        throw new Error("ajv implementation error");
      }
      const deps = def.dependencies;
      if (deps === null || deps === void 0 ? void 0 : deps.some((kwd) => !Object.prototype.hasOwnProperty.call(schema, kwd))) {
        throw new Error(`parent schema must have dependencies of ${keyword}: ${deps.join(",")}`);
      }
      if (def.validateSchema) {
        const valid = def.validateSchema(schema[keyword]);
        if (!valid) {
          const msg = `keyword "${keyword}" value is invalid at path "${errSchemaPath}": ` + self.errorsText(def.validateSchema.errors);
          if (opts.validateSchema === "log")
            self.logger.error(msg);
          else
            throw new Error(msg);
        }
      }
    }
    exports2.validateKeywordUsage = validateKeywordUsage;
  }
});

// node_modules/ajv-formats/node_modules/ajv/dist/compile/validate/subschema.js
var require_subschema2 = __commonJS({
  "node_modules/ajv-formats/node_modules/ajv/dist/compile/validate/subschema.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.extendSubschemaMode = exports2.extendSubschemaData = exports2.getSubschema = void 0;
    var codegen_1 = require_codegen2();
    var util_1 = require_util5();
    function getSubschema(it, { keyword, schemaProp, schema, schemaPath, errSchemaPath, topSchemaRef }) {
      if (keyword !== void 0 && schema !== void 0) {
        throw new Error('both "keyword" and "schema" passed, only one allowed');
      }
      if (keyword !== void 0) {
        const sch = it.schema[keyword];
        return schemaProp === void 0 ? {
          schema: sch,
          schemaPath: (0, codegen_1._)`${it.schemaPath}${(0, codegen_1.getProperty)(keyword)}`,
          errSchemaPath: `${it.errSchemaPath}/${keyword}`
        } : {
          schema: sch[schemaProp],
          schemaPath: (0, codegen_1._)`${it.schemaPath}${(0, codegen_1.getProperty)(keyword)}${(0, codegen_1.getProperty)(schemaProp)}`,
          errSchemaPath: `${it.errSchemaPath}/${keyword}/${(0, util_1.escapeFragment)(schemaProp)}`
        };
      }
      if (schema !== void 0) {
        if (schemaPath === void 0 || errSchemaPath === void 0 || topSchemaRef === void 0) {
          throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');
        }
        return {
          schema,
          schemaPath,
          topSchemaRef,
          errSchemaPath
        };
      }
      throw new Error('either "keyword" or "schema" must be passed');
    }
    exports2.getSubschema = getSubschema;
    function extendSubschemaData(subschema, it, { dataProp, dataPropType: dpType, data, dataTypes, propertyName }) {
      if (data !== void 0 && dataProp !== void 0) {
        throw new Error('both "data" and "dataProp" passed, only one allowed');
      }
      const { gen } = it;
      if (dataProp !== void 0) {
        const { errorPath, dataPathArr, opts } = it;
        const nextData = gen.let("data", (0, codegen_1._)`${it.data}${(0, codegen_1.getProperty)(dataProp)}`, true);
        dataContextProps(nextData);
        subschema.errorPath = (0, codegen_1.str)`${errorPath}${(0, util_1.getErrorPath)(dataProp, dpType, opts.jsPropertySyntax)}`;
        subschema.parentDataProperty = (0, codegen_1._)`${dataProp}`;
        subschema.dataPathArr = [...dataPathArr, subschema.parentDataProperty];
      }
      if (data !== void 0) {
        const nextData = data instanceof codegen_1.Name ? data : gen.let("data", data, true);
        dataContextProps(nextData);
        if (propertyName !== void 0)
          subschema.propertyName = propertyName;
      }
      if (dataTypes)
        subschema.dataTypes = dataTypes;
      function dataContextProps(_nextData) {
        subschema.data = _nextData;
        subschema.dataLevel = it.dataLevel + 1;
        subschema.dataTypes = [];
        it.definedProperties = /* @__PURE__ */ new Set();
        subschema.parentData = it.data;
        subschema.dataNames = [...it.dataNames, _nextData];
      }
    }
    exports2.extendSubschemaData = extendSubschemaData;
    function extendSubschemaMode(subschema, { jtdDiscriminator, jtdMetadata, compositeRule, createErrors, allErrors }) {
      if (compositeRule !== void 0)
        subschema.compositeRule = compositeRule;
      if (createErrors !== void 0)
        subschema.createErrors = createErrors;
      if (allErrors !== void 0)
        subschema.allErrors = allErrors;
      subschema.jtdDiscriminator = jtdDiscriminator;
      subschema.jtdMetadata = jtdMetadata;
    }
    exports2.extendSubschemaMode = extendSubschemaMode;
  }
});

// node_modules/ajv-formats/node_modules/json-schema-traverse/index.js
var require_json_schema_traverse2 = __commonJS({
  "node_modules/ajv-formats/node_modules/json-schema-traverse/index.js"(exports2, module2) {
    "use strict";
    var traverse = module2.exports = function(schema, opts, cb) {
      if (typeof opts == "function") {
        cb = opts;
        opts = {};
      }
      cb = opts.cb || cb;
      var pre = typeof cb == "function" ? cb : cb.pre || function() {
      };
      var post = cb.post || function() {
      };
      _traverse(opts, pre, post, schema, "", schema);
    };
    traverse.keywords = {
      additionalItems: true,
      items: true,
      contains: true,
      additionalProperties: true,
      propertyNames: true,
      not: true,
      if: true,
      then: true,
      else: true
    };
    traverse.arrayKeywords = {
      items: true,
      allOf: true,
      anyOf: true,
      oneOf: true
    };
    traverse.propsKeywords = {
      $defs: true,
      definitions: true,
      properties: true,
      patternProperties: true,
      dependencies: true
    };
    traverse.skipKeywords = {
      default: true,
      enum: true,
      const: true,
      required: true,
      maximum: true,
      minimum: true,
      exclusiveMaximum: true,
      exclusiveMinimum: true,
      multipleOf: true,
      maxLength: true,
      minLength: true,
      pattern: true,
      format: true,
      maxItems: true,
      minItems: true,
      uniqueItems: true,
      maxProperties: true,
      minProperties: true
    };
    function _traverse(opts, pre, post, schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex) {
      if (schema && typeof schema == "object" && !Array.isArray(schema)) {
        pre(schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex);
        for (var key in schema) {
          var sch = schema[key];
          if (Array.isArray(sch)) {
            if (key in traverse.arrayKeywords) {
              for (var i = 0; i < sch.length; i++)
                _traverse(opts, pre, post, sch[i], jsonPtr + "/" + key + "/" + i, rootSchema, jsonPtr, key, schema, i);
            }
          } else if (key in traverse.propsKeywords) {
            if (sch && typeof sch == "object") {
              for (var prop in sch)
                _traverse(opts, pre, post, sch[prop], jsonPtr + "/" + key + "/" + escapeJsonPtr(prop), rootSchema, jsonPtr, key, schema, prop);
            }
          } else if (key in traverse.keywords || opts.allKeys && !(key in traverse.skipKeywords)) {
            _traverse(opts, pre, post, sch, jsonPtr + "/" + key, rootSchema, jsonPtr, key, schema);
          }
        }
        post(schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex);
      }
    }
    function escapeJsonPtr(str) {
      return str.replace(/~/g, "~0").replace(/\//g, "~1");
    }
  }
});

// node_modules/ajv-formats/node_modules/ajv/dist/compile/resolve.js
var require_resolve2 = __commonJS({
  "node_modules/ajv-formats/node_modules/ajv/dist/compile/resolve.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.getSchemaRefs = exports2.resolveUrl = exports2.normalizeId = exports2._getFullPath = exports2.getFullPath = exports2.inlineRef = void 0;
    var util_1 = require_util5();
    var equal = require_fast_deep_equal();
    var traverse = require_json_schema_traverse2();
    var SIMPLE_INLINED = /* @__PURE__ */ new Set([
      "type",
      "format",
      "pattern",
      "maxLength",
      "minLength",
      "maxProperties",
      "minProperties",
      "maxItems",
      "minItems",
      "maximum",
      "minimum",
      "uniqueItems",
      "multipleOf",
      "required",
      "enum",
      "const"
    ]);
    function inlineRef(schema, limit = true) {
      if (typeof schema == "boolean")
        return true;
      if (limit === true)
        return !hasRef(schema);
      if (!limit)
        return false;
      return countKeys(schema) <= limit;
    }
    exports2.inlineRef = inlineRef;
    var REF_KEYWORDS = /* @__PURE__ */ new Set([
      "$ref",
      "$recursiveRef",
      "$recursiveAnchor",
      "$dynamicRef",
      "$dynamicAnchor"
    ]);
    function hasRef(schema) {
      for (const key in schema) {
        if (REF_KEYWORDS.has(key))
          return true;
        const sch = schema[key];
        if (Array.isArray(sch) && sch.some(hasRef))
          return true;
        if (typeof sch == "object" && hasRef(sch))
          return true;
      }
      return false;
    }
    function countKeys(schema) {
      let count = 0;
      for (const key in schema) {
        if (key === "$ref")
          return Infinity;
        count++;
        if (SIMPLE_INLINED.has(key))
          continue;
        if (typeof schema[key] == "object") {
          (0, util_1.eachItem)(schema[key], (sch) => count += countKeys(sch));
        }
        if (count === Infinity)
          return Infinity;
      }
      return count;
    }
    function getFullPath(resolver, id = "", normalize) {
      if (normalize !== false)
        id = normalizeId(id);
      const p = resolver.parse(id);
      return _getFullPath(resolver, p);
    }
    exports2.getFullPath = getFullPath;
    function _getFullPath(resolver, p) {
      const serialized = resolver.serialize(p);
      return serialized.split("#")[0] + "#";
    }
    exports2._getFullPath = _getFullPath;
    var TRAILING_SLASH_HASH = /#\/?$/;
    function normalizeId(id) {
      return id ? id.replace(TRAILING_SLASH_HASH, "") : "";
    }
    exports2.normalizeId = normalizeId;
    function resolveUrl(resolver, baseId, id) {
      id = normalizeId(id);
      return resolver.resolve(baseId, id);
    }
    exports2.resolveUrl = resolveUrl;
    var ANCHOR = /^[a-z_][-a-z0-9._]*$/i;
    function getSchemaRefs(schema, baseId) {
      if (typeof schema == "boolean")
        return {};
      const { schemaId, uriResolver } = this.opts;
      const schId = normalizeId(schema[schemaId] || baseId);
      const baseIds = { "": schId };
      const pathPrefix = getFullPath(uriResolver, schId, false);
      const localRefs = {};
      const schemaRefs = /* @__PURE__ */ new Set();
      traverse(schema, { allKeys: true }, (sch, jsonPtr, _, parentJsonPtr) => {
        if (parentJsonPtr === void 0)
          return;
        const fullPath = pathPrefix + jsonPtr;
        let innerBaseId = baseIds[parentJsonPtr];
        if (typeof sch[schemaId] == "string")
          innerBaseId = addRef.call(this, sch[schemaId]);
        addAnchor.call(this, sch.$anchor);
        addAnchor.call(this, sch.$dynamicAnchor);
        baseIds[jsonPtr] = innerBaseId;
        function addRef(ref) {
          const _resolve = this.opts.uriResolver.resolve;
          ref = normalizeId(innerBaseId ? _resolve(innerBaseId, ref) : ref);
          if (schemaRefs.has(ref))
            throw ambiguos(ref);
          schemaRefs.add(ref);
          let schOrRef = this.refs[ref];
          if (typeof schOrRef == "string")
            schOrRef = this.refs[schOrRef];
          if (typeof schOrRef == "object") {
            checkAmbiguosRef(sch, schOrRef.schema, ref);
          } else if (ref !== normalizeId(fullPath)) {
            if (ref[0] === "#") {
              checkAmbiguosRef(sch, localRefs[ref], ref);
              localRefs[ref] = sch;
            } else {
              this.refs[ref] = fullPath;
            }
          }
          return ref;
        }
        function addAnchor(anchor) {
          if (typeof anchor == "string") {
            if (!ANCHOR.test(anchor))
              throw new Error(`invalid anchor "${anchor}"`);
            addRef.call(this, `#${anchor}`);
          }
        }
      });
      return localRefs;
      function checkAmbiguosRef(sch1, sch2, ref) {
        if (sch2 !== void 0 && !equal(sch1, sch2))
          throw ambiguos(ref);
      }
      function ambiguos(ref) {
        return new Error(`reference "${ref}" resolves to more than one schema`);
      }
    }
    exports2.getSchemaRefs = getSchemaRefs;
  }
});

// node_modules/ajv-formats/node_modules/ajv/dist/compile/validate/index.js
var require_validate2 = __commonJS({
  "node_modules/ajv-formats/node_modules/ajv/dist/compile/validate/index.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.getData = exports2.KeywordCxt = exports2.validateFunctionCode = void 0;
    var boolSchema_1 = require_boolSchema2();
    var dataType_1 = require_dataType2();
    var applicability_1 = require_applicability2();
    var dataType_2 = require_dataType2();
    var defaults_1 = require_defaults2();
    var keyword_1 = require_keyword2();
    var subschema_1 = require_subschema2();
    var codegen_1 = require_codegen2();
    var names_1 = require_names2();
    var resolve_1 = require_resolve2();
    var util_1 = require_util5();
    var errors_1 = require_errors3();
    function validateFunctionCode(it) {
      if (isSchemaObj(it)) {
        checkKeywords(it);
        if (schemaCxtHasRules(it)) {
          topSchemaObjCode(it);
          return;
        }
      }
      validateFunction(it, () => (0, boolSchema_1.topBoolOrEmptySchema)(it));
    }
    exports2.validateFunctionCode = validateFunctionCode;
    function validateFunction({ gen, validateName, schema, schemaEnv, opts }, body) {
      if (opts.code.es5) {
        gen.func(validateName, (0, codegen_1._)`${names_1.default.data}, ${names_1.default.valCxt}`, schemaEnv.$async, () => {
          gen.code((0, codegen_1._)`"use strict"; ${funcSourceUrl(schema, opts)}`);
          destructureValCxtES5(gen, opts);
          gen.code(body);
        });
      } else {
        gen.func(validateName, (0, codegen_1._)`${names_1.default.data}, ${destructureValCxt(opts)}`, schemaEnv.$async, () => gen.code(funcSourceUrl(schema, opts)).code(body));
      }
    }
    function destructureValCxt(opts) {
      return (0, codegen_1._)`{${names_1.default.instancePath}="", ${names_1.default.parentData}, ${names_1.default.parentDataProperty}, ${names_1.default.rootData}=${names_1.default.data}${opts.dynamicRef ? (0, codegen_1._)`, ${names_1.default.dynamicAnchors}={}` : codegen_1.nil}}={}`;
    }
    function destructureValCxtES5(gen, opts) {
      gen.if(names_1.default.valCxt, () => {
        gen.var(names_1.default.instancePath, (0, codegen_1._)`${names_1.default.valCxt}.${names_1.default.instancePath}`);
        gen.var(names_1.default.parentData, (0, codegen_1._)`${names_1.default.valCxt}.${names_1.default.parentData}`);
        gen.var(names_1.default.parentDataProperty, (0, codegen_1._)`${names_1.default.valCxt}.${names_1.default.parentDataProperty}`);
        gen.var(names_1.default.rootData, (0, codegen_1._)`${names_1.default.valCxt}.${names_1.default.rootData}`);
        if (opts.dynamicRef)
          gen.var(names_1.default.dynamicAnchors, (0, codegen_1._)`${names_1.default.valCxt}.${names_1.default.dynamicAnchors}`);
      }, () => {
        gen.var(names_1.default.instancePath, (0, codegen_1._)`""`);
        gen.var(names_1.default.parentData, (0, codegen_1._)`undefined`);
        gen.var(names_1.default.parentDataProperty, (0, codegen_1._)`undefined`);
        gen.var(names_1.default.rootData, names_1.default.data);
        if (opts.dynamicRef)
          gen.var(names_1.default.dynamicAnchors, (0, codegen_1._)`{}`);
      });
    }
    function topSchemaObjCode(it) {
      const { schema, opts, gen } = it;
      validateFunction(it, () => {
        if (opts.$comment && schema.$comment)
          commentKeyword(it);
        checkNoDefault(it);
        gen.let(names_1.default.vErrors, null);
        gen.let(names_1.default.errors, 0);
        if (opts.unevaluated)
          resetEvaluated(it);
        typeAndKeywords(it);
        returnResults(it);
      });
      return;
    }
    function resetEvaluated(it) {
      const { gen, validateName } = it;
      it.evaluated = gen.const("evaluated", (0, codegen_1._)`${validateName}.evaluated`);
      gen.if((0, codegen_1._)`${it.evaluated}.dynamicProps`, () => gen.assign((0, codegen_1._)`${it.evaluated}.props`, (0, codegen_1._)`undefined`));
      gen.if((0, codegen_1._)`${it.evaluated}.dynamicItems`, () => gen.assign((0, codegen_1._)`${it.evaluated}.items`, (0, codegen_1._)`undefined`));
    }
    function funcSourceUrl(schema, opts) {
      const schId = typeof schema == "object" && schema[opts.schemaId];
      return schId && (opts.code.source || opts.code.process) ? (0, codegen_1._)`/*# sourceURL=${schId} */` : codegen_1.nil;
    }
    function subschemaCode(it, valid) {
      if (isSchemaObj(it)) {
        checkKeywords(it);
        if (schemaCxtHasRules(it)) {
          subSchemaObjCode(it, valid);
          return;
        }
      }
      (0, boolSchema_1.boolOrEmptySchema)(it, valid);
    }
    function schemaCxtHasRules({ schema, self }) {
      if (typeof schema == "boolean")
        return !schema;
      for (const key in schema)
        if (self.RULES.all[key])
          return true;
      return false;
    }
    function isSchemaObj(it) {
      return typeof it.schema != "boolean";
    }
    function subSchemaObjCode(it, valid) {
      const { schema, gen, opts } = it;
      if (opts.$comment && schema.$comment)
        commentKeyword(it);
      updateContext(it);
      checkAsyncSchema(it);
      const errsCount = gen.const("_errs", names_1.default.errors);
      typeAndKeywords(it, errsCount);
      gen.var(valid, (0, codegen_1._)`${errsCount} === ${names_1.default.errors}`);
    }
    function checkKeywords(it) {
      (0, util_1.checkUnknownRules)(it);
      checkRefsAndKeywords(it);
    }
    function typeAndKeywords(it, errsCount) {
      if (it.opts.jtd)
        return schemaKeywords(it, [], false, errsCount);
      const types = (0, dataType_1.getSchemaTypes)(it.schema);
      const checkedTypes = (0, dataType_1.coerceAndCheckDataType)(it, types);
      schemaKeywords(it, types, !checkedTypes, errsCount);
    }
    function checkRefsAndKeywords(it) {
      const { schema, errSchemaPath, opts, self } = it;
      if (schema.$ref && opts.ignoreKeywordsWithRef && (0, util_1.schemaHasRulesButRef)(schema, self.RULES)) {
        self.logger.warn(`$ref: keywords ignored in schema at path "${errSchemaPath}"`);
      }
    }
    function checkNoDefault(it) {
      const { schema, opts } = it;
      if (schema.default !== void 0 && opts.useDefaults && opts.strictSchema) {
        (0, util_1.checkStrictMode)(it, "default is ignored in the schema root");
      }
    }
    function updateContext(it) {
      const schId = it.schema[it.opts.schemaId];
      if (schId)
        it.baseId = (0, resolve_1.resolveUrl)(it.opts.uriResolver, it.baseId, schId);
    }
    function checkAsyncSchema(it) {
      if (it.schema.$async && !it.schemaEnv.$async)
        throw new Error("async schema in sync schema");
    }
    function commentKeyword({ gen, schemaEnv, schema, errSchemaPath, opts }) {
      const msg = schema.$comment;
      if (opts.$comment === true) {
        gen.code((0, codegen_1._)`${names_1.default.self}.logger.log(${msg})`);
      } else if (typeof opts.$comment == "function") {
        const schemaPath = (0, codegen_1.str)`${errSchemaPath}/$comment`;
        const rootName = gen.scopeValue("root", { ref: schemaEnv.root });
        gen.code((0, codegen_1._)`${names_1.default.self}.opts.$comment(${msg}, ${schemaPath}, ${rootName}.schema)`);
      }
    }
    function returnResults(it) {
      const { gen, schemaEnv, validateName, ValidationError, opts } = it;
      if (schemaEnv.$async) {
        gen.if((0, codegen_1._)`${names_1.default.errors} === 0`, () => gen.return(names_1.default.data), () => gen.throw((0, codegen_1._)`new ${ValidationError}(${names_1.default.vErrors})`));
      } else {
        gen.assign((0, codegen_1._)`${validateName}.errors`, names_1.default.vErrors);
        if (opts.unevaluated)
          assignEvaluated(it);
        gen.return((0, codegen_1._)`${names_1.default.errors} === 0`);
      }
    }
    function assignEvaluated({ gen, evaluated, props, items }) {
      if (props instanceof codegen_1.Name)
        gen.assign((0, codegen_1._)`${evaluated}.props`, props);
      if (items instanceof codegen_1.Name)
        gen.assign((0, codegen_1._)`${evaluated}.items`, items);
    }
    function schemaKeywords(it, types, typeErrors, errsCount) {
      const { gen, schema, data, allErrors, opts, self } = it;
      const { RULES } = self;
      if (schema.$ref && (opts.ignoreKeywordsWithRef || !(0, util_1.schemaHasRulesButRef)(schema, RULES))) {
        gen.block(() => keywordCode(it, "$ref", RULES.all.$ref.definition));
        return;
      }
      if (!opts.jtd)
        checkStrictTypes(it, types);
      gen.block(() => {
        for (const group of RULES.rules)
          groupKeywords(group);
        groupKeywords(RULES.post);
      });
      function groupKeywords(group) {
        if (!(0, applicability_1.shouldUseGroup)(schema, group))
          return;
        if (group.type) {
          gen.if((0, dataType_2.checkDataType)(group.type, data, opts.strictNumbers));
          iterateKeywords(it, group);
          if (types.length === 1 && types[0] === group.type && typeErrors) {
            gen.else();
            (0, dataType_2.reportTypeError)(it);
          }
          gen.endIf();
        } else {
          iterateKeywords(it, group);
        }
        if (!allErrors)
          gen.if((0, codegen_1._)`${names_1.default.errors} === ${errsCount || 0}`);
      }
    }
    function iterateKeywords(it, group) {
      const { gen, schema, opts: { useDefaults } } = it;
      if (useDefaults)
        (0, defaults_1.assignDefaults)(it, group.type);
      gen.block(() => {
        for (const rule of group.rules) {
          if ((0, applicability_1.shouldUseRule)(schema, rule)) {
            keywordCode(it, rule.keyword, rule.definition, group.type);
          }
        }
      });
    }
    function checkStrictTypes(it, types) {
      if (it.schemaEnv.meta || !it.opts.strictTypes)
        return;
      checkContextTypes(it, types);
      if (!it.opts.allowUnionTypes)
        checkMultipleTypes(it, types);
      checkKeywordTypes(it, it.dataTypes);
    }
    function checkContextTypes(it, types) {
      if (!types.length)
        return;
      if (!it.dataTypes.length) {
        it.dataTypes = types;
        return;
      }
      types.forEach((t) => {
        if (!includesType(it.dataTypes, t)) {
          strictTypesError(it, `type "${t}" not allowed by context "${it.dataTypes.join(",")}"`);
        }
      });
      narrowSchemaTypes(it, types);
    }
    function checkMultipleTypes(it, ts) {
      if (ts.length > 1 && !(ts.length === 2 && ts.includes("null"))) {
        strictTypesError(it, "use allowUnionTypes to allow union type keyword");
      }
    }
    function checkKeywordTypes(it, ts) {
      const rules = it.self.RULES.all;
      for (const keyword in rules) {
        const rule = rules[keyword];
        if (typeof rule == "object" && (0, applicability_1.shouldUseRule)(it.schema, rule)) {
          const { type } = rule.definition;
          if (type.length && !type.some((t) => hasApplicableType(ts, t))) {
            strictTypesError(it, `missing type "${type.join(",")}" for keyword "${keyword}"`);
          }
        }
      }
    }
    function hasApplicableType(schTs, kwdT) {
      return schTs.includes(kwdT) || kwdT === "number" && schTs.includes("integer");
    }
    function includesType(ts, t) {
      return ts.includes(t) || t === "integer" && ts.includes("number");
    }
    function narrowSchemaTypes(it, withTypes) {
      const ts = [];
      for (const t of it.dataTypes) {
        if (includesType(withTypes, t))
          ts.push(t);
        else if (withTypes.includes("integer") && t === "number")
          ts.push("integer");
      }
      it.dataTypes = ts;
    }
    function strictTypesError(it, msg) {
      const schemaPath = it.schemaEnv.baseId + it.errSchemaPath;
      msg += ` at "${schemaPath}" (strictTypes)`;
      (0, util_1.checkStrictMode)(it, msg, it.opts.strictTypes);
    }
    var KeywordCxt = class {
      constructor(it, def, keyword) {
        (0, keyword_1.validateKeywordUsage)(it, def, keyword);
        this.gen = it.gen;
        this.allErrors = it.allErrors;
        this.keyword = keyword;
        this.data = it.data;
        this.schema = it.schema[keyword];
        this.$data = def.$data && it.opts.$data && this.schema && this.schema.$data;
        this.schemaValue = (0, util_1.schemaRefOrVal)(it, this.schema, keyword, this.$data);
        this.schemaType = def.schemaType;
        this.parentSchema = it.schema;
        this.params = {};
        this.it = it;
        this.def = def;
        if (this.$data) {
          this.schemaCode = it.gen.const("vSchema", getData(this.$data, it));
        } else {
          this.schemaCode = this.schemaValue;
          if (!(0, keyword_1.validSchemaType)(this.schema, def.schemaType, def.allowUndefined)) {
            throw new Error(`${keyword} value must be ${JSON.stringify(def.schemaType)}`);
          }
        }
        if ("code" in def ? def.trackErrors : def.errors !== false) {
          this.errsCount = it.gen.const("_errs", names_1.default.errors);
        }
      }
      result(condition, successAction, failAction) {
        this.failResult((0, codegen_1.not)(condition), successAction, failAction);
      }
      failResult(condition, successAction, failAction) {
        this.gen.if(condition);
        if (failAction)
          failAction();
        else
          this.error();
        if (successAction) {
          this.gen.else();
          successAction();
          if (this.allErrors)
            this.gen.endIf();
        } else {
          if (this.allErrors)
            this.gen.endIf();
          else
            this.gen.else();
        }
      }
      pass(condition, failAction) {
        this.failResult((0, codegen_1.not)(condition), void 0, failAction);
      }
      fail(condition) {
        if (condition === void 0) {
          this.error();
          if (!this.allErrors)
            this.gen.if(false);
          return;
        }
        this.gen.if(condition);
        this.error();
        if (this.allErrors)
          this.gen.endIf();
        else
          this.gen.else();
      }
      fail$data(condition) {
        if (!this.$data)
          return this.fail(condition);
        const { schemaCode } = this;
        this.fail((0, codegen_1._)`${schemaCode} !== undefined && (${(0, codegen_1.or)(this.invalid$data(), condition)})`);
      }
      error(append, errorParams, errorPaths) {
        if (errorParams) {
          this.setParams(errorParams);
          this._error(append, errorPaths);
          this.setParams({});
          return;
        }
        this._error(append, errorPaths);
      }
      _error(append, errorPaths) {
        ;
        (append ? errors_1.reportExtraError : errors_1.reportError)(this, this.def.error, errorPaths);
      }
      $dataError() {
        (0, errors_1.reportError)(this, this.def.$dataError || errors_1.keyword$DataError);
      }
      reset() {
        if (this.errsCount === void 0)
          throw new Error('add "trackErrors" to keyword definition');
        (0, errors_1.resetErrorsCount)(this.gen, this.errsCount);
      }
      ok(cond) {
        if (!this.allErrors)
          this.gen.if(cond);
      }
      setParams(obj, assign) {
        if (assign)
          Object.assign(this.params, obj);
        else
          this.params = obj;
      }
      block$data(valid, codeBlock, $dataValid = codegen_1.nil) {
        this.gen.block(() => {
          this.check$data(valid, $dataValid);
          codeBlock();
        });
      }
      check$data(valid = codegen_1.nil, $dataValid = codegen_1.nil) {
        if (!this.$data)
          return;
        const { gen, schemaCode, schemaType, def } = this;
        gen.if((0, codegen_1.or)((0, codegen_1._)`${schemaCode} === undefined`, $dataValid));
        if (valid !== codegen_1.nil)
          gen.assign(valid, true);
        if (schemaType.length || def.validateSchema) {
          gen.elseIf(this.invalid$data());
          this.$dataError();
          if (valid !== codegen_1.nil)
            gen.assign(valid, false);
        }
        gen.else();
      }
      invalid$data() {
        const { gen, schemaCode, schemaType, def, it } = this;
        return (0, codegen_1.or)(wrong$DataType(), invalid$DataSchema());
        function wrong$DataType() {
          if (schemaType.length) {
            if (!(schemaCode instanceof codegen_1.Name))
              throw new Error("ajv implementation error");
            const st = Array.isArray(schemaType) ? schemaType : [schemaType];
            return (0, codegen_1._)`${(0, dataType_2.checkDataTypes)(st, schemaCode, it.opts.strictNumbers, dataType_2.DataType.Wrong)}`;
          }
          return codegen_1.nil;
        }
        function invalid$DataSchema() {
          if (def.validateSchema) {
            const validateSchemaRef = gen.scopeValue("validate$data", { ref: def.validateSchema });
            return (0, codegen_1._)`!${validateSchemaRef}(${schemaCode})`;
          }
          return codegen_1.nil;
        }
      }
      subschema(appl, valid) {
        const subschema = (0, subschema_1.getSubschema)(this.it, appl);
        (0, subschema_1.extendSubschemaData)(subschema, this.it, appl);
        (0, subschema_1.extendSubschemaMode)(subschema, appl);
        const nextContext = { ...this.it, ...subschema, items: void 0, props: void 0 };
        subschemaCode(nextContext, valid);
        return nextContext;
      }
      mergeEvaluated(schemaCxt, toName) {
        const { it, gen } = this;
        if (!it.opts.unevaluated)
          return;
        if (it.props !== true && schemaCxt.props !== void 0) {
          it.props = util_1.mergeEvaluated.props(gen, schemaCxt.props, it.props, toName);
        }
        if (it.items !== true && schemaCxt.items !== void 0) {
          it.items = util_1.mergeEvaluated.items(gen, schemaCxt.items, it.items, toName);
        }
      }
      mergeValidEvaluated(schemaCxt, valid) {
        const { it, gen } = this;
        if (it.opts.unevaluated && (it.props !== true || it.items !== true)) {
          gen.if(valid, () => this.mergeEvaluated(schemaCxt, codegen_1.Name));
          return true;
        }
      }
    };
    exports2.KeywordCxt = KeywordCxt;
    function keywordCode(it, keyword, def, ruleType) {
      const cxt = new KeywordCxt(it, def, keyword);
      if ("code" in def) {
        def.code(cxt, ruleType);
      } else if (cxt.$data && def.validate) {
        (0, keyword_1.funcKeywordCode)(cxt, def);
      } else if ("macro" in def) {
        (0, keyword_1.macroKeywordCode)(cxt, def);
      } else if (def.compile || def.validate) {
        (0, keyword_1.funcKeywordCode)(cxt, def);
      }
    }
    var JSON_POINTER = /^\/(?:[^~]|~0|~1)*$/;
    var RELATIVE_JSON_POINTER = /^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;
    function getData($data, { dataLevel, dataNames, dataPathArr }) {
      let jsonPointer;
      let data;
      if ($data === "")
        return names_1.default.rootData;
      if ($data[0] === "/") {
        if (!JSON_POINTER.test($data))
          throw new Error(`Invalid JSON-pointer: ${$data}`);
        jsonPointer = $data;
        data = names_1.default.rootData;
      } else {
        const matches = RELATIVE_JSON_POINTER.exec($data);
        if (!matches)
          throw new Error(`Invalid JSON-pointer: ${$data}`);
        const up = +matches[1];
        jsonPointer = matches[2];
        if (jsonPointer === "#") {
          if (up >= dataLevel)
            throw new Error(errorMsg("property/index", up));
          return dataPathArr[dataLevel - up];
        }
        if (up > dataLevel)
          throw new Error(errorMsg("data", up));
        data = dataNames[dataLevel - up];
        if (!jsonPointer)
          return data;
      }
      let expr = data;
      const segments = jsonPointer.split("/");
      for (const segment2 of segments) {
        if (segment2) {
          data = (0, codegen_1._)`${data}${(0, codegen_1.getProperty)((0, util_1.unescapeJsonPointer)(segment2))}`;
          expr = (0, codegen_1._)`${expr} && ${data}`;
        }
      }
      return expr;
      function errorMsg(pointerType, up) {
        return `Cannot access ${pointerType} ${up} levels up, current level is ${dataLevel}`;
      }
    }
    exports2.getData = getData;
  }
});

// node_modules/ajv-formats/node_modules/ajv/dist/runtime/validation_error.js
var require_validation_error2 = __commonJS({
  "node_modules/ajv-formats/node_modules/ajv/dist/runtime/validation_error.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    var ValidationError = class extends Error {
      constructor(errors) {
        super("validation failed");
        this.errors = errors;
        this.ajv = this.validation = true;
      }
    };
    exports2.default = ValidationError;
  }
});

// node_modules/ajv-formats/node_modules/ajv/dist/compile/ref_error.js
var require_ref_error2 = __commonJS({
  "node_modules/ajv-formats/node_modules/ajv/dist/compile/ref_error.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    var resolve_1 = require_resolve2();
    var MissingRefError = class extends Error {
      constructor(resolver, baseId, ref, msg) {
        super(msg || `can't resolve reference ${ref} from id ${baseId}`);
        this.missingRef = (0, resolve_1.resolveUrl)(resolver, baseId, ref);
        this.missingSchema = (0, resolve_1.normalizeId)((0, resolve_1.getFullPath)(resolver, this.missingRef));
      }
    };
    exports2.default = MissingRefError;
  }
});

// node_modules/ajv-formats/node_modules/ajv/dist/compile/index.js
var require_compile3 = __commonJS({
  "node_modules/ajv-formats/node_modules/ajv/dist/compile/index.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.resolveSchema = exports2.getCompilingSchema = exports2.resolveRef = exports2.compileSchema = exports2.SchemaEnv = void 0;
    var codegen_1 = require_codegen2();
    var validation_error_1 = require_validation_error2();
    var names_1 = require_names2();
    var resolve_1 = require_resolve2();
    var util_1 = require_util5();
    var validate_1 = require_validate2();
    var SchemaEnv = class {
      constructor(env) {
        var _a2;
        this.refs = {};
        this.dynamicAnchors = {};
        let schema;
        if (typeof env.schema == "object")
          schema = env.schema;
        this.schema = env.schema;
        this.schemaId = env.schemaId;
        this.root = env.root || this;
        this.baseId = (_a2 = env.baseId) !== null && _a2 !== void 0 ? _a2 : (0, resolve_1.normalizeId)(schema === null || schema === void 0 ? void 0 : schema[env.schemaId || "$id"]);
        this.schemaPath = env.schemaPath;
        this.localRefs = env.localRefs;
        this.meta = env.meta;
        this.$async = schema === null || schema === void 0 ? void 0 : schema.$async;
        this.refs = {};
      }
    };
    exports2.SchemaEnv = SchemaEnv;
    function compileSchema(sch) {
      const _sch = getCompilingSchema.call(this, sch);
      if (_sch)
        return _sch;
      const rootId = (0, resolve_1.getFullPath)(this.opts.uriResolver, sch.root.baseId);
      const { es5, lines } = this.opts.code;
      const { ownProperties } = this.opts;
      const gen = new codegen_1.CodeGen(this.scope, { es5, lines, ownProperties });
      let _ValidationError;
      if (sch.$async) {
        _ValidationError = gen.scopeValue("Error", {
          ref: validation_error_1.default,
          code: (0, codegen_1._)`require("ajv/dist/runtime/validation_error").default`
        });
      }
      const validateName = gen.scopeName("validate");
      sch.validateName = validateName;
      const schemaCxt = {
        gen,
        allErrors: this.opts.allErrors,
        data: names_1.default.data,
        parentData: names_1.default.parentData,
        parentDataProperty: names_1.default.parentDataProperty,
        dataNames: [names_1.default.data],
        dataPathArr: [codegen_1.nil],
        // TODO can its length be used as dataLevel if nil is removed?
        dataLevel: 0,
        dataTypes: [],
        definedProperties: /* @__PURE__ */ new Set(),
        topSchemaRef: gen.scopeValue("schema", this.opts.code.source === true ? { ref: sch.schema, code: (0, codegen_1.stringify)(sch.schema) } : { ref: sch.schema }),
        validateName,
        ValidationError: _ValidationError,
        schema: sch.schema,
        schemaEnv: sch,
        rootId,
        baseId: sch.baseId || rootId,
        schemaPath: codegen_1.nil,
        errSchemaPath: sch.schemaPath || (this.opts.jtd ? "" : "#"),
        errorPath: (0, codegen_1._)`""`,
        opts: this.opts,
        self: this
      };
      let sourceCode;
      try {
        this._compilations.add(sch);
        (0, validate_1.validateFunctionCode)(schemaCxt);
        gen.optimize(this.opts.code.optimize);
        const validateCode = gen.toString();
        sourceCode = `${gen.scopeRefs(names_1.default.scope)}return ${validateCode}`;
        if (this.opts.code.process)
          sourceCode = this.opts.code.process(sourceCode, sch);
        const makeValidate = new Function(`${names_1.default.self}`, `${names_1.default.scope}`, sourceCode);
        const validate2 = makeValidate(this, this.scope.get());
        this.scope.value(validateName, { ref: validate2 });
        validate2.errors = null;
        validate2.schema = sch.schema;
        validate2.schemaEnv = sch;
        if (sch.$async)
          validate2.$async = true;
        if (this.opts.code.source === true) {
          validate2.source = { validateName, validateCode, scopeValues: gen._values };
        }
        if (this.opts.unevaluated) {
          const { props, items } = schemaCxt;
          validate2.evaluated = {
            props: props instanceof codegen_1.Name ? void 0 : props,
            items: items instanceof codegen_1.Name ? void 0 : items,
            dynamicProps: props instanceof codegen_1.Name,
            dynamicItems: items instanceof codegen_1.Name
          };
          if (validate2.source)
            validate2.source.evaluated = (0, codegen_1.stringify)(validate2.evaluated);
        }
        sch.validate = validate2;
        return sch;
      } catch (e) {
        delete sch.validate;
        delete sch.validateName;
        if (sourceCode)
          this.logger.error("Error compiling schema, function code:", sourceCode);
        throw e;
      } finally {
        this._compilations.delete(sch);
      }
    }
    exports2.compileSchema = compileSchema;
    function resolveRef2(root, baseId, ref) {
      var _a2;
      ref = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, ref);
      const schOrFunc = root.refs[ref];
      if (schOrFunc)
        return schOrFunc;
      let _sch = resolve.call(this, root, ref);
      if (_sch === void 0) {
        const schema = (_a2 = root.localRefs) === null || _a2 === void 0 ? void 0 : _a2[ref];
        const { schemaId } = this.opts;
        if (schema)
          _sch = new SchemaEnv({ schema, schemaId, root, baseId });
      }
      if (_sch === void 0)
        return;
      return root.refs[ref] = inlineOrCompile.call(this, _sch);
    }
    exports2.resolveRef = resolveRef2;
    function inlineOrCompile(sch) {
      if ((0, resolve_1.inlineRef)(sch.schema, this.opts.inlineRefs))
        return sch.schema;
      return sch.validate ? sch : compileSchema.call(this, sch);
    }
    function getCompilingSchema(schEnv) {
      for (const sch of this._compilations) {
        if (sameSchemaEnv(sch, schEnv))
          return sch;
      }
    }
    exports2.getCompilingSchema = getCompilingSchema;
    function sameSchemaEnv(s1, s2) {
      return s1.schema === s2.schema && s1.root === s2.root && s1.baseId === s2.baseId;
    }
    function resolve(root, ref) {
      let sch;
      while (typeof (sch = this.refs[ref]) == "string")
        ref = sch;
      return sch || this.schemas[ref] || resolveSchema.call(this, root, ref);
    }
    function resolveSchema(root, ref) {
      const p = this.opts.uriResolver.parse(ref);
      const refPath = (0, resolve_1._getFullPath)(this.opts.uriResolver, p);
      let baseId = (0, resolve_1.getFullPath)(this.opts.uriResolver, root.baseId, void 0);
      if (Object.keys(root.schema).length > 0 && refPath === baseId) {
        return getJsonPointer.call(this, p, root);
      }
      const id = (0, resolve_1.normalizeId)(refPath);
      const schOrRef = this.refs[id] || this.schemas[id];
      if (typeof schOrRef == "string") {
        const sch = resolveSchema.call(this, root, schOrRef);
        if (typeof (sch === null || sch === void 0 ? void 0 : sch.schema) !== "object")
          return;
        return getJsonPointer.call(this, p, sch);
      }
      if (typeof (schOrRef === null || schOrRef === void 0 ? void 0 : schOrRef.schema) !== "object")
        return;
      if (!schOrRef.validate)
        compileSchema.call(this, schOrRef);
      if (id === (0, resolve_1.normalizeId)(ref)) {
        const { schema } = schOrRef;
        const { schemaId } = this.opts;
        const schId = schema[schemaId];
        if (schId)
          baseId = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, schId);
        return new SchemaEnv({ schema, schemaId, root, baseId });
      }
      return getJsonPointer.call(this, p, schOrRef);
    }
    exports2.resolveSchema = resolveSchema;
    var PREVENT_SCOPE_CHANGE = /* @__PURE__ */ new Set([
      "properties",
      "patternProperties",
      "enum",
      "dependencies",
      "definitions"
    ]);
    function getJsonPointer(parsedRef, { baseId, schema, root }) {
      var _a2;
      if (((_a2 = parsedRef.fragment) === null || _a2 === void 0 ? void 0 : _a2[0]) !== "/")
        return;
      for (const part of parsedRef.fragment.slice(1).split("/")) {
        if (typeof schema === "boolean")
          return;
        const partSchema = schema[(0, util_1.unescapeFragment)(part)];
        if (partSchema === void 0)
          return;
        schema = partSchema;
        const schId = typeof schema === "object" && schema[this.opts.schemaId];
        if (!PREVENT_SCOPE_CHANGE.has(part) && schId) {
          baseId = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, schId);
        }
      }
      let env;
      if (typeof schema != "boolean" && schema.$ref && !(0, util_1.schemaHasRulesButRef)(schema, this.RULES)) {
        const $ref = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, schema.$ref);
        env = resolveSchema.call(this, root, $ref);
      }
      const { schemaId } = this.opts;
      env = env || new SchemaEnv({ schema, schemaId, root, baseId });
      if (env.schema !== env.root.schema)
        return env;
      return void 0;
    }
  }
});

// node_modules/ajv-formats/node_modules/ajv/dist/refs/data.json
var require_data2 = __commonJS({
  "node_modules/ajv-formats/node_modules/ajv/dist/refs/data.json"(exports2, module2) {
    module2.exports = {
      $id: "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",
      description: "Meta-schema for $data reference (JSON AnySchema extension proposal)",
      type: "object",
      required: ["$data"],
      properties: {
        $data: {
          type: "string",
          anyOf: [{ format: "relative-json-pointer" }, { format: "json-pointer" }]
        }
      },
      additionalProperties: false
    };
  }
});

// node_modules/ajv-formats/node_modules/ajv/dist/runtime/uri.js
var require_uri2 = __commonJS({
  "node_modules/ajv-formats/node_modules/ajv/dist/runtime/uri.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    var uri = require_fast_uri();
    uri.code = 'require("ajv/dist/runtime/uri").default';
    exports2.default = uri;
  }
});

// node_modules/ajv-formats/node_modules/ajv/dist/core.js
var require_core3 = __commonJS({
  "node_modules/ajv-formats/node_modules/ajv/dist/core.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.CodeGen = exports2.Name = exports2.nil = exports2.stringify = exports2.str = exports2._ = exports2.KeywordCxt = void 0;
    var validate_1 = require_validate2();
    Object.defineProperty(exports2, "KeywordCxt", { enumerable: true, get: function() {
      return validate_1.KeywordCxt;
    } });
    var codegen_1 = require_codegen2();
    Object.defineProperty(exports2, "_", { enumerable: true, get: function() {
      return codegen_1._;
    } });
    Object.defineProperty(exports2, "str", { enumerable: true, get: function() {
      return codegen_1.str;
    } });
    Object.defineProperty(exports2, "stringify", { enumerable: true, get: function() {
      return codegen_1.stringify;
    } });
    Object.defineProperty(exports2, "nil", { enumerable: true, get: function() {
      return codegen_1.nil;
    } });
    Object.defineProperty(exports2, "Name", { enumerable: true, get: function() {
      return codegen_1.Name;
    } });
    Object.defineProperty(exports2, "CodeGen", { enumerable: true, get: function() {
      return codegen_1.CodeGen;
    } });
    var validation_error_1 = require_validation_error2();
    var ref_error_1 = require_ref_error2();
    var rules_1 = require_rules2();
    var compile_1 = require_compile3();
    var codegen_2 = require_codegen2();
    var resolve_1 = require_resolve2();
    var dataType_1 = require_dataType2();
    var util_1 = require_util5();
    var $dataRefSchema = require_data2();
    var uri_1 = require_uri2();
    var defaultRegExp = (str, flags) => new RegExp(str, flags);
    defaultRegExp.code = "new RegExp";
    var META_IGNORE_OPTIONS = ["removeAdditional", "useDefaults", "coerceTypes"];
    var EXT_SCOPE_NAMES = /* @__PURE__ */ new Set([
      "validate",
      "serialize",
      "parse",
      "wrapper",
      "root",
      "schema",
      "keyword",
      "pattern",
      "formats",
      "validate$data",
      "func",
      "obj",
      "Error"
    ]);
    var removedOptions = {
      errorDataPath: "",
      format: "`validateFormats: false` can be used instead.",
      nullable: '"nullable" keyword is supported by default.',
      jsonPointers: "Deprecated jsPropertySyntax can be used instead.",
      extendRefs: "Deprecated ignoreKeywordsWithRef can be used instead.",
      missingRefs: "Pass empty schema with $id that should be ignored to ajv.addSchema.",
      processCode: "Use option `code: {process: (code, schemaEnv: object) => string}`",
      sourceCode: "Use option `code: {source: true}`",
      strictDefaults: "It is default now, see option `strict`.",
      strictKeywords: "It is default now, see option `strict`.",
      uniqueItems: '"uniqueItems" keyword is always validated.',
      unknownFormats: "Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",
      cache: "Map is used as cache, schema object as key.",
      serialize: "Map is used as cache, schema object as key.",
      ajvErrors: "It is default now."
    };
    var deprecatedOptions = {
      ignoreKeywordsWithRef: "",
      jsPropertySyntax: "",
      unicode: '"minLength"/"maxLength" account for unicode characters by default.'
    };
    var MAX_EXPRESSION = 200;
    function requiredOptions(o) {
      var _a2, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0;
      const s = o.strict;
      const _optz = (_a2 = o.code) === null || _a2 === void 0 ? void 0 : _a2.optimize;
      const optimize = _optz === true || _optz === void 0 ? 1 : _optz || 0;
      const regExp = (_c = (_b = o.code) === null || _b === void 0 ? void 0 : _b.regExp) !== null && _c !== void 0 ? _c : defaultRegExp;
      const uriResolver = (_d = o.uriResolver) !== null && _d !== void 0 ? _d : uri_1.default;
      return {
        strictSchema: (_f = (_e = o.strictSchema) !== null && _e !== void 0 ? _e : s) !== null && _f !== void 0 ? _f : true,
        strictNumbers: (_h = (_g = o.strictNumbers) !== null && _g !== void 0 ? _g : s) !== null && _h !== void 0 ? _h : true,
        strictTypes: (_k = (_j = o.strictTypes) !== null && _j !== void 0 ? _j : s) !== null && _k !== void 0 ? _k : "log",
        strictTuples: (_m = (_l = o.strictTuples) !== null && _l !== void 0 ? _l : s) !== null && _m !== void 0 ? _m : "log",
        strictRequired: (_p = (_o = o.strictRequired) !== null && _o !== void 0 ? _o : s) !== null && _p !== void 0 ? _p : false,
        code: o.code ? { ...o.code, optimize, regExp } : { optimize, regExp },
        loopRequired: (_q = o.loopRequired) !== null && _q !== void 0 ? _q : MAX_EXPRESSION,
        loopEnum: (_r = o.loopEnum) !== null && _r !== void 0 ? _r : MAX_EXPRESSION,
        meta: (_s = o.meta) !== null && _s !== void 0 ? _s : true,
        messages: (_t = o.messages) !== null && _t !== void 0 ? _t : true,
        inlineRefs: (_u = o.inlineRefs) !== null && _u !== void 0 ? _u : true,
        schemaId: (_v = o.schemaId) !== null && _v !== void 0 ? _v : "$id",
        addUsedSchema: (_w = o.addUsedSchema) !== null && _w !== void 0 ? _w : true,
        validateSchema: (_x = o.validateSchema) !== null && _x !== void 0 ? _x : true,
        validateFormats: (_y = o.validateFormats) !== null && _y !== void 0 ? _y : true,
        unicodeRegExp: (_z = o.unicodeRegExp) !== null && _z !== void 0 ? _z : true,
        int32range: (_0 = o.int32range) !== null && _0 !== void 0 ? _0 : true,
        uriResolver
      };
    }
    var Ajv2 = class {
      constructor(opts = {}) {
        this.schemas = {};
        this.refs = {};
        this.formats = {};
        this._compilations = /* @__PURE__ */ new Set();
        this._loading = {};
        this._cache = /* @__PURE__ */ new Map();
        opts = this.opts = { ...opts, ...requiredOptions(opts) };
        const { es5, lines } = this.opts.code;
        this.scope = new codegen_2.ValueScope({ scope: {}, prefixes: EXT_SCOPE_NAMES, es5, lines });
        this.logger = getLogger(opts.logger);
        const formatOpt = opts.validateFormats;
        opts.validateFormats = false;
        this.RULES = (0, rules_1.getRules)();
        checkOptions.call(this, removedOptions, opts, "NOT SUPPORTED");
        checkOptions.call(this, deprecatedOptions, opts, "DEPRECATED", "warn");
        this._metaOpts = getMetaSchemaOptions.call(this);
        if (opts.formats)
          addInitialFormats.call(this);
        this._addVocabularies();
        this._addDefaultMetaSchema();
        if (opts.keywords)
          addInitialKeywords.call(this, opts.keywords);
        if (typeof opts.meta == "object")
          this.addMetaSchema(opts.meta);
        addInitialSchemas.call(this);
        opts.validateFormats = formatOpt;
      }
      _addVocabularies() {
        this.addKeyword("$async");
      }
      _addDefaultMetaSchema() {
        const { $data, meta: meta3, schemaId } = this.opts;
        let _dataRefSchema = $dataRefSchema;
        if (schemaId === "id") {
          _dataRefSchema = { ...$dataRefSchema };
          _dataRefSchema.id = _dataRefSchema.$id;
          delete _dataRefSchema.$id;
        }
        if (meta3 && $data)
          this.addMetaSchema(_dataRefSchema, _dataRefSchema[schemaId], false);
      }
      defaultMeta() {
        const { meta: meta3, schemaId } = this.opts;
        return this.opts.defaultMeta = typeof meta3 == "object" ? meta3[schemaId] || meta3 : void 0;
      }
      validate(schemaKeyRef, data) {
        let v;
        if (typeof schemaKeyRef == "string") {
          v = this.getSchema(schemaKeyRef);
          if (!v)
            throw new Error(`no schema with key or ref "${schemaKeyRef}"`);
        } else {
          v = this.compile(schemaKeyRef);
        }
        const valid = v(data);
        if (!("$async" in v))
          this.errors = v.errors;
        return valid;
      }
      compile(schema, _meta) {
        const sch = this._addSchema(schema, _meta);
        return sch.validate || this._compileSchemaEnv(sch);
      }
      compileAsync(schema, meta3) {
        if (typeof this.opts.loadSchema != "function") {
          throw new Error("options.loadSchema should be a function");
        }
        const { loadSchema } = this.opts;
        return runCompileAsync.call(this, schema, meta3);
        async function runCompileAsync(_schema, _meta) {
          await loadMetaSchema.call(this, _schema.$schema);
          const sch = this._addSchema(_schema, _meta);
          return sch.validate || _compileAsync.call(this, sch);
        }
        async function loadMetaSchema($ref) {
          if ($ref && !this.getSchema($ref)) {
            await runCompileAsync.call(this, { $ref }, true);
          }
        }
        async function _compileAsync(sch) {
          try {
            return this._compileSchemaEnv(sch);
          } catch (e) {
            if (!(e instanceof ref_error_1.default))
              throw e;
            checkLoaded.call(this, e);
            await loadMissingSchema.call(this, e.missingSchema);
            return _compileAsync.call(this, sch);
          }
        }
        function checkLoaded({ missingSchema: ref, missingRef }) {
          if (this.refs[ref]) {
            throw new Error(`AnySchema ${ref} is loaded but ${missingRef} cannot be resolved`);
          }
        }
        async function loadMissingSchema(ref) {
          const _schema = await _loadSchema.call(this, ref);
          if (!this.refs[ref])
            await loadMetaSchema.call(this, _schema.$schema);
          if (!this.refs[ref])
            this.addSchema(_schema, ref, meta3);
        }
        async function _loadSchema(ref) {
          const p = this._loading[ref];
          if (p)
            return p;
          try {
            return await (this._loading[ref] = loadSchema(ref));
          } finally {
            delete this._loading[ref];
          }
        }
      }
      // Adds schema to the instance
      addSchema(schema, key, _meta, _validateSchema = this.opts.validateSchema) {
        if (Array.isArray(schema)) {
          for (const sch of schema)
            this.addSchema(sch, void 0, _meta, _validateSchema);
          return this;
        }
        let id;
        if (typeof schema === "object") {
          const { schemaId } = this.opts;
          id = schema[schemaId];
          if (id !== void 0 && typeof id != "string") {
            throw new Error(`schema ${schemaId} must be string`);
          }
        }
        key = (0, resolve_1.normalizeId)(key || id);
        this._checkUnique(key);
        this.schemas[key] = this._addSchema(schema, _meta, key, _validateSchema, true);
        return this;
      }
      // Add schema that will be used to validate other schemas
      // options in META_IGNORE_OPTIONS are alway set to false
      addMetaSchema(schema, key, _validateSchema = this.opts.validateSchema) {
        this.addSchema(schema, key, true, _validateSchema);
        return this;
      }
      //  Validate schema against its meta-schema
      validateSchema(schema, throwOrLogError) {
        if (typeof schema == "boolean")
          return true;
        let $schema;
        $schema = schema.$schema;
        if ($schema !== void 0 && typeof $schema != "string") {
          throw new Error("$schema must be a string");
        }
        $schema = $schema || this.opts.defaultMeta || this.defaultMeta();
        if (!$schema) {
          this.logger.warn("meta-schema not available");
          this.errors = null;
          return true;
        }
        const valid = this.validate($schema, schema);
        if (!valid && throwOrLogError) {
          const message = "schema is invalid: " + this.errorsText();
          if (this.opts.validateSchema === "log")
            this.logger.error(message);
          else
            throw new Error(message);
        }
        return valid;
      }
      // Get compiled schema by `key` or `ref`.
      // (`key` that was passed to `addSchema` or full schema reference - `schema.$id` or resolved id)
      getSchema(keyRef) {
        let sch;
        while (typeof (sch = getSchEnv.call(this, keyRef)) == "string")
          keyRef = sch;
        if (sch === void 0) {
          const { schemaId } = this.opts;
          const root = new compile_1.SchemaEnv({ schema: {}, schemaId });
          sch = compile_1.resolveSchema.call(this, root, keyRef);
          if (!sch)
            return;
          this.refs[keyRef] = sch;
        }
        return sch.validate || this._compileSchemaEnv(sch);
      }
      // Remove cached schema(s).
      // If no parameter is passed all schemas but meta-schemas are removed.
      // If RegExp is passed all schemas with key/id matching pattern but meta-schemas are removed.
      // Even if schema is referenced by other schemas it still can be removed as other schemas have local references.
      removeSchema(schemaKeyRef) {
        if (schemaKeyRef instanceof RegExp) {
          this._removeAllSchemas(this.schemas, schemaKeyRef);
          this._removeAllSchemas(this.refs, schemaKeyRef);
          return this;
        }
        switch (typeof schemaKeyRef) {
          case "undefined":
            this._removeAllSchemas(this.schemas);
            this._removeAllSchemas(this.refs);
            this._cache.clear();
            return this;
          case "string": {
            const sch = getSchEnv.call(this, schemaKeyRef);
            if (typeof sch == "object")
              this._cache.delete(sch.schema);
            delete this.schemas[schemaKeyRef];
            delete this.refs[schemaKeyRef];
            return this;
          }
          case "object": {
            const cacheKey2 = schemaKeyRef;
            this._cache.delete(cacheKey2);
            let id = schemaKeyRef[this.opts.schemaId];
            if (id) {
              id = (0, resolve_1.normalizeId)(id);
              delete this.schemas[id];
              delete this.refs[id];
            }
            return this;
          }
          default:
            throw new Error("ajv.removeSchema: invalid parameter");
        }
      }
      // add "vocabulary" - a collection of keywords
      addVocabulary(definitions) {
        for (const def of definitions)
          this.addKeyword(def);
        return this;
      }
      addKeyword(kwdOrDef, def) {
        let keyword;
        if (typeof kwdOrDef == "string") {
          keyword = kwdOrDef;
          if (typeof def == "object") {
            this.logger.warn("these parameters are deprecated, see docs for addKeyword");
            def.keyword = keyword;
          }
        } else if (typeof kwdOrDef == "object" && def === void 0) {
          def = kwdOrDef;
          keyword = def.keyword;
          if (Array.isArray(keyword) && !keyword.length) {
            throw new Error("addKeywords: keyword must be string or non-empty array");
          }
        } else {
          throw new Error("invalid addKeywords parameters");
        }
        checkKeyword.call(this, keyword, def);
        if (!def) {
          (0, util_1.eachItem)(keyword, (kwd) => addRule.call(this, kwd));
          return this;
        }
        keywordMetaschema.call(this, def);
        const definition = {
          ...def,
          type: (0, dataType_1.getJSONTypes)(def.type),
          schemaType: (0, dataType_1.getJSONTypes)(def.schemaType)
        };
        (0, util_1.eachItem)(keyword, definition.type.length === 0 ? (k) => addRule.call(this, k, definition) : (k) => definition.type.forEach((t) => addRule.call(this, k, definition, t)));
        return this;
      }
      getKeyword(keyword) {
        const rule = this.RULES.all[keyword];
        return typeof rule == "object" ? rule.definition : !!rule;
      }
      // Remove keyword
      removeKeyword(keyword) {
        const { RULES } = this;
        delete RULES.keywords[keyword];
        delete RULES.all[keyword];
        for (const group of RULES.rules) {
          const i = group.rules.findIndex((rule) => rule.keyword === keyword);
          if (i >= 0)
            group.rules.splice(i, 1);
        }
        return this;
      }
      // Add format
      addFormat(name, format) {
        if (typeof format == "string")
          format = new RegExp(format);
        this.formats[name] = format;
        return this;
      }
      errorsText(errors = this.errors, { separator = ", ", dataVar = "data" } = {}) {
        if (!errors || errors.length === 0)
          return "No errors";
        return errors.map((e) => `${dataVar}${e.instancePath} ${e.message}`).reduce((text, msg) => text + separator + msg);
      }
      $dataMetaSchema(metaSchema, keywordsJsonPointers) {
        const rules = this.RULES.all;
        metaSchema = JSON.parse(JSON.stringify(metaSchema));
        for (const jsonPointer of keywordsJsonPointers) {
          const segments = jsonPointer.split("/").slice(1);
          let keywords = metaSchema;
          for (const seg of segments)
            keywords = keywords[seg];
          for (const key in rules) {
            const rule = rules[key];
            if (typeof rule != "object")
              continue;
            const { $data } = rule.definition;
            const schema = keywords[key];
            if ($data && schema)
              keywords[key] = schemaOrData(schema);
          }
        }
        return metaSchema;
      }
      _removeAllSchemas(schemas, regex) {
        for (const keyRef in schemas) {
          const sch = schemas[keyRef];
          if (!regex || regex.test(keyRef)) {
            if (typeof sch == "string") {
              delete schemas[keyRef];
            } else if (sch && !sch.meta) {
              this._cache.delete(sch.schema);
              delete schemas[keyRef];
            }
          }
        }
      }
      _addSchema(schema, meta3, baseId, validateSchema = this.opts.validateSchema, addSchema = this.opts.addUsedSchema) {
        let id;
        const { schemaId } = this.opts;
        if (typeof schema == "object") {
          id = schema[schemaId];
        } else {
          if (this.opts.jtd)
            throw new Error("schema must be object");
          else if (typeof schema != "boolean")
            throw new Error("schema must be object or boolean");
        }
        let sch = this._cache.get(schema);
        if (sch !== void 0)
          return sch;
        baseId = (0, resolve_1.normalizeId)(id || baseId);
        const localRefs = resolve_1.getSchemaRefs.call(this, schema, baseId);
        sch = new compile_1.SchemaEnv({ schema, schemaId, meta: meta3, baseId, localRefs });
        this._cache.set(sch.schema, sch);
        if (addSchema && !baseId.startsWith("#")) {
          if (baseId)
            this._checkUnique(baseId);
          this.refs[baseId] = sch;
        }
        if (validateSchema)
          this.validateSchema(schema, true);
        return sch;
      }
      _checkUnique(id) {
        if (this.schemas[id] || this.refs[id]) {
          throw new Error(`schema with key or id "${id}" already exists`);
        }
      }
      _compileSchemaEnv(sch) {
        if (sch.meta)
          this._compileMetaSchema(sch);
        else
          compile_1.compileSchema.call(this, sch);
        if (!sch.validate)
          throw new Error("ajv implementation error");
        return sch.validate;
      }
      _compileMetaSchema(sch) {
        const currentOpts = this.opts;
        this.opts = this._metaOpts;
        try {
          compile_1.compileSchema.call(this, sch);
        } finally {
          this.opts = currentOpts;
        }
      }
    };
    Ajv2.ValidationError = validation_error_1.default;
    Ajv2.MissingRefError = ref_error_1.default;
    exports2.default = Ajv2;
    function checkOptions(checkOpts, options2, msg, log = "error") {
      for (const key in checkOpts) {
        const opt = key;
        if (opt in options2)
          this.logger[log](`${msg}: option ${key}. ${checkOpts[opt]}`);
      }
    }
    function getSchEnv(keyRef) {
      keyRef = (0, resolve_1.normalizeId)(keyRef);
      return this.schemas[keyRef] || this.refs[keyRef];
    }
    function addInitialSchemas() {
      const optsSchemas = this.opts.schemas;
      if (!optsSchemas)
        return;
      if (Array.isArray(optsSchemas))
        this.addSchema(optsSchemas);
      else
        for (const key in optsSchemas)
          this.addSchema(optsSchemas[key], key);
    }
    function addInitialFormats() {
      for (const name in this.opts.formats) {
        const format = this.opts.formats[name];
        if (format)
          this.addFormat(name, format);
      }
    }
    function addInitialKeywords(defs) {
      if (Array.isArray(defs)) {
        this.addVocabulary(defs);
        return;
      }
      this.logger.warn("keywords option as map is deprecated, pass array");
      for (const keyword in defs) {
        const def = defs[keyword];
        if (!def.keyword)
          def.keyword = keyword;
        this.addKeyword(def);
      }
    }
    function getMetaSchemaOptions() {
      const metaOpts = { ...this.opts };
      for (const opt of META_IGNORE_OPTIONS)
        delete metaOpts[opt];
      return metaOpts;
    }
    var noLogs = { log() {
    }, warn() {
    }, error() {
    } };
    function getLogger(logger) {
      if (logger === false)
        return noLogs;
      if (logger === void 0)
        return console;
      if (logger.log && logger.warn && logger.error)
        return logger;
      throw new Error("logger must implement log, warn and error methods");
    }
    var KEYWORD_NAME = /^[a-z_$][a-z0-9_$:-]*$/i;
    function checkKeyword(keyword, def) {
      const { RULES } = this;
      (0, util_1.eachItem)(keyword, (kwd) => {
        if (RULES.keywords[kwd])
          throw new Error(`Keyword ${kwd} is already defined`);
        if (!KEYWORD_NAME.test(kwd))
          throw new Error(`Keyword ${kwd} has invalid name`);
      });
      if (!def)
        return;
      if (def.$data && !("code" in def || "validate" in def)) {
        throw new Error('$data keyword must have "code" or "validate" function');
      }
    }
    function addRule(keyword, definition, dataType) {
      var _a2;
      const post = definition === null || definition === void 0 ? void 0 : definition.post;
      if (dataType && post)
        throw new Error('keyword with "post" flag cannot have "type"');
      const { RULES } = this;
      let ruleGroup = post ? RULES.post : RULES.rules.find(({ type: t }) => t === dataType);
      if (!ruleGroup) {
        ruleGroup = { type: dataType, rules: [] };
        RULES.rules.push(ruleGroup);
      }
      RULES.keywords[keyword] = true;
      if (!definition)
        return;
      const rule = {
        keyword,
        definition: {
          ...definition,
          type: (0, dataType_1.getJSONTypes)(definition.type),
          schemaType: (0, dataType_1.getJSONTypes)(definition.schemaType)
        }
      };
      if (definition.before)
        addBeforeRule.call(this, ruleGroup, rule, definition.before);
      else
        ruleGroup.rules.push(rule);
      RULES.all[keyword] = rule;
      (_a2 = definition.implements) === null || _a2 === void 0 ? void 0 : _a2.forEach((kwd) => this.addKeyword(kwd));
    }
    function addBeforeRule(ruleGroup, rule, before) {
      const i = ruleGroup.rules.findIndex((_rule) => _rule.keyword === before);
      if (i >= 0) {
        ruleGroup.rules.splice(i, 0, rule);
      } else {
        ruleGroup.rules.push(rule);
        this.logger.warn(`rule ${before} is not defined`);
      }
    }
    function keywordMetaschema(def) {
      let { metaSchema } = def;
      if (metaSchema === void 0)
        return;
      if (def.$data && this.opts.$data)
        metaSchema = schemaOrData(metaSchema);
      def.validateSchema = this.compile(metaSchema, true);
    }
    var $dataRef = {
      $ref: "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"
    };
    function schemaOrData(schema) {
      return { anyOf: [schema, $dataRef] };
    }
  }
});

// node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/core/id.js
var require_id2 = __commonJS({
  "node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/core/id.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    var def = {
      keyword: "id",
      code() {
        throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID');
      }
    };
    exports2.default = def;
  }
});

// node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/core/ref.js
var require_ref2 = __commonJS({
  "node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/core/ref.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.callRef = exports2.getValidate = void 0;
    var ref_error_1 = require_ref_error2();
    var code_1 = require_code4();
    var codegen_1 = require_codegen2();
    var names_1 = require_names2();
    var compile_1 = require_compile3();
    var util_1 = require_util5();
    var def = {
      keyword: "$ref",
      schemaType: "string",
      code(cxt) {
        const { gen, schema: $ref, it } = cxt;
        const { baseId, schemaEnv: env, validateName, opts, self } = it;
        const { root } = env;
        if (($ref === "#" || $ref === "#/") && baseId === root.baseId)
          return callRootRef();
        const schOrEnv = compile_1.resolveRef.call(self, root, baseId, $ref);
        if (schOrEnv === void 0)
          throw new ref_error_1.default(it.opts.uriResolver, baseId, $ref);
        if (schOrEnv instanceof compile_1.SchemaEnv)
          return callValidate(schOrEnv);
        return inlineRefSchema(schOrEnv);
        function callRootRef() {
          if (env === root)
            return callRef(cxt, validateName, env, env.$async);
          const rootName = gen.scopeValue("root", { ref: root });
          return callRef(cxt, (0, codegen_1._)`${rootName}.validate`, root, root.$async);
        }
        function callValidate(sch) {
          const v = getValidate(cxt, sch);
          callRef(cxt, v, sch, sch.$async);
        }
        function inlineRefSchema(sch) {
          const schName = gen.scopeValue("schema", opts.code.source === true ? { ref: sch, code: (0, codegen_1.stringify)(sch) } : { ref: sch });
          const valid = gen.name("valid");
          const schCxt = cxt.subschema({
            schema: sch,
            dataTypes: [],
            schemaPath: codegen_1.nil,
            topSchemaRef: schName,
            errSchemaPath: $ref
          }, valid);
          cxt.mergeEvaluated(schCxt);
          cxt.ok(valid);
        }
      }
    };
    function getValidate(cxt, sch) {
      const { gen } = cxt;
      return sch.validate ? gen.scopeValue("validate", { ref: sch.validate }) : (0, codegen_1._)`${gen.scopeValue("wrapper", { ref: sch })}.validate`;
    }
    exports2.getValidate = getValidate;
    function callRef(cxt, v, sch, $async) {
      const { gen, it } = cxt;
      const { allErrors, schemaEnv: env, opts } = it;
      const passCxt = opts.passContext ? names_1.default.this : codegen_1.nil;
      if ($async)
        callAsyncRef();
      else
        callSyncRef();
      function callAsyncRef() {
        if (!env.$async)
          throw new Error("async schema referenced by sync schema");
        const valid = gen.let("valid");
        gen.try(() => {
          gen.code((0, codegen_1._)`await ${(0, code_1.callValidateCode)(cxt, v, passCxt)}`);
          addEvaluatedFrom(v);
          if (!allErrors)
            gen.assign(valid, true);
        }, (e) => {
          gen.if((0, codegen_1._)`!(${e} instanceof ${it.ValidationError})`, () => gen.throw(e));
          addErrorsFrom(e);
          if (!allErrors)
            gen.assign(valid, false);
        });
        cxt.ok(valid);
      }
      function callSyncRef() {
        cxt.result((0, code_1.callValidateCode)(cxt, v, passCxt), () => addEvaluatedFrom(v), () => addErrorsFrom(v));
      }
      function addErrorsFrom(source) {
        const errs = (0, codegen_1._)`${source}.errors`;
        gen.assign(names_1.default.vErrors, (0, codegen_1._)`${names_1.default.vErrors} === null ? ${errs} : ${names_1.default.vErrors}.concat(${errs})`);
        gen.assign(names_1.default.errors, (0, codegen_1._)`${names_1.default.vErrors}.length`);
      }
      function addEvaluatedFrom(source) {
        var _a2;
        if (!it.opts.unevaluated)
          return;
        const schEvaluated = (_a2 = sch === null || sch === void 0 ? void 0 : sch.validate) === null || _a2 === void 0 ? void 0 : _a2.evaluated;
        if (it.props !== true) {
          if (schEvaluated && !schEvaluated.dynamicProps) {
            if (schEvaluated.props !== void 0) {
              it.props = util_1.mergeEvaluated.props(gen, schEvaluated.props, it.props);
            }
          } else {
            const props = gen.var("props", (0, codegen_1._)`${source}.evaluated.props`);
            it.props = util_1.mergeEvaluated.props(gen, props, it.props, codegen_1.Name);
          }
        }
        if (it.items !== true) {
          if (schEvaluated && !schEvaluated.dynamicItems) {
            if (schEvaluated.items !== void 0) {
              it.items = util_1.mergeEvaluated.items(gen, schEvaluated.items, it.items);
            }
          } else {
            const items = gen.var("items", (0, codegen_1._)`${source}.evaluated.items`);
            it.items = util_1.mergeEvaluated.items(gen, items, it.items, codegen_1.Name);
          }
        }
      }
    }
    exports2.callRef = callRef;
    exports2.default = def;
  }
});

// node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/core/index.js
var require_core4 = __commonJS({
  "node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/core/index.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    var id_1 = require_id2();
    var ref_1 = require_ref2();
    var core = [
      "$schema",
      "$id",
      "$defs",
      "$vocabulary",
      { keyword: "$comment" },
      "definitions",
      id_1.default,
      ref_1.default
    ];
    exports2.default = core;
  }
});

// node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/limitNumber.js
var require_limitNumber2 = __commonJS({
  "node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/limitNumber.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    var codegen_1 = require_codegen2();
    var ops = codegen_1.operators;
    var KWDs = {
      maximum: { okStr: "<=", ok: ops.LTE, fail: ops.GT },
      minimum: { okStr: ">=", ok: ops.GTE, fail: ops.LT },
      exclusiveMaximum: { okStr: "<", ok: ops.LT, fail: ops.GTE },
      exclusiveMinimum: { okStr: ">", ok: ops.GT, fail: ops.LTE }
    };
    var error48 = {
      message: ({ keyword, schemaCode }) => (0, codegen_1.str)`must be ${KWDs[keyword].okStr} ${schemaCode}`,
      params: ({ keyword, schemaCode }) => (0, codegen_1._)`{comparison: ${KWDs[keyword].okStr}, limit: ${schemaCode}}`
    };
    var def = {
      keyword: Object.keys(KWDs),
      type: "number",
      schemaType: "number",
      $data: true,
      error: error48,
      code(cxt) {
        const { keyword, data, schemaCode } = cxt;
        cxt.fail$data((0, codegen_1._)`${data} ${KWDs[keyword].fail} ${schemaCode} || isNaN(${data})`);
      }
    };
    exports2.default = def;
  }
});

// node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/multipleOf.js
var require_multipleOf2 = __commonJS({
  "node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/multipleOf.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    var codegen_1 = require_codegen2();
    var error48 = {
      message: ({ schemaCode }) => (0, codegen_1.str)`must be multiple of ${schemaCode}`,
      params: ({ schemaCode }) => (0, codegen_1._)`{multipleOf: ${schemaCode}}`
    };
    var def = {
      keyword: "multipleOf",
      type: "number",
      schemaType: "number",
      $data: true,
      error: error48,
      code(cxt) {
        const { gen, data, schemaCode, it } = cxt;
        const prec = it.opts.multipleOfPrecision;
        const res = gen.let("res");
        const invalid = prec ? (0, codegen_1._)`Math.abs(Math.round(${res}) - ${res}) > 1e-${prec}` : (0, codegen_1._)`${res} !== parseInt(${res})`;
        cxt.fail$data((0, codegen_1._)`(${schemaCode} === 0 || (${res} = ${data}/${schemaCode}, ${invalid}))`);
      }
    };
    exports2.default = def;
  }
});

// node_modules/ajv-formats/node_modules/ajv/dist/runtime/ucs2length.js
var require_ucs2length2 = __commonJS({
  "node_modules/ajv-formats/node_modules/ajv/dist/runtime/ucs2length.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    function ucs2length(str) {
      const len = str.length;
      let length = 0;
      let pos = 0;
      let value;
      while (pos < len) {
        length++;
        value = str.charCodeAt(pos++);
        if (value >= 55296 && value <= 56319 && pos < len) {
          value = str.charCodeAt(pos);
          if ((value & 64512) === 56320)
            pos++;
        }
      }
      return length;
    }
    exports2.default = ucs2length;
    ucs2length.code = 'require("ajv/dist/runtime/ucs2length").default';
  }
});

// node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/limitLength.js
var require_limitLength2 = __commonJS({
  "node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/limitLength.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    var codegen_1 = require_codegen2();
    var util_1 = require_util5();
    var ucs2length_1 = require_ucs2length2();
    var error48 = {
      message({ keyword, schemaCode }) {
        const comp = keyword === "maxLength" ? "more" : "fewer";
        return (0, codegen_1.str)`must NOT have ${comp} than ${schemaCode} characters`;
      },
      params: ({ schemaCode }) => (0, codegen_1._)`{limit: ${schemaCode}}`
    };
    var def = {
      keyword: ["maxLength", "minLength"],
      type: "string",
      schemaType: "number",
      $data: true,
      error: error48,
      code(cxt) {
        const { keyword, data, schemaCode, it } = cxt;
        const op = keyword === "maxLength" ? codegen_1.operators.GT : codegen_1.operators.LT;
        const len = it.opts.unicode === false ? (0, codegen_1._)`${data}.length` : (0, codegen_1._)`${(0, util_1.useFunc)(cxt.gen, ucs2length_1.default)}(${data})`;
        cxt.fail$data((0, codegen_1._)`${len} ${op} ${schemaCode}`);
      }
    };
    exports2.default = def;
  }
});

// node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/pattern.js
var require_pattern2 = __commonJS({
  "node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/pattern.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    var code_1 = require_code4();
    var util_1 = require_util5();
    var codegen_1 = require_codegen2();
    var error48 = {
      message: ({ schemaCode }) => (0, codegen_1.str)`must match pattern "${schemaCode}"`,
      params: ({ schemaCode }) => (0, codegen_1._)`{pattern: ${schemaCode}}`
    };
    var def = {
      keyword: "pattern",
      type: "string",
      schemaType: "string",
      $data: true,
      error: error48,
      code(cxt) {
        const { gen, data, $data, schema, schemaCode, it } = cxt;
        const u = it.opts.unicodeRegExp ? "u" : "";
        if ($data) {
          const { regExp } = it.opts.code;
          const regExpCode = regExp.code === "new RegExp" ? (0, codegen_1._)`new RegExp` : (0, util_1.useFunc)(gen, regExp);
          const valid = gen.let("valid");
          gen.try(() => gen.assign(valid, (0, codegen_1._)`${regExpCode}(${schemaCode}, ${u}).test(${data})`), () => gen.assign(valid, false));
          cxt.fail$data((0, codegen_1._)`!${valid}`);
        } else {
          const regExp = (0, code_1.usePattern)(cxt, schema);
          cxt.fail$data((0, codegen_1._)`!${regExp}.test(${data})`);
        }
      }
    };
    exports2.default = def;
  }
});

// node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/limitProperties.js
var require_limitProperties2 = __commonJS({
  "node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/limitProperties.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    var codegen_1 = require_codegen2();
    var error48 = {
      message({ keyword, schemaCode }) {
        const comp = keyword === "maxProperties" ? "more" : "fewer";
        return (0, codegen_1.str)`must NOT have ${comp} than ${schemaCode} properties`;
      },
      params: ({ schemaCode }) => (0, codegen_1._)`{limit: ${schemaCode}}`
    };
    var def = {
      keyword: ["maxProperties", "minProperties"],
      type: "object",
      schemaType: "number",
      $data: true,
      error: error48,
      code(cxt) {
        const { keyword, data, schemaCode } = cxt;
        const op = keyword === "maxProperties" ? codegen_1.operators.GT : codegen_1.operators.LT;
        cxt.fail$data((0, codegen_1._)`Object.keys(${data}).length ${op} ${schemaCode}`);
      }
    };
    exports2.default = def;
  }
});

// node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/required.js
var require_required2 = __commonJS({
  "node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/required.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    var code_1 = require_code4();
    var codegen_1 = require_codegen2();
    var util_1 = require_util5();
    var error48 = {
      message: ({ params: { missingProperty } }) => (0, codegen_1.str)`must have required property '${missingProperty}'`,
      params: ({ params: { missingProperty } }) => (0, codegen_1._)`{missingProperty: ${missingProperty}}`
    };
    var def = {
      keyword: "required",
      type: "object",
      schemaType: "array",
      $data: true,
      error: error48,
      code(cxt) {
        const { gen, schema, schemaCode, data, $data, it } = cxt;
        const { opts } = it;
        if (!$data && schema.length === 0)
          return;
        const useLoop = schema.length >= opts.loopRequired;
        if (it.allErrors)
          allErrorsMode();
        else
          exitOnErrorMode();
        if (opts.strictRequired) {
          const props = cxt.parentSchema.properties;
          const { definedProperties } = cxt.it;
          for (const requiredKey of schema) {
            if ((props === null || props === void 0 ? void 0 : props[requiredKey]) === void 0 && !definedProperties.has(requiredKey)) {
              const schemaPath = it.schemaEnv.baseId + it.errSchemaPath;
              const msg = `required property "${requiredKey}" is not defined at "${schemaPath}" (strictRequired)`;
              (0, util_1.checkStrictMode)(it, msg, it.opts.strictRequired);
            }
          }
        }
        function allErrorsMode() {
          if (useLoop || $data) {
            cxt.block$data(codegen_1.nil, loopAllRequired);
          } else {
            for (const prop of schema) {
              (0, code_1.checkReportMissingProp)(cxt, prop);
            }
          }
        }
        function exitOnErrorMode() {
          const missing = gen.let("missing");
          if (useLoop || $data) {
            const valid = gen.let("valid", true);
            cxt.block$data(valid, () => loopUntilMissing(missing, valid));
            cxt.ok(valid);
          } else {
            gen.if((0, code_1.checkMissingProp)(cxt, schema, missing));
            (0, code_1.reportMissingProp)(cxt, missing);
            gen.else();
          }
        }
        function loopAllRequired() {
          gen.forOf("prop", schemaCode, (prop) => {
            cxt.setParams({ missingProperty: prop });
            gen.if((0, code_1.noPropertyInData)(gen, data, prop, opts.ownProperties), () => cxt.error());
          });
        }
        function loopUntilMissing(missing, valid) {
          cxt.setParams({ missingProperty: missing });
          gen.forOf(missing, schemaCode, () => {
            gen.assign(valid, (0, code_1.propertyInData)(gen, data, missing, opts.ownProperties));
            gen.if((0, codegen_1.not)(valid), () => {
              cxt.error();
              gen.break();
            });
          }, codegen_1.nil);
        }
      }
    };
    exports2.default = def;
  }
});

// node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/limitItems.js
var require_limitItems2 = __commonJS({
  "node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/limitItems.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    var codegen_1 = require_codegen2();
    var error48 = {
      message({ keyword, schemaCode }) {
        const comp = keyword === "maxItems" ? "more" : "fewer";
        return (0, codegen_1.str)`must NOT have ${comp} than ${schemaCode} items`;
      },
      params: ({ schemaCode }) => (0, codegen_1._)`{limit: ${schemaCode}}`
    };
    var def = {
      keyword: ["maxItems", "minItems"],
      type: "array",
      schemaType: "number",
      $data: true,
      error: error48,
      code(cxt) {
        const { keyword, data, schemaCode } = cxt;
        const op = keyword === "maxItems" ? codegen_1.operators.GT : codegen_1.operators.LT;
        cxt.fail$data((0, codegen_1._)`${data}.length ${op} ${schemaCode}`);
      }
    };
    exports2.default = def;
  }
});

// node_modules/ajv-formats/node_modules/ajv/dist/runtime/equal.js
var require_equal2 = __commonJS({
  "node_modules/ajv-formats/node_modules/ajv/dist/runtime/equal.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    var equal = require_fast_deep_equal();
    equal.code = 'require("ajv/dist/runtime/equal").default';
    exports2.default = equal;
  }
});

// node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js
var require_uniqueItems2 = __commonJS({
  "node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    var dataType_1 = require_dataType2();
    var codegen_1 = require_codegen2();
    var util_1 = require_util5();
    var equal_1 = require_equal2();
    var error48 = {
      message: ({ params: { i, j } }) => (0, codegen_1.str)`must NOT have duplicate items (items ## ${j} and ${i} are identical)`,
      params: ({ params: { i, j } }) => (0, codegen_1._)`{i: ${i}, j: ${j}}`
    };
    var def = {
      keyword: "uniqueItems",
      type: "array",
      schemaType: "boolean",
      $data: true,
      error: error48,
      code(cxt) {
        const { gen, data, $data, schema, parentSchema, schemaCode, it } = cxt;
        if (!$data && !schema)
          return;
        const valid = gen.let("valid");
        const itemTypes = parentSchema.items ? (0, dataType_1.getSchemaTypes)(parentSchema.items) : [];
        cxt.block$data(valid, validateUniqueItems, (0, codegen_1._)`${schemaCode} === false`);
        cxt.ok(valid);
        function validateUniqueItems() {
          const i = gen.let("i", (0, codegen_1._)`${data}.length`);
          const j = gen.let("j");
          cxt.setParams({ i, j });
          gen.assign(valid, true);
          gen.if((0, codegen_1._)`${i} > 1`, () => (canOptimize() ? loopN : loopN2)(i, j));
        }
        function canOptimize() {
          return itemTypes.length > 0 && !itemTypes.some((t) => t === "object" || t === "array");
        }
        function loopN(i, j) {
          const item = gen.name("item");
          const wrongType = (0, dataType_1.checkDataTypes)(itemTypes, item, it.opts.strictNumbers, dataType_1.DataType.Wrong);
          const indices = gen.const("indices", (0, codegen_1._)`{}`);
          gen.for((0, codegen_1._)`;${i}--;`, () => {
            gen.let(item, (0, codegen_1._)`${data}[${i}]`);
            gen.if(wrongType, (0, codegen_1._)`continue`);
            if (itemTypes.length > 1)
              gen.if((0, codegen_1._)`typeof ${item} == "string"`, (0, codegen_1._)`${item} += "_"`);
            gen.if((0, codegen_1._)`typeof ${indices}[${item}] == "number"`, () => {
              gen.assign(j, (0, codegen_1._)`${indices}[${item}]`);
              cxt.error();
              gen.assign(valid, false).break();
            }).code((0, codegen_1._)`${indices}[${item}] = ${i}`);
          });
        }
        function loopN2(i, j) {
          const eql = (0, util_1.useFunc)(gen, equal_1.default);
          const outer = gen.name("outer");
          gen.label(outer).for((0, codegen_1._)`;${i}--;`, () => gen.for((0, codegen_1._)`${j} = ${i}; ${j}--;`, () => gen.if((0, codegen_1._)`${eql}(${data}[${i}], ${data}[${j}])`, () => {
            cxt.error();
            gen.assign(valid, false).break(outer);
          })));
        }
      }
    };
    exports2.default = def;
  }
});

// node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/const.js
var require_const2 = __commonJS({
  "node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/const.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    var codegen_1 = require_codegen2();
    var util_1 = require_util5();
    var equal_1 = require_equal2();
    var error48 = {
      message: "must be equal to constant",
      params: ({ schemaCode }) => (0, codegen_1._)`{allowedValue: ${schemaCode}}`
    };
    var def = {
      keyword: "const",
      $data: true,
      error: error48,
      code(cxt) {
        const { gen, data, $data, schemaCode, schema } = cxt;
        if ($data || schema && typeof schema == "object") {
          cxt.fail$data((0, codegen_1._)`!${(0, util_1.useFunc)(gen, equal_1.default)}(${data}, ${schemaCode})`);
        } else {
          cxt.fail((0, codegen_1._)`${schema} !== ${data}`);
        }
      }
    };
    exports2.default = def;
  }
});

// node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/enum.js
var require_enum2 = __commonJS({
  "node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/enum.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    var codegen_1 = require_codegen2();
    var util_1 = require_util5();
    var equal_1 = require_equal2();
    var error48 = {
      message: "must be equal to one of the allowed values",
      params: ({ schemaCode }) => (0, codegen_1._)`{allowedValues: ${schemaCode}}`
    };
    var def = {
      keyword: "enum",
      schemaType: "array",
      $data: true,
      error: error48,
      code(cxt) {
        const { gen, data, $data, schema, schemaCode, it } = cxt;
        if (!$data && schema.length === 0)
          throw new Error("enum must have non-empty array");
        const useLoop = schema.length >= it.opts.loopEnum;
        let eql;
        const getEql = () => eql !== null && eql !== void 0 ? eql : eql = (0, util_1.useFunc)(gen, equal_1.default);
        let valid;
        if (useLoop || $data) {
          valid = gen.let("valid");
          cxt.block$data(valid, loopEnum);
        } else {
          if (!Array.isArray(schema))
            throw new Error("ajv implementation error");
          const vSchema = gen.const("vSchema", schemaCode);
          valid = (0, codegen_1.or)(...schema.map((_x, i) => equalCode(vSchema, i)));
        }
        cxt.pass(valid);
        function loopEnum() {
          gen.assign(valid, false);
          gen.forOf("v", schemaCode, (v) => gen.if((0, codegen_1._)`${getEql()}(${data}, ${v})`, () => gen.assign(valid, true).break()));
        }
        function equalCode(vSchema, i) {
          const sch = schema[i];
          return typeof sch === "object" && sch !== null ? (0, codegen_1._)`${getEql()}(${data}, ${vSchema}[${i}])` : (0, codegen_1._)`${data} === ${sch}`;
        }
      }
    };
    exports2.default = def;
  }
});

// node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/index.js
var require_validation3 = __commonJS({
  "node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/index.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    var limitNumber_1 = require_limitNumber2();
    var multipleOf_1 = require_multipleOf2();
    var limitLength_1 = require_limitLength2();
    var pattern_1 = require_pattern2();
    var limitProperties_1 = require_limitProperties2();
    var required_1 = require_required2();
    var limitItems_1 = require_limitItems2();
    var uniqueItems_1 = require_uniqueItems2();
    var const_1 = require_const2();
    var enum_1 = require_enum2();
    var validation = [
      // number
      limitNumber_1.default,
      multipleOf_1.default,
      // string
      limitLength_1.default,
      pattern_1.default,
      // object
      limitProperties_1.default,
      required_1.default,
      // array
      limitItems_1.default,
      uniqueItems_1.default,
      // any
      { keyword: "type", schemaType: ["string", "array"] },
      { keyword: "nullable", schemaType: "boolean" },
      const_1.default,
      enum_1.default
    ];
    exports2.default = validation;
  }
});

// node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js
var require_additionalItems2 = __commonJS({
  "node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.validateAdditionalItems = void 0;
    var codegen_1 = require_codegen2();
    var util_1 = require_util5();
    var error48 = {
      message: ({ params: { len } }) => (0, codegen_1.str)`must NOT have more than ${len} items`,
      params: ({ params: { len } }) => (0, codegen_1._)`{limit: ${len}}`
    };
    var def = {
      keyword: "additionalItems",
      type: "array",
      schemaType: ["boolean", "object"],
      before: "uniqueItems",
      error: error48,
      code(cxt) {
        const { parentSchema, it } = cxt;
        const { items } = parentSchema;
        if (!Array.isArray(items)) {
          (0, util_1.checkStrictMode)(it, '"additionalItems" is ignored when "items" is not an array of schemas');
          return;
        }
        validateAdditionalItems(cxt, items);
      }
    };
    function validateAdditionalItems(cxt, items) {
      const { gen, schema, data, keyword, it } = cxt;
      it.items = true;
      const len = gen.const("len", (0, codegen_1._)`${data}.length`);
      if (schema === false) {
        cxt.setParams({ len: items.length });
        cxt.pass((0, codegen_1._)`${len} <= ${items.length}`);
      } else if (typeof schema == "object" && !(0, util_1.alwaysValidSchema)(it, schema)) {
        const valid = gen.var("valid", (0, codegen_1._)`${len} <= ${items.length}`);
        gen.if((0, codegen_1.not)(valid), () => validateItems(valid));
        cxt.ok(valid);
      }
      function validateItems(valid) {
        gen.forRange("i", items.length, len, (i) => {
          cxt.subschema({ keyword, dataProp: i, dataPropType: util_1.Type.Num }, valid);
          if (!it.allErrors)
            gen.if((0, codegen_1.not)(valid), () => gen.break());
        });
      }
    }
    exports2.validateAdditionalItems = validateAdditionalItems;
    exports2.default = def;
  }
});

// node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/items.js
var require_items2 = __commonJS({
  "node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/items.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.validateTuple = void 0;
    var codegen_1 = require_codegen2();
    var util_1 = require_util5();
    var code_1 = require_code4();
    var def = {
      keyword: "items",
      type: "array",
      schemaType: ["object", "array", "boolean"],
      before: "uniqueItems",
      code(cxt) {
        const { schema, it } = cxt;
        if (Array.isArray(schema))
          return validateTuple(cxt, "additionalItems", schema);
        it.items = true;
        if ((0, util_1.alwaysValidSchema)(it, schema))
          return;
        cxt.ok((0, code_1.validateArray)(cxt));
      }
    };
    function validateTuple(cxt, extraItems, schArr = cxt.schema) {
      const { gen, parentSchema, data, keyword, it } = cxt;
      checkStrictTuple(parentSchema);
      if (it.opts.unevaluated && schArr.length && it.items !== true) {
        it.items = util_1.mergeEvaluated.items(gen, schArr.length, it.items);
      }
      const valid = gen.name("valid");
      const len = gen.const("len", (0, codegen_1._)`${data}.length`);
      schArr.forEach((sch, i) => {
        if ((0, util_1.alwaysValidSchema)(it, sch))
          return;
        gen.if((0, codegen_1._)`${len} > ${i}`, () => cxt.subschema({
          keyword,
          schemaProp: i,
          dataProp: i
        }, valid));
        cxt.ok(valid);
      });
      function checkStrictTuple(sch) {
        const { opts, errSchemaPath } = it;
        const l = schArr.length;
        const fullTuple = l === sch.minItems && (l === sch.maxItems || sch[extraItems] === false);
        if (opts.strictTuples && !fullTuple) {
          const msg = `"${keyword}" is ${l}-tuple, but minItems or maxItems/${extraItems} are not specified or different at path "${errSchemaPath}"`;
          (0, util_1.checkStrictMode)(it, msg, opts.strictTuples);
        }
      }
    }
    exports2.validateTuple = validateTuple;
    exports2.default = def;
  }
});

// node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js
var require_prefixItems2 = __commonJS({
  "node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    var items_1 = require_items2();
    var def = {
      keyword: "prefixItems",
      type: "array",
      schemaType: ["array"],
      before: "uniqueItems",
      code: (cxt) => (0, items_1.validateTuple)(cxt, "items")
    };
    exports2.default = def;
  }
});

// node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/items2020.js
var require_items20202 = __commonJS({
  "node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/items2020.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    var codegen_1 = require_codegen2();
    var util_1 = require_util5();
    var code_1 = require_code4();
    var additionalItems_1 = require_additionalItems2();
    var error48 = {
      message: ({ params: { len } }) => (0, codegen_1.str)`must NOT have more than ${len} items`,
      params: ({ params: { len } }) => (0, codegen_1._)`{limit: ${len}}`
    };
    var def = {
      keyword: "items",
      type: "array",
      schemaType: ["object", "boolean"],
      before: "uniqueItems",
      error: error48,
      code(cxt) {
        const { schema, parentSchema, it } = cxt;
        const { prefixItems } = parentSchema;
        it.items = true;
        if ((0, util_1.alwaysValidSchema)(it, schema))
          return;
        if (prefixItems)
          (0, additionalItems_1.validateAdditionalItems)(cxt, prefixItems);
        else
          cxt.ok((0, code_1.validateArray)(cxt));
      }
    };
    exports2.default = def;
  }
});

// node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/contains.js
var require_contains2 = __commonJS({
  "node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/contains.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    var codegen_1 = require_codegen2();
    var util_1 = require_util5();
    var error48 = {
      message: ({ params: { min, max } }) => max === void 0 ? (0, codegen_1.str)`must contain at least ${min} valid item(s)` : (0, codegen_1.str)`must contain at least ${min} and no more than ${max} valid item(s)`,
      params: ({ params: { min, max } }) => max === void 0 ? (0, codegen_1._)`{minContains: ${min}}` : (0, codegen_1._)`{minContains: ${min}, maxContains: ${max}}`
    };
    var def = {
      keyword: "contains",
      type: "array",
      schemaType: ["object", "boolean"],
      before: "uniqueItems",
      trackErrors: true,
      error: error48,
      code(cxt) {
        const { gen, schema, parentSchema, data, it } = cxt;
        let min;
        let max;
        const { minContains, maxContains } = parentSchema;
        if (it.opts.next) {
          min = minContains === void 0 ? 1 : minContains;
          max = maxContains;
        } else {
          min = 1;
        }
        const len = gen.const("len", (0, codegen_1._)`${data}.length`);
        cxt.setParams({ min, max });
        if (max === void 0 && min === 0) {
          (0, util_1.checkStrictMode)(it, `"minContains" == 0 without "maxContains": "contains" keyword ignored`);
          return;
        }
        if (max !== void 0 && min > max) {
          (0, util_1.checkStrictMode)(it, `"minContains" > "maxContains" is always invalid`);
          cxt.fail();
          return;
        }
        if ((0, util_1.alwaysValidSchema)(it, schema)) {
          let cond = (0, codegen_1._)`${len} >= ${min}`;
          if (max !== void 0)
            cond = (0, codegen_1._)`${cond} && ${len} <= ${max}`;
          cxt.pass(cond);
          return;
        }
        it.items = true;
        const valid = gen.name("valid");
        if (max === void 0 && min === 1) {
          validateItems(valid, () => gen.if(valid, () => gen.break()));
        } else if (min === 0) {
          gen.let(valid, true);
          if (max !== void 0)
            gen.if((0, codegen_1._)`${data}.length > 0`, validateItemsWithCount);
        } else {
          gen.let(valid, false);
          validateItemsWithCount();
        }
        cxt.result(valid, () => cxt.reset());
        function validateItemsWithCount() {
          const schValid = gen.name("_valid");
          const count = gen.let("count", 0);
          validateItems(schValid, () => gen.if(schValid, () => checkLimits(count)));
        }
        function validateItems(_valid, block) {
          gen.forRange("i", 0, len, (i) => {
            cxt.subschema({
              keyword: "contains",
              dataProp: i,
              dataPropType: util_1.Type.Num,
              compositeRule: true
            }, _valid);
            block();
          });
        }
        function checkLimits(count) {
          gen.code((0, codegen_1._)`${count}++`);
          if (max === void 0) {
            gen.if((0, codegen_1._)`${count} >= ${min}`, () => gen.assign(valid, true).break());
          } else {
            gen.if((0, codegen_1._)`${count} > ${max}`, () => gen.assign(valid, false).break());
            if (min === 1)
              gen.assign(valid, true);
            else
              gen.if((0, codegen_1._)`${count} >= ${min}`, () => gen.assign(valid, true));
          }
        }
      }
    };
    exports2.default = def;
  }
});

// node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/dependencies.js
var require_dependencies2 = __commonJS({
  "node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/dependencies.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.validateSchemaDeps = exports2.validatePropertyDeps = exports2.error = void 0;
    var codegen_1 = require_codegen2();
    var util_1 = require_util5();
    var code_1 = require_code4();
    exports2.error = {
      message: ({ params: { property, depsCount, deps } }) => {
        const property_ies = depsCount === 1 ? "property" : "properties";
        return (0, codegen_1.str)`must have ${property_ies} ${deps} when property ${property} is present`;
      },
      params: ({ params: { property, depsCount, deps, missingProperty } }) => (0, codegen_1._)`{property: ${property},
    missingProperty: ${missingProperty},
    depsCount: ${depsCount},
    deps: ${deps}}`
      // TODO change to reference
    };
    var def = {
      keyword: "dependencies",
      type: "object",
      schemaType: "object",
      error: exports2.error,
      code(cxt) {
        const [propDeps, schDeps] = splitDependencies(cxt);
        validatePropertyDeps(cxt, propDeps);
        validateSchemaDeps(cxt, schDeps);
      }
    };
    function splitDependencies({ schema }) {
      const propertyDeps = {};
      const schemaDeps = {};
      for (const key in schema) {
        if (key === "__proto__")
          continue;
        const deps = Array.isArray(schema[key]) ? propertyDeps : schemaDeps;
        deps[key] = schema[key];
      }
      return [propertyDeps, schemaDeps];
    }
    function validatePropertyDeps(cxt, propertyDeps = cxt.schema) {
      const { gen, data, it } = cxt;
      if (Object.keys(propertyDeps).length === 0)
        return;
      const missing = gen.let("missing");
      for (const prop in propertyDeps) {
        const deps = propertyDeps[prop];
        if (deps.length === 0)
          continue;
        const hasProperty = (0, code_1.propertyInData)(gen, data, prop, it.opts.ownProperties);
        cxt.setParams({
          property: prop,
          depsCount: deps.length,
          deps: deps.join(", ")
        });
        if (it.allErrors) {
          gen.if(hasProperty, () => {
            for (const depProp of deps) {
              (0, code_1.checkReportMissingProp)(cxt, depProp);
            }
          });
        } else {
          gen.if((0, codegen_1._)`${hasProperty} && (${(0, code_1.checkMissingProp)(cxt, deps, missing)})`);
          (0, code_1.reportMissingProp)(cxt, missing);
          gen.else();
        }
      }
    }
    exports2.validatePropertyDeps = validatePropertyDeps;
    function validateSchemaDeps(cxt, schemaDeps = cxt.schema) {
      const { gen, data, keyword, it } = cxt;
      const valid = gen.name("valid");
      for (const prop in schemaDeps) {
        if ((0, util_1.alwaysValidSchema)(it, schemaDeps[prop]))
          continue;
        gen.if(
          (0, code_1.propertyInData)(gen, data, prop, it.opts.ownProperties),
          () => {
            const schCxt = cxt.subschema({ keyword, schemaProp: prop }, valid);
            cxt.mergeValidEvaluated(schCxt, valid);
          },
          () => gen.var(valid, true)
          // TODO var
        );
        cxt.ok(valid);
      }
    }
    exports2.validateSchemaDeps = validateSchemaDeps;
    exports2.default = def;
  }
});

// node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js
var require_propertyNames2 = __commonJS({
  "node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    var codegen_1 = require_codegen2();
    var util_1 = require_util5();
    var error48 = {
      message: "property name must be valid",
      params: ({ params }) => (0, codegen_1._)`{propertyName: ${params.propertyName}}`
    };
    var def = {
      keyword: "propertyNames",
      type: "object",
      schemaType: ["object", "boolean"],
      error: error48,
      code(cxt) {
        const { gen, schema, data, it } = cxt;
        if ((0, util_1.alwaysValidSchema)(it, schema))
          return;
        const valid = gen.name("valid");
        gen.forIn("key", data, (key) => {
          cxt.setParams({ propertyName: key });
          cxt.subschema({
            keyword: "propertyNames",
            data: key,
            dataTypes: ["string"],
            propertyName: key,
            compositeRule: true
          }, valid);
          gen.if((0, codegen_1.not)(valid), () => {
            cxt.error(true);
            if (!it.allErrors)
              gen.break();
          });
        });
        cxt.ok(valid);
      }
    };
    exports2.default = def;
  }
});

// node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js
var require_additionalProperties2 = __commonJS({
  "node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    var code_1 = require_code4();
    var codegen_1 = require_codegen2();
    var names_1 = require_names2();
    var util_1 = require_util5();
    var error48 = {
      message: "must NOT have additional properties",
      params: ({ params }) => (0, codegen_1._)`{additionalProperty: ${params.additionalProperty}}`
    };
    var def = {
      keyword: "additionalProperties",
      type: ["object"],
      schemaType: ["boolean", "object"],
      allowUndefined: true,
      trackErrors: true,
      error: error48,
      code(cxt) {
        const { gen, schema, parentSchema, data, errsCount, it } = cxt;
        if (!errsCount)
          throw new Error("ajv implementation error");
        const { allErrors, opts } = it;
        it.props = true;
        if (opts.removeAdditional !== "all" && (0, util_1.alwaysValidSchema)(it, schema))
          return;
        const props = (0, code_1.allSchemaProperties)(parentSchema.properties);
        const patProps = (0, code_1.allSchemaProperties)(parentSchema.patternProperties);
        checkAdditionalProperties();
        cxt.ok((0, codegen_1._)`${errsCount} === ${names_1.default.errors}`);
        function checkAdditionalProperties() {
          gen.forIn("key", data, (key) => {
            if (!props.length && !patProps.length)
              additionalPropertyCode(key);
            else
              gen.if(isAdditional(key), () => additionalPropertyCode(key));
          });
        }
        function isAdditional(key) {
          let definedProp;
          if (props.length > 8) {
            const propsSchema = (0, util_1.schemaRefOrVal)(it, parentSchema.properties, "properties");
            definedProp = (0, code_1.isOwnProperty)(gen, propsSchema, key);
          } else if (props.length) {
            definedProp = (0, codegen_1.or)(...props.map((p) => (0, codegen_1._)`${key} === ${p}`));
          } else {
            definedProp = codegen_1.nil;
          }
          if (patProps.length) {
            definedProp = (0, codegen_1.or)(definedProp, ...patProps.map((p) => (0, codegen_1._)`${(0, code_1.usePattern)(cxt, p)}.test(${key})`));
          }
          return (0, codegen_1.not)(definedProp);
        }
        function deleteAdditional(key) {
          gen.code((0, codegen_1._)`delete ${data}[${key}]`);
        }
        function additionalPropertyCode(key) {
          if (opts.removeAdditional === "all" || opts.removeAdditional && schema === false) {
            deleteAdditional(key);
            return;
          }
          if (schema === false) {
            cxt.setParams({ additionalProperty: key });
            cxt.error();
            if (!allErrors)
              gen.break();
            return;
          }
          if (typeof schema == "object" && !(0, util_1.alwaysValidSchema)(it, schema)) {
            const valid = gen.name("valid");
            if (opts.removeAdditional === "failing") {
              applyAdditionalSchema(key, valid, false);
              gen.if((0, codegen_1.not)(valid), () => {
                cxt.reset();
                deleteAdditional(key);
              });
            } else {
              applyAdditionalSchema(key, valid);
              if (!allErrors)
                gen.if((0, codegen_1.not)(valid), () => gen.break());
            }
          }
        }
        function applyAdditionalSchema(key, valid, errors) {
          const subschema = {
            keyword: "additionalProperties",
            dataProp: key,
            dataPropType: util_1.Type.Str
          };
          if (errors === false) {
            Object.assign(subschema, {
              compositeRule: true,
              createErrors: false,
              allErrors: false
            });
          }
          cxt.subschema(subschema, valid);
        }
      }
    };
    exports2.default = def;
  }
});

// node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/properties.js
var require_properties2 = __commonJS({
  "node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/properties.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    var validate_1 = require_validate2();
    var code_1 = require_code4();
    var util_1 = require_util5();
    var additionalProperties_1 = require_additionalProperties2();
    var def = {
      keyword: "properties",
      type: "object",
      schemaType: "object",
      code(cxt) {
        const { gen, schema, parentSchema, data, it } = cxt;
        if (it.opts.removeAdditional === "all" && parentSchema.additionalProperties === void 0) {
          additionalProperties_1.default.code(new validate_1.KeywordCxt(it, additionalProperties_1.default, "additionalProperties"));
        }
        const allProps = (0, code_1.allSchemaProperties)(schema);
        for (const prop of allProps) {
          it.definedProperties.add(prop);
        }
        if (it.opts.unevaluated && allProps.length && it.props !== true) {
          it.props = util_1.mergeEvaluated.props(gen, (0, util_1.toHash)(allProps), it.props);
        }
        const properties = allProps.filter((p) => !(0, util_1.alwaysValidSchema)(it, schema[p]));
        if (properties.length === 0)
          return;
        const valid = gen.name("valid");
        for (const prop of properties) {
          if (hasDefault(prop)) {
            applyPropertySchema(prop);
          } else {
            gen.if((0, code_1.propertyInData)(gen, data, prop, it.opts.ownProperties));
            applyPropertySchema(prop);
            if (!it.allErrors)
              gen.else().var(valid, true);
            gen.endIf();
          }
          cxt.it.definedProperties.add(prop);
          cxt.ok(valid);
        }
        function hasDefault(prop) {
          return it.opts.useDefaults && !it.compositeRule && schema[prop].default !== void 0;
        }
        function applyPropertySchema(prop) {
          cxt.subschema({
            keyword: "properties",
            schemaProp: prop,
            dataProp: prop
          }, valid);
        }
      }
    };
    exports2.default = def;
  }
});

// node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js
var require_patternProperties2 = __commonJS({
  "node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    var code_1 = require_code4();
    var codegen_1 = require_codegen2();
    var util_1 = require_util5();
    var util_2 = require_util5();
    var def = {
      keyword: "patternProperties",
      type: "object",
      schemaType: "object",
      code(cxt) {
        const { gen, schema, data, parentSchema, it } = cxt;
        const { opts } = it;
        const patterns = (0, code_1.allSchemaProperties)(schema);
        const alwaysValidPatterns = patterns.filter((p) => (0, util_1.alwaysValidSchema)(it, schema[p]));
        if (patterns.length === 0 || alwaysValidPatterns.length === patterns.length && (!it.opts.unevaluated || it.props === true)) {
          return;
        }
        const checkProperties = opts.strictSchema && !opts.allowMatchingProperties && parentSchema.properties;
        const valid = gen.name("valid");
        if (it.props !== true && !(it.props instanceof codegen_1.Name)) {
          it.props = (0, util_2.evaluatedPropsToName)(gen, it.props);
        }
        const { props } = it;
        validatePatternProperties();
        function validatePatternProperties() {
          for (const pat of patterns) {
            if (checkProperties)
              checkMatchingProperties(pat);
            if (it.allErrors) {
              validateProperties(pat);
            } else {
              gen.var(valid, true);
              validateProperties(pat);
              gen.if(valid);
            }
          }
        }
        function checkMatchingProperties(pat) {
          for (const prop in checkProperties) {
            if (new RegExp(pat).test(prop)) {
              (0, util_1.checkStrictMode)(it, `property ${prop} matches pattern ${pat} (use allowMatchingProperties)`);
            }
          }
        }
        function validateProperties(pat) {
          gen.forIn("key", data, (key) => {
            gen.if((0, codegen_1._)`${(0, code_1.usePattern)(cxt, pat)}.test(${key})`, () => {
              const alwaysValid = alwaysValidPatterns.includes(pat);
              if (!alwaysValid) {
                cxt.subschema({
                  keyword: "patternProperties",
                  schemaProp: pat,
                  dataProp: key,
                  dataPropType: util_2.Type.Str
                }, valid);
              }
              if (it.opts.unevaluated && props !== true) {
                gen.assign((0, codegen_1._)`${props}[${key}]`, true);
              } else if (!alwaysValid && !it.allErrors) {
                gen.if((0, codegen_1.not)(valid), () => gen.break());
              }
            });
          });
        }
      }
    };
    exports2.default = def;
  }
});

// node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/not.js
var require_not2 = __commonJS({
  "node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/not.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    var util_1 = require_util5();
    var def = {
      keyword: "not",
      schemaType: ["object", "boolean"],
      trackErrors: true,
      code(cxt) {
        const { gen, schema, it } = cxt;
        if ((0, util_1.alwaysValidSchema)(it, schema)) {
          cxt.fail();
          return;
        }
        const valid = gen.name("valid");
        cxt.subschema({
          keyword: "not",
          compositeRule: true,
          createErrors: false,
          allErrors: false
        }, valid);
        cxt.failResult(valid, () => cxt.reset(), () => cxt.error());
      },
      error: { message: "must NOT be valid" }
    };
    exports2.default = def;
  }
});

// node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/anyOf.js
var require_anyOf2 = __commonJS({
  "node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/anyOf.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    var code_1 = require_code4();
    var def = {
      keyword: "anyOf",
      schemaType: "array",
      trackErrors: true,
      code: code_1.validateUnion,
      error: { message: "must match a schema in anyOf" }
    };
    exports2.default = def;
  }
});

// node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/oneOf.js
var require_oneOf2 = __commonJS({
  "node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/oneOf.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    var codegen_1 = require_codegen2();
    var util_1 = require_util5();
    var error48 = {
      message: "must match exactly one schema in oneOf",
      params: ({ params }) => (0, codegen_1._)`{passingSchemas: ${params.passing}}`
    };
    var def = {
      keyword: "oneOf",
      schemaType: "array",
      trackErrors: true,
      error: error48,
      code(cxt) {
        const { gen, schema, parentSchema, it } = cxt;
        if (!Array.isArray(schema))
          throw new Error("ajv implementation error");
        if (it.opts.discriminator && parentSchema.discriminator)
          return;
        const schArr = schema;
        const valid = gen.let("valid", false);
        const passing = gen.let("passing", null);
        const schValid = gen.name("_valid");
        cxt.setParams({ passing });
        gen.block(validateOneOf);
        cxt.result(valid, () => cxt.reset(), () => cxt.error(true));
        function validateOneOf() {
          schArr.forEach((sch, i) => {
            let schCxt;
            if ((0, util_1.alwaysValidSchema)(it, sch)) {
              gen.var(schValid, true);
            } else {
              schCxt = cxt.subschema({
                keyword: "oneOf",
                schemaProp: i,
                compositeRule: true
              }, schValid);
            }
            if (i > 0) {
              gen.if((0, codegen_1._)`${schValid} && ${valid}`).assign(valid, false).assign(passing, (0, codegen_1._)`[${passing}, ${i}]`).else();
            }
            gen.if(schValid, () => {
              gen.assign(valid, true);
              gen.assign(passing, i);
              if (schCxt)
                cxt.mergeEvaluated(schCxt, codegen_1.Name);
            });
          });
        }
      }
    };
    exports2.default = def;
  }
});

// node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/allOf.js
var require_allOf2 = __commonJS({
  "node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/allOf.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    var util_1 = require_util5();
    var def = {
      keyword: "allOf",
      schemaType: "array",
      code(cxt) {
        const { gen, schema, it } = cxt;
        if (!Array.isArray(schema))
          throw new Error("ajv implementation error");
        const valid = gen.name("valid");
        schema.forEach((sch, i) => {
          if ((0, util_1.alwaysValidSchema)(it, sch))
            return;
          const schCxt = cxt.subschema({ keyword: "allOf", schemaProp: i }, valid);
          cxt.ok(valid);
          cxt.mergeEvaluated(schCxt);
        });
      }
    };
    exports2.default = def;
  }
});

// node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/if.js
var require_if2 = __commonJS({
  "node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/if.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    var codegen_1 = require_codegen2();
    var util_1 = require_util5();
    var error48 = {
      message: ({ params }) => (0, codegen_1.str)`must match "${params.ifClause}" schema`,
      params: ({ params }) => (0, codegen_1._)`{failingKeyword: ${params.ifClause}}`
    };
    var def = {
      keyword: "if",
      schemaType: ["object", "boolean"],
      trackErrors: true,
      error: error48,
      code(cxt) {
        const { gen, parentSchema, it } = cxt;
        if (parentSchema.then === void 0 && parentSchema.else === void 0) {
          (0, util_1.checkStrictMode)(it, '"if" without "then" and "else" is ignored');
        }
        const hasThen = hasSchema(it, "then");
        const hasElse = hasSchema(it, "else");
        if (!hasThen && !hasElse)
          return;
        const valid = gen.let("valid", true);
        const schValid = gen.name("_valid");
        validateIf();
        cxt.reset();
        if (hasThen && hasElse) {
          const ifClause = gen.let("ifClause");
          cxt.setParams({ ifClause });
          gen.if(schValid, validateClause("then", ifClause), validateClause("else", ifClause));
        } else if (hasThen) {
          gen.if(schValid, validateClause("then"));
        } else {
          gen.if((0, codegen_1.not)(schValid), validateClause("else"));
        }
        cxt.pass(valid, () => cxt.error(true));
        function validateIf() {
          const schCxt = cxt.subschema({
            keyword: "if",
            compositeRule: true,
            createErrors: false,
            allErrors: false
          }, schValid);
          cxt.mergeEvaluated(schCxt);
        }
        function validateClause(keyword, ifClause) {
          return () => {
            const schCxt = cxt.subschema({ keyword }, schValid);
            gen.assign(valid, schValid);
            cxt.mergeValidEvaluated(schCxt, valid);
            if (ifClause)
              gen.assign(ifClause, (0, codegen_1._)`${keyword}`);
            else
              cxt.setParams({ ifClause: keyword });
          };
        }
      }
    };
    function hasSchema(it, keyword) {
      const schema = it.schema[keyword];
      return schema !== void 0 && !(0, util_1.alwaysValidSchema)(it, schema);
    }
    exports2.default = def;
  }
});

// node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/thenElse.js
var require_thenElse2 = __commonJS({
  "node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/thenElse.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    var util_1 = require_util5();
    var def = {
      keyword: ["then", "else"],
      schemaType: ["object", "boolean"],
      code({ keyword, parentSchema, it }) {
        if (parentSchema.if === void 0)
          (0, util_1.checkStrictMode)(it, `"${keyword}" without "if" is ignored`);
      }
    };
    exports2.default = def;
  }
});

// node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/index.js
var require_applicator2 = __commonJS({
  "node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/index.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    var additionalItems_1 = require_additionalItems2();
    var prefixItems_1 = require_prefixItems2();
    var items_1 = require_items2();
    var items2020_1 = require_items20202();
    var contains_1 = require_contains2();
    var dependencies_1 = require_dependencies2();
    var propertyNames_1 = require_propertyNames2();
    var additionalProperties_1 = require_additionalProperties2();
    var properties_1 = require_properties2();
    var patternProperties_1 = require_patternProperties2();
    var not_1 = require_not2();
    var anyOf_1 = require_anyOf2();
    var oneOf_1 = require_oneOf2();
    var allOf_1 = require_allOf2();
    var if_1 = require_if2();
    var thenElse_1 = require_thenElse2();
    function getApplicator(draft2020 = false) {
      const applicator = [
        // any
        not_1.default,
        anyOf_1.default,
        oneOf_1.default,
        allOf_1.default,
        if_1.default,
        thenElse_1.default,
        // object
        propertyNames_1.default,
        additionalProperties_1.default,
        dependencies_1.default,
        properties_1.default,
        patternProperties_1.default
      ];
      if (draft2020)
        applicator.push(prefixItems_1.default, items2020_1.default);
      else
        applicator.push(additionalItems_1.default, items_1.default);
      applicator.push(contains_1.default);
      return applicator;
    }
    exports2.default = getApplicator;
  }
});

// node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/format/format.js
var require_format3 = __commonJS({
  "node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/format/format.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    var codegen_1 = require_codegen2();
    var error48 = {
      message: ({ schemaCode }) => (0, codegen_1.str)`must match format "${schemaCode}"`,
      params: ({ schemaCode }) => (0, codegen_1._)`{format: ${schemaCode}}`
    };
    var def = {
      keyword: "format",
      type: ["number", "string"],
      schemaType: "string",
      $data: true,
      error: error48,
      code(cxt, ruleType) {
        const { gen, data, $data, schema, schemaCode, it } = cxt;
        const { opts, errSchemaPath, schemaEnv, self } = it;
        if (!opts.validateFormats)
          return;
        if ($data)
          validate$DataFormat();
        else
          validateFormat();
        function validate$DataFormat() {
          const fmts = gen.scopeValue("formats", {
            ref: self.formats,
            code: opts.code.formats
          });
          const fDef = gen.const("fDef", (0, codegen_1._)`${fmts}[${schemaCode}]`);
          const fType = gen.let("fType");
          const format = gen.let("format");
          gen.if((0, codegen_1._)`typeof ${fDef} == "object" && !(${fDef} instanceof RegExp)`, () => gen.assign(fType, (0, codegen_1._)`${fDef}.type || "string"`).assign(format, (0, codegen_1._)`${fDef}.validate`), () => gen.assign(fType, (0, codegen_1._)`"string"`).assign(format, fDef));
          cxt.fail$data((0, codegen_1.or)(unknownFmt(), invalidFmt()));
          function unknownFmt() {
            if (opts.strictSchema === false)
              return codegen_1.nil;
            return (0, codegen_1._)`${schemaCode} && !${format}`;
          }
          function invalidFmt() {
            const callFormat = schemaEnv.$async ? (0, codegen_1._)`(${fDef}.async ? await ${format}(${data}) : ${format}(${data}))` : (0, codegen_1._)`${format}(${data})`;
            const validData = (0, codegen_1._)`(typeof ${format} == "function" ? ${callFormat} : ${format}.test(${data}))`;
            return (0, codegen_1._)`${format} && ${format} !== true && ${fType} === ${ruleType} && !${validData}`;
          }
        }
        function validateFormat() {
          const formatDef = self.formats[schema];
          if (!formatDef) {
            unknownFormat();
            return;
          }
          if (formatDef === true)
            return;
          const [fmtType, format, fmtRef] = getFormat(formatDef);
          if (fmtType === ruleType)
            cxt.pass(validCondition());
          function unknownFormat() {
            if (opts.strictSchema === false) {
              self.logger.warn(unknownMsg());
              return;
            }
            throw new Error(unknownMsg());
            function unknownMsg() {
              return `unknown format "${schema}" ignored in schema at path "${errSchemaPath}"`;
            }
          }
          function getFormat(fmtDef) {
            const code = fmtDef instanceof RegExp ? (0, codegen_1.regexpCode)(fmtDef) : opts.code.formats ? (0, codegen_1._)`${opts.code.formats}${(0, codegen_1.getProperty)(schema)}` : void 0;
            const fmt = gen.scopeValue("formats", { key: schema, ref: fmtDef, code });
            if (typeof fmtDef == "object" && !(fmtDef instanceof RegExp)) {
              return [fmtDef.type || "string", fmtDef.validate, (0, codegen_1._)`${fmt}.validate`];
            }
            return ["string", fmtDef, fmt];
          }
          function validCondition() {
            if (typeof formatDef == "object" && !(formatDef instanceof RegExp) && formatDef.async) {
              if (!schemaEnv.$async)
                throw new Error("async format in sync schema");
              return (0, codegen_1._)`await ${fmtRef}(${data})`;
            }
            return typeof format == "function" ? (0, codegen_1._)`${fmtRef}(${data})` : (0, codegen_1._)`${fmtRef}.test(${data})`;
          }
        }
      }
    };
    exports2.default = def;
  }
});

// node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/format/index.js
var require_format4 = __commonJS({
  "node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/format/index.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    var format_1 = require_format3();
    var format = [format_1.default];
    exports2.default = format;
  }
});

// node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/metadata.js
var require_metadata2 = __commonJS({
  "node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/metadata.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.contentVocabulary = exports2.metadataVocabulary = void 0;
    exports2.metadataVocabulary = [
      "title",
      "description",
      "default",
      "deprecated",
      "readOnly",
      "writeOnly",
      "examples"
    ];
    exports2.contentVocabulary = [
      "contentMediaType",
      "contentEncoding",
      "contentSchema"
    ];
  }
});

// node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/draft7.js
var require_draft72 = __commonJS({
  "node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/draft7.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    var core_1 = require_core4();
    var validation_1 = require_validation3();
    var applicator_1 = require_applicator2();
    var format_1 = require_format4();
    var metadata_1 = require_metadata2();
    var draft7Vocabularies = [
      core_1.default,
      validation_1.default,
      (0, applicator_1.default)(),
      format_1.default,
      metadata_1.metadataVocabulary,
      metadata_1.contentVocabulary
    ];
    exports2.default = draft7Vocabularies;
  }
});

// node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/discriminator/types.js
var require_types3 = __commonJS({
  "node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/discriminator/types.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.DiscrError = void 0;
    var DiscrError;
    (function(DiscrError2) {
      DiscrError2["Tag"] = "tag";
      DiscrError2["Mapping"] = "mapping";
    })(DiscrError || (exports2.DiscrError = DiscrError = {}));
  }
});

// node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/discriminator/index.js
var require_discriminator2 = __commonJS({
  "node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/discriminator/index.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    var codegen_1 = require_codegen2();
    var types_1 = require_types3();
    var compile_1 = require_compile3();
    var ref_error_1 = require_ref_error2();
    var util_1 = require_util5();
    var error48 = {
      message: ({ params: { discrError, tagName } }) => discrError === types_1.DiscrError.Tag ? `tag "${tagName}" must be string` : `value of tag "${tagName}" must be in oneOf`,
      params: ({ params: { discrError, tag, tagName } }) => (0, codegen_1._)`{error: ${discrError}, tag: ${tagName}, tagValue: ${tag}}`
    };
    var def = {
      keyword: "discriminator",
      type: "object",
      schemaType: "object",
      error: error48,
      code(cxt) {
        const { gen, data, schema, parentSchema, it } = cxt;
        const { oneOf } = parentSchema;
        if (!it.opts.discriminator) {
          throw new Error("discriminator: requires discriminator option");
        }
        const tagName = schema.propertyName;
        if (typeof tagName != "string")
          throw new Error("discriminator: requires propertyName");
        if (schema.mapping)
          throw new Error("discriminator: mapping is not supported");
        if (!oneOf)
          throw new Error("discriminator: requires oneOf keyword");
        const valid = gen.let("valid", false);
        const tag = gen.const("tag", (0, codegen_1._)`${data}${(0, codegen_1.getProperty)(tagName)}`);
        gen.if((0, codegen_1._)`typeof ${tag} == "string"`, () => validateMapping(), () => cxt.error(false, { discrError: types_1.DiscrError.Tag, tag, tagName }));
        cxt.ok(valid);
        function validateMapping() {
          const mapping = getMapping();
          gen.if(false);
          for (const tagValue in mapping) {
            gen.elseIf((0, codegen_1._)`${tag} === ${tagValue}`);
            gen.assign(valid, applyTagSchema(mapping[tagValue]));
          }
          gen.else();
          cxt.error(false, { discrError: types_1.DiscrError.Mapping, tag, tagName });
          gen.endIf();
        }
        function applyTagSchema(schemaProp) {
          const _valid = gen.name("valid");
          const schCxt = cxt.subschema({ keyword: "oneOf", schemaProp }, _valid);
          cxt.mergeEvaluated(schCxt, codegen_1.Name);
          return _valid;
        }
        function getMapping() {
          var _a2;
          const oneOfMapping = {};
          const topRequired = hasRequired(parentSchema);
          let tagRequired = true;
          for (let i = 0; i < oneOf.length; i++) {
            let sch = oneOf[i];
            if ((sch === null || sch === void 0 ? void 0 : sch.$ref) && !(0, util_1.schemaHasRulesButRef)(sch, it.self.RULES)) {
              const ref = sch.$ref;
              sch = compile_1.resolveRef.call(it.self, it.schemaEnv.root, it.baseId, ref);
              if (sch instanceof compile_1.SchemaEnv)
                sch = sch.schema;
              if (sch === void 0)
                throw new ref_error_1.default(it.opts.uriResolver, it.baseId, ref);
            }
            const propSch = (_a2 = sch === null || sch === void 0 ? void 0 : sch.properties) === null || _a2 === void 0 ? void 0 : _a2[tagName];
            if (typeof propSch != "object") {
              throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${tagName}"`);
            }
            tagRequired = tagRequired && (topRequired || hasRequired(sch));
            addMappings(propSch, i);
          }
          if (!tagRequired)
            throw new Error(`discriminator: "${tagName}" must be required`);
          return oneOfMapping;
          function hasRequired({ required: required2 }) {
            return Array.isArray(required2) && required2.includes(tagName);
          }
          function addMappings(sch, i) {
            if (sch.const) {
              addMapping(sch.const, i);
            } else if (sch.enum) {
              for (const tagValue of sch.enum) {
                addMapping(tagValue, i);
              }
            } else {
              throw new Error(`discriminator: "properties/${tagName}" must have "const" or "enum"`);
            }
          }
          function addMapping(tagValue, i) {
            if (typeof tagValue != "string" || tagValue in oneOfMapping) {
              throw new Error(`discriminator: "${tagName}" values must be unique strings`);
            }
            oneOfMapping[tagValue] = i;
          }
        }
      }
    };
    exports2.default = def;
  }
});

// node_modules/ajv-formats/node_modules/ajv/dist/refs/json-schema-draft-07.json
var require_json_schema_draft_072 = __commonJS({
  "node_modules/ajv-formats/node_modules/ajv/dist/refs/json-schema-draft-07.json"(exports2, module2) {
    module2.exports = {
      $schema: "http://json-schema.org/draft-07/schema#",
      $id: "http://json-schema.org/draft-07/schema#",
      title: "Core schema meta-schema",
      definitions: {
        schemaArray: {
          type: "array",
          minItems: 1,
          items: { $ref: "#" }
        },
        nonNegativeInteger: {
          type: "integer",
          minimum: 0
        },
        nonNegativeIntegerDefault0: {
          allOf: [{ $ref: "#/definitions/nonNegativeInteger" }, { default: 0 }]
        },
        simpleTypes: {
          enum: ["array", "boolean", "integer", "null", "number", "object", "string"]
        },
        stringArray: {
          type: "array",
          items: { type: "string" },
          uniqueItems: true,
          default: []
        }
      },
      type: ["object", "boolean"],
      properties: {
        $id: {
          type: "string",
          format: "uri-reference"
        },
        $schema: {
          type: "string",
          format: "uri"
        },
        $ref: {
          type: "string",
          format: "uri-reference"
        },
        $comment: {
          type: "string"
        },
        title: {
          type: "string"
        },
        description: {
          type: "string"
        },
        default: true,
        readOnly: {
          type: "boolean",
          default: false
        },
        examples: {
          type: "array",
          items: true
        },
        multipleOf: {
          type: "number",
          exclusiveMinimum: 0
        },
        maximum: {
          type: "number"
        },
        exclusiveMaximum: {
          type: "number"
        },
        minimum: {
          type: "number"
        },
        exclusiveMinimum: {
          type: "number"
        },
        maxLength: { $ref: "#/definitions/nonNegativeInteger" },
        minLength: { $ref: "#/definitions/nonNegativeIntegerDefault0" },
        pattern: {
          type: "string",
          format: "regex"
        },
        additionalItems: { $ref: "#" },
        items: {
          anyOf: [{ $ref: "#" }, { $ref: "#/definitions/schemaArray" }],
          default: true
        },
        maxItems: { $ref: "#/definitions/nonNegativeInteger" },
        minItems: { $ref: "#/definitions/nonNegativeIntegerDefault0" },
        uniqueItems: {
          type: "boolean",
          default: false
        },
        contains: { $ref: "#" },
        maxProperties: { $ref: "#/definitions/nonNegativeInteger" },
        minProperties: { $ref: "#/definitions/nonNegativeIntegerDefault0" },
        required: { $ref: "#/definitions/stringArray" },
        additionalProperties: { $ref: "#" },
        definitions: {
          type: "object",
          additionalProperties: { $ref: "#" },
          default: {}
        },
        properties: {
          type: "object",
          additionalProperties: { $ref: "#" },
          default: {}
        },
        patternProperties: {
          type: "object",
          additionalProperties: { $ref: "#" },
          propertyNames: { format: "regex" },
          default: {}
        },
        dependencies: {
          type: "object",
          additionalProperties: {
            anyOf: [{ $ref: "#" }, { $ref: "#/definitions/stringArray" }]
          }
        },
        propertyNames: { $ref: "#" },
        const: true,
        enum: {
          type: "array",
          items: true,
          minItems: 1,
          uniqueItems: true
        },
        type: {
          anyOf: [
            { $ref: "#/definitions/simpleTypes" },
            {
              type: "array",
              items: { $ref: "#/definitions/simpleTypes" },
              minItems: 1,
              uniqueItems: true
            }
          ]
        },
        format: { type: "string" },
        contentMediaType: { type: "string" },
        contentEncoding: { type: "string" },
        if: { $ref: "#" },
        then: { $ref: "#" },
        else: { $ref: "#" },
        allOf: { $ref: "#/definitions/schemaArray" },
        anyOf: { $ref: "#/definitions/schemaArray" },
        oneOf: { $ref: "#/definitions/schemaArray" },
        not: { $ref: "#" }
      },
      default: true
    };
  }
});

// node_modules/ajv-formats/node_modules/ajv/dist/ajv.js
var require_ajv2 = __commonJS({
  "node_modules/ajv-formats/node_modules/ajv/dist/ajv.js"(exports2, module2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.MissingRefError = exports2.ValidationError = exports2.CodeGen = exports2.Name = exports2.nil = exports2.stringify = exports2.str = exports2._ = exports2.KeywordCxt = exports2.Ajv = void 0;
    var core_1 = require_core3();
    var draft7_1 = require_draft72();
    var discriminator_1 = require_discriminator2();
    var draft7MetaSchema = require_json_schema_draft_072();
    var META_SUPPORT_DATA = ["/properties"];
    var META_SCHEMA_ID = "http://json-schema.org/draft-07/schema";
    var Ajv2 = class extends core_1.default {
      _addVocabularies() {
        super._addVocabularies();
        draft7_1.default.forEach((v) => this.addVocabulary(v));
        if (this.opts.discriminator)
          this.addKeyword(discriminator_1.default);
      }
      _addDefaultMetaSchema() {
        super._addDefaultMetaSchema();
        if (!this.opts.meta)
          return;
        const metaSchema = this.opts.$data ? this.$dataMetaSchema(draft7MetaSchema, META_SUPPORT_DATA) : draft7MetaSchema;
        this.addMetaSchema(metaSchema, META_SCHEMA_ID, false);
        this.refs["http://json-schema.org/schema"] = META_SCHEMA_ID;
      }
      defaultMeta() {
        return this.opts.defaultMeta = super.defaultMeta() || (this.getSchema(META_SCHEMA_ID) ? META_SCHEMA_ID : void 0);
      }
    };
    exports2.Ajv = Ajv2;
    module2.exports = exports2 = Ajv2;
    module2.exports.Ajv = Ajv2;
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.default = Ajv2;
    var validate_1 = require_validate2();
    Object.defineProperty(exports2, "KeywordCxt", { enumerable: true, get: function() {
      return validate_1.KeywordCxt;
    } });
    var codegen_1 = require_codegen2();
    Object.defineProperty(exports2, "_", { enumerable: true, get: function() {
      return codegen_1._;
    } });
    Object.defineProperty(exports2, "str", { enumerable: true, get: function() {
      return codegen_1.str;
    } });
    Object.defineProperty(exports2, "stringify", { enumerable: true, get: function() {
      return codegen_1.stringify;
    } });
    Object.defineProperty(exports2, "nil", { enumerable: true, get: function() {
      return codegen_1.nil;
    } });
    Object.defineProperty(exports2, "Name", { enumerable: true, get: function() {
      return codegen_1.Name;
    } });
    Object.defineProperty(exports2, "CodeGen", { enumerable: true, get: function() {
      return codegen_1.CodeGen;
    } });
    var validation_error_1 = require_validation_error2();
    Object.defineProperty(exports2, "ValidationError", { enumerable: true, get: function() {
      return validation_error_1.default;
    } });
    var ref_error_1 = require_ref_error2();
    Object.defineProperty(exports2, "MissingRefError", { enumerable: true, get: function() {
      return ref_error_1.default;
    } });
  }
});

// node_modules/ajv-formats/dist/limit.js
var require_limit = __commonJS({
  "node_modules/ajv-formats/dist/limit.js"(exports2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.formatLimitDefinition = void 0;
    var ajv_1 = require_ajv2();
    var codegen_1 = require_codegen2();
    var ops = codegen_1.operators;
    var KWDs = {
      formatMaximum: { okStr: "<=", ok: ops.LTE, fail: ops.GT },
      formatMinimum: { okStr: ">=", ok: ops.GTE, fail: ops.LT },
      formatExclusiveMaximum: { okStr: "<", ok: ops.LT, fail: ops.GTE },
      formatExclusiveMinimum: { okStr: ">", ok: ops.GT, fail: ops.LTE }
    };
    var error48 = {
      message: ({ keyword, schemaCode }) => (0, codegen_1.str)`should be ${KWDs[keyword].okStr} ${schemaCode}`,
      params: ({ keyword, schemaCode }) => (0, codegen_1._)`{comparison: ${KWDs[keyword].okStr}, limit: ${schemaCode}}`
    };
    exports2.formatLimitDefinition = {
      keyword: Object.keys(KWDs),
      type: "string",
      schemaType: "string",
      $data: true,
      error: error48,
      code(cxt) {
        const { gen, data, schemaCode, keyword, it } = cxt;
        const { opts, self } = it;
        if (!opts.validateFormats)
          return;
        const fCxt = new ajv_1.KeywordCxt(it, self.RULES.all.format.definition, "format");
        if (fCxt.$data)
          validate$DataFormat();
        else
          validateFormat();
        function validate$DataFormat() {
          const fmts = gen.scopeValue("formats", {
            ref: self.formats,
            code: opts.code.formats
          });
          const fmt = gen.const("fmt", (0, codegen_1._)`${fmts}[${fCxt.schemaCode}]`);
          cxt.fail$data((0, codegen_1.or)((0, codegen_1._)`typeof ${fmt} != "object"`, (0, codegen_1._)`${fmt} instanceof RegExp`, (0, codegen_1._)`typeof ${fmt}.compare != "function"`, compareCode(fmt)));
        }
        function validateFormat() {
          const format = fCxt.schema;
          const fmtDef = self.formats[format];
          if (!fmtDef || fmtDef === true)
            return;
          if (typeof fmtDef != "object" || fmtDef instanceof RegExp || typeof fmtDef.compare != "function") {
            throw new Error(`"${keyword}": format "${format}" does not define "compare" function`);
          }
          const fmt = gen.scopeValue("formats", {
            key: format,
            ref: fmtDef,
            code: opts.code.formats ? (0, codegen_1._)`${opts.code.formats}${(0, codegen_1.getProperty)(format)}` : void 0
          });
          cxt.fail$data(compareCode(fmt));
        }
        function compareCode(fmt) {
          return (0, codegen_1._)`${fmt}.compare(${data}, ${schemaCode}) ${KWDs[keyword].fail} 0`;
        }
      },
      dependencies: ["format"]
    };
    var formatLimitPlugin = (ajv) => {
      ajv.addKeyword(exports2.formatLimitDefinition);
      return ajv;
    };
    exports2.default = formatLimitPlugin;
  }
});

// node_modules/ajv-formats/dist/index.js
var require_dist5 = __commonJS({
  "node_modules/ajv-formats/dist/index.js"(exports2, module2) {
    "use strict";
    Object.defineProperty(exports2, "__esModule", { value: true });
    var formats_1 = require_formats();
    var limit_1 = require_limit();
    var codegen_1 = require_codegen2();
    var fullName = new codegen_1.Name("fullFormats");
    var fastName = new codegen_1.Name("fastFormats");
    var formatsPlugin = (ajv, opts = { keywords: true }) => {
      if (Array.isArray(opts)) {
        addFormats(ajv, opts, formats_1.fullFormats, fullName);
        return ajv;
      }
      const [formats, exportName] = opts.mode === "fast" ? [formats_1.fastFormats, fastName] : [formats_1.fullFormats, fullName];
      const list = opts.formats || formats_1.formatNames;
      addFormats(ajv, list, formats, exportName);
      if (opts.keywords)
        (0, limit_1.default)(ajv);
      return ajv;
    };
    formatsPlugin.get = (name, mode = "full") => {
      const formats = mode === "fast" ? formats_1.fastFormats : formats_1.fullFormats;
      const f = formats[name];
      if (!f)
        throw new Error(`Unknown format "${name}"`);
      return f;
    };
    function addFormats(ajv, list, fs, exportName) {
      var _a2;
      var _b;
      (_a2 = (_b = ajv.opts.code).formats) !== null && _a2 !== void 0 ? _a2 : _b.formats = (0, codegen_1._)`require("ajv-formats/dist/formats").${exportName}`;
      for (const f of list)
        ajv.addFormat(f, fs[f]);
    }
    module2.exports = exports2 = formatsPlugin;
    Object.defineProperty(exports2, "__esModule", { value: true });
    exports2.default = formatsPlugin;
  }
});

// node_modules/bytes/index.js
var require_bytes = __commonJS({
  "node_modules/bytes/index.js"(exports2, module2) {
    "use strict";
    module2.exports = bytes2;
    module2.exports.format = format;
    module2.exports.parse = parse3;
    var formatThousandsRegExp = /\B(?=(\d{3})+(?!\d))/g;
    var formatDecimalsRegExp = /(?:\.0*|(\.[^0]+)0+)$/;
    var map2 = {
      b: 1,
      kb: 1 << 10,
      mb: 1 << 20,
      gb: 1 << 30,
      tb: Math.pow(1024, 4),
      pb: Math.pow(1024, 5)
    };
    var parseRegExp = /^((-|\+)?(\d+(?:\.\d+)?)) *(kb|mb|gb|tb|pb)$/i;
    function bytes2(value, options2) {
      if (typeof value === "string") {
        return parse3(value);
      }
      if (typeof value === "number") {
        return format(value, options2);
      }
      return null;
    }
    function format(value, options2) {
      if (!Number.isFinite(value)) {
        return null;
      }
      var mag = Math.abs(value);
      var thousandsSeparator = options2 && options2.thousandsSeparator || "";
      var unitSeparator = options2 && options2.unitSeparator || "";
      var decimalPlaces = options2 && options2.decimalPlaces !== void 0 ? options2.decimalPlaces : 2;
      var fixedDecimals = Boolean(options2 && options2.fixedDecimals);
      var unit = options2 && options2.unit || "";
      if (!unit || !map2[unit.toLowerCase()]) {
        if (mag >= map2.pb) {
          unit = "PB";
        } else if (mag >= map2.tb) {
          unit = "TB";
        } else if (mag >= map2.gb) {
          unit = "GB";
        } else if (mag >= map2.mb) {
          unit = "MB";
        } else if (mag >= map2.kb) {
          unit = "KB";
        } else {
          unit = "B";
        }
      }
      var val = value / map2[unit.toLowerCase()];
      var str = val.toFixed(decimalPlaces);
      if (!fixedDecimals) {
        str = str.replace(formatDecimalsRegExp, "$1");
      }
      if (thousandsSeparator) {
        str = str.split(".").map(function(s, i) {
          return i === 0 ? s.replace(formatThousandsRegExp, thousandsSeparator) : s;
        }).join(".");
      }
      return str + unitSeparator + unit;
    }
    function parse3(val) {
      if (typeof val === "number" && !isNaN(val)) {
        return val;
      }
      if (typeof val !== "string") {
        return null;
      }
      var results = parseRegExp.exec(val);
      var floatValue;
      var unit = "b";
      if (!results) {
        floatValue = parseInt(val, 10);
        unit = "b";
      } else {
        floatValue = parseFloat(results[1]);
        unit = results[4].toLowerCase();
      }
      if (isNaN(floatValue)) {
        return null;
      }
      return Math.floor(map2[unit] * floatValue);
    }
  }
});

// node_modules/content-type/index.js
var require_content_type = __commonJS({
  "node_modules/content-type/index.js"(exports2) {
    "use strict";
    var PARAM_REGEXP = /; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g;
    var TEXT_REGEXP = /^[\u000b\u0020-\u007e\u0080-\u00ff]+$/;
    var TOKEN_REGEXP = /^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;
    var QESC_REGEXP = /\\([\u000b\u0020-\u00ff])/g;
    var QUOTE_REGEXP = /([\\"])/g;
    var TYPE_REGEXP = /^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;
    exports2.format = format;
    exports2.parse = parse3;
    function format(obj) {
      if (!obj || typeof obj !== "object") {
        throw new TypeError("argument obj is required");
      }
      var parameters = obj.parameters;
      var type = obj.type;
      if (!type || !TYPE_REGEXP.test(type)) {
        throw new TypeError("invalid type");
      }
      var string4 = type;
      if (parameters && typeof parameters === "object") {
        var param;
        var params = Object.keys(parameters).sort();
        for (var i = 0; i < params.length; i++) {
          param = params[i];
          if (!TOKEN_REGEXP.test(param)) {
            throw new TypeError("invalid parameter name");
          }
          string4 += "; " + param + "=" + qstring(parameters[param]);
        }
      }
      return string4;
    }
    function parse3(string4) {
      if (!string4) {
        throw new TypeError("argument string is required");
      }
      var header = typeof string4 === "object" ? getcontenttype(string4) : string4;
      if (typeof header !== "string") {
        throw new TypeError("argument string is required to be a string");
      }
      var index = header.indexOf(";");
      var type = index !== -1 ? header.slice(0, index).trim() : header.trim();
      if (!TYPE_REGEXP.test(type)) {
        throw new TypeError("invalid media type");
      }
      var obj = new ContentType(type.toLowerCase());
      if (index !== -1) {
        var key;
        var match;
        var value;
        PARAM_REGEXP.lastIndex = index;
        while (match = PARAM_REGEXP.exec(header)) {
          if (match.index !== index) {
            throw new TypeError("invalid parameter format");
          }
          index += match[0].length;
          key = match[1].toLowerCase();
          value = match[2];
          if (value.charCodeAt(0) === 34) {
            value = value.slice(1, -1);
            if (value.indexOf("\\") !== -1) {
              value = value.replace(QESC_REGEXP, "$1");
            }
          }
          obj.parameters[key] = value;
        }
        if (index !== header.length) {
          throw new TypeError("invalid parameter format");
        }
      }
      return obj;
    }
    function getcontenttype(obj) {
      var header;
      if (typeof obj.getHeader === "function") {
        header = obj.getHeader("content-type");
      } else if (typeof obj.headers === "object") {
        header = obj.headers && obj.headers["content-type"];
      }
      if (typeof header !== "string") {
        throw new TypeError("content-type header is missing from object");
      }
      return header;
    }
    function qstring(val) {
      var str = String(val);
      if (TOKEN_REGEXP.test(str)) {
        return str;
      }
      if (str.length > 0 && !TEXT_REGEXP.test(str)) {
        throw new TypeError("invalid parameter value");
      }
      return '"' + str.replace(QUOTE_REGEXP, "\\$1") + '"';
    }
    function ContentType(type) {
      this.parameters = /* @__PURE__ */ Object.create(null);
      this.type = type;
    }
  }
});

// node_modules/isexe/windows.js
var require_windows = __commonJS({
  "node_modules/isexe/windows.js"(exports2, module2) {
    module2.exports = isexe;
    isexe.sync = sync;
    var fs = require("fs");
    function checkPathExt(path, options2) {
      var pathext = options2.pathExt !== void 0 ? options2.pathExt : process.env.PATHEXT;
      if (!pathext) {
        return true;
      }
      pathext = pathext.split(";");
      if (pathext.indexOf("") !== -1) {
        return true;
      }
      for (var i = 0; i < pathext.length; i++) {
        var p = pathext[i].toLowerCase();
        if (p && path.substr(-p.length).toLowerCase() === p) {
          return true;
        }
      }
      return false;
    }
    function checkStat(stat, path, options2) {
      if (!stat.isSymbolicLink() && !stat.isFile()) {
        return false;
      }
      return checkPathExt(path, options2);
    }
    function isexe(path, options2, cb) {
      fs.stat(path, function(er, stat) {
        cb(er, er ? false : checkStat(stat, path, options2));
      });
    }
    function sync(path, options2) {
      return checkStat(fs.statSync(path), path, options2);
    }
  }
});

// node_modules/isexe/mode.js
var require_mode = __commonJS({
  "node_modules/isexe/mode.js"(exports2, module2) {
    module2.exports = isexe;
    isexe.sync = sync;
    var fs = require("fs");
    function isexe(path, options2, cb) {
      fs.stat(path, function(er, stat) {
        cb(er, er ? false : checkStat(stat, options2));
      });
    }
    function sync(path, options2) {
      return checkStat(fs.statSync(path), options2);
    }
    function checkStat(stat, options2) {
      return stat.isFile() && checkMode(stat, options2);
    }
    function checkMode(stat, options2) {
      var mod = stat.mode;
      var uid = stat.uid;
      var gid = stat.gid;
      var myUid = options2.uid !== void 0 ? options2.uid : process.getuid && process.getuid();
      var myGid = options2.gid !== void 0 ? options2.gid : process.getgid && process.getgid();
      var u = parseInt("100", 8);
      var g = parseInt("010", 8);
      var o = parseInt("001", 8);
      var ug = u | g;
      var ret = mod & o || mod & g && gid === myGid || mod & u && uid === myUid || mod & ug && myUid === 0;
      return ret;
    }
  }
});

// node_modules/isexe/index.js
var require_isexe = __commonJS({
  "node_modules/isexe/index.js"(exports2, module2) {
    var fs = require("fs");
    var core;
    if (process.platform === "win32" || global.TESTING_WINDOWS) {
      core = require_windows();
    } else {
      core = require_mode();
    }
    module2.exports = isexe;
    isexe.sync = sync;
    function isexe(path, options2, cb) {
      if (typeof options2 === "function") {
        cb = options2;
        options2 = {};
      }
      if (!cb) {
        if (typeof Promise !== "function") {
          throw new TypeError("callback not provided");
        }
        return new Promise(function(resolve, reject) {
          isexe(path, options2 || {}, function(er, is) {
            if (er) {
              reject(er);
            } else {
              resolve(is);
            }
          });
        });
      }
      core(path, options2 || {}, function(er, is) {
        if (er) {
          if (er.code === "EACCES" || options2 && options2.ignoreErrors) {
            er = null;
            is = false;
          }
        }
        cb(er, is);
      });
    }
    function sync(path, options2) {
      try {
        return core.sync(path, options2 || {});
      } catch (er) {
        if (options2 && options2.ignoreErrors || er.code === "EACCES") {
          return false;
        } else {
          throw er;
        }
      }
    }
  }
});

// node_modules/which/which.js
var require_which = __commonJS({
  "node_modules/which/which.js"(exports2, module2) {
    var isWindows = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys";
    var path = require("path");
    var COLON = isWindows ? ";" : ":";
    var isexe = require_isexe();
    var getNotFoundError = (cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: "ENOENT" });
    var getPathInfo = (cmd, opt) => {
      const colon = opt.colon || COLON;
      const pathEnv = cmd.match(/\//) || isWindows && cmd.match(/\\/) ? [""] : [
        // windows always checks the cwd first
        ...isWindows ? [process.cwd()] : [],
        ...(opt.path || process.env.PATH || /* istanbul ignore next: very unusual */
        "").split(colon)
      ];
      const pathExtExe = isWindows ? opt.pathExt || process.env.PATHEXT || ".EXE;.CMD;.BAT;.COM" : "";
      const pathExt = isWindows ? pathExtExe.split(colon) : [""];
      if (isWindows) {
        if (cmd.indexOf(".") !== -1 && pathExt[0] !== "")
          pathExt.unshift("");
      }
      return {
        pathEnv,
        pathExt,
        pathExtExe
      };
    };
    var which = (cmd, opt, cb) => {
      if (typeof opt === "function") {
        cb = opt;
        opt = {};
      }
      if (!opt)
        opt = {};
      const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
      const found = [];
      const step = (i) => new Promise((resolve, reject) => {
        if (i === pathEnv.length)
          return opt.all && found.length ? resolve(found) : reject(getNotFoundError(cmd));
        const ppRaw = pathEnv[i];
        const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
        const pCmd = path.join(pathPart, cmd);
        const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
        resolve(subStep(p, i, 0));
      });
      const subStep = (p, i, ii) => new Promise((resolve, reject) => {
        if (ii === pathExt.length)
          return resolve(step(i + 1));
        const ext = pathExt[ii];
        isexe(p + ext, { pathExt: pathExtExe }, (er, is) => {
          if (!er && is) {
            if (opt.all)
              found.push(p + ext);
            else
              return resolve(p + ext);
          }
          return resolve(subStep(p, i, ii + 1));
        });
      });
      return cb ? step(0).then((res) => cb(null, res), cb) : step(0);
    };
    var whichSync = (cmd, opt) => {
      opt = opt || {};
      const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
      const found = [];
      for (let i = 0; i < pathEnv.length; i++) {
        const ppRaw = pathEnv[i];
        const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
        const pCmd = path.join(pathPart, cmd);
        const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
        for (let j = 0; j < pathExt.length; j++) {
          const cur = p + pathExt[j];
          try {
            const is = isexe.sync(cur, { pathExt: pathExtExe });
            if (is) {
              if (opt.all)
                found.push(cur);
              else
                return cur;
            }
          } catch (ex) {
          }
        }
      }
      if (opt.all && found.length)
        return found;
      if (opt.nothrow)
        return null;
      throw getNotFoundError(cmd);
    };
    module2.exports = which;
    which.sync = whichSync;
  }
});

// node_modules/path-key/index.js
var require_path_key = __commonJS({
  "node_modules/path-key/index.js"(exports2, module2) {
    "use strict";
    var pathKey = (options2 = {}) => {
      const environment = options2.env || process.env;
      const platform = options2.platform || process.platform;
      if (platform !== "win32") {
        return "PATH";
      }
      return Object.keys(environment).reverse().find((key) => key.toUpperCase() === "PATH") || "Path";
    };
    module2.exports = pathKey;
    module2.exports.default = pathKey;
  }
});

// node_modules/cross-spawn/lib/util/resolveCommand.js
var require_resolveCommand = __commonJS({
  "node_modules/cross-spawn/lib/util/resolveCommand.js"(exports2, module2) {
    "use strict";
    var path = require("path");
    var which = require_which();
    var getPathKey = require_path_key();
    function resolveCommandAttempt(parsed, withoutPathExt) {
      const env = parsed.options.env || process.env;
      const cwd = process.cwd();
      const hasCustomCwd = parsed.options.cwd != null;
      const shouldSwitchCwd = hasCustomCwd && process.chdir !== void 0 && !process.chdir.disabled;
      if (shouldSwitchCwd) {
        try {
          process.chdir(parsed.options.cwd);
        } catch (err) {
        }
      }
      let resolved;
      try {
        resolved = which.sync(parsed.command, {
          path: env[getPathKey({ env })],
          pathExt: withoutPathExt ? path.delimiter : void 0
        });
      } catch (e) {
      } finally {
        if (shouldSwitchCwd) {
          process.chdir(cwd);
        }
      }
      if (resolved) {
        resolved = path.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved);
      }
      return resolved;
    }
    function resolveCommand(parsed) {
      return resolveCommandAttempt(parsed) || resolveCommandAttempt(parsed, true);
    }
    module2.exports = resolveCommand;
  }
});

// node_modules/cross-spawn/lib/util/escape.js
var require_escape = __commonJS({
  "node_modules/cross-spawn/lib/util/escape.js"(exports2, module2) {
    "use strict";
    var metaCharsRegExp = /([()\][%!^"`<>&|;, *?])/g;
    function escapeCommand(arg) {
      arg = arg.replace(metaCharsRegExp, "^$1");
      return arg;
    }
    function escapeArgument(arg, doubleEscapeMetaChars) {
      arg = `${arg}`;
      arg = arg.replace(/(?=(\\+?)?)\1"/g, '$1$1\\"');
      arg = arg.replace(/(?=(\\+?)?)\1$/, "$1$1");
      arg = `"${arg}"`;
      arg = arg.replace(metaCharsRegExp, "^$1");
      if (doubleEscapeMetaChars) {
        arg = arg.replace(metaCharsRegExp, "^$1");
      }
      return arg;
    }
    module2.exports.command = escapeCommand;
    module2.exports.argument = escapeArgument;
  }
});

// node_modules/shebang-regex/index.js
var require_shebang_regex = __commonJS({
  "node_modules/shebang-regex/index.js"(exports2, module2) {
    "use strict";
    module2.exports = /^#!(.*)/;
  }
});

// node_modules/shebang-command/index.js
var require_shebang_command = __commonJS({
  "node_modules/shebang-command/index.js"(exports2, module2) {
    "use strict";
    var shebangRegex = require_shebang_regex();
    module2.exports = (string4 = "") => {
      const match = string4.match(shebangRegex);
      if (!match) {
        return null;
      }
      const [path, argument] = match[0].replace(/#! ?/, "").split(" ");
      const binary = path.split("/").pop();
      if (binary === "env") {
        return argument;
      }
      return argument ? `${binary} ${argument}` : binary;
    };
  }
});

// node_modules/cross-spawn/lib/util/readShebang.js
var require_readShebang = __commonJS({
  "node_modules/cross-spawn/lib/util/readShebang.js"(exports2, module2) {
    "use strict";
    var fs = require("fs");
    var shebangCommand = require_shebang_command();
    function readShebang(command) {
      const size = 150;
      const buffer = Buffer.alloc(size);
      let fd;
      try {
        fd = fs.openSync(command, "r");
        fs.readSync(fd, buffer, 0, size, 0);
        fs.closeSync(fd);
      } catch (e) {
      }
      return shebangCommand(buffer.toString());
    }
    module2.exports = readShebang;
  }
});

// node_modules/cross-spawn/lib/parse.js
var require_parse5 = __commonJS({
  "node_modules/cross-spawn/lib/parse.js"(exports2, module2) {
    "use strict";
    var path = require("path");
    var resolveCommand = require_resolveCommand();
    var escape2 = require_escape();
    var readShebang = require_readShebang();
    var isWin2 = process.platform === "win32";
    var isExecutableRegExp = /\.(?:com|exe)$/i;
    var isCmdShimRegExp = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;
    function detectShebang(parsed) {
      parsed.file = resolveCommand(parsed);
      const shebang = parsed.file && readShebang(parsed.file);
      if (shebang) {
        parsed.args.unshift(parsed.file);
        parsed.command = shebang;
        return resolveCommand(parsed);
      }
      return parsed.file;
    }
    function parseNonShell(parsed) {
      if (!isWin2) {
        return parsed;
      }
      const commandFile = detectShebang(parsed);
      const needsShell = !isExecutableRegExp.test(commandFile);
      if (parsed.options.forceShell || needsShell) {
        const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
        parsed.command = path.normalize(parsed.command);
        parsed.command = escape2.command(parsed.command);
        parsed.args = parsed.args.map((arg) => escape2.argument(arg, needsDoubleEscapeMetaChars));
        const shellCommand = [parsed.command].concat(parsed.args).join(" ");
        parsed.args = ["/d", "/s", "/c", `"${shellCommand}"`];
        parsed.command = process.env.comspec || "cmd.exe";
        parsed.options.windowsVerbatimArguments = true;
      }
      return parsed;
    }
    function parse3(command, args, options2) {
      if (args && !Array.isArray(args)) {
        options2 = args;
        args = null;
      }
      args = args ? args.slice(0) : [];
      options2 = Object.assign({}, options2);
      const parsed = {
        command,
        args,
        options: options2,
        file: void 0,
        original: {
          command,
          args
        }
      };
      return options2.shell ? parsed : parseNonShell(parsed);
    }
    module2.exports = parse3;
  }
});

// node_modules/cross-spawn/lib/enoent.js
var require_enoent = __commonJS({
  "node_modules/cross-spawn/lib/enoent.js"(exports2, module2) {
    "use strict";
    var isWin2 = process.platform === "win32";
    function notFoundError(original, syscall) {
      return Object.assign(new Error(`${syscall} ${original.command} ENOENT`), {
        code: "ENOENT",
        errno: "ENOENT",
        syscall: `${syscall} ${original.command}`,
        path: original.command,
        spawnargs: original.args
      });
    }
    function hookChildProcess(cp, parsed) {
      if (!isWin2) {
        return;
      }
      const originalEmit = cp.emit;
      cp.emit = function(name, arg1) {
        if (name === "exit") {
          const err = verifyENOENT(arg1, parsed);
          if (err) {
            return originalEmit.call(cp, "error", err);
          }
        }
        return originalEmit.apply(cp, arguments);
      };
    }
    function verifyENOENT(status, parsed) {
      if (isWin2 && status === 1 && !parsed.file) {
        return notFoundError(parsed.original, "spawn");
      }
      return null;
    }
    function verifyENOENTSync(status, parsed) {
      if (isWin2 && status === 1 && !parsed.file) {
        return notFoundError(parsed.original, "spawnSync");
      }
      return null;
    }
    module2.exports = {
      hookChildProcess,
      verifyENOENT,
      verifyENOENTSync,
      notFoundError
    };
  }
});

// node_modules/cross-spawn/index.js
var require_cross_spawn = __commonJS({
  "node_modules/cross-spawn/index.js"(exports2, module2) {
    "use strict";
    var cp = require("child_process");
    var parse3 = require_parse5();
    var enoent = require_enoent();
    function spawn2(command, args, options2) {
      const parsed = parse3(command, args, options2);
      const spawned = cp.spawn(parsed.command, parsed.args, parsed.options);
      enoent.hookChildProcess(spawned, parsed);
      return spawned;
    }
    function spawnSync(command, args, options2) {
      const parsed = parse3(command, args, options2);
      const result = cp.spawnSync(parsed.command, parsed.args, parsed.options);
      result.error = result.error || enoent.verifyENOENTSync(result.status, parsed);
      return result;
    }
    module2.exports = spawn2;
    module2.exports.spawn = spawn2;
    module2.exports.sync = spawnSync;
    module2.exports._parse = parse3;
    module2.exports._enoent = enoent;
  }
});

// packages/playwright-core/src/utilsBundle.ts
var utilsBundle_exports = {};
__export(utilsBundle_exports, {
  CallToolRequestSchema: () => CallToolRequestSchema,
  Client: () => Client,
  HttpsProxyAgent: () => import_https_proxy_agent.HttpsProxyAgent,
  ListRootsRequestSchema: () => ListRootsRequestSchema,
  ListToolsRequestSchema: () => ListToolsRequestSchema,
  PNG: () => import_pngjs.PNG,
  PingRequestSchema: () => PingRequestSchema,
  ProgramOption: () => Option,
  ProgressNotificationSchema: () => ProgressNotificationSchema,
  SSEClientTransport: () => SSEClientTransport,
  SSEServerTransport: () => SSEServerTransport,
  Server: () => Server,
  SocksProxyAgent: () => import_socks_proxy_agent.SocksProxyAgent,
  StdioClientTransport: () => StdioClientTransport,
  StdioServerTransport: () => StdioServerTransport,
  StreamableHTTPClientTransport: () => StreamableHTTPClientTransport,
  StreamableHTTPServerTransport: () => StreamableHTTPServerTransport,
  chokidar: () => chokidar,
  colors: () => colors,
  debug: () => debug,
  diff: () => diff,
  dotenv: () => dotenv,
  enquirer: () => enquirer,
  getEastAsianWidth: () => getEastAsianWidth,
  getProxyForUrl: () => getProxyForUrl,
  getStream: () => getStream,
  gracefulFs: () => gracefulFs,
  httpProxyAgent: () => httpProxyAgent,
  ini: () => ini,
  jpegjs: () => jpegjs,
  json5: () => json5,
  mime: () => mime,
  minimatch: () => minimatch,
  onExit: () => onExit,
  open: () => open,
  program: () => program,
  progress: () => progress,
  retry: () => retry,
  socksProxyAgent: () => socksProxyAgent,
  sourceMapSupport: () => sourceMapSupport,
  ws: () => ws,
  wsReceiver: () => wsReceiver,
  wsSender: () => wsSender,
  wsServer: () => wsServer,
  yaml: () => yaml,
  yauzl: () => yauzl,
  yazl: () => yazl,
  z: () => zod_exports,
  zodToJsonSchema: () => zodToJsonSchema
});
module.exports = __toCommonJS(utilsBundle_exports);
var import_safe = __toESM(require_safe());
var import_debug = __toESM(require_src());
var iniLibrary = __toESM(require_ini());

// node_modules/diff/libesm/index.js
var libesm_exports = {};
__export(libesm_exports, {
  Diff: () => Diff,
  FILE_HEADERS_ONLY: () => FILE_HEADERS_ONLY,
  INCLUDE_HEADERS: () => INCLUDE_HEADERS,
  OMIT_HEADERS: () => OMIT_HEADERS,
  applyPatch: () => applyPatch,
  applyPatches: () => applyPatches,
  arrayDiff: () => arrayDiff,
  canonicalize: () => canonicalize,
  characterDiff: () => characterDiff,
  convertChangesToDMP: () => convertChangesToDMP,
  convertChangesToXML: () => convertChangesToXML,
  createPatch: () => createPatch,
  createTwoFilesPatch: () => createTwoFilesPatch,
  cssDiff: () => cssDiff,
  diffArrays: () => diffArrays,
  diffChars: () => diffChars,
  diffCss: () => diffCss,
  diffJson: () => diffJson,
  diffLines: () => diffLines,
  diffSentences: () => diffSentences,
  diffTrimmedLines: () => diffTrimmedLines,
  diffWords: () => diffWords,
  diffWordsWithSpace: () => diffWordsWithSpace,
  formatPatch: () => formatPatch,
  jsonDiff: () => jsonDiff,
  lineDiff: () => lineDiff,
  parsePatch: () => parsePatch,
  reversePatch: () => reversePatch,
  sentenceDiff: () => sentenceDiff,
  structuredPatch: () => structuredPatch,
  wordDiff: () => wordDiff,
  wordsWithSpaceDiff: () => wordsWithSpaceDiff
});

// node_modules/diff/libesm/diff/base.js
var Diff = class {
  diff(oldStr, newStr, options2 = {}) {
    let callback;
    if (typeof options2 === "function") {
      callback = options2;
      options2 = {};
    } else if ("callback" in options2) {
      callback = options2.callback;
    }
    const oldString = this.castInput(oldStr, options2);
    const newString = this.castInput(newStr, options2);
    const oldTokens = this.removeEmpty(this.tokenize(oldString, options2));
    const newTokens = this.removeEmpty(this.tokenize(newString, options2));
    return this.diffWithOptionsObj(oldTokens, newTokens, options2, callback);
  }
  diffWithOptionsObj(oldTokens, newTokens, options2, callback) {
    var _a2;
    const done = (value) => {
      value = this.postProcess(value, options2);
      if (callback) {
        setTimeout(function() {
          callback(value);
        }, 0);
        return void 0;
      } else {
        return value;
      }
    };
    const newLen = newTokens.length, oldLen = oldTokens.length;
    let editLength = 1;
    let maxEditLength = newLen + oldLen;
    if (options2.maxEditLength != null) {
      maxEditLength = Math.min(maxEditLength, options2.maxEditLength);
    }
    const maxExecutionTime = (_a2 = options2.timeout) !== null && _a2 !== void 0 ? _a2 : Infinity;
    const abortAfterTimestamp = Date.now() + maxExecutionTime;
    const bestPath = [{ oldPos: -1, lastComponent: void 0 }];
    let newPos = this.extractCommon(bestPath[0], newTokens, oldTokens, 0, options2);
    if (bestPath[0].oldPos + 1 >= oldLen && newPos + 1 >= newLen) {
      return done(this.buildValues(bestPath[0].lastComponent, newTokens, oldTokens));
    }
    let minDiagonalToConsider = -Infinity, maxDiagonalToConsider = Infinity;
    const execEditLength = () => {
      for (let diagonalPath = Math.max(minDiagonalToConsider, -editLength); diagonalPath <= Math.min(maxDiagonalToConsider, editLength); diagonalPath += 2) {
        let basePath;
        const removePath = bestPath[diagonalPath - 1], addPath = bestPath[diagonalPath + 1];
        if (removePath) {
          bestPath[diagonalPath - 1] = void 0;
        }
        let canAdd = false;
        if (addPath) {
          const addPathNewPos = addPath.oldPos - diagonalPath;
          canAdd = addPath && 0 <= addPathNewPos && addPathNewPos < newLen;
        }
        const canRemove = removePath && removePath.oldPos + 1 < oldLen;
        if (!canAdd && !canRemove) {
          bestPath[diagonalPath] = void 0;
          continue;
        }
        if (!canRemove || canAdd && removePath.oldPos < addPath.oldPos) {
          basePath = this.addToPath(addPath, true, false, 0, options2);
        } else {
          basePath = this.addToPath(removePath, false, true, 1, options2);
        }
        newPos = this.extractCommon(basePath, newTokens, oldTokens, diagonalPath, options2);
        if (basePath.oldPos + 1 >= oldLen && newPos + 1 >= newLen) {
          return done(this.buildValues(basePath.lastComponent, newTokens, oldTokens)) || true;
        } else {
          bestPath[diagonalPath] = basePath;
          if (basePath.oldPos + 1 >= oldLen) {
            maxDiagonalToConsider = Math.min(maxDiagonalToConsider, diagonalPath - 1);
          }
          if (newPos + 1 >= newLen) {
            minDiagonalToConsider = Math.max(minDiagonalToConsider, diagonalPath + 1);
          }
        }
      }
      editLength++;
    };
    if (callback) {
      (function exec() {
        setTimeout(function() {
          if (editLength > maxEditLength || Date.now() > abortAfterTimestamp) {
            return callback(void 0);
          }
          if (!execEditLength()) {
            exec();
          }
        }, 0);
      })();
    } else {
      while (editLength <= maxEditLength && Date.now() <= abortAfterTimestamp) {
        const ret = execEditLength();
        if (ret) {
          return ret;
        }
      }
    }
  }
  addToPath(path, added, removed, oldPosInc, options2) {
    const last = path.lastComponent;
    if (last && !options2.oneChangePerToken && last.added === added && last.removed === removed) {
      return {
        oldPos: path.oldPos + oldPosInc,
        lastComponent: { count: last.count + 1, added, removed, previousComponent: last.previousComponent }
      };
    } else {
      return {
        oldPos: path.oldPos + oldPosInc,
        lastComponent: { count: 1, added, removed, previousComponent: last }
      };
    }
  }
  extractCommon(basePath, newTokens, oldTokens, diagonalPath, options2) {
    const newLen = newTokens.length, oldLen = oldTokens.length;
    let oldPos = basePath.oldPos, newPos = oldPos - diagonalPath, commonCount = 0;
    while (newPos + 1 < newLen && oldPos + 1 < oldLen && this.equals(oldTokens[oldPos + 1], newTokens[newPos + 1], options2)) {
      newPos++;
      oldPos++;
      commonCount++;
      if (options2.oneChangePerToken) {
        basePath.lastComponent = { count: 1, previousComponent: basePath.lastComponent, added: false, removed: false };
      }
    }
    if (commonCount && !options2.oneChangePerToken) {
      basePath.lastComponent = { count: commonCount, previousComponent: basePath.lastComponent, added: false, removed: false };
    }
    basePath.oldPos = oldPos;
    return newPos;
  }
  equals(left, right, options2) {
    if (options2.comparator) {
      return options2.comparator(left, right);
    } else {
      return left === right || !!options2.ignoreCase && left.toLowerCase() === right.toLowerCase();
    }
  }
  removeEmpty(array2) {
    const ret = [];
    for (let i = 0; i < array2.length; i++) {
      if (array2[i]) {
        ret.push(array2[i]);
      }
    }
    return ret;
  }
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  castInput(value, options2) {
    return value;
  }
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  tokenize(value, options2) {
    return Array.from(value);
  }
  join(chars) {
    return chars.join("");
  }
  postProcess(changeObjects, options2) {
    return changeObjects;
  }
  get useLongestToken() {
    return false;
  }
  buildValues(lastComponent, newTokens, oldTokens) {
    const components = [];
    let nextComponent;
    while (lastComponent) {
      components.push(lastComponent);
      nextComponent = lastComponent.previousComponent;
      delete lastComponent.previousComponent;
      lastComponent = nextComponent;
    }
    components.reverse();
    const componentLen = components.length;
    let componentPos = 0, newPos = 0, oldPos = 0;
    for (; componentPos < componentLen; componentPos++) {
      const component = components[componentPos];
      if (!component.removed) {
        if (!component.added && this.useLongestToken) {
          let value = newTokens.slice(newPos, newPos + component.count);
          value = value.map(function(value2, i) {
            const oldValue = oldTokens[oldPos + i];
            return oldValue.length > value2.length ? oldValue : value2;
          });
          component.value = this.join(value);
        } else {
          component.value = this.join(newTokens.slice(newPos, newPos + component.count));
        }
        newPos += component.count;
        if (!component.added) {
          oldPos += component.count;
        }
      } else {
        component.value = this.join(oldTokens.slice(oldPos, oldPos + component.count));
        oldPos += component.count;
      }
    }
    return components;
  }
};

// node_modules/diff/libesm/diff/character.js
var CharacterDiff = class extends Diff {
};
var characterDiff = new CharacterDiff();
function diffChars(oldStr, newStr, options2) {
  return characterDiff.diff(oldStr, newStr, options2);
}

// node_modules/diff/libesm/util/string.js
function longestCommonPrefix(str1, str2) {
  let i;
  for (i = 0; i < str1.length && i < str2.length; i++) {
    if (str1[i] != str2[i]) {
      return str1.slice(0, i);
    }
  }
  return str1.slice(0, i);
}
function longestCommonSuffix(str1, str2) {
  let i;
  if (!str1 || !str2 || str1[str1.length - 1] != str2[str2.length - 1]) {
    return "";
  }
  for (i = 0; i < str1.length && i < str2.length; i++) {
    if (str1[str1.length - (i + 1)] != str2[str2.length - (i + 1)]) {
      return str1.slice(-i);
    }
  }
  return str1.slice(-i);
}
function replacePrefix(string4, oldPrefix, newPrefix) {
  if (string4.slice(0, oldPrefix.length) != oldPrefix) {
    throw Error(`string ${JSON.stringify(string4)} doesn't start with prefix ${JSON.stringify(oldPrefix)}; this is a bug`);
  }
  return newPrefix + string4.slice(oldPrefix.length);
}
function replaceSuffix(string4, oldSuffix, newSuffix) {
  if (!oldSuffix) {
    return string4 + newSuffix;
  }
  if (string4.slice(-oldSuffix.length) != oldSuffix) {
    throw Error(`string ${JSON.stringify(string4)} doesn't end with suffix ${JSON.stringify(oldSuffix)}; this is a bug`);
  }
  return string4.slice(0, -oldSuffix.length) + newSuffix;
}
function removePrefix(string4, oldPrefix) {
  return replacePrefix(string4, oldPrefix, "");
}
function removeSuffix(string4, oldSuffix) {
  return replaceSuffix(string4, oldSuffix, "");
}
function maximumOverlap(string1, string22) {
  return string22.slice(0, overlapCount(string1, string22));
}
function overlapCount(a, b) {
  let startA = 0;
  if (a.length > b.length) {
    startA = a.length - b.length;
  }
  let endB = b.length;
  if (a.length < b.length) {
    endB = a.length;
  }
  const map2 = Array(endB);
  let k = 0;
  map2[0] = 0;
  for (let j = 1; j < endB; j++) {
    if (b[j] == b[k]) {
      map2[j] = map2[k];
    } else {
      map2[j] = k;
    }
    while (k > 0 && b[j] != b[k]) {
      k = map2[k];
    }
    if (b[j] == b[k]) {
      k++;
    }
  }
  k = 0;
  for (let i = startA; i < a.length; i++) {
    while (k > 0 && a[i] != b[k]) {
      k = map2[k];
    }
    if (a[i] == b[k]) {
      k++;
    }
  }
  return k;
}
function hasOnlyWinLineEndings(string4) {
  return string4.includes("\r\n") && !string4.startsWith("\n") && !string4.match(/[^\r]\n/);
}
function hasOnlyUnixLineEndings(string4) {
  return !string4.includes("\r\n") && string4.includes("\n");
}
function segment(string4, segmenter) {
  const parts = [];
  for (const segmentObj of Array.from(segmenter.segment(string4))) {
    const segment2 = segmentObj.segment;
    if (parts.length && /\s/.test(parts[parts.length - 1]) && /\s/.test(segment2)) {
      parts[parts.length - 1] += segment2;
    } else {
      parts.push(segment2);
    }
  }
  return parts;
}
function trailingWs(string4, segmenter) {
  if (segmenter) {
    return leadingAndTrailingWs(string4, segmenter)[1];
  }
  let i;
  for (i = string4.length - 1; i >= 0; i--) {
    if (!string4[i].match(/\s/)) {
      break;
    }
  }
  return string4.substring(i + 1);
}
function leadingWs(string4, segmenter) {
  if (segmenter) {
    return leadingAndTrailingWs(string4, segmenter)[0];
  }
  const match = string4.match(/^\s*/);
  return match ? match[0] : "";
}
function leadingAndTrailingWs(string4, segmenter) {
  if (!segmenter) {
    return [leadingWs(string4), trailingWs(string4)];
  }
  if (segmenter.resolvedOptions().granularity != "word") {
    throw new Error('The segmenter passed must have a granularity of "word"');
  }
  const segments = segment(string4, segmenter);
  const firstSeg = segments[0];
  const lastSeg = segments[segments.length - 1];
  const head = /\s/.test(firstSeg) ? firstSeg : "";
  const tail = /\s/.test(lastSeg) ? lastSeg : "";
  return [head, tail];
}

// node_modules/diff/libesm/diff/word.js
var extendedWordChars = "a-zA-Z0-9_\\u{AD}\\u{C0}-\\u{D6}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}";
var tokenizeIncludingWhitespace = new RegExp(`[${extendedWordChars}]+|\\s+|[^${extendedWordChars}]`, "ug");
var WordDiff = class extends Diff {
  equals(left, right, options2) {
    if (options2.ignoreCase) {
      left = left.toLowerCase();
      right = right.toLowerCase();
    }
    return left.trim() === right.trim();
  }
  tokenize(value, options2 = {}) {
    let parts;
    if (options2.intlSegmenter) {
      const segmenter = options2.intlSegmenter;
      if (segmenter.resolvedOptions().granularity != "word") {
        throw new Error('The segmenter passed must have a granularity of "word"');
      }
      parts = segment(value, segmenter);
    } else {
      parts = value.match(tokenizeIncludingWhitespace) || [];
    }
    const tokens = [];
    let prevPart = null;
    parts.forEach((part) => {
      if (/\s/.test(part)) {
        if (prevPart == null) {
          tokens.push(part);
        } else {
          tokens.push(tokens.pop() + part);
        }
      } else if (prevPart != null && /\s/.test(prevPart)) {
        if (tokens[tokens.length - 1] == prevPart) {
          tokens.push(tokens.pop() + part);
        } else {
          tokens.push(prevPart + part);
        }
      } else {
        tokens.push(part);
      }
      prevPart = part;
    });
    return tokens;
  }
  join(tokens) {
    return tokens.map((token, i) => {
      if (i == 0) {
        return token;
      } else {
        return token.replace(/^\s+/, "");
      }
    }).join("");
  }
  postProcess(changes, options2) {
    if (!changes || options2.oneChangePerToken) {
      return changes;
    }
    let lastKeep = null;
    let insertion = null;
    let deletion = null;
    changes.forEach((change) => {
      if (change.added) {
        insertion = change;
      } else if (change.removed) {
        deletion = change;
      } else {
        if (insertion || deletion) {
          dedupeWhitespaceInChangeObjects(lastKeep, deletion, insertion, change, options2.intlSegmenter);
        }
        lastKeep = change;
        insertion = null;
        deletion = null;
      }
    });
    if (insertion || deletion) {
      dedupeWhitespaceInChangeObjects(lastKeep, deletion, insertion, null, options2.intlSegmenter);
    }
    return changes;
  }
};
var wordDiff = new WordDiff();
function diffWords(oldStr, newStr, options2) {
  if ((options2 === null || options2 === void 0 ? void 0 : options2.ignoreWhitespace) != null && !options2.ignoreWhitespace) {
    return diffWordsWithSpace(oldStr, newStr, options2);
  }
  return wordDiff.diff(oldStr, newStr, options2);
}
function dedupeWhitespaceInChangeObjects(startKeep, deletion, insertion, endKeep, segmenter) {
  if (deletion && insertion) {
    const [oldWsPrefix, oldWsSuffix] = leadingAndTrailingWs(deletion.value, segmenter);
    const [newWsPrefix, newWsSuffix] = leadingAndTrailingWs(insertion.value, segmenter);
    if (startKeep) {
      const commonWsPrefix = longestCommonPrefix(oldWsPrefix, newWsPrefix);
      startKeep.value = replaceSuffix(startKeep.value, newWsPrefix, commonWsPrefix);
      deletion.value = removePrefix(deletion.value, commonWsPrefix);
      insertion.value = removePrefix(insertion.value, commonWsPrefix);
    }
    if (endKeep) {
      const commonWsSuffix = longestCommonSuffix(oldWsSuffix, newWsSuffix);
      endKeep.value = replacePrefix(endKeep.value, newWsSuffix, commonWsSuffix);
      deletion.value = removeSuffix(deletion.value, commonWsSuffix);
      insertion.value = removeSuffix(insertion.value, commonWsSuffix);
    }
  } else if (insertion) {
    if (startKeep) {
      const ws2 = leadingWs(insertion.value, segmenter);
      insertion.value = insertion.value.substring(ws2.length);
    }
    if (endKeep) {
      const ws2 = leadingWs(endKeep.value, segmenter);
      endKeep.value = endKeep.value.substring(ws2.length);
    }
  } else if (startKeep && endKeep) {
    const newWsFull = leadingWs(endKeep.value, segmenter), [delWsStart, delWsEnd] = leadingAndTrailingWs(deletion.value, segmenter);
    const newWsStart = longestCommonPrefix(newWsFull, delWsStart);
    deletion.value = removePrefix(deletion.value, newWsStart);
    const newWsEnd = longestCommonSuffix(removePrefix(newWsFull, newWsStart), delWsEnd);
    deletion.value = removeSuffix(deletion.value, newWsEnd);
    endKeep.value = replacePrefix(endKeep.value, newWsFull, newWsEnd);
    startKeep.value = replaceSuffix(startKeep.value, newWsFull, newWsFull.slice(0, newWsFull.length - newWsEnd.length));
  } else if (endKeep) {
    const endKeepWsPrefix = leadingWs(endKeep.value, segmenter);
    const deletionWsSuffix = trailingWs(deletion.value, segmenter);
    const overlap = maximumOverlap(deletionWsSuffix, endKeepWsPrefix);
    deletion.value = removeSuffix(deletion.value, overlap);
  } else if (startKeep) {
    const startKeepWsSuffix = trailingWs(startKeep.value, segmenter);
    const deletionWsPrefix = leadingWs(deletion.value, segmenter);
    const overlap = maximumOverlap(startKeepWsSuffix, deletionWsPrefix);
    deletion.value = removePrefix(deletion.value, overlap);
  }
}
var WordsWithSpaceDiff = class extends Diff {
  tokenize(value) {
    const regex = new RegExp(`(\\r?\\n)|[${extendedWordChars}]+|[^\\S\\n\\r]+|[^${extendedWordChars}]`, "ug");
    return value.match(regex) || [];
  }
};
var wordsWithSpaceDiff = new WordsWithSpaceDiff();
function diffWordsWithSpace(oldStr, newStr, options2) {
  return wordsWithSpaceDiff.diff(oldStr, newStr, options2);
}

// node_modules/diff/libesm/util/params.js
function generateOptions(options2, defaults) {
  if (typeof options2 === "function") {
    defaults.callback = options2;
  } else if (options2) {
    for (const name in options2) {
      if (Object.prototype.hasOwnProperty.call(options2, name)) {
        defaults[name] = options2[name];
      }
    }
  }
  return defaults;
}

// node_modules/diff/libesm/diff/line.js
var LineDiff = class extends Diff {
  constructor() {
    super(...arguments);
    this.tokenize = tokenize;
  }
  equals(left, right, options2) {
    if (options2.ignoreWhitespace) {
      if (!options2.newlineIsToken || !left.includes("\n")) {
        left = left.trim();
      }
      if (!options2.newlineIsToken || !right.includes("\n")) {
        right = right.trim();
      }
    } else if (options2.ignoreNewlineAtEof && !options2.newlineIsToken) {
      if (left.endsWith("\n")) {
        left = left.slice(0, -1);
      }
      if (right.endsWith("\n")) {
        right = right.slice(0, -1);
      }
    }
    return super.equals(left, right, options2);
  }
};
var lineDiff = new LineDiff();
function diffLines(oldStr, newStr, options2) {
  return lineDiff.diff(oldStr, newStr, options2);
}
function diffTrimmedLines(oldStr, newStr, options2) {
  options2 = generateOptions(options2, { ignoreWhitespace: true });
  return lineDiff.diff(oldStr, newStr, options2);
}
function tokenize(value, options2) {
  if (options2.stripTrailingCr) {
    value = value.replace(/\r\n/g, "\n");
  }
  const retLines = [], linesAndNewlines = value.split(/(\n|\r\n)/);
  if (!linesAndNewlines[linesAndNewlines.length - 1]) {
    linesAndNewlines.pop();
  }
  for (let i = 0; i < linesAndNewlines.length; i++) {
    const line = linesAndNewlines[i];
    if (i % 2 && !options2.newlineIsToken) {
      retLines[retLines.length - 1] += line;
    } else {
      retLines.push(line);
    }
  }
  return retLines;
}

// node_modules/diff/libesm/diff/sentence.js
function isSentenceEndPunct(char) {
  return char == "." || char == "!" || char == "?";
}
var SentenceDiff = class extends Diff {
  tokenize(value) {
    var _a2;
    const result = [];
    let tokenStartI = 0;
    for (let i = 0; i < value.length; i++) {
      if (i == value.length - 1) {
        result.push(value.slice(tokenStartI));
        break;
      }
      if (isSentenceEndPunct(value[i]) && value[i + 1].match(/\s/)) {
        result.push(value.slice(tokenStartI, i + 1));
        i = tokenStartI = i + 1;
        while ((_a2 = value[i + 1]) === null || _a2 === void 0 ? void 0 : _a2.match(/\s/)) {
          i++;
        }
        result.push(value.slice(tokenStartI, i + 1));
        tokenStartI = i + 1;
      }
    }
    return result;
  }
};
var sentenceDiff = new SentenceDiff();
function diffSentences(oldStr, newStr, options2) {
  return sentenceDiff.diff(oldStr, newStr, options2);
}

// node_modules/diff/libesm/diff/css.js
var CssDiff = class extends Diff {
  tokenize(value) {
    return value.split(/([{}:;,]|\s+)/);
  }
};
var cssDiff = new CssDiff();
function diffCss(oldStr, newStr, options2) {
  return cssDiff.diff(oldStr, newStr, options2);
}

// node_modules/diff/libesm/diff/json.js
var JsonDiff = class extends Diff {
  constructor() {
    super(...arguments);
    this.tokenize = tokenize;
  }
  get useLongestToken() {
    return true;
  }
  castInput(value, options2) {
    const { undefinedReplacement, stringifyReplacer = (k, v) => typeof v === "undefined" ? undefinedReplacement : v } = options2;
    return typeof value === "string" ? value : JSON.stringify(canonicalize(value, null, null, stringifyReplacer), null, "  ");
  }
  equals(left, right, options2) {
    return super.equals(left.replace(/,([\r\n])/g, "$1"), right.replace(/,([\r\n])/g, "$1"), options2);
  }
};
var jsonDiff = new JsonDiff();
function diffJson(oldStr, newStr, options2) {
  return jsonDiff.diff(oldStr, newStr, options2);
}
function canonicalize(obj, stack, replacementStack, replacer, key) {
  stack = stack || [];
  replacementStack = replacementStack || [];
  if (replacer) {
    obj = replacer(key === void 0 ? "" : key, obj);
  }
  let i;
  for (i = 0; i < stack.length; i += 1) {
    if (stack[i] === obj) {
      return replacementStack[i];
    }
  }
  let canonicalizedObj;
  if ("[object Array]" === Object.prototype.toString.call(obj)) {
    stack.push(obj);
    canonicalizedObj = new Array(obj.length);
    replacementStack.push(canonicalizedObj);
    for (i = 0; i < obj.length; i += 1) {
      canonicalizedObj[i] = canonicalize(obj[i], stack, replacementStack, replacer, String(i));
    }
    stack.pop();
    replacementStack.pop();
    return canonicalizedObj;
  }
  if (obj && obj.toJSON) {
    obj = obj.toJSON();
  }
  if (typeof obj === "object" && obj !== null) {
    stack.push(obj);
    canonicalizedObj = {};
    replacementStack.push(canonicalizedObj);
    const sortedKeys = [];
    let key2;
    for (key2 in obj) {
      if (Object.prototype.hasOwnProperty.call(obj, key2)) {
        sortedKeys.push(key2);
      }
    }
    sortedKeys.sort();
    for (i = 0; i < sortedKeys.length; i += 1) {
      key2 = sortedKeys[i];
      canonicalizedObj[key2] = canonicalize(obj[key2], stack, replacementStack, replacer, key2);
    }
    stack.pop();
    replacementStack.pop();
  } else {
    canonicalizedObj = obj;
  }
  return canonicalizedObj;
}

// node_modules/diff/libesm/diff/array.js
var ArrayDiff = class extends Diff {
  tokenize(value) {
    return value.slice();
  }
  join(value) {
    return value;
  }
  removeEmpty(value) {
    return value;
  }
};
var arrayDiff = new ArrayDiff();
function diffArrays(oldArr, newArr, options2) {
  return arrayDiff.diff(oldArr, newArr, options2);
}

// node_modules/diff/libesm/patch/line-endings.js
function unixToWin(patch) {
  if (Array.isArray(patch)) {
    return patch.map((p) => unixToWin(p));
  }
  return Object.assign(Object.assign({}, patch), { hunks: patch.hunks.map((hunk) => Object.assign(Object.assign({}, hunk), { lines: hunk.lines.map((line, i) => {
    var _a2;
    return line.startsWith("\\") || line.endsWith("\r") || ((_a2 = hunk.lines[i + 1]) === null || _a2 === void 0 ? void 0 : _a2.startsWith("\\")) ? line : line + "\r";
  }) })) });
}
function winToUnix(patch) {
  if (Array.isArray(patch)) {
    return patch.map((p) => winToUnix(p));
  }
  return Object.assign(Object.assign({}, patch), { hunks: patch.hunks.map((hunk) => Object.assign(Object.assign({}, hunk), { lines: hunk.lines.map((line) => line.endsWith("\r") ? line.substring(0, line.length - 1) : line) })) });
}
function isUnix(patch) {
  if (!Array.isArray(patch)) {
    patch = [patch];
  }
  return !patch.some((index) => index.hunks.some((hunk) => hunk.lines.some((line) => !line.startsWith("\\") && line.endsWith("\r"))));
}
function isWin(patch) {
  if (!Array.isArray(patch)) {
    patch = [patch];
  }
  return patch.some((index) => index.hunks.some((hunk) => hunk.lines.some((line) => line.endsWith("\r")))) && patch.every((index) => index.hunks.every((hunk) => hunk.lines.every((line, i) => {
    var _a2;
    return line.startsWith("\\") || line.endsWith("\r") || ((_a2 = hunk.lines[i + 1]) === null || _a2 === void 0 ? void 0 : _a2.startsWith("\\"));
  })));
}

// node_modules/diff/libesm/patch/parse.js
function parsePatch(uniDiff) {
  const diffstr = uniDiff.split(/\n/), list = [];
  let i = 0;
  function parseIndex() {
    const index = {};
    list.push(index);
    while (i < diffstr.length) {
      const line = diffstr[i];
      if (/^(---|\+\+\+|@@)\s/.test(line)) {
        break;
      }
      const headerMatch = /^(?:Index:|diff(?: -r \w+)+)\s+/.exec(line);
      if (headerMatch) {
        index.index = line.substring(headerMatch[0].length).trim();
      }
      i++;
    }
    parseFileHeader(index);
    parseFileHeader(index);
    index.hunks = [];
    while (i < diffstr.length) {
      const line = diffstr[i];
      if (/^(Index:\s|diff\s|---\s|\+\+\+\s|===================================================================)/.test(line)) {
        break;
      } else if (/^@@/.test(line)) {
        index.hunks.push(parseHunk());
      } else if (line) {
        throw new Error("Unknown line " + (i + 1) + " " + JSON.stringify(line));
      } else {
        i++;
      }
    }
  }
  function parseFileHeader(index) {
    const fileHeaderMatch = /^(---|\+\+\+)\s+/.exec(diffstr[i]);
    if (fileHeaderMatch) {
      const prefix = fileHeaderMatch[1], data = diffstr[i].substring(3).trim().split("	", 2), header = (data[1] || "").trim();
      let fileName = data[0].replace(/\\\\/g, "\\");
      if (fileName.startsWith('"') && fileName.endsWith('"')) {
        fileName = fileName.substr(1, fileName.length - 2);
      }
      if (prefix === "---") {
        index.oldFileName = fileName;
        index.oldHeader = header;
      } else {
        index.newFileName = fileName;
        index.newHeader = header;
      }
      i++;
    }
  }
  function parseHunk() {
    var _a2;
    const chunkHeaderIndex = i, chunkHeaderLine = diffstr[i++], chunkHeader = chunkHeaderLine.split(/@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/);
    const hunk = {
      oldStart: +chunkHeader[1],
      oldLines: typeof chunkHeader[2] === "undefined" ? 1 : +chunkHeader[2],
      newStart: +chunkHeader[3],
      newLines: typeof chunkHeader[4] === "undefined" ? 1 : +chunkHeader[4],
      lines: []
    };
    if (hunk.oldLines === 0) {
      hunk.oldStart += 1;
    }
    if (hunk.newLines === 0) {
      hunk.newStart += 1;
    }
    let addCount = 0, removeCount = 0;
    for (; i < diffstr.length && (removeCount < hunk.oldLines || addCount < hunk.newLines || ((_a2 = diffstr[i]) === null || _a2 === void 0 ? void 0 : _a2.startsWith("\\"))); i++) {
      const operation = diffstr[i].length == 0 && i != diffstr.length - 1 ? " " : diffstr[i][0];
      if (operation === "+" || operation === "-" || operation === " " || operation === "\\") {
        hunk.lines.push(diffstr[i]);
        if (operation === "+") {
          addCount++;
        } else if (operation === "-") {
          removeCount++;
        } else if (operation === " ") {
          addCount++;
          removeCount++;
        }
      } else {
        throw new Error(`Hunk at line ${chunkHeaderIndex + 1} contained invalid line ${diffstr[i]}`);
      }
    }
    if (!addCount && hunk.newLines === 1) {
      hunk.newLines = 0;
    }
    if (!removeCount && hunk.oldLines === 1) {
      hunk.oldLines = 0;
    }
    if (addCount !== hunk.newLines) {
      throw new Error("Added line count did not match for hunk at line " + (chunkHeaderIndex + 1));
    }
    if (removeCount !== hunk.oldLines) {
      throw new Error("Removed line count did not match for hunk at line " + (chunkHeaderIndex + 1));
    }
    return hunk;
  }
  while (i < diffstr.length) {
    parseIndex();
  }
  return list;
}

// node_modules/diff/libesm/util/distance-iterator.js
function distance_iterator_default(start, minLine, maxLine) {
  let wantForward = true, backwardExhausted = false, forwardExhausted = false, localOffset = 1;
  return function iterator() {
    if (wantForward && !forwardExhausted) {
      if (backwardExhausted) {
        localOffset++;
      } else {
        wantForward = false;
      }
      if (start + localOffset <= maxLine) {
        return start + localOffset;
      }
      forwardExhausted = true;
    }
    if (!backwardExhausted) {
      if (!forwardExhausted) {
        wantForward = true;
      }
      if (minLine <= start - localOffset) {
        return start - localOffset++;
      }
      backwardExhausted = true;
      return iterator();
    }
    return void 0;
  };
}

// node_modules/diff/libesm/patch/apply.js
function applyPatch(source, patch, options2 = {}) {
  let patches;
  if (typeof patch === "string") {
    patches = parsePatch(patch);
  } else if (Array.isArray(patch)) {
    patches = patch;
  } else {
    patches = [patch];
  }
  if (patches.length > 1) {
    throw new Error("applyPatch only works with a single input.");
  }
  return applyStructuredPatch(source, patches[0], options2);
}
function applyStructuredPatch(source, patch, options2 = {}) {
  if (options2.autoConvertLineEndings || options2.autoConvertLineEndings == null) {
    if (hasOnlyWinLineEndings(source) && isUnix(patch)) {
      patch = unixToWin(patch);
    } else if (hasOnlyUnixLineEndings(source) && isWin(patch)) {
      patch = winToUnix(patch);
    }
  }
  const lines = source.split("\n"), hunks = patch.hunks, compareLine = options2.compareLine || ((lineNumber, line, operation, patchContent) => line === patchContent), fuzzFactor = options2.fuzzFactor || 0;
  let minLine = 0;
  if (fuzzFactor < 0 || !Number.isInteger(fuzzFactor)) {
    throw new Error("fuzzFactor must be a non-negative integer");
  }
  if (!hunks.length) {
    return source;
  }
  let prevLine = "", removeEOFNL = false, addEOFNL = false;
  for (let i = 0; i < hunks[hunks.length - 1].lines.length; i++) {
    const line = hunks[hunks.length - 1].lines[i];
    if (line[0] == "\\") {
      if (prevLine[0] == "+") {
        removeEOFNL = true;
      } else if (prevLine[0] == "-") {
        addEOFNL = true;
      }
    }
    prevLine = line;
  }
  if (removeEOFNL) {
    if (addEOFNL) {
      if (!fuzzFactor && lines[lines.length - 1] == "") {
        return false;
      }
    } else if (lines[lines.length - 1] == "") {
      lines.pop();
    } else if (!fuzzFactor) {
      return false;
    }
  } else if (addEOFNL) {
    if (lines[lines.length - 1] != "") {
      lines.push("");
    } else if (!fuzzFactor) {
      return false;
    }
  }
  function applyHunk(hunkLines, toPos, maxErrors, hunkLinesI = 0, lastContextLineMatched = true, patchedLines = [], patchedLinesLength = 0) {
    let nConsecutiveOldContextLines = 0;
    let nextContextLineMustMatch = false;
    for (; hunkLinesI < hunkLines.length; hunkLinesI++) {
      const hunkLine = hunkLines[hunkLinesI], operation = hunkLine.length > 0 ? hunkLine[0] : " ", content = hunkLine.length > 0 ? hunkLine.substr(1) : hunkLine;
      if (operation === "-") {
        if (compareLine(toPos + 1, lines[toPos], operation, content)) {
          toPos++;
          nConsecutiveOldContextLines = 0;
        } else {
          if (!maxErrors || lines[toPos] == null) {
            return null;
          }
          patchedLines[patchedLinesLength] = lines[toPos];
          return applyHunk(hunkLines, toPos + 1, maxErrors - 1, hunkLinesI, false, patchedLines, patchedLinesLength + 1);
        }
      }
      if (operation === "+") {
        if (!lastContextLineMatched) {
          return null;
        }
        patchedLines[patchedLinesLength] = content;
        patchedLinesLength++;
        nConsecutiveOldContextLines = 0;
        nextContextLineMustMatch = true;
      }
      if (operation === " ") {
        nConsecutiveOldContextLines++;
        patchedLines[patchedLinesLength] = lines[toPos];
        if (compareLine(toPos + 1, lines[toPos], operation, content)) {
          patchedLinesLength++;
          lastContextLineMatched = true;
          nextContextLineMustMatch = false;
          toPos++;
        } else {
          if (nextContextLineMustMatch || !maxErrors) {
            return null;
          }
          return lines[toPos] && (applyHunk(hunkLines, toPos + 1, maxErrors - 1, hunkLinesI + 1, false, patchedLines, patchedLinesLength + 1) || applyHunk(hunkLines, toPos + 1, maxErrors - 1, hunkLinesI, false, patchedLines, patchedLinesLength + 1)) || applyHunk(hunkLines, toPos, maxErrors - 1, hunkLinesI + 1, false, patchedLines, patchedLinesLength);
        }
      }
    }
    patchedLinesLength -= nConsecutiveOldContextLines;
    toPos -= nConsecutiveOldContextLines;
    patchedLines.length = patchedLinesLength;
    return {
      patchedLines,
      oldLineLastI: toPos - 1
    };
  }
  const resultLines = [];
  let prevHunkOffset = 0;
  for (let i = 0; i < hunks.length; i++) {
    const hunk = hunks[i];
    let hunkResult;
    const maxLine = lines.length - hunk.oldLines + fuzzFactor;
    let toPos;
    for (let maxErrors = 0; maxErrors <= fuzzFactor; maxErrors++) {
      toPos = hunk.oldStart + prevHunkOffset - 1;
      const iterator = distance_iterator_default(toPos, minLine, maxLine);
      for (; toPos !== void 0; toPos = iterator()) {
        hunkResult = applyHunk(hunk.lines, toPos, maxErrors);
        if (hunkResult) {
          break;
        }
      }
      if (hunkResult) {
        break;
      }
    }
    if (!hunkResult) {
      return false;
    }
    for (let i2 = minLine; i2 < toPos; i2++) {
      resultLines.push(lines[i2]);
    }
    for (let i2 = 0; i2 < hunkResult.patchedLines.length; i2++) {
      const line = hunkResult.patchedLines[i2];
      resultLines.push(line);
    }
    minLine = hunkResult.oldLineLastI + 1;
    prevHunkOffset = toPos + 1 - hunk.oldStart;
  }
  for (let i = minLine; i < lines.length; i++) {
    resultLines.push(lines[i]);
  }
  return resultLines.join("\n");
}
function applyPatches(uniDiff, options2) {
  const spDiff = typeof uniDiff === "string" ? parsePatch(uniDiff) : uniDiff;
  let currentIndex = 0;
  function processIndex() {
    const index = spDiff[currentIndex++];
    if (!index) {
      return options2.complete();
    }
    options2.loadFile(index, function(err, data) {
      if (err) {
        return options2.complete(err);
      }
      const updatedContent = applyPatch(data, index, options2);
      options2.patched(index, updatedContent, function(err2) {
        if (err2) {
          return options2.complete(err2);
        }
        processIndex();
      });
    });
  }
  processIndex();
}

// node_modules/diff/libesm/patch/reverse.js
function reversePatch(structuredPatch2) {
  if (Array.isArray(structuredPatch2)) {
    return structuredPatch2.map((patch) => reversePatch(patch)).reverse();
  }
  return Object.assign(Object.assign({}, structuredPatch2), { oldFileName: structuredPatch2.newFileName, oldHeader: structuredPatch2.newHeader, newFileName: structuredPatch2.oldFileName, newHeader: structuredPatch2.oldHeader, hunks: structuredPatch2.hunks.map((hunk) => {
    return {
      oldLines: hunk.newLines,
      oldStart: hunk.newStart,
      newLines: hunk.oldLines,
      newStart: hunk.oldStart,
      lines: hunk.lines.map((l) => {
        if (l.startsWith("-")) {
          return `+${l.slice(1)}`;
        }
        if (l.startsWith("+")) {
          return `-${l.slice(1)}`;
        }
        return l;
      })
    };
  }) });
}

// node_modules/diff/libesm/patch/create.js
var INCLUDE_HEADERS = {
  includeIndex: true,
  includeUnderline: true,
  includeFileHeaders: true
};
var FILE_HEADERS_ONLY = {
  includeIndex: false,
  includeUnderline: false,
  includeFileHeaders: true
};
var OMIT_HEADERS = {
  includeIndex: false,
  includeUnderline: false,
  includeFileHeaders: false
};
function structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options2) {
  let optionsObj;
  if (!options2) {
    optionsObj = {};
  } else if (typeof options2 === "function") {
    optionsObj = { callback: options2 };
  } else {
    optionsObj = options2;
  }
  if (typeof optionsObj.context === "undefined") {
    optionsObj.context = 4;
  }
  const context = optionsObj.context;
  if (optionsObj.newlineIsToken) {
    throw new Error("newlineIsToken may not be used with patch-generation functions, only with diffing functions");
  }
  if (!optionsObj.callback) {
    return diffLinesResultToPatch(diffLines(oldStr, newStr, optionsObj));
  } else {
    const { callback } = optionsObj;
    diffLines(oldStr, newStr, Object.assign(Object.assign({}, optionsObj), { callback: (diff2) => {
      const patch = diffLinesResultToPatch(diff2);
      callback(patch);
    } }));
  }
  function diffLinesResultToPatch(diff2) {
    if (!diff2) {
      return;
    }
    diff2.push({ value: "", lines: [] });
    function contextLines(lines) {
      return lines.map(function(entry) {
        return " " + entry;
      });
    }
    const hunks = [];
    let oldRangeStart = 0, newRangeStart = 0, curRange = [], oldLine = 1, newLine = 1;
    for (let i = 0; i < diff2.length; i++) {
      const current = diff2[i], lines = current.lines || splitLines(current.value);
      current.lines = lines;
      if (current.added || current.removed) {
        if (!oldRangeStart) {
          const prev = diff2[i - 1];
          oldRangeStart = oldLine;
          newRangeStart = newLine;
          if (prev) {
            curRange = context > 0 ? contextLines(prev.lines.slice(-context)) : [];
            oldRangeStart -= curRange.length;
            newRangeStart -= curRange.length;
          }
        }
        for (const line of lines) {
          curRange.push((current.added ? "+" : "-") + line);
        }
        if (current.added) {
          newLine += lines.length;
        } else {
          oldLine += lines.length;
        }
      } else {
        if (oldRangeStart) {
          if (lines.length <= context * 2 && i < diff2.length - 2) {
            for (const line of contextLines(lines)) {
              curRange.push(line);
            }
          } else {
            const contextSize = Math.min(lines.length, context);
            for (const line of contextLines(lines.slice(0, contextSize))) {
              curRange.push(line);
            }
            const hunk = {
              oldStart: oldRangeStart,
              oldLines: oldLine - oldRangeStart + contextSize,
              newStart: newRangeStart,
              newLines: newLine - newRangeStart + contextSize,
              lines: curRange
            };
            hunks.push(hunk);
            oldRangeStart = 0;
            newRangeStart = 0;
            curRange = [];
          }
        }
        oldLine += lines.length;
        newLine += lines.length;
      }
    }
    for (const hunk of hunks) {
      for (let i = 0; i < hunk.lines.length; i++) {
        if (hunk.lines[i].endsWith("\n")) {
          hunk.lines[i] = hunk.lines[i].slice(0, -1);
        } else {
          hunk.lines.splice(i + 1, 0, "\\ No newline at end of file");
          i++;
        }
      }
    }
    return {
      oldFileName,
      newFileName,
      oldHeader,
      newHeader,
      hunks
    };
  }
}
function formatPatch(patch, headerOptions) {
  if (!headerOptions) {
    headerOptions = INCLUDE_HEADERS;
  }
  if (Array.isArray(patch)) {
    if (patch.length > 1 && !headerOptions.includeFileHeaders) {
      throw new Error("Cannot omit file headers on a multi-file patch. (The result would be unparseable; how would a tool trying to apply the patch know which changes are to which file?)");
    }
    return patch.map((p) => formatPatch(p, headerOptions)).join("\n");
  }
  const ret = [];
  if (headerOptions.includeIndex && patch.oldFileName == patch.newFileName) {
    ret.push("Index: " + patch.oldFileName);
  }
  if (headerOptions.includeUnderline) {
    ret.push("===================================================================");
  }
  if (headerOptions.includeFileHeaders) {
    ret.push("--- " + patch.oldFileName + (typeof patch.oldHeader === "undefined" ? "" : "	" + patch.oldHeader));
    ret.push("+++ " + patch.newFileName + (typeof patch.newHeader === "undefined" ? "" : "	" + patch.newHeader));
  }
  for (let i = 0; i < patch.hunks.length; i++) {
    const hunk = patch.hunks[i];
    if (hunk.oldLines === 0) {
      hunk.oldStart -= 1;
    }
    if (hunk.newLines === 0) {
      hunk.newStart -= 1;
    }
    ret.push("@@ -" + hunk.oldStart + "," + hunk.oldLines + " +" + hunk.newStart + "," + hunk.newLines + " @@");
    for (const line of hunk.lines) {
      ret.push(line);
    }
  }
  return ret.join("\n") + "\n";
}
function createTwoFilesPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options2) {
  if (typeof options2 === "function") {
    options2 = { callback: options2 };
  }
  if (!(options2 === null || options2 === void 0 ? void 0 : options2.callback)) {
    const patchObj = structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options2);
    if (!patchObj) {
      return;
    }
    return formatPatch(patchObj, options2 === null || options2 === void 0 ? void 0 : options2.headerOptions);
  } else {
    const { callback } = options2;
    structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, Object.assign(Object.assign({}, options2), { callback: (patchObj) => {
      if (!patchObj) {
        callback(void 0);
      } else {
        callback(formatPatch(patchObj, options2.headerOptions));
      }
    } }));
  }
}
function createPatch(fileName, oldStr, newStr, oldHeader, newHeader, options2) {
  return createTwoFilesPatch(fileName, fileName, oldStr, newStr, oldHeader, newHeader, options2);
}
function splitLines(text) {
  const hasTrailingNl = text.endsWith("\n");
  const result = text.split("\n").map((line) => line + "\n");
  if (hasTrailingNl) {
    result.pop();
  } else {
    result.push(result.pop().slice(0, -1));
  }
  return result;
}

// node_modules/diff/libesm/convert/dmp.js
function convertChangesToDMP(changes) {
  const ret = [];
  let change, operation;
  for (let i = 0; i < changes.length; i++) {
    change = changes[i];
    if (change.added) {
      operation = 1;
    } else if (change.removed) {
      operation = -1;
    } else {
      operation = 0;
    }
    ret.push([operation, change.value]);
  }
  return ret;
}

// node_modules/diff/libesm/convert/xml.js
function convertChangesToXML(changes) {
  const ret = [];
  for (let i = 0; i < changes.length; i++) {
    const change = changes[i];
    if (change.added) {
      ret.push("<ins>");
    } else if (change.removed) {
      ret.push("<del>");
    }
    ret.push(escapeHTML(change.value));
    if (change.added) {
      ret.push("</ins>");
    } else if (change.removed) {
      ret.push("</del>");
    }
  }
  return ret.join("");
}
function escapeHTML(s) {
  let n = s;
  n = n.replace(/&/g, "&amp;");
  n = n.replace(/</g, "&lt;");
  n = n.replace(/>/g, "&gt;");
  n = n.replace(/"/g, "&quot;");
  return n;
}

// packages/playwright-core/src/utilsBundle.ts
var import_dotenv = __toESM(require_main());

// node_modules/proxy-from-env/index.js
var DEFAULT_PORTS = {
  ftp: 21,
  gopher: 70,
  http: 80,
  https: 443,
  ws: 80,
  wss: 443
};
function parseUrl(urlString) {
  try {
    return new URL(urlString);
  } catch {
    return null;
  }
}
function getProxyForUrl(url2) {
  var parsedUrl = (typeof url2 === "string" ? parseUrl(url2) : url2) || {};
  var proto = parsedUrl.protocol;
  var hostname3 = parsedUrl.host;
  var port = parsedUrl.port;
  if (typeof hostname3 !== "string" || !hostname3 || typeof proto !== "string") {
    return "";
  }
  proto = proto.split(":", 1)[0];
  hostname3 = hostname3.replace(/:\d*$/, "");
  port = parseInt(port) || DEFAULT_PORTS[proto] || 0;
  if (!shouldProxy(hostname3, port)) {
    return "";
  }
  var proxy = getEnv(proto + "_proxy") || getEnv("all_proxy");
  if (proxy && proxy.indexOf("://") === -1) {
    proxy = proto + "://" + proxy;
  }
  return proxy;
}
function shouldProxy(hostname3, port) {
  var NO_PROXY = getEnv("no_proxy").toLowerCase();
  if (!NO_PROXY) {
    return true;
  }
  if (NO_PROXY === "*") {
    return false;
  }
  return NO_PROXY.split(/[,\s]/).every(function(proxy) {
    if (!proxy) {
      return true;
    }
    var parsedProxy = proxy.match(/^(.+):(\d+)$/);
    var parsedProxyHostname = parsedProxy ? parsedProxy[1] : proxy;
    var parsedProxyPort = parsedProxy ? parseInt(parsedProxy[2]) : 0;
    if (parsedProxyPort && parsedProxyPort !== port) {
      return true;
    }
    if (!/^[.*]/.test(parsedProxyHostname)) {
      return hostname3 !== parsedProxyHostname;
    }
    if (parsedProxyHostname.charAt(0) === "*") {
      parsedProxyHostname = parsedProxyHostname.slice(1);
    }
    return !hostname3.endsWith(parsedProxyHostname);
  });
}
function getEnv(key) {
  return process.env[key.toLowerCase()] || process.env[key.toUpperCase()] || "";
}

// packages/playwright-core/src/utilsBundle.ts
var import_https_proxy_agent = __toESM(require_dist2());
var import_jpeg_js = __toESM(require_jpeg_js());
var import_mime = __toESM(require_mime());
var import_minimatch = __toESM(require_minimatch());
var import_open = __toESM(require_open());
var import_pngjs = __toESM(require_png());

// node_modules/commander/esm.mjs
var import_index = __toESM(require_commander(), 1);
var {
  program,
  createCommand,
  createArgument,
  createOption,
  CommanderError,
  InvalidArgumentError,
  InvalidOptionArgumentError,
  // deprecated old name
  Command,
  Argument,
  Option,
  Help
} = import_index.default;

// packages/playwright-core/src/utilsBundle.ts
var import_progress = __toESM(require_progress());
var import_socks_proxy_agent = __toESM(require_dist3());

// node_modules/ws/wrapper.mjs
var import_stream = __toESM(require_stream(), 1);
var import_receiver = __toESM(require_receiver(), 1);
var import_sender = __toESM(require_sender(), 1);
var import_websocket = __toESM(require_websocket(), 1);
var import_websocket_server = __toESM(require_websocket_server(), 1);
var wrapper_default = import_websocket.default;

// packages/playwright-core/src/utilsBundle.ts
var import_yaml = __toESM(require_dist4());
var import_json5 = __toESM(require_lib());
var import_source_map_support = __toESM(require_source_map_support());
var import_enquirer = __toESM(require_enquirer());
var import_chokidar = __toESM(require_chokidar());

// node_modules/get-east-asian-width/index.js
var get_east_asian_width_exports = {};
__export(get_east_asian_width_exports, {
  _isNarrowWidth: () => _isNarrowWidth,
  eastAsianWidth: () => eastAsianWidth,
  eastAsianWidthType: () => eastAsianWidthType
});

// node_modules/get-east-asian-width/lookup.js
function isAmbiguous(x) {
  return x === 161 || x === 164 || x === 167 || x === 168 || x === 170 || x === 173 || x === 174 || x >= 176 && x <= 180 || x >= 182 && x <= 186 || x >= 188 && x <= 191 || x === 198 || x === 208 || x === 215 || x === 216 || x >= 222 && x <= 225 || x === 230 || x >= 232 && x <= 234 || x === 236 || x === 237 || x === 240 || x === 242 || x === 243 || x >= 247 && x <= 250 || x === 252 || x === 254 || x === 257 || x === 273 || x === 275 || x === 283 || x === 294 || x === 295 || x === 299 || x >= 305 && x <= 307 || x === 312 || x >= 319 && x <= 322 || x === 324 || x >= 328 && x <= 331 || x === 333 || x === 338 || x === 339 || x === 358 || x === 359 || x === 363 || x === 462 || x === 464 || x === 466 || x === 468 || x === 470 || x === 472 || x === 474 || x === 476 || x === 593 || x === 609 || x === 708 || x === 711 || x >= 713 && x <= 715 || x === 717 || x === 720 || x >= 728 && x <= 731 || x === 733 || x === 735 || x >= 768 && x <= 879 || x >= 913 && x <= 929 || x >= 931 && x <= 937 || x >= 945 && x <= 961 || x >= 963 && x <= 969 || x === 1025 || x >= 1040 && x <= 1103 || x === 1105 || x === 8208 || x >= 8211 && x <= 8214 || x === 8216 || x === 8217 || x === 8220 || x === 8221 || x >= 8224 && x <= 8226 || x >= 8228 && x <= 8231 || x === 8240 || x === 8242 || x === 8243 || x === 8245 || x === 8251 || x === 8254 || x === 8308 || x === 8319 || x >= 8321 && x <= 8324 || x === 8364 || x === 8451 || x === 8453 || x === 8457 || x === 8467 || x === 8470 || x === 8481 || x === 8482 || x === 8486 || x === 8491 || x === 8531 || x === 8532 || x >= 8539 && x <= 8542 || x >= 8544 && x <= 8555 || x >= 8560 && x <= 8569 || x === 8585 || x >= 8592 && x <= 8601 || x === 8632 || x === 8633 || x === 8658 || x === 8660 || x === 8679 || x === 8704 || x === 8706 || x === 8707 || x === 8711 || x === 8712 || x === 8715 || x === 8719 || x === 8721 || x === 8725 || x === 8730 || x >= 8733 && x <= 8736 || x === 8739 || x === 8741 || x >= 8743 && x <= 8748 || x === 8750 || x >= 8756 && x <= 8759 || x === 8764 || x === 8765 || x === 8776 || x === 8780 || x === 8786 || x === 8800 || x === 8801 || x >= 8804 && x <= 8807 || x === 8810 || x === 8811 || x === 8814 || x === 8815 || x === 8834 || x === 8835 || x === 8838 || x === 8839 || x === 8853 || x === 8857 || x === 8869 || x === 8895 || x === 8978 || x >= 9312 && x <= 9449 || x >= 9451 && x <= 9547 || x >= 9552 && x <= 9587 || x >= 9600 && x <= 9615 || x >= 9618 && x <= 9621 || x === 9632 || x === 9633 || x >= 9635 && x <= 9641 || x === 9650 || x === 9651 || x === 9654 || x === 9655 || x === 9660 || x === 9661 || x === 9664 || x === 9665 || x >= 9670 && x <= 9672 || x === 9675 || x >= 9678 && x <= 9681 || x >= 9698 && x <= 9701 || x === 9711 || x === 9733 || x === 9734 || x === 9737 || x === 9742 || x === 9743 || x === 9756 || x === 9758 || x === 9792 || x === 9794 || x === 9824 || x === 9825 || x >= 9827 && x <= 9829 || x >= 9831 && x <= 9834 || x === 9836 || x === 9837 || x === 9839 || x === 9886 || x === 9887 || x === 9919 || x >= 9926 && x <= 9933 || x >= 9935 && x <= 9939 || x >= 9941 && x <= 9953 || x === 9955 || x === 9960 || x === 9961 || x >= 9963 && x <= 9969 || x === 9972 || x >= 9974 && x <= 9977 || x === 9979 || x === 9980 || x === 9982 || x === 9983 || x === 10045 || x >= 10102 && x <= 10111 || x >= 11094 && x <= 11097 || x >= 12872 && x <= 12879 || x >= 57344 && x <= 63743 || x >= 65024 && x <= 65039 || x === 65533 || x >= 127232 && x <= 127242 || x >= 127248 && x <= 127277 || x >= 127280 && x <= 127337 || x >= 127344 && x <= 127373 || x === 127375 || x === 127376 || x >= 127387 && x <= 127404 || x >= 917760 && x <= 917999 || x >= 983040 && x <= 1048573 || x >= 1048576 && x <= 1114109;
}
function isFullWidth(x) {
  return x === 12288 || x >= 65281 && x <= 65376 || x >= 65504 && x <= 65510;
}
function isWide(x) {
  return x >= 4352 && x <= 4447 || x === 8986 || x === 8987 || x === 9001 || x === 9002 || x >= 9193 && x <= 9196 || x === 9200 || x === 9203 || x === 9725 || x === 9726 || x === 9748 || x === 9749 || x >= 9776 && x <= 9783 || x >= 9800 && x <= 9811 || x === 9855 || x >= 9866 && x <= 9871 || x === 9875 || x === 9889 || x === 9898 || x === 9899 || x === 9917 || x === 9918 || x === 9924 || x === 9925 || x === 9934 || x === 9940 || x === 9962 || x === 9970 || x === 9971 || x === 9973 || x === 9978 || x === 9981 || x === 9989 || x === 9994 || x === 9995 || x === 10024 || x === 10060 || x === 10062 || x >= 10067 && x <= 10069 || x === 10071 || x >= 10133 && x <= 10135 || x === 10160 || x === 10175 || x === 11035 || x === 11036 || x === 11088 || x === 11093 || x >= 11904 && x <= 11929 || x >= 11931 && x <= 12019 || x >= 12032 && x <= 12245 || x >= 12272 && x <= 12287 || x >= 12289 && x <= 12350 || x >= 12353 && x <= 12438 || x >= 12441 && x <= 12543 || x >= 12549 && x <= 12591 || x >= 12593 && x <= 12686 || x >= 12688 && x <= 12773 || x >= 12783 && x <= 12830 || x >= 12832 && x <= 12871 || x >= 12880 && x <= 42124 || x >= 42128 && x <= 42182 || x >= 43360 && x <= 43388 || x >= 44032 && x <= 55203 || x >= 63744 && x <= 64255 || x >= 65040 && x <= 65049 || x >= 65072 && x <= 65106 || x >= 65108 && x <= 65126 || x >= 65128 && x <= 65131 || x >= 94176 && x <= 94180 || x === 94192 || x === 94193 || x >= 94208 && x <= 100343 || x >= 100352 && x <= 101589 || x >= 101631 && x <= 101640 || x >= 110576 && x <= 110579 || x >= 110581 && x <= 110587 || x === 110589 || x === 110590 || x >= 110592 && x <= 110882 || x === 110898 || x >= 110928 && x <= 110930 || x === 110933 || x >= 110948 && x <= 110951 || x >= 110960 && x <= 111355 || x >= 119552 && x <= 119638 || x >= 119648 && x <= 119670 || x === 126980 || x === 127183 || x === 127374 || x >= 127377 && x <= 127386 || x >= 127488 && x <= 127490 || x >= 127504 && x <= 127547 || x >= 127552 && x <= 127560 || x === 127568 || x === 127569 || x >= 127584 && x <= 127589 || x >= 127744 && x <= 127776 || x >= 127789 && x <= 127797 || x >= 127799 && x <= 127868 || x >= 127870 && x <= 127891 || x >= 127904 && x <= 127946 || x >= 127951 && x <= 127955 || x >= 127968 && x <= 127984 || x === 127988 || x >= 127992 && x <= 128062 || x === 128064 || x >= 128066 && x <= 128252 || x >= 128255 && x <= 128317 || x >= 128331 && x <= 128334 || x >= 128336 && x <= 128359 || x === 128378 || x === 128405 || x === 128406 || x === 128420 || x >= 128507 && x <= 128591 || x >= 128640 && x <= 128709 || x === 128716 || x >= 128720 && x <= 128722 || x >= 128725 && x <= 128727 || x >= 128732 && x <= 128735 || x === 128747 || x === 128748 || x >= 128756 && x <= 128764 || x >= 128992 && x <= 129003 || x === 129008 || x >= 129292 && x <= 129338 || x >= 129340 && x <= 129349 || x >= 129351 && x <= 129535 || x >= 129648 && x <= 129660 || x >= 129664 && x <= 129673 || x >= 129679 && x <= 129734 || x >= 129742 && x <= 129756 || x >= 129759 && x <= 129769 || x >= 129776 && x <= 129784 || x >= 131072 && x <= 196605 || x >= 196608 && x <= 262141;
}
function getCategory(x) {
  if (isAmbiguous(x)) return "ambiguous";
  if (isFullWidth(x)) return "fullwidth";
  if (x === 8361 || x >= 65377 && x <= 65470 || x >= 65474 && x <= 65479 || x >= 65482 && x <= 65487 || x >= 65490 && x <= 65495 || x >= 65498 && x <= 65500 || x >= 65512 && x <= 65518) {
    return "halfwidth";
  }
  if (x >= 32 && x <= 126 || x === 162 || x === 163 || x === 165 || x === 166 || x === 172 || x === 175 || x >= 10214 && x <= 10221 || x === 10629 || x === 10630) {
    return "narrow";
  }
  if (isWide(x)) return "wide";
  return "neutral";
}

// node_modules/get-east-asian-width/index.js
function validate(codePoint) {
  if (!Number.isSafeInteger(codePoint)) {
    throw new TypeError(`Expected a code point, got \`${typeof codePoint}\`.`);
  }
}
function eastAsianWidthType(codePoint) {
  validate(codePoint);
  return getCategory(codePoint);
}
function eastAsianWidth(codePoint, { ambiguousAsWide = false } = {}) {
  validate(codePoint);
  if (isFullWidth(codePoint) || isWide(codePoint) || ambiguousAsWide && isAmbiguous(codePoint)) {
    return 2;
  }
  return 1;
}
var _isNarrowWidth = (codePoint) => !(isFullWidth(codePoint) || isWide(codePoint));

// packages/playwright-core/src/utilsBundle.ts
var yazl = __toESM(require_yazl());
var yauzl = __toESM(require_yauzl());
var gracefulFsLibrary = __toESM(require_graceful_fs());
var import_retry = __toESM(require_retry2());
var import_signal_exit = __toESM(require_signal_exit());
var import_get_stream = __toESM(require_get_stream());
var import_https_proxy_agent2 = __toESM(require_dist2());
var import_socks_proxy_agent2 = __toESM(require_dist3());

// node_modules/zod/index.js
var zod_exports = {};
__export(zod_exports, {
  $brand: () => $brand,
  $input: () => $input,
  $output: () => $output,
  NEVER: () => NEVER,
  TimePrecision: () => TimePrecision,
  ZodAny: () => ZodAny,
  ZodArray: () => ZodArray,
  ZodBase64: () => ZodBase64,
  ZodBase64URL: () => ZodBase64URL,
  ZodBigInt: () => ZodBigInt,
  ZodBigIntFormat: () => ZodBigIntFormat,
  ZodBoolean: () => ZodBoolean,
  ZodCIDRv4: () => ZodCIDRv4,
  ZodCIDRv6: () => ZodCIDRv6,
  ZodCUID: () => ZodCUID,
  ZodCUID2: () => ZodCUID2,
  ZodCatch: () => ZodCatch,
  ZodCodec: () => ZodCodec,
  ZodCustom: () => ZodCustom,
  ZodCustomStringFormat: () => ZodCustomStringFormat,
  ZodDate: () => ZodDate,
  ZodDefault: () => ZodDefault,
  ZodDiscriminatedUnion: () => ZodDiscriminatedUnion,
  ZodE164: () => ZodE164,
  ZodEmail: () => ZodEmail,
  ZodEmoji: () => ZodEmoji,
  ZodEnum: () => ZodEnum,
  ZodError: () => ZodError,
  ZodExactOptional: () => ZodExactOptional,
  ZodFile: () => ZodFile,
  ZodFirstPartyTypeKind: () => ZodFirstPartyTypeKind,
  ZodFunction: () => ZodFunction,
  ZodGUID: () => ZodGUID,
  ZodIPv4: () => ZodIPv4,
  ZodIPv6: () => ZodIPv6,
  ZodISODate: () => ZodISODate,
  ZodISODateTime: () => ZodISODateTime,
  ZodISODuration: () => ZodISODuration,
  ZodISOTime: () => ZodISOTime,
  ZodIntersection: () => ZodIntersection,
  ZodIssueCode: () => ZodIssueCode,
  ZodJWT: () => ZodJWT,
  ZodKSUID: () => ZodKSUID,
  ZodLazy: () => ZodLazy,
  ZodLiteral: () => ZodLiteral,
  ZodMAC: () => ZodMAC,
  ZodMap: () => ZodMap,
  ZodNaN: () => ZodNaN,
  ZodNanoID: () => ZodNanoID,
  ZodNever: () => ZodNever,
  ZodNonOptional: () => ZodNonOptional,
  ZodNull: () => ZodNull,
  ZodNullable: () => ZodNullable,
  ZodNumber: () => ZodNumber,
  ZodNumberFormat: () => ZodNumberFormat,
  ZodObject: () => ZodObject,
  ZodOptional: () => ZodOptional,
  ZodPipe: () => ZodPipe,
  ZodPrefault: () => ZodPrefault,
  ZodPromise: () => ZodPromise,
  ZodReadonly: () => ZodReadonly,
  ZodRealError: () => ZodRealError,
  ZodRecord: () => ZodRecord,
  ZodSet: () => ZodSet,
  ZodString: () => ZodString,
  ZodStringFormat: () => ZodStringFormat,
  ZodSuccess: () => ZodSuccess,
  ZodSymbol: () => ZodSymbol,
  ZodTemplateLiteral: () => ZodTemplateLiteral,
  ZodTransform: () => ZodTransform,
  ZodTuple: () => ZodTuple,
  ZodType: () => ZodType,
  ZodULID: () => ZodULID,
  ZodURL: () => ZodURL,
  ZodUUID: () => ZodUUID,
  ZodUndefined: () => ZodUndefined,
  ZodUnion: () => ZodUnion,
  ZodUnknown: () => ZodUnknown,
  ZodVoid: () => ZodVoid,
  ZodXID: () => ZodXID,
  ZodXor: () => ZodXor,
  _ZodString: () => _ZodString,
  _default: () => _default2,
  _function: () => _function,
  any: () => any,
  array: () => array,
  base64: () => base642,
  base64url: () => base64url2,
  bigint: () => bigint2,
  boolean: () => boolean2,
  catch: () => _catch2,
  check: () => check,
  cidrv4: () => cidrv42,
  cidrv6: () => cidrv62,
  clone: () => clone,
  codec: () => codec,
  coerce: () => coerce_exports,
  config: () => config,
  core: () => core_exports2,
  cuid: () => cuid3,
  cuid2: () => cuid22,
  custom: () => custom,
  date: () => date3,
  decode: () => decode2,
  decodeAsync: () => decodeAsync2,
  default: () => zod_default,
  describe: () => describe2,
  discriminatedUnion: () => discriminatedUnion,
  e164: () => e1642,
  email: () => email2,
  emoji: () => emoji2,
  encode: () => encode2,
  encodeAsync: () => encodeAsync2,
  endsWith: () => _endsWith,
  enum: () => _enum2,
  exactOptional: () => exactOptional,
  file: () => file,
  flattenError: () => flattenError,
  float32: () => float32,
  float64: () => float64,
  formatError: () => formatError,
  fromJSONSchema: () => fromJSONSchema,
  function: () => _function,
  getErrorMap: () => getErrorMap,
  globalRegistry: () => globalRegistry,
  gt: () => _gt,
  gte: () => _gte,
  guid: () => guid2,
  hash: () => hash,
  hex: () => hex2,
  hostname: () => hostname2,
  httpUrl: () => httpUrl,
  includes: () => _includes,
  instanceof: () => _instanceof,
  int: () => int,
  int32: () => int32,
  int64: () => int64,
  intersection: () => intersection,
  ipv4: () => ipv42,
  ipv6: () => ipv62,
  iso: () => iso_exports,
  json: () => json,
  jwt: () => jwt,
  keyof: () => keyof,
  ksuid: () => ksuid2,
  lazy: () => lazy,
  length: () => _length,
  literal: () => literal,
  locales: () => locales_exports,
  looseObject: () => looseObject,
  looseRecord: () => looseRecord,
  lowercase: () => _lowercase,
  lt: () => _lt,
  lte: () => _lte,
  mac: () => mac2,
  map: () => map,
  maxLength: () => _maxLength,
  maxSize: () => _maxSize,
  meta: () => meta2,
  mime: () => _mime,
  minLength: () => _minLength,
  minSize: () => _minSize,
  multipleOf: () => _multipleOf,
  nan: () => nan,
  nanoid: () => nanoid2,
  nativeEnum: () => nativeEnum,
  negative: () => _negative,
  never: () => never,
  nonnegative: () => _nonnegative,
  nonoptional: () => nonoptional,
  nonpositive: () => _nonpositive,
  normalize: () => _normalize,
  null: () => _null3,
  nullable: () => nullable,
  nullish: () => nullish2,
  number: () => number2,
  object: () => object,
  optional: () => optional,
  overwrite: () => _overwrite,
  parse: () => parse2,
  parseAsync: () => parseAsync2,
  partialRecord: () => partialRecord,
  pipe: () => pipe,
  positive: () => _positive,
  prefault: () => prefault,
  preprocess: () => preprocess,
  prettifyError: () => prettifyError,
  promise: () => promise,
  property: () => _property,
  readonly: () => readonly,
  record: () => record,
  refine: () => refine,
  regex: () => _regex,
  regexes: () => regexes_exports,
  registry: () => registry,
  safeDecode: () => safeDecode2,
  safeDecodeAsync: () => safeDecodeAsync2,
  safeEncode: () => safeEncode2,
  safeEncodeAsync: () => safeEncodeAsync2,
  safeParse: () => safeParse2,
  safeParseAsync: () => safeParseAsync2,
  set: () => set,
  setErrorMap: () => setErrorMap,
  size: () => _size,
  slugify: () => _slugify,
  startsWith: () => _startsWith,
  strictObject: () => strictObject,
  string: () => string2,
  stringFormat: () => stringFormat,
  stringbool: () => stringbool,
  success: () => success,
  superRefine: () => superRefine,
  symbol: () => symbol,
  templateLiteral: () => templateLiteral,
  toJSONSchema: () => toJSONSchema,
  toLowerCase: () => _toLowerCase,
  toUpperCase: () => _toUpperCase,
  transform: () => transform,
  treeifyError: () => treeifyError,
  trim: () => _trim,
  tuple: () => tuple,
  uint32: () => uint32,
  uint64: () => uint64,
  ulid: () => ulid2,
  undefined: () => _undefined3,
  union: () => union,
  unknown: () => unknown,
  uppercase: () => _uppercase,
  url: () => url,
  util: () => util_exports,
  uuid: () => uuid2,
  uuidv4: () => uuidv4,
  uuidv6: () => uuidv6,
  uuidv7: () => uuidv7,
  void: () => _void2,
  xid: () => xid2,
  xor: () => xor,
  z: () => external_exports
});

// node_modules/zod/v4/classic/external.js
var external_exports = {};
__export(external_exports, {
  $brand: () => $brand,
  $input: () => $input,
  $output: () => $output,
  NEVER: () => NEVER,
  TimePrecision: () => TimePrecision,
  ZodAny: () => ZodAny,
  ZodArray: () => ZodArray,
  ZodBase64: () => ZodBase64,
  ZodBase64URL: () => ZodBase64URL,
  ZodBigInt: () => ZodBigInt,
  ZodBigIntFormat: () => ZodBigIntFormat,
  ZodBoolean: () => ZodBoolean,
  ZodCIDRv4: () => ZodCIDRv4,
  ZodCIDRv6: () => ZodCIDRv6,
  ZodCUID: () => ZodCUID,
  ZodCUID2: () => ZodCUID2,
  ZodCatch: () => ZodCatch,
  ZodCodec: () => ZodCodec,
  ZodCustom: () => ZodCustom,
  ZodCustomStringFormat: () => ZodCustomStringFormat,
  ZodDate: () => ZodDate,
  ZodDefault: () => ZodDefault,
  ZodDiscriminatedUnion: () => ZodDiscriminatedUnion,
  ZodE164: () => ZodE164,
  ZodEmail: () => ZodEmail,
  ZodEmoji: () => ZodEmoji,
  ZodEnum: () => ZodEnum,
  ZodError: () => ZodError,
  ZodExactOptional: () => ZodExactOptional,
  ZodFile: () => ZodFile,
  ZodFirstPartyTypeKind: () => ZodFirstPartyTypeKind,
  ZodFunction: () => ZodFunction,
  ZodGUID: () => ZodGUID,
  ZodIPv4: () => ZodIPv4,
  ZodIPv6: () => ZodIPv6,
  ZodISODate: () => ZodISODate,
  ZodISODateTime: () => ZodISODateTime,
  ZodISODuration: () => ZodISODuration,
  ZodISOTime: () => ZodISOTime,
  ZodIntersection: () => ZodIntersection,
  ZodIssueCode: () => ZodIssueCode,
  ZodJWT: () => ZodJWT,
  ZodKSUID: () => ZodKSUID,
  ZodLazy: () => ZodLazy,
  ZodLiteral: () => ZodLiteral,
  ZodMAC: () => ZodMAC,
  ZodMap: () => ZodMap,
  ZodNaN: () => ZodNaN,
  ZodNanoID: () => ZodNanoID,
  ZodNever: () => ZodNever,
  ZodNonOptional: () => ZodNonOptional,
  ZodNull: () => ZodNull,
  ZodNullable: () => ZodNullable,
  ZodNumber: () => ZodNumber,
  ZodNumberFormat: () => ZodNumberFormat,
  ZodObject: () => ZodObject,
  ZodOptional: () => ZodOptional,
  ZodPipe: () => ZodPipe,
  ZodPrefault: () => ZodPrefault,
  ZodPromise: () => ZodPromise,
  ZodReadonly: () => ZodReadonly,
  ZodRealError: () => ZodRealError,
  ZodRecord: () => ZodRecord,
  ZodSet: () => ZodSet,
  ZodString: () => ZodString,
  ZodStringFormat: () => ZodStringFormat,
  ZodSuccess: () => ZodSuccess,
  ZodSymbol: () => ZodSymbol,
  ZodTemplateLiteral: () => ZodTemplateLiteral,
  ZodTransform: () => ZodTransform,
  ZodTuple: () => ZodTuple,
  ZodType: () => ZodType,
  ZodULID: () => ZodULID,
  ZodURL: () => ZodURL,
  ZodUUID: () => ZodUUID,
  ZodUndefined: () => ZodUndefined,
  ZodUnion: () => ZodUnion,
  ZodUnknown: () => ZodUnknown,
  ZodVoid: () => ZodVoid,
  ZodXID: () => ZodXID,
  ZodXor: () => ZodXor,
  _ZodString: () => _ZodString,
  _default: () => _default2,
  _function: () => _function,
  any: () => any,
  array: () => array,
  base64: () => base642,
  base64url: () => base64url2,
  bigint: () => bigint2,
  boolean: () => boolean2,
  catch: () => _catch2,
  check: () => check,
  cidrv4: () => cidrv42,
  cidrv6: () => cidrv62,
  clone: () => clone,
  codec: () => codec,
  coerce: () => coerce_exports,
  config: () => config,
  core: () => core_exports2,
  cuid: () => cuid3,
  cuid2: () => cuid22,
  custom: () => custom,
  date: () => date3,
  decode: () => decode2,
  decodeAsync: () => decodeAsync2,
  describe: () => describe2,
  discriminatedUnion: () => discriminatedUnion,
  e164: () => e1642,
  email: () => email2,
  emoji: () => emoji2,
  encode: () => encode2,
  encodeAsync: () => encodeAsync2,
  endsWith: () => _endsWith,
  enum: () => _enum2,
  exactOptional: () => exactOptional,
  file: () => file,
  flattenError: () => flattenError,
  float32: () => float32,
  float64: () => float64,
  formatError: () => formatError,
  fromJSONSchema: () => fromJSONSchema,
  function: () => _function,
  getErrorMap: () => getErrorMap,
  globalRegistry: () => globalRegistry,
  gt: () => _gt,
  gte: () => _gte,
  guid: () => guid2,
  hash: () => hash,
  hex: () => hex2,
  hostname: () => hostname2,
  httpUrl: () => httpUrl,
  includes: () => _includes,
  instanceof: () => _instanceof,
  int: () => int,
  int32: () => int32,
  int64: () => int64,
  intersection: () => intersection,
  ipv4: () => ipv42,
  ipv6: () => ipv62,
  iso: () => iso_exports,
  json: () => json,
  jwt: () => jwt,
  keyof: () => keyof,
  ksuid: () => ksuid2,
  lazy: () => lazy,
  length: () => _length,
  literal: () => literal,
  locales: () => locales_exports,
  looseObject: () => looseObject,
  looseRecord: () => looseRecord,
  lowercase: () => _lowercase,
  lt: () => _lt,
  lte: () => _lte,
  mac: () => mac2,
  map: () => map,
  maxLength: () => _maxLength,
  maxSize: () => _maxSize,
  meta: () => meta2,
  mime: () => _mime,
  minLength: () => _minLength,
  minSize: () => _minSize,
  multipleOf: () => _multipleOf,
  nan: () => nan,
  nanoid: () => nanoid2,
  nativeEnum: () => nativeEnum,
  negative: () => _negative,
  never: () => never,
  nonnegative: () => _nonnegative,
  nonoptional: () => nonoptional,
  nonpositive: () => _nonpositive,
  normalize: () => _normalize,
  null: () => _null3,
  nullable: () => nullable,
  nullish: () => nullish2,
  number: () => number2,
  object: () => object,
  optional: () => optional,
  overwrite: () => _overwrite,
  parse: () => parse2,
  parseAsync: () => parseAsync2,
  partialRecord: () => partialRecord,
  pipe: () => pipe,
  positive: () => _positive,
  prefault: () => prefault,
  preprocess: () => preprocess,
  prettifyError: () => prettifyError,
  promise: () => promise,
  property: () => _property,
  readonly: () => readonly,
  record: () => record,
  refine: () => refine,
  regex: () => _regex,
  regexes: () => regexes_exports,
  registry: () => registry,
  safeDecode: () => safeDecode2,
  safeDecodeAsync: () => safeDecodeAsync2,
  safeEncode: () => safeEncode2,
  safeEncodeAsync: () => safeEncodeAsync2,
  safeParse: () => safeParse2,
  safeParseAsync: () => safeParseAsync2,
  set: () => set,
  setErrorMap: () => setErrorMap,
  size: () => _size,
  slugify: () => _slugify,
  startsWith: () => _startsWith,
  strictObject: () => strictObject,
  string: () => string2,
  stringFormat: () => stringFormat,
  stringbool: () => stringbool,
  success: () => success,
  superRefine: () => superRefine,
  symbol: () => symbol,
  templateLiteral: () => templateLiteral,
  toJSONSchema: () => toJSONSchema,
  toLowerCase: () => _toLowerCase,
  toUpperCase: () => _toUpperCase,
  transform: () => transform,
  treeifyError: () => treeifyError,
  trim: () => _trim,
  tuple: () => tuple,
  uint32: () => uint32,
  uint64: () => uint64,
  ulid: () => ulid2,
  undefined: () => _undefined3,
  union: () => union,
  unknown: () => unknown,
  uppercase: () => _uppercase,
  url: () => url,
  util: () => util_exports,
  uuid: () => uuid2,
  uuidv4: () => uuidv4,
  uuidv6: () => uuidv6,
  uuidv7: () => uuidv7,
  void: () => _void2,
  xid: () => xid2,
  xor: () => xor
});

// node_modules/zod/v4/core/index.js
var core_exports2 = {};
__export(core_exports2, {
  $ZodAny: () => $ZodAny,
  $ZodArray: () => $ZodArray,
  $ZodAsyncError: () => $ZodAsyncError,
  $ZodBase64: () => $ZodBase64,
  $ZodBase64URL: () => $ZodBase64URL,
  $ZodBigInt: () => $ZodBigInt,
  $ZodBigIntFormat: () => $ZodBigIntFormat,
  $ZodBoolean: () => $ZodBoolean,
  $ZodCIDRv4: () => $ZodCIDRv4,
  $ZodCIDRv6: () => $ZodCIDRv6,
  $ZodCUID: () => $ZodCUID,
  $ZodCUID2: () => $ZodCUID2,
  $ZodCatch: () => $ZodCatch,
  $ZodCheck: () => $ZodCheck,
  $ZodCheckBigIntFormat: () => $ZodCheckBigIntFormat,
  $ZodCheckEndsWith: () => $ZodCheckEndsWith,
  $ZodCheckGreaterThan: () => $ZodCheckGreaterThan,
  $ZodCheckIncludes: () => $ZodCheckIncludes,
  $ZodCheckLengthEquals: () => $ZodCheckLengthEquals,
  $ZodCheckLessThan: () => $ZodCheckLessThan,
  $ZodCheckLowerCase: () => $ZodCheckLowerCase,
  $ZodCheckMaxLength: () => $ZodCheckMaxLength,
  $ZodCheckMaxSize: () => $ZodCheckMaxSize,
  $ZodCheckMimeType: () => $ZodCheckMimeType,
  $ZodCheckMinLength: () => $ZodCheckMinLength,
  $ZodCheckMinSize: () => $ZodCheckMinSize,
  $ZodCheckMultipleOf: () => $ZodCheckMultipleOf,
  $ZodCheckNumberFormat: () => $ZodCheckNumberFormat,
  $ZodCheckOverwrite: () => $ZodCheckOverwrite,
  $ZodCheckProperty: () => $ZodCheckProperty,
  $ZodCheckRegex: () => $ZodCheckRegex,
  $ZodCheckSizeEquals: () => $ZodCheckSizeEquals,
  $ZodCheckStartsWith: () => $ZodCheckStartsWith,
  $ZodCheckStringFormat: () => $ZodCheckStringFormat,
  $ZodCheckUpperCase: () => $ZodCheckUpperCase,
  $ZodCodec: () => $ZodCodec,
  $ZodCustom: () => $ZodCustom,
  $ZodCustomStringFormat: () => $ZodCustomStringFormat,
  $ZodDate: () => $ZodDate,
  $ZodDefault: () => $ZodDefault,
  $ZodDiscriminatedUnion: () => $ZodDiscriminatedUnion,
  $ZodE164: () => $ZodE164,
  $ZodEmail: () => $ZodEmail,
  $ZodEmoji: () => $ZodEmoji,
  $ZodEncodeError: () => $ZodEncodeError,
  $ZodEnum: () => $ZodEnum,
  $ZodError: () => $ZodError,
  $ZodExactOptional: () => $ZodExactOptional,
  $ZodFile: () => $ZodFile,
  $ZodFunction: () => $ZodFunction,
  $ZodGUID: () => $ZodGUID,
  $ZodIPv4: () => $ZodIPv4,
  $ZodIPv6: () => $ZodIPv6,
  $ZodISODate: () => $ZodISODate,
  $ZodISODateTime: () => $ZodISODateTime,
  $ZodISODuration: () => $ZodISODuration,
  $ZodISOTime: () => $ZodISOTime,
  $ZodIntersection: () => $ZodIntersection,
  $ZodJWT: () => $ZodJWT,
  $ZodKSUID: () => $ZodKSUID,
  $ZodLazy: () => $ZodLazy,
  $ZodLiteral: () => $ZodLiteral,
  $ZodMAC: () => $ZodMAC,
  $ZodMap: () => $ZodMap,
  $ZodNaN: () => $ZodNaN,
  $ZodNanoID: () => $ZodNanoID,
  $ZodNever: () => $ZodNever,
  $ZodNonOptional: () => $ZodNonOptional,
  $ZodNull: () => $ZodNull,
  $ZodNullable: () => $ZodNullable,
  $ZodNumber: () => $ZodNumber,
  $ZodNumberFormat: () => $ZodNumberFormat,
  $ZodObject: () => $ZodObject,
  $ZodObjectJIT: () => $ZodObjectJIT,
  $ZodOptional: () => $ZodOptional,
  $ZodPipe: () => $ZodPipe,
  $ZodPrefault: () => $ZodPrefault,
  $ZodPromise: () => $ZodPromise,
  $ZodReadonly: () => $ZodReadonly,
  $ZodRealError: () => $ZodRealError,
  $ZodRecord: () => $ZodRecord,
  $ZodRegistry: () => $ZodRegistry,
  $ZodSet: () => $ZodSet,
  $ZodString: () => $ZodString,
  $ZodStringFormat: () => $ZodStringFormat,
  $ZodSuccess: () => $ZodSuccess,
  $ZodSymbol: () => $ZodSymbol,
  $ZodTemplateLiteral: () => $ZodTemplateLiteral,
  $ZodTransform: () => $ZodTransform,
  $ZodTuple: () => $ZodTuple,
  $ZodType: () => $ZodType,
  $ZodULID: () => $ZodULID,
  $ZodURL: () => $ZodURL,
  $ZodUUID: () => $ZodUUID,
  $ZodUndefined: () => $ZodUndefined,
  $ZodUnion: () => $ZodUnion,
  $ZodUnknown: () => $ZodUnknown,
  $ZodVoid: () => $ZodVoid,
  $ZodXID: () => $ZodXID,
  $ZodXor: () => $ZodXor,
  $brand: () => $brand,
  $constructor: () => $constructor,
  $input: () => $input,
  $output: () => $output,
  Doc: () => Doc,
  JSONSchema: () => json_schema_exports,
  JSONSchemaGenerator: () => JSONSchemaGenerator,
  NEVER: () => NEVER,
  TimePrecision: () => TimePrecision,
  _any: () => _any,
  _array: () => _array,
  _base64: () => _base64,
  _base64url: () => _base64url,
  _bigint: () => _bigint,
  _boolean: () => _boolean,
  _catch: () => _catch,
  _check: () => _check,
  _cidrv4: () => _cidrv4,
  _cidrv6: () => _cidrv6,
  _coercedBigint: () => _coercedBigint,
  _coercedBoolean: () => _coercedBoolean,
  _coercedDate: () => _coercedDate,
  _coercedNumber: () => _coercedNumber,
  _coercedString: () => _coercedString,
  _cuid: () => _cuid,
  _cuid2: () => _cuid2,
  _custom: () => _custom,
  _date: () => _date,
  _decode: () => _decode,
  _decodeAsync: () => _decodeAsync,
  _default: () => _default,
  _discriminatedUnion: () => _discriminatedUnion,
  _e164: () => _e164,
  _email: () => _email,
  _emoji: () => _emoji2,
  _encode: () => _encode,
  _encodeAsync: () => _encodeAsync,
  _endsWith: () => _endsWith,
  _enum: () => _enum,
  _file: () => _file,
  _float32: () => _float32,
  _float64: () => _float64,
  _gt: () => _gt,
  _gte: () => _gte,
  _guid: () => _guid,
  _includes: () => _includes,
  _int: () => _int,
  _int32: () => _int32,
  _int64: () => _int64,
  _intersection: () => _intersection,
  _ipv4: () => _ipv4,
  _ipv6: () => _ipv6,
  _isoDate: () => _isoDate,
  _isoDateTime: () => _isoDateTime,
  _isoDuration: () => _isoDuration,
  _isoTime: () => _isoTime,
  _jwt: () => _jwt,
  _ksuid: () => _ksuid,
  _lazy: () => _lazy,
  _length: () => _length,
  _literal: () => _literal,
  _lowercase: () => _lowercase,
  _lt: () => _lt,
  _lte: () => _lte,
  _mac: () => _mac,
  _map: () => _map,
  _max: () => _lte,
  _maxLength: () => _maxLength,
  _maxSize: () => _maxSize,
  _mime: () => _mime,
  _min: () => _gte,
  _minLength: () => _minLength,
  _minSize: () => _minSize,
  _multipleOf: () => _multipleOf,
  _nan: () => _nan,
  _nanoid: () => _nanoid,
  _nativeEnum: () => _nativeEnum,
  _negative: () => _negative,
  _never: () => _never,
  _nonnegative: () => _nonnegative,
  _nonoptional: () => _nonoptional,
  _nonpositive: () => _nonpositive,
  _normalize: () => _normalize,
  _null: () => _null2,
  _nullable: () => _nullable,
  _number: () => _number,
  _optional: () => _optional,
  _overwrite: () => _overwrite,
  _parse: () => _parse,
  _parseAsync: () => _parseAsync,
  _pipe: () => _pipe,
  _positive: () => _positive,
  _promise: () => _promise,
  _property: () => _property,
  _readonly: () => _readonly,
  _record: () => _record,
  _refine: () => _refine,
  _regex: () => _regex,
  _safeDecode: () => _safeDecode,
  _safeDecodeAsync: () => _safeDecodeAsync,
  _safeEncode: () => _safeEncode,
  _safeEncodeAsync: () => _safeEncodeAsync,
  _safeParse: () => _safeParse,
  _safeParseAsync: () => _safeParseAsync,
  _set: () => _set,
  _size: () => _size,
  _slugify: () => _slugify,
  _startsWith: () => _startsWith,
  _string: () => _string,
  _stringFormat: () => _stringFormat,
  _stringbool: () => _stringbool,
  _success: () => _success,
  _superRefine: () => _superRefine,
  _symbol: () => _symbol,
  _templateLiteral: () => _templateLiteral,
  _toLowerCase: () => _toLowerCase,
  _toUpperCase: () => _toUpperCase,
  _transform: () => _transform,
  _trim: () => _trim,
  _tuple: () => _tuple,
  _uint32: () => _uint32,
  _uint64: () => _uint64,
  _ulid: () => _ulid,
  _undefined: () => _undefined2,
  _union: () => _union,
  _unknown: () => _unknown,
  _uppercase: () => _uppercase,
  _url: () => _url,
  _uuid: () => _uuid,
  _uuidv4: () => _uuidv4,
  _uuidv6: () => _uuidv6,
  _uuidv7: () => _uuidv7,
  _void: () => _void,
  _xid: () => _xid,
  _xor: () => _xor,
  clone: () => clone,
  config: () => config,
  createStandardJSONSchemaMethod: () => createStandardJSONSchemaMethod,
  createToJSONSchemaMethod: () => createToJSONSchemaMethod,
  decode: () => decode,
  decodeAsync: () => decodeAsync,
  describe: () => describe,
  encode: () => encode,
  encodeAsync: () => encodeAsync,
  extractDefs: () => extractDefs,
  finalize: () => finalize,
  flattenError: () => flattenError,
  formatError: () => formatError,
  globalConfig: () => globalConfig,
  globalRegistry: () => globalRegistry,
  initializeContext: () => initializeContext,
  isValidBase64: () => isValidBase64,
  isValidBase64URL: () => isValidBase64URL,
  isValidJWT: () => isValidJWT,
  locales: () => locales_exports,
  meta: () => meta,
  parse: () => parse,
  parseAsync: () => parseAsync,
  prettifyError: () => prettifyError,
  process: () => process2,
  regexes: () => regexes_exports,
  registry: () => registry,
  safeDecode: () => safeDecode,
  safeDecodeAsync: () => safeDecodeAsync,
  safeEncode: () => safeEncode,
  safeEncodeAsync: () => safeEncodeAsync,
  safeParse: () => safeParse,
  safeParseAsync: () => safeParseAsync,
  toDotPath: () => toDotPath,
  toJSONSchema: () => toJSONSchema,
  treeifyError: () => treeifyError,
  util: () => util_exports,
  version: () => version
});

// node_modules/zod/v4/core/core.js
var NEVER = Object.freeze({
  status: "aborted"
});
// @__NO_SIDE_EFFECTS__
function $constructor(name, initializer3, params) {
  function init(inst, def) {
    if (!inst._zod) {
      Object.defineProperty(inst, "_zod", {
        value: {
          def,
          constr: _,
          traits: /* @__PURE__ */ new Set()
        },
        enumerable: false
      });
    }
    if (inst._zod.traits.has(name)) {
      return;
    }
    inst._zod.traits.add(name);
    initializer3(inst, def);
    const proto = _.prototype;
    const keys = Object.keys(proto);
    for (let i = 0; i < keys.length; i++) {
      const k = keys[i];
      if (!(k in inst)) {
        inst[k] = proto[k].bind(inst);
      }
    }
  }
  const Parent = params?.Parent ?? Object;
  class Definition extends Parent {
  }
  Object.defineProperty(Definition, "name", { value: name });
  function _(def) {
    var _a2;
    const inst = params?.Parent ? new Definition() : this;
    init(inst, def);
    (_a2 = inst._zod).deferred ?? (_a2.deferred = []);
    for (const fn of inst._zod.deferred) {
      fn();
    }
    return inst;
  }
  Object.defineProperty(_, "init", { value: init });
  Object.defineProperty(_, Symbol.hasInstance, {
    value: (inst) => {
      if (params?.Parent && inst instanceof params.Parent)
        return true;
      return inst?._zod?.traits?.has(name);
    }
  });
  Object.defineProperty(_, "name", { value: name });
  return _;
}
var $brand = Symbol("zod_brand");
var $ZodAsyncError = class extends Error {
  constructor() {
    super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`);
  }
};
var $ZodEncodeError = class extends Error {
  constructor(name) {
    super(`Encountered unidirectional transform during encode: ${name}`);
    this.name = "ZodEncodeError";
  }
};
var globalConfig = {};
function config(newConfig) {
  if (newConfig)
    Object.assign(globalConfig, newConfig);
  return globalConfig;
}

// node_modules/zod/v4/core/util.js
var util_exports = {};
__export(util_exports, {
  BIGINT_FORMAT_RANGES: () => BIGINT_FORMAT_RANGES,
  Class: () => Class,
  NUMBER_FORMAT_RANGES: () => NUMBER_FORMAT_RANGES,
  aborted: () => aborted,
  allowsEval: () => allowsEval,
  assert: () => assert,
  assertEqual: () => assertEqual,
  assertIs: () => assertIs,
  assertNever: () => assertNever,
  assertNotEqual: () => assertNotEqual,
  assignProp: () => assignProp,
  base64ToUint8Array: () => base64ToUint8Array,
  base64urlToUint8Array: () => base64urlToUint8Array,
  cached: () => cached,
  captureStackTrace: () => captureStackTrace,
  cleanEnum: () => cleanEnum,
  cleanRegex: () => cleanRegex,
  clone: () => clone,
  cloneDef: () => cloneDef,
  createTransparentProxy: () => createTransparentProxy,
  defineLazy: () => defineLazy,
  esc: () => esc,
  escapeRegex: () => escapeRegex,
  extend: () => extend,
  finalizeIssue: () => finalizeIssue,
  floatSafeRemainder: () => floatSafeRemainder,
  getElementAtPath: () => getElementAtPath,
  getEnumValues: () => getEnumValues,
  getLengthableOrigin: () => getLengthableOrigin,
  getParsedType: () => getParsedType,
  getSizableOrigin: () => getSizableOrigin,
  hexToUint8Array: () => hexToUint8Array,
  isObject: () => isObject,
  isPlainObject: () => isPlainObject,
  issue: () => issue,
  joinValues: () => joinValues,
  jsonStringifyReplacer: () => jsonStringifyReplacer,
  merge: () => merge,
  mergeDefs: () => mergeDefs,
  normalizeParams: () => normalizeParams,
  nullish: () => nullish,
  numKeys: () => numKeys,
  objectClone: () => objectClone,
  omit: () => omit,
  optionalKeys: () => optionalKeys,
  parsedType: () => parsedType,
  partial: () => partial,
  pick: () => pick,
  prefixIssues: () => prefixIssues,
  primitiveTypes: () => primitiveTypes,
  promiseAllObject: () => promiseAllObject,
  propertyKeyTypes: () => propertyKeyTypes,
  randomString: () => randomString,
  required: () => required,
  safeExtend: () => safeExtend,
  shallowClone: () => shallowClone,
  slugify: () => slugify,
  stringifyPrimitive: () => stringifyPrimitive,
  uint8ArrayToBase64: () => uint8ArrayToBase64,
  uint8ArrayToBase64url: () => uint8ArrayToBase64url,
  uint8ArrayToHex: () => uint8ArrayToHex,
  unwrapMessage: () => unwrapMessage
});
function assertEqual(val) {
  return val;
}
function assertNotEqual(val) {
  return val;
}
function assertIs(_arg) {
}
function assertNever(_x) {
  throw new Error("Unexpected value in exhaustive check");
}
function assert(_) {
}
function getEnumValues(entries) {
  const numericValues = Object.values(entries).filter((v) => typeof v === "number");
  const values = Object.entries(entries).filter(([k, _]) => numericValues.indexOf(+k) === -1).map(([_, v]) => v);
  return values;
}
function joinValues(array2, separator = "|") {
  return array2.map((val) => stringifyPrimitive(val)).join(separator);
}
function jsonStringifyReplacer(_, value) {
  if (typeof value === "bigint")
    return value.toString();
  return value;
}
function cached(getter) {
  const set2 = false;
  return {
    get value() {
      if (!set2) {
        const value = getter();
        Object.defineProperty(this, "value", { value });
        return value;
      }
      throw new Error("cached value already set");
    }
  };
}
function nullish(input) {
  return input === null || input === void 0;
}
function cleanRegex(source) {
  const start = source.startsWith("^") ? 1 : 0;
  const end = source.endsWith("$") ? source.length - 1 : source.length;
  return source.slice(start, end);
}
function floatSafeRemainder(val, step) {
  const valDecCount = (val.toString().split(".")[1] || "").length;
  const stepString = step.toString();
  let stepDecCount = (stepString.split(".")[1] || "").length;
  if (stepDecCount === 0 && /\d?e-\d?/.test(stepString)) {
    const match = stepString.match(/\d?e-(\d?)/);
    if (match?.[1]) {
      stepDecCount = Number.parseInt(match[1]);
    }
  }
  const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount;
  const valInt = Number.parseInt(val.toFixed(decCount).replace(".", ""));
  const stepInt = Number.parseInt(step.toFixed(decCount).replace(".", ""));
  return valInt % stepInt / 10 ** decCount;
}
var EVALUATING = Symbol("evaluating");
function defineLazy(object3, key, getter) {
  let value = void 0;
  Object.defineProperty(object3, key, {
    get() {
      if (value === EVALUATING) {
        return void 0;
      }
      if (value === void 0) {
        value = EVALUATING;
        value = getter();
      }
      return value;
    },
    set(v) {
      Object.defineProperty(object3, key, {
        value: v
        // configurable: true,
      });
    },
    configurable: true
  });
}
function objectClone(obj) {
  return Object.create(Object.getPrototypeOf(obj), Object.getOwnPropertyDescriptors(obj));
}
function assignProp(target, prop, value) {
  Object.defineProperty(target, prop, {
    value,
    writable: true,
    enumerable: true,
    configurable: true
  });
}
function mergeDefs(...defs) {
  const mergedDescriptors = {};
  for (const def of defs) {
    const descriptors = Object.getOwnPropertyDescriptors(def);
    Object.assign(mergedDescriptors, descriptors);
  }
  return Object.defineProperties({}, mergedDescriptors);
}
function cloneDef(schema) {
  return mergeDefs(schema._zod.def);
}
function getElementAtPath(obj, path) {
  if (!path)
    return obj;
  return path.reduce((acc, key) => acc?.[key], obj);
}
function promiseAllObject(promisesObj) {
  const keys = Object.keys(promisesObj);
  const promises = keys.map((key) => promisesObj[key]);
  return Promise.all(promises).then((results) => {
    const resolvedObj = {};
    for (let i = 0; i < keys.length; i++) {
      resolvedObj[keys[i]] = results[i];
    }
    return resolvedObj;
  });
}
function randomString(length = 10) {
  const chars = "abcdefghijklmnopqrstuvwxyz";
  let str = "";
  for (let i = 0; i < length; i++) {
    str += chars[Math.floor(Math.random() * chars.length)];
  }
  return str;
}
function esc(str) {
  return JSON.stringify(str);
}
function slugify(input) {
  return input.toLowerCase().trim().replace(/[^\w\s-]/g, "").replace(/[\s_-]+/g, "-").replace(/^-+|-+$/g, "");
}
var captureStackTrace = "captureStackTrace" in Error ? Error.captureStackTrace : (..._args) => {
};
function isObject(data) {
  return typeof data === "object" && data !== null && !Array.isArray(data);
}
var allowsEval = cached(() => {
  if (typeof navigator !== "undefined" && navigator?.userAgent?.includes("Cloudflare")) {
    return false;
  }
  try {
    const F = Function;
    new F("");
    return true;
  } catch (_) {
    return false;
  }
});
function isPlainObject(o) {
  if (isObject(o) === false)
    return false;
  const ctor = o.constructor;
  if (ctor === void 0)
    return true;
  if (typeof ctor !== "function")
    return true;
  const prot = ctor.prototype;
  if (isObject(prot) === false)
    return false;
  if (Object.prototype.hasOwnProperty.call(prot, "isPrototypeOf") === false) {
    return false;
  }
  return true;
}
function shallowClone(o) {
  if (isPlainObject(o))
    return { ...o };
  if (Array.isArray(o))
    return [...o];
  return o;
}
function numKeys(data) {
  let keyCount = 0;
  for (const key in data) {
    if (Object.prototype.hasOwnProperty.call(data, key)) {
      keyCount++;
    }
  }
  return keyCount;
}
var getParsedType = (data) => {
  const t = typeof data;
  switch (t) {
    case "undefined":
      return "undefined";
    case "string":
      return "string";
    case "number":
      return Number.isNaN(data) ? "nan" : "number";
    case "boolean":
      return "boolean";
    case "function":
      return "function";
    case "bigint":
      return "bigint";
    case "symbol":
      return "symbol";
    case "object":
      if (Array.isArray(data)) {
        return "array";
      }
      if (data === null) {
        return "null";
      }
      if (data.then && typeof data.then === "function" && data.catch && typeof data.catch === "function") {
        return "promise";
      }
      if (typeof Map !== "undefined" && data instanceof Map) {
        return "map";
      }
      if (typeof Set !== "undefined" && data instanceof Set) {
        return "set";
      }
      if (typeof Date !== "undefined" && data instanceof Date) {
        return "date";
      }
      if (typeof File !== "undefined" && data instanceof File) {
        return "file";
      }
      return "object";
    default:
      throw new Error(`Unknown data type: ${t}`);
  }
};
var propertyKeyTypes = /* @__PURE__ */ new Set(["string", "number", "symbol"]);
var primitiveTypes = /* @__PURE__ */ new Set(["string", "number", "bigint", "boolean", "symbol", "undefined"]);
function escapeRegex(str) {
  return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
}
function clone(inst, def, params) {
  const cl = new inst._zod.constr(def ?? inst._zod.def);
  if (!def || params?.parent)
    cl._zod.parent = inst;
  return cl;
}
function normalizeParams(_params) {
  const params = _params;
  if (!params)
    return {};
  if (typeof params === "string")
    return { error: () => params };
  if (params?.message !== void 0) {
    if (params?.error !== void 0)
      throw new Error("Cannot specify both `message` and `error` params");
    params.error = params.message;
  }
  delete params.message;
  if (typeof params.error === "string")
    return { ...params, error: () => params.error };
  return params;
}
function createTransparentProxy(getter) {
  let target;
  return new Proxy({}, {
    get(_, prop, receiver) {
      target ?? (target = getter());
      return Reflect.get(target, prop, receiver);
    },
    set(_, prop, value, receiver) {
      target ?? (target = getter());
      return Reflect.set(target, prop, value, receiver);
    },
    has(_, prop) {
      target ?? (target = getter());
      return Reflect.has(target, prop);
    },
    deleteProperty(_, prop) {
      target ?? (target = getter());
      return Reflect.deleteProperty(target, prop);
    },
    ownKeys(_) {
      target ?? (target = getter());
      return Reflect.ownKeys(target);
    },
    getOwnPropertyDescriptor(_, prop) {
      target ?? (target = getter());
      return Reflect.getOwnPropertyDescriptor(target, prop);
    },
    defineProperty(_, prop, descriptor) {
      target ?? (target = getter());
      return Reflect.defineProperty(target, prop, descriptor);
    }
  });
}
function stringifyPrimitive(value) {
  if (typeof value === "bigint")
    return value.toString() + "n";
  if (typeof value === "string")
    return `"${value}"`;
  return `${value}`;
}
function optionalKeys(shape) {
  return Object.keys(shape).filter((k) => {
    return shape[k]._zod.optin === "optional" && shape[k]._zod.optout === "optional";
  });
}
var NUMBER_FORMAT_RANGES = {
  safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],
  int32: [-2147483648, 2147483647],
  uint32: [0, 4294967295],
  float32: [-34028234663852886e22, 34028234663852886e22],
  float64: [-Number.MAX_VALUE, Number.MAX_VALUE]
};
var BIGINT_FORMAT_RANGES = {
  int64: [/* @__PURE__ */ BigInt("-9223372036854775808"), /* @__PURE__ */ BigInt("9223372036854775807")],
  uint64: [/* @__PURE__ */ BigInt(0), /* @__PURE__ */ BigInt("18446744073709551615")]
};
function pick(schema, mask) {
  const currDef = schema._zod.def;
  const checks = currDef.checks;
  const hasChecks = checks && checks.length > 0;
  if (hasChecks) {
    throw new Error(".pick() cannot be used on object schemas containing refinements");
  }
  const def = mergeDefs(schema._zod.def, {
    get shape() {
      const newShape = {};
      for (const key in mask) {
        if (!(key in currDef.shape)) {
          throw new Error(`Unrecognized key: "${key}"`);
        }
        if (!mask[key])
          continue;
        newShape[key] = currDef.shape[key];
      }
      assignProp(this, "shape", newShape);
      return newShape;
    },
    checks: []
  });
  return clone(schema, def);
}
function omit(schema, mask) {
  const currDef = schema._zod.def;
  const checks = currDef.checks;
  const hasChecks = checks && checks.length > 0;
  if (hasChecks) {
    throw new Error(".omit() cannot be used on object schemas containing refinements");
  }
  const def = mergeDefs(schema._zod.def, {
    get shape() {
      const newShape = { ...schema._zod.def.shape };
      for (const key in mask) {
        if (!(key in currDef.shape)) {
          throw new Error(`Unrecognized key: "${key}"`);
        }
        if (!mask[key])
          continue;
        delete newShape[key];
      }
      assignProp(this, "shape", newShape);
      return newShape;
    },
    checks: []
  });
  return clone(schema, def);
}
function extend(schema, shape) {
  if (!isPlainObject(shape)) {
    throw new Error("Invalid input to extend: expected a plain object");
  }
  const checks = schema._zod.def.checks;
  const hasChecks = checks && checks.length > 0;
  if (hasChecks) {
    const existingShape = schema._zod.def.shape;
    for (const key in shape) {
      if (Object.getOwnPropertyDescriptor(existingShape, key) !== void 0) {
        throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.");
      }
    }
  }
  const def = mergeDefs(schema._zod.def, {
    get shape() {
      const _shape = { ...schema._zod.def.shape, ...shape };
      assignProp(this, "shape", _shape);
      return _shape;
    }
  });
  return clone(schema, def);
}
function safeExtend(schema, shape) {
  if (!isPlainObject(shape)) {
    throw new Error("Invalid input to safeExtend: expected a plain object");
  }
  const def = mergeDefs(schema._zod.def, {
    get shape() {
      const _shape = { ...schema._zod.def.shape, ...shape };
      assignProp(this, "shape", _shape);
      return _shape;
    }
  });
  return clone(schema, def);
}
function merge(a, b) {
  const def = mergeDefs(a._zod.def, {
    get shape() {
      const _shape = { ...a._zod.def.shape, ...b._zod.def.shape };
      assignProp(this, "shape", _shape);
      return _shape;
    },
    get catchall() {
      return b._zod.def.catchall;
    },
    checks: []
    // delete existing checks
  });
  return clone(a, def);
}
function partial(Class2, schema, mask) {
  const currDef = schema._zod.def;
  const checks = currDef.checks;
  const hasChecks = checks && checks.length > 0;
  if (hasChecks) {
    throw new Error(".partial() cannot be used on object schemas containing refinements");
  }
  const def = mergeDefs(schema._zod.def, {
    get shape() {
      const oldShape = schema._zod.def.shape;
      const shape = { ...oldShape };
      if (mask) {
        for (const key in mask) {
          if (!(key in oldShape)) {
            throw new Error(`Unrecognized key: "${key}"`);
          }
          if (!mask[key])
            continue;
          shape[key] = Class2 ? new Class2({
            type: "optional",
            innerType: oldShape[key]
          }) : oldShape[key];
        }
      } else {
        for (const key in oldShape) {
          shape[key] = Class2 ? new Class2({
            type: "optional",
            innerType: oldShape[key]
          }) : oldShape[key];
        }
      }
      assignProp(this, "shape", shape);
      return shape;
    },
    checks: []
  });
  return clone(schema, def);
}
function required(Class2, schema, mask) {
  const def = mergeDefs(schema._zod.def, {
    get shape() {
      const oldShape = schema._zod.def.shape;
      const shape = { ...oldShape };
      if (mask) {
        for (const key in mask) {
          if (!(key in shape)) {
            throw new Error(`Unrecognized key: "${key}"`);
          }
          if (!mask[key])
            continue;
          shape[key] = new Class2({
            type: "nonoptional",
            innerType: oldShape[key]
          });
        }
      } else {
        for (const key in oldShape) {
          shape[key] = new Class2({
            type: "nonoptional",
            innerType: oldShape[key]
          });
        }
      }
      assignProp(this, "shape", shape);
      return shape;
    }
  });
  return clone(schema, def);
}
function aborted(x, startIndex = 0) {
  if (x.aborted === true)
    return true;
  for (let i = startIndex; i < x.issues.length; i++) {
    if (x.issues[i]?.continue !== true) {
      return true;
    }
  }
  return false;
}
function prefixIssues(path, issues) {
  return issues.map((iss) => {
    var _a2;
    (_a2 = iss).path ?? (_a2.path = []);
    iss.path.unshift(path);
    return iss;
  });
}
function unwrapMessage(message) {
  return typeof message === "string" ? message : message?.message;
}
function finalizeIssue(iss, ctx, config2) {
  const full = { ...iss, path: iss.path ?? [] };
  if (!iss.message) {
    const message = unwrapMessage(iss.inst?._zod.def?.error?.(iss)) ?? unwrapMessage(ctx?.error?.(iss)) ?? unwrapMessage(config2.customError?.(iss)) ?? unwrapMessage(config2.localeError?.(iss)) ?? "Invalid input";
    full.message = message;
  }
  delete full.inst;
  delete full.continue;
  if (!ctx?.reportInput) {
    delete full.input;
  }
  return full;
}
function getSizableOrigin(input) {
  if (input instanceof Set)
    return "set";
  if (input instanceof Map)
    return "map";
  if (input instanceof File)
    return "file";
  return "unknown";
}
function getLengthableOrigin(input) {
  if (Array.isArray(input))
    return "array";
  if (typeof input === "string")
    return "string";
  return "unknown";
}
function parsedType(data) {
  const t = typeof data;
  switch (t) {
    case "number": {
      return Number.isNaN(data) ? "nan" : "number";
    }
    case "object": {
      if (data === null) {
        return "null";
      }
      if (Array.isArray(data)) {
        return "array";
      }
      const obj = data;
      if (obj && Object.getPrototypeOf(obj) !== Object.prototype && "constructor" in obj && obj.constructor) {
        return obj.constructor.name;
      }
    }
  }
  return t;
}
function issue(...args) {
  const [iss, input, inst] = args;
  if (typeof iss === "string") {
    return {
      message: iss,
      code: "custom",
      input,
      inst
    };
  }
  return { ...iss };
}
function cleanEnum(obj) {
  return Object.entries(obj).filter(([k, _]) => {
    return Number.isNaN(Number.parseInt(k, 10));
  }).map((el) => el[1]);
}
function base64ToUint8Array(base643) {
  const binaryString = atob(base643);
  const bytes2 = new Uint8Array(binaryString.length);
  for (let i = 0; i < binaryString.length; i++) {
    bytes2[i] = binaryString.charCodeAt(i);
  }
  return bytes2;
}
function uint8ArrayToBase64(bytes2) {
  let binaryString = "";
  for (let i = 0; i < bytes2.length; i++) {
    binaryString += String.fromCharCode(bytes2[i]);
  }
  return btoa(binaryString);
}
function base64urlToUint8Array(base64url3) {
  const base643 = base64url3.replace(/-/g, "+").replace(/_/g, "/");
  const padding = "=".repeat((4 - base643.length % 4) % 4);
  return base64ToUint8Array(base643 + padding);
}
function uint8ArrayToBase64url(bytes2) {
  return uint8ArrayToBase64(bytes2).replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, "");
}
function hexToUint8Array(hex3) {
  const cleanHex = hex3.replace(/^0x/, "");
  if (cleanHex.length % 2 !== 0) {
    throw new Error("Invalid hex string length");
  }
  const bytes2 = new Uint8Array(cleanHex.length / 2);
  for (let i = 0; i < cleanHex.length; i += 2) {
    bytes2[i / 2] = Number.parseInt(cleanHex.slice(i, i + 2), 16);
  }
  return bytes2;
}
function uint8ArrayToHex(bytes2) {
  return Array.from(bytes2).map((b) => b.toString(16).padStart(2, "0")).join("");
}
var Class = class {
  constructor(..._args) {
  }
};

// node_modules/zod/v4/core/errors.js
var initializer = (inst, def) => {
  inst.name = "$ZodError";
  Object.defineProperty(inst, "_zod", {
    value: inst._zod,
    enumerable: false
  });
  Object.defineProperty(inst, "issues", {
    value: def,
    enumerable: false
  });
  inst.message = JSON.stringify(def, jsonStringifyReplacer, 2);
  Object.defineProperty(inst, "toString", {
    value: () => inst.message,
    enumerable: false
  });
};
var $ZodError = $constructor("$ZodError", initializer);
var $ZodRealError = $constructor("$ZodError", initializer, { Parent: Error });
function flattenError(error48, mapper = (issue2) => issue2.message) {
  const fieldErrors = {};
  const formErrors = [];
  for (const sub of error48.issues) {
    if (sub.path.length > 0) {
      fieldErrors[sub.path[0]] = fieldErrors[sub.path[0]] || [];
      fieldErrors[sub.path[0]].push(mapper(sub));
    } else {
      formErrors.push(mapper(sub));
    }
  }
  return { formErrors, fieldErrors };
}
function formatError(error48, mapper = (issue2) => issue2.message) {
  const fieldErrors = { _errors: [] };
  const processError = (error49) => {
    for (const issue2 of error49.issues) {
      if (issue2.code === "invalid_union" && issue2.errors.length) {
        issue2.errors.map((issues) => processError({ issues }));
      } else if (issue2.code === "invalid_key") {
        processError({ issues: issue2.issues });
      } else if (issue2.code === "invalid_element") {
        processError({ issues: issue2.issues });
      } else if (issue2.path.length === 0) {
        fieldErrors._errors.push(mapper(issue2));
      } else {
        let curr = fieldErrors;
        let i = 0;
        while (i < issue2.path.length) {
          const el = issue2.path[i];
          const terminal = i === issue2.path.length - 1;
          if (!terminal) {
            curr[el] = curr[el] || { _errors: [] };
          } else {
            curr[el] = curr[el] || { _errors: [] };
            curr[el]._errors.push(mapper(issue2));
          }
          curr = curr[el];
          i++;
        }
      }
    }
  };
  processError(error48);
  return fieldErrors;
}
function treeifyError(error48, mapper = (issue2) => issue2.message) {
  const result = { errors: [] };
  const processError = (error49, path = []) => {
    var _a2, _b;
    for (const issue2 of error49.issues) {
      if (issue2.code === "invalid_union" && issue2.errors.length) {
        issue2.errors.map((issues) => processError({ issues }, issue2.path));
      } else if (issue2.code === "invalid_key") {
        processError({ issues: issue2.issues }, issue2.path);
      } else if (issue2.code === "invalid_element") {
        processError({ issues: issue2.issues }, issue2.path);
      } else {
        const fullpath = [...path, ...issue2.path];
        if (fullpath.length === 0) {
          result.errors.push(mapper(issue2));
          continue;
        }
        let curr = result;
        let i = 0;
        while (i < fullpath.length) {
          const el = fullpath[i];
          const terminal = i === fullpath.length - 1;
          if (typeof el === "string") {
            curr.properties ?? (curr.properties = {});
            (_a2 = curr.properties)[el] ?? (_a2[el] = { errors: [] });
            curr = curr.properties[el];
          } else {
            curr.items ?? (curr.items = []);
            (_b = curr.items)[el] ?? (_b[el] = { errors: [] });
            curr = curr.items[el];
          }
          if (terminal) {
            curr.errors.push(mapper(issue2));
          }
          i++;
        }
      }
    }
  };
  processError(error48);
  return result;
}
function toDotPath(_path) {
  const segs = [];
  const path = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
  for (const seg of path) {
    if (typeof seg === "number")
      segs.push(`[${seg}]`);
    else if (typeof seg === "symbol")
      segs.push(`[${JSON.stringify(String(seg))}]`);
    else if (/[^\w$]/.test(seg))
      segs.push(`[${JSON.stringify(seg)}]`);
    else {
      if (segs.length)
        segs.push(".");
      segs.push(seg);
    }
  }
  return segs.join("");
}
function prettifyError(error48) {
  const lines = [];
  const issues = [...error48.issues].sort((a, b) => (a.path ?? []).length - (b.path ?? []).length);
  for (const issue2 of issues) {
    lines.push(`\u2716 ${issue2.message}`);
    if (issue2.path?.length)
      lines.push(`  \u2192 at ${toDotPath(issue2.path)}`);
  }
  return lines.join("\n");
}

// node_modules/zod/v4/core/parse.js
var _parse = (_Err) => (schema, value, _ctx, _params) => {
  const ctx = _ctx ? Object.assign(_ctx, { async: false }) : { async: false };
  const result = schema._zod.run({ value, issues: [] }, ctx);
  if (result instanceof Promise) {
    throw new $ZodAsyncError();
  }
  if (result.issues.length) {
    const e = new (_params?.Err ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
    captureStackTrace(e, _params?.callee);
    throw e;
  }
  return result.value;
};
var parse = /* @__PURE__ */ _parse($ZodRealError);
var _parseAsync = (_Err) => async (schema, value, _ctx, params) => {
  const ctx = _ctx ? Object.assign(_ctx, { async: true }) : { async: true };
  let result = schema._zod.run({ value, issues: [] }, ctx);
  if (result instanceof Promise)
    result = await result;
  if (result.issues.length) {
    const e = new (params?.Err ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
    captureStackTrace(e, params?.callee);
    throw e;
  }
  return result.value;
};
var parseAsync = /* @__PURE__ */ _parseAsync($ZodRealError);
var _safeParse = (_Err) => (schema, value, _ctx) => {
  const ctx = _ctx ? { ..._ctx, async: false } : { async: false };
  const result = schema._zod.run({ value, issues: [] }, ctx);
  if (result instanceof Promise) {
    throw new $ZodAsyncError();
  }
  return result.issues.length ? {
    success: false,
    error: new (_Err ?? $ZodError)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())))
  } : { success: true, data: result.value };
};
var safeParse = /* @__PURE__ */ _safeParse($ZodRealError);
var _safeParseAsync = (_Err) => async (schema, value, _ctx) => {
  const ctx = _ctx ? Object.assign(_ctx, { async: true }) : { async: true };
  let result = schema._zod.run({ value, issues: [] }, ctx);
  if (result instanceof Promise)
    result = await result;
  return result.issues.length ? {
    success: false,
    error: new _Err(result.issues.map((iss) => finalizeIssue(iss, ctx, config())))
  } : { success: true, data: result.value };
};
var safeParseAsync = /* @__PURE__ */ _safeParseAsync($ZodRealError);
var _encode = (_Err) => (schema, value, _ctx) => {
  const ctx = _ctx ? Object.assign(_ctx, { direction: "backward" }) : { direction: "backward" };
  return _parse(_Err)(schema, value, ctx);
};
var encode = /* @__PURE__ */ _encode($ZodRealError);
var _decode = (_Err) => (schema, value, _ctx) => {
  return _parse(_Err)(schema, value, _ctx);
};
var decode = /* @__PURE__ */ _decode($ZodRealError);
var _encodeAsync = (_Err) => async (schema, value, _ctx) => {
  const ctx = _ctx ? Object.assign(_ctx, { direction: "backward" }) : { direction: "backward" };
  return _parseAsync(_Err)(schema, value, ctx);
};
var encodeAsync = /* @__PURE__ */ _encodeAsync($ZodRealError);
var _decodeAsync = (_Err) => async (schema, value, _ctx) => {
  return _parseAsync(_Err)(schema, value, _ctx);
};
var decodeAsync = /* @__PURE__ */ _decodeAsync($ZodRealError);
var _safeEncode = (_Err) => (schema, value, _ctx) => {
  const ctx = _ctx ? Object.assign(_ctx, { direction: "backward" }) : { direction: "backward" };
  return _safeParse(_Err)(schema, value, ctx);
};
var safeEncode = /* @__PURE__ */ _safeEncode($ZodRealError);
var _safeDecode = (_Err) => (schema, value, _ctx) => {
  return _safeParse(_Err)(schema, value, _ctx);
};
var safeDecode = /* @__PURE__ */ _safeDecode($ZodRealError);
var _safeEncodeAsync = (_Err) => async (schema, value, _ctx) => {
  const ctx = _ctx ? Object.assign(_ctx, { direction: "backward" }) : { direction: "backward" };
  return _safeParseAsync(_Err)(schema, value, ctx);
};
var safeEncodeAsync = /* @__PURE__ */ _safeEncodeAsync($ZodRealError);
var _safeDecodeAsync = (_Err) => async (schema, value, _ctx) => {
  return _safeParseAsync(_Err)(schema, value, _ctx);
};
var safeDecodeAsync = /* @__PURE__ */ _safeDecodeAsync($ZodRealError);

// node_modules/zod/v4/core/regexes.js
var regexes_exports = {};
__export(regexes_exports, {
  base64: () => base64,
  base64url: () => base64url,
  bigint: () => bigint,
  boolean: () => boolean,
  browserEmail: () => browserEmail,
  cidrv4: () => cidrv4,
  cidrv6: () => cidrv6,
  cuid: () => cuid,
  cuid2: () => cuid2,
  date: () => date,
  datetime: () => datetime,
  domain: () => domain,
  duration: () => duration,
  e164: () => e164,
  email: () => email,
  emoji: () => emoji,
  extendedDuration: () => extendedDuration,
  guid: () => guid,
  hex: () => hex,
  hostname: () => hostname,
  html5Email: () => html5Email,
  idnEmail: () => idnEmail,
  integer: () => integer,
  ipv4: () => ipv4,
  ipv6: () => ipv6,
  ksuid: () => ksuid,
  lowercase: () => lowercase,
  mac: () => mac,
  md5_base64: () => md5_base64,
  md5_base64url: () => md5_base64url,
  md5_hex: () => md5_hex,
  nanoid: () => nanoid,
  null: () => _null,
  number: () => number,
  rfc5322Email: () => rfc5322Email,
  sha1_base64: () => sha1_base64,
  sha1_base64url: () => sha1_base64url,
  sha1_hex: () => sha1_hex,
  sha256_base64: () => sha256_base64,
  sha256_base64url: () => sha256_base64url,
  sha256_hex: () => sha256_hex,
  sha384_base64: () => sha384_base64,
  sha384_base64url: () => sha384_base64url,
  sha384_hex: () => sha384_hex,
  sha512_base64: () => sha512_base64,
  sha512_base64url: () => sha512_base64url,
  sha512_hex: () => sha512_hex,
  string: () => string,
  time: () => time,
  ulid: () => ulid,
  undefined: () => _undefined,
  unicodeEmail: () => unicodeEmail,
  uppercase: () => uppercase,
  uuid: () => uuid,
  uuid4: () => uuid4,
  uuid6: () => uuid6,
  uuid7: () => uuid7,
  xid: () => xid
});
var cuid = /^[cC][^\s-]{8,}$/;
var cuid2 = /^[0-9a-z]+$/;
var ulid = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/;
var xid = /^[0-9a-vA-V]{20}$/;
var ksuid = /^[A-Za-z0-9]{27}$/;
var nanoid = /^[a-zA-Z0-9_-]{21}$/;
var duration = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;
var extendedDuration = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/;
var guid = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/;
var uuid = (version2) => {
  if (!version2)
    return /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;
  return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${version2}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`);
};
var uuid4 = /* @__PURE__ */ uuid(4);
var uuid6 = /* @__PURE__ */ uuid(6);
var uuid7 = /* @__PURE__ */ uuid(7);
var email = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;
var html5Email = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;
var rfc5322Email = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
var unicodeEmail = /^[^\s@"]{1,64}@[^\s@]{1,255}$/u;
var idnEmail = unicodeEmail;
var browserEmail = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;
var _emoji = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;
function emoji() {
  return new RegExp(_emoji, "u");
}
var ipv4 = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/;
var ipv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/;
var mac = (delimiter) => {
  const escapedDelim = escapeRegex(delimiter ?? ":");
  return new RegExp(`^(?:[0-9A-F]{2}${escapedDelim}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${escapedDelim}){5}[0-9a-f]{2}$`);
};
var cidrv4 = /^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/;
var cidrv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/;
var base64 = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/;
var base64url = /^[A-Za-z0-9_-]*$/;
var hostname = /^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/;
var domain = /^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/;
var e164 = /^\+[1-9]\d{6,14}$/;
var dateSource = `(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`;
var date = /* @__PURE__ */ new RegExp(`^${dateSource}$`);
function timeSource(args) {
  const hhmm = `(?:[01]\\d|2[0-3]):[0-5]\\d`;
  const regex = typeof args.precision === "number" ? args.precision === -1 ? `${hhmm}` : args.precision === 0 ? `${hhmm}:[0-5]\\d` : `${hhmm}:[0-5]\\d\\.\\d{${args.precision}}` : `${hhmm}(?::[0-5]\\d(?:\\.\\d+)?)?`;
  return regex;
}
function time(args) {
  return new RegExp(`^${timeSource(args)}$`);
}
function datetime(args) {
  const time3 = timeSource({ precision: args.precision });
  const opts = ["Z"];
  if (args.local)
    opts.push("");
  if (args.offset)
    opts.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);
  const timeRegex2 = `${time3}(?:${opts.join("|")})`;
  return new RegExp(`^${dateSource}T(?:${timeRegex2})$`);
}
var string = (params) => {
  const regex = params ? `[\\s\\S]{${params?.minimum ?? 0},${params?.maximum ?? ""}}` : `[\\s\\S]*`;
  return new RegExp(`^${regex}$`);
};
var bigint = /^-?\d+n?$/;
var integer = /^-?\d+$/;
var number = /^-?\d+(?:\.\d+)?$/;
var boolean = /^(?:true|false)$/i;
var _null = /^null$/i;
var _undefined = /^undefined$/i;
var lowercase = /^[^A-Z]*$/;
var uppercase = /^[^a-z]*$/;
var hex = /^[0-9a-fA-F]*$/;
function fixedBase64(bodyLength, padding) {
  return new RegExp(`^[A-Za-z0-9+/]{${bodyLength}}${padding}$`);
}
function fixedBase64url(length) {
  return new RegExp(`^[A-Za-z0-9_-]{${length}}$`);
}
var md5_hex = /^[0-9a-fA-F]{32}$/;
var md5_base64 = /* @__PURE__ */ fixedBase64(22, "==");
var md5_base64url = /* @__PURE__ */ fixedBase64url(22);
var sha1_hex = /^[0-9a-fA-F]{40}$/;
var sha1_base64 = /* @__PURE__ */ fixedBase64(27, "=");
var sha1_base64url = /* @__PURE__ */ fixedBase64url(27);
var sha256_hex = /^[0-9a-fA-F]{64}$/;
var sha256_base64 = /* @__PURE__ */ fixedBase64(43, "=");
var sha256_base64url = /* @__PURE__ */ fixedBase64url(43);
var sha384_hex = /^[0-9a-fA-F]{96}$/;
var sha384_base64 = /* @__PURE__ */ fixedBase64(64, "");
var sha384_base64url = /* @__PURE__ */ fixedBase64url(64);
var sha512_hex = /^[0-9a-fA-F]{128}$/;
var sha512_base64 = /* @__PURE__ */ fixedBase64(86, "==");
var sha512_base64url = /* @__PURE__ */ fixedBase64url(86);

// node_modules/zod/v4/core/checks.js
var $ZodCheck = /* @__PURE__ */ $constructor("$ZodCheck", (inst, def) => {
  var _a2;
  inst._zod ?? (inst._zod = {});
  inst._zod.def = def;
  (_a2 = inst._zod).onattach ?? (_a2.onattach = []);
});
var numericOriginMap = {
  number: "number",
  bigint: "bigint",
  object: "date"
};
var $ZodCheckLessThan = /* @__PURE__ */ $constructor("$ZodCheckLessThan", (inst, def) => {
  $ZodCheck.init(inst, def);
  const origin = numericOriginMap[typeof def.value];
  inst._zod.onattach.push((inst2) => {
    const bag = inst2._zod.bag;
    const curr = (def.inclusive ? bag.maximum : bag.exclusiveMaximum) ?? Number.POSITIVE_INFINITY;
    if (def.value < curr) {
      if (def.inclusive)
        bag.maximum = def.value;
      else
        bag.exclusiveMaximum = def.value;
    }
  });
  inst._zod.check = (payload) => {
    if (def.inclusive ? payload.value <= def.value : payload.value < def.value) {
      return;
    }
    payload.issues.push({
      origin,
      code: "too_big",
      maximum: typeof def.value === "object" ? def.value.getTime() : def.value,
      input: payload.value,
      inclusive: def.inclusive,
      inst,
      continue: !def.abort
    });
  };
});
var $ZodCheckGreaterThan = /* @__PURE__ */ $constructor("$ZodCheckGreaterThan", (inst, def) => {
  $ZodCheck.init(inst, def);
  const origin = numericOriginMap[typeof def.value];
  inst._zod.onattach.push((inst2) => {
    const bag = inst2._zod.bag;
    const curr = (def.inclusive ? bag.minimum : bag.exclusiveMinimum) ?? Number.NEGATIVE_INFINITY;
    if (def.value > curr) {
      if (def.inclusive)
        bag.minimum = def.value;
      else
        bag.exclusiveMinimum = def.value;
    }
  });
  inst._zod.check = (payload) => {
    if (def.inclusive ? payload.value >= def.value : payload.value > def.value) {
      return;
    }
    payload.issues.push({
      origin,
      code: "too_small",
      minimum: typeof def.value === "object" ? def.value.getTime() : def.value,
      input: payload.value,
      inclusive: def.inclusive,
      inst,
      continue: !def.abort
    });
  };
});
var $ZodCheckMultipleOf = /* @__PURE__ */ $constructor("$ZodCheckMultipleOf", (inst, def) => {
  $ZodCheck.init(inst, def);
  inst._zod.onattach.push((inst2) => {
    var _a2;
    (_a2 = inst2._zod.bag).multipleOf ?? (_a2.multipleOf = def.value);
  });
  inst._zod.check = (payload) => {
    if (typeof payload.value !== typeof def.value)
      throw new Error("Cannot mix number and bigint in multiple_of check.");
    const isMultiple = typeof payload.value === "bigint" ? payload.value % def.value === BigInt(0) : floatSafeRemainder(payload.value, def.value) === 0;
    if (isMultiple)
      return;
    payload.issues.push({
      origin: typeof payload.value,
      code: "not_multiple_of",
      divisor: def.value,
      input: payload.value,
      inst,
      continue: !def.abort
    });
  };
});
var $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberFormat", (inst, def) => {
  $ZodCheck.init(inst, def);
  def.format = def.format || "float64";
  const isInt = def.format?.includes("int");
  const origin = isInt ? "int" : "number";
  const [minimum, maximum] = NUMBER_FORMAT_RANGES[def.format];
  inst._zod.onattach.push((inst2) => {
    const bag = inst2._zod.bag;
    bag.format = def.format;
    bag.minimum = minimum;
    bag.maximum = maximum;
    if (isInt)
      bag.pattern = integer;
  });
  inst._zod.check = (payload) => {
    const input = payload.value;
    if (isInt) {
      if (!Number.isInteger(input)) {
        payload.issues.push({
          expected: origin,
          format: def.format,
          code: "invalid_type",
          continue: false,
          input,
          inst
        });
        return;
      }
      if (!Number.isSafeInteger(input)) {
        if (input > 0) {
          payload.issues.push({
            input,
            code: "too_big",
            maximum: Number.MAX_SAFE_INTEGER,
            note: "Integers must be within the safe integer range.",
            inst,
            origin,
            inclusive: true,
            continue: !def.abort
          });
        } else {
          payload.issues.push({
            input,
            code: "too_small",
            minimum: Number.MIN_SAFE_INTEGER,
            note: "Integers must be within the safe integer range.",
            inst,
            origin,
            inclusive: true,
            continue: !def.abort
          });
        }
        return;
      }
    }
    if (input < minimum) {
      payload.issues.push({
        origin: "number",
        input,
        code: "too_small",
        minimum,
        inclusive: true,
        inst,
        continue: !def.abort
      });
    }
    if (input > maximum) {
      payload.issues.push({
        origin: "number",
        input,
        code: "too_big",
        maximum,
        inclusive: true,
        inst,
        continue: !def.abort
      });
    }
  };
});
var $ZodCheckBigIntFormat = /* @__PURE__ */ $constructor("$ZodCheckBigIntFormat", (inst, def) => {
  $ZodCheck.init(inst, def);
  const [minimum, maximum] = BIGINT_FORMAT_RANGES[def.format];
  inst._zod.onattach.push((inst2) => {
    const bag = inst2._zod.bag;
    bag.format = def.format;
    bag.minimum = minimum;
    bag.maximum = maximum;
  });
  inst._zod.check = (payload) => {
    const input = payload.value;
    if (input < minimum) {
      payload.issues.push({
        origin: "bigint",
        input,
        code: "too_small",
        minimum,
        inclusive: true,
        inst,
        continue: !def.abort
      });
    }
    if (input > maximum) {
      payload.issues.push({
        origin: "bigint",
        input,
        code: "too_big",
        maximum,
        inclusive: true,
        inst,
        continue: !def.abort
      });
    }
  };
});
var $ZodCheckMaxSize = /* @__PURE__ */ $constructor("$ZodCheckMaxSize", (inst, def) => {
  var _a2;
  $ZodCheck.init(inst, def);
  (_a2 = inst._zod.def).when ?? (_a2.when = (payload) => {
    const val = payload.value;
    return !nullish(val) && val.size !== void 0;
  });
  inst._zod.onattach.push((inst2) => {
    const curr = inst2._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
    if (def.maximum < curr)
      inst2._zod.bag.maximum = def.maximum;
  });
  inst._zod.check = (payload) => {
    const input = payload.value;
    const size = input.size;
    if (size <= def.maximum)
      return;
    payload.issues.push({
      origin: getSizableOrigin(input),
      code: "too_big",
      maximum: def.maximum,
      inclusive: true,
      input,
      inst,
      continue: !def.abort
    });
  };
});
var $ZodCheckMinSize = /* @__PURE__ */ $constructor("$ZodCheckMinSize", (inst, def) => {
  var _a2;
  $ZodCheck.init(inst, def);
  (_a2 = inst._zod.def).when ?? (_a2.when = (payload) => {
    const val = payload.value;
    return !nullish(val) && val.size !== void 0;
  });
  inst._zod.onattach.push((inst2) => {
    const curr = inst2._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
    if (def.minimum > curr)
      inst2._zod.bag.minimum = def.minimum;
  });
  inst._zod.check = (payload) => {
    const input = payload.value;
    const size = input.size;
    if (size >= def.minimum)
      return;
    payload.issues.push({
      origin: getSizableOrigin(input),
      code: "too_small",
      minimum: def.minimum,
      inclusive: true,
      input,
      inst,
      continue: !def.abort
    });
  };
});
var $ZodCheckSizeEquals = /* @__PURE__ */ $constructor("$ZodCheckSizeEquals", (inst, def) => {
  var _a2;
  $ZodCheck.init(inst, def);
  (_a2 = inst._zod.def).when ?? (_a2.when = (payload) => {
    const val = payload.value;
    return !nullish(val) && val.size !== void 0;
  });
  inst._zod.onattach.push((inst2) => {
    const bag = inst2._zod.bag;
    bag.minimum = def.size;
    bag.maximum = def.size;
    bag.size = def.size;
  });
  inst._zod.check = (payload) => {
    const input = payload.value;
    const size = input.size;
    if (size === def.size)
      return;
    const tooBig = size > def.size;
    payload.issues.push({
      origin: getSizableOrigin(input),
      ...tooBig ? { code: "too_big", maximum: def.size } : { code: "too_small", minimum: def.size },
      inclusive: true,
      exact: true,
      input: payload.value,
      inst,
      continue: !def.abort
    });
  };
});
var $ZodCheckMaxLength = /* @__PURE__ */ $constructor("$ZodCheckMaxLength", (inst, def) => {
  var _a2;
  $ZodCheck.init(inst, def);
  (_a2 = inst._zod.def).when ?? (_a2.when = (payload) => {
    const val = payload.value;
    return !nullish(val) && val.length !== void 0;
  });
  inst._zod.onattach.push((inst2) => {
    const curr = inst2._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
    if (def.maximum < curr)
      inst2._zod.bag.maximum = def.maximum;
  });
  inst._zod.check = (payload) => {
    const input = payload.value;
    const length = input.length;
    if (length <= def.maximum)
      return;
    const origin = getLengthableOrigin(input);
    payload.issues.push({
      origin,
      code: "too_big",
      maximum: def.maximum,
      inclusive: true,
      input,
      inst,
      continue: !def.abort
    });
  };
});
var $ZodCheckMinLength = /* @__PURE__ */ $constructor("$ZodCheckMinLength", (inst, def) => {
  var _a2;
  $ZodCheck.init(inst, def);
  (_a2 = inst._zod.def).when ?? (_a2.when = (payload) => {
    const val = payload.value;
    return !nullish(val) && val.length !== void 0;
  });
  inst._zod.onattach.push((inst2) => {
    const curr = inst2._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
    if (def.minimum > curr)
      inst2._zod.bag.minimum = def.minimum;
  });
  inst._zod.check = (payload) => {
    const input = payload.value;
    const length = input.length;
    if (length >= def.minimum)
      return;
    const origin = getLengthableOrigin(input);
    payload.issues.push({
      origin,
      code: "too_small",
      minimum: def.minimum,
      inclusive: true,
      input,
      inst,
      continue: !def.abort
    });
  };
});
var $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEquals", (inst, def) => {
  var _a2;
  $ZodCheck.init(inst, def);
  (_a2 = inst._zod.def).when ?? (_a2.when = (payload) => {
    const val = payload.value;
    return !nullish(val) && val.length !== void 0;
  });
  inst._zod.onattach.push((inst2) => {
    const bag = inst2._zod.bag;
    bag.minimum = def.length;
    bag.maximum = def.length;
    bag.length = def.length;
  });
  inst._zod.check = (payload) => {
    const input = payload.value;
    const length = input.length;
    if (length === def.length)
      return;
    const origin = getLengthableOrigin(input);
    const tooBig = length > def.length;
    payload.issues.push({
      origin,
      ...tooBig ? { code: "too_big", maximum: def.length } : { code: "too_small", minimum: def.length },
      inclusive: true,
      exact: true,
      input: payload.value,
      inst,
      continue: !def.abort
    });
  };
});
var $ZodCheckStringFormat = /* @__PURE__ */ $constructor("$ZodCheckStringFormat", (inst, def) => {
  var _a2, _b;
  $ZodCheck.init(inst, def);
  inst._zod.onattach.push((inst2) => {
    const bag = inst2._zod.bag;
    bag.format = def.format;
    if (def.pattern) {
      bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set());
      bag.patterns.add(def.pattern);
    }
  });
  if (def.pattern)
    (_a2 = inst._zod).check ?? (_a2.check = (payload) => {
      def.pattern.lastIndex = 0;
      if (def.pattern.test(payload.value))
        return;
      payload.issues.push({
        origin: "string",
        code: "invalid_format",
        format: def.format,
        input: payload.value,
        ...def.pattern ? { pattern: def.pattern.toString() } : {},
        inst,
        continue: !def.abort
      });
    });
  else
    (_b = inst._zod).check ?? (_b.check = () => {
    });
});
var $ZodCheckRegex = /* @__PURE__ */ $constructor("$ZodCheckRegex", (inst, def) => {
  $ZodCheckStringFormat.init(inst, def);
  inst._zod.check = (payload) => {
    def.pattern.lastIndex = 0;
    if (def.pattern.test(payload.value))
      return;
    payload.issues.push({
      origin: "string",
      code: "invalid_format",
      format: "regex",
      input: payload.value,
      pattern: def.pattern.toString(),
      inst,
      continue: !def.abort
    });
  };
});
var $ZodCheckLowerCase = /* @__PURE__ */ $constructor("$ZodCheckLowerCase", (inst, def) => {
  def.pattern ?? (def.pattern = lowercase);
  $ZodCheckStringFormat.init(inst, def);
});
var $ZodCheckUpperCase = /* @__PURE__ */ $constructor("$ZodCheckUpperCase", (inst, def) => {
  def.pattern ?? (def.pattern = uppercase);
  $ZodCheckStringFormat.init(inst, def);
});
var $ZodCheckIncludes = /* @__PURE__ */ $constructor("$ZodCheckIncludes", (inst, def) => {
  $ZodCheck.init(inst, def);
  const escapedRegex = escapeRegex(def.includes);
  const pattern = new RegExp(typeof def.position === "number" ? `^.{${def.position}}${escapedRegex}` : escapedRegex);
  def.pattern = pattern;
  inst._zod.onattach.push((inst2) => {
    const bag = inst2._zod.bag;
    bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set());
    bag.patterns.add(pattern);
  });
  inst._zod.check = (payload) => {
    if (payload.value.includes(def.includes, def.position))
      return;
    payload.issues.push({
      origin: "string",
      code: "invalid_format",
      format: "includes",
      includes: def.includes,
      input: payload.value,
      inst,
      continue: !def.abort
    });
  };
});
var $ZodCheckStartsWith = /* @__PURE__ */ $constructor("$ZodCheckStartsWith", (inst, def) => {
  $ZodCheck.init(inst, def);
  const pattern = new RegExp(`^${escapeRegex(def.prefix)}.*`);
  def.pattern ?? (def.pattern = pattern);
  inst._zod.onattach.push((inst2) => {
    const bag = inst2._zod.bag;
    bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set());
    bag.patterns.add(pattern);
  });
  inst._zod.check = (payload) => {
    if (payload.value.startsWith(def.prefix))
      return;
    payload.issues.push({
      origin: "string",
      code: "invalid_format",
      format: "starts_with",
      prefix: def.prefix,
      input: payload.value,
      inst,
      continue: !def.abort
    });
  };
});
var $ZodCheckEndsWith = /* @__PURE__ */ $constructor("$ZodCheckEndsWith", (inst, def) => {
  $ZodCheck.init(inst, def);
  const pattern = new RegExp(`.*${escapeRegex(def.suffix)}$`);
  def.pattern ?? (def.pattern = pattern);
  inst._zod.onattach.push((inst2) => {
    const bag = inst2._zod.bag;
    bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set());
    bag.patterns.add(pattern);
  });
  inst._zod.check = (payload) => {
    if (payload.value.endsWith(def.suffix))
      return;
    payload.issues.push({
      origin: "string",
      code: "invalid_format",
      format: "ends_with",
      suffix: def.suffix,
      input: payload.value,
      inst,
      continue: !def.abort
    });
  };
});
function handleCheckPropertyResult(result, payload, property) {
  if (result.issues.length) {
    payload.issues.push(...prefixIssues(property, result.issues));
  }
}
var $ZodCheckProperty = /* @__PURE__ */ $constructor("$ZodCheckProperty", (inst, def) => {
  $ZodCheck.init(inst, def);
  inst._zod.check = (payload) => {
    const result = def.schema._zod.run({
      value: payload.value[def.property],
      issues: []
    }, {});
    if (result instanceof Promise) {
      return result.then((result2) => handleCheckPropertyResult(result2, payload, def.property));
    }
    handleCheckPropertyResult(result, payload, def.property);
    return;
  };
});
var $ZodCheckMimeType = /* @__PURE__ */ $constructor("$ZodCheckMimeType", (inst, def) => {
  $ZodCheck.init(inst, def);
  const mimeSet = new Set(def.mime);
  inst._zod.onattach.push((inst2) => {
    inst2._zod.bag.mime = def.mime;
  });
  inst._zod.check = (payload) => {
    if (mimeSet.has(payload.value.type))
      return;
    payload.issues.push({
      code: "invalid_value",
      values: def.mime,
      input: payload.value.type,
      inst,
      continue: !def.abort
    });
  };
});
var $ZodCheckOverwrite = /* @__PURE__ */ $constructor("$ZodCheckOverwrite", (inst, def) => {
  $ZodCheck.init(inst, def);
  inst._zod.check = (payload) => {
    payload.value = def.tx(payload.value);
  };
});

// node_modules/zod/v4/core/doc.js
var Doc = class {
  constructor(args = []) {
    this.content = [];
    this.indent = 0;
    if (this)
      this.args = args;
  }
  indented(fn) {
    this.indent += 1;
    fn(this);
    this.indent -= 1;
  }
  write(arg) {
    if (typeof arg === "function") {
      arg(this, { execution: "sync" });
      arg(this, { execution: "async" });
      return;
    }
    const content = arg;
    const lines = content.split("\n").filter((x) => x);
    const minIndent = Math.min(...lines.map((x) => x.length - x.trimStart().length));
    const dedented = lines.map((x) => x.slice(minIndent)).map((x) => " ".repeat(this.indent * 2) + x);
    for (const line of dedented) {
      this.content.push(line);
    }
  }
  compile() {
    const F = Function;
    const args = this?.args;
    const content = this?.content ?? [``];
    const lines = [...content.map((x) => `  ${x}`)];
    return new F(...args, lines.join("\n"));
  }
};

// node_modules/zod/v4/core/versions.js
var version = {
  major: 4,
  minor: 3,
  patch: 6
};

// node_modules/zod/v4/core/schemas.js
var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
  var _a2;
  inst ?? (inst = {});
  inst._zod.def = def;
  inst._zod.bag = inst._zod.bag || {};
  inst._zod.version = version;
  const checks = [...inst._zod.def.checks ?? []];
  if (inst._zod.traits.has("$ZodCheck")) {
    checks.unshift(inst);
  }
  for (const ch of checks) {
    for (const fn of ch._zod.onattach) {
      fn(inst);
    }
  }
  if (checks.length === 0) {
    (_a2 = inst._zod).deferred ?? (_a2.deferred = []);
    inst._zod.deferred?.push(() => {
      inst._zod.run = inst._zod.parse;
    });
  } else {
    const runChecks = (payload, checks2, ctx) => {
      let isAborted2 = aborted(payload);
      let asyncResult;
      for (const ch of checks2) {
        if (ch._zod.def.when) {
          const shouldRun = ch._zod.def.when(payload);
          if (!shouldRun)
            continue;
        } else if (isAborted2) {
          continue;
        }
        const currLen = payload.issues.length;
        const _ = ch._zod.check(payload);
        if (_ instanceof Promise && ctx?.async === false) {
          throw new $ZodAsyncError();
        }
        if (asyncResult || _ instanceof Promise) {
          asyncResult = (asyncResult ?? Promise.resolve()).then(async () => {
            await _;
            const nextLen = payload.issues.length;
            if (nextLen === currLen)
              return;
            if (!isAborted2)
              isAborted2 = aborted(payload, currLen);
          });
        } else {
          const nextLen = payload.issues.length;
          if (nextLen === currLen)
            continue;
          if (!isAborted2)
            isAborted2 = aborted(payload, currLen);
        }
      }
      if (asyncResult) {
        return asyncResult.then(() => {
          return payload;
        });
      }
      return payload;
    };
    const handleCanaryResult = (canary, payload, ctx) => {
      if (aborted(canary)) {
        canary.aborted = true;
        return canary;
      }
      const checkResult = runChecks(payload, checks, ctx);
      if (checkResult instanceof Promise) {
        if (ctx.async === false)
          throw new $ZodAsyncError();
        return checkResult.then((checkResult2) => inst._zod.parse(checkResult2, ctx));
      }
      return inst._zod.parse(checkResult, ctx);
    };
    inst._zod.run = (payload, ctx) => {
      if (ctx.skipChecks) {
        return inst._zod.parse(payload, ctx);
      }
      if (ctx.direction === "backward") {
        const canary = inst._zod.parse({ value: payload.value, issues: [] }, { ...ctx, skipChecks: true });
        if (canary instanceof Promise) {
          return canary.then((canary2) => {
            return handleCanaryResult(canary2, payload, ctx);
          });
        }
        return handleCanaryResult(canary, payload, ctx);
      }
      const result = inst._zod.parse(payload, ctx);
      if (result instanceof Promise) {
        if (ctx.async === false)
          throw new $ZodAsyncError();
        return result.then((result2) => runChecks(result2, checks, ctx));
      }
      return runChecks(result, checks, ctx);
    };
  }
  defineLazy(inst, "~standard", () => ({
    validate: (value) => {
      try {
        const r = safeParse(inst, value);
        return r.success ? { value: r.data } : { issues: r.error?.issues };
      } catch (_) {
        return safeParseAsync(inst, value).then((r) => r.success ? { value: r.data } : { issues: r.error?.issues });
      }
    },
    vendor: "zod",
    version: 1
  }));
});
var $ZodString = /* @__PURE__ */ $constructor("$ZodString", (inst, def) => {
  $ZodType.init(inst, def);
  inst._zod.pattern = [...inst?._zod.bag?.patterns ?? []].pop() ?? string(inst._zod.bag);
  inst._zod.parse = (payload, _) => {
    if (def.coerce)
      try {
        payload.value = String(payload.value);
      } catch (_2) {
      }
    if (typeof payload.value === "string")
      return payload;
    payload.issues.push({
      expected: "string",
      code: "invalid_type",
      input: payload.value,
      inst
    });
    return payload;
  };
});
var $ZodStringFormat = /* @__PURE__ */ $constructor("$ZodStringFormat", (inst, def) => {
  $ZodCheckStringFormat.init(inst, def);
  $ZodString.init(inst, def);
});
var $ZodGUID = /* @__PURE__ */ $constructor("$ZodGUID", (inst, def) => {
  def.pattern ?? (def.pattern = guid);
  $ZodStringFormat.init(inst, def);
});
var $ZodUUID = /* @__PURE__ */ $constructor("$ZodUUID", (inst, def) => {
  if (def.version) {
    const versionMap = {
      v1: 1,
      v2: 2,
      v3: 3,
      v4: 4,
      v5: 5,
      v6: 6,
      v7: 7,
      v8: 8
    };
    const v = versionMap[def.version];
    if (v === void 0)
      throw new Error(`Invalid UUID version: "${def.version}"`);
    def.pattern ?? (def.pattern = uuid(v));
  } else
    def.pattern ?? (def.pattern = uuid());
  $ZodStringFormat.init(inst, def);
});
var $ZodEmail = /* @__PURE__ */ $constructor("$ZodEmail", (inst, def) => {
  def.pattern ?? (def.pattern = email);
  $ZodStringFormat.init(inst, def);
});
var $ZodURL = /* @__PURE__ */ $constructor("$ZodURL", (inst, def) => {
  $ZodStringFormat.init(inst, def);
  inst._zod.check = (payload) => {
    try {
      const trimmed = payload.value.trim();
      const url2 = new URL(trimmed);
      if (def.hostname) {
        def.hostname.lastIndex = 0;
        if (!def.hostname.test(url2.hostname)) {
          payload.issues.push({
            code: "invalid_format",
            format: "url",
            note: "Invalid hostname",
            pattern: def.hostname.source,
            input: payload.value,
            inst,
            continue: !def.abort
          });
        }
      }
      if (def.protocol) {
        def.protocol.lastIndex = 0;
        if (!def.protocol.test(url2.protocol.endsWith(":") ? url2.protocol.slice(0, -1) : url2.protocol)) {
          payload.issues.push({
            code: "invalid_format",
            format: "url",
            note: "Invalid protocol",
            pattern: def.protocol.source,
            input: payload.value,
            inst,
            continue: !def.abort
          });
        }
      }
      if (def.normalize) {
        payload.value = url2.href;
      } else {
        payload.value = trimmed;
      }
      return;
    } catch (_) {
      payload.issues.push({
        code: "invalid_format",
        format: "url",
        input: payload.value,
        inst,
        continue: !def.abort
      });
    }
  };
});
var $ZodEmoji = /* @__PURE__ */ $constructor("$ZodEmoji", (inst, def) => {
  def.pattern ?? (def.pattern = emoji());
  $ZodStringFormat.init(inst, def);
});
var $ZodNanoID = /* @__PURE__ */ $constructor("$ZodNanoID", (inst, def) => {
  def.pattern ?? (def.pattern = nanoid);
  $ZodStringFormat.init(inst, def);
});
var $ZodCUID = /* @__PURE__ */ $constructor("$ZodCUID", (inst, def) => {
  def.pattern ?? (def.pattern = cuid);
  $ZodStringFormat.init(inst, def);
});
var $ZodCUID2 = /* @__PURE__ */ $constructor("$ZodCUID2", (inst, def) => {
  def.pattern ?? (def.pattern = cuid2);
  $ZodStringFormat.init(inst, def);
});
var $ZodULID = /* @__PURE__ */ $constructor("$ZodULID", (inst, def) => {
  def.pattern ?? (def.pattern = ulid);
  $ZodStringFormat.init(inst, def);
});
var $ZodXID = /* @__PURE__ */ $constructor("$ZodXID", (inst, def) => {
  def.pattern ?? (def.pattern = xid);
  $ZodStringFormat.init(inst, def);
});
var $ZodKSUID = /* @__PURE__ */ $constructor("$ZodKSUID", (inst, def) => {
  def.pattern ?? (def.pattern = ksuid);
  $ZodStringFormat.init(inst, def);
});
var $ZodISODateTime = /* @__PURE__ */ $constructor("$ZodISODateTime", (inst, def) => {
  def.pattern ?? (def.pattern = datetime(def));
  $ZodStringFormat.init(inst, def);
});
var $ZodISODate = /* @__PURE__ */ $constructor("$ZodISODate", (inst, def) => {
  def.pattern ?? (def.pattern = date);
  $ZodStringFormat.init(inst, def);
});
var $ZodISOTime = /* @__PURE__ */ $constructor("$ZodISOTime", (inst, def) => {
  def.pattern ?? (def.pattern = time(def));
  $ZodStringFormat.init(inst, def);
});
var $ZodISODuration = /* @__PURE__ */ $constructor("$ZodISODuration", (inst, def) => {
  def.pattern ?? (def.pattern = duration);
  $ZodStringFormat.init(inst, def);
});
var $ZodIPv4 = /* @__PURE__ */ $constructor("$ZodIPv4", (inst, def) => {
  def.pattern ?? (def.pattern = ipv4);
  $ZodStringFormat.init(inst, def);
  inst._zod.bag.format = `ipv4`;
});
var $ZodIPv6 = /* @__PURE__ */ $constructor("$ZodIPv6", (inst, def) => {
  def.pattern ?? (def.pattern = ipv6);
  $ZodStringFormat.init(inst, def);
  inst._zod.bag.format = `ipv6`;
  inst._zod.check = (payload) => {
    try {
      new URL(`http://[${payload.value}]`);
    } catch {
      payload.issues.push({
        code: "invalid_format",
        format: "ipv6",
        input: payload.value,
        inst,
        continue: !def.abort
      });
    }
  };
});
var $ZodMAC = /* @__PURE__ */ $constructor("$ZodMAC", (inst, def) => {
  def.pattern ?? (def.pattern = mac(def.delimiter));
  $ZodStringFormat.init(inst, def);
  inst._zod.bag.format = `mac`;
});
var $ZodCIDRv4 = /* @__PURE__ */ $constructor("$ZodCIDRv4", (inst, def) => {
  def.pattern ?? (def.pattern = cidrv4);
  $ZodStringFormat.init(inst, def);
});
var $ZodCIDRv6 = /* @__PURE__ */ $constructor("$ZodCIDRv6", (inst, def) => {
  def.pattern ?? (def.pattern = cidrv6);
  $ZodStringFormat.init(inst, def);
  inst._zod.check = (payload) => {
    const parts = payload.value.split("/");
    try {
      if (parts.length !== 2)
        throw new Error();
      const [address, prefix] = parts;
      if (!prefix)
        throw new Error();
      const prefixNum = Number(prefix);
      if (`${prefixNum}` !== prefix)
        throw new Error();
      if (prefixNum < 0 || prefixNum > 128)
        throw new Error();
      new URL(`http://[${address}]`);
    } catch {
      payload.issues.push({
        code: "invalid_format",
        format: "cidrv6",
        input: payload.value,
        inst,
        continue: !def.abort
      });
    }
  };
});
function isValidBase64(data) {
  if (data === "")
    return true;
  if (data.length % 4 !== 0)
    return false;
  try {
    atob(data);
    return true;
  } catch {
    return false;
  }
}
var $ZodBase64 = /* @__PURE__ */ $constructor("$ZodBase64", (inst, def) => {
  def.pattern ?? (def.pattern = base64);
  $ZodStringFormat.init(inst, def);
  inst._zod.bag.contentEncoding = "base64";
  inst._zod.check = (payload) => {
    if (isValidBase64(payload.value))
      return;
    payload.issues.push({
      code: "invalid_format",
      format: "base64",
      input: payload.value,
      inst,
      continue: !def.abort
    });
  };
});
function isValidBase64URL(data) {
  if (!base64url.test(data))
    return false;
  const base643 = data.replace(/[-_]/g, (c) => c === "-" ? "+" : "/");
  const padded = base643.padEnd(Math.ceil(base643.length / 4) * 4, "=");
  return isValidBase64(padded);
}
var $ZodBase64URL = /* @__PURE__ */ $constructor("$ZodBase64URL", (inst, def) => {
  def.pattern ?? (def.pattern = base64url);
  $ZodStringFormat.init(inst, def);
  inst._zod.bag.contentEncoding = "base64url";
  inst._zod.check = (payload) => {
    if (isValidBase64URL(payload.value))
      return;
    payload.issues.push({
      code: "invalid_format",
      format: "base64url",
      input: payload.value,
      inst,
      continue: !def.abort
    });
  };
});
var $ZodE164 = /* @__PURE__ */ $constructor("$ZodE164", (inst, def) => {
  def.pattern ?? (def.pattern = e164);
  $ZodStringFormat.init(inst, def);
});
function isValidJWT(token, algorithm = null) {
  try {
    const tokensParts = token.split(".");
    if (tokensParts.length !== 3)
      return false;
    const [header] = tokensParts;
    if (!header)
      return false;
    const parsedHeader = JSON.parse(atob(header));
    if ("typ" in parsedHeader && parsedHeader?.typ !== "JWT")
      return false;
    if (!parsedHeader.alg)
      return false;
    if (algorithm && (!("alg" in parsedHeader) || parsedHeader.alg !== algorithm))
      return false;
    return true;
  } catch {
    return false;
  }
}
var $ZodJWT = /* @__PURE__ */ $constructor("$ZodJWT", (inst, def) => {
  $ZodStringFormat.init(inst, def);
  inst._zod.check = (payload) => {
    if (isValidJWT(payload.value, def.alg))
      return;
    payload.issues.push({
      code: "invalid_format",
      format: "jwt",
      input: payload.value,
      inst,
      continue: !def.abort
    });
  };
});
var $ZodCustomStringFormat = /* @__PURE__ */ $constructor("$ZodCustomStringFormat", (inst, def) => {
  $ZodStringFormat.init(inst, def);
  inst._zod.check = (payload) => {
    if (def.fn(payload.value))
      return;
    payload.issues.push({
      code: "invalid_format",
      format: def.format,
      input: payload.value,
      inst,
      continue: !def.abort
    });
  };
});
var $ZodNumber = /* @__PURE__ */ $constructor("$ZodNumber", (inst, def) => {
  $ZodType.init(inst, def);
  inst._zod.pattern = inst._zod.bag.pattern ?? number;
  inst._zod.parse = (payload, _ctx) => {
    if (def.coerce)
      try {
        payload.value = Number(payload.value);
      } catch (_) {
      }
    const input = payload.value;
    if (typeof input === "number" && !Number.isNaN(input) && Number.isFinite(input)) {
      return payload;
    }
    const received = typeof input === "number" ? Number.isNaN(input) ? "NaN" : !Number.isFinite(input) ? "Infinity" : void 0 : void 0;
    payload.issues.push({
      expected: "number",
      code: "invalid_type",
      input,
      inst,
      ...received ? { received } : {}
    });
    return payload;
  };
});
var $ZodNumberFormat = /* @__PURE__ */ $constructor("$ZodNumberFormat", (inst, def) => {
  $ZodCheckNumberFormat.init(inst, def);
  $ZodNumber.init(inst, def);
});
var $ZodBoolean = /* @__PURE__ */ $constructor("$ZodBoolean", (inst, def) => {
  $ZodType.init(inst, def);
  inst._zod.pattern = boolean;
  inst._zod.parse = (payload, _ctx) => {
    if (def.coerce)
      try {
        payload.value = Boolean(payload.value);
      } catch (_) {
      }
    const input = payload.value;
    if (typeof input === "boolean")
      return payload;
    payload.issues.push({
      expected: "boolean",
      code: "invalid_type",
      input,
      inst
    });
    return payload;
  };
});
var $ZodBigInt = /* @__PURE__ */ $constructor("$ZodBigInt", (inst, def) => {
  $ZodType.init(inst, def);
  inst._zod.pattern = bigint;
  inst._zod.parse = (payload, _ctx) => {
    if (def.coerce)
      try {
        payload.value = BigInt(payload.value);
      } catch (_) {
      }
    if (typeof payload.value === "bigint")
      return payload;
    payload.issues.push({
      expected: "bigint",
      code: "invalid_type",
      input: payload.value,
      inst
    });
    return payload;
  };
});
var $ZodBigIntFormat = /* @__PURE__ */ $constructor("$ZodBigIntFormat", (inst, def) => {
  $ZodCheckBigIntFormat.init(inst, def);
  $ZodBigInt.init(inst, def);
});
var $ZodSymbol = /* @__PURE__ */ $constructor("$ZodSymbol", (inst, def) => {
  $ZodType.init(inst, def);
  inst._zod.parse = (payload, _ctx) => {
    const input = payload.value;
    if (typeof input === "symbol")
      return payload;
    payload.issues.push({
      expected: "symbol",
      code: "invalid_type",
      input,
      inst
    });
    return payload;
  };
});
var $ZodUndefined = /* @__PURE__ */ $constructor("$ZodUndefined", (inst, def) => {
  $ZodType.init(inst, def);
  inst._zod.pattern = _undefined;
  inst._zod.values = /* @__PURE__ */ new Set([void 0]);
  inst._zod.optin = "optional";
  inst._zod.optout = "optional";
  inst._zod.parse = (payload, _ctx) => {
    const input = payload.value;
    if (typeof input === "undefined")
      return payload;
    payload.issues.push({
      expected: "undefined",
      code: "invalid_type",
      input,
      inst
    });
    return payload;
  };
});
var $ZodNull = /* @__PURE__ */ $constructor("$ZodNull", (inst, def) => {
  $ZodType.init(inst, def);
  inst._zod.pattern = _null;
  inst._zod.values = /* @__PURE__ */ new Set([null]);
  inst._zod.parse = (payload, _ctx) => {
    const input = payload.value;
    if (input === null)
      return payload;
    payload.issues.push({
      expected: "null",
      code: "invalid_type",
      input,
      inst
    });
    return payload;
  };
});
var $ZodAny = /* @__PURE__ */ $constructor("$ZodAny", (inst, def) => {
  $ZodType.init(inst, def);
  inst._zod.parse = (payload) => payload;
});
var $ZodUnknown = /* @__PURE__ */ $constructor("$ZodUnknown", (inst, def) => {
  $ZodType.init(inst, def);
  inst._zod.parse = (payload) => payload;
});
var $ZodNever = /* @__PURE__ */ $constructor("$ZodNever", (inst, def) => {
  $ZodType.init(inst, def);
  inst._zod.parse = (payload, _ctx) => {
    payload.issues.push({
      expected: "never",
      code: "invalid_type",
      input: payload.value,
      inst
    });
    return payload;
  };
});
var $ZodVoid = /* @__PURE__ */ $constructor("$ZodVoid", (inst, def) => {
  $ZodType.init(inst, def);
  inst._zod.parse = (payload, _ctx) => {
    const input = payload.value;
    if (typeof input === "undefined")
      return payload;
    payload.issues.push({
      expected: "void",
      code: "invalid_type",
      input,
      inst
    });
    return payload;
  };
});
var $ZodDate = /* @__PURE__ */ $constructor("$ZodDate", (inst, def) => {
  $ZodType.init(inst, def);
  inst._zod.parse = (payload, _ctx) => {
    if (def.coerce) {
      try {
        payload.value = new Date(payload.value);
      } catch (_err) {
      }
    }
    const input = payload.value;
    const isDate = input instanceof Date;
    const isValidDate = isDate && !Number.isNaN(input.getTime());
    if (isValidDate)
      return payload;
    payload.issues.push({
      expected: "date",
      code: "invalid_type",
      input,
      ...isDate ? { received: "Invalid Date" } : {},
      inst
    });
    return payload;
  };
});
function handleArrayResult(result, final, index) {
  if (result.issues.length) {
    final.issues.push(...prefixIssues(index, result.issues));
  }
  final.value[index] = result.value;
}
var $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
  $ZodType.init(inst, def);
  inst._zod.parse = (payload, ctx) => {
    const input = payload.value;
    if (!Array.isArray(input)) {
      payload.issues.push({
        expected: "array",
        code: "invalid_type",
        input,
        inst
      });
      return payload;
    }
    payload.value = Array(input.length);
    const proms = [];
    for (let i = 0; i < input.length; i++) {
      const item = input[i];
      const result = def.element._zod.run({
        value: item,
        issues: []
      }, ctx);
      if (result instanceof Promise) {
        proms.push(result.then((result2) => handleArrayResult(result2, payload, i)));
      } else {
        handleArrayResult(result, payload, i);
      }
    }
    if (proms.length) {
      return Promise.all(proms).then(() => payload);
    }
    return payload;
  };
});
function handlePropertyResult(result, final, key, input, isOptionalOut) {
  if (result.issues.length) {
    if (isOptionalOut && !(key in input)) {
      return;
    }
    final.issues.push(...prefixIssues(key, result.issues));
  }
  if (result.value === void 0) {
    if (key in input) {
      final.value[key] = void 0;
    }
  } else {
    final.value[key] = result.value;
  }
}
function normalizeDef(def) {
  const keys = Object.keys(def.shape);
  for (const k of keys) {
    if (!def.shape?.[k]?._zod?.traits?.has("$ZodType")) {
      throw new Error(`Invalid element at key "${k}": expected a Zod schema`);
    }
  }
  const okeys = optionalKeys(def.shape);
  return {
    ...def,
    keys,
    keySet: new Set(keys),
    numKeys: keys.length,
    optionalKeys: new Set(okeys)
  };
}
function handleCatchall(proms, input, payload, ctx, def, inst) {
  const unrecognized = [];
  const keySet = def.keySet;
  const _catchall = def.catchall._zod;
  const t = _catchall.def.type;
  const isOptionalOut = _catchall.optout === "optional";
  for (const key in input) {
    if (keySet.has(key))
      continue;
    if (t === "never") {
      unrecognized.push(key);
      continue;
    }
    const r = _catchall.run({ value: input[key], issues: [] }, ctx);
    if (r instanceof Promise) {
      proms.push(r.then((r2) => handlePropertyResult(r2, payload, key, input, isOptionalOut)));
    } else {
      handlePropertyResult(r, payload, key, input, isOptionalOut);
    }
  }
  if (unrecognized.length) {
    payload.issues.push({
      code: "unrecognized_keys",
      keys: unrecognized,
      input,
      inst
    });
  }
  if (!proms.length)
    return payload;
  return Promise.all(proms).then(() => {
    return payload;
  });
}
var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
  $ZodType.init(inst, def);
  const desc = Object.getOwnPropertyDescriptor(def, "shape");
  if (!desc?.get) {
    const sh = def.shape;
    Object.defineProperty(def, "shape", {
      get: () => {
        const newSh = { ...sh };
        Object.defineProperty(def, "shape", {
          value: newSh
        });
        return newSh;
      }
    });
  }
  const _normalized = cached(() => normalizeDef(def));
  defineLazy(inst._zod, "propValues", () => {
    const shape = def.shape;
    const propValues = {};
    for (const key in shape) {
      const field = shape[key]._zod;
      if (field.values) {
        propValues[key] ?? (propValues[key] = /* @__PURE__ */ new Set());
        for (const v of field.values)
          propValues[key].add(v);
      }
    }
    return propValues;
  });
  const isObject2 = isObject;
  const catchall = def.catchall;
  let value;
  inst._zod.parse = (payload, ctx) => {
    value ?? (value = _normalized.value);
    const input = payload.value;
    if (!isObject2(input)) {
      payload.issues.push({
        expected: "object",
        code: "invalid_type",
        input,
        inst
      });
      return payload;
    }
    payload.value = {};
    const proms = [];
    const shape = value.shape;
    for (const key of value.keys) {
      const el = shape[key];
      const isOptionalOut = el._zod.optout === "optional";
      const r = el._zod.run({ value: input[key], issues: [] }, ctx);
      if (r instanceof Promise) {
        proms.push(r.then((r2) => handlePropertyResult(r2, payload, key, input, isOptionalOut)));
      } else {
        handlePropertyResult(r, payload, key, input, isOptionalOut);
      }
    }
    if (!catchall) {
      return proms.length ? Promise.all(proms).then(() => payload) : payload;
    }
    return handleCatchall(proms, input, payload, ctx, _normalized.value, inst);
  };
});
var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) => {
  $ZodObject.init(inst, def);
  const superParse = inst._zod.parse;
  const _normalized = cached(() => normalizeDef(def));
  const generateFastpass = (shape) => {
    const doc = new Doc(["shape", "payload", "ctx"]);
    const normalized = _normalized.value;
    const parseStr = (key) => {
      const k = esc(key);
      return `shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`;
    };
    doc.write(`const input = payload.value;`);
    const ids = /* @__PURE__ */ Object.create(null);
    let counter = 0;
    for (const key of normalized.keys) {
      ids[key] = `key_${counter++}`;
    }
    doc.write(`const newResult = {};`);
    for (const key of normalized.keys) {
      const id = ids[key];
      const k = esc(key);
      const schema = shape[key];
      const isOptionalOut = schema?._zod?.optout === "optional";
      doc.write(`const ${id} = ${parseStr(key)};`);
      if (isOptionalOut) {
        doc.write(`
        if (${id}.issues.length) {
          if (${k} in input) {
            payload.issues = payload.issues.concat(${id}.issues.map(iss => ({
              ...iss,
              path: iss.path ? [${k}, ...iss.path] : [${k}]
            })));
          }
        }
        
        if (${id}.value === undefined) {
          if (${k} in input) {
            newResult[${k}] = undefined;
          }
        } else {
          newResult[${k}] = ${id}.value;
        }
        
      `);
      } else {
        doc.write(`
        if (${id}.issues.length) {
          payload.issues = payload.issues.concat(${id}.issues.map(iss => ({
            ...iss,
            path: iss.path ? [${k}, ...iss.path] : [${k}]
          })));
        }
        
        if (${id}.value === undefined) {
          if (${k} in input) {
            newResult[${k}] = undefined;
          }
        } else {
          newResult[${k}] = ${id}.value;
        }
        
      `);
      }
    }
    doc.write(`payload.value = newResult;`);
    doc.write(`return payload;`);
    const fn = doc.compile();
    return (payload, ctx) => fn(shape, payload, ctx);
  };
  let fastpass;
  const isObject2 = isObject;
  const jit = !globalConfig.jitless;
  const allowsEval2 = allowsEval;
  const fastEnabled = jit && allowsEval2.value;
  const catchall = def.catchall;
  let value;
  inst._zod.parse = (payload, ctx) => {
    value ?? (value = _normalized.value);
    const input = payload.value;
    if (!isObject2(input)) {
      payload.issues.push({
        expected: "object",
        code: "invalid_type",
        input,
        inst
      });
      return payload;
    }
    if (jit && fastEnabled && ctx?.async === false && ctx.jitless !== true) {
      if (!fastpass)
        fastpass = generateFastpass(def.shape);
      payload = fastpass(payload, ctx);
      if (!catchall)
        return payload;
      return handleCatchall([], input, payload, ctx, value, inst);
    }
    return superParse(payload, ctx);
  };
});
function handleUnionResults(results, final, inst, ctx) {
  for (const result of results) {
    if (result.issues.length === 0) {
      final.value = result.value;
      return final;
    }
  }
  const nonaborted = results.filter((r) => !aborted(r));
  if (nonaborted.length === 1) {
    final.value = nonaborted[0].value;
    return nonaborted[0];
  }
  final.issues.push({
    code: "invalid_union",
    input: final.value,
    inst,
    errors: results.map((result) => result.issues.map((iss) => finalizeIssue(iss, ctx, config())))
  });
  return final;
}
var $ZodUnion = /* @__PURE__ */ $constructor("$ZodUnion", (inst, def) => {
  $ZodType.init(inst, def);
  defineLazy(inst._zod, "optin", () => def.options.some((o) => o._zod.optin === "optional") ? "optional" : void 0);
  defineLazy(inst._zod, "optout", () => def.options.some((o) => o._zod.optout === "optional") ? "optional" : void 0);
  defineLazy(inst._zod, "values", () => {
    if (def.options.every((o) => o._zod.values)) {
      return new Set(def.options.flatMap((option) => Array.from(option._zod.values)));
    }
    return void 0;
  });
  defineLazy(inst._zod, "pattern", () => {
    if (def.options.every((o) => o._zod.pattern)) {
      const patterns = def.options.map((o) => o._zod.pattern);
      return new RegExp(`^(${patterns.map((p) => cleanRegex(p.source)).join("|")})$`);
    }
    return void 0;
  });
  const single = def.options.length === 1;
  const first = def.options[0]._zod.run;
  inst._zod.parse = (payload, ctx) => {
    if (single) {
      return first(payload, ctx);
    }
    let async = false;
    const results = [];
    for (const option of def.options) {
      const result = option._zod.run({
        value: payload.value,
        issues: []
      }, ctx);
      if (result instanceof Promise) {
        results.push(result);
        async = true;
      } else {
        if (result.issues.length === 0)
          return result;
        results.push(result);
      }
    }
    if (!async)
      return handleUnionResults(results, payload, inst, ctx);
    return Promise.all(results).then((results2) => {
      return handleUnionResults(results2, payload, inst, ctx);
    });
  };
});
function handleExclusiveUnionResults(results, final, inst, ctx) {
  const successes = results.filter((r) => r.issues.length === 0);
  if (successes.length === 1) {
    final.value = successes[0].value;
    return final;
  }
  if (successes.length === 0) {
    final.issues.push({
      code: "invalid_union",
      input: final.value,
      inst,
      errors: results.map((result) => result.issues.map((iss) => finalizeIssue(iss, ctx, config())))
    });
  } else {
    final.issues.push({
      code: "invalid_union",
      input: final.value,
      inst,
      errors: [],
      inclusive: false
    });
  }
  return final;
}
var $ZodXor = /* @__PURE__ */ $constructor("$ZodXor", (inst, def) => {
  $ZodUnion.init(inst, def);
  def.inclusive = false;
  const single = def.options.length === 1;
  const first = def.options[0]._zod.run;
  inst._zod.parse = (payload, ctx) => {
    if (single) {
      return first(payload, ctx);
    }
    let async = false;
    const results = [];
    for (const option of def.options) {
      const result = option._zod.run({
        value: payload.value,
        issues: []
      }, ctx);
      if (result instanceof Promise) {
        results.push(result);
        async = true;
      } else {
        results.push(result);
      }
    }
    if (!async)
      return handleExclusiveUnionResults(results, payload, inst, ctx);
    return Promise.all(results).then((results2) => {
      return handleExclusiveUnionResults(results2, payload, inst, ctx);
    });
  };
});
var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnion", (inst, def) => {
  def.inclusive = false;
  $ZodUnion.init(inst, def);
  const _super = inst._zod.parse;
  defineLazy(inst._zod, "propValues", () => {
    const propValues = {};
    for (const option of def.options) {
      const pv = option._zod.propValues;
      if (!pv || Object.keys(pv).length === 0)
        throw new Error(`Invalid discriminated union option at index "${def.options.indexOf(option)}"`);
      for (const [k, v] of Object.entries(pv)) {
        if (!propValues[k])
          propValues[k] = /* @__PURE__ */ new Set();
        for (const val of v) {
          propValues[k].add(val);
        }
      }
    }
    return propValues;
  });
  const disc = cached(() => {
    const opts = def.options;
    const map2 = /* @__PURE__ */ new Map();
    for (const o of opts) {
      const values = o._zod.propValues?.[def.discriminator];
      if (!values || values.size === 0)
        throw new Error(`Invalid discriminated union option at index "${def.options.indexOf(o)}"`);
      for (const v of values) {
        if (map2.has(v)) {
          throw new Error(`Duplicate discriminator value "${String(v)}"`);
        }
        map2.set(v, o);
      }
    }
    return map2;
  });
  inst._zod.parse = (payload, ctx) => {
    const input = payload.value;
    if (!isObject(input)) {
      payload.issues.push({
        code: "invalid_type",
        expected: "object",
        input,
        inst
      });
      return payload;
    }
    const opt = disc.value.get(input?.[def.discriminator]);
    if (opt) {
      return opt._zod.run(payload, ctx);
    }
    if (def.unionFallback) {
      return _super(payload, ctx);
    }
    payload.issues.push({
      code: "invalid_union",
      errors: [],
      note: "No matching discriminator",
      discriminator: def.discriminator,
      input,
      path: [def.discriminator],
      inst
    });
    return payload;
  };
});
var $ZodIntersection = /* @__PURE__ */ $constructor("$ZodIntersection", (inst, def) => {
  $ZodType.init(inst, def);
  inst._zod.parse = (payload, ctx) => {
    const input = payload.value;
    const left = def.left._zod.run({ value: input, issues: [] }, ctx);
    const right = def.right._zod.run({ value: input, issues: [] }, ctx);
    const async = left instanceof Promise || right instanceof Promise;
    if (async) {
      return Promise.all([left, right]).then(([left2, right2]) => {
        return handleIntersectionResults(payload, left2, right2);
      });
    }
    return handleIntersectionResults(payload, left, right);
  };
});
function mergeValues(a, b) {
  if (a === b) {
    return { valid: true, data: a };
  }
  if (a instanceof Date && b instanceof Date && +a === +b) {
    return { valid: true, data: a };
  }
  if (isPlainObject(a) && isPlainObject(b)) {
    const bKeys = Object.keys(b);
    const sharedKeys = Object.keys(a).filter((key) => bKeys.indexOf(key) !== -1);
    const newObj = { ...a, ...b };
    for (const key of sharedKeys) {
      const sharedValue = mergeValues(a[key], b[key]);
      if (!sharedValue.valid) {
        return {
          valid: false,
          mergeErrorPath: [key, ...sharedValue.mergeErrorPath]
        };
      }
      newObj[key] = sharedValue.data;
    }
    return { valid: true, data: newObj };
  }
  if (Array.isArray(a) && Array.isArray(b)) {
    if (a.length !== b.length) {
      return { valid: false, mergeErrorPath: [] };
    }
    const newArray = [];
    for (let index = 0; index < a.length; index++) {
      const itemA = a[index];
      const itemB = b[index];
      const sharedValue = mergeValues(itemA, itemB);
      if (!sharedValue.valid) {
        return {
          valid: false,
          mergeErrorPath: [index, ...sharedValue.mergeErrorPath]
        };
      }
      newArray.push(sharedValue.data);
    }
    return { valid: true, data: newArray };
  }
  return { valid: false, mergeErrorPath: [] };
}
function handleIntersectionResults(result, left, right) {
  const unrecKeys = /* @__PURE__ */ new Map();
  let unrecIssue;
  for (const iss of left.issues) {
    if (iss.code === "unrecognized_keys") {
      unrecIssue ?? (unrecIssue = iss);
      for (const k of iss.keys) {
        if (!unrecKeys.has(k))
          unrecKeys.set(k, {});
        unrecKeys.get(k).l = true;
      }
    } else {
      result.issues.push(iss);
    }
  }
  for (const iss of right.issues) {
    if (iss.code === "unrecognized_keys") {
      for (const k of iss.keys) {
        if (!unrecKeys.has(k))
          unrecKeys.set(k, {});
        unrecKeys.get(k).r = true;
      }
    } else {
      result.issues.push(iss);
    }
  }
  const bothKeys = [...unrecKeys].filter(([, f]) => f.l && f.r).map(([k]) => k);
  if (bothKeys.length && unrecIssue) {
    result.issues.push({ ...unrecIssue, keys: bothKeys });
  }
  if (aborted(result))
    return result;
  const merged = mergeValues(left.value, right.value);
  if (!merged.valid) {
    throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(merged.mergeErrorPath)}`);
  }
  result.value = merged.data;
  return result;
}
var $ZodTuple = /* @__PURE__ */ $constructor("$ZodTuple", (inst, def) => {
  $ZodType.init(inst, def);
  const items = def.items;
  inst._zod.parse = (payload, ctx) => {
    const input = payload.value;
    if (!Array.isArray(input)) {
      payload.issues.push({
        input,
        inst,
        expected: "tuple",
        code: "invalid_type"
      });
      return payload;
    }
    payload.value = [];
    const proms = [];
    const reversedIndex = [...items].reverse().findIndex((item) => item._zod.optin !== "optional");
    const optStart = reversedIndex === -1 ? 0 : items.length - reversedIndex;
    if (!def.rest) {
      const tooBig = input.length > items.length;
      const tooSmall = input.length < optStart - 1;
      if (tooBig || tooSmall) {
        payload.issues.push({
          ...tooBig ? { code: "too_big", maximum: items.length, inclusive: true } : { code: "too_small", minimum: items.length },
          input,
          inst,
          origin: "array"
        });
        return payload;
      }
    }
    let i = -1;
    for (const item of items) {
      i++;
      if (i >= input.length) {
        if (i >= optStart)
          continue;
      }
      const result = item._zod.run({
        value: input[i],
        issues: []
      }, ctx);
      if (result instanceof Promise) {
        proms.push(result.then((result2) => handleTupleResult(result2, payload, i)));
      } else {
        handleTupleResult(result, payload, i);
      }
    }
    if (def.rest) {
      const rest = input.slice(items.length);
      for (const el of rest) {
        i++;
        const result = def.rest._zod.run({
          value: el,
          issues: []
        }, ctx);
        if (result instanceof Promise) {
          proms.push(result.then((result2) => handleTupleResult(result2, payload, i)));
        } else {
          handleTupleResult(result, payload, i);
        }
      }
    }
    if (proms.length)
      return Promise.all(proms).then(() => payload);
    return payload;
  };
});
function handleTupleResult(result, final, index) {
  if (result.issues.length) {
    final.issues.push(...prefixIssues(index, result.issues));
  }
  final.value[index] = result.value;
}
var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
  $ZodType.init(inst, def);
  inst._zod.parse = (payload, ctx) => {
    const input = payload.value;
    if (!isPlainObject(input)) {
      payload.issues.push({
        expected: "record",
        code: "invalid_type",
        input,
        inst
      });
      return payload;
    }
    const proms = [];
    const values = def.keyType._zod.values;
    if (values) {
      payload.value = {};
      const recordKeys = /* @__PURE__ */ new Set();
      for (const key of values) {
        if (typeof key === "string" || typeof key === "number" || typeof key === "symbol") {
          recordKeys.add(typeof key === "number" ? key.toString() : key);
          const result = def.valueType._zod.run({ value: input[key], issues: [] }, ctx);
          if (result instanceof Promise) {
            proms.push(result.then((result2) => {
              if (result2.issues.length) {
                payload.issues.push(...prefixIssues(key, result2.issues));
              }
              payload.value[key] = result2.value;
            }));
          } else {
            if (result.issues.length) {
              payload.issues.push(...prefixIssues(key, result.issues));
            }
            payload.value[key] = result.value;
          }
        }
      }
      let unrecognized;
      for (const key in input) {
        if (!recordKeys.has(key)) {
          unrecognized = unrecognized ?? [];
          unrecognized.push(key);
        }
      }
      if (unrecognized && unrecognized.length > 0) {
        payload.issues.push({
          code: "unrecognized_keys",
          input,
          inst,
          keys: unrecognized
        });
      }
    } else {
      payload.value = {};
      for (const key of Reflect.ownKeys(input)) {
        if (key === "__proto__")
          continue;
        let keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx);
        if (keyResult instanceof Promise) {
          throw new Error("Async schemas not supported in object keys currently");
        }
        const checkNumericKey = typeof key === "string" && number.test(key) && keyResult.issues.length;
        if (checkNumericKey) {
          const retryResult = def.keyType._zod.run({ value: Number(key), issues: [] }, ctx);
          if (retryResult instanceof Promise) {
            throw new Error("Async schemas not supported in object keys currently");
          }
          if (retryResult.issues.length === 0) {
            keyResult = retryResult;
          }
        }
        if (keyResult.issues.length) {
          if (def.mode === "loose") {
            payload.value[key] = input[key];
          } else {
            payload.issues.push({
              code: "invalid_key",
              origin: "record",
              issues: keyResult.issues.map((iss) => finalizeIssue(iss, ctx, config())),
              input: key,
              path: [key],
              inst
            });
          }
          continue;
        }
        const result = def.valueType._zod.run({ value: input[key], issues: [] }, ctx);
        if (result instanceof Promise) {
          proms.push(result.then((result2) => {
            if (result2.issues.length) {
              payload.issues.push(...prefixIssues(key, result2.issues));
            }
            payload.value[keyResult.value] = result2.value;
          }));
        } else {
          if (result.issues.length) {
            payload.issues.push(...prefixIssues(key, result.issues));
          }
          payload.value[keyResult.value] = result.value;
        }
      }
    }
    if (proms.length) {
      return Promise.all(proms).then(() => payload);
    }
    return payload;
  };
});
var $ZodMap = /* @__PURE__ */ $constructor("$ZodMap", (inst, def) => {
  $ZodType.init(inst, def);
  inst._zod.parse = (payload, ctx) => {
    const input = payload.value;
    if (!(input instanceof Map)) {
      payload.issues.push({
        expected: "map",
        code: "invalid_type",
        input,
        inst
      });
      return payload;
    }
    const proms = [];
    payload.value = /* @__PURE__ */ new Map();
    for (const [key, value] of input) {
      const keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx);
      const valueResult = def.valueType._zod.run({ value, issues: [] }, ctx);
      if (keyResult instanceof Promise || valueResult instanceof Promise) {
        proms.push(Promise.all([keyResult, valueResult]).then(([keyResult2, valueResult2]) => {
          handleMapResult(keyResult2, valueResult2, payload, key, input, inst, ctx);
        }));
      } else {
        handleMapResult(keyResult, valueResult, payload, key, input, inst, ctx);
      }
    }
    if (proms.length)
      return Promise.all(proms).then(() => payload);
    return payload;
  };
});
function handleMapResult(keyResult, valueResult, final, key, input, inst, ctx) {
  if (keyResult.issues.length) {
    if (propertyKeyTypes.has(typeof key)) {
      final.issues.push(...prefixIssues(key, keyResult.issues));
    } else {
      final.issues.push({
        code: "invalid_key",
        origin: "map",
        input,
        inst,
        issues: keyResult.issues.map((iss) => finalizeIssue(iss, ctx, config()))
      });
    }
  }
  if (valueResult.issues.length) {
    if (propertyKeyTypes.has(typeof key)) {
      final.issues.push(...prefixIssues(key, valueResult.issues));
    } else {
      final.issues.push({
        origin: "map",
        code: "invalid_element",
        input,
        inst,
        key,
        issues: valueResult.issues.map((iss) => finalizeIssue(iss, ctx, config()))
      });
    }
  }
  final.value.set(keyResult.value, valueResult.value);
}
var $ZodSet = /* @__PURE__ */ $constructor("$ZodSet", (inst, def) => {
  $ZodType.init(inst, def);
  inst._zod.parse = (payload, ctx) => {
    const input = payload.value;
    if (!(input instanceof Set)) {
      payload.issues.push({
        input,
        inst,
        expected: "set",
        code: "invalid_type"
      });
      return payload;
    }
    const proms = [];
    payload.value = /* @__PURE__ */ new Set();
    for (const item of input) {
      const result = def.valueType._zod.run({ value: item, issues: [] }, ctx);
      if (result instanceof Promise) {
        proms.push(result.then((result2) => handleSetResult(result2, payload)));
      } else
        handleSetResult(result, payload);
    }
    if (proms.length)
      return Promise.all(proms).then(() => payload);
    return payload;
  };
});
function handleSetResult(result, final) {
  if (result.issues.length) {
    final.issues.push(...result.issues);
  }
  final.value.add(result.value);
}
var $ZodEnum = /* @__PURE__ */ $constructor("$ZodEnum", (inst, def) => {
  $ZodType.init(inst, def);
  const values = getEnumValues(def.entries);
  const valuesSet = new Set(values);
  inst._zod.values = valuesSet;
  inst._zod.pattern = new RegExp(`^(${values.filter((k) => propertyKeyTypes.has(typeof k)).map((o) => typeof o === "string" ? escapeRegex(o) : o.toString()).join("|")})$`);
  inst._zod.parse = (payload, _ctx) => {
    const input = payload.value;
    if (valuesSet.has(input)) {
      return payload;
    }
    payload.issues.push({
      code: "invalid_value",
      values,
      input,
      inst
    });
    return payload;
  };
});
var $ZodLiteral = /* @__PURE__ */ $constructor("$ZodLiteral", (inst, def) => {
  $ZodType.init(inst, def);
  if (def.values.length === 0) {
    throw new Error("Cannot create literal schema with no valid values");
  }
  const values = new Set(def.values);
  inst._zod.values = values;
  inst._zod.pattern = new RegExp(`^(${def.values.map((o) => typeof o === "string" ? escapeRegex(o) : o ? escapeRegex(o.toString()) : String(o)).join("|")})$`);
  inst._zod.parse = (payload, _ctx) => {
    const input = payload.value;
    if (values.has(input)) {
      return payload;
    }
    payload.issues.push({
      code: "invalid_value",
      values: def.values,
      input,
      inst
    });
    return payload;
  };
});
var $ZodFile = /* @__PURE__ */ $constructor("$ZodFile", (inst, def) => {
  $ZodType.init(inst, def);
  inst._zod.parse = (payload, _ctx) => {
    const input = payload.value;
    if (input instanceof File)
      return payload;
    payload.issues.push({
      expected: "file",
      code: "invalid_type",
      input,
      inst
    });
    return payload;
  };
});
var $ZodTransform = /* @__PURE__ */ $constructor("$ZodTransform", (inst, def) => {
  $ZodType.init(inst, def);
  inst._zod.parse = (payload, ctx) => {
    if (ctx.direction === "backward") {
      throw new $ZodEncodeError(inst.constructor.name);
    }
    const _out = def.transform(payload.value, payload);
    if (ctx.async) {
      const output = _out instanceof Promise ? _out : Promise.resolve(_out);
      return output.then((output2) => {
        payload.value = output2;
        return payload;
      });
    }
    if (_out instanceof Promise) {
      throw new $ZodAsyncError();
    }
    payload.value = _out;
    return payload;
  };
});
function handleOptionalResult(result, input) {
  if (result.issues.length && input === void 0) {
    return { issues: [], value: void 0 };
  }
  return result;
}
var $ZodOptional = /* @__PURE__ */ $constructor("$ZodOptional", (inst, def) => {
  $ZodType.init(inst, def);
  inst._zod.optin = "optional";
  inst._zod.optout = "optional";
  defineLazy(inst._zod, "values", () => {
    return def.innerType._zod.values ? /* @__PURE__ */ new Set([...def.innerType._zod.values, void 0]) : void 0;
  });
  defineLazy(inst._zod, "pattern", () => {
    const pattern = def.innerType._zod.pattern;
    return pattern ? new RegExp(`^(${cleanRegex(pattern.source)})?$`) : void 0;
  });
  inst._zod.parse = (payload, ctx) => {
    if (def.innerType._zod.optin === "optional") {
      const result = def.innerType._zod.run(payload, ctx);
      if (result instanceof Promise)
        return result.then((r) => handleOptionalResult(r, payload.value));
      return handleOptionalResult(result, payload.value);
    }
    if (payload.value === void 0) {
      return payload;
    }
    return def.innerType._zod.run(payload, ctx);
  };
});
var $ZodExactOptional = /* @__PURE__ */ $constructor("$ZodExactOptional", (inst, def) => {
  $ZodOptional.init(inst, def);
  defineLazy(inst._zod, "values", () => def.innerType._zod.values);
  defineLazy(inst._zod, "pattern", () => def.innerType._zod.pattern);
  inst._zod.parse = (payload, ctx) => {
    return def.innerType._zod.run(payload, ctx);
  };
});
var $ZodNullable = /* @__PURE__ */ $constructor("$ZodNullable", (inst, def) => {
  $ZodType.init(inst, def);
  defineLazy(inst._zod, "optin", () => def.innerType._zod.optin);
  defineLazy(inst._zod, "optout", () => def.innerType._zod.optout);
  defineLazy(inst._zod, "pattern", () => {
    const pattern = def.innerType._zod.pattern;
    return pattern ? new RegExp(`^(${cleanRegex(pattern.source)}|null)$`) : void 0;
  });
  defineLazy(inst._zod, "values", () => {
    return def.innerType._zod.values ? /* @__PURE__ */ new Set([...def.innerType._zod.values, null]) : void 0;
  });
  inst._zod.parse = (payload, ctx) => {
    if (payload.value === null)
      return payload;
    return def.innerType._zod.run(payload, ctx);
  };
});
var $ZodDefault = /* @__PURE__ */ $constructor("$ZodDefault", (inst, def) => {
  $ZodType.init(inst, def);
  inst._zod.optin = "optional";
  defineLazy(inst._zod, "values", () => def.innerType._zod.values);
  inst._zod.parse = (payload, ctx) => {
    if (ctx.direction === "backward") {
      return def.innerType._zod.run(payload, ctx);
    }
    if (payload.value === void 0) {
      payload.value = def.defaultValue;
      return payload;
    }
    const result = def.innerType._zod.run(payload, ctx);
    if (result instanceof Promise) {
      return result.then((result2) => handleDefaultResult(result2, def));
    }
    return handleDefaultResult(result, def);
  };
});
function handleDefaultResult(payload, def) {
  if (payload.value === void 0) {
    payload.value = def.defaultValue;
  }
  return payload;
}
var $ZodPrefault = /* @__PURE__ */ $constructor("$ZodPrefault", (inst, def) => {
  $ZodType.init(inst, def);
  inst._zod.optin = "optional";
  defineLazy(inst._zod, "values", () => def.innerType._zod.values);
  inst._zod.parse = (payload, ctx) => {
    if (ctx.direction === "backward") {
      return def.innerType._zod.run(payload, ctx);
    }
    if (payload.value === void 0) {
      payload.value = def.defaultValue;
    }
    return def.innerType._zod.run(payload, ctx);
  };
});
var $ZodNonOptional = /* @__PURE__ */ $constructor("$ZodNonOptional", (inst, def) => {
  $ZodType.init(inst, def);
  defineLazy(inst._zod, "values", () => {
    const v = def.innerType._zod.values;
    return v ? new Set([...v].filter((x) => x !== void 0)) : void 0;
  });
  inst._zod.parse = (payload, ctx) => {
    const result = def.innerType._zod.run(payload, ctx);
    if (result instanceof Promise) {
      return result.then((result2) => handleNonOptionalResult(result2, inst));
    }
    return handleNonOptionalResult(result, inst);
  };
});
function handleNonOptionalResult(payload, inst) {
  if (!payload.issues.length && payload.value === void 0) {
    payload.issues.push({
      code: "invalid_type",
      expected: "nonoptional",
      input: payload.value,
      inst
    });
  }
  return payload;
}
var $ZodSuccess = /* @__PURE__ */ $constructor("$ZodSuccess", (inst, def) => {
  $ZodType.init(inst, def);
  inst._zod.parse = (payload, ctx) => {
    if (ctx.direction === "backward") {
      throw new $ZodEncodeError("ZodSuccess");
    }
    const result = def.innerType._zod.run(payload, ctx);
    if (result instanceof Promise) {
      return result.then((result2) => {
        payload.value = result2.issues.length === 0;
        return payload;
      });
    }
    payload.value = result.issues.length === 0;
    return payload;
  };
});
var $ZodCatch = /* @__PURE__ */ $constructor("$ZodCatch", (inst, def) => {
  $ZodType.init(inst, def);
  defineLazy(inst._zod, "optin", () => def.innerType._zod.optin);
  defineLazy(inst._zod, "optout", () => def.innerType._zod.optout);
  defineLazy(inst._zod, "values", () => def.innerType._zod.values);
  inst._zod.parse = (payload, ctx) => {
    if (ctx.direction === "backward") {
      return def.innerType._zod.run(payload, ctx);
    }
    const result = def.innerType._zod.run(payload, ctx);
    if (result instanceof Promise) {
      return result.then((result2) => {
        payload.value = result2.value;
        if (result2.issues.length) {
          payload.value = def.catchValue({
            ...payload,
            error: {
              issues: result2.issues.map((iss) => finalizeIssue(iss, ctx, config()))
            },
            input: payload.value
          });
          payload.issues = [];
        }
        return payload;
      });
    }
    payload.value = result.value;
    if (result.issues.length) {
      payload.value = def.catchValue({
        ...payload,
        error: {
          issues: result.issues.map((iss) => finalizeIssue(iss, ctx, config()))
        },
        input: payload.value
      });
      payload.issues = [];
    }
    return payload;
  };
});
var $ZodNaN = /* @__PURE__ */ $constructor("$ZodNaN", (inst, def) => {
  $ZodType.init(inst, def);
  inst._zod.parse = (payload, _ctx) => {
    if (typeof payload.value !== "number" || !Number.isNaN(payload.value)) {
      payload.issues.push({
        input: payload.value,
        inst,
        expected: "nan",
        code: "invalid_type"
      });
      return payload;
    }
    return payload;
  };
});
var $ZodPipe = /* @__PURE__ */ $constructor("$ZodPipe", (inst, def) => {
  $ZodType.init(inst, def);
  defineLazy(inst._zod, "values", () => def.in._zod.values);
  defineLazy(inst._zod, "optin", () => def.in._zod.optin);
  defineLazy(inst._zod, "optout", () => def.out._zod.optout);
  defineLazy(inst._zod, "propValues", () => def.in._zod.propValues);
  inst._zod.parse = (payload, ctx) => {
    if (ctx.direction === "backward") {
      const right = def.out._zod.run(payload, ctx);
      if (right instanceof Promise) {
        return right.then((right2) => handlePipeResult(right2, def.in, ctx));
      }
      return handlePipeResult(right, def.in, ctx);
    }
    const left = def.in._zod.run(payload, ctx);
    if (left instanceof Promise) {
      return left.then((left2) => handlePipeResult(left2, def.out, ctx));
    }
    return handlePipeResult(left, def.out, ctx);
  };
});
function handlePipeResult(left, next, ctx) {
  if (left.issues.length) {
    left.aborted = true;
    return left;
  }
  return next._zod.run({ value: left.value, issues: left.issues }, ctx);
}
var $ZodCodec = /* @__PURE__ */ $constructor("$ZodCodec", (inst, def) => {
  $ZodType.init(inst, def);
  defineLazy(inst._zod, "values", () => def.in._zod.values);
  defineLazy(inst._zod, "optin", () => def.in._zod.optin);
  defineLazy(inst._zod, "optout", () => def.out._zod.optout);
  defineLazy(inst._zod, "propValues", () => def.in._zod.propValues);
  inst._zod.parse = (payload, ctx) => {
    const direction = ctx.direction || "forward";
    if (direction === "forward") {
      const left = def.in._zod.run(payload, ctx);
      if (left instanceof Promise) {
        return left.then((left2) => handleCodecAResult(left2, def, ctx));
      }
      return handleCodecAResult(left, def, ctx);
    } else {
      const right = def.out._zod.run(payload, ctx);
      if (right instanceof Promise) {
        return right.then((right2) => handleCodecAResult(right2, def, ctx));
      }
      return handleCodecAResult(right, def, ctx);
    }
  };
});
function handleCodecAResult(result, def, ctx) {
  if (result.issues.length) {
    result.aborted = true;
    return result;
  }
  const direction = ctx.direction || "forward";
  if (direction === "forward") {
    const transformed = def.transform(result.value, result);
    if (transformed instanceof Promise) {
      return transformed.then((value) => handleCodecTxResult(result, value, def.out, ctx));
    }
    return handleCodecTxResult(result, transformed, def.out, ctx);
  } else {
    const transformed = def.reverseTransform(result.value, result);
    if (transformed instanceof Promise) {
      return transformed.then((value) => handleCodecTxResult(result, value, def.in, ctx));
    }
    return handleCodecTxResult(result, transformed, def.in, ctx);
  }
}
function handleCodecTxResult(left, value, nextSchema, ctx) {
  if (left.issues.length) {
    left.aborted = true;
    return left;
  }
  return nextSchema._zod.run({ value, issues: left.issues }, ctx);
}
var $ZodReadonly = /* @__PURE__ */ $constructor("$ZodReadonly", (inst, def) => {
  $ZodType.init(inst, def);
  defineLazy(inst._zod, "propValues", () => def.innerType._zod.propValues);
  defineLazy(inst._zod, "values", () => def.innerType._zod.values);
  defineLazy(inst._zod, "optin", () => def.innerType?._zod?.optin);
  defineLazy(inst._zod, "optout", () => def.innerType?._zod?.optout);
  inst._zod.parse = (payload, ctx) => {
    if (ctx.direction === "backward") {
      return def.innerType._zod.run(payload, ctx);
    }
    const result = def.innerType._zod.run(payload, ctx);
    if (result instanceof Promise) {
      return result.then(handleReadonlyResult);
    }
    return handleReadonlyResult(result);
  };
});
function handleReadonlyResult(payload) {
  payload.value = Object.freeze(payload.value);
  return payload;
}
var $ZodTemplateLiteral = /* @__PURE__ */ $constructor("$ZodTemplateLiteral", (inst, def) => {
  $ZodType.init(inst, def);
  const regexParts = [];
  for (const part of def.parts) {
    if (typeof part === "object" && part !== null) {
      if (!part._zod.pattern) {
        throw new Error(`Invalid template literal part, no pattern found: ${[...part._zod.traits].shift()}`);
      }
      const source = part._zod.pattern instanceof RegExp ? part._zod.pattern.source : part._zod.pattern;
      if (!source)
        throw new Error(`Invalid template literal part: ${part._zod.traits}`);
      const start = source.startsWith("^") ? 1 : 0;
      const end = source.endsWith("$") ? source.length - 1 : source.length;
      regexParts.push(source.slice(start, end));
    } else if (part === null || primitiveTypes.has(typeof part)) {
      regexParts.push(escapeRegex(`${part}`));
    } else {
      throw new Error(`Invalid template literal part: ${part}`);
    }
  }
  inst._zod.pattern = new RegExp(`^${regexParts.join("")}$`);
  inst._zod.parse = (payload, _ctx) => {
    if (typeof payload.value !== "string") {
      payload.issues.push({
        input: payload.value,
        inst,
        expected: "string",
        code: "invalid_type"
      });
      return payload;
    }
    inst._zod.pattern.lastIndex = 0;
    if (!inst._zod.pattern.test(payload.value)) {
      payload.issues.push({
        input: payload.value,
        inst,
        code: "invalid_format",
        format: def.format ?? "template_literal",
        pattern: inst._zod.pattern.source
      });
      return payload;
    }
    return payload;
  };
});
var $ZodFunction = /* @__PURE__ */ $constructor("$ZodFunction", (inst, def) => {
  $ZodType.init(inst, def);
  inst._def = def;
  inst._zod.def = def;
  inst.implement = (func) => {
    if (typeof func !== "function") {
      throw new Error("implement() must be called with a function");
    }
    return function(...args) {
      const parsedArgs = inst._def.input ? parse(inst._def.input, args) : args;
      const result = Reflect.apply(func, this, parsedArgs);
      if (inst._def.output) {
        return parse(inst._def.output, result);
      }
      return result;
    };
  };
  inst.implementAsync = (func) => {
    if (typeof func !== "function") {
      throw new Error("implementAsync() must be called with a function");
    }
    return async function(...args) {
      const parsedArgs = inst._def.input ? await parseAsync(inst._def.input, args) : args;
      const result = await Reflect.apply(func, this, parsedArgs);
      if (inst._def.output) {
        return await parseAsync(inst._def.output, result);
      }
      return result;
    };
  };
  inst._zod.parse = (payload, _ctx) => {
    if (typeof payload.value !== "function") {
      payload.issues.push({
        code: "invalid_type",
        expected: "function",
        input: payload.value,
        inst
      });
      return payload;
    }
    const hasPromiseOutput = inst._def.output && inst._def.output._zod.def.type === "promise";
    if (hasPromiseOutput) {
      payload.value = inst.implementAsync(payload.value);
    } else {
      payload.value = inst.implement(payload.value);
    }
    return payload;
  };
  inst.input = (...args) => {
    const F = inst.constructor;
    if (Array.isArray(args[0])) {
      return new F({
        type: "function",
        input: new $ZodTuple({
          type: "tuple",
          items: args[0],
          rest: args[1]
        }),
        output: inst._def.output
      });
    }
    return new F({
      type: "function",
      input: args[0],
      output: inst._def.output
    });
  };
  inst.output = (output) => {
    const F = inst.constructor;
    return new F({
      type: "function",
      input: inst._def.input,
      output
    });
  };
  return inst;
});
var $ZodPromise = /* @__PURE__ */ $constructor("$ZodPromise", (inst, def) => {
  $ZodType.init(inst, def);
  inst._zod.parse = (payload, ctx) => {
    return Promise.resolve(payload.value).then((inner) => def.innerType._zod.run({ value: inner, issues: [] }, ctx));
  };
});
var $ZodLazy = /* @__PURE__ */ $constructor("$ZodLazy", (inst, def) => {
  $ZodType.init(inst, def);
  defineLazy(inst._zod, "innerType", () => def.getter());
  defineLazy(inst._zod, "pattern", () => inst._zod.innerType?._zod?.pattern);
  defineLazy(inst._zod, "propValues", () => inst._zod.innerType?._zod?.propValues);
  defineLazy(inst._zod, "optin", () => inst._zod.innerType?._zod?.optin ?? void 0);
  defineLazy(inst._zod, "optout", () => inst._zod.innerType?._zod?.optout ?? void 0);
  inst._zod.parse = (payload, ctx) => {
    const inner = inst._zod.innerType;
    return inner._zod.run(payload, ctx);
  };
});
var $ZodCustom = /* @__PURE__ */ $constructor("$ZodCustom", (inst, def) => {
  $ZodCheck.init(inst, def);
  $ZodType.init(inst, def);
  inst._zod.parse = (payload, _) => {
    return payload;
  };
  inst._zod.check = (payload) => {
    const input = payload.value;
    const r = def.fn(input);
    if (r instanceof Promise) {
      return r.then((r2) => handleRefineResult(r2, payload, input, inst));
    }
    handleRefineResult(r, payload, input, inst);
    return;
  };
});
function handleRefineResult(result, payload, input, inst) {
  if (!result) {
    const _iss = {
      code: "custom",
      input,
      inst,
      // incorporates params.error into issue reporting
      path: [...inst._zod.def.path ?? []],
      // incorporates params.error into issue reporting
      continue: !inst._zod.def.abort
      // params: inst._zod.def.params,
    };
    if (inst._zod.def.params)
      _iss.params = inst._zod.def.params;
    payload.issues.push(issue(_iss));
  }
}

// node_modules/zod/v4/locales/index.js
var locales_exports = {};
__export(locales_exports, {
  ar: () => ar_default,
  az: () => az_default,
  be: () => be_default,
  bg: () => bg_default,
  ca: () => ca_default,
  cs: () => cs_default,
  da: () => da_default,
  de: () => de_default,
  en: () => en_default,
  eo: () => eo_default,
  es: () => es_default,
  fa: () => fa_default,
  fi: () => fi_default,
  fr: () => fr_default,
  frCA: () => fr_CA_default,
  he: () => he_default,
  hu: () => hu_default,
  hy: () => hy_default,
  id: () => id_default,
  is: () => is_default,
  it: () => it_default,
  ja: () => ja_default,
  ka: () => ka_default,
  kh: () => kh_default,
  km: () => km_default,
  ko: () => ko_default,
  lt: () => lt_default,
  mk: () => mk_default,
  ms: () => ms_default,
  nl: () => nl_default,
  no: () => no_default,
  ota: () => ota_default,
  pl: () => pl_default,
  ps: () => ps_default,
  pt: () => pt_default,
  ru: () => ru_default,
  sl: () => sl_default,
  sv: () => sv_default,
  ta: () => ta_default,
  th: () => th_default,
  tr: () => tr_default,
  ua: () => ua_default,
  uk: () => uk_default,
  ur: () => ur_default,
  uz: () => uz_default,
  vi: () => vi_default,
  yo: () => yo_default,
  zhCN: () => zh_CN_default,
  zhTW: () => zh_TW_default
});

// node_modules/zod/v4/locales/ar.js
var error = () => {
  const Sizable = {
    string: { unit: "\u062D\u0631\u0641", verb: "\u0623\u0646 \u064A\u062D\u0648\u064A" },
    file: { unit: "\u0628\u0627\u064A\u062A", verb: "\u0623\u0646 \u064A\u062D\u0648\u064A" },
    array: { unit: "\u0639\u0646\u0635\u0631", verb: "\u0623\u0646 \u064A\u062D\u0648\u064A" },
    set: { unit: "\u0639\u0646\u0635\u0631", verb: "\u0623\u0646 \u064A\u062D\u0648\u064A" }
  };
  function getSizing(origin) {
    return Sizable[origin] ?? null;
  }
  const FormatDictionary = {
    regex: "\u0645\u062F\u062E\u0644",
    email: "\u0628\u0631\u064A\u062F \u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A",
    url: "\u0631\u0627\u0628\u0637",
    emoji: "\u0625\u064A\u0645\u0648\u062C\u064A",
    uuid: "UUID",
    uuidv4: "UUIDv4",
    uuidv6: "UUIDv6",
    nanoid: "nanoid",
    guid: "GUID",
    cuid: "cuid",
    cuid2: "cuid2",
    ulid: "ULID",
    xid: "XID",
    ksuid: "KSUID",
    datetime: "\u062A\u0627\u0631\u064A\u062E \u0648\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",
    date: "\u062A\u0627\u0631\u064A\u062E \u0628\u0645\u0639\u064A\u0627\u0631 ISO",
    time: "\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",
    duration: "\u0645\u062F\u0629 \u0628\u0645\u0639\u064A\u0627\u0631 ISO",
    ipv4: "\u0639\u0646\u0648\u0627\u0646 IPv4",
    ipv6: "\u0639\u0646\u0648\u0627\u0646 IPv6",
    cidrv4: "\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv4",
    cidrv6: "\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv6",
    base64: "\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64-encoded",
    base64url: "\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64url-encoded",
    json_string: "\u0646\u064E\u0635 \u0639\u0644\u0649 \u0647\u064A\u0626\u0629 JSON",
    e164: "\u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0628\u0645\u0639\u064A\u0627\u0631 E.164",
    jwt: "JWT",
    template_literal: "\u0645\u062F\u062E\u0644"
  };
  const TypeDictionary = {
    nan: "NaN"
  };
  return (issue2) => {
    switch (issue2.code) {
      case "invalid_type": {
        const expected = TypeDictionary[issue2.expected] ?? issue2.expected;
        const receivedType = parsedType(issue2.input);
        const received = TypeDictionary[receivedType] ?? receivedType;
        if (/^[A-Z]/.test(issue2.expected)) {
          return `\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 instanceof ${issue2.expected}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${received}`;
        }
        return `\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${expected}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${received}`;
      }
      case "invalid_value":
        if (issue2.values.length === 1)
          return `\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${stringifyPrimitive(issue2.values[0])}`;
        return `\u0627\u062E\u062A\u064A\u0627\u0631 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062A\u0648\u0642\u0639 \u0627\u0646\u062A\u0642\u0627\u0621 \u0623\u062D\u062F \u0647\u0630\u0647 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A: ${joinValues(issue2.values, "|")}`;
      case "too_big": {
        const adj = issue2.inclusive ? "<=" : "<";
        const sizing = getSizing(issue2.origin);
        if (sizing)
          return ` \u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${issue2.origin ?? "\u0627\u0644\u0642\u064A\u0645\u0629"} ${adj} ${issue2.maximum.toString()} ${sizing.unit ?? "\u0639\u0646\u0635\u0631"}`;
        return `\u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${issue2.origin ?? "\u0627\u0644\u0642\u064A\u0645\u0629"} ${adj} ${issue2.maximum.toString()}`;
      }
      case "too_small": {
        const adj = issue2.inclusive ? ">=" : ">";
        const sizing = getSizing(issue2.origin);
        if (sizing) {
          return `\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${issue2.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${adj} ${issue2.minimum.toString()} ${sizing.unit}`;
        }
        return `\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${issue2.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${adj} ${issue2.minimum.toString()}`;
      }
      case "invalid_format": {
        const _issue = issue2;
        if (_issue.format === "starts_with")
          return `\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0628\u062F\u0623 \u0628\u0640 "${issue2.prefix}"`;
        if (_issue.format === "ends_with")
          return `\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0646\u062A\u0647\u064A \u0628\u0640 "${_issue.suffix}"`;
        if (_issue.format === "includes")
          return `\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u062A\u0636\u0645\u0651\u064E\u0646 "${_issue.includes}"`;
        if (_issue.format === "regex")
          return `\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0637\u0627\u0628\u0642 \u0627\u0644\u0646\u0645\u0637 ${_issue.pattern}`;
        return `${FormatDictionary[_issue.format] ?? issue2.format} \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644`;
      }
      case "not_multiple_of":
        return `\u0631\u0642\u0645 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0643\u0648\u0646 \u0645\u0646 \u0645\u0636\u0627\u0639\u0641\u0627\u062A ${issue2.divisor}`;
      case "unrecognized_keys":
        return `\u0645\u0639\u0631\u0641${issue2.keys.length > 1 ? "\u0627\u062A" : ""} \u063A\u0631\u064A\u0628${issue2.keys.length > 1 ? "\u0629" : ""}: ${joinValues(issue2.keys, "\u060C ")}`;
      case "invalid_key":
        return `\u0645\u0639\u0631\u0641 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${issue2.origin}`;
      case "invalid_union":
        return "\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644";
      case "invalid_element":
        return `\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${issue2.origin}`;
      default:
        return "\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644";
    }
  };
};
function ar_default() {
  return {
    localeError: error()
  };
}

// node_modules/zod/v4/locales/az.js
var error2 = () => {
  const Sizable = {
    string: { unit: "simvol", verb: "olmal\u0131d\u0131r" },
    file: { unit: "bayt", verb: "olmal\u0131d\u0131r" },
    array: { unit: "element", verb: "olmal\u0131d\u0131r" },
    set: { unit: "element", verb: "olmal\u0131d\u0131r" }
  };
  function getSizing(origin) {
    return Sizable[origin] ?? null;
  }
  const FormatDictionary = {
    regex: "input",
    email: "email address",
    url: "URL",
    emoji: "emoji",
    uuid: "UUID",
    uuidv4: "UUIDv4",
    uuidv6: "UUIDv6",
    nanoid: "nanoid",
    guid: "GUID",
    cuid: "cuid",
    cuid2: "cuid2",
    ulid: "ULID",
    xid: "XID",
    ksuid: "KSUID",
    datetime: "ISO datetime",
    date: "ISO date",
    time: "ISO time",
    duration: "ISO duration",
    ipv4: "IPv4 address",
    ipv6: "IPv6 address",
    cidrv4: "IPv4 range",
    cidrv6: "IPv6 range",
    base64: "base64-encoded string",
    base64url: "base64url-encoded string",
    json_string: "JSON string",
    e164: "E.164 number",
    jwt: "JWT",
    template_literal: "input"
  };
  const TypeDictionary = {
    nan: "NaN"
  };
  return (issue2) => {
    switch (issue2.code) {
      case "invalid_type": {
        const expected = TypeDictionary[issue2.expected] ?? issue2.expected;
        const receivedType = parsedType(issue2.input);
        const received = TypeDictionary[receivedType] ?? receivedType;
        if (/^[A-Z]/.test(issue2.expected)) {
          return `Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n instanceof ${issue2.expected}, daxil olan ${received}`;
        }
        return `Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${expected}, daxil olan ${received}`;
      }
      case "invalid_value":
        if (issue2.values.length === 1)
          return `Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${stringifyPrimitive(issue2.values[0])}`;
        return `Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${joinValues(issue2.values, "|")}`;
      case "too_big": {
        const adj = issue2.inclusive ? "<=" : "<";
        const sizing = getSizing(issue2.origin);
        if (sizing)
          return `\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${issue2.origin ?? "d\u0259y\u0259r"} ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "element"}`;
        return `\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${issue2.origin ?? "d\u0259y\u0259r"} ${adj}${issue2.maximum.toString()}`;
      }
      case "too_small": {
        const adj = issue2.inclusive ? ">=" : ">";
        const sizing = getSizing(issue2.origin);
        if (sizing)
          return `\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${issue2.origin} ${adj}${issue2.minimum.toString()} ${sizing.unit}`;
        return `\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${issue2.origin} ${adj}${issue2.minimum.toString()}`;
      }
      case "invalid_format": {
        const _issue = issue2;
        if (_issue.format === "starts_with")
          return `Yanl\u0131\u015F m\u0259tn: "${_issue.prefix}" il\u0259 ba\u015Flamal\u0131d\u0131r`;
        if (_issue.format === "ends_with")
          return `Yanl\u0131\u015F m\u0259tn: "${_issue.suffix}" il\u0259 bitm\u0259lidir`;
        if (_issue.format === "includes")
          return `Yanl\u0131\u015F m\u0259tn: "${_issue.includes}" daxil olmal\u0131d\u0131r`;
        if (_issue.format === "regex")
          return `Yanl\u0131\u015F m\u0259tn: ${_issue.pattern} \u015Fablonuna uy\u011Fun olmal\u0131d\u0131r`;
        return `Yanl\u0131\u015F ${FormatDictionary[_issue.format] ?? issue2.format}`;
      }
      case "not_multiple_of":
        return `Yanl\u0131\u015F \u0259d\u0259d: ${issue2.divisor} il\u0259 b\xF6l\xFCn\u0259 bil\u0259n olmal\u0131d\u0131r`;
      case "unrecognized_keys":
        return `Tan\u0131nmayan a\xE7ar${issue2.keys.length > 1 ? "lar" : ""}: ${joinValues(issue2.keys, ", ")}`;
      case "invalid_key":
        return `${issue2.origin} daxilind\u0259 yanl\u0131\u015F a\xE7ar`;
      case "invalid_union":
        return "Yanl\u0131\u015F d\u0259y\u0259r";
      case "invalid_element":
        return `${issue2.origin} daxilind\u0259 yanl\u0131\u015F d\u0259y\u0259r`;
      default:
        return `Yanl\u0131\u015F d\u0259y\u0259r`;
    }
  };
};
function az_default() {
  return {
    localeError: error2()
  };
}

// node_modules/zod/v4/locales/be.js
function getBelarusianPlural(count, one, few, many) {
  const absCount = Math.abs(count);
  const lastDigit = absCount % 10;
  const lastTwoDigits = absCount % 100;
  if (lastTwoDigits >= 11 && lastTwoDigits <= 19) {
    return many;
  }
  if (lastDigit === 1) {
    return one;
  }
  if (lastDigit >= 2 && lastDigit <= 4) {
    return few;
  }
  return many;
}
var error3 = () => {
  const Sizable = {
    string: {
      unit: {
        one: "\u0441\u0456\u043C\u0432\u0430\u043B",
        few: "\u0441\u0456\u043C\u0432\u0430\u043B\u044B",
        many: "\u0441\u0456\u043C\u0432\u0430\u043B\u0430\u045E"
      },
      verb: "\u043C\u0435\u0446\u044C"
    },
    array: {
      unit: {
        one: "\u044D\u043B\u0435\u043C\u0435\u043D\u0442",
        few: "\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",
        many: "\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"
      },
      verb: "\u043C\u0435\u0446\u044C"
    },
    set: {
      unit: {
        one: "\u044D\u043B\u0435\u043C\u0435\u043D\u0442",
        few: "\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",
        many: "\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"
      },
      verb: "\u043C\u0435\u0446\u044C"
    },
    file: {
      unit: {
        one: "\u0431\u0430\u0439\u0442",
        few: "\u0431\u0430\u0439\u0442\u044B",
        many: "\u0431\u0430\u0439\u0442\u0430\u045E"
      },
      verb: "\u043C\u0435\u0446\u044C"
    }
  };
  function getSizing(origin) {
    return Sizable[origin] ?? null;
  }
  const FormatDictionary = {
    regex: "\u0443\u0432\u043E\u0434",
    email: "email \u0430\u0434\u0440\u0430\u0441",
    url: "URL",
    emoji: "\u044D\u043C\u043E\u0434\u0437\u0456",
    uuid: "UUID",
    uuidv4: "UUIDv4",
    uuidv6: "UUIDv6",
    nanoid: "nanoid",
    guid: "GUID",
    cuid: "cuid",
    cuid2: "cuid2",
    ulid: "ULID",
    xid: "XID",
    ksuid: "KSUID",
    datetime: "ISO \u0434\u0430\u0442\u0430 \u0456 \u0447\u0430\u0441",
    date: "ISO \u0434\u0430\u0442\u0430",
    time: "ISO \u0447\u0430\u0441",
    duration: "ISO \u043F\u0440\u0430\u0446\u044F\u0433\u043B\u0430\u0441\u0446\u044C",
    ipv4: "IPv4 \u0430\u0434\u0440\u0430\u0441",
    ipv6: "IPv6 \u0430\u0434\u0440\u0430\u0441",
    cidrv4: "IPv4 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",
    cidrv6: "IPv6 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",
    base64: "\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64",
    base64url: "\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64url",
    json_string: "JSON \u0440\u0430\u0434\u043E\u043A",
    e164: "\u043D\u0443\u043C\u0430\u0440 E.164",
    jwt: "JWT",
    template_literal: "\u0443\u0432\u043E\u0434"
  };
  const TypeDictionary = {
    nan: "NaN",
    number: "\u043B\u0456\u043A",
    array: "\u043C\u0430\u0441\u0456\u045E"
  };
  return (issue2) => {
    switch (issue2.code) {
      case "invalid_type": {
        const expected = TypeDictionary[issue2.expected] ?? issue2.expected;
        const receivedType = parsedType(issue2.input);
        const received = TypeDictionary[receivedType] ?? receivedType;
        if (/^[A-Z]/.test(issue2.expected)) {
          return `\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F instanceof ${issue2.expected}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${received}`;
        }
        return `\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F ${expected}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${received}`;
      }
      case "invalid_value":
        if (issue2.values.length === 1)
          return `\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F ${stringifyPrimitive(issue2.values[0])}`;
        return `\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0432\u0430\u0440\u044B\u044F\u043D\u0442: \u0447\u0430\u043A\u0430\u045E\u0441\u044F \u0430\u0434\u0437\u0456\u043D \u0437 ${joinValues(issue2.values, "|")}`;
      case "too_big": {
        const adj = issue2.inclusive ? "<=" : "<";
        const sizing = getSizing(issue2.origin);
        if (sizing) {
          const maxValue = Number(issue2.maximum);
          const unit = getBelarusianPlural(maxValue, sizing.unit.one, sizing.unit.few, sizing.unit.many);
          return `\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${issue2.origin ?? "\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${sizing.verb} ${adj}${issue2.maximum.toString()} ${unit}`;
        }
        return `\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${issue2.origin ?? "\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${adj}${issue2.maximum.toString()}`;
      }
      case "too_small": {
        const adj = issue2.inclusive ? ">=" : ">";
        const sizing = getSizing(issue2.origin);
        if (sizing) {
          const minValue = Number(issue2.minimum);
          const unit = getBelarusianPlural(minValue, sizing.unit.one, sizing.unit.few, sizing.unit.many);
          return `\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${issue2.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${sizing.verb} ${adj}${issue2.minimum.toString()} ${unit}`;
        }
        return `\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${issue2.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${adj}${issue2.minimum.toString()}`;
      }
      case "invalid_format": {
        const _issue = issue2;
        if (_issue.format === "starts_with")
          return `\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u043F\u0430\u0447\u044B\u043D\u0430\u0446\u0446\u0430 \u0437 "${_issue.prefix}"`;
        if (_issue.format === "ends_with")
          return `\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u0430\u043A\u0430\u043D\u0447\u0432\u0430\u0446\u0446\u0430 \u043D\u0430 "${_issue.suffix}"`;
        if (_issue.format === "includes")
          return `\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u043C\u044F\u0448\u0447\u0430\u0446\u044C "${_issue.includes}"`;
        if (_issue.format === "regex")
          return `\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0430\u0434\u043F\u0430\u0432\u044F\u0434\u0430\u0446\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${_issue.pattern}`;
        return `\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B ${FormatDictionary[_issue.format] ?? issue2.format}`;
      }
      case "not_multiple_of":
        return `\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043B\u0456\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0431\u044B\u0446\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${issue2.divisor}`;
      case "unrecognized_keys":
        return `\u041D\u0435\u0440\u0430\u0441\u043F\u0430\u0437\u043D\u0430\u043D\u044B ${issue2.keys.length > 1 ? "\u043A\u043B\u044E\u0447\u044B" : "\u043A\u043B\u044E\u0447"}: ${joinValues(issue2.keys, ", ")}`;
      case "invalid_key":
        return `\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043A\u043B\u044E\u0447 \u0443 ${issue2.origin}`;
      case "invalid_union":
        return "\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434";
      case "invalid_element":
        return `\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u0430\u0435 \u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435 \u045E ${issue2.origin}`;
      default:
        return `\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434`;
    }
  };
};
function be_default() {
  return {
    localeError: error3()
  };
}

// node_modules/zod/v4/locales/bg.js
var error4 = () => {
  const Sizable = {
    string: { unit: "\u0441\u0438\u043C\u0432\u043E\u043B\u0430", verb: "\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430" },
    file: { unit: "\u0431\u0430\u0439\u0442\u0430", verb: "\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430" },
    array: { unit: "\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430", verb: "\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430" },
    set: { unit: "\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430", verb: "\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430" }
  };
  function getSizing(origin) {
    return Sizable[origin] ?? null;
  }
  const FormatDictionary = {
    regex: "\u0432\u0445\u043E\u0434",
    email: "\u0438\u043C\u0435\u0439\u043B \u0430\u0434\u0440\u0435\u0441",
    url: "URL",
    emoji: "\u0435\u043C\u043E\u0434\u0436\u0438",
    uuid: "UUID",
    uuidv4: "UUIDv4",
    uuidv6: "UUIDv6",
    nanoid: "nanoid",
    guid: "GUID",
    cuid: "cuid",
    cuid2: "cuid2",
    ulid: "ULID",
    xid: "XID",
    ksuid: "KSUID",
    datetime: "ISO \u0432\u0440\u0435\u043C\u0435",
    date: "ISO \u0434\u0430\u0442\u0430",
    time: "ISO \u0432\u0440\u0435\u043C\u0435",
    duration: "ISO \u043F\u0440\u043E\u0434\u044A\u043B\u0436\u0438\u0442\u0435\u043B\u043D\u043E\u0441\u0442",
    ipv4: "IPv4 \u0430\u0434\u0440\u0435\u0441",
    ipv6: "IPv6 \u0430\u0434\u0440\u0435\u0441",
    cidrv4: "IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",
    cidrv6: "IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",
    base64: "base64-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",
    base64url: "base64url-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",
    json_string: "JSON \u043D\u0438\u0437",
    e164: "E.164 \u043D\u043E\u043C\u0435\u0440",
    jwt: "JWT",
    template_literal: "\u0432\u0445\u043E\u0434"
  };
  const TypeDictionary = {
    nan: "NaN",
    number: "\u0447\u0438\u0441\u043B\u043E",
    array: "\u043C\u0430\u0441\u0438\u0432"
  };
  return (issue2) => {
    switch (issue2.code) {
      case "invalid_type": {
        const expected = TypeDictionary[issue2.expected] ?? issue2.expected;
        const receivedType = parsedType(issue2.input);
        const received = TypeDictionary[receivedType] ?? receivedType;
        if (/^[A-Z]/.test(issue2.expected)) {
          return `\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D instanceof ${issue2.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${received}`;
        }
        return `\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${received}`;
      }
      case "invalid_value":
        if (issue2.values.length === 1)
          return `\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${stringifyPrimitive(issue2.values[0])}`;
        return `\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u043E\u043F\u0446\u0438\u044F: \u043E\u0447\u0430\u043A\u0432\u0430\u043D\u043E \u0435\u0434\u043D\u043E \u043E\u0442 ${joinValues(issue2.values, "|")}`;
      case "too_big": {
        const adj = issue2.inclusive ? "<=" : "<";
        const sizing = getSizing(issue2.origin);
        if (sizing)
          return `\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${issue2.origin ?? "\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430"}`;
        return `\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${issue2.origin ?? "\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0431\u044A\u0434\u0435 ${adj}${issue2.maximum.toString()}`;
      }
      case "too_small": {
        const adj = issue2.inclusive ? ">=" : ">";
        const sizing = getSizing(issue2.origin);
        if (sizing) {
          return `\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${issue2.origin} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${adj}${issue2.minimum.toString()} ${sizing.unit}`;
        }
        return `\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${issue2.origin} \u0434\u0430 \u0431\u044A\u0434\u0435 ${adj}${issue2.minimum.toString()}`;
      }
      case "invalid_format": {
        const _issue = issue2;
        if (_issue.format === "starts_with") {
          return `\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u0432\u0430 \u0441 "${_issue.prefix}"`;
        }
        if (_issue.format === "ends_with")
          return `\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u0432\u044A\u0440\u0448\u0432\u0430 \u0441 "${_issue.suffix}"`;
        if (_issue.format === "includes")
          return `\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0432\u043A\u043B\u044E\u0447\u0432\u0430 "${_issue.includes}"`;
        if (_issue.format === "regex")
          return `\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0441\u044A\u0432\u043F\u0430\u0434\u0430 \u0441 ${_issue.pattern}`;
        let invalid_adj = "\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D";
        if (_issue.format === "emoji")
          invalid_adj = "\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E";
        if (_issue.format === "datetime")
          invalid_adj = "\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E";
        if (_issue.format === "date")
          invalid_adj = "\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430";
        if (_issue.format === "time")
          invalid_adj = "\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E";
        if (_issue.format === "duration")
          invalid_adj = "\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430";
        return `${invalid_adj} ${FormatDictionary[_issue.format] ?? issue2.format}`;
      }
      case "not_multiple_of":
        return `\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E \u0447\u0438\u0441\u043B\u043E: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0431\u044A\u0434\u0435 \u043A\u0440\u0430\u0442\u043D\u043E \u043D\u0430 ${issue2.divisor}`;
      case "unrecognized_keys":
        return `\u041D\u0435\u0440\u0430\u0437\u043F\u043E\u0437\u043D\u0430\u0442${issue2.keys.length > 1 ? "\u0438" : ""} \u043A\u043B\u044E\u0447${issue2.keys.length > 1 ? "\u043E\u0432\u0435" : ""}: ${joinValues(issue2.keys, ", ")}`;
      case "invalid_key":
        return `\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043A\u043B\u044E\u0447 \u0432 ${issue2.origin}`;
      case "invalid_union":
        return "\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434";
      case "invalid_element":
        return `\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442 \u0432 ${issue2.origin}`;
      default:
        return `\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434`;
    }
  };
};
function bg_default() {
  return {
    localeError: error4()
  };
}

// node_modules/zod/v4/locales/ca.js
var error5 = () => {
  const Sizable = {
    string: { unit: "car\xE0cters", verb: "contenir" },
    file: { unit: "bytes", verb: "contenir" },
    array: { unit: "elements", verb: "contenir" },
    set: { unit: "elements", verb: "contenir" }
  };
  function getSizing(origin) {
    return Sizable[origin] ?? null;
  }
  const FormatDictionary = {
    regex: "entrada",
    email: "adre\xE7a electr\xF2nica",
    url: "URL",
    emoji: "emoji",
    uuid: "UUID",
    uuidv4: "UUIDv4",
    uuidv6: "UUIDv6",
    nanoid: "nanoid",
    guid: "GUID",
    cuid: "cuid",
    cuid2: "cuid2",
    ulid: "ULID",
    xid: "XID",
    ksuid: "KSUID",
    datetime: "data i hora ISO",
    date: "data ISO",
    time: "hora ISO",
    duration: "durada ISO",
    ipv4: "adre\xE7a IPv4",
    ipv6: "adre\xE7a IPv6",
    cidrv4: "rang IPv4",
    cidrv6: "rang IPv6",
    base64: "cadena codificada en base64",
    base64url: "cadena codificada en base64url",
    json_string: "cadena JSON",
    e164: "n\xFAmero E.164",
    jwt: "JWT",
    template_literal: "entrada"
  };
  const TypeDictionary = {
    nan: "NaN"
  };
  return (issue2) => {
    switch (issue2.code) {
      case "invalid_type": {
        const expected = TypeDictionary[issue2.expected] ?? issue2.expected;
        const receivedType = parsedType(issue2.input);
        const received = TypeDictionary[receivedType] ?? receivedType;
        if (/^[A-Z]/.test(issue2.expected)) {
          return `Tipus inv\xE0lid: s'esperava instanceof ${issue2.expected}, s'ha rebut ${received}`;
        }
        return `Tipus inv\xE0lid: s'esperava ${expected}, s'ha rebut ${received}`;
      }
      case "invalid_value":
        if (issue2.values.length === 1)
          return `Valor inv\xE0lid: s'esperava ${stringifyPrimitive(issue2.values[0])}`;
        return `Opci\xF3 inv\xE0lida: s'esperava una de ${joinValues(issue2.values, " o ")}`;
      case "too_big": {
        const adj = issue2.inclusive ? "com a m\xE0xim" : "menys de";
        const sizing = getSizing(issue2.origin);
        if (sizing)
          return `Massa gran: s'esperava que ${issue2.origin ?? "el valor"} contingu\xE9s ${adj} ${issue2.maximum.toString()} ${sizing.unit ?? "elements"}`;
        return `Massa gran: s'esperava que ${issue2.origin ?? "el valor"} fos ${adj} ${issue2.maximum.toString()}`;
      }
      case "too_small": {
        const adj = issue2.inclusive ? "com a m\xEDnim" : "m\xE9s de";
        const sizing = getSizing(issue2.origin);
        if (sizing) {
          return `Massa petit: s'esperava que ${issue2.origin} contingu\xE9s ${adj} ${issue2.minimum.toString()} ${sizing.unit}`;
        }
        return `Massa petit: s'esperava que ${issue2.origin} fos ${adj} ${issue2.minimum.toString()}`;
      }
      case "invalid_format": {
        const _issue = issue2;
        if (_issue.format === "starts_with") {
          return `Format inv\xE0lid: ha de comen\xE7ar amb "${_issue.prefix}"`;
        }
        if (_issue.format === "ends_with")
          return `Format inv\xE0lid: ha d'acabar amb "${_issue.suffix}"`;
        if (_issue.format === "includes")
          return `Format inv\xE0lid: ha d'incloure "${_issue.includes}"`;
        if (_issue.format === "regex")
          return `Format inv\xE0lid: ha de coincidir amb el patr\xF3 ${_issue.pattern}`;
        return `Format inv\xE0lid per a ${FormatDictionary[_issue.format] ?? issue2.format}`;
      }
      case "not_multiple_of":
        return `N\xFAmero inv\xE0lid: ha de ser m\xFAltiple de ${issue2.divisor}`;
      case "unrecognized_keys":
        return `Clau${issue2.keys.length > 1 ? "s" : ""} no reconeguda${issue2.keys.length > 1 ? "s" : ""}: ${joinValues(issue2.keys, ", ")}`;
      case "invalid_key":
        return `Clau inv\xE0lida a ${issue2.origin}`;
      case "invalid_union":
        return "Entrada inv\xE0lida";
      // Could also be "Tipus d'uniÃ³ invÃ lid" but "Entrada invÃ lida" is more general
      case "invalid_element":
        return `Element inv\xE0lid a ${issue2.origin}`;
      default:
        return `Entrada inv\xE0lida`;
    }
  };
};
function ca_default() {
  return {
    localeError: error5()
  };
}

// node_modules/zod/v4/locales/cs.js
var error6 = () => {
  const Sizable = {
    string: { unit: "znak\u016F", verb: "m\xEDt" },
    file: { unit: "bajt\u016F", verb: "m\xEDt" },
    array: { unit: "prvk\u016F", verb: "m\xEDt" },
    set: { unit: "prvk\u016F", verb: "m\xEDt" }
  };
  function getSizing(origin) {
    return Sizable[origin] ?? null;
  }
  const FormatDictionary = {
    regex: "regul\xE1rn\xED v\xFDraz",
    email: "e-mailov\xE1 adresa",
    url: "URL",
    emoji: "emoji",
    uuid: "UUID",
    uuidv4: "UUIDv4",
    uuidv6: "UUIDv6",
    nanoid: "nanoid",
    guid: "GUID",
    cuid: "cuid",
    cuid2: "cuid2",
    ulid: "ULID",
    xid: "XID",
    ksuid: "KSUID",
    datetime: "datum a \u010Das ve form\xE1tu ISO",
    date: "datum ve form\xE1tu ISO",
    time: "\u010Das ve form\xE1tu ISO",
    duration: "doba trv\xE1n\xED ISO",
    ipv4: "IPv4 adresa",
    ipv6: "IPv6 adresa",
    cidrv4: "rozsah IPv4",
    cidrv6: "rozsah IPv6",
    base64: "\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64",
    base64url: "\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64url",
    json_string: "\u0159et\u011Bzec ve form\xE1tu JSON",
    e164: "\u010D\xEDslo E.164",
    jwt: "JWT",
    template_literal: "vstup"
  };
  const TypeDictionary = {
    nan: "NaN",
    number: "\u010D\xEDslo",
    string: "\u0159et\u011Bzec",
    function: "funkce",
    array: "pole"
  };
  return (issue2) => {
    switch (issue2.code) {
      case "invalid_type": {
        const expected = TypeDictionary[issue2.expected] ?? issue2.expected;
        const receivedType = parsedType(issue2.input);
        const received = TypeDictionary[receivedType] ?? receivedType;
        if (/^[A-Z]/.test(issue2.expected)) {
          return `Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no instanceof ${issue2.expected}, obdr\u017Eeno ${received}`;
        }
        return `Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${expected}, obdr\u017Eeno ${received}`;
      }
      case "invalid_value":
        if (issue2.values.length === 1)
          return `Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${stringifyPrimitive(issue2.values[0])}`;
        return `Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${joinValues(issue2.values, "|")}`;
      case "too_big": {
        const adj = issue2.inclusive ? "<=" : "<";
        const sizing = getSizing(issue2.origin);
        if (sizing) {
          return `Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${issue2.origin ?? "hodnota"} mus\xED m\xEDt ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "prvk\u016F"}`;
        }
        return `Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${issue2.origin ?? "hodnota"} mus\xED b\xFDt ${adj}${issue2.maximum.toString()}`;
      }
      case "too_small": {
        const adj = issue2.inclusive ? ">=" : ">";
        const sizing = getSizing(issue2.origin);
        if (sizing) {
          return `Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${issue2.origin ?? "hodnota"} mus\xED m\xEDt ${adj}${issue2.minimum.toString()} ${sizing.unit ?? "prvk\u016F"}`;
        }
        return `Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${issue2.origin ?? "hodnota"} mus\xED b\xFDt ${adj}${issue2.minimum.toString()}`;
      }
      case "invalid_format": {
        const _issue = issue2;
        if (_issue.format === "starts_with")
          return `Neplatn\xFD \u0159et\u011Bzec: mus\xED za\u010D\xEDnat na "${_issue.prefix}"`;
        if (_issue.format === "ends_with")
          return `Neplatn\xFD \u0159et\u011Bzec: mus\xED kon\u010Dit na "${_issue.suffix}"`;
        if (_issue.format === "includes")
          return `Neplatn\xFD \u0159et\u011Bzec: mus\xED obsahovat "${_issue.includes}"`;
        if (_issue.format === "regex")
          return `Neplatn\xFD \u0159et\u011Bzec: mus\xED odpov\xEDdat vzoru ${_issue.pattern}`;
        return `Neplatn\xFD form\xE1t ${FormatDictionary[_issue.format] ?? issue2.format}`;
      }
      case "not_multiple_of":
        return `Neplatn\xE9 \u010D\xEDslo: mus\xED b\xFDt n\xE1sobkem ${issue2.divisor}`;
      case "unrecognized_keys":
        return `Nezn\xE1m\xE9 kl\xED\u010De: ${joinValues(issue2.keys, ", ")}`;
      case "invalid_key":
        return `Neplatn\xFD kl\xED\u010D v ${issue2.origin}`;
      case "invalid_union":
        return "Neplatn\xFD vstup";
      case "invalid_element":
        return `Neplatn\xE1 hodnota v ${issue2.origin}`;
      default:
        return `Neplatn\xFD vstup`;
    }
  };
};
function cs_default() {
  return {
    localeError: error6()
  };
}

// node_modules/zod/v4/locales/da.js
var error7 = () => {
  const Sizable = {
    string: { unit: "tegn", verb: "havde" },
    file: { unit: "bytes", verb: "havde" },
    array: { unit: "elementer", verb: "indeholdt" },
    set: { unit: "elementer", verb: "indeholdt" }
  };
  function getSizing(origin) {
    return Sizable[origin] ?? null;
  }
  const FormatDictionary = {
    regex: "input",
    email: "e-mailadresse",
    url: "URL",
    emoji: "emoji",
    uuid: "UUID",
    uuidv4: "UUIDv4",
    uuidv6: "UUIDv6",
    nanoid: "nanoid",
    guid: "GUID",
    cuid: "cuid",
    cuid2: "cuid2",
    ulid: "ULID",
    xid: "XID",
    ksuid: "KSUID",
    datetime: "ISO dato- og klokkesl\xE6t",
    date: "ISO-dato",
    time: "ISO-klokkesl\xE6t",
    duration: "ISO-varighed",
    ipv4: "IPv4-omr\xE5de",
    ipv6: "IPv6-omr\xE5de",
    cidrv4: "IPv4-spektrum",
    cidrv6: "IPv6-spektrum",
    base64: "base64-kodet streng",
    base64url: "base64url-kodet streng",
    json_string: "JSON-streng",
    e164: "E.164-nummer",
    jwt: "JWT",
    template_literal: "input"
  };
  const TypeDictionary = {
    nan: "NaN",
    string: "streng",
    number: "tal",
    boolean: "boolean",
    array: "liste",
    object: "objekt",
    set: "s\xE6t",
    file: "fil"
  };
  return (issue2) => {
    switch (issue2.code) {
      case "invalid_type": {
        const expected = TypeDictionary[issue2.expected] ?? issue2.expected;
        const receivedType = parsedType(issue2.input);
        const received = TypeDictionary[receivedType] ?? receivedType;
        if (/^[A-Z]/.test(issue2.expected)) {
          return `Ugyldigt input: forventede instanceof ${issue2.expected}, fik ${received}`;
        }
        return `Ugyldigt input: forventede ${expected}, fik ${received}`;
      }
      case "invalid_value":
        if (issue2.values.length === 1)
          return `Ugyldig v\xE6rdi: forventede ${stringifyPrimitive(issue2.values[0])}`;
        return `Ugyldigt valg: forventede en af f\xF8lgende ${joinValues(issue2.values, "|")}`;
      case "too_big": {
        const adj = issue2.inclusive ? "<=" : "<";
        const sizing = getSizing(issue2.origin);
        const origin = TypeDictionary[issue2.origin] ?? issue2.origin;
        if (sizing)
          return `For stor: forventede ${origin ?? "value"} ${sizing.verb} ${adj} ${issue2.maximum.toString()} ${sizing.unit ?? "elementer"}`;
        return `For stor: forventede ${origin ?? "value"} havde ${adj} ${issue2.maximum.toString()}`;
      }
      case "too_small": {
        const adj = issue2.inclusive ? ">=" : ">";
        const sizing = getSizing(issue2.origin);
        const origin = TypeDictionary[issue2.origin] ?? issue2.origin;
        if (sizing) {
          return `For lille: forventede ${origin} ${sizing.verb} ${adj} ${issue2.minimum.toString()} ${sizing.unit}`;
        }
        return `For lille: forventede ${origin} havde ${adj} ${issue2.minimum.toString()}`;
      }
      case "invalid_format": {
        const _issue = issue2;
        if (_issue.format === "starts_with")
          return `Ugyldig streng: skal starte med "${_issue.prefix}"`;
        if (_issue.format === "ends_with")
          return `Ugyldig streng: skal ende med "${_issue.suffix}"`;
        if (_issue.format === "includes")
          return `Ugyldig streng: skal indeholde "${_issue.includes}"`;
        if (_issue.format === "regex")
          return `Ugyldig streng: skal matche m\xF8nsteret ${_issue.pattern}`;
        return `Ugyldig ${FormatDictionary[_issue.format] ?? issue2.format}`;
      }
      case "not_multiple_of":
        return `Ugyldigt tal: skal v\xE6re deleligt med ${issue2.divisor}`;
      case "unrecognized_keys":
        return `${issue2.keys.length > 1 ? "Ukendte n\xF8gler" : "Ukendt n\xF8gle"}: ${joinValues(issue2.keys, ", ")}`;
      case "invalid_key":
        return `Ugyldig n\xF8gle i ${issue2.origin}`;
      case "invalid_union":
        return "Ugyldigt input: matcher ingen af de tilladte typer";
      case "invalid_element":
        return `Ugyldig v\xE6rdi i ${issue2.origin}`;
      default:
        return `Ugyldigt input`;
    }
  };
};
function da_default() {
  return {
    localeError: error7()
  };
}

// node_modules/zod/v4/locales/de.js
var error8 = () => {
  const Sizable = {
    string: { unit: "Zeichen", verb: "zu haben" },
    file: { unit: "Bytes", verb: "zu haben" },
    array: { unit: "Elemente", verb: "zu haben" },
    set: { unit: "Elemente", verb: "zu haben" }
  };
  function getSizing(origin) {
    return Sizable[origin] ?? null;
  }
  const FormatDictionary = {
    regex: "Eingabe",
    email: "E-Mail-Adresse",
    url: "URL",
    emoji: "Emoji",
    uuid: "UUID",
    uuidv4: "UUIDv4",
    uuidv6: "UUIDv6",
    nanoid: "nanoid",
    guid: "GUID",
    cuid: "cuid",
    cuid2: "cuid2",
    ulid: "ULID",
    xid: "XID",
    ksuid: "KSUID",
    datetime: "ISO-Datum und -Uhrzeit",
    date: "ISO-Datum",
    time: "ISO-Uhrzeit",
    duration: "ISO-Dauer",
    ipv4: "IPv4-Adresse",
    ipv6: "IPv6-Adresse",
    cidrv4: "IPv4-Bereich",
    cidrv6: "IPv6-Bereich",
    base64: "Base64-codierter String",
    base64url: "Base64-URL-codierter String",
    json_string: "JSON-String",
    e164: "E.164-Nummer",
    jwt: "JWT",
    template_literal: "Eingabe"
  };
  const TypeDictionary = {
    nan: "NaN",
    number: "Zahl",
    array: "Array"
  };
  return (issue2) => {
    switch (issue2.code) {
      case "invalid_type": {
        const expected = TypeDictionary[issue2.expected] ?? issue2.expected;
        const receivedType = parsedType(issue2.input);
        const received = TypeDictionary[receivedType] ?? receivedType;
        if (/^[A-Z]/.test(issue2.expected)) {
          return `Ung\xFCltige Eingabe: erwartet instanceof ${issue2.expected}, erhalten ${received}`;
        }
        return `Ung\xFCltige Eingabe: erwartet ${expected}, erhalten ${received}`;
      }
      case "invalid_value":
        if (issue2.values.length === 1)
          return `Ung\xFCltige Eingabe: erwartet ${stringifyPrimitive(issue2.values[0])}`;
        return `Ung\xFCltige Option: erwartet eine von ${joinValues(issue2.values, "|")}`;
      case "too_big": {
        const adj = issue2.inclusive ? "<=" : "<";
        const sizing = getSizing(issue2.origin);
        if (sizing)
          return `Zu gro\xDF: erwartet, dass ${issue2.origin ?? "Wert"} ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "Elemente"} hat`;
        return `Zu gro\xDF: erwartet, dass ${issue2.origin ?? "Wert"} ${adj}${issue2.maximum.toString()} ist`;
      }
      case "too_small": {
        const adj = issue2.inclusive ? ">=" : ">";
        const sizing = getSizing(issue2.origin);
        if (sizing) {
          return `Zu klein: erwartet, dass ${issue2.origin} ${adj}${issue2.minimum.toString()} ${sizing.unit} hat`;
        }
        return `Zu klein: erwartet, dass ${issue2.origin} ${adj}${issue2.minimum.toString()} ist`;
      }
      case "invalid_format": {
        const _issue = issue2;
        if (_issue.format === "starts_with")
          return `Ung\xFCltiger String: muss mit "${_issue.prefix}" beginnen`;
        if (_issue.format === "ends_with")
          return `Ung\xFCltiger String: muss mit "${_issue.suffix}" enden`;
        if (_issue.format === "includes")
          return `Ung\xFCltiger String: muss "${_issue.includes}" enthalten`;
        if (_issue.format === "regex")
          return `Ung\xFCltiger String: muss dem Muster ${_issue.pattern} entsprechen`;
        return `Ung\xFCltig: ${FormatDictionary[_issue.format] ?? issue2.format}`;
      }
      case "not_multiple_of":
        return `Ung\xFCltige Zahl: muss ein Vielfaches von ${issue2.divisor} sein`;
      case "unrecognized_keys":
        return `${issue2.keys.length > 1 ? "Unbekannte Schl\xFCssel" : "Unbekannter Schl\xFCssel"}: ${joinValues(issue2.keys, ", ")}`;
      case "invalid_key":
        return `Ung\xFCltiger Schl\xFCssel in ${issue2.origin}`;
      case "invalid_union":
        return "Ung\xFCltige Eingabe";
      case "invalid_element":
        return `Ung\xFCltiger Wert in ${issue2.origin}`;
      default:
        return `Ung\xFCltige Eingabe`;
    }
  };
};
function de_default() {
  return {
    localeError: error8()
  };
}

// node_modules/zod/v4/locales/en.js
var error9 = () => {
  const Sizable = {
    string: { unit: "characters", verb: "to have" },
    file: { unit: "bytes", verb: "to have" },
    array: { unit: "items", verb: "to have" },
    set: { unit: "items", verb: "to have" },
    map: { unit: "entries", verb: "to have" }
  };
  function getSizing(origin) {
    return Sizable[origin] ?? null;
  }
  const FormatDictionary = {
    regex: "input",
    email: "email address",
    url: "URL",
    emoji: "emoji",
    uuid: "UUID",
    uuidv4: "UUIDv4",
    uuidv6: "UUIDv6",
    nanoid: "nanoid",
    guid: "GUID",
    cuid: "cuid",
    cuid2: "cuid2",
    ulid: "ULID",
    xid: "XID",
    ksuid: "KSUID",
    datetime: "ISO datetime",
    date: "ISO date",
    time: "ISO time",
    duration: "ISO duration",
    ipv4: "IPv4 address",
    ipv6: "IPv6 address",
    mac: "MAC address",
    cidrv4: "IPv4 range",
    cidrv6: "IPv6 range",
    base64: "base64-encoded string",
    base64url: "base64url-encoded string",
    json_string: "JSON string",
    e164: "E.164 number",
    jwt: "JWT",
    template_literal: "input"
  };
  const TypeDictionary = {
    // Compatibility: "nan" -> "NaN" for display
    nan: "NaN"
    // All other type names omitted - they fall back to raw values via ?? operator
  };
  return (issue2) => {
    switch (issue2.code) {
      case "invalid_type": {
        const expected = TypeDictionary[issue2.expected] ?? issue2.expected;
        const receivedType = parsedType(issue2.input);
        const received = TypeDictionary[receivedType] ?? receivedType;
        return `Invalid input: expected ${expected}, received ${received}`;
      }
      case "invalid_value":
        if (issue2.values.length === 1)
          return `Invalid input: expected ${stringifyPrimitive(issue2.values[0])}`;
        return `Invalid option: expected one of ${joinValues(issue2.values, "|")}`;
      case "too_big": {
        const adj = issue2.inclusive ? "<=" : "<";
        const sizing = getSizing(issue2.origin);
        if (sizing)
          return `Too big: expected ${issue2.origin ?? "value"} to have ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "elements"}`;
        return `Too big: expected ${issue2.origin ?? "value"} to be ${adj}${issue2.maximum.toString()}`;
      }
      case "too_small": {
        const adj = issue2.inclusive ? ">=" : ">";
        const sizing = getSizing(issue2.origin);
        if (sizing) {
          return `Too small: expected ${issue2.origin} to have ${adj}${issue2.minimum.toString()} ${sizing.unit}`;
        }
        return `Too small: expected ${issue2.origin} to be ${adj}${issue2.minimum.toString()}`;
      }
      case "invalid_format": {
        const _issue = issue2;
        if (_issue.format === "starts_with") {
          return `Invalid string: must start with "${_issue.prefix}"`;
        }
        if (_issue.format === "ends_with")
          return `Invalid string: must end with "${_issue.suffix}"`;
        if (_issue.format === "includes")
          return `Invalid string: must include "${_issue.includes}"`;
        if (_issue.format === "regex")
          return `Invalid string: must match pattern ${_issue.pattern}`;
        return `Invalid ${FormatDictionary[_issue.format] ?? issue2.format}`;
      }
      case "not_multiple_of":
        return `Invalid number: must be a multiple of ${issue2.divisor}`;
      case "unrecognized_keys":
        return `Unrecognized key${issue2.keys.length > 1 ? "s" : ""}: ${joinValues(issue2.keys, ", ")}`;
      case "invalid_key":
        return `Invalid key in ${issue2.origin}`;
      case "invalid_union":
        return "Invalid input";
      case "invalid_element":
        return `Invalid value in ${issue2.origin}`;
      default:
        return `Invalid input`;
    }
  };
};
function en_default() {
  return {
    localeError: error9()
  };
}

// node_modules/zod/v4/locales/eo.js
var error10 = () => {
  const Sizable = {
    string: { unit: "karaktrojn", verb: "havi" },
    file: { unit: "bajtojn", verb: "havi" },
    array: { unit: "elementojn", verb: "havi" },
    set: { unit: "elementojn", verb: "havi" }
  };
  function getSizing(origin) {
    return Sizable[origin] ?? null;
  }
  const FormatDictionary = {
    regex: "enigo",
    email: "retadreso",
    url: "URL",
    emoji: "emo\u011Dio",
    uuid: "UUID",
    uuidv4: "UUIDv4",
    uuidv6: "UUIDv6",
    nanoid: "nanoid",
    guid: "GUID",
    cuid: "cuid",
    cuid2: "cuid2",
    ulid: "ULID",
    xid: "XID",
    ksuid: "KSUID",
    datetime: "ISO-datotempo",
    date: "ISO-dato",
    time: "ISO-tempo",
    duration: "ISO-da\u016Dro",
    ipv4: "IPv4-adreso",
    ipv6: "IPv6-adreso",
    cidrv4: "IPv4-rango",
    cidrv6: "IPv6-rango",
    base64: "64-ume kodita karaktraro",
    base64url: "URL-64-ume kodita karaktraro",
    json_string: "JSON-karaktraro",
    e164: "E.164-nombro",
    jwt: "JWT",
    template_literal: "enigo"
  };
  const TypeDictionary = {
    nan: "NaN",
    number: "nombro",
    array: "tabelo",
    null: "senvalora"
  };
  return (issue2) => {
    switch (issue2.code) {
      case "invalid_type": {
        const expected = TypeDictionary[issue2.expected] ?? issue2.expected;
        const receivedType = parsedType(issue2.input);
        const received = TypeDictionary[receivedType] ?? receivedType;
        if (/^[A-Z]/.test(issue2.expected)) {
          return `Nevalida enigo: atendi\u011Dis instanceof ${issue2.expected}, ricevi\u011Dis ${received}`;
        }
        return `Nevalida enigo: atendi\u011Dis ${expected}, ricevi\u011Dis ${received}`;
      }
      case "invalid_value":
        if (issue2.values.length === 1)
          return `Nevalida enigo: atendi\u011Dis ${stringifyPrimitive(issue2.values[0])}`;
        return `Nevalida opcio: atendi\u011Dis unu el ${joinValues(issue2.values, "|")}`;
      case "too_big": {
        const adj = issue2.inclusive ? "<=" : "<";
        const sizing = getSizing(issue2.origin);
        if (sizing)
          return `Tro granda: atendi\u011Dis ke ${issue2.origin ?? "valoro"} havu ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "elementojn"}`;
        return `Tro granda: atendi\u011Dis ke ${issue2.origin ?? "valoro"} havu ${adj}${issue2.maximum.toString()}`;
      }
      case "too_small": {
        const adj = issue2.inclusive ? ">=" : ">";
        const sizing = getSizing(issue2.origin);
        if (sizing) {
          return `Tro malgranda: atendi\u011Dis ke ${issue2.origin} havu ${adj}${issue2.minimum.toString()} ${sizing.unit}`;
        }
        return `Tro malgranda: atendi\u011Dis ke ${issue2.origin} estu ${adj}${issue2.minimum.toString()}`;
      }
      case "invalid_format": {
        const _issue = issue2;
        if (_issue.format === "starts_with")
          return `Nevalida karaktraro: devas komenci\u011Di per "${_issue.prefix}"`;
        if (_issue.format === "ends_with")
          return `Nevalida karaktraro: devas fini\u011Di per "${_issue.suffix}"`;
        if (_issue.format === "includes")
          return `Nevalida karaktraro: devas inkluzivi "${_issue.includes}"`;
        if (_issue.format === "regex")
          return `Nevalida karaktraro: devas kongrui kun la modelo ${_issue.pattern}`;
        return `Nevalida ${FormatDictionary[_issue.format] ?? issue2.format}`;
      }
      case "not_multiple_of":
        return `Nevalida nombro: devas esti oblo de ${issue2.divisor}`;
      case "unrecognized_keys":
        return `Nekonata${issue2.keys.length > 1 ? "j" : ""} \u015Dlosilo${issue2.keys.length > 1 ? "j" : ""}: ${joinValues(issue2.keys, ", ")}`;
      case "invalid_key":
        return `Nevalida \u015Dlosilo en ${issue2.origin}`;
      case "invalid_union":
        return "Nevalida enigo";
      case "invalid_element":
        return `Nevalida valoro en ${issue2.origin}`;
      default:
        return `Nevalida enigo`;
    }
  };
};
function eo_default() {
  return {
    localeError: error10()
  };
}

// node_modules/zod/v4/locales/es.js
var error11 = () => {
  const Sizable = {
    string: { unit: "caracteres", verb: "tener" },
    file: { unit: "bytes", verb: "tener" },
    array: { unit: "elementos", verb: "tener" },
    set: { unit: "elementos", verb: "tener" }
  };
  function getSizing(origin) {
    return Sizable[origin] ?? null;
  }
  const FormatDictionary = {
    regex: "entrada",
    email: "direcci\xF3n de correo electr\xF3nico",
    url: "URL",
    emoji: "emoji",
    uuid: "UUID",
    uuidv4: "UUIDv4",
    uuidv6: "UUIDv6",
    nanoid: "nanoid",
    guid: "GUID",
    cuid: "cuid",
    cuid2: "cuid2",
    ulid: "ULID",
    xid: "XID",
    ksuid: "KSUID",
    datetime: "fecha y hora ISO",
    date: "fecha ISO",
    time: "hora ISO",
    duration: "duraci\xF3n ISO",
    ipv4: "direcci\xF3n IPv4",
    ipv6: "direcci\xF3n IPv6",
    cidrv4: "rango IPv4",
    cidrv6: "rango IPv6",
    base64: "cadena codificada en base64",
    base64url: "URL codificada en base64",
    json_string: "cadena JSON",
    e164: "n\xFAmero E.164",
    jwt: "JWT",
    template_literal: "entrada"
  };
  const TypeDictionary = {
    nan: "NaN",
    string: "texto",
    number: "n\xFAmero",
    boolean: "booleano",
    array: "arreglo",
    object: "objeto",
    set: "conjunto",
    file: "archivo",
    date: "fecha",
    bigint: "n\xFAmero grande",
    symbol: "s\xEDmbolo",
    undefined: "indefinido",
    null: "nulo",
    function: "funci\xF3n",
    map: "mapa",
    record: "registro",
    tuple: "tupla",
    enum: "enumeraci\xF3n",
    union: "uni\xF3n",
    literal: "literal",
    promise: "promesa",
    void: "vac\xEDo",
    never: "nunca",
    unknown: "desconocido",
    any: "cualquiera"
  };
  return (issue2) => {
    switch (issue2.code) {
      case "invalid_type": {
        const expected = TypeDictionary[issue2.expected] ?? issue2.expected;
        const receivedType = parsedType(issue2.input);
        const received = TypeDictionary[receivedType] ?? receivedType;
        if (/^[A-Z]/.test(issue2.expected)) {
          return `Entrada inv\xE1lida: se esperaba instanceof ${issue2.expected}, recibido ${received}`;
        }
        return `Entrada inv\xE1lida: se esperaba ${expected}, recibido ${received}`;
      }
      case "invalid_value":
        if (issue2.values.length === 1)
          return `Entrada inv\xE1lida: se esperaba ${stringifyPrimitive(issue2.values[0])}`;
        return `Opci\xF3n inv\xE1lida: se esperaba una de ${joinValues(issue2.values, "|")}`;
      case "too_big": {
        const adj = issue2.inclusive ? "<=" : "<";
        const sizing = getSizing(issue2.origin);
        const origin = TypeDictionary[issue2.origin] ?? issue2.origin;
        if (sizing)
          return `Demasiado grande: se esperaba que ${origin ?? "valor"} tuviera ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "elementos"}`;
        return `Demasiado grande: se esperaba que ${origin ?? "valor"} fuera ${adj}${issue2.maximum.toString()}`;
      }
      case "too_small": {
        const adj = issue2.inclusive ? ">=" : ">";
        const sizing = getSizing(issue2.origin);
        const origin = TypeDictionary[issue2.origin] ?? issue2.origin;
        if (sizing) {
          return `Demasiado peque\xF1o: se esperaba que ${origin} tuviera ${adj}${issue2.minimum.toString()} ${sizing.unit}`;
        }
        return `Demasiado peque\xF1o: se esperaba que ${origin} fuera ${adj}${issue2.minimum.toString()}`;
      }
      case "invalid_format": {
        const _issue = issue2;
        if (_issue.format === "starts_with")
          return `Cadena inv\xE1lida: debe comenzar con "${_issue.prefix}"`;
        if (_issue.format === "ends_with")
          return `Cadena inv\xE1lida: debe terminar en "${_issue.suffix}"`;
        if (_issue.format === "includes")
          return `Cadena inv\xE1lida: debe incluir "${_issue.includes}"`;
        if (_issue.format === "regex")
          return `Cadena inv\xE1lida: debe coincidir con el patr\xF3n ${_issue.pattern}`;
        return `Inv\xE1lido ${FormatDictionary[_issue.format] ?? issue2.format}`;
      }
      case "not_multiple_of":
        return `N\xFAmero inv\xE1lido: debe ser m\xFAltiplo de ${issue2.divisor}`;
      case "unrecognized_keys":
        return `Llave${issue2.keys.length > 1 ? "s" : ""} desconocida${issue2.keys.length > 1 ? "s" : ""}: ${joinValues(issue2.keys, ", ")}`;
      case "invalid_key":
        return `Llave inv\xE1lida en ${TypeDictionary[issue2.origin] ?? issue2.origin}`;
      case "invalid_union":
        return "Entrada inv\xE1lida";
      case "invalid_element":
        return `Valor inv\xE1lido en ${TypeDictionary[issue2.origin] ?? issue2.origin}`;
      default:
        return `Entrada inv\xE1lida`;
    }
  };
};
function es_default() {
  return {
    localeError: error11()
  };
}

// node_modules/zod/v4/locales/fa.js
var error12 = () => {
  const Sizable = {
    string: { unit: "\u06A9\u0627\u0631\u0627\u06A9\u062A\u0631", verb: "\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F" },
    file: { unit: "\u0628\u0627\u06CC\u062A", verb: "\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F" },
    array: { unit: "\u0622\u06CC\u062A\u0645", verb: "\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F" },
    set: { unit: "\u0622\u06CC\u062A\u0645", verb: "\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F" }
  };
  function getSizing(origin) {
    return Sizable[origin] ?? null;
  }
  const FormatDictionary = {
    regex: "\u0648\u0631\u0648\u062F\u06CC",
    email: "\u0622\u062F\u0631\u0633 \u0627\u06CC\u0645\u06CC\u0644",
    url: "URL",
    emoji: "\u0627\u06CC\u0645\u0648\u062C\u06CC",
    uuid: "UUID",
    uuidv4: "UUIDv4",
    uuidv6: "UUIDv6",
    nanoid: "nanoid",
    guid: "GUID",
    cuid: "cuid",
    cuid2: "cuid2",
    ulid: "ULID",
    xid: "XID",
    ksuid: "KSUID",
    datetime: "\u062A\u0627\u0631\u06CC\u062E \u0648 \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",
    date: "\u062A\u0627\u0631\u06CC\u062E \u0627\u06CC\u0632\u0648",
    time: "\u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",
    duration: "\u0645\u062F\u062A \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",
    ipv4: "IPv4 \u0622\u062F\u0631\u0633",
    ipv6: "IPv6 \u0622\u062F\u0631\u0633",
    cidrv4: "IPv4 \u062F\u0627\u0645\u0646\u0647",
    cidrv6: "IPv6 \u062F\u0627\u0645\u0646\u0647",
    base64: "base64-encoded \u0631\u0634\u062A\u0647",
    base64url: "base64url-encoded \u0631\u0634\u062A\u0647",
    json_string: "JSON \u0631\u0634\u062A\u0647",
    e164: "E.164 \u0639\u062F\u062F",
    jwt: "JWT",
    template_literal: "\u0648\u0631\u0648\u062F\u06CC"
  };
  const TypeDictionary = {
    nan: "NaN",
    number: "\u0639\u062F\u062F",
    array: "\u0622\u0631\u0627\u06CC\u0647"
  };
  return (issue2) => {
    switch (issue2.code) {
      case "invalid_type": {
        const expected = TypeDictionary[issue2.expected] ?? issue2.expected;
        const receivedType = parsedType(issue2.input);
        const received = TypeDictionary[receivedType] ?? receivedType;
        if (/^[A-Z]/.test(issue2.expected)) {
          return `\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A instanceof ${issue2.expected} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${received} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`;
        }
        return `\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${expected} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${received} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`;
      }
      case "invalid_value":
        if (issue2.values.length === 1) {
          return `\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${stringifyPrimitive(issue2.values[0])} \u0645\u06CC\u200C\u0628\u0648\u062F`;
        }
        return `\u06AF\u0632\u06CC\u0646\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A \u06CC\u06A9\u06CC \u0627\u0632 ${joinValues(issue2.values, "|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;
      case "too_big": {
        const adj = issue2.inclusive ? "<=" : "<";
        const sizing = getSizing(issue2.origin);
        if (sizing) {
          return `\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${issue2.origin ?? "\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "\u0639\u0646\u0635\u0631"} \u0628\u0627\u0634\u062F`;
        }
        return `\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${issue2.origin ?? "\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${adj}${issue2.maximum.toString()} \u0628\u0627\u0634\u062F`;
      }
      case "too_small": {
        const adj = issue2.inclusive ? ">=" : ">";
        const sizing = getSizing(issue2.origin);
        if (sizing) {
          return `\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${issue2.origin} \u0628\u0627\u06CC\u062F ${adj}${issue2.minimum.toString()} ${sizing.unit} \u0628\u0627\u0634\u062F`;
        }
        return `\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${issue2.origin} \u0628\u0627\u06CC\u062F ${adj}${issue2.minimum.toString()} \u0628\u0627\u0634\u062F`;
      }
      case "invalid_format": {
        const _issue = issue2;
        if (_issue.format === "starts_with") {
          return `\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${_issue.prefix}" \u0634\u0631\u0648\u0639 \u0634\u0648\u062F`;
        }
        if (_issue.format === "ends_with") {
          return `\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${_issue.suffix}" \u062A\u0645\u0627\u0645 \u0634\u0648\u062F`;
        }
        if (_issue.format === "includes") {
          return `\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0634\u0627\u0645\u0644 "${_issue.includes}" \u0628\u0627\u0634\u062F`;
        }
        if (_issue.format === "regex") {
          return `\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 \u0627\u0644\u06AF\u0648\u06CC ${_issue.pattern} \u0645\u0637\u0627\u0628\u0642\u062A \u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F`;
        }
        return `${FormatDictionary[_issue.format] ?? issue2.format} \u0646\u0627\u0645\u0639\u062A\u0628\u0631`;
      }
      case "not_multiple_of":
        return `\u0639\u062F\u062F \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0645\u0636\u0631\u0628 ${issue2.divisor} \u0628\u0627\u0634\u062F`;
      case "unrecognized_keys":
        return `\u06A9\u0644\u06CC\u062F${issue2.keys.length > 1 ? "\u0647\u0627\u06CC" : ""} \u0646\u0627\u0634\u0646\u0627\u0633: ${joinValues(issue2.keys, ", ")}`;
      case "invalid_key":
        return `\u06A9\u0644\u06CC\u062F \u0646\u0627\u0634\u0646\u0627\u0633 \u062F\u0631 ${issue2.origin}`;
      case "invalid_union":
        return `\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631`;
      case "invalid_element":
        return `\u0645\u0642\u062F\u0627\u0631 \u0646\u0627\u0645\u0639\u062A\u0628\u0631 \u062F\u0631 ${issue2.origin}`;
      default:
        return `\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631`;
    }
  };
};
function fa_default() {
  return {
    localeError: error12()
  };
}

// node_modules/zod/v4/locales/fi.js
var error13 = () => {
  const Sizable = {
    string: { unit: "merkki\xE4", subject: "merkkijonon" },
    file: { unit: "tavua", subject: "tiedoston" },
    array: { unit: "alkiota", subject: "listan" },
    set: { unit: "alkiota", subject: "joukon" },
    number: { unit: "", subject: "luvun" },
    bigint: { unit: "", subject: "suuren kokonaisluvun" },
    int: { unit: "", subject: "kokonaisluvun" },
    date: { unit: "", subject: "p\xE4iv\xE4m\xE4\xE4r\xE4n" }
  };
  function getSizing(origin) {
    return Sizable[origin] ?? null;
  }
  const FormatDictionary = {
    regex: "s\xE4\xE4nn\xF6llinen lauseke",
    email: "s\xE4hk\xF6postiosoite",
    url: "URL-osoite",
    emoji: "emoji",
    uuid: "UUID",
    uuidv4: "UUIDv4",
    uuidv6: "UUIDv6",
    nanoid: "nanoid",
    guid: "GUID",
    cuid: "cuid",
    cuid2: "cuid2",
    ulid: "ULID",
    xid: "XID",
    ksuid: "KSUID",
    datetime: "ISO-aikaleima",
    date: "ISO-p\xE4iv\xE4m\xE4\xE4r\xE4",
    time: "ISO-aika",
    duration: "ISO-kesto",
    ipv4: "IPv4-osoite",
    ipv6: "IPv6-osoite",
    cidrv4: "IPv4-alue",
    cidrv6: "IPv6-alue",
    base64: "base64-koodattu merkkijono",
    base64url: "base64url-koodattu merkkijono",
    json_string: "JSON-merkkijono",
    e164: "E.164-luku",
    jwt: "JWT",
    template_literal: "templaattimerkkijono"
  };
  const TypeDictionary = {
    nan: "NaN"
  };
  return (issue2) => {
    switch (issue2.code) {
      case "invalid_type": {
        const expected = TypeDictionary[issue2.expected] ?? issue2.expected;
        const receivedType = parsedType(issue2.input);
        const received = TypeDictionary[receivedType] ?? receivedType;
        if (/^[A-Z]/.test(issue2.expected)) {
          return `Virheellinen tyyppi: odotettiin instanceof ${issue2.expected}, oli ${received}`;
        }
        return `Virheellinen tyyppi: odotettiin ${expected}, oli ${received}`;
      }
      case "invalid_value":
        if (issue2.values.length === 1)
          return `Virheellinen sy\xF6te: t\xE4ytyy olla ${stringifyPrimitive(issue2.values[0])}`;
        return `Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${joinValues(issue2.values, "|")}`;
      case "too_big": {
        const adj = issue2.inclusive ? "<=" : "<";
        const sizing = getSizing(issue2.origin);
        if (sizing) {
          return `Liian suuri: ${sizing.subject} t\xE4ytyy olla ${adj}${issue2.maximum.toString()} ${sizing.unit}`.trim();
        }
        return `Liian suuri: arvon t\xE4ytyy olla ${adj}${issue2.maximum.toString()}`;
      }
      case "too_small": {
        const adj = issue2.inclusive ? ">=" : ">";
        const sizing = getSizing(issue2.origin);
        if (sizing) {
          return `Liian pieni: ${sizing.subject} t\xE4ytyy olla ${adj}${issue2.minimum.toString()} ${sizing.unit}`.trim();
        }
        return `Liian pieni: arvon t\xE4ytyy olla ${adj}${issue2.minimum.toString()}`;
      }
      case "invalid_format": {
        const _issue = issue2;
        if (_issue.format === "starts_with")
          return `Virheellinen sy\xF6te: t\xE4ytyy alkaa "${_issue.prefix}"`;
        if (_issue.format === "ends_with")
          return `Virheellinen sy\xF6te: t\xE4ytyy loppua "${_issue.suffix}"`;
        if (_issue.format === "includes")
          return `Virheellinen sy\xF6te: t\xE4ytyy sis\xE4lt\xE4\xE4 "${_issue.includes}"`;
        if (_issue.format === "regex") {
          return `Virheellinen sy\xF6te: t\xE4ytyy vastata s\xE4\xE4nn\xF6llist\xE4 lauseketta ${_issue.pattern}`;
        }
        return `Virheellinen ${FormatDictionary[_issue.format] ?? issue2.format}`;
      }
      case "not_multiple_of":
        return `Virheellinen luku: t\xE4ytyy olla luvun ${issue2.divisor} monikerta`;
      case "unrecognized_keys":
        return `${issue2.keys.length > 1 ? "Tuntemattomat avaimet" : "Tuntematon avain"}: ${joinValues(issue2.keys, ", ")}`;
      case "invalid_key":
        return "Virheellinen avain tietueessa";
      case "invalid_union":
        return "Virheellinen unioni";
      case "invalid_element":
        return "Virheellinen arvo joukossa";
      default:
        return `Virheellinen sy\xF6te`;
    }
  };
};
function fi_default() {
  return {
    localeError: error13()
  };
}

// node_modules/zod/v4/locales/fr.js
var error14 = () => {
  const Sizable = {
    string: { unit: "caract\xE8res", verb: "avoir" },
    file: { unit: "octets", verb: "avoir" },
    array: { unit: "\xE9l\xE9ments", verb: "avoir" },
    set: { unit: "\xE9l\xE9ments", verb: "avoir" }
  };
  function getSizing(origin) {
    return Sizable[origin] ?? null;
  }
  const FormatDictionary = {
    regex: "entr\xE9e",
    email: "adresse e-mail",
    url: "URL",
    emoji: "emoji",
    uuid: "UUID",
    uuidv4: "UUIDv4",
    uuidv6: "UUIDv6",
    nanoid: "nanoid",
    guid: "GUID",
    cuid: "cuid",
    cuid2: "cuid2",
    ulid: "ULID",
    xid: "XID",
    ksuid: "KSUID",
    datetime: "date et heure ISO",
    date: "date ISO",
    time: "heure ISO",
    duration: "dur\xE9e ISO",
    ipv4: "adresse IPv4",
    ipv6: "adresse IPv6",
    cidrv4: "plage IPv4",
    cidrv6: "plage IPv6",
    base64: "cha\xEEne encod\xE9e en base64",
    base64url: "cha\xEEne encod\xE9e en base64url",
    json_string: "cha\xEEne JSON",
    e164: "num\xE9ro E.164",
    jwt: "JWT",
    template_literal: "entr\xE9e"
  };
  const TypeDictionary = {
    nan: "NaN",
    number: "nombre",
    array: "tableau"
  };
  return (issue2) => {
    switch (issue2.code) {
      case "invalid_type": {
        const expected = TypeDictionary[issue2.expected] ?? issue2.expected;
        const receivedType = parsedType(issue2.input);
        const received = TypeDictionary[receivedType] ?? receivedType;
        if (/^[A-Z]/.test(issue2.expected)) {
          return `Entr\xE9e invalide : instanceof ${issue2.expected} attendu, ${received} re\xE7u`;
        }
        return `Entr\xE9e invalide : ${expected} attendu, ${received} re\xE7u`;
      }
      case "invalid_value":
        if (issue2.values.length === 1)
          return `Entr\xE9e invalide : ${stringifyPrimitive(issue2.values[0])} attendu`;
        return `Option invalide : une valeur parmi ${joinValues(issue2.values, "|")} attendue`;
      case "too_big": {
        const adj = issue2.inclusive ? "<=" : "<";
        const sizing = getSizing(issue2.origin);
        if (sizing)
          return `Trop grand : ${issue2.origin ?? "valeur"} doit ${sizing.verb} ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "\xE9l\xE9ment(s)"}`;
        return `Trop grand : ${issue2.origin ?? "valeur"} doit \xEAtre ${adj}${issue2.maximum.toString()}`;
      }
      case "too_small": {
        const adj = issue2.inclusive ? ">=" : ">";
        const sizing = getSizing(issue2.origin);
        if (sizing) {
          return `Trop petit : ${issue2.origin} doit ${sizing.verb} ${adj}${issue2.minimum.toString()} ${sizing.unit}`;
        }
        return `Trop petit : ${issue2.origin} doit \xEAtre ${adj}${issue2.minimum.toString()}`;
      }
      case "invalid_format": {
        const _issue = issue2;
        if (_issue.format === "starts_with")
          return `Cha\xEEne invalide : doit commencer par "${_issue.prefix}"`;
        if (_issue.format === "ends_with")
          return `Cha\xEEne invalide : doit se terminer par "${_issue.suffix}"`;
        if (_issue.format === "includes")
          return `Cha\xEEne invalide : doit inclure "${_issue.includes}"`;
        if (_issue.format === "regex")
          return `Cha\xEEne invalide : doit correspondre au mod\xE8le ${_issue.pattern}`;
        return `${FormatDictionary[_issue.format] ?? issue2.format} invalide`;
      }
      case "not_multiple_of":
        return `Nombre invalide : doit \xEAtre un multiple de ${issue2.divisor}`;
      case "unrecognized_keys":
        return `Cl\xE9${issue2.keys.length > 1 ? "s" : ""} non reconnue${issue2.keys.length > 1 ? "s" : ""} : ${joinValues(issue2.keys, ", ")}`;
      case "invalid_key":
        return `Cl\xE9 invalide dans ${issue2.origin}`;
      case "invalid_union":
        return "Entr\xE9e invalide";
      case "invalid_element":
        return `Valeur invalide dans ${issue2.origin}`;
      default:
        return `Entr\xE9e invalide`;
    }
  };
};
function fr_default() {
  return {
    localeError: error14()
  };
}

// node_modules/zod/v4/locales/fr-CA.js
var error15 = () => {
  const Sizable = {
    string: { unit: "caract\xE8res", verb: "avoir" },
    file: { unit: "octets", verb: "avoir" },
    array: { unit: "\xE9l\xE9ments", verb: "avoir" },
    set: { unit: "\xE9l\xE9ments", verb: "avoir" }
  };
  function getSizing(origin) {
    return Sizable[origin] ?? null;
  }
  const FormatDictionary = {
    regex: "entr\xE9e",
    email: "adresse courriel",
    url: "URL",
    emoji: "emoji",
    uuid: "UUID",
    uuidv4: "UUIDv4",
    uuidv6: "UUIDv6",
    nanoid: "nanoid",
    guid: "GUID",
    cuid: "cuid",
    cuid2: "cuid2",
    ulid: "ULID",
    xid: "XID",
    ksuid: "KSUID",
    datetime: "date-heure ISO",
    date: "date ISO",
    time: "heure ISO",
    duration: "dur\xE9e ISO",
    ipv4: "adresse IPv4",
    ipv6: "adresse IPv6",
    cidrv4: "plage IPv4",
    cidrv6: "plage IPv6",
    base64: "cha\xEEne encod\xE9e en base64",
    base64url: "cha\xEEne encod\xE9e en base64url",
    json_string: "cha\xEEne JSON",
    e164: "num\xE9ro E.164",
    jwt: "JWT",
    template_literal: "entr\xE9e"
  };
  const TypeDictionary = {
    nan: "NaN"
  };
  return (issue2) => {
    switch (issue2.code) {
      case "invalid_type": {
        const expected = TypeDictionary[issue2.expected] ?? issue2.expected;
        const receivedType = parsedType(issue2.input);
        const received = TypeDictionary[receivedType] ?? receivedType;
        if (/^[A-Z]/.test(issue2.expected)) {
          return `Entr\xE9e invalide : attendu instanceof ${issue2.expected}, re\xE7u ${received}`;
        }
        return `Entr\xE9e invalide : attendu ${expected}, re\xE7u ${received}`;
      }
      case "invalid_value":
        if (issue2.values.length === 1)
          return `Entr\xE9e invalide : attendu ${stringifyPrimitive(issue2.values[0])}`;
        return `Option invalide : attendu l'une des valeurs suivantes ${joinValues(issue2.values, "|")}`;
      case "too_big": {
        const adj = issue2.inclusive ? "\u2264" : "<";
        const sizing = getSizing(issue2.origin);
        if (sizing)
          return `Trop grand : attendu que ${issue2.origin ?? "la valeur"} ait ${adj}${issue2.maximum.toString()} ${sizing.unit}`;
        return `Trop grand : attendu que ${issue2.origin ?? "la valeur"} soit ${adj}${issue2.maximum.toString()}`;
      }
      case "too_small": {
        const adj = issue2.inclusive ? "\u2265" : ">";
        const sizing = getSizing(issue2.origin);
        if (sizing) {
          return `Trop petit : attendu que ${issue2.origin} ait ${adj}${issue2.minimum.toString()} ${sizing.unit}`;
        }
        return `Trop petit : attendu que ${issue2.origin} soit ${adj}${issue2.minimum.toString()}`;
      }
      case "invalid_format": {
        const _issue = issue2;
        if (_issue.format === "starts_with") {
          return `Cha\xEEne invalide : doit commencer par "${_issue.prefix}"`;
        }
        if (_issue.format === "ends_with")
          return `Cha\xEEne invalide : doit se terminer par "${_issue.suffix}"`;
        if (_issue.format === "includes")
          return `Cha\xEEne invalide : doit inclure "${_issue.includes}"`;
        if (_issue.format === "regex")
          return `Cha\xEEne invalide : doit correspondre au motif ${_issue.pattern}`;
        return `${FormatDictionary[_issue.format] ?? issue2.format} invalide`;
      }
      case "not_multiple_of":
        return `Nombre invalide : doit \xEAtre un multiple de ${issue2.divisor}`;
      case "unrecognized_keys":
        return `Cl\xE9${issue2.keys.length > 1 ? "s" : ""} non reconnue${issue2.keys.length > 1 ? "s" : ""} : ${joinValues(issue2.keys, ", ")}`;
      case "invalid_key":
        return `Cl\xE9 invalide dans ${issue2.origin}`;
      case "invalid_union":
        return "Entr\xE9e invalide";
      case "invalid_element":
        return `Valeur invalide dans ${issue2.origin}`;
      default:
        return `Entr\xE9e invalide`;
    }
  };
};
function fr_CA_default() {
  return {
    localeError: error15()
  };
}

// node_modules/zod/v4/locales/he.js
var error16 = () => {
  const TypeNames = {
    string: { label: "\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA", gender: "f" },
    number: { label: "\u05DE\u05E1\u05E4\u05E8", gender: "m" },
    boolean: { label: "\u05E2\u05E8\u05DA \u05D1\u05D5\u05DC\u05D9\u05D0\u05E0\u05D9", gender: "m" },
    bigint: { label: "BigInt", gender: "m" },
    date: { label: "\u05EA\u05D0\u05E8\u05D9\u05DA", gender: "m" },
    array: { label: "\u05DE\u05E2\u05E8\u05DA", gender: "m" },
    object: { label: "\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8", gender: "m" },
    null: { label: "\u05E2\u05E8\u05DA \u05E8\u05D9\u05E7 (null)", gender: "m" },
    undefined: { label: "\u05E2\u05E8\u05DA \u05DC\u05D0 \u05DE\u05D5\u05D2\u05D3\u05E8 (undefined)", gender: "m" },
    symbol: { label: "\u05E1\u05D9\u05DE\u05D1\u05D5\u05DC (Symbol)", gender: "m" },
    function: { label: "\u05E4\u05D5\u05E0\u05E7\u05E6\u05D9\u05D4", gender: "f" },
    map: { label: "\u05DE\u05E4\u05D4 (Map)", gender: "f" },
    set: { label: "\u05E7\u05D1\u05D5\u05E6\u05D4 (Set)", gender: "f" },
    file: { label: "\u05E7\u05D5\u05D1\u05E5", gender: "m" },
    promise: { label: "Promise", gender: "m" },
    NaN: { label: "NaN", gender: "m" },
    unknown: { label: "\u05E2\u05E8\u05DA \u05DC\u05D0 \u05D9\u05D3\u05D5\u05E2", gender: "m" },
    value: { label: "\u05E2\u05E8\u05DA", gender: "m" }
  };
  const Sizable = {
    string: { unit: "\u05EA\u05D5\u05D5\u05D9\u05DD", shortLabel: "\u05E7\u05E6\u05E8", longLabel: "\u05D0\u05E8\u05D5\u05DA" },
    file: { unit: "\u05D1\u05D9\u05D9\u05D8\u05D9\u05DD", shortLabel: "\u05E7\u05D8\u05DF", longLabel: "\u05D2\u05D3\u05D5\u05DC" },
    array: { unit: "\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD", shortLabel: "\u05E7\u05D8\u05DF", longLabel: "\u05D2\u05D3\u05D5\u05DC" },
    set: { unit: "\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD", shortLabel: "\u05E7\u05D8\u05DF", longLabel: "\u05D2\u05D3\u05D5\u05DC" },
    number: { unit: "", shortLabel: "\u05E7\u05D8\u05DF", longLabel: "\u05D2\u05D3\u05D5\u05DC" }
    // no unit
  };
  const typeEntry = (t) => t ? TypeNames[t] : void 0;
  const typeLabel = (t) => {
    const e = typeEntry(t);
    if (e)
      return e.label;
    return t ?? TypeNames.unknown.label;
  };
  const withDefinite = (t) => `\u05D4${typeLabel(t)}`;
  const verbFor = (t) => {
    const e = typeEntry(t);
    const gender = e?.gender ?? "m";
    return gender === "f" ? "\u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05D9\u05D5\u05EA" : "\u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA";
  };
  const getSizing = (origin) => {
    if (!origin)
      return null;
    return Sizable[origin] ?? null;
  };
  const FormatDictionary = {
    regex: { label: "\u05E7\u05DC\u05D8", gender: "m" },
    email: { label: "\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC", gender: "f" },
    url: { label: "\u05DB\u05EA\u05D5\u05D1\u05EA \u05E8\u05E9\u05EA", gender: "f" },
    emoji: { label: "\u05D0\u05D9\u05DE\u05D5\u05D2'\u05D9", gender: "m" },
    uuid: { label: "UUID", gender: "m" },
    nanoid: { label: "nanoid", gender: "m" },
    guid: { label: "GUID", gender: "m" },
    cuid: { label: "cuid", gender: "m" },
    cuid2: { label: "cuid2", gender: "m" },
    ulid: { label: "ULID", gender: "m" },
    xid: { label: "XID", gender: "m" },
    ksuid: { label: "KSUID", gender: "m" },
    datetime: { label: "\u05EA\u05D0\u05E8\u05D9\u05DA \u05D5\u05D6\u05DE\u05DF ISO", gender: "m" },
    date: { label: "\u05EA\u05D0\u05E8\u05D9\u05DA ISO", gender: "m" },
    time: { label: "\u05D6\u05DE\u05DF ISO", gender: "m" },
    duration: { label: "\u05DE\u05E9\u05DA \u05D6\u05DE\u05DF ISO", gender: "m" },
    ipv4: { label: "\u05DB\u05EA\u05D5\u05D1\u05EA IPv4", gender: "f" },
    ipv6: { label: "\u05DB\u05EA\u05D5\u05D1\u05EA IPv6", gender: "f" },
    cidrv4: { label: "\u05D8\u05D5\u05D5\u05D7 IPv4", gender: "m" },
    cidrv6: { label: "\u05D8\u05D5\u05D5\u05D7 IPv6", gender: "m" },
    base64: { label: "\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64", gender: "f" },
    base64url: { label: "\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64 \u05DC\u05DB\u05EA\u05D5\u05D1\u05D5\u05EA \u05E8\u05E9\u05EA", gender: "f" },
    json_string: { label: "\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON", gender: "f" },
    e164: { label: "\u05DE\u05E1\u05E4\u05E8 E.164", gender: "m" },
    jwt: { label: "JWT", gender: "m" },
    ends_with: { label: "\u05E7\u05DC\u05D8", gender: "m" },
    includes: { label: "\u05E7\u05DC\u05D8", gender: "m" },
    lowercase: { label: "\u05E7\u05DC\u05D8", gender: "m" },
    starts_with: { label: "\u05E7\u05DC\u05D8", gender: "m" },
    uppercase: { label: "\u05E7\u05DC\u05D8", gender: "m" }
  };
  const TypeDictionary = {
    nan: "NaN"
  };
  return (issue2) => {
    switch (issue2.code) {
      case "invalid_type": {
        const expectedKey = issue2.expected;
        const expected = TypeDictionary[expectedKey ?? ""] ?? typeLabel(expectedKey);
        const receivedType = parsedType(issue2.input);
        const received = TypeDictionary[receivedType] ?? TypeNames[receivedType]?.label ?? receivedType;
        if (/^[A-Z]/.test(issue2.expected)) {
          return `\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA instanceof ${issue2.expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${received}`;
        }
        return `\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${received}`;
      }
      case "invalid_value": {
        if (issue2.values.length === 1) {
          return `\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05E2\u05E8\u05DA \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA ${stringifyPrimitive(issue2.values[0])}`;
        }
        const stringified = issue2.values.map((v) => stringifyPrimitive(v));
        if (issue2.values.length === 2) {
          return `\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${stringified[0]} \u05D0\u05D5 ${stringified[1]}`;
        }
        const lastValue = stringified[stringified.length - 1];
        const restValues = stringified.slice(0, -1).join(", ");
        return `\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${restValues} \u05D0\u05D5 ${lastValue}`;
      }
      case "too_big": {
        const sizing = getSizing(issue2.origin);
        const subject = withDefinite(issue2.origin ?? "value");
        if (issue2.origin === "string") {
          return `${sizing?.longLabel ?? "\u05D0\u05E8\u05D5\u05DA"} \u05DE\u05D3\u05D9: ${subject} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${issue2.maximum.toString()} ${sizing?.unit ?? ""} ${issue2.inclusive ? "\u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA" : "\u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8"}`.trim();
        }
        if (issue2.origin === "number") {
          const comparison = issue2.inclusive ? `\u05E7\u05D8\u05DF \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${issue2.maximum}` : `\u05E7\u05D8\u05DF \u05DE-${issue2.maximum}`;
          return `\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${subject} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${comparison}`;
        }
        if (issue2.origin === "array" || issue2.origin === "set") {
          const verb = issue2.origin === "set" ? "\u05E6\u05E8\u05D9\u05DB\u05D4" : "\u05E6\u05E8\u05D9\u05DA";
          const comparison = issue2.inclusive ? `${issue2.maximum} ${sizing?.unit ?? ""} \u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA` : `\u05E4\u05D7\u05D5\u05EA \u05DE-${issue2.maximum} ${sizing?.unit ?? ""}`;
          return `\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${subject} ${verb} \u05DC\u05D4\u05DB\u05D9\u05DC ${comparison}`.trim();
        }
        const adj = issue2.inclusive ? "<=" : "<";
        const be = verbFor(issue2.origin ?? "value");
        if (sizing?.unit) {
          return `${sizing.longLabel} \u05DE\u05D3\u05D9: ${subject} ${be} ${adj}${issue2.maximum.toString()} ${sizing.unit}`;
        }
        return `${sizing?.longLabel ?? "\u05D2\u05D3\u05D5\u05DC"} \u05DE\u05D3\u05D9: ${subject} ${be} ${adj}${issue2.maximum.toString()}`;
      }
      case "too_small": {
        const sizing = getSizing(issue2.origin);
        const subject = withDefinite(issue2.origin ?? "value");
        if (issue2.origin === "string") {
          return `${sizing?.shortLabel ?? "\u05E7\u05E6\u05E8"} \u05DE\u05D3\u05D9: ${subject} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${issue2.minimum.toString()} ${sizing?.unit ?? ""} ${issue2.inclusive ? "\u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8" : "\u05DC\u05E4\u05D7\u05D5\u05EA"}`.trim();
        }
        if (issue2.origin === "number") {
          const comparison = issue2.inclusive ? `\u05D2\u05D3\u05D5\u05DC \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${issue2.minimum}` : `\u05D2\u05D3\u05D5\u05DC \u05DE-${issue2.minimum}`;
          return `\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${subject} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${comparison}`;
        }
        if (issue2.origin === "array" || issue2.origin === "set") {
          const verb = issue2.origin === "set" ? "\u05E6\u05E8\u05D9\u05DB\u05D4" : "\u05E6\u05E8\u05D9\u05DA";
          if (issue2.minimum === 1 && issue2.inclusive) {
            const singularPhrase = issue2.origin === "set" ? "\u05DC\u05E4\u05D7\u05D5\u05EA \u05E4\u05E8\u05D9\u05D8 \u05D0\u05D7\u05D3" : "\u05DC\u05E4\u05D7\u05D5\u05EA \u05E4\u05E8\u05D9\u05D8 \u05D0\u05D7\u05D3";
            return `\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${subject} ${verb} \u05DC\u05D4\u05DB\u05D9\u05DC ${singularPhrase}`;
          }
          const comparison = issue2.inclusive ? `${issue2.minimum} ${sizing?.unit ?? ""} \u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8` : `\u05D9\u05D5\u05EA\u05E8 \u05DE-${issue2.minimum} ${sizing?.unit ?? ""}`;
          return `\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${subject} ${verb} \u05DC\u05D4\u05DB\u05D9\u05DC ${comparison}`.trim();
        }
        const adj = issue2.inclusive ? ">=" : ">";
        const be = verbFor(issue2.origin ?? "value");
        if (sizing?.unit) {
          return `${sizing.shortLabel} \u05DE\u05D3\u05D9: ${subject} ${be} ${adj}${issue2.minimum.toString()} ${sizing.unit}`;
        }
        return `${sizing?.shortLabel ?? "\u05E7\u05D8\u05DF"} \u05DE\u05D3\u05D9: ${subject} ${be} ${adj}${issue2.minimum.toString()}`;
      }
      case "invalid_format": {
        const _issue = issue2;
        if (_issue.format === "starts_with")
          return `\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1 "${_issue.prefix}"`;
        if (_issue.format === "ends_with")
          return `\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${_issue.suffix}"`;
        if (_issue.format === "includes")
          return `\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${_issue.includes}"`;
        if (_issue.format === "regex")
          return `\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D0\u05D9\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA ${_issue.pattern}`;
        const nounEntry = FormatDictionary[_issue.format];
        const noun = nounEntry?.label ?? _issue.format;
        const gender = nounEntry?.gender ?? "m";
        const adjective = gender === "f" ? "\u05EA\u05E7\u05D9\u05E0\u05D4" : "\u05EA\u05E7\u05D9\u05DF";
        return `${noun} \u05DC\u05D0 ${adjective}`;
      }
      case "not_multiple_of":
        return `\u05DE\u05E1\u05E4\u05E8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DE\u05DB\u05E4\u05DC\u05D4 \u05E9\u05DC ${issue2.divisor}`;
      case "unrecognized_keys":
        return `\u05DE\u05E4\u05EA\u05D7${issue2.keys.length > 1 ? "\u05D5\u05EA" : ""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${issue2.keys.length > 1 ? "\u05D9\u05DD" : "\u05D4"}: ${joinValues(issue2.keys, ", ")}`;
      case "invalid_key": {
        return `\u05E9\u05D3\u05D4 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8`;
      }
      case "invalid_union":
        return "\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF";
      case "invalid_element": {
        const place = withDefinite(issue2.origin ?? "array");
        return `\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${place}`;
      }
      default:
        return `\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF`;
    }
  };
};
function he_default() {
  return {
    localeError: error16()
  };
}

// node_modules/zod/v4/locales/hu.js
var error17 = () => {
  const Sizable = {
    string: { unit: "karakter", verb: "legyen" },
    file: { unit: "byte", verb: "legyen" },
    array: { unit: "elem", verb: "legyen" },
    set: { unit: "elem", verb: "legyen" }
  };
  function getSizing(origin) {
    return Sizable[origin] ?? null;
  }
  const FormatDictionary = {
    regex: "bemenet",
    email: "email c\xEDm",
    url: "URL",
    emoji: "emoji",
    uuid: "UUID",
    uuidv4: "UUIDv4",
    uuidv6: "UUIDv6",
    nanoid: "nanoid",
    guid: "GUID",
    cuid: "cuid",
    cuid2: "cuid2",
    ulid: "ULID",
    xid: "XID",
    ksuid: "KSUID",
    datetime: "ISO id\u0151b\xE9lyeg",
    date: "ISO d\xE1tum",
    time: "ISO id\u0151",
    duration: "ISO id\u0151intervallum",
    ipv4: "IPv4 c\xEDm",
    ipv6: "IPv6 c\xEDm",
    cidrv4: "IPv4 tartom\xE1ny",
    cidrv6: "IPv6 tartom\xE1ny",
    base64: "base64-k\xF3dolt string",
    base64url: "base64url-k\xF3dolt string",
    json_string: "JSON string",
    e164: "E.164 sz\xE1m",
    jwt: "JWT",
    template_literal: "bemenet"
  };
  const TypeDictionary = {
    nan: "NaN",
    number: "sz\xE1m",
    array: "t\xF6mb"
  };
  return (issue2) => {
    switch (issue2.code) {
      case "invalid_type": {
        const expected = TypeDictionary[issue2.expected] ?? issue2.expected;
        const receivedType = parsedType(issue2.input);
        const received = TypeDictionary[receivedType] ?? receivedType;
        if (/^[A-Z]/.test(issue2.expected)) {
          return `\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k instanceof ${issue2.expected}, a kapott \xE9rt\xE9k ${received}`;
        }
        return `\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${expected}, a kapott \xE9rt\xE9k ${received}`;
      }
      case "invalid_value":
        if (issue2.values.length === 1)
          return `\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${stringifyPrimitive(issue2.values[0])}`;
        return `\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${joinValues(issue2.values, "|")}`;
      case "too_big": {
        const adj = issue2.inclusive ? "<=" : "<";
        const sizing = getSizing(issue2.origin);
        if (sizing)
          return `T\xFAl nagy: ${issue2.origin ?? "\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "elem"}`;
        return `T\xFAl nagy: a bemeneti \xE9rt\xE9k ${issue2.origin ?? "\xE9rt\xE9k"} t\xFAl nagy: ${adj}${issue2.maximum.toString()}`;
      }
      case "too_small": {
        const adj = issue2.inclusive ? ">=" : ">";
        const sizing = getSizing(issue2.origin);
        if (sizing) {
          return `T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${issue2.origin} m\xE9rete t\xFAl kicsi ${adj}${issue2.minimum.toString()} ${sizing.unit}`;
        }
        return `T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${issue2.origin} t\xFAl kicsi ${adj}${issue2.minimum.toString()}`;
      }
      case "invalid_format": {
        const _issue = issue2;
        if (_issue.format === "starts_with")
          return `\xC9rv\xE9nytelen string: "${_issue.prefix}" \xE9rt\xE9kkel kell kezd\u0151dnie`;
        if (_issue.format === "ends_with")
          return `\xC9rv\xE9nytelen string: "${_issue.suffix}" \xE9rt\xE9kkel kell v\xE9gz\u0151dnie`;
        if (_issue.format === "includes")
          return `\xC9rv\xE9nytelen string: "${_issue.includes}" \xE9rt\xE9ket kell tartalmaznia`;
        if (_issue.format === "regex")
          return `\xC9rv\xE9nytelen string: ${_issue.pattern} mint\xE1nak kell megfelelnie`;
        return `\xC9rv\xE9nytelen ${FormatDictionary[_issue.format] ?? issue2.format}`;
      }
      case "not_multiple_of":
        return `\xC9rv\xE9nytelen sz\xE1m: ${issue2.divisor} t\xF6bbsz\xF6r\xF6s\xE9nek kell lennie`;
      case "unrecognized_keys":
        return `Ismeretlen kulcs${issue2.keys.length > 1 ? "s" : ""}: ${joinValues(issue2.keys, ", ")}`;
      case "invalid_key":
        return `\xC9rv\xE9nytelen kulcs ${issue2.origin}`;
      case "invalid_union":
        return "\xC9rv\xE9nytelen bemenet";
      case "invalid_element":
        return `\xC9rv\xE9nytelen \xE9rt\xE9k: ${issue2.origin}`;
      default:
        return `\xC9rv\xE9nytelen bemenet`;
    }
  };
};
function hu_default() {
  return {
    localeError: error17()
  };
}

// node_modules/zod/v4/locales/hy.js
function getArmenianPlural(count, one, many) {
  return Math.abs(count) === 1 ? one : many;
}
function withDefiniteArticle(word) {
  if (!word)
    return "";
  const vowels = ["\u0561", "\u0565", "\u0568", "\u056B", "\u0578", "\u0578\u0582", "\u0585"];
  const lastChar = word[word.length - 1];
  return word + (vowels.includes(lastChar) ? "\u0576" : "\u0568");
}
var error18 = () => {
  const Sizable = {
    string: {
      unit: {
        one: "\u0576\u0577\u0561\u0576",
        many: "\u0576\u0577\u0561\u0576\u0576\u0565\u0580"
      },
      verb: "\u0578\u0582\u0576\u0565\u0576\u0561\u056C"
    },
    file: {
      unit: {
        one: "\u0562\u0561\u0575\u0569",
        many: "\u0562\u0561\u0575\u0569\u0565\u0580"
      },
      verb: "\u0578\u0582\u0576\u0565\u0576\u0561\u056C"
    },
    array: {
      unit: {
        one: "\u057F\u0561\u0580\u0580",
        many: "\u057F\u0561\u0580\u0580\u0565\u0580"
      },
      verb: "\u0578\u0582\u0576\u0565\u0576\u0561\u056C"
    },
    set: {
      unit: {
        one: "\u057F\u0561\u0580\u0580",
        many: "\u057F\u0561\u0580\u0580\u0565\u0580"
      },
      verb: "\u0578\u0582\u0576\u0565\u0576\u0561\u056C"
    }
  };
  function getSizing(origin) {
    return Sizable[origin] ?? null;
  }
  const FormatDictionary = {
    regex: "\u0574\u0578\u0582\u057F\u0584",
    email: "\u0567\u056C. \u0570\u0561\u057D\u0581\u0565",
    url: "URL",
    emoji: "\u0567\u0574\u0578\u057B\u056B",
    uuid: "UUID",
    uuidv4: "UUIDv4",
    uuidv6: "UUIDv6",
    nanoid: "nanoid",
    guid: "GUID",
    cuid: "cuid",
    cuid2: "cuid2",
    ulid: "ULID",
    xid: "XID",
    ksuid: "KSUID",
    datetime: "ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E \u0587 \u056A\u0561\u0574",
    date: "ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E",
    time: "ISO \u056A\u0561\u0574",
    duration: "ISO \u057F\u0587\u0578\u0572\u0578\u0582\u0569\u0575\u0578\u0582\u0576",
    ipv4: "IPv4 \u0570\u0561\u057D\u0581\u0565",
    ipv6: "IPv6 \u0570\u0561\u057D\u0581\u0565",
    cidrv4: "IPv4 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",
    cidrv6: "IPv6 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",
    base64: "base64 \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",
    base64url: "base64url \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",
    json_string: "JSON \u057F\u0578\u0572",
    e164: "E.164 \u0570\u0561\u0574\u0561\u0580",
    jwt: "JWT",
    template_literal: "\u0574\u0578\u0582\u057F\u0584"
  };
  const TypeDictionary = {
    nan: "NaN",
    number: "\u0569\u056B\u057E",
    array: "\u0566\u0561\u0576\u0563\u057E\u0561\u056E"
  };
  return (issue2) => {
    switch (issue2.code) {
      case "invalid_type": {
        const expected = TypeDictionary[issue2.expected] ?? issue2.expected;
        const receivedType = parsedType(issue2.input);
        const received = TypeDictionary[receivedType] ?? receivedType;
        if (/^[A-Z]/.test(issue2.expected)) {
          return `\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 instanceof ${issue2.expected}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${received}`;
        }
        return `\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${expected}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${received}`;
      }
      case "invalid_value":
        if (issue2.values.length === 1)
          return `\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${stringifyPrimitive(issue2.values[1])}`;
        return `\u054D\u056D\u0561\u056C \u057F\u0561\u0580\u0562\u0565\u0580\u0561\u056F\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 \u0570\u0565\u057F\u0587\u0575\u0561\u056C\u0576\u0565\u0580\u056B\u0581 \u0574\u0565\u056F\u0568\u055D ${joinValues(issue2.values, "|")}`;
      case "too_big": {
        const adj = issue2.inclusive ? "<=" : "<";
        const sizing = getSizing(issue2.origin);
        if (sizing) {
          const maxValue = Number(issue2.maximum);
          const unit = getArmenianPlural(maxValue, sizing.unit.one, sizing.unit.many);
          return `\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${withDefiniteArticle(issue2.origin ?? "\u0561\u0580\u056A\u0565\u0584")} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${adj}${issue2.maximum.toString()} ${unit}`;
        }
        return `\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${withDefiniteArticle(issue2.origin ?? "\u0561\u0580\u056A\u0565\u0584")} \u056C\u056B\u0576\u056B ${adj}${issue2.maximum.toString()}`;
      }
      case "too_small": {
        const adj = issue2.inclusive ? ">=" : ">";
        const sizing = getSizing(issue2.origin);
        if (sizing) {
          const minValue = Number(issue2.minimum);
          const unit = getArmenianPlural(minValue, sizing.unit.one, sizing.unit.many);
          return `\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${withDefiniteArticle(issue2.origin)} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${adj}${issue2.minimum.toString()} ${unit}`;
        }
        return `\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${withDefiniteArticle(issue2.origin)} \u056C\u056B\u0576\u056B ${adj}${issue2.minimum.toString()}`;
      }
      case "invalid_format": {
        const _issue = issue2;
        if (_issue.format === "starts_with")
          return `\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057D\u056F\u057D\u057E\u056B "${_issue.prefix}"-\u0578\u057E`;
        if (_issue.format === "ends_with")
          return `\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0561\u057E\u0561\u0580\u057F\u057E\u056B "${_issue.suffix}"-\u0578\u057E`;
        if (_issue.format === "includes")
          return `\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057A\u0561\u0580\u0578\u0582\u0576\u0561\u056F\u056B "${_issue.includes}"`;
        if (_issue.format === "regex")
          return `\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0570\u0561\u0574\u0561\u057A\u0561\u057F\u0561\u057D\u056D\u0561\u0576\u056B ${_issue.pattern} \u0571\u0587\u0561\u0579\u0561\u0583\u056B\u0576`;
        return `\u054D\u056D\u0561\u056C ${FormatDictionary[_issue.format] ?? issue2.format}`;
      }
      case "not_multiple_of":
        return `\u054D\u056D\u0561\u056C \u0569\u056B\u057E\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0562\u0561\u0566\u0574\u0561\u057A\u0561\u057F\u056B\u056F \u056C\u056B\u0576\u056B ${issue2.divisor}-\u056B`;
      case "unrecognized_keys":
        return `\u0549\u0573\u0561\u0576\u0561\u0579\u057E\u0561\u056E \u0562\u0561\u0576\u0561\u056C\u056B${issue2.keys.length > 1 ? "\u0576\u0565\u0580" : ""}. ${joinValues(issue2.keys, ", ")}`;
      case "invalid_key":
        return `\u054D\u056D\u0561\u056C \u0562\u0561\u0576\u0561\u056C\u056B ${withDefiniteArticle(issue2.origin)}-\u0578\u0582\u0574`;
      case "invalid_union":
        return "\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574";
      case "invalid_element":
        return `\u054D\u056D\u0561\u056C \u0561\u0580\u056A\u0565\u0584 ${withDefiniteArticle(issue2.origin)}-\u0578\u0582\u0574`;
      default:
        return `\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574`;
    }
  };
};
function hy_default() {
  return {
    localeError: error18()
  };
}

// node_modules/zod/v4/locales/id.js
var error19 = () => {
  const Sizable = {
    string: { unit: "karakter", verb: "memiliki" },
    file: { unit: "byte", verb: "memiliki" },
    array: { unit: "item", verb: "memiliki" },
    set: { unit: "item", verb: "memiliki" }
  };
  function getSizing(origin) {
    return Sizable[origin] ?? null;
  }
  const FormatDictionary = {
    regex: "input",
    email: "alamat email",
    url: "URL",
    emoji: "emoji",
    uuid: "UUID",
    uuidv4: "UUIDv4",
    uuidv6: "UUIDv6",
    nanoid: "nanoid",
    guid: "GUID",
    cuid: "cuid",
    cuid2: "cuid2",
    ulid: "ULID",
    xid: "XID",
    ksuid: "KSUID",
    datetime: "tanggal dan waktu format ISO",
    date: "tanggal format ISO",
    time: "jam format ISO",
    duration: "durasi format ISO",
    ipv4: "alamat IPv4",
    ipv6: "alamat IPv6",
    cidrv4: "rentang alamat IPv4",
    cidrv6: "rentang alamat IPv6",
    base64: "string dengan enkode base64",
    base64url: "string dengan enkode base64url",
    json_string: "string JSON",
    e164: "angka E.164",
    jwt: "JWT",
    template_literal: "input"
  };
  const TypeDictionary = {
    nan: "NaN"
  };
  return (issue2) => {
    switch (issue2.code) {
      case "invalid_type": {
        const expected = TypeDictionary[issue2.expected] ?? issue2.expected;
        const receivedType = parsedType(issue2.input);
        const received = TypeDictionary[receivedType] ?? receivedType;
        if (/^[A-Z]/.test(issue2.expected)) {
          return `Input tidak valid: diharapkan instanceof ${issue2.expected}, diterima ${received}`;
        }
        return `Input tidak valid: diharapkan ${expected}, diterima ${received}`;
      }
      case "invalid_value":
        if (issue2.values.length === 1)
          return `Input tidak valid: diharapkan ${stringifyPrimitive(issue2.values[0])}`;
        return `Pilihan tidak valid: diharapkan salah satu dari ${joinValues(issue2.values, "|")}`;
      case "too_big": {
        const adj = issue2.inclusive ? "<=" : "<";
        const sizing = getSizing(issue2.origin);
        if (sizing)
          return `Terlalu besar: diharapkan ${issue2.origin ?? "value"} memiliki ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "elemen"}`;
        return `Terlalu besar: diharapkan ${issue2.origin ?? "value"} menjadi ${adj}${issue2.maximum.toString()}`;
      }
      case "too_small": {
        const adj = issue2.inclusive ? ">=" : ">";
        const sizing = getSizing(issue2.origin);
        if (sizing) {
          return `Terlalu kecil: diharapkan ${issue2.origin} memiliki ${adj}${issue2.minimum.toString()} ${sizing.unit}`;
        }
        return `Terlalu kecil: diharapkan ${issue2.origin} menjadi ${adj}${issue2.minimum.toString()}`;
      }
      case "invalid_format": {
        const _issue = issue2;
        if (_issue.format === "starts_with")
          return `String tidak valid: harus dimulai dengan "${_issue.prefix}"`;
        if (_issue.format === "ends_with")
          return `String tidak valid: harus berakhir dengan "${_issue.suffix}"`;
        if (_issue.format === "includes")
          return `String tidak valid: harus menyertakan "${_issue.includes}"`;
        if (_issue.format === "regex")
          return `String tidak valid: harus sesuai pola ${_issue.pattern}`;
        return `${FormatDictionary[_issue.format] ?? issue2.format} tidak valid`;
      }
      case "not_multiple_of":
        return `Angka tidak valid: harus kelipatan dari ${issue2.divisor}`;
      case "unrecognized_keys":
        return `Kunci tidak dikenali ${issue2.keys.length > 1 ? "s" : ""}: ${joinValues(issue2.keys, ", ")}`;
      case "invalid_key":
        return `Kunci tidak valid di ${issue2.origin}`;
      case "invalid_union":
        return "Input tidak valid";
      case "invalid_element":
        return `Nilai tidak valid di ${issue2.origin}`;
      default:
        return `Input tidak valid`;
    }
  };
};
function id_default() {
  return {
    localeError: error19()
  };
}

// node_modules/zod/v4/locales/is.js
var error20 = () => {
  const Sizable = {
    string: { unit: "stafi", verb: "a\xF0 hafa" },
    file: { unit: "b\xE6ti", verb: "a\xF0 hafa" },
    array: { unit: "hluti", verb: "a\xF0 hafa" },
    set: { unit: "hluti", verb: "a\xF0 hafa" }
  };
  function getSizing(origin) {
    return Sizable[origin] ?? null;
  }
  const FormatDictionary = {
    regex: "gildi",
    email: "netfang",
    url: "vefsl\xF3\xF0",
    emoji: "emoji",
    uuid: "UUID",
    uuidv4: "UUIDv4",
    uuidv6: "UUIDv6",
    nanoid: "nanoid",
    guid: "GUID",
    cuid: "cuid",
    cuid2: "cuid2",
    ulid: "ULID",
    xid: "XID",
    ksuid: "KSUID",
    datetime: "ISO dagsetning og t\xEDmi",
    date: "ISO dagsetning",
    time: "ISO t\xEDmi",
    duration: "ISO t\xEDmalengd",
    ipv4: "IPv4 address",
    ipv6: "IPv6 address",
    cidrv4: "IPv4 range",
    cidrv6: "IPv6 range",
    base64: "base64-encoded strengur",
    base64url: "base64url-encoded strengur",
    json_string: "JSON strengur",
    e164: "E.164 t\xF6lugildi",
    jwt: "JWT",
    template_literal: "gildi"
  };
  const TypeDictionary = {
    nan: "NaN",
    number: "n\xFAmer",
    array: "fylki"
  };
  return (issue2) => {
    switch (issue2.code) {
      case "invalid_type": {
        const expected = TypeDictionary[issue2.expected] ?? issue2.expected;
        const receivedType = parsedType(issue2.input);
        const received = TypeDictionary[receivedType] ?? receivedType;
        if (/^[A-Z]/.test(issue2.expected)) {
          return `Rangt gildi: \xDE\xFA sl\xF3st inn ${received} \xFEar sem \xE1 a\xF0 vera instanceof ${issue2.expected}`;
        }
        return `Rangt gildi: \xDE\xFA sl\xF3st inn ${received} \xFEar sem \xE1 a\xF0 vera ${expected}`;
      }
      case "invalid_value":
        if (issue2.values.length === 1)
          return `Rangt gildi: gert r\xE1\xF0 fyrir ${stringifyPrimitive(issue2.values[0])}`;
        return `\xD3gilt val: m\xE1 vera eitt af eftirfarandi ${joinValues(issue2.values, "|")}`;
      case "too_big": {
        const adj = issue2.inclusive ? "<=" : "<";
        const sizing = getSizing(issue2.origin);
        if (sizing)
          return `Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${issue2.origin ?? "gildi"} hafi ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "hluti"}`;
        return `Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${issue2.origin ?? "gildi"} s\xE9 ${adj}${issue2.maximum.toString()}`;
      }
      case "too_small": {
        const adj = issue2.inclusive ? ">=" : ">";
        const sizing = getSizing(issue2.origin);
        if (sizing) {
          return `Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${issue2.origin} hafi ${adj}${issue2.minimum.toString()} ${sizing.unit}`;
        }
        return `Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${issue2.origin} s\xE9 ${adj}${issue2.minimum.toString()}`;
      }
      case "invalid_format": {
        const _issue = issue2;
        if (_issue.format === "starts_with") {
          return `\xD3gildur strengur: ver\xF0ur a\xF0 byrja \xE1 "${_issue.prefix}"`;
        }
        if (_issue.format === "ends_with")
          return `\xD3gildur strengur: ver\xF0ur a\xF0 enda \xE1 "${_issue.suffix}"`;
        if (_issue.format === "includes")
          return `\xD3gildur strengur: ver\xF0ur a\xF0 innihalda "${_issue.includes}"`;
        if (_issue.format === "regex")
          return `\xD3gildur strengur: ver\xF0ur a\xF0 fylgja mynstri ${_issue.pattern}`;
        return `Rangt ${FormatDictionary[_issue.format] ?? issue2.format}`;
      }
      case "not_multiple_of":
        return `R\xF6ng tala: ver\xF0ur a\xF0 vera margfeldi af ${issue2.divisor}`;
      case "unrecognized_keys":
        return `\xD3\xFEekkt ${issue2.keys.length > 1 ? "ir lyklar" : "ur lykill"}: ${joinValues(issue2.keys, ", ")}`;
      case "invalid_key":
        return `Rangur lykill \xED ${issue2.origin}`;
      case "invalid_union":
        return "Rangt gildi";
      case "invalid_element":
        return `Rangt gildi \xED ${issue2.origin}`;
      default:
        return `Rangt gildi`;
    }
  };
};
function is_default() {
  return {
    localeError: error20()
  };
}

// node_modules/zod/v4/locales/it.js
var error21 = () => {
  const Sizable = {
    string: { unit: "caratteri", verb: "avere" },
    file: { unit: "byte", verb: "avere" },
    array: { unit: "elementi", verb: "avere" },
    set: { unit: "elementi", verb: "avere" }
  };
  function getSizing(origin) {
    return Sizable[origin] ?? null;
  }
  const FormatDictionary = {
    regex: "input",
    email: "indirizzo email",
    url: "URL",
    emoji: "emoji",
    uuid: "UUID",
    uuidv4: "UUIDv4",
    uuidv6: "UUIDv6",
    nanoid: "nanoid",
    guid: "GUID",
    cuid: "cuid",
    cuid2: "cuid2",
    ulid: "ULID",
    xid: "XID",
    ksuid: "KSUID",
    datetime: "data e ora ISO",
    date: "data ISO",
    time: "ora ISO",
    duration: "durata ISO",
    ipv4: "indirizzo IPv4",
    ipv6: "indirizzo IPv6",
    cidrv4: "intervallo IPv4",
    cidrv6: "intervallo IPv6",
    base64: "stringa codificata in base64",
    base64url: "URL codificata in base64",
    json_string: "stringa JSON",
    e164: "numero E.164",
    jwt: "JWT",
    template_literal: "input"
  };
  const TypeDictionary = {
    nan: "NaN",
    number: "numero",
    array: "vettore"
  };
  return (issue2) => {
    switch (issue2.code) {
      case "invalid_type": {
        const expected = TypeDictionary[issue2.expected] ?? issue2.expected;
        const receivedType = parsedType(issue2.input);
        const received = TypeDictionary[receivedType] ?? receivedType;
        if (/^[A-Z]/.test(issue2.expected)) {
          return `Input non valido: atteso instanceof ${issue2.expected}, ricevuto ${received}`;
        }
        return `Input non valido: atteso ${expected}, ricevuto ${received}`;
      }
      case "invalid_value":
        if (issue2.values.length === 1)
          return `Input non valido: atteso ${stringifyPrimitive(issue2.values[0])}`;
        return `Opzione non valida: atteso uno tra ${joinValues(issue2.values, "|")}`;
      case "too_big": {
        const adj = issue2.inclusive ? "<=" : "<";
        const sizing = getSizing(issue2.origin);
        if (sizing)
          return `Troppo grande: ${issue2.origin ?? "valore"} deve avere ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "elementi"}`;
        return `Troppo grande: ${issue2.origin ?? "valore"} deve essere ${adj}${issue2.maximum.toString()}`;
      }
      case "too_small": {
        const adj = issue2.inclusive ? ">=" : ">";
        const sizing = getSizing(issue2.origin);
        if (sizing) {
          return `Troppo piccolo: ${issue2.origin} deve avere ${adj}${issue2.minimum.toString()} ${sizing.unit}`;
        }
        return `Troppo piccolo: ${issue2.origin} deve essere ${adj}${issue2.minimum.toString()}`;
      }
      case "invalid_format": {
        const _issue = issue2;
        if (_issue.format === "starts_with")
          return `Stringa non valida: deve iniziare con "${_issue.prefix}"`;
        if (_issue.format === "ends_with")
          return `Stringa non valida: deve terminare con "${_issue.suffix}"`;
        if (_issue.format === "includes")
          return `Stringa non valida: deve includere "${_issue.includes}"`;
        if (_issue.format === "regex")
          return `Stringa non valida: deve corrispondere al pattern ${_issue.pattern}`;
        return `Invalid ${FormatDictionary[_issue.format] ?? issue2.format}`;
      }
      case "not_multiple_of":
        return `Numero non valido: deve essere un multiplo di ${issue2.divisor}`;
      case "unrecognized_keys":
        return `Chiav${issue2.keys.length > 1 ? "i" : "e"} non riconosciut${issue2.keys.length > 1 ? "e" : "a"}: ${joinValues(issue2.keys, ", ")}`;
      case "invalid_key":
        return `Chiave non valida in ${issue2.origin}`;
      case "invalid_union":
        return "Input non valido";
      case "invalid_element":
        return `Valore non valido in ${issue2.origin}`;
      default:
        return `Input non valido`;
    }
  };
};
function it_default() {
  return {
    localeError: error21()
  };
}

// node_modules/zod/v4/locales/ja.js
var error22 = () => {
  const Sizable = {
    string: { unit: "\u6587\u5B57", verb: "\u3067\u3042\u308B" },
    file: { unit: "\u30D0\u30A4\u30C8", verb: "\u3067\u3042\u308B" },
    array: { unit: "\u8981\u7D20", verb: "\u3067\u3042\u308B" },
    set: { unit: "\u8981\u7D20", verb: "\u3067\u3042\u308B" }
  };
  function getSizing(origin) {
    return Sizable[origin] ?? null;
  }
  const FormatDictionary = {
    regex: "\u5165\u529B\u5024",
    email: "\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9",
    url: "URL",
    emoji: "\u7D75\u6587\u5B57",
    uuid: "UUID",
    uuidv4: "UUIDv4",
    uuidv6: "UUIDv6",
    nanoid: "nanoid",
    guid: "GUID",
    cuid: "cuid",
    cuid2: "cuid2",
    ulid: "ULID",
    xid: "XID",
    ksuid: "KSUID",
    datetime: "ISO\u65E5\u6642",
    date: "ISO\u65E5\u4ED8",
    time: "ISO\u6642\u523B",
    duration: "ISO\u671F\u9593",
    ipv4: "IPv4\u30A2\u30C9\u30EC\u30B9",
    ipv6: "IPv6\u30A2\u30C9\u30EC\u30B9",
    cidrv4: "IPv4\u7BC4\u56F2",
    cidrv6: "IPv6\u7BC4\u56F2",
    base64: "base64\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",
    base64url: "base64url\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",
    json_string: "JSON\u6587\u5B57\u5217",
    e164: "E.164\u756A\u53F7",
    jwt: "JWT",
    template_literal: "\u5165\u529B\u5024"
  };
  const TypeDictionary = {
    nan: "NaN",
    number: "\u6570\u5024",
    array: "\u914D\u5217"
  };
  return (issue2) => {
    switch (issue2.code) {
      case "invalid_type": {
        const expected = TypeDictionary[issue2.expected] ?? issue2.expected;
        const receivedType = parsedType(issue2.input);
        const received = TypeDictionary[receivedType] ?? receivedType;
        if (/^[A-Z]/.test(issue2.expected)) {
          return `\u7121\u52B9\u306A\u5165\u529B: instanceof ${issue2.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${received}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`;
        }
        return `\u7121\u52B9\u306A\u5165\u529B: ${expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${received}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`;
      }
      case "invalid_value":
        if (issue2.values.length === 1)
          return `\u7121\u52B9\u306A\u5165\u529B: ${stringifyPrimitive(issue2.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`;
        return `\u7121\u52B9\u306A\u9078\u629E: ${joinValues(issue2.values, "\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;
      case "too_big": {
        const adj = issue2.inclusive ? "\u4EE5\u4E0B\u3067\u3042\u308B" : "\u3088\u308A\u5C0F\u3055\u3044";
        const sizing = getSizing(issue2.origin);
        if (sizing)
          return `\u5927\u304D\u3059\u304E\u308B\u5024: ${issue2.origin ?? "\u5024"}\u306F${issue2.maximum.toString()}${sizing.unit ?? "\u8981\u7D20"}${adj}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;
        return `\u5927\u304D\u3059\u304E\u308B\u5024: ${issue2.origin ?? "\u5024"}\u306F${issue2.maximum.toString()}${adj}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;
      }
      case "too_small": {
        const adj = issue2.inclusive ? "\u4EE5\u4E0A\u3067\u3042\u308B" : "\u3088\u308A\u5927\u304D\u3044";
        const sizing = getSizing(issue2.origin);
        if (sizing)
          return `\u5C0F\u3055\u3059\u304E\u308B\u5024: ${issue2.origin}\u306F${issue2.minimum.toString()}${sizing.unit}${adj}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;
        return `\u5C0F\u3055\u3059\u304E\u308B\u5024: ${issue2.origin}\u306F${issue2.minimum.toString()}${adj}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;
      }
      case "invalid_format": {
        const _issue = issue2;
        if (_issue.format === "starts_with")
          return `\u7121\u52B9\u306A\u6587\u5B57\u5217: "${_issue.prefix}"\u3067\u59CB\u307E\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;
        if (_issue.format === "ends_with")
          return `\u7121\u52B9\u306A\u6587\u5B57\u5217: "${_issue.suffix}"\u3067\u7D42\u308F\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;
        if (_issue.format === "includes")
          return `\u7121\u52B9\u306A\u6587\u5B57\u5217: "${_issue.includes}"\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;
        if (_issue.format === "regex")
          return `\u7121\u52B9\u306A\u6587\u5B57\u5217: \u30D1\u30BF\u30FC\u30F3${_issue.pattern}\u306B\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;
        return `\u7121\u52B9\u306A${FormatDictionary[_issue.format] ?? issue2.format}`;
      }
      case "not_multiple_of":
        return `\u7121\u52B9\u306A\u6570\u5024: ${issue2.divisor}\u306E\u500D\u6570\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;
      case "unrecognized_keys":
        return `\u8A8D\u8B58\u3055\u308C\u3066\u3044\u306A\u3044\u30AD\u30FC${issue2.keys.length > 1 ? "\u7FA4" : ""}: ${joinValues(issue2.keys, "\u3001")}`;
      case "invalid_key":
        return `${issue2.origin}\u5185\u306E\u7121\u52B9\u306A\u30AD\u30FC`;
      case "invalid_union":
        return "\u7121\u52B9\u306A\u5165\u529B";
      case "invalid_element":
        return `${issue2.origin}\u5185\u306E\u7121\u52B9\u306A\u5024`;
      default:
        return `\u7121\u52B9\u306A\u5165\u529B`;
    }
  };
};
function ja_default() {
  return {
    localeError: error22()
  };
}

// node_modules/zod/v4/locales/ka.js
var error23 = () => {
  const Sizable = {
    string: { unit: "\u10E1\u10D8\u10DB\u10D1\u10DD\u10DA\u10DD", verb: "\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1" },
    file: { unit: "\u10D1\u10D0\u10D8\u10E2\u10D8", verb: "\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1" },
    array: { unit: "\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8", verb: "\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1" },
    set: { unit: "\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8", verb: "\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1" }
  };
  function getSizing(origin) {
    return Sizable[origin] ?? null;
  }
  const FormatDictionary = {
    regex: "\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0",
    email: "\u10D4\u10DA-\u10E4\u10DD\u10E1\u10E2\u10D8\u10E1 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",
    url: "URL",
    emoji: "\u10D4\u10DB\u10DD\u10EF\u10D8",
    uuid: "UUID",
    uuidv4: "UUIDv4",
    uuidv6: "UUIDv6",
    nanoid: "nanoid",
    guid: "GUID",
    cuid: "cuid",
    cuid2: "cuid2",
    ulid: "ULID",
    xid: "XID",
    ksuid: "KSUID",
    datetime: "\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8-\u10D3\u10E0\u10DD",
    date: "\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8",
    time: "\u10D3\u10E0\u10DD",
    duration: "\u10EE\u10D0\u10DC\u10D2\u10E0\u10EB\u10DA\u10D8\u10D5\u10DD\u10D1\u10D0",
    ipv4: "IPv4 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",
    ipv6: "IPv6 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",
    cidrv4: "IPv4 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",
    cidrv6: "IPv6 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",
    base64: "base64-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",
    base64url: "base64url-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",
    json_string: "JSON \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",
    e164: "E.164 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",
    jwt: "JWT",
    template_literal: "\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"
  };
  const TypeDictionary = {
    nan: "NaN",
    number: "\u10E0\u10D8\u10EA\u10EE\u10D5\u10D8",
    string: "\u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",
    boolean: "\u10D1\u10E3\u10DA\u10D4\u10D0\u10DC\u10D8",
    function: "\u10E4\u10E3\u10DC\u10E5\u10EA\u10D8\u10D0",
    array: "\u10DB\u10D0\u10E1\u10D8\u10D5\u10D8"
  };
  return (issue2) => {
    switch (issue2.code) {
      case "invalid_type": {
        const expected = TypeDictionary[issue2.expected] ?? issue2.expected;
        const receivedType = parsedType(issue2.input);
        const received = TypeDictionary[receivedType] ?? receivedType;
        if (/^[A-Z]/.test(issue2.expected)) {
          return `\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 instanceof ${issue2.expected}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${received}`;
        }
        return `\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${expected}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${received}`;
      }
      case "invalid_value":
        if (issue2.values.length === 1)
          return `\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${stringifyPrimitive(issue2.values[0])}`;
        return `\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D0\u10E0\u10D8\u10D0\u10DC\u10E2\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8\u10D0 \u10D4\u10E0\u10D7-\u10D4\u10E0\u10D7\u10D8 ${joinValues(issue2.values, "|")}-\u10D3\u10D0\u10DC`;
      case "too_big": {
        const adj = issue2.inclusive ? "<=" : "<";
        const sizing = getSizing(issue2.origin);
        if (sizing)
          return `\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${issue2.origin ?? "\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} ${sizing.verb} ${adj}${issue2.maximum.toString()} ${sizing.unit}`;
        return `\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${issue2.origin ?? "\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} \u10D8\u10E7\u10DD\u10E1 ${adj}${issue2.maximum.toString()}`;
      }
      case "too_small": {
        const adj = issue2.inclusive ? ">=" : ">";
        const sizing = getSizing(issue2.origin);
        if (sizing) {
          return `\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${issue2.origin} ${sizing.verb} ${adj}${issue2.minimum.toString()} ${sizing.unit}`;
        }
        return `\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${issue2.origin} \u10D8\u10E7\u10DD\u10E1 ${adj}${issue2.minimum.toString()}`;
      }
      case "invalid_format": {
        const _issue = issue2;
        if (_issue.format === "starts_with") {
          return `\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10EC\u10E7\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${_issue.prefix}"-\u10D8\u10D7`;
        }
        if (_issue.format === "ends_with")
          return `\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10DB\u10D7\u10D0\u10D5\u10E0\u10D3\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${_issue.suffix}"-\u10D8\u10D7`;
        if (_issue.format === "includes")
          return `\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1 "${_issue.includes}"-\u10E1`;
        if (_issue.format === "regex")
          return `\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D4\u10E1\u10D0\u10D1\u10D0\u10DB\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 \u10E8\u10D0\u10D1\u10DA\u10DD\u10DC\u10E1 ${_issue.pattern}`;
        return `\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 ${FormatDictionary[_issue.format] ?? issue2.format}`;
      }
      case "not_multiple_of":
        return `\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E0\u10D8\u10EA\u10EE\u10D5\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10E7\u10DD\u10E1 ${issue2.divisor}-\u10D8\u10E1 \u10EF\u10D4\u10E0\u10D0\u10D3\u10D8`;
      case "unrecognized_keys":
        return `\u10E3\u10EA\u10DC\u10DD\u10D1\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1${issue2.keys.length > 1 ? "\u10D4\u10D1\u10D8" : "\u10D8"}: ${joinValues(issue2.keys, ", ")}`;
      case "invalid_key":
        return `\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1\u10D8 ${issue2.origin}-\u10E8\u10D8`;
      case "invalid_union":
        return "\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0";
      case "invalid_element":
        return `\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0 ${issue2.origin}-\u10E8\u10D8`;
      default:
        return `\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0`;
    }
  };
};
function ka_default() {
  return {
    localeError: error23()
  };
}

// node_modules/zod/v4/locales/km.js
var error24 = () => {
  const Sizable = {
    string: { unit: "\u178F\u17BD\u17A2\u1780\u17D2\u179F\u179A", verb: "\u1782\u17BD\u179A\u1798\u17B6\u1793" },
    file: { unit: "\u1794\u17C3", verb: "\u1782\u17BD\u179A\u1798\u17B6\u1793" },
    array: { unit: "\u1792\u17B6\u178F\u17BB", verb: "\u1782\u17BD\u179A\u1798\u17B6\u1793" },
    set: { unit: "\u1792\u17B6\u178F\u17BB", verb: "\u1782\u17BD\u179A\u1798\u17B6\u1793" }
  };
  function getSizing(origin) {
    return Sizable[origin] ?? null;
  }
  const FormatDictionary = {
    regex: "\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B",
    email: "\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793\u17A2\u17CA\u17B8\u1798\u17C2\u179B",
    url: "URL",
    emoji: "\u179F\u1789\u17D2\u1789\u17B6\u17A2\u17B6\u179A\u1798\u17D2\u1798\u178E\u17CD",
    uuid: "UUID",
    uuidv4: "UUIDv4",
    uuidv6: "UUIDv6",
    nanoid: "nanoid",
    guid: "GUID",
    cuid: "cuid",
    cuid2: "cuid2",
    ulid: "ULID",
    xid: "XID",
    ksuid: "KSUID",
    datetime: "\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 \u1793\u17B7\u1784\u1798\u17C9\u17C4\u1784 ISO",
    date: "\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 ISO",
    time: "\u1798\u17C9\u17C4\u1784 ISO",
    duration: "\u179A\u1799\u17C8\u1796\u17C1\u179B ISO",
    ipv4: "\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",
    ipv6: "\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",
    cidrv4: "\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",
    cidrv6: "\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",
    base64: "\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64",
    base64url: "\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64url",
    json_string: "\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A JSON",
    e164: "\u179B\u17C1\u1781 E.164",
    jwt: "JWT",
    template_literal: "\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B"
  };
  const TypeDictionary = {
    nan: "NaN",
    number: "\u179B\u17C1\u1781",
    array: "\u17A2\u17B6\u179A\u17C1 (Array)",
    null: "\u1782\u17D2\u1798\u17B6\u1793\u178F\u1798\u17D2\u179B\u17C3 (null)"
  };
  return (issue2) => {
    switch (issue2.code) {
      case "invalid_type": {
        const expected = TypeDictionary[issue2.expected] ?? issue2.expected;
        const receivedType = parsedType(issue2.input);
        const received = TypeDictionary[receivedType] ?? receivedType;
        if (/^[A-Z]/.test(issue2.expected)) {
          return `\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A instanceof ${issue2.expected} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${received}`;
        }
        return `\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${expected} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${received}`;
      }
      case "invalid_value":
        if (issue2.values.length === 1)
          return `\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${stringifyPrimitive(issue2.values[0])}`;
        return `\u1787\u1798\u17D2\u179A\u17BE\u179F\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1787\u17B6\u1798\u17BD\u1799\u1780\u17D2\u1793\u17BB\u1784\u1785\u17C6\u178E\u17C4\u1798 ${joinValues(issue2.values, "|")}`;
      case "too_big": {
        const adj = issue2.inclusive ? "<=" : "<";
        const sizing = getSizing(issue2.origin);
        if (sizing)
          return `\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${issue2.origin ?? "\u178F\u1798\u17D2\u179B\u17C3"} ${adj} ${issue2.maximum.toString()} ${sizing.unit ?? "\u1792\u17B6\u178F\u17BB"}`;
        return `\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${issue2.origin ?? "\u178F\u1798\u17D2\u179B\u17C3"} ${adj} ${issue2.maximum.toString()}`;
      }
      case "too_small": {
        const adj = issue2.inclusive ? ">=" : ">";
        const sizing = getSizing(issue2.origin);
        if (sizing) {
          return `\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${issue2.origin} ${adj} ${issue2.minimum.toString()} ${sizing.unit}`;
        }
        return `\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${issue2.origin} ${adj} ${issue2.minimum.toString()}`;
      }
      case "invalid_format": {
        const _issue = issue2;
        if (_issue.format === "starts_with") {
          return `\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1785\u17B6\u1794\u17CB\u1795\u17D2\u178F\u17BE\u1798\u178A\u17C4\u1799 "${_issue.prefix}"`;
        }
        if (_issue.format === "ends_with")
          return `\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1794\u1789\u17D2\u1785\u1794\u17CB\u178A\u17C4\u1799 "${_issue.suffix}"`;
        if (_issue.format === "includes")
          return `\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1798\u17B6\u1793 "${_issue.includes}"`;
        if (_issue.format === "regex")
          return `\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1795\u17D2\u1782\u17BC\u1795\u17D2\u1782\u1784\u1793\u17B9\u1784\u1791\u1798\u17D2\u179A\u1784\u17CB\u178A\u17C2\u179B\u1794\u17B6\u1793\u1780\u17C6\u178E\u178F\u17CB ${_issue.pattern}`;
        return `\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 ${FormatDictionary[_issue.format] ?? issue2.format}`;
      }
      case "not_multiple_of":
        return `\u179B\u17C1\u1781\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1787\u17B6\u1796\u17A0\u17BB\u1782\u17BB\u178E\u1793\u17C3 ${issue2.divisor}`;
      case "unrecognized_keys":
        return `\u179A\u1780\u1783\u17BE\u1789\u179F\u17C4\u1798\u17B7\u1793\u179F\u17D2\u1782\u17B6\u179B\u17CB\u17D6 ${joinValues(issue2.keys, ", ")}`;
      case "invalid_key":
        return `\u179F\u17C4\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${issue2.origin}`;
      case "invalid_union":
        return `\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C`;
      case "invalid_element":
        return `\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${issue2.origin}`;
      default:
        return `\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C`;
    }
  };
};
function km_default() {
  return {
    localeError: error24()
  };
}

// node_modules/zod/v4/locales/kh.js
function kh_default() {
  return km_default();
}

// node_modules/zod/v4/locales/ko.js
var error25 = () => {
  const Sizable = {
    string: { unit: "\uBB38\uC790", verb: "to have" },
    file: { unit: "\uBC14\uC774\uD2B8", verb: "to have" },
    array: { unit: "\uAC1C", verb: "to have" },
    set: { unit: "\uAC1C", verb: "to have" }
  };
  function getSizing(origin) {
    return Sizable[origin] ?? null;
  }
  const FormatDictionary = {
    regex: "\uC785\uB825",
    email: "\uC774\uBA54\uC77C \uC8FC\uC18C",
    url: "URL",
    emoji: "\uC774\uBAA8\uC9C0",
    uuid: "UUID",
    uuidv4: "UUIDv4",
    uuidv6: "UUIDv6",
    nanoid: "nanoid",
    guid: "GUID",
    cuid: "cuid",
    cuid2: "cuid2",
    ulid: "ULID",
    xid: "XID",
    ksuid: "KSUID",
    datetime: "ISO \uB0A0\uC9DC\uC2DC\uAC04",
    date: "ISO \uB0A0\uC9DC",
    time: "ISO \uC2DC\uAC04",
    duration: "ISO \uAE30\uAC04",
    ipv4: "IPv4 \uC8FC\uC18C",
    ipv6: "IPv6 \uC8FC\uC18C",
    cidrv4: "IPv4 \uBC94\uC704",
    cidrv6: "IPv6 \uBC94\uC704",
    base64: "base64 \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",
    base64url: "base64url \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",
    json_string: "JSON \uBB38\uC790\uC5F4",
    e164: "E.164 \uBC88\uD638",
    jwt: "JWT",
    template_literal: "\uC785\uB825"
  };
  const TypeDictionary = {
    nan: "NaN"
  };
  return (issue2) => {
    switch (issue2.code) {
      case "invalid_type": {
        const expected = TypeDictionary[issue2.expected] ?? issue2.expected;
        const receivedType = parsedType(issue2.input);
        const received = TypeDictionary[receivedType] ?? receivedType;
        if (/^[A-Z]/.test(issue2.expected)) {
          return `\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 instanceof ${issue2.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${received}\uC785\uB2C8\uB2E4`;
        }
        return `\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${received}\uC785\uB2C8\uB2E4`;
      }
      case "invalid_value":
        if (issue2.values.length === 1)
          return `\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${stringifyPrimitive(issue2.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`;
        return `\uC798\uBABB\uB41C \uC635\uC158: ${joinValues(issue2.values, "\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;
      case "too_big": {
        const adj = issue2.inclusive ? "\uC774\uD558" : "\uBBF8\uB9CC";
        const suffix = adj === "\uBBF8\uB9CC" ? "\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4" : "\uC5EC\uC57C \uD569\uB2C8\uB2E4";
        const sizing = getSizing(issue2.origin);
        const unit = sizing?.unit ?? "\uC694\uC18C";
        if (sizing)
          return `${issue2.origin ?? "\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${issue2.maximum.toString()}${unit} ${adj}${suffix}`;
        return `${issue2.origin ?? "\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${issue2.maximum.toString()} ${adj}${suffix}`;
      }
      case "too_small": {
        const adj = issue2.inclusive ? "\uC774\uC0C1" : "\uCD08\uACFC";
        const suffix = adj === "\uC774\uC0C1" ? "\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4" : "\uC5EC\uC57C \uD569\uB2C8\uB2E4";
        const sizing = getSizing(issue2.origin);
        const unit = sizing?.unit ?? "\uC694\uC18C";
        if (sizing) {
          return `${issue2.origin ?? "\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${issue2.minimum.toString()}${unit} ${adj}${suffix}`;
        }
        return `${issue2.origin ?? "\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${issue2.minimum.toString()} ${adj}${suffix}`;
      }
      case "invalid_format": {
        const _issue = issue2;
        if (_issue.format === "starts_with") {
          return `\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${_issue.prefix}"(\uC73C)\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4`;
        }
        if (_issue.format === "ends_with")
          return `\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${_issue.suffix}"(\uC73C)\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4`;
        if (_issue.format === "includes")
          return `\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${_issue.includes}"\uC744(\uB97C) \uD3EC\uD568\uD574\uC57C \uD569\uB2C8\uB2E4`;
        if (_issue.format === "regex")
          return `\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: \uC815\uADDC\uC2DD ${_issue.pattern} \uD328\uD134\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4`;
        return `\uC798\uBABB\uB41C ${FormatDictionary[_issue.format] ?? issue2.format}`;
      }
      case "not_multiple_of":
        return `\uC798\uBABB\uB41C \uC22B\uC790: ${issue2.divisor}\uC758 \uBC30\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4`;
      case "unrecognized_keys":
        return `\uC778\uC2DD\uD560 \uC218 \uC5C6\uB294 \uD0A4: ${joinValues(issue2.keys, ", ")}`;
      case "invalid_key":
        return `\uC798\uBABB\uB41C \uD0A4: ${issue2.origin}`;
      case "invalid_union":
        return `\uC798\uBABB\uB41C \uC785\uB825`;
      case "invalid_element":
        return `\uC798\uBABB\uB41C \uAC12: ${issue2.origin}`;
      default:
        return `\uC798\uBABB\uB41C \uC785\uB825`;
    }
  };
};
function ko_default() {
  return {
    localeError: error25()
  };
}

// node_modules/zod/v4/locales/lt.js
var capitalizeFirstCharacter = (text) => {
  return text.charAt(0).toUpperCase() + text.slice(1);
};
function getUnitTypeFromNumber(number4) {
  const abs = Math.abs(number4);
  const last = abs % 10;
  const last2 = abs % 100;
  if (last2 >= 11 && last2 <= 19 || last === 0)
    return "many";
  if (last === 1)
    return "one";
  return "few";
}
var error26 = () => {
  const Sizable = {
    string: {
      unit: {
        one: "simbolis",
        few: "simboliai",
        many: "simboli\u0173"
      },
      verb: {
        smaller: {
          inclusive: "turi b\u016Bti ne ilgesn\u0117 kaip",
          notInclusive: "turi b\u016Bti trumpesn\u0117 kaip"
        },
        bigger: {
          inclusive: "turi b\u016Bti ne trumpesn\u0117 kaip",
          notInclusive: "turi b\u016Bti ilgesn\u0117 kaip"
        }
      }
    },
    file: {
      unit: {
        one: "baitas",
        few: "baitai",
        many: "bait\u0173"
      },
      verb: {
        smaller: {
          inclusive: "turi b\u016Bti ne didesnis kaip",
          notInclusive: "turi b\u016Bti ma\u017Eesnis kaip"
        },
        bigger: {
          inclusive: "turi b\u016Bti ne ma\u017Eesnis kaip",
          notInclusive: "turi b\u016Bti didesnis kaip"
        }
      }
    },
    array: {
      unit: {
        one: "element\u0105",
        few: "elementus",
        many: "element\u0173"
      },
      verb: {
        smaller: {
          inclusive: "turi tur\u0117ti ne daugiau kaip",
          notInclusive: "turi tur\u0117ti ma\u017Eiau kaip"
        },
        bigger: {
          inclusive: "turi tur\u0117ti ne ma\u017Eiau kaip",
          notInclusive: "turi tur\u0117ti daugiau kaip"
        }
      }
    },
    set: {
      unit: {
        one: "element\u0105",
        few: "elementus",
        many: "element\u0173"
      },
      verb: {
        smaller: {
          inclusive: "turi tur\u0117ti ne daugiau kaip",
          notInclusive: "turi tur\u0117ti ma\u017Eiau kaip"
        },
        bigger: {
          inclusive: "turi tur\u0117ti ne ma\u017Eiau kaip",
          notInclusive: "turi tur\u0117ti daugiau kaip"
        }
      }
    }
  };
  function getSizing(origin, unitType, inclusive, targetShouldBe) {
    const result = Sizable[origin] ?? null;
    if (result === null)
      return result;
    return {
      unit: result.unit[unitType],
      verb: result.verb[targetShouldBe][inclusive ? "inclusive" : "notInclusive"]
    };
  }
  const FormatDictionary = {
    regex: "\u012Fvestis",
    email: "el. pa\u0161to adresas",
    url: "URL",
    emoji: "jaustukas",
    uuid: "UUID",
    uuidv4: "UUIDv4",
    uuidv6: "UUIDv6",
    nanoid: "nanoid",
    guid: "GUID",
    cuid: "cuid",
    cuid2: "cuid2",
    ulid: "ULID",
    xid: "XID",
    ksuid: "KSUID",
    datetime: "ISO data ir laikas",
    date: "ISO data",
    time: "ISO laikas",
    duration: "ISO trukm\u0117",
    ipv4: "IPv4 adresas",
    ipv6: "IPv6 adresas",
    cidrv4: "IPv4 tinklo prefiksas (CIDR)",
    cidrv6: "IPv6 tinklo prefiksas (CIDR)",
    base64: "base64 u\u017Ekoduota eilut\u0117",
    base64url: "base64url u\u017Ekoduota eilut\u0117",
    json_string: "JSON eilut\u0117",
    e164: "E.164 numeris",
    jwt: "JWT",
    template_literal: "\u012Fvestis"
  };
  const TypeDictionary = {
    nan: "NaN",
    number: "skai\u010Dius",
    bigint: "sveikasis skai\u010Dius",
    string: "eilut\u0117",
    boolean: "login\u0117 reik\u0161m\u0117",
    undefined: "neapibr\u0117\u017Eta reik\u0161m\u0117",
    function: "funkcija",
    symbol: "simbolis",
    array: "masyvas",
    object: "objektas",
    null: "nulin\u0117 reik\u0161m\u0117"
  };
  return (issue2) => {
    switch (issue2.code) {
      case "invalid_type": {
        const expected = TypeDictionary[issue2.expected] ?? issue2.expected;
        const receivedType = parsedType(issue2.input);
        const received = TypeDictionary[receivedType] ?? receivedType;
        if (/^[A-Z]/.test(issue2.expected)) {
          return `Gautas tipas ${received}, o tik\u0117tasi - instanceof ${issue2.expected}`;
        }
        return `Gautas tipas ${received}, o tik\u0117tasi - ${expected}`;
      }
      case "invalid_value":
        if (issue2.values.length === 1)
          return `Privalo b\u016Bti ${stringifyPrimitive(issue2.values[0])}`;
        return `Privalo b\u016Bti vienas i\u0161 ${joinValues(issue2.values, "|")} pasirinkim\u0173`;
      case "too_big": {
        const origin = TypeDictionary[issue2.origin] ?? issue2.origin;
        const sizing = getSizing(issue2.origin, getUnitTypeFromNumber(Number(issue2.maximum)), issue2.inclusive ?? false, "smaller");
        if (sizing?.verb)
          return `${capitalizeFirstCharacter(origin ?? issue2.origin ?? "reik\u0161m\u0117")} ${sizing.verb} ${issue2.maximum.toString()} ${sizing.unit ?? "element\u0173"}`;
        const adj = issue2.inclusive ? "ne didesnis kaip" : "ma\u017Eesnis kaip";
        return `${capitalizeFirstCharacter(origin ?? issue2.origin ?? "reik\u0161m\u0117")} turi b\u016Bti ${adj} ${issue2.maximum.toString()} ${sizing?.unit}`;
      }
      case "too_small": {
        const origin = TypeDictionary[issue2.origin] ?? issue2.origin;
        const sizing = getSizing(issue2.origin, getUnitTypeFromNumber(Number(issue2.minimum)), issue2.inclusive ?? false, "bigger");
        if (sizing?.verb)
          return `${capitalizeFirstCharacter(origin ?? issue2.origin ?? "reik\u0161m\u0117")} ${sizing.verb} ${issue2.minimum.toString()} ${sizing.unit ?? "element\u0173"}`;
        const adj = issue2.inclusive ? "ne ma\u017Eesnis kaip" : "didesnis kaip";
        return `${capitalizeFirstCharacter(origin ?? issue2.origin ?? "reik\u0161m\u0117")} turi b\u016Bti ${adj} ${issue2.minimum.toString()} ${sizing?.unit}`;
      }
      case "invalid_format": {
        const _issue = issue2;
        if (_issue.format === "starts_with") {
          return `Eilut\u0117 privalo prasid\u0117ti "${_issue.prefix}"`;
        }
        if (_issue.format === "ends_with")
          return `Eilut\u0117 privalo pasibaigti "${_issue.suffix}"`;
        if (_issue.format === "includes")
          return `Eilut\u0117 privalo \u012Ftraukti "${_issue.includes}"`;
        if (_issue.format === "regex")
          return `Eilut\u0117 privalo atitikti ${_issue.pattern}`;
        return `Neteisingas ${FormatDictionary[_issue.format] ?? issue2.format}`;
      }
      case "not_multiple_of":
        return `Skai\u010Dius privalo b\u016Bti ${issue2.divisor} kartotinis.`;
      case "unrecognized_keys":
        return `Neatpa\u017Eint${issue2.keys.length > 1 ? "i" : "as"} rakt${issue2.keys.length > 1 ? "ai" : "as"}: ${joinValues(issue2.keys, ", ")}`;
      case "invalid_key":
        return "Rastas klaidingas raktas";
      case "invalid_union":
        return "Klaidinga \u012Fvestis";
      case "invalid_element": {
        const origin = TypeDictionary[issue2.origin] ?? issue2.origin;
        return `${capitalizeFirstCharacter(origin ?? issue2.origin ?? "reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`;
      }
      default:
        return "Klaidinga \u012Fvestis";
    }
  };
};
function lt_default() {
  return {
    localeError: error26()
  };
}

// node_modules/zod/v4/locales/mk.js
var error27 = () => {
  const Sizable = {
    string: { unit: "\u0437\u043D\u0430\u0446\u0438", verb: "\u0434\u0430 \u0438\u043C\u0430\u0430\u0442" },
    file: { unit: "\u0431\u0430\u0458\u0442\u0438", verb: "\u0434\u0430 \u0438\u043C\u0430\u0430\u0442" },
    array: { unit: "\u0441\u0442\u0430\u0432\u043A\u0438", verb: "\u0434\u0430 \u0438\u043C\u0430\u0430\u0442" },
    set: { unit: "\u0441\u0442\u0430\u0432\u043A\u0438", verb: "\u0434\u0430 \u0438\u043C\u0430\u0430\u0442" }
  };
  function getSizing(origin) {
    return Sizable[origin] ?? null;
  }
  const FormatDictionary = {
    regex: "\u0432\u043D\u0435\u0441",
    email: "\u0430\u0434\u0440\u0435\u0441\u0430 \u043D\u0430 \u0435-\u043F\u043E\u0448\u0442\u0430",
    url: "URL",
    emoji: "\u0435\u043C\u043E\u045F\u0438",
    uuid: "UUID",
    uuidv4: "UUIDv4",
    uuidv6: "UUIDv6",
    nanoid: "nanoid",
    guid: "GUID",
    cuid: "cuid",
    cuid2: "cuid2",
    ulid: "ULID",
    xid: "XID",
    ksuid: "KSUID",
    datetime: "ISO \u0434\u0430\u0442\u0443\u043C \u0438 \u0432\u0440\u0435\u043C\u0435",
    date: "ISO \u0434\u0430\u0442\u0443\u043C",
    time: "ISO \u0432\u0440\u0435\u043C\u0435",
    duration: "ISO \u0432\u0440\u0435\u043C\u0435\u0442\u0440\u0430\u0435\u045A\u0435",
    ipv4: "IPv4 \u0430\u0434\u0440\u0435\u0441\u0430",
    ipv6: "IPv6 \u0430\u0434\u0440\u0435\u0441\u0430",
    cidrv4: "IPv4 \u043E\u043F\u0441\u0435\u0433",
    cidrv6: "IPv6 \u043E\u043F\u0441\u0435\u0433",
    base64: "base64-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",
    base64url: "base64url-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",
    json_string: "JSON \u043D\u0438\u0437\u0430",
    e164: "E.164 \u0431\u0440\u043E\u0458",
    jwt: "JWT",
    template_literal: "\u0432\u043D\u0435\u0441"
  };
  const TypeDictionary = {
    nan: "NaN",
    number: "\u0431\u0440\u043E\u0458",
    array: "\u043D\u0438\u0437\u0430"
  };
  return (issue2) => {
    switch (issue2.code) {
      case "invalid_type": {
        const expected = TypeDictionary[issue2.expected] ?? issue2.expected;
        const receivedType = parsedType(issue2.input);
        const received = TypeDictionary[receivedType] ?? receivedType;
        if (/^[A-Z]/.test(issue2.expected)) {
          return `\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 instanceof ${issue2.expected}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${received}`;
        }
        return `\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${expected}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${received}`;
      }
      case "invalid_value":
        if (issue2.values.length === 1)
          return `Invalid input: expected ${stringifyPrimitive(issue2.values[0])}`;
        return `\u0413\u0440\u0435\u0448\u0430\u043D\u0430 \u043E\u043F\u0446\u0438\u0458\u0430: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 \u0435\u0434\u043D\u0430 ${joinValues(issue2.values, "|")}`;
      case "too_big": {
        const adj = issue2.inclusive ? "<=" : "<";
        const sizing = getSizing(issue2.origin);
        if (sizing)
          return `\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${issue2.origin ?? "\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0438\u043C\u0430 ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438"}`;
        return `\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${issue2.origin ?? "\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0431\u0438\u0434\u0435 ${adj}${issue2.maximum.toString()}`;
      }
      case "too_small": {
        const adj = issue2.inclusive ? ">=" : ">";
        const sizing = getSizing(issue2.origin);
        if (sizing) {
          return `\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${issue2.origin} \u0434\u0430 \u0438\u043C\u0430 ${adj}${issue2.minimum.toString()} ${sizing.unit}`;
        }
        return `\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${issue2.origin} \u0434\u0430 \u0431\u0438\u0434\u0435 ${adj}${issue2.minimum.toString()}`;
      }
      case "invalid_format": {
        const _issue = issue2;
        if (_issue.format === "starts_with") {
          return `\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u043D\u0443\u0432\u0430 \u0441\u043E "${_issue.prefix}"`;
        }
        if (_issue.format === "ends_with")
          return `\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u0432\u0440\u0448\u0443\u0432\u0430 \u0441\u043E "${_issue.suffix}"`;
        if (_issue.format === "includes")
          return `\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0432\u043A\u043B\u0443\u0447\u0443\u0432\u0430 "${_issue.includes}"`;
        if (_issue.format === "regex")
          return `\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u043E\u0434\u0433\u043E\u0430\u0440\u0430 \u043D\u0430 \u043F\u0430\u0442\u0435\u0440\u043D\u043E\u0442 ${_issue.pattern}`;
        return `Invalid ${FormatDictionary[_issue.format] ?? issue2.format}`;
      }
      case "not_multiple_of":
        return `\u0413\u0440\u0435\u0448\u0435\u043D \u0431\u0440\u043E\u0458: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0431\u0438\u0434\u0435 \u0434\u0435\u043B\u0438\u0432 \u0441\u043E ${issue2.divisor}`;
      case "unrecognized_keys":
        return `${issue2.keys.length > 1 ? "\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D\u0438 \u043A\u043B\u0443\u0447\u0435\u0432\u0438" : "\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D \u043A\u043B\u0443\u0447"}: ${joinValues(issue2.keys, ", ")}`;
      case "invalid_key":
        return `\u0413\u0440\u0435\u0448\u0435\u043D \u043A\u043B\u0443\u0447 \u0432\u043E ${issue2.origin}`;
      case "invalid_union":
        return "\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441";
      case "invalid_element":
        return `\u0413\u0440\u0435\u0448\u043D\u0430 \u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442 \u0432\u043E ${issue2.origin}`;
      default:
        return `\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441`;
    }
  };
};
function mk_default() {
  return {
    localeError: error27()
  };
}

// node_modules/zod/v4/locales/ms.js
var error28 = () => {
  const Sizable = {
    string: { unit: "aksara", verb: "mempunyai" },
    file: { unit: "bait", verb: "mempunyai" },
    array: { unit: "elemen", verb: "mempunyai" },
    set: { unit: "elemen", verb: "mempunyai" }
  };
  function getSizing(origin) {
    return Sizable[origin] ?? null;
  }
  const FormatDictionary = {
    regex: "input",
    email: "alamat e-mel",
    url: "URL",
    emoji: "emoji",
    uuid: "UUID",
    uuidv4: "UUIDv4",
    uuidv6: "UUIDv6",
    nanoid: "nanoid",
    guid: "GUID",
    cuid: "cuid",
    cuid2: "cuid2",
    ulid: "ULID",
    xid: "XID",
    ksuid: "KSUID",
    datetime: "tarikh masa ISO",
    date: "tarikh ISO",
    time: "masa ISO",
    duration: "tempoh ISO",
    ipv4: "alamat IPv4",
    ipv6: "alamat IPv6",
    cidrv4: "julat IPv4",
    cidrv6: "julat IPv6",
    base64: "string dikodkan base64",
    base64url: "string dikodkan base64url",
    json_string: "string JSON",
    e164: "nombor E.164",
    jwt: "JWT",
    template_literal: "input"
  };
  const TypeDictionary = {
    nan: "NaN",
    number: "nombor"
  };
  return (issue2) => {
    switch (issue2.code) {
      case "invalid_type": {
        const expected = TypeDictionary[issue2.expected] ?? issue2.expected;
        const receivedType = parsedType(issue2.input);
        const received = TypeDictionary[receivedType] ?? receivedType;
        if (/^[A-Z]/.test(issue2.expected)) {
          return `Input tidak sah: dijangka instanceof ${issue2.expected}, diterima ${received}`;
        }
        return `Input tidak sah: dijangka ${expected}, diterima ${received}`;
      }
      case "invalid_value":
        if (issue2.values.length === 1)
          return `Input tidak sah: dijangka ${stringifyPrimitive(issue2.values[0])}`;
        return `Pilihan tidak sah: dijangka salah satu daripada ${joinValues(issue2.values, "|")}`;
      case "too_big": {
        const adj = issue2.inclusive ? "<=" : "<";
        const sizing = getSizing(issue2.origin);
        if (sizing)
          return `Terlalu besar: dijangka ${issue2.origin ?? "nilai"} ${sizing.verb} ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "elemen"}`;
        return `Terlalu besar: dijangka ${issue2.origin ?? "nilai"} adalah ${adj}${issue2.maximum.toString()}`;
      }
      case "too_small": {
        const adj = issue2.inclusive ? ">=" : ">";
        const sizing = getSizing(issue2.origin);
        if (sizing) {
          return `Terlalu kecil: dijangka ${issue2.origin} ${sizing.verb} ${adj}${issue2.minimum.toString()} ${sizing.unit}`;
        }
        return `Terlalu kecil: dijangka ${issue2.origin} adalah ${adj}${issue2.minimum.toString()}`;
      }
      case "invalid_format": {
        const _issue = issue2;
        if (_issue.format === "starts_with")
          return `String tidak sah: mesti bermula dengan "${_issue.prefix}"`;
        if (_issue.format === "ends_with")
          return `String tidak sah: mesti berakhir dengan "${_issue.suffix}"`;
        if (_issue.format === "includes")
          return `String tidak sah: mesti mengandungi "${_issue.includes}"`;
        if (_issue.format === "regex")
          return `String tidak sah: mesti sepadan dengan corak ${_issue.pattern}`;
        return `${FormatDictionary[_issue.format] ?? issue2.format} tidak sah`;
      }
      case "not_multiple_of":
        return `Nombor tidak sah: perlu gandaan ${issue2.divisor}`;
      case "unrecognized_keys":
        return `Kunci tidak dikenali: ${joinValues(issue2.keys, ", ")}`;
      case "invalid_key":
        return `Kunci tidak sah dalam ${issue2.origin}`;
      case "invalid_union":
        return "Input tidak sah";
      case "invalid_element":
        return `Nilai tidak sah dalam ${issue2.origin}`;
      default:
        return `Input tidak sah`;
    }
  };
};
function ms_default() {
  return {
    localeError: error28()
  };
}

// node_modules/zod/v4/locales/nl.js
var error29 = () => {
  const Sizable = {
    string: { unit: "tekens", verb: "heeft" },
    file: { unit: "bytes", verb: "heeft" },
    array: { unit: "elementen", verb: "heeft" },
    set: { unit: "elementen", verb: "heeft" }
  };
  function getSizing(origin) {
    return Sizable[origin] ?? null;
  }
  const FormatDictionary = {
    regex: "invoer",
    email: "emailadres",
    url: "URL",
    emoji: "emoji",
    uuid: "UUID",
    uuidv4: "UUIDv4",
    uuidv6: "UUIDv6",
    nanoid: "nanoid",
    guid: "GUID",
    cuid: "cuid",
    cuid2: "cuid2",
    ulid: "ULID",
    xid: "XID",
    ksuid: "KSUID",
    datetime: "ISO datum en tijd",
    date: "ISO datum",
    time: "ISO tijd",
    duration: "ISO duur",
    ipv4: "IPv4-adres",
    ipv6: "IPv6-adres",
    cidrv4: "IPv4-bereik",
    cidrv6: "IPv6-bereik",
    base64: "base64-gecodeerde tekst",
    base64url: "base64 URL-gecodeerde tekst",
    json_string: "JSON string",
    e164: "E.164-nummer",
    jwt: "JWT",
    template_literal: "invoer"
  };
  const TypeDictionary = {
    nan: "NaN",
    number: "getal"
  };
  return (issue2) => {
    switch (issue2.code) {
      case "invalid_type": {
        const expected = TypeDictionary[issue2.expected] ?? issue2.expected;
        const receivedType = parsedType(issue2.input);
        const received = TypeDictionary[receivedType] ?? receivedType;
        if (/^[A-Z]/.test(issue2.expected)) {
          return `Ongeldige invoer: verwacht instanceof ${issue2.expected}, ontving ${received}`;
        }
        return `Ongeldige invoer: verwacht ${expected}, ontving ${received}`;
      }
      case "invalid_value":
        if (issue2.values.length === 1)
          return `Ongeldige invoer: verwacht ${stringifyPrimitive(issue2.values[0])}`;
        return `Ongeldige optie: verwacht \xE9\xE9n van ${joinValues(issue2.values, "|")}`;
      case "too_big": {
        const adj = issue2.inclusive ? "<=" : "<";
        const sizing = getSizing(issue2.origin);
        const longName = issue2.origin === "date" ? "laat" : issue2.origin === "string" ? "lang" : "groot";
        if (sizing)
          return `Te ${longName}: verwacht dat ${issue2.origin ?? "waarde"} ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "elementen"} ${sizing.verb}`;
        return `Te ${longName}: verwacht dat ${issue2.origin ?? "waarde"} ${adj}${issue2.maximum.toString()} is`;
      }
      case "too_small": {
        const adj = issue2.inclusive ? ">=" : ">";
        const sizing = getSizing(issue2.origin);
        const shortName = issue2.origin === "date" ? "vroeg" : issue2.origin === "string" ? "kort" : "klein";
        if (sizing) {
          return `Te ${shortName}: verwacht dat ${issue2.origin} ${adj}${issue2.minimum.toString()} ${sizing.unit} ${sizing.verb}`;
        }
        return `Te ${shortName}: verwacht dat ${issue2.origin} ${adj}${issue2.minimum.toString()} is`;
      }
      case "invalid_format": {
        const _issue = issue2;
        if (_issue.format === "starts_with") {
          return `Ongeldige tekst: moet met "${_issue.prefix}" beginnen`;
        }
        if (_issue.format === "ends_with")
          return `Ongeldige tekst: moet op "${_issue.suffix}" eindigen`;
        if (_issue.format === "includes")
          return `Ongeldige tekst: moet "${_issue.includes}" bevatten`;
        if (_issue.format === "regex")
          return `Ongeldige tekst: moet overeenkomen met patroon ${_issue.pattern}`;
        return `Ongeldig: ${FormatDictionary[_issue.format] ?? issue2.format}`;
      }
      case "not_multiple_of":
        return `Ongeldig getal: moet een veelvoud van ${issue2.divisor} zijn`;
      case "unrecognized_keys":
        return `Onbekende key${issue2.keys.length > 1 ? "s" : ""}: ${joinValues(issue2.keys, ", ")}`;
      case "invalid_key":
        return `Ongeldige key in ${issue2.origin}`;
      case "invalid_union":
        return "Ongeldige invoer";
      case "invalid_element":
        return `Ongeldige waarde in ${issue2.origin}`;
      default:
        return `Ongeldige invoer`;
    }
  };
};
function nl_default() {
  return {
    localeError: error29()
  };
}

// node_modules/zod/v4/locales/no.js
var error30 = () => {
  const Sizable = {
    string: { unit: "tegn", verb: "\xE5 ha" },
    file: { unit: "bytes", verb: "\xE5 ha" },
    array: { unit: "elementer", verb: "\xE5 inneholde" },
    set: { unit: "elementer", verb: "\xE5 inneholde" }
  };
  function getSizing(origin) {
    return Sizable[origin] ?? null;
  }
  const FormatDictionary = {
    regex: "input",
    email: "e-postadresse",
    url: "URL",
    emoji: "emoji",
    uuid: "UUID",
    uuidv4: "UUIDv4",
    uuidv6: "UUIDv6",
    nanoid: "nanoid",
    guid: "GUID",
    cuid: "cuid",
    cuid2: "cuid2",
    ulid: "ULID",
    xid: "XID",
    ksuid: "KSUID",
    datetime: "ISO dato- og klokkeslett",
    date: "ISO-dato",
    time: "ISO-klokkeslett",
    duration: "ISO-varighet",
    ipv4: "IPv4-omr\xE5de",
    ipv6: "IPv6-omr\xE5de",
    cidrv4: "IPv4-spekter",
    cidrv6: "IPv6-spekter",
    base64: "base64-enkodet streng",
    base64url: "base64url-enkodet streng",
    json_string: "JSON-streng",
    e164: "E.164-nummer",
    jwt: "JWT",
    template_literal: "input"
  };
  const TypeDictionary = {
    nan: "NaN",
    number: "tall",
    array: "liste"
  };
  return (issue2) => {
    switch (issue2.code) {
      case "invalid_type": {
        const expected = TypeDictionary[issue2.expected] ?? issue2.expected;
        const receivedType = parsedType(issue2.input);
        const received = TypeDictionary[receivedType] ?? receivedType;
        if (/^[A-Z]/.test(issue2.expected)) {
          return `Ugyldig input: forventet instanceof ${issue2.expected}, fikk ${received}`;
        }
        return `Ugyldig input: forventet ${expected}, fikk ${received}`;
      }
      case "invalid_value":
        if (issue2.values.length === 1)
          return `Ugyldig verdi: forventet ${stringifyPrimitive(issue2.values[0])}`;
        return `Ugyldig valg: forventet en av ${joinValues(issue2.values, "|")}`;
      case "too_big": {
        const adj = issue2.inclusive ? "<=" : "<";
        const sizing = getSizing(issue2.origin);
        if (sizing)
          return `For stor(t): forventet ${issue2.origin ?? "value"} til \xE5 ha ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "elementer"}`;
        return `For stor(t): forventet ${issue2.origin ?? "value"} til \xE5 ha ${adj}${issue2.maximum.toString()}`;
      }
      case "too_small": {
        const adj = issue2.inclusive ? ">=" : ">";
        const sizing = getSizing(issue2.origin);
        if (sizing) {
          return `For lite(n): forventet ${issue2.origin} til \xE5 ha ${adj}${issue2.minimum.toString()} ${sizing.unit}`;
        }
        return `For lite(n): forventet ${issue2.origin} til \xE5 ha ${adj}${issue2.minimum.toString()}`;
      }
      case "invalid_format": {
        const _issue = issue2;
        if (_issue.format === "starts_with")
          return `Ugyldig streng: m\xE5 starte med "${_issue.prefix}"`;
        if (_issue.format === "ends_with")
          return `Ugyldig streng: m\xE5 ende med "${_issue.suffix}"`;
        if (_issue.format === "includes")
          return `Ugyldig streng: m\xE5 inneholde "${_issue.includes}"`;
        if (_issue.format === "regex")
          return `Ugyldig streng: m\xE5 matche m\xF8nsteret ${_issue.pattern}`;
        return `Ugyldig ${FormatDictionary[_issue.format] ?? issue2.format}`;
      }
      case "not_multiple_of":
        return `Ugyldig tall: m\xE5 v\xE6re et multiplum av ${issue2.divisor}`;
      case "unrecognized_keys":
        return `${issue2.keys.length > 1 ? "Ukjente n\xF8kler" : "Ukjent n\xF8kkel"}: ${joinValues(issue2.keys, ", ")}`;
      case "invalid_key":
        return `Ugyldig n\xF8kkel i ${issue2.origin}`;
      case "invalid_union":
        return "Ugyldig input";
      case "invalid_element":
        return `Ugyldig verdi i ${issue2.origin}`;
      default:
        return `Ugyldig input`;
    }
  };
};
function no_default() {
  return {
    localeError: error30()
  };
}

// node_modules/zod/v4/locales/ota.js
var error31 = () => {
  const Sizable = {
    string: { unit: "harf", verb: "olmal\u0131d\u0131r" },
    file: { unit: "bayt", verb: "olmal\u0131d\u0131r" },
    array: { unit: "unsur", verb: "olmal\u0131d\u0131r" },
    set: { unit: "unsur", verb: "olmal\u0131d\u0131r" }
  };
  function getSizing(origin) {
    return Sizable[origin] ?? null;
  }
  const FormatDictionary = {
    regex: "giren",
    email: "epostag\xE2h",
    url: "URL",
    emoji: "emoji",
    uuid: "UUID",
    uuidv4: "UUIDv4",
    uuidv6: "UUIDv6",
    nanoid: "nanoid",
    guid: "GUID",
    cuid: "cuid",
    cuid2: "cuid2",
    ulid: "ULID",
    xid: "XID",
    ksuid: "KSUID",
    datetime: "ISO heng\xE2m\u0131",
    date: "ISO tarihi",
    time: "ISO zaman\u0131",
    duration: "ISO m\xFCddeti",
    ipv4: "IPv4 ni\u015F\xE2n\u0131",
    ipv6: "IPv6 ni\u015F\xE2n\u0131",
    cidrv4: "IPv4 menzili",
    cidrv6: "IPv6 menzili",
    base64: "base64-\u015Fifreli metin",
    base64url: "base64url-\u015Fifreli metin",
    json_string: "JSON metin",
    e164: "E.164 say\u0131s\u0131",
    jwt: "JWT",
    template_literal: "giren"
  };
  const TypeDictionary = {
    nan: "NaN",
    number: "numara",
    array: "saf",
    null: "gayb"
  };
  return (issue2) => {
    switch (issue2.code) {
      case "invalid_type": {
        const expected = TypeDictionary[issue2.expected] ?? issue2.expected;
        const receivedType = parsedType(issue2.input);
        const received = TypeDictionary[receivedType] ?? receivedType;
        if (/^[A-Z]/.test(issue2.expected)) {
          return `F\xE2sit giren: umulan instanceof ${issue2.expected}, al\u0131nan ${received}`;
        }
        return `F\xE2sit giren: umulan ${expected}, al\u0131nan ${received}`;
      }
      case "invalid_value":
        if (issue2.values.length === 1)
          return `F\xE2sit giren: umulan ${stringifyPrimitive(issue2.values[0])}`;
        return `F\xE2sit tercih: m\xFBteberler ${joinValues(issue2.values, "|")}`;
      case "too_big": {
        const adj = issue2.inclusive ? "<=" : "<";
        const sizing = getSizing(issue2.origin);
        if (sizing)
          return `Fazla b\xFCy\xFCk: ${issue2.origin ?? "value"}, ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "elements"} sahip olmal\u0131yd\u0131.`;
        return `Fazla b\xFCy\xFCk: ${issue2.origin ?? "value"}, ${adj}${issue2.maximum.toString()} olmal\u0131yd\u0131.`;
      }
      case "too_small": {
        const adj = issue2.inclusive ? ">=" : ">";
        const sizing = getSizing(issue2.origin);
        if (sizing) {
          return `Fazla k\xFC\xE7\xFCk: ${issue2.origin}, ${adj}${issue2.minimum.toString()} ${sizing.unit} sahip olmal\u0131yd\u0131.`;
        }
        return `Fazla k\xFC\xE7\xFCk: ${issue2.origin}, ${adj}${issue2.minimum.toString()} olmal\u0131yd\u0131.`;
      }
      case "invalid_format": {
        const _issue = issue2;
        if (_issue.format === "starts_with")
          return `F\xE2sit metin: "${_issue.prefix}" ile ba\u015Flamal\u0131.`;
        if (_issue.format === "ends_with")
          return `F\xE2sit metin: "${_issue.suffix}" ile bitmeli.`;
        if (_issue.format === "includes")
          return `F\xE2sit metin: "${_issue.includes}" ihtiv\xE2 etmeli.`;
        if (_issue.format === "regex")
          return `F\xE2sit metin: ${_issue.pattern} nak\u015F\u0131na uymal\u0131.`;
        return `F\xE2sit ${FormatDictionary[_issue.format] ?? issue2.format}`;
      }
      case "not_multiple_of":
        return `F\xE2sit say\u0131: ${issue2.divisor} kat\u0131 olmal\u0131yd\u0131.`;
      case "unrecognized_keys":
        return `Tan\u0131nmayan anahtar ${issue2.keys.length > 1 ? "s" : ""}: ${joinValues(issue2.keys, ", ")}`;
      case "invalid_key":
        return `${issue2.origin} i\xE7in tan\u0131nmayan anahtar var.`;
      case "invalid_union":
        return "Giren tan\u0131namad\u0131.";
      case "invalid_element":
        return `${issue2.origin} i\xE7in tan\u0131nmayan k\u0131ymet var.`;
      default:
        return `K\u0131ymet tan\u0131namad\u0131.`;
    }
  };
};
function ota_default() {
  return {
    localeError: error31()
  };
}

// node_modules/zod/v4/locales/ps.js
var error32 = () => {
  const Sizable = {
    string: { unit: "\u062A\u0648\u06A9\u064A", verb: "\u0648\u0644\u0631\u064A" },
    file: { unit: "\u0628\u0627\u06CC\u067C\u0633", verb: "\u0648\u0644\u0631\u064A" },
    array: { unit: "\u062A\u0648\u06A9\u064A", verb: "\u0648\u0644\u0631\u064A" },
    set: { unit: "\u062A\u0648\u06A9\u064A", verb: "\u0648\u0644\u0631\u064A" }
  };
  function getSizing(origin) {
    return Sizable[origin] ?? null;
  }
  const FormatDictionary = {
    regex: "\u0648\u0631\u0648\u062F\u064A",
    email: "\u0628\u0631\u06CC\u069A\u0646\u0627\u0644\u06CC\u06A9",
    url: "\u06CC\u0648 \u0622\u0631 \u0627\u0644",
    emoji: "\u0627\u06CC\u0645\u0648\u062C\u064A",
    uuid: "UUID",
    uuidv4: "UUIDv4",
    uuidv6: "UUIDv6",
    nanoid: "nanoid",
    guid: "GUID",
    cuid: "cuid",
    cuid2: "cuid2",
    ulid: "ULID",
    xid: "XID",
    ksuid: "KSUID",
    datetime: "\u0646\u06CC\u067C\u0647 \u0627\u0648 \u0648\u062E\u062A",
    date: "\u0646\u06D0\u067C\u0647",
    time: "\u0648\u062E\u062A",
    duration: "\u0645\u0648\u062F\u0647",
    ipv4: "\u062F IPv4 \u067E\u062A\u0647",
    ipv6: "\u062F IPv6 \u067E\u062A\u0647",
    cidrv4: "\u062F IPv4 \u0633\u0627\u062D\u0647",
    cidrv6: "\u062F IPv6 \u0633\u0627\u062D\u0647",
    base64: "base64-encoded \u0645\u062A\u0646",
    base64url: "base64url-encoded \u0645\u062A\u0646",
    json_string: "JSON \u0645\u062A\u0646",
    e164: "\u062F E.164 \u0634\u0645\u06D0\u0631\u0647",
    jwt: "JWT",
    template_literal: "\u0648\u0631\u0648\u062F\u064A"
  };
  const TypeDictionary = {
    nan: "NaN",
    number: "\u0639\u062F\u062F",
    array: "\u0627\u0631\u06D0"
  };
  return (issue2) => {
    switch (issue2.code) {
      case "invalid_type": {
        const expected = TypeDictionary[issue2.expected] ?? issue2.expected;
        const receivedType = parsedType(issue2.input);
        const received = TypeDictionary[receivedType] ?? receivedType;
        if (/^[A-Z]/.test(issue2.expected)) {
          return `\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F instanceof ${issue2.expected} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${received} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`;
        }
        return `\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${expected} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${received} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`;
      }
      case "invalid_value":
        if (issue2.values.length === 1) {
          return `\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${stringifyPrimitive(issue2.values[0])} \u0648\u0627\u06CC`;
        }
        return `\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${joinValues(issue2.values, "|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;
      case "too_big": {
        const adj = issue2.inclusive ? "<=" : "<";
        const sizing = getSizing(issue2.origin);
        if (sizing) {
          return `\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${issue2.origin ?? "\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "\u0639\u0646\u0635\u0631\u0648\u0646\u0647"} \u0648\u0644\u0631\u064A`;
        }
        return `\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${issue2.origin ?? "\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${adj}${issue2.maximum.toString()} \u0648\u064A`;
      }
      case "too_small": {
        const adj = issue2.inclusive ? ">=" : ">";
        const sizing = getSizing(issue2.origin);
        if (sizing) {
          return `\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${issue2.origin} \u0628\u0627\u06CC\u062F ${adj}${issue2.minimum.toString()} ${sizing.unit} \u0648\u0644\u0631\u064A`;
        }
        return `\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${issue2.origin} \u0628\u0627\u06CC\u062F ${adj}${issue2.minimum.toString()} \u0648\u064A`;
      }
      case "invalid_format": {
        const _issue = issue2;
        if (_issue.format === "starts_with") {
          return `\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${_issue.prefix}" \u0633\u0631\u0647 \u067E\u06CC\u0644 \u0634\u064A`;
        }
        if (_issue.format === "ends_with") {
          return `\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${_issue.suffix}" \u0633\u0631\u0647 \u067E\u0627\u06CC \u062A\u0647 \u0648\u0631\u0633\u064A\u0696\u064A`;
        }
        if (_issue.format === "includes") {
          return `\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F "${_issue.includes}" \u0648\u0644\u0631\u064A`;
        }
        if (_issue.format === "regex") {
          return `\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F ${_issue.pattern} \u0633\u0631\u0647 \u0645\u0637\u0627\u0628\u0642\u062A \u0648\u0644\u0631\u064A`;
        }
        return `${FormatDictionary[_issue.format] ?? issue2.format} \u0646\u0627\u0633\u0645 \u062F\u06CC`;
      }
      case "not_multiple_of":
        return `\u0646\u0627\u0633\u0645 \u0639\u062F\u062F: \u0628\u0627\u06CC\u062F \u062F ${issue2.divisor} \u0645\u0636\u0631\u0628 \u0648\u064A`;
      case "unrecognized_keys":
        return `\u0646\u0627\u0633\u0645 ${issue2.keys.length > 1 ? "\u06A9\u0644\u06CC\u0689\u0648\u0646\u0647" : "\u06A9\u0644\u06CC\u0689"}: ${joinValues(issue2.keys, ", ")}`;
      case "invalid_key":
        return `\u0646\u0627\u0633\u0645 \u06A9\u0644\u06CC\u0689 \u067E\u0647 ${issue2.origin} \u06A9\u06D0`;
      case "invalid_union":
        return `\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A`;
      case "invalid_element":
        return `\u0646\u0627\u0633\u0645 \u0639\u0646\u0635\u0631 \u067E\u0647 ${issue2.origin} \u06A9\u06D0`;
      default:
        return `\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A`;
    }
  };
};
function ps_default() {
  return {
    localeError: error32()
  };
}

// node_modules/zod/v4/locales/pl.js
var error33 = () => {
  const Sizable = {
    string: { unit: "znak\xF3w", verb: "mie\u0107" },
    file: { unit: "bajt\xF3w", verb: "mie\u0107" },
    array: { unit: "element\xF3w", verb: "mie\u0107" },
    set: { unit: "element\xF3w", verb: "mie\u0107" }
  };
  function getSizing(origin) {
    return Sizable[origin] ?? null;
  }
  const FormatDictionary = {
    regex: "wyra\u017Cenie",
    email: "adres email",
    url: "URL",
    emoji: "emoji",
    uuid: "UUID",
    uuidv4: "UUIDv4",
    uuidv6: "UUIDv6",
    nanoid: "nanoid",
    guid: "GUID",
    cuid: "cuid",
    cuid2: "cuid2",
    ulid: "ULID",
    xid: "XID",
    ksuid: "KSUID",
    datetime: "data i godzina w formacie ISO",
    date: "data w formacie ISO",
    time: "godzina w formacie ISO",
    duration: "czas trwania ISO",
    ipv4: "adres IPv4",
    ipv6: "adres IPv6",
    cidrv4: "zakres IPv4",
    cidrv6: "zakres IPv6",
    base64: "ci\u0105g znak\xF3w zakodowany w formacie base64",
    base64url: "ci\u0105g znak\xF3w zakodowany w formacie base64url",
    json_string: "ci\u0105g znak\xF3w w formacie JSON",
    e164: "liczba E.164",
    jwt: "JWT",
    template_literal: "wej\u015Bcie"
  };
  const TypeDictionary = {
    nan: "NaN",
    number: "liczba",
    array: "tablica"
  };
  return (issue2) => {
    switch (issue2.code) {
      case "invalid_type": {
        const expected = TypeDictionary[issue2.expected] ?? issue2.expected;
        const receivedType = parsedType(issue2.input);
        const received = TypeDictionary[receivedType] ?? receivedType;
        if (/^[A-Z]/.test(issue2.expected)) {
          return `Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano instanceof ${issue2.expected}, otrzymano ${received}`;
        }
        return `Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${expected}, otrzymano ${received}`;
      }
      case "invalid_value":
        if (issue2.values.length === 1)
          return `Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${stringifyPrimitive(issue2.values[0])}`;
        return `Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${joinValues(issue2.values, "|")}`;
      case "too_big": {
        const adj = issue2.inclusive ? "<=" : "<";
        const sizing = getSizing(issue2.origin);
        if (sizing) {
          return `Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${issue2.origin ?? "warto\u015B\u0107"} b\u0119dzie mie\u0107 ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "element\xF3w"}`;
        }
        return `Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${issue2.origin ?? "warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${adj}${issue2.maximum.toString()}`;
      }
      case "too_small": {
        const adj = issue2.inclusive ? ">=" : ">";
        const sizing = getSizing(issue2.origin);
        if (sizing) {
          return `Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${issue2.origin ?? "warto\u015B\u0107"} b\u0119dzie mie\u0107 ${adj}${issue2.minimum.toString()} ${sizing.unit ?? "element\xF3w"}`;
        }
        return `Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${issue2.origin ?? "warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${adj}${issue2.minimum.toString()}`;
      }
      case "invalid_format": {
        const _issue = issue2;
        if (_issue.format === "starts_with")
          return `Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zaczyna\u0107 si\u0119 od "${_issue.prefix}"`;
        if (_issue.format === "ends_with")
          return `Nieprawid\u0142owy ci\u0105g znak\xF3w: musi ko\u0144czy\u0107 si\u0119 na "${_issue.suffix}"`;
        if (_issue.format === "includes")
          return `Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zawiera\u0107 "${_issue.includes}"`;
        if (_issue.format === "regex")
          return `Nieprawid\u0142owy ci\u0105g znak\xF3w: musi odpowiada\u0107 wzorcowi ${_issue.pattern}`;
        return `Nieprawid\u0142ow(y/a/e) ${FormatDictionary[_issue.format] ?? issue2.format}`;
      }
      case "not_multiple_of":
        return `Nieprawid\u0142owa liczba: musi by\u0107 wielokrotno\u015Bci\u0105 ${issue2.divisor}`;
      case "unrecognized_keys":
        return `Nierozpoznane klucze${issue2.keys.length > 1 ? "s" : ""}: ${joinValues(issue2.keys, ", ")}`;
      case "invalid_key":
        return `Nieprawid\u0142owy klucz w ${issue2.origin}`;
      case "invalid_union":
        return "Nieprawid\u0142owe dane wej\u015Bciowe";
      case "invalid_element":
        return `Nieprawid\u0142owa warto\u015B\u0107 w ${issue2.origin}`;
      default:
        return `Nieprawid\u0142owe dane wej\u015Bciowe`;
    }
  };
};
function pl_default() {
  return {
    localeError: error33()
  };
}

// node_modules/zod/v4/locales/pt.js
var error34 = () => {
  const Sizable = {
    string: { unit: "caracteres", verb: "ter" },
    file: { unit: "bytes", verb: "ter" },
    array: { unit: "itens", verb: "ter" },
    set: { unit: "itens", verb: "ter" }
  };
  function getSizing(origin) {
    return Sizable[origin] ?? null;
  }
  const FormatDictionary = {
    regex: "padr\xE3o",
    email: "endere\xE7o de e-mail",
    url: "URL",
    emoji: "emoji",
    uuid: "UUID",
    uuidv4: "UUIDv4",
    uuidv6: "UUIDv6",
    nanoid: "nanoid",
    guid: "GUID",
    cuid: "cuid",
    cuid2: "cuid2",
    ulid: "ULID",
    xid: "XID",
    ksuid: "KSUID",
    datetime: "data e hora ISO",
    date: "data ISO",
    time: "hora ISO",
    duration: "dura\xE7\xE3o ISO",
    ipv4: "endere\xE7o IPv4",
    ipv6: "endere\xE7o IPv6",
    cidrv4: "faixa de IPv4",
    cidrv6: "faixa de IPv6",
    base64: "texto codificado em base64",
    base64url: "URL codificada em base64",
    json_string: "texto JSON",
    e164: "n\xFAmero E.164",
    jwt: "JWT",
    template_literal: "entrada"
  };
  const TypeDictionary = {
    nan: "NaN",
    number: "n\xFAmero",
    null: "nulo"
  };
  return (issue2) => {
    switch (issue2.code) {
      case "invalid_type": {
        const expected = TypeDictionary[issue2.expected] ?? issue2.expected;
        const receivedType = parsedType(issue2.input);
        const received = TypeDictionary[receivedType] ?? receivedType;
        if (/^[A-Z]/.test(issue2.expected)) {
          return `Tipo inv\xE1lido: esperado instanceof ${issue2.expected}, recebido ${received}`;
        }
        return `Tipo inv\xE1lido: esperado ${expected}, recebido ${received}`;
      }
      case "invalid_value":
        if (issue2.values.length === 1)
          return `Entrada inv\xE1lida: esperado ${stringifyPrimitive(issue2.values[0])}`;
        return `Op\xE7\xE3o inv\xE1lida: esperada uma das ${joinValues(issue2.values, "|")}`;
      case "too_big": {
        const adj = issue2.inclusive ? "<=" : "<";
        const sizing = getSizing(issue2.origin);
        if (sizing)
          return `Muito grande: esperado que ${issue2.origin ?? "valor"} tivesse ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "elementos"}`;
        return `Muito grande: esperado que ${issue2.origin ?? "valor"} fosse ${adj}${issue2.maximum.toString()}`;
      }
      case "too_small": {
        const adj = issue2.inclusive ? ">=" : ">";
        const sizing = getSizing(issue2.origin);
        if (sizing) {
          return `Muito pequeno: esperado que ${issue2.origin} tivesse ${adj}${issue2.minimum.toString()} ${sizing.unit}`;
        }
        return `Muito pequeno: esperado que ${issue2.origin} fosse ${adj}${issue2.minimum.toString()}`;
      }
      case "invalid_format": {
        const _issue = issue2;
        if (_issue.format === "starts_with")
          return `Texto inv\xE1lido: deve come\xE7ar com "${_issue.prefix}"`;
        if (_issue.format === "ends_with")
          return `Texto inv\xE1lido: deve terminar com "${_issue.suffix}"`;
        if (_issue.format === "includes")
          return `Texto inv\xE1lido: deve incluir "${_issue.includes}"`;
        if (_issue.format === "regex")
          return `Texto inv\xE1lido: deve corresponder ao padr\xE3o ${_issue.pattern}`;
        return `${FormatDictionary[_issue.format] ?? issue2.format} inv\xE1lido`;
      }
      case "not_multiple_of":
        return `N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${issue2.divisor}`;
      case "unrecognized_keys":
        return `Chave${issue2.keys.length > 1 ? "s" : ""} desconhecida${issue2.keys.length > 1 ? "s" : ""}: ${joinValues(issue2.keys, ", ")}`;
      case "invalid_key":
        return `Chave inv\xE1lida em ${issue2.origin}`;
      case "invalid_union":
        return "Entrada inv\xE1lida";
      case "invalid_element":
        return `Valor inv\xE1lido em ${issue2.origin}`;
      default:
        return `Campo inv\xE1lido`;
    }
  };
};
function pt_default() {
  return {
    localeError: error34()
  };
}

// node_modules/zod/v4/locales/ru.js
function getRussianPlural(count, one, few, many) {
  const absCount = Math.abs(count);
  const lastDigit = absCount % 10;
  const lastTwoDigits = absCount % 100;
  if (lastTwoDigits >= 11 && lastTwoDigits <= 19) {
    return many;
  }
  if (lastDigit === 1) {
    return one;
  }
  if (lastDigit >= 2 && lastDigit <= 4) {
    return few;
  }
  return many;
}
var error35 = () => {
  const Sizable = {
    string: {
      unit: {
        one: "\u0441\u0438\u043C\u0432\u043E\u043B",
        few: "\u0441\u0438\u043C\u0432\u043E\u043B\u0430",
        many: "\u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432"
      },
      verb: "\u0438\u043C\u0435\u0442\u044C"
    },
    file: {
      unit: {
        one: "\u0431\u0430\u0439\u0442",
        few: "\u0431\u0430\u0439\u0442\u0430",
        many: "\u0431\u0430\u0439\u0442"
      },
      verb: "\u0438\u043C\u0435\u0442\u044C"
    },
    array: {
      unit: {
        one: "\u044D\u043B\u0435\u043C\u0435\u043D\u0442",
        few: "\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",
        many: "\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"
      },
      verb: "\u0438\u043C\u0435\u0442\u044C"
    },
    set: {
      unit: {
        one: "\u044D\u043B\u0435\u043C\u0435\u043D\u0442",
        few: "\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",
        many: "\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"
      },
      verb: "\u0438\u043C\u0435\u0442\u044C"
    }
  };
  function getSizing(origin) {
    return Sizable[origin] ?? null;
  }
  const FormatDictionary = {
    regex: "\u0432\u0432\u043E\u0434",
    email: "email \u0430\u0434\u0440\u0435\u0441",
    url: "URL",
    emoji: "\u044D\u043C\u043E\u0434\u0437\u0438",
    uuid: "UUID",
    uuidv4: "UUIDv4",
    uuidv6: "UUIDv6",
    nanoid: "nanoid",
    guid: "GUID",
    cuid: "cuid",
    cuid2: "cuid2",
    ulid: "ULID",
    xid: "XID",
    ksuid: "KSUID",
    datetime: "ISO \u0434\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043C\u044F",
    date: "ISO \u0434\u0430\u0442\u0430",
    time: "ISO \u0432\u0440\u0435\u043C\u044F",
    duration: "ISO \u0434\u043B\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u044C",
    ipv4: "IPv4 \u0430\u0434\u0440\u0435\u0441",
    ipv6: "IPv6 \u0430\u0434\u0440\u0435\u0441",
    cidrv4: "IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",
    cidrv6: "IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",
    base64: "\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64",
    base64url: "\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64url",
    json_string: "JSON \u0441\u0442\u0440\u043E\u043A\u0430",
    e164: "\u043D\u043E\u043C\u0435\u0440 E.164",
    jwt: "JWT",
    template_literal: "\u0432\u0432\u043E\u0434"
  };
  const TypeDictionary = {
    nan: "NaN",
    number: "\u0447\u0438\u0441\u043B\u043E",
    array: "\u043C\u0430\u0441\u0441\u0438\u0432"
  };
  return (issue2) => {
    switch (issue2.code) {
      case "invalid_type": {
        const expected = TypeDictionary[issue2.expected] ?? issue2.expected;
        const receivedType = parsedType(issue2.input);
        const received = TypeDictionary[receivedType] ?? receivedType;
        if (/^[A-Z]/.test(issue2.expected)) {
          return `\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C instanceof ${issue2.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${received}`;
        }
        return `\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${received}`;
      }
      case "invalid_value":
        if (issue2.values.length === 1)
          return `\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${stringifyPrimitive(issue2.values[0])}`;
        return `\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0430\u0440\u0438\u0430\u043D\u0442: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C \u043E\u0434\u043D\u043E \u0438\u0437 ${joinValues(issue2.values, "|")}`;
      case "too_big": {
        const adj = issue2.inclusive ? "<=" : "<";
        const sizing = getSizing(issue2.origin);
        if (sizing) {
          const maxValue = Number(issue2.maximum);
          const unit = getRussianPlural(maxValue, sizing.unit.one, sizing.unit.few, sizing.unit.many);
          return `\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${issue2.origin ?? "\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${adj}${issue2.maximum.toString()} ${unit}`;
        }
        return `\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${issue2.origin ?? "\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 ${adj}${issue2.maximum.toString()}`;
      }
      case "too_small": {
        const adj = issue2.inclusive ? ">=" : ">";
        const sizing = getSizing(issue2.origin);
        if (sizing) {
          const minValue = Number(issue2.minimum);
          const unit = getRussianPlural(minValue, sizing.unit.one, sizing.unit.few, sizing.unit.many);
          return `\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${issue2.origin} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${adj}${issue2.minimum.toString()} ${unit}`;
        }
        return `\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${issue2.origin} \u0431\u0443\u0434\u0435\u0442 ${adj}${issue2.minimum.toString()}`;
      }
      case "invalid_format": {
        const _issue = issue2;
        if (_issue.format === "starts_with")
          return `\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u043D\u0430\u0447\u0438\u043D\u0430\u0442\u044C\u0441\u044F \u0441 "${_issue.prefix}"`;
        if (_issue.format === "ends_with")
          return `\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0437\u0430\u043A\u0430\u043D\u0447\u0438\u0432\u0430\u0442\u044C\u0441\u044F \u043D\u0430 "${_issue.suffix}"`;
        if (_issue.format === "includes")
          return `\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u0434\u0435\u0440\u0436\u0430\u0442\u044C "${_issue.includes}"`;
        if (_issue.format === "regex")
          return `\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043E\u0432\u0430\u0442\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${_issue.pattern}`;
        return `\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 ${FormatDictionary[_issue.format] ?? issue2.format}`;
      }
      case "not_multiple_of":
        return `\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0447\u0438\u0441\u043B\u043E: \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${issue2.divisor}`;
      case "unrecognized_keys":
        return `\u041D\u0435\u0440\u0430\u0441\u043F\u043E\u0437\u043D\u0430\u043D\u043D${issue2.keys.length > 1 ? "\u044B\u0435" : "\u044B\u0439"} \u043A\u043B\u044E\u0447${issue2.keys.length > 1 ? "\u0438" : ""}: ${joinValues(issue2.keys, ", ")}`;
      case "invalid_key":
        return `\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u043A\u043B\u044E\u0447 \u0432 ${issue2.origin}`;
      case "invalid_union":
        return "\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435";
      case "invalid_element":
        return `\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0432 ${issue2.origin}`;
      default:
        return `\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435`;
    }
  };
};
function ru_default() {
  return {
    localeError: error35()
  };
}

// node_modules/zod/v4/locales/sl.js
var error36 = () => {
  const Sizable = {
    string: { unit: "znakov", verb: "imeti" },
    file: { unit: "bajtov", verb: "imeti" },
    array: { unit: "elementov", verb: "imeti" },
    set: { unit: "elementov", verb: "imeti" }
  };
  function getSizing(origin) {
    return Sizable[origin] ?? null;
  }
  const FormatDictionary = {
    regex: "vnos",
    email: "e-po\u0161tni naslov",
    url: "URL",
    emoji: "emoji",
    uuid: "UUID",
    uuidv4: "UUIDv4",
    uuidv6: "UUIDv6",
    nanoid: "nanoid",
    guid: "GUID",
    cuid: "cuid",
    cuid2: "cuid2",
    ulid: "ULID",
    xid: "XID",
    ksuid: "KSUID",
    datetime: "ISO datum in \u010Das",
    date: "ISO datum",
    time: "ISO \u010Das",
    duration: "ISO trajanje",
    ipv4: "IPv4 naslov",
    ipv6: "IPv6 naslov",
    cidrv4: "obseg IPv4",
    cidrv6: "obseg IPv6",
    base64: "base64 kodiran niz",
    base64url: "base64url kodiran niz",
    json_string: "JSON niz",
    e164: "E.164 \u0161tevilka",
    jwt: "JWT",
    template_literal: "vnos"
  };
  const TypeDictionary = {
    nan: "NaN",
    number: "\u0161tevilo",
    array: "tabela"
  };
  return (issue2) => {
    switch (issue2.code) {
      case "invalid_type": {
        const expected = TypeDictionary[issue2.expected] ?? issue2.expected;
        const receivedType = parsedType(issue2.input);
        const received = TypeDictionary[receivedType] ?? receivedType;
        if (/^[A-Z]/.test(issue2.expected)) {
          return `Neveljaven vnos: pri\u010Dakovano instanceof ${issue2.expected}, prejeto ${received}`;
        }
        return `Neveljaven vnos: pri\u010Dakovano ${expected}, prejeto ${received}`;
      }
      case "invalid_value":
        if (issue2.values.length === 1)
          return `Neveljaven vnos: pri\u010Dakovano ${stringifyPrimitive(issue2.values[0])}`;
        return `Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${joinValues(issue2.values, "|")}`;
      case "too_big": {
        const adj = issue2.inclusive ? "<=" : "<";
        const sizing = getSizing(issue2.origin);
        if (sizing)
          return `Preveliko: pri\u010Dakovano, da bo ${issue2.origin ?? "vrednost"} imelo ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "elementov"}`;
        return `Preveliko: pri\u010Dakovano, da bo ${issue2.origin ?? "vrednost"} ${adj}${issue2.maximum.toString()}`;
      }
      case "too_small": {
        const adj = issue2.inclusive ? ">=" : ">";
        const sizing = getSizing(issue2.origin);
        if (sizing) {
          return `Premajhno: pri\u010Dakovano, da bo ${issue2.origin} imelo ${adj}${issue2.minimum.toString()} ${sizing.unit}`;
        }
        return `Premajhno: pri\u010Dakovano, da bo ${issue2.origin} ${adj}${issue2.minimum.toString()}`;
      }
      case "invalid_format": {
        const _issue = issue2;
        if (_issue.format === "starts_with") {
          return `Neveljaven niz: mora se za\u010Deti z "${_issue.prefix}"`;
        }
        if (_issue.format === "ends_with")
          return `Neveljaven niz: mora se kon\u010Dati z "${_issue.suffix}"`;
        if (_issue.format === "includes")
          return `Neveljaven niz: mora vsebovati "${_issue.includes}"`;
        if (_issue.format === "regex")
          return `Neveljaven niz: mora ustrezati vzorcu ${_issue.pattern}`;
        return `Neveljaven ${FormatDictionary[_issue.format] ?? issue2.format}`;
      }
      case "not_multiple_of":
        return `Neveljavno \u0161tevilo: mora biti ve\u010Dkratnik ${issue2.divisor}`;
      case "unrecognized_keys":
        return `Neprepoznan${issue2.keys.length > 1 ? "i klju\u010Di" : " klju\u010D"}: ${joinValues(issue2.keys, ", ")}`;
      case "invalid_key":
        return `Neveljaven klju\u010D v ${issue2.origin}`;
      case "invalid_union":
        return "Neveljaven vnos";
      case "invalid_element":
        return `Neveljavna vrednost v ${issue2.origin}`;
      default:
        return "Neveljaven vnos";
    }
  };
};
function sl_default() {
  return {
    localeError: error36()
  };
}

// node_modules/zod/v4/locales/sv.js
var error37 = () => {
  const Sizable = {
    string: { unit: "tecken", verb: "att ha" },
    file: { unit: "bytes", verb: "att ha" },
    array: { unit: "objekt", verb: "att inneh\xE5lla" },
    set: { unit: "objekt", verb: "att inneh\xE5lla" }
  };
  function getSizing(origin) {
    return Sizable[origin] ?? null;
  }
  const FormatDictionary = {
    regex: "regulj\xE4rt uttryck",
    email: "e-postadress",
    url: "URL",
    emoji: "emoji",
    uuid: "UUID",
    uuidv4: "UUIDv4",
    uuidv6: "UUIDv6",
    nanoid: "nanoid",
    guid: "GUID",
    cuid: "cuid",
    cuid2: "cuid2",
    ulid: "ULID",
    xid: "XID",
    ksuid: "KSUID",
    datetime: "ISO-datum och tid",
    date: "ISO-datum",
    time: "ISO-tid",
    duration: "ISO-varaktighet",
    ipv4: "IPv4-intervall",
    ipv6: "IPv6-intervall",
    cidrv4: "IPv4-spektrum",
    cidrv6: "IPv6-spektrum",
    base64: "base64-kodad str\xE4ng",
    base64url: "base64url-kodad str\xE4ng",
    json_string: "JSON-str\xE4ng",
    e164: "E.164-nummer",
    jwt: "JWT",
    template_literal: "mall-literal"
  };
  const TypeDictionary = {
    nan: "NaN",
    number: "antal",
    array: "lista"
  };
  return (issue2) => {
    switch (issue2.code) {
      case "invalid_type": {
        const expected = TypeDictionary[issue2.expected] ?? issue2.expected;
        const receivedType = parsedType(issue2.input);
        const received = TypeDictionary[receivedType] ?? receivedType;
        if (/^[A-Z]/.test(issue2.expected)) {
          return `Ogiltig inmatning: f\xF6rv\xE4ntat instanceof ${issue2.expected}, fick ${received}`;
        }
        return `Ogiltig inmatning: f\xF6rv\xE4ntat ${expected}, fick ${received}`;
      }
      case "invalid_value":
        if (issue2.values.length === 1)
          return `Ogiltig inmatning: f\xF6rv\xE4ntat ${stringifyPrimitive(issue2.values[0])}`;
        return `Ogiltigt val: f\xF6rv\xE4ntade en av ${joinValues(issue2.values, "|")}`;
      case "too_big": {
        const adj = issue2.inclusive ? "<=" : "<";
        const sizing = getSizing(issue2.origin);
        if (sizing) {
          return `F\xF6r stor(t): f\xF6rv\xE4ntade ${issue2.origin ?? "v\xE4rdet"} att ha ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "element"}`;
        }
        return `F\xF6r stor(t): f\xF6rv\xE4ntat ${issue2.origin ?? "v\xE4rdet"} att ha ${adj}${issue2.maximum.toString()}`;
      }
      case "too_small": {
        const adj = issue2.inclusive ? ">=" : ">";
        const sizing = getSizing(issue2.origin);
        if (sizing) {
          return `F\xF6r lite(t): f\xF6rv\xE4ntade ${issue2.origin ?? "v\xE4rdet"} att ha ${adj}${issue2.minimum.toString()} ${sizing.unit}`;
        }
        return `F\xF6r lite(t): f\xF6rv\xE4ntade ${issue2.origin ?? "v\xE4rdet"} att ha ${adj}${issue2.minimum.toString()}`;
      }
      case "invalid_format": {
        const _issue = issue2;
        if (_issue.format === "starts_with") {
          return `Ogiltig str\xE4ng: m\xE5ste b\xF6rja med "${_issue.prefix}"`;
        }
        if (_issue.format === "ends_with")
          return `Ogiltig str\xE4ng: m\xE5ste sluta med "${_issue.suffix}"`;
        if (_issue.format === "includes")
          return `Ogiltig str\xE4ng: m\xE5ste inneh\xE5lla "${_issue.includes}"`;
        if (_issue.format === "regex")
          return `Ogiltig str\xE4ng: m\xE5ste matcha m\xF6nstret "${_issue.pattern}"`;
        return `Ogiltig(t) ${FormatDictionary[_issue.format] ?? issue2.format}`;
      }
      case "not_multiple_of":
        return `Ogiltigt tal: m\xE5ste vara en multipel av ${issue2.divisor}`;
      case "unrecognized_keys":
        return `${issue2.keys.length > 1 ? "Ok\xE4nda nycklar" : "Ok\xE4nd nyckel"}: ${joinValues(issue2.keys, ", ")}`;
      case "invalid_key":
        return `Ogiltig nyckel i ${issue2.origin ?? "v\xE4rdet"}`;
      case "invalid_union":
        return "Ogiltig input";
      case "invalid_element":
        return `Ogiltigt v\xE4rde i ${issue2.origin ?? "v\xE4rdet"}`;
      default:
        return `Ogiltig input`;
    }
  };
};
function sv_default() {
  return {
    localeError: error37()
  };
}

// node_modules/zod/v4/locales/ta.js
var error38 = () => {
  const Sizable = {
    string: { unit: "\u0B8E\u0BB4\u0BC1\u0BA4\u0BCD\u0BA4\u0BC1\u0B95\u0BCD\u0B95\u0BB3\u0BCD", verb: "\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD" },
    file: { unit: "\u0BAA\u0BC8\u0B9F\u0BCD\u0B9F\u0BC1\u0B95\u0BB3\u0BCD", verb: "\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD" },
    array: { unit: "\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD", verb: "\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD" },
    set: { unit: "\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD", verb: "\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD" }
  };
  function getSizing(origin) {
    return Sizable[origin] ?? null;
  }
  const FormatDictionary = {
    regex: "\u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1",
    email: "\u0BAE\u0BBF\u0BA9\u0BCD\u0BA9\u0B9E\u0BCD\u0B9A\u0BB2\u0BCD \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",
    url: "URL",
    emoji: "emoji",
    uuid: "UUID",
    uuidv4: "UUIDv4",
    uuidv6: "UUIDv6",
    nanoid: "nanoid",
    guid: "GUID",
    cuid: "cuid",
    cuid2: "cuid2",
    ulid: "ULID",
    xid: "XID",
    ksuid: "KSUID",
    datetime: "ISO \u0BA4\u0BC7\u0BA4\u0BBF \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",
    date: "ISO \u0BA4\u0BC7\u0BA4\u0BBF",
    time: "ISO \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",
    duration: "ISO \u0B95\u0BBE\u0BB2 \u0B85\u0BB3\u0BB5\u0BC1",
    ipv4: "IPv4 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",
    ipv6: "IPv6 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",
    cidrv4: "IPv4 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",
    cidrv6: "IPv6 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",
    base64: "base64-encoded \u0B9A\u0BB0\u0BAE\u0BCD",
    base64url: "base64url-encoded \u0B9A\u0BB0\u0BAE\u0BCD",
    json_string: "JSON \u0B9A\u0BB0\u0BAE\u0BCD",
    e164: "E.164 \u0B8E\u0BA3\u0BCD",
    jwt: "JWT",
    template_literal: "input"
  };
  const TypeDictionary = {
    nan: "NaN",
    number: "\u0B8E\u0BA3\u0BCD",
    array: "\u0B85\u0BA3\u0BBF",
    null: "\u0BB5\u0BC6\u0BB1\u0BC1\u0BAE\u0BC8"
  };
  return (issue2) => {
    switch (issue2.code) {
      case "invalid_type": {
        const expected = TypeDictionary[issue2.expected] ?? issue2.expected;
        const receivedType = parsedType(issue2.input);
        const received = TypeDictionary[receivedType] ?? receivedType;
        if (/^[A-Z]/.test(issue2.expected)) {
          return `\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 instanceof ${issue2.expected}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${received}`;
        }
        return `\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${expected}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${received}`;
      }
      case "invalid_value":
        if (issue2.values.length === 1)
          return `\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${stringifyPrimitive(issue2.values[0])}`;
        return `\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0BB0\u0BC1\u0BAA\u0BCD\u0BAA\u0BAE\u0BCD: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${joinValues(issue2.values, "|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;
      case "too_big": {
        const adj = issue2.inclusive ? "<=" : "<";
        const sizing = getSizing(issue2.origin);
        if (sizing) {
          return `\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${issue2.origin ?? "\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD"} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;
        }
        return `\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${issue2.origin ?? "\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${adj}${issue2.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;
      }
      case "too_small": {
        const adj = issue2.inclusive ? ">=" : ">";
        const sizing = getSizing(issue2.origin);
        if (sizing) {
          return `\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${issue2.origin} ${adj}${issue2.minimum.toString()} ${sizing.unit} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;
        }
        return `\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${issue2.origin} ${adj}${issue2.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;
      }
      case "invalid_format": {
        const _issue = issue2;
        if (_issue.format === "starts_with")
          return `\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${_issue.prefix}" \u0B87\u0BB2\u0BCD \u0BA4\u0BCA\u0B9F\u0B99\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;
        if (_issue.format === "ends_with")
          return `\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${_issue.suffix}" \u0B87\u0BB2\u0BCD \u0BAE\u0BC1\u0B9F\u0BBF\u0BB5\u0B9F\u0BC8\u0BAF \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;
        if (_issue.format === "includes")
          return `\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${_issue.includes}" \u0B90 \u0B89\u0BB3\u0BCD\u0BB3\u0B9F\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;
        if (_issue.format === "regex")
          return `\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: ${_issue.pattern} \u0BAE\u0BC1\u0BB1\u0BC8\u0BAA\u0BBE\u0B9F\u0BCD\u0B9F\u0BC1\u0B9F\u0BA9\u0BCD \u0BAA\u0BCA\u0BB0\u0BC1\u0BA8\u0BCD\u0BA4 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;
        return `\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 ${FormatDictionary[_issue.format] ?? issue2.format}`;
      }
      case "not_multiple_of":
        return `\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B8E\u0BA3\u0BCD: ${issue2.divisor} \u0B87\u0BA9\u0BCD \u0BAA\u0BB2\u0BAE\u0BBE\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;
      case "unrecognized_keys":
        return `\u0B85\u0B9F\u0BC8\u0BAF\u0BBE\u0BB3\u0BAE\u0BCD \u0BA4\u0BC6\u0BB0\u0BBF\u0BAF\u0BBE\u0BA4 \u0BB5\u0BBF\u0B9A\u0BC8${issue2.keys.length > 1 ? "\u0B95\u0BB3\u0BCD" : ""}: ${joinValues(issue2.keys, ", ")}`;
      case "invalid_key":
        return `${issue2.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0B9A\u0BC8`;
      case "invalid_union":
        return "\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1";
      case "invalid_element":
        return `${issue2.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1`;
      default:
        return `\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1`;
    }
  };
};
function ta_default() {
  return {
    localeError: error38()
  };
}

// node_modules/zod/v4/locales/th.js
var error39 = () => {
  const Sizable = {
    string: { unit: "\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23", verb: "\u0E04\u0E27\u0E23\u0E21\u0E35" },
    file: { unit: "\u0E44\u0E1A\u0E15\u0E4C", verb: "\u0E04\u0E27\u0E23\u0E21\u0E35" },
    array: { unit: "\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23", verb: "\u0E04\u0E27\u0E23\u0E21\u0E35" },
    set: { unit: "\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23", verb: "\u0E04\u0E27\u0E23\u0E21\u0E35" }
  };
  function getSizing(origin) {
    return Sizable[origin] ?? null;
  }
  const FormatDictionary = {
    regex: "\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19",
    email: "\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48\u0E2D\u0E35\u0E40\u0E21\u0E25",
    url: "URL",
    emoji: "\u0E2D\u0E34\u0E42\u0E21\u0E08\u0E34",
    uuid: "UUID",
    uuidv4: "UUIDv4",
    uuidv6: "UUIDv6",
    nanoid: "nanoid",
    guid: "GUID",
    cuid: "cuid",
    cuid2: "cuid2",
    ulid: "ULID",
    xid: "XID",
    ksuid: "KSUID",
    datetime: "\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",
    date: "\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E41\u0E1A\u0E1A ISO",
    time: "\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",
    duration: "\u0E0A\u0E48\u0E27\u0E07\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",
    ipv4: "\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv4",
    ipv6: "\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv6",
    cidrv4: "\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv4",
    cidrv6: "\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv6",
    base64: "\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64",
    base64url: "\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64 \u0E2A\u0E33\u0E2B\u0E23\u0E31\u0E1A URL",
    json_string: "\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A JSON",
    e164: "\u0E40\u0E1A\u0E2D\u0E23\u0E4C\u0E42\u0E17\u0E23\u0E28\u0E31\u0E1E\u0E17\u0E4C\u0E23\u0E30\u0E2B\u0E27\u0E48\u0E32\u0E07\u0E1B\u0E23\u0E30\u0E40\u0E17\u0E28 (E.164)",
    jwt: "\u0E42\u0E17\u0E40\u0E04\u0E19 JWT",
    template_literal: "\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19"
  };
  const TypeDictionary = {
    nan: "NaN",
    number: "\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02",
    array: "\u0E2D\u0E32\u0E23\u0E4C\u0E40\u0E23\u0E22\u0E4C (Array)",
    null: "\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E48\u0E32 (null)"
  };
  return (issue2) => {
    switch (issue2.code) {
      case "invalid_type": {
        const expected = TypeDictionary[issue2.expected] ?? issue2.expected;
        const receivedType = parsedType(issue2.input);
        const received = TypeDictionary[receivedType] ?? receivedType;
        if (/^[A-Z]/.test(issue2.expected)) {
          return `\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 instanceof ${issue2.expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${received}`;
        }
        return `\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${received}`;
      }
      case "invalid_value":
        if (issue2.values.length === 1)
          return `\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${stringifyPrimitive(issue2.values[0])}`;
        return `\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19\u0E2B\u0E19\u0E36\u0E48\u0E07\u0E43\u0E19 ${joinValues(issue2.values, "|")}`;
      case "too_big": {
        const adj = issue2.inclusive ? "\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19" : "\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32";
        const sizing = getSizing(issue2.origin);
        if (sizing)
          return `\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${issue2.origin ?? "\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${adj} ${issue2.maximum.toString()} ${sizing.unit ?? "\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"}`;
        return `\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${issue2.origin ?? "\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${adj} ${issue2.maximum.toString()}`;
      }
      case "too_small": {
        const adj = issue2.inclusive ? "\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22" : "\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32";
        const sizing = getSizing(issue2.origin);
        if (sizing) {
          return `\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${issue2.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${adj} ${issue2.minimum.toString()} ${sizing.unit}`;
        }
        return `\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${issue2.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${adj} ${issue2.minimum.toString()}`;
      }
      case "invalid_format": {
        const _issue = issue2;
        if (_issue.format === "starts_with") {
          return `\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E02\u0E36\u0E49\u0E19\u0E15\u0E49\u0E19\u0E14\u0E49\u0E27\u0E22 "${_issue.prefix}"`;
        }
        if (_issue.format === "ends_with")
          return `\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E25\u0E07\u0E17\u0E49\u0E32\u0E22\u0E14\u0E49\u0E27\u0E22 "${_issue.suffix}"`;
        if (_issue.format === "includes")
          return `\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35 "${_issue.includes}" \u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21`;
        if (_issue.format === "regex")
          return `\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14 ${_issue.pattern}`;
        return `\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: ${FormatDictionary[_issue.format] ?? issue2.format}`;
      }
      case "not_multiple_of":
        return `\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19\u0E08\u0E33\u0E19\u0E27\u0E19\u0E17\u0E35\u0E48\u0E2B\u0E32\u0E23\u0E14\u0E49\u0E27\u0E22 ${issue2.divisor} \u0E44\u0E14\u0E49\u0E25\u0E07\u0E15\u0E31\u0E27`;
      case "unrecognized_keys":
        return `\u0E1E\u0E1A\u0E04\u0E35\u0E22\u0E4C\u0E17\u0E35\u0E48\u0E44\u0E21\u0E48\u0E23\u0E39\u0E49\u0E08\u0E31\u0E01: ${joinValues(issue2.keys, ", ")}`;
      case "invalid_key":
        return `\u0E04\u0E35\u0E22\u0E4C\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${issue2.origin}`;
      case "invalid_union":
        return "\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E44\u0E21\u0E48\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E22\u0E39\u0E40\u0E19\u0E35\u0E22\u0E19\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14\u0E44\u0E27\u0E49";
      case "invalid_element":
        return `\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${issue2.origin}`;
      default:
        return `\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07`;
    }
  };
};
function th_default() {
  return {
    localeError: error39()
  };
}

// node_modules/zod/v4/locales/tr.js
var error40 = () => {
  const Sizable = {
    string: { unit: "karakter", verb: "olmal\u0131" },
    file: { unit: "bayt", verb: "olmal\u0131" },
    array: { unit: "\xF6\u011Fe", verb: "olmal\u0131" },
    set: { unit: "\xF6\u011Fe", verb: "olmal\u0131" }
  };
  function getSizing(origin) {
    return Sizable[origin] ?? null;
  }
  const FormatDictionary = {
    regex: "girdi",
    email: "e-posta adresi",
    url: "URL",
    emoji: "emoji",
    uuid: "UUID",
    uuidv4: "UUIDv4",
    uuidv6: "UUIDv6",
    nanoid: "nanoid",
    guid: "GUID",
    cuid: "cuid",
    cuid2: "cuid2",
    ulid: "ULID",
    xid: "XID",
    ksuid: "KSUID",
    datetime: "ISO tarih ve saat",
    date: "ISO tarih",
    time: "ISO saat",
    duration: "ISO s\xFCre",
    ipv4: "IPv4 adresi",
    ipv6: "IPv6 adresi",
    cidrv4: "IPv4 aral\u0131\u011F\u0131",
    cidrv6: "IPv6 aral\u0131\u011F\u0131",
    base64: "base64 ile \u015Fifrelenmi\u015F metin",
    base64url: "base64url ile \u015Fifrelenmi\u015F metin",
    json_string: "JSON dizesi",
    e164: "E.164 say\u0131s\u0131",
    jwt: "JWT",
    template_literal: "\u015Eablon dizesi"
  };
  const TypeDictionary = {
    nan: "NaN"
  };
  return (issue2) => {
    switch (issue2.code) {
      case "invalid_type": {
        const expected = TypeDictionary[issue2.expected] ?? issue2.expected;
        const receivedType = parsedType(issue2.input);
        const received = TypeDictionary[receivedType] ?? receivedType;
        if (/^[A-Z]/.test(issue2.expected)) {
          return `Ge\xE7ersiz de\u011Fer: beklenen instanceof ${issue2.expected}, al\u0131nan ${received}`;
        }
        return `Ge\xE7ersiz de\u011Fer: beklenen ${expected}, al\u0131nan ${received}`;
      }
      case "invalid_value":
        if (issue2.values.length === 1)
          return `Ge\xE7ersiz de\u011Fer: beklenen ${stringifyPrimitive(issue2.values[0])}`;
        return `Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${joinValues(issue2.values, "|")}`;
      case "too_big": {
        const adj = issue2.inclusive ? "<=" : "<";
        const sizing = getSizing(issue2.origin);
        if (sizing)
          return `\xC7ok b\xFCy\xFCk: beklenen ${issue2.origin ?? "de\u011Fer"} ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "\xF6\u011Fe"}`;
        return `\xC7ok b\xFCy\xFCk: beklenen ${issue2.origin ?? "de\u011Fer"} ${adj}${issue2.maximum.toString()}`;
      }
      case "too_small": {
        const adj = issue2.inclusive ? ">=" : ">";
        const sizing = getSizing(issue2.origin);
        if (sizing)
          return `\xC7ok k\xFC\xE7\xFCk: beklenen ${issue2.origin} ${adj}${issue2.minimum.toString()} ${sizing.unit}`;
        return `\xC7ok k\xFC\xE7\xFCk: beklenen ${issue2.origin} ${adj}${issue2.minimum.toString()}`;
      }
      case "invalid_format": {
        const _issue = issue2;
        if (_issue.format === "starts_with")
          return `Ge\xE7ersiz metin: "${_issue.prefix}" ile ba\u015Flamal\u0131`;
        if (_issue.format === "ends_with")
          return `Ge\xE7ersiz metin: "${_issue.suffix}" ile bitmeli`;
        if (_issue.format === "includes")
          return `Ge\xE7ersiz metin: "${_issue.includes}" i\xE7ermeli`;
        if (_issue.format === "regex")
          return `Ge\xE7ersiz metin: ${_issue.pattern} desenine uymal\u0131`;
        return `Ge\xE7ersiz ${FormatDictionary[_issue.format] ?? issue2.format}`;
      }
      case "not_multiple_of":
        return `Ge\xE7ersiz say\u0131: ${issue2.divisor} ile tam b\xF6l\xFCnebilmeli`;
      case "unrecognized_keys":
        return `Tan\u0131nmayan anahtar${issue2.keys.length > 1 ? "lar" : ""}: ${joinValues(issue2.keys, ", ")}`;
      case "invalid_key":
        return `${issue2.origin} i\xE7inde ge\xE7ersiz anahtar`;
      case "invalid_union":
        return "Ge\xE7ersiz de\u011Fer";
      case "invalid_element":
        return `${issue2.origin} i\xE7inde ge\xE7ersiz de\u011Fer`;
      default:
        return `Ge\xE7ersiz de\u011Fer`;
    }
  };
};
function tr_default() {
  return {
    localeError: error40()
  };
}

// node_modules/zod/v4/locales/uk.js
var error41 = () => {
  const Sizable = {
    string: { unit: "\u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432", verb: "\u043C\u0430\u0442\u0438\u043C\u0435" },
    file: { unit: "\u0431\u0430\u0439\u0442\u0456\u0432", verb: "\u043C\u0430\u0442\u0438\u043C\u0435" },
    array: { unit: "\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432", verb: "\u043C\u0430\u0442\u0438\u043C\u0435" },
    set: { unit: "\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432", verb: "\u043C\u0430\u0442\u0438\u043C\u0435" }
  };
  function getSizing(origin) {
    return Sizable[origin] ?? null;
  }
  const FormatDictionary = {
    regex: "\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456",
    email: "\u0430\u0434\u0440\u0435\u0441\u0430 \u0435\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0457 \u043F\u043E\u0448\u0442\u0438",
    url: "URL",
    emoji: "\u0435\u043C\u043E\u0434\u0437\u0456",
    uuid: "UUID",
    uuidv4: "UUIDv4",
    uuidv6: "UUIDv6",
    nanoid: "nanoid",
    guid: "GUID",
    cuid: "cuid",
    cuid2: "cuid2",
    ulid: "ULID",
    xid: "XID",
    ksuid: "KSUID",
    datetime: "\u0434\u0430\u0442\u0430 \u0442\u0430 \u0447\u0430\u0441 ISO",
    date: "\u0434\u0430\u0442\u0430 ISO",
    time: "\u0447\u0430\u0441 ISO",
    duration: "\u0442\u0440\u0438\u0432\u0430\u043B\u0456\u0441\u0442\u044C ISO",
    ipv4: "\u0430\u0434\u0440\u0435\u0441\u0430 IPv4",
    ipv6: "\u0430\u0434\u0440\u0435\u0441\u0430 IPv6",
    cidrv4: "\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv4",
    cidrv6: "\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv6",
    base64: "\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64",
    base64url: "\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64url",
    json_string: "\u0440\u044F\u0434\u043E\u043A JSON",
    e164: "\u043D\u043E\u043C\u0435\u0440 E.164",
    jwt: "JWT",
    template_literal: "\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"
  };
  const TypeDictionary = {
    nan: "NaN",
    number: "\u0447\u0438\u0441\u043B\u043E",
    array: "\u043C\u0430\u0441\u0438\u0432"
  };
  return (issue2) => {
    switch (issue2.code) {
      case "invalid_type": {
        const expected = TypeDictionary[issue2.expected] ?? issue2.expected;
        const receivedType = parsedType(issue2.input);
        const received = TypeDictionary[receivedType] ?? receivedType;
        if (/^[A-Z]/.test(issue2.expected)) {
          return `\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F instanceof ${issue2.expected}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${received}`;
        }
        return `\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${expected}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${received}`;
      }
      case "invalid_value":
        if (issue2.values.length === 1)
          return `\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${stringifyPrimitive(issue2.values[0])}`;
        return `\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0430 \u043E\u043F\u0446\u0456\u044F: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F \u043E\u0434\u043D\u0435 \u0437 ${joinValues(issue2.values, "|")}`;
      case "too_big": {
        const adj = issue2.inclusive ? "<=" : "<";
        const sizing = getSizing(issue2.origin);
        if (sizing)
          return `\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${issue2.origin ?? "\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} ${sizing.verb} ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432"}`;
        return `\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${issue2.origin ?? "\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} \u0431\u0443\u0434\u0435 ${adj}${issue2.maximum.toString()}`;
      }
      case "too_small": {
        const adj = issue2.inclusive ? ">=" : ">";
        const sizing = getSizing(issue2.origin);
        if (sizing) {
          return `\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${issue2.origin} ${sizing.verb} ${adj}${issue2.minimum.toString()} ${sizing.unit}`;
        }
        return `\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${issue2.origin} \u0431\u0443\u0434\u0435 ${adj}${issue2.minimum.toString()}`;
      }
      case "invalid_format": {
        const _issue = issue2;
        if (_issue.format === "starts_with")
          return `\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043F\u043E\u0447\u0438\u043D\u0430\u0442\u0438\u0441\u044F \u0437 "${_issue.prefix}"`;
        if (_issue.format === "ends_with")
          return `\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0437\u0430\u043A\u0456\u043D\u0447\u0443\u0432\u0430\u0442\u0438\u0441\u044F \u043D\u0430 "${_issue.suffix}"`;
        if (_issue.format === "includes")
          return `\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043C\u0456\u0441\u0442\u0438\u0442\u0438 "${_issue.includes}"`;
        if (_issue.format === "regex")
          return `\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u0442\u0438 \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${_issue.pattern}`;
        return `\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 ${FormatDictionary[_issue.format] ?? issue2.format}`;
      }
      case "not_multiple_of":
        return `\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0447\u0438\u0441\u043B\u043E: \u043F\u043E\u0432\u0438\u043D\u043D\u043E \u0431\u0443\u0442\u0438 \u043A\u0440\u0430\u0442\u043D\u0438\u043C ${issue2.divisor}`;
      case "unrecognized_keys":
        return `\u041D\u0435\u0440\u043E\u0437\u043F\u0456\u0437\u043D\u0430\u043D\u0438\u0439 \u043A\u043B\u044E\u0447${issue2.keys.length > 1 ? "\u0456" : ""}: ${joinValues(issue2.keys, ", ")}`;
      case "invalid_key":
        return `\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u043A\u043B\u044E\u0447 \u0443 ${issue2.origin}`;
      case "invalid_union":
        return "\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456";
      case "invalid_element":
        return `\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F \u0443 ${issue2.origin}`;
      default:
        return `\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456`;
    }
  };
};
function uk_default() {
  return {
    localeError: error41()
  };
}

// node_modules/zod/v4/locales/ua.js
function ua_default() {
  return uk_default();
}

// node_modules/zod/v4/locales/ur.js
var error42 = () => {
  const Sizable = {
    string: { unit: "\u062D\u0631\u0648\u0641", verb: "\u06C1\u0648\u0646\u0627" },
    file: { unit: "\u0628\u0627\u0626\u0679\u0633", verb: "\u06C1\u0648\u0646\u0627" },
    array: { unit: "\u0622\u0626\u0679\u0645\u0632", verb: "\u06C1\u0648\u0646\u0627" },
    set: { unit: "\u0622\u0626\u0679\u0645\u0632", verb: "\u06C1\u0648\u0646\u0627" }
  };
  function getSizing(origin) {
    return Sizable[origin] ?? null;
  }
  const FormatDictionary = {
    regex: "\u0627\u0646 \u067E\u0679",
    email: "\u0627\u06CC \u0645\u06CC\u0644 \u0627\u06CC\u0688\u0631\u06CC\u0633",
    url: "\u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644",
    emoji: "\u0627\u06CC\u0645\u0648\u062C\u06CC",
    uuid: "\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",
    uuidv4: "\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 4",
    uuidv6: "\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 6",
    nanoid: "\u0646\u06CC\u0646\u0648 \u0622\u0626\u06CC \u0688\u06CC",
    guid: "\u062C\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",
    cuid: "\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",
    cuid2: "\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC 2",
    ulid: "\u06CC\u0648 \u0627\u06CC\u0644 \u0622\u0626\u06CC \u0688\u06CC",
    xid: "\u0627\u06CC\u06A9\u0633 \u0622\u0626\u06CC \u0688\u06CC",
    ksuid: "\u06A9\u06D2 \u0627\u06CC\u0633 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",
    datetime: "\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0688\u06CC\u0679 \u0679\u0627\u0626\u0645",
    date: "\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u062A\u0627\u0631\u06CC\u062E",
    time: "\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0648\u0642\u062A",
    duration: "\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0645\u062F\u062A",
    ipv4: "\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0627\u06CC\u0688\u0631\u06CC\u0633",
    ipv6: "\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0627\u06CC\u0688\u0631\u06CC\u0633",
    cidrv4: "\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0631\u06CC\u0646\u062C",
    cidrv6: "\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0631\u06CC\u0646\u062C",
    base64: "\u0628\u06CC\u0633 64 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",
    base64url: "\u0628\u06CC\u0633 64 \u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",
    json_string: "\u062C\u06D2 \u0627\u06CC\u0633 \u0627\u0648 \u0627\u06CC\u0646 \u0633\u0679\u0631\u0646\u06AF",
    e164: "\u0627\u06CC 164 \u0646\u0645\u0628\u0631",
    jwt: "\u062C\u06D2 \u0688\u0628\u0644\u06CC\u0648 \u0679\u06CC",
    template_literal: "\u0627\u0646 \u067E\u0679"
  };
  const TypeDictionary = {
    nan: "NaN",
    number: "\u0646\u0645\u0628\u0631",
    array: "\u0622\u0631\u06D2",
    null: "\u0646\u0644"
  };
  return (issue2) => {
    switch (issue2.code) {
      case "invalid_type": {
        const expected = TypeDictionary[issue2.expected] ?? issue2.expected;
        const receivedType = parsedType(issue2.input);
        const received = TypeDictionary[receivedType] ?? receivedType;
        if (/^[A-Z]/.test(issue2.expected)) {
          return `\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: instanceof ${issue2.expected} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${received} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`;
        }
        return `\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${expected} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${received} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`;
      }
      case "invalid_value":
        if (issue2.values.length === 1)
          return `\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${stringifyPrimitive(issue2.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;
        return `\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${joinValues(issue2.values, "|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;
      case "too_big": {
        const adj = issue2.inclusive ? "<=" : "<";
        const sizing = getSizing(issue2.origin);
        if (sizing)
          return `\u0628\u06C1\u062A \u0628\u0691\u0627: ${issue2.origin ?? "\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "\u0639\u0646\u0627\u0635\u0631"} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`;
        return `\u0628\u06C1\u062A \u0628\u0691\u0627: ${issue2.origin ?? "\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u0627 ${adj}${issue2.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;
      }
      case "too_small": {
        const adj = issue2.inclusive ? ">=" : ">";
        const sizing = getSizing(issue2.origin);
        if (sizing) {
          return `\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${issue2.origin} \u06A9\u06D2 ${adj}${issue2.minimum.toString()} ${sizing.unit} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`;
        }
        return `\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${issue2.origin} \u06A9\u0627 ${adj}${issue2.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;
      }
      case "invalid_format": {
        const _issue = issue2;
        if (_issue.format === "starts_with") {
          return `\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${_issue.prefix}" \u0633\u06D2 \u0634\u0631\u0648\u0639 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;
        }
        if (_issue.format === "ends_with")
          return `\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${_issue.suffix}" \u067E\u0631 \u062E\u062A\u0645 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;
        if (_issue.format === "includes")
          return `\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${_issue.includes}" \u0634\u0627\u0645\u0644 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;
        if (_issue.format === "regex")
          return `\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: \u067E\u06CC\u0679\u0631\u0646 ${_issue.pattern} \u0633\u06D2 \u0645\u06CC\u0686 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;
        return `\u063A\u0644\u0637 ${FormatDictionary[_issue.format] ?? issue2.format}`;
      }
      case "not_multiple_of":
        return `\u063A\u0644\u0637 \u0646\u0645\u0628\u0631: ${issue2.divisor} \u06A9\u0627 \u0645\u0636\u0627\u0639\u0641 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;
      case "unrecognized_keys":
        return `\u063A\u06CC\u0631 \u062A\u0633\u0644\u06CC\u0645 \u0634\u062F\u06C1 \u06A9\u06CC${issue2.keys.length > 1 ? "\u0632" : ""}: ${joinValues(issue2.keys, "\u060C ")}`;
      case "invalid_key":
        return `${issue2.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u06A9\u06CC`;
      case "invalid_union":
        return "\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679";
      case "invalid_element":
        return `${issue2.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u0648\u06CC\u0644\u06CC\u0648`;
      default:
        return `\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679`;
    }
  };
};
function ur_default() {
  return {
    localeError: error42()
  };
}

// node_modules/zod/v4/locales/uz.js
var error43 = () => {
  const Sizable = {
    string: { unit: "belgi", verb: "bo\u2018lishi kerak" },
    file: { unit: "bayt", verb: "bo\u2018lishi kerak" },
    array: { unit: "element", verb: "bo\u2018lishi kerak" },
    set: { unit: "element", verb: "bo\u2018lishi kerak" }
  };
  function getSizing(origin) {
    return Sizable[origin] ?? null;
  }
  const FormatDictionary = {
    regex: "kirish",
    email: "elektron pochta manzili",
    url: "URL",
    emoji: "emoji",
    uuid: "UUID",
    uuidv4: "UUIDv4",
    uuidv6: "UUIDv6",
    nanoid: "nanoid",
    guid: "GUID",
    cuid: "cuid",
    cuid2: "cuid2",
    ulid: "ULID",
    xid: "XID",
    ksuid: "KSUID",
    datetime: "ISO sana va vaqti",
    date: "ISO sana",
    time: "ISO vaqt",
    duration: "ISO davomiylik",
    ipv4: "IPv4 manzil",
    ipv6: "IPv6 manzil",
    mac: "MAC manzil",
    cidrv4: "IPv4 diapazon",
    cidrv6: "IPv6 diapazon",
    base64: "base64 kodlangan satr",
    base64url: "base64url kodlangan satr",
    json_string: "JSON satr",
    e164: "E.164 raqam",
    jwt: "JWT",
    template_literal: "kirish"
  };
  const TypeDictionary = {
    nan: "NaN",
    number: "raqam",
    array: "massiv"
  };
  return (issue2) => {
    switch (issue2.code) {
      case "invalid_type": {
        const expected = TypeDictionary[issue2.expected] ?? issue2.expected;
        const receivedType = parsedType(issue2.input);
        const received = TypeDictionary[receivedType] ?? receivedType;
        if (/^[A-Z]/.test(issue2.expected)) {
          return `Noto\u2018g\u2018ri kirish: kutilgan instanceof ${issue2.expected}, qabul qilingan ${received}`;
        }
        return `Noto\u2018g\u2018ri kirish: kutilgan ${expected}, qabul qilingan ${received}`;
      }
      case "invalid_value":
        if (issue2.values.length === 1)
          return `Noto\u2018g\u2018ri kirish: kutilgan ${stringifyPrimitive(issue2.values[0])}`;
        return `Noto\u2018g\u2018ri variant: quyidagilardan biri kutilgan ${joinValues(issue2.values, "|")}`;
      case "too_big": {
        const adj = issue2.inclusive ? "<=" : "<";
        const sizing = getSizing(issue2.origin);
        if (sizing)
          return `Juda katta: kutilgan ${issue2.origin ?? "qiymat"} ${adj}${issue2.maximum.toString()} ${sizing.unit} ${sizing.verb}`;
        return `Juda katta: kutilgan ${issue2.origin ?? "qiymat"} ${adj}${issue2.maximum.toString()}`;
      }
      case "too_small": {
        const adj = issue2.inclusive ? ">=" : ">";
        const sizing = getSizing(issue2.origin);
        if (sizing) {
          return `Juda kichik: kutilgan ${issue2.origin} ${adj}${issue2.minimum.toString()} ${sizing.unit} ${sizing.verb}`;
        }
        return `Juda kichik: kutilgan ${issue2.origin} ${adj}${issue2.minimum.toString()}`;
      }
      case "invalid_format": {
        const _issue = issue2;
        if (_issue.format === "starts_with")
          return `Noto\u2018g\u2018ri satr: "${_issue.prefix}" bilan boshlanishi kerak`;
        if (_issue.format === "ends_with")
          return `Noto\u2018g\u2018ri satr: "${_issue.suffix}" bilan tugashi kerak`;
        if (_issue.format === "includes")
          return `Noto\u2018g\u2018ri satr: "${_issue.includes}" ni o\u2018z ichiga olishi kerak`;
        if (_issue.format === "regex")
          return `Noto\u2018g\u2018ri satr: ${_issue.pattern} shabloniga mos kelishi kerak`;
        return `Noto\u2018g\u2018ri ${FormatDictionary[_issue.format] ?? issue2.format}`;
      }
      case "not_multiple_of":
        return `Noto\u2018g\u2018ri raqam: ${issue2.divisor} ning karralisi bo\u2018lishi kerak`;
      case "unrecognized_keys":
        return `Noma\u2019lum kalit${issue2.keys.length > 1 ? "lar" : ""}: ${joinValues(issue2.keys, ", ")}`;
      case "invalid_key":
        return `${issue2.origin} dagi kalit noto\u2018g\u2018ri`;
      case "invalid_union":
        return "Noto\u2018g\u2018ri kirish";
      case "invalid_element":
        return `${issue2.origin} da noto\u2018g\u2018ri qiymat`;
      default:
        return `Noto\u2018g\u2018ri kirish`;
    }
  };
};
function uz_default() {
  return {
    localeError: error43()
  };
}

// node_modules/zod/v4/locales/vi.js
var error44 = () => {
  const Sizable = {
    string: { unit: "k\xFD t\u1EF1", verb: "c\xF3" },
    file: { unit: "byte", verb: "c\xF3" },
    array: { unit: "ph\u1EA7n t\u1EED", verb: "c\xF3" },
    set: { unit: "ph\u1EA7n t\u1EED", verb: "c\xF3" }
  };
  function getSizing(origin) {
    return Sizable[origin] ?? null;
  }
  const FormatDictionary = {
    regex: "\u0111\u1EA7u v\xE0o",
    email: "\u0111\u1ECBa ch\u1EC9 email",
    url: "URL",
    emoji: "emoji",
    uuid: "UUID",
    uuidv4: "UUIDv4",
    uuidv6: "UUIDv6",
    nanoid: "nanoid",
    guid: "GUID",
    cuid: "cuid",
    cuid2: "cuid2",
    ulid: "ULID",
    xid: "XID",
    ksuid: "KSUID",
    datetime: "ng\xE0y gi\u1EDD ISO",
    date: "ng\xE0y ISO",
    time: "gi\u1EDD ISO",
    duration: "kho\u1EA3ng th\u1EDDi gian ISO",
    ipv4: "\u0111\u1ECBa ch\u1EC9 IPv4",
    ipv6: "\u0111\u1ECBa ch\u1EC9 IPv6",
    cidrv4: "d\u1EA3i IPv4",
    cidrv6: "d\u1EA3i IPv6",
    base64: "chu\u1ED7i m\xE3 h\xF3a base64",
    base64url: "chu\u1ED7i m\xE3 h\xF3a base64url",
    json_string: "chu\u1ED7i JSON",
    e164: "s\u1ED1 E.164",
    jwt: "JWT",
    template_literal: "\u0111\u1EA7u v\xE0o"
  };
  const TypeDictionary = {
    nan: "NaN",
    number: "s\u1ED1",
    array: "m\u1EA3ng"
  };
  return (issue2) => {
    switch (issue2.code) {
      case "invalid_type": {
        const expected = TypeDictionary[issue2.expected] ?? issue2.expected;
        const receivedType = parsedType(issue2.input);
        const received = TypeDictionary[receivedType] ?? receivedType;
        if (/^[A-Z]/.test(issue2.expected)) {
          return `\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i instanceof ${issue2.expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${received}`;
        }
        return `\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${received}`;
      }
      case "invalid_value":
        if (issue2.values.length === 1)
          return `\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${stringifyPrimitive(issue2.values[0])}`;
        return `T\xF9y ch\u1ECDn kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i m\u1ED9t trong c\xE1c gi\xE1 tr\u1ECB ${joinValues(issue2.values, "|")}`;
      case "too_big": {
        const adj = issue2.inclusive ? "<=" : "<";
        const sizing = getSizing(issue2.origin);
        if (sizing)
          return `Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${issue2.origin ?? "gi\xE1 tr\u1ECB"} ${sizing.verb} ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "ph\u1EA7n t\u1EED"}`;
        return `Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${issue2.origin ?? "gi\xE1 tr\u1ECB"} ${adj}${issue2.maximum.toString()}`;
      }
      case "too_small": {
        const adj = issue2.inclusive ? ">=" : ">";
        const sizing = getSizing(issue2.origin);
        if (sizing) {
          return `Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${issue2.origin} ${sizing.verb} ${adj}${issue2.minimum.toString()} ${sizing.unit}`;
        }
        return `Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${issue2.origin} ${adj}${issue2.minimum.toString()}`;
      }
      case "invalid_format": {
        const _issue = issue2;
        if (_issue.format === "starts_with")
          return `Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i b\u1EAFt \u0111\u1EA7u b\u1EB1ng "${_issue.prefix}"`;
        if (_issue.format === "ends_with")
          return `Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i k\u1EBFt th\xFAc b\u1EB1ng "${_issue.suffix}"`;
        if (_issue.format === "includes")
          return `Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i bao g\u1ED3m "${_issue.includes}"`;
        if (_issue.format === "regex")
          return `Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i kh\u1EDBp v\u1EDBi m\u1EABu ${_issue.pattern}`;
        return `${FormatDictionary[_issue.format] ?? issue2.format} kh\xF4ng h\u1EE3p l\u1EC7`;
      }
      case "not_multiple_of":
        return `S\u1ED1 kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i l\xE0 b\u1ED9i s\u1ED1 c\u1EE7a ${issue2.divisor}`;
      case "unrecognized_keys":
        return `Kh\xF3a kh\xF4ng \u0111\u01B0\u1EE3c nh\u1EADn d\u1EA1ng: ${joinValues(issue2.keys, ", ")}`;
      case "invalid_key":
        return `Kh\xF3a kh\xF4ng h\u1EE3p l\u1EC7 trong ${issue2.origin}`;
      case "invalid_union":
        return "\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7";
      case "invalid_element":
        return `Gi\xE1 tr\u1ECB kh\xF4ng h\u1EE3p l\u1EC7 trong ${issue2.origin}`;
      default:
        return `\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7`;
    }
  };
};
function vi_default() {
  return {
    localeError: error44()
  };
}

// node_modules/zod/v4/locales/zh-CN.js
var error45 = () => {
  const Sizable = {
    string: { unit: "\u5B57\u7B26", verb: "\u5305\u542B" },
    file: { unit: "\u5B57\u8282", verb: "\u5305\u542B" },
    array: { unit: "\u9879", verb: "\u5305\u542B" },
    set: { unit: "\u9879", verb: "\u5305\u542B" }
  };
  function getSizing(origin) {
    return Sizable[origin] ?? null;
  }
  const FormatDictionary = {
    regex: "\u8F93\u5165",
    email: "\u7535\u5B50\u90AE\u4EF6",
    url: "URL",
    emoji: "\u8868\u60C5\u7B26\u53F7",
    uuid: "UUID",
    uuidv4: "UUIDv4",
    uuidv6: "UUIDv6",
    nanoid: "nanoid",
    guid: "GUID",
    cuid: "cuid",
    cuid2: "cuid2",
    ulid: "ULID",
    xid: "XID",
    ksuid: "KSUID",
    datetime: "ISO\u65E5\u671F\u65F6\u95F4",
    date: "ISO\u65E5\u671F",
    time: "ISO\u65F6\u95F4",
    duration: "ISO\u65F6\u957F",
    ipv4: "IPv4\u5730\u5740",
    ipv6: "IPv6\u5730\u5740",
    cidrv4: "IPv4\u7F51\u6BB5",
    cidrv6: "IPv6\u7F51\u6BB5",
    base64: "base64\u7F16\u7801\u5B57\u7B26\u4E32",
    base64url: "base64url\u7F16\u7801\u5B57\u7B26\u4E32",
    json_string: "JSON\u5B57\u7B26\u4E32",
    e164: "E.164\u53F7\u7801",
    jwt: "JWT",
    template_literal: "\u8F93\u5165"
  };
  const TypeDictionary = {
    nan: "NaN",
    number: "\u6570\u5B57",
    array: "\u6570\u7EC4",
    null: "\u7A7A\u503C(null)"
  };
  return (issue2) => {
    switch (issue2.code) {
      case "invalid_type": {
        const expected = TypeDictionary[issue2.expected] ?? issue2.expected;
        const receivedType = parsedType(issue2.input);
        const received = TypeDictionary[receivedType] ?? receivedType;
        if (/^[A-Z]/.test(issue2.expected)) {
          return `\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B instanceof ${issue2.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${received}`;
        }
        return `\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${received}`;
      }
      case "invalid_value":
        if (issue2.values.length === 1)
          return `\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${stringifyPrimitive(issue2.values[0])}`;
        return `\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${joinValues(issue2.values, "|")}`;
      case "too_big": {
        const adj = issue2.inclusive ? "<=" : "<";
        const sizing = getSizing(issue2.origin);
        if (sizing)
          return `\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${issue2.origin ?? "\u503C"} ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "\u4E2A\u5143\u7D20"}`;
        return `\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${issue2.origin ?? "\u503C"} ${adj}${issue2.maximum.toString()}`;
      }
      case "too_small": {
        const adj = issue2.inclusive ? ">=" : ">";
        const sizing = getSizing(issue2.origin);
        if (sizing) {
          return `\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${issue2.origin} ${adj}${issue2.minimum.toString()} ${sizing.unit}`;
        }
        return `\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${issue2.origin} ${adj}${issue2.minimum.toString()}`;
      }
      case "invalid_format": {
        const _issue = issue2;
        if (_issue.format === "starts_with")
          return `\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${_issue.prefix}" \u5F00\u5934`;
        if (_issue.format === "ends_with")
          return `\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${_issue.suffix}" \u7ED3\u5C3E`;
        if (_issue.format === "includes")
          return `\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u5305\u542B "${_issue.includes}"`;
        if (_issue.format === "regex")
          return `\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u6EE1\u8DB3\u6B63\u5219\u8868\u8FBE\u5F0F ${_issue.pattern}`;
        return `\u65E0\u6548${FormatDictionary[_issue.format] ?? issue2.format}`;
      }
      case "not_multiple_of":
        return `\u65E0\u6548\u6570\u5B57\uFF1A\u5FC5\u987B\u662F ${issue2.divisor} \u7684\u500D\u6570`;
      case "unrecognized_keys":
        return `\u51FA\u73B0\u672A\u77E5\u7684\u952E(key): ${joinValues(issue2.keys, ", ")}`;
      case "invalid_key":
        return `${issue2.origin} \u4E2D\u7684\u952E(key)\u65E0\u6548`;
      case "invalid_union":
        return "\u65E0\u6548\u8F93\u5165";
      case "invalid_element":
        return `${issue2.origin} \u4E2D\u5305\u542B\u65E0\u6548\u503C(value)`;
      default:
        return `\u65E0\u6548\u8F93\u5165`;
    }
  };
};
function zh_CN_default() {
  return {
    localeError: error45()
  };
}

// node_modules/zod/v4/locales/zh-TW.js
var error46 = () => {
  const Sizable = {
    string: { unit: "\u5B57\u5143", verb: "\u64C1\u6709" },
    file: { unit: "\u4F4D\u5143\u7D44", verb: "\u64C1\u6709" },
    array: { unit: "\u9805\u76EE", verb: "\u64C1\u6709" },
    set: { unit: "\u9805\u76EE", verb: "\u64C1\u6709" }
  };
  function getSizing(origin) {
    return Sizable[origin] ?? null;
  }
  const FormatDictionary = {
    regex: "\u8F38\u5165",
    email: "\u90F5\u4EF6\u5730\u5740",
    url: "URL",
    emoji: "emoji",
    uuid: "UUID",
    uuidv4: "UUIDv4",
    uuidv6: "UUIDv6",
    nanoid: "nanoid",
    guid: "GUID",
    cuid: "cuid",
    cuid2: "cuid2",
    ulid: "ULID",
    xid: "XID",
    ksuid: "KSUID",
    datetime: "ISO \u65E5\u671F\u6642\u9593",
    date: "ISO \u65E5\u671F",
    time: "ISO \u6642\u9593",
    duration: "ISO \u671F\u9593",
    ipv4: "IPv4 \u4F4D\u5740",
    ipv6: "IPv6 \u4F4D\u5740",
    cidrv4: "IPv4 \u7BC4\u570D",
    cidrv6: "IPv6 \u7BC4\u570D",
    base64: "base64 \u7DE8\u78BC\u5B57\u4E32",
    base64url: "base64url \u7DE8\u78BC\u5B57\u4E32",
    json_string: "JSON \u5B57\u4E32",
    e164: "E.164 \u6578\u503C",
    jwt: "JWT",
    template_literal: "\u8F38\u5165"
  };
  const TypeDictionary = {
    nan: "NaN"
  };
  return (issue2) => {
    switch (issue2.code) {
      case "invalid_type": {
        const expected = TypeDictionary[issue2.expected] ?? issue2.expected;
        const receivedType = parsedType(issue2.input);
        const received = TypeDictionary[receivedType] ?? receivedType;
        if (/^[A-Z]/.test(issue2.expected)) {
          return `\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA instanceof ${issue2.expected}\uFF0C\u4F46\u6536\u5230 ${received}`;
        }
        return `\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${expected}\uFF0C\u4F46\u6536\u5230 ${received}`;
      }
      case "invalid_value":
        if (issue2.values.length === 1)
          return `\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${stringifyPrimitive(issue2.values[0])}`;
        return `\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${joinValues(issue2.values, "|")}`;
      case "too_big": {
        const adj = issue2.inclusive ? "<=" : "<";
        const sizing = getSizing(issue2.origin);
        if (sizing)
          return `\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${issue2.origin ?? "\u503C"} \u61C9\u70BA ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "\u500B\u5143\u7D20"}`;
        return `\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${issue2.origin ?? "\u503C"} \u61C9\u70BA ${adj}${issue2.maximum.toString()}`;
      }
      case "too_small": {
        const adj = issue2.inclusive ? ">=" : ">";
        const sizing = getSizing(issue2.origin);
        if (sizing) {
          return `\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${issue2.origin} \u61C9\u70BA ${adj}${issue2.minimum.toString()} ${sizing.unit}`;
        }
        return `\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${issue2.origin} \u61C9\u70BA ${adj}${issue2.minimum.toString()}`;
      }
      case "invalid_format": {
        const _issue = issue2;
        if (_issue.format === "starts_with") {
          return `\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${_issue.prefix}" \u958B\u982D`;
        }
        if (_issue.format === "ends_with")
          return `\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${_issue.suffix}" \u7D50\u5C3E`;
        if (_issue.format === "includes")
          return `\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u5305\u542B "${_issue.includes}"`;
        if (_issue.format === "regex")
          return `\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u7B26\u5408\u683C\u5F0F ${_issue.pattern}`;
        return `\u7121\u6548\u7684 ${FormatDictionary[_issue.format] ?? issue2.format}`;
      }
      case "not_multiple_of":
        return `\u7121\u6548\u7684\u6578\u5B57\uFF1A\u5FC5\u9808\u70BA ${issue2.divisor} \u7684\u500D\u6578`;
      case "unrecognized_keys":
        return `\u7121\u6CD5\u8B58\u5225\u7684\u9375\u503C${issue2.keys.length > 1 ? "\u5011" : ""}\uFF1A${joinValues(issue2.keys, "\u3001")}`;
      case "invalid_key":
        return `${issue2.origin} \u4E2D\u6709\u7121\u6548\u7684\u9375\u503C`;
      case "invalid_union":
        return "\u7121\u6548\u7684\u8F38\u5165\u503C";
      case "invalid_element":
        return `${issue2.origin} \u4E2D\u6709\u7121\u6548\u7684\u503C`;
      default:
        return `\u7121\u6548\u7684\u8F38\u5165\u503C`;
    }
  };
};
function zh_TW_default() {
  return {
    localeError: error46()
  };
}

// node_modules/zod/v4/locales/yo.js
var error47 = () => {
  const Sizable = {
    string: { unit: "\xE0mi", verb: "n\xED" },
    file: { unit: "bytes", verb: "n\xED" },
    array: { unit: "nkan", verb: "n\xED" },
    set: { unit: "nkan", verb: "n\xED" }
  };
  function getSizing(origin) {
    return Sizable[origin] ?? null;
  }
  const FormatDictionary = {
    regex: "\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9",
    email: "\xE0d\xEDr\u1EB9\u0301s\xEC \xECm\u1EB9\u0301l\xEC",
    url: "URL",
    emoji: "emoji",
    uuid: "UUID",
    uuidv4: "UUIDv4",
    uuidv6: "UUIDv6",
    nanoid: "nanoid",
    guid: "GUID",
    cuid: "cuid",
    cuid2: "cuid2",
    ulid: "ULID",
    xid: "XID",
    ksuid: "KSUID",
    datetime: "\xE0k\xF3k\xF2 ISO",
    date: "\u1ECDj\u1ECD\u0301 ISO",
    time: "\xE0k\xF3k\xF2 ISO",
    duration: "\xE0k\xF3k\xF2 t\xF3 p\xE9 ISO",
    ipv4: "\xE0d\xEDr\u1EB9\u0301s\xEC IPv4",
    ipv6: "\xE0d\xEDr\u1EB9\u0301s\xEC IPv6",
    cidrv4: "\xE0gb\xE8gb\xE8 IPv4",
    cidrv6: "\xE0gb\xE8gb\xE8 IPv6",
    base64: "\u1ECD\u0300r\u1ECD\u0300 t\xED a k\u1ECD\u0301 n\xED base64",
    base64url: "\u1ECD\u0300r\u1ECD\u0300 base64url",
    json_string: "\u1ECD\u0300r\u1ECD\u0300 JSON",
    e164: "n\u1ECD\u0301mb\xE0 E.164",
    jwt: "JWT",
    template_literal: "\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9"
  };
  const TypeDictionary = {
    nan: "NaN",
    number: "n\u1ECD\u0301mb\xE0",
    array: "akop\u1ECD"
  };
  return (issue2) => {
    switch (issue2.code) {
      case "invalid_type": {
        const expected = TypeDictionary[issue2.expected] ?? issue2.expected;
        const receivedType = parsedType(issue2.input);
        const received = TypeDictionary[receivedType] ?? receivedType;
        if (/^[A-Z]/.test(issue2.expected)) {
          return `\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi instanceof ${issue2.expected}, \xE0m\u1ECD\u0300 a r\xED ${received}`;
        }
        return `\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${expected}, \xE0m\u1ECD\u0300 a r\xED ${received}`;
      }
      case "invalid_value":
        if (issue2.values.length === 1)
          return `\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${stringifyPrimitive(issue2.values[0])}`;
        return `\xC0\u1E63\xE0y\xE0n a\u1E63\xEC\u1E63e: yan \u1ECD\u0300kan l\xE1ra ${joinValues(issue2.values, "|")}`;
      case "too_big": {
        const adj = issue2.inclusive ? "<=" : "<";
        const sizing = getSizing(issue2.origin);
        if (sizing)
          return `T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${issue2.origin ?? "iye"} ${sizing.verb} ${adj}${issue2.maximum} ${sizing.unit}`;
        return `T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 ${adj}${issue2.maximum}`;
      }
      case "too_small": {
        const adj = issue2.inclusive ? ">=" : ">";
        const sizing = getSizing(issue2.origin);
        if (sizing)
          return `K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${issue2.origin} ${sizing.verb} ${adj}${issue2.minimum} ${sizing.unit}`;
        return `K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 ${adj}${issue2.minimum}`;
      }
      case "invalid_format": {
        const _issue = issue2;
        if (_issue.format === "starts_with")
          return `\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\u1EB9\u0300r\u1EB9\u0300 p\u1EB9\u0300l\xFA "${_issue.prefix}"`;
        if (_issue.format === "ends_with")
          return `\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 par\xED p\u1EB9\u0300l\xFA "${_issue.suffix}"`;
        if (_issue.format === "includes")
          return `\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 n\xED "${_issue.includes}"`;
        if (_issue.format === "regex")
          return `\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\xE1 \xE0p\u1EB9\u1EB9r\u1EB9 mu ${_issue.pattern}`;
        return `A\u1E63\xEC\u1E63e: ${FormatDictionary[_issue.format] ?? issue2.format}`;
      }
      case "not_multiple_of":
        return `N\u1ECD\u0301mb\xE0 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 j\u1EB9\u0301 \xE8y\xE0 p\xEDp\xEDn ti ${issue2.divisor}`;
      case "unrecognized_keys":
        return `B\u1ECDt\xECn\xEC \xE0\xECm\u1ECD\u0300: ${joinValues(issue2.keys, ", ")}`;
      case "invalid_key":
        return `B\u1ECDt\xECn\xEC a\u1E63\xEC\u1E63e n\xEDn\xFA ${issue2.origin}`;
      case "invalid_union":
        return "\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e";
      case "invalid_element":
        return `Iye a\u1E63\xEC\u1E63e n\xEDn\xFA ${issue2.origin}`;
      default:
        return "\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e";
    }
  };
};
function yo_default() {
  return {
    localeError: error47()
  };
}

// node_modules/zod/v4/core/registries.js
var _a;
var $output = Symbol("ZodOutput");
var $input = Symbol("ZodInput");
var $ZodRegistry = class {
  constructor() {
    this._map = /* @__PURE__ */ new WeakMap();
    this._idmap = /* @__PURE__ */ new Map();
  }
  add(schema, ..._meta) {
    const meta3 = _meta[0];
    this._map.set(schema, meta3);
    if (meta3 && typeof meta3 === "object" && "id" in meta3) {
      this._idmap.set(meta3.id, schema);
    }
    return this;
  }
  clear() {
    this._map = /* @__PURE__ */ new WeakMap();
    this._idmap = /* @__PURE__ */ new Map();
    return this;
  }
  remove(schema) {
    const meta3 = this._map.get(schema);
    if (meta3 && typeof meta3 === "object" && "id" in meta3) {
      this._idmap.delete(meta3.id);
    }
    this._map.delete(schema);
    return this;
  }
  get(schema) {
    const p = schema._zod.parent;
    if (p) {
      const pm = { ...this.get(p) ?? {} };
      delete pm.id;
      const f = { ...pm, ...this._map.get(schema) };
      return Object.keys(f).length ? f : void 0;
    }
    return this._map.get(schema);
  }
  has(schema) {
    return this._map.has(schema);
  }
};
function registry() {
  return new $ZodRegistry();
}
(_a = globalThis).__zod_globalRegistry ?? (_a.__zod_globalRegistry = registry());
var globalRegistry = globalThis.__zod_globalRegistry;

// node_modules/zod/v4/core/api.js
// @__NO_SIDE_EFFECTS__
function _string(Class2, params) {
  return new Class2({
    type: "string",
    ...normalizeParams(params)
  });
}
// @__NO_SIDE_EFFECTS__
function _coercedString(Class2, params) {
  return new Class2({
    type: "string",
    coerce: true,
    ...normalizeParams(params)
  });
}
// @__NO_SIDE_EFFECTS__
function _email(Class2, params) {
  return new Class2({
    type: "string",
    format: "email",
    check: "string_format",
    abort: false,
    ...normalizeParams(params)
  });
}
// @__NO_SIDE_EFFECTS__
function _guid(Class2, params) {
  return new Class2({
    type: "string",
    format: "guid",
    check: "string_format",
    abort: false,
    ...normalizeParams(params)
  });
}
// @__NO_SIDE_EFFECTS__
function _uuid(Class2, params) {
  return new Class2({
    type: "string",
    format: "uuid",
    check: "string_format",
    abort: false,
    ...normalizeParams(params)
  });
}
// @__NO_SIDE_EFFECTS__
function _uuidv4(Class2, params) {
  return new Class2({
    type: "string",
    format: "uuid",
    check: "string_format",
    abort: false,
    version: "v4",
    ...normalizeParams(params)
  });
}
// @__NO_SIDE_EFFECTS__
function _uuidv6(Class2, params) {
  return new Class2({
    type: "string",
    format: "uuid",
    check: "string_format",
    abort: false,
    version: "v6",
    ...normalizeParams(params)
  });
}
// @__NO_SIDE_EFFECTS__
function _uuidv7(Class2, params) {
  return new Class2({
    type: "string",
    format: "uuid",
    check: "string_format",
    abort: false,
    version: "v7",
    ...normalizeParams(params)
  });
}
// @__NO_SIDE_EFFECTS__
function _url(Class2, params) {
  return new Class2({
    type: "string",
    format: "url",
    check: "string_format",
    abort: false,
    ...normalizeParams(params)
  });
}
// @__NO_SIDE_EFFECTS__
function _emoji2(Class2, params) {
  return new Class2({
    type: "string",
    format: "emoji",
    check: "string_format",
    abort: false,
    ...normalizeParams(params)
  });
}
// @__NO_SIDE_EFFECTS__
function _nanoid(Class2, params) {
  return new Class2({
    type: "string",
    format: "nanoid",
    check: "string_format",
    abort: false,
    ...normalizeParams(params)
  });
}
// @__NO_SIDE_EFFECTS__
function _cuid(Class2, params) {
  return new Class2({
    type: "string",
    format: "cuid",
    check: "string_format",
    abort: false,
    ...normalizeParams(params)
  });
}
// @__NO_SIDE_EFFECTS__
function _cuid2(Class2, params) {
  return new Class2({
    type: "string",
    format: "cuid2",
    check: "string_format",
    abort: false,
    ...normalizeParams(params)
  });
}
// @__NO_SIDE_EFFECTS__
function _ulid(Class2, params) {
  return new Class2({
    type: "string",
    format: "ulid",
    check: "string_format",
    abort: false,
    ...normalizeParams(params)
  });
}
// @__NO_SIDE_EFFECTS__
function _xid(Class2, params) {
  return new Class2({
    type: "string",
    format: "xid",
    check: "string_format",
    abort: false,
    ...normalizeParams(params)
  });
}
// @__NO_SIDE_EFFECTS__
function _ksuid(Class2, params) {
  return new Class2({
    type: "string",
    format: "ksuid",
    check: "string_format",
    abort: false,
    ...normalizeParams(params)
  });
}
// @__NO_SIDE_EFFECTS__
function _ipv4(Class2, params) {
  return new Class2({
    type: "string",
    format: "ipv4",
    check: "string_format",
    abort: false,
    ...normalizeParams(params)
  });
}
// @__NO_SIDE_EFFECTS__
function _ipv6(Class2, params) {
  return new Class2({
    type: "string",
    format: "ipv6",
    check: "string_format",
    abort: false,
    ...normalizeParams(params)
  });
}
// @__NO_SIDE_EFFECTS__
function _mac(Class2, params) {
  return new Class2({
    type: "string",
    format: "mac",
    check: "string_format",
    abort: false,
    ...normalizeParams(params)
  });
}
// @__NO_SIDE_EFFECTS__
function _cidrv4(Class2, params) {
  return new Class2({
    type: "string",
    format: "cidrv4",
    check: "string_format",
    abort: false,
    ...normalizeParams(params)
  });
}
// @__NO_SIDE_EFFECTS__
function _cidrv6(Class2, params) {
  return new Class2({
    type: "string",
    format: "cidrv6",
    check: "string_format",
    abort: false,
    ...normalizeParams(params)
  });
}
// @__NO_SIDE_EFFECTS__
function _base64(Class2, params) {
  return new Class2({
    type: "string",
    format: "base64",
    check: "string_format",
    abort: false,
    ...normalizeParams(params)
  });
}
// @__NO_SIDE_EFFECTS__
function _base64url(Class2, params) {
  return new Class2({
    type: "string",
    format: "base64url",
    check: "string_format",
    abort: false,
    ...normalizeParams(params)
  });
}
// @__NO_SIDE_EFFECTS__
function _e164(Class2, params) {
  return new Class2({
    type: "string",
    format: "e164",
    check: "string_format",
    abort: false,
    ...normalizeParams(params)
  });
}
// @__NO_SIDE_EFFECTS__
function _jwt(Class2, params) {
  return new Class2({
    type: "string",
    format: "jwt",
    check: "string_format",
    abort: false,
    ...normalizeParams(params)
  });
}
var TimePrecision = {
  Any: null,
  Minute: -1,
  Second: 0,
  Millisecond: 3,
  Microsecond: 6
};
// @__NO_SIDE_EFFECTS__
function _isoDateTime(Class2, params) {
  return new Class2({
    type: "string",
    format: "datetime",
    check: "string_format",
    offset: false,
    local: false,
    precision: null,
    ...normalizeParams(params)
  });
}
// @__NO_SIDE_EFFECTS__
function _isoDate(Class2, params) {
  return new Class2({
    type: "string",
    format: "date",
    check: "string_format",
    ...normalizeParams(params)
  });
}
// @__NO_SIDE_EFFECTS__
function _isoTime(Class2, params) {
  return new Class2({
    type: "string",
    format: "time",
    check: "string_format",
    precision: null,
    ...normalizeParams(params)
  });
}
// @__NO_SIDE_EFFECTS__
function _isoDuration(Class2, params) {
  return new Class2({
    type: "string",
    format: "duration",
    check: "string_format",
    ...normalizeParams(params)
  });
}
// @__NO_SIDE_EFFECTS__
function _number(Class2, params) {
  return new Class2({
    type: "number",
    checks: [],
    ...normalizeParams(params)
  });
}
// @__NO_SIDE_EFFECTS__
function _coercedNumber(Class2, params) {
  return new Class2({
    type: "number",
    coerce: true,
    checks: [],
    ...normalizeParams(params)
  });
}
// @__NO_SIDE_EFFECTS__
function _int(Class2, params) {
  return new Class2({
    type: "number",
    check: "number_format",
    abort: false,
    format: "safeint",
    ...normalizeParams(params)
  });
}
// @__NO_SIDE_EFFECTS__
function _float32(Class2, params) {
  return new Class2({
    type: "number",
    check: "number_format",
    abort: false,
    format: "float32",
    ...normalizeParams(params)
  });
}
// @__NO_SIDE_EFFECTS__
function _float64(Class2, params) {
  return new Class2({
    type: "number",
    check: "number_format",
    abort: false,
    format: "float64",
    ...normalizeParams(params)
  });
}
// @__NO_SIDE_EFFECTS__
function _int32(Class2, params) {
  return new Class2({
    type: "number",
    check: "number_format",
    abort: false,
    format: "int32",
    ...normalizeParams(params)
  });
}
// @__NO_SIDE_EFFECTS__
function _uint32(Class2, params) {
  return new Class2({
    type: "number",
    check: "number_format",
    abort: false,
    format: "uint32",
    ...normalizeParams(params)
  });
}
// @__NO_SIDE_EFFECTS__
function _boolean(Class2, params) {
  return new Class2({
    type: "boolean",
    ...normalizeParams(params)
  });
}
// @__NO_SIDE_EFFECTS__
function _coercedBoolean(Class2, params) {
  return new Class2({
    type: "boolean",
    coerce: true,
    ...normalizeParams(params)
  });
}
// @__NO_SIDE_EFFECTS__
function _bigint(Class2, params) {
  return new Class2({
    type: "bigint",
    ...normalizeParams(params)
  });
}
// @__NO_SIDE_EFFECTS__
function _coercedBigint(Class2, params) {
  return new Class2({
    type: "bigint",
    coerce: true,
    ...normalizeParams(params)
  });
}
// @__NO_SIDE_EFFECTS__
function _int64(Class2, params) {
  return new Class2({
    type: "bigint",
    check: "bigint_format",
    abort: false,
    format: "int64",
    ...normalizeParams(params)
  });
}
// @__NO_SIDE_EFFECTS__
function _uint64(Class2, params) {
  return new Class2({
    type: "bigint",
    check: "bigint_format",
    abort: false,
    format: "uint64",
    ...normalizeParams(params)
  });
}
// @__NO_SIDE_EFFECTS__
function _symbol(Class2, params) {
  return new Class2({
    type: "symbol",
    ...normalizeParams(params)
  });
}
// @__NO_SIDE_EFFECTS__
function _undefined2(Class2, params) {
  return new Class2({
    type: "undefined",
    ...normalizeParams(params)
  });
}
// @__NO_SIDE_EFFECTS__
function _null2(Class2, params) {
  return new Class2({
    type: "null",
    ...normalizeParams(params)
  });
}
// @__NO_SIDE_EFFECTS__
function _any(Class2) {
  return new Class2({
    type: "any"
  });
}
// @__NO_SIDE_EFFECTS__
function _unknown(Class2) {
  return new Class2({
    type: "unknown"
  });
}
// @__NO_SIDE_EFFECTS__
function _never(Class2, params) {
  return new Class2({
    type: "never",
    ...normalizeParams(params)
  });
}
// @__NO_SIDE_EFFECTS__
function _void(Class2, params) {
  return new Class2({
    type: "void",
    ...normalizeParams(params)
  });
}
// @__NO_SIDE_EFFECTS__
function _date(Class2, params) {
  return new Class2({
    type: "date",
    ...normalizeParams(params)
  });
}
// @__NO_SIDE_EFFECTS__
function _coercedDate(Class2, params) {
  return new Class2({
    type: "date",
    coerce: true,
    ...normalizeParams(params)
  });
}
// @__NO_SIDE_EFFECTS__
function _nan(Class2, params) {
  return new Class2({
    type: "nan",
    ...normalizeParams(params)
  });
}
// @__NO_SIDE_EFFECTS__
function _lt(value, params) {
  return new $ZodCheckLessThan({
    check: "less_than",
    ...normalizeParams(params),
    value,
    inclusive: false
  });
}
// @__NO_SIDE_EFFECTS__
function _lte(value, params) {
  return new $ZodCheckLessThan({
    check: "less_than",
    ...normalizeParams(params),
    value,
    inclusive: true
  });
}
// @__NO_SIDE_EFFECTS__
function _gt(value, params) {
  return new $ZodCheckGreaterThan({
    check: "greater_than",
    ...normalizeParams(params),
    value,
    inclusive: false
  });
}
// @__NO_SIDE_EFFECTS__
function _gte(value, params) {
  return new $ZodCheckGreaterThan({
    check: "greater_than",
    ...normalizeParams(params),
    value,
    inclusive: true
  });
}
// @__NO_SIDE_EFFECTS__
function _positive(params) {
  return /* @__PURE__ */ _gt(0, params);
}
// @__NO_SIDE_EFFECTS__
function _negative(params) {
  return /* @__PURE__ */ _lt(0, params);
}
// @__NO_SIDE_EFFECTS__
function _nonpositive(params) {
  return /* @__PURE__ */ _lte(0, params);
}
// @__NO_SIDE_EFFECTS__
function _nonnegative(params) {
  return /* @__PURE__ */ _gte(0, params);
}
// @__NO_SIDE_EFFECTS__
function _multipleOf(value, params) {
  return new $ZodCheckMultipleOf({
    check: "multiple_of",
    ...normalizeParams(params),
    value
  });
}
// @__NO_SIDE_EFFECTS__
function _maxSize(maximum, params) {
  return new $ZodCheckMaxSize({
    check: "max_size",
    ...normalizeParams(params),
    maximum
  });
}
// @__NO_SIDE_EFFECTS__
function _minSize(minimum, params) {
  return new $ZodCheckMinSize({
    check: "min_size",
    ...normalizeParams(params),
    minimum
  });
}
// @__NO_SIDE_EFFECTS__
function _size(size, params) {
  return new $ZodCheckSizeEquals({
    check: "size_equals",
    ...normalizeParams(params),
    size
  });
}
// @__NO_SIDE_EFFECTS__
function _maxLength(maximum, params) {
  const ch = new $ZodCheckMaxLength({
    check: "max_length",
    ...normalizeParams(params),
    maximum
  });
  return ch;
}
// @__NO_SIDE_EFFECTS__
function _minLength(minimum, params) {
  return new $ZodCheckMinLength({
    check: "min_length",
    ...normalizeParams(params),
    minimum
  });
}
// @__NO_SIDE_EFFECTS__
function _length(length, params) {
  return new $ZodCheckLengthEquals({
    check: "length_equals",
    ...normalizeParams(params),
    length
  });
}
// @__NO_SIDE_EFFECTS__
function _regex(pattern, params) {
  return new $ZodCheckRegex({
    check: "string_format",
    format: "regex",
    ...normalizeParams(params),
    pattern
  });
}
// @__NO_SIDE_EFFECTS__
function _lowercase(params) {
  return new $ZodCheckLowerCase({
    check: "string_format",
    format: "lowercase",
    ...normalizeParams(params)
  });
}
// @__NO_SIDE_EFFECTS__
function _uppercase(params) {
  return new $ZodCheckUpperCase({
    check: "string_format",
    format: "uppercase",
    ...normalizeParams(params)
  });
}
// @__NO_SIDE_EFFECTS__
function _includes(includes, params) {
  return new $ZodCheckIncludes({
    check: "string_format",
    format: "includes",
    ...normalizeParams(params),
    includes
  });
}
// @__NO_SIDE_EFFECTS__
function _startsWith(prefix, params) {
  return new $ZodCheckStartsWith({
    check: "string_format",
    format: "starts_with",
    ...normalizeParams(params),
    prefix
  });
}
// @__NO_SIDE_EFFECTS__
function _endsWith(suffix, params) {
  return new $ZodCheckEndsWith({
    check: "string_format",
    format: "ends_with",
    ...normalizeParams(params),
    suffix
  });
}
// @__NO_SIDE_EFFECTS__
function _property(property, schema, params) {
  return new $ZodCheckProperty({
    check: "property",
    property,
    schema,
    ...normalizeParams(params)
  });
}
// @__NO_SIDE_EFFECTS__
function _mime(types, params) {
  return new $ZodCheckMimeType({
    check: "mime_type",
    mime: types,
    ...normalizeParams(params)
  });
}
// @__NO_SIDE_EFFECTS__
function _overwrite(tx) {
  return new $ZodCheckOverwrite({
    check: "overwrite",
    tx
  });
}
// @__NO_SIDE_EFFECTS__
function _normalize(form) {
  return /* @__PURE__ */ _overwrite((input) => input.normalize(form));
}
// @__NO_SIDE_EFFECTS__
function _trim() {
  return /* @__PURE__ */ _overwrite((input) => input.trim());
}
// @__NO_SIDE_EFFECTS__
function _toLowerCase() {
  return /* @__PURE__ */ _overwrite((input) => input.toLowerCase());
}
// @__NO_SIDE_EFFECTS__
function _toUpperCase() {
  return /* @__PURE__ */ _overwrite((input) => input.toUpperCase());
}
// @__NO_SIDE_EFFECTS__
function _slugify() {
  return /* @__PURE__ */ _overwrite((input) => slugify(input));
}
// @__NO_SIDE_EFFECTS__
function _array(Class2, element, params) {
  return new Class2({
    type: "array",
    element,
    // get element() {
    //   return element;
    // },
    ...normalizeParams(params)
  });
}
// @__NO_SIDE_EFFECTS__
function _union(Class2, options2, params) {
  return new Class2({
    type: "union",
    options: options2,
    ...normalizeParams(params)
  });
}
function _xor(Class2, options2, params) {
  return new Class2({
    type: "union",
    options: options2,
    inclusive: false,
    ...normalizeParams(params)
  });
}
// @__NO_SIDE_EFFECTS__
function _discriminatedUnion(Class2, discriminator, options2, params) {
  return new Class2({
    type: "union",
    options: options2,
    discriminator,
    ...normalizeParams(params)
  });
}
// @__NO_SIDE_EFFECTS__
function _intersection(Class2, left, right) {
  return new Class2({
    type: "intersection",
    left,
    right
  });
}
// @__NO_SIDE_EFFECTS__
function _tuple(Class2, items, _paramsOrRest, _params) {
  const hasRest = _paramsOrRest instanceof $ZodType;
  const params = hasRest ? _params : _paramsOrRest;
  const rest = hasRest ? _paramsOrRest : null;
  return new Class2({
    type: "tuple",
    items,
    rest,
    ...normalizeParams(params)
  });
}
// @__NO_SIDE_EFFECTS__
function _record(Class2, keyType, valueType, params) {
  return new Class2({
    type: "record",
    keyType,
    valueType,
    ...normalizeParams(params)
  });
}
// @__NO_SIDE_EFFECTS__
function _map(Class2, keyType, valueType, params) {
  return new Class2({
    type: "map",
    keyType,
    valueType,
    ...normalizeParams(params)
  });
}
// @__NO_SIDE_EFFECTS__
function _set(Class2, valueType, params) {
  return new Class2({
    type: "set",
    valueType,
    ...normalizeParams(params)
  });
}
// @__NO_SIDE_EFFECTS__
function _enum(Class2, values, params) {
  const entries = Array.isArray(values) ? Object.fromEntries(values.map((v) => [v, v])) : values;
  return new Class2({
    type: "enum",
    entries,
    ...normalizeParams(params)
  });
}
// @__NO_SIDE_EFFECTS__
function _nativeEnum(Class2, entries, params) {
  return new Class2({
    type: "enum",
    entries,
    ...normalizeParams(params)
  });
}
// @__NO_SIDE_EFFECTS__
function _literal(Class2, value, params) {
  return new Class2({
    type: "literal",
    values: Array.isArray(value) ? value : [value],
    ...normalizeParams(params)
  });
}
// @__NO_SIDE_EFFECTS__
function _file(Class2, params) {
  return new Class2({
    type: "file",
    ...normalizeParams(params)
  });
}
// @__NO_SIDE_EFFECTS__
function _transform(Class2, fn) {
  return new Class2({
    type: "transform",
    transform: fn
  });
}
// @__NO_SIDE_EFFECTS__
function _optional(Class2, innerType) {
  return new Class2({
    type: "optional",
    innerType
  });
}
// @__NO_SIDE_EFFECTS__
function _nullable(Class2, innerType) {
  return new Class2({
    type: "nullable",
    innerType
  });
}
// @__NO_SIDE_EFFECTS__
function _default(Class2, innerType, defaultValue) {
  return new Class2({
    type: "default",
    innerType,
    get defaultValue() {
      return typeof defaultValue === "function" ? defaultValue() : shallowClone(defaultValue);
    }
  });
}
// @__NO_SIDE_EFFECTS__
function _nonoptional(Class2, innerType, params) {
  return new Class2({
    type: "nonoptional",
    innerType,
    ...normalizeParams(params)
  });
}
// @__NO_SIDE_EFFECTS__
function _success(Class2, innerType) {
  return new Class2({
    type: "success",
    innerType
  });
}
// @__NO_SIDE_EFFECTS__
function _catch(Class2, innerType, catchValue) {
  return new Class2({
    type: "catch",
    innerType,
    catchValue: typeof catchValue === "function" ? catchValue : () => catchValue
  });
}
// @__NO_SIDE_EFFECTS__
function _pipe(Class2, in_, out) {
  return new Class2({
    type: "pipe",
    in: in_,
    out
  });
}
// @__NO_SIDE_EFFECTS__
function _readonly(Class2, innerType) {
  return new Class2({
    type: "readonly",
    innerType
  });
}
// @__NO_SIDE_EFFECTS__
function _templateLiteral(Class2, parts, params) {
  return new Class2({
    type: "template_literal",
    parts,
    ...normalizeParams(params)
  });
}
// @__NO_SIDE_EFFECTS__
function _lazy(Class2, getter) {
  return new Class2({
    type: "lazy",
    getter
  });
}
// @__NO_SIDE_EFFECTS__
function _promise(Class2, innerType) {
  return new Class2({
    type: "promise",
    innerType
  });
}
// @__NO_SIDE_EFFECTS__
function _custom(Class2, fn, _params) {
  const norm = normalizeParams(_params);
  norm.abort ?? (norm.abort = true);
  const schema = new Class2({
    type: "custom",
    check: "custom",
    fn,
    ...norm
  });
  return schema;
}
// @__NO_SIDE_EFFECTS__
function _refine(Class2, fn, _params) {
  const schema = new Class2({
    type: "custom",
    check: "custom",
    fn,
    ...normalizeParams(_params)
  });
  return schema;
}
// @__NO_SIDE_EFFECTS__
function _superRefine(fn) {
  const ch = /* @__PURE__ */ _check((payload) => {
    payload.addIssue = (issue2) => {
      if (typeof issue2 === "string") {
        payload.issues.push(issue(issue2, payload.value, ch._zod.def));
      } else {
        const _issue = issue2;
        if (_issue.fatal)
          _issue.continue = false;
        _issue.code ?? (_issue.code = "custom");
        _issue.input ?? (_issue.input = payload.value);
        _issue.inst ?? (_issue.inst = ch);
        _issue.continue ?? (_issue.continue = !ch._zod.def.abort);
        payload.issues.push(issue(_issue));
      }
    };
    return fn(payload.value, payload);
  });
  return ch;
}
// @__NO_SIDE_EFFECTS__
function _check(fn, params) {
  const ch = new $ZodCheck({
    check: "custom",
    ...normalizeParams(params)
  });
  ch._zod.check = fn;
  return ch;
}
// @__NO_SIDE_EFFECTS__
function describe(description) {
  const ch = new $ZodCheck({ check: "describe" });
  ch._zod.onattach = [
    (inst) => {
      const existing = globalRegistry.get(inst) ?? {};
      globalRegistry.add(inst, { ...existing, description });
    }
  ];
  ch._zod.check = () => {
  };
  return ch;
}
// @__NO_SIDE_EFFECTS__
function meta(metadata) {
  const ch = new $ZodCheck({ check: "meta" });
  ch._zod.onattach = [
    (inst) => {
      const existing = globalRegistry.get(inst) ?? {};
      globalRegistry.add(inst, { ...existing, ...metadata });
    }
  ];
  ch._zod.check = () => {
  };
  return ch;
}
// @__NO_SIDE_EFFECTS__
function _stringbool(Classes, _params) {
  const params = normalizeParams(_params);
  let truthyArray = params.truthy ?? ["true", "1", "yes", "on", "y", "enabled"];
  let falsyArray = params.falsy ?? ["false", "0", "no", "off", "n", "disabled"];
  if (params.case !== "sensitive") {
    truthyArray = truthyArray.map((v) => typeof v === "string" ? v.toLowerCase() : v);
    falsyArray = falsyArray.map((v) => typeof v === "string" ? v.toLowerCase() : v);
  }
  const truthySet = new Set(truthyArray);
  const falsySet = new Set(falsyArray);
  const _Codec = Classes.Codec ?? $ZodCodec;
  const _Boolean = Classes.Boolean ?? $ZodBoolean;
  const _String = Classes.String ?? $ZodString;
  const stringSchema = new _String({ type: "string", error: params.error });
  const booleanSchema = new _Boolean({ type: "boolean", error: params.error });
  const codec2 = new _Codec({
    type: "pipe",
    in: stringSchema,
    out: booleanSchema,
    transform: ((input, payload) => {
      let data = input;
      if (params.case !== "sensitive")
        data = data.toLowerCase();
      if (truthySet.has(data)) {
        return true;
      } else if (falsySet.has(data)) {
        return false;
      } else {
        payload.issues.push({
          code: "invalid_value",
          expected: "stringbool",
          values: [...truthySet, ...falsySet],
          input: payload.value,
          inst: codec2,
          continue: false
        });
        return {};
      }
    }),
    reverseTransform: ((input, _payload) => {
      if (input === true) {
        return truthyArray[0] || "true";
      } else {
        return falsyArray[0] || "false";
      }
    }),
    error: params.error
  });
  return codec2;
}
// @__NO_SIDE_EFFECTS__
function _stringFormat(Class2, format, fnOrRegex, _params = {}) {
  const params = normalizeParams(_params);
  const def = {
    ...normalizeParams(_params),
    check: "string_format",
    type: "string",
    format,
    fn: typeof fnOrRegex === "function" ? fnOrRegex : (val) => fnOrRegex.test(val),
    ...params
  };
  if (fnOrRegex instanceof RegExp) {
    def.pattern = fnOrRegex;
  }
  const inst = new Class2(def);
  return inst;
}

// node_modules/zod/v4/core/to-json-schema.js
function initializeContext(params) {
  let target = params?.target ?? "draft-2020-12";
  if (target === "draft-4")
    target = "draft-04";
  if (target === "draft-7")
    target = "draft-07";
  return {
    processors: params.processors ?? {},
    metadataRegistry: params?.metadata ?? globalRegistry,
    target,
    unrepresentable: params?.unrepresentable ?? "throw",
    override: params?.override ?? (() => {
    }),
    io: params?.io ?? "output",
    counter: 0,
    seen: /* @__PURE__ */ new Map(),
    cycles: params?.cycles ?? "ref",
    reused: params?.reused ?? "inline",
    external: params?.external ?? void 0
  };
}
function process2(schema, ctx, _params = { path: [], schemaPath: [] }) {
  var _a2;
  const def = schema._zod.def;
  const seen = ctx.seen.get(schema);
  if (seen) {
    seen.count++;
    const isCycle = _params.schemaPath.includes(schema);
    if (isCycle) {
      seen.cycle = _params.path;
    }
    return seen.schema;
  }
  const result = { schema: {}, count: 1, cycle: void 0, path: _params.path };
  ctx.seen.set(schema, result);
  const overrideSchema = schema._zod.toJSONSchema?.();
  if (overrideSchema) {
    result.schema = overrideSchema;
  } else {
    const params = {
      ..._params,
      schemaPath: [..._params.schemaPath, schema],
      path: _params.path
    };
    if (schema._zod.processJSONSchema) {
      schema._zod.processJSONSchema(ctx, result.schema, params);
    } else {
      const _json = result.schema;
      const processor = ctx.processors[def.type];
      if (!processor) {
        throw new Error(`[toJSONSchema]: Non-representable type encountered: ${def.type}`);
      }
      processor(schema, ctx, _json, params);
    }
    const parent = schema._zod.parent;
    if (parent) {
      if (!result.ref)
        result.ref = parent;
      process2(parent, ctx, params);
      ctx.seen.get(parent).isParent = true;
    }
  }
  const meta3 = ctx.metadataRegistry.get(schema);
  if (meta3)
    Object.assign(result.schema, meta3);
  if (ctx.io === "input" && isTransforming(schema)) {
    delete result.schema.examples;
    delete result.schema.default;
  }
  if (ctx.io === "input" && result.schema._prefault)
    (_a2 = result.schema).default ?? (_a2.default = result.schema._prefault);
  delete result.schema._prefault;
  const _result = ctx.seen.get(schema);
  return _result.schema;
}
function extractDefs(ctx, schema) {
  const root = ctx.seen.get(schema);
  if (!root)
    throw new Error("Unprocessed schema. This is a bug in Zod.");
  const idToSchema = /* @__PURE__ */ new Map();
  for (const entry of ctx.seen.entries()) {
    const id = ctx.metadataRegistry.get(entry[0])?.id;
    if (id) {
      const existing = idToSchema.get(id);
      if (existing && existing !== entry[0]) {
        throw new Error(`Duplicate schema id "${id}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);
      }
      idToSchema.set(id, entry[0]);
    }
  }
  const makeURI = (entry) => {
    const defsSegment = ctx.target === "draft-2020-12" ? "$defs" : "definitions";
    if (ctx.external) {
      const externalId = ctx.external.registry.get(entry[0])?.id;
      const uriGenerator = ctx.external.uri ?? ((id2) => id2);
      if (externalId) {
        return { ref: uriGenerator(externalId) };
      }
      const id = entry[1].defId ?? entry[1].schema.id ?? `schema${ctx.counter++}`;
      entry[1].defId = id;
      return { defId: id, ref: `${uriGenerator("__shared")}#/${defsSegment}/${id}` };
    }
    if (entry[1] === root) {
      return { ref: "#" };
    }
    const uriPrefix = `#`;
    const defUriPrefix = `${uriPrefix}/${defsSegment}/`;
    const defId = entry[1].schema.id ?? `__schema${ctx.counter++}`;
    return { defId, ref: defUriPrefix + defId };
  };
  const extractToDef = (entry) => {
    if (entry[1].schema.$ref) {
      return;
    }
    const seen = entry[1];
    const { ref, defId } = makeURI(entry);
    seen.def = { ...seen.schema };
    if (defId)
      seen.defId = defId;
    const schema2 = seen.schema;
    for (const key in schema2) {
      delete schema2[key];
    }
    schema2.$ref = ref;
  };
  if (ctx.cycles === "throw") {
    for (const entry of ctx.seen.entries()) {
      const seen = entry[1];
      if (seen.cycle) {
        throw new Error(`Cycle detected: #/${seen.cycle?.join("/")}/<root>

Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`);
      }
    }
  }
  for (const entry of ctx.seen.entries()) {
    const seen = entry[1];
    if (schema === entry[0]) {
      extractToDef(entry);
      continue;
    }
    if (ctx.external) {
      const ext = ctx.external.registry.get(entry[0])?.id;
      if (schema !== entry[0] && ext) {
        extractToDef(entry);
        continue;
      }
    }
    const id = ctx.metadataRegistry.get(entry[0])?.id;
    if (id) {
      extractToDef(entry);
      continue;
    }
    if (seen.cycle) {
      extractToDef(entry);
      continue;
    }
    if (seen.count > 1) {
      if (ctx.reused === "ref") {
        extractToDef(entry);
        continue;
      }
    }
  }
}
function finalize(ctx, schema) {
  const root = ctx.seen.get(schema);
  if (!root)
    throw new Error("Unprocessed schema. This is a bug in Zod.");
  const flattenRef = (zodSchema) => {
    const seen = ctx.seen.get(zodSchema);
    if (seen.ref === null)
      return;
    const schema2 = seen.def ?? seen.schema;
    const _cached = { ...schema2 };
    const ref = seen.ref;
    seen.ref = null;
    if (ref) {
      flattenRef(ref);
      const refSeen = ctx.seen.get(ref);
      const refSchema = refSeen.schema;
      if (refSchema.$ref && (ctx.target === "draft-07" || ctx.target === "draft-04" || ctx.target === "openapi-3.0")) {
        schema2.allOf = schema2.allOf ?? [];
        schema2.allOf.push(refSchema);
      } else {
        Object.assign(schema2, refSchema);
      }
      Object.assign(schema2, _cached);
      const isParentRef = zodSchema._zod.parent === ref;
      if (isParentRef) {
        for (const key in schema2) {
          if (key === "$ref" || key === "allOf")
            continue;
          if (!(key in _cached)) {
            delete schema2[key];
          }
        }
      }
      if (refSchema.$ref && refSeen.def) {
        for (const key in schema2) {
          if (key === "$ref" || key === "allOf")
            continue;
          if (key in refSeen.def && JSON.stringify(schema2[key]) === JSON.stringify(refSeen.def[key])) {
            delete schema2[key];
          }
        }
      }
    }
    const parent = zodSchema._zod.parent;
    if (parent && parent !== ref) {
      flattenRef(parent);
      const parentSeen = ctx.seen.get(parent);
      if (parentSeen?.schema.$ref) {
        schema2.$ref = parentSeen.schema.$ref;
        if (parentSeen.def) {
          for (const key in schema2) {
            if (key === "$ref" || key === "allOf")
              continue;
            if (key in parentSeen.def && JSON.stringify(schema2[key]) === JSON.stringify(parentSeen.def[key])) {
              delete schema2[key];
            }
          }
        }
      }
    }
    ctx.override({
      zodSchema,
      jsonSchema: schema2,
      path: seen.path ?? []
    });
  };
  for (const entry of [...ctx.seen.entries()].reverse()) {
    flattenRef(entry[0]);
  }
  const result = {};
  if (ctx.target === "draft-2020-12") {
    result.$schema = "https://json-schema.org/draft/2020-12/schema";
  } else if (ctx.target === "draft-07") {
    result.$schema = "http://json-schema.org/draft-07/schema#";
  } else if (ctx.target === "draft-04") {
    result.$schema = "http://json-schema.org/draft-04/schema#";
  } else if (ctx.target === "openapi-3.0") {
  } else {
  }
  if (ctx.external?.uri) {
    const id = ctx.external.registry.get(schema)?.id;
    if (!id)
      throw new Error("Schema is missing an `id` property");
    result.$id = ctx.external.uri(id);
  }
  Object.assign(result, root.def ?? root.schema);
  const defs = ctx.external?.defs ?? {};
  for (const entry of ctx.seen.entries()) {
    const seen = entry[1];
    if (seen.def && seen.defId) {
      defs[seen.defId] = seen.def;
    }
  }
  if (ctx.external) {
  } else {
    if (Object.keys(defs).length > 0) {
      if (ctx.target === "draft-2020-12") {
        result.$defs = defs;
      } else {
        result.definitions = defs;
      }
    }
  }
  try {
    const finalized = JSON.parse(JSON.stringify(result));
    Object.defineProperty(finalized, "~standard", {
      value: {
        ...schema["~standard"],
        jsonSchema: {
          input: createStandardJSONSchemaMethod(schema, "input", ctx.processors),
          output: createStandardJSONSchemaMethod(schema, "output", ctx.processors)
        }
      },
      enumerable: false,
      writable: false
    });
    return finalized;
  } catch (_err) {
    throw new Error("Error converting schema to JSON.");
  }
}
function isTransforming(_schema, _ctx) {
  const ctx = _ctx ?? { seen: /* @__PURE__ */ new Set() };
  if (ctx.seen.has(_schema))
    return false;
  ctx.seen.add(_schema);
  const def = _schema._zod.def;
  if (def.type === "transform")
    return true;
  if (def.type === "array")
    return isTransforming(def.element, ctx);
  if (def.type === "set")
    return isTransforming(def.valueType, ctx);
  if (def.type === "lazy")
    return isTransforming(def.getter(), ctx);
  if (def.type === "promise" || def.type === "optional" || def.type === "nonoptional" || def.type === "nullable" || def.type === "readonly" || def.type === "default" || def.type === "prefault") {
    return isTransforming(def.innerType, ctx);
  }
  if (def.type === "intersection") {
    return isTransforming(def.left, ctx) || isTransforming(def.right, ctx);
  }
  if (def.type === "record" || def.type === "map") {
    return isTransforming(def.keyType, ctx) || isTransforming(def.valueType, ctx);
  }
  if (def.type === "pipe") {
    return isTransforming(def.in, ctx) || isTransforming(def.out, ctx);
  }
  if (def.type === "object") {
    for (const key in def.shape) {
      if (isTransforming(def.shape[key], ctx))
        return true;
    }
    return false;
  }
  if (def.type === "union") {
    for (const option of def.options) {
      if (isTransforming(option, ctx))
        return true;
    }
    return false;
  }
  if (def.type === "tuple") {
    for (const item of def.items) {
      if (isTransforming(item, ctx))
        return true;
    }
    if (def.rest && isTransforming(def.rest, ctx))
      return true;
    return false;
  }
  return false;
}
var createToJSONSchemaMethod = (schema, processors = {}) => (params) => {
  const ctx = initializeContext({ ...params, processors });
  process2(schema, ctx);
  extractDefs(ctx, schema);
  return finalize(ctx, schema);
};
var createStandardJSONSchemaMethod = (schema, io, processors = {}) => (params) => {
  const { libraryOptions, target } = params ?? {};
  const ctx = initializeContext({ ...libraryOptions ?? {}, target, io, processors });
  process2(schema, ctx);
  extractDefs(ctx, schema);
  return finalize(ctx, schema);
};

// node_modules/zod/v4/core/json-schema-processors.js
var formatMap = {
  guid: "uuid",
  url: "uri",
  datetime: "date-time",
  json_string: "json-string",
  regex: ""
  // do not set
};
var stringProcessor = (schema, ctx, _json, _params) => {
  const json2 = _json;
  json2.type = "string";
  const { minimum, maximum, format, patterns, contentEncoding } = schema._zod.bag;
  if (typeof minimum === "number")
    json2.minLength = minimum;
  if (typeof maximum === "number")
    json2.maxLength = maximum;
  if (format) {
    json2.format = formatMap[format] ?? format;
    if (json2.format === "")
      delete json2.format;
    if (format === "time") {
      delete json2.format;
    }
  }
  if (contentEncoding)
    json2.contentEncoding = contentEncoding;
  if (patterns && patterns.size > 0) {
    const regexes = [...patterns];
    if (regexes.length === 1)
      json2.pattern = regexes[0].source;
    else if (regexes.length > 1) {
      json2.allOf = [
        ...regexes.map((regex) => ({
          ...ctx.target === "draft-07" || ctx.target === "draft-04" || ctx.target === "openapi-3.0" ? { type: "string" } : {},
          pattern: regex.source
        }))
      ];
    }
  }
};
var numberProcessor = (schema, ctx, _json, _params) => {
  const json2 = _json;
  const { minimum, maximum, format, multipleOf, exclusiveMaximum, exclusiveMinimum } = schema._zod.bag;
  if (typeof format === "string" && format.includes("int"))
    json2.type = "integer";
  else
    json2.type = "number";
  if (typeof exclusiveMinimum === "number") {
    if (ctx.target === "draft-04" || ctx.target === "openapi-3.0") {
      json2.minimum = exclusiveMinimum;
      json2.exclusiveMinimum = true;
    } else {
      json2.exclusiveMinimum = exclusiveMinimum;
    }
  }
  if (typeof minimum === "number") {
    json2.minimum = minimum;
    if (typeof exclusiveMinimum === "number" && ctx.target !== "draft-04") {
      if (exclusiveMinimum >= minimum)
        delete json2.minimum;
      else
        delete json2.exclusiveMinimum;
    }
  }
  if (typeof exclusiveMaximum === "number") {
    if (ctx.target === "draft-04" || ctx.target === "openapi-3.0") {
      json2.maximum = exclusiveMaximum;
      json2.exclusiveMaximum = true;
    } else {
      json2.exclusiveMaximum = exclusiveMaximum;
    }
  }
  if (typeof maximum === "number") {
    json2.maximum = maximum;
    if (typeof exclusiveMaximum === "number" && ctx.target !== "draft-04") {
      if (exclusiveMaximum <= maximum)
        delete json2.maximum;
      else
        delete json2.exclusiveMaximum;
    }
  }
  if (typeof multipleOf === "number")
    json2.multipleOf = multipleOf;
};
var booleanProcessor = (_schema, _ctx, json2, _params) => {
  json2.type = "boolean";
};
var bigintProcessor = (_schema, ctx, _json, _params) => {
  if (ctx.unrepresentable === "throw") {
    throw new Error("BigInt cannot be represented in JSON Schema");
  }
};
var symbolProcessor = (_schema, ctx, _json, _params) => {
  if (ctx.unrepresentable === "throw") {
    throw new Error("Symbols cannot be represented in JSON Schema");
  }
};
var nullProcessor = (_schema, ctx, json2, _params) => {
  if (ctx.target === "openapi-3.0") {
    json2.type = "string";
    json2.nullable = true;
    json2.enum = [null];
  } else {
    json2.type = "null";
  }
};
var undefinedProcessor = (_schema, ctx, _json, _params) => {
  if (ctx.unrepresentable === "throw") {
    throw new Error("Undefined cannot be represented in JSON Schema");
  }
};
var voidProcessor = (_schema, ctx, _json, _params) => {
  if (ctx.unrepresentable === "throw") {
    throw new Error("Void cannot be represented in JSON Schema");
  }
};
var neverProcessor = (_schema, _ctx, json2, _params) => {
  json2.not = {};
};
var anyProcessor = (_schema, _ctx, _json, _params) => {
};
var unknownProcessor = (_schema, _ctx, _json, _params) => {
};
var dateProcessor = (_schema, ctx, _json, _params) => {
  if (ctx.unrepresentable === "throw") {
    throw new Error("Date cannot be represented in JSON Schema");
  }
};
var enumProcessor = (schema, _ctx, json2, _params) => {
  const def = schema._zod.def;
  const values = getEnumValues(def.entries);
  if (values.every((v) => typeof v === "number"))
    json2.type = "number";
  if (values.every((v) => typeof v === "string"))
    json2.type = "string";
  json2.enum = values;
};
var literalProcessor = (schema, ctx, json2, _params) => {
  const def = schema._zod.def;
  const vals = [];
  for (const val of def.values) {
    if (val === void 0) {
      if (ctx.unrepresentable === "throw") {
        throw new Error("Literal `undefined` cannot be represented in JSON Schema");
      } else {
      }
    } else if (typeof val === "bigint") {
      if (ctx.unrepresentable === "throw") {
        throw new Error("BigInt literals cannot be represented in JSON Schema");
      } else {
        vals.push(Number(val));
      }
    } else {
      vals.push(val);
    }
  }
  if (vals.length === 0) {
  } else if (vals.length === 1) {
    const val = vals[0];
    json2.type = val === null ? "null" : typeof val;
    if (ctx.target === "draft-04" || ctx.target === "openapi-3.0") {
      json2.enum = [val];
    } else {
      json2.const = val;
    }
  } else {
    if (vals.every((v) => typeof v === "number"))
      json2.type = "number";
    if (vals.every((v) => typeof v === "string"))
      json2.type = "string";
    if (vals.every((v) => typeof v === "boolean"))
      json2.type = "boolean";
    if (vals.every((v) => v === null))
      json2.type = "null";
    json2.enum = vals;
  }
};
var nanProcessor = (_schema, ctx, _json, _params) => {
  if (ctx.unrepresentable === "throw") {
    throw new Error("NaN cannot be represented in JSON Schema");
  }
};
var templateLiteralProcessor = (schema, _ctx, json2, _params) => {
  const _json = json2;
  const pattern = schema._zod.pattern;
  if (!pattern)
    throw new Error("Pattern not found in template literal");
  _json.type = "string";
  _json.pattern = pattern.source;
};
var fileProcessor = (schema, _ctx, json2, _params) => {
  const _json = json2;
  const file2 = {
    type: "string",
    format: "binary",
    contentEncoding: "binary"
  };
  const { minimum, maximum, mime: mime2 } = schema._zod.bag;
  if (minimum !== void 0)
    file2.minLength = minimum;
  if (maximum !== void 0)
    file2.maxLength = maximum;
  if (mime2) {
    if (mime2.length === 1) {
      file2.contentMediaType = mime2[0];
      Object.assign(_json, file2);
    } else {
      Object.assign(_json, file2);
      _json.anyOf = mime2.map((m) => ({ contentMediaType: m }));
    }
  } else {
    Object.assign(_json, file2);
  }
};
var successProcessor = (_schema, _ctx, json2, _params) => {
  json2.type = "boolean";
};
var customProcessor = (_schema, ctx, _json, _params) => {
  if (ctx.unrepresentable === "throw") {
    throw new Error("Custom types cannot be represented in JSON Schema");
  }
};
var functionProcessor = (_schema, ctx, _json, _params) => {
  if (ctx.unrepresentable === "throw") {
    throw new Error("Function types cannot be represented in JSON Schema");
  }
};
var transformProcessor = (_schema, ctx, _json, _params) => {
  if (ctx.unrepresentable === "throw") {
    throw new Error("Transforms cannot be represented in JSON Schema");
  }
};
var mapProcessor = (_schema, ctx, _json, _params) => {
  if (ctx.unrepresentable === "throw") {
    throw new Error("Map cannot be represented in JSON Schema");
  }
};
var setProcessor = (_schema, ctx, _json, _params) => {
  if (ctx.unrepresentable === "throw") {
    throw new Error("Set cannot be represented in JSON Schema");
  }
};
var arrayProcessor = (schema, ctx, _json, params) => {
  const json2 = _json;
  const def = schema._zod.def;
  const { minimum, maximum } = schema._zod.bag;
  if (typeof minimum === "number")
    json2.minItems = minimum;
  if (typeof maximum === "number")
    json2.maxItems = maximum;
  json2.type = "array";
  json2.items = process2(def.element, ctx, { ...params, path: [...params.path, "items"] });
};
var objectProcessor = (schema, ctx, _json, params) => {
  const json2 = _json;
  const def = schema._zod.def;
  json2.type = "object";
  json2.properties = {};
  const shape = def.shape;
  for (const key in shape) {
    json2.properties[key] = process2(shape[key], ctx, {
      ...params,
      path: [...params.path, "properties", key]
    });
  }
  const allKeys = new Set(Object.keys(shape));
  const requiredKeys = new Set([...allKeys].filter((key) => {
    const v = def.shape[key]._zod;
    if (ctx.io === "input") {
      return v.optin === void 0;
    } else {
      return v.optout === void 0;
    }
  }));
  if (requiredKeys.size > 0) {
    json2.required = Array.from(requiredKeys);
  }
  if (def.catchall?._zod.def.type === "never") {
    json2.additionalProperties = false;
  } else if (!def.catchall) {
    if (ctx.io === "output")
      json2.additionalProperties = false;
  } else if (def.catchall) {
    json2.additionalProperties = process2(def.catchall, ctx, {
      ...params,
      path: [...params.path, "additionalProperties"]
    });
  }
};
var unionProcessor = (schema, ctx, json2, params) => {
  const def = schema._zod.def;
  const isExclusive = def.inclusive === false;
  const options2 = def.options.map((x, i) => process2(x, ctx, {
    ...params,
    path: [...params.path, isExclusive ? "oneOf" : "anyOf", i]
  }));
  if (isExclusive) {
    json2.oneOf = options2;
  } else {
    json2.anyOf = options2;
  }
};
var intersectionProcessor = (schema, ctx, json2, params) => {
  const def = schema._zod.def;
  const a = process2(def.left, ctx, {
    ...params,
    path: [...params.path, "allOf", 0]
  });
  const b = process2(def.right, ctx, {
    ...params,
    path: [...params.path, "allOf", 1]
  });
  const isSimpleIntersection = (val) => "allOf" in val && Object.keys(val).length === 1;
  const allOf = [
    ...isSimpleIntersection(a) ? a.allOf : [a],
    ...isSimpleIntersection(b) ? b.allOf : [b]
  ];
  json2.allOf = allOf;
};
var tupleProcessor = (schema, ctx, _json, params) => {
  const json2 = _json;
  const def = schema._zod.def;
  json2.type = "array";
  const prefixPath = ctx.target === "draft-2020-12" ? "prefixItems" : "items";
  const restPath = ctx.target === "draft-2020-12" ? "items" : ctx.target === "openapi-3.0" ? "items" : "additionalItems";
  const prefixItems = def.items.map((x, i) => process2(x, ctx, {
    ...params,
    path: [...params.path, prefixPath, i]
  }));
  const rest = def.rest ? process2(def.rest, ctx, {
    ...params,
    path: [...params.path, restPath, ...ctx.target === "openapi-3.0" ? [def.items.length] : []]
  }) : null;
  if (ctx.target === "draft-2020-12") {
    json2.prefixItems = prefixItems;
    if (rest) {
      json2.items = rest;
    }
  } else if (ctx.target === "openapi-3.0") {
    json2.items = {
      anyOf: prefixItems
    };
    if (rest) {
      json2.items.anyOf.push(rest);
    }
    json2.minItems = prefixItems.length;
    if (!rest) {
      json2.maxItems = prefixItems.length;
    }
  } else {
    json2.items = prefixItems;
    if (rest) {
      json2.additionalItems = rest;
    }
  }
  const { minimum, maximum } = schema._zod.bag;
  if (typeof minimum === "number")
    json2.minItems = minimum;
  if (typeof maximum === "number")
    json2.maxItems = maximum;
};
var recordProcessor = (schema, ctx, _json, params) => {
  const json2 = _json;
  const def = schema._zod.def;
  json2.type = "object";
  const keyType = def.keyType;
  const keyBag = keyType._zod.bag;
  const patterns = keyBag?.patterns;
  if (def.mode === "loose" && patterns && patterns.size > 0) {
    const valueSchema = process2(def.valueType, ctx, {
      ...params,
      path: [...params.path, "patternProperties", "*"]
    });
    json2.patternProperties = {};
    for (const pattern of patterns) {
      json2.patternProperties[pattern.source] = valueSchema;
    }
  } else {
    if (ctx.target === "draft-07" || ctx.target === "draft-2020-12") {
      json2.propertyNames = process2(def.keyType, ctx, {
        ...params,
        path: [...params.path, "propertyNames"]
      });
    }
    json2.additionalProperties = process2(def.valueType, ctx, {
      ...params,
      path: [...params.path, "additionalProperties"]
    });
  }
  const keyValues = keyType._zod.values;
  if (keyValues) {
    const validKeyValues = [...keyValues].filter((v) => typeof v === "string" || typeof v === "number");
    if (validKeyValues.length > 0) {
      json2.required = validKeyValues;
    }
  }
};
var nullableProcessor = (schema, ctx, json2, params) => {
  const def = schema._zod.def;
  const inner = process2(def.innerType, ctx, params);
  const seen = ctx.seen.get(schema);
  if (ctx.target === "openapi-3.0") {
    seen.ref = def.innerType;
    json2.nullable = true;
  } else {
    json2.anyOf = [inner, { type: "null" }];
  }
};
var nonoptionalProcessor = (schema, ctx, _json, params) => {
  const def = schema._zod.def;
  process2(def.innerType, ctx, params);
  const seen = ctx.seen.get(schema);
  seen.ref = def.innerType;
};
var defaultProcessor = (schema, ctx, json2, params) => {
  const def = schema._zod.def;
  process2(def.innerType, ctx, params);
  const seen = ctx.seen.get(schema);
  seen.ref = def.innerType;
  json2.default = JSON.parse(JSON.stringify(def.defaultValue));
};
var prefaultProcessor = (schema, ctx, json2, params) => {
  const def = schema._zod.def;
  process2(def.innerType, ctx, params);
  const seen = ctx.seen.get(schema);
  seen.ref = def.innerType;
  if (ctx.io === "input")
    json2._prefault = JSON.parse(JSON.stringify(def.defaultValue));
};
var catchProcessor = (schema, ctx, json2, params) => {
  const def = schema._zod.def;
  process2(def.innerType, ctx, params);
  const seen = ctx.seen.get(schema);
  seen.ref = def.innerType;
  let catchValue;
  try {
    catchValue = def.catchValue(void 0);
  } catch {
    throw new Error("Dynamic catch values are not supported in JSON Schema");
  }
  json2.default = catchValue;
};
var pipeProcessor = (schema, ctx, _json, params) => {
  const def = schema._zod.def;
  const innerType = ctx.io === "input" ? def.in._zod.def.type === "transform" ? def.out : def.in : def.out;
  process2(innerType, ctx, params);
  const seen = ctx.seen.get(schema);
  seen.ref = innerType;
};
var readonlyProcessor = (schema, ctx, json2, params) => {
  const def = schema._zod.def;
  process2(def.innerType, ctx, params);
  const seen = ctx.seen.get(schema);
  seen.ref = def.innerType;
  json2.readOnly = true;
};
var promiseProcessor = (schema, ctx, _json, params) => {
  const def = schema._zod.def;
  process2(def.innerType, ctx, params);
  const seen = ctx.seen.get(schema);
  seen.ref = def.innerType;
};
var optionalProcessor = (schema, ctx, _json, params) => {
  const def = schema._zod.def;
  process2(def.innerType, ctx, params);
  const seen = ctx.seen.get(schema);
  seen.ref = def.innerType;
};
var lazyProcessor = (schema, ctx, _json, params) => {
  const innerType = schema._zod.innerType;
  process2(innerType, ctx, params);
  const seen = ctx.seen.get(schema);
  seen.ref = innerType;
};
var allProcessors = {
  string: stringProcessor,
  number: numberProcessor,
  boolean: booleanProcessor,
  bigint: bigintProcessor,
  symbol: symbolProcessor,
  null: nullProcessor,
  undefined: undefinedProcessor,
  void: voidProcessor,
  never: neverProcessor,
  any: anyProcessor,
  unknown: unknownProcessor,
  date: dateProcessor,
  enum: enumProcessor,
  literal: literalProcessor,
  nan: nanProcessor,
  template_literal: templateLiteralProcessor,
  file: fileProcessor,
  success: successProcessor,
  custom: customProcessor,
  function: functionProcessor,
  transform: transformProcessor,
  map: mapProcessor,
  set: setProcessor,
  array: arrayProcessor,
  object: objectProcessor,
  union: unionProcessor,
  intersection: intersectionProcessor,
  tuple: tupleProcessor,
  record: recordProcessor,
  nullable: nullableProcessor,
  nonoptional: nonoptionalProcessor,
  default: defaultProcessor,
  prefault: prefaultProcessor,
  catch: catchProcessor,
  pipe: pipeProcessor,
  readonly: readonlyProcessor,
  promise: promiseProcessor,
  optional: optionalProcessor,
  lazy: lazyProcessor
};
function toJSONSchema(input, params) {
  if ("_idmap" in input) {
    const registry2 = input;
    const ctx2 = initializeContext({ ...params, processors: allProcessors });
    const defs = {};
    for (const entry of registry2._idmap.entries()) {
      const [_, schema] = entry;
      process2(schema, ctx2);
    }
    const schemas = {};
    const external = {
      registry: registry2,
      uri: params?.uri,
      defs
    };
    ctx2.external = external;
    for (const entry of registry2._idmap.entries()) {
      const [key, schema] = entry;
      extractDefs(ctx2, schema);
      schemas[key] = finalize(ctx2, schema);
    }
    if (Object.keys(defs).length > 0) {
      const defsSegment = ctx2.target === "draft-2020-12" ? "$defs" : "definitions";
      schemas.__shared = {
        [defsSegment]: defs
      };
    }
    return { schemas };
  }
  const ctx = initializeContext({ ...params, processors: allProcessors });
  process2(input, ctx);
  extractDefs(ctx, input);
  return finalize(ctx, input);
}

// node_modules/zod/v4/core/json-schema-generator.js
var JSONSchemaGenerator = class {
  /** @deprecated Access via ctx instead */
  get metadataRegistry() {
    return this.ctx.metadataRegistry;
  }
  /** @deprecated Access via ctx instead */
  get target() {
    return this.ctx.target;
  }
  /** @deprecated Access via ctx instead */
  get unrepresentable() {
    return this.ctx.unrepresentable;
  }
  /** @deprecated Access via ctx instead */
  get override() {
    return this.ctx.override;
  }
  /** @deprecated Access via ctx instead */
  get io() {
    return this.ctx.io;
  }
  /** @deprecated Access via ctx instead */
  get counter() {
    return this.ctx.counter;
  }
  set counter(value) {
    this.ctx.counter = value;
  }
  /** @deprecated Access via ctx instead */
  get seen() {
    return this.ctx.seen;
  }
  constructor(params) {
    let normalizedTarget = params?.target ?? "draft-2020-12";
    if (normalizedTarget === "draft-4")
      normalizedTarget = "draft-04";
    if (normalizedTarget === "draft-7")
      normalizedTarget = "draft-07";
    this.ctx = initializeContext({
      processors: allProcessors,
      target: normalizedTarget,
      ...params?.metadata && { metadata: params.metadata },
      ...params?.unrepresentable && { unrepresentable: params.unrepresentable },
      ...params?.override && { override: params.override },
      ...params?.io && { io: params.io }
    });
  }
  /**
   * Process a schema to prepare it for JSON Schema generation.
   * This must be called before emit().
   */
  process(schema, _params = { path: [], schemaPath: [] }) {
    return process2(schema, this.ctx, _params);
  }
  /**
   * Emit the final JSON Schema after processing.
   * Must call process() first.
   */
  emit(schema, _params) {
    if (_params) {
      if (_params.cycles)
        this.ctx.cycles = _params.cycles;
      if (_params.reused)
        this.ctx.reused = _params.reused;
      if (_params.external)
        this.ctx.external = _params.external;
    }
    extractDefs(this.ctx, schema);
    const result = finalize(this.ctx, schema);
    const { "~standard": _, ...plainResult } = result;
    return plainResult;
  }
};

// node_modules/zod/v4/core/json-schema.js
var json_schema_exports = {};

// node_modules/zod/v4/classic/schemas.js
var schemas_exports2 = {};
__export(schemas_exports2, {
  ZodAny: () => ZodAny,
  ZodArray: () => ZodArray,
  ZodBase64: () => ZodBase64,
  ZodBase64URL: () => ZodBase64URL,
  ZodBigInt: () => ZodBigInt,
  ZodBigIntFormat: () => ZodBigIntFormat,
  ZodBoolean: () => ZodBoolean,
  ZodCIDRv4: () => ZodCIDRv4,
  ZodCIDRv6: () => ZodCIDRv6,
  ZodCUID: () => ZodCUID,
  ZodCUID2: () => ZodCUID2,
  ZodCatch: () => ZodCatch,
  ZodCodec: () => ZodCodec,
  ZodCustom: () => ZodCustom,
  ZodCustomStringFormat: () => ZodCustomStringFormat,
  ZodDate: () => ZodDate,
  ZodDefault: () => ZodDefault,
  ZodDiscriminatedUnion: () => ZodDiscriminatedUnion,
  ZodE164: () => ZodE164,
  ZodEmail: () => ZodEmail,
  ZodEmoji: () => ZodEmoji,
  ZodEnum: () => ZodEnum,
  ZodExactOptional: () => ZodExactOptional,
  ZodFile: () => ZodFile,
  ZodFunction: () => ZodFunction,
  ZodGUID: () => ZodGUID,
  ZodIPv4: () => ZodIPv4,
  ZodIPv6: () => ZodIPv6,
  ZodIntersection: () => ZodIntersection,
  ZodJWT: () => ZodJWT,
  ZodKSUID: () => ZodKSUID,
  ZodLazy: () => ZodLazy,
  ZodLiteral: () => ZodLiteral,
  ZodMAC: () => ZodMAC,
  ZodMap: () => ZodMap,
  ZodNaN: () => ZodNaN,
  ZodNanoID: () => ZodNanoID,
  ZodNever: () => ZodNever,
  ZodNonOptional: () => ZodNonOptional,
  ZodNull: () => ZodNull,
  ZodNullable: () => ZodNullable,
  ZodNumber: () => ZodNumber,
  ZodNumberFormat: () => ZodNumberFormat,
  ZodObject: () => ZodObject,
  ZodOptional: () => ZodOptional,
  ZodPipe: () => ZodPipe,
  ZodPrefault: () => ZodPrefault,
  ZodPromise: () => ZodPromise,
  ZodReadonly: () => ZodReadonly,
  ZodRecord: () => ZodRecord,
  ZodSet: () => ZodSet,
  ZodString: () => ZodString,
  ZodStringFormat: () => ZodStringFormat,
  ZodSuccess: () => ZodSuccess,
  ZodSymbol: () => ZodSymbol,
  ZodTemplateLiteral: () => ZodTemplateLiteral,
  ZodTransform: () => ZodTransform,
  ZodTuple: () => ZodTuple,
  ZodType: () => ZodType,
  ZodULID: () => ZodULID,
  ZodURL: () => ZodURL,
  ZodUUID: () => ZodUUID,
  ZodUndefined: () => ZodUndefined,
  ZodUnion: () => ZodUnion,
  ZodUnknown: () => ZodUnknown,
  ZodVoid: () => ZodVoid,
  ZodXID: () => ZodXID,
  ZodXor: () => ZodXor,
  _ZodString: () => _ZodString,
  _default: () => _default2,
  _function: () => _function,
  any: () => any,
  array: () => array,
  base64: () => base642,
  base64url: () => base64url2,
  bigint: () => bigint2,
  boolean: () => boolean2,
  catch: () => _catch2,
  check: () => check,
  cidrv4: () => cidrv42,
  cidrv6: () => cidrv62,
  codec: () => codec,
  cuid: () => cuid3,
  cuid2: () => cuid22,
  custom: () => custom,
  date: () => date3,
  describe: () => describe2,
  discriminatedUnion: () => discriminatedUnion,
  e164: () => e1642,
  email: () => email2,
  emoji: () => emoji2,
  enum: () => _enum2,
  exactOptional: () => exactOptional,
  file: () => file,
  float32: () => float32,
  float64: () => float64,
  function: () => _function,
  guid: () => guid2,
  hash: () => hash,
  hex: () => hex2,
  hostname: () => hostname2,
  httpUrl: () => httpUrl,
  instanceof: () => _instanceof,
  int: () => int,
  int32: () => int32,
  int64: () => int64,
  intersection: () => intersection,
  ipv4: () => ipv42,
  ipv6: () => ipv62,
  json: () => json,
  jwt: () => jwt,
  keyof: () => keyof,
  ksuid: () => ksuid2,
  lazy: () => lazy,
  literal: () => literal,
  looseObject: () => looseObject,
  looseRecord: () => looseRecord,
  mac: () => mac2,
  map: () => map,
  meta: () => meta2,
  nan: () => nan,
  nanoid: () => nanoid2,
  nativeEnum: () => nativeEnum,
  never: () => never,
  nonoptional: () => nonoptional,
  null: () => _null3,
  nullable: () => nullable,
  nullish: () => nullish2,
  number: () => number2,
  object: () => object,
  optional: () => optional,
  partialRecord: () => partialRecord,
  pipe: () => pipe,
  prefault: () => prefault,
  preprocess: () => preprocess,
  promise: () => promise,
  readonly: () => readonly,
  record: () => record,
  refine: () => refine,
  set: () => set,
  strictObject: () => strictObject,
  string: () => string2,
  stringFormat: () => stringFormat,
  stringbool: () => stringbool,
  success: () => success,
  superRefine: () => superRefine,
  symbol: () => symbol,
  templateLiteral: () => templateLiteral,
  transform: () => transform,
  tuple: () => tuple,
  uint32: () => uint32,
  uint64: () => uint64,
  ulid: () => ulid2,
  undefined: () => _undefined3,
  union: () => union,
  unknown: () => unknown,
  url: () => url,
  uuid: () => uuid2,
  uuidv4: () => uuidv4,
  uuidv6: () => uuidv6,
  uuidv7: () => uuidv7,
  void: () => _void2,
  xid: () => xid2,
  xor: () => xor
});

// node_modules/zod/v4/classic/checks.js
var checks_exports2 = {};
__export(checks_exports2, {
  endsWith: () => _endsWith,
  gt: () => _gt,
  gte: () => _gte,
  includes: () => _includes,
  length: () => _length,
  lowercase: () => _lowercase,
  lt: () => _lt,
  lte: () => _lte,
  maxLength: () => _maxLength,
  maxSize: () => _maxSize,
  mime: () => _mime,
  minLength: () => _minLength,
  minSize: () => _minSize,
  multipleOf: () => _multipleOf,
  negative: () => _negative,
  nonnegative: () => _nonnegative,
  nonpositive: () => _nonpositive,
  normalize: () => _normalize,
  overwrite: () => _overwrite,
  positive: () => _positive,
  property: () => _property,
  regex: () => _regex,
  size: () => _size,
  slugify: () => _slugify,
  startsWith: () => _startsWith,
  toLowerCase: () => _toLowerCase,
  toUpperCase: () => _toUpperCase,
  trim: () => _trim,
  uppercase: () => _uppercase
});

// node_modules/zod/v4/classic/iso.js
var iso_exports = {};
__export(iso_exports, {
  ZodISODate: () => ZodISODate,
  ZodISODateTime: () => ZodISODateTime,
  ZodISODuration: () => ZodISODuration,
  ZodISOTime: () => ZodISOTime,
  date: () => date2,
  datetime: () => datetime2,
  duration: () => duration2,
  time: () => time2
});
var ZodISODateTime = /* @__PURE__ */ $constructor("ZodISODateTime", (inst, def) => {
  $ZodISODateTime.init(inst, def);
  ZodStringFormat.init(inst, def);
});
function datetime2(params) {
  return _isoDateTime(ZodISODateTime, params);
}
var ZodISODate = /* @__PURE__ */ $constructor("ZodISODate", (inst, def) => {
  $ZodISODate.init(inst, def);
  ZodStringFormat.init(inst, def);
});
function date2(params) {
  return _isoDate(ZodISODate, params);
}
var ZodISOTime = /* @__PURE__ */ $constructor("ZodISOTime", (inst, def) => {
  $ZodISOTime.init(inst, def);
  ZodStringFormat.init(inst, def);
});
function time2(params) {
  return _isoTime(ZodISOTime, params);
}
var ZodISODuration = /* @__PURE__ */ $constructor("ZodISODuration", (inst, def) => {
  $ZodISODuration.init(inst, def);
  ZodStringFormat.init(inst, def);
});
function duration2(params) {
  return _isoDuration(ZodISODuration, params);
}

// node_modules/zod/v4/classic/errors.js
var initializer2 = (inst, issues) => {
  $ZodError.init(inst, issues);
  inst.name = "ZodError";
  Object.defineProperties(inst, {
    format: {
      value: (mapper) => formatError(inst, mapper)
      // enumerable: false,
    },
    flatten: {
      value: (mapper) => flattenError(inst, mapper)
      // enumerable: false,
    },
    addIssue: {
      value: (issue2) => {
        inst.issues.push(issue2);
        inst.message = JSON.stringify(inst.issues, jsonStringifyReplacer, 2);
      }
      // enumerable: false,
    },
    addIssues: {
      value: (issues2) => {
        inst.issues.push(...issues2);
        inst.message = JSON.stringify(inst.issues, jsonStringifyReplacer, 2);
      }
      // enumerable: false,
    },
    isEmpty: {
      get() {
        return inst.issues.length === 0;
      }
      // enumerable: false,
    }
  });
};
var ZodError = $constructor("ZodError", initializer2);
var ZodRealError = $constructor("ZodError", initializer2, {
  Parent: Error
});

// node_modules/zod/v4/classic/parse.js
var parse2 = /* @__PURE__ */ _parse(ZodRealError);
var parseAsync2 = /* @__PURE__ */ _parseAsync(ZodRealError);
var safeParse2 = /* @__PURE__ */ _safeParse(ZodRealError);
var safeParseAsync2 = /* @__PURE__ */ _safeParseAsync(ZodRealError);
var encode2 = /* @__PURE__ */ _encode(ZodRealError);
var decode2 = /* @__PURE__ */ _decode(ZodRealError);
var encodeAsync2 = /* @__PURE__ */ _encodeAsync(ZodRealError);
var decodeAsync2 = /* @__PURE__ */ _decodeAsync(ZodRealError);
var safeEncode2 = /* @__PURE__ */ _safeEncode(ZodRealError);
var safeDecode2 = /* @__PURE__ */ _safeDecode(ZodRealError);
var safeEncodeAsync2 = /* @__PURE__ */ _safeEncodeAsync(ZodRealError);
var safeDecodeAsync2 = /* @__PURE__ */ _safeDecodeAsync(ZodRealError);

// node_modules/zod/v4/classic/schemas.js
var ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
  $ZodType.init(inst, def);
  Object.assign(inst["~standard"], {
    jsonSchema: {
      input: createStandardJSONSchemaMethod(inst, "input"),
      output: createStandardJSONSchemaMethod(inst, "output")
    }
  });
  inst.toJSONSchema = createToJSONSchemaMethod(inst, {});
  inst.def = def;
  inst.type = def.type;
  Object.defineProperty(inst, "_def", { value: def });
  inst.check = (...checks) => {
    return inst.clone(util_exports.mergeDefs(def, {
      checks: [
        ...def.checks ?? [],
        ...checks.map((ch) => typeof ch === "function" ? { _zod: { check: ch, def: { check: "custom" }, onattach: [] } } : ch)
      ]
    }), {
      parent: true
    });
  };
  inst.with = inst.check;
  inst.clone = (def2, params) => clone(inst, def2, params);
  inst.brand = () => inst;
  inst.register = ((reg, meta3) => {
    reg.add(inst, meta3);
    return inst;
  });
  inst.parse = (data, params) => parse2(inst, data, params, { callee: inst.parse });
  inst.safeParse = (data, params) => safeParse2(inst, data, params);
  inst.parseAsync = async (data, params) => parseAsync2(inst, data, params, { callee: inst.parseAsync });
  inst.safeParseAsync = async (data, params) => safeParseAsync2(inst, data, params);
  inst.spa = inst.safeParseAsync;
  inst.encode = (data, params) => encode2(inst, data, params);
  inst.decode = (data, params) => decode2(inst, data, params);
  inst.encodeAsync = async (data, params) => encodeAsync2(inst, data, params);
  inst.decodeAsync = async (data, params) => decodeAsync2(inst, data, params);
  inst.safeEncode = (data, params) => safeEncode2(inst, data, params);
  inst.safeDecode = (data, params) => safeDecode2(inst, data, params);
  inst.safeEncodeAsync = async (data, params) => safeEncodeAsync2(inst, data, params);
  inst.safeDecodeAsync = async (data, params) => safeDecodeAsync2(inst, data, params);
  inst.refine = (check2, params) => inst.check(refine(check2, params));
  inst.superRefine = (refinement) => inst.check(superRefine(refinement));
  inst.overwrite = (fn) => inst.check(_overwrite(fn));
  inst.optional = () => optional(inst);
  inst.exactOptional = () => exactOptional(inst);
  inst.nullable = () => nullable(inst);
  inst.nullish = () => optional(nullable(inst));
  inst.nonoptional = (params) => nonoptional(inst, params);
  inst.array = () => array(inst);
  inst.or = (arg) => union([inst, arg]);
  inst.and = (arg) => intersection(inst, arg);
  inst.transform = (tx) => pipe(inst, transform(tx));
  inst.default = (def2) => _default2(inst, def2);
  inst.prefault = (def2) => prefault(inst, def2);
  inst.catch = (params) => _catch2(inst, params);
  inst.pipe = (target) => pipe(inst, target);
  inst.readonly = () => readonly(inst);
  inst.describe = (description) => {
    const cl = inst.clone();
    globalRegistry.add(cl, { description });
    return cl;
  };
  Object.defineProperty(inst, "description", {
    get() {
      return globalRegistry.get(inst)?.description;
    },
    configurable: true
  });
  inst.meta = (...args) => {
    if (args.length === 0) {
      return globalRegistry.get(inst);
    }
    const cl = inst.clone();
    globalRegistry.add(cl, args[0]);
    return cl;
  };
  inst.isOptional = () => inst.safeParse(void 0).success;
  inst.isNullable = () => inst.safeParse(null).success;
  inst.apply = (fn) => fn(inst);
  return inst;
});
var _ZodString = /* @__PURE__ */ $constructor("_ZodString", (inst, def) => {
  $ZodString.init(inst, def);
  ZodType.init(inst, def);
  inst._zod.processJSONSchema = (ctx, json2, params) => stringProcessor(inst, ctx, json2, params);
  const bag = inst._zod.bag;
  inst.format = bag.format ?? null;
  inst.minLength = bag.minimum ?? null;
  inst.maxLength = bag.maximum ?? null;
  inst.regex = (...args) => inst.check(_regex(...args));
  inst.includes = (...args) => inst.check(_includes(...args));
  inst.startsWith = (...args) => inst.check(_startsWith(...args));
  inst.endsWith = (...args) => inst.check(_endsWith(...args));
  inst.min = (...args) => inst.check(_minLength(...args));
  inst.max = (...args) => inst.check(_maxLength(...args));
  inst.length = (...args) => inst.check(_length(...args));
  inst.nonempty = (...args) => inst.check(_minLength(1, ...args));
  inst.lowercase = (params) => inst.check(_lowercase(params));
  inst.uppercase = (params) => inst.check(_uppercase(params));
  inst.trim = () => inst.check(_trim());
  inst.normalize = (...args) => inst.check(_normalize(...args));
  inst.toLowerCase = () => inst.check(_toLowerCase());
  inst.toUpperCase = () => inst.check(_toUpperCase());
  inst.slugify = () => inst.check(_slugify());
});
var ZodString = /* @__PURE__ */ $constructor("ZodString", (inst, def) => {
  $ZodString.init(inst, def);
  _ZodString.init(inst, def);
  inst.email = (params) => inst.check(_email(ZodEmail, params));
  inst.url = (params) => inst.check(_url(ZodURL, params));
  inst.jwt = (params) => inst.check(_jwt(ZodJWT, params));
  inst.emoji = (params) => inst.check(_emoji2(ZodEmoji, params));
  inst.guid = (params) => inst.check(_guid(ZodGUID, params));
  inst.uuid = (params) => inst.check(_uuid(ZodUUID, params));
  inst.uuidv4 = (params) => inst.check(_uuidv4(ZodUUID, params));
  inst.uuidv6 = (params) => inst.check(_uuidv6(ZodUUID, params));
  inst.uuidv7 = (params) => inst.check(_uuidv7(ZodUUID, params));
  inst.nanoid = (params) => inst.check(_nanoid(ZodNanoID, params));
  inst.guid = (params) => inst.check(_guid(ZodGUID, params));
  inst.cuid = (params) => inst.check(_cuid(ZodCUID, params));
  inst.cuid2 = (params) => inst.check(_cuid2(ZodCUID2, params));
  inst.ulid = (params) => inst.check(_ulid(ZodULID, params));
  inst.base64 = (params) => inst.check(_base64(ZodBase64, params));
  inst.base64url = (params) => inst.check(_base64url(ZodBase64URL, params));
  inst.xid = (params) => inst.check(_xid(ZodXID, params));
  inst.ksuid = (params) => inst.check(_ksuid(ZodKSUID, params));
  inst.ipv4 = (params) => inst.check(_ipv4(ZodIPv4, params));
  inst.ipv6 = (params) => inst.check(_ipv6(ZodIPv6, params));
  inst.cidrv4 = (params) => inst.check(_cidrv4(ZodCIDRv4, params));
  inst.cidrv6 = (params) => inst.check(_cidrv6(ZodCIDRv6, params));
  inst.e164 = (params) => inst.check(_e164(ZodE164, params));
  inst.datetime = (params) => inst.check(datetime2(params));
  inst.date = (params) => inst.check(date2(params));
  inst.time = (params) => inst.check(time2(params));
  inst.duration = (params) => inst.check(duration2(params));
});
function string2(params) {
  return _string(ZodString, params);
}
var ZodStringFormat = /* @__PURE__ */ $constructor("ZodStringFormat", (inst, def) => {
  $ZodStringFormat.init(inst, def);
  _ZodString.init(inst, def);
});
var ZodEmail = /* @__PURE__ */ $constructor("ZodEmail", (inst, def) => {
  $ZodEmail.init(inst, def);
  ZodStringFormat.init(inst, def);
});
function email2(params) {
  return _email(ZodEmail, params);
}
var ZodGUID = /* @__PURE__ */ $constructor("ZodGUID", (inst, def) => {
  $ZodGUID.init(inst, def);
  ZodStringFormat.init(inst, def);
});
function guid2(params) {
  return _guid(ZodGUID, params);
}
var ZodUUID = /* @__PURE__ */ $constructor("ZodUUID", (inst, def) => {
  $ZodUUID.init(inst, def);
  ZodStringFormat.init(inst, def);
});
function uuid2(params) {
  return _uuid(ZodUUID, params);
}
function uuidv4(params) {
  return _uuidv4(ZodUUID, params);
}
function uuidv6(params) {
  return _uuidv6(ZodUUID, params);
}
function uuidv7(params) {
  return _uuidv7(ZodUUID, params);
}
var ZodURL = /* @__PURE__ */ $constructor("ZodURL", (inst, def) => {
  $ZodURL.init(inst, def);
  ZodStringFormat.init(inst, def);
});
function url(params) {
  return _url(ZodURL, params);
}
function httpUrl(params) {
  return _url(ZodURL, {
    protocol: /^https?$/,
    hostname: regexes_exports.domain,
    ...util_exports.normalizeParams(params)
  });
}
var ZodEmoji = /* @__PURE__ */ $constructor("ZodEmoji", (inst, def) => {
  $ZodEmoji.init(inst, def);
  ZodStringFormat.init(inst, def);
});
function emoji2(params) {
  return _emoji2(ZodEmoji, params);
}
var ZodNanoID = /* @__PURE__ */ $constructor("ZodNanoID", (inst, def) => {
  $ZodNanoID.init(inst, def);
  ZodStringFormat.init(inst, def);
});
function nanoid2(params) {
  return _nanoid(ZodNanoID, params);
}
var ZodCUID = /* @__PURE__ */ $constructor("ZodCUID", (inst, def) => {
  $ZodCUID.init(inst, def);
  ZodStringFormat.init(inst, def);
});
function cuid3(params) {
  return _cuid(ZodCUID, params);
}
var ZodCUID2 = /* @__PURE__ */ $constructor("ZodCUID2", (inst, def) => {
  $ZodCUID2.init(inst, def);
  ZodStringFormat.init(inst, def);
});
function cuid22(params) {
  return _cuid2(ZodCUID2, params);
}
var ZodULID = /* @__PURE__ */ $constructor("ZodULID", (inst, def) => {
  $ZodULID.init(inst, def);
  ZodStringFormat.init(inst, def);
});
function ulid2(params) {
  return _ulid(ZodULID, params);
}
var ZodXID = /* @__PURE__ */ $constructor("ZodXID", (inst, def) => {
  $ZodXID.init(inst, def);
  ZodStringFormat.init(inst, def);
});
function xid2(params) {
  return _xid(ZodXID, params);
}
var ZodKSUID = /* @__PURE__ */ $constructor("ZodKSUID", (inst, def) => {
  $ZodKSUID.init(inst, def);
  ZodStringFormat.init(inst, def);
});
function ksuid2(params) {
  return _ksuid(ZodKSUID, params);
}
var ZodIPv4 = /* @__PURE__ */ $constructor("ZodIPv4", (inst, def) => {
  $ZodIPv4.init(inst, def);
  ZodStringFormat.init(inst, def);
});
function ipv42(params) {
  return _ipv4(ZodIPv4, params);
}
var ZodMAC = /* @__PURE__ */ $constructor("ZodMAC", (inst, def) => {
  $ZodMAC.init(inst, def);
  ZodStringFormat.init(inst, def);
});
function mac2(params) {
  return _mac(ZodMAC, params);
}
var ZodIPv6 = /* @__PURE__ */ $constructor("ZodIPv6", (inst, def) => {
  $ZodIPv6.init(inst, def);
  ZodStringFormat.init(inst, def);
});
function ipv62(params) {
  return _ipv6(ZodIPv6, params);
}
var ZodCIDRv4 = /* @__PURE__ */ $constructor("ZodCIDRv4", (inst, def) => {
  $ZodCIDRv4.init(inst, def);
  ZodStringFormat.init(inst, def);
});
function cidrv42(params) {
  return _cidrv4(ZodCIDRv4, params);
}
var ZodCIDRv6 = /* @__PURE__ */ $constructor("ZodCIDRv6", (inst, def) => {
  $ZodCIDRv6.init(inst, def);
  ZodStringFormat.init(inst, def);
});
function cidrv62(params) {
  return _cidrv6(ZodCIDRv6, params);
}
var ZodBase64 = /* @__PURE__ */ $constructor("ZodBase64", (inst, def) => {
  $ZodBase64.init(inst, def);
  ZodStringFormat.init(inst, def);
});
function base642(params) {
  return _base64(ZodBase64, params);
}
var ZodBase64URL = /* @__PURE__ */ $constructor("ZodBase64URL", (inst, def) => {
  $ZodBase64URL.init(inst, def);
  ZodStringFormat.init(inst, def);
});
function base64url2(params) {
  return _base64url(ZodBase64URL, params);
}
var ZodE164 = /* @__PURE__ */ $constructor("ZodE164", (inst, def) => {
  $ZodE164.init(inst, def);
  ZodStringFormat.init(inst, def);
});
function e1642(params) {
  return _e164(ZodE164, params);
}
var ZodJWT = /* @__PURE__ */ $constructor("ZodJWT", (inst, def) => {
  $ZodJWT.init(inst, def);
  ZodStringFormat.init(inst, def);
});
function jwt(params) {
  return _jwt(ZodJWT, params);
}
var ZodCustomStringFormat = /* @__PURE__ */ $constructor("ZodCustomStringFormat", (inst, def) => {
  $ZodCustomStringFormat.init(inst, def);
  ZodStringFormat.init(inst, def);
});
function stringFormat(format, fnOrRegex, _params = {}) {
  return _stringFormat(ZodCustomStringFormat, format, fnOrRegex, _params);
}
function hostname2(_params) {
  return _stringFormat(ZodCustomStringFormat, "hostname", regexes_exports.hostname, _params);
}
function hex2(_params) {
  return _stringFormat(ZodCustomStringFormat, "hex", regexes_exports.hex, _params);
}
function hash(alg, params) {
  const enc = params?.enc ?? "hex";
  const format = `${alg}_${enc}`;
  const regex = regexes_exports[format];
  if (!regex)
    throw new Error(`Unrecognized hash format: ${format}`);
  return _stringFormat(ZodCustomStringFormat, format, regex, params);
}
var ZodNumber = /* @__PURE__ */ $constructor("ZodNumber", (inst, def) => {
  $ZodNumber.init(inst, def);
  ZodType.init(inst, def);
  inst._zod.processJSONSchema = (ctx, json2, params) => numberProcessor(inst, ctx, json2, params);
  inst.gt = (value, params) => inst.check(_gt(value, params));
  inst.gte = (value, params) => inst.check(_gte(value, params));
  inst.min = (value, params) => inst.check(_gte(value, params));
  inst.lt = (value, params) => inst.check(_lt(value, params));
  inst.lte = (value, params) => inst.check(_lte(value, params));
  inst.max = (value, params) => inst.check(_lte(value, params));
  inst.int = (params) => inst.check(int(params));
  inst.safe = (params) => inst.check(int(params));
  inst.positive = (params) => inst.check(_gt(0, params));
  inst.nonnegative = (params) => inst.check(_gte(0, params));
  inst.negative = (params) => inst.check(_lt(0, params));
  inst.nonpositive = (params) => inst.check(_lte(0, params));
  inst.multipleOf = (value, params) => inst.check(_multipleOf(value, params));
  inst.step = (value, params) => inst.check(_multipleOf(value, params));
  inst.finite = () => inst;
  const bag = inst._zod.bag;
  inst.minValue = Math.max(bag.minimum ?? Number.NEGATIVE_INFINITY, bag.exclusiveMinimum ?? Number.NEGATIVE_INFINITY) ?? null;
  inst.maxValue = Math.min(bag.maximum ?? Number.POSITIVE_INFINITY, bag.exclusiveMaximum ?? Number.POSITIVE_INFINITY) ?? null;
  inst.isInt = (bag.format ?? "").includes("int") || Number.isSafeInteger(bag.multipleOf ?? 0.5);
  inst.isFinite = true;
  inst.format = bag.format ?? null;
});
function number2(params) {
  return _number(ZodNumber, params);
}
var ZodNumberFormat = /* @__PURE__ */ $constructor("ZodNumberFormat", (inst, def) => {
  $ZodNumberFormat.init(inst, def);
  ZodNumber.init(inst, def);
});
function int(params) {
  return _int(ZodNumberFormat, params);
}
function float32(params) {
  return _float32(ZodNumberFormat, params);
}
function float64(params) {
  return _float64(ZodNumberFormat, params);
}
function int32(params) {
  return _int32(ZodNumberFormat, params);
}
function uint32(params) {
  return _uint32(ZodNumberFormat, params);
}
var ZodBoolean = /* @__PURE__ */ $constructor("ZodBoolean", (inst, def) => {
  $ZodBoolean.init(inst, def);
  ZodType.init(inst, def);
  inst._zod.processJSONSchema = (ctx, json2, params) => booleanProcessor(inst, ctx, json2, params);
});
function boolean2(params) {
  return _boolean(ZodBoolean, params);
}
var ZodBigInt = /* @__PURE__ */ $constructor("ZodBigInt", (inst, def) => {
  $ZodBigInt.init(inst, def);
  ZodType.init(inst, def);
  inst._zod.processJSONSchema = (ctx, json2, params) => bigintProcessor(inst, ctx, json2, params);
  inst.gte = (value, params) => inst.check(_gte(value, params));
  inst.min = (value, params) => inst.check(_gte(value, params));
  inst.gt = (value, params) => inst.check(_gt(value, params));
  inst.gte = (value, params) => inst.check(_gte(value, params));
  inst.min = (value, params) => inst.check(_gte(value, params));
  inst.lt = (value, params) => inst.check(_lt(value, params));
  inst.lte = (value, params) => inst.check(_lte(value, params));
  inst.max = (value, params) => inst.check(_lte(value, params));
  inst.positive = (params) => inst.check(_gt(BigInt(0), params));
  inst.negative = (params) => inst.check(_lt(BigInt(0), params));
  inst.nonpositive = (params) => inst.check(_lte(BigInt(0), params));
  inst.nonnegative = (params) => inst.check(_gte(BigInt(0), params));
  inst.multipleOf = (value, params) => inst.check(_multipleOf(value, params));
  const bag = inst._zod.bag;
  inst.minValue = bag.minimum ?? null;
  inst.maxValue = bag.maximum ?? null;
  inst.format = bag.format ?? null;
});
function bigint2(params) {
  return _bigint(ZodBigInt, params);
}
var ZodBigIntFormat = /* @__PURE__ */ $constructor("ZodBigIntFormat", (inst, def) => {
  $ZodBigIntFormat.init(inst, def);
  ZodBigInt.init(inst, def);
});
function int64(params) {
  return _int64(ZodBigIntFormat, params);
}
function uint64(params) {
  return _uint64(ZodBigIntFormat, params);
}
var ZodSymbol = /* @__PURE__ */ $constructor("ZodSymbol", (inst, def) => {
  $ZodSymbol.init(inst, def);
  ZodType.init(inst, def);
  inst._zod.processJSONSchema = (ctx, json2, params) => symbolProcessor(inst, ctx, json2, params);
});
function symbol(params) {
  return _symbol(ZodSymbol, params);
}
var ZodUndefined = /* @__PURE__ */ $constructor("ZodUndefined", (inst, def) => {
  $ZodUndefined.init(inst, def);
  ZodType.init(inst, def);
  inst._zod.processJSONSchema = (ctx, json2, params) => undefinedProcessor(inst, ctx, json2, params);
});
function _undefined3(params) {
  return _undefined2(ZodUndefined, params);
}
var ZodNull = /* @__PURE__ */ $constructor("ZodNull", (inst, def) => {
  $ZodNull.init(inst, def);
  ZodType.init(inst, def);
  inst._zod.processJSONSchema = (ctx, json2, params) => nullProcessor(inst, ctx, json2, params);
});
function _null3(params) {
  return _null2(ZodNull, params);
}
var ZodAny = /* @__PURE__ */ $constructor("ZodAny", (inst, def) => {
  $ZodAny.init(inst, def);
  ZodType.init(inst, def);
  inst._zod.processJSONSchema = (ctx, json2, params) => anyProcessor(inst, ctx, json2, params);
});
function any() {
  return _any(ZodAny);
}
var ZodUnknown = /* @__PURE__ */ $constructor("ZodUnknown", (inst, def) => {
  $ZodUnknown.init(inst, def);
  ZodType.init(inst, def);
  inst._zod.processJSONSchema = (ctx, json2, params) => unknownProcessor(inst, ctx, json2, params);
});
function unknown() {
  return _unknown(ZodUnknown);
}
var ZodNever = /* @__PURE__ */ $constructor("ZodNever", (inst, def) => {
  $ZodNever.init(inst, def);
  ZodType.init(inst, def);
  inst._zod.processJSONSchema = (ctx, json2, params) => neverProcessor(inst, ctx, json2, params);
});
function never(params) {
  return _never(ZodNever, params);
}
var ZodVoid = /* @__PURE__ */ $constructor("ZodVoid", (inst, def) => {
  $ZodVoid.init(inst, def);
  ZodType.init(inst, def);
  inst._zod.processJSONSchema = (ctx, json2, params) => voidProcessor(inst, ctx, json2, params);
});
function _void2(params) {
  return _void(ZodVoid, params);
}
var ZodDate = /* @__PURE__ */ $constructor("ZodDate", (inst, def) => {
  $ZodDate.init(inst, def);
  ZodType.init(inst, def);
  inst._zod.processJSONSchema = (ctx, json2, params) => dateProcessor(inst, ctx, json2, params);
  inst.min = (value, params) => inst.check(_gte(value, params));
  inst.max = (value, params) => inst.check(_lte(value, params));
  const c = inst._zod.bag;
  inst.minDate = c.minimum ? new Date(c.minimum) : null;
  inst.maxDate = c.maximum ? new Date(c.maximum) : null;
});
function date3(params) {
  return _date(ZodDate, params);
}
var ZodArray = /* @__PURE__ */ $constructor("ZodArray", (inst, def) => {
  $ZodArray.init(inst, def);
  ZodType.init(inst, def);
  inst._zod.processJSONSchema = (ctx, json2, params) => arrayProcessor(inst, ctx, json2, params);
  inst.element = def.element;
  inst.min = (minLength, params) => inst.check(_minLength(minLength, params));
  inst.nonempty = (params) => inst.check(_minLength(1, params));
  inst.max = (maxLength, params) => inst.check(_maxLength(maxLength, params));
  inst.length = (len, params) => inst.check(_length(len, params));
  inst.unwrap = () => inst.element;
});
function array(element, params) {
  return _array(ZodArray, element, params);
}
function keyof(schema) {
  const shape = schema._zod.def.shape;
  return _enum2(Object.keys(shape));
}
var ZodObject = /* @__PURE__ */ $constructor("ZodObject", (inst, def) => {
  $ZodObjectJIT.init(inst, def);
  ZodType.init(inst, def);
  inst._zod.processJSONSchema = (ctx, json2, params) => objectProcessor(inst, ctx, json2, params);
  util_exports.defineLazy(inst, "shape", () => {
    return def.shape;
  });
  inst.keyof = () => _enum2(Object.keys(inst._zod.def.shape));
  inst.catchall = (catchall) => inst.clone({ ...inst._zod.def, catchall });
  inst.passthrough = () => inst.clone({ ...inst._zod.def, catchall: unknown() });
  inst.loose = () => inst.clone({ ...inst._zod.def, catchall: unknown() });
  inst.strict = () => inst.clone({ ...inst._zod.def, catchall: never() });
  inst.strip = () => inst.clone({ ...inst._zod.def, catchall: void 0 });
  inst.extend = (incoming) => {
    return util_exports.extend(inst, incoming);
  };
  inst.safeExtend = (incoming) => {
    return util_exports.safeExtend(inst, incoming);
  };
  inst.merge = (other) => util_exports.merge(inst, other);
  inst.pick = (mask) => util_exports.pick(inst, mask);
  inst.omit = (mask) => util_exports.omit(inst, mask);
  inst.partial = (...args) => util_exports.partial(ZodOptional, inst, args[0]);
  inst.required = (...args) => util_exports.required(ZodNonOptional, inst, args[0]);
});
function object(shape, params) {
  const def = {
    type: "object",
    shape: shape ?? {},
    ...util_exports.normalizeParams(params)
  };
  return new ZodObject(def);
}
function strictObject(shape, params) {
  return new ZodObject({
    type: "object",
    shape,
    catchall: never(),
    ...util_exports.normalizeParams(params)
  });
}
function looseObject(shape, params) {
  return new ZodObject({
    type: "object",
    shape,
    catchall: unknown(),
    ...util_exports.normalizeParams(params)
  });
}
var ZodUnion = /* @__PURE__ */ $constructor("ZodUnion", (inst, def) => {
  $ZodUnion.init(inst, def);
  ZodType.init(inst, def);
  inst._zod.processJSONSchema = (ctx, json2, params) => unionProcessor(inst, ctx, json2, params);
  inst.options = def.options;
});
function union(options2, params) {
  return new ZodUnion({
    type: "union",
    options: options2,
    ...util_exports.normalizeParams(params)
  });
}
var ZodXor = /* @__PURE__ */ $constructor("ZodXor", (inst, def) => {
  ZodUnion.init(inst, def);
  $ZodXor.init(inst, def);
  inst._zod.processJSONSchema = (ctx, json2, params) => unionProcessor(inst, ctx, json2, params);
  inst.options = def.options;
});
function xor(options2, params) {
  return new ZodXor({
    type: "union",
    options: options2,
    inclusive: false,
    ...util_exports.normalizeParams(params)
  });
}
var ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("ZodDiscriminatedUnion", (inst, def) => {
  ZodUnion.init(inst, def);
  $ZodDiscriminatedUnion.init(inst, def);
});
function discriminatedUnion(discriminator, options2, params) {
  return new ZodDiscriminatedUnion({
    type: "union",
    options: options2,
    discriminator,
    ...util_exports.normalizeParams(params)
  });
}
var ZodIntersection = /* @__PURE__ */ $constructor("ZodIntersection", (inst, def) => {
  $ZodIntersection.init(inst, def);
  ZodType.init(inst, def);
  inst._zod.processJSONSchema = (ctx, json2, params) => intersectionProcessor(inst, ctx, json2, params);
});
function intersection(left, right) {
  return new ZodIntersection({
    type: "intersection",
    left,
    right
  });
}
var ZodTuple = /* @__PURE__ */ $constructor("ZodTuple", (inst, def) => {
  $ZodTuple.init(inst, def);
  ZodType.init(inst, def);
  inst._zod.processJSONSchema = (ctx, json2, params) => tupleProcessor(inst, ctx, json2, params);
  inst.rest = (rest) => inst.clone({
    ...inst._zod.def,
    rest
  });
});
function tuple(items, _paramsOrRest, _params) {
  const hasRest = _paramsOrRest instanceof $ZodType;
  const params = hasRest ? _params : _paramsOrRest;
  const rest = hasRest ? _paramsOrRest : null;
  return new ZodTuple({
    type: "tuple",
    items,
    rest,
    ...util_exports.normalizeParams(params)
  });
}
var ZodRecord = /* @__PURE__ */ $constructor("ZodRecord", (inst, def) => {
  $ZodRecord.init(inst, def);
  ZodType.init(inst, def);
  inst._zod.processJSONSchema = (ctx, json2, params) => recordProcessor(inst, ctx, json2, params);
  inst.keyType = def.keyType;
  inst.valueType = def.valueType;
});
function record(keyType, valueType, params) {
  return new ZodRecord({
    type: "record",
    keyType,
    valueType,
    ...util_exports.normalizeParams(params)
  });
}
function partialRecord(keyType, valueType, params) {
  const k = clone(keyType);
  k._zod.values = void 0;
  return new ZodRecord({
    type: "record",
    keyType: k,
    valueType,
    ...util_exports.normalizeParams(params)
  });
}
function looseRecord(keyType, valueType, params) {
  return new ZodRecord({
    type: "record",
    keyType,
    valueType,
    mode: "loose",
    ...util_exports.normalizeParams(params)
  });
}
var ZodMap = /* @__PURE__ */ $constructor("ZodMap", (inst, def) => {
  $ZodMap.init(inst, def);
  ZodType.init(inst, def);
  inst._zod.processJSONSchema = (ctx, json2, params) => mapProcessor(inst, ctx, json2, params);
  inst.keyType = def.keyType;
  inst.valueType = def.valueType;
  inst.min = (...args) => inst.check(_minSize(...args));
  inst.nonempty = (params) => inst.check(_minSize(1, params));
  inst.max = (...args) => inst.check(_maxSize(...args));
  inst.size = (...args) => inst.check(_size(...args));
});
function map(keyType, valueType, params) {
  return new ZodMap({
    type: "map",
    keyType,
    valueType,
    ...util_exports.normalizeParams(params)
  });
}
var ZodSet = /* @__PURE__ */ $constructor("ZodSet", (inst, def) => {
  $ZodSet.init(inst, def);
  ZodType.init(inst, def);
  inst._zod.processJSONSchema = (ctx, json2, params) => setProcessor(inst, ctx, json2, params);
  inst.min = (...args) => inst.check(_minSize(...args));
  inst.nonempty = (params) => inst.check(_minSize(1, params));
  inst.max = (...args) => inst.check(_maxSize(...args));
  inst.size = (...args) => inst.check(_size(...args));
});
function set(valueType, params) {
  return new ZodSet({
    type: "set",
    valueType,
    ...util_exports.normalizeParams(params)
  });
}
var ZodEnum = /* @__PURE__ */ $constructor("ZodEnum", (inst, def) => {
  $ZodEnum.init(inst, def);
  ZodType.init(inst, def);
  inst._zod.processJSONSchema = (ctx, json2, params) => enumProcessor(inst, ctx, json2, params);
  inst.enum = def.entries;
  inst.options = Object.values(def.entries);
  const keys = new Set(Object.keys(def.entries));
  inst.extract = (values, params) => {
    const newEntries = {};
    for (const value of values) {
      if (keys.has(value)) {
        newEntries[value] = def.entries[value];
      } else
        throw new Error(`Key ${value} not found in enum`);
    }
    return new ZodEnum({
      ...def,
      checks: [],
      ...util_exports.normalizeParams(params),
      entries: newEntries
    });
  };
  inst.exclude = (values, params) => {
    const newEntries = { ...def.entries };
    for (const value of values) {
      if (keys.has(value)) {
        delete newEntries[value];
      } else
        throw new Error(`Key ${value} not found in enum`);
    }
    return new ZodEnum({
      ...def,
      checks: [],
      ...util_exports.normalizeParams(params),
      entries: newEntries
    });
  };
});
function _enum2(values, params) {
  const entries = Array.isArray(values) ? Object.fromEntries(values.map((v) => [v, v])) : values;
  return new ZodEnum({
    type: "enum",
    entries,
    ...util_exports.normalizeParams(params)
  });
}
function nativeEnum(entries, params) {
  return new ZodEnum({
    type: "enum",
    entries,
    ...util_exports.normalizeParams(params)
  });
}
var ZodLiteral = /* @__PURE__ */ $constructor("ZodLiteral", (inst, def) => {
  $ZodLiteral.init(inst, def);
  ZodType.init(inst, def);
  inst._zod.processJSONSchema = (ctx, json2, params) => literalProcessor(inst, ctx, json2, params);
  inst.values = new Set(def.values);
  Object.defineProperty(inst, "value", {
    get() {
      if (def.values.length > 1) {
        throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");
      }
      return def.values[0];
    }
  });
});
function literal(value, params) {
  return new ZodLiteral({
    type: "literal",
    values: Array.isArray(value) ? value : [value],
    ...util_exports.normalizeParams(params)
  });
}
var ZodFile = /* @__PURE__ */ $constructor("ZodFile", (inst, def) => {
  $ZodFile.init(inst, def);
  ZodType.init(inst, def);
  inst._zod.processJSONSchema = (ctx, json2, params) => fileProcessor(inst, ctx, json2, params);
  inst.min = (size, params) => inst.check(_minSize(size, params));
  inst.max = (size, params) => inst.check(_maxSize(size, params));
  inst.mime = (types, params) => inst.check(_mime(Array.isArray(types) ? types : [types], params));
});
function file(params) {
  return _file(ZodFile, params);
}
var ZodTransform = /* @__PURE__ */ $constructor("ZodTransform", (inst, def) => {
  $ZodTransform.init(inst, def);
  ZodType.init(inst, def);
  inst._zod.processJSONSchema = (ctx, json2, params) => transformProcessor(inst, ctx, json2, params);
  inst._zod.parse = (payload, _ctx) => {
    if (_ctx.direction === "backward") {
      throw new $ZodEncodeError(inst.constructor.name);
    }
    payload.addIssue = (issue2) => {
      if (typeof issue2 === "string") {
        payload.issues.push(util_exports.issue(issue2, payload.value, def));
      } else {
        const _issue = issue2;
        if (_issue.fatal)
          _issue.continue = false;
        _issue.code ?? (_issue.code = "custom");
        _issue.input ?? (_issue.input = payload.value);
        _issue.inst ?? (_issue.inst = inst);
        payload.issues.push(util_exports.issue(_issue));
      }
    };
    const output = def.transform(payload.value, payload);
    if (output instanceof Promise) {
      return output.then((output2) => {
        payload.value = output2;
        return payload;
      });
    }
    payload.value = output;
    return payload;
  };
});
function transform(fn) {
  return new ZodTransform({
    type: "transform",
    transform: fn
  });
}
var ZodOptional = /* @__PURE__ */ $constructor("ZodOptional", (inst, def) => {
  $ZodOptional.init(inst, def);
  ZodType.init(inst, def);
  inst._zod.processJSONSchema = (ctx, json2, params) => optionalProcessor(inst, ctx, json2, params);
  inst.unwrap = () => inst._zod.def.innerType;
});
function optional(innerType) {
  return new ZodOptional({
    type: "optional",
    innerType
  });
}
var ZodExactOptional = /* @__PURE__ */ $constructor("ZodExactOptional", (inst, def) => {
  $ZodExactOptional.init(inst, def);
  ZodType.init(inst, def);
  inst._zod.processJSONSchema = (ctx, json2, params) => optionalProcessor(inst, ctx, json2, params);
  inst.unwrap = () => inst._zod.def.innerType;
});
function exactOptional(innerType) {
  return new ZodExactOptional({
    type: "optional",
    innerType
  });
}
var ZodNullable = /* @__PURE__ */ $constructor("ZodNullable", (inst, def) => {
  $ZodNullable.init(inst, def);
  ZodType.init(inst, def);
  inst._zod.processJSONSchema = (ctx, json2, params) => nullableProcessor(inst, ctx, json2, params);
  inst.unwrap = () => inst._zod.def.innerType;
});
function nullable(innerType) {
  return new ZodNullable({
    type: "nullable",
    innerType
  });
}
function nullish2(innerType) {
  return optional(nullable(innerType));
}
var ZodDefault = /* @__PURE__ */ $constructor("ZodDefault", (inst, def) => {
  $ZodDefault.init(inst, def);
  ZodType.init(inst, def);
  inst._zod.processJSONSchema = (ctx, json2, params) => defaultProcessor(inst, ctx, json2, params);
  inst.unwrap = () => inst._zod.def.innerType;
  inst.removeDefault = inst.unwrap;
});
function _default2(innerType, defaultValue) {
  return new ZodDefault({
    type: "default",
    innerType,
    get defaultValue() {
      return typeof defaultValue === "function" ? defaultValue() : util_exports.shallowClone(defaultValue);
    }
  });
}
var ZodPrefault = /* @__PURE__ */ $constructor("ZodPrefault", (inst, def) => {
  $ZodPrefault.init(inst, def);
  ZodType.init(inst, def);
  inst._zod.processJSONSchema = (ctx, json2, params) => prefaultProcessor(inst, ctx, json2, params);
  inst.unwrap = () => inst._zod.def.innerType;
});
function prefault(innerType, defaultValue) {
  return new ZodPrefault({
    type: "prefault",
    innerType,
    get defaultValue() {
      return typeof defaultValue === "function" ? defaultValue() : util_exports.shallowClone(defaultValue);
    }
  });
}
var ZodNonOptional = /* @__PURE__ */ $constructor("ZodNonOptional", (inst, def) => {
  $ZodNonOptional.init(inst, def);
  ZodType.init(inst, def);
  inst._zod.processJSONSchema = (ctx, json2, params) => nonoptionalProcessor(inst, ctx, json2, params);
  inst.unwrap = () => inst._zod.def.innerType;
});
function nonoptional(innerType, params) {
  return new ZodNonOptional({
    type: "nonoptional",
    innerType,
    ...util_exports.normalizeParams(params)
  });
}
var ZodSuccess = /* @__PURE__ */ $constructor("ZodSuccess", (inst, def) => {
  $ZodSuccess.init(inst, def);
  ZodType.init(inst, def);
  inst._zod.processJSONSchema = (ctx, json2, params) => successProcessor(inst, ctx, json2, params);
  inst.unwrap = () => inst._zod.def.innerType;
});
function success(innerType) {
  return new ZodSuccess({
    type: "success",
    innerType
  });
}
var ZodCatch = /* @__PURE__ */ $constructor("ZodCatch", (inst, def) => {
  $ZodCatch.init(inst, def);
  ZodType.init(inst, def);
  inst._zod.processJSONSchema = (ctx, json2, params) => catchProcessor(inst, ctx, json2, params);
  inst.unwrap = () => inst._zod.def.innerType;
  inst.removeCatch = inst.unwrap;
});
function _catch2(innerType, catchValue) {
  return new ZodCatch({
    type: "catch",
    innerType,
    catchValue: typeof catchValue === "function" ? catchValue : () => catchValue
  });
}
var ZodNaN = /* @__PURE__ */ $constructor("ZodNaN", (inst, def) => {
  $ZodNaN.init(inst, def);
  ZodType.init(inst, def);
  inst._zod.processJSONSchema = (ctx, json2, params) => nanProcessor(inst, ctx, json2, params);
});
function nan(params) {
  return _nan(ZodNaN, params);
}
var ZodPipe = /* @__PURE__ */ $constructor("ZodPipe", (inst, def) => {
  $ZodPipe.init(inst, def);
  ZodType.init(inst, def);
  inst._zod.processJSONSchema = (ctx, json2, params) => pipeProcessor(inst, ctx, json2, params);
  inst.in = def.in;
  inst.out = def.out;
});
function pipe(in_, out) {
  return new ZodPipe({
    type: "pipe",
    in: in_,
    out
    // ...util.normalizeParams(params),
  });
}
var ZodCodec = /* @__PURE__ */ $constructor("ZodCodec", (inst, def) => {
  ZodPipe.init(inst, def);
  $ZodCodec.init(inst, def);
});
function codec(in_, out, params) {
  return new ZodCodec({
    type: "pipe",
    in: in_,
    out,
    transform: params.decode,
    reverseTransform: params.encode
  });
}
var ZodReadonly = /* @__PURE__ */ $constructor("ZodReadonly", (inst, def) => {
  $ZodReadonly.init(inst, def);
  ZodType.init(inst, def);
  inst._zod.processJSONSchema = (ctx, json2, params) => readonlyProcessor(inst, ctx, json2, params);
  inst.unwrap = () => inst._zod.def.innerType;
});
function readonly(innerType) {
  return new ZodReadonly({
    type: "readonly",
    innerType
  });
}
var ZodTemplateLiteral = /* @__PURE__ */ $constructor("ZodTemplateLiteral", (inst, def) => {
  $ZodTemplateLiteral.init(inst, def);
  ZodType.init(inst, def);
  inst._zod.processJSONSchema = (ctx, json2, params) => templateLiteralProcessor(inst, ctx, json2, params);
});
function templateLiteral(parts, params) {
  return new ZodTemplateLiteral({
    type: "template_literal",
    parts,
    ...util_exports.normalizeParams(params)
  });
}
var ZodLazy = /* @__PURE__ */ $constructor("ZodLazy", (inst, def) => {
  $ZodLazy.init(inst, def);
  ZodType.init(inst, def);
  inst._zod.processJSONSchema = (ctx, json2, params) => lazyProcessor(inst, ctx, json2, params);
  inst.unwrap = () => inst._zod.def.getter();
});
function lazy(getter) {
  return new ZodLazy({
    type: "lazy",
    getter
  });
}
var ZodPromise = /* @__PURE__ */ $constructor("ZodPromise", (inst, def) => {
  $ZodPromise.init(inst, def);
  ZodType.init(inst, def);
  inst._zod.processJSONSchema = (ctx, json2, params) => promiseProcessor(inst, ctx, json2, params);
  inst.unwrap = () => inst._zod.def.innerType;
});
function promise(innerType) {
  return new ZodPromise({
    type: "promise",
    innerType
  });
}
var ZodFunction = /* @__PURE__ */ $constructor("ZodFunction", (inst, def) => {
  $ZodFunction.init(inst, def);
  ZodType.init(inst, def);
  inst._zod.processJSONSchema = (ctx, json2, params) => functionProcessor(inst, ctx, json2, params);
});
function _function(params) {
  return new ZodFunction({
    type: "function",
    input: Array.isArray(params?.input) ? tuple(params?.input) : params?.input ?? array(unknown()),
    output: params?.output ?? unknown()
  });
}
var ZodCustom = /* @__PURE__ */ $constructor("ZodCustom", (inst, def) => {
  $ZodCustom.init(inst, def);
  ZodType.init(inst, def);
  inst._zod.processJSONSchema = (ctx, json2, params) => customProcessor(inst, ctx, json2, params);
});
function check(fn) {
  const ch = new $ZodCheck({
    check: "custom"
    // ...util.normalizeParams(params),
  });
  ch._zod.check = fn;
  return ch;
}
function custom(fn, _params) {
  return _custom(ZodCustom, fn ?? (() => true), _params);
}
function refine(fn, _params = {}) {
  return _refine(ZodCustom, fn, _params);
}
function superRefine(fn) {
  return _superRefine(fn);
}
var describe2 = describe;
var meta2 = meta;
function _instanceof(cls, params = {}) {
  const inst = new ZodCustom({
    type: "custom",
    check: "custom",
    fn: (data) => data instanceof cls,
    abort: true,
    ...util_exports.normalizeParams(params)
  });
  inst._zod.bag.Class = cls;
  inst._zod.check = (payload) => {
    if (!(payload.value instanceof cls)) {
      payload.issues.push({
        code: "invalid_type",
        expected: cls.name,
        input: payload.value,
        inst,
        path: [...inst._zod.def.path ?? []]
      });
    }
  };
  return inst;
}
var stringbool = (...args) => _stringbool({
  Codec: ZodCodec,
  Boolean: ZodBoolean,
  String: ZodString
}, ...args);
function json(params) {
  const jsonSchema = lazy(() => {
    return union([string2(params), number2(), boolean2(), _null3(), array(jsonSchema), record(string2(), jsonSchema)]);
  });
  return jsonSchema;
}
function preprocess(fn, schema) {
  return pipe(transform(fn), schema);
}

// node_modules/zod/v4/classic/compat.js
var ZodIssueCode = {
  invalid_type: "invalid_type",
  too_big: "too_big",
  too_small: "too_small",
  invalid_format: "invalid_format",
  not_multiple_of: "not_multiple_of",
  unrecognized_keys: "unrecognized_keys",
  invalid_union: "invalid_union",
  invalid_key: "invalid_key",
  invalid_element: "invalid_element",
  invalid_value: "invalid_value",
  custom: "custom"
};
function setErrorMap(map2) {
  config({
    customError: map2
  });
}
function getErrorMap() {
  return config().customError;
}
var ZodFirstPartyTypeKind;
/* @__PURE__ */ (function(ZodFirstPartyTypeKind3) {
})(ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {}));

// node_modules/zod/v4/classic/from-json-schema.js
var z = {
  ...schemas_exports2,
  ...checks_exports2,
  iso: iso_exports
};
var RECOGNIZED_KEYS = /* @__PURE__ */ new Set([
  // Schema identification
  "$schema",
  "$ref",
  "$defs",
  "definitions",
  // Core schema keywords
  "$id",
  "id",
  "$comment",
  "$anchor",
  "$vocabulary",
  "$dynamicRef",
  "$dynamicAnchor",
  // Type
  "type",
  "enum",
  "const",
  // Composition
  "anyOf",
  "oneOf",
  "allOf",
  "not",
  // Object
  "properties",
  "required",
  "additionalProperties",
  "patternProperties",
  "propertyNames",
  "minProperties",
  "maxProperties",
  // Array
  "items",
  "prefixItems",
  "additionalItems",
  "minItems",
  "maxItems",
  "uniqueItems",
  "contains",
  "minContains",
  "maxContains",
  // String
  "minLength",
  "maxLength",
  "pattern",
  "format",
  // Number
  "minimum",
  "maximum",
  "exclusiveMinimum",
  "exclusiveMaximum",
  "multipleOf",
  // Already handled metadata
  "description",
  "default",
  // Content
  "contentEncoding",
  "contentMediaType",
  "contentSchema",
  // Unsupported (error-throwing)
  "unevaluatedItems",
  "unevaluatedProperties",
  "if",
  "then",
  "else",
  "dependentSchemas",
  "dependentRequired",
  // OpenAPI
  "nullable",
  "readOnly"
]);
function detectVersion(schema, defaultTarget) {
  const $schema = schema.$schema;
  if ($schema === "https://json-schema.org/draft/2020-12/schema") {
    return "draft-2020-12";
  }
  if ($schema === "http://json-schema.org/draft-07/schema#") {
    return "draft-7";
  }
  if ($schema === "http://json-schema.org/draft-04/schema#") {
    return "draft-4";
  }
  return defaultTarget ?? "draft-2020-12";
}
function resolveRef(ref, ctx) {
  if (!ref.startsWith("#")) {
    throw new Error("External $ref is not supported, only local refs (#/...) are allowed");
  }
  const path = ref.slice(1).split("/").filter(Boolean);
  if (path.length === 0) {
    return ctx.rootSchema;
  }
  const defsKey = ctx.version === "draft-2020-12" ? "$defs" : "definitions";
  if (path[0] === defsKey) {
    const key = path[1];
    if (!key || !ctx.defs[key]) {
      throw new Error(`Reference not found: ${ref}`);
    }
    return ctx.defs[key];
  }
  throw new Error(`Reference not found: ${ref}`);
}
function convertBaseSchema(schema, ctx) {
  if (schema.not !== void 0) {
    if (typeof schema.not === "object" && Object.keys(schema.not).length === 0) {
      return z.never();
    }
    throw new Error("not is not supported in Zod (except { not: {} } for never)");
  }
  if (schema.unevaluatedItems !== void 0) {
    throw new Error("unevaluatedItems is not supported");
  }
  if (schema.unevaluatedProperties !== void 0) {
    throw new Error("unevaluatedProperties is not supported");
  }
  if (schema.if !== void 0 || schema.then !== void 0 || schema.else !== void 0) {
    throw new Error("Conditional schemas (if/then/else) are not supported");
  }
  if (schema.dependentSchemas !== void 0 || schema.dependentRequired !== void 0) {
    throw new Error("dependentSchemas and dependentRequired are not supported");
  }
  if (schema.$ref) {
    const refPath = schema.$ref;
    if (ctx.refs.has(refPath)) {
      return ctx.refs.get(refPath);
    }
    if (ctx.processing.has(refPath)) {
      return z.lazy(() => {
        if (!ctx.refs.has(refPath)) {
          throw new Error(`Circular reference not resolved: ${refPath}`);
        }
        return ctx.refs.get(refPath);
      });
    }
    ctx.processing.add(refPath);
    const resolved = resolveRef(refPath, ctx);
    const zodSchema2 = convertSchema(resolved, ctx);
    ctx.refs.set(refPath, zodSchema2);
    ctx.processing.delete(refPath);
    return zodSchema2;
  }
  if (schema.enum !== void 0) {
    const enumValues = schema.enum;
    if (ctx.version === "openapi-3.0" && schema.nullable === true && enumValues.length === 1 && enumValues[0] === null) {
      return z.null();
    }
    if (enumValues.length === 0) {
      return z.never();
    }
    if (enumValues.length === 1) {
      return z.literal(enumValues[0]);
    }
    if (enumValues.every((v) => typeof v === "string")) {
      return z.enum(enumValues);
    }
    const literalSchemas = enumValues.map((v) => z.literal(v));
    if (literalSchemas.length < 2) {
      return literalSchemas[0];
    }
    return z.union([literalSchemas[0], literalSchemas[1], ...literalSchemas.slice(2)]);
  }
  if (schema.const !== void 0) {
    return z.literal(schema.const);
  }
  const type = schema.type;
  if (Array.isArray(type)) {
    const typeSchemas = type.map((t) => {
      const typeSchema = { ...schema, type: t };
      return convertBaseSchema(typeSchema, ctx);
    });
    if (typeSchemas.length === 0) {
      return z.never();
    }
    if (typeSchemas.length === 1) {
      return typeSchemas[0];
    }
    return z.union(typeSchemas);
  }
  if (!type) {
    return z.any();
  }
  let zodSchema;
  switch (type) {
    case "string": {
      let stringSchema = z.string();
      if (schema.format) {
        const format = schema.format;
        if (format === "email") {
          stringSchema = stringSchema.check(z.email());
        } else if (format === "uri" || format === "uri-reference") {
          stringSchema = stringSchema.check(z.url());
        } else if (format === "uuid" || format === "guid") {
          stringSchema = stringSchema.check(z.uuid());
        } else if (format === "date-time") {
          stringSchema = stringSchema.check(z.iso.datetime());
        } else if (format === "date") {
          stringSchema = stringSchema.check(z.iso.date());
        } else if (format === "time") {
          stringSchema = stringSchema.check(z.iso.time());
        } else if (format === "duration") {
          stringSchema = stringSchema.check(z.iso.duration());
        } else if (format === "ipv4") {
          stringSchema = stringSchema.check(z.ipv4());
        } else if (format === "ipv6") {
          stringSchema = stringSchema.check(z.ipv6());
        } else if (format === "mac") {
          stringSchema = stringSchema.check(z.mac());
        } else if (format === "cidr") {
          stringSchema = stringSchema.check(z.cidrv4());
        } else if (format === "cidr-v6") {
          stringSchema = stringSchema.check(z.cidrv6());
        } else if (format === "base64") {
          stringSchema = stringSchema.check(z.base64());
        } else if (format === "base64url") {
          stringSchema = stringSchema.check(z.base64url());
        } else if (format === "e164") {
          stringSchema = stringSchema.check(z.e164());
        } else if (format === "jwt") {
          stringSchema = stringSchema.check(z.jwt());
        } else if (format === "emoji") {
          stringSchema = stringSchema.check(z.emoji());
        } else if (format === "nanoid") {
          stringSchema = stringSchema.check(z.nanoid());
        } else if (format === "cuid") {
          stringSchema = stringSchema.check(z.cuid());
        } else if (format === "cuid2") {
          stringSchema = stringSchema.check(z.cuid2());
        } else if (format === "ulid") {
          stringSchema = stringSchema.check(z.ulid());
        } else if (format === "xid") {
          stringSchema = stringSchema.check(z.xid());
        } else if (format === "ksuid") {
          stringSchema = stringSchema.check(z.ksuid());
        }
      }
      if (typeof schema.minLength === "number") {
        stringSchema = stringSchema.min(schema.minLength);
      }
      if (typeof schema.maxLength === "number") {
        stringSchema = stringSchema.max(schema.maxLength);
      }
      if (schema.pattern) {
        stringSchema = stringSchema.regex(new RegExp(schema.pattern));
      }
      zodSchema = stringSchema;
      break;
    }
    case "number":
    case "integer": {
      let numberSchema = type === "integer" ? z.number().int() : z.number();
      if (typeof schema.minimum === "number") {
        numberSchema = numberSchema.min(schema.minimum);
      }
      if (typeof schema.maximum === "number") {
        numberSchema = numberSchema.max(schema.maximum);
      }
      if (typeof schema.exclusiveMinimum === "number") {
        numberSchema = numberSchema.gt(schema.exclusiveMinimum);
      } else if (schema.exclusiveMinimum === true && typeof schema.minimum === "number") {
        numberSchema = numberSchema.gt(schema.minimum);
      }
      if (typeof schema.exclusiveMaximum === "number") {
        numberSchema = numberSchema.lt(schema.exclusiveMaximum);
      } else if (schema.exclusiveMaximum === true && typeof schema.maximum === "number") {
        numberSchema = numberSchema.lt(schema.maximum);
      }
      if (typeof schema.multipleOf === "number") {
        numberSchema = numberSchema.multipleOf(schema.multipleOf);
      }
      zodSchema = numberSchema;
      break;
    }
    case "boolean": {
      zodSchema = z.boolean();
      break;
    }
    case "null": {
      zodSchema = z.null();
      break;
    }
    case "object": {
      const shape = {};
      const properties = schema.properties || {};
      const requiredSet = new Set(schema.required || []);
      for (const [key, propSchema] of Object.entries(properties)) {
        const propZodSchema = convertSchema(propSchema, ctx);
        shape[key] = requiredSet.has(key) ? propZodSchema : propZodSchema.optional();
      }
      if (schema.propertyNames) {
        const keySchema = convertSchema(schema.propertyNames, ctx);
        const valueSchema = schema.additionalProperties && typeof schema.additionalProperties === "object" ? convertSchema(schema.additionalProperties, ctx) : z.any();
        if (Object.keys(shape).length === 0) {
          zodSchema = z.record(keySchema, valueSchema);
          break;
        }
        const objectSchema2 = z.object(shape).passthrough();
        const recordSchema = z.looseRecord(keySchema, valueSchema);
        zodSchema = z.intersection(objectSchema2, recordSchema);
        break;
      }
      if (schema.patternProperties) {
        const patternProps = schema.patternProperties;
        const patternKeys = Object.keys(patternProps);
        const looseRecords = [];
        for (const pattern of patternKeys) {
          const patternValue = convertSchema(patternProps[pattern], ctx);
          const keySchema = z.string().regex(new RegExp(pattern));
          looseRecords.push(z.looseRecord(keySchema, patternValue));
        }
        const schemasToIntersect = [];
        if (Object.keys(shape).length > 0) {
          schemasToIntersect.push(z.object(shape).passthrough());
        }
        schemasToIntersect.push(...looseRecords);
        if (schemasToIntersect.length === 0) {
          zodSchema = z.object({}).passthrough();
        } else if (schemasToIntersect.length === 1) {
          zodSchema = schemasToIntersect[0];
        } else {
          let result = z.intersection(schemasToIntersect[0], schemasToIntersect[1]);
          for (let i = 2; i < schemasToIntersect.length; i++) {
            result = z.intersection(result, schemasToIntersect[i]);
          }
          zodSchema = result;
        }
        break;
      }
      const objectSchema = z.object(shape);
      if (schema.additionalProperties === false) {
        zodSchema = objectSchema.strict();
      } else if (typeof schema.additionalProperties === "object") {
        zodSchema = objectSchema.catchall(convertSchema(schema.additionalProperties, ctx));
      } else {
        zodSchema = objectSchema.passthrough();
      }
      break;
    }
    case "array": {
      const prefixItems = schema.prefixItems;
      const items = schema.items;
      if (prefixItems && Array.isArray(prefixItems)) {
        const tupleItems = prefixItems.map((item) => convertSchema(item, ctx));
        const rest = items && typeof items === "object" && !Array.isArray(items) ? convertSchema(items, ctx) : void 0;
        if (rest) {
          zodSchema = z.tuple(tupleItems).rest(rest);
        } else {
          zodSchema = z.tuple(tupleItems);
        }
        if (typeof schema.minItems === "number") {
          zodSchema = zodSchema.check(z.minLength(schema.minItems));
        }
        if (typeof schema.maxItems === "number") {
          zodSchema = zodSchema.check(z.maxLength(schema.maxItems));
        }
      } else if (Array.isArray(items)) {
        const tupleItems = items.map((item) => convertSchema(item, ctx));
        const rest = schema.additionalItems && typeof schema.additionalItems === "object" ? convertSchema(schema.additionalItems, ctx) : void 0;
        if (rest) {
          zodSchema = z.tuple(tupleItems).rest(rest);
        } else {
          zodSchema = z.tuple(tupleItems);
        }
        if (typeof schema.minItems === "number") {
          zodSchema = zodSchema.check(z.minLength(schema.minItems));
        }
        if (typeof schema.maxItems === "number") {
          zodSchema = zodSchema.check(z.maxLength(schema.maxItems));
        }
      } else if (items !== void 0) {
        const element = convertSchema(items, ctx);
        let arraySchema = z.array(element);
        if (typeof schema.minItems === "number") {
          arraySchema = arraySchema.min(schema.minItems);
        }
        if (typeof schema.maxItems === "number") {
          arraySchema = arraySchema.max(schema.maxItems);
        }
        zodSchema = arraySchema;
      } else {
        zodSchema = z.array(z.any());
      }
      break;
    }
    default:
      throw new Error(`Unsupported type: ${type}`);
  }
  if (schema.description) {
    zodSchema = zodSchema.describe(schema.description);
  }
  if (schema.default !== void 0) {
    zodSchema = zodSchema.default(schema.default);
  }
  return zodSchema;
}
function convertSchema(schema, ctx) {
  if (typeof schema === "boolean") {
    return schema ? z.any() : z.never();
  }
  let baseSchema = convertBaseSchema(schema, ctx);
  const hasExplicitType = schema.type || schema.enum !== void 0 || schema.const !== void 0;
  if (schema.anyOf && Array.isArray(schema.anyOf)) {
    const options2 = schema.anyOf.map((s) => convertSchema(s, ctx));
    const anyOfUnion = z.union(options2);
    baseSchema = hasExplicitType ? z.intersection(baseSchema, anyOfUnion) : anyOfUnion;
  }
  if (schema.oneOf && Array.isArray(schema.oneOf)) {
    const options2 = schema.oneOf.map((s) => convertSchema(s, ctx));
    const oneOfUnion = z.xor(options2);
    baseSchema = hasExplicitType ? z.intersection(baseSchema, oneOfUnion) : oneOfUnion;
  }
  if (schema.allOf && Array.isArray(schema.allOf)) {
    if (schema.allOf.length === 0) {
      baseSchema = hasExplicitType ? baseSchema : z.any();
    } else {
      let result = hasExplicitType ? baseSchema : convertSchema(schema.allOf[0], ctx);
      const startIdx = hasExplicitType ? 0 : 1;
      for (let i = startIdx; i < schema.allOf.length; i++) {
        result = z.intersection(result, convertSchema(schema.allOf[i], ctx));
      }
      baseSchema = result;
    }
  }
  if (schema.nullable === true && ctx.version === "openapi-3.0") {
    baseSchema = z.nullable(baseSchema);
  }
  if (schema.readOnly === true) {
    baseSchema = z.readonly(baseSchema);
  }
  const extraMeta = {};
  const coreMetadataKeys = ["$id", "id", "$comment", "$anchor", "$vocabulary", "$dynamicRef", "$dynamicAnchor"];
  for (const key of coreMetadataKeys) {
    if (key in schema) {
      extraMeta[key] = schema[key];
    }
  }
  const contentMetadataKeys = ["contentEncoding", "contentMediaType", "contentSchema"];
  for (const key of contentMetadataKeys) {
    if (key in schema) {
      extraMeta[key] = schema[key];
    }
  }
  for (const key of Object.keys(schema)) {
    if (!RECOGNIZED_KEYS.has(key)) {
      extraMeta[key] = schema[key];
    }
  }
  if (Object.keys(extraMeta).length > 0) {
    ctx.registry.add(baseSchema, extraMeta);
  }
  return baseSchema;
}
function fromJSONSchema(schema, params) {
  if (typeof schema === "boolean") {
    return schema ? z.any() : z.never();
  }
  const version2 = detectVersion(schema, params?.defaultTarget);
  const defs = schema.$defs || schema.definitions || {};
  const ctx = {
    version: version2,
    defs,
    refs: /* @__PURE__ */ new Map(),
    processing: /* @__PURE__ */ new Set(),
    rootSchema: schema,
    registry: params?.registry ?? globalRegistry
  };
  return convertSchema(schema, ctx);
}

// node_modules/zod/v4/classic/coerce.js
var coerce_exports = {};
__export(coerce_exports, {
  bigint: () => bigint3,
  boolean: () => boolean3,
  date: () => date4,
  number: () => number3,
  string: () => string3
});
function string3(params) {
  return _coercedString(ZodString, params);
}
function number3(params) {
  return _coercedNumber(ZodNumber, params);
}
function boolean3(params) {
  return _coercedBoolean(ZodBoolean, params);
}
function bigint3(params) {
  return _coercedBigint(ZodBigInt, params);
}
function date4(params) {
  return _coercedDate(ZodDate, params);
}

// node_modules/zod/v4/classic/external.js
config(en_default());

// node_modules/zod/index.js
var zod_default = external_exports;

// node_modules/zod/v3/helpers/util.js
var util;
(function(util2) {
  util2.assertEqual = (_) => {
  };
  function assertIs2(_arg) {
  }
  util2.assertIs = assertIs2;
  function assertNever2(_x) {
    throw new Error();
  }
  util2.assertNever = assertNever2;
  util2.arrayToEnum = (items) => {
    const obj = {};
    for (const item of items) {
      obj[item] = item;
    }
    return obj;
  };
  util2.getValidEnumValues = (obj) => {
    const validKeys = util2.objectKeys(obj).filter((k) => typeof obj[obj[k]] !== "number");
    const filtered = {};
    for (const k of validKeys) {
      filtered[k] = obj[k];
    }
    return util2.objectValues(filtered);
  };
  util2.objectValues = (obj) => {
    return util2.objectKeys(obj).map(function(e) {
      return obj[e];
    });
  };
  util2.objectKeys = typeof Object.keys === "function" ? (obj) => Object.keys(obj) : (object3) => {
    const keys = [];
    for (const key in object3) {
      if (Object.prototype.hasOwnProperty.call(object3, key)) {
        keys.push(key);
      }
    }
    return keys;
  };
  util2.find = (arr, checker) => {
    for (const item of arr) {
      if (checker(item))
        return item;
    }
    return void 0;
  };
  util2.isInteger = typeof Number.isInteger === "function" ? (val) => Number.isInteger(val) : (val) => typeof val === "number" && Number.isFinite(val) && Math.floor(val) === val;
  function joinValues2(array2, separator = " | ") {
    return array2.map((val) => typeof val === "string" ? `'${val}'` : val).join(separator);
  }
  util2.joinValues = joinValues2;
  util2.jsonStringifyReplacer = (_, value) => {
    if (typeof value === "bigint") {
      return value.toString();
    }
    return value;
  };
})(util || (util = {}));
var objectUtil;
(function(objectUtil2) {
  objectUtil2.mergeShapes = (first, second) => {
    return {
      ...first,
      ...second
      // second overwrites first
    };
  };
})(objectUtil || (objectUtil = {}));
var ZodParsedType = util.arrayToEnum([
  "string",
  "nan",
  "number",
  "integer",
  "float",
  "boolean",
  "date",
  "bigint",
  "symbol",
  "function",
  "undefined",
  "null",
  "array",
  "object",
  "unknown",
  "promise",
  "void",
  "never",
  "map",
  "set"
]);
var getParsedType2 = (data) => {
  const t = typeof data;
  switch (t) {
    case "undefined":
      return ZodParsedType.undefined;
    case "string":
      return ZodParsedType.string;
    case "number":
      return Number.isNaN(data) ? ZodParsedType.nan : ZodParsedType.number;
    case "boolean":
      return ZodParsedType.boolean;
    case "function":
      return ZodParsedType.function;
    case "bigint":
      return ZodParsedType.bigint;
    case "symbol":
      return ZodParsedType.symbol;
    case "object":
      if (Array.isArray(data)) {
        return ZodParsedType.array;
      }
      if (data === null) {
        return ZodParsedType.null;
      }
      if (data.then && typeof data.then === "function" && data.catch && typeof data.catch === "function") {
        return ZodParsedType.promise;
      }
      if (typeof Map !== "undefined" && data instanceof Map) {
        return ZodParsedType.map;
      }
      if (typeof Set !== "undefined" && data instanceof Set) {
        return ZodParsedType.set;
      }
      if (typeof Date !== "undefined" && data instanceof Date) {
        return ZodParsedType.date;
      }
      return ZodParsedType.object;
    default:
      return ZodParsedType.unknown;
  }
};

// node_modules/zod/v3/ZodError.js
var ZodIssueCode2 = util.arrayToEnum([
  "invalid_type",
  "invalid_literal",
  "custom",
  "invalid_union",
  "invalid_union_discriminator",
  "invalid_enum_value",
  "unrecognized_keys",
  "invalid_arguments",
  "invalid_return_type",
  "invalid_date",
  "invalid_string",
  "too_small",
  "too_big",
  "invalid_intersection_types",
  "not_multiple_of",
  "not_finite"
]);
var ZodError2 = class _ZodError extends Error {
  get errors() {
    return this.issues;
  }
  constructor(issues) {
    super();
    this.issues = [];
    this.addIssue = (sub) => {
      this.issues = [...this.issues, sub];
    };
    this.addIssues = (subs = []) => {
      this.issues = [...this.issues, ...subs];
    };
    const actualProto = new.target.prototype;
    if (Object.setPrototypeOf) {
      Object.setPrototypeOf(this, actualProto);
    } else {
      this.__proto__ = actualProto;
    }
    this.name = "ZodError";
    this.issues = issues;
  }
  format(_mapper) {
    const mapper = _mapper || function(issue2) {
      return issue2.message;
    };
    const fieldErrors = { _errors: [] };
    const processError = (error48) => {
      for (const issue2 of error48.issues) {
        if (issue2.code === "invalid_union") {
          issue2.unionErrors.map(processError);
        } else if (issue2.code === "invalid_return_type") {
          processError(issue2.returnTypeError);
        } else if (issue2.code === "invalid_arguments") {
          processError(issue2.argumentsError);
        } else if (issue2.path.length === 0) {
          fieldErrors._errors.push(mapper(issue2));
        } else {
          let curr = fieldErrors;
          let i = 0;
          while (i < issue2.path.length) {
            const el = issue2.path[i];
            const terminal = i === issue2.path.length - 1;
            if (!terminal) {
              curr[el] = curr[el] || { _errors: [] };
            } else {
              curr[el] = curr[el] || { _errors: [] };
              curr[el]._errors.push(mapper(issue2));
            }
            curr = curr[el];
            i++;
          }
        }
      }
    };
    processError(this);
    return fieldErrors;
  }
  static assert(value) {
    if (!(value instanceof _ZodError)) {
      throw new Error(`Not a ZodError: ${value}`);
    }
  }
  toString() {
    return this.message;
  }
  get message() {
    return JSON.stringify(this.issues, util.jsonStringifyReplacer, 2);
  }
  get isEmpty() {
    return this.issues.length === 0;
  }
  flatten(mapper = (issue2) => issue2.message) {
    const fieldErrors = /* @__PURE__ */ Object.create(null);
    const formErrors = [];
    for (const sub of this.issues) {
      if (sub.path.length > 0) {
        const firstEl = sub.path[0];
        fieldErrors[firstEl] = fieldErrors[firstEl] || [];
        fieldErrors[firstEl].push(mapper(sub));
      } else {
        formErrors.push(mapper(sub));
      }
    }
    return { formErrors, fieldErrors };
  }
  get formErrors() {
    return this.flatten();
  }
};
ZodError2.create = (issues) => {
  const error48 = new ZodError2(issues);
  return error48;
};

// node_modules/zod/v3/locales/en.js
var errorMap = (issue2, _ctx) => {
  let message;
  switch (issue2.code) {
    case ZodIssueCode2.invalid_type:
      if (issue2.received === ZodParsedType.undefined) {
        message = "Required";
      } else {
        message = `Expected ${issue2.expected}, received ${issue2.received}`;
      }
      break;
    case ZodIssueCode2.invalid_literal:
      message = `Invalid literal value, expected ${JSON.stringify(issue2.expected, util.jsonStringifyReplacer)}`;
      break;
    case ZodIssueCode2.unrecognized_keys:
      message = `Unrecognized key(s) in object: ${util.joinValues(issue2.keys, ", ")}`;
      break;
    case ZodIssueCode2.invalid_union:
      message = `Invalid input`;
      break;
    case ZodIssueCode2.invalid_union_discriminator:
      message = `Invalid discriminator value. Expected ${util.joinValues(issue2.options)}`;
      break;
    case ZodIssueCode2.invalid_enum_value:
      message = `Invalid enum value. Expected ${util.joinValues(issue2.options)}, received '${issue2.received}'`;
      break;
    case ZodIssueCode2.invalid_arguments:
      message = `Invalid function arguments`;
      break;
    case ZodIssueCode2.invalid_return_type:
      message = `Invalid function return type`;
      break;
    case ZodIssueCode2.invalid_date:
      message = `Invalid date`;
      break;
    case ZodIssueCode2.invalid_string:
      if (typeof issue2.validation === "object") {
        if ("includes" in issue2.validation) {
          message = `Invalid input: must include "${issue2.validation.includes}"`;
          if (typeof issue2.validation.position === "number") {
            message = `${message} at one or more positions greater than or equal to ${issue2.validation.position}`;
          }
        } else if ("startsWith" in issue2.validation) {
          message = `Invalid input: must start with "${issue2.validation.startsWith}"`;
        } else if ("endsWith" in issue2.validation) {
          message = `Invalid input: must end with "${issue2.validation.endsWith}"`;
        } else {
          util.assertNever(issue2.validation);
        }
      } else if (issue2.validation !== "regex") {
        message = `Invalid ${issue2.validation}`;
      } else {
        message = "Invalid";
      }
      break;
    case ZodIssueCode2.too_small:
      if (issue2.type === "array")
        message = `Array must contain ${issue2.exact ? "exactly" : issue2.inclusive ? `at least` : `more than`} ${issue2.minimum} element(s)`;
      else if (issue2.type === "string")
        message = `String must contain ${issue2.exact ? "exactly" : issue2.inclusive ? `at least` : `over`} ${issue2.minimum} character(s)`;
      else if (issue2.type === "number")
        message = `Number must be ${issue2.exact ? `exactly equal to ` : issue2.inclusive ? `greater than or equal to ` : `greater than `}${issue2.minimum}`;
      else if (issue2.type === "bigint")
        message = `Number must be ${issue2.exact ? `exactly equal to ` : issue2.inclusive ? `greater than or equal to ` : `greater than `}${issue2.minimum}`;
      else if (issue2.type === "date")
        message = `Date must be ${issue2.exact ? `exactly equal to ` : issue2.inclusive ? `greater than or equal to ` : `greater than `}${new Date(Number(issue2.minimum))}`;
      else
        message = "Invalid input";
      break;
    case ZodIssueCode2.too_big:
      if (issue2.type === "array")
        message = `Array must contain ${issue2.exact ? `exactly` : issue2.inclusive ? `at most` : `less than`} ${issue2.maximum} element(s)`;
      else if (issue2.type === "string")
        message = `String must contain ${issue2.exact ? `exactly` : issue2.inclusive ? `at most` : `under`} ${issue2.maximum} character(s)`;
      else if (issue2.type === "number")
        message = `Number must be ${issue2.exact ? `exactly` : issue2.inclusive ? `less than or equal to` : `less than`} ${issue2.maximum}`;
      else if (issue2.type === "bigint")
        message = `BigInt must be ${issue2.exact ? `exactly` : issue2.inclusive ? `less than or equal to` : `less than`} ${issue2.maximum}`;
      else if (issue2.type === "date")
        message = `Date must be ${issue2.exact ? `exactly` : issue2.inclusive ? `smaller than or equal to` : `smaller than`} ${new Date(Number(issue2.maximum))}`;
      else
        message = "Invalid input";
      break;
    case ZodIssueCode2.custom:
      message = `Invalid input`;
      break;
    case ZodIssueCode2.invalid_intersection_types:
      message = `Intersection results could not be merged`;
      break;
    case ZodIssueCode2.not_multiple_of:
      message = `Number must be a multiple of ${issue2.multipleOf}`;
      break;
    case ZodIssueCode2.not_finite:
      message = "Number must be finite";
      break;
    default:
      message = _ctx.defaultError;
      util.assertNever(issue2);
  }
  return { message };
};
var en_default2 = errorMap;

// node_modules/zod/v3/errors.js
var overrideErrorMap = en_default2;
function getErrorMap2() {
  return overrideErrorMap;
}

// node_modules/zod/v3/helpers/parseUtil.js
var makeIssue = (params) => {
  const { data, path, errorMaps, issueData } = params;
  const fullPath = [...path, ...issueData.path || []];
  const fullIssue = {
    ...issueData,
    path: fullPath
  };
  if (issueData.message !== void 0) {
    return {
      ...issueData,
      path: fullPath,
      message: issueData.message
    };
  }
  let errorMessage = "";
  const maps = errorMaps.filter((m) => !!m).slice().reverse();
  for (const map2 of maps) {
    errorMessage = map2(fullIssue, { data, defaultError: errorMessage }).message;
  }
  return {
    ...issueData,
    path: fullPath,
    message: errorMessage
  };
};
function addIssueToContext(ctx, issueData) {
  const overrideMap = getErrorMap2();
  const issue2 = makeIssue({
    issueData,
    data: ctx.data,
    path: ctx.path,
    errorMaps: [
      ctx.common.contextualErrorMap,
      // contextual error map is first priority
      ctx.schemaErrorMap,
      // then schema-bound map if available
      overrideMap,
      // then global override map
      overrideMap === en_default2 ? void 0 : en_default2
      // then global default map
    ].filter((x) => !!x)
  });
  ctx.common.issues.push(issue2);
}
var ParseStatus = class _ParseStatus {
  constructor() {
    this.value = "valid";
  }
  dirty() {
    if (this.value === "valid")
      this.value = "dirty";
  }
  abort() {
    if (this.value !== "aborted")
      this.value = "aborted";
  }
  static mergeArray(status, results) {
    const arrayValue = [];
    for (const s of results) {
      if (s.status === "aborted")
        return INVALID;
      if (s.status === "dirty")
        status.dirty();
      arrayValue.push(s.value);
    }
    return { status: status.value, value: arrayValue };
  }
  static async mergeObjectAsync(status, pairs) {
    const syncPairs = [];
    for (const pair of pairs) {
      const key = await pair.key;
      const value = await pair.value;
      syncPairs.push({
        key,
        value
      });
    }
    return _ParseStatus.mergeObjectSync(status, syncPairs);
  }
  static mergeObjectSync(status, pairs) {
    const finalObject = {};
    for (const pair of pairs) {
      const { key, value } = pair;
      if (key.status === "aborted")
        return INVALID;
      if (value.status === "aborted")
        return INVALID;
      if (key.status === "dirty")
        status.dirty();
      if (value.status === "dirty")
        status.dirty();
      if (key.value !== "__proto__" && (typeof value.value !== "undefined" || pair.alwaysSet)) {
        finalObject[key.value] = value.value;
      }
    }
    return { status: status.value, value: finalObject };
  }
};
var INVALID = Object.freeze({
  status: "aborted"
});
var DIRTY = (value) => ({ status: "dirty", value });
var OK = (value) => ({ status: "valid", value });
var isAborted = (x) => x.status === "aborted";
var isDirty = (x) => x.status === "dirty";
var isValid = (x) => x.status === "valid";
var isAsync = (x) => typeof Promise !== "undefined" && x instanceof Promise;

// node_modules/zod/v3/helpers/errorUtil.js
var errorUtil;
(function(errorUtil2) {
  errorUtil2.errToObj = (message) => typeof message === "string" ? { message } : message || {};
  errorUtil2.toString = (message) => typeof message === "string" ? message : message?.message;
})(errorUtil || (errorUtil = {}));

// node_modules/zod/v3/types.js
var ParseInputLazyPath = class {
  constructor(parent, value, path, key) {
    this._cachedPath = [];
    this.parent = parent;
    this.data = value;
    this._path = path;
    this._key = key;
  }
  get path() {
    if (!this._cachedPath.length) {
      if (Array.isArray(this._key)) {
        this._cachedPath.push(...this._path, ...this._key);
      } else {
        this._cachedPath.push(...this._path, this._key);
      }
    }
    return this._cachedPath;
  }
};
var handleResult = (ctx, result) => {
  if (isValid(result)) {
    return { success: true, data: result.value };
  } else {
    if (!ctx.common.issues.length) {
      throw new Error("Validation failed but no issues detected.");
    }
    return {
      success: false,
      get error() {
        if (this._error)
          return this._error;
        const error48 = new ZodError2(ctx.common.issues);
        this._error = error48;
        return this._error;
      }
    };
  }
};
function processCreateParams(params) {
  if (!params)
    return {};
  const { errorMap: errorMap2, invalid_type_error, required_error, description } = params;
  if (errorMap2 && (invalid_type_error || required_error)) {
    throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);
  }
  if (errorMap2)
    return { errorMap: errorMap2, description };
  const customMap = (iss, ctx) => {
    const { message } = params;
    if (iss.code === "invalid_enum_value") {
      return { message: message ?? ctx.defaultError };
    }
    if (typeof ctx.data === "undefined") {
      return { message: message ?? required_error ?? ctx.defaultError };
    }
    if (iss.code !== "invalid_type")
      return { message: ctx.defaultError };
    return { message: message ?? invalid_type_error ?? ctx.defaultError };
  };
  return { errorMap: customMap, description };
}
var ZodType2 = class {
  get description() {
    return this._def.description;
  }
  _getType(input) {
    return getParsedType2(input.data);
  }
  _getOrReturnCtx(input, ctx) {
    return ctx || {
      common: input.parent.common,
      data: input.data,
      parsedType: getParsedType2(input.data),
      schemaErrorMap: this._def.errorMap,
      path: input.path,
      parent: input.parent
    };
  }
  _processInputParams(input) {
    return {
      status: new ParseStatus(),
      ctx: {
        common: input.parent.common,
        data: input.data,
        parsedType: getParsedType2(input.data),
        schemaErrorMap: this._def.errorMap,
        path: input.path,
        parent: input.parent
      }
    };
  }
  _parseSync(input) {
    const result = this._parse(input);
    if (isAsync(result)) {
      throw new Error("Synchronous parse encountered promise.");
    }
    return result;
  }
  _parseAsync(input) {
    const result = this._parse(input);
    return Promise.resolve(result);
  }
  parse(data, params) {
    const result = this.safeParse(data, params);
    if (result.success)
      return result.data;
    throw result.error;
  }
  safeParse(data, params) {
    const ctx = {
      common: {
        issues: [],
        async: params?.async ?? false,
        contextualErrorMap: params?.errorMap
      },
      path: params?.path || [],
      schemaErrorMap: this._def.errorMap,
      parent: null,
      data,
      parsedType: getParsedType2(data)
    };
    const result = this._parseSync({ data, path: ctx.path, parent: ctx });
    return handleResult(ctx, result);
  }
  "~validate"(data) {
    const ctx = {
      common: {
        issues: [],
        async: !!this["~standard"].async
      },
      path: [],
      schemaErrorMap: this._def.errorMap,
      parent: null,
      data,
      parsedType: getParsedType2(data)
    };
    if (!this["~standard"].async) {
      try {
        const result = this._parseSync({ data, path: [], parent: ctx });
        return isValid(result) ? {
          value: result.value
        } : {
          issues: ctx.common.issues
        };
      } catch (err) {
        if (err?.message?.toLowerCase()?.includes("encountered")) {
          this["~standard"].async = true;
        }
        ctx.common = {
          issues: [],
          async: true
        };
      }
    }
    return this._parseAsync({ data, path: [], parent: ctx }).then((result) => isValid(result) ? {
      value: result.value
    } : {
      issues: ctx.common.issues
    });
  }
  async parseAsync(data, params) {
    const result = await this.safeParseAsync(data, params);
    if (result.success)
      return result.data;
    throw result.error;
  }
  async safeParseAsync(data, params) {
    const ctx = {
      common: {
        issues: [],
        contextualErrorMap: params?.errorMap,
        async: true
      },
      path: params?.path || [],
      schemaErrorMap: this._def.errorMap,
      parent: null,
      data,
      parsedType: getParsedType2(data)
    };
    const maybeAsyncResult = this._parse({ data, path: ctx.path, parent: ctx });
    const result = await (isAsync(maybeAsyncResult) ? maybeAsyncResult : Promise.resolve(maybeAsyncResult));
    return handleResult(ctx, result);
  }
  refine(check2, message) {
    const getIssueProperties = (val) => {
      if (typeof message === "string" || typeof message === "undefined") {
        return { message };
      } else if (typeof message === "function") {
        return message(val);
      } else {
        return message;
      }
    };
    return this._refinement((val, ctx) => {
      const result = check2(val);
      const setError = () => ctx.addIssue({
        code: ZodIssueCode2.custom,
        ...getIssueProperties(val)
      });
      if (typeof Promise !== "undefined" && result instanceof Promise) {
        return result.then((data) => {
          if (!data) {
            setError();
            return false;
          } else {
            return true;
          }
        });
      }
      if (!result) {
        setError();
        return false;
      } else {
        return true;
      }
    });
  }
  refinement(check2, refinementData) {
    return this._refinement((val, ctx) => {
      if (!check2(val)) {
        ctx.addIssue(typeof refinementData === "function" ? refinementData(val, ctx) : refinementData);
        return false;
      } else {
        return true;
      }
    });
  }
  _refinement(refinement) {
    return new ZodEffects({
      schema: this,
      typeName: ZodFirstPartyTypeKind2.ZodEffects,
      effect: { type: "refinement", refinement }
    });
  }
  superRefine(refinement) {
    return this._refinement(refinement);
  }
  constructor(def) {
    this.spa = this.safeParseAsync;
    this._def = def;
    this.parse = this.parse.bind(this);
    this.safeParse = this.safeParse.bind(this);
    this.parseAsync = this.parseAsync.bind(this);
    this.safeParseAsync = this.safeParseAsync.bind(this);
    this.spa = this.spa.bind(this);
    this.refine = this.refine.bind(this);
    this.refinement = this.refinement.bind(this);
    this.superRefine = this.superRefine.bind(this);
    this.optional = this.optional.bind(this);
    this.nullable = this.nullable.bind(this);
    this.nullish = this.nullish.bind(this);
    this.array = this.array.bind(this);
    this.promise = this.promise.bind(this);
    this.or = this.or.bind(this);
    this.and = this.and.bind(this);
    this.transform = this.transform.bind(this);
    this.brand = this.brand.bind(this);
    this.default = this.default.bind(this);
    this.catch = this.catch.bind(this);
    this.describe = this.describe.bind(this);
    this.pipe = this.pipe.bind(this);
    this.readonly = this.readonly.bind(this);
    this.isNullable = this.isNullable.bind(this);
    this.isOptional = this.isOptional.bind(this);
    this["~standard"] = {
      version: 1,
      vendor: "zod",
      validate: (data) => this["~validate"](data)
    };
  }
  optional() {
    return ZodOptional2.create(this, this._def);
  }
  nullable() {
    return ZodNullable2.create(this, this._def);
  }
  nullish() {
    return this.nullable().optional();
  }
  array() {
    return ZodArray2.create(this);
  }
  promise() {
    return ZodPromise2.create(this, this._def);
  }
  or(option) {
    return ZodUnion2.create([this, option], this._def);
  }
  and(incoming) {
    return ZodIntersection2.create(this, incoming, this._def);
  }
  transform(transform2) {
    return new ZodEffects({
      ...processCreateParams(this._def),
      schema: this,
      typeName: ZodFirstPartyTypeKind2.ZodEffects,
      effect: { type: "transform", transform: transform2 }
    });
  }
  default(def) {
    const defaultValueFunc = typeof def === "function" ? def : () => def;
    return new ZodDefault2({
      ...processCreateParams(this._def),
      innerType: this,
      defaultValue: defaultValueFunc,
      typeName: ZodFirstPartyTypeKind2.ZodDefault
    });
  }
  brand() {
    return new ZodBranded({
      typeName: ZodFirstPartyTypeKind2.ZodBranded,
      type: this,
      ...processCreateParams(this._def)
    });
  }
  catch(def) {
    const catchValueFunc = typeof def === "function" ? def : () => def;
    return new ZodCatch2({
      ...processCreateParams(this._def),
      innerType: this,
      catchValue: catchValueFunc,
      typeName: ZodFirstPartyTypeKind2.ZodCatch
    });
  }
  describe(description) {
    const This = this.constructor;
    return new This({
      ...this._def,
      description
    });
  }
  pipe(target) {
    return ZodPipeline.create(this, target);
  }
  readonly() {
    return ZodReadonly2.create(this);
  }
  isOptional() {
    return this.safeParse(void 0).success;
  }
  isNullable() {
    return this.safeParse(null).success;
  }
};
var cuidRegex = /^c[^\s-]{8,}$/i;
var cuid2Regex = /^[0-9a-z]+$/;
var ulidRegex = /^[0-9A-HJKMNP-TV-Z]{26}$/i;
var uuidRegex = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i;
var nanoidRegex = /^[a-z0-9_-]{21}$/i;
var jwtRegex = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/;
var durationRegex = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/;
var emailRegex = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;
var _emojiRegex = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;
var emojiRegex;
var ipv4Regex = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/;
var ipv4CidrRegex = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/;
var ipv6Regex = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/;
var ipv6CidrRegex = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/;
var base64Regex = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/;
var base64urlRegex = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/;
var dateRegexSource = `((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))`;
var dateRegex = new RegExp(`^${dateRegexSource}$`);
function timeRegexSource(args) {
  let secondsRegexSource = `[0-5]\\d`;
  if (args.precision) {
    secondsRegexSource = `${secondsRegexSource}\\.\\d{${args.precision}}`;
  } else if (args.precision == null) {
    secondsRegexSource = `${secondsRegexSource}(\\.\\d+)?`;
  }
  const secondsQuantifier = args.precision ? "+" : "?";
  return `([01]\\d|2[0-3]):[0-5]\\d(:${secondsRegexSource})${secondsQuantifier}`;
}
function timeRegex(args) {
  return new RegExp(`^${timeRegexSource(args)}$`);
}
function datetimeRegex(args) {
  let regex = `${dateRegexSource}T${timeRegexSource(args)}`;
  const opts = [];
  opts.push(args.local ? `Z?` : `Z`);
  if (args.offset)
    opts.push(`([+-]\\d{2}:?\\d{2})`);
  regex = `${regex}(${opts.join("|")})`;
  return new RegExp(`^${regex}$`);
}
function isValidIP(ip, version2) {
  if ((version2 === "v4" || !version2) && ipv4Regex.test(ip)) {
    return true;
  }
  if ((version2 === "v6" || !version2) && ipv6Regex.test(ip)) {
    return true;
  }
  return false;
}
function isValidJWT2(jwt2, alg) {
  if (!jwtRegex.test(jwt2))
    return false;
  try {
    const [header] = jwt2.split(".");
    if (!header)
      return false;
    const base643 = header.replace(/-/g, "+").replace(/_/g, "/").padEnd(header.length + (4 - header.length % 4) % 4, "=");
    const decoded = JSON.parse(atob(base643));
    if (typeof decoded !== "object" || decoded === null)
      return false;
    if ("typ" in decoded && decoded?.typ !== "JWT")
      return false;
    if (!decoded.alg)
      return false;
    if (alg && decoded.alg !== alg)
      return false;
    return true;
  } catch {
    return false;
  }
}
function isValidCidr(ip, version2) {
  if ((version2 === "v4" || !version2) && ipv4CidrRegex.test(ip)) {
    return true;
  }
  if ((version2 === "v6" || !version2) && ipv6CidrRegex.test(ip)) {
    return true;
  }
  return false;
}
var ZodString2 = class _ZodString2 extends ZodType2 {
  _parse(input) {
    if (this._def.coerce) {
      input.data = String(input.data);
    }
    const parsedType2 = this._getType(input);
    if (parsedType2 !== ZodParsedType.string) {
      const ctx2 = this._getOrReturnCtx(input);
      addIssueToContext(ctx2, {
        code: ZodIssueCode2.invalid_type,
        expected: ZodParsedType.string,
        received: ctx2.parsedType
      });
      return INVALID;
    }
    const status = new ParseStatus();
    let ctx = void 0;
    for (const check2 of this._def.checks) {
      if (check2.kind === "min") {
        if (input.data.length < check2.value) {
          ctx = this._getOrReturnCtx(input, ctx);
          addIssueToContext(ctx, {
            code: ZodIssueCode2.too_small,
            minimum: check2.value,
            type: "string",
            inclusive: true,
            exact: false,
            message: check2.message
          });
          status.dirty();
        }
      } else if (check2.kind === "max") {
        if (input.data.length > check2.value) {
          ctx = this._getOrReturnCtx(input, ctx);
          addIssueToContext(ctx, {
            code: ZodIssueCode2.too_big,
            maximum: check2.value,
            type: "string",
            inclusive: true,
            exact: false,
            message: check2.message
          });
          status.dirty();
        }
      } else if (check2.kind === "length") {
        const tooBig = input.data.length > check2.value;
        const tooSmall = input.data.length < check2.value;
        if (tooBig || tooSmall) {
          ctx = this._getOrReturnCtx(input, ctx);
          if (tooBig) {
            addIssueToContext(ctx, {
              code: ZodIssueCode2.too_big,
              maximum: check2.value,
              type: "string",
              inclusive: true,
              exact: true,
              message: check2.message
            });
          } else if (tooSmall) {
            addIssueToContext(ctx, {
              code: ZodIssueCode2.too_small,
              minimum: check2.value,
              type: "string",
              inclusive: true,
              exact: true,
              message: check2.message
            });
          }
          status.dirty();
        }
      } else if (check2.kind === "email") {
        if (!emailRegex.test(input.data)) {
          ctx = this._getOrReturnCtx(input, ctx);
          addIssueToContext(ctx, {
            validation: "email",
            code: ZodIssueCode2.invalid_string,
            message: check2.message
          });
          status.dirty();
        }
      } else if (check2.kind === "emoji") {
        if (!emojiRegex) {
          emojiRegex = new RegExp(_emojiRegex, "u");
        }
        if (!emojiRegex.test(input.data)) {
          ctx = this._getOrReturnCtx(input, ctx);
          addIssueToContext(ctx, {
            validation: "emoji",
            code: ZodIssueCode2.invalid_string,
            message: check2.message
          });
          status.dirty();
        }
      } else if (check2.kind === "uuid") {
        if (!uuidRegex.test(input.data)) {
          ctx = this._getOrReturnCtx(input, ctx);
          addIssueToContext(ctx, {
            validation: "uuid",
            code: ZodIssueCode2.invalid_string,
            message: check2.message
          });
          status.dirty();
        }
      } else if (check2.kind === "nanoid") {
        if (!nanoidRegex.test(input.data)) {
          ctx = this._getOrReturnCtx(input, ctx);
          addIssueToContext(ctx, {
            validation: "nanoid",
            code: ZodIssueCode2.invalid_string,
            message: check2.message
          });
          status.dirty();
        }
      } else if (check2.kind === "cuid") {
        if (!cuidRegex.test(input.data)) {
          ctx = this._getOrReturnCtx(input, ctx);
          addIssueToContext(ctx, {
            validation: "cuid",
            code: ZodIssueCode2.invalid_string,
            message: check2.message
          });
          status.dirty();
        }
      } else if (check2.kind === "cuid2") {
        if (!cuid2Regex.test(input.data)) {
          ctx = this._getOrReturnCtx(input, ctx);
          addIssueToContext(ctx, {
            validation: "cuid2",
            code: ZodIssueCode2.invalid_string,
            message: check2.message
          });
          status.dirty();
        }
      } else if (check2.kind === "ulid") {
        if (!ulidRegex.test(input.data)) {
          ctx = this._getOrReturnCtx(input, ctx);
          addIssueToContext(ctx, {
            validation: "ulid",
            code: ZodIssueCode2.invalid_string,
            message: check2.message
          });
          status.dirty();
        }
      } else if (check2.kind === "url") {
        try {
          new URL(input.data);
        } catch {
          ctx = this._getOrReturnCtx(input, ctx);
          addIssueToContext(ctx, {
            validation: "url",
            code: ZodIssueCode2.invalid_string,
            message: check2.message
          });
          status.dirty();
        }
      } else if (check2.kind === "regex") {
        check2.regex.lastIndex = 0;
        const testResult = check2.regex.test(input.data);
        if (!testResult) {
          ctx = this._getOrReturnCtx(input, ctx);
          addIssueToContext(ctx, {
            validation: "regex",
            code: ZodIssueCode2.invalid_string,
            message: check2.message
          });
          status.dirty();
        }
      } else if (check2.kind === "trim") {
        input.data = input.data.trim();
      } else if (check2.kind === "includes") {
        if (!input.data.includes(check2.value, check2.position)) {
          ctx = this._getOrReturnCtx(input, ctx);
          addIssueToContext(ctx, {
            code: ZodIssueCode2.invalid_string,
            validation: { includes: check2.value, position: check2.position },
            message: check2.message
          });
          status.dirty();
        }
      } else if (check2.kind === "toLowerCase") {
        input.data = input.data.toLowerCase();
      } else if (check2.kind === "toUpperCase") {
        input.data = input.data.toUpperCase();
      } else if (check2.kind === "startsWith") {
        if (!input.data.startsWith(check2.value)) {
          ctx = this._getOrReturnCtx(input, ctx);
          addIssueToContext(ctx, {
            code: ZodIssueCode2.invalid_string,
            validation: { startsWith: check2.value },
            message: check2.message
          });
          status.dirty();
        }
      } else if (check2.kind === "endsWith") {
        if (!input.data.endsWith(check2.value)) {
          ctx = this._getOrReturnCtx(input, ctx);
          addIssueToContext(ctx, {
            code: ZodIssueCode2.invalid_string,
            validation: { endsWith: check2.value },
            message: check2.message
          });
          status.dirty();
        }
      } else if (check2.kind === "datetime") {
        const regex = datetimeRegex(check2);
        if (!regex.test(input.data)) {
          ctx = this._getOrReturnCtx(input, ctx);
          addIssueToContext(ctx, {
            code: ZodIssueCode2.invalid_string,
            validation: "datetime",
            message: check2.message
          });
          status.dirty();
        }
      } else if (check2.kind === "date") {
        const regex = dateRegex;
        if (!regex.test(input.data)) {
          ctx = this._getOrReturnCtx(input, ctx);
          addIssueToContext(ctx, {
            code: ZodIssueCode2.invalid_string,
            validation: "date",
            message: check2.message
          });
          status.dirty();
        }
      } else if (check2.kind === "time") {
        const regex = timeRegex(check2);
        if (!regex.test(input.data)) {
          ctx = this._getOrReturnCtx(input, ctx);
          addIssueToContext(ctx, {
            code: ZodIssueCode2.invalid_string,
            validation: "time",
            message: check2.message
          });
          status.dirty();
        }
      } else if (check2.kind === "duration") {
        if (!durationRegex.test(input.data)) {
          ctx = this._getOrReturnCtx(input, ctx);
          addIssueToContext(ctx, {
            validation: "duration",
            code: ZodIssueCode2.invalid_string,
            message: check2.message
          });
          status.dirty();
        }
      } else if (check2.kind === "ip") {
        if (!isValidIP(input.data, check2.version)) {
          ctx = this._getOrReturnCtx(input, ctx);
          addIssueToContext(ctx, {
            validation: "ip",
            code: ZodIssueCode2.invalid_string,
            message: check2.message
          });
          status.dirty();
        }
      } else if (check2.kind === "jwt") {
        if (!isValidJWT2(input.data, check2.alg)) {
          ctx = this._getOrReturnCtx(input, ctx);
          addIssueToContext(ctx, {
            validation: "jwt",
            code: ZodIssueCode2.invalid_string,
            message: check2.message
          });
          status.dirty();
        }
      } else if (check2.kind === "cidr") {
        if (!isValidCidr(input.data, check2.version)) {
          ctx = this._getOrReturnCtx(input, ctx);
          addIssueToContext(ctx, {
            validation: "cidr",
            code: ZodIssueCode2.invalid_string,
            message: check2.message
          });
          status.dirty();
        }
      } else if (check2.kind === "base64") {
        if (!base64Regex.test(input.data)) {
          ctx = this._getOrReturnCtx(input, ctx);
          addIssueToContext(ctx, {
            validation: "base64",
            code: ZodIssueCode2.invalid_string,
            message: check2.message
          });
          status.dirty();
        }
      } else if (check2.kind === "base64url") {
        if (!base64urlRegex.test(input.data)) {
          ctx = this._getOrReturnCtx(input, ctx);
          addIssueToContext(ctx, {
            validation: "base64url",
            code: ZodIssueCode2.invalid_string,
            message: check2.message
          });
          status.dirty();
        }
      } else {
        util.assertNever(check2);
      }
    }
    return { status: status.value, value: input.data };
  }
  _regex(regex, validation, message) {
    return this.refinement((data) => regex.test(data), {
      validation,
      code: ZodIssueCode2.invalid_string,
      ...errorUtil.errToObj(message)
    });
  }
  _addCheck(check2) {
    return new _ZodString2({
      ...this._def,
      checks: [...this._def.checks, check2]
    });
  }
  email(message) {
    return this._addCheck({ kind: "email", ...errorUtil.errToObj(message) });
  }
  url(message) {
    return this._addCheck({ kind: "url", ...errorUtil.errToObj(message) });
  }
  emoji(message) {
    return this._addCheck({ kind: "emoji", ...errorUtil.errToObj(message) });
  }
  uuid(message) {
    return this._addCheck({ kind: "uuid", ...errorUtil.errToObj(message) });
  }
  nanoid(message) {
    return this._addCheck({ kind: "nanoid", ...errorUtil.errToObj(message) });
  }
  cuid(message) {
    return this._addCheck({ kind: "cuid", ...errorUtil.errToObj(message) });
  }
  cuid2(message) {
    return this._addCheck({ kind: "cuid2", ...errorUtil.errToObj(message) });
  }
  ulid(message) {
    return this._addCheck({ kind: "ulid", ...errorUtil.errToObj(message) });
  }
  base64(message) {
    return this._addCheck({ kind: "base64", ...errorUtil.errToObj(message) });
  }
  base64url(message) {
    return this._addCheck({
      kind: "base64url",
      ...errorUtil.errToObj(message)
    });
  }
  jwt(options2) {
    return this._addCheck({ kind: "jwt", ...errorUtil.errToObj(options2) });
  }
  ip(options2) {
    return this._addCheck({ kind: "ip", ...errorUtil.errToObj(options2) });
  }
  cidr(options2) {
    return this._addCheck({ kind: "cidr", ...errorUtil.errToObj(options2) });
  }
  datetime(options2) {
    if (typeof options2 === "string") {
      return this._addCheck({
        kind: "datetime",
        precision: null,
        offset: false,
        local: false,
        message: options2
      });
    }
    return this._addCheck({
      kind: "datetime",
      precision: typeof options2?.precision === "undefined" ? null : options2?.precision,
      offset: options2?.offset ?? false,
      local: options2?.local ?? false,
      ...errorUtil.errToObj(options2?.message)
    });
  }
  date(message) {
    return this._addCheck({ kind: "date", message });
  }
  time(options2) {
    if (typeof options2 === "string") {
      return this._addCheck({
        kind: "time",
        precision: null,
        message: options2
      });
    }
    return this._addCheck({
      kind: "time",
      precision: typeof options2?.precision === "undefined" ? null : options2?.precision,
      ...errorUtil.errToObj(options2?.message)
    });
  }
  duration(message) {
    return this._addCheck({ kind: "duration", ...errorUtil.errToObj(message) });
  }
  regex(regex, message) {
    return this._addCheck({
      kind: "regex",
      regex,
      ...errorUtil.errToObj(message)
    });
  }
  includes(value, options2) {
    return this._addCheck({
      kind: "includes",
      value,
      position: options2?.position,
      ...errorUtil.errToObj(options2?.message)
    });
  }
  startsWith(value, message) {
    return this._addCheck({
      kind: "startsWith",
      value,
      ...errorUtil.errToObj(message)
    });
  }
  endsWith(value, message) {
    return this._addCheck({
      kind: "endsWith",
      value,
      ...errorUtil.errToObj(message)
    });
  }
  min(minLength, message) {
    return this._addCheck({
      kind: "min",
      value: minLength,
      ...errorUtil.errToObj(message)
    });
  }
  max(maxLength, message) {
    return this._addCheck({
      kind: "max",
      value: maxLength,
      ...errorUtil.errToObj(message)
    });
  }
  length(len, message) {
    return this._addCheck({
      kind: "length",
      value: len,
      ...errorUtil.errToObj(message)
    });
  }
  /**
   * Equivalent to `.min(1)`
   */
  nonempty(message) {
    return this.min(1, errorUtil.errToObj(message));
  }
  trim() {
    return new _ZodString2({
      ...this._def,
      checks: [...this._def.checks, { kind: "trim" }]
    });
  }
  toLowerCase() {
    return new _ZodString2({
      ...this._def,
      checks: [...this._def.checks, { kind: "toLowerCase" }]
    });
  }
  toUpperCase() {
    return new _ZodString2({
      ...this._def,
      checks: [...this._def.checks, { kind: "toUpperCase" }]
    });
  }
  get isDatetime() {
    return !!this._def.checks.find((ch) => ch.kind === "datetime");
  }
  get isDate() {
    return !!this._def.checks.find((ch) => ch.kind === "date");
  }
  get isTime() {
    return !!this._def.checks.find((ch) => ch.kind === "time");
  }
  get isDuration() {
    return !!this._def.checks.find((ch) => ch.kind === "duration");
  }
  get isEmail() {
    return !!this._def.checks.find((ch) => ch.kind === "email");
  }
  get isURL() {
    return !!this._def.checks.find((ch) => ch.kind === "url");
  }
  get isEmoji() {
    return !!this._def.checks.find((ch) => ch.kind === "emoji");
  }
  get isUUID() {
    return !!this._def.checks.find((ch) => ch.kind === "uuid");
  }
  get isNANOID() {
    return !!this._def.checks.find((ch) => ch.kind === "nanoid");
  }
  get isCUID() {
    return !!this._def.checks.find((ch) => ch.kind === "cuid");
  }
  get isCUID2() {
    return !!this._def.checks.find((ch) => ch.kind === "cuid2");
  }
  get isULID() {
    return !!this._def.checks.find((ch) => ch.kind === "ulid");
  }
  get isIP() {
    return !!this._def.checks.find((ch) => ch.kind === "ip");
  }
  get isCIDR() {
    return !!this._def.checks.find((ch) => ch.kind === "cidr");
  }
  get isBase64() {
    return !!this._def.checks.find((ch) => ch.kind === "base64");
  }
  get isBase64url() {
    return !!this._def.checks.find((ch) => ch.kind === "base64url");
  }
  get minLength() {
    let min = null;
    for (const ch of this._def.checks) {
      if (ch.kind === "min") {
        if (min === null || ch.value > min)
          min = ch.value;
      }
    }
    return min;
  }
  get maxLength() {
    let max = null;
    for (const ch of this._def.checks) {
      if (ch.kind === "max") {
        if (max === null || ch.value < max)
          max = ch.value;
      }
    }
    return max;
  }
};
ZodString2.create = (params) => {
  return new ZodString2({
    checks: [],
    typeName: ZodFirstPartyTypeKind2.ZodString,
    coerce: params?.coerce ?? false,
    ...processCreateParams(params)
  });
};
function floatSafeRemainder2(val, step) {
  const valDecCount = (val.toString().split(".")[1] || "").length;
  const stepDecCount = (step.toString().split(".")[1] || "").length;
  const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount;
  const valInt = Number.parseInt(val.toFixed(decCount).replace(".", ""));
  const stepInt = Number.parseInt(step.toFixed(decCount).replace(".", ""));
  return valInt % stepInt / 10 ** decCount;
}
var ZodNumber2 = class _ZodNumber extends ZodType2 {
  constructor() {
    super(...arguments);
    this.min = this.gte;
    this.max = this.lte;
    this.step = this.multipleOf;
  }
  _parse(input) {
    if (this._def.coerce) {
      input.data = Number(input.data);
    }
    const parsedType2 = this._getType(input);
    if (parsedType2 !== ZodParsedType.number) {
      const ctx2 = this._getOrReturnCtx(input);
      addIssueToContext(ctx2, {
        code: ZodIssueCode2.invalid_type,
        expected: ZodParsedType.number,
        received: ctx2.parsedType
      });
      return INVALID;
    }
    let ctx = void 0;
    const status = new ParseStatus();
    for (const check2 of this._def.checks) {
      if (check2.kind === "int") {
        if (!util.isInteger(input.data)) {
          ctx = this._getOrReturnCtx(input, ctx);
          addIssueToContext(ctx, {
            code: ZodIssueCode2.invalid_type,
            expected: "integer",
            received: "float",
            message: check2.message
          });
          status.dirty();
        }
      } else if (check2.kind === "min") {
        const tooSmall = check2.inclusive ? input.data < check2.value : input.data <= check2.value;
        if (tooSmall) {
          ctx = this._getOrReturnCtx(input, ctx);
          addIssueToContext(ctx, {
            code: ZodIssueCode2.too_small,
            minimum: check2.value,
            type: "number",
            inclusive: check2.inclusive,
            exact: false,
            message: check2.message
          });
          status.dirty();
        }
      } else if (check2.kind === "max") {
        const tooBig = check2.inclusive ? input.data > check2.value : input.data >= check2.value;
        if (tooBig) {
          ctx = this._getOrReturnCtx(input, ctx);
          addIssueToContext(ctx, {
            code: ZodIssueCode2.too_big,
            maximum: check2.value,
            type: "number",
            inclusive: check2.inclusive,
            exact: false,
            message: check2.message
          });
          status.dirty();
        }
      } else if (check2.kind === "multipleOf") {
        if (floatSafeRemainder2(input.data, check2.value) !== 0) {
          ctx = this._getOrReturnCtx(input, ctx);
          addIssueToContext(ctx, {
            code: ZodIssueCode2.not_multiple_of,
            multipleOf: check2.value,
            message: check2.message
          });
          status.dirty();
        }
      } else if (check2.kind === "finite") {
        if (!Number.isFinite(input.data)) {
          ctx = this._getOrReturnCtx(input, ctx);
          addIssueToContext(ctx, {
            code: ZodIssueCode2.not_finite,
            message: check2.message
          });
          status.dirty();
        }
      } else {
        util.assertNever(check2);
      }
    }
    return { status: status.value, value: input.data };
  }
  gte(value, message) {
    return this.setLimit("min", value, true, errorUtil.toString(message));
  }
  gt(value, message) {
    return this.setLimit("min", value, false, errorUtil.toString(message));
  }
  lte(value, message) {
    return this.setLimit("max", value, true, errorUtil.toString(message));
  }
  lt(value, message) {
    return this.setLimit("max", value, false, errorUtil.toString(message));
  }
  setLimit(kind, value, inclusive, message) {
    return new _ZodNumber({
      ...this._def,
      checks: [
        ...this._def.checks,
        {
          kind,
          value,
          inclusive,
          message: errorUtil.toString(message)
        }
      ]
    });
  }
  _addCheck(check2) {
    return new _ZodNumber({
      ...this._def,
      checks: [...this._def.checks, check2]
    });
  }
  int(message) {
    return this._addCheck({
      kind: "int",
      message: errorUtil.toString(message)
    });
  }
  positive(message) {
    return this._addCheck({
      kind: "min",
      value: 0,
      inclusive: false,
      message: errorUtil.toString(message)
    });
  }
  negative(message) {
    return this._addCheck({
      kind: "max",
      value: 0,
      inclusive: false,
      message: errorUtil.toString(message)
    });
  }
  nonpositive(message) {
    return this._addCheck({
      kind: "max",
      value: 0,
      inclusive: true,
      message: errorUtil.toString(message)
    });
  }
  nonnegative(message) {
    return this._addCheck({
      kind: "min",
      value: 0,
      inclusive: true,
      message: errorUtil.toString(message)
    });
  }
  multipleOf(value, message) {
    return this._addCheck({
      kind: "multipleOf",
      value,
      message: errorUtil.toString(message)
    });
  }
  finite(message) {
    return this._addCheck({
      kind: "finite",
      message: errorUtil.toString(message)
    });
  }
  safe(message) {
    return this._addCheck({
      kind: "min",
      inclusive: true,
      value: Number.MIN_SAFE_INTEGER,
      message: errorUtil.toString(message)
    })._addCheck({
      kind: "max",
      inclusive: true,
      value: Number.MAX_SAFE_INTEGER,
      message: errorUtil.toString(message)
    });
  }
  get minValue() {
    let min = null;
    for (const ch of this._def.checks) {
      if (ch.kind === "min") {
        if (min === null || ch.value > min)
          min = ch.value;
      }
    }
    return min;
  }
  get maxValue() {
    let max = null;
    for (const ch of this._def.checks) {
      if (ch.kind === "max") {
        if (max === null || ch.value < max)
          max = ch.value;
      }
    }
    return max;
  }
  get isInt() {
    return !!this._def.checks.find((ch) => ch.kind === "int" || ch.kind === "multipleOf" && util.isInteger(ch.value));
  }
  get isFinite() {
    let max = null;
    let min = null;
    for (const ch of this._def.checks) {
      if (ch.kind === "finite" || ch.kind === "int" || ch.kind === "multipleOf") {
        return true;
      } else if (ch.kind === "min") {
        if (min === null || ch.value > min)
          min = ch.value;
      } else if (ch.kind === "max") {
        if (max === null || ch.value < max)
          max = ch.value;
      }
    }
    return Number.isFinite(min) && Number.isFinite(max);
  }
};
ZodNumber2.create = (params) => {
  return new ZodNumber2({
    checks: [],
    typeName: ZodFirstPartyTypeKind2.ZodNumber,
    coerce: params?.coerce || false,
    ...processCreateParams(params)
  });
};
var ZodBigInt2 = class _ZodBigInt extends ZodType2 {
  constructor() {
    super(...arguments);
    this.min = this.gte;
    this.max = this.lte;
  }
  _parse(input) {
    if (this._def.coerce) {
      try {
        input.data = BigInt(input.data);
      } catch {
        return this._getInvalidInput(input);
      }
    }
    const parsedType2 = this._getType(input);
    if (parsedType2 !== ZodParsedType.bigint) {
      return this._getInvalidInput(input);
    }
    let ctx = void 0;
    const status = new ParseStatus();
    for (const check2 of this._def.checks) {
      if (check2.kind === "min") {
        const tooSmall = check2.inclusive ? input.data < check2.value : input.data <= check2.value;
        if (tooSmall) {
          ctx = this._getOrReturnCtx(input, ctx);
          addIssueToContext(ctx, {
            code: ZodIssueCode2.too_small,
            type: "bigint",
            minimum: check2.value,
            inclusive: check2.inclusive,
            message: check2.message
          });
          status.dirty();
        }
      } else if (check2.kind === "max") {
        const tooBig = check2.inclusive ? input.data > check2.value : input.data >= check2.value;
        if (tooBig) {
          ctx = this._getOrReturnCtx(input, ctx);
          addIssueToContext(ctx, {
            code: ZodIssueCode2.too_big,
            type: "bigint",
            maximum: check2.value,
            inclusive: check2.inclusive,
            message: check2.message
          });
          status.dirty();
        }
      } else if (check2.kind === "multipleOf") {
        if (input.data % check2.value !== BigInt(0)) {
          ctx = this._getOrReturnCtx(input, ctx);
          addIssueToContext(ctx, {
            code: ZodIssueCode2.not_multiple_of,
            multipleOf: check2.value,
            message: check2.message
          });
          status.dirty();
        }
      } else {
        util.assertNever(check2);
      }
    }
    return { status: status.value, value: input.data };
  }
  _getInvalidInput(input) {
    const ctx = this._getOrReturnCtx(input);
    addIssueToContext(ctx, {
      code: ZodIssueCode2.invalid_type,
      expected: ZodParsedType.bigint,
      received: ctx.parsedType
    });
    return INVALID;
  }
  gte(value, message) {
    return this.setLimit("min", value, true, errorUtil.toString(message));
  }
  gt(value, message) {
    return this.setLimit("min", value, false, errorUtil.toString(message));
  }
  lte(value, message) {
    return this.setLimit("max", value, true, errorUtil.toString(message));
  }
  lt(value, message) {
    return this.setLimit("max", value, false, errorUtil.toString(message));
  }
  setLimit(kind, value, inclusive, message) {
    return new _ZodBigInt({
      ...this._def,
      checks: [
        ...this._def.checks,
        {
          kind,
          value,
          inclusive,
          message: errorUtil.toString(message)
        }
      ]
    });
  }
  _addCheck(check2) {
    return new _ZodBigInt({
      ...this._def,
      checks: [...this._def.checks, check2]
    });
  }
  positive(message) {
    return this._addCheck({
      kind: "min",
      value: BigInt(0),
      inclusive: false,
      message: errorUtil.toString(message)
    });
  }
  negative(message) {
    return this._addCheck({
      kind: "max",
      value: BigInt(0),
      inclusive: false,
      message: errorUtil.toString(message)
    });
  }
  nonpositive(message) {
    return this._addCheck({
      kind: "max",
      value: BigInt(0),
      inclusive: true,
      message: errorUtil.toString(message)
    });
  }
  nonnegative(message) {
    return this._addCheck({
      kind: "min",
      value: BigInt(0),
      inclusive: true,
      message: errorUtil.toString(message)
    });
  }
  multipleOf(value, message) {
    return this._addCheck({
      kind: "multipleOf",
      value,
      message: errorUtil.toString(message)
    });
  }
  get minValue() {
    let min = null;
    for (const ch of this._def.checks) {
      if (ch.kind === "min") {
        if (min === null || ch.value > min)
          min = ch.value;
      }
    }
    return min;
  }
  get maxValue() {
    let max = null;
    for (const ch of this._def.checks) {
      if (ch.kind === "max") {
        if (max === null || ch.value < max)
          max = ch.value;
      }
    }
    return max;
  }
};
ZodBigInt2.create = (params) => {
  return new ZodBigInt2({
    checks: [],
    typeName: ZodFirstPartyTypeKind2.ZodBigInt,
    coerce: params?.coerce ?? false,
    ...processCreateParams(params)
  });
};
var ZodBoolean2 = class extends ZodType2 {
  _parse(input) {
    if (this._def.coerce) {
      input.data = Boolean(input.data);
    }
    const parsedType2 = this._getType(input);
    if (parsedType2 !== ZodParsedType.boolean) {
      const ctx = this._getOrReturnCtx(input);
      addIssueToContext(ctx, {
        code: ZodIssueCode2.invalid_type,
        expected: ZodParsedType.boolean,
        received: ctx.parsedType
      });
      return INVALID;
    }
    return OK(input.data);
  }
};
ZodBoolean2.create = (params) => {
  return new ZodBoolean2({
    typeName: ZodFirstPartyTypeKind2.ZodBoolean,
    coerce: params?.coerce || false,
    ...processCreateParams(params)
  });
};
var ZodDate2 = class _ZodDate extends ZodType2 {
  _parse(input) {
    if (this._def.coerce) {
      input.data = new Date(input.data);
    }
    const parsedType2 = this._getType(input);
    if (parsedType2 !== ZodParsedType.date) {
      const ctx2 = this._getOrReturnCtx(input);
      addIssueToContext(ctx2, {
        code: ZodIssueCode2.invalid_type,
        expected: ZodParsedType.date,
        received: ctx2.parsedType
      });
      return INVALID;
    }
    if (Number.isNaN(input.data.getTime())) {
      const ctx2 = this._getOrReturnCtx(input);
      addIssueToContext(ctx2, {
        code: ZodIssueCode2.invalid_date
      });
      return INVALID;
    }
    const status = new ParseStatus();
    let ctx = void 0;
    for (const check2 of this._def.checks) {
      if (check2.kind === "min") {
        if (input.data.getTime() < check2.value) {
          ctx = this._getOrReturnCtx(input, ctx);
          addIssueToContext(ctx, {
            code: ZodIssueCode2.too_small,
            message: check2.message,
            inclusive: true,
            exact: false,
            minimum: check2.value,
            type: "date"
          });
          status.dirty();
        }
      } else if (check2.kind === "max") {
        if (input.data.getTime() > check2.value) {
          ctx = this._getOrReturnCtx(input, ctx);
          addIssueToContext(ctx, {
            code: ZodIssueCode2.too_big,
            message: check2.message,
            inclusive: true,
            exact: false,
            maximum: check2.value,
            type: "date"
          });
          status.dirty();
        }
      } else {
        util.assertNever(check2);
      }
    }
    return {
      status: status.value,
      value: new Date(input.data.getTime())
    };
  }
  _addCheck(check2) {
    return new _ZodDate({
      ...this._def,
      checks: [...this._def.checks, check2]
    });
  }
  min(minDate, message) {
    return this._addCheck({
      kind: "min",
      value: minDate.getTime(),
      message: errorUtil.toString(message)
    });
  }
  max(maxDate, message) {
    return this._addCheck({
      kind: "max",
      value: maxDate.getTime(),
      message: errorUtil.toString(message)
    });
  }
  get minDate() {
    let min = null;
    for (const ch of this._def.checks) {
      if (ch.kind === "min") {
        if (min === null || ch.value > min)
          min = ch.value;
      }
    }
    return min != null ? new Date(min) : null;
  }
  get maxDate() {
    let max = null;
    for (const ch of this._def.checks) {
      if (ch.kind === "max") {
        if (max === null || ch.value < max)
          max = ch.value;
      }
    }
    return max != null ? new Date(max) : null;
  }
};
ZodDate2.create = (params) => {
  return new ZodDate2({
    checks: [],
    coerce: params?.coerce || false,
    typeName: ZodFirstPartyTypeKind2.ZodDate,
    ...processCreateParams(params)
  });
};
var ZodSymbol2 = class extends ZodType2 {
  _parse(input) {
    const parsedType2 = this._getType(input);
    if (parsedType2 !== ZodParsedType.symbol) {
      const ctx = this._getOrReturnCtx(input);
      addIssueToContext(ctx, {
        code: ZodIssueCode2.invalid_type,
        expected: ZodParsedType.symbol,
        received: ctx.parsedType
      });
      return INVALID;
    }
    return OK(input.data);
  }
};
ZodSymbol2.create = (params) => {
  return new ZodSymbol2({
    typeName: ZodFirstPartyTypeKind2.ZodSymbol,
    ...processCreateParams(params)
  });
};
var ZodUndefined2 = class extends ZodType2 {
  _parse(input) {
    const parsedType2 = this._getType(input);
    if (parsedType2 !== ZodParsedType.undefined) {
      const ctx = this._getOrReturnCtx(input);
      addIssueToContext(ctx, {
        code: ZodIssueCode2.invalid_type,
        expected: ZodParsedType.undefined,
        received: ctx.parsedType
      });
      return INVALID;
    }
    return OK(input.data);
  }
};
ZodUndefined2.create = (params) => {
  return new ZodUndefined2({
    typeName: ZodFirstPartyTypeKind2.ZodUndefined,
    ...processCreateParams(params)
  });
};
var ZodNull2 = class extends ZodType2 {
  _parse(input) {
    const parsedType2 = this._getType(input);
    if (parsedType2 !== ZodParsedType.null) {
      const ctx = this._getOrReturnCtx(input);
      addIssueToContext(ctx, {
        code: ZodIssueCode2.invalid_type,
        expected: ZodParsedType.null,
        received: ctx.parsedType
      });
      return INVALID;
    }
    return OK(input.data);
  }
};
ZodNull2.create = (params) => {
  return new ZodNull2({
    typeName: ZodFirstPartyTypeKind2.ZodNull,
    ...processCreateParams(params)
  });
};
var ZodAny2 = class extends ZodType2 {
  constructor() {
    super(...arguments);
    this._any = true;
  }
  _parse(input) {
    return OK(input.data);
  }
};
ZodAny2.create = (params) => {
  return new ZodAny2({
    typeName: ZodFirstPartyTypeKind2.ZodAny,
    ...processCreateParams(params)
  });
};
var ZodUnknown2 = class extends ZodType2 {
  constructor() {
    super(...arguments);
    this._unknown = true;
  }
  _parse(input) {
    return OK(input.data);
  }
};
ZodUnknown2.create = (params) => {
  return new ZodUnknown2({
    typeName: ZodFirstPartyTypeKind2.ZodUnknown,
    ...processCreateParams(params)
  });
};
var ZodNever2 = class extends ZodType2 {
  _parse(input) {
    const ctx = this._getOrReturnCtx(input);
    addIssueToContext(ctx, {
      code: ZodIssueCode2.invalid_type,
      expected: ZodParsedType.never,
      received: ctx.parsedType
    });
    return INVALID;
  }
};
ZodNever2.create = (params) => {
  return new ZodNever2({
    typeName: ZodFirstPartyTypeKind2.ZodNever,
    ...processCreateParams(params)
  });
};
var ZodVoid2 = class extends ZodType2 {
  _parse(input) {
    const parsedType2 = this._getType(input);
    if (parsedType2 !== ZodParsedType.undefined) {
      const ctx = this._getOrReturnCtx(input);
      addIssueToContext(ctx, {
        code: ZodIssueCode2.invalid_type,
        expected: ZodParsedType.void,
        received: ctx.parsedType
      });
      return INVALID;
    }
    return OK(input.data);
  }
};
ZodVoid2.create = (params) => {
  return new ZodVoid2({
    typeName: ZodFirstPartyTypeKind2.ZodVoid,
    ...processCreateParams(params)
  });
};
var ZodArray2 = class _ZodArray extends ZodType2 {
  _parse(input) {
    const { ctx, status } = this._processInputParams(input);
    const def = this._def;
    if (ctx.parsedType !== ZodParsedType.array) {
      addIssueToContext(ctx, {
        code: ZodIssueCode2.invalid_type,
        expected: ZodParsedType.array,
        received: ctx.parsedType
      });
      return INVALID;
    }
    if (def.exactLength !== null) {
      const tooBig = ctx.data.length > def.exactLength.value;
      const tooSmall = ctx.data.length < def.exactLength.value;
      if (tooBig || tooSmall) {
        addIssueToContext(ctx, {
          code: tooBig ? ZodIssueCode2.too_big : ZodIssueCode2.too_small,
          minimum: tooSmall ? def.exactLength.value : void 0,
          maximum: tooBig ? def.exactLength.value : void 0,
          type: "array",
          inclusive: true,
          exact: true,
          message: def.exactLength.message
        });
        status.dirty();
      }
    }
    if (def.minLength !== null) {
      if (ctx.data.length < def.minLength.value) {
        addIssueToContext(ctx, {
          code: ZodIssueCode2.too_small,
          minimum: def.minLength.value,
          type: "array",
          inclusive: true,
          exact: false,
          message: def.minLength.message
        });
        status.dirty();
      }
    }
    if (def.maxLength !== null) {
      if (ctx.data.length > def.maxLength.value) {
        addIssueToContext(ctx, {
          code: ZodIssueCode2.too_big,
          maximum: def.maxLength.value,
          type: "array",
          inclusive: true,
          exact: false,
          message: def.maxLength.message
        });
        status.dirty();
      }
    }
    if (ctx.common.async) {
      return Promise.all([...ctx.data].map((item, i) => {
        return def.type._parseAsync(new ParseInputLazyPath(ctx, item, ctx.path, i));
      })).then((result2) => {
        return ParseStatus.mergeArray(status, result2);
      });
    }
    const result = [...ctx.data].map((item, i) => {
      return def.type._parseSync(new ParseInputLazyPath(ctx, item, ctx.path, i));
    });
    return ParseStatus.mergeArray(status, result);
  }
  get element() {
    return this._def.type;
  }
  min(minLength, message) {
    return new _ZodArray({
      ...this._def,
      minLength: { value: minLength, message: errorUtil.toString(message) }
    });
  }
  max(maxLength, message) {
    return new _ZodArray({
      ...this._def,
      maxLength: { value: maxLength, message: errorUtil.toString(message) }
    });
  }
  length(len, message) {
    return new _ZodArray({
      ...this._def,
      exactLength: { value: len, message: errorUtil.toString(message) }
    });
  }
  nonempty(message) {
    return this.min(1, message);
  }
};
ZodArray2.create = (schema, params) => {
  return new ZodArray2({
    type: schema,
    minLength: null,
    maxLength: null,
    exactLength: null,
    typeName: ZodFirstPartyTypeKind2.ZodArray,
    ...processCreateParams(params)
  });
};
function deepPartialify(schema) {
  if (schema instanceof ZodObject2) {
    const newShape = {};
    for (const key in schema.shape) {
      const fieldSchema = schema.shape[key];
      newShape[key] = ZodOptional2.create(deepPartialify(fieldSchema));
    }
    return new ZodObject2({
      ...schema._def,
      shape: () => newShape
    });
  } else if (schema instanceof ZodArray2) {
    return new ZodArray2({
      ...schema._def,
      type: deepPartialify(schema.element)
    });
  } else if (schema instanceof ZodOptional2) {
    return ZodOptional2.create(deepPartialify(schema.unwrap()));
  } else if (schema instanceof ZodNullable2) {
    return ZodNullable2.create(deepPartialify(schema.unwrap()));
  } else if (schema instanceof ZodTuple2) {
    return ZodTuple2.create(schema.items.map((item) => deepPartialify(item)));
  } else {
    return schema;
  }
}
var ZodObject2 = class _ZodObject extends ZodType2 {
  constructor() {
    super(...arguments);
    this._cached = null;
    this.nonstrict = this.passthrough;
    this.augment = this.extend;
  }
  _getCached() {
    if (this._cached !== null)
      return this._cached;
    const shape = this._def.shape();
    const keys = util.objectKeys(shape);
    this._cached = { shape, keys };
    return this._cached;
  }
  _parse(input) {
    const parsedType2 = this._getType(input);
    if (parsedType2 !== ZodParsedType.object) {
      const ctx2 = this._getOrReturnCtx(input);
      addIssueToContext(ctx2, {
        code: ZodIssueCode2.invalid_type,
        expected: ZodParsedType.object,
        received: ctx2.parsedType
      });
      return INVALID;
    }
    const { status, ctx } = this._processInputParams(input);
    const { shape, keys: shapeKeys } = this._getCached();
    const extraKeys = [];
    if (!(this._def.catchall instanceof ZodNever2 && this._def.unknownKeys === "strip")) {
      for (const key in ctx.data) {
        if (!shapeKeys.includes(key)) {
          extraKeys.push(key);
        }
      }
    }
    const pairs = [];
    for (const key of shapeKeys) {
      const keyValidator = shape[key];
      const value = ctx.data[key];
      pairs.push({
        key: { status: "valid", value: key },
        value: keyValidator._parse(new ParseInputLazyPath(ctx, value, ctx.path, key)),
        alwaysSet: key in ctx.data
      });
    }
    if (this._def.catchall instanceof ZodNever2) {
      const unknownKeys = this._def.unknownKeys;
      if (unknownKeys === "passthrough") {
        for (const key of extraKeys) {
          pairs.push({
            key: { status: "valid", value: key },
            value: { status: "valid", value: ctx.data[key] }
          });
        }
      } else if (unknownKeys === "strict") {
        if (extraKeys.length > 0) {
          addIssueToContext(ctx, {
            code: ZodIssueCode2.unrecognized_keys,
            keys: extraKeys
          });
          status.dirty();
        }
      } else if (unknownKeys === "strip") {
      } else {
        throw new Error(`Internal ZodObject error: invalid unknownKeys value.`);
      }
    } else {
      const catchall = this._def.catchall;
      for (const key of extraKeys) {
        const value = ctx.data[key];
        pairs.push({
          key: { status: "valid", value: key },
          value: catchall._parse(
            new ParseInputLazyPath(ctx, value, ctx.path, key)
            //, ctx.child(key), value, getParsedType(value)
          ),
          alwaysSet: key in ctx.data
        });
      }
    }
    if (ctx.common.async) {
      return Promise.resolve().then(async () => {
        const syncPairs = [];
        for (const pair of pairs) {
          const key = await pair.key;
          const value = await pair.value;
          syncPairs.push({
            key,
            value,
            alwaysSet: pair.alwaysSet
          });
        }
        return syncPairs;
      }).then((syncPairs) => {
        return ParseStatus.mergeObjectSync(status, syncPairs);
      });
    } else {
      return ParseStatus.mergeObjectSync(status, pairs);
    }
  }
  get shape() {
    return this._def.shape();
  }
  strict(message) {
    errorUtil.errToObj;
    return new _ZodObject({
      ...this._def,
      unknownKeys: "strict",
      ...message !== void 0 ? {
        errorMap: (issue2, ctx) => {
          const defaultError = this._def.errorMap?.(issue2, ctx).message ?? ctx.defaultError;
          if (issue2.code === "unrecognized_keys")
            return {
              message: errorUtil.errToObj(message).message ?? defaultError
            };
          return {
            message: defaultError
          };
        }
      } : {}
    });
  }
  strip() {
    return new _ZodObject({
      ...this._def,
      unknownKeys: "strip"
    });
  }
  passthrough() {
    return new _ZodObject({
      ...this._def,
      unknownKeys: "passthrough"
    });
  }
  // const AugmentFactory =
  //   <Def extends ZodObjectDef>(def: Def) =>
  //   <Augmentation extends ZodRawShape>(
  //     augmentation: Augmentation
  //   ): ZodObject<
  //     extendShape<ReturnType<Def["shape"]>, Augmentation>,
  //     Def["unknownKeys"],
  //     Def["catchall"]
  //   > => {
  //     return new ZodObject({
  //       ...def,
  //       shape: () => ({
  //         ...def.shape(),
  //         ...augmentation,
  //       }),
  //     }) as any;
  //   };
  extend(augmentation) {
    return new _ZodObject({
      ...this._def,
      shape: () => ({
        ...this._def.shape(),
        ...augmentation
      })
    });
  }
  /**
   * Prior to zod@1.0.12 there was a bug in the
   * inferred type of merged objects. Please
   * upgrade if you are experiencing issues.
   */
  merge(merging) {
    const merged = new _ZodObject({
      unknownKeys: merging._def.unknownKeys,
      catchall: merging._def.catchall,
      shape: () => ({
        ...this._def.shape(),
        ...merging._def.shape()
      }),
      typeName: ZodFirstPartyTypeKind2.ZodObject
    });
    return merged;
  }
  // merge<
  //   Incoming extends AnyZodObject,
  //   Augmentation extends Incoming["shape"],
  //   NewOutput extends {
  //     [k in keyof Augmentation | keyof Output]: k extends keyof Augmentation
  //       ? Augmentation[k]["_output"]
  //       : k extends keyof Output
  //       ? Output[k]
  //       : never;
  //   },
  //   NewInput extends {
  //     [k in keyof Augmentation | keyof Input]: k extends keyof Augmentation
  //       ? Augmentation[k]["_input"]
  //       : k extends keyof Input
  //       ? Input[k]
  //       : never;
  //   }
  // >(
  //   merging: Incoming
  // ): ZodObject<
  //   extendShape<T, ReturnType<Incoming["_def"]["shape"]>>,
  //   Incoming["_def"]["unknownKeys"],
  //   Incoming["_def"]["catchall"],
  //   NewOutput,
  //   NewInput
  // > {
  //   const merged: any = new ZodObject({
  //     unknownKeys: merging._def.unknownKeys,
  //     catchall: merging._def.catchall,
  //     shape: () =>
  //       objectUtil.mergeShapes(this._def.shape(), merging._def.shape()),
  //     typeName: ZodFirstPartyTypeKind.ZodObject,
  //   }) as any;
  //   return merged;
  // }
  setKey(key, schema) {
    return this.augment({ [key]: schema });
  }
  // merge<Incoming extends AnyZodObject>(
  //   merging: Incoming
  // ): //ZodObject<T & Incoming["_shape"], UnknownKeys, Catchall> = (merging) => {
  // ZodObject<
  //   extendShape<T, ReturnType<Incoming["_def"]["shape"]>>,
  //   Incoming["_def"]["unknownKeys"],
  //   Incoming["_def"]["catchall"]
  // > {
  //   // const mergedShape = objectUtil.mergeShapes(
  //   //   this._def.shape(),
  //   //   merging._def.shape()
  //   // );
  //   const merged: any = new ZodObject({
  //     unknownKeys: merging._def.unknownKeys,
  //     catchall: merging._def.catchall,
  //     shape: () =>
  //       objectUtil.mergeShapes(this._def.shape(), merging._def.shape()),
  //     typeName: ZodFirstPartyTypeKind.ZodObject,
  //   }) as any;
  //   return merged;
  // }
  catchall(index) {
    return new _ZodObject({
      ...this._def,
      catchall: index
    });
  }
  pick(mask) {
    const shape = {};
    for (const key of util.objectKeys(mask)) {
      if (mask[key] && this.shape[key]) {
        shape[key] = this.shape[key];
      }
    }
    return new _ZodObject({
      ...this._def,
      shape: () => shape
    });
  }
  omit(mask) {
    const shape = {};
    for (const key of util.objectKeys(this.shape)) {
      if (!mask[key]) {
        shape[key] = this.shape[key];
      }
    }
    return new _ZodObject({
      ...this._def,
      shape: () => shape
    });
  }
  /**
   * @deprecated
   */
  deepPartial() {
    return deepPartialify(this);
  }
  partial(mask) {
    const newShape = {};
    for (const key of util.objectKeys(this.shape)) {
      const fieldSchema = this.shape[key];
      if (mask && !mask[key]) {
        newShape[key] = fieldSchema;
      } else {
        newShape[key] = fieldSchema.optional();
      }
    }
    return new _ZodObject({
      ...this._def,
      shape: () => newShape
    });
  }
  required(mask) {
    const newShape = {};
    for (const key of util.objectKeys(this.shape)) {
      if (mask && !mask[key]) {
        newShape[key] = this.shape[key];
      } else {
        const fieldSchema = this.shape[key];
        let newField = fieldSchema;
        while (newField instanceof ZodOptional2) {
          newField = newField._def.innerType;
        }
        newShape[key] = newField;
      }
    }
    return new _ZodObject({
      ...this._def,
      shape: () => newShape
    });
  }
  keyof() {
    return createZodEnum(util.objectKeys(this.shape));
  }
};
ZodObject2.create = (shape, params) => {
  return new ZodObject2({
    shape: () => shape,
    unknownKeys: "strip",
    catchall: ZodNever2.create(),
    typeName: ZodFirstPartyTypeKind2.ZodObject,
    ...processCreateParams(params)
  });
};
ZodObject2.strictCreate = (shape, params) => {
  return new ZodObject2({
    shape: () => shape,
    unknownKeys: "strict",
    catchall: ZodNever2.create(),
    typeName: ZodFirstPartyTypeKind2.ZodObject,
    ...processCreateParams(params)
  });
};
ZodObject2.lazycreate = (shape, params) => {
  return new ZodObject2({
    shape,
    unknownKeys: "strip",
    catchall: ZodNever2.create(),
    typeName: ZodFirstPartyTypeKind2.ZodObject,
    ...processCreateParams(params)
  });
};
var ZodUnion2 = class extends ZodType2 {
  _parse(input) {
    const { ctx } = this._processInputParams(input);
    const options2 = this._def.options;
    function handleResults(results) {
      for (const result of results) {
        if (result.result.status === "valid") {
          return result.result;
        }
      }
      for (const result of results) {
        if (result.result.status === "dirty") {
          ctx.common.issues.push(...result.ctx.common.issues);
          return result.result;
        }
      }
      const unionErrors = results.map((result) => new ZodError2(result.ctx.common.issues));
      addIssueToContext(ctx, {
        code: ZodIssueCode2.invalid_union,
        unionErrors
      });
      return INVALID;
    }
    if (ctx.common.async) {
      return Promise.all(options2.map(async (option) => {
        const childCtx = {
          ...ctx,
          common: {
            ...ctx.common,
            issues: []
          },
          parent: null
        };
        return {
          result: await option._parseAsync({
            data: ctx.data,
            path: ctx.path,
            parent: childCtx
          }),
          ctx: childCtx
        };
      })).then(handleResults);
    } else {
      let dirty = void 0;
      const issues = [];
      for (const option of options2) {
        const childCtx = {
          ...ctx,
          common: {
            ...ctx.common,
            issues: []
          },
          parent: null
        };
        const result = option._parseSync({
          data: ctx.data,
          path: ctx.path,
          parent: childCtx
        });
        if (result.status === "valid") {
          return result;
        } else if (result.status === "dirty" && !dirty) {
          dirty = { result, ctx: childCtx };
        }
        if (childCtx.common.issues.length) {
          issues.push(childCtx.common.issues);
        }
      }
      if (dirty) {
        ctx.common.issues.push(...dirty.ctx.common.issues);
        return dirty.result;
      }
      const unionErrors = issues.map((issues2) => new ZodError2(issues2));
      addIssueToContext(ctx, {
        code: ZodIssueCode2.invalid_union,
        unionErrors
      });
      return INVALID;
    }
  }
  get options() {
    return this._def.options;
  }
};
ZodUnion2.create = (types, params) => {
  return new ZodUnion2({
    options: types,
    typeName: ZodFirstPartyTypeKind2.ZodUnion,
    ...processCreateParams(params)
  });
};
var getDiscriminator = (type) => {
  if (type instanceof ZodLazy2) {
    return getDiscriminator(type.schema);
  } else if (type instanceof ZodEffects) {
    return getDiscriminator(type.innerType());
  } else if (type instanceof ZodLiteral2) {
    return [type.value];
  } else if (type instanceof ZodEnum2) {
    return type.options;
  } else if (type instanceof ZodNativeEnum) {
    return util.objectValues(type.enum);
  } else if (type instanceof ZodDefault2) {
    return getDiscriminator(type._def.innerType);
  } else if (type instanceof ZodUndefined2) {
    return [void 0];
  } else if (type instanceof ZodNull2) {
    return [null];
  } else if (type instanceof ZodOptional2) {
    return [void 0, ...getDiscriminator(type.unwrap())];
  } else if (type instanceof ZodNullable2) {
    return [null, ...getDiscriminator(type.unwrap())];
  } else if (type instanceof ZodBranded) {
    return getDiscriminator(type.unwrap());
  } else if (type instanceof ZodReadonly2) {
    return getDiscriminator(type.unwrap());
  } else if (type instanceof ZodCatch2) {
    return getDiscriminator(type._def.innerType);
  } else {
    return [];
  }
};
var ZodDiscriminatedUnion2 = class _ZodDiscriminatedUnion extends ZodType2 {
  _parse(input) {
    const { ctx } = this._processInputParams(input);
    if (ctx.parsedType !== ZodParsedType.object) {
      addIssueToContext(ctx, {
        code: ZodIssueCode2.invalid_type,
        expected: ZodParsedType.object,
        received: ctx.parsedType
      });
      return INVALID;
    }
    const discriminator = this.discriminator;
    const discriminatorValue = ctx.data[discriminator];
    const option = this.optionsMap.get(discriminatorValue);
    if (!option) {
      addIssueToContext(ctx, {
        code: ZodIssueCode2.invalid_union_discriminator,
        options: Array.from(this.optionsMap.keys()),
        path: [discriminator]
      });
      return INVALID;
    }
    if (ctx.common.async) {
      return option._parseAsync({
        data: ctx.data,
        path: ctx.path,
        parent: ctx
      });
    } else {
      return option._parseSync({
        data: ctx.data,
        path: ctx.path,
        parent: ctx
      });
    }
  }
  get discriminator() {
    return this._def.discriminator;
  }
  get options() {
    return this._def.options;
  }
  get optionsMap() {
    return this._def.optionsMap;
  }
  /**
   * The constructor of the discriminated union schema. Its behaviour is very similar to that of the normal z.union() constructor.
   * However, it only allows a union of objects, all of which need to share a discriminator property. This property must
   * have a different value for each object in the union.
   * @param discriminator the name of the discriminator property
   * @param types an array of object schemas
   * @param params
   */
  static create(discriminator, options2, params) {
    const optionsMap = /* @__PURE__ */ new Map();
    for (const type of options2) {
      const discriminatorValues = getDiscriminator(type.shape[discriminator]);
      if (!discriminatorValues.length) {
        throw new Error(`A discriminator value for key \`${discriminator}\` could not be extracted from all schema options`);
      }
      for (const value of discriminatorValues) {
        if (optionsMap.has(value)) {
          throw new Error(`Discriminator property ${String(discriminator)} has duplicate value ${String(value)}`);
        }
        optionsMap.set(value, type);
      }
    }
    return new _ZodDiscriminatedUnion({
      typeName: ZodFirstPartyTypeKind2.ZodDiscriminatedUnion,
      discriminator,
      options: options2,
      optionsMap,
      ...processCreateParams(params)
    });
  }
};
function mergeValues2(a, b) {
  const aType = getParsedType2(a);
  const bType = getParsedType2(b);
  if (a === b) {
    return { valid: true, data: a };
  } else if (aType === ZodParsedType.object && bType === ZodParsedType.object) {
    const bKeys = util.objectKeys(b);
    const sharedKeys = util.objectKeys(a).filter((key) => bKeys.indexOf(key) !== -1);
    const newObj = { ...a, ...b };
    for (const key of sharedKeys) {
      const sharedValue = mergeValues2(a[key], b[key]);
      if (!sharedValue.valid) {
        return { valid: false };
      }
      newObj[key] = sharedValue.data;
    }
    return { valid: true, data: newObj };
  } else if (aType === ZodParsedType.array && bType === ZodParsedType.array) {
    if (a.length !== b.length) {
      return { valid: false };
    }
    const newArray = [];
    for (let index = 0; index < a.length; index++) {
      const itemA = a[index];
      const itemB = b[index];
      const sharedValue = mergeValues2(itemA, itemB);
      if (!sharedValue.valid) {
        return { valid: false };
      }
      newArray.push(sharedValue.data);
    }
    return { valid: true, data: newArray };
  } else if (aType === ZodParsedType.date && bType === ZodParsedType.date && +a === +b) {
    return { valid: true, data: a };
  } else {
    return { valid: false };
  }
}
var ZodIntersection2 = class extends ZodType2 {
  _parse(input) {
    const { status, ctx } = this._processInputParams(input);
    const handleParsed = (parsedLeft, parsedRight) => {
      if (isAborted(parsedLeft) || isAborted(parsedRight)) {
        return INVALID;
      }
      const merged = mergeValues2(parsedLeft.value, parsedRight.value);
      if (!merged.valid) {
        addIssueToContext(ctx, {
          code: ZodIssueCode2.invalid_intersection_types
        });
        return INVALID;
      }
      if (isDirty(parsedLeft) || isDirty(parsedRight)) {
        status.dirty();
      }
      return { status: status.value, value: merged.data };
    };
    if (ctx.common.async) {
      return Promise.all([
        this._def.left._parseAsync({
          data: ctx.data,
          path: ctx.path,
          parent: ctx
        }),
        this._def.right._parseAsync({
          data: ctx.data,
          path: ctx.path,
          parent: ctx
        })
      ]).then(([left, right]) => handleParsed(left, right));
    } else {
      return handleParsed(this._def.left._parseSync({
        data: ctx.data,
        path: ctx.path,
        parent: ctx
      }), this._def.right._parseSync({
        data: ctx.data,
        path: ctx.path,
        parent: ctx
      }));
    }
  }
};
ZodIntersection2.create = (left, right, params) => {
  return new ZodIntersection2({
    left,
    right,
    typeName: ZodFirstPartyTypeKind2.ZodIntersection,
    ...processCreateParams(params)
  });
};
var ZodTuple2 = class _ZodTuple extends ZodType2 {
  _parse(input) {
    const { status, ctx } = this._processInputParams(input);
    if (ctx.parsedType !== ZodParsedType.array) {
      addIssueToContext(ctx, {
        code: ZodIssueCode2.invalid_type,
        expected: ZodParsedType.array,
        received: ctx.parsedType
      });
      return INVALID;
    }
    if (ctx.data.length < this._def.items.length) {
      addIssueToContext(ctx, {
        code: ZodIssueCode2.too_small,
        minimum: this._def.items.length,
        inclusive: true,
        exact: false,
        type: "array"
      });
      return INVALID;
    }
    const rest = this._def.rest;
    if (!rest && ctx.data.length > this._def.items.length) {
      addIssueToContext(ctx, {
        code: ZodIssueCode2.too_big,
        maximum: this._def.items.length,
        inclusive: true,
        exact: false,
        type: "array"
      });
      status.dirty();
    }
    const items = [...ctx.data].map((item, itemIndex) => {
      const schema = this._def.items[itemIndex] || this._def.rest;
      if (!schema)
        return null;
      return schema._parse(new ParseInputLazyPath(ctx, item, ctx.path, itemIndex));
    }).filter((x) => !!x);
    if (ctx.common.async) {
      return Promise.all(items).then((results) => {
        return ParseStatus.mergeArray(status, results);
      });
    } else {
      return ParseStatus.mergeArray(status, items);
    }
  }
  get items() {
    return this._def.items;
  }
  rest(rest) {
    return new _ZodTuple({
      ...this._def,
      rest
    });
  }
};
ZodTuple2.create = (schemas, params) => {
  if (!Array.isArray(schemas)) {
    throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
  }
  return new ZodTuple2({
    items: schemas,
    typeName: ZodFirstPartyTypeKind2.ZodTuple,
    rest: null,
    ...processCreateParams(params)
  });
};
var ZodRecord2 = class _ZodRecord extends ZodType2 {
  get keySchema() {
    return this._def.keyType;
  }
  get valueSchema() {
    return this._def.valueType;
  }
  _parse(input) {
    const { status, ctx } = this._processInputParams(input);
    if (ctx.parsedType !== ZodParsedType.object) {
      addIssueToContext(ctx, {
        code: ZodIssueCode2.invalid_type,
        expected: ZodParsedType.object,
        received: ctx.parsedType
      });
      return INVALID;
    }
    const pairs = [];
    const keyType = this._def.keyType;
    const valueType = this._def.valueType;
    for (const key in ctx.data) {
      pairs.push({
        key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, key)),
        value: valueType._parse(new ParseInputLazyPath(ctx, ctx.data[key], ctx.path, key)),
        alwaysSet: key in ctx.data
      });
    }
    if (ctx.common.async) {
      return ParseStatus.mergeObjectAsync(status, pairs);
    } else {
      return ParseStatus.mergeObjectSync(status, pairs);
    }
  }
  get element() {
    return this._def.valueType;
  }
  static create(first, second, third) {
    if (second instanceof ZodType2) {
      return new _ZodRecord({
        keyType: first,
        valueType: second,
        typeName: ZodFirstPartyTypeKind2.ZodRecord,
        ...processCreateParams(third)
      });
    }
    return new _ZodRecord({
      keyType: ZodString2.create(),
      valueType: first,
      typeName: ZodFirstPartyTypeKind2.ZodRecord,
      ...processCreateParams(second)
    });
  }
};
var ZodMap2 = class extends ZodType2 {
  get keySchema() {
    return this._def.keyType;
  }
  get valueSchema() {
    return this._def.valueType;
  }
  _parse(input) {
    const { status, ctx } = this._processInputParams(input);
    if (ctx.parsedType !== ZodParsedType.map) {
      addIssueToContext(ctx, {
        code: ZodIssueCode2.invalid_type,
        expected: ZodParsedType.map,
        received: ctx.parsedType
      });
      return INVALID;
    }
    const keyType = this._def.keyType;
    const valueType = this._def.valueType;
    const pairs = [...ctx.data.entries()].map(([key, value], index) => {
      return {
        key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, [index, "key"])),
        value: valueType._parse(new ParseInputLazyPath(ctx, value, ctx.path, [index, "value"]))
      };
    });
    if (ctx.common.async) {
      const finalMap = /* @__PURE__ */ new Map();
      return Promise.resolve().then(async () => {
        for (const pair of pairs) {
          const key = await pair.key;
          const value = await pair.value;
          if (key.status === "aborted" || value.status === "aborted") {
            return INVALID;
          }
          if (key.status === "dirty" || value.status === "dirty") {
            status.dirty();
          }
          finalMap.set(key.value, value.value);
        }
        return { status: status.value, value: finalMap };
      });
    } else {
      const finalMap = /* @__PURE__ */ new Map();
      for (const pair of pairs) {
        const key = pair.key;
        const value = pair.value;
        if (key.status === "aborted" || value.status === "aborted") {
          return INVALID;
        }
        if (key.status === "dirty" || value.status === "dirty") {
          status.dirty();
        }
        finalMap.set(key.value, value.value);
      }
      return { status: status.value, value: finalMap };
    }
  }
};
ZodMap2.create = (keyType, valueType, params) => {
  return new ZodMap2({
    valueType,
    keyType,
    typeName: ZodFirstPartyTypeKind2.ZodMap,
    ...processCreateParams(params)
  });
};
var ZodSet2 = class _ZodSet extends ZodType2 {
  _parse(input) {
    const { status, ctx } = this._processInputParams(input);
    if (ctx.parsedType !== ZodParsedType.set) {
      addIssueToContext(ctx, {
        code: ZodIssueCode2.invalid_type,
        expected: ZodParsedType.set,
        received: ctx.parsedType
      });
      return INVALID;
    }
    const def = this._def;
    if (def.minSize !== null) {
      if (ctx.data.size < def.minSize.value) {
        addIssueToContext(ctx, {
          code: ZodIssueCode2.too_small,
          minimum: def.minSize.value,
          type: "set",
          inclusive: true,
          exact: false,
          message: def.minSize.message
        });
        status.dirty();
      }
    }
    if (def.maxSize !== null) {
      if (ctx.data.size > def.maxSize.value) {
        addIssueToContext(ctx, {
          code: ZodIssueCode2.too_big,
          maximum: def.maxSize.value,
          type: "set",
          inclusive: true,
          exact: false,
          message: def.maxSize.message
        });
        status.dirty();
      }
    }
    const valueType = this._def.valueType;
    function finalizeSet(elements2) {
      const parsedSet = /* @__PURE__ */ new Set();
      for (const element of elements2) {
        if (element.status === "aborted")
          return INVALID;
        if (element.status === "dirty")
          status.dirty();
        parsedSet.add(element.value);
      }
      return { status: status.value, value: parsedSet };
    }
    const elements = [...ctx.data.values()].map((item, i) => valueType._parse(new ParseInputLazyPath(ctx, item, ctx.path, i)));
    if (ctx.common.async) {
      return Promise.all(elements).then((elements2) => finalizeSet(elements2));
    } else {
      return finalizeSet(elements);
    }
  }
  min(minSize, message) {
    return new _ZodSet({
      ...this._def,
      minSize: { value: minSize, message: errorUtil.toString(message) }
    });
  }
  max(maxSize, message) {
    return new _ZodSet({
      ...this._def,
      maxSize: { value: maxSize, message: errorUtil.toString(message) }
    });
  }
  size(size, message) {
    return this.min(size, message).max(size, message);
  }
  nonempty(message) {
    return this.min(1, message);
  }
};
ZodSet2.create = (valueType, params) => {
  return new ZodSet2({
    valueType,
    minSize: null,
    maxSize: null,
    typeName: ZodFirstPartyTypeKind2.ZodSet,
    ...processCreateParams(params)
  });
};
var ZodFunction2 = class _ZodFunction extends ZodType2 {
  constructor() {
    super(...arguments);
    this.validate = this.implement;
  }
  _parse(input) {
    const { ctx } = this._processInputParams(input);
    if (ctx.parsedType !== ZodParsedType.function) {
      addIssueToContext(ctx, {
        code: ZodIssueCode2.invalid_type,
        expected: ZodParsedType.function,
        received: ctx.parsedType
      });
      return INVALID;
    }
    function makeArgsIssue(args, error48) {
      return makeIssue({
        data: args,
        path: ctx.path,
        errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, getErrorMap2(), en_default2].filter((x) => !!x),
        issueData: {
          code: ZodIssueCode2.invalid_arguments,
          argumentsError: error48
        }
      });
    }
    function makeReturnsIssue(returns, error48) {
      return makeIssue({
        data: returns,
        path: ctx.path,
        errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, getErrorMap2(), en_default2].filter((x) => !!x),
        issueData: {
          code: ZodIssueCode2.invalid_return_type,
          returnTypeError: error48
        }
      });
    }
    const params = { errorMap: ctx.common.contextualErrorMap };
    const fn = ctx.data;
    if (this._def.returns instanceof ZodPromise2) {
      const me = this;
      return OK(async function(...args) {
        const error48 = new ZodError2([]);
        const parsedArgs = await me._def.args.parseAsync(args, params).catch((e) => {
          error48.addIssue(makeArgsIssue(args, e));
          throw error48;
        });
        const result = await Reflect.apply(fn, this, parsedArgs);
        const parsedReturns = await me._def.returns._def.type.parseAsync(result, params).catch((e) => {
          error48.addIssue(makeReturnsIssue(result, e));
          throw error48;
        });
        return parsedReturns;
      });
    } else {
      const me = this;
      return OK(function(...args) {
        const parsedArgs = me._def.args.safeParse(args, params);
        if (!parsedArgs.success) {
          throw new ZodError2([makeArgsIssue(args, parsedArgs.error)]);
        }
        const result = Reflect.apply(fn, this, parsedArgs.data);
        const parsedReturns = me._def.returns.safeParse(result, params);
        if (!parsedReturns.success) {
          throw new ZodError2([makeReturnsIssue(result, parsedReturns.error)]);
        }
        return parsedReturns.data;
      });
    }
  }
  parameters() {
    return this._def.args;
  }
  returnType() {
    return this._def.returns;
  }
  args(...items) {
    return new _ZodFunction({
      ...this._def,
      args: ZodTuple2.create(items).rest(ZodUnknown2.create())
    });
  }
  returns(returnType) {
    return new _ZodFunction({
      ...this._def,
      returns: returnType
    });
  }
  implement(func) {
    const validatedFunc = this.parse(func);
    return validatedFunc;
  }
  strictImplement(func) {
    const validatedFunc = this.parse(func);
    return validatedFunc;
  }
  static create(args, returns, params) {
    return new _ZodFunction({
      args: args ? args : ZodTuple2.create([]).rest(ZodUnknown2.create()),
      returns: returns || ZodUnknown2.create(),
      typeName: ZodFirstPartyTypeKind2.ZodFunction,
      ...processCreateParams(params)
    });
  }
};
var ZodLazy2 = class extends ZodType2 {
  get schema() {
    return this._def.getter();
  }
  _parse(input) {
    const { ctx } = this._processInputParams(input);
    const lazySchema = this._def.getter();
    return lazySchema._parse({ data: ctx.data, path: ctx.path, parent: ctx });
  }
};
ZodLazy2.create = (getter, params) => {
  return new ZodLazy2({
    getter,
    typeName: ZodFirstPartyTypeKind2.ZodLazy,
    ...processCreateParams(params)
  });
};
var ZodLiteral2 = class extends ZodType2 {
  _parse(input) {
    if (input.data !== this._def.value) {
      const ctx = this._getOrReturnCtx(input);
      addIssueToContext(ctx, {
        received: ctx.data,
        code: ZodIssueCode2.invalid_literal,
        expected: this._def.value
      });
      return INVALID;
    }
    return { status: "valid", value: input.data };
  }
  get value() {
    return this._def.value;
  }
};
ZodLiteral2.create = (value, params) => {
  return new ZodLiteral2({
    value,
    typeName: ZodFirstPartyTypeKind2.ZodLiteral,
    ...processCreateParams(params)
  });
};
function createZodEnum(values, params) {
  return new ZodEnum2({
    values,
    typeName: ZodFirstPartyTypeKind2.ZodEnum,
    ...processCreateParams(params)
  });
}
var ZodEnum2 = class _ZodEnum extends ZodType2 {
  _parse(input) {
    if (typeof input.data !== "string") {
      const ctx = this._getOrReturnCtx(input);
      const expectedValues = this._def.values;
      addIssueToContext(ctx, {
        expected: util.joinValues(expectedValues),
        received: ctx.parsedType,
        code: ZodIssueCode2.invalid_type
      });
      return INVALID;
    }
    if (!this._cache) {
      this._cache = new Set(this._def.values);
    }
    if (!this._cache.has(input.data)) {
      const ctx = this._getOrReturnCtx(input);
      const expectedValues = this._def.values;
      addIssueToContext(ctx, {
        received: ctx.data,
        code: ZodIssueCode2.invalid_enum_value,
        options: expectedValues
      });
      return INVALID;
    }
    return OK(input.data);
  }
  get options() {
    return this._def.values;
  }
  get enum() {
    const enumValues = {};
    for (const val of this._def.values) {
      enumValues[val] = val;
    }
    return enumValues;
  }
  get Values() {
    const enumValues = {};
    for (const val of this._def.values) {
      enumValues[val] = val;
    }
    return enumValues;
  }
  get Enum() {
    const enumValues = {};
    for (const val of this._def.values) {
      enumValues[val] = val;
    }
    return enumValues;
  }
  extract(values, newDef = this._def) {
    return _ZodEnum.create(values, {
      ...this._def,
      ...newDef
    });
  }
  exclude(values, newDef = this._def) {
    return _ZodEnum.create(this.options.filter((opt) => !values.includes(opt)), {
      ...this._def,
      ...newDef
    });
  }
};
ZodEnum2.create = createZodEnum;
var ZodNativeEnum = class extends ZodType2 {
  _parse(input) {
    const nativeEnumValues = util.getValidEnumValues(this._def.values);
    const ctx = this._getOrReturnCtx(input);
    if (ctx.parsedType !== ZodParsedType.string && ctx.parsedType !== ZodParsedType.number) {
      const expectedValues = util.objectValues(nativeEnumValues);
      addIssueToContext(ctx, {
        expected: util.joinValues(expectedValues),
        received: ctx.parsedType,
        code: ZodIssueCode2.invalid_type
      });
      return INVALID;
    }
    if (!this._cache) {
      this._cache = new Set(util.getValidEnumValues(this._def.values));
    }
    if (!this._cache.has(input.data)) {
      const expectedValues = util.objectValues(nativeEnumValues);
      addIssueToContext(ctx, {
        received: ctx.data,
        code: ZodIssueCode2.invalid_enum_value,
        options: expectedValues
      });
      return INVALID;
    }
    return OK(input.data);
  }
  get enum() {
    return this._def.values;
  }
};
ZodNativeEnum.create = (values, params) => {
  return new ZodNativeEnum({
    values,
    typeName: ZodFirstPartyTypeKind2.ZodNativeEnum,
    ...processCreateParams(params)
  });
};
var ZodPromise2 = class extends ZodType2 {
  unwrap() {
    return this._def.type;
  }
  _parse(input) {
    const { ctx } = this._processInputParams(input);
    if (ctx.parsedType !== ZodParsedType.promise && ctx.common.async === false) {
      addIssueToContext(ctx, {
        code: ZodIssueCode2.invalid_type,
        expected: ZodParsedType.promise,
        received: ctx.parsedType
      });
      return INVALID;
    }
    const promisified = ctx.parsedType === ZodParsedType.promise ? ctx.data : Promise.resolve(ctx.data);
    return OK(promisified.then((data) => {
      return this._def.type.parseAsync(data, {
        path: ctx.path,
        errorMap: ctx.common.contextualErrorMap
      });
    }));
  }
};
ZodPromise2.create = (schema, params) => {
  return new ZodPromise2({
    type: schema,
    typeName: ZodFirstPartyTypeKind2.ZodPromise,
    ...processCreateParams(params)
  });
};
var ZodEffects = class extends ZodType2 {
  innerType() {
    return this._def.schema;
  }
  sourceType() {
    return this._def.schema._def.typeName === ZodFirstPartyTypeKind2.ZodEffects ? this._def.schema.sourceType() : this._def.schema;
  }
  _parse(input) {
    const { status, ctx } = this._processInputParams(input);
    const effect = this._def.effect || null;
    const checkCtx = {
      addIssue: (arg) => {
        addIssueToContext(ctx, arg);
        if (arg.fatal) {
          status.abort();
        } else {
          status.dirty();
        }
      },
      get path() {
        return ctx.path;
      }
    };
    checkCtx.addIssue = checkCtx.addIssue.bind(checkCtx);
    if (effect.type === "preprocess") {
      const processed = effect.transform(ctx.data, checkCtx);
      if (ctx.common.async) {
        return Promise.resolve(processed).then(async (processed2) => {
          if (status.value === "aborted")
            return INVALID;
          const result = await this._def.schema._parseAsync({
            data: processed2,
            path: ctx.path,
            parent: ctx
          });
          if (result.status === "aborted")
            return INVALID;
          if (result.status === "dirty")
            return DIRTY(result.value);
          if (status.value === "dirty")
            return DIRTY(result.value);
          return result;
        });
      } else {
        if (status.value === "aborted")
          return INVALID;
        const result = this._def.schema._parseSync({
          data: processed,
          path: ctx.path,
          parent: ctx
        });
        if (result.status === "aborted")
          return INVALID;
        if (result.status === "dirty")
          return DIRTY(result.value);
        if (status.value === "dirty")
          return DIRTY(result.value);
        return result;
      }
    }
    if (effect.type === "refinement") {
      const executeRefinement = (acc) => {
        const result = effect.refinement(acc, checkCtx);
        if (ctx.common.async) {
          return Promise.resolve(result);
        }
        if (result instanceof Promise) {
          throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");
        }
        return acc;
      };
      if (ctx.common.async === false) {
        const inner = this._def.schema._parseSync({
          data: ctx.data,
          path: ctx.path,
          parent: ctx
        });
        if (inner.status === "aborted")
          return INVALID;
        if (inner.status === "dirty")
          status.dirty();
        executeRefinement(inner.value);
        return { status: status.value, value: inner.value };
      } else {
        return this._def.schema._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx }).then((inner) => {
          if (inner.status === "aborted")
            return INVALID;
          if (inner.status === "dirty")
            status.dirty();
          return executeRefinement(inner.value).then(() => {
            return { status: status.value, value: inner.value };
          });
        });
      }
    }
    if (effect.type === "transform") {
      if (ctx.common.async === false) {
        const base = this._def.schema._parseSync({
          data: ctx.data,
          path: ctx.path,
          parent: ctx
        });
        if (!isValid(base))
          return INVALID;
        const result = effect.transform(base.value, checkCtx);
        if (result instanceof Promise) {
          throw new Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);
        }
        return { status: status.value, value: result };
      } else {
        return this._def.schema._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx }).then((base) => {
          if (!isValid(base))
            return INVALID;
          return Promise.resolve(effect.transform(base.value, checkCtx)).then((result) => ({
            status: status.value,
            value: result
          }));
        });
      }
    }
    util.assertNever(effect);
  }
};
ZodEffects.create = (schema, effect, params) => {
  return new ZodEffects({
    schema,
    typeName: ZodFirstPartyTypeKind2.ZodEffects,
    effect,
    ...processCreateParams(params)
  });
};
ZodEffects.createWithPreprocess = (preprocess2, schema, params) => {
  return new ZodEffects({
    schema,
    effect: { type: "preprocess", transform: preprocess2 },
    typeName: ZodFirstPartyTypeKind2.ZodEffects,
    ...processCreateParams(params)
  });
};
var ZodOptional2 = class extends ZodType2 {
  _parse(input) {
    const parsedType2 = this._getType(input);
    if (parsedType2 === ZodParsedType.undefined) {
      return OK(void 0);
    }
    return this._def.innerType._parse(input);
  }
  unwrap() {
    return this._def.innerType;
  }
};
ZodOptional2.create = (type, params) => {
  return new ZodOptional2({
    innerType: type,
    typeName: ZodFirstPartyTypeKind2.ZodOptional,
    ...processCreateParams(params)
  });
};
var ZodNullable2 = class extends ZodType2 {
  _parse(input) {
    const parsedType2 = this._getType(input);
    if (parsedType2 === ZodParsedType.null) {
      return OK(null);
    }
    return this._def.innerType._parse(input);
  }
  unwrap() {
    return this._def.innerType;
  }
};
ZodNullable2.create = (type, params) => {
  return new ZodNullable2({
    innerType: type,
    typeName: ZodFirstPartyTypeKind2.ZodNullable,
    ...processCreateParams(params)
  });
};
var ZodDefault2 = class extends ZodType2 {
  _parse(input) {
    const { ctx } = this._processInputParams(input);
    let data = ctx.data;
    if (ctx.parsedType === ZodParsedType.undefined) {
      data = this._def.defaultValue();
    }
    return this._def.innerType._parse({
      data,
      path: ctx.path,
      parent: ctx
    });
  }
  removeDefault() {
    return this._def.innerType;
  }
};
ZodDefault2.create = (type, params) => {
  return new ZodDefault2({
    innerType: type,
    typeName: ZodFirstPartyTypeKind2.ZodDefault,
    defaultValue: typeof params.default === "function" ? params.default : () => params.default,
    ...processCreateParams(params)
  });
};
var ZodCatch2 = class extends ZodType2 {
  _parse(input) {
    const { ctx } = this._processInputParams(input);
    const newCtx = {
      ...ctx,
      common: {
        ...ctx.common,
        issues: []
      }
    };
    const result = this._def.innerType._parse({
      data: newCtx.data,
      path: newCtx.path,
      parent: {
        ...newCtx
      }
    });
    if (isAsync(result)) {
      return result.then((result2) => {
        return {
          status: "valid",
          value: result2.status === "valid" ? result2.value : this._def.catchValue({
            get error() {
              return new ZodError2(newCtx.common.issues);
            },
            input: newCtx.data
          })
        };
      });
    } else {
      return {
        status: "valid",
        value: result.status === "valid" ? result.value : this._def.catchValue({
          get error() {
            return new ZodError2(newCtx.common.issues);
          },
          input: newCtx.data
        })
      };
    }
  }
  removeCatch() {
    return this._def.innerType;
  }
};
ZodCatch2.create = (type, params) => {
  return new ZodCatch2({
    innerType: type,
    typeName: ZodFirstPartyTypeKind2.ZodCatch,
    catchValue: typeof params.catch === "function" ? params.catch : () => params.catch,
    ...processCreateParams(params)
  });
};
var ZodNaN2 = class extends ZodType2 {
  _parse(input) {
    const parsedType2 = this._getType(input);
    if (parsedType2 !== ZodParsedType.nan) {
      const ctx = this._getOrReturnCtx(input);
      addIssueToContext(ctx, {
        code: ZodIssueCode2.invalid_type,
        expected: ZodParsedType.nan,
        received: ctx.parsedType
      });
      return INVALID;
    }
    return { status: "valid", value: input.data };
  }
};
ZodNaN2.create = (params) => {
  return new ZodNaN2({
    typeName: ZodFirstPartyTypeKind2.ZodNaN,
    ...processCreateParams(params)
  });
};
var BRAND = Symbol("zod_brand");
var ZodBranded = class extends ZodType2 {
  _parse(input) {
    const { ctx } = this._processInputParams(input);
    const data = ctx.data;
    return this._def.type._parse({
      data,
      path: ctx.path,
      parent: ctx
    });
  }
  unwrap() {
    return this._def.type;
  }
};
var ZodPipeline = class _ZodPipeline extends ZodType2 {
  _parse(input) {
    const { status, ctx } = this._processInputParams(input);
    if (ctx.common.async) {
      const handleAsync = async () => {
        const inResult = await this._def.in._parseAsync({
          data: ctx.data,
          path: ctx.path,
          parent: ctx
        });
        if (inResult.status === "aborted")
          return INVALID;
        if (inResult.status === "dirty") {
          status.dirty();
          return DIRTY(inResult.value);
        } else {
          return this._def.out._parseAsync({
            data: inResult.value,
            path: ctx.path,
            parent: ctx
          });
        }
      };
      return handleAsync();
    } else {
      const inResult = this._def.in._parseSync({
        data: ctx.data,
        path: ctx.path,
        parent: ctx
      });
      if (inResult.status === "aborted")
        return INVALID;
      if (inResult.status === "dirty") {
        status.dirty();
        return {
          status: "dirty",
          value: inResult.value
        };
      } else {
        return this._def.out._parseSync({
          data: inResult.value,
          path: ctx.path,
          parent: ctx
        });
      }
    }
  }
  static create(a, b) {
    return new _ZodPipeline({
      in: a,
      out: b,
      typeName: ZodFirstPartyTypeKind2.ZodPipeline
    });
  }
};
var ZodReadonly2 = class extends ZodType2 {
  _parse(input) {
    const result = this._def.innerType._parse(input);
    const freeze = (data) => {
      if (isValid(data)) {
        data.value = Object.freeze(data.value);
      }
      return data;
    };
    return isAsync(result) ? result.then((data) => freeze(data)) : freeze(result);
  }
  unwrap() {
    return this._def.innerType;
  }
};
ZodReadonly2.create = (type, params) => {
  return new ZodReadonly2({
    innerType: type,
    typeName: ZodFirstPartyTypeKind2.ZodReadonly,
    ...processCreateParams(params)
  });
};
var late = {
  object: ZodObject2.lazycreate
};
var ZodFirstPartyTypeKind2;
(function(ZodFirstPartyTypeKind3) {
  ZodFirstPartyTypeKind3["ZodString"] = "ZodString";
  ZodFirstPartyTypeKind3["ZodNumber"] = "ZodNumber";
  ZodFirstPartyTypeKind3["ZodNaN"] = "ZodNaN";
  ZodFirstPartyTypeKind3["ZodBigInt"] = "ZodBigInt";
  ZodFirstPartyTypeKind3["ZodBoolean"] = "ZodBoolean";
  ZodFirstPartyTypeKind3["ZodDate"] = "ZodDate";
  ZodFirstPartyTypeKind3["ZodSymbol"] = "ZodSymbol";
  ZodFirstPartyTypeKind3["ZodUndefined"] = "ZodUndefined";
  ZodFirstPartyTypeKind3["ZodNull"] = "ZodNull";
  ZodFirstPartyTypeKind3["ZodAny"] = "ZodAny";
  ZodFirstPartyTypeKind3["ZodUnknown"] = "ZodUnknown";
  ZodFirstPartyTypeKind3["ZodNever"] = "ZodNever";
  ZodFirstPartyTypeKind3["ZodVoid"] = "ZodVoid";
  ZodFirstPartyTypeKind3["ZodArray"] = "ZodArray";
  ZodFirstPartyTypeKind3["ZodObject"] = "ZodObject";
  ZodFirstPartyTypeKind3["ZodUnion"] = "ZodUnion";
  ZodFirstPartyTypeKind3["ZodDiscriminatedUnion"] = "ZodDiscriminatedUnion";
  ZodFirstPartyTypeKind3["ZodIntersection"] = "ZodIntersection";
  ZodFirstPartyTypeKind3["ZodTuple"] = "ZodTuple";
  ZodFirstPartyTypeKind3["ZodRecord"] = "ZodRecord";
  ZodFirstPartyTypeKind3["ZodMap"] = "ZodMap";
  ZodFirstPartyTypeKind3["ZodSet"] = "ZodSet";
  ZodFirstPartyTypeKind3["ZodFunction"] = "ZodFunction";
  ZodFirstPartyTypeKind3["ZodLazy"] = "ZodLazy";
  ZodFirstPartyTypeKind3["ZodLiteral"] = "ZodLiteral";
  ZodFirstPartyTypeKind3["ZodEnum"] = "ZodEnum";
  ZodFirstPartyTypeKind3["ZodEffects"] = "ZodEffects";
  ZodFirstPartyTypeKind3["ZodNativeEnum"] = "ZodNativeEnum";
  ZodFirstPartyTypeKind3["ZodOptional"] = "ZodOptional";
  ZodFirstPartyTypeKind3["ZodNullable"] = "ZodNullable";
  ZodFirstPartyTypeKind3["ZodDefault"] = "ZodDefault";
  ZodFirstPartyTypeKind3["ZodCatch"] = "ZodCatch";
  ZodFirstPartyTypeKind3["ZodPromise"] = "ZodPromise";
  ZodFirstPartyTypeKind3["ZodBranded"] = "ZodBranded";
  ZodFirstPartyTypeKind3["ZodPipeline"] = "ZodPipeline";
  ZodFirstPartyTypeKind3["ZodReadonly"] = "ZodReadonly";
})(ZodFirstPartyTypeKind2 || (ZodFirstPartyTypeKind2 = {}));
var stringType = ZodString2.create;
var numberType = ZodNumber2.create;
var nanType = ZodNaN2.create;
var bigIntType = ZodBigInt2.create;
var booleanType = ZodBoolean2.create;
var dateType = ZodDate2.create;
var symbolType = ZodSymbol2.create;
var undefinedType = ZodUndefined2.create;
var nullType = ZodNull2.create;
var anyType = ZodAny2.create;
var unknownType = ZodUnknown2.create;
var neverType = ZodNever2.create;
var voidType = ZodVoid2.create;
var arrayType = ZodArray2.create;
var objectType = ZodObject2.create;
var strictObjectType = ZodObject2.strictCreate;
var unionType = ZodUnion2.create;
var discriminatedUnionType = ZodDiscriminatedUnion2.create;
var intersectionType = ZodIntersection2.create;
var tupleType = ZodTuple2.create;
var recordType = ZodRecord2.create;
var mapType = ZodMap2.create;
var setType = ZodSet2.create;
var functionType = ZodFunction2.create;
var lazyType = ZodLazy2.create;
var literalType = ZodLiteral2.create;
var enumType = ZodEnum2.create;
var nativeEnumType = ZodNativeEnum.create;
var promiseType = ZodPromise2.create;
var effectsType = ZodEffects.create;
var optionalType = ZodOptional2.create;
var nullableType = ZodNullable2.create;
var preprocessType = ZodEffects.createWithPreprocess;
var pipelineType = ZodPipeline.create;

// node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.js
function isZ4Schema(s) {
  const schema = s;
  return !!schema._zod;
}
function safeParse3(schema, data) {
  if (isZ4Schema(schema)) {
    const result2 = safeParse(schema, data);
    return result2;
  }
  const v3Schema = schema;
  const result = v3Schema.safeParse(data);
  return result;
}
function getObjectShape(schema) {
  if (!schema)
    return void 0;
  let rawShape;
  if (isZ4Schema(schema)) {
    const v4Schema = schema;
    rawShape = v4Schema._zod?.def?.shape;
  } else {
    const v3Schema = schema;
    rawShape = v3Schema.shape;
  }
  if (!rawShape)
    return void 0;
  if (typeof rawShape === "function") {
    try {
      return rawShape();
    } catch {
      return void 0;
    }
  }
  return rawShape;
}
function getLiteralValue(schema) {
  if (isZ4Schema(schema)) {
    const v4Schema = schema;
    const def2 = v4Schema._zod?.def;
    if (def2) {
      if (def2.value !== void 0)
        return def2.value;
      if (Array.isArray(def2.values) && def2.values.length > 0) {
        return def2.values[0];
      }
    }
  }
  const v3Schema = schema;
  const def = v3Schema._def;
  if (def) {
    if (def.value !== void 0)
      return def.value;
    if (Array.isArray(def.values) && def.values.length > 0) {
      return def.values[0];
    }
  }
  const directValue = schema.value;
  if (directValue !== void 0)
    return directValue;
  return void 0;
}

// node_modules/@modelcontextprotocol/sdk/dist/esm/types.js
var LATEST_PROTOCOL_VERSION = "2025-11-25";
var DEFAULT_NEGOTIATED_PROTOCOL_VERSION = "2025-03-26";
var SUPPORTED_PROTOCOL_VERSIONS = [LATEST_PROTOCOL_VERSION, "2025-06-18", "2025-03-26", "2024-11-05", "2024-10-07"];
var RELATED_TASK_META_KEY = "io.modelcontextprotocol/related-task";
var JSONRPC_VERSION = "2.0";
var AssertObjectSchema = custom((v) => v !== null && (typeof v === "object" || typeof v === "function"));
var ProgressTokenSchema = union([string2(), number2().int()]);
var CursorSchema = string2();
var TaskCreationParamsSchema = looseObject({
  /**
   * Requested duration in milliseconds to retain task from creation.
   */
  ttl: number2().optional(),
  /**
   * Time in milliseconds to wait between task status requests.
   */
  pollInterval: number2().optional()
});
var TaskMetadataSchema = object({
  ttl: number2().optional()
});
var RelatedTaskMetadataSchema = object({
  taskId: string2()
});
var RequestMetaSchema = looseObject({
  /**
   * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications.
   */
  progressToken: ProgressTokenSchema.optional(),
  /**
   * If specified, this request is related to the provided task.
   */
  [RELATED_TASK_META_KEY]: RelatedTaskMetadataSchema.optional()
});
var BaseRequestParamsSchema = object({
  /**
   * See [General fields: `_meta`](/specification/draft/basic/index#meta) for notes on `_meta` usage.
   */
  _meta: RequestMetaSchema.optional()
});
var TaskAugmentedRequestParamsSchema = BaseRequestParamsSchema.extend({
  /**
   * If specified, the caller is requesting task-augmented execution for this request.
   * The request will return a CreateTaskResult immediately, and the actual result can be
   * retrieved later via tasks/result.
   *
   * Task augmentation is subject to capability negotiation - receivers MUST declare support
   * for task augmentation of specific request types in their capabilities.
   */
  task: TaskMetadataSchema.optional()
});
var isTaskAugmentedRequestParams = (value) => TaskAugmentedRequestParamsSchema.safeParse(value).success;
var RequestSchema = object({
  method: string2(),
  params: BaseRequestParamsSchema.loose().optional()
});
var NotificationsParamsSchema = object({
  /**
   * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
   * for notes on _meta usage.
   */
  _meta: RequestMetaSchema.optional()
});
var NotificationSchema = object({
  method: string2(),
  params: NotificationsParamsSchema.loose().optional()
});
var ResultSchema = looseObject({
  /**
   * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
   * for notes on _meta usage.
   */
  _meta: RequestMetaSchema.optional()
});
var RequestIdSchema = union([string2(), number2().int()]);
var JSONRPCRequestSchema = object({
  jsonrpc: literal(JSONRPC_VERSION),
  id: RequestIdSchema,
  ...RequestSchema.shape
}).strict();
var isJSONRPCRequest = (value) => JSONRPCRequestSchema.safeParse(value).success;
var JSONRPCNotificationSchema = object({
  jsonrpc: literal(JSONRPC_VERSION),
  ...NotificationSchema.shape
}).strict();
var isJSONRPCNotification = (value) => JSONRPCNotificationSchema.safeParse(value).success;
var JSONRPCResultResponseSchema = object({
  jsonrpc: literal(JSONRPC_VERSION),
  id: RequestIdSchema,
  result: ResultSchema
}).strict();
var isJSONRPCResultResponse = (value) => JSONRPCResultResponseSchema.safeParse(value).success;
var ErrorCode;
(function(ErrorCode2) {
  ErrorCode2[ErrorCode2["ConnectionClosed"] = -32e3] = "ConnectionClosed";
  ErrorCode2[ErrorCode2["RequestTimeout"] = -32001] = "RequestTimeout";
  ErrorCode2[ErrorCode2["ParseError"] = -32700] = "ParseError";
  ErrorCode2[ErrorCode2["InvalidRequest"] = -32600] = "InvalidRequest";
  ErrorCode2[ErrorCode2["MethodNotFound"] = -32601] = "MethodNotFound";
  ErrorCode2[ErrorCode2["InvalidParams"] = -32602] = "InvalidParams";
  ErrorCode2[ErrorCode2["InternalError"] = -32603] = "InternalError";
  ErrorCode2[ErrorCode2["UrlElicitationRequired"] = -32042] = "UrlElicitationRequired";
})(ErrorCode || (ErrorCode = {}));
var JSONRPCErrorResponseSchema = object({
  jsonrpc: literal(JSONRPC_VERSION),
  id: RequestIdSchema.optional(),
  error: object({
    /**
     * The error type that occurred.
     */
    code: number2().int(),
    /**
     * A short description of the error. The message SHOULD be limited to a concise single sentence.
     */
    message: string2(),
    /**
     * Additional information about the error. The value of this member is defined by the sender (e.g. detailed error information, nested errors etc.).
     */
    data: unknown().optional()
  })
}).strict();
var isJSONRPCErrorResponse = (value) => JSONRPCErrorResponseSchema.safeParse(value).success;
var JSONRPCMessageSchema = union([
  JSONRPCRequestSchema,
  JSONRPCNotificationSchema,
  JSONRPCResultResponseSchema,
  JSONRPCErrorResponseSchema
]);
var JSONRPCResponseSchema = union([JSONRPCResultResponseSchema, JSONRPCErrorResponseSchema]);
var EmptyResultSchema = ResultSchema.strict();
var CancelledNotificationParamsSchema = NotificationsParamsSchema.extend({
  /**
   * The ID of the request to cancel.
   *
   * This MUST correspond to the ID of a request previously issued in the same direction.
   */
  requestId: RequestIdSchema.optional(),
  /**
   * An optional string describing the reason for the cancellation. This MAY be logged or presented to the user.
   */
  reason: string2().optional()
});
var CancelledNotificationSchema = NotificationSchema.extend({
  method: literal("notifications/cancelled"),
  params: CancelledNotificationParamsSchema
});
var IconSchema = object({
  /**
   * URL or data URI for the icon.
   */
  src: string2(),
  /**
   * Optional MIME type for the icon.
   */
  mimeType: string2().optional(),
  /**
   * Optional array of strings that specify sizes at which the icon can be used.
   * Each string should be in WxH format (e.g., `"48x48"`, `"96x96"`) or `"any"` for scalable formats like SVG.
   *
   * If not provided, the client should assume that the icon can be used at any size.
   */
  sizes: array(string2()).optional(),
  /**
   * Optional specifier for the theme this icon is designed for. `light` indicates
   * the icon is designed to be used with a light background, and `dark` indicates
   * the icon is designed to be used with a dark background.
   *
   * If not provided, the client should assume the icon can be used with any theme.
   */
  theme: _enum2(["light", "dark"]).optional()
});
var IconsSchema = object({
  /**
   * Optional set of sized icons that the client can display in a user interface.
   *
   * Clients that support rendering icons MUST support at least the following MIME types:
   * - `image/png` - PNG images (safe, universal compatibility)
   * - `image/jpeg` (and `image/jpg`) - JPEG images (safe, universal compatibility)
   *
   * Clients that support rendering icons SHOULD also support:
   * - `image/svg+xml` - SVG images (scalable but requires security precautions)
   * - `image/webp` - WebP images (modern, efficient format)
   */
  icons: array(IconSchema).optional()
});
var BaseMetadataSchema = object({
  /** Intended for programmatic or logical use, but used as a display name in past specs or fallback */
  name: string2(),
  /**
   * Intended for UI and end-user contexts â€” optimized to be human-readable and easily understood,
   * even by those unfamiliar with domain-specific terminology.
   *
   * If not provided, the name should be used for display (except for Tool,
   * where `annotations.title` should be given precedence over using `name`,
   * if present).
   */
  title: string2().optional()
});
var ImplementationSchema = BaseMetadataSchema.extend({
  ...BaseMetadataSchema.shape,
  ...IconsSchema.shape,
  version: string2(),
  /**
   * An optional URL of the website for this implementation.
   */
  websiteUrl: string2().optional(),
  /**
   * An optional human-readable description of what this implementation does.
   *
   * This can be used by clients or servers to provide context about their purpose
   * and capabilities. For example, a server might describe the types of resources
   * or tools it provides, while a client might describe its intended use case.
   */
  description: string2().optional()
});
var FormElicitationCapabilitySchema = intersection(object({
  applyDefaults: boolean2().optional()
}), record(string2(), unknown()));
var ElicitationCapabilitySchema = preprocess((value) => {
  if (value && typeof value === "object" && !Array.isArray(value)) {
    if (Object.keys(value).length === 0) {
      return { form: {} };
    }
  }
  return value;
}, intersection(object({
  form: FormElicitationCapabilitySchema.optional(),
  url: AssertObjectSchema.optional()
}), record(string2(), unknown()).optional()));
var ClientTasksCapabilitySchema = looseObject({
  /**
   * Present if the client supports listing tasks.
   */
  list: AssertObjectSchema.optional(),
  /**
   * Present if the client supports cancelling tasks.
   */
  cancel: AssertObjectSchema.optional(),
  /**
   * Capabilities for task creation on specific request types.
   */
  requests: looseObject({
    /**
     * Task support for sampling requests.
     */
    sampling: looseObject({
      createMessage: AssertObjectSchema.optional()
    }).optional(),
    /**
     * Task support for elicitation requests.
     */
    elicitation: looseObject({
      create: AssertObjectSchema.optional()
    }).optional()
  }).optional()
});
var ServerTasksCapabilitySchema = looseObject({
  /**
   * Present if the server supports listing tasks.
   */
  list: AssertObjectSchema.optional(),
  /**
   * Present if the server supports cancelling tasks.
   */
  cancel: AssertObjectSchema.optional(),
  /**
   * Capabilities for task creation on specific request types.
   */
  requests: looseObject({
    /**
     * Task support for tool requests.
     */
    tools: looseObject({
      call: AssertObjectSchema.optional()
    }).optional()
  }).optional()
});
var ClientCapabilitiesSchema = object({
  /**
   * Experimental, non-standard capabilities that the client supports.
   */
  experimental: record(string2(), AssertObjectSchema).optional(),
  /**
   * Present if the client supports sampling from an LLM.
   */
  sampling: object({
    /**
     * Present if the client supports context inclusion via includeContext parameter.
     * If not declared, servers SHOULD only use `includeContext: "none"` (or omit it).
     */
    context: AssertObjectSchema.optional(),
    /**
     * Present if the client supports tool use via tools and toolChoice parameters.
     */
    tools: AssertObjectSchema.optional()
  }).optional(),
  /**
   * Present if the client supports eliciting user input.
   */
  elicitation: ElicitationCapabilitySchema.optional(),
  /**
   * Present if the client supports listing roots.
   */
  roots: object({
    /**
     * Whether the client supports issuing notifications for changes to the roots list.
     */
    listChanged: boolean2().optional()
  }).optional(),
  /**
   * Present if the client supports task creation.
   */
  tasks: ClientTasksCapabilitySchema.optional(),
  /**
   * Extensions that the client supports. Keys are extension identifiers (vendor-prefix/extension-name).
   */
  extensions: record(string2(), AssertObjectSchema).optional()
});
var InitializeRequestParamsSchema = BaseRequestParamsSchema.extend({
  /**
   * The latest version of the Model Context Protocol that the client supports. The client MAY decide to support older versions as well.
   */
  protocolVersion: string2(),
  capabilities: ClientCapabilitiesSchema,
  clientInfo: ImplementationSchema
});
var InitializeRequestSchema = RequestSchema.extend({
  method: literal("initialize"),
  params: InitializeRequestParamsSchema
});
var isInitializeRequest = (value) => InitializeRequestSchema.safeParse(value).success;
var ServerCapabilitiesSchema = object({
  /**
   * Experimental, non-standard capabilities that the server supports.
   */
  experimental: record(string2(), AssertObjectSchema).optional(),
  /**
   * Present if the server supports sending log messages to the client.
   */
  logging: AssertObjectSchema.optional(),
  /**
   * Present if the server supports sending completions to the client.
   */
  completions: AssertObjectSchema.optional(),
  /**
   * Present if the server offers any prompt templates.
   */
  prompts: object({
    /**
     * Whether this server supports issuing notifications for changes to the prompt list.
     */
    listChanged: boolean2().optional()
  }).optional(),
  /**
   * Present if the server offers any resources to read.
   */
  resources: object({
    /**
     * Whether this server supports clients subscribing to resource updates.
     */
    subscribe: boolean2().optional(),
    /**
     * Whether this server supports issuing notifications for changes to the resource list.
     */
    listChanged: boolean2().optional()
  }).optional(),
  /**
   * Present if the server offers any tools to call.
   */
  tools: object({
    /**
     * Whether this server supports issuing notifications for changes to the tool list.
     */
    listChanged: boolean2().optional()
  }).optional(),
  /**
   * Present if the server supports task creation.
   */
  tasks: ServerTasksCapabilitySchema.optional(),
  /**
   * Extensions that the server supports. Keys are extension identifiers (vendor-prefix/extension-name).
   */
  extensions: record(string2(), AssertObjectSchema).optional()
});
var InitializeResultSchema = ResultSchema.extend({
  /**
   * The version of the Model Context Protocol that the server wants to use. This may not match the version that the client requested. If the client cannot support this version, it MUST disconnect.
   */
  protocolVersion: string2(),
  capabilities: ServerCapabilitiesSchema,
  serverInfo: ImplementationSchema,
  /**
   * Instructions describing how to use the server and its features.
   *
   * This can be used by clients to improve the LLM's understanding of available tools, resources, etc. It can be thought of like a "hint" to the model. For example, this information MAY be added to the system prompt.
   */
  instructions: string2().optional()
});
var InitializedNotificationSchema = NotificationSchema.extend({
  method: literal("notifications/initialized"),
  params: NotificationsParamsSchema.optional()
});
var isInitializedNotification = (value) => InitializedNotificationSchema.safeParse(value).success;
var PingRequestSchema = RequestSchema.extend({
  method: literal("ping"),
  params: BaseRequestParamsSchema.optional()
});
var ProgressSchema = object({
  /**
   * The progress thus far. This should increase every time progress is made, even if the total is unknown.
   */
  progress: number2(),
  /**
   * Total number of items to process (or total progress required), if known.
   */
  total: optional(number2()),
  /**
   * An optional message describing the current progress.
   */
  message: optional(string2())
});
var ProgressNotificationParamsSchema = object({
  ...NotificationsParamsSchema.shape,
  ...ProgressSchema.shape,
  /**
   * The progress token which was given in the initial request, used to associate this notification with the request that is proceeding.
   */
  progressToken: ProgressTokenSchema
});
var ProgressNotificationSchema = NotificationSchema.extend({
  method: literal("notifications/progress"),
  params: ProgressNotificationParamsSchema
});
var PaginatedRequestParamsSchema = BaseRequestParamsSchema.extend({
  /**
   * An opaque token representing the current pagination position.
   * If provided, the server should return results starting after this cursor.
   */
  cursor: CursorSchema.optional()
});
var PaginatedRequestSchema = RequestSchema.extend({
  params: PaginatedRequestParamsSchema.optional()
});
var PaginatedResultSchema = ResultSchema.extend({
  /**
   * An opaque token representing the pagination position after the last returned result.
   * If present, there may be more results available.
   */
  nextCursor: CursorSchema.optional()
});
var TaskStatusSchema = _enum2(["working", "input_required", "completed", "failed", "cancelled"]);
var TaskSchema = object({
  taskId: string2(),
  status: TaskStatusSchema,
  /**
   * Time in milliseconds to keep task results available after completion.
   * If null, the task has unlimited lifetime until manually cleaned up.
   */
  ttl: union([number2(), _null3()]),
  /**
   * ISO 8601 timestamp when the task was created.
   */
  createdAt: string2(),
  /**
   * ISO 8601 timestamp when the task was last updated.
   */
  lastUpdatedAt: string2(),
  pollInterval: optional(number2()),
  /**
   * Optional diagnostic message for failed tasks or other status information.
   */
  statusMessage: optional(string2())
});
var CreateTaskResultSchema = ResultSchema.extend({
  task: TaskSchema
});
var TaskStatusNotificationParamsSchema = NotificationsParamsSchema.merge(TaskSchema);
var TaskStatusNotificationSchema = NotificationSchema.extend({
  method: literal("notifications/tasks/status"),
  params: TaskStatusNotificationParamsSchema
});
var GetTaskRequestSchema = RequestSchema.extend({
  method: literal("tasks/get"),
  params: BaseRequestParamsSchema.extend({
    taskId: string2()
  })
});
var GetTaskResultSchema = ResultSchema.merge(TaskSchema);
var GetTaskPayloadRequestSchema = RequestSchema.extend({
  method: literal("tasks/result"),
  params: BaseRequestParamsSchema.extend({
    taskId: string2()
  })
});
var GetTaskPayloadResultSchema = ResultSchema.loose();
var ListTasksRequestSchema = PaginatedRequestSchema.extend({
  method: literal("tasks/list")
});
var ListTasksResultSchema = PaginatedResultSchema.extend({
  tasks: array(TaskSchema)
});
var CancelTaskRequestSchema = RequestSchema.extend({
  method: literal("tasks/cancel"),
  params: BaseRequestParamsSchema.extend({
    taskId: string2()
  })
});
var CancelTaskResultSchema = ResultSchema.merge(TaskSchema);
var ResourceContentsSchema = object({
  /**
   * The URI of this resource.
   */
  uri: string2(),
  /**
   * The MIME type of this resource, if known.
   */
  mimeType: optional(string2()),
  /**
   * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
   * for notes on _meta usage.
   */
  _meta: record(string2(), unknown()).optional()
});
var TextResourceContentsSchema = ResourceContentsSchema.extend({
  /**
   * The text of the item. This must only be set if the item can actually be represented as text (not binary data).
   */
  text: string2()
});
var Base64Schema = string2().refine((val) => {
  try {
    atob(val);
    return true;
  } catch {
    return false;
  }
}, { message: "Invalid Base64 string" });
var BlobResourceContentsSchema = ResourceContentsSchema.extend({
  /**
   * A base64-encoded string representing the binary data of the item.
   */
  blob: Base64Schema
});
var RoleSchema = _enum2(["user", "assistant"]);
var AnnotationsSchema = object({
  /**
   * Intended audience(s) for the resource.
   */
  audience: array(RoleSchema).optional(),
  /**
   * Importance hint for the resource, from 0 (least) to 1 (most).
   */
  priority: number2().min(0).max(1).optional(),
  /**
   * ISO 8601 timestamp for the most recent modification.
   */
  lastModified: iso_exports.datetime({ offset: true }).optional()
});
var ResourceSchema = object({
  ...BaseMetadataSchema.shape,
  ...IconsSchema.shape,
  /**
   * The URI of this resource.
   */
  uri: string2(),
  /**
   * A description of what this resource represents.
   *
   * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model.
   */
  description: optional(string2()),
  /**
   * The MIME type of this resource, if known.
   */
  mimeType: optional(string2()),
  /**
   * The size of the raw resource content, in bytes (i.e., before base64 encoding or any tokenization), if known.
   *
   * This can be used by Hosts to display file sizes and estimate context window usage.
   */
  size: optional(number2()),
  /**
   * Optional annotations for the client.
   */
  annotations: AnnotationsSchema.optional(),
  /**
   * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
   * for notes on _meta usage.
   */
  _meta: optional(looseObject({}))
});
var ResourceTemplateSchema = object({
  ...BaseMetadataSchema.shape,
  ...IconsSchema.shape,
  /**
   * A URI template (according to RFC 6570) that can be used to construct resource URIs.
   */
  uriTemplate: string2(),
  /**
   * A description of what this template is for.
   *
   * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model.
   */
  description: optional(string2()),
  /**
   * The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type.
   */
  mimeType: optional(string2()),
  /**
   * Optional annotations for the client.
   */
  annotations: AnnotationsSchema.optional(),
  /**
   * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
   * for notes on _meta usage.
   */
  _meta: optional(looseObject({}))
});
var ListResourcesRequestSchema = PaginatedRequestSchema.extend({
  method: literal("resources/list")
});
var ListResourcesResultSchema = PaginatedResultSchema.extend({
  resources: array(ResourceSchema)
});
var ListResourceTemplatesRequestSchema = PaginatedRequestSchema.extend({
  method: literal("resources/templates/list")
});
var ListResourceTemplatesResultSchema = PaginatedResultSchema.extend({
  resourceTemplates: array(ResourceTemplateSchema)
});
var ResourceRequestParamsSchema = BaseRequestParamsSchema.extend({
  /**
   * The URI of the resource to read. The URI can use any protocol; it is up to the server how to interpret it.
   *
   * @format uri
   */
  uri: string2()
});
var ReadResourceRequestParamsSchema = ResourceRequestParamsSchema;
var ReadResourceRequestSchema = RequestSchema.extend({
  method: literal("resources/read"),
  params: ReadResourceRequestParamsSchema
});
var ReadResourceResultSchema = ResultSchema.extend({
  contents: array(union([TextResourceContentsSchema, BlobResourceContentsSchema]))
});
var ResourceListChangedNotificationSchema = NotificationSchema.extend({
  method: literal("notifications/resources/list_changed"),
  params: NotificationsParamsSchema.optional()
});
var SubscribeRequestParamsSchema = ResourceRequestParamsSchema;
var SubscribeRequestSchema = RequestSchema.extend({
  method: literal("resources/subscribe"),
  params: SubscribeRequestParamsSchema
});
var UnsubscribeRequestParamsSchema = ResourceRequestParamsSchema;
var UnsubscribeRequestSchema = RequestSchema.extend({
  method: literal("resources/unsubscribe"),
  params: UnsubscribeRequestParamsSchema
});
var ResourceUpdatedNotificationParamsSchema = NotificationsParamsSchema.extend({
  /**
   * The URI of the resource that has been updated. This might be a sub-resource of the one that the client actually subscribed to.
   */
  uri: string2()
});
var ResourceUpdatedNotificationSchema = NotificationSchema.extend({
  method: literal("notifications/resources/updated"),
  params: ResourceUpdatedNotificationParamsSchema
});
var PromptArgumentSchema = object({
  /**
   * The name of the argument.
   */
  name: string2(),
  /**
   * A human-readable description of the argument.
   */
  description: optional(string2()),
  /**
   * Whether this argument must be provided.
   */
  required: optional(boolean2())
});
var PromptSchema = object({
  ...BaseMetadataSchema.shape,
  ...IconsSchema.shape,
  /**
   * An optional description of what this prompt provides
   */
  description: optional(string2()),
  /**
   * A list of arguments to use for templating the prompt.
   */
  arguments: optional(array(PromptArgumentSchema)),
  /**
   * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
   * for notes on _meta usage.
   */
  _meta: optional(looseObject({}))
});
var ListPromptsRequestSchema = PaginatedRequestSchema.extend({
  method: literal("prompts/list")
});
var ListPromptsResultSchema = PaginatedResultSchema.extend({
  prompts: array(PromptSchema)
});
var GetPromptRequestParamsSchema = BaseRequestParamsSchema.extend({
  /**
   * The name of the prompt or prompt template.
   */
  name: string2(),
  /**
   * Arguments to use for templating the prompt.
   */
  arguments: record(string2(), string2()).optional()
});
var GetPromptRequestSchema = RequestSchema.extend({
  method: literal("prompts/get"),
  params: GetPromptRequestParamsSchema
});
var TextContentSchema = object({
  type: literal("text"),
  /**
   * The text content of the message.
   */
  text: string2(),
  /**
   * Optional annotations for the client.
   */
  annotations: AnnotationsSchema.optional(),
  /**
   * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
   * for notes on _meta usage.
   */
  _meta: record(string2(), unknown()).optional()
});
var ImageContentSchema = object({
  type: literal("image"),
  /**
   * The base64-encoded image data.
   */
  data: Base64Schema,
  /**
   * The MIME type of the image. Different providers may support different image types.
   */
  mimeType: string2(),
  /**
   * Optional annotations for the client.
   */
  annotations: AnnotationsSchema.optional(),
  /**
   * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
   * for notes on _meta usage.
   */
  _meta: record(string2(), unknown()).optional()
});
var AudioContentSchema = object({
  type: literal("audio"),
  /**
   * The base64-encoded audio data.
   */
  data: Base64Schema,
  /**
   * The MIME type of the audio. Different providers may support different audio types.
   */
  mimeType: string2(),
  /**
   * Optional annotations for the client.
   */
  annotations: AnnotationsSchema.optional(),
  /**
   * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
   * for notes on _meta usage.
   */
  _meta: record(string2(), unknown()).optional()
});
var ToolUseContentSchema = object({
  type: literal("tool_use"),
  /**
   * The name of the tool to invoke.
   * Must match a tool name from the request's tools array.
   */
  name: string2(),
  /**
   * Unique identifier for this tool call.
   * Used to correlate with ToolResultContent in subsequent messages.
   */
  id: string2(),
  /**
   * Arguments to pass to the tool.
   * Must conform to the tool's inputSchema.
   */
  input: record(string2(), unknown()),
  /**
   * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
   * for notes on _meta usage.
   */
  _meta: record(string2(), unknown()).optional()
});
var EmbeddedResourceSchema = object({
  type: literal("resource"),
  resource: union([TextResourceContentsSchema, BlobResourceContentsSchema]),
  /**
   * Optional annotations for the client.
   */
  annotations: AnnotationsSchema.optional(),
  /**
   * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
   * for notes on _meta usage.
   */
  _meta: record(string2(), unknown()).optional()
});
var ResourceLinkSchema = ResourceSchema.extend({
  type: literal("resource_link")
});
var ContentBlockSchema = union([
  TextContentSchema,
  ImageContentSchema,
  AudioContentSchema,
  ResourceLinkSchema,
  EmbeddedResourceSchema
]);
var PromptMessageSchema = object({
  role: RoleSchema,
  content: ContentBlockSchema
});
var GetPromptResultSchema = ResultSchema.extend({
  /**
   * An optional description for the prompt.
   */
  description: string2().optional(),
  messages: array(PromptMessageSchema)
});
var PromptListChangedNotificationSchema = NotificationSchema.extend({
  method: literal("notifications/prompts/list_changed"),
  params: NotificationsParamsSchema.optional()
});
var ToolAnnotationsSchema = object({
  /**
   * A human-readable title for the tool.
   */
  title: string2().optional(),
  /**
   * If true, the tool does not modify its environment.
   *
   * Default: false
   */
  readOnlyHint: boolean2().optional(),
  /**
   * If true, the tool may perform destructive updates to its environment.
   * If false, the tool performs only additive updates.
   *
   * (This property is meaningful only when `readOnlyHint == false`)
   *
   * Default: true
   */
  destructiveHint: boolean2().optional(),
  /**
   * If true, calling the tool repeatedly with the same arguments
   * will have no additional effect on the its environment.
   *
   * (This property is meaningful only when `readOnlyHint == false`)
   *
   * Default: false
   */
  idempotentHint: boolean2().optional(),
  /**
   * If true, this tool may interact with an "open world" of external
   * entities. If false, the tool's domain of interaction is closed.
   * For example, the world of a web search tool is open, whereas that
   * of a memory tool is not.
   *
   * Default: true
   */
  openWorldHint: boolean2().optional()
});
var ToolExecutionSchema = object({
  /**
   * Indicates the tool's preference for task-augmented execution.
   * - "required": Clients MUST invoke the tool as a task
   * - "optional": Clients MAY invoke the tool as a task or normal request
   * - "forbidden": Clients MUST NOT attempt to invoke the tool as a task
   *
   * If not present, defaults to "forbidden".
   */
  taskSupport: _enum2(["required", "optional", "forbidden"]).optional()
});
var ToolSchema = object({
  ...BaseMetadataSchema.shape,
  ...IconsSchema.shape,
  /**
   * A human-readable description of the tool.
   */
  description: string2().optional(),
  /**
   * A JSON Schema 2020-12 object defining the expected parameters for the tool.
   * Must have type: 'object' at the root level per MCP spec.
   */
  inputSchema: object({
    type: literal("object"),
    properties: record(string2(), AssertObjectSchema).optional(),
    required: array(string2()).optional()
  }).catchall(unknown()),
  /**
   * An optional JSON Schema 2020-12 object defining the structure of the tool's output
   * returned in the structuredContent field of a CallToolResult.
   * Must have type: 'object' at the root level per MCP spec.
   */
  outputSchema: object({
    type: literal("object"),
    properties: record(string2(), AssertObjectSchema).optional(),
    required: array(string2()).optional()
  }).catchall(unknown()).optional(),
  /**
   * Optional additional tool information.
   */
  annotations: ToolAnnotationsSchema.optional(),
  /**
   * Execution-related properties for this tool.
   */
  execution: ToolExecutionSchema.optional(),
  /**
   * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
   * for notes on _meta usage.
   */
  _meta: record(string2(), unknown()).optional()
});
var ListToolsRequestSchema = PaginatedRequestSchema.extend({
  method: literal("tools/list")
});
var ListToolsResultSchema = PaginatedResultSchema.extend({
  tools: array(ToolSchema)
});
var CallToolResultSchema = ResultSchema.extend({
  /**
   * A list of content objects that represent the result of the tool call.
   *
   * If the Tool does not define an outputSchema, this field MUST be present in the result.
   * For backwards compatibility, this field is always present, but it may be empty.
   */
  content: array(ContentBlockSchema).default([]),
  /**
   * An object containing structured tool output.
   *
   * If the Tool defines an outputSchema, this field MUST be present in the result, and contain a JSON object that matches the schema.
   */
  structuredContent: record(string2(), unknown()).optional(),
  /**
   * Whether the tool call ended in an error.
   *
   * If not set, this is assumed to be false (the call was successful).
   *
   * Any errors that originate from the tool SHOULD be reported inside the result
   * object, with `isError` set to true, _not_ as an MCP protocol-level error
   * response. Otherwise, the LLM would not be able to see that an error occurred
   * and self-correct.
   *
   * However, any errors in _finding_ the tool, an error indicating that the
   * server does not support tool calls, or any other exceptional conditions,
   * should be reported as an MCP error response.
   */
  isError: boolean2().optional()
});
var CompatibilityCallToolResultSchema = CallToolResultSchema.or(ResultSchema.extend({
  toolResult: unknown()
}));
var CallToolRequestParamsSchema = TaskAugmentedRequestParamsSchema.extend({
  /**
   * The name of the tool to call.
   */
  name: string2(),
  /**
   * Arguments to pass to the tool.
   */
  arguments: record(string2(), unknown()).optional()
});
var CallToolRequestSchema = RequestSchema.extend({
  method: literal("tools/call"),
  params: CallToolRequestParamsSchema
});
var ToolListChangedNotificationSchema = NotificationSchema.extend({
  method: literal("notifications/tools/list_changed"),
  params: NotificationsParamsSchema.optional()
});
var ListChangedOptionsBaseSchema = object({
  /**
   * If true, the list will be refreshed automatically when a list changed notification is received.
   * The callback will be called with the updated list.
   *
   * If false, the callback will be called with null items, allowing manual refresh.
   *
   * @default true
   */
  autoRefresh: boolean2().default(true),
  /**
   * Debounce time in milliseconds for list changed notification processing.
   *
   * Multiple notifications received within this timeframe will only trigger one refresh.
   * Set to 0 to disable debouncing.
   *
   * @default 300
   */
  debounceMs: number2().int().nonnegative().default(300)
});
var LoggingLevelSchema = _enum2(["debug", "info", "notice", "warning", "error", "critical", "alert", "emergency"]);
var SetLevelRequestParamsSchema = BaseRequestParamsSchema.extend({
  /**
   * The level of logging that the client wants to receive from the server. The server should send all logs at this level and higher (i.e., more severe) to the client as notifications/logging/message.
   */
  level: LoggingLevelSchema
});
var SetLevelRequestSchema = RequestSchema.extend({
  method: literal("logging/setLevel"),
  params: SetLevelRequestParamsSchema
});
var LoggingMessageNotificationParamsSchema = NotificationsParamsSchema.extend({
  /**
   * The severity of this log message.
   */
  level: LoggingLevelSchema,
  /**
   * An optional name of the logger issuing this message.
   */
  logger: string2().optional(),
  /**
   * The data to be logged, such as a string message or an object. Any JSON serializable type is allowed here.
   */
  data: unknown()
});
var LoggingMessageNotificationSchema = NotificationSchema.extend({
  method: literal("notifications/message"),
  params: LoggingMessageNotificationParamsSchema
});
var ModelHintSchema = object({
  /**
   * A hint for a model name.
   */
  name: string2().optional()
});
var ModelPreferencesSchema = object({
  /**
   * Optional hints to use for model selection.
   */
  hints: array(ModelHintSchema).optional(),
  /**
   * How much to prioritize cost when selecting a model.
   */
  costPriority: number2().min(0).max(1).optional(),
  /**
   * How much to prioritize sampling speed (latency) when selecting a model.
   */
  speedPriority: number2().min(0).max(1).optional(),
  /**
   * How much to prioritize intelligence and capabilities when selecting a model.
   */
  intelligencePriority: number2().min(0).max(1).optional()
});
var ToolChoiceSchema = object({
  /**
   * Controls when tools are used:
   * - "auto": Model decides whether to use tools (default)
   * - "required": Model MUST use at least one tool before completing
   * - "none": Model MUST NOT use any tools
   */
  mode: _enum2(["auto", "required", "none"]).optional()
});
var ToolResultContentSchema = object({
  type: literal("tool_result"),
  toolUseId: string2().describe("The unique identifier for the corresponding tool call."),
  content: array(ContentBlockSchema).default([]),
  structuredContent: object({}).loose().optional(),
  isError: boolean2().optional(),
  /**
   * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
   * for notes on _meta usage.
   */
  _meta: record(string2(), unknown()).optional()
});
var SamplingContentSchema = discriminatedUnion("type", [TextContentSchema, ImageContentSchema, AudioContentSchema]);
var SamplingMessageContentBlockSchema = discriminatedUnion("type", [
  TextContentSchema,
  ImageContentSchema,
  AudioContentSchema,
  ToolUseContentSchema,
  ToolResultContentSchema
]);
var SamplingMessageSchema = object({
  role: RoleSchema,
  content: union([SamplingMessageContentBlockSchema, array(SamplingMessageContentBlockSchema)]),
  /**
   * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
   * for notes on _meta usage.
   */
  _meta: record(string2(), unknown()).optional()
});
var CreateMessageRequestParamsSchema = TaskAugmentedRequestParamsSchema.extend({
  messages: array(SamplingMessageSchema),
  /**
   * The server's preferences for which model to select. The client MAY modify or omit this request.
   */
  modelPreferences: ModelPreferencesSchema.optional(),
  /**
   * An optional system prompt the server wants to use for sampling. The client MAY modify or omit this prompt.
   */
  systemPrompt: string2().optional(),
  /**
   * A request to include context from one or more MCP servers (including the caller), to be attached to the prompt.
   * The client MAY ignore this request.
   *
   * Default is "none". Values "thisServer" and "allServers" are soft-deprecated. Servers SHOULD only use these values if the client
   * declares ClientCapabilities.sampling.context. These values may be removed in future spec releases.
   */
  includeContext: _enum2(["none", "thisServer", "allServers"]).optional(),
  temperature: number2().optional(),
  /**
   * The requested maximum number of tokens to sample (to prevent runaway completions).
   *
   * The client MAY choose to sample fewer tokens than the requested maximum.
   */
  maxTokens: number2().int(),
  stopSequences: array(string2()).optional(),
  /**
   * Optional metadata to pass through to the LLM provider. The format of this metadata is provider-specific.
   */
  metadata: AssertObjectSchema.optional(),
  /**
   * Tools that the model may use during generation.
   * The client MUST return an error if this field is provided but ClientCapabilities.sampling.tools is not declared.
   */
  tools: array(ToolSchema).optional(),
  /**
   * Controls how the model uses tools.
   * The client MUST return an error if this field is provided but ClientCapabilities.sampling.tools is not declared.
   * Default is `{ mode: "auto" }`.
   */
  toolChoice: ToolChoiceSchema.optional()
});
var CreateMessageRequestSchema = RequestSchema.extend({
  method: literal("sampling/createMessage"),
  params: CreateMessageRequestParamsSchema
});
var CreateMessageResultSchema = ResultSchema.extend({
  /**
   * The name of the model that generated the message.
   */
  model: string2(),
  /**
   * The reason why sampling stopped, if known.
   *
   * Standard values:
   * - "endTurn": Natural end of the assistant's turn
   * - "stopSequence": A stop sequence was encountered
   * - "maxTokens": Maximum token limit was reached
   *
   * This field is an open string to allow for provider-specific stop reasons.
   */
  stopReason: optional(_enum2(["endTurn", "stopSequence", "maxTokens"]).or(string2())),
  role: RoleSchema,
  /**
   * Response content. Single content block (text, image, or audio).
   */
  content: SamplingContentSchema
});
var CreateMessageResultWithToolsSchema = ResultSchema.extend({
  /**
   * The name of the model that generated the message.
   */
  model: string2(),
  /**
   * The reason why sampling stopped, if known.
   *
   * Standard values:
   * - "endTurn": Natural end of the assistant's turn
   * - "stopSequence": A stop sequence was encountered
   * - "maxTokens": Maximum token limit was reached
   * - "toolUse": The model wants to use one or more tools
   *
   * This field is an open string to allow for provider-specific stop reasons.
   */
  stopReason: optional(_enum2(["endTurn", "stopSequence", "maxTokens", "toolUse"]).or(string2())),
  role: RoleSchema,
  /**
   * Response content. May be a single block or array. May include ToolUseContent if stopReason is "toolUse".
   */
  content: union([SamplingMessageContentBlockSchema, array(SamplingMessageContentBlockSchema)])
});
var BooleanSchemaSchema = object({
  type: literal("boolean"),
  title: string2().optional(),
  description: string2().optional(),
  default: boolean2().optional()
});
var StringSchemaSchema = object({
  type: literal("string"),
  title: string2().optional(),
  description: string2().optional(),
  minLength: number2().optional(),
  maxLength: number2().optional(),
  format: _enum2(["email", "uri", "date", "date-time"]).optional(),
  default: string2().optional()
});
var NumberSchemaSchema = object({
  type: _enum2(["number", "integer"]),
  title: string2().optional(),
  description: string2().optional(),
  minimum: number2().optional(),
  maximum: number2().optional(),
  default: number2().optional()
});
var UntitledSingleSelectEnumSchemaSchema = object({
  type: literal("string"),
  title: string2().optional(),
  description: string2().optional(),
  enum: array(string2()),
  default: string2().optional()
});
var TitledSingleSelectEnumSchemaSchema = object({
  type: literal("string"),
  title: string2().optional(),
  description: string2().optional(),
  oneOf: array(object({
    const: string2(),
    title: string2()
  })),
  default: string2().optional()
});
var LegacyTitledEnumSchemaSchema = object({
  type: literal("string"),
  title: string2().optional(),
  description: string2().optional(),
  enum: array(string2()),
  enumNames: array(string2()).optional(),
  default: string2().optional()
});
var SingleSelectEnumSchemaSchema = union([UntitledSingleSelectEnumSchemaSchema, TitledSingleSelectEnumSchemaSchema]);
var UntitledMultiSelectEnumSchemaSchema = object({
  type: literal("array"),
  title: string2().optional(),
  description: string2().optional(),
  minItems: number2().optional(),
  maxItems: number2().optional(),
  items: object({
    type: literal("string"),
    enum: array(string2())
  }),
  default: array(string2()).optional()
});
var TitledMultiSelectEnumSchemaSchema = object({
  type: literal("array"),
  title: string2().optional(),
  description: string2().optional(),
  minItems: number2().optional(),
  maxItems: number2().optional(),
  items: object({
    anyOf: array(object({
      const: string2(),
      title: string2()
    }))
  }),
  default: array(string2()).optional()
});
var MultiSelectEnumSchemaSchema = union([UntitledMultiSelectEnumSchemaSchema, TitledMultiSelectEnumSchemaSchema]);
var EnumSchemaSchema = union([LegacyTitledEnumSchemaSchema, SingleSelectEnumSchemaSchema, MultiSelectEnumSchemaSchema]);
var PrimitiveSchemaDefinitionSchema = union([EnumSchemaSchema, BooleanSchemaSchema, StringSchemaSchema, NumberSchemaSchema]);
var ElicitRequestFormParamsSchema = TaskAugmentedRequestParamsSchema.extend({
  /**
   * The elicitation mode.
   *
   * Optional for backward compatibility. Clients MUST treat missing mode as "form".
   */
  mode: literal("form").optional(),
  /**
   * The message to present to the user describing what information is being requested.
   */
  message: string2(),
  /**
   * A restricted subset of JSON Schema.
   * Only top-level properties are allowed, without nesting.
   */
  requestedSchema: object({
    type: literal("object"),
    properties: record(string2(), PrimitiveSchemaDefinitionSchema),
    required: array(string2()).optional()
  })
});
var ElicitRequestURLParamsSchema = TaskAugmentedRequestParamsSchema.extend({
  /**
   * The elicitation mode.
   */
  mode: literal("url"),
  /**
   * The message to present to the user explaining why the interaction is needed.
   */
  message: string2(),
  /**
   * The ID of the elicitation, which must be unique within the context of the server.
   * The client MUST treat this ID as an opaque value.
   */
  elicitationId: string2(),
  /**
   * The URL that the user should navigate to.
   */
  url: string2().url()
});
var ElicitRequestParamsSchema = union([ElicitRequestFormParamsSchema, ElicitRequestURLParamsSchema]);
var ElicitRequestSchema = RequestSchema.extend({
  method: literal("elicitation/create"),
  params: ElicitRequestParamsSchema
});
var ElicitationCompleteNotificationParamsSchema = NotificationsParamsSchema.extend({
  /**
   * The ID of the elicitation that completed.
   */
  elicitationId: string2()
});
var ElicitationCompleteNotificationSchema = NotificationSchema.extend({
  method: literal("notifications/elicitation/complete"),
  params: ElicitationCompleteNotificationParamsSchema
});
var ElicitResultSchema = ResultSchema.extend({
  /**
   * The user action in response to the elicitation.
   * - "accept": User submitted the form/confirmed the action
   * - "decline": User explicitly decline the action
   * - "cancel": User dismissed without making an explicit choice
   */
  action: _enum2(["accept", "decline", "cancel"]),
  /**
   * The submitted form data, only present when action is "accept".
   * Contains values matching the requested schema.
   * Per MCP spec, content is "typically omitted" for decline/cancel actions.
   * We normalize null to undefined for leniency while maintaining type compatibility.
   */
  content: preprocess((val) => val === null ? void 0 : val, record(string2(), union([string2(), number2(), boolean2(), array(string2())])).optional())
});
var ResourceTemplateReferenceSchema = object({
  type: literal("ref/resource"),
  /**
   * The URI or URI template of the resource.
   */
  uri: string2()
});
var PromptReferenceSchema = object({
  type: literal("ref/prompt"),
  /**
   * The name of the prompt or prompt template
   */
  name: string2()
});
var CompleteRequestParamsSchema = BaseRequestParamsSchema.extend({
  ref: union([PromptReferenceSchema, ResourceTemplateReferenceSchema]),
  /**
   * The argument's information
   */
  argument: object({
    /**
     * The name of the argument
     */
    name: string2(),
    /**
     * The value of the argument to use for completion matching.
     */
    value: string2()
  }),
  context: object({
    /**
     * Previously-resolved variables in a URI template or prompt.
     */
    arguments: record(string2(), string2()).optional()
  }).optional()
});
var CompleteRequestSchema = RequestSchema.extend({
  method: literal("completion/complete"),
  params: CompleteRequestParamsSchema
});
var CompleteResultSchema = ResultSchema.extend({
  completion: looseObject({
    /**
     * An array of completion values. Must not exceed 100 items.
     */
    values: array(string2()).max(100),
    /**
     * The total number of completion options available. This can exceed the number of values actually sent in the response.
     */
    total: optional(number2().int()),
    /**
     * Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown.
     */
    hasMore: optional(boolean2())
  })
});
var RootSchema = object({
  /**
   * The URI identifying the root. This *must* start with file:// for now.
   */
  uri: string2().startsWith("file://"),
  /**
   * An optional name for the root.
   */
  name: string2().optional(),
  /**
   * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
   * for notes on _meta usage.
   */
  _meta: record(string2(), unknown()).optional()
});
var ListRootsRequestSchema = RequestSchema.extend({
  method: literal("roots/list"),
  params: BaseRequestParamsSchema.optional()
});
var ListRootsResultSchema = ResultSchema.extend({
  roots: array(RootSchema)
});
var RootsListChangedNotificationSchema = NotificationSchema.extend({
  method: literal("notifications/roots/list_changed"),
  params: NotificationsParamsSchema.optional()
});
var ClientRequestSchema = union([
  PingRequestSchema,
  InitializeRequestSchema,
  CompleteRequestSchema,
  SetLevelRequestSchema,
  GetPromptRequestSchema,
  ListPromptsRequestSchema,
  ListResourcesRequestSchema,
  ListResourceTemplatesRequestSchema,
  ReadResourceRequestSchema,
  SubscribeRequestSchema,
  UnsubscribeRequestSchema,
  CallToolRequestSchema,
  ListToolsRequestSchema,
  GetTaskRequestSchema,
  GetTaskPayloadRequestSchema,
  ListTasksRequestSchema,
  CancelTaskRequestSchema
]);
var ClientNotificationSchema = union([
  CancelledNotificationSchema,
  ProgressNotificationSchema,
  InitializedNotificationSchema,
  RootsListChangedNotificationSchema,
  TaskStatusNotificationSchema
]);
var ClientResultSchema = union([
  EmptyResultSchema,
  CreateMessageResultSchema,
  CreateMessageResultWithToolsSchema,
  ElicitResultSchema,
  ListRootsResultSchema,
  GetTaskResultSchema,
  ListTasksResultSchema,
  CreateTaskResultSchema
]);
var ServerRequestSchema = union([
  PingRequestSchema,
  CreateMessageRequestSchema,
  ElicitRequestSchema,
  ListRootsRequestSchema,
  GetTaskRequestSchema,
  GetTaskPayloadRequestSchema,
  ListTasksRequestSchema,
  CancelTaskRequestSchema
]);
var ServerNotificationSchema = union([
  CancelledNotificationSchema,
  ProgressNotificationSchema,
  LoggingMessageNotificationSchema,
  ResourceUpdatedNotificationSchema,
  ResourceListChangedNotificationSchema,
  ToolListChangedNotificationSchema,
  PromptListChangedNotificationSchema,
  TaskStatusNotificationSchema,
  ElicitationCompleteNotificationSchema
]);
var ServerResultSchema = union([
  EmptyResultSchema,
  InitializeResultSchema,
  CompleteResultSchema,
  GetPromptResultSchema,
  ListPromptsResultSchema,
  ListResourcesResultSchema,
  ListResourceTemplatesResultSchema,
  ReadResourceResultSchema,
  CallToolResultSchema,
  ListToolsResultSchema,
  GetTaskResultSchema,
  ListTasksResultSchema,
  CreateTaskResultSchema
]);
var McpError = class _McpError extends Error {
  constructor(code, message, data) {
    super(`MCP error ${code}: ${message}`);
    this.code = code;
    this.data = data;
    this.name = "McpError";
  }
  /**
   * Factory method to create the appropriate error type based on the error code and data
   */
  static fromError(code, message, data) {
    if (code === ErrorCode.UrlElicitationRequired && data) {
      const errorData = data;
      if (errorData.elicitations) {
        return new UrlElicitationRequiredError(errorData.elicitations, message);
      }
    }
    return new _McpError(code, message, data);
  }
};
var UrlElicitationRequiredError = class extends McpError {
  constructor(elicitations, message = `URL elicitation${elicitations.length > 1 ? "s" : ""} required`) {
    super(ErrorCode.UrlElicitationRequired, message, {
      elicitations
    });
  }
  get elicitations() {
    return this.data?.elicitations ?? [];
  }
};

// node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/interfaces.js
function isTerminal(status) {
  return status === "completed" || status === "failed" || status === "cancelled";
}

// node_modules/zod-to-json-schema/dist/esm/Options.js
var ignoreOverride = Symbol("Let zodToJsonSchema decide on which parser to use");
var defaultOptions = {
  name: void 0,
  $refStrategy: "root",
  basePath: ["#"],
  effectStrategy: "input",
  pipeStrategy: "all",
  dateStrategy: "format:date-time",
  mapStrategy: "entries",
  removeAdditionalStrategy: "passthrough",
  allowedAdditionalProperties: true,
  rejectedAdditionalProperties: false,
  definitionPath: "definitions",
  target: "jsonSchema7",
  strictUnions: false,
  definitions: {},
  errorMessages: false,
  markdownDescription: false,
  patternStrategy: "escape",
  applyRegexFlags: false,
  emailStrategy: "format:email",
  base64Strategy: "contentEncoding:base64",
  nameStrategy: "ref",
  openAiAnyTypeName: "OpenAiAnyType"
};
var getDefaultOptions = (options2) => typeof options2 === "string" ? {
  ...defaultOptions,
  name: options2
} : {
  ...defaultOptions,
  ...options2
};

// node_modules/zod-to-json-schema/dist/esm/Refs.js
var getRefs = (options2) => {
  const _options = getDefaultOptions(options2);
  const currentPath = _options.name !== void 0 ? [..._options.basePath, _options.definitionPath, _options.name] : _options.basePath;
  return {
    ..._options,
    flags: { hasReferencedOpenAiAnyType: false },
    currentPath,
    propertyPath: void 0,
    seen: new Map(Object.entries(_options.definitions).map(([name, def]) => [
      def._def,
      {
        def: def._def,
        path: [..._options.basePath, _options.definitionPath, name],
        // Resolution of references will be forced even though seen, so it's ok that the schema is undefined here for now.
        jsonSchema: void 0
      }
    ]))
  };
};

// node_modules/zod-to-json-schema/dist/esm/errorMessages.js
function addErrorMessage(res, key, errorMessage, refs) {
  if (!refs?.errorMessages)
    return;
  if (errorMessage) {
    res.errorMessage = {
      ...res.errorMessage,
      [key]: errorMessage
    };
  }
}
function setResponseValueAndErrors(res, key, value, errorMessage, refs) {
  res[key] = value;
  addErrorMessage(res, key, errorMessage, refs);
}

// node_modules/zod-to-json-schema/dist/esm/getRelativePath.js
var getRelativePath = (pathA, pathB) => {
  let i = 0;
  for (; i < pathA.length && i < pathB.length; i++) {
    if (pathA[i] !== pathB[i])
      break;
  }
  return [(pathA.length - i).toString(), ...pathB.slice(i)].join("/");
};

// node_modules/zod-to-json-schema/dist/esm/parsers/any.js
function parseAnyDef(refs) {
  if (refs.target !== "openAi") {
    return {};
  }
  const anyDefinitionPath = [
    ...refs.basePath,
    refs.definitionPath,
    refs.openAiAnyTypeName
  ];
  refs.flags.hasReferencedOpenAiAnyType = true;
  return {
    $ref: refs.$refStrategy === "relative" ? getRelativePath(anyDefinitionPath, refs.currentPath) : anyDefinitionPath.join("/")
  };
}

// node_modules/zod-to-json-schema/dist/esm/parsers/array.js
function parseArrayDef(def, refs) {
  const res = {
    type: "array"
  };
  if (def.type?._def && def.type?._def?.typeName !== ZodFirstPartyTypeKind2.ZodAny) {
    res.items = parseDef(def.type._def, {
      ...refs,
      currentPath: [...refs.currentPath, "items"]
    });
  }
  if (def.minLength) {
    setResponseValueAndErrors(res, "minItems", def.minLength.value, def.minLength.message, refs);
  }
  if (def.maxLength) {
    setResponseValueAndErrors(res, "maxItems", def.maxLength.value, def.maxLength.message, refs);
  }
  if (def.exactLength) {
    setResponseValueAndErrors(res, "minItems", def.exactLength.value, def.exactLength.message, refs);
    setResponseValueAndErrors(res, "maxItems", def.exactLength.value, def.exactLength.message, refs);
  }
  return res;
}

// node_modules/zod-to-json-schema/dist/esm/parsers/bigint.js
function parseBigintDef(def, refs) {
  const res = {
    type: "integer",
    format: "int64"
  };
  if (!def.checks)
    return res;
  for (const check2 of def.checks) {
    switch (check2.kind) {
      case "min":
        if (refs.target === "jsonSchema7") {
          if (check2.inclusive) {
            setResponseValueAndErrors(res, "minimum", check2.value, check2.message, refs);
          } else {
            setResponseValueAndErrors(res, "exclusiveMinimum", check2.value, check2.message, refs);
          }
        } else {
          if (!check2.inclusive) {
            res.exclusiveMinimum = true;
          }
          setResponseValueAndErrors(res, "minimum", check2.value, check2.message, refs);
        }
        break;
      case "max":
        if (refs.target === "jsonSchema7") {
          if (check2.inclusive) {
            setResponseValueAndErrors(res, "maximum", check2.value, check2.message, refs);
          } else {
            setResponseValueAndErrors(res, "exclusiveMaximum", check2.value, check2.message, refs);
          }
        } else {
          if (!check2.inclusive) {
            res.exclusiveMaximum = true;
          }
          setResponseValueAndErrors(res, "maximum", check2.value, check2.message, refs);
        }
        break;
      case "multipleOf":
        setResponseValueAndErrors(res, "multipleOf", check2.value, check2.message, refs);
        break;
    }
  }
  return res;
}

// node_modules/zod-to-json-schema/dist/esm/parsers/boolean.js
function parseBooleanDef() {
  return {
    type: "boolean"
  };
}

// node_modules/zod-to-json-schema/dist/esm/parsers/branded.js
function parseBrandedDef(_def, refs) {
  return parseDef(_def.type._def, refs);
}

// node_modules/zod-to-json-schema/dist/esm/parsers/catch.js
var parseCatchDef = (def, refs) => {
  return parseDef(def.innerType._def, refs);
};

// node_modules/zod-to-json-schema/dist/esm/parsers/date.js
function parseDateDef(def, refs, overrideDateStrategy) {
  const strategy = overrideDateStrategy ?? refs.dateStrategy;
  if (Array.isArray(strategy)) {
    return {
      anyOf: strategy.map((item, i) => parseDateDef(def, refs, item))
    };
  }
  switch (strategy) {
    case "string":
    case "format:date-time":
      return {
        type: "string",
        format: "date-time"
      };
    case "format:date":
      return {
        type: "string",
        format: "date"
      };
    case "integer":
      return integerDateParser(def, refs);
  }
}
var integerDateParser = (def, refs) => {
  const res = {
    type: "integer",
    format: "unix-time"
  };
  if (refs.target === "openApi3") {
    return res;
  }
  for (const check2 of def.checks) {
    switch (check2.kind) {
      case "min":
        setResponseValueAndErrors(
          res,
          "minimum",
          check2.value,
          // This is in milliseconds
          check2.message,
          refs
        );
        break;
      case "max":
        setResponseValueAndErrors(
          res,
          "maximum",
          check2.value,
          // This is in milliseconds
          check2.message,
          refs
        );
        break;
    }
  }
  return res;
};

// node_modules/zod-to-json-schema/dist/esm/parsers/default.js
function parseDefaultDef(_def, refs) {
  return {
    ...parseDef(_def.innerType._def, refs),
    default: _def.defaultValue()
  };
}

// node_modules/zod-to-json-schema/dist/esm/parsers/effects.js
function parseEffectsDef(_def, refs) {
  return refs.effectStrategy === "input" ? parseDef(_def.schema._def, refs) : parseAnyDef(refs);
}

// node_modules/zod-to-json-schema/dist/esm/parsers/enum.js
function parseEnumDef(def) {
  return {
    type: "string",
    enum: Array.from(def.values)
  };
}

// node_modules/zod-to-json-schema/dist/esm/parsers/intersection.js
var isJsonSchema7AllOfType = (type) => {
  if ("type" in type && type.type === "string")
    return false;
  return "allOf" in type;
};
function parseIntersectionDef(def, refs) {
  const allOf = [
    parseDef(def.left._def, {
      ...refs,
      currentPath: [...refs.currentPath, "allOf", "0"]
    }),
    parseDef(def.right._def, {
      ...refs,
      currentPath: [...refs.currentPath, "allOf", "1"]
    })
  ].filter((x) => !!x);
  let unevaluatedProperties = refs.target === "jsonSchema2019-09" ? { unevaluatedProperties: false } : void 0;
  const mergedAllOf = [];
  allOf.forEach((schema) => {
    if (isJsonSchema7AllOfType(schema)) {
      mergedAllOf.push(...schema.allOf);
      if (schema.unevaluatedProperties === void 0) {
        unevaluatedProperties = void 0;
      }
    } else {
      let nestedSchema = schema;
      if ("additionalProperties" in schema && schema.additionalProperties === false) {
        const { additionalProperties, ...rest } = schema;
        nestedSchema = rest;
      } else {
        unevaluatedProperties = void 0;
      }
      mergedAllOf.push(nestedSchema);
    }
  });
  return mergedAllOf.length ? {
    allOf: mergedAllOf,
    ...unevaluatedProperties
  } : void 0;
}

// node_modules/zod-to-json-schema/dist/esm/parsers/literal.js
function parseLiteralDef(def, refs) {
  const parsedType2 = typeof def.value;
  if (parsedType2 !== "bigint" && parsedType2 !== "number" && parsedType2 !== "boolean" && parsedType2 !== "string") {
    return {
      type: Array.isArray(def.value) ? "array" : "object"
    };
  }
  if (refs.target === "openApi3") {
    return {
      type: parsedType2 === "bigint" ? "integer" : parsedType2,
      enum: [def.value]
    };
  }
  return {
    type: parsedType2 === "bigint" ? "integer" : parsedType2,
    const: def.value
  };
}

// node_modules/zod-to-json-schema/dist/esm/parsers/string.js
var emojiRegex2 = void 0;
var zodPatterns = {
  /**
   * `c` was changed to `[cC]` to replicate /i flag
   */
  cuid: /^[cC][^\s-]{8,}$/,
  cuid2: /^[0-9a-z]+$/,
  ulid: /^[0-9A-HJKMNP-TV-Z]{26}$/,
  /**
   * `a-z` was added to replicate /i flag
   */
  email: /^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,
  /**
   * Constructed a valid Unicode RegExp
   *
   * Lazily instantiate since this type of regex isn't supported
   * in all envs (e.g. React Native).
   *
   * See:
   * https://github.com/colinhacks/zod/issues/2433
   * Fix in Zod:
   * https://github.com/colinhacks/zod/commit/9340fd51e48576a75adc919bff65dbc4a5d4c99b
   */
  emoji: () => {
    if (emojiRegex2 === void 0) {
      emojiRegex2 = RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$", "u");
    }
    return emojiRegex2;
  },
  /**
   * Unused
   */
  uuid: /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,
  /**
   * Unused
   */
  ipv4: /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,
  ipv4Cidr: /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,
  /**
   * Unused
   */
  ipv6: /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,
  ipv6Cidr: /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,
  base64: /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,
  base64url: /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,
  nanoid: /^[a-zA-Z0-9_-]{21}$/,
  jwt: /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/
};
function parseStringDef(def, refs) {
  const res = {
    type: "string"
  };
  if (def.checks) {
    for (const check2 of def.checks) {
      switch (check2.kind) {
        case "min":
          setResponseValueAndErrors(res, "minLength", typeof res.minLength === "number" ? Math.max(res.minLength, check2.value) : check2.value, check2.message, refs);
          break;
        case "max":
          setResponseValueAndErrors(res, "maxLength", typeof res.maxLength === "number" ? Math.min(res.maxLength, check2.value) : check2.value, check2.message, refs);
          break;
        case "email":
          switch (refs.emailStrategy) {
            case "format:email":
              addFormat(res, "email", check2.message, refs);
              break;
            case "format:idn-email":
              addFormat(res, "idn-email", check2.message, refs);
              break;
            case "pattern:zod":
              addPattern(res, zodPatterns.email, check2.message, refs);
              break;
          }
          break;
        case "url":
          addFormat(res, "uri", check2.message, refs);
          break;
        case "uuid":
          addFormat(res, "uuid", check2.message, refs);
          break;
        case "regex":
          addPattern(res, check2.regex, check2.message, refs);
          break;
        case "cuid":
          addPattern(res, zodPatterns.cuid, check2.message, refs);
          break;
        case "cuid2":
          addPattern(res, zodPatterns.cuid2, check2.message, refs);
          break;
        case "startsWith":
          addPattern(res, RegExp(`^${escapeLiteralCheckValue(check2.value, refs)}`), check2.message, refs);
          break;
        case "endsWith":
          addPattern(res, RegExp(`${escapeLiteralCheckValue(check2.value, refs)}$`), check2.message, refs);
          break;
        case "datetime":
          addFormat(res, "date-time", check2.message, refs);
          break;
        case "date":
          addFormat(res, "date", check2.message, refs);
          break;
        case "time":
          addFormat(res, "time", check2.message, refs);
          break;
        case "duration":
          addFormat(res, "duration", check2.message, refs);
          break;
        case "length":
          setResponseValueAndErrors(res, "minLength", typeof res.minLength === "number" ? Math.max(res.minLength, check2.value) : check2.value, check2.message, refs);
          setResponseValueAndErrors(res, "maxLength", typeof res.maxLength === "number" ? Math.min(res.maxLength, check2.value) : check2.value, check2.message, refs);
          break;
        case "includes": {
          addPattern(res, RegExp(escapeLiteralCheckValue(check2.value, refs)), check2.message, refs);
          break;
        }
        case "ip": {
          if (check2.version !== "v6") {
            addFormat(res, "ipv4", check2.message, refs);
          }
          if (check2.version !== "v4") {
            addFormat(res, "ipv6", check2.message, refs);
          }
          break;
        }
        case "base64url":
          addPattern(res, zodPatterns.base64url, check2.message, refs);
          break;
        case "jwt":
          addPattern(res, zodPatterns.jwt, check2.message, refs);
          break;
        case "cidr": {
          if (check2.version !== "v6") {
            addPattern(res, zodPatterns.ipv4Cidr, check2.message, refs);
          }
          if (check2.version !== "v4") {
            addPattern(res, zodPatterns.ipv6Cidr, check2.message, refs);
          }
          break;
        }
        case "emoji":
          addPattern(res, zodPatterns.emoji(), check2.message, refs);
          break;
        case "ulid": {
          addPattern(res, zodPatterns.ulid, check2.message, refs);
          break;
        }
        case "base64": {
          switch (refs.base64Strategy) {
            case "format:binary": {
              addFormat(res, "binary", check2.message, refs);
              break;
            }
            case "contentEncoding:base64": {
              setResponseValueAndErrors(res, "contentEncoding", "base64", check2.message, refs);
              break;
            }
            case "pattern:zod": {
              addPattern(res, zodPatterns.base64, check2.message, refs);
              break;
            }
          }
          break;
        }
        case "nanoid": {
          addPattern(res, zodPatterns.nanoid, check2.message, refs);
        }
        case "toLowerCase":
        case "toUpperCase":
        case "trim":
          break;
        default:
          /* @__PURE__ */ ((_) => {
          })(check2);
      }
    }
  }
  return res;
}
function escapeLiteralCheckValue(literal2, refs) {
  return refs.patternStrategy === "escape" ? escapeNonAlphaNumeric(literal2) : literal2;
}
var ALPHA_NUMERIC = new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");
function escapeNonAlphaNumeric(source) {
  let result = "";
  for (let i = 0; i < source.length; i++) {
    if (!ALPHA_NUMERIC.has(source[i])) {
      result += "\\";
    }
    result += source[i];
  }
  return result;
}
function addFormat(schema, value, message, refs) {
  if (schema.format || schema.anyOf?.some((x) => x.format)) {
    if (!schema.anyOf) {
      schema.anyOf = [];
    }
    if (schema.format) {
      schema.anyOf.push({
        format: schema.format,
        ...schema.errorMessage && refs.errorMessages && {
          errorMessage: { format: schema.errorMessage.format }
        }
      });
      delete schema.format;
      if (schema.errorMessage) {
        delete schema.errorMessage.format;
        if (Object.keys(schema.errorMessage).length === 0) {
          delete schema.errorMessage;
        }
      }
    }
    schema.anyOf.push({
      format: value,
      ...message && refs.errorMessages && { errorMessage: { format: message } }
    });
  } else {
    setResponseValueAndErrors(schema, "format", value, message, refs);
  }
}
function addPattern(schema, regex, message, refs) {
  if (schema.pattern || schema.allOf?.some((x) => x.pattern)) {
    if (!schema.allOf) {
      schema.allOf = [];
    }
    if (schema.pattern) {
      schema.allOf.push({
        pattern: schema.pattern,
        ...schema.errorMessage && refs.errorMessages && {
          errorMessage: { pattern: schema.errorMessage.pattern }
        }
      });
      delete schema.pattern;
      if (schema.errorMessage) {
        delete schema.errorMessage.pattern;
        if (Object.keys(schema.errorMessage).length === 0) {
          delete schema.errorMessage;
        }
      }
    }
    schema.allOf.push({
      pattern: stringifyRegExpWithFlags(regex, refs),
      ...message && refs.errorMessages && { errorMessage: { pattern: message } }
    });
  } else {
    setResponseValueAndErrors(schema, "pattern", stringifyRegExpWithFlags(regex, refs), message, refs);
  }
}
function stringifyRegExpWithFlags(regex, refs) {
  if (!refs.applyRegexFlags || !regex.flags) {
    return regex.source;
  }
  const flags = {
    i: regex.flags.includes("i"),
    m: regex.flags.includes("m"),
    s: regex.flags.includes("s")
    // `.` matches newlines
  };
  const source = flags.i ? regex.source.toLowerCase() : regex.source;
  let pattern = "";
  let isEscaped = false;
  let inCharGroup = false;
  let inCharRange = false;
  for (let i = 0; i < source.length; i++) {
    if (isEscaped) {
      pattern += source[i];
      isEscaped = false;
      continue;
    }
    if (flags.i) {
      if (inCharGroup) {
        if (source[i].match(/[a-z]/)) {
          if (inCharRange) {
            pattern += source[i];
            pattern += `${source[i - 2]}-${source[i]}`.toUpperCase();
            inCharRange = false;
          } else if (source[i + 1] === "-" && source[i + 2]?.match(/[a-z]/)) {
            pattern += source[i];
            inCharRange = true;
          } else {
            pattern += `${source[i]}${source[i].toUpperCase()}`;
          }
          continue;
        }
      } else if (source[i].match(/[a-z]/)) {
        pattern += `[${source[i]}${source[i].toUpperCase()}]`;
        continue;
      }
    }
    if (flags.m) {
      if (source[i] === "^") {
        pattern += `(^|(?<=[\r
]))`;
        continue;
      } else if (source[i] === "$") {
        pattern += `($|(?=[\r
]))`;
        continue;
      }
    }
    if (flags.s && source[i] === ".") {
      pattern += inCharGroup ? `${source[i]}\r
` : `[${source[i]}\r
]`;
      continue;
    }
    pattern += source[i];
    if (source[i] === "\\") {
      isEscaped = true;
    } else if (inCharGroup && source[i] === "]") {
      inCharGroup = false;
    } else if (!inCharGroup && source[i] === "[") {
      inCharGroup = true;
    }
  }
  try {
    new RegExp(pattern);
  } catch {
    console.warn(`Could not convert regex pattern at ${refs.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`);
    return regex.source;
  }
  return pattern;
}

// node_modules/zod-to-json-schema/dist/esm/parsers/record.js
function parseRecordDef(def, refs) {
  if (refs.target === "openAi") {
    console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead.");
  }
  if (refs.target === "openApi3" && def.keyType?._def.typeName === ZodFirstPartyTypeKind2.ZodEnum) {
    return {
      type: "object",
      required: def.keyType._def.values,
      properties: def.keyType._def.values.reduce((acc, key) => ({
        ...acc,
        [key]: parseDef(def.valueType._def, {
          ...refs,
          currentPath: [...refs.currentPath, "properties", key]
        }) ?? parseAnyDef(refs)
      }), {}),
      additionalProperties: refs.rejectedAdditionalProperties
    };
  }
  const schema = {
    type: "object",
    additionalProperties: parseDef(def.valueType._def, {
      ...refs,
      currentPath: [...refs.currentPath, "additionalProperties"]
    }) ?? refs.allowedAdditionalProperties
  };
  if (refs.target === "openApi3") {
    return schema;
  }
  if (def.keyType?._def.typeName === ZodFirstPartyTypeKind2.ZodString && def.keyType._def.checks?.length) {
    const { type, ...keyType } = parseStringDef(def.keyType._def, refs);
    return {
      ...schema,
      propertyNames: keyType
    };
  } else if (def.keyType?._def.typeName === ZodFirstPartyTypeKind2.ZodEnum) {
    return {
      ...schema,
      propertyNames: {
        enum: def.keyType._def.values
      }
    };
  } else if (def.keyType?._def.typeName === ZodFirstPartyTypeKind2.ZodBranded && def.keyType._def.type._def.typeName === ZodFirstPartyTypeKind2.ZodString && def.keyType._def.type._def.checks?.length) {
    const { type, ...keyType } = parseBrandedDef(def.keyType._def, refs);
    return {
      ...schema,
      propertyNames: keyType
    };
  }
  return schema;
}

// node_modules/zod-to-json-schema/dist/esm/parsers/map.js
function parseMapDef(def, refs) {
  if (refs.mapStrategy === "record") {
    return parseRecordDef(def, refs);
  }
  const keys = parseDef(def.keyType._def, {
    ...refs,
    currentPath: [...refs.currentPath, "items", "items", "0"]
  }) || parseAnyDef(refs);
  const values = parseDef(def.valueType._def, {
    ...refs,
    currentPath: [...refs.currentPath, "items", "items", "1"]
  }) || parseAnyDef(refs);
  return {
    type: "array",
    maxItems: 125,
    items: {
      type: "array",
      items: [keys, values],
      minItems: 2,
      maxItems: 2
    }
  };
}

// node_modules/zod-to-json-schema/dist/esm/parsers/nativeEnum.js
function parseNativeEnumDef(def) {
  const object3 = def.values;
  const actualKeys = Object.keys(def.values).filter((key) => {
    return typeof object3[object3[key]] !== "number";
  });
  const actualValues = actualKeys.map((key) => object3[key]);
  const parsedTypes = Array.from(new Set(actualValues.map((values) => typeof values)));
  return {
    type: parsedTypes.length === 1 ? parsedTypes[0] === "string" ? "string" : "number" : ["string", "number"],
    enum: actualValues
  };
}

// node_modules/zod-to-json-schema/dist/esm/parsers/never.js
function parseNeverDef(refs) {
  return refs.target === "openAi" ? void 0 : {
    not: parseAnyDef({
      ...refs,
      currentPath: [...refs.currentPath, "not"]
    })
  };
}

// node_modules/zod-to-json-schema/dist/esm/parsers/null.js
function parseNullDef(refs) {
  return refs.target === "openApi3" ? {
    enum: ["null"],
    nullable: true
  } : {
    type: "null"
  };
}

// node_modules/zod-to-json-schema/dist/esm/parsers/union.js
var primitiveMappings = {
  ZodString: "string",
  ZodNumber: "number",
  ZodBigInt: "integer",
  ZodBoolean: "boolean",
  ZodNull: "null"
};
function parseUnionDef(def, refs) {
  if (refs.target === "openApi3")
    return asAnyOf(def, refs);
  const options2 = def.options instanceof Map ? Array.from(def.options.values()) : def.options;
  if (options2.every((x) => x._def.typeName in primitiveMappings && (!x._def.checks || !x._def.checks.length))) {
    const types = options2.reduce((types2, x) => {
      const type = primitiveMappings[x._def.typeName];
      return type && !types2.includes(type) ? [...types2, type] : types2;
    }, []);
    return {
      type: types.length > 1 ? types : types[0]
    };
  } else if (options2.every((x) => x._def.typeName === "ZodLiteral" && !x.description)) {
    const types = options2.reduce((acc, x) => {
      const type = typeof x._def.value;
      switch (type) {
        case "string":
        case "number":
        case "boolean":
          return [...acc, type];
        case "bigint":
          return [...acc, "integer"];
        case "object":
          if (x._def.value === null)
            return [...acc, "null"];
        case "symbol":
        case "undefined":
        case "function":
        default:
          return acc;
      }
    }, []);
    if (types.length === options2.length) {
      const uniqueTypes = types.filter((x, i, a) => a.indexOf(x) === i);
      return {
        type: uniqueTypes.length > 1 ? uniqueTypes : uniqueTypes[0],
        enum: options2.reduce((acc, x) => {
          return acc.includes(x._def.value) ? acc : [...acc, x._def.value];
        }, [])
      };
    }
  } else if (options2.every((x) => x._def.typeName === "ZodEnum")) {
    return {
      type: "string",
      enum: options2.reduce((acc, x) => [
        ...acc,
        ...x._def.values.filter((x2) => !acc.includes(x2))
      ], [])
    };
  }
  return asAnyOf(def, refs);
}
var asAnyOf = (def, refs) => {
  const anyOf = (def.options instanceof Map ? Array.from(def.options.values()) : def.options).map((x, i) => parseDef(x._def, {
    ...refs,
    currentPath: [...refs.currentPath, "anyOf", `${i}`]
  })).filter((x) => !!x && (!refs.strictUnions || typeof x === "object" && Object.keys(x).length > 0));
  return anyOf.length ? { anyOf } : void 0;
};

// node_modules/zod-to-json-schema/dist/esm/parsers/nullable.js
function parseNullableDef(def, refs) {
  if (["ZodString", "ZodNumber", "ZodBigInt", "ZodBoolean", "ZodNull"].includes(def.innerType._def.typeName) && (!def.innerType._def.checks || !def.innerType._def.checks.length)) {
    if (refs.target === "openApi3") {
      return {
        type: primitiveMappings[def.innerType._def.typeName],
        nullable: true
      };
    }
    return {
      type: [
        primitiveMappings[def.innerType._def.typeName],
        "null"
      ]
    };
  }
  if (refs.target === "openApi3") {
    const base2 = parseDef(def.innerType._def, {
      ...refs,
      currentPath: [...refs.currentPath]
    });
    if (base2 && "$ref" in base2)
      return { allOf: [base2], nullable: true };
    return base2 && { ...base2, nullable: true };
  }
  const base = parseDef(def.innerType._def, {
    ...refs,
    currentPath: [...refs.currentPath, "anyOf", "0"]
  });
  return base && { anyOf: [base, { type: "null" }] };
}

// node_modules/zod-to-json-schema/dist/esm/parsers/number.js
function parseNumberDef(def, refs) {
  const res = {
    type: "number"
  };
  if (!def.checks)
    return res;
  for (const check2 of def.checks) {
    switch (check2.kind) {
      case "int":
        res.type = "integer";
        addErrorMessage(res, "type", check2.message, refs);
        break;
      case "min":
        if (refs.target === "jsonSchema7") {
          if (check2.inclusive) {
            setResponseValueAndErrors(res, "minimum", check2.value, check2.message, refs);
          } else {
            setResponseValueAndErrors(res, "exclusiveMinimum", check2.value, check2.message, refs);
          }
        } else {
          if (!check2.inclusive) {
            res.exclusiveMinimum = true;
          }
          setResponseValueAndErrors(res, "minimum", check2.value, check2.message, refs);
        }
        break;
      case "max":
        if (refs.target === "jsonSchema7") {
          if (check2.inclusive) {
            setResponseValueAndErrors(res, "maximum", check2.value, check2.message, refs);
          } else {
            setResponseValueAndErrors(res, "exclusiveMaximum", check2.value, check2.message, refs);
          }
        } else {
          if (!check2.inclusive) {
            res.exclusiveMaximum = true;
          }
          setResponseValueAndErrors(res, "maximum", check2.value, check2.message, refs);
        }
        break;
      case "multipleOf":
        setResponseValueAndErrors(res, "multipleOf", check2.value, check2.message, refs);
        break;
    }
  }
  return res;
}

// node_modules/zod-to-json-schema/dist/esm/parsers/object.js
function parseObjectDef(def, refs) {
  const forceOptionalIntoNullable = refs.target === "openAi";
  const result = {
    type: "object",
    properties: {}
  };
  const required2 = [];
  const shape = def.shape();
  for (const propName in shape) {
    let propDef = shape[propName];
    if (propDef === void 0 || propDef._def === void 0) {
      continue;
    }
    let propOptional = safeIsOptional(propDef);
    if (propOptional && forceOptionalIntoNullable) {
      if (propDef._def.typeName === "ZodOptional") {
        propDef = propDef._def.innerType;
      }
      if (!propDef.isNullable()) {
        propDef = propDef.nullable();
      }
      propOptional = false;
    }
    const parsedDef = parseDef(propDef._def, {
      ...refs,
      currentPath: [...refs.currentPath, "properties", propName],
      propertyPath: [...refs.currentPath, "properties", propName]
    });
    if (parsedDef === void 0) {
      continue;
    }
    result.properties[propName] = parsedDef;
    if (!propOptional) {
      required2.push(propName);
    }
  }
  if (required2.length) {
    result.required = required2;
  }
  const additionalProperties = decideAdditionalProperties(def, refs);
  if (additionalProperties !== void 0) {
    result.additionalProperties = additionalProperties;
  }
  return result;
}
function decideAdditionalProperties(def, refs) {
  if (def.catchall._def.typeName !== "ZodNever") {
    return parseDef(def.catchall._def, {
      ...refs,
      currentPath: [...refs.currentPath, "additionalProperties"]
    });
  }
  switch (def.unknownKeys) {
    case "passthrough":
      return refs.allowedAdditionalProperties;
    case "strict":
      return refs.rejectedAdditionalProperties;
    case "strip":
      return refs.removeAdditionalStrategy === "strict" ? refs.allowedAdditionalProperties : refs.rejectedAdditionalProperties;
  }
}
function safeIsOptional(schema) {
  try {
    return schema.isOptional();
  } catch {
    return true;
  }
}

// node_modules/zod-to-json-schema/dist/esm/parsers/optional.js
var parseOptionalDef = (def, refs) => {
  if (refs.currentPath.toString() === refs.propertyPath?.toString()) {
    return parseDef(def.innerType._def, refs);
  }
  const innerSchema = parseDef(def.innerType._def, {
    ...refs,
    currentPath: [...refs.currentPath, "anyOf", "1"]
  });
  return innerSchema ? {
    anyOf: [
      {
        not: parseAnyDef(refs)
      },
      innerSchema
    ]
  } : parseAnyDef(refs);
};

// node_modules/zod-to-json-schema/dist/esm/parsers/pipeline.js
var parsePipelineDef = (def, refs) => {
  if (refs.pipeStrategy === "input") {
    return parseDef(def.in._def, refs);
  } else if (refs.pipeStrategy === "output") {
    return parseDef(def.out._def, refs);
  }
  const a = parseDef(def.in._def, {
    ...refs,
    currentPath: [...refs.currentPath, "allOf", "0"]
  });
  const b = parseDef(def.out._def, {
    ...refs,
    currentPath: [...refs.currentPath, "allOf", a ? "1" : "0"]
  });
  return {
    allOf: [a, b].filter((x) => x !== void 0)
  };
};

// node_modules/zod-to-json-schema/dist/esm/parsers/promise.js
function parsePromiseDef(def, refs) {
  return parseDef(def.type._def, refs);
}

// node_modules/zod-to-json-schema/dist/esm/parsers/set.js
function parseSetDef(def, refs) {
  const items = parseDef(def.valueType._def, {
    ...refs,
    currentPath: [...refs.currentPath, "items"]
  });
  const schema = {
    type: "array",
    uniqueItems: true,
    items
  };
  if (def.minSize) {
    setResponseValueAndErrors(schema, "minItems", def.minSize.value, def.minSize.message, refs);
  }
  if (def.maxSize) {
    setResponseValueAndErrors(schema, "maxItems", def.maxSize.value, def.maxSize.message, refs);
  }
  return schema;
}

// node_modules/zod-to-json-schema/dist/esm/parsers/tuple.js
function parseTupleDef(def, refs) {
  if (def.rest) {
    return {
      type: "array",
      minItems: def.items.length,
      items: def.items.map((x, i) => parseDef(x._def, {
        ...refs,
        currentPath: [...refs.currentPath, "items", `${i}`]
      })).reduce((acc, x) => x === void 0 ? acc : [...acc, x], []),
      additionalItems: parseDef(def.rest._def, {
        ...refs,
        currentPath: [...refs.currentPath, "additionalItems"]
      })
    };
  } else {
    return {
      type: "array",
      minItems: def.items.length,
      maxItems: def.items.length,
      items: def.items.map((x, i) => parseDef(x._def, {
        ...refs,
        currentPath: [...refs.currentPath, "items", `${i}`]
      })).reduce((acc, x) => x === void 0 ? acc : [...acc, x], [])
    };
  }
}

// node_modules/zod-to-json-schema/dist/esm/parsers/undefined.js
function parseUndefinedDef(refs) {
  return {
    not: parseAnyDef(refs)
  };
}

// node_modules/zod-to-json-schema/dist/esm/parsers/unknown.js
function parseUnknownDef(refs) {
  return parseAnyDef(refs);
}

// node_modules/zod-to-json-schema/dist/esm/parsers/readonly.js
var parseReadonlyDef = (def, refs) => {
  return parseDef(def.innerType._def, refs);
};

// node_modules/zod-to-json-schema/dist/esm/selectParser.js
var selectParser = (def, typeName, refs) => {
  switch (typeName) {
    case ZodFirstPartyTypeKind2.ZodString:
      return parseStringDef(def, refs);
    case ZodFirstPartyTypeKind2.ZodNumber:
      return parseNumberDef(def, refs);
    case ZodFirstPartyTypeKind2.ZodObject:
      return parseObjectDef(def, refs);
    case ZodFirstPartyTypeKind2.ZodBigInt:
      return parseBigintDef(def, refs);
    case ZodFirstPartyTypeKind2.ZodBoolean:
      return parseBooleanDef();
    case ZodFirstPartyTypeKind2.ZodDate:
      return parseDateDef(def, refs);
    case ZodFirstPartyTypeKind2.ZodUndefined:
      return parseUndefinedDef(refs);
    case ZodFirstPartyTypeKind2.ZodNull:
      return parseNullDef(refs);
    case ZodFirstPartyTypeKind2.ZodArray:
      return parseArrayDef(def, refs);
    case ZodFirstPartyTypeKind2.ZodUnion:
    case ZodFirstPartyTypeKind2.ZodDiscriminatedUnion:
      return parseUnionDef(def, refs);
    case ZodFirstPartyTypeKind2.ZodIntersection:
      return parseIntersectionDef(def, refs);
    case ZodFirstPartyTypeKind2.ZodTuple:
      return parseTupleDef(def, refs);
    case ZodFirstPartyTypeKind2.ZodRecord:
      return parseRecordDef(def, refs);
    case ZodFirstPartyTypeKind2.ZodLiteral:
      return parseLiteralDef(def, refs);
    case ZodFirstPartyTypeKind2.ZodEnum:
      return parseEnumDef(def);
    case ZodFirstPartyTypeKind2.ZodNativeEnum:
      return parseNativeEnumDef(def);
    case ZodFirstPartyTypeKind2.ZodNullable:
      return parseNullableDef(def, refs);
    case ZodFirstPartyTypeKind2.ZodOptional:
      return parseOptionalDef(def, refs);
    case ZodFirstPartyTypeKind2.ZodMap:
      return parseMapDef(def, refs);
    case ZodFirstPartyTypeKind2.ZodSet:
      return parseSetDef(def, refs);
    case ZodFirstPartyTypeKind2.ZodLazy:
      return () => def.getter()._def;
    case ZodFirstPartyTypeKind2.ZodPromise:
      return parsePromiseDef(def, refs);
    case ZodFirstPartyTypeKind2.ZodNaN:
    case ZodFirstPartyTypeKind2.ZodNever:
      return parseNeverDef(refs);
    case ZodFirstPartyTypeKind2.ZodEffects:
      return parseEffectsDef(def, refs);
    case ZodFirstPartyTypeKind2.ZodAny:
      return parseAnyDef(refs);
    case ZodFirstPartyTypeKind2.ZodUnknown:
      return parseUnknownDef(refs);
    case ZodFirstPartyTypeKind2.ZodDefault:
      return parseDefaultDef(def, refs);
    case ZodFirstPartyTypeKind2.ZodBranded:
      return parseBrandedDef(def, refs);
    case ZodFirstPartyTypeKind2.ZodReadonly:
      return parseReadonlyDef(def, refs);
    case ZodFirstPartyTypeKind2.ZodCatch:
      return parseCatchDef(def, refs);
    case ZodFirstPartyTypeKind2.ZodPipeline:
      return parsePipelineDef(def, refs);
    case ZodFirstPartyTypeKind2.ZodFunction:
    case ZodFirstPartyTypeKind2.ZodVoid:
    case ZodFirstPartyTypeKind2.ZodSymbol:
      return void 0;
    default:
      return /* @__PURE__ */ ((_) => void 0)(typeName);
  }
};

// node_modules/zod-to-json-schema/dist/esm/parseDef.js
function parseDef(def, refs, forceResolution = false) {
  const seenItem = refs.seen.get(def);
  if (refs.override) {
    const overrideResult = refs.override?.(def, refs, seenItem, forceResolution);
    if (overrideResult !== ignoreOverride) {
      return overrideResult;
    }
  }
  if (seenItem && !forceResolution) {
    const seenSchema = get$ref(seenItem, refs);
    if (seenSchema !== void 0) {
      return seenSchema;
    }
  }
  const newItem = { def, path: refs.currentPath, jsonSchema: void 0 };
  refs.seen.set(def, newItem);
  const jsonSchemaOrGetter = selectParser(def, def.typeName, refs);
  const jsonSchema = typeof jsonSchemaOrGetter === "function" ? parseDef(jsonSchemaOrGetter(), refs) : jsonSchemaOrGetter;
  if (jsonSchema) {
    addMeta(def, refs, jsonSchema);
  }
  if (refs.postProcess) {
    const postProcessResult = refs.postProcess(jsonSchema, def, refs);
    newItem.jsonSchema = jsonSchema;
    return postProcessResult;
  }
  newItem.jsonSchema = jsonSchema;
  return jsonSchema;
}
var get$ref = (item, refs) => {
  switch (refs.$refStrategy) {
    case "root":
      return { $ref: item.path.join("/") };
    case "relative":
      return { $ref: getRelativePath(refs.currentPath, item.path) };
    case "none":
    case "seen": {
      if (item.path.length < refs.currentPath.length && item.path.every((value, index) => refs.currentPath[index] === value)) {
        console.warn(`Recursive reference detected at ${refs.currentPath.join("/")}! Defaulting to any`);
        return parseAnyDef(refs);
      }
      return refs.$refStrategy === "seen" ? parseAnyDef(refs) : void 0;
    }
  }
};
var addMeta = (def, refs, jsonSchema) => {
  if (def.description) {
    jsonSchema.description = def.description;
    if (refs.markdownDescription) {
      jsonSchema.markdownDescription = def.description;
    }
  }
  return jsonSchema;
};

// node_modules/zod-to-json-schema/dist/esm/zodToJsonSchema.js
var zodToJsonSchema = (schema, options2) => {
  const refs = getRefs(options2);
  let definitions = typeof options2 === "object" && options2.definitions ? Object.entries(options2.definitions).reduce((acc, [name2, schema2]) => ({
    ...acc,
    [name2]: parseDef(schema2._def, {
      ...refs,
      currentPath: [...refs.basePath, refs.definitionPath, name2]
    }, true) ?? parseAnyDef(refs)
  }), {}) : void 0;
  const name = typeof options2 === "string" ? options2 : options2?.nameStrategy === "title" ? void 0 : options2?.name;
  const main = parseDef(schema._def, name === void 0 ? refs : {
    ...refs,
    currentPath: [...refs.basePath, refs.definitionPath, name]
  }, false) ?? parseAnyDef(refs);
  const title = typeof options2 === "object" && options2.name !== void 0 && options2.nameStrategy === "title" ? options2.name : void 0;
  if (title !== void 0) {
    main.title = title;
  }
  if (refs.flags.hasReferencedOpenAiAnyType) {
    if (!definitions) {
      definitions = {};
    }
    if (!definitions[refs.openAiAnyTypeName]) {
      definitions[refs.openAiAnyTypeName] = {
        // Skipping "object" as no properties can be defined and additionalProperties must be "false"
        type: ["string", "number", "integer", "boolean", "array", "null"],
        items: {
          $ref: refs.$refStrategy === "relative" ? "1" : [
            ...refs.basePath,
            refs.definitionPath,
            refs.openAiAnyTypeName
          ].join("/")
        }
      };
    }
  }
  const combined = name === void 0 ? definitions ? {
    ...main,
    [refs.definitionPath]: definitions
  } : main : {
    $ref: [
      ...refs.$refStrategy === "relative" ? [] : refs.basePath,
      refs.definitionPath,
      name
    ].join("/"),
    [refs.definitionPath]: {
      ...definitions,
      [name]: main
    }
  };
  if (refs.target === "jsonSchema7") {
    combined.$schema = "http://json-schema.org/draft-07/schema#";
  } else if (refs.target === "jsonSchema2019-09" || refs.target === "openAi") {
    combined.$schema = "https://json-schema.org/draft/2019-09/schema#";
  }
  if (refs.target === "openAi" && ("anyOf" in combined || "oneOf" in combined || "allOf" in combined || "type" in combined && Array.isArray(combined.type))) {
    console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property.");
  }
  return combined;
};

// node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-json-schema-compat.js
function getMethodLiteral(schema) {
  const shape = getObjectShape(schema);
  const methodSchema = shape?.method;
  if (!methodSchema) {
    throw new Error("Schema is missing a method literal");
  }
  const value = getLiteralValue(methodSchema);
  if (typeof value !== "string") {
    throw new Error("Schema method literal must be a string");
  }
  return value;
}
function parseWithCompat(schema, data) {
  const result = safeParse3(schema, data);
  if (!result.success) {
    throw result.error;
  }
  return result.data;
}

// node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js
var DEFAULT_REQUEST_TIMEOUT_MSEC = 6e4;
var Protocol = class {
  constructor(_options) {
    this._options = _options;
    this._requestMessageId = 0;
    this._requestHandlers = /* @__PURE__ */ new Map();
    this._requestHandlerAbortControllers = /* @__PURE__ */ new Map();
    this._notificationHandlers = /* @__PURE__ */ new Map();
    this._responseHandlers = /* @__PURE__ */ new Map();
    this._progressHandlers = /* @__PURE__ */ new Map();
    this._timeoutInfo = /* @__PURE__ */ new Map();
    this._pendingDebouncedNotifications = /* @__PURE__ */ new Set();
    this._taskProgressTokens = /* @__PURE__ */ new Map();
    this._requestResolvers = /* @__PURE__ */ new Map();
    this.setNotificationHandler(CancelledNotificationSchema, (notification) => {
      this._oncancel(notification);
    });
    this.setNotificationHandler(ProgressNotificationSchema, (notification) => {
      this._onprogress(notification);
    });
    this.setRequestHandler(
      PingRequestSchema,
      // Automatic pong by default.
      (_request) => ({})
    );
    this._taskStore = _options?.taskStore;
    this._taskMessageQueue = _options?.taskMessageQueue;
    if (this._taskStore) {
      this.setRequestHandler(GetTaskRequestSchema, async (request, extra) => {
        const task = await this._taskStore.getTask(request.params.taskId, extra.sessionId);
        if (!task) {
          throw new McpError(ErrorCode.InvalidParams, "Failed to retrieve task: Task not found");
        }
        return {
          ...task
        };
      });
      this.setRequestHandler(GetTaskPayloadRequestSchema, async (request, extra) => {
        const handleTaskResult = async () => {
          const taskId = request.params.taskId;
          if (this._taskMessageQueue) {
            let queuedMessage;
            while (queuedMessage = await this._taskMessageQueue.dequeue(taskId, extra.sessionId)) {
              if (queuedMessage.type === "response" || queuedMessage.type === "error") {
                const message = queuedMessage.message;
                const requestId = message.id;
                const resolver = this._requestResolvers.get(requestId);
                if (resolver) {
                  this._requestResolvers.delete(requestId);
                  if (queuedMessage.type === "response") {
                    resolver(message);
                  } else {
                    const errorMessage = message;
                    const error48 = new McpError(errorMessage.error.code, errorMessage.error.message, errorMessage.error.data);
                    resolver(error48);
                  }
                } else {
                  const messageType = queuedMessage.type === "response" ? "Response" : "Error";
                  this._onerror(new Error(`${messageType} handler missing for request ${requestId}`));
                }
                continue;
              }
              await this._transport?.send(queuedMessage.message, { relatedRequestId: extra.requestId });
            }
          }
          const task = await this._taskStore.getTask(taskId, extra.sessionId);
          if (!task) {
            throw new McpError(ErrorCode.InvalidParams, `Task not found: ${taskId}`);
          }
          if (!isTerminal(task.status)) {
            await this._waitForTaskUpdate(taskId, extra.signal);
            return await handleTaskResult();
          }
          if (isTerminal(task.status)) {
            const result = await this._taskStore.getTaskResult(taskId, extra.sessionId);
            this._clearTaskQueue(taskId);
            return {
              ...result,
              _meta: {
                ...result._meta,
                [RELATED_TASK_META_KEY]: {
                  taskId
                }
              }
            };
          }
          return await handleTaskResult();
        };
        return await handleTaskResult();
      });
      this.setRequestHandler(ListTasksRequestSchema, async (request, extra) => {
        try {
          const { tasks, nextCursor } = await this._taskStore.listTasks(request.params?.cursor, extra.sessionId);
          return {
            tasks,
            nextCursor,
            _meta: {}
          };
        } catch (error48) {
          throw new McpError(ErrorCode.InvalidParams, `Failed to list tasks: ${error48 instanceof Error ? error48.message : String(error48)}`);
        }
      });
      this.setRequestHandler(CancelTaskRequestSchema, async (request, extra) => {
        try {
          const task = await this._taskStore.getTask(request.params.taskId, extra.sessionId);
          if (!task) {
            throw new McpError(ErrorCode.InvalidParams, `Task not found: ${request.params.taskId}`);
          }
          if (isTerminal(task.status)) {
            throw new McpError(ErrorCode.InvalidParams, `Cannot cancel task in terminal status: ${task.status}`);
          }
          await this._taskStore.updateTaskStatus(request.params.taskId, "cancelled", "Client cancelled task execution.", extra.sessionId);
          this._clearTaskQueue(request.params.taskId);
          const cancelledTask = await this._taskStore.getTask(request.params.taskId, extra.sessionId);
          if (!cancelledTask) {
            throw new McpError(ErrorCode.InvalidParams, `Task not found after cancellation: ${request.params.taskId}`);
          }
          return {
            _meta: {},
            ...cancelledTask
          };
        } catch (error48) {
          if (error48 instanceof McpError) {
            throw error48;
          }
          throw new McpError(ErrorCode.InvalidRequest, `Failed to cancel task: ${error48 instanceof Error ? error48.message : String(error48)}`);
        }
      });
    }
  }
  async _oncancel(notification) {
    if (!notification.params.requestId) {
      return;
    }
    const controller = this._requestHandlerAbortControllers.get(notification.params.requestId);
    controller?.abort(notification.params.reason);
  }
  _setupTimeout(messageId, timeout, maxTotalTimeout, onTimeout, resetTimeoutOnProgress = false) {
    this._timeoutInfo.set(messageId, {
      timeoutId: setTimeout(onTimeout, timeout),
      startTime: Date.now(),
      timeout,
      maxTotalTimeout,
      resetTimeoutOnProgress,
      onTimeout
    });
  }
  _resetTimeout(messageId) {
    const info = this._timeoutInfo.get(messageId);
    if (!info)
      return false;
    const totalElapsed = Date.now() - info.startTime;
    if (info.maxTotalTimeout && totalElapsed >= info.maxTotalTimeout) {
      this._timeoutInfo.delete(messageId);
      throw McpError.fromError(ErrorCode.RequestTimeout, "Maximum total timeout exceeded", {
        maxTotalTimeout: info.maxTotalTimeout,
        totalElapsed
      });
    }
    clearTimeout(info.timeoutId);
    info.timeoutId = setTimeout(info.onTimeout, info.timeout);
    return true;
  }
  _cleanupTimeout(messageId) {
    const info = this._timeoutInfo.get(messageId);
    if (info) {
      clearTimeout(info.timeoutId);
      this._timeoutInfo.delete(messageId);
    }
  }
  /**
   * Attaches to the given transport, starts it, and starts listening for messages.
   *
   * The Protocol object assumes ownership of the Transport, replacing any callbacks that have already been set, and expects that it is the only user of the Transport instance going forward.
   */
  async connect(transport) {
    if (this._transport) {
      throw new Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");
    }
    this._transport = transport;
    const _onclose = this.transport?.onclose;
    this._transport.onclose = () => {
      _onclose?.();
      this._onclose();
    };
    const _onerror = this.transport?.onerror;
    this._transport.onerror = (error48) => {
      _onerror?.(error48);
      this._onerror(error48);
    };
    const _onmessage = this._transport?.onmessage;
    this._transport.onmessage = (message, extra) => {
      _onmessage?.(message, extra);
      if (isJSONRPCResultResponse(message) || isJSONRPCErrorResponse(message)) {
        this._onresponse(message);
      } else if (isJSONRPCRequest(message)) {
        this._onrequest(message, extra);
      } else if (isJSONRPCNotification(message)) {
        this._onnotification(message);
      } else {
        this._onerror(new Error(`Unknown message type: ${JSON.stringify(message)}`));
      }
    };
    await this._transport.start();
  }
  _onclose() {
    const responseHandlers = this._responseHandlers;
    this._responseHandlers = /* @__PURE__ */ new Map();
    this._progressHandlers.clear();
    this._taskProgressTokens.clear();
    this._pendingDebouncedNotifications.clear();
    for (const info of this._timeoutInfo.values()) {
      clearTimeout(info.timeoutId);
    }
    this._timeoutInfo.clear();
    for (const controller of this._requestHandlerAbortControllers.values()) {
      controller.abort();
    }
    this._requestHandlerAbortControllers.clear();
    const error48 = McpError.fromError(ErrorCode.ConnectionClosed, "Connection closed");
    this._transport = void 0;
    this.onclose?.();
    for (const handler of responseHandlers.values()) {
      handler(error48);
    }
  }
  _onerror(error48) {
    this.onerror?.(error48);
  }
  _onnotification(notification) {
    const handler = this._notificationHandlers.get(notification.method) ?? this.fallbackNotificationHandler;
    if (handler === void 0) {
      return;
    }
    Promise.resolve().then(() => handler(notification)).catch((error48) => this._onerror(new Error(`Uncaught error in notification handler: ${error48}`)));
  }
  _onrequest(request, extra) {
    const handler = this._requestHandlers.get(request.method) ?? this.fallbackRequestHandler;
    const capturedTransport = this._transport;
    const relatedTaskId = request.params?._meta?.[RELATED_TASK_META_KEY]?.taskId;
    if (handler === void 0) {
      const errorResponse = {
        jsonrpc: "2.0",
        id: request.id,
        error: {
          code: ErrorCode.MethodNotFound,
          message: "Method not found"
        }
      };
      if (relatedTaskId && this._taskMessageQueue) {
        this._enqueueTaskMessage(relatedTaskId, {
          type: "error",
          message: errorResponse,
          timestamp: Date.now()
        }, capturedTransport?.sessionId).catch((error48) => this._onerror(new Error(`Failed to enqueue error response: ${error48}`)));
      } else {
        capturedTransport?.send(errorResponse).catch((error48) => this._onerror(new Error(`Failed to send an error response: ${error48}`)));
      }
      return;
    }
    const abortController = new AbortController();
    this._requestHandlerAbortControllers.set(request.id, abortController);
    const taskCreationParams = isTaskAugmentedRequestParams(request.params) ? request.params.task : void 0;
    const taskStore = this._taskStore ? this.requestTaskStore(request, capturedTransport?.sessionId) : void 0;
    const fullExtra = {
      signal: abortController.signal,
      sessionId: capturedTransport?.sessionId,
      _meta: request.params?._meta,
      sendNotification: async (notification) => {
        if (abortController.signal.aborted)
          return;
        const notificationOptions = { relatedRequestId: request.id };
        if (relatedTaskId) {
          notificationOptions.relatedTask = { taskId: relatedTaskId };
        }
        await this.notification(notification, notificationOptions);
      },
      sendRequest: async (r, resultSchema, options2) => {
        if (abortController.signal.aborted) {
          throw new McpError(ErrorCode.ConnectionClosed, "Request was cancelled");
        }
        const requestOptions = { ...options2, relatedRequestId: request.id };
        if (relatedTaskId && !requestOptions.relatedTask) {
          requestOptions.relatedTask = { taskId: relatedTaskId };
        }
        const effectiveTaskId = requestOptions.relatedTask?.taskId ?? relatedTaskId;
        if (effectiveTaskId && taskStore) {
          await taskStore.updateTaskStatus(effectiveTaskId, "input_required");
        }
        return await this.request(r, resultSchema, requestOptions);
      },
      authInfo: extra?.authInfo,
      requestId: request.id,
      requestInfo: extra?.requestInfo,
      taskId: relatedTaskId,
      taskStore,
      taskRequestedTtl: taskCreationParams?.ttl,
      closeSSEStream: extra?.closeSSEStream,
      closeStandaloneSSEStream: extra?.closeStandaloneSSEStream
    };
    Promise.resolve().then(() => {
      if (taskCreationParams) {
        this.assertTaskHandlerCapability(request.method);
      }
    }).then(() => handler(request, fullExtra)).then(async (result) => {
      if (abortController.signal.aborted) {
        return;
      }
      const response = {
        result,
        jsonrpc: "2.0",
        id: request.id
      };
      if (relatedTaskId && this._taskMessageQueue) {
        await this._enqueueTaskMessage(relatedTaskId, {
          type: "response",
          message: response,
          timestamp: Date.now()
        }, capturedTransport?.sessionId);
      } else {
        await capturedTransport?.send(response);
      }
    }, async (error48) => {
      if (abortController.signal.aborted) {
        return;
      }
      const errorResponse = {
        jsonrpc: "2.0",
        id: request.id,
        error: {
          code: Number.isSafeInteger(error48["code"]) ? error48["code"] : ErrorCode.InternalError,
          message: error48.message ?? "Internal error",
          ...error48["data"] !== void 0 && { data: error48["data"] }
        }
      };
      if (relatedTaskId && this._taskMessageQueue) {
        await this._enqueueTaskMessage(relatedTaskId, {
          type: "error",
          message: errorResponse,
          timestamp: Date.now()
        }, capturedTransport?.sessionId);
      } else {
        await capturedTransport?.send(errorResponse);
      }
    }).catch((error48) => this._onerror(new Error(`Failed to send response: ${error48}`))).finally(() => {
      if (this._requestHandlerAbortControllers.get(request.id) === abortController) {
        this._requestHandlerAbortControllers.delete(request.id);
      }
    });
  }
  _onprogress(notification) {
    const { progressToken, ...params } = notification.params;
    const messageId = Number(progressToken);
    const handler = this._progressHandlers.get(messageId);
    if (!handler) {
      this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(notification)}`));
      return;
    }
    const responseHandler = this._responseHandlers.get(messageId);
    const timeoutInfo = this._timeoutInfo.get(messageId);
    if (timeoutInfo && responseHandler && timeoutInfo.resetTimeoutOnProgress) {
      try {
        this._resetTimeout(messageId);
      } catch (error48) {
        this._responseHandlers.delete(messageId);
        this._progressHandlers.delete(messageId);
        this._cleanupTimeout(messageId);
        responseHandler(error48);
        return;
      }
    }
    handler(params);
  }
  _onresponse(response) {
    const messageId = Number(response.id);
    const resolver = this._requestResolvers.get(messageId);
    if (resolver) {
      this._requestResolvers.delete(messageId);
      if (isJSONRPCResultResponse(response)) {
        resolver(response);
      } else {
        const error48 = new McpError(response.error.code, response.error.message, response.error.data);
        resolver(error48);
      }
      return;
    }
    const handler = this._responseHandlers.get(messageId);
    if (handler === void 0) {
      this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(response)}`));
      return;
    }
    this._responseHandlers.delete(messageId);
    this._cleanupTimeout(messageId);
    let isTaskResponse = false;
    if (isJSONRPCResultResponse(response) && response.result && typeof response.result === "object") {
      const result = response.result;
      if (result.task && typeof result.task === "object") {
        const task = result.task;
        if (typeof task.taskId === "string") {
          isTaskResponse = true;
          this._taskProgressTokens.set(task.taskId, messageId);
        }
      }
    }
    if (!isTaskResponse) {
      this._progressHandlers.delete(messageId);
    }
    if (isJSONRPCResultResponse(response)) {
      handler(response);
    } else {
      const error48 = McpError.fromError(response.error.code, response.error.message, response.error.data);
      handler(error48);
    }
  }
  get transport() {
    return this._transport;
  }
  /**
   * Closes the connection.
   */
  async close() {
    await this._transport?.close();
  }
  /**
   * Sends a request and returns an AsyncGenerator that yields response messages.
   * The generator is guaranteed to end with either a 'result' or 'error' message.
   *
   * @example
   * ```typescript
   * const stream = protocol.requestStream(request, resultSchema, options);
   * for await (const message of stream) {
   *   switch (message.type) {
   *     case 'taskCreated':
   *       console.log('Task created:', message.task.taskId);
   *       break;
   *     case 'taskStatus':
   *       console.log('Task status:', message.task.status);
   *       break;
   *     case 'result':
   *       console.log('Final result:', message.result);
   *       break;
   *     case 'error':
   *       console.error('Error:', message.error);
   *       break;
   *   }
   * }
   * ```
   *
   * @experimental Use `client.experimental.tasks.requestStream()` to access this method.
   */
  async *requestStream(request, resultSchema, options2) {
    const { task } = options2 ?? {};
    if (!task) {
      try {
        const result = await this.request(request, resultSchema, options2);
        yield { type: "result", result };
      } catch (error48) {
        yield {
          type: "error",
          error: error48 instanceof McpError ? error48 : new McpError(ErrorCode.InternalError, String(error48))
        };
      }
      return;
    }
    let taskId;
    try {
      const createResult = await this.request(request, CreateTaskResultSchema, options2);
      if (createResult.task) {
        taskId = createResult.task.taskId;
        yield { type: "taskCreated", task: createResult.task };
      } else {
        throw new McpError(ErrorCode.InternalError, "Task creation did not return a task");
      }
      while (true) {
        const task2 = await this.getTask({ taskId }, options2);
        yield { type: "taskStatus", task: task2 };
        if (isTerminal(task2.status)) {
          if (task2.status === "completed") {
            const result = await this.getTaskResult({ taskId }, resultSchema, options2);
            yield { type: "result", result };
          } else if (task2.status === "failed") {
            yield {
              type: "error",
              error: new McpError(ErrorCode.InternalError, `Task ${taskId} failed`)
            };
          } else if (task2.status === "cancelled") {
            yield {
              type: "error",
              error: new McpError(ErrorCode.InternalError, `Task ${taskId} was cancelled`)
            };
          }
          return;
        }
        if (task2.status === "input_required") {
          const result = await this.getTaskResult({ taskId }, resultSchema, options2);
          yield { type: "result", result };
          return;
        }
        const pollInterval = task2.pollInterval ?? this._options?.defaultTaskPollInterval ?? 1e3;
        await new Promise((resolve) => setTimeout(resolve, pollInterval));
        options2?.signal?.throwIfAborted();
      }
    } catch (error48) {
      yield {
        type: "error",
        error: error48 instanceof McpError ? error48 : new McpError(ErrorCode.InternalError, String(error48))
      };
    }
  }
  /**
   * Sends a request and waits for a response.
   *
   * Do not use this method to emit notifications! Use notification() instead.
   */
  request(request, resultSchema, options2) {
    const { relatedRequestId, resumptionToken, onresumptiontoken, task, relatedTask } = options2 ?? {};
    return new Promise((resolve, reject) => {
      const earlyReject = (error48) => {
        reject(error48);
      };
      if (!this._transport) {
        earlyReject(new Error("Not connected"));
        return;
      }
      if (this._options?.enforceStrictCapabilities === true) {
        try {
          this.assertCapabilityForMethod(request.method);
          if (task) {
            this.assertTaskCapability(request.method);
          }
        } catch (e) {
          earlyReject(e);
          return;
        }
      }
      options2?.signal?.throwIfAborted();
      const messageId = this._requestMessageId++;
      const jsonrpcRequest = {
        ...request,
        jsonrpc: "2.0",
        id: messageId
      };
      if (options2?.onprogress) {
        this._progressHandlers.set(messageId, options2.onprogress);
        jsonrpcRequest.params = {
          ...request.params,
          _meta: {
            ...request.params?._meta || {},
            progressToken: messageId
          }
        };
      }
      if (task) {
        jsonrpcRequest.params = {
          ...jsonrpcRequest.params,
          task
        };
      }
      if (relatedTask) {
        jsonrpcRequest.params = {
          ...jsonrpcRequest.params,
          _meta: {
            ...jsonrpcRequest.params?._meta || {},
            [RELATED_TASK_META_KEY]: relatedTask
          }
        };
      }
      const cancel = (reason) => {
        this._responseHandlers.delete(messageId);
        this._progressHandlers.delete(messageId);
        this._cleanupTimeout(messageId);
        this._transport?.send({
          jsonrpc: "2.0",
          method: "notifications/cancelled",
          params: {
            requestId: messageId,
            reason: String(reason)
          }
        }, { relatedRequestId, resumptionToken, onresumptiontoken }).catch((error49) => this._onerror(new Error(`Failed to send cancellation: ${error49}`)));
        const error48 = reason instanceof McpError ? reason : new McpError(ErrorCode.RequestTimeout, String(reason));
        reject(error48);
      };
      this._responseHandlers.set(messageId, (response) => {
        if (options2?.signal?.aborted) {
          return;
        }
        if (response instanceof Error) {
          return reject(response);
        }
        try {
          const parseResult = safeParse3(resultSchema, response.result);
          if (!parseResult.success) {
            reject(parseResult.error);
          } else {
            resolve(parseResult.data);
          }
        } catch (error48) {
          reject(error48);
        }
      });
      options2?.signal?.addEventListener("abort", () => {
        cancel(options2?.signal?.reason);
      });
      const timeout = options2?.timeout ?? DEFAULT_REQUEST_TIMEOUT_MSEC;
      const timeoutHandler = () => cancel(McpError.fromError(ErrorCode.RequestTimeout, "Request timed out", { timeout }));
      this._setupTimeout(messageId, timeout, options2?.maxTotalTimeout, timeoutHandler, options2?.resetTimeoutOnProgress ?? false);
      const relatedTaskId = relatedTask?.taskId;
      if (relatedTaskId) {
        const responseResolver = (response) => {
          const handler = this._responseHandlers.get(messageId);
          if (handler) {
            handler(response);
          } else {
            this._onerror(new Error(`Response handler missing for side-channeled request ${messageId}`));
          }
        };
        this._requestResolvers.set(messageId, responseResolver);
        this._enqueueTaskMessage(relatedTaskId, {
          type: "request",
          message: jsonrpcRequest,
          timestamp: Date.now()
        }).catch((error48) => {
          this._cleanupTimeout(messageId);
          reject(error48);
        });
      } else {
        this._transport.send(jsonrpcRequest, { relatedRequestId, resumptionToken, onresumptiontoken }).catch((error48) => {
          this._cleanupTimeout(messageId);
          reject(error48);
        });
      }
    });
  }
  /**
   * Gets the current status of a task.
   *
   * @experimental Use `client.experimental.tasks.getTask()` to access this method.
   */
  async getTask(params, options2) {
    return this.request({ method: "tasks/get", params }, GetTaskResultSchema, options2);
  }
  /**
   * Retrieves the result of a completed task.
   *
   * @experimental Use `client.experimental.tasks.getTaskResult()` to access this method.
   */
  async getTaskResult(params, resultSchema, options2) {
    return this.request({ method: "tasks/result", params }, resultSchema, options2);
  }
  /**
   * Lists tasks, optionally starting from a pagination cursor.
   *
   * @experimental Use `client.experimental.tasks.listTasks()` to access this method.
   */
  async listTasks(params, options2) {
    return this.request({ method: "tasks/list", params }, ListTasksResultSchema, options2);
  }
  /**
   * Cancels a specific task.
   *
   * @experimental Use `client.experimental.tasks.cancelTask()` to access this method.
   */
  async cancelTask(params, options2) {
    return this.request({ method: "tasks/cancel", params }, CancelTaskResultSchema, options2);
  }
  /**
   * Emits a notification, which is a one-way message that does not expect a response.
   */
  async notification(notification, options2) {
    if (!this._transport) {
      throw new Error("Not connected");
    }
    this.assertNotificationCapability(notification.method);
    const relatedTaskId = options2?.relatedTask?.taskId;
    if (relatedTaskId) {
      const jsonrpcNotification2 = {
        ...notification,
        jsonrpc: "2.0",
        params: {
          ...notification.params,
          _meta: {
            ...notification.params?._meta || {},
            [RELATED_TASK_META_KEY]: options2.relatedTask
          }
        }
      };
      await this._enqueueTaskMessage(relatedTaskId, {
        type: "notification",
        message: jsonrpcNotification2,
        timestamp: Date.now()
      });
      return;
    }
    const debouncedMethods = this._options?.debouncedNotificationMethods ?? [];
    const canDebounce = debouncedMethods.includes(notification.method) && !notification.params && !options2?.relatedRequestId && !options2?.relatedTask;
    if (canDebounce) {
      if (this._pendingDebouncedNotifications.has(notification.method)) {
        return;
      }
      this._pendingDebouncedNotifications.add(notification.method);
      Promise.resolve().then(() => {
        this._pendingDebouncedNotifications.delete(notification.method);
        if (!this._transport) {
          return;
        }
        let jsonrpcNotification2 = {
          ...notification,
          jsonrpc: "2.0"
        };
        if (options2?.relatedTask) {
          jsonrpcNotification2 = {
            ...jsonrpcNotification2,
            params: {
              ...jsonrpcNotification2.params,
              _meta: {
                ...jsonrpcNotification2.params?._meta || {},
                [RELATED_TASK_META_KEY]: options2.relatedTask
              }
            }
          };
        }
        this._transport?.send(jsonrpcNotification2, options2).catch((error48) => this._onerror(error48));
      });
      return;
    }
    let jsonrpcNotification = {
      ...notification,
      jsonrpc: "2.0"
    };
    if (options2?.relatedTask) {
      jsonrpcNotification = {
        ...jsonrpcNotification,
        params: {
          ...jsonrpcNotification.params,
          _meta: {
            ...jsonrpcNotification.params?._meta || {},
            [RELATED_TASK_META_KEY]: options2.relatedTask
          }
        }
      };
    }
    await this._transport.send(jsonrpcNotification, options2);
  }
  /**
   * Registers a handler to invoke when this protocol object receives a request with the given method.
   *
   * Note that this will replace any previous request handler for the same method.
   */
  setRequestHandler(requestSchema, handler) {
    const method = getMethodLiteral(requestSchema);
    this.assertRequestHandlerCapability(method);
    this._requestHandlers.set(method, (request, extra) => {
      const parsed = parseWithCompat(requestSchema, request);
      return Promise.resolve(handler(parsed, extra));
    });
  }
  /**
   * Removes the request handler for the given method.
   */
  removeRequestHandler(method) {
    this._requestHandlers.delete(method);
  }
  /**
   * Asserts that a request handler has not already been set for the given method, in preparation for a new one being automatically installed.
   */
  assertCanSetRequestHandler(method) {
    if (this._requestHandlers.has(method)) {
      throw new Error(`A request handler for ${method} already exists, which would be overridden`);
    }
  }
  /**
   * Registers a handler to invoke when this protocol object receives a notification with the given method.
   *
   * Note that this will replace any previous notification handler for the same method.
   */
  setNotificationHandler(notificationSchema, handler) {
    const method = getMethodLiteral(notificationSchema);
    this._notificationHandlers.set(method, (notification) => {
      const parsed = parseWithCompat(notificationSchema, notification);
      return Promise.resolve(handler(parsed));
    });
  }
  /**
   * Removes the notification handler for the given method.
   */
  removeNotificationHandler(method) {
    this._notificationHandlers.delete(method);
  }
  /**
   * Cleans up the progress handler associated with a task.
   * This should be called when a task reaches a terminal status.
   */
  _cleanupTaskProgressHandler(taskId) {
    const progressToken = this._taskProgressTokens.get(taskId);
    if (progressToken !== void 0) {
      this._progressHandlers.delete(progressToken);
      this._taskProgressTokens.delete(taskId);
    }
  }
  /**
   * Enqueues a task-related message for side-channel delivery via tasks/result.
   * @param taskId The task ID to associate the message with
   * @param message The message to enqueue
   * @param sessionId Optional session ID for binding the operation to a specific session
   * @throws Error if taskStore is not configured or if enqueue fails (e.g., queue overflow)
   *
   * Note: If enqueue fails, it's the TaskMessageQueue implementation's responsibility to handle
   * the error appropriately (e.g., by failing the task, logging, etc.). The Protocol layer
   * simply propagates the error.
   */
  async _enqueueTaskMessage(taskId, message, sessionId) {
    if (!this._taskStore || !this._taskMessageQueue) {
      throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");
    }
    const maxQueueSize = this._options?.maxTaskQueueSize;
    await this._taskMessageQueue.enqueue(taskId, message, sessionId, maxQueueSize);
  }
  /**
   * Clears the message queue for a task and rejects any pending request resolvers.
   * @param taskId The task ID whose queue should be cleared
   * @param sessionId Optional session ID for binding the operation to a specific session
   */
  async _clearTaskQueue(taskId, sessionId) {
    if (this._taskMessageQueue) {
      const messages = await this._taskMessageQueue.dequeueAll(taskId, sessionId);
      for (const message of messages) {
        if (message.type === "request" && isJSONRPCRequest(message.message)) {
          const requestId = message.message.id;
          const resolver = this._requestResolvers.get(requestId);
          if (resolver) {
            resolver(new McpError(ErrorCode.InternalError, "Task cancelled or completed"));
            this._requestResolvers.delete(requestId);
          } else {
            this._onerror(new Error(`Resolver missing for request ${requestId} during task ${taskId} cleanup`));
          }
        }
      }
    }
  }
  /**
   * Waits for a task update (new messages or status change) with abort signal support.
   * Uses polling to check for updates at the task's configured poll interval.
   * @param taskId The task ID to wait for
   * @param signal Abort signal to cancel the wait
   * @returns Promise that resolves when an update occurs or rejects if aborted
   */
  async _waitForTaskUpdate(taskId, signal) {
    let interval = this._options?.defaultTaskPollInterval ?? 1e3;
    try {
      const task = await this._taskStore?.getTask(taskId);
      if (task?.pollInterval) {
        interval = task.pollInterval;
      }
    } catch {
    }
    return new Promise((resolve, reject) => {
      if (signal.aborted) {
        reject(new McpError(ErrorCode.InvalidRequest, "Request cancelled"));
        return;
      }
      const timeoutId = setTimeout(resolve, interval);
      signal.addEventListener("abort", () => {
        clearTimeout(timeoutId);
        reject(new McpError(ErrorCode.InvalidRequest, "Request cancelled"));
      }, { once: true });
    });
  }
  requestTaskStore(request, sessionId) {
    const taskStore = this._taskStore;
    if (!taskStore) {
      throw new Error("No task store configured");
    }
    return {
      createTask: async (taskParams) => {
        if (!request) {
          throw new Error("No request provided");
        }
        return await taskStore.createTask(taskParams, request.id, {
          method: request.method,
          params: request.params
        }, sessionId);
      },
      getTask: async (taskId) => {
        const task = await taskStore.getTask(taskId, sessionId);
        if (!task) {
          throw new McpError(ErrorCode.InvalidParams, "Failed to retrieve task: Task not found");
        }
        return task;
      },
      storeTaskResult: async (taskId, status, result) => {
        await taskStore.storeTaskResult(taskId, status, result, sessionId);
        const task = await taskStore.getTask(taskId, sessionId);
        if (task) {
          const notification = TaskStatusNotificationSchema.parse({
            method: "notifications/tasks/status",
            params: task
          });
          await this.notification(notification);
          if (isTerminal(task.status)) {
            this._cleanupTaskProgressHandler(taskId);
          }
        }
      },
      getTaskResult: (taskId) => {
        return taskStore.getTaskResult(taskId, sessionId);
      },
      updateTaskStatus: async (taskId, status, statusMessage) => {
        const task = await taskStore.getTask(taskId, sessionId);
        if (!task) {
          throw new McpError(ErrorCode.InvalidParams, `Task "${taskId}" not found - it may have been cleaned up`);
        }
        if (isTerminal(task.status)) {
          throw new McpError(ErrorCode.InvalidParams, `Cannot update task "${taskId}" from terminal status "${task.status}" to "${status}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);
        }
        await taskStore.updateTaskStatus(taskId, status, statusMessage, sessionId);
        const updatedTask = await taskStore.getTask(taskId, sessionId);
        if (updatedTask) {
          const notification = TaskStatusNotificationSchema.parse({
            method: "notifications/tasks/status",
            params: updatedTask
          });
          await this.notification(notification);
          if (isTerminal(updatedTask.status)) {
            this._cleanupTaskProgressHandler(taskId);
          }
        }
      },
      listTasks: (cursor) => {
        return taskStore.listTasks(cursor, sessionId);
      }
    };
  }
};
function isPlainObject2(value) {
  return value !== null && typeof value === "object" && !Array.isArray(value);
}
function mergeCapabilities(base, additional) {
  const result = { ...base };
  for (const key in additional) {
    const k = key;
    const addValue = additional[k];
    if (addValue === void 0)
      continue;
    const baseValue = result[k];
    if (isPlainObject2(baseValue) && isPlainObject2(addValue)) {
      result[k] = { ...baseValue, ...addValue };
    } else {
      result[k] = addValue;
    }
  }
  return result;
}

// node_modules/@modelcontextprotocol/sdk/dist/esm/validation/ajv-provider.js
var import_ajv = __toESM(require_ajv(), 1);
var import_ajv_formats = __toESM(require_dist5(), 1);
function createDefaultAjvInstance() {
  const ajv = new import_ajv.default({
    strict: false,
    validateFormats: true,
    validateSchema: false,
    allErrors: true
  });
  const addFormats = import_ajv_formats.default;
  addFormats(ajv);
  return ajv;
}
var AjvJsonSchemaValidator = class {
  /**
   * Create an AJV validator
   *
   * @param ajv - Optional pre-configured AJV instance. If not provided, a default instance will be created.
   *
   * @example
   * ```typescript
   * // Use default configuration (recommended for most cases)
   * import { AjvJsonSchemaValidator } from '@modelcontextprotocol/sdk/validation/ajv';
   * const validator = new AjvJsonSchemaValidator();
   *
   * // Or provide custom AJV instance for advanced configuration
   * import { Ajv } from 'ajv';
   * import addFormats from 'ajv-formats';
   *
   * const ajv = new Ajv({ validateFormats: true });
   * addFormats(ajv);
   * const validator = new AjvJsonSchemaValidator(ajv);
   * ```
   */
  constructor(ajv) {
    this._ajv = ajv ?? createDefaultAjvInstance();
  }
  /**
   * Create a validator for the given JSON Schema
   *
   * The validator is compiled once and can be reused multiple times.
   * If the schema has an $id, it will be cached by AJV automatically.
   *
   * @param schema - Standard JSON Schema object
   * @returns A validator function that validates input data
   */
  getValidator(schema) {
    const ajvValidator = "$id" in schema && typeof schema.$id === "string" ? this._ajv.getSchema(schema.$id) ?? this._ajv.compile(schema) : this._ajv.compile(schema);
    return (input) => {
      const valid = ajvValidator(input);
      if (valid) {
        return {
          valid: true,
          data: input,
          errorMessage: void 0
        };
      } else {
        return {
          valid: false,
          data: void 0,
          errorMessage: this._ajv.errorsText(ajvValidator.errors)
        };
      }
    };
  }
};

// node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/client.js
var ExperimentalClientTasks = class {
  constructor(_client) {
    this._client = _client;
  }
  /**
   * Calls a tool and returns an AsyncGenerator that yields response messages.
   * The generator is guaranteed to end with either a 'result' or 'error' message.
   *
   * This method provides streaming access to tool execution, allowing you to
   * observe intermediate task status updates for long-running tool calls.
   * Automatically validates structured output if the tool has an outputSchema.
   *
   * @example
   * ```typescript
   * const stream = client.experimental.tasks.callToolStream({ name: 'myTool', arguments: {} });
   * for await (const message of stream) {
   *   switch (message.type) {
   *     case 'taskCreated':
   *       console.log('Tool execution started:', message.task.taskId);
   *       break;
   *     case 'taskStatus':
   *       console.log('Tool status:', message.task.status);
   *       break;
   *     case 'result':
   *       console.log('Tool result:', message.result);
   *       break;
   *     case 'error':
   *       console.error('Tool error:', message.error);
   *       break;
   *   }
   * }
   * ```
   *
   * @param params - Tool call parameters (name and arguments)
   * @param resultSchema - Zod schema for validating the result (defaults to CallToolResultSchema)
   * @param options - Optional request options (timeout, signal, task creation params, etc.)
   * @returns AsyncGenerator that yields ResponseMessage objects
   *
   * @experimental
   */
  async *callToolStream(params, resultSchema = CallToolResultSchema, options2) {
    const clientInternal = this._client;
    const optionsWithTask = {
      ...options2,
      // We check if the tool is known to be a task during auto-configuration, but assume
      // the caller knows what they're doing if they pass this explicitly
      task: options2?.task ?? (clientInternal.isToolTask(params.name) ? {} : void 0)
    };
    const stream = clientInternal.requestStream({ method: "tools/call", params }, resultSchema, optionsWithTask);
    const validator = clientInternal.getToolOutputValidator(params.name);
    for await (const message of stream) {
      if (message.type === "result" && validator) {
        const result = message.result;
        if (!result.structuredContent && !result.isError) {
          yield {
            type: "error",
            error: new McpError(ErrorCode.InvalidRequest, `Tool ${params.name} has an output schema but did not return structured content`)
          };
          return;
        }
        if (result.structuredContent) {
          try {
            const validationResult = validator(result.structuredContent);
            if (!validationResult.valid) {
              yield {
                type: "error",
                error: new McpError(ErrorCode.InvalidParams, `Structured content does not match the tool's output schema: ${validationResult.errorMessage}`)
              };
              return;
            }
          } catch (error48) {
            if (error48 instanceof McpError) {
              yield { type: "error", error: error48 };
              return;
            }
            yield {
              type: "error",
              error: new McpError(ErrorCode.InvalidParams, `Failed to validate structured content: ${error48 instanceof Error ? error48.message : String(error48)}`)
            };
            return;
          }
        }
      }
      yield message;
    }
  }
  /**
   * Gets the current status of a task.
   *
   * @param taskId - The task identifier
   * @param options - Optional request options
   * @returns The task status
   *
   * @experimental
   */
  async getTask(taskId, options2) {
    return this._client.getTask({ taskId }, options2);
  }
  /**
   * Retrieves the result of a completed task.
   *
   * @param taskId - The task identifier
   * @param resultSchema - Zod schema for validating the result
   * @param options - Optional request options
   * @returns The task result
   *
   * @experimental
   */
  async getTaskResult(taskId, resultSchema, options2) {
    return this._client.getTaskResult({ taskId }, resultSchema, options2);
  }
  /**
   * Lists tasks with optional pagination.
   *
   * @param cursor - Optional pagination cursor
   * @param options - Optional request options
   * @returns List of tasks with optional next cursor
   *
   * @experimental
   */
  async listTasks(cursor, options2) {
    return this._client.listTasks(cursor ? { cursor } : void 0, options2);
  }
  /**
   * Cancels a running task.
   *
   * @param taskId - The task identifier
   * @param options - Optional request options
   *
   * @experimental
   */
  async cancelTask(taskId, options2) {
    return this._client.cancelTask({ taskId }, options2);
  }
  /**
   * Sends a request and returns an AsyncGenerator that yields response messages.
   * The generator is guaranteed to end with either a 'result' or 'error' message.
   *
   * This method provides streaming access to request processing, allowing you to
   * observe intermediate task status updates for task-augmented requests.
   *
   * @param request - The request to send
   * @param resultSchema - Zod schema for validating the result
   * @param options - Optional request options (timeout, signal, task creation params, etc.)
   * @returns AsyncGenerator that yields ResponseMessage objects
   *
   * @experimental
   */
  requestStream(request, resultSchema, options2) {
    return this._client.requestStream(request, resultSchema, options2);
  }
};

// node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/helpers.js
function assertToolsCallTaskCapability(requests, method, entityName) {
  if (!requests) {
    throw new Error(`${entityName} does not support task creation (required for ${method})`);
  }
  switch (method) {
    case "tools/call":
      if (!requests.tools?.call) {
        throw new Error(`${entityName} does not support task creation for tools/call (required for ${method})`);
      }
      break;
    default:
      break;
  }
}
function assertClientRequestTaskCapability(requests, method, entityName) {
  if (!requests) {
    throw new Error(`${entityName} does not support task creation (required for ${method})`);
  }
  switch (method) {
    case "sampling/createMessage":
      if (!requests.sampling?.createMessage) {
        throw new Error(`${entityName} does not support task creation for sampling/createMessage (required for ${method})`);
      }
      break;
    case "elicitation/create":
      if (!requests.elicitation?.create) {
        throw new Error(`${entityName} does not support task creation for elicitation/create (required for ${method})`);
      }
      break;
    default:
      break;
  }
}

// node_modules/@modelcontextprotocol/sdk/dist/esm/client/index.js
function applyElicitationDefaults(schema, data) {
  if (!schema || data === null || typeof data !== "object")
    return;
  if (schema.type === "object" && schema.properties && typeof schema.properties === "object") {
    const obj = data;
    const props = schema.properties;
    for (const key of Object.keys(props)) {
      const propSchema = props[key];
      if (obj[key] === void 0 && Object.prototype.hasOwnProperty.call(propSchema, "default")) {
        obj[key] = propSchema.default;
      }
      if (obj[key] !== void 0) {
        applyElicitationDefaults(propSchema, obj[key]);
      }
    }
  }
  if (Array.isArray(schema.anyOf)) {
    for (const sub of schema.anyOf) {
      if (typeof sub !== "boolean") {
        applyElicitationDefaults(sub, data);
      }
    }
  }
  if (Array.isArray(schema.oneOf)) {
    for (const sub of schema.oneOf) {
      if (typeof sub !== "boolean") {
        applyElicitationDefaults(sub, data);
      }
    }
  }
}
function getSupportedElicitationModes(capabilities) {
  if (!capabilities) {
    return { supportsFormMode: false, supportsUrlMode: false };
  }
  const hasFormCapability = capabilities.form !== void 0;
  const hasUrlCapability = capabilities.url !== void 0;
  const supportsFormMode = hasFormCapability || !hasFormCapability && !hasUrlCapability;
  const supportsUrlMode = hasUrlCapability;
  return { supportsFormMode, supportsUrlMode };
}
var Client = class extends Protocol {
  /**
   * Initializes this client with the given name and version information.
   */
  constructor(_clientInfo, options2) {
    super(options2);
    this._clientInfo = _clientInfo;
    this._cachedToolOutputValidators = /* @__PURE__ */ new Map();
    this._cachedKnownTaskTools = /* @__PURE__ */ new Set();
    this._cachedRequiredTaskTools = /* @__PURE__ */ new Set();
    this._listChangedDebounceTimers = /* @__PURE__ */ new Map();
    this._capabilities = options2?.capabilities ?? {};
    this._jsonSchemaValidator = options2?.jsonSchemaValidator ?? new AjvJsonSchemaValidator();
    if (options2?.listChanged) {
      this._pendingListChangedConfig = options2.listChanged;
    }
  }
  /**
   * Set up handlers for list changed notifications based on config and server capabilities.
   * This should only be called after initialization when server capabilities are known.
   * Handlers are silently skipped if the server doesn't advertise the corresponding listChanged capability.
   * @internal
   */
  _setupListChangedHandlers(config2) {
    if (config2.tools && this._serverCapabilities?.tools?.listChanged) {
      this._setupListChangedHandler("tools", ToolListChangedNotificationSchema, config2.tools, async () => {
        const result = await this.listTools();
        return result.tools;
      });
    }
    if (config2.prompts && this._serverCapabilities?.prompts?.listChanged) {
      this._setupListChangedHandler("prompts", PromptListChangedNotificationSchema, config2.prompts, async () => {
        const result = await this.listPrompts();
        return result.prompts;
      });
    }
    if (config2.resources && this._serverCapabilities?.resources?.listChanged) {
      this._setupListChangedHandler("resources", ResourceListChangedNotificationSchema, config2.resources, async () => {
        const result = await this.listResources();
        return result.resources;
      });
    }
  }
  /**
   * Access experimental features.
   *
   * WARNING: These APIs are experimental and may change without notice.
   *
   * @experimental
   */
  get experimental() {
    if (!this._experimental) {
      this._experimental = {
        tasks: new ExperimentalClientTasks(this)
      };
    }
    return this._experimental;
  }
  /**
   * Registers new capabilities. This can only be called before connecting to a transport.
   *
   * The new capabilities will be merged with any existing capabilities previously given (e.g., at initialization).
   */
  registerCapabilities(capabilities) {
    if (this.transport) {
      throw new Error("Cannot register capabilities after connecting to transport");
    }
    this._capabilities = mergeCapabilities(this._capabilities, capabilities);
  }
  /**
   * Override request handler registration to enforce client-side validation for elicitation.
   */
  setRequestHandler(requestSchema, handler) {
    const shape = getObjectShape(requestSchema);
    const methodSchema = shape?.method;
    if (!methodSchema) {
      throw new Error("Schema is missing a method literal");
    }
    let methodValue;
    if (isZ4Schema(methodSchema)) {
      const v4Schema = methodSchema;
      const v4Def = v4Schema._zod?.def;
      methodValue = v4Def?.value ?? v4Schema.value;
    } else {
      const v3Schema = methodSchema;
      const legacyDef = v3Schema._def;
      methodValue = legacyDef?.value ?? v3Schema.value;
    }
    if (typeof methodValue !== "string") {
      throw new Error("Schema method literal must be a string");
    }
    const method = methodValue;
    if (method === "elicitation/create") {
      const wrappedHandler = async (request, extra) => {
        const validatedRequest = safeParse3(ElicitRequestSchema, request);
        if (!validatedRequest.success) {
          const errorMessage = validatedRequest.error instanceof Error ? validatedRequest.error.message : String(validatedRequest.error);
          throw new McpError(ErrorCode.InvalidParams, `Invalid elicitation request: ${errorMessage}`);
        }
        const { params } = validatedRequest.data;
        params.mode = params.mode ?? "form";
        const { supportsFormMode, supportsUrlMode } = getSupportedElicitationModes(this._capabilities.elicitation);
        if (params.mode === "form" && !supportsFormMode) {
          throw new McpError(ErrorCode.InvalidParams, "Client does not support form-mode elicitation requests");
        }
        if (params.mode === "url" && !supportsUrlMode) {
          throw new McpError(ErrorCode.InvalidParams, "Client does not support URL-mode elicitation requests");
        }
        const result = await Promise.resolve(handler(request, extra));
        if (params.task) {
          const taskValidationResult = safeParse3(CreateTaskResultSchema, result);
          if (!taskValidationResult.success) {
            const errorMessage = taskValidationResult.error instanceof Error ? taskValidationResult.error.message : String(taskValidationResult.error);
            throw new McpError(ErrorCode.InvalidParams, `Invalid task creation result: ${errorMessage}`);
          }
          return taskValidationResult.data;
        }
        const validationResult = safeParse3(ElicitResultSchema, result);
        if (!validationResult.success) {
          const errorMessage = validationResult.error instanceof Error ? validationResult.error.message : String(validationResult.error);
          throw new McpError(ErrorCode.InvalidParams, `Invalid elicitation result: ${errorMessage}`);
        }
        const validatedResult = validationResult.data;
        const requestedSchema = params.mode === "form" ? params.requestedSchema : void 0;
        if (params.mode === "form" && validatedResult.action === "accept" && validatedResult.content && requestedSchema) {
          if (this._capabilities.elicitation?.form?.applyDefaults) {
            try {
              applyElicitationDefaults(requestedSchema, validatedResult.content);
            } catch {
            }
          }
        }
        return validatedResult;
      };
      return super.setRequestHandler(requestSchema, wrappedHandler);
    }
    if (method === "sampling/createMessage") {
      const wrappedHandler = async (request, extra) => {
        const validatedRequest = safeParse3(CreateMessageRequestSchema, request);
        if (!validatedRequest.success) {
          const errorMessage = validatedRequest.error instanceof Error ? validatedRequest.error.message : String(validatedRequest.error);
          throw new McpError(ErrorCode.InvalidParams, `Invalid sampling request: ${errorMessage}`);
        }
        const { params } = validatedRequest.data;
        const result = await Promise.resolve(handler(request, extra));
        if (params.task) {
          const taskValidationResult = safeParse3(CreateTaskResultSchema, result);
          if (!taskValidationResult.success) {
            const errorMessage = taskValidationResult.error instanceof Error ? taskValidationResult.error.message : String(taskValidationResult.error);
            throw new McpError(ErrorCode.InvalidParams, `Invalid task creation result: ${errorMessage}`);
          }
          return taskValidationResult.data;
        }
        const hasTools = params.tools || params.toolChoice;
        const resultSchema = hasTools ? CreateMessageResultWithToolsSchema : CreateMessageResultSchema;
        const validationResult = safeParse3(resultSchema, result);
        if (!validationResult.success) {
          const errorMessage = validationResult.error instanceof Error ? validationResult.error.message : String(validationResult.error);
          throw new McpError(ErrorCode.InvalidParams, `Invalid sampling result: ${errorMessage}`);
        }
        return validationResult.data;
      };
      return super.setRequestHandler(requestSchema, wrappedHandler);
    }
    return super.setRequestHandler(requestSchema, handler);
  }
  assertCapability(capability, method) {
    if (!this._serverCapabilities?.[capability]) {
      throw new Error(`Server does not support ${capability} (required for ${method})`);
    }
  }
  async connect(transport, options2) {
    await super.connect(transport);
    if (transport.sessionId !== void 0) {
      return;
    }
    try {
      const result = await this.request({
        method: "initialize",
        params: {
          protocolVersion: LATEST_PROTOCOL_VERSION,
          capabilities: this._capabilities,
          clientInfo: this._clientInfo
        }
      }, InitializeResultSchema, options2);
      if (result === void 0) {
        throw new Error(`Server sent invalid initialize result: ${result}`);
      }
      if (!SUPPORTED_PROTOCOL_VERSIONS.includes(result.protocolVersion)) {
        throw new Error(`Server's protocol version is not supported: ${result.protocolVersion}`);
      }
      this._serverCapabilities = result.capabilities;
      this._serverVersion = result.serverInfo;
      if (transport.setProtocolVersion) {
        transport.setProtocolVersion(result.protocolVersion);
      }
      this._instructions = result.instructions;
      await this.notification({
        method: "notifications/initialized"
      });
      if (this._pendingListChangedConfig) {
        this._setupListChangedHandlers(this._pendingListChangedConfig);
        this._pendingListChangedConfig = void 0;
      }
    } catch (error48) {
      void this.close();
      throw error48;
    }
  }
  /**
   * After initialization has completed, this will be populated with the server's reported capabilities.
   */
  getServerCapabilities() {
    return this._serverCapabilities;
  }
  /**
   * After initialization has completed, this will be populated with information about the server's name and version.
   */
  getServerVersion() {
    return this._serverVersion;
  }
  /**
   * After initialization has completed, this may be populated with information about the server's instructions.
   */
  getInstructions() {
    return this._instructions;
  }
  assertCapabilityForMethod(method) {
    switch (method) {
      case "logging/setLevel":
        if (!this._serverCapabilities?.logging) {
          throw new Error(`Server does not support logging (required for ${method})`);
        }
        break;
      case "prompts/get":
      case "prompts/list":
        if (!this._serverCapabilities?.prompts) {
          throw new Error(`Server does not support prompts (required for ${method})`);
        }
        break;
      case "resources/list":
      case "resources/templates/list":
      case "resources/read":
      case "resources/subscribe":
      case "resources/unsubscribe":
        if (!this._serverCapabilities?.resources) {
          throw new Error(`Server does not support resources (required for ${method})`);
        }
        if (method === "resources/subscribe" && !this._serverCapabilities.resources.subscribe) {
          throw new Error(`Server does not support resource subscriptions (required for ${method})`);
        }
        break;
      case "tools/call":
      case "tools/list":
        if (!this._serverCapabilities?.tools) {
          throw new Error(`Server does not support tools (required for ${method})`);
        }
        break;
      case "completion/complete":
        if (!this._serverCapabilities?.completions) {
          throw new Error(`Server does not support completions (required for ${method})`);
        }
        break;
      case "initialize":
        break;
      case "ping":
        break;
    }
  }
  assertNotificationCapability(method) {
    switch (method) {
      case "notifications/roots/list_changed":
        if (!this._capabilities.roots?.listChanged) {
          throw new Error(`Client does not support roots list changed notifications (required for ${method})`);
        }
        break;
      case "notifications/initialized":
        break;
      case "notifications/cancelled":
        break;
      case "notifications/progress":
        break;
    }
  }
  assertRequestHandlerCapability(method) {
    if (!this._capabilities) {
      return;
    }
    switch (method) {
      case "sampling/createMessage":
        if (!this._capabilities.sampling) {
          throw new Error(`Client does not support sampling capability (required for ${method})`);
        }
        break;
      case "elicitation/create":
        if (!this._capabilities.elicitation) {
          throw new Error(`Client does not support elicitation capability (required for ${method})`);
        }
        break;
      case "roots/list":
        if (!this._capabilities.roots) {
          throw new Error(`Client does not support roots capability (required for ${method})`);
        }
        break;
      case "tasks/get":
      case "tasks/list":
      case "tasks/result":
      case "tasks/cancel":
        if (!this._capabilities.tasks) {
          throw new Error(`Client does not support tasks capability (required for ${method})`);
        }
        break;
      case "ping":
        break;
    }
  }
  assertTaskCapability(method) {
    assertToolsCallTaskCapability(this._serverCapabilities?.tasks?.requests, method, "Server");
  }
  assertTaskHandlerCapability(method) {
    if (!this._capabilities) {
      return;
    }
    assertClientRequestTaskCapability(this._capabilities.tasks?.requests, method, "Client");
  }
  async ping(options2) {
    return this.request({ method: "ping" }, EmptyResultSchema, options2);
  }
  async complete(params, options2) {
    return this.request({ method: "completion/complete", params }, CompleteResultSchema, options2);
  }
  async setLoggingLevel(level, options2) {
    return this.request({ method: "logging/setLevel", params: { level } }, EmptyResultSchema, options2);
  }
  async getPrompt(params, options2) {
    return this.request({ method: "prompts/get", params }, GetPromptResultSchema, options2);
  }
  async listPrompts(params, options2) {
    return this.request({ method: "prompts/list", params }, ListPromptsResultSchema, options2);
  }
  async listResources(params, options2) {
    return this.request({ method: "resources/list", params }, ListResourcesResultSchema, options2);
  }
  async listResourceTemplates(params, options2) {
    return this.request({ method: "resources/templates/list", params }, ListResourceTemplatesResultSchema, options2);
  }
  async readResource(params, options2) {
    return this.request({ method: "resources/read", params }, ReadResourceResultSchema, options2);
  }
  async subscribeResource(params, options2) {
    return this.request({ method: "resources/subscribe", params }, EmptyResultSchema, options2);
  }
  async unsubscribeResource(params, options2) {
    return this.request({ method: "resources/unsubscribe", params }, EmptyResultSchema, options2);
  }
  /**
   * Calls a tool and waits for the result. Automatically validates structured output if the tool has an outputSchema.
   *
   * For task-based execution with streaming behavior, use client.experimental.tasks.callToolStream() instead.
   */
  async callTool(params, resultSchema = CallToolResultSchema, options2) {
    if (this.isToolTaskRequired(params.name)) {
      throw new McpError(ErrorCode.InvalidRequest, `Tool "${params.name}" requires task-based execution. Use client.experimental.tasks.callToolStream() instead.`);
    }
    const result = await this.request({ method: "tools/call", params }, resultSchema, options2);
    const validator = this.getToolOutputValidator(params.name);
    if (validator) {
      if (!result.structuredContent && !result.isError) {
        throw new McpError(ErrorCode.InvalidRequest, `Tool ${params.name} has an output schema but did not return structured content`);
      }
      if (result.structuredContent) {
        try {
          const validationResult = validator(result.structuredContent);
          if (!validationResult.valid) {
            throw new McpError(ErrorCode.InvalidParams, `Structured content does not match the tool's output schema: ${validationResult.errorMessage}`);
          }
        } catch (error48) {
          if (error48 instanceof McpError) {
            throw error48;
          }
          throw new McpError(ErrorCode.InvalidParams, `Failed to validate structured content: ${error48 instanceof Error ? error48.message : String(error48)}`);
        }
      }
    }
    return result;
  }
  isToolTask(toolName) {
    if (!this._serverCapabilities?.tasks?.requests?.tools?.call) {
      return false;
    }
    return this._cachedKnownTaskTools.has(toolName);
  }
  /**
   * Check if a tool requires task-based execution.
   * Unlike isToolTask which includes 'optional' tools, this only checks for 'required'.
   */
  isToolTaskRequired(toolName) {
    return this._cachedRequiredTaskTools.has(toolName);
  }
  /**
   * Cache validators for tool output schemas.
   * Called after listTools() to pre-compile validators for better performance.
   */
  cacheToolMetadata(tools) {
    this._cachedToolOutputValidators.clear();
    this._cachedKnownTaskTools.clear();
    this._cachedRequiredTaskTools.clear();
    for (const tool of tools) {
      if (tool.outputSchema) {
        const toolValidator = this._jsonSchemaValidator.getValidator(tool.outputSchema);
        this._cachedToolOutputValidators.set(tool.name, toolValidator);
      }
      const taskSupport = tool.execution?.taskSupport;
      if (taskSupport === "required" || taskSupport === "optional") {
        this._cachedKnownTaskTools.add(tool.name);
      }
      if (taskSupport === "required") {
        this._cachedRequiredTaskTools.add(tool.name);
      }
    }
  }
  /**
   * Get cached validator for a tool
   */
  getToolOutputValidator(toolName) {
    return this._cachedToolOutputValidators.get(toolName);
  }
  async listTools(params, options2) {
    const result = await this.request({ method: "tools/list", params }, ListToolsResultSchema, options2);
    this.cacheToolMetadata(result.tools);
    return result;
  }
  /**
   * Set up a single list changed handler.
   * @internal
   */
  _setupListChangedHandler(listType, notificationSchema, options2, fetcher) {
    const parseResult = ListChangedOptionsBaseSchema.safeParse(options2);
    if (!parseResult.success) {
      throw new Error(`Invalid ${listType} listChanged options: ${parseResult.error.message}`);
    }
    if (typeof options2.onChanged !== "function") {
      throw new Error(`Invalid ${listType} listChanged options: onChanged must be a function`);
    }
    const { autoRefresh, debounceMs } = parseResult.data;
    const { onChanged } = options2;
    const refresh = async () => {
      if (!autoRefresh) {
        onChanged(null, null);
        return;
      }
      try {
        const items = await fetcher();
        onChanged(null, items);
      } catch (e) {
        const error48 = e instanceof Error ? e : new Error(String(e));
        onChanged(error48, null);
      }
    };
    const handler = () => {
      if (debounceMs) {
        const existingTimer = this._listChangedDebounceTimers.get(listType);
        if (existingTimer) {
          clearTimeout(existingTimer);
        }
        const timer = setTimeout(refresh, debounceMs);
        this._listChangedDebounceTimers.set(listType, timer);
      } else {
        refresh();
      }
    };
    this.setNotificationHandler(notificationSchema, handler);
  }
  async sendRootsListChanged() {
    return this.notification({ method: "notifications/roots/list_changed" });
  }
};

// node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/server.js
var ExperimentalServerTasks = class {
  constructor(_server) {
    this._server = _server;
  }
  /**
   * Sends a request and returns an AsyncGenerator that yields response messages.
   * The generator is guaranteed to end with either a 'result' or 'error' message.
   *
   * This method provides streaming access to request processing, allowing you to
   * observe intermediate task status updates for task-augmented requests.
   *
   * @param request - The request to send
   * @param resultSchema - Zod schema for validating the result
   * @param options - Optional request options (timeout, signal, task creation params, etc.)
   * @returns AsyncGenerator that yields ResponseMessage objects
   *
   * @experimental
   */
  requestStream(request, resultSchema, options2) {
    return this._server.requestStream(request, resultSchema, options2);
  }
  /**
   * Sends a sampling request and returns an AsyncGenerator that yields response messages.
   * The generator is guaranteed to end with either a 'result' or 'error' message.
   *
   * For task-augmented requests, yields 'taskCreated' and 'taskStatus' messages
   * before the final result.
   *
   * @example
   * ```typescript
   * const stream = server.experimental.tasks.createMessageStream({
   *     messages: [{ role: 'user', content: { type: 'text', text: 'Hello' } }],
   *     maxTokens: 100
   * }, {
   *     onprogress: (progress) => {
   *         // Handle streaming tokens via progress notifications
   *         console.log('Progress:', progress.message);
   *     }
   * });
   *
   * for await (const message of stream) {
   *     switch (message.type) {
   *         case 'taskCreated':
   *             console.log('Task created:', message.task.taskId);
   *             break;
   *         case 'taskStatus':
   *             console.log('Task status:', message.task.status);
   *             break;
   *         case 'result':
   *             console.log('Final result:', message.result);
   *             break;
   *         case 'error':
   *             console.error('Error:', message.error);
   *             break;
   *     }
   * }
   * ```
   *
   * @param params - The sampling request parameters
   * @param options - Optional request options (timeout, signal, task creation params, onprogress, etc.)
   * @returns AsyncGenerator that yields ResponseMessage objects
   *
   * @experimental
   */
  createMessageStream(params, options2) {
    const clientCapabilities = this._server.getClientCapabilities();
    if ((params.tools || params.toolChoice) && !clientCapabilities?.sampling?.tools) {
      throw new Error("Client does not support sampling tools capability.");
    }
    if (params.messages.length > 0) {
      const lastMessage = params.messages[params.messages.length - 1];
      const lastContent = Array.isArray(lastMessage.content) ? lastMessage.content : [lastMessage.content];
      const hasToolResults = lastContent.some((c) => c.type === "tool_result");
      const previousMessage = params.messages.length > 1 ? params.messages[params.messages.length - 2] : void 0;
      const previousContent = previousMessage ? Array.isArray(previousMessage.content) ? previousMessage.content : [previousMessage.content] : [];
      const hasPreviousToolUse = previousContent.some((c) => c.type === "tool_use");
      if (hasToolResults) {
        if (lastContent.some((c) => c.type !== "tool_result")) {
          throw new Error("The last message must contain only tool_result content if any is present");
        }
        if (!hasPreviousToolUse) {
          throw new Error("tool_result blocks are not matching any tool_use from the previous message");
        }
      }
      if (hasPreviousToolUse) {
        const toolUseIds = new Set(previousContent.filter((c) => c.type === "tool_use").map((c) => c.id));
        const toolResultIds = new Set(lastContent.filter((c) => c.type === "tool_result").map((c) => c.toolUseId));
        if (toolUseIds.size !== toolResultIds.size || ![...toolUseIds].every((id) => toolResultIds.has(id))) {
          throw new Error("ids of tool_result blocks and tool_use blocks from previous message do not match");
        }
      }
    }
    return this.requestStream({
      method: "sampling/createMessage",
      params
    }, CreateMessageResultSchema, options2);
  }
  /**
   * Sends an elicitation request and returns an AsyncGenerator that yields response messages.
   * The generator is guaranteed to end with either a 'result' or 'error' message.
   *
   * For task-augmented requests (especially URL-based elicitation), yields 'taskCreated'
   * and 'taskStatus' messages before the final result.
   *
   * @example
   * ```typescript
   * const stream = server.experimental.tasks.elicitInputStream({
   *     mode: 'url',
   *     message: 'Please authenticate',
   *     elicitationId: 'auth-123',
   *     url: 'https://example.com/auth'
   * }, {
   *     task: { ttl: 300000 } // Task-augmented for long-running auth flow
   * });
   *
   * for await (const message of stream) {
   *     switch (message.type) {
   *         case 'taskCreated':
   *             console.log('Task created:', message.task.taskId);
   *             break;
   *         case 'taskStatus':
   *             console.log('Task status:', message.task.status);
   *             break;
   *         case 'result':
   *             console.log('User action:', message.result.action);
   *             break;
   *         case 'error':
   *             console.error('Error:', message.error);
   *             break;
   *     }
   * }
   * ```
   *
   * @param params - The elicitation request parameters
   * @param options - Optional request options (timeout, signal, task creation params, etc.)
   * @returns AsyncGenerator that yields ResponseMessage objects
   *
   * @experimental
   */
  elicitInputStream(params, options2) {
    const clientCapabilities = this._server.getClientCapabilities();
    const mode = params.mode ?? "form";
    switch (mode) {
      case "url": {
        if (!clientCapabilities?.elicitation?.url) {
          throw new Error("Client does not support url elicitation.");
        }
        break;
      }
      case "form": {
        if (!clientCapabilities?.elicitation?.form) {
          throw new Error("Client does not support form elicitation.");
        }
        break;
      }
    }
    const normalizedParams = mode === "form" && params.mode === void 0 ? { ...params, mode: "form" } : params;
    return this.requestStream({
      method: "elicitation/create",
      params: normalizedParams
    }, ElicitResultSchema, options2);
  }
  /**
   * Gets the current status of a task.
   *
   * @param taskId - The task identifier
   * @param options - Optional request options
   * @returns The task status
   *
   * @experimental
   */
  async getTask(taskId, options2) {
    return this._server.getTask({ taskId }, options2);
  }
  /**
   * Retrieves the result of a completed task.
   *
   * @param taskId - The task identifier
   * @param resultSchema - Zod schema for validating the result
   * @param options - Optional request options
   * @returns The task result
   *
   * @experimental
   */
  async getTaskResult(taskId, resultSchema, options2) {
    return this._server.getTaskResult({ taskId }, resultSchema, options2);
  }
  /**
   * Lists tasks with optional pagination.
   *
   * @param cursor - Optional pagination cursor
   * @param options - Optional request options
   * @returns List of tasks with optional next cursor
   *
   * @experimental
   */
  async listTasks(cursor, options2) {
    return this._server.listTasks(cursor ? { cursor } : void 0, options2);
  }
  /**
   * Cancels a running task.
   *
   * @param taskId - The task identifier
   * @param options - Optional request options
   *
   * @experimental
   */
  async cancelTask(taskId, options2) {
    return this._server.cancelTask({ taskId }, options2);
  }
};

// node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js
var Server = class extends Protocol {
  /**
   * Initializes this server with the given name and version information.
   */
  constructor(_serverInfo, options2) {
    super(options2);
    this._serverInfo = _serverInfo;
    this._loggingLevels = /* @__PURE__ */ new Map();
    this.LOG_LEVEL_SEVERITY = new Map(LoggingLevelSchema.options.map((level, index) => [level, index]));
    this.isMessageIgnored = (level, sessionId) => {
      const currentLevel = this._loggingLevels.get(sessionId);
      return currentLevel ? this.LOG_LEVEL_SEVERITY.get(level) < this.LOG_LEVEL_SEVERITY.get(currentLevel) : false;
    };
    this._capabilities = options2?.capabilities ?? {};
    this._instructions = options2?.instructions;
    this._jsonSchemaValidator = options2?.jsonSchemaValidator ?? new AjvJsonSchemaValidator();
    this.setRequestHandler(InitializeRequestSchema, (request) => this._oninitialize(request));
    this.setNotificationHandler(InitializedNotificationSchema, () => this.oninitialized?.());
    if (this._capabilities.logging) {
      this.setRequestHandler(SetLevelRequestSchema, async (request, extra) => {
        const transportSessionId = extra.sessionId || extra.requestInfo?.headers["mcp-session-id"] || void 0;
        const { level } = request.params;
        const parseResult = LoggingLevelSchema.safeParse(level);
        if (parseResult.success) {
          this._loggingLevels.set(transportSessionId, parseResult.data);
        }
        return {};
      });
    }
  }
  /**
   * Access experimental features.
   *
   * WARNING: These APIs are experimental and may change without notice.
   *
   * @experimental
   */
  get experimental() {
    if (!this._experimental) {
      this._experimental = {
        tasks: new ExperimentalServerTasks(this)
      };
    }
    return this._experimental;
  }
  /**
   * Registers new capabilities. This can only be called before connecting to a transport.
   *
   * The new capabilities will be merged with any existing capabilities previously given (e.g., at initialization).
   */
  registerCapabilities(capabilities) {
    if (this.transport) {
      throw new Error("Cannot register capabilities after connecting to transport");
    }
    this._capabilities = mergeCapabilities(this._capabilities, capabilities);
  }
  /**
   * Override request handler registration to enforce server-side validation for tools/call.
   */
  setRequestHandler(requestSchema, handler) {
    const shape = getObjectShape(requestSchema);
    const methodSchema = shape?.method;
    if (!methodSchema) {
      throw new Error("Schema is missing a method literal");
    }
    let methodValue;
    if (isZ4Schema(methodSchema)) {
      const v4Schema = methodSchema;
      const v4Def = v4Schema._zod?.def;
      methodValue = v4Def?.value ?? v4Schema.value;
    } else {
      const v3Schema = methodSchema;
      const legacyDef = v3Schema._def;
      methodValue = legacyDef?.value ?? v3Schema.value;
    }
    if (typeof methodValue !== "string") {
      throw new Error("Schema method literal must be a string");
    }
    const method = methodValue;
    if (method === "tools/call") {
      const wrappedHandler = async (request, extra) => {
        const validatedRequest = safeParse3(CallToolRequestSchema, request);
        if (!validatedRequest.success) {
          const errorMessage = validatedRequest.error instanceof Error ? validatedRequest.error.message : String(validatedRequest.error);
          throw new McpError(ErrorCode.InvalidParams, `Invalid tools/call request: ${errorMessage}`);
        }
        const { params } = validatedRequest.data;
        const result = await Promise.resolve(handler(request, extra));
        if (params.task) {
          const taskValidationResult = safeParse3(CreateTaskResultSchema, result);
          if (!taskValidationResult.success) {
            const errorMessage = taskValidationResult.error instanceof Error ? taskValidationResult.error.message : String(taskValidationResult.error);
            throw new McpError(ErrorCode.InvalidParams, `Invalid task creation result: ${errorMessage}`);
          }
          return taskValidationResult.data;
        }
        const validationResult = safeParse3(CallToolResultSchema, result);
        if (!validationResult.success) {
          const errorMessage = validationResult.error instanceof Error ? validationResult.error.message : String(validationResult.error);
          throw new McpError(ErrorCode.InvalidParams, `Invalid tools/call result: ${errorMessage}`);
        }
        return validationResult.data;
      };
      return super.setRequestHandler(requestSchema, wrappedHandler);
    }
    return super.setRequestHandler(requestSchema, handler);
  }
  assertCapabilityForMethod(method) {
    switch (method) {
      case "sampling/createMessage":
        if (!this._clientCapabilities?.sampling) {
          throw new Error(`Client does not support sampling (required for ${method})`);
        }
        break;
      case "elicitation/create":
        if (!this._clientCapabilities?.elicitation) {
          throw new Error(`Client does not support elicitation (required for ${method})`);
        }
        break;
      case "roots/list":
        if (!this._clientCapabilities?.roots) {
          throw new Error(`Client does not support listing roots (required for ${method})`);
        }
        break;
      case "ping":
        break;
    }
  }
  assertNotificationCapability(method) {
    switch (method) {
      case "notifications/message":
        if (!this._capabilities.logging) {
          throw new Error(`Server does not support logging (required for ${method})`);
        }
        break;
      case "notifications/resources/updated":
      case "notifications/resources/list_changed":
        if (!this._capabilities.resources) {
          throw new Error(`Server does not support notifying about resources (required for ${method})`);
        }
        break;
      case "notifications/tools/list_changed":
        if (!this._capabilities.tools) {
          throw new Error(`Server does not support notifying of tool list changes (required for ${method})`);
        }
        break;
      case "notifications/prompts/list_changed":
        if (!this._capabilities.prompts) {
          throw new Error(`Server does not support notifying of prompt list changes (required for ${method})`);
        }
        break;
      case "notifications/elicitation/complete":
        if (!this._clientCapabilities?.elicitation?.url) {
          throw new Error(`Client does not support URL elicitation (required for ${method})`);
        }
        break;
      case "notifications/cancelled":
        break;
      case "notifications/progress":
        break;
    }
  }
  assertRequestHandlerCapability(method) {
    if (!this._capabilities) {
      return;
    }
    switch (method) {
      case "completion/complete":
        if (!this._capabilities.completions) {
          throw new Error(`Server does not support completions (required for ${method})`);
        }
        break;
      case "logging/setLevel":
        if (!this._capabilities.logging) {
          throw new Error(`Server does not support logging (required for ${method})`);
        }
        break;
      case "prompts/get":
      case "prompts/list":
        if (!this._capabilities.prompts) {
          throw new Error(`Server does not support prompts (required for ${method})`);
        }
        break;
      case "resources/list":
      case "resources/templates/list":
      case "resources/read":
        if (!this._capabilities.resources) {
          throw new Error(`Server does not support resources (required for ${method})`);
        }
        break;
      case "tools/call":
      case "tools/list":
        if (!this._capabilities.tools) {
          throw new Error(`Server does not support tools (required for ${method})`);
        }
        break;
      case "tasks/get":
      case "tasks/list":
      case "tasks/result":
      case "tasks/cancel":
        if (!this._capabilities.tasks) {
          throw new Error(`Server does not support tasks capability (required for ${method})`);
        }
        break;
      case "ping":
      case "initialize":
        break;
    }
  }
  assertTaskCapability(method) {
    assertClientRequestTaskCapability(this._clientCapabilities?.tasks?.requests, method, "Client");
  }
  assertTaskHandlerCapability(method) {
    if (!this._capabilities) {
      return;
    }
    assertToolsCallTaskCapability(this._capabilities.tasks?.requests, method, "Server");
  }
  async _oninitialize(request) {
    const requestedVersion = request.params.protocolVersion;
    this._clientCapabilities = request.params.capabilities;
    this._clientVersion = request.params.clientInfo;
    const protocolVersion = SUPPORTED_PROTOCOL_VERSIONS.includes(requestedVersion) ? requestedVersion : LATEST_PROTOCOL_VERSION;
    return {
      protocolVersion,
      capabilities: this.getCapabilities(),
      serverInfo: this._serverInfo,
      ...this._instructions && { instructions: this._instructions }
    };
  }
  /**
   * After initialization has completed, this will be populated with the client's reported capabilities.
   */
  getClientCapabilities() {
    return this._clientCapabilities;
  }
  /**
   * After initialization has completed, this will be populated with information about the client's name and version.
   */
  getClientVersion() {
    return this._clientVersion;
  }
  getCapabilities() {
    return this._capabilities;
  }
  async ping() {
    return this.request({ method: "ping" }, EmptyResultSchema);
  }
  // Implementation
  async createMessage(params, options2) {
    if (params.tools || params.toolChoice) {
      if (!this._clientCapabilities?.sampling?.tools) {
        throw new Error("Client does not support sampling tools capability.");
      }
    }
    if (params.messages.length > 0) {
      const lastMessage = params.messages[params.messages.length - 1];
      const lastContent = Array.isArray(lastMessage.content) ? lastMessage.content : [lastMessage.content];
      const hasToolResults = lastContent.some((c) => c.type === "tool_result");
      const previousMessage = params.messages.length > 1 ? params.messages[params.messages.length - 2] : void 0;
      const previousContent = previousMessage ? Array.isArray(previousMessage.content) ? previousMessage.content : [previousMessage.content] : [];
      const hasPreviousToolUse = previousContent.some((c) => c.type === "tool_use");
      if (hasToolResults) {
        if (lastContent.some((c) => c.type !== "tool_result")) {
          throw new Error("The last message must contain only tool_result content if any is present");
        }
        if (!hasPreviousToolUse) {
          throw new Error("tool_result blocks are not matching any tool_use from the previous message");
        }
      }
      if (hasPreviousToolUse) {
        const toolUseIds = new Set(previousContent.filter((c) => c.type === "tool_use").map((c) => c.id));
        const toolResultIds = new Set(lastContent.filter((c) => c.type === "tool_result").map((c) => c.toolUseId));
        if (toolUseIds.size !== toolResultIds.size || ![...toolUseIds].every((id) => toolResultIds.has(id))) {
          throw new Error("ids of tool_result blocks and tool_use blocks from previous message do not match");
        }
      }
    }
    if (params.tools) {
      return this.request({ method: "sampling/createMessage", params }, CreateMessageResultWithToolsSchema, options2);
    }
    return this.request({ method: "sampling/createMessage", params }, CreateMessageResultSchema, options2);
  }
  /**
   * Creates an elicitation request for the given parameters.
   * For backwards compatibility, `mode` may be omitted for form requests and will default to `'form'`.
   * @param params The parameters for the elicitation request.
   * @param options Optional request options.
   * @returns The result of the elicitation request.
   */
  async elicitInput(params, options2) {
    const mode = params.mode ?? "form";
    switch (mode) {
      case "url": {
        if (!this._clientCapabilities?.elicitation?.url) {
          throw new Error("Client does not support url elicitation.");
        }
        const urlParams = params;
        return this.request({ method: "elicitation/create", params: urlParams }, ElicitResultSchema, options2);
      }
      case "form": {
        if (!this._clientCapabilities?.elicitation?.form) {
          throw new Error("Client does not support form elicitation.");
        }
        const formParams = params.mode === "form" ? params : { ...params, mode: "form" };
        const result = await this.request({ method: "elicitation/create", params: formParams }, ElicitResultSchema, options2);
        if (result.action === "accept" && result.content && formParams.requestedSchema) {
          try {
            const validator = this._jsonSchemaValidator.getValidator(formParams.requestedSchema);
            const validationResult = validator(result.content);
            if (!validationResult.valid) {
              throw new McpError(ErrorCode.InvalidParams, `Elicitation response content does not match requested schema: ${validationResult.errorMessage}`);
            }
          } catch (error48) {
            if (error48 instanceof McpError) {
              throw error48;
            }
            throw new McpError(ErrorCode.InternalError, `Error validating elicitation response: ${error48 instanceof Error ? error48.message : String(error48)}`);
          }
        }
        return result;
      }
    }
  }
  /**
   * Creates a reusable callback that, when invoked, will send a `notifications/elicitation/complete`
   * notification for the specified elicitation ID.
   *
   * @param elicitationId The ID of the elicitation to mark as complete.
   * @param options Optional notification options. Useful when the completion notification should be related to a prior request.
   * @returns A function that emits the completion notification when awaited.
   */
  createElicitationCompletionNotifier(elicitationId, options2) {
    if (!this._clientCapabilities?.elicitation?.url) {
      throw new Error("Client does not support URL elicitation (required for notifications/elicitation/complete)");
    }
    return () => this.notification({
      method: "notifications/elicitation/complete",
      params: {
        elicitationId
      }
    }, options2);
  }
  async listRoots(params, options2) {
    return this.request({ method: "roots/list", params }, ListRootsResultSchema, options2);
  }
  /**
   * Sends a logging message to the client, if connected.
   * Note: You only need to send the parameters object, not the entire JSON RPC message
   * @see LoggingMessageNotification
   * @param params
   * @param sessionId optional for stateless and backward compatibility
   */
  async sendLoggingMessage(params, sessionId) {
    if (this._capabilities.logging) {
      if (!this.isMessageIgnored(params.level, sessionId)) {
        return this.notification({ method: "notifications/message", params });
      }
    }
  }
  async sendResourceUpdated(params) {
    return this.notification({
      method: "notifications/resources/updated",
      params
    });
  }
  async sendResourceListChanged() {
    return this.notification({
      method: "notifications/resources/list_changed"
    });
  }
  async sendToolListChanged() {
    return this.notification({ method: "notifications/tools/list_changed" });
  }
  async sendPromptListChanged() {
    return this.notification({ method: "notifications/prompts/list_changed" });
  }
};

// node_modules/eventsource-parser/dist/index.js
var ParseError = class extends Error {
  constructor(message, options2) {
    super(message), this.name = "ParseError", this.type = options2.type, this.field = options2.field, this.value = options2.value, this.line = options2.line;
  }
};
function noop(_arg) {
}
function createParser(callbacks) {
  if (typeof callbacks == "function")
    throw new TypeError(
      "`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?"
    );
  const { onEvent = noop, onError = noop, onRetry = noop, onComment } = callbacks;
  let incompleteLine = "", isFirstChunk = true, id, data = "", eventType = "";
  function feed(newChunk) {
    const chunk = isFirstChunk ? newChunk.replace(/^\xEF\xBB\xBF/, "") : newChunk, [complete, incomplete] = splitLines2(`${incompleteLine}${chunk}`);
    for (const line of complete)
      parseLine(line);
    incompleteLine = incomplete, isFirstChunk = false;
  }
  function parseLine(line) {
    if (line === "") {
      dispatchEvent();
      return;
    }
    if (line.startsWith(":")) {
      onComment && onComment(line.slice(line.startsWith(": ") ? 2 : 1));
      return;
    }
    const fieldSeparatorIndex = line.indexOf(":");
    if (fieldSeparatorIndex !== -1) {
      const field = line.slice(0, fieldSeparatorIndex), offset = line[fieldSeparatorIndex + 1] === " " ? 2 : 1, value = line.slice(fieldSeparatorIndex + offset);
      processField(field, value, line);
      return;
    }
    processField(line, "", line);
  }
  function processField(field, value, line) {
    switch (field) {
      case "event":
        eventType = value;
        break;
      case "data":
        data = `${data}${value}
`;
        break;
      case "id":
        id = value.includes("\0") ? void 0 : value;
        break;
      case "retry":
        /^\d+$/.test(value) ? onRetry(parseInt(value, 10)) : onError(
          new ParseError(`Invalid \`retry\` value: "${value}"`, {
            type: "invalid-retry",
            value,
            line
          })
        );
        break;
      default:
        onError(
          new ParseError(
            `Unknown field "${field.length > 20 ? `${field.slice(0, 20)}\u2026` : field}"`,
            { type: "unknown-field", field, value, line }
          )
        );
        break;
    }
  }
  function dispatchEvent() {
    data.length > 0 && onEvent({
      id,
      event: eventType || void 0,
      // If the data buffer's last character is a U+000A LINE FEED (LF) character,
      // then remove the last character from the data buffer.
      data: data.endsWith(`
`) ? data.slice(0, -1) : data
    }), id = void 0, data = "", eventType = "";
  }
  function reset(options2 = {}) {
    incompleteLine && options2.consume && parseLine(incompleteLine), isFirstChunk = true, id = void 0, data = "", eventType = "", incompleteLine = "";
  }
  return { feed, reset };
}
function splitLines2(chunk) {
  const lines = [];
  let incompleteLine = "", searchIndex = 0;
  for (; searchIndex < chunk.length; ) {
    const crIndex = chunk.indexOf("\r", searchIndex), lfIndex = chunk.indexOf(`
`, searchIndex);
    let lineEnd = -1;
    if (crIndex !== -1 && lfIndex !== -1 ? lineEnd = Math.min(crIndex, lfIndex) : crIndex !== -1 ? crIndex === chunk.length - 1 ? lineEnd = -1 : lineEnd = crIndex : lfIndex !== -1 && (lineEnd = lfIndex), lineEnd === -1) {
      incompleteLine = chunk.slice(searchIndex);
      break;
    } else {
      const line = chunk.slice(searchIndex, lineEnd);
      lines.push(line), searchIndex = lineEnd + 1, chunk[searchIndex - 1] === "\r" && chunk[searchIndex] === `
` && searchIndex++;
    }
  }
  return [lines, incompleteLine];
}

// node_modules/eventsource/dist/index.js
var ErrorEvent = class extends Event {
  /**
   * Constructs a new `ErrorEvent` instance. This is typically not called directly,
   * but rather emitted by the `EventSource` object when an error occurs.
   *
   * @param type - The type of the event (should be "error")
   * @param errorEventInitDict - Optional properties to include in the error event
   */
  constructor(type, errorEventInitDict) {
    var _a2, _b;
    super(type), this.code = (_a2 = errorEventInitDict == null ? void 0 : errorEventInitDict.code) != null ? _a2 : void 0, this.message = (_b = errorEventInitDict == null ? void 0 : errorEventInitDict.message) != null ? _b : void 0;
  }
  /**
   * Node.js "hides" the `message` and `code` properties of the `ErrorEvent` instance,
   * when it is `console.log`'ed. This makes it harder to debug errors. To ease debugging,
   * we explicitly include the properties in the `inspect` method.
   *
   * This is automatically called by Node.js when you `console.log` an instance of this class.
   *
   * @param _depth - The current depth
   * @param options - The options passed to `util.inspect`
   * @param inspect - The inspect function to use (prevents having to import it from `util`)
   * @returns A string representation of the error
   */
  [Symbol.for("nodejs.util.inspect.custom")](_depth, options2, inspect) {
    return inspect(inspectableError(this), options2);
  }
  /**
   * Deno "hides" the `message` and `code` properties of the `ErrorEvent` instance,
   * when it is `console.log`'ed. This makes it harder to debug errors. To ease debugging,
   * we explicitly include the properties in the `inspect` method.
   *
   * This is automatically called by Deno when you `console.log` an instance of this class.
   *
   * @param inspect - The inspect function to use (prevents having to import it from `util`)
   * @param options - The options passed to `Deno.inspect`
   * @returns A string representation of the error
   */
  [Symbol.for("Deno.customInspect")](inspect, options2) {
    return inspect(inspectableError(this), options2);
  }
};
function syntaxError(message) {
  const DomException = globalThis.DOMException;
  return typeof DomException == "function" ? new DomException(message, "SyntaxError") : new SyntaxError(message);
}
function flattenError2(err) {
  return err instanceof Error ? "errors" in err && Array.isArray(err.errors) ? err.errors.map(flattenError2).join(", ") : "cause" in err && err.cause instanceof Error ? `${err}: ${flattenError2(err.cause)}` : err.message : `${err}`;
}
function inspectableError(err) {
  return {
    type: err.type,
    message: err.message,
    code: err.code,
    defaultPrevented: err.defaultPrevented,
    cancelable: err.cancelable,
    timeStamp: err.timeStamp
  };
}
var __typeError = (msg) => {
  throw TypeError(msg);
};
var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), member.set(obj, value), value);
var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
var _readyState;
var _url2;
var _redirectUrl;
var _withCredentials;
var _fetch;
var _reconnectInterval;
var _reconnectTimer;
var _lastEventId;
var _controller;
var _parser;
var _onError;
var _onMessage;
var _onOpen;
var _EventSource_instances;
var connect_fn;
var _onFetchResponse;
var _onFetchError;
var getRequestOptions_fn;
var _onEvent;
var _onRetryChange;
var failConnection_fn;
var scheduleReconnect_fn;
var _reconnect;
var EventSource = class extends EventTarget {
  constructor(url2, eventSourceInitDict) {
    var _a2, _b;
    super(), __privateAdd(this, _EventSource_instances), this.CONNECTING = 0, this.OPEN = 1, this.CLOSED = 2, __privateAdd(this, _readyState), __privateAdd(this, _url2), __privateAdd(this, _redirectUrl), __privateAdd(this, _withCredentials), __privateAdd(this, _fetch), __privateAdd(this, _reconnectInterval), __privateAdd(this, _reconnectTimer), __privateAdd(this, _lastEventId, null), __privateAdd(this, _controller), __privateAdd(this, _parser), __privateAdd(this, _onError, null), __privateAdd(this, _onMessage, null), __privateAdd(this, _onOpen, null), __privateAdd(this, _onFetchResponse, async (response) => {
      var _a22;
      __privateGet(this, _parser).reset();
      const { body, redirected, status, headers } = response;
      if (status === 204) {
        __privateMethod(this, _EventSource_instances, failConnection_fn).call(this, "Server sent HTTP 204, not reconnecting", 204), this.close();
        return;
      }
      if (redirected ? __privateSet(this, _redirectUrl, new URL(response.url)) : __privateSet(this, _redirectUrl, void 0), status !== 200) {
        __privateMethod(this, _EventSource_instances, failConnection_fn).call(this, `Non-200 status code (${status})`, status);
        return;
      }
      if (!(headers.get("content-type") || "").startsWith("text/event-stream")) {
        __privateMethod(this, _EventSource_instances, failConnection_fn).call(this, 'Invalid content type, expected "text/event-stream"', status);
        return;
      }
      if (__privateGet(this, _readyState) === this.CLOSED)
        return;
      __privateSet(this, _readyState, this.OPEN);
      const openEvent = new Event("open");
      if ((_a22 = __privateGet(this, _onOpen)) == null || _a22.call(this, openEvent), this.dispatchEvent(openEvent), typeof body != "object" || !body || !("getReader" in body)) {
        __privateMethod(this, _EventSource_instances, failConnection_fn).call(this, "Invalid response body, expected a web ReadableStream", status), this.close();
        return;
      }
      const decoder = new TextDecoder(), reader = body.getReader();
      let open2 = true;
      do {
        const { done, value } = await reader.read();
        value && __privateGet(this, _parser).feed(decoder.decode(value, { stream: !done })), done && (open2 = false, __privateGet(this, _parser).reset(), __privateMethod(this, _EventSource_instances, scheduleReconnect_fn).call(this));
      } while (open2);
    }), __privateAdd(this, _onFetchError, (err) => {
      __privateSet(this, _controller, void 0), !(err.name === "AbortError" || err.type === "aborted") && __privateMethod(this, _EventSource_instances, scheduleReconnect_fn).call(this, flattenError2(err));
    }), __privateAdd(this, _onEvent, (event) => {
      typeof event.id == "string" && __privateSet(this, _lastEventId, event.id);
      const messageEvent = new MessageEvent(event.event || "message", {
        data: event.data,
        origin: __privateGet(this, _redirectUrl) ? __privateGet(this, _redirectUrl).origin : __privateGet(this, _url2).origin,
        lastEventId: event.id || ""
      });
      __privateGet(this, _onMessage) && (!event.event || event.event === "message") && __privateGet(this, _onMessage).call(this, messageEvent), this.dispatchEvent(messageEvent);
    }), __privateAdd(this, _onRetryChange, (value) => {
      __privateSet(this, _reconnectInterval, value);
    }), __privateAdd(this, _reconnect, () => {
      __privateSet(this, _reconnectTimer, void 0), __privateGet(this, _readyState) === this.CONNECTING && __privateMethod(this, _EventSource_instances, connect_fn).call(this);
    });
    try {
      if (url2 instanceof URL)
        __privateSet(this, _url2, url2);
      else if (typeof url2 == "string")
        __privateSet(this, _url2, new URL(url2, getBaseURL()));
      else
        throw new Error("Invalid URL");
    } catch {
      throw syntaxError("An invalid or illegal string was specified");
    }
    __privateSet(this, _parser, createParser({
      onEvent: __privateGet(this, _onEvent),
      onRetry: __privateGet(this, _onRetryChange)
    })), __privateSet(this, _readyState, this.CONNECTING), __privateSet(this, _reconnectInterval, 3e3), __privateSet(this, _fetch, (_a2 = eventSourceInitDict == null ? void 0 : eventSourceInitDict.fetch) != null ? _a2 : globalThis.fetch), __privateSet(this, _withCredentials, (_b = eventSourceInitDict == null ? void 0 : eventSourceInitDict.withCredentials) != null ? _b : false), __privateMethod(this, _EventSource_instances, connect_fn).call(this);
  }
  /**
   * Returns the state of this EventSource object's connection. It can have the values described below.
   *
   * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/readyState)
   *
   * Note: typed as `number` instead of `0 | 1 | 2` for compatibility with the `EventSource` interface,
   * defined in the TypeScript `dom` library.
   *
   * @public
   */
  get readyState() {
    return __privateGet(this, _readyState);
  }
  /**
   * Returns the URL providing the event stream.
   *
   * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/url)
   *
   * @public
   */
  get url() {
    return __privateGet(this, _url2).href;
  }
  /**
   * Returns true if the credentials mode for connection requests to the URL providing the event stream is set to "include", and false otherwise.
   *
   * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/withCredentials)
   */
  get withCredentials() {
    return __privateGet(this, _withCredentials);
  }
  /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/error_event) */
  get onerror() {
    return __privateGet(this, _onError);
  }
  set onerror(value) {
    __privateSet(this, _onError, value);
  }
  /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/message_event) */
  get onmessage() {
    return __privateGet(this, _onMessage);
  }
  set onmessage(value) {
    __privateSet(this, _onMessage, value);
  }
  /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/open_event) */
  get onopen() {
    return __privateGet(this, _onOpen);
  }
  set onopen(value) {
    __privateSet(this, _onOpen, value);
  }
  addEventListener(type, listener, options2) {
    const listen = listener;
    super.addEventListener(type, listen, options2);
  }
  removeEventListener(type, listener, options2) {
    const listen = listener;
    super.removeEventListener(type, listen, options2);
  }
  /**
   * Aborts any instances of the fetch algorithm started for this EventSource object, and sets the readyState attribute to CLOSED.
   *
   * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/close)
   *
   * @public
   */
  close() {
    __privateGet(this, _reconnectTimer) && clearTimeout(__privateGet(this, _reconnectTimer)), __privateGet(this, _readyState) !== this.CLOSED && (__privateGet(this, _controller) && __privateGet(this, _controller).abort(), __privateSet(this, _readyState, this.CLOSED), __privateSet(this, _controller, void 0));
  }
};
_readyState = /* @__PURE__ */ new WeakMap(), _url2 = /* @__PURE__ */ new WeakMap(), _redirectUrl = /* @__PURE__ */ new WeakMap(), _withCredentials = /* @__PURE__ */ new WeakMap(), _fetch = /* @__PURE__ */ new WeakMap(), _reconnectInterval = /* @__PURE__ */ new WeakMap(), _reconnectTimer = /* @__PURE__ */ new WeakMap(), _lastEventId = /* @__PURE__ */ new WeakMap(), _controller = /* @__PURE__ */ new WeakMap(), _parser = /* @__PURE__ */ new WeakMap(), _onError = /* @__PURE__ */ new WeakMap(), _onMessage = /* @__PURE__ */ new WeakMap(), _onOpen = /* @__PURE__ */ new WeakMap(), _EventSource_instances = /* @__PURE__ */ new WeakSet(), /**
* Connect to the given URL and start receiving events
*
* @internal
*/
connect_fn = function() {
  __privateSet(this, _readyState, this.CONNECTING), __privateSet(this, _controller, new AbortController()), __privateGet(this, _fetch)(__privateGet(this, _url2), __privateMethod(this, _EventSource_instances, getRequestOptions_fn).call(this)).then(__privateGet(this, _onFetchResponse)).catch(__privateGet(this, _onFetchError));
}, _onFetchResponse = /* @__PURE__ */ new WeakMap(), _onFetchError = /* @__PURE__ */ new WeakMap(), /**
* Get request options for the `fetch()` request
*
* @returns The request options
* @internal
*/
getRequestOptions_fn = function() {
  var _a2;
  const init = {
    // [spec] Let `corsAttributeState` be `Anonymous`â€¦
    // [spec] â€¦will have their mode set to "cors"â€¦
    mode: "cors",
    redirect: "follow",
    headers: { Accept: "text/event-stream", ...__privateGet(this, _lastEventId) ? { "Last-Event-ID": __privateGet(this, _lastEventId) } : void 0 },
    cache: "no-store",
    signal: (_a2 = __privateGet(this, _controller)) == null ? void 0 : _a2.signal
  };
  return "window" in globalThis && (init.credentials = this.withCredentials ? "include" : "same-origin"), init;
}, _onEvent = /* @__PURE__ */ new WeakMap(), _onRetryChange = /* @__PURE__ */ new WeakMap(), /**
* Handles the process referred to in the EventSource specification as "failing a connection".
*
* @param error - The error causing the connection to fail
* @param code - The HTTP status code, if available
* @internal
*/
failConnection_fn = function(message, code) {
  var _a2;
  __privateGet(this, _readyState) !== this.CLOSED && __privateSet(this, _readyState, this.CLOSED);
  const errorEvent = new ErrorEvent("error", { code, message });
  (_a2 = __privateGet(this, _onError)) == null || _a2.call(this, errorEvent), this.dispatchEvent(errorEvent);
}, /**
* Schedules a reconnection attempt against the EventSource endpoint.
*
* @param message - The error causing the connection to fail
* @param code - The HTTP status code, if available
* @internal
*/
scheduleReconnect_fn = function(message, code) {
  var _a2;
  if (__privateGet(this, _readyState) === this.CLOSED)
    return;
  __privateSet(this, _readyState, this.CONNECTING);
  const errorEvent = new ErrorEvent("error", { code, message });
  (_a2 = __privateGet(this, _onError)) == null || _a2.call(this, errorEvent), this.dispatchEvent(errorEvent), __privateSet(this, _reconnectTimer, setTimeout(__privateGet(this, _reconnect), __privateGet(this, _reconnectInterval)));
}, _reconnect = /* @__PURE__ */ new WeakMap(), /**
* ReadyState representing an EventSource currently trying to connect
*
* @public
*/
EventSource.CONNECTING = 0, /**
* ReadyState representing an EventSource connection that is open (eg connected)
*
* @public
*/
EventSource.OPEN = 1, /**
* ReadyState representing an EventSource connection that is closed (eg disconnected)
*
* @public
*/
EventSource.CLOSED = 2;
function getBaseURL() {
  const doc = "document" in globalThis ? globalThis.document : void 0;
  return doc && typeof doc == "object" && "baseURI" in doc && typeof doc.baseURI == "string" ? doc.baseURI : void 0;
}

// node_modules/@modelcontextprotocol/sdk/dist/esm/shared/transport.js
function normalizeHeaders(headers) {
  if (!headers)
    return {};
  if (headers instanceof Headers) {
    return Object.fromEntries(headers.entries());
  }
  if (Array.isArray(headers)) {
    return Object.fromEntries(headers);
  }
  return { ...headers };
}
function createFetchWithInit(baseFetch = fetch, baseInit) {
  if (!baseInit) {
    return baseFetch;
  }
  return async (url2, init) => {
    const mergedInit = {
      ...baseInit,
      ...init,
      // Headers need special handling - merge instead of replace
      headers: init?.headers ? { ...normalizeHeaders(baseInit.headers), ...normalizeHeaders(init.headers) } : baseInit.headers
    };
    return baseFetch(url2, mergedInit);
  };
}

// node_modules/pkce-challenge/dist/index.node.js
var crypto2;
crypto2 = globalThis.crypto?.webcrypto ?? // Node.js [18-16] REPL
globalThis.crypto ?? // Node.js >18
import("node:crypto").then((m) => m.webcrypto);
async function getRandomValues(size) {
  return (await crypto2).getRandomValues(new Uint8Array(size));
}
async function random(size) {
  const mask = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~";
  let result = "";
  const randomUints = await getRandomValues(size);
  for (let i = 0; i < size; i++) {
    const randomIndex = randomUints[i] % mask.length;
    result += mask[randomIndex];
  }
  return result;
}
async function generateVerifier(length) {
  return await random(length);
}
async function generateChallenge(code_verifier) {
  const buffer = await (await crypto2).subtle.digest("SHA-256", new TextEncoder().encode(code_verifier));
  return btoa(String.fromCharCode(...new Uint8Array(buffer))).replace(/\//g, "_").replace(/\+/g, "-").replace(/=/g, "");
}
async function pkceChallenge(length) {
  if (!length)
    length = 43;
  if (length < 43 || length > 128) {
    throw `Expected a length between 43 and 128. Received ${length}.`;
  }
  const verifier = await generateVerifier(length);
  const challenge = await generateChallenge(verifier);
  return {
    code_verifier: verifier,
    code_challenge: challenge
  };
}

// node_modules/@modelcontextprotocol/sdk/dist/esm/shared/auth.js
var SafeUrlSchema = url().superRefine((val, ctx) => {
  if (!URL.canParse(val)) {
    ctx.addIssue({
      code: ZodIssueCode.custom,
      message: "URL must be parseable",
      fatal: true
    });
    return NEVER;
  }
}).refine((url2) => {
  const u = new URL(url2);
  return u.protocol !== "javascript:" && u.protocol !== "data:" && u.protocol !== "vbscript:";
}, { message: "URL cannot use javascript:, data:, or vbscript: scheme" });
var OAuthProtectedResourceMetadataSchema = looseObject({
  resource: string2().url(),
  authorization_servers: array(SafeUrlSchema).optional(),
  jwks_uri: string2().url().optional(),
  scopes_supported: array(string2()).optional(),
  bearer_methods_supported: array(string2()).optional(),
  resource_signing_alg_values_supported: array(string2()).optional(),
  resource_name: string2().optional(),
  resource_documentation: string2().optional(),
  resource_policy_uri: string2().url().optional(),
  resource_tos_uri: string2().url().optional(),
  tls_client_certificate_bound_access_tokens: boolean2().optional(),
  authorization_details_types_supported: array(string2()).optional(),
  dpop_signing_alg_values_supported: array(string2()).optional(),
  dpop_bound_access_tokens_required: boolean2().optional()
});
var OAuthMetadataSchema = looseObject({
  issuer: string2(),
  authorization_endpoint: SafeUrlSchema,
  token_endpoint: SafeUrlSchema,
  registration_endpoint: SafeUrlSchema.optional(),
  scopes_supported: array(string2()).optional(),
  response_types_supported: array(string2()),
  response_modes_supported: array(string2()).optional(),
  grant_types_supported: array(string2()).optional(),
  token_endpoint_auth_methods_supported: array(string2()).optional(),
  token_endpoint_auth_signing_alg_values_supported: array(string2()).optional(),
  service_documentation: SafeUrlSchema.optional(),
  revocation_endpoint: SafeUrlSchema.optional(),
  revocation_endpoint_auth_methods_supported: array(string2()).optional(),
  revocation_endpoint_auth_signing_alg_values_supported: array(string2()).optional(),
  introspection_endpoint: string2().optional(),
  introspection_endpoint_auth_methods_supported: array(string2()).optional(),
  introspection_endpoint_auth_signing_alg_values_supported: array(string2()).optional(),
  code_challenge_methods_supported: array(string2()).optional(),
  client_id_metadata_document_supported: boolean2().optional()
});
var OpenIdProviderMetadataSchema = looseObject({
  issuer: string2(),
  authorization_endpoint: SafeUrlSchema,
  token_endpoint: SafeUrlSchema,
  userinfo_endpoint: SafeUrlSchema.optional(),
  jwks_uri: SafeUrlSchema,
  registration_endpoint: SafeUrlSchema.optional(),
  scopes_supported: array(string2()).optional(),
  response_types_supported: array(string2()),
  response_modes_supported: array(string2()).optional(),
  grant_types_supported: array(string2()).optional(),
  acr_values_supported: array(string2()).optional(),
  subject_types_supported: array(string2()),
  id_token_signing_alg_values_supported: array(string2()),
  id_token_encryption_alg_values_supported: array(string2()).optional(),
  id_token_encryption_enc_values_supported: array(string2()).optional(),
  userinfo_signing_alg_values_supported: array(string2()).optional(),
  userinfo_encryption_alg_values_supported: array(string2()).optional(),
  userinfo_encryption_enc_values_supported: array(string2()).optional(),
  request_object_signing_alg_values_supported: array(string2()).optional(),
  request_object_encryption_alg_values_supported: array(string2()).optional(),
  request_object_encryption_enc_values_supported: array(string2()).optional(),
  token_endpoint_auth_methods_supported: array(string2()).optional(),
  token_endpoint_auth_signing_alg_values_supported: array(string2()).optional(),
  display_values_supported: array(string2()).optional(),
  claim_types_supported: array(string2()).optional(),
  claims_supported: array(string2()).optional(),
  service_documentation: string2().optional(),
  claims_locales_supported: array(string2()).optional(),
  ui_locales_supported: array(string2()).optional(),
  claims_parameter_supported: boolean2().optional(),
  request_parameter_supported: boolean2().optional(),
  request_uri_parameter_supported: boolean2().optional(),
  require_request_uri_registration: boolean2().optional(),
  op_policy_uri: SafeUrlSchema.optional(),
  op_tos_uri: SafeUrlSchema.optional(),
  client_id_metadata_document_supported: boolean2().optional()
});
var OpenIdProviderDiscoveryMetadataSchema = object({
  ...OpenIdProviderMetadataSchema.shape,
  ...OAuthMetadataSchema.pick({
    code_challenge_methods_supported: true
  }).shape
});
var OAuthTokensSchema = object({
  access_token: string2(),
  id_token: string2().optional(),
  // Optional for OAuth 2.1, but necessary in OpenID Connect
  token_type: string2(),
  expires_in: coerce_exports.number().optional(),
  scope: string2().optional(),
  refresh_token: string2().optional()
}).strip();
var OAuthErrorResponseSchema = object({
  error: string2(),
  error_description: string2().optional(),
  error_uri: string2().optional()
});
var OptionalSafeUrlSchema = SafeUrlSchema.optional().or(literal("").transform(() => void 0));
var OAuthClientMetadataSchema = object({
  redirect_uris: array(SafeUrlSchema),
  token_endpoint_auth_method: string2().optional(),
  grant_types: array(string2()).optional(),
  response_types: array(string2()).optional(),
  client_name: string2().optional(),
  client_uri: SafeUrlSchema.optional(),
  logo_uri: OptionalSafeUrlSchema,
  scope: string2().optional(),
  contacts: array(string2()).optional(),
  tos_uri: OptionalSafeUrlSchema,
  policy_uri: string2().optional(),
  jwks_uri: SafeUrlSchema.optional(),
  jwks: any().optional(),
  software_id: string2().optional(),
  software_version: string2().optional(),
  software_statement: string2().optional()
}).strip();
var OAuthClientInformationSchema = object({
  client_id: string2(),
  client_secret: string2().optional(),
  client_id_issued_at: number2().optional(),
  client_secret_expires_at: number2().optional()
}).strip();
var OAuthClientInformationFullSchema = OAuthClientMetadataSchema.merge(OAuthClientInformationSchema);
var OAuthClientRegistrationErrorSchema = object({
  error: string2(),
  error_description: string2().optional()
}).strip();
var OAuthTokenRevocationRequestSchema = object({
  token: string2(),
  token_type_hint: string2().optional()
}).strip();

// node_modules/@modelcontextprotocol/sdk/dist/esm/shared/auth-utils.js
function resourceUrlFromServerUrl(url2) {
  const resourceURL = typeof url2 === "string" ? new URL(url2) : new URL(url2.href);
  resourceURL.hash = "";
  return resourceURL;
}
function checkResourceAllowed({ requestedResource, configuredResource }) {
  const requested = typeof requestedResource === "string" ? new URL(requestedResource) : new URL(requestedResource.href);
  const configured = typeof configuredResource === "string" ? new URL(configuredResource) : new URL(configuredResource.href);
  if (requested.origin !== configured.origin) {
    return false;
  }
  if (requested.pathname.length < configured.pathname.length) {
    return false;
  }
  const requestedPath = requested.pathname.endsWith("/") ? requested.pathname : requested.pathname + "/";
  const configuredPath = configured.pathname.endsWith("/") ? configured.pathname : configured.pathname + "/";
  return requestedPath.startsWith(configuredPath);
}

// node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/errors.js
var OAuthError = class extends Error {
  constructor(message, errorUri) {
    super(message);
    this.errorUri = errorUri;
    this.name = this.constructor.name;
  }
  /**
   * Converts the error to a standard OAuth error response object
   */
  toResponseObject() {
    const response = {
      error: this.errorCode,
      error_description: this.message
    };
    if (this.errorUri) {
      response.error_uri = this.errorUri;
    }
    return response;
  }
  get errorCode() {
    return this.constructor.errorCode;
  }
};
var InvalidRequestError = class extends OAuthError {
};
InvalidRequestError.errorCode = "invalid_request";
var InvalidClientError = class extends OAuthError {
};
InvalidClientError.errorCode = "invalid_client";
var InvalidGrantError = class extends OAuthError {
};
InvalidGrantError.errorCode = "invalid_grant";
var UnauthorizedClientError = class extends OAuthError {
};
UnauthorizedClientError.errorCode = "unauthorized_client";
var UnsupportedGrantTypeError = class extends OAuthError {
};
UnsupportedGrantTypeError.errorCode = "unsupported_grant_type";
var InvalidScopeError = class extends OAuthError {
};
InvalidScopeError.errorCode = "invalid_scope";
var AccessDeniedError = class extends OAuthError {
};
AccessDeniedError.errorCode = "access_denied";
var ServerError = class extends OAuthError {
};
ServerError.errorCode = "server_error";
var TemporarilyUnavailableError = class extends OAuthError {
};
TemporarilyUnavailableError.errorCode = "temporarily_unavailable";
var UnsupportedResponseTypeError = class extends OAuthError {
};
UnsupportedResponseTypeError.errorCode = "unsupported_response_type";
var UnsupportedTokenTypeError = class extends OAuthError {
};
UnsupportedTokenTypeError.errorCode = "unsupported_token_type";
var InvalidTokenError = class extends OAuthError {
};
InvalidTokenError.errorCode = "invalid_token";
var MethodNotAllowedError = class extends OAuthError {
};
MethodNotAllowedError.errorCode = "method_not_allowed";
var TooManyRequestsError = class extends OAuthError {
};
TooManyRequestsError.errorCode = "too_many_requests";
var InvalidClientMetadataError = class extends OAuthError {
};
InvalidClientMetadataError.errorCode = "invalid_client_metadata";
var InsufficientScopeError = class extends OAuthError {
};
InsufficientScopeError.errorCode = "insufficient_scope";
var InvalidTargetError = class extends OAuthError {
};
InvalidTargetError.errorCode = "invalid_target";
var OAUTH_ERRORS = {
  [InvalidRequestError.errorCode]: InvalidRequestError,
  [InvalidClientError.errorCode]: InvalidClientError,
  [InvalidGrantError.errorCode]: InvalidGrantError,
  [UnauthorizedClientError.errorCode]: UnauthorizedClientError,
  [UnsupportedGrantTypeError.errorCode]: UnsupportedGrantTypeError,
  [InvalidScopeError.errorCode]: InvalidScopeError,
  [AccessDeniedError.errorCode]: AccessDeniedError,
  [ServerError.errorCode]: ServerError,
  [TemporarilyUnavailableError.errorCode]: TemporarilyUnavailableError,
  [UnsupportedResponseTypeError.errorCode]: UnsupportedResponseTypeError,
  [UnsupportedTokenTypeError.errorCode]: UnsupportedTokenTypeError,
  [InvalidTokenError.errorCode]: InvalidTokenError,
  [MethodNotAllowedError.errorCode]: MethodNotAllowedError,
  [TooManyRequestsError.errorCode]: TooManyRequestsError,
  [InvalidClientMetadataError.errorCode]: InvalidClientMetadataError,
  [InsufficientScopeError.errorCode]: InsufficientScopeError,
  [InvalidTargetError.errorCode]: InvalidTargetError
};

// node_modules/@modelcontextprotocol/sdk/dist/esm/client/auth.js
var UnauthorizedError = class extends Error {
  constructor(message) {
    super(message ?? "Unauthorized");
  }
};
function isClientAuthMethod(method) {
  return ["client_secret_basic", "client_secret_post", "none"].includes(method);
}
var AUTHORIZATION_CODE_RESPONSE_TYPE = "code";
var AUTHORIZATION_CODE_CHALLENGE_METHOD = "S256";
function selectClientAuthMethod(clientInformation, supportedMethods) {
  const hasClientSecret = clientInformation.client_secret !== void 0;
  if ("token_endpoint_auth_method" in clientInformation && clientInformation.token_endpoint_auth_method && isClientAuthMethod(clientInformation.token_endpoint_auth_method) && (supportedMethods.length === 0 || supportedMethods.includes(clientInformation.token_endpoint_auth_method))) {
    return clientInformation.token_endpoint_auth_method;
  }
  if (supportedMethods.length === 0) {
    return hasClientSecret ? "client_secret_basic" : "none";
  }
  if (hasClientSecret && supportedMethods.includes("client_secret_basic")) {
    return "client_secret_basic";
  }
  if (hasClientSecret && supportedMethods.includes("client_secret_post")) {
    return "client_secret_post";
  }
  if (supportedMethods.includes("none")) {
    return "none";
  }
  return hasClientSecret ? "client_secret_post" : "none";
}
function applyClientAuthentication(method, clientInformation, headers, params) {
  const { client_id, client_secret } = clientInformation;
  switch (method) {
    case "client_secret_basic":
      applyBasicAuth(client_id, client_secret, headers);
      return;
    case "client_secret_post":
      applyPostAuth(client_id, client_secret, params);
      return;
    case "none":
      applyPublicAuth(client_id, params);
      return;
    default:
      throw new Error(`Unsupported client authentication method: ${method}`);
  }
}
function applyBasicAuth(clientId, clientSecret, headers) {
  if (!clientSecret) {
    throw new Error("client_secret_basic authentication requires a client_secret");
  }
  const credentials = btoa(`${clientId}:${clientSecret}`);
  headers.set("Authorization", `Basic ${credentials}`);
}
function applyPostAuth(clientId, clientSecret, params) {
  params.set("client_id", clientId);
  if (clientSecret) {
    params.set("client_secret", clientSecret);
  }
}
function applyPublicAuth(clientId, params) {
  params.set("client_id", clientId);
}
async function parseErrorResponse(input) {
  const statusCode = input instanceof Response ? input.status : void 0;
  const body = input instanceof Response ? await input.text() : input;
  try {
    const result = OAuthErrorResponseSchema.parse(JSON.parse(body));
    const { error: error48, error_description, error_uri } = result;
    const errorClass = OAUTH_ERRORS[error48] || ServerError;
    return new errorClass(error_description || "", error_uri);
  } catch (error48) {
    const errorMessage = `${statusCode ? `HTTP ${statusCode}: ` : ""}Invalid OAuth error response: ${error48}. Raw body: ${body}`;
    return new ServerError(errorMessage);
  }
}
async function auth(provider, options2) {
  try {
    return await authInternal(provider, options2);
  } catch (error48) {
    if (error48 instanceof InvalidClientError || error48 instanceof UnauthorizedClientError) {
      await provider.invalidateCredentials?.("all");
      return await authInternal(provider, options2);
    } else if (error48 instanceof InvalidGrantError) {
      await provider.invalidateCredentials?.("tokens");
      return await authInternal(provider, options2);
    }
    throw error48;
  }
}
async function authInternal(provider, { serverUrl, authorizationCode, scope, resourceMetadataUrl, fetchFn }) {
  const cachedState = await provider.discoveryState?.();
  let resourceMetadata;
  let authorizationServerUrl;
  let metadata;
  let effectiveResourceMetadataUrl = resourceMetadataUrl;
  if (!effectiveResourceMetadataUrl && cachedState?.resourceMetadataUrl) {
    effectiveResourceMetadataUrl = new URL(cachedState.resourceMetadataUrl);
  }
  if (cachedState?.authorizationServerUrl) {
    authorizationServerUrl = cachedState.authorizationServerUrl;
    resourceMetadata = cachedState.resourceMetadata;
    metadata = cachedState.authorizationServerMetadata ?? await discoverAuthorizationServerMetadata(authorizationServerUrl, { fetchFn });
    if (!resourceMetadata) {
      try {
        resourceMetadata = await discoverOAuthProtectedResourceMetadata(serverUrl, { resourceMetadataUrl: effectiveResourceMetadataUrl }, fetchFn);
      } catch {
      }
    }
    if (metadata !== cachedState.authorizationServerMetadata || resourceMetadata !== cachedState.resourceMetadata) {
      await provider.saveDiscoveryState?.({
        authorizationServerUrl: String(authorizationServerUrl),
        resourceMetadataUrl: effectiveResourceMetadataUrl?.toString(),
        resourceMetadata,
        authorizationServerMetadata: metadata
      });
    }
  } else {
    const serverInfo = await discoverOAuthServerInfo(serverUrl, { resourceMetadataUrl: effectiveResourceMetadataUrl, fetchFn });
    authorizationServerUrl = serverInfo.authorizationServerUrl;
    metadata = serverInfo.authorizationServerMetadata;
    resourceMetadata = serverInfo.resourceMetadata;
    await provider.saveDiscoveryState?.({
      authorizationServerUrl: String(authorizationServerUrl),
      resourceMetadataUrl: effectiveResourceMetadataUrl?.toString(),
      resourceMetadata,
      authorizationServerMetadata: metadata
    });
  }
  const resource = await selectResourceURL(serverUrl, provider, resourceMetadata);
  const resolvedScope = scope || resourceMetadata?.scopes_supported?.join(" ") || provider.clientMetadata.scope;
  let clientInformation = await Promise.resolve(provider.clientInformation());
  if (!clientInformation) {
    if (authorizationCode !== void 0) {
      throw new Error("Existing OAuth client information is required when exchanging an authorization code");
    }
    const supportsUrlBasedClientId = metadata?.client_id_metadata_document_supported === true;
    const clientMetadataUrl = provider.clientMetadataUrl;
    if (clientMetadataUrl && !isHttpsUrl(clientMetadataUrl)) {
      throw new InvalidClientMetadataError(`clientMetadataUrl must be a valid HTTPS URL with a non-root pathname, got: ${clientMetadataUrl}`);
    }
    const shouldUseUrlBasedClientId = supportsUrlBasedClientId && clientMetadataUrl;
    if (shouldUseUrlBasedClientId) {
      clientInformation = {
        client_id: clientMetadataUrl
      };
      await provider.saveClientInformation?.(clientInformation);
    } else {
      if (!provider.saveClientInformation) {
        throw new Error("OAuth client information must be saveable for dynamic registration");
      }
      const fullInformation = await registerClient(authorizationServerUrl, {
        metadata,
        clientMetadata: provider.clientMetadata,
        scope: resolvedScope,
        fetchFn
      });
      await provider.saveClientInformation(fullInformation);
      clientInformation = fullInformation;
    }
  }
  const nonInteractiveFlow = !provider.redirectUrl;
  if (authorizationCode !== void 0 || nonInteractiveFlow) {
    const tokens2 = await fetchToken(provider, authorizationServerUrl, {
      metadata,
      resource,
      authorizationCode,
      fetchFn
    });
    await provider.saveTokens(tokens2);
    return "AUTHORIZED";
  }
  const tokens = await provider.tokens();
  if (tokens?.refresh_token) {
    try {
      const newTokens = await refreshAuthorization(authorizationServerUrl, {
        metadata,
        clientInformation,
        refreshToken: tokens.refresh_token,
        resource,
        addClientAuthentication: provider.addClientAuthentication,
        fetchFn
      });
      await provider.saveTokens(newTokens);
      return "AUTHORIZED";
    } catch (error48) {
      if (!(error48 instanceof OAuthError) || error48 instanceof ServerError) {
      } else {
        throw error48;
      }
    }
  }
  const state = provider.state ? await provider.state() : void 0;
  const { authorizationUrl, codeVerifier } = await startAuthorization(authorizationServerUrl, {
    metadata,
    clientInformation,
    state,
    redirectUrl: provider.redirectUrl,
    scope: resolvedScope,
    resource
  });
  await provider.saveCodeVerifier(codeVerifier);
  await provider.redirectToAuthorization(authorizationUrl);
  return "REDIRECT";
}
function isHttpsUrl(value) {
  if (!value)
    return false;
  try {
    const url2 = new URL(value);
    return url2.protocol === "https:" && url2.pathname !== "/";
  } catch {
    return false;
  }
}
async function selectResourceURL(serverUrl, provider, resourceMetadata) {
  const defaultResource = resourceUrlFromServerUrl(serverUrl);
  if (provider.validateResourceURL) {
    return await provider.validateResourceURL(defaultResource, resourceMetadata?.resource);
  }
  if (!resourceMetadata) {
    return void 0;
  }
  if (!checkResourceAllowed({ requestedResource: defaultResource, configuredResource: resourceMetadata.resource })) {
    throw new Error(`Protected resource ${resourceMetadata.resource} does not match expected ${defaultResource} (or origin)`);
  }
  return new URL(resourceMetadata.resource);
}
function extractWWWAuthenticateParams(res) {
  const authenticateHeader = res.headers.get("WWW-Authenticate");
  if (!authenticateHeader) {
    return {};
  }
  const [type, scheme] = authenticateHeader.split(" ");
  if (type.toLowerCase() !== "bearer" || !scheme) {
    return {};
  }
  const resourceMetadataMatch = extractFieldFromWwwAuth(res, "resource_metadata") || void 0;
  let resourceMetadataUrl;
  if (resourceMetadataMatch) {
    try {
      resourceMetadataUrl = new URL(resourceMetadataMatch);
    } catch {
    }
  }
  const scope = extractFieldFromWwwAuth(res, "scope") || void 0;
  const error48 = extractFieldFromWwwAuth(res, "error") || void 0;
  return {
    resourceMetadataUrl,
    scope,
    error: error48
  };
}
function extractFieldFromWwwAuth(response, fieldName) {
  const wwwAuthHeader = response.headers.get("WWW-Authenticate");
  if (!wwwAuthHeader) {
    return null;
  }
  const pattern = new RegExp(`${fieldName}=(?:"([^"]+)"|([^\\s,]+))`);
  const match = wwwAuthHeader.match(pattern);
  if (match) {
    return match[1] || match[2];
  }
  return null;
}
async function discoverOAuthProtectedResourceMetadata(serverUrl, opts, fetchFn = fetch) {
  const response = await discoverMetadataWithFallback(serverUrl, "oauth-protected-resource", fetchFn, {
    protocolVersion: opts?.protocolVersion,
    metadataUrl: opts?.resourceMetadataUrl
  });
  if (!response || response.status === 404) {
    await response?.body?.cancel();
    throw new Error(`Resource server does not implement OAuth 2.0 Protected Resource Metadata.`);
  }
  if (!response.ok) {
    await response.body?.cancel();
    throw new Error(`HTTP ${response.status} trying to load well-known OAuth protected resource metadata.`);
  }
  return OAuthProtectedResourceMetadataSchema.parse(await response.json());
}
async function fetchWithCorsRetry(url2, headers, fetchFn = fetch) {
  try {
    return await fetchFn(url2, { headers });
  } catch (error48) {
    if (error48 instanceof TypeError) {
      if (headers) {
        return fetchWithCorsRetry(url2, void 0, fetchFn);
      } else {
        return void 0;
      }
    }
    throw error48;
  }
}
function buildWellKnownPath(wellKnownPrefix, pathname = "", options2 = {}) {
  if (pathname.endsWith("/")) {
    pathname = pathname.slice(0, -1);
  }
  return options2.prependPathname ? `${pathname}/.well-known/${wellKnownPrefix}` : `/.well-known/${wellKnownPrefix}${pathname}`;
}
async function tryMetadataDiscovery(url2, protocolVersion, fetchFn = fetch) {
  const headers = {
    "MCP-Protocol-Version": protocolVersion
  };
  return await fetchWithCorsRetry(url2, headers, fetchFn);
}
function shouldAttemptFallback(response, pathname) {
  return !response || response.status >= 400 && response.status < 500 && pathname !== "/";
}
async function discoverMetadataWithFallback(serverUrl, wellKnownType, fetchFn, opts) {
  const issuer = new URL(serverUrl);
  const protocolVersion = opts?.protocolVersion ?? LATEST_PROTOCOL_VERSION;
  let url2;
  if (opts?.metadataUrl) {
    url2 = new URL(opts.metadataUrl);
  } else {
    const wellKnownPath = buildWellKnownPath(wellKnownType, issuer.pathname);
    url2 = new URL(wellKnownPath, opts?.metadataServerUrl ?? issuer);
    url2.search = issuer.search;
  }
  let response = await tryMetadataDiscovery(url2, protocolVersion, fetchFn);
  if (!opts?.metadataUrl && shouldAttemptFallback(response, issuer.pathname)) {
    const rootUrl = new URL(`/.well-known/${wellKnownType}`, issuer);
    response = await tryMetadataDiscovery(rootUrl, protocolVersion, fetchFn);
  }
  return response;
}
function buildDiscoveryUrls(authorizationServerUrl) {
  const url2 = typeof authorizationServerUrl === "string" ? new URL(authorizationServerUrl) : authorizationServerUrl;
  const hasPath = url2.pathname !== "/";
  const urlsToTry = [];
  if (!hasPath) {
    urlsToTry.push({
      url: new URL("/.well-known/oauth-authorization-server", url2.origin),
      type: "oauth"
    });
    urlsToTry.push({
      url: new URL(`/.well-known/openid-configuration`, url2.origin),
      type: "oidc"
    });
    return urlsToTry;
  }
  let pathname = url2.pathname;
  if (pathname.endsWith("/")) {
    pathname = pathname.slice(0, -1);
  }
  urlsToTry.push({
    url: new URL(`/.well-known/oauth-authorization-server${pathname}`, url2.origin),
    type: "oauth"
  });
  urlsToTry.push({
    url: new URL(`/.well-known/openid-configuration${pathname}`, url2.origin),
    type: "oidc"
  });
  urlsToTry.push({
    url: new URL(`${pathname}/.well-known/openid-configuration`, url2.origin),
    type: "oidc"
  });
  return urlsToTry;
}
async function discoverAuthorizationServerMetadata(authorizationServerUrl, { fetchFn = fetch, protocolVersion = LATEST_PROTOCOL_VERSION } = {}) {
  const headers = {
    "MCP-Protocol-Version": protocolVersion,
    Accept: "application/json"
  };
  const urlsToTry = buildDiscoveryUrls(authorizationServerUrl);
  for (const { url: endpointUrl, type } of urlsToTry) {
    const response = await fetchWithCorsRetry(endpointUrl, headers, fetchFn);
    if (!response) {
      continue;
    }
    if (!response.ok) {
      await response.body?.cancel();
      if (response.status >= 400 && response.status < 500) {
        continue;
      }
      throw new Error(`HTTP ${response.status} trying to load ${type === "oauth" ? "OAuth" : "OpenID provider"} metadata from ${endpointUrl}`);
    }
    if (type === "oauth") {
      return OAuthMetadataSchema.parse(await response.json());
    } else {
      return OpenIdProviderDiscoveryMetadataSchema.parse(await response.json());
    }
  }
  return void 0;
}
async function discoverOAuthServerInfo(serverUrl, opts) {
  let resourceMetadata;
  let authorizationServerUrl;
  try {
    resourceMetadata = await discoverOAuthProtectedResourceMetadata(serverUrl, { resourceMetadataUrl: opts?.resourceMetadataUrl }, opts?.fetchFn);
    if (resourceMetadata.authorization_servers && resourceMetadata.authorization_servers.length > 0) {
      authorizationServerUrl = resourceMetadata.authorization_servers[0];
    }
  } catch {
  }
  if (!authorizationServerUrl) {
    authorizationServerUrl = String(new URL("/", serverUrl));
  }
  const authorizationServerMetadata = await discoverAuthorizationServerMetadata(authorizationServerUrl, { fetchFn: opts?.fetchFn });
  return {
    authorizationServerUrl,
    authorizationServerMetadata,
    resourceMetadata
  };
}
async function startAuthorization(authorizationServerUrl, { metadata, clientInformation, redirectUrl, scope, state, resource }) {
  let authorizationUrl;
  if (metadata) {
    authorizationUrl = new URL(metadata.authorization_endpoint);
    if (!metadata.response_types_supported.includes(AUTHORIZATION_CODE_RESPONSE_TYPE)) {
      throw new Error(`Incompatible auth server: does not support response type ${AUTHORIZATION_CODE_RESPONSE_TYPE}`);
    }
    if (metadata.code_challenge_methods_supported && !metadata.code_challenge_methods_supported.includes(AUTHORIZATION_CODE_CHALLENGE_METHOD)) {
      throw new Error(`Incompatible auth server: does not support code challenge method ${AUTHORIZATION_CODE_CHALLENGE_METHOD}`);
    }
  } else {
    authorizationUrl = new URL("/authorize", authorizationServerUrl);
  }
  const challenge = await pkceChallenge();
  const codeVerifier = challenge.code_verifier;
  const codeChallenge = challenge.code_challenge;
  authorizationUrl.searchParams.set("response_type", AUTHORIZATION_CODE_RESPONSE_TYPE);
  authorizationUrl.searchParams.set("client_id", clientInformation.client_id);
  authorizationUrl.searchParams.set("code_challenge", codeChallenge);
  authorizationUrl.searchParams.set("code_challenge_method", AUTHORIZATION_CODE_CHALLENGE_METHOD);
  authorizationUrl.searchParams.set("redirect_uri", String(redirectUrl));
  if (state) {
    authorizationUrl.searchParams.set("state", state);
  }
  if (scope) {
    authorizationUrl.searchParams.set("scope", scope);
  }
  if (scope?.includes("offline_access")) {
    authorizationUrl.searchParams.append("prompt", "consent");
  }
  if (resource) {
    authorizationUrl.searchParams.set("resource", resource.href);
  }
  return { authorizationUrl, codeVerifier };
}
function prepareAuthorizationCodeRequest(authorizationCode, codeVerifier, redirectUri) {
  return new URLSearchParams({
    grant_type: "authorization_code",
    code: authorizationCode,
    code_verifier: codeVerifier,
    redirect_uri: String(redirectUri)
  });
}
async function executeTokenRequest(authorizationServerUrl, { metadata, tokenRequestParams, clientInformation, addClientAuthentication, resource, fetchFn }) {
  const tokenUrl = metadata?.token_endpoint ? new URL(metadata.token_endpoint) : new URL("/token", authorizationServerUrl);
  const headers = new Headers({
    "Content-Type": "application/x-www-form-urlencoded",
    Accept: "application/json"
  });
  if (resource) {
    tokenRequestParams.set("resource", resource.href);
  }
  if (addClientAuthentication) {
    await addClientAuthentication(headers, tokenRequestParams, tokenUrl, metadata);
  } else if (clientInformation) {
    const supportedMethods = metadata?.token_endpoint_auth_methods_supported ?? [];
    const authMethod = selectClientAuthMethod(clientInformation, supportedMethods);
    applyClientAuthentication(authMethod, clientInformation, headers, tokenRequestParams);
  }
  const response = await (fetchFn ?? fetch)(tokenUrl, {
    method: "POST",
    headers,
    body: tokenRequestParams
  });
  if (!response.ok) {
    throw await parseErrorResponse(response);
  }
  return OAuthTokensSchema.parse(await response.json());
}
async function refreshAuthorization(authorizationServerUrl, { metadata, clientInformation, refreshToken, resource, addClientAuthentication, fetchFn }) {
  const tokenRequestParams = new URLSearchParams({
    grant_type: "refresh_token",
    refresh_token: refreshToken
  });
  const tokens = await executeTokenRequest(authorizationServerUrl, {
    metadata,
    tokenRequestParams,
    clientInformation,
    addClientAuthentication,
    resource,
    fetchFn
  });
  return { refresh_token: refreshToken, ...tokens };
}
async function fetchToken(provider, authorizationServerUrl, { metadata, resource, authorizationCode, fetchFn } = {}) {
  const scope = provider.clientMetadata.scope;
  let tokenRequestParams;
  if (provider.prepareTokenRequest) {
    tokenRequestParams = await provider.prepareTokenRequest(scope);
  }
  if (!tokenRequestParams) {
    if (!authorizationCode) {
      throw new Error("Either provider.prepareTokenRequest() or authorizationCode is required");
    }
    if (!provider.redirectUrl) {
      throw new Error("redirectUrl is required for authorization_code flow");
    }
    const codeVerifier = await provider.codeVerifier();
    tokenRequestParams = prepareAuthorizationCodeRequest(authorizationCode, codeVerifier, provider.redirectUrl);
  }
  const clientInformation = await provider.clientInformation();
  return executeTokenRequest(authorizationServerUrl, {
    metadata,
    tokenRequestParams,
    clientInformation: clientInformation ?? void 0,
    addClientAuthentication: provider.addClientAuthentication,
    resource,
    fetchFn
  });
}
async function registerClient(authorizationServerUrl, { metadata, clientMetadata, scope, fetchFn }) {
  let registrationUrl;
  if (metadata) {
    if (!metadata.registration_endpoint) {
      throw new Error("Incompatible auth server: does not support dynamic client registration");
    }
    registrationUrl = new URL(metadata.registration_endpoint);
  } else {
    registrationUrl = new URL("/register", authorizationServerUrl);
  }
  const response = await (fetchFn ?? fetch)(registrationUrl, {
    method: "POST",
    headers: {
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      ...clientMetadata,
      ...scope !== void 0 ? { scope } : {}
    })
  });
  if (!response.ok) {
    throw await parseErrorResponse(response);
  }
  return OAuthClientInformationFullSchema.parse(await response.json());
}

// node_modules/@modelcontextprotocol/sdk/dist/esm/client/sse.js
var SseError = class extends Error {
  constructor(code, message, event) {
    super(`SSE error: ${message}`);
    this.code = code;
    this.event = event;
  }
};
var SSEClientTransport = class {
  constructor(url2, opts) {
    this._url = url2;
    this._resourceMetadataUrl = void 0;
    this._scope = void 0;
    this._eventSourceInit = opts?.eventSourceInit;
    this._requestInit = opts?.requestInit;
    this._authProvider = opts?.authProvider;
    this._fetch = opts?.fetch;
    this._fetchWithInit = createFetchWithInit(opts?.fetch, opts?.requestInit);
  }
  async _authThenStart() {
    if (!this._authProvider) {
      throw new UnauthorizedError("No auth provider");
    }
    let result;
    try {
      result = await auth(this._authProvider, {
        serverUrl: this._url,
        resourceMetadataUrl: this._resourceMetadataUrl,
        scope: this._scope,
        fetchFn: this._fetchWithInit
      });
    } catch (error48) {
      this.onerror?.(error48);
      throw error48;
    }
    if (result !== "AUTHORIZED") {
      throw new UnauthorizedError();
    }
    return await this._startOrAuth();
  }
  async _commonHeaders() {
    const headers = {};
    if (this._authProvider) {
      const tokens = await this._authProvider.tokens();
      if (tokens) {
        headers["Authorization"] = `Bearer ${tokens.access_token}`;
      }
    }
    if (this._protocolVersion) {
      headers["mcp-protocol-version"] = this._protocolVersion;
    }
    const extraHeaders = normalizeHeaders(this._requestInit?.headers);
    return new Headers({
      ...headers,
      ...extraHeaders
    });
  }
  _startOrAuth() {
    const fetchImpl = this?._eventSourceInit?.fetch ?? this._fetch ?? fetch;
    return new Promise((resolve, reject) => {
      this._eventSource = new EventSource(this._url.href, {
        ...this._eventSourceInit,
        fetch: async (url2, init) => {
          const headers = await this._commonHeaders();
          headers.set("Accept", "text/event-stream");
          const response = await fetchImpl(url2, {
            ...init,
            headers
          });
          if (response.status === 401 && response.headers.has("www-authenticate")) {
            const { resourceMetadataUrl, scope } = extractWWWAuthenticateParams(response);
            this._resourceMetadataUrl = resourceMetadataUrl;
            this._scope = scope;
          }
          return response;
        }
      });
      this._abortController = new AbortController();
      this._eventSource.onerror = (event) => {
        if (event.code === 401 && this._authProvider) {
          this._authThenStart().then(resolve, reject);
          return;
        }
        const error48 = new SseError(event.code, event.message, event);
        reject(error48);
        this.onerror?.(error48);
      };
      this._eventSource.onopen = () => {
      };
      this._eventSource.addEventListener("endpoint", (event) => {
        const messageEvent = event;
        try {
          this._endpoint = new URL(messageEvent.data, this._url);
          if (this._endpoint.origin !== this._url.origin) {
            throw new Error(`Endpoint origin does not match connection origin: ${this._endpoint.origin}`);
          }
        } catch (error48) {
          reject(error48);
          this.onerror?.(error48);
          void this.close();
          return;
        }
        resolve();
      });
      this._eventSource.onmessage = (event) => {
        const messageEvent = event;
        let message;
        try {
          message = JSONRPCMessageSchema.parse(JSON.parse(messageEvent.data));
        } catch (error48) {
          this.onerror?.(error48);
          return;
        }
        this.onmessage?.(message);
      };
    });
  }
  async start() {
    if (this._eventSource) {
      throw new Error("SSEClientTransport already started! If using Client class, note that connect() calls start() automatically.");
    }
    return await this._startOrAuth();
  }
  /**
   * Call this method after the user has finished authorizing via their user agent and is redirected back to the MCP client application. This will exchange the authorization code for an access token, enabling the next connection attempt to successfully auth.
   */
  async finishAuth(authorizationCode) {
    if (!this._authProvider) {
      throw new UnauthorizedError("No auth provider");
    }
    const result = await auth(this._authProvider, {
      serverUrl: this._url,
      authorizationCode,
      resourceMetadataUrl: this._resourceMetadataUrl,
      scope: this._scope,
      fetchFn: this._fetchWithInit
    });
    if (result !== "AUTHORIZED") {
      throw new UnauthorizedError("Failed to authorize");
    }
  }
  async close() {
    this._abortController?.abort();
    this._eventSource?.close();
    this.onclose?.();
  }
  async send(message) {
    if (!this._endpoint) {
      throw new Error("Not connected");
    }
    try {
      const headers = await this._commonHeaders();
      headers.set("content-type", "application/json");
      const init = {
        ...this._requestInit,
        method: "POST",
        headers,
        body: JSON.stringify(message),
        signal: this._abortController?.signal
      };
      const response = await (this._fetch ?? fetch)(this._endpoint, init);
      if (!response.ok) {
        const text = await response.text().catch(() => null);
        if (response.status === 401 && this._authProvider) {
          const { resourceMetadataUrl, scope } = extractWWWAuthenticateParams(response);
          this._resourceMetadataUrl = resourceMetadataUrl;
          this._scope = scope;
          const result = await auth(this._authProvider, {
            serverUrl: this._url,
            resourceMetadataUrl: this._resourceMetadataUrl,
            scope: this._scope,
            fetchFn: this._fetchWithInit
          });
          if (result !== "AUTHORIZED") {
            throw new UnauthorizedError();
          }
          return this.send(message);
        }
        throw new Error(`Error POSTing to endpoint (HTTP ${response.status}): ${text}`);
      }
      await response.body?.cancel();
    } catch (error48) {
      this.onerror?.(error48);
      throw error48;
    }
  }
  setProtocolVersion(version2) {
    this._protocolVersion = version2;
  }
};

// node_modules/@modelcontextprotocol/sdk/dist/esm/server/sse.js
var import_node_crypto = require("node:crypto");
var import_node_tls = require("node:tls");

// utils/build/raw-body.ts
var import_bytes = __toESM(require_bytes());
function getRawBody(req, { limit, encoding }) {
  const limitNumber = import_bytes.default.parse(limit);
  return new Promise((resolve, reject) => {
    let received = 0;
    const chunks = [];
    req.on("data", (chunk) => {
      received += chunk.length;
      if (received > limitNumber)
        return reject(new Error(`Message size exceeds limit of ${limit} bytes`));
      chunks.push(chunk);
    });
    req.on("end", () => {
      try {
        resolve(Buffer.concat(chunks).toString(encoding));
      } catch (error48) {
        reject(error48);
      }
    });
    req.on("error", (error48) => {
      reject(error48);
    });
  });
}

// node_modules/@modelcontextprotocol/sdk/dist/esm/server/sse.js
var import_content_type = __toESM(require_content_type(), 1);
var import_node_url = require("node:url");
var MAXIMUM_MESSAGE_SIZE = "4mb";
var SSEServerTransport = class {
  /**
   * Creates a new SSE server transport, which will direct the client to POST messages to the relative or absolute URL identified by `_endpoint`.
   */
  constructor(_endpoint, res, options2) {
    this._endpoint = _endpoint;
    this.res = res;
    this._sessionId = (0, import_node_crypto.randomUUID)();
    this._options = options2 || { enableDnsRebindingProtection: false };
  }
  /**
   * Validates request headers for DNS rebinding protection.
   * @returns Error message if validation fails, undefined if validation passes.
   */
  validateRequestHeaders(req) {
    if (!this._options.enableDnsRebindingProtection) {
      return void 0;
    }
    if (this._options.allowedHosts && this._options.allowedHosts.length > 0) {
      const hostHeader = req.headers.host;
      if (!hostHeader || !this._options.allowedHosts.includes(hostHeader)) {
        return `Invalid Host header: ${hostHeader}`;
      }
    }
    if (this._options.allowedOrigins && this._options.allowedOrigins.length > 0) {
      const originHeader = req.headers.origin;
      if (originHeader && !this._options.allowedOrigins.includes(originHeader)) {
        return `Invalid Origin header: ${originHeader}`;
      }
    }
    return void 0;
  }
  /**
   * Handles the initial SSE connection request.
   *
   * This should be called when a GET request is made to establish the SSE stream.
   */
  async start() {
    if (this._sseResponse) {
      throw new Error("SSEServerTransport already started! If using Server class, note that connect() calls start() automatically.");
    }
    this.res.writeHead(200, {
      "Content-Type": "text/event-stream",
      "Cache-Control": "no-cache, no-transform",
      Connection: "keep-alive"
    });
    const dummyBase = "http://localhost";
    const endpointUrl = new import_node_url.URL(this._endpoint, dummyBase);
    endpointUrl.searchParams.set("sessionId", this._sessionId);
    const relativeUrlWithSession = endpointUrl.pathname + endpointUrl.search + endpointUrl.hash;
    this.res.write(`event: endpoint
data: ${relativeUrlWithSession}

`);
    this._sseResponse = this.res;
    this.res.on("close", () => {
      this._sseResponse = void 0;
      this.onclose?.();
    });
  }
  /**
   * Handles incoming POST messages.
   *
   * This should be called when a POST request is made to send a message to the server.
   */
  async handlePostMessage(req, res, parsedBody) {
    if (!this._sseResponse) {
      const message = "SSE connection not established";
      res.writeHead(500).end(message);
      throw new Error(message);
    }
    const validationError = this.validateRequestHeaders(req);
    if (validationError) {
      res.writeHead(403).end(validationError);
      this.onerror?.(new Error(validationError));
      return;
    }
    const authInfo = req.auth;
    const host = req.headers.host;
    const protocol = req.socket instanceof import_node_tls.TLSSocket ? "https" : "http";
    const fullUrl = host && req.url ? new import_node_url.URL(req.url, `${protocol}://${host}`) : void 0;
    const requestInfo = {
      headers: req.headers,
      url: fullUrl
    };
    let body;
    try {
      const ct = import_content_type.default.parse(req.headers["content-type"] ?? "");
      if (ct.type !== "application/json") {
        throw new Error(`Unsupported content-type: ${ct.type}`);
      }
      body = parsedBody ?? await getRawBody(req, {
        limit: MAXIMUM_MESSAGE_SIZE,
        encoding: ct.parameters.charset ?? "utf-8"
      });
    } catch (error48) {
      res.writeHead(400).end(String(error48));
      this.onerror?.(error48);
      return;
    }
    try {
      await this.handleMessage(typeof body === "string" ? JSON.parse(body) : body, { requestInfo, authInfo });
    } catch {
      res.writeHead(400).end(`Invalid message: ${body}`);
      return;
    }
    res.writeHead(202).end("Accepted");
  }
  /**
   * Handle a client message, regardless of how it arrived. This can be used to inform the server of messages that arrive via a means different than HTTP POST.
   */
  async handleMessage(message, extra) {
    let parsedMessage;
    try {
      parsedMessage = JSONRPCMessageSchema.parse(message);
    } catch (error48) {
      this.onerror?.(error48);
      throw error48;
    }
    this.onmessage?.(parsedMessage, extra);
  }
  async close() {
    this._sseResponse?.end();
    this._sseResponse = void 0;
    this.onclose?.();
  }
  async send(message) {
    if (!this._sseResponse) {
      throw new Error("Not connected");
    }
    this._sseResponse.write(`event: message
data: ${JSON.stringify(message)}

`);
  }
  /**
   * Returns the session ID for this transport.
   *
   * This can be used to route incoming POST requests.
   */
  get sessionId() {
    return this._sessionId;
  }
};

// node_modules/@modelcontextprotocol/sdk/dist/esm/client/stdio.js
var import_cross_spawn = __toESM(require_cross_spawn(), 1);
var import_node_process = __toESM(require("node:process"), 1);
var import_node_stream = require("node:stream");

// node_modules/@modelcontextprotocol/sdk/dist/esm/shared/stdio.js
var ReadBuffer = class {
  append(chunk) {
    this._buffer = this._buffer ? Buffer.concat([this._buffer, chunk]) : chunk;
  }
  readMessage() {
    if (!this._buffer) {
      return null;
    }
    const index = this._buffer.indexOf("\n");
    if (index === -1) {
      return null;
    }
    const line = this._buffer.toString("utf8", 0, index).replace(/\r$/, "");
    this._buffer = this._buffer.subarray(index + 1);
    return deserializeMessage(line);
  }
  clear() {
    this._buffer = void 0;
  }
};
function deserializeMessage(line) {
  return JSONRPCMessageSchema.parse(JSON.parse(line));
}
function serializeMessage(message) {
  return JSON.stringify(message) + "\n";
}

// node_modules/@modelcontextprotocol/sdk/dist/esm/client/stdio.js
var DEFAULT_INHERITED_ENV_VARS = import_node_process.default.platform === "win32" ? [
  "APPDATA",
  "HOMEDRIVE",
  "HOMEPATH",
  "LOCALAPPDATA",
  "PATH",
  "PROCESSOR_ARCHITECTURE",
  "SYSTEMDRIVE",
  "SYSTEMROOT",
  "TEMP",
  "USERNAME",
  "USERPROFILE",
  "PROGRAMFILES"
] : (
  /* list inspired by the default env inheritance of sudo */
  ["HOME", "LOGNAME", "PATH", "SHELL", "TERM", "USER"]
);
function getDefaultEnvironment() {
  const env = {};
  for (const key of DEFAULT_INHERITED_ENV_VARS) {
    const value = import_node_process.default.env[key];
    if (value === void 0) {
      continue;
    }
    if (value.startsWith("()")) {
      continue;
    }
    env[key] = value;
  }
  return env;
}
var StdioClientTransport = class {
  constructor(server) {
    this._readBuffer = new ReadBuffer();
    this._stderrStream = null;
    this._serverParams = server;
    if (server.stderr === "pipe" || server.stderr === "overlapped") {
      this._stderrStream = new import_node_stream.PassThrough();
    }
  }
  /**
   * Starts the server process and prepares to communicate with it.
   */
  async start() {
    if (this._process) {
      throw new Error("StdioClientTransport already started! If using Client class, note that connect() calls start() automatically.");
    }
    return new Promise((resolve, reject) => {
      this._process = (0, import_cross_spawn.default)(this._serverParams.command, this._serverParams.args ?? [], {
        // merge default env with server env because mcp server needs some env vars
        env: {
          ...getDefaultEnvironment(),
          ...this._serverParams.env
        },
        stdio: ["pipe", "pipe", this._serverParams.stderr ?? "inherit"],
        shell: false,
        windowsHide: import_node_process.default.platform === "win32",
        cwd: this._serverParams.cwd
      });
      this._process.on("error", (error48) => {
        reject(error48);
        this.onerror?.(error48);
      });
      this._process.on("spawn", () => {
        resolve();
      });
      this._process.on("close", (_code) => {
        this._process = void 0;
        this.onclose?.();
      });
      this._process.stdin?.on("error", (error48) => {
        this.onerror?.(error48);
      });
      this._process.stdout?.on("data", (chunk) => {
        this._readBuffer.append(chunk);
        this.processReadBuffer();
      });
      this._process.stdout?.on("error", (error48) => {
        this.onerror?.(error48);
      });
      if (this._stderrStream && this._process.stderr) {
        this._process.stderr.pipe(this._stderrStream);
      }
    });
  }
  /**
   * The stderr stream of the child process, if `StdioServerParameters.stderr` was set to "pipe" or "overlapped".
   *
   * If stderr piping was requested, a PassThrough stream is returned _immediately_, allowing callers to
   * attach listeners before the start method is invoked. This prevents loss of any early
   * error output emitted by the child process.
   */
  get stderr() {
    if (this._stderrStream) {
      return this._stderrStream;
    }
    return this._process?.stderr ?? null;
  }
  /**
   * The child process pid spawned by this transport.
   *
   * This is only available after the transport has been started.
   */
  get pid() {
    return this._process?.pid ?? null;
  }
  processReadBuffer() {
    while (true) {
      try {
        const message = this._readBuffer.readMessage();
        if (message === null) {
          break;
        }
        this.onmessage?.(message);
      } catch (error48) {
        this.onerror?.(error48);
      }
    }
  }
  async close() {
    if (this._process) {
      const processToClose = this._process;
      this._process = void 0;
      const closePromise = new Promise((resolve) => {
        processToClose.once("close", () => {
          resolve();
        });
      });
      try {
        processToClose.stdin?.end();
      } catch {
      }
      await Promise.race([closePromise, new Promise((resolve) => setTimeout(resolve, 2e3).unref())]);
      if (processToClose.exitCode === null) {
        try {
          processToClose.kill("SIGTERM");
        } catch {
        }
        await Promise.race([closePromise, new Promise((resolve) => setTimeout(resolve, 2e3).unref())]);
      }
      if (processToClose.exitCode === null) {
        try {
          processToClose.kill("SIGKILL");
        } catch {
        }
      }
    }
    this._readBuffer.clear();
  }
  send(message) {
    return new Promise((resolve) => {
      if (!this._process?.stdin) {
        throw new Error("Not connected");
      }
      const json2 = serializeMessage(message);
      if (this._process.stdin.write(json2)) {
        resolve();
      } else {
        this._process.stdin.once("drain", resolve);
      }
    });
  }
};

// node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.js
var import_node_process2 = __toESM(require("node:process"), 1);
var StdioServerTransport = class {
  constructor(_stdin = import_node_process2.default.stdin, _stdout = import_node_process2.default.stdout) {
    this._stdin = _stdin;
    this._stdout = _stdout;
    this._readBuffer = new ReadBuffer();
    this._started = false;
    this._ondata = (chunk) => {
      this._readBuffer.append(chunk);
      this.processReadBuffer();
    };
    this._onerror = (error48) => {
      this.onerror?.(error48);
    };
  }
  /**
   * Starts listening for messages on stdin.
   */
  async start() {
    if (this._started) {
      throw new Error("StdioServerTransport already started! If using Server class, note that connect() calls start() automatically.");
    }
    this._started = true;
    this._stdin.on("data", this._ondata);
    this._stdin.on("error", this._onerror);
  }
  processReadBuffer() {
    while (true) {
      try {
        const message = this._readBuffer.readMessage();
        if (message === null) {
          break;
        }
        this.onmessage?.(message);
      } catch (error48) {
        this.onerror?.(error48);
      }
    }
  }
  async close() {
    this._stdin.off("data", this._ondata);
    this._stdin.off("error", this._onerror);
    const remainingDataListeners = this._stdin.listenerCount("data");
    if (remainingDataListeners === 0) {
      this._stdin.pause();
    }
    this._readBuffer.clear();
    this.onclose?.();
  }
  send(message) {
    return new Promise((resolve) => {
      const json2 = serializeMessage(message);
      if (this._stdout.write(json2)) {
        resolve();
      } else {
        this._stdout.once("drain", resolve);
      }
    });
  }
};

// node_modules/@hono/node-server/dist/index.mjs
var import_http2 = require("http2");
var import_http22 = require("http2");
var import_stream2 = require("stream");
var import_crypto = __toESM(require("crypto"), 1);
var RequestError = class extends Error {
  constructor(message, options2) {
    super(message, options2);
    this.name = "RequestError";
  }
};
var toRequestError = (e) => {
  if (e instanceof RequestError) {
    return e;
  }
  return new RequestError(e.message, { cause: e });
};
var GlobalRequest = global.Request;
var Request = class extends GlobalRequest {
  constructor(input, options2) {
    if (typeof input === "object" && getRequestCache in input) {
      input = input[getRequestCache]();
    }
    if (typeof options2?.body?.getReader !== "undefined") {
      ;
      options2.duplex ??= "half";
    }
    super(input, options2);
  }
};
var newHeadersFromIncoming = (incoming) => {
  const headerRecord = [];
  const rawHeaders = incoming.rawHeaders;
  for (let i = 0; i < rawHeaders.length; i += 2) {
    const { [i]: key, [i + 1]: value } = rawHeaders;
    if (key.charCodeAt(0) !== /*:*/
    58) {
      headerRecord.push([key, value]);
    }
  }
  return new Headers(headerRecord);
};
var wrapBodyStream = Symbol("wrapBodyStream");
var newRequestFromIncoming = (method, url2, headers, incoming, abortController) => {
  const init = {
    method,
    headers,
    signal: abortController.signal
  };
  if (method === "TRACE") {
    init.method = "GET";
    const req = new Request(url2, init);
    Object.defineProperty(req, "method", {
      get() {
        return "TRACE";
      }
    });
    return req;
  }
  if (!(method === "GET" || method === "HEAD")) {
    if ("rawBody" in incoming && incoming.rawBody instanceof Buffer) {
      init.body = new ReadableStream({
        start(controller) {
          controller.enqueue(incoming.rawBody);
          controller.close();
        }
      });
    } else if (incoming[wrapBodyStream]) {
      let reader;
      init.body = new ReadableStream({
        async pull(controller) {
          try {
            reader ||= import_stream2.Readable.toWeb(incoming).getReader();
            const { done, value } = await reader.read();
            if (done) {
              controller.close();
            } else {
              controller.enqueue(value);
            }
          } catch (error48) {
            controller.error(error48);
          }
        }
      });
    } else {
      init.body = import_stream2.Readable.toWeb(incoming);
    }
  }
  return new Request(url2, init);
};
var getRequestCache = Symbol("getRequestCache");
var requestCache = Symbol("requestCache");
var incomingKey = Symbol("incomingKey");
var urlKey = Symbol("urlKey");
var headersKey = Symbol("headersKey");
var abortControllerKey = Symbol("abortControllerKey");
var getAbortController = Symbol("getAbortController");
var requestPrototype = {
  get method() {
    return this[incomingKey].method || "GET";
  },
  get url() {
    return this[urlKey];
  },
  get headers() {
    return this[headersKey] ||= newHeadersFromIncoming(this[incomingKey]);
  },
  [getAbortController]() {
    this[getRequestCache]();
    return this[abortControllerKey];
  },
  [getRequestCache]() {
    this[abortControllerKey] ||= new AbortController();
    return this[requestCache] ||= newRequestFromIncoming(
      this.method,
      this[urlKey],
      this.headers,
      this[incomingKey],
      this[abortControllerKey]
    );
  }
};
[
  "body",
  "bodyUsed",
  "cache",
  "credentials",
  "destination",
  "integrity",
  "mode",
  "redirect",
  "referrer",
  "referrerPolicy",
  "signal",
  "keepalive"
].forEach((k) => {
  Object.defineProperty(requestPrototype, k, {
    get() {
      return this[getRequestCache]()[k];
    }
  });
});
["arrayBuffer", "blob", "clone", "formData", "json", "text"].forEach((k) => {
  Object.defineProperty(requestPrototype, k, {
    value: function() {
      return this[getRequestCache]()[k]();
    }
  });
});
Object.setPrototypeOf(requestPrototype, Request.prototype);
var newRequest = (incoming, defaultHostname) => {
  const req = Object.create(requestPrototype);
  req[incomingKey] = incoming;
  const incomingUrl = incoming.url || "";
  if (incomingUrl[0] !== "/" && // short-circuit for performance. most requests are relative URL.
  (incomingUrl.startsWith("http://") || incomingUrl.startsWith("https://"))) {
    if (incoming instanceof import_http22.Http2ServerRequest) {
      throw new RequestError("Absolute URL for :path is not allowed in HTTP/2");
    }
    try {
      const url22 = new URL(incomingUrl);
      req[urlKey] = url22.href;
    } catch (e) {
      throw new RequestError("Invalid absolute URL", { cause: e });
    }
    return req;
  }
  const host = (incoming instanceof import_http22.Http2ServerRequest ? incoming.authority : incoming.headers.host) || defaultHostname;
  if (!host) {
    throw new RequestError("Missing host header");
  }
  let scheme;
  if (incoming instanceof import_http22.Http2ServerRequest) {
    scheme = incoming.scheme;
    if (!(scheme === "http" || scheme === "https")) {
      throw new RequestError("Unsupported scheme");
    }
  } else {
    scheme = incoming.socket && incoming.socket.encrypted ? "https" : "http";
  }
  const url2 = new URL(`${scheme}://${host}${incomingUrl}`);
  if (url2.hostname.length !== host.length && url2.hostname !== host.replace(/:\d+$/, "")) {
    throw new RequestError("Invalid host header");
  }
  req[urlKey] = url2.href;
  return req;
};
var responseCache = Symbol("responseCache");
var getResponseCache = Symbol("getResponseCache");
var cacheKey = Symbol("cache");
var GlobalResponse = global.Response;
var Response2 = class _Response {
  #body;
  #init;
  [getResponseCache]() {
    delete this[cacheKey];
    return this[responseCache] ||= new GlobalResponse(this.#body, this.#init);
  }
  constructor(body, init) {
    let headers;
    this.#body = body;
    if (init instanceof _Response) {
      const cachedGlobalResponse = init[responseCache];
      if (cachedGlobalResponse) {
        this.#init = cachedGlobalResponse;
        this[getResponseCache]();
        return;
      } else {
        this.#init = init.#init;
        headers = new Headers(init.#init.headers);
      }
    } else {
      this.#init = init;
    }
    if (typeof body === "string" || typeof body?.getReader !== "undefined" || body instanceof Blob || body instanceof Uint8Array) {
      ;
      this[cacheKey] = [init?.status || 200, body, headers || init?.headers];
    }
  }
  get headers() {
    const cache = this[cacheKey];
    if (cache) {
      if (!(cache[2] instanceof Headers)) {
        cache[2] = new Headers(
          cache[2] || { "content-type": "text/plain; charset=UTF-8" }
        );
      }
      return cache[2];
    }
    return this[getResponseCache]().headers;
  }
  get status() {
    return this[cacheKey]?.[0] ?? this[getResponseCache]().status;
  }
  get ok() {
    const status = this.status;
    return status >= 200 && status < 300;
  }
};
["body", "bodyUsed", "redirected", "statusText", "trailers", "type", "url"].forEach((k) => {
  Object.defineProperty(Response2.prototype, k, {
    get() {
      return this[getResponseCache]()[k];
    }
  });
});
["arrayBuffer", "blob", "clone", "formData", "json", "text"].forEach((k) => {
  Object.defineProperty(Response2.prototype, k, {
    value: function() {
      return this[getResponseCache]()[k]();
    }
  });
});
Object.setPrototypeOf(Response2, GlobalResponse);
Object.setPrototypeOf(Response2.prototype, GlobalResponse.prototype);
async function readWithoutBlocking(readPromise) {
  return Promise.race([readPromise, Promise.resolve().then(() => Promise.resolve(void 0))]);
}
function writeFromReadableStreamDefaultReader(reader, writable, currentReadPromise) {
  const cancel = (error48) => {
    reader.cancel(error48).catch(() => {
    });
  };
  writable.on("close", cancel);
  writable.on("error", cancel);
  (currentReadPromise ?? reader.read()).then(flow, handleStreamError);
  return reader.closed.finally(() => {
    writable.off("close", cancel);
    writable.off("error", cancel);
  });
  function handleStreamError(error48) {
    if (error48) {
      writable.destroy(error48);
    }
  }
  function onDrain() {
    reader.read().then(flow, handleStreamError);
  }
  function flow({ done, value }) {
    try {
      if (done) {
        writable.end();
      } else if (!writable.write(value)) {
        writable.once("drain", onDrain);
      } else {
        return reader.read().then(flow, handleStreamError);
      }
    } catch (e) {
      handleStreamError(e);
    }
  }
}
function writeFromReadableStream(stream, writable) {
  if (stream.locked) {
    throw new TypeError("ReadableStream is locked.");
  } else if (writable.destroyed) {
    return;
  }
  return writeFromReadableStreamDefaultReader(stream.getReader(), writable);
}
var buildOutgoingHttpHeaders = (headers) => {
  const res = {};
  if (!(headers instanceof Headers)) {
    headers = new Headers(headers ?? void 0);
  }
  const cookies = [];
  for (const [k, v] of headers) {
    if (k === "set-cookie") {
      cookies.push(v);
    } else {
      res[k] = v;
    }
  }
  if (cookies.length > 0) {
    res["set-cookie"] = cookies;
  }
  res["content-type"] ??= "text/plain; charset=UTF-8";
  return res;
};
var X_ALREADY_SENT = "x-hono-already-sent";
if (typeof global.crypto === "undefined") {
  global.crypto = import_crypto.default;
}
var outgoingEnded = Symbol("outgoingEnded");
var handleRequestError = () => new Response(null, {
  status: 400
});
var handleFetchError = (e) => new Response(null, {
  status: e instanceof Error && (e.name === "TimeoutError" || e.constructor.name === "TimeoutError") ? 504 : 500
});
var handleResponseError = (e, outgoing) => {
  const err = e instanceof Error ? e : new Error("unknown error", { cause: e });
  if (err.code === "ERR_STREAM_PREMATURE_CLOSE") {
    console.info("The user aborted a request.");
  } else {
    console.error(e);
    if (!outgoing.headersSent) {
      outgoing.writeHead(500, { "Content-Type": "text/plain" });
    }
    outgoing.end(`Error: ${err.message}`);
    outgoing.destroy(err);
  }
};
var flushHeaders = (outgoing) => {
  if ("flushHeaders" in outgoing && outgoing.writable) {
    outgoing.flushHeaders();
  }
};
var responseViaCache = async (res, outgoing) => {
  let [status, body, header] = res[cacheKey];
  let hasContentLength = false;
  if (!header) {
    header = { "content-type": "text/plain; charset=UTF-8" };
  } else if (header instanceof Headers) {
    hasContentLength = header.has("content-length");
    header = buildOutgoingHttpHeaders(header);
  } else if (Array.isArray(header)) {
    const headerObj = new Headers(header);
    hasContentLength = headerObj.has("content-length");
    header = buildOutgoingHttpHeaders(headerObj);
  } else {
    for (const key in header) {
      if (key.length === 14 && key.toLowerCase() === "content-length") {
        hasContentLength = true;
        break;
      }
    }
  }
  if (!hasContentLength) {
    if (typeof body === "string") {
      header["Content-Length"] = Buffer.byteLength(body);
    } else if (body instanceof Uint8Array) {
      header["Content-Length"] = body.byteLength;
    } else if (body instanceof Blob) {
      header["Content-Length"] = body.size;
    }
  }
  outgoing.writeHead(status, header);
  if (typeof body === "string" || body instanceof Uint8Array) {
    outgoing.end(body);
  } else if (body instanceof Blob) {
    outgoing.end(new Uint8Array(await body.arrayBuffer()));
  } else {
    flushHeaders(outgoing);
    await writeFromReadableStream(body, outgoing)?.catch(
      (e) => handleResponseError(e, outgoing)
    );
  }
  ;
  outgoing[outgoingEnded]?.();
};
var isPromise = (res) => typeof res.then === "function";
var responseViaResponseObject = async (res, outgoing, options2 = {}) => {
  if (isPromise(res)) {
    if (options2.errorHandler) {
      try {
        res = await res;
      } catch (err) {
        const errRes = await options2.errorHandler(err);
        if (!errRes) {
          return;
        }
        res = errRes;
      }
    } else {
      res = await res.catch(handleFetchError);
    }
  }
  if (cacheKey in res) {
    return responseViaCache(res, outgoing);
  }
  const resHeaderRecord = buildOutgoingHttpHeaders(res.headers);
  if (res.body) {
    const reader = res.body.getReader();
    const values = [];
    let done = false;
    let currentReadPromise = void 0;
    if (resHeaderRecord["transfer-encoding"] !== "chunked") {
      let maxReadCount = 2;
      for (let i = 0; i < maxReadCount; i++) {
        currentReadPromise ||= reader.read();
        const chunk = await readWithoutBlocking(currentReadPromise).catch((e) => {
          console.error(e);
          done = true;
        });
        if (!chunk) {
          if (i === 1) {
            await new Promise((resolve) => setTimeout(resolve));
            maxReadCount = 3;
            continue;
          }
          break;
        }
        currentReadPromise = void 0;
        if (chunk.value) {
          values.push(chunk.value);
        }
        if (chunk.done) {
          done = true;
          break;
        }
      }
      if (done && !("content-length" in resHeaderRecord)) {
        resHeaderRecord["content-length"] = values.reduce((acc, value) => acc + value.length, 0);
      }
    }
    outgoing.writeHead(res.status, resHeaderRecord);
    values.forEach((value) => {
      ;
      outgoing.write(value);
    });
    if (done) {
      outgoing.end();
    } else {
      if (values.length === 0) {
        flushHeaders(outgoing);
      }
      await writeFromReadableStreamDefaultReader(reader, outgoing, currentReadPromise);
    }
  } else if (resHeaderRecord[X_ALREADY_SENT]) {
  } else {
    outgoing.writeHead(res.status, resHeaderRecord);
    outgoing.end();
  }
  ;
  outgoing[outgoingEnded]?.();
};
var getRequestListener = (fetchCallback, options2 = {}) => {
  const autoCleanupIncoming = options2.autoCleanupIncoming ?? true;
  if (options2.overrideGlobalObjects !== false && global.Request !== Request) {
    Object.defineProperty(global, "Request", {
      value: Request
    });
    Object.defineProperty(global, "Response", {
      value: Response2
    });
  }
  return async (incoming, outgoing) => {
    let res, req;
    try {
      req = newRequest(incoming, options2.hostname);
      let incomingEnded = !autoCleanupIncoming || incoming.method === "GET" || incoming.method === "HEAD";
      if (!incomingEnded) {
        ;
        incoming[wrapBodyStream] = true;
        incoming.on("end", () => {
          incomingEnded = true;
        });
        if (incoming instanceof import_http2.Http2ServerRequest) {
          ;
          outgoing[outgoingEnded] = () => {
            if (!incomingEnded) {
              setTimeout(() => {
                if (!incomingEnded) {
                  setTimeout(() => {
                    incoming.destroy();
                    outgoing.destroy();
                  });
                }
              });
            }
          };
        }
      }
      outgoing.on("close", () => {
        const abortController = req[abortControllerKey];
        if (abortController) {
          if (incoming.errored) {
            req[abortControllerKey].abort(incoming.errored.toString());
          } else if (!outgoing.writableFinished) {
            req[abortControllerKey].abort("Client connection prematurely closed.");
          }
        }
        if (!incomingEnded) {
          setTimeout(() => {
            if (!incomingEnded) {
              setTimeout(() => {
                incoming.destroy();
              });
            }
          });
        }
      });
      res = fetchCallback(req, { incoming, outgoing });
      if (cacheKey in res) {
        return responseViaCache(res, outgoing);
      }
    } catch (e) {
      if (!res) {
        if (options2.errorHandler) {
          res = await options2.errorHandler(req ? e : toRequestError(e));
          if (!res) {
            return;
          }
        } else if (!req) {
          res = handleRequestError();
        } else {
          res = handleFetchError(e);
        }
      } else {
        return handleResponseError(e, outgoing);
      }
    }
    try {
      return await responseViaResponseObject(res, outgoing, options2);
    } catch (e) {
      return handleResponseError(e, outgoing);
    }
  };
};

// node_modules/@modelcontextprotocol/sdk/dist/esm/server/webStandardStreamableHttp.js
var WebStandardStreamableHTTPServerTransport = class {
  constructor(options2 = {}) {
    this._started = false;
    this._hasHandledRequest = false;
    this._streamMapping = /* @__PURE__ */ new Map();
    this._requestToStreamMapping = /* @__PURE__ */ new Map();
    this._requestResponseMap = /* @__PURE__ */ new Map();
    this._initialized = false;
    this._enableJsonResponse = false;
    this._standaloneSseStreamId = "_GET_stream";
    this.sessionIdGenerator = options2.sessionIdGenerator;
    this._enableJsonResponse = options2.enableJsonResponse ?? false;
    this._eventStore = options2.eventStore;
    this._onsessioninitialized = options2.onsessioninitialized;
    this._onsessionclosed = options2.onsessionclosed;
    this._allowedHosts = options2.allowedHosts;
    this._allowedOrigins = options2.allowedOrigins;
    this._enableDnsRebindingProtection = options2.enableDnsRebindingProtection ?? false;
    this._retryInterval = options2.retryInterval;
  }
  /**
   * Starts the transport. This is required by the Transport interface but is a no-op
   * for the Streamable HTTP transport as connections are managed per-request.
   */
  async start() {
    if (this._started) {
      throw new Error("Transport already started");
    }
    this._started = true;
  }
  /**
   * Helper to create a JSON error response
   */
  createJsonErrorResponse(status, code, message, options2) {
    const error48 = { code, message };
    if (options2?.data !== void 0) {
      error48.data = options2.data;
    }
    return new Response(JSON.stringify({
      jsonrpc: "2.0",
      error: error48,
      id: null
    }), {
      status,
      headers: {
        "Content-Type": "application/json",
        ...options2?.headers
      }
    });
  }
  /**
   * Validates request headers for DNS rebinding protection.
   * @returns Error response if validation fails, undefined if validation passes.
   */
  validateRequestHeaders(req) {
    if (!this._enableDnsRebindingProtection) {
      return void 0;
    }
    if (this._allowedHosts && this._allowedHosts.length > 0) {
      const hostHeader = req.headers.get("host");
      if (!hostHeader || !this._allowedHosts.includes(hostHeader)) {
        const error48 = `Invalid Host header: ${hostHeader}`;
        this.onerror?.(new Error(error48));
        return this.createJsonErrorResponse(403, -32e3, error48);
      }
    }
    if (this._allowedOrigins && this._allowedOrigins.length > 0) {
      const originHeader = req.headers.get("origin");
      if (originHeader && !this._allowedOrigins.includes(originHeader)) {
        const error48 = `Invalid Origin header: ${originHeader}`;
        this.onerror?.(new Error(error48));
        return this.createJsonErrorResponse(403, -32e3, error48);
      }
    }
    return void 0;
  }
  /**
   * Handles an incoming HTTP request, whether GET, POST, or DELETE
   * Returns a Response object (Web Standard)
   */
  async handleRequest(req, options2) {
    if (!this.sessionIdGenerator && this._hasHandledRequest) {
      throw new Error("Stateless transport cannot be reused across requests. Create a new transport per request.");
    }
    this._hasHandledRequest = true;
    const validationError = this.validateRequestHeaders(req);
    if (validationError) {
      return validationError;
    }
    switch (req.method) {
      case "POST":
        return this.handlePostRequest(req, options2);
      case "GET":
        return this.handleGetRequest(req);
      case "DELETE":
        return this.handleDeleteRequest(req);
      default:
        return this.handleUnsupportedRequest();
    }
  }
  /**
   * Writes a priming event to establish resumption capability.
   * Only sends if eventStore is configured (opt-in for resumability) and
   * the client's protocol version supports empty SSE data (>= 2025-11-25).
   */
  async writePrimingEvent(controller, encoder, streamId, protocolVersion) {
    if (!this._eventStore) {
      return;
    }
    if (protocolVersion < "2025-11-25") {
      return;
    }
    const primingEventId = await this._eventStore.storeEvent(streamId, {});
    let primingEvent = `id: ${primingEventId}
data: 

`;
    if (this._retryInterval !== void 0) {
      primingEvent = `id: ${primingEventId}
retry: ${this._retryInterval}
data: 

`;
    }
    controller.enqueue(encoder.encode(primingEvent));
  }
  /**
   * Handles GET requests for SSE stream
   */
  async handleGetRequest(req) {
    const acceptHeader = req.headers.get("accept");
    if (!acceptHeader?.includes("text/event-stream")) {
      this.onerror?.(new Error("Not Acceptable: Client must accept text/event-stream"));
      return this.createJsonErrorResponse(406, -32e3, "Not Acceptable: Client must accept text/event-stream");
    }
    const sessionError = this.validateSession(req);
    if (sessionError) {
      return sessionError;
    }
    const protocolError = this.validateProtocolVersion(req);
    if (protocolError) {
      return protocolError;
    }
    if (this._eventStore) {
      const lastEventId = req.headers.get("last-event-id");
      if (lastEventId) {
        return this.replayEvents(lastEventId);
      }
    }
    if (this._streamMapping.get(this._standaloneSseStreamId) !== void 0) {
      this.onerror?.(new Error("Conflict: Only one SSE stream is allowed per session"));
      return this.createJsonErrorResponse(409, -32e3, "Conflict: Only one SSE stream is allowed per session");
    }
    const encoder = new TextEncoder();
    let streamController;
    const readable = new ReadableStream({
      start: (controller) => {
        streamController = controller;
      },
      cancel: () => {
        this._streamMapping.delete(this._standaloneSseStreamId);
      }
    });
    const headers = {
      "Content-Type": "text/event-stream",
      "Cache-Control": "no-cache, no-transform",
      Connection: "keep-alive"
    };
    if (this.sessionId !== void 0) {
      headers["mcp-session-id"] = this.sessionId;
    }
    this._streamMapping.set(this._standaloneSseStreamId, {
      controller: streamController,
      encoder,
      cleanup: () => {
        this._streamMapping.delete(this._standaloneSseStreamId);
        try {
          streamController.close();
        } catch {
        }
      }
    });
    return new Response(readable, { headers });
  }
  /**
   * Replays events that would have been sent after the specified event ID
   * Only used when resumability is enabled
   */
  async replayEvents(lastEventId) {
    if (!this._eventStore) {
      this.onerror?.(new Error("Event store not configured"));
      return this.createJsonErrorResponse(400, -32e3, "Event store not configured");
    }
    try {
      let streamId;
      if (this._eventStore.getStreamIdForEventId) {
        streamId = await this._eventStore.getStreamIdForEventId(lastEventId);
        if (!streamId) {
          this.onerror?.(new Error("Invalid event ID format"));
          return this.createJsonErrorResponse(400, -32e3, "Invalid event ID format");
        }
        if (this._streamMapping.get(streamId) !== void 0) {
          this.onerror?.(new Error("Conflict: Stream already has an active connection"));
          return this.createJsonErrorResponse(409, -32e3, "Conflict: Stream already has an active connection");
        }
      }
      const headers = {
        "Content-Type": "text/event-stream",
        "Cache-Control": "no-cache, no-transform",
        Connection: "keep-alive"
      };
      if (this.sessionId !== void 0) {
        headers["mcp-session-id"] = this.sessionId;
      }
      const encoder = new TextEncoder();
      let streamController;
      const readable = new ReadableStream({
        start: (controller) => {
          streamController = controller;
        },
        cancel: () => {
        }
      });
      const replayedStreamId = await this._eventStore.replayEventsAfter(lastEventId, {
        send: async (eventId, message) => {
          const success2 = this.writeSSEEvent(streamController, encoder, message, eventId);
          if (!success2) {
            this.onerror?.(new Error("Failed replay events"));
            try {
              streamController.close();
            } catch {
            }
          }
        }
      });
      this._streamMapping.set(replayedStreamId, {
        controller: streamController,
        encoder,
        cleanup: () => {
          this._streamMapping.delete(replayedStreamId);
          try {
            streamController.close();
          } catch {
          }
        }
      });
      return new Response(readable, { headers });
    } catch (error48) {
      this.onerror?.(error48);
      return this.createJsonErrorResponse(500, -32e3, "Error replaying events");
    }
  }
  /**
   * Writes an event to an SSE stream via controller with proper formatting
   */
  writeSSEEvent(controller, encoder, message, eventId) {
    try {
      let eventData = `event: message
`;
      if (eventId) {
        eventData += `id: ${eventId}
`;
      }
      eventData += `data: ${JSON.stringify(message)}

`;
      controller.enqueue(encoder.encode(eventData));
      return true;
    } catch (error48) {
      this.onerror?.(error48);
      return false;
    }
  }
  /**
   * Handles unsupported requests (PUT, PATCH, etc.)
   */
  handleUnsupportedRequest() {
    this.onerror?.(new Error("Method not allowed."));
    return new Response(JSON.stringify({
      jsonrpc: "2.0",
      error: {
        code: -32e3,
        message: "Method not allowed."
      },
      id: null
    }), {
      status: 405,
      headers: {
        Allow: "GET, POST, DELETE",
        "Content-Type": "application/json"
      }
    });
  }
  /**
   * Handles POST requests containing JSON-RPC messages
   */
  async handlePostRequest(req, options2) {
    try {
      const acceptHeader = req.headers.get("accept");
      if (!acceptHeader?.includes("application/json") || !acceptHeader.includes("text/event-stream")) {
        this.onerror?.(new Error("Not Acceptable: Client must accept both application/json and text/event-stream"));
        return this.createJsonErrorResponse(406, -32e3, "Not Acceptable: Client must accept both application/json and text/event-stream");
      }
      const ct = req.headers.get("content-type");
      if (!ct || !ct.includes("application/json")) {
        this.onerror?.(new Error("Unsupported Media Type: Content-Type must be application/json"));
        return this.createJsonErrorResponse(415, -32e3, "Unsupported Media Type: Content-Type must be application/json");
      }
      const requestInfo = {
        headers: Object.fromEntries(req.headers.entries()),
        url: new URL(req.url)
      };
      let rawMessage;
      if (options2?.parsedBody !== void 0) {
        rawMessage = options2.parsedBody;
      } else {
        try {
          rawMessage = await req.json();
        } catch {
          this.onerror?.(new Error("Parse error: Invalid JSON"));
          return this.createJsonErrorResponse(400, -32700, "Parse error: Invalid JSON");
        }
      }
      let messages;
      try {
        if (Array.isArray(rawMessage)) {
          messages = rawMessage.map((msg) => JSONRPCMessageSchema.parse(msg));
        } else {
          messages = [JSONRPCMessageSchema.parse(rawMessage)];
        }
      } catch {
        this.onerror?.(new Error("Parse error: Invalid JSON-RPC message"));
        return this.createJsonErrorResponse(400, -32700, "Parse error: Invalid JSON-RPC message");
      }
      const isInitializationRequest = messages.some(isInitializeRequest);
      if (isInitializationRequest) {
        if (this._initialized && this.sessionId !== void 0) {
          this.onerror?.(new Error("Invalid Request: Server already initialized"));
          return this.createJsonErrorResponse(400, -32600, "Invalid Request: Server already initialized");
        }
        if (messages.length > 1) {
          this.onerror?.(new Error("Invalid Request: Only one initialization request is allowed"));
          return this.createJsonErrorResponse(400, -32600, "Invalid Request: Only one initialization request is allowed");
        }
        this.sessionId = this.sessionIdGenerator?.();
        this._initialized = true;
        if (this.sessionId && this._onsessioninitialized) {
          await Promise.resolve(this._onsessioninitialized(this.sessionId));
        }
      }
      if (!isInitializationRequest) {
        const sessionError = this.validateSession(req);
        if (sessionError) {
          return sessionError;
        }
        const protocolError = this.validateProtocolVersion(req);
        if (protocolError) {
          return protocolError;
        }
      }
      const hasRequests = messages.some(isJSONRPCRequest);
      if (!hasRequests) {
        for (const message of messages) {
          this.onmessage?.(message, { authInfo: options2?.authInfo, requestInfo });
        }
        return new Response(null, { status: 202 });
      }
      const streamId = crypto.randomUUID();
      const initRequest = messages.find((m) => isInitializeRequest(m));
      const clientProtocolVersion = initRequest ? initRequest.params.protocolVersion : req.headers.get("mcp-protocol-version") ?? DEFAULT_NEGOTIATED_PROTOCOL_VERSION;
      if (this._enableJsonResponse) {
        return new Promise((resolve) => {
          this._streamMapping.set(streamId, {
            resolveJson: resolve,
            cleanup: () => {
              this._streamMapping.delete(streamId);
            }
          });
          for (const message of messages) {
            if (isJSONRPCRequest(message)) {
              this._requestToStreamMapping.set(message.id, streamId);
            }
          }
          for (const message of messages) {
            this.onmessage?.(message, { authInfo: options2?.authInfo, requestInfo });
          }
        });
      }
      const encoder = new TextEncoder();
      let streamController;
      const readable = new ReadableStream({
        start: (controller) => {
          streamController = controller;
        },
        cancel: () => {
          this._streamMapping.delete(streamId);
        }
      });
      const headers = {
        "Content-Type": "text/event-stream",
        "Cache-Control": "no-cache",
        Connection: "keep-alive"
      };
      if (this.sessionId !== void 0) {
        headers["mcp-session-id"] = this.sessionId;
      }
      for (const message of messages) {
        if (isJSONRPCRequest(message)) {
          this._streamMapping.set(streamId, {
            controller: streamController,
            encoder,
            cleanup: () => {
              this._streamMapping.delete(streamId);
              try {
                streamController.close();
              } catch {
              }
            }
          });
          this._requestToStreamMapping.set(message.id, streamId);
        }
      }
      await this.writePrimingEvent(streamController, encoder, streamId, clientProtocolVersion);
      for (const message of messages) {
        let closeSSEStream;
        let closeStandaloneSSEStream;
        if (isJSONRPCRequest(message) && this._eventStore && clientProtocolVersion >= "2025-11-25") {
          closeSSEStream = () => {
            this.closeSSEStream(message.id);
          };
          closeStandaloneSSEStream = () => {
            this.closeStandaloneSSEStream();
          };
        }
        this.onmessage?.(message, { authInfo: options2?.authInfo, requestInfo, closeSSEStream, closeStandaloneSSEStream });
      }
      return new Response(readable, { status: 200, headers });
    } catch (error48) {
      this.onerror?.(error48);
      return this.createJsonErrorResponse(400, -32700, "Parse error", { data: String(error48) });
    }
  }
  /**
   * Handles DELETE requests to terminate sessions
   */
  async handleDeleteRequest(req) {
    const sessionError = this.validateSession(req);
    if (sessionError) {
      return sessionError;
    }
    const protocolError = this.validateProtocolVersion(req);
    if (protocolError) {
      return protocolError;
    }
    await Promise.resolve(this._onsessionclosed?.(this.sessionId));
    await this.close();
    return new Response(null, { status: 200 });
  }
  /**
   * Validates session ID for non-initialization requests.
   * Returns Response error if invalid, undefined otherwise
   */
  validateSession(req) {
    if (this.sessionIdGenerator === void 0) {
      return void 0;
    }
    if (!this._initialized) {
      this.onerror?.(new Error("Bad Request: Server not initialized"));
      return this.createJsonErrorResponse(400, -32e3, "Bad Request: Server not initialized");
    }
    const sessionId = req.headers.get("mcp-session-id");
    if (!sessionId) {
      this.onerror?.(new Error("Bad Request: Mcp-Session-Id header is required"));
      return this.createJsonErrorResponse(400, -32e3, "Bad Request: Mcp-Session-Id header is required");
    }
    if (sessionId !== this.sessionId) {
      this.onerror?.(new Error("Session not found"));
      return this.createJsonErrorResponse(404, -32001, "Session not found");
    }
    return void 0;
  }
  /**
   * Validates the MCP-Protocol-Version header on incoming requests.
   *
   * For initialization: Version negotiation handles unknown versions gracefully
   * (server responds with its supported version).
   *
   * For subsequent requests with MCP-Protocol-Version header:
   * - Accept if in supported list
   * - 400 if unsupported
   *
   * For HTTP requests without the MCP-Protocol-Version header:
   * - Accept and default to the version negotiated at initialization
   */
  validateProtocolVersion(req) {
    const protocolVersion = req.headers.get("mcp-protocol-version");
    if (protocolVersion !== null && !SUPPORTED_PROTOCOL_VERSIONS.includes(protocolVersion)) {
      this.onerror?.(new Error(`Bad Request: Unsupported protocol version: ${protocolVersion} (supported versions: ${SUPPORTED_PROTOCOL_VERSIONS.join(", ")})`));
      return this.createJsonErrorResponse(400, -32e3, `Bad Request: Unsupported protocol version: ${protocolVersion} (supported versions: ${SUPPORTED_PROTOCOL_VERSIONS.join(", ")})`);
    }
    return void 0;
  }
  async close() {
    this._streamMapping.forEach(({ cleanup }) => {
      cleanup();
    });
    this._streamMapping.clear();
    this._requestResponseMap.clear();
    this.onclose?.();
  }
  /**
   * Close an SSE stream for a specific request, triggering client reconnection.
   * Use this to implement polling behavior during long-running operations -
   * client will reconnect after the retry interval specified in the priming event.
   */
  closeSSEStream(requestId) {
    const streamId = this._requestToStreamMapping.get(requestId);
    if (!streamId)
      return;
    const stream = this._streamMapping.get(streamId);
    if (stream) {
      stream.cleanup();
    }
  }
  /**
   * Close the standalone GET SSE stream, triggering client reconnection.
   * Use this to implement polling behavior for server-initiated notifications.
   */
  closeStandaloneSSEStream() {
    const stream = this._streamMapping.get(this._standaloneSseStreamId);
    if (stream) {
      stream.cleanup();
    }
  }
  async send(message, options2) {
    let requestId = options2?.relatedRequestId;
    if (isJSONRPCResultResponse(message) || isJSONRPCErrorResponse(message)) {
      requestId = message.id;
    }
    if (requestId === void 0) {
      if (isJSONRPCResultResponse(message) || isJSONRPCErrorResponse(message)) {
        throw new Error("Cannot send a response on a standalone SSE stream unless resuming a previous client request");
      }
      let eventId;
      if (this._eventStore) {
        eventId = await this._eventStore.storeEvent(this._standaloneSseStreamId, message);
      }
      const standaloneSse = this._streamMapping.get(this._standaloneSseStreamId);
      if (standaloneSse === void 0) {
        return;
      }
      if (standaloneSse.controller && standaloneSse.encoder) {
        this.writeSSEEvent(standaloneSse.controller, standaloneSse.encoder, message, eventId);
      }
      return;
    }
    const streamId = this._requestToStreamMapping.get(requestId);
    if (!streamId) {
      throw new Error(`No connection established for request ID: ${String(requestId)}`);
    }
    const stream = this._streamMapping.get(streamId);
    if (!this._enableJsonResponse && stream?.controller && stream?.encoder) {
      let eventId;
      if (this._eventStore) {
        eventId = await this._eventStore.storeEvent(streamId, message);
      }
      this.writeSSEEvent(stream.controller, stream.encoder, message, eventId);
    }
    if (isJSONRPCResultResponse(message) || isJSONRPCErrorResponse(message)) {
      this._requestResponseMap.set(requestId, message);
      const relatedIds = Array.from(this._requestToStreamMapping.entries()).filter(([_, sid]) => sid === streamId).map(([id]) => id);
      const allResponsesReady = relatedIds.every((id) => this._requestResponseMap.has(id));
      if (allResponsesReady) {
        if (!stream) {
          throw new Error(`No connection established for request ID: ${String(requestId)}`);
        }
        if (this._enableJsonResponse && stream.resolveJson) {
          const headers = {
            "Content-Type": "application/json"
          };
          if (this.sessionId !== void 0) {
            headers["mcp-session-id"] = this.sessionId;
          }
          const responses = relatedIds.map((id) => this._requestResponseMap.get(id));
          if (responses.length === 1) {
            stream.resolveJson(new Response(JSON.stringify(responses[0]), { status: 200, headers }));
          } else {
            stream.resolveJson(new Response(JSON.stringify(responses), { status: 200, headers }));
          }
        } else {
          stream.cleanup();
        }
        for (const id of relatedIds) {
          this._requestResponseMap.delete(id);
          this._requestToStreamMapping.delete(id);
        }
      }
    }
  }
};

// node_modules/@modelcontextprotocol/sdk/dist/esm/server/streamableHttp.js
var StreamableHTTPServerTransport = class {
  constructor(options2 = {}) {
    this._requestContext = /* @__PURE__ */ new WeakMap();
    this._webStandardTransport = new WebStandardStreamableHTTPServerTransport(options2);
    this._requestListener = getRequestListener(async (webRequest) => {
      const context = this._requestContext.get(webRequest);
      return this._webStandardTransport.handleRequest(webRequest, {
        authInfo: context?.authInfo,
        parsedBody: context?.parsedBody
      });
    }, { overrideGlobalObjects: false });
  }
  /**
   * Gets the session ID for this transport instance.
   */
  get sessionId() {
    return this._webStandardTransport.sessionId;
  }
  /**
   * Sets callback for when the transport is closed.
   */
  set onclose(handler) {
    this._webStandardTransport.onclose = handler;
  }
  get onclose() {
    return this._webStandardTransport.onclose;
  }
  /**
   * Sets callback for transport errors.
   */
  set onerror(handler) {
    this._webStandardTransport.onerror = handler;
  }
  get onerror() {
    return this._webStandardTransport.onerror;
  }
  /**
   * Sets callback for incoming messages.
   */
  set onmessage(handler) {
    this._webStandardTransport.onmessage = handler;
  }
  get onmessage() {
    return this._webStandardTransport.onmessage;
  }
  /**
   * Starts the transport. This is required by the Transport interface but is a no-op
   * for the Streamable HTTP transport as connections are managed per-request.
   */
  async start() {
    return this._webStandardTransport.start();
  }
  /**
   * Closes the transport and all active connections.
   */
  async close() {
    return this._webStandardTransport.close();
  }
  /**
   * Sends a JSON-RPC message through the transport.
   */
  async send(message, options2) {
    return this._webStandardTransport.send(message, options2);
  }
  /**
   * Handles an incoming HTTP request, whether GET or POST.
   *
   * This method converts Node.js HTTP objects to Web Standard Request/Response
   * and delegates to the underlying WebStandardStreamableHTTPServerTransport.
   *
   * @param req - Node.js IncomingMessage, optionally with auth property from middleware
   * @param res - Node.js ServerResponse
   * @param parsedBody - Optional pre-parsed body from body-parser middleware
   */
  async handleRequest(req, res, parsedBody) {
    const authInfo = req.auth;
    const handler = getRequestListener(async (webRequest) => {
      return this._webStandardTransport.handleRequest(webRequest, {
        authInfo,
        parsedBody
      });
    }, { overrideGlobalObjects: false });
    await handler(req, res);
  }
  /**
   * Close an SSE stream for a specific request, triggering client reconnection.
   * Use this to implement polling behavior during long-running operations -
   * client will reconnect after the retry interval specified in the priming event.
   */
  closeSSEStream(requestId) {
    this._webStandardTransport.closeSSEStream(requestId);
  }
  /**
   * Close the standalone GET SSE stream, triggering client reconnection.
   * Use this to implement polling behavior for server-initiated notifications.
   */
  closeStandaloneSSEStream() {
    this._webStandardTransport.closeStandaloneSSEStream();
  }
};

// node_modules/eventsource-parser/dist/stream.js
var EventSourceParserStream = class extends TransformStream {
  constructor({ onError, onRetry, onComment } = {}) {
    let parser;
    super({
      start(controller) {
        parser = createParser({
          onEvent: (event) => {
            controller.enqueue(event);
          },
          onError(error48) {
            onError === "terminate" ? controller.error(error48) : typeof onError == "function" && onError(error48);
          },
          onRetry,
          onComment
        });
      },
      transform(chunk) {
        parser.feed(chunk);
      }
    });
  }
};

// node_modules/@modelcontextprotocol/sdk/dist/esm/client/streamableHttp.js
var DEFAULT_STREAMABLE_HTTP_RECONNECTION_OPTIONS = {
  initialReconnectionDelay: 1e3,
  maxReconnectionDelay: 3e4,
  reconnectionDelayGrowFactor: 1.5,
  maxRetries: 2
};
var StreamableHTTPError = class extends Error {
  constructor(code, message) {
    super(`Streamable HTTP error: ${message}`);
    this.code = code;
  }
};
var StreamableHTTPClientTransport = class {
  constructor(url2, opts) {
    this._hasCompletedAuthFlow = false;
    this._url = url2;
    this._resourceMetadataUrl = void 0;
    this._scope = void 0;
    this._requestInit = opts?.requestInit;
    this._authProvider = opts?.authProvider;
    this._fetch = opts?.fetch;
    this._fetchWithInit = createFetchWithInit(opts?.fetch, opts?.requestInit);
    this._sessionId = opts?.sessionId;
    this._reconnectionOptions = opts?.reconnectionOptions ?? DEFAULT_STREAMABLE_HTTP_RECONNECTION_OPTIONS;
  }
  async _authThenStart() {
    if (!this._authProvider) {
      throw new UnauthorizedError("No auth provider");
    }
    let result;
    try {
      result = await auth(this._authProvider, {
        serverUrl: this._url,
        resourceMetadataUrl: this._resourceMetadataUrl,
        scope: this._scope,
        fetchFn: this._fetchWithInit
      });
    } catch (error48) {
      this.onerror?.(error48);
      throw error48;
    }
    if (result !== "AUTHORIZED") {
      throw new UnauthorizedError();
    }
    return await this._startOrAuthSse({ resumptionToken: void 0 });
  }
  async _commonHeaders() {
    const headers = {};
    if (this._authProvider) {
      const tokens = await this._authProvider.tokens();
      if (tokens) {
        headers["Authorization"] = `Bearer ${tokens.access_token}`;
      }
    }
    if (this._sessionId) {
      headers["mcp-session-id"] = this._sessionId;
    }
    if (this._protocolVersion) {
      headers["mcp-protocol-version"] = this._protocolVersion;
    }
    const extraHeaders = normalizeHeaders(this._requestInit?.headers);
    return new Headers({
      ...headers,
      ...extraHeaders
    });
  }
  async _startOrAuthSse(options2) {
    const { resumptionToken } = options2;
    try {
      const headers = await this._commonHeaders();
      headers.set("Accept", "text/event-stream");
      if (resumptionToken) {
        headers.set("last-event-id", resumptionToken);
      }
      const response = await (this._fetch ?? fetch)(this._url, {
        method: "GET",
        headers,
        signal: this._abortController?.signal
      });
      if (!response.ok) {
        await response.body?.cancel();
        if (response.status === 401 && this._authProvider) {
          return await this._authThenStart();
        }
        if (response.status === 405) {
          return;
        }
        throw new StreamableHTTPError(response.status, `Failed to open SSE stream: ${response.statusText}`);
      }
      this._handleSseStream(response.body, options2, true);
    } catch (error48) {
      this.onerror?.(error48);
      throw error48;
    }
  }
  /**
   * Calculates the next reconnection delay using  backoff algorithm
   *
   * @param attempt Current reconnection attempt count for the specific stream
   * @returns Time to wait in milliseconds before next reconnection attempt
   */
  _getNextReconnectionDelay(attempt) {
    if (this._serverRetryMs !== void 0) {
      return this._serverRetryMs;
    }
    const initialDelay = this._reconnectionOptions.initialReconnectionDelay;
    const growFactor = this._reconnectionOptions.reconnectionDelayGrowFactor;
    const maxDelay = this._reconnectionOptions.maxReconnectionDelay;
    return Math.min(initialDelay * Math.pow(growFactor, attempt), maxDelay);
  }
  /**
   * Schedule a reconnection attempt using server-provided retry interval or backoff
   *
   * @param lastEventId The ID of the last received event for resumability
   * @param attemptCount Current reconnection attempt count for this specific stream
   */
  _scheduleReconnection(options2, attemptCount = 0) {
    const maxRetries = this._reconnectionOptions.maxRetries;
    if (attemptCount >= maxRetries) {
      this.onerror?.(new Error(`Maximum reconnection attempts (${maxRetries}) exceeded.`));
      return;
    }
    const delay = this._getNextReconnectionDelay(attemptCount);
    this._reconnectionTimeout = setTimeout(() => {
      this._startOrAuthSse(options2).catch((error48) => {
        this.onerror?.(new Error(`Failed to reconnect SSE stream: ${error48 instanceof Error ? error48.message : String(error48)}`));
        this._scheduleReconnection(options2, attemptCount + 1);
      });
    }, delay);
  }
  _handleSseStream(stream, options2, isReconnectable) {
    if (!stream) {
      return;
    }
    const { onresumptiontoken, replayMessageId } = options2;
    let lastEventId;
    let hasPrimingEvent = false;
    let receivedResponse = false;
    const processStream = async () => {
      try {
        const reader = stream.pipeThrough(new TextDecoderStream()).pipeThrough(new EventSourceParserStream({
          onRetry: (retryMs) => {
            this._serverRetryMs = retryMs;
          }
        })).getReader();
        while (true) {
          const { value: event, done } = await reader.read();
          if (done) {
            break;
          }
          if (event.id) {
            lastEventId = event.id;
            hasPrimingEvent = true;
            onresumptiontoken?.(event.id);
          }
          if (!event.data) {
            continue;
          }
          if (!event.event || event.event === "message") {
            try {
              const message = JSONRPCMessageSchema.parse(JSON.parse(event.data));
              if (isJSONRPCResultResponse(message)) {
                receivedResponse = true;
                if (replayMessageId !== void 0) {
                  message.id = replayMessageId;
                }
              }
              this.onmessage?.(message);
            } catch (error48) {
              this.onerror?.(error48);
            }
          }
        }
        const canResume = isReconnectable || hasPrimingEvent;
        const needsReconnect = canResume && !receivedResponse;
        if (needsReconnect && this._abortController && !this._abortController.signal.aborted) {
          this._scheduleReconnection({
            resumptionToken: lastEventId,
            onresumptiontoken,
            replayMessageId
          }, 0);
        }
      } catch (error48) {
        this.onerror?.(new Error(`SSE stream disconnected: ${error48}`));
        const canResume = isReconnectable || hasPrimingEvent;
        const needsReconnect = canResume && !receivedResponse;
        if (needsReconnect && this._abortController && !this._abortController.signal.aborted) {
          try {
            this._scheduleReconnection({
              resumptionToken: lastEventId,
              onresumptiontoken,
              replayMessageId
            }, 0);
          } catch (error49) {
            this.onerror?.(new Error(`Failed to reconnect: ${error49 instanceof Error ? error49.message : String(error49)}`));
          }
        }
      }
    };
    processStream();
  }
  async start() {
    if (this._abortController) {
      throw new Error("StreamableHTTPClientTransport already started! If using Client class, note that connect() calls start() automatically.");
    }
    this._abortController = new AbortController();
  }
  /**
   * Call this method after the user has finished authorizing via their user agent and is redirected back to the MCP client application. This will exchange the authorization code for an access token, enabling the next connection attempt to successfully auth.
   */
  async finishAuth(authorizationCode) {
    if (!this._authProvider) {
      throw new UnauthorizedError("No auth provider");
    }
    const result = await auth(this._authProvider, {
      serverUrl: this._url,
      authorizationCode,
      resourceMetadataUrl: this._resourceMetadataUrl,
      scope: this._scope,
      fetchFn: this._fetchWithInit
    });
    if (result !== "AUTHORIZED") {
      throw new UnauthorizedError("Failed to authorize");
    }
  }
  async close() {
    if (this._reconnectionTimeout) {
      clearTimeout(this._reconnectionTimeout);
      this._reconnectionTimeout = void 0;
    }
    this._abortController?.abort();
    this.onclose?.();
  }
  async send(message, options2) {
    try {
      const { resumptionToken, onresumptiontoken } = options2 || {};
      if (resumptionToken) {
        this._startOrAuthSse({ resumptionToken, replayMessageId: isJSONRPCRequest(message) ? message.id : void 0 }).catch((err) => this.onerror?.(err));
        return;
      }
      const headers = await this._commonHeaders();
      headers.set("content-type", "application/json");
      headers.set("accept", "application/json, text/event-stream");
      const init = {
        ...this._requestInit,
        method: "POST",
        headers,
        body: JSON.stringify(message),
        signal: this._abortController?.signal
      };
      const response = await (this._fetch ?? fetch)(this._url, init);
      const sessionId = response.headers.get("mcp-session-id");
      if (sessionId) {
        this._sessionId = sessionId;
      }
      if (!response.ok) {
        const text = await response.text().catch(() => null);
        if (response.status === 401 && this._authProvider) {
          if (this._hasCompletedAuthFlow) {
            throw new StreamableHTTPError(401, "Server returned 401 after successful authentication");
          }
          const { resourceMetadataUrl, scope } = extractWWWAuthenticateParams(response);
          this._resourceMetadataUrl = resourceMetadataUrl;
          this._scope = scope;
          const result = await auth(this._authProvider, {
            serverUrl: this._url,
            resourceMetadataUrl: this._resourceMetadataUrl,
            scope: this._scope,
            fetchFn: this._fetchWithInit
          });
          if (result !== "AUTHORIZED") {
            throw new UnauthorizedError();
          }
          this._hasCompletedAuthFlow = true;
          return this.send(message);
        }
        if (response.status === 403 && this._authProvider) {
          const { resourceMetadataUrl, scope, error: error48 } = extractWWWAuthenticateParams(response);
          if (error48 === "insufficient_scope") {
            const wwwAuthHeader = response.headers.get("WWW-Authenticate");
            if (this._lastUpscopingHeader === wwwAuthHeader) {
              throw new StreamableHTTPError(403, "Server returned 403 after trying upscoping");
            }
            if (scope) {
              this._scope = scope;
            }
            if (resourceMetadataUrl) {
              this._resourceMetadataUrl = resourceMetadataUrl;
            }
            this._lastUpscopingHeader = wwwAuthHeader ?? void 0;
            const result = await auth(this._authProvider, {
              serverUrl: this._url,
              resourceMetadataUrl: this._resourceMetadataUrl,
              scope: this._scope,
              fetchFn: this._fetch
            });
            if (result !== "AUTHORIZED") {
              throw new UnauthorizedError();
            }
            return this.send(message);
          }
        }
        throw new StreamableHTTPError(response.status, `Error POSTing to endpoint: ${text}`);
      }
      this._hasCompletedAuthFlow = false;
      this._lastUpscopingHeader = void 0;
      if (response.status === 202) {
        await response.body?.cancel();
        if (isInitializedNotification(message)) {
          this._startOrAuthSse({ resumptionToken: void 0 }).catch((err) => this.onerror?.(err));
        }
        return;
      }
      const messages = Array.isArray(message) ? message : [message];
      const hasRequests = messages.filter((msg) => "method" in msg && "id" in msg && msg.id !== void 0).length > 0;
      const contentType2 = response.headers.get("content-type");
      if (hasRequests) {
        if (contentType2?.includes("text/event-stream")) {
          this._handleSseStream(response.body, { onresumptiontoken }, false);
        } else if (contentType2?.includes("application/json")) {
          const data = await response.json();
          const responseMessages = Array.isArray(data) ? data.map((msg) => JSONRPCMessageSchema.parse(msg)) : [JSONRPCMessageSchema.parse(data)];
          for (const msg of responseMessages) {
            this.onmessage?.(msg);
          }
        } else {
          await response.body?.cancel();
          throw new StreamableHTTPError(-1, `Unexpected content type: ${contentType2}`);
        }
      } else {
        await response.body?.cancel();
      }
    } catch (error48) {
      this.onerror?.(error48);
      throw error48;
    }
  }
  get sessionId() {
    return this._sessionId;
  }
  /**
   * Terminates the current session by sending a DELETE request to the server.
   *
   * Clients that no longer need a particular session
   * (e.g., because the user is leaving the client application) SHOULD send an
   * HTTP DELETE to the MCP endpoint with the Mcp-Session-Id header to explicitly
   * terminate the session.
   *
   * The server MAY respond with HTTP 405 Method Not Allowed, indicating that
   * the server does not allow clients to terminate sessions.
   */
  async terminateSession() {
    if (!this._sessionId) {
      return;
    }
    try {
      const headers = await this._commonHeaders();
      const init = {
        ...this._requestInit,
        method: "DELETE",
        headers,
        signal: this._abortController?.signal
      };
      const response = await (this._fetch ?? fetch)(this._url, init);
      await response.body?.cancel();
      if (!response.ok && response.status !== 405) {
        throw new StreamableHTTPError(response.status, `Failed to terminate session: ${response.statusText}`);
      }
      this._sessionId = void 0;
    } catch (error48) {
      this.onerror?.(error48);
      throw error48;
    }
  }
  setProtocolVersion(version2) {
    this._protocolVersion = version2;
  }
  get protocolVersion() {
    return this._protocolVersion;
  }
  /**
   * Resume an SSE stream from a previous event ID.
   * Opens a GET SSE connection with Last-Event-ID header to replay missed events.
   *
   * @param lastEventId The event ID to resume from
   * @param options Optional callback to receive new resumption tokens
   */
  async resumeStream(lastEventId, options2) {
    await this._startOrAuthSse({
      resumptionToken: lastEventId,
      onresumptiontoken: options2?.onresumptiontoken
    });
  }
};

// packages/playwright-core/src/utilsBundle.ts
var colors = import_safe.default;
var debug = import_debug.default;
var ini = iniLibrary;
var diff = libesm_exports;
var dotenv = import_dotenv.default;
var jpegjs = import_jpeg_js.default;
var mime = import_mime.default;
var minimatch = import_minimatch.default;
var open = import_open.default;
var progress = import_progress.default;
var ws = wrapper_default;
var wsServer = import_websocket_server.default;
var wsReceiver = import_receiver.default;
var wsSender = import_sender.default;
var yaml = import_yaml.default;
var json5 = import_json5.default;
var sourceMapSupport = import_source_map_support.default;
var enquirer = import_enquirer.default;
var chokidar = import_chokidar.default;
var getEastAsianWidth = get_east_asian_width_exports;
var gracefulFs = gracefulFsLibrary;
var retry = import_retry.default;
var onExit = import_signal_exit.default;
var getStream = import_get_stream.default;
var httpProxyAgent = import_https_proxy_agent2.default;
var socksProxyAgent = import_socks_proxy_agent2.default;
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  CallToolRequestSchema,
  Client,
  HttpsProxyAgent,
  ListRootsRequestSchema,
  ListToolsRequestSchema,
  PNG,
  PingRequestSchema,
  ProgramOption,
  ProgressNotificationSchema,
  SSEClientTransport,
  SSEServerTransport,
  Server,
  SocksProxyAgent,
  StdioClientTransport,
  StdioServerTransport,
  StreamableHTTPClientTransport,
  StreamableHTTPServerTransport,
  chokidar,
  colors,
  debug,
  diff,
  dotenv,
  enquirer,
  getEastAsianWidth,
  getProxyForUrl,
  getStream,
  gracefulFs,
  httpProxyAgent,
  ini,
  jpegjs,
  json5,
  mime,
  minimatch,
  onExit,
  open,
  program,
  progress,
  retry,
  socksProxyAgent,
  sourceMapSupport,
  ws,
  wsReceiver,
  wsSender,
  wsServer,
  yaml,
  yauzl,
  yazl,
  z,
  zodToJsonSchema
});
/*! Bundled license information:

progress/lib/node-progress.js:
  (*!
   * node-progress
   * Copyright(c) 2011 TJ Holowaychuk <tj@vision-media.ca>
   * MIT Licensed
   *)

normalize-path/index.js:
  (*!
   * normalize-path <https://github.com/jonschlinkert/normalize-path>
   *
   * Copyright (c) 2014-2018, Jon Schlinkert.
   * Released under the MIT License.
   *)

is-extglob/index.js:
  (*!
   * is-extglob <https://github.com/jonschlinkert/is-extglob>
   *
   * Copyright (c) 2014-2016, Jon Schlinkert.
   * Licensed under the MIT License.
   *)

is-glob/index.js:
  (*!
   * is-glob <https://github.com/jonschlinkert/is-glob>
   *
   * Copyright (c) 2014-2017, Jon Schlinkert.
   * Released under the MIT License.
   *)

is-number/index.js:
  (*!
   * is-number <https://github.com/jonschlinkert/is-number>
   *
   * Copyright (c) 2014-present, Jon Schlinkert.
   * Released under the MIT License.
   *)

to-regex-range/index.js:
  (*!
   * to-regex-range <https://github.com/micromatch/to-regex-range>
   *
   * Copyright (c) 2015-present, Jon Schlinkert.
   * Released under the MIT License.
   *)

fill-range/index.js:
  (*!
   * fill-range <https://github.com/jonschlinkert/fill-range>
   *
   * Copyright (c) 2014-present, Jon Schlinkert.
   * Licensed under the MIT License.
   *)

bytes/index.js:
  (*!
   * bytes
   * Copyright(c) 2012-2014 TJ Holowaychuk
   * Copyright(c) 2015 Jed Watson
   * MIT Licensed
   *)

content-type/index.js:
  (*!
   * content-type
   * Copyright(c) 2015 Douglas Christopher Wilson
   * MIT Licensed
   *)
*/
packages/playwright-core/lib/utilsBundle.js

THIRD-PARTY SOFTWARE NOTICES AND INFORMATION

The following npm packages are inlined into this bundle.

- @hono/node-server@1.19.11 (https://github.com/honojs/node-server)
- @modelcontextprotocol/sdk@1.29.0 (https://github.com/modelcontextprotocol/typescript-sdk)
- agent-base@7.1.4 (https://github.com/TooTallNate/proxy-agents)
- ajv-formats@3.0.1 (https://github.com/ajv-validator/ajv-formats)
- ajv@8.18.0 (https://github.com/ajv-validator/ajv)
- ansi-colors@4.1.3 (https://github.com/doowb/ansi-colors)
- anymatch@3.1.3 (https://github.com/micromatch/anymatch)
- balanced-match@1.0.2 (https://github.com/juliangruber/balanced-match)
- binary-extensions@2.3.0 (https://github.com/sindresorhus/binary-extensions)
- brace-expansion@1.1.12 (https://github.com/juliangruber/brace-expansion)
- braces@3.0.3 (https://github.com/micromatch/braces)
- buffer-crc32@0.2.13 (https://github.com/brianloveswords/buffer-crc32)
- buffer-from@1.1.2 (https://github.com/LinusU/buffer-from)
- bytes@3.1.2 (https://github.com/visionmedia/bytes.js)
- chokidar@3.6.0 (https://github.com/paulmillr/chokidar)
- colors@1.4.0 (https://github.com/Marak/colors.js)
- commander@13.1.0 (https://github.com/tj/commander.js)
- concat-map@0.0.1 (https://github.com/substack/node-concat-map)
- content-type@1.0.5 (https://github.com/jshttp/content-type)
- cross-spawn@7.0.6 (https://github.com/moxystudio/node-cross-spawn)
- debug@4.4.3 (https://github.com/debug-js/debug)
- define-lazy-prop@2.0.0 (https://github.com/sindresorhus/define-lazy-prop)
- diff@8.0.4 (https://github.com/kpdecker/jsdiff)
- dotenv@16.6.1 (https://github.com/motdotla/dotenv)
- end-of-stream@1.4.5 (https://github.com/mafintosh/end-of-stream)
- enquirer@2.3.6 (https://github.com/enquirer/enquirer)
- eventsource-parser@3.0.6 (https://github.com/rexxars/eventsource-parser)
- eventsource@3.0.7 (git://git@github.com/EventSource/eventsource)
- fast-deep-equal@3.1.3 (https://github.com/epoberezkin/fast-deep-equal)
- fast-uri@3.1.2 (https://github.com/fastify/fast-uri)
- fill-range@7.1.1 (https://github.com/jonschlinkert/fill-range)
- get-east-asian-width@1.3.0 (https://github.com/sindresorhus/get-east-asian-width)
- get-stream@5.2.0 (https://github.com/sindresorhus/get-stream)
- glob-parent@5.1.2 (https://github.com/gulpjs/glob-parent)
- graceful-fs@4.2.10 (https://github.com/isaacs/node-graceful-fs)
- has-flag@4.0.0 (https://github.com/sindresorhus/has-flag)
- https-proxy-agent@7.0.6 (https://github.com/TooTallNate/proxy-agents)
- ini@6.0.0 (https://github.com/npm/ini)
- ip-address@10.2.0 (https://github.com/beaugunderson/ip-address)
- is-binary-path@2.1.0 (https://github.com/sindresorhus/is-binary-path)
- is-docker@2.2.1 (https://github.com/sindresorhus/is-docker)
- is-extglob@2.1.1 (https://github.com/jonschlinkert/is-extglob)
- is-glob@4.0.3 (https://github.com/micromatch/is-glob)
- is-number@7.0.0 (https://github.com/jonschlinkert/is-number)
- is-wsl@2.2.0 (https://github.com/sindresorhus/is-wsl)
- isexe@2.0.0 (https://github.com/isaacs/isexe)
- jpeg-js@0.4.4 (https://github.com/eugeneware/jpeg-js)
- json-schema-traverse@1.0.0 (https://github.com/epoberezkin/json-schema-traverse)
- json5@2.2.3 (https://github.com/json5/json5)
- mime@3.0.0 (https://github.com/broofa/mime)
- minimatch@3.1.5 (https://github.com/isaacs/minimatch)
- ms@2.1.3 (https://github.com/vercel/ms)
- normalize-path@3.0.0 (https://github.com/jonschlinkert/normalize-path)
- once@1.4.0 (https://github.com/isaacs/once)
- open@8.4.0 (https://github.com/sindresorhus/open)
- path-key@3.1.1 (https://github.com/sindresorhus/path-key)
- pend@1.2.0 (https://github.com/andrewrk/node-pend)
- picomatch@2.3.2 (https://github.com/micromatch/picomatch)
- pkce-challenge@5.0.0 (https://github.com/crouchcd/pkce-challenge)
- pngjs@6.0.0 (https://github.com/lukeapage/pngjs)
- progress@2.0.3 (https://github.com/visionmedia/node-progress)
- proxy-from-env@2.0.0 (https://github.com/Rob--W/proxy-from-env)
- pump@3.0.3 (https://github.com/mafintosh/pump)
- readdirp@3.6.0 (https://github.com/paulmillr/readdirp)
- retry@0.12.0 (https://github.com/tim-kos/node-retry)
- shebang-command@2.0.0 (https://github.com/kevva/shebang-command)
- shebang-regex@3.0.0 (https://github.com/sindresorhus/shebang-regex)
- signal-exit@3.0.7 (https://github.com/tapjs/signal-exit)
- smart-buffer@4.2.0 (https://github.com/JoshGlazebrook/smart-buffer)
- socks-proxy-agent@8.0.5 (https://github.com/TooTallNate/proxy-agents)
- socks@2.8.7 (https://github.com/JoshGlazebrook/socks)
- source-map-support@0.5.21 (https://github.com/evanw/node-source-map-support)
- source-map@0.6.1 (https://github.com/mozilla/source-map)
- supports-color@8.1.1 (https://github.com/chalk/supports-color)
- to-regex-range@5.0.1 (https://github.com/micromatch/to-regex-range)
- which@2.0.2 (https://github.com/isaacs/node-which)
- wrappy@1.0.2 (https://github.com/npm/wrappy)
- ws@8.17.1 (https://github.com/websockets/ws)
- yaml@2.8.3 (https://github.com/eemeli/yaml)
- yauzl@3.3.2 (https://github.com/thejoshwolfe/yauzl)
- yazl@2.5.1 (https://github.com/thejoshwolfe/yazl)
- zod-to-json-schema@3.25.1 (https://github.com/StefanTerdell/zod-to-json-schema)
- zod@4.3.6 (https://github.com/colinhacks/zod)

%% @hono/node-server@1.19.11 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License

Copyright (c) 2022 - present, Yusuke Wada and Hono contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
=========================================
END OF @hono/node-server@1.19.11 NOTICES AND INFORMATION

%% @modelcontextprotocol/sdk@1.29.0 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License

Copyright (c) 2024 Anthropic, PBC

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
=========================================
END OF @modelcontextprotocol/sdk@1.29.0 NOTICES AND INFORMATION

%% agent-base@7.1.4 NOTICES AND INFORMATION BEGIN HERE
=========================================
(The MIT License)

Copyright (c) 2013 Nathan Rajlich <nathan@tootallnate.net>

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF agent-base@7.1.4 NOTICES AND INFORMATION

%% ajv-formats@3.0.1 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License

Copyright (c) 2020 Evgeny Poberezkin

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
=========================================
END OF ajv-formats@3.0.1 NOTICES AND INFORMATION

%% ajv@8.18.0 NOTICES AND INFORMATION BEGIN HERE
=========================================
The MIT License (MIT)

Copyright (c) 2015-2021 Evgeny Poberezkin

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
=========================================
END OF ajv@8.18.0 NOTICES AND INFORMATION

%% ansi-colors@4.1.3 NOTICES AND INFORMATION BEGIN HERE
=========================================
The MIT License (MIT)

Copyright (c) 2015-present, Brian Woodward.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
=========================================
END OF ansi-colors@4.1.3 NOTICES AND INFORMATION

%% anymatch@3.1.3 NOTICES AND INFORMATION BEGIN HERE
=========================================
The ISC License

Copyright (c) 2019 Elan Shanker, Paul Miller (https://paulmillr.com)

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
=========================================
END OF anymatch@3.1.3 NOTICES AND INFORMATION

%% balanced-match@1.0.2 NOTICES AND INFORMATION BEGIN HERE
=========================================
(MIT)

Copyright (c) 2013 Julian Gruber &lt;julian@juliangruber.com&gt;

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
=========================================
END OF balanced-match@1.0.2 NOTICES AND INFORMATION

%% binary-extensions@2.3.0 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License

Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
Copyright (c) Paul Miller (https://paulmillr.com)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF binary-extensions@2.3.0 NOTICES AND INFORMATION

%% brace-expansion@1.1.12 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License

Copyright (c) 2013 Julian Gruber <julian@juliangruber.com>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
=========================================
END OF brace-expansion@1.1.12 NOTICES AND INFORMATION

%% braces@3.0.3 NOTICES AND INFORMATION BEGIN HERE
=========================================
The MIT License (MIT)

Copyright (c) 2014-present, Jon Schlinkert.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
=========================================
END OF braces@3.0.3 NOTICES AND INFORMATION

%% buffer-crc32@0.2.13 NOTICES AND INFORMATION BEGIN HERE
=========================================
The MIT License

Copyright (c) 2013 Brian J. Brennan

Permission is hereby granted, free of charge, to any person obtaining a copy 
of this software and associated documentation files (the "Software"), to deal in 
the Software without restriction, including without limitation the rights to use, 
copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the 
Software, and to permit persons to whom the Software is furnished to do so, 
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all 
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 
PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF buffer-crc32@0.2.13 NOTICES AND INFORMATION

%% buffer-from@1.1.2 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License

Copyright (c) 2016, 2018 Linus UnnebÃ¤ck

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
=========================================
END OF buffer-from@1.1.2 NOTICES AND INFORMATION

%% bytes@3.1.2 NOTICES AND INFORMATION BEGIN HERE
=========================================
(The MIT License)

Copyright (c) 2012-2014 TJ Holowaychuk <tj@vision-media.ca>
Copyright (c) 2015 Jed Watson <jed.watson@me.com>

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF bytes@3.1.2 NOTICES AND INFORMATION

%% chokidar@3.6.0 NOTICES AND INFORMATION BEGIN HERE
=========================================
The MIT License (MIT)

Copyright (c) 2012-2019 Paul Miller (https://paulmillr.com), Elan Shanker

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the â€œSoftwareâ€�), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED â€œAS ISâ€�, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
=========================================
END OF chokidar@3.6.0 NOTICES AND INFORMATION

%% colors@1.4.0 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License

Original Library
  - Copyright (c) Marak Squires

Additional Functionality
 - Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
=========================================
END OF colors@1.4.0 NOTICES AND INFORMATION

%% commander@13.1.0 NOTICES AND INFORMATION BEGIN HERE
=========================================
(The MIT License)

Copyright (c) 2011 TJ Holowaychuk <tj@vision-media.ca>

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF commander@13.1.0 NOTICES AND INFORMATION

%% concat-map@0.0.1 NOTICES AND INFORMATION BEGIN HERE
=========================================
This software is released under the MIT license:

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF concat-map@0.0.1 NOTICES AND INFORMATION

%% content-type@1.0.5 NOTICES AND INFORMATION BEGIN HERE
=========================================
(The MIT License)

Copyright (c) 2015 Douglas Christopher Wilson

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF content-type@1.0.5 NOTICES AND INFORMATION

%% cross-spawn@7.0.6 NOTICES AND INFORMATION BEGIN HERE
=========================================
The MIT License (MIT)

Copyright (c) 2018 Made With MOXY Lda <hello@moxy.studio>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
=========================================
END OF cross-spawn@7.0.6 NOTICES AND INFORMATION

%% debug@4.4.3 NOTICES AND INFORMATION BEGIN HERE
=========================================
(The MIT License)

Copyright (c) 2014-2017 TJ Holowaychuk <tj@vision-media.ca>
Copyright (c) 2018-2021 Josh Junon

Permission is hereby granted, free of charge, to any person obtaining a copy of this software
and associated documentation files (the 'Software'), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial
portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF debug@4.4.3 NOTICES AND INFORMATION

%% define-lazy-prop@2.0.0 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License

Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF define-lazy-prop@2.0.0 NOTICES AND INFORMATION

%% diff@8.0.4 NOTICES AND INFORMATION BEGIN HERE
=========================================
BSD 3-Clause License

Copyright (c) 2009-2015, Kevin Decker <kpdecker@gmail.com>
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
   list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
   this list of conditions and the following disclaimer in the documentation
   and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its
   contributors may be used to endorse or promote products derived from
   this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
=========================================
END OF diff@8.0.4 NOTICES AND INFORMATION

%% dotenv@16.6.1 NOTICES AND INFORMATION BEGIN HERE
=========================================
Copyright (c) 2015, Scott Motte
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this
  list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice,
  this list of conditions and the following disclaimer in the documentation
  and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
=========================================
END OF dotenv@16.6.1 NOTICES AND INFORMATION

%% end-of-stream@1.4.5 NOTICES AND INFORMATION BEGIN HERE
=========================================
The MIT License (MIT)

Copyright (c) 2014 Mathias Buus

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
=========================================
END OF end-of-stream@1.4.5 NOTICES AND INFORMATION

%% enquirer@2.3.6 NOTICES AND INFORMATION BEGIN HERE
=========================================
The MIT License (MIT)

Copyright (c) 2016-present, Jon Schlinkert.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
=========================================
END OF enquirer@2.3.6 NOTICES AND INFORMATION

%% eventsource-parser@3.0.6 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License

Copyright (c) 2025 Espen Hovlandsdal <espen@hovlandsdal.com>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
=========================================
END OF eventsource-parser@3.0.6 NOTICES AND INFORMATION

%% eventsource@3.0.7 NOTICES AND INFORMATION BEGIN HERE
=========================================
The MIT License

Copyright (c) EventSource GitHub organisation

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF eventsource@3.0.7 NOTICES AND INFORMATION

%% fast-deep-equal@3.1.3 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License

Copyright (c) 2017 Evgeny Poberezkin

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
=========================================
END OF fast-deep-equal@3.1.3 NOTICES AND INFORMATION

%% fast-uri@3.1.2 NOTICES AND INFORMATION BEGIN HERE
=========================================
Copyright (c) 2011-2021, Gary Court until https://github.com/garycourt/uri-js/commit/a1acf730b4bba3f1097c9f52e7d9d3aba8cdcaae
Copyright (c) 2021-present The Fastify team <https://github.com/fastify/fastify#team>
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
    * Redistributions of source code must retain the above copyright
      notice, this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above copyright
      notice, this list of conditions and the following disclaimer in the
      documentation and/or other materials provided with the distribution.
    * The names of any contributors may not be used to endorse or promote
      products derived from this software without specific prior written
      permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS AND CONTRIBUTORS BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

                                  *   *   *

The complete list of contributors can be found at:
- https://github.com/garycourt/uri-js/graphs/contributors
=========================================
END OF fast-uri@3.1.2 NOTICES AND INFORMATION

%% fill-range@7.1.1 NOTICES AND INFORMATION BEGIN HERE
=========================================
The MIT License (MIT)

Copyright (c) 2014-present, Jon Schlinkert.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
=========================================
END OF fill-range@7.1.1 NOTICES AND INFORMATION

%% get-east-asian-width@1.3.0 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License

Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF get-east-asian-width@1.3.0 NOTICES AND INFORMATION

%% get-stream@5.2.0 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License

Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF get-stream@5.2.0 NOTICES AND INFORMATION

%% glob-parent@5.1.2 NOTICES AND INFORMATION BEGIN HERE
=========================================
The ISC License

Copyright (c) 2015, 2019 Elan Shanker

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
=========================================
END OF glob-parent@5.1.2 NOTICES AND INFORMATION

%% graceful-fs@4.2.10 NOTICES AND INFORMATION BEGIN HERE
=========================================
The ISC License

Copyright (c) 2011-2022 Isaac Z. Schlueter, Ben Noordhuis, and Contributors

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
=========================================
END OF graceful-fs@4.2.10 NOTICES AND INFORMATION

%% has-flag@4.0.0 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License

Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF has-flag@4.0.0 NOTICES AND INFORMATION

%% https-proxy-agent@7.0.6 NOTICES AND INFORMATION BEGIN HERE
=========================================
(The MIT License)

Copyright (c) 2013 Nathan Rajlich <nathan@tootallnate.net>

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF https-proxy-agent@7.0.6 NOTICES AND INFORMATION

%% ini@6.0.0 NOTICES AND INFORMATION BEGIN HERE
=========================================
The ISC License

Copyright (c) Isaac Z. Schlueter and Contributors

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
=========================================
END OF ini@6.0.0 NOTICES AND INFORMATION

%% ip-address@10.2.0 NOTICES AND INFORMATION BEGIN HERE
=========================================
Copyright (C) 2011 by Beau Gunderson

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
=========================================
END OF ip-address@10.2.0 NOTICES AND INFORMATION

%% is-binary-path@2.1.0 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License

Copyright (c) 2019 Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com), Paul Miller (https://paulmillr.com)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF is-binary-path@2.1.0 NOTICES AND INFORMATION

%% is-docker@2.2.1 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License

Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF is-docker@2.2.1 NOTICES AND INFORMATION

%% is-extglob@2.1.1 NOTICES AND INFORMATION BEGIN HERE
=========================================
The MIT License (MIT)

Copyright (c) 2014-2016, Jon Schlinkert

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
=========================================
END OF is-extglob@2.1.1 NOTICES AND INFORMATION

%% is-glob@4.0.3 NOTICES AND INFORMATION BEGIN HERE
=========================================
The MIT License (MIT)

Copyright (c) 2014-2017, Jon Schlinkert.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
=========================================
END OF is-glob@4.0.3 NOTICES AND INFORMATION

%% is-number@7.0.0 NOTICES AND INFORMATION BEGIN HERE
=========================================
The MIT License (MIT)

Copyright (c) 2014-present, Jon Schlinkert.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
=========================================
END OF is-number@7.0.0 NOTICES AND INFORMATION

%% is-wsl@2.2.0 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License

Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF is-wsl@2.2.0 NOTICES AND INFORMATION

%% isexe@2.0.0 NOTICES AND INFORMATION BEGIN HERE
=========================================
The ISC License

Copyright (c) Isaac Z. Schlueter and Contributors

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
=========================================
END OF isexe@2.0.0 NOTICES AND INFORMATION

%% jpeg-js@0.4.4 NOTICES AND INFORMATION BEGIN HERE
=========================================
Copyright (c) 2014, Eugene Ware
All rights reserved.
  
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:  

1. Redistributions of source code must retain the above copyright
   notice, this list of conditions and the following disclaimer.  
2. Redistributions in binary form must reproduce the above copyright
   notice, this list of conditions and the following disclaimer in the
   documentation and/or other materials provided with the distribution.  
3. Neither the name of Eugene Ware nor the names of its contributors
   may be used to endorse or promote products derived from this software
   without specific prior written permission.  
  
THIS SOFTWARE IS PROVIDED BY EUGENE WARE ''AS IS'' AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL EUGENE WARE BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
=========================================
END OF jpeg-js@0.4.4 NOTICES AND INFORMATION

%% json-schema-traverse@1.0.0 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License

Copyright (c) 2017 Evgeny Poberezkin

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
=========================================
END OF json-schema-traverse@1.0.0 NOTICES AND INFORMATION

%% json5@2.2.3 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License

Copyright (c) 2012-2018 Aseem Kishore, and [others].

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

[others]: https://github.com/json5/json5/contributors
=========================================
END OF json5@2.2.3 NOTICES AND INFORMATION

%% mime@3.0.0 NOTICES AND INFORMATION BEGIN HERE
=========================================
The MIT License (MIT)

Copyright (c) 2010 Benjamin Thomas, Robert Kieffer

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
=========================================
END OF mime@3.0.0 NOTICES AND INFORMATION

%% minimatch@3.1.5 NOTICES AND INFORMATION BEGIN HERE
=========================================
The ISC License

Copyright (c) Isaac Z. Schlueter and Contributors

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
=========================================
END OF minimatch@3.1.5 NOTICES AND INFORMATION

%% ms@2.1.3 NOTICES AND INFORMATION BEGIN HERE
=========================================
The MIT License (MIT)

Copyright (c) 2020 Vercel, Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
=========================================
END OF ms@2.1.3 NOTICES AND INFORMATION

%% normalize-path@3.0.0 NOTICES AND INFORMATION BEGIN HERE
=========================================
The MIT License (MIT)

Copyright (c) 2014-2018, Jon Schlinkert.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
=========================================
END OF normalize-path@3.0.0 NOTICES AND INFORMATION

%% once@1.4.0 NOTICES AND INFORMATION BEGIN HERE
=========================================
The ISC License

Copyright (c) Isaac Z. Schlueter and Contributors

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
=========================================
END OF once@1.4.0 NOTICES AND INFORMATION

%% open@8.4.0 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License

Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF open@8.4.0 NOTICES AND INFORMATION

%% path-key@3.1.1 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License

Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF path-key@3.1.1 NOTICES AND INFORMATION

%% pend@1.2.0 NOTICES AND INFORMATION BEGIN HERE
=========================================
The MIT License (Expat)

Copyright (c) 2014 Andrew Kelley

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation files
(the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
=========================================
END OF pend@1.2.0 NOTICES AND INFORMATION

%% picomatch@2.3.2 NOTICES AND INFORMATION BEGIN HERE
=========================================
The MIT License (MIT)

Copyright (c) 2017-present, Jon Schlinkert.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
=========================================
END OF picomatch@2.3.2 NOTICES AND INFORMATION

%% pkce-challenge@5.0.0 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License

Copyright (c) 2019 

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
=========================================
END OF pkce-challenge@5.0.0 NOTICES AND INFORMATION

%% pngjs@6.0.0 NOTICES AND INFORMATION BEGIN HERE
=========================================
pngjs2 original work Copyright (c) 2015 Luke Page & Original Contributors
pngjs derived work Copyright (c) 2012 Kuba Niegowski

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
=========================================
END OF pngjs@6.0.0 NOTICES AND INFORMATION

%% progress@2.0.3 NOTICES AND INFORMATION BEGIN HERE
=========================================
(The MIT License)

Copyright (c) 2017 TJ Holowaychuk <tj@vision-media.ca>

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF progress@2.0.3 NOTICES AND INFORMATION

%% proxy-from-env@2.0.0 NOTICES AND INFORMATION BEGIN HERE
=========================================
The MIT License

Copyright (C) 2016-2018 Rob Wu <rob@robwu.nl>

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF proxy-from-env@2.0.0 NOTICES AND INFORMATION

%% pump@3.0.3 NOTICES AND INFORMATION BEGIN HERE
=========================================
The MIT License (MIT)

Copyright (c) 2014 Mathias Buus

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
=========================================
END OF pump@3.0.3 NOTICES AND INFORMATION

%% readdirp@3.6.0 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License

Copyright (c) 2012-2019 Thorsten Lorenz, Paul Miller (https://paulmillr.com)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
=========================================
END OF readdirp@3.6.0 NOTICES AND INFORMATION

%% retry@0.12.0 NOTICES AND INFORMATION BEGIN HERE
=========================================
Copyright (c) 2011:
Tim KoschÃ¼tzki (tim@debuggable.com)
Felix GeisendÃ¶rfer (felix@debuggable.com)

 Permission is hereby granted, free of charge, to any person obtaining a copy
 of this software and associated documentation files (the "Software"), to deal
 in the Software without restriction, including without limitation the rights
 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 copies of the Software, and to permit persons to whom the Software is
 furnished to do so, subject to the following conditions:

 The above copyright notice and this permission notice shall be included in
 all copies or substantial portions of the Software.

 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 THE SOFTWARE.
=========================================
END OF retry@0.12.0 NOTICES AND INFORMATION

%% shebang-command@2.0.0 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License

Copyright (c) Kevin MÃ¥rtensson <kevinmartensson@gmail.com> (github.com/kevva)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF shebang-command@2.0.0 NOTICES AND INFORMATION

%% shebang-regex@3.0.0 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License

Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF shebang-regex@3.0.0 NOTICES AND INFORMATION

%% signal-exit@3.0.7 NOTICES AND INFORMATION BEGIN HERE
=========================================
The ISC License

Copyright (c) 2015, Contributors

Permission to use, copy, modify, and/or distribute this software
for any purpose with or without fee is hereby granted, provided
that the above copyright notice and this permission notice
appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE
LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
=========================================
END OF signal-exit@3.0.7 NOTICES AND INFORMATION

%% smart-buffer@4.2.0 NOTICES AND INFORMATION BEGIN HERE
=========================================
The MIT License (MIT)

Copyright (c) 2013-2017 Josh Glazebrook

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF smart-buffer@4.2.0 NOTICES AND INFORMATION

%% socks-proxy-agent@8.0.5 NOTICES AND INFORMATION BEGIN HERE
=========================================
(The MIT License)

Copyright (c) 2013 Nathan Rajlich <nathan@tootallnate.net>

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF socks-proxy-agent@8.0.5 NOTICES AND INFORMATION

%% socks@2.8.7 NOTICES AND INFORMATION BEGIN HERE
=========================================
The MIT License (MIT)

Copyright (c) 2013 Josh Glazebrook

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF socks@2.8.7 NOTICES AND INFORMATION

%% source-map-support@0.5.21 NOTICES AND INFORMATION BEGIN HERE
=========================================
The MIT License (MIT)

Copyright (c) 2014 Evan Wallace

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
=========================================
END OF source-map-support@0.5.21 NOTICES AND INFORMATION

%% source-map@0.6.1 NOTICES AND INFORMATION BEGIN HERE
=========================================
Copyright (c) 2009-2011, Mozilla Foundation and contributors
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this
  list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice,
  this list of conditions and the following disclaimer in the documentation
  and/or other materials provided with the distribution.

* Neither the names of the Mozilla Foundation nor the names of project
  contributors may be used to endorse or promote products derived from this
  software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
=========================================
END OF source-map@0.6.1 NOTICES AND INFORMATION

%% supports-color@8.1.1 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License

Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF supports-color@8.1.1 NOTICES AND INFORMATION

%% to-regex-range@5.0.1 NOTICES AND INFORMATION BEGIN HERE
=========================================
The MIT License (MIT)

Copyright (c) 2015-present, Jon Schlinkert.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
=========================================
END OF to-regex-range@5.0.1 NOTICES AND INFORMATION

%% which@2.0.2 NOTICES AND INFORMATION BEGIN HERE
=========================================
The ISC License

Copyright (c) Isaac Z. Schlueter and Contributors

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
=========================================
END OF which@2.0.2 NOTICES AND INFORMATION

%% wrappy@1.0.2 NOTICES AND INFORMATION BEGIN HERE
=========================================
The ISC License

Copyright (c) Isaac Z. Schlueter and Contributors

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
=========================================
END OF wrappy@1.0.2 NOTICES AND INFORMATION

%% ws@8.17.1 NOTICES AND INFORMATION BEGIN HERE
=========================================
Copyright (c) 2011 Einar Otto Stangvik <einaros@gmail.com>
Copyright (c) 2013 Arnout Kazemier and contributors
Copyright (c) 2016 Luigi Pinca and contributors

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF ws@8.17.1 NOTICES AND INFORMATION

%% yaml@2.8.3 NOTICES AND INFORMATION BEGIN HERE
=========================================
Copyright Eemeli Aro <eemeli@gmail.com>

Permission to use, copy, modify, and/or distribute this software for any purpose
with or without fee is hereby granted, provided that the above copyright notice
and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
THIS SOFTWARE.
=========================================
END OF yaml@2.8.3 NOTICES AND INFORMATION

%% yauzl@3.3.2 NOTICES AND INFORMATION BEGIN HERE
=========================================
The MIT License (MIT)

Copyright (c) 2014 Josh Wolfe

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
=========================================
END OF yauzl@3.3.2 NOTICES AND INFORMATION

%% yazl@2.5.1 NOTICES AND INFORMATION BEGIN HERE
=========================================
The MIT License (MIT)

Copyright (c) 2014 Josh Wolfe

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
=========================================
END OF yazl@2.5.1 NOTICES AND INFORMATION

%% zod-to-json-schema@3.25.1 NOTICES AND INFORMATION BEGIN HERE
=========================================
ISC License

Copyright (c) 2020, Stefan Terdell

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
=========================================
END OF zod-to-json-schema@3.25.1 NOTICES AND INFORMATION

%% zod@4.3.6 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License

Copyright (c) 2025 Colin McDonnell

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
=========================================
END OF zod@4.3.6 NOTICES AND INFORMATION

SUMMARY
=========================================
Total Packages: 83
=========================================     €  0GSUB ‹%z  8   TOS/27OKG  Œ   `cmapC›?{  	$  Þglyfòm(y  '¤  ÷headX— S   à   6hhea[ù   ¼   $hmtxAÿú  ì  8loca‹ÇV  $  žmaxpï�      name“÷¹K ¸  øpostcFÂ  °  $   ,    ,ÿÿÿþ.               Î      Tûùq_<õ ,    |%°€    |%°€ÿÿÿý.-             Îu         
 
   ÿ          
 0 > DFLT latn                      liga                     +�    Ë Ò   * Ë Ò   �  M                         PfEd Àê`ñ,   G                     ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,ÿÿ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,ÿÿ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,ÿÿ,  ,  ,  ,  ,  ,  ,  ,ÿÿ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,ÿÿ,  ,  ,  ,ÿÿ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,           ,     &           ,  
  & ô      êˆêŒêÇêÉë	ëNì4ñÿÿ  ê`êŠê�êÉêÌëëPñÿÿ                   b f Ö ÖPÖž    ñJG ´7•%nt NÃ`ji ‘ 60 † Ï þ A“ y ¾ › ˆC¨ É ¦ ¼ € ‹‘yˆ†z‰�‹„ ¾�    
            \ ] ^ _ b c " # $ % & ) + , - . / 0 2 3 4 5 < 9 = > ? @ B C F H I K U V W X g i k n r t u v w x z { | } ~  � ‚ „ … ‡ ‰ Œ � � “ ” • – — ˜ ™ š œ ž Ÿ   ¡ ¢ £ ¥ ¨ © ª ” « ¬ ® ¸ ¹ ½ À Ä Å È Ê Ë Ì Í Ó Ô Õ Ö × Ø Ù Ú ï ò ó ö ù ú û ü  (,-./123456;<=>?@ABDFHIKLNOPQRYZ[\]_defhkmqrsuv{|}~�‚ƒ…‡ŠŒŽ—˜¡¢¤¦§©ª«¬­±³´µ¸¹º¼½ÄÅÆÇÈÌÍ ô õ ÷ ø ` a p : q d� o s m [ ' (	 � ’ Æ²   e îU’* ºcb"w+9 Z» D
 Ž Á ÿ: *)! 7 8 J”¶°®¯ °SV lÉËÊš›œ�žŸ™  S$ �Â j Ñ Ý Ü Û Q P O  Ò ¯ ± Y hX ¤ f  Â Ã'   ! ý · í Þ ß ä â ã æ ç é ë ì á à– Î8 Š    	 ê å è  Ç ;   M ² ³^ Lap Ð£¥ Gl §¿ 1&E R ðMo ƒ €xg · µ ¶ÁÀ EWT T » ¿#  ­                                                                                                                                                                                                                                                                         ¸      Î  ê`  ê`     êa  êa   ñ  êb  êb  J  êc  êc  G  êd  êd   ´  êe  êe  7  êf  êf  •  êg  êg  %  êh  êh  n  êi  êi    êj  êj  t  êk  êk   N  êl  êl  Ã  êm  êm  `  ên  ên  j  êo  êo  i  êp  êp   ‘  êq  êq   6  êr  êr  0  ês  ês   †  êt  êt   Ï  êu  êu   þ  êv  êv   A  êw  êw  “  êx  êx   y  êy  êy     êz  êz  ¾  ê{  ê{   ›  ê|  ê|   ˆ  ê}  ê}  C  ê~  ê~    ê  ê    ê€  ê€    ê�  ê�  ¨  ê‚  ê‚   É  êƒ  êƒ   ¦  ê„  ê„   ¼  ê…  ê…     ê†  ê†  €  ê‡  ê‡   ‹  êˆ  êˆ  ‘  êŠ  êŠ  y  ê‹  ê‹  ˆ  êŒ  êŒ  †  ê�  ê�  z  ê�  ê�  ‰  ê‘  ê‘  �  ê’  ê’  ‹  ê“  ê“  „  ê”  ê”   ¾  ê•  ê•    ê–  ê–  �  ê—  ê—     ê˜  ê˜     ê™  ê™     êš  êš   
  ê›  ê›     êœ  êœ     ê�  ê�     êž  êž     êŸ  êŸ     ê   ê      ê¡  ê¡     ê¢  ê¢     ê£  ê£     ê¤  ê¤     ê¥  ê¥     ê¦  ê¦   \  ê§  ê§   ]  ê¨  ê¨   ^  ê©  ê©   _  êª  êª   b  ê«  ê«   c  ê¬  ê¬   "  ê­  ê­   #  ê®  ê®   $  ê¯  ê¯   %  ê°  ê°   &  ê±  ê±   )  ê²  ê²   +  ê³  ê³   ,  ê´  ê´   -  êµ  êµ   .  ê¶  ê¶   /  ê·  ê·   0  ê¸  ê¸   2  ê¹  ê¹   3  êº  êº   4  ê»  ê»   5  ê¼  ê¼   <  ê½  ê½   9  ê¾  ê¾   =  ê¿  ê¿   >  êÀ  êÀ   ?  êÁ  êÁ   @  êÂ  êÂ   B  êÃ  êÃ   C  êÄ  êÄ   F  êÅ  êÅ   H  êÆ  êÆ   I  êÇ  êÇ   K  êÉ  êÉ   U  êÌ  êÌ   V  êÍ  êÍ   W  êÎ  êÎ   X  êÏ  êÏ   g  êÐ  êÐ   i  êÑ  êÑ   k  êÒ  êÒ   n  êÓ  êÓ   r  êÔ  êÔ   t  êÕ  êÕ   u  êÖ  êÖ   v  ê×  ê×   w  êØ  êØ   x  êÙ  êÙ   z  êÚ  êÚ   {  êÛ  êÛ   |  êÜ  êÜ   }  êÝ  êÝ   ~  êÞ  êÞ     êß  êß   �  êà  êà   ‚  êá  êá   „  êâ  êâ   …  êã  êã   ‡  êä  êä   ‰  êå  êå   Œ  êæ  êæ   �  êç  êç   �  êè  êè   “  êé  êé   ”  êê  êê   •  êë  êë   –  êì  êì   —  êí  êí   ˜  êî  êî   ™  êï  êï   š  êð  êð   œ  êñ  êñ   ž  êò  êò   Ÿ  êó  êó      êô  êô   ¡  êõ  êõ   ¢  êö  êö   £  ê÷  ê÷   ¥  êø  êø   ¨  êù  êù   ©  êú  êú   ª  êû  êû   ”  êü  êü   «  êý  êý   ¬  êþ  êþ   ®  êÿ  êÿ   ¸  ë   ë    ¹  ë  ë   ½  ë  ë   À  ë  ë   Ä  ë  ë   Å  ë  ë   È  ë  ë   Ê  ë  ë   Ë  ë  ë   Ì  ë	  ë	   Í  ë  ë   Ó  ë  ë   Ô  ë  ë   Õ  ë  ë   Ö  ë  ë   ×  ë  ë   Ø  ë  ë   Ù  ë  ë   Ú  ë  ë   ï  ë  ë   ò  ë  ë   ó  ë  ë   ö  ë  ë   ù  ë  ë   ú  ë  ë   û  ë  ë   ü  ë  ë     ë  ë    ë  ë    ë  ë    ë  ë    ë   ë     ë!  ë!    ë"  ë"    ë#  ë#    ë$  ë$    ë%  ë%    ë&  ë&    ë'  ë'    ë(  ë(    ë)  ë)    ë*  ë*     ë+  ë+  (  ë,  ë,  ,  ë-  ë-  -  ë.  ë.  .  ë/  ë/  /  ë0  ë0  1  ë1  ë1  2  ë2  ë2  3  ë3  ë3  4  ë4  ë4  5  ë5  ë5  6  ë6  ë6  ;  ë7  ë7  <  ë8  ë8  =  ë9  ë9  >  ë:  ë:  ?  ë;  ë;  @  ë<  ë<  A  ë=  ë=  B  ë>  ë>  D  ë?  ë?  F  ë@  ë@  H  ëA  ëA  I  ëB  ëB  K  ëC  ëC  L  ëD  ëD  N  ëE  ëE  O  ëF  ëF  P  ëG  ëG  Q  ëH  ëH  R  ëI  ëI  Y  ëJ  ëJ  Z  ëK  ëK  [  ëL  ëL  \  ëM  ëM  ]  ëN  ëN  _  ëP  ëP  d  ëQ  ëQ  e  ëR  ëR  f  ëS  ëS  h  ëT  ëT  k  ëU  ëU  m  ëV  ëV  q  ëW  ëW  r  ëX  ëX  s  ëY  ëY  u  ëZ  ëZ  v  ë[  ë[  {  ë\  ë\  |  ë]  ë]  }  ë^  ë^  ~  ë_  ë_  �  ë`  ë`  ‚  ëa  ëa  ƒ  ëb  ëb  …  ëc  ëc  ‡  ëd  ëd  Š  ëe  ëe  Œ  ëf  ëf  Ž  ëg  ëg  —  ëh  ëh  ˜  ëi  ëi  ¡  ëj  ëj  ¢  ëk  ëk  ¤  ël  ël  ¦  ëm  ëm  §  ën  ën  ©  ëo  ëo  ª  ëp  ëp  «  ëq  ëq  ¬  ër  ër  ­  ës  ës  ±  ët  ët  ³  ëu  ëu  ´  ëv  ëv  µ  ëw  ëw  ¸  ëx  ëx  ¹  ëy  ëy  º  ëz  ëz  ¼  ë{  ë{  ½  ë|  ë|  Ä  ë}  ë}  Å  ë~  ë~  Æ  ë  ë  Ç  ë€  ë€  È  ë�  ë�  Ì  ë‚  ë‚  Í  ëƒ  ëƒ   ô  ë„  ë„   õ  ë…  ë…   ÷  ë†  ë†   ø  ë‡  ë‡   `  ëˆ  ëˆ   a  ë‰  ë‰   p  ëŠ  ëŠ   :  ë‹  ë‹   q  ëŒ  ëŒ   d  ë�  ë�  �  ëŽ  ëŽ   o  ë�  ë�   s  ë�  ë�   m  ë‘  ë‘   [  ë’  ë’   '  ë“  ë“   (  ë”  ë”  	  ë•  ë•   �  ë–  ë–   ’  ë—  ë—   Æ  ë˜  ë˜  ²  ë™  ë™     ëš  ëš     ë›  ë›   e  ëœ  ëœ   î  ë�  ë�    ëž  ëž  U  ëŸ  ëŸ  ’  ë   ë   *  ë¡  ë¡   º  ë¢  ë¢  c  ë£  ë£  b  ë¤  ë¤  "  ë¥  ë¥  w  ë¦  ë¦  +  ë§  ë§  9  ë¨  ë¨   Z  ë©  ë©  »  ëª  ëª   D  ë«  ë«  
  ë¬  ë¬   Ž  ë­  ë­   Á  ë®  ë®   ÿ  ë¯  ë¯    ë°  ë°  :  ë±  ë±   *  ë²  ë²  )  ë³  ë³  !  ë´  ë´   7  ëµ  ëµ   8  ë¶  ë¶   J  ë·  ë·  ”  ë¸  ë¸  ¶  ë¹  ë¹  °  ëº  ëº  ®  ë»  ë»  ¯  ë¼  ë¼   °  ë½  ë½  S  ë¾  ë¾  V  ë¿  ë¿    ëÀ  ëÀ   l  ëÁ  ëÁ  É  ëÂ  ëÂ  Ë  ëÃ  ëÃ  Ê  ëÄ  ëÄ  š  ëÅ  ëÅ  ›  ëÆ  ëÆ  œ  ëÇ  ëÇ  �  ëÈ  ëÈ  ž  ëÉ  ëÉ  Ÿ  ëÊ  ëÊ  ™  ëË  ëË     ëÌ  ëÌ   S  ëÍ  ëÍ  $  ëÎ  ëÎ   �  ëÏ  ëÏ  Â  ëÐ  ëÐ   j  ëÑ  ëÑ   Ñ  ëÒ  ëÒ   Ý  ëÓ  ëÓ   Ü  ëÔ  ëÔ   Û  ëÕ  ëÕ   Q  ëÖ  ëÖ   P  ë×  ë×   O  ëØ  ëØ     ëÙ  ëÙ   Ò  ëÚ  ëÚ   ¯  ëÛ  ëÛ   ±  ëÜ  ëÜ   Y  ëÝ  ëÝ   h  ëÞ  ëÞ  X  ëß  ëß   ¤  ëà  ëà   f  ëá  ëá     ëâ  ëâ   Â  ëã  ëã   Ã  ëä  ëä  '  ëå  ëå      ëæ  ëæ   !  ëç  ëç   ý  ëè  ëè     ëé  ëé  ·  ëê  ëê    ëë  ëë   í  ëì  ëì   Þ  ëí  ëí   ß  ëî  ëî   ä  ëï  ëï   â  ëð  ëð   ã  ëñ  ëñ   æ  ëò  ëò   ç  ëó  ëó   é  ëô  ëô   ë  ëõ  ëõ   ì  ëö  ëö   á  ë÷  ë÷   à  ëø  ëø  –  ëù  ëù   Î  ëú  ëú  8  ëû  ëû   Š  ëü  ëü     ëý  ëý     ëþ  ëþ     ëÿ  ëÿ   	  ì   ì    ê  ì  ì   å  ì  ì   è  ì  ì     ì  ì   Ç  ì  ì    ì  ì    ì  ì   ;  ì  ì     ì	  ì	     ì
  ì
   M  ì  ì   ²  ì  ì   ³  ì  ì  ^  ì  ì   L  ì  ì  a  ì  ì  p  ì  ì   Ð  ì  ì    ì  ì  £  ì  ì  ¥  ì  ì   G  ì  ì  l  ì  ì   §  ì  ì  ¿  ì  ì   1  ì  ì  &  ì  ì    ì  ì    ì  ì  E  ì  ì   R  ì  ì   ð  ì   ì   M  ì!  ì!  o  ì"  ì"   ƒ  ì#  ì#   €  ì$  ì$  x  ì%  ì%  g  ì&  ì&   ·  ì'  ì'   µ  ì(  ì(   ¶  ì)  ì)  Á  ì*  ì*  À  ì+  ì+   E  ì,  ì,  W  ì-  ì-  T  ì.  ì.   T  ì/  ì/   »  ì0  ì0    ì1  ì1    ì2  ì2   ¿  ì3  ì3  #  ì4  ì4     ñ  ñ   ­       ” Ô è2l¦à.BVj~’¦ÈÞ8ŠäfÌjj˜ê¦Zš$Bª		Ô
ˆ
Î
öPbt†˜àú6b�ô*>fŽü.|¶Ð&€È&²Þbœð&J¸`8Ž¸Ä6ŠôT¶ì(8HThvš2Lš
6H‚Ìü>Zp¢Äè4´ä
Xvœ¼à6Xˆºæ0\„¼–Èâ  x º!!z!²""l"´"ú#:# #Â#ð$$$¢$À$Ü$ø%F%„%¸%æ&X&Ê'B'Ž'¸(8(^(ä)x)ô*|*Æ+
+ž+Þ,,J,ˆ-*-¤-È.b.ä/"/l/€/Æ/ê00V0|0Ú1
1l1¨1Ö22|2¬2Ê33L3p3Þ444p4 4î5¦5Ø6>6¦6ú7<7j7‚7š7¸7à88&8D8b8€8˜8¶8Î8ì999V9’9ä:~:¾:â;D;\;x<<&<F<x<Ü<ú=L=x=¦=ì>>2>J>d>�>¼>â??r?Œ?â@@d@Ž@ÊAABAvAÆAøB&B`B~BÂBêCpCªD$DnEREŠE¼F"FFF”FÔG6GŽGÊHHdHÜI0I‚I˜IÈJJFJ^J†J¦KK:KÄL"L„L¶MM2M˜MÈMîNFNbNpO*O�O´P.PªPðQ`Q˜QÐR(RVR†SSpSÌT&TNTrT–TîUU2U†UâVV\V‚V¶VðW:W˜WÊWèX$X°YY”YúZZZÐ[[B[œ\\V\Â]J^^.^L_:_l_‚_¨_ò`8`X`Š`Îa^a€aºaúbbJblb¢c8clc˜cÞd–dÀe@e|eæffHf¾fúg>g€g¼hhNh¦hÊii¬jlmºmæn
nvnžnÊnâoobo�oâp€pºpÊpÚpêpúqZqšqÚr$rjrÚssRsØttt¤töu(uduºuüvHvhvÚww`wºwÚxxDxžx¼y€yðz’{
{N{Š     ÿÿ,,  " 4 d  %4."2?>"'7>32'&4>2'.0=.'&'67676'6.".54>2,(ERE(&\&–)"

"X	‡	

	#<H<#–)E((E)!<

<b

	‹		[	


	0$<##<$0          (  %4'>7.&#>32"2>4.#""#	
%²''.''Å%
	%"'.''.'         %##5#5353qpp©pppp           #3375375#5353'#3ô		
	Î
		×áÏ¼&pp	8
Ÿ		Ÿ
8/&&©––q         Ì   7'573'7'78(88(¼(88(ƒ(89((98(       	  #  7537#'74."2>'".4>2e(&88°3>33>3,2,,2,”(lj&7733>33,,2,,        	  $  7'35#7'72.>"2>4.”(lj&7733>33,,2,,e(&88°3>33>3,2,,2,      	  #  7#375'.>2'2>4."˜(lj&7733>33,,2,,Ç(&88¯3>33>3,2,,2,       	  #  ?357'#.>24."2>e(&88°3>33>3,2,,2,˜(lj&7733>33,,2,,        	  737'5#';^^NNƒ]]NÄÄN      ó 	  77'35#7ƒ]]NÄÄNò^^MN      ñ 	  ?5'#3©^^NÃÃN(]]NN      É á 	  7#'7537É//Š//hh      Ñ Ï 	  7'573#z//iic//      Ñ Ï 	  7'7#53'¢//hhÎ//      É á 	  ?3'#5^//²//ii      	   7'573#?5'#3O<<,éé,�<<,éé,<<,,v<<,,      	  %'#735^^NM©^^NÃÃN         %  ?62"&4?64&"2?>.26m0"‚tt(‚((m�h .|oo&|&&

h           %''5'5Af:¨^V%è 5%%K�9%!Ka      "  ' 6  %'.#";26?;2>"/37#3#6/3# K
X
L	7
8X	kl9*WELEL,áá	!+	P4}áá        , 5 =  73&'#7347#75367'535#37632.627'7654&#"8^K$&		pIr*- 	O
N!
9		HNOKKŽ		‰&	 ,*YNFO!        
     %'535#3;26'753#73HpJ
¼
ˆ&$n'‚.�KKŽ
�NOGK99         * 1 :  7##76=4>367&'&326537'&526'#7264&"ô	
µ	&BB	^%S!!.!!˜)
	$)!!m„!.!!.!        *&  ' . 3 8 A  "76=4>#326537'&"&537&'77&264&"¢
	
&U	
zB	R%u‚”•3!!.!!
))$‘!LÝ
g••!.!!.!        *&  ' . 2  &'&76=4>3'&=7#"&'26'#Ï&=l	B&%{	þ÷$)		)
¬)!		þ÷        ! 4  7&=4.'&326537"&53'76=4>û&BB	c%n		
f&!$)!)
&        á ô     7532#'32654#'3264&+^? "**%+'&8¼XD" 	        " & * . 2 6  #/#337375/#53#573#3#3'3#7#33#3#gg		cc	Œ]Yz^Z–9999999¼8888888
»

»¸©›¡&988      ô    #775'#53ê¨
MMDD–	ôVVôÛKKÒ      G q }  71#";#".'1&'5&754'1&'5&'1&+532>716=&71671>;35#"'1&'5&'1&=6'5&'1.+32#">54&q

	
	”	
"!ô

z
"!      G q ~ Š  71#";#".'1&'5&754'1&'5&'1&+532>716=&71671>;35#"'1&'5&'1&=6'5&'1.+32#632.6'77'7q

	
	”	
6!"Bô

z
	!"          )  %#5'##375'3#5'#'5#553757B	^	B		ô	¨KK–K
8	Kƒ&]K	8
Ká

	–

–*	

	+8K`+		*_         " ? [ d  632516=>&'..6#+0#1.="&=46;27>&'.547&>#"&462X"3)!		
69(		(r			$#		4$:		 &'+:51@:§//&&[	
		

$#		          3#'535'35#ô		ô	áááá	á		áB––&         1 9 I  754&"#'#;726?7'567135#56/7'#5462".5475Ì - 	&(%#"$%)'
m 	Ø  %#$&''              # ' + / 3 7 ; ? C G K O  #5##5##375#535#53#33##373##33#7#33##33#7#33##3'3#–		ô	áááá¼&&%
á		á×¨^^„„^       = y ‚  7.&/&'.?>54'.#"32>?654&/&/&'"&'&'.5&>?6323276?>273#537ë
)	
 "!
	
E			

/W>^W}'		
"! 

T		
	

E	ãW^>W       D €  ?#53#52#".54>?632?>2>?6'6/&/&"#"/.4>?64/&#"¢W=]X1	
"! 

)		

	
	E		¯X]=W#

 !!		'Z	E		
	        á   $ /  7#'##73'&'##51#"&54?4#"56323265¦=7¶"$	Q((�Y>>7
&
      % ô  
    %#'777'#'7%’:4‹�RP
):4é­S
I¤mb^S
I       ú   %/77Ÿ?8—î¼YO²       
     $ +  7#'773#3##33#'37''#'7737''F––––––––––J" /"Ø%&&h!LZ!       ó Á   ?#'7–QXXoRWW        Á ô   7'57oRWW–QXX        Ï ó   7'7'½RWW–QXX        ô Ï   7'73–QXX½RWW        7 ;  335335333#3#3###5##5##5#'5#535#535#5357335#^&&&&&&%%%%%%ƒƒ%%%%%%%%%%%–ƒ       ý ý   777'7''…UUUUUUU–UUUUUUU        ô ô    735#538¼––ô¼¼©–        –   %#5Ï–      ô     735#53'353#35#8©ƒƒpƒ&©Î¨¨–„ƒ©         â â   72"'.'&46767>–




	á


	
        2".46767>–!1
		!$!			!
1!$!			!$!		         * D  &"11>71676716&'1&'1&'1&'1&'".46767>2´
S!$!			!$!1
	

®			!$!		
1!$!           2".4>7.34&'>–$<##<H<##<LŸB;$âŸB;$#<H<##<H<#ƒ%Ÿ	7!%Ÿ	7       ¼ ¼   7.462¼  –         ¼ ¼ 
   7.>2654&#"6¦
		Œ

	      á â     72>4."7"&462'–##(##E((1K#(##(#K(         4 = F O  #375#533264&"##532653264&#"#.#53462"&'2"&4632"&46ô		ô	©+
8%%&
0
©q

8

y	



	ô		ôê%8á,	
		
&©

y







       ô       777'7'''!5!!5!5#35#¼  Çþúþú––––@  ƒKB	9         " , 6  7#5335'#5#4&"##35>.5#'37'3'#5'ƒ8–
 

A	

†%$|%&¨%/		¼	å	



¬dd$$[$dd          $  7''77/73##'57;35##3¢)ƒ&„&K&ƒK„„”zƒ&„Kƒ8„        è è   77'7''–DEEDDEE‰EDDEEDD        ö / 9  73#5264&'#'.'&'";#"&'.>76>537#'à!!
				&+_((¼ /!
#"vfe((      ö 2 <  73+53264&'#'.'&';#"&'.7>>'#5'73à!!%%
//		&+((¼ /!
+Hfe((       ö  .  73+"&'.>76>3264&+'.'&'"3à!!Œ		&+ƒ
¼ /!#"s
            '  3#73#3#3#3#3#'353#5#375'^%KK&KKKKKK&KK]áááÏ¼Î^^ÏqqÏ      ô     7'573757'X1188‘228¸^Ã1289128`»	        ,  + A S ] e  3#54&/&'&=33#54&'5&'&=31#54&/&'&=732++".=5#;267364&#8

L
	
K	

pÅ(8"¼©!9!		



		



		



	p'"9888!!P8              7#3'73##'57;35##3©^^Kƒ&„&K&ƒK„„ƒƒƒ&„Kƒ8„          "2>4.52–$<##<H<##<$33#<H<##<H<#óá3>3    
    ,      # + / 3 =  375'53375'5373#'7357375'#53#53'#375'		8

.%/		8

.%8	8

8	%Ÿ		9		
%%%%n::""	8

8	8&&%
8		8
9&&/

8		/%%ƒ	q		q	8&^%""         '  ?'5#'573#5#375375'#7#53#'K		á
Î	v#		–		KB„	X/	–		TK„	B"
]

]
KK	  
      
    # ' - 1 8  #335'3#'3#3755#'#5'#7375#5#3=#7#573p%%K%%©		8%&	(
	6ƒá	
		„	%(!
B6K%%8	K%%^	          #  3&'5#3?3#'5#'5">54&ô	
á.
(6/	Î"!
€	h–
!(	
6/	©z"!         #37375#5'#53ô		/6	z(
.á
©	/6	©Ÿ(!
–     ÿý- , 2 6 C J  7#5#.'35#>735#3654."327&7//62.67''«.-.	#<H<##<$7&L$G!"."'--.$<##<H<#JL&7$$&
 ! ?-%     , , 2 6 ?  7#5#.'35#>735#3654."327&7//264&"«.-.	#<H<##<$7&L$/ /!!/ '--.$<##<H<#JL&7$$U!!/!!           # 0  7//35#.'35#>735#2>4."©&L&T$y..-.^$<##<H<##<©L&LT$$.--.z#<H<##<H<#  ÿÿ  ,   N g q {  72"&=464&"265'763"'&'&/.'&=46737&547676276?5'#"'&'#"7&26767264.uV2&#)R)#&I
$F$
!!:0*'*0q				²		‚PPb((             ?3#'7'#3'53'KeD–©8^–¼yáC‹ƒ8»ó¼Ï         ô   ( 6  7'77>54.#"&#6326".4>2>4."§/(I	
'e$''.''�80+	'.(+$$'.''.'         â      %#53#7#";26=4&3#áááááá@&&Î%^–ƒƒp      Ï –   73#^pp–      	   ( 0 : H  >.632>54.7.>64&7>/&#"&>IA;$6A:%& /%0.$‚(

T	
4	&86A;$7A:¨/*	 -/*Š)	!+.$9+       ô  $ 5  74."#26?5#'2"'.4676"'./577ô,2,5H5]*`*#((#ê¦¦

ÄŒ       ( % , 5 ? F  7."'#372677'67535#5'7'2#46.'53'357557'5‰ K82K*Ž0GGi�¥ƒ		

	
K³VD_ /dF_n         % , 5 ?  7."'#372677'67535#5'7'2#46.'53'757'#‰ K82K©lVŽƒ		

	
K«qH9_D       ), % , 5 @  7."'#372677'67535#5'7'2#46.'53757'&'57‰ K82K¸€j¢	
ƒ		


K`QCgv~         ã ã       7>.6>&'&7#3#3l($!($)J8888Ô"($!($^#*;      á â     7"2>4.#57#5–##(##KKKá#(##(#^9       æ á    7#37#'73ºV,,V,:::áKKK3333      æ á   7#'73å+V,,V–KKK        á á    73'3'K–K#F#^ƒl=      á á   7#–K–á�        ô ô    ?57'9]]]444–^^])455       ô ô   7'–^^^ô^^^        ã ã     7>.6'#3'53Ô"($"($'l($"($%KK        D L V  73+54'35#&#=&/7'773#'"&''7&'5#5357'7>2.34675#6X±\`¬	
†#-
4W 	8
J±
¬[\g#.
3;
	

		T
       	   #37755K>ƒiáÕ¼]L˜       	   3#7755/\„!]áÙ¼^B„      	 . 8  ?57'#+".=4.54>2#;265^©lVŽ

ÿqH9_D`

         7 D  7&'7'&'&7676'76767''7''726?".54?ÿ	Q	:a#	6:ä		Q:n#	:                 753'3#7#535%7'77q¨]]]]¨¨þúeeJqKK©­CDuc1         Ø ô    73#7#5T„ô¼¼¼¼     ÿý  $  7&'>.5#35#>'757'#†'#
-2#/1	,
#%(©YCŽK%2,2

¡q;-_D       ô  	   -  753767#&'#%!52>.3#'53>&'7a	‰iaþúÇ! 	%*'*%	q		8
q	
¼¼"*$+           7&'>54.5#35#>ï&:5
(23)*DEA#57#–.!
 /$;"K-         þ  	   #3''55ý\„!]áÙ¼^B„          7.4623/#3?#53¼  TP__Pa__O– Y²YJ²Y      	   %/#3?#53P__Pa__O¦Y²YJ²Y      ü     ?'77P––nôdd­“J             753>32#5."3#'"&462!04 '.)5Nu ÀK/."�         ê 
   737'5#'"&462–
I11I/yI1tt1IA       ê 
   #7357'"&462–
I11II1tt1Iá           !  %5#.#"35>2#37264.304 '.)5Nu ÀK/."�            #'57#3ô¼·²²¼¼²      +,   A I Y  75'77''7373#1'"&/'7'&'+535475'7354>2354&"5#2>54+[&('&&('t$",.+)$&$)*.,#$"kY%z›	"‹	&((&&)(�$"+)(* #$2-!!-         7526765#'573'5#337'5#'KU		ô	ák	.(//
»

­‘©	//yy/        á     %5'#37575#53'57=	©		©	=]––K99Ó#(		„		&#	kmp]
"           ) 2  73#'573?335#/##">4&2.467"264&ÉG		ô		G8“áB0AP !!.!!ô
¨

¨
¹–  !.!!.!        ô     3#'535#3#T–

–	ƒƒ/%%	ô		ôêá¼             3#'535###33535#á

á	ÎÎp8888	á		áØÏ&888             3#'535#3#5ô		ô	áá–%p&	ô		ôêá&%q&            3#'535264&"ô		ô	áq!!.!!	ô		ô	áá©!.!!.!       	    %  #'57335'##33535#5#3#7/¶8©qq©8qK%%&&%^^‹+88¨áó¨9K&&%ƒÎ+»Î8           7#5'3#'535#¼^Bá

á	ÎÎ©p	á		áØÏ          3#'535#37'#ô		ô	áá%8^^8	ô		ôêá„8KK8         	     #'57335'##33535#5#3#É8©pp©9pK%%%%%]]8¨áó¨9K&&%ƒ         ô        ?3#'735#535#73#'535#535#&	^		^	KKKKz^		^	KKKKê

¨

	q
¨

¨Ÿ&%K       ÷
   35#7>7>.5B	B0"#

ab!,,B			##ba,,!'        	    #?577'7ø›,Mšì!–!šM,›Ë8
!–!            %'#5'#337'53#53753	�	^		/	¼	óK–©	„²
T		—U		gqq]K       ©     7"&462"&462"&462K

^^–          73##5#53535335#535#53#K88888áqqqz		ôá888ýg]ƒ%
Î	        â á   !  7''7'777".4>24&"26¬$#(##(#!.!!.!o##(##!!.!!       ( 4  '.767>676'4&'&'&'7''7'7¡)&&0'&+!&&& !"&-------)7+'	"*..ô	"%*	NH
|///////         / C P T  #'73&'#/'7/5?'7?375'7'2..>>.635°4
&&--&&
'
	&,,&		&,-&&$	
#!" ^-&&
4
&&-,&		&,,&	
'
&&0
	4#!"!             7#35#'73##'57;35##3©^^&ƒ&„&K&ƒK„„ƒ&^^©ƒ&„Kƒ8„        ã    7'7'7#5'3#õ,CC,½%©-DC-8ƒ       ,,      #  73#'7355733#'75##;5#©]]]þç^^Îq^^^^^^]]]]¨p^^p^^^^         & 7 ;  67>727264/1'&""&47"632>'..3)J€hb,	
%9	#303% )J€ht,	Q.#+,/       è   (  72"&46"264&'2&'.".7>–*3#	9J9	#3»))>+#--#+   ÿÿ    ; D  753#5#37375'>4."354>;23'&'.'"&462T		
©!&""		˜#

2'	^
	#	q	±	##	



''         	    ' 1 ; @  #'57335'32654#"42"35#57##535573732654#"42"Æ>
Î		‘ˆ¼8h<-- >¶		ô	á¨9L%%2=-j-=$%2         	    !  #'5733'#35#'57'?'7Æ>
Î		‘88„¼B	J"))$))">¶		ô	K9á–	BŽ#))D))"          % ) - 6  3335/#35#7##375'#'#57+577264&"&p	B>‘		B8ƒ88g–		–	(O]/%B	)>	ô	á98	q		q
K('P.A 	         ( . 7 ? I  %/#3533355375'#53##532'#3246'4#32'536'7##53#3>‘	q	BK8Å		Î

	¼¼–

B	
M!Ù>	g^B	)998	q		q	^]89&	8#9          ! + 2  735#75733#'5#'5733#5#/#'#3?35##35#&
Sk		Î
		Sk
gDqD;qhA¼k^K		
–		/	©

.%898K]       
   ,  73#'57357##737#/#37'7'7##467‘		ô		^…wTfzzPP1)+ô
»		Î
Ìgq–9I**               *  #535#'5##5733'#375#53#5'7#53Æ>
A8B	q	‘88ƒ		ƒ
pp21!8>¶	–	BKT	K9^
ƒ		ƒyp8!12        
  # ' + / 3 7 ; ? I  3#'5#335/5###5#'5#353535'#573#5#573#5#5;5#75#35/Î

»	KK&		
	&s8	^		ô	&»vT/

/á%&QQzy         	    %/#375#533'58q©©^K88Ü8á¨¨áK99       ,      ##375375'##5337#533Ûq9—;8&–9KK–^8,8¼9—á»q»8        #5'5]K^ YhhY           #5'53575#]K^p&^á YhhY q^^Y       û - S  7'6&'&'.7567676?67676'76?'>76&'/6&'1&767«
	
	
	
	
	%;		

			
	%		
G%%		#		;

           ''37''3
pqwwpqwppwqqw           777'#77'#pqvxpqv¡qqxèppx      î     7'3777'#àJKQQ£MLSRÿJJQQÎLLRR   ÿÿ.   + 2  73&'5##3#'57337#/#37>.67''‘	vU`o		^zzPP1($!($8-' ô
Tq			Î
69B"($!($R;4           $ (  73#5##3#'57337#/#373#73#?‘	wT^g		^zzPP&%&ô
Aq	Î
695pppij       %      73?'#5'#/#733###73?3Î	2	
l^	PgUG	½ºEm&„.

ÎÅ%91^       
    %#/#375#53?3'##533^		ô	áUwzPPzô
Î		»•q9      , ô  # @ I S  732+".=4>";26=4&#"#";26=3264&+54&"&46"&>2K–##–##!!–!!z‰
ô#8""9#!8!!8!%
@          7 @ I  7'#'73?7'?5/7''7'#''7'57'77"&462264&"«

%--%
%,-%
'&--&'
4
'%--&'@&Ú--%

%+-%
%C-&'4
'%--&'4
'&-ƒ"       " & 9 L P  7#65&'&/&"&'&#"#375#535#5&57676762347676762##53ý				á
„]]8	
6^^^á			©		© –

©–           & 0 4  73#'573&'5#'5#'3#'5735462354.358KV		‘>B	q¼8A		q		3%
%^&	ô	>0	B999K
K		K
	788      á,    3#5.467264&"�&&&&	(,L*:*LL*:*{((      ÿþ  * I U  7'7'7#&=.>323'>..676754&+'5732>.‹((#		5
È
		#((#	8((h		g›{
!h((²
              #3'7537'3##3©^NM^Î]NN]¨&      - 4 ? J W  7..'27>54'&'&#">56.'5>4.>'".>.>ù!*	
		$¨

�	›	*
	_	-
%2
‚
{	    ÿþ ! - 9 J U a  7#".>75.>32.">'2>..676753>.6'77'7''i			,	È


  Ð^
_	Ÿ
ž{
C…Ø           ,  * 6 J V  7".>75.>36.#">'2>.#54&+'5732#5#53533#i
	,	È#((#8888Ð^
	_Ÿž/((		Å888        , 8 A J S \  7>54.#"32>54&'&'5.>2'".>"&462264&"'264&"5264&"T				Ð''/¾	_
^u
ƒ
Ÿ'/ˆH    ÿÿ      5  7375/#3#57#5##33533#7'7#";#"&46;'78©8%%9©ƒ%%%%]]](8		8(qK¨89¨KK%%&&K™('(         " .  %/#3&'#535#34'3533##5#">54&8pd	Up9
n'%%%%%%p"!Ü8á
â9:Bp
g%%&&&"!    ÿþ  * 6 W c  7".>75.>36.#">'2>..676754&+'5732>.6i
	,	È
	#((#
Ð^
	_Ÿž{
h((		ª	       	  ! % )  7357'#375'#"&'3#5326'3#3#ƒ2BB6		á

B!i,Î+ ' =ð""2AA;	^		^	KK\        	  !  7357'#375'#"&'3#5326ƒ2BB6		á

B!i,Î+ ' ðmm2AA;	^		^	KK         	  !  7537#'7375'#"&'3#5326ƒ2BB6		á

B!i,Î+ ' ­ll1BB[	^		^	KK            # '  73#'573'5#37'#7'#7337#'#53#5390F

á	Îh*i6++6#Bl3
6?%.q	©		Z!0©Al ^p8mH89      ! l  %"&=6&'76767654/6'&'&#"&='&'&/.'.>75&7&'&547&?66676 	))		
 	
)*	ê-
..
	

/+

   ÿÿ  -, T  "26='&'&/./&7631767&'&5471&73263267613>54.–)E(.			

	
/)E,(E) :*

'	'
)
+:)E(            73535#5##3'3#'535#qqq99BÎ

Î	¼¼8q99^
Î		ÎÅ¼     -,  j  "2>4.#"&=4&'>7654&'>4&'#"&/.+&/.#737+.>2–)E((ERE((E	  		
,
$7>7$
,,(ERE((ERE(þð#												
	,:>22>:,	    
        * 1 7 A H M S  2".4>.'65&'#36'564'#36'&'+#673&547##&'67#7>7Ÿ!8!!8B8!!8}	2,/AHC
		/,4,
&	/
7	B	%!8B8  8B8!K8
	
				
A
J1     ,  ' *  ?5'#";5#".6;7#'3#'535#73q&(8		8_2X9¨¨K8½'('K8¨Œ|–K9        0  77'2>4.#"32"&'7'7#";#"&46;'7ZGG1://''-%6(8		8(nEE"/80'.'a('(        ¼    %!!!!þúþú¼&        	    ! ) -  7'573573#75#7573#75#7375'##5(  ðÎ	&		&8	&		&8	&		&áÆ««™™……	uu}``PP      ,    %#'537#''7373ý	ÎaDK`&8	ýô¸aDKa&        ,  
      %#'5373#73#3#3#73#ý	8%%ƒ&&K&&8%%ƒ&&8	ýôÏ&8%&%&%8%       ,      & *  735#5#7573#75#7375'##5573#75#ýó%
%

%ƒ
%

%^
%

%&ôý%–

–	ƒƒ²¼		¼	©©³q		q	^^      Ï ô        73#3#3#73#3#3#^%%%%%%K%%%%%%ô&%&%&¼&%&%&        	    ! ) - 5 9 = A  3#3#'5#'573'35##'573'35##'573'35##'573'35+35#3&&	z&		&	%Œ8		8
9&&A&		&	%Œ8		8
9&&&&&&á	ôg	&		&
%	8

8
%–	&		&
9
8		8	&p        %.'."'."7>4	



		oo	Ò	


		


nn       =  %.'."'."767654'.4>76767676	



	oo	
ab
	
	Ò	
		
	oo	
aa         %  7>&'.5#35#>&'6'7'5#ý<A8	B)HJ.1KF8B>+6E99!-B	">M<!"	&,6GK          '#'5##'5'7357335'�w
8	&	8
wD&	8
%Klz		BB		zlX‚B		B‚D        ô â    , 0  735##5#3533'676764.'&'&+3537+532#3y11j.	  
¼¼qp11p001	
p.$
f        $ . ; ? C  733##'5#'5#'5735735.54625#3?3'1&'267'#373#ŸK	



	://
				
K	B–/	"5(	
	L8á	&
	9	4-6	
(a8n)&.
			3       	    7375/#7#533?3'##/#73ô	4�	4ôá/V15	K51&	T�‹Y	8„       ô Ï   7;'7'7#"&=K�00�Î%0/%        ' + /  &'.>>7>&'.7'35##5¡)7<&+ !13&>@"*-,$ó755;2	”%KK             #'57#3#'57#3'7'––––––––ô++KKK9KKKŽ++        '     ?3#5#3#''75#áá]]~3 =%ôqq– ~±3V>   	         $ * 2 8 A  764''7&''7&"62'647&7&7'"767''264&"ï#	,'!?	#-#	-'!?	#L'!?	##	M!	##	:       #  0 9  7/7>#.7'.'35>7'7'264&"c=$()%2H>,­$))$$# +=Â<$&$4	'"C=%&	"
        $  ">'6.".>'264&"�%>5HD*"- 4,=:#&')DI4=%,#á#:=,4 &g        à   7#727676?654.#73&©\&	V
&	-‡	‡	         1  7#'5#/?76?#'35737'"&'&/3ß“		PP	“€	?@	
!
}2	2}	}	##	        F �  75#"111+321135#".=4&'&'67>=4676332>716716'5471676;5#"'5&'5&'1&=6'5&'1.#32#q	
	
			M	
	
			ô

	¼	

	        ª     7>&'&7"&462'"&462Œ
	)
	V^        9 E  #"'###'5?&54>6716.3573573?327>.6Õ#/	
8	^%,	 ^%		
	 +&
		+]#	Š 	$
_		B
	      / 6 9 = @ G  %'35#5##3#326735#'3#37/#53#326735"&'3'#7#?#"&'3^^:%%©%%:·/&vƒv& /©KKK–//–K-‹Š-      ÿý-     , 3  #3757'373#"'#37&762.67''™
oo
sÖ^aam!QT"'Q!m
+!"."LJJAA?BJ77
7J	=
 ! ?-%      ,     (  #3757'373#"'#37&7264&"™
oo
sÖ^aam!QT"'Q!m
 /!!/ LJJAA?BJ77
7J	!!/!!           3#'57737#''373�
ss
ot^^aÓm
q"TQLm!QT"qLJJ9A??7JJ77yJ77J          375'#53&á¼¼ááóá           375'53&áá»ááóáá           375'53353&ááKKKááóáááá               73#'7353#73#7#3áááÏ&&9%%]%%áááá           375'5375373#&áá%p&&ááóááK–––á              375'53353353&áá%p&áá¨––––––           73#'735335áá–9áá––áá             375'533#&áááááááá©––9            73#'735335áá8–áááá––            375'53&ááááá¨––           375'53353&ááK„ááôáááá            375'#53&á„„ááóá            375'53353&ááƒKááôáááá            375'53&ááƒááóáá          375'53&ááááááÎÎ            #  375'53?3#'73573#'7358KKK9999K999¼¼Ï¼¼¼8888ƒ9999      (      #  ?3#'735?/7/73#'735^	&		&	)#F#2@A¿	&		&	ý

Î		Å¼¼ÂÀ°°

Î		Å¼¼        7  7"264&'7'373'#;#&=4&'.547>32á!!.!!	

#"

	'ƒ!.!!.!]R)

	
'	       ; X l  7676?67654.";2>5'#&'+"&=3>37267676301'&'&'&'6762"'&'&4¨

			%3

		
				x

		)P


				       õ ! +  7'#&=4&'.547>32#;265Û	
	'3)Š	
	
'.)           3#353#'5!#5'7#53UKá	ô	~czáKU		ôzc~        ô $ I  732+5326=4&+".=4>5+".=4>;#";2675.S9		9   :		:ô$L$        ô     753'3#7#5qKq––¼áK^^         ô      73#3#53#53#&¨¨––ááÎÎƒ&„K          
   3 k  73#573#3##3'?64'&'&"354?2335#2"./&'133?/+573?'4&#547>2+3»»»»»»»Ó% 9*88R:	         ô     753'!!7#5©©þúÎÎK^^       ô       73#3#53#'3#;#K©©ƒƒ¼¼8ÎÎ8ƒ&„K©      ô          7#3#33##373##33##3&%ÎÎÎÎÎÎÎÎÎÎÎô%&&¼%&&      #   ' 3 ?  7'5#"'&7>37'#&676763>.6>&'&¬dd(0GF$.	B+			PL	#, A#68!
J		$,;        %."#>2060%8@8%©++ 33         â   ' 3  7.#1"376'4&';'&5>&>&'>.6Ë
";
;A 	00	 "	&		ú
"*ww!aa!(		      ô     ?3#'735'54&"354628–––!.! –^^^^%!!%%%             7#54."#375'4>##53ô#(#¼©!.!p–¼¼©%""%pp8 !%ƒp          0  "3754623754.#53#53'54&"#54>2–$<#89#<\88©999 .!84<4#<$^^^^$<#á888 44          #375'#'#53?›
~	ô	ƒj Ùá¨K•		•8?…r        ô     ?3#'735#7#	ô		ô	ákd¼^ê

¨

•ŒŒR\I         ô     7755'57&AK8KBÅ�)�°�#�#�)�      ô     3##'3#3g�)�°�#�#�)�BK8KA         ü      73#3#?'#3?53#lw#ww#wd,�/,,�/�w#wý88BFK	FGK	8       ü      77535'5?37#775/88AGK	GFK	8Àw#ww#wd,�/,,�/�w#w       Ï    73#7#'#5375##7w'!!(œ%$76Îzccc/-z++BB66       î     ?'.7/567'5&çr&@X××­@
¡


$=	,9Š=       î õ 8 B  7'.74>32#"5#"&4>367332654&#"77'32676#"Ä!&$
	%%	L	D '#'		"
<
 )
8$        , á     %!5!!5!5!5!,þÔ,þÔ,þÔ,Î©8        ë þ & ;  7'#711354./.7'67&/354>7Å((4Õ((	S
      þ   #  7462"&553'.53;2>53#^!.!!.!/+""+Ø!!K!!�&&&+##+        þ     4  75462"&7"2>=4.53'.53;2>53#g&&/$+""+�KK KKþç&&&+##+          ##3353?5/##53'3#–g		gT((TPÀÀ§^^%
K	ƒƒ&%K8	       
  %  ''5?5'#571?'7#'573¡tuutgggg#..q..rK¬KK¬K«B–B66B–BZ/../      ô   "  %'#353?54'7'56737/7€€+KI?BAB10AgggÂ22w^""G(((      	   '  75#'37'7357'#3#'573'7'7#À!!00n!!05!AA!11eA!11!Ac @@ 00“ @@ 0P  10- 01                 73#535##735375'533#q	–		/&„„ë		–

Œƒƒƒƒ		ƒ
K9^
ƒ		ƒ
&K           ' + 4  %#&#">=2"&>7&#26=73552"&46'.1–	'„ƒ/©/	'U8•		�
'qT
%	&�         	    737'#'55#37''7'74II4	H;;..·  !    ÎHôH	^X;Ç;KI !  !       ,     #5#5#3#'5733#5#53533#²@K^KT		~68888A%KÏ	á	9Î888       ,   (  #/#35#53?335##533#5#53533#^		g^UwzPPz8888	Î
q%T8ô888      ô Å   7+7'7'326=á�00�Å%0
0%       Ò    (  76.6.>&'7+7'7'326=,.	'.	F	
	
œM00MÅ	'.	'.
	
	%%0/%              3#'5353##33#ô		ô	á¼––qqqqKK
»

»	©©&      ,,         # ' + / 3 7 ; ? C K O S W [ _  7#53#53#53#53#53#53#73##53#5;#3#53#53#5353#53+5373#'7353#3#3#'3#%%%8&%ÎKƒƒƒ%–^^Î8989%%&K©©©©&&%ƒ               #  73#'73573#'735#33##3&©©©–^^^]áááá&%%&        ú % @ I R  %676'#&&"&'&12767654"'&'&5476722763'"264&3"264&	B	Sƒ!

JJÂ
	
 )

) xR     -   " .  3&'5##'535#"#7>..>8Ï	
]\^^Ã
	,,	
	d^ÌÏÏÏq
',,
K   
       $ - H b w ’ ž §  7.676'.>&76&'&6264&"3#"&="&=46;#"37&+"33>=26=4#+"&=#5&6;2#5326=354&+&'32#'">54&"&462«	

	+			œ""	"	‹
.&	.4""	"®		Õ	&	
	
¥
")	*5z
;,	,<J??=	v5*	)"
Ù
&       ,    ! %  #'57533533533535#3##33#ô¼&&%©¼¼&pppppppp,ôôþçô&88         ô 
     7/5??5'755¡lsskK
@9±^^q^&ô	~	  	~	wllk
00      # - B  %'5'54'&'&#"76?2>'&>&/&4?>&'5\9		D
]
–DR
	HO:\=8	D]*	³ªDQ5		
5I            72>4."7#'77–$<##<H<##<+$O#<H<##<H<#M+$O         /  737''7'.767>676'4&'&'&vUO$V)&&0'&+!&&& !"&`VO$Ž)7+'	"*..ô	"%*	NH
      þ     '  ?7"&462264&""&>2264&"D––'—'>¼¼€'']''         # E  7##33535#'.>&'>.632#54&+"3;#"&75"&7546ô%%%%T
		&	

.	.			q&%%¸
			E3?	,2         Ï   ) =  2"&467"264&#"3;26=26'54&5&6;2#+"&=– .		
J	.	T2,	
+2T33??        , -  353375337533753#5##5##5##5#!75'%

%

%

%8//8qqg

gg

gg

g¼999999KK¼          -  73.'7#523#".54672>765#5"¼I(#3p	/\3",+ 0 q	
+3¼(I\3#
	pƒ +,"3Ì+
	q 03      á  7  %#"&'#+5#'735323>3#'&'.'>76?36
	<<	
6	M		MÎƒ
		
K
	K
	
ƒ       - 6 P  31&/576?67#3#'5#5467675.5>"'.'&67676Kƒ	
			[^
	
K
	
Œ6
MM	<<	
6˜       á  7  3#'5#5467675.53.'&/576?67Kƒ	
	
K	
K
	
ƒ6
	<<	
6	M		M         ( . 1  '.767>676'4&'&'&'7'77¡)&&0'&+!&&& !"&'TT:)7+'	"*..ô	"%*	NH
«88_N'      ð    755G©¥�ápg¾_         â    ##35>='#5##.=3ƒ	%%	&;"p8	B+99+B	88s88         ï    ' /  7#'##73'&'1532#'32654#32654# >8n)#^((�Y>>7��/>4              #  3#'535##3'#5335#3#'#33#&ááááÎ¼¼––8KK%%9KKKKK¼¼¼¼8ƒK%8%      ë ë    ?3#'735B	–		–	„á		–		�„„              3#'535#3#7#373#ô		ô	áá&&q&&%&&	ô		ôêá¼¼qq–       ô   7'#'##3?3735Ý!#5<
#	Cƒq}]Q2_„X         < @  "2>4.".>27."34>23546?>4&3#�!8!!8B8!!8!008//
.!8B8  8B8!á/8008/ž			
^     
  "  7232#"&5467232#"&5467†# //™$ 0.ê3$+*&5N#3$+*&5N#         % 1 C N R V  7467'7.77.467''>4&'77>4&'#'7.>264.#3'#8	

	�



K@h@	&6Ã&,1,&		M		!†&)&,1,B
‘!!‘	'$8%%           * 3 ?  736.75.>264&"27"&'77264&"33##5#53á ;@.9 .#31z.		/7%%%%Ÿ 9.@; /4'+/	
/8&%%      ô      # ' + / 3 7 ; ? C  %#";26=4&#53#3#373##3'3#7#3'3##33#53#7#33#Ï

ÏÏÏ9%ƒ]]ƒ&&^K88&&ôƒƒ–ƒ8988]         â á     7264&"7".4>24&"26–S#(##(#!.!!.!ƒ##(##!!.!!         1  7264&"7'.767>676'4&'&'&– )&&0'&+!&&& !"&q  ¨)7+'	"*..ô	"%*	NH
      ë
   #53'.'.>5ê	B0"#

ab!,,B			##ba,,!'   
    *,   ! . 2 6 : > B G  7'7#";#.4673'7#'573'35#73#535##5#33##373##3'13#‹+<<+Ex

x
xddFx

2(d<<<<<<<<<<<**ó+(+þÿ
 

 
Œx
 
Œ<F‚È<<      	   7#53#5>&'7.>X2A
9@+$%+31%ô
A%?<0A5
#03,#03,            37'#5'7'73#¼0	00	00	00	0–KK;::[K      -   , 2 8  3&'5#3#535#'5"2>4.".4>27'7'7'þ		
êaN:k
×$$*$$ 	K	lV° 	Äl$*$$*$ˆ  '	         ò    7'7''75'òKKPP®MMRRyJKPPVMLSR      ©   %!5!þú–          & : D X a s {  †  762"'#53264&"'7546;#"77354#"6232?"&54?#5#"&54?4"5>72526275"&4625&'"'73#'735'735Ú	Œ',,;	,	7	}©©©p„ú	J4N(
 			¯				K]]]]&^q        â   ' : B F  77'546;5#"'3>4&"'#3=462"&#"&5&632&"27'375'3#<+)o
^ƒƒƒƒæ+*/	'\	
	–[ppp           7'32354.+7vKK=$'4&<)";LK<G'9&:   	     ( , 0 4 ; K S W [  7#535#"35#"'&'4=45676;#375#'#33#3##53#'73##5#"&=4635#";5#'35#ô©KP	
®KT
ƒ8BT		/		 &&99q–
²

&
Tqƒ88ê	q	^p9      ,   / ? G W `  7121#1"&5146121#1"&51467121#1"&51467121#1"&514637#'7#326735#."".>ŸDTU88%1%99%1%l''á%K%yETT­    !'         	  # ,  7357'#7357'##326735#."".>–DTUDDTU88%1%99%1%l''üDTT..ETT4    !'         / 8 A J  %4.'&=>."2>&'57>=>'462"&"&4627"&4624432»

g/á¡

Ž        ,   "  7#326735#."".>'537#'7^88%1%99%1%l''8DTUK    !'^yyETT         	  "  7357'##326735#."".>–DTU88%1%99%1%l''üffDTTm    !'         & * . 2 6 =  %5'#";5#"'&'&=47676;#37'53'3#3##3#53#
·®KT
¼©–	8qŸ	²
&	B––ƒg88             3#'5#'535#3?3#35#ô		6/	zzá.
(	¼	6/	¼²©©
!(™^%         	     #'57335'##33535#5#3#É8©pp©9pK%%%%%]]8¨áó¨9K&&%ƒ        ,    # 0 V f  7"&462264&"264&""&46267"&'7?32+"&='57546;5.5462";>=4&#–888.	
	
	/ !p  /	
Tp–  E



	·	!%!!%!	;qq            ( . 7  "#37567653''67/6767675#5#76.6/.%$N	p8	!ó1j@@#$0/$H%·!	8q	N$%./Tj1@$/0$#8%8�	     %  ( 5 >  757333#6737#&'?35#/#"&4623".4>2264&"	^l
	2	F3-lUgP
U&##B'·F

.„
q%1W$A''         & 3 <  73#6737#&'?37#/#573"&4623".4>2264&"‘		lVw	zzP
		^&##B'ô
»	
„1F
�$A''         ô ô     7#52'234.234.^&&.N-3V3+38&¬-N.3V3K+3      ô 	    7375/#'73'3||>|>ƒo5t5o2"T¥||>>vo55""S             7553'#5'!©¤Ž0/ápg¾_/ff         ø     2 9  ?5''757'#&671654'1.611.716#'77Ÿwš†cjŸC.†!&).-#J#/PgYB¬j-Y@-,

 #          75575'4©¥�V¤¤ŽŽápg¾_umn__             755#'7537"©¥Ž=/ápg¾_Ž/ff         	  . 5  ?57'#&671654'5.611.716#'77^©lVŽ(	+1	0$ O%ÿqH9_D

!%         	  . :  ?57'#&671654'5.611.716'77'7'^©lVŽ(	+1	0$ ,ÿqH9_D

!            &  %/##375375#5335353#5/#53 	/		¼	/	K¨q]%q&^’ú	/	¼		/	 Î¨99%%K^&            # '  #5'##5#3#'57335#'??7'Ï
	q%8
.œ?&&zr9rg
a	 KK¼¼K99r8r‡	a        	    #'57335'##5335ú	ô		ØÎá"ƒK&Ø		ô	áÊKK99              #  735#3#'#573#7#5#533#53#3#'538¼¼&pp8	B8ó9B		B9á8B	K–%KKA
	A8–B		B          # '  7#535375#353535+335'7#'573#3B/%©	/8%/×%	Ÿ	„		„	%KKá%/
%/	²/%%/			^		&    ÿÿ,   /  "732>4.4>2".#'77373'#–'EF''Y$$U(()(%)'EF'-'T#‚((((%(       ) 2 :  7''7.>&'54.>.677'76'6&#"l		GG$AB)	/2')$"($O
N!î5		EEE:7#*
d!($"($[NFO!        ,-    "7>.#".4>2#¿3	ddC87!''.&&,!8<sr&@A(»'.''.'          7'77'øøÑÑeppo	Wb_V             ! )  73#3#3#!7354>;2335#'##5#qKKKKKK«þô#p#¦pp¦–ô^K^©¨&Ïô8%%8        . 7 U ^  3#5#3#'535#5&''7&7'767537''264&"5&''7&7'767537''264&"ô	áƒ�	áá]

					e				
z9„	Î/&©






/m





/				         # 7 ? S  7'573'##5##5##5#35##'573'##5#35##5##5##75'#753353353353353/		Î

A¼&�		Î

Œ¼&Œ

Î			&Î
8		8
9&&ƒ	8

8	8&&ƒ	8

8	%%       ,,  7 C N  7'#''7'57'773775/7'/#'73?7/632.63264.ø44+,<,*44*,<,+122+

+22+

+`		¿<,*44+,<,+44+l
+22+
+22+K-        þ  # < F  7232#"&'#"&>73>3"264&#7232#"&'#"&4673>"264&#qhjLhjz–        % = @ B  7#375##53#54675462"&=#7"36767632?'.20#1^B		Î
»8*!EE
L!
		DD9á	¼		8/©p/!4
II

z !(IH¢       $ E Q  7.7572>76763'67>=#&'&/&'&>."3›
	

		l		
	
	
h	
	
%	#<		<#	Ñ3	3Q1         #  755'#75375#5/3'53#'57Ï	©	^B	9DƒLKK:]\./å*

Ê	 		*œÔ­../          %  775'#175375'#5/3'5#53'7'Ï	©	^B	9DƒLKK{^]..å"

	Á	 		",œÔ­@..           " + 8  >.6>.7"&462"&462"&'>7'MG?( ;E?()<6"3;6"<^B
%*#	;F@'<E?·2=6!2<5_S	        1 X  7"&462'"#33573#"";>4&#4&#54.#46;23232+"&46;546;75'#"&–/"©B&
	©		&ê+!%  B/K

8	       
     " ,  35375'3##3'375'53'#37#'37'ƒ„q&&8&&8ƒƒƒ%%^&&88.:&%9%K^^q^^9&–H&&     ÿÿ, , 5 > G  %4.+"5>.">&'>;267>'462"&"&4627"&462	%$$%Î8gÅ
[$$r$$
IÂn         , W  726?>?>././.26?>?>././.e


						x
a
				

				O
      , @ k   726?>?>././.?'./7>26?>?>./././7>?'.e


						
		v
			a
				

				‡
			È
2				          #375#53#53ÏÏƒ^^q^^ÏÏÏÏÏÏ            #375#535#53ÏÏÏÏÏÏÏÏÏ^^         M œ ¦  7&#.#21273#;>'&/.6?3267654'&'&&'54&'+46;5&67'#"&>;26?&'>73235&67>76&'&&/">4&#h


'}	

d	n
<

!

	
ƒú		#

	
			¹	
	

	
p       	      7'#7'7377#373'7´eRPPRíRªRR,,$$$·bb@d>>d@	OO4P„----      	  7'#7'7´eRPPR·bb@d>>d@       	     ?3'7''7#'5#xeRPPRƒ$$,jR·bb@d>>d@G--3O           ,  73#7'.767>676'4&'&'&qKK0)&&0'&+!&&& !"&¼K¨)7+'	"*..ô	"%*	NH
         ô 	   % .  735#35#7#3#375264&"7"&462264&"&		ê	»S%
á
¨
©–
¨g         	   35#53575'#3#		/%%Å		/&&
Î	¼á	Î
¼       ô    ?3#'7##7'7'353'7'7#3	ô		ô	ôqL'88(MI'77'Iqê

¨

ŸA'77((77'A          $ ( ,  7375'##575'#373375'##537'/7Õ2"^#&K%	X2#^O8%%%�=v2""%K&m	
2#K	*&8&x=        5 > G P Y b  ">32>4.##.5&764&"'"&=4>2#7"&462"&>2'26."7"&>2"&462–0%#=##=#
,
3=448
ƒ
‹
%0$<G<$õ+ 33=4¼‹V@       ô      73##3'73#'735K–––––Îááá¼&p––––          " &  ?3#535##5'#37'#57'53'3##3ƒqKKq&ppp‹KKKK&KKô^^89^^^^8]          " & *  #353#3753#'#375'#533#3#73#qqKKpKD&]ppp^KKKKqKK88^^8^^q^–        ï    733'7#'7#7#‹>)!†(G6…E>>@
@ ‰H	c‰^„              %'#3?5'57'757^ƒ

^ƒ
 TT	W}WzzØ/BT/BT‘*F&'?,W=I9       	    %/#375#5533>‘		Î
8„q	BÙ>	ô		¶9ááB	–      â  !  7"#.673>."&462#Ø%::"'á #p''        ë  % ? J e  7>76'6'.#"5#35766'&75&76'767232?356&#"&476?7?5"&4625'&"‡
			P				
œ
		

_4�L	


	?9/*                %#53#3'#3#3'#37#3'#5#3]]&&K©©%ÎÎ^pp–]]ƒƒp]]áK^K©99              7'#3?5'5'757ý]^		^]
zUUPYYY^TTá88q88q£2a.A551C2e.            )  35#7'3'?7>.6>&'&K–
	¼(K–v +*# "

&KbŸ!*%ƒ8Kx
# " T &       F �  75#"111+321135#".=4&'&'67>=4676332>716716'5471676;5#"'5&'5&'1&=6'5&'1.#32#q	
	
			M	
	
		
ô

	¼	

           3#3##5##5#535#53533535ÎKKKKKKKKKKKKKKKKKKKKKK]KK          ) 5 B O S  #"&54676674.7733##5#53'''7'77.">'.>7#36


LdcS////l!!!!!!!:�KK	%"dc‡///%!!!!!!!p		

4       á  " )  7#54&+;#5326=#"#53'7'#'7'Î
9
p7"!§!"¼	gg	%L"!!"        C  7".767&4767>7'7"276?6767>54''7&5#@
)68%D 	‰D#I 		100
&>86 Eõ&B%K		001      ô    375'53#535#535#535#535K––––&&KK&&Káá%á&&%       	      ! %  35335'537#373#7#373#35#'3#/	Ï	ê&8]&	ØÏÏØ	þú          ) 6 @ R  375'53'354#"6232?"&54?##5362"'264&"275"&4625&&&ááá£	+	E	©©¼©©: 			J	!	               %  375'3#73#'7#35373#'7#35&áááá88%8^99%9888K99999999        á 	   # ' +  735#35#7#3#375#/5?35'77'75&%/		/%ê/&&/	<T	.T	P?BBÎ	–
–ƒ
–'/	%/&WW      +  # '  7'>7#'7..''73''7g=6 '',1@:2'('.’ßç3'(*³1'('¾Ð     +  #  7'73'67.7'37'.>&'()=9EI0Í''.HE:<'‘'(/!:/('%: 0             # ' + /  #3753##53#5'3#3#533533#535#53'53ýá		á
áÎÎƒ888K888888K888888
Î		Î	8%8%%8%%9&&&&&%%%      '  # 0  #372>?4&'5&#"32'73'?øb}a**%I%TsT	
E}b*
"
%*!(J&Tt9
E            + 8  7264&"7".4>2264&"7".4>22>4."–S#(##(#K!!.!!š#<H<##<H<#ƒ33>33ƒ##(##L!.!!.!8$<##<H<##<”3>33>3          
    ?''7#733##3Ckd"ä™+n¨¨¨¨¨¨®]V"*&K&%&              *  ///?'?'77'77'77'#'#5#7Ó'>C
0/Cg*
8
#+!.9## ]
b.-MMs[8KaNI      #  G Q n  %'&"2?>=4&='"57473764"&54754?2621&327##54?17#"/.=46?62. YY		YY		M

$T		YYY	é55	j	55	j	Ÿ|4	g5j55     ,    $ ( 0 4 8  7#'"27#".4>2.3#3#7!!75!5!5!5!Ì&%S
		
	%�þæ			þúþú©^^				»	ô		ôê¨&    ÿÿ   ò- -5;JPRW^cdnt  "+7656=#.'.>'370#61&31#&'&7333'#&'.7&74'56751?6736767167676?3761231716'27162'1&1#5&'#1&7141"'1&1"73'1641'65147"'4'&'&76767>.72576?6?651&?097.'21&'7"#2#0'4"4&671?6.77'''&'76'031256547…H#	2

&			T		6'Œà+�
&						-@!
			

)


»z™ŸW      - Z ± Ï>  7#"&'&/"""&'&/.465'4676?'4>7>5'454>32'2;2?4/./=4>323265'.#"'&#"=."265#"/&62>&/.72767675?4>754?6?/&/&5'&/&""&/&"22>76?6=/&#""&/ù	

		
		~

C			
@


	[
	


		
�	ä

	
	

        +      /77'7//ô"ô"á áM^=E2=		ò	
ñèß�/7''            #375#53#535#53ýá		á
„]]q^^^^	ô		ôqgÏÏ^^    ÿÿ      ' 4 D  7"&462"&462.''3&57"&462676&''"1>&'&#ö!!¦!!2"
1 a!!
	ÒD&	)
ó!e!t(!2	"| #
              73#'735753#ááá¯55>KKáááá955=
3       á  
    73733'77#3733'767?,	+
,…=?d©qqB((z©++BCC      ô     %#53#5335#áááááááÎ&q&q&           7".?#.767>73+f4#§n#	)J	B
g          6  7".?#.767>73+'"732?326=4&#f4#§n >	r	#	)J	B
gÑC	.hB           36+.=46;76Æ4#§m
	)J
B
g          6  36+.=46;7627676&#'576."#"3Æ4#§m!=
r	
	)J
B
gÐC	.hB         / A M R h  %''7'&"32767672>4+".7677"'.7>;3737'7/'#'7'&/7>4&''':9		$"â*FI© ,
"#"Ê6#
+Š:;:ë'(:;%!·,FK… 
##"'$6@,}<<<       ô     # '  73##'5#53546;2+335##373#73#¼8ƒ8888^ƒƒ&&ô©©¼©ƒƒƒƒƒ         Ï   ?3#&ÒjÄ

f        Ï   '5Ä

fÒj       Ï   7'57h

f&Òj        Ï   %#'73Òih

f       ÿ >  %"&'67"&'&'7.'&513&'&'&767'5476762676	$+-**
		

å"
	
			
       " & *  7#'375'#3#375'#7#375'53#5#53ý ?

K		>!		8

:9		8
–8^%Î&&^^	K		K	^
8		8
VV
8		8z99ƒ%%%%          " & *  #3'375'#3#375'#737553#57#53ý8		9:

8		!>		K

? 
á%^8ƒ&&	8
VV
8		8
]
K		K
]
8/&&ƒ88ƒ&        # ' + / 3  7#'5'#5375'#3##37573375'3#3##53#53ý! 
	

%				 "		&	 C 
%
„889¼K G
%	&		&	%
G 	&		"  "		&ÅK8K        	  -  75'73''37'57#53'#3#'7'73#37#5�""""bEEN888:9OEEO988:8²K!"K8K""Kg79--79--         	    ' + 3 7 ? C G K  '#5'75#'37'7#'573'35##'573'35##'573'35##'573'35+35#36(''(N%		%
&�8

8	8&&B%		%
&�8

8	8&&%%%%'RT'èRR''b	&		&
%	8

8
%–	&		&
9
8		8	&p            754>3.#375'3#5^)#.8&¼&&¼©% *%pppp      	   ' /  737'#'55#37'>'6'7'64'7'6'74II4	H;;..Å%&ÑHôH	^W;Æ:K%*$'+/         / [ _  73737575'5'#'##37#5/?53?3#'7#567>32#546?>4'1.'1&"#53� -
  	. /

/))((	 
-  .	  
-  -
((((q			
]       , B N Z b f j  74626?'."577>#"&"276?"./&'"&>4&'3#.54737!!75!5!5!5!e				s				ž		Ïþæ			þúþúT	"	


	
Î	ô		ôê¨&          7#'#'5'57573733#'37''�/

/ .	  
-?F@ 
-  -
  	.  -
0FA       / 6  73737575'5'#'##37#5/?53?3#'737''� -
  	. /

/))((F@ 
-  .	  
-  -
(((( FA        ô    !  7375'#53535#35#'535#35#–qqq©		8		ô––©–^K	„	8&	^	    ÿÿ.   &  3&'5#3#535#'5>.67''ô	à]K8g	¤($!($8-' 
gS©
»t"($!($R;4     ,   + 1 7  3&'5#3#535#'5"2>4.".4>32'7'7''7'ô	à]K8g	Î##(##!!		0
gS©
»g#(##(#ƒ!.!C.        ,   +  3&'5#3#535#'5"2>4.".4>32ô	à]K8g	Î##(##!!
gS©
»g#(##(#ƒ!.!      ÿþ.  . 1  3&'5#3#535#'52'.'.7>76'ô	à]K8g	Î

	
:9
gS©
»g
	
	
K&K           #3#35#5375#53ô		g8–8g	áá
»

»²©      , ô  3 7 ; G S  732+"/&"+"&=46";2?62;26=4&#3#%3#'2+"&46;2+"&463K–!!

!!	"	áŸ/–/ô!K!



!K!K		K8888%          )  754'&"6577>=6&'7"/&4·O(,Œ¡4èH!;šj	”á		Ï		¥�	       *  7'&/"/&4?'&4?627>#553Ì`*$$*b2<II='X 	!"	 Y\A87.I         # 0 8 @  73535#5##3##33535#75##33535&"2?64"&4?7'762R–J	ŒŒ¢yÎ^–.�	Œžy             3#'73'5#=3Ž{öƒkÖ_æÎÉ&KK        ô   '  735#5#'375>4&'5'#".4>2�%
K		K
z#(##(#ƒ/8Z,2,)		),2,)		z##(##         á     5#";#35#5#"&46;#53ág^8&#^Ï^'ÏÏ     , ÷   ' 7 C  53!53!7#5##"&54?4#"563232651#531632"'32654&"þÔ€
"$
	?*^&&88	&
˜C;          #375#535#53ô		ô	áááá
Î		ÎÅ„&          / E Z z Š  7&'&7>2327354&'.=4>37."5#3532>4'.=>6>25'&26?5'.467#53#'573I			
k^
	

ÜKT		|'66&rë
	1.t

	`
	M	q	'67%      %- $ ? L  23'.=2>7>.'.">5//?—
!"

ˆ)		)
	4Q$	[,J&#

#'L	89" 		 "`'3k       %- $ ? i q  22'.=>7>.'.">5'#'54>?>4&'&"#'4>7673#'—
!"

ˆ)		)

`
,J&#

#'L	89" 		 "
a      %- $ ? S  22'.=>7>.'.">5/#'#37375'7—
!"

ˆ)		)

G%%%%%%%%,J&#

#'L	89" 		 "&&%%&&%%          +  7'.>267>54."75#5##335âPOH9?G0d'.&&E%&&¹&OP+EB#5€''-'K%%%%          #  7'.>267>54."'3#âPOH9?G0d'.&&]]¹&OP+EB#5€''-']      Æ                                                 (      
 $ /        S  	   f  	   t  	   ‚  	   �  	   ž  	   ¶  	 
 H Ä  	  &codiconRegularcodiconcodiconVersion 1.11codiconThe icon font for Visual Studio Codehttp://fontello.com c o d i c o n R e g u l a r c o d i c o n c o d i c o n V e r s i o n   1 . 1 1 c o d i c o n T h e   i c o n   f o n t   f o r   V i s u a l   S t u d i o   C o d e h t t p : / / f o n t e l l o . c o m                              Î	
 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€�‚ƒ„…†‡ˆ‰Š‹Œ�Ž��‘’“”•–—˜™š›œ�žŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ 	
 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€�‚ƒ„…†‡ˆ‰Š‹Œ�Ž��‘’“”•–—˜™š›œ�žŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ accountactivate-breakpointsaddarchive
arrow-botharrow-circle-downarrow-circle-leftarrow-circle-rightarrow-circle-up
arrow-down
arrow-leftarrow-rightarrow-small-downarrow-small-leftarrow-small-rightarrow-small-up
arrow-swaparrow-upattachazure-devopsazurebeaker-stopbeakerbell-dotbell-slash-dot
bell-slashbellblankboldbookbookmarkbracket-dotbracket-error	briefcase	broadcastbrowserbugcalendarcall-incomingcall-outgoingcase-sensitive	check-allcheck	checklistchevron-downchevron-leftchevron-right
chevron-upchipchrome-closechrome-maximizechrome-minimizechrome-restorecircle-filledcircle-large-filledcircle-largecircle-slashcircle-small-filledcircle-smallcirclecircuit-board	clear-allclippy	close-allclosecloud-downloadcloud-uploadcloudcode-osscodecoffeecollapse-all
color-modecombinecomment-discussioncomment-draftcomment-unresolvedcommentcompass-activecompass-dotcompasscopilotcopycoveragecredit-carddash	dashboarddatabase	debug-alldebug-alt-small	debug-alt'debug-breakpoint-conditional-unverifieddebug-breakpoint-conditional debug-breakpoint-data-unverifieddebug-breakpoint-data$debug-breakpoint-function-unverifieddebug-breakpoint-functiondebug-breakpoint-log-unverifieddebug-breakpoint-logdebug-breakpoint-unsupporteddebug-consoledebug-continue-smalldebug-continuedebug-coveragedebug-disconnectdebug-line-by-linedebug-pausedebug-rerundebug-restart-framedebug-restartdebug-reverse-continuedebug-stackframe-activedebug-stackframedebug-startdebug-step-backdebug-step-intodebug-step-outdebug-step-over
debug-stopdebugdesktop-downloaddevice-camera-videodevice-cameradevice-mobile
diff-addeddiff-ignoreddiff-modifieddiff-multiplediff-removeddiff-renameddiff-singlediffdiscardediteditor-layoutellipsisempty-windowerror-smallerrorexclude
expand-allexport
extensions
eye-closedeyefeedbackfile-binary	file-code
file-mediafile-pdffile-submodulefile-symlink-directoryfile-symlink-filefile-zipfilefilesfilter-filledfilterflame	fold-downfold-upfoldfolder-activefolder-libraryfolder-openedfoldergamegeargiftgist-secret
git-commitgit-compare	git-fetch	git-mergegit-pull-request-closedgit-pull-request-creategit-pull-request-draftgit-pull-request-go-to-changesgit-pull-request-new-changesgit-pull-requestgit-stash-applygit-stash-pop	git-stashgithub-action
github-altgithub-invertedgithub-projectgithubglobe
go-to-filego-to-searchgrabber
graph-left
graph-linegraph-scattergraphgrippergroup-by-ref-typeheart-filledhearthistoryhomehorizontal-rulehubotinboxindentinfoinsertinspectissue-draftissue-reopenedissuesitalicjerseyjsonkebab-verticalkeylawlayers-active
layers-dotlayerslayout-activitybar-leftlayout-activitybar-rightlayout-centeredlayout-menubarlayout-panel-centerlayout-panel-justifylayout-panel-leftlayout-panel-offlayout-panel-rightlayout-panellayout-sidebar-left-offlayout-sidebar-leftlayout-sidebar-right-offlayout-sidebar-rightlayout-statusbarlayoutlibrarylightbulb-autofixlightbulb-sparkle	lightbulblink-externallinklist-filter	list-flatlist-orderedlist-selection	list-treelist-unordered
live-shareloadinglocation
lock-smalllockmagnet	mail-readmail
map-filledmap-vertical-filledmap-verticalmapmarkdown	megaphonementionmenumerge
mic-filledmic	milestonemirrormortar-boardmovemultiple-windowsmusicmutenew-file
new-foldernewline
no-newlinenotenotebook-templatenotebookoctofaceopen-previeworganizationoutputpackagepaintcanpass-filledpass
percentage
person-addpersonpiano	pie-chartpinpinned-dirtypinnedplay-circleplayplugpreserve-casepreviewprimitive-squareprojectpulsequestionquoteradio-tower	reactionsrecord-keysrecord-smallrecordredo
referencesrefreshregexremote-explorerremoteremovereplace-allreplacereply
repo-clone
repo-fetchrepo-force-pushrepo-forked	repo-pull	repo-pushreporeportrequest-changesrobotrocketroot-folder-openedroot-folderrssruby	run-aboverun-all-coveragerun-all	run-belowrun-coverage
run-errorssave-allsave-assavescreen-fullscreen-normalsearch-fuzzysearch-stopsearchsendserver-environmentserver-processserversettings-gearsettingsshareshieldsign-insign-outsmileysnakesort-precedencesource-controlsparkle-filledsparklesplit-horizontalsplit-verticalsquirrel
star-empty	star-full	star-halfstop-circlesurround-withsymbol-arraysymbol-booleansymbol-classsymbol-colorsymbol-constantsymbol-enum-membersymbol-enumsymbol-eventsymbol-fieldsymbol-filesymbol-interface
symbol-keysymbol-keywordsymbol-methodsymbol-miscsymbol-namespacesymbol-numericsymbol-operatorsymbol-parametersymbol-propertysymbol-rulersymbol-snippetsymbol-stringsymbol-structuresymbol-variablesync-ignoredsynctabletagtargettasklist	telescopeterminal-bashterminal-cmdterminal-debianterminal-linuxterminal-powershellterminal-tmuxterminal-ubuntuterminal	text-size
three-barsthumbsdown-filled
thumbsdownthumbsup-filledthumbsuptoolstrashtriangle-downtriangle-lefttriangle-righttriangle-uptwittertype-hierarchy-subtype-hierarchy-supertype-hierarchyunfoldungroup-by-ref-typeunlockunmute
unverifiedvariable-groupverified-filledverifiedversions	vm-active
vm-connect
vm-outline
vm-runningvmvrvscode-insidersvscodewandwarningwatch
whitespace
whole-wordwindow	word-wrapworkspace-trustedworkspace-unknownworkspace-untrustedzoom-inzoom-out  <svg xmlns="http://www.w3.org/2000/svg" xmlns:x="http://www.w3.org/1999/xlink" viewBox="0 0 51500 51500"><radialGradient id="b" cx="87.4%" cy="-12.9%" r="128%" gradientTransform="matrix(.8 0 0 1 .18 .13)"><stop offset=".13" stop-color="#ffbd4f"/><stop offset=".28" stop-color="#ff980e"/><stop offset=".47" stop-color="#ff3750"/><stop offset=".78" stop-color="#eb0878"/><stop offset=".86" stop-color="#e50080"/></radialGradient><radialGradient id="d" cx="49%" cy="40%" r="128%" gradientTransform="matrix(.82 0 0 1 .09 0)"><stop offset=".3" stop-color="#960e18"/><stop offset=".35" stop-color="#b11927" stop-opacity=".74"/><stop offset=".43" stop-color="#db293d" stop-opacity=".34"/><stop offset=".5" stop-color="#f5334b" stop-opacity=".1"/><stop offset=".53" stop-color="#ff3750" stop-opacity="0"/></radialGradient><radialGradient id="e" cx="48%" cy="-12%" r="140%"><stop offset=".13" stop-color="#fff44f"/><stop offset=".53" stop-color="#ff980e"/></radialGradient><radialGradient id="f" cx="22.76%" cy="110.11%" r="100%"><stop offset=".35" stop-color="#3a8ee6"/><stop offset=".67" stop-color="#9059ff"/><stop offset="1" stop-color="#c139e6"/></radialGradient><radialGradient id="h" cx="52%" cy="33%" r="59%" gradientTransform="scale(.9 1)"><stop offset=".21" stop-color="#9059ff" stop-opacity="0"/><stop offset=".97" stop-color="#6e008b" stop-opacity=".6"/></radialGradient><radialGradient id="i" cx="210%" cy="-100%" r="290%"><stop offset=".1" stop-color="#ffe226"/><stop offset=".79" stop-color="#ff7139"/></radialGradient><radialGradient id="j" cx="84%" cy="-41%" r="180%"><stop offset=".11" stop-color="#fff44f"/><stop offset=".46" stop-color="#ff980e"/><stop offset=".72" stop-color="#ff3647"/><stop offset=".9" stop-color="#e31587"/></radialGradient><radialGradient id="k" cx="16.1%" cy="-18.6%" r="348.8%" gradientTransform="matrix(.10453 .46743 -.99452 .04913 -.05 -.26)"><stop offset="0" stop-color="#fff44f"/><stop offset=".3" stop-color="#ff980e"/><stop offset=".57" stop-color="#ff3647"/><stop offset=".74" stop-color="#e31587"/></radialGradient><radialGradient id="l" cx="18.9%" cy="-42.5%" r="238.4%"><stop offset=".14" stop-color="#fff44f"/><stop offset=".48" stop-color="#ff980e"/><stop offset=".66" stop-color="#ff3647"/><stop offset=".9" stop-color="#e31587"/></radialGradient><radialGradient id="m" cx="159.3%" cy="-44.72%" r="313.1%"><stop offset=".09" stop-color="#fff44f"/><stop offset=".63" stop-color="#ff980e"/></radialGradient><linearGradient id="a" x1="87.25%" x2="9.4%" y1="15.5%" y2="93.1%"><stop offset=".05" stop-color="#fff44f"/><stop offset=".37" stop-color="#ff980e"/><stop offset=".53" stop-color="#ff3647"/><stop offset=".7" stop-color="#e31587"/></linearGradient><linearGradient id="n" x1="80%" x2="18%" y1="14%" y2="84%"><stop offset=".17" stop-color="#fff44f" stop-opacity=".8"/><stop offset=".6" stop-color="#fff44f" stop-opacity="0"/></linearGradient><path id="c" d="M47870 16735c-1044-2512-3160-5224-4820-6082 1352 2650 2134 5310 2433 7294 0-6 2 5 4 22l4 26c2268 6147 1032 12398-748 16218-2754 5910-9420 11967-19857 11670-11276-318-21210-8683-23064-19643-338-1728 0-2605 170-4008-207 1080-286 1394-390 3315l-2 123c0 13270 10760 24030 24032 24030 11887 0 21756-8630 23690-19963l110-927c477-4120-53-8453-1560-12075z"/><path id="g" d="M25677 21050c-40 598-2150 2660-2890 2660-6834 0-7943 4133-7943 4133 303 3480 2726 6348 5660 7865 134 70 270 130 405 193a13277 13277 0 00706 289 10674 10674 0 003127 603c11978 562 14300-14320 5655-18640 2213-385 4510 505 5794 1407-2100-3672-6025-6150-10530-6150-285 0-564 24-844 43a12025 12025 0 00-6614 2549c366 310 780 724 1650 1583 1630 1606 5813 3270 5822 3465z"/><path fill="url(#a)" d="M47870 16735c-1044-2512-3160-5224-4820-6082 1352 2650 2134 5310 2433 7294l5 40c-2718-6773-7325-9505-11088-15452l-566-920a7372 7372 0 01-265-497 4370 4370 0 01-359-950 63 63 0 00-55-65 82 82 0 00-45 0l-12 7-17 10 10-14c-6037 3536-8085 10076-8274 13350a12025 12025 0 00-6614 2548 7136 7136 0 00-622-470 11134 11134 0 01-68-5873c-2468 1124-4390 2900-5785 4470h-10c-953-1206-886-5187-832-6018-10-52-710 363-802 425a17507 17507 0 00-2349 2012 21048 21048 0 00-2244 2692l-1 3v-3a20284 20284 0 00-3225 7280l-32 160a39700 39700 0 00-237 1500l-5 52a22907 22907 0 00-390 3316l-1 120c0 13270 10760 24030 24032 24030 11887 0 21756-8630 23690-19963l110-927c477-4120-53-8453-1560-12075zM20170 35545c113 53 220 112 334 164l16 10a12620 12620 0 01-350-174zm5506-14493zm19813-3060l-3-23 4 26z"/><use fill="url(#b)" x:href="#c"/><use fill="url(#d)" x:href="#c"/><path fill="url(#e)" d="M36192 19560l150 110a13070 13070 0 00-2231-2911C26640 9290 32150 563 33080 120l10-13c-6037 3535-8085 10076-8273 13348 280-20 560-43 844-43 4505 0 8430 2477 10530 6150z"/><use fill="url(#f)" x:href="#g"/><use fill="url(#h)" x:href="#g"/><path fill="url(#i)" d="M17083 15204a24404 24404 0 01498 330 11134 11134 0 01-67-5874c-2470 1125-4390 2900-5785 4470 115-3 3600-66 5354 1074z"/><path fill="url(#j)" d="M1822 26240c1855 10960 11788 19325 23063 19644 10437 296 17104-5762 19858-11670 1780-3820 3016-10070 748-16218v-2l-4-24c-2-17-4-28-4-22l5 40c853 5566-1980 10958-6405 14604l-13 30c-8625 7023-16878 4237-18550 3097a14410 14410 0 01-350-174c-5028-2403-7105-6984-6660-10913-4245 0-5693-3580-5693-3580s3812-2718 8836-355c4653 2190 9023 355 9023 354-10-195-4192-1860-5822-3465-872-860-1285-1272-1652-1583a7136 7136 0 00-622-470 28293 28293 0 00-498-330c-1753-1140-5240-1076-5355-1073h-10c-953-1207-886-5188-832-6020-10-50-710 363-802 426a17507 17507 0 00-2349 2012 21048 21048 0 00-2244 2692l-1 3v-3a20284 20284 0 00-3225 7280c-10 52-865 3784-444 5720z"/><path fill="url(#k)" d="M34110 16760a13070 13070 0 012231 2910l360 296c5450 5020 2594 12120 2380 12626 4426-3646 7258-9038 6405-14604-2716-6774-7323-9506-11086-15453l-566-920a7372 7372 0 01-265-497 4370 4370 0 01-359-950 63 63 0 00-55-65 82 82 0 00-45 0l-12 7-17 10c-930 443-6440 9170 1030 16640z"/><path fill="url(#l)" d="M36702 19965a4743 4743 0 00-360-295l-150-110c-1283-900-3580-1792-5794-1407 8644 4322 6323 19203-5655 18640a10674 10674 0 01-3127-603 13451 13451 0 01-706-289 9064 9064 0 01-405-193l16 10c1670 1140 9924 3925 18550-3097l13-30c213-506 3068-7606-2380-12626z"/><path fill="url(#m)" d="M14844 27844s1110-4133 7943-4133c740 0 2850-2062 2890-2660s-4370 1836-9023-354c-5024-2363-8836 354-8836 354s1448 3580 5693 3580c-445 3930 1632 8510 6660 10913 113 53 218 112 334 164-2935-1517-5358-4384-5660-7865z"/><path fill="url(#n)" d="M47870 16735c-1044-2512-3160-5224-4820-6082 1352 2650 2134 5310 2433 7294l5 40c-2718-6773-7325-9505-11088-15452l-566-920a7372 7372 0 01-265-497 4370 4370 0 01-359-950 63 63 0 00-55-65 82 82 0 00-45 0l-12 7-17 10 10-14c-6037 3536-8085 10076-8274 13350 280-20 560-43 845-43 4505 0 8430 2477 10530 6148-1284-900-3580-1792-5795-1407 8644 4322 6323 19203-5655 18640a10674 10674 0 01-3127-603 13451 13451 0 01-706-289 9064 9064 0 01-405-193l17 10a14410 14410 0 01-350-174c112 53 218 112 333 164-2935-1517-5358-4384-5660-7865 0 0 1108-4133 7942-4133 740 0 2850-2062 2890-2660-10-195-4190-1860-5822-3465-870-860-1285-1272-1650-1583a7136 7136 0 00-623-470 11134 11134 0 01-67-5873c-2470 1124-4390 2900-5785 4470h-10c-953-1207-886-5187-832-6020-10-50-710 363-802 426a17507 17507 0 00-2349 2012 21048 21048 0 00-2243 2692l-1 3v-3a20284 20284 0 00-3225 7280l-32 160a39787 39787 0 00-277 1515c-2 18 2-17 0 0a27956 27956 0 00-355 3353l-3 122c0 13270 10760 24030 24032 24030 11887 0 21756-8630 23690-19963l110-927c477-4120-53-8453-1560-12075zm-2384 1234l4 26v-2l-4-24z"/></svg><svg xmlns="http://www.w3.org/2000/svg" xmlns:x="http://www.w3.org/1999/xlink" viewBox="0 0 51500 51500"><radialGradient id="d" cx="87.4%" cy="-12.9%" r="128%" gradientTransform="matrix(.8 0 0 1 .18 .13)"><stop offset=".13" stop-color="#ffbd4f"/><stop offset=".28" stop-color="#ff980e"/><stop offset=".47" stop-color="#ff3750"/><stop offset=".78" stop-color="#eb0878"/><stop offset=".86" stop-color="#e50080"/></radialGradient><radialGradient id="f" cx="49%" cy="40%" r="128%" gradientTransform="matrix(.82 0 0 1 .09 0)"><stop offset=".3" stop-color="#960e18"/><stop offset=".35" stop-color="#b11927" stop-opacity=".74"/><stop offset=".43" stop-color="#db293d" stop-opacity=".34"/><stop offset=".5" stop-color="#f5334b" stop-opacity=".1"/><stop offset=".53" stop-color="#ff3750" stop-opacity="0"/></radialGradient><radialGradient id="g" cx="48%" cy="-12%" r="140%"><stop offset=".13" stop-color="#fff44f"/><stop offset=".53" stop-color="#ff980e"/></radialGradient><radialGradient id="h" cx="22.76%" cy="110.11%" r="100%"><stop offset=".35" stop-color="#3a8ee6"/><stop offset=".67" stop-color="#9059ff"/><stop offset="1" stop-color="#c139e6"/></radialGradient><radialGradient id="j" cx="52%" cy="33%" r="59%" gradientTransform="scale(.9 1)"><stop offset=".21" stop-color="#9059ff" stop-opacity="0"/><stop offset=".97" stop-color="#6e008b" stop-opacity=".6"/></radialGradient><radialGradient id="k" cx="210%" cy="-100%" r="290%"><stop offset=".1" stop-color="#ffe226"/><stop offset=".79" stop-color="#ff7139"/></radialGradient><radialGradient id="l" cx="84%" cy="-41%" r="180%"><stop offset=".11" stop-color="#fff44f"/><stop offset=".46" stop-color="#ff980e"/><stop offset=".72" stop-color="#ff3647"/><stop offset=".9" stop-color="#e31587"/></radialGradient><radialGradient id="m" cx="16.1%" cy="-18.6%" r="348.8%" gradientTransform="matrix(.10453 .46743 -.99452 .04913 -.05 -.26)"><stop offset="0" stop-color="#fff44f"/><stop offset=".3" stop-color="#ff980e"/><stop offset=".57" stop-color="#ff3647"/><stop offset=".74" stop-color="#e31587"/></radialGradient><radialGradient id="n" cx="18.9%" cy="-42.5%" r="238.4%"><stop offset=".14" stop-color="#fff44f"/><stop offset=".48" stop-color="#ff980e"/><stop offset=".66" stop-color="#ff3647"/><stop offset=".9" stop-color="#e31587"/></radialGradient><radialGradient id="o" cx="159.3%" cy="-44.72%" r="313.1%"><stop offset=".09" stop-color="#fff44f"/><stop offset=".63" stop-color="#ff980e"/></radialGradient><linearGradient id="c" x1="87.25%" x2="9.4%" y1="15.5%" y2="93.1%"><stop offset=".05" stop-color="#fff44f"/><stop offset=".37" stop-color="#ff980e"/><stop offset=".53" stop-color="#ff3647"/><stop offset=".7" stop-color="#e31587"/></linearGradient><linearGradient id="p" x1="80%" x2="18%" y1="14%" y2="84%"><stop offset=".17" stop-color="#fff44f" stop-opacity=".8"/><stop offset=".6" stop-color="#fff44f" stop-opacity="0"/></linearGradient><linearGradient id="b" x1="44605" x2="38527" y1="43446" y2="37691" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#054096" stop-opacity=".5"/><stop offset=".05" stop-color="#0f3d9c" stop-opacity=".44"/><stop offset=".26" stop-color="#2f35b1" stop-opacity=".25"/><stop offset=".47" stop-color="#462fbf" stop-opacity=".1"/><stop offset=".67" stop-color="#542bc8" stop-opacity=".03"/><stop offset=".86" stop-color="#592acb" stop-opacity="0"/></linearGradient><linearGradient id="q" x1="28037" x2="49981" y1="37793" y2="47078" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#54ffbd"/><stop offset="1" stop-color="#0df"/></linearGradient><path id="a" d="M45068 32763H27508a937 937 0 00-937 937v2810a7493 7493 0 007492 7493h9718a5620 5620 0 005619-5620v-2459c0-1404-1405-3160-4332-3160z"/><path id="e" d="M47870 16735c-1044-2512-3160-5224-4820-6082 1352 2650 2134 5310 2433 7294 0-6 2 5 4 22l4 26c2268 6147 1032 12398-748 16218-2754 5910-9420 11967-19857 11670-11276-318-21210-8683-23064-19643-338-1728 0-2605 170-4008-207 1080-286 1394-390 3315l-2 123c0 13270 10760 24030 24032 24030 11887 0 21756-8630 23690-19963l110-927c477-4120-53-8453-1560-12075z"/><path id="i" d="M25677 21050c-40 598-2150 2660-2890 2660-6834 0-7943 4133-7943 4133 303 3480 2726 6348 5660 7865 134 70 270 130 405 193a13277 13277 0 00706 289 10674 10674 0 003127 603c11978 562 14300-14320 5655-18640 2213-385 4510 505 5794 1407-2100-3672-6025-6150-10530-6150-285 0-564 24-844 43a12025 12025 0 00-6614 2549c366 310 780 724 1650 1583 1630 1606 5813 3270 5822 3465z"/><filter id="r" width="300%" height="300%" x="-1" y="-1"><feOffset dx="-400" dy="-400" in="SourceGraphic"/><feColorMatrix values=".01 0 0 0 0 0 0 0 0 0 0 .2 0 0 0 0 0 0 .2 0"/><feGaussianBlur stdDeviation="800"/><feBlend in="SourceGraphic"/></filter><use fill="#008787" x:href="#a"/><use fill="url(#b)" opacity=".9" x:href="#a"/><path fill="url(#c)" d="M47870 16735c-1044-2512-3160-5224-4820-6082 1352 2650 2134 5310 2433 7294l5 40c-2718-6773-7325-9505-11088-15452l-566-920a7372 7372 0 01-265-497 4370 4370 0 01-359-950 63 63 0 00-55-65 82 82 0 00-45 0l-12 7-17 10 10-14c-6037 3536-8085 10076-8274 13350a12025 12025 0 00-6614 2548 7136 7136 0 00-622-470 11134 11134 0 01-68-5873c-2468 1124-4390 2900-5785 4470h-10c-953-1206-886-5187-832-6018-10-52-710 363-802 425a17507 17507 0 00-2349 2012 21048 21048 0 00-2244 2692l-1 3v-3a20284 20284 0 00-3225 7280l-32 160a39700 39700 0 00-237 1500l-5 52a22907 22907 0 00-390 3316l-1 120c0 13270 10760 24030 24032 24030 11887 0 21756-8630 23690-19963l110-927c477-4120-53-8453-1560-12075zM20170 35545c113 53 220 112 334 164l16 10a12620 12620 0 01-350-174zm5506-14493zm19813-3060l-3-23 4 26z"/><use fill="url(#d)" x:href="#e"/><use fill="url(#f)" x:href="#e"/><path fill="url(#g)" d="M36192 19560l150 110a13070 13070 0 00-2231-2911C26640 9290 32150 563 33080 120l10-13c-6037 3535-8085 10076-8273 13348 280-20 560-43 844-43 4505 0 8430 2477 10530 6150z"/><use fill="url(#h)" x:href="#i"/><use fill="url(#j)" x:href="#i"/><path fill="url(#k)" d="M17083 15204a24404 24404 0 01498 330 11134 11134 0 01-67-5874c-2470 1125-4390 2900-5785 4470 115-3 3600-66 5354 1074z"/><path fill="url(#l)" d="M1822 26240c1855 10960 11788 19325 23063 19644 10437 296 17104-5762 19858-11670 1780-3820 3016-10070 748-16218v-2l-4-24c-2-17-4-28-4-22l5 40c853 5566-1980 10958-6405 14604l-13 30c-8625 7023-16878 4237-18550 3097a14410 14410 0 01-350-174c-5028-2403-7105-6984-6660-10913-4245 0-5693-3580-5693-3580s3812-2718 8836-355c4653 2190 9023 355 9023 354-10-195-4192-1860-5822-3465-872-860-1285-1272-1652-1583a7136 7136 0 00-622-470 28293 28293 0 00-498-330c-1753-1140-5240-1076-5355-1073h-10c-953-1207-886-5188-832-6020-10-50-710 363-802 426a17507 17507 0 00-2349 2012 21048 21048 0 00-2244 2692l-1 3v-3a20284 20284 0 00-3225 7280c-10 52-865 3784-444 5720z"/><path fill="url(#m)" d="M34110 16760a13070 13070 0 012231 2910l360 296c5450 5020 2594 12120 2380 12626 4426-3646 7258-9038 6405-14604-2716-6774-7323-9506-11086-15453l-566-920a7372 7372 0 01-265-497 4370 4370 0 01-359-950 63 63 0 00-55-65 82 82 0 00-45 0l-12 7-17 10c-930 443-6440 9170 1030 16640z"/><path fill="url(#n)" d="M36702 19965a4743 4743 0 00-360-295l-150-110c-1283-900-3580-1792-5794-1407 8644 4322 6323 19203-5655 18640a10674 10674 0 01-3127-603 13451 13451 0 01-706-289 9064 9064 0 01-405-193l16 10c1670 1140 9924 3925 18550-3097l13-30c213-506 3068-7606-2380-12626z"/><path fill="url(#o)" d="M14844 27844s1110-4133 7943-4133c740 0 2850-2062 2890-2660s-4370 1836-9023-354c-5024-2363-8836 354-8836 354s1448 3580 5693 3580c-445 3930 1632 8510 6660 10913 113 53 218 112 334 164-2935-1517-5358-4384-5660-7865z"/><path fill="url(#p)" d="M47870 16735c-1044-2512-3160-5224-4820-6082 1352 2650 2134 5310 2433 7294l5 40c-2718-6773-7325-9505-11088-15452l-566-920a7372 7372 0 01-265-497 4370 4370 0 01-359-950 63 63 0 00-55-65 82 82 0 00-45 0l-12 7-17 10 10-14c-6037 3536-8085 10076-8274 13350 280-20 560-43 845-43 4505 0 8430 2477 10530 6148-1284-900-3580-1792-5795-1407 8644 4322 6323 19203-5655 18640a10674 10674 0 01-3127-603 13451 13451 0 01-706-289 9064 9064 0 01-405-193l17 10a14410 14410 0 01-350-174c112 53 218 112 333 164-2935-1517-5358-4384-5660-7865 0 0 1108-4133 7942-4133 740 0 2850-2062 2890-2660-10-195-4190-1860-5822-3465-870-860-1285-1272-1650-1583a7136 7136 0 00-623-470 11134 11134 0 01-67-5873c-2470 1124-4390 2900-5785 4470h-10c-953-1207-886-5187-832-6020-10-50-710 363-802 426a17507 17507 0 00-2349 2012 21048 21048 0 00-2243 2692l-1 3v-3a20284 20284 0 00-3225 7280l-32 160a39787 39787 0 00-277 1515c-2 18 2-17 0 0a27956 27956 0 00-355 3353l-3 122c0 13270 10760 24030 24032 24030 11887 0 21756-8630 23690-19963l110-927c477-4120-53-8453-1560-12075zm-2384 1234l4 26v-2l-4-24z"/><path fill="url(#q)" d="M48463 36861H32320a6919 6919 0 00-6920 6919v3384a937 937 0 00937 936h16143a6919 6919 0 006920-6919v-5257a937 937 0 01-937 937z" filter="url(#r)"/><path fill="#20123a" d="M32624 42417a1026 1026 0 00535-943c0-834-580-1300-1610-1300h-1923v4650h1936c1030 0 1668-458 1668-1376 0-483-217-834-605-1030zm-2114-1447h1057c470 0 694 198 694 523 0 318-204 554-680 554h-1070zm1063 3044h-1063v-1160h1025c567 0 784 210 784 573s-255 586-746 586zm2515 810h3127v-853h-2230v-1057h2230v-847h-2230v-1047h2230v-847h-3127zm7355-4650h-3458v828h1293v3820h885v-3820h1280zm2407 0h-885l-1758 4650h924l305-847h1943l305 847h924zm-1114 2987l675-1847 668 1847z"/></svg><svg xmlns="http://www.w3.org/2000/svg" xmlns:x="http://www.w3.org/1999/xlink" viewBox="0 0 51500 51500"><radialGradient id="c" cx="-922719" cy="-981512" r="8080" gradientTransform="matrix(6.201 0 0 6.2 5764500 6090880)" x:href="#a"><stop offset=".11" stop-color="#3fe1b0"/><stop offset=".12" stop-color="#3bdcb3"/><stop offset=".25" stop-color="#1bb3d3"/><stop offset=".36" stop-color="#0799e6"/><stop offset=".42" stop-color="#0090ed"/><stop offset=".49" stop-color="#2482f1"/><stop offset=".64" stop-color="#7165fb"/><stop offset=".71" stop-color="#9059ff"/><stop offset=".8" stop-color="#7d49ed"/><stop offset=".86" stop-color="#7542e5"/></radialGradient><radialGradient id="e" cx="-925671" cy="-978209" r="8080" gradientTransform="matrix(6.201 0 0 6.2 5764500 6090880)" x:href="#a"><stop offset=".3" stop-color="#45278d"/><stop offset=".34" stop-color="#562896" stop-opacity=".8"/><stop offset=".43" stop-color="#782aa9" stop-opacity=".36"/><stop offset=".49" stop-color="#8d2bb5" stop-opacity=".1"/><stop offset=".53" stop-color="#952bb9" stop-opacity="0"/></radialGradient><radialGradient id="f" cx="30454" cy="-5865" r="5853" x:href="#a"><stop offset=".13" stop-color="#3fe1b0"/><stop offset=".29" stop-color="#28d0c8"/><stop offset=".53" stop-color="#00b3f4"/></radialGradient><radialGradient id="g" cx="18870" cy="39072" r="3847" x:href="#a"><stop offset=".29" stop-color="#0060df"/><stop offset=".42" stop-color="#2357e1"/><stop offset=".6" stop-color="#4f4ce3"/><stop offset=".75" stop-color="#6b45e4"/><stop offset=".83" stop-color="#7542e5"/></radialGradient><radialGradient id="i" cx="-925562" cy="-979155" r="2040" gradientTransform="matrix(6.027 -1.458 1.708 7.059 7275865 5582118)" x:href="#a"><stop offset=".21" stop-color="#45278d" stop-opacity="0"/><stop offset=".25" stop-color="#44268a" stop-opacity=".06"/><stop offset=".72" stop-color="#371f6f" stop-opacity=".6"/><stop offset=".96" stop-color="#321c64" stop-opacity=".8"/></radialGradient><radialGradient id="j" cx="-925773" cy="-981843" r="2768" gradientTransform="matrix(6.201 0 0 6.2 5764500 6090880)" x:href="#a"><stop offset="0" stop-color="#0df"/><stop offset=".23" stop-color="#00d6fd"/><stop offset=".57" stop-color="#00c3f8"/><stop offset=".79" stop-color="#00b3f4"/></radialGradient><radialGradient id="k" cx="-923598" cy="-983598" r="11808" gradientTransform="matrix(6.201 0 0 6.2 5764500 6090880)" x:href="#a"><stop offset=".13" stop-color="#3fe1b0"/><stop offset=".43" stop-color="#0df"/><stop offset=".48" stop-color="#1ec1ff"/><stop offset=".62" stop-color="#7077ff"/><stop offset=".69" stop-color="#9059ff"/><stop offset=".9" stop-color="#b833e1"/></radialGradient><radialGradient id="l" cx="-924717" cy="-982286" r="8650" gradientTransform="matrix(.649 6.166 -4.046 .426 -3344043 6120786)" x:href="#a"><stop offset="0" stop-color="#54ffbd"/><stop offset=".1" stop-color="#4cf3b8"/><stop offset=".2" stop-color="#3fe1b0"/><stop offset=".26" stop-color="#33d8bd"/><stop offset=".37" stop-color="#12c0e1"/><stop offset=".42" stop-color="#00b3f4"/><stop offset=".74" stop-color="#0060df"/></radialGradient><radialGradient id="m" cx="-925838" cy="-980818" r="7372" gradientTransform="matrix(6.201 0 0 6.2 5764500 6090880)" x:href="#a"><stop offset=".14" stop-color="#3fe1b0"/><stop offset=".43" stop-color="#0df"/><stop offset=".48" stop-color="#1ec1ff"/><stop offset=".62" stop-color="#7077ff"/><stop offset=".69" stop-color="#9059ff"/></radialGradient><radialGradient id="n" cx="-923892" cy="-980386" r="8069" gradientTransform="matrix(6.201 0 0 6.2 5764500 6090880)" x:href="#a"><stop offset=".09" stop-color="#54ffbd"/><stop offset=".24" stop-color="#41f7cc"/><stop offset=".54" stop-color="#0fe3f3"/><stop offset=".63" stop-color="#0df"/></radialGradient><linearGradient id="b" x1="4718" x2="5598" y1="12735" y2="38928" x:href="#a"><stop offset="0" stop-color="#3fe1b0"/><stop offset=".41" stop-color="#00b3f4"/><stop offset=".42" stop-color="#03b0f4"/><stop offset=".82" stop-color="#5561e9"/><stop offset="1" stop-color="#7542e5"/></linearGradient><linearGradient id="o" x1="44208" x2="10264" y1="7477" y2="41421" x:href="#a"><stop offset=".17" stop-color="#54ffbd" stop-opacity=".8"/><stop offset=".24" stop-color="#43f8ca" stop-opacity=".64"/><stop offset=".36" stop-color="#27ede1" stop-opacity=".37"/><stop offset=".47" stop-color="#12e4f1" stop-opacity=".17"/><stop offset=".55" stop-color="#05dffb" stop-opacity=".05"/><stop offset=".59" stop-color="#0df" stop-opacity="0"/></linearGradient><linearGradient id="a" gradientUnits="userSpaceOnUse"/><path id="d" d="M47870 16735c-1044-2512-3160-5224-4820-6082 1352 2650 2134 5310 2433 7294 0-6 2 5 4 22l4 26c2268 6147 1032 12398-748 16218-2754 5910-9420 11967-19857 11670-11276-318-21210-8683-23064-19643-338-1728 0-2605 170-4008-207 1080-286 1394-390 3315l-2 123c0 13270 10760 24030 24032 24030 11887 0 21756-8630 23690-19963l110-927c477-4120-53-8453-1560-12075z"/><path id="h" d="M25677 21050c-40 598-2150 2660-2890 2660-6834 0-7943 4133-7943 4133 303 3480 2726 6348 5660 7865 134 70 270 130 405 193a13277 13277 0 00706 289 10674 10674 0 003127 603c11978 562 14300-14320 5655-18640 2213-385 4510 505 5794 1407-2100-3672-6025-6150-10530-6150-285 0-564 24-844 43a12025 12025 0 00-6614 2549c366 310 780 724 1650 1583 1630 1606 5813 3270 5822 3465z"/><path fill="url(#b)" d="M47870 16735c-1044-2512-3160-5224-4820-6082 1352 2650 2134 5310 2433 7294l5 40c-2718-6773-7325-9505-11088-15452l-566-920a7372 7372 0 01-265-497 4370 4370 0 01-359-950 63 63 0 00-55-65 82 82 0 00-45 0l-12 7-17 10 10-14c-6037 3536-8085 10076-8274 13350a12025 12025 0 00-6614 2548 7136 7136 0 00-622-470 11134 11134 0 01-68-5873c-2468 1124-4390 2900-5785 4470h-10c-953-1206-886-5187-832-6018-10-52-710 363-802 425a17507 17507 0 00-2349 2012 21048 21048 0 00-2244 2692l-1 3v-3a20284 20284 0 00-3225 7280l-32 160a39700 39700 0 00-237 1500l-5 52a22907 22907 0 00-390 3316l-1 120c0 13270 10760 24030 24032 24030 11887 0 21756-8630 23690-19963l110-927c477-4120-53-8453-1560-12075zM20170 35545c113 53 220 112 334 164l16 10a12620 12620 0 01-350-174zm5506-14493zm19813-3060l-3-23 4 26z"/><use fill="url(#c)" x:href="#d"/><use fill="url(#e)" x:href="#d"/><path fill="url(#f)" d="M36192 19560l150 110a13070 13070 0 00-2231-2911C26640 9290 32150 563 33080 120l10-13c-6037 3535-8085 10076-8273 13348 280-20 560-43 844-43 4505 0 8430 2477 10530 6150z"/><use fill="url(#g)" x:href="#h"/><use fill="url(#i)" x:href="#h"/><path fill="url(#j)" d="M17083 15204a24404 24404 0 01498 330 11134 11134 0 01-67-5874c-2470 1125-4390 2900-5785 4470 115-3 3600-66 5354 1074z"/><path fill="url(#k)" d="M1822 26240c1855 10960 11788 19325 23063 19644 10437 296 17104-5762 19858-11670 1780-3820 3016-10070 748-16218v-2l-4-24c-2-17-4-28-4-22l5 40c853 5566-1980 10958-6405 14604l-13 30c-8625 7023-16878 4237-18550 3097a14410 14410 0 01-350-174c-5028-2403-7105-6984-6660-10913-4245 0-5693-3580-5693-3580s3812-2718 8836-355c4653 2190 9023 355 9023 354-10-195-4192-1860-5822-3465-872-860-1285-1272-1652-1583a7136 7136 0 00-622-470 28293 28293 0 00-498-330c-1753-1140-5240-1076-5355-1073h-10c-953-1207-886-5188-832-6020-10-50-710 363-802 426a17507 17507 0 00-2349 2012 21048 21048 0 00-2244 2692l-1 3v-3a20284 20284 0 00-3225 7280c-10 52-865 3784-444 5720z"/><path fill="url(#l)" d="M34110 16760a13070 13070 0 012231 2910l360 296c5450 5020 2594 12120 2380 12626 4426-3646 7258-9038 6405-14604-2716-6774-7323-9506-11086-15453l-566-920a7372 7372 0 01-265-497 4370 4370 0 01-359-950 63 63 0 00-55-65 82 82 0 00-45 0l-12 7-17 10c-930 443-6440 9170 1030 16640z"/><path fill="url(#m)" d="M36702 19965a4743 4743 0 00-360-295l-150-110c-1283-900-3580-1792-5794-1407 8644 4322 6323 19203-5655 18640a10674 10674 0 01-3127-603 13451 13451 0 01-706-289 9064 9064 0 01-405-193l16 10c1670 1140 9924 3925 18550-3097l13-30c213-506 3068-7606-2380-12626z"/><path fill="url(#n)" d="M14844 27844s1110-4133 7943-4133c740 0 2850-2062 2890-2660s-4370 1836-9023-354c-5024-2363-8836 354-8836 354s1448 3580 5693 3580c-445 3930 1632 8510 6660 10913 113 53 218 112 334 164-2935-1517-5358-4384-5660-7865z"/><path fill="url(#o)" d="M47870 16735c-1044-2512-3160-5224-4820-6082 1352 2650 2134 5310 2433 7294l5 40c-2718-6773-7325-9505-11088-15452l-566-920a7372 7372 0 01-265-497 4370 4370 0 01-359-950 63 63 0 00-55-65 82 82 0 00-45 0l-12 7-17 10 10-14c-6037 3536-8085 10076-8274 13350 280-20 560-43 845-43 4505 0 8430 2477 10530 6148-1284-900-3580-1792-5795-1407 8644 4322 6323 19203-5655 18640a10674 10674 0 01-3127-603 13451 13451 0 01-706-289 9064 9064 0 01-405-193l17 10a14410 14410 0 01-350-174c112 53 218 112 333 164-2935-1517-5358-4384-5660-7865 0 0 1108-4133 7942-4133 740 0 2850-2062 2890-2660-10-195-4190-1860-5822-3465-870-860-1285-1272-1650-1583a7136 7136 0 00-623-470 11134 11134 0 01-67-5873c-2470 1124-4390 2900-5785 4470h-10c-953-1207-886-5187-832-6020-10-50-710 363-802 426a17507 17507 0 00-2349 2012 21048 21048 0 00-2243 2692l-1 3v-3a20284 20284 0 00-3225 7280l-32 160a39787 39787 0 00-277 1515c-2 18 2-17 0 0a27956 27956 0 00-355 3353l-3 122c0 13270 10760 24030 24032 24030 11887 0 21756-8630 23690-19963l110-927c477-4120-53-8453-1560-12075zm-2384 1234l4 26v-2l-4-24z"/></svg>:root{--color-canvas-default-transparent: rgba(255,255,255,0);--color-marketing-icon-primary: #218bff;--color-marketing-icon-secondary: #54aeff;--color-diff-blob-addition-num-text: #24292f;--color-diff-blob-addition-fg: #24292f;--color-diff-blob-addition-num-bg: #CCFFD8;--color-diff-blob-addition-line-bg: #E6FFEC;--color-diff-blob-addition-word-bg: #ABF2BC;--color-diff-blob-deletion-num-text: #24292f;--color-diff-blob-deletion-fg: #24292f;--color-diff-blob-deletion-num-bg: #FFD7D5;--color-diff-blob-deletion-line-bg: #FFEBE9;--color-diff-blob-deletion-word-bg: rgba(255,129,130,.4);--color-diff-blob-hunk-num-bg: rgba(84,174,255,.4);--color-diff-blob-expander-icon: #57606a;--color-diff-blob-selected-line-highlight-mix-blend-mode: multiply;--color-diffstat-deletion-border: rgba(27,31,36,.15);--color-diffstat-addition-border: rgba(27,31,36,.15);--color-diffstat-addition-bg: #2da44e;--color-search-keyword-hl: #fff8c5;--color-prettylights-syntax-comment: #6e7781;--color-prettylights-syntax-constant: #0550ae;--color-prettylights-syntax-entity: #8250df;--color-prettylights-syntax-storage-modifier-import: #24292f;--color-prettylights-syntax-entity-tag: #116329;--color-prettylights-syntax-keyword: #cf222e;--color-prettylights-syntax-string: #0a3069;--color-prettylights-syntax-variable: #953800;--color-prettylights-syntax-brackethighlighter-unmatched: #82071e;--color-prettylights-syntax-invalid-illegal-text: #f6f8fa;--color-prettylights-syntax-invalid-illegal-bg: #82071e;--color-prettylights-syntax-carriage-return-text: #f6f8fa;--color-prettylights-syntax-carriage-return-bg: #cf222e;--color-prettylights-syntax-string-regexp: #116329;--color-prettylights-syntax-markup-list: #3b2300;--color-prettylights-syntax-markup-heading: #0550ae;--color-prettylights-syntax-markup-italic: #24292f;--color-prettylights-syntax-markup-bold: #24292f;--color-prettylights-syntax-markup-deleted-text: #82071e;--color-prettylights-syntax-markup-deleted-bg: #FFEBE9;--color-prettylights-syntax-markup-inserted-text: #116329;--color-prettylights-syntax-markup-inserted-bg: #dafbe1;--color-prettylights-syntax-markup-changed-text: #953800;--color-prettylights-syntax-markup-changed-bg: #ffd8b5;--color-prettylights-syntax-markup-ignored-text: #eaeef2;--color-prettylights-syntax-markup-ignored-bg: #0550ae;--color-prettylights-syntax-meta-diff-range: #8250df;--color-prettylights-syntax-brackethighlighter-angle: #57606a;--color-prettylights-syntax-sublimelinter-gutter-mark: #8c959f;--color-prettylights-syntax-constant-other-reference-link: #0a3069;--color-codemirror-text: #24292f;--color-codemirror-bg: #ffffff;--color-codemirror-gutters-bg: #ffffff;--color-codemirror-guttermarker-text: #ffffff;--color-codemirror-guttermarker-subtle-text: #6e7781;--color-codemirror-linenumber-text: #57606a;--color-codemirror-cursor: #24292f;--color-codemirror-selection-bg: rgba(84,174,255,.4);--color-codemirror-activeline-bg: rgba(234,238,242,.5);--color-codemirror-matchingbracket-text: #24292f;--color-codemirror-lines-bg: #ffffff;--color-codemirror-syntax-comment: #24292f;--color-codemirror-syntax-constant: #0550ae;--color-codemirror-syntax-entity: #8250df;--color-codemirror-syntax-keyword: #cf222e;--color-codemirror-syntax-storage: #cf222e;--color-codemirror-syntax-string: #0a3069;--color-codemirror-syntax-support: #0550ae;--color-codemirror-syntax-variable: #953800;--color-checks-bg: #24292f;--color-checks-run-border-width: 0px;--color-checks-container-border-width: 0px;--color-checks-text-primary: #f6f8fa;--color-checks-text-secondary: #8c959f;--color-checks-text-link: #54aeff;--color-checks-btn-icon: #afb8c1;--color-checks-btn-hover-icon: #f6f8fa;--color-checks-btn-hover-bg: rgba(255,255,255,.125);--color-checks-input-text: #eaeef2;--color-checks-input-placeholder-text: #8c959f;--color-checks-input-focus-text: #8c959f;--color-checks-input-bg: #32383f;--color-checks-input-shadow: none;--color-checks-donut-error: #fa4549;--color-checks-donut-pending: #bf8700;--color-checks-donut-success: #2da44e;--color-checks-donut-neutral: #afb8c1;--color-checks-dropdown-text: #afb8c1;--color-checks-dropdown-bg: #32383f;--color-checks-dropdown-border: #424a53;--color-checks-dropdown-shadow: rgba(27,31,36,.3);--color-checks-dropdown-hover-text: #f6f8fa;--color-checks-dropdown-hover-bg: #424a53;--color-checks-dropdown-btn-hover-text: #f6f8fa;--color-checks-dropdown-btn-hover-bg: #32383f;--color-checks-scrollbar-thumb-bg: #57606a;--color-checks-header-label-text: #d0d7de;--color-checks-header-label-open-text: #f6f8fa;--color-checks-header-border: #32383f;--color-checks-header-icon: #8c959f;--color-checks-line-text: #d0d7de;--color-checks-line-num-text: rgba(140,149,159,.75);--color-checks-line-timestamp-text: #8c959f;--color-checks-line-hover-bg: #32383f;--color-checks-line-selected-bg: rgba(33,139,255,.15);--color-checks-line-selected-num-text: #54aeff;--color-checks-line-dt-fm-text: #24292f;--color-checks-line-dt-fm-bg: #9a6700;--color-checks-gate-bg: rgba(125,78,0,.15);--color-checks-gate-text: #d0d7de;--color-checks-gate-waiting-text: #afb8c1;--color-checks-step-header-open-bg: #32383f;--color-checks-step-error-text: #ff8182;--color-checks-step-warning-text: #d4a72c;--color-checks-logline-text: #8c959f;--color-checks-logline-num-text: rgba(140,149,159,.75);--color-checks-logline-debug-text: #c297ff;--color-checks-logline-error-text: #d0d7de;--color-checks-logline-error-num-text: #ff8182;--color-checks-logline-error-bg: rgba(164,14,38,.15);--color-checks-logline-warning-text: #d0d7de;--color-checks-logline-warning-num-text: #d4a72c;--color-checks-logline-warning-bg: rgba(125,78,0,.15);--color-checks-logline-command-text: #54aeff;--color-checks-logline-section-text: #4ac26b;--color-checks-ansi-black: #24292f;--color-checks-ansi-black-bright: #32383f;--color-checks-ansi-white: #d0d7de;--color-checks-ansi-white-bright: #d0d7de;--color-checks-ansi-gray: #8c959f;--color-checks-ansi-red: #ff8182;--color-checks-ansi-red-bright: #ffaba8;--color-checks-ansi-green: #4ac26b;--color-checks-ansi-green-bright: #6fdd8b;--color-checks-ansi-yellow: #d4a72c;--color-checks-ansi-yellow-bright: #eac54f;--color-checks-ansi-blue: #54aeff;--color-checks-ansi-blue-bright: #80ccff;--color-checks-ansi-magenta: #c297ff;--color-checks-ansi-magenta-bright: #d8b9ff;--color-checks-ansi-cyan: #76e3ea;--color-checks-ansi-cyan-bright: #b3f0ff;--color-project-header-bg: #24292f;--color-project-sidebar-bg: #ffffff;--color-project-gradient-in: #ffffff;--color-project-gradient-out: rgba(255,255,255,0);--color-mktg-success: rgba(36,146,67,1);--color-mktg-info: rgba(19,119,234,1);--color-mktg-bg-shade-gradient-top: rgba(27,31,36,.065);--color-mktg-bg-shade-gradient-bottom: rgba(27,31,36,0);--color-mktg-btn-bg-top: hsla(228,82%,66%,1);--color-mktg-btn-bg-bottom: #4969ed;--color-mktg-btn-bg-overlay-top: hsla(228,74%,59%,1);--color-mktg-btn-bg-overlay-bottom: #3355e0;--color-mktg-btn-text: #ffffff;--color-mktg-btn-primary-bg-top: hsla(137,56%,46%,1);--color-mktg-btn-primary-bg-bottom: #2ea44f;--color-mktg-btn-primary-bg-overlay-top: hsla(134,60%,38%,1);--color-mktg-btn-primary-bg-overlay-bottom: #22863a;--color-mktg-btn-primary-text: #ffffff;--color-mktg-btn-enterprise-bg-top: hsla(249,100%,72%,1);--color-mktg-btn-enterprise-bg-bottom: #6f57ff;--color-mktg-btn-enterprise-bg-overlay-top: hsla(248,65%,63%,1);--color-mktg-btn-enterprise-bg-overlay-bottom: #614eda;--color-mktg-btn-enterprise-text: #ffffff;--color-mktg-btn-outline-text: #4969ed;--color-mktg-btn-outline-border: rgba(73,105,237,.3);--color-mktg-btn-outline-hover-text: #3355e0;--color-mktg-btn-outline-hover-border: rgba(51,85,224,.5);--color-mktg-btn-outline-focus-border: #4969ed;--color-mktg-btn-outline-focus-border-inset: rgba(73,105,237,.5);--color-mktg-btn-dark-text: #ffffff;--color-mktg-btn-dark-border: rgba(255,255,255,.3);--color-mktg-btn-dark-hover-text: #ffffff;--color-mktg-btn-dark-hover-border: rgba(255,255,255,.5);--color-mktg-btn-dark-focus-border: #ffffff;--color-mktg-btn-dark-focus-border-inset: rgba(255,255,255,.5);--color-avatar-bg: #ffffff;--color-avatar-border: rgba(27,31,36,.15);--color-avatar-stack-fade: #afb8c1;--color-avatar-stack-fade-more: #d0d7de;--color-avatar-child-shadow: -2px -2px 0 rgba(255,255,255,.8);--color-topic-tag-border: rgba(0,0,0,0);--color-select-menu-backdrop-border: rgba(0,0,0,0);--color-select-menu-tap-highlight: rgba(175,184,193,.5);--color-select-menu-tap-focus-bg: #b6e3ff;--color-overlay-shadow: 0 1px 3px rgba(27,31,36,.12), 0 8px 24px rgba(66,74,83,.12);--color-header-text: rgba(255,255,255,.7);--color-header-bg: #24292f;--color-header-logo: #ffffff;--color-header-search-bg: #24292f;--color-header-search-border: #57606a;--color-sidenav-selected-bg: #ffffff;--color-menu-bg-active: rgba(0,0,0,0);--color-control-transparent-bg-hover: #818b981a;--color-input-disabled-bg: rgba(175,184,193,.2);--color-timeline-badge-bg: #eaeef2;--color-ansi-black: #24292f;--color-ansi-black-bright: #57606a;--color-ansi-white: #6e7781;--color-ansi-white-bright: #8c959f;--color-ansi-gray: #6e7781;--color-ansi-red: #cf222e;--color-ansi-red-bright: #a40e26;--color-ansi-green: #116329;--color-ansi-green-bright: #1a7f37;--color-ansi-yellow: #4d2d00;--color-ansi-yellow-bright: #633c01;--color-ansi-blue: #0969da;--color-ansi-blue-bright: #218bff;--color-ansi-magenta: #8250df;--color-ansi-magenta-bright: #a475f9;--color-ansi-cyan: #1b7c83;--color-ansi-cyan-bright: #3192aa;--color-btn-text: #24292f;--color-btn-bg: #f6f8fa;--color-btn-border: rgba(27,31,36,.15);--color-btn-shadow: 0 1px 0 rgba(27,31,36,.04);--color-btn-inset-shadow: inset 0 1px 0 rgba(255,255,255,.25);--color-btn-hover-bg: #f3f4f6;--color-btn-hover-border: rgba(27,31,36,.15);--color-btn-active-bg: hsla(220,14%,93%,1);--color-btn-active-border: rgba(27,31,36,.15);--color-btn-selected-bg: hsla(220,14%,94%,1);--color-btn-focus-bg: #f6f8fa;--color-btn-focus-border: rgba(27,31,36,.15);--color-btn-focus-shadow: 0 0 0 3px rgba(9,105,218,.3);--color-btn-shadow-active: inset 0 .15em .3em rgba(27,31,36,.15);--color-btn-shadow-input-focus: 0 0 0 .2em rgba(9,105,218,.3);--color-btn-counter-bg: rgba(27,31,36,.08);--color-btn-primary-text: #ffffff;--color-btn-primary-bg: #2da44e;--color-btn-primary-border: rgba(27,31,36,.15);--color-btn-primary-shadow: 0 1px 0 rgba(27,31,36,.1);--color-btn-primary-inset-shadow: inset 0 1px 0 rgba(255,255,255,.03);--color-btn-primary-hover-bg: #2c974b;--color-btn-primary-hover-border: rgba(27,31,36,.15);--color-btn-primary-selected-bg: hsla(137,55%,36%,1);--color-btn-primary-selected-shadow: inset 0 1px 0 rgba(0,45,17,.2);--color-btn-primary-disabled-text: rgba(255,255,255,.8);--color-btn-primary-disabled-bg: #94d3a2;--color-btn-primary-disabled-border: rgba(27,31,36,.15);--color-btn-primary-focus-bg: #2da44e;--color-btn-primary-focus-border: rgba(27,31,36,.15);--color-btn-primary-focus-shadow: 0 0 0 3px rgba(45,164,78,.4);--color-btn-primary-icon: rgba(255,255,255,.8);--color-btn-primary-counter-bg: rgba(255,255,255,.2);--color-btn-outline-text: #0969da;--color-btn-outline-hover-text: #ffffff;--color-btn-outline-hover-bg: #0969da;--color-btn-outline-hover-border: rgba(27,31,36,.15);--color-btn-outline-hover-shadow: 0 1px 0 rgba(27,31,36,.1);--color-btn-outline-hover-inset-shadow: inset 0 1px 0 rgba(255,255,255,.03);--color-btn-outline-hover-counter-bg: rgba(255,255,255,.2);--color-btn-outline-selected-text: #ffffff;--color-btn-outline-selected-bg: hsla(212,92%,42%,1);--color-btn-outline-selected-border: rgba(27,31,36,.15);--color-btn-outline-selected-shadow: inset 0 1px 0 rgba(0,33,85,.2);--color-btn-outline-disabled-text: rgba(9,105,218,.5);--color-btn-outline-disabled-bg: #f6f8fa;--color-btn-outline-disabled-counter-bg: rgba(9,105,218,.05);--color-btn-outline-focus-border: rgba(27,31,36,.15);--color-btn-outline-focus-shadow: 0 0 0 3px rgba(5,80,174,.4);--color-btn-outline-counter-bg: rgba(9,105,218,.1);--color-btn-danger-text: #cf222e;--color-btn-danger-hover-text: #ffffff;--color-btn-danger-hover-bg: #a40e26;--color-btn-danger-hover-border: rgba(27,31,36,.15);--color-btn-danger-hover-shadow: 0 1px 0 rgba(27,31,36,.1);--color-btn-danger-hover-inset-shadow: inset 0 1px 0 rgba(255,255,255,.03);--color-btn-danger-hover-counter-bg: rgba(255,255,255,.2);--color-btn-danger-selected-text: #ffffff;--color-btn-danger-selected-bg: hsla(356,72%,44%,1);--color-btn-danger-selected-border: rgba(27,31,36,.15);--color-btn-danger-selected-shadow: inset 0 1px 0 rgba(76,0,20,.2);--color-btn-danger-disabled-text: rgba(207,34,46,.5);--color-btn-danger-disabled-bg: #f6f8fa;--color-btn-danger-disabled-counter-bg: rgba(207,34,46,.05);--color-btn-danger-focus-border: rgba(27,31,36,.15);--color-btn-danger-focus-shadow: 0 0 0 3px rgba(164,14,38,.4);--color-btn-danger-counter-bg: rgba(207,34,46,.1);--color-btn-danger-icon: #cf222e;--color-btn-danger-hover-icon: #ffffff;--color-underlinenav-icon: #6e7781;--color-underlinenav-border-hover: rgba(175,184,193,.2);--color-fg-default: #24292f;--color-fg-muted: #57606a;--color-fg-subtle: #6e7781;--color-fg-on-emphasis: #ffffff;--color-canvas-default: #ffffff;--color-canvas-overlay: #ffffff;--color-canvas-inset: #f6f8fa;--color-canvas-subtle: #f6f8fa;--color-border-default: #d0d7de;--color-border-muted: hsla(210,18%,87%,1);--color-border-subtle: rgba(27,31,36,.15);--color-shadow-small: 0 1px 0 rgba(27,31,36,.04);--color-shadow-medium: 0 3px 6px rgba(140,149,159,.15);--color-shadow-large: 0 8px 24px rgba(140,149,159,.2);--color-shadow-extra-large: 0 12px 28px rgba(140,149,159,.3);--color-neutral-emphasis-plus: #24292f;--color-neutral-emphasis: #6e7781;--color-neutral-muted: rgba(175,184,193,.2);--color-neutral-subtle: rgba(234,238,242,.5);--color-accent-fg: #0969da;--color-accent-emphasis: #0969da;--color-accent-muted: rgba(84,174,255,.4);--color-accent-subtle: #ddf4ff;--color-success-fg: #1a7f37;--color-success-emphasis: #2da44e;--color-success-muted: rgba(74,194,107,.4);--color-success-subtle: #dafbe1;--color-attention-fg: #9a6700;--color-attention-emphasis: #bf8700;--color-attention-muted: rgba(212,167,44,.4);--color-attention-subtle: #fff8c5;--color-severe-fg: #bc4c00;--color-severe-emphasis: #bc4c00;--color-severe-muted: rgba(251,143,68,.4);--color-severe-subtle: #fff1e5;--color-danger-fg: #cf222e;--color-danger-emphasis: #cf222e;--color-danger-muted: rgba(255,129,130,.4);--color-danger-subtle: #FFEBE9;--color-done-fg: #8250df;--color-done-emphasis: #8250df;--color-done-muted: rgba(194,151,255,.4);--color-done-subtle: #fbefff;--color-sponsors-fg: #bf3989;--color-sponsors-emphasis: #bf3989;--color-sponsors-muted: rgba(255,128,200,.4);--color-sponsors-subtle: #ffeff7;--color-primer-canvas-backdrop: rgba(27,31,36,.5);--color-primer-canvas-sticky: rgba(255,255,255,.95);--color-primer-border-active: #FD8C73;--color-primer-border-contrast: rgba(27,31,36,.1);--color-primer-shadow-highlight: inset 0 1px 0 rgba(255,255,255,.25);--color-primer-shadow-inset: inset 0 1px 0 rgba(208,215,222,.2);--color-primer-shadow-focus: 0 0 0 3px rgba(9,105,218,.3);--color-scale-black: #1b1f24;--color-scale-white: #ffffff;--color-scale-gray-0: #f6f8fa;--color-scale-gray-1: #eaeef2;--color-scale-gray-2: #d0d7de;--color-scale-gray-3: #afb8c1;--color-scale-gray-4: #8c959f;--color-scale-gray-5: #6e7781;--color-scale-gray-6: #57606a;--color-scale-gray-7: #424a53;--color-scale-gray-8: #32383f;--color-scale-gray-9: #24292f;--color-scale-blue-0: #ddf4ff;--color-scale-blue-1: #b6e3ff;--color-scale-blue-2: #80ccff;--color-scale-blue-3: #54aeff;--color-scale-blue-4: #218bff;--color-scale-blue-5: #0969da;--color-scale-blue-6: #0550ae;--color-scale-blue-7: #033d8b;--color-scale-blue-8: #0a3069;--color-scale-blue-9: #002155;--color-scale-green-0: #dafbe1;--color-scale-green-1: #aceebb;--color-scale-green-2: #6fdd8b;--color-scale-green-3: #4ac26b;--color-scale-green-4: #2da44e;--color-scale-green-5: #1a7f37;--color-scale-green-6: #116329;--color-scale-green-7: #044f1e;--color-scale-green-8: #003d16;--color-scale-green-9: #002d11;--color-scale-yellow-0: #fff8c5;--color-scale-yellow-1: #fae17d;--color-scale-yellow-2: #eac54f;--color-scale-yellow-3: #d4a72c;--color-scale-yellow-4: #bf8700;--color-scale-yellow-5: #9a6700;--color-scale-yellow-6: #7d4e00;--color-scale-yellow-7: #633c01;--color-scale-yellow-8: #4d2d00;--color-scale-yellow-9: #3b2300;--color-scale-orange-0: #fff1e5;--color-scale-orange-1: #ffd8b5;--color-scale-orange-2: #ffb77c;--color-scale-orange-3: #fb8f44;--color-scale-orange-4: #e16f24;--color-scale-orange-5: #bc4c00;--color-scale-orange-6: #953800;--color-scale-orange-7: #762c00;--color-scale-orange-8: #5c2200;--color-scale-orange-9: #471700;--color-scale-red-0: #FFEBE9;--color-scale-red-1: #ffcecb;--color-scale-red-2: #ffaba8;--color-scale-red-3: #ff8182;--color-scale-red-4: #fa4549;--color-scale-red-5: #cf222e;--color-scale-red-6: #a40e26;--color-scale-red-7: #82071e;--color-scale-red-8: #660018;--color-scale-red-9: #4c0014;--color-scale-purple-0: #fbefff;--color-scale-purple-1: #ecd8ff;--color-scale-purple-2: #d8b9ff;--color-scale-purple-3: #c297ff;--color-scale-purple-4: #a475f9;--color-scale-purple-5: #8250df;--color-scale-purple-6: #6639ba;--color-scale-purple-7: #512a97;--color-scale-purple-8: #3e1f79;--color-scale-purple-9: #2e1461;--color-scale-pink-0: #ffeff7;--color-scale-pink-1: #ffd3eb;--color-scale-pink-2: #ffadda;--color-scale-pink-3: #ff80c8;--color-scale-pink-4: #e85aad;--color-scale-pink-5: #bf3989;--color-scale-pink-6: #99286e;--color-scale-pink-7: #772057;--color-scale-pink-8: #611347;--color-scale-pink-9: #4d0336;--color-scale-coral-0: #FFF0EB;--color-scale-coral-1: #FFD6CC;--color-scale-coral-2: #FFB4A1;--color-scale-coral-3: #FD8C73;--color-scale-coral-4: #EC6547;--color-scale-coral-5: #C4432B;--color-scale-coral-6: #9E2F1C;--color-scale-coral-7: #801F0F;--color-scale-coral-8: #691105;--color-scale-coral-9: #510901 }:root.dark-mode{color-scheme:dark;--color-canvas-default-transparent: rgba(13,17,23,0);--color-marketing-icon-primary: #79c0ff;--color-marketing-icon-secondary: #1f6feb;--color-diff-blob-addition-num-text: #c9d1d9;--color-diff-blob-addition-fg: #c9d1d9;--color-diff-blob-addition-num-bg: rgba(63,185,80,.3);--color-diff-blob-addition-line-bg: rgba(46,160,67,.15);--color-diff-blob-addition-word-bg: rgba(46,160,67,.4);--color-diff-blob-deletion-num-text: #c9d1d9;--color-diff-blob-deletion-fg: #c9d1d9;--color-diff-blob-deletion-num-bg: rgba(248,81,73,.3);--color-diff-blob-deletion-line-bg: rgba(248,81,73,.15);--color-diff-blob-deletion-word-bg: rgba(248,81,73,.4);--color-diff-blob-hunk-num-bg: rgba(56,139,253,.4);--color-diff-blob-expander-icon: #8b949e;--color-diff-blob-selected-line-highlight-mix-blend-mode: screen;--color-diffstat-deletion-border: rgba(240,246,252,.1);--color-diffstat-addition-border: rgba(240,246,252,.1);--color-diffstat-addition-bg: #3fb950;--color-search-keyword-hl: rgba(210,153,34,.4);--color-prettylights-syntax-comment: #8b949e;--color-prettylights-syntax-constant: #79c0ff;--color-prettylights-syntax-entity: #d2a8ff;--color-prettylights-syntax-storage-modifier-import: #c9d1d9;--color-prettylights-syntax-entity-tag: #7ee787;--color-prettylights-syntax-keyword: #ff7b72;--color-prettylights-syntax-string: #a5d6ff;--color-prettylights-syntax-variable: #ffa657;--color-prettylights-syntax-brackethighlighter-unmatched: #f85149;--color-prettylights-syntax-invalid-illegal-text: #f0f6fc;--color-prettylights-syntax-invalid-illegal-bg: #8e1519;--color-prettylights-syntax-carriage-return-text: #f0f6fc;--color-prettylights-syntax-carriage-return-bg: #b62324;--color-prettylights-syntax-string-regexp: #7ee787;--color-prettylights-syntax-markup-list: #f2cc60;--color-prettylights-syntax-markup-heading: #1f6feb;--color-prettylights-syntax-markup-italic: #c9d1d9;--color-prettylights-syntax-markup-bold: #c9d1d9;--color-prettylights-syntax-markup-deleted-text: #ffdcd7;--color-prettylights-syntax-markup-deleted-bg: #67060c;--color-prettylights-syntax-markup-inserted-text: #aff5b4;--color-prettylights-syntax-markup-inserted-bg: #033a16;--color-prettylights-syntax-markup-changed-text: #ffdfb6;--color-prettylights-syntax-markup-changed-bg: #5a1e02;--color-prettylights-syntax-markup-ignored-text: #c9d1d9;--color-prettylights-syntax-markup-ignored-bg: #1158c7;--color-prettylights-syntax-meta-diff-range: #d2a8ff;--color-prettylights-syntax-brackethighlighter-angle: #8b949e;--color-prettylights-syntax-sublimelinter-gutter-mark: #484f58;--color-prettylights-syntax-constant-other-reference-link: #a5d6ff;--color-codemirror-text: #c9d1d9;--color-codemirror-bg: #0d1117;--color-codemirror-gutters-bg: #0d1117;--color-codemirror-guttermarker-text: #0d1117;--color-codemirror-guttermarker-subtle-text: #484f58;--color-codemirror-linenumber-text: #8b949e;--color-codemirror-cursor: #c9d1d9;--color-codemirror-selection-bg: rgba(56,139,253,.4);--color-codemirror-activeline-bg: rgba(110,118,129,.1);--color-codemirror-matchingbracket-text: #c9d1d9;--color-codemirror-lines-bg: #0d1117;--color-codemirror-syntax-comment: #8b949e;--color-codemirror-syntax-constant: #79c0ff;--color-codemirror-syntax-entity: #d2a8ff;--color-codemirror-syntax-keyword: #ff7b72;--color-codemirror-syntax-storage: #ff7b72;--color-codemirror-syntax-string: #a5d6ff;--color-codemirror-syntax-support: #79c0ff;--color-codemirror-syntax-variable: #ffa657;--color-checks-bg: #010409;--color-checks-run-border-width: 1px;--color-checks-container-border-width: 1px;--color-checks-text-primary: #c9d1d9;--color-checks-text-secondary: #8b949e;--color-checks-text-link: #58a6ff;--color-checks-btn-icon: #8b949e;--color-checks-btn-hover-icon: #c9d1d9;--color-checks-btn-hover-bg: rgba(110,118,129,.1);--color-checks-input-text: #8b949e;--color-checks-input-placeholder-text: #484f58;--color-checks-input-focus-text: #c9d1d9;--color-checks-input-bg: #161b22;--color-checks-input-shadow: none;--color-checks-donut-error: #f85149;--color-checks-donut-pending: #d29922;--color-checks-donut-success: #2ea043;--color-checks-donut-neutral: #8b949e;--color-checks-dropdown-text: #c9d1d9;--color-checks-dropdown-bg: #161b22;--color-checks-dropdown-border: #30363d;--color-checks-dropdown-shadow: rgba(1,4,9,.3);--color-checks-dropdown-hover-text: #c9d1d9;--color-checks-dropdown-hover-bg: rgba(110,118,129,.1);--color-checks-dropdown-btn-hover-text: #c9d1d9;--color-checks-dropdown-btn-hover-bg: rgba(110,118,129,.1);--color-checks-scrollbar-thumb-bg: rgba(110,118,129,.4);--color-checks-header-label-text: #8b949e;--color-checks-header-label-open-text: #c9d1d9;--color-checks-header-border: #21262d;--color-checks-header-icon: #8b949e;--color-checks-line-text: #8b949e;--color-checks-line-num-text: #484f58;--color-checks-line-timestamp-text: #484f58;--color-checks-line-hover-bg: rgba(110,118,129,.1);--color-checks-line-selected-bg: rgba(56,139,253,.15);--color-checks-line-selected-num-text: #58a6ff;--color-checks-line-dt-fm-text: #f0f6fc;--color-checks-line-dt-fm-bg: #9e6a03;--color-checks-gate-bg: rgba(187,128,9,.15);--color-checks-gate-text: #8b949e;--color-checks-gate-waiting-text: #d29922;--color-checks-step-header-open-bg: #161b22;--color-checks-step-error-text: #f85149;--color-checks-step-warning-text: #d29922;--color-checks-logline-text: #8b949e;--color-checks-logline-num-text: #484f58;--color-checks-logline-debug-text: #a371f7;--color-checks-logline-error-text: #8b949e;--color-checks-logline-error-num-text: #484f58;--color-checks-logline-error-bg: rgba(248,81,73,.15);--color-checks-logline-warning-text: #8b949e;--color-checks-logline-warning-num-text: #d29922;--color-checks-logline-warning-bg: rgba(187,128,9,.15);--color-checks-logline-command-text: #58a6ff;--color-checks-logline-section-text: #3fb950;--color-checks-ansi-black: #0d1117;--color-checks-ansi-black-bright: #161b22;--color-checks-ansi-white: #b1bac4;--color-checks-ansi-white-bright: #b1bac4;--color-checks-ansi-gray: #6e7681;--color-checks-ansi-red: #ff7b72;--color-checks-ansi-red-bright: #ffa198;--color-checks-ansi-green: #3fb950;--color-checks-ansi-green-bright: #56d364;--color-checks-ansi-yellow: #d29922;--color-checks-ansi-yellow-bright: #e3b341;--color-checks-ansi-blue: #58a6ff;--color-checks-ansi-blue-bright: #79c0ff;--color-checks-ansi-magenta: #bc8cff;--color-checks-ansi-magenta-bright: #d2a8ff;--color-checks-ansi-cyan: #76e3ea;--color-checks-ansi-cyan-bright: #b3f0ff;--color-project-header-bg: #0d1117;--color-project-sidebar-bg: #161b22;--color-project-gradient-in: #161b22;--color-project-gradient-out: rgba(22,27,34,0);--color-mktg-success: rgba(41,147,61,1);--color-mktg-info: rgba(42,123,243,1);--color-mktg-bg-shade-gradient-top: rgba(1,4,9,.065);--color-mktg-bg-shade-gradient-bottom: rgba(1,4,9,0);--color-mktg-btn-bg-top: hsla(228,82%,66%,1);--color-mktg-btn-bg-bottom: #4969ed;--color-mktg-btn-bg-overlay-top: hsla(228,74%,59%,1);--color-mktg-btn-bg-overlay-bottom: #3355e0;--color-mktg-btn-text: #f0f6fc;--color-mktg-btn-primary-bg-top: hsla(137,56%,46%,1);--color-mktg-btn-primary-bg-bottom: #2ea44f;--color-mktg-btn-primary-bg-overlay-top: hsla(134,60%,38%,1);--color-mktg-btn-primary-bg-overlay-bottom: #22863a;--color-mktg-btn-primary-text: #f0f6fc;--color-mktg-btn-enterprise-bg-top: hsla(249,100%,72%,1);--color-mktg-btn-enterprise-bg-bottom: #6f57ff;--color-mktg-btn-enterprise-bg-overlay-top: hsla(248,65%,63%,1);--color-mktg-btn-enterprise-bg-overlay-bottom: #614eda;--color-mktg-btn-enterprise-text: #f0f6fc;--color-mktg-btn-outline-text: #f0f6fc;--color-mktg-btn-outline-border: rgba(240,246,252,.3);--color-mktg-btn-outline-hover-text: #f0f6fc;--color-mktg-btn-outline-hover-border: rgba(240,246,252,.5);--color-mktg-btn-outline-focus-border: #f0f6fc;--color-mktg-btn-outline-focus-border-inset: rgba(240,246,252,.5);--color-mktg-btn-dark-text: #f0f6fc;--color-mktg-btn-dark-border: rgba(240,246,252,.3);--color-mktg-btn-dark-hover-text: #f0f6fc;--color-mktg-btn-dark-hover-border: rgba(240,246,252,.5);--color-mktg-btn-dark-focus-border: #f0f6fc;--color-mktg-btn-dark-focus-border-inset: rgba(240,246,252,.5);--color-avatar-bg: rgba(240,246,252,.1);--color-avatar-border: rgba(240,246,252,.1);--color-avatar-stack-fade: #30363d;--color-avatar-stack-fade-more: #21262d;--color-avatar-child-shadow: -2px -2px 0 #0d1117;--color-topic-tag-border: rgba(0,0,0,0);--color-select-menu-backdrop-border: #484f58;--color-select-menu-tap-highlight: rgba(48,54,61,.5);--color-select-menu-tap-focus-bg: #0c2d6b;--color-overlay-shadow: 0 0 0 1px #30363d, 0 16px 32px rgba(1,4,9,.85);--color-header-text: rgba(240,246,252,.7);--color-header-bg: #161b22;--color-header-logo: #f0f6fc;--color-header-search-bg: #0d1117;--color-header-search-border: #30363d;--color-sidenav-selected-bg: #21262d;--color-menu-bg-active: #161b22;--color-control-transparent-bg-hover: #656c7633;--color-input-disabled-bg: rgba(110,118,129,0);--color-timeline-badge-bg: #21262d;--color-ansi-black: #484f58;--color-ansi-black-bright: #6e7681;--color-ansi-white: #b1bac4;--color-ansi-white-bright: #f0f6fc;--color-ansi-gray: #6e7681;--color-ansi-red: #ff7b72;--color-ansi-red-bright: #ffa198;--color-ansi-green: #3fb950;--color-ansi-green-bright: #56d364;--color-ansi-yellow: #d29922;--color-ansi-yellow-bright: #e3b341;--color-ansi-blue: #58a6ff;--color-ansi-blue-bright: #79c0ff;--color-ansi-magenta: #bc8cff;--color-ansi-magenta-bright: #d2a8ff;--color-ansi-cyan: #39c5cf;--color-ansi-cyan-bright: #56d4dd;--color-btn-text: #c9d1d9;--color-btn-bg: #21262d;--color-btn-border: rgba(240,246,252,.1);--color-btn-shadow: 0 0 transparent;--color-btn-inset-shadow: 0 0 transparent;--color-btn-hover-bg: #30363d;--color-btn-hover-border: #8b949e;--color-btn-active-bg: hsla(212,12%,18%,1);--color-btn-active-border: #6e7681;--color-btn-selected-bg: #161b22;--color-btn-focus-bg: #21262d;--color-btn-focus-border: #8b949e;--color-btn-focus-shadow: 0 0 0 3px rgba(139,148,158,.3);--color-btn-shadow-active: inset 0 .15em .3em rgba(1,4,9,.15);--color-btn-shadow-input-focus: 0 0 0 .2em rgba(31,111,235,.3);--color-btn-counter-bg: #30363d;--color-btn-primary-text: #ffffff;--color-btn-primary-bg: #238636;--color-btn-primary-border: rgba(240,246,252,.1);--color-btn-primary-shadow: 0 0 transparent;--color-btn-primary-inset-shadow: 0 0 transparent;--color-btn-primary-hover-bg: #2ea043;--color-btn-primary-hover-border: rgba(240,246,252,.1);--color-btn-primary-selected-bg: #238636;--color-btn-primary-selected-shadow: 0 0 transparent;--color-btn-primary-disabled-text: rgba(240,246,252,.5);--color-btn-primary-disabled-bg: rgba(35,134,54,.6);--color-btn-primary-disabled-border: rgba(240,246,252,.1);--color-btn-primary-focus-bg: #238636;--color-btn-primary-focus-border: rgba(240,246,252,.1);--color-btn-primary-focus-shadow: 0 0 0 3px rgba(46,164,79,.4);--color-btn-primary-icon: #f0f6fc;--color-btn-primary-counter-bg: rgba(240,246,252,.2);--color-btn-outline-text: #58a6ff;--color-btn-outline-hover-text: #58a6ff;--color-btn-outline-hover-bg: #30363d;--color-btn-outline-hover-border: rgba(240,246,252,.1);--color-btn-outline-hover-shadow: 0 1px 0 rgba(1,4,9,.1);--color-btn-outline-hover-inset-shadow: inset 0 1px 0 rgba(240,246,252,.03);--color-btn-outline-hover-counter-bg: rgba(240,246,252,.2);--color-btn-outline-selected-text: #f0f6fc;--color-btn-outline-selected-bg: #0d419d;--color-btn-outline-selected-border: rgba(240,246,252,.1);--color-btn-outline-selected-shadow: 0 0 transparent;--color-btn-outline-disabled-text: rgba(88,166,255,.5);--color-btn-outline-disabled-bg: #0d1117;--color-btn-outline-disabled-counter-bg: rgba(31,111,235,.05);--color-btn-outline-focus-border: rgba(240,246,252,.1);--color-btn-outline-focus-shadow: 0 0 0 3px rgba(17,88,199,.4);--color-btn-outline-counter-bg: rgba(31,111,235,.1);--color-btn-danger-text: #f85149;--color-btn-danger-hover-text: #f0f6fc;--color-btn-danger-hover-bg: #da3633;--color-btn-danger-hover-border: #f85149;--color-btn-danger-hover-shadow: 0 0 transparent;--color-btn-danger-hover-inset-shadow: 0 0 transparent;--color-btn-danger-hover-icon: #f0f6fc;--color-btn-danger-hover-counter-bg: rgba(255,255,255,.2);--color-btn-danger-selected-text: #ffffff;--color-btn-danger-selected-bg: #b62324;--color-btn-danger-selected-border: #ff7b72;--color-btn-danger-selected-shadow: 0 0 transparent;--color-btn-danger-disabled-text: rgba(248,81,73,.5);--color-btn-danger-disabled-bg: #0d1117;--color-btn-danger-disabled-counter-bg: rgba(218,54,51,.05);--color-btn-danger-focus-border: #f85149;--color-btn-danger-focus-shadow: 0 0 0 3px rgba(248,81,73,.4);--color-btn-danger-counter-bg: rgba(218,54,51,.1);--color-btn-danger-icon: #f85149;--color-underlinenav-icon: #484f58;--color-underlinenav-border-hover: rgba(110,118,129,.4);--color-fg-default: #c9d1d9;--color-fg-muted: #8b949e;--color-fg-subtle: #484f58;--color-fg-on-emphasis: #f0f6fc;--color-canvas-default: #0d1117;--color-canvas-overlay: #161b22;--color-canvas-inset: #010409;--color-canvas-subtle: #161b22;--color-border-default: #30363d;--color-border-muted: #21262d;--color-border-subtle: rgba(240,246,252,.1);--color-shadow-small: 0 0 transparent;--color-shadow-medium: 0 3px 6px #010409;--color-shadow-large: 0 8px 24px #010409;--color-shadow-extra-large: 0 12px 48px #010409;--color-neutral-emphasis-plus: #6e7681;--color-neutral-emphasis: #6e7681;--color-neutral-muted: rgba(110,118,129,.4);--color-neutral-subtle: rgba(110,118,129,.1);--color-accent-fg: #58a6ff;--color-accent-emphasis: #1f6feb;--color-accent-muted: rgba(56,139,253,.4);--color-accent-subtle: rgba(56,139,253,.15);--color-success-fg: #3fb950;--color-success-emphasis: #238636;--color-success-muted: rgba(46,160,67,.4);--color-success-subtle: rgba(46,160,67,.15);--color-attention-fg: #d29922;--color-attention-emphasis: #9e6a03;--color-attention-muted: rgba(187,128,9,.4);--color-attention-subtle: rgba(187,128,9,.15);--color-severe-fg: #db6d28;--color-severe-emphasis: #bd561d;--color-severe-muted: rgba(219,109,40,.4);--color-severe-subtle: rgba(219,109,40,.15);--color-danger-fg: #f85149;--color-danger-emphasis: #da3633;--color-danger-muted: rgba(248,81,73,.4);--color-danger-subtle: rgba(248,81,73,.15);--color-done-fg: #a371f7;--color-done-emphasis: #8957e5;--color-done-muted: rgba(163,113,247,.4);--color-done-subtle: rgba(163,113,247,.15);--color-sponsors-fg: #db61a2;--color-sponsors-emphasis: #bf4b8a;--color-sponsors-muted: rgba(219,97,162,.4);--color-sponsors-subtle: rgba(219,97,162,.15);--color-primer-canvas-backdrop: rgba(1,4,9,.8);--color-primer-canvas-sticky: rgba(13,17,23,.95);--color-primer-border-active: #F78166;--color-primer-border-contrast: rgba(240,246,252,.2);--color-primer-shadow-highlight: 0 0 transparent;--color-primer-shadow-inset: 0 0 transparent;--color-primer-shadow-focus: 0 0 0 3px #0c2d6b;--color-scale-black: #010409;--color-scale-white: #f0f6fc;--color-scale-gray-0: #f0f6fc;--color-scale-gray-1: #c9d1d9;--color-scale-gray-2: #b1bac4;--color-scale-gray-3: #8b949e;--color-scale-gray-4: #6e7681;--color-scale-gray-5: #484f58;--color-scale-gray-6: #30363d;--color-scale-gray-7: #21262d;--color-scale-gray-8: #161b22;--color-scale-gray-9: #0d1117;--color-scale-blue-0: #cae8ff;--color-scale-blue-1: #a5d6ff;--color-scale-blue-2: #79c0ff;--color-scale-blue-3: #58a6ff;--color-scale-blue-4: #388bfd;--color-scale-blue-5: #1f6feb;--color-scale-blue-6: #1158c7;--color-scale-blue-7: #0d419d;--color-scale-blue-8: #0c2d6b;--color-scale-blue-9: #051d4d;--color-scale-green-0: #aff5b4;--color-scale-green-1: #7ee787;--color-scale-green-2: #56d364;--color-scale-green-3: #3fb950;--color-scale-green-4: #2ea043;--color-scale-green-5: #238636;--color-scale-green-6: #196c2e;--color-scale-green-7: #0f5323;--color-scale-green-8: #033a16;--color-scale-green-9: #04260f;--color-scale-yellow-0: #f8e3a1;--color-scale-yellow-1: #f2cc60;--color-scale-yellow-2: #e3b341;--color-scale-yellow-3: #d29922;--color-scale-yellow-4: #bb8009;--color-scale-yellow-5: #9e6a03;--color-scale-yellow-6: #845306;--color-scale-yellow-7: #693e00;--color-scale-yellow-8: #4b2900;--color-scale-yellow-9: #341a00;--color-scale-orange-0: #ffdfb6;--color-scale-orange-1: #ffc680;--color-scale-orange-2: #ffa657;--color-scale-orange-3: #f0883e;--color-scale-orange-4: #db6d28;--color-scale-orange-5: #bd561d;--color-scale-orange-6: #9b4215;--color-scale-orange-7: #762d0a;--color-scale-orange-8: #5a1e02;--color-scale-orange-9: #3d1300;--color-scale-red-0: #ffdcd7;--color-scale-red-1: #ffc1ba;--color-scale-red-2: #ffa198;--color-scale-red-3: #ff7b72;--color-scale-red-4: #f85149;--color-scale-red-5: #da3633;--color-scale-red-6: #b62324;--color-scale-red-7: #8e1519;--color-scale-red-8: #67060c;--color-scale-red-9: #490202;--color-scale-purple-0: #eddeff;--color-scale-purple-1: #e2c5ff;--color-scale-purple-2: #d2a8ff;--color-scale-purple-3: #bc8cff;--color-scale-purple-4: #a371f7;--color-scale-purple-5: #8957e5;--color-scale-purple-6: #6e40c9;--color-scale-purple-7: #553098;--color-scale-purple-8: #3c1e70;--color-scale-purple-9: #271052;--color-scale-pink-0: #ffdaec;--color-scale-pink-1: #ffbedd;--color-scale-pink-2: #ff9bce;--color-scale-pink-3: #f778ba;--color-scale-pink-4: #db61a2;--color-scale-pink-5: #bf4b8a;--color-scale-pink-6: #9e3670;--color-scale-pink-7: #7d2457;--color-scale-pink-8: #5e103e;--color-scale-pink-9: #42062a;--color-scale-coral-0: #FFDDD2;--color-scale-coral-1: #FFC2B2;--color-scale-coral-2: #FFA28B;--color-scale-coral-3: #F78166;--color-scale-coral-4: #EA6045;--color-scale-coral-5: #CF462D;--color-scale-coral-6: #AC3220;--color-scale-coral-7: #872012;--color-scale-coral-8: #640D04;--color-scale-coral-9: #460701 }:root{color-scheme:light dark}body{--transparent-blue: #2196F355;--light-pink: #ff69b460;--gray: #888888;--sidebar-width: 250px;--box-shadow: rgba(0, 0, 0, .133) 0px 1.6px 3.6px 0px, rgba(0, 0, 0, .11) 0px .3px .9px 0px}html,body{width:100%;height:100%;padding:0;margin:0;overflow:hidden;display:flex;overscroll-behavior-x:none}#root{width:100%;height:100%;display:flex}body,dialog{background-color:var(--vscode-panel-background);color:var(--vscode-foreground);font-family:var(--vscode-font-family);font-weight:var(--vscode-font-weight);font-size:var(--vscode-font-size);-webkit-font-smoothing:antialiased}a{color:var(--vscode-textLink-foreground)}dialog{border:none;padding:0;box-shadow:var(--box-shadow);line-height:28px;max-width:400px}dialog .title{display:flex;align-items:center;margin:0;padding:0 5px;height:32px;background-color:var(--vscode-sideBar-background);max-width:400px}dialog .title .codicon{margin-right:3px}dialog .body{padding:10px;text-align:center}.button{color:var(--vscode-button-foreground);background:var(--vscode-button-background);margin:10px;border:none;height:28px;min-width:40px;cursor:pointer;-webkit-user-select:none;user-select:none}.button:focus{outline:1px solid var(--vscode-focusBorder)}.button:hover{background:var(--vscode-button-hoverBackground)}.button.secondary{color:var(--vscode-button-secondaryForeground);background:var(--vscode-button-secondaryBackground)}.button.secondary:hover{background:var(--vscode-button-secondaryHoverBackground)}*{box-sizing:border-box;min-width:0;min-height:0}*[hidden],.hidden{display:none!important}.invisible{visibility:hidden!important}svg{fill:currentColor}.vbox{display:flex;flex-direction:column;flex:auto;position:relative}.fill{position:absolute;top:0;right:0;bottom:0;left:0}.hbox{display:flex;flex:auto;position:relative}.spacer{flex:auto}.codicon-check{color:var(--vscode-charts-green)}.codicon-error{color:var(--vscode-errorForeground)}.codicon-warning{color:var(--vscode-list-warningForeground)}.codicon-circle-outline{color:var(--vscode-disabledForeground)}input[type=text],input[type=search]{color:var(--vscode-input-foreground);background-color:var(--vscode-input-background);border:none;outline:none}.codicon-loading{animation:spin 1s infinite linear}::placeholder{color:var(--vscode-input-placeholderForeground)}@keyframes spin{to{transform:rotate(360deg)}}*,*:before,*:after{box-sizing:border-box;margin:0;padding:0}html,body{height:100%}body{background:var(--color-canvas-default);color:var(--color-fg-default)}body *{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif}#root{height:100%}button{background:none;border:none;color:var(--color-fg-muted);cursor:pointer;display:flex;align-items:center;justify-content:center;flex-shrink:0}button:hover{color:var(--color-fg-default)}svg{fill:none}.dashboard-view{--interactive-orange: 238 134 12;--recording-red: 239 68 68;display:flex;flex-direction:column;height:100%;width:100%;overflow:hidden;position:relative}.dashboard-view.has-annotate-sidebar{flex-direction:row}.dashboard-main{display:flex;flex-direction:column;flex:1;min-width:0;min-height:0}.mode-toggle.toolbar-button.toggled,.mode-toggle.toolbar-button.toggled>.codicon{color:var(--color-fg-on-emphasis)}.mode-toggle.toolbar-button.toggled.mode-interactive{background:rgb(var(--interactive-orange));box-shadow:0 0 0 2px rgb(var(--interactive-orange) / .35)}.mode-toggle.toolbar-button.toggled.mode-record{background:rgb(var(--recording-red));box-shadow:0 0 0 2px rgb(var(--recording-red) / .35)}.mode-toggle.flash{animation:mode-toggle-flash .45s ease-in-out 4}@keyframes mode-toggle-flash{0%,to{box-shadow:0 0 rgb(var(--interactive-orange) / 0)}50%{box-shadow:0 0 0 4px rgb(var(--interactive-orange) / .6);background:rgb(var(--interactive-orange) / .25)}}.toolbar{display:flex;align-items:center;gap:4px;height:40px;min-height:40px;background:var(--color-canvas-overlay);padding:0 8px;position:relative;z-index:100;border-bottom:1px solid var(--color-border-muted);overflow:visible}:root.light-mode .toolbar{background:var(--color-canvas-subtle)}.browser-window{display:flex;flex-direction:column;border:1px solid var(--color-border-default);border-radius:10px;overflow:hidden;box-shadow:0 4px 20px #0003;background:var(--color-canvas-default);position:relative}.browser-chrome{display:flex;align-items:center;gap:4px;height:40px;min-height:40px;padding:0 8px;background:var(--color-canvas-overlay);border-bottom:1px solid var(--color-border-muted);position:relative;overflow:visible}:root.light-mode .browser-chrome{background:var(--color-canvas-subtle)}.omnibox-wrap{flex:1;display:flex;align-items:center;position:relative;min-width:0}.nav-btn{width:32px;height:32px;border-radius:50%}.nav-btn:hover{background:var(--color-neutral-subtle)}.nav-btn:active{background:var(--color-neutral-muted)}.nav-btn[aria-disabled]{color:var(--color-fg-subtle);cursor:default}.nav-btn[aria-disabled]:hover{background:none}.nav-btn svg{width:18px;height:18px}.omnibox{flex:1;height:30px;padding:0 12px;font-size:13px;font-family:inherit;background:var(--color-canvas-inset);color:var(--color-fg-default);border:1px solid var(--color-border-default);border-radius:16px;outline:none;min-width:0}:root.light-mode .omnibox{background:var(--color-canvas-default)}.omnibox:focus{border-color:var(--color-accent-fg);background:var(--color-canvas-default);box-shadow:0 0 0 2px var(--color-accent-muted)}:root.light-mode .omnibox:focus{background:var(--color-canvas-default)}.omnibox::placeholder{color:var(--color-fg-subtle)}.omnibox::selection{background:var(--color-accent-muted)}.omnibox[aria-disabled]{color:var(--color-fg-subtle);cursor:default}.viewport-wrapper{flex:1;display:flex;overflow:hidden;position:relative;min-height:0}.viewport-main{flex:1;display:flex;align-items:center;justify-content:center;position:relative;min-width:0;min-height:0}.screen{position:relative;outline:none;flex:1;min-height:0;width:100%}.display{display:block;width:100%;height:100%;background:var(--color-canvas-subtle);object-fit:contain}.screen-overlay{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:center;font-size:14px;z-index:10;pointer-events:none;background:var(--color-canvas-subtle);color:var(--color-fg-subtle)}.screen-overlay.has-frame{background:#c8c8c880}.screen-overlay.has-frame>span{background:#fff6;backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);color:#000c;padding:12px 24px;border-radius:12px;font-weight:500;border:1px solid rgba(255,255,255,.15);box-shadow:0 0 24px 12px #fff3}.mode-record.toggled>.codicon{animation:mode-record-pulse 1.5s ease-in-out infinite}@keyframes mode-record-pulse{0%,to{opacity:1;transform:scale(1)}50%{opacity:.4;transform:scale(.85)}}.mode-record-label{display:inline-block;margin-left:5px;white-space:nowrap;animation:mode-record-label-slide-in .3s ease both}@keyframes mode-record-label-slide-in{0%{max-width:0;opacity:0;overflow:hidden}to{max-width:100px;opacity:1;overflow:hidden}}.modal-overlay{position:fixed;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:center;background:#0000008c;z-index:1000;padding:24px}.modal{display:flex;flex-direction:column;width:100%;height:100%;background:var(--color-canvas-default);border:1px solid var(--color-border-default);border-radius:10px;box-shadow:0 10px 40px #00000073;overflow:hidden}.modal-toolbar{display:flex;align-items:center;justify-content:flex-end;gap:4px;height:40px;min-height:40px;background:var(--color-canvas-overlay);padding:0 8px;border-bottom:1px solid var(--color-border-muted)}:root.light-mode .modal-toolbar{background:var(--color-canvas-subtle)}.modal-title{margin-right:auto;padding-left:4px;font-size:13px;font-weight:600;color:var(--color-fg-default)}.modal-body{position:relative;flex:1;display:flex;align-items:center;justify-content:center;min-height:0;padding:16px}.recording-body{background:#000}.recording-video{max-width:100%;max-height:100%;object-fit:contain;display:block}:root{--vscode-font-family: system-ui, "Ubuntu", "Droid Sans", sans-serif;--vscode-font-weight: normal;--vscode-font-size: 13px;--vscode-editor-font-family: "Droid Sans Mono", "monospace", monospace;--vscode-editor-font-weight: normal;--vscode-editor-font-size: 14px;--vscode-foreground: #616161;--vscode-disabledForeground: rgba(97, 97, 97, .5);--vscode-errorForeground: #a1260d;--vscode-descriptionForeground: #717171;--vscode-icon-foreground: #424242;--vscode-focusBorder: #0090f1;--vscode-textSeparator-foreground: rgba(0, 0, 0, .18);--vscode-textLink-foreground: #006ab1;--vscode-textLink-activeForeground: #006ab1;--vscode-textPreformat-foreground: #a31515;--vscode-textBlockQuote-background: rgba(127, 127, 127, .1);--vscode-textBlockQuote-border: rgba(0, 122, 204, .5);--vscode-textCodeBlock-background: rgba(220, 220, 220, .4);--vscode-widget-shadow: rgba(0, 0, 0, .16);--vscode-input-background: #ffffff;--vscode-input-foreground: #616161;--vscode-inputOption-activeBorder: #007acc;--vscode-inputOption-hoverBackground: rgba(184, 184, 184, .31);--vscode-inputOption-activeBackground: rgba(0, 144, 241, .2);--vscode-inputOption-activeForeground: #000000;--vscode-input-placeholderForeground: #767676;--vscode-inputValidation-infoBackground: #d6ecf2;--vscode-inputValidation-infoBorder: #007acc;--vscode-inputValidation-warningBackground: #f6f5d2;--vscode-inputValidation-warningBorder: #b89500;--vscode-inputValidation-errorBackground: #f2dede;--vscode-inputValidation-errorBorder: #be1100;--vscode-dropdown-background: #ffffff;--vscode-dropdown-border: #cecece;--vscode-checkbox-background: #ffffff;--vscode-checkbox-border: #cecece;--vscode-button-foreground: #ffffff;--vscode-button-separator: rgba(255, 255, 255, .4);--vscode-button-background: #007acc;--vscode-button-hoverBackground: #0062a3;--vscode-button-secondaryForeground: #ffffff;--vscode-button-secondaryBackground: #5f6a79;--vscode-button-secondaryHoverBackground: #4c5561;--vscode-badge-background: #c4c4c4;--vscode-badge-foreground: #333333;--vscode-scrollbar-shadow: #dddddd;--vscode-scrollbarSlider-background: rgba(100, 100, 100, .4);--vscode-scrollbarSlider-hoverBackground: rgba(100, 100, 100, .7);--vscode-scrollbarSlider-activeBackground: rgba(0, 0, 0, .6);--vscode-progressBar-background: #0e70c0;--vscode-editorError-foreground: #e51400;--vscode-editorWarning-foreground: #bf8803;--vscode-editorInfo-foreground: #1a85ff;--vscode-editorHint-foreground: #6c6c6c;--vscode-sash-hoverBorder: #0090f1;--vscode-editor-background: #ffffff;--vscode-editor-foreground: #000000;--vscode-editorStickyScroll-background: #ffffff;--vscode-editorStickyScrollHover-background: #f0f0f0;--vscode-editorWidget-background: #f3f3f3;--vscode-editorWidget-foreground: #616161;--vscode-editorWidget-border: #c8c8c8;--vscode-quickInput-background: #f3f3f3;--vscode-quickInput-foreground: #616161;--vscode-quickInputTitle-background: rgba(0, 0, 0, .06);--vscode-pickerGroup-foreground: #0066bf;--vscode-pickerGroup-border: #cccedb;--vscode-keybindingLabel-background: rgba(221, 221, 221, .4);--vscode-keybindingLabel-foreground: #555555;--vscode-keybindingLabel-border: rgba(204, 204, 204, .4);--vscode-keybindingLabel-bottomBorder: rgba(187, 187, 187, .4);--vscode-editor-selectionBackground: #add6ff;--vscode-editor-inactiveSelectionBackground: #e5ebf1;--vscode-editor-selectionHighlightBackground: rgba(173, 214, 255, .5);--vscode-editor-findMatchBackground: #a8ac94;--vscode-editor-findMatchHighlightBackground: rgba(234, 92, 0, .33);--vscode-editor-findRangeHighlightBackground: rgba(180, 180, 180, .3);--vscode-searchEditor-findMatchBackground: rgba(234, 92, 0, .22);--vscode-editor-hoverHighlightBackground: rgba(173, 214, 255, .15);--vscode-editorHoverWidget-background: #f3f3f3;--vscode-editorHoverWidget-foreground: #616161;--vscode-editorHoverWidget-border: #c8c8c8;--vscode-editorHoverWidget-statusBarBackground: #e7e7e7;--vscode-editorLink-activeForeground: #0000ff;--vscode-editorInlayHint-foreground: rgba(51, 51, 51, .8);--vscode-editorInlayHint-background: rgba(196, 196, 196, .3);--vscode-editorInlayHint-typeForeground: rgba(51, 51, 51, .8);--vscode-editorInlayHint-typeBackground: rgba(196, 196, 196, .3);--vscode-editorInlayHint-parameterForeground: rgba(51, 51, 51, .8);--vscode-editorInlayHint-parameterBackground: rgba(196, 196, 196, .3);--vscode-editorLightBulb-foreground: #ddb100;--vscode-editorLightBulbAutoFix-foreground: #007acc;--vscode-diffEditor-insertedTextBackground: rgba(156, 204, 44, .4);--vscode-diffEditor-removedTextBackground: rgba(255, 0, 0, .3);--vscode-diffEditor-insertedLineBackground: rgba(155, 185, 85, .2);--vscode-diffEditor-removedLineBackground: rgba(255, 0, 0, .2);--vscode-diffEditor-diagonalFill: rgba(34, 34, 34, .2);--vscode-list-focusOutline: #0090f1;--vscode-list-focusAndSelectionOutline: #90c2f9;--vscode-list-activeSelectionBackground: #0060c0;--vscode-list-activeSelectionForeground: #ffffff;--vscode-list-activeSelectionIconForeground: #ffffff;--vscode-list-inactiveSelectionBackground: #e4e6f1;--vscode-list-hoverBackground: #e8e8e8;--vscode-list-dropBackground: #d6ebff;--vscode-list-highlightForeground: #0066bf;--vscode-list-focusHighlightForeground: #bbe7ff;--vscode-list-invalidItemForeground: #b89500;--vscode-list-errorForeground: #b01011;--vscode-list-warningForeground: #855f00;--vscode-listFilterWidget-background: #f3f3f3;--vscode-listFilterWidget-outline: rgba(0, 0, 0, 0);--vscode-listFilterWidget-noMatchesOutline: #be1100;--vscode-listFilterWidget-shadow: rgba(0, 0, 0, .16);--vscode-list-filterMatchBackground: rgba(234, 92, 0, .33);--vscode-tree-indentGuidesStroke: #a9a9a9;--vscode-tree-tableColumnsBorder: rgba(97, 97, 97, .13);--vscode-tree-tableOddRowsBackground: rgba(97, 97, 97, .04);--vscode-list-deemphasizedForeground: #8e8e90;--vscode-quickInputList-focusForeground: #ffffff;--vscode-quickInputList-focusIconForeground: #ffffff;--vscode-quickInputList-focusBackground: #0060c0;--vscode-menu-foreground: #616161;--vscode-menu-background: #ffffff;--vscode-menu-selectionForeground: #ffffff;--vscode-menu-selectionBackground: #0060c0;--vscode-menu-separatorBackground: #d4d4d4;--vscode-toolbar-hoverBackground: rgba(184, 184, 184, .31);--vscode-toolbar-activeBackground: rgba(166, 166, 166, .31);--vscode-editor-snippetTabstopHighlightBackground: rgba(10, 50, 100, .2);--vscode-editor-snippetFinalTabstopHighlightBorder: rgba(10, 50, 100, .5);--vscode-breadcrumb-foreground: rgba(97, 97, 97, .8);--vscode-breadcrumb-background: #ffffff;--vscode-breadcrumb-focusForeground: #4e4e4e;--vscode-breadcrumb-activeSelectionForeground: #4e4e4e;--vscode-breadcrumbPicker-background: #f3f3f3;--vscode-merge-currentHeaderBackground: rgba(64, 200, 174, .5);--vscode-merge-currentContentBackground: rgba(64, 200, 174, .2);--vscode-merge-incomingHeaderBackground: rgba(64, 166, 255, .5);--vscode-merge-incomingContentBackground: rgba(64, 166, 255, .2);--vscode-merge-commonHeaderBackground: rgba(96, 96, 96, .4);--vscode-merge-commonContentBackground: rgba(96, 96, 96, .16);--vscode-editorOverviewRuler-currentContentForeground: rgba(64, 200, 174, .5);--vscode-editorOverviewRuler-incomingContentForeground: rgba(64, 166, 255, .5);--vscode-editorOverviewRuler-commonContentForeground: rgba(96, 96, 96, .4);--vscode-editorOverviewRuler-findMatchForeground: rgba(209, 134, 22, .49);--vscode-editorOverviewRuler-selectionHighlightForeground: rgba(160, 160, 160, .8);--vscode-minimap-findMatchHighlight: #d18616;--vscode-minimap-selectionOccurrenceHighlight: #c9c9c9;--vscode-minimap-selectionHighlight: #add6ff;--vscode-minimap-errorHighlight: rgba(255, 18, 18, .7);--vscode-minimap-warningHighlight: #bf8803;--vscode-minimap-foregroundOpacity: #000000;--vscode-minimapSlider-background: rgba(100, 100, 100, .2);--vscode-minimapSlider-hoverBackground: rgba(100, 100, 100, .35);--vscode-minimapSlider-activeBackground: rgba(0, 0, 0, .3);--vscode-problemsErrorIcon-foreground: #e51400;--vscode-problemsWarningIcon-foreground: #bf8803;--vscode-problemsInfoIcon-foreground: #1a85ff;--vscode-charts-foreground: #616161;--vscode-charts-lines: rgba(97, 97, 97, .5);--vscode-charts-red: #e51400;--vscode-charts-blue: #1a85ff;--vscode-charts-yellow: #bf8803;--vscode-charts-orange: #d18616;--vscode-charts-green: #388a34;--vscode-charts-purple: #652d90;--vscode-editor-lineHighlightBorder: #eeeeee;--vscode-editor-rangeHighlightBackground: rgba(253, 255, 0, .2);--vscode-editor-symbolHighlightBackground: rgba(234, 92, 0, .33);--vscode-editorCursor-foreground: #000000;--vscode-editorWhitespace-foreground: rgba(51, 51, 51, .2);--vscode-editorIndentGuide-background: #d3d3d3;--vscode-editorIndentGuide-activeBackground: #939393;--vscode-editorLineNumber-foreground: #237893;--vscode-editorActiveLineNumber-foreground: #0b216f;--vscode-editorLineNumber-activeForeground: #0b216f;--vscode-editorRuler-foreground: #d3d3d3;--vscode-editorCodeLens-foreground: #919191;--vscode-editorBracketMatch-background: rgba(0, 100, 0, .1);--vscode-editorBracketMatch-border: #b9b9b9;--vscode-editorOverviewRuler-border: rgba(127, 127, 127, .3);--vscode-editorGutter-background: #ffffff;--vscode-editorUnnecessaryCode-opacity: rgba(0, 0, 0, .47);--vscode-editorGhostText-foreground: rgba(0, 0, 0, .47);--vscode-editorOverviewRuler-rangeHighlightForeground: rgba(0, 122, 204, .6);--vscode-editorOverviewRuler-errorForeground: rgba(255, 18, 18, .7);--vscode-editorOverviewRuler-warningForeground: #bf8803;--vscode-editorOverviewRuler-infoForeground: #1a85ff;--vscode-editorBracketHighlight-foreground1: #0431fa;--vscode-editorBracketHighlight-foreground2: #319331;--vscode-editorBracketHighlight-foreground3: #7b3814;--vscode-editorBracketHighlight-foreground4: rgba(0, 0, 0, 0);--vscode-editorBracketHighlight-foreground5: rgba(0, 0, 0, 0);--vscode-editorBracketHighlight-foreground6: rgba(0, 0, 0, 0);--vscode-editorBracketHighlight-unexpectedBracket\.foreground: rgba(255, 18, 18, .8);--vscode-editorBracketPairGuide-background1: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-background2: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-background3: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-background4: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-background5: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-background6: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-activeBackground1: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-activeBackground2: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-activeBackground3: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-activeBackground4: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-activeBackground5: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-activeBackground6: rgba(0, 0, 0, 0);--vscode-editorUnicodeHighlight-border: #cea33d;--vscode-editorUnicodeHighlight-background: rgba(206, 163, 61, .08);--vscode-symbolIcon-arrayForeground: #616161;--vscode-symbolIcon-booleanForeground: #616161;--vscode-symbolIcon-classForeground: #d67e00;--vscode-symbolIcon-colorForeground: #616161;--vscode-symbolIcon-constantForeground: #616161;--vscode-symbolIcon-constructorForeground: #652d90;--vscode-symbolIcon-enumeratorForeground: #d67e00;--vscode-symbolIcon-enumeratorMemberForeground: #007acc;--vscode-symbolIcon-eventForeground: #d67e00;--vscode-symbolIcon-fieldForeground: #007acc;--vscode-symbolIcon-fileForeground: #616161;--vscode-symbolIcon-folderForeground: #616161;--vscode-symbolIcon-functionForeground: #652d90;--vscode-symbolIcon-interfaceForeground: #007acc;--vscode-symbolIcon-keyForeground: #616161;--vscode-symbolIcon-keywordForeground: #616161;--vscode-symbolIcon-methodForeground: #652d90;--vscode-symbolIcon-moduleForeground: #616161;--vscode-symbolIcon-namespaceForeground: #616161;--vscode-symbolIcon-nullForeground: #616161;--vscode-symbolIcon-numberForeground: #616161;--vscode-symbolIcon-objectForeground: #616161;--vscode-symbolIcon-operatorForeground: #616161;--vscode-symbolIcon-packageForeground: #616161;--vscode-symbolIcon-propertyForeground: #616161;--vscode-symbolIcon-referenceForeground: #616161;--vscode-symbolIcon-snippetForeground: #616161;--vscode-symbolIcon-stringForeground: #616161;--vscode-symbolIcon-structForeground: #616161;--vscode-symbolIcon-textForeground: #616161;--vscode-symbolIcon-typeParameterForeground: #616161;--vscode-symbolIcon-unitForeground: #616161;--vscode-symbolIcon-variableForeground: #007acc;--vscode-editorHoverWidget-highlightForeground: #0066bf;--vscode-editorOverviewRuler-bracketMatchForeground: #a0a0a0;--vscode-editor-foldBackground: rgba(173, 214, 255, .3);--vscode-editorGutter-foldingControlForeground: #424242;--vscode-editor-linkedEditingBackground: rgba(255, 0, 0, .3);--vscode-editor-wordHighlightBackground: rgba(87, 87, 87, .25);--vscode-editor-wordHighlightStrongBackground: rgba(14, 99, 156, .25);--vscode-editorOverviewRuler-wordHighlightForeground: rgba(160, 160, 160, .8);--vscode-editorOverviewRuler-wordHighlightStrongForeground: rgba(192, 160, 192, .8);--vscode-peekViewTitle-background: rgba(26, 133, 255, .1);--vscode-peekViewTitleLabel-foreground: #000000;--vscode-peekViewTitleDescription-foreground: #616161;--vscode-peekView-border: #1a85ff;--vscode-peekViewResult-background: #f3f3f3;--vscode-peekViewResult-lineForeground: #646465;--vscode-peekViewResult-fileForeground: #1e1e1e;--vscode-peekViewResult-selectionBackground: rgba(51, 153, 255, .2);--vscode-peekViewResult-selectionForeground: #6c6c6c;--vscode-peekViewEditor-background: #f2f8fc;--vscode-peekViewEditorGutter-background: #f2f8fc;--vscode-peekViewResult-matchHighlightBackground: rgba(234, 92, 0, .3);--vscode-peekViewEditor-matchHighlightBackground: rgba(245, 216, 2, .87);--vscode-editorMarkerNavigationError-background: #e51400;--vscode-editorMarkerNavigationError-headerBackground: rgba(229, 20, 0, .1);--vscode-editorMarkerNavigationWarning-background: #bf8803;--vscode-editorMarkerNavigationWarning-headerBackground: rgba(191, 136, 3, .1);--vscode-editorMarkerNavigationInfo-background: #1a85ff;--vscode-editorMarkerNavigationInfo-headerBackground: rgba(26, 133, 255, .1);--vscode-editorMarkerNavigation-background: #ffffff;--vscode-editorSuggestWidget-background: #f3f3f3;--vscode-editorSuggestWidget-border: #c8c8c8;--vscode-editorSuggestWidget-foreground: #000000;--vscode-editorSuggestWidget-selectedForeground: #ffffff;--vscode-editorSuggestWidget-selectedIconForeground: #ffffff;--vscode-editorSuggestWidget-selectedBackground: #0060c0;--vscode-editorSuggestWidget-highlightForeground: #0066bf;--vscode-editorSuggestWidget-focusHighlightForeground: #bbe7ff;--vscode-editorSuggestWidgetStatus-foreground: rgba(0, 0, 0, .5);--vscode-tab-activeBackground: #ffffff;--vscode-tab-unfocusedActiveBackground: #ffffff;--vscode-tab-inactiveBackground: #ececec;--vscode-tab-unfocusedInactiveBackground: #ececec;--vscode-tab-activeForeground: #333333;--vscode-tab-inactiveForeground: rgba(51, 51, 51, .7);--vscode-tab-unfocusedActiveForeground: rgba(51, 51, 51, .7);--vscode-tab-unfocusedInactiveForeground: rgba(51, 51, 51, .35);--vscode-tab-border: #f3f3f3;--vscode-tab-lastPinnedBorder: rgba(97, 97, 97, .19);--vscode-tab-activeModifiedBorder: #33aaee;--vscode-tab-inactiveModifiedBorder: rgba(51, 170, 238, .5);--vscode-tab-unfocusedActiveModifiedBorder: rgba(51, 170, 238, .7);--vscode-tab-unfocusedInactiveModifiedBorder: rgba(51, 170, 238, .25);--vscode-editorPane-background: #ffffff;--vscode-editorGroupHeader-tabsBackground: #f3f3f3;--vscode-editorGroupHeader-noTabsBackground: #ffffff;--vscode-editorGroup-border: #e7e7e7;--vscode-editorGroup-dropBackground: rgba(38, 119, 203, .18);--vscode-editorGroup-dropIntoPromptForeground: #616161;--vscode-editorGroup-dropIntoPromptBackground: #f3f3f3;--vscode-sideBySideEditor-horizontalBorder: #e7e7e7;--vscode-sideBySideEditor-verticalBorder: #e7e7e7;--vscode-panel-background: #ffffff;--vscode-panel-border: rgba(128, 128, 128, .35);--vscode-panelTitle-activeForeground: #424242;--vscode-panelTitle-inactiveForeground: rgba(66, 66, 66, .75);--vscode-panelTitle-activeBorder: #424242;--vscode-panelInput-border: #dddddd;--vscode-panel-dropBorder: #424242;--vscode-panelSection-dropBackground: rgba(38, 119, 203, .18);--vscode-panelSectionHeader-background: rgba(128, 128, 128, .2);--vscode-panelSection-border: rgba(128, 128, 128, .35);--vscode-banner-background: #004386;--vscode-banner-foreground: #ffffff;--vscode-banner-iconForeground: #1a85ff;--vscode-statusBar-foreground: #ffffff;--vscode-statusBar-noFolderForeground: #ffffff;--vscode-statusBar-background: #007acc;--vscode-statusBar-noFolderBackground: #68217a;--vscode-statusBar-focusBorder: #ffffff;--vscode-statusBarItem-activeBackground: rgba(255, 255, 255, .18);--vscode-statusBarItem-focusBorder: #ffffff;--vscode-statusBarItem-hoverBackground: rgba(255, 255, 255, .12);--vscode-statusBarItem-compactHoverBackground: rgba(255, 255, 255, .2);--vscode-statusBarItem-prominentForeground: #ffffff;--vscode-statusBarItem-prominentBackground: rgba(0, 0, 0, .5);--vscode-statusBarItem-prominentHoverBackground: rgba(0, 0, 0, .3);--vscode-statusBarItem-errorBackground: #c72e0f;--vscode-statusBarItem-errorForeground: #ffffff;--vscode-statusBarItem-warningBackground: #725102;--vscode-statusBarItem-warningForeground: #ffffff;--vscode-activityBar-background: #2c2c2c;--vscode-activityBar-foreground: #ffffff;--vscode-activityBar-inactiveForeground: rgba(255, 255, 255, .4);--vscode-activityBar-activeBorder: #ffffff;--vscode-activityBar-dropBorder: #ffffff;--vscode-activityBarBadge-background: #007acc;--vscode-activityBarBadge-foreground: #ffffff;--vscode-statusBarItem-remoteBackground: #16825d;--vscode-statusBarItem-remoteForeground: #ffffff;--vscode-extensionBadge-remoteBackground: #007acc;--vscode-extensionBadge-remoteForeground: #ffffff;--vscode-sideBar-background: #f3f3f3;--vscode-sideBarTitle-foreground: #6f6f6f;--vscode-sideBar-dropBackground: rgba(38, 119, 203, .18);--vscode-sideBarSectionHeader-background: rgba(0, 0, 0, 0);--vscode-sideBarSectionHeader-border: rgba(97, 97, 97, .19);--vscode-titleBar-activeForeground: #333333;--vscode-titleBar-inactiveForeground: rgba(51, 51, 51, .6);--vscode-titleBar-activeBackground: #dddddd;--vscode-titleBar-inactiveBackground: rgba(221, 221, 221, .6);--vscode-menubar-selectionForeground: #333333;--vscode-menubar-selectionBackground: rgba(184, 184, 184, .31);--vscode-notifications-foreground: #616161;--vscode-notifications-background: #f3f3f3;--vscode-notificationLink-foreground: #006ab1;--vscode-notificationCenterHeader-background: #e7e7e7;--vscode-notifications-border: #e7e7e7;--vscode-notificationsErrorIcon-foreground: #e51400;--vscode-notificationsWarningIcon-foreground: #bf8803;--vscode-notificationsInfoIcon-foreground: #1a85ff;--vscode-commandCenter-foreground: #333333;--vscode-commandCenter-activeForeground: #333333;--vscode-commandCenter-activeBackground: rgba(184, 184, 184, .31);--vscode-commandCenter-border: rgba(128, 128, 128, .35);--vscode-editorCommentsWidget-resolvedBorder: rgba(97, 97, 97, .5);--vscode-editorCommentsWidget-unresolvedBorder: #1a85ff;--vscode-editorCommentsWidget-rangeBackground: rgba(26, 133, 255, .1);--vscode-editorCommentsWidget-rangeBorder: rgba(26, 133, 255, .4);--vscode-editorCommentsWidget-rangeActiveBackground: rgba(26, 133, 255, .1);--vscode-editorCommentsWidget-rangeActiveBorder: rgba(26, 133, 255, .4);--vscode-editorGutter-commentRangeForeground: #d5d8e9;--vscode-debugToolBar-background: #f3f3f3;--vscode-debugIcon-startForeground: #388a34;--vscode-editor-stackFrameHighlightBackground: rgba(255, 255, 102, .45);--vscode-editor-focusedStackFrameHighlightBackground: rgba(206, 231, 206, .45);--vscode-mergeEditor-change\.background: rgba(155, 185, 85, .2);--vscode-mergeEditor-change\.word\.background: rgba(156, 204, 44, .4);--vscode-mergeEditor-conflict\.unhandledUnfocused\.border: rgba(255, 166, 0, .48);--vscode-mergeEditor-conflict\.unhandledFocused\.border: #ffa600;--vscode-mergeEditor-conflict\.handledUnfocused\.border: rgba(134, 134, 134, .29);--vscode-mergeEditor-conflict\.handledFocused\.border: rgba(193, 193, 193, .8);--vscode-mergeEditor-conflict\.handled\.minimapOverViewRuler: rgba(173, 172, 168, .93);--vscode-mergeEditor-conflict\.unhandled\.minimapOverViewRuler: #fcba03;--vscode-mergeEditor-conflictingLines\.background: rgba(255, 234, 0, .28);--vscode-settings-headerForeground: #444444;--vscode-settings-modifiedItemIndicator: #66afe0;--vscode-settings-headerBorder: rgba(128, 128, 128, .35);--vscode-settings-sashBorder: rgba(128, 128, 128, .35);--vscode-settings-dropdownBackground: #ffffff;--vscode-settings-dropdownBorder: #cecece;--vscode-settings-dropdownListBorder: #c8c8c8;--vscode-settings-checkboxBackground: #ffffff;--vscode-settings-checkboxBorder: #cecece;--vscode-settings-textInputBackground: #ffffff;--vscode-settings-textInputForeground: #616161;--vscode-settings-textInputBorder: #cecece;--vscode-settings-numberInputBackground: #ffffff;--vscode-settings-numberInputForeground: #616161;--vscode-settings-numberInputBorder: #cecece;--vscode-settings-focusedRowBackground: rgba(232, 232, 232, .6);--vscode-settings-rowHoverBackground: rgba(232, 232, 232, .3);--vscode-settings-focusedRowBorder: rgba(0, 0, 0, .12);--vscode-terminal-foreground: #333333;--vscode-terminal-selectionBackground: #add6ff;--vscode-terminal-inactiveSelectionBackground: #e5ebf1;--vscode-terminalCommandDecoration-defaultBackground: rgba(0, 0, 0, .25);--vscode-terminalCommandDecoration-successBackground: #2090d3;--vscode-terminalCommandDecoration-errorBackground: #e51400;--vscode-terminalOverviewRuler-cursorForeground: rgba(160, 160, 160, .8);--vscode-terminal-border: rgba(128, 128, 128, .35);--vscode-terminal-findMatchBackground: #a8ac94;--vscode-terminal-findMatchHighlightBackground: rgba(234, 92, 0, .33);--vscode-terminalOverviewRuler-findMatchForeground: rgba(209, 134, 22, .49);--vscode-terminal-dropBackground: rgba(38, 119, 203, .18);--vscode-testing-iconFailed: #f14c4c;--vscode-testing-iconErrored: #f14c4c;--vscode-testing-iconPassed: #73c991;--vscode-testing-runAction: #73c991;--vscode-testing-iconQueued: #cca700;--vscode-testing-iconUnset: #848484;--vscode-testing-iconSkipped: #848484;--vscode-testing-peekBorder: #e51400;--vscode-testing-peekHeaderBackground: rgba(229, 20, 0, .1);--vscode-testing-message\.error\.decorationForeground: #e51400;--vscode-testing-message\.error\.lineBackground: rgba(255, 0, 0, .2);--vscode-testing-message\.info\.decorationForeground: rgba(0, 0, 0, .5);--vscode-welcomePage-tileBackground: #f3f3f3;--vscode-welcomePage-tileHoverBackground: #dbdbdb;--vscode-welcomePage-tileShadow: rgba(0, 0, 0, .16);--vscode-welcomePage-progress\.background: #ffffff;--vscode-welcomePage-progress\.foreground: #006ab1;--vscode-debugExceptionWidget-border: #a31515;--vscode-debugExceptionWidget-background: #f1dfde;--vscode-ports-iconRunningProcessForeground: #369432;--vscode-statusBar-debuggingBackground: #cc6633;--vscode-statusBar-debuggingForeground: #ffffff;--vscode-editor-inlineValuesForeground: rgba(0, 0, 0, .5);--vscode-editor-inlineValuesBackground: rgba(255, 200, 0, .2);--vscode-editorGutter-modifiedBackground: #2090d3;--vscode-editorGutter-addedBackground: #48985d;--vscode-editorGutter-deletedBackground: #e51400;--vscode-minimapGutter-modifiedBackground: #2090d3;--vscode-minimapGutter-addedBackground: #48985d;--vscode-minimapGutter-deletedBackground: #e51400;--vscode-editorOverviewRuler-modifiedForeground: rgba(32, 144, 211, .6);--vscode-editorOverviewRuler-addedForeground: rgba(72, 152, 93, .6);--vscode-editorOverviewRuler-deletedForeground: rgba(229, 20, 0, .6);--vscode-debugIcon-breakpointForeground: #e51400;--vscode-debugIcon-breakpointDisabledForeground: #848484;--vscode-debugIcon-breakpointUnverifiedForeground: #848484;--vscode-debugIcon-breakpointCurrentStackframeForeground: #be8700;--vscode-debugIcon-breakpointStackframeForeground: #89d185;--vscode-notebook-cellBorderColor: #e8e8e8;--vscode-notebook-focusedEditorBorder: #0090f1;--vscode-notebookStatusSuccessIcon-foreground: #388a34;--vscode-notebookStatusErrorIcon-foreground: #a1260d;--vscode-notebookStatusRunningIcon-foreground: #616161;--vscode-notebook-cellToolbarSeparator: rgba(128, 128, 128, .35);--vscode-notebook-selectedCellBackground: rgba(200, 221, 241, .31);--vscode-notebook-selectedCellBorder: #e8e8e8;--vscode-notebook-focusedCellBorder: #0090f1;--vscode-notebook-inactiveFocusedCellBorder: #e8e8e8;--vscode-notebook-cellStatusBarItemHoverBackground: rgba(0, 0, 0, .08);--vscode-notebook-cellInsertionIndicator: #0090f1;--vscode-notebookScrollbarSlider-background: rgba(100, 100, 100, .4);--vscode-notebookScrollbarSlider-hoverBackground: rgba(100, 100, 100, .7);--vscode-notebookScrollbarSlider-activeBackground: rgba(0, 0, 0, .6);--vscode-notebook-symbolHighlightBackground: rgba(253, 255, 0, .2);--vscode-notebook-cellEditorBackground: #f3f3f3;--vscode-notebook-editorBackground: #ffffff;--vscode-keybindingTable-headerBackground: rgba(97, 97, 97, .04);--vscode-keybindingTable-rowsBackground: rgba(97, 97, 97, .04);--vscode-scm-providerBorder: #c8c8c8;--vscode-searchEditor-textInputBorder: #cecece;--vscode-debugTokenExpression-name: #9b46b0;--vscode-debugTokenExpression-value: rgba(108, 108, 108, .8);--vscode-debugTokenExpression-string: #a31515;--vscode-debugTokenExpression-boolean: #0000ff;--vscode-debugTokenExpression-number: #098658;--vscode-debugTokenExpression-error: #e51400;--vscode-debugView-exceptionLabelForeground: #ffffff;--vscode-debugView-exceptionLabelBackground: #a31515;--vscode-debugView-stateLabelForeground: #616161;--vscode-debugView-stateLabelBackground: rgba(136, 136, 136, .27);--vscode-debugView-valueChangedHighlight: #569cd6;--vscode-debugConsole-infoForeground: #1a85ff;--vscode-debugConsole-warningForeground: #bf8803;--vscode-debugConsole-errorForeground: #a1260d;--vscode-debugConsole-sourceForeground: #616161;--vscode-debugConsoleInputIcon-foreground: #616161;--vscode-debugIcon-pauseForeground: #007acc;--vscode-debugIcon-stopForeground: #a1260d;--vscode-debugIcon-disconnectForeground: #a1260d;--vscode-debugIcon-restartForeground: #388a34;--vscode-debugIcon-stepOverForeground: #007acc;--vscode-debugIcon-stepIntoForeground: #007acc;--vscode-debugIcon-stepOutForeground: #007acc;--vscode-debugIcon-continueForeground: #007acc;--vscode-debugIcon-stepBackForeground: #007acc;--vscode-extensionButton-prominentBackground: #007acc;--vscode-extensionButton-prominentForeground: #ffffff;--vscode-extensionButton-prominentHoverBackground: #0062a3;--vscode-extensionIcon-starForeground: #df6100;--vscode-extensionIcon-verifiedForeground: #006ab1;--vscode-extensionIcon-preReleaseForeground: #1d9271;--vscode-extensionIcon-sponsorForeground: #b51e78;--vscode-terminal-ansiBlack: #000000;--vscode-terminal-ansiRed: #cd3131;--vscode-terminal-ansiGreen: #00bc00;--vscode-terminal-ansiYellow: #949800;--vscode-terminal-ansiBlue: #0451a5;--vscode-terminal-ansiMagenta: #bc05bc;--vscode-terminal-ansiCyan: #0598bc;--vscode-terminal-ansiWhite: #555555;--vscode-terminal-ansiBrightBlack: #666666;--vscode-terminal-ansiBrightRed: #cd3131;--vscode-terminal-ansiBrightGreen: #14ce14;--vscode-terminal-ansiBrightYellow: #b5ba00;--vscode-terminal-ansiBrightBlue: #0451a5;--vscode-terminal-ansiBrightMagenta: #bc05bc;--vscode-terminal-ansiBrightCyan: #0598bc;--vscode-terminal-ansiBrightWhite: #a5a5a5;--vscode-interactive-activeCodeBorder: #1a85ff;--vscode-interactive-inactiveCodeBorder: #e4e6f1;--vscode-gitDecoration-addedResourceForeground: #587c0c;--vscode-gitDecoration-modifiedResourceForeground: #895503;--vscode-gitDecoration-deletedResourceForeground: #ad0707;--vscode-gitDecoration-renamedResourceForeground: #007100;--vscode-gitDecoration-untrackedResourceForeground: #007100;--vscode-gitDecoration-ignoredResourceForeground: #8e8e90;--vscode-gitDecoration-stageModifiedResourceForeground: #895503;--vscode-gitDecoration-stageDeletedResourceForeground: #ad0707;--vscode-gitDecoration-conflictingResourceForeground: #ad0707;--vscode-gitDecoration-submoduleResourceForeground: #1258a7}:root.light-mode{color-scheme:light}:root.dark-mode{color-scheme:dark;--vscode-font-family: system-ui, "Ubuntu", "Droid Sans", sans-serif;--vscode-font-weight: normal;--vscode-font-size: 13px;--vscode-editor-font-family: "Droid Sans Mono", "monospace", monospace;--vscode-editor-font-weight: normal;--vscode-editor-font-size: 14px;--vscode-foreground: #cccccc;--vscode-disabledForeground: rgba(204, 204, 204, .5);--vscode-errorForeground: #f48771;--vscode-descriptionForeground: rgba(204, 204, 204, .7);--vscode-icon-foreground: #c5c5c5;--vscode-focusBorder: #007fd4;--vscode-textSeparator-foreground: rgba(255, 255, 255, .18);--vscode-textLink-foreground: #3794ff;--vscode-textLink-activeForeground: #3794ff;--vscode-textPreformat-foreground: #d7ba7d;--vscode-textBlockQuote-background: rgba(127, 127, 127, .1);--vscode-textBlockQuote-border: rgba(0, 122, 204, .5);--vscode-textCodeBlock-background: rgba(10, 10, 10, .4);--vscode-widget-shadow: rgba(0, 0, 0, .36);--vscode-input-background: #3c3c3c;--vscode-input-foreground: #cccccc;--vscode-inputOption-activeBorder: #007acc;--vscode-inputOption-hoverBackground: rgba(90, 93, 94, .5);--vscode-inputOption-activeBackground: rgba(0, 127, 212, .4);--vscode-inputOption-activeForeground: #ffffff;--vscode-input-placeholderForeground: #a6a6a6;--vscode-inputValidation-infoBackground: #063b49;--vscode-inputValidation-infoBorder: #007acc;--vscode-inputValidation-warningBackground: #352a05;--vscode-inputValidation-warningBorder: #b89500;--vscode-inputValidation-errorBackground: #5a1d1d;--vscode-inputValidation-errorBorder: #be1100;--vscode-dropdown-background: #3c3c3c;--vscode-dropdown-foreground: #f0f0f0;--vscode-dropdown-border: #3c3c3c;--vscode-checkbox-background: #3c3c3c;--vscode-checkbox-foreground: #f0f0f0;--vscode-checkbox-border: #3c3c3c;--vscode-button-foreground: #ffffff;--vscode-button-separator: rgba(255, 255, 255, .4);--vscode-button-background: #0e639c;--vscode-button-hoverBackground: #1177bb;--vscode-button-secondaryForeground: #ffffff;--vscode-button-secondaryBackground: #3a3d41;--vscode-button-secondaryHoverBackground: #45494e;--vscode-badge-background: #4d4d4d;--vscode-badge-foreground: #ffffff;--vscode-scrollbar-shadow: #000000;--vscode-scrollbarSlider-background: rgba(121, 121, 121, .4);--vscode-scrollbarSlider-hoverBackground: rgba(100, 100, 100, .7);--vscode-scrollbarSlider-activeBackground: rgba(191, 191, 191, .4);--vscode-progressBar-background: #0e70c0;--vscode-editorError-foreground: #f14c4c;--vscode-editorWarning-foreground: #cca700;--vscode-editorInfo-foreground: #3794ff;--vscode-editorHint-foreground: rgba(238, 238, 238, .7);--vscode-sash-hoverBorder: #007fd4;--vscode-editor-background: #1e1e1e;--vscode-editor-foreground: #d4d4d4;--vscode-editorStickyScroll-background: #1e1e1e;--vscode-editorStickyScrollHover-background: #2a2d2e;--vscode-editorWidget-background: #252526;--vscode-editorWidget-foreground: #cccccc;--vscode-editorWidget-border: #454545;--vscode-quickInput-background: #252526;--vscode-quickInput-foreground: #cccccc;--vscode-quickInputTitle-background: rgba(255, 255, 255, .1);--vscode-pickerGroup-foreground: #3794ff;--vscode-pickerGroup-border: #3f3f46;--vscode-keybindingLabel-background: rgba(128, 128, 128, .17);--vscode-keybindingLabel-foreground: #cccccc;--vscode-keybindingLabel-border: rgba(51, 51, 51, .6);--vscode-keybindingLabel-bottomBorder: rgba(68, 68, 68, .6);--vscode-editor-selectionBackground: #264f78;--vscode-editor-inactiveSelectionBackground: #3a3d41;--vscode-editor-selectionHighlightBackground: rgba(173, 214, 255, .15);--vscode-editor-findMatchBackground: #515c6a;--vscode-editor-findMatchHighlightBackground: rgba(234, 92, 0, .33);--vscode-editor-findRangeHighlightBackground: rgba(58, 61, 65, .4);--vscode-searchEditor-findMatchBackground: rgba(234, 92, 0, .22);--vscode-editor-hoverHighlightBackground: rgba(38, 79, 120, .25);--vscode-editorHoverWidget-background: #252526;--vscode-editorHoverWidget-foreground: #cccccc;--vscode-editorHoverWidget-border: #454545;--vscode-editorHoverWidget-statusBarBackground: #2c2c2d;--vscode-editorLink-activeForeground: #4e94ce;--vscode-editorInlayHint-foreground: rgba(255, 255, 255, .8);--vscode-editorInlayHint-background: rgba(77, 77, 77, .6);--vscode-editorInlayHint-typeForeground: rgba(255, 255, 255, .8);--vscode-editorInlayHint-typeBackground: rgba(77, 77, 77, .6);--vscode-editorInlayHint-parameterForeground: rgba(255, 255, 255, .8);--vscode-editorInlayHint-parameterBackground: rgba(77, 77, 77, .6);--vscode-editorLightBulb-foreground: #ffcc00;--vscode-editorLightBulbAutoFix-foreground: #75beff;--vscode-diffEditor-insertedTextBackground: rgba(156, 204, 44, .2);--vscode-diffEditor-removedTextBackground: rgba(255, 0, 0, .4);--vscode-diffEditor-insertedLineBackground: rgba(155, 185, 85, .2);--vscode-diffEditor-removedLineBackground: rgba(255, 0, 0, .2);--vscode-diffEditor-diagonalFill: rgba(204, 204, 204, .2);--vscode-list-focusOutline: #007fd4;--vscode-list-activeSelectionBackground: #04395e;--vscode-list-activeSelectionForeground: #ffffff;--vscode-list-activeSelectionIconForeground: #ffffff;--vscode-list-inactiveSelectionBackground: #37373d;--vscode-list-hoverBackground: #2a2d2e;--vscode-list-dropBackground: #383b3d;--vscode-list-highlightForeground: #2aaaff;--vscode-list-focusHighlightForeground: #2aaaff;--vscode-list-invalidItemForeground: #b89500;--vscode-list-errorForeground: #f88070;--vscode-list-warningForeground: #cca700;--vscode-listFilterWidget-background: #252526;--vscode-listFilterWidget-outline: rgba(0, 0, 0, 0);--vscode-listFilterWidget-noMatchesOutline: #be1100;--vscode-listFilterWidget-shadow: rgba(0, 0, 0, .36);--vscode-list-filterMatchBackground: rgba(234, 92, 0, .33);--vscode-tree-indentGuidesStroke: #585858;--vscode-tree-tableColumnsBorder: rgba(204, 204, 204, .13);--vscode-tree-tableOddRowsBackground: rgba(204, 204, 204, .04);--vscode-list-deemphasizedForeground: #8c8c8c;--vscode-quickInputList-focusForeground: #ffffff;--vscode-quickInputList-focusIconForeground: #ffffff;--vscode-quickInputList-focusBackground: #04395e;--vscode-menu-foreground: #cccccc;--vscode-menu-background: #303031;--vscode-menu-selectionForeground: #ffffff;--vscode-menu-selectionBackground: #04395e;--vscode-menu-separatorBackground: #606060;--vscode-toolbar-hoverBackground: rgba(90, 93, 94, .31);--vscode-toolbar-activeBackground: rgba(99, 102, 103, .31);--vscode-editor-snippetTabstopHighlightBackground: rgba(124, 124, 124, .3);--vscode-editor-snippetFinalTabstopHighlightBorder: #525252;--vscode-breadcrumb-foreground: rgba(204, 204, 204, .8);--vscode-breadcrumb-background: #1e1e1e;--vscode-breadcrumb-focusForeground: #e0e0e0;--vscode-breadcrumb-activeSelectionForeground: #e0e0e0;--vscode-breadcrumbPicker-background: #252526;--vscode-merge-currentHeaderBackground: rgba(64, 200, 174, .5);--vscode-merge-currentContentBackground: rgba(64, 200, 174, .2);--vscode-merge-incomingHeaderBackground: rgba(64, 166, 255, .5);--vscode-merge-incomingContentBackground: rgba(64, 166, 255, .2);--vscode-merge-commonHeaderBackground: rgba(96, 96, 96, .4);--vscode-merge-commonContentBackground: rgba(96, 96, 96, .16);--vscode-editorOverviewRuler-currentContentForeground: rgba(64, 200, 174, .5);--vscode-editorOverviewRuler-incomingContentForeground: rgba(64, 166, 255, .5);--vscode-editorOverviewRuler-commonContentForeground: rgba(96, 96, 96, .4);--vscode-editorOverviewRuler-findMatchForeground: rgba(209, 134, 22, .49);--vscode-editorOverviewRuler-selectionHighlightForeground: rgba(160, 160, 160, .8);--vscode-minimap-findMatchHighlight: #d18616;--vscode-minimap-selectionOccurrenceHighlight: #676767;--vscode-minimap-selectionHighlight: #264f78;--vscode-minimap-errorHighlight: rgba(255, 18, 18, .7);--vscode-minimap-warningHighlight: #cca700;--vscode-minimap-foregroundOpacity: #000000;--vscode-minimapSlider-background: rgba(121, 121, 121, .2);--vscode-minimapSlider-hoverBackground: rgba(100, 100, 100, .35);--vscode-minimapSlider-activeBackground: rgba(191, 191, 191, .2);--vscode-problemsErrorIcon-foreground: #f14c4c;--vscode-problemsWarningIcon-foreground: #cca700;--vscode-problemsInfoIcon-foreground: #3794ff;--vscode-charts-foreground: #cccccc;--vscode-charts-lines: rgba(204, 204, 204, .5);--vscode-charts-red: #f14c4c;--vscode-charts-blue: #3794ff;--vscode-charts-yellow: #cca700;--vscode-charts-orange: #d18616;--vscode-charts-green: #89d185;--vscode-charts-purple: #b180d7;--vscode-editor-lineHighlightBorder: #282828;--vscode-editor-rangeHighlightBackground: rgba(255, 255, 255, .04);--vscode-editor-symbolHighlightBackground: rgba(234, 92, 0, .33);--vscode-editorCursor-foreground: #aeafad;--vscode-editorWhitespace-foreground: rgba(227, 228, 226, .16);--vscode-editorIndentGuide-background: #404040;--vscode-editorIndentGuide-activeBackground: #707070;--vscode-editorLineNumber-foreground: #858585;--vscode-editorActiveLineNumber-foreground: #c6c6c6;--vscode-editorLineNumber-activeForeground: #c6c6c6;--vscode-editorRuler-foreground: #5a5a5a;--vscode-editorCodeLens-foreground: #999999;--vscode-editorBracketMatch-background: rgba(0, 100, 0, .1);--vscode-editorBracketMatch-border: #888888;--vscode-editorOverviewRuler-border: rgba(127, 127, 127, .3);--vscode-editorGutter-background: #1e1e1e;--vscode-editorUnnecessaryCode-opacity: rgba(0, 0, 0, .67);--vscode-editorGhostText-foreground: rgba(255, 255, 255, .34);--vscode-editorOverviewRuler-rangeHighlightForeground: rgba(0, 122, 204, .6);--vscode-editorOverviewRuler-errorForeground: rgba(255, 18, 18, .7);--vscode-editorOverviewRuler-warningForeground: #cca700;--vscode-editorOverviewRuler-infoForeground: #3794ff;--vscode-editorBracketHighlight-foreground1: #ffd700;--vscode-editorBracketHighlight-foreground2: #da70d6;--vscode-editorBracketHighlight-foreground3: #179fff;--vscode-editorBracketHighlight-foreground4: rgba(0, 0, 0, 0);--vscode-editorBracketHighlight-foreground5: rgba(0, 0, 0, 0);--vscode-editorBracketHighlight-foreground6: rgba(0, 0, 0, 0);--vscode-editorBracketHighlight-unexpectedBracket\.foreground: rgba(255, 18, 18, .8);--vscode-editorBracketPairGuide-background1: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-background2: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-background3: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-background4: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-background5: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-background6: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-activeBackground1: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-activeBackground2: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-activeBackground3: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-activeBackground4: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-activeBackground5: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-activeBackground6: rgba(0, 0, 0, 0);--vscode-editorUnicodeHighlight-border: #bd9b03;--vscode-editorUnicodeHighlight-background: rgba(189, 155, 3, .15);--vscode-symbolIcon-arrayForeground: #cccccc;--vscode-symbolIcon-booleanForeground: #cccccc;--vscode-symbolIcon-classForeground: #ee9d28;--vscode-symbolIcon-colorForeground: #cccccc;--vscode-symbolIcon-constantForeground: #cccccc;--vscode-symbolIcon-constructorForeground: #b180d7;--vscode-symbolIcon-enumeratorForeground: #ee9d28;--vscode-symbolIcon-enumeratorMemberForeground: #75beff;--vscode-symbolIcon-eventForeground: #ee9d28;--vscode-symbolIcon-fieldForeground: #75beff;--vscode-symbolIcon-fileForeground: #cccccc;--vscode-symbolIcon-folderForeground: #cccccc;--vscode-symbolIcon-functionForeground: #b180d7;--vscode-symbolIcon-interfaceForeground: #75beff;--vscode-symbolIcon-keyForeground: #cccccc;--vscode-symbolIcon-keywordForeground: #cccccc;--vscode-symbolIcon-methodForeground: #b180d7;--vscode-symbolIcon-moduleForeground: #cccccc;--vscode-symbolIcon-namespaceForeground: #cccccc;--vscode-symbolIcon-nullForeground: #cccccc;--vscode-symbolIcon-numberForeground: #cccccc;--vscode-symbolIcon-objectForeground: #cccccc;--vscode-symbolIcon-operatorForeground: #cccccc;--vscode-symbolIcon-packageForeground: #cccccc;--vscode-symbolIcon-propertyForeground: #cccccc;--vscode-symbolIcon-referenceForeground: #cccccc;--vscode-symbolIcon-snippetForeground: #cccccc;--vscode-symbolIcon-stringForeground: #cccccc;--vscode-symbolIcon-structForeground: #cccccc;--vscode-symbolIcon-textForeground: #cccccc;--vscode-symbolIcon-typeParameterForeground: #cccccc;--vscode-symbolIcon-unitForeground: #cccccc;--vscode-symbolIcon-variableForeground: #75beff;--vscode-editorHoverWidget-highlightForeground: #2aaaff;--vscode-editorOverviewRuler-bracketMatchForeground: #a0a0a0;--vscode-editor-foldBackground: rgba(38, 79, 120, .3);--vscode-editorGutter-foldingControlForeground: #c5c5c5;--vscode-editor-linkedEditingBackground: rgba(255, 0, 0, .3);--vscode-editor-wordHighlightBackground: rgba(87, 87, 87, .72);--vscode-editor-wordHighlightStrongBackground: rgba(0, 73, 114, .72);--vscode-editorOverviewRuler-wordHighlightForeground: rgba(160, 160, 160, .8);--vscode-editorOverviewRuler-wordHighlightStrongForeground: rgba(192, 160, 192, .8);--vscode-peekViewTitle-background: rgba(55, 148, 255, .1);--vscode-peekViewTitleLabel-foreground: #ffffff;--vscode-peekViewTitleDescription-foreground: rgba(204, 204, 204, .7);--vscode-peekView-border: #3794ff;--vscode-peekViewResult-background: #252526;--vscode-peekViewResult-lineForeground: #bbbbbb;--vscode-peekViewResult-fileForeground: #ffffff;--vscode-peekViewResult-selectionBackground: rgba(51, 153, 255, .2);--vscode-peekViewResult-selectionForeground: #ffffff;--vscode-peekViewEditor-background: #001f33;--vscode-peekViewEditorGutter-background: #001f33;--vscode-peekViewResult-matchHighlightBackground: rgba(234, 92, 0, .3);--vscode-peekViewEditor-matchHighlightBackground: rgba(255, 143, 0, .6);--vscode-editorMarkerNavigationError-background: #f14c4c;--vscode-editorMarkerNavigationError-headerBackground: rgba(241, 76, 76, .1);--vscode-editorMarkerNavigationWarning-background: #cca700;--vscode-editorMarkerNavigationWarning-headerBackground: rgba(204, 167, 0, .1);--vscode-editorMarkerNavigationInfo-background: #3794ff;--vscode-editorMarkerNavigationInfo-headerBackground: rgba(55, 148, 255, .1);--vscode-editorMarkerNavigation-background: #1e1e1e;--vscode-editorSuggestWidget-background: #252526;--vscode-editorSuggestWidget-border: #454545;--vscode-editorSuggestWidget-foreground: #d4d4d4;--vscode-editorSuggestWidget-selectedForeground: #ffffff;--vscode-editorSuggestWidget-selectedIconForeground: #ffffff;--vscode-editorSuggestWidget-selectedBackground: #04395e;--vscode-editorSuggestWidget-highlightForeground: #2aaaff;--vscode-editorSuggestWidget-focusHighlightForeground: #2aaaff;--vscode-editorSuggestWidgetStatus-foreground: rgba(212, 212, 212, .5);--vscode-tab-activeBackground: #1e1e1e;--vscode-tab-unfocusedActiveBackground: #1e1e1e;--vscode-tab-inactiveBackground: #2d2d2d;--vscode-tab-unfocusedInactiveBackground: #2d2d2d;--vscode-tab-activeForeground: #ffffff;--vscode-tab-inactiveForeground: rgba(255, 255, 255, .5);--vscode-tab-unfocusedActiveForeground: rgba(255, 255, 255, .5);--vscode-tab-unfocusedInactiveForeground: rgba(255, 255, 255, .25);--vscode-tab-border: #252526;--vscode-tab-lastPinnedBorder: rgba(204, 204, 204, .2);--vscode-tab-activeModifiedBorder: #3399cc;--vscode-tab-inactiveModifiedBorder: rgba(51, 153, 204, .5);--vscode-tab-unfocusedActiveModifiedBorder: rgba(51, 153, 204, .5);--vscode-tab-unfocusedInactiveModifiedBorder: rgba(51, 153, 204, .25);--vscode-editorPane-background: #1e1e1e;--vscode-editorGroupHeader-tabsBackground: #252526;--vscode-editorGroupHeader-noTabsBackground: #1e1e1e;--vscode-editorGroup-border: #444444;--vscode-editorGroup-dropBackground: rgba(83, 89, 93, .5);--vscode-editorGroup-dropIntoPromptForeground: #cccccc;--vscode-editorGroup-dropIntoPromptBackground: #252526;--vscode-sideBySideEditor-horizontalBorder: #444444;--vscode-sideBySideEditor-verticalBorder: #444444;--vscode-panel-background: #1e1e1e;--vscode-panel-border: rgba(128, 128, 128, .35);--vscode-panelTitle-activeForeground: #e7e7e7;--vscode-panelTitle-inactiveForeground: rgba(231, 231, 231, .6);--vscode-panelTitle-activeBorder: #e7e7e7;--vscode-panel-dropBorder: #e7e7e7;--vscode-panelSection-dropBackground: rgba(83, 89, 93, .5);--vscode-panelSectionHeader-background: rgba(128, 128, 128, .2);--vscode-panelSection-border: rgba(128, 128, 128, .35);--vscode-banner-background: #04395e;--vscode-banner-foreground: #ffffff;--vscode-banner-iconForeground: #3794ff;--vscode-statusBar-foreground: #ffffff;--vscode-statusBar-noFolderForeground: #ffffff;--vscode-statusBar-background: #007acc;--vscode-statusBar-noFolderBackground: #68217a;--vscode-statusBar-focusBorder: #ffffff;--vscode-statusBarItem-activeBackground: rgba(255, 255, 255, .18);--vscode-statusBarItem-focusBorder: #ffffff;--vscode-statusBarItem-hoverBackground: rgba(255, 255, 255, .12);--vscode-statusBarItem-compactHoverBackground: rgba(255, 255, 255, .2);--vscode-statusBarItem-prominentForeground: #ffffff;--vscode-statusBarItem-prominentBackground: rgba(0, 0, 0, .5);--vscode-statusBarItem-prominentHoverBackground: rgba(0, 0, 0, .3);--vscode-statusBarItem-errorBackground: #c72e0f;--vscode-statusBarItem-errorForeground: #ffffff;--vscode-statusBarItem-warningBackground: #7a6400;--vscode-statusBarItem-warningForeground: #ffffff;--vscode-activityBar-background: #333333;--vscode-activityBar-foreground: #ffffff;--vscode-activityBar-inactiveForeground: rgba(255, 255, 255, .4);--vscode-activityBar-activeBorder: #ffffff;--vscode-activityBar-dropBorder: #ffffff;--vscode-activityBarBadge-background: #007acc;--vscode-activityBarBadge-foreground: #ffffff;--vscode-statusBarItem-remoteBackground: #16825d;--vscode-statusBarItem-remoteForeground: #ffffff;--vscode-extensionBadge-remoteBackground: #007acc;--vscode-extensionBadge-remoteForeground: #ffffff;--vscode-sideBar-background: #252526;--vscode-sideBarTitle-foreground: #bbbbbb;--vscode-sideBar-dropBackground: rgba(83, 89, 93, .5);--vscode-sideBarSectionHeader-background: rgba(0, 0, 0, 0);--vscode-sideBarSectionHeader-border: rgba(204, 204, 204, .2);--vscode-titleBar-activeForeground: #cccccc;--vscode-titleBar-inactiveForeground: rgba(204, 204, 204, .6);--vscode-titleBar-activeBackground: #3c3c3c;--vscode-titleBar-inactiveBackground: rgba(60, 60, 60, .6);--vscode-menubar-selectionForeground: #cccccc;--vscode-menubar-selectionBackground: rgba(90, 93, 94, .31);--vscode-notifications-foreground: #cccccc;--vscode-notifications-background: #252526;--vscode-notificationLink-foreground: #3794ff;--vscode-notificationCenterHeader-background: #303031;--vscode-notifications-border: #303031;--vscode-notificationsErrorIcon-foreground: #f14c4c;--vscode-notificationsWarningIcon-foreground: #cca700;--vscode-notificationsInfoIcon-foreground: #3794ff;--vscode-commandCenter-foreground: #cccccc;--vscode-commandCenter-activeForeground: #cccccc;--vscode-commandCenter-activeBackground: rgba(90, 93, 94, .31);--vscode-commandCenter-border: rgba(128, 128, 128, .35);--vscode-editorCommentsWidget-resolvedBorder: rgba(204, 204, 204, .5);--vscode-editorCommentsWidget-unresolvedBorder: #3794ff;--vscode-editorCommentsWidget-rangeBackground: rgba(55, 148, 255, .1);--vscode-editorCommentsWidget-rangeBorder: rgba(55, 148, 255, .4);--vscode-editorCommentsWidget-rangeActiveBackground: rgba(55, 148, 255, .1);--vscode-editorCommentsWidget-rangeActiveBorder: rgba(55, 148, 255, .4);--vscode-editorGutter-commentRangeForeground: #37373d;--vscode-debugToolBar-background: #333333;--vscode-debugIcon-startForeground: #89d185;--vscode-editor-stackFrameHighlightBackground: rgba(255, 255, 0, .2);--vscode-editor-focusedStackFrameHighlightBackground: rgba(122, 189, 122, .3);--vscode-mergeEditor-change\.background: rgba(155, 185, 85, .2);--vscode-mergeEditor-change\.word\.background: rgba(156, 204, 44, .2);--vscode-mergeEditor-conflict\.unhandledUnfocused\.border: rgba(255, 166, 0, .48);--vscode-mergeEditor-conflict\.unhandledFocused\.border: #ffa600;--vscode-mergeEditor-conflict\.handledUnfocused\.border: rgba(134, 134, 134, .29);--vscode-mergeEditor-conflict\.handledFocused\.border: rgba(193, 193, 193, .8);--vscode-mergeEditor-conflict\.handled\.minimapOverViewRuler: rgba(173, 172, 168, .93);--vscode-mergeEditor-conflict\.unhandled\.minimapOverViewRuler: #fcba03;--vscode-mergeEditor-conflictingLines\.background: rgba(255, 234, 0, .28);--vscode-settings-headerForeground: #e7e7e7;--vscode-settings-modifiedItemIndicator: #0c7d9d;--vscode-settings-headerBorder: rgba(128, 128, 128, .35);--vscode-settings-sashBorder: rgba(128, 128, 128, .35);--vscode-settings-dropdownBackground: #3c3c3c;--vscode-settings-dropdownForeground: #f0f0f0;--vscode-settings-dropdownBorder: #3c3c3c;--vscode-settings-dropdownListBorder: #454545;--vscode-settings-checkboxBackground: #3c3c3c;--vscode-settings-checkboxForeground: #f0f0f0;--vscode-settings-checkboxBorder: #3c3c3c;--vscode-settings-textInputBackground: #3c3c3c;--vscode-settings-textInputForeground: #cccccc;--vscode-settings-numberInputBackground: #3c3c3c;--vscode-settings-numberInputForeground: #cccccc;--vscode-settings-focusedRowBackground: rgba(42, 45, 46, .6);--vscode-settings-rowHoverBackground: rgba(42, 45, 46, .3);--vscode-settings-focusedRowBorder: rgba(255, 255, 255, .12);--vscode-terminal-foreground: #cccccc;--vscode-terminal-selectionBackground: #264f78;--vscode-terminal-inactiveSelectionBackground: #3a3d41;--vscode-terminalCommandDecoration-defaultBackground: rgba(255, 255, 255, .25);--vscode-terminalCommandDecoration-successBackground: #1b81a8;--vscode-terminalCommandDecoration-errorBackground: #f14c4c;--vscode-terminalOverviewRuler-cursorForeground: rgba(160, 160, 160, .8);--vscode-terminal-border: rgba(128, 128, 128, .35);--vscode-terminal-findMatchBackground: #515c6a;--vscode-terminal-findMatchHighlightBackground: rgba(234, 92, 0, .33);--vscode-terminalOverviewRuler-findMatchForeground: rgba(209, 134, 22, .49);--vscode-terminal-dropBackground: rgba(83, 89, 93, .5);--vscode-testing-iconFailed: #f14c4c;--vscode-testing-iconErrored: #f14c4c;--vscode-testing-iconPassed: #73c991;--vscode-testing-runAction: #73c991;--vscode-testing-iconQueued: #cca700;--vscode-testing-iconUnset: #848484;--vscode-testing-iconSkipped: #848484;--vscode-testing-peekBorder: #f14c4c;--vscode-testing-peekHeaderBackground: rgba(241, 76, 76, .1);--vscode-testing-message\.error\.decorationForeground: #f14c4c;--vscode-testing-message\.error\.lineBackground: rgba(255, 0, 0, .2);--vscode-testing-message\.info\.decorationForeground: rgba(212, 212, 212, .5);--vscode-welcomePage-tileBackground: #252526;--vscode-welcomePage-tileHoverBackground: #2c2c2d;--vscode-welcomePage-tileShadow: rgba(0, 0, 0, .36);--vscode-welcomePage-progress\.background: #3c3c3c;--vscode-welcomePage-progress\.foreground: #3794ff;--vscode-debugExceptionWidget-border: #a31515;--vscode-debugExceptionWidget-background: #420b0d;--vscode-ports-iconRunningProcessForeground: #369432;--vscode-statusBar-debuggingBackground: #cc6633;--vscode-statusBar-debuggingForeground: #ffffff;--vscode-editor-inlineValuesForeground: rgba(255, 255, 255, .5);--vscode-editor-inlineValuesBackground: rgba(255, 200, 0, .2);--vscode-editorGutter-modifiedBackground: #1b81a8;--vscode-editorGutter-addedBackground: #487e02;--vscode-editorGutter-deletedBackground: #f14c4c;--vscode-minimapGutter-modifiedBackground: #1b81a8;--vscode-minimapGutter-addedBackground: #487e02;--vscode-minimapGutter-deletedBackground: #f14c4c;--vscode-editorOverviewRuler-modifiedForeground: rgba(27, 129, 168, .6);--vscode-editorOverviewRuler-addedForeground: rgba(72, 126, 2, .6);--vscode-editorOverviewRuler-deletedForeground: rgba(241, 76, 76, .6);--vscode-debugIcon-breakpointForeground: #e51400;--vscode-debugIcon-breakpointDisabledForeground: #848484;--vscode-debugIcon-breakpointUnverifiedForeground: #848484;--vscode-debugIcon-breakpointCurrentStackframeForeground: #ffcc00;--vscode-debugIcon-breakpointStackframeForeground: #89d185;--vscode-notebook-cellBorderColor: #37373d;--vscode-notebook-focusedEditorBorder: #007fd4;--vscode-notebookStatusSuccessIcon-foreground: #89d185;--vscode-notebookStatusErrorIcon-foreground: #f48771;--vscode-notebookStatusRunningIcon-foreground: #cccccc;--vscode-notebook-cellToolbarSeparator: rgba(128, 128, 128, .35);--vscode-notebook-selectedCellBackground: #37373d;--vscode-notebook-selectedCellBorder: #37373d;--vscode-notebook-focusedCellBorder: #007fd4;--vscode-notebook-inactiveFocusedCellBorder: #37373d;--vscode-notebook-cellStatusBarItemHoverBackground: rgba(255, 255, 255, .15);--vscode-notebook-cellInsertionIndicator: #007fd4;--vscode-notebookScrollbarSlider-background: rgba(121, 121, 121, .4);--vscode-notebookScrollbarSlider-hoverBackground: rgba(100, 100, 100, .7);--vscode-notebookScrollbarSlider-activeBackground: rgba(191, 191, 191, .4);--vscode-notebook-symbolHighlightBackground: rgba(255, 255, 255, .04);--vscode-notebook-cellEditorBackground: #252526;--vscode-notebook-editorBackground: #1e1e1e;--vscode-keybindingTable-headerBackground: rgba(204, 204, 204, .04);--vscode-keybindingTable-rowsBackground: rgba(204, 204, 204, .04);--vscode-scm-providerBorder: #454545;--vscode-debugTokenExpression-name: #c586c0;--vscode-debugTokenExpression-value: rgba(204, 204, 204, .6);--vscode-debugTokenExpression-string: #ce9178;--vscode-debugTokenExpression-boolean: #4e94ce;--vscode-debugTokenExpression-number: #b5cea8;--vscode-debugTokenExpression-error: #f48771;--vscode-debugView-exceptionLabelForeground: #cccccc;--vscode-debugView-exceptionLabelBackground: #6c2022;--vscode-debugView-stateLabelForeground: #cccccc;--vscode-debugView-stateLabelBackground: rgba(136, 136, 136, .27);--vscode-debugView-valueChangedHighlight: #569cd6;--vscode-debugConsole-infoForeground: #3794ff;--vscode-debugConsole-warningForeground: #cca700;--vscode-debugConsole-errorForeground: #f48771;--vscode-debugConsole-sourceForeground: #cccccc;--vscode-debugConsoleInputIcon-foreground: #cccccc;--vscode-debugIcon-pauseForeground: #75beff;--vscode-debugIcon-stopForeground: #f48771;--vscode-debugIcon-disconnectForeground: #f48771;--vscode-debugIcon-restartForeground: #89d185;--vscode-debugIcon-stepOverForeground: #75beff;--vscode-debugIcon-stepIntoForeground: #75beff;--vscode-debugIcon-stepOutForeground: #75beff;--vscode-debugIcon-continueForeground: #75beff;--vscode-debugIcon-stepBackForeground: #75beff;--vscode-extensionButton-prominentBackground: #0e639c;--vscode-extensionButton-prominentForeground: #ffffff;--vscode-extensionButton-prominentHoverBackground: #1177bb;--vscode-extensionIcon-starForeground: #ff8e00;--vscode-extensionIcon-verifiedForeground: #3794ff;--vscode-extensionIcon-preReleaseForeground: #1d9271;--vscode-extensionIcon-sponsorForeground: #d758b3;--vscode-terminal-ansiBlack: #000000;--vscode-terminal-ansiRed: #cd3131;--vscode-terminal-ansiGreen: #0dbc79;--vscode-terminal-ansiYellow: #e5e510;--vscode-terminal-ansiBlue: #2472c8;--vscode-terminal-ansiMagenta: #bc3fbc;--vscode-terminal-ansiCyan: #11a8cd;--vscode-terminal-ansiWhite: #e5e5e5;--vscode-terminal-ansiBrightBlack: #666666;--vscode-terminal-ansiBrightRed: #f14c4c;--vscode-terminal-ansiBrightGreen: #23d18b;--vscode-terminal-ansiBrightYellow: #f5f543;--vscode-terminal-ansiBrightBlue: #3b8eea;--vscode-terminal-ansiBrightMagenta: #d670d6;--vscode-terminal-ansiBrightCyan: #29b8db;--vscode-terminal-ansiBrightWhite: #e5e5e5;--vscode-interactive-activeCodeBorder: #3794ff;--vscode-interactive-inactiveCodeBorder: #37373d;--vscode-gitDecoration-addedResourceForeground: #81b88b;--vscode-gitDecoration-modifiedResourceForeground: #e2c08d;--vscode-gitDecoration-deletedResourceForeground: #c74e39;--vscode-gitDecoration-renamedResourceForeground: #73c991;--vscode-gitDecoration-untrackedResourceForeground: #73c991;--vscode-gitDecoration-ignoredResourceForeground: #8c8c8c;--vscode-gitDecoration-stageModifiedResourceForeground: #e2c08d;--vscode-gitDecoration-stageDeletedResourceForeground: #c74e39;--vscode-gitDecoration-conflictingResourceForeground: #e4676b;--vscode-gitDecoration-submoduleResourceForeground: #8db9e2}.toolbar-button{position:relative;flex:none;border:none;outline:none;color:var(--vscode-sideBarTitle-foreground);background:transparent;padding:4px;cursor:pointer;display:inline-flex;align-items:center;border-radius:4px}.toolbar-button:disabled{color:var(--vscode-disabledForeground)!important;cursor:default}.toolbar-button:not(:disabled):hover{background-color:var(--vscode-toolbar-hoverBackground)}.toolbar-button:not(:disabled):active{background-color:var(--vscode-toolbar-activeBackground)}.toolbar-button.toggled{color:var(--vscode-notificationLink-foreground)}.toolbar-button-error-badge{position:absolute;top:2px;right:2px;width:7px;height:7px;border-radius:50%;background-color:var(--vscode-notificationsErrorIcon-foreground)}.toolbar-separator{flex:none;background-color:var(--vscode-menu-separatorBackground);width:1px;padding:0;margin:5px 4px;height:16px}@font-face{font-family:codicon;src:url(/assets/codicon-DCmgc-ay.ttf) format("truetype")}.codicon{font: 16px/1 codicon;flex:none;display:inline-block;text-decoration:none;text-rendering:auto;text-align:center;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.codicon-add:before{content:"î© "}.codicon-plus:before{content:"î© "}.codicon-gist-new:before{content:"î© "}.codicon-repo-create:before{content:"î© "}.codicon-lightbulb:before{content:"î©¡"}.codicon-light-bulb:before{content:"î©¡"}.codicon-repo:before{content:"î©¢"}.codicon-repo-delete:before{content:"î©¢"}.codicon-gist-fork:before{content:"î©£"}.codicon-repo-forked:before{content:"î©£"}.codicon-git-pull-request:before{content:"î©¤"}.codicon-git-pull-request-abandoned:before{content:"î©¤"}.codicon-record-keys:before{content:"î©¥"}.codicon-keyboard:before{content:"î©¥"}.codicon-tag:before{content:"î©¦"}.codicon-git-pull-request-label:before{content:"î©¦"}.codicon-tag-add:before{content:"î©¦"}.codicon-tag-remove:before{content:"î©¦"}.codicon-person:before{content:"î©§"}.codicon-person-follow:before{content:"î©§"}.codicon-person-outline:before{content:"î©§"}.codicon-person-filled:before{content:"î©§"}.codicon-git-branch:before{content:"î©¨"}.codicon-git-branch-create:before{content:"î©¨"}.codicon-git-branch-delete:before{content:"î©¨"}.codicon-source-control:before{content:"î©¨"}.codicon-mirror:before{content:"î©©"}.codicon-mirror-public:before{content:"î©©"}.codicon-star:before{content:"î©ª"}.codicon-star-add:before{content:"î©ª"}.codicon-star-delete:before{content:"î©ª"}.codicon-star-empty:before{content:"î©ª"}.codicon-comment:before{content:"î©«"}.codicon-comment-add:before{content:"î©«"}.codicon-alert:before{content:"î©¬"}.codicon-warning:before{content:"î©¬"}.codicon-search:before{content:"î©­"}.codicon-search-save:before{content:"î©­"}.codicon-log-out:before{content:"î©®"}.codicon-sign-out:before{content:"î©®"}.codicon-log-in:before{content:"î©¯"}.codicon-sign-in:before{content:"î©¯"}.codicon-eye:before{content:"î©°"}.codicon-eye-unwatch:before{content:"î©°"}.codicon-eye-watch:before{content:"î©°"}.codicon-circle-filled:before{content:"î©±"}.codicon-primitive-dot:before{content:"î©±"}.codicon-close-dirty:before{content:"î©±"}.codicon-debug-breakpoint:before{content:"î©±"}.codicon-debug-breakpoint-disabled:before{content:"î©±"}.codicon-debug-hint:before{content:"î©±"}.codicon-terminal-decoration-success:before{content:"î©±"}.codicon-primitive-square:before{content:"î©²"}.codicon-edit:before{content:"î©³"}.codicon-pencil:before{content:"î©³"}.codicon-info:before{content:"î©´"}.codicon-issue-opened:before{content:"î©´"}.codicon-gist-private:before{content:"î©µ"}.codicon-git-fork-private:before{content:"î©µ"}.codicon-lock:before{content:"î©µ"}.codicon-mirror-private:before{content:"î©µ"}.codicon-close:before{content:"î©¶"}.codicon-remove-close:before{content:"î©¶"}.codicon-x:before{content:"î©¶"}.codicon-repo-sync:before{content:"î©·"}.codicon-sync:before{content:"î©·"}.codicon-clone:before{content:"î©¸"}.codicon-desktop-download:before{content:"î©¸"}.codicon-beaker:before{content:"î©¹"}.codicon-microscope:before{content:"î©¹"}.codicon-vm:before{content:"î©º"}.codicon-device-desktop:before{content:"î©º"}.codicon-file:before{content:"î©»"}.codicon-file-text:before{content:"î©»"}.codicon-more:before{content:"î©¼"}.codicon-ellipsis:before{content:"î©¼"}.codicon-kebab-horizontal:before{content:"î©¼"}.codicon-mail-reply:before{content:"î©½"}.codicon-reply:before{content:"î©½"}.codicon-organization:before{content:"î©¾"}.codicon-organization-filled:before{content:"î©¾"}.codicon-organization-outline:before{content:"î©¾"}.codicon-new-file:before{content:"î©¿"}.codicon-file-add:before{content:"î©¿"}.codicon-new-folder:before{content:"îª€"}.codicon-file-directory-create:before{content:"îª€"}.codicon-trash:before{content:"îª�"}.codicon-trashcan:before{content:"îª�"}.codicon-history:before{content:"îª‚"}.codicon-clock:before{content:"îª‚"}.codicon-folder:before{content:"îªƒ"}.codicon-file-directory:before{content:"îªƒ"}.codicon-symbol-folder:before{content:"îªƒ"}.codicon-logo-github:before{content:"îª„"}.codicon-mark-github:before{content:"îª„"}.codicon-github:before{content:"îª„"}.codicon-terminal:before{content:"îª…"}.codicon-console:before{content:"îª…"}.codicon-repl:before{content:"îª…"}.codicon-zap:before{content:"îª†"}.codicon-symbol-event:before{content:"îª†"}.codicon-error:before{content:"îª‡"}.codicon-stop:before{content:"îª‡"}.codicon-variable:before{content:"îªˆ"}.codicon-symbol-variable:before{content:"îªˆ"}.codicon-array:before{content:"îªŠ"}.codicon-symbol-array:before{content:"îªŠ"}.codicon-symbol-module:before{content:"îª‹"}.codicon-symbol-package:before{content:"îª‹"}.codicon-symbol-namespace:before{content:"îª‹"}.codicon-symbol-object:before{content:"îª‹"}.codicon-symbol-method:before{content:"îªŒ"}.codicon-symbol-function:before{content:"îªŒ"}.codicon-symbol-constructor:before{content:"îªŒ"}.codicon-symbol-boolean:before{content:"îª�"}.codicon-symbol-null:before{content:"îª�"}.codicon-symbol-numeric:before{content:"îª�"}.codicon-symbol-number:before{content:"îª�"}.codicon-symbol-structure:before{content:"îª‘"}.codicon-symbol-struct:before{content:"îª‘"}.codicon-symbol-parameter:before{content:"îª’"}.codicon-symbol-type-parameter:before{content:"îª’"}.codicon-symbol-key:before{content:"îª“"}.codicon-symbol-text:before{content:"îª“"}.codicon-symbol-reference:before{content:"îª”"}.codicon-go-to-file:before{content:"îª”"}.codicon-symbol-enum:before{content:"îª•"}.codicon-symbol-value:before{content:"îª•"}.codicon-symbol-ruler:before{content:"îª–"}.codicon-symbol-unit:before{content:"îª–"}.codicon-activate-breakpoints:before{content:"îª—"}.codicon-archive:before{content:"îª˜"}.codicon-arrow-both:before{content:"îª™"}.codicon-arrow-down:before{content:"îªš"}.codicon-arrow-left:before{content:"îª›"}.codicon-arrow-right:before{content:"îªœ"}.codicon-arrow-small-down:before{content:"îª�"}.codicon-arrow-small-left:before{content:"îªž"}.codicon-arrow-small-right:before{content:"îªŸ"}.codicon-arrow-small-up:before{content:"îª "}.codicon-arrow-up:before{content:"îª¡"}.codicon-bell:before{content:"îª¢"}.codicon-bold:before{content:"îª£"}.codicon-book:before{content:"îª¤"}.codicon-bookmark:before{content:"îª¥"}.codicon-debug-breakpoint-conditional-unverified:before{content:"îª¦"}.codicon-debug-breakpoint-conditional:before{content:"îª§"}.codicon-debug-breakpoint-conditional-disabled:before{content:"îª§"}.codicon-debug-breakpoint-data-unverified:before{content:"îª¨"}.codicon-debug-breakpoint-data:before{content:"îª©"}.codicon-debug-breakpoint-data-disabled:before{content:"îª©"}.codicon-debug-breakpoint-log-unverified:before{content:"îªª"}.codicon-debug-breakpoint-log:before{content:"îª«"}.codicon-debug-breakpoint-log-disabled:before{content:"îª«"}.codicon-briefcase:before{content:"îª¬"}.codicon-broadcast:before{content:"îª­"}.codicon-browser:before{content:"îª®"}.codicon-bug:before{content:"îª¯"}.codicon-calendar:before{content:"îª°"}.codicon-case-sensitive:before{content:"îª±"}.codicon-check:before{content:"îª²"}.codicon-checklist:before{content:"îª³"}.codicon-chevron-down:before{content:"îª´"}.codicon-chevron-left:before{content:"îªµ"}.codicon-chevron-right:before{content:"îª¶"}.codicon-chevron-up:before{content:"îª·"}.codicon-chrome-close:before{content:"îª¸"}.codicon-chrome-maximize:before{content:"îª¹"}.codicon-chrome-minimize:before{content:"îªº"}.codicon-chrome-restore:before{content:"îª»"}.codicon-circle-outline:before{content:"îª¼"}.codicon-circle:before{content:"îª¼"}.codicon-debug-breakpoint-unverified:before{content:"îª¼"}.codicon-terminal-decoration-incomplete:before{content:"îª¼"}.codicon-circle-slash:before{content:"îª½"}.codicon-circuit-board:before{content:"îª¾"}.codicon-clear-all:before{content:"îª¿"}.codicon-clippy:before{content:"î«€"}.codicon-close-all:before{content:"î«�"}.codicon-cloud-download:before{content:"î«‚"}.codicon-cloud-upload:before{content:"î«ƒ"}.codicon-code:before{content:"î«„"}.codicon-collapse-all:before{content:"î«…"}.codicon-color-mode:before{content:"î«†"}.codicon-comment-discussion:before{content:"î«‡"}.codicon-credit-card:before{content:"î«‰"}.codicon-dash:before{content:"î«Œ"}.codicon-dashboard:before{content:"î«�"}.codicon-database:before{content:"î«Ž"}.codicon-debug-continue:before{content:"î«�"}.codicon-debug-disconnect:before{content:"î«�"}.codicon-debug-pause:before{content:"î«‘"}.codicon-debug-restart:before{content:"î«’"}.codicon-debug-start:before{content:"î«“"}.codicon-debug-step-into:before{content:"î«”"}.codicon-debug-step-out:before{content:"î«•"}.codicon-debug-step-over:before{content:"î«–"}.codicon-debug-stop:before{content:"î«—"}.codicon-debug:before{content:"î«˜"}.codicon-device-camera-video:before{content:"î«™"}.codicon-device-camera:before{content:"î«š"}.codicon-device-mobile:before{content:"î«›"}.codicon-diff-added:before{content:"î«œ"}.codicon-diff-ignored:before{content:"î«�"}.codicon-diff-modified:before{content:"î«ž"}.codicon-diff-removed:before{content:"î«Ÿ"}.codicon-diff-renamed:before{content:"î« "}.codicon-diff:before{content:"î«¡"}.codicon-diff-sidebyside:before{content:"î«¡"}.codicon-discard:before{content:"î«¢"}.codicon-editor-layout:before{content:"î«£"}.codicon-empty-window:before{content:"î«¤"}.codicon-exclude:before{content:"î«¥"}.codicon-extensions:before{content:"î«¦"}.codicon-eye-closed:before{content:"î«§"}.codicon-file-binary:before{content:"î«¨"}.codicon-file-code:before{content:"î«©"}.codicon-file-media:before{content:"î«ª"}.codicon-file-pdf:before{content:"î««"}.codicon-file-submodule:before{content:"î«¬"}.codicon-file-symlink-directory:before{content:"î«­"}.codicon-file-symlink-file:before{content:"î«®"}.codicon-file-zip:before{content:"î«¯"}.codicon-files:before{content:"î«°"}.codicon-filter:before{content:"î«±"}.codicon-flame:before{content:"î«²"}.codicon-fold-down:before{content:"î«³"}.codicon-fold-up:before{content:"î«´"}.codicon-fold:before{content:"î«µ"}.codicon-folder-active:before{content:"î«¶"}.codicon-folder-opened:before{content:"î«·"}.codicon-gear:before{content:"î«¸"}.codicon-gift:before{content:"î«¹"}.codicon-gist-secret:before{content:"î«º"}.codicon-gist:before{content:"î«»"}.codicon-git-commit:before{content:"î«¼"}.codicon-git-compare:before{content:"î«½"}.codicon-compare-changes:before{content:"î«½"}.codicon-git-merge:before{content:"î«¾"}.codicon-github-action:before{content:"î«¿"}.codicon-github-alt:before{content:"î¬€"}.codicon-globe:before{content:"î¬�"}.codicon-grabber:before{content:"î¬‚"}.codicon-graph:before{content:"î¬ƒ"}.codicon-gripper:before{content:"î¬„"}.codicon-heart:before{content:"î¬…"}.codicon-home:before{content:"î¬†"}.codicon-horizontal-rule:before{content:"î¬‡"}.codicon-hubot:before{content:"î¬ˆ"}.codicon-inbox:before{content:"î¬‰"}.codicon-issue-reopened:before{content:"î¬‹"}.codicon-issues:before{content:"î¬Œ"}.codicon-italic:before{content:"î¬�"}.codicon-jersey:before{content:"î¬Ž"}.codicon-json:before{content:"î¬�"}.codicon-kebab-vertical:before{content:"î¬�"}.codicon-key:before{content:"î¬‘"}.codicon-law:before{content:"î¬’"}.codicon-lightbulb-autofix:before{content:"î¬“"}.codicon-link-external:before{content:"î¬”"}.codicon-link:before{content:"î¬•"}.codicon-list-ordered:before{content:"î¬–"}.codicon-list-unordered:before{content:"î¬—"}.codicon-live-share:before{content:"î¬˜"}.codicon-loading:before{content:"î¬™"}.codicon-location:before{content:"î¬š"}.codicon-mail-read:before{content:"î¬›"}.codicon-mail:before{content:"î¬œ"}.codicon-markdown:before{content:"î¬�"}.codicon-megaphone:before{content:"î¬ž"}.codicon-mention:before{content:"î¬Ÿ"}.codicon-milestone:before{content:"î¬ "}.codicon-git-pull-request-milestone:before{content:"î¬ "}.codicon-mortar-board:before{content:"î¬¡"}.codicon-move:before{content:"î¬¢"}.codicon-multiple-windows:before{content:"î¬£"}.codicon-mute:before{content:"î¬¤"}.codicon-no-newline:before{content:"î¬¥"}.codicon-note:before{content:"î¬¦"}.codicon-octoface:before{content:"î¬§"}.codicon-open-preview:before{content:"î¬¨"}.codicon-package:before{content:"î¬©"}.codicon-paintcan:before{content:"î¬ª"}.codicon-pin:before{content:"î¬«"}.codicon-play:before{content:"î¬¬"}.codicon-run:before{content:"î¬¬"}.codicon-plug:before{content:"î¬­"}.codicon-preserve-case:before{content:"î¬®"}.codicon-preview:before{content:"î¬¯"}.codicon-project:before{content:"î¬°"}.codicon-pulse:before{content:"î¬±"}.codicon-question:before{content:"î¬²"}.codicon-quote:before{content:"î¬³"}.codicon-radio-tower:before{content:"î¬´"}.codicon-reactions:before{content:"î¬µ"}.codicon-references:before{content:"î¬¶"}.codicon-refresh:before{content:"î¬·"}.codicon-regex:before{content:"î¬¸"}.codicon-remote-explorer:before{content:"î¬¹"}.codicon-remote:before{content:"î¬º"}.codicon-remove:before{content:"î¬»"}.codicon-replace-all:before{content:"î¬¼"}.codicon-replace:before{content:"î¬½"}.codicon-repo-clone:before{content:"î¬¾"}.codicon-repo-force-push:before{content:"î¬¿"}.codicon-repo-pull:before{content:"î­€"}.codicon-repo-push:before{content:"î­�"}.codicon-report:before{content:"î­‚"}.codicon-request-changes:before{content:"î­ƒ"}.codicon-rocket:before{content:"î­„"}.codicon-root-folder-opened:before{content:"î­…"}.codicon-root-folder:before{content:"î­†"}.codicon-rss:before{content:"î­‡"}.codicon-ruby:before{content:"î­ˆ"}.codicon-save-all:before{content:"î­‰"}.codicon-save-as:before{content:"î­Š"}.codicon-save:before{content:"î­‹"}.codicon-screen-full:before{content:"î­Œ"}.codicon-screen-normal:before{content:"î­�"}.codicon-search-stop:before{content:"î­Ž"}.codicon-server:before{content:"î­�"}.codicon-settings-gear:before{content:"î­‘"}.codicon-settings:before{content:"î­’"}.codicon-shield:before{content:"î­“"}.codicon-smiley:before{content:"î­”"}.codicon-sort-precedence:before{content:"î­•"}.codicon-split-horizontal:before{content:"î­–"}.codicon-split-vertical:before{content:"î­—"}.codicon-squirrel:before{content:"î­˜"}.codicon-star-full:before{content:"î­™"}.codicon-star-half:before{content:"î­š"}.codicon-symbol-class:before{content:"î­›"}.codicon-symbol-color:before{content:"î­œ"}.codicon-symbol-constant:before{content:"î­�"}.codicon-symbol-enum-member:before{content:"î­ž"}.codicon-symbol-field:before{content:"î­Ÿ"}.codicon-symbol-file:before{content:"î­ "}.codicon-symbol-interface:before{content:"î­¡"}.codicon-symbol-keyword:before{content:"î­¢"}.codicon-symbol-misc:before{content:"î­£"}.codicon-symbol-operator:before{content:"î­¤"}.codicon-symbol-property:before{content:"î­¥"}.codicon-wrench:before{content:"î­¥"}.codicon-wrench-subaction:before{content:"î­¥"}.codicon-symbol-snippet:before{content:"î­¦"}.codicon-tasklist:before{content:"î­§"}.codicon-telescope:before{content:"î­¨"}.codicon-text-size:before{content:"î­©"}.codicon-three-bars:before{content:"î­ª"}.codicon-thumbsdown:before{content:"î­«"}.codicon-thumbsup:before{content:"î­¬"}.codicon-tools:before{content:"î­­"}.codicon-triangle-down:before{content:"î­®"}.codicon-triangle-left:before{content:"î­¯"}.codicon-triangle-right:before{content:"î­°"}.codicon-triangle-up:before{content:"î­±"}.codicon-twitter:before{content:"î­²"}.codicon-unfold:before{content:"î­³"}.codicon-unlock:before{content:"î­´"}.codicon-unmute:before{content:"î­µ"}.codicon-unverified:before{content:"î­¶"}.codicon-verified:before{content:"î­·"}.codicon-versions:before{content:"î­¸"}.codicon-vm-active:before{content:"î­¹"}.codicon-vm-outline:before{content:"î­º"}.codicon-vm-running:before{content:"î­»"}.codicon-watch:before{content:"î­¼"}.codicon-whitespace:before{content:"î­½"}.codicon-whole-word:before{content:"î­¾"}.codicon-window:before{content:"î­¿"}.codicon-word-wrap:before{content:"î®€"}.codicon-zoom-in:before{content:"î®�"}.codicon-zoom-out:before{content:"î®‚"}.codicon-list-filter:before{content:"î®ƒ"}.codicon-list-flat:before{content:"î®„"}.codicon-list-selection:before{content:"î®…"}.codicon-selection:before{content:"î®…"}.codicon-list-tree:before{content:"î®†"}.codicon-debug-breakpoint-function-unverified:before{content:"î®‡"}.codicon-debug-breakpoint-function:before{content:"î®ˆ"}.codicon-debug-breakpoint-function-disabled:before{content:"î®ˆ"}.codicon-debug-stackframe-active:before{content:"î®‰"}.codicon-circle-small-filled:before{content:"î®Š"}.codicon-debug-stackframe-dot:before{content:"î®Š"}.codicon-terminal-decoration-mark:before{content:"î®Š"}.codicon-debug-stackframe:before{content:"î®‹"}.codicon-debug-stackframe-focused:before{content:"î®‹"}.codicon-debug-breakpoint-unsupported:before{content:"î®Œ"}.codicon-symbol-string:before{content:"î®�"}.codicon-debug-reverse-continue:before{content:"î®Ž"}.codicon-debug-step-back:before{content:"î®�"}.codicon-debug-restart-frame:before{content:"î®�"}.codicon-debug-alt:before{content:"î®‘"}.codicon-call-incoming:before{content:"î®’"}.codicon-call-outgoing:before{content:"î®“"}.codicon-menu:before{content:"î®”"}.codicon-expand-all:before{content:"î®•"}.codicon-feedback:before{content:"î®–"}.codicon-git-pull-request-reviewer:before{content:"î®–"}.codicon-group-by-ref-type:before{content:"î®—"}.codicon-ungroup-by-ref-type:before{content:"î®˜"}.codicon-account:before{content:"î®™"}.codicon-git-pull-request-assignee:before{content:"î®™"}.codicon-bell-dot:before{content:"î®š"}.codicon-debug-console:before{content:"î®›"}.codicon-library:before{content:"î®œ"}.codicon-output:before{content:"î®�"}.codicon-run-all:before{content:"î®ž"}.codicon-sync-ignored:before{content:"î®Ÿ"}.codicon-pinned:before{content:"î® "}.codicon-github-inverted:before{content:"î®¡"}.codicon-server-process:before{content:"î®¢"}.codicon-server-environment:before{content:"î®£"}.codicon-pass:before{content:"î®¤"}.codicon-issue-closed:before{content:"î®¤"}.codicon-stop-circle:before{content:"î®¥"}.codicon-play-circle:before{content:"î®¦"}.codicon-record:before{content:"î®§"}.codicon-debug-alt-small:before{content:"î®¨"}.codicon-vm-connect:before{content:"î®©"}.codicon-cloud:before{content:"î®ª"}.codicon-merge:before{content:"î®«"}.codicon-export:before{content:"î®¬"}.codicon-graph-left:before{content:"î®­"}.codicon-magnet:before{content:"î®®"}.codicon-notebook:before{content:"î®¯"}.codicon-redo:before{content:"î®°"}.codicon-check-all:before{content:"î®±"}.codicon-pinned-dirty:before{content:"î®²"}.codicon-pass-filled:before{content:"î®³"}.codicon-circle-large-filled:before{content:"î®´"}.codicon-circle-large:before{content:"î®µ"}.codicon-circle-large-outline:before{content:"î®µ"}.codicon-combine:before{content:"î®¶"}.codicon-gather:before{content:"î®¶"}.codicon-table:before{content:"î®·"}.codicon-variable-group:before{content:"î®¸"}.codicon-type-hierarchy:before{content:"î®¹"}.codicon-type-hierarchy-sub:before{content:"î®º"}.codicon-type-hierarchy-super:before{content:"î®»"}.codicon-git-pull-request-create:before{content:"î®¼"}.codicon-run-above:before{content:"î®½"}.codicon-run-below:before{content:"î®¾"}.codicon-notebook-template:before{content:"î®¿"}.codicon-debug-rerun:before{content:"î¯€"}.codicon-workspace-trusted:before{content:"î¯�"}.codicon-workspace-untrusted:before{content:"î¯‚"}.codicon-workspace-unknown:before{content:"î¯ƒ"}.codicon-terminal-cmd:before{content:"î¯„"}.codicon-terminal-debian:before{content:"î¯…"}.codicon-terminal-linux:before{content:"î¯†"}.codicon-terminal-powershell:before{content:"î¯‡"}.codicon-terminal-tmux:before{content:"î¯ˆ"}.codicon-terminal-ubuntu:before{content:"î¯‰"}.codicon-terminal-bash:before{content:"î¯Š"}.codicon-arrow-swap:before{content:"î¯‹"}.codicon-copy:before{content:"î¯Œ"}.codicon-person-add:before{content:"î¯�"}.codicon-filter-filled:before{content:"î¯Ž"}.codicon-wand:before{content:"î¯�"}.codicon-debug-line-by-line:before{content:"î¯�"}.codicon-inspect:before{content:"î¯‘"}.codicon-layers:before{content:"î¯’"}.codicon-layers-dot:before{content:"î¯“"}.codicon-layers-active:before{content:"î¯”"}.codicon-compass:before{content:"î¯•"}.codicon-compass-dot:before{content:"î¯–"}.codicon-compass-active:before{content:"î¯—"}.codicon-azure:before{content:"î¯˜"}.codicon-issue-draft:before{content:"î¯™"}.codicon-git-pull-request-closed:before{content:"î¯š"}.codicon-git-pull-request-draft:before{content:"î¯›"}.codicon-debug-all:before{content:"î¯œ"}.codicon-debug-coverage:before{content:"î¯�"}.codicon-run-errors:before{content:"î¯ž"}.codicon-folder-library:before{content:"î¯Ÿ"}.codicon-debug-continue-small:before{content:"î¯ "}.codicon-beaker-stop:before{content:"î¯¡"}.codicon-graph-line:before{content:"î¯¢"}.codicon-graph-scatter:before{content:"î¯£"}.codicon-pie-chart:before{content:"î¯¤"}.codicon-bracket:before{content:"î¬�"}.codicon-bracket-dot:before{content:"î¯¥"}.codicon-bracket-error:before{content:"î¯¦"}.codicon-lock-small:before{content:"î¯§"}.codicon-azure-devops:before{content:"î¯¨"}.codicon-verified-filled:before{content:"î¯©"}.codicon-newline:before{content:"î¯ª"}.codicon-layout:before{content:"î¯«"}.codicon-layout-activitybar-left:before{content:"î¯¬"}.codicon-layout-activitybar-right:before{content:"î¯­"}.codicon-layout-panel-left:before{content:"î¯®"}.codicon-layout-panel-center:before{content:"î¯¯"}.codicon-layout-panel-justify:before{content:"î¯°"}.codicon-layout-panel-right:before{content:"î¯±"}.codicon-layout-panel:before{content:"î¯²"}.codicon-layout-sidebar-left:before{content:"î¯³"}.codicon-layout-sidebar-right:before{content:"î¯´"}.codicon-layout-statusbar:before{content:"î¯µ"}.codicon-layout-menubar:before{content:"î¯¶"}.codicon-layout-centered:before{content:"î¯·"}.codicon-target:before{content:"î¯¸"}.codicon-indent:before{content:"î¯¹"}.codicon-record-small:before{content:"î¯º"}.codicon-error-small:before{content:"î¯»"}.codicon-terminal-decoration-error:before{content:"î¯»"}.codicon-arrow-circle-down:before{content:"î¯¼"}.codicon-arrow-circle-left:before{content:"î¯½"}.codicon-arrow-circle-right:before{content:"î¯¾"}.codicon-arrow-circle-up:before{content:"î¯¿"}.codicon-layout-sidebar-right-off:before{content:"î°€"}.codicon-layout-panel-off:before{content:"î°�"}.codicon-layout-sidebar-left-off:before{content:"î°‚"}.codicon-blank:before{content:"î°ƒ"}.codicon-heart-filled:before{content:"î°„"}.codicon-map:before{content:"î°…"}.codicon-map-horizontal:before{content:"î°…"}.codicon-fold-horizontal:before{content:"î°…"}.codicon-map-filled:before{content:"î°†"}.codicon-map-horizontal-filled:before{content:"î°†"}.codicon-fold-horizontal-filled:before{content:"î°†"}.codicon-circle-small:before{content:"î°‡"}.codicon-bell-slash:before{content:"î°ˆ"}.codicon-bell-slash-dot:before{content:"î°‰"}.codicon-comment-unresolved:before{content:"î°Š"}.codicon-git-pull-request-go-to-changes:before{content:"î°‹"}.codicon-git-pull-request-new-changes:before{content:"î°Œ"}.codicon-search-fuzzy:before{content:"î°�"}.codicon-comment-draft:before{content:"î°Ž"}.codicon-send:before{content:"î°�"}.codicon-sparkle:before{content:"î°�"}.codicon-insert:before{content:"î°‘"}.codicon-mic:before{content:"î°’"}.codicon-thumbsdown-filled:before{content:"î°“"}.codicon-thumbsup-filled:before{content:"î°”"}.codicon-coffee:before{content:"î°•"}.codicon-snake:before{content:"î°–"}.codicon-game:before{content:"î°—"}.codicon-vr:before{content:"î°˜"}.codicon-chip:before{content:"î°™"}.codicon-piano:before{content:"î°š"}.codicon-music:before{content:"î°›"}.codicon-mic-filled:before{content:"î°œ"}.codicon-repo-fetch:before{content:"î°�"}.codicon-copilot:before{content:"î°ž"}.codicon-lightbulb-sparkle:before{content:"î°Ÿ"}.codicon-robot:before{content:"î° "}.codicon-sparkle-filled:before{content:"î°¡"}.codicon-diff-single:before{content:"î°¢"}.codicon-diff-multiple:before{content:"î°£"}.codicon-surround-with:before{content:"î°¤"}.codicon-share:before{content:"î°¥"}.codicon-git-stash:before{content:"î°¦"}.codicon-git-stash-apply:before{content:"î°§"}.codicon-git-stash-pop:before{content:"î°¨"}.codicon-vscode:before{content:"î°©"}.codicon-vscode-insiders:before{content:"î°ª"}.codicon-code-oss:before{content:"î°«"}.codicon-run-coverage:before{content:"î°¬"}.codicon-run-all-coverage:before{content:"î°­"}.codicon-coverage:before{content:"î°®"}.codicon-github-project:before{content:"î°¯"}.codicon-map-vertical:before{content:"î°°"}.codicon-fold-vertical:before{content:"î°°"}.codicon-map-vertical-filled:before{content:"î°±"}.codicon-fold-vertical-filled:before{content:"î°±"}.codicon-go-to-search:before{content:"î°²"}.codicon-percentage:before{content:"î°³"}.codicon-sort-percentage:before{content:"î°³"}.codicon-attach:before{content:"î°´"}.codicon-git-fetch:before{content:"ï„�"}:root{--annotations-blue: 54 116 209}.annotations-layer,.annotations-rect,.annotations-popover,.annotations-color-swatch{--annotation-color: var(--annotations-blue)}.annotations-layer{position:absolute;top:0;right:0;bottom:0;left:0;z-index:5;outline:none;cursor:crosshair}.annotations-layer:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;pointer-events:none}.annotations-action-btn{height:26px;padding:0 12px;font-size:11px;font-weight:600;letter-spacing:.03em;text-transform:uppercase;background:var(--color-neutral-subtle);color:var(--color-fg-default);border:1px solid var(--color-border-muted);border-radius:999px;cursor:pointer;line-height:1}:root.dark-mode .annotations-action-btn{background:var(--color-neutral-muted);border-color:var(--color-border-default)}.annotations-action-btn:hover:not(:disabled){background:var(--color-neutral-muted)}.annotations-action-btn:disabled{opacity:.5;cursor:default}.annotations-action-btn.danger{background:transparent;color:var(--color-danger-fg);border-color:var(--color-border-muted)}.annotations-action-btn.danger:hover:not(:disabled){background:var(--color-danger-subtle)}.annotations-rect{position:absolute;box-sizing:border-box;border:2px solid rgb(var(--annotation-color));background:rgb(var(--annotation-color) / .12);cursor:pointer;transition:box-shadow .12s ease}.annotations-rect:hover{box-shadow:0 0 0 3px rgb(var(--annotation-color) / .25)}.annotations-rect.selected{box-shadow:0 0 0 3px rgb(var(--annotation-color) / .4);border-style:solid;border-color:rgb(var(--annotation-color));cursor:move}.annotations-rect.draft{border-style:dashed;background:rgb(var(--annotation-color) / .18);pointer-events:none}.annotations-handle{position:absolute;width:10px;height:10px;background:#fff;border:1.5px solid rgb(var(--annotation-color));border-radius:2px;box-sizing:border-box;z-index:1}.annotations-handle-nw{left:-6px;top:-6px;cursor:nwse-resize}.annotations-handle-n{left:50%;top:-6px;margin-left:-5px;cursor:ns-resize}.annotations-handle-ne{right:-6px;top:-6px;cursor:nesw-resize}.annotations-handle-e{right:-6px;top:50%;margin-top:-5px;cursor:ew-resize}.annotations-handle-se{right:-6px;bottom:-6px;cursor:nwse-resize}.annotations-handle-s{left:50%;bottom:-6px;margin-left:-5px;cursor:ns-resize}.annotations-handle-sw{left:-6px;bottom:-6px;cursor:nesw-resize}.annotations-handle-w{left:-6px;top:50%;margin-top:-5px;cursor:ew-resize}.annotations-label{position:absolute;top:-2px;left:-2px;max-width:calc(100% + 4px);padding:2px 6px;background:rgb(var(--annotation-color));color:#fff;font-size:11px;font-weight:500;border-radius:2px 2px 2px 0;transform:translateY(-100%);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:text}.annotations-label:hover{background:rgb(var(--annotation-color) / .85)}.annotations-popover{position:absolute;min-width:220px;max-width:320px;background:var(--color-canvas-overlay);border:1px solid var(--color-border-default);border-radius:8px;padding:8px;box-shadow:0 8px 24px #0000004d;display:flex;flex-direction:column;gap:6px;z-index:10;cursor:default}.annotations-textarea{width:100%;min-height:64px;resize:vertical;padding:6px 8px;font-family:inherit;font-size:12px;color:var(--color-fg-default);background:var(--color-canvas-default);border:1px solid var(--color-border-muted);border-radius:6px;outline:none;box-sizing:border-box}.annotations-textarea:focus{border-color:rgb(var(--annotation-color))}.annotations-popover-footer{display:flex;align-items:center;justify-content:space-between;gap:8px}.annotations-popover-actions{display:flex;gap:6px;justify-content:flex-end}.annotations-color-picker{display:flex;align-items:center;gap:4px}.annotations-color-swatch{width:14px;height:14px;padding:0;border:2px solid transparent;border-radius:50%;background:rgb(var(--annotation-color));cursor:pointer;transition:box-shadow .12s ease,transform .12s ease}.annotations-color-swatch:hover{box-shadow:0 0 0 2px rgb(var(--annotation-color) / .35)}.annotations-color-swatch.selected{border-color:var(--color-fg-default);transform:scale(1.1)}.annotate-modal-image{max-width:100%;max-height:100%;object-fit:contain;display:block;-webkit-user-select:none;user-select:none;-webkit-user-drag:none;box-shadow:0 0 0 1px var(--color-border-muted),0 0 8px var(--color-border-muted)}.annotate-sidebar{width:260px;flex-shrink:0;display:flex;flex-direction:column;background:var(--color-canvas-subtle);border-left:1px solid var(--color-border-muted);min-height:0}.annotate-sidebar-header{display:flex;align-items:center;justify-content:space-between;gap:6px;height:40px;min-height:40px;padding:0 8px;border-bottom:1px solid var(--color-border-muted);background:var(--color-canvas-overlay)}:root.light-mode .annotate-sidebar-header{background:var(--color-canvas-subtle)}.annotate-sidebar-list{flex:1;min-height:0;overflow-y:auto;padding:8px;display:flex;flex-direction:column;gap:6px}.annotate-sidebar-thumb{position:relative;flex-shrink:0;border:1px solid var(--color-border-muted);border-radius:6px;background:var(--color-canvas-default);overflow:hidden}.annotate-sidebar-thumb:hover{border-color:var(--color-border-default)}.annotate-sidebar-thumb.selected{border-color:var(--color-accent-fg, #2f81f7);box-shadow:0 0 0 1px var(--color-accent-fg, #2f81f7)}.annotate-sidebar-thumb-button{display:block;width:100%;padding:0;background:transparent;border:0;text-align:left;color:inherit;font:inherit;cursor:pointer}.annotate-sidebar-thumb-img-wrap{position:relative;display:block;width:100%;background:var(--color-canvas-overlay);overflow:hidden}.annotate-sidebar-thumb-img{display:block;width:100%;height:100%;object-fit:cover}.annotate-sidebar-thumb-overlay{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;pointer-events:none}.annotate-sidebar-thumb-rect{position:absolute;border:1.5px solid rgb(var(--annotation-color));background:rgb(var(--annotation-color) / .12);border-radius:2px;pointer-events:none;box-sizing:border-box}.annotate-sidebar-thumb-rect.hovered{background:rgb(var(--annotation-color) / .32)}.annotate-sidebar-thumb-remove.toolbar-button{position:absolute;top:4px;right:4px;padding:2px;background:#0000008c;color:#fff;border-radius:50%;opacity:0;transition:opacity .12s ease;z-index:1}.annotate-sidebar-thumb-remove.toolbar-button:not(:disabled):hover{background:#000000bf;color:#fff}.annotate-sidebar-thumb:hover .annotate-sidebar-thumb-remove,.annotate-sidebar-thumb-remove:focus-visible{opacity:1}.annotate-sidebar-comments{list-style:none;margin:0;padding:4px 8px 6px;display:flex;flex-direction:column;gap:3px}.annotate-sidebar-comment{display:block;width:100%;text-align:left;background:rgb(var(--annotation-color) / .12);border:1px solid rgb(var(--annotation-color) / .35);border-radius:4px;color:var(--color-fg-default);font-size:11px;line-height:1.4;padding:3px 6px;cursor:pointer;white-space:pre-wrap;word-break:break-word}.annotate-sidebar-comment:hover{background:rgb(var(--annotation-color) / .2)}.annotate-sidebar-comment.empty{color:var(--color-fg-muted);font-style:italic}.annotate-sidebar-feedback-wrap{display:grid;margin:8px 8px 4px;flex-shrink:0}.annotate-sidebar-feedback-wrap:after{content:attr(data-value) " ";white-space:pre-wrap;word-break:break-word;visibility:hidden;padding:6px 8px;font-size:12px;font-family:inherit;border:1px solid transparent;border-radius:4px;min-height:56px;grid-area:1 / 1 / 2 / 2}.annotate-sidebar-feedback{grid-area:1 / 1 / 2 / 2;padding:6px 8px;background:var(--vscode-input-background, #1e1e1e);color:var(--vscode-input-foreground, #cccccc);border:1px solid var(--color-border-muted);border-radius:4px;font-size:12px;font-family:inherit;resize:none;min-height:56px;overflow:hidden;outline:none}.annotate-sidebar-feedback:focus{border-color:var(--vscode-focusBorder, #007fd4)}.annotate-sidebar-submit{margin:4px 8px 8px;padding:8px 12px;background:var(--color-accent-fg, #2f81f7);color:#fff;border:0;border-radius:6px;cursor:pointer;font-weight:500;font-size:13px;flex-shrink:0}.annotate-sidebar-submit:hover:not(:disabled){filter:brightness(1.05)}.annotate-sidebar-submit:disabled{opacity:.55;cursor:not-allowed}.annotate-overlay{position:fixed;top:0;right:0;bottom:0;left:0;display:flex;align-items:stretch;justify-content:center;padding:16px;background:#0000008c;z-index:100;min-height:0}.annotate-overlay-window{flex:1;display:flex;flex-direction:column;border:1px solid var(--color-border-default);border-radius:10px;overflow:hidden;box-shadow:0 4px 20px #00000059;background:var(--color-canvas-default);min-height:0}.annotate-overlay-chrome{display:flex;align-items:center;gap:4px;height:40px;min-height:40px;padding:0 8px;background:var(--color-canvas-overlay);border-bottom:1px solid var(--color-border-muted)}:root.light-mode .annotate-overlay-chrome{background:var(--color-canvas-subtle)}.annotate-overlay-titlebar{flex:1;display:flex;align-items:center;gap:6px;height:30px;padding:0 4px;font-size:13px;color:var(--color-fg-default);min-width:0;overflow:hidden;white-space:nowrap}.annotate-overlay-title-text{font-weight:500;color:var(--color-fg-default);overflow:hidden;text-overflow:ellipsis;flex-shrink:0;max-width:40%}.annotate-overlay-title-sep{color:var(--color-fg-subtle)}.annotate-overlay-title-url{flex:1;font-family:var(--monospace-font, monospace);font-size:12px;color:var(--color-fg-muted);overflow:hidden;text-overflow:ellipsis}.annotate-overlay-canvas{flex:1;position:relative;display:flex;align-items:center;justify-content:center;min-height:0;padding:12px;background:var(--color-canvas-default)}.dashboard-shell-sidebar{width:100%;height:100%;background:var(--color-canvas-default);display:flex;flex-direction:column;overflow:hidden;border-right:1px solid var(--color-border-muted)}.dashboard-shell-sidebar-header{height:40px;min-height:40px;display:flex;align-items:center;justify-content:space-between;padding:0 8px;border-bottom:1px solid var(--color-border-muted)}.dashboard-shell-sidebar-title{margin:0;font-size:12px;font-weight:600;text-transform:uppercase;color:var(--color-fg-muted);letter-spacing:.03em}.dashboard-shell-sidebar-content{flex:1;overflow:auto;padding:0}.sidebar-empty{color:var(--color-fg-subtle);font-size:13px;padding:8px 12px}.dashboard-shell-main{flex:1;display:flex;flex-direction:column;height:100%;min-width:0;min-height:0}.dashboard-shell-main>.vbox{flex:1;min-height:0}.dashboard-shell-empty{width:100%;height:100%;display:flex;align-items:center;justify-content:center;color:var(--color-fg-muted);font-size:14px}.workspace-group{margin:0}.workspace-header{margin:0;padding:8px 12px 4px;font-size:12px;color:var(--color-fg-muted);font-weight:400}.workspace-path-full{display:block;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;direction:rtl;text-align:left;unicode-bidi:plaintext}.sidebar-session-list{display:flex;flex-direction:column;gap:0}.session-chip.sidebar-session{border:none;border-radius:0;background:transparent;overflow:hidden;cursor:default;position:relative}.sidebar-session-row{width:100%;display:flex;align-items:center;gap:8px;text-align:left;padding:8px 4px 4px 8px}.session-browser-icon-wrap{position:relative;width:18px;height:18px;border-radius:50%;flex-shrink:0}.session-browser-icon{width:100%;height:100%;border-radius:50%;display:flex;align-items:center;justify-content:center;transition:opacity .12s ease}.session-browser-icon .browser-icon-img{width:80%;height:80%;display:block}.session-browser-icon .browser-icon-fallback{width:100%;height:100%;border-radius:50%;background:var(--color-fg-subtle);color:var(--color-canvas-default);display:flex;align-items:center;justify-content:center;font-size:10px;font-weight:700}.session-browser-close{position:absolute;top:0;right:0;bottom:0;left:0;border-radius:50%;opacity:0;pointer-events:none;transition:opacity .12s ease}.session-browser-close .codicon{font-size:10px}.session-browser-icon-wrap:hover .session-browser-icon{opacity:0}.session-browser-icon-wrap:hover .session-browser-close{opacity:1;pointer-events:auto}.session-browser-close:hover{background:var(--color-neutral-muted)}.session-chip-name{font-size:13px;font-weight:600;color:var(--color-fg-default);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}.sidebar-session-row-actions{margin-left:auto;display:flex;align-items:center;gap:4px}.sidebar-session-new-tab .codicon{font-size:12px}.sidebar-session-new-tab:hover:not(:disabled){background:var(--color-neutral-muted)}.sidebar-tabs-loading{color:var(--color-fg-subtle);font-size:12px;padding:4px 12px 6px 38px;margin:0;flex:none;display:block;justify-content:flex-start;text-align:left}.sidebar-session .list-view-entry{display:flex;align-items:center;gap:6px;font-size:12px;color:var(--color-fg-muted);border-radius:0;padding:4px 4px 4px 24px;line-height:1.4}.sidebar-session .list-view-entry:hover{background:var(--color-neutral-muted)}.sidebar-tab-favicon{width:14px;height:14px;flex-shrink:0;margin-top:0;align-self:center}.sidebar-tab-favicon.placeholder{border-radius:2px;background:var(--color-fg-subtle);color:var(--color-canvas-default);display:flex;align-items:center;justify-content:center;font-size:9px;font-weight:700}.sidebar-tab-text{display:flex;flex-direction:column;gap:1px;flex:1;min-width:0}.sidebar-tab-title{color:var(--color-fg-default);line-height:1.2;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sidebar-tab-url{font-size:11px;color:var(--color-fg-muted);line-height:1.2;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sidebar-tab-close{margin-left:auto;align-self:center;opacity:0;pointer-events:none;transition:opacity .12s ease}.sidebar-session .list-view-entry:hover .sidebar-tab-close,.sidebar-tab-close:focus-visible{opacity:1;pointer-events:auto}.sidebar-tab-close .codicon{font-size:12px}.sidebar-tab-close:not(:disabled):hover{background:var(--color-neutral-muted)}.settings-button-container{position:relative}.settings-gear-btn{width:28px;height:28px;justify-content:center}.settings-gear-btn svg{width:16px;height:16px;fill:currentColor}.settings-popup{position:absolute;top:100%;right:0;margin-top:4px;background:var(--color-canvas-overlay);border:1px solid var(--color-neutral-muted);border-radius:8px;padding:8px 0;min-width:160px;box-shadow:var(--color-overlay-shadow);z-index:100;-webkit-user-select:none;user-select:none}.settings-popup .setting-row{display:flex;flex-direction:column;gap:4px;padding:6px 12px}.settings-popup .setting-label{font-size:11px;font-weight:600;color:var(--color-fg-subtle);text-transform:uppercase;letter-spacing:.04em}.settings-popup .setting-options{display:flex;flex-direction:column}.settings-popup .setting-option{display:flex;align-items:center;justify-content:flex-start;height:28px;padding:0 8px;border-radius:4px;font-size:12px;color:var(--color-fg-muted);cursor:pointer}.settings-popup .setting-option:hover{background:var(--color-neutral-subtle);color:var(--color-fg-default)}.settings-popup .setting-option.selected{color:var(--color-accent-fg)}.list-view-content{display:flex;flex-direction:column;flex:auto;position:relative;-webkit-user-select:none;user-select:none;overflow:hidden auto;outline:1px solid transparent}.list-view-entry{display:flex;flex:none;cursor:pointer;align-items:center;white-space:nowrap;line-height:28px;padding-left:5px}.list-view-content.not-selectable>.list-view-entry{cursor:inherit}.list-view-entry.highlighted:not(.selected){background-color:var(--vscode-list-inactiveSelectionBackground)!important}.list-view-entry.selected{z-index:10}.list-view-indent{min-width:16px}.list-view-content:focus .list-view-entry.selected{background-color:var(--vscode-list-activeSelectionBackground);color:var(--vscode-list-activeSelectionForeground);outline:1px solid var(--vscode-focusBorder)}.list-view-content .list-view-entry.selected{background-color:var(--vscode-list-inactiveSelectionBackground)}.list-view-content:focus .list-view-entry.selected *{color:var(--vscode-list-activeSelectionForeground)!important;background-color:transparent!important}.list-view-content:focus .list-view-entry.selected .codicon{color:var(--vscode-list-activeSelectionForeground)!important}.list-view-empty{flex:auto;display:flex;align-items:center;justify-content:center}.list-view-entry.error{color:var(--vscode-list-errorForeground);background-color:var(--vscode-inputValidation-errorBackground)}.list-view-entry.warning{color:var(--vscode-list-warningForeground);background-color:var(--vscode-inputValidation-warningBackground)}.list-view-entry.info{background-color:var(--vscode-inputValidation-infoBackground)}.split-view{display:flex;flex:auto;position:relative}.split-view.vertical{flex-direction:column}.split-view.vertical.sidebar-first{flex-direction:column-reverse}.split-view.horizontal{flex-direction:row}.split-view.horizontal.sidebar-first{flex-direction:row-reverse}.split-view-main{display:flex;flex:auto}.split-view-sidebar{display:flex;flex:none}.split-view.vertical:not(.sidebar-first)>.split-view-sidebar{border-top:1px solid var(--vscode-panel-border)}.split-view.horizontal:not(.sidebar-first)>.split-view-sidebar{border-left:1px solid var(--vscode-panel-border)}.split-view.vertical.sidebar-first>.split-view-sidebar{border-bottom:1px solid var(--vscode-panel-border)}.split-view.horizontal.sidebar-first>.split-view-sidebar{border-right:1px solid var(--vscode-panel-border)}.split-view-resizer{position:absolute;z-index:100}.split-view.vertical>.split-view-resizer{left:0;right:0;height:12px;cursor:ns-resize}.split-view.horizontal>.split-view-resizer{top:0;bottom:0;width:12px;cursor:ew-resize}
(function(){const i=document.createElement("link").relList;if(i&&i.supports&&i.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))s(r);new MutationObserver(r=>{for(const o of r)if(o.type==="childList")for(const h of o.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&s(h)}).observe(document,{childList:!0,subtree:!0});function f(r){const o={};return r.integrity&&(o.integrity=r.integrity),r.referrerPolicy&&(o.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?o.credentials="include":r.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function s(r){if(r.ep)return;r.ep=!0;const o=f(r);fetch(r.href,o)}})();function wg(u){return u&&u.__esModule&&Object.prototype.hasOwnProperty.call(u,"default")?u.default:u}var rr={exports:{}},Zi={};/**
 * @license React
 * react-jsx-runtime.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var y1;function Og(){if(y1)return Zi;y1=1;var u=Symbol.for("react.transitional.element"),i=Symbol.for("react.fragment");function f(s,r,o){var h=null;if(o!==void 0&&(h=""+o),r.key!==void 0&&(h=""+r.key),"key"in r){o={};for(var v in r)v!=="key"&&(o[v]=r[v])}else o=r;return r=o.ref,{$$typeof:u,type:s,key:h,ref:r!==void 0?r:null,props:o}}return Zi.Fragment=i,Zi.jsx=f,Zi.jsxs=f,Zi}var g1;function Rg(){return g1||(g1=1,rr.exports=Og()),rr.exports}var O=Rg(),or={exports:{}},Et={};/**
 * @license React
 * react.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var v1;function Dg(){if(v1)return Et;v1=1;var u=Symbol.for("react.transitional.element"),i=Symbol.for("react.portal"),f=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),h=Symbol.for("react.context"),v=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),y=Symbol.for("react.memo"),_=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),b=Symbol.iterator;function T(E){return E===null||typeof E!="object"?null:(E=b&&E[b]||E["@@iterator"],typeof E=="function"?E:null)}var D={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},G=Object.assign,W={};function J(E,R,k){this.props=E,this.context=R,this.refs=W,this.updater=k||D}J.prototype.isReactComponent={},J.prototype.setState=function(E,R){if(typeof E!="object"&&typeof E!="function"&&E!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,E,R,"setState")},J.prototype.forceUpdate=function(E){this.updater.enqueueForceUpdate(this,E,"forceUpdate")};function Z(){}Z.prototype=J.prototype;function $(E,R,k){this.props=E,this.context=R,this.refs=W,this.updater=k||D}var I=$.prototype=new Z;I.constructor=$,G(I,J.prototype),I.isPureReactComponent=!0;var B=Array.isArray;function it(){}var X={H:null,A:null,T:null,S:null},et=Object.prototype.hasOwnProperty;function ut(E,R,k){var w=k.ref;return{$$typeof:u,type:E,key:R,ref:w!==void 0?w:null,props:k}}function st(E,R){return ut(E.type,R,E.props)}function at(E){return typeof E=="object"&&E!==null&&E.$$typeof===u}function _t(E){var R={"=":"=0",":":"=2"};return"$"+E.replace(/[=:]/g,function(k){return R[k]})}var pt=/\/+/g;function yt(E,R){return typeof E=="object"&&E!==null&&E.key!=null?_t(""+E.key):R.toString(36)}function ot(E){switch(E.status){case"fulfilled":return E.value;case"rejected":throw E.reason;default:switch(typeof E.status=="string"?E.then(it,it):(E.status="pending",E.then(function(R){E.status==="pending"&&(E.status="fulfilled",E.value=R)},function(R){E.status==="pending"&&(E.status="rejected",E.reason=R)})),E.status){case"fulfilled":return E.value;case"rejected":throw E.reason}}throw E}function N(E,R,k,w,U){var L=typeof E;(L==="undefined"||L==="boolean")&&(E=null);var P=!1;if(E===null)P=!0;else switch(L){case"bigint":case"string":case"number":P=!0;break;case"object":switch(E.$$typeof){case u:case i:P=!0;break;case _:return P=E._init,N(P(E._payload),R,k,w,U)}}if(P)return U=U(E),P=w===""?"."+yt(E,0):w,B(U)?(k="",P!=null&&(k=P.replace(pt,"$&/")+"/"),N(U,R,k,"",function(Yt){return Yt})):U!=null&&(at(U)&&(U=st(U,k+(U.key==null||E&&E.key===U.key?"":(""+U.key).replace(pt,"$&/")+"/")+P)),R.push(U)),1;P=0;var H=w===""?".":w+":";if(B(E))for(var ht=0;ht<E.length;ht++)w=E[ht],L=H+yt(w,ht),P+=N(w,R,k,L,U);else if(ht=T(E),typeof ht=="function")for(E=ht.call(E),ht=0;!(w=E.next()).done;)w=w.value,L=H+yt(w,ht++),P+=N(w,R,k,L,U);else if(L==="object"){if(typeof E.then=="function")return N(ot(E),R,k,w,U);throw R=String(E),Error("Objects are not valid as a React child (found: "+(R==="[object Object]"?"object with keys {"+Object.keys(E).join(", ")+"}":R)+"). If you meant to render a collection of children, use an array instead.")}return P}function V(E,R,k){if(E==null)return E;var w=[],U=0;return N(E,w,"","",function(L){return R.call(k,L,U++)}),w}function lt(E){if(E._status===-1){var R=E._result;R=R(),R.then(function(k){(E._status===0||E._status===-1)&&(E._status=1,E._result=k)},function(k){(E._status===0||E._status===-1)&&(E._status=2,E._result=k)}),E._status===-1&&(E._status=0,E._result=R)}if(E._status===1)return E._result.default;throw E._result}var rt=typeof reportError=="function"?reportError:function(E){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var R=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof E=="object"&&E!==null&&typeof E.message=="string"?String(E.message):String(E),error:E});if(!window.dispatchEvent(R))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",E);return}console.error(E)},gt={map:V,forEach:function(E,R,k){V(E,function(){R.apply(this,arguments)},k)},count:function(E){var R=0;return V(E,function(){R++}),R},toArray:function(E){return V(E,function(R){return R})||[]},only:function(E){if(!at(E))throw Error("React.Children.only expected to receive a single React element child.");return E}};return Et.Activity=p,Et.Children=gt,Et.Component=J,Et.Fragment=f,Et.Profiler=r,Et.PureComponent=$,Et.StrictMode=s,Et.Suspense=m,Et.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=X,Et.__COMPILER_RUNTIME={__proto__:null,c:function(E){return X.H.useMemoCache(E)}},Et.cache=function(E){return function(){return E.apply(null,arguments)}},Et.cacheSignal=function(){return null},Et.cloneElement=function(E,R,k){if(E==null)throw Error("The argument must be a React element, but you passed "+E+".");var w=G({},E.props),U=E.key;if(R!=null)for(L in R.key!==void 0&&(U=""+R.key),R)!et.call(R,L)||L==="key"||L==="__self"||L==="__source"||L==="ref"&&R.ref===void 0||(w[L]=R[L]);var L=arguments.length-2;if(L===1)w.children=k;else if(1<L){for(var P=Array(L),H=0;H<L;H++)P[H]=arguments[H+2];w.children=P}return ut(E.type,U,w)},Et.createContext=function(E){return E={$$typeof:h,_currentValue:E,_currentValue2:E,_threadCount:0,Provider:null,Consumer:null},E.Provider=E,E.Consumer={$$typeof:o,_context:E},E},Et.createElement=function(E,R,k){var w,U={},L=null;if(R!=null)for(w in R.key!==void 0&&(L=""+R.key),R)et.call(R,w)&&w!=="key"&&w!=="__self"&&w!=="__source"&&(U[w]=R[w]);var P=arguments.length-2;if(P===1)U.children=k;else if(1<P){for(var H=Array(P),ht=0;ht<P;ht++)H[ht]=arguments[ht+2];U.children=H}if(E&&E.defaultProps)for(w in P=E.defaultProps,P)U[w]===void 0&&(U[w]=P[w]);return ut(E,L,U)},Et.createRef=function(){return{current:null}},Et.forwardRef=function(E){return{$$typeof:v,render:E}},Et.isValidElement=at,Et.lazy=function(E){return{$$typeof:_,_payload:{_status:-1,_result:E},_init:lt}},Et.memo=function(E,R){return{$$typeof:y,type:E,compare:R===void 0?null:R}},Et.startTransition=function(E){var R=X.T,k={};X.T=k;try{var w=E(),U=X.S;U!==null&&U(k,w),typeof w=="object"&&w!==null&&typeof w.then=="function"&&w.then(it,rt)}catch(L){rt(L)}finally{R!==null&&k.types!==null&&(R.types=k.types),X.T=R}},Et.unstable_useCacheRefresh=function(){return X.H.useCacheRefresh()},Et.use=function(E){return X.H.use(E)},Et.useActionState=function(E,R,k){return X.H.useActionState(E,R,k)},Et.useCallback=function(E,R){return X.H.useCallback(E,R)},Et.useContext=function(E){return X.H.useContext(E)},Et.useDebugValue=function(){},Et.useDeferredValue=function(E,R){return X.H.useDeferredValue(E,R)},Et.useEffect=function(E,R){return X.H.useEffect(E,R)},Et.useEffectEvent=function(E){return X.H.useEffectEvent(E)},Et.useId=function(){return X.H.useId()},Et.useImperativeHandle=function(E,R,k){return X.H.useImperativeHandle(E,R,k)},Et.useInsertionEffect=function(E,R){return X.H.useInsertionEffect(E,R)},Et.useLayoutEffect=function(E,R){return X.H.useLayoutEffect(E,R)},Et.useMemo=function(E,R){return X.H.useMemo(E,R)},Et.useOptimistic=function(E,R){return X.H.useOptimistic(E,R)},Et.useReducer=function(E,R,k){return X.H.useReducer(E,R,k)},Et.useRef=function(E){return X.H.useRef(E)},Et.useState=function(E){return X.H.useState(E)},Et.useSyncExternalStore=function(E,R,k){return X.H.useSyncExternalStore(E,R,k)},Et.useTransition=function(){return X.H.useTransition()},Et.version="19.2.1",Et}var _1;function kr(){return _1||(_1=1,or.exports=Dg()),or.exports}var Wn=kr();const mt=wg(Wn);var dr={exports:{}},Xi={},hr={exports:{}},mr={};/**
 * @license React
 * scheduler.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var p1;function zg(){return p1||(p1=1,(function(u){function i(N,V){var lt=N.length;N.push(V);t:for(;0<lt;){var rt=lt-1>>>1,gt=N[rt];if(0<r(gt,V))N[rt]=V,N[lt]=gt,lt=rt;else break t}}function f(N){return N.length===0?null:N[0]}function s(N){if(N.length===0)return null;var V=N[0],lt=N.pop();if(lt!==V){N[0]=lt;t:for(var rt=0,gt=N.length,E=gt>>>1;rt<E;){var R=2*(rt+1)-1,k=N[R],w=R+1,U=N[w];if(0>r(k,lt))w<gt&&0>r(U,k)?(N[rt]=U,N[w]=lt,rt=w):(N[rt]=k,N[R]=lt,rt=R);else if(w<gt&&0>r(U,lt))N[rt]=U,N[w]=lt,rt=w;else break t}}return V}function r(N,V){var lt=N.sortIndex-V.sortIndex;return lt!==0?lt:N.id-V.id}if(u.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;u.unstable_now=function(){return o.now()}}else{var h=Date,v=h.now();u.unstable_now=function(){return h.now()-v}}var m=[],y=[],_=1,p=null,b=3,T=!1,D=!1,G=!1,W=!1,J=typeof setTimeout=="function"?setTimeout:null,Z=typeof clearTimeout=="function"?clearTimeout:null,$=typeof setImmediate<"u"?setImmediate:null;function I(N){for(var V=f(y);V!==null;){if(V.callback===null)s(y);else if(V.startTime<=N)s(y),V.sortIndex=V.expirationTime,i(m,V);else break;V=f(y)}}function B(N){if(G=!1,I(N),!D)if(f(m)!==null)D=!0,it||(it=!0,_t());else{var V=f(y);V!==null&&ot(B,V.startTime-N)}}var it=!1,X=-1,et=5,ut=-1;function st(){return W?!0:!(u.unstable_now()-ut<et)}function at(){if(W=!1,it){var N=u.unstable_now();ut=N;var V=!0;try{t:{D=!1,G&&(G=!1,Z(X),X=-1),T=!0;var lt=b;try{e:{for(I(N),p=f(m);p!==null&&!(p.expirationTime>N&&st());){var rt=p.callback;if(typeof rt=="function"){p.callback=null,b=p.priorityLevel;var gt=rt(p.expirationTime<=N);if(N=u.unstable_now(),typeof gt=="function"){p.callback=gt,I(N),V=!0;break e}p===f(m)&&s(m),I(N)}else s(m);p=f(m)}if(p!==null)V=!0;else{var E=f(y);E!==null&&ot(B,E.startTime-N),V=!1}}break t}finally{p=null,b=lt,T=!1}V=void 0}}finally{V?_t():it=!1}}}var _t;if(typeof $=="function")_t=function(){$(at)};else if(typeof MessageChannel<"u"){var pt=new MessageChannel,yt=pt.port2;pt.port1.onmessage=at,_t=function(){yt.postMessage(null)}}else _t=function(){J(at,0)};function ot(N,V){X=J(function(){N(u.unstable_now())},V)}u.unstable_IdlePriority=5,u.unstable_ImmediatePriority=1,u.unstable_LowPriority=4,u.unstable_NormalPriority=3,u.unstable_Profiling=null,u.unstable_UserBlockingPriority=2,u.unstable_cancelCallback=function(N){N.callback=null},u.unstable_forceFrameRate=function(N){0>N||125<N?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):et=0<N?Math.floor(1e3/N):5},u.unstable_getCurrentPriorityLevel=function(){return b},u.unstable_next=function(N){switch(b){case 1:case 2:case 3:var V=3;break;default:V=b}var lt=b;b=V;try{return N()}finally{b=lt}},u.unstable_requestPaint=function(){W=!0},u.unstable_runWithPriority=function(N,V){switch(N){case 1:case 2:case 3:case 4:case 5:break;default:N=3}var lt=b;b=N;try{return V()}finally{b=lt}},u.unstable_scheduleCallback=function(N,V,lt){var rt=u.unstable_now();switch(typeof lt=="object"&&lt!==null?(lt=lt.delay,lt=typeof lt=="number"&&0<lt?rt+lt:rt):lt=rt,N){case 1:var gt=-1;break;case 2:gt=250;break;case 5:gt=1073741823;break;case 4:gt=1e4;break;default:gt=5e3}return gt=lt+gt,N={id:_++,callback:V,priorityLevel:N,startTime:lt,expirationTime:gt,sortIndex:-1},lt>rt?(N.sortIndex=lt,i(y,N),f(m)===null&&N===f(y)&&(G?(Z(X),X=-1):G=!0,ot(B,lt-rt))):(N.sortIndex=gt,i(m,N),D||T||(D=!0,it||(it=!0,_t()))),N},u.unstable_shouldYield=st,u.unstable_wrapCallback=function(N){var V=b;return function(){var lt=b;b=V;try{return N.apply(this,arguments)}finally{b=lt}}}})(mr)),mr}var b1;function Ng(){return b1||(b1=1,hr.exports=zg()),hr.exports}var yr={exports:{}},He={};/**
 * @license React
 * react-dom.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var S1;function Mg(){if(S1)return He;S1=1;var u=kr();function i(m){var y="https://react.dev/errors/"+m;if(1<arguments.length){y+="?args[]="+encodeURIComponent(arguments[1]);for(var _=2;_<arguments.length;_++)y+="&args[]="+encodeURIComponent(arguments[_])}return"Minified React error #"+m+"; visit "+y+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function f(){}var s={d:{f,r:function(){throw Error(i(522))},D:f,C:f,L:f,m:f,X:f,S:f,M:f},p:0,findDOMNode:null},r=Symbol.for("react.portal");function o(m,y,_){var p=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:r,key:p==null?null:""+p,children:m,containerInfo:y,implementation:_}}var h=u.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function v(m,y){if(m==="font")return"";if(typeof y=="string")return y==="use-credentials"?y:""}return He.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=s,He.createPortal=function(m,y){var _=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!y||y.nodeType!==1&&y.nodeType!==9&&y.nodeType!==11)throw Error(i(299));return o(m,y,null,_)},He.flushSync=function(m){var y=h.T,_=s.p;try{if(h.T=null,s.p=2,m)return m()}finally{h.T=y,s.p=_,s.d.f()}},He.preconnect=function(m,y){typeof m=="string"&&(y?(y=y.crossOrigin,y=typeof y=="string"?y==="use-credentials"?y:"":void 0):y=null,s.d.C(m,y))},He.prefetchDNS=function(m){typeof m=="string"&&s.d.D(m)},He.preinit=function(m,y){if(typeof m=="string"&&y&&typeof y.as=="string"){var _=y.as,p=v(_,y.crossOrigin),b=typeof y.integrity=="string"?y.integrity:void 0,T=typeof y.fetchPriority=="string"?y.fetchPriority:void 0;_==="style"?s.d.S(m,typeof y.precedence=="string"?y.precedence:void 0,{crossOrigin:p,integrity:b,fetchPriority:T}):_==="script"&&s.d.X(m,{crossOrigin:p,integrity:b,fetchPriority:T,nonce:typeof y.nonce=="string"?y.nonce:void 0})}},He.preinitModule=function(m,y){if(typeof m=="string")if(typeof y=="object"&&y!==null){if(y.as==null||y.as==="script"){var _=v(y.as,y.crossOrigin);s.d.M(m,{crossOrigin:_,integrity:typeof y.integrity=="string"?y.integrity:void 0,nonce:typeof y.nonce=="string"?y.nonce:void 0})}}else y==null&&s.d.M(m)},He.preload=function(m,y){if(typeof m=="string"&&typeof y=="object"&&y!==null&&typeof y.as=="string"){var _=y.as,p=v(_,y.crossOrigin);s.d.L(m,_,{crossOrigin:p,integrity:typeof y.integrity=="string"?y.integrity:void 0,nonce:typeof y.nonce=="string"?y.nonce:void 0,type:typeof y.type=="string"?y.type:void 0,fetchPriority:typeof y.fetchPriority=="string"?y.fetchPriority:void 0,referrerPolicy:typeof y.referrerPolicy=="string"?y.referrerPolicy:void 0,imageSrcSet:typeof y.imageSrcSet=="string"?y.imageSrcSet:void 0,imageSizes:typeof y.imageSizes=="string"?y.imageSizes:void 0,media:typeof y.media=="string"?y.media:void 0})}},He.preloadModule=function(m,y){if(typeof m=="string")if(y){var _=v(y.as,y.crossOrigin);s.d.m(m,{as:typeof y.as=="string"&&y.as!=="script"?y.as:void 0,crossOrigin:_,integrity:typeof y.integrity=="string"?y.integrity:void 0})}else s.d.m(m)},He.requestFormReset=function(m){s.d.r(m)},He.unstable_batchedUpdates=function(m,y){return m(y)},He.useFormState=function(m,y,_){return h.H.useFormState(m,y,_)},He.useFormStatus=function(){return h.H.useHostTransitionStatus()},He.version="19.2.1",He}var E1;function Ug(){if(E1)return yr.exports;E1=1;function u(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(u)}catch(i){console.error(i)}}return u(),yr.exports=Mg(),yr.exports}/**
 * @license React
 * react-dom-client.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var T1;function Cg(){if(T1)return Xi;T1=1;var u=Ng(),i=kr(),f=Ug();function s(t){var e="https://react.dev/errors/"+t;if(1<arguments.length){e+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)e+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function o(t){var e=t,n=t;if(t.alternate)for(;e.return;)e=e.return;else{t=e;do e=t,(e.flags&4098)!==0&&(n=e.return),t=e.return;while(t)}return e.tag===3?n:null}function h(t){if(t.tag===13){var e=t.memoizedState;if(e===null&&(t=t.alternate,t!==null&&(e=t.memoizedState)),e!==null)return e.dehydrated}return null}function v(t){if(t.tag===31){var e=t.memoizedState;if(e===null&&(t=t.alternate,t!==null&&(e=t.memoizedState)),e!==null)return e.dehydrated}return null}function m(t){if(o(t)!==t)throw Error(s(188))}function y(t){var e=t.alternate;if(!e){if(e=o(t),e===null)throw Error(s(188));return e!==t?null:t}for(var n=t,a=e;;){var l=n.return;if(l===null)break;var c=l.alternate;if(c===null){if(a=l.return,a!==null){n=a;continue}break}if(l.child===c.child){for(c=l.child;c;){if(c===n)return m(l),t;if(c===a)return m(l),e;c=c.sibling}throw Error(s(188))}if(n.return!==a.return)n=l,a=c;else{for(var d=!1,g=l.child;g;){if(g===n){d=!0,n=l,a=c;break}if(g===a){d=!0,a=l,n=c;break}g=g.sibling}if(!d){for(g=c.child;g;){if(g===n){d=!0,n=c,a=l;break}if(g===a){d=!0,a=c,n=l;break}g=g.sibling}if(!d)throw Error(s(189))}}if(n.alternate!==a)throw Error(s(190))}if(n.tag!==3)throw Error(s(188));return n.stateNode.current===n?t:e}function _(t){var e=t.tag;if(e===5||e===26||e===27||e===6)return t;for(t=t.child;t!==null;){if(e=_(t),e!==null)return e;t=t.sibling}return null}var p=Object.assign,b=Symbol.for("react.element"),T=Symbol.for("react.transitional.element"),D=Symbol.for("react.portal"),G=Symbol.for("react.fragment"),W=Symbol.for("react.strict_mode"),J=Symbol.for("react.profiler"),Z=Symbol.for("react.consumer"),$=Symbol.for("react.context"),I=Symbol.for("react.forward_ref"),B=Symbol.for("react.suspense"),it=Symbol.for("react.suspense_list"),X=Symbol.for("react.memo"),et=Symbol.for("react.lazy"),ut=Symbol.for("react.activity"),st=Symbol.for("react.memo_cache_sentinel"),at=Symbol.iterator;function _t(t){return t===null||typeof t!="object"?null:(t=at&&t[at]||t["@@iterator"],typeof t=="function"?t:null)}var pt=Symbol.for("react.client.reference");function yt(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===pt?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case G:return"Fragment";case J:return"Profiler";case W:return"StrictMode";case B:return"Suspense";case it:return"SuspenseList";case ut:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case D:return"Portal";case $:return t.displayName||"Context";case Z:return(t._context.displayName||"Context")+".Consumer";case I:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case X:return e=t.displayName||null,e!==null?e:yt(t.type)||"Memo";case et:e=t._payload,t=t._init;try{return yt(t(e))}catch{}}return null}var ot=Array.isArray,N=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,V=f.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,lt={pending:!1,data:null,method:null,action:null},rt=[],gt=-1;function E(t){return{current:t}}function R(t){0>gt||(t.current=rt[gt],rt[gt]=null,gt--)}function k(t,e){gt++,rt[gt]=t.current,t.current=e}var w=E(null),U=E(null),L=E(null),P=E(null);function H(t,e){switch(k(L,e),k(U,t),k(w,null),e.nodeType){case 9:case 11:t=(t=e.documentElement)&&(t=t.namespaceURI)?Bd(t):0;break;default:if(t=e.tagName,e=e.namespaceURI)e=Bd(e),t=Yd(e,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}R(w),k(w,t)}function ht(){R(w),R(U),R(L)}function Yt(t){t.memoizedState!==null&&k(P,t);var e=w.current,n=Yd(e,t.type);e!==n&&(k(U,t),k(w,n))}function Ft(t){U.current===t&&(R(w),R(U)),P.current===t&&(R(P),Bi._currentValue=lt)}var ae,oe;function Jt(t){if(ae===void 0)try{throw Error()}catch(n){var e=n.stack.trim().match(/\n( *(at )?)/);ae=e&&e[1]||"",oe=-1<n.stack.indexOf(`
    at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
`+ae+t+oe}var Gt=!1;function kt(t,e){if(!t||Gt)return"";Gt=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var a={DetermineComponentFrameRoot:function(){try{if(e){var K=function(){throw Error()};if(Object.defineProperty(K.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(K,[])}catch(j){var C=j}Reflect.construct(t,[],K)}else{try{K.call()}catch(j){C=j}t.call(K.prototype)}}else{try{throw Error()}catch(j){C=j}(K=t())&&typeof K.catch=="function"&&K.catch(function(){})}}catch(j){if(j&&C&&typeof j.stack=="string")return[j.stack,C.stack]}return[null,null]}};a.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var l=Object.getOwnPropertyDescriptor(a.DetermineComponentFrameRoot,"name");l&&l.configurable&&Object.defineProperty(a.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var c=a.DetermineComponentFrameRoot(),d=c[0],g=c[1];if(d&&g){var S=d.split(`
`),M=g.split(`
`);for(l=a=0;a<S.length&&!S[a].includes("DetermineComponentFrameRoot");)a++;for(;l<M.length&&!M[l].includes("DetermineComponentFrameRoot");)l++;if(a===S.length||l===M.length)for(a=S.length-1,l=M.length-1;1<=a&&0<=l&&S[a]!==M[l];)l--;for(;1<=a&&0<=l;a--,l--)if(S[a]!==M[l]){if(a!==1||l!==1)do if(a--,l--,0>l||S[a]!==M[l]){var q=`
`+S[a].replace(" at new "," at ");return t.displayName&&q.includes("<anonymous>")&&(q=q.replace("<anonymous>",t.displayName)),q}while(1<=a&&0<=l);break}}}finally{Gt=!1,Error.prepareStackTrace=n}return(n=t?t.displayName||t.name:"")?Jt(n):""}function je(t,e){switch(t.tag){case 26:case 27:case 5:return Jt(t.type);case 16:return Jt("Lazy");case 13:return t.child!==e&&e!==null?Jt("Suspense Fallback"):Jt("Suspense");case 19:return Jt("SuspenseList");case 0:case 15:return kt(t.type,!1);case 11:return kt(t.type.render,!1);case 1:return kt(t.type,!0);case 31:return Jt("Activity");default:return""}}function Be(t){try{var e="",n=null;do e+=je(t,n),n=t,t=t.return;while(t);return e}catch(a){return`
Error generating stack: `+a.message+`
`+a.stack}}var qe=Object.prototype.hasOwnProperty,Ce=u.unstable_scheduleCallback,Ae=u.unstable_cancelCallback,wn=u.unstable_shouldYield,nl=u.unstable_requestPaint,xe=u.unstable_now,al=u.unstable_getCurrentPriorityLevel,ll=u.unstable_ImmediatePriority,_e=u.unstable_UserBlockingPriority,ea=u.unstable_NormalPriority,Jc=u.unstable_LowPriority,Wl=u.unstable_IdlePriority,kc=u.log,Ic=u.unstable_setDisableYieldValue,Ua=null,Y=null;function tt(t){if(typeof kc=="function"&&Ic(t),Y&&typeof Y.setStrictMode=="function")try{Y.setStrictMode(Ua,t)}catch{}}var F=Math.clz32?Math.clz32:St,nt=Math.log,ct=Math.LN2;function St(t){return t>>>=0,t===0?32:31-(nt(t)/ct|0)|0}var wt=256,de=262144,Le=4194304;function pn(t){var e=t&42;if(e!==0)return e;switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function Ca(t,e,n){var a=t.pendingLanes;if(a===0)return 0;var l=0,c=t.suspendedLanes,d=t.pingedLanes;t=t.warmLanes;var g=a&134217727;return g!==0?(a=g&~c,a!==0?l=pn(a):(d&=g,d!==0?l=pn(d):n||(n=g&~t,n!==0&&(l=pn(n))))):(g=a&~c,g!==0?l=pn(g):d!==0?l=pn(d):n||(n=a&~t,n!==0&&(l=pn(n)))),l===0?0:e!==0&&e!==l&&(e&c)===0&&(c=l&-l,n=e&-e,c>=n||c===32&&(n&4194048)!==0)?e:l}function na(t,e){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&e)===0}function h3(t,e){switch(t){case 1:case 2:case 4:case 8:case 64:return e+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function po(){var t=Le;return Le<<=1,(Le&62914560)===0&&(Le=4194304),t}function Wc(t){for(var e=[],n=0;31>n;n++)e.push(t);return e}function $l(t,e){t.pendingLanes|=e,e!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function m3(t,e,n,a,l,c){var d=t.pendingLanes;t.pendingLanes=n,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=n,t.entangledLanes&=n,t.errorRecoveryDisabledLanes&=n,t.shellSuspendCounter=0;var g=t.entanglements,S=t.expirationTimes,M=t.hiddenUpdates;for(n=d&~n;0<n;){var q=31-F(n),K=1<<q;g[q]=0,S[q]=-1;var C=M[q];if(C!==null)for(M[q]=null,q=0;q<C.length;q++){var j=C[q];j!==null&&(j.lane&=-536870913)}n&=~K}a!==0&&bo(t,a,0),c!==0&&l===0&&t.tag!==0&&(t.suspendedLanes|=c&~(d&~e))}function bo(t,e,n){t.pendingLanes|=e,t.suspendedLanes&=~e;var a=31-F(e);t.entangledLanes|=e,t.entanglements[a]=t.entanglements[a]|1073741824|n&261930}function So(t,e){var n=t.entangledLanes|=e;for(t=t.entanglements;n;){var a=31-F(n),l=1<<a;l&e|t[a]&e&&(t[a]|=e),n&=~l}}function Eo(t,e){var n=e&-e;return n=(n&42)!==0?1:$c(n),(n&(t.suspendedLanes|e))!==0?0:n}function $c(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function Pc(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function To(){var t=V.p;return t!==0?t:(t=window.event,t===void 0?32:s1(t.type))}function Ao(t,e){var n=V.p;try{return V.p=t,e()}finally{V.p=n}}var aa=Math.random().toString(36).slice(2),we="__reactFiber$"+aa,Ze="__reactProps$"+aa,il="__reactContainer$"+aa,ts="__reactEvents$"+aa,y3="__reactListeners$"+aa,g3="__reactHandles$"+aa,xo="__reactResources$"+aa,Pl="__reactMarker$"+aa;function es(t){delete t[we],delete t[Ze],delete t[ts],delete t[y3],delete t[g3]}function ul(t){var e=t[we];if(e)return e;for(var n=t.parentNode;n;){if(e=n[il]||n[we]){if(n=e.alternate,e.child!==null||n!==null&&n.child!==null)for(t=Fd(t);t!==null;){if(n=t[we])return n;t=Fd(t)}return e}t=n,n=t.parentNode}return null}function cl(t){if(t=t[we]||t[il]){var e=t.tag;if(e===5||e===6||e===13||e===31||e===26||e===27||e===3)return t}return null}function ti(t){var e=t.tag;if(e===5||e===26||e===27||e===6)return t.stateNode;throw Error(s(33))}function sl(t){var e=t[xo];return e||(e=t[xo]={hoistableStyles:new Map,hoistableScripts:new Map}),e}function be(t){t[Pl]=!0}var wo=new Set,Oo={};function La(t,e){fl(t,e),fl(t+"Capture",e)}function fl(t,e){for(Oo[t]=e,t=0;t<e.length;t++)wo.add(e[t])}var v3=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Ro={},Do={};function _3(t){return qe.call(Do,t)?!0:qe.call(Ro,t)?!1:v3.test(t)?Do[t]=!0:(Ro[t]=!0,!1)}function uu(t,e,n){if(_3(e))if(n===null)t.removeAttribute(e);else{switch(typeof n){case"undefined":case"function":case"symbol":t.removeAttribute(e);return;case"boolean":var a=e.toLowerCase().slice(0,5);if(a!=="data-"&&a!=="aria-"){t.removeAttribute(e);return}}t.setAttribute(e,""+n)}}function cu(t,e,n){if(n===null)t.removeAttribute(e);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(e);return}t.setAttribute(e,""+n)}}function Un(t,e,n,a){if(a===null)t.removeAttribute(n);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(n);return}t.setAttributeNS(e,n,""+a)}}function un(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function zo(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function p3(t,e,n){var a=Object.getOwnPropertyDescriptor(t.constructor.prototype,e);if(!t.hasOwnProperty(e)&&typeof a<"u"&&typeof a.get=="function"&&typeof a.set=="function"){var l=a.get,c=a.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return l.call(this)},set:function(d){n=""+d,c.call(this,d)}}),Object.defineProperty(t,e,{enumerable:a.enumerable}),{getValue:function(){return n},setValue:function(d){n=""+d},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function ns(t){if(!t._valueTracker){var e=zo(t)?"checked":"value";t._valueTracker=p3(t,e,""+t[e])}}function No(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),a="";return t&&(a=zo(t)?t.checked?"true":"false":t.value),t=a,t!==n?(e.setValue(t),!0):!1}function su(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var b3=/[\n"\\]/g;function cn(t){return t.replace(b3,function(e){return"\\"+e.charCodeAt(0).toString(16)+" "})}function as(t,e,n,a,l,c,d,g){t.name="",d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"?t.type=d:t.removeAttribute("type"),e!=null?d==="number"?(e===0&&t.value===""||t.value!=e)&&(t.value=""+un(e)):t.value!==""+un(e)&&(t.value=""+un(e)):d!=="submit"&&d!=="reset"||t.removeAttribute("value"),e!=null?ls(t,d,un(e)):n!=null?ls(t,d,un(n)):a!=null&&t.removeAttribute("value"),l==null&&c!=null&&(t.defaultChecked=!!c),l!=null&&(t.checked=l&&typeof l!="function"&&typeof l!="symbol"),g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"?t.name=""+un(g):t.removeAttribute("name")}function Mo(t,e,n,a,l,c,d,g){if(c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"&&(t.type=c),e!=null||n!=null){if(!(c!=="submit"&&c!=="reset"||e!=null)){ns(t);return}n=n!=null?""+un(n):"",e=e!=null?""+un(e):n,g||e===t.value||(t.value=e),t.defaultValue=e}a=a??l,a=typeof a!="function"&&typeof a!="symbol"&&!!a,t.checked=g?t.checked:!!a,t.defaultChecked=!!a,d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"&&(t.name=d),ns(t)}function ls(t,e,n){e==="number"&&su(t.ownerDocument)===t||t.defaultValue===""+n||(t.defaultValue=""+n)}function rl(t,e,n,a){if(t=t.options,e){e={};for(var l=0;l<n.length;l++)e["$"+n[l]]=!0;for(n=0;n<t.length;n++)l=e.hasOwnProperty("$"+t[n].value),t[n].selected!==l&&(t[n].selected=l),l&&a&&(t[n].defaultSelected=!0)}else{for(n=""+un(n),e=null,l=0;l<t.length;l++){if(t[l].value===n){t[l].selected=!0,a&&(t[l].defaultSelected=!0);return}e!==null||t[l].disabled||(e=t[l])}e!==null&&(e.selected=!0)}}function Uo(t,e,n){if(e!=null&&(e=""+un(e),e!==t.value&&(t.value=e),n==null)){t.defaultValue!==e&&(t.defaultValue=e);return}t.defaultValue=n!=null?""+un(n):""}function Co(t,e,n,a){if(e==null){if(a!=null){if(n!=null)throw Error(s(92));if(ot(a)){if(1<a.length)throw Error(s(93));a=a[0]}n=a}n==null&&(n=""),e=n}n=un(e),t.defaultValue=n,a=t.textContent,a===n&&a!==""&&a!==null&&(t.value=a),ns(t)}function ol(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var S3=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Lo(t,e,n){var a=e.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?a?t.setProperty(e,""):e==="float"?t.cssFloat="":t[e]="":a?t.setProperty(e,n):typeof n!="number"||n===0||S3.has(e)?e==="float"?t.cssFloat=n:t[e]=(""+n).trim():t[e]=n+"px"}function Ho(t,e,n){if(e!=null&&typeof e!="object")throw Error(s(62));if(t=t.style,n!=null){for(var a in n)!n.hasOwnProperty(a)||e!=null&&e.hasOwnProperty(a)||(a.indexOf("--")===0?t.setProperty(a,""):a==="float"?t.cssFloat="":t[a]="");for(var l in e)a=e[l],e.hasOwnProperty(l)&&n[l]!==a&&Lo(t,l,a)}else for(var c in e)e.hasOwnProperty(c)&&Lo(t,c,e[c])}function is(t){if(t.indexOf("-")===-1)return!1;switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var E3=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),T3=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function fu(t){return T3.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function Cn(){}var us=null;function cs(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var dl=null,hl=null;function jo(t){var e=cl(t);if(e&&(t=e.stateNode)){var n=t[Ze]||null;t:switch(t=e.stateNode,e.type){case"input":if(as(t,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),e=n.name,n.type==="radio"&&e!=null){for(n=t;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+cn(""+e)+'"][type="radio"]'),e=0;e<n.length;e++){var a=n[e];if(a!==t&&a.form===t.form){var l=a[Ze]||null;if(!l)throw Error(s(90));as(a,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name)}}for(e=0;e<n.length;e++)a=n[e],a.form===t.form&&No(a)}break t;case"textarea":Uo(t,n.value,n.defaultValue);break t;case"select":e=n.value,e!=null&&rl(t,!!n.multiple,e,!1)}}}var ss=!1;function Bo(t,e,n){if(ss)return t(e,n);ss=!0;try{var a=t(e);return a}finally{if(ss=!1,(dl!==null||hl!==null)&&(Iu(),dl&&(e=dl,t=hl,hl=dl=null,jo(e),t)))for(e=0;e<t.length;e++)jo(t[e])}}function ei(t,e){var n=t.stateNode;if(n===null)return null;var a=n[Ze]||null;if(a===null)return null;n=a[e];t:switch(e){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(a=!a.disabled)||(t=t.type,a=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!a;break t;default:t=!1}if(t)return null;if(n&&typeof n!="function")throw Error(s(231,e,typeof n));return n}var Ln=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),fs=!1;if(Ln)try{var ni={};Object.defineProperty(ni,"passive",{get:function(){fs=!0}}),window.addEventListener("test",ni,ni),window.removeEventListener("test",ni,ni)}catch{fs=!1}var la=null,rs=null,ru=null;function Yo(){if(ru)return ru;var t,e=rs,n=e.length,a,l="value"in la?la.value:la.textContent,c=l.length;for(t=0;t<n&&e[t]===l[t];t++);var d=n-t;for(a=1;a<=d&&e[n-a]===l[c-a];a++);return ru=l.slice(t,1<a?1-a:void 0)}function ou(t){var e=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&e===13&&(t=13)):t=e,t===10&&(t=13),32<=t||t===13?t:0}function du(){return!0}function Go(){return!1}function Xe(t){function e(n,a,l,c,d){this._reactName=n,this._targetInst=l,this.type=a,this.nativeEvent=c,this.target=d,this.currentTarget=null;for(var g in t)t.hasOwnProperty(g)&&(n=t[g],this[g]=n?n(c):c[g]);return this.isDefaultPrevented=(c.defaultPrevented!=null?c.defaultPrevented:c.returnValue===!1)?du:Go,this.isPropagationStopped=Go,this}return p(e.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=du)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=du)},persist:function(){},isPersistent:du}),e}var Ha={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},hu=Xe(Ha),ai=p({},Ha,{view:0,detail:0}),A3=Xe(ai),os,ds,li,mu=p({},ai,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ms,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==li&&(li&&t.type==="mousemove"?(os=t.screenX-li.screenX,ds=t.screenY-li.screenY):ds=os=0,li=t),os)},movementY:function(t){return"movementY"in t?t.movementY:ds}}),qo=Xe(mu),x3=p({},mu,{dataTransfer:0}),w3=Xe(x3),O3=p({},ai,{relatedTarget:0}),hs=Xe(O3),R3=p({},Ha,{animationName:0,elapsedTime:0,pseudoElement:0}),D3=Xe(R3),z3=p({},Ha,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),N3=Xe(z3),M3=p({},Ha,{data:0}),Zo=Xe(M3),U3={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},C3={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},L3={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function H3(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=L3[t])?!!e[t]:!1}function ms(){return H3}var j3=p({},ai,{key:function(t){if(t.key){var e=U3[t.key]||t.key;if(e!=="Unidentified")return e}return t.type==="keypress"?(t=ou(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?C3[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ms,charCode:function(t){return t.type==="keypress"?ou(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?ou(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),B3=Xe(j3),Y3=p({},mu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Xo=Xe(Y3),G3=p({},ai,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ms}),q3=Xe(G3),Z3=p({},Ha,{propertyName:0,elapsedTime:0,pseudoElement:0}),X3=Xe(Z3),V3=p({},mu,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),Q3=Xe(V3),F3=p({},Ha,{newState:0,oldState:0}),K3=Xe(F3),J3=[9,13,27,32],ys=Ln&&"CompositionEvent"in window,ii=null;Ln&&"documentMode"in document&&(ii=document.documentMode);var k3=Ln&&"TextEvent"in window&&!ii,Vo=Ln&&(!ys||ii&&8<ii&&11>=ii),Qo=" ",Fo=!1;function Ko(t,e){switch(t){case"keyup":return J3.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Jo(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var ml=!1;function I3(t,e){switch(t){case"compositionend":return Jo(e);case"keypress":return e.which!==32?null:(Fo=!0,Qo);case"textInput":return t=e.data,t===Qo&&Fo?null:t;default:return null}}function W3(t,e){if(ml)return t==="compositionend"||!ys&&Ko(t,e)?(t=Yo(),ru=rs=la=null,ml=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1<e.char.length)return e.char;if(e.which)return String.fromCharCode(e.which)}return null;case"compositionend":return Vo&&e.locale!=="ko"?null:e.data;default:return null}}var $3={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function ko(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e==="input"?!!$3[t.type]:e==="textarea"}function Io(t,e,n,a){dl?hl?hl.push(a):hl=[a]:dl=a,e=ac(e,"onChange"),0<e.length&&(n=new hu("onChange","change",null,n,a),t.push({event:n,listeners:e}))}var ui=null,ci=null;function P3(t){Md(t,0)}function yu(t){var e=ti(t);if(No(e))return t}function Wo(t,e){if(t==="change")return e}var $o=!1;if(Ln){var gs;if(Ln){var vs="oninput"in document;if(!vs){var Po=document.createElement("div");Po.setAttribute("oninput","return;"),vs=typeof Po.oninput=="function"}gs=vs}else gs=!1;$o=gs&&(!document.documentMode||9<document.documentMode)}function t0(){ui&&(ui.detachEvent("onpropertychange",e0),ci=ui=null)}function e0(t){if(t.propertyName==="value"&&yu(ci)){var e=[];Io(e,ci,t,cs(t)),Bo(P3,e)}}function ty(t,e,n){t==="focusin"?(t0(),ui=e,ci=n,ui.attachEvent("onpropertychange",e0)):t==="focusout"&&t0()}function ey(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return yu(ci)}function ny(t,e){if(t==="click")return yu(e)}function ay(t,e){if(t==="input"||t==="change")return yu(e)}function ly(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var Ie=typeof Object.is=="function"?Object.is:ly;function si(t,e){if(Ie(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;var n=Object.keys(t),a=Object.keys(e);if(n.length!==a.length)return!1;for(a=0;a<n.length;a++){var l=n[a];if(!qe.call(e,l)||!Ie(t[l],e[l]))return!1}return!0}function n0(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function a0(t,e){var n=n0(t);t=0;for(var a;n;){if(n.nodeType===3){if(a=t+n.textContent.length,t<=e&&a>=e)return{node:n,offset:e-t};t=a}t:{for(;n;){if(n.nextSibling){n=n.nextSibling;break t}n=n.parentNode}n=void 0}n=n0(n)}}function l0(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?l0(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function i0(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var e=su(t.document);e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=su(t.document)}return e}function _s(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}var iy=Ln&&"documentMode"in document&&11>=document.documentMode,yl=null,ps=null,fi=null,bs=!1;function u0(t,e,n){var a=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;bs||yl==null||yl!==su(a)||(a=yl,"selectionStart"in a&&_s(a)?a={start:a.selectionStart,end:a.selectionEnd}:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection(),a={anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset}),fi&&si(fi,a)||(fi=a,a=ac(ps,"onSelect"),0<a.length&&(e=new hu("onSelect","select",null,e,n),t.push({event:e,listeners:a}),e.target=yl)))}function ja(t,e){var n={};return n[t.toLowerCase()]=e.toLowerCase(),n["Webkit"+t]="webkit"+e,n["Moz"+t]="moz"+e,n}var gl={animationend:ja("Animation","AnimationEnd"),animationiteration:ja("Animation","AnimationIteration"),animationstart:ja("Animation","AnimationStart"),transitionrun:ja("Transition","TransitionRun"),transitionstart:ja("Transition","TransitionStart"),transitioncancel:ja("Transition","TransitionCancel"),transitionend:ja("Transition","TransitionEnd")},Ss={},c0={};Ln&&(c0=document.createElement("div").style,"AnimationEvent"in window||(delete gl.animationend.animation,delete gl.animationiteration.animation,delete gl.animationstart.animation),"TransitionEvent"in window||delete gl.transitionend.transition);function Ba(t){if(Ss[t])return Ss[t];if(!gl[t])return t;var e=gl[t],n;for(n in e)if(e.hasOwnProperty(n)&&n in c0)return Ss[t]=e[n];return t}var s0=Ba("animationend"),f0=Ba("animationiteration"),r0=Ba("animationstart"),uy=Ba("transitionrun"),cy=Ba("transitionstart"),sy=Ba("transitioncancel"),o0=Ba("transitionend"),d0=new Map,Es="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Es.push("scrollEnd");function bn(t,e){d0.set(t,e),La(e,[t])}var gu=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var e=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(e))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},sn=[],vl=0,Ts=0;function vu(){for(var t=vl,e=Ts=vl=0;e<t;){var n=sn[e];sn[e++]=null;var a=sn[e];sn[e++]=null;var l=sn[e];sn[e++]=null;var c=sn[e];if(sn[e++]=null,a!==null&&l!==null){var d=a.pending;d===null?l.next=l:(l.next=d.next,d.next=l),a.pending=l}c!==0&&h0(n,l,c)}}function _u(t,e,n,a){sn[vl++]=t,sn[vl++]=e,sn[vl++]=n,sn[vl++]=a,Ts|=a,t.lanes|=a,t=t.alternate,t!==null&&(t.lanes|=a)}function As(t,e,n,a){return _u(t,e,n,a),pu(t)}function Ya(t,e){return _u(t,null,null,e),pu(t)}function h0(t,e,n){t.lanes|=n;var a=t.alternate;a!==null&&(a.lanes|=n);for(var l=!1,c=t.return;c!==null;)c.childLanes|=n,a=c.alternate,a!==null&&(a.childLanes|=n),c.tag===22&&(t=c.stateNode,t===null||t._visibility&1||(l=!0)),t=c,c=c.return;return t.tag===3?(c=t.stateNode,l&&e!==null&&(l=31-F(n),t=c.hiddenUpdates,a=t[l],a===null?t[l]=[e]:a.push(e),e.lane=n|536870912),c):null}function pu(t){if(50<Ni)throw Ni=0,Cf=null,Error(s(185));for(var e=t.return;e!==null;)t=e,e=t.return;return t.tag===3?t.stateNode:null}var _l={};function fy(t,e,n,a){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=a,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function We(t,e,n,a){return new fy(t,e,n,a)}function xs(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Hn(t,e){var n=t.alternate;return n===null?(n=We(t.tag,e,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=t.flags&65011712,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n.refCleanup=t.refCleanup,n}function m0(t,e){t.flags&=65011714;var n=t.alternate;return n===null?(t.childLanes=0,t.lanes=e,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=n.childLanes,t.lanes=n.lanes,t.child=n.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=n.memoizedProps,t.memoizedState=n.memoizedState,t.updateQueue=n.updateQueue,t.type=n.type,e=n.dependencies,t.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),t}function bu(t,e,n,a,l,c){var d=0;if(a=t,typeof t=="function")xs(t)&&(d=1);else if(typeof t=="string")d=mg(t,n,w.current)?26:t==="html"||t==="head"||t==="body"?27:5;else t:switch(t){case ut:return t=We(31,n,e,l),t.elementType=ut,t.lanes=c,t;case G:return Ga(n.children,l,c,e);case W:d=8,l|=24;break;case J:return t=We(12,n,e,l|2),t.elementType=J,t.lanes=c,t;case B:return t=We(13,n,e,l),t.elementType=B,t.lanes=c,t;case it:return t=We(19,n,e,l),t.elementType=it,t.lanes=c,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case $:d=10;break t;case Z:d=9;break t;case I:d=11;break t;case X:d=14;break t;case et:d=16,a=null;break t}d=29,n=Error(s(130,t===null?"null":typeof t,"")),a=null}return e=We(d,n,e,l),e.elementType=t,e.type=a,e.lanes=c,e}function Ga(t,e,n,a){return t=We(7,t,a,e),t.lanes=n,t}function ws(t,e,n){return t=We(6,t,null,e),t.lanes=n,t}function y0(t){var e=We(18,null,null,0);return e.stateNode=t,e}function Os(t,e,n){return e=We(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}var g0=new WeakMap;function fn(t,e){if(typeof t=="object"&&t!==null){var n=g0.get(t);return n!==void 0?n:(e={value:t,source:e,stack:Be(e)},g0.set(t,e),e)}return{value:t,source:e,stack:Be(e)}}var pl=[],bl=0,Su=null,ri=0,rn=[],on=0,ia=null,On=1,Rn="";function jn(t,e){pl[bl++]=ri,pl[bl++]=Su,Su=t,ri=e}function v0(t,e,n){rn[on++]=On,rn[on++]=Rn,rn[on++]=ia,ia=t;var a=On;t=Rn;var l=32-F(a)-1;a&=~(1<<l),n+=1;var c=32-F(e)+l;if(30<c){var d=l-l%5;c=(a&(1<<d)-1).toString(32),a>>=d,l-=d,On=1<<32-F(e)+l|n<<l|a,Rn=c+t}else On=1<<c|n<<l|a,Rn=t}function Rs(t){t.return!==null&&(jn(t,1),v0(t,1,0))}function Ds(t){for(;t===Su;)Su=pl[--bl],pl[bl]=null,ri=pl[--bl],pl[bl]=null;for(;t===ia;)ia=rn[--on],rn[on]=null,Rn=rn[--on],rn[on]=null,On=rn[--on],rn[on]=null}function _0(t,e){rn[on++]=On,rn[on++]=Rn,rn[on++]=ia,On=e.id,Rn=e.overflow,ia=t}var Oe=null,It=null,Ut=!1,ua=null,dn=!1,zs=Error(s(519));function ca(t){var e=Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw oi(fn(e,t)),zs}function p0(t){var e=t.stateNode,n=t.type,a=t.memoizedProps;switch(e[we]=t,e[Ze]=a,n){case"dialog":Rt("cancel",e),Rt("close",e);break;case"iframe":case"object":case"embed":Rt("load",e);break;case"video":case"audio":for(n=0;n<Ui.length;n++)Rt(Ui[n],e);break;case"source":Rt("error",e);break;case"img":case"image":case"link":Rt("error",e),Rt("load",e);break;case"details":Rt("toggle",e);break;case"input":Rt("invalid",e),Mo(e,a.value,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name,!0);break;case"select":Rt("invalid",e);break;case"textarea":Rt("invalid",e),Co(e,a.value,a.defaultValue,a.children)}n=a.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||e.textContent===""+n||a.suppressHydrationWarning===!0||Hd(e.textContent,n)?(a.popover!=null&&(Rt("beforetoggle",e),Rt("toggle",e)),a.onScroll!=null&&Rt("scroll",e),a.onScrollEnd!=null&&Rt("scrollend",e),a.onClick!=null&&(e.onclick=Cn),e=!0):e=!1,e||ca(t,!0)}function b0(t){for(Oe=t.return;Oe;)switch(Oe.tag){case 5:case 31:case 13:dn=!1;return;case 27:case 3:dn=!0;return;default:Oe=Oe.return}}function Sl(t){if(t!==Oe)return!1;if(!Ut)return b0(t),Ut=!0,!1;var e=t.tag,n;if((n=e!==3&&e!==27)&&((n=e===5)&&(n=t.type,n=!(n!=="form"&&n!=="button")||kf(t.type,t.memoizedProps)),n=!n),n&&It&&ca(t),b0(t),e===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(s(317));It=Qd(t)}else if(e===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(s(317));It=Qd(t)}else e===27?(e=It,Sa(t.type)?(t=tr,tr=null,It=t):It=e):It=Oe?mn(t.stateNode.nextSibling):null;return!0}function qa(){It=Oe=null,Ut=!1}function Ns(){var t=ua;return t!==null&&(Ke===null?Ke=t:Ke.push.apply(Ke,t),ua=null),t}function oi(t){ua===null?ua=[t]:ua.push(t)}var Ms=E(null),Za=null,Bn=null;function sa(t,e,n){k(Ms,e._currentValue),e._currentValue=n}function Yn(t){t._currentValue=Ms.current,R(Ms)}function Us(t,e,n){for(;t!==null;){var a=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,a!==null&&(a.childLanes|=e)):a!==null&&(a.childLanes&e)!==e&&(a.childLanes|=e),t===n)break;t=t.return}}function Cs(t,e,n,a){var l=t.child;for(l!==null&&(l.return=t);l!==null;){var c=l.dependencies;if(c!==null){var d=l.child;c=c.firstContext;t:for(;c!==null;){var g=c;c=l;for(var S=0;S<e.length;S++)if(g.context===e[S]){c.lanes|=n,g=c.alternate,g!==null&&(g.lanes|=n),Us(c.return,n,t),a||(d=null);break t}c=g.next}}else if(l.tag===18){if(d=l.return,d===null)throw Error(s(341));d.lanes|=n,c=d.alternate,c!==null&&(c.lanes|=n),Us(d,n,t),d=null}else d=l.child;if(d!==null)d.return=l;else for(d=l;d!==null;){if(d===t){d=null;break}if(l=d.sibling,l!==null){l.return=d.return,d=l;break}d=d.return}l=d}}function El(t,e,n,a){t=null;for(var l=e,c=!1;l!==null;){if(!c){if((l.flags&524288)!==0)c=!0;else if((l.flags&262144)!==0)break}if(l.tag===10){var d=l.alternate;if(d===null)throw Error(s(387));if(d=d.memoizedProps,d!==null){var g=l.type;Ie(l.pendingProps.value,d.value)||(t!==null?t.push(g):t=[g])}}else if(l===P.current){if(d=l.alternate,d===null)throw Error(s(387));d.memoizedState.memoizedState!==l.memoizedState.memoizedState&&(t!==null?t.push(Bi):t=[Bi])}l=l.return}t!==null&&Cs(e,t,n,a),e.flags|=262144}function Eu(t){for(t=t.firstContext;t!==null;){if(!Ie(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function Xa(t){Za=t,Bn=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function Re(t){return S0(Za,t)}function Tu(t,e){return Za===null&&Xa(t),S0(t,e)}function S0(t,e){var n=e._currentValue;if(e={context:e,memoizedValue:n,next:null},Bn===null){if(t===null)throw Error(s(308));Bn=e,t.dependencies={lanes:0,firstContext:e},t.flags|=524288}else Bn=Bn.next=e;return n}var ry=typeof AbortController<"u"?AbortController:function(){var t=[],e=this.signal={aborted:!1,addEventListener:function(n,a){t.push(a)}};this.abort=function(){e.aborted=!0,t.forEach(function(n){return n()})}},oy=u.unstable_scheduleCallback,dy=u.unstable_NormalPriority,he={$$typeof:$,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ls(){return{controller:new ry,data:new Map,refCount:0}}function di(t){t.refCount--,t.refCount===0&&oy(dy,function(){t.controller.abort()})}var hi=null,Hs=0,Tl=0,Al=null;function hy(t,e){if(hi===null){var n=hi=[];Hs=0,Tl=Gf(),Al={status:"pending",value:void 0,then:function(a){n.push(a)}}}return Hs++,e.then(E0,E0),e}function E0(){if(--Hs===0&&hi!==null){Al!==null&&(Al.status="fulfilled");var t=hi;hi=null,Tl=0,Al=null;for(var e=0;e<t.length;e++)(0,t[e])()}}function my(t,e){var n=[],a={status:"pending",value:null,reason:null,then:function(l){n.push(l)}};return t.then(function(){a.status="fulfilled",a.value=e;for(var l=0;l<n.length;l++)(0,n[l])(e)},function(l){for(a.status="rejected",a.reason=l,l=0;l<n.length;l++)(0,n[l])(void 0)}),a}var T0=N.S;N.S=function(t,e){ud=xe(),typeof e=="object"&&e!==null&&typeof e.then=="function"&&hy(t,e),T0!==null&&T0(t,e)};var Va=E(null);function js(){var t=Va.current;return t!==null?t:Kt.pooledCache}function Au(t,e){e===null?k(Va,Va.current):k(Va,e.pool)}function A0(){var t=js();return t===null?null:{parent:he._currentValue,pool:t}}var xl=Error(s(460)),Bs=Error(s(474)),xu=Error(s(542)),wu={then:function(){}};function x0(t){return t=t.status,t==="fulfilled"||t==="rejected"}function w0(t,e,n){switch(n=t[n],n===void 0?t.push(e):n!==e&&(e.then(Cn,Cn),e=n),e.status){case"fulfilled":return e.value;case"rejected":throw t=e.reason,R0(t),t;default:if(typeof e.status=="string")e.then(Cn,Cn);else{if(t=Kt,t!==null&&100<t.shellSuspendCounter)throw Error(s(482));t=e,t.status="pending",t.then(function(a){if(e.status==="pending"){var l=e;l.status="fulfilled",l.value=a}},function(a){if(e.status==="pending"){var l=e;l.status="rejected",l.reason=a}})}switch(e.status){case"fulfilled":return e.value;case"rejected":throw t=e.reason,R0(t),t}throw Fa=e,xl}}function Qa(t){try{var e=t._init;return e(t._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(Fa=n,xl):n}}var Fa=null;function O0(){if(Fa===null)throw Error(s(459));var t=Fa;return Fa=null,t}function R0(t){if(t===xl||t===xu)throw Error(s(483))}var wl=null,mi=0;function Ou(t){var e=mi;return mi+=1,wl===null&&(wl=[]),w0(wl,t,e)}function yi(t,e){e=e.props.ref,t.ref=e!==void 0?e:null}function Ru(t,e){throw e.$$typeof===b?Error(s(525)):(t=Object.prototype.toString.call(e),Error(s(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)))}function D0(t){function e(x,A){if(t){var z=x.deletions;z===null?(x.deletions=[A],x.flags|=16):z.push(A)}}function n(x,A){if(!t)return null;for(;A!==null;)e(x,A),A=A.sibling;return null}function a(x){for(var A=new Map;x!==null;)x.key!==null?A.set(x.key,x):A.set(x.index,x),x=x.sibling;return A}function l(x,A){return x=Hn(x,A),x.index=0,x.sibling=null,x}function c(x,A,z){return x.index=z,t?(z=x.alternate,z!==null?(z=z.index,z<A?(x.flags|=67108866,A):z):(x.flags|=67108866,A)):(x.flags|=1048576,A)}function d(x){return t&&x.alternate===null&&(x.flags|=67108866),x}function g(x,A,z,Q){return A===null||A.tag!==6?(A=ws(z,x.mode,Q),A.return=x,A):(A=l(A,z),A.return=x,A)}function S(x,A,z,Q){var vt=z.type;return vt===G?q(x,A,z.props.children,Q,z.key):A!==null&&(A.elementType===vt||typeof vt=="object"&&vt!==null&&vt.$$typeof===et&&Qa(vt)===A.type)?(A=l(A,z.props),yi(A,z),A.return=x,A):(A=bu(z.type,z.key,z.props,null,x.mode,Q),yi(A,z),A.return=x,A)}function M(x,A,z,Q){return A===null||A.tag!==4||A.stateNode.containerInfo!==z.containerInfo||A.stateNode.implementation!==z.implementation?(A=Os(z,x.mode,Q),A.return=x,A):(A=l(A,z.children||[]),A.return=x,A)}function q(x,A,z,Q,vt){return A===null||A.tag!==7?(A=Ga(z,x.mode,Q,vt),A.return=x,A):(A=l(A,z),A.return=x,A)}function K(x,A,z){if(typeof A=="string"&&A!==""||typeof A=="number"||typeof A=="bigint")return A=ws(""+A,x.mode,z),A.return=x,A;if(typeof A=="object"&&A!==null){switch(A.$$typeof){case T:return z=bu(A.type,A.key,A.props,null,x.mode,z),yi(z,A),z.return=x,z;case D:return A=Os(A,x.mode,z),A.return=x,A;case et:return A=Qa(A),K(x,A,z)}if(ot(A)||_t(A))return A=Ga(A,x.mode,z,null),A.return=x,A;if(typeof A.then=="function")return K(x,Ou(A),z);if(A.$$typeof===$)return K(x,Tu(x,A),z);Ru(x,A)}return null}function C(x,A,z,Q){var vt=A!==null?A.key:null;if(typeof z=="string"&&z!==""||typeof z=="number"||typeof z=="bigint")return vt!==null?null:g(x,A,""+z,Q);if(typeof z=="object"&&z!==null){switch(z.$$typeof){case T:return z.key===vt?S(x,A,z,Q):null;case D:return z.key===vt?M(x,A,z,Q):null;case et:return z=Qa(z),C(x,A,z,Q)}if(ot(z)||_t(z))return vt!==null?null:q(x,A,z,Q,null);if(typeof z.then=="function")return C(x,A,Ou(z),Q);if(z.$$typeof===$)return C(x,A,Tu(x,z),Q);Ru(x,z)}return null}function j(x,A,z,Q,vt){if(typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint")return x=x.get(z)||null,g(A,x,""+Q,vt);if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case T:return x=x.get(Q.key===null?z:Q.key)||null,S(A,x,Q,vt);case D:return x=x.get(Q.key===null?z:Q.key)||null,M(A,x,Q,vt);case et:return Q=Qa(Q),j(x,A,z,Q,vt)}if(ot(Q)||_t(Q))return x=x.get(z)||null,q(A,x,Q,vt,null);if(typeof Q.then=="function")return j(x,A,z,Ou(Q),vt);if(Q.$$typeof===$)return j(x,A,z,Tu(A,Q),vt);Ru(A,Q)}return null}function ft(x,A,z,Q){for(var vt=null,Ht=null,dt=A,xt=A=0,Mt=null;dt!==null&&xt<z.length;xt++){dt.index>xt?(Mt=dt,dt=null):Mt=dt.sibling;var jt=C(x,dt,z[xt],Q);if(jt===null){dt===null&&(dt=Mt);break}t&&dt&&jt.alternate===null&&e(x,dt),A=c(jt,A,xt),Ht===null?vt=jt:Ht.sibling=jt,Ht=jt,dt=Mt}if(xt===z.length)return n(x,dt),Ut&&jn(x,xt),vt;if(dt===null){for(;xt<z.length;xt++)dt=K(x,z[xt],Q),dt!==null&&(A=c(dt,A,xt),Ht===null?vt=dt:Ht.sibling=dt,Ht=dt);return Ut&&jn(x,xt),vt}for(dt=a(dt);xt<z.length;xt++)Mt=j(dt,x,xt,z[xt],Q),Mt!==null&&(t&&Mt.alternate!==null&&dt.delete(Mt.key===null?xt:Mt.key),A=c(Mt,A,xt),Ht===null?vt=Mt:Ht.sibling=Mt,Ht=Mt);return t&&dt.forEach(function(wa){return e(x,wa)}),Ut&&jn(x,xt),vt}function bt(x,A,z,Q){if(z==null)throw Error(s(151));for(var vt=null,Ht=null,dt=A,xt=A=0,Mt=null,jt=z.next();dt!==null&&!jt.done;xt++,jt=z.next()){dt.index>xt?(Mt=dt,dt=null):Mt=dt.sibling;var wa=C(x,dt,jt.value,Q);if(wa===null){dt===null&&(dt=Mt);break}t&&dt&&wa.alternate===null&&e(x,dt),A=c(wa,A,xt),Ht===null?vt=wa:Ht.sibling=wa,Ht=wa,dt=Mt}if(jt.done)return n(x,dt),Ut&&jn(x,xt),vt;if(dt===null){for(;!jt.done;xt++,jt=z.next())jt=K(x,jt.value,Q),jt!==null&&(A=c(jt,A,xt),Ht===null?vt=jt:Ht.sibling=jt,Ht=jt);return Ut&&jn(x,xt),vt}for(dt=a(dt);!jt.done;xt++,jt=z.next())jt=j(dt,x,xt,jt.value,Q),jt!==null&&(t&&jt.alternate!==null&&dt.delete(jt.key===null?xt:jt.key),A=c(jt,A,xt),Ht===null?vt=jt:Ht.sibling=jt,Ht=jt);return t&&dt.forEach(function(xg){return e(x,xg)}),Ut&&jn(x,xt),vt}function Qt(x,A,z,Q){if(typeof z=="object"&&z!==null&&z.type===G&&z.key===null&&(z=z.props.children),typeof z=="object"&&z!==null){switch(z.$$typeof){case T:t:{for(var vt=z.key;A!==null;){if(A.key===vt){if(vt=z.type,vt===G){if(A.tag===7){n(x,A.sibling),Q=l(A,z.props.children),Q.return=x,x=Q;break t}}else if(A.elementType===vt||typeof vt=="object"&&vt!==null&&vt.$$typeof===et&&Qa(vt)===A.type){n(x,A.sibling),Q=l(A,z.props),yi(Q,z),Q.return=x,x=Q;break t}n(x,A);break}else e(x,A);A=A.sibling}z.type===G?(Q=Ga(z.props.children,x.mode,Q,z.key),Q.return=x,x=Q):(Q=bu(z.type,z.key,z.props,null,x.mode,Q),yi(Q,z),Q.return=x,x=Q)}return d(x);case D:t:{for(vt=z.key;A!==null;){if(A.key===vt)if(A.tag===4&&A.stateNode.containerInfo===z.containerInfo&&A.stateNode.implementation===z.implementation){n(x,A.sibling),Q=l(A,z.children||[]),Q.return=x,x=Q;break t}else{n(x,A);break}else e(x,A);A=A.sibling}Q=Os(z,x.mode,Q),Q.return=x,x=Q}return d(x);case et:return z=Qa(z),Qt(x,A,z,Q)}if(ot(z))return ft(x,A,z,Q);if(_t(z)){if(vt=_t(z),typeof vt!="function")throw Error(s(150));return z=vt.call(z),bt(x,A,z,Q)}if(typeof z.then=="function")return Qt(x,A,Ou(z),Q);if(z.$$typeof===$)return Qt(x,A,Tu(x,z),Q);Ru(x,z)}return typeof z=="string"&&z!==""||typeof z=="number"||typeof z=="bigint"?(z=""+z,A!==null&&A.tag===6?(n(x,A.sibling),Q=l(A,z),Q.return=x,x=Q):(n(x,A),Q=ws(z,x.mode,Q),Q.return=x,x=Q),d(x)):n(x,A)}return function(x,A,z,Q){try{mi=0;var vt=Qt(x,A,z,Q);return wl=null,vt}catch(dt){if(dt===xl||dt===xu)throw dt;var Ht=We(29,dt,null,x.mode);return Ht.lanes=Q,Ht.return=x,Ht}finally{}}}var Ka=D0(!0),z0=D0(!1),fa=!1;function Ys(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Gs(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function ra(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function oa(t,e,n){var a=t.updateQueue;if(a===null)return null;if(a=a.shared,(Bt&2)!==0){var l=a.pending;return l===null?e.next=e:(e.next=l.next,l.next=e),a.pending=e,e=pu(t),h0(t,null,n),e}return _u(t,a,e,n),pu(t)}function gi(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194048)!==0)){var a=e.lanes;a&=t.pendingLanes,n|=a,e.lanes=n,So(t,n)}}function qs(t,e){var n=t.updateQueue,a=t.alternate;if(a!==null&&(a=a.updateQueue,n===a)){var l=null,c=null;if(n=n.firstBaseUpdate,n!==null){do{var d={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};c===null?l=c=d:c=c.next=d,n=n.next}while(n!==null);c===null?l=c=e:c=c.next=e}else l=c=e;n={baseState:a.baseState,firstBaseUpdate:l,lastBaseUpdate:c,shared:a.shared,callbacks:a.callbacks},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}var Zs=!1;function vi(){if(Zs){var t=Al;if(t!==null)throw t}}function _i(t,e,n,a){Zs=!1;var l=t.updateQueue;fa=!1;var c=l.firstBaseUpdate,d=l.lastBaseUpdate,g=l.shared.pending;if(g!==null){l.shared.pending=null;var S=g,M=S.next;S.next=null,d===null?c=M:d.next=M,d=S;var q=t.alternate;q!==null&&(q=q.updateQueue,g=q.lastBaseUpdate,g!==d&&(g===null?q.firstBaseUpdate=M:g.next=M,q.lastBaseUpdate=S))}if(c!==null){var K=l.baseState;d=0,q=M=S=null,g=c;do{var C=g.lane&-536870913,j=C!==g.lane;if(j?(Nt&C)===C:(a&C)===C){C!==0&&C===Tl&&(Zs=!0),q!==null&&(q=q.next={lane:0,tag:g.tag,payload:g.payload,callback:null,next:null});t:{var ft=t,bt=g;C=e;var Qt=n;switch(bt.tag){case 1:if(ft=bt.payload,typeof ft=="function"){K=ft.call(Qt,K,C);break t}K=ft;break t;case 3:ft.flags=ft.flags&-65537|128;case 0:if(ft=bt.payload,C=typeof ft=="function"?ft.call(Qt,K,C):ft,C==null)break t;K=p({},K,C);break t;case 2:fa=!0}}C=g.callback,C!==null&&(t.flags|=64,j&&(t.flags|=8192),j=l.callbacks,j===null?l.callbacks=[C]:j.push(C))}else j={lane:C,tag:g.tag,payload:g.payload,callback:g.callback,next:null},q===null?(M=q=j,S=K):q=q.next=j,d|=C;if(g=g.next,g===null){if(g=l.shared.pending,g===null)break;j=g,g=j.next,j.next=null,l.lastBaseUpdate=j,l.shared.pending=null}}while(!0);q===null&&(S=K),l.baseState=S,l.firstBaseUpdate=M,l.lastBaseUpdate=q,c===null&&(l.shared.lanes=0),ga|=d,t.lanes=d,t.memoizedState=K}}function N0(t,e){if(typeof t!="function")throw Error(s(191,t));t.call(e)}function M0(t,e){var n=t.callbacks;if(n!==null)for(t.callbacks=null,t=0;t<n.length;t++)N0(n[t],e)}var Ol=E(null),Du=E(0);function U0(t,e){t=Jn,k(Du,t),k(Ol,e),Jn=t|e.baseLanes}function Xs(){k(Du,Jn),k(Ol,Ol.current)}function Vs(){Jn=Du.current,R(Ol),R(Du)}var $e=E(null),hn=null;function da(t){var e=t.alternate;k(se,se.current&1),k($e,t),hn===null&&(e===null||Ol.current!==null||e.memoizedState!==null)&&(hn=t)}function Qs(t){k(se,se.current),k($e,t),hn===null&&(hn=t)}function C0(t){t.tag===22?(k(se,se.current),k($e,t),hn===null&&(hn=t)):ha()}function ha(){k(se,se.current),k($e,$e.current)}function Pe(t){R($e),hn===t&&(hn=null),R(se)}var se=E(0);function zu(t){for(var e=t;e!==null;){if(e.tag===13){var n=e.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||$f(n)||Pf(n)))return e}else if(e.tag===19&&(e.memoizedProps.revealOrder==="forwards"||e.memoizedProps.revealOrder==="backwards"||e.memoizedProps.revealOrder==="unstable_legacy-backwards"||e.memoizedProps.revealOrder==="together")){if((e.flags&128)!==0)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var Gn=0,Tt=null,Xt=null,me=null,Nu=!1,Rl=!1,Ja=!1,Mu=0,pi=0,Dl=null,yy=0;function ie(){throw Error(s(321))}function Fs(t,e){if(e===null)return!1;for(var n=0;n<e.length&&n<t.length;n++)if(!Ie(t[n],e[n]))return!1;return!0}function Ks(t,e,n,a,l,c){return Gn=c,Tt=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,N.H=t===null||t.memoizedState===null?v2:ff,Ja=!1,c=n(a,l),Ja=!1,Rl&&(c=H0(e,n,a,l)),L0(t),c}function L0(t){N.H=Ei;var e=Xt!==null&&Xt.next!==null;if(Gn=0,me=Xt=Tt=null,Nu=!1,pi=0,Dl=null,e)throw Error(s(300));t===null||ye||(t=t.dependencies,t!==null&&Eu(t)&&(ye=!0))}function H0(t,e,n,a){Tt=t;var l=0;do{if(Rl&&(Dl=null),pi=0,Rl=!1,25<=l)throw Error(s(301));if(l+=1,me=Xt=null,t.updateQueue!=null){var c=t.updateQueue;c.lastEffect=null,c.events=null,c.stores=null,c.memoCache!=null&&(c.memoCache.index=0)}N.H=_2,c=e(n,a)}while(Rl);return c}function gy(){var t=N.H,e=t.useState()[0];return e=typeof e.then=="function"?bi(e):e,t=t.useState()[0],(Xt!==null?Xt.memoizedState:null)!==t&&(Tt.flags|=1024),e}function Js(){var t=Mu!==0;return Mu=0,t}function ks(t,e,n){e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~n}function Is(t){if(Nu){for(t=t.memoizedState;t!==null;){var e=t.queue;e!==null&&(e.pending=null),t=t.next}Nu=!1}Gn=0,me=Xt=Tt=null,Rl=!1,pi=Mu=0,Dl=null}function Ye(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return me===null?Tt.memoizedState=me=t:me=me.next=t,me}function fe(){if(Xt===null){var t=Tt.alternate;t=t!==null?t.memoizedState:null}else t=Xt.next;var e=me===null?Tt.memoizedState:me.next;if(e!==null)me=e,Xt=t;else{if(t===null)throw Tt.alternate===null?Error(s(467)):Error(s(310));Xt=t,t={memoizedState:Xt.memoizedState,baseState:Xt.baseState,baseQueue:Xt.baseQueue,queue:Xt.queue,next:null},me===null?Tt.memoizedState=me=t:me=me.next=t}return me}function Uu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function bi(t){var e=pi;return pi+=1,Dl===null&&(Dl=[]),t=w0(Dl,t,e),e=Tt,(me===null?e.memoizedState:me.next)===null&&(e=e.alternate,N.H=e===null||e.memoizedState===null?v2:ff),t}function Cu(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return bi(t);if(t.$$typeof===$)return Re(t)}throw Error(s(438,String(t)))}function Ws(t){var e=null,n=Tt.updateQueue;if(n!==null&&(e=n.memoCache),e==null){var a=Tt.alternate;a!==null&&(a=a.updateQueue,a!==null&&(a=a.memoCache,a!=null&&(e={data:a.data.map(function(l){return l.slice()}),index:0})))}if(e==null&&(e={data:[],index:0}),n===null&&(n=Uu(),Tt.updateQueue=n),n.memoCache=e,n=e.data[e.index],n===void 0)for(n=e.data[e.index]=Array(t),a=0;a<t;a++)n[a]=st;return e.index++,n}function qn(t,e){return typeof e=="function"?e(t):e}function Lu(t){var e=fe();return $s(e,Xt,t)}function $s(t,e,n){var a=t.queue;if(a===null)throw Error(s(311));a.lastRenderedReducer=n;var l=t.baseQueue,c=a.pending;if(c!==null){if(l!==null){var d=l.next;l.next=c.next,c.next=d}e.baseQueue=l=c,a.pending=null}if(c=t.baseState,l===null)t.memoizedState=c;else{e=l.next;var g=d=null,S=null,M=e,q=!1;do{var K=M.lane&-536870913;if(K!==M.lane?(Nt&K)===K:(Gn&K)===K){var C=M.revertLane;if(C===0)S!==null&&(S=S.next={lane:0,revertLane:0,gesture:null,action:M.action,hasEagerState:M.hasEagerState,eagerState:M.eagerState,next:null}),K===Tl&&(q=!0);else if((Gn&C)===C){M=M.next,C===Tl&&(q=!0);continue}else K={lane:0,revertLane:M.revertLane,gesture:null,action:M.action,hasEagerState:M.hasEagerState,eagerState:M.eagerState,next:null},S===null?(g=S=K,d=c):S=S.next=K,Tt.lanes|=C,ga|=C;K=M.action,Ja&&n(c,K),c=M.hasEagerState?M.eagerState:n(c,K)}else C={lane:K,revertLane:M.revertLane,gesture:M.gesture,action:M.action,hasEagerState:M.hasEagerState,eagerState:M.eagerState,next:null},S===null?(g=S=C,d=c):S=S.next=C,Tt.lanes|=K,ga|=K;M=M.next}while(M!==null&&M!==e);if(S===null?d=c:S.next=g,!Ie(c,t.memoizedState)&&(ye=!0,q&&(n=Al,n!==null)))throw n;t.memoizedState=c,t.baseState=d,t.baseQueue=S,a.lastRenderedState=c}return l===null&&(a.lanes=0),[t.memoizedState,a.dispatch]}function Ps(t){var e=fe(),n=e.queue;if(n===null)throw Error(s(311));n.lastRenderedReducer=t;var a=n.dispatch,l=n.pending,c=e.memoizedState;if(l!==null){n.pending=null;var d=l=l.next;do c=t(c,d.action),d=d.next;while(d!==l);Ie(c,e.memoizedState)||(ye=!0),e.memoizedState=c,e.baseQueue===null&&(e.baseState=c),n.lastRenderedState=c}return[c,a]}function j0(t,e,n){var a=Tt,l=fe(),c=Ut;if(c){if(n===void 0)throw Error(s(407));n=n()}else n=e();var d=!Ie((Xt||l).memoizedState,n);if(d&&(l.memoizedState=n,ye=!0),l=l.queue,nf(G0.bind(null,a,l,t),[t]),l.getSnapshot!==e||d||me!==null&&me.memoizedState.tag&1){if(a.flags|=2048,zl(9,{destroy:void 0},Y0.bind(null,a,l,n,e),null),Kt===null)throw Error(s(349));c||(Gn&127)!==0||B0(a,e,n)}return n}function B0(t,e,n){t.flags|=16384,t={getSnapshot:e,value:n},e=Tt.updateQueue,e===null?(e=Uu(),Tt.updateQueue=e,e.stores=[t]):(n=e.stores,n===null?e.stores=[t]:n.push(t))}function Y0(t,e,n,a){e.value=n,e.getSnapshot=a,q0(e)&&Z0(t)}function G0(t,e,n){return n(function(){q0(e)&&Z0(t)})}function q0(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!Ie(t,n)}catch{return!0}}function Z0(t){var e=Ya(t,2);e!==null&&Je(e,t,2)}function tf(t){var e=Ye();if(typeof t=="function"){var n=t;if(t=n(),Ja){tt(!0);try{n()}finally{tt(!1)}}}return e.memoizedState=e.baseState=t,e.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:qn,lastRenderedState:t},e}function X0(t,e,n,a){return t.baseState=n,$s(t,Xt,typeof a=="function"?a:qn)}function vy(t,e,n,a,l){if(Bu(t))throw Error(s(485));if(t=e.action,t!==null){var c={payload:l,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(d){c.listeners.push(d)}};N.T!==null?n(!0):c.isTransition=!1,a(c),n=e.pending,n===null?(c.next=e.pending=c,V0(e,c)):(c.next=n.next,e.pending=n.next=c)}}function V0(t,e){var n=e.action,a=e.payload,l=t.state;if(e.isTransition){var c=N.T,d={};N.T=d;try{var g=n(l,a),S=N.S;S!==null&&S(d,g),Q0(t,e,g)}catch(M){ef(t,e,M)}finally{c!==null&&d.types!==null&&(c.types=d.types),N.T=c}}else try{c=n(l,a),Q0(t,e,c)}catch(M){ef(t,e,M)}}function Q0(t,e,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(a){F0(t,e,a)},function(a){return ef(t,e,a)}):F0(t,e,n)}function F0(t,e,n){e.status="fulfilled",e.value=n,K0(e),t.state=n,e=t.pending,e!==null&&(n=e.next,n===e?t.pending=null:(n=n.next,e.next=n,V0(t,n)))}function ef(t,e,n){var a=t.pending;if(t.pending=null,a!==null){a=a.next;do e.status="rejected",e.reason=n,K0(e),e=e.next;while(e!==a)}t.action=null}function K0(t){t=t.listeners;for(var e=0;e<t.length;e++)(0,t[e])()}function J0(t,e){return e}function k0(t,e){if(Ut){var n=Kt.formState;if(n!==null){t:{var a=Tt;if(Ut){if(It){e:{for(var l=It,c=dn;l.nodeType!==8;){if(!c){l=null;break e}if(l=mn(l.nextSibling),l===null){l=null;break e}}c=l.data,l=c==="F!"||c==="F"?l:null}if(l){It=mn(l.nextSibling),a=l.data==="F!";break t}}ca(a)}a=!1}a&&(e=n[0])}}return n=Ye(),n.memoizedState=n.baseState=e,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:J0,lastRenderedState:e},n.queue=a,n=m2.bind(null,Tt,a),a.dispatch=n,a=tf(!1),c=sf.bind(null,Tt,!1,a.queue),a=Ye(),l={state:e,dispatch:null,action:t,pending:null},a.queue=l,n=vy.bind(null,Tt,l,c,n),l.dispatch=n,a.memoizedState=t,[e,n,!1]}function I0(t){var e=fe();return W0(e,Xt,t)}function W0(t,e,n){if(e=$s(t,e,J0)[0],t=Lu(qn)[0],typeof e=="object"&&e!==null&&typeof e.then=="function")try{var a=bi(e)}catch(d){throw d===xl?xu:d}else a=e;e=fe();var l=e.queue,c=l.dispatch;return n!==e.memoizedState&&(Tt.flags|=2048,zl(9,{destroy:void 0},_y.bind(null,l,n),null)),[a,c,t]}function _y(t,e){t.action=e}function $0(t){var e=fe(),n=Xt;if(n!==null)return W0(e,n,t);fe(),e=e.memoizedState,n=fe();var a=n.queue.dispatch;return n.memoizedState=t,[e,a,!1]}function zl(t,e,n,a){return t={tag:t,create:n,deps:a,inst:e,next:null},e=Tt.updateQueue,e===null&&(e=Uu(),Tt.updateQueue=e),n=e.lastEffect,n===null?e.lastEffect=t.next=t:(a=n.next,n.next=t,t.next=a,e.lastEffect=t),t}function P0(){return fe().memoizedState}function Hu(t,e,n,a){var l=Ye();Tt.flags|=t,l.memoizedState=zl(1|e,{destroy:void 0},n,a===void 0?null:a)}function ju(t,e,n,a){var l=fe();a=a===void 0?null:a;var c=l.memoizedState.inst;Xt!==null&&a!==null&&Fs(a,Xt.memoizedState.deps)?l.memoizedState=zl(e,c,n,a):(Tt.flags|=t,l.memoizedState=zl(1|e,c,n,a))}function t2(t,e){Hu(8390656,8,t,e)}function nf(t,e){ju(2048,8,t,e)}function py(t){Tt.flags|=4;var e=Tt.updateQueue;if(e===null)e=Uu(),Tt.updateQueue=e,e.events=[t];else{var n=e.events;n===null?e.events=[t]:n.push(t)}}function e2(t){var e=fe().memoizedState;return py({ref:e,nextImpl:t}),function(){if((Bt&2)!==0)throw Error(s(440));return e.impl.apply(void 0,arguments)}}function n2(t,e){return ju(4,2,t,e)}function a2(t,e){return ju(4,4,t,e)}function l2(t,e){if(typeof e=="function"){t=t();var n=e(t);return function(){typeof n=="function"?n():e(null)}}if(e!=null)return t=t(),e.current=t,function(){e.current=null}}function i2(t,e,n){n=n!=null?n.concat([t]):null,ju(4,4,l2.bind(null,e,t),n)}function af(){}function u2(t,e){var n=fe();e=e===void 0?null:e;var a=n.memoizedState;return e!==null&&Fs(e,a[1])?a[0]:(n.memoizedState=[t,e],t)}function c2(t,e){var n=fe();e=e===void 0?null:e;var a=n.memoizedState;if(e!==null&&Fs(e,a[1]))return a[0];if(a=t(),Ja){tt(!0);try{t()}finally{tt(!1)}}return n.memoizedState=[a,e],a}function lf(t,e,n){return n===void 0||(Gn&1073741824)!==0&&(Nt&261930)===0?t.memoizedState=e:(t.memoizedState=n,t=sd(),Tt.lanes|=t,ga|=t,n)}function s2(t,e,n,a){return Ie(n,e)?n:Ol.current!==null?(t=lf(t,n,a),Ie(t,e)||(ye=!0),t):(Gn&42)===0||(Gn&1073741824)!==0&&(Nt&261930)===0?(ye=!0,t.memoizedState=n):(t=sd(),Tt.lanes|=t,ga|=t,e)}function f2(t,e,n,a,l){var c=V.p;V.p=c!==0&&8>c?c:8;var d=N.T,g={};N.T=g,sf(t,!1,e,n);try{var S=l(),M=N.S;if(M!==null&&M(g,S),S!==null&&typeof S=="object"&&typeof S.then=="function"){var q=my(S,a);Si(t,e,q,nn(t))}else Si(t,e,a,nn(t))}catch(K){Si(t,e,{then:function(){},status:"rejected",reason:K},nn())}finally{V.p=c,d!==null&&g.types!==null&&(d.types=g.types),N.T=d}}function by(){}function uf(t,e,n,a){if(t.tag!==5)throw Error(s(476));var l=r2(t).queue;f2(t,l,e,lt,n===null?by:function(){return o2(t),n(a)})}function r2(t){var e=t.memoizedState;if(e!==null)return e;e={memoizedState:lt,baseState:lt,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:qn,lastRenderedState:lt},next:null};var n={};return e.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:qn,lastRenderedState:n},next:null},t.memoizedState=e,t=t.alternate,t!==null&&(t.memoizedState=e),e}function o2(t){var e=r2(t);e.next===null&&(e=t.alternate.memoizedState),Si(t,e.next.queue,{},nn())}function cf(){return Re(Bi)}function d2(){return fe().memoizedState}function h2(){return fe().memoizedState}function Sy(t){for(var e=t.return;e!==null;){switch(e.tag){case 24:case 3:var n=nn();t=ra(n);var a=oa(e,t,n);a!==null&&(Je(a,e,n),gi(a,e,n)),e={cache:Ls()},t.payload=e;return}e=e.return}}function Ey(t,e,n){var a=nn();n={lane:a,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Bu(t)?y2(e,n):(n=As(t,e,n,a),n!==null&&(Je(n,t,a),g2(n,e,a)))}function m2(t,e,n){var a=nn();Si(t,e,n,a)}function Si(t,e,n,a){var l={lane:a,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Bu(t))y2(e,l);else{var c=t.alternate;if(t.lanes===0&&(c===null||c.lanes===0)&&(c=e.lastRenderedReducer,c!==null))try{var d=e.lastRenderedState,g=c(d,n);if(l.hasEagerState=!0,l.eagerState=g,Ie(g,d))return _u(t,e,l,0),Kt===null&&vu(),!1}catch{}finally{}if(n=As(t,e,l,a),n!==null)return Je(n,t,a),g2(n,e,a),!0}return!1}function sf(t,e,n,a){if(a={lane:2,revertLane:Gf(),gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Bu(t)){if(e)throw Error(s(479))}else e=As(t,n,a,2),e!==null&&Je(e,t,2)}function Bu(t){var e=t.alternate;return t===Tt||e!==null&&e===Tt}function y2(t,e){Rl=Nu=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function g2(t,e,n){if((n&4194048)!==0){var a=e.lanes;a&=t.pendingLanes,n|=a,e.lanes=n,So(t,n)}}var Ei={readContext:Re,use:Cu,useCallback:ie,useContext:ie,useEffect:ie,useImperativeHandle:ie,useLayoutEffect:ie,useInsertionEffect:ie,useMemo:ie,useReducer:ie,useRef:ie,useState:ie,useDebugValue:ie,useDeferredValue:ie,useTransition:ie,useSyncExternalStore:ie,useId:ie,useHostTransitionStatus:ie,useFormState:ie,useActionState:ie,useOptimistic:ie,useMemoCache:ie,useCacheRefresh:ie};Ei.useEffectEvent=ie;var v2={readContext:Re,use:Cu,useCallback:function(t,e){return Ye().memoizedState=[t,e===void 0?null:e],t},useContext:Re,useEffect:t2,useImperativeHandle:function(t,e,n){n=n!=null?n.concat([t]):null,Hu(4194308,4,l2.bind(null,e,t),n)},useLayoutEffect:function(t,e){return Hu(4194308,4,t,e)},useInsertionEffect:function(t,e){Hu(4,2,t,e)},useMemo:function(t,e){var n=Ye();e=e===void 0?null:e;var a=t();if(Ja){tt(!0);try{t()}finally{tt(!1)}}return n.memoizedState=[a,e],a},useReducer:function(t,e,n){var a=Ye();if(n!==void 0){var l=n(e);if(Ja){tt(!0);try{n(e)}finally{tt(!1)}}}else l=e;return a.memoizedState=a.baseState=l,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:l},a.queue=t,t=t.dispatch=Ey.bind(null,Tt,t),[a.memoizedState,t]},useRef:function(t){var e=Ye();return t={current:t},e.memoizedState=t},useState:function(t){t=tf(t);var e=t.queue,n=m2.bind(null,Tt,e);return e.dispatch=n,[t.memoizedState,n]},useDebugValue:af,useDeferredValue:function(t,e){var n=Ye();return lf(n,t,e)},useTransition:function(){var t=tf(!1);return t=f2.bind(null,Tt,t.queue,!0,!1),Ye().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,e,n){var a=Tt,l=Ye();if(Ut){if(n===void 0)throw Error(s(407));n=n()}else{if(n=e(),Kt===null)throw Error(s(349));(Nt&127)!==0||B0(a,e,n)}l.memoizedState=n;var c={value:n,getSnapshot:e};return l.queue=c,t2(G0.bind(null,a,c,t),[t]),a.flags|=2048,zl(9,{destroy:void 0},Y0.bind(null,a,c,n,e),null),n},useId:function(){var t=Ye(),e=Kt.identifierPrefix;if(Ut){var n=Rn,a=On;n=(a&~(1<<32-F(a)-1)).toString(32)+n,e="_"+e+"R_"+n,n=Mu++,0<n&&(e+="H"+n.toString(32)),e+="_"}else n=yy++,e="_"+e+"r_"+n.toString(32)+"_";return t.memoizedState=e},useHostTransitionStatus:cf,useFormState:k0,useActionState:k0,useOptimistic:function(t){var e=Ye();e.memoizedState=e.baseState=t;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return e.queue=n,e=sf.bind(null,Tt,!0,n),n.dispatch=e,[t,e]},useMemoCache:Ws,useCacheRefresh:function(){return Ye().memoizedState=Sy.bind(null,Tt)},useEffectEvent:function(t){var e=Ye(),n={impl:t};return e.memoizedState=n,function(){if((Bt&2)!==0)throw Error(s(440));return n.impl.apply(void 0,arguments)}}},ff={readContext:Re,use:Cu,useCallback:u2,useContext:Re,useEffect:nf,useImperativeHandle:i2,useInsertionEffect:n2,useLayoutEffect:a2,useMemo:c2,useReducer:Lu,useRef:P0,useState:function(){return Lu(qn)},useDebugValue:af,useDeferredValue:function(t,e){var n=fe();return s2(n,Xt.memoizedState,t,e)},useTransition:function(){var t=Lu(qn)[0],e=fe().memoizedState;return[typeof t=="boolean"?t:bi(t),e]},useSyncExternalStore:j0,useId:d2,useHostTransitionStatus:cf,useFormState:I0,useActionState:I0,useOptimistic:function(t,e){var n=fe();return X0(n,Xt,t,e)},useMemoCache:Ws,useCacheRefresh:h2};ff.useEffectEvent=e2;var _2={readContext:Re,use:Cu,useCallback:u2,useContext:Re,useEffect:nf,useImperativeHandle:i2,useInsertionEffect:n2,useLayoutEffect:a2,useMemo:c2,useReducer:Ps,useRef:P0,useState:function(){return Ps(qn)},useDebugValue:af,useDeferredValue:function(t,e){var n=fe();return Xt===null?lf(n,t,e):s2(n,Xt.memoizedState,t,e)},useTransition:function(){var t=Ps(qn)[0],e=fe().memoizedState;return[typeof t=="boolean"?t:bi(t),e]},useSyncExternalStore:j0,useId:d2,useHostTransitionStatus:cf,useFormState:$0,useActionState:$0,useOptimistic:function(t,e){var n=fe();return Xt!==null?X0(n,Xt,t,e):(n.baseState=t,[t,n.queue.dispatch])},useMemoCache:Ws,useCacheRefresh:h2};_2.useEffectEvent=e2;function rf(t,e,n,a){e=t.memoizedState,n=n(a,e),n=n==null?e:p({},e,n),t.memoizedState=n,t.lanes===0&&(t.updateQueue.baseState=n)}var of={enqueueSetState:function(t,e,n){t=t._reactInternals;var a=nn(),l=ra(a);l.payload=e,n!=null&&(l.callback=n),e=oa(t,l,a),e!==null&&(Je(e,t,a),gi(e,t,a))},enqueueReplaceState:function(t,e,n){t=t._reactInternals;var a=nn(),l=ra(a);l.tag=1,l.payload=e,n!=null&&(l.callback=n),e=oa(t,l,a),e!==null&&(Je(e,t,a),gi(e,t,a))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var n=nn(),a=ra(n);a.tag=2,e!=null&&(a.callback=e),e=oa(t,a,n),e!==null&&(Je(e,t,n),gi(e,t,n))}};function p2(t,e,n,a,l,c,d){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(a,c,d):e.prototype&&e.prototype.isPureReactComponent?!si(n,a)||!si(l,c):!0}function b2(t,e,n,a){t=e.state,typeof e.componentWillReceiveProps=="function"&&e.componentWillReceiveProps(n,a),typeof e.UNSAFE_componentWillReceiveProps=="function"&&e.UNSAFE_componentWillReceiveProps(n,a),e.state!==t&&of.enqueueReplaceState(e,e.state,null)}function ka(t,e){var n=e;if("ref"in e){n={};for(var a in e)a!=="ref"&&(n[a]=e[a])}if(t=t.defaultProps){n===e&&(n=p({},n));for(var l in t)n[l]===void 0&&(n[l]=t[l])}return n}function S2(t){gu(t)}function E2(t){console.error(t)}function T2(t){gu(t)}function Yu(t,e){try{var n=t.onUncaughtError;n(e.value,{componentStack:e.stack})}catch(a){setTimeout(function(){throw a})}}function A2(t,e,n){try{var a=t.onCaughtError;a(n.value,{componentStack:n.stack,errorBoundary:e.tag===1?e.stateNode:null})}catch(l){setTimeout(function(){throw l})}}function df(t,e,n){return n=ra(n),n.tag=3,n.payload={element:null},n.callback=function(){Yu(t,e)},n}function x2(t){return t=ra(t),t.tag=3,t}function w2(t,e,n,a){var l=n.type.getDerivedStateFromError;if(typeof l=="function"){var c=a.value;t.payload=function(){return l(c)},t.callback=function(){A2(e,n,a)}}var d=n.stateNode;d!==null&&typeof d.componentDidCatch=="function"&&(t.callback=function(){A2(e,n,a),typeof l!="function"&&(va===null?va=new Set([this]):va.add(this));var g=a.stack;this.componentDidCatch(a.value,{componentStack:g!==null?g:""})})}function Ty(t,e,n,a,l){if(n.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){if(e=n.alternate,e!==null&&El(e,n,l,!0),n=$e.current,n!==null){switch(n.tag){case 31:case 13:return hn===null?Wu():n.alternate===null&&ue===0&&(ue=3),n.flags&=-257,n.flags|=65536,n.lanes=l,a===wu?n.flags|=16384:(e=n.updateQueue,e===null?n.updateQueue=new Set([a]):e.add(a),jf(t,a,l)),!1;case 22:return n.flags|=65536,a===wu?n.flags|=16384:(e=n.updateQueue,e===null?(e={transitions:null,markerInstances:null,retryQueue:new Set([a])},n.updateQueue=e):(n=e.retryQueue,n===null?e.retryQueue=new Set([a]):n.add(a)),jf(t,a,l)),!1}throw Error(s(435,n.tag))}return jf(t,a,l),Wu(),!1}if(Ut)return e=$e.current,e!==null?((e.flags&65536)===0&&(e.flags|=256),e.flags|=65536,e.lanes=l,a!==zs&&(t=Error(s(422),{cause:a}),oi(fn(t,n)))):(a!==zs&&(e=Error(s(423),{cause:a}),oi(fn(e,n))),t=t.current.alternate,t.flags|=65536,l&=-l,t.lanes|=l,a=fn(a,n),l=df(t.stateNode,a,l),qs(t,l),ue!==4&&(ue=2)),!1;var c=Error(s(520),{cause:a});if(c=fn(c,n),zi===null?zi=[c]:zi.push(c),ue!==4&&(ue=2),e===null)return!0;a=fn(a,n),n=e;do{switch(n.tag){case 3:return n.flags|=65536,t=l&-l,n.lanes|=t,t=df(n.stateNode,a,t),qs(n,t),!1;case 1:if(e=n.type,c=n.stateNode,(n.flags&128)===0&&(typeof e.getDerivedStateFromError=="function"||c!==null&&typeof c.componentDidCatch=="function"&&(va===null||!va.has(c))))return n.flags|=65536,l&=-l,n.lanes|=l,l=x2(l),w2(l,t,n,a),qs(n,l),!1}n=n.return}while(n!==null);return!1}var hf=Error(s(461)),ye=!1;function De(t,e,n,a){e.child=t===null?z0(e,null,n,a):Ka(e,t.child,n,a)}function O2(t,e,n,a,l){n=n.render;var c=e.ref;if("ref"in a){var d={};for(var g in a)g!=="ref"&&(d[g]=a[g])}else d=a;return Xa(e),a=Ks(t,e,n,d,c,l),g=Js(),t!==null&&!ye?(ks(t,e,l),Zn(t,e,l)):(Ut&&g&&Rs(e),e.flags|=1,De(t,e,a,l),e.child)}function R2(t,e,n,a,l){if(t===null){var c=n.type;return typeof c=="function"&&!xs(c)&&c.defaultProps===void 0&&n.compare===null?(e.tag=15,e.type=c,D2(t,e,c,a,l)):(t=bu(n.type,null,a,e,e.mode,l),t.ref=e.ref,t.return=e,e.child=t)}if(c=t.child,!Sf(t,l)){var d=c.memoizedProps;if(n=n.compare,n=n!==null?n:si,n(d,a)&&t.ref===e.ref)return Zn(t,e,l)}return e.flags|=1,t=Hn(c,a),t.ref=e.ref,t.return=e,e.child=t}function D2(t,e,n,a,l){if(t!==null){var c=t.memoizedProps;if(si(c,a)&&t.ref===e.ref)if(ye=!1,e.pendingProps=a=c,Sf(t,l))(t.flags&131072)!==0&&(ye=!0);else return e.lanes=t.lanes,Zn(t,e,l)}return mf(t,e,n,a,l)}function z2(t,e,n,a){var l=a.children,c=t!==null?t.memoizedState:null;if(t===null&&e.stateNode===null&&(e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),a.mode==="hidden"){if((e.flags&128)!==0){if(c=c!==null?c.baseLanes|n:n,t!==null){for(a=e.child=t.child,l=0;a!==null;)l=l|a.lanes|a.childLanes,a=a.sibling;a=l&~c}else a=0,e.child=null;return N2(t,e,c,n,a)}if((n&536870912)!==0)e.memoizedState={baseLanes:0,cachePool:null},t!==null&&Au(e,c!==null?c.cachePool:null),c!==null?U0(e,c):Xs(),C0(e);else return a=e.lanes=536870912,N2(t,e,c!==null?c.baseLanes|n:n,n,a)}else c!==null?(Au(e,c.cachePool),U0(e,c),ha(),e.memoizedState=null):(t!==null&&Au(e,null),Xs(),ha());return De(t,e,l,n),e.child}function Ti(t,e){return t!==null&&t.tag===22||e.stateNode!==null||(e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),e.sibling}function N2(t,e,n,a,l){var c=js();return c=c===null?null:{parent:he._currentValue,pool:c},e.memoizedState={baseLanes:n,cachePool:c},t!==null&&Au(e,null),Xs(),C0(e),t!==null&&El(t,e,a,!0),e.childLanes=l,null}function Gu(t,e){return e=Zu({mode:e.mode,children:e.children},t.mode),e.ref=t.ref,t.child=e,e.return=t,e}function M2(t,e,n){return Ka(e,t.child,null,n),t=Gu(e,e.pendingProps),t.flags|=2,Pe(e),e.memoizedState=null,t}function Ay(t,e,n){var a=e.pendingProps,l=(e.flags&128)!==0;if(e.flags&=-129,t===null){if(Ut){if(a.mode==="hidden")return t=Gu(e,a),e.lanes=536870912,Ti(null,t);if(Qs(e),(t=It)?(t=Vd(t,dn),t=t!==null&&t.data==="&"?t:null,t!==null&&(e.memoizedState={dehydrated:t,treeContext:ia!==null?{id:On,overflow:Rn}:null,retryLane:536870912,hydrationErrors:null},n=y0(t),n.return=e,e.child=n,Oe=e,It=null)):t=null,t===null)throw ca(e);return e.lanes=536870912,null}return Gu(e,a)}var c=t.memoizedState;if(c!==null){var d=c.dehydrated;if(Qs(e),l)if(e.flags&256)e.flags&=-257,e=M2(t,e,n);else if(e.memoizedState!==null)e.child=t.child,e.flags|=128,e=null;else throw Error(s(558));else if(ye||El(t,e,n,!1),l=(n&t.childLanes)!==0,ye||l){if(a=Kt,a!==null&&(d=Eo(a,n),d!==0&&d!==c.retryLane))throw c.retryLane=d,Ya(t,d),Je(a,t,d),hf;Wu(),e=M2(t,e,n)}else t=c.treeContext,It=mn(d.nextSibling),Oe=e,Ut=!0,ua=null,dn=!1,t!==null&&_0(e,t),e=Gu(e,a),e.flags|=4096;return e}return t=Hn(t.child,{mode:a.mode,children:a.children}),t.ref=e.ref,e.child=t,t.return=e,t}function qu(t,e){var n=e.ref;if(n===null)t!==null&&t.ref!==null&&(e.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(s(284));(t===null||t.ref!==n)&&(e.flags|=4194816)}}function mf(t,e,n,a,l){return Xa(e),n=Ks(t,e,n,a,void 0,l),a=Js(),t!==null&&!ye?(ks(t,e,l),Zn(t,e,l)):(Ut&&a&&Rs(e),e.flags|=1,De(t,e,n,l),e.child)}function U2(t,e,n,a,l,c){return Xa(e),e.updateQueue=null,n=H0(e,a,n,l),L0(t),a=Js(),t!==null&&!ye?(ks(t,e,c),Zn(t,e,c)):(Ut&&a&&Rs(e),e.flags|=1,De(t,e,n,c),e.child)}function C2(t,e,n,a,l){if(Xa(e),e.stateNode===null){var c=_l,d=n.contextType;typeof d=="object"&&d!==null&&(c=Re(d)),c=new n(a,c),e.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,c.updater=of,e.stateNode=c,c._reactInternals=e,c=e.stateNode,c.props=a,c.state=e.memoizedState,c.refs={},Ys(e),d=n.contextType,c.context=typeof d=="object"&&d!==null?Re(d):_l,c.state=e.memoizedState,d=n.getDerivedStateFromProps,typeof d=="function"&&(rf(e,n,d,a),c.state=e.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof c.getSnapshotBeforeUpdate=="function"||typeof c.UNSAFE_componentWillMount!="function"&&typeof c.componentWillMount!="function"||(d=c.state,typeof c.componentWillMount=="function"&&c.componentWillMount(),typeof c.UNSAFE_componentWillMount=="function"&&c.UNSAFE_componentWillMount(),d!==c.state&&of.enqueueReplaceState(c,c.state,null),_i(e,a,c,l),vi(),c.state=e.memoizedState),typeof c.componentDidMount=="function"&&(e.flags|=4194308),a=!0}else if(t===null){c=e.stateNode;var g=e.memoizedProps,S=ka(n,g);c.props=S;var M=c.context,q=n.contextType;d=_l,typeof q=="object"&&q!==null&&(d=Re(q));var K=n.getDerivedStateFromProps;q=typeof K=="function"||typeof c.getSnapshotBeforeUpdate=="function",g=e.pendingProps!==g,q||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(g||M!==d)&&b2(e,c,a,d),fa=!1;var C=e.memoizedState;c.state=C,_i(e,a,c,l),vi(),M=e.memoizedState,g||C!==M||fa?(typeof K=="function"&&(rf(e,n,K,a),M=e.memoizedState),(S=fa||p2(e,n,S,a,C,M,d))?(q||typeof c.UNSAFE_componentWillMount!="function"&&typeof c.componentWillMount!="function"||(typeof c.componentWillMount=="function"&&c.componentWillMount(),typeof c.UNSAFE_componentWillMount=="function"&&c.UNSAFE_componentWillMount()),typeof c.componentDidMount=="function"&&(e.flags|=4194308)):(typeof c.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=a,e.memoizedState=M),c.props=a,c.state=M,c.context=d,a=S):(typeof c.componentDidMount=="function"&&(e.flags|=4194308),a=!1)}else{c=e.stateNode,Gs(t,e),d=e.memoizedProps,q=ka(n,d),c.props=q,K=e.pendingProps,C=c.context,M=n.contextType,S=_l,typeof M=="object"&&M!==null&&(S=Re(M)),g=n.getDerivedStateFromProps,(M=typeof g=="function"||typeof c.getSnapshotBeforeUpdate=="function")||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(d!==K||C!==S)&&b2(e,c,a,S),fa=!1,C=e.memoizedState,c.state=C,_i(e,a,c,l),vi();var j=e.memoizedState;d!==K||C!==j||fa||t!==null&&t.dependencies!==null&&Eu(t.dependencies)?(typeof g=="function"&&(rf(e,n,g,a),j=e.memoizedState),(q=fa||p2(e,n,q,a,C,j,S)||t!==null&&t.dependencies!==null&&Eu(t.dependencies))?(M||typeof c.UNSAFE_componentWillUpdate!="function"&&typeof c.componentWillUpdate!="function"||(typeof c.componentWillUpdate=="function"&&c.componentWillUpdate(a,j,S),typeof c.UNSAFE_componentWillUpdate=="function"&&c.UNSAFE_componentWillUpdate(a,j,S)),typeof c.componentDidUpdate=="function"&&(e.flags|=4),typeof c.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof c.componentDidUpdate!="function"||d===t.memoizedProps&&C===t.memoizedState||(e.flags|=4),typeof c.getSnapshotBeforeUpdate!="function"||d===t.memoizedProps&&C===t.memoizedState||(e.flags|=1024),e.memoizedProps=a,e.memoizedState=j),c.props=a,c.state=j,c.context=S,a=q):(typeof c.componentDidUpdate!="function"||d===t.memoizedProps&&C===t.memoizedState||(e.flags|=4),typeof c.getSnapshotBeforeUpdate!="function"||d===t.memoizedProps&&C===t.memoizedState||(e.flags|=1024),a=!1)}return c=a,qu(t,e),a=(e.flags&128)!==0,c||a?(c=e.stateNode,n=a&&typeof n.getDerivedStateFromError!="function"?null:c.render(),e.flags|=1,t!==null&&a?(e.child=Ka(e,t.child,null,l),e.child=Ka(e,null,n,l)):De(t,e,n,l),e.memoizedState=c.state,t=e.child):t=Zn(t,e,l),t}function L2(t,e,n,a){return qa(),e.flags|=256,De(t,e,n,a),e.child}var yf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function gf(t){return{baseLanes:t,cachePool:A0()}}function vf(t,e,n){return t=t!==null?t.childLanes&~n:0,e&&(t|=en),t}function H2(t,e,n){var a=e.pendingProps,l=!1,c=(e.flags&128)!==0,d;if((d=c)||(d=t!==null&&t.memoizedState===null?!1:(se.current&2)!==0),d&&(l=!0,e.flags&=-129),d=(e.flags&32)!==0,e.flags&=-33,t===null){if(Ut){if(l?da(e):ha(),(t=It)?(t=Vd(t,dn),t=t!==null&&t.data!=="&"?t:null,t!==null&&(e.memoizedState={dehydrated:t,treeContext:ia!==null?{id:On,overflow:Rn}:null,retryLane:536870912,hydrationErrors:null},n=y0(t),n.return=e,e.child=n,Oe=e,It=null)):t=null,t===null)throw ca(e);return Pf(t)?e.lanes=32:e.lanes=536870912,null}var g=a.children;return a=a.fallback,l?(ha(),l=e.mode,g=Zu({mode:"hidden",children:g},l),a=Ga(a,l,n,null),g.return=e,a.return=e,g.sibling=a,e.child=g,a=e.child,a.memoizedState=gf(n),a.childLanes=vf(t,d,n),e.memoizedState=yf,Ti(null,a)):(da(e),_f(e,g))}var S=t.memoizedState;if(S!==null&&(g=S.dehydrated,g!==null)){if(c)e.flags&256?(da(e),e.flags&=-257,e=pf(t,e,n)):e.memoizedState!==null?(ha(),e.child=t.child,e.flags|=128,e=null):(ha(),g=a.fallback,l=e.mode,a=Zu({mode:"visible",children:a.children},l),g=Ga(g,l,n,null),g.flags|=2,a.return=e,g.return=e,a.sibling=g,e.child=a,Ka(e,t.child,null,n),a=e.child,a.memoizedState=gf(n),a.childLanes=vf(t,d,n),e.memoizedState=yf,e=Ti(null,a));else if(da(e),Pf(g)){if(d=g.nextSibling&&g.nextSibling.dataset,d)var M=d.dgst;d=M,a=Error(s(419)),a.stack="",a.digest=d,oi({value:a,source:null,stack:null}),e=pf(t,e,n)}else if(ye||El(t,e,n,!1),d=(n&t.childLanes)!==0,ye||d){if(d=Kt,d!==null&&(a=Eo(d,n),a!==0&&a!==S.retryLane))throw S.retryLane=a,Ya(t,a),Je(d,t,a),hf;$f(g)||Wu(),e=pf(t,e,n)}else $f(g)?(e.flags|=192,e.child=t.child,e=null):(t=S.treeContext,It=mn(g.nextSibling),Oe=e,Ut=!0,ua=null,dn=!1,t!==null&&_0(e,t),e=_f(e,a.children),e.flags|=4096);return e}return l?(ha(),g=a.fallback,l=e.mode,S=t.child,M=S.sibling,a=Hn(S,{mode:"hidden",children:a.children}),a.subtreeFlags=S.subtreeFlags&65011712,M!==null?g=Hn(M,g):(g=Ga(g,l,n,null),g.flags|=2),g.return=e,a.return=e,a.sibling=g,e.child=a,Ti(null,a),a=e.child,g=t.child.memoizedState,g===null?g=gf(n):(l=g.cachePool,l!==null?(S=he._currentValue,l=l.parent!==S?{parent:S,pool:S}:l):l=A0(),g={baseLanes:g.baseLanes|n,cachePool:l}),a.memoizedState=g,a.childLanes=vf(t,d,n),e.memoizedState=yf,Ti(t.child,a)):(da(e),n=t.child,t=n.sibling,n=Hn(n,{mode:"visible",children:a.children}),n.return=e,n.sibling=null,t!==null&&(d=e.deletions,d===null?(e.deletions=[t],e.flags|=16):d.push(t)),e.child=n,e.memoizedState=null,n)}function _f(t,e){return e=Zu({mode:"visible",children:e},t.mode),e.return=t,t.child=e}function Zu(t,e){return t=We(22,t,null,e),t.lanes=0,t}function pf(t,e,n){return Ka(e,t.child,null,n),t=_f(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function j2(t,e,n){t.lanes|=e;var a=t.alternate;a!==null&&(a.lanes|=e),Us(t.return,e,n)}function bf(t,e,n,a,l,c){var d=t.memoizedState;d===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:a,tail:n,tailMode:l,treeForkCount:c}:(d.isBackwards=e,d.rendering=null,d.renderingStartTime=0,d.last=a,d.tail=n,d.tailMode=l,d.treeForkCount=c)}function B2(t,e,n){var a=e.pendingProps,l=a.revealOrder,c=a.tail;a=a.children;var d=se.current,g=(d&2)!==0;if(g?(d=d&1|2,e.flags|=128):d&=1,k(se,d),De(t,e,a,n),a=Ut?ri:0,!g&&t!==null&&(t.flags&128)!==0)t:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&j2(t,n,e);else if(t.tag===19)j2(t,n,e);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break t;for(;t.sibling===null;){if(t.return===null||t.return===e)break t;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(l){case"forwards":for(n=e.child,l=null;n!==null;)t=n.alternate,t!==null&&zu(t)===null&&(l=n),n=n.sibling;n=l,n===null?(l=e.child,e.child=null):(l=n.sibling,n.sibling=null),bf(e,!1,l,n,c,a);break;case"backwards":case"unstable_legacy-backwards":for(n=null,l=e.child,e.child=null;l!==null;){if(t=l.alternate,t!==null&&zu(t)===null){e.child=l;break}t=l.sibling,l.sibling=n,n=l,l=t}bf(e,!0,n,null,c,a);break;case"together":bf(e,!1,null,null,void 0,a);break;default:e.memoizedState=null}return e.child}function Zn(t,e,n){if(t!==null&&(e.dependencies=t.dependencies),ga|=e.lanes,(n&e.childLanes)===0)if(t!==null){if(El(t,e,n,!1),(n&e.childLanes)===0)return null}else return null;if(t!==null&&e.child!==t.child)throw Error(s(153));if(e.child!==null){for(t=e.child,n=Hn(t,t.pendingProps),e.child=n,n.return=e;t.sibling!==null;)t=t.sibling,n=n.sibling=Hn(t,t.pendingProps),n.return=e;n.sibling=null}return e.child}function Sf(t,e){return(t.lanes&e)!==0?!0:(t=t.dependencies,!!(t!==null&&Eu(t)))}function xy(t,e,n){switch(e.tag){case 3:H(e,e.stateNode.containerInfo),sa(e,he,t.memoizedState.cache),qa();break;case 27:case 5:Yt(e);break;case 4:H(e,e.stateNode.containerInfo);break;case 10:sa(e,e.type,e.memoizedProps.value);break;case 31:if(e.memoizedState!==null)return e.flags|=128,Qs(e),null;break;case 13:var a=e.memoizedState;if(a!==null)return a.dehydrated!==null?(da(e),e.flags|=128,null):(n&e.child.childLanes)!==0?H2(t,e,n):(da(e),t=Zn(t,e,n),t!==null?t.sibling:null);da(e);break;case 19:var l=(t.flags&128)!==0;if(a=(n&e.childLanes)!==0,a||(El(t,e,n,!1),a=(n&e.childLanes)!==0),l){if(a)return B2(t,e,n);e.flags|=128}if(l=e.memoizedState,l!==null&&(l.rendering=null,l.tail=null,l.lastEffect=null),k(se,se.current),a)break;return null;case 22:return e.lanes=0,z2(t,e,n,e.pendingProps);case 24:sa(e,he,t.memoizedState.cache)}return Zn(t,e,n)}function Y2(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps)ye=!0;else{if(!Sf(t,n)&&(e.flags&128)===0)return ye=!1,xy(t,e,n);ye=(t.flags&131072)!==0}else ye=!1,Ut&&(e.flags&1048576)!==0&&v0(e,ri,e.index);switch(e.lanes=0,e.tag){case 16:t:{var a=e.pendingProps;if(t=Qa(e.elementType),e.type=t,typeof t=="function")xs(t)?(a=ka(t,a),e.tag=1,e=C2(null,e,t,a,n)):(e.tag=0,e=mf(null,e,t,a,n));else{if(t!=null){var l=t.$$typeof;if(l===I){e.tag=11,e=O2(null,e,t,a,n);break t}else if(l===X){e.tag=14,e=R2(null,e,t,a,n);break t}}throw e=yt(t)||t,Error(s(306,e,""))}}return e;case 0:return mf(t,e,e.type,e.pendingProps,n);case 1:return a=e.type,l=ka(a,e.pendingProps),C2(t,e,a,l,n);case 3:t:{if(H(e,e.stateNode.containerInfo),t===null)throw Error(s(387));a=e.pendingProps;var c=e.memoizedState;l=c.element,Gs(t,e),_i(e,a,null,n);var d=e.memoizedState;if(a=d.cache,sa(e,he,a),a!==c.cache&&Cs(e,[he],n,!0),vi(),a=d.element,c.isDehydrated)if(c={element:a,isDehydrated:!1,cache:d.cache},e.updateQueue.baseState=c,e.memoizedState=c,e.flags&256){e=L2(t,e,a,n);break t}else if(a!==l){l=fn(Error(s(424)),e),oi(l),e=L2(t,e,a,n);break t}else{switch(t=e.stateNode.containerInfo,t.nodeType){case 9:t=t.body;break;default:t=t.nodeName==="HTML"?t.ownerDocument.body:t}for(It=mn(t.firstChild),Oe=e,Ut=!0,ua=null,dn=!0,n=z0(e,null,a,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(qa(),a===l){e=Zn(t,e,n);break t}De(t,e,a,n)}e=e.child}return e;case 26:return qu(t,e),t===null?(n=Id(e.type,null,e.pendingProps,null))?e.memoizedState=n:Ut||(n=e.type,t=e.pendingProps,a=lc(L.current).createElement(n),a[we]=e,a[Ze]=t,ze(a,n,t),be(a),e.stateNode=a):e.memoizedState=Id(e.type,t.memoizedProps,e.pendingProps,t.memoizedState),null;case 27:return Yt(e),t===null&&Ut&&(a=e.stateNode=Kd(e.type,e.pendingProps,L.current),Oe=e,dn=!0,l=It,Sa(e.type)?(tr=l,It=mn(a.firstChild)):It=l),De(t,e,e.pendingProps.children,n),qu(t,e),t===null&&(e.flags|=4194304),e.child;case 5:return t===null&&Ut&&((l=a=It)&&(a=eg(a,e.type,e.pendingProps,dn),a!==null?(e.stateNode=a,Oe=e,It=mn(a.firstChild),dn=!1,l=!0):l=!1),l||ca(e)),Yt(e),l=e.type,c=e.pendingProps,d=t!==null?t.memoizedProps:null,a=c.children,kf(l,c)?a=null:d!==null&&kf(l,d)&&(e.flags|=32),e.memoizedState!==null&&(l=Ks(t,e,gy,null,null,n),Bi._currentValue=l),qu(t,e),De(t,e,a,n),e.child;case 6:return t===null&&Ut&&((t=n=It)&&(n=ng(n,e.pendingProps,dn),n!==null?(e.stateNode=n,Oe=e,It=null,t=!0):t=!1),t||ca(e)),null;case 13:return H2(t,e,n);case 4:return H(e,e.stateNode.containerInfo),a=e.pendingProps,t===null?e.child=Ka(e,null,a,n):De(t,e,a,n),e.child;case 11:return O2(t,e,e.type,e.pendingProps,n);case 7:return De(t,e,e.pendingProps,n),e.child;case 8:return De(t,e,e.pendingProps.children,n),e.child;case 12:return De(t,e,e.pendingProps.children,n),e.child;case 10:return a=e.pendingProps,sa(e,e.type,a.value),De(t,e,a.children,n),e.child;case 9:return l=e.type._context,a=e.pendingProps.children,Xa(e),l=Re(l),a=a(l),e.flags|=1,De(t,e,a,n),e.child;case 14:return R2(t,e,e.type,e.pendingProps,n);case 15:return D2(t,e,e.type,e.pendingProps,n);case 19:return B2(t,e,n);case 31:return Ay(t,e,n);case 22:return z2(t,e,n,e.pendingProps);case 24:return Xa(e),a=Re(he),t===null?(l=js(),l===null&&(l=Kt,c=Ls(),l.pooledCache=c,c.refCount++,c!==null&&(l.pooledCacheLanes|=n),l=c),e.memoizedState={parent:a,cache:l},Ys(e),sa(e,he,l)):((t.lanes&n)!==0&&(Gs(t,e),_i(e,null,null,n),vi()),l=t.memoizedState,c=e.memoizedState,l.parent!==a?(l={parent:a,cache:a},e.memoizedState=l,e.lanes===0&&(e.memoizedState=e.updateQueue.baseState=l),sa(e,he,a)):(a=c.cache,sa(e,he,a),a!==l.cache&&Cs(e,[he],n,!0))),De(t,e,e.pendingProps.children,n),e.child;case 29:throw e.pendingProps}throw Error(s(156,e.tag))}function Xn(t){t.flags|=4}function Ef(t,e,n,a,l){if((e=(t.mode&32)!==0)&&(e=!1),e){if(t.flags|=16777216,(l&335544128)===l)if(t.stateNode.complete)t.flags|=8192;else if(dd())t.flags|=8192;else throw Fa=wu,Bs}else t.flags&=-16777217}function G2(t,e){if(e.type!=="stylesheet"||(e.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!e1(e))if(dd())t.flags|=8192;else throw Fa=wu,Bs}function Xu(t,e){e!==null&&(t.flags|=4),t.flags&16384&&(e=t.tag!==22?po():536870912,t.lanes|=e,Cl|=e)}function Ai(t,e){if(!Ut)switch(t.tailMode){case"hidden":e=t.tail;for(var n=null;e!==null;)e.alternate!==null&&(n=e),e=e.sibling;n===null?t.tail=null:n.sibling=null;break;case"collapsed":n=t.tail;for(var a=null;n!==null;)n.alternate!==null&&(a=n),n=n.sibling;a===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:a.sibling=null}}function Wt(t){var e=t.alternate!==null&&t.alternate.child===t.child,n=0,a=0;if(e)for(var l=t.child;l!==null;)n|=l.lanes|l.childLanes,a|=l.subtreeFlags&65011712,a|=l.flags&65011712,l.return=t,l=l.sibling;else for(l=t.child;l!==null;)n|=l.lanes|l.childLanes,a|=l.subtreeFlags,a|=l.flags,l.return=t,l=l.sibling;return t.subtreeFlags|=a,t.childLanes=n,e}function wy(t,e,n){var a=e.pendingProps;switch(Ds(e),e.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Wt(e),null;case 1:return Wt(e),null;case 3:return n=e.stateNode,a=null,t!==null&&(a=t.memoizedState.cache),e.memoizedState.cache!==a&&(e.flags|=2048),Yn(he),ht(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(t===null||t.child===null)&&(Sl(e)?Xn(e):t===null||t.memoizedState.isDehydrated&&(e.flags&256)===0||(e.flags|=1024,Ns())),Wt(e),null;case 26:var l=e.type,c=e.memoizedState;return t===null?(Xn(e),c!==null?(Wt(e),G2(e,c)):(Wt(e),Ef(e,l,null,a,n))):c?c!==t.memoizedState?(Xn(e),Wt(e),G2(e,c)):(Wt(e),e.flags&=-16777217):(t=t.memoizedProps,t!==a&&Xn(e),Wt(e),Ef(e,l,t,a,n)),null;case 27:if(Ft(e),n=L.current,l=e.type,t!==null&&e.stateNode!=null)t.memoizedProps!==a&&Xn(e);else{if(!a){if(e.stateNode===null)throw Error(s(166));return Wt(e),null}t=w.current,Sl(e)?p0(e):(t=Kd(l,a,n),e.stateNode=t,Xn(e))}return Wt(e),null;case 5:if(Ft(e),l=e.type,t!==null&&e.stateNode!=null)t.memoizedProps!==a&&Xn(e);else{if(!a){if(e.stateNode===null)throw Error(s(166));return Wt(e),null}if(c=w.current,Sl(e))p0(e);else{var d=lc(L.current);switch(c){case 1:c=d.createElementNS("http://www.w3.org/2000/svg",l);break;case 2:c=d.createElementNS("http://www.w3.org/1998/Math/MathML",l);break;default:switch(l){case"svg":c=d.createElementNS("http://www.w3.org/2000/svg",l);break;case"math":c=d.createElementNS("http://www.w3.org/1998/Math/MathML",l);break;case"script":c=d.createElement("div"),c.innerHTML="<script><\/script>",c=c.removeChild(c.firstChild);break;case"select":c=typeof a.is=="string"?d.createElement("select",{is:a.is}):d.createElement("select"),a.multiple?c.multiple=!0:a.size&&(c.size=a.size);break;default:c=typeof a.is=="string"?d.createElement(l,{is:a.is}):d.createElement(l)}}c[we]=e,c[Ze]=a;t:for(d=e.child;d!==null;){if(d.tag===5||d.tag===6)c.appendChild(d.stateNode);else if(d.tag!==4&&d.tag!==27&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===e)break t;for(;d.sibling===null;){if(d.return===null||d.return===e)break t;d=d.return}d.sibling.return=d.return,d=d.sibling}e.stateNode=c;t:switch(ze(c,l,a),l){case"button":case"input":case"select":case"textarea":a=!!a.autoFocus;break t;case"img":a=!0;break t;default:a=!1}a&&Xn(e)}}return Wt(e),Ef(e,e.type,t===null?null:t.memoizedProps,e.pendingProps,n),null;case 6:if(t&&e.stateNode!=null)t.memoizedProps!==a&&Xn(e);else{if(typeof a!="string"&&e.stateNode===null)throw Error(s(166));if(t=L.current,Sl(e)){if(t=e.stateNode,n=e.memoizedProps,a=null,l=Oe,l!==null)switch(l.tag){case 27:case 5:a=l.memoizedProps}t[we]=e,t=!!(t.nodeValue===n||a!==null&&a.suppressHydrationWarning===!0||Hd(t.nodeValue,n)),t||ca(e,!0)}else t=lc(t).createTextNode(a),t[we]=e,e.stateNode=t}return Wt(e),null;case 31:if(n=e.memoizedState,t===null||t.memoizedState!==null){if(a=Sl(e),n!==null){if(t===null){if(!a)throw Error(s(318));if(t=e.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(s(557));t[we]=e}else qa(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;Wt(e),t=!1}else n=Ns(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=n),t=!0;if(!t)return e.flags&256?(Pe(e),e):(Pe(e),null);if((e.flags&128)!==0)throw Error(s(558))}return Wt(e),null;case 13:if(a=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(l=Sl(e),a!==null&&a.dehydrated!==null){if(t===null){if(!l)throw Error(s(318));if(l=e.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(s(317));l[we]=e}else qa(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;Wt(e),l=!1}else l=Ns(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=l),l=!0;if(!l)return e.flags&256?(Pe(e),e):(Pe(e),null)}return Pe(e),(e.flags&128)!==0?(e.lanes=n,e):(n=a!==null,t=t!==null&&t.memoizedState!==null,n&&(a=e.child,l=null,a.alternate!==null&&a.alternate.memoizedState!==null&&a.alternate.memoizedState.cachePool!==null&&(l=a.alternate.memoizedState.cachePool.pool),c=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(c=a.memoizedState.cachePool.pool),c!==l&&(a.flags|=2048)),n!==t&&n&&(e.child.flags|=8192),Xu(e,e.updateQueue),Wt(e),null);case 4:return ht(),t===null&&Vf(e.stateNode.containerInfo),Wt(e),null;case 10:return Yn(e.type),Wt(e),null;case 19:if(R(se),a=e.memoizedState,a===null)return Wt(e),null;if(l=(e.flags&128)!==0,c=a.rendering,c===null)if(l)Ai(a,!1);else{if(ue!==0||t!==null&&(t.flags&128)!==0)for(t=e.child;t!==null;){if(c=zu(t),c!==null){for(e.flags|=128,Ai(a,!1),t=c.updateQueue,e.updateQueue=t,Xu(e,t),e.subtreeFlags=0,t=n,n=e.child;n!==null;)m0(n,t),n=n.sibling;return k(se,se.current&1|2),Ut&&jn(e,a.treeForkCount),e.child}t=t.sibling}a.tail!==null&&xe()>Ju&&(e.flags|=128,l=!0,Ai(a,!1),e.lanes=4194304)}else{if(!l)if(t=zu(c),t!==null){if(e.flags|=128,l=!0,t=t.updateQueue,e.updateQueue=t,Xu(e,t),Ai(a,!0),a.tail===null&&a.tailMode==="hidden"&&!c.alternate&&!Ut)return Wt(e),null}else 2*xe()-a.renderingStartTime>Ju&&n!==536870912&&(e.flags|=128,l=!0,Ai(a,!1),e.lanes=4194304);a.isBackwards?(c.sibling=e.child,e.child=c):(t=a.last,t!==null?t.sibling=c:e.child=c,a.last=c)}return a.tail!==null?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=xe(),t.sibling=null,n=se.current,k(se,l?n&1|2:n&1),Ut&&jn(e,a.treeForkCount),t):(Wt(e),null);case 22:case 23:return Pe(e),Vs(),a=e.memoizedState!==null,t!==null?t.memoizedState!==null!==a&&(e.flags|=8192):a&&(e.flags|=8192),a?(n&536870912)!==0&&(e.flags&128)===0&&(Wt(e),e.subtreeFlags&6&&(e.flags|=8192)):Wt(e),n=e.updateQueue,n!==null&&Xu(e,n.retryQueue),n=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),a=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),a!==n&&(e.flags|=2048),t!==null&&R(Va),null;case 24:return n=null,t!==null&&(n=t.memoizedState.cache),e.memoizedState.cache!==n&&(e.flags|=2048),Yn(he),Wt(e),null;case 25:return null;case 30:return null}throw Error(s(156,e.tag))}function Oy(t,e){switch(Ds(e),e.tag){case 1:return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return Yn(he),ht(),t=e.flags,(t&65536)!==0&&(t&128)===0?(e.flags=t&-65537|128,e):null;case 26:case 27:case 5:return Ft(e),null;case 31:if(e.memoizedState!==null){if(Pe(e),e.alternate===null)throw Error(s(340));qa()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 13:if(Pe(e),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(s(340));qa()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return R(se),null;case 4:return ht(),null;case 10:return Yn(e.type),null;case 22:case 23:return Pe(e),Vs(),t!==null&&R(Va),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 24:return Yn(he),null;case 25:return null;default:return null}}function q2(t,e){switch(Ds(e),e.tag){case 3:Yn(he),ht();break;case 26:case 27:case 5:Ft(e);break;case 4:ht();break;case 31:e.memoizedState!==null&&Pe(e);break;case 13:Pe(e);break;case 19:R(se);break;case 10:Yn(e.type);break;case 22:case 23:Pe(e),Vs(),t!==null&&R(Va);break;case 24:Yn(he)}}function xi(t,e){try{var n=e.updateQueue,a=n!==null?n.lastEffect:null;if(a!==null){var l=a.next;n=l;do{if((n.tag&t)===t){a=void 0;var c=n.create,d=n.inst;a=c(),d.destroy=a}n=n.next}while(n!==l)}}catch(g){Zt(e,e.return,g)}}function ma(t,e,n){try{var a=e.updateQueue,l=a!==null?a.lastEffect:null;if(l!==null){var c=l.next;a=c;do{if((a.tag&t)===t){var d=a.inst,g=d.destroy;if(g!==void 0){d.destroy=void 0,l=e;var S=n,M=g;try{M()}catch(q){Zt(l,S,q)}}}a=a.next}while(a!==c)}}catch(q){Zt(e,e.return,q)}}function Z2(t){var e=t.updateQueue;if(e!==null){var n=t.stateNode;try{M0(e,n)}catch(a){Zt(t,t.return,a)}}}function X2(t,e,n){n.props=ka(t.type,t.memoizedProps),n.state=t.memoizedState;try{n.componentWillUnmount()}catch(a){Zt(t,e,a)}}function wi(t,e){try{var n=t.ref;if(n!==null){switch(t.tag){case 26:case 27:case 5:var a=t.stateNode;break;case 30:a=t.stateNode;break;default:a=t.stateNode}typeof n=="function"?t.refCleanup=n(a):n.current=a}}catch(l){Zt(t,e,l)}}function Dn(t,e){var n=t.ref,a=t.refCleanup;if(n!==null)if(typeof a=="function")try{a()}catch(l){Zt(t,e,l)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(l){Zt(t,e,l)}else n.current=null}function V2(t){var e=t.type,n=t.memoizedProps,a=t.stateNode;try{t:switch(e){case"button":case"input":case"select":case"textarea":n.autoFocus&&a.focus();break t;case"img":n.src?a.src=n.src:n.srcSet&&(a.srcset=n.srcSet)}}catch(l){Zt(t,t.return,l)}}function Tf(t,e,n){try{var a=t.stateNode;ky(a,t.type,n,e),a[Ze]=e}catch(l){Zt(t,t.return,l)}}function Q2(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&Sa(t.type)||t.tag===4}function Af(t){t:for(;;){for(;t.sibling===null;){if(t.return===null||Q2(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&Sa(t.type)||t.flags&2||t.child===null||t.tag===4)continue t;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function xf(t,e,n){var a=t.tag;if(a===5||a===6)t=t.stateNode,e?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(t,e):(e=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,e.appendChild(t),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=Cn));else if(a!==4&&(a===27&&Sa(t.type)&&(n=t.stateNode,e=null),t=t.child,t!==null))for(xf(t,e,n),t=t.sibling;t!==null;)xf(t,e,n),t=t.sibling}function Vu(t,e,n){var a=t.tag;if(a===5||a===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(a!==4&&(a===27&&Sa(t.type)&&(n=t.stateNode),t=t.child,t!==null))for(Vu(t,e,n),t=t.sibling;t!==null;)Vu(t,e,n),t=t.sibling}function F2(t){var e=t.stateNode,n=t.memoizedProps;try{for(var a=t.type,l=e.attributes;l.length;)e.removeAttributeNode(l[0]);ze(e,a,n),e[we]=t,e[Ze]=n}catch(c){Zt(t,t.return,c)}}var Vn=!1,ge=!1,wf=!1,K2=typeof WeakSet=="function"?WeakSet:Set,Se=null;function Ry(t,e){if(t=t.containerInfo,Kf=oc,t=i0(t),_s(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else t:{n=(n=t.ownerDocument)&&n.defaultView||window;var a=n.getSelection&&n.getSelection();if(a&&a.rangeCount!==0){n=a.anchorNode;var l=a.anchorOffset,c=a.focusNode;a=a.focusOffset;try{n.nodeType,c.nodeType}catch{n=null;break t}var d=0,g=-1,S=-1,M=0,q=0,K=t,C=null;e:for(;;){for(var j;K!==n||l!==0&&K.nodeType!==3||(g=d+l),K!==c||a!==0&&K.nodeType!==3||(S=d+a),K.nodeType===3&&(d+=K.nodeValue.length),(j=K.firstChild)!==null;)C=K,K=j;for(;;){if(K===t)break e;if(C===n&&++M===l&&(g=d),C===c&&++q===a&&(S=d),(j=K.nextSibling)!==null)break;K=C,C=K.parentNode}K=j}n=g===-1||S===-1?null:{start:g,end:S}}else n=null}n=n||{start:0,end:0}}else n=null;for(Jf={focusedElem:t,selectionRange:n},oc=!1,Se=e;Se!==null;)if(e=Se,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,Se=t;else for(;Se!==null;){switch(e=Se,c=e.alternate,t=e.flags,e.tag){case 0:if((t&4)!==0&&(t=e.updateQueue,t=t!==null?t.events:null,t!==null))for(n=0;n<t.length;n++)l=t[n],l.ref.impl=l.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&c!==null){t=void 0,n=e,l=c.memoizedProps,c=c.memoizedState,a=n.stateNode;try{var ft=ka(n.type,l);t=a.getSnapshotBeforeUpdate(ft,c),a.__reactInternalSnapshotBeforeUpdate=t}catch(bt){Zt(n,n.return,bt)}}break;case 3:if((t&1024)!==0){if(t=e.stateNode.containerInfo,n=t.nodeType,n===9)Wf(t);else if(n===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":Wf(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((t&1024)!==0)throw Error(s(163))}if(t=e.sibling,t!==null){t.return=e.return,Se=t;break}Se=e.return}}function J2(t,e,n){var a=n.flags;switch(n.tag){case 0:case 11:case 15:Fn(t,n),a&4&&xi(5,n);break;case 1:if(Fn(t,n),a&4)if(t=n.stateNode,e===null)try{t.componentDidMount()}catch(d){Zt(n,n.return,d)}else{var l=ka(n.type,e.memoizedProps);e=e.memoizedState;try{t.componentDidUpdate(l,e,t.__reactInternalSnapshotBeforeUpdate)}catch(d){Zt(n,n.return,d)}}a&64&&Z2(n),a&512&&wi(n,n.return);break;case 3:if(Fn(t,n),a&64&&(t=n.updateQueue,t!==null)){if(e=null,n.child!==null)switch(n.child.tag){case 27:case 5:e=n.child.stateNode;break;case 1:e=n.child.stateNode}try{M0(t,e)}catch(d){Zt(n,n.return,d)}}break;case 27:e===null&&a&4&&F2(n);case 26:case 5:Fn(t,n),e===null&&a&4&&V2(n),a&512&&wi(n,n.return);break;case 12:Fn(t,n);break;case 31:Fn(t,n),a&4&&W2(t,n);break;case 13:Fn(t,n),a&4&&$2(t,n),a&64&&(t=n.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(n=jy.bind(null,n),ag(t,n))));break;case 22:if(a=n.memoizedState!==null||Vn,!a){e=e!==null&&e.memoizedState!==null||ge,l=Vn;var c=ge;Vn=a,(ge=e)&&!c?Kn(t,n,(n.subtreeFlags&8772)!==0):Fn(t,n),Vn=l,ge=c}break;case 30:break;default:Fn(t,n)}}function k2(t){var e=t.alternate;e!==null&&(t.alternate=null,k2(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&es(e)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var te=null,Ve=!1;function Qn(t,e,n){for(n=n.child;n!==null;)I2(t,e,n),n=n.sibling}function I2(t,e,n){if(Y&&typeof Y.onCommitFiberUnmount=="function")try{Y.onCommitFiberUnmount(Ua,n)}catch{}switch(n.tag){case 26:ge||Dn(n,e),Qn(t,e,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:ge||Dn(n,e);var a=te,l=Ve;Sa(n.type)&&(te=n.stateNode,Ve=!1),Qn(t,e,n),Li(n.stateNode),te=a,Ve=l;break;case 5:ge||Dn(n,e);case 6:if(a=te,l=Ve,te=null,Qn(t,e,n),te=a,Ve=l,te!==null)if(Ve)try{(te.nodeType===9?te.body:te.nodeName==="HTML"?te.ownerDocument.body:te).removeChild(n.stateNode)}catch(c){Zt(n,e,c)}else try{te.removeChild(n.stateNode)}catch(c){Zt(n,e,c)}break;case 18:te!==null&&(Ve?(t=te,Zd(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,n.stateNode),Zl(t)):Zd(te,n.stateNode));break;case 4:a=te,l=Ve,te=n.stateNode.containerInfo,Ve=!0,Qn(t,e,n),te=a,Ve=l;break;case 0:case 11:case 14:case 15:ma(2,n,e),ge||ma(4,n,e),Qn(t,e,n);break;case 1:ge||(Dn(n,e),a=n.stateNode,typeof a.componentWillUnmount=="function"&&X2(n,e,a)),Qn(t,e,n);break;case 21:Qn(t,e,n);break;case 22:ge=(a=ge)||n.memoizedState!==null,Qn(t,e,n),ge=a;break;default:Qn(t,e,n)}}function W2(t,e){if(e.memoizedState===null&&(t=e.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{Zl(t)}catch(n){Zt(e,e.return,n)}}}function $2(t,e){if(e.memoizedState===null&&(t=e.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{Zl(t)}catch(n){Zt(e,e.return,n)}}function Dy(t){switch(t.tag){case 31:case 13:case 19:var e=t.stateNode;return e===null&&(e=t.stateNode=new K2),e;case 22:return t=t.stateNode,e=t._retryCache,e===null&&(e=t._retryCache=new K2),e;default:throw Error(s(435,t.tag))}}function Qu(t,e){var n=Dy(t);e.forEach(function(a){if(!n.has(a)){n.add(a);var l=By.bind(null,t,a);a.then(l,l)}})}function Qe(t,e){var n=e.deletions;if(n!==null)for(var a=0;a<n.length;a++){var l=n[a],c=t,d=e,g=d;t:for(;g!==null;){switch(g.tag){case 27:if(Sa(g.type)){te=g.stateNode,Ve=!1;break t}break;case 5:te=g.stateNode,Ve=!1;break t;case 3:case 4:te=g.stateNode.containerInfo,Ve=!0;break t}g=g.return}if(te===null)throw Error(s(160));I2(c,d,l),te=null,Ve=!1,c=l.alternate,c!==null&&(c.return=null),l.return=null}if(e.subtreeFlags&13886)for(e=e.child;e!==null;)P2(e,t),e=e.sibling}var Sn=null;function P2(t,e){var n=t.alternate,a=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:Qe(e,t),Fe(t),a&4&&(ma(3,t,t.return),xi(3,t),ma(5,t,t.return));break;case 1:Qe(e,t),Fe(t),a&512&&(ge||n===null||Dn(n,n.return)),a&64&&Vn&&(t=t.updateQueue,t!==null&&(a=t.callbacks,a!==null&&(n=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=n===null?a:n.concat(a))));break;case 26:var l=Sn;if(Qe(e,t),Fe(t),a&512&&(ge||n===null||Dn(n,n.return)),a&4){var c=n!==null?n.memoizedState:null;if(a=t.memoizedState,n===null)if(a===null)if(t.stateNode===null){t:{a=t.type,n=t.memoizedProps,l=l.ownerDocument||l;e:switch(a){case"title":c=l.getElementsByTagName("title")[0],(!c||c[Pl]||c[we]||c.namespaceURI==="http://www.w3.org/2000/svg"||c.hasAttribute("itemprop"))&&(c=l.createElement(a),l.head.insertBefore(c,l.querySelector("head > title"))),ze(c,a,n),c[we]=t,be(c),a=c;break t;case"link":var d=Pd("link","href",l).get(a+(n.href||""));if(d){for(var g=0;g<d.length;g++)if(c=d[g],c.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&c.getAttribute("rel")===(n.rel==null?null:n.rel)&&c.getAttribute("title")===(n.title==null?null:n.title)&&c.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){d.splice(g,1);break e}}c=l.createElement(a),ze(c,a,n),l.head.appendChild(c);break;case"meta":if(d=Pd("meta","content",l).get(a+(n.content||""))){for(g=0;g<d.length;g++)if(c=d[g],c.getAttribute("content")===(n.content==null?null:""+n.content)&&c.getAttribute("name")===(n.name==null?null:n.name)&&c.getAttribute("property")===(n.property==null?null:n.property)&&c.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&c.getAttribute("charset")===(n.charSet==null?null:n.charSet)){d.splice(g,1);break e}}c=l.createElement(a),ze(c,a,n),l.head.appendChild(c);break;default:throw Error(s(468,a))}c[we]=t,be(c),a=c}t.stateNode=a}else t1(l,t.type,t.stateNode);else t.stateNode=$d(l,a,t.memoizedProps);else c!==a?(c===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):c.count--,a===null?t1(l,t.type,t.stateNode):$d(l,a,t.memoizedProps)):a===null&&t.stateNode!==null&&Tf(t,t.memoizedProps,n.memoizedProps)}break;case 27:Qe(e,t),Fe(t),a&512&&(ge||n===null||Dn(n,n.return)),n!==null&&a&4&&Tf(t,t.memoizedProps,n.memoizedProps);break;case 5:if(Qe(e,t),Fe(t),a&512&&(ge||n===null||Dn(n,n.return)),t.flags&32){l=t.stateNode;try{ol(l,"")}catch(ft){Zt(t,t.return,ft)}}a&4&&t.stateNode!=null&&(l=t.memoizedProps,Tf(t,l,n!==null?n.memoizedProps:l)),a&1024&&(wf=!0);break;case 6:if(Qe(e,t),Fe(t),a&4){if(t.stateNode===null)throw Error(s(162));a=t.memoizedProps,n=t.stateNode;try{n.nodeValue=a}catch(ft){Zt(t,t.return,ft)}}break;case 3:if(cc=null,l=Sn,Sn=ic(e.containerInfo),Qe(e,t),Sn=l,Fe(t),a&4&&n!==null&&n.memoizedState.isDehydrated)try{Zl(e.containerInfo)}catch(ft){Zt(t,t.return,ft)}wf&&(wf=!1,td(t));break;case 4:a=Sn,Sn=ic(t.stateNode.containerInfo),Qe(e,t),Fe(t),Sn=a;break;case 12:Qe(e,t),Fe(t);break;case 31:Qe(e,t),Fe(t),a&4&&(a=t.updateQueue,a!==null&&(t.updateQueue=null,Qu(t,a)));break;case 13:Qe(e,t),Fe(t),t.child.flags&8192&&t.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(Ku=xe()),a&4&&(a=t.updateQueue,a!==null&&(t.updateQueue=null,Qu(t,a)));break;case 22:l=t.memoizedState!==null;var S=n!==null&&n.memoizedState!==null,M=Vn,q=ge;if(Vn=M||l,ge=q||S,Qe(e,t),ge=q,Vn=M,Fe(t),a&8192)t:for(e=t.stateNode,e._visibility=l?e._visibility&-2:e._visibility|1,l&&(n===null||S||Vn||ge||Ia(t)),n=null,e=t;;){if(e.tag===5||e.tag===26){if(n===null){S=n=e;try{if(c=S.stateNode,l)d=c.style,typeof d.setProperty=="function"?d.setProperty("display","none","important"):d.display="none";else{g=S.stateNode;var K=S.memoizedProps.style,C=K!=null&&K.hasOwnProperty("display")?K.display:null;g.style.display=C==null||typeof C=="boolean"?"":(""+C).trim()}}catch(ft){Zt(S,S.return,ft)}}}else if(e.tag===6){if(n===null){S=e;try{S.stateNode.nodeValue=l?"":S.memoizedProps}catch(ft){Zt(S,S.return,ft)}}}else if(e.tag===18){if(n===null){S=e;try{var j=S.stateNode;l?Xd(j,!0):Xd(S.stateNode,!1)}catch(ft){Zt(S,S.return,ft)}}}else if((e.tag!==22&&e.tag!==23||e.memoizedState===null||e===t)&&e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break t;for(;e.sibling===null;){if(e.return===null||e.return===t)break t;n===e&&(n=null),e=e.return}n===e&&(n=null),e.sibling.return=e.return,e=e.sibling}a&4&&(a=t.updateQueue,a!==null&&(n=a.retryQueue,n!==null&&(a.retryQueue=null,Qu(t,n))));break;case 19:Qe(e,t),Fe(t),a&4&&(a=t.updateQueue,a!==null&&(t.updateQueue=null,Qu(t,a)));break;case 30:break;case 21:break;default:Qe(e,t),Fe(t)}}function Fe(t){var e=t.flags;if(e&2){try{for(var n,a=t.return;a!==null;){if(Q2(a)){n=a;break}a=a.return}if(n==null)throw Error(s(160));switch(n.tag){case 27:var l=n.stateNode,c=Af(t);Vu(t,c,l);break;case 5:var d=n.stateNode;n.flags&32&&(ol(d,""),n.flags&=-33);var g=Af(t);Vu(t,g,d);break;case 3:case 4:var S=n.stateNode.containerInfo,M=Af(t);xf(t,M,S);break;default:throw Error(s(161))}}catch(q){Zt(t,t.return,q)}t.flags&=-3}e&4096&&(t.flags&=-4097)}function td(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var e=t;td(e),e.tag===5&&e.flags&1024&&e.stateNode.reset(),t=t.sibling}}function Fn(t,e){if(e.subtreeFlags&8772)for(e=e.child;e!==null;)J2(t,e.alternate,e),e=e.sibling}function Ia(t){for(t=t.child;t!==null;){var e=t;switch(e.tag){case 0:case 11:case 14:case 15:ma(4,e,e.return),Ia(e);break;case 1:Dn(e,e.return);var n=e.stateNode;typeof n.componentWillUnmount=="function"&&X2(e,e.return,n),Ia(e);break;case 27:Li(e.stateNode);case 26:case 5:Dn(e,e.return),Ia(e);break;case 22:e.memoizedState===null&&Ia(e);break;case 30:Ia(e);break;default:Ia(e)}t=t.sibling}}function Kn(t,e,n){for(n=n&&(e.subtreeFlags&8772)!==0,e=e.child;e!==null;){var a=e.alternate,l=t,c=e,d=c.flags;switch(c.tag){case 0:case 11:case 15:Kn(l,c,n),xi(4,c);break;case 1:if(Kn(l,c,n),a=c,l=a.stateNode,typeof l.componentDidMount=="function")try{l.componentDidMount()}catch(M){Zt(a,a.return,M)}if(a=c,l=a.updateQueue,l!==null){var g=a.stateNode;try{var S=l.shared.hiddenCallbacks;if(S!==null)for(l.shared.hiddenCallbacks=null,l=0;l<S.length;l++)N0(S[l],g)}catch(M){Zt(a,a.return,M)}}n&&d&64&&Z2(c),wi(c,c.return);break;case 27:F2(c);case 26:case 5:Kn(l,c,n),n&&a===null&&d&4&&V2(c),wi(c,c.return);break;case 12:Kn(l,c,n);break;case 31:Kn(l,c,n),n&&d&4&&W2(l,c);break;case 13:Kn(l,c,n),n&&d&4&&$2(l,c);break;case 22:c.memoizedState===null&&Kn(l,c,n),wi(c,c.return);break;case 30:break;default:Kn(l,c,n)}e=e.sibling}}function Of(t,e){var n=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),t=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(t=e.memoizedState.cachePool.pool),t!==n&&(t!=null&&t.refCount++,n!=null&&di(n))}function Rf(t,e){t=null,e.alternate!==null&&(t=e.alternate.memoizedState.cache),e=e.memoizedState.cache,e!==t&&(e.refCount++,t!=null&&di(t))}function En(t,e,n,a){if(e.subtreeFlags&10256)for(e=e.child;e!==null;)ed(t,e,n,a),e=e.sibling}function ed(t,e,n,a){var l=e.flags;switch(e.tag){case 0:case 11:case 15:En(t,e,n,a),l&2048&&xi(9,e);break;case 1:En(t,e,n,a);break;case 3:En(t,e,n,a),l&2048&&(t=null,e.alternate!==null&&(t=e.alternate.memoizedState.cache),e=e.memoizedState.cache,e!==t&&(e.refCount++,t!=null&&di(t)));break;case 12:if(l&2048){En(t,e,n,a),t=e.stateNode;try{var c=e.memoizedProps,d=c.id,g=c.onPostCommit;typeof g=="function"&&g(d,e.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(S){Zt(e,e.return,S)}}else En(t,e,n,a);break;case 31:En(t,e,n,a);break;case 13:En(t,e,n,a);break;case 23:break;case 22:c=e.stateNode,d=e.alternate,e.memoizedState!==null?c._visibility&2?En(t,e,n,a):Oi(t,e):c._visibility&2?En(t,e,n,a):(c._visibility|=2,Nl(t,e,n,a,(e.subtreeFlags&10256)!==0||!1)),l&2048&&Of(d,e);break;case 24:En(t,e,n,a),l&2048&&Rf(e.alternate,e);break;default:En(t,e,n,a)}}function Nl(t,e,n,a,l){for(l=l&&((e.subtreeFlags&10256)!==0||!1),e=e.child;e!==null;){var c=t,d=e,g=n,S=a,M=d.flags;switch(d.tag){case 0:case 11:case 15:Nl(c,d,g,S,l),xi(8,d);break;case 23:break;case 22:var q=d.stateNode;d.memoizedState!==null?q._visibility&2?Nl(c,d,g,S,l):Oi(c,d):(q._visibility|=2,Nl(c,d,g,S,l)),l&&M&2048&&Of(d.alternate,d);break;case 24:Nl(c,d,g,S,l),l&&M&2048&&Rf(d.alternate,d);break;default:Nl(c,d,g,S,l)}e=e.sibling}}function Oi(t,e){if(e.subtreeFlags&10256)for(e=e.child;e!==null;){var n=t,a=e,l=a.flags;switch(a.tag){case 22:Oi(n,a),l&2048&&Of(a.alternate,a);break;case 24:Oi(n,a),l&2048&&Rf(a.alternate,a);break;default:Oi(n,a)}e=e.sibling}}var Ri=8192;function Ml(t,e,n){if(t.subtreeFlags&Ri)for(t=t.child;t!==null;)nd(t,e,n),t=t.sibling}function nd(t,e,n){switch(t.tag){case 26:Ml(t,e,n),t.flags&Ri&&t.memoizedState!==null&&yg(n,Sn,t.memoizedState,t.memoizedProps);break;case 5:Ml(t,e,n);break;case 3:case 4:var a=Sn;Sn=ic(t.stateNode.containerInfo),Ml(t,e,n),Sn=a;break;case 22:t.memoizedState===null&&(a=t.alternate,a!==null&&a.memoizedState!==null?(a=Ri,Ri=16777216,Ml(t,e,n),Ri=a):Ml(t,e,n));break;default:Ml(t,e,n)}}function ad(t){var e=t.alternate;if(e!==null&&(t=e.child,t!==null)){e.child=null;do e=t.sibling,t.sibling=null,t=e;while(t!==null)}}function Di(t){var e=t.deletions;if((t.flags&16)!==0){if(e!==null)for(var n=0;n<e.length;n++){var a=e[n];Se=a,id(a,t)}ad(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)ld(t),t=t.sibling}function ld(t){switch(t.tag){case 0:case 11:case 15:Di(t),t.flags&2048&&ma(9,t,t.return);break;case 3:Di(t);break;case 12:Di(t);break;case 22:var e=t.stateNode;t.memoizedState!==null&&e._visibility&2&&(t.return===null||t.return.tag!==13)?(e._visibility&=-3,Fu(t)):Di(t);break;default:Di(t)}}function Fu(t){var e=t.deletions;if((t.flags&16)!==0){if(e!==null)for(var n=0;n<e.length;n++){var a=e[n];Se=a,id(a,t)}ad(t)}for(t=t.child;t!==null;){switch(e=t,e.tag){case 0:case 11:case 15:ma(8,e,e.return),Fu(e);break;case 22:n=e.stateNode,n._visibility&2&&(n._visibility&=-3,Fu(e));break;default:Fu(e)}t=t.sibling}}function id(t,e){for(;Se!==null;){var n=Se;switch(n.tag){case 0:case 11:case 15:ma(8,n,e);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var a=n.memoizedState.cachePool.pool;a!=null&&a.refCount++}break;case 24:di(n.memoizedState.cache)}if(a=n.child,a!==null)a.return=n,Se=a;else t:for(n=t;Se!==null;){a=Se;var l=a.sibling,c=a.return;if(k2(a),a===n){Se=null;break t}if(l!==null){l.return=c,Se=l;break t}Se=c}}}var zy={getCacheForType:function(t){var e=Re(he),n=e.data.get(t);return n===void 0&&(n=t(),e.data.set(t,n)),n},cacheSignal:function(){return Re(he).controller.signal}},Ny=typeof WeakMap=="function"?WeakMap:Map,Bt=0,Kt=null,Ot=null,Nt=0,qt=0,tn=null,ya=!1,Ul=!1,Df=!1,Jn=0,ue=0,ga=0,Wa=0,zf=0,en=0,Cl=0,zi=null,Ke=null,Nf=!1,Ku=0,ud=0,Ju=1/0,ku=null,va=null,pe=0,_a=null,Ll=null,kn=0,Mf=0,Uf=null,cd=null,Ni=0,Cf=null;function nn(){return(Bt&2)!==0&&Nt!==0?Nt&-Nt:N.T!==null?Gf():To()}function sd(){if(en===0)if((Nt&536870912)===0||Ut){var t=de;de<<=1,(de&3932160)===0&&(de=262144),en=t}else en=536870912;return t=$e.current,t!==null&&(t.flags|=32),en}function Je(t,e,n){(t===Kt&&(qt===2||qt===9)||t.cancelPendingCommit!==null)&&(Hl(t,0),pa(t,Nt,en,!1)),$l(t,n),((Bt&2)===0||t!==Kt)&&(t===Kt&&((Bt&2)===0&&(Wa|=n),ue===4&&pa(t,Nt,en,!1)),zn(t))}function fd(t,e,n){if((Bt&6)!==0)throw Error(s(327));var a=!n&&(e&127)===0&&(e&t.expiredLanes)===0||na(t,e),l=a?Cy(t,e):Hf(t,e,!0),c=a;do{if(l===0){Ul&&!a&&pa(t,e,0,!1);break}else{if(n=t.current.alternate,c&&!My(n)){l=Hf(t,e,!1),c=!1;continue}if(l===2){if(c=e,t.errorRecoveryDisabledLanes&c)var d=0;else d=t.pendingLanes&-536870913,d=d!==0?d:d&536870912?536870912:0;if(d!==0){e=d;t:{var g=t;l=zi;var S=g.current.memoizedState.isDehydrated;if(S&&(Hl(g,d).flags|=256),d=Hf(g,d,!1),d!==2){if(Df&&!S){g.errorRecoveryDisabledLanes|=c,Wa|=c,l=4;break t}c=Ke,Ke=l,c!==null&&(Ke===null?Ke=c:Ke.push.apply(Ke,c))}l=d}if(c=!1,l!==2)continue}}if(l===1){Hl(t,0),pa(t,e,0,!0);break}t:{switch(a=t,c=l,c){case 0:case 1:throw Error(s(345));case 4:if((e&4194048)!==e)break;case 6:pa(a,e,en,!ya);break t;case 2:Ke=null;break;case 3:case 5:break;default:throw Error(s(329))}if((e&62914560)===e&&(l=Ku+300-xe(),10<l)){if(pa(a,e,en,!ya),Ca(a,0,!0)!==0)break t;kn=e,a.timeoutHandle=Gd(rd.bind(null,a,n,Ke,ku,Nf,e,en,Wa,Cl,ya,c,"Throttled",-0,0),l);break t}rd(a,n,Ke,ku,Nf,e,en,Wa,Cl,ya,c,null,-0,0)}}break}while(!0);zn(t)}function rd(t,e,n,a,l,c,d,g,S,M,q,K,C,j){if(t.timeoutHandle=-1,K=e.subtreeFlags,K&8192||(K&16785408)===16785408){K={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Cn},nd(e,c,K);var ft=(c&62914560)===c?Ku-xe():(c&4194048)===c?ud-xe():0;if(ft=gg(K,ft),ft!==null){kn=c,t.cancelPendingCommit=ft(_d.bind(null,t,e,c,n,a,l,d,g,S,q,K,null,C,j)),pa(t,c,d,!M);return}}_d(t,e,c,n,a,l,d,g,S)}function My(t){for(var e=t;;){var n=e.tag;if((n===0||n===11||n===15)&&e.flags&16384&&(n=e.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var a=0;a<n.length;a++){var l=n[a],c=l.getSnapshot;l=l.value;try{if(!Ie(c(),l))return!1}catch{return!1}}if(n=e.child,e.subtreeFlags&16384&&n!==null)n.return=e,e=n;else{if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return!0;e=e.return}e.sibling.return=e.return,e=e.sibling}}return!0}function pa(t,e,n,a){e&=~zf,e&=~Wa,t.suspendedLanes|=e,t.pingedLanes&=~e,a&&(t.warmLanes|=e),a=t.expirationTimes;for(var l=e;0<l;){var c=31-F(l),d=1<<c;a[c]=-1,l&=~d}n!==0&&bo(t,n,e)}function Iu(){return(Bt&6)===0?(Mi(0),!1):!0}function Lf(){if(Ot!==null){if(qt===0)var t=Ot.return;else t=Ot,Bn=Za=null,Is(t),wl=null,mi=0,t=Ot;for(;t!==null;)q2(t.alternate,t),t=t.return;Ot=null}}function Hl(t,e){var n=t.timeoutHandle;n!==-1&&(t.timeoutHandle=-1,$y(n)),n=t.cancelPendingCommit,n!==null&&(t.cancelPendingCommit=null,n()),kn=0,Lf(),Kt=t,Ot=n=Hn(t.current,null),Nt=e,qt=0,tn=null,ya=!1,Ul=na(t,e),Df=!1,Cl=en=zf=Wa=ga=ue=0,Ke=zi=null,Nf=!1,(e&8)!==0&&(e|=e&32);var a=t.entangledLanes;if(a!==0)for(t=t.entanglements,a&=e;0<a;){var l=31-F(a),c=1<<l;e|=t[l],a&=~c}return Jn=e,vu(),n}function od(t,e){Tt=null,N.H=Ei,e===xl||e===xu?(e=O0(),qt=3):e===Bs?(e=O0(),qt=4):qt=e===hf?8:e!==null&&typeof e=="object"&&typeof e.then=="function"?6:1,tn=e,Ot===null&&(ue=1,Yu(t,fn(e,t.current)))}function dd(){var t=$e.current;return t===null?!0:(Nt&4194048)===Nt?hn===null:(Nt&62914560)===Nt||(Nt&536870912)!==0?t===hn:!1}function hd(){var t=N.H;return N.H=Ei,t===null?Ei:t}function md(){var t=N.A;return N.A=zy,t}function Wu(){ue=4,ya||(Nt&4194048)!==Nt&&$e.current!==null||(Ul=!0),(ga&134217727)===0&&(Wa&134217727)===0||Kt===null||pa(Kt,Nt,en,!1)}function Hf(t,e,n){var a=Bt;Bt|=2;var l=hd(),c=md();(Kt!==t||Nt!==e)&&(ku=null,Hl(t,e)),e=!1;var d=ue;t:do try{if(qt!==0&&Ot!==null){var g=Ot,S=tn;switch(qt){case 8:Lf(),d=6;break t;case 3:case 2:case 9:case 6:$e.current===null&&(e=!0);var M=qt;if(qt=0,tn=null,jl(t,g,S,M),n&&Ul){d=0;break t}break;default:M=qt,qt=0,tn=null,jl(t,g,S,M)}}Uy(),d=ue;break}catch(q){od(t,q)}while(!0);return e&&t.shellSuspendCounter++,Bn=Za=null,Bt=a,N.H=l,N.A=c,Ot===null&&(Kt=null,Nt=0,vu()),d}function Uy(){for(;Ot!==null;)yd(Ot)}function Cy(t,e){var n=Bt;Bt|=2;var a=hd(),l=md();Kt!==t||Nt!==e?(ku=null,Ju=xe()+500,Hl(t,e)):Ul=na(t,e);t:do try{if(qt!==0&&Ot!==null){e=Ot;var c=tn;e:switch(qt){case 1:qt=0,tn=null,jl(t,e,c,1);break;case 2:case 9:if(x0(c)){qt=0,tn=null,gd(e);break}e=function(){qt!==2&&qt!==9||Kt!==t||(qt=7),zn(t)},c.then(e,e);break t;case 3:qt=7;break t;case 4:qt=5;break t;case 7:x0(c)?(qt=0,tn=null,gd(e)):(qt=0,tn=null,jl(t,e,c,7));break;case 5:var d=null;switch(Ot.tag){case 26:d=Ot.memoizedState;case 5:case 27:var g=Ot;if(d?e1(d):g.stateNode.complete){qt=0,tn=null;var S=g.sibling;if(S!==null)Ot=S;else{var M=g.return;M!==null?(Ot=M,$u(M)):Ot=null}break e}}qt=0,tn=null,jl(t,e,c,5);break;case 6:qt=0,tn=null,jl(t,e,c,6);break;case 8:Lf(),ue=6;break t;default:throw Error(s(462))}}Ly();break}catch(q){od(t,q)}while(!0);return Bn=Za=null,N.H=a,N.A=l,Bt=n,Ot!==null?0:(Kt=null,Nt=0,vu(),ue)}function Ly(){for(;Ot!==null&&!wn();)yd(Ot)}function yd(t){var e=Y2(t.alternate,t,Jn);t.memoizedProps=t.pendingProps,e===null?$u(t):Ot=e}function gd(t){var e=t,n=e.alternate;switch(e.tag){case 15:case 0:e=U2(n,e,e.pendingProps,e.type,void 0,Nt);break;case 11:e=U2(n,e,e.pendingProps,e.type.render,e.ref,Nt);break;case 5:Is(e);default:q2(n,e),e=Ot=m0(e,Jn),e=Y2(n,e,Jn)}t.memoizedProps=t.pendingProps,e===null?$u(t):Ot=e}function jl(t,e,n,a){Bn=Za=null,Is(e),wl=null,mi=0;var l=e.return;try{if(Ty(t,l,e,n,Nt)){ue=1,Yu(t,fn(n,t.current)),Ot=null;return}}catch(c){if(l!==null)throw Ot=l,c;ue=1,Yu(t,fn(n,t.current)),Ot=null;return}e.flags&32768?(Ut||a===1?t=!0:Ul||(Nt&536870912)!==0?t=!1:(ya=t=!0,(a===2||a===9||a===3||a===6)&&(a=$e.current,a!==null&&a.tag===13&&(a.flags|=16384))),vd(e,t)):$u(e)}function $u(t){var e=t;do{if((e.flags&32768)!==0){vd(e,ya);return}t=e.return;var n=wy(e.alternate,e,Jn);if(n!==null){Ot=n;return}if(e=e.sibling,e!==null){Ot=e;return}Ot=e=t}while(e!==null);ue===0&&(ue=5)}function vd(t,e){do{var n=Oy(t.alternate,t);if(n!==null){n.flags&=32767,Ot=n;return}if(n=t.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!e&&(t=t.sibling,t!==null)){Ot=t;return}Ot=t=n}while(t!==null);ue=6,Ot=null}function _d(t,e,n,a,l,c,d,g,S){t.cancelPendingCommit=null;do Pu();while(pe!==0);if((Bt&6)!==0)throw Error(s(327));if(e!==null){if(e===t.current)throw Error(s(177));if(c=e.lanes|e.childLanes,c|=Ts,m3(t,n,c,d,g,S),t===Kt&&(Ot=Kt=null,Nt=0),Ll=e,_a=t,kn=n,Mf=c,Uf=l,cd=a,(e.subtreeFlags&10256)!==0||(e.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,Yy(ea,function(){return Td(),null})):(t.callbackNode=null,t.callbackPriority=0),a=(e.flags&13878)!==0,(e.subtreeFlags&13878)!==0||a){a=N.T,N.T=null,l=V.p,V.p=2,d=Bt,Bt|=4;try{Ry(t,e,n)}finally{Bt=d,V.p=l,N.T=a}}pe=1,pd(),bd(),Sd()}}function pd(){if(pe===1){pe=0;var t=_a,e=Ll,n=(e.flags&13878)!==0;if((e.subtreeFlags&13878)!==0||n){n=N.T,N.T=null;var a=V.p;V.p=2;var l=Bt;Bt|=4;try{P2(e,t);var c=Jf,d=i0(t.containerInfo),g=c.focusedElem,S=c.selectionRange;if(d!==g&&g&&g.ownerDocument&&l0(g.ownerDocument.documentElement,g)){if(S!==null&&_s(g)){var M=S.start,q=S.end;if(q===void 0&&(q=M),"selectionStart"in g)g.selectionStart=M,g.selectionEnd=Math.min(q,g.value.length);else{var K=g.ownerDocument||document,C=K&&K.defaultView||window;if(C.getSelection){var j=C.getSelection(),ft=g.textContent.length,bt=Math.min(S.start,ft),Qt=S.end===void 0?bt:Math.min(S.end,ft);!j.extend&&bt>Qt&&(d=Qt,Qt=bt,bt=d);var x=a0(g,bt),A=a0(g,Qt);if(x&&A&&(j.rangeCount!==1||j.anchorNode!==x.node||j.anchorOffset!==x.offset||j.focusNode!==A.node||j.focusOffset!==A.offset)){var z=K.createRange();z.setStart(x.node,x.offset),j.removeAllRanges(),bt>Qt?(j.addRange(z),j.extend(A.node,A.offset)):(z.setEnd(A.node,A.offset),j.addRange(z))}}}}for(K=[],j=g;j=j.parentNode;)j.nodeType===1&&K.push({element:j,left:j.scrollLeft,top:j.scrollTop});for(typeof g.focus=="function"&&g.focus(),g=0;g<K.length;g++){var Q=K[g];Q.element.scrollLeft=Q.left,Q.element.scrollTop=Q.top}}oc=!!Kf,Jf=Kf=null}finally{Bt=l,V.p=a,N.T=n}}t.current=e,pe=2}}function bd(){if(pe===2){pe=0;var t=_a,e=Ll,n=(e.flags&8772)!==0;if((e.subtreeFlags&8772)!==0||n){n=N.T,N.T=null;var a=V.p;V.p=2;var l=Bt;Bt|=4;try{J2(t,e.alternate,e)}finally{Bt=l,V.p=a,N.T=n}}pe=3}}function Sd(){if(pe===4||pe===3){pe=0,nl();var t=_a,e=Ll,n=kn,a=cd;(e.subtreeFlags&10256)!==0||(e.flags&10256)!==0?pe=5:(pe=0,Ll=_a=null,Ed(t,t.pendingLanes));var l=t.pendingLanes;if(l===0&&(va=null),Pc(n),e=e.stateNode,Y&&typeof Y.onCommitFiberRoot=="function")try{Y.onCommitFiberRoot(Ua,e,void 0,(e.current.flags&128)===128)}catch{}if(a!==null){e=N.T,l=V.p,V.p=2,N.T=null;try{for(var c=t.onRecoverableError,d=0;d<a.length;d++){var g=a[d];c(g.value,{componentStack:g.stack})}}finally{N.T=e,V.p=l}}(kn&3)!==0&&Pu(),zn(t),l=t.pendingLanes,(n&261930)!==0&&(l&42)!==0?t===Cf?Ni++:(Ni=0,Cf=t):Ni=0,Mi(0)}}function Ed(t,e){(t.pooledCacheLanes&=e)===0&&(e=t.pooledCache,e!=null&&(t.pooledCache=null,di(e)))}function Pu(){return pd(),bd(),Sd(),Td()}function Td(){if(pe!==5)return!1;var t=_a,e=Mf;Mf=0;var n=Pc(kn),a=N.T,l=V.p;try{V.p=32>n?32:n,N.T=null,n=Uf,Uf=null;var c=_a,d=kn;if(pe=0,Ll=_a=null,kn=0,(Bt&6)!==0)throw Error(s(331));var g=Bt;if(Bt|=4,ld(c.current),ed(c,c.current,d,n),Bt=g,Mi(0,!1),Y&&typeof Y.onPostCommitFiberRoot=="function")try{Y.onPostCommitFiberRoot(Ua,c)}catch{}return!0}finally{V.p=l,N.T=a,Ed(t,e)}}function Ad(t,e,n){e=fn(n,e),e=df(t.stateNode,e,2),t=oa(t,e,2),t!==null&&($l(t,2),zn(t))}function Zt(t,e,n){if(t.tag===3)Ad(t,t,n);else for(;e!==null;){if(e.tag===3){Ad(e,t,n);break}else if(e.tag===1){var a=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(va===null||!va.has(a))){t=fn(n,t),n=x2(2),a=oa(e,n,2),a!==null&&(w2(n,a,e,t),$l(a,2),zn(a));break}}e=e.return}}function jf(t,e,n){var a=t.pingCache;if(a===null){a=t.pingCache=new Ny;var l=new Set;a.set(e,l)}else l=a.get(e),l===void 0&&(l=new Set,a.set(e,l));l.has(n)||(Df=!0,l.add(n),t=Hy.bind(null,t,e,n),e.then(t,t))}function Hy(t,e,n){var a=t.pingCache;a!==null&&a.delete(e),t.pingedLanes|=t.suspendedLanes&n,t.warmLanes&=~n,Kt===t&&(Nt&n)===n&&(ue===4||ue===3&&(Nt&62914560)===Nt&&300>xe()-Ku?(Bt&2)===0&&Hl(t,0):zf|=n,Cl===Nt&&(Cl=0)),zn(t)}function xd(t,e){e===0&&(e=po()),t=Ya(t,e),t!==null&&($l(t,e),zn(t))}function jy(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),xd(t,n)}function By(t,e){var n=0;switch(t.tag){case 31:case 13:var a=t.stateNode,l=t.memoizedState;l!==null&&(n=l.retryLane);break;case 19:a=t.stateNode;break;case 22:a=t.stateNode._retryCache;break;default:throw Error(s(314))}a!==null&&a.delete(e),xd(t,n)}function Yy(t,e){return Ce(t,e)}var tc=null,Bl=null,Bf=!1,ec=!1,Yf=!1,ba=0;function zn(t){t!==Bl&&t.next===null&&(Bl===null?tc=Bl=t:Bl=Bl.next=t),ec=!0,Bf||(Bf=!0,qy())}function Mi(t,e){if(!Yf&&ec){Yf=!0;do for(var n=!1,a=tc;a!==null;){if(t!==0){var l=a.pendingLanes;if(l===0)var c=0;else{var d=a.suspendedLanes,g=a.pingedLanes;c=(1<<31-F(42|t)+1)-1,c&=l&~(d&~g),c=c&201326741?c&201326741|1:c?c|2:0}c!==0&&(n=!0,Dd(a,c))}else c=Nt,c=Ca(a,a===Kt?c:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(c&3)===0||na(a,c)||(n=!0,Dd(a,c));a=a.next}while(n);Yf=!1}}function Gy(){wd()}function wd(){ec=Bf=!1;var t=0;ba!==0&&Wy()&&(t=ba);for(var e=xe(),n=null,a=tc;a!==null;){var l=a.next,c=Od(a,e);c===0?(a.next=null,n===null?tc=l:n.next=l,l===null&&(Bl=n)):(n=a,(t!==0||(c&3)!==0)&&(ec=!0)),a=l}pe!==0&&pe!==5||Mi(t),ba!==0&&(ba=0)}function Od(t,e){for(var n=t.suspendedLanes,a=t.pingedLanes,l=t.expirationTimes,c=t.pendingLanes&-62914561;0<c;){var d=31-F(c),g=1<<d,S=l[d];S===-1?((g&n)===0||(g&a)!==0)&&(l[d]=h3(g,e)):S<=e&&(t.expiredLanes|=g),c&=~g}if(e=Kt,n=Nt,n=Ca(t,t===e?n:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),a=t.callbackNode,n===0||t===e&&(qt===2||qt===9)||t.cancelPendingCommit!==null)return a!==null&&a!==null&&Ae(a),t.callbackNode=null,t.callbackPriority=0;if((n&3)===0||na(t,n)){if(e=n&-n,e===t.callbackPriority)return e;switch(a!==null&&Ae(a),Pc(n)){case 2:case 8:n=_e;break;case 32:n=ea;break;case 268435456:n=Wl;break;default:n=ea}return a=Rd.bind(null,t),n=Ce(n,a),t.callbackPriority=e,t.callbackNode=n,e}return a!==null&&a!==null&&Ae(a),t.callbackPriority=2,t.callbackNode=null,2}function Rd(t,e){if(pe!==0&&pe!==5)return t.callbackNode=null,t.callbackPriority=0,null;var n=t.callbackNode;if(Pu()&&t.callbackNode!==n)return null;var a=Nt;return a=Ca(t,t===Kt?a:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),a===0?null:(fd(t,a,e),Od(t,xe()),t.callbackNode!=null&&t.callbackNode===n?Rd.bind(null,t):null)}function Dd(t,e){if(Pu())return null;fd(t,e,!0)}function qy(){Py(function(){(Bt&6)!==0?Ce(ll,Gy):wd()})}function Gf(){if(ba===0){var t=Tl;t===0&&(t=wt,wt<<=1,(wt&261888)===0&&(wt=256)),ba=t}return ba}function zd(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:fu(""+t)}function Nd(t,e){var n=e.ownerDocument.createElement("input");return n.name=e.name,n.value=e.value,t.id&&n.setAttribute("form",t.id),e.parentNode.insertBefore(n,e),t=new FormData(t),n.parentNode.removeChild(n),t}function Zy(t,e,n,a,l){if(e==="submit"&&n&&n.stateNode===l){var c=zd((l[Ze]||null).action),d=a.submitter;d&&(e=(e=d[Ze]||null)?zd(e.formAction):d.getAttribute("formAction"),e!==null&&(c=e,d=null));var g=new hu("action","action",null,a,l);t.push({event:g,listeners:[{instance:null,listener:function(){if(a.defaultPrevented){if(ba!==0){var S=d?Nd(l,d):new FormData(l);uf(n,{pending:!0,data:S,method:l.method,action:c},null,S)}}else typeof c=="function"&&(g.preventDefault(),S=d?Nd(l,d):new FormData(l),uf(n,{pending:!0,data:S,method:l.method,action:c},c,S))},currentTarget:l}]})}}for(var qf=0;qf<Es.length;qf++){var Zf=Es[qf],Xy=Zf.toLowerCase(),Vy=Zf[0].toUpperCase()+Zf.slice(1);bn(Xy,"on"+Vy)}bn(s0,"onAnimationEnd"),bn(f0,"onAnimationIteration"),bn(r0,"onAnimationStart"),bn("dblclick","onDoubleClick"),bn("focusin","onFocus"),bn("focusout","onBlur"),bn(uy,"onTransitionRun"),bn(cy,"onTransitionStart"),bn(sy,"onTransitionCancel"),bn(o0,"onTransitionEnd"),fl("onMouseEnter",["mouseout","mouseover"]),fl("onMouseLeave",["mouseout","mouseover"]),fl("onPointerEnter",["pointerout","pointerover"]),fl("onPointerLeave",["pointerout","pointerover"]),La("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),La("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),La("onBeforeInput",["compositionend","keypress","textInput","paste"]),La("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),La("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),La("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ui="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Qy=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ui));function Md(t,e){e=(e&4)!==0;for(var n=0;n<t.length;n++){var a=t[n],l=a.event;a=a.listeners;t:{var c=void 0;if(e)for(var d=a.length-1;0<=d;d--){var g=a[d],S=g.instance,M=g.currentTarget;if(g=g.listener,S!==c&&l.isPropagationStopped())break t;c=g,l.currentTarget=M;try{c(l)}catch(q){gu(q)}l.currentTarget=null,c=S}else for(d=0;d<a.length;d++){if(g=a[d],S=g.instance,M=g.currentTarget,g=g.listener,S!==c&&l.isPropagationStopped())break t;c=g,l.currentTarget=M;try{c(l)}catch(q){gu(q)}l.currentTarget=null,c=S}}}}function Rt(t,e){var n=e[ts];n===void 0&&(n=e[ts]=new Set);var a=t+"__bubble";n.has(a)||(Ud(e,t,2,!1),n.add(a))}function Xf(t,e,n){var a=0;e&&(a|=4),Ud(n,t,a,e)}var nc="_reactListening"+Math.random().toString(36).slice(2);function Vf(t){if(!t[nc]){t[nc]=!0,wo.forEach(function(n){n!=="selectionchange"&&(Qy.has(n)||Xf(n,!1,t),Xf(n,!0,t))});var e=t.nodeType===9?t:t.ownerDocument;e===null||e[nc]||(e[nc]=!0,Xf("selectionchange",!1,e))}}function Ud(t,e,n,a){switch(s1(e)){case 2:var l=pg;break;case 8:l=bg;break;default:l=ir}n=l.bind(null,e,n,t),l=void 0,!fs||e!=="touchstart"&&e!=="touchmove"&&e!=="wheel"||(l=!0),a?l!==void 0?t.addEventListener(e,n,{capture:!0,passive:l}):t.addEventListener(e,n,!0):l!==void 0?t.addEventListener(e,n,{passive:l}):t.addEventListener(e,n,!1)}function Qf(t,e,n,a,l){var c=a;if((e&1)===0&&(e&2)===0&&a!==null)t:for(;;){if(a===null)return;var d=a.tag;if(d===3||d===4){var g=a.stateNode.containerInfo;if(g===l)break;if(d===4)for(d=a.return;d!==null;){var S=d.tag;if((S===3||S===4)&&d.stateNode.containerInfo===l)return;d=d.return}for(;g!==null;){if(d=ul(g),d===null)return;if(S=d.tag,S===5||S===6||S===26||S===27){a=c=d;continue t}g=g.parentNode}}a=a.return}Bo(function(){var M=c,q=cs(n),K=[];t:{var C=d0.get(t);if(C!==void 0){var j=hu,ft=t;switch(t){case"keypress":if(ou(n)===0)break t;case"keydown":case"keyup":j=B3;break;case"focusin":ft="focus",j=hs;break;case"focusout":ft="blur",j=hs;break;case"beforeblur":case"afterblur":j=hs;break;case"click":if(n.button===2)break t;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":j=qo;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":j=w3;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":j=q3;break;case s0:case f0:case r0:j=D3;break;case o0:j=X3;break;case"scroll":case"scrollend":j=A3;break;case"wheel":j=Q3;break;case"copy":case"cut":case"paste":j=N3;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":j=Xo;break;case"toggle":case"beforetoggle":j=K3}var bt=(e&4)!==0,Qt=!bt&&(t==="scroll"||t==="scrollend"),x=bt?C!==null?C+"Capture":null:C;bt=[];for(var A=M,z;A!==null;){var Q=A;if(z=Q.stateNode,Q=Q.tag,Q!==5&&Q!==26&&Q!==27||z===null||x===null||(Q=ei(A,x),Q!=null&&bt.push(Ci(A,Q,z))),Qt)break;A=A.return}0<bt.length&&(C=new j(C,ft,null,n,q),K.push({event:C,listeners:bt}))}}if((e&7)===0){t:{if(C=t==="mouseover"||t==="pointerover",j=t==="mouseout"||t==="pointerout",C&&n!==us&&(ft=n.relatedTarget||n.fromElement)&&(ul(ft)||ft[il]))break t;if((j||C)&&(C=q.window===q?q:(C=q.ownerDocument)?C.defaultView||C.parentWindow:window,j?(ft=n.relatedTarget||n.toElement,j=M,ft=ft?ul(ft):null,ft!==null&&(Qt=o(ft),bt=ft.tag,ft!==Qt||bt!==5&&bt!==27&&bt!==6)&&(ft=null)):(j=null,ft=M),j!==ft)){if(bt=qo,Q="onMouseLeave",x="onMouseEnter",A="mouse",(t==="pointerout"||t==="pointerover")&&(bt=Xo,Q="onPointerLeave",x="onPointerEnter",A="pointer"),Qt=j==null?C:ti(j),z=ft==null?C:ti(ft),C=new bt(Q,A+"leave",j,n,q),C.target=Qt,C.relatedTarget=z,Q=null,ul(q)===M&&(bt=new bt(x,A+"enter",ft,n,q),bt.target=z,bt.relatedTarget=Qt,Q=bt),Qt=Q,j&&ft)e:{for(bt=Fy,x=j,A=ft,z=0,Q=x;Q;Q=bt(Q))z++;Q=0;for(var vt=A;vt;vt=bt(vt))Q++;for(;0<z-Q;)x=bt(x),z--;for(;0<Q-z;)A=bt(A),Q--;for(;z--;){if(x===A||A!==null&&x===A.alternate){bt=x;break e}x=bt(x),A=bt(A)}bt=null}else bt=null;j!==null&&Cd(K,C,j,bt,!1),ft!==null&&Qt!==null&&Cd(K,Qt,ft,bt,!0)}}t:{if(C=M?ti(M):window,j=C.nodeName&&C.nodeName.toLowerCase(),j==="select"||j==="input"&&C.type==="file")var Ht=Wo;else if(ko(C))if($o)Ht=ay;else{Ht=ey;var dt=ty}else j=C.nodeName,!j||j.toLowerCase()!=="input"||C.type!=="checkbox"&&C.type!=="radio"?M&&is(M.elementType)&&(Ht=Wo):Ht=ny;if(Ht&&(Ht=Ht(t,M))){Io(K,Ht,n,q);break t}dt&&dt(t,C,M),t==="focusout"&&M&&C.type==="number"&&M.memoizedProps.value!=null&&ls(C,"number",C.value)}switch(dt=M?ti(M):window,t){case"focusin":(ko(dt)||dt.contentEditable==="true")&&(yl=dt,ps=M,fi=null);break;case"focusout":fi=ps=yl=null;break;case"mousedown":bs=!0;break;case"contextmenu":case"mouseup":case"dragend":bs=!1,u0(K,n,q);break;case"selectionchange":if(iy)break;case"keydown":case"keyup":u0(K,n,q)}var xt;if(ys)t:{switch(t){case"compositionstart":var Mt="onCompositionStart";break t;case"compositionend":Mt="onCompositionEnd";break t;case"compositionupdate":Mt="onCompositionUpdate";break t}Mt=void 0}else ml?Ko(t,n)&&(Mt="onCompositionEnd"):t==="keydown"&&n.keyCode===229&&(Mt="onCompositionStart");Mt&&(Vo&&n.locale!=="ko"&&(ml||Mt!=="onCompositionStart"?Mt==="onCompositionEnd"&&ml&&(xt=Yo()):(la=q,rs="value"in la?la.value:la.textContent,ml=!0)),dt=ac(M,Mt),0<dt.length&&(Mt=new Zo(Mt,t,null,n,q),K.push({event:Mt,listeners:dt}),xt?Mt.data=xt:(xt=Jo(n),xt!==null&&(Mt.data=xt)))),(xt=k3?I3(t,n):W3(t,n))&&(Mt=ac(M,"onBeforeInput"),0<Mt.length&&(dt=new Zo("onBeforeInput","beforeinput",null,n,q),K.push({event:dt,listeners:Mt}),dt.data=xt)),Zy(K,t,M,n,q)}Md(K,e)})}function Ci(t,e,n){return{instance:t,listener:e,currentTarget:n}}function ac(t,e){for(var n=e+"Capture",a=[];t!==null;){var l=t,c=l.stateNode;if(l=l.tag,l!==5&&l!==26&&l!==27||c===null||(l=ei(t,n),l!=null&&a.unshift(Ci(t,l,c)),l=ei(t,e),l!=null&&a.push(Ci(t,l,c))),t.tag===3)return a;t=t.return}return[]}function Fy(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function Cd(t,e,n,a,l){for(var c=e._reactName,d=[];n!==null&&n!==a;){var g=n,S=g.alternate,M=g.stateNode;if(g=g.tag,S!==null&&S===a)break;g!==5&&g!==26&&g!==27||M===null||(S=M,l?(M=ei(n,c),M!=null&&d.unshift(Ci(n,M,S))):l||(M=ei(n,c),M!=null&&d.push(Ci(n,M,S)))),n=n.return}d.length!==0&&t.push({event:e,listeners:d})}var Ky=/\r\n?/g,Jy=/\u0000|\uFFFD/g;function Ld(t){return(typeof t=="string"?t:""+t).replace(Ky,`
`).replace(Jy,"")}function Hd(t,e){return e=Ld(e),Ld(t)===e}function Vt(t,e,n,a,l,c){switch(n){case"children":typeof a=="string"?e==="body"||e==="textarea"&&a===""||ol(t,a):(typeof a=="number"||typeof a=="bigint")&&e!=="body"&&ol(t,""+a);break;case"className":cu(t,"class",a);break;case"tabIndex":cu(t,"tabindex",a);break;case"dir":case"role":case"viewBox":case"width":case"height":cu(t,n,a);break;case"style":Ho(t,a,c);break;case"data":if(e!=="object"){cu(t,"data",a);break}case"src":case"href":if(a===""&&(e!=="a"||n!=="href")){t.removeAttribute(n);break}if(a==null||typeof a=="function"||typeof a=="symbol"||typeof a=="boolean"){t.removeAttribute(n);break}a=fu(""+a),t.setAttribute(n,a);break;case"action":case"formAction":if(typeof a=="function"){t.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof c=="function"&&(n==="formAction"?(e!=="input"&&Vt(t,e,"name",l.name,l,null),Vt(t,e,"formEncType",l.formEncType,l,null),Vt(t,e,"formMethod",l.formMethod,l,null),Vt(t,e,"formTarget",l.formTarget,l,null)):(Vt(t,e,"encType",l.encType,l,null),Vt(t,e,"method",l.method,l,null),Vt(t,e,"target",l.target,l,null)));if(a==null||typeof a=="symbol"||typeof a=="boolean"){t.removeAttribute(n);break}a=fu(""+a),t.setAttribute(n,a);break;case"onClick":a!=null&&(t.onclick=Cn);break;case"onScroll":a!=null&&Rt("scroll",t);break;case"onScrollEnd":a!=null&&Rt("scrollend",t);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(s(61));if(n=a.__html,n!=null){if(l.children!=null)throw Error(s(60));t.innerHTML=n}}break;case"multiple":t.multiple=a&&typeof a!="function"&&typeof a!="symbol";break;case"muted":t.muted=a&&typeof a!="function"&&typeof a!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(a==null||typeof a=="function"||typeof a=="boolean"||typeof a=="symbol"){t.removeAttribute("xlink:href");break}n=fu(""+a),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":a!=null&&typeof a!="function"&&typeof a!="symbol"?t.setAttribute(n,""+a):t.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":a&&typeof a!="function"&&typeof a!="symbol"?t.setAttribute(n,""):t.removeAttribute(n);break;case"capture":case"download":a===!0?t.setAttribute(n,""):a!==!1&&a!=null&&typeof a!="function"&&typeof a!="symbol"?t.setAttribute(n,a):t.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":a!=null&&typeof a!="function"&&typeof a!="symbol"&&!isNaN(a)&&1<=a?t.setAttribute(n,a):t.removeAttribute(n);break;case"rowSpan":case"start":a==null||typeof a=="function"||typeof a=="symbol"||isNaN(a)?t.removeAttribute(n):t.setAttribute(n,a);break;case"popover":Rt("beforetoggle",t),Rt("toggle",t),uu(t,"popover",a);break;case"xlinkActuate":Un(t,"http://www.w3.org/1999/xlink","xlink:actuate",a);break;case"xlinkArcrole":Un(t,"http://www.w3.org/1999/xlink","xlink:arcrole",a);break;case"xlinkRole":Un(t,"http://www.w3.org/1999/xlink","xlink:role",a);break;case"xlinkShow":Un(t,"http://www.w3.org/1999/xlink","xlink:show",a);break;case"xlinkTitle":Un(t,"http://www.w3.org/1999/xlink","xlink:title",a);break;case"xlinkType":Un(t,"http://www.w3.org/1999/xlink","xlink:type",a);break;case"xmlBase":Un(t,"http://www.w3.org/XML/1998/namespace","xml:base",a);break;case"xmlLang":Un(t,"http://www.w3.org/XML/1998/namespace","xml:lang",a);break;case"xmlSpace":Un(t,"http://www.w3.org/XML/1998/namespace","xml:space",a);break;case"is":uu(t,"is",a);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=E3.get(n)||n,uu(t,n,a))}}function Ff(t,e,n,a,l,c){switch(n){case"style":Ho(t,a,c);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(s(61));if(n=a.__html,n!=null){if(l.children!=null)throw Error(s(60));t.innerHTML=n}}break;case"children":typeof a=="string"?ol(t,a):(typeof a=="number"||typeof a=="bigint")&&ol(t,""+a);break;case"onScroll":a!=null&&Rt("scroll",t);break;case"onScrollEnd":a!=null&&Rt("scrollend",t);break;case"onClick":a!=null&&(t.onclick=Cn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Oo.hasOwnProperty(n))t:{if(n[0]==="o"&&n[1]==="n"&&(l=n.endsWith("Capture"),e=n.slice(2,l?n.length-7:void 0),c=t[Ze]||null,c=c!=null?c[n]:null,typeof c=="function"&&t.removeEventListener(e,c,l),typeof a=="function")){typeof c!="function"&&c!==null&&(n in t?t[n]=null:t.hasAttribute(n)&&t.removeAttribute(n)),t.addEventListener(e,a,l);break t}n in t?t[n]=a:a===!0?t.setAttribute(n,""):uu(t,n,a)}}}function ze(t,e,n){switch(e){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Rt("error",t),Rt("load",t);var a=!1,l=!1,c;for(c in n)if(n.hasOwnProperty(c)){var d=n[c];if(d!=null)switch(c){case"src":a=!0;break;case"srcSet":l=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(s(137,e));default:Vt(t,e,c,d,n,null)}}l&&Vt(t,e,"srcSet",n.srcSet,n,null),a&&Vt(t,e,"src",n.src,n,null);return;case"input":Rt("invalid",t);var g=c=d=l=null,S=null,M=null;for(a in n)if(n.hasOwnProperty(a)){var q=n[a];if(q!=null)switch(a){case"name":l=q;break;case"type":d=q;break;case"checked":S=q;break;case"defaultChecked":M=q;break;case"value":c=q;break;case"defaultValue":g=q;break;case"children":case"dangerouslySetInnerHTML":if(q!=null)throw Error(s(137,e));break;default:Vt(t,e,a,q,n,null)}}Mo(t,c,g,S,M,d,l,!1);return;case"select":Rt("invalid",t),a=d=c=null;for(l in n)if(n.hasOwnProperty(l)&&(g=n[l],g!=null))switch(l){case"value":c=g;break;case"defaultValue":d=g;break;case"multiple":a=g;default:Vt(t,e,l,g,n,null)}e=c,n=d,t.multiple=!!a,e!=null?rl(t,!!a,e,!1):n!=null&&rl(t,!!a,n,!0);return;case"textarea":Rt("invalid",t),c=l=a=null;for(d in n)if(n.hasOwnProperty(d)&&(g=n[d],g!=null))switch(d){case"value":a=g;break;case"defaultValue":l=g;break;case"children":c=g;break;case"dangerouslySetInnerHTML":if(g!=null)throw Error(s(91));break;default:Vt(t,e,d,g,n,null)}Co(t,a,l,c);return;case"option":for(S in n)if(n.hasOwnProperty(S)&&(a=n[S],a!=null))switch(S){case"selected":t.selected=a&&typeof a!="function"&&typeof a!="symbol";break;default:Vt(t,e,S,a,n,null)}return;case"dialog":Rt("beforetoggle",t),Rt("toggle",t),Rt("cancel",t),Rt("close",t);break;case"iframe":case"object":Rt("load",t);break;case"video":case"audio":for(a=0;a<Ui.length;a++)Rt(Ui[a],t);break;case"image":Rt("error",t),Rt("load",t);break;case"details":Rt("toggle",t);break;case"embed":case"source":case"link":Rt("error",t),Rt("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(M in n)if(n.hasOwnProperty(M)&&(a=n[M],a!=null))switch(M){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,e));default:Vt(t,e,M,a,n,null)}return;default:if(is(e)){for(q in n)n.hasOwnProperty(q)&&(a=n[q],a!==void 0&&Ff(t,e,q,a,n,void 0));return}}for(g in n)n.hasOwnProperty(g)&&(a=n[g],a!=null&&Vt(t,e,g,a,n,null))}function ky(t,e,n,a){switch(e){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var l=null,c=null,d=null,g=null,S=null,M=null,q=null;for(j in n){var K=n[j];if(n.hasOwnProperty(j)&&K!=null)switch(j){case"checked":break;case"value":break;case"defaultValue":S=K;default:a.hasOwnProperty(j)||Vt(t,e,j,null,a,K)}}for(var C in a){var j=a[C];if(K=n[C],a.hasOwnProperty(C)&&(j!=null||K!=null))switch(C){case"type":c=j;break;case"name":l=j;break;case"checked":M=j;break;case"defaultChecked":q=j;break;case"value":d=j;break;case"defaultValue":g=j;break;case"children":case"dangerouslySetInnerHTML":if(j!=null)throw Error(s(137,e));break;default:j!==K&&Vt(t,e,C,j,a,K)}}as(t,d,g,S,M,q,c,l);return;case"select":j=d=g=C=null;for(c in n)if(S=n[c],n.hasOwnProperty(c)&&S!=null)switch(c){case"value":break;case"multiple":j=S;default:a.hasOwnProperty(c)||Vt(t,e,c,null,a,S)}for(l in a)if(c=a[l],S=n[l],a.hasOwnProperty(l)&&(c!=null||S!=null))switch(l){case"value":C=c;break;case"defaultValue":g=c;break;case"multiple":d=c;default:c!==S&&Vt(t,e,l,c,a,S)}e=g,n=d,a=j,C!=null?rl(t,!!n,C,!1):!!a!=!!n&&(e!=null?rl(t,!!n,e,!0):rl(t,!!n,n?[]:"",!1));return;case"textarea":j=C=null;for(g in n)if(l=n[g],n.hasOwnProperty(g)&&l!=null&&!a.hasOwnProperty(g))switch(g){case"value":break;case"children":break;default:Vt(t,e,g,null,a,l)}for(d in a)if(l=a[d],c=n[d],a.hasOwnProperty(d)&&(l!=null||c!=null))switch(d){case"value":C=l;break;case"defaultValue":j=l;break;case"children":break;case"dangerouslySetInnerHTML":if(l!=null)throw Error(s(91));break;default:l!==c&&Vt(t,e,d,l,a,c)}Uo(t,C,j);return;case"option":for(var ft in n)if(C=n[ft],n.hasOwnProperty(ft)&&C!=null&&!a.hasOwnProperty(ft))switch(ft){case"selected":t.selected=!1;break;default:Vt(t,e,ft,null,a,C)}for(S in a)if(C=a[S],j=n[S],a.hasOwnProperty(S)&&C!==j&&(C!=null||j!=null))switch(S){case"selected":t.selected=C&&typeof C!="function"&&typeof C!="symbol";break;default:Vt(t,e,S,C,a,j)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var bt in n)C=n[bt],n.hasOwnProperty(bt)&&C!=null&&!a.hasOwnProperty(bt)&&Vt(t,e,bt,null,a,C);for(M in a)if(C=a[M],j=n[M],a.hasOwnProperty(M)&&C!==j&&(C!=null||j!=null))switch(M){case"children":case"dangerouslySetInnerHTML":if(C!=null)throw Error(s(137,e));break;default:Vt(t,e,M,C,a,j)}return;default:if(is(e)){for(var Qt in n)C=n[Qt],n.hasOwnProperty(Qt)&&C!==void 0&&!a.hasOwnProperty(Qt)&&Ff(t,e,Qt,void 0,a,C);for(q in a)C=a[q],j=n[q],!a.hasOwnProperty(q)||C===j||C===void 0&&j===void 0||Ff(t,e,q,C,a,j);return}}for(var x in n)C=n[x],n.hasOwnProperty(x)&&C!=null&&!a.hasOwnProperty(x)&&Vt(t,e,x,null,a,C);for(K in a)C=a[K],j=n[K],!a.hasOwnProperty(K)||C===j||C==null&&j==null||Vt(t,e,K,C,a,j)}function jd(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Iy(){if(typeof performance.getEntriesByType=="function"){for(var t=0,e=0,n=performance.getEntriesByType("resource"),a=0;a<n.length;a++){var l=n[a],c=l.transferSize,d=l.initiatorType,g=l.duration;if(c&&g&&jd(d)){for(d=0,g=l.responseEnd,a+=1;a<n.length;a++){var S=n[a],M=S.startTime;if(M>g)break;var q=S.transferSize,K=S.initiatorType;q&&jd(K)&&(S=S.responseEnd,d+=q*(S<g?1:(g-M)/(S-M)))}if(--a,e+=8*(c+d)/(l.duration/1e3),t++,10<t)break}}if(0<t)return e/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var Kf=null,Jf=null;function lc(t){return t.nodeType===9?t:t.ownerDocument}function Bd(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Yd(t,e){if(t===0)switch(e){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&e==="foreignObject"?0:t}function kf(t,e){return t==="textarea"||t==="noscript"||typeof e.children=="string"||typeof e.children=="number"||typeof e.children=="bigint"||typeof e.dangerouslySetInnerHTML=="object"&&e.dangerouslySetInnerHTML!==null&&e.dangerouslySetInnerHTML.__html!=null}var If=null;function Wy(){var t=window.event;return t&&t.type==="popstate"?t===If?!1:(If=t,!0):(If=null,!1)}var Gd=typeof setTimeout=="function"?setTimeout:void 0,$y=typeof clearTimeout=="function"?clearTimeout:void 0,qd=typeof Promise=="function"?Promise:void 0,Py=typeof queueMicrotask=="function"?queueMicrotask:typeof qd<"u"?function(t){return qd.resolve(null).then(t).catch(tg)}:Gd;function tg(t){setTimeout(function(){throw t})}function Sa(t){return t==="head"}function Zd(t,e){var n=e,a=0;do{var l=n.nextSibling;if(t.removeChild(n),l&&l.nodeType===8)if(n=l.data,n==="/$"||n==="/&"){if(a===0){t.removeChild(l),Zl(e);return}a--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")a++;else if(n==="html")Li(t.ownerDocument.documentElement);else if(n==="head"){n=t.ownerDocument.head,Li(n);for(var c=n.firstChild;c;){var d=c.nextSibling,g=c.nodeName;c[Pl]||g==="SCRIPT"||g==="STYLE"||g==="LINK"&&c.rel.toLowerCase()==="stylesheet"||n.removeChild(c),c=d}}else n==="body"&&Li(t.ownerDocument.body);n=l}while(n);Zl(e)}function Xd(t,e){var n=t;t=0;do{var a=n.nextSibling;if(n.nodeType===1?e?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",n.getAttribute("style")===""&&n.removeAttribute("style")):n.nodeType===3&&(e?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),a&&a.nodeType===8)if(n=a.data,n==="/$"){if(t===0)break;t--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||t++;n=a}while(n)}function Wf(t){var e=t.firstChild;for(e&&e.nodeType===10&&(e=e.nextSibling);e;){var n=e;switch(e=e.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":Wf(n),es(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}t.removeChild(n)}}function eg(t,e,n,a){for(;t.nodeType===1;){var l=n;if(t.nodeName.toLowerCase()!==e.toLowerCase()){if(!a&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(a){if(!t[Pl])switch(e){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(c=t.getAttribute("rel"),c==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(c!==l.rel||t.getAttribute("href")!==(l.href==null||l.href===""?null:l.href)||t.getAttribute("crossorigin")!==(l.crossOrigin==null?null:l.crossOrigin)||t.getAttribute("title")!==(l.title==null?null:l.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(c=t.getAttribute("src"),(c!==(l.src==null?null:l.src)||t.getAttribute("type")!==(l.type==null?null:l.type)||t.getAttribute("crossorigin")!==(l.crossOrigin==null?null:l.crossOrigin))&&c&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(e==="input"&&t.type==="hidden"){var c=l.name==null?null:""+l.name;if(l.type==="hidden"&&t.getAttribute("name")===c)return t}else return t;if(t=mn(t.nextSibling),t===null)break}return null}function ng(t,e,n){if(e==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!n||(t=mn(t.nextSibling),t===null))return null;return t}function Vd(t,e){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!e||(t=mn(t.nextSibling),t===null))return null;return t}function $f(t){return t.data==="$?"||t.data==="$~"}function Pf(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function ag(t,e){var n=t.ownerDocument;if(t.data==="$~")t._reactRetry=e;else if(t.data!=="$?"||n.readyState!=="loading")e();else{var a=function(){e(),n.removeEventListener("DOMContentLoaded",a)};n.addEventListener("DOMContentLoaded",a),t._reactRetry=a}}function mn(t){for(;t!=null;t=t.nextSibling){var e=t.nodeType;if(e===1||e===3)break;if(e===8){if(e=t.data,e==="$"||e==="$!"||e==="$?"||e==="$~"||e==="&"||e==="F!"||e==="F")break;if(e==="/$"||e==="/&")return null}}return t}var tr=null;function Qd(t){t=t.nextSibling;for(var e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="/$"||n==="/&"){if(e===0)return mn(t.nextSibling);e--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||e++}t=t.nextSibling}return null}function Fd(t){t=t.previousSibling;for(var e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"){if(e===0)return t;e--}else n!=="/$"&&n!=="/&"||e++}t=t.previousSibling}return null}function Kd(t,e,n){switch(e=lc(n),t){case"html":if(t=e.documentElement,!t)throw Error(s(452));return t;case"head":if(t=e.head,!t)throw Error(s(453));return t;case"body":if(t=e.body,!t)throw Error(s(454));return t;default:throw Error(s(451))}}function Li(t){for(var e=t.attributes;e.length;)t.removeAttributeNode(e[0]);es(t)}var yn=new Map,Jd=new Set;function ic(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var In=V.d;V.d={f:lg,r:ig,D:ug,C:cg,L:sg,m:fg,X:og,S:rg,M:dg};function lg(){var t=In.f(),e=Iu();return t||e}function ig(t){var e=cl(t);e!==null&&e.tag===5&&e.type==="form"?o2(e):In.r(t)}var Yl=typeof document>"u"?null:document;function kd(t,e,n){var a=Yl;if(a&&typeof e=="string"&&e){var l=cn(e);l='link[rel="'+t+'"][href="'+l+'"]',typeof n=="string"&&(l+='[crossorigin="'+n+'"]'),Jd.has(l)||(Jd.add(l),t={rel:t,crossOrigin:n,href:e},a.querySelector(l)===null&&(e=a.createElement("link"),ze(e,"link",t),be(e),a.head.appendChild(e)))}}function ug(t){In.D(t),kd("dns-prefetch",t,null)}function cg(t,e){In.C(t,e),kd("preconnect",t,e)}function sg(t,e,n){In.L(t,e,n);var a=Yl;if(a&&t&&e){var l='link[rel="preload"][as="'+cn(e)+'"]';e==="image"&&n&&n.imageSrcSet?(l+='[imagesrcset="'+cn(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(l+='[imagesizes="'+cn(n.imageSizes)+'"]')):l+='[href="'+cn(t)+'"]';var c=l;switch(e){case"style":c=Gl(t);break;case"script":c=ql(t)}yn.has(c)||(t=p({rel:"preload",href:e==="image"&&n&&n.imageSrcSet?void 0:t,as:e},n),yn.set(c,t),a.querySelector(l)!==null||e==="style"&&a.querySelector(Hi(c))||e==="script"&&a.querySelector(ji(c))||(e=a.createElement("link"),ze(e,"link",t),be(e),a.head.appendChild(e)))}}function fg(t,e){In.m(t,e);var n=Yl;if(n&&t){var a=e&&typeof e.as=="string"?e.as:"script",l='link[rel="modulepreload"][as="'+cn(a)+'"][href="'+cn(t)+'"]',c=l;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":c=ql(t)}if(!yn.has(c)&&(t=p({rel:"modulepreload",href:t},e),yn.set(c,t),n.querySelector(l)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(ji(c)))return}a=n.createElement("link"),ze(a,"link",t),be(a),n.head.appendChild(a)}}}function rg(t,e,n){In.S(t,e,n);var a=Yl;if(a&&t){var l=sl(a).hoistableStyles,c=Gl(t);e=e||"default";var d=l.get(c);if(!d){var g={loading:0,preload:null};if(d=a.querySelector(Hi(c)))g.loading=5;else{t=p({rel:"stylesheet",href:t,"data-precedence":e},n),(n=yn.get(c))&&er(t,n);var S=d=a.createElement("link");be(S),ze(S,"link",t),S._p=new Promise(function(M,q){S.onload=M,S.onerror=q}),S.addEventListener("load",function(){g.loading|=1}),S.addEventListener("error",function(){g.loading|=2}),g.loading|=4,uc(d,e,a)}d={type:"stylesheet",instance:d,count:1,state:g},l.set(c,d)}}}function og(t,e){In.X(t,e);var n=Yl;if(n&&t){var a=sl(n).hoistableScripts,l=ql(t),c=a.get(l);c||(c=n.querySelector(ji(l)),c||(t=p({src:t,async:!0},e),(e=yn.get(l))&&nr(t,e),c=n.createElement("script"),be(c),ze(c,"link",t),n.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},a.set(l,c))}}function dg(t,e){In.M(t,e);var n=Yl;if(n&&t){var a=sl(n).hoistableScripts,l=ql(t),c=a.get(l);c||(c=n.querySelector(ji(l)),c||(t=p({src:t,async:!0,type:"module"},e),(e=yn.get(l))&&nr(t,e),c=n.createElement("script"),be(c),ze(c,"link",t),n.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},a.set(l,c))}}function Id(t,e,n,a){var l=(l=L.current)?ic(l):null;if(!l)throw Error(s(446));switch(t){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(e=Gl(n.href),n=sl(l).hoistableStyles,a=n.get(e),a||(a={type:"style",instance:null,count:0,state:null},n.set(e,a)),a):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){t=Gl(n.href);var c=sl(l).hoistableStyles,d=c.get(t);if(d||(l=l.ownerDocument||l,d={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},c.set(t,d),(c=l.querySelector(Hi(t)))&&!c._p&&(d.instance=c,d.state.loading=5),yn.has(t)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},yn.set(t,n),c||hg(l,t,n,d.state))),e&&a===null)throw Error(s(528,""));return d}if(e&&a!==null)throw Error(s(529,""));return null;case"script":return e=n.async,n=n.src,typeof n=="string"&&e&&typeof e!="function"&&typeof e!="symbol"?(e=ql(n),n=sl(l).hoistableScripts,a=n.get(e),a||(a={type:"script",instance:null,count:0,state:null},n.set(e,a)),a):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,t))}}function Gl(t){return'href="'+cn(t)+'"'}function Hi(t){return'link[rel="stylesheet"]['+t+"]"}function Wd(t){return p({},t,{"data-precedence":t.precedence,precedence:null})}function hg(t,e,n,a){t.querySelector('link[rel="preload"][as="style"]['+e+"]")?a.loading=1:(e=t.createElement("link"),a.preload=e,e.addEventListener("load",function(){return a.loading|=1}),e.addEventListener("error",function(){return a.loading|=2}),ze(e,"link",n),be(e),t.head.appendChild(e))}function ql(t){return'[src="'+cn(t)+'"]'}function ji(t){return"script[async]"+t}function $d(t,e,n){if(e.count++,e.instance===null)switch(e.type){case"style":var a=t.querySelector('style[data-href~="'+cn(n.href)+'"]');if(a)return e.instance=a,be(a),a;var l=p({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return a=(t.ownerDocument||t).createElement("style"),be(a),ze(a,"style",l),uc(a,n.precedence,t),e.instance=a;case"stylesheet":l=Gl(n.href);var c=t.querySelector(Hi(l));if(c)return e.state.loading|=4,e.instance=c,be(c),c;a=Wd(n),(l=yn.get(l))&&er(a,l),c=(t.ownerDocument||t).createElement("link"),be(c);var d=c;return d._p=new Promise(function(g,S){d.onload=g,d.onerror=S}),ze(c,"link",a),e.state.loading|=4,uc(c,n.precedence,t),e.instance=c;case"script":return c=ql(n.src),(l=t.querySelector(ji(c)))?(e.instance=l,be(l),l):(a=n,(l=yn.get(c))&&(a=p({},n),nr(a,l)),t=t.ownerDocument||t,l=t.createElement("script"),be(l),ze(l,"link",a),t.head.appendChild(l),e.instance=l);case"void":return null;default:throw Error(s(443,e.type))}else e.type==="stylesheet"&&(e.state.loading&4)===0&&(a=e.instance,e.state.loading|=4,uc(a,n.precedence,t));return e.instance}function uc(t,e,n){for(var a=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),l=a.length?a[a.length-1]:null,c=l,d=0;d<a.length;d++){var g=a[d];if(g.dataset.precedence===e)c=g;else if(c!==l)break}c?c.parentNode.insertBefore(t,c.nextSibling):(e=n.nodeType===9?n.head:n,e.insertBefore(t,e.firstChild))}function er(t,e){t.crossOrigin==null&&(t.crossOrigin=e.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=e.referrerPolicy),t.title==null&&(t.title=e.title)}function nr(t,e){t.crossOrigin==null&&(t.crossOrigin=e.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=e.referrerPolicy),t.integrity==null&&(t.integrity=e.integrity)}var cc=null;function Pd(t,e,n){if(cc===null){var a=new Map,l=cc=new Map;l.set(n,a)}else l=cc,a=l.get(n),a||(a=new Map,l.set(n,a));if(a.has(t))return a;for(a.set(t,null),n=n.getElementsByTagName(t),l=0;l<n.length;l++){var c=n[l];if(!(c[Pl]||c[we]||t==="link"&&c.getAttribute("rel")==="stylesheet")&&c.namespaceURI!=="http://www.w3.org/2000/svg"){var d=c.getAttribute(e)||"";d=t+d;var g=a.get(d);g?g.push(c):a.set(d,[c])}}return a}function t1(t,e,n){t=t.ownerDocument||t,t.head.insertBefore(n,e==="title"?t.querySelector("head > title"):null)}function mg(t,e,n){if(n===1||e.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof e.precedence!="string"||typeof e.href!="string"||e.href==="")break;return!0;case"link":if(typeof e.rel!="string"||typeof e.href!="string"||e.href===""||e.onLoad||e.onError)break;switch(e.rel){case"stylesheet":return t=e.disabled,typeof e.precedence=="string"&&t==null;default:return!0}case"script":if(e.async&&typeof e.async!="function"&&typeof e.async!="symbol"&&!e.onLoad&&!e.onError&&e.src&&typeof e.src=="string")return!0}return!1}function e1(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function yg(t,e,n,a){if(n.type==="stylesheet"&&(typeof a.media!="string"||matchMedia(a.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var l=Gl(a.href),c=e.querySelector(Hi(l));if(c){e=c._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(t.count++,t=sc.bind(t),e.then(t,t)),n.state.loading|=4,n.instance=c,be(c);return}c=e.ownerDocument||e,a=Wd(a),(l=yn.get(l))&&er(a,l),c=c.createElement("link"),be(c);var d=c;d._p=new Promise(function(g,S){d.onload=g,d.onerror=S}),ze(c,"link",a),n.instance=c}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(n,e),(e=n.state.preload)&&(n.state.loading&3)===0&&(t.count++,n=sc.bind(t),e.addEventListener("load",n),e.addEventListener("error",n))}}var ar=0;function gg(t,e){return t.stylesheets&&t.count===0&&rc(t,t.stylesheets),0<t.count||0<t.imgCount?function(n){var a=setTimeout(function(){if(t.stylesheets&&rc(t,t.stylesheets),t.unsuspend){var c=t.unsuspend;t.unsuspend=null,c()}},6e4+e);0<t.imgBytes&&ar===0&&(ar=62500*Iy());var l=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&rc(t,t.stylesheets),t.unsuspend)){var c=t.unsuspend;t.unsuspend=null,c()}},(t.imgBytes>ar?50:800)+e);return t.unsuspend=n,function(){t.unsuspend=null,clearTimeout(a),clearTimeout(l)}}:null}function sc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)rc(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var fc=null;function rc(t,e){t.stylesheets=null,t.unsuspend!==null&&(t.count++,fc=new Map,e.forEach(vg,t),fc=null,sc.call(t))}function vg(t,e){if(!(e.state.loading&4)){var n=fc.get(t);if(n)var a=n.get(null);else{n=new Map,fc.set(t,n);for(var l=t.querySelectorAll("link[data-precedence],style[data-precedence]"),c=0;c<l.length;c++){var d=l[c];(d.nodeName==="LINK"||d.getAttribute("media")!=="not all")&&(n.set(d.dataset.precedence,d),a=d)}a&&n.set(null,a)}l=e.instance,d=l.getAttribute("data-precedence"),c=n.get(d)||a,c===a&&n.set(null,l),n.set(d,l),this.count++,a=sc.bind(this),l.addEventListener("load",a),l.addEventListener("error",a),c?c.parentNode.insertBefore(l,c.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(l,t.firstChild)),e.state.loading|=4}}var Bi={$$typeof:$,Provider:null,Consumer:null,_currentValue:lt,_currentValue2:lt,_threadCount:0};function _g(t,e,n,a,l,c,d,g,S){this.tag=1,this.containerInfo=t,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Wc(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Wc(0),this.hiddenUpdates=Wc(null),this.identifierPrefix=a,this.onUncaughtError=l,this.onCaughtError=c,this.onRecoverableError=d,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=S,this.incompleteTransitions=new Map}function n1(t,e,n,a,l,c,d,g,S,M,q,K){return t=new _g(t,e,n,d,S,M,q,K,g),e=1,c===!0&&(e|=24),c=We(3,null,null,e),t.current=c,c.stateNode=t,e=Ls(),e.refCount++,t.pooledCache=e,e.refCount++,c.memoizedState={element:a,isDehydrated:n,cache:e},Ys(c),t}function a1(t){return t?(t=_l,t):_l}function l1(t,e,n,a,l,c){l=a1(l),a.context===null?a.context=l:a.pendingContext=l,a=ra(e),a.payload={element:n},c=c===void 0?null:c,c!==null&&(a.callback=c),n=oa(t,a,e),n!==null&&(Je(n,t,e),gi(n,t,e))}function i1(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var n=t.retryLane;t.retryLane=n!==0&&n<e?n:e}}function lr(t,e){i1(t,e),(t=t.alternate)&&i1(t,e)}function u1(t){if(t.tag===13||t.tag===31){var e=Ya(t,67108864);e!==null&&Je(e,t,67108864),lr(t,67108864)}}function c1(t){if(t.tag===13||t.tag===31){var e=nn();e=$c(e);var n=Ya(t,e);n!==null&&Je(n,t,e),lr(t,e)}}var oc=!0;function pg(t,e,n,a){var l=N.T;N.T=null;var c=V.p;try{V.p=2,ir(t,e,n,a)}finally{V.p=c,N.T=l}}function bg(t,e,n,a){var l=N.T;N.T=null;var c=V.p;try{V.p=8,ir(t,e,n,a)}finally{V.p=c,N.T=l}}function ir(t,e,n,a){if(oc){var l=ur(a);if(l===null)Qf(t,e,a,dc,n),f1(t,a);else if(Eg(l,t,e,n,a))a.stopPropagation();else if(f1(t,a),e&4&&-1<Sg.indexOf(t)){for(;l!==null;){var c=cl(l);if(c!==null)switch(c.tag){case 3:if(c=c.stateNode,c.current.memoizedState.isDehydrated){var d=pn(c.pendingLanes);if(d!==0){var g=c;for(g.pendingLanes|=2,g.entangledLanes|=2;d;){var S=1<<31-F(d);g.entanglements[1]|=S,d&=~S}zn(c),(Bt&6)===0&&(Ju=xe()+500,Mi(0))}}break;case 31:case 13:g=Ya(c,2),g!==null&&Je(g,c,2),Iu(),lr(c,2)}if(c=ur(a),c===null&&Qf(t,e,a,dc,n),c===l)break;l=c}l!==null&&a.stopPropagation()}else Qf(t,e,a,null,n)}}function ur(t){return t=cs(t),cr(t)}var dc=null;function cr(t){if(dc=null,t=ul(t),t!==null){var e=o(t);if(e===null)t=null;else{var n=e.tag;if(n===13){if(t=h(e),t!==null)return t;t=null}else if(n===31){if(t=v(e),t!==null)return t;t=null}else if(n===3){if(e.stateNode.current.memoizedState.isDehydrated)return e.tag===3?e.stateNode.containerInfo:null;t=null}else e!==t&&(t=null)}}return dc=t,null}function s1(t){switch(t){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(al()){case ll:return 2;case _e:return 8;case ea:case Jc:return 32;case Wl:return 268435456;default:return 32}default:return 32}}var sr=!1,Ea=null,Ta=null,Aa=null,Yi=new Map,Gi=new Map,xa=[],Sg="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function f1(t,e){switch(t){case"focusin":case"focusout":Ea=null;break;case"dragenter":case"dragleave":Ta=null;break;case"mouseover":case"mouseout":Aa=null;break;case"pointerover":case"pointerout":Yi.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":Gi.delete(e.pointerId)}}function qi(t,e,n,a,l,c){return t===null||t.nativeEvent!==c?(t={blockedOn:e,domEventName:n,eventSystemFlags:a,nativeEvent:c,targetContainers:[l]},e!==null&&(e=cl(e),e!==null&&u1(e)),t):(t.eventSystemFlags|=a,e=t.targetContainers,l!==null&&e.indexOf(l)===-1&&e.push(l),t)}function Eg(t,e,n,a,l){switch(e){case"focusin":return Ea=qi(Ea,t,e,n,a,l),!0;case"dragenter":return Ta=qi(Ta,t,e,n,a,l),!0;case"mouseover":return Aa=qi(Aa,t,e,n,a,l),!0;case"pointerover":var c=l.pointerId;return Yi.set(c,qi(Yi.get(c)||null,t,e,n,a,l)),!0;case"gotpointercapture":return c=l.pointerId,Gi.set(c,qi(Gi.get(c)||null,t,e,n,a,l)),!0}return!1}function r1(t){var e=ul(t.target);if(e!==null){var n=o(e);if(n!==null){if(e=n.tag,e===13){if(e=h(n),e!==null){t.blockedOn=e,Ao(t.priority,function(){c1(n)});return}}else if(e===31){if(e=v(n),e!==null){t.blockedOn=e,Ao(t.priority,function(){c1(n)});return}}else if(e===3&&n.stateNode.current.memoizedState.isDehydrated){t.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}t.blockedOn=null}function hc(t){if(t.blockedOn!==null)return!1;for(var e=t.targetContainers;0<e.length;){var n=ur(t.nativeEvent);if(n===null){n=t.nativeEvent;var a=new n.constructor(n.type,n);us=a,n.target.dispatchEvent(a),us=null}else return e=cl(n),e!==null&&u1(e),t.blockedOn=n,!1;e.shift()}return!0}function o1(t,e,n){hc(t)&&n.delete(e)}function Tg(){sr=!1,Ea!==null&&hc(Ea)&&(Ea=null),Ta!==null&&hc(Ta)&&(Ta=null),Aa!==null&&hc(Aa)&&(Aa=null),Yi.forEach(o1),Gi.forEach(o1)}function mc(t,e){t.blockedOn===e&&(t.blockedOn=null,sr||(sr=!0,u.unstable_scheduleCallback(u.unstable_NormalPriority,Tg)))}var yc=null;function d1(t){yc!==t&&(yc=t,u.unstable_scheduleCallback(u.unstable_NormalPriority,function(){yc===t&&(yc=null);for(var e=0;e<t.length;e+=3){var n=t[e],a=t[e+1],l=t[e+2];if(typeof a!="function"){if(cr(a||n)===null)continue;break}var c=cl(n);c!==null&&(t.splice(e,3),e-=3,uf(c,{pending:!0,data:l,method:n.method,action:a},a,l))}}))}function Zl(t){function e(S){return mc(S,t)}Ea!==null&&mc(Ea,t),Ta!==null&&mc(Ta,t),Aa!==null&&mc(Aa,t),Yi.forEach(e),Gi.forEach(e);for(var n=0;n<xa.length;n++){var a=xa[n];a.blockedOn===t&&(a.blockedOn=null)}for(;0<xa.length&&(n=xa[0],n.blockedOn===null);)r1(n),n.blockedOn===null&&xa.shift();if(n=(t.ownerDocument||t).$$reactFormReplay,n!=null)for(a=0;a<n.length;a+=3){var l=n[a],c=n[a+1],d=l[Ze]||null;if(typeof c=="function")d||d1(n);else if(d){var g=null;if(c&&c.hasAttribute("formAction")){if(l=c,d=c[Ze]||null)g=d.formAction;else if(cr(l)!==null)continue}else g=d.action;typeof g=="function"?n[a+1]=g:(n.splice(a,3),a-=3),d1(n)}}}function h1(){function t(c){c.canIntercept&&c.info==="react-transition"&&c.intercept({handler:function(){return new Promise(function(d){return l=d})},focusReset:"manual",scroll:"manual"})}function e(){l!==null&&(l(),l=null),a||setTimeout(n,20)}function n(){if(!a&&!navigation.transition){var c=navigation.currentEntry;c&&c.url!=null&&navigation.navigate(c.url,{state:c.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var a=!1,l=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",e),navigation.addEventListener("navigateerror",e),setTimeout(n,100),function(){a=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",e),navigation.removeEventListener("navigateerror",e),l!==null&&(l(),l=null)}}}function fr(t){this._internalRoot=t}gc.prototype.render=fr.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(s(409));var n=e.current,a=nn();l1(n,a,t,e,null,null)},gc.prototype.unmount=fr.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;l1(t.current,2,null,t,null,null),Iu(),e[il]=null}};function gc(t){this._internalRoot=t}gc.prototype.unstable_scheduleHydration=function(t){if(t){var e=To();t={blockedOn:null,target:t,priority:e};for(var n=0;n<xa.length&&e!==0&&e<xa[n].priority;n++);xa.splice(n,0,t),n===0&&r1(t)}};var m1=i.version;if(m1!=="19.2.1")throw Error(s(527,m1,"19.2.1"));V.findDOMNode=function(t){var e=t._reactInternals;if(e===void 0)throw typeof t.render=="function"?Error(s(188)):(t=Object.keys(t).join(","),Error(s(268,t)));return t=y(e),t=t!==null?_(t):null,t=t===null?null:t.stateNode,t};var Ag={bundleType:0,version:"19.2.1",rendererPackageName:"react-dom",currentDispatcherRef:N,reconcilerVersion:"19.2.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var vc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!vc.isDisabled&&vc.supportsFiber)try{Ua=vc.inject(Ag),Y=vc}catch{}}return Xi.createRoot=function(t,e){if(!r(t))throw Error(s(299));var n=!1,a="",l=S2,c=E2,d=T2;return e!=null&&(e.unstable_strictMode===!0&&(n=!0),e.identifierPrefix!==void 0&&(a=e.identifierPrefix),e.onUncaughtError!==void 0&&(l=e.onUncaughtError),e.onCaughtError!==void 0&&(c=e.onCaughtError),e.onRecoverableError!==void 0&&(d=e.onRecoverableError)),e=n1(t,1,!1,null,null,n,a,null,l,c,d,h1),t[il]=e.current,Vf(t),new fr(e)},Xi.hydrateRoot=function(t,e,n){if(!r(t))throw Error(s(299));var a=!1,l="",c=S2,d=E2,g=T2,S=null;return n!=null&&(n.unstable_strictMode===!0&&(a=!0),n.identifierPrefix!==void 0&&(l=n.identifierPrefix),n.onUncaughtError!==void 0&&(c=n.onUncaughtError),n.onCaughtError!==void 0&&(d=n.onCaughtError),n.onRecoverableError!==void 0&&(g=n.onRecoverableError),n.formState!==void 0&&(S=n.formState)),e=n1(t,1,!0,e,n??null,a,l,S,c,d,g,h1),e.context=a1(null),n=e.current,a=nn(),a=$c(a),l=ra(a),l.callback=null,oa(n,l,a),n=a,e.current.lanes=n,$l(e,n),zn(e),t[il]=e.current,Vf(t),new gc(e)},Xi.version="19.2.1",Xi}var A1;function Lg(){if(A1)return dr.exports;A1=1;function u(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(u)}catch(i){console.error(i)}}return u(),dr.exports=Cg(),dr.exports}var Hg=Lg();function jg(){const u=mt.useRef(null),[i]=yh(u);return[i,u]}function yh(u){const[i,f]=mt.useState(new DOMRect(0,0,10,10)),s=mt.useCallback(()=>{const r=u==null?void 0:u.current;r&&f(r.getBoundingClientRect())},[u]);return mt.useLayoutEffect(()=>{const r=u==null?void 0:u.current;if(!r)return;s();const o=new ResizeObserver(s);return o.observe(r),window.addEventListener("resize",s),()=>{o.disconnect(),window.removeEventListener("resize",s)}},[s,u]),[i,s]}function x1(u,i){u&&(i=Pa.getObject(u,i));const[f,s]=mt.useState(i),r=mt.useCallback(o=>{u?Pa.setObject(u,o):s(o)},[u,s]);return mt.useEffect(()=>{if(u){const o=()=>s(Pa.getObject(u,i));return Pa.onChangeEmitter.addEventListener(u,o),()=>Pa.onChangeEmitter.removeEventListener(u,o)}},[i,u]),[f,r]}class Bg{constructor(){this.onChangeEmitter=new EventTarget}getString(i,f){return localStorage[i]||f}setString(i,f){var s;localStorage[i]=f,this.onChangeEmitter.dispatchEvent(new Event(i)),(s=window.saveSettings)==null||s.call(window)}getObject(i,f){if(!localStorage[i])return f;try{return JSON.parse(localStorage[i])}catch{return f}}setObject(i,f){var s;localStorage[i]=JSON.stringify(f),this.onChangeEmitter.dispatchEvent(new Event(i)),(s=window.saveSettings)==null||s.call(window)}}const Pa=new Bg;function Ji(...u){return u.filter(Boolean).join(" ")}function Yg(u){u&&(u!=null&&u.scrollIntoViewIfNeeded?u.scrollIntoViewIfNeeded(!1):u==null||u.scrollIntoView())}const Gg="system",gh="theme",qg=[{label:"Dark mode",value:"dark-mode"},{label:"Light mode",value:"light-mode"},{label:"System",value:"system"}],vh=window.matchMedia("(prefers-color-scheme: dark)");function Zg(){document.playwrightThemeInitialized||(document.playwrightThemeInitialized=!0,document.defaultView.addEventListener("focus",u=>{u.target.document.nodeType===Node.DOCUMENT_NODE&&document.body.classList.remove("inactive")},!1),document.defaultView.addEventListener("blur",u=>{document.body.classList.add("inactive")},!1),Dr(zr()),vh.addEventListener("change",()=>{Dr(zr())}))}const Xg=new Set;function Dr(u){const i=Vg(),f=u==="system"?vh.matches?"dark-mode":"light-mode":u;if(i!==f){i&&document.documentElement.classList.remove(i),document.documentElement.classList.add(f);for(const s of Xg)s(f)}}function zr(){return Pa.getString(gh,Gg)}function Vg(){return document.documentElement.classList.contains("dark-mode")?"dark-mode":document.documentElement.classList.contains("light-mode")?"light-mode":null}function Qg(){const[u,i]=mt.useState(zr());return mt.useEffect(()=>{Pa.setString(gh,u),Dr(u)},[u]),[u,i]}const Fg="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='-10%20-10%20276%20276'%3e%3clinearGradient%20id='a'%20x1='145'%20x2='34'%20y1='253'%20y2='61'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0'%20stop-color='%231e8e3e'/%3e%3cstop%20offset='1'%20stop-color='%2334a853'/%3e%3c/linearGradient%3e%3clinearGradient%20id='b'%20x1='111'%20x2='222'%20y1='254'%20y2='62'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0'%20stop-color='%23fcc934'/%3e%3cstop%20offset='1'%20stop-color='%23fbbc04'/%3e%3c/linearGradient%3e%3clinearGradient%20id='c'%20x1='17'%20x2='239'%20y1='80'%20y2='80'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0'%20stop-color='%23d93025'/%3e%3cstop%20offset='1'%20stop-color='%23ea4335'/%3e%3c/linearGradient%3e%3ccircle%20cx='128'%20cy='128'%20r='64'%20fill='%23fff'/%3e%3cpath%20fill='url(%23a)'%20d='M96%20183.4A63.7%2063.7%200%200%201%2072.6%20160L17.2%2064A128%20128%200%200%200%20128%20256l55.4-96A64%2064%200%200%201%2096%20183.4Z'/%3e%3cpath%20fill='url(%23b)'%20d='M192%20128a63.7%2063.7%200%200%201-8.6%2032L128%20256A128%20128%200%200%200%20238.9%2064h-111a64%2064%200%200%201%2064%2064Z'/%3e%3ccircle%20cx='128'%20cy='128'%20r='52'%20fill='%231a73e8'/%3e%3cpath%20fill='url(%23c)'%20d='M96%2072.6a63.7%2063.7%200%200%201%2032-8.6h110.8a128%20128%200%200%200-221.7%200l55.5%2096A64%2064%200%200%201%2096%2072.6Z'/%3e%3c/svg%3e",Kg="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20fill='%23fff'%20viewBox='-190%20-190%205180%205180'%3e%3clinearGradient%20id='a'%20x1='2149'%20x2='4207'%20y1='4638'%20y2='1076'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0'%20stop-color='%23fcc934'/%3e%3cstop%20offset='1'%20stop-color='%23fbbc04'/%3e%3c/linearGradient%3e%3clinearGradient%20id='b'%20x1='2823'%20x2='-214'%20y1='4031'%20y2='2278'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0'%20stop-color='%231e8e3e'/%3e%3cstop%20offset='1'%20stop-color='%2334a853'/%3e%3c/linearGradient%3e%3clinearGradient%20id='c'%20x1='371'%20x2='4429'%20y1='1501'%20y2='1501'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0'%20stop-color='%23d93025'/%3e%3cstop%20offset='1'%20stop-color='%23ea4335'/%3e%3c/linearGradient%3e%3cpath%20fill='%23202124'%20d='M4400%203676c-45%2080-93%20157-145%20228l541-228z'/%3e%3cpath%20d='M2399%203600a1200%201200%200%201%200-1%200z'/%3e%3cpath%20fill='url(%23a)'%20d='M3440%203001%202402%204800a2394%202394%200%200%200%202398-2400c0-421-112-835-323-1200H2400l-2%201a1198%201198%200%200%201%201041%201800z'/%3e%3cpath%20fill='url(%23b)'%20d='M1360%203001%20322%201202a2398%202398%200%200%200%202078%203598l1038-1799v-1a1199%201199%200%200%201-2078%202z'/%3e%3cpath%20fill='%231a73e8'%20d='M2399%203351a950%20950%200%201%200%200-1900%20950%20950%200%200%200%200%201900z'/%3e%3cpath%20fill='url(%23c)'%20d='M2399%201200h2076a2396%202396%200%200%200-4153%202l1038%201800h2a1200%201200%200%200%201%201037-1802z'/%3e%3cpath%20fill='%233c4043'%20d='M1575%202250c0-40%2033-74%2075-74h3149v1500H1649a75%2075%200%200%201-74-75z'/%3e%3cpath%20d='M2442%202883a199%20199%200%200%200%20115-185c1-44-10-87-34-124a244%20244%200%200%200-94-86c-38-20-81-30-125-30h-317v880h334c46%201%2090-10%20131-32a250%20250%200%200%200%20135-220%20216%20216%200%200%200-145-203zm-40%20325c-23%2014-50%2022-76%2021h-226v-286h222c28%200%2055%206%2079%2020a146%20146%200%200%201%2070%20123c0%2024-6%2047-17%2068-13%2022-30%2041-53%2054zm25-444a140%20140%200%200%201-124%2070h-203v-267h209c25%200%2050%207%2071%2020a140%20140%200%200%201%2065%20113c0%2022-6%2044-18%2063zm733-40a296%20296%200%200%200-160-42%20292%20292%200%200%200-264%20171%20389%20389%200%200%200%203%20340%20300%20300%200%200%200%20270%20164%20300%20300%200%200%200%20276-167l3-5-96-48-3%205c-40%2072-100%20110-176%20110a192%20192%200%200%201-168-95%20240%20240%200%200%201-32-112h481l1-4a377%20377%200%200%200-32-200%20277%20277%200%200%200-103-117zm-160%2064c35-1%2070%208%20100%2026%2025%2015%2045%2037%2059%2064%2010%2022%2018%2045%2020%2070h-360c10-44%2031-84%2063-114s74-47%20118-46zm657%20462a76%2076%200%200%201-62-25c-12-15-18-40-18-73v-340h150v-105h-150v-175h-114v175h-108v105h108v364c0%2027%203%2053%2012%2078a160%20160%200%200%200%2094%2090c23%2010%2047%2014%2071%2013%2017%200%2033%200%2050-3%2012-3%2025-7%2037-13l4-1v-115l-9%205c-20%2013-42%2020-65%2020zm656-500a283%20283%200%200%200-200-68c-50%200-100%2010-144%2033-40%2020-76%2051-101%2090l-3%204%2086%2066%203-5c17-26%2040-47%2067-61%2028-15%2060-22%2092-22%2043-2%2085%2013%20118%2040a142%20142%200%200%201%2046%20108v29a418%20418%200%200%200-170-36c-75%200-139%2019-189%2056s-75%2092-75%20160a205%20205%200%200%200%20114%20186%20268%20268%200%200%200%20245-5c30-17%2056-41%2076-70v83h108v-401c0-78-25-141-73-186zm-224%20504c-34%202-67-10-94-30a96%2096%200%200%201-36-79%20108%20108%200%200%201%2040-88c28-22%2070-34%20124-34a315%20315%200%200%201%20155%2042%20198%20198%200%200%201-95%20164c-28%2017-60%2026-94%2025z'/%3e%3c/svg%3e",Jg="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='-10%20-10%20276%20276'%3e%3ccircle%20cx='128'%20cy='128'%20r='64'%20fill='%23fff'/%3e%3cpath%20fill='%23fbbc04'%20d='M96%20183.4A63.7%2063.7%200%200%201%2072.6%20160L17.2%2064A128%20128%200%200%200%20128%20256l55.4-96A64%2064%200%200%201%2096%20183.4Z'/%3e%3cpath%20fill='%23fdd663'%20d='M192%20128a63.7%2063.7%200%200%201-8.6%2032L128%20256A128%20128%200%200%200%20238.9%2064h-111a64%2064%200%200%201%2064%2064Z'/%3e%3ccircle%20cx='128'%20cy='128'%20r='52'%20fill='%23fbbc04'/%3e%3cpath%20fill='%23f29900'%20d='M96%2072.6a63.7%2063.7%200%200%201%2032-8.6h110.8a128%20128%200%200%200-221.7%200l55.5%2096A64%2064%200%200%201%2096%2072.6Z'/%3e%3c/svg%3e",kg="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20fill='%23fff'%20viewBox='-190%20-190%205180%205180'%3e%3clinearGradient%20id='a'%20x1='2149'%20x2='4207'%20y1='4638'%20y2='1076'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0'%20stop-color='%23fcc934'/%3e%3cstop%20offset='1'%20stop-color='%23fbbc04'/%3e%3c/linearGradient%3e%3clinearGradient%20id='b'%20x1='2823'%20x2='-214'%20y1='4031'%20y2='2278'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0'%20stop-color='%231e8e3e'/%3e%3cstop%20offset='1'%20stop-color='%2334a853'/%3e%3c/linearGradient%3e%3clinearGradient%20id='c'%20x1='371'%20x2='4429'%20y1='1501'%20y2='1501'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0'%20stop-color='%23d93025'/%3e%3cstop%20offset='1'%20stop-color='%23ea4335'/%3e%3c/linearGradient%3e%3cpath%20fill='%23202124'%20d='M4400%203676c-45%2080-93%20157-145%20228l541-228z'/%3e%3cpath%20d='M2399%203600a1200%201200%200%201%200-1%200z'/%3e%3cpath%20fill='url(%23a)'%20d='M3440%203001%202402%204800a2394%202394%200%200%200%202398-2400c0-421-112-835-323-1200H2400l-2%201a1198%201198%200%200%201%201041%201800z'/%3e%3cpath%20fill='url(%23b)'%20d='M1360%203001%20322%201202a2398%202398%200%200%200%202078%203598l1038-1799v-1a1199%201199%200%200%201-2078%202z'/%3e%3cpath%20fill='%231a73e8'%20d='M2399%203351a950%20950%200%201%200%200-1900%20950%20950%200%200%200%200%201900z'/%3e%3cpath%20fill='url(%23c)'%20d='M2399%201200h2076a2396%202396%200%200%200-4153%202l1038%201800h2a1200%201200%200%200%201%201037-1802z'/%3e%3cpath%20fill='%233c4043'%20d='M1987%202326c0-70%200-106%2022-128s57-22%20128-22h2662v1500H2137c-70%200-106%200-128-22s-22-57-22-128z'/%3e%3cpath%20d='M2865%202532a480%20480%200%200%200-236-56h-267v881h267a480%20480%200%200%200%20236-56c66-36%20120-90%20155-155%2037-70%2056-150%2054-229%202-80-17-158-54-229-35-65-90-120-155-156zm-390%2054h154c102%200%20182%2030%20240%2087%2060%2058%2090%20140%2090%20244s-30%20186-90%20244a330%20330%200%200%201-240%2087h-154zm1153%20157a295%20295%200%200%200-158-42c-57%200-112%2016-160%2047-45%2030-81%2073-105%20123-25%2053-38%20110-37%20170%200%2060%2013%20118%2040%20172a302%20302%200%200%200%20270%20163%20300%20300%200%200%200%20276-167l2-6-96-47-2%204c-41%2073-100%20110-176%20110a193%20193%200%200%201-168-95c-20-34-30-72-33-112h482v-4c4-10%205-22%205-33a380%20380%200%200%200-36-168c-23-48-60-87-104-115zm-160%2064c36-2%2070%207%20101%2026%2025%2015%2045%2037%2058%2064%2011%2022%2018%2045%2021%2070h-360c10-44%2030-84%2062-115%2032-30%2075-46%20118-45zm837-87-190%20496-187-493-1-3h-122l251%20634%202%204h110l256-638z'/%3e%3c/svg%3e",gr="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='-10%20-10%20276%20276'%3e%3ccircle%20cx='128'%20cy='128'%20r='64'%20fill='%23fff'/%3e%3cpath%20fill='%23669df6'%20d='M96%20183.4A63.7%2063.7%200%200%201%2072.6%20160L17.2%2064A128%20128%200%200%200%20128%20256l55.4-96A64%2064%200%200%201%2096%20183.4Z'/%3e%3cpath%20fill='%23aecbfa'%20d='M192%20128a63.7%2063.7%200%200%201-8.6%2032L128%20256A128%20128%200%200%200%20238.9%2064h-111a64%2064%200%200%201%2064%2064Z'/%3e%3ccircle%20cx='128'%20cy='128'%20r='52'%20fill='%231a73e8'/%3e%3cpath%20fill='%231967d2'%20d='M96%2072.6a63.7%2063.7%200%200%201%2032-8.6h110.8a128%20128%200%200%200-221.7%200l55.5%2096A64%2064%200%200%201%2096%2072.6Z'/%3e%3c/svg%3e",w1="/assets/firefox-1bWoP6pv.svg",O1="/assets/firefox-beta-k3eOH_eK.svg",Ig="/assets/firefox-nightly-Cp5nfeDT.svg",Wg="/assets/safari-na3_-uQk.svg",_c="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xmlns:x='http://www.w3.org/1999/xlink'%20viewBox='0%200%2027600%2027600'%3e%3clinearGradient%20id='a'%20gradientUnits='userSpaceOnUse'/%3e%3clinearGradient%20id='b'%20x1='6870'%20x2='24704'%20y1='18705'%20y2='18705'%20x:href='%23a'%3e%3cstop%20offset='0'%20stop-color='%230c59a4'/%3e%3cstop%20offset='1'%20stop-color='%23114a8b'/%3e%3c/linearGradient%3e%3clinearGradient%20id='c'%20x1='16272'%20x2='5133'%20y1='10968'%20y2='23102'%20x:href='%23a'%3e%3cstop%20offset='0'%20stop-color='%231b9de2'/%3e%3cstop%20offset='.16'%20stop-color='%231595df'/%3e%3cstop%20offset='.67'%20stop-color='%230680d7'/%3e%3cstop%20offset='1'%20stop-color='%230078d4'/%3e%3c/linearGradient%3e%3cradialGradient%20id='d'%20cx='16720'%20cy='18747'%20r='9538'%20x:href='%23a'%3e%3cstop%20offset='.72'%20stop-opacity='0'/%3e%3cstop%20offset='.95'%20stop-opacity='.53'/%3e%3cstop%20offset='1'/%3e%3c/radialGradient%3e%3cradialGradient%20id='e'%20cx='7130'%20cy='19866'%20r='14324'%20gradientTransform='matrix(.14843%20-.98892%20.79688%20.1196%20-8759%2025542)'%20x:href='%23a'%3e%3cstop%20offset='.76'%20stop-opacity='0'/%3e%3cstop%20offset='.95'%20stop-opacity='.5'/%3e%3cstop%20offset='1'/%3e%3c/radialGradient%3e%3cradialGradient%20id='f'%20cx='2523'%20cy='4680'%20r='20243'%20gradientTransform='matrix(-.03715%20.99931%20-2.12836%20-.07913%2013579%203530)'%20x:href='%23a'%3e%3cstop%20offset='0'%20stop-color='%2335c1f1'/%3e%3cstop%20offset='.11'%20stop-color='%2334c1ed'/%3e%3cstop%20offset='.23'%20stop-color='%232fc2df'/%3e%3cstop%20offset='.31'%20stop-color='%232bc3d2'/%3e%3cstop%20offset='.67'%20stop-color='%2336c752'/%3e%3c/radialGradient%3e%3cradialGradient%20id='g'%20cx='24247'%20cy='7758'%20r='9734'%20gradientTransform='matrix(.28109%20.95968%20-.78353%20.22949%2024510%20-16292)'%20x:href='%23a'%3e%3cstop%20offset='0'%20stop-color='%2366eb6e'/%3e%3cstop%20offset='1'%20stop-color='%2366eb6e'%20stop-opacity='0'/%3e%3c/radialGradient%3e%3cpath%20id='h'%20d='M24105%2020053a9345%209345%200%2001-1053%20472%2010202%2010202%200%2001-3590%20646c-4732%200-8855-3255-8855-7432%200-1175%20680-2193%201643-2729-4280%20180-5380%204640-5380%207253%200%207387%206810%208137%208276%208137%20791%200%201984-230%202704-456l130-44a12834%2012834%200%20006660-5282c220-350-168-757-535-565z'/%3e%3cpath%20id='i'%20d='M11571%2025141a7913%207913%200%2001-2273-2137%208145%208145%200%2001-1514-4740%208093%208093%200%20013093-6395%208082%208082%200%20011373-859c312-148%20846-414%201554-404a3236%203236%200%20012569%201297%203184%203184%200%2001636%201866c0-21%202446-7960-8005-7960-4390%200-8004%204166-8004%207820%200%202319%20538%204170%201212%205604a12833%2012833%200%20007684%206757%2012795%2012795%200%20003908%20610c1414%200%202774-233%204045-656a7575%207575%200%2001-6278-803z'/%3e%3cpath%20id='j'%20d='M16231%2015886c-80%20105-330%20250-330%20566%200%20260%20170%20512%20472%20723%201438%201003%204149%20868%204156%20868a5954%205954%200%20003027-839%206147%206147%200%20001133-850%206180%206180%200%20001910-4437c26-2242-796-3732-1133-4392-2120-4141-6694-6525-11668-6525-7011%200-12703%205635-12798%2012620%2047-3654%203679-6605%207996-6605%20350%200%202346%2034%204200%201007%201634%20858%202490%201894%203086%202921%20618%201067%20728%202415%20728%202952s-271%201333-780%201990z'/%3e%3cuse%20fill='url(%23b)'%20x:href='%23h'/%3e%3cuse%20fill='url(%23d)'%20opacity='.35'%20x:href='%23h'/%3e%3cuse%20fill='url(%23c)'%20x:href='%23i'/%3e%3cuse%20fill='url(%23e)'%20opacity='.4'%20x:href='%23i'/%3e%3cuse%20fill='url(%23f)'%20x:href='%23j'/%3e%3cuse%20fill='url(%23g)'%20x:href='%23j'/%3e%3c/svg%3e",R1={chromium:gr,"chromium-headless-shell":gr,"chrome-for-testing":gr,chrome:Fg,"chrome-beta":Kg,"chrome-dev":kg,"chrome-canary":Jg,firefox:w1,"moz-firefox":w1,"firefox-beta":O1,"moz-firefox-beta":O1,"moz-firefox-nightly":Ig,webkit:Wg,msedge:_c,"msedge-beta":_c,"msedge-dev":_c,"msedge-canary":_c},$g=({browserName:u,channel:i})=>{const f=i&&R1[i]?i:u,s=f?R1[f]:void 0;if(s)return O.jsx("img",{className:"browser-icon-img",src:s,alt:"","aria-hidden":"true"});const r=u?u[0].toUpperCase():"?";return O.jsx("span",{className:"browser-icon-fallback","aria-hidden":"true",children:r})},Pg=()=>O.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:O.jsx("polyline",{points:"15 18 9 12 15 6"})}),tv=()=>O.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:O.jsx("polyline",{points:"9 18 15 12 9 6"})}),ev=()=>O.jsx("svg",{width:"20",height:"20",viewBox:"0 -960 960 960",style:{fill:"currentColor"},"aria-hidden":"true",children:O.jsx("path",{d:"M240-80q-33 0-56.5-23.5T160-160v-400q0-33 23.5-56.5T240-640h40v-80q0-83 58.5-141.5T480-920q83 0 141.5 58.5T680-720v80h40q33 0 56.5 23.5T800-560v400q0 33-23.5 56.5T720-80H240Zm0-80h480v-400H240v400Zm296.5-143.5Q560-327 560-360t-23.5-56.5Q513-440 480-440t-56.5 23.5Q400-393 400-360t23.5 56.5Q447-280 480-280t56.5-23.5ZM360-640h240v-80q0-50-35-85t-85-35q-50 0-85 35t-35 85v80ZM240-160v-400 400Z"})}),nv=()=>O.jsx("svg",{width:"20",height:"20",viewBox:"0 -960 960 960",style:{fill:"currentColor"},"aria-hidden":"true",children:O.jsx("path",{d:"M240-160h480v-400H240v400Zm296.5-143.5Q560-327 560-360t-23.5-56.5Q513-440 480-440t-56.5 23.5Q400-393 400-360t23.5 56.5Q447-280 480-280t56.5-23.5ZM240-160v-400 400Zm0 80q-33 0-56.5-23.5T160-160v-400q0-33 23.5-56.5T240-640h280v-80q0-83 58.5-141.5T720-920q83 0 141.5 58.5T920-720h-80q0-50-35-85t-85-35q-50 0-85 35t-35 85v80h120q33 0 56.5 23.5T800-560v400q0 33-23.5 56.5T720-80H240Z"})}),av=()=>O.jsx("svg",{width:"20",height:"20",viewBox:"0 -960 960 960",style:{fill:"currentColor"},"aria-hidden":"true",children:O.jsx("path",{d:"M680-80v-120H560v-80h120v-120h80v120h120v80H760v120h-80ZM200-200v-200h80v120h120v80H200Zm0-360v-200h200v80H280v120h-80Zm480 0v-120H560v-80h200v200h-80Z"})}),_h=()=>O.jsx("svg",{width:"20",height:"20",viewBox:"0 -960 960 960",style:{fill:"currentColor"},"aria-hidden":"true",children:O.jsx("path",{d:"M480-320 280-520l56-58 104 104v-326h80v326l104-104 56 58-200 200ZM240-160q-33 0-56.5-23.5T160-240v-120h80v120h480v-120h80v120q0 33-23.5 56.5T720-160H240Z"})}),lv=()=>O.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[O.jsx("polyline",{points:"23 4 23 10 17 10"}),O.jsx("path",{d:"M20.49 15a9 9 0 1 1-2.12-9.36L23 10"})]}),iv=()=>O.jsx("svg",{viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:O.jsx("path",{d:"M8 0a8.2 8.2 0 0 1 .701.031C9.444.095 9.99.645 10.16 1.29l.288 1.107c.018.066.079.158.212.224.231.114.454.243.668.386.123.082.233.09.299.071l1.103-.303c.644-.176 1.392.021 1.82.63.27.385.506.792.704 1.218.315.675.111 1.422-.364 1.891l-.814.806c-.049.048-.098.147-.088.294.016.257.016.515 0 .772-.01.147.038.246.088.294l.814.806c.475.469.679 1.216.364 1.891a7.977 7.977 0 0 1-.704 1.217c-.428.61-1.176.807-1.82.63l-1.102-.302c-.067-.019-.177-.011-.3.071a5.909 5.909 0 0 1-.668.386c-.133.066-.194.158-.211.224l-.29 1.106c-.168.646-.715 1.196-1.458 1.26a8.006 8.006 0 0 1-1.402 0c-.743-.064-1.289-.614-1.458-1.26l-.289-1.106c-.018-.066-.079-.158-.212-.224a5.738 5.738 0 0 1-.668-.386c-.123-.082-.233-.09-.299-.071l-1.103.303c-.644.176-1.392-.021-1.82-.63a8.12 8.12 0 0 1-.704-1.218c-.315-.675-.111-1.422.363-1.891l.815-.806c.05-.048.098-.147.088-.294a6.214 6.214 0 0 1 0-.772c.01-.147-.038-.246-.088-.294l-.815-.806C.635 6.045.431 5.298.746 4.623a7.92 7.92 0 0 1 .704-1.217c.428-.61 1.176-.807 1.82-.63l1.102.302c.067.019.177.011.3-.071.214-.143.437-.272.668-.386.133-.066.194-.158.211-.224l.29-1.106C6.009.645 6.556.095 7.299.03 7.53.01 7.764 0 8 0Zm-.571 1.525c-.036.003-.108.036-.137.146l-.289 1.105c-.147.561-.549.967-.998 1.189-.173.086-.34.183-.5.29-.417.278-.97.423-1.529.27l-1.103-.303c-.109-.03-.175.016-.195.045-.22.312-.412.644-.573.99-.014.031-.021.11.059.19l.815.806c.411.406.562.957.53 1.456a4.709 4.709 0 0 0 0 .582c.032.499-.119 1.05-.53 1.456l-.815.806c-.081.08-.073.159-.059.19.162.346.353.677.573.989.02.03.085.076.195.046l1.102-.303c.56-.153 1.113-.008 1.53.27.161.107.328.204.501.29.447.222.85.629.997 1.189l.289 1.105c.029.109.101.143.137.146a6.6 6.6 0 0 0 1.142 0c.036-.003.108-.036.137-.146l.289-1.105c.147-.561.549-.967.998-1.189.173-.086.34-.183.5-.29.417-.278.97-.423 1.529-.27l1.103.303c.109.029.175-.016.195-.045.22-.313.411-.644.573-.99.014-.031.021-.11-.059-.19l-.815-.806c-.411-.406-.562-.957-.53-1.456a4.709 4.709 0 0 0 0-.582c-.032-.499.119-1.05.53-1.456l.815-.806c.081-.08.073-.159.059-.19a6.464 6.464 0 0 0-.573-.989c-.02-.03-.085-.076-.195-.046l-1.102.303c-.56.153-1.113.008-1.53-.27a4.44 4.44 0 0 0-.501-.29c-.447-.222-.85-.629-.997-1.189l-.289-1.105c-.029-.11-.101-.143-.137-.146a6.6 6.6 0 0 0-1.142 0ZM11 8a3 3 0 1 1-6 0 3 3 0 0 1 6 0ZM9.5 8a1.5 1.5 0 1 0-3.001.001A1.5 1.5 0 0 0 9.5 8Z"})});function wc(u){if(!u||!u.naturalWidth||!u.naturalHeight)return null;const i=u.getBoundingClientRect(),f=u.naturalWidth/u.naturalHeight,s=i.width/i.height;if(f>s){const o=i.width/f;return{rect:i,renderW:i.width,renderH:o,offsetX:0,offsetY:(i.height-o)/2}}const r=i.height*f;return{rect:i,renderW:r,renderH:i.height,offsetX:(i.width-r)/2,offsetY:0}}function Nr(u,i,f,s,r){const o=(s-u.rect.left-u.offsetX)/u.renderW,h=(r-u.rect.top-u.offsetY)/u.renderH;return{x:Math.round(o*i),y:Math.round(h*f)}}const ln=Wn.forwardRef(function({children:i,title:f="",icon:s,disabled:r=!1,toggled:o=!1,onClick:h=()=>{},style:v,testId:m,className:y,ariaLabel:_,errorBadge:p},b){const T=Wn.useId();return O.jsxs("button",{ref:b,className:Ji(y,"toolbar-button",s,o&&"toggled"),onMouseDown:D1,onClick:h,onDoubleClick:D1,title:f,disabled:!!r,style:v,"data-testid":m,"aria-label":_||f,"aria-describedby":p?T:void 0,children:[s&&O.jsx("span",{className:`codicon codicon-${s}`,style:i?{marginRight:5}:{}}),i,p&&O.jsx("span",{id:T,className:"toolbar-button-error-badge",title:p,"aria-label":p})]})}),D1=u=>{u.stopPropagation(),u.preventDefault()},uv=({blob:u,blobUrl:i,onSave:f,onClose:s})=>{const r=mt.useCallback(async()=>{await f(u)},[f,u]);return O.jsx("div",{className:"modal-overlay",role:"dialog","aria-modal":"true","aria-label":"Recording preview",children:O.jsxs("div",{className:"modal",children:[O.jsxs("div",{className:"modal-toolbar",children:[O.jsx("div",{className:"modal-title",children:"Recording"}),O.jsx(ln,{title:"Save recording",onClick:r,children:O.jsx(_h,{})}),O.jsx(ln,{title:"Discard",icon:"close",onClick:s})]}),O.jsx("div",{className:"modal-body recording-body",children:O.jsx("video",{className:"recording-video",src:i,controls:!0,autoPlay:!0})})]})})};async function ph(u,i,f,s){if(!u.naturalWidth||!u.naturalHeight||!i||!f)return null;const r=document.createElement("canvas");r.width=u.naturalWidth,r.height=u.naturalHeight;const o=r.getContext("2d");if(!o)return null;o.drawImage(u,0,0,r.width,r.height);const h=r.width/i,v=r.height/f,m=Math.max(11,Math.round(14*v));o.font=`500 ${m}px -apple-system, system-ui, sans-serif`,o.textBaseline="middle";for(const y of s){const[_,p,b]=y.color.split(" ").map(Number),T=`rgb(${_}, ${p}, ${b})`,D=`rgba(${_}, ${p}, ${b}, 0.12)`,G=y.x*h,W=y.y*v,J=y.width*h,Z=y.height*v;if(o.fillStyle=D,o.fillRect(G,W,J,Z),o.lineWidth=Math.max(2,Math.round(2*v)),o.strokeStyle=T,o.strokeRect(G,W,J,Z),y.text){const $=Math.max(4,Math.round(6*v)),I=Math.max(2,Math.round(3*v)),it=o.measureText(y.text).width+$*2,X=m+I*2,et=G-o.lineWidth/2,ut=W-X;o.fillStyle=T,o.fillRect(et,ut,it,X),o.fillStyle="#fff",o.fillText(y.text,et+$,ut+X/2)}}return await new Promise(y=>r.toBlob(y,"image/png"))}async function bh(u,i){var _;const f=new Date().toISOString().replace(/[:.]/g,"-"),s=i??`annotations-${f}.png`,r=(((_=s.match(/\.[^./\\]+$/))==null?void 0:_[0])??".bin").toLowerCase(),o=u.type||{".png":"image/png",".zip":"application/zip"}[r]||"application/octet-stream",h={".png":"PNG image",".zip":"Zip archive"}[r]||"File",v=window.showSaveFilePicker;if(v){try{const b=await(await v({suggestedName:s,startIn:"downloads",types:[{description:h,accept:{[o]:[r]}}]})).createWritable();await b.write(u),await b.close()}catch(p){if((p==null?void 0:p.name)==="AbortError")return!1;throw p}return!0}const m=URL.createObjectURL(u),y=document.createElement("a");return y.href=m,y.download=s,document.body.appendChild(y),y.click(),document.body.removeChild(y),URL.revokeObjectURL(m),!0}const Sh=[{name:"blue",rgb:"54 116 209"},{name:"red",rgb:"229 62 62"},{name:"green",rgb:"56 161 105"},{name:"orange",rgb:"221 107 32"},{name:"purple",rgb:"128 90 213"},{name:"pink",rgb:"213 63 140"}],cv=Sh[0].rgb,sv=["nw","n","ne","e","se","s","sw","w"],z1=4;function fv(){return"ann-"+Math.random().toString(36).slice(2,10)}function N1(u){return{x:Math.min(u.startX,u.x),y:Math.min(u.startY,u.y),width:Math.abs(u.x-u.startX),height:Math.abs(u.y-u.startY)}}function rv(u,i,f,s){let r=u.x,o=u.y,h=u.x+u.width,v=u.y+u.height;switch(i){case"move":r+=f,o+=s,h+=f,v+=s;break;case"nw":r+=f,o+=s;break;case"n":o+=s;break;case"ne":h+=f,o+=s;break;case"e":h+=f;break;case"se":h+=f,v+=s;break;case"s":v+=s;break;case"sw":r+=f,v+=s;break;case"w":r+=f;break}return{x:Math.min(r,h),y:Math.min(o,v),width:Math.abs(h-r),height:Math.abs(v-o)}}function ov(u,i,f,s,r){const o=u.rect.left-i.left+u.offsetX,h=u.rect.top-i.top+u.offsetY;return{left:o+r.x/f*u.renderW,top:h+r.y/s*u.renderH,width:r.width/f*u.renderW,height:r.height/s*u.renderH}}const dv=({color:u,onChange:i})=>O.jsx("div",{className:"annotations-color-picker",role:"radiogroup","aria-label":"Annotation color",children:Sh.map(({name:f,rgb:s})=>O.jsx("button",{type:"button",role:"radio","aria-checked":u===s,title:`Use ${f}`,className:"annotations-color-swatch"+(u===s?" selected":""),style:{"--annotation-color":s},onClick:()=>i(s)},f))}),Eh=mt.forwardRef(({active:u,displayRef:i,screenRef:f,viewportWidth:s,viewportHeight:r,annotations:o,onAnnotationsChange:h,focusAnnotationId:v},m)=>{var k;const[y,_]=mt.useState(null),[p,b]=mt.useState(null),[T,D]=mt.useState(null),[G,W]=mt.useState(cv),[J,Z]=mt.useState(null),[,$]=mt.useState(0),I=mt.useCallback(()=>$(w=>w+1),[]),B=mt.useRef(null),it=mt.useRef(o),X=mt.useRef(v);mt.useLayoutEffect(()=>{it.current=o,X.current=v});const et=(p==null?void 0:p.id)??null,ut=p!=null&&p.editing?p.id:null;mt.useEffect(()=>{if(!u)return;const w=()=>I(),U=i.current,L=()=>I();return window.addEventListener("resize",w),U==null||U.addEventListener("load",L),()=>{window.removeEventListener("resize",w),U==null||U.removeEventListener("load",L)}},[u,i,I]),mt.useEffect(()=>{var w;if(u){const U=X.current;if(U){const L=it.current.find(P=>P.id===U);if(L){Z({...L}),b({id:U,editing:!0});return}}(w=B.current)==null||w.focus()}else b(null)},[u]),mt.useEffect(()=>{if(!T)return;const w=L=>{const P=wc(i.current);if(!P||!s||!r)return;const H=Nr(P,s,r,L.clientX,L.clientY),ht=H.x-T.startVx,Yt=H.y-T.startVy;ht===0&&Yt===0||h(it.current.map(Ft=>Ft.id===T.id?{...Ft,...rv(T.orig,T.kind,ht,Yt)}:Ft))},U=()=>D(null);return window.addEventListener("mousemove",w),window.addEventListener("mouseup",U),()=>{window.removeEventListener("mousemove",w),window.removeEventListener("mouseup",U)}},[T,i,s,r,h]);function st(w){if(!s||!r)return null;const U=wc(i.current);return U?Nr(U,s,r,w.clientX,w.clientY):null}function at(w,U){for(let L=o.length-1;L>=0;L--){const P=o[L];if(w>=P.x&&w<=P.x+P.width&&U>=P.y&&U<=P.y+P.height)return P}}function _t(w){var P;if(w.button!==0)return;(P=B.current)==null||P.focus();const U=st(w);if(!U)return;const L=at(U.x,U.y);if(w.preventDefault(),L){b({id:L.id,editing:!1}),D({kind:"move",id:L.id,orig:{x:L.x,y:L.y,width:L.width,height:L.height},startVx:U.x,startVy:U.y});return}_({startX:U.x,startY:U.y,x:U.x,y:U.y}),b(null)}function pt(w){if(T||!y)return;const U=st(w);U&&(y.x===U.x&&y.y===U.y||_({...y,x:U.x,y:U.y}))}function yt(w){if(!y)return;w.preventDefault();const U=N1(y);if(_(null),U.width<z1||U.height<z1)return;const L=fv();h([...o,{id:L,...U,text:"",color:G}]),b({id:L,editing:!0})}function ot(w,U,L){var H;L.preventDefault(),L.stopPropagation(),(H=B.current)==null||H.focus();const P=st(L);P&&(b({id:U.id,editing:!1}),D({kind:w,id:U.id,orig:{x:U.x,y:U.y,width:U.width,height:U.height},startVx:P.x,startVy:P.y}))}function N(w,U){et&&h(o.map(L=>L.id===et?{...L,x:L.x+w,y:L.y+U}:L))}function V(){var w;b(U=>U!=null&&U.editing?{...U,editing:!1}:U),(w=B.current)==null||w.focus()}function lt(w){if(w.key==="Escape"){w.preventDefault(),y?_(null):ut?V():et&&b(null);return}if((w.key==="Delete"||w.key==="Backspace")&&et&&!ut){w.preventDefault(),h(o.filter(U=>U.id!==et)),b(null);return}if(et&&!ut){const U=w.shiftKey?1:5;if(w.key==="ArrowLeft"){w.preventDefault(),N(-U,0);return}if(w.key==="ArrowRight"){w.preventDefault(),N(U,0);return}if(w.key==="ArrowUp"){w.preventDefault(),N(0,-U);return}if(w.key==="ArrowDown"){w.preventDefault(),N(0,U);return}}}if(mt.useEffect(()=>{ut||Z(null)},[ut]),mt.useImperativeHandle(m,()=>({clearSelection:()=>{_(null),b(null)}}),[]),!u)return null;const rt=wc(i.current),gt=((k=f.current)==null?void 0:k.getBoundingClientRect())??null,E=w=>rt&&gt&&s&&r?ov(rt,gt,s,r,w):null,R=ut?o.find(w=>w.id===ut):void 0;return O.jsxs("div",{ref:B,className:"annotations-layer",tabIndex:0,onMouseDown:_t,onMouseMove:pt,onMouseUp:yt,onKeyDown:lt,onContextMenu:w=>w.preventDefault(),children:[o.map(w=>{const U=E(w);if(!U)return null;const L=w.id===et,P=w.id===ut;return O.jsxs("div",{className:"annotations-rect"+(L?" selected":"")+(P?" editing":"")+(w.text?"":" empty"),style:{...U,"--annotation-color":w.color},onDoubleClick:H=>{H.preventDefault(),H.stopPropagation(),ut!==w.id&&Z({...w}),b({id:w.id,editing:!0})},children:[w.text&&O.jsx("div",{className:"annotations-label",onMouseDown:H=>{H.preventDefault(),H.stopPropagation(),ut!==w.id&&Z({...w}),b({id:w.id,editing:!0})},children:w.text}),L&&!P&&sv.map(H=>O.jsx("div",{className:"annotations-handle annotations-handle-"+H,onMouseDown:ht=>ot(H,w,ht)},H))]},w.id)}),y&&(()=>{const w=E(N1(y));return w?O.jsx("div",{className:"annotations-rect draft",style:{...w,"--annotation-color":G}}):null})(),R&&(()=>{const w=E(R);if(!w)return null;const U={left:w.left,top:w.top+w.height+6,"--annotation-color":R.color};return O.jsxs("div",{className:"annotations-popover",style:U,onMouseDown:L=>L.stopPropagation(),onClick:L=>L.stopPropagation(),children:[O.jsx("textarea",{className:"annotations-textarea",autoFocus:!0,onFocus:L=>{const P=L.target.value.length;L.target.setSelectionRange(P,P)},value:R.text,placeholder:"Task or commentâ€¦",onChange:L=>{const P=L.target.value;h(o.map(H=>H.id===R.id?{...H,text:P}:H))},onKeyDown:L=>{(L.key==="Enter"&&!L.shiftKey&&!L.ctrlKey&&!L.metaKey||L.key==="Escape")&&(L.preventDefault(),V()),L.stopPropagation()},onKeyUp:L=>L.stopPropagation()}),O.jsxs("div",{className:"annotations-popover-footer",children:[O.jsx(dv,{color:R.color,onChange:L=>{h(o.map(P=>P.id===R.id?{...P,color:L}:P)),W(L)}}),O.jsx("div",{className:"annotations-popover-actions",children:J?O.jsxs(O.Fragment,{children:[O.jsx("button",{className:"annotations-action-btn",onClick:()=>{var P;const L=J;h(o.map(H=>H.id===L.id?L:H)),b(null),(P=B.current)==null||P.focus()},children:"Cancel"}),O.jsx("button",{className:"annotations-action-btn",onClick:V,children:"Done"})]}):O.jsxs(O.Fragment,{children:[O.jsx("button",{className:"annotations-action-btn danger",onClick:()=>{var L;h(o.filter(P=>P.id!==R.id)),b(null),(L=B.current)==null||L.focus()},children:"Discard"}),O.jsx("button",{className:"annotations-action-btn",onClick:V,children:"Add"})]})})]})]})})()]})});Eh.displayName="Annotations";const hv=({model:u,session:i,onSubmit:f})=>{const[s,r]=mt.useState(!1),[o,h]=mt.useState(null);return O.jsxs("aside",{className:"annotate-sidebar","aria-label":"Annotation screenshots",children:[O.jsx("div",{className:"annotate-sidebar-header dashboard-shell-sidebar-header",children:O.jsx("h2",{className:"dashboard-shell-sidebar-title",children:"UI Review"})}),O.jsx("div",{className:"annotate-sidebar-list",children:i.frames.map(v=>{const m=v.id===i.selectedFrameId,y=v.annotations;return O.jsxs("div",{className:"annotate-sidebar-thumb"+(m?" selected":""),children:[O.jsx("button",{className:"annotate-sidebar-thumb-button",onClick:()=>u.selectAnnotateFrame(v.id),title:`${v.sessionTitle||"session"} Â· ${v.title||"tab"}
${v.url}`,"aria-pressed":m,children:O.jsxs("span",{className:"annotate-sidebar-thumb-img-wrap",style:{aspectRatio:`${v.viewportWidth} / ${v.viewportHeight}`},children:[O.jsx("img",{className:"annotate-sidebar-thumb-img",alt:"",src:"data:image/png;base64,"+v.data}),v.annotations.map(_=>O.jsx("span",{className:"annotate-sidebar-thumb-rect"+(_.id===o?" hovered":""),style:{left:`${_.x/v.viewportWidth*100}%`,top:`${_.y/v.viewportHeight*100}%`,width:`${_.width/v.viewportWidth*100}%`,height:`${_.height/v.viewportHeight*100}%`,"--annotation-color":_.color}},_.id))]})}),y.length>0&&O.jsx("ul",{className:"annotate-sidebar-comments",children:y.map(_=>O.jsx("li",{children:O.jsx("button",{className:"annotate-sidebar-comment"+(_.text?"":" empty"),style:{"--annotation-color":_.color},onClick:()=>u.selectAnnotateFrame(v.id,_.id),onMouseEnter:()=>h(_.id),onMouseLeave:()=>h(null),title:"Edit comment",children:_.text||"Empty comment"})},_.id))}),O.jsx(ln,{className:"annotate-sidebar-thumb-remove",icon:"close",title:"Remove screenshot",onClick:_=>{_.stopPropagation(),u.removeAnnotateFrame(v.id)}})]},v.id)})}),O.jsx("div",{className:"annotate-sidebar-feedback-wrap","data-value":i.feedback,children:O.jsx("textarea",{className:"annotate-sidebar-feedback",placeholder:"Feedbackâ€¦",value:i.feedback,onChange:v=>u.updateFeedback(v.target.value)})}),O.jsx("button",{className:"annotate-sidebar-submit",disabled:s,onClick:async()=>{r(!0);try{await f()}finally{r(!1)}},children:s?"Submittingâ€¦":"Submit"})]})},mv=({model:u,frame:i,focusAnnotationId:f})=>{const s=mt.useRef(null),r=mt.useRef(null),o=mt.useRef(null),h=mt.useCallback(y=>{u.updateFrameAnnotations(i.id,y)},[u,i.id]),v=mt.useCallback(async()=>{const y=r.current;if(!y)return;const _=await ph(y,i.viewportWidth,i.viewportHeight,i.annotations);if(!_)return;const p=(i.title||i.url||"screenshot").replace(/[^a-z0-9]+/gi,"-").slice(0,40)||"screenshot",b=new Date().toISOString().replace(/[:.]/g,"-");await bh(_,`annotations-${b}-${p}.png`)},[i]),m=mt.useCallback(()=>{var y;u.updateFrameAnnotations(i.id,[]),(y=s.current)==null||y.clearSelection()},[u,i.id]);return O.jsx("div",{className:"annotate-overlay",role:"dialog","aria-label":`Annotate screenshot from ${i.title||i.url||"page"}`,children:O.jsxs("div",{className:"annotate-overlay-window",children:[O.jsxs("div",{className:"annotate-overlay-chrome",children:[O.jsxs("span",{className:"annotate-overlay-titlebar",children:[O.jsx("span",{className:"annotate-overlay-title-text",children:i.title||"untitled"}),O.jsx("span",{className:"annotate-overlay-title-sep",children:"Â·"}),O.jsx("span",{className:"annotate-overlay-title-url",children:i.url})]}),O.jsx(ln,{title:"Save screenshot",onClick:v,children:O.jsx(_h,{})}),O.jsx(ln,{title:"Clear annotations",icon:"circle-slash",disabled:i.annotations.length===0,onClick:m}),O.jsx(ln,{title:"Done annotating",icon:"check",onClick:()=>u.deselectFrame()})]}),O.jsxs("div",{ref:o,className:"annotate-overlay-canvas",children:[O.jsx("img",{ref:r,className:"annotate-modal-image",alt:"annotation",src:"data:image/png;base64,"+i.data}),O.jsx(Eh,{ref:s,active:!0,displayRef:r,screenRef:o,viewportWidth:i.viewportWidth,viewportHeight:i.viewportHeight,annotations:i.annotations,onAnnotationsChange:h,focusAnnotationId:f})]})]})})},yv=["left","middle","right"];async function gv(u,i,f,s){try{return await(await window.showSaveFilePicker({suggestedName:u,types:[{description:i,accept:{[f]:[s]}}]})).createWritable()}catch{return null}}function vv(u){const i=u.trim();if(!i||/^[a-z][a-z0-9+.-]*:\/\//i.test(i)||i.startsWith("about:")||i.startsWith("data:"))return i;const f=i.split(/[/?#]/,1)[0],s=f.includes("."),r=/^localhost(:\d+)?$/i.test(f),o=/:\d+$/.test(f),h=/^\d{1,3}(\.\d{1,3}){3}(:\d+)?$/.test(f);return r||h||o&&!s?"http://"+i:s||o?"https://"+i:"https://"+f+".com"+i.slice(f.length)}const _v=({model:u})=>{const[,i]=mt.useState(0);mt.useEffect(()=>u.subscribe(()=>i(H=>H+1)),[u]);const{tabs:f,mode:s,recording:r,liveFrame:o,annotateSession:h,pendingCapture:v}=u.state,m=s==="interactive",y=!!h,_=(h==null?void 0:h.frames.find(H=>H.id===h.selectedFrameId))??null,[p,b]=mt.useState(0),T=mt.useRef(null),D=mt.useRef(null),G=mt.useRef(null),W=mt.useRef(null),J=mt.useRef(null),Z=mt.useRef(null),$=mt.useRef(0),I=o&&o.viewportWidth&&o.viewportHeight?o.viewportWidth/o.viewportHeight:null,[B]=yh(W),it=(r==null?void 0:r.phase)!=="recording",X=mt.useMemo(()=>{var Gt;const ht=it?((Gt=J.current)==null?void 0:Gt.offsetHeight)??40:0,Yt=B.width-24,Ft=B.height-24;if(Yt<=0||Ft<=0)return;if(I===null)return{width:Yt,height:Ft};const ae=Ft-ht;let oe=Yt,Jt=oe/I;return Jt>ae&&(Jt=ae,oe=Jt*I),{width:oe,height:Jt+ht}},[B,I,it]);mt.useEffect(()=>{if(p===0)return;const H=Z.current;if(!H)return;H.classList.remove("flash"),H.offsetWidth,H.classList.add("flash");const ht=setTimeout(()=>H.classList.remove("flash"),2e3);return()=>{clearTimeout(ht),H.classList.remove("flash")}},[p]),mt.useEffect(()=>{var H;m&&((H=Z.current)==null||H.classList.remove("flash"))},[m]);function et(){b(H=>H+1)}const ut=mt.useCallback(async H=>{const ht=await gv(`playwright-recording-${Date.now()}.webm`,"WebM Video","video/webm",".webm");ht&&(await ht.write(H),await ht.close(),u.discardRecording())},[u]),st=f==null?void 0:f.find(H=>H.selected),at=!!st,[_t,pt]=mt.useState((st==null?void 0:st.url)??"");mt.useEffect(()=>{pt((st==null?void 0:st.url)??"")},[st==null?void 0:st.url]);function yt(H){const ht=(o==null?void 0:o.viewportWidth)??0,Yt=(o==null?void 0:o.viewportHeight)??0;if(!ht||!Yt)return{x:0,y:0};const Ft=wc(T.current);return Ft?Nr(Ft,ht,Yt,H.clientX,H.clientY):{x:0,y:0}}function ot(H,ht){const{x:Yt,y:Ft}=yt(ht);u[H](Yt,Ft,yv[ht.button]||"left")}function N(H){var ht;if(H.preventDefault(),(ht=D.current)==null||ht.focus(),!!at){if(!m){et();return}ot("mousedown",H)}}function V(H){m&&(H.preventDefault(),ot("mouseup",H))}function lt(H){if(!m)return;const ht=Date.now();if(ht-$.current<32)return;$.current=ht;const{x:Yt,y:Ft}=yt(H);u.mousemove(Yt,Ft)}function rt(H){m&&(H.preventDefault(),u.wheel(H.deltaX,H.deltaY))}function gt(H){m&&(H.preventDefault(),u.keydown(H.key))}function E(H){m&&(H.preventDefault(),u.keyup(H.key))}function R(H){if(H.key==="Enter"){const ht=vv(H.target.value);u.navigate(ht),H.currentTarget.blur()}}const k=st?void 0:"Select a session",w=(r==null?void 0:r.phase)==="recording",U=(r==null?void 0:r.phase)==="stopped",L=y?"Dashboard: annotate":w?"Dashboard: record":"Dashboard",P=!!_;return O.jsxs("main",{className:"dashboard-view"+(m?" interactive":"")+(y?" has-annotate-sidebar":""),"aria-label":L,children:[O.jsxs("div",{className:"dashboard-main",children:[O.jsxs("div",{ref:G,className:"toolbar",hidden:P,children:[O.jsx(ln,{ref:Z,className:"mode-toggle mode-interactive",title:m?"Disable interactive mode":"Enable interactive mode",toggled:m,disabled:!at,onClick:()=>{m?u.toggleInteractive():u.enterInteractive()},children:m?O.jsx(nv,{}):O.jsx(ev,{})}),O.jsx(ln,{className:"mode-annotate",title:y?"Add screenshot":"Take screenshot",disabled:!at||v,onClick:()=>{y?u.addAnnotateFrame():u.enterAnnotate("user")},children:O.jsx(av,{})}),O.jsx(ln,{className:"mode-toggle mode-record",title:w?"Stop recording":"Record video",icon:"record",toggled:w,disabled:!at||U,onClick:()=>{w?u.stopRecording():u.startRecording()},children:w&&O.jsx("span",{className:"mode-record-label",children:"Recording..."})})]}),O.jsx("div",{className:"viewport-wrapper",children:O.jsx("div",{ref:W,className:"viewport-main",children:O.jsxs("div",{className:"browser-window",style:X,children:[it&&O.jsxs("div",{ref:J,className:"browser-chrome",children:[O.jsx("button",{className:"nav-btn",title:"Back","aria-disabled":!m||void 0,onClick:()=>{if(!m){et();return}u.back()},children:O.jsx(Pg,{})}),O.jsx("button",{className:"nav-btn",title:"Forward","aria-disabled":!m||void 0,onClick:()=>{if(!m){et();return}u.forward()},children:O.jsx(tv,{})}),O.jsx("button",{className:"nav-btn",title:"Reload","aria-disabled":!m||void 0,onClick:()=>{if(!m){et();return}u.reload()},children:O.jsx(lv,{})}),O.jsx("div",{className:"omnibox-wrap",children:O.jsx("input",{id:"omnibox",className:"omnibox",type:"text",placeholder:"Search or enter URL",spellCheck:!1,autoComplete:"off",value:_t,onChange:H=>pt(H.target.value),onKeyDown:H=>{m&&R(H)},onFocus:H=>{if(!m){et(),H.target.blur();return}H.target.select()},"aria-disabled":!m||void 0,"aria-label":m?"Search or enter URL":"URL input - enable interactive mode to use this field",readOnly:!m})})]}),O.jsx("div",{ref:D,className:"screen",tabIndex:0,style:{display:o?"":"none"},onMouseDown:N,onMouseUp:V,onMouseMove:lt,onWheel:rt,onKeyDown:gt,onKeyUp:E,onContextMenu:H=>H.preventDefault(),children:O.jsx("img",{ref:T,id:"display",className:"display",alt:"screencast",src:o?"data:image/jpeg;base64,"+o.data:void 0})}),k&&O.jsx("div",{className:"screen-overlay"+(o?" has-frame":""),children:O.jsx("span",{children:k})})]})})})]}),_&&O.jsx(mv,{model:u,frame:_,focusAnnotationId:h==null?void 0:h.focusAnnotationId},_.id+((h==null?void 0:h.focusAnnotationId)??"")),h&&O.jsx(hv,{model:u,session:h,onSubmit:()=>u.submitAnnotateSession()}),U&&(r==null?void 0:r.phase)==="stopped"&&O.jsx(uv,{blob:r.blob,blobUrl:r.blobUrl,onSave:ut,onClose:()=>u.discardRecording()})]})},Pi=15,Mr=30,Ur=19,pv=29,Cc=256,Ir=Cc+1+pv,M1=2*Ir+1,Vi=256,bv=7,U1=16,C1=17,L1=18,vr=16,Lc=-1,Sv=1,pc=2,Ev=0,Ql=0,H1=1,Tv=3,ke=4,An=0,Th=1,bc=2,xn=-2,Av=-3,Xl=-5;function Zc(u){return Xc(u.map(([i,f])=>new Array(i).fill(f,0,i)))}function Xc(u){return u.reduce((i,f)=>i.concat(Array.isArray(f)?Xc(f):f),[])}const j1=[0,1,2,3].concat(...Zc([[2,4],[2,5],[4,6],[4,7],[8,8],[8,9],[16,10],[16,11],[32,12],[32,13],[64,14],[64,15],[2,0],[1,16],[1,17],[2,18],[2,19],[4,20],[4,21],[8,22],[8,23],[16,24],[16,25],[32,26],[32,27],[64,28],[64,29]]));function $t(){const u=this;function i(r){const o=u.dyn_tree,h=u.stat_desc.static_tree,v=u.stat_desc.extra_bits,m=u.stat_desc.extra_base,y=u.stat_desc.max_length;let _,p,b,T,D,G,W=0;for(T=0;T<=Pi;T++)r.bl_count[T]=0;for(o[r.heap[r.heap_max]*2+1]=0,_=r.heap_max+1;_<M1;_++)p=r.heap[_],T=o[o[p*2+1]*2+1]+1,T>y&&(T=y,W++),o[p*2+1]=T,!(p>u.max_code)&&(r.bl_count[T]++,D=0,p>=m&&(D=v[p-m]),G=o[p*2],r.opt_len+=G*(T+D),h&&(r.static_len+=G*(h[p*2+1]+D)));if(W!==0){do{for(T=y-1;r.bl_count[T]===0;)T--;r.bl_count[T]--,r.bl_count[T+1]+=2,r.bl_count[y]--,W-=2}while(W>0);for(T=y;T!==0;T--)for(p=r.bl_count[T];p!==0;)b=r.heap[--_],!(b>u.max_code)&&(o[b*2+1]!=T&&(r.opt_len+=(T-o[b*2+1])*o[b*2],o[b*2+1]=T),p--)}}function f(r,o){let h=0;do h|=r&1,r>>>=1,h<<=1;while(--o>0);return h>>>1}function s(r,o,h){const v=[];let m=0,y,_,p;for(y=1;y<=Pi;y++)v[y]=m=m+h[y-1]<<1;for(_=0;_<=o;_++)p=r[_*2+1],p!==0&&(r[_*2]=f(v[p]++,p))}u.build_tree=function(r){const o=u.dyn_tree,h=u.stat_desc.static_tree,v=u.stat_desc.elems;let m,y,_=-1,p;for(r.heap_len=0,r.heap_max=M1,m=0;m<v;m++)o[m*2]!==0?(r.heap[++r.heap_len]=_=m,r.depth[m]=0):o[m*2+1]=0;for(;r.heap_len<2;)p=r.heap[++r.heap_len]=_<2?++_:0,o[p*2]=1,r.depth[p]=0,r.opt_len--,h&&(r.static_len-=h[p*2+1]);for(u.max_code=_,m=Math.floor(r.heap_len/2);m>=1;m--)r.pqdownheap(o,m);p=v;do m=r.heap[1],r.heap[1]=r.heap[r.heap_len--],r.pqdownheap(o,1),y=r.heap[1],r.heap[--r.heap_max]=m,r.heap[--r.heap_max]=y,o[p*2]=o[m*2]+o[y*2],r.depth[p]=Math.max(r.depth[m],r.depth[y])+1,o[m*2+1]=o[y*2+1]=p,r.heap[1]=p++,r.pqdownheap(o,1);while(r.heap_len>=2);r.heap[--r.heap_max]=r.heap[1],i(r),s(o,u.max_code,r.bl_count)}}$t._length_code=[0,1,2,3,4,5,6,7].concat(...Zc([[2,8],[2,9],[2,10],[2,11],[4,12],[4,13],[4,14],[4,15],[8,16],[8,17],[8,18],[8,19],[16,20],[16,21],[16,22],[16,23],[32,24],[32,25],[32,26],[31,27],[1,28]]));$t.base_length=[0,1,2,3,4,5,6,7,8,10,12,14,16,20,24,28,32,40,48,56,64,80,96,112,128,160,192,224,0];$t.base_dist=[0,1,2,3,4,6,8,12,16,24,32,48,64,96,128,192,256,384,512,768,1024,1536,2048,3072,4096,6144,8192,12288,16384,24576];$t.d_code=function(u){return u<256?j1[u]:j1[256+(u>>>7)]};$t.extra_lbits=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0];$t.extra_dbits=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13];$t.extra_blbits=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7];$t.bl_order=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];function Me(u,i,f,s,r){const o=this;o.static_tree=u,o.extra_bits=i,o.extra_base=f,o.elems=s,o.max_length=r}const xv=[12,140,76,204,44,172,108,236,28,156,92,220,60,188,124,252,2,130,66,194,34,162,98,226,18,146,82,210,50,178,114,242,10,138,74,202,42,170,106,234,26,154,90,218,58,186,122,250,6,134,70,198,38,166,102,230,22,150,86,214,54,182,118,246,14,142,78,206,46,174,110,238,30,158,94,222,62,190,126,254,1,129,65,193,33,161,97,225,17,145,81,209,49,177,113,241,9,137,73,201,41,169,105,233,25,153,89,217,57,185,121,249,5,133,69,197,37,165,101,229,21,149,85,213,53,181,117,245,13,141,77,205,45,173,109,237,29,157,93,221,61,189,125,253,19,275,147,403,83,339,211,467,51,307,179,435,115,371,243,499,11,267,139,395,75,331,203,459,43,299,171,427,107,363,235,491,27,283,155,411,91,347,219,475,59,315,187,443,123,379,251,507,7,263,135,391,71,327,199,455,39,295,167,423,103,359,231,487,23,279,151,407,87,343,215,471,55,311,183,439,119,375,247,503,15,271,143,399,79,335,207,463,47,303,175,431,111,367,239,495,31,287,159,415,95,351,223,479,63,319,191,447,127,383,255,511,0,64,32,96,16,80,48,112,8,72,40,104,24,88,56,120,4,68,36,100,20,84,52,116,3,131,67,195,35,163,99,227],wv=Zc([[144,8],[112,9],[24,7],[8,8]]);Me.static_ltree=Xc(xv.map((u,i)=>[u,wv[i]]));const Ov=[0,16,8,24,4,20,12,28,2,18,10,26,6,22,14,30,1,17,9,25,5,21,13,29,3,19,11,27,7,23],Rv=Zc([[30,5]]);Me.static_dtree=Xc(Ov.map((u,i)=>[u,Rv[i]]));Me.static_l_desc=new Me(Me.static_ltree,$t.extra_lbits,Cc+1,Ir,Pi);Me.static_d_desc=new Me(Me.static_dtree,$t.extra_dbits,0,Mr,Pi);Me.static_bl_desc=new Me(null,$t.extra_blbits,0,Ur,bv);const Dv=9,zv=8;function Nn(u,i,f,s,r){const o=this;o.good_length=u,o.max_lazy=i,o.nice_length=f,o.max_chain=s,o.func=r}const Ah=0,Oc=1,$a=2,Tn=[new Nn(0,0,0,0,Ah),new Nn(4,4,8,4,Oc),new Nn(4,5,16,8,Oc),new Nn(4,6,32,32,Oc),new Nn(4,4,16,16,$a),new Nn(8,16,32,32,$a),new Nn(8,16,128,128,$a),new Nn(8,32,128,256,$a),new Nn(32,128,258,1024,$a),new Nn(32,258,258,4096,$a)],Sc=["need dictionary","stream end","","","stream error","data error","","buffer error","",""],gn=0,Ec=1,Qi=2,Tc=3,Nv=32,_r=42,Ac=113,Fi=666,pr=8,Mv=0,br=1,Uv=2,ee=3,Rc=258,an=Rc+ee+1;function B1(u,i,f,s){const r=u[i*2],o=u[f*2];return r<o||r==o&&s[i]<=s[f]}function Cv(){const u=this;let i,f,s,r,o,h,v,m,y,_,p,b,T,D,G,W,J,Z,$,I,B,it,X,et,ut,st,at,_t,pt,yt,ot,N,V;const lt=new $t,rt=new $t,gt=new $t;u.depth=[];let E,R,k,w,U,L;u.bl_count=[],u.heap=[],ot=[],N=[],V=[];function P(){y=2*o,p[T-1]=0;for(let Y=0;Y<T-1;Y++)p[Y]=0;st=Tn[at].max_lazy,pt=Tn[at].good_length,yt=Tn[at].nice_length,ut=Tn[at].max_chain,B=0,J=0,X=0,Z=et=ee-1,I=0,b=0}function H(){let Y;for(Y=0;Y<Ir;Y++)ot[Y*2]=0;for(Y=0;Y<Mr;Y++)N[Y*2]=0;for(Y=0;Y<Ur;Y++)V[Y*2]=0;ot[Vi*2]=1,u.opt_len=u.static_len=0,R=k=0}function ht(){lt.dyn_tree=ot,lt.stat_desc=Me.static_l_desc,rt.dyn_tree=N,rt.stat_desc=Me.static_d_desc,gt.dyn_tree=V,gt.stat_desc=Me.static_bl_desc,U=0,L=0,w=8,H()}u.pqdownheap=function(Y,tt){const F=u.heap,nt=F[tt];let ct=tt<<1;for(;ct<=u.heap_len&&(ct<u.heap_len&&B1(Y,F[ct+1],F[ct],u.depth)&&ct++,!B1(Y,nt,F[ct],u.depth));)F[tt]=F[ct],tt=ct,ct<<=1;F[tt]=nt};function Yt(Y,tt){let F=-1,nt,ct=Y[1],St=0,wt=7,de=4;ct===0&&(wt=138,de=3),Y[(tt+1)*2+1]=65535;for(let Le=0;Le<=tt;Le++)nt=ct,ct=Y[(Le+1)*2+1],!(++St<wt&&nt==ct)&&(St<de?V[nt*2]+=St:nt!==0?(nt!=F&&V[nt*2]++,V[U1*2]++):St<=10?V[C1*2]++:V[L1*2]++,St=0,F=nt,ct===0?(wt=138,de=3):nt==ct?(wt=6,de=3):(wt=7,de=4))}function Ft(){let Y;for(Yt(ot,lt.max_code),Yt(N,rt.max_code),gt.build_tree(u),Y=Ur-1;Y>=3&&V[$t.bl_order[Y]*2+1]===0;Y--);return u.opt_len+=3*(Y+1)+5+5+4,Y}function ae(Y){u.pending_buf[u.pending++]=Y}function oe(Y){ae(Y&255),ae(Y>>>8&255)}function Jt(Y){ae(Y>>8&255),ae(Y&255&255)}function Gt(Y,tt){let F;const nt=tt;L>vr-nt?(F=Y,U|=F<<L&65535,oe(U),U=F>>>vr-L,L+=nt-vr):(U|=Y<<L&65535,L+=nt)}function kt(Y,tt){const F=Y*2;Gt(tt[F]&65535,tt[F+1]&65535)}function je(Y,tt){let F,nt=-1,ct,St=Y[1],wt=0,de=7,Le=4;for(St===0&&(de=138,Le=3),F=0;F<=tt;F++)if(ct=St,St=Y[(F+1)*2+1],!(++wt<de&&ct==St)){if(wt<Le)do kt(ct,V);while(--wt!==0);else ct!==0?(ct!=nt&&(kt(ct,V),wt--),kt(U1,V),Gt(wt-3,2)):wt<=10?(kt(C1,V),Gt(wt-3,3)):(kt(L1,V),Gt(wt-11,7));wt=0,nt=ct,St===0?(de=138,Le=3):ct==St?(de=6,Le=3):(de=7,Le=4)}}function Be(Y,tt,F){let nt;for(Gt(Y-257,5),Gt(tt-1,5),Gt(F-4,4),nt=0;nt<F;nt++)Gt(V[$t.bl_order[nt]*2+1],3);je(ot,Y-1),je(N,tt-1)}function qe(){L==16?(oe(U),U=0,L=0):L>=8&&(ae(U&255),U>>>=8,L-=8)}function Ce(){Gt(br<<1,3),kt(Vi,Me.static_ltree),qe(),1+w+10-L<9&&(Gt(br<<1,3),kt(Vi,Me.static_ltree),qe()),w=7}function Ae(Y,tt){let F,nt,ct;if(u.dist_buf[R]=Y,u.lc_buf[R]=tt&255,R++,Y===0?ot[tt*2]++:(k++,Y--,ot[($t._length_code[tt]+Cc+1)*2]++,N[$t.d_code(Y)*2]++),(R&8191)===0&&at>2){for(F=R*8,nt=B-J,ct=0;ct<Mr;ct++)F+=N[ct*2]*(5+$t.extra_dbits[ct]);if(F>>>=3,k<Math.floor(R/2)&&F<Math.floor(nt/2))return!0}return R==E-1}function wn(Y,tt){let F,nt,ct=0,St,wt;if(R!==0)do F=u.dist_buf[ct],nt=u.lc_buf[ct],ct++,F===0?kt(nt,Y):(St=$t._length_code[nt],kt(St+Cc+1,Y),wt=$t.extra_lbits[St],wt!==0&&(nt-=$t.base_length[St],Gt(nt,wt)),F--,St=$t.d_code(F),kt(St,tt),wt=$t.extra_dbits[St],wt!==0&&(F-=$t.base_dist[St],Gt(F,wt)));while(ct<R);kt(Vi,Y),w=Y[Vi*2+1]}function nl(){L>8?oe(U):L>0&&ae(U&255),U=0,L=0}function xe(Y,tt,F){nl(),w=8,oe(tt),oe(~tt),u.pending_buf.set(m.subarray(Y,Y+tt),u.pending),u.pending+=tt}function al(Y,tt,F){Gt((Mv<<1)+(F?1:0),3),xe(Y,tt)}function ll(Y,tt,F){let nt,ct,St=0;at>0?(lt.build_tree(u),rt.build_tree(u),St=Ft(),nt=u.opt_len+3+7>>>3,ct=u.static_len+3+7>>>3,ct<=nt&&(nt=ct)):nt=ct=tt+5,tt+4<=nt&&Y!=-1?al(Y,tt,F):ct==nt?(Gt((br<<1)+(F?1:0),3),wn(Me.static_ltree,Me.static_dtree)):(Gt((Uv<<1)+(F?1:0),3),Be(lt.max_code+1,rt.max_code+1,St+1),wn(ot,N)),H(),F&&nl()}function _e(Y){ll(J>=0?J:-1,B-J,Y),J=B,i.flush_pending()}function ea(){let Y,tt,F,nt;do{if(nt=y-X-B,nt===0&&B===0&&X===0)nt=o;else if(nt==-1)nt--;else if(B>=o+o-an){m.set(m.subarray(o,o+o),0),it-=o,B-=o,J-=o,Y=T,F=Y;do tt=p[--F]&65535,p[F]=tt>=o?tt-o:0;while(--Y!==0);Y=o,F=Y;do tt=_[--F]&65535,_[F]=tt>=o?tt-o:0;while(--Y!==0);nt+=o}if(i.avail_in===0)return;Y=i.read_buf(m,B+X,nt),X+=Y,X>=ee&&(b=m[B]&255,b=(b<<W^m[B+1]&255)&G)}while(X<an&&i.avail_in!==0)}function Jc(Y){let tt=65535,F;for(tt>s-5&&(tt=s-5);;){if(X<=1){if(ea(),X===0&&Y==Ql)return gn;if(X===0)break}if(B+=X,X=0,F=J+tt,(B===0||B>=F)&&(X=B-F,B=F,_e(!1),i.avail_out===0)||B-J>=o-an&&(_e(!1),i.avail_out===0))return gn}return _e(Y==ke),i.avail_out===0?Y==ke?Qi:gn:Y==ke?Tc:Ec}function Wl(Y){let tt=ut,F=B,nt,ct,St=et;const wt=B>o-an?B-(o-an):0;let de=yt;const Le=v,pn=B+Rc;let Ca=m[F+St-1],na=m[F+St];et>=pt&&(tt>>=2),de>X&&(de=X);do if(nt=Y,!(m[nt+St]!=na||m[nt+St-1]!=Ca||m[nt]!=m[F]||m[++nt]!=m[F+1])){F+=2,nt++;do;while(m[++F]==m[++nt]&&m[++F]==m[++nt]&&m[++F]==m[++nt]&&m[++F]==m[++nt]&&m[++F]==m[++nt]&&m[++F]==m[++nt]&&m[++F]==m[++nt]&&m[++F]==m[++nt]&&F<pn);if(ct=Rc-(pn-F),F=pn-Rc,ct>St){if(it=Y,St=ct,ct>=de)break;Ca=m[F+St-1],na=m[F+St]}}while((Y=_[Y&Le]&65535)>wt&&--tt!==0);return St<=X?St:X}function kc(Y){let tt=0,F;for(;;){if(X<an){if(ea(),X<an&&Y==Ql)return gn;if(X===0)break}if(X>=ee&&(b=(b<<W^m[B+(ee-1)]&255)&G,tt=p[b]&65535,_[B&v]=p[b],p[b]=B),tt!==0&&(B-tt&65535)<=o-an&&_t!=pc&&(Z=Wl(tt)),Z>=ee)if(F=Ae(B-it,Z-ee),X-=Z,Z<=st&&X>=ee){Z--;do B++,b=(b<<W^m[B+(ee-1)]&255)&G,tt=p[b]&65535,_[B&v]=p[b],p[b]=B;while(--Z!==0);B++}else B+=Z,Z=0,b=m[B]&255,b=(b<<W^m[B+1]&255)&G;else F=Ae(0,m[B]&255),X--,B++;if(F&&(_e(!1),i.avail_out===0))return gn}return _e(Y==ke),i.avail_out===0?Y==ke?Qi:gn:Y==ke?Tc:Ec}function Ic(Y){let tt=0,F,nt;for(;;){if(X<an){if(ea(),X<an&&Y==Ql)return gn;if(X===0)break}if(X>=ee&&(b=(b<<W^m[B+(ee-1)]&255)&G,tt=p[b]&65535,_[B&v]=p[b],p[b]=B),et=Z,$=it,Z=ee-1,tt!==0&&et<st&&(B-tt&65535)<=o-an&&(_t!=pc&&(Z=Wl(tt)),Z<=5&&(_t==Sv||Z==ee&&B-it>4096)&&(Z=ee-1)),et>=ee&&Z<=et){nt=B+X-ee,F=Ae(B-1-$,et-ee),X-=et-1,et-=2;do++B<=nt&&(b=(b<<W^m[B+(ee-1)]&255)&G,tt=p[b]&65535,_[B&v]=p[b],p[b]=B);while(--et!==0);if(I=0,Z=ee-1,B++,F&&(_e(!1),i.avail_out===0))return gn}else if(I!==0){if(F=Ae(0,m[B-1]&255),F&&_e(!1),B++,X--,i.avail_out===0)return gn}else I=1,B++,X--}return I!==0&&(F=Ae(0,m[B-1]&255),I=0),_e(Y==ke),i.avail_out===0?Y==ke?Qi:gn:Y==ke?Tc:Ec}function Ua(Y){return Y.total_in=Y.total_out=0,Y.msg=null,u.pending=0,u.pending_out=0,f=Ac,r=Ql,ht(),P(),An}u.deflateInit=function(Y,tt,F,nt,ct,St){return nt||(nt=pr),ct||(ct=zv),St||(St=Ev),Y.msg=null,tt==Lc&&(tt=6),ct<1||ct>Dv||nt!=pr||F<9||F>15||tt<0||tt>9||St<0||St>pc?xn:(Y.dstate=u,h=F,o=1<<h,v=o-1,D=ct+7,T=1<<D,G=T-1,W=Math.floor((D+ee-1)/ee),m=new Uint8Array(o*2),_=[],p=[],E=1<<ct+6,u.pending_buf=new Uint8Array(E*4),s=E*4,u.dist_buf=new Uint16Array(E),u.lc_buf=new Uint8Array(E),at=tt,_t=St,Ua(Y))},u.deflateEnd=function(){return f!=_r&&f!=Ac&&f!=Fi?xn:(u.lc_buf=null,u.dist_buf=null,u.pending_buf=null,p=null,_=null,m=null,u.dstate=null,f==Ac?Av:An)},u.deflateParams=function(Y,tt,F){let nt=An;return tt==Lc&&(tt=6),tt<0||tt>9||F<0||F>pc?xn:(Tn[at].func!=Tn[tt].func&&Y.total_in!==0&&(nt=Y.deflate(H1)),at!=tt&&(at=tt,st=Tn[at].max_lazy,pt=Tn[at].good_length,yt=Tn[at].nice_length,ut=Tn[at].max_chain),_t=F,nt)},u.deflateSetDictionary=function(Y,tt,F){let nt=F,ct,St=0;if(!tt||f!=_r)return xn;if(nt<ee)return An;for(nt>o-an&&(nt=o-an,St=F-nt),m.set(tt.subarray(St,St+nt),0),B=nt,J=nt,b=m[0]&255,b=(b<<W^m[1]&255)&G,ct=0;ct<=nt-ee;ct++)b=(b<<W^m[ct+(ee-1)]&255)&G,_[ct&v]=p[b],p[b]=ct;return An},u.deflate=function(Y,tt){let F,nt,ct,St,wt;if(tt>ke||tt<0)return xn;if(!Y.next_out||!Y.next_in&&Y.avail_in!==0||f==Fi&&tt!=ke)return Y.msg=Sc[bc-xn],xn;if(Y.avail_out===0)return Y.msg=Sc[bc-Xl],Xl;if(i=Y,St=r,r=tt,f==_r&&(nt=pr+(h-8<<4)<<8,ct=(at-1&255)>>1,ct>3&&(ct=3),nt|=ct<<6,B!==0&&(nt|=Nv),nt+=31-nt%31,f=Ac,Jt(nt)),u.pending!==0){if(i.flush_pending(),i.avail_out===0)return r=-1,An}else if(i.avail_in===0&&tt<=St&&tt!=ke)return i.msg=Sc[bc-Xl],Xl;if(f==Fi&&i.avail_in!==0)return Y.msg=Sc[bc-Xl],Xl;if(i.avail_in!==0||X!==0||tt!=Ql&&f!=Fi){switch(wt=-1,Tn[at].func){case Ah:wt=Jc(tt);break;case Oc:wt=kc(tt);break;case $a:wt=Ic(tt);break}if((wt==Qi||wt==Tc)&&(f=Fi),wt==gn||wt==Qi)return i.avail_out===0&&(r=-1),An;if(wt==Ec){if(tt==H1)Ce();else if(al(0,0,!1),tt==Tv)for(F=0;F<T;F++)p[F]=0;if(i.flush_pending(),i.avail_out===0)return r=-1,An}}return tt!=ke?An:Th}}function xh(){const u=this;u.next_in_index=0,u.next_out_index=0,u.avail_in=0,u.total_in=0,u.avail_out=0,u.total_out=0}xh.prototype={deflateInit(u,i){const f=this;return f.dstate=new Cv,i||(i=Pi),f.dstate.deflateInit(f,u,i)},deflate(u){const i=this;return i.dstate?i.dstate.deflate(i,u):xn},deflateEnd(){const u=this;if(!u.dstate)return xn;const i=u.dstate.deflateEnd();return u.dstate=null,i},deflateParams(u,i){const f=this;return f.dstate?f.dstate.deflateParams(f,u,i):xn},deflateSetDictionary(u,i){const f=this;return f.dstate?f.dstate.deflateSetDictionary(f,u,i):xn},read_buf(u,i,f){const s=this;let r=s.avail_in;return r>f&&(r=f),r===0?0:(s.avail_in-=r,u.set(s.next_in.subarray(s.next_in_index,s.next_in_index+r),i),s.next_in_index+=r,s.total_in+=r,r)},flush_pending(){const u=this;let i=u.dstate.pending;i>u.avail_out&&(i=u.avail_out),i!==0&&(u.next_out.set(u.dstate.pending_buf.subarray(u.dstate.pending_out,u.dstate.pending_out+i),u.next_out_index),u.next_out_index+=i,u.dstate.pending_out+=i,u.total_out+=i,u.avail_out-=i,u.dstate.pending-=i,u.dstate.pending===0&&(u.dstate.pending_out=0))}};function Lv(u){const i=this,f=new xh,s=Hv(u&&u.chunkSize?u.chunkSize:64*1024),r=Ql,o=new Uint8Array(s);let h=u?u.level:Lc;typeof h>"u"&&(h=Lc),f.deflateInit(h),f.next_out=o,i.append=function(v,m){let y,_,p=0,b=0,T=0;const D=[];if(v.length){f.next_in_index=0,f.next_in=v,f.avail_in=v.length;do{if(f.next_out_index=0,f.avail_out=s,y=f.deflate(r),y!=An)throw new Error("deflating: "+f.msg);f.next_out_index&&(f.next_out_index==s?D.push(new Uint8Array(o)):D.push(o.subarray(0,f.next_out_index))),T+=f.next_out_index,m&&f.next_in_index>0&&f.next_in_index!=p&&(m(f.next_in_index),p=f.next_in_index)}while(f.avail_in>0||f.avail_out===0);return D.length>1?(_=new Uint8Array(T),D.forEach(function(G){_.set(G,b),b+=G.length})):_=D[0]?new Uint8Array(D[0]):new Uint8Array,_}},i.flush=function(){let v,m,y=0,_=0;const p=[];do{if(f.next_out_index=0,f.avail_out=s,v=f.deflate(ke),v!=Th&&v!=An)throw new Error("deflating: "+f.msg);s-f.avail_out>0&&p.push(o.slice(0,f.next_out_index)),_+=f.next_out_index}while(f.avail_in>0||f.avail_out===0);return f.deflateEnd(),m=new Uint8Array(_),p.forEach(function(b){m.set(b,y),y+=b.length}),m}}function Hv(u){return u+5*(Math.floor(u/16383)+1)}const ce=4294967295,le=65535,Wr=8,jv=9,wh=0,Oh=99,Rh=67324752,$r=134695760,Dh=$r,Cr=33639248,zh=101010256,Lr=101075792,Nh=117853008,vn=22,ki=20,Ii=56,Bv=vn+ki+Ii,Mh=12,Uh=20,Hc=4,Ch=1,Lh=39169,Hh=10,jh=1,Pr=21589,Yv=28789,Gv=25461,Bh=6534,Hr=1,qv=6,Zv=2,Xv=4,Vv=6,jr=8,Br=2048,Yr=16,Qv=61440,Yh=16384,Gr=73,Sr=420,Fv=20,Y1=45,G1=51,Wi="/",tl=30,to=10,kl=14,Il=18,q1=new Date(2107,11,31),Z1=new Date(1980,0,1),At=void 0,Na="undefined",au="function";class X1{constructor(i){return class extends TransformStream{constructor(f,s){const r=new i(s);super({transform(o,h){h.enqueue(r.append(o))},flush(o){const h=r.flush();h&&o.enqueue(h)}})}}}}const Kv=64;let Gh=2;try{typeof navigator!=Na&&navigator.hardwareConcurrency&&(Gh=navigator.hardwareConcurrency)}catch{}const Jv={chunkSize:512*1024,maxWorkers:Gh,terminateWorkerTimeout:5e3,useWebWorkers:!0,useCompressionStream:!0,workerScripts:At,CompressionStreamNative:typeof CompressionStream!=Na&&CompressionStream,DecompressionStreamNative:typeof DecompressionStream!=Na&&DecompressionStream},Da=Object.assign({},Jv);function eo(){return Da}function qh(u){return Math.max(u.chunkSize,Kv)}function Zh(u){const{baseURL:i,chunkSize:f,maxWorkers:s,terminateWorkerTimeout:r,useCompressionStream:o,useWebWorkers:h,Deflate:v,Inflate:m,CompressionStream:y,DecompressionStream:_,workerScripts:p}=u;if(Oa("baseURL",i),Oa("chunkSize",f),Oa("maxWorkers",s),Oa("terminateWorkerTimeout",r),Oa("useCompressionStream",o),Oa("useWebWorkers",h),v&&(Da.CompressionStream=new X1(v)),m&&(Da.DecompressionStream=new X1(m)),Oa("CompressionStream",y),Oa("DecompressionStream",_),p!==At){const{deflate:b,inflate:T}=p;if((b||T)&&(Da.workerScripts||(Da.workerScripts={})),b){if(!Array.isArray(b))throw new Error("workerScripts.deflate must be an array");Da.workerScripts.deflate=b}if(T){if(!Array.isArray(T))throw new Error("workerScripts.inflate must be an array");Da.workerScripts.inflate=T}}}function Oa(u,i){i!==At&&(Da[u]=i)}function kv(){return"application/octet-stream"}const Xh=[];for(let u=0;u<256;u++){let i=u;for(let f=0;f<8;f++)i&1?i=i>>>1^3988292384:i=i>>>1;Xh[u]=i}class jc{constructor(i){this.crc=i||-1}append(i){let f=this.crc|0;for(let s=0,r=i.length|0;s<r;s++)f=f>>>8^Xh[(f^i[s])&255];this.crc=f}get(){return~this.crc}}class Vh extends TransformStream{constructor(){let i;const f=new jc;super({transform(s,r){f.append(s),r.enqueue(s)},flush(){const s=new Uint8Array(4);new DataView(s.buffer).setUint32(0,f.get()),i.value=s}}),i=this}}function Dc(u){if(typeof TextEncoder==Na){u=unescape(encodeURIComponent(u));const i=new Uint8Array(u.length);for(let f=0;f<i.length;f++)i[f]=u.charCodeAt(f);return i}else return new TextEncoder().encode(u)}const Ge={concat(u,i){if(u.length===0||i.length===0)return u.concat(i);const f=u[u.length-1],s=Ge.getPartial(f);return s===32?u.concat(i):Ge._shiftRight(i,s,f|0,u.slice(0,u.length-1))},bitLength(u){const i=u.length;if(i===0)return 0;const f=u[i-1];return(i-1)*32+Ge.getPartial(f)},clamp(u,i){if(u.length*32<i)return u;u=u.slice(0,Math.ceil(i/32));const f=u.length;return i=i&31,f>0&&i&&(u[f-1]=Ge.partial(i,u[f-1]&2147483648>>i-1,1)),u},partial(u,i,f){return u===32?i:(f?i|0:i<<32-u)+u*1099511627776},getPartial(u){return Math.round(u/1099511627776)||32},_shiftRight(u,i,f,s){for(s===void 0&&(s=[]);i>=32;i-=32)s.push(f),f=0;if(i===0)return s.concat(u);for(let h=0;h<u.length;h++)s.push(f|u[h]>>>i),f=u[h]<<32-i;const r=u.length?u[u.length-1]:0,o=Ge.getPartial(r);return s.push(Ge.partial(i+o&31,i+o>32?f:s.pop(),1)),s}},Bc={bytes:{fromBits(u){const f=Ge.bitLength(u)/8,s=new Uint8Array(f);let r;for(let o=0;o<f;o++)(o&3)===0&&(r=u[o/4]),s[o]=r>>>24,r<<=8;return s},toBits(u){const i=[];let f,s=0;for(f=0;f<u.length;f++)s=s<<8|u[f],(f&3)===3&&(i.push(s),s=0);return f&3&&i.push(Ge.partial(8*(f&3),s)),i}}},Qh={};Qh.sha1=class{constructor(u){const i=this;i.blockSize=512,i._init=[1732584193,4023233417,2562383102,271733878,3285377520],i._key=[1518500249,1859775393,2400959708,3395469782],u?(i._h=u._h.slice(0),i._buffer=u._buffer.slice(0),i._length=u._length):i.reset()}reset(){const u=this;return u._h=u._init.slice(0),u._buffer=[],u._length=0,u}update(u){const i=this;typeof u=="string"&&(u=Bc.utf8String.toBits(u));const f=i._buffer=Ge.concat(i._buffer,u),s=i._length,r=i._length=s+Ge.bitLength(u);if(r>9007199254740991)throw new Error("Cannot hash more than 2^53 - 1 bits");const o=new Uint32Array(f);let h=0;for(let v=i.blockSize+s-(i.blockSize+s&i.blockSize-1);v<=r;v+=i.blockSize)i._block(o.subarray(16*h,16*(h+1))),h+=1;return f.splice(0,16*h),i}finalize(){const u=this;let i=u._buffer;const f=u._h;i=Ge.concat(i,[Ge.partial(1,1)]);for(let s=i.length+2;s&15;s++)i.push(0);for(i.push(Math.floor(u._length/4294967296)),i.push(u._length|0);i.length;)u._block(i.splice(0,16));return u.reset(),f}_f(u,i,f,s){if(u<=19)return i&f|~i&s;if(u<=39)return i^f^s;if(u<=59)return i&f|i&s|f&s;if(u<=79)return i^f^s}_S(u,i){return i<<u|i>>>32-u}_block(u){const i=this,f=i._h,s=Array(80);for(let y=0;y<16;y++)s[y]=u[y];let r=f[0],o=f[1],h=f[2],v=f[3],m=f[4];for(let y=0;y<=79;y++){y>=16&&(s[y]=i._S(1,s[y-3]^s[y-8]^s[y-14]^s[y-16]));const _=i._S(5,r)+i._f(y,o,h,v)+m+s[y]+i._key[Math.floor(y/20)]|0;m=v,v=h,h=i._S(30,o),o=r,r=_}f[0]=f[0]+r|0,f[1]=f[1]+o|0,f[2]=f[2]+h|0,f[3]=f[3]+v|0,f[4]=f[4]+m|0}};const Fh={};Fh.aes=class{constructor(u){const i=this;i._tables=[[[],[],[],[],[]],[[],[],[],[],[]]],i._tables[0][0][0]||i._precompute();const f=i._tables[0][4],s=i._tables[1],r=u.length;let o,h,v,m=1;if(r!==4&&r!==6&&r!==8)throw new Error("invalid aes key size");for(i._key=[h=u.slice(0),v=[]],o=r;o<4*r+28;o++){let y=h[o-1];(o%r===0||r===8&&o%r===4)&&(y=f[y>>>24]<<24^f[y>>16&255]<<16^f[y>>8&255]<<8^f[y&255],o%r===0&&(y=y<<8^y>>>24^m<<24,m=m<<1^(m>>7)*283)),h[o]=h[o-r]^y}for(let y=0;o;y++,o--){const _=h[y&3?o:o-4];o<=4||y<4?v[y]=_:v[y]=s[0][f[_>>>24]]^s[1][f[_>>16&255]]^s[2][f[_>>8&255]]^s[3][f[_&255]]}}encrypt(u){return this._crypt(u,0)}decrypt(u){return this._crypt(u,1)}_precompute(){const u=this._tables[0],i=this._tables[1],f=u[4],s=i[4],r=[],o=[];let h,v,m,y;for(let _=0;_<256;_++)o[(r[_]=_<<1^(_>>7)*283)^_]=_;for(let _=h=0;!f[_];_^=v||1,h=o[h]||1){let p=h^h<<1^h<<2^h<<3^h<<4;p=p>>8^p&255^99,f[_]=p,s[p]=_,y=r[m=r[v=r[_]]];let b=y*16843009^m*65537^v*257^_*16843008,T=r[p]*257^p*16843008;for(let D=0;D<4;D++)u[D][_]=T=T<<24^T>>>8,i[D][p]=b=b<<24^b>>>8}for(let _=0;_<5;_++)u[_]=u[_].slice(0),i[_]=i[_].slice(0)}_crypt(u,i){if(u.length!==4)throw new Error("invalid aes block size");const f=this._key[i],s=f.length/4-2,r=[0,0,0,0],o=this._tables[i],h=o[0],v=o[1],m=o[2],y=o[3],_=o[4];let p=u[0]^f[0],b=u[i?3:1]^f[1],T=u[2]^f[2],D=u[i?1:3]^f[3],G=4,W,J,Z;for(let $=0;$<s;$++)W=h[p>>>24]^v[b>>16&255]^m[T>>8&255]^y[D&255]^f[G],J=h[b>>>24]^v[T>>16&255]^m[D>>8&255]^y[p&255]^f[G+1],Z=h[T>>>24]^v[D>>16&255]^m[p>>8&255]^y[b&255]^f[G+2],D=h[D>>>24]^v[p>>16&255]^m[b>>8&255]^y[T&255]^f[G+3],G+=4,p=W,b=J,T=Z;for(let $=0;$<4;$++)r[i?3&-$:$]=_[p>>>24]<<24^_[b>>16&255]<<16^_[T>>8&255]<<8^_[D&255]^f[G++],W=p,p=b,b=T,T=D,D=W;return r}};const Iv={getRandomValues(u){const i=new Uint32Array(u.buffer),f=s=>{let r=987654321;const o=4294967295;return function(){return r=36969*(r&65535)+(r>>16)&o,s=18e3*(s&65535)+(s>>16)&o,(((r<<16)+s&o)/4294967296+.5)*(Math.random()>.5?1:-1)}};for(let s=0,r;s<u.length;s+=4){const o=f((r||Math.random())*4294967296);r=o()*987654071,i[s/4]=o()*4294967296|0}return u}},Kh={};Kh.ctrGladman=class{constructor(u,i){this._prf=u,this._initIv=i,this._iv=i}reset(){this._iv=this._initIv}update(u){return this.calculate(this._prf,u,this._iv)}incWord(u){if((u>>24&255)===255){let i=u>>16&255,f=u>>8&255,s=u&255;i===255?(i=0,f===255?(f=0,s===255?s=0:++s):++f):++i,u=0,u+=i<<16,u+=f<<8,u+=s}else u+=1<<24;return u}incCounter(u){(u[0]=this.incWord(u[0]))===0&&(u[1]=this.incWord(u[1]))}calculate(u,i,f){let s;if(!(s=i.length))return[];const r=Ge.bitLength(i);for(let o=0;o<s;o+=4){this.incCounter(f);const h=u.encrypt(f);i[o]^=h[0],i[o+1]^=h[1],i[o+2]^=h[2],i[o+3]^=h[3]}return Ge.clamp(i,r)}};const el={importKey(u){return new el.hmacSha1(Bc.bytes.toBits(u))},pbkdf2(u,i,f,s){if(f=f||1e4,s<0||f<0)throw new Error("invalid params to pbkdf2");const r=(s>>5)+1<<2;let o,h,v,m,y;const _=new ArrayBuffer(r),p=new DataView(_);let b=0;const T=Ge;for(i=Bc.bytes.toBits(i),y=1;b<(r||1);y++){for(o=h=u.encrypt(T.concat(i,[y])),v=1;v<f;v++)for(h=u.encrypt(h),m=0;m<h.length;m++)o[m]^=h[m];for(v=0;b<(r||1)&&v<o.length;v++)p.setInt32(b,o[v]),b+=4}return _.slice(0,s/8)}};el.hmacSha1=class{constructor(u){const i=this,f=i._hash=Qh.sha1,s=[[],[]];i._baseHash=[new f,new f];const r=i._baseHash[0].blockSize/32;u.length>r&&(u=new f().update(u).finalize());for(let o=0;o<r;o++)s[0][o]=u[o]^909522486,s[1][o]=u[o]^1549556828;i._baseHash[0].update(s[0]),i._baseHash[1].update(s[1]),i._resultHash=new f(i._baseHash[0])}reset(){const u=this;u._resultHash=new u._hash(u._baseHash[0]),u._updated=!1}update(u){const i=this;i._updated=!0,i._resultHash.update(u)}digest(){const u=this,i=u._resultHash.finalize(),f=new u._hash(u._baseHash[1]).update(i).finalize();return u.reset(),f}encrypt(u){if(this._updated)throw new Error("encrypt on already updated hmac called!");return this.update(u),this.digest(u)}};const Wv=typeof crypto!=Na&&typeof crypto.getRandomValues==au,Jh="Invalid password",kh="Invalid signature",no="zipjs-abort-check-password";function Ih(u){return Wv?crypto.getRandomValues(u):Iv.getRandomValues(u)}const Fl=16,$v="raw",Wh={name:"PBKDF2"},Pv={name:"HMAC"},t4="SHA-1",e4=Object.assign({hash:Pv},Wh),qr=Object.assign({iterations:1e3,hash:{name:t4}},Wh),n4=["deriveBits"],tu=[8,12,16],Ki=[16,24,32],Ra=10,a4=[0,0,0,0],Vc=typeof crypto!=Na,lu=Vc&&crypto.subtle,$h=Vc&&typeof lu!=Na,Mn=Bc.bytes,l4=Fh.aes,i4=Kh.ctrGladman,u4=el.hmacSha1;let V1=Vc&&$h&&typeof lu.importKey==au,Q1=Vc&&$h&&typeof lu.deriveBits==au;class c4 extends TransformStream{constructor({password:i,rawPassword:f,signed:s,encryptionStrength:r,checkPasswordOnly:o}){super({start(){Object.assign(this,{ready:new Promise(h=>this.resolveReady=h),password:em(i,f),signed:s,strength:r-1,pending:new Uint8Array})},async transform(h,v){const m=this,{password:y,strength:_,resolveReady:p,ready:b}=m;y?(await f4(m,_,y,_n(h,0,tu[_]+2)),h=_n(h,tu[_]+2),o?v.error(new Error(no)):p()):await b;const T=new Uint8Array(h.length-Ra-(h.length-Ra)%Fl);v.enqueue(Ph(m,h,T,0,Ra,!0))},async flush(h){const{signed:v,ctr:m,hmac:y,pending:_,ready:p}=this;if(y&&m){await p;const b=_n(_,0,_.length-Ra),T=_n(_,_.length-Ra);let D=new Uint8Array;if(b.length){const G=nu(Mn,b);y.update(G);const W=m.update(G);D=eu(Mn,W)}if(v){const G=_n(eu(Mn,y.digest()),0,Ra);for(let W=0;W<Ra;W++)if(G[W]!=T[W])throw new Error(kh)}h.enqueue(D)}}})}}class s4 extends TransformStream{constructor({password:i,rawPassword:f,encryptionStrength:s}){let r;super({start(){Object.assign(this,{ready:new Promise(o=>this.resolveReady=o),password:em(i,f),strength:s-1,pending:new Uint8Array})},async transform(o,h){const v=this,{password:m,strength:y,resolveReady:_,ready:p}=v;let b=new Uint8Array;m?(b=await r4(v,y,m),_()):await p;const T=new Uint8Array(b.length+o.length-o.length%Fl);T.set(b,0),h.enqueue(Ph(v,o,T,b.length,0))},async flush(o){const{ctr:h,hmac:v,pending:m,ready:y}=this;if(v&&h){await y;let _=new Uint8Array;if(m.length){const p=h.update(nu(Mn,m));v.update(p),_=eu(Mn,p)}r.signature=eu(Mn,v.digest()).slice(0,Ra),o.enqueue(ao(_,r.signature))}}}),r=this}}function Ph(u,i,f,s,r,o){const{ctr:h,hmac:v,pending:m}=u,y=i.length-r;m.length&&(i=ao(m,i),f=h4(f,y-y%Fl));let _;for(_=0;_<=y-Fl;_+=Fl){const p=nu(Mn,_n(i,_,_+Fl));o&&v.update(p);const b=h.update(p);o||v.update(b),f.set(eu(Mn,b),_+s)}return u.pending=_n(i,_),f}async function f4(u,i,f,s){const r=await tm(u,i,f,_n(s,0,tu[i])),o=_n(s,tu[i]);if(r[0]!=o[0]||r[1]!=o[1])throw new Error(Jh)}async function r4(u,i,f){const s=Ih(new Uint8Array(tu[i])),r=await tm(u,i,f,s);return ao(s,r)}async function tm(u,i,f,s){u.password=null;const r=await o4($v,f,e4,!1,n4),o=await d4(Object.assign({salt:s},qr),r,8*(Ki[i]*2+2)),h=new Uint8Array(o),v=nu(Mn,_n(h,0,Ki[i])),m=nu(Mn,_n(h,Ki[i],Ki[i]*2)),y=_n(h,Ki[i]*2);return Object.assign(u,{keys:{key:v,authentication:m,passwordVerification:y},ctr:new i4(new l4(v),Array.from(a4)),hmac:new u4(m)}),y}async function o4(u,i,f,s,r){if(V1)try{return await lu.importKey(u,i,f,s,r)}catch{return V1=!1,el.importKey(i)}else return el.importKey(i)}async function d4(u,i,f){if(Q1)try{return await lu.deriveBits(u,i,f)}catch{return Q1=!1,el.pbkdf2(i,u.salt,qr.iterations,f)}else return el.pbkdf2(i,u.salt,qr.iterations,f)}function em(u,i){return i===At?Dc(u):i}function ao(u,i){let f=u;return u.length+i.length&&(f=new Uint8Array(u.length+i.length),f.set(u,0),f.set(i,u.length)),f}function h4(u,i){if(i&&i>u.length){const f=u;u=new Uint8Array(i),u.set(f,0)}return u}function _n(u,i,f){return u.subarray(i,f)}function eu(u,i){return u.fromBits(i)}function nu(u,i){return u.toBits(i)}const $i=12;class m4 extends TransformStream{constructor({password:i,passwordVerification:f,checkPasswordOnly:s}){super({start(){Object.assign(this,{password:i,passwordVerification:f}),nm(this,i)},transform(r,o){const h=this;if(h.password){const v=F1(h,r.subarray(0,$i));if(h.password=null,v.at(-1)!=h.passwordVerification)throw new Error(Jh);r=r.subarray($i)}s?o.error(new Error(no)):o.enqueue(F1(h,r))}})}}class y4 extends TransformStream{constructor({password:i,passwordVerification:f}){super({start(){Object.assign(this,{password:i,passwordVerification:f}),nm(this,i)},transform(s,r){const o=this;let h,v;if(o.password){o.password=null;const m=Ih(new Uint8Array($i));m[$i-1]=o.passwordVerification,h=new Uint8Array(s.length+m.length),h.set(K1(o,m),0),v=$i}else h=new Uint8Array(s.length),v=0;h.set(K1(o,s),v),r.enqueue(h)}})}}function F1(u,i){const f=new Uint8Array(i.length);for(let s=0;s<i.length;s++)f[s]=am(u)^i[s],lo(u,f[s]);return f}function K1(u,i){const f=new Uint8Array(i.length);for(let s=0;s<i.length;s++)f[s]=am(u)^i[s],lo(u,i[s]);return f}function nm(u,i){const f=[305419896,591751049,878082192];Object.assign(u,{keys:f,crcKey0:new jc(f[0]),crcKey2:new jc(f[2])});for(let s=0;s<i.length;s++)lo(u,i.charCodeAt(s))}function lo(u,i){let[f,s,r]=u.keys;u.crcKey0.append([i]),f=~u.crcKey0.get(),s=J1(Math.imul(J1(s+lm(f)),134775813)+1),u.crcKey2.append([s>>>24]),r=~u.crcKey2.get(),u.keys=[f,s,r]}function am(u){const i=u.keys[2]|2;return lm(Math.imul(i,i^1)>>>8)}function lm(u){return u&255}function J1(u){return u&4294967295}const im="Invalid uncompressed size",k1="deflate-raw";class g4 extends TransformStream{constructor(i,{chunkSize:f,CompressionStream:s,CompressionStreamNative:r}){super({});const{compressed:o,encrypted:h,useCompressionStream:v,zipCrypto:m,signed:y,level:_}=i,p=this;let b,T,D=super.readable;(!h||m)&&y&&(b=new Vh,D=Pn(D,b)),o&&(D=cm(D,v,{level:_,chunkSize:f},r,s)),h&&(m?D=Pn(D,new y4(i)):(T=new s4(i),D=Pn(D,T))),um(p,D,()=>{let G;h&&!m&&(G=T.signature),(!h||m)&&y&&(G=new DataView(b.value.buffer).getUint32(0)),p.signature=G})}}class v4 extends TransformStream{constructor(i,{chunkSize:f,DecompressionStream:s,DecompressionStreamNative:r}){super({});const{zipCrypto:o,encrypted:h,signed:v,signature:m,compressed:y,useCompressionStream:_}=i;let p,b,T=super.readable;h&&(o?T=Pn(T,new m4(i)):(b=new c4(i),T=Pn(T,b))),y&&(T=cm(T,_,{chunkSize:f},r,s)),(!h||o)&&v&&(p=new Vh,T=Pn(T,p)),um(this,T,()=>{if((!h||o)&&v){const D=new DataView(p.value.buffer);if(m!=D.getUint32(0,!1))throw new Error(kh)}})}}function um(u,i,f){i=Pn(i,new TransformStream({flush:f})),Object.defineProperty(u,"readable",{get(){return i}})}function cm(u,i,f,s,r){try{const o=i&&s?s:r;u=Pn(u,new o(k1,f))}catch(o){if(i)u=Pn(u,new r(k1,f));else throw o}return u}function Pn(u,i){return u.pipeThrough(i)}const _4="message",p4="start",b4="pull",I1="data",S4="ack",W1="close",sm="deflate",fm="inflate";class E4 extends TransformStream{constructor(i,f){super({});const s=this,{codecType:r}=i;let o;r.startsWith(sm)?o=g4:r.startsWith(fm)&&(o=v4),s.outputSize=0;let h=0;const v=new o(i,f),m=super.readable,y=new TransformStream({transform(p,b){p&&p.length&&(h+=p.length,b.enqueue(p))},flush(){Object.assign(s,{inputSize:h})}}),_=new TransformStream({transform(p,b){if(p&&p.length&&(b.enqueue(p),s.outputSize+=p.length,i.outputSize&&s.outputSize>i.outputSize))throw new Error(im)},flush(){const{signature:p}=v;Object.assign(s,{signature:p,inputSize:h})}});Object.defineProperty(s,"readable",{get(){return m.pipeThrough(y).pipeThrough(v).pipeThrough(_)}})}}class T4 extends TransformStream{constructor(i){let f;super({transform:s,flush(r){f&&f.length&&r.enqueue(f)}});function s(r,o){if(f){const h=new Uint8Array(f.length+r.length);h.set(f),h.set(r,f.length),r=h,f=null}r.length>i?(o.enqueue(r.slice(0,i)),s(r.slice(i),o)):f=r}}}let rm=typeof Worker!=Na;class Er{constructor(i,{readable:f,writable:s},{options:r,config:o,streamOptions:h,useWebWorkers:v,transferStreams:m,scripts:y},_){const{signal:p}=h;return Object.assign(i,{busy:!0,readable:f.pipeThrough(new T4(o.chunkSize)).pipeThrough(new A4(h),{signal:p}),writable:s,options:Object.assign({},r),scripts:y,transferStreams:m,terminate(){return new Promise(b=>{const{worker:T,busy:D}=i;T?(D?i.resolveTerminated=b:(T.terminate(),b()),i.interface=null):b()})},onTaskFinished(){const{resolveTerminated:b}=i;b&&(i.resolveTerminated=null,i.terminated=!0,i.worker.terminate(),b()),i.busy=!1,_(i)}}),(v&&rm?x4:om)(i,o)}}class A4 extends TransformStream{constructor({onstart:i,onprogress:f,size:s,onend:r}){let o=0;super({async start(){i&&await Tr(i,s)},async transform(h,v){o+=h.length,f&&await Tr(f,o,s),v.enqueue(h)},async flush(){r&&await Tr(r,o)}})}}async function Tr(u,...i){try{await u(...i)}catch{}}function om(u,i){return{run:()=>w4(u,i)}}function x4(u,i){const{baseURL:f,chunkSize:s}=i;if(!u.interface){let r;try{r=D4(u.scripts[0],f,u)}catch{return rm=!1,om(u,i)}Object.assign(u,{worker:r,interface:{run:()=>O4(u,{chunkSize:s})}})}return u.interface}async function w4({options:u,readable:i,writable:f,onTaskFinished:s},r){let o;try{o=new E4(u,r),await i.pipeThrough(o).pipeTo(f,{preventClose:!0,preventAbort:!0});const{signature:h,inputSize:v,outputSize:m}=o;return{signature:h,inputSize:v,outputSize:m}}catch(h){throw o&&(h.outputSize=o.outputSize),h}finally{s()}}async function O4(u,i){let f,s;const r=new Promise((b,T)=>{f=b,s=T});Object.assign(u,{reader:null,writer:null,resolveResult:f,rejectResult:s,result:r});const{readable:o,options:h,scripts:v}=u,{writable:m,closed:y}=R4(u.writable),_=zc({type:p4,scripts:v.slice(1),options:h,config:i,readable:o,writable:m},u);_||Object.assign(u,{reader:o.getReader(),writer:m.getWriter()});const p=await r;return _||await m.getWriter().close(),await y,p}function R4(u){let i;const f=new Promise(r=>i=r);return{writable:new WritableStream({async write(r){const o=u.getWriter();await o.ready,await o.write(r),o.releaseLock()},close(){i()},abort(r){return u.getWriter().abort(r)}}),closed:f}}let $1=!0,P1=!0;function D4(u,i,f){const s={type:"module"};let r,o;typeof u==au&&(u=u());try{r=new URL(u,i)}catch{r=u}if($1)try{o=new Worker(r)}catch{$1=!1,o=new Worker(r,s)}else o=new Worker(r,s);return o.addEventListener(_4,h=>z4(h,f)),o}function zc(u,{worker:i,writer:f,onTaskFinished:s,transferStreams:r}){try{const{value:o,readable:h,writable:v}=u,m=[];if(o&&(o.byteLength<o.buffer.byteLength?u.value=o.buffer.slice(0,o.byteLength):u.value=o.buffer,m.push(u.value)),r&&P1?(h&&m.push(h),v&&m.push(v)):u.readable=u.writable=null,m.length)try{return i.postMessage(u,m),!0}catch{P1=!1,u.readable=u.writable=null,i.postMessage(u)}else i.postMessage(u)}catch(o){throw f&&f.releaseLock(),s(),o}}async function z4({data:u},i){const{type:f,value:s,messageId:r,result:o,error:h}=u,{reader:v,writer:m,resolveResult:y,rejectResult:_,onTaskFinished:p}=i;try{if(h){const{message:T,stack:D,code:G,name:W,outputSize:J}=h,Z=new Error(T);Object.assign(Z,{stack:D,code:G,name:W,outputSize:J}),b(Z)}else{if(f==b4){const{value:T,done:D}=await v.read();zc({type:I1,value:T,done:D,messageId:r},i)}f==I1&&(await m.ready,await m.write(new Uint8Array(s)),zc({type:S4,messageId:r},i)),f==W1&&b(null,o)}}catch(T){zc({type:W1,messageId:r},i),b(T)}function b(T,D){T?_(T):y(D),m&&m.releaseLock(),p()}}let za=[];const Ar=[];let th=0;async function dm(u,i){const{options:f,config:s}=i,{transferStreams:r,useWebWorkers:o,useCompressionStream:h,codecType:v,compressed:m,signed:y,encrypted:_}=f,{workerScripts:p,maxWorkers:b}=s;i.transferStreams=r||r===At;const T=!m&&!y&&!_&&!i.transferStreams;return i.useWebWorkers=!T&&(o||o===At&&s.useWebWorkers),i.scripts=i.useWebWorkers&&p?p[v]:[],f.useCompressionStream=h||h===At&&s.useCompressionStream,(await D()).run();async function D(){const W=za.find(J=>!J.busy);if(W)return Zr(W),new Er(W,u,i,G);if(za.length<b){const J={indexWorker:th};return th++,za.push(J),new Er(J,u,i,G)}else return new Promise(J=>Ar.push({resolve:J,stream:u,workerOptions:i}))}function G(W){if(Ar.length){const[{resolve:J,stream:Z,workerOptions:$}]=Ar.splice(0,1);J(new Er(W,Z,$,G))}else W.worker?(Zr(W),N4(W,i)):za=za.filter(J=>J!=W)}}function N4(u,i){const{config:f}=i,{terminateWorkerTimeout:s}=f;Number.isFinite(s)&&s>=0&&(u.terminated?u.terminated=!1:u.terminateTimeout=setTimeout(async()=>{za=za.filter(r=>r!=u);try{await u.terminate()}catch{}},s))}function Zr(u){const{terminateTimeout:i}=u;i&&(clearTimeout(i),u.terminateTimeout=null)}async function M4(){await Promise.allSettled(za.map(u=>(Zr(u),u.terminate())))}const hm="HTTP error ",iu="HTTP Range not supported",mm="Writer iterator completed too soon",ym="Writer not initialized",U4="text/plain",C4="Content-Length",L4="Content-Range",H4="Accept-Ranges",j4="Range",B4="Content-Type",Y4="HEAD",io="GET",gm="bytes",G4=64*1024,uo="writable";class Qc{constructor(){this.size=0}init(){this.initialized=!0}}class Ma extends Qc{get readable(){const i=this,{chunkSize:f=G4}=i,s=new ReadableStream({start(){this.chunkOffset=0},async pull(r){const{offset:o=0,size:h,diskNumberStart:v}=s,{chunkOffset:m}=this,y=h===At?f:Math.min(f,h-m),_=await Ee(i,o+m,y,v);r.enqueue(_),m+f>h||h===At&&!_.length&&y?r.close():this.chunkOffset+=f}});return s}}class co extends Qc{constructor(){super();const i=this,f=new WritableStream({write(s){if(!i.initialized)throw new Error(ym);return i.writeUint8Array(s)}});Object.defineProperty(i,uo,{get(){return f}})}writeUint8Array(){}}class q4 extends Ma{constructor(i){super();let f=i.length;for(;i.charAt(f-1)=="=";)f--;const s=i.indexOf(",")+1;Object.assign(this,{dataURI:i,dataStart:s,size:Math.floor((f-s)*.75)})}readUint8Array(i,f){const{dataStart:s,dataURI:r}=this,o=new Uint8Array(f),h=Math.floor(i/3)*4,v=atob(r.substring(h+s,Math.ceil((i+f)/3)*4+s)),m=i-Math.floor(h/4)*3;let y=0;for(let _=m;_<m+f&&_<v.length;_++)o[_-m]=v.charCodeAt(_),y++;return y<o.length?o.subarray(0,y):o}}class Z4 extends co{constructor(i){super(),Object.assign(this,{data:"data:"+(i||"")+";base64,",pending:[]})}writeUint8Array(i){const f=this;let s=0,r=f.pending;const o=f.pending.length;for(f.pending="",s=0;s<Math.floor((o+i.length)/3)*3-o;s++)r+=String.fromCharCode(i[s]);for(;s<i.length;s++)f.pending+=String.fromCharCode(i[s]);r.length&&(r.length>2?f.data+=btoa(r):f.pending+=r)}getData(){return this.data+btoa(this.pending)}}class so extends Ma{constructor(i){super(),Object.assign(this,{blob:i,size:i.size})}async readUint8Array(i,f){const s=this,r=i+f;let h=await(i||r<s.size?s.blob.slice(i,r):s.blob).arrayBuffer();return h.byteLength>f&&(h=h.slice(i,r)),new Uint8Array(h)}}class vm extends Qc{constructor(i){super();const f=this,s=new TransformStream,r=[];i&&r.push([B4,i]),Object.defineProperty(f,uo,{get(){return s.writable}}),f.blob=new Response(s.readable,{headers:r}).blob()}getData(){return this.blob}}class X4 extends so{constructor(i){super(new Blob([i],{type:U4}))}}class V4 extends vm{constructor(i){super(i),Object.assign(this,{encoding:i,utf8:!i||i.toLowerCase()=="utf-8"})}async getData(){const{encoding:i,utf8:f}=this,s=await super.getData();if(s.text&&f)return s.text();{const r=new FileReader;return new Promise((o,h)=>{Object.assign(r,{onload:({target:v})=>o(v.result),onerror:()=>h(r.error)}),r.readAsText(s,i)})}}}class Q4 extends Ma{constructor(i,f){super(),_m(this,i,f)}async init(){await pm(this,Xr,eh),super.init()}readUint8Array(i,f){return bm(this,i,f,Xr,eh)}}class F4 extends Ma{constructor(i,f){super(),_m(this,i,f)}async init(){await pm(this,Vr,nh),super.init()}readUint8Array(i,f){return bm(this,i,f,Vr,nh)}}function _m(u,i,f){const{preventHeadRequest:s,useRangeHeader:r,forceRangeRequests:o,combineSizeEocd:h}=f;f=Object.assign({},f),delete f.preventHeadRequest,delete f.useRangeHeader,delete f.forceRangeRequests,delete f.combineSizeEocd,delete f.useXHR,Object.assign(u,{url:i,options:f,preventHeadRequest:s,useRangeHeader:r,forceRangeRequests:o,combineSizeEocd:h})}async function pm(u,i,f){const{url:s,preventHeadRequest:r,useRangeHeader:o,forceRangeRequests:h,combineSizeEocd:v}=u;if(I4(s)&&(o||h)&&(typeof r>"u"||r)){const m=await i(io,u,Sm(u,v?-vn:void 0));if(!h&&m.headers.get(H4)!=gm)throw new Error(iu);{v&&(u.eocdCache=new Uint8Array(await m.arrayBuffer()));let y;const _=m.headers.get(L4);if(_){const p=_.trim().split(/\s*\/\s*/);if(p.length){const b=p[1];b&&b!="*"&&(y=Number(b))}}y===At?await ah(u,i,f):u.size=y}}else await ah(u,i,f)}async function bm(u,i,f,s,r){const{useRangeHeader:o,forceRangeRequests:h,eocdCache:v,size:m,options:y}=u;if(o||h){if(v&&i==m-vn&&f==vn)return v;if(i>=m)return new Uint8Array;{i+f>m&&(f=m-i);const _=await s(io,u,Sm(u,i,f));if(_.status!=206)throw new Error(iu);return new Uint8Array(await _.arrayBuffer())}}else{const{data:_}=u;return _||await r(u,y),new Uint8Array(u.data.subarray(i,i+f))}}function Sm(u,i=0,f=1){return Object.assign({},fo(u),{[j4]:gm+"="+(i<0?i:i+"-"+(i+f-1))})}function fo({options:u}){const{headers:i}=u;if(i)return Symbol.iterator in i?Object.fromEntries(i):i}async function eh(u){await Em(u,Xr)}async function nh(u){await Em(u,Vr)}async function Em(u,i){const f=await i(io,u,fo(u));u.data=new Uint8Array(await f.arrayBuffer()),u.size||(u.size=u.data.length)}async function ah(u,i,f){if(u.preventHeadRequest)await f(u,u.options);else{const r=(await i(Y4,u,fo(u))).headers.get(C4);r?u.size=Number(r):await f(u,u.options)}}async function Xr(u,{options:i,url:f},s){const r=await fetch(f,Object.assign({},i,{method:u,headers:s}));if(r.status<400)return r;throw r.status==416?new Error(iu):new Error(hm+(r.statusText||r.status))}function Vr(u,{url:i},f){return new Promise((s,r)=>{const o=new XMLHttpRequest;if(o.addEventListener("load",()=>{if(o.status<400){const h=[];o.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach(v=>{const m=v.trim().split(/\s*:\s*/);m[0]=m[0].trim().replace(/^[a-z]|-[a-z]/g,y=>y.toUpperCase()),h.push(m)}),s({status:o.status,arrayBuffer:()=>o.response,headers:new Map(h)})}else r(o.status==416?new Error(iu):new Error(hm+(o.statusText||o.status)))},!1),o.addEventListener("error",h=>r(h.detail?h.detail.error:new Error("Network error")),!1),o.open(u,i),f)for(const h of Object.entries(f))o.setRequestHeader(h[0],h[1]);o.responseType="arraybuffer",o.send()})}class Tm extends Ma{constructor(i,f={}){super(),Object.assign(this,{url:i,reader:f.useXHR?new F4(i,f):new Q4(i,f)})}set size(i){}get size(){return this.reader.size}async init(){await this.reader.init(),super.init()}readUint8Array(i,f){return this.reader.readUint8Array(i,f)}}class K4 extends Tm{constructor(i,f={}){f.useRangeHeader=!0,super(i,f)}}class J4 extends Ma{constructor(i){super(),i=new Uint8Array(i.buffer,i.byteOffset,i.byteLength),Object.assign(this,{array:i,size:i.length})}readUint8Array(i,f){return this.array.slice(i,i+f)}}class k4 extends co{init(i=0){Object.assign(this,{offset:0,array:new Uint8Array(i)}),super.init()}writeUint8Array(i){const f=this;if(f.offset+i.length>f.array.length){const s=f.array;f.array=new Uint8Array(s.length+i.length),f.array.set(s)}f.array.set(i,f.offset),f.offset+=i.length}getData(){return this.array}}class ro extends Ma{constructor(i){super(),this.readers=i}async init(){const i=this,{readers:f}=i;i.lastDiskNumber=0,i.lastDiskOffset=0,await Promise.all(f.map(async(s,r)=>{await s.init(),r!=f.length-1&&(i.lastDiskOffset+=s.size),i.size+=s.size})),super.init()}async readUint8Array(i,f,s=0){const r=this,{readers:o}=this;let h,v=s;v==-1&&(v=o.length-1);let m=i;for(;o[v]&&m>=o[v].size;)m-=o[v].size,v++;const y=o[v];if(y){const _=y.size;if(m+f<=_)h=await Ee(y,m,f);else{const p=_-m;h=new Uint8Array(f);const b=await Ee(y,m,p);h.set(b,0);const T=await r.readUint8Array(i+p,f-p,s);h.set(T,p),b.length+T.length<f&&(h=h.subarray(0,b.length+T.length))}}else h=new Uint8Array;return r.lastDiskNumber=Math.max(v,r.lastDiskNumber),h}}class Yc extends Qc{constructor(i,f=4294967295){super();const s=this;Object.assign(s,{diskNumber:0,diskOffset:0,size:0,maxSize:f,availableSize:f});let r,o,h;const v=new WritableStream({async write(_){const{availableSize:p}=s;if(h)_.length>=p?(await m(_.subarray(0,p)),await y(),s.diskOffset+=r.size,s.diskNumber++,h=null,await this.write(_.subarray(p))):await m(_);else{const{value:b,done:T}=await i.next();if(T&&!b)throw new Error(mm);r=b,r.size=0,r.maxSize&&(s.maxSize=r.maxSize),s.availableSize=s.maxSize,await ta(r),o=b.writable,h=o.getWriter(),await this.write(_)}},async close(){await h.ready,await y()}});Object.defineProperty(s,uo,{get(){return v}});async function m(_){const p=_.length;p&&(await h.ready,await h.write(_),r.size+=p,s.size+=p,s.availableSize-=p)}async function y(){await h.close()}}}class Fc{constructor(i){return Array.isArray(i)&&(i=new ro(i)),i instanceof ReadableStream&&(i={readable:i}),i}}class oo{constructor(i){return i.writable===At&&typeof i.next==au&&(i=new Yc(i)),i instanceof WritableStream&&(i={writable:i}),i.size===At&&(i.size=0),i instanceof Yc||Object.assign(i,{diskNumber:0,diskOffset:0,availableSize:1/0,maxSize:1/0}),i}}function I4(u){const{baseURL:i}=eo(),{protocol:f}=new URL(u,i);return f=="http:"||f=="https:"}async function ta(u,i){if(u.init&&!u.initialized)await u.init(i);else return Promise.resolve()}function Ee(u,i,f,s){return u.readUint8Array(i,f,s)}const W4=ro,$4=Yc,Am="filename",xm="rawFilename",ho="comment",wm="rawComment",mo="uncompressedSize",Om="compressedSize",Rm="offset",Qr="diskNumberStart",Gc="lastModDate",Fr="rawLastModDate",yo="lastAccessDate",P4="rawLastAccessDate",go="creationDate",t_="rawCreationDate",Dm="internalFileAttribute",zm="internalFileAttributes",Nm="externalFileAttribute",Mm="externalFileAttributes",Um="msDosCompatible",vo="zip64",Cm="encrypted",Lm="version",Hm="versionMadeBy",jm="zipCrypto",Nc="directory",Bm="executable",Ym="compressionMethod",Gm="signature",qm="extraField",e_=[Am,xm,Om,mo,Gc,Fr,ho,wm,yo,go,Rm,Qr,Qr,Dm,zm,Nm,Mm,Um,vo,Cm,Lm,Hm,jm,Nc,Bm,Ym,Gm,qm,"bitFlag","filenameUTF8","commentUTF8","rawExtraField","extraFieldZip64","extraFieldUnicodePath","extraFieldUnicodeComment","extraFieldAES","extraFieldNTFS","extraFieldExtendedTimestamp"];class qc{constructor(i){e_.forEach(f=>this[f]=i[f])}}const n_="filenameEncoding",a_="commentEncoding",l_="decodeText",i_="extractPrependedData",u_="extractAppendedData",Zm="password",Xm="rawPassword",Vm="passThrough",Qm="signal",c_="checkPasswordOnly",s_="checkOverlappingEntryOnly",f_="checkOverlappingEntry",r_="checkSignature",Fm="useWebWorkers",Km="useCompressionStream",o_="transferStreams",Jm="preventClose",d_="encryptionStrength",h_="extendedTimestamp",m_="keepOrder",y_="level",g_="bufferedWrite",v_="dataDescriptorSignature",__="useUnicodeFileNames",p_="dataDescriptor",km="supportZip64SplitFile",b_="encodeText",lh="offset",Im="usdz",Wm="\0â˜ºâ˜»â™¥â™¦â™£â™ â€¢â—˜â—‹â—™â™‚â™€â™ªâ™«â˜¼â–ºâ—„â†•â€¼Â¶Â§â–¬â†¨â†‘â†“â†’â†�âˆŸâ†”â–²â–¼ !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~âŒ‚Ã‡Ã¼Ã©Ã¢Ã¤Ã Ã¥Ã§ÃªÃ«Ã¨Ã¯Ã®Ã¬Ã„Ã…Ã‰Ã¦Ã†Ã´Ã¶Ã²Ã»Ã¹Ã¿Ã–ÃœÂ¢Â£Â¥â‚§Æ’Ã¡Ã­Ã³ÃºÃ±Ã‘ÂªÂºÂ¿âŒ�Â¬Â½Â¼Â¡Â«Â»â–‘â–’â–“â”‚â”¤â•¡â•¢â•–â••â•£â•‘â•—â•�â•œâ•›â”�â””â”´â”¬â”œâ”€â”¼â•žâ•Ÿâ•šâ•”â•©â•¦â• â•�â•¬â•§â•¨â•¤â•¥â•™â•˜â•’â•“â•«â•ªâ”˜â”Œâ–ˆâ–„â–Œâ–�â–€Î±ÃŸÎ“Ï€Î£ÏƒÂµÏ„Î¦Î˜Î©Î´âˆžÏ†Îµâˆ©â‰¡Â±â‰¥â‰¤âŒ âŒ¡Ã·â‰ˆÂ°âˆ™Â·âˆšâ�¿Â²â–  ".split(""),S_=Wm.length==256;function E_(u){if(S_){let i="";for(let f=0;f<u.length;f++)i+=Wm[u[f]];return i}else return new TextDecoder().decode(u)}function Mc(u,i){return i&&i.trim().toLowerCase()=="cp437"?E_(u):new TextDecoder(i).decode(u)}const xr="File format is not recognized",T_="End of central directory not found",A_="End of Zip64 central directory locator not found",x_="Central directory header not found",w_="Local file header not found",O_="Zip64 extra field not found",R_="File contains encrypted entry",D_="Encryption method not supported",ih="Compression method not supported",uh="Split zip file",z_="Overlapping entry found",ch="utf-8",sh="cp437",N_=[[mo,ce],[Om,ce],[Rm,ce],[Qr,le]],M_={[le]:{getValue:Pt,bytes:4},[ce]:{getValue:Jl,bytes:8}};class U_{constructor(i,f={}){Object.assign(this,{reader:new Fc(i),options:f,config:eo(),readRanges:[]})}async*getEntriesGenerator(i={}){const f=this;let{reader:s}=f;const{config:r}=f;if(await ta(s),(s.size===At||!s.readUint8Array)&&(s=new so(await new Response(s.readable).blob()),await ta(s)),s.size<vn)throw new Error(xr);s.chunkSize=qh(r);const o=await G_(s,zh,s.size,vn,le*16);if(!o){const st=await Ee(s,0,4),at=ne(st);throw Pt(at)==$r?new Error(uh):new Error(T_)}const h=ne(o);let v=Pt(h,12),m=Pt(h,16);const y=o.offset,_=Te(h,20),p=y+vn+_;let b=Te(h,4);const T=s.lastDiskNumber||0;let D=Te(h,6),G=Te(h,8),W=0,J=0;if(m==ce||v==ce||G==le||D==le){const st=await Ee(s,o.offset-ki,ki),at=ne(st);if(Pt(at,0)==Nh){m=Jl(at,8);let _t=await Ee(s,m,Ii,-1),pt=ne(_t);const yt=o.offset-ki-Ii;if(Pt(pt,0)!=Lr&&m!=yt){const ot=m;m=yt,m>ot&&(W=m-ot),_t=await Ee(s,m,Ii,-1),pt=ne(_t)}if(Pt(pt,0)!=Lr)throw new Error(A_);b==le&&(b=Pt(pt,16)),D==le&&(D=Pt(pt,20)),G==le&&(G=Jl(pt,32)),v==ce&&(v=Jl(pt,40)),m-=v}}if(m>=s.size&&(W=s.size-m-v-vn,m=s.size-v-vn),T!=b)throw new Error(uh);if(m<0)throw new Error(xr);let Z=0,$=await Ee(s,m,v,D),I=ne($);if(v){const st=o.offset-v;if(Pt(I,Z)!=Cr&&m!=st){const at=m;m=st,m>at&&(W+=m-at),$=await Ee(s,m,v,D),I=ne($)}}const B=o.offset-m-(s.lastDiskOffset||0);if(v!=B&&B>=0&&(v=B,$=await Ee(s,m,v,D),I=ne($)),m<0||m>=s.size)throw new Error(xr);const it=Ne(f,i,n_),X=Ne(f,i,a_);for(let st=0;st<G;st++){const at=new C_(s,r,f.options);if(Pt(I,Z)!=Cr)throw new Error(x_);$m(at,I,Z+6);const _t=!!at.bitFlag.languageEncodingFlag,pt=Z+46,yt=pt+at.filenameLength,ot=yt+at.extraFieldLength,N=Te(I,Z+4),V=N>>8==0,lt=N>>8==3,rt=$.subarray(pt,yt),gt=Te(I,Z+32),E=ot+gt,R=$.subarray(ot,E),k=_t,w=_t,U=Pt(I,Z+38),L=V&&(Kl(I,Z+38)&Yr)==Yr||lt&&(U>>16&Qv)==Yh||rt.length&&rt.at(-1)==Wi.charCodeAt(0),P=lt&&(U>>16&Gr)!=0,H=Pt(I,Z+42)+W;Object.assign(at,{versionMadeBy:N,msDosCompatible:V,compressedSize:0,uncompressedSize:0,commentLength:gt,directory:L,offset:H,diskNumberStart:Te(I,Z+34),internalFileAttributes:Te(I,Z+36),externalFileAttributes:U,rawFilename:rt,filenameUTF8:k,commentUTF8:w,rawExtraField:$.subarray(yt,ot),executable:P}),at.internalFileAttribute=at.internalFileAttributes,at.externalFileAttribute=at.externalFileAttributes;const ht=Ne(f,i,l_)||Mc,Yt=k?ch:it||sh,Ft=w?ch:X||sh;let ae=ht(rt,Yt);ae===At&&(ae=Mc(rt,Yt));let oe=ht(R,Ft);oe===At&&(oe=Mc(R,Ft)),Object.assign(at,{rawComment:R,filename:ae,comment:oe,directory:L||ae.endsWith(Wi)}),J=Math.max(H,J),Pm(at,at,I,Z+6),at.zipCrypto=at.encrypted&&!at.extraFieldAES;const Jt=new qc(at);Jt.getData=(kt,je)=>at.getData(kt,Jt,f.readRanges,je),Jt.arrayBuffer=async kt=>{const je=new TransformStream,[Be]=await Promise.all([new Response(je.readable).arrayBuffer(),at.getData(je,Jt,f.readRanges,kt)]);return Be},Z=E;const{onprogress:Gt}=i;if(Gt)try{await Gt(st+1,G,new qc(at))}catch{}yield Jt}const et=Ne(f,i,i_),ut=Ne(f,i,u_);return et&&(f.prependedData=J>0?await Ee(s,0,J):new Uint8Array),f.comment=_?await Ee(s,y+vn,_):new Uint8Array,ut&&(f.appendedData=p<s.size?await Ee(s,p,s.size-p):new Uint8Array),!0}async getEntries(i={}){const f=[];for await(const s of this.getEntriesGenerator(i))f.push(s);return f}async close(){}}class C_{constructor(i,f,s){Object.assign(this,{reader:i,config:f,options:s})}async getData(i,f,s,r={}){const o=this,{reader:h,offset:v,diskNumberStart:m,extraFieldAES:y,extraFieldZip64:_,compressionMethod:p,config:b,bitFlag:T,signature:D,rawLastModDate:G,uncompressedSize:W,compressedSize:J}=o,{dataDescriptor:Z}=T,$=f.localDirectory={},I=await Ee(h,v,tl,m),B=ne(I);let it=Ne(o,r,Zm),X=Ne(o,r,Xm);const et=Ne(o,r,Vm);if(it=it&&it.length&&it,X=X&&X.length&&X,y&&y.originalCompressionMethod!=Oh)throw new Error(ih);if(p!=wh&&p!=Wr&&!et)throw new Error(ih);if(Pt(B,0)!=Rh)throw new Error(w_);$m($,B,4);const{extraFieldLength:ut,filenameLength:st,lastAccessDate:at,creationDate:_t}=$;$.rawExtraField=ut?await Ee(h,v+tl+st,ut,m):new Uint8Array,Pm(o,$,B,4,!0),Object.assign(f,{lastAccessDate:at,creationDate:_t});const pt=o.encrypted&&$.encrypted&&!et,yt=pt&&!y;if(et||(f.zipCrypto=yt),pt){if(!yt&&y.strength===At)throw new Error(D_);if(!it&&!X)throw new Error(R_)}const ot=v+tl+st+ut,N=J,V=h.readable;Object.assign(V,{diskNumberStart:m,offset:ot,size:N});const lt=Ne(o,r,Qm),rt=Ne(o,r,c_);let gt=Ne(o,r,f_);const E=Ne(o,r,s_);E&&(gt=!0);const{onstart:R,onprogress:k,onend:w}=r,U={options:{codecType:fm,password:it,rawPassword:X,zipCrypto:yt,encryptionStrength:y&&y.strength,signed:Ne(o,r,r_)&&!et,passwordVerification:yt&&(Z?G>>>8&255:D>>>24&255),outputSize:W,signature:D,compressed:p!=0&&!et,encrypted:o.encrypted&&!et,useWebWorkers:Ne(o,r,Fm),useCompressionStream:Ne(o,r,Km),transferStreams:Ne(o,r,o_),checkPasswordOnly:rt},config:b,streamOptions:{signal:lt,size:N,onstart:R,onprogress:k,onend:w}};gt&&await Y_({reader:h,fileEntry:f,offset:v,diskNumberStart:m,signature:D,compressedSize:J,uncompressedSize:W,dataOffset:ot,dataDescriptor:Z||$.bitFlag.dataDescriptor,extraFieldZip64:_||$.extraFieldZip64,readRanges:s});let L;try{if(!E){rt&&(i=new WritableStream),i=new oo(i),await ta(i,et?J:W),{writable:L}=i;const{outputSize:P}=await dm({readable:V,writable:L},U);if(i.size+=P,P!=(et?J:W))throw new Error(im)}}catch(P){if(P.outputSize!==At&&(i.size+=P.outputSize),!rt||P.message!=no)throw P}finally{!Ne(o,r,Jm)&&L&&!L.locked&&await L.getWriter().close()}return rt||E?At:i.getData?i.getData():L}}function $m(u,i,f){const s=u.rawBitFlag=Te(i,f+2),r=(s&Hr)==Hr,o=Pt(i,f+6);Object.assign(u,{encrypted:r,version:Te(i,f),bitFlag:{level:(s&qv)>>1,dataDescriptor:(s&jr)==jr,languageEncodingFlag:(s&Br)==Br},rawLastModDate:o,lastModDate:q_(o),filenameLength:Te(i,f+22),extraFieldLength:Te(i,f+24)})}function Pm(u,i,f,s,r){const{rawExtraField:o}=i,h=i.extraField=new Map,v=ne(new Uint8Array(o));let m=0;try{for(;m<o.length;){const J=Te(v,m),Z=Te(v,m+2);h.set(J,{type:J,data:o.slice(m+4,m+4+Z)}),m+=4+Z}}catch{}const y=Te(f,s+4);Object.assign(i,{signature:Pt(f,s+to),compressedSize:Pt(f,s+kl),uncompressedSize:Pt(f,s+Il)});const _=h.get(Ch);_&&(L_(_,i),i.extraFieldZip64=_);const p=h.get(Yv);p&&(fh(p,Am,xm,i,u),i.extraFieldUnicodePath=p);const b=h.get(Gv);b&&(fh(b,ho,wm,i,u),i.extraFieldUnicodeComment=b);const T=h.get(Lh);T?(H_(T,i,y),i.extraFieldAES=T):i.compressionMethod=y;const D=h.get(Hh);D&&(j_(D,i),i.extraFieldNTFS=D);const G=h.get(Pr);G&&(B_(G,i,r),i.extraFieldExtendedTimestamp=G);const W=h.get(Bh);W&&(i.extraFieldUSDZ=W)}function L_(u,i){i.zip64=!0;const f=ne(u.data),s=N_.filter(([r,o])=>i[r]==o);for(let r=0,o=0;r<s.length;r++){const[h,v]=s[r];if(i[h]==v){const m=M_[v];i[h]=u[h]=m.getValue(f,o),o+=m.bytes}else if(u[h])throw new Error(O_)}}function fh(u,i,f,s,r){const o=ne(u.data),h=new jc;h.append(r[f]);const v=ne(new Uint8Array(4));v.setUint32(0,h.get(),!0);const m=Pt(o,1);Object.assign(u,{version:Kl(o,0),[i]:Mc(u.data.subarray(5)),valid:!r.bitFlag.languageEncodingFlag&&m==Pt(v,0)}),u.valid&&(s[i]=u[i],s[i+"UTF8"]=!0)}function H_(u,i,f){const s=ne(u.data),r=Kl(s,4);Object.assign(u,{vendorVersion:Kl(s,0),vendorId:Kl(s,2),strength:r,originalCompressionMethod:f,compressionMethod:Te(s,5)}),i.compressionMethod=u.compressionMethod}function j_(u,i){const f=ne(u.data);let s=4,r;try{for(;s<u.data.length&&!r;){const o=Te(f,s),h=Te(f,s+2);o==jh&&(r=u.data.slice(s+4,s+4+h)),s+=4+h}}catch{}try{if(r&&r.length==24){const o=ne(r),h=o.getBigUint64(0,!0),v=o.getBigUint64(8,!0),m=o.getBigUint64(16,!0);Object.assign(u,{rawLastModDate:h,rawLastAccessDate:v,rawCreationDate:m});const y=wr(h),_=wr(v),p=wr(m),b={lastModDate:y,lastAccessDate:_,creationDate:p};Object.assign(u,b),Object.assign(i,b)}}catch{}}function B_(u,i,f){const s=ne(u.data),r=Kl(s,0),o=[],h=[];f?((r&1)==1&&(o.push(Gc),h.push(Fr)),(r&2)==2&&(o.push(yo),h.push(P4)),(r&4)==4&&(o.push(go),h.push(t_))):u.data.length>=5&&(o.push(Gc),h.push(Fr));let v=1;o.forEach((m,y)=>{if(u.data.length>=v+4){const _=Pt(s,v);i[m]=u[m]=new Date(_*1e3);const p=h[y];u[p]=_}v+=4})}async function Y_({reader:u,fileEntry:i,offset:f,diskNumberStart:s,signature:r,compressedSize:o,uncompressedSize:h,dataOffset:v,dataDescriptor:m,extraFieldZip64:y,readRanges:_}){let p=0;if(s)for(let D=0;D<s;D++){const G=u.readers[D];p+=G.size}let b=0;if(m&&(y?b=Uh:b=Mh),b){const D=await Ee(u,v+o,b+Hc,s);if(Pt(ne(D),0)==Dh){const W=Pt(ne(D),4);let J,Z;y?(J=Jl(ne(D),8),Z=Jl(ne(D),16)):(J=Pt(ne(D),8),Z=Pt(ne(D),12)),(i.encrypted&&!i.zipCrypto||W==r)&&J==o&&Z==h&&(b+=Hc)}}const T={start:p+f,end:p+v+o+b,fileEntry:i};for(const D of _)if(D.fileEntry!=i&&T.start>=D.start&&T.start<D.end){const G=new Error(z_);throw G.overlappingEntry=D.fileEntry,G}_.push(T)}async function G_(u,i,f,s,r){const o=new Uint8Array(4),h=ne(o);Z_(h,0,i);const v=s+r;return await m(s)||await m(Math.min(v,f));async function m(y){const _=f-y,p=await Ee(u,_,y);for(let b=p.length-s;b>=0;b--)if(p[b]==o[0]&&p[b+1]==o[1]&&p[b+2]==o[2]&&p[b+3]==o[3])return{offset:_+b,buffer:p.slice(b,b+s).buffer}}}function Ne(u,i,f){return i[f]===At?u.options[f]:i[f]}function q_(u){const i=(u&4294901760)>>16,f=u&65535;try{return new Date(1980+((i&65024)>>9),((i&480)>>5)-1,i&31,(f&63488)>>11,(f&2016)>>5,(f&31)*2,0)}catch{}}function wr(u){return new Date(Number(u/BigInt(1e4)-BigInt(116444736e5)))}function Kl(u,i){return u.getUint8(i)}function Te(u,i){return u.getUint16(i,!0)}function Pt(u,i){return u.getUint32(i,!0)}function Jl(u,i){return Number(u.getBigUint64(i,!0))}function Z_(u,i,f){u.setUint32(i,f,!0)}function ne(u){return new DataView(u.buffer)}const t3="File already exists",e3="Zip file comment exceeds 64KB",n3="File entry comment exceeds 64KB",a3="File entry name exceeds 64KB",Kr="Version exceeds 65535",l3="The strength must equal 1, 2, or 3",i3="Extra field type exceeds 65535",u3="Extra field data exceeds 64KB",Kc="Zip64 is not supported (make sure 'keepOrder' is set to 'true')",c3="Undefined uncompressed size",s3="Zip file not empty",rh=new Uint8Array([7,0,2,0,65,69,3,0,0]);let Or=0;const oh=[];class f3{constructor(i,f={}){i=new oo(i);const s=i.availableSize!==At&&i.availableSize>0&&i.availableSize!==1/0&&i.maxSize!==At&&i.maxSize>0&&i.maxSize!==1/0;Object.assign(this,{writer:i,addSplitZipSignature:s,options:f,config:eo(),files:new Map,filenames:new Set,offset:f[lh]===At?i.size||i.writable.size||0:f[lh],pendingEntriesSize:0,pendingAddFileCalls:new Set,bufferedWrites:0})}async prependZip(i){if(this.filenames.size)throw new Error(s3);i=new Fc(i);const f=new U_(i.readable),s=await f.getEntries();await f.close(),await i.readable.pipeTo(this.writer.writable,{preventClose:!0,preventAbort:!0}),this.writer.size=this.offset=i.size,this.filenames=new Set(s.map(r=>r.filename)),this.files=new Map(s.map(r=>{const{version:o,compressionMethod:h,lastModDate:v,lastAccessDate:m,creationDate:y,rawFilename:_,bitFlag:p,encrypted:b,uncompressedSize:T,compressedSize:D,diskOffset:G,diskNumber:W,zip64:J}=r;let{rawExtraFieldZip64:Z,rawExtraFieldAES:$,rawExtraFieldExtendedTimestamp:I,rawExtraFieldNTFS:B,rawExtraField:it}=r;const{level:X,languageEncodingFlag:et,dataDescriptor:ut}=p;Z=Z||new Uint8Array,$=$||new Uint8Array,I=I||new Uint8Array,B=B||new Uint8Array,it=it||new Uint8Array;const st=zt(Z,$,I,B,it),at=J&&T>ce,_t=J&&D>ce,{headerArray:pt,headerView:yt}=r3({version:o,bitFlag:o3(X,et,ut,b,h),compressionMethod:h,uncompressedSize:T,compressedSize:D,lastModDate:v,rawFilename:_,zip64CompressedSize:_t,zip64UncompressedSize:at,extraFieldLength:st});return Object.assign(r,{zip64UncompressedSize:at,zip64CompressedSize:_t,zip64Offset:J&&this.offset-G>ce,zip64DiskNumberStart:J&&W>le,rawExtraFieldZip64:Z,rawExtraFieldAES:$,rawExtraFieldExtendedTimestamp:I,rawExtraFieldNTFS:B,rawExtraField:it,extendedTimestamp:I.length>0||B.length>0,extraFieldExtendedTimestampFlag:1+(m?2:0)+(y?4:0),headerArray:pt,headerView:yt}),[r.filename,r]}))}async add(i="",f,s={}){const r=this,{pendingAddFileCalls:o,config:h}=r;Or<h.maxWorkers?Or++:await new Promise(m=>oh.push(m));let v;try{if(i=i.trim(),r.filenames.has(i))throw new Error(t3);return r.filenames.add(i),v=V_(r,i,f,s),o.add(v),await v}catch(m){throw r.filenames.delete(i),m}finally{o.delete(v);const m=oh.shift();m?m():Or--}}remove(i){const{filenames:f,files:s}=this;if(typeof i=="string"&&(i=s.get(i)),i&&i.filename!==At){const{filename:r}=i;if(f.has(r)&&s.has(r))return f.delete(r),s.delete(r),!0}return!1}async close(i=new Uint8Array,f={}){const s=this,{pendingAddFileCalls:r,writer:o}=this,{writable:h}=o;for(;r.size;)await Promise.allSettled(Array.from(r));return await $_(this,i,f),Ct(s,f,Jm)||await h.getWriter().close(),o.getData?o.getData():h}}class X_{constructor(i={}){const{readable:f,writable:s}=new TransformStream;this.readable=f,this.zipWriter=new f3(s,i)}transform(i){const{readable:f,writable:s}=new TransformStream({flush:()=>{this.zipWriter.close()}});return this.zipWriter.add(i,f),{readable:this.readable,writable:s}}writable(i){const{readable:f,writable:s}=new TransformStream;return this.zipWriter.add(i,f),s}close(i=void 0,f={}){return this.zipWriter.close(i,f)}}async function V_(u,i,f,s){i=i.trim();const r=Ct(u,s,Um),o=Ct(u,s,Hm,r?20:768),h=Ct(u,s,Bm);if(o>le)throw new Error(Kr);let v=Ct(u,s,Mm,0);v===0&&(v=Ct(u,s,Nm,0)),!s[Nc]&&i.endsWith(Wi)&&(s[Nc]=!0),Ct(u,s,Nc)?(i.endsWith(Wi)||(i+=Wi),v===0&&(v=Yr,r||(v|=(Yh|Gr|Sr)<<16))):!r&&v===0&&(h?v=(Gr|Sr)<<16:v=Sr<<16);const y=Ct(u,s,b_,Dc);let _=y(i);if(_===At&&(_=Dc(i)),zt(_)>le)throw new Error(a3);const p=s[ho]||"";let b=y(p);if(b===At&&(b=Dc(p)),zt(b)>le)throw new Error(n3);const T=Ct(u,s,Lm,Fv);if(T>le)throw new Error(Kr);const D=Ct(u,s,Gc,new Date),G=Ct(u,s,yo),W=Ct(u,s,go);let J=Ct(u,s,zm,0);J===0&&(J=Ct(u,s,Dm,0));const Z=Ct(u,s,Vm);let $,I;Z||($=Ct(u,s,Zm),I=Ct(u,s,Xm));const B=Ct(u,s,d_,3),it=Ct(u,s,jm),X=Ct(u,s,h_,!0),et=Ct(u,s,m_,!0),ut=Ct(u,s,y_),st=Ct(u,s,Fm),at=Ct(u,s,g_),_t=Ct(u,s,v_,!1),pt=Ct(u,s,Qm),yt=Ct(u,s,__,!0),ot=Ct(u,s,Km),N=Ct(u,s,Ym);let V=Ct(u,s,p_);at&&V===At&&(V=!1),(V===At||it)&&(V=!0);let lt=Ct(u,s,vo);if(!it&&($!==At||I!==At)&&!(B>=1&&B<=3))throw new Error(l3);let rt=new Uint8Array;const gt=s[qm];if(gt){let Be=0,qe=0;gt.forEach(Ce=>Be+=4+zt(Ce)),rt=new Uint8Array(Be),gt.forEach((Ce,Ae)=>{if(Ae>le)throw new Error(i3);if(zt(Ce)>le)throw new Error(u3);re(rt,new Uint16Array([Ae]),qe),re(rt,new Uint16Array([zt(Ce)]),qe+2),re(rt,Ce,qe+4),qe+=4+zt(Ce)})}let E=0,R=0,k=0;if(Z&&(k=s[mo],k===At))throw new Error(c3);const w=lt===!0;f&&(f=new Fc(f),await ta(f),Z?(s.uncompressedSize=k,E=hh(k)):f.size===At?(V=!0,(lt||lt===At)&&(lt=!0,k=E=ce+1)):(s.uncompressedSize=k=f.size,E=hh(k)));const{diskOffset:U,diskNumber:L,maxSize:P}=u.writer,H=w||k>ce,ht=w||E>ce,Yt=w||u.offset+u.pendingEntriesSize-U>ce,ae=Ct(u,s,km,!0)&&w||L+Math.ceil(u.pendingEntriesSize/P)>le;if(Yt||H||ht||ae){if(lt===!1||!et)throw new Error(Kc);lt=!0}lt=lt||!1;const oe=Ct(u,s,Cm);s=Object.assign({},s,{rawFilename:_,rawComment:b,version:T,versionMadeBy:o,lastModDate:D,lastAccessDate:G,creationDate:W,rawExtraField:rt,zip64:lt,zip64UncompressedSize:H,zip64CompressedSize:ht,zip64Offset:Yt,zip64DiskNumberStart:ae,password:$,rawPassword:I,level:!ot&&u.config.CompressionStream===At&&u.config.CompressionStreamNative===At?0:ut,useWebWorkers:st,encryptionStrength:B,extendedTimestamp:X,zipCrypto:it,bufferedWrite:at,keepOrder:et,useUnicodeFileNames:yt,dataDescriptor:V,dataDescriptorSignature:_t,signal:pt,msDosCompatible:r,internalFileAttribute:J,internalFileAttributes:J,externalFileAttribute:v,externalFileAttributes:v,useCompressionStream:ot,passThrough:Z,encrypted:!!($&&zt($)||I&&zt(I))||Z&&oe,signature:s[Gm],compressionMethod:N,uncompressedSize:k,offset:u.offset-U,diskNumberStart:L});const Jt=K_(s),Gt=k_(s),kt=zt(Jt.localHeaderArray,Gt.dataDescriptorArray);R=kt+E,u.options[Im]&&(R+=R+64),u.pendingEntriesSize+=R;let je;try{je=await Q_(u,i,f,{headerInfo:Jt,dataDescriptorInfo:Gt,metadataSize:kt},s)}finally{u.pendingEntriesSize-=R}return Object.assign(je,{name:i,comment:p,extraField:gt}),new qc(je)}async function Q_(u,i,f,s,r){const{files:o,writer:h}=u,{keepOrder:v,dataDescriptor:m,signal:y}=r,{headerInfo:_}=s,p=u.options[Im],b=Array.from(o.values()).pop();let T={},D,G,W,J,Z,$,I;o.set(i,T);try{let et;v&&(et=b&&b.lock,B()),(r.bufferedWrite||u.writerLocked||u.bufferedWrites&&v||!m)&&!p?($=new TransformStream,$.size=0,D=!0,u.bufferedWrites++,await ta(h)):($=h,await it()),await ta($);const{writable:ut,diskOffset:st}=h;if(u.addSplitZipSignature){delete u.addSplitZipSignature;const ot=new Uint8Array(4),N=Ue(ot);Dt(N,0,$r),await $n(h,ot),u.offset+=4}p&&J_(s,u.offset-st);const{localHeaderView:at,localHeaderArray:_t}=_;D||(await et,await X(ut));const{diskNumber:pt}=h;Z=!0,T.diskNumberStart=pt,D?I=new Response($.readable).blob():await $n($,_t),T=await F_(f,$,T,s,u.config,r);const{zip64:yt}=T;if(Z=!1,o.set(i,T),T.filename=i,D){const[ot]=await Promise.all([I,$.writable.getWriter().close(),et]);await it(),J=!0,T.diskNumberStart=h.diskNumber,T.offset=u.offset-h.diskOffset,yt&&dh(T),W_(T,at,r),await X(ut),await $n(h,_t),await ot.stream().pipeTo(ut,{preventClose:!0,preventAbort:!0,signal:y}),h.size+=$.size,J=!1}else T.offset=u.offset-st,yt&&dh(T);if(T.offset>ce&&!yt)throw new Error(Kc);return u.offset+=T.size,T}catch(et){if(D&&J||!D&&Z){if(u.hasCorruptedEntries=!0,et)try{et.corruptedEntry=!0}catch{}D?u.offset+=$.size:u.offset=$.size}throw o.delete(i),et}finally{D&&u.bufferedWrites--,W&&W(),G&&G()}function B(){T.lock=new Promise(et=>W=et)}async function it(){u.writerLocked=!0;const{lockWriter:et}=u;u.lockWriter=new Promise(ut=>G=()=>{u.writerLocked=!1,ut()}),await et}async function X(et){zt(_.localHeaderArray)>h.availableSize&&(h.availableSize=0,await $n(et,new Uint8Array))}}async function F_(u,i,{diskNumberStart:f,lock:s},r,o,h){const{headerInfo:v,dataDescriptorInfo:m,metadataSize:y}=r,{headerArray:_,headerView:p,lastModDate:b,rawLastModDate:T,encrypted:D,compressed:G,version:W,compressionMethod:J,rawExtraFieldZip64:Z,localExtraFieldZip64Length:$,rawExtraFieldExtendedTimestamp:I,extraFieldExtendedTimestampFlag:B,rawExtraFieldNTFS:it,rawExtraFieldAES:X}=v,{dataDescriptorArray:et}=m,{rawFilename:ut,lastAccessDate:st,creationDate:at,password:_t,rawPassword:pt,level:yt,zip64:ot,zip64UncompressedSize:N,zip64CompressedSize:V,zip64Offset:lt,zip64DiskNumberStart:rt,zipCrypto:gt,dataDescriptor:E,directory:R,executable:k,versionMadeBy:w,rawComment:U,rawExtraField:L,useWebWorkers:P,onstart:H,onprogress:ht,onend:Yt,signal:Ft,encryptionStrength:ae,extendedTimestamp:oe,msDosCompatible:Jt,internalFileAttributes:Gt,externalFileAttributes:kt,useCompressionStream:je,passThrough:Be}=h,qe={lock:s,versionMadeBy:w,zip64:ot,directory:!!R,executable:!!k,filenameUTF8:!0,rawFilename:ut,commentUTF8:!0,rawComment:U,rawExtraFieldZip64:Z,localExtraFieldZip64Length:$,rawExtraFieldExtendedTimestamp:I,rawExtraFieldNTFS:it,rawExtraFieldAES:X,rawExtraField:L,extendedTimestamp:oe,msDosCompatible:Jt,internalFileAttributes:Gt,externalFileAttributes:kt,diskNumberStart:f};let{signature:Ce,uncompressedSize:Ae}=h,wn=0;Be||(Ae=0);const{writable:nl}=i;if(u){u.chunkSize=qh(o);const xe=u.readable,al=u.size,ll={options:{codecType:sm,level:yt,rawPassword:pt,password:_t,encryptionStrength:ae,zipCrypto:D&&gt,passwordVerification:D&&gt&&T>>8&255,signed:!Be,compressed:G&&!Be,encrypted:D&&!Be,useWebWorkers:P,useCompressionStream:je,transferStreams:!1},config:o,streamOptions:{signal:Ft,size:al,onstart:H,onprogress:ht,onend:Yt}};try{const _e=await dm({readable:xe,writable:nl},ll);wn=_e.outputSize,i.size+=wn,Be||(Ae=_e.inputSize,Ce=_e.signature)}catch(_e){throw _e.outputSize!==At&&(i.size+=_e.outputSize),_e}}return I_({signature:Ce,compressedSize:wn,uncompressedSize:Ae,headerInfo:v,dataDescriptorInfo:m},h),E&&await $n(i,et),Object.assign(qe,{uncompressedSize:Ae,compressedSize:wn,lastModDate:b,rawLastModDate:T,creationDate:at,lastAccessDate:st,encrypted:D,zipCrypto:gt,size:y+wn,compressionMethod:J,version:W,headerArray:_,headerView:p,signature:Ce,extraFieldExtendedTimestampFlag:B,zip64UncompressedSize:N,zip64CompressedSize:V,zip64Offset:lt,zip64DiskNumberStart:rt}),qe}function K_(u){const{rawFilename:i,lastModDate:f,lastAccessDate:s,creationDate:r,level:o,zip64:h,zipCrypto:v,useUnicodeFileNames:m,dataDescriptor:y,directory:_,rawExtraField:p,encryptionStrength:b,extendedTimestamp:T,passThrough:D,encrypted:G,zip64UncompressedSize:W,zip64CompressedSize:J,zip64Offset:Z,zip64DiskNumberStart:$,uncompressedSize:I,offset:B,diskNumberStart:it}=u;let{version:X,compressionMethod:et}=u;const ut=!_&&(o>0||o===At&&et!==0);let st;const at=D||!ut,_t=h&&(u.bufferedWrite||!W&&!J||at);if(h){let U=4;W&&(U+=8),J&&(U+=8),Z&&(U+=8),$&&(U+=4),st=new Uint8Array(U);const L=Ue(st);if(Lt(L,0,Ch),Lt(L,2,zt(st)-4),_t){const P=Ue(st);let H=4;W&&(ve(P,H,BigInt(I)),H+=8),J&&at&&(ve(P,H,BigInt(I)),H+=8),Z&&(ve(P,H,BigInt(B)),H+=8),$&&(Dt(P,H,it),H+=4)}}else st=new Uint8Array;let pt;if(G&&!v){pt=new Uint8Array(zt(rh)+2);const U=Ue(pt);Lt(U,0,Lh),re(pt,rh,2),Jr(U,8,b)}else pt=new Uint8Array;let yt,ot,N;if(T){ot=new Uint8Array(9+(s?4:0)+(r?4:0));const U=Ue(ot);Lt(U,0,Pr),Lt(U,2,zt(ot)-4),N=1+(s?2:0)+(r?4:0),Jr(U,4,N);let L=5;Dt(U,L,Math.floor(f.getTime()/1e3)),L+=4,s&&(Dt(U,L,Math.floor(s.getTime()/1e3)),L+=4),r&&Dt(U,L,Math.floor(r.getTime()/1e3));try{yt=new Uint8Array(36);const P=Ue(yt),H=Rr(f);Lt(P,0,Hh),Lt(P,2,32),Lt(P,8,jh),Lt(P,10,24),ve(P,12,H),ve(P,20,Rr(s)||H),ve(P,28,Rr(r)||H)}catch{yt=new Uint8Array}}else yt=ot=new Uint8Array;et===At&&(et=ut?Wr:wh),h&&(X=X>Y1?X:Y1),G&&!v&&(X=X>G1?X:G1,pt[9]=et,et=Oh);const V=_t?zt(st):0,lt=V+zt(pt,ot,yt,p),{headerArray:rt,headerView:gt,rawLastModDate:E}=r3({version:X,bitFlag:o3(o,m,y,G,et),compressionMethod:et,uncompressedSize:I,lastModDate:f<Z1?Z1:f>q1?q1:f,rawFilename:i,zip64CompressedSize:J,zip64UncompressedSize:W,extraFieldLength:lt});let R=tl;const k=new Uint8Array(R+zt(i)+lt),w=Ue(k);return Dt(w,0,Rh),re(k,rt,4),re(k,i,R),R+=zt(i),_t&&re(k,st,R),R+=V,re(k,pt,R),R+=zt(pt),re(k,ot,R),R+=zt(ot),re(k,yt,R),R+=zt(yt),re(k,p,R),y&&(Dt(w,kl+4,0),Dt(w,Il+4,0)),{localHeaderArray:k,localHeaderView:w,headerArray:rt,headerView:gt,lastModDate:f,rawLastModDate:E,encrypted:G,compressed:ut,version:X,compressionMethod:et,extraFieldExtendedTimestampFlag:N,rawExtraFieldZip64:st,localExtraFieldZip64Length:V,rawExtraFieldExtendedTimestamp:ot,rawExtraFieldNTFS:yt,rawExtraFieldAES:pt,extraFieldLength:lt}}function J_(u,i){const{headerInfo:f}=u;let{localHeaderArray:s,extraFieldLength:r}=f,o=Ue(s),h=64-(i+zt(s))%64;h<4&&(h+=64);const v=new Uint8Array(h),m=Ue(v);Lt(m,0,Bh),Lt(m,2,h-2);const y=s;f.localHeaderArray=s=new Uint8Array(zt(y)+h),re(s,y),re(s,v,zt(y)),o=Ue(s),Lt(o,28,r+h),u.metadataSize+=h}function k_({zip64:u,dataDescriptor:i,dataDescriptorSignature:f}){let s=new Uint8Array,r,o=0,h=u?Uh:Mh;return f&&(h+=Hc),i&&(s=new Uint8Array(h),r=Ue(s),f&&(o=Hc,Dt(r,0,Dh))),{dataDescriptorArray:s,dataDescriptorView:r,dataDescriptorOffset:o}}function I_({signature:u,compressedSize:i,uncompressedSize:f,headerInfo:s,dataDescriptorInfo:r},{zip64:o,zipCrypto:h,dataDescriptor:v}){const{headerView:m,encrypted:y}=s,{dataDescriptorView:_,dataDescriptorOffset:p}=r;(!y||h)&&u!==At&&(Dt(m,to,u),v&&Dt(_,p,u)),o?v&&(ve(_,p+4,BigInt(i)),ve(_,p+12,BigInt(f))):(Dt(m,kl,i),Dt(m,Il,f),v&&(Dt(_,p+4,i),Dt(_,p+8,f)))}function W_({rawFilename:u,encrypted:i,zip64:f,localExtraFieldZip64Length:s,signature:r,compressedSize:o,uncompressedSize:h,offset:v,diskNumberStart:m,zip64UncompressedSize:y,zip64CompressedSize:_,zip64Offset:p,zip64DiskNumberStart:b},T,{dataDescriptor:D}){if(D||(i||Dt(T,to+4,r),f||(Dt(T,kl+4,o),Dt(T,Il+4,h))),f&&s){let G=tl+zt(u)+4;y&&(ve(T,G,BigInt(h)),G+=8),_&&(ve(T,G,BigInt(o)),G+=8),p&&(ve(T,G,BigInt(v)),G+=8),b&&Dt(T,G,m)}}function dh({compressedSize:u,uncompressedSize:i,offset:f,diskNumberStart:s,zip64UncompressedSize:r,zip64CompressedSize:o,zip64Offset:h,zip64DiskNumberStart:v,rawExtraFieldZip64:m}){const y=Ue(m);let _=4;r&&(ve(y,_,BigInt(i)),_+=8),o&&(ve(y,_,BigInt(u)),_+=8),h&&(ve(y,_,BigInt(f)),_+=8),v&&Dt(y,_,s)}async function $_(u,i,f){const{files:s,writer:r}=u,{diskOffset:o}=r;let{diskNumber:h}=r,v=0,m=0,y=u.offset-o,_=s.size;for(const[,I]of s){const{rawFilename:B,rawExtraFieldZip64:it,rawExtraFieldAES:X,rawComment:et,rawExtraFieldNTFS:ut,rawExtraField:st,extendedTimestamp:at,extraFieldExtendedTimestampFlag:_t,lastModDate:pt}=I;let yt;if(at){yt=new Uint8Array(9);const ot=Ue(yt);Lt(ot,0,Pr),Lt(ot,2,5),Jr(ot,4,_t),Dt(ot,5,Math.floor(pt.getTime()/1e3))}else yt=new Uint8Array;I.rawExtraFieldExtendedTimestamp=yt,m+=46+zt(B,et,it,X,ut,yt,st)}const p=new Uint8Array(m),b=Ue(p);await ta(r);let T=0;for(const[I,B]of Array.from(s.values()).entries()){const{offset:it,rawFilename:X,rawExtraFieldZip64:et,rawExtraFieldAES:ut,rawExtraFieldExtendedTimestamp:st,rawExtraFieldNTFS:at,rawExtraField:_t,rawComment:pt,versionMadeBy:yt,headerArray:ot,headerView:N,zip64:V,zip64UncompressedSize:lt,zip64CompressedSize:rt,zip64DiskNumberStart:gt,zip64Offset:E,internalFileAttributes:R,externalFileAttributes:k,diskNumberStart:w,uncompressedSize:U,compressedSize:L}=B,P=zt(et,ut,st,at,_t);Dt(b,v,Cr),Lt(b,v+4,yt),lt||Dt(N,Il,U),rt||Dt(N,kl,L),re(p,ot,v+6);let H=v+tl;if(Lt(b,H,P),H+=2,Lt(b,H,zt(pt)),H+=2,Lt(b,H,V&&gt?le:w),H+=2,Lt(b,H,R),H+=2,k&&Dt(b,H,k),H+=4,Dt(b,H,V&&E?ce:it),H+=4,re(p,X,H),H+=zt(X),re(p,et,H),H+=zt(et),re(p,ut,H),H+=zt(ut),re(p,st,H),H+=zt(st),re(p,at,H),H+=zt(at),re(p,_t,H),H+=zt(_t),re(p,pt,H),v-T>r.availableSize&&(r.availableSize=0,await $n(r,p.slice(T,v)),T=v),v=H,f.onprogress)try{await f.onprogress(I+1,s.size,new qc(B))}catch{}}await $n(r,T?p.slice(T):p);let D=r.diskNumber;const{availableSize:G}=r;G<vn&&D++;let W=Ct(u,f,vo);if(y>ce||m>ce||_>le||D>le){if(W===!1)throw new Error(Kc);W=!0}const J=new Uint8Array(W?Bv:vn),Z=Ue(J);v=0,W&&(Dt(Z,0,Lr),ve(Z,4,BigInt(44)),Lt(Z,12,45),Lt(Z,14,45),Dt(Z,16,D),Dt(Z,20,h),ve(Z,24,BigInt(_)),ve(Z,32,BigInt(_)),ve(Z,40,BigInt(m)),ve(Z,48,BigInt(y)),Dt(Z,56,Nh),ve(Z,64,BigInt(y)+BigInt(m)),Dt(Z,72,D+1),Ct(u,f,km,!0)&&(D=le,h=le),_=le,y=ce,m=ce,v+=Ii+ki),Dt(Z,v,zh),Lt(Z,v+4,D),Lt(Z,v+6,h),Lt(Z,v+8,_),Lt(Z,v+10,_),Dt(Z,v+12,m),Dt(Z,v+16,y);const $=zt(i);if($)if($<=le)Lt(Z,v+20,$);else throw new Error(e3);await $n(r,J),$&&await $n(r,i)}async function $n(u,i){const{writable:f}=u,s=f.getWriter();try{await s.ready,u.size+=zt(i),await s.write(i)}finally{s.releaseLock()}}function Rr(u){if(u)return(BigInt(u.getTime())+BigInt(116444736e5))*BigInt(1e4)}function Ct(u,i,f,s){const r=i[f]===At?u.options[f]:i[f];return r===At?s:r}function hh(u){return u+5*(Math.floor(u/16383)+1)}function Jr(u,i,f){u.setUint8(i,f)}function Lt(u,i,f){u.setUint16(i,f,!0)}function Dt(u,i,f){u.setUint32(i,f,!0)}function ve(u,i,f){u.setBigUint64(i,f,!0)}function re(u,i,f){u.set(i,f)}function Ue(u){return new DataView(u.buffer)}function zt(...u){let i=0;return u.forEach(f=>f&&(i+=f.length)),i}function r3({version:u,bitFlag:i,compressionMethod:f,uncompressedSize:s,compressedSize:r,lastModDate:o,rawFilename:h,zip64CompressedSize:v,zip64UncompressedSize:m,extraFieldLength:y}){const _=new Uint8Array(tl-4),p=Ue(_);Lt(p,0,u),Lt(p,2,i),Lt(p,4,f);const b=new Uint32Array(1),T=Ue(b);Lt(T,0,(o.getHours()<<6|o.getMinutes())<<5|o.getSeconds()/2),Lt(T,2,(o.getFullYear()-1980<<4|o.getMonth()+1)<<5|o.getDate());const D=b[0];return Dt(p,6,D),(v||r!==At)&&Dt(p,kl,v?ce:r),(m||s!==At)&&Dt(p,Il,m?ce:s),Lt(p,22,zt(h)),Lt(p,24,y),{headerArray:_,headerView:p,rawLastModDate:D}}function o3(u,i,f,s,r){let o=0;return i&&(o=o|Br),f&&(o=o|jr),(r==Wr||r==jv)&&(u>=0&&u<=3&&(o=o|Vv),u>3&&u<=5&&(o=o|Xv),u==9&&(o=o|Zv)),s&&(o=o|Hr),o}Zh({Deflate:Lv});const P_=Object.freeze(Object.defineProperty({__proto__:null,BlobReader:so,BlobWriter:vm,Data64URIReader:q4,Data64URIWriter:Z4,ERR_DUPLICATED_NAME:t3,ERR_HTTP_RANGE:iu,ERR_INVALID_COMMENT:e3,ERR_INVALID_ENCRYPTION_STRENGTH:l3,ERR_INVALID_ENTRY_COMMENT:n3,ERR_INVALID_ENTRY_NAME:a3,ERR_INVALID_EXTRAFIELD_DATA:u3,ERR_INVALID_EXTRAFIELD_TYPE:i3,ERR_INVALID_VERSION:Kr,ERR_ITERATOR_COMPLETED_TOO_SOON:mm,ERR_UNDEFINED_UNCOMPRESSED_SIZE:c3,ERR_UNSUPPORTED_FORMAT:Kc,ERR_WRITER_NOT_INITIALIZED:ym,ERR_ZIP_NOT_EMPTY:s3,GenericReader:Fc,GenericWriter:oo,HttpRangeReader:K4,HttpReader:Tm,Reader:Ma,SplitDataReader:ro,SplitDataWriter:Yc,SplitZipReader:W4,SplitZipWriter:$4,TextReader:X4,TextWriter:V4,Uint8ArrayReader:J4,Uint8ArrayWriter:k4,Writer:co,ZipWriter:f3,ZipWriterStream:X_,configure:Zh,getMimeType:kv,initStream:ta,readUint8Array:Ee,terminateWorkers:M4},Symbol.toStringTag,{value:"Module"})),Vl=P_;async function tp(u,i){Vl.configure({useWebWorkers:!1});const f=new Vl.ZipWriter(new Vl.BlobWriter("application/zip")),s=[];i&&s.push(i,"");for(let r=0;r<u.length;r++){const o=r+1,h=u[r],v=h.sessionTitle||"session",m=h.title||"tab",y=`screenshot ${o}: ${v} / ${m} @ ${h.url} (${h.viewportWidth}x${h.viewportHeight})`;if(s.push(`## ${y}`),h.data){const _=`annotations-${o}.png`;await f.add(_,new Vl.Uint8ArrayReader(Uint8Array.fromBase64(h.data))),s.push(`- [Screenshot ${o}](${_})`)}if(h.ariaSnapshot){const _=`annotations-${o}.yaml`,b=[...h.annotations.map(T=>`# { x: ${T.x}, y: ${T.y}, width: ${T.width}, height: ${T.height} }: ${T.text}`),h.ariaSnapshot].join(`
`);await f.add(_,new Vl.TextReader(b)),s.push(`- [Aria snapshot ${o}](${_})`)}for(const _ of h.annotations)_.text&&s.push(`- { x: ${_.x}, y: ${_.y}, width: ${_.width}, height: ${_.height} }: ${_.text}`);s.push("")}return await f.add("feedback.md",new Vl.TextReader(s.join(`
`))),f.close()}const ep={sessions:[],clientInfo:void 0,loadingSessions:!0,tabs:null,liveFrame:void 0,annotateSession:null,pendingCapture:!1,mode:"readonly",recording:null};class np{constructor(i){this.state=ep,this._listeners=new Set,this._requestId=0,this._client=i,i.on("sessions",f=>this._emit({sessions:f.sessions,clientInfo:f.clientInfo,loadingSessions:!1})),i.on("tabs",f=>this._emit({tabs:f.tabs})),i.on("frame",f=>this._emit({liveFrame:f})),i.on("annotate",()=>this.enterAnnotate("cli")),i.on("cancelAnnotate",()=>this.cancelAnnotate(!1))}subscribe(i){return this._listeners.add(i),()=>{this._listeners.delete(i)}}sessionByGuid(i){return this.state.sessions.find(f=>f.browser.guid===i)}closeSession(i){this._client.closeSession({browser:i.browser.guid})}setVisible(i){this._client.setVisible({visible:i})}selectTab(i){this._client.selectTab({browser:i.browser,context:i.context,page:i.page})}closeTab(i){this._client.closeTab({browser:i.browser,context:i.context,page:i.page})}newTab(i,f){this._client.newTab({browser:i,context:f})}navigate(i){this._client.navigate({url:i})}back(){this._client.back()}forward(){this._client.forward()}reload(){this._client.reload()}mousemove(i,f){this._client.mousemove({x:i,y:f})}mousedown(i,f,s){this._client.mousedown({x:i,y:f,button:s})}mouseup(i,f,s){this._client.mouseup({x:i,y:f,button:s})}wheel(i,f){this._client.wheel({deltaX:i,deltaY:f})}keydown(i){this._client.keydown({key:i})}keyup(i){this._client.keyup({key:i})}toggleInteractive(){const i=this.state.mode==="interactive"?"readonly":"interactive";i==="interactive"?this._enterInteractive():this._emit({mode:i})}enterInteractive(){this._enterInteractive()}enterAnnotate(i){this._enterAnnotate(i)}addAnnotateFrame(){this._addAnnotateFrame()}selectAnnotateFrame(i,f){const s=this.state.annotateSession;!s||!s.frames.find(r=>r.id===i)||this._emit({annotateSession:{...s,selectedFrameId:i,focusAnnotationId:f??null},mode:"annotate"})}toggleSelectFrame(i){const f=this.state.annotateSession;f&&(f.selectedFrameId===i?this._emit({annotateSession:{...f,selectedFrameId:null,focusAnnotationId:null},mode:"readonly"}):this.selectAnnotateFrame(i))}deselectFrame(){const i=this.state.annotateSession;!i||i.selectedFrameId===null||this._emit({annotateSession:{...i,selectedFrameId:null,focusAnnotationId:null},mode:"readonly"})}removeAnnotateFrame(i){const f=this.state.annotateSession;if(!f)return;const s=f.frames.filter(o=>o.id!==i);if(s.length===0){this.cancelAnnotate();return}const r=f.selectedFrameId===i?null:f.selectedFrameId;this._emit({annotateSession:{...f,frames:s,selectedFrameId:r}})}updateFrameAnnotations(i,f){const s=this.state.annotateSession;if(!s)return;const r=s.frames.map(o=>o.id===i?{...o,annotations:f}:o);this._emit({annotateSession:{...s,frames:r}})}updateFeedback(i){const f=this.state.annotateSession;f&&this._emit({annotateSession:{...f,feedback:i}})}completeAnnotation(){this._completeAnnotation()}startRecording(){this._startRecording()}stopRecording(){this._stopRecording()}discardRecording(){this._discardRecording()}cancelAnnotate(i=!0){var s;this._requestId++;const f=this.state;i&&((s=f.annotateSession)==null?void 0:s.initiator)==="cli"&&this._client.cancelAnnotation(),this._emit({mode:f.mode==="annotate"?"readonly":f.mode,annotateSession:null,pendingCapture:!1})}async submitAnnotateSession(){const i=this.state.annotateSession;if(!i)return;const f=[];for(const s of i.frames){const r=await ap(s);f.push({data:r??s.data,ariaSnapshot:s.ariaSnapshot,annotations:s.annotations.map(o=>({x:o.x,y:o.y,width:o.width,height:o.height,text:o.text})),sessionTitle:s.sessionTitle,title:s.title,url:s.url,viewportWidth:s.viewportWidth,viewportHeight:s.viewportHeight})}if(i.initiator==="cli")await this._client.submitAnnotation({frames:f,feedback:i.feedback});else{const s=await tp(f,i.feedback),r=new Date().toISOString().replace(/[:.]/g,"-");if(!await bh(s,`annotations-${r}.zip`))return}this.cancelAnnotate()}async _enterInteractive(){var f;const i=this.state;this._emit({mode:"interactive",annotateSession:(f=i.annotateSession)!=null&&f.selectedFrameId?{...i.annotateSession,selectedFrameId:null,focusAnnotationId:null}:i.annotateSession})}async _enterAnnotate(i){const f=this.state;if(f.annotateSession){i==="cli"&&f.annotateSession.initiator!=="cli"&&this._emit({annotateSession:{...f.annotateSession,initiator:"cli"}}),await this._addAnnotateFrame();return}await this._discardRecording(),await this._addAnnotateFrame(i)}async _addAnnotateFrame(i){var y,_;if(this.state.pendingCapture)return;const f=++this._requestId;this._emit({pendingCapture:!0});let s;try{s=await this._client.screenshot()}catch{}if(f!==this._requestId)return;if(!s){this._emit({pendingCapture:!1});return}const r=(y=this.state.tabs)==null?void 0:y.find(p=>p.selected),o=((_=this.state.sessions.find(p=>p.browser.guid===(r==null?void 0:r.browser)))==null?void 0:_.title)??"",h={id:"frm-"+Math.random().toString(36).slice(2,10),data:s.data,viewportWidth:s.viewportWidth,viewportHeight:s.viewportHeight,ariaSnapshot:s.ariaSnapshot,sessionTitle:o,title:(r==null?void 0:r.title)??"",url:(r==null?void 0:r.url)??"",annotations:[]},v=this.state.annotateSession,m=v?{...v,frames:[...v.frames,h],selectedFrameId:h.id,focusAnnotationId:null}:{initiator:i??"user",frames:[h],selectedFrameId:h.id,focusAnnotationId:null,feedback:""};this._emit({annotateSession:m,pendingCapture:!1,mode:"annotate"})}async _completeAnnotation(){var f;((f=this.state.annotateSession)==null?void 0:f.initiator)==="cli"?await this.submitAnnotateSession().catch(()=>{}):this.cancelAnnotate()}async _startRecording(){this.state.annotateSession&&this.cancelAnnotate(),await this._client.startRecording(),this._emit({recording:{phase:"recording"}})}async _stopRecording(){const{streamId:i}=await this._client.stopRecording(),f=[];for(;;){const{data:o,eof:h}=await this._client.readStream({streamId:i});if(o&&f.push(lp(o,"video/webm")),h)break}const s=new Blob(f,{type:"video/webm"}),r=URL.createObjectURL(s);this._emit({recording:{phase:"stopped",blob:s,blobUrl:r}})}async _discardRecording(){var f,s;const i=this.state;if(((f=i.recording)==null?void 0:f.phase)==="recording")try{const{streamId:r}=await this._client.stopRecording();for(;;){const{eof:o}=await this._client.readStream({streamId:r});if(o)break}}catch{}((s=i.recording)==null?void 0:s.phase)==="stopped"&&URL.revokeObjectURL(i.recording.blobUrl),this._emit({recording:null})}_emit(i){this.state={...this.state,...i};for(const f of this._listeners)f()}}async function ap(u){const i=new Image;i.src="data:image/png;base64,"+u.data;try{await i.decode()}catch{return}const f=await ph(i,u.viewportWidth,u.viewportHeight,u.annotations);if(!f)return;const s=await f.arrayBuffer();return new Uint8Array(s).toBase64()}function lp(u,i){return new Blob([Uint8Array.fromBase64(u)],{type:i})}class ip{constructor(i){this._lastId=0,this._pending=new Map,this._sendQueue=[],this._closed=!1,this._ws=new WebSocket(i),this._ws.onopen=()=>{for(const f of this._sendQueue||[])this._ws.send(f);this._sendQueue=void 0,this.onopen&&this.onopen()},this._ws.onmessage=f=>{let s;try{s=JSON.parse(f.data)}catch{this._ws.close();return}if(s.id!==void 0){const r=this._pending.get(s.id);r&&(this._pending.delete(s.id),s.error?r.reject(new Error(s.error)):r.resolve(s.result))}else s.method&&this.onevent&&this.onevent(s.method,s.params)},this._ws.onclose=f=>{this._closed=!0,this._sendQueue=void 0;for(const{reject:s}of this._pending.values())s(new Error("Connection closed"));this._pending.clear(),this.onclose&&this.onclose(f.reason)},this._ws.onerror=()=>{}}sendNoReply(i,f){this.send(i,f).catch(()=>{})}send(i,f){if(this._closed)return Promise.reject(new Error("Connection closed"));const s=++this._lastId,r=JSON.stringify({id:s,method:i,params:f});return this._sendQueue?this._sendQueue.push(r):this._ws.send(r),new Promise((o,h)=>{this._pending.set(s,{resolve:o,reject:h})})}close(){this._ws.close()}}class _o{constructor(i){this._listeners=new Map,this._transport=i,this._transport.onopen=()=>{var f;(f=this.onopen)==null||f.call(this)},this._transport.onevent=(f,s)=>{this._fireEvent(f,s)},this._transport.onclose=f=>{var s;(s=this.onclose)==null||s.call(this,f)}}static create(i){const f=new ip(i),s=new _o(f);return new Proxy(s,{get(r,o,h){if(typeof o=="symbol"||o in r)return Reflect.get(r,o,h);if(o!=="then")return v=>r._transport.send(o,v)}})}_fireEvent(i,f){const s=this._listeners.get(i);if(s)for(const r of s)r(f)}on(i,f){let s=this._listeners.get(i);s||(s=new Set,this._listeners.set(i,s)),s.add(f)}off(i,f){var s;(s=this._listeners.get(i))==null||s.delete(f)}close(){this._transport.close()}}const up=()=>{const[u,i]=mt.useState(!1),[f,s]=Qg(),r=mt.useRef(null);return mt.useEffect(()=>{if(!u)return;const o=v=>{r.current&&!r.current.contains(v.target)&&i(!1)},h=v=>{v.key==="Escape"&&i(!1)};return document.addEventListener("mousedown",o),document.addEventListener("keydown",h),()=>{document.removeEventListener("mousedown",o),document.removeEventListener("keydown",h)}},[u]),O.jsxs("div",{ref:r,className:"settings-button-container",children:[O.jsx(ln,{className:"settings-gear-btn",title:"Settings",toggled:u,onClick:()=>i(!u),children:O.jsx(iv,{})}),u&&O.jsx("div",{className:"settings-popup",children:O.jsxs("div",{className:"setting-row",children:[O.jsx("span",{className:"setting-label",children:"Theme"}),O.jsx("div",{className:"setting-options",children:qg.map(o=>O.jsx("div",{className:"setting-option"+(f===o.value?" selected":""),onClick:()=>{s(o.value),i(!1)},children:o.label},o.value))})]})})]})},mh=new Map;function cp({name:u,items:i=[],id:f,render:s,icon:r,isError:o,isWarning:h,isInfo:v,selectedItem:m,onAccepted:y,onSelected:_,onHighlighted:p,onIconClicked:b,noItemsMessage:T,dataTestId:D,notSelectable:G,ariaLabel:W}){const J=Wn.useRef(null),[Z,$]=Wn.useState();return Wn.useEffect(()=>{p==null||p(Z)},[p,Z]),Wn.useEffect(()=>{const I=J.current;if(!I)return;const B=()=>{mh.set(u,I.scrollTop)};return I.addEventListener("scroll",B,{passive:!0}),()=>I.removeEventListener("scroll",B)},[u]),Wn.useEffect(()=>{J.current&&(J.current.scrollTop=mh.get(u)||0)},[u]),O.jsx("div",{className:Ji("list-view vbox",u+"-list-view"),role:i.length>0?"listbox":void 0,"aria-label":W,children:O.jsxs("div",{className:Ji("list-view-content",G&&"not-selectable"),tabIndex:0,onKeyDown:I=>{var et;if(m&&I.key==="Enter"){y==null||y(m,i.indexOf(m));return}if(I.key!=="ArrowDown"&&I.key!=="ArrowUp")return;I.stopPropagation(),I.preventDefault();const B=m?i.indexOf(m):-1;let it=B;I.key==="ArrowDown"&&(B===-1?it=0:it=Math.min(B+1,i.length-1)),I.key==="ArrowUp"&&(B===-1?it=i.length-1:it=Math.max(B-1,0));const X=(et=J.current)==null?void 0:et.children.item(it);Yg(X||void 0),p==null||p(void 0),_==null||_(i[it],it),$(void 0)},ref:J,children:[T&&i.length===0&&O.jsx("div",{className:"list-view-empty",children:T}),i.map((I,B)=>{const it=s(I,B);return O.jsxs("div",{onDoubleClick:()=>y==null?void 0:y(I,B),role:"option",className:Ji("list-view-entry",m===I&&"selected",!G&&Z===I&&"highlighted",(o==null?void 0:o(I,B))&&"error",(h==null?void 0:h(I,B))&&"warning",(v==null?void 0:v(I,B))&&"info"),"aria-selected":m===I,onClick:()=>_==null?void 0:_(I,B),onMouseEnter:()=>$(I),onMouseLeave:()=>$(void 0),children:[r&&O.jsx("div",{className:"codicon "+(r(I,B)||"codicon-blank"),style:{minWidth:16,marginRight:4},onDoubleClick:X=>{X.preventDefault(),X.stopPropagation()},onClick:X=>{X.stopPropagation(),X.preventDefault(),b==null||b(I,B)}}),typeof it=="string"?O.jsx("div",{style:{textOverflow:"ellipsis",overflow:"hidden"},children:it}):it]},(f==null?void 0:f(I,B))||B)})]})})}const sp=cp;function fp(u){try{const f=new URL(u).hostname.replace(/^www\./,"");return f?f[0].toUpperCase():""}catch{return""}}function rp(u,i){if(!u||u==="Global")return u;let f=u;if(!u.startsWith("/")&&!u.startsWith("\\\\")&&!/^[A-Za-z]:[\\/]/.test(u)&&u.includes("/")&&(f="/"+u),i){if(f===i)return"~";if(f.startsWith(i+"/")||f.startsWith(i+"\\"))return"~"+f.slice(i.length)}return f}const op=({tab:u,model:i})=>O.jsxs(O.Fragment,{children:[u.faviconUrl?O.jsx("img",{className:"sidebar-tab-favicon",src:u.faviconUrl,alt:"","aria-hidden":"true"}):O.jsx("span",{className:"sidebar-tab-favicon placeholder","aria-hidden":"true",children:fp(u.url)}),O.jsxs("span",{className:"sidebar-tab-text",children:[O.jsx("span",{className:"sidebar-tab-title",children:u.title||"New Tab"}),O.jsx("span",{className:"sidebar-tab-url",children:u.url||"about:blank"})]}),O.jsx(ln,{className:"sidebar-tab-close",icon:"close",title:"Close tab",onClick:f=>{f.stopPropagation(),i.closeTab(u)}})]}),dp=({model:u})=>{const{sessions:i,clientInfo:f,loadingSessions:s,tabs:r}=u.state,o=i,h=mt.useMemo(()=>{const y=new Map;for(const _ of r??[]){let p=y.get(_.browser);p||(p=new Map,y.set(_.browser,p));let b=p.get(_.context);b||(b=[],p.set(_.context,b)),b.push(_)}return y},[r]),v=mt.useMemo(()=>{var y;return(y=r==null?void 0:r.find(_=>_.selected))==null?void 0:y.context},[r]),m=mt.useMemo(()=>{const y=new Map;for(const D of o){const G=D.workspaceDir||"Global";let W=y.get(G);W||(W=[],y.set(G,W)),W.push(D)}for(const D of y.values())D.sort((G,W)=>G.title.localeCompare(W.title));const _=(f==null?void 0:f.workspaceDir)||"Global",p=[...y.entries()],b=p.filter(([D])=>D===_),T=p.filter(([D])=>D!==_).sort((D,G)=>D[0].localeCompare(G[0]));return[...b,...T]},[o,f==null?void 0:f.workspaceDir]);return O.jsxs("nav",{className:"dashboard-shell-sidebar","aria-label":"Sessions",children:[O.jsxs("div",{className:"dashboard-shell-sidebar-header",children:[O.jsx("h2",{className:"dashboard-shell-sidebar-title",children:"Sessions"}),O.jsx(up,{})]}),O.jsxs("div",{className:"dashboard-shell-sidebar-content",children:[s&&O.jsx("p",{className:"sidebar-empty",role:"status","aria-live":"polite",children:"Loading sessions..."}),!s&&o.length===0&&O.jsx("p",{className:"sidebar-empty",role:"status","aria-live":"polite",children:"No open sessions."}),m.map(([y,_])=>{const p=rp(y,f==null?void 0:f.homeDir);return O.jsxs("section",{className:"workspace-group","aria-label":`Workspace ${p}`,children:[O.jsx("h3",{className:"workspace-header",children:O.jsx("span",{className:"workspace-path-full",title:p,children:p})}),_.map(b=>{var $;const T=b.browser.guid,D=b.browser.browserName,G=($=b.browser.launchOptions)==null?void 0:$.channel,W=h.get(T),J=W?[...W.entries()]:[];return(r===null?[{contextGuid:null,tabs:void 0}]:J.length===0?[{contextGuid:null,tabs:[]}]:J.map(([I,B])=>({contextGuid:I,tabs:B}))).map((I,B)=>{var et;const it=(et=I.tabs)==null?void 0:et.find(ut=>ut.context===v&&ut.selected),X=`${T}-${I.contextGuid??`placeholder-${B}`}`;return O.jsxs("section",{className:"sidebar-session session-chip"+(it?" active":""),"aria-label":`Session ${b.title}`,children:[O.jsxs("header",{className:"sidebar-session-row",children:[O.jsxs("div",{className:"session-browser-icon-wrap",title:G||D,children:[O.jsx("span",{className:"session-browser-icon","aria-hidden":"true",children:O.jsx($g,{browserName:D,channel:G})}),O.jsx(ln,{className:"session-browser-close",icon:"close",title:"Close session",onClick:()=>u.closeSession(b)})]}),O.jsx("span",{className:"session-chip-name",children:b.title}),O.jsx("div",{className:"sidebar-session-row-actions",children:I.contextGuid&&O.jsx(ln,{className:"sidebar-session-new-tab",icon:"add",title:"New tab",onClick:()=>u.newTab(T,I.contextGuid)})})]}),I.tabs===void 0?O.jsx("p",{className:"sidebar-tabs-loading",role:"status","aria-live":"polite",children:"Loading tabs..."}):O.jsx(sp,{name:`sidebar-tabs-${X}`,ariaLabel:`${b.title} tabs`,items:I.tabs,id:ut=>ut.page,selectedItem:it,onSelected:ut=>u.selectTab(ut),noItemsMessage:"No tabs open.",render:ut=>O.jsx(op,{tab:ut,model:u})})]},X)})})]},y)})]})]})},hp=50,mp=({sidebarSize:u,sidebarHidden:i=!1,sidebarIsFirst:f=!1,orientation:s="vertical",minSidebarSize:r=hp,settingName:o,sidebar:h,main:v})=>{const m=Math.max(r,u)*window.devicePixelRatio,[y,_]=x1(o?o+"."+s+":size":void 0,m),[p,b]=x1(o?o+"."+s+":size":void 0,m),[T,D]=Wn.useState(null),[G,W]=jg();let J;s==="vertical"?(J=p/window.devicePixelRatio,G&&G.height<J&&(J=G.height-10)):(J=y/window.devicePixelRatio,G&&G.width<J&&(J=G.width-10)),document.body.style.userSelect=T?"none":"inherit";let Z={};return s==="vertical"?f?Z={top:T?0:J-4,bottom:T?0:void 0,height:T?"initial":8}:Z={bottom:T?0:J-4,top:T?0:void 0,height:T?"initial":8}:f?Z={left:T?0:J-4,right:T?0:void 0,width:T?"initial":8}:Z={right:T?0:J-4,left:T?0:void 0,width:T?"initial":8},O.jsxs("div",{className:Ji("split-view",s,f&&"sidebar-first"),ref:W,children:[O.jsx("div",{className:"split-view-main",children:v}),!i&&O.jsx("div",{style:{flexBasis:J},className:"split-view-sidebar",children:h}),!i&&O.jsx("div",{style:Z,className:"split-view-resizer",onMouseDown:$=>D({offset:s==="vertical"?$.clientY:$.clientX,size:J}),onMouseUp:()=>D(null),onMouseMove:$=>{if(!$.buttons)D(null);else if(T){const B=(s==="vertical"?$.clientY:$.clientX)-T.offset,it=f?T.size+B:T.size-B,et=$.target.parentElement.getBoundingClientRect(),ut=Math.min(Math.max(r,it),(s==="vertical"?et.height:et.width)-r);s==="vertical"?b(ut*window.devicePixelRatio):_(ut*window.devicePixelRatio)}}})]})};Zg();const yp=new URLSearchParams(location.search).get("ws")??"",gp=_o.create("/"+yp),Uc=new np(gp),d3=()=>Uc.setVisible(!document.hidden);document.addEventListener("visibilitychange",d3);document.hidden&&d3();const vp=()=>{const[,u]=mt.useState(0);return mt.useEffect(()=>Uc.subscribe(()=>u(i=>i+1)),[]),O.jsx(mp,{orientation:"horizontal",sidebarIsFirst:!0,sidebarSize:320,minSidebarSize:220,settingName:"dashboardSessionSidebar",sidebar:O.jsx(dp,{model:Uc}),main:O.jsx("div",{className:"dashboard-shell-main",children:O.jsx(_v,{model:Uc})})})},xc=document.querySelector("#root"),_p=xc.__dashboardRoot??(xc.__dashboardRoot=Hg.createRoot(xc));_p.render(O.jsx(vp,{}));
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="194.5 190.1 135.1 135.1"><style>.b{color-interpolation-filters:srgb}.c{flood-opacity:.31}</style><defs><linearGradient id="a" x1="132.55" x2="134.37" y1="111.67" y2="-105.3" xlink:href="#b"><stop offset="0" stop-color="#d2d2d2"/><stop offset=".53" stop-color="#f2f2f2"/><stop offset="1" stop-color="#fff"/></linearGradient><linearGradient id="b" gradientUnits="userSpaceOnUse"/><linearGradient id="c" x1="65.44" x2="67.4" y1="115.72" y2="17.14" xlink:href="#b"><stop offset="0" stop-color="#005ad5"/><stop offset=".16" stop-color="#0875f0"/><stop offset=".31" stop-color="#218cee"/><stop offset=".63" stop-color="#27a5f3"/><stop offset=".81" stop-color="#25aaf2"/><stop offset="1" stop-color="#21aaef"/></linearGradient><linearGradient id="d" x1="158.7" x2="176.28" y1="96.71" y2="79.53" xlink:href="#b"><stop offset="0" stop-color="#c72e24"/><stop offset="1" stop-color="#fd3b2f"/></linearGradient><filter id="e" class="b"><feFlood flood-opacity=".28"/><feComposite in2="SourceGraphic" operator="in"/><feGaussianBlur stdDeviation="3"/><feOffset dx=".3" dy="2.8"/><feComposite in="SourceGraphic"/></filter><filter id="f" class="b"><feFlood class="c"/><feComposite class="c" in2="SourceGraphic" operator="out"/><feGaussianBlur flood-opacity=".3" stdDeviation=".7"/><feOffset dy="1.8"/><feComposite in2="SourceGraphic" operator="atop"/></filter><filter id="g" class="b"><feFlood flood-opacity=".61"/><feComposite in2="SourceGraphic" operator="in"/><feGaussianBlur stdDeviation=".5"/><feOffset dx=".8" dy=".8"/><feComposite in="SourceGraphic" result="A"/><feColorMatrix values="0 0 0 -1 0 0 0 0 -1 0 0 0 0 -1 0 0 0 0 1 0"/><feFlood flood-opacity=".4"/><feComposite in2="A" operator="in"/><feGaussianBlur stdDeviation="3.8"/><feOffset dx="2.3" dy="3.3"/><feComposite in="A"/></filter><filter id="h" width="110%" height="110%" x="-1%" y="-1%"><feGaussianBlur in="SourceAlpha" stdDeviation=".4"/><feOffset dx=".1" dy=".2"/><feComponentTransfer result="A"><feFuncA type="linear"/></feComponentTransfer><feFlood flood-color="rgba(0,0,0,0.5)"/><feComposite in2="A" operator="in"/><feMerge><feMergeNode/><feMergeNode in="SourceGraphic"/></feMerge></filter><radialGradient id="i" cx="-69.88" cy="69.29" r="54.01" gradientTransform="matrix(.9023 -.01249 .0377 2.7234 -9.44 -120.29)" xlink:href="#b"><stop offset="0" stop-color="#24a5f3" stop-opacity=".01"/><stop offset="1" stop-color="#1e8ceb" stop-opacity=".98"/></radialGradient><radialGradient id="j" cx="109.35" cy="13.76" r="93.08" gradientTransform="matrix(-.01822 1.0922 -1.042 -.01765 136.95 -115.33)" xlink:href="#b"><stop offset="0" stop-opacity="0"/><stop offset=".96" stop-color="#5488d6" stop-opacity="0"/><stop offset="1" stop-color="#5d96eb"/></radialGradient></defs><rect width="220" height="220" x="22" y="-106.53" fill="url(#a)" filter="url(#e)" ry="49" transform="matrix(.56938 0 0 .56921 186.86 255.75)"/><g filter="url(#f)" transform="translate(194.2 190.07)"><ellipse cx="67.77" cy="67.73" fill="url(#c)" paint-order="stroke fill markers" rx="54.01" ry="53.98"/><ellipse cx="-69.88" cy="69.29" fill="url(#i)" rx="54.01" ry="53.98" transform="translate(137.65 -1.55)"/></g><ellipse cx="120" cy="14.15" fill="url(#j)" rx="93.08" ry="93.67" transform="matrix(.58082 0 0 .57636 192.3 249.63)"/><g filter="url(#g)" transform="matrix(.58289 0 0 .56508 196.8 181.63)"><path fill="#cac7c8" d="m46 191.66.73.35 72.18-48.2-7.34-8.95L46 191.66Z"/><path fill="#fbfffc" d="m45.8 190.87.2.8 65.57-56.8-6.95-8.92-58.83 64.92Z"/><path fill="url(#d)" d="m118.91 143.81-7.35-8.95 66.08-57.2.27.73-59 65.42Z"/><path fill="#fb645c" d="m104.62 125.95 6.94 8.92 66.08-57.2-.65-.35-72.37 48.63Z"/></g><path stroke="#fff" stroke-linecap="round" stroke-miterlimit="1" stroke-width="1.33" d="m286.59 278.44 3.14-2.14m-11.23-17.8 7.8-1.37m-8.32-2.9 3.78-.3m-3.3-12.47 7.8 1.38m-8.2 3.03 3.76.38m-1.2-13.05 7.47 2.73m-3.77-10.5 6.86 3.96m-1.87-10.96 6.07 5.09m.05-11.07 5.09 6.07m1.97-10.99 3.97 6.86m3.7-10.53 2.71 7.43m5.62-9.62 1.37 7.8m15.62-7.89-1.38 7.8m9.82-5.6-2.72 7.42m10.5-3.75-3.96 6.86m10.98-1.89-5.12 6.07m16.18 6.96-6.87 3.96m10.45 3.88-7.45 2.7m9.64 5.6-7.82 1.38m7.81 15.79-7.82-1.39m5.6 9.7-7.44-2.71m3.8 10.47-6.87-3.95m1.91 10.98-6.07-5.07m-.05 11.2-5.1-6.08m-1.95 10.99-4-6.88m-3.87 10.5-2.7-7.43m-5.61 9.61-1.37-7.78m-15.78 7.75 1.4-7.86m-9.7 5.58 2.72-7.47m-10.5 3.73 3.97-6.87m-10.96 1.9 5.08-6.03m-8.26 3.13 2.75-2.68m3.84 8.23 2.2-3.1m5.2 7.44 1.66-3.45m6.43 6.47 1.02-3.7m7.52 5.32.43-3.82m8.08 3.8-.31-3.84m8.81 2.33-.97-3.69m9.06.75-1.58-3.48m9.05-.76-2.16-3.18m8.78-2.38-2.68-2.73m8.24-3.85-3.11-2.2m7.42-5.2-3.47-1.67m6.42-6.41-3.7-1.03m5.17-7.46-3.78-.37m3.8-8.24-3.81.3m2.35-8.8-3.7.97m.8-9.06-3.49 1.61m-1.03-9.12-3.2 2.2m-2.12-8.62-2.72 2.7m-3.84-8.28-2.23 3.12m-5.21-7.45-1.66 3.44m-6.55-6.32-1.02 3.63m-7.42-5.2-.38 3.81m-8.09-3.66.28 3.8m-8.79-2.34.95 3.68m-8.9-.72 1.61 3.46m-9.06.82 2.18 3.16m-8.82 2.27 2.68 2.7m-8.25 3.85 3.1 2.23m-7.44 5.17 3.42 1.66m-6.3 6.36 3.7 1.05m-3.71 24.39 3.7-.91m-2.44 5.03 7.48-2.72m-5.86 6.73 3.5-1.61m-1.53 5.43 6.87-3.95m-13.33-20.52 7.96.01m41.16-41.44v-7.96m.02 98.74.01-7.94m49.33-41.4-7.95-.01" filter="url(#h)" transform="translate(-65 7.73)"/></svg><!--
  Copyright (c) Microsoft Corporation.

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<!DOCTYPE html>
<html lang="en" translate="no">
  <head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="icon" href="/playwright-logo.svg" type="image/svg+xml">
    <title>Playwright Dashboard</title>
    <script type="module" crossorigin src="/assets/index-C_5TMfeg.js"></script>
    <link rel="stylesheet" crossorigin href="/assets/index-BY2S1tHT.css">
  </head>
  <body>
    <div id="root"></div>
  </body>
</html>
<svg width="400" height="400" viewBox="0 0 400 400" fill="none" xmlns="http://www.w3.org/2000/svg">
<defs>
  <mask id="bezel-mask">
    <rect width="400" height="400" fill="white"/>
    <rect x="32" y="32" width="336" height="302" rx="6" fill="black"/>
  </mask>
</defs>
<!-- Monitor bezel (ring, transparent screen area) -->
<rect x="20" y="20" width="360" height="326" rx="13" fill="#2D4552" mask="url(#bezel-mask)"/>
<!-- Stand neck -->
<rect x="190" y="346" width="20" height="20" fill="#2D4552"/>
<!-- Stand base -->
<rect x="152" y="366" width="96" height="14" rx="7" fill="#2D4552"/>
<!-- Playwright logo inscribed on screen (scale 0.755, centered) -->
<g transform="translate(49, 32) scale(0.755)">
<path d="M136.444 221.556C123.558 225.213 115.104 231.625 109.535 238.032C114.869 233.364 122.014 229.08 131.652 226.348C141.51 223.554 149.92 223.574 156.869 224.915V219.481C150.941 218.939 144.145 219.371 136.444 221.556ZM108.946 175.876L61.0895 188.484C61.0895 188.484 61.9617 189.716 63.5767 191.36L104.153 180.668C104.153 180.668 103.578 188.077 98.5847 194.705C108.03 187.559 108.946 175.876 108.946 175.876ZM149.005 288.347C81.6582 306.486 46.0272 228.438 35.2396 187.928C30.2556 169.229 28.0799 155.067 27.5 145.928C27.4377 144.979 27.4665 144.179 27.5336 143.446C24.04 143.657 22.3674 145.473 22.7077 150.721C23.2876 159.855 25.4633 174.016 30.4473 192.721C41.2301 233.225 76.8659 311.273 144.213 293.134C158.872 289.185 169.885 281.992 178.152 272.81C170.532 279.692 160.995 285.112 149.005 288.347ZM161.661 128.11V132.903H188.077C187.535 131.206 186.989 129.677 186.447 128.11H161.661Z" fill="#2D4552"/>
<path d="M193.981 167.584C205.861 170.958 212.144 179.287 215.465 186.658L228.711 190.42C228.711 190.42 226.904 164.623 203.57 157.995C181.741 151.793 168.308 170.124 166.674 172.496C173.024 167.972 182.297 164.268 193.981 167.584ZM299.422 186.777C277.573 180.547 264.145 198.916 262.535 201.255C268.89 196.736 278.158 193.031 289.837 196.362C301.698 199.741 307.976 208.06 311.307 215.436L324.572 219.212C324.572 219.212 322.736 193.41 299.422 186.777ZM286.262 254.795L176.072 223.99C176.072 223.99 177.265 230.038 181.842 237.869L274.617 263.805C282.255 259.386 286.262 254.795 286.262 254.795ZM209.867 321.102C122.618 297.71 133.166 186.543 147.284 133.865C153.097 112.156 159.073 96.0203 164.029 85.204C161.072 84.5953 158.623 86.1529 156.203 91.0746C150.941 101.747 144.212 119.124 137.7 143.45C123.586 196.127 113.038 307.29 200.283 330.682C241.406 341.699 273.442 324.955 297.323 298.659C274.655 319.19 245.714 330.701 209.867 321.102Z" fill="#2D4552"/>
<path d="M161.661 262.296V239.863L99.3324 257.537C99.3324 257.537 103.938 230.777 136.444 221.556C146.302 218.762 154.713 218.781 161.661 220.123V128.11H192.869C189.471 117.61 186.184 109.526 183.423 103.909C178.856 94.612 174.174 100.775 163.545 109.665C156.059 115.919 137.139 129.261 108.668 136.933C80.1966 144.61 57.179 142.574 47.5752 140.911C33.9601 138.562 26.8387 135.572 27.5049 145.928C28.0847 155.062 30.2605 169.224 35.2445 187.928C46.0272 228.433 81.663 306.481 149.01 288.342C166.602 283.602 179.019 274.233 187.626 262.291H161.661V262.296ZM61.0848 188.484L108.946 175.876C108.946 175.876 107.551 194.288 89.6087 199.018C71.6614 203.743 61.0848 188.484 61.0848 188.484Z" fill="#E2574C"/>
<path d="M341.786 129.174C329.345 131.355 299.498 134.072 262.612 124.185C225.716 114.304 201.236 97.0224 191.537 88.8994C177.788 77.3834 171.74 69.3802 165.788 81.4857C160.526 92.163 153.797 109.54 147.284 133.866C133.171 186.543 122.623 297.706 209.867 321.098C297.093 344.47 343.53 242.92 357.644 190.238C364.157 165.917 367.013 147.5 367.799 135.625C368.695 122.173 359.455 126.078 341.786 129.174ZM166.497 172.756C166.497 172.756 180.246 151.372 203.565 158C226.899 164.628 228.706 190.425 228.706 190.425L166.497 172.756ZM223.42 268.713C182.403 256.698 176.077 223.99 176.077 223.99L286.262 254.796C286.262 254.791 264.021 280.578 223.42 268.713ZM262.377 201.495C262.377 201.495 276.107 180.126 299.422 186.773C322.736 193.411 324.572 219.208 324.572 219.208L262.377 201.495Z" fill="#2EAD33"/>
<path d="M139.88 246.04L99.3324 257.532C99.3324 257.532 103.737 232.44 133.607 222.496L110.647 136.33L108.663 136.933C80.1918 144.611 57.1742 142.574 47.5704 140.911C33.9554 138.563 26.834 135.572 27.5001 145.929C28.08 155.063 30.2557 169.224 35.2397 187.929C46.0225 228.433 81.6583 306.481 149.005 288.342L150.989 287.719L139.88 246.04ZM61.0848 188.485L108.946 175.876C108.946 175.876 107.551 194.288 89.6087 199.018C71.6615 203.743 61.0848 188.485 61.0848 188.485Z" fill="#D65348"/>
<path d="M225.27 269.163L223.415 268.712C182.398 256.698 176.072 223.99 176.072 223.99L232.89 239.872L262.971 124.281L262.607 124.185C225.711 114.304 201.232 97.0224 191.532 88.8994C177.783 77.3834 171.735 69.3802 165.783 81.4857C160.526 92.163 153.797 109.54 147.284 133.866C133.171 186.543 122.623 297.706 209.867 321.097L211.655 321.5L225.27 269.163ZM166.497 172.756C166.497 172.756 180.246 151.372 203.565 158C226.899 164.628 228.706 190.425 228.706 190.425L166.497 172.756Z" fill="#1D8D22"/>
<path d="M141.946 245.451L131.072 248.537C133.641 263.019 138.169 276.917 145.276 289.195C146.513 288.922 147.74 288.687 149 288.342C152.302 287.451 155.364 286.348 158.312 285.145C150.371 273.361 145.118 259.789 141.946 245.451ZM137.7 143.451C132.112 164.307 127.113 194.326 128.489 224.436C130.952 223.367 133.554 222.371 136.444 221.551L138.457 221.101C136.003 188.939 141.308 156.165 147.284 133.866C148.799 128.225 150.318 122.978 151.832 118.085C149.393 119.637 146.767 121.228 143.776 122.867C141.759 129.093 139.722 135.898 137.7 143.451Z" fill="#C04B41"/>
</g>
</svg>


<!DOCTYPE html>
<html style='scrollbar-gutter: stable both-edges;'>
  <head>
    <meta charset='UTF-8'>
    <meta name='color-scheme' content='dark light'>
    <meta name='viewport' content='width=device-width, initial-scale=1.0'>
    <title>Playwright Test Report</title>
    <script type="module" crossorigin src="./report.js"></script>
    <link rel="stylesheet" crossorigin href="./report.css">
  </head>
  <body>
    <div id='root'></div>
  </body>
</html>
:root{--color-canvas-default-transparent: rgba(255,255,255,0);--color-marketing-icon-primary: #218bff;--color-marketing-icon-secondary: #54aeff;--color-diff-blob-addition-num-text: #24292f;--color-diff-blob-addition-fg: #24292f;--color-diff-blob-addition-num-bg: #CCFFD8;--color-diff-blob-addition-line-bg: #E6FFEC;--color-diff-blob-addition-word-bg: #ABF2BC;--color-diff-blob-deletion-num-text: #24292f;--color-diff-blob-deletion-fg: #24292f;--color-diff-blob-deletion-num-bg: #FFD7D5;--color-diff-blob-deletion-line-bg: #FFEBE9;--color-diff-blob-deletion-word-bg: rgba(255,129,130,.4);--color-diff-blob-hunk-num-bg: rgba(84,174,255,.4);--color-diff-blob-expander-icon: #57606a;--color-diff-blob-selected-line-highlight-mix-blend-mode: multiply;--color-diffstat-deletion-border: rgba(27,31,36,.15);--color-diffstat-addition-border: rgba(27,31,36,.15);--color-diffstat-addition-bg: #2da44e;--color-search-keyword-hl: #fff8c5;--color-prettylights-syntax-comment: #6e7781;--color-prettylights-syntax-constant: #0550ae;--color-prettylights-syntax-entity: #8250df;--color-prettylights-syntax-storage-modifier-import: #24292f;--color-prettylights-syntax-entity-tag: #116329;--color-prettylights-syntax-keyword: #cf222e;--color-prettylights-syntax-string: #0a3069;--color-prettylights-syntax-variable: #953800;--color-prettylights-syntax-brackethighlighter-unmatched: #82071e;--color-prettylights-syntax-invalid-illegal-text: #f6f8fa;--color-prettylights-syntax-invalid-illegal-bg: #82071e;--color-prettylights-syntax-carriage-return-text: #f6f8fa;--color-prettylights-syntax-carriage-return-bg: #cf222e;--color-prettylights-syntax-string-regexp: #116329;--color-prettylights-syntax-markup-list: #3b2300;--color-prettylights-syntax-markup-heading: #0550ae;--color-prettylights-syntax-markup-italic: #24292f;--color-prettylights-syntax-markup-bold: #24292f;--color-prettylights-syntax-markup-deleted-text: #82071e;--color-prettylights-syntax-markup-deleted-bg: #FFEBE9;--color-prettylights-syntax-markup-inserted-text: #116329;--color-prettylights-syntax-markup-inserted-bg: #dafbe1;--color-prettylights-syntax-markup-changed-text: #953800;--color-prettylights-syntax-markup-changed-bg: #ffd8b5;--color-prettylights-syntax-markup-ignored-text: #eaeef2;--color-prettylights-syntax-markup-ignored-bg: #0550ae;--color-prettylights-syntax-meta-diff-range: #8250df;--color-prettylights-syntax-brackethighlighter-angle: #57606a;--color-prettylights-syntax-sublimelinter-gutter-mark: #8c959f;--color-prettylights-syntax-constant-other-reference-link: #0a3069;--color-codemirror-text: #24292f;--color-codemirror-bg: #ffffff;--color-codemirror-gutters-bg: #ffffff;--color-codemirror-guttermarker-text: #ffffff;--color-codemirror-guttermarker-subtle-text: #6e7781;--color-codemirror-linenumber-text: #57606a;--color-codemirror-cursor: #24292f;--color-codemirror-selection-bg: rgba(84,174,255,.4);--color-codemirror-activeline-bg: rgba(234,238,242,.5);--color-codemirror-matchingbracket-text: #24292f;--color-codemirror-lines-bg: #ffffff;--color-codemirror-syntax-comment: #24292f;--color-codemirror-syntax-constant: #0550ae;--color-codemirror-syntax-entity: #8250df;--color-codemirror-syntax-keyword: #cf222e;--color-codemirror-syntax-storage: #cf222e;--color-codemirror-syntax-string: #0a3069;--color-codemirror-syntax-support: #0550ae;--color-codemirror-syntax-variable: #953800;--color-checks-bg: #24292f;--color-checks-run-border-width: 0px;--color-checks-container-border-width: 0px;--color-checks-text-primary: #f6f8fa;--color-checks-text-secondary: #8c959f;--color-checks-text-link: #54aeff;--color-checks-btn-icon: #afb8c1;--color-checks-btn-hover-icon: #f6f8fa;--color-checks-btn-hover-bg: rgba(255,255,255,.125);--color-checks-input-text: #eaeef2;--color-checks-input-placeholder-text: #8c959f;--color-checks-input-focus-text: #8c959f;--color-checks-input-bg: #32383f;--color-checks-input-shadow: none;--color-checks-donut-error: #fa4549;--color-checks-donut-pending: #bf8700;--color-checks-donut-success: #2da44e;--color-checks-donut-neutral: #afb8c1;--color-checks-dropdown-text: #afb8c1;--color-checks-dropdown-bg: #32383f;--color-checks-dropdown-border: #424a53;--color-checks-dropdown-shadow: rgba(27,31,36,.3);--color-checks-dropdown-hover-text: #f6f8fa;--color-checks-dropdown-hover-bg: #424a53;--color-checks-dropdown-btn-hover-text: #f6f8fa;--color-checks-dropdown-btn-hover-bg: #32383f;--color-checks-scrollbar-thumb-bg: #57606a;--color-checks-header-label-text: #d0d7de;--color-checks-header-label-open-text: #f6f8fa;--color-checks-header-border: #32383f;--color-checks-header-icon: #8c959f;--color-checks-line-text: #d0d7de;--color-checks-line-num-text: rgba(140,149,159,.75);--color-checks-line-timestamp-text: #8c959f;--color-checks-line-hover-bg: #32383f;--color-checks-line-selected-bg: rgba(33,139,255,.15);--color-checks-line-selected-num-text: #54aeff;--color-checks-line-dt-fm-text: #24292f;--color-checks-line-dt-fm-bg: #9a6700;--color-checks-gate-bg: rgba(125,78,0,.15);--color-checks-gate-text: #d0d7de;--color-checks-gate-waiting-text: #afb8c1;--color-checks-step-header-open-bg: #32383f;--color-checks-step-error-text: #ff8182;--color-checks-step-warning-text: #d4a72c;--color-checks-logline-text: #8c959f;--color-checks-logline-num-text: rgba(140,149,159,.75);--color-checks-logline-debug-text: #c297ff;--color-checks-logline-error-text: #d0d7de;--color-checks-logline-error-num-text: #ff8182;--color-checks-logline-error-bg: rgba(164,14,38,.15);--color-checks-logline-warning-text: #d0d7de;--color-checks-logline-warning-num-text: #d4a72c;--color-checks-logline-warning-bg: rgba(125,78,0,.15);--color-checks-logline-command-text: #54aeff;--color-checks-logline-section-text: #4ac26b;--color-checks-ansi-black: #24292f;--color-checks-ansi-black-bright: #32383f;--color-checks-ansi-white: #d0d7de;--color-checks-ansi-white-bright: #d0d7de;--color-checks-ansi-gray: #8c959f;--color-checks-ansi-red: #ff8182;--color-checks-ansi-red-bright: #ffaba8;--color-checks-ansi-green: #4ac26b;--color-checks-ansi-green-bright: #6fdd8b;--color-checks-ansi-yellow: #d4a72c;--color-checks-ansi-yellow-bright: #eac54f;--color-checks-ansi-blue: #54aeff;--color-checks-ansi-blue-bright: #80ccff;--color-checks-ansi-magenta: #c297ff;--color-checks-ansi-magenta-bright: #d8b9ff;--color-checks-ansi-cyan: #76e3ea;--color-checks-ansi-cyan-bright: #b3f0ff;--color-project-header-bg: #24292f;--color-project-sidebar-bg: #ffffff;--color-project-gradient-in: #ffffff;--color-project-gradient-out: rgba(255,255,255,0);--color-mktg-success: rgba(36,146,67,1);--color-mktg-info: rgba(19,119,234,1);--color-mktg-bg-shade-gradient-top: rgba(27,31,36,.065);--color-mktg-bg-shade-gradient-bottom: rgba(27,31,36,0);--color-mktg-btn-bg-top: hsla(228,82%,66%,1);--color-mktg-btn-bg-bottom: #4969ed;--color-mktg-btn-bg-overlay-top: hsla(228,74%,59%,1);--color-mktg-btn-bg-overlay-bottom: #3355e0;--color-mktg-btn-text: #ffffff;--color-mktg-btn-primary-bg-top: hsla(137,56%,46%,1);--color-mktg-btn-primary-bg-bottom: #2ea44f;--color-mktg-btn-primary-bg-overlay-top: hsla(134,60%,38%,1);--color-mktg-btn-primary-bg-overlay-bottom: #22863a;--color-mktg-btn-primary-text: #ffffff;--color-mktg-btn-enterprise-bg-top: hsla(249,100%,72%,1);--color-mktg-btn-enterprise-bg-bottom: #6f57ff;--color-mktg-btn-enterprise-bg-overlay-top: hsla(248,65%,63%,1);--color-mktg-btn-enterprise-bg-overlay-bottom: #614eda;--color-mktg-btn-enterprise-text: #ffffff;--color-mktg-btn-outline-text: #4969ed;--color-mktg-btn-outline-border: rgba(73,105,237,.3);--color-mktg-btn-outline-hover-text: #3355e0;--color-mktg-btn-outline-hover-border: rgba(51,85,224,.5);--color-mktg-btn-outline-focus-border: #4969ed;--color-mktg-btn-outline-focus-border-inset: rgba(73,105,237,.5);--color-mktg-btn-dark-text: #ffffff;--color-mktg-btn-dark-border: rgba(255,255,255,.3);--color-mktg-btn-dark-hover-text: #ffffff;--color-mktg-btn-dark-hover-border: rgba(255,255,255,.5);--color-mktg-btn-dark-focus-border: #ffffff;--color-mktg-btn-dark-focus-border-inset: rgba(255,255,255,.5);--color-avatar-bg: #ffffff;--color-avatar-border: rgba(27,31,36,.15);--color-avatar-stack-fade: #afb8c1;--color-avatar-stack-fade-more: #d0d7de;--color-avatar-child-shadow: -2px -2px 0 rgba(255,255,255,.8);--color-topic-tag-border: rgba(0,0,0,0);--color-select-menu-backdrop-border: rgba(0,0,0,0);--color-select-menu-tap-highlight: rgba(175,184,193,.5);--color-select-menu-tap-focus-bg: #b6e3ff;--color-overlay-shadow: 0 1px 3px rgba(27,31,36,.12), 0 8px 24px rgba(66,74,83,.12);--color-header-text: rgba(255,255,255,.7);--color-header-bg: #24292f;--color-header-logo: #ffffff;--color-header-search-bg: #24292f;--color-header-search-border: #57606a;--color-sidenav-selected-bg: #ffffff;--color-menu-bg-active: rgba(0,0,0,0);--color-control-transparent-bg-hover: #818b981a;--color-input-disabled-bg: rgba(175,184,193,.2);--color-timeline-badge-bg: #eaeef2;--color-ansi-black: #24292f;--color-ansi-black-bright: #57606a;--color-ansi-white: #6e7781;--color-ansi-white-bright: #8c959f;--color-ansi-gray: #6e7781;--color-ansi-red: #cf222e;--color-ansi-red-bright: #a40e26;--color-ansi-green: #116329;--color-ansi-green-bright: #1a7f37;--color-ansi-yellow: #4d2d00;--color-ansi-yellow-bright: #633c01;--color-ansi-blue: #0969da;--color-ansi-blue-bright: #218bff;--color-ansi-magenta: #8250df;--color-ansi-magenta-bright: #a475f9;--color-ansi-cyan: #1b7c83;--color-ansi-cyan-bright: #3192aa;--color-btn-text: #24292f;--color-btn-bg: #f6f8fa;--color-btn-border: rgba(27,31,36,.15);--color-btn-shadow: 0 1px 0 rgba(27,31,36,.04);--color-btn-inset-shadow: inset 0 1px 0 rgba(255,255,255,.25);--color-btn-hover-bg: #f3f4f6;--color-btn-hover-border: rgba(27,31,36,.15);--color-btn-active-bg: hsla(220,14%,93%,1);--color-btn-active-border: rgba(27,31,36,.15);--color-btn-selected-bg: hsla(220,14%,94%,1);--color-btn-focus-bg: #f6f8fa;--color-btn-focus-border: rgba(27,31,36,.15);--color-btn-focus-shadow: 0 0 0 3px rgba(9,105,218,.3);--color-btn-shadow-active: inset 0 .15em .3em rgba(27,31,36,.15);--color-btn-shadow-input-focus: 0 0 0 .2em rgba(9,105,218,.3);--color-btn-counter-bg: rgba(27,31,36,.08);--color-btn-primary-text: #ffffff;--color-btn-primary-bg: #2da44e;--color-btn-primary-border: rgba(27,31,36,.15);--color-btn-primary-shadow: 0 1px 0 rgba(27,31,36,.1);--color-btn-primary-inset-shadow: inset 0 1px 0 rgba(255,255,255,.03);--color-btn-primary-hover-bg: #2c974b;--color-btn-primary-hover-border: rgba(27,31,36,.15);--color-btn-primary-selected-bg: hsla(137,55%,36%,1);--color-btn-primary-selected-shadow: inset 0 1px 0 rgba(0,45,17,.2);--color-btn-primary-disabled-text: rgba(255,255,255,.8);--color-btn-primary-disabled-bg: #94d3a2;--color-btn-primary-disabled-border: rgba(27,31,36,.15);--color-btn-primary-focus-bg: #2da44e;--color-btn-primary-focus-border: rgba(27,31,36,.15);--color-btn-primary-focus-shadow: 0 0 0 3px rgba(45,164,78,.4);--color-btn-primary-icon: rgba(255,255,255,.8);--color-btn-primary-counter-bg: rgba(255,255,255,.2);--color-btn-outline-text: #0969da;--color-btn-outline-hover-text: #ffffff;--color-btn-outline-hover-bg: #0969da;--color-btn-outline-hover-border: rgba(27,31,36,.15);--color-btn-outline-hover-shadow: 0 1px 0 rgba(27,31,36,.1);--color-btn-outline-hover-inset-shadow: inset 0 1px 0 rgba(255,255,255,.03);--color-btn-outline-hover-counter-bg: rgba(255,255,255,.2);--color-btn-outline-selected-text: #ffffff;--color-btn-outline-selected-bg: hsla(212,92%,42%,1);--color-btn-outline-selected-border: rgba(27,31,36,.15);--color-btn-outline-selected-shadow: inset 0 1px 0 rgba(0,33,85,.2);--color-btn-outline-disabled-text: rgba(9,105,218,.5);--color-btn-outline-disabled-bg: #f6f8fa;--color-btn-outline-disabled-counter-bg: rgba(9,105,218,.05);--color-btn-outline-focus-border: rgba(27,31,36,.15);--color-btn-outline-focus-shadow: 0 0 0 3px rgba(5,80,174,.4);--color-btn-outline-counter-bg: rgba(9,105,218,.1);--color-btn-danger-text: #cf222e;--color-btn-danger-hover-text: #ffffff;--color-btn-danger-hover-bg: #a40e26;--color-btn-danger-hover-border: rgba(27,31,36,.15);--color-btn-danger-hover-shadow: 0 1px 0 rgba(27,31,36,.1);--color-btn-danger-hover-inset-shadow: inset 0 1px 0 rgba(255,255,255,.03);--color-btn-danger-hover-counter-bg: rgba(255,255,255,.2);--color-btn-danger-selected-text: #ffffff;--color-btn-danger-selected-bg: hsla(356,72%,44%,1);--color-btn-danger-selected-border: rgba(27,31,36,.15);--color-btn-danger-selected-shadow: inset 0 1px 0 rgba(76,0,20,.2);--color-btn-danger-disabled-text: rgba(207,34,46,.5);--color-btn-danger-disabled-bg: #f6f8fa;--color-btn-danger-disabled-counter-bg: rgba(207,34,46,.05);--color-btn-danger-focus-border: rgba(27,31,36,.15);--color-btn-danger-focus-shadow: 0 0 0 3px rgba(164,14,38,.4);--color-btn-danger-counter-bg: rgba(207,34,46,.1);--color-btn-danger-icon: #cf222e;--color-btn-danger-hover-icon: #ffffff;--color-underlinenav-icon: #6e7781;--color-underlinenav-border-hover: rgba(175,184,193,.2);--color-fg-default: #24292f;--color-fg-muted: #57606a;--color-fg-subtle: #6e7781;--color-fg-on-emphasis: #ffffff;--color-canvas-default: #ffffff;--color-canvas-overlay: #ffffff;--color-canvas-inset: #f6f8fa;--color-canvas-subtle: #f6f8fa;--color-border-default: #d0d7de;--color-border-muted: hsla(210,18%,87%,1);--color-border-subtle: rgba(27,31,36,.15);--color-shadow-small: 0 1px 0 rgba(27,31,36,.04);--color-shadow-medium: 0 3px 6px rgba(140,149,159,.15);--color-shadow-large: 0 8px 24px rgba(140,149,159,.2);--color-shadow-extra-large: 0 12px 28px rgba(140,149,159,.3);--color-neutral-emphasis-plus: #24292f;--color-neutral-emphasis: #6e7781;--color-neutral-muted: rgba(175,184,193,.2);--color-neutral-subtle: rgba(234,238,242,.5);--color-accent-fg: #0969da;--color-accent-emphasis: #0969da;--color-accent-muted: rgba(84,174,255,.4);--color-accent-subtle: #ddf4ff;--color-success-fg: #1a7f37;--color-success-emphasis: #2da44e;--color-success-muted: rgba(74,194,107,.4);--color-success-subtle: #dafbe1;--color-attention-fg: #9a6700;--color-attention-emphasis: #bf8700;--color-attention-muted: rgba(212,167,44,.4);--color-attention-subtle: #fff8c5;--color-severe-fg: #bc4c00;--color-severe-emphasis: #bc4c00;--color-severe-muted: rgba(251,143,68,.4);--color-severe-subtle: #fff1e5;--color-danger-fg: #cf222e;--color-danger-emphasis: #cf222e;--color-danger-muted: rgba(255,129,130,.4);--color-danger-subtle: #FFEBE9;--color-done-fg: #8250df;--color-done-emphasis: #8250df;--color-done-muted: rgba(194,151,255,.4);--color-done-subtle: #fbefff;--color-sponsors-fg: #bf3989;--color-sponsors-emphasis: #bf3989;--color-sponsors-muted: rgba(255,128,200,.4);--color-sponsors-subtle: #ffeff7;--color-primer-canvas-backdrop: rgba(27,31,36,.5);--color-primer-canvas-sticky: rgba(255,255,255,.95);--color-primer-border-active: #FD8C73;--color-primer-border-contrast: rgba(27,31,36,.1);--color-primer-shadow-highlight: inset 0 1px 0 rgba(255,255,255,.25);--color-primer-shadow-inset: inset 0 1px 0 rgba(208,215,222,.2);--color-primer-shadow-focus: 0 0 0 3px rgba(9,105,218,.3);--color-scale-black: #1b1f24;--color-scale-white: #ffffff;--color-scale-gray-0: #f6f8fa;--color-scale-gray-1: #eaeef2;--color-scale-gray-2: #d0d7de;--color-scale-gray-3: #afb8c1;--color-scale-gray-4: #8c959f;--color-scale-gray-5: #6e7781;--color-scale-gray-6: #57606a;--color-scale-gray-7: #424a53;--color-scale-gray-8: #32383f;--color-scale-gray-9: #24292f;--color-scale-blue-0: #ddf4ff;--color-scale-blue-1: #b6e3ff;--color-scale-blue-2: #80ccff;--color-scale-blue-3: #54aeff;--color-scale-blue-4: #218bff;--color-scale-blue-5: #0969da;--color-scale-blue-6: #0550ae;--color-scale-blue-7: #033d8b;--color-scale-blue-8: #0a3069;--color-scale-blue-9: #002155;--color-scale-green-0: #dafbe1;--color-scale-green-1: #aceebb;--color-scale-green-2: #6fdd8b;--color-scale-green-3: #4ac26b;--color-scale-green-4: #2da44e;--color-scale-green-5: #1a7f37;--color-scale-green-6: #116329;--color-scale-green-7: #044f1e;--color-scale-green-8: #003d16;--color-scale-green-9: #002d11;--color-scale-yellow-0: #fff8c5;--color-scale-yellow-1: #fae17d;--color-scale-yellow-2: #eac54f;--color-scale-yellow-3: #d4a72c;--color-scale-yellow-4: #bf8700;--color-scale-yellow-5: #9a6700;--color-scale-yellow-6: #7d4e00;--color-scale-yellow-7: #633c01;--color-scale-yellow-8: #4d2d00;--color-scale-yellow-9: #3b2300;--color-scale-orange-0: #fff1e5;--color-scale-orange-1: #ffd8b5;--color-scale-orange-2: #ffb77c;--color-scale-orange-3: #fb8f44;--color-scale-orange-4: #e16f24;--color-scale-orange-5: #bc4c00;--color-scale-orange-6: #953800;--color-scale-orange-7: #762c00;--color-scale-orange-8: #5c2200;--color-scale-orange-9: #471700;--color-scale-red-0: #FFEBE9;--color-scale-red-1: #ffcecb;--color-scale-red-2: #ffaba8;--color-scale-red-3: #ff8182;--color-scale-red-4: #fa4549;--color-scale-red-5: #cf222e;--color-scale-red-6: #a40e26;--color-scale-red-7: #82071e;--color-scale-red-8: #660018;--color-scale-red-9: #4c0014;--color-scale-purple-0: #fbefff;--color-scale-purple-1: #ecd8ff;--color-scale-purple-2: #d8b9ff;--color-scale-purple-3: #c297ff;--color-scale-purple-4: #a475f9;--color-scale-purple-5: #8250df;--color-scale-purple-6: #6639ba;--color-scale-purple-7: #512a97;--color-scale-purple-8: #3e1f79;--color-scale-purple-9: #2e1461;--color-scale-pink-0: #ffeff7;--color-scale-pink-1: #ffd3eb;--color-scale-pink-2: #ffadda;--color-scale-pink-3: #ff80c8;--color-scale-pink-4: #e85aad;--color-scale-pink-5: #bf3989;--color-scale-pink-6: #99286e;--color-scale-pink-7: #772057;--color-scale-pink-8: #611347;--color-scale-pink-9: #4d0336;--color-scale-coral-0: #FFF0EB;--color-scale-coral-1: #FFD6CC;--color-scale-coral-2: #FFB4A1;--color-scale-coral-3: #FD8C73;--color-scale-coral-4: #EC6547;--color-scale-coral-5: #C4432B;--color-scale-coral-6: #9E2F1C;--color-scale-coral-7: #801F0F;--color-scale-coral-8: #691105;--color-scale-coral-9: #510901 }:root.dark-mode{color-scheme:dark;--color-canvas-default-transparent: rgba(13,17,23,0);--color-marketing-icon-primary: #79c0ff;--color-marketing-icon-secondary: #1f6feb;--color-diff-blob-addition-num-text: #c9d1d9;--color-diff-blob-addition-fg: #c9d1d9;--color-diff-blob-addition-num-bg: rgba(63,185,80,.3);--color-diff-blob-addition-line-bg: rgba(46,160,67,.15);--color-diff-blob-addition-word-bg: rgba(46,160,67,.4);--color-diff-blob-deletion-num-text: #c9d1d9;--color-diff-blob-deletion-fg: #c9d1d9;--color-diff-blob-deletion-num-bg: rgba(248,81,73,.3);--color-diff-blob-deletion-line-bg: rgba(248,81,73,.15);--color-diff-blob-deletion-word-bg: rgba(248,81,73,.4);--color-diff-blob-hunk-num-bg: rgba(56,139,253,.4);--color-diff-blob-expander-icon: #8b949e;--color-diff-blob-selected-line-highlight-mix-blend-mode: screen;--color-diffstat-deletion-border: rgba(240,246,252,.1);--color-diffstat-addition-border: rgba(240,246,252,.1);--color-diffstat-addition-bg: #3fb950;--color-search-keyword-hl: rgba(210,153,34,.4);--color-prettylights-syntax-comment: #8b949e;--color-prettylights-syntax-constant: #79c0ff;--color-prettylights-syntax-entity: #d2a8ff;--color-prettylights-syntax-storage-modifier-import: #c9d1d9;--color-prettylights-syntax-entity-tag: #7ee787;--color-prettylights-syntax-keyword: #ff7b72;--color-prettylights-syntax-string: #a5d6ff;--color-prettylights-syntax-variable: #ffa657;--color-prettylights-syntax-brackethighlighter-unmatched: #f85149;--color-prettylights-syntax-invalid-illegal-text: #f0f6fc;--color-prettylights-syntax-invalid-illegal-bg: #8e1519;--color-prettylights-syntax-carriage-return-text: #f0f6fc;--color-prettylights-syntax-carriage-return-bg: #b62324;--color-prettylights-syntax-string-regexp: #7ee787;--color-prettylights-syntax-markup-list: #f2cc60;--color-prettylights-syntax-markup-heading: #1f6feb;--color-prettylights-syntax-markup-italic: #c9d1d9;--color-prettylights-syntax-markup-bold: #c9d1d9;--color-prettylights-syntax-markup-deleted-text: #ffdcd7;--color-prettylights-syntax-markup-deleted-bg: #67060c;--color-prettylights-syntax-markup-inserted-text: #aff5b4;--color-prettylights-syntax-markup-inserted-bg: #033a16;--color-prettylights-syntax-markup-changed-text: #ffdfb6;--color-prettylights-syntax-markup-changed-bg: #5a1e02;--color-prettylights-syntax-markup-ignored-text: #c9d1d9;--color-prettylights-syntax-markup-ignored-bg: #1158c7;--color-prettylights-syntax-meta-diff-range: #d2a8ff;--color-prettylights-syntax-brackethighlighter-angle: #8b949e;--color-prettylights-syntax-sublimelinter-gutter-mark: #484f58;--color-prettylights-syntax-constant-other-reference-link: #a5d6ff;--color-codemirror-text: #c9d1d9;--color-codemirror-bg: #0d1117;--color-codemirror-gutters-bg: #0d1117;--color-codemirror-guttermarker-text: #0d1117;--color-codemirror-guttermarker-subtle-text: #484f58;--color-codemirror-linenumber-text: #8b949e;--color-codemirror-cursor: #c9d1d9;--color-codemirror-selection-bg: rgba(56,139,253,.4);--color-codemirror-activeline-bg: rgba(110,118,129,.1);--color-codemirror-matchingbracket-text: #c9d1d9;--color-codemirror-lines-bg: #0d1117;--color-codemirror-syntax-comment: #8b949e;--color-codemirror-syntax-constant: #79c0ff;--color-codemirror-syntax-entity: #d2a8ff;--color-codemirror-syntax-keyword: #ff7b72;--color-codemirror-syntax-storage: #ff7b72;--color-codemirror-syntax-string: #a5d6ff;--color-codemirror-syntax-support: #79c0ff;--color-codemirror-syntax-variable: #ffa657;--color-checks-bg: #010409;--color-checks-run-border-width: 1px;--color-checks-container-border-width: 1px;--color-checks-text-primary: #c9d1d9;--color-checks-text-secondary: #8b949e;--color-checks-text-link: #58a6ff;--color-checks-btn-icon: #8b949e;--color-checks-btn-hover-icon: #c9d1d9;--color-checks-btn-hover-bg: rgba(110,118,129,.1);--color-checks-input-text: #8b949e;--color-checks-input-placeholder-text: #484f58;--color-checks-input-focus-text: #c9d1d9;--color-checks-input-bg: #161b22;--color-checks-input-shadow: none;--color-checks-donut-error: #f85149;--color-checks-donut-pending: #d29922;--color-checks-donut-success: #2ea043;--color-checks-donut-neutral: #8b949e;--color-checks-dropdown-text: #c9d1d9;--color-checks-dropdown-bg: #161b22;--color-checks-dropdown-border: #30363d;--color-checks-dropdown-shadow: rgba(1,4,9,.3);--color-checks-dropdown-hover-text: #c9d1d9;--color-checks-dropdown-hover-bg: rgba(110,118,129,.1);--color-checks-dropdown-btn-hover-text: #c9d1d9;--color-checks-dropdown-btn-hover-bg: rgba(110,118,129,.1);--color-checks-scrollbar-thumb-bg: rgba(110,118,129,.4);--color-checks-header-label-text: #8b949e;--color-checks-header-label-open-text: #c9d1d9;--color-checks-header-border: #21262d;--color-checks-header-icon: #8b949e;--color-checks-line-text: #8b949e;--color-checks-line-num-text: #484f58;--color-checks-line-timestamp-text: #484f58;--color-checks-line-hover-bg: rgba(110,118,129,.1);--color-checks-line-selected-bg: rgba(56,139,253,.15);--color-checks-line-selected-num-text: #58a6ff;--color-checks-line-dt-fm-text: #f0f6fc;--color-checks-line-dt-fm-bg: #9e6a03;--color-checks-gate-bg: rgba(187,128,9,.15);--color-checks-gate-text: #8b949e;--color-checks-gate-waiting-text: #d29922;--color-checks-step-header-open-bg: #161b22;--color-checks-step-error-text: #f85149;--color-checks-step-warning-text: #d29922;--color-checks-logline-text: #8b949e;--color-checks-logline-num-text: #484f58;--color-checks-logline-debug-text: #a371f7;--color-checks-logline-error-text: #8b949e;--color-checks-logline-error-num-text: #484f58;--color-checks-logline-error-bg: rgba(248,81,73,.15);--color-checks-logline-warning-text: #8b949e;--color-checks-logline-warning-num-text: #d29922;--color-checks-logline-warning-bg: rgba(187,128,9,.15);--color-checks-logline-command-text: #58a6ff;--color-checks-logline-section-text: #3fb950;--color-checks-ansi-black: #0d1117;--color-checks-ansi-black-bright: #161b22;--color-checks-ansi-white: #b1bac4;--color-checks-ansi-white-bright: #b1bac4;--color-checks-ansi-gray: #6e7681;--color-checks-ansi-red: #ff7b72;--color-checks-ansi-red-bright: #ffa198;--color-checks-ansi-green: #3fb950;--color-checks-ansi-green-bright: #56d364;--color-checks-ansi-yellow: #d29922;--color-checks-ansi-yellow-bright: #e3b341;--color-checks-ansi-blue: #58a6ff;--color-checks-ansi-blue-bright: #79c0ff;--color-checks-ansi-magenta: #bc8cff;--color-checks-ansi-magenta-bright: #d2a8ff;--color-checks-ansi-cyan: #76e3ea;--color-checks-ansi-cyan-bright: #b3f0ff;--color-project-header-bg: #0d1117;--color-project-sidebar-bg: #161b22;--color-project-gradient-in: #161b22;--color-project-gradient-out: rgba(22,27,34,0);--color-mktg-success: rgba(41,147,61,1);--color-mktg-info: rgba(42,123,243,1);--color-mktg-bg-shade-gradient-top: rgba(1,4,9,.065);--color-mktg-bg-shade-gradient-bottom: rgba(1,4,9,0);--color-mktg-btn-bg-top: hsla(228,82%,66%,1);--color-mktg-btn-bg-bottom: #4969ed;--color-mktg-btn-bg-overlay-top: hsla(228,74%,59%,1);--color-mktg-btn-bg-overlay-bottom: #3355e0;--color-mktg-btn-text: #f0f6fc;--color-mktg-btn-primary-bg-top: hsla(137,56%,46%,1);--color-mktg-btn-primary-bg-bottom: #2ea44f;--color-mktg-btn-primary-bg-overlay-top: hsla(134,60%,38%,1);--color-mktg-btn-primary-bg-overlay-bottom: #22863a;--color-mktg-btn-primary-text: #f0f6fc;--color-mktg-btn-enterprise-bg-top: hsla(249,100%,72%,1);--color-mktg-btn-enterprise-bg-bottom: #6f57ff;--color-mktg-btn-enterprise-bg-overlay-top: hsla(248,65%,63%,1);--color-mktg-btn-enterprise-bg-overlay-bottom: #614eda;--color-mktg-btn-enterprise-text: #f0f6fc;--color-mktg-btn-outline-text: #f0f6fc;--color-mktg-btn-outline-border: rgba(240,246,252,.3);--color-mktg-btn-outline-hover-text: #f0f6fc;--color-mktg-btn-outline-hover-border: rgba(240,246,252,.5);--color-mktg-btn-outline-focus-border: #f0f6fc;--color-mktg-btn-outline-focus-border-inset: rgba(240,246,252,.5);--color-mktg-btn-dark-text: #f0f6fc;--color-mktg-btn-dark-border: rgba(240,246,252,.3);--color-mktg-btn-dark-hover-text: #f0f6fc;--color-mktg-btn-dark-hover-border: rgba(240,246,252,.5);--color-mktg-btn-dark-focus-border: #f0f6fc;--color-mktg-btn-dark-focus-border-inset: rgba(240,246,252,.5);--color-avatar-bg: rgba(240,246,252,.1);--color-avatar-border: rgba(240,246,252,.1);--color-avatar-stack-fade: #30363d;--color-avatar-stack-fade-more: #21262d;--color-avatar-child-shadow: -2px -2px 0 #0d1117;--color-topic-tag-border: rgba(0,0,0,0);--color-select-menu-backdrop-border: #484f58;--color-select-menu-tap-highlight: rgba(48,54,61,.5);--color-select-menu-tap-focus-bg: #0c2d6b;--color-overlay-shadow: 0 0 0 1px #30363d, 0 16px 32px rgba(1,4,9,.85);--color-header-text: rgba(240,246,252,.7);--color-header-bg: #161b22;--color-header-logo: #f0f6fc;--color-header-search-bg: #0d1117;--color-header-search-border: #30363d;--color-sidenav-selected-bg: #21262d;--color-menu-bg-active: #161b22;--color-control-transparent-bg-hover: #656c7633;--color-input-disabled-bg: rgba(110,118,129,0);--color-timeline-badge-bg: #21262d;--color-ansi-black: #484f58;--color-ansi-black-bright: #6e7681;--color-ansi-white: #b1bac4;--color-ansi-white-bright: #f0f6fc;--color-ansi-gray: #6e7681;--color-ansi-red: #ff7b72;--color-ansi-red-bright: #ffa198;--color-ansi-green: #3fb950;--color-ansi-green-bright: #56d364;--color-ansi-yellow: #d29922;--color-ansi-yellow-bright: #e3b341;--color-ansi-blue: #58a6ff;--color-ansi-blue-bright: #79c0ff;--color-ansi-magenta: #bc8cff;--color-ansi-magenta-bright: #d2a8ff;--color-ansi-cyan: #39c5cf;--color-ansi-cyan-bright: #56d4dd;--color-btn-text: #c9d1d9;--color-btn-bg: #21262d;--color-btn-border: rgba(240,246,252,.1);--color-btn-shadow: 0 0 transparent;--color-btn-inset-shadow: 0 0 transparent;--color-btn-hover-bg: #30363d;--color-btn-hover-border: #8b949e;--color-btn-active-bg: hsla(212,12%,18%,1);--color-btn-active-border: #6e7681;--color-btn-selected-bg: #161b22;--color-btn-focus-bg: #21262d;--color-btn-focus-border: #8b949e;--color-btn-focus-shadow: 0 0 0 3px rgba(139,148,158,.3);--color-btn-shadow-active: inset 0 .15em .3em rgba(1,4,9,.15);--color-btn-shadow-input-focus: 0 0 0 .2em rgba(31,111,235,.3);--color-btn-counter-bg: #30363d;--color-btn-primary-text: #ffffff;--color-btn-primary-bg: #238636;--color-btn-primary-border: rgba(240,246,252,.1);--color-btn-primary-shadow: 0 0 transparent;--color-btn-primary-inset-shadow: 0 0 transparent;--color-btn-primary-hover-bg: #2ea043;--color-btn-primary-hover-border: rgba(240,246,252,.1);--color-btn-primary-selected-bg: #238636;--color-btn-primary-selected-shadow: 0 0 transparent;--color-btn-primary-disabled-text: rgba(240,246,252,.5);--color-btn-primary-disabled-bg: rgba(35,134,54,.6);--color-btn-primary-disabled-border: rgba(240,246,252,.1);--color-btn-primary-focus-bg: #238636;--color-btn-primary-focus-border: rgba(240,246,252,.1);--color-btn-primary-focus-shadow: 0 0 0 3px rgba(46,164,79,.4);--color-btn-primary-icon: #f0f6fc;--color-btn-primary-counter-bg: rgba(240,246,252,.2);--color-btn-outline-text: #58a6ff;--color-btn-outline-hover-text: #58a6ff;--color-btn-outline-hover-bg: #30363d;--color-btn-outline-hover-border: rgba(240,246,252,.1);--color-btn-outline-hover-shadow: 0 1px 0 rgba(1,4,9,.1);--color-btn-outline-hover-inset-shadow: inset 0 1px 0 rgba(240,246,252,.03);--color-btn-outline-hover-counter-bg: rgba(240,246,252,.2);--color-btn-outline-selected-text: #f0f6fc;--color-btn-outline-selected-bg: #0d419d;--color-btn-outline-selected-border: rgba(240,246,252,.1);--color-btn-outline-selected-shadow: 0 0 transparent;--color-btn-outline-disabled-text: rgba(88,166,255,.5);--color-btn-outline-disabled-bg: #0d1117;--color-btn-outline-disabled-counter-bg: rgba(31,111,235,.05);--color-btn-outline-focus-border: rgba(240,246,252,.1);--color-btn-outline-focus-shadow: 0 0 0 3px rgba(17,88,199,.4);--color-btn-outline-counter-bg: rgba(31,111,235,.1);--color-btn-danger-text: #f85149;--color-btn-danger-hover-text: #f0f6fc;--color-btn-danger-hover-bg: #da3633;--color-btn-danger-hover-border: #f85149;--color-btn-danger-hover-shadow: 0 0 transparent;--color-btn-danger-hover-inset-shadow: 0 0 transparent;--color-btn-danger-hover-icon: #f0f6fc;--color-btn-danger-hover-counter-bg: rgba(255,255,255,.2);--color-btn-danger-selected-text: #ffffff;--color-btn-danger-selected-bg: #b62324;--color-btn-danger-selected-border: #ff7b72;--color-btn-danger-selected-shadow: 0 0 transparent;--color-btn-danger-disabled-text: rgba(248,81,73,.5);--color-btn-danger-disabled-bg: #0d1117;--color-btn-danger-disabled-counter-bg: rgba(218,54,51,.05);--color-btn-danger-focus-border: #f85149;--color-btn-danger-focus-shadow: 0 0 0 3px rgba(248,81,73,.4);--color-btn-danger-counter-bg: rgba(218,54,51,.1);--color-btn-danger-icon: #f85149;--color-underlinenav-icon: #484f58;--color-underlinenav-border-hover: rgba(110,118,129,.4);--color-fg-default: #c9d1d9;--color-fg-muted: #8b949e;--color-fg-subtle: #484f58;--color-fg-on-emphasis: #f0f6fc;--color-canvas-default: #0d1117;--color-canvas-overlay: #161b22;--color-canvas-inset: #010409;--color-canvas-subtle: #161b22;--color-border-default: #30363d;--color-border-muted: #21262d;--color-border-subtle: rgba(240,246,252,.1);--color-shadow-small: 0 0 transparent;--color-shadow-medium: 0 3px 6px #010409;--color-shadow-large: 0 8px 24px #010409;--color-shadow-extra-large: 0 12px 48px #010409;--color-neutral-emphasis-plus: #6e7681;--color-neutral-emphasis: #6e7681;--color-neutral-muted: rgba(110,118,129,.4);--color-neutral-subtle: rgba(110,118,129,.1);--color-accent-fg: #58a6ff;--color-accent-emphasis: #1f6feb;--color-accent-muted: rgba(56,139,253,.4);--color-accent-subtle: rgba(56,139,253,.15);--color-success-fg: #3fb950;--color-success-emphasis: #238636;--color-success-muted: rgba(46,160,67,.4);--color-success-subtle: rgba(46,160,67,.15);--color-attention-fg: #d29922;--color-attention-emphasis: #9e6a03;--color-attention-muted: rgba(187,128,9,.4);--color-attention-subtle: rgba(187,128,9,.15);--color-severe-fg: #db6d28;--color-severe-emphasis: #bd561d;--color-severe-muted: rgba(219,109,40,.4);--color-severe-subtle: rgba(219,109,40,.15);--color-danger-fg: #f85149;--color-danger-emphasis: #da3633;--color-danger-muted: rgba(248,81,73,.4);--color-danger-subtle: rgba(248,81,73,.15);--color-done-fg: #a371f7;--color-done-emphasis: #8957e5;--color-done-muted: rgba(163,113,247,.4);--color-done-subtle: rgba(163,113,247,.15);--color-sponsors-fg: #db61a2;--color-sponsors-emphasis: #bf4b8a;--color-sponsors-muted: rgba(219,97,162,.4);--color-sponsors-subtle: rgba(219,97,162,.15);--color-primer-canvas-backdrop: rgba(1,4,9,.8);--color-primer-canvas-sticky: rgba(13,17,23,.95);--color-primer-border-active: #F78166;--color-primer-border-contrast: rgba(240,246,252,.2);--color-primer-shadow-highlight: 0 0 transparent;--color-primer-shadow-inset: 0 0 transparent;--color-primer-shadow-focus: 0 0 0 3px #0c2d6b;--color-scale-black: #010409;--color-scale-white: #f0f6fc;--color-scale-gray-0: #f0f6fc;--color-scale-gray-1: #c9d1d9;--color-scale-gray-2: #b1bac4;--color-scale-gray-3: #8b949e;--color-scale-gray-4: #6e7681;--color-scale-gray-5: #484f58;--color-scale-gray-6: #30363d;--color-scale-gray-7: #21262d;--color-scale-gray-8: #161b22;--color-scale-gray-9: #0d1117;--color-scale-blue-0: #cae8ff;--color-scale-blue-1: #a5d6ff;--color-scale-blue-2: #79c0ff;--color-scale-blue-3: #58a6ff;--color-scale-blue-4: #388bfd;--color-scale-blue-5: #1f6feb;--color-scale-blue-6: #1158c7;--color-scale-blue-7: #0d419d;--color-scale-blue-8: #0c2d6b;--color-scale-blue-9: #051d4d;--color-scale-green-0: #aff5b4;--color-scale-green-1: #7ee787;--color-scale-green-2: #56d364;--color-scale-green-3: #3fb950;--color-scale-green-4: #2ea043;--color-scale-green-5: #238636;--color-scale-green-6: #196c2e;--color-scale-green-7: #0f5323;--color-scale-green-8: #033a16;--color-scale-green-9: #04260f;--color-scale-yellow-0: #f8e3a1;--color-scale-yellow-1: #f2cc60;--color-scale-yellow-2: #e3b341;--color-scale-yellow-3: #d29922;--color-scale-yellow-4: #bb8009;--color-scale-yellow-5: #9e6a03;--color-scale-yellow-6: #845306;--color-scale-yellow-7: #693e00;--color-scale-yellow-8: #4b2900;--color-scale-yellow-9: #341a00;--color-scale-orange-0: #ffdfb6;--color-scale-orange-1: #ffc680;--color-scale-orange-2: #ffa657;--color-scale-orange-3: #f0883e;--color-scale-orange-4: #db6d28;--color-scale-orange-5: #bd561d;--color-scale-orange-6: #9b4215;--color-scale-orange-7: #762d0a;--color-scale-orange-8: #5a1e02;--color-scale-orange-9: #3d1300;--color-scale-red-0: #ffdcd7;--color-scale-red-1: #ffc1ba;--color-scale-red-2: #ffa198;--color-scale-red-3: #ff7b72;--color-scale-red-4: #f85149;--color-scale-red-5: #da3633;--color-scale-red-6: #b62324;--color-scale-red-7: #8e1519;--color-scale-red-8: #67060c;--color-scale-red-9: #490202;--color-scale-purple-0: #eddeff;--color-scale-purple-1: #e2c5ff;--color-scale-purple-2: #d2a8ff;--color-scale-purple-3: #bc8cff;--color-scale-purple-4: #a371f7;--color-scale-purple-5: #8957e5;--color-scale-purple-6: #6e40c9;--color-scale-purple-7: #553098;--color-scale-purple-8: #3c1e70;--color-scale-purple-9: #271052;--color-scale-pink-0: #ffdaec;--color-scale-pink-1: #ffbedd;--color-scale-pink-2: #ff9bce;--color-scale-pink-3: #f778ba;--color-scale-pink-4: #db61a2;--color-scale-pink-5: #bf4b8a;--color-scale-pink-6: #9e3670;--color-scale-pink-7: #7d2457;--color-scale-pink-8: #5e103e;--color-scale-pink-9: #42062a;--color-scale-coral-0: #FFDDD2;--color-scale-coral-1: #FFC2B2;--color-scale-coral-2: #FFA28B;--color-scale-coral-3: #F78166;--color-scale-coral-4: #EA6045;--color-scale-coral-5: #CF462D;--color-scale-coral-6: #AC3220;--color-scale-coral-7: #872012;--color-scale-coral-8: #640D04;--color-scale-coral-9: #460701 }:root{--box-shadow: rgba(0, 0, 0, .133) 0px 1.6px 3.6px 0px, rgba(0, 0, 0, .11) 0px .3px .9px 0px;--box-shadow-thick: rgb(0 0 0 / 10%) 0px 1.8px 1.9px, rgb(0 0 0 / 15%) 0px 6.1px 6.3px, rgb(0 0 0 / 10%) 0px -2px 4px, rgb(0 0 0 / 15%) 0px -6.1px 12px, rgb(0 0 0 / 25%) 0px 6px 12px}*{box-sizing:border-box;min-width:0;min-height:0}svg{fill:currentColor}.vbox{display:flex;flex-direction:column;flex:auto;position:relative}.hbox{display:flex;flex:auto;position:relative}.hidden{visibility:hidden}.d-flex{display:flex!important}.d-inline{display:inline!important}.m-1{margin:4px}.m-2{margin:8px}.m-3{margin:16px}.m-4{margin:24px}.m-5{margin:32px}.mx-1{margin:0 4px}.mx-2{margin:0 8px}.mx-3{margin:0 16px}.mx-4{margin:0 24px}.mx-5{margin:0 32px}.my-1{margin:4px 0}.my-2{margin:8px 0}.my-3{margin:16px 0}.my-4{margin:24px 0}.my-5{margin:32px 0}.mt-1{margin-top:4px}.mt-2{margin-top:8px}.mt-3{margin-top:16px}.mt-4{margin-top:24px}.mt-5{margin-top:32px}.mr-1{margin-right:4px}.mr-2{margin-right:8px}.mr-3{margin-right:16px}.mr-4{margin-right:24px}.mr-5{margin-right:32px}.mb-1{margin-bottom:4px}.mb-2{margin-bottom:8px}.mb-3{margin-bottom:16px}.mb-4{margin-bottom:24px}.mb-5{margin-bottom:32px}.ml-1{margin-left:4px}.ml-2{margin-left:8px}.ml-3{margin-left:16px}.ml-4{margin-left:24px}.ml-5{margin-left:32px}.p-1{padding:4px}.p-2{padding:8px}.p-3{padding:16px}.p-4{padding:24px}.p-5{padding:32px}.px-1{padding:0 4px}.px-2{padding:0 8px}.px-3{padding:0 16px}.px-4{padding:0 24px}.px-5{padding:0 32px}.py-1{padding:4px 0}.py-2{padding:8px 0}.py-3{padding:16px 0}.py-4{padding:24px 0}.py-5{padding:32px 0}.pt-1{padding-top:4px}.pt-2{padding-top:8px}.pt-3{padding-top:16px}.pt-4{padding-top:24px}.pt-5{padding-top:32px}.pr-1{padding-right:4px}.pr-2{padding-right:8px}.pr-3{padding-right:16px}.pr-4{padding-right:24px}.pr-5{padding-right:32px}.pb-1{padding-bottom:4px}.pb-2{padding-bottom:8px}.pb-3{padding-bottom:16px}.pb-4{padding-bottom:24px}.pb-5{padding-bottom:32px}.pl-1{padding-left:4px}.pl-2{padding-left:8px}.pl-3{padding-left:16px}.pl-4{padding-left:24px}.pl-5{padding-left:32px}.no-wrap{white-space:nowrap!important}.float-left{float:left!important}article,aside,details,figcaption,figure,footer,header,main,menu,nav,section{display:block}.form-control,.form-select{padding:5px 12px;font-size:14px;line-height:20px;color:var(--color-fg-default);vertical-align:middle;background-color:var(--color-canvas-default);background-repeat:no-repeat;background-position:right 8px center;border:1px solid var(--color-border-default);border-radius:6px;outline:none;box-shadow:var(--color-primer-shadow-inset)}.input-contrast{background-color:var(--color-canvas-inset)}.subnav-search{position:relative;flex:auto;display:flex}.subnav-search-input{flex:auto;padding-left:32px;color:var(--color-fg-muted)}.subnav-search-icon{position:absolute;top:9px;left:8px;display:block;color:var(--color-fg-muted);text-align:center;pointer-events:none}.subnav-search-context+.subnav-search{margin-left:-1px}.subnav-item{flex:none;position:relative;float:left;padding:5px 8px;font-weight:500;line-height:20px;color:var(--color-fg-default);border:1px solid var(--color-border-default);-webkit-user-select:none;user-select:none}.subnav-item:hover{background-color:var(--color-canvas-subtle)}.subnav-item[aria-selected=true]{background:var(--color-control-transparent-bg-hover)}.subnav-item:first-child{border-top-left-radius:6px;border-bottom-left-radius:6px}.subnav-item:last-child{border-top-right-radius:6px;border-bottom-right-radius:6px}.subnav-item+.subnav-item{margin-left:-1px}.subnav-item .octicon,.subnav-item-label{margin-right:8px}.counter{display:inline-block;min-width:20px;padding:0 6px;font-size:12px;font-weight:500;line-height:18px;color:var(--color-fg-default);text-align:center;background-color:var(--color-neutral-muted);border:1px solid transparent;border-radius:2em}.color-icon-success{color:var(--color-success-fg)!important}.color-text-danger{color:var(--color-danger-fg)!important}.color-text-warning{color:var(--color-checks-step-warning-text)!important}.color-fg-muted{color:var(--color-fg-muted)!important}.octicon{display:inline-block;overflow:visible!important;vertical-align:text-bottom;fill:currentColor;margin-right:7px;flex:none}.button{flex:none;height:24px;border:1px solid var(--color-btn-border);outline:none;color:var(--color-btn-text);background:var(--color-btn-bg);padding:4px;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;border-radius:4px}.button:not(:disabled):hover{border-color:var(--color-btn-hover-border);background-color:var(--color-btn-hover-bg)}input[type=checkbox]{outline:var(--color-focus-border);height:24px}dialog{background-color:var(--color-canvas-subtle);border:1px solid var(--color-border-default);border-radius:6px;padding:6px}.subnav-item .octicon.octicon-settings{margin-right:0}.subnav-item .octicon.octicon-clock{margin-right:0;color:var(--color-fg-default)!important}@media only screen and (max-width: 600px){.subnav-item,.form-control{border-radius:0!important}.subnav-item{border:none}.subnav-search-input{border-left:0;border-right:0}}.header-view-status-container{float:right}.header-view{padding:12px 8px 0}.header-view div{flex-shrink:0;flex-wrap:wrap}.header-superheader{color:var(--color-fg-muted)}.header-title{flex:none;font-weight:400;font-size:32px;line-height:1.25}.header-setting-theme{display:grid;margin-left:22px}@media only screen and (max-width: 600px){.header-view{padding:0}.header-view div{flex-shrink:1}.header-view-status-container{float:none;margin:0 0 10px!important;overflow:hidden}.header-view-status-container .subnav-search-input{border-left:none;border-right:none}.header-title,.header-superheader{margin:0 8px}}.copy-icon{flex:none;height:24px;width:24px;border:none;outline:none;color:var(--color-fg-muted);background:transparent;padding:4px;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;border-radius:4px}.copy-icon svg{margin:0}.copy-icon:not(:disabled):hover{background-color:var(--color-border-default)}.copy-button-container{visibility:hidden;display:inline-flex;margin-left:8px;vertical-align:bottom}.copy-value-container:hover .copy-button-container{visibility:visible}.attachment-body{white-space:pre-wrap;background-color:var(--color-canvas-subtle);margin-left:24px;line-height:normal;padding:8px;font-family:monospace;position:relative}.attachment-body .copy-icon{position:absolute;right:5px;top:5px}.attachment-flash{animation:attachmentflash-bg 2s}@keyframes attachmentflash-bg{0%{background:var(--color-attention-subtle)}to{background:transparent}}.link-badge{flex:none;background-color:transparent;border-color:transparent;-webkit-user-select:none;user-select:none}.link-badge-dim span{color:var(--color-fg-muted)}.link-badge:hover{cursor:pointer}.link-badge svg{fill:var(--color-fg-default)}.link-badge-dim svg{fill:var(--color-fg-muted)}.link-badge-dim:hover svg{fill:var(--color-fg-muted)}.fullwidth-link{width:100%;text-align:left}.fullwidth-link:hover{background-color:var(--color-canvas-subtle)}.trace-link{margin-right:3px}.trace-link-separator{color:var(--color-fg-muted);-webkit-user-select:none;user-select:none}.expandable-summary{cursor:pointer;list-style:none;white-space:nowrap;padding-left:4px}.label{display:inline-block;padding:0 8px;font-size:12px;font-weight:500;line-height:18px;border:1px solid transparent;border-radius:2em;background-color:var(--color-scale-gray-4);color:#fff;margin:0 10px;flex:none;font-weight:600;cursor:pointer}.label-anchor{text-decoration:none;color:var(--color-fg-default)}:root.light-mode .label-color-0{background-color:var(--color-scale-blue-0);color:var(--color-scale-blue-6);border:1px solid var(--color-scale-blue-4)}:root.light-mode .label-color-1{background-color:var(--color-scale-yellow-0);color:var(--color-scale-yellow-6);border:1px solid var(--color-scale-yellow-4)}:root.light-mode .label-color-2{background-color:var(--color-scale-purple-0);color:var(--color-scale-purple-6);border:1px solid var(--color-scale-purple-4)}:root.light-mode .label-color-3{background-color:var(--color-scale-pink-0);color:var(--color-scale-pink-6);border:1px solid var(--color-scale-pink-4)}:root.light-mode .label-color-4{background-color:var(--color-scale-coral-0);color:var(--color-scale-coral-6);border:1px solid var(--color-scale-coral-4)}:root.light-mode .label-color-5{background-color:var(--color-scale-orange-0);color:var(--color-scale-orange-6);border:1px solid var(--color-scale-orange-4)}:root.dark-mode .label-color-0{background-color:var(--color-scale-blue-9);color:var(--color-scale-blue-2);border:1px solid var(--color-scale-blue-4)}:root.dark-mode .label-color-1{background-color:var(--color-scale-yellow-9);color:var(--color-scale-yellow-2);border:1px solid var(--color-scale-yellow-4)}:root.dark-mode .label-color-2{background-color:var(--color-scale-purple-9);color:var(--color-scale-purple-2);border:1px solid var(--color-scale-purple-4)}:root.dark-mode .label-color-3{background-color:var(--color-scale-pink-9);color:var(--color-scale-pink-2);border:1px solid var(--color-scale-pink-4)}:root.dark-mode .label-color-4{background-color:var(--color-scale-coral-9);color:var(--color-scale-coral-2);border:1px solid var(--color-scale-coral-4)}:root.dark-mode .label-color-5{background-color:var(--color-scale-orange-9);color:var(--color-scale-orange-2);border:1px solid var(--color-scale-orange-4)}.label-row .label{margin:0}.label-row .label:not(:first-child){margin-left:6px}html,body{width:100%;height:100%;padding:0;margin:0;overscroll-behavior-x:none}body{overflow:auto;max-width:1024px;margin:0 auto;width:100%}.test-file-test:not(:first-child){border-top:1px solid var(--color-border-default)}@media only screen and (max-width: 600px){.htmlreport{padding:0!important}}.tabbed-pane{display:flex;flex:auto;overflow:hidden}.tabbed-pane-tab-strip{display:flex;align-items:center;padding-right:10px;flex:none;width:100%;z-index:2;font-size:14px;line-height:32px;color:var(--color-fg-default);height:48px;min-width:70px;box-shadow:inset 0 -1px 0 var(--color-border-muted)!important}.tabbed-pane-tab-strip:focus{outline:none}.tabbed-pane-tab-element{padding:4px 8px 0;margin-right:4px;cursor:pointer;display:flex;flex:none;align-items:center;justify-content:center;-webkit-user-select:none;user-select:none;border-bottom:2px solid transparent;outline:none;height:100%}.tabbed-pane-tab-label{max-width:250px;white-space:pre;overflow:hidden;text-overflow:ellipsis;display:inline-block;height:30px;padding:0 8px;border-radius:6px}.tabbed-pane-tab-label:hover{background-color:var(--color-control-transparent-bg-hover)}.tabbed-pane-tab-element.selected{border-bottom-color:#666;-webkit-text-stroke:.5px currentColor}.chip-header{border:1px solid var(--color-border-default);border-top-left-radius:6px;border-top-right-radius:6px;background-color:var(--color-canvas-subtle);padding:0 8px;border-bottom:none;margin-top:12px;font-weight:600;line-height:38px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;-webkit-user-select:none;user-select:none}.chip-header-allow-selection{-webkit-user-select:text;user-select:text}.chip-header.expanded-false{border:1px solid var(--color-border-default);border-radius:6px}.chip-header.expanded-false,.chip-header.expanded-true{cursor:pointer}.chip-body{border:1px solid var(--color-border-default);border-bottom-left-radius:6px;border-bottom-right-radius:6px;padding:16px;margin-bottom:12px;overflow:hidden}.chip-body-no-insets{padding:0}.chip-footer{border-top:1px solid var(--color-border-default)}@media only screen and (max-width: 600px){.chip-header{border-radius:0;border-right:none;border-left:none}.chip-body{border-radius:0;border-right:none;border-left:none;padding:8px}.chip-body-no-insets{padding:0}}.test-case-column{border-radius:6px;margin-bottom:24px}.test-case-column .tab-element.selected{font-weight:600;border-bottom-color:var(--color-primer-border-active)}.test-case-column .tab-element{border:none;color:var(--color-fg-default);border-bottom:2px solid transparent}.test-case-column .tab-element:hover{color:var(--color-fg-default)}.test-case-location,.test-case-duration{flex:none;align-items:center;padding:0 8px 8px}.selected .test-case-run-duration{-webkit-text-stroke:0}.test-case-run-duration{color:var(--color-fg-muted);padding-left:8px}.header-view .test-case-path{flex:none;flex-shrink:1;align-items:center;padding-right:8px}.test-case-annotation{flex:none;align-items:center;padding:0 8px;line-height:24px;white-space:pre-wrap}@media only screen and (max-width: 600px){.test-case-column{border-radius:0!important;margin:0!important}}.tree-item{display:flex;flex-direction:column;overflow:hidden;min-width:0;line-height:38px}.tree-item-title{cursor:pointer;overflow:hidden;text-overflow:ellipsis;min-width:0;display:flex;align-items:center}.tree-item-body{min-height:18px}.yellow-flash{animation:yellowflash-bg 2s}@keyframes yellowflash-bg{0%{background:var(--color-attention-subtle)}to{background:transparent}}:root{--vscode-font-family: system-ui, "Ubuntu", "Droid Sans", sans-serif;--vscode-font-weight: normal;--vscode-font-size: 13px;--vscode-editor-font-family: "Droid Sans Mono", "monospace", monospace;--vscode-editor-font-weight: normal;--vscode-editor-font-size: 14px;--vscode-foreground: #616161;--vscode-disabledForeground: rgba(97, 97, 97, .5);--vscode-errorForeground: #a1260d;--vscode-descriptionForeground: #717171;--vscode-icon-foreground: #424242;--vscode-focusBorder: #0090f1;--vscode-textSeparator-foreground: rgba(0, 0, 0, .18);--vscode-textLink-foreground: #006ab1;--vscode-textLink-activeForeground: #006ab1;--vscode-textPreformat-foreground: #a31515;--vscode-textBlockQuote-background: rgba(127, 127, 127, .1);--vscode-textBlockQuote-border: rgba(0, 122, 204, .5);--vscode-textCodeBlock-background: rgba(220, 220, 220, .4);--vscode-widget-shadow: rgba(0, 0, 0, .16);--vscode-input-background: #ffffff;--vscode-input-foreground: #616161;--vscode-inputOption-activeBorder: #007acc;--vscode-inputOption-hoverBackground: rgba(184, 184, 184, .31);--vscode-inputOption-activeBackground: rgba(0, 144, 241, .2);--vscode-inputOption-activeForeground: #000000;--vscode-input-placeholderForeground: #767676;--vscode-inputValidation-infoBackground: #d6ecf2;--vscode-inputValidation-infoBorder: #007acc;--vscode-inputValidation-warningBackground: #f6f5d2;--vscode-inputValidation-warningBorder: #b89500;--vscode-inputValidation-errorBackground: #f2dede;--vscode-inputValidation-errorBorder: #be1100;--vscode-dropdown-background: #ffffff;--vscode-dropdown-border: #cecece;--vscode-checkbox-background: #ffffff;--vscode-checkbox-border: #cecece;--vscode-button-foreground: #ffffff;--vscode-button-separator: rgba(255, 255, 255, .4);--vscode-button-background: #007acc;--vscode-button-hoverBackground: #0062a3;--vscode-button-secondaryForeground: #ffffff;--vscode-button-secondaryBackground: #5f6a79;--vscode-button-secondaryHoverBackground: #4c5561;--vscode-badge-background: #c4c4c4;--vscode-badge-foreground: #333333;--vscode-scrollbar-shadow: #dddddd;--vscode-scrollbarSlider-background: rgba(100, 100, 100, .4);--vscode-scrollbarSlider-hoverBackground: rgba(100, 100, 100, .7);--vscode-scrollbarSlider-activeBackground: rgba(0, 0, 0, .6);--vscode-progressBar-background: #0e70c0;--vscode-editorError-foreground: #e51400;--vscode-editorWarning-foreground: #bf8803;--vscode-editorInfo-foreground: #1a85ff;--vscode-editorHint-foreground: #6c6c6c;--vscode-sash-hoverBorder: #0090f1;--vscode-editor-background: #ffffff;--vscode-editor-foreground: #000000;--vscode-editorStickyScroll-background: #ffffff;--vscode-editorStickyScrollHover-background: #f0f0f0;--vscode-editorWidget-background: #f3f3f3;--vscode-editorWidget-foreground: #616161;--vscode-editorWidget-border: #c8c8c8;--vscode-quickInput-background: #f3f3f3;--vscode-quickInput-foreground: #616161;--vscode-quickInputTitle-background: rgba(0, 0, 0, .06);--vscode-pickerGroup-foreground: #0066bf;--vscode-pickerGroup-border: #cccedb;--vscode-keybindingLabel-background: rgba(221, 221, 221, .4);--vscode-keybindingLabel-foreground: #555555;--vscode-keybindingLabel-border: rgba(204, 204, 204, .4);--vscode-keybindingLabel-bottomBorder: rgba(187, 187, 187, .4);--vscode-editor-selectionBackground: #add6ff;--vscode-editor-inactiveSelectionBackground: #e5ebf1;--vscode-editor-selectionHighlightBackground: rgba(173, 214, 255, .5);--vscode-editor-findMatchBackground: #a8ac94;--vscode-editor-findMatchHighlightBackground: rgba(234, 92, 0, .33);--vscode-editor-findRangeHighlightBackground: rgba(180, 180, 180, .3);--vscode-searchEditor-findMatchBackground: rgba(234, 92, 0, .22);--vscode-editor-hoverHighlightBackground: rgba(173, 214, 255, .15);--vscode-editorHoverWidget-background: #f3f3f3;--vscode-editorHoverWidget-foreground: #616161;--vscode-editorHoverWidget-border: #c8c8c8;--vscode-editorHoverWidget-statusBarBackground: #e7e7e7;--vscode-editorLink-activeForeground: #0000ff;--vscode-editorInlayHint-foreground: rgba(51, 51, 51, .8);--vscode-editorInlayHint-background: rgba(196, 196, 196, .3);--vscode-editorInlayHint-typeForeground: rgba(51, 51, 51, .8);--vscode-editorInlayHint-typeBackground: rgba(196, 196, 196, .3);--vscode-editorInlayHint-parameterForeground: rgba(51, 51, 51, .8);--vscode-editorInlayHint-parameterBackground: rgba(196, 196, 196, .3);--vscode-editorLightBulb-foreground: #ddb100;--vscode-editorLightBulbAutoFix-foreground: #007acc;--vscode-diffEditor-insertedTextBackground: rgba(156, 204, 44, .4);--vscode-diffEditor-removedTextBackground: rgba(255, 0, 0, .3);--vscode-diffEditor-insertedLineBackground: rgba(155, 185, 85, .2);--vscode-diffEditor-removedLineBackground: rgba(255, 0, 0, .2);--vscode-diffEditor-diagonalFill: rgba(34, 34, 34, .2);--vscode-list-focusOutline: #0090f1;--vscode-list-focusAndSelectionOutline: #90c2f9;--vscode-list-activeSelectionBackground: #0060c0;--vscode-list-activeSelectionForeground: #ffffff;--vscode-list-activeSelectionIconForeground: #ffffff;--vscode-list-inactiveSelectionBackground: #e4e6f1;--vscode-list-hoverBackground: #e8e8e8;--vscode-list-dropBackground: #d6ebff;--vscode-list-highlightForeground: #0066bf;--vscode-list-focusHighlightForeground: #bbe7ff;--vscode-list-invalidItemForeground: #b89500;--vscode-list-errorForeground: #b01011;--vscode-list-warningForeground: #855f00;--vscode-listFilterWidget-background: #f3f3f3;--vscode-listFilterWidget-outline: rgba(0, 0, 0, 0);--vscode-listFilterWidget-noMatchesOutline: #be1100;--vscode-listFilterWidget-shadow: rgba(0, 0, 0, .16);--vscode-list-filterMatchBackground: rgba(234, 92, 0, .33);--vscode-tree-indentGuidesStroke: #a9a9a9;--vscode-tree-tableColumnsBorder: rgba(97, 97, 97, .13);--vscode-tree-tableOddRowsBackground: rgba(97, 97, 97, .04);--vscode-list-deemphasizedForeground: #8e8e90;--vscode-quickInputList-focusForeground: #ffffff;--vscode-quickInputList-focusIconForeground: #ffffff;--vscode-quickInputList-focusBackground: #0060c0;--vscode-menu-foreground: #616161;--vscode-menu-background: #ffffff;--vscode-menu-selectionForeground: #ffffff;--vscode-menu-selectionBackground: #0060c0;--vscode-menu-separatorBackground: #d4d4d4;--vscode-toolbar-hoverBackground: rgba(184, 184, 184, .31);--vscode-toolbar-activeBackground: rgba(166, 166, 166, .31);--vscode-editor-snippetTabstopHighlightBackground: rgba(10, 50, 100, .2);--vscode-editor-snippetFinalTabstopHighlightBorder: rgba(10, 50, 100, .5);--vscode-breadcrumb-foreground: rgba(97, 97, 97, .8);--vscode-breadcrumb-background: #ffffff;--vscode-breadcrumb-focusForeground: #4e4e4e;--vscode-breadcrumb-activeSelectionForeground: #4e4e4e;--vscode-breadcrumbPicker-background: #f3f3f3;--vscode-merge-currentHeaderBackground: rgba(64, 200, 174, .5);--vscode-merge-currentContentBackground: rgba(64, 200, 174, .2);--vscode-merge-incomingHeaderBackground: rgba(64, 166, 255, .5);--vscode-merge-incomingContentBackground: rgba(64, 166, 255, .2);--vscode-merge-commonHeaderBackground: rgba(96, 96, 96, .4);--vscode-merge-commonContentBackground: rgba(96, 96, 96, .16);--vscode-editorOverviewRuler-currentContentForeground: rgba(64, 200, 174, .5);--vscode-editorOverviewRuler-incomingContentForeground: rgba(64, 166, 255, .5);--vscode-editorOverviewRuler-commonContentForeground: rgba(96, 96, 96, .4);--vscode-editorOverviewRuler-findMatchForeground: rgba(209, 134, 22, .49);--vscode-editorOverviewRuler-selectionHighlightForeground: rgba(160, 160, 160, .8);--vscode-minimap-findMatchHighlight: #d18616;--vscode-minimap-selectionOccurrenceHighlight: #c9c9c9;--vscode-minimap-selectionHighlight: #add6ff;--vscode-minimap-errorHighlight: rgba(255, 18, 18, .7);--vscode-minimap-warningHighlight: #bf8803;--vscode-minimap-foregroundOpacity: #000000;--vscode-minimapSlider-background: rgba(100, 100, 100, .2);--vscode-minimapSlider-hoverBackground: rgba(100, 100, 100, .35);--vscode-minimapSlider-activeBackground: rgba(0, 0, 0, .3);--vscode-problemsErrorIcon-foreground: #e51400;--vscode-problemsWarningIcon-foreground: #bf8803;--vscode-problemsInfoIcon-foreground: #1a85ff;--vscode-charts-foreground: #616161;--vscode-charts-lines: rgba(97, 97, 97, .5);--vscode-charts-red: #e51400;--vscode-charts-blue: #1a85ff;--vscode-charts-yellow: #bf8803;--vscode-charts-orange: #d18616;--vscode-charts-green: #388a34;--vscode-charts-purple: #652d90;--vscode-editor-lineHighlightBorder: #eeeeee;--vscode-editor-rangeHighlightBackground: rgba(253, 255, 0, .2);--vscode-editor-symbolHighlightBackground: rgba(234, 92, 0, .33);--vscode-editorCursor-foreground: #000000;--vscode-editorWhitespace-foreground: rgba(51, 51, 51, .2);--vscode-editorIndentGuide-background: #d3d3d3;--vscode-editorIndentGuide-activeBackground: #939393;--vscode-editorLineNumber-foreground: #237893;--vscode-editorActiveLineNumber-foreground: #0b216f;--vscode-editorLineNumber-activeForeground: #0b216f;--vscode-editorRuler-foreground: #d3d3d3;--vscode-editorCodeLens-foreground: #919191;--vscode-editorBracketMatch-background: rgba(0, 100, 0, .1);--vscode-editorBracketMatch-border: #b9b9b9;--vscode-editorOverviewRuler-border: rgba(127, 127, 127, .3);--vscode-editorGutter-background: #ffffff;--vscode-editorUnnecessaryCode-opacity: rgba(0, 0, 0, .47);--vscode-editorGhostText-foreground: rgba(0, 0, 0, .47);--vscode-editorOverviewRuler-rangeHighlightForeground: rgba(0, 122, 204, .6);--vscode-editorOverviewRuler-errorForeground: rgba(255, 18, 18, .7);--vscode-editorOverviewRuler-warningForeground: #bf8803;--vscode-editorOverviewRuler-infoForeground: #1a85ff;--vscode-editorBracketHighlight-foreground1: #0431fa;--vscode-editorBracketHighlight-foreground2: #319331;--vscode-editorBracketHighlight-foreground3: #7b3814;--vscode-editorBracketHighlight-foreground4: rgba(0, 0, 0, 0);--vscode-editorBracketHighlight-foreground5: rgba(0, 0, 0, 0);--vscode-editorBracketHighlight-foreground6: rgba(0, 0, 0, 0);--vscode-editorBracketHighlight-unexpectedBracket\.foreground: rgba(255, 18, 18, .8);--vscode-editorBracketPairGuide-background1: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-background2: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-background3: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-background4: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-background5: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-background6: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-activeBackground1: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-activeBackground2: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-activeBackground3: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-activeBackground4: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-activeBackground5: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-activeBackground6: rgba(0, 0, 0, 0);--vscode-editorUnicodeHighlight-border: #cea33d;--vscode-editorUnicodeHighlight-background: rgba(206, 163, 61, .08);--vscode-symbolIcon-arrayForeground: #616161;--vscode-symbolIcon-booleanForeground: #616161;--vscode-symbolIcon-classForeground: #d67e00;--vscode-symbolIcon-colorForeground: #616161;--vscode-symbolIcon-constantForeground: #616161;--vscode-symbolIcon-constructorForeground: #652d90;--vscode-symbolIcon-enumeratorForeground: #d67e00;--vscode-symbolIcon-enumeratorMemberForeground: #007acc;--vscode-symbolIcon-eventForeground: #d67e00;--vscode-symbolIcon-fieldForeground: #007acc;--vscode-symbolIcon-fileForeground: #616161;--vscode-symbolIcon-folderForeground: #616161;--vscode-symbolIcon-functionForeground: #652d90;--vscode-symbolIcon-interfaceForeground: #007acc;--vscode-symbolIcon-keyForeground: #616161;--vscode-symbolIcon-keywordForeground: #616161;--vscode-symbolIcon-methodForeground: #652d90;--vscode-symbolIcon-moduleForeground: #616161;--vscode-symbolIcon-namespaceForeground: #616161;--vscode-symbolIcon-nullForeground: #616161;--vscode-symbolIcon-numberForeground: #616161;--vscode-symbolIcon-objectForeground: #616161;--vscode-symbolIcon-operatorForeground: #616161;--vscode-symbolIcon-packageForeground: #616161;--vscode-symbolIcon-propertyForeground: #616161;--vscode-symbolIcon-referenceForeground: #616161;--vscode-symbolIcon-snippetForeground: #616161;--vscode-symbolIcon-stringForeground: #616161;--vscode-symbolIcon-structForeground: #616161;--vscode-symbolIcon-textForeground: #616161;--vscode-symbolIcon-typeParameterForeground: #616161;--vscode-symbolIcon-unitForeground: #616161;--vscode-symbolIcon-variableForeground: #007acc;--vscode-editorHoverWidget-highlightForeground: #0066bf;--vscode-editorOverviewRuler-bracketMatchForeground: #a0a0a0;--vscode-editor-foldBackground: rgba(173, 214, 255, .3);--vscode-editorGutter-foldingControlForeground: #424242;--vscode-editor-linkedEditingBackground: rgba(255, 0, 0, .3);--vscode-editor-wordHighlightBackground: rgba(87, 87, 87, .25);--vscode-editor-wordHighlightStrongBackground: rgba(14, 99, 156, .25);--vscode-editorOverviewRuler-wordHighlightForeground: rgba(160, 160, 160, .8);--vscode-editorOverviewRuler-wordHighlightStrongForeground: rgba(192, 160, 192, .8);--vscode-peekViewTitle-background: rgba(26, 133, 255, .1);--vscode-peekViewTitleLabel-foreground: #000000;--vscode-peekViewTitleDescription-foreground: #616161;--vscode-peekView-border: #1a85ff;--vscode-peekViewResult-background: #f3f3f3;--vscode-peekViewResult-lineForeground: #646465;--vscode-peekViewResult-fileForeground: #1e1e1e;--vscode-peekViewResult-selectionBackground: rgba(51, 153, 255, .2);--vscode-peekViewResult-selectionForeground: #6c6c6c;--vscode-peekViewEditor-background: #f2f8fc;--vscode-peekViewEditorGutter-background: #f2f8fc;--vscode-peekViewResult-matchHighlightBackground: rgba(234, 92, 0, .3);--vscode-peekViewEditor-matchHighlightBackground: rgba(245, 216, 2, .87);--vscode-editorMarkerNavigationError-background: #e51400;--vscode-editorMarkerNavigationError-headerBackground: rgba(229, 20, 0, .1);--vscode-editorMarkerNavigationWarning-background: #bf8803;--vscode-editorMarkerNavigationWarning-headerBackground: rgba(191, 136, 3, .1);--vscode-editorMarkerNavigationInfo-background: #1a85ff;--vscode-editorMarkerNavigationInfo-headerBackground: rgba(26, 133, 255, .1);--vscode-editorMarkerNavigation-background: #ffffff;--vscode-editorSuggestWidget-background: #f3f3f3;--vscode-editorSuggestWidget-border: #c8c8c8;--vscode-editorSuggestWidget-foreground: #000000;--vscode-editorSuggestWidget-selectedForeground: #ffffff;--vscode-editorSuggestWidget-selectedIconForeground: #ffffff;--vscode-editorSuggestWidget-selectedBackground: #0060c0;--vscode-editorSuggestWidget-highlightForeground: #0066bf;--vscode-editorSuggestWidget-focusHighlightForeground: #bbe7ff;--vscode-editorSuggestWidgetStatus-foreground: rgba(0, 0, 0, .5);--vscode-tab-activeBackground: #ffffff;--vscode-tab-unfocusedActiveBackground: #ffffff;--vscode-tab-inactiveBackground: #ececec;--vscode-tab-unfocusedInactiveBackground: #ececec;--vscode-tab-activeForeground: #333333;--vscode-tab-inactiveForeground: rgba(51, 51, 51, .7);--vscode-tab-unfocusedActiveForeground: rgba(51, 51, 51, .7);--vscode-tab-unfocusedInactiveForeground: rgba(51, 51, 51, .35);--vscode-tab-border: #f3f3f3;--vscode-tab-lastPinnedBorder: rgba(97, 97, 97, .19);--vscode-tab-activeModifiedBorder: #33aaee;--vscode-tab-inactiveModifiedBorder: rgba(51, 170, 238, .5);--vscode-tab-unfocusedActiveModifiedBorder: rgba(51, 170, 238, .7);--vscode-tab-unfocusedInactiveModifiedBorder: rgba(51, 170, 238, .25);--vscode-editorPane-background: #ffffff;--vscode-editorGroupHeader-tabsBackground: #f3f3f3;--vscode-editorGroupHeader-noTabsBackground: #ffffff;--vscode-editorGroup-border: #e7e7e7;--vscode-editorGroup-dropBackground: rgba(38, 119, 203, .18);--vscode-editorGroup-dropIntoPromptForeground: #616161;--vscode-editorGroup-dropIntoPromptBackground: #f3f3f3;--vscode-sideBySideEditor-horizontalBorder: #e7e7e7;--vscode-sideBySideEditor-verticalBorder: #e7e7e7;--vscode-panel-background: #ffffff;--vscode-panel-border: rgba(128, 128, 128, .35);--vscode-panelTitle-activeForeground: #424242;--vscode-panelTitle-inactiveForeground: rgba(66, 66, 66, .75);--vscode-panelTitle-activeBorder: #424242;--vscode-panelInput-border: #dddddd;--vscode-panel-dropBorder: #424242;--vscode-panelSection-dropBackground: rgba(38, 119, 203, .18);--vscode-panelSectionHeader-background: rgba(128, 128, 128, .2);--vscode-panelSection-border: rgba(128, 128, 128, .35);--vscode-banner-background: #004386;--vscode-banner-foreground: #ffffff;--vscode-banner-iconForeground: #1a85ff;--vscode-statusBar-foreground: #ffffff;--vscode-statusBar-noFolderForeground: #ffffff;--vscode-statusBar-background: #007acc;--vscode-statusBar-noFolderBackground: #68217a;--vscode-statusBar-focusBorder: #ffffff;--vscode-statusBarItem-activeBackground: rgba(255, 255, 255, .18);--vscode-statusBarItem-focusBorder: #ffffff;--vscode-statusBarItem-hoverBackground: rgba(255, 255, 255, .12);--vscode-statusBarItem-compactHoverBackground: rgba(255, 255, 255, .2);--vscode-statusBarItem-prominentForeground: #ffffff;--vscode-statusBarItem-prominentBackground: rgba(0, 0, 0, .5);--vscode-statusBarItem-prominentHoverBackground: rgba(0, 0, 0, .3);--vscode-statusBarItem-errorBackground: #c72e0f;--vscode-statusBarItem-errorForeground: #ffffff;--vscode-statusBarItem-warningBackground: #725102;--vscode-statusBarItem-warningForeground: #ffffff;--vscode-activityBar-background: #2c2c2c;--vscode-activityBar-foreground: #ffffff;--vscode-activityBar-inactiveForeground: rgba(255, 255, 255, .4);--vscode-activityBar-activeBorder: #ffffff;--vscode-activityBar-dropBorder: #ffffff;--vscode-activityBarBadge-background: #007acc;--vscode-activityBarBadge-foreground: #ffffff;--vscode-statusBarItem-remoteBackground: #16825d;--vscode-statusBarItem-remoteForeground: #ffffff;--vscode-extensionBadge-remoteBackground: #007acc;--vscode-extensionBadge-remoteForeground: #ffffff;--vscode-sideBar-background: #f3f3f3;--vscode-sideBarTitle-foreground: #6f6f6f;--vscode-sideBar-dropBackground: rgba(38, 119, 203, .18);--vscode-sideBarSectionHeader-background: rgba(0, 0, 0, 0);--vscode-sideBarSectionHeader-border: rgba(97, 97, 97, .19);--vscode-titleBar-activeForeground: #333333;--vscode-titleBar-inactiveForeground: rgba(51, 51, 51, .6);--vscode-titleBar-activeBackground: #dddddd;--vscode-titleBar-inactiveBackground: rgba(221, 221, 221, .6);--vscode-menubar-selectionForeground: #333333;--vscode-menubar-selectionBackground: rgba(184, 184, 184, .31);--vscode-notifications-foreground: #616161;--vscode-notifications-background: #f3f3f3;--vscode-notificationLink-foreground: #006ab1;--vscode-notificationCenterHeader-background: #e7e7e7;--vscode-notifications-border: #e7e7e7;--vscode-notificationsErrorIcon-foreground: #e51400;--vscode-notificationsWarningIcon-foreground: #bf8803;--vscode-notificationsInfoIcon-foreground: #1a85ff;--vscode-commandCenter-foreground: #333333;--vscode-commandCenter-activeForeground: #333333;--vscode-commandCenter-activeBackground: rgba(184, 184, 184, .31);--vscode-commandCenter-border: rgba(128, 128, 128, .35);--vscode-editorCommentsWidget-resolvedBorder: rgba(97, 97, 97, .5);--vscode-editorCommentsWidget-unresolvedBorder: #1a85ff;--vscode-editorCommentsWidget-rangeBackground: rgba(26, 133, 255, .1);--vscode-editorCommentsWidget-rangeBorder: rgba(26, 133, 255, .4);--vscode-editorCommentsWidget-rangeActiveBackground: rgba(26, 133, 255, .1);--vscode-editorCommentsWidget-rangeActiveBorder: rgba(26, 133, 255, .4);--vscode-editorGutter-commentRangeForeground: #d5d8e9;--vscode-debugToolBar-background: #f3f3f3;--vscode-debugIcon-startForeground: #388a34;--vscode-editor-stackFrameHighlightBackground: rgba(255, 255, 102, .45);--vscode-editor-focusedStackFrameHighlightBackground: rgba(206, 231, 206, .45);--vscode-mergeEditor-change\.background: rgba(155, 185, 85, .2);--vscode-mergeEditor-change\.word\.background: rgba(156, 204, 44, .4);--vscode-mergeEditor-conflict\.unhandledUnfocused\.border: rgba(255, 166, 0, .48);--vscode-mergeEditor-conflict\.unhandledFocused\.border: #ffa600;--vscode-mergeEditor-conflict\.handledUnfocused\.border: rgba(134, 134, 134, .29);--vscode-mergeEditor-conflict\.handledFocused\.border: rgba(193, 193, 193, .8);--vscode-mergeEditor-conflict\.handled\.minimapOverViewRuler: rgba(173, 172, 168, .93);--vscode-mergeEditor-conflict\.unhandled\.minimapOverViewRuler: #fcba03;--vscode-mergeEditor-conflictingLines\.background: rgba(255, 234, 0, .28);--vscode-settings-headerForeground: #444444;--vscode-settings-modifiedItemIndicator: #66afe0;--vscode-settings-headerBorder: rgba(128, 128, 128, .35);--vscode-settings-sashBorder: rgba(128, 128, 128, .35);--vscode-settings-dropdownBackground: #ffffff;--vscode-settings-dropdownBorder: #cecece;--vscode-settings-dropdownListBorder: #c8c8c8;--vscode-settings-checkboxBackground: #ffffff;--vscode-settings-checkboxBorder: #cecece;--vscode-settings-textInputBackground: #ffffff;--vscode-settings-textInputForeground: #616161;--vscode-settings-textInputBorder: #cecece;--vscode-settings-numberInputBackground: #ffffff;--vscode-settings-numberInputForeground: #616161;--vscode-settings-numberInputBorder: #cecece;--vscode-settings-focusedRowBackground: rgba(232, 232, 232, .6);--vscode-settings-rowHoverBackground: rgba(232, 232, 232, .3);--vscode-settings-focusedRowBorder: rgba(0, 0, 0, .12);--vscode-terminal-foreground: #333333;--vscode-terminal-selectionBackground: #add6ff;--vscode-terminal-inactiveSelectionBackground: #e5ebf1;--vscode-terminalCommandDecoration-defaultBackground: rgba(0, 0, 0, .25);--vscode-terminalCommandDecoration-successBackground: #2090d3;--vscode-terminalCommandDecoration-errorBackground: #e51400;--vscode-terminalOverviewRuler-cursorForeground: rgba(160, 160, 160, .8);--vscode-terminal-border: rgba(128, 128, 128, .35);--vscode-terminal-findMatchBackground: #a8ac94;--vscode-terminal-findMatchHighlightBackground: rgba(234, 92, 0, .33);--vscode-terminalOverviewRuler-findMatchForeground: rgba(209, 134, 22, .49);--vscode-terminal-dropBackground: rgba(38, 119, 203, .18);--vscode-testing-iconFailed: #f14c4c;--vscode-testing-iconErrored: #f14c4c;--vscode-testing-iconPassed: #73c991;--vscode-testing-runAction: #73c991;--vscode-testing-iconQueued: #cca700;--vscode-testing-iconUnset: #848484;--vscode-testing-iconSkipped: #848484;--vscode-testing-peekBorder: #e51400;--vscode-testing-peekHeaderBackground: rgba(229, 20, 0, .1);--vscode-testing-message\.error\.decorationForeground: #e51400;--vscode-testing-message\.error\.lineBackground: rgba(255, 0, 0, .2);--vscode-testing-message\.info\.decorationForeground: rgba(0, 0, 0, .5);--vscode-welcomePage-tileBackground: #f3f3f3;--vscode-welcomePage-tileHoverBackground: #dbdbdb;--vscode-welcomePage-tileShadow: rgba(0, 0, 0, .16);--vscode-welcomePage-progress\.background: #ffffff;--vscode-welcomePage-progress\.foreground: #006ab1;--vscode-debugExceptionWidget-border: #a31515;--vscode-debugExceptionWidget-background: #f1dfde;--vscode-ports-iconRunningProcessForeground: #369432;--vscode-statusBar-debuggingBackground: #cc6633;--vscode-statusBar-debuggingForeground: #ffffff;--vscode-editor-inlineValuesForeground: rgba(0, 0, 0, .5);--vscode-editor-inlineValuesBackground: rgba(255, 200, 0, .2);--vscode-editorGutter-modifiedBackground: #2090d3;--vscode-editorGutter-addedBackground: #48985d;--vscode-editorGutter-deletedBackground: #e51400;--vscode-minimapGutter-modifiedBackground: #2090d3;--vscode-minimapGutter-addedBackground: #48985d;--vscode-minimapGutter-deletedBackground: #e51400;--vscode-editorOverviewRuler-modifiedForeground: rgba(32, 144, 211, .6);--vscode-editorOverviewRuler-addedForeground: rgba(72, 152, 93, .6);--vscode-editorOverviewRuler-deletedForeground: rgba(229, 20, 0, .6);--vscode-debugIcon-breakpointForeground: #e51400;--vscode-debugIcon-breakpointDisabledForeground: #848484;--vscode-debugIcon-breakpointUnverifiedForeground: #848484;--vscode-debugIcon-breakpointCurrentStackframeForeground: #be8700;--vscode-debugIcon-breakpointStackframeForeground: #89d185;--vscode-notebook-cellBorderColor: #e8e8e8;--vscode-notebook-focusedEditorBorder: #0090f1;--vscode-notebookStatusSuccessIcon-foreground: #388a34;--vscode-notebookStatusErrorIcon-foreground: #a1260d;--vscode-notebookStatusRunningIcon-foreground: #616161;--vscode-notebook-cellToolbarSeparator: rgba(128, 128, 128, .35);--vscode-notebook-selectedCellBackground: rgba(200, 221, 241, .31);--vscode-notebook-selectedCellBorder: #e8e8e8;--vscode-notebook-focusedCellBorder: #0090f1;--vscode-notebook-inactiveFocusedCellBorder: #e8e8e8;--vscode-notebook-cellStatusBarItemHoverBackground: rgba(0, 0, 0, .08);--vscode-notebook-cellInsertionIndicator: #0090f1;--vscode-notebookScrollbarSlider-background: rgba(100, 100, 100, .4);--vscode-notebookScrollbarSlider-hoverBackground: rgba(100, 100, 100, .7);--vscode-notebookScrollbarSlider-activeBackground: rgba(0, 0, 0, .6);--vscode-notebook-symbolHighlightBackground: rgba(253, 255, 0, .2);--vscode-notebook-cellEditorBackground: #f3f3f3;--vscode-notebook-editorBackground: #ffffff;--vscode-keybindingTable-headerBackground: rgba(97, 97, 97, .04);--vscode-keybindingTable-rowsBackground: rgba(97, 97, 97, .04);--vscode-scm-providerBorder: #c8c8c8;--vscode-searchEditor-textInputBorder: #cecece;--vscode-debugTokenExpression-name: #9b46b0;--vscode-debugTokenExpression-value: rgba(108, 108, 108, .8);--vscode-debugTokenExpression-string: #a31515;--vscode-debugTokenExpression-boolean: #0000ff;--vscode-debugTokenExpression-number: #098658;--vscode-debugTokenExpression-error: #e51400;--vscode-debugView-exceptionLabelForeground: #ffffff;--vscode-debugView-exceptionLabelBackground: #a31515;--vscode-debugView-stateLabelForeground: #616161;--vscode-debugView-stateLabelBackground: rgba(136, 136, 136, .27);--vscode-debugView-valueChangedHighlight: #569cd6;--vscode-debugConsole-infoForeground: #1a85ff;--vscode-debugConsole-warningForeground: #bf8803;--vscode-debugConsole-errorForeground: #a1260d;--vscode-debugConsole-sourceForeground: #616161;--vscode-debugConsoleInputIcon-foreground: #616161;--vscode-debugIcon-pauseForeground: #007acc;--vscode-debugIcon-stopForeground: #a1260d;--vscode-debugIcon-disconnectForeground: #a1260d;--vscode-debugIcon-restartForeground: #388a34;--vscode-debugIcon-stepOverForeground: #007acc;--vscode-debugIcon-stepIntoForeground: #007acc;--vscode-debugIcon-stepOutForeground: #007acc;--vscode-debugIcon-continueForeground: #007acc;--vscode-debugIcon-stepBackForeground: #007acc;--vscode-extensionButton-prominentBackground: #007acc;--vscode-extensionButton-prominentForeground: #ffffff;--vscode-extensionButton-prominentHoverBackground: #0062a3;--vscode-extensionIcon-starForeground: #df6100;--vscode-extensionIcon-verifiedForeground: #006ab1;--vscode-extensionIcon-preReleaseForeground: #1d9271;--vscode-extensionIcon-sponsorForeground: #b51e78;--vscode-terminal-ansiBlack: #000000;--vscode-terminal-ansiRed: #cd3131;--vscode-terminal-ansiGreen: #00bc00;--vscode-terminal-ansiYellow: #949800;--vscode-terminal-ansiBlue: #0451a5;--vscode-terminal-ansiMagenta: #bc05bc;--vscode-terminal-ansiCyan: #0598bc;--vscode-terminal-ansiWhite: #555555;--vscode-terminal-ansiBrightBlack: #666666;--vscode-terminal-ansiBrightRed: #cd3131;--vscode-terminal-ansiBrightGreen: #14ce14;--vscode-terminal-ansiBrightYellow: #b5ba00;--vscode-terminal-ansiBrightBlue: #0451a5;--vscode-terminal-ansiBrightMagenta: #bc05bc;--vscode-terminal-ansiBrightCyan: #0598bc;--vscode-terminal-ansiBrightWhite: #a5a5a5;--vscode-interactive-activeCodeBorder: #1a85ff;--vscode-interactive-inactiveCodeBorder: #e4e6f1;--vscode-gitDecoration-addedResourceForeground: #587c0c;--vscode-gitDecoration-modifiedResourceForeground: #895503;--vscode-gitDecoration-deletedResourceForeground: #ad0707;--vscode-gitDecoration-renamedResourceForeground: #007100;--vscode-gitDecoration-untrackedResourceForeground: #007100;--vscode-gitDecoration-ignoredResourceForeground: #8e8e90;--vscode-gitDecoration-stageModifiedResourceForeground: #895503;--vscode-gitDecoration-stageDeletedResourceForeground: #ad0707;--vscode-gitDecoration-conflictingResourceForeground: #ad0707;--vscode-gitDecoration-submoduleResourceForeground: #1258a7}:root.light-mode{color-scheme:light}:root.dark-mode{color-scheme:dark;--vscode-font-family: system-ui, "Ubuntu", "Droid Sans", sans-serif;--vscode-font-weight: normal;--vscode-font-size: 13px;--vscode-editor-font-family: "Droid Sans Mono", "monospace", monospace;--vscode-editor-font-weight: normal;--vscode-editor-font-size: 14px;--vscode-foreground: #cccccc;--vscode-disabledForeground: rgba(204, 204, 204, .5);--vscode-errorForeground: #f48771;--vscode-descriptionForeground: rgba(204, 204, 204, .7);--vscode-icon-foreground: #c5c5c5;--vscode-focusBorder: #007fd4;--vscode-textSeparator-foreground: rgba(255, 255, 255, .18);--vscode-textLink-foreground: #3794ff;--vscode-textLink-activeForeground: #3794ff;--vscode-textPreformat-foreground: #d7ba7d;--vscode-textBlockQuote-background: rgba(127, 127, 127, .1);--vscode-textBlockQuote-border: rgba(0, 122, 204, .5);--vscode-textCodeBlock-background: rgba(10, 10, 10, .4);--vscode-widget-shadow: rgba(0, 0, 0, .36);--vscode-input-background: #3c3c3c;--vscode-input-foreground: #cccccc;--vscode-inputOption-activeBorder: #007acc;--vscode-inputOption-hoverBackground: rgba(90, 93, 94, .5);--vscode-inputOption-activeBackground: rgba(0, 127, 212, .4);--vscode-inputOption-activeForeground: #ffffff;--vscode-input-placeholderForeground: #a6a6a6;--vscode-inputValidation-infoBackground: #063b49;--vscode-inputValidation-infoBorder: #007acc;--vscode-inputValidation-warningBackground: #352a05;--vscode-inputValidation-warningBorder: #b89500;--vscode-inputValidation-errorBackground: #5a1d1d;--vscode-inputValidation-errorBorder: #be1100;--vscode-dropdown-background: #3c3c3c;--vscode-dropdown-foreground: #f0f0f0;--vscode-dropdown-border: #3c3c3c;--vscode-checkbox-background: #3c3c3c;--vscode-checkbox-foreground: #f0f0f0;--vscode-checkbox-border: #3c3c3c;--vscode-button-foreground: #ffffff;--vscode-button-separator: rgba(255, 255, 255, .4);--vscode-button-background: #0e639c;--vscode-button-hoverBackground: #1177bb;--vscode-button-secondaryForeground: #ffffff;--vscode-button-secondaryBackground: #3a3d41;--vscode-button-secondaryHoverBackground: #45494e;--vscode-badge-background: #4d4d4d;--vscode-badge-foreground: #ffffff;--vscode-scrollbar-shadow: #000000;--vscode-scrollbarSlider-background: rgba(121, 121, 121, .4);--vscode-scrollbarSlider-hoverBackground: rgba(100, 100, 100, .7);--vscode-scrollbarSlider-activeBackground: rgba(191, 191, 191, .4);--vscode-progressBar-background: #0e70c0;--vscode-editorError-foreground: #f14c4c;--vscode-editorWarning-foreground: #cca700;--vscode-editorInfo-foreground: #3794ff;--vscode-editorHint-foreground: rgba(238, 238, 238, .7);--vscode-sash-hoverBorder: #007fd4;--vscode-editor-background: #1e1e1e;--vscode-editor-foreground: #d4d4d4;--vscode-editorStickyScroll-background: #1e1e1e;--vscode-editorStickyScrollHover-background: #2a2d2e;--vscode-editorWidget-background: #252526;--vscode-editorWidget-foreground: #cccccc;--vscode-editorWidget-border: #454545;--vscode-quickInput-background: #252526;--vscode-quickInput-foreground: #cccccc;--vscode-quickInputTitle-background: rgba(255, 255, 255, .1);--vscode-pickerGroup-foreground: #3794ff;--vscode-pickerGroup-border: #3f3f46;--vscode-keybindingLabel-background: rgba(128, 128, 128, .17);--vscode-keybindingLabel-foreground: #cccccc;--vscode-keybindingLabel-border: rgba(51, 51, 51, .6);--vscode-keybindingLabel-bottomBorder: rgba(68, 68, 68, .6);--vscode-editor-selectionBackground: #264f78;--vscode-editor-inactiveSelectionBackground: #3a3d41;--vscode-editor-selectionHighlightBackground: rgba(173, 214, 255, .15);--vscode-editor-findMatchBackground: #515c6a;--vscode-editor-findMatchHighlightBackground: rgba(234, 92, 0, .33);--vscode-editor-findRangeHighlightBackground: rgba(58, 61, 65, .4);--vscode-searchEditor-findMatchBackground: rgba(234, 92, 0, .22);--vscode-editor-hoverHighlightBackground: rgba(38, 79, 120, .25);--vscode-editorHoverWidget-background: #252526;--vscode-editorHoverWidget-foreground: #cccccc;--vscode-editorHoverWidget-border: #454545;--vscode-editorHoverWidget-statusBarBackground: #2c2c2d;--vscode-editorLink-activeForeground: #4e94ce;--vscode-editorInlayHint-foreground: rgba(255, 255, 255, .8);--vscode-editorInlayHint-background: rgba(77, 77, 77, .6);--vscode-editorInlayHint-typeForeground: rgba(255, 255, 255, .8);--vscode-editorInlayHint-typeBackground: rgba(77, 77, 77, .6);--vscode-editorInlayHint-parameterForeground: rgba(255, 255, 255, .8);--vscode-editorInlayHint-parameterBackground: rgba(77, 77, 77, .6);--vscode-editorLightBulb-foreground: #ffcc00;--vscode-editorLightBulbAutoFix-foreground: #75beff;--vscode-diffEditor-insertedTextBackground: rgba(156, 204, 44, .2);--vscode-diffEditor-removedTextBackground: rgba(255, 0, 0, .4);--vscode-diffEditor-insertedLineBackground: rgba(155, 185, 85, .2);--vscode-diffEditor-removedLineBackground: rgba(255, 0, 0, .2);--vscode-diffEditor-diagonalFill: rgba(204, 204, 204, .2);--vscode-list-focusOutline: #007fd4;--vscode-list-activeSelectionBackground: #04395e;--vscode-list-activeSelectionForeground: #ffffff;--vscode-list-activeSelectionIconForeground: #ffffff;--vscode-list-inactiveSelectionBackground: #37373d;--vscode-list-hoverBackground: #2a2d2e;--vscode-list-dropBackground: #383b3d;--vscode-list-highlightForeground: #2aaaff;--vscode-list-focusHighlightForeground: #2aaaff;--vscode-list-invalidItemForeground: #b89500;--vscode-list-errorForeground: #f88070;--vscode-list-warningForeground: #cca700;--vscode-listFilterWidget-background: #252526;--vscode-listFilterWidget-outline: rgba(0, 0, 0, 0);--vscode-listFilterWidget-noMatchesOutline: #be1100;--vscode-listFilterWidget-shadow: rgba(0, 0, 0, .36);--vscode-list-filterMatchBackground: rgba(234, 92, 0, .33);--vscode-tree-indentGuidesStroke: #585858;--vscode-tree-tableColumnsBorder: rgba(204, 204, 204, .13);--vscode-tree-tableOddRowsBackground: rgba(204, 204, 204, .04);--vscode-list-deemphasizedForeground: #8c8c8c;--vscode-quickInputList-focusForeground: #ffffff;--vscode-quickInputList-focusIconForeground: #ffffff;--vscode-quickInputList-focusBackground: #04395e;--vscode-menu-foreground: #cccccc;--vscode-menu-background: #303031;--vscode-menu-selectionForeground: #ffffff;--vscode-menu-selectionBackground: #04395e;--vscode-menu-separatorBackground: #606060;--vscode-toolbar-hoverBackground: rgba(90, 93, 94, .31);--vscode-toolbar-activeBackground: rgba(99, 102, 103, .31);--vscode-editor-snippetTabstopHighlightBackground: rgba(124, 124, 124, .3);--vscode-editor-snippetFinalTabstopHighlightBorder: #525252;--vscode-breadcrumb-foreground: rgba(204, 204, 204, .8);--vscode-breadcrumb-background: #1e1e1e;--vscode-breadcrumb-focusForeground: #e0e0e0;--vscode-breadcrumb-activeSelectionForeground: #e0e0e0;--vscode-breadcrumbPicker-background: #252526;--vscode-merge-currentHeaderBackground: rgba(64, 200, 174, .5);--vscode-merge-currentContentBackground: rgba(64, 200, 174, .2);--vscode-merge-incomingHeaderBackground: rgba(64, 166, 255, .5);--vscode-merge-incomingContentBackground: rgba(64, 166, 255, .2);--vscode-merge-commonHeaderBackground: rgba(96, 96, 96, .4);--vscode-merge-commonContentBackground: rgba(96, 96, 96, .16);--vscode-editorOverviewRuler-currentContentForeground: rgba(64, 200, 174, .5);--vscode-editorOverviewRuler-incomingContentForeground: rgba(64, 166, 255, .5);--vscode-editorOverviewRuler-commonContentForeground: rgba(96, 96, 96, .4);--vscode-editorOverviewRuler-findMatchForeground: rgba(209, 134, 22, .49);--vscode-editorOverviewRuler-selectionHighlightForeground: rgba(160, 160, 160, .8);--vscode-minimap-findMatchHighlight: #d18616;--vscode-minimap-selectionOccurrenceHighlight: #676767;--vscode-minimap-selectionHighlight: #264f78;--vscode-minimap-errorHighlight: rgba(255, 18, 18, .7);--vscode-minimap-warningHighlight: #cca700;--vscode-minimap-foregroundOpacity: #000000;--vscode-minimapSlider-background: rgba(121, 121, 121, .2);--vscode-minimapSlider-hoverBackground: rgba(100, 100, 100, .35);--vscode-minimapSlider-activeBackground: rgba(191, 191, 191, .2);--vscode-problemsErrorIcon-foreground: #f14c4c;--vscode-problemsWarningIcon-foreground: #cca700;--vscode-problemsInfoIcon-foreground: #3794ff;--vscode-charts-foreground: #cccccc;--vscode-charts-lines: rgba(204, 204, 204, .5);--vscode-charts-red: #f14c4c;--vscode-charts-blue: #3794ff;--vscode-charts-yellow: #cca700;--vscode-charts-orange: #d18616;--vscode-charts-green: #89d185;--vscode-charts-purple: #b180d7;--vscode-editor-lineHighlightBorder: #282828;--vscode-editor-rangeHighlightBackground: rgba(255, 255, 255, .04);--vscode-editor-symbolHighlightBackground: rgba(234, 92, 0, .33);--vscode-editorCursor-foreground: #aeafad;--vscode-editorWhitespace-foreground: rgba(227, 228, 226, .16);--vscode-editorIndentGuide-background: #404040;--vscode-editorIndentGuide-activeBackground: #707070;--vscode-editorLineNumber-foreground: #858585;--vscode-editorActiveLineNumber-foreground: #c6c6c6;--vscode-editorLineNumber-activeForeground: #c6c6c6;--vscode-editorRuler-foreground: #5a5a5a;--vscode-editorCodeLens-foreground: #999999;--vscode-editorBracketMatch-background: rgba(0, 100, 0, .1);--vscode-editorBracketMatch-border: #888888;--vscode-editorOverviewRuler-border: rgba(127, 127, 127, .3);--vscode-editorGutter-background: #1e1e1e;--vscode-editorUnnecessaryCode-opacity: rgba(0, 0, 0, .67);--vscode-editorGhostText-foreground: rgba(255, 255, 255, .34);--vscode-editorOverviewRuler-rangeHighlightForeground: rgba(0, 122, 204, .6);--vscode-editorOverviewRuler-errorForeground: rgba(255, 18, 18, .7);--vscode-editorOverviewRuler-warningForeground: #cca700;--vscode-editorOverviewRuler-infoForeground: #3794ff;--vscode-editorBracketHighlight-foreground1: #ffd700;--vscode-editorBracketHighlight-foreground2: #da70d6;--vscode-editorBracketHighlight-foreground3: #179fff;--vscode-editorBracketHighlight-foreground4: rgba(0, 0, 0, 0);--vscode-editorBracketHighlight-foreground5: rgba(0, 0, 0, 0);--vscode-editorBracketHighlight-foreground6: rgba(0, 0, 0, 0);--vscode-editorBracketHighlight-unexpectedBracket\.foreground: rgba(255, 18, 18, .8);--vscode-editorBracketPairGuide-background1: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-background2: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-background3: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-background4: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-background5: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-background6: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-activeBackground1: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-activeBackground2: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-activeBackground3: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-activeBackground4: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-activeBackground5: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-activeBackground6: rgba(0, 0, 0, 0);--vscode-editorUnicodeHighlight-border: #bd9b03;--vscode-editorUnicodeHighlight-background: rgba(189, 155, 3, .15);--vscode-symbolIcon-arrayForeground: #cccccc;--vscode-symbolIcon-booleanForeground: #cccccc;--vscode-symbolIcon-classForeground: #ee9d28;--vscode-symbolIcon-colorForeground: #cccccc;--vscode-symbolIcon-constantForeground: #cccccc;--vscode-symbolIcon-constructorForeground: #b180d7;--vscode-symbolIcon-enumeratorForeground: #ee9d28;--vscode-symbolIcon-enumeratorMemberForeground: #75beff;--vscode-symbolIcon-eventForeground: #ee9d28;--vscode-symbolIcon-fieldForeground: #75beff;--vscode-symbolIcon-fileForeground: #cccccc;--vscode-symbolIcon-folderForeground: #cccccc;--vscode-symbolIcon-functionForeground: #b180d7;--vscode-symbolIcon-interfaceForeground: #75beff;--vscode-symbolIcon-keyForeground: #cccccc;--vscode-symbolIcon-keywordForeground: #cccccc;--vscode-symbolIcon-methodForeground: #b180d7;--vscode-symbolIcon-moduleForeground: #cccccc;--vscode-symbolIcon-namespaceForeground: #cccccc;--vscode-symbolIcon-nullForeground: #cccccc;--vscode-symbolIcon-numberForeground: #cccccc;--vscode-symbolIcon-objectForeground: #cccccc;--vscode-symbolIcon-operatorForeground: #cccccc;--vscode-symbolIcon-packageForeground: #cccccc;--vscode-symbolIcon-propertyForeground: #cccccc;--vscode-symbolIcon-referenceForeground: #cccccc;--vscode-symbolIcon-snippetForeground: #cccccc;--vscode-symbolIcon-stringForeground: #cccccc;--vscode-symbolIcon-structForeground: #cccccc;--vscode-symbolIcon-textForeground: #cccccc;--vscode-symbolIcon-typeParameterForeground: #cccccc;--vscode-symbolIcon-unitForeground: #cccccc;--vscode-symbolIcon-variableForeground: #75beff;--vscode-editorHoverWidget-highlightForeground: #2aaaff;--vscode-editorOverviewRuler-bracketMatchForeground: #a0a0a0;--vscode-editor-foldBackground: rgba(38, 79, 120, .3);--vscode-editorGutter-foldingControlForeground: #c5c5c5;--vscode-editor-linkedEditingBackground: rgba(255, 0, 0, .3);--vscode-editor-wordHighlightBackground: rgba(87, 87, 87, .72);--vscode-editor-wordHighlightStrongBackground: rgba(0, 73, 114, .72);--vscode-editorOverviewRuler-wordHighlightForeground: rgba(160, 160, 160, .8);--vscode-editorOverviewRuler-wordHighlightStrongForeground: rgba(192, 160, 192, .8);--vscode-peekViewTitle-background: rgba(55, 148, 255, .1);--vscode-peekViewTitleLabel-foreground: #ffffff;--vscode-peekViewTitleDescription-foreground: rgba(204, 204, 204, .7);--vscode-peekView-border: #3794ff;--vscode-peekViewResult-background: #252526;--vscode-peekViewResult-lineForeground: #bbbbbb;--vscode-peekViewResult-fileForeground: #ffffff;--vscode-peekViewResult-selectionBackground: rgba(51, 153, 255, .2);--vscode-peekViewResult-selectionForeground: #ffffff;--vscode-peekViewEditor-background: #001f33;--vscode-peekViewEditorGutter-background: #001f33;--vscode-peekViewResult-matchHighlightBackground: rgba(234, 92, 0, .3);--vscode-peekViewEditor-matchHighlightBackground: rgba(255, 143, 0, .6);--vscode-editorMarkerNavigationError-background: #f14c4c;--vscode-editorMarkerNavigationError-headerBackground: rgba(241, 76, 76, .1);--vscode-editorMarkerNavigationWarning-background: #cca700;--vscode-editorMarkerNavigationWarning-headerBackground: rgba(204, 167, 0, .1);--vscode-editorMarkerNavigationInfo-background: #3794ff;--vscode-editorMarkerNavigationInfo-headerBackground: rgba(55, 148, 255, .1);--vscode-editorMarkerNavigation-background: #1e1e1e;--vscode-editorSuggestWidget-background: #252526;--vscode-editorSuggestWidget-border: #454545;--vscode-editorSuggestWidget-foreground: #d4d4d4;--vscode-editorSuggestWidget-selectedForeground: #ffffff;--vscode-editorSuggestWidget-selectedIconForeground: #ffffff;--vscode-editorSuggestWidget-selectedBackground: #04395e;--vscode-editorSuggestWidget-highlightForeground: #2aaaff;--vscode-editorSuggestWidget-focusHighlightForeground: #2aaaff;--vscode-editorSuggestWidgetStatus-foreground: rgba(212, 212, 212, .5);--vscode-tab-activeBackground: #1e1e1e;--vscode-tab-unfocusedActiveBackground: #1e1e1e;--vscode-tab-inactiveBackground: #2d2d2d;--vscode-tab-unfocusedInactiveBackground: #2d2d2d;--vscode-tab-activeForeground: #ffffff;--vscode-tab-inactiveForeground: rgba(255, 255, 255, .5);--vscode-tab-unfocusedActiveForeground: rgba(255, 255, 255, .5);--vscode-tab-unfocusedInactiveForeground: rgba(255, 255, 255, .25);--vscode-tab-border: #252526;--vscode-tab-lastPinnedBorder: rgba(204, 204, 204, .2);--vscode-tab-activeModifiedBorder: #3399cc;--vscode-tab-inactiveModifiedBorder: rgba(51, 153, 204, .5);--vscode-tab-unfocusedActiveModifiedBorder: rgba(51, 153, 204, .5);--vscode-tab-unfocusedInactiveModifiedBorder: rgba(51, 153, 204, .25);--vscode-editorPane-background: #1e1e1e;--vscode-editorGroupHeader-tabsBackground: #252526;--vscode-editorGroupHeader-noTabsBackground: #1e1e1e;--vscode-editorGroup-border: #444444;--vscode-editorGroup-dropBackground: rgba(83, 89, 93, .5);--vscode-editorGroup-dropIntoPromptForeground: #cccccc;--vscode-editorGroup-dropIntoPromptBackground: #252526;--vscode-sideBySideEditor-horizontalBorder: #444444;--vscode-sideBySideEditor-verticalBorder: #444444;--vscode-panel-background: #1e1e1e;--vscode-panel-border: rgba(128, 128, 128, .35);--vscode-panelTitle-activeForeground: #e7e7e7;--vscode-panelTitle-inactiveForeground: rgba(231, 231, 231, .6);--vscode-panelTitle-activeBorder: #e7e7e7;--vscode-panel-dropBorder: #e7e7e7;--vscode-panelSection-dropBackground: rgba(83, 89, 93, .5);--vscode-panelSectionHeader-background: rgba(128, 128, 128, .2);--vscode-panelSection-border: rgba(128, 128, 128, .35);--vscode-banner-background: #04395e;--vscode-banner-foreground: #ffffff;--vscode-banner-iconForeground: #3794ff;--vscode-statusBar-foreground: #ffffff;--vscode-statusBar-noFolderForeground: #ffffff;--vscode-statusBar-background: #007acc;--vscode-statusBar-noFolderBackground: #68217a;--vscode-statusBar-focusBorder: #ffffff;--vscode-statusBarItem-activeBackground: rgba(255, 255, 255, .18);--vscode-statusBarItem-focusBorder: #ffffff;--vscode-statusBarItem-hoverBackground: rgba(255, 255, 255, .12);--vscode-statusBarItem-compactHoverBackground: rgba(255, 255, 255, .2);--vscode-statusBarItem-prominentForeground: #ffffff;--vscode-statusBarItem-prominentBackground: rgba(0, 0, 0, .5);--vscode-statusBarItem-prominentHoverBackground: rgba(0, 0, 0, .3);--vscode-statusBarItem-errorBackground: #c72e0f;--vscode-statusBarItem-errorForeground: #ffffff;--vscode-statusBarItem-warningBackground: #7a6400;--vscode-statusBarItem-warningForeground: #ffffff;--vscode-activityBar-background: #333333;--vscode-activityBar-foreground: #ffffff;--vscode-activityBar-inactiveForeground: rgba(255, 255, 255, .4);--vscode-activityBar-activeBorder: #ffffff;--vscode-activityBar-dropBorder: #ffffff;--vscode-activityBarBadge-background: #007acc;--vscode-activityBarBadge-foreground: #ffffff;--vscode-statusBarItem-remoteBackground: #16825d;--vscode-statusBarItem-remoteForeground: #ffffff;--vscode-extensionBadge-remoteBackground: #007acc;--vscode-extensionBadge-remoteForeground: #ffffff;--vscode-sideBar-background: #252526;--vscode-sideBarTitle-foreground: #bbbbbb;--vscode-sideBar-dropBackground: rgba(83, 89, 93, .5);--vscode-sideBarSectionHeader-background: rgba(0, 0, 0, 0);--vscode-sideBarSectionHeader-border: rgba(204, 204, 204, .2);--vscode-titleBar-activeForeground: #cccccc;--vscode-titleBar-inactiveForeground: rgba(204, 204, 204, .6);--vscode-titleBar-activeBackground: #3c3c3c;--vscode-titleBar-inactiveBackground: rgba(60, 60, 60, .6);--vscode-menubar-selectionForeground: #cccccc;--vscode-menubar-selectionBackground: rgba(90, 93, 94, .31);--vscode-notifications-foreground: #cccccc;--vscode-notifications-background: #252526;--vscode-notificationLink-foreground: #3794ff;--vscode-notificationCenterHeader-background: #303031;--vscode-notifications-border: #303031;--vscode-notificationsErrorIcon-foreground: #f14c4c;--vscode-notificationsWarningIcon-foreground: #cca700;--vscode-notificationsInfoIcon-foreground: #3794ff;--vscode-commandCenter-foreground: #cccccc;--vscode-commandCenter-activeForeground: #cccccc;--vscode-commandCenter-activeBackground: rgba(90, 93, 94, .31);--vscode-commandCenter-border: rgba(128, 128, 128, .35);--vscode-editorCommentsWidget-resolvedBorder: rgba(204, 204, 204, .5);--vscode-editorCommentsWidget-unresolvedBorder: #3794ff;--vscode-editorCommentsWidget-rangeBackground: rgba(55, 148, 255, .1);--vscode-editorCommentsWidget-rangeBorder: rgba(55, 148, 255, .4);--vscode-editorCommentsWidget-rangeActiveBackground: rgba(55, 148, 255, .1);--vscode-editorCommentsWidget-rangeActiveBorder: rgba(55, 148, 255, .4);--vscode-editorGutter-commentRangeForeground: #37373d;--vscode-debugToolBar-background: #333333;--vscode-debugIcon-startForeground: #89d185;--vscode-editor-stackFrameHighlightBackground: rgba(255, 255, 0, .2);--vscode-editor-focusedStackFrameHighlightBackground: rgba(122, 189, 122, .3);--vscode-mergeEditor-change\.background: rgba(155, 185, 85, .2);--vscode-mergeEditor-change\.word\.background: rgba(156, 204, 44, .2);--vscode-mergeEditor-conflict\.unhandledUnfocused\.border: rgba(255, 166, 0, .48);--vscode-mergeEditor-conflict\.unhandledFocused\.border: #ffa600;--vscode-mergeEditor-conflict\.handledUnfocused\.border: rgba(134, 134, 134, .29);--vscode-mergeEditor-conflict\.handledFocused\.border: rgba(193, 193, 193, .8);--vscode-mergeEditor-conflict\.handled\.minimapOverViewRuler: rgba(173, 172, 168, .93);--vscode-mergeEditor-conflict\.unhandled\.minimapOverViewRuler: #fcba03;--vscode-mergeEditor-conflictingLines\.background: rgba(255, 234, 0, .28);--vscode-settings-headerForeground: #e7e7e7;--vscode-settings-modifiedItemIndicator: #0c7d9d;--vscode-settings-headerBorder: rgba(128, 128, 128, .35);--vscode-settings-sashBorder: rgba(128, 128, 128, .35);--vscode-settings-dropdownBackground: #3c3c3c;--vscode-settings-dropdownForeground: #f0f0f0;--vscode-settings-dropdownBorder: #3c3c3c;--vscode-settings-dropdownListBorder: #454545;--vscode-settings-checkboxBackground: #3c3c3c;--vscode-settings-checkboxForeground: #f0f0f0;--vscode-settings-checkboxBorder: #3c3c3c;--vscode-settings-textInputBackground: #3c3c3c;--vscode-settings-textInputForeground: #cccccc;--vscode-settings-numberInputBackground: #3c3c3c;--vscode-settings-numberInputForeground: #cccccc;--vscode-settings-focusedRowBackground: rgba(42, 45, 46, .6);--vscode-settings-rowHoverBackground: rgba(42, 45, 46, .3);--vscode-settings-focusedRowBorder: rgba(255, 255, 255, .12);--vscode-terminal-foreground: #cccccc;--vscode-terminal-selectionBackground: #264f78;--vscode-terminal-inactiveSelectionBackground: #3a3d41;--vscode-terminalCommandDecoration-defaultBackground: rgba(255, 255, 255, .25);--vscode-terminalCommandDecoration-successBackground: #1b81a8;--vscode-terminalCommandDecoration-errorBackground: #f14c4c;--vscode-terminalOverviewRuler-cursorForeground: rgba(160, 160, 160, .8);--vscode-terminal-border: rgba(128, 128, 128, .35);--vscode-terminal-findMatchBackground: #515c6a;--vscode-terminal-findMatchHighlightBackground: rgba(234, 92, 0, .33);--vscode-terminalOverviewRuler-findMatchForeground: rgba(209, 134, 22, .49);--vscode-terminal-dropBackground: rgba(83, 89, 93, .5);--vscode-testing-iconFailed: #f14c4c;--vscode-testing-iconErrored: #f14c4c;--vscode-testing-iconPassed: #73c991;--vscode-testing-runAction: #73c991;--vscode-testing-iconQueued: #cca700;--vscode-testing-iconUnset: #848484;--vscode-testing-iconSkipped: #848484;--vscode-testing-peekBorder: #f14c4c;--vscode-testing-peekHeaderBackground: rgba(241, 76, 76, .1);--vscode-testing-message\.error\.decorationForeground: #f14c4c;--vscode-testing-message\.error\.lineBackground: rgba(255, 0, 0, .2);--vscode-testing-message\.info\.decorationForeground: rgba(212, 212, 212, .5);--vscode-welcomePage-tileBackground: #252526;--vscode-welcomePage-tileHoverBackground: #2c2c2d;--vscode-welcomePage-tileShadow: rgba(0, 0, 0, .36);--vscode-welcomePage-progress\.background: #3c3c3c;--vscode-welcomePage-progress\.foreground: #3794ff;--vscode-debugExceptionWidget-border: #a31515;--vscode-debugExceptionWidget-background: #420b0d;--vscode-ports-iconRunningProcessForeground: #369432;--vscode-statusBar-debuggingBackground: #cc6633;--vscode-statusBar-debuggingForeground: #ffffff;--vscode-editor-inlineValuesForeground: rgba(255, 255, 255, .5);--vscode-editor-inlineValuesBackground: rgba(255, 200, 0, .2);--vscode-editorGutter-modifiedBackground: #1b81a8;--vscode-editorGutter-addedBackground: #487e02;--vscode-editorGutter-deletedBackground: #f14c4c;--vscode-minimapGutter-modifiedBackground: #1b81a8;--vscode-minimapGutter-addedBackground: #487e02;--vscode-minimapGutter-deletedBackground: #f14c4c;--vscode-editorOverviewRuler-modifiedForeground: rgba(27, 129, 168, .6);--vscode-editorOverviewRuler-addedForeground: rgba(72, 126, 2, .6);--vscode-editorOverviewRuler-deletedForeground: rgba(241, 76, 76, .6);--vscode-debugIcon-breakpointForeground: #e51400;--vscode-debugIcon-breakpointDisabledForeground: #848484;--vscode-debugIcon-breakpointUnverifiedForeground: #848484;--vscode-debugIcon-breakpointCurrentStackframeForeground: #ffcc00;--vscode-debugIcon-breakpointStackframeForeground: #89d185;--vscode-notebook-cellBorderColor: #37373d;--vscode-notebook-focusedEditorBorder: #007fd4;--vscode-notebookStatusSuccessIcon-foreground: #89d185;--vscode-notebookStatusErrorIcon-foreground: #f48771;--vscode-notebookStatusRunningIcon-foreground: #cccccc;--vscode-notebook-cellToolbarSeparator: rgba(128, 128, 128, .35);--vscode-notebook-selectedCellBackground: #37373d;--vscode-notebook-selectedCellBorder: #37373d;--vscode-notebook-focusedCellBorder: #007fd4;--vscode-notebook-inactiveFocusedCellBorder: #37373d;--vscode-notebook-cellStatusBarItemHoverBackground: rgba(255, 255, 255, .15);--vscode-notebook-cellInsertionIndicator: #007fd4;--vscode-notebookScrollbarSlider-background: rgba(121, 121, 121, .4);--vscode-notebookScrollbarSlider-hoverBackground: rgba(100, 100, 100, .7);--vscode-notebookScrollbarSlider-activeBackground: rgba(191, 191, 191, .4);--vscode-notebook-symbolHighlightBackground: rgba(255, 255, 255, .04);--vscode-notebook-cellEditorBackground: #252526;--vscode-notebook-editorBackground: #1e1e1e;--vscode-keybindingTable-headerBackground: rgba(204, 204, 204, .04);--vscode-keybindingTable-rowsBackground: rgba(204, 204, 204, .04);--vscode-scm-providerBorder: #454545;--vscode-debugTokenExpression-name: #c586c0;--vscode-debugTokenExpression-value: rgba(204, 204, 204, .6);--vscode-debugTokenExpression-string: #ce9178;--vscode-debugTokenExpression-boolean: #4e94ce;--vscode-debugTokenExpression-number: #b5cea8;--vscode-debugTokenExpression-error: #f48771;--vscode-debugView-exceptionLabelForeground: #cccccc;--vscode-debugView-exceptionLabelBackground: #6c2022;--vscode-debugView-stateLabelForeground: #cccccc;--vscode-debugView-stateLabelBackground: rgba(136, 136, 136, .27);--vscode-debugView-valueChangedHighlight: #569cd6;--vscode-debugConsole-infoForeground: #3794ff;--vscode-debugConsole-warningForeground: #cca700;--vscode-debugConsole-errorForeground: #f48771;--vscode-debugConsole-sourceForeground: #cccccc;--vscode-debugConsoleInputIcon-foreground: #cccccc;--vscode-debugIcon-pauseForeground: #75beff;--vscode-debugIcon-stopForeground: #f48771;--vscode-debugIcon-disconnectForeground: #f48771;--vscode-debugIcon-restartForeground: #89d185;--vscode-debugIcon-stepOverForeground: #75beff;--vscode-debugIcon-stepIntoForeground: #75beff;--vscode-debugIcon-stepOutForeground: #75beff;--vscode-debugIcon-continueForeground: #75beff;--vscode-debugIcon-stepBackForeground: #75beff;--vscode-extensionButton-prominentBackground: #0e639c;--vscode-extensionButton-prominentForeground: #ffffff;--vscode-extensionButton-prominentHoverBackground: #1177bb;--vscode-extensionIcon-starForeground: #ff8e00;--vscode-extensionIcon-verifiedForeground: #3794ff;--vscode-extensionIcon-preReleaseForeground: #1d9271;--vscode-extensionIcon-sponsorForeground: #d758b3;--vscode-terminal-ansiBlack: #000000;--vscode-terminal-ansiRed: #cd3131;--vscode-terminal-ansiGreen: #0dbc79;--vscode-terminal-ansiYellow: #e5e510;--vscode-terminal-ansiBlue: #2472c8;--vscode-terminal-ansiMagenta: #bc3fbc;--vscode-terminal-ansiCyan: #11a8cd;--vscode-terminal-ansiWhite: #e5e5e5;--vscode-terminal-ansiBrightBlack: #666666;--vscode-terminal-ansiBrightRed: #f14c4c;--vscode-terminal-ansiBrightGreen: #23d18b;--vscode-terminal-ansiBrightYellow: #f5f543;--vscode-terminal-ansiBrightBlue: #3b8eea;--vscode-terminal-ansiBrightMagenta: #d670d6;--vscode-terminal-ansiBrightCyan: #29b8db;--vscode-terminal-ansiBrightWhite: #e5e5e5;--vscode-interactive-activeCodeBorder: #3794ff;--vscode-interactive-inactiveCodeBorder: #37373d;--vscode-gitDecoration-addedResourceForeground: #81b88b;--vscode-gitDecoration-modifiedResourceForeground: #e2c08d;--vscode-gitDecoration-deletedResourceForeground: #c74e39;--vscode-gitDecoration-renamedResourceForeground: #73c991;--vscode-gitDecoration-untrackedResourceForeground: #73c991;--vscode-gitDecoration-ignoredResourceForeground: #8c8c8c;--vscode-gitDecoration-stageModifiedResourceForeground: #e2c08d;--vscode-gitDecoration-stageDeletedResourceForeground: #c74e39;--vscode-gitDecoration-conflictingResourceForeground: #e4676b;--vscode-gitDecoration-submoduleResourceForeground: #8db9e2}.test-error-container{position:relative;white-space:pre;flex:none;padding:0;background-color:var(--color-canvas-subtle);border-radius:6px;line-height:initial;margin-bottom:6px}.test-error-view{overflow:auto;padding:16px}.test-error-text{font-family:monospace}.test-result{flex:auto;display:flex;flex-direction:column;margin-bottom:24px}.test-result>div{flex:none}.test-result video,.test-result img.screenshot{flex:none;box-shadow:var(--box-shadow-thick);margin:24px auto;min-width:200px;max-width:80%}.test-result-path{padding:0 0 0 5px;color:var(--color-fg-muted)}.test-result-counter{border-radius:12px;color:var(--color-canvas-default);padding:2px 8px;line-height:normal}.step-title-container{display:flex;align-items:center;flex:auto;min-width:0}.step-title-container>*{flex-shrink:0}.step-title-text{flex-shrink:1;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;min-width:0}.step-title-highlight{background:var(--color-attention-subtle)}.step-spacer{flex:auto}.step-attachment-link{display:flex;flex:none;border-radius:4px;padding:4px}.step-attachment-link:hover{background-color:var(--color-neutral-muted)}.step-attachment-link .octicon{margin-right:0}.step-indirect-attachment-indicator{display:flex;flex:none;padding:4px;opacity:.5}.step-indirect-attachment-indicator .octicon{margin-right:0}.step-duration{flex:none;white-space:nowrap;margin-left:4px}:root.light-mode .test-result-counter{background:var(--color-scale-gray-5)}:root.dark-mode .test-result-counter{background:var(--color-scale-gray-3)}.step-filter{margin-bottom:8px}@media only screen and (max-width: 600px){.test-result{padding:0!important}}.test-file-test{line-height:32px;align-items:center;padding:2px 8px;overflow:hidden;text-overflow:ellipsis}.test-file-test-selected,.test-file-test:hover{background-color:var(--color-canvas-subtle)}.test-file-title{font-weight:600;font-size:16px}.test-file-details-row{padding:0 0 6px 8px;margin:0 0 0 15px;line-height:16px;font-weight:400;color:var(--color-fg-muted);display:flex;align-items:center}.test-file-details-row-items{display:flex;height:16px}.test-file-details-row-items>.link-badge{margin-top:-2px}.test-file-details-row-items>.trace-link{margin-top:-4px}.test-file-path{text-overflow:ellipsis;overflow:hidden;color:var(--color-fg-muted)}.test-file-path-link{margin-right:10px}.test-file-test-outcome-skipped{color:var(--color-fg-muted)}.test-file-test-status-icon{flex:none}.test-file-header-info{display:flex;align-items:center;gap:4px 8px;color:var(--color-fg-muted)}.test-file-header-br{flex-basis:100%;height:0}.test-file-no-files{margin-top:12px;color:var(--color-fg-muted);background-color:unset;font-weight:unset;border:1px solid var(--color-border-default);border-bottom-left-radius:6px;border-bottom-right-radius:6px}#root{color:var(--color-fg-default);font-size:14px;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";-webkit-font-smoothing:antialiased}.metadata-toggle{cursor:pointer;-webkit-user-select:none;user-select:none;color:var(--color-fg-default)}.metadata-toggle-second-line{margin-top:8px;margin-left:8px}.metadata-view{border:1px solid var(--color-border-default);border-radius:6px;margin-top:12px}.metadata-view .metadata-section{margin:8px 10px 8px 32px}.metadata-view span:not(.copy-button-container),.metadata-view a{display:inline-block;line-height:24px}.metadata-properties{display:flex;flex-direction:column;align-items:normal;gap:8px}.metadata-properties>div{height:24px}.metadata-separator{height:1px;border-bottom:1px solid var(--color-border-default)}.metadata-view a{color:var(--color-fg-default)}.copyable-property{white-space:pre}.copyable-property>span{display:flex;align-items:center}.gantt-bar{transition:opacity .2s;cursor:pointer;outline:none}.gantt-bar:hover,.gantt-bar:focus{opacity:.8;stroke:var(--color-fg-default);stroke-width:2}
(function(){const u=document.createElement("link").relList;if(u&&u.supports&&u.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))f(r);new MutationObserver(r=>{for(const o of r)if(o.type==="childList")for(const h of o.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&f(h)}).observe(document,{childList:!0,subtree:!0});function c(r){const o={};return r.integrity&&(o.integrity=r.integrity),r.referrerPolicy&&(o.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?o.credentials="include":r.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function f(r){if(r.ep)return;r.ep=!0;const o=c(r);fetch(r.href,o)}})();function EA(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var Of={exports:{}},vi={};/**
 * @license React
 * react-jsx-runtime.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var y1;function pA(){if(y1)return vi;y1=1;var i=Symbol.for("react.transitional.element"),u=Symbol.for("react.fragment");function c(f,r,o){var h=null;if(o!==void 0&&(h=""+o),r.key!==void 0&&(h=""+r.key),"key"in r){o={};for(var v in r)v!=="key"&&(o[v]=r[v])}else o=r;return r=o.ref,{$$typeof:i,type:f,key:h,ref:r!==void 0?r:null,props:o}}return vi.Fragment=u,vi.jsx=c,vi.jsxs=c,vi}var E1;function xA(){return E1||(E1=1,Of.exports=pA()),Of.exports}var m=xA();const bA=15,bt=0,En=1,SA=2,ye=-2,Ut=-3,p1=-4,pn=-5,Me=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535],w2=1440,TA=0,CA=4,OA=9,DA=5,RA=[96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,192,80,7,10,0,8,96,0,8,32,0,9,160,0,8,0,0,8,128,0,8,64,0,9,224,80,7,6,0,8,88,0,8,24,0,9,144,83,7,59,0,8,120,0,8,56,0,9,208,81,7,17,0,8,104,0,8,40,0,9,176,0,8,8,0,8,136,0,8,72,0,9,240,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,200,81,7,13,0,8,100,0,8,36,0,9,168,0,8,4,0,8,132,0,8,68,0,9,232,80,7,8,0,8,92,0,8,28,0,9,152,84,7,83,0,8,124,0,8,60,0,9,216,82,7,23,0,8,108,0,8,44,0,9,184,0,8,12,0,8,140,0,8,76,0,9,248,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,196,81,7,11,0,8,98,0,8,34,0,9,164,0,8,2,0,8,130,0,8,66,0,9,228,80,7,7,0,8,90,0,8,26,0,9,148,84,7,67,0,8,122,0,8,58,0,9,212,82,7,19,0,8,106,0,8,42,0,9,180,0,8,10,0,8,138,0,8,74,0,9,244,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,204,81,7,15,0,8,102,0,8,38,0,9,172,0,8,6,0,8,134,0,8,70,0,9,236,80,7,9,0,8,94,0,8,30,0,9,156,84,7,99,0,8,126,0,8,62,0,9,220,82,7,27,0,8,110,0,8,46,0,9,188,0,8,14,0,8,142,0,8,78,0,9,252,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,194,80,7,10,0,8,97,0,8,33,0,9,162,0,8,1,0,8,129,0,8,65,0,9,226,80,7,6,0,8,89,0,8,25,0,9,146,83,7,59,0,8,121,0,8,57,0,9,210,81,7,17,0,8,105,0,8,41,0,9,178,0,8,9,0,8,137,0,8,73,0,9,242,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,202,81,7,13,0,8,101,0,8,37,0,9,170,0,8,5,0,8,133,0,8,69,0,9,234,80,7,8,0,8,93,0,8,29,0,9,154,84,7,83,0,8,125,0,8,61,0,9,218,82,7,23,0,8,109,0,8,45,0,9,186,0,8,13,0,8,141,0,8,77,0,9,250,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,198,81,7,11,0,8,99,0,8,35,0,9,166,0,8,3,0,8,131,0,8,67,0,9,230,80,7,7,0,8,91,0,8,27,0,9,150,84,7,67,0,8,123,0,8,59,0,9,214,82,7,19,0,8,107,0,8,43,0,9,182,0,8,11,0,8,139,0,8,75,0,9,246,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,206,81,7,15,0,8,103,0,8,39,0,9,174,0,8,7,0,8,135,0,8,71,0,9,238,80,7,9,0,8,95,0,8,31,0,9,158,84,7,99,0,8,127,0,8,63,0,9,222,82,7,27,0,8,111,0,8,47,0,9,190,0,8,15,0,8,143,0,8,79,0,9,254,96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,193,80,7,10,0,8,96,0,8,32,0,9,161,0,8,0,0,8,128,0,8,64,0,9,225,80,7,6,0,8,88,0,8,24,0,9,145,83,7,59,0,8,120,0,8,56,0,9,209,81,7,17,0,8,104,0,8,40,0,9,177,0,8,8,0,8,136,0,8,72,0,9,241,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,201,81,7,13,0,8,100,0,8,36,0,9,169,0,8,4,0,8,132,0,8,68,0,9,233,80,7,8,0,8,92,0,8,28,0,9,153,84,7,83,0,8,124,0,8,60,0,9,217,82,7,23,0,8,108,0,8,44,0,9,185,0,8,12,0,8,140,0,8,76,0,9,249,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,197,81,7,11,0,8,98,0,8,34,0,9,165,0,8,2,0,8,130,0,8,66,0,9,229,80,7,7,0,8,90,0,8,26,0,9,149,84,7,67,0,8,122,0,8,58,0,9,213,82,7,19,0,8,106,0,8,42,0,9,181,0,8,10,0,8,138,0,8,74,0,9,245,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,205,81,7,15,0,8,102,0,8,38,0,9,173,0,8,6,0,8,134,0,8,70,0,9,237,80,7,9,0,8,94,0,8,30,0,9,157,84,7,99,0,8,126,0,8,62,0,9,221,82,7,27,0,8,110,0,8,46,0,9,189,0,8,14,0,8,142,0,8,78,0,9,253,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,195,80,7,10,0,8,97,0,8,33,0,9,163,0,8,1,0,8,129,0,8,65,0,9,227,80,7,6,0,8,89,0,8,25,0,9,147,83,7,59,0,8,121,0,8,57,0,9,211,81,7,17,0,8,105,0,8,41,0,9,179,0,8,9,0,8,137,0,8,73,0,9,243,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,203,81,7,13,0,8,101,0,8,37,0,9,171,0,8,5,0,8,133,0,8,69,0,9,235,80,7,8,0,8,93,0,8,29,0,9,155,84,7,83,0,8,125,0,8,61,0,9,219,82,7,23,0,8,109,0,8,45,0,9,187,0,8,13,0,8,141,0,8,77,0,9,251,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,199,81,7,11,0,8,99,0,8,35,0,9,167,0,8,3,0,8,131,0,8,67,0,9,231,80,7,7,0,8,91,0,8,27,0,9,151,84,7,67,0,8,123,0,8,59,0,9,215,82,7,19,0,8,107,0,8,43,0,9,183,0,8,11,0,8,139,0,8,75,0,9,247,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,207,81,7,15,0,8,103,0,8,39,0,9,175,0,8,7,0,8,135,0,8,71,0,9,239,80,7,9,0,8,95,0,8,31,0,9,159,84,7,99,0,8,127,0,8,63,0,9,223,82,7,27,0,8,111,0,8,47,0,9,191,0,8,15,0,8,143,0,8,79,0,9,255],wA=[80,5,1,87,5,257,83,5,17,91,5,4097,81,5,5,89,5,1025,85,5,65,93,5,16385,80,5,3,88,5,513,84,5,33,92,5,8193,82,5,9,90,5,2049,86,5,129,192,5,24577,80,5,2,87,5,385,83,5,25,91,5,6145,81,5,7,89,5,1537,85,5,97,93,5,24577,80,5,4,88,5,769,84,5,49,92,5,12289,82,5,13,90,5,3073,86,5,193,192,5,24577],MA=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],jA=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,112,112],NA=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],HA=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],_n=15;function qf(){const i=this;let u,c,f,r,o,h;function v(A,x,T,D,X,q,p,E,b,R,N){let V,F,H,j,Y,z,I,k,nt,P,st,ut,M,_,$;P=0,Y=T;do f[A[x+P]]++,P++,Y--;while(Y!==0);if(f[0]==T)return p[0]=-1,E[0]=0,bt;for(k=E[0],z=1;z<=_n&&f[z]===0;z++);for(I=z,k<z&&(k=z),Y=_n;Y!==0&&f[Y]===0;Y--);for(H=Y,k>Y&&(k=Y),E[0]=k,_=1<<z;z<Y;z++,_<<=1)if((_-=f[z])<0)return Ut;if((_-=f[Y])<0)return Ut;for(f[Y]+=_,h[1]=z=0,P=1,M=2;--Y!==0;)h[M]=z+=f[P],M++,P++;Y=0,P=0;do(z=A[x+P])!==0&&(N[h[z]++]=Y),P++;while(++Y<T);for(T=h[H],h[0]=Y=0,P=0,j=-1,ut=-k,o[0]=0,st=0,$=0;I<=H;I++)for(V=f[I];V--!==0;){for(;I>ut+k;){if(j++,ut+=k,$=H-ut,$=$>k?k:$,(F=1<<(z=I-ut))>V+1&&(F-=V+1,M=I,z<$))for(;++z<$&&!((F<<=1)<=f[++M]);)F-=f[M];if($=1<<z,R[0]+$>w2)return Ut;o[j]=st=R[0],R[0]+=$,j!==0?(h[j]=Y,r[0]=z,r[1]=k,z=Y>>>ut-k,r[2]=st-o[j-1]-z,b.set(r,(o[j-1]+z)*3)):p[0]=st}for(r[1]=I-ut,P>=T?r[0]=192:N[P]<D?(r[0]=N[P]<256?0:96,r[2]=N[P++]):(r[0]=q[N[P]-D]+16+64,r[2]=X[N[P++]-D]),F=1<<I-ut,z=Y>>>ut;z<$;z+=F)b.set(r,(st+z)*3);for(z=1<<I-1;(Y&z)!==0;z>>>=1)Y^=z;for(Y^=z,nt=(1<<ut)-1;(Y&nt)!=h[j];)j--,ut-=k,nt=(1<<ut)-1}return _!==0&&H!=1?pn:bt}function y(A){let x;for(u||(u=[],c=[],f=new Int32Array(_n+1),r=[],o=new Int32Array(_n),h=new Int32Array(_n+1)),c.length<A&&(c=[]),x=0;x<A;x++)c[x]=0;for(x=0;x<_n+1;x++)f[x]=0;for(x=0;x<3;x++)r[x]=0;o.set(f.subarray(0,_n),0),h.set(f.subarray(0,_n+1),0)}i.inflate_trees_bits=function(A,x,T,D,X){let q;return y(19),u[0]=0,q=v(A,0,19,19,null,null,T,x,D,u,c),q==Ut?X.msg="oversubscribed dynamic bit lengths tree":(q==pn||x[0]===0)&&(X.msg="incomplete dynamic bit lengths tree",q=Ut),q},i.inflate_trees_dynamic=function(A,x,T,D,X,q,p,E,b){let R;return y(288),u[0]=0,R=v(T,0,A,257,MA,jA,q,D,E,u,c),R!=bt||D[0]===0?(R==Ut?b.msg="oversubscribed literal/length tree":R!=p1&&(b.msg="incomplete literal/length tree",R=Ut),R):(y(288),R=v(T,A,x,0,NA,HA,p,X,E,u,c),R!=bt||X[0]===0&&A>257?(R==Ut?b.msg="oversubscribed distance tree":R==pn?(b.msg="incomplete distance tree",R=Ut):R!=p1&&(b.msg="empty distance tree with lengths",R=Ut),R):bt)}}qf.inflate_trees_fixed=function(i,u,c,f){return i[0]=OA,u[0]=DA,c[0]=RA,f[0]=wA,bt};const Fu=0,x1=1,b1=2,S1=3,T1=4,C1=5,O1=6,Df=7,D1=8,Wu=9;function BA(){const i=this;let u,c=0,f,r=0,o=0,h=0,v=0,y=0,A=0,x=0,T,D=0,X,q=0;function p(E,b,R,N,V,F,H,j){let Y,z,I,k,nt,P,st,ut,M,_,$,ht,tt,C,L,W;st=j.next_in_index,ut=j.avail_in,nt=H.bitb,P=H.bitk,M=H.write,_=M<H.read?H.read-M-1:H.end-M,$=Me[E],ht=Me[b];do{for(;P<20;)ut--,nt|=(j.read_byte(st++)&255)<<P,P+=8;if(Y=nt&$,z=R,I=N,W=(I+Y)*3,(k=z[W])===0){nt>>=z[W+1],P-=z[W+1],H.win[M++]=z[W+2],_--;continue}do{if(nt>>=z[W+1],P-=z[W+1],(k&16)!==0){for(k&=15,tt=z[W+2]+(nt&Me[k]),nt>>=k,P-=k;P<15;)ut--,nt|=(j.read_byte(st++)&255)<<P,P+=8;Y=nt&ht,z=V,I=F,W=(I+Y)*3,k=z[W];do if(nt>>=z[W+1],P-=z[W+1],(k&16)!==0){for(k&=15;P<k;)ut--,nt|=(j.read_byte(st++)&255)<<P,P+=8;if(C=z[W+2]+(nt&Me[k]),nt>>=k,P-=k,_-=tt,M>=C)L=M-C,M-L>0&&2>M-L?(H.win[M++]=H.win[L++],H.win[M++]=H.win[L++],tt-=2):(H.win.set(H.win.subarray(L,L+2),M),M+=2,L+=2,tt-=2);else{L=M-C;do L+=H.end;while(L<0);if(k=H.end-L,tt>k){if(tt-=k,M-L>0&&k>M-L)do H.win[M++]=H.win[L++];while(--k!==0);else H.win.set(H.win.subarray(L,L+k),M),M+=k,L+=k,k=0;L=0}}if(M-L>0&&tt>M-L)do H.win[M++]=H.win[L++];while(--tt!==0);else H.win.set(H.win.subarray(L,L+tt),M),M+=tt,L+=tt,tt=0;break}else if((k&64)===0)Y+=z[W+2],Y+=nt&Me[k],W=(I+Y)*3,k=z[W];else return j.msg="invalid distance code",tt=j.avail_in-ut,tt=P>>3<tt?P>>3:tt,ut+=tt,st-=tt,P-=tt<<3,H.bitb=nt,H.bitk=P,j.avail_in=ut,j.total_in+=st-j.next_in_index,j.next_in_index=st,H.write=M,Ut;while(!0);break}if((k&64)===0){if(Y+=z[W+2],Y+=nt&Me[k],W=(I+Y)*3,(k=z[W])===0){nt>>=z[W+1],P-=z[W+1],H.win[M++]=z[W+2],_--;break}}else return(k&32)!==0?(tt=j.avail_in-ut,tt=P>>3<tt?P>>3:tt,ut+=tt,st-=tt,P-=tt<<3,H.bitb=nt,H.bitk=P,j.avail_in=ut,j.total_in+=st-j.next_in_index,j.next_in_index=st,H.write=M,En):(j.msg="invalid literal/length code",tt=j.avail_in-ut,tt=P>>3<tt?P>>3:tt,ut+=tt,st-=tt,P-=tt<<3,H.bitb=nt,H.bitk=P,j.avail_in=ut,j.total_in+=st-j.next_in_index,j.next_in_index=st,H.write=M,Ut)}while(!0)}while(_>=258&&ut>=10);return tt=j.avail_in-ut,tt=P>>3<tt?P>>3:tt,ut+=tt,st-=tt,P-=tt<<3,H.bitb=nt,H.bitk=P,j.avail_in=ut,j.total_in+=st-j.next_in_index,j.next_in_index=st,H.write=M,bt}i.init=function(E,b,R,N,V,F){u=Fu,A=E,x=b,T=R,D=N,X=V,q=F,f=null},i.proc=function(E,b,R){let N,V,F,H=0,j=0,Y=0,z,I,k,nt;for(Y=b.next_in_index,z=b.avail_in,H=E.bitb,j=E.bitk,I=E.write,k=I<E.read?E.read-I-1:E.end-I;;)switch(u){case Fu:if(k>=258&&z>=10&&(E.bitb=H,E.bitk=j,b.avail_in=z,b.total_in+=Y-b.next_in_index,b.next_in_index=Y,E.write=I,R=p(A,x,T,D,X,q,E,b),Y=b.next_in_index,z=b.avail_in,H=E.bitb,j=E.bitk,I=E.write,k=I<E.read?E.read-I-1:E.end-I,R!=bt)){u=R==En?Df:Wu;break}o=A,f=T,r=D,u=x1;case x1:for(N=o;j<N;){if(z!==0)R=bt;else return E.bitb=H,E.bitk=j,b.avail_in=z,b.total_in+=Y-b.next_in_index,b.next_in_index=Y,E.write=I,E.inflate_flush(b,R);z--,H|=(b.read_byte(Y++)&255)<<j,j+=8}if(V=(r+(H&Me[N]))*3,H>>>=f[V+1],j-=f[V+1],F=f[V],F===0){h=f[V+2],u=O1;break}if((F&16)!==0){v=F&15,c=f[V+2],u=b1;break}if((F&64)===0){o=F,r=V/3+f[V+2];break}if((F&32)!==0){u=Df;break}return u=Wu,b.msg="invalid literal/length code",R=Ut,E.bitb=H,E.bitk=j,b.avail_in=z,b.total_in+=Y-b.next_in_index,b.next_in_index=Y,E.write=I,E.inflate_flush(b,R);case b1:for(N=v;j<N;){if(z!==0)R=bt;else return E.bitb=H,E.bitk=j,b.avail_in=z,b.total_in+=Y-b.next_in_index,b.next_in_index=Y,E.write=I,E.inflate_flush(b,R);z--,H|=(b.read_byte(Y++)&255)<<j,j+=8}c+=H&Me[N],H>>=N,j-=N,o=x,f=X,r=q,u=S1;case S1:for(N=o;j<N;){if(z!==0)R=bt;else return E.bitb=H,E.bitk=j,b.avail_in=z,b.total_in+=Y-b.next_in_index,b.next_in_index=Y,E.write=I,E.inflate_flush(b,R);z--,H|=(b.read_byte(Y++)&255)<<j,j+=8}if(V=(r+(H&Me[N]))*3,H>>=f[V+1],j-=f[V+1],F=f[V],(F&16)!==0){v=F&15,y=f[V+2],u=T1;break}if((F&64)===0){o=F,r=V/3+f[V+2];break}return u=Wu,b.msg="invalid distance code",R=Ut,E.bitb=H,E.bitk=j,b.avail_in=z,b.total_in+=Y-b.next_in_index,b.next_in_index=Y,E.write=I,E.inflate_flush(b,R);case T1:for(N=v;j<N;){if(z!==0)R=bt;else return E.bitb=H,E.bitk=j,b.avail_in=z,b.total_in+=Y-b.next_in_index,b.next_in_index=Y,E.write=I,E.inflate_flush(b,R);z--,H|=(b.read_byte(Y++)&255)<<j,j+=8}y+=H&Me[N],H>>=N,j-=N,u=C1;case C1:for(nt=I-y;nt<0;)nt+=E.end;for(;c!==0;){if(k===0&&(I==E.end&&E.read!==0&&(I=0,k=I<E.read?E.read-I-1:E.end-I),k===0&&(E.write=I,R=E.inflate_flush(b,R),I=E.write,k=I<E.read?E.read-I-1:E.end-I,I==E.end&&E.read!==0&&(I=0,k=I<E.read?E.read-I-1:E.end-I),k===0)))return E.bitb=H,E.bitk=j,b.avail_in=z,b.total_in+=Y-b.next_in_index,b.next_in_index=Y,E.write=I,E.inflate_flush(b,R);E.win[I++]=E.win[nt++],k--,nt==E.end&&(nt=0),c--}u=Fu;break;case O1:if(k===0&&(I==E.end&&E.read!==0&&(I=0,k=I<E.read?E.read-I-1:E.end-I),k===0&&(E.write=I,R=E.inflate_flush(b,R),I=E.write,k=I<E.read?E.read-I-1:E.end-I,I==E.end&&E.read!==0&&(I=0,k=I<E.read?E.read-I-1:E.end-I),k===0)))return E.bitb=H,E.bitk=j,b.avail_in=z,b.total_in+=Y-b.next_in_index,b.next_in_index=Y,E.write=I,E.inflate_flush(b,R);R=bt,E.win[I++]=h,k--,u=Fu;break;case Df:if(j>7&&(j-=8,z++,Y--),E.write=I,R=E.inflate_flush(b,R),I=E.write,k=I<E.read?E.read-I-1:E.end-I,E.read!=E.write)return E.bitb=H,E.bitk=j,b.avail_in=z,b.total_in+=Y-b.next_in_index,b.next_in_index=Y,E.write=I,E.inflate_flush(b,R);u=D1;case D1:return R=En,E.bitb=H,E.bitk=j,b.avail_in=z,b.total_in+=Y-b.next_in_index,b.next_in_index=Y,E.write=I,E.inflate_flush(b,R);case Wu:return R=Ut,E.bitb=H,E.bitk=j,b.avail_in=z,b.total_in+=Y-b.next_in_index,b.next_in_index=Y,E.write=I,E.inflate_flush(b,R);default:return R=ye,E.bitb=H,E.bitk=j,b.avail_in=z,b.total_in+=Y-b.next_in_index,b.next_in_index=Y,E.write=I,E.inflate_flush(b,R)}},i.free=function(){}}const R1=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],ya=0,Rf=1,w1=2,M1=3,j1=4,N1=5,_u=6,Pu=7,H1=8,Cl=9;function UA(i,u){const c=this;let f=ya,r=0,o=0,h=0,v;const y=[0],A=[0],x=new BA;let T=0,D=new Int32Array(w2*3);const X=0,q=new qf;c.bitk=0,c.bitb=0,c.win=new Uint8Array(u),c.end=u,c.read=0,c.write=0,c.reset=function(p,E){E&&(E[0]=X),f==_u&&x.free(p),f=ya,c.bitk=0,c.bitb=0,c.read=c.write=0},c.reset(i,null),c.inflate_flush=function(p,E){let b,R,N;return R=p.next_out_index,N=c.read,b=(N<=c.write?c.write:c.end)-N,b>p.avail_out&&(b=p.avail_out),b!==0&&E==pn&&(E=bt),p.avail_out-=b,p.total_out+=b,p.next_out.set(c.win.subarray(N,N+b),R),R+=b,N+=b,N==c.end&&(N=0,c.write==c.end&&(c.write=0),b=c.write-N,b>p.avail_out&&(b=p.avail_out),b!==0&&E==pn&&(E=bt),p.avail_out-=b,p.total_out+=b,p.next_out.set(c.win.subarray(N,N+b),R),R+=b,N+=b),p.next_out_index=R,c.read=N,E},c.proc=function(p,E){let b,R,N,V,F,H,j,Y;for(V=p.next_in_index,F=p.avail_in,R=c.bitb,N=c.bitk,H=c.write,j=H<c.read?c.read-H-1:c.end-H;;){let z,I,k,nt,P,st,ut,M;switch(f){case ya:for(;N<3;){if(F!==0)E=bt;else return c.bitb=R,c.bitk=N,p.avail_in=F,p.total_in+=V-p.next_in_index,p.next_in_index=V,c.write=H,c.inflate_flush(p,E);F--,R|=(p.read_byte(V++)&255)<<N,N+=8}switch(b=R&7,T=b&1,b>>>1){case 0:R>>>=3,N-=3,b=N&7,R>>>=b,N-=b,f=Rf;break;case 1:z=[],I=[],k=[[]],nt=[[]],qf.inflate_trees_fixed(z,I,k,nt),x.init(z[0],I[0],k[0],0,nt[0],0),R>>>=3,N-=3,f=_u;break;case 2:R>>>=3,N-=3,f=M1;break;case 3:return R>>>=3,N-=3,f=Cl,p.msg="invalid block type",E=Ut,c.bitb=R,c.bitk=N,p.avail_in=F,p.total_in+=V-p.next_in_index,p.next_in_index=V,c.write=H,c.inflate_flush(p,E)}break;case Rf:for(;N<32;){if(F!==0)E=bt;else return c.bitb=R,c.bitk=N,p.avail_in=F,p.total_in+=V-p.next_in_index,p.next_in_index=V,c.write=H,c.inflate_flush(p,E);F--,R|=(p.read_byte(V++)&255)<<N,N+=8}if((~R>>>16&65535)!=(R&65535))return f=Cl,p.msg="invalid stored block lengths",E=Ut,c.bitb=R,c.bitk=N,p.avail_in=F,p.total_in+=V-p.next_in_index,p.next_in_index=V,c.write=H,c.inflate_flush(p,E);r=R&65535,R=N=0,f=r!==0?w1:T!==0?Pu:ya;break;case w1:if(F===0||j===0&&(H==c.end&&c.read!==0&&(H=0,j=H<c.read?c.read-H-1:c.end-H),j===0&&(c.write=H,E=c.inflate_flush(p,E),H=c.write,j=H<c.read?c.read-H-1:c.end-H,H==c.end&&c.read!==0&&(H=0,j=H<c.read?c.read-H-1:c.end-H),j===0)))return c.bitb=R,c.bitk=N,p.avail_in=F,p.total_in+=V-p.next_in_index,p.next_in_index=V,c.write=H,c.inflate_flush(p,E);if(E=bt,b=r,b>F&&(b=F),b>j&&(b=j),c.win.set(p.read_buf(V,b),H),V+=b,F-=b,H+=b,j-=b,(r-=b)!==0)break;f=T!==0?Pu:ya;break;case M1:for(;N<14;){if(F!==0)E=bt;else return c.bitb=R,c.bitk=N,p.avail_in=F,p.total_in+=V-p.next_in_index,p.next_in_index=V,c.write=H,c.inflate_flush(p,E);F--,R|=(p.read_byte(V++)&255)<<N,N+=8}if(o=b=R&16383,(b&31)>29||(b>>5&31)>29)return f=Cl,p.msg="too many length or distance symbols",E=Ut,c.bitb=R,c.bitk=N,p.avail_in=F,p.total_in+=V-p.next_in_index,p.next_in_index=V,c.write=H,c.inflate_flush(p,E);if(b=258+(b&31)+(b>>5&31),!v||v.length<b)v=[];else for(Y=0;Y<b;Y++)v[Y]=0;R>>>=14,N-=14,h=0,f=j1;case j1:for(;h<4+(o>>>10);){for(;N<3;){if(F!==0)E=bt;else return c.bitb=R,c.bitk=N,p.avail_in=F,p.total_in+=V-p.next_in_index,p.next_in_index=V,c.write=H,c.inflate_flush(p,E);F--,R|=(p.read_byte(V++)&255)<<N,N+=8}v[R1[h++]]=R&7,R>>>=3,N-=3}for(;h<19;)v[R1[h++]]=0;if(y[0]=7,b=q.inflate_trees_bits(v,y,A,D,p),b!=bt)return E=b,E==Ut&&(v=null,f=Cl),c.bitb=R,c.bitk=N,p.avail_in=F,p.total_in+=V-p.next_in_index,p.next_in_index=V,c.write=H,c.inflate_flush(p,E);h=0,f=N1;case N1:for(;b=o,!(h>=258+(b&31)+(b>>5&31));){let _,$;for(b=y[0];N<b;){if(F!==0)E=bt;else return c.bitb=R,c.bitk=N,p.avail_in=F,p.total_in+=V-p.next_in_index,p.next_in_index=V,c.write=H,c.inflate_flush(p,E);F--,R|=(p.read_byte(V++)&255)<<N,N+=8}if(b=D[(A[0]+(R&Me[b]))*3+1],$=D[(A[0]+(R&Me[b]))*3+2],$<16)R>>>=b,N-=b,v[h++]=$;else{for(Y=$==18?7:$-14,_=$==18?11:3;N<b+Y;){if(F!==0)E=bt;else return c.bitb=R,c.bitk=N,p.avail_in=F,p.total_in+=V-p.next_in_index,p.next_in_index=V,c.write=H,c.inflate_flush(p,E);F--,R|=(p.read_byte(V++)&255)<<N,N+=8}if(R>>>=b,N-=b,_+=R&Me[Y],R>>>=Y,N-=Y,Y=h,b=o,Y+_>258+(b&31)+(b>>5&31)||$==16&&Y<1)return v=null,f=Cl,p.msg="invalid bit length repeat",E=Ut,c.bitb=R,c.bitk=N,p.avail_in=F,p.total_in+=V-p.next_in_index,p.next_in_index=V,c.write=H,c.inflate_flush(p,E);$=$==16?v[Y-1]:0;do v[Y++]=$;while(--_!==0);h=Y}}if(A[0]=-1,P=[],st=[],ut=[],M=[],P[0]=9,st[0]=6,b=o,b=q.inflate_trees_dynamic(257+(b&31),1+(b>>5&31),v,P,st,ut,M,D,p),b!=bt)return b==Ut&&(v=null,f=Cl),E=b,c.bitb=R,c.bitk=N,p.avail_in=F,p.total_in+=V-p.next_in_index,p.next_in_index=V,c.write=H,c.inflate_flush(p,E);x.init(P[0],st[0],D,ut[0],D,M[0]),f=_u;case _u:if(c.bitb=R,c.bitk=N,p.avail_in=F,p.total_in+=V-p.next_in_index,p.next_in_index=V,c.write=H,(E=x.proc(c,p,E))!=En)return c.inflate_flush(p,E);if(E=bt,x.free(p),V=p.next_in_index,F=p.avail_in,R=c.bitb,N=c.bitk,H=c.write,j=H<c.read?c.read-H-1:c.end-H,T===0){f=ya;break}f=Pu;case Pu:if(c.write=H,E=c.inflate_flush(p,E),H=c.write,j=H<c.read?c.read-H-1:c.end-H,c.read!=c.write)return c.bitb=R,c.bitk=N,p.avail_in=F,p.total_in+=V-p.next_in_index,p.next_in_index=V,c.write=H,c.inflate_flush(p,E);f=H1;case H1:return E=En,c.bitb=R,c.bitk=N,p.avail_in=F,p.total_in+=V-p.next_in_index,p.next_in_index=V,c.write=H,c.inflate_flush(p,E);case Cl:return E=Ut,c.bitb=R,c.bitk=N,p.avail_in=F,p.total_in+=V-p.next_in_index,p.next_in_index=V,c.write=H,c.inflate_flush(p,E);default:return E=ye,c.bitb=R,c.bitk=N,p.avail_in=F,p.total_in+=V-p.next_in_index,p.next_in_index=V,c.write=H,c.inflate_flush(p,E)}}},c.free=function(p){c.reset(p,null),c.win=null,D=null},c.set_dictionary=function(p,E,b){c.win.set(p.subarray(E,E+b),0),c.read=c.write=b},c.sync_point=function(){return f==Rf?1:0}}const QA=32,zA=8,YA=0,B1=1,U1=2,Q1=3,z1=4,Y1=5,wf=6,yi=7,L1=12,Pn=13,LA=[0,0,255,255];function GA(){const i=this;i.mode=0,i.method=0,i.was=[0],i.need=0,i.marker=0,i.wbits=0;function u(c){return!c||!c.istate?ye:(c.total_in=c.total_out=0,c.msg=null,c.istate.mode=yi,c.istate.blocks.reset(c,null),bt)}i.inflateEnd=function(c){return i.blocks&&i.blocks.free(c),i.blocks=null,bt},i.inflateInit=function(c,f){return c.msg=null,i.blocks=null,f<8||f>15?(i.inflateEnd(c),ye):(i.wbits=f,c.istate.blocks=new UA(c,1<<f),u(c),bt)},i.inflate=function(c,f){let r,o;if(!c||!c.istate||!c.next_in)return ye;const h=c.istate;for(f=f==CA?pn:bt,r=pn;;)switch(h.mode){case YA:if(c.avail_in===0)return r;if(r=f,c.avail_in--,c.total_in++,((h.method=c.read_byte(c.next_in_index++))&15)!=zA){h.mode=Pn,c.msg="unknown compression method",h.marker=5;break}if((h.method>>4)+8>h.wbits){h.mode=Pn,c.msg="invalid win size",h.marker=5;break}h.mode=B1;case B1:if(c.avail_in===0)return r;if(r=f,c.avail_in--,c.total_in++,o=c.read_byte(c.next_in_index++)&255,((h.method<<8)+o)%31!==0){h.mode=Pn,c.msg="incorrect header check",h.marker=5;break}if((o&QA)===0){h.mode=yi;break}h.mode=U1;case U1:if(c.avail_in===0)return r;r=f,c.avail_in--,c.total_in++,h.need=(c.read_byte(c.next_in_index++)&255)<<24&4278190080,h.mode=Q1;case Q1:if(c.avail_in===0)return r;r=f,c.avail_in--,c.total_in++,h.need+=(c.read_byte(c.next_in_index++)&255)<<16&16711680,h.mode=z1;case z1:if(c.avail_in===0)return r;r=f,c.avail_in--,c.total_in++,h.need+=(c.read_byte(c.next_in_index++)&255)<<8&65280,h.mode=Y1;case Y1:return c.avail_in===0?r:(r=f,c.avail_in--,c.total_in++,h.need+=c.read_byte(c.next_in_index++)&255,h.mode=wf,SA);case wf:return h.mode=Pn,c.msg="need dictionary",h.marker=0,ye;case yi:if(r=h.blocks.proc(c,r),r==Ut){h.mode=Pn,h.marker=0;break}if(r==bt&&(r=f),r!=En)return r;r=f,h.blocks.reset(c,h.was),h.mode=L1;case L1:return c.avail_in=0,En;case Pn:return Ut;default:return ye}},i.inflateSetDictionary=function(c,f,r){let o=0,h=r;if(!c||!c.istate||c.istate.mode!=wf)return ye;const v=c.istate;return h>=1<<v.wbits&&(h=(1<<v.wbits)-1,o=r-h),v.blocks.set_dictionary(f,o,h),v.mode=yi,bt},i.inflateSync=function(c){let f,r,o,h,v;if(!c||!c.istate)return ye;const y=c.istate;if(y.mode!=Pn&&(y.mode=Pn,y.marker=0),(f=c.avail_in)===0)return pn;for(r=c.next_in_index,o=y.marker;f!==0&&o<4;)c.read_byte(r)==LA[o]?o++:c.read_byte(r)!==0?o=0:o=4-o,r++,f--;return c.total_in+=r-c.next_in_index,c.next_in_index=r,c.avail_in=f,y.marker=o,o!=4?Ut:(h=c.total_in,v=c.total_out,u(c),c.total_in=h,c.total_out=v,y.mode=yi,bt)},i.inflateSyncPoint=function(c){return!c||!c.istate||!c.istate.blocks?ye:c.istate.blocks.sync_point()}}function M2(){}M2.prototype={inflateInit(i){const u=this;return u.istate=new GA,i||(i=bA),u.istate.inflateInit(u,i)},inflate(i){const u=this;return u.istate?u.istate.inflate(u,i):ye},inflateEnd(){const i=this;if(!i.istate)return ye;const u=i.istate.inflateEnd(i);return i.istate=null,u},inflateSync(){const i=this;return i.istate?i.istate.inflateSync(i):ye},inflateSetDictionary(i,u){const c=this;return c.istate?c.istate.inflateSetDictionary(c,i,u):ye},read_byte(i){return this.next_in[i]},read_buf(i,u){return this.next_in.subarray(i,i+u)}};function XA(i){const u=this,c=new M2,f=i&&i.chunkSize?Math.floor(i.chunkSize*2):128*1024,r=TA,o=new Uint8Array(f);let h=!1;c.inflateInit(),c.next_out=o,u.append=function(v,y){const A=[];let x,T,D=0,X=0,q=0;if(v.length!==0){c.next_in_index=0,c.next_in=v,c.avail_in=v.length;do{if(c.next_out_index=0,c.avail_out=f,c.avail_in===0&&!h&&(c.next_in_index=0,h=!0),x=c.inflate(r),h&&x===pn){if(c.avail_in!==0)throw new Error("inflating: bad input")}else if(x!==bt&&x!==En)throw new Error("inflating: "+c.msg);if((h||x===En)&&c.avail_in===v.length)throw new Error("inflating: bad input");c.next_out_index&&(c.next_out_index===f?A.push(new Uint8Array(o)):A.push(o.subarray(0,c.next_out_index))),q+=c.next_out_index,y&&c.next_in_index>0&&c.next_in_index!=D&&(y(c.next_in_index),D=c.next_in_index)}while(c.avail_in>0||c.avail_out===0);return A.length>1?(T=new Uint8Array(q),A.forEach(function(p){T.set(p,X),X+=p.length})):T=A[0]?new Uint8Array(A[0]):new Uint8Array,T}},u.flush=function(){c.inflateEnd()}}const Rl=4294967295,el=65535,VA=8,ZA=0,IA=99,qA=67324752,j2=134695760,KA=j2,G1=33639248,kA=101010256,X1=101075792,JA=117853008,Ea=22,Mf=20,jf=56,FA=12,WA=20,V1=4,_A=1,PA=39169,$A=10,t5=1,e5=21589,n5=28789,l5=25461,a5=6534,Z1=1,i5=6,I1=8,q1=2048,K1=16,u5=61440,c5=16384,s5=73,k1="/",Nf=30,f5=10,r5=14,o5=18,$t=void 0,al="undefined",Ri="function";class J1{constructor(u){return class extends TransformStream{constructor(c,f){const r=new u(f);super({transform(o,h){h.enqueue(r.append(o))},flush(o){const h=r.flush();h&&o.enqueue(h)}})}}}}const d5=64;let N2=2;try{typeof navigator!=al&&navigator.hardwareConcurrency&&(N2=navigator.hardwareConcurrency)}catch{}const h5={chunkSize:512*1024,maxWorkers:N2,terminateWorkerTimeout:5e3,useWebWorkers:!0,useCompressionStream:!0,workerScripts:$t,CompressionStreamNative:typeof CompressionStream!=al&&CompressionStream,DecompressionStreamNative:typeof DecompressionStream!=al&&DecompressionStream},nl=Object.assign({},h5);function m5(){return nl}function g5(i){return Math.max(i.chunkSize,d5)}function H2(i){const{baseURL:u,chunkSize:c,maxWorkers:f,terminateWorkerTimeout:r,useCompressionStream:o,useWebWorkers:h,Deflate:v,Inflate:y,CompressionStream:A,DecompressionStream:x,workerScripts:T}=i;if($n("baseURL",u),$n("chunkSize",c),$n("maxWorkers",f),$n("terminateWorkerTimeout",r),$n("useCompressionStream",o),$n("useWebWorkers",h),v&&(nl.CompressionStream=new J1(v)),y&&(nl.DecompressionStream=new J1(y)),$n("CompressionStream",A),$n("DecompressionStream",x),T!==$t){const{deflate:D,inflate:X}=T;if((D||X)&&(nl.workerScripts||(nl.workerScripts={})),D){if(!Array.isArray(D))throw new Error("workerScripts.deflate must be an array");nl.workerScripts.deflate=D}if(X){if(!Array.isArray(X))throw new Error("workerScripts.inflate must be an array");nl.workerScripts.inflate=X}}}function $n(i,u){u!==$t&&(nl[i]=u)}const B2=[];for(let i=0;i<256;i++){let u=i;for(let c=0;c<8;c++)u&1?u=u>>>1^3988292384:u=u>>>1;B2[i]=u}class ac{constructor(u){this.crc=u||-1}append(u){let c=this.crc|0;for(let f=0,r=u.length|0;f<r;f++)c=c>>>8^B2[(c^u[f])&255];this.crc=c}get(){return~this.crc}}class U2 extends TransformStream{constructor(){let u;const c=new ac;super({transform(f,r){c.append(f),r.enqueue(f)},flush(){const f=new Uint8Array(4);new DataView(f.buffer).setUint32(0,c.get()),u.value=f}}),u=this}}function A5(i){if(typeof TextEncoder==al){i=unescape(encodeURIComponent(i));const u=new Uint8Array(i.length);for(let c=0;c<u.length;c++)u[c]=i.charCodeAt(c);return u}else return new TextEncoder().encode(i)}const re={concat(i,u){if(i.length===0||u.length===0)return i.concat(u);const c=i[i.length-1],f=re.getPartial(c);return f===32?i.concat(u):re._shiftRight(u,f,c|0,i.slice(0,i.length-1))},bitLength(i){const u=i.length;if(u===0)return 0;const c=i[u-1];return(u-1)*32+re.getPartial(c)},clamp(i,u){if(i.length*32<u)return i;i=i.slice(0,Math.ceil(u/32));const c=i.length;return u=u&31,c>0&&u&&(i[c-1]=re.partial(u,i[c-1]&2147483648>>u-1,1)),i},partial(i,u,c){return i===32?u:(c?u|0:u<<32-i)+i*1099511627776},getPartial(i){return Math.round(i/1099511627776)||32},_shiftRight(i,u,c,f){for(f===void 0&&(f=[]);u>=32;u-=32)f.push(c),c=0;if(u===0)return f.concat(i);for(let h=0;h<i.length;h++)f.push(c|i[h]>>>u),c=i[h]<<32-u;const r=i.length?i[i.length-1]:0,o=re.getPartial(r);return f.push(re.partial(u+o&31,u+o>32?c:f.pop(),1)),f}},ic={bytes:{fromBits(i){const c=re.bitLength(i)/8,f=new Uint8Array(c);let r;for(let o=0;o<c;o++)(o&3)===0&&(r=i[o/4]),f[o]=r>>>24,r<<=8;return f},toBits(i){const u=[];let c,f=0;for(c=0;c<i.length;c++)f=f<<8|i[c],(c&3)===3&&(u.push(f),f=0);return c&3&&u.push(re.partial(8*(c&3),f)),u}}},Q2={};Q2.sha1=class{constructor(i){const u=this;u.blockSize=512,u._init=[1732584193,4023233417,2562383102,271733878,3285377520],u._key=[1518500249,1859775393,2400959708,3395469782],i?(u._h=i._h.slice(0),u._buffer=i._buffer.slice(0),u._length=i._length):u.reset()}reset(){const i=this;return i._h=i._init.slice(0),i._buffer=[],i._length=0,i}update(i){const u=this;typeof i=="string"&&(i=ic.utf8String.toBits(i));const c=u._buffer=re.concat(u._buffer,i),f=u._length,r=u._length=f+re.bitLength(i);if(r>9007199254740991)throw new Error("Cannot hash more than 2^53 - 1 bits");const o=new Uint32Array(c);let h=0;for(let v=u.blockSize+f-(u.blockSize+f&u.blockSize-1);v<=r;v+=u.blockSize)u._block(o.subarray(16*h,16*(h+1))),h+=1;return c.splice(0,16*h),u}finalize(){const i=this;let u=i._buffer;const c=i._h;u=re.concat(u,[re.partial(1,1)]);for(let f=u.length+2;f&15;f++)u.push(0);for(u.push(Math.floor(i._length/4294967296)),u.push(i._length|0);u.length;)i._block(u.splice(0,16));return i.reset(),c}_f(i,u,c,f){if(i<=19)return u&c|~u&f;if(i<=39)return u^c^f;if(i<=59)return u&c|u&f|c&f;if(i<=79)return u^c^f}_S(i,u){return u<<i|u>>>32-i}_block(i){const u=this,c=u._h,f=Array(80);for(let A=0;A<16;A++)f[A]=i[A];let r=c[0],o=c[1],h=c[2],v=c[3],y=c[4];for(let A=0;A<=79;A++){A>=16&&(f[A]=u._S(1,f[A-3]^f[A-8]^f[A-14]^f[A-16]));const x=u._S(5,r)+u._f(A,o,h,v)+y+f[A]+u._key[Math.floor(A/20)]|0;y=v,v=h,h=u._S(30,o),o=r,r=x}c[0]=c[0]+r|0,c[1]=c[1]+o|0,c[2]=c[2]+h|0,c[3]=c[3]+v|0,c[4]=c[4]+y|0}};const z2={};z2.aes=class{constructor(i){const u=this;u._tables=[[[],[],[],[],[]],[[],[],[],[],[]]],u._tables[0][0][0]||u._precompute();const c=u._tables[0][4],f=u._tables[1],r=i.length;let o,h,v,y=1;if(r!==4&&r!==6&&r!==8)throw new Error("invalid aes key size");for(u._key=[h=i.slice(0),v=[]],o=r;o<4*r+28;o++){let A=h[o-1];(o%r===0||r===8&&o%r===4)&&(A=c[A>>>24]<<24^c[A>>16&255]<<16^c[A>>8&255]<<8^c[A&255],o%r===0&&(A=A<<8^A>>>24^y<<24,y=y<<1^(y>>7)*283)),h[o]=h[o-r]^A}for(let A=0;o;A++,o--){const x=h[A&3?o:o-4];o<=4||A<4?v[A]=x:v[A]=f[0][c[x>>>24]]^f[1][c[x>>16&255]]^f[2][c[x>>8&255]]^f[3][c[x&255]]}}encrypt(i){return this._crypt(i,0)}decrypt(i){return this._crypt(i,1)}_precompute(){const i=this._tables[0],u=this._tables[1],c=i[4],f=u[4],r=[],o=[];let h,v,y,A;for(let x=0;x<256;x++)o[(r[x]=x<<1^(x>>7)*283)^x]=x;for(let x=h=0;!c[x];x^=v||1,h=o[h]||1){let T=h^h<<1^h<<2^h<<3^h<<4;T=T>>8^T&255^99,c[x]=T,f[T]=x,A=r[y=r[v=r[x]]];let D=A*16843009^y*65537^v*257^x*16843008,X=r[T]*257^T*16843008;for(let q=0;q<4;q++)i[q][x]=X=X<<24^X>>>8,u[q][T]=D=D<<24^D>>>8}for(let x=0;x<5;x++)i[x]=i[x].slice(0),u[x]=u[x].slice(0)}_crypt(i,u){if(i.length!==4)throw new Error("invalid aes block size");const c=this._key[u],f=c.length/4-2,r=[0,0,0,0],o=this._tables[u],h=o[0],v=o[1],y=o[2],A=o[3],x=o[4];let T=i[0]^c[0],D=i[u?3:1]^c[1],X=i[2]^c[2],q=i[u?1:3]^c[3],p=4,E,b,R;for(let N=0;N<f;N++)E=h[T>>>24]^v[D>>16&255]^y[X>>8&255]^A[q&255]^c[p],b=h[D>>>24]^v[X>>16&255]^y[q>>8&255]^A[T&255]^c[p+1],R=h[X>>>24]^v[q>>16&255]^y[T>>8&255]^A[D&255]^c[p+2],q=h[q>>>24]^v[T>>16&255]^y[D>>8&255]^A[X&255]^c[p+3],p+=4,T=E,D=b,X=R;for(let N=0;N<4;N++)r[u?3&-N:N]=x[T>>>24]<<24^x[D>>16&255]<<16^x[X>>8&255]<<8^x[q&255]^c[p++],E=T,T=D,D=X,X=q,q=E;return r}};const v5={getRandomValues(i){const u=new Uint32Array(i.buffer),c=f=>{let r=987654321;const o=4294967295;return function(){return r=36969*(r&65535)+(r>>16)&o,f=18e3*(f&65535)+(f>>16)&o,(((r<<16)+f&o)/4294967296+.5)*(Math.random()>.5?1:-1)}};for(let f=0,r;f<i.length;f+=4){const o=c((r||Math.random())*4294967296);r=o()*987654071,u[f/4]=o()*4294967296|0}return i}},Y2={};Y2.ctrGladman=class{constructor(i,u){this._prf=i,this._initIv=u,this._iv=u}reset(){this._iv=this._initIv}update(i){return this.calculate(this._prf,i,this._iv)}incWord(i){if((i>>24&255)===255){let u=i>>16&255,c=i>>8&255,f=i&255;u===255?(u=0,c===255?(c=0,f===255?f=0:++f):++c):++u,i=0,i+=u<<16,i+=c<<8,i+=f}else i+=1<<24;return i}incCounter(i){(i[0]=this.incWord(i[0]))===0&&(i[1]=this.incWord(i[1]))}calculate(i,u,c){let f;if(!(f=u.length))return[];const r=re.bitLength(u);for(let o=0;o<f;o+=4){this.incCounter(c);const h=i.encrypt(c);u[o]^=h[0],u[o+1]^=h[1],u[o+2]^=h[2],u[o+3]^=h[3]}return re.clamp(u,r)}};const wl={importKey(i){return new wl.hmacSha1(ic.bytes.toBits(i))},pbkdf2(i,u,c,f){if(c=c||1e4,f<0||c<0)throw new Error("invalid params to pbkdf2");const r=(f>>5)+1<<2;let o,h,v,y,A;const x=new ArrayBuffer(r),T=new DataView(x);let D=0;const X=re;for(u=ic.bytes.toBits(u),A=1;D<(r||1);A++){for(o=h=i.encrypt(X.concat(u,[A])),v=1;v<c;v++)for(h=i.encrypt(h),y=0;y<h.length;y++)o[y]^=h[y];for(v=0;D<(r||1)&&v<o.length;v++)T.setInt32(D,o[v]),D+=4}return x.slice(0,f/8)}};wl.hmacSha1=class{constructor(i){const u=this,c=u._hash=Q2.sha1,f=[[],[]];u._baseHash=[new c,new c];const r=u._baseHash[0].blockSize/32;i.length>r&&(i=new c().update(i).finalize());for(let o=0;o<r;o++)f[0][o]=i[o]^909522486,f[1][o]=i[o]^1549556828;u._baseHash[0].update(f[0]),u._baseHash[1].update(f[1]),u._resultHash=new c(u._baseHash[0])}reset(){const i=this;i._resultHash=new i._hash(i._baseHash[0]),i._updated=!1}update(i){const u=this;u._updated=!0,u._resultHash.update(i)}digest(){const i=this,u=i._resultHash.finalize(),c=new i._hash(i._baseHash[1]).update(u).finalize();return i.reset(),c}encrypt(i){if(this._updated)throw new Error("encrypt on already updated hmac called!");return this.update(i),this.digest(i)}};const y5=typeof crypto!=al&&typeof crypto.getRandomValues==Ri,lr="Invalid password",ar="Invalid signature",ir="zipjs-abort-check-password";function L2(i){return y5?crypto.getRandomValues(i):v5.getRandomValues(i)}const pa=16,E5="raw",G2={name:"PBKDF2"},p5={name:"HMAC"},x5="SHA-1",b5=Object.assign({hash:p5},G2),Kf=Object.assign({iterations:1e3,hash:{name:x5}},G2),S5=["deriveBits"],Si=[8,12,16],Ei=[16,24,32],tl=10,T5=[0,0,0,0],cc=typeof crypto!=al,wi=cc&&crypto.subtle,X2=cc&&typeof wi!=al,Pe=ic.bytes,C5=z2.aes,O5=Y2.ctrGladman,D5=wl.hmacSha1;let F1=cc&&X2&&typeof wi.importKey==Ri,W1=cc&&X2&&typeof wi.deriveBits==Ri;class R5 extends TransformStream{constructor({password:u,rawPassword:c,signed:f,encryptionStrength:r,checkPasswordOnly:o}){super({start(){Object.assign(this,{ready:new Promise(h=>this.resolveReady=h),password:I2(u,c),signed:f,strength:r-1,pending:new Uint8Array})},async transform(h,v){const y=this,{password:A,strength:x,resolveReady:T,ready:D}=y;A?(await M5(y,x,A,Xe(h,0,Si[x]+2)),h=Xe(h,Si[x]+2),o?v.error(new Error(ir)):T()):await D;const X=new Uint8Array(h.length-tl-(h.length-tl)%pa);v.enqueue(V2(y,h,X,0,tl,!0))},async flush(h){const{signed:v,ctr:y,hmac:A,pending:x,ready:T}=this;if(A&&y){await T;const D=Xe(x,0,x.length-tl),X=Xe(x,x.length-tl);let q=new Uint8Array;if(D.length){const p=Ci(Pe,D);A.update(p);const E=y.update(p);q=Ti(Pe,E)}if(v){const p=Xe(Ti(Pe,A.digest()),0,tl);for(let E=0;E<tl;E++)if(p[E]!=X[E])throw new Error(ar)}h.enqueue(q)}}})}}class w5 extends TransformStream{constructor({password:u,rawPassword:c,encryptionStrength:f}){let r;super({start(){Object.assign(this,{ready:new Promise(o=>this.resolveReady=o),password:I2(u,c),strength:f-1,pending:new Uint8Array})},async transform(o,h){const v=this,{password:y,strength:A,resolveReady:x,ready:T}=v;let D=new Uint8Array;y?(D=await j5(v,A,y),x()):await T;const X=new Uint8Array(D.length+o.length-o.length%pa);X.set(D,0),h.enqueue(V2(v,o,X,D.length,0))},async flush(o){const{ctr:h,hmac:v,pending:y,ready:A}=this;if(v&&h){await A;let x=new Uint8Array;if(y.length){const T=h.update(Ci(Pe,y));v.update(T),x=Ti(Pe,T)}r.signature=Ti(Pe,v.digest()).slice(0,tl),o.enqueue(ur(x,r.signature))}}}),r=this}}function V2(i,u,c,f,r,o){const{ctr:h,hmac:v,pending:y}=i,A=u.length-r;y.length&&(u=ur(y,u),c=B5(c,A-A%pa));let x;for(x=0;x<=A-pa;x+=pa){const T=Ci(Pe,Xe(u,x,x+pa));o&&v.update(T);const D=h.update(T);o||v.update(D),c.set(Ti(Pe,D),x+f)}return i.pending=Xe(u,x),c}async function M5(i,u,c,f){const r=await Z2(i,u,c,Xe(f,0,Si[u])),o=Xe(f,Si[u]);if(r[0]!=o[0]||r[1]!=o[1])throw new Error(lr)}async function j5(i,u,c){const f=L2(new Uint8Array(Si[u])),r=await Z2(i,u,c,f);return ur(f,r)}async function Z2(i,u,c,f){i.password=null;const r=await N5(E5,c,b5,!1,S5),o=await H5(Object.assign({salt:f},Kf),r,8*(Ei[u]*2+2)),h=new Uint8Array(o),v=Ci(Pe,Xe(h,0,Ei[u])),y=Ci(Pe,Xe(h,Ei[u],Ei[u]*2)),A=Xe(h,Ei[u]*2);return Object.assign(i,{keys:{key:v,authentication:y,passwordVerification:A},ctr:new O5(new C5(v),Array.from(T5)),hmac:new D5(y)}),A}async function N5(i,u,c,f,r){if(F1)try{return await wi.importKey(i,u,c,f,r)}catch{return F1=!1,wl.importKey(u)}else return wl.importKey(u)}async function H5(i,u,c){if(W1)try{return await wi.deriveBits(i,u,c)}catch{return W1=!1,wl.pbkdf2(u,i.salt,Kf.iterations,c)}else return wl.pbkdf2(u,i.salt,Kf.iterations,c)}function I2(i,u){return u===$t?A5(i):u}function ur(i,u){let c=i;return i.length+u.length&&(c=new Uint8Array(i.length+u.length),c.set(i,0),c.set(u,i.length)),c}function B5(i,u){if(u&&u>i.length){const c=i;i=new Uint8Array(u),i.set(c,0)}return i}function Xe(i,u,c){return i.subarray(u,c)}function Ti(i,u){return i.fromBits(u)}function Ci(i,u){return i.toBits(u)}const bi=12;class U5 extends TransformStream{constructor({password:u,passwordVerification:c,checkPasswordOnly:f}){super({start(){Object.assign(this,{password:u,passwordVerification:c}),q2(this,u)},transform(r,o){const h=this;if(h.password){const v=_1(h,r.subarray(0,bi));if(h.password=null,v.at(-1)!=h.passwordVerification)throw new Error(lr);r=r.subarray(bi)}f?o.error(new Error(ir)):o.enqueue(_1(h,r))}})}}class Q5 extends TransformStream{constructor({password:u,passwordVerification:c}){super({start(){Object.assign(this,{password:u,passwordVerification:c}),q2(this,u)},transform(f,r){const o=this;let h,v;if(o.password){o.password=null;const y=L2(new Uint8Array(bi));y[bi-1]=o.passwordVerification,h=new Uint8Array(f.length+y.length),h.set(P1(o,y),0),v=bi}else h=new Uint8Array(f.length),v=0;h.set(P1(o,f),v),r.enqueue(h)}})}}function _1(i,u){const c=new Uint8Array(u.length);for(let f=0;f<u.length;f++)c[f]=K2(i)^u[f],cr(i,c[f]);return c}function P1(i,u){const c=new Uint8Array(u.length);for(let f=0;f<u.length;f++)c[f]=K2(i)^u[f],cr(i,u[f]);return c}function q2(i,u){const c=[305419896,591751049,878082192];Object.assign(i,{keys:c,crcKey0:new ac(c[0]),crcKey2:new ac(c[2])});for(let f=0;f<u.length;f++)cr(i,u.charCodeAt(f))}function cr(i,u){let[c,f,r]=i.keys;i.crcKey0.append([u]),c=~i.crcKey0.get(),f=$1(Math.imul($1(f+k2(c)),134775813)+1),i.crcKey2.append([f>>>24]),r=~i.crcKey2.get(),i.keys=[c,f,r]}function K2(i){const u=i.keys[2]|2;return k2(Math.imul(u,u^1)>>>8)}function k2(i){return i&255}function $1(i){return i&4294967295}const sr="Invalid uncompressed size",t2="deflate-raw";class z5 extends TransformStream{constructor(u,{chunkSize:c,CompressionStream:f,CompressionStreamNative:r}){super({});const{compressed:o,encrypted:h,useCompressionStream:v,zipCrypto:y,signed:A,level:x}=u,T=this;let D,X,q=super.readable;(!h||y)&&A&&(D=new U2,q=xn(q,D)),o&&(q=F2(q,v,{level:x,chunkSize:c},r,f)),h&&(y?q=xn(q,new Q5(u)):(X=new w5(u),q=xn(q,X))),J2(T,q,()=>{let p;h&&!y&&(p=X.signature),(!h||y)&&A&&(p=new DataView(D.value.buffer).getUint32(0)),T.signature=p})}}class Y5 extends TransformStream{constructor(u,{chunkSize:c,DecompressionStream:f,DecompressionStreamNative:r}){super({});const{zipCrypto:o,encrypted:h,signed:v,signature:y,compressed:A,useCompressionStream:x}=u;let T,D,X=super.readable;h&&(o?X=xn(X,new U5(u)):(D=new R5(u),X=xn(X,D))),A&&(X=F2(X,x,{chunkSize:c},r,f)),(!h||o)&&v&&(T=new U2,X=xn(X,T)),J2(this,X,()=>{if((!h||o)&&v){const q=new DataView(T.value.buffer);if(y!=q.getUint32(0,!1))throw new Error(ar)}})}}function J2(i,u,c){u=xn(u,new TransformStream({flush:c})),Object.defineProperty(i,"readable",{get(){return u}})}function F2(i,u,c,f,r){try{const o=u&&f?f:r;i=xn(i,new o(t2,c))}catch(o){if(u)i=xn(i,new r(t2,c));else throw o}return i}function xn(i,u){return i.pipeThrough(u)}const L5="message",G5="start",X5="pull",e2="data",V5="ack",n2="close",Z5="deflate",W2="inflate";class I5 extends TransformStream{constructor(u,c){super({});const f=this,{codecType:r}=u;let o;r.startsWith(Z5)?o=z5:r.startsWith(W2)&&(o=Y5),f.outputSize=0;let h=0;const v=new o(u,c),y=super.readable,A=new TransformStream({transform(T,D){T&&T.length&&(h+=T.length,D.enqueue(T))},flush(){Object.assign(f,{inputSize:h})}}),x=new TransformStream({transform(T,D){if(T&&T.length&&(D.enqueue(T),f.outputSize+=T.length,u.outputSize&&f.outputSize>u.outputSize))throw new Error(sr)},flush(){const{signature:T}=v;Object.assign(f,{signature:T,inputSize:h})}});Object.defineProperty(f,"readable",{get(){return y.pipeThrough(A).pipeThrough(v).pipeThrough(x)}})}}class q5 extends TransformStream{constructor(u){let c;super({transform:f,flush(r){c&&c.length&&r.enqueue(c)}});function f(r,o){if(c){const h=new Uint8Array(c.length+r.length);h.set(c),h.set(r,c.length),r=h,c=null}r.length>u?(o.enqueue(r.slice(0,u)),f(r.slice(u),o)):c=r}}}let _2=typeof Worker!=al;class Hf{constructor(u,{readable:c,writable:f},{options:r,config:o,streamOptions:h,useWebWorkers:v,transferStreams:y,scripts:A},x){const{signal:T}=h;return Object.assign(u,{busy:!0,readable:c.pipeThrough(new q5(o.chunkSize)).pipeThrough(new K5(h),{signal:T}),writable:f,options:Object.assign({},r),scripts:A,transferStreams:y,terminate(){return new Promise(D=>{const{worker:X,busy:q}=u;X?(q?u.resolveTerminated=D:(X.terminate(),D()),u.interface=null):D()})},onTaskFinished(){const{resolveTerminated:D}=u;D&&(u.resolveTerminated=null,u.terminated=!0,u.worker.terminate(),D()),u.busy=!1,x(u)}}),(v&&_2?k5:P2)(u,o)}}class K5 extends TransformStream{constructor({onstart:u,onprogress:c,size:f,onend:r}){let o=0;super({async start(){u&&await Bf(u,f)},async transform(h,v){o+=h.length,c&&await Bf(c,o,f),v.enqueue(h)},async flush(){r&&await Bf(r,o)}})}}async function Bf(i,...u){try{await i(...u)}catch{}}function P2(i,u){return{run:()=>J5(i,u)}}function k5(i,u){const{baseURL:c,chunkSize:f}=u;if(!i.interface){let r;try{r=_5(i.scripts[0],c,i)}catch{return _2=!1,P2(i,u)}Object.assign(i,{worker:r,interface:{run:()=>F5(i,{chunkSize:f})}})}return i.interface}async function J5({options:i,readable:u,writable:c,onTaskFinished:f},r){let o;try{o=new I5(i,r),await u.pipeThrough(o).pipeTo(c,{preventClose:!0,preventAbort:!0});const{signature:h,inputSize:v,outputSize:y}=o;return{signature:h,inputSize:v,outputSize:y}}catch(h){throw o&&(h.outputSize=o.outputSize),h}finally{f()}}async function F5(i,u){let c,f;const r=new Promise((D,X)=>{c=D,f=X});Object.assign(i,{reader:null,writer:null,resolveResult:c,rejectResult:f,result:r});const{readable:o,options:h,scripts:v}=i,{writable:y,closed:A}=W5(i.writable),x=ec({type:G5,scripts:v.slice(1),options:h,config:u,readable:o,writable:y},i);x||Object.assign(i,{reader:o.getReader(),writer:y.getWriter()});const T=await r;return x||await y.getWriter().close(),await A,T}function W5(i){let u;const c=new Promise(r=>u=r);return{writable:new WritableStream({async write(r){const o=i.getWriter();await o.ready,await o.write(r),o.releaseLock()},close(){u()},abort(r){return i.getWriter().abort(r)}}),closed:c}}let l2=!0,a2=!0;function _5(i,u,c){const f={type:"module"};let r,o;typeof i==Ri&&(i=i());try{r=new URL(i,u)}catch{r=i}if(l2)try{o=new Worker(r)}catch{l2=!1,o=new Worker(r,f)}else o=new Worker(r,f);return o.addEventListener(L5,h=>P5(h,c)),o}function ec(i,{worker:u,writer:c,onTaskFinished:f,transferStreams:r}){try{const{value:o,readable:h,writable:v}=i,y=[];if(o&&(o.byteLength<o.buffer.byteLength?i.value=o.buffer.slice(0,o.byteLength):i.value=o.buffer,y.push(i.value)),r&&a2?(h&&y.push(h),v&&y.push(v)):i.readable=i.writable=null,y.length)try{return u.postMessage(i,y),!0}catch{a2=!1,i.readable=i.writable=null,u.postMessage(i)}else u.postMessage(i)}catch(o){throw c&&c.releaseLock(),f(),o}}async function P5({data:i},u){const{type:c,value:f,messageId:r,result:o,error:h}=i,{reader:v,writer:y,resolveResult:A,rejectResult:x,onTaskFinished:T}=u;try{if(h){const{message:X,stack:q,code:p,name:E,outputSize:b}=h,R=new Error(X);Object.assign(R,{stack:q,code:p,name:E,outputSize:b}),D(R)}else{if(c==X5){const{value:X,done:q}=await v.read();ec({type:e2,value:X,done:q,messageId:r},u)}c==e2&&(await y.ready,await y.write(new Uint8Array(f)),ec({type:V5,messageId:r},u)),c==n2&&D(null,o)}}catch(X){ec({type:n2,messageId:r},u),D(X)}function D(X,q){X?x(X):A(q),y&&y.releaseLock(),T()}}let Ol=[];const Uf=[];let i2=0;async function $5(i,u){const{options:c,config:f}=u,{transferStreams:r,useWebWorkers:o,useCompressionStream:h,codecType:v,compressed:y,signed:A,encrypted:x}=c,{workerScripts:T,maxWorkers:D}=f;u.transferStreams=r||r===$t;const X=!y&&!A&&!x&&!u.transferStreams;return u.useWebWorkers=!X&&(o||o===$t&&f.useWebWorkers),u.scripts=u.useWebWorkers&&T?T[v]:[],c.useCompressionStream=h||h===$t&&f.useCompressionStream,(await q()).run();async function q(){const E=Ol.find(b=>!b.busy);if(E)return u2(E),new Hf(E,i,u,p);if(Ol.length<D){const b={indexWorker:i2};return i2++,Ol.push(b),new Hf(b,i,u,p)}else return new Promise(b=>Uf.push({resolve:b,stream:i,workerOptions:u}))}function p(E){if(Uf.length){const[{resolve:b,stream:R,workerOptions:N}]=Uf.splice(0,1);b(new Hf(E,R,N,p))}else E.worker?(u2(E),t8(E,u)):Ol=Ol.filter(b=>b!=E)}}function t8(i,u){const{config:c}=u,{terminateWorkerTimeout:f}=c;Number.isFinite(f)&&f>=0&&(i.terminated?i.terminated=!1:i.terminateTimeout=setTimeout(async()=>{Ol=Ol.filter(r=>r!=i);try{await i.terminate()}catch{}},f))}function u2(i){const{terminateTimeout:u}=i;u&&(clearTimeout(u),i.terminateTimeout=null)}const $2="Writer iterator completed too soon",e8="Content-Type",n8=64*1024,th="writable";class fr{constructor(){this.size=0}init(){this.initialized=!0}}class sc extends fr{get readable(){const u=this,{chunkSize:c=n8}=u,f=new ReadableStream({start(){this.chunkOffset=0},async pull(r){const{offset:o=0,size:h,diskNumberStart:v}=f,{chunkOffset:y}=this,A=h===$t?c:Math.min(c,h-y),x=await _t(u,o+y,A,v);r.enqueue(x),y+c>h||h===$t&&!x.length&&A?r.close():this.chunkOffset+=c}});return f}}class l8 extends sc{constructor(u){super();let c=u.length;for(;u.charAt(c-1)=="=";)c--;const f=u.indexOf(",")+1;Object.assign(this,{dataURI:u,dataStart:f,size:Math.floor((c-f)*.75)})}readUint8Array(u,c){const{dataStart:f,dataURI:r}=this,o=new Uint8Array(c),h=Math.floor(u/3)*4,v=atob(r.substring(h+f,Math.ceil((u+c)/3)*4+f)),y=u-Math.floor(h/4)*3;let A=0;for(let x=y;x<y+c&&x<v.length;x++)o[x-y]=v.charCodeAt(x),A++;return A<o.length?o.subarray(0,A):o}}class eh extends sc{constructor(u){super(),Object.assign(this,{blob:u,size:u.size})}async readUint8Array(u,c){const f=this,r=u+c;let h=await(u||r<f.size?f.blob.slice(u,r):f.blob).arrayBuffer();return h.byteLength>c&&(h=h.slice(u,r)),new Uint8Array(h)}}class nh extends fr{constructor(u){super();const c=this,f=new TransformStream,r=[];u&&r.push([e8,u]),Object.defineProperty(c,th,{get(){return f.writable}}),c.blob=new Response(f.readable,{headers:r}).blob()}getData(){return this.blob}}class a8 extends nh{constructor(u){super(u),Object.assign(this,{encoding:u,utf8:!u||u.toLowerCase()=="utf-8"})}async getData(){const{encoding:u,utf8:c}=this,f=await super.getData();if(f.text&&c)return f.text();{const r=new FileReader;return new Promise((o,h)=>{Object.assign(r,{onload:({target:v})=>o(v.result),onerror:()=>h(r.error)}),r.readAsText(f,u)})}}}class lh extends sc{constructor(u){super(),this.readers=u}async init(){const u=this,{readers:c}=u;u.lastDiskNumber=0,u.lastDiskOffset=0,await Promise.all(c.map(async(f,r)=>{await f.init(),r!=c.length-1&&(u.lastDiskOffset+=f.size),u.size+=f.size})),super.init()}async readUint8Array(u,c,f=0){const r=this,{readers:o}=this;let h,v=f;v==-1&&(v=o.length-1);let y=u;for(;o[v]&&y>=o[v].size;)y-=o[v].size,v++;const A=o[v];if(A){const x=A.size;if(y+c<=x)h=await _t(A,y,c);else{const T=x-y;h=new Uint8Array(c);const D=await _t(A,y,T);h.set(D,0);const X=await r.readUint8Array(u+T,c-T,f);h.set(X,T),D.length+X.length<c&&(h=h.subarray(0,D.length+X.length))}}else h=new Uint8Array;return r.lastDiskNumber=Math.max(v,r.lastDiskNumber),h}}class kf extends fr{constructor(u,c=4294967295){super();const f=this;Object.assign(f,{diskNumber:0,diskOffset:0,size:0,maxSize:c,availableSize:c});let r,o,h;const v=new WritableStream({async write(x){const{availableSize:T}=f;if(h)x.length>=T?(await y(x.subarray(0,T)),await A(),f.diskOffset+=r.size,f.diskNumber++,h=null,await this.write(x.subarray(T))):await y(x);else{const{value:D,done:X}=await u.next();if(X&&!D)throw new Error($2);r=D,r.size=0,r.maxSize&&(f.maxSize=r.maxSize),f.availableSize=f.maxSize,await Oi(r),o=D.writable,h=o.getWriter(),await this.write(x)}},async close(){await h.ready,await A()}});Object.defineProperty(f,th,{get(){return v}});async function y(x){const T=x.length;T&&(await h.ready,await h.write(x),r.size+=T,f.size+=T,f.availableSize-=T)}async function A(){await h.close()}}}class ah{constructor(u){return Array.isArray(u)&&(u=new lh(u)),u instanceof ReadableStream&&(u={readable:u}),u}}class ih{constructor(u){return u.writable===$t&&typeof u.next==Ri&&(u=new kf(u)),u instanceof WritableStream&&(u={writable:u}),u.size===$t&&(u.size=0),u instanceof kf||Object.assign(u,{diskNumber:0,diskOffset:0,availableSize:1/0,maxSize:1/0}),u}}async function Oi(i,u){if(i.init&&!i.initialized)await i.init(u);else return Promise.resolve()}function _t(i,u,c,f){return i.readUint8Array(u,c,f)}const uh="\0â˜ºâ˜»â™¥â™¦â™£â™ â€¢â—˜â—‹â—™â™‚â™€â™ªâ™«â˜¼â–ºâ—„â†•â€¼Â¶Â§â–¬â†¨â†‘â†“â†’â†�âˆŸâ†”â–²â–¼ !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~âŒ‚Ã‡Ã¼Ã©Ã¢Ã¤Ã Ã¥Ã§ÃªÃ«Ã¨Ã¯Ã®Ã¬Ã„Ã…Ã‰Ã¦Ã†Ã´Ã¶Ã²Ã»Ã¹Ã¿Ã–ÃœÂ¢Â£Â¥â‚§Æ’Ã¡Ã­Ã³ÃºÃ±Ã‘ÂªÂºÂ¿âŒ�Â¬Â½Â¼Â¡Â«Â»â–‘â–’â–“â”‚â”¤â•¡â•¢â•–â••â•£â•‘â•—â•�â•œâ•›â”�â””â”´â”¬â”œâ”€â”¼â•žâ•Ÿâ•šâ•”â•©â•¦â• â•�â•¬â•§â•¨â•¤â•¥â•™â•˜â•’â•“â•«â•ªâ”˜â”Œâ–ˆâ–„â–Œâ–�â–€Î±ÃŸÎ“Ï€Î£ÏƒÂµÏ„Î¦Î˜Î©Î´âˆžÏ†Îµâˆ©â‰¡Â±â‰¥â‰¤âŒ âŒ¡Ã·â‰ˆÂ°âˆ™Â·âˆšâ�¿Â²â–  ".split(""),i8=uh.length==256;function u8(i){if(i8){let u="";for(let c=0;c<i.length;c++)u+=uh[i[c]];return u}else return new TextDecoder().decode(i)}function nc(i,u){return u&&u.trim().toLowerCase()=="cp437"?u8(i):new TextDecoder(u).decode(i)}const ch="filename",sh="rawFilename",fh="comment",rh="rawComment",oh="uncompressedSize",dh="compressedSize",hh="offset",Jf="diskNumberStart",Ff="lastModDate",Wf="rawLastModDate",mh="lastAccessDate",c8="rawLastAccessDate",gh="creationDate",s8="rawCreationDate",f8="internalFileAttribute",r8="internalFileAttributes",o8="externalFileAttribute",d8="externalFileAttributes",h8="msDosCompatible",m8="zip64",g8="encrypted",A8="version",v8="versionMadeBy",y8="zipCrypto",E8="directory",p8="executable",x8="compressionMethod",b8="signature",S8="extraField",T8=[ch,sh,dh,oh,Ff,Wf,fh,rh,mh,gh,hh,Jf,Jf,f8,r8,o8,d8,h8,m8,g8,A8,v8,y8,E8,p8,x8,b8,S8,"bitFlag","filenameUTF8","commentUTF8","rawExtraField","extraFieldZip64","extraFieldUnicodePath","extraFieldUnicodeComment","extraFieldAES","extraFieldNTFS","extraFieldExtendedTimestamp"];class c2{constructor(u){T8.forEach(c=>this[c]=u[c])}}const C8="filenameEncoding",O8="commentEncoding",D8="decodeText",R8="extractPrependedData",w8="extractAppendedData",M8="password",j8="rawPassword",N8="passThrough",H8="signal",B8="checkPasswordOnly",U8="checkOverlappingEntryOnly",Q8="checkOverlappingEntry",z8="checkSignature",Y8="useWebWorkers",L8="useCompressionStream",G8="transferStreams",X8="preventClose",lc="File format is not recognized",Ah="End of central directory not found",vh="End of Zip64 central directory locator not found",yh="Central directory header not found",Eh="Local file header not found",ph="Zip64 extra field not found",xh="File contains encrypted entry",bh="Encryption method not supported",_f="Compression method not supported",Pf="Split zip file",Sh="Overlapping entry found",s2="utf-8",f2="cp437",V8=[[oh,Rl],[dh,Rl],[hh,Rl],[Jf,el]],Z8={[el]:{getValue:Bt,bytes:4},[Rl]:{getValue:ba,bytes:8}};class I8{constructor(u,c={}){Object.assign(this,{reader:new ah(u),options:c,config:m5(),readRanges:[]})}async*getEntriesGenerator(u={}){const c=this;let{reader:f}=c;const{config:r}=c;if(await Oi(f),(f.size===$t||!f.readUint8Array)&&(f=new eh(await new Response(f.readable).blob()),await Oi(f)),f.size<Ea)throw new Error(lc);f.chunkSize=g5(r);const o=await _8(f,kA,f.size,Ea,el*16);if(!o){const I=await _t(f,0,4),k=Yt(I);throw Bt(k)==j2?new Error(Pf):new Error(Ah)}const h=Yt(o);let v=Bt(h,12),y=Bt(h,16);const A=o.offset,x=Pt(h,20),T=A+Ea+x;let D=Pt(h,4);const X=f.lastDiskNumber||0;let q=Pt(h,6),p=Pt(h,8),E=0,b=0;if(y==Rl||v==Rl||p==el||q==el){const I=await _t(f,o.offset-Mf,Mf),k=Yt(I);if(Bt(k,0)==JA){y=ba(k,8);let nt=await _t(f,y,jf,-1),P=Yt(nt);const st=o.offset-Mf-jf;if(Bt(P,0)!=X1&&y!=st){const ut=y;y=st,y>ut&&(E=y-ut),nt=await _t(f,y,jf,-1),P=Yt(nt)}if(Bt(P,0)!=X1)throw new Error(vh);D==el&&(D=Bt(P,16)),q==el&&(q=Bt(P,20)),p==el&&(p=ba(P,32)),v==Rl&&(v=ba(P,40)),y-=v}}if(y>=f.size&&(E=f.size-y-v-Ea,y=f.size-v-Ea),X!=D)throw new Error(Pf);if(y<0)throw new Error(lc);let R=0,N=await _t(f,y,v,q),V=Yt(N);if(v){const I=o.offset-v;if(Bt(V,R)!=G1&&y!=I){const k=y;y=I,y>k&&(E+=y-k),N=await _t(f,y,v,q),V=Yt(N)}}const F=o.offset-y-(f.lastDiskOffset||0);if(v!=F&&F>=0&&(v=F,N=await _t(f,y,v,q),V=Yt(N)),y<0||y>=f.size)throw new Error(lc);const H=ie(c,u,C8),j=ie(c,u,O8);for(let I=0;I<p;I++){const k=new q8(f,r,c.options);if(Bt(V,R)!=G1)throw new Error(yh);Th(k,V,R+6);const nt=!!k.bitFlag.languageEncodingFlag,P=R+46,st=P+k.filenameLength,ut=st+k.extraFieldLength,M=Pt(V,R+4),_=M>>8==0,$=M>>8==3,ht=N.subarray(P,st),tt=Pt(V,R+32),C=ut+tt,L=N.subarray(ut,C),W=nt,et=nt,rt=Bt(V,R+38),ot=_&&(xa(V,R+38)&K1)==K1||$&&(rt>>16&u5)==c5||ht.length&&ht.at(-1)==k1.charCodeAt(0),gt=$&&(rt>>16&s5)!=0,Jt=Bt(V,R+42)+E;Object.assign(k,{versionMadeBy:M,msDosCompatible:_,compressedSize:0,uncompressedSize:0,commentLength:tt,directory:ot,offset:Jt,diskNumberStart:Pt(V,R+34),internalFileAttributes:Pt(V,R+36),externalFileAttributes:rt,rawFilename:ht,filenameUTF8:W,commentUTF8:et,rawExtraField:N.subarray(st,ut),executable:gt}),k.internalFileAttribute=k.internalFileAttributes,k.externalFileAttribute=k.externalFileAttributes;const Qt=ie(c,u,D8)||nc,Sn=W?s2:H||f2,ul=et?s2:j||f2;let Tn=Qt(ht,Sn);Tn===$t&&(Tn=nc(ht,Sn));let jl=Qt(L,ul);jl===$t&&(jl=nc(L,ul)),Object.assign(k,{rawComment:L,filename:Tn,comment:jl,directory:ot||Tn.endsWith(k1)}),b=Math.max(Jt,b),Ch(k,k,V,R+6),k.zipCrypto=k.encrypted&&!k.extraFieldAES;const Ee=new c2(k);Ee.getData=(Cn,Hl)=>k.getData(Cn,Ee,c.readRanges,Hl),Ee.arrayBuffer=async Cn=>{const Hl=new TransformStream,[ji]=await Promise.all([new Response(Hl.readable).arrayBuffer(),k.getData(Hl,Ee,c.readRanges,Cn)]);return ji},R=C;const{onprogress:Nl}=u;if(Nl)try{await Nl(I+1,p,new c2(k))}catch{}yield Ee}const Y=ie(c,u,R8),z=ie(c,u,w8);return Y&&(c.prependedData=b>0?await _t(f,0,b):new Uint8Array),c.comment=x?await _t(f,A+Ea,x):new Uint8Array,z&&(c.appendedData=T<f.size?await _t(f,T,f.size-T):new Uint8Array),!0}async getEntries(u={}){const c=[];for await(const f of this.getEntriesGenerator(u))c.push(f);return c}async close(){}}class q8{constructor(u,c,f){Object.assign(this,{reader:u,config:c,options:f})}async getData(u,c,f,r={}){const o=this,{reader:h,offset:v,diskNumberStart:y,extraFieldAES:A,extraFieldZip64:x,compressionMethod:T,config:D,bitFlag:X,signature:q,rawLastModDate:p,uncompressedSize:E,compressedSize:b}=o,{dataDescriptor:R}=X,N=c.localDirectory={},V=await _t(h,v,Nf,y),F=Yt(V);let H=ie(o,r,M8),j=ie(o,r,j8);const Y=ie(o,r,N8);if(H=H&&H.length&&H,j=j&&j.length&&j,A&&A.originalCompressionMethod!=IA)throw new Error(_f);if(T!=ZA&&T!=VA&&!Y)throw new Error(_f);if(Bt(F,0)!=qA)throw new Error(Eh);Th(N,F,4);const{extraFieldLength:z,filenameLength:I,lastAccessDate:k,creationDate:nt}=N;N.rawExtraField=z?await _t(h,v+Nf+I,z,y):new Uint8Array,Ch(o,N,F,4,!0),Object.assign(c,{lastAccessDate:k,creationDate:nt});const P=o.encrypted&&N.encrypted&&!Y,st=P&&!A;if(Y||(c.zipCrypto=st),P){if(!st&&A.strength===$t)throw new Error(bh);if(!H&&!j)throw new Error(xh)}const ut=v+Nf+I+z,M=b,_=h.readable;Object.assign(_,{diskNumberStart:y,offset:ut,size:M});const $=ie(o,r,H8),ht=ie(o,r,B8);let tt=ie(o,r,Q8);const C=ie(o,r,U8);C&&(tt=!0);const{onstart:L,onprogress:W,onend:et}=r,rt={options:{codecType:W2,password:H,rawPassword:j,zipCrypto:st,encryptionStrength:A&&A.strength,signed:ie(o,r,z8)&&!Y,passwordVerification:st&&(R?p>>>8&255:q>>>24&255),outputSize:E,signature:q,compressed:T!=0&&!Y,encrypted:o.encrypted&&!Y,useWebWorkers:ie(o,r,Y8),useCompressionStream:ie(o,r,L8),transferStreams:ie(o,r,G8),checkPasswordOnly:ht},config:D,streamOptions:{signal:$,size:M,onstart:L,onprogress:W,onend:et}};tt&&await W8({reader:h,fileEntry:c,offset:v,diskNumberStart:y,signature:q,compressedSize:b,uncompressedSize:E,dataOffset:ut,dataDescriptor:R||N.bitFlag.dataDescriptor,extraFieldZip64:x||N.extraFieldZip64,readRanges:f});let ot;try{if(!C){ht&&(u=new WritableStream),u=new ih(u),await Oi(u,Y?b:E),{writable:ot}=u;const{outputSize:gt}=await $5({readable:_,writable:ot},rt);if(u.size+=gt,gt!=(Y?b:E))throw new Error(sr)}}catch(gt){if(gt.outputSize!==$t&&(u.size+=gt.outputSize),!ht||gt.message!=ir)throw gt}finally{!ie(o,r,X8)&&ot&&!ot.locked&&await ot.getWriter().close()}return ht||C?$t:u.getData?u.getData():ot}}function Th(i,u,c){const f=i.rawBitFlag=Pt(u,c+2),r=(f&Z1)==Z1,o=Bt(u,c+6);Object.assign(i,{encrypted:r,version:Pt(u,c),bitFlag:{level:(f&i5)>>1,dataDescriptor:(f&I1)==I1,languageEncodingFlag:(f&q1)==q1},rawLastModDate:o,lastModDate:P8(o),filenameLength:Pt(u,c+22),extraFieldLength:Pt(u,c+24)})}function Ch(i,u,c,f,r){const{rawExtraField:o}=u,h=u.extraField=new Map,v=Yt(new Uint8Array(o));let y=0;try{for(;y<o.length;){const b=Pt(v,y),R=Pt(v,y+2);h.set(b,{type:b,data:o.slice(y+4,y+4+R)}),y+=4+R}}catch{}const A=Pt(c,f+4);Object.assign(u,{signature:Bt(c,f+f5),compressedSize:Bt(c,f+r5),uncompressedSize:Bt(c,f+o5)});const x=h.get(_A);x&&(K8(x,u),u.extraFieldZip64=x);const T=h.get(n5);T&&(r2(T,ch,sh,u,i),u.extraFieldUnicodePath=T);const D=h.get(l5);D&&(r2(D,fh,rh,u,i),u.extraFieldUnicodeComment=D);const X=h.get(PA);X?(k8(X,u,A),u.extraFieldAES=X):u.compressionMethod=A;const q=h.get($A);q&&(J8(q,u),u.extraFieldNTFS=q);const p=h.get(e5);p&&(F8(p,u,r),u.extraFieldExtendedTimestamp=p);const E=h.get(a5);E&&(u.extraFieldUSDZ=E)}function K8(i,u){u.zip64=!0;const c=Yt(i.data),f=V8.filter(([r,o])=>u[r]==o);for(let r=0,o=0;r<f.length;r++){const[h,v]=f[r];if(u[h]==v){const y=Z8[v];u[h]=i[h]=y.getValue(c,o),o+=y.bytes}else if(i[h])throw new Error(ph)}}function r2(i,u,c,f,r){const o=Yt(i.data),h=new ac;h.append(r[c]);const v=Yt(new Uint8Array(4));v.setUint32(0,h.get(),!0);const y=Bt(o,1);Object.assign(i,{version:xa(o,0),[u]:nc(i.data.subarray(5)),valid:!r.bitFlag.languageEncodingFlag&&y==Bt(v,0)}),i.valid&&(f[u]=i[u],f[u+"UTF8"]=!0)}function k8(i,u,c){const f=Yt(i.data),r=xa(f,4);Object.assign(i,{vendorVersion:xa(f,0),vendorId:xa(f,2),strength:r,originalCompressionMethod:c,compressionMethod:Pt(f,5)}),u.compressionMethod=i.compressionMethod}function J8(i,u){const c=Yt(i.data);let f=4,r;try{for(;f<i.data.length&&!r;){const o=Pt(c,f),h=Pt(c,f+2);o==t5&&(r=i.data.slice(f+4,f+4+h)),f+=4+h}}catch{}try{if(r&&r.length==24){const o=Yt(r),h=o.getBigUint64(0,!0),v=o.getBigUint64(8,!0),y=o.getBigUint64(16,!0);Object.assign(i,{rawLastModDate:h,rawLastAccessDate:v,rawCreationDate:y});const A=Qf(h),x=Qf(v),T=Qf(y),D={lastModDate:A,lastAccessDate:x,creationDate:T};Object.assign(i,D),Object.assign(u,D)}}catch{}}function F8(i,u,c){const f=Yt(i.data),r=xa(f,0),o=[],h=[];c?((r&1)==1&&(o.push(Ff),h.push(Wf)),(r&2)==2&&(o.push(mh),h.push(c8)),(r&4)==4&&(o.push(gh),h.push(s8))):i.data.length>=5&&(o.push(Ff),h.push(Wf));let v=1;o.forEach((y,A)=>{if(i.data.length>=v+4){const x=Bt(f,v);u[y]=i[y]=new Date(x*1e3);const T=h[A];i[T]=x}v+=4})}async function W8({reader:i,fileEntry:u,offset:c,diskNumberStart:f,signature:r,compressedSize:o,uncompressedSize:h,dataOffset:v,dataDescriptor:y,extraFieldZip64:A,readRanges:x}){let T=0;if(f)for(let q=0;q<f;q++){const p=i.readers[q];T+=p.size}let D=0;if(y&&(A?D=WA:D=FA),D){const q=await _t(i,v+o,D+V1,f);if(Bt(Yt(q),0)==KA){const E=Bt(Yt(q),4);let b,R;A?(b=ba(Yt(q),8),R=ba(Yt(q),16)):(b=Bt(Yt(q),8),R=Bt(Yt(q),12)),(u.encrypted&&!u.zipCrypto||E==r)&&b==o&&R==h&&(D+=V1)}}const X={start:T+c,end:T+v+o+D,fileEntry:u};for(const q of x)if(q.fileEntry!=u&&X.start>=q.start&&X.start<q.end){const p=new Error(Sh);throw p.overlappingEntry=q.fileEntry,p}x.push(X)}async function _8(i,u,c,f,r){const o=new Uint8Array(4),h=Yt(o);$8(h,0,u);const v=f+r;return await y(f)||await y(Math.min(v,c));async function y(A){const x=c-A,T=await _t(i,x,A);for(let D=T.length-f;D>=0;D--)if(T[D]==o[0]&&T[D+1]==o[1]&&T[D+2]==o[2]&&T[D+3]==o[3])return{offset:x+D,buffer:T.slice(D,D+f).buffer}}}function ie(i,u,c){return u[c]===$t?i.options[c]:u[c]}function P8(i){const u=(i&4294901760)>>16,c=i&65535;try{return new Date(1980+((u&65024)>>9),((u&480)>>5)-1,u&31,(c&63488)>>11,(c&2016)>>5,(c&31)*2,0)}catch{}}function Qf(i){return new Date(Number(i/BigInt(1e4)-BigInt(116444736e5)))}function xa(i,u){return i.getUint8(u)}function Pt(i,u){return i.getUint16(u,!0)}function Bt(i,u){return i.getUint32(u,!0)}function ba(i,u){return Number(i.getBigUint64(u,!0))}function $8(i,u,c){i.setUint32(u,c,!0)}function Yt(i){return new DataView(i.buffer)}H2({Inflate:XA});const t3=Object.freeze(Object.defineProperty({__proto__:null,BlobReader:eh,BlobWriter:nh,Data64URIReader:l8,ERR_BAD_FORMAT:lc,ERR_CENTRAL_DIRECTORY_NOT_FOUND:yh,ERR_ENCRYPTED:xh,ERR_EOCDR_LOCATOR_ZIP64_NOT_FOUND:vh,ERR_EOCDR_NOT_FOUND:Ah,ERR_EXTRAFIELD_ZIP64_NOT_FOUND:ph,ERR_INVALID_PASSWORD:lr,ERR_INVALID_SIGNATURE:ar,ERR_INVALID_UNCOMPRESSED_SIZE:sr,ERR_ITERATOR_COMPLETED_TOO_SOON:$2,ERR_LOCAL_FILE_HEADER_NOT_FOUND:Eh,ERR_OVERLAPPING_ENTRY:Sh,ERR_SPLIT_ZIP_FILE:Pf,ERR_UNSUPPORTED_COMPRESSION:_f,ERR_UNSUPPORTED_ENCRYPTION:bh,GenericReader:ah,GenericWriter:ih,Reader:sc,SplitDataReader:lh,SplitDataWriter:kf,TextWriter:a8,ZipReader:I8,configure:H2,initStream:Oi,readUint8Array:_t},Symbol.toStringTag,{value:"Module"}));var zf={exports:{}},dt={};/**
 * @license React
 * react.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var o2;function e3(){if(o2)return dt;o2=1;var i=Symbol.for("react.transitional.element"),u=Symbol.for("react.portal"),c=Symbol.for("react.fragment"),f=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),h=Symbol.for("react.context"),v=Symbol.for("react.forward_ref"),y=Symbol.for("react.suspense"),A=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),T=Symbol.for("react.activity"),D=Symbol.iterator;function X(C){return C===null||typeof C!="object"?null:(C=D&&C[D]||C["@@iterator"],typeof C=="function"?C:null)}var q={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},p=Object.assign,E={};function b(C,L,W){this.props=C,this.context=L,this.refs=E,this.updater=W||q}b.prototype.isReactComponent={},b.prototype.setState=function(C,L){if(typeof C!="object"&&typeof C!="function"&&C!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,C,L,"setState")},b.prototype.forceUpdate=function(C){this.updater.enqueueForceUpdate(this,C,"forceUpdate")};function R(){}R.prototype=b.prototype;function N(C,L,W){this.props=C,this.context=L,this.refs=E,this.updater=W||q}var V=N.prototype=new R;V.constructor=N,p(V,b.prototype),V.isPureReactComponent=!0;var F=Array.isArray;function H(){}var j={H:null,A:null,T:null,S:null},Y=Object.prototype.hasOwnProperty;function z(C,L,W){var et=W.ref;return{$$typeof:i,type:C,key:L,ref:et!==void 0?et:null,props:W}}function I(C,L){return z(C.type,L,C.props)}function k(C){return typeof C=="object"&&C!==null&&C.$$typeof===i}function nt(C){var L={"=":"=0",":":"=2"};return"$"+C.replace(/[=:]/g,function(W){return L[W]})}var P=/\/+/g;function st(C,L){return typeof C=="object"&&C!==null&&C.key!=null?nt(""+C.key):L.toString(36)}function ut(C){switch(C.status){case"fulfilled":return C.value;case"rejected":throw C.reason;default:switch(typeof C.status=="string"?C.then(H,H):(C.status="pending",C.then(function(L){C.status==="pending"&&(C.status="fulfilled",C.value=L)},function(L){C.status==="pending"&&(C.status="rejected",C.reason=L)})),C.status){case"fulfilled":return C.value;case"rejected":throw C.reason}}throw C}function M(C,L,W,et,rt){var ot=typeof C;(ot==="undefined"||ot==="boolean")&&(C=null);var gt=!1;if(C===null)gt=!0;else switch(ot){case"bigint":case"string":case"number":gt=!0;break;case"object":switch(C.$$typeof){case i:case u:gt=!0;break;case x:return gt=C._init,M(gt(C._payload),L,W,et,rt)}}if(gt)return rt=rt(C),gt=et===""?"."+st(C,0):et,F(rt)?(W="",gt!=null&&(W=gt.replace(P,"$&/")+"/"),M(rt,L,W,"",function(Sn){return Sn})):rt!=null&&(k(rt)&&(rt=I(rt,W+(rt.key==null||C&&C.key===rt.key?"":(""+rt.key).replace(P,"$&/")+"/")+gt)),L.push(rt)),1;gt=0;var Jt=et===""?".":et+":";if(F(C))for(var Qt=0;Qt<C.length;Qt++)et=C[Qt],ot=Jt+st(et,Qt),gt+=M(et,L,W,ot,rt);else if(Qt=X(C),typeof Qt=="function")for(C=Qt.call(C),Qt=0;!(et=C.next()).done;)et=et.value,ot=Jt+st(et,Qt++),gt+=M(et,L,W,ot,rt);else if(ot==="object"){if(typeof C.then=="function")return M(ut(C),L,W,et,rt);throw L=String(C),Error("Objects are not valid as a React child (found: "+(L==="[object Object]"?"object with keys {"+Object.keys(C).join(", ")+"}":L)+"). If you meant to render a collection of children, use an array instead.")}return gt}function _(C,L,W){if(C==null)return C;var et=[],rt=0;return M(C,et,"","",function(ot){return L.call(W,ot,rt++)}),et}function $(C){if(C._status===-1){var L=C._result;L=L(),L.then(function(W){(C._status===0||C._status===-1)&&(C._status=1,C._result=W)},function(W){(C._status===0||C._status===-1)&&(C._status=2,C._result=W)}),C._status===-1&&(C._status=0,C._result=L)}if(C._status===1)return C._result.default;throw C._result}var ht=typeof reportError=="function"?reportError:function(C){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var L=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof C=="object"&&C!==null&&typeof C.message=="string"?String(C.message):String(C),error:C});if(!window.dispatchEvent(L))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",C);return}console.error(C)},tt={map:_,forEach:function(C,L,W){_(C,function(){L.apply(this,arguments)},W)},count:function(C){var L=0;return _(C,function(){L++}),L},toArray:function(C){return _(C,function(L){return L})||[]},only:function(C){if(!k(C))throw Error("React.Children.only expected to receive a single React element child.");return C}};return dt.Activity=T,dt.Children=tt,dt.Component=b,dt.Fragment=c,dt.Profiler=r,dt.PureComponent=N,dt.StrictMode=f,dt.Suspense=y,dt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=j,dt.__COMPILER_RUNTIME={__proto__:null,c:function(C){return j.H.useMemoCache(C)}},dt.cache=function(C){return function(){return C.apply(null,arguments)}},dt.cacheSignal=function(){return null},dt.cloneElement=function(C,L,W){if(C==null)throw Error("The argument must be a React element, but you passed "+C+".");var et=p({},C.props),rt=C.key;if(L!=null)for(ot in L.key!==void 0&&(rt=""+L.key),L)!Y.call(L,ot)||ot==="key"||ot==="__self"||ot==="__source"||ot==="ref"&&L.ref===void 0||(et[ot]=L[ot]);var ot=arguments.length-2;if(ot===1)et.children=W;else if(1<ot){for(var gt=Array(ot),Jt=0;Jt<ot;Jt++)gt[Jt]=arguments[Jt+2];et.children=gt}return z(C.type,rt,et)},dt.createContext=function(C){return C={$$typeof:h,_currentValue:C,_currentValue2:C,_threadCount:0,Provider:null,Consumer:null},C.Provider=C,C.Consumer={$$typeof:o,_context:C},C},dt.createElement=function(C,L,W){var et,rt={},ot=null;if(L!=null)for(et in L.key!==void 0&&(ot=""+L.key),L)Y.call(L,et)&&et!=="key"&&et!=="__self"&&et!=="__source"&&(rt[et]=L[et]);var gt=arguments.length-2;if(gt===1)rt.children=W;else if(1<gt){for(var Jt=Array(gt),Qt=0;Qt<gt;Qt++)Jt[Qt]=arguments[Qt+2];rt.children=Jt}if(C&&C.defaultProps)for(et in gt=C.defaultProps,gt)rt[et]===void 0&&(rt[et]=gt[et]);return z(C,ot,rt)},dt.createRef=function(){return{current:null}},dt.forwardRef=function(C){return{$$typeof:v,render:C}},dt.isValidElement=k,dt.lazy=function(C){return{$$typeof:x,_payload:{_status:-1,_result:C},_init:$}},dt.memo=function(C,L){return{$$typeof:A,type:C,compare:L===void 0?null:L}},dt.startTransition=function(C){var L=j.T,W={};j.T=W;try{var et=C(),rt=j.S;rt!==null&&rt(W,et),typeof et=="object"&&et!==null&&typeof et.then=="function"&&et.then(H,ht)}catch(ot){ht(ot)}finally{L!==null&&W.types!==null&&(L.types=W.types),j.T=L}},dt.unstable_useCacheRefresh=function(){return j.H.useCacheRefresh()},dt.use=function(C){return j.H.use(C)},dt.useActionState=function(C,L,W){return j.H.useActionState(C,L,W)},dt.useCallback=function(C,L){return j.H.useCallback(C,L)},dt.useContext=function(C){return j.H.useContext(C)},dt.useDebugValue=function(){},dt.useDeferredValue=function(C,L){return j.H.useDeferredValue(C,L)},dt.useEffect=function(C,L){return j.H.useEffect(C,L)},dt.useEffectEvent=function(C){return j.H.useEffectEvent(C)},dt.useId=function(){return j.H.useId()},dt.useImperativeHandle=function(C,L,W){return j.H.useImperativeHandle(C,L,W)},dt.useInsertionEffect=function(C,L){return j.H.useInsertionEffect(C,L)},dt.useLayoutEffect=function(C,L){return j.H.useLayoutEffect(C,L)},dt.useMemo=function(C,L){return j.H.useMemo(C,L)},dt.useOptimistic=function(C,L){return j.H.useOptimistic(C,L)},dt.useReducer=function(C,L,W){return j.H.useReducer(C,L,W)},dt.useRef=function(C){return j.H.useRef(C)},dt.useState=function(C){return j.H.useState(C)},dt.useSyncExternalStore=function(C,L,W){return j.H.useSyncExternalStore(C,L,W)},dt.useTransition=function(){return j.H.useTransition()},dt.version="19.2.1",dt}var d2;function rr(){return d2||(d2=1,zf.exports=e3()),zf.exports}var it=rr();const ue=EA(it);var Yf={exports:{}},pi={},Lf={exports:{}},Gf={};/**
 * @license React
 * scheduler.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var h2;function n3(){return h2||(h2=1,(function(i){function u(M,_){var $=M.length;M.push(_);t:for(;0<$;){var ht=$-1>>>1,tt=M[ht];if(0<r(tt,_))M[ht]=_,M[$]=tt,$=ht;else break t}}function c(M){return M.length===0?null:M[0]}function f(M){if(M.length===0)return null;var _=M[0],$=M.pop();if($!==_){M[0]=$;t:for(var ht=0,tt=M.length,C=tt>>>1;ht<C;){var L=2*(ht+1)-1,W=M[L],et=L+1,rt=M[et];if(0>r(W,$))et<tt&&0>r(rt,W)?(M[ht]=rt,M[et]=$,ht=et):(M[ht]=W,M[L]=$,ht=L);else if(et<tt&&0>r(rt,$))M[ht]=rt,M[et]=$,ht=et;else break t}}return _}function r(M,_){var $=M.sortIndex-_.sortIndex;return $!==0?$:M.id-_.id}if(i.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;i.unstable_now=function(){return o.now()}}else{var h=Date,v=h.now();i.unstable_now=function(){return h.now()-v}}var y=[],A=[],x=1,T=null,D=3,X=!1,q=!1,p=!1,E=!1,b=typeof setTimeout=="function"?setTimeout:null,R=typeof clearTimeout=="function"?clearTimeout:null,N=typeof setImmediate<"u"?setImmediate:null;function V(M){for(var _=c(A);_!==null;){if(_.callback===null)f(A);else if(_.startTime<=M)f(A),_.sortIndex=_.expirationTime,u(y,_);else break;_=c(A)}}function F(M){if(p=!1,V(M),!q)if(c(y)!==null)q=!0,H||(H=!0,nt());else{var _=c(A);_!==null&&ut(F,_.startTime-M)}}var H=!1,j=-1,Y=5,z=-1;function I(){return E?!0:!(i.unstable_now()-z<Y)}function k(){if(E=!1,H){var M=i.unstable_now();z=M;var _=!0;try{t:{q=!1,p&&(p=!1,R(j),j=-1),X=!0;var $=D;try{e:{for(V(M),T=c(y);T!==null&&!(T.expirationTime>M&&I());){var ht=T.callback;if(typeof ht=="function"){T.callback=null,D=T.priorityLevel;var tt=ht(T.expirationTime<=M);if(M=i.unstable_now(),typeof tt=="function"){T.callback=tt,V(M),_=!0;break e}T===c(y)&&f(y),V(M)}else f(y);T=c(y)}if(T!==null)_=!0;else{var C=c(A);C!==null&&ut(F,C.startTime-M),_=!1}}break t}finally{T=null,D=$,X=!1}_=void 0}}finally{_?nt():H=!1}}}var nt;if(typeof N=="function")nt=function(){N(k)};else if(typeof MessageChannel<"u"){var P=new MessageChannel,st=P.port2;P.port1.onmessage=k,nt=function(){st.postMessage(null)}}else nt=function(){b(k,0)};function ut(M,_){j=b(function(){M(i.unstable_now())},_)}i.unstable_IdlePriority=5,i.unstable_ImmediatePriority=1,i.unstable_LowPriority=4,i.unstable_NormalPriority=3,i.unstable_Profiling=null,i.unstable_UserBlockingPriority=2,i.unstable_cancelCallback=function(M){M.callback=null},i.unstable_forceFrameRate=function(M){0>M||125<M?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Y=0<M?Math.floor(1e3/M):5},i.unstable_getCurrentPriorityLevel=function(){return D},i.unstable_next=function(M){switch(D){case 1:case 2:case 3:var _=3;break;default:_=D}var $=D;D=_;try{return M()}finally{D=$}},i.unstable_requestPaint=function(){E=!0},i.unstable_runWithPriority=function(M,_){switch(M){case 1:case 2:case 3:case 4:case 5:break;default:M=3}var $=D;D=M;try{return _()}finally{D=$}},i.unstable_scheduleCallback=function(M,_,$){var ht=i.unstable_now();switch(typeof $=="object"&&$!==null?($=$.delay,$=typeof $=="number"&&0<$?ht+$:ht):$=ht,M){case 1:var tt=-1;break;case 2:tt=250;break;case 5:tt=1073741823;break;case 4:tt=1e4;break;default:tt=5e3}return tt=$+tt,M={id:x++,callback:_,priorityLevel:M,startTime:$,expirationTime:tt,sortIndex:-1},$>ht?(M.sortIndex=$,u(A,M),c(y)===null&&M===c(A)&&(p?(R(j),j=-1):p=!0,ut(F,$-ht))):(M.sortIndex=tt,u(y,M),q||X||(q=!0,H||(H=!0,nt()))),M},i.unstable_shouldYield=I,i.unstable_wrapCallback=function(M){var _=D;return function(){var $=D;D=_;try{return M.apply(this,arguments)}finally{D=$}}}})(Gf)),Gf}var m2;function l3(){return m2||(m2=1,Lf.exports=n3()),Lf.exports}var Xf={exports:{}},ce={};/**
 * @license React
 * react-dom.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var g2;function a3(){if(g2)return ce;g2=1;var i=rr();function u(y){var A="https://react.dev/errors/"+y;if(1<arguments.length){A+="?args[]="+encodeURIComponent(arguments[1]);for(var x=2;x<arguments.length;x++)A+="&args[]="+encodeURIComponent(arguments[x])}return"Minified React error #"+y+"; visit "+A+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function c(){}var f={d:{f:c,r:function(){throw Error(u(522))},D:c,C:c,L:c,m:c,X:c,S:c,M:c},p:0,findDOMNode:null},r=Symbol.for("react.portal");function o(y,A,x){var T=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:r,key:T==null?null:""+T,children:y,containerInfo:A,implementation:x}}var h=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function v(y,A){if(y==="font")return"";if(typeof A=="string")return A==="use-credentials"?A:""}return ce.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=f,ce.createPortal=function(y,A){var x=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!A||A.nodeType!==1&&A.nodeType!==9&&A.nodeType!==11)throw Error(u(299));return o(y,A,null,x)},ce.flushSync=function(y){var A=h.T,x=f.p;try{if(h.T=null,f.p=2,y)return y()}finally{h.T=A,f.p=x,f.d.f()}},ce.preconnect=function(y,A){typeof y=="string"&&(A?(A=A.crossOrigin,A=typeof A=="string"?A==="use-credentials"?A:"":void 0):A=null,f.d.C(y,A))},ce.prefetchDNS=function(y){typeof y=="string"&&f.d.D(y)},ce.preinit=function(y,A){if(typeof y=="string"&&A&&typeof A.as=="string"){var x=A.as,T=v(x,A.crossOrigin),D=typeof A.integrity=="string"?A.integrity:void 0,X=typeof A.fetchPriority=="string"?A.fetchPriority:void 0;x==="style"?f.d.S(y,typeof A.precedence=="string"?A.precedence:void 0,{crossOrigin:T,integrity:D,fetchPriority:X}):x==="script"&&f.d.X(y,{crossOrigin:T,integrity:D,fetchPriority:X,nonce:typeof A.nonce=="string"?A.nonce:void 0})}},ce.preinitModule=function(y,A){if(typeof y=="string")if(typeof A=="object"&&A!==null){if(A.as==null||A.as==="script"){var x=v(A.as,A.crossOrigin);f.d.M(y,{crossOrigin:x,integrity:typeof A.integrity=="string"?A.integrity:void 0,nonce:typeof A.nonce=="string"?A.nonce:void 0})}}else A==null&&f.d.M(y)},ce.preload=function(y,A){if(typeof y=="string"&&typeof A=="object"&&A!==null&&typeof A.as=="string"){var x=A.as,T=v(x,A.crossOrigin);f.d.L(y,x,{crossOrigin:T,integrity:typeof A.integrity=="string"?A.integrity:void 0,nonce:typeof A.nonce=="string"?A.nonce:void 0,type:typeof A.type=="string"?A.type:void 0,fetchPriority:typeof A.fetchPriority=="string"?A.fetchPriority:void 0,referrerPolicy:typeof A.referrerPolicy=="string"?A.referrerPolicy:void 0,imageSrcSet:typeof A.imageSrcSet=="string"?A.imageSrcSet:void 0,imageSizes:typeof A.imageSizes=="string"?A.imageSizes:void 0,media:typeof A.media=="string"?A.media:void 0})}},ce.preloadModule=function(y,A){if(typeof y=="string")if(A){var x=v(A.as,A.crossOrigin);f.d.m(y,{as:typeof A.as=="string"&&A.as!=="script"?A.as:void 0,crossOrigin:x,integrity:typeof A.integrity=="string"?A.integrity:void 0})}else f.d.m(y)},ce.requestFormReset=function(y){f.d.r(y)},ce.unstable_batchedUpdates=function(y,A){return y(A)},ce.useFormState=function(y,A,x){return h.H.useFormState(y,A,x)},ce.useFormStatus=function(){return h.H.useHostTransitionStatus()},ce.version="19.2.1",ce}var A2;function i3(){if(A2)return Xf.exports;A2=1;function i(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(u){console.error(u)}}return i(),Xf.exports=a3(),Xf.exports}/**
 * @license React
 * react-dom-client.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var v2;function u3(){if(v2)return pi;v2=1;var i=l3(),u=rr(),c=i3();function f(t){var e="https://react.dev/errors/"+t;if(1<arguments.length){e+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)e+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function o(t){var e=t,n=t;if(t.alternate)for(;e.return;)e=e.return;else{t=e;do e=t,(e.flags&4098)!==0&&(n=e.return),t=e.return;while(t)}return e.tag===3?n:null}function h(t){if(t.tag===13){var e=t.memoizedState;if(e===null&&(t=t.alternate,t!==null&&(e=t.memoizedState)),e!==null)return e.dehydrated}return null}function v(t){if(t.tag===31){var e=t.memoizedState;if(e===null&&(t=t.alternate,t!==null&&(e=t.memoizedState)),e!==null)return e.dehydrated}return null}function y(t){if(o(t)!==t)throw Error(f(188))}function A(t){var e=t.alternate;if(!e){if(e=o(t),e===null)throw Error(f(188));return e!==t?null:t}for(var n=t,l=e;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(l=a.return,l!==null){n=l;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return y(a),t;if(s===l)return y(a),e;s=s.sibling}throw Error(f(188))}if(n.return!==l.return)n=a,l=s;else{for(var d=!1,g=a.child;g;){if(g===n){d=!0,n=a,l=s;break}if(g===l){d=!0,l=a,n=s;break}g=g.sibling}if(!d){for(g=s.child;g;){if(g===n){d=!0,n=s,l=a;break}if(g===l){d=!0,l=s,n=a;break}g=g.sibling}if(!d)throw Error(f(189))}}if(n.alternate!==l)throw Error(f(190))}if(n.tag!==3)throw Error(f(188));return n.stateNode.current===n?t:e}function x(t){var e=t.tag;if(e===5||e===26||e===27||e===6)return t;for(t=t.child;t!==null;){if(e=x(t),e!==null)return e;t=t.sibling}return null}var T=Object.assign,D=Symbol.for("react.element"),X=Symbol.for("react.transitional.element"),q=Symbol.for("react.portal"),p=Symbol.for("react.fragment"),E=Symbol.for("react.strict_mode"),b=Symbol.for("react.profiler"),R=Symbol.for("react.consumer"),N=Symbol.for("react.context"),V=Symbol.for("react.forward_ref"),F=Symbol.for("react.suspense"),H=Symbol.for("react.suspense_list"),j=Symbol.for("react.memo"),Y=Symbol.for("react.lazy"),z=Symbol.for("react.activity"),I=Symbol.for("react.memo_cache_sentinel"),k=Symbol.iterator;function nt(t){return t===null||typeof t!="object"?null:(t=k&&t[k]||t["@@iterator"],typeof t=="function"?t:null)}var P=Symbol.for("react.client.reference");function st(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===P?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case p:return"Fragment";case b:return"Profiler";case E:return"StrictMode";case F:return"Suspense";case H:return"SuspenseList";case z:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case q:return"Portal";case N:return t.displayName||"Context";case R:return(t._context.displayName||"Context")+".Consumer";case V:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case j:return e=t.displayName||null,e!==null?e:st(t.type)||"Memo";case Y:e=t._payload,t=t._init;try{return st(t(e))}catch{}}return null}var ut=Array.isArray,M=u.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,_=c.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$={pending:!1,data:null,method:null,action:null},ht=[],tt=-1;function C(t){return{current:t}}function L(t){0>tt||(t.current=ht[tt],ht[tt]=null,tt--)}function W(t,e){tt++,ht[tt]=t.current,t.current=e}var et=C(null),rt=C(null),ot=C(null),gt=C(null);function Jt(t,e){switch(W(ot,e),W(rt,t),W(et,null),e.nodeType){case 9:case 11:t=(t=e.documentElement)&&(t=t.namespaceURI)?Xd(t):0;break;default:if(t=e.tagName,e=e.namespaceURI)e=Xd(e),t=Vd(e,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}L(et),W(et,t)}function Qt(){L(et),L(rt),L(ot)}function Sn(t){t.memoizedState!==null&&W(gt,t);var e=et.current,n=Vd(e,t.type);e!==n&&(W(rt,t),W(et,n))}function ul(t){rt.current===t&&(L(et),L(rt)),gt.current===t&&(L(gt),hi._currentValue=$)}var Tn,jl;function Ee(t){if(Tn===void 0)try{throw Error()}catch(n){var e=n.stack.trim().match(/\n( *(at )?)/);Tn=e&&e[1]||"",jl=-1<n.stack.indexOf(`
    at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
`+Tn+t+jl}var Nl=!1;function Cn(t,e){if(!t||Nl)return"";Nl=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(e){var J=function(){throw Error()};if(Object.defineProperty(J.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(J,[])}catch(G){var Q=G}Reflect.construct(t,[],J)}else{try{J.call()}catch(G){Q=G}t.call(J.prototype)}}else{try{throw Error()}catch(G){Q=G}(J=t())&&typeof J.catch=="function"&&J.catch(function(){})}}catch(G){if(G&&Q&&typeof G.stack=="string")return[G.stack,Q.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var a=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");a&&a.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var s=l.DetermineComponentFrameRoot(),d=s[0],g=s[1];if(d&&g){var S=d.split(`
`),U=g.split(`
`);for(a=l=0;l<S.length&&!S[l].includes("DetermineComponentFrameRoot");)l++;for(;a<U.length&&!U[a].includes("DetermineComponentFrameRoot");)a++;if(l===S.length||a===U.length)for(l=S.length-1,a=U.length-1;1<=l&&0<=a&&S[l]!==U[a];)a--;for(;1<=l&&0<=a;l--,a--)if(S[l]!==U[a]){if(l!==1||a!==1)do if(l--,a--,0>a||S[l]!==U[a]){var Z=`
`+S[l].replace(" at new "," at ");return t.displayName&&Z.includes("<anonymous>")&&(Z=Z.replace("<anonymous>",t.displayName)),Z}while(1<=l&&0<=a);break}}}finally{Nl=!1,Error.prepareStackTrace=n}return(n=t?t.displayName||t.name:"")?Ee(n):""}function Hl(t,e){switch(t.tag){case 26:case 27:case 5:return Ee(t.type);case 16:return Ee("Lazy");case 13:return t.child!==e&&e!==null?Ee("Suspense Fallback"):Ee("Suspense");case 19:return Ee("SuspenseList");case 0:case 15:return Cn(t.type,!1);case 11:return Cn(t.type.render,!1);case 1:return Cn(t.type,!0);case 31:return Ee("Activity");default:return""}}function ji(t){try{var e="",n=null;do e+=Hl(t,n),n=t,t=t.return;while(t);return e}catch(l){return`
Error generating stack: `+l.message+`
`+l.stack}}var rc=Object.prototype.hasOwnProperty,oc=i.unstable_scheduleCallback,dc=i.unstable_cancelCallback,_h=i.unstable_shouldYield,Ph=i.unstable_requestPaint,pe=i.unstable_now,$h=i.unstable_getCurrentPriorityLevel,yr=i.unstable_ImmediatePriority,Er=i.unstable_UserBlockingPriority,Ni=i.unstable_NormalPriority,tm=i.unstable_LowPriority,pr=i.unstable_IdlePriority,em=i.log,nm=i.unstable_setDisableYieldValue,Ca=null,xe=null;function On(t){if(typeof em=="function"&&nm(t),xe&&typeof xe.setStrictMode=="function")try{xe.setStrictMode(Ca,t)}catch{}}var be=Math.clz32?Math.clz32:im,lm=Math.log,am=Math.LN2;function im(t){return t>>>=0,t===0?32:31-(lm(t)/am|0)|0}var Hi=256,Bi=262144,Ui=4194304;function cl(t){var e=t&42;if(e!==0)return e;switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function Qi(t,e,n){var l=t.pendingLanes;if(l===0)return 0;var a=0,s=t.suspendedLanes,d=t.pingedLanes;t=t.warmLanes;var g=l&134217727;return g!==0?(l=g&~s,l!==0?a=cl(l):(d&=g,d!==0?a=cl(d):n||(n=g&~t,n!==0&&(a=cl(n))))):(g=l&~s,g!==0?a=cl(g):d!==0?a=cl(d):n||(n=l&~t,n!==0&&(a=cl(n)))),a===0?0:e!==0&&e!==a&&(e&s)===0&&(s=a&-a,n=e&-e,s>=n||s===32&&(n&4194048)!==0)?e:a}function Oa(t,e){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&e)===0}function um(t,e){switch(t){case 1:case 2:case 4:case 8:case 64:return e+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function xr(){var t=Ui;return Ui<<=1,(Ui&62914560)===0&&(Ui=4194304),t}function hc(t){for(var e=[],n=0;31>n;n++)e.push(t);return e}function Da(t,e){t.pendingLanes|=e,e!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function cm(t,e,n,l,a,s){var d=t.pendingLanes;t.pendingLanes=n,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=n,t.entangledLanes&=n,t.errorRecoveryDisabledLanes&=n,t.shellSuspendCounter=0;var g=t.entanglements,S=t.expirationTimes,U=t.hiddenUpdates;for(n=d&~n;0<n;){var Z=31-be(n),J=1<<Z;g[Z]=0,S[Z]=-1;var Q=U[Z];if(Q!==null)for(U[Z]=null,Z=0;Z<Q.length;Z++){var G=Q[Z];G!==null&&(G.lane&=-536870913)}n&=~J}l!==0&&br(t,l,0),s!==0&&a===0&&t.tag!==0&&(t.suspendedLanes|=s&~(d&~e))}function br(t,e,n){t.pendingLanes|=e,t.suspendedLanes&=~e;var l=31-be(e);t.entangledLanes|=e,t.entanglements[l]=t.entanglements[l]|1073741824|n&261930}function Sr(t,e){var n=t.entangledLanes|=e;for(t=t.entanglements;n;){var l=31-be(n),a=1<<l;a&e|t[l]&e&&(t[l]|=e),n&=~a}}function Tr(t,e){var n=e&-e;return n=(n&42)!==0?1:mc(n),(n&(t.suspendedLanes|e))!==0?0:n}function mc(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function gc(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function Cr(){var t=_.p;return t!==0?t:(t=window.event,t===void 0?32:o1(t.type))}function Or(t,e){var n=_.p;try{return _.p=t,e()}finally{_.p=n}}var Dn=Math.random().toString(36).slice(2),te="__reactFiber$"+Dn,oe="__reactProps$"+Dn,Bl="__reactContainer$"+Dn,Ac="__reactEvents$"+Dn,sm="__reactListeners$"+Dn,fm="__reactHandles$"+Dn,Dr="__reactResources$"+Dn,Ra="__reactMarker$"+Dn;function vc(t){delete t[te],delete t[oe],delete t[Ac],delete t[sm],delete t[fm]}function Ul(t){var e=t[te];if(e)return e;for(var n=t.parentNode;n;){if(e=n[Bl]||n[te]){if(n=e.alternate,e.child!==null||n!==null&&n.child!==null)for(t=Fd(t);t!==null;){if(n=t[te])return n;t=Fd(t)}return e}t=n,n=t.parentNode}return null}function Ql(t){if(t=t[te]||t[Bl]){var e=t.tag;if(e===5||e===6||e===13||e===31||e===26||e===27||e===3)return t}return null}function wa(t){var e=t.tag;if(e===5||e===26||e===27||e===6)return t.stateNode;throw Error(f(33))}function zl(t){var e=t[Dr];return e||(e=t[Dr]={hoistableStyles:new Map,hoistableScripts:new Map}),e}function Ft(t){t[Ra]=!0}var Rr=new Set,wr={};function sl(t,e){Yl(t,e),Yl(t+"Capture",e)}function Yl(t,e){for(wr[t]=e,t=0;t<e.length;t++)Rr.add(e[t])}var rm=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Mr={},jr={};function om(t){return rc.call(jr,t)?!0:rc.call(Mr,t)?!1:rm.test(t)?jr[t]=!0:(Mr[t]=!0,!1)}function zi(t,e,n){if(om(e))if(n===null)t.removeAttribute(e);else{switch(typeof n){case"undefined":case"function":case"symbol":t.removeAttribute(e);return;case"boolean":var l=e.toLowerCase().slice(0,5);if(l!=="data-"&&l!=="aria-"){t.removeAttribute(e);return}}t.setAttribute(e,""+n)}}function Yi(t,e,n){if(n===null)t.removeAttribute(e);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(e);return}t.setAttribute(e,""+n)}}function $e(t,e,n,l){if(l===null)t.removeAttribute(n);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(n);return}t.setAttributeNS(e,n,""+l)}}function je(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function Nr(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function dm(t,e,n){var l=Object.getOwnPropertyDescriptor(t.constructor.prototype,e);if(!t.hasOwnProperty(e)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var a=l.get,s=l.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return a.call(this)},set:function(d){n=""+d,s.call(this,d)}}),Object.defineProperty(t,e,{enumerable:l.enumerable}),{getValue:function(){return n},setValue:function(d){n=""+d},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function yc(t){if(!t._valueTracker){var e=Nr(t)?"checked":"value";t._valueTracker=dm(t,e,""+t[e])}}function Hr(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),l="";return t&&(l=Nr(t)?t.checked?"true":"false":t.value),t=l,t!==n?(e.setValue(t),!0):!1}function Li(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var hm=/[\n"\\]/g;function Ne(t){return t.replace(hm,function(e){return"\\"+e.charCodeAt(0).toString(16)+" "})}function Ec(t,e,n,l,a,s,d,g){t.name="",d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"?t.type=d:t.removeAttribute("type"),e!=null?d==="number"?(e===0&&t.value===""||t.value!=e)&&(t.value=""+je(e)):t.value!==""+je(e)&&(t.value=""+je(e)):d!=="submit"&&d!=="reset"||t.removeAttribute("value"),e!=null?pc(t,d,je(e)):n!=null?pc(t,d,je(n)):l!=null&&t.removeAttribute("value"),a==null&&s!=null&&(t.defaultChecked=!!s),a!=null&&(t.checked=a&&typeof a!="function"&&typeof a!="symbol"),g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"?t.name=""+je(g):t.removeAttribute("name")}function Br(t,e,n,l,a,s,d,g){if(s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"&&(t.type=s),e!=null||n!=null){if(!(s!=="submit"&&s!=="reset"||e!=null)){yc(t);return}n=n!=null?""+je(n):"",e=e!=null?""+je(e):n,g||e===t.value||(t.value=e),t.defaultValue=e}l=l??a,l=typeof l!="function"&&typeof l!="symbol"&&!!l,t.checked=g?t.checked:!!l,t.defaultChecked=!!l,d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"&&(t.name=d),yc(t)}function pc(t,e,n){e==="number"&&Li(t.ownerDocument)===t||t.defaultValue===""+n||(t.defaultValue=""+n)}function Ll(t,e,n,l){if(t=t.options,e){e={};for(var a=0;a<n.length;a++)e["$"+n[a]]=!0;for(n=0;n<t.length;n++)a=e.hasOwnProperty("$"+t[n].value),t[n].selected!==a&&(t[n].selected=a),a&&l&&(t[n].defaultSelected=!0)}else{for(n=""+je(n),e=null,a=0;a<t.length;a++){if(t[a].value===n){t[a].selected=!0,l&&(t[a].defaultSelected=!0);return}e!==null||t[a].disabled||(e=t[a])}e!==null&&(e.selected=!0)}}function Ur(t,e,n){if(e!=null&&(e=""+je(e),e!==t.value&&(t.value=e),n==null)){t.defaultValue!==e&&(t.defaultValue=e);return}t.defaultValue=n!=null?""+je(n):""}function Qr(t,e,n,l){if(e==null){if(l!=null){if(n!=null)throw Error(f(92));if(ut(l)){if(1<l.length)throw Error(f(93));l=l[0]}n=l}n==null&&(n=""),e=n}n=je(e),t.defaultValue=n,l=t.textContent,l===n&&l!==""&&l!==null&&(t.value=l),yc(t)}function Gl(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var mm=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function zr(t,e,n){var l=e.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?l?t.setProperty(e,""):e==="float"?t.cssFloat="":t[e]="":l?t.setProperty(e,n):typeof n!="number"||n===0||mm.has(e)?e==="float"?t.cssFloat=n:t[e]=(""+n).trim():t[e]=n+"px"}function Yr(t,e,n){if(e!=null&&typeof e!="object")throw Error(f(62));if(t=t.style,n!=null){for(var l in n)!n.hasOwnProperty(l)||e!=null&&e.hasOwnProperty(l)||(l.indexOf("--")===0?t.setProperty(l,""):l==="float"?t.cssFloat="":t[l]="");for(var a in e)l=e[a],e.hasOwnProperty(a)&&n[a]!==l&&zr(t,a,l)}else for(var s in e)e.hasOwnProperty(s)&&zr(t,s,e[s])}function xc(t){if(t.indexOf("-")===-1)return!1;switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var gm=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Am=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Gi(t){return Am.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function tn(){}var bc=null;function Sc(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Xl=null,Vl=null;function Lr(t){var e=Ql(t);if(e&&(t=e.stateNode)){var n=t[oe]||null;t:switch(t=e.stateNode,e.type){case"input":if(Ec(t,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),e=n.name,n.type==="radio"&&e!=null){for(n=t;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+Ne(""+e)+'"][type="radio"]'),e=0;e<n.length;e++){var l=n[e];if(l!==t&&l.form===t.form){var a=l[oe]||null;if(!a)throw Error(f(90));Ec(l,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(e=0;e<n.length;e++)l=n[e],l.form===t.form&&Hr(l)}break t;case"textarea":Ur(t,n.value,n.defaultValue);break t;case"select":e=n.value,e!=null&&Ll(t,!!n.multiple,e,!1)}}}var Tc=!1;function Gr(t,e,n){if(Tc)return t(e,n);Tc=!0;try{var l=t(e);return l}finally{if(Tc=!1,(Xl!==null||Vl!==null)&&(Du(),Xl&&(e=Xl,t=Vl,Vl=Xl=null,Lr(e),t)))for(e=0;e<t.length;e++)Lr(t[e])}}function Ma(t,e){var n=t.stateNode;if(n===null)return null;var l=n[oe]||null;if(l===null)return null;n=l[e];t:switch(e){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(l=!l.disabled)||(t=t.type,l=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!l;break t;default:t=!1}if(t)return null;if(n&&typeof n!="function")throw Error(f(231,e,typeof n));return n}var en=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Cc=!1;if(en)try{var ja={};Object.defineProperty(ja,"passive",{get:function(){Cc=!0}}),window.addEventListener("test",ja,ja),window.removeEventListener("test",ja,ja)}catch{Cc=!1}var Rn=null,Oc=null,Xi=null;function Xr(){if(Xi)return Xi;var t,e=Oc,n=e.length,l,a="value"in Rn?Rn.value:Rn.textContent,s=a.length;for(t=0;t<n&&e[t]===a[t];t++);var d=n-t;for(l=1;l<=d&&e[n-l]===a[s-l];l++);return Xi=a.slice(t,1<l?1-l:void 0)}function Vi(t){var e=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&e===13&&(t=13)):t=e,t===10&&(t=13),32<=t||t===13?t:0}function Zi(){return!0}function Vr(){return!1}function de(t){function e(n,l,a,s,d){this._reactName=n,this._targetInst=a,this.type=l,this.nativeEvent=s,this.target=d,this.currentTarget=null;for(var g in t)t.hasOwnProperty(g)&&(n=t[g],this[g]=n?n(s):s[g]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?Zi:Vr,this.isPropagationStopped=Vr,this}return T(e.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Zi)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Zi)},persist:function(){},isPersistent:Zi}),e}var fl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ii=de(fl),Na=T({},fl,{view:0,detail:0}),vm=de(Na),Dc,Rc,Ha,qi=T({},Na,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Mc,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==Ha&&(Ha&&t.type==="mousemove"?(Dc=t.screenX-Ha.screenX,Rc=t.screenY-Ha.screenY):Rc=Dc=0,Ha=t),Dc)},movementY:function(t){return"movementY"in t?t.movementY:Rc}}),Zr=de(qi),ym=T({},qi,{dataTransfer:0}),Em=de(ym),pm=T({},Na,{relatedTarget:0}),wc=de(pm),xm=T({},fl,{animationName:0,elapsedTime:0,pseudoElement:0}),bm=de(xm),Sm=T({},fl,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),Tm=de(Sm),Cm=T({},fl,{data:0}),Ir=de(Cm),Om={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Dm={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Rm={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function wm(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=Rm[t])?!!e[t]:!1}function Mc(){return wm}var Mm=T({},Na,{key:function(t){if(t.key){var e=Om[t.key]||t.key;if(e!=="Unidentified")return e}return t.type==="keypress"?(t=Vi(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?Dm[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Mc,charCode:function(t){return t.type==="keypress"?Vi(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Vi(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),jm=de(Mm),Nm=T({},qi,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),qr=de(Nm),Hm=T({},Na,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Mc}),Bm=de(Hm),Um=T({},fl,{propertyName:0,elapsedTime:0,pseudoElement:0}),Qm=de(Um),zm=T({},qi,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),Ym=de(zm),Lm=T({},fl,{newState:0,oldState:0}),Gm=de(Lm),Xm=[9,13,27,32],jc=en&&"CompositionEvent"in window,Ba=null;en&&"documentMode"in document&&(Ba=document.documentMode);var Vm=en&&"TextEvent"in window&&!Ba,Kr=en&&(!jc||Ba&&8<Ba&&11>=Ba),kr=" ",Jr=!1;function Fr(t,e){switch(t){case"keyup":return Xm.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Wr(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Zl=!1;function Zm(t,e){switch(t){case"compositionend":return Wr(e);case"keypress":return e.which!==32?null:(Jr=!0,kr);case"textInput":return t=e.data,t===kr&&Jr?null:t;default:return null}}function Im(t,e){if(Zl)return t==="compositionend"||!jc&&Fr(t,e)?(t=Xr(),Xi=Oc=Rn=null,Zl=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1<e.char.length)return e.char;if(e.which)return String.fromCharCode(e.which)}return null;case"compositionend":return Kr&&e.locale!=="ko"?null:e.data;default:return null}}var qm={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function _r(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e==="input"?!!qm[t.type]:e==="textarea"}function Pr(t,e,n,l){Xl?Vl?Vl.push(l):Vl=[l]:Xl=l,e=Bu(e,"onChange"),0<e.length&&(n=new Ii("onChange","change",null,n,l),t.push({event:n,listeners:e}))}var Ua=null,Qa=null;function Km(t){Ud(t,0)}function Ki(t){var e=wa(t);if(Hr(e))return t}function $r(t,e){if(t==="change")return e}var t0=!1;if(en){var Nc;if(en){var Hc="oninput"in document;if(!Hc){var e0=document.createElement("div");e0.setAttribute("oninput","return;"),Hc=typeof e0.oninput=="function"}Nc=Hc}else Nc=!1;t0=Nc&&(!document.documentMode||9<document.documentMode)}function n0(){Ua&&(Ua.detachEvent("onpropertychange",l0),Qa=Ua=null)}function l0(t){if(t.propertyName==="value"&&Ki(Qa)){var e=[];Pr(e,Qa,t,Sc(t)),Gr(Km,e)}}function km(t,e,n){t==="focusin"?(n0(),Ua=e,Qa=n,Ua.attachEvent("onpropertychange",l0)):t==="focusout"&&n0()}function Jm(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Ki(Qa)}function Fm(t,e){if(t==="click")return Ki(e)}function Wm(t,e){if(t==="input"||t==="change")return Ki(e)}function _m(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var Se=typeof Object.is=="function"?Object.is:_m;function za(t,e){if(Se(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;var n=Object.keys(t),l=Object.keys(e);if(n.length!==l.length)return!1;for(l=0;l<n.length;l++){var a=n[l];if(!rc.call(e,a)||!Se(t[a],e[a]))return!1}return!0}function a0(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function i0(t,e){var n=a0(t);t=0;for(var l;n;){if(n.nodeType===3){if(l=t+n.textContent.length,t<=e&&l>=e)return{node:n,offset:e-t};t=l}t:{for(;n;){if(n.nextSibling){n=n.nextSibling;break t}n=n.parentNode}n=void 0}n=a0(n)}}function u0(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?u0(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function c0(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var e=Li(t.document);e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=Li(t.document)}return e}function Bc(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}var Pm=en&&"documentMode"in document&&11>=document.documentMode,Il=null,Uc=null,Ya=null,Qc=!1;function s0(t,e,n){var l=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Qc||Il==null||Il!==Li(l)||(l=Il,"selectionStart"in l&&Bc(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),Ya&&za(Ya,l)||(Ya=l,l=Bu(Uc,"onSelect"),0<l.length&&(e=new Ii("onSelect","select",null,e,n),t.push({event:e,listeners:l}),e.target=Il)))}function rl(t,e){var n={};return n[t.toLowerCase()]=e.toLowerCase(),n["Webkit"+t]="webkit"+e,n["Moz"+t]="moz"+e,n}var ql={animationend:rl("Animation","AnimationEnd"),animationiteration:rl("Animation","AnimationIteration"),animationstart:rl("Animation","AnimationStart"),transitionrun:rl("Transition","TransitionRun"),transitionstart:rl("Transition","TransitionStart"),transitioncancel:rl("Transition","TransitionCancel"),transitionend:rl("Transition","TransitionEnd")},zc={},f0={};en&&(f0=document.createElement("div").style,"AnimationEvent"in window||(delete ql.animationend.animation,delete ql.animationiteration.animation,delete ql.animationstart.animation),"TransitionEvent"in window||delete ql.transitionend.transition);function ol(t){if(zc[t])return zc[t];if(!ql[t])return t;var e=ql[t],n;for(n in e)if(e.hasOwnProperty(n)&&n in f0)return zc[t]=e[n];return t}var r0=ol("animationend"),o0=ol("animationiteration"),d0=ol("animationstart"),$m=ol("transitionrun"),tg=ol("transitionstart"),eg=ol("transitioncancel"),h0=ol("transitionend"),m0=new Map,Yc="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Yc.push("scrollEnd");function Ie(t,e){m0.set(t,e),sl(e,[t])}var ki=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var e=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(e))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},He=[],Kl=0,Lc=0;function Ji(){for(var t=Kl,e=Lc=Kl=0;e<t;){var n=He[e];He[e++]=null;var l=He[e];He[e++]=null;var a=He[e];He[e++]=null;var s=He[e];if(He[e++]=null,l!==null&&a!==null){var d=l.pending;d===null?a.next=a:(a.next=d.next,d.next=a),l.pending=a}s!==0&&g0(n,a,s)}}function Fi(t,e,n,l){He[Kl++]=t,He[Kl++]=e,He[Kl++]=n,He[Kl++]=l,Lc|=l,t.lanes|=l,t=t.alternate,t!==null&&(t.lanes|=l)}function Gc(t,e,n,l){return Fi(t,e,n,l),Wi(t)}function dl(t,e){return Fi(t,null,null,e),Wi(t)}function g0(t,e,n){t.lanes|=n;var l=t.alternate;l!==null&&(l.lanes|=n);for(var a=!1,s=t.return;s!==null;)s.childLanes|=n,l=s.alternate,l!==null&&(l.childLanes|=n),s.tag===22&&(t=s.stateNode,t===null||t._visibility&1||(a=!0)),t=s,s=s.return;return t.tag===3?(s=t.stateNode,a&&e!==null&&(a=31-be(n),t=s.hiddenUpdates,l=t[a],l===null?t[a]=[e]:l.push(e),e.lane=n|536870912),s):null}function Wi(t){if(50<ui)throw ui=0,Fs=null,Error(f(185));for(var e=t.return;e!==null;)t=e,e=t.return;return t.tag===3?t.stateNode:null}var kl={};function ng(t,e,n,l){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Te(t,e,n,l){return new ng(t,e,n,l)}function Xc(t){return t=t.prototype,!(!t||!t.isReactComponent)}function nn(t,e){var n=t.alternate;return n===null?(n=Te(t.tag,e,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=t.flags&65011712,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n.refCleanup=t.refCleanup,n}function A0(t,e){t.flags&=65011714;var n=t.alternate;return n===null?(t.childLanes=0,t.lanes=e,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=n.childLanes,t.lanes=n.lanes,t.child=n.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=n.memoizedProps,t.memoizedState=n.memoizedState,t.updateQueue=n.updateQueue,t.type=n.type,e=n.dependencies,t.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),t}function _i(t,e,n,l,a,s){var d=0;if(l=t,typeof t=="function")Xc(t)&&(d=1);else if(typeof t=="string")d=cA(t,n,et.current)?26:t==="html"||t==="head"||t==="body"?27:5;else t:switch(t){case z:return t=Te(31,n,e,a),t.elementType=z,t.lanes=s,t;case p:return hl(n.children,a,s,e);case E:d=8,a|=24;break;case b:return t=Te(12,n,e,a|2),t.elementType=b,t.lanes=s,t;case F:return t=Te(13,n,e,a),t.elementType=F,t.lanes=s,t;case H:return t=Te(19,n,e,a),t.elementType=H,t.lanes=s,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case N:d=10;break t;case R:d=9;break t;case V:d=11;break t;case j:d=14;break t;case Y:d=16,l=null;break t}d=29,n=Error(f(130,t===null?"null":typeof t,"")),l=null}return e=Te(d,n,e,a),e.elementType=t,e.type=l,e.lanes=s,e}function hl(t,e,n,l){return t=Te(7,t,l,e),t.lanes=n,t}function Vc(t,e,n){return t=Te(6,t,null,e),t.lanes=n,t}function v0(t){var e=Te(18,null,null,0);return e.stateNode=t,e}function Zc(t,e,n){return e=Te(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}var y0=new WeakMap;function Be(t,e){if(typeof t=="object"&&t!==null){var n=y0.get(t);return n!==void 0?n:(e={value:t,source:e,stack:ji(e)},y0.set(t,e),e)}return{value:t,source:e,stack:ji(e)}}var Jl=[],Fl=0,Pi=null,La=0,Ue=[],Qe=0,wn=null,Je=1,Fe="";function ln(t,e){Jl[Fl++]=La,Jl[Fl++]=Pi,Pi=t,La=e}function E0(t,e,n){Ue[Qe++]=Je,Ue[Qe++]=Fe,Ue[Qe++]=wn,wn=t;var l=Je;t=Fe;var a=32-be(l)-1;l&=~(1<<a),n+=1;var s=32-be(e)+a;if(30<s){var d=a-a%5;s=(l&(1<<d)-1).toString(32),l>>=d,a-=d,Je=1<<32-be(e)+a|n<<a|l,Fe=s+t}else Je=1<<s|n<<a|l,Fe=t}function Ic(t){t.return!==null&&(ln(t,1),E0(t,1,0))}function qc(t){for(;t===Pi;)Pi=Jl[--Fl],Jl[Fl]=null,La=Jl[--Fl],Jl[Fl]=null;for(;t===wn;)wn=Ue[--Qe],Ue[Qe]=null,Fe=Ue[--Qe],Ue[Qe]=null,Je=Ue[--Qe],Ue[Qe]=null}function p0(t,e){Ue[Qe++]=Je,Ue[Qe++]=Fe,Ue[Qe++]=wn,Je=e.id,Fe=e.overflow,wn=t}var ee=null,Nt=null,xt=!1,Mn=null,ze=!1,Kc=Error(f(519));function jn(t){var e=Error(f(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Ga(Be(e,t)),Kc}function x0(t){var e=t.stateNode,n=t.type,l=t.memoizedProps;switch(e[te]=t,e[oe]=l,n){case"dialog":yt("cancel",e),yt("close",e);break;case"iframe":case"object":case"embed":yt("load",e);break;case"video":case"audio":for(n=0;n<si.length;n++)yt(si[n],e);break;case"source":yt("error",e);break;case"img":case"image":case"link":yt("error",e),yt("load",e);break;case"details":yt("toggle",e);break;case"input":yt("invalid",e),Br(e,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":yt("invalid",e);break;case"textarea":yt("invalid",e),Qr(e,l.value,l.defaultValue,l.children)}n=l.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||e.textContent===""+n||l.suppressHydrationWarning===!0||Ld(e.textContent,n)?(l.popover!=null&&(yt("beforetoggle",e),yt("toggle",e)),l.onScroll!=null&&yt("scroll",e),l.onScrollEnd!=null&&yt("scrollend",e),l.onClick!=null&&(e.onclick=tn),e=!0):e=!1,e||jn(t,!0)}function b0(t){for(ee=t.return;ee;)switch(ee.tag){case 5:case 31:case 13:ze=!1;return;case 27:case 3:ze=!0;return;default:ee=ee.return}}function Wl(t){if(t!==ee)return!1;if(!xt)return b0(t),xt=!0,!1;var e=t.tag,n;if((n=e!==3&&e!==27)&&((n=e===5)&&(n=t.type,n=!(n!=="form"&&n!=="button")||of(t.type,t.memoizedProps)),n=!n),n&&Nt&&jn(t),b0(t),e===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(f(317));Nt=Jd(t)}else if(e===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(f(317));Nt=Jd(t)}else e===27?(e=Nt,qn(t.type)?(t=Af,Af=null,Nt=t):Nt=e):Nt=ee?Le(t.stateNode.nextSibling):null;return!0}function ml(){Nt=ee=null,xt=!1}function kc(){var t=Mn;return t!==null&&(Ae===null?Ae=t:Ae.push.apply(Ae,t),Mn=null),t}function Ga(t){Mn===null?Mn=[t]:Mn.push(t)}var Jc=C(null),gl=null,an=null;function Nn(t,e,n){W(Jc,e._currentValue),e._currentValue=n}function un(t){t._currentValue=Jc.current,L(Jc)}function Fc(t,e,n){for(;t!==null;){var l=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,l!==null&&(l.childLanes|=e)):l!==null&&(l.childLanes&e)!==e&&(l.childLanes|=e),t===n)break;t=t.return}}function Wc(t,e,n,l){var a=t.child;for(a!==null&&(a.return=t);a!==null;){var s=a.dependencies;if(s!==null){var d=a.child;s=s.firstContext;t:for(;s!==null;){var g=s;s=a;for(var S=0;S<e.length;S++)if(g.context===e[S]){s.lanes|=n,g=s.alternate,g!==null&&(g.lanes|=n),Fc(s.return,n,t),l||(d=null);break t}s=g.next}}else if(a.tag===18){if(d=a.return,d===null)throw Error(f(341));d.lanes|=n,s=d.alternate,s!==null&&(s.lanes|=n),Fc(d,n,t),d=null}else d=a.child;if(d!==null)d.return=a;else for(d=a;d!==null;){if(d===t){d=null;break}if(a=d.sibling,a!==null){a.return=d.return,d=a;break}d=d.return}a=d}}function _l(t,e,n,l){t=null;for(var a=e,s=!1;a!==null;){if(!s){if((a.flags&524288)!==0)s=!0;else if((a.flags&262144)!==0)break}if(a.tag===10){var d=a.alternate;if(d===null)throw Error(f(387));if(d=d.memoizedProps,d!==null){var g=a.type;Se(a.pendingProps.value,d.value)||(t!==null?t.push(g):t=[g])}}else if(a===gt.current){if(d=a.alternate,d===null)throw Error(f(387));d.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(t!==null?t.push(hi):t=[hi])}a=a.return}t!==null&&Wc(e,t,n,l),e.flags|=262144}function $i(t){for(t=t.firstContext;t!==null;){if(!Se(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function Al(t){gl=t,an=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function ne(t){return S0(gl,t)}function tu(t,e){return gl===null&&Al(t),S0(t,e)}function S0(t,e){var n=e._currentValue;if(e={context:e,memoizedValue:n,next:null},an===null){if(t===null)throw Error(f(308));an=e,t.dependencies={lanes:0,firstContext:e},t.flags|=524288}else an=an.next=e;return n}var lg=typeof AbortController<"u"?AbortController:function(){var t=[],e=this.signal={aborted:!1,addEventListener:function(n,l){t.push(l)}};this.abort=function(){e.aborted=!0,t.forEach(function(n){return n()})}},ag=i.unstable_scheduleCallback,ig=i.unstable_NormalPriority,Zt={$$typeof:N,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function _c(){return{controller:new lg,data:new Map,refCount:0}}function Xa(t){t.refCount--,t.refCount===0&&ag(ig,function(){t.controller.abort()})}var Va=null,Pc=0,Pl=0,$l=null;function ug(t,e){if(Va===null){var n=Va=[];Pc=0,Pl=ef(),$l={status:"pending",value:void 0,then:function(l){n.push(l)}}}return Pc++,e.then(T0,T0),e}function T0(){if(--Pc===0&&Va!==null){$l!==null&&($l.status="fulfilled");var t=Va;Va=null,Pl=0,$l=null;for(var e=0;e<t.length;e++)(0,t[e])()}}function cg(t,e){var n=[],l={status:"pending",value:null,reason:null,then:function(a){n.push(a)}};return t.then(function(){l.status="fulfilled",l.value=e;for(var a=0;a<n.length;a++)(0,n[a])(e)},function(a){for(l.status="rejected",l.reason=a,a=0;a<n.length;a++)(0,n[a])(void 0)}),l}var C0=M.S;M.S=function(t,e){fd=pe(),typeof e=="object"&&e!==null&&typeof e.then=="function"&&ug(t,e),C0!==null&&C0(t,e)};var vl=C(null);function $c(){var t=vl.current;return t!==null?t:jt.pooledCache}function eu(t,e){e===null?W(vl,vl.current):W(vl,e.pool)}function O0(){var t=$c();return t===null?null:{parent:Zt._currentValue,pool:t}}var ta=Error(f(460)),ts=Error(f(474)),nu=Error(f(542)),lu={then:function(){}};function D0(t){return t=t.status,t==="fulfilled"||t==="rejected"}function R0(t,e,n){switch(n=t[n],n===void 0?t.push(e):n!==e&&(e.then(tn,tn),e=n),e.status){case"fulfilled":return e.value;case"rejected":throw t=e.reason,M0(t),t;default:if(typeof e.status=="string")e.then(tn,tn);else{if(t=jt,t!==null&&100<t.shellSuspendCounter)throw Error(f(482));t=e,t.status="pending",t.then(function(l){if(e.status==="pending"){var a=e;a.status="fulfilled",a.value=l}},function(l){if(e.status==="pending"){var a=e;a.status="rejected",a.reason=l}})}switch(e.status){case"fulfilled":return e.value;case"rejected":throw t=e.reason,M0(t),t}throw El=e,ta}}function yl(t){try{var e=t._init;return e(t._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(El=n,ta):n}}var El=null;function w0(){if(El===null)throw Error(f(459));var t=El;return El=null,t}function M0(t){if(t===ta||t===nu)throw Error(f(483))}var ea=null,Za=0;function au(t){var e=Za;return Za+=1,ea===null&&(ea=[]),R0(ea,t,e)}function Ia(t,e){e=e.props.ref,t.ref=e!==void 0?e:null}function iu(t,e){throw e.$$typeof===D?Error(f(525)):(t=Object.prototype.toString.call(e),Error(f(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)))}function j0(t){function e(w,O){if(t){var B=w.deletions;B===null?(w.deletions=[O],w.flags|=16):B.push(O)}}function n(w,O){if(!t)return null;for(;O!==null;)e(w,O),O=O.sibling;return null}function l(w){for(var O=new Map;w!==null;)w.key!==null?O.set(w.key,w):O.set(w.index,w),w=w.sibling;return O}function a(w,O){return w=nn(w,O),w.index=0,w.sibling=null,w}function s(w,O,B){return w.index=B,t?(B=w.alternate,B!==null?(B=B.index,B<O?(w.flags|=67108866,O):B):(w.flags|=67108866,O)):(w.flags|=1048576,O)}function d(w){return t&&w.alternate===null&&(w.flags|=67108866),w}function g(w,O,B,K){return O===null||O.tag!==6?(O=Vc(B,w.mode,K),O.return=w,O):(O=a(O,B),O.return=w,O)}function S(w,O,B,K){var ct=B.type;return ct===p?Z(w,O,B.props.children,K,B.key):O!==null&&(O.elementType===ct||typeof ct=="object"&&ct!==null&&ct.$$typeof===Y&&yl(ct)===O.type)?(O=a(O,B.props),Ia(O,B),O.return=w,O):(O=_i(B.type,B.key,B.props,null,w.mode,K),Ia(O,B),O.return=w,O)}function U(w,O,B,K){return O===null||O.tag!==4||O.stateNode.containerInfo!==B.containerInfo||O.stateNode.implementation!==B.implementation?(O=Zc(B,w.mode,K),O.return=w,O):(O=a(O,B.children||[]),O.return=w,O)}function Z(w,O,B,K,ct){return O===null||O.tag!==7?(O=hl(B,w.mode,K,ct),O.return=w,O):(O=a(O,B),O.return=w,O)}function J(w,O,B){if(typeof O=="string"&&O!==""||typeof O=="number"||typeof O=="bigint")return O=Vc(""+O,w.mode,B),O.return=w,O;if(typeof O=="object"&&O!==null){switch(O.$$typeof){case X:return B=_i(O.type,O.key,O.props,null,w.mode,B),Ia(B,O),B.return=w,B;case q:return O=Zc(O,w.mode,B),O.return=w,O;case Y:return O=yl(O),J(w,O,B)}if(ut(O)||nt(O))return O=hl(O,w.mode,B,null),O.return=w,O;if(typeof O.then=="function")return J(w,au(O),B);if(O.$$typeof===N)return J(w,tu(w,O),B);iu(w,O)}return null}function Q(w,O,B,K){var ct=O!==null?O.key:null;if(typeof B=="string"&&B!==""||typeof B=="number"||typeof B=="bigint")return ct!==null?null:g(w,O,""+B,K);if(typeof B=="object"&&B!==null){switch(B.$$typeof){case X:return B.key===ct?S(w,O,B,K):null;case q:return B.key===ct?U(w,O,B,K):null;case Y:return B=yl(B),Q(w,O,B,K)}if(ut(B)||nt(B))return ct!==null?null:Z(w,O,B,K,null);if(typeof B.then=="function")return Q(w,O,au(B),K);if(B.$$typeof===N)return Q(w,O,tu(w,B),K);iu(w,B)}return null}function G(w,O,B,K,ct){if(typeof K=="string"&&K!==""||typeof K=="number"||typeof K=="bigint")return w=w.get(B)||null,g(O,w,""+K,ct);if(typeof K=="object"&&K!==null){switch(K.$$typeof){case X:return w=w.get(K.key===null?B:K.key)||null,S(O,w,K,ct);case q:return w=w.get(K.key===null?B:K.key)||null,U(O,w,K,ct);case Y:return K=yl(K),G(w,O,B,K,ct)}if(ut(K)||nt(K))return w=w.get(B)||null,Z(O,w,K,ct,null);if(typeof K.then=="function")return G(w,O,B,au(K),ct);if(K.$$typeof===N)return G(w,O,B,tu(O,K),ct);iu(O,K)}return null}function lt(w,O,B,K){for(var ct=null,St=null,at=O,At=O=0,pt=null;at!==null&&At<B.length;At++){at.index>At?(pt=at,at=null):pt=at.sibling;var Tt=Q(w,at,B[At],K);if(Tt===null){at===null&&(at=pt);break}t&&at&&Tt.alternate===null&&e(w,at),O=s(Tt,O,At),St===null?ct=Tt:St.sibling=Tt,St=Tt,at=pt}if(At===B.length)return n(w,at),xt&&ln(w,At),ct;if(at===null){for(;At<B.length;At++)at=J(w,B[At],K),at!==null&&(O=s(at,O,At),St===null?ct=at:St.sibling=at,St=at);return xt&&ln(w,At),ct}for(at=l(at);At<B.length;At++)pt=G(at,w,At,B[At],K),pt!==null&&(t&&pt.alternate!==null&&at.delete(pt.key===null?At:pt.key),O=s(pt,O,At),St===null?ct=pt:St.sibling=pt,St=pt);return t&&at.forEach(function(Wn){return e(w,Wn)}),xt&&ln(w,At),ct}function ft(w,O,B,K){if(B==null)throw Error(f(151));for(var ct=null,St=null,at=O,At=O=0,pt=null,Tt=B.next();at!==null&&!Tt.done;At++,Tt=B.next()){at.index>At?(pt=at,at=null):pt=at.sibling;var Wn=Q(w,at,Tt.value,K);if(Wn===null){at===null&&(at=pt);break}t&&at&&Wn.alternate===null&&e(w,at),O=s(Wn,O,At),St===null?ct=Wn:St.sibling=Wn,St=Wn,at=pt}if(Tt.done)return n(w,at),xt&&ln(w,At),ct;if(at===null){for(;!Tt.done;At++,Tt=B.next())Tt=J(w,Tt.value,K),Tt!==null&&(O=s(Tt,O,At),St===null?ct=Tt:St.sibling=Tt,St=Tt);return xt&&ln(w,At),ct}for(at=l(at);!Tt.done;At++,Tt=B.next())Tt=G(at,w,At,Tt.value,K),Tt!==null&&(t&&Tt.alternate!==null&&at.delete(Tt.key===null?At:Tt.key),O=s(Tt,O,At),St===null?ct=Tt:St.sibling=Tt,St=Tt);return t&&at.forEach(function(yA){return e(w,yA)}),xt&&ln(w,At),ct}function Mt(w,O,B,K){if(typeof B=="object"&&B!==null&&B.type===p&&B.key===null&&(B=B.props.children),typeof B=="object"&&B!==null){switch(B.$$typeof){case X:t:{for(var ct=B.key;O!==null;){if(O.key===ct){if(ct=B.type,ct===p){if(O.tag===7){n(w,O.sibling),K=a(O,B.props.children),K.return=w,w=K;break t}}else if(O.elementType===ct||typeof ct=="object"&&ct!==null&&ct.$$typeof===Y&&yl(ct)===O.type){n(w,O.sibling),K=a(O,B.props),Ia(K,B),K.return=w,w=K;break t}n(w,O);break}else e(w,O);O=O.sibling}B.type===p?(K=hl(B.props.children,w.mode,K,B.key),K.return=w,w=K):(K=_i(B.type,B.key,B.props,null,w.mode,K),Ia(K,B),K.return=w,w=K)}return d(w);case q:t:{for(ct=B.key;O!==null;){if(O.key===ct)if(O.tag===4&&O.stateNode.containerInfo===B.containerInfo&&O.stateNode.implementation===B.implementation){n(w,O.sibling),K=a(O,B.children||[]),K.return=w,w=K;break t}else{n(w,O);break}else e(w,O);O=O.sibling}K=Zc(B,w.mode,K),K.return=w,w=K}return d(w);case Y:return B=yl(B),Mt(w,O,B,K)}if(ut(B))return lt(w,O,B,K);if(nt(B)){if(ct=nt(B),typeof ct!="function")throw Error(f(150));return B=ct.call(B),ft(w,O,B,K)}if(typeof B.then=="function")return Mt(w,O,au(B),K);if(B.$$typeof===N)return Mt(w,O,tu(w,B),K);iu(w,B)}return typeof B=="string"&&B!==""||typeof B=="number"||typeof B=="bigint"?(B=""+B,O!==null&&O.tag===6?(n(w,O.sibling),K=a(O,B),K.return=w,w=K):(n(w,O),K=Vc(B,w.mode,K),K.return=w,w=K),d(w)):n(w,O)}return function(w,O,B,K){try{Za=0;var ct=Mt(w,O,B,K);return ea=null,ct}catch(at){if(at===ta||at===nu)throw at;var St=Te(29,at,null,w.mode);return St.lanes=K,St.return=w,St}finally{}}}var pl=j0(!0),N0=j0(!1),Hn=!1;function es(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function ns(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function Bn(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Un(t,e,n){var l=t.updateQueue;if(l===null)return null;if(l=l.shared,(Ct&2)!==0){var a=l.pending;return a===null?e.next=e:(e.next=a.next,a.next=e),l.pending=e,e=Wi(t),g0(t,null,n),e}return Fi(t,l,e,n),Wi(t)}function qa(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194048)!==0)){var l=e.lanes;l&=t.pendingLanes,n|=l,e.lanes=n,Sr(t,n)}}function ls(t,e){var n=t.updateQueue,l=t.alternate;if(l!==null&&(l=l.updateQueue,n===l)){var a=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var d={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};s===null?a=s=d:s=s.next=d,n=n.next}while(n!==null);s===null?a=s=e:s=s.next=e}else a=s=e;n={baseState:l.baseState,firstBaseUpdate:a,lastBaseUpdate:s,shared:l.shared,callbacks:l.callbacks},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}var as=!1;function Ka(){if(as){var t=$l;if(t!==null)throw t}}function ka(t,e,n,l){as=!1;var a=t.updateQueue;Hn=!1;var s=a.firstBaseUpdate,d=a.lastBaseUpdate,g=a.shared.pending;if(g!==null){a.shared.pending=null;var S=g,U=S.next;S.next=null,d===null?s=U:d.next=U,d=S;var Z=t.alternate;Z!==null&&(Z=Z.updateQueue,g=Z.lastBaseUpdate,g!==d&&(g===null?Z.firstBaseUpdate=U:g.next=U,Z.lastBaseUpdate=S))}if(s!==null){var J=a.baseState;d=0,Z=U=S=null,g=s;do{var Q=g.lane&-536870913,G=Q!==g.lane;if(G?(Et&Q)===Q:(l&Q)===Q){Q!==0&&Q===Pl&&(as=!0),Z!==null&&(Z=Z.next={lane:0,tag:g.tag,payload:g.payload,callback:null,next:null});t:{var lt=t,ft=g;Q=e;var Mt=n;switch(ft.tag){case 1:if(lt=ft.payload,typeof lt=="function"){J=lt.call(Mt,J,Q);break t}J=lt;break t;case 3:lt.flags=lt.flags&-65537|128;case 0:if(lt=ft.payload,Q=typeof lt=="function"?lt.call(Mt,J,Q):lt,Q==null)break t;J=T({},J,Q);break t;case 2:Hn=!0}}Q=g.callback,Q!==null&&(t.flags|=64,G&&(t.flags|=8192),G=a.callbacks,G===null?a.callbacks=[Q]:G.push(Q))}else G={lane:Q,tag:g.tag,payload:g.payload,callback:g.callback,next:null},Z===null?(U=Z=G,S=J):Z=Z.next=G,d|=Q;if(g=g.next,g===null){if(g=a.shared.pending,g===null)break;G=g,g=G.next,G.next=null,a.lastBaseUpdate=G,a.shared.pending=null}}while(!0);Z===null&&(S=J),a.baseState=S,a.firstBaseUpdate=U,a.lastBaseUpdate=Z,s===null&&(a.shared.lanes=0),Gn|=d,t.lanes=d,t.memoizedState=J}}function H0(t,e){if(typeof t!="function")throw Error(f(191,t));t.call(e)}function B0(t,e){var n=t.callbacks;if(n!==null)for(t.callbacks=null,t=0;t<n.length;t++)H0(n[t],e)}var na=C(null),uu=C(0);function U0(t,e){t=gn,W(uu,t),W(na,e),gn=t|e.baseLanes}function is(){W(uu,gn),W(na,na.current)}function us(){gn=uu.current,L(na),L(uu)}var Ce=C(null),Ye=null;function Qn(t){var e=t.alternate;W(Xt,Xt.current&1),W(Ce,t),Ye===null&&(e===null||na.current!==null||e.memoizedState!==null)&&(Ye=t)}function cs(t){W(Xt,Xt.current),W(Ce,t),Ye===null&&(Ye=t)}function Q0(t){t.tag===22?(W(Xt,Xt.current),W(Ce,t),Ye===null&&(Ye=t)):zn()}function zn(){W(Xt,Xt.current),W(Ce,Ce.current)}function Oe(t){L(Ce),Ye===t&&(Ye=null),L(Xt)}var Xt=C(0);function cu(t){for(var e=t;e!==null;){if(e.tag===13){var n=e.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||mf(n)||gf(n)))return e}else if(e.tag===19&&(e.memoizedProps.revealOrder==="forwards"||e.memoizedProps.revealOrder==="backwards"||e.memoizedProps.revealOrder==="unstable_legacy-backwards"||e.memoizedProps.revealOrder==="together")){if((e.flags&128)!==0)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var cn=0,mt=null,Rt=null,It=null,su=!1,la=!1,xl=!1,fu=0,Ja=0,aa=null,sg=0;function Lt(){throw Error(f(321))}function ss(t,e){if(e===null)return!1;for(var n=0;n<e.length&&n<t.length;n++)if(!Se(t[n],e[n]))return!1;return!0}function fs(t,e,n,l,a,s){return cn=s,mt=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,M.H=t===null||t.memoizedState===null?po:Ts,xl=!1,s=n(l,a),xl=!1,la&&(s=Y0(e,n,l,a)),z0(t),s}function z0(t){M.H=_a;var e=Rt!==null&&Rt.next!==null;if(cn=0,It=Rt=mt=null,su=!1,Ja=0,aa=null,e)throw Error(f(300));t===null||qt||(t=t.dependencies,t!==null&&$i(t)&&(qt=!0))}function Y0(t,e,n,l){mt=t;var a=0;do{if(la&&(aa=null),Ja=0,la=!1,25<=a)throw Error(f(301));if(a+=1,It=Rt=null,t.updateQueue!=null){var s=t.updateQueue;s.lastEffect=null,s.events=null,s.stores=null,s.memoCache!=null&&(s.memoCache.index=0)}M.H=xo,s=e(n,l)}while(la);return s}function fg(){var t=M.H,e=t.useState()[0];return e=typeof e.then=="function"?Fa(e):e,t=t.useState()[0],(Rt!==null?Rt.memoizedState:null)!==t&&(mt.flags|=1024),e}function rs(){var t=fu!==0;return fu=0,t}function os(t,e,n){e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~n}function ds(t){if(su){for(t=t.memoizedState;t!==null;){var e=t.queue;e!==null&&(e.pending=null),t=t.next}su=!1}cn=0,It=Rt=mt=null,la=!1,Ja=fu=0,aa=null}function fe(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return It===null?mt.memoizedState=It=t:It=It.next=t,It}function Vt(){if(Rt===null){var t=mt.alternate;t=t!==null?t.memoizedState:null}else t=Rt.next;var e=It===null?mt.memoizedState:It.next;if(e!==null)It=e,Rt=t;else{if(t===null)throw mt.alternate===null?Error(f(467)):Error(f(310));Rt=t,t={memoizedState:Rt.memoizedState,baseState:Rt.baseState,baseQueue:Rt.baseQueue,queue:Rt.queue,next:null},It===null?mt.memoizedState=It=t:It=It.next=t}return It}function ru(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Fa(t){var e=Ja;return Ja+=1,aa===null&&(aa=[]),t=R0(aa,t,e),e=mt,(It===null?e.memoizedState:It.next)===null&&(e=e.alternate,M.H=e===null||e.memoizedState===null?po:Ts),t}function ou(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return Fa(t);if(t.$$typeof===N)return ne(t)}throw Error(f(438,String(t)))}function hs(t){var e=null,n=mt.updateQueue;if(n!==null&&(e=n.memoCache),e==null){var l=mt.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(e={data:l.data.map(function(a){return a.slice()}),index:0})))}if(e==null&&(e={data:[],index:0}),n===null&&(n=ru(),mt.updateQueue=n),n.memoCache=e,n=e.data[e.index],n===void 0)for(n=e.data[e.index]=Array(t),l=0;l<t;l++)n[l]=I;return e.index++,n}function sn(t,e){return typeof e=="function"?e(t):e}function du(t){var e=Vt();return ms(e,Rt,t)}function ms(t,e,n){var l=t.queue;if(l===null)throw Error(f(311));l.lastRenderedReducer=n;var a=t.baseQueue,s=l.pending;if(s!==null){if(a!==null){var d=a.next;a.next=s.next,s.next=d}e.baseQueue=a=s,l.pending=null}if(s=t.baseState,a===null)t.memoizedState=s;else{e=a.next;var g=d=null,S=null,U=e,Z=!1;do{var J=U.lane&-536870913;if(J!==U.lane?(Et&J)===J:(cn&J)===J){var Q=U.revertLane;if(Q===0)S!==null&&(S=S.next={lane:0,revertLane:0,gesture:null,action:U.action,hasEagerState:U.hasEagerState,eagerState:U.eagerState,next:null}),J===Pl&&(Z=!0);else if((cn&Q)===Q){U=U.next,Q===Pl&&(Z=!0);continue}else J={lane:0,revertLane:U.revertLane,gesture:null,action:U.action,hasEagerState:U.hasEagerState,eagerState:U.eagerState,next:null},S===null?(g=S=J,d=s):S=S.next=J,mt.lanes|=Q,Gn|=Q;J=U.action,xl&&n(s,J),s=U.hasEagerState?U.eagerState:n(s,J)}else Q={lane:J,revertLane:U.revertLane,gesture:U.gesture,action:U.action,hasEagerState:U.hasEagerState,eagerState:U.eagerState,next:null},S===null?(g=S=Q,d=s):S=S.next=Q,mt.lanes|=J,Gn|=J;U=U.next}while(U!==null&&U!==e);if(S===null?d=s:S.next=g,!Se(s,t.memoizedState)&&(qt=!0,Z&&(n=$l,n!==null)))throw n;t.memoizedState=s,t.baseState=d,t.baseQueue=S,l.lastRenderedState=s}return a===null&&(l.lanes=0),[t.memoizedState,l.dispatch]}function gs(t){var e=Vt(),n=e.queue;if(n===null)throw Error(f(311));n.lastRenderedReducer=t;var l=n.dispatch,a=n.pending,s=e.memoizedState;if(a!==null){n.pending=null;var d=a=a.next;do s=t(s,d.action),d=d.next;while(d!==a);Se(s,e.memoizedState)||(qt=!0),e.memoizedState=s,e.baseQueue===null&&(e.baseState=s),n.lastRenderedState=s}return[s,l]}function L0(t,e,n){var l=mt,a=Vt(),s=xt;if(s){if(n===void 0)throw Error(f(407));n=n()}else n=e();var d=!Se((Rt||a).memoizedState,n);if(d&&(a.memoizedState=n,qt=!0),a=a.queue,ys(V0.bind(null,l,a,t),[t]),a.getSnapshot!==e||d||It!==null&&It.memoizedState.tag&1){if(l.flags|=2048,ia(9,{destroy:void 0},X0.bind(null,l,a,n,e),null),jt===null)throw Error(f(349));s||(cn&127)!==0||G0(l,e,n)}return n}function G0(t,e,n){t.flags|=16384,t={getSnapshot:e,value:n},e=mt.updateQueue,e===null?(e=ru(),mt.updateQueue=e,e.stores=[t]):(n=e.stores,n===null?e.stores=[t]:n.push(t))}function X0(t,e,n,l){e.value=n,e.getSnapshot=l,Z0(e)&&I0(t)}function V0(t,e,n){return n(function(){Z0(e)&&I0(t)})}function Z0(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!Se(t,n)}catch{return!0}}function I0(t){var e=dl(t,2);e!==null&&ve(e,t,2)}function As(t){var e=fe();if(typeof t=="function"){var n=t;if(t=n(),xl){On(!0);try{n()}finally{On(!1)}}}return e.memoizedState=e.baseState=t,e.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:sn,lastRenderedState:t},e}function q0(t,e,n,l){return t.baseState=n,ms(t,Rt,typeof l=="function"?l:sn)}function rg(t,e,n,l,a){if(gu(t))throw Error(f(485));if(t=e.action,t!==null){var s={payload:a,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(d){s.listeners.push(d)}};M.T!==null?n(!0):s.isTransition=!1,l(s),n=e.pending,n===null?(s.next=e.pending=s,K0(e,s)):(s.next=n.next,e.pending=n.next=s)}}function K0(t,e){var n=e.action,l=e.payload,a=t.state;if(e.isTransition){var s=M.T,d={};M.T=d;try{var g=n(a,l),S=M.S;S!==null&&S(d,g),k0(t,e,g)}catch(U){vs(t,e,U)}finally{s!==null&&d.types!==null&&(s.types=d.types),M.T=s}}else try{s=n(a,l),k0(t,e,s)}catch(U){vs(t,e,U)}}function k0(t,e,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(l){J0(t,e,l)},function(l){return vs(t,e,l)}):J0(t,e,n)}function J0(t,e,n){e.status="fulfilled",e.value=n,F0(e),t.state=n,e=t.pending,e!==null&&(n=e.next,n===e?t.pending=null:(n=n.next,e.next=n,K0(t,n)))}function vs(t,e,n){var l=t.pending;if(t.pending=null,l!==null){l=l.next;do e.status="rejected",e.reason=n,F0(e),e=e.next;while(e!==l)}t.action=null}function F0(t){t=t.listeners;for(var e=0;e<t.length;e++)(0,t[e])()}function W0(t,e){return e}function _0(t,e){if(xt){var n=jt.formState;if(n!==null){t:{var l=mt;if(xt){if(Nt){e:{for(var a=Nt,s=ze;a.nodeType!==8;){if(!s){a=null;break e}if(a=Le(a.nextSibling),a===null){a=null;break e}}s=a.data,a=s==="F!"||s==="F"?a:null}if(a){Nt=Le(a.nextSibling),l=a.data==="F!";break t}}jn(l)}l=!1}l&&(e=n[0])}}return n=fe(),n.memoizedState=n.baseState=e,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:W0,lastRenderedState:e},n.queue=l,n=vo.bind(null,mt,l),l.dispatch=n,l=As(!1),s=Ss.bind(null,mt,!1,l.queue),l=fe(),a={state:e,dispatch:null,action:t,pending:null},l.queue=a,n=rg.bind(null,mt,a,s,n),a.dispatch=n,l.memoizedState=t,[e,n,!1]}function P0(t){var e=Vt();return $0(e,Rt,t)}function $0(t,e,n){if(e=ms(t,e,W0)[0],t=du(sn)[0],typeof e=="object"&&e!==null&&typeof e.then=="function")try{var l=Fa(e)}catch(d){throw d===ta?nu:d}else l=e;e=Vt();var a=e.queue,s=a.dispatch;return n!==e.memoizedState&&(mt.flags|=2048,ia(9,{destroy:void 0},og.bind(null,a,n),null)),[l,s,t]}function og(t,e){t.action=e}function to(t){var e=Vt(),n=Rt;if(n!==null)return $0(e,n,t);Vt(),e=e.memoizedState,n=Vt();var l=n.queue.dispatch;return n.memoizedState=t,[e,l,!1]}function ia(t,e,n,l){return t={tag:t,create:n,deps:l,inst:e,next:null},e=mt.updateQueue,e===null&&(e=ru(),mt.updateQueue=e),n=e.lastEffect,n===null?e.lastEffect=t.next=t:(l=n.next,n.next=t,t.next=l,e.lastEffect=t),t}function eo(){return Vt().memoizedState}function hu(t,e,n,l){var a=fe();mt.flags|=t,a.memoizedState=ia(1|e,{destroy:void 0},n,l===void 0?null:l)}function mu(t,e,n,l){var a=Vt();l=l===void 0?null:l;var s=a.memoizedState.inst;Rt!==null&&l!==null&&ss(l,Rt.memoizedState.deps)?a.memoizedState=ia(e,s,n,l):(mt.flags|=t,a.memoizedState=ia(1|e,s,n,l))}function no(t,e){hu(8390656,8,t,e)}function ys(t,e){mu(2048,8,t,e)}function dg(t){mt.flags|=4;var e=mt.updateQueue;if(e===null)e=ru(),mt.updateQueue=e,e.events=[t];else{var n=e.events;n===null?e.events=[t]:n.push(t)}}function lo(t){var e=Vt().memoizedState;return dg({ref:e,nextImpl:t}),function(){if((Ct&2)!==0)throw Error(f(440));return e.impl.apply(void 0,arguments)}}function ao(t,e){return mu(4,2,t,e)}function io(t,e){return mu(4,4,t,e)}function uo(t,e){if(typeof e=="function"){t=t();var n=e(t);return function(){typeof n=="function"?n():e(null)}}if(e!=null)return t=t(),e.current=t,function(){e.current=null}}function co(t,e,n){n=n!=null?n.concat([t]):null,mu(4,4,uo.bind(null,e,t),n)}function Es(){}function so(t,e){var n=Vt();e=e===void 0?null:e;var l=n.memoizedState;return e!==null&&ss(e,l[1])?l[0]:(n.memoizedState=[t,e],t)}function fo(t,e){var n=Vt();e=e===void 0?null:e;var l=n.memoizedState;if(e!==null&&ss(e,l[1]))return l[0];if(l=t(),xl){On(!0);try{t()}finally{On(!1)}}return n.memoizedState=[l,e],l}function ps(t,e,n){return n===void 0||(cn&1073741824)!==0&&(Et&261930)===0?t.memoizedState=e:(t.memoizedState=n,t=od(),mt.lanes|=t,Gn|=t,n)}function ro(t,e,n,l){return Se(n,e)?n:na.current!==null?(t=ps(t,n,l),Se(t,e)||(qt=!0),t):(cn&42)===0||(cn&1073741824)!==0&&(Et&261930)===0?(qt=!0,t.memoizedState=n):(t=od(),mt.lanes|=t,Gn|=t,e)}function oo(t,e,n,l,a){var s=_.p;_.p=s!==0&&8>s?s:8;var d=M.T,g={};M.T=g,Ss(t,!1,e,n);try{var S=a(),U=M.S;if(U!==null&&U(g,S),S!==null&&typeof S=="object"&&typeof S.then=="function"){var Z=cg(S,l);Wa(t,e,Z,we(t))}else Wa(t,e,l,we(t))}catch(J){Wa(t,e,{then:function(){},status:"rejected",reason:J},we())}finally{_.p=s,d!==null&&g.types!==null&&(d.types=g.types),M.T=d}}function hg(){}function xs(t,e,n,l){if(t.tag!==5)throw Error(f(476));var a=ho(t).queue;oo(t,a,e,$,n===null?hg:function(){return mo(t),n(l)})}function ho(t){var e=t.memoizedState;if(e!==null)return e;e={memoizedState:$,baseState:$,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:sn,lastRenderedState:$},next:null};var n={};return e.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:sn,lastRenderedState:n},next:null},t.memoizedState=e,t=t.alternate,t!==null&&(t.memoizedState=e),e}function mo(t){var e=ho(t);e.next===null&&(e=t.alternate.memoizedState),Wa(t,e.next.queue,{},we())}function bs(){return ne(hi)}function go(){return Vt().memoizedState}function Ao(){return Vt().memoizedState}function mg(t){for(var e=t.return;e!==null;){switch(e.tag){case 24:case 3:var n=we();t=Bn(n);var l=Un(e,t,n);l!==null&&(ve(l,e,n),qa(l,e,n)),e={cache:_c()},t.payload=e;return}e=e.return}}function gg(t,e,n){var l=we();n={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},gu(t)?yo(e,n):(n=Gc(t,e,n,l),n!==null&&(ve(n,t,l),Eo(n,e,l)))}function vo(t,e,n){var l=we();Wa(t,e,n,l)}function Wa(t,e,n,l){var a={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(gu(t))yo(e,a);else{var s=t.alternate;if(t.lanes===0&&(s===null||s.lanes===0)&&(s=e.lastRenderedReducer,s!==null))try{var d=e.lastRenderedState,g=s(d,n);if(a.hasEagerState=!0,a.eagerState=g,Se(g,d))return Fi(t,e,a,0),jt===null&&Ji(),!1}catch{}finally{}if(n=Gc(t,e,a,l),n!==null)return ve(n,t,l),Eo(n,e,l),!0}return!1}function Ss(t,e,n,l){if(l={lane:2,revertLane:ef(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},gu(t)){if(e)throw Error(f(479))}else e=Gc(t,n,l,2),e!==null&&ve(e,t,2)}function gu(t){var e=t.alternate;return t===mt||e!==null&&e===mt}function yo(t,e){la=su=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function Eo(t,e,n){if((n&4194048)!==0){var l=e.lanes;l&=t.pendingLanes,n|=l,e.lanes=n,Sr(t,n)}}var _a={readContext:ne,use:ou,useCallback:Lt,useContext:Lt,useEffect:Lt,useImperativeHandle:Lt,useLayoutEffect:Lt,useInsertionEffect:Lt,useMemo:Lt,useReducer:Lt,useRef:Lt,useState:Lt,useDebugValue:Lt,useDeferredValue:Lt,useTransition:Lt,useSyncExternalStore:Lt,useId:Lt,useHostTransitionStatus:Lt,useFormState:Lt,useActionState:Lt,useOptimistic:Lt,useMemoCache:Lt,useCacheRefresh:Lt};_a.useEffectEvent=Lt;var po={readContext:ne,use:ou,useCallback:function(t,e){return fe().memoizedState=[t,e===void 0?null:e],t},useContext:ne,useEffect:no,useImperativeHandle:function(t,e,n){n=n!=null?n.concat([t]):null,hu(4194308,4,uo.bind(null,e,t),n)},useLayoutEffect:function(t,e){return hu(4194308,4,t,e)},useInsertionEffect:function(t,e){hu(4,2,t,e)},useMemo:function(t,e){var n=fe();e=e===void 0?null:e;var l=t();if(xl){On(!0);try{t()}finally{On(!1)}}return n.memoizedState=[l,e],l},useReducer:function(t,e,n){var l=fe();if(n!==void 0){var a=n(e);if(xl){On(!0);try{n(e)}finally{On(!1)}}}else a=e;return l.memoizedState=l.baseState=a,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:a},l.queue=t,t=t.dispatch=gg.bind(null,mt,t),[l.memoizedState,t]},useRef:function(t){var e=fe();return t={current:t},e.memoizedState=t},useState:function(t){t=As(t);var e=t.queue,n=vo.bind(null,mt,e);return e.dispatch=n,[t.memoizedState,n]},useDebugValue:Es,useDeferredValue:function(t,e){var n=fe();return ps(n,t,e)},useTransition:function(){var t=As(!1);return t=oo.bind(null,mt,t.queue,!0,!1),fe().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,e,n){var l=mt,a=fe();if(xt){if(n===void 0)throw Error(f(407));n=n()}else{if(n=e(),jt===null)throw Error(f(349));(Et&127)!==0||G0(l,e,n)}a.memoizedState=n;var s={value:n,getSnapshot:e};return a.queue=s,no(V0.bind(null,l,s,t),[t]),l.flags|=2048,ia(9,{destroy:void 0},X0.bind(null,l,s,n,e),null),n},useId:function(){var t=fe(),e=jt.identifierPrefix;if(xt){var n=Fe,l=Je;n=(l&~(1<<32-be(l)-1)).toString(32)+n,e="_"+e+"R_"+n,n=fu++,0<n&&(e+="H"+n.toString(32)),e+="_"}else n=sg++,e="_"+e+"r_"+n.toString(32)+"_";return t.memoizedState=e},useHostTransitionStatus:bs,useFormState:_0,useActionState:_0,useOptimistic:function(t){var e=fe();e.memoizedState=e.baseState=t;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return e.queue=n,e=Ss.bind(null,mt,!0,n),n.dispatch=e,[t,e]},useMemoCache:hs,useCacheRefresh:function(){return fe().memoizedState=mg.bind(null,mt)},useEffectEvent:function(t){var e=fe(),n={impl:t};return e.memoizedState=n,function(){if((Ct&2)!==0)throw Error(f(440));return n.impl.apply(void 0,arguments)}}},Ts={readContext:ne,use:ou,useCallback:so,useContext:ne,useEffect:ys,useImperativeHandle:co,useInsertionEffect:ao,useLayoutEffect:io,useMemo:fo,useReducer:du,useRef:eo,useState:function(){return du(sn)},useDebugValue:Es,useDeferredValue:function(t,e){var n=Vt();return ro(n,Rt.memoizedState,t,e)},useTransition:function(){var t=du(sn)[0],e=Vt().memoizedState;return[typeof t=="boolean"?t:Fa(t),e]},useSyncExternalStore:L0,useId:go,useHostTransitionStatus:bs,useFormState:P0,useActionState:P0,useOptimistic:function(t,e){var n=Vt();return q0(n,Rt,t,e)},useMemoCache:hs,useCacheRefresh:Ao};Ts.useEffectEvent=lo;var xo={readContext:ne,use:ou,useCallback:so,useContext:ne,useEffect:ys,useImperativeHandle:co,useInsertionEffect:ao,useLayoutEffect:io,useMemo:fo,useReducer:gs,useRef:eo,useState:function(){return gs(sn)},useDebugValue:Es,useDeferredValue:function(t,e){var n=Vt();return Rt===null?ps(n,t,e):ro(n,Rt.memoizedState,t,e)},useTransition:function(){var t=gs(sn)[0],e=Vt().memoizedState;return[typeof t=="boolean"?t:Fa(t),e]},useSyncExternalStore:L0,useId:go,useHostTransitionStatus:bs,useFormState:to,useActionState:to,useOptimistic:function(t,e){var n=Vt();return Rt!==null?q0(n,Rt,t,e):(n.baseState=t,[t,n.queue.dispatch])},useMemoCache:hs,useCacheRefresh:Ao};xo.useEffectEvent=lo;function Cs(t,e,n,l){e=t.memoizedState,n=n(l,e),n=n==null?e:T({},e,n),t.memoizedState=n,t.lanes===0&&(t.updateQueue.baseState=n)}var Os={enqueueSetState:function(t,e,n){t=t._reactInternals;var l=we(),a=Bn(l);a.payload=e,n!=null&&(a.callback=n),e=Un(t,a,l),e!==null&&(ve(e,t,l),qa(e,t,l))},enqueueReplaceState:function(t,e,n){t=t._reactInternals;var l=we(),a=Bn(l);a.tag=1,a.payload=e,n!=null&&(a.callback=n),e=Un(t,a,l),e!==null&&(ve(e,t,l),qa(e,t,l))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var n=we(),l=Bn(n);l.tag=2,e!=null&&(l.callback=e),e=Un(t,l,n),e!==null&&(ve(e,t,n),qa(e,t,n))}};function bo(t,e,n,l,a,s,d){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(l,s,d):e.prototype&&e.prototype.isPureReactComponent?!za(n,l)||!za(a,s):!0}function So(t,e,n,l){t=e.state,typeof e.componentWillReceiveProps=="function"&&e.componentWillReceiveProps(n,l),typeof e.UNSAFE_componentWillReceiveProps=="function"&&e.UNSAFE_componentWillReceiveProps(n,l),e.state!==t&&Os.enqueueReplaceState(e,e.state,null)}function bl(t,e){var n=e;if("ref"in e){n={};for(var l in e)l!=="ref"&&(n[l]=e[l])}if(t=t.defaultProps){n===e&&(n=T({},n));for(var a in t)n[a]===void 0&&(n[a]=t[a])}return n}function To(t){ki(t)}function Co(t){console.error(t)}function Oo(t){ki(t)}function Au(t,e){try{var n=t.onUncaughtError;n(e.value,{componentStack:e.stack})}catch(l){setTimeout(function(){throw l})}}function Do(t,e,n){try{var l=t.onCaughtError;l(n.value,{componentStack:n.stack,errorBoundary:e.tag===1?e.stateNode:null})}catch(a){setTimeout(function(){throw a})}}function Ds(t,e,n){return n=Bn(n),n.tag=3,n.payload={element:null},n.callback=function(){Au(t,e)},n}function Ro(t){return t=Bn(t),t.tag=3,t}function wo(t,e,n,l){var a=n.type.getDerivedStateFromError;if(typeof a=="function"){var s=l.value;t.payload=function(){return a(s)},t.callback=function(){Do(e,n,l)}}var d=n.stateNode;d!==null&&typeof d.componentDidCatch=="function"&&(t.callback=function(){Do(e,n,l),typeof a!="function"&&(Xn===null?Xn=new Set([this]):Xn.add(this));var g=l.stack;this.componentDidCatch(l.value,{componentStack:g!==null?g:""})})}function Ag(t,e,n,l,a){if(n.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(e=n.alternate,e!==null&&_l(e,n,a,!0),n=Ce.current,n!==null){switch(n.tag){case 31:case 13:return Ye===null?Ru():n.alternate===null&&Gt===0&&(Gt=3),n.flags&=-257,n.flags|=65536,n.lanes=a,l===lu?n.flags|=16384:(e=n.updateQueue,e===null?n.updateQueue=new Set([l]):e.add(l),Ps(t,l,a)),!1;case 22:return n.flags|=65536,l===lu?n.flags|=16384:(e=n.updateQueue,e===null?(e={transitions:null,markerInstances:null,retryQueue:new Set([l])},n.updateQueue=e):(n=e.retryQueue,n===null?e.retryQueue=new Set([l]):n.add(l)),Ps(t,l,a)),!1}throw Error(f(435,n.tag))}return Ps(t,l,a),Ru(),!1}if(xt)return e=Ce.current,e!==null?((e.flags&65536)===0&&(e.flags|=256),e.flags|=65536,e.lanes=a,l!==Kc&&(t=Error(f(422),{cause:l}),Ga(Be(t,n)))):(l!==Kc&&(e=Error(f(423),{cause:l}),Ga(Be(e,n))),t=t.current.alternate,t.flags|=65536,a&=-a,t.lanes|=a,l=Be(l,n),a=Ds(t.stateNode,l,a),ls(t,a),Gt!==4&&(Gt=2)),!1;var s=Error(f(520),{cause:l});if(s=Be(s,n),ii===null?ii=[s]:ii.push(s),Gt!==4&&(Gt=2),e===null)return!0;l=Be(l,n),n=e;do{switch(n.tag){case 3:return n.flags|=65536,t=a&-a,n.lanes|=t,t=Ds(n.stateNode,l,t),ls(n,t),!1;case 1:if(e=n.type,s=n.stateNode,(n.flags&128)===0&&(typeof e.getDerivedStateFromError=="function"||s!==null&&typeof s.componentDidCatch=="function"&&(Xn===null||!Xn.has(s))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Ro(a),wo(a,t,n,l),ls(n,a),!1}n=n.return}while(n!==null);return!1}var Rs=Error(f(461)),qt=!1;function le(t,e,n,l){e.child=t===null?N0(e,null,n,l):pl(e,t.child,n,l)}function Mo(t,e,n,l,a){n=n.render;var s=e.ref;if("ref"in l){var d={};for(var g in l)g!=="ref"&&(d[g]=l[g])}else d=l;return Al(e),l=fs(t,e,n,d,s,a),g=rs(),t!==null&&!qt?(os(t,e,a),fn(t,e,a)):(xt&&g&&Ic(e),e.flags|=1,le(t,e,l,a),e.child)}function jo(t,e,n,l,a){if(t===null){var s=n.type;return typeof s=="function"&&!Xc(s)&&s.defaultProps===void 0&&n.compare===null?(e.tag=15,e.type=s,No(t,e,s,l,a)):(t=_i(n.type,null,l,e,e.mode,a),t.ref=e.ref,t.return=e,e.child=t)}if(s=t.child,!Qs(t,a)){var d=s.memoizedProps;if(n=n.compare,n=n!==null?n:za,n(d,l)&&t.ref===e.ref)return fn(t,e,a)}return e.flags|=1,t=nn(s,l),t.ref=e.ref,t.return=e,e.child=t}function No(t,e,n,l,a){if(t!==null){var s=t.memoizedProps;if(za(s,l)&&t.ref===e.ref)if(qt=!1,e.pendingProps=l=s,Qs(t,a))(t.flags&131072)!==0&&(qt=!0);else return e.lanes=t.lanes,fn(t,e,a)}return ws(t,e,n,l,a)}function Ho(t,e,n,l){var a=l.children,s=t!==null?t.memoizedState:null;if(t===null&&e.stateNode===null&&(e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.mode==="hidden"){if((e.flags&128)!==0){if(s=s!==null?s.baseLanes|n:n,t!==null){for(l=e.child=t.child,a=0;l!==null;)a=a|l.lanes|l.childLanes,l=l.sibling;l=a&~s}else l=0,e.child=null;return Bo(t,e,s,n,l)}if((n&536870912)!==0)e.memoizedState={baseLanes:0,cachePool:null},t!==null&&eu(e,s!==null?s.cachePool:null),s!==null?U0(e,s):is(),Q0(e);else return l=e.lanes=536870912,Bo(t,e,s!==null?s.baseLanes|n:n,n,l)}else s!==null?(eu(e,s.cachePool),U0(e,s),zn(),e.memoizedState=null):(t!==null&&eu(e,null),is(),zn());return le(t,e,a,n),e.child}function Pa(t,e){return t!==null&&t.tag===22||e.stateNode!==null||(e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),e.sibling}function Bo(t,e,n,l,a){var s=$c();return s=s===null?null:{parent:Zt._currentValue,pool:s},e.memoizedState={baseLanes:n,cachePool:s},t!==null&&eu(e,null),is(),Q0(e),t!==null&&_l(t,e,l,!0),e.childLanes=a,null}function vu(t,e){return e=Eu({mode:e.mode,children:e.children},t.mode),e.ref=t.ref,t.child=e,e.return=t,e}function Uo(t,e,n){return pl(e,t.child,null,n),t=vu(e,e.pendingProps),t.flags|=2,Oe(e),e.memoizedState=null,t}function vg(t,e,n){var l=e.pendingProps,a=(e.flags&128)!==0;if(e.flags&=-129,t===null){if(xt){if(l.mode==="hidden")return t=vu(e,l),e.lanes=536870912,Pa(null,t);if(cs(e),(t=Nt)?(t=kd(t,ze),t=t!==null&&t.data==="&"?t:null,t!==null&&(e.memoizedState={dehydrated:t,treeContext:wn!==null?{id:Je,overflow:Fe}:null,retryLane:536870912,hydrationErrors:null},n=v0(t),n.return=e,e.child=n,ee=e,Nt=null)):t=null,t===null)throw jn(e);return e.lanes=536870912,null}return vu(e,l)}var s=t.memoizedState;if(s!==null){var d=s.dehydrated;if(cs(e),a)if(e.flags&256)e.flags&=-257,e=Uo(t,e,n);else if(e.memoizedState!==null)e.child=t.child,e.flags|=128,e=null;else throw Error(f(558));else if(qt||_l(t,e,n,!1),a=(n&t.childLanes)!==0,qt||a){if(l=jt,l!==null&&(d=Tr(l,n),d!==0&&d!==s.retryLane))throw s.retryLane=d,dl(t,d),ve(l,t,d),Rs;Ru(),e=Uo(t,e,n)}else t=s.treeContext,Nt=Le(d.nextSibling),ee=e,xt=!0,Mn=null,ze=!1,t!==null&&p0(e,t),e=vu(e,l),e.flags|=4096;return e}return t=nn(t.child,{mode:l.mode,children:l.children}),t.ref=e.ref,e.child=t,t.return=e,t}function yu(t,e){var n=e.ref;if(n===null)t!==null&&t.ref!==null&&(e.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(f(284));(t===null||t.ref!==n)&&(e.flags|=4194816)}}function ws(t,e,n,l,a){return Al(e),n=fs(t,e,n,l,void 0,a),l=rs(),t!==null&&!qt?(os(t,e,a),fn(t,e,a)):(xt&&l&&Ic(e),e.flags|=1,le(t,e,n,a),e.child)}function Qo(t,e,n,l,a,s){return Al(e),e.updateQueue=null,n=Y0(e,l,n,a),z0(t),l=rs(),t!==null&&!qt?(os(t,e,s),fn(t,e,s)):(xt&&l&&Ic(e),e.flags|=1,le(t,e,n,s),e.child)}function zo(t,e,n,l,a){if(Al(e),e.stateNode===null){var s=kl,d=n.contextType;typeof d=="object"&&d!==null&&(s=ne(d)),s=new n(l,s),e.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,s.updater=Os,e.stateNode=s,s._reactInternals=e,s=e.stateNode,s.props=l,s.state=e.memoizedState,s.refs={},es(e),d=n.contextType,s.context=typeof d=="object"&&d!==null?ne(d):kl,s.state=e.memoizedState,d=n.getDerivedStateFromProps,typeof d=="function"&&(Cs(e,n,d,l),s.state=e.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof s.getSnapshotBeforeUpdate=="function"||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(d=s.state,typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount(),d!==s.state&&Os.enqueueReplaceState(s,s.state,null),ka(e,l,s,a),Ka(),s.state=e.memoizedState),typeof s.componentDidMount=="function"&&(e.flags|=4194308),l=!0}else if(t===null){s=e.stateNode;var g=e.memoizedProps,S=bl(n,g);s.props=S;var U=s.context,Z=n.contextType;d=kl,typeof Z=="object"&&Z!==null&&(d=ne(Z));var J=n.getDerivedStateFromProps;Z=typeof J=="function"||typeof s.getSnapshotBeforeUpdate=="function",g=e.pendingProps!==g,Z||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(g||U!==d)&&So(e,s,l,d),Hn=!1;var Q=e.memoizedState;s.state=Q,ka(e,l,s,a),Ka(),U=e.memoizedState,g||Q!==U||Hn?(typeof J=="function"&&(Cs(e,n,J,l),U=e.memoizedState),(S=Hn||bo(e,n,S,l,Q,U,d))?(Z||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(e.flags|=4194308)):(typeof s.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=l,e.memoizedState=U),s.props=l,s.state=U,s.context=d,l=S):(typeof s.componentDidMount=="function"&&(e.flags|=4194308),l=!1)}else{s=e.stateNode,ns(t,e),d=e.memoizedProps,Z=bl(n,d),s.props=Z,J=e.pendingProps,Q=s.context,U=n.contextType,S=kl,typeof U=="object"&&U!==null&&(S=ne(U)),g=n.getDerivedStateFromProps,(U=typeof g=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(d!==J||Q!==S)&&So(e,s,l,S),Hn=!1,Q=e.memoizedState,s.state=Q,ka(e,l,s,a),Ka();var G=e.memoizedState;d!==J||Q!==G||Hn||t!==null&&t.dependencies!==null&&$i(t.dependencies)?(typeof g=="function"&&(Cs(e,n,g,l),G=e.memoizedState),(Z=Hn||bo(e,n,Z,l,Q,G,S)||t!==null&&t.dependencies!==null&&$i(t.dependencies))?(U||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(l,G,S),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(l,G,S)),typeof s.componentDidUpdate=="function"&&(e.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof s.componentDidUpdate!="function"||d===t.memoizedProps&&Q===t.memoizedState||(e.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||d===t.memoizedProps&&Q===t.memoizedState||(e.flags|=1024),e.memoizedProps=l,e.memoizedState=G),s.props=l,s.state=G,s.context=S,l=Z):(typeof s.componentDidUpdate!="function"||d===t.memoizedProps&&Q===t.memoizedState||(e.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||d===t.memoizedProps&&Q===t.memoizedState||(e.flags|=1024),l=!1)}return s=l,yu(t,e),l=(e.flags&128)!==0,s||l?(s=e.stateNode,n=l&&typeof n.getDerivedStateFromError!="function"?null:s.render(),e.flags|=1,t!==null&&l?(e.child=pl(e,t.child,null,a),e.child=pl(e,null,n,a)):le(t,e,n,a),e.memoizedState=s.state,t=e.child):t=fn(t,e,a),t}function Yo(t,e,n,l){return ml(),e.flags|=256,le(t,e,n,l),e.child}var Ms={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function js(t){return{baseLanes:t,cachePool:O0()}}function Ns(t,e,n){return t=t!==null?t.childLanes&~n:0,e&&(t|=Re),t}function Lo(t,e,n){var l=e.pendingProps,a=!1,s=(e.flags&128)!==0,d;if((d=s)||(d=t!==null&&t.memoizedState===null?!1:(Xt.current&2)!==0),d&&(a=!0,e.flags&=-129),d=(e.flags&32)!==0,e.flags&=-33,t===null){if(xt){if(a?Qn(e):zn(),(t=Nt)?(t=kd(t,ze),t=t!==null&&t.data!=="&"?t:null,t!==null&&(e.memoizedState={dehydrated:t,treeContext:wn!==null?{id:Je,overflow:Fe}:null,retryLane:536870912,hydrationErrors:null},n=v0(t),n.return=e,e.child=n,ee=e,Nt=null)):t=null,t===null)throw jn(e);return gf(t)?e.lanes=32:e.lanes=536870912,null}var g=l.children;return l=l.fallback,a?(zn(),a=e.mode,g=Eu({mode:"hidden",children:g},a),l=hl(l,a,n,null),g.return=e,l.return=e,g.sibling=l,e.child=g,l=e.child,l.memoizedState=js(n),l.childLanes=Ns(t,d,n),e.memoizedState=Ms,Pa(null,l)):(Qn(e),Hs(e,g))}var S=t.memoizedState;if(S!==null&&(g=S.dehydrated,g!==null)){if(s)e.flags&256?(Qn(e),e.flags&=-257,e=Bs(t,e,n)):e.memoizedState!==null?(zn(),e.child=t.child,e.flags|=128,e=null):(zn(),g=l.fallback,a=e.mode,l=Eu({mode:"visible",children:l.children},a),g=hl(g,a,n,null),g.flags|=2,l.return=e,g.return=e,l.sibling=g,e.child=l,pl(e,t.child,null,n),l=e.child,l.memoizedState=js(n),l.childLanes=Ns(t,d,n),e.memoizedState=Ms,e=Pa(null,l));else if(Qn(e),gf(g)){if(d=g.nextSibling&&g.nextSibling.dataset,d)var U=d.dgst;d=U,l=Error(f(419)),l.stack="",l.digest=d,Ga({value:l,source:null,stack:null}),e=Bs(t,e,n)}else if(qt||_l(t,e,n,!1),d=(n&t.childLanes)!==0,qt||d){if(d=jt,d!==null&&(l=Tr(d,n),l!==0&&l!==S.retryLane))throw S.retryLane=l,dl(t,l),ve(d,t,l),Rs;mf(g)||Ru(),e=Bs(t,e,n)}else mf(g)?(e.flags|=192,e.child=t.child,e=null):(t=S.treeContext,Nt=Le(g.nextSibling),ee=e,xt=!0,Mn=null,ze=!1,t!==null&&p0(e,t),e=Hs(e,l.children),e.flags|=4096);return e}return a?(zn(),g=l.fallback,a=e.mode,S=t.child,U=S.sibling,l=nn(S,{mode:"hidden",children:l.children}),l.subtreeFlags=S.subtreeFlags&65011712,U!==null?g=nn(U,g):(g=hl(g,a,n,null),g.flags|=2),g.return=e,l.return=e,l.sibling=g,e.child=l,Pa(null,l),l=e.child,g=t.child.memoizedState,g===null?g=js(n):(a=g.cachePool,a!==null?(S=Zt._currentValue,a=a.parent!==S?{parent:S,pool:S}:a):a=O0(),g={baseLanes:g.baseLanes|n,cachePool:a}),l.memoizedState=g,l.childLanes=Ns(t,d,n),e.memoizedState=Ms,Pa(t.child,l)):(Qn(e),n=t.child,t=n.sibling,n=nn(n,{mode:"visible",children:l.children}),n.return=e,n.sibling=null,t!==null&&(d=e.deletions,d===null?(e.deletions=[t],e.flags|=16):d.push(t)),e.child=n,e.memoizedState=null,n)}function Hs(t,e){return e=Eu({mode:"visible",children:e},t.mode),e.return=t,t.child=e}function Eu(t,e){return t=Te(22,t,null,e),t.lanes=0,t}function Bs(t,e,n){return pl(e,t.child,null,n),t=Hs(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function Go(t,e,n){t.lanes|=e;var l=t.alternate;l!==null&&(l.lanes|=e),Fc(t.return,e,n)}function Us(t,e,n,l,a,s){var d=t.memoizedState;d===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:l,tail:n,tailMode:a,treeForkCount:s}:(d.isBackwards=e,d.rendering=null,d.renderingStartTime=0,d.last=l,d.tail=n,d.tailMode=a,d.treeForkCount=s)}function Xo(t,e,n){var l=e.pendingProps,a=l.revealOrder,s=l.tail;l=l.children;var d=Xt.current,g=(d&2)!==0;if(g?(d=d&1|2,e.flags|=128):d&=1,W(Xt,d),le(t,e,l,n),l=xt?La:0,!g&&t!==null&&(t.flags&128)!==0)t:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&Go(t,n,e);else if(t.tag===19)Go(t,n,e);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break t;for(;t.sibling===null;){if(t.return===null||t.return===e)break t;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(a){case"forwards":for(n=e.child,a=null;n!==null;)t=n.alternate,t!==null&&cu(t)===null&&(a=n),n=n.sibling;n=a,n===null?(a=e.child,e.child=null):(a=n.sibling,n.sibling=null),Us(e,!1,a,n,s,l);break;case"backwards":case"unstable_legacy-backwards":for(n=null,a=e.child,e.child=null;a!==null;){if(t=a.alternate,t!==null&&cu(t)===null){e.child=a;break}t=a.sibling,a.sibling=n,n=a,a=t}Us(e,!0,n,null,s,l);break;case"together":Us(e,!1,null,null,void 0,l);break;default:e.memoizedState=null}return e.child}function fn(t,e,n){if(t!==null&&(e.dependencies=t.dependencies),Gn|=e.lanes,(n&e.childLanes)===0)if(t!==null){if(_l(t,e,n,!1),(n&e.childLanes)===0)return null}else return null;if(t!==null&&e.child!==t.child)throw Error(f(153));if(e.child!==null){for(t=e.child,n=nn(t,t.pendingProps),e.child=n,n.return=e;t.sibling!==null;)t=t.sibling,n=n.sibling=nn(t,t.pendingProps),n.return=e;n.sibling=null}return e.child}function Qs(t,e){return(t.lanes&e)!==0?!0:(t=t.dependencies,!!(t!==null&&$i(t)))}function yg(t,e,n){switch(e.tag){case 3:Jt(e,e.stateNode.containerInfo),Nn(e,Zt,t.memoizedState.cache),ml();break;case 27:case 5:Sn(e);break;case 4:Jt(e,e.stateNode.containerInfo);break;case 10:Nn(e,e.type,e.memoizedProps.value);break;case 31:if(e.memoizedState!==null)return e.flags|=128,cs(e),null;break;case 13:var l=e.memoizedState;if(l!==null)return l.dehydrated!==null?(Qn(e),e.flags|=128,null):(n&e.child.childLanes)!==0?Lo(t,e,n):(Qn(e),t=fn(t,e,n),t!==null?t.sibling:null);Qn(e);break;case 19:var a=(t.flags&128)!==0;if(l=(n&e.childLanes)!==0,l||(_l(t,e,n,!1),l=(n&e.childLanes)!==0),a){if(l)return Xo(t,e,n);e.flags|=128}if(a=e.memoizedState,a!==null&&(a.rendering=null,a.tail=null,a.lastEffect=null),W(Xt,Xt.current),l)break;return null;case 22:return e.lanes=0,Ho(t,e,n,e.pendingProps);case 24:Nn(e,Zt,t.memoizedState.cache)}return fn(t,e,n)}function Vo(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps)qt=!0;else{if(!Qs(t,n)&&(e.flags&128)===0)return qt=!1,yg(t,e,n);qt=(t.flags&131072)!==0}else qt=!1,xt&&(e.flags&1048576)!==0&&E0(e,La,e.index);switch(e.lanes=0,e.tag){case 16:t:{var l=e.pendingProps;if(t=yl(e.elementType),e.type=t,typeof t=="function")Xc(t)?(l=bl(t,l),e.tag=1,e=zo(null,e,t,l,n)):(e.tag=0,e=ws(null,e,t,l,n));else{if(t!=null){var a=t.$$typeof;if(a===V){e.tag=11,e=Mo(null,e,t,l,n);break t}else if(a===j){e.tag=14,e=jo(null,e,t,l,n);break t}}throw e=st(t)||t,Error(f(306,e,""))}}return e;case 0:return ws(t,e,e.type,e.pendingProps,n);case 1:return l=e.type,a=bl(l,e.pendingProps),zo(t,e,l,a,n);case 3:t:{if(Jt(e,e.stateNode.containerInfo),t===null)throw Error(f(387));l=e.pendingProps;var s=e.memoizedState;a=s.element,ns(t,e),ka(e,l,null,n);var d=e.memoizedState;if(l=d.cache,Nn(e,Zt,l),l!==s.cache&&Wc(e,[Zt],n,!0),Ka(),l=d.element,s.isDehydrated)if(s={element:l,isDehydrated:!1,cache:d.cache},e.updateQueue.baseState=s,e.memoizedState=s,e.flags&256){e=Yo(t,e,l,n);break t}else if(l!==a){a=Be(Error(f(424)),e),Ga(a),e=Yo(t,e,l,n);break t}else{switch(t=e.stateNode.containerInfo,t.nodeType){case 9:t=t.body;break;default:t=t.nodeName==="HTML"?t.ownerDocument.body:t}for(Nt=Le(t.firstChild),ee=e,xt=!0,Mn=null,ze=!0,n=N0(e,null,l,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(ml(),l===a){e=fn(t,e,n);break t}le(t,e,l,n)}e=e.child}return e;case 26:return yu(t,e),t===null?(n=$d(e.type,null,e.pendingProps,null))?e.memoizedState=n:xt||(n=e.type,t=e.pendingProps,l=Uu(ot.current).createElement(n),l[te]=e,l[oe]=t,ae(l,n,t),Ft(l),e.stateNode=l):e.memoizedState=$d(e.type,t.memoizedProps,e.pendingProps,t.memoizedState),null;case 27:return Sn(e),t===null&&xt&&(l=e.stateNode=Wd(e.type,e.pendingProps,ot.current),ee=e,ze=!0,a=Nt,qn(e.type)?(Af=a,Nt=Le(l.firstChild)):Nt=a),le(t,e,e.pendingProps.children,n),yu(t,e),t===null&&(e.flags|=4194304),e.child;case 5:return t===null&&xt&&((a=l=Nt)&&(l=Jg(l,e.type,e.pendingProps,ze),l!==null?(e.stateNode=l,ee=e,Nt=Le(l.firstChild),ze=!1,a=!0):a=!1),a||jn(e)),Sn(e),a=e.type,s=e.pendingProps,d=t!==null?t.memoizedProps:null,l=s.children,of(a,s)?l=null:d!==null&&of(a,d)&&(e.flags|=32),e.memoizedState!==null&&(a=fs(t,e,fg,null,null,n),hi._currentValue=a),yu(t,e),le(t,e,l,n),e.child;case 6:return t===null&&xt&&((t=n=Nt)&&(n=Fg(n,e.pendingProps,ze),n!==null?(e.stateNode=n,ee=e,Nt=null,t=!0):t=!1),t||jn(e)),null;case 13:return Lo(t,e,n);case 4:return Jt(e,e.stateNode.containerInfo),l=e.pendingProps,t===null?e.child=pl(e,null,l,n):le(t,e,l,n),e.child;case 11:return Mo(t,e,e.type,e.pendingProps,n);case 7:return le(t,e,e.pendingProps,n),e.child;case 8:return le(t,e,e.pendingProps.children,n),e.child;case 12:return le(t,e,e.pendingProps.children,n),e.child;case 10:return l=e.pendingProps,Nn(e,e.type,l.value),le(t,e,l.children,n),e.child;case 9:return a=e.type._context,l=e.pendingProps.children,Al(e),a=ne(a),l=l(a),e.flags|=1,le(t,e,l,n),e.child;case 14:return jo(t,e,e.type,e.pendingProps,n);case 15:return No(t,e,e.type,e.pendingProps,n);case 19:return Xo(t,e,n);case 31:return vg(t,e,n);case 22:return Ho(t,e,n,e.pendingProps);case 24:return Al(e),l=ne(Zt),t===null?(a=$c(),a===null&&(a=jt,s=_c(),a.pooledCache=s,s.refCount++,s!==null&&(a.pooledCacheLanes|=n),a=s),e.memoizedState={parent:l,cache:a},es(e),Nn(e,Zt,a)):((t.lanes&n)!==0&&(ns(t,e),ka(e,null,null,n),Ka()),a=t.memoizedState,s=e.memoizedState,a.parent!==l?(a={parent:l,cache:l},e.memoizedState=a,e.lanes===0&&(e.memoizedState=e.updateQueue.baseState=a),Nn(e,Zt,l)):(l=s.cache,Nn(e,Zt,l),l!==a.cache&&Wc(e,[Zt],n,!0))),le(t,e,e.pendingProps.children,n),e.child;case 29:throw e.pendingProps}throw Error(f(156,e.tag))}function rn(t){t.flags|=4}function zs(t,e,n,l,a){if((e=(t.mode&32)!==0)&&(e=!1),e){if(t.flags|=16777216,(a&335544128)===a)if(t.stateNode.complete)t.flags|=8192;else if(gd())t.flags|=8192;else throw El=lu,ts}else t.flags&=-16777217}function Zo(t,e){if(e.type!=="stylesheet"||(e.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!a1(e))if(gd())t.flags|=8192;else throw El=lu,ts}function pu(t,e){e!==null&&(t.flags|=4),t.flags&16384&&(e=t.tag!==22?xr():536870912,t.lanes|=e,fa|=e)}function $a(t,e){if(!xt)switch(t.tailMode){case"hidden":e=t.tail;for(var n=null;e!==null;)e.alternate!==null&&(n=e),e=e.sibling;n===null?t.tail=null:n.sibling=null;break;case"collapsed":n=t.tail;for(var l=null;n!==null;)n.alternate!==null&&(l=n),n=n.sibling;l===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:l.sibling=null}}function Ht(t){var e=t.alternate!==null&&t.alternate.child===t.child,n=0,l=0;if(e)for(var a=t.child;a!==null;)n|=a.lanes|a.childLanes,l|=a.subtreeFlags&65011712,l|=a.flags&65011712,a.return=t,a=a.sibling;else for(a=t.child;a!==null;)n|=a.lanes|a.childLanes,l|=a.subtreeFlags,l|=a.flags,a.return=t,a=a.sibling;return t.subtreeFlags|=l,t.childLanes=n,e}function Eg(t,e,n){var l=e.pendingProps;switch(qc(e),e.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ht(e),null;case 1:return Ht(e),null;case 3:return n=e.stateNode,l=null,t!==null&&(l=t.memoizedState.cache),e.memoizedState.cache!==l&&(e.flags|=2048),un(Zt),Qt(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(t===null||t.child===null)&&(Wl(e)?rn(e):t===null||t.memoizedState.isDehydrated&&(e.flags&256)===0||(e.flags|=1024,kc())),Ht(e),null;case 26:var a=e.type,s=e.memoizedState;return t===null?(rn(e),s!==null?(Ht(e),Zo(e,s)):(Ht(e),zs(e,a,null,l,n))):s?s!==t.memoizedState?(rn(e),Ht(e),Zo(e,s)):(Ht(e),e.flags&=-16777217):(t=t.memoizedProps,t!==l&&rn(e),Ht(e),zs(e,a,t,l,n)),null;case 27:if(ul(e),n=ot.current,a=e.type,t!==null&&e.stateNode!=null)t.memoizedProps!==l&&rn(e);else{if(!l){if(e.stateNode===null)throw Error(f(166));return Ht(e),null}t=et.current,Wl(e)?x0(e):(t=Wd(a,l,n),e.stateNode=t,rn(e))}return Ht(e),null;case 5:if(ul(e),a=e.type,t!==null&&e.stateNode!=null)t.memoizedProps!==l&&rn(e);else{if(!l){if(e.stateNode===null)throw Error(f(166));return Ht(e),null}if(s=et.current,Wl(e))x0(e);else{var d=Uu(ot.current);switch(s){case 1:s=d.createElementNS("http://www.w3.org/2000/svg",a);break;case 2:s=d.createElementNS("http://www.w3.org/1998/Math/MathML",a);break;default:switch(a){case"svg":s=d.createElementNS("http://www.w3.org/2000/svg",a);break;case"math":s=d.createElementNS("http://www.w3.org/1998/Math/MathML",a);break;case"script":s=d.createElement("div"),s.innerHTML="<script><\/script>",s=s.removeChild(s.firstChild);break;case"select":s=typeof l.is=="string"?d.createElement("select",{is:l.is}):d.createElement("select"),l.multiple?s.multiple=!0:l.size&&(s.size=l.size);break;default:s=typeof l.is=="string"?d.createElement(a,{is:l.is}):d.createElement(a)}}s[te]=e,s[oe]=l;t:for(d=e.child;d!==null;){if(d.tag===5||d.tag===6)s.appendChild(d.stateNode);else if(d.tag!==4&&d.tag!==27&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===e)break t;for(;d.sibling===null;){if(d.return===null||d.return===e)break t;d=d.return}d.sibling.return=d.return,d=d.sibling}e.stateNode=s;t:switch(ae(s,a,l),a){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break t;case"img":l=!0;break t;default:l=!1}l&&rn(e)}}return Ht(e),zs(e,e.type,t===null?null:t.memoizedProps,e.pendingProps,n),null;case 6:if(t&&e.stateNode!=null)t.memoizedProps!==l&&rn(e);else{if(typeof l!="string"&&e.stateNode===null)throw Error(f(166));if(t=ot.current,Wl(e)){if(t=e.stateNode,n=e.memoizedProps,l=null,a=ee,a!==null)switch(a.tag){case 27:case 5:l=a.memoizedProps}t[te]=e,t=!!(t.nodeValue===n||l!==null&&l.suppressHydrationWarning===!0||Ld(t.nodeValue,n)),t||jn(e,!0)}else t=Uu(t).createTextNode(l),t[te]=e,e.stateNode=t}return Ht(e),null;case 31:if(n=e.memoizedState,t===null||t.memoizedState!==null){if(l=Wl(e),n!==null){if(t===null){if(!l)throw Error(f(318));if(t=e.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(f(557));t[te]=e}else ml(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;Ht(e),t=!1}else n=kc(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=n),t=!0;if(!t)return e.flags&256?(Oe(e),e):(Oe(e),null);if((e.flags&128)!==0)throw Error(f(558))}return Ht(e),null;case 13:if(l=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(a=Wl(e),l!==null&&l.dehydrated!==null){if(t===null){if(!a)throw Error(f(318));if(a=e.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(f(317));a[te]=e}else ml(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;Ht(e),a=!1}else a=kc(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=a),a=!0;if(!a)return e.flags&256?(Oe(e),e):(Oe(e),null)}return Oe(e),(e.flags&128)!==0?(e.lanes=n,e):(n=l!==null,t=t!==null&&t.memoizedState!==null,n&&(l=e.child,a=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(a=l.alternate.memoizedState.cachePool.pool),s=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(s=l.memoizedState.cachePool.pool),s!==a&&(l.flags|=2048)),n!==t&&n&&(e.child.flags|=8192),pu(e,e.updateQueue),Ht(e),null);case 4:return Qt(),t===null&&uf(e.stateNode.containerInfo),Ht(e),null;case 10:return un(e.type),Ht(e),null;case 19:if(L(Xt),l=e.memoizedState,l===null)return Ht(e),null;if(a=(e.flags&128)!==0,s=l.rendering,s===null)if(a)$a(l,!1);else{if(Gt!==0||t!==null&&(t.flags&128)!==0)for(t=e.child;t!==null;){if(s=cu(t),s!==null){for(e.flags|=128,$a(l,!1),t=s.updateQueue,e.updateQueue=t,pu(e,t),e.subtreeFlags=0,t=n,n=e.child;n!==null;)A0(n,t),n=n.sibling;return W(Xt,Xt.current&1|2),xt&&ln(e,l.treeForkCount),e.child}t=t.sibling}l.tail!==null&&pe()>Cu&&(e.flags|=128,a=!0,$a(l,!1),e.lanes=4194304)}else{if(!a)if(t=cu(s),t!==null){if(e.flags|=128,a=!0,t=t.updateQueue,e.updateQueue=t,pu(e,t),$a(l,!0),l.tail===null&&l.tailMode==="hidden"&&!s.alternate&&!xt)return Ht(e),null}else 2*pe()-l.renderingStartTime>Cu&&n!==536870912&&(e.flags|=128,a=!0,$a(l,!1),e.lanes=4194304);l.isBackwards?(s.sibling=e.child,e.child=s):(t=l.last,t!==null?t.sibling=s:e.child=s,l.last=s)}return l.tail!==null?(t=l.tail,l.rendering=t,l.tail=t.sibling,l.renderingStartTime=pe(),t.sibling=null,n=Xt.current,W(Xt,a?n&1|2:n&1),xt&&ln(e,l.treeForkCount),t):(Ht(e),null);case 22:case 23:return Oe(e),us(),l=e.memoizedState!==null,t!==null?t.memoizedState!==null!==l&&(e.flags|=8192):l&&(e.flags|=8192),l?(n&536870912)!==0&&(e.flags&128)===0&&(Ht(e),e.subtreeFlags&6&&(e.flags|=8192)):Ht(e),n=e.updateQueue,n!==null&&pu(e,n.retryQueue),n=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),l=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),l!==n&&(e.flags|=2048),t!==null&&L(vl),null;case 24:return n=null,t!==null&&(n=t.memoizedState.cache),e.memoizedState.cache!==n&&(e.flags|=2048),un(Zt),Ht(e),null;case 25:return null;case 30:return null}throw Error(f(156,e.tag))}function pg(t,e){switch(qc(e),e.tag){case 1:return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return un(Zt),Qt(),t=e.flags,(t&65536)!==0&&(t&128)===0?(e.flags=t&-65537|128,e):null;case 26:case 27:case 5:return ul(e),null;case 31:if(e.memoizedState!==null){if(Oe(e),e.alternate===null)throw Error(f(340));ml()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 13:if(Oe(e),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(f(340));ml()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return L(Xt),null;case 4:return Qt(),null;case 10:return un(e.type),null;case 22:case 23:return Oe(e),us(),t!==null&&L(vl),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 24:return un(Zt),null;case 25:return null;default:return null}}function Io(t,e){switch(qc(e),e.tag){case 3:un(Zt),Qt();break;case 26:case 27:case 5:ul(e);break;case 4:Qt();break;case 31:e.memoizedState!==null&&Oe(e);break;case 13:Oe(e);break;case 19:L(Xt);break;case 10:un(e.type);break;case 22:case 23:Oe(e),us(),t!==null&&L(vl);break;case 24:un(Zt)}}function ti(t,e){try{var n=e.updateQueue,l=n!==null?n.lastEffect:null;if(l!==null){var a=l.next;n=a;do{if((n.tag&t)===t){l=void 0;var s=n.create,d=n.inst;l=s(),d.destroy=l}n=n.next}while(n!==a)}}catch(g){Dt(e,e.return,g)}}function Yn(t,e,n){try{var l=e.updateQueue,a=l!==null?l.lastEffect:null;if(a!==null){var s=a.next;l=s;do{if((l.tag&t)===t){var d=l.inst,g=d.destroy;if(g!==void 0){d.destroy=void 0,a=e;var S=n,U=g;try{U()}catch(Z){Dt(a,S,Z)}}}l=l.next}while(l!==s)}}catch(Z){Dt(e,e.return,Z)}}function qo(t){var e=t.updateQueue;if(e!==null){var n=t.stateNode;try{B0(e,n)}catch(l){Dt(t,t.return,l)}}}function Ko(t,e,n){n.props=bl(t.type,t.memoizedProps),n.state=t.memoizedState;try{n.componentWillUnmount()}catch(l){Dt(t,e,l)}}function ei(t,e){try{var n=t.ref;if(n!==null){switch(t.tag){case 26:case 27:case 5:var l=t.stateNode;break;case 30:l=t.stateNode;break;default:l=t.stateNode}typeof n=="function"?t.refCleanup=n(l):n.current=l}}catch(a){Dt(t,e,a)}}function We(t,e){var n=t.ref,l=t.refCleanup;if(n!==null)if(typeof l=="function")try{l()}catch(a){Dt(t,e,a)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(a){Dt(t,e,a)}else n.current=null}function ko(t){var e=t.type,n=t.memoizedProps,l=t.stateNode;try{t:switch(e){case"button":case"input":case"select":case"textarea":n.autoFocus&&l.focus();break t;case"img":n.src?l.src=n.src:n.srcSet&&(l.srcset=n.srcSet)}}catch(a){Dt(t,t.return,a)}}function Ys(t,e,n){try{var l=t.stateNode;Vg(l,t.type,n,e),l[oe]=e}catch(a){Dt(t,t.return,a)}}function Jo(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&qn(t.type)||t.tag===4}function Ls(t){t:for(;;){for(;t.sibling===null;){if(t.return===null||Jo(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&qn(t.type)||t.flags&2||t.child===null||t.tag===4)continue t;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Gs(t,e,n){var l=t.tag;if(l===5||l===6)t=t.stateNode,e?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(t,e):(e=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,e.appendChild(t),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=tn));else if(l!==4&&(l===27&&qn(t.type)&&(n=t.stateNode,e=null),t=t.child,t!==null))for(Gs(t,e,n),t=t.sibling;t!==null;)Gs(t,e,n),t=t.sibling}function xu(t,e,n){var l=t.tag;if(l===5||l===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(l!==4&&(l===27&&qn(t.type)&&(n=t.stateNode),t=t.child,t!==null))for(xu(t,e,n),t=t.sibling;t!==null;)xu(t,e,n),t=t.sibling}function Fo(t){var e=t.stateNode,n=t.memoizedProps;try{for(var l=t.type,a=e.attributes;a.length;)e.removeAttributeNode(a[0]);ae(e,l,n),e[te]=t,e[oe]=n}catch(s){Dt(t,t.return,s)}}var on=!1,Kt=!1,Xs=!1,Wo=typeof WeakSet=="function"?WeakSet:Set,Wt=null;function xg(t,e){if(t=t.containerInfo,ff=Vu,t=c0(t),Bc(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else t:{n=(n=t.ownerDocument)&&n.defaultView||window;var l=n.getSelection&&n.getSelection();if(l&&l.rangeCount!==0){n=l.anchorNode;var a=l.anchorOffset,s=l.focusNode;l=l.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break t}var d=0,g=-1,S=-1,U=0,Z=0,J=t,Q=null;e:for(;;){for(var G;J!==n||a!==0&&J.nodeType!==3||(g=d+a),J!==s||l!==0&&J.nodeType!==3||(S=d+l),J.nodeType===3&&(d+=J.nodeValue.length),(G=J.firstChild)!==null;)Q=J,J=G;for(;;){if(J===t)break e;if(Q===n&&++U===a&&(g=d),Q===s&&++Z===l&&(S=d),(G=J.nextSibling)!==null)break;J=Q,Q=J.parentNode}J=G}n=g===-1||S===-1?null:{start:g,end:S}}else n=null}n=n||{start:0,end:0}}else n=null;for(rf={focusedElem:t,selectionRange:n},Vu=!1,Wt=e;Wt!==null;)if(e=Wt,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,Wt=t;else for(;Wt!==null;){switch(e=Wt,s=e.alternate,t=e.flags,e.tag){case 0:if((t&4)!==0&&(t=e.updateQueue,t=t!==null?t.events:null,t!==null))for(n=0;n<t.length;n++)a=t[n],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&s!==null){t=void 0,n=e,a=s.memoizedProps,s=s.memoizedState,l=n.stateNode;try{var lt=bl(n.type,a);t=l.getSnapshotBeforeUpdate(lt,s),l.__reactInternalSnapshotBeforeUpdate=t}catch(ft){Dt(n,n.return,ft)}}break;case 3:if((t&1024)!==0){if(t=e.stateNode.containerInfo,n=t.nodeType,n===9)hf(t);else if(n===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":hf(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((t&1024)!==0)throw Error(f(163))}if(t=e.sibling,t!==null){t.return=e.return,Wt=t;break}Wt=e.return}}function _o(t,e,n){var l=n.flags;switch(n.tag){case 0:case 11:case 15:hn(t,n),l&4&&ti(5,n);break;case 1:if(hn(t,n),l&4)if(t=n.stateNode,e===null)try{t.componentDidMount()}catch(d){Dt(n,n.return,d)}else{var a=bl(n.type,e.memoizedProps);e=e.memoizedState;try{t.componentDidUpdate(a,e,t.__reactInternalSnapshotBeforeUpdate)}catch(d){Dt(n,n.return,d)}}l&64&&qo(n),l&512&&ei(n,n.return);break;case 3:if(hn(t,n),l&64&&(t=n.updateQueue,t!==null)){if(e=null,n.child!==null)switch(n.child.tag){case 27:case 5:e=n.child.stateNode;break;case 1:e=n.child.stateNode}try{B0(t,e)}catch(d){Dt(n,n.return,d)}}break;case 27:e===null&&l&4&&Fo(n);case 26:case 5:hn(t,n),e===null&&l&4&&ko(n),l&512&&ei(n,n.return);break;case 12:hn(t,n);break;case 31:hn(t,n),l&4&&td(t,n);break;case 13:hn(t,n),l&4&&ed(t,n),l&64&&(t=n.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(n=Mg.bind(null,n),Wg(t,n))));break;case 22:if(l=n.memoizedState!==null||on,!l){e=e!==null&&e.memoizedState!==null||Kt,a=on;var s=Kt;on=l,(Kt=e)&&!s?mn(t,n,(n.subtreeFlags&8772)!==0):hn(t,n),on=a,Kt=s}break;case 30:break;default:hn(t,n)}}function Po(t){var e=t.alternate;e!==null&&(t.alternate=null,Po(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&vc(e)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var zt=null,he=!1;function dn(t,e,n){for(n=n.child;n!==null;)$o(t,e,n),n=n.sibling}function $o(t,e,n){if(xe&&typeof xe.onCommitFiberUnmount=="function")try{xe.onCommitFiberUnmount(Ca,n)}catch{}switch(n.tag){case 26:Kt||We(n,e),dn(t,e,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Kt||We(n,e);var l=zt,a=he;qn(n.type)&&(zt=n.stateNode,he=!1),dn(t,e,n),ri(n.stateNode),zt=l,he=a;break;case 5:Kt||We(n,e);case 6:if(l=zt,a=he,zt=null,dn(t,e,n),zt=l,he=a,zt!==null)if(he)try{(zt.nodeType===9?zt.body:zt.nodeName==="HTML"?zt.ownerDocument.body:zt).removeChild(n.stateNode)}catch(s){Dt(n,e,s)}else try{zt.removeChild(n.stateNode)}catch(s){Dt(n,e,s)}break;case 18:zt!==null&&(he?(t=zt,qd(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,n.stateNode),va(t)):qd(zt,n.stateNode));break;case 4:l=zt,a=he,zt=n.stateNode.containerInfo,he=!0,dn(t,e,n),zt=l,he=a;break;case 0:case 11:case 14:case 15:Yn(2,n,e),Kt||Yn(4,n,e),dn(t,e,n);break;case 1:Kt||(We(n,e),l=n.stateNode,typeof l.componentWillUnmount=="function"&&Ko(n,e,l)),dn(t,e,n);break;case 21:dn(t,e,n);break;case 22:Kt=(l=Kt)||n.memoizedState!==null,dn(t,e,n),Kt=l;break;default:dn(t,e,n)}}function td(t,e){if(e.memoizedState===null&&(t=e.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{va(t)}catch(n){Dt(e,e.return,n)}}}function ed(t,e){if(e.memoizedState===null&&(t=e.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{va(t)}catch(n){Dt(e,e.return,n)}}function bg(t){switch(t.tag){case 31:case 13:case 19:var e=t.stateNode;return e===null&&(e=t.stateNode=new Wo),e;case 22:return t=t.stateNode,e=t._retryCache,e===null&&(e=t._retryCache=new Wo),e;default:throw Error(f(435,t.tag))}}function bu(t,e){var n=bg(t);e.forEach(function(l){if(!n.has(l)){n.add(l);var a=jg.bind(null,t,l);l.then(a,a)}})}function me(t,e){var n=e.deletions;if(n!==null)for(var l=0;l<n.length;l++){var a=n[l],s=t,d=e,g=d;t:for(;g!==null;){switch(g.tag){case 27:if(qn(g.type)){zt=g.stateNode,he=!1;break t}break;case 5:zt=g.stateNode,he=!1;break t;case 3:case 4:zt=g.stateNode.containerInfo,he=!0;break t}g=g.return}if(zt===null)throw Error(f(160));$o(s,d,a),zt=null,he=!1,s=a.alternate,s!==null&&(s.return=null),a.return=null}if(e.subtreeFlags&13886)for(e=e.child;e!==null;)nd(e,t),e=e.sibling}var qe=null;function nd(t,e){var n=t.alternate,l=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:me(e,t),ge(t),l&4&&(Yn(3,t,t.return),ti(3,t),Yn(5,t,t.return));break;case 1:me(e,t),ge(t),l&512&&(Kt||n===null||We(n,n.return)),l&64&&on&&(t=t.updateQueue,t!==null&&(l=t.callbacks,l!==null&&(n=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=n===null?l:n.concat(l))));break;case 26:var a=qe;if(me(e,t),ge(t),l&512&&(Kt||n===null||We(n,n.return)),l&4){var s=n!==null?n.memoizedState:null;if(l=t.memoizedState,n===null)if(l===null)if(t.stateNode===null){t:{l=t.type,n=t.memoizedProps,a=a.ownerDocument||a;e:switch(l){case"title":s=a.getElementsByTagName("title")[0],(!s||s[Ra]||s[te]||s.namespaceURI==="http://www.w3.org/2000/svg"||s.hasAttribute("itemprop"))&&(s=a.createElement(l),a.head.insertBefore(s,a.querySelector("head > title"))),ae(s,l,n),s[te]=t,Ft(s),l=s;break t;case"link":var d=n1("link","href",a).get(l+(n.href||""));if(d){for(var g=0;g<d.length;g++)if(s=d[g],s.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&s.getAttribute("rel")===(n.rel==null?null:n.rel)&&s.getAttribute("title")===(n.title==null?null:n.title)&&s.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){d.splice(g,1);break e}}s=a.createElement(l),ae(s,l,n),a.head.appendChild(s);break;case"meta":if(d=n1("meta","content",a).get(l+(n.content||""))){for(g=0;g<d.length;g++)if(s=d[g],s.getAttribute("content")===(n.content==null?null:""+n.content)&&s.getAttribute("name")===(n.name==null?null:n.name)&&s.getAttribute("property")===(n.property==null?null:n.property)&&s.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&s.getAttribute("charset")===(n.charSet==null?null:n.charSet)){d.splice(g,1);break e}}s=a.createElement(l),ae(s,l,n),a.head.appendChild(s);break;default:throw Error(f(468,l))}s[te]=t,Ft(s),l=s}t.stateNode=l}else l1(a,t.type,t.stateNode);else t.stateNode=e1(a,l,t.memoizedProps);else s!==l?(s===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):s.count--,l===null?l1(a,t.type,t.stateNode):e1(a,l,t.memoizedProps)):l===null&&t.stateNode!==null&&Ys(t,t.memoizedProps,n.memoizedProps)}break;case 27:me(e,t),ge(t),l&512&&(Kt||n===null||We(n,n.return)),n!==null&&l&4&&Ys(t,t.memoizedProps,n.memoizedProps);break;case 5:if(me(e,t),ge(t),l&512&&(Kt||n===null||We(n,n.return)),t.flags&32){a=t.stateNode;try{Gl(a,"")}catch(lt){Dt(t,t.return,lt)}}l&4&&t.stateNode!=null&&(a=t.memoizedProps,Ys(t,a,n!==null?n.memoizedProps:a)),l&1024&&(Xs=!0);break;case 6:if(me(e,t),ge(t),l&4){if(t.stateNode===null)throw Error(f(162));l=t.memoizedProps,n=t.stateNode;try{n.nodeValue=l}catch(lt){Dt(t,t.return,lt)}}break;case 3:if(Yu=null,a=qe,qe=Qu(e.containerInfo),me(e,t),qe=a,ge(t),l&4&&n!==null&&n.memoizedState.isDehydrated)try{va(e.containerInfo)}catch(lt){Dt(t,t.return,lt)}Xs&&(Xs=!1,ld(t));break;case 4:l=qe,qe=Qu(t.stateNode.containerInfo),me(e,t),ge(t),qe=l;break;case 12:me(e,t),ge(t);break;case 31:me(e,t),ge(t),l&4&&(l=t.updateQueue,l!==null&&(t.updateQueue=null,bu(t,l)));break;case 13:me(e,t),ge(t),t.child.flags&8192&&t.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(Tu=pe()),l&4&&(l=t.updateQueue,l!==null&&(t.updateQueue=null,bu(t,l)));break;case 22:a=t.memoizedState!==null;var S=n!==null&&n.memoizedState!==null,U=on,Z=Kt;if(on=U||a,Kt=Z||S,me(e,t),Kt=Z,on=U,ge(t),l&8192)t:for(e=t.stateNode,e._visibility=a?e._visibility&-2:e._visibility|1,a&&(n===null||S||on||Kt||Sl(t)),n=null,e=t;;){if(e.tag===5||e.tag===26){if(n===null){S=n=e;try{if(s=S.stateNode,a)d=s.style,typeof d.setProperty=="function"?d.setProperty("display","none","important"):d.display="none";else{g=S.stateNode;var J=S.memoizedProps.style,Q=J!=null&&J.hasOwnProperty("display")?J.display:null;g.style.display=Q==null||typeof Q=="boolean"?"":(""+Q).trim()}}catch(lt){Dt(S,S.return,lt)}}}else if(e.tag===6){if(n===null){S=e;try{S.stateNode.nodeValue=a?"":S.memoizedProps}catch(lt){Dt(S,S.return,lt)}}}else if(e.tag===18){if(n===null){S=e;try{var G=S.stateNode;a?Kd(G,!0):Kd(S.stateNode,!1)}catch(lt){Dt(S,S.return,lt)}}}else if((e.tag!==22&&e.tag!==23||e.memoizedState===null||e===t)&&e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break t;for(;e.sibling===null;){if(e.return===null||e.return===t)break t;n===e&&(n=null),e=e.return}n===e&&(n=null),e.sibling.return=e.return,e=e.sibling}l&4&&(l=t.updateQueue,l!==null&&(n=l.retryQueue,n!==null&&(l.retryQueue=null,bu(t,n))));break;case 19:me(e,t),ge(t),l&4&&(l=t.updateQueue,l!==null&&(t.updateQueue=null,bu(t,l)));break;case 30:break;case 21:break;default:me(e,t),ge(t)}}function ge(t){var e=t.flags;if(e&2){try{for(var n,l=t.return;l!==null;){if(Jo(l)){n=l;break}l=l.return}if(n==null)throw Error(f(160));switch(n.tag){case 27:var a=n.stateNode,s=Ls(t);xu(t,s,a);break;case 5:var d=n.stateNode;n.flags&32&&(Gl(d,""),n.flags&=-33);var g=Ls(t);xu(t,g,d);break;case 3:case 4:var S=n.stateNode.containerInfo,U=Ls(t);Gs(t,U,S);break;default:throw Error(f(161))}}catch(Z){Dt(t,t.return,Z)}t.flags&=-3}e&4096&&(t.flags&=-4097)}function ld(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var e=t;ld(e),e.tag===5&&e.flags&1024&&e.stateNode.reset(),t=t.sibling}}function hn(t,e){if(e.subtreeFlags&8772)for(e=e.child;e!==null;)_o(t,e.alternate,e),e=e.sibling}function Sl(t){for(t=t.child;t!==null;){var e=t;switch(e.tag){case 0:case 11:case 14:case 15:Yn(4,e,e.return),Sl(e);break;case 1:We(e,e.return);var n=e.stateNode;typeof n.componentWillUnmount=="function"&&Ko(e,e.return,n),Sl(e);break;case 27:ri(e.stateNode);case 26:case 5:We(e,e.return),Sl(e);break;case 22:e.memoizedState===null&&Sl(e);break;case 30:Sl(e);break;default:Sl(e)}t=t.sibling}}function mn(t,e,n){for(n=n&&(e.subtreeFlags&8772)!==0,e=e.child;e!==null;){var l=e.alternate,a=t,s=e,d=s.flags;switch(s.tag){case 0:case 11:case 15:mn(a,s,n),ti(4,s);break;case 1:if(mn(a,s,n),l=s,a=l.stateNode,typeof a.componentDidMount=="function")try{a.componentDidMount()}catch(U){Dt(l,l.return,U)}if(l=s,a=l.updateQueue,a!==null){var g=l.stateNode;try{var S=a.shared.hiddenCallbacks;if(S!==null)for(a.shared.hiddenCallbacks=null,a=0;a<S.length;a++)H0(S[a],g)}catch(U){Dt(l,l.return,U)}}n&&d&64&&qo(s),ei(s,s.return);break;case 27:Fo(s);case 26:case 5:mn(a,s,n),n&&l===null&&d&4&&ko(s),ei(s,s.return);break;case 12:mn(a,s,n);break;case 31:mn(a,s,n),n&&d&4&&td(a,s);break;case 13:mn(a,s,n),n&&d&4&&ed(a,s);break;case 22:s.memoizedState===null&&mn(a,s,n),ei(s,s.return);break;case 30:break;default:mn(a,s,n)}e=e.sibling}}function Vs(t,e){var n=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),t=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(t=e.memoizedState.cachePool.pool),t!==n&&(t!=null&&t.refCount++,n!=null&&Xa(n))}function Zs(t,e){t=null,e.alternate!==null&&(t=e.alternate.memoizedState.cache),e=e.memoizedState.cache,e!==t&&(e.refCount++,t!=null&&Xa(t))}function Ke(t,e,n,l){if(e.subtreeFlags&10256)for(e=e.child;e!==null;)ad(t,e,n,l),e=e.sibling}function ad(t,e,n,l){var a=e.flags;switch(e.tag){case 0:case 11:case 15:Ke(t,e,n,l),a&2048&&ti(9,e);break;case 1:Ke(t,e,n,l);break;case 3:Ke(t,e,n,l),a&2048&&(t=null,e.alternate!==null&&(t=e.alternate.memoizedState.cache),e=e.memoizedState.cache,e!==t&&(e.refCount++,t!=null&&Xa(t)));break;case 12:if(a&2048){Ke(t,e,n,l),t=e.stateNode;try{var s=e.memoizedProps,d=s.id,g=s.onPostCommit;typeof g=="function"&&g(d,e.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(S){Dt(e,e.return,S)}}else Ke(t,e,n,l);break;case 31:Ke(t,e,n,l);break;case 13:Ke(t,e,n,l);break;case 23:break;case 22:s=e.stateNode,d=e.alternate,e.memoizedState!==null?s._visibility&2?Ke(t,e,n,l):ni(t,e):s._visibility&2?Ke(t,e,n,l):(s._visibility|=2,ua(t,e,n,l,(e.subtreeFlags&10256)!==0||!1)),a&2048&&Vs(d,e);break;case 24:Ke(t,e,n,l),a&2048&&Zs(e.alternate,e);break;default:Ke(t,e,n,l)}}function ua(t,e,n,l,a){for(a=a&&((e.subtreeFlags&10256)!==0||!1),e=e.child;e!==null;){var s=t,d=e,g=n,S=l,U=d.flags;switch(d.tag){case 0:case 11:case 15:ua(s,d,g,S,a),ti(8,d);break;case 23:break;case 22:var Z=d.stateNode;d.memoizedState!==null?Z._visibility&2?ua(s,d,g,S,a):ni(s,d):(Z._visibility|=2,ua(s,d,g,S,a)),a&&U&2048&&Vs(d.alternate,d);break;case 24:ua(s,d,g,S,a),a&&U&2048&&Zs(d.alternate,d);break;default:ua(s,d,g,S,a)}e=e.sibling}}function ni(t,e){if(e.subtreeFlags&10256)for(e=e.child;e!==null;){var n=t,l=e,a=l.flags;switch(l.tag){case 22:ni(n,l),a&2048&&Vs(l.alternate,l);break;case 24:ni(n,l),a&2048&&Zs(l.alternate,l);break;default:ni(n,l)}e=e.sibling}}var li=8192;function ca(t,e,n){if(t.subtreeFlags&li)for(t=t.child;t!==null;)id(t,e,n),t=t.sibling}function id(t,e,n){switch(t.tag){case 26:ca(t,e,n),t.flags&li&&t.memoizedState!==null&&sA(n,qe,t.memoizedState,t.memoizedProps);break;case 5:ca(t,e,n);break;case 3:case 4:var l=qe;qe=Qu(t.stateNode.containerInfo),ca(t,e,n),qe=l;break;case 22:t.memoizedState===null&&(l=t.alternate,l!==null&&l.memoizedState!==null?(l=li,li=16777216,ca(t,e,n),li=l):ca(t,e,n));break;default:ca(t,e,n)}}function ud(t){var e=t.alternate;if(e!==null&&(t=e.child,t!==null)){e.child=null;do e=t.sibling,t.sibling=null,t=e;while(t!==null)}}function ai(t){var e=t.deletions;if((t.flags&16)!==0){if(e!==null)for(var n=0;n<e.length;n++){var l=e[n];Wt=l,sd(l,t)}ud(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)cd(t),t=t.sibling}function cd(t){switch(t.tag){case 0:case 11:case 15:ai(t),t.flags&2048&&Yn(9,t,t.return);break;case 3:ai(t);break;case 12:ai(t);break;case 22:var e=t.stateNode;t.memoizedState!==null&&e._visibility&2&&(t.return===null||t.return.tag!==13)?(e._visibility&=-3,Su(t)):ai(t);break;default:ai(t)}}function Su(t){var e=t.deletions;if((t.flags&16)!==0){if(e!==null)for(var n=0;n<e.length;n++){var l=e[n];Wt=l,sd(l,t)}ud(t)}for(t=t.child;t!==null;){switch(e=t,e.tag){case 0:case 11:case 15:Yn(8,e,e.return),Su(e);break;case 22:n=e.stateNode,n._visibility&2&&(n._visibility&=-3,Su(e));break;default:Su(e)}t=t.sibling}}function sd(t,e){for(;Wt!==null;){var n=Wt;switch(n.tag){case 0:case 11:case 15:Yn(8,n,e);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var l=n.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:Xa(n.memoizedState.cache)}if(l=n.child,l!==null)l.return=n,Wt=l;else t:for(n=t;Wt!==null;){l=Wt;var a=l.sibling,s=l.return;if(Po(l),l===n){Wt=null;break t}if(a!==null){a.return=s,Wt=a;break t}Wt=s}}}var Sg={getCacheForType:function(t){var e=ne(Zt),n=e.data.get(t);return n===void 0&&(n=t(),e.data.set(t,n)),n},cacheSignal:function(){return ne(Zt).controller.signal}},Tg=typeof WeakMap=="function"?WeakMap:Map,Ct=0,jt=null,vt=null,Et=0,Ot=0,De=null,Ln=!1,sa=!1,Is=!1,gn=0,Gt=0,Gn=0,Tl=0,qs=0,Re=0,fa=0,ii=null,Ae=null,Ks=!1,Tu=0,fd=0,Cu=1/0,Ou=null,Xn=null,kt=0,Vn=null,ra=null,An=0,ks=0,Js=null,rd=null,ui=0,Fs=null;function we(){return(Ct&2)!==0&&Et!==0?Et&-Et:M.T!==null?ef():Cr()}function od(){if(Re===0)if((Et&536870912)===0||xt){var t=Bi;Bi<<=1,(Bi&3932160)===0&&(Bi=262144),Re=t}else Re=536870912;return t=Ce.current,t!==null&&(t.flags|=32),Re}function ve(t,e,n){(t===jt&&(Ot===2||Ot===9)||t.cancelPendingCommit!==null)&&(oa(t,0),Zn(t,Et,Re,!1)),Da(t,n),((Ct&2)===0||t!==jt)&&(t===jt&&((Ct&2)===0&&(Tl|=n),Gt===4&&Zn(t,Et,Re,!1)),_e(t))}function dd(t,e,n){if((Ct&6)!==0)throw Error(f(327));var l=!n&&(e&127)===0&&(e&t.expiredLanes)===0||Oa(t,e),a=l?Dg(t,e):_s(t,e,!0),s=l;do{if(a===0){sa&&!l&&Zn(t,e,0,!1);break}else{if(n=t.current.alternate,s&&!Cg(n)){a=_s(t,e,!1),s=!1;continue}if(a===2){if(s=e,t.errorRecoveryDisabledLanes&s)var d=0;else d=t.pendingLanes&-536870913,d=d!==0?d:d&536870912?536870912:0;if(d!==0){e=d;t:{var g=t;a=ii;var S=g.current.memoizedState.isDehydrated;if(S&&(oa(g,d).flags|=256),d=_s(g,d,!1),d!==2){if(Is&&!S){g.errorRecoveryDisabledLanes|=s,Tl|=s,a=4;break t}s=Ae,Ae=a,s!==null&&(Ae===null?Ae=s:Ae.push.apply(Ae,s))}a=d}if(s=!1,a!==2)continue}}if(a===1){oa(t,0),Zn(t,e,0,!0);break}t:{switch(l=t,s=a,s){case 0:case 1:throw Error(f(345));case 4:if((e&4194048)!==e)break;case 6:Zn(l,e,Re,!Ln);break t;case 2:Ae=null;break;case 3:case 5:break;default:throw Error(f(329))}if((e&62914560)===e&&(a=Tu+300-pe(),10<a)){if(Zn(l,e,Re,!Ln),Qi(l,0,!0)!==0)break t;An=e,l.timeoutHandle=Zd(hd.bind(null,l,n,Ae,Ou,Ks,e,Re,Tl,fa,Ln,s,"Throttled",-0,0),a);break t}hd(l,n,Ae,Ou,Ks,e,Re,Tl,fa,Ln,s,null,-0,0)}}break}while(!0);_e(t)}function hd(t,e,n,l,a,s,d,g,S,U,Z,J,Q,G){if(t.timeoutHandle=-1,J=e.subtreeFlags,J&8192||(J&16785408)===16785408){J={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:tn},id(e,s,J);var lt=(s&62914560)===s?Tu-pe():(s&4194048)===s?fd-pe():0;if(lt=fA(J,lt),lt!==null){An=s,t.cancelPendingCommit=lt(xd.bind(null,t,e,s,n,l,a,d,g,S,Z,J,null,Q,G)),Zn(t,s,d,!U);return}}xd(t,e,s,n,l,a,d,g,S)}function Cg(t){for(var e=t;;){var n=e.tag;if((n===0||n===11||n===15)&&e.flags&16384&&(n=e.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var l=0;l<n.length;l++){var a=n[l],s=a.getSnapshot;a=a.value;try{if(!Se(s(),a))return!1}catch{return!1}}if(n=e.child,e.subtreeFlags&16384&&n!==null)n.return=e,e=n;else{if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return!0;e=e.return}e.sibling.return=e.return,e=e.sibling}}return!0}function Zn(t,e,n,l){e&=~qs,e&=~Tl,t.suspendedLanes|=e,t.pingedLanes&=~e,l&&(t.warmLanes|=e),l=t.expirationTimes;for(var a=e;0<a;){var s=31-be(a),d=1<<s;l[s]=-1,a&=~d}n!==0&&br(t,n,e)}function Du(){return(Ct&6)===0?(ci(0),!1):!0}function Ws(){if(vt!==null){if(Ot===0)var t=vt.return;else t=vt,an=gl=null,ds(t),ea=null,Za=0,t=vt;for(;t!==null;)Io(t.alternate,t),t=t.return;vt=null}}function oa(t,e){var n=t.timeoutHandle;n!==-1&&(t.timeoutHandle=-1,qg(n)),n=t.cancelPendingCommit,n!==null&&(t.cancelPendingCommit=null,n()),An=0,Ws(),jt=t,vt=n=nn(t.current,null),Et=e,Ot=0,De=null,Ln=!1,sa=Oa(t,e),Is=!1,fa=Re=qs=Tl=Gn=Gt=0,Ae=ii=null,Ks=!1,(e&8)!==0&&(e|=e&32);var l=t.entangledLanes;if(l!==0)for(t=t.entanglements,l&=e;0<l;){var a=31-be(l),s=1<<a;e|=t[a],l&=~s}return gn=e,Ji(),n}function md(t,e){mt=null,M.H=_a,e===ta||e===nu?(e=w0(),Ot=3):e===ts?(e=w0(),Ot=4):Ot=e===Rs?8:e!==null&&typeof e=="object"&&typeof e.then=="function"?6:1,De=e,vt===null&&(Gt=1,Au(t,Be(e,t.current)))}function gd(){var t=Ce.current;return t===null?!0:(Et&4194048)===Et?Ye===null:(Et&62914560)===Et||(Et&536870912)!==0?t===Ye:!1}function Ad(){var t=M.H;return M.H=_a,t===null?_a:t}function vd(){var t=M.A;return M.A=Sg,t}function Ru(){Gt=4,Ln||(Et&4194048)!==Et&&Ce.current!==null||(sa=!0),(Gn&134217727)===0&&(Tl&134217727)===0||jt===null||Zn(jt,Et,Re,!1)}function _s(t,e,n){var l=Ct;Ct|=2;var a=Ad(),s=vd();(jt!==t||Et!==e)&&(Ou=null,oa(t,e)),e=!1;var d=Gt;t:do try{if(Ot!==0&&vt!==null){var g=vt,S=De;switch(Ot){case 8:Ws(),d=6;break t;case 3:case 2:case 9:case 6:Ce.current===null&&(e=!0);var U=Ot;if(Ot=0,De=null,da(t,g,S,U),n&&sa){d=0;break t}break;default:U=Ot,Ot=0,De=null,da(t,g,S,U)}}Og(),d=Gt;break}catch(Z){md(t,Z)}while(!0);return e&&t.shellSuspendCounter++,an=gl=null,Ct=l,M.H=a,M.A=s,vt===null&&(jt=null,Et=0,Ji()),d}function Og(){for(;vt!==null;)yd(vt)}function Dg(t,e){var n=Ct;Ct|=2;var l=Ad(),a=vd();jt!==t||Et!==e?(Ou=null,Cu=pe()+500,oa(t,e)):sa=Oa(t,e);t:do try{if(Ot!==0&&vt!==null){e=vt;var s=De;e:switch(Ot){case 1:Ot=0,De=null,da(t,e,s,1);break;case 2:case 9:if(D0(s)){Ot=0,De=null,Ed(e);break}e=function(){Ot!==2&&Ot!==9||jt!==t||(Ot=7),_e(t)},s.then(e,e);break t;case 3:Ot=7;break t;case 4:Ot=5;break t;case 7:D0(s)?(Ot=0,De=null,Ed(e)):(Ot=0,De=null,da(t,e,s,7));break;case 5:var d=null;switch(vt.tag){case 26:d=vt.memoizedState;case 5:case 27:var g=vt;if(d?a1(d):g.stateNode.complete){Ot=0,De=null;var S=g.sibling;if(S!==null)vt=S;else{var U=g.return;U!==null?(vt=U,wu(U)):vt=null}break e}}Ot=0,De=null,da(t,e,s,5);break;case 6:Ot=0,De=null,da(t,e,s,6);break;case 8:Ws(),Gt=6;break t;default:throw Error(f(462))}}Rg();break}catch(Z){md(t,Z)}while(!0);return an=gl=null,M.H=l,M.A=a,Ct=n,vt!==null?0:(jt=null,Et=0,Ji(),Gt)}function Rg(){for(;vt!==null&&!_h();)yd(vt)}function yd(t){var e=Vo(t.alternate,t,gn);t.memoizedProps=t.pendingProps,e===null?wu(t):vt=e}function Ed(t){var e=t,n=e.alternate;switch(e.tag){case 15:case 0:e=Qo(n,e,e.pendingProps,e.type,void 0,Et);break;case 11:e=Qo(n,e,e.pendingProps,e.type.render,e.ref,Et);break;case 5:ds(e);default:Io(n,e),e=vt=A0(e,gn),e=Vo(n,e,gn)}t.memoizedProps=t.pendingProps,e===null?wu(t):vt=e}function da(t,e,n,l){an=gl=null,ds(e),ea=null,Za=0;var a=e.return;try{if(Ag(t,a,e,n,Et)){Gt=1,Au(t,Be(n,t.current)),vt=null;return}}catch(s){if(a!==null)throw vt=a,s;Gt=1,Au(t,Be(n,t.current)),vt=null;return}e.flags&32768?(xt||l===1?t=!0:sa||(Et&536870912)!==0?t=!1:(Ln=t=!0,(l===2||l===9||l===3||l===6)&&(l=Ce.current,l!==null&&l.tag===13&&(l.flags|=16384))),pd(e,t)):wu(e)}function wu(t){var e=t;do{if((e.flags&32768)!==0){pd(e,Ln);return}t=e.return;var n=Eg(e.alternate,e,gn);if(n!==null){vt=n;return}if(e=e.sibling,e!==null){vt=e;return}vt=e=t}while(e!==null);Gt===0&&(Gt=5)}function pd(t,e){do{var n=pg(t.alternate,t);if(n!==null){n.flags&=32767,vt=n;return}if(n=t.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!e&&(t=t.sibling,t!==null)){vt=t;return}vt=t=n}while(t!==null);Gt=6,vt=null}function xd(t,e,n,l,a,s,d,g,S){t.cancelPendingCommit=null;do Mu();while(kt!==0);if((Ct&6)!==0)throw Error(f(327));if(e!==null){if(e===t.current)throw Error(f(177));if(s=e.lanes|e.childLanes,s|=Lc,cm(t,n,s,d,g,S),t===jt&&(vt=jt=null,Et=0),ra=e,Vn=t,An=n,ks=s,Js=a,rd=l,(e.subtreeFlags&10256)!==0||(e.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,Ng(Ni,function(){return Od(),null})):(t.callbackNode=null,t.callbackPriority=0),l=(e.flags&13878)!==0,(e.subtreeFlags&13878)!==0||l){l=M.T,M.T=null,a=_.p,_.p=2,d=Ct,Ct|=4;try{xg(t,e,n)}finally{Ct=d,_.p=a,M.T=l}}kt=1,bd(),Sd(),Td()}}function bd(){if(kt===1){kt=0;var t=Vn,e=ra,n=(e.flags&13878)!==0;if((e.subtreeFlags&13878)!==0||n){n=M.T,M.T=null;var l=_.p;_.p=2;var a=Ct;Ct|=4;try{nd(e,t);var s=rf,d=c0(t.containerInfo),g=s.focusedElem,S=s.selectionRange;if(d!==g&&g&&g.ownerDocument&&u0(g.ownerDocument.documentElement,g)){if(S!==null&&Bc(g)){var U=S.start,Z=S.end;if(Z===void 0&&(Z=U),"selectionStart"in g)g.selectionStart=U,g.selectionEnd=Math.min(Z,g.value.length);else{var J=g.ownerDocument||document,Q=J&&J.defaultView||window;if(Q.getSelection){var G=Q.getSelection(),lt=g.textContent.length,ft=Math.min(S.start,lt),Mt=S.end===void 0?ft:Math.min(S.end,lt);!G.extend&&ft>Mt&&(d=Mt,Mt=ft,ft=d);var w=i0(g,ft),O=i0(g,Mt);if(w&&O&&(G.rangeCount!==1||G.anchorNode!==w.node||G.anchorOffset!==w.offset||G.focusNode!==O.node||G.focusOffset!==O.offset)){var B=J.createRange();B.setStart(w.node,w.offset),G.removeAllRanges(),ft>Mt?(G.addRange(B),G.extend(O.node,O.offset)):(B.setEnd(O.node,O.offset),G.addRange(B))}}}}for(J=[],G=g;G=G.parentNode;)G.nodeType===1&&J.push({element:G,left:G.scrollLeft,top:G.scrollTop});for(typeof g.focus=="function"&&g.focus(),g=0;g<J.length;g++){var K=J[g];K.element.scrollLeft=K.left,K.element.scrollTop=K.top}}Vu=!!ff,rf=ff=null}finally{Ct=a,_.p=l,M.T=n}}t.current=e,kt=2}}function Sd(){if(kt===2){kt=0;var t=Vn,e=ra,n=(e.flags&8772)!==0;if((e.subtreeFlags&8772)!==0||n){n=M.T,M.T=null;var l=_.p;_.p=2;var a=Ct;Ct|=4;try{_o(t,e.alternate,e)}finally{Ct=a,_.p=l,M.T=n}}kt=3}}function Td(){if(kt===4||kt===3){kt=0,Ph();var t=Vn,e=ra,n=An,l=rd;(e.subtreeFlags&10256)!==0||(e.flags&10256)!==0?kt=5:(kt=0,ra=Vn=null,Cd(t,t.pendingLanes));var a=t.pendingLanes;if(a===0&&(Xn=null),gc(n),e=e.stateNode,xe&&typeof xe.onCommitFiberRoot=="function")try{xe.onCommitFiberRoot(Ca,e,void 0,(e.current.flags&128)===128)}catch{}if(l!==null){e=M.T,a=_.p,_.p=2,M.T=null;try{for(var s=t.onRecoverableError,d=0;d<l.length;d++){var g=l[d];s(g.value,{componentStack:g.stack})}}finally{M.T=e,_.p=a}}(An&3)!==0&&Mu(),_e(t),a=t.pendingLanes,(n&261930)!==0&&(a&42)!==0?t===Fs?ui++:(ui=0,Fs=t):ui=0,ci(0)}}function Cd(t,e){(t.pooledCacheLanes&=e)===0&&(e=t.pooledCache,e!=null&&(t.pooledCache=null,Xa(e)))}function Mu(){return bd(),Sd(),Td(),Od()}function Od(){if(kt!==5)return!1;var t=Vn,e=ks;ks=0;var n=gc(An),l=M.T,a=_.p;try{_.p=32>n?32:n,M.T=null,n=Js,Js=null;var s=Vn,d=An;if(kt=0,ra=Vn=null,An=0,(Ct&6)!==0)throw Error(f(331));var g=Ct;if(Ct|=4,cd(s.current),ad(s,s.current,d,n),Ct=g,ci(0,!1),xe&&typeof xe.onPostCommitFiberRoot=="function")try{xe.onPostCommitFiberRoot(Ca,s)}catch{}return!0}finally{_.p=a,M.T=l,Cd(t,e)}}function Dd(t,e,n){e=Be(n,e),e=Ds(t.stateNode,e,2),t=Un(t,e,2),t!==null&&(Da(t,2),_e(t))}function Dt(t,e,n){if(t.tag===3)Dd(t,t,n);else for(;e!==null;){if(e.tag===3){Dd(e,t,n);break}else if(e.tag===1){var l=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(Xn===null||!Xn.has(l))){t=Be(n,t),n=Ro(2),l=Un(e,n,2),l!==null&&(wo(n,l,e,t),Da(l,2),_e(l));break}}e=e.return}}function Ps(t,e,n){var l=t.pingCache;if(l===null){l=t.pingCache=new Tg;var a=new Set;l.set(e,a)}else a=l.get(e),a===void 0&&(a=new Set,l.set(e,a));a.has(n)||(Is=!0,a.add(n),t=wg.bind(null,t,e,n),e.then(t,t))}function wg(t,e,n){var l=t.pingCache;l!==null&&l.delete(e),t.pingedLanes|=t.suspendedLanes&n,t.warmLanes&=~n,jt===t&&(Et&n)===n&&(Gt===4||Gt===3&&(Et&62914560)===Et&&300>pe()-Tu?(Ct&2)===0&&oa(t,0):qs|=n,fa===Et&&(fa=0)),_e(t)}function Rd(t,e){e===0&&(e=xr()),t=dl(t,e),t!==null&&(Da(t,e),_e(t))}function Mg(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),Rd(t,n)}function jg(t,e){var n=0;switch(t.tag){case 31:case 13:var l=t.stateNode,a=t.memoizedState;a!==null&&(n=a.retryLane);break;case 19:l=t.stateNode;break;case 22:l=t.stateNode._retryCache;break;default:throw Error(f(314))}l!==null&&l.delete(e),Rd(t,n)}function Ng(t,e){return oc(t,e)}var ju=null,ha=null,$s=!1,Nu=!1,tf=!1,In=0;function _e(t){t!==ha&&t.next===null&&(ha===null?ju=ha=t:ha=ha.next=t),Nu=!0,$s||($s=!0,Bg())}function ci(t,e){if(!tf&&Nu){tf=!0;do for(var n=!1,l=ju;l!==null;){if(t!==0){var a=l.pendingLanes;if(a===0)var s=0;else{var d=l.suspendedLanes,g=l.pingedLanes;s=(1<<31-be(42|t)+1)-1,s&=a&~(d&~g),s=s&201326741?s&201326741|1:s?s|2:0}s!==0&&(n=!0,Nd(l,s))}else s=Et,s=Qi(l,l===jt?s:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(s&3)===0||Oa(l,s)||(n=!0,Nd(l,s));l=l.next}while(n);tf=!1}}function Hg(){wd()}function wd(){Nu=$s=!1;var t=0;In!==0&&Ig()&&(t=In);for(var e=pe(),n=null,l=ju;l!==null;){var a=l.next,s=Md(l,e);s===0?(l.next=null,n===null?ju=a:n.next=a,a===null&&(ha=n)):(n=l,(t!==0||(s&3)!==0)&&(Nu=!0)),l=a}kt!==0&&kt!==5||ci(t),In!==0&&(In=0)}function Md(t,e){for(var n=t.suspendedLanes,l=t.pingedLanes,a=t.expirationTimes,s=t.pendingLanes&-62914561;0<s;){var d=31-be(s),g=1<<d,S=a[d];S===-1?((g&n)===0||(g&l)!==0)&&(a[d]=um(g,e)):S<=e&&(t.expiredLanes|=g),s&=~g}if(e=jt,n=Et,n=Qi(t,t===e?n:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),l=t.callbackNode,n===0||t===e&&(Ot===2||Ot===9)||t.cancelPendingCommit!==null)return l!==null&&l!==null&&dc(l),t.callbackNode=null,t.callbackPriority=0;if((n&3)===0||Oa(t,n)){if(e=n&-n,e===t.callbackPriority)return e;switch(l!==null&&dc(l),gc(n)){case 2:case 8:n=Er;break;case 32:n=Ni;break;case 268435456:n=pr;break;default:n=Ni}return l=jd.bind(null,t),n=oc(n,l),t.callbackPriority=e,t.callbackNode=n,e}return l!==null&&l!==null&&dc(l),t.callbackPriority=2,t.callbackNode=null,2}function jd(t,e){if(kt!==0&&kt!==5)return t.callbackNode=null,t.callbackPriority=0,null;var n=t.callbackNode;if(Mu()&&t.callbackNode!==n)return null;var l=Et;return l=Qi(t,t===jt?l:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),l===0?null:(dd(t,l,e),Md(t,pe()),t.callbackNode!=null&&t.callbackNode===n?jd.bind(null,t):null)}function Nd(t,e){if(Mu())return null;dd(t,e,!0)}function Bg(){Kg(function(){(Ct&6)!==0?oc(yr,Hg):wd()})}function ef(){if(In===0){var t=Pl;t===0&&(t=Hi,Hi<<=1,(Hi&261888)===0&&(Hi=256)),In=t}return In}function Hd(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:Gi(""+t)}function Bd(t,e){var n=e.ownerDocument.createElement("input");return n.name=e.name,n.value=e.value,t.id&&n.setAttribute("form",t.id),e.parentNode.insertBefore(n,e),t=new FormData(t),n.parentNode.removeChild(n),t}function Ug(t,e,n,l,a){if(e==="submit"&&n&&n.stateNode===a){var s=Hd((a[oe]||null).action),d=l.submitter;d&&(e=(e=d[oe]||null)?Hd(e.formAction):d.getAttribute("formAction"),e!==null&&(s=e,d=null));var g=new Ii("action","action",null,l,a);t.push({event:g,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(In!==0){var S=d?Bd(a,d):new FormData(a);xs(n,{pending:!0,data:S,method:a.method,action:s},null,S)}}else typeof s=="function"&&(g.preventDefault(),S=d?Bd(a,d):new FormData(a),xs(n,{pending:!0,data:S,method:a.method,action:s},s,S))},currentTarget:a}]})}}for(var nf=0;nf<Yc.length;nf++){var lf=Yc[nf],Qg=lf.toLowerCase(),zg=lf[0].toUpperCase()+lf.slice(1);Ie(Qg,"on"+zg)}Ie(r0,"onAnimationEnd"),Ie(o0,"onAnimationIteration"),Ie(d0,"onAnimationStart"),Ie("dblclick","onDoubleClick"),Ie("focusin","onFocus"),Ie("focusout","onBlur"),Ie($m,"onTransitionRun"),Ie(tg,"onTransitionStart"),Ie(eg,"onTransitionCancel"),Ie(h0,"onTransitionEnd"),Yl("onMouseEnter",["mouseout","mouseover"]),Yl("onMouseLeave",["mouseout","mouseover"]),Yl("onPointerEnter",["pointerout","pointerover"]),Yl("onPointerLeave",["pointerout","pointerover"]),sl("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),sl("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),sl("onBeforeInput",["compositionend","keypress","textInput","paste"]),sl("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),sl("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),sl("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var si="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Yg=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(si));function Ud(t,e){e=(e&4)!==0;for(var n=0;n<t.length;n++){var l=t[n],a=l.event;l=l.listeners;t:{var s=void 0;if(e)for(var d=l.length-1;0<=d;d--){var g=l[d],S=g.instance,U=g.currentTarget;if(g=g.listener,S!==s&&a.isPropagationStopped())break t;s=g,a.currentTarget=U;try{s(a)}catch(Z){ki(Z)}a.currentTarget=null,s=S}else for(d=0;d<l.length;d++){if(g=l[d],S=g.instance,U=g.currentTarget,g=g.listener,S!==s&&a.isPropagationStopped())break t;s=g,a.currentTarget=U;try{s(a)}catch(Z){ki(Z)}a.currentTarget=null,s=S}}}}function yt(t,e){var n=e[Ac];n===void 0&&(n=e[Ac]=new Set);var l=t+"__bubble";n.has(l)||(Qd(e,t,2,!1),n.add(l))}function af(t,e,n){var l=0;e&&(l|=4),Qd(n,t,l,e)}var Hu="_reactListening"+Math.random().toString(36).slice(2);function uf(t){if(!t[Hu]){t[Hu]=!0,Rr.forEach(function(n){n!=="selectionchange"&&(Yg.has(n)||af(n,!1,t),af(n,!0,t))});var e=t.nodeType===9?t:t.ownerDocument;e===null||e[Hu]||(e[Hu]=!0,af("selectionchange",!1,e))}}function Qd(t,e,n,l){switch(o1(e)){case 2:var a=dA;break;case 8:a=hA;break;default:a=xf}n=a.bind(null,e,n,t),a=void 0,!Cc||e!=="touchstart"&&e!=="touchmove"&&e!=="wheel"||(a=!0),l?a!==void 0?t.addEventListener(e,n,{capture:!0,passive:a}):t.addEventListener(e,n,!0):a!==void 0?t.addEventListener(e,n,{passive:a}):t.addEventListener(e,n,!1)}function cf(t,e,n,l,a){var s=l;if((e&1)===0&&(e&2)===0&&l!==null)t:for(;;){if(l===null)return;var d=l.tag;if(d===3||d===4){var g=l.stateNode.containerInfo;if(g===a)break;if(d===4)for(d=l.return;d!==null;){var S=d.tag;if((S===3||S===4)&&d.stateNode.containerInfo===a)return;d=d.return}for(;g!==null;){if(d=Ul(g),d===null)return;if(S=d.tag,S===5||S===6||S===26||S===27){l=s=d;continue t}g=g.parentNode}}l=l.return}Gr(function(){var U=s,Z=Sc(n),J=[];t:{var Q=m0.get(t);if(Q!==void 0){var G=Ii,lt=t;switch(t){case"keypress":if(Vi(n)===0)break t;case"keydown":case"keyup":G=jm;break;case"focusin":lt="focus",G=wc;break;case"focusout":lt="blur",G=wc;break;case"beforeblur":case"afterblur":G=wc;break;case"click":if(n.button===2)break t;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":G=Zr;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":G=Em;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":G=Bm;break;case r0:case o0:case d0:G=bm;break;case h0:G=Qm;break;case"scroll":case"scrollend":G=vm;break;case"wheel":G=Ym;break;case"copy":case"cut":case"paste":G=Tm;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":G=qr;break;case"toggle":case"beforetoggle":G=Gm}var ft=(e&4)!==0,Mt=!ft&&(t==="scroll"||t==="scrollend"),w=ft?Q!==null?Q+"Capture":null:Q;ft=[];for(var O=U,B;O!==null;){var K=O;if(B=K.stateNode,K=K.tag,K!==5&&K!==26&&K!==27||B===null||w===null||(K=Ma(O,w),K!=null&&ft.push(fi(O,K,B))),Mt)break;O=O.return}0<ft.length&&(Q=new G(Q,lt,null,n,Z),J.push({event:Q,listeners:ft}))}}if((e&7)===0){t:{if(Q=t==="mouseover"||t==="pointerover",G=t==="mouseout"||t==="pointerout",Q&&n!==bc&&(lt=n.relatedTarget||n.fromElement)&&(Ul(lt)||lt[Bl]))break t;if((G||Q)&&(Q=Z.window===Z?Z:(Q=Z.ownerDocument)?Q.defaultView||Q.parentWindow:window,G?(lt=n.relatedTarget||n.toElement,G=U,lt=lt?Ul(lt):null,lt!==null&&(Mt=o(lt),ft=lt.tag,lt!==Mt||ft!==5&&ft!==27&&ft!==6)&&(lt=null)):(G=null,lt=U),G!==lt)){if(ft=Zr,K="onMouseLeave",w="onMouseEnter",O="mouse",(t==="pointerout"||t==="pointerover")&&(ft=qr,K="onPointerLeave",w="onPointerEnter",O="pointer"),Mt=G==null?Q:wa(G),B=lt==null?Q:wa(lt),Q=new ft(K,O+"leave",G,n,Z),Q.target=Mt,Q.relatedTarget=B,K=null,Ul(Z)===U&&(ft=new ft(w,O+"enter",lt,n,Z),ft.target=B,ft.relatedTarget=Mt,K=ft),Mt=K,G&&lt)e:{for(ft=Lg,w=G,O=lt,B=0,K=w;K;K=ft(K))B++;K=0;for(var ct=O;ct;ct=ft(ct))K++;for(;0<B-K;)w=ft(w),B--;for(;0<K-B;)O=ft(O),K--;for(;B--;){if(w===O||O!==null&&w===O.alternate){ft=w;break e}w=ft(w),O=ft(O)}ft=null}else ft=null;G!==null&&zd(J,Q,G,ft,!1),lt!==null&&Mt!==null&&zd(J,Mt,lt,ft,!0)}}t:{if(Q=U?wa(U):window,G=Q.nodeName&&Q.nodeName.toLowerCase(),G==="select"||G==="input"&&Q.type==="file")var St=$r;else if(_r(Q))if(t0)St=Wm;else{St=Jm;var at=km}else G=Q.nodeName,!G||G.toLowerCase()!=="input"||Q.type!=="checkbox"&&Q.type!=="radio"?U&&xc(U.elementType)&&(St=$r):St=Fm;if(St&&(St=St(t,U))){Pr(J,St,n,Z);break t}at&&at(t,Q,U),t==="focusout"&&U&&Q.type==="number"&&U.memoizedProps.value!=null&&pc(Q,"number",Q.value)}switch(at=U?wa(U):window,t){case"focusin":(_r(at)||at.contentEditable==="true")&&(Il=at,Uc=U,Ya=null);break;case"focusout":Ya=Uc=Il=null;break;case"mousedown":Qc=!0;break;case"contextmenu":case"mouseup":case"dragend":Qc=!1,s0(J,n,Z);break;case"selectionchange":if(Pm)break;case"keydown":case"keyup":s0(J,n,Z)}var At;if(jc)t:{switch(t){case"compositionstart":var pt="onCompositionStart";break t;case"compositionend":pt="onCompositionEnd";break t;case"compositionupdate":pt="onCompositionUpdate";break t}pt=void 0}else Zl?Fr(t,n)&&(pt="onCompositionEnd"):t==="keydown"&&n.keyCode===229&&(pt="onCompositionStart");pt&&(Kr&&n.locale!=="ko"&&(Zl||pt!=="onCompositionStart"?pt==="onCompositionEnd"&&Zl&&(At=Xr()):(Rn=Z,Oc="value"in Rn?Rn.value:Rn.textContent,Zl=!0)),at=Bu(U,pt),0<at.length&&(pt=new Ir(pt,t,null,n,Z),J.push({event:pt,listeners:at}),At?pt.data=At:(At=Wr(n),At!==null&&(pt.data=At)))),(At=Vm?Zm(t,n):Im(t,n))&&(pt=Bu(U,"onBeforeInput"),0<pt.length&&(at=new Ir("onBeforeInput","beforeinput",null,n,Z),J.push({event:at,listeners:pt}),at.data=At)),Ug(J,t,U,n,Z)}Ud(J,e)})}function fi(t,e,n){return{instance:t,listener:e,currentTarget:n}}function Bu(t,e){for(var n=e+"Capture",l=[];t!==null;){var a=t,s=a.stateNode;if(a=a.tag,a!==5&&a!==26&&a!==27||s===null||(a=Ma(t,n),a!=null&&l.unshift(fi(t,a,s)),a=Ma(t,e),a!=null&&l.push(fi(t,a,s))),t.tag===3)return l;t=t.return}return[]}function Lg(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function zd(t,e,n,l,a){for(var s=e._reactName,d=[];n!==null&&n!==l;){var g=n,S=g.alternate,U=g.stateNode;if(g=g.tag,S!==null&&S===l)break;g!==5&&g!==26&&g!==27||U===null||(S=U,a?(U=Ma(n,s),U!=null&&d.unshift(fi(n,U,S))):a||(U=Ma(n,s),U!=null&&d.push(fi(n,U,S)))),n=n.return}d.length!==0&&t.push({event:e,listeners:d})}var Gg=/\r\n?/g,Xg=/\u0000|\uFFFD/g;function Yd(t){return(typeof t=="string"?t:""+t).replace(Gg,`
`).replace(Xg,"")}function Ld(t,e){return e=Yd(e),Yd(t)===e}function wt(t,e,n,l,a,s){switch(n){case"children":typeof l=="string"?e==="body"||e==="textarea"&&l===""||Gl(t,l):(typeof l=="number"||typeof l=="bigint")&&e!=="body"&&Gl(t,""+l);break;case"className":Yi(t,"class",l);break;case"tabIndex":Yi(t,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":Yi(t,n,l);break;case"style":Yr(t,l,s);break;case"data":if(e!=="object"){Yi(t,"data",l);break}case"src":case"href":if(l===""&&(e!=="a"||n!=="href")){t.removeAttribute(n);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){t.removeAttribute(n);break}l=Gi(""+l),t.setAttribute(n,l);break;case"action":case"formAction":if(typeof l=="function"){t.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof s=="function"&&(n==="formAction"?(e!=="input"&&wt(t,e,"name",a.name,a,null),wt(t,e,"formEncType",a.formEncType,a,null),wt(t,e,"formMethod",a.formMethod,a,null),wt(t,e,"formTarget",a.formTarget,a,null)):(wt(t,e,"encType",a.encType,a,null),wt(t,e,"method",a.method,a,null),wt(t,e,"target",a.target,a,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){t.removeAttribute(n);break}l=Gi(""+l),t.setAttribute(n,l);break;case"onClick":l!=null&&(t.onclick=tn);break;case"onScroll":l!=null&&yt("scroll",t);break;case"onScrollEnd":l!=null&&yt("scrollend",t);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(f(61));if(n=l.__html,n!=null){if(a.children!=null)throw Error(f(60));t.innerHTML=n}}break;case"multiple":t.multiple=l&&typeof l!="function"&&typeof l!="symbol";break;case"muted":t.muted=l&&typeof l!="function"&&typeof l!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(l==null||typeof l=="function"||typeof l=="boolean"||typeof l=="symbol"){t.removeAttribute("xlink:href");break}n=Gi(""+l),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":l!=null&&typeof l!="function"&&typeof l!="symbol"?t.setAttribute(n,""+l):t.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":l&&typeof l!="function"&&typeof l!="symbol"?t.setAttribute(n,""):t.removeAttribute(n);break;case"capture":case"download":l===!0?t.setAttribute(n,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?t.setAttribute(n,l):t.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?t.setAttribute(n,l):t.removeAttribute(n);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?t.removeAttribute(n):t.setAttribute(n,l);break;case"popover":yt("beforetoggle",t),yt("toggle",t),zi(t,"popover",l);break;case"xlinkActuate":$e(t,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":$e(t,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":$e(t,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":$e(t,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":$e(t,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":$e(t,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":$e(t,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":$e(t,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":$e(t,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":zi(t,"is",l);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=gm.get(n)||n,zi(t,n,l))}}function sf(t,e,n,l,a,s){switch(n){case"style":Yr(t,l,s);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(f(61));if(n=l.__html,n!=null){if(a.children!=null)throw Error(f(60));t.innerHTML=n}}break;case"children":typeof l=="string"?Gl(t,l):(typeof l=="number"||typeof l=="bigint")&&Gl(t,""+l);break;case"onScroll":l!=null&&yt("scroll",t);break;case"onScrollEnd":l!=null&&yt("scrollend",t);break;case"onClick":l!=null&&(t.onclick=tn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!wr.hasOwnProperty(n))t:{if(n[0]==="o"&&n[1]==="n"&&(a=n.endsWith("Capture"),e=n.slice(2,a?n.length-7:void 0),s=t[oe]||null,s=s!=null?s[n]:null,typeof s=="function"&&t.removeEventListener(e,s,a),typeof l=="function")){typeof s!="function"&&s!==null&&(n in t?t[n]=null:t.hasAttribute(n)&&t.removeAttribute(n)),t.addEventListener(e,l,a);break t}n in t?t[n]=l:l===!0?t.setAttribute(n,""):zi(t,n,l)}}}function ae(t,e,n){switch(e){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":yt("error",t),yt("load",t);var l=!1,a=!1,s;for(s in n)if(n.hasOwnProperty(s)){var d=n[s];if(d!=null)switch(s){case"src":l=!0;break;case"srcSet":a=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(f(137,e));default:wt(t,e,s,d,n,null)}}a&&wt(t,e,"srcSet",n.srcSet,n,null),l&&wt(t,e,"src",n.src,n,null);return;case"input":yt("invalid",t);var g=s=d=a=null,S=null,U=null;for(l in n)if(n.hasOwnProperty(l)){var Z=n[l];if(Z!=null)switch(l){case"name":a=Z;break;case"type":d=Z;break;case"checked":S=Z;break;case"defaultChecked":U=Z;break;case"value":s=Z;break;case"defaultValue":g=Z;break;case"children":case"dangerouslySetInnerHTML":if(Z!=null)throw Error(f(137,e));break;default:wt(t,e,l,Z,n,null)}}Br(t,s,g,S,U,d,a,!1);return;case"select":yt("invalid",t),l=d=s=null;for(a in n)if(n.hasOwnProperty(a)&&(g=n[a],g!=null))switch(a){case"value":s=g;break;case"defaultValue":d=g;break;case"multiple":l=g;default:wt(t,e,a,g,n,null)}e=s,n=d,t.multiple=!!l,e!=null?Ll(t,!!l,e,!1):n!=null&&Ll(t,!!l,n,!0);return;case"textarea":yt("invalid",t),s=a=l=null;for(d in n)if(n.hasOwnProperty(d)&&(g=n[d],g!=null))switch(d){case"value":l=g;break;case"defaultValue":a=g;break;case"children":s=g;break;case"dangerouslySetInnerHTML":if(g!=null)throw Error(f(91));break;default:wt(t,e,d,g,n,null)}Qr(t,l,a,s);return;case"option":for(S in n)if(n.hasOwnProperty(S)&&(l=n[S],l!=null))switch(S){case"selected":t.selected=l&&typeof l!="function"&&typeof l!="symbol";break;default:wt(t,e,S,l,n,null)}return;case"dialog":yt("beforetoggle",t),yt("toggle",t),yt("cancel",t),yt("close",t);break;case"iframe":case"object":yt("load",t);break;case"video":case"audio":for(l=0;l<si.length;l++)yt(si[l],t);break;case"image":yt("error",t),yt("load",t);break;case"details":yt("toggle",t);break;case"embed":case"source":case"link":yt("error",t),yt("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(U in n)if(n.hasOwnProperty(U)&&(l=n[U],l!=null))switch(U){case"children":case"dangerouslySetInnerHTML":throw Error(f(137,e));default:wt(t,e,U,l,n,null)}return;default:if(xc(e)){for(Z in n)n.hasOwnProperty(Z)&&(l=n[Z],l!==void 0&&sf(t,e,Z,l,n,void 0));return}}for(g in n)n.hasOwnProperty(g)&&(l=n[g],l!=null&&wt(t,e,g,l,n,null))}function Vg(t,e,n,l){switch(e){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var a=null,s=null,d=null,g=null,S=null,U=null,Z=null;for(G in n){var J=n[G];if(n.hasOwnProperty(G)&&J!=null)switch(G){case"checked":break;case"value":break;case"defaultValue":S=J;default:l.hasOwnProperty(G)||wt(t,e,G,null,l,J)}}for(var Q in l){var G=l[Q];if(J=n[Q],l.hasOwnProperty(Q)&&(G!=null||J!=null))switch(Q){case"type":s=G;break;case"name":a=G;break;case"checked":U=G;break;case"defaultChecked":Z=G;break;case"value":d=G;break;case"defaultValue":g=G;break;case"children":case"dangerouslySetInnerHTML":if(G!=null)throw Error(f(137,e));break;default:G!==J&&wt(t,e,Q,G,l,J)}}Ec(t,d,g,S,U,Z,s,a);return;case"select":G=d=g=Q=null;for(s in n)if(S=n[s],n.hasOwnProperty(s)&&S!=null)switch(s){case"value":break;case"multiple":G=S;default:l.hasOwnProperty(s)||wt(t,e,s,null,l,S)}for(a in l)if(s=l[a],S=n[a],l.hasOwnProperty(a)&&(s!=null||S!=null))switch(a){case"value":Q=s;break;case"defaultValue":g=s;break;case"multiple":d=s;default:s!==S&&wt(t,e,a,s,l,S)}e=g,n=d,l=G,Q!=null?Ll(t,!!n,Q,!1):!!l!=!!n&&(e!=null?Ll(t,!!n,e,!0):Ll(t,!!n,n?[]:"",!1));return;case"textarea":G=Q=null;for(g in n)if(a=n[g],n.hasOwnProperty(g)&&a!=null&&!l.hasOwnProperty(g))switch(g){case"value":break;case"children":break;default:wt(t,e,g,null,l,a)}for(d in l)if(a=l[d],s=n[d],l.hasOwnProperty(d)&&(a!=null||s!=null))switch(d){case"value":Q=a;break;case"defaultValue":G=a;break;case"children":break;case"dangerouslySetInnerHTML":if(a!=null)throw Error(f(91));break;default:a!==s&&wt(t,e,d,a,l,s)}Ur(t,Q,G);return;case"option":for(var lt in n)if(Q=n[lt],n.hasOwnProperty(lt)&&Q!=null&&!l.hasOwnProperty(lt))switch(lt){case"selected":t.selected=!1;break;default:wt(t,e,lt,null,l,Q)}for(S in l)if(Q=l[S],G=n[S],l.hasOwnProperty(S)&&Q!==G&&(Q!=null||G!=null))switch(S){case"selected":t.selected=Q&&typeof Q!="function"&&typeof Q!="symbol";break;default:wt(t,e,S,Q,l,G)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var ft in n)Q=n[ft],n.hasOwnProperty(ft)&&Q!=null&&!l.hasOwnProperty(ft)&&wt(t,e,ft,null,l,Q);for(U in l)if(Q=l[U],G=n[U],l.hasOwnProperty(U)&&Q!==G&&(Q!=null||G!=null))switch(U){case"children":case"dangerouslySetInnerHTML":if(Q!=null)throw Error(f(137,e));break;default:wt(t,e,U,Q,l,G)}return;default:if(xc(e)){for(var Mt in n)Q=n[Mt],n.hasOwnProperty(Mt)&&Q!==void 0&&!l.hasOwnProperty(Mt)&&sf(t,e,Mt,void 0,l,Q);for(Z in l)Q=l[Z],G=n[Z],!l.hasOwnProperty(Z)||Q===G||Q===void 0&&G===void 0||sf(t,e,Z,Q,l,G);return}}for(var w in n)Q=n[w],n.hasOwnProperty(w)&&Q!=null&&!l.hasOwnProperty(w)&&wt(t,e,w,null,l,Q);for(J in l)Q=l[J],G=n[J],!l.hasOwnProperty(J)||Q===G||Q==null&&G==null||wt(t,e,J,Q,l,G)}function Gd(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Zg(){if(typeof performance.getEntriesByType=="function"){for(var t=0,e=0,n=performance.getEntriesByType("resource"),l=0;l<n.length;l++){var a=n[l],s=a.transferSize,d=a.initiatorType,g=a.duration;if(s&&g&&Gd(d)){for(d=0,g=a.responseEnd,l+=1;l<n.length;l++){var S=n[l],U=S.startTime;if(U>g)break;var Z=S.transferSize,J=S.initiatorType;Z&&Gd(J)&&(S=S.responseEnd,d+=Z*(S<g?1:(g-U)/(S-U)))}if(--l,e+=8*(s+d)/(a.duration/1e3),t++,10<t)break}}if(0<t)return e/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var ff=null,rf=null;function Uu(t){return t.nodeType===9?t:t.ownerDocument}function Xd(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Vd(t,e){if(t===0)switch(e){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&e==="foreignObject"?0:t}function of(t,e){return t==="textarea"||t==="noscript"||typeof e.children=="string"||typeof e.children=="number"||typeof e.children=="bigint"||typeof e.dangerouslySetInnerHTML=="object"&&e.dangerouslySetInnerHTML!==null&&e.dangerouslySetInnerHTML.__html!=null}var df=null;function Ig(){var t=window.event;return t&&t.type==="popstate"?t===df?!1:(df=t,!0):(df=null,!1)}var Zd=typeof setTimeout=="function"?setTimeout:void 0,qg=typeof clearTimeout=="function"?clearTimeout:void 0,Id=typeof Promise=="function"?Promise:void 0,Kg=typeof queueMicrotask=="function"?queueMicrotask:typeof Id<"u"?function(t){return Id.resolve(null).then(t).catch(kg)}:Zd;function kg(t){setTimeout(function(){throw t})}function qn(t){return t==="head"}function qd(t,e){var n=e,l=0;do{var a=n.nextSibling;if(t.removeChild(n),a&&a.nodeType===8)if(n=a.data,n==="/$"||n==="/&"){if(l===0){t.removeChild(a),va(e);return}l--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")l++;else if(n==="html")ri(t.ownerDocument.documentElement);else if(n==="head"){n=t.ownerDocument.head,ri(n);for(var s=n.firstChild;s;){var d=s.nextSibling,g=s.nodeName;s[Ra]||g==="SCRIPT"||g==="STYLE"||g==="LINK"&&s.rel.toLowerCase()==="stylesheet"||n.removeChild(s),s=d}}else n==="body"&&ri(t.ownerDocument.body);n=a}while(n);va(e)}function Kd(t,e){var n=t;t=0;do{var l=n.nextSibling;if(n.nodeType===1?e?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",n.getAttribute("style")===""&&n.removeAttribute("style")):n.nodeType===3&&(e?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),l&&l.nodeType===8)if(n=l.data,n==="/$"){if(t===0)break;t--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||t++;n=l}while(n)}function hf(t){var e=t.firstChild;for(e&&e.nodeType===10&&(e=e.nextSibling);e;){var n=e;switch(e=e.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":hf(n),vc(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}t.removeChild(n)}}function Jg(t,e,n,l){for(;t.nodeType===1;){var a=n;if(t.nodeName.toLowerCase()!==e.toLowerCase()){if(!l&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(l){if(!t[Ra])switch(e){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(s=t.getAttribute("rel"),s==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(s!==a.rel||t.getAttribute("href")!==(a.href==null||a.href===""?null:a.href)||t.getAttribute("crossorigin")!==(a.crossOrigin==null?null:a.crossOrigin)||t.getAttribute("title")!==(a.title==null?null:a.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(s=t.getAttribute("src"),(s!==(a.src==null?null:a.src)||t.getAttribute("type")!==(a.type==null?null:a.type)||t.getAttribute("crossorigin")!==(a.crossOrigin==null?null:a.crossOrigin))&&s&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(e==="input"&&t.type==="hidden"){var s=a.name==null?null:""+a.name;if(a.type==="hidden"&&t.getAttribute("name")===s)return t}else return t;if(t=Le(t.nextSibling),t===null)break}return null}function Fg(t,e,n){if(e==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!n||(t=Le(t.nextSibling),t===null))return null;return t}function kd(t,e){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!e||(t=Le(t.nextSibling),t===null))return null;return t}function mf(t){return t.data==="$?"||t.data==="$~"}function gf(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function Wg(t,e){var n=t.ownerDocument;if(t.data==="$~")t._reactRetry=e;else if(t.data!=="$?"||n.readyState!=="loading")e();else{var l=function(){e(),n.removeEventListener("DOMContentLoaded",l)};n.addEventListener("DOMContentLoaded",l),t._reactRetry=l}}function Le(t){for(;t!=null;t=t.nextSibling){var e=t.nodeType;if(e===1||e===3)break;if(e===8){if(e=t.data,e==="$"||e==="$!"||e==="$?"||e==="$~"||e==="&"||e==="F!"||e==="F")break;if(e==="/$"||e==="/&")return null}}return t}var Af=null;function Jd(t){t=t.nextSibling;for(var e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="/$"||n==="/&"){if(e===0)return Le(t.nextSibling);e--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||e++}t=t.nextSibling}return null}function Fd(t){t=t.previousSibling;for(var e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"){if(e===0)return t;e--}else n!=="/$"&&n!=="/&"||e++}t=t.previousSibling}return null}function Wd(t,e,n){switch(e=Uu(n),t){case"html":if(t=e.documentElement,!t)throw Error(f(452));return t;case"head":if(t=e.head,!t)throw Error(f(453));return t;case"body":if(t=e.body,!t)throw Error(f(454));return t;default:throw Error(f(451))}}function ri(t){for(var e=t.attributes;e.length;)t.removeAttributeNode(e[0]);vc(t)}var Ge=new Map,_d=new Set;function Qu(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var vn=_.d;_.d={f:_g,r:Pg,D:$g,C:tA,L:eA,m:nA,X:aA,S:lA,M:iA};function _g(){var t=vn.f(),e=Du();return t||e}function Pg(t){var e=Ql(t);e!==null&&e.tag===5&&e.type==="form"?mo(e):vn.r(t)}var ma=typeof document>"u"?null:document;function Pd(t,e,n){var l=ma;if(l&&typeof e=="string"&&e){var a=Ne(e);a='link[rel="'+t+'"][href="'+a+'"]',typeof n=="string"&&(a+='[crossorigin="'+n+'"]'),_d.has(a)||(_d.add(a),t={rel:t,crossOrigin:n,href:e},l.querySelector(a)===null&&(e=l.createElement("link"),ae(e,"link",t),Ft(e),l.head.appendChild(e)))}}function $g(t){vn.D(t),Pd("dns-prefetch",t,null)}function tA(t,e){vn.C(t,e),Pd("preconnect",t,e)}function eA(t,e,n){vn.L(t,e,n);var l=ma;if(l&&t&&e){var a='link[rel="preload"][as="'+Ne(e)+'"]';e==="image"&&n&&n.imageSrcSet?(a+='[imagesrcset="'+Ne(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(a+='[imagesizes="'+Ne(n.imageSizes)+'"]')):a+='[href="'+Ne(t)+'"]';var s=a;switch(e){case"style":s=ga(t);break;case"script":s=Aa(t)}Ge.has(s)||(t=T({rel:"preload",href:e==="image"&&n&&n.imageSrcSet?void 0:t,as:e},n),Ge.set(s,t),l.querySelector(a)!==null||e==="style"&&l.querySelector(oi(s))||e==="script"&&l.querySelector(di(s))||(e=l.createElement("link"),ae(e,"link",t),Ft(e),l.head.appendChild(e)))}}function nA(t,e){vn.m(t,e);var n=ma;if(n&&t){var l=e&&typeof e.as=="string"?e.as:"script",a='link[rel="modulepreload"][as="'+Ne(l)+'"][href="'+Ne(t)+'"]',s=a;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":s=Aa(t)}if(!Ge.has(s)&&(t=T({rel:"modulepreload",href:t},e),Ge.set(s,t),n.querySelector(a)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(di(s)))return}l=n.createElement("link"),ae(l,"link",t),Ft(l),n.head.appendChild(l)}}}function lA(t,e,n){vn.S(t,e,n);var l=ma;if(l&&t){var a=zl(l).hoistableStyles,s=ga(t);e=e||"default";var d=a.get(s);if(!d){var g={loading:0,preload:null};if(d=l.querySelector(oi(s)))g.loading=5;else{t=T({rel:"stylesheet",href:t,"data-precedence":e},n),(n=Ge.get(s))&&vf(t,n);var S=d=l.createElement("link");Ft(S),ae(S,"link",t),S._p=new Promise(function(U,Z){S.onload=U,S.onerror=Z}),S.addEventListener("load",function(){g.loading|=1}),S.addEventListener("error",function(){g.loading|=2}),g.loading|=4,zu(d,e,l)}d={type:"stylesheet",instance:d,count:1,state:g},a.set(s,d)}}}function aA(t,e){vn.X(t,e);var n=ma;if(n&&t){var l=zl(n).hoistableScripts,a=Aa(t),s=l.get(a);s||(s=n.querySelector(di(a)),s||(t=T({src:t,async:!0},e),(e=Ge.get(a))&&yf(t,e),s=n.createElement("script"),Ft(s),ae(s,"link",t),n.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},l.set(a,s))}}function iA(t,e){vn.M(t,e);var n=ma;if(n&&t){var l=zl(n).hoistableScripts,a=Aa(t),s=l.get(a);s||(s=n.querySelector(di(a)),s||(t=T({src:t,async:!0,type:"module"},e),(e=Ge.get(a))&&yf(t,e),s=n.createElement("script"),Ft(s),ae(s,"link",t),n.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},l.set(a,s))}}function $d(t,e,n,l){var a=(a=ot.current)?Qu(a):null;if(!a)throw Error(f(446));switch(t){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(e=ga(n.href),n=zl(a).hoistableStyles,l=n.get(e),l||(l={type:"style",instance:null,count:0,state:null},n.set(e,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){t=ga(n.href);var s=zl(a).hoistableStyles,d=s.get(t);if(d||(a=a.ownerDocument||a,d={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},s.set(t,d),(s=a.querySelector(oi(t)))&&!s._p&&(d.instance=s,d.state.loading=5),Ge.has(t)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Ge.set(t,n),s||uA(a,t,n,d.state))),e&&l===null)throw Error(f(528,""));return d}if(e&&l!==null)throw Error(f(529,""));return null;case"script":return e=n.async,n=n.src,typeof n=="string"&&e&&typeof e!="function"&&typeof e!="symbol"?(e=Aa(n),n=zl(a).hoistableScripts,l=n.get(e),l||(l={type:"script",instance:null,count:0,state:null},n.set(e,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(f(444,t))}}function ga(t){return'href="'+Ne(t)+'"'}function oi(t){return'link[rel="stylesheet"]['+t+"]"}function t1(t){return T({},t,{"data-precedence":t.precedence,precedence:null})}function uA(t,e,n,l){t.querySelector('link[rel="preload"][as="style"]['+e+"]")?l.loading=1:(e=t.createElement("link"),l.preload=e,e.addEventListener("load",function(){return l.loading|=1}),e.addEventListener("error",function(){return l.loading|=2}),ae(e,"link",n),Ft(e),t.head.appendChild(e))}function Aa(t){return'[src="'+Ne(t)+'"]'}function di(t){return"script[async]"+t}function e1(t,e,n){if(e.count++,e.instance===null)switch(e.type){case"style":var l=t.querySelector('style[data-href~="'+Ne(n.href)+'"]');if(l)return e.instance=l,Ft(l),l;var a=T({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return l=(t.ownerDocument||t).createElement("style"),Ft(l),ae(l,"style",a),zu(l,n.precedence,t),e.instance=l;case"stylesheet":a=ga(n.href);var s=t.querySelector(oi(a));if(s)return e.state.loading|=4,e.instance=s,Ft(s),s;l=t1(n),(a=Ge.get(a))&&vf(l,a),s=(t.ownerDocument||t).createElement("link"),Ft(s);var d=s;return d._p=new Promise(function(g,S){d.onload=g,d.onerror=S}),ae(s,"link",l),e.state.loading|=4,zu(s,n.precedence,t),e.instance=s;case"script":return s=Aa(n.src),(a=t.querySelector(di(s)))?(e.instance=a,Ft(a),a):(l=n,(a=Ge.get(s))&&(l=T({},n),yf(l,a)),t=t.ownerDocument||t,a=t.createElement("script"),Ft(a),ae(a,"link",l),t.head.appendChild(a),e.instance=a);case"void":return null;default:throw Error(f(443,e.type))}else e.type==="stylesheet"&&(e.state.loading&4)===0&&(l=e.instance,e.state.loading|=4,zu(l,n.precedence,t));return e.instance}function zu(t,e,n){for(var l=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),a=l.length?l[l.length-1]:null,s=a,d=0;d<l.length;d++){var g=l[d];if(g.dataset.precedence===e)s=g;else if(s!==a)break}s?s.parentNode.insertBefore(t,s.nextSibling):(e=n.nodeType===9?n.head:n,e.insertBefore(t,e.firstChild))}function vf(t,e){t.crossOrigin==null&&(t.crossOrigin=e.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=e.referrerPolicy),t.title==null&&(t.title=e.title)}function yf(t,e){t.crossOrigin==null&&(t.crossOrigin=e.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=e.referrerPolicy),t.integrity==null&&(t.integrity=e.integrity)}var Yu=null;function n1(t,e,n){if(Yu===null){var l=new Map,a=Yu=new Map;a.set(n,l)}else a=Yu,l=a.get(n),l||(l=new Map,a.set(n,l));if(l.has(t))return l;for(l.set(t,null),n=n.getElementsByTagName(t),a=0;a<n.length;a++){var s=n[a];if(!(s[Ra]||s[te]||t==="link"&&s.getAttribute("rel")==="stylesheet")&&s.namespaceURI!=="http://www.w3.org/2000/svg"){var d=s.getAttribute(e)||"";d=t+d;var g=l.get(d);g?g.push(s):l.set(d,[s])}}return l}function l1(t,e,n){t=t.ownerDocument||t,t.head.insertBefore(n,e==="title"?t.querySelector("head > title"):null)}function cA(t,e,n){if(n===1||e.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof e.precedence!="string"||typeof e.href!="string"||e.href==="")break;return!0;case"link":if(typeof e.rel!="string"||typeof e.href!="string"||e.href===""||e.onLoad||e.onError)break;switch(e.rel){case"stylesheet":return t=e.disabled,typeof e.precedence=="string"&&t==null;default:return!0}case"script":if(e.async&&typeof e.async!="function"&&typeof e.async!="symbol"&&!e.onLoad&&!e.onError&&e.src&&typeof e.src=="string")return!0}return!1}function a1(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function sA(t,e,n,l){if(n.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var a=ga(l.href),s=e.querySelector(oi(a));if(s){e=s._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(t.count++,t=Lu.bind(t),e.then(t,t)),n.state.loading|=4,n.instance=s,Ft(s);return}s=e.ownerDocument||e,l=t1(l),(a=Ge.get(a))&&vf(l,a),s=s.createElement("link"),Ft(s);var d=s;d._p=new Promise(function(g,S){d.onload=g,d.onerror=S}),ae(s,"link",l),n.instance=s}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(n,e),(e=n.state.preload)&&(n.state.loading&3)===0&&(t.count++,n=Lu.bind(t),e.addEventListener("load",n),e.addEventListener("error",n))}}var Ef=0;function fA(t,e){return t.stylesheets&&t.count===0&&Xu(t,t.stylesheets),0<t.count||0<t.imgCount?function(n){var l=setTimeout(function(){if(t.stylesheets&&Xu(t,t.stylesheets),t.unsuspend){var s=t.unsuspend;t.unsuspend=null,s()}},6e4+e);0<t.imgBytes&&Ef===0&&(Ef=62500*Zg());var a=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&Xu(t,t.stylesheets),t.unsuspend)){var s=t.unsuspend;t.unsuspend=null,s()}},(t.imgBytes>Ef?50:800)+e);return t.unsuspend=n,function(){t.unsuspend=null,clearTimeout(l),clearTimeout(a)}}:null}function Lu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Xu(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Gu=null;function Xu(t,e){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Gu=new Map,e.forEach(rA,t),Gu=null,Lu.call(t))}function rA(t,e){if(!(e.state.loading&4)){var n=Gu.get(t);if(n)var l=n.get(null);else{n=new Map,Gu.set(t,n);for(var a=t.querySelectorAll("link[data-precedence],style[data-precedence]"),s=0;s<a.length;s++){var d=a[s];(d.nodeName==="LINK"||d.getAttribute("media")!=="not all")&&(n.set(d.dataset.precedence,d),l=d)}l&&n.set(null,l)}a=e.instance,d=a.getAttribute("data-precedence"),s=n.get(d)||l,s===l&&n.set(null,a),n.set(d,a),this.count++,l=Lu.bind(this),a.addEventListener("load",l),a.addEventListener("error",l),s?s.parentNode.insertBefore(a,s.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(a,t.firstChild)),e.state.loading|=4}}var hi={$$typeof:N,Provider:null,Consumer:null,_currentValue:$,_currentValue2:$,_threadCount:0};function oA(t,e,n,l,a,s,d,g,S){this.tag=1,this.containerInfo=t,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=hc(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=hc(0),this.hiddenUpdates=hc(null),this.identifierPrefix=l,this.onUncaughtError=a,this.onCaughtError=s,this.onRecoverableError=d,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=S,this.incompleteTransitions=new Map}function i1(t,e,n,l,a,s,d,g,S,U,Z,J){return t=new oA(t,e,n,d,S,U,Z,J,g),e=1,s===!0&&(e|=24),s=Te(3,null,null,e),t.current=s,s.stateNode=t,e=_c(),e.refCount++,t.pooledCache=e,e.refCount++,s.memoizedState={element:l,isDehydrated:n,cache:e},es(s),t}function u1(t){return t?(t=kl,t):kl}function c1(t,e,n,l,a,s){a=u1(a),l.context===null?l.context=a:l.pendingContext=a,l=Bn(e),l.payload={element:n},s=s===void 0?null:s,s!==null&&(l.callback=s),n=Un(t,l,e),n!==null&&(ve(n,t,e),qa(n,t,e))}function s1(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var n=t.retryLane;t.retryLane=n!==0&&n<e?n:e}}function pf(t,e){s1(t,e),(t=t.alternate)&&s1(t,e)}function f1(t){if(t.tag===13||t.tag===31){var e=dl(t,67108864);e!==null&&ve(e,t,67108864),pf(t,67108864)}}function r1(t){if(t.tag===13||t.tag===31){var e=we();e=mc(e);var n=dl(t,e);n!==null&&ve(n,t,e),pf(t,e)}}var Vu=!0;function dA(t,e,n,l){var a=M.T;M.T=null;var s=_.p;try{_.p=2,xf(t,e,n,l)}finally{_.p=s,M.T=a}}function hA(t,e,n,l){var a=M.T;M.T=null;var s=_.p;try{_.p=8,xf(t,e,n,l)}finally{_.p=s,M.T=a}}function xf(t,e,n,l){if(Vu){var a=bf(l);if(a===null)cf(t,e,l,Zu,n),d1(t,l);else if(gA(a,t,e,n,l))l.stopPropagation();else if(d1(t,l),e&4&&-1<mA.indexOf(t)){for(;a!==null;){var s=Ql(a);if(s!==null)switch(s.tag){case 3:if(s=s.stateNode,s.current.memoizedState.isDehydrated){var d=cl(s.pendingLanes);if(d!==0){var g=s;for(g.pendingLanes|=2,g.entangledLanes|=2;d;){var S=1<<31-be(d);g.entanglements[1]|=S,d&=~S}_e(s),(Ct&6)===0&&(Cu=pe()+500,ci(0))}}break;case 31:case 13:g=dl(s,2),g!==null&&ve(g,s,2),Du(),pf(s,2)}if(s=bf(l),s===null&&cf(t,e,l,Zu,n),s===a)break;a=s}a!==null&&l.stopPropagation()}else cf(t,e,l,null,n)}}function bf(t){return t=Sc(t),Sf(t)}var Zu=null;function Sf(t){if(Zu=null,t=Ul(t),t!==null){var e=o(t);if(e===null)t=null;else{var n=e.tag;if(n===13){if(t=h(e),t!==null)return t;t=null}else if(n===31){if(t=v(e),t!==null)return t;t=null}else if(n===3){if(e.stateNode.current.memoizedState.isDehydrated)return e.tag===3?e.stateNode.containerInfo:null;t=null}else e!==t&&(t=null)}}return Zu=t,null}function o1(t){switch(t){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch($h()){case yr:return 2;case Er:return 8;case Ni:case tm:return 32;case pr:return 268435456;default:return 32}default:return 32}}var Tf=!1,Kn=null,kn=null,Jn=null,mi=new Map,gi=new Map,Fn=[],mA="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function d1(t,e){switch(t){case"focusin":case"focusout":Kn=null;break;case"dragenter":case"dragleave":kn=null;break;case"mouseover":case"mouseout":Jn=null;break;case"pointerover":case"pointerout":mi.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":gi.delete(e.pointerId)}}function Ai(t,e,n,l,a,s){return t===null||t.nativeEvent!==s?(t={blockedOn:e,domEventName:n,eventSystemFlags:l,nativeEvent:s,targetContainers:[a]},e!==null&&(e=Ql(e),e!==null&&f1(e)),t):(t.eventSystemFlags|=l,e=t.targetContainers,a!==null&&e.indexOf(a)===-1&&e.push(a),t)}function gA(t,e,n,l,a){switch(e){case"focusin":return Kn=Ai(Kn,t,e,n,l,a),!0;case"dragenter":return kn=Ai(kn,t,e,n,l,a),!0;case"mouseover":return Jn=Ai(Jn,t,e,n,l,a),!0;case"pointerover":var s=a.pointerId;return mi.set(s,Ai(mi.get(s)||null,t,e,n,l,a)),!0;case"gotpointercapture":return s=a.pointerId,gi.set(s,Ai(gi.get(s)||null,t,e,n,l,a)),!0}return!1}function h1(t){var e=Ul(t.target);if(e!==null){var n=o(e);if(n!==null){if(e=n.tag,e===13){if(e=h(n),e!==null){t.blockedOn=e,Or(t.priority,function(){r1(n)});return}}else if(e===31){if(e=v(n),e!==null){t.blockedOn=e,Or(t.priority,function(){r1(n)});return}}else if(e===3&&n.stateNode.current.memoizedState.isDehydrated){t.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}t.blockedOn=null}function Iu(t){if(t.blockedOn!==null)return!1;for(var e=t.targetContainers;0<e.length;){var n=bf(t.nativeEvent);if(n===null){n=t.nativeEvent;var l=new n.constructor(n.type,n);bc=l,n.target.dispatchEvent(l),bc=null}else return e=Ql(n),e!==null&&f1(e),t.blockedOn=n,!1;e.shift()}return!0}function m1(t,e,n){Iu(t)&&n.delete(e)}function AA(){Tf=!1,Kn!==null&&Iu(Kn)&&(Kn=null),kn!==null&&Iu(kn)&&(kn=null),Jn!==null&&Iu(Jn)&&(Jn=null),mi.forEach(m1),gi.forEach(m1)}function qu(t,e){t.blockedOn===e&&(t.blockedOn=null,Tf||(Tf=!0,i.unstable_scheduleCallback(i.unstable_NormalPriority,AA)))}var Ku=null;function g1(t){Ku!==t&&(Ku=t,i.unstable_scheduleCallback(i.unstable_NormalPriority,function(){Ku===t&&(Ku=null);for(var e=0;e<t.length;e+=3){var n=t[e],l=t[e+1],a=t[e+2];if(typeof l!="function"){if(Sf(l||n)===null)continue;break}var s=Ql(n);s!==null&&(t.splice(e,3),e-=3,xs(s,{pending:!0,data:a,method:n.method,action:l},l,a))}}))}function va(t){function e(S){return qu(S,t)}Kn!==null&&qu(Kn,t),kn!==null&&qu(kn,t),Jn!==null&&qu(Jn,t),mi.forEach(e),gi.forEach(e);for(var n=0;n<Fn.length;n++){var l=Fn[n];l.blockedOn===t&&(l.blockedOn=null)}for(;0<Fn.length&&(n=Fn[0],n.blockedOn===null);)h1(n),n.blockedOn===null&&Fn.shift();if(n=(t.ownerDocument||t).$$reactFormReplay,n!=null)for(l=0;l<n.length;l+=3){var a=n[l],s=n[l+1],d=a[oe]||null;if(typeof s=="function")d||g1(n);else if(d){var g=null;if(s&&s.hasAttribute("formAction")){if(a=s,d=s[oe]||null)g=d.formAction;else if(Sf(a)!==null)continue}else g=d.action;typeof g=="function"?n[l+1]=g:(n.splice(l,3),l-=3),g1(n)}}}function A1(){function t(s){s.canIntercept&&s.info==="react-transition"&&s.intercept({handler:function(){return new Promise(function(d){return a=d})},focusReset:"manual",scroll:"manual"})}function e(){a!==null&&(a(),a=null),l||setTimeout(n,20)}function n(){if(!l&&!navigation.transition){var s=navigation.currentEntry;s&&s.url!=null&&navigation.navigate(s.url,{state:s.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var l=!1,a=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",e),navigation.addEventListener("navigateerror",e),setTimeout(n,100),function(){l=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",e),navigation.removeEventListener("navigateerror",e),a!==null&&(a(),a=null)}}}function Cf(t){this._internalRoot=t}ku.prototype.render=Cf.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(f(409));var n=e.current,l=we();c1(n,l,t,e,null,null)},ku.prototype.unmount=Cf.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;c1(t.current,2,null,t,null,null),Du(),e[Bl]=null}};function ku(t){this._internalRoot=t}ku.prototype.unstable_scheduleHydration=function(t){if(t){var e=Cr();t={blockedOn:null,target:t,priority:e};for(var n=0;n<Fn.length&&e!==0&&e<Fn[n].priority;n++);Fn.splice(n,0,t),n===0&&h1(t)}};var v1=u.version;if(v1!=="19.2.1")throw Error(f(527,v1,"19.2.1"));_.findDOMNode=function(t){var e=t._reactInternals;if(e===void 0)throw typeof t.render=="function"?Error(f(188)):(t=Object.keys(t).join(","),Error(f(268,t)));return t=A(e),t=t!==null?x(t):null,t=t===null?null:t.stateNode,t};var vA={bundleType:0,version:"19.2.1",rendererPackageName:"react-dom",currentDispatcherRef:M,reconcilerVersion:"19.2.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ju=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ju.isDisabled&&Ju.supportsFiber)try{Ca=Ju.inject(vA),xe=Ju}catch{}}return pi.createRoot=function(t,e){if(!r(t))throw Error(f(299));var n=!1,l="",a=To,s=Co,d=Oo;return e!=null&&(e.unstable_strictMode===!0&&(n=!0),e.identifierPrefix!==void 0&&(l=e.identifierPrefix),e.onUncaughtError!==void 0&&(a=e.onUncaughtError),e.onCaughtError!==void 0&&(s=e.onCaughtError),e.onRecoverableError!==void 0&&(d=e.onRecoverableError)),e=i1(t,1,!1,null,null,n,l,null,a,s,d,A1),t[Bl]=e.current,uf(t),new Cf(e)},pi.hydrateRoot=function(t,e,n){if(!r(t))throw Error(f(299));var l=!1,a="",s=To,d=Co,g=Oo,S=null;return n!=null&&(n.unstable_strictMode===!0&&(l=!0),n.identifierPrefix!==void 0&&(a=n.identifierPrefix),n.onUncaughtError!==void 0&&(s=n.onUncaughtError),n.onCaughtError!==void 0&&(d=n.onCaughtError),n.onRecoverableError!==void 0&&(g=n.onRecoverableError),n.formState!==void 0&&(S=n.formState)),e=i1(t,1,!0,e,n??null,l,a,S,s,d,g,A1),e.context=u1(null),n=e.current,l=we(),l=mc(l),a=Bn(l),a.callback=null,Un(n,a,l),n=l,e.current.lanes=n,Da(e,n),_e(e),t[Bl]=e.current,uf(t),new ku(e)},pi.version="19.2.1",pi}var y2;function c3(){if(y2)return Yf.exports;y2=1;function i(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(u){console.error(u)}}return i(),Yf.exports=u3(),Yf.exports}var s3=c3();class uc{constructor(){this.project=[],this.status=[],this.text=[],this.labels=[],this.annotations=[]}empty(){return this.project.length+this.status.length+this.text.length+this.labels.length+this.annotations.length===0}static parse(u){const c=uc.tokenize(u),f=new Set,r=new Set,o=[],h=new Set,v=new Set;for(let A of c){const x=A.startsWith("!");if(x&&(A=A.slice(1)),A.startsWith("p:")){f.add({name:A.slice(2),not:x});continue}if(A.startsWith("s:")){r.add({name:A.slice(2),not:x});continue}if(A.startsWith("@")){h.add({name:A,not:x});continue}if(A.startsWith("annot:")){v.add({name:A.slice(6),not:x});continue}o.push({name:A.toLowerCase(),not:x})}const y=new uc;return y.text=o,y.project=[...f],y.status=[...r],y.labels=[...h],y.annotations=[...v],y}static tokenize(u){const c=[];let f,r=[];for(let o=0;o<u.length;++o){const h=u[o];if(f&&h==="\\"&&u[o+1]===f){r.push(f),++o;continue}if(h==='"'||h==="'"){f===h?(c.push(r.join("").toLowerCase()),r=[],f=void 0):f?r.push(h):f=h;continue}if(f){r.push(h);continue}if(h===" "){r.length&&(c.push(r.join("").toLowerCase()),r=[]);continue}r.push(h)}return r.length&&c.push(r.join("").toLowerCase()),c}matches(u){const c=f3(u);if(this.project.length&&!!!this.project.find(r=>{const o=c.project.includes(r.name);return r.not?!o:o}))return!1;if(this.status.length){if(!!!this.status.find(r=>{const o=c.status.includes(r.name);return r.not?!o:o}))return!1}else if(c.status==="skipped")return!1;return!(this.text.length&&!this.text.every(r=>{if(c.text.includes(r.name))return!r.not;const[o,h,v]=r.name.split(":");return c.file.includes(o)&&c.line===h&&(v===void 0||c.column===v)?!r.not:!!r.not})||this.labels.length&&!this.labels.every(r=>{const o=c.labels.includes(r.name);return r.not?!o:o})||this.annotations.length&&!this.annotations.every(r=>{const o=c.annotations.some(h=>h.includes(r.name));return r.not?!o:o}))}}const E2=Symbol("searchValues");function f3(i){const u=i[E2];if(u)return u;let c="passed";i.outcome==="unexpected"&&(c="failed"),i.outcome==="flaky"&&(c="flaky"),i.outcome==="skipped"&&(c="skipped");const f={text:(c+" "+i.projectName+" "+i.tags.join(" ")+" "+i.location.file+" "+i.path.join(" ")+" "+i.title).toLowerCase(),project:i.projectName.toLowerCase(),status:c,file:i.location.file,line:String(i.location.line),column:String(i.location.column),labels:i.tags.map(r=>r.toLowerCase()),annotations:i.annotations.map(r=>r.type.toLowerCase()+"="+(r.description??"").toLowerCase())};return i[E2]=f,f}const r3=/("[^"]*"|"[^"]*$|\S+)/g;function Ml(i,u,c){const f=new URLSearchParams(i),o=[...(i.get("q")??"").matchAll(r3)].map(y=>{const A=y[0];return A.startsWith('"')&&A.endsWith('"')&&A.length>1?A.slice(1,A.length-1):A});if(c)return f.set("q",p2(o.includes(u)?o.filter(y=>y!==u):[...o,u])),"#?"+f;let h;u.startsWith("s:")&&(h="s:"),u.startsWith("p:")&&(h="p:"),u.startsWith("@")&&(h="@");const v=o.filter(y=>!y.startsWith(h));return v.push(u),f.set("q",p2(v)),"#?"+f}function p2(i){return i.map(u=>/\s/.test(u)?`"${u}"`:u).join(" ").trim()}const o3=()=>m.jsx("span",{className:"octicon",style:{width:16,height:16}}),Oh=()=>m.jsx("svg",{"aria-hidden":"true",height:"16",viewBox:"0 0 16 16",version:"1.1",width:"16","data-view-component":"true",className:"octicon subnav-search-icon",children:m.jsx("path",{fillRule:"evenodd",d:"M11.5 7a4.499 4.499 0 11-8.998 0A4.499 4.499 0 0111.5 7zm-.82 4.74a6 6 0 111.06-1.06l3.04 3.04a.75.75 0 11-1.06 1.06l-3.04-3.04z"})}),Mi=()=>m.jsx("svg",{"aria-hidden":"true",height:"16",viewBox:"0 0 16 16",version:"1.1",width:"16",className:"octicon color-fg-muted",children:m.jsx("path",{fillRule:"evenodd",d:"M12.78 6.22a.75.75 0 010 1.06l-4.25 4.25a.75.75 0 01-1.06 0L3.22 7.28a.75.75 0 011.06-1.06L8 9.94l3.72-3.72a.75.75 0 011.06 0z"})}),Sa=()=>m.jsx("svg",{"aria-hidden":"true",height:"16",viewBox:"0 0 16 16",version:"1.1",width:"16","data-view-component":"true",className:"octicon color-fg-muted",children:m.jsx("path",{fillRule:"evenodd",d:"M6.22 3.22a.75.75 0 011.06 0l4.25 4.25a.75.75 0 010 1.06l-4.25 4.25a.75.75 0 01-1.06-1.06L9.94 8 6.22 4.28a.75.75 0 010-1.06z"})}),Dh=()=>m.jsx("svg",{"aria-hidden":"true",height:"16",viewBox:"0 0 16 16",version:"1.1",width:"16","data-view-component":"true",className:"octicon color-text-warning",children:m.jsx("path",{fillRule:"evenodd",d:"M8.22 1.754a.25.25 0 00-.44 0L1.698 13.132a.25.25 0 00.22.368h12.164a.25.25 0 00.22-.368L8.22 1.754zm-1.763-.707c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0114.082 15H1.918a1.75 1.75 0 01-1.543-2.575L6.457 1.047zM9 11a1 1 0 11-2 0 1 1 0 012 0zm-.25-5.25a.75.75 0 00-1.5 0v2.5a.75.75 0 001.5 0v-2.5z"})}),Rh=()=>m.jsx("svg",{"aria-hidden":"true",height:"16",viewBox:"0 0 16 16",version:"1.1",width:"16","data-view-component":"true",className:"octicon color-fg-muted",children:m.jsx("path",{fillRule:"evenodd",d:"M3.5 1.75a.25.25 0 01.25-.25h3a.75.75 0 000 1.5h.5a.75.75 0 000-1.5h2.086a.25.25 0 01.177.073l2.914 2.914a.25.25 0 01.073.177v8.586a.25.25 0 01-.25.25h-.5a.75.75 0 000 1.5h.5A1.75 1.75 0 0014 13.25V4.664c0-.464-.184-.909-.513-1.237L10.573.513A1.75 1.75 0 009.336 0H3.75A1.75 1.75 0 002 1.75v11.5c0 .649.353 1.214.874 1.515a.75.75 0 10.752-1.298.25.25 0 01-.126-.217V1.75zM8.75 3a.75.75 0 000 1.5h.5a.75.75 0 000-1.5h-.5zM6 5.25a.75.75 0 01.75-.75h.5a.75.75 0 010 1.5h-.5A.75.75 0 016 5.25zm2 1.5A.75.75 0 018.75 6h.5a.75.75 0 010 1.5h-.5A.75.75 0 018 6.75zm-1.25.75a.75.75 0 000 1.5h.5a.75.75 0 000-1.5h-.5zM8 9.75A.75.75 0 018.75 9h.5a.75.75 0 010 1.5h-.5A.75.75 0 018 9.75zm-.75.75a1.75 1.75 0 00-1.75 1.75v3c0 .414.336.75.75.75h2.5a.75.75 0 00.75-.75v-3a1.75 1.75 0 00-1.75-1.75h-.5zM7 12.25a.25.25 0 01.25-.25h.5a.25.25 0 01.25.25v2.25H7v-2.25z"})}),d3=()=>m.jsx("svg",{"aria-hidden":"true",height:"16",viewBox:"0 0 16 16",version:"1.1",width:"16","data-view-component":"true",className:"octicon color-fg-muted indirect-attachment-indicator",children:m.jsx("path",{fillRule:"evenodd",d:"M3.5 1.75a.25.25 0 01.25-.25h3a.75.75 0 000 1.5h.5a.75.75 0 000-1.5h2.086a.25.25 0 01.177.073l2.914 2.914a.25.25 0 01.073.177v8.586a.25.25 0 01-.25.25h-.5a.75.75 0 000 1.5h.5A1.75 1.75 0 0014 13.25V4.664c0-.464-.184-.909-.513-1.237L10.573.513A1.75 1.75 0 009.336 0H3.75A1.75 1.75 0 002 1.75v11.5c0 .649.353 1.214.874 1.515a.75.75 0 10.752-1.298.25.25 0 01-.126-.217V1.75zM8.75 3a.75.75 0 000 1.5h.5a.75.75 0 000-1.5h-.5zM6 5.25a.75.75 0 01.75-.75h.5a.75.75 0 010 1.5h-.5A.75.75 0 016 5.25zm2 1.5A.75.75 0 018.75 6h.5a.75.75 0 010 1.5h-.5A.75.75 0 018 6.75zm-1.25.75a.75.75 0 000 1.5h.5a.75.75 0 000-1.5h-.5zM8 9.75A.75.75 0 018.75 9h.5a.75.75 0 010 1.5h-.5A.75.75 0 018 9.75zm-.75.75a1.75 1.75 0 00-1.75 1.75v3c0 .414.336.75.75.75h2.5a.75.75 0 00.75-.75v-3a1.75 1.75 0 00-1.75-1.75h-.5zM7 12.25a.25.25 0 01.25-.25h.5a.25.25 0 01.25.25v2.25H7v-2.25z"})}),wh=()=>m.jsx("svg",{className:"octicon color-text-danger",viewBox:"0 0 16 16",version:"1.1",width:"16",height:"16","aria-hidden":"true",children:m.jsx("path",{fillRule:"evenodd",d:"M3.72 3.72a.75.75 0 011.06 0L8 6.94l3.22-3.22a.75.75 0 111.06 1.06L9.06 8l3.22 3.22a.75.75 0 11-1.06 1.06L8 9.06l-3.22 3.22a.75.75 0 01-1.06-1.06L6.94 8 3.72 4.78a.75.75 0 010-1.06z"})}),Mh=()=>m.jsx("svg",{"aria-hidden":"true",height:"16",viewBox:"0 0 16 16",version:"1.1",width:"16","data-view-component":"true",className:"octicon color-icon-success",children:m.jsx("path",{fillRule:"evenodd",d:"M13.78 4.22a.75.75 0 010 1.06l-7.25 7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z"})}),jh=()=>m.jsx("svg",{"aria-hidden":"true",height:"16",viewBox:"0 0 16 16",version:"1.1",width:"16","data-view-component":"true",className:"octicon octicon-clock color-text-danger",children:m.jsx("path",{fillRule:"evenodd",d:"M5.75.75A.75.75 0 016.5 0h3a.75.75 0 010 1.5h-.75v1l-.001.041a6.718 6.718 0 013.464 1.435l.007-.006.75-.75a.75.75 0 111.06 1.06l-.75.75-.006.007a6.75 6.75 0 11-10.548 0L2.72 5.03l-.75-.75a.75.75 0 011.06-1.06l.75.75.007.006A6.718 6.718 0 017.25 2.541a.756.756 0 010-.041v-1H6.5a.75.75 0 01-.75-.75zM8 14.5A5.25 5.25 0 108 4a5.25 5.25 0 000 10.5zm.389-6.7l1.33-1.33a.75.75 0 111.061 1.06L9.45 8.861A1.502 1.502 0 018 10.75a1.5 1.5 0 11.389-2.95z"})}),h3=()=>m.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",width:"16",height:"16","data-view-component":"true",className:"octicon color-fg-muted",children:m.jsx("path",{d:"M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Zm9.78-2.22-5.5 5.5a.749.749 0 0 1-1.275-.326.749.749 0 0 1 .215-.734l5.5-5.5a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042Z"})}),m3=()=>m.jsx("svg",{className:"octicon",viewBox:"0 0 48 48",version:"1.1",width:"20",height:"20","aria-hidden":"true",children:m.jsx("path",{xmlns:"http://www.w3.org/2000/svg",d:"M11.85 32H36.2l-7.35-9.95-6.55 8.7-4.6-6.45ZM7 40q-1.2 0-2.1-.9Q4 38.2 4 37V11q0-1.2.9-2.1Q5.8 8 7 8h34q1.2 0 2.1.9.9.9.9 2.1v26q0 1.2-.9 2.1-.9.9-2.1.9Zm0-29v26-26Zm34 26V11H7v26Z"})}),g3=()=>m.jsx("svg",{className:"octicon",viewBox:"0 0 48 48",version:"1.1",width:"20",height:"20","aria-hidden":"true",children:m.jsx("path",{xmlns:"http://www.w3.org/2000/svg",d:"m19.6 32.35 13-8.45-13-8.45ZM7 40q-1.2 0-2.1-.9Q4 38.2 4 37V11q0-1.2.9-2.1Q5.8 8 7 8h34q1.2 0 2.1.9.9.9.9 2.1v26q0 1.2-.9 2.1-.9.9-2.1.9Zm0-3h34V11H7v26Zm0 0V11v26Z"})}),A3=()=>m.jsx("svg",{className:"octicon",viewBox:"0 0 48 48",version:"1.1",width:"20",height:"20","aria-hidden":"true",children:m.jsx("path",{xmlns:"http://www.w3.org/2000/svg",d:"M7 37h9.35V11H7v26Zm12.35 0h9.3V11h-9.3v26Zm12.3 0H41V11h-9.35v26ZM7 40q-1.2 0-2.1-.9Q4 38.2 4 37V11q0-1.2.9-2.1Q5.8 8 7 8h34q1.2 0 2.1.9.9.9.9 2.1v26q0 1.2-.9 2.1-.9.9-2.1.9Z"})}),v3=()=>m.jsxs("svg",{className:"octicon",viewBox:"0 0 16 16",width:"16",height:"16","aria-hidden":"true",children:[m.jsx("path",{d:"M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Z"}),m.jsx("path",{d:"M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z"})]}),y3=()=>m.jsx("svg",{className:"octicon octicon-settings",viewBox:"0 0 16 16",width:"16",height:"16","aria-hidden":"true",children:m.jsx("path",{d:"M8 0a8.2 8.2 0 0 1 .701.031C9.444.095 9.99.645 10.16 1.29l.288 1.107c.018.066.079.158.212.224.231.114.454.243.668.386.123.082.233.09.299.071l1.103-.303c.644-.176 1.392.021 1.82.63.27.385.506.792.704 1.218.315.675.111 1.422-.364 1.891l-.814.806c-.049.048-.098.147-.088.294.016.257.016.515 0 .772-.01.147.038.246.088.294l.814.806c.475.469.679 1.216.364 1.891a7.977 7.977 0 0 1-.704 1.217c-.428.61-1.176.807-1.82.63l-1.102-.302c-.067-.019-.177-.011-.3.071a5.909 5.909 0 0 1-.668.386c-.133.066-.194.158-.211.224l-.29 1.106c-.168.646-.715 1.196-1.458 1.26a8.006 8.006 0 0 1-1.402 0c-.743-.064-1.289-.614-1.458-1.26l-.289-1.106c-.018-.066-.079-.158-.212-.224a5.738 5.738 0 0 1-.668-.386c-.123-.082-.233-.09-.299-.071l-1.103.303c-.644.176-1.392-.021-1.82-.63a8.12 8.12 0 0 1-.704-1.218c-.315-.675-.111-1.422.363-1.891l.815-.806c.05-.048.098-.147.088-.294a6.214 6.214 0 0 1 0-.772c.01-.147-.038-.246-.088-.294l-.815-.806C.635 6.045.431 5.298.746 4.623a7.92 7.92 0 0 1 .704-1.217c.428-.61 1.176-.807 1.82-.63l1.102.302c.067.019.177.011.3-.071.214-.143.437-.272.668-.386.133-.066.194-.158.211-.224l.29-1.106C6.009.645 6.556.095 7.299.03 7.53.01 7.764 0 8 0Zm-.571 1.525c-.036.003-.108.036-.137.146l-.289 1.105c-.147.561-.549.967-.998 1.189-.173.086-.34.183-.5.29-.417.278-.97.423-1.529.27l-1.103-.303c-.109-.03-.175.016-.195.045-.22.312-.412.644-.573.99-.014.031-.021.11.059.19l.815.806c.411.406.562.957.53 1.456a4.709 4.709 0 0 0 0 .582c.032.499-.119 1.05-.53 1.456l-.815.806c-.081.08-.073.159-.059.19.162.346.353.677.573.989.02.03.085.076.195.046l1.102-.303c.56-.153 1.113-.008 1.53.27.161.107.328.204.501.29.447.222.85.629.997 1.189l.289 1.105c.029.109.101.143.137.146a6.6 6.6 0 0 0 1.142 0c.036-.003.108-.036.137-.146l.289-1.105c.147-.561.549-.967.998-1.189.173-.086.34-.183.5-.29.417-.278.97-.423 1.529-.27l1.103.303c.109.029.175-.016.195-.045.22-.313.411-.644.573-.99.014-.031.021-.11-.059-.19l-.815-.806c-.411-.406-.562-.957-.53-1.456a4.709 4.709 0 0 0 0-.582c-.032-.499.119-1.05.53-1.456l.815-.806c.081-.08.073-.159.059-.19a6.464 6.464 0 0 0-.573-.989c-.02-.03-.085-.076-.195-.046l-1.102.303c-.56.153-1.113.008-1.53-.27a4.44 4.44 0 0 0-.501-.29c-.447-.222-.85-.629-.997-1.189l-.289-1.105c-.029-.11-.101-.143-.137-.146a6.6 6.6 0 0 0-1.142 0ZM11 8a3 3 0 1 1-6 0 3 3 0 0 1 6 0ZM9.5 8a1.5 1.5 0 1 0-3.001.001A1.5 1.5 0 0 0 9.5 8Z"})}),Nh=({value:i})=>{const[u,c]=it.useState("copy"),f=it.useCallback(()=>{navigator.clipboard.writeText(i).then(()=>{c("check"),setTimeout(()=>{c("copy")},3e3)},()=>{c("cross")})},[i]),r=u==="check"?Mh():u==="cross"?wh():v3();return m.jsx("button",{className:"copy-icon",title:"Copy to clipboard","aria-label":"Copy to clipboard",onClick:f,children:r})},or=({children:i,value:u})=>m.jsxs("span",{className:"copy-value-container",children:[i,m.jsx("span",{className:"copy-button-container",children:m.jsx(Nh,{value:u})})]});function E3(i,u,c,f){const[r,o]=ue.useState(c);return ue.useEffect(()=>{let h=!1;return i().then(v=>{h||o(v)}),()=>{h=!0}},u),r}function Hh(){const i=ue.useRef(null),[u]=$f(i);return[u,i]}function $f(i){const[u,c]=ue.useState(new DOMRect(0,0,10,10)),f=ue.useCallback(()=>{const r=i==null?void 0:i.current;r&&c(r.getBoundingClientRect())},[i]);return ue.useLayoutEffect(()=>{const r=i==null?void 0:i.current;if(!r)return;f();const o=new ResizeObserver(f);return o.observe(r),window.addEventListener("resize",f),()=>{o.disconnect(),window.removeEventListener("resize",f)}},[f,i]),[u,f]}function Bh(i,u){u=Dl.getObject(i,u);const[c,f]=ue.useState(u),r=ue.useCallback(o=>{Dl.setObject(i,o)},[i,f]);return ue.useEffect(()=>{{const o=()=>f(Dl.getObject(i,u));return Dl.onChangeEmitter.addEventListener(i,o),()=>Dl.onChangeEmitter.removeEventListener(i,o)}},[u,i]),[c,r]}class p3{constructor(){this.onChangeEmitter=new EventTarget}getString(u,c){return localStorage[u]||c}setString(u,c){var f;localStorage[u]=c,this.onChangeEmitter.dispatchEvent(new Event(u)),(f=window.saveSettings)==null||f.call(window)}getObject(u,c){if(!localStorage[u])return c;try{return JSON.parse(localStorage[u])}catch{return c}}setObject(u,c){var f;localStorage[u]=JSON.stringify(c),this.onChangeEmitter.dispatchEvent(new Event(u)),(f=window.saveSettings)==null||f.call(window)}}const Dl=new p3;function Ze(...i){return i.filter(Boolean).join(" ")}const x2="\\u0000-\\u0020\\u007f-\\u009f",x3=new RegExp("(?:[a-zA-Z][a-zA-Z0-9+.-]{2,}:\\/\\/|www\\.)[^\\s"+x2+'"]{2,}[^\\s'+x2+`"')}\\],:;.!?]`,"ug");function b3(){const[i,u]=ue.useState(!1),c=ue.useCallback(()=>{const f=[];return u(r=>(f.push(setTimeout(()=>u(!1),1e3)),r?(f.push(setTimeout(()=>u(!0),50)),!1):!0)),()=>f.forEach(clearTimeout)},[u]);return[i,c]}function Di(i){const u=[];let c=0,f;for(;(f=x3.exec(i))!==null;){const o=i.substring(c,f.index);o&&u.push(o);const h=f[0];u.push(S3(h)),c=f.index+h.length}const r=i.substring(c);return r&&u.push(r),u}function S3(i){let u=i;return u.startsWith("www.")&&(u="https://"+u),m.jsx("a",{href:u,target:"_blank",rel:"noopener noreferrer",children:i})}const T3=({summary:i,children:u,className:c,style:f})=>{const[r,o]=ue.useState(!1),h=v=>{o(v.currentTarget.open)};return m.jsxs("details",{style:f,className:c,onToggle:h,children:[m.jsxs("summary",{className:"expandable-summary",children:[r?Mi():Sa(),i]}),u]})};function C3(i){let u=0;for(let c=0;c<i.length;c++)u=i.charCodeAt(c)+((u<<8)-u);return Math.abs(u%6)}function Ve(i){if(!i)return i;try{const u=new URL(i,window.location.href);if(u.origin===window.location.origin){for(const[c,f]of new URLSearchParams(window.location.search))u.searchParams.set(c,f);return u.toString()}return i}catch{return i}}const Uh=({label:i,href:u,onClick:c,colorIndex:f,trimAtSymbolPrefix:r})=>{const o=m.jsx("span",{className:Ze("label","label-color-"+(f!==void 0?f:C3(i))),onClick:c?h=>c(h,i):void 0,children:r&&i.startsWith("@")?i.slice(1):i});return u?m.jsx("a",{className:"label-anchor",href:Ve(u),children:o}):o},Qh=({projectNames:i,activeProjectName:u,otherLabels:c,style:f})=>{const r=i.length>0&&!!u;return(r||c.length>0)&&m.jsxs("span",{className:"label-row",style:f,children:[r&&m.jsx(D3,{projectNames:i,projectName:u}),m.jsx(O3,{labels:c})]})},O3=({labels:i})=>{const u=se(),c=it.useCallback((f,r)=>{const o=new URLSearchParams(u);f.preventDefault(),o.has("testId")&&o.delete("speedboard"),o.delete("testId"),ll(Ml(o,r,f.metaKey||f.ctrlKey))},[u]);return m.jsx(m.Fragment,{children:i.map(f=>m.jsx(Uh,{label:f,trimAtSymbolPrefix:!0,onClick:c},f))})};function ll(i){window.history.pushState({},"",i);const u=new PopStateEvent("popstate");window.dispatchEvent(u)}const Vf=({predicate:i,children:u})=>i(se())?u:null,bn=({click:i,ctrlClick:u,children:c,...f})=>m.jsx("a",{...f,style:{textDecoration:"none",color:"var(--color-fg-default)",cursor:"pointer"},onClick:r=>{i&&(r.preventDefault(),ll(Ve((r.metaKey||r.ctrlKey)&&u||i)))},children:c}),dr=({className:i,...u})=>m.jsx(bn,{...u,className:Ze("link-badge",u.dim&&"link-badge-dim",i)}),D3=({projectNames:i,projectName:u})=>{const c=new URLSearchParams(se());return c.has("testId")&&c.delete("speedboard"),c.delete("testId"),m.jsx(bn,{click:Ml(c,`p:${u}`,!1),ctrlClick:Ml(c,`p:${u}`,!0),children:m.jsx(Uh,{label:u,colorIndex:i.indexOf(u)%6})})},$u=({attachment:i,result:u,href:c,linkName:f,openInNewTab:r})=>{const[o,h]=b3();hr("attachment-"+u.attachments.indexOf(i),h);const v=m.jsxs("span",{children:[i.contentType===M3?Dh():Rh(),i.path&&(r?m.jsx("a",{href:Ve(c||i.path),target:"_blank",rel:"noreferrer",children:f||i.name}):m.jsx("a",{href:Ve(c||i.path),download:w3(i),children:f||i.name})),!i.path&&(r?m.jsx("a",{href:URL.createObjectURL(new Blob([i.body],{type:i.contentType})),target:"_blank",rel:"noreferrer",onClick:y=>y.stopPropagation(),children:i.name}):m.jsx("span",{children:Di(i.name)}))]});return i.body?m.jsx(T3,{style:{lineHeight:"32px"},className:Ze(o&&"attachment-flash"),summary:v,children:m.jsxs("div",{className:"attachment-body",children:[m.jsx(Nh,{value:i.body}),Di(i.body)]})}):m.jsxs("div",{style:{lineHeight:"32px",whiteSpace:"nowrap",paddingLeft:4},className:Ze(o&&"attachment-flash"),children:[m.jsx("span",{style:{visibility:"hidden"},children:Sa()}),v]})},zh=({test:i,trailingSeparator:u,dim:c})=>{const f=i.results.map(r=>r.attachments.filter(o=>o.name==="trace")).filter(r=>r.length>0)[0];if(f)return m.jsxs(m.Fragment,{children:[m.jsxs(dr,{href:Ve(Lh(f)),title:"View Trace",className:"button trace-link",dim:c,children:[A3(),m.jsx("span",{children:"View Trace"})]}),u&&m.jsx("div",{className:"trace-link-separator",children:"|"})]})},Yh=it.createContext(new URLSearchParams(window.location.hash.slice(1)));function se(){return it.useContext(Yh)}const R3=({children:i})=>{const[u,c]=it.useState(new URLSearchParams(window.location.hash.slice(1)));return it.useEffect(()=>{const f=()=>c(new URLSearchParams(window.location.hash.slice(1)));return window.addEventListener("popstate",f),()=>window.removeEventListener("popstate",f)},[]),m.jsx(Yh.Provider,{value:u,children:i})};function w3(i){if(i.name.includes(".")||!i.path)return i.name;const u=i.path.indexOf(".");return u===-1?i.name:i.name+i.path.slice(u,i.path.length)}function Lh(i){return`trace/index.html?${i.map((u,c)=>`trace=${new URL(u.path,window.location.href)}`).join("&")}`}const M3="x-playwright/missing";function hr(i,u){const c=se(),f=j3(i);it.useEffect(()=>{if(f)return u()},[f,u,c])}function j3(i){const u=se().get("anchor");return u===null||typeof i>"u"?!1:typeof i=="string"?i===u:Array.isArray(i)?i.includes(u):i(u)}function xi({id:i,children:u}){const c=it.useRef(null),f=it.useCallback(()=>{var r;(r=c.current)==null||r.scrollIntoView({block:"start",inline:"start"})},[]);return hr(i,f),m.jsx("div",{ref:c,children:u})}function il({test:i,result:u,anchor:c},f){const r=new URLSearchParams(f);return i&&r.set("testId",i.testId),i&&u&&r.set("run",""+i.results.indexOf(u)),c&&r.set("anchor",c),"#?"+r}function fc(i){switch(i){case"failed":case"unexpected":return wh();case"passed":case"expected":return Mh();case"timedOut":return jh();case"flaky":return Dh();case"skipped":case"interrupted":return h3()}}const N3=({className:i,style:u,open:c,isModal:f,minWidth:r,verticalOffset:o,requestClose:h,anchor:v,dataTestId:y,children:A})=>{const x=it.useRef(null),[T,D]=it.useState(0),[X]=$f(x),[q,p]=$f(v),E=v?H3(X,q,o):void 0;return it.useEffect(()=>{const b=N=>{!x.current||!(N.target instanceof Node)||x.current.contains(N.target)||h==null||h()},R=N=>{N.key==="Escape"&&(h==null||h())};return c?(document.addEventListener("mousedown",b),document.addEventListener("keydown",R),()=>{document.removeEventListener("mousedown",b),document.removeEventListener("keydown",R)}):()=>{}},[c,h]),it.useLayoutEffect(()=>p(),[c,p]),it.useEffect(()=>{const b=()=>D(R=>R+1);return window.addEventListener("resize",b),()=>{window.removeEventListener("resize",b)}},[]),it.useLayoutEffect(()=>{x.current&&(c?f?x.current.showModal():x.current.show():x.current.close())},[c,f]),m.jsx("dialog",{ref:x,style:{position:"fixed",margin:E?0:void 0,zIndex:110,top:E==null?void 0:E.top,left:E==null?void 0:E.left,minWidth:r||0,...u},className:i,"data-testid":y,children:A})};function H3(i,u,c=4,f=4){let r=Math.max(f,u.left);r+i.width>window.innerWidth-f&&(r=window.innerWidth-i.width-f);let o=Math.max(0,u.bottom)+c;return o+i.height>window.innerHeight-c&&(Math.max(0,u.top)>i.height+c?o=Math.max(0,u.top)-i.height-c:o=window.innerHeight-c-i.height),{left:r,top:o}}const B3="system",Gh="theme",U3=[{label:"Dark mode",value:"dark-mode"},{label:"Light mode",value:"light-mode"},{label:"System",value:"system"}],Xh=window.matchMedia("(prefers-color-scheme: dark)");function Q3(){document.playwrightThemeInitialized||(document.playwrightThemeInitialized=!0,document.defaultView.addEventListener("focus",i=>{i.target.document.nodeType===Node.DOCUMENT_NODE&&document.body.classList.remove("inactive")},!1),document.defaultView.addEventListener("blur",i=>{document.body.classList.add("inactive")},!1),tr(er()),Xh.addEventListener("change",()=>{tr(er())}))}const z3=new Set;function tr(i){const u=Y3(),c=i==="system"?Xh.matches?"dark-mode":"light-mode":i;if(u!==c){u&&document.documentElement.classList.remove(u),document.documentElement.classList.add(c);for(const f of z3)f(c)}}function er(){return Dl.getString(Gh,B3)}function Y3(){return document.documentElement.classList.contains("dark-mode")?"dark-mode":document.documentElement.classList.contains("light-mode")?"light-mode":null}function L3(){const[i,u]=ue.useState(er());return ue.useEffect(()=>{Dl.setString(Gh,i),tr(i)},[i]),[i,u]}const mr=({title:i,leftSuperHeader:u,rightSuperHeader:c})=>m.jsxs("div",{className:"header-view",children:[m.jsxs("div",{className:"hbox header-superheader",children:[u,m.jsx("div",{style:{flex:"auto"}}),c]}),i&&m.jsx("div",{className:"header-title",children:Di(i)})]}),G3=({stats:i,filterText:u,setFilterText:c})=>{const f=se().get("q");return it.useEffect(()=>{c(f?`${f.trim()} `:"")},[f,c]),m.jsx(m.Fragment,{children:m.jsxs("div",{className:"pt-3",children:[m.jsx("div",{className:"header-view-status-container ml-2 pl-2 d-flex",children:m.jsx(X3,{stats:i})}),m.jsxs("form",{className:"subnav-search",onSubmit:r=>{r.preventDefault();const o=new URL(window.location.href),h=new URLSearchParams(o.hash.slice(1)),v=new FormData(r.target).get("q"),y=new URLSearchParams({q:v});h.has("speedboard")&&y.set("speedboard",""),y.toString()&&(o.hash="?"+y.toString()),ll(o)},children:[Oh(),m.jsx("input",{name:"q",spellCheck:!1,className:"form-control subnav-search-input input-contrast width-full","aria-label":"Search tests",placeholder:"Search tests",value:u,onChange:r=>{c(r.target.value)}})]})]})})},X3=({stats:i})=>{const u=se().has("speedboard");return m.jsxs("nav",{children:[m.jsxs(bn,{className:"subnav-item",href:"#?",children:[m.jsx("span",{className:"subnav-item-label",children:"All"}),m.jsx("span",{className:"d-inline counter",children:i.total-i.skipped})]}),m.jsx(tc,{token:"passed",count:i.expected}),m.jsx(tc,{token:"failed",count:i.unexpected}),m.jsx(tc,{token:"flaky",count:i.flaky}),m.jsx(tc,{token:"skipped",count:i.skipped}),m.jsx(bn,{className:"subnav-item",href:"#?speedboard",title:"Speedboard","aria-selected":u,children:jh()}),m.jsx(V3,{})]})},tc=({token:i,count:u})=>{const c=new URLSearchParams(se());c.delete("speedboard"),c.delete("testId");const f=`s:${i}`,r=Ml(c,f,!1),o=Ml(c,f,!0),h=i.charAt(0).toUpperCase()+i.slice(1);return m.jsxs(bn,{className:"subnav-item",href:r,click:r,ctrlClick:o,children:[u>0&&fc(i),m.jsx("span",{className:"subnav-item-label",children:h}),m.jsx("span",{className:"d-inline counter",children:u})]})},V3=()=>{const i=it.useRef(null),[u,c]=it.useState(!1),[f,r]=L3(),[o,h]=Bh("mergeFiles",!1);return m.jsxs(m.Fragment,{children:[m.jsx("div",{role:"button",ref:i,style:{cursor:"pointer"},className:"subnav-item",title:"Settings",onClick:v=>{c(!u),v.preventDefault()},onMouseDown:Z3,children:y3()}),m.jsxs(N3,{open:u,minWidth:150,verticalOffset:4,requestClose:()=>c(!1),anchor:i,dataTestId:"settings-dialog",children:[m.jsxs("label",{className:"header-setting-theme",children:["Theme:",m.jsx("select",{value:f,onChange:v=>r(v.target.value),children:U3.map(v=>m.jsx("option",{value:v.value,children:v.label},v.value))})]}),m.jsxs("label",{style:{cursor:"pointer",display:"flex",alignItems:"center",gap:4},children:[m.jsx("input",{type:"checkbox",checked:o,onChange:()=>h(!o)}),"Merge files"]})]})]})},Z3=i=>{i.stopPropagation(),i.preventDefault()},I3=({tabs:i,selectedTab:u,setSelectedTab:c})=>{const f=it.useId(),r=it.useRef(null),o=h=>{var x;const v=Array.from(((x=r.current)==null?void 0:x.querySelectorAll('[role="tab"]'))??[]),y=v.findIndex(T=>T===document.activeElement);if(y===-1)return;let A=y;if(h.key==="ArrowRight")A=(y+1)%v.length;else if(h.key==="ArrowLeft")A=(y-1+v.length)%v.length;else if(h.key==="Home")A=0;else if(h.key==="End")A=v.length-1;else return;h.preventDefault(),v[A].focus(),c(i[A].id)};return m.jsx("div",{className:"tabbed-pane",children:m.jsxs("div",{className:"vbox",children:[m.jsx("div",{className:"hbox",style:{flex:"none"},children:m.jsx("div",{className:"tabbed-pane-tab-strip",role:"tablist",onKeyDown:o,ref:r,children:i.map(h=>m.jsx("div",{className:Ze("tabbed-pane-tab-element",u===h.id&&"selected"),onClick:()=>c(h.id),id:`${f}-${h.id}`,role:"tab",tabIndex:u===h.id?0:-1,"aria-selected":u===h.id,children:m.jsx("div",{className:"tabbed-pane-tab-label",children:h.title})},h.id))})}),i.map(h=>{if(u===h.id)return m.jsx("div",{className:"tab-content",role:"tabpanel","aria-labelledby":`${f}-${h.id}`,children:h.render()},h.id)})]})})},gr=({header:i,footer:u,expanded:c,setExpanded:f,children:r,noInsets:o,body:h,dataTestId:v})=>{const y=it.useId();return m.jsxs("div",{className:"chip","data-testid":v,children:[m.jsxs("div",{role:"button","aria-expanded":!!c,"aria-controls":y,className:Ze("chip-header",f&&" expanded-"+c),onClick:()=>f==null?void 0:f(!c),title:typeof i=="string"?i:void 0,children:[f?c?m.jsx(Mi,{}):m.jsx(Sa,{}):m.jsx(o3,{}),i]}),(!f||c)&&m.jsxs("div",{id:y,role:"region",className:Ze("chip-body",o&&"chip-body-no-insets"),children:[r,h&&h(),u&&m.jsx("div",{className:"chip-footer",children:u})]})]})},ke=({header:i,initialExpanded:u,noInsets:c,children:f,body:r,dataTestId:o,revealOnAnchorId:h})=>{const[v,y]=it.useState(u??!0),A=it.useCallback(()=>y(!0),[]);return hr(h,A),m.jsx(gr,{header:i,expanded:v,setExpanded:y,noInsets:c,body:r,dataTestId:o,children:f})},q3=({title:i,loadChildren:u,onClick:c,expandByDefault:f,depth:r,style:o,flash:h})=>{const[v,y]=it.useState(f||!1);return it.useEffect(()=>{y(f||!1)},[f]),m.jsxs("div",{role:"treeitem",className:Ze("tree-item",h&&"yellow-flash"),style:o,children:[m.jsxs("div",{className:"tree-item-title",style:{paddingLeft:r*22+4},onClick:()=>{c==null||c(),y(!v)},children:[u&&!!v&&Mi(),u&&!v&&Sa(),!u&&m.jsx("span",{style:{visibility:"hidden"},children:Sa()}),i]}),v&&(u==null?void 0:u())]})};function Ta(i){if(i<0||!isFinite(i))return"-";if(i===0)return"0ms";if(i<1e3)return i.toFixed(0)+"ms";const u=i/1e3;if(u<60)return u.toFixed(1)+"s";const c=u/60;if(c<60)return c.toFixed(1)+"m";const f=c/60;return f<24?f.toFixed(1)+"h":(f/24).toFixed(1)+"d"}const K3="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAYgAAADqCAYAAAC4CNLDAAAMa2lDQ1BJQ0MgUHJvZmlsZQAASImVVwdYU8kWnluSkJDQAqFICb0J0quUEFoEAamCjZAEEkqMCUHFhqio4NpFFCu6KqLoWgBZVMReFsXeFwsqK+tiQVFU3oQEdN1Xvne+b+7898yZ/5Q7c+8dADR7uRJJLqoFQJ44XxofEcIcm5rGJHUAMjABVOAMSFyeTMKKi4sGUAb7v8v7mwBR9NecFFz/HP+vosMXyHgAIOMhzuDLeHkQNwOAb+BJpPkAEBV6y6n5EgUuglhXCgOEeLUCZynxLgXOUOKmAZvEeDbEVwBQo3K50iwANO5DPbOAlwV5ND5D7CLmi8QAaA6HOJAn5PIhVsQ+PC9vsgJXQGwH7SUQw3iAT8Z3nFl/488Y4udys4awMq8BUQsVySS53On/Z2n+t+Tlygd92MBGFUoj4xX5wxrezpkcpcBUiLvEGTGxilpD3CviK+sOAEoRyiOTlPaoMU/GhvUDDIhd+NzQKIiNIQ4X58ZEq/QZmaJwDsRwtaDTRPmcRIgNIF4kkIUlqGy2SCfHq3yhdZlSNkulP8eVDvhV+Hooz0liqfjfCAUcFT+mUShMTIGYArFVgSg5BmINiJ1lOQlRKpuRhUJ2zKCNVB6viN8K4niBOCJEyY8VZErD41X2pXmywXyxLUIRJ0aFD+QLEyOV9cFO8bgD8cNcsCsCMStpkEcgGxs9mAtfEBqmzB17IRAnJah4eiX5IfHKuThFkhunssctBLkRCr0FxB6yggTVXDw5Hy5OJT+eKcmPS1TGiRdmc0fFKePBl4NowAahgAnksGWAySAbiFq76rvgnXIkHHCBFGQBAXBSaQZnpAyMiOE1ARSCPyESANnQvJCBUQEogPovQ1rl1QlkDowWDMzIAc8gzgNRIBfeywdmiYe8JYOnUCP6h3cubDwYby5sivF/rx/UftOwoCZapZEPemRqDloSw4ihxEhiONEeN8IDcX88Gl6DYXPDfXDfwTy+2ROeEdoIjwk3CO2EO5NExdIfohwN2iF/uKoWGd/XAreBnJ54CB4A2SEzzsCNgBPuAf2w8CDo2RNq2aq4FVVh/sD9twy+exoqO7ILGSXrk4PJdj/O1HDQ8BxiUdT6+/ooY80Yqjd7aORH/+zvqs+HfdSPltgi7CB2FjuBnceasHrAxI5jDdgl7KgCD62upwOra9Bb/EA8OZBH9A9/XJVPRSVlLjUunS6flWP5gmn5io3HniyZLhVlCfOZLPh1EDA5Yp7zcKabi5srAIpvjfL19ZYx8A1BGBe+6YrfARDA7+/vb/qmi4Z7/dACuP2ffdPZHoOvCX0AzpXx5NICpQ5XXAjwLaEJd5ohMAWWwA7m4wa8gD8IBmFgFIgFiSAVTIRVFsJ1LgVTwUwwF5SAMrAcrAHrwWawDewCe8EBUA+awAlwBlwEV8ANcA+ung7wEnSD96APQRASQkPoiCFihlgjjogb4oMEImFINBKPpCLpSBYiRuTITGQeUoasRNYjW5Fq5BfkCHICOY+0IXeQR0gn8gb5hGIoFdVFTVAbdATqg7LQKDQRnYBmoVPQQnQ+uhStQKvQPWgdegK9iN5A29GXaA8GMHWMgZljTpgPxsZisTQsE5Nis7FSrByrwmqxRvicr2HtWBf2ESfidJyJO8EVHIkn4Tx8Cj4bX4Kvx3fhdfgp/Br+CO/GvxJoBGOCI8GPwCGMJWQRphJKCOWEHYTDhNNwL3UQ3hOJRAbRlugN92IqMZs4g7iEuJG4j9hMbCM+IfaQSCRDkiMpgBRL4pLySSWkdaQ9pOOkq6QOUq+aupqZmptauFqamlitWK1cbbfaMbWras/V+shaZGuyHzmWzCdPJy8jbyc3ki+TO8h9FG2KLSWAkkjJpsylVFBqKacp9ylv1dXVLdR91ceoi9SL1CvU96ufU3+k/pGqQ3WgsqnjqXLqUupOajP1DvUtjUazoQXT0mj5tKW0atpJ2kNarwZdw1mDo8HXmKNRqVGncVXjlSZZ01qTpTlRs1CzXPOg5mXNLi2ylo0WW4urNVurUuuI1i2tHm26tqt2rHae9hLt3drntV/okHRsdMJ0+DrzdbbpnNR5QsfolnQ2nUefR99OP03v0CXq2upydLN1y3T36rbqduvp6HnoJetN06vUO6rXzsAYNgwOI5exjHGAcZPxSd9En6Uv0F+sX6t/Vf+DwTCDYAOBQanBPoMbBp8MmYZhhjmGKwzrDR8Y4UYORmOMphptMjpt1DVMd5j/MN6w0mEHht01Ro0djOONZxhvM75k3GNiahJhIjFZZ3LSpMuUYRpsmm262vSYaacZ3SzQTGS22uy42R9MPSaLmcusYJ5idpsbm0eay823mrea91nYWiRZFFvss3hgSbH0scy0XG3ZYtltZWY12mqmVY3VXWuytY+10Hqt9VnrDza2Nik2C23qbV7YGthybAtta2zv29Hsguym2FXZXbcn2vvY59hvtL/igDp4OggdKh0uO6KOXo4ix42ObcMJw32Hi4dXDb/lRHViORU41Tg9cmY4RzsXO9c7vxphNSJtxIoRZ0d8dfF0yXXZ7nLPVcd1lGuxa6PrGzcHN55bpdt1d5p7uPsc9wb31x6OHgKPTR63Pemeoz0XerZ4fvHy9pJ61Xp1elt5p3tv8L7lo+sT57PE55wvwTfEd45vk+9HPy+/fL8Dfn/5O/nn+O/2fzHSdqRg5PaRTwIsArgBWwPaA5mB6YFbAtuDzIO4QVVBj4Mtg/nBO4Kfs+xZ2aw9rFchLiHSkMMhH9h+7Fns5lAsNCK0NLQ1TCcsKWx92MNwi/Cs8Jrw7gjPiBkRzZGEyKjIFZG3OCYcHqea0z3Ke9SsUaeiqFEJUeujHkc7REujG0ejo0eNXjX6fox1jDimPhbEcmJXxT6Is42bEvfrGOKYuDGVY57Fu8bPjD+bQE+YlLA74X1iSOKyxHtJdknypJZkzeTxydXJH1JCU1amtI8dMXbW2IupRqmi1IY0Ulpy2o60nnFh49aM6xjvOb5k/M0JthOmTTg/0Whi7sSjkzQncScdTCekp6TvTv/MjeVWcXsyOBkbMrp5bN5a3kt+MH81v1MQIFgpeJ4ZkLky80VWQNaqrE5hkLBc2CVii9aLXmdHZm/O/pATm7Mzpz83JXdfnlpeet4RsY44R3xqsunkaZPbJI6SEkn7FL8pa6Z0S6OkO2SIbIKsIV8X/tRfktvJF8gfFQQWVBb0Tk2eenCa9jTxtEvTHaYvnv68MLzw5xn4DN6MlpnmM+fOfDSLNWvrbGR2xuyWOZZz5s/pKIoo2jWXMjdn7m/FLsUri9/NS5nXON9kftH8JwsiFtSUaJRIS24t9F+4eRG+SLSodbH74nWLv5bySy+UuZSVl31ewlty4SfXnyp+6l+aubR1mdeyTcuJy8XLb64IWrFrpfbKwpVPVo1eVbeaubp09bs1k9acL/co37yWsla+tr0iuqJhndW65es+rxeuv1EZUrlvg/GGxRs+bORvvLopeFPtZpPNZZs/bRFtub01YmtdlU1V+TbitoJtz7Ynbz/7s8/P1TuMdpTt+LJTvLN9V/yuU9Xe1dW7jXcvq0Fr5DWde8bvubI3dG9DrVPt1n2MfWX7wX75/j9+Sf/l5oGoAy0HfQ7WHrI+tOEw/XBpHVI3va67Xljf3pDa0HZk1JGWRv/Gw786/7qzybyp8qje0WXHKMfmH+s/Xni8p1nS3HUi68STlkkt906OPXn91JhTraejTp87E37m5FnW2ePnAs41nfc7f+SCz4X6i14X6y55Xjr8m+dvh1u9Wusue19uuOJ7pbFtZNuxq0FXT1wLvXbmOuf6xRsxN9puJt28fWv8rfbb/Nsv7uTeeX234G7fvaL7hPulD7QelD80flj1u/3v+9q92o8+Cn106XHC43tPeE9ePpU9/dwx/xntWflzs+fVL9xeNHWGd175Y9wfHS8lL/u6Sv7U/nPDK7tXh/4K/utS99jujtfS1/1vlrw1fLvznce7lp64nofv8973fSjtNezd9dHn49lPKZ+e9039TPpc8cX+S+PXqK/3+/P6+yVcKXfgVwCDDc3MBODNTgBoqQDQ4bmNMk55FhwQRHl+HUDgP2HleXFAvACohZ3iN57dDMB+2GyKIHcwAIpf+MRggLq7DzWVyDLd3ZRcVHgSIvT29781AYDUCMAXaX9/38b+/i/bYbB3AGieojyDKoQIzwxbghXohgG/CPwgyvPpdzn+2ANFBB7gx/5fCGaPbNiir/8AAACKZVhJZk1NACoAAAAIAAQBGgAFAAAAAQAAAD4BGwAFAAAAAQAAAEYBKAADAAAAAQACAACHaQAEAAAAAQAAAE4AAAAAAAAAkAAAAAEAAACQAAAAAQADkoYABwAAABIAAAB4oAIABAAAAAEAAAGIoAMABAAAAAEAAADqAAAAAEFTQ0lJAAAAU2NyZWVuc2hvdHGOMr4AAAAJcEhZcwAAFiUAABYlAUlSJPAAAAHWaVRYdFhNTDpjb20uYWRvYmUueG1wAAAAAAA8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJYTVAgQ29yZSA2LjAuMCI+CiAgIDxyZGY6UkRGIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyI+CiAgICAgIDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiCiAgICAgICAgICAgIHhtbG5zOmV4aWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20vZXhpZi8xLjAvIj4KICAgICAgICAgPGV4aWY6UGl4ZWxZRGltZW5zaW9uPjIzNDwvZXhpZjpQaXhlbFlEaW1lbnNpb24+CiAgICAgICAgIDxleGlmOlBpeGVsWERpbWVuc2lvbj4zOTI8L2V4aWY6UGl4ZWxYRGltZW5zaW9uPgogICAgICAgICA8ZXhpZjpVc2VyQ29tbWVudD5TY3JlZW5zaG90PC9leGlmOlVzZXJDb21tZW50PgogICAgICA8L3JkZjpEZXNjcmlwdGlvbj4KICAgPC9yZGY6UkRGPgo8L3g6eG1wbWV0YT4KmnXOOwAAABxpRE9UAAAAAgAAAAAAAAB1AAAAKAAAAHUAAAB1AABxIC1bFLAAAEAASURBVHgB7L13tF/HcedZL+eInAECIAmQIMAkikESRSUqi6Ngj23ZK8u2rLFlr3c8Zz27Pp7dtXfOnOM/PDNOs+u8li3ZEiVKJCVKlJgpBpAERQIkkXPGw8s57fdT99XDxQ+/38PDCwBI3gZ+797bt7uqu7q6qro63KKXXnxp9LFHH7OtW7daX2+fjY6O6memvzZxiPdFShb36Rz54okj5EufvMn+ZhTIKJBRIKNAPgrkk6mkyxefK2vj+Vy4ReTX/+KiIquoqLAVK1fY+97/Plu9ZrUV/ec/+s+jzzz9jLWePq2co1ailIjvYf0d4WYMbrGuJcU8F9nwcCgRPROATwL9HyUT+fhlIaPANChQJF4rLi52oyXAJAbM5JiL/PxGRkY8ezwHDJ65Bwf3BNISN5kQeeIa+SeTN0uTUeCSUaAAe9MD4OXqmmrbdP0m+4XP/4IVffbffHb0xPETNjo0ZHWlxba0stwG1UEO9Q1Y9/CI0bVQDLVVxbZsHurD7OCpYevsGTG9dqVQonfl80qtqKzIBk4O2XCXOpmUSBYyCkyHAmVlZTZ//nzr6+uz/v5+47mjo0MGyvB5wcLodXV1nranp8eFfnl5udXU1DgM3peUlNjAwICnq62tdeXQ2trquM6HgPxYW6Wl4nvdA5vraRlaoZDOByN7n1FgRimQFrmJvZMffDpdKkVkoV/Qd37rd37Lij7+kY+Ptp5utSZpgc8uarINdVU2oFHAM21d9t0T7dYri6q2ssg+9+5qe+dVdAKzzTsH7OuP91hHj6yv8iJrur3G6jZW+X3PngFreaTTBk+fvxOnypbdZhQ4hwJVVVX23ve+13p7e62rq8sFb0tLiwtlhD4COQQ0SoNnrP/KykobksGD0Edgw+wIbRTNVVddZQcPHvRRA/EvvfSSzZ07166++mprb2+37u5uVyoopMiPIkAB8H7OnDkG7uPHj1tzc7MtWLDA8fKe+FOnTll9fb3jpRz8KDujlIaGBk8zODjo8ceOHXN851Q8i8gocKEUyCf0Q+LnwsqXVmkiOf2IvveLX/hFK/ro3R8dbW9rt5WVZfaHaxdbtRQFA4OWgSH799sPWcfQsM2pK7Y//XeN1lzrPiYphhH7zb9stRNtI8boYcVvzbWyphLGJzbSP2KH/u609e4dyC1W9pxR4IIogLX/kY98xBUEwhdrH4UA8yJcly1b5sIXwb1kyRJ/19nZ6aOEvXv3umKA2RHYCPkdO3bY2rVr/Z78WEpPPfWUj0w2btxoR48etdWrVzsehHpTU5PDRLmgmHhGESDgN2/ePJ4P+IcOHfJyVVdXuzKgvOAkD7gY/aAgUEC8Q6G9/PLLRnmzkFFg2hQoIPTHpX4aQYG0aQWBYfO5f/u5MwpiRUWp/cGaxdZYVuIK4kDvgP3BriPjCuKPv9hgi+dICQjj8bZh+w9/0zauIJb+arNVLi5zBTHcPWyH/6HVevdnCiLdJtn9hVMgFMSWLVvc7YPw5oeAfe2119zq379/vx04cMDuuusuF9yMEvg988wzPlpAoCPAGQ28/vrrLqQZBTCyoBM8+eSTriiuu+46VxBXXHGFjwJQOAj0gMfIgPLg8iLviy++6KOVW2+91ZXGrl27bPHixQ4TxXPy5El/xmWFkjh8+LABm7zAZBRDuVE2WcgoMG0KFBD6DjckPw8TpItkGFX0jc/8zGfOKIhqvb29qdbeM6fO5x5+eKrDXu6U1SZ3U6XcSLfIvfShGys102328EvqgG8MWE//qBWValJjTbk1vrPGSmqKrXNLr3X8tNeGu5OJwWlXPAPwtqUAowWENFZ2DHthXNxIWPU333yzbdu2zS100hHPD/cSIwBGGo2NjbZRwn9Y6Z977jm33BHgWPBY9QjsgB2uH2CjWMAPLGCShnvwc2XUQsBNxXvykod0wEUJcCU+nlFS4GUkhAuLK7iykFFg2hSYQPBPFnZaQVRUVtg9n77njIIoGlWnkJ+0Vi4mZg+6YGQpB/CiFMo1AV1b5QuirLN31AaG6KR6qXfFeldcqZUgGmAMy/00Oqh8Gd9Ptl2ydFOgAEIX4c+kNcI2X0BYI+RJhzBm5JFZ7PkolcW96SkwCwrik/d80oo+8qGP+BxEriUzGurkTU+5rAIZBTIKZBR4i1NgFhTExz75MSu68113juInzRTEW5yBsuplFMgo8NalwDQVRHo8wIq7cRfTsqXLRlmhMTySLUt963JPVrOMAhkFMgpMjgLFRcU+f/cbv/kbVqRVGaOs0MgdQUwOVJYqo0BGgYwCGQXeShRg7o7l2l/5ylcyBfFWatisLhkFMgpkFJguBUJB/MZvZCOI6dIyy59RIKNARoG3FAVCQXz5y1/OP4IoLimz0opKK6/SrlDd93V32GBPp2k7hB/gx1lNWcgokFEgo0BGgbceBUJBfOlLX8qvIGqaF9ui6+60q265SbuqS+31R79nB1/8kd1YW2I7uwetdWh2NznERqa3HumzGmUUyCiQUeDypkAoiF/7tV+zonnz5vkqpvQkddOCK2zZpvfb+g992BrnNtuL3/66bbn/r+2m6mLb2ztoxwfPVRDr1q2zz3zmM75x6bHHHvMjCdra2mz79u2+kYkdpASQ84vALlRCxKMcPv3pT9sDDzzgZ/DwbuHChX5o29e+9jXficqRBRzgxvk36XKTNgsZBTIKZBTIKDB1CoSC+NVf/dUCCqK2ya689n3WeNsHrbF+xJqOPmf7tj5ldac7bMuxTtvV2nMOdk7d/Nmf/Vl79tln/bwcDkZDQYAMJcDhaQh6DkTjzBoOLUMZcKAZyoOVVEuXLvUza6688ko/AkHKy/Nz3g5K45FHHrEjR47Yhz/8YYfzj//4j37swTmFySIyCmQUyCiQUWBKFAgF8Su/8iv5FcS8snJb1TDHiq661ZYtn2u3zztsi5fV2f6t+2zza0ftG5v3n4P4/e9/v+Gz4hA1Nt5xBAJn6HB65sqVK/3wtPXr1/s7TrfkADPecWYNowFOtuR0zu9///vG0IZzazhw7V3vepd94xvfsA9+8IP29NNP+wFsnLHz05/+1O69997s6IRzWiKLyCiQUSCjwNQpEArii1/8Yn4FsUgnuy6uKLPXdcTNtSub7T9+5mpbfMVCe/EnO+wbTx2wR7cfPwc7I4iPf/zj9id/8id+7g3Pa9as8VEBB6Lt3r3bhT5xf/u3f2u33367Kw7ecdomp2Nyvg4K4vd///d9He4rr7xi7373u+2f/umf7KabbnKF8KlPfcqPU37jjTfsW9/6VqYgzmmJLCKjQEaBjAJTp8B5FUSTvix3ZU2ZvdgxoCO+a+0Ld66yxuY6e33HMbvvpcN2oqPvHOwrVqwwfj/5yU/cdbRq1So/iZMrh6kxX3D99de7cP/2t7/tiiMmo9mUgYuJgCK54447bNGiRX6cM26pv/iLv3CFgVLgwy4cvMb7Bx980N1T5xQmi8gokFEgo0BGgSlRIBTEL//yL+cfQZQVaSddSZF16puiFWWltmJuna1b2mzP7zpmx9t7bci/NTo53CBjDoJjkj/5yU/6kcucg3++yWXO/b/tttv8Qy2c2Z99WGVy9M5SZRTIKJBRYDoUCAXxhS98Ib+CADjrjFhfJPmuez4ez8ffdcT3FPdAgJQRA4rhfMoB/BwYxY/AJHasdvKI7E9GgYwCGQUyCswKBSalIGYFcwY0o0BGgYwCGQUuawpkCuKybp6scBkFMgpkFLh0FDhLQSxYsOCcjXKXrmgZ5owCGQUyCmQUuJQUwLXPVoJf+qVfsiLtMxhlAjjXx88zP7QJv4sVMrwXi9KaY8ra+KIQ+1LRmcpdKtwZ3ovCWo5kNmjNoiL2thXt2rVrFAUAktzAJjZ2Ol9MBUEZWBYbH4DPLdNsPVN/vlfMN4xjcny2cKXhgpdluxe7vlGGS0XrS1HnaGP221xMno42pi9dinCp2pj+dClofanwwtNvlTZGBj7++ONWpEqN0ogRhoaG/JYEMBYVnqrApGOkz2DiOUK6g3Ifz+nOFHGRZ7LXwBv5WTUVOHiXrg/xxPGj7tAi/X6yOElXCG+8YxVXbgi801EQwKCOXCNEvXgOOsQ1HRfCY6p1DnzpK+WIMgE37ql/lCs6U7pMaRhTvY9VcuAKvOAIvLTxdGhdqFxpvKQJGkR6hNZsGFuBh2s6RJ2Ji348k7QOvNQ72niU+1QbU+eZpjV4g9cvdhvHasrAm0vz2WrjqC9tGbSmLNGfZquNOcHiLAVBQV7YvNkLcbUO36MwDDW4XmgAFuctbXnpJWue06weY378xiKdw3To0EGbN2++H7cBXOBztEYIDeKm05kQAuy1YARUV1dn27XB7iptsDtx4gSgbZU271E+fjU1NY6XkQPMPB0FAYNwBlWfjg5ZonOlXn/9NVuyZKk6aJ9vBLzhhhs0ShlyYQUeykmnZaPgdDoSeA8ePKDzqY6Z5pR0nMlpwU1oevjwYd/RDo4QGuCiM1er7sHUU2ljJ2aeP9SLHfLQm82TnL91ROW44cYbXXCGlTWdNs6D1qM45mXXzp22cdMmPwtMI2Sd/bVI7VxrlTJ2yvmp/jMpLEEM3q2vvmq3au8OnZfjZHp7e2zOnLnOU/Sj2agvwp/zyeDlOXPm2D6deQYvLxfdCfiSaQ/wz2SdgXlS7dve3j5+hhp1po1HVP8K4SPMdJ3p02ym7dd1w3XXic5Hbafa+8orr3Jcs9XG0Jcz4fhxqgPPyJUaya15c9XG4qnZamP68AHhXbFyhc2dO8/7FnHsFaPf0sbw3EzT+iwFgTbkTKTnn3/empubrbGx0a8IlqkIDwiIgjh+/Lg3IvdLly6zffv2SmCtdcZq0e7puvo6pevxyh6TIFmn85rAOVWGph4w0Q9/+EOrl3Lo0PzKMglrLBsYuKqq0mEjqFEOHChYLmGN4lqyZMm0FAR4f/DQQy6AVkoJcR7V3r17XGiXlyeCCeXBXpKGhgYJziO2dMlSW63jR2jkqXZg8KKI2zva1SWLXCB2dXZZj3CtWrXSOLIExdHV1eVKGeVRJiFCGVFU0HoqbSxkeQNtj9Bi9zxMjNJEITVLgKE42A0P7afaxnmRjkUiqDdvft7e8547fXMl/Nfe3uYGygLtyudAyNlQEJwE8MwzP7G77/6wnTx50tj1T4elPCt1FhlGSSjpicp/oe8Q1KGAFy9ZbE8+8aSfMtCos84InHxMG0+Hv/KViTbGCGtpOeV127Z1m/P67bff4YbBWh24idE300ILIxLeOnjwoN1yyy0ywl5PjMDtb3gdl0nGLNWZbjPdxsgVeOlVGQEoCPpLq3iZ9kWuoJCXL1/udZ5qP85HZ+KAf/p0i2hZ6UbAT3VuHX1+rg4zLZVcu0J9DKNgpvvTOQoC4rNrGWHSJAUBk01VQUBQ4D388MM6YmOTE3bFipUuFNGCAwP9duL4CVuoIzPoUBydgfCAyByvMVWGBi/wHpKgpmNwKOBcCabaulrX/ggmtG11dY208VzbtnWr4ybPe++6a9oK4qmnnvLGQsFinXOKLXXDqqqXUiCup6fHGUnmtHemO3QgISOdqTIWSuenUgLUZ+vWV23F8hWuLPj4OAJx8wubbc3qNXZKnbmpqdnPvmppaXHBRTlnWkHA1Cx8wNLDqsXagaFpWzo2p/lSrplmaPD29fXali1bbMOG61z579+/T0pqjdOZctylNp5p4QFe2vS55561W2+9zQ+sRDnSngsWzPdy3HzzO9womElFDF4C/eyll14Uny32foYRhDEGT3P2GWedTbU/JRjy/21ra1V7HvI23r17lw0PDbvM6JRhBC+uknKaaQVB/9kpg4P6zJec2rlzh4zZJhkh29XP53qd79Q5cDPdxsgVDB0UI6NiZMhLOj8Ogxa+QlFs3LjR5c1Mt/GBA/vdCFi//hrr0IgNGYNhcKMUFaM4yjAbBtdZCiJYAIsXK5TODOPRwFOpMIRESOzZs9sa6hvcnUHlaFQ0IqMUiF5ZWeE+Uvxpra1trhy4n47wAC5Db5iJsu+RoELDU55EOVS7IkCBMEQOgY0yIW4q9YV+wMatwkiM+h0+fEgn1C63XgmPUxLI0JQ0w8ND8h+WOjOj+VEg0+lIwIRBwc0R6V2qZwkWhdruqIbgCAvw0J5lOjplYGDQR3fghVZTbePgmXxXGLhbI5Zu1R1BSfkYoTFqhAcoz3TqnA8ncdAijplnBAfe5uYmrzMWLe0y08IDvNQXXCGIqRsjNkYWpaUlUhQLp8XT4CgUgu8YCXdppE7fw7CDrzG2CNPpT4XwhrETqyChOycynxavz58/30pVnpluY/o1Rhe4MTR4RhGu1CiNK4JyNtoYmuLGpT1RxPA0+OApykJfm6c6R/sXotlU4hmpMYJAEVI3aNrT0y28Q2e18UzTOq+CoLJUHiGN1QfSqQhMBA+/NDyITAA+v3QgbQQ623QrG/DACTzqA06eqU/g5zmddjoKAjh01gjARhBy5RdliPekJQ+/6Qgt8gcOYAd9ieMdeCMEDXiGDigNcE+ljQNmvmvUK122qD9xM9HGk8Wbrhs0mQ6t8+EkLl3fwEdc8APX6fL0RLiBT9tGOUjLM2WhD852nYP/vI2hh36Uaabxgge4XMFFfQncE8cz15nGC1x4FtzgSgfeQWvezUYbB17a0unr7YxMSepOfBjzlGOmQl4FkQaOgoDQwfDpd7N1D7GxCmaD0BOVGbyJhT31EcRE8Au9C7wzzdCF8KXjg9aXoo1DMc0kQ6frlu/+UtE66DxVniY/QgJBD4zojzxzjxGSL5AHYcl76FyI1iFYcwUfMHnHj3cBLwR/4KUcBIyrCBPRmnfkIX/UhT4PDuJCAZCOHyHeBfxC14nwFsozE/HgvRRyi7LPFu5MQaQ4IxhrOiOIFLhJ3wbeTEFMmmRTTnipaB0dOARorqDmfTqkhXkIaNyy/NauXSO3Rp0LBVwcvMfVgqAFTsACBi6RMn38i/mAtPAnTRoHypq5oVWaSI8QZeQdk7O4I5kcrpDBuF2++GuuucbdHaTHxUTZrrrqKi8PecGRNgKiXKTnft++fT4PBU1I/4IWFqxbpwUqchHt2bPH501w/2KklqhuK1U23EfnC7l4z5d+pt6D962mIL75zW+evcw1l1jZCCKXIjP/fKkYmpoEU2cjiJlv1zRE6Mwqvvvv/65Wj5XZO7T6hqWZQ7Kir5RQ5WNZo6MjErBX+9JofNw33MC3U0rsR1rkUasFDKx6YwXgdddt9MUWzHMh0Jn34KTl22673f3jTz/9lBTGEl/0wEIEVsrhF1+zZq1WVr1uixYu8rmRPi29vummm32ugqWi37nvPnufds4e2H9AvinTyr9l1qS5m23bWJ201+68870+gmBxwdOaJGXZ+KuvvuKK6frrb/AyVVdXSYkc9YlaVqodP87qm1at1FviOI+oLJVaiVM5tiwTujDJuljvWR3U0FBvV6690n748A/1Jcl3ex1YIt7R3uHLlplfO1+4VP0p+tJUR4nnq9dE72cLdzaCSFE9GCsbQaSIMku3QeuLPWq6lHiZsP7bv/0b26T9GXL2+Iq94xKOWOJY2qzMWaT9GkwsM6F86623+jLpXbt2+wiBPRVbteIOYcyyVgT1gNwyz8vy/sQnPuGLIbZt2+pLi1nifNPNN7vFz3JmYDJ5zUQqS6FH9D2XBq1eY0IZIxC3Dp/33bDhWs/DqISFDc8//5yvysKi52Nf3d1dvt8AVxPW/UMPfV8jmivFJaMqa6cvK29TPKMZFp/Qvu1tyXMixLQ0UysYUYpPPPGEKwCW4e7atdNHINdvul7fmhk2lnF+Qt+OYQUcYbP2ZqFkWBV1vnAp2/itNoLIFESK24KxMgWRIsos3Qat3y4KAoHLCOLP/vS/+34bhPyjjz7qI4gPfuhDbomzOuaaa671UQLLNVnxxmqvx5QOy3rxkqVaPrtNCuZ627F9uw2PDGs/yTpfYokCuOeee/xrjq/rm/C4Yq5YfYVGJebuJdbrs+S4V8qA1U0IdJZAr1u/zlfk4PNn/87KVSvt4IGDPrJk1R/upFYtZWWUsuHaDT6CYOSAAjsht9NXv/qPWq20wG7U5jhGRKxiGhwa9L0XJ0+clEBnn025vbzlJXcdbdy4yVfYse/n8ccf8/kUYFPevt5k4xurc9joeP0NN7rLChZEmVypfRWxIou4QuFS8lamIAq1ygzG08CXgtDBWJmCmMHGLAAqaP12URDUFyH+7LPP+iYrhDT7YuR8d/89AhTh/a53vUtCs9Ine/HLExDe3PND0UQ877gHNhZ7TCKzhJqNkDHnwPv4kT8dT7703AXpRqR4In/kAxf3LLdk+Sp7dlhC/Kr23tz8jnc4jEhDujYJ/RfkNuPTwelln1EProxC2MDJCKamptqVHX0v4ESdqD+uMfZQsaT0fAH86bmP86WfqffgvRRyi/LPFu5sBJHijmCsTEGkiDJLt0HrqSoIhAZCgA4JrMkG0rJ6hjZOC9rJ5p9qOvBSVoQiPuq0ICQOYVtRUe7KAXdPumzkTT+nywCcNLz0u/R9KJZCcNJpC90H7YABXujILxmRnJ0LoR90nsgnj9LkxwiCdCiFCNAFGMy10Na8C7pFmnzXKCdpp1PffLAnigNvKCbaEPyzsfckXxnAPRnlBB9A1+DFfLAwIOiXtEc2SZ2iUDQwDZtm1FSSWbkNvFMVltMpVDAWuN9MdUYAcSQMvnGYfrKB+ka42MJjpvFSfjZ2YqWzSmmigEC42Pw1Xb6mjZkX4eyjN1sbI1yZs1k3dp7dRG0zE++iH0+kjMGDcmC12nPPPeeKOR9uYOAyZEVapiBSFAqGzhREiiizdBu0nqrQwuLmKBWYHaZ/OwYUOsekfOADH7CVK1cWJMFkhUdBAFN8Md02ZhL8wQcf9ElzRoxvpsDIYcOGDToP7D3jLr3ZLP9k2xhD4TXNUT399NM+J5avTJSdhRS4O++9995smWsQKRg6UxBBkdm7Bq2nqiCY8H3kkUdcQbzZhMdMUTUUxJ133ulHmBSCO1nhUSj/VONnoo05cJMVW2+2NsYKR0FwmODFGJlPto1x2bGYgJEZrr18AQVxnU7JvVmr4CZUEEPDo7bzcLsNjrJLM5kwywdw5uPkTxvQ0QAX2YfIyo4BnW1SpnNzmKS7aAHfpVZ+UN+LS2dqCK111IZWmkzW5eKcoD9Lmiusvlo7X7UGfzJheFTnVHXqCOyhXs0bjIz7qFnyOdlAuyyo1dlCA8N2fM8uO7LzDR0Qd/YIgnoUl1da9ZKVVuQ0PRs6wiYmas9+M7tPjHTwTc9c0DEeRcPWVywf/chAYbDir5gPUCMXTjfNN0CuEN2vWbHBaiprfJVU+OQny1vpInT3ddueg7tsz+HdvmIr/e5898NaxltSchH78FiBgrcwMtlvMker0RbWLbLK0kobHBmy411HtcprgrY6X8XyvVebVpZUWENRnVl7qw33dOZLZcXaf1NS12hdct3t3/aK9fjJz+cmRRZwsnWz9pw8+PRzhUcQvQMj9nv/vNtOdXFe0LmAZjNmRAIEproQ4THd8lBFrfdwcXVx8SarTBB+s9d9C1NnSrRWQX/m1nn2wQ1NVlU+uY7YP9Rvf/38n1l7b6uOO9fxDWKq4gsUWKXFpfbBKz9uV9UstxPf/bq1b33JRnI6HHQsrau3db/7X3RtOKvi07VqzwJ2AQ+TtfAuAKQvJ3394Db78/v+qx04sf9Css5KWvprfXWD/c5n/oNtWn2jlZeWj0/aTkVBdPZ32Pdev8/2nNYpsRKuFxKmwlsXAr9Q2jReZEipDuT8zHW/YCuaVtmRjkN236v/Yh39HMk/c4Hlyg3lDfYzyz5hLfd/zbr37BDwcwV2qXbfz3nHnVYxb5Ed/cE3bbDtdMFC0IdKamrtpfoVhRVEd9+wfe6/v26nuy6scQpizV68pSjwS+9eYD93+zyrr5qcVdw72Gv/18P/q9HxCbDwhSrEEimIT6z/jN1Yd7Ud/pv/Zu3bpCAGz7bIgFlcWW03/um/WnljstEKfIS3koIYGOy3LbtfcgVxsj35EFZSy0v3t1ojh1//6G/aHRvebZXlVdNSEK29Lfb/vfBXU1IQU+GtmaDauXiL7Ndv/W27ct56292yw7764l9be5++TTLDobakxn57zRfs+Ff/0rp2vpYXemlNnc297S6rXrbaDt379zbQPpGC0Chcy61fW3trYQXBCOIrf7/TTnYM5dFHecswc5EMWS7QupwJ5AiQqVg708V9qfB6uadAa4Tw59813z6yqdmqK84+2bIQLQY0gvizp//YTveedhfTmc40eTXBCOLj6z9t62pW2dFv/J21vbLZRuWeOyuIb8o0crj2P/2plda+xUcQB7bZ//PAn9mJ1uMXv4+eRXS6q76MWFFtX/r4b9qNa2+ekRHEt7f+i+06lWwKzEE3wSN+gDA+Js9bEwCc5KvAm+BEfJUWl9kv3PBFW9ksodx+wP7l5X+wjr7EQJok0PMmg+7NFY32+RWftZPqE9173sibp0Tfv5n/ng/7COLwd75qg3JHFQyCWVpday8vXFdYQQwOaoPKLn3KsFSfqpRv8eKF/HMQDN8GNS8yrCNuS0uKrHzGfYyXZg4C5YCPuLz88piDGO7tduVcIiu8UID5F1QOWUONvukwiQPUgMPOX3yw/UN97mIKv/iFuPMYTs+tmW8VozraubPdBjRMHhXcs4IKV1xeYdWLV/g1/e6tNILgSIpjrS22efszdqTloPpEuqape0lLfOPJt6JT8TN8SzvWVzfabdd+yObq+y9V5cn3R6a6EGFgeMBHmx197W5QFCouLsZRze8UsX9ELh0My0K8NaJNhPB3SWWVfPLlhUBOKR71wHdW6Mecwj04pC90anC7as5ia5RwHhoetBPdxzXf2H8W/CElxltTVVE8JZmGgqjQHER9Ua0VdbTZcHeBOQj1CUYRJZLlA20tNtzfe1Y54gH5qikcG5Ex9sNnJpiDGNYhWa/+0f9sS//N/2SN190S+Wf9CqF904cqlLbmGdG8uLfTHtnaZl/+wGKbV3/maOGZKFQIaiYSL8bKgyjzpRJa4Hda92mNvFZdxHzAkYe+aT37d9qaL/3HKGLe69Hvfd0GTx2zK77wO3nf54tk7oH6emcaX5s/uTmMgIeSwEYDjrQDlTg7uAEnccWmKzRZKlwqWoPXeVp0TvN0qmgXfNs/qO/H7+mwVw502qffMccaqtlglweM6MOBd7TxTOHOg8XbpHdg1P63fz1gX3zPItu0MvnW+1QVhHMJvEI7TxD6xYN7/v6/2sIP3GP1V290o6DQ5Pig3Cq7/vqPbdmnPm+1q9dPAPXCX7HwggUfrGDq6R+x7//0tP3lj47a//0zV9jtaxuc50mTW53W7iH74wcO2ufvWGDrlhQ2ys5XokEWm2gi2nkgH8l44T9BQoPlFmQMQVf/sD36WpsdaR20kiNPFB5BDOvTjVv/z9+wZZ/9FWu+4bbzlW/G3hfqTD0q+LO7Ou3Hr7bZb9292BY0zrAFIILBWG/3Za6HvvtVKYhdduVX/o8J2/Tgt/7O+k8dtzW/9nsTpsv38lIK6kLCI185ZyquEE9PBz4K4tndnfbq/m6fC2qqGRMOOUBnA3cOivHHbvXR3/qH3fbrdy2ym1bXTmsOYhzoeW76Thyx3X/1x7bo7k9bwzU3uu+8UBsPaMS188//0JZ/7les7sprzwP5wl6n6dzVN2LffbHF/vzhI/Zf/u0qe/fVZ7s605BbOgftD791wH7lvQvt2uXnP848nTfu07inawR09A7bw6+22pHT+ibPsQkUxIi+Gf3Gf/tPtuRjP2sN6zZFWWb9WqiyfeoQW/Z12U92dNgX3rPQmmsnNzk62QKDN1MQZscffcB6Du21VZ//yoSkO/aj+6y/5YSt+JlfmzBdvpdB66lal/lgTibuUuKd6REELoxXD3bbtkPd9smb5lhdZf4RRKH+NBl6XWga+ugfSdj97G3z7Jql1RdFQQy0nrL9X/sf8q9/xOrWXqOlzYVXTw3JLbnvn//SlUnNirUXWr0J06fp3Cs6YMh+7ZmT9rsfXWo3rCp8hlRHz7D9hRTJZ26Za2sWVk2Io9DLNO7pKggM8ae2d9jx9gEb2vdo4RHEqI4waNuz3WoXLrGy2vpCZZvx+EKVZQ6iW0O39p4hW9BQbmWah5jJAN5MQWiLgfz6I3JJVC5YPCF58WOOagURy+YuNAStMwVxoZQ7kx4vAb5rhBHGUqH9KIX60xlIM3fHJzAPtPS7+7day58LWfIzh1HeEvEgbqbyhmZfvYYbpRBe5ir6Th6x8qZ5Pg8xk+VI05m2QU4dbR2w5XMrra6q0ASRjr/QvOqRtgGbV1c26SXjueVO456ugmAOolOjCEaoj/7gOxMoCAnMPu1Yraiq1ATXzFrruRVMPxeqLG41Fcl9kvjLcafNZABvpiBEX441wF2pj9VMFCabLh+MoHWmIPJRZ/JxdObErVy4PxTqT5PHMvmU9FHK5P1TXvdCgnryECeRcmxeywWjiIGMKIhXL+HbIha4aC5rJkOazjQKypLJ3lKh4YNOhQLldZopzQTJCmX3+DTu6SoIykM7AvPe7ItyZ+gOQTIFcYYes3kXtM4UxGxSOYE9k8LjQkr7dmtjDhREfpzvwLwLoeFk085WG0/6uO/paqXJVpR0l5KxxpfHzfTwZAICRH1hrIsdgrFYucVSyPTBd7Q5loSbZOMFy7WESBFxnjrJ4/mSV/E2SZekcQtL5lWVRqdeBnUsMkL28+MdwwlgBzcGMx7BrXAGb/LMX1JSz1otzY26YzGN482BdwZK4KCAAIpnoKaKMfY6iT2TFvconxfls6EIEvhs/IRSkJ8FLh4cUQLKh3RpREm0p+QPSccvZ/DyCmueuqKMwZm/jcmdAsRj3uAYzy6u0o2hH7tL0kBU3NQcB87OXMrgONzil2lNvT1ncvVHxUw3gAVas2qLY1gQ2l6is9osaAQ23sazpzxTv+RxvIKUlBDR3I/HKXJIe3Lq6+u9rrQxR36cCZGLHKl7f4xnvTlzO541aOOv+KM8gZc7RijQt0xtDM1p4/G0aVzjENM3CcKz8I7Bv//++wu7mADBkbsze35MumCF7+NME1K4wDir9IXzTfcNHYglrqEQE6aeLtTz50/jvVg4o1TQms9Efv1fvqHPPh53zkNZ8aF4ysVvGLqwvHSMERE6UWYvr56BAy+y38HjEr6z0rJSh1WsYf3w0LCE45CvFd9w7bX6nOUttmXLy/bU08+oOBJiwssqMserzjWkdeucmwRuAnCBX6o4hA4ft6ETIoAJPCehyM/iSfImim5Qa9QpwxKdM/PZT99je/fts3u/9R0lT4Qnh5QxkUzbU1+C84KnEGzhIT9x1JWO6C4e0YR6ec9Wx+I9eIHD5z75EBDp6Uf//nd+W1+AO2IPfu/7/slO0vFBnQEJE2gKXupI52eZ7qjcFJQveBK3Bf/8Y0NKlQh70iQ9Ojm/DPzFqsuA4+XTnx+++0P6GtsCu+++++2ovhMNPBQGbZzQNGlnb2OVAxyUP93G7HOgPQhe//E+ST3VRoLFXgvKNKQ25vsWmzZttDvf/S5BM33XoS/J26WvznW1WJ987qXF9aaSKK++QaB296XJnmp6f0pV/2Ydhf6yPkj0w4d/7AoZWlJueJh6q4JO36ij86fe80x7siT1TIC+COKEXvEOGoV8BGap6vCVf/dlO3jokD3+5JN2Ql/Voy2hMTxKen6K8GenmfLRnqQZRLCP8d4Z3OIp398hHoTPCF6WBDcw+ODS++680z/m9L2HfmDH9LU/4Hg/Ur1BSTovg0pE+9LW4CTQZmedaaYMZdrPUadvjBdJw47SKfMFPtYB4GB4r1y+hDMY58Qcq1y6AWYQRV5QgZcrv0I0yZt5GpHgImBxBMOMM9I04E4mK7hhDj4V+Wd/+f9aiz5NCfNWlomZdKjeiDYTiZXEwOY8gGCGyWAuF3oS/jA3who4dL4hOleKycuUBsFBBxqSkB3Q6jhoe4OOFP7A++5SR3rKnnjqaS8um7KLRsWsvgCBjVYjrkzA61wu3KFgoBGbxRDcTkG9o0wevAPpAzPsaZGwQDgg/KHvihXL7Rd//uds+46d9s//8q+eXNXV0RDF1jXQow5fpbormk7i68oT/z6wEWQuSOjIwgd+YA5pUymCnMB7Fxp6pJ496kMoLmD9wf/+e7Zfn/T8xje/ZR2dnarriEYzlfpedJs6ZK0NjyI8EnzAoIMjYKBvCDDqHbzCNQICvFxCOXgX4462QFB/+p5P6hOmy+wv/sdf2amWFodZWa621Kat0ZKypI0lD+nntJO38VhbUocoP8oZGtDW423sdEr2DpEfJYLVzqFvt7zjJrv7gx9QudhoS03MWvbtssOvPWXFa3s1uf5exTQ4vZIvz2GcJZREyCfCl5rlBEVAByiezHecnQIBjtJ6fvML9t0Hv++HfyIU3UhQ+cvKMDoSuN6uwlVCvVR2eAW6Jq15Bi8YaANomryU4BWt4G+eS4QPWv3e7/4vbnz88MeP2pGjx7ztUPwodyz9Mk1KeGnFP9CEfMG3KPWQB2cwax5DdIUX4DfyUndvK/hbMKtlZHzsox+2pYuX2Fe/9nU7cbLF0zte9Q+Cb8QVXeBXYHFOlBtUggVdQvmT1nlJBsSihfPOryAoDA0F4IsRIBAEoxIELJ2LES4V3qgbHRoaX0xag5vOjCHQ26erysDO5N5DO+zIgaeteNVynbW0QXFlbuHhmoEfPPgl1XkjPnk79jfpBEnSsXx6gxCqlOCCaTlBt7sn2dXZe3S/te141lpX6lvKNfqUpU6opHPU6OAw8owH4RqHlhdvkjLwcqUkCAU6eaO+8Uxn7OzSrnEFzqXp2PyQnVoxrBM4b9NEZp23RWNDo+fxRPxJ4x179ndJNcduJTj4N5aWVwTatrGhzq1T6ktnH9Jqsc6tT9qRkZ22aO0HbHiwXvlK3AWGu2C8lmOVTS5jDwlYerMH+Jf6RRkdr/4gSGpr9YlTtSunI6CwEO49B97QiPEFK9W3pxuq1ikfKwP1FTS5/cbbeAwHKBCGjgocZ4Wk8rnvGMVUarNrTU2VhKBOEh1b6LL1UKtt3rXdPjX3CRuZ/0kbsibnecrPD9xcE4MiGXm5UEM4jtWP5+IyCTZp8oaqehfuUSQUQWK0mL7U12nHTp627kFGC9rIphVD0BQ6LWxUmcbgRV4hdvqd/cxTUiYUR7/6SInkIXSlnFjafdpsijHCaK25scFHAqdb261VS1gZZWIYDY1IOcjwadTpA6zwohxJG/nfPHjH6Cwc8Ap9k3IzSqF+9J1BKSugoFwb6sVbiu/r1+qpUzrVVYYGo2tsF5QIZ6bVV2kgQJ0JSbON3acfkijyPPHEY5evgqCyMESmIJIGm42/MDgKwq0bMTwdAabavXuH7dj2HVu/TmctNb5XzF3l7eAWnfJER3UrBsGBhSuG0qvxAB+OFCUWS0WpdvHqXzrEERnkYYRB2LfvoL5T/LRdveINq5v3KRu2eS48sMwc5xgfozTAjaAgnnpQdgJ4R6VLRnS8eFWZjlRQ2dIBQami6j0dJ8F7QkLk6ScetzXLXrC5Sz6l/EscUKVcXgnA5AK+BG/iQjqDm/eqoQTAwHC/4+XcqNwwouMWgIcSIH13T5+9uPknNtj9Pdtw/edsaHSR6lLiQhphkNRK6VVgBBB5KEMSxurs8DQCHR30Y6WxDHMDR0wgEZLViLTxsO3avs327njQrrx6oVXW3yEhVCGlXZUIa6WGRpQ16OxCOU8bD6uNEeaF2lggVCcs5aRcPVLMXfoWQflot5VV1MnqrnQBCPOAK3FRJoqN72uXSrlQFNwvXCvkCvR2132+kFYQjC6lE8Tjyeh8SG0PfYAD/0FPLHiMUWDiGqMM7koVg4SRipsUGPB/qdKnA3w91hIOL9qYOvfKAEAxMiLz+im/u4lkyePGZSQGXtqDQpE2RmbgpmykoUzj7UrhFSi7I/YH3QKDCPE7Cos+BY8D2+effHTEiLw8wafU4GZETr3ARz2ZvwEffep7Dz4wOQVBBn4XI1AwKsUPImQKYvaoHgqCK8LD/fq6P9nRZa2n99lSbX8prlomr4f81WI8Op8HtcsYnzojJQoCYQ2fxxsJYf3jEcs0HQ+cYGiYGCFAaOnq1Q7OFltZcdBKatdIUGvEwr8xkPADZR2HpfhEWESaJOFokXhICqK8RP7tlIIYFx7CBRwsW0KnDs3ZdbLdlpfttMraK3SuD5Z8goUaK2lSt8DPO/0ITjvhcAtbcUMS1NS3RErg7CBLUGv2SYdigmaMnvafbrfy3h02t3m58DZ6fOQbr+8YPlwnodRCqHk5Ha/cWGpDXCW5gclTxFi6jY+1dVpn215bUq/yqI01VvdKJtVS3cYq7c/UX+VWpNcXnNCVq3qqX89pY+VHGYf4RMkTsMIHJTipC0KvRPGjCVKHQ71wjXjdsfildPnn7aUyoGi8zg7t3D+kQ7EQEp97MmldrHxwjo+y9M7bzduCulL1ZM4F5eD4xupKOsl6jQbaRHt9e0HfduDsI4wU8ignqMaCDK4xVyavML6cx3gQDniV42a4xzWFYeb1JE4BmsKjBPDiPG3v7dBfCXa5e2vKalwZn8GbpCU9gj2pU4lcRrhTxQfCR1wi8JNjPsLII4+Qu0KibXGtUT8UMWXkLKyH5J477xwEhckUhJNzVv9cChcTzAMTO2O5gkiYfUCCjE8+lohhqnSwGVYYViKdB6sMnqATw2wDsgixdJhkpPNGBzwfsRgm01Ng8XA/MFnb1d0l5TGgYTPHDiTWMnARcggUzrtB2GDtESo0rKcck8WbGB5JBwy8g6oTnzEdGtSZRWU6l0rwUFp+vo0sPYQatPAOLqFHKJOPHevO75V+MoZMWkEgDIZEwy7tNert6VLd5MaTr95pOlZHaOTCwa0+CU4JPkY1bkDJvYAbqkI/OnqEM3dJDPQd9hNvERQSri40zHpkZba1dwgvfnThljsIXsCKpFFG5b7BTeRGg8rpLj4Bp86UEbzQY6KQtDFySiMg4SAgyHBzEaiLKx7KL14kINR75IJj7iQWFoAPxVHpcxlJOngwEZSezf/wDC9TRq78MEBwJ7piGYNPecDHogiv1xkQ59yBjaPqf7zzMRfg6xdcbQ3FdVZTVe10IIPTXLiBS39wuog21CNkJyNzcDFCgnZRnnMQpiIY8Tyz/3k/AbapqtE2zFnnfIly8fqPpYWGTDJ7P5ZiAC90hOaJEkoS0p60c0K7FCLdJvTSwiQpuF4ds3S874Q9/+gzmYIIMkEgOh6MSJhMh4+8M3G91AoCZooOh0ChPCKJ+zz9oLexSkInhttunalT9PT2uA+U1wg9mF/RBUN04qA1z+PCQ3gHhNetY4SQBEKUCYAopW7cExLOPuksK47JSMpShethAsRpvElnSFYvAbdvYMjaO7u9k/Dsq7jGRhc8q/voxNA+LyeKiY4LPgRRlcpIxysUovzgjIlyBB6Cl/q0dnQ7rcEJz/kGxTH6YdWVaNIeIU4dWQlUW1sj+iRfxZvoK4RBCmWTgkuMAOicWLHyz3fLCOhK/NooWdoujGHQlxWFUixKyqc0iZWpNpbwLtTE6fqGAiUu2hgjgDkvgrez8PoHpEQL2g/XCKuIcOWwRBZmQuiCkIn+np5u76esOuMX+IDHfbofU/dhwR8cSvo0MBgdpAP0oC2UNW/wdpNFfrKjxd18zfrwDjuysW9QCKXAdBiJtwNB7TTWCHJgArwYW9A8Xf50AVBMGAQnWk963WtlqNXA92OGUZnyo3BI531XV8pK4tNtHRpzJLTEqEri/ZVeo9zLvN9EpWkHjCHMNQxAeA1X6eM/ejhTECKbhzRjEfF2UxDUF8aGDjAIjJL0pcRSEz+eE0jLD2b3AH8qwHDceocXzAh0hujECA/S8Ry05hmhmQTSJjAiP1fwnRPG0FPmpDy4cdT5xhKm8YZi4lXgBSdHyStzkkOIXdkIADCS3xm8dCQXNLxQtNcXOihf2hUbeAFKudIKwoWIFAATmOCPtNTZYQdeucucEMrvdUsSOF6esRB58NEB5RkLwCeQJkaJ422sePI5Xmo3ni+54W+gCRg8BwXGk/MyJ0Q9wBuWPHGhIBitIbD12o8HwXOdhkfa8XoKdjxDc+I7uyX8hqCQXCIa7VVoRZLPFaXSRhtDGo2DfDREHEhRKml65hTfH13gp144X0pYUxaMgZ7efk1465htWfINmvwlnh8hDL1RWfKcTcWSON6EcvYHlYP654Y0HN5R51Cy8COKs1sr+3Bv1VezTDjBC1185ZWuuBF7NFHtc3zQWGUsZTu3ENM/fC6H8jpyURH+0kgdfikbM3Sc1iLeA/fflykIp5P+QORgLOJCeMT72b4GY2FdRueebZzUOVd4oBy65JPv6k3W5lMGOjGHwUWAucjrHc15TwJKHYI4rEwsXYbUdFwEF9ZgDOXpBKTLpyC6+wfdsqXzJ/2nyI+xdlEnpAlTJx3HH/QCvC4uKLfcNcMSPoxicAFheYfADrz52rhPVllbV2Jle91Uv9pKrShDyQTSqDzXYgQyCshLpvr2qIPiiy/2kQV1DRdCCA6y5bYxyqFN8y5DCEy9B1elBB5Cz9F6RxYt/CUJ9H+sztBwWOXuYX+B3mNtwze4+xAmgZd0uW1MWWhnnxAdr+C5FeVVOpZyRDmBMdZIfht/PI/+RBtzpSyhILrFW21d/VJQKrO+gZB8cCoZzUWZIQR4gQVO5pMIxPWJ1sh6zY1bmVZcJQsWknYgv9NlzBOAgugf0TuN/rBhaDO+m+1wBctdeNAB4KkAz7iBoDjeATNxl6lcAsQqNOhXzShGo6kIpMMI8HqoLdp7tHCgJBHo4wpCid2gEAFy8Xr7KV8E3vseG6WEt3D99mk0Rb9ik+l4GYU32hgFQd/V9LbThlVW3gcEDCUS7j1lERHlcpIC8WXoog2jcWjMO1ZOfee+TEFEW5zFWES+XRUEVmWr3C09Pcm+AbpIuZRWaYm4RpwTygsGYoiNa6RMH4eBgUnLKo6ubgk9WU/lYtYSMSguiQoJ7BAWXPMpiA51PFwuvvxQ0ICPwAQvnRrc4xaVGLqyutInZuFqhF1HZ5vwMuzXTytyKlQulAUhV3gQF23cJYsQFxOdHlwotHJNjoKfydQQXMmoSvMy1cmGPuIxwDp7WuUakwDSbGax11XLRXF/jOEFFyFXQQzIIjyl5ZDAxaKng6LUigU06AwOXA1cfc5B9A4ZMqCPvnRpJVSxhCAKqbxCtFZ9EQhRZmgdwmN8BDEWF6t7ijSZj7BgTgSpxQe5+JBNuSxP6IALiPL0DWhKWu9ZrqnLuDDxyukPopYPeVGHaONo81AQ/QO9ErDiLbk6mNdRtTwfrpCkzEAWDuohnOQfF+F6xcQ+ARWCdUx+6EwgP+nDCEBB9A4LxmC38zD7BdJ0IR3pI8R9rpFG/Bm+Y2URCitpIxRUlICy4MN3wa2yt3b2u4Kok1sw2hNcUT7uI4CDdnNhHpG6ItQJUTfvd0JEGcdeOC2YowNGkVbPseiiSC4i8AbdeQcfdI0t7YY2lIll30Wa/6qpYpkzdVHNlJbVTd/5TqYgnCBBlHTDhfAYTzDLN7nCY5bROfhgGq5p4YGgwLqlE8KYflKoD0VTpRrrV7yPTkenwTryzXKCSUdxSzqVZpzR87iYwJus7U46RCJAkCAJssgbpUjjdqbm62KScQgM1otHuSIdafK1ceJiGnNPKbdPSKvMLv0DGdc8dUZ4MWczzIobJWGCOz1aijKQPbeNUUjQapj66T+C2ecCAhGZKEeq/mfgURfNh9BOKCbv7CgGMiWdn2u+No54rklIMoUgpt2TyurqtyjoRPhCgtRbzx5xASspciJUwU/eEFS9UjI9OoUW5VujEQR1PicofZ5YJ8PJNo0gUGRKgRKu0oa/Su2JoLxRxmhjhGDfmIKokmLFmImQywsRz3VCBYHgb+90pUmfqdHX4sBLnSlFsoqJB6XTHE9tpeZSMBZIoDAR3lwFQdpQTOTt1EKK1tbTqneVVWtPEnxXpFVVlSpDaVHiQgsFUVo0ZHVKE4oJWCgbRj/Qh0CZtObOGmsFQ8ZUBNIysX///d/NXExpogRjEfd2VhDtPQNu/bDJp0YM3lzHRCyW/Bi14HXdw/PsN0CwJOyvaOXpkoWI4GO1BZ0Y3yZClxCdON8Iokub9U62Jy6TMs3+NdeymU7W7ZgEcrRjeIVZVm4yISh+9mW47VqeS5mFxSdzsWTjGOzAm6+NmaQ+2d7r8xDgmFtfrslnrOqolYowhpeYoRF1TKxf3csG8xETli2jACaRGba7cqMkKRi5CgLhfqq9Rz5jrD/TJqpyq9fO6nQe6kIokoJmcjoIDfYBlRsXEzVm5IAATEYgZ/DS2XNHEA5wlv+EcONKfUJBdIq32jqTYzcQnpK3HryW+pPQOaGtj0zlzotK407s6mXOJjE+RqQYq7TprKo8aHTuCGJAo6tRnQpQKfqk+zTlghe45gZ4PQQr7yIt98xPdPcxooMtkzmJmAvgmlYQHbLka1Q+X601xgfAwojilxvAmTuCoJ+Qh5Hs6ZOHbceOXVI4Gh3X1NuQRgQVNXNs7uKlmgsRNKXDxdTdh4tpWMpL+4DGCAwMRgV9WmKcjIASHhnSSK5eI2LmUyKQFp757nczBRE0GWeCaLg0M40nmsWbXOExi6jGQQcjcKW+MBNWLXMQpzq0ckRCGMuiRvMPw3Q0YvQe4c0Ha5j7wlcvlvd/WLI6u8FOd7N1n3kJlsMW2Rydu1MtSw88IajzKQgY+0SHhIcEQLlcSwg73EQgxuWBa2MAuEKTxovVzb4DygxeJfWOVicBVKdJRDpO4M2nIFgZckKKiclTjhnB+quWu6ZEiDgXv1xxXBFD4C2WA5z1/8XCCe5unZ/fKasY3NWiFQqxkU+AKn1a2Oe2Me6CVvnjOyQ0yYNLp1J4VVz/+eS/7rGYeYcwHNKqJmCimGiDDn13oE/zHxWiL2WZW4drBosW7MC5vBREryZQ28QftCW8pOp5WRGu0A+ioQAq5G6rluAv9WVCiSLmHSuaEj6idskcESNVrH6EN++ijeGDQfGjDWv5Mi44jI2xQDr6OtcICVyE/hkXHe8CJjTl1yEFAU6ywqeVahs9el362aSmukhSiy80X6DRTa6CCNyBN3DkUxChxEZliLW0HLA9uw55XZvnzNFRGEt9ot73WshYAq5PUstwKBaf1MilllYQKAaWicN3BMqsxbfq31KeuQpCo437MwXhdPI/wQSZgtAks/yoWBveUUSdxBefKAd6RZxJA4Pht0yWPepBgU7P98Pp5AgqnsOXHR0MWudTEH1iyl51MFw0SQcUrjELiHaJ1VLJmvKkI1ekXEk9wosiQYHIOBdezZHol8YbwoOyhsDoF94+dRzsVmoROEmD/538KrILFOZHmOx0hQoBFFAe/RLWBL1S2WXRS6lQB/JGyFUQCH7mP4oArkC9SU98lAP81BdDm3ZgcjJgsiII3IxcoDVQUCLgjTpA68tpBMFIC1dHMr+QzG2oQi5dKSsV97ZXXZJdxaqLiJr4+s327HxDyaWcNZqqqGlU3eTn156E+fqwGXVO92MUxMCIhP1In4+wAoZAe4Cnor9HHNdx/34qEr4hgKNHS62hNQsDwp3oL/XnzCR1ieamBtzFlCxHjhQJH+XDC+xot0gdCoI2Z7ky/ZJRefBupIs2jklqFBPLWYNXKC9LtNnjkB5BjBRzKJ+WWEshR3CeuRAFkeuTC0CzcY0GhjBULpcQs4ETmIE3Gu5i4Y365AqPiJ/NqzM3vcy1AAAw4ElEQVSCBCNXF3hiUAQ6k6dY077WWtI2OmyUhXYhT4SkfzMMllWmfB2dHb6ahw7JMJz0pGFlUXTifAoCvP36IYSxKN0SCyS6IjQJgZmRC8Hh6+3pltPu1kpOBk2sQIR1aQpvPgUxKF4DN1VKu8McOPDHbs7g1Z0iiUelsMmOuicrWpLUg/IP19QkZ0kFnNw2xsU04HMxjI5ww52xRBMo/E2sbAoHfugYoV/KpU+z4+zJiDah/Zjwxd0UcSE8oo0j/2xeoUe4RyhHuJi6ZH23a8UYwlvV9ZEWI7TxRlWh4BFvU9VVYMbrDMwtzz6hlW7dduj112ze0mWu2Fevv8bWX7PJDRrSRBszIOnXHIQN9riwpP7AjRDCN565kt9HI6l0AdPLJHD9vSekWDQKknHiLiGl7R+QW7FEnxaVQnchr9Eco0NGnLi30oI/Fy/wCcBKpyMOGhIozvBQhxRiV7KYQbgJ/UNsIpTLSSMA4IzPQWgVEy4mL5/SgYFFCV1dXf5AXZyjdIXvhjUarpFbtVwjdvo7ZbzvQlYxpQlLwWYrUMnQ7FxziRbliOtMlSOYAHjgBX4Ql7jAF1fiZiqAO1Yr5IMZNJgN3OB1xlJ9CQgYLB/cHhUaOrPeGouZAH46xXgX0w2L9ZiH8M1OWNuDOqrj6CE7fvygziTS9x60qqJCQ9258xdaI596RGkIR3QSYNIhYVb3T3drVY4wcLgYE5gwNvj8ZFYkSgRFDqqTkg945bKE9sm6ZJVMb1ur1c1dqJVFvTZnwUJbuGi5d7zAGyDCUuR8oFb5xRl9NAovJ24SSE+aRNG5qnMacO4RdOKfxIKdPnHCWuQf1njJejp7rLqe7z4M2boNNzte6ggsaI0AgAbEoZiOnda6fum5Bh2kNm7FqW50WqeL8pGWICprdJH4zaFRn1aknDh2UH7lHvV+zYGIctV1tbZk+WqttDozQRlt7G03BssBzuKffLSmLbvEV6zugX4UhVVSFbJ2g0Zc2cVeU4n1qzqLt5KJe/GaFOozTz7uk7PHd++0hjkLtEppyNZcs97Wr99wFm9RNVwpveJHNjnCSUwoQ9PAFTyYS4bobxFPXRDU5JPclxXeqd3vcltJ8OM+oqAlHCcjf35slINr27Sar1g8WldbO64ggRXyLQ2fe/DyS4eQCxhLg6oHAh5+5IA+YJXoCA6UAnN/itB94toaUj/AcKiWkiCQlk2K3V3iFdGVZ444wfXmgbqpcsxl4TZzBfGd831ylBMExagUMjRZAm32/zKMwvKJzUU0TgRvqNRzxM/EFbzUNY46vxh4YRiGq1wZvubSGqYOoTITdQwYQUfgY92GIIE5+BEY3sf5P6T3DjYGAJ9vYvHQ9RXEdMBoP33K2rTaYlRWdJk6UIVcAHU6GbVG3zZPwwpaU18YFqsbJlZfVoBhgem3wot1xUR5IjAd7xmW8HSnjh3WpK0mfWXRV7IvQHnqG5ussXGuOs4ZoR+0pqzQnCWCWPLA1n/hTQBTJurrCoIXCqwZP4v1FN/Z3mYdUkr9mgDsF/5qCYRy8dGiJSu805Ev2ph7+JpnhD0+YUlLkCZ1JYFu0wrCo4LWwifKqJwjfkRHu45qZ+JxUEeUUN8aKac5UsZl2kQW7csV5UCb5vIWsGcrgDe3jZlnYFOiU1N/fCSh+kb1oTykRmnQZNBovD2U+MiBfV432qZcfKWPUjuP1dc3nUmnd7QxdHZ3EAAV4BnnX5ApuJAce+cRY38Snk7HJO3n5VBWXH60H5Y2cUCnvQjgBW7IruChNMxCeIEVdXVg+kPaCChV2pA0KE2MMngz6sSVjXBMlHPFqEornITX1dccILg4ZkX8HAhSV3D94KGHCq9iomAIDbQkgPldrAATM0SmDEGQ2cYduGIYGgLyYuBFUAVjgTfNFIE/l3EifrrXoHVuG6fLUAh3vnjysdoG/7FunZlJx/yBW4K6JwRe7oPWaZzEnxPIK6D58JLWaed4xavg1A+cCHUC8EkTyx2pM3HnwwscTwNMh3T2H4cjWHRYJXTcCIQ464m86TYex0tXTXrr2QDzPOWrcwJHdZDgTMonIThW33T6oDVpyHOxArSmPxHG25iHydRZhIbWqJKgOvfJ5rbkHW1M4BKGB3WkvmFhO0/QJmMhTZeIu9Cr0zqdiQKk2phX4E3TekbwAni8Lgl1Am7QmrIFrUke77kn5JY9932SKvn7HUYQ8p+OonlyA4BgaiyPixnASwNfCrwQdjYs9YnoN5n6RqNO1JgT4Sj0LnCHBVIo3UzHB95L0cbw1tulvrRb0PpS1Jn+lE+2UK6Z5mVgEqgveIO3eL4YIegcCvFi4Y26pWXmTOH2Za6nTp0axXrNF0A0Ww2ZD1/EZXiDEskVS4TRXKF2Ojv1hT1ltL4wek019aWiM+W9VLjz4UWQIVMKKY6p0jedLx/e9PvZur9UeKnPbOD2EQQKolY+07SPbLYImMGdGgUYyXVr5UZdXfKls0uhtKdW8ixXRoGzKRDLQLHwMz4+mzaX29O3v/1tK8oUxOXWLOeWJxREfT2TvMlk2LmpspiMApc/BTIFcfm3UZRwQgXBkIUVAPjU0PbJhNiZSS7exzAxbQlwzztCOj6QZtcLp8D5FAT0Jg1tRFuFEsEXG+1GW0V8ugTTaaNYJQJOJn5jxQTx/BiZ5gbKCs7p4A2Y1A08wAJu+J6pJ7/AMZM4A3d2nRoFJqsgaEt4Or2fI42RNs3Hz+k0k7kHDjxEucAV/SR4KmAED8Vz+hp8lo4rdA/P4mYLeFxj3oJ31JsyTAQzTZuZoEGhsk6oIGicJ554wq655hqbP3++uzgAdOTIEWtoaPAKIACoFCsGSE/FiUOxUMlYLVKoAFn85CgAbXExFRpB8J520WjQrr76aqc9bcG8xeHDh739aJcQ4FzJQxvBnBMx40QlBPauXbu8ndeuXetLGoG5f/9+O336tF1//fXe+VjqCFPDK3QImJq4qeKlTMBhKfKrr75qy5cv9y/gUSfmaXDFhXKifnT+MHQmqk/2bvYpMFkFQdu+8cYbtnHjRi8UQhz+QaYAg/anrafDQwCmn+zdu9f3FwB7xYoVzqs1OuiOd/QVcIE/LYwximKVJ/eTLQdwDh48aG1anrx06VLtFzpuV111leOij9CPly1b5oYeeMFPvcGFnKVMyIKjR48afY734J+NUFBBUIlDhw55R0cZUEAKRqdDKCxevNg7J/F0SghLg1JYOmLE3XDDDWcRdTYq8XaACT0nUhDQfuvWrS6U16xZ48xDW5EPhrviiiu8bbinfZqamuyENnfBWLfddpsriqnQkY712muveX6MiNbWVscDXhQFDA2PENjgQxoUB3V5//vf73wz2Y6VWz74ER6FH+lIdF7qHHTauXOnP9PZKOc73/lO7YdozAWTPV9kCkxWQcAvmzdvtve85z06g6jFXn75ZecXhOru3budnz72sY9NWzgilOk7COCVK1favn37nJeQZZSBON698sor3o/4FC/9h3rwHkWCEoPXJxPIh+Jj9z38evLkSYeBUY2spQ/RX7miRLiHz4FPmVAozc3NrsToOxjws8XXBRUEAufFF1/0Tk5HpKCbNm3y+lNYCkQF6PxLlixxKw5CQjg6I/FUCAWBoMjC9ChwPgXR2dnp7YWQJC0MtGjRIheWMPzChQu9vbCsgzFRFAjrW2+9dcptxEiB9oZxKQNtDlzKQcehM8ybN08nUO7wMlGu7du3Oz7wkmY6CmLbtm1eH+oBH6IM4Et4lg69YMECN2bofOvXr590J55ea2W5J6LAhSiIZ5991m655Ra3uMmHXGLkiQGLoLz77rtdaUyE73zv4BWENDwETIwmRqTE8UNAh8GMYYw8g49RKhjG8Pt111036RWG1IP+QD3AR3+kD+AdINCXkKXwNvekC+WFhwDDDqWAkmEEhXKKvOer64W+L6ggYggDQY4dO+YEQknQAakgPwiFMKKCCAEKS4fHSkVY8MzQiUpOVQhcaIXequnPpyAQgAw5sUBgIKwiGB8BeeDAAW8fGJl3CG8YnI6ABcSIg7ipBHiDEQR4gYmlB7PSceAP4COw586d68+kY3gNT+AK4zrVQB2xJOfoVEusOoQHHRvehSfBDXx4mA6GkpytofhU6/B2zIfsQB7QFhPJBdoTJQ9vYngif7iHp+F1fh/84AdnREEgsxiJYviCA2WBgQUfwU+MfOlj4MZApi+F9Y/sY1QzWUOYvoxioJ/QN1BCwAI+OOmjGDvUF4OLNFyJBxe8DE8TT1mRs5RrNkJBBcGQnVEABeDKj8aMBuV9biAtgbQE0hIXeTwy+zMlCpxPQUR7BXCeg+6596SJd9FGke9Cr7Q1gjrgpWFzn+aTdBreTUc5BOzgtXjOx4OBl2vckz4Ll4YCk1UQtG26faO0CMjXX3/dFQOjwskK5sife4VH+YEL/gieTd+TJ3iH9+l33F+InAt85Is6cs+PEPD9YexPukzpeO4Df278TDwXVBAzATyDMXMUQEFgJTPcDCE4c9DzQ4LxGAlcLHz5S5HFvtUogEWOUTFVwc7IGMGK0MSSD8FaiE68Z7SCQXK+tIVgvF3jXUFoiJNtlLvMOQAFgauIYfDFYnIUw8033+yd8DInT1a8NxEFcEviGgxLeraLjmJgHgH3zHRHrbNd1ssNvh/3rQYbxTK9WILnciPCm6E8WFx79uzxiasYbs52uVEQ+Hjxf2Yho8BMUAAZg5HDiiQmfi8GLzNSYRIZv/5URy0zUfc3Gwz6/wMPPJDspM4UxOXdfAypmcQiXIxOBR46M8ohs7qgRhZmggLwFJPPjIgvVkDQ4YpCOWRG8OSpDt38LCb5tkens9wwH8oQYukGIW5Ec9vikbHje2OiO5mcIb5Q4POVyu55+UIYgWcgRD6eeZfGOUI+peFjGxOAB9xZwT8GkwMP+MQT+LzjhQTKz48P4Pi/C8vuPlssrsyavxCqZ2kvRwqEcsgE9uXYOmeX6d57702O+w4FgRAPAZu+j2zpONLxnI6Le4QZDIAWioBobekc0sfgtYtWnxjkoyH+zWIJTj63GBIc2UnacRmqm0On+vWFKb6hVaTvpyYfuOjSR+L59jEfhx9WOXr6R6ypRh/ISAnvkx36mlOVvpksfEQDFxkfOPSYuk+w8m5AHwRp7RrSB+A5tiJJRb6jrf02R3HAS2L94nDjOYFydnxLpza6qbzz6susSvXnQyMXEnAxZQriQiiWpb1cKQAfIzsmqyCQKbkhZFRuPCNtQlru5KbJfQ74+WBO5l3AS+efKF+k5zpROt7xC7jp+3QccOKZ+0IhcPGe9OnndJ6IJ803v/nNREEwBGOVDG4M1hwjkHhmjXmsOiAN2p93rLsFAGvNec8qAQBzz1piNtmxBI0Gw33l64tLyu3FvVqbLtm4oLHcth7qtsW6Hmjpt43La9zCBiZCHsHeIMHP91xLlOHHW7UHo1krapQXBVCmuAp9nP3oaX0aU4J3cVO57TvZZ9curXEFVK5PRvb0D9u2wz1WX1lqS+eUW3NtmT5BOGoHpWyaavUdV5UXhbWwscy6pVzae/SREcGs1k86S8pgwJULwpy0c5S/Vx+ILyvlU4JD1qxyDvChepUJuErmyiopuz4dqHKeaB+0uVIKrx/p8TLvONprH9nU7Ioi3Sjnu88UxPkolL1/s1AgV0EgN+IXdeBZ3cn7HUepxAY19gbEngNcn6xoQmaEQmBugy/tXXfdxvE4ZFC4SYFLiCv3zz/3nG3QHAVyCqVFX+M9MNmYxj4D3vFMPD/gIfvYKMrmU+RhrJRCRh7UgpJmyU72/bjSIo9gU17gRHn4GiBffkPmRpmoD4G9ZMAiP7jYk4EcBReymPh92gTLfgrkNHAjL3VIP5MW3OwdYTDQqHLxOVb2dICbfRghY1hE0NPTbfPmzrPHHn88URAAhrgUIDZkxLEMuDUAygYnAvcrV670tBxnwFJIdtOySgBkKBY2f3CmCQqDdc/r1q2zxuZ59uwufX9XbXRMlnh1RYktbaqw/S19fj0uK5vPDBL30r4uu2pRtYSyPvcoQbvzRK/VKf2prkEJ8RIX0Asayu1Y24A+tF3sima3FES7BPe1S6utWVb+a1IOfRphYLXj3tm0otZOa1Rw4HS/C2vGACiaI4KBMJ8rXMelmPqkBK5ZUmNdUjDbJdhRWPPqy62zV2cbSSFUSEGgvMqUh/IsUXl3q3wol1VzK+35vZ22VMoM91aNynxI+EiP4qFMH72+2Sj7hYRovMzFdCFUy9JejhTIVRAIwcOHD2luos8/lVklgcwnM3v1PXGUATvvTxw/Yddpx3CnhCT7IEgzZ06zbzijn7HpslpyilU3a3Q+ESIWgVgvQdgjGXT1uqslhwZst84Nq2+o93dtbRjAzbb5+c22cdNG62jvsDoJWwzCYQlUhPsTTzxuN954k+NE8VRV6sw5wb36as5OGrZXfvpTmyu51yvDmjxsxuyWMD+kiXi+VT1HG0STOZcBycsmLy8bSpGfhJdeekmf5tXRGquv8I1xtbV1rox69dnalpbTrrBIj3w+JZm6QPCpz5C+w11WVu7ydVx5CX+laMCmVN8cqyub6UplvJeVlfo9ZRgcHLDBAZ2bJxjHjx23puYml+nQv7MzUUKUGZr++Mc/ThQE2uunqiw7UWNnLBoIbUIBKQQKAgVAo6EUKDRKBG24T5qMvFQcrYqm5x4FgeZjR/WceQvs1f3d7ip69WC3C0kE6V4Jdj4U3yJhWy4h2qT7do0K+O7rmgVVdlQCHAF7vGPAhXJbj0Y3svaXzKmQ0B6W1V5iCyVwserfONpjq+ZV+gfvXxEOhPk1S6rtkEYDKyS8qSf5+4dkVRQV2QIpj80S6OQH195Tfe5GWq17FAjKAwXB+53Hex0fH1lfLyXUImXTL4WxZkGlvby/y91mC6RIWnq0U7JtUGUocZib93R6mZqlgF450G13XdPo9XEOmeSfTEFMklBZssueArkKAoH/8stbJLx3+3fDkRvsyD8gOXL7Hbf7prhyCcMrr7zSlQVjgPkSyi0tp2Q9N7iMYQSwVKuUfvCDH9hC7UY+deqky6ijR4/ZmtWrXbkwGnjooe/bqlWr/JiKClnhTZJtCNE6CeZTgsfnWpdJjiGvsKoffvhhWy3hTZmRHYcPH7FNUlQoHORjUpdi+/GPfmTHjh+zDRuuk6E81w3mBQsW+nLeYSmUtvY2F9ws7123br2nQS6Sn4Blj6JEzjZJiCNfS0pLvAy8R+4uWbzEP537vQcf9FHEEeWZO3eOf24Wox54KEToh4Bv0zfSkcPIDo7j6Ozo9FHO0WNHXVb3dPd4+VC8fEudduAb1XGuFKMUX+YqwD7uYijH6ABBT2IIxzNDHSrCEIpMaGaO3ED4844RAwHNRSFpSArMcI33WL0MEUtKy+TX1yFuErCtEua4gdD+zEUca9fHxWWxI2BXSMBvO9RjS5oTK3v3iT67QnEoiisXVtmWA136sP2IrVusoZ9GE/j35zdorkBlaJfCYH4Dt9V8CX/CMbl5lsvFNChh3iBhv/d4n1xc2jijEQDKCZiMMGorNWyUYsLt1DswbCvnV1pv/4iVCx6jgw6NIKSkhbPYdh3rNZQIkw+NNSW2RzAh4lIprddVdlxowNsul9K6xVVirsQ1hhJEcTCPcSEhUxAXQq0s7eVMgUSonpmD4Hn37l1u9SJfGhsa/YiNRglFLPX9+/arvw9I8K2yw3KJIJMQ7F2SLQjcPgm39773vZJbK+wnP/mJH4uxb99et5IR8suWL5M3Y6Ufn3Hw4AEJzXaNFtpdJiFQX9dRMfN0lAYGb2VlhadDltXX1dtLW7a4POzu7rL+Pp0IXFHu3pCFCxe5gkBpINgfuP9+H33gRSmVwTygOGTe5s3PuwFdXS0Xuiz2igoZqRIiCGXKhgcGRYjlX6NREfAQ7i066oPRSJEaslzKAjfSaik6wn36iA+ymJfgw1vT3DzHRycNGh2xHP7nf/4XfIlqfX2du6c2XrfRejQqQUidlPJkNIXyQDDddvvtPrXAyOe0ZD6HWlI25PsDD9yfjCDQWPi5EOY0EgVFKEE0FABuIkYSjBaIQ/jj10IhAIh3MelE4ckLDH5oWn5F+qEQIuiVV5I4Jpjx8+OSQYEgzBHgJEEwI/Tx8+OWOiyXDc9Y9swHAId0Su4BIc6kNa4pYPIeWBCUe/Axr6ERo79PVhYlMACAwqI89WOT4QnUM3+pAmUhXzK3XqS5CI4l0RS6cAyp7LwjAKtcZYRm0IKyiQxJec6APO9dpiDOS6IswZuEArkKAjmCUIx4qoFMQaAmLhE+IzCoPqNjt/UufP3IpGeeeUZ9uVgH+r3TrWwMUmQUvn3kTU1NteSSFoZIrmHYIkwR4BWy1JFduJHAi+xql5UPPvoaygelATz6LrhIU6V85MXSJ55Avz4mq3xwUC4tCXLwIEMpJzKVvCStlHsKeK7gpPwoZ5/caMflPiMfdUYwAzdkL3PCITvYx8H9T55+2uc3muUaYmTFXAJwmSvBe4OL7MabbvK6ggNY465plbW9o922bd3m5b5KbiTmNKiD11vlZT6DsicjrocSBREF8xpnfy47CtB4MPJ4Q192JcwKlFFgchQIRRAG5eRynZuKPoGQBw4CG6H2VgshuFEM/M64tZLjQ3Lri+eHPIXkBO9QYLGnCsUE3NwQk9p+1IaI7Edt5EuYmzF7vjQUyBTEpaF7hnXmKTBTCmLmS5ZBzKXAN77xjWwEkUuUy/E5UxCXY6tkZZoKBTIFMRWqXZo8M6YgEGAMXxiF4Pci8MxQxecfGMboeVR+RSXSL5mTYMKG4KOXPEMdf6k/oyPDpHK/YsQ5PMUXyTdJII3fTwiHiYcEFsvWfFJA5SUfPsvxoHeU7XzwxtOf58brCT7wTFC+s8BAL/2YLGElxIB8nNXyUWYho8CbmQJTURDIEfpCyJZ0/b2PKGLS/Sqdeew+4I/LqjxpkHHgIA04J8IX8hD3F7ADPs/k5TcRrjzox6OATchHi/FEqRtwkSfwURbKHj9cTtwHPNKShvRn7aROwTzvbRAH5ADDp0XDM1nC/gcCkzPEMxHkyCXoBlpP2ZDW2lYtXm5FJSKWFMZgR6uV1Tf5s0o6hpvpqDP35BnRRFV505wz8RL0A+1aK1yliR35H/tPHbeKuZr5dwVFfsIZGDwNawPIQNtpK2tosp5De12pVM7TCqsqTWbVnBG+oyJa/8ljVrloqYqUMIRDGyufC3wHzZ/ARQpCOi7BP9St8ss/WCIcxeVaIuxKLScfjUbewKGGGuxo83oPqtwjolfD0hUJiuxvRoE3KQUmUhAhPKNqPCNr2NDFyqJYXs/7eAc8hFkIuMhLHCEEIukJIbuSfpssHkFWndBHfFjiGu8DPnmAwZJ+JoZZkcSkerosgStwsGwV/35MjrNFgMnjpVr9SeC9r+zEOFV8On+Ul3TAo15c4xdLV6FHpOEKnMCfvmeVFatKmWemTCw6YkFNg1aLgXe7vky3RFsXKCv5kk/4ssG5yh555JHExcQED8taEehslgMRBWFGm7iYmQcZFWAJFsBBRj4C8bHrkNl73qMwqAhKoqq8zHoOJkIZgT6ipWullTXWd/yQVUphIAzLG1EAWv3T3mrlzfNsuK/HRoVzuF+rHFpOWNXSVVZWq5UHbS0uaAfaTllZXaO/79m/y5o23WpDPV1WpJULqquE65CVVtfaqJRLsZaYDSpfx45XreGaG637wG6rXXWVFassQ1pBAMMwiiiprLZ+4eo5uNvmv/vDTov+k0d9+VGlFBDKAeVSWltvI1piR11QIkPdWkHhiqZO+Y8Lb53KqOW1ne2ufEYl8Fs2P2GNG96RKDHB4f2IGBzcFXO1mkBxpTWaOBJTjAz0q6xbnQbVK9a6Am5YshzyZCGjwJuWAhMpCCZZ+doaaeq1Q5n9EDUSbK+//po+s3mtZFKrrzRi49cxbfJi9eSrr77iJ7Uie9AB7Gwm37JlSyWDSnwvF7II2UVAHrFCp64Og1Ab0LTskw1qO3Zst2uFg1VGXZIHrCoCJoLzqJTD/gP79dnl6x3nt7/1LV8eilxEgLM1APgoDmQncg+BfOLEcYdNvVh6u1h7GZC1e/fssRtuvNFlbFVVpS/RRTgja/maHaugkpVcw35UuSswwerW3gVgDQkXG/QITNCThyWv4KVMi9iwJ1jARLY8//zz2r+2zMu+QxsPUQhshGNEs1972BCWyPGmpkZfOuzl1LuntWy4iElqALGTGoWApgQZWg4AVJTfPgApQMCVK5Od1KxDhogUmrSh6VEIxLHsio11bDypREFIiKMYuvZut9rV6/wZgVwswTogoYp1DYFrlq32dB3bX5HArrLqJSt9hIAbqWLeIhf4vYf3WfXyNS6AEbT9J45aldL1HT2gChdbxfxFrhyAOdTV4aOU8ua5LsilzQzYKAiUSM/BPa6QEMrDUjBljc3We+SALfrAPZ6+7dUXXFA333SHFbOf4+VnpSAalGa/lFGpVcyRcJcC6D91zKqXrXKF0acRTVl9g49aSmukLFSPrj1vWNXCZZ6WhiMwkqL8ZQ36ELlw1191nSsjRjEoHR+taDlbn+rQIEWahYwCb2YKTKQgEHBPPflk4hLR8lV2N2OpJ/sgVvrOZYQZx/gg3JFFyKuFCxe4fELQEwalYO5417tcBj311FMug/ZIViHA12qfFruSq5VXoHxj2nFZ2AhWlAd5kXcvvviCBHWFf/8Zg3efZNldd93lshEFsUA4EfbAvOOOBBeCn7S4aVatWmVPPf2UC//Tp1vcgF69eo21SDkdOXLY1q2/xvdBgO/nfv7nHQ47qxH4yMyt2pe2a9cu+/Uvf9k3BfJ9bvIjV9lRzvJW9oUs1vJXlsvOnTPXTpw84cuBoQ97KVA0wHKlovpxrAijiPla2lqr+qP8OBZp3vx5Xj4UJ/RmOW9XV7cdFm1dQSCU2UnNBjg+hg0QBD47qRH2IEJhoLFJA2HIA0DW0TKEIQ1DKZQMhSIvDY72e5caq0JaHwUxrA0b3ft2WKOs/Y7Xt7jgxP2CQMdSx+3UeN0tNnD6pAtuRhclsv4ZTTDKQJCiF7t2v2G1a9drVCA3k0YJfRLOuJhGNNpgtIDgrZQy6RPMwdYWK58zzxrWbfJ5AJRR94E9VrdmnfUe0zb/w/utds164TzlZahassJHCQvu/KhfKTPpGq+9yUo0xETQM9pgpMPzyIBGEqXlnrZmxRor0yiAOtasvNIVSOfObVIcV6gsR6y8YY7cTdLuUjS4zSgzv2MPf8tHNqRDOaBAGB2hgHAx9cg916ByZSGjwJuZAudTEBiiyI1du3baqpWr3ADF0Fy5aqU20x3UM0f/1Eou1fveg66uTn3LebFt3brVRwW4aRHwGzdtckGKXFukTWvILzbCkRerH8GIYlm16grbpQ1rCJUrrljtoxW+H/HC5hdctnH8BsqDUcz73/8Bj3v4hz9QOWr8fCUUxK233uow2aMwLCO2SgYv37E+rZEMRjMjGMINN9xgB7RZb9/evdqNvU717HK5SX5GD9SdzXzrtdv6NX1Wde/ePfalL/26jxCeeupJ5b/RvTYoRXZX8566s0fitde2uWx2mJLPrfIAoWzAidzGI8TGNzbcofhWaiqgSK6mRx951EdAHEGCwY9sxegnPzvRXUFQeAgMYVEACHUAkpArGoh7tAvEokCkQVOiJFAIBIZFpCGOUQgjE1xPFLRKuxBREMw59Mnar16+Wtb0UremRzRk6j9xxCoWLHYLHUu8atEyF8DDcuNUzFvoBvfIkNxSUgYIdOYRiivkNxPxezVqwK9ftWi5BPlBH3VgtZdUqRHZvShl5sMtai/DHZgoktI6HVolBhvu7fYRASOIgOcjFwlr0nbv2ynXj85Jmb/YBTsjEt7HCIJ5DdxN1UtXOszeQ/t8RIKJ4nMjKj8jGfBQTvLDkV4HjQ4o1KnnHrOmjbeo/nI7SXGo0IIxVy6wcuvVfEifytm0aq3SnhuoXxYyClxuFPA+l1OoiRQE79hZjHsEHz2H3rHbGflRW1sjAbZHBmiz7uv8OIuVK1f6Ao4OKRRwcYYTfn5cMOzERlYhv3Cb79mTjCBQCFj6c+ayIUxGrXBg7ZO2Vu4p5BqyjhEHsozzlBDoCFBcL5TlgNxNWN8nTpz0K+UAf7iHcDdhMGNs444vkYxCruA+q5OMZfSCEb5PCgFjGw8LfZgfMhVlwXlK3G/YsEHxyRxIu0ZUwINOJzVaSGRypRvoy7Vj/NSpFq/Htdde6+WhTPGjTChJlAtKAqXBO0YznDHFmU3Ib8pQqmM+BnRe02OPPZYoCAiBJuRKgQkUDgAMmSgQFUIT8kMDExD+pGO0kQ4hsEjLvRdSCXChIHARiMwlYOXrpQtDX6mk9D4prFEEBNVLn0j2iWfSEZCFIpjDlbAlwvGpLJ5ujNAIYocR+cg7FnDbeLT+uAsnXnDVVmlf4aRb3Em897IprcMkj/An5VBaWQzDGuJh6SPMKYPDpN7UX/ASXNBCeB1XAiPqiNuNeZZSKTSniafRH8epM180j8EqplptqY8QNI7n7JpR4HKlAP0/wkQKIuRJkpaOPtZbyK/+hFsFWQPvkzZ9Tx7wMBlMvwmrnXTcIyC5R74hswjIsZBzkR4YwEdh8D5w8Z5n3vMuAu8pB/HA50oYEQ7SFStPwA5cuXBQJhECH2m55106LmBFvXjHjzJEuZDjuYE0wCQNaaMMwOFdhPT9t+RK8xEEI4eoWCTMrpcPBWhYOhZWCyHdiLmlnOhdbtrsOaPATFJgIhkS7yZSEDNZlgzW9CkwY/sgpl+UDMJEFAgFwfA2HXKVQe5zOm12n1HgYlAgFEHgyn3GkicurO5Il10vPwpkCuLya5O8JUJB4BvNN4JIK4X0fV5AWWRGgYtAgbRSiPu4MoLATZIpiIvQENNEMW0FgeDiR4ABwk8nH4j75ln6yT4DOePdh5j48pMJm3xld98+PnsxkACOJ4l5gmCyEISJD3882Zkbx695grH5CVYFeV78gTHvMZY65hMcG3inE8Cr+ZPxHdOpOpwPLPnG64XvVcv8mI8h4DcMF1Ok4Zq+J108c5+FjAKXggLRR9PXuKc8MYJgLiDig5fDEEKO8Iv50HQ6YPDML3z+5GcOlcldJqTxr5M/4EZ68pKHQPoOnWzKCa747IknjrxM/pIn8nuGsT+kY9EOgT4JvtyQxpf77s30PK4gWE9MgCBULn1PXG6A+BAqNrXQ6MCggZgh10vfEzCk5ZnV7JrWpAiTuqw2qtRKpaISlIbwMNlL8HsJPAnCPq3YqWiepxVKTLSQJhG67JpmiSvPQ51tWi2knYDA9fIqHcUeL+qoNqudTOIU3aNVRWVahcR+Cza7jSstvWPSfLhHH9PQ8lPguTICnCa5XaEFTOgAjkDkZeaZeL3QhfQsqWWZLRPWxbiExunnmZO0ZFNwWo/VvefwPs/HKq+Sch0prFVcPkmu/HQcmBEXU7RHMG9cgRfvcu95zkJGgdmkQMiN9JX73OdQEIwgQogzOmYFUJnitujjQaw0atXzOq3nZ5EMApt+RDq+nYCApi8ELGTRK69oOauWfLK8dECrEVnpBHxOfCU/8omy8AU3Pv/JKiA+AMSeAcqCEcZHiEpkQAIDwQ98NgMzUUwa5Bt4n3vuWVu5cpUrE5abxson0nPPUv9QbrNJ89mGPa4gqAxLU0MDg5iddWwcYekTxCMNBEAILdJXm4jbtm2bE5M0EAYYd999t+9+doGnVUCx67liznxrf22L1azQJjg1YHmzGlI7mxGbbEzjaIsiCdUeLWGt0JEa7KRGQLKruUzLUdnPwH6BQe2eHtK+BDbPJbuvtcFM8Eq0jNRXDGltb7EEbNfeHRLyQNdPjFK1YEmypFZLZX0XNyuGVKe+Iwddr9RfucGTosTYzVyp9MDvbzmW7N7Wvoyyeu3aFnOy3La8aa7DYzc35WKvBPsb2GHNkR7t2uMx5+b3WL/2L7A6ySuqEQHKiaNFWOpaLprESqkTjz3gSqFGm//aXnnemja905fpQu+wrGIOgg4RiiGutFn6nucsZBS4mBTIVQY85/6QIQjuUBAYPqzh37tnr+9/YB8BX13jyAeW02/RR3tYQcnmLfLyKVKsfjaHqWu425WdzMgiFMyqK67wJap8/AbhT7pD2p91zz3/P3tn19vEEYXhUUiK62ClaYIDFTRulBCoA6rSkPYGIYEUVY0EqOIP9Nf0X/QX5A4JLir1hnDBh7jgM6SuIz6S1CU4QrYLrjHp+5z1bNaWWyIRRw3akezdnZ2vnd0975yz8575wRbfuXLlsvIkbRotoEJduNlQQzX1s78xDXTUTWlNhSVNb71x47q1lSmxH+ndZfr+3Xt3tTDauE0bhdVt750sHxD6MAOPjx+1hdN2su87UVcIENxEmNQgJ/Nv2TJfFnULohw3iNWPSMeMp0wmY/Ew/Tifz+ctDaOA2dlZAYRWiNOoHc1h7dovRkKDN/C6sGx8AhjCgASCFUEL76EmDQHTDMGY0wIGuAq9YjtDNOvWiACyXO+hEfdK5TDS7urZK+GbNN7AJyemxcaW1iBxjwCGucyIHsY1gh7/T9U1MSaVL5mR6wqN9P9eF6NSQAOHITU2YWWWcg+MqZ0+/b25zCjnH1k73mpeMFoNbUiNZY2oB48CjaTyJGcaAxpTQoQ/OA8AFDwPCHrV5wVxP5bdwNQpaVHPBH6DRq7blxk3kOJJhxgIrwPto3jrqgBC5BuRcQjexIQqzMMIQAAavDDNYEHqTdMTR3GIe2AnegDZQGgGBMxETKnkh8k0mCLKlgEnW7QBZA8L9iBz8BHEspeQbgEPRvAMjBD+DEyxWiCPFhcX5W5iUAsAdbsj4hHAQsZcPDo6ZqaiBRHNPocMpmblfsu58xcuWFvm568Zb4v3htXkyAuhDcJvVfXhimLy60k3MXFcZLmbtvAOpDEcZk6dnOIKjVMBTyMvXgbcCVxbsCIna0sjD0mTzWbpjl0dQoBA6MA4hPBGx+PPBLUKYgX7oD3aAeQK0Brg4MfNAzBYWJyOASBmZmYaALFknIDCr5fEjJ42YQeBbI+IbpiKyhL6kOESEqIVXF2I+Aa7+LUIc6R/ef+28Sb6spO2jzO9WqVsbGhcdbwRNyA1ckzzjWsmXAe+PeNeiGzGd4/k4Yzbp3P4YCr9/tBG6Qjlcu5hUKbKx70Gv74vJ83pX0qs7L/kn4k2sN0vP0xoOFWBEeatxOBBE+r4YeoTo5r24TwwKf9QaAtJARfOCOEzoAWUVS/gh+sNrq9aWHEHv7tobkaKt+bdgbPnAm1DmgdaBKQ5DYgMONsBhKnXelE8OBSL6w4XAcy3thEMj6LuI2VwHIbIbhgX78Q9sB09EGCClSRdAbkYAAQxksxwEjC3pOXKwWsMXoPwAAEIMNCEIJceSiudlgOWbMFMxNKedySXcCfByBxgwOREuQ8k3Bk44TaCZY4hpQFGaB2sGokfpJSWDV1dXZFrjTVzk/GxTE3X5W4C/0dD6cADBPkBHRjZYwIXykTWsSob3iAAHiwpgMDCowUT/Ph6op28ZwBcQemyE1m7dpYVBfgAnN0eQoDgQlDRAANAgpsGAxG7XdT0BGgwcgXJ6RhuMnFQ49knHx2DCQdneGgJJTmcS8mNBW4nYBLjTM+0B5lXvIkp8dmwq0joY56B/YxJCS2DhwxQScostVEXCUWqKQIawYwbCtxZADA6Yd8tmm6I8qJBUB8fphH8mHUADTQMBDllvvrjiXwpockMWBz1cT5xQA+argdWM98TytIsuvXAVaQZYH4CGDiPSar3iyMNT7Ua7ag9pKcuAzy56OiRE0IY3ZjZ6Be0i/6vYE3jKLBk6UlDe2Fe4yiwLyu3HtKOeAijGgQAUdNDDBivrBaawcA6IEaEpucgPtjBHoggRqPW/WIsD0nwY57xGgQmJuQFW0J0QEOaaPDnovGM5vE1hEbNABVAaZeOpUBxHwEYDGcyVifpfFl+v11e0hDvz9Gm1nzE+fP+HHGE1uMgdnf9z83NBUQ5VDhGqNw0kJ4AEHCRfNkH9T2Zjjh/Q3wnRDuJm86HXsxDCFe8se7hA7HKJiCU9R8wjht1qEBLh6CHiUy5VqbKYXaPfeS2GT18sKZderBIo/KNPe1Z01ZD5E83OAzcbA6IU14LxFG+6qRugh3rPIxmawNpSce1SIV9q37CXIbw14UG7WFfwp3rDtjhVlSQT+2lPuIBOAM+ncZJYTRwjvrMg63yAA6+DQAE94cXwmsQXEbk6qJFxftxD/xveoDXh7cNucAPucI2ChA01suSrTSc9ySYTLL5jaNdPt4bZBcyDZlFvXHYeg+EGoQX/lvPGqfsZA8YMDUqYN8DBNoaAMEPQOHD2bYFaX31P5/a9xiALwxyjlZNyU9LXZ5l3WZ8d5dGb4m0S/T0h0njnbgHWnvgjQZWmEE9QPAsI6zfByBa64iPO9MDMUB0pl/fu1QPEDZS+heA6JLW1CPA2K6wUSq69Z9/crXlJX0VD3znW9n6iPd4esAtVG66+samD5revZ+6b0Z+dMODpyyZb+u72hNqh5GE8cgu0hkf2C6O8+po6VIlAAYPEAx2iPOag9/+1+XzjPl00f12eThP8Onbpel03Lva6OtvTbedbW8t29e5lS0A8Q8AAAD//8ED5cAAAEAASURBVOy9V3CdSZbfmfDeewIgLwy9d+V9l7paquqe0UgTI21opYfd7X3QRmyEnrT7KIUepQiNNvSwD7uzMbuKlaZH1d3V3VVtq6rLsByr6D0BkCAI74ELD+j/O3nz4hIFkgAJy0KSF9+9+aU355/n5DmZSUNDQ3O5ubkuKSnJbbmN0QJzc3NWEJ58pqen3cTEhEtPT3czMzNudnbWJScnu/SMzBUr8Nxgj+v9D/+bm7x9w81NT86nu3+/a3q+3F0YPeWm56bi/rmZpe6lXf/cNZR/z/z6+wfcr3/zG3fw4EHX0dHhKisqXHFJsZWTANQjOSnZfs/Ozri2u3fd8PCwKy0pdfv27Y2nu/XlyWqBqalJN6PxC31JSUmx8cuTsYxfoDvhuVjtGe+Mez6pqak2lvALaSwWZ2RkxMJmZj54jjCvKA/pLseFOUq5E7+HNCjf5OSkS0tLs/SD/8In4cbHx11GRobNDerIb8qDH79t7mi+U87lOOJOTU3F0+H3wjajjNSBci50f/M3f+OSVgMgKAgOIkYBcRSCSicOBBoHRzi+8y7xPQ1DWjRMor9F0h/eJ6axWJgQdjM9w4DjyQeAYNDQudSXNklWm2SsJEAMdLuev/yXbur2dTenSR13Bw64my+Uu/Ojn94DEHmZZQKI/8U1VrxuQfv6+tz/95/+f5efn6/yTrnCoiLzHx2NCgRKXFd3l8vNyVV9Zl1WVpZrvXPHQISB+dabfy+e3daXJ6sFpkSAGA/MceZxmM/0O35hzvKEVkCwGO+8w+HHu9HRUTcw0G+LjJycHJek91lZmaIpaTYvonoPfcnU2GKO/PrX77mjR4+57Owsl6NxRzqAVVlZuS22SI/w58+fd42NjZZfdna2hZuYGFdZU628lHNsbEzpZMfnIaBz61aLq6ra5srLy92VK5etDKWlZRa2sLDQynzlyhWLV1paau9Fa11BQYEjPvlTx0kBVF9/n/wLrdzJyUlK+5blVVtT61JSU1x3d4/btm2b2mbCFRYWWVqhbUiH+kIboBG0MXUeGho22nHzxg0Xqauz999884179tlnrYyUgXj9/f369LkjR45au0SjUWsX+undd9/1AEHlcRCj0GGLfccPRyH4Hn6bZ8Kf5uZmNV6V+bS1tVnBK1hRFs+vKCkcg8FWkWrA7u5ue0/aOBqPQrIaLSsrs0KTXxg4xKfT8evq6nLV1dXxd5ZALI0QPvhthmdoV558qOe3OQgBxENWR8up69xjAgQD9dKly65XQMHKhw+DjQmWl5fn7rbfdRm2akx2UU24HI05+oxJ89TJE8sp6lbYTdQCELXpKQj+tzkI5magNzwhVrdFHO+2t2sxkePytNi4e7fN6ABj5VbLLdGSMVdf3+B6e3vduAg5i44S0Q/iTYievP7660ZvfvGLd0T4d9rcobkAndzcHPfyy6+4a9euuatXrxix7enpcSVawHjimmxPgIOyOJG7/eKgW++0GjHNzc3TPBy3tKBXhw4ddidOnHD/5T//Z5uL6Rrr0K/tO3a4Hfr87ne/dVOTfoFcUVlphLmgIN8dO3Zcc+WiLfAg4KVlparnXVck4o8053brbTcsAl8kepmenubSBIKUjzl27Phxt337dqN1LMq++uortUWP2717j+tQu40oDGXu6ek2kOgU/aypqXHZak9Azd4JcCgni8zBwQH7/tZbP3RtWrRdvXrVTQpIAciWlhYPEExiCDFIGdCPzEE+CkXjEgZChQPNIN4Qd+JA+HlCEEB3nvzmfbsKfVyVKtKKks6AsJMH+ZHmuXPn3AsvvOAuXLigSu62uBAXVqIMms7OTlepxiUuRJLvpAu4DA4O2mqURiVfBk1YBVBmgIXOD4PQCr8J/iQCBO1FXb4NEMkxgFgZ0eDjAgRlpqwz+oQShXZnWWF10hd1adzxHiKxGUE8XomtLw9sAQ8Q3+Yggqgj9D1jgXl96tSnNudJ9PjxE+7SxYuORebBQwfd+JgXxWRphcwiFA6hre2OvYfoXlTYV199RQuSfK1+f2XiS2jA9RvXrYxPP/2M0Y+f/vRtm09wshDwWXG10CtojkaoOyCuGWI6Fh0z2kH+LHLKystcbe1213TzhghxVHTredHCavfRR3+0sjHGK6sqRRtn3Z49e9zHH39kNPTq1WtuZGTYlRSXiOgXueeff8EADe6lobFBC9xuy39a9BVaevv2baOXR44ede+9967Fg3DD6dTU1qh8B20B1tLS7N5//30DEECAuABNjughdLNfNBy6e/TYMXfnTqu7ITCC9iLqNVqqRTy0nPq9+uqrBpqXLl6ysAcPHnItAl0TMdE5Z86csVV/U1OTY7VPJDqPDPhcvnzZGgtiHIlErMEg6iAb6E6GyP2MSAg8yBhwoSMh/KAeecBikR/v4DJ4HwCDOBB9CCLhgnyMcAANnVhbW2vgArqBhgACaE5nMxjgJgC3OrFVABBP0HIzuYcBBOAM+nv5agLFfYxKTkdHXefvf+4me7vcrNIPLrO63EUb013n2AUtqKaDt7iBQtdQ+YYrKThsfqzeevv6JW+esXZPSRGApYuLGIvGQYBy4wCMTC0CJjU5ETkxoVLFSrMAoa8QHUxp1cmYMlGaOA/iTur93OychQWIFNlliYtisrKo0LCy8UcapDmh1Svvp1UmykOA8XHt5WhclJWWWDpWoK0/q9YCywEI+huxDH0FXUGEc+7sWStbXX29LTLaRQBZjQ+JTuDH6plxxAKyW2LMN954wwDirOJBQwgPwWQlXhepc7ki9NCOZtG5MomHoCnQDhasFRXlGj9zRs+6RUcY04yrO62txqXA9bKqJyzEPDsn2+3du8/Sg9NJ1aob7hhCDg29dOmSaFGv5kO6cQYsYCOindAk6NzNmzfFDdXbyp94iMmKtaCFq4YGQn/hepJiBJ06E35IQMpeH2kAiuzpVQuo0lVW8mCuDAwMKJ4X69OAiHmhk0Yj1U6IwxD/Acr5aqdDhw65pqabAoc2AWPU7VA5T58+7QECgkSDQqAh2KzGQXgaAuRkwtEBIBRIBeEFCFrU0IBHQDyAAj8KSEMAArx77rnnjJh9/vnn1lCkDzFAfndHbA2/AQ8qT6dC5KkcAAEXAxcAGFGZvXv32pPGhTOhLIAH5aVspEe+hCM+flsA8fD5H52ccX/9db/rHNKmoiZJcI0ls+7vFn/qModOaW3lOUjepaQVuPSaf+iSC49ZUAZ4e2eXWPNB+52ZkW5EuO1uh/o+I75iY6yNaSVYUV7qBgaH1H+pmhCjmoiSSWsiJEkUwaQY1CSxTW2NA8bHoFhuACJP75CvMnFhpyvEntO/U5pQw8MjGj8ar8kprn9g0CZYQX6uG9VKkAk3LdDIFmAQt6a6yvK2wm79WbUWQMY+Pb00DiIsLpn7OOgIQIHIhw8Ek35kDPGduW/EUOKgDz78wAjvvn1+0Yg/NIbwfvGQFCeY0AXekw5jJ+RLeiHv0CCEY5Pd3inP4PAnLIs0xE4AS7J+Mw6hRZSX/PkQDj8AEP8g/ydfysCHMuEIhz/l5knYUG/AjLCA1y4tuvlO+wBWiJsJhx/xQr7kR9o8+eAIzwy3eaPv1I02onzUC4ff22+/7QECD9AOFguCSoKgE6tzWBUILoSaREgAMY+t7lQgKgTnQGagFyCCIywEHX/8aCRAhoKTFnkQl99wJYAClaMRjA2KdQbx+MDBwBkg8yM//EgHtKXilBX2KuTFb9KjgQm7mRzlxoXOZrDQ3rRXGDjJIoLUTZVbkar1jc+6f/XHYXdrQIN6noFwT5VH3f9Y9o4r7nvXJc9OxPNKyihxabt+7FzZa3E/ykv56HMGK87qQhn1LvSDDxdb1SvMtMZUquKE9+Fp8fWHGlo6sScTgD4PfonhiZPoCMP7+FMvV6bFEnPZ+n6/FgAgmONwBYwL6AdPxjL9EsbJg/rwfmkn+of+TfTb+v54LRDXYoLQ0IkBZWhsJiGdBmFi0sOG8TuxUxOzJzwuhCENPgwA/HABdcNv/EJ44vMhDgMo0eEPUhKf1SQuhOOJI51QhsRBl5iXBdwEf0KdeFKntQSIloFpAcQ8B/F0AIjeX7nkuQSASAcg/mfnyj1AMH7YXJzVKr20FPGNX/Eh6qH76RPqE/qGOvGdcPQ344wNbtj4sJLjfSAqdDMbnaQRxgxdGdoKrZY5xo/3tDCWscIzbhBVscLz4dkw9XsfiMVYuCCCQDUXdp70ySukTx/wIY0UqwfjzeeNqAtxGe/hYFi85OXlar5k+zBKhJT8OOSb+pTK8E1xQr0IRZrB+SAxcJMnZTdQVPzRqagbmRzRNz8+SDMlmdWhnkkpriiryKWlaDW8AaBwrQAitNvWc+VawACirbN/LkOD2Q/jlUt8K6VHb4FA9HhCTOYkY3Qzk64gF3m6Zz1Xi4N4VICAwF/RRhqEkgUH5UzXHsSY9iBYXIh2SUbKqlFyVYE8YILn7l27bDV5S6JIOMTIjohrkZgSlhnCXiwRJkoPiJcQRwFApIMYifeQWoAEgo4MGA7UyqB9DMoAkUQrIzOmEowIANAplY0Gi40vvjwt8cSH7odvvWnp8Y70oNXJAhHmxYQWJ8i52RwFwEiXviEcYq59e/dYP6FGODU1bWJZAAdNkDQBINwyHDXlAvxQt5xQepSVtgB4QAoDQ/U1T7j2bdp7GxAnr1e2b1KuTdIUtUH/uFQTR/rd2KTfRI1ORF1uZq5EgzOuKEd7hrnShklTumrr9XZbALHePfDo+RtA/N+/a5q7OyTZnmcAHj21rZir0gIQorTkOfdcfbp7enfxqgFE//ic+9cfDUnEJA4iYQ/iqbIx9z9IxFTU+94iHMT/JBHTq1ZviCbEDKLNJjAbfBBECDnEG8LJXgQEFz3tAe0RsKouKio0oonhHCtxxIu8g9gBOjnZOUZI0QcnbQMaiSfQPMEBAHADcCoACMSUsmQIRCDqRpRFrCGWpMk7Nq4h2BDrdu2zIU5l/wwgslW66o8KJe/5mAxXxJ4VPnr3lIMPAEL92Ddjs71Lm4CjI6MGPNRtZmbapSo+3/lHGNKn1GNS1wQsTfU3xq0ASnBicEOAHXmz0U6lAF0TKYrm940JIKL9BnyknaoyjE+NK9kkV5BV4Mrzylx2WvamBgjair60tlO9cGHhhN9Cxzv8eYbviWEWxglpEYbUWGjggn9ICz8WAg9yi8UhfGI5wvdQDn6HeCH9ECY8QxqLhUsME8LxDOn7Gvl2mvcjxNKdAcS/+L/Oz51rl8bHdGiipSewFXINWkDdkiu6+t89XeD+wTMVqwYQw1Nz7j+eHnVtg9MipPP1OlAy4f686Pcuf+AjAcT8JnVSWr5Lifxj54pOWmAGbBjI+iq3+HgKgzUMcH7zgeCG74lp4TefricC86W795sP6/NOjMd376u/Khy/g5+BjrzDbwtowRbPi3ChPIRNTAsw8u9I/14CEdINT9ooViz7YkTKN5wFCeWx9ChvLC9eSuAlMeCUtZm9kB/hiJOeog1SiZtCfMKvp1sOB0EdaEP6BNBGSQYNyNDGvMOF33wnDgQ2jB/AHMMvtIiiUk5Ay6m62iuqwJlZeyoe4TFIK5fmIxwunDp7mGwARyIRM/QMCjso08Q5S7Uxjvh8AHwWHTjjAOWHQxMIBZ2GxkZbYFAXNDDZeyEOCwHUTlEMYoFBGpQtpEcdfbhJd01qsrXSAiUc8fggymTBEPaFh7UXC0daqvqQzi2p6UYiXpMz7PdYwZbxxwDin/+f5+bOtElbQATiURzNlZLiBzApTMfk1yyKWDmiEaPyLupSYiunRK2ZxQJanyiNxZLx3eXfkV4Ae8pBvsTFHy2DhIXxYtnE/SgWcaZjZV+YBr+RCSc6OmWp6SfGW8r3/Mwk90+fLXB/8XzlqgHEpOZe27BW7VooJNYjP33alacNuLTJXtGiBORITncuq0JL6sKlVGErzAq3gEb3ohMCwrKR3HIAArEayjKI9OC8IHqoYEL4UHWH2MPloYCSn19g3xFhokLfervVNOCwSL4mUeffe/NNiwfRHxoaNE4UzR+IOuqwNB96/qikogWJkgRW2DdkMwHXWlBYICI8alwvatK4w4cPx2wlUOq5qL2rXlMbvX37lpWHMmKshkNd9QtpbQIK28SdAhZoc+XJ2K5S4dplOHr3brvZgKFsg5amiWMzs4x7hVNFaQhbhjap0GI7wW+0TSl8v/bOsMugrJ0CNbh2FHbQKs2UeJX2wACPttu3b5/2Bb2xsRVuiX/iAHHurnTM1QYQxkAcwneGG2MuEFuefoUJcsPeJrm8LDVuWrIryU91F29HLfusjGSXL/+uQamaxYg14cP4JZ3tpRluaGzGDUWFngmFDvkFop6htNMEQuNT2iikLApLfBz5p6Uluai0cOorMt2w0ivKTXU3O6QSpvcQ+rL8NDcwOi2Zrd8wtbh6GUvCykQ9+U36+VmpLj01yfWOeFRn0tWVZ7hb3RPWPhnKj3YqzUtzg2PTkvumutYeaWusEhe2FgChqm+5rRZY8RZYDkBgS/DLX/5SczDZrKjZn7kk7cV8qdpDcAEGQAMCywr67Nkzpt8Ph4C9DTr+UdnEMI9fefll40KuXrtqAAAhffHFF82i+Pe/+52J8aKy/dm1a7cZ6xbLgA1tylbZPDQ0NFhcxKKs1rHSZv/ptde+5+rqvF3VX/3VX9kxGWh0QsAPHjgoOpQqM4EW0+Y8+dRTsXjZpraN+j22Zfky4sPyG5EmmpsnThyXGn+prK5/Z6DB8TmAFko5cDDPPPOMgdbJk0/Z3tbf/u1PXLb2jOEmagQ+pHFVtiNwE6RZJY6kqanJbCrQQEWcu0e2Gk+pPCaiXEYPxwHiSvecqyrMcNki6n0iiqzoIardQ1JBzdRBViLOkyJ+GSKaNH5L14R+z7ptxemuXOFYafMBOEbHZwwwKEeWCPugCPZtEc9xEefSvFRXViCki864MRH7w7WyhxB4dCof4hWI0ELIC7JTDFSIB1HfUZbpju7Icd/cGlG50gUC0ktO1QZhLK9DSufDy4MuIsAZlN9OAcUXNwmb5rIUjj3AW0orMz3ZgGx0YjYWlzOgZLSlcpIvdQXUxlW3frVDRWG6BmuSQGzaHYvkuuaucavPoe057vMbQ66+TBadPeNud1WW++z6sBsU0K2G2wKI1WjVrTTXogWWAxAc+3D69NeuUMQPjpzV78joiK2KscfiXC+MyVhxYyfTJ7V6viMCgviyfzU0PGScBStuQARRCxwARmbHpSKPGvypU58aAJSXVwhUSkWYOxxWycZNaFUP98K+FgQVsRHEmtU7XAsgRD6ffPKJrdo5kBIr57q6euMAbly/YfHq6usFPGcNEHZKEaOrq1Pl7TOiDtC1SBGDY0MoJ3lcFAcBGI2KQ8KSG04JwzaMVmmDF14QuCne5cuXJEIbMFEVS1qOMaGtgro/NmOIHQFKXI7shigbbYTIajkuDhBNfc4d2ZFnxO6giG1b34RW97IfUAE6xQFAwJ9qyDMQgLjf6BxzfcNTbpcIY/vApCsUYYc7qCvLMI7hdu+EEdtnGvNEqIfdtfYxA5jGyky3rzrHwOKT60PuqAgtxJgVe5cMtHZWZrmeYW0waoUO13FV8WqLM7QhN61D4TiESzI6gRWgcXdgwtK6eEdGcdXZ7uKdqAEboAbBB2SKs6UxosbbpXS/ahp2EQFNtdL75OqQqy5KdwMi/GW5nHWS5AYFEDzTNDDaB3UWiepDnt36DmdQofA9SntG6eUJSD5XvQAXwPRoJEdtMu7a+xMOuVtOTzwk7FoCBDJcHIMpbJ49pHj3vGawJrqFIo/wfqF/Ypz7fSfuUuKFPCgJnGFiHONK1XFwqWgP8f5BLqRFmMR0HhTnYe9CmiuV3sPyW8/3ywEI5PDYTkGQ0TBDDRg1YsYkBNrk9PqdorGJqIh2JCyracIwXtmnQLkBIOA77xHtoMQAJ4J2HHkQPuwH8JtxwDv8yQd6xkkAKAwE5QWIMOmSH35YK4d9AbgHxhagRL8at6N0yYPvGNuNq1zkwxlTwdKZeqGMwNlPlBewgJMJexykx/sQDlsz6k2avGOekjZjGX/KTljABoe4jn0Jwi13vMUBokXnUh2J5LlbIuwN5Tq6QOIarE6rtIIe0oocYl1RIAIpUID4ww1AqOEI+mzFn+omxBHUiwB3iYh2iKjCWWRq9Q6h/t2FQcm2Z93J+lxbkRdkp7pTWoE3inADNBDrfPnBvcAZILYpk5jo3G2dA6W8yetATY4R534BFHkV56S4QgHAdYHVThHyK+06ByojxV0XqEC0GwVepSL+NBqcSXP3uNtRkuFyMlPdl8r7oMDpQquO+xDnBBLXChAvt+nIBoEEdQJkjoprIK/2PiwRZeg3IlXHdB2Sp/J83TJiQAWQvLA7311SXMBpNdxaAgRyWVZuNWJXw7lKDFpvH+CPsmCyscIKjomJzBStHrR4gp4/x2dkS65LfBwrOSYsv4nPIGbQhoFr0KL+4jdhEkGKuExeNKHCJPbl8pvGTChWfExSVpqkgaYTExeWnPwYC2M6aoOjCph0eSJClIdyBuKiiFZWZNLkjzYWx3Ng/4CYAbVVq4vyY/VGcMpBXUifdPTwyGRfgujS14kInP9DeCY55XuS3XIAYqO3A2MMIv4oxHaj122x8sUBAg6ClX23CPRtiUwyRKThCqITM7ZPwAr/jrgKgEHj393tnzIZfboIZYnk8HAcbF9mi6hOiqAXi7gHURUEFCLL5idEHTHOhDbEETEBp5N62h6DwuXoHWIjiDNEhv0LRFCkUaS4whi3TWDSLwIOIYiqPHq4HImOyHe/OIkzt0YNjGok/kJE1CuOpFOARfhSgRZ7FoQFwOBscJAEysB+CHsPiMsId3RHronLLt+NmviIcrMhnycg4kgKOAvA62R9njsrMKO9VsOtJUB8pfNXIPZFYqMvasMQYoyWBys6JgcrFI7KSJPqaKZWR6yKeL9jB1oWhe66WGxWM6yw2JDbubPe1EppF9jnzu5eUUyJKxU/WOnn64RLDmKjH6CtEFpkwhGdiImWBr/ZMOzSpmDNtkrXLPa8S8d6cMYOaSESYGV1/PgxI77nLlyUdkq5VFjbXW1NjduuA84434l0hpUOx4JA8HEcFsnGnm3yCThQtcXGpFCblGw6divPTuXFirKxoV6rszyLRzoAESCUqzN5bt5sspUrMl9k1xARVq60JecRpes8HspbJpFId7fu3tDm4549u2xVGwDSEn7C/jxJAPGEdc1DqxMHiAsdcAx+gxriyERl/mg+2eYwBJo9BxwEGWKLQz6PLY7ohk0+88TPvsT89JuJycwPm9Sxnz4DwipCXCuIpPWbMGYkpqeSsDRtZUl+9i5kEnsqDBvZcBzE47utIhXYtKQsDWk56Uk5KBN7JjiyJEN76quCWFxEXfwDpGgXK5QKQxqkSRkpG2Ipfls+pLXCbi0BoqmpWYR81NVFIkaU+T4yLOtgEUaIHOw7NgZjWnlz1DK/IYacn5QpDYw+yUcBFcQDrNIrKsrsSXtjpNYn7QtbOccIaJeIJcSbvkJuOiiNE069ZLWOkRxpW1wRXVZwGMmx6icseWNPQHrIajl8jTC9vf123gzGdbyr1CFsYaXOuUzEZ6UfzoiCE0CDxjpefUrevAckh4d1D4Fk43BQ1AUbChz5RAVqjCW4DWwgOKIZK3ISmhI4MEDYdARYAUzApEqbmiMjUQHVsH1H40RD6Il1WwCxebvWAOJ//+uLcxc7dViUVsNbbmO2gCRp7s9P5rkfnSi3FTwEh1UuMtMVWX2KkGGYJKoXF5WwKofAIWaC2JOPz4snr8J4gbx50Qrv4TBMxAR4ingikkkSAWUlQYwQL4h0wm9annqx+EAcxHvLEzQOWREo5nzYGMLLj7DEISgy2SAeww+gCo78KB+l9vXxZfKLHp9R8A9lBAyoNMZrQbRGOqHslibtJD/iJDrSCmF9ur69KB/AQviQX2K8J+X7agBEYt/TtrQfC4nFHO/pP9o59E2Is1h40uY97kF9Q5p8CM8+Q0h7sTQT/ULZg3g0vLMxph/4bxRnAPHJhY45bddIvr9RirVVDpgV7/RFg1XnTbqK3DlXXyVFAQiwBiUAwfG+K+KUx1xUN1ANcxJrPPMVSZpEksR5JBVoZS1xy5b7brWAv1GO403mz9WCCAbjrUBYA5AytoMLhDwQ7BAGzhH1ThYCvOP4b8ScIS1b7GgJQHj2erBBwFaCfAnPHGLRwPvET3iHxlG21GLZLF4IEoTHjzRZ/HBkDHYGiEITy064hY704a7RuIpEIgnlnTNuGGM6VGw3ijOA6O0fnMtSYyxWoY1S0O9UOcAEiLRhg1/tzs5IH1ty7OysjDhAsGJCfKKOe/zm0cA1F56Pn+K3UwjlDM9vh9jyeQJbYFz7PRBFiCoEmpXy/QAC0R+2EByRglor+0qcfYU/J/6yD4YmEeO+tfW2NHSkbal9Kg5H7JUKKdo7xMMIjfwgtpwHhuEcLKNdOCSuGwtm7j/AgI59M2wZKBfAMyw1Wc77ShNXgBptlvKC+HtxpL+/GbChnJwdduH8BffmW29ZfIzyAB80nbAEJx7AhYYSZQMgMKRrkeot9g3sq7H/hfiRMBjs/cmf/MmGGQUGEGrwOZByJQGCxqYx6CQQHMd3iFpiPoTjN+9AX74nvsePMAvjhRYkj4DapJEYN4TZjE/qhQv1Y9AxeFl1BQ4iAMRK1Zkc7XRRy3nj/zFYZOzo49sJWI0B3X2KTxzGCY6QYeyYxxL/3JMG4y/WV/eLrhGtPO8d1/cL+yT6oxG3VIBA3fTjjz4SGHBuV5apkEJYr8hYDmtkiCh6/rdEYFnhMycQ0+GHXcSIiDs3vKE4cfHiBfcXf/GPlE6m7jX4r9o/qrTTepubm228kB7A0yVjspdfecUI+YcffGCGdCgwdMhfAW28sCeFgRv7RhjxvfGDH7gvv/xCQJcqbuCOrjn9O3YiMNeHwplwvS4gw/4Se1uIJrEIR7V1u4zbmlQG5i/jgtvvGJPQYE4V/rM/+7MNMwziAAEiB2IUJhCTh+/484EQhWdg1RLfJdbq+vXrdq8EfrBiDBKs/OjIQNBIn4FDo4HgoCfGHCH/sNqAHeM9DUqckDffg2ohcbkDNqQdykpYPpvN0a44ntRztQGC3GDX1YCWJ3lDCP1ewr1El19hHNBXob+Is+YuNi7ZP2CFGcYj5QhlTBwTfNd/IyqozVIX2jcxntWBQFZtP+7DPPDxpa4aI/hsurN5Tf8k5hfCWd4qI+IVxu930S0XIKAXAAWGa/v27dcqPF1XfDbZ7ZFYRdfU1NpxHBirARCMU1bsAAFnK1VUVpg19OVLl92Pf/xj4wAACG5+g6P45OOPTcuuRtptAARGbm/pJF/um/7ZT39qdAS60nqnVVprjWYHMSPA4ggQ7oyGzhzSkRtfffWlOJpc40KOHTtuIi84HrThzspAbnvtdru97vLlS8q30biJ89KY47iPpps3bTxEIhHbKxsY6JdxYKEdmfGjH/1owwyTOEAweDExpzMx/AAFQTMIOgjIBMAvrARoXCYEiI6xBgScTqXDYKmIQyPDDiJX4+Y30oLYMyHDd8JyZR7sFhcCNcrEHHaL8tDpOIg/+fGkfLB3sG+E4zdp8AGBKQ9sHeUkHwCHQ7tsom6YZn94QWhbHM81AQjlYwRTG9Wob0IQsQ2gH2H3TfdfM5HrRNlcpX1RB0X7CEvW9XKBuBsnqj0Z1Fdh8zmiAZVaxgLjCDk4Y4QxjHyaVSeAAnFHNAEaoLIKIccfTSVUVRn31JE54bW2ciwNsVoeP6ziSe5mU5MBCqq/LEiwBCYuq18DC4Um7++iWw5AMK44koIziaApnFVEG8I50wfQGGgI5xupI20s0qa0LTSDePTb11+fNvHT93X9KGIpxgSiJ2gEC1LON+LqUSyVoQ9YRzPmERmFBSXA09TcpPwLLD/CogkHKJDmgGgN6tz0cwAr6B/xeUL3UHn2N27qXCTNE8YjdIz41IvvLJyZZ9DRAvlVi9ZtFBcHCAqEPjjEF6Skc+gICBQNSOU4657K08igKB1GHICAMExWGp8nHzqRit8UWu7cudOBllwrCjjQgDQs+cDy0WBsOtFYEHni48eAoVHpQAALxEc3nQ4n3pEjR0weSWdAADgZkUYHycmTTiff0OkbpeEfVo71AQiJsQQGHLVtR10LILjaE6MyylMgNVdYZSYF99ZWVVWaDn9NTfXDqrNq7xknlC0ABOMFQz/GV2vrHY21Ylt5IjpjHHFHA9xGagwIAIimpmZdTzpgqryo6nKBEE/SABQwGNypi+UhdBACG0sLAOLS5StuUO1G+hyQhq0D4RnrOPFlWwChuUjb0Vc8F9ukDrQjjH9ru6R7xXOEwTG3Ex1ATDzGQFgoQoQBDhsfek+cxDwIz/uQVkg7LCi5mhNNPGxZCBvKRfkJG34vjJ8YNrGM9l3paNVgnI9fBvoQxCEdyrNRXBwgKBynBELoMV6CXaORaGjETzQIRJcJwqocPxodQg1QwH2AlHyIT+MBEKAiYZ5++mkbEFyCTdrEoSMBHgg6oAPYEMfQWROWxgJ8SJNVIMAFR8Jd03AQsKIABOUEPCAAhKOccBe7du2yPAANyr+ZXBh4PGlLwBSCtVp7EORjK2o1EqtwVmEYsjGQsS9AphssoinPoO6SxrgNu4hgX7Ae7QuxVxFtLOqbPRlXcD1cysOigTZjLPEhLA4OAvEQpJvwjDPGM+2sprBJCqcxrPFbojHF2GKc+TSY3H6Skz+OviE+jtVsyI8nCRJ3PdvJCrZOf5bDQaxTEbeyvU8LxAGCAXxFJwJCjFnVM1Fg5yDmsHx8R8zDRIFAsDJiUjEBmBAQZNKAgAe2GiRkcECcgx+Aw0QCIMgjoDsTOXAOTDbYQdKGcIUnoig4lJMnTxonQX4AFlwKeVBW2EDyIg6/iR9WKvdpgw3pTblxPNcCIMgLYhfy5fdmccHoEYBLkPssXnwBBBuQjA9EZbTtQ+MsSEnDzi849AWR28PajHGK6Io8v4tuCyA2b6//5Cc/cUloMUGgw0APq20mD4ObJ5/gj18g2lSd38QN8fkdHH78Dn4hzfCeZ3jPu5DOwsmEP8BCmERZ7sJy8B6XGD/kbS82yZ/Qljyp02pzEDSLsuIvfzalW0rxE4am1dHXeXnVXW4aC8MvL7f1CM18Xbl8twBi5dpyrVOKcxCIeDYjIV3rBlur/NYLILyB0VrVciufjdgCYcG2UmVbLkCwIEIqwKIICQG/A21iXoRFYfgeyhnmTOLvxHhIJticxr4BsSKicha9iemFuod4Ia3v6nMLIDZoz4fBznOtOIgN2hQbrlihb0LBlktMFsYP6WyU53Lr87ByLwcgkBIgpkZdFYDAQhnNIoCCdHiPCJnvvGcPk/ZkrxOiz0IXcTjGdSgYUBfEe3a6rwr65VdfWRzSY78V0Ajib/Y12f/E6I5N6S3n3BZAbNBREIgIzy2A2FidRJ+w34FmVKIGzFJLaX2qNDaiQ7IEUV1JkFgOQLAP+cEH75sxGgCANl2xDm5EKQYtSjTndu7cZVd5Ykz3T/7Jf297ob/4xTtuW9U26xf2mNB6PC1V10ikzqyhAQHOLUOZhXdYQdfpHQo07Fvu3LXTuuOOlG3+5E//1PLciP2z1mVaEYBgwIPsPBlYQU0LwsYHNi4+4JgYJt9cRMgZJo3SwDEBkYknSb/9u+ZoS5wRE7UDk4XVzmpqMaHeek0GjkwgjH3oU+53sImqU0s5/hrbAlRD0fPnlFfC0KF+z2fOtJt4R7+jJYR/qRQaBrQ6oz85XZXxEOqCZg/2FxhDcaS2aUpJvZZzpsiXVSFjByLD6pAjwGkTtKy4CIXyeU2mJCkloMaqO0t0PLcC2aUy2HLgNyh13VGtMlkdEpc0M+SPSiontvryW5M/9A8aUheuXNN1k5MiShWK7y9noV6MfWxGRmInzWKPkao6Bn+6lbZhDqALtREdYkbaIz5nH7OQywEICDgWypzme0cWysTFyIwnavc7ZSdFe54/d94UZV7StaKMwTNnvjGFgY7ODrs3muM1PvvsM13necJhcFemo985QgMuge9YP++WwRr3mnAXNKra9F+z7FkACO5v3nIJHETYpKaxaShc+M6E5MOACc8AAoRhIgcWjxUA6qWEw2YBf9hAwnMkwvTIkJ3smawOnNMKwIi//JnQMzJy4dTPZB2PjCHSLESxp8NlVtZqKkEwYxOK8HzngbfCEl+jmtknf0095cdNUPE4+raZHO2H4wlBWQuAiOoY7N+//4H0/rcZgeBYbojdpNRF0QhDOQAizQXpHBfAGTvNEgXAlkNsIf5chJOjuxE44prjBohz6OAB2bh02zHfaL5xq1e2wnBtIh1IHUn3yrXruj8ixzTiWDHa/QkKx3HgdpxCaYne66atWY1RAQj2GYgTOBIcA7Wx6Lirq9uhO4yv2NWOHKsNgHB3BXYOtCH5YDTHuMTm5sCBfa4iJou2Bl/CHy4c+uSzL22clQqwKspKrL1uNDVbX1XJkhfC06k658hQCgDca/c+5NowpT+D5lXIbjnEeDlhQ/rLeTKn1wsgoBnXrl0zGyfAgP2CGzeuu/379htxN7sSze8O3fPBJU5oNFJeVPQZW5FIxK7krJUVM+MTuy60MOEU9u3fZ8exc7YS46ZU44nFDgfzQf9Qt0d9+5VXXjEty+W02ZMaNs5BQMBbdAkLSI0KKqsuWC86BBVWGp/JzooOAMFeAaIBqoP6xOd3mIRMQCY+nYdqLB2XJeTv/eqPLiVDN4zphq9p3bOaWVljoJEiwBhpue7ScqVbX1TiZlgdym+09abLbdjrZnXmf7LSmdWBdYBKsvTv04vL3NSg1GbHddWo3qcXlrjJvi6lneuyq3e4lJy8GEhsvu5ba4AILRTsCsLv+z3DYoH+5TgOs7S+X2D5h/ALg0xoFc75NoAMltkQVsYbK33iQEy5WAeuJGivLZYW7RW4EogbvwmH4zvjmvG5kFMIYRaW60G/mQs3mmSMp7lQpXsmAAH8EDvxAeRIF8BF/g2nwCVDzBsVxepE0SgvIAeXwXzD4cd8CY7yGseBhyL5Gnk120cpe0j3Qc/1BAjKFcb+wjIm1jeEWcyPeHF/NbhfavnUgn/i+OANAMLhfxW6oxpL5jDWfKzv7t84QNAEGKrV1dXZE2tlkJfByXc2dL744gsDAlZhWFJjM9EiUAEsME5jkhAHUOE9mginTp0yIzmzoRC7P3T1nHEO/Wc+dxlFpS6nfo+bGuh1afmFbkbyxtScXJdRWilAGNdAmbXwWVW1bqytxWVV17mJ3k6XrA2kZE2o7Jp6F5X/yM3LLi1PoFZSIbAZNA6kYN9RAU2p51A2Yf+GCcCTPlhtDuJxmmjhZFtOWoH4MXH5kBafQMhD/fkdJvf90n9QOXiHe1ga90s70R8QtcuA5OltKvwR0nBDuJBHLEv99n6+fvMAYUBz46ZdsITo46mTx437ASRyNA94FsgYEe7Lc0hjIlypNh/37d0TBxXLdAX/rDdArGBVlpwU84uPSTo01sL4W3ICT2jAOEAwgWDTkD8jJmJFgx8aBbBfNBjaBHAXiIyMVRcghPdwFqAuSAxw8D5wHgDFsWPHXJbkzNE7zcY5jHfcERBUiAsod9HbN1xqfpE4Cxm2SXwwp46aFVik6PCsyd5ul7Wt1jiHie4Ol1FW5aaGdZyHxB4ZRWVusr/bTUs0lSFwACQm+3tMTJUpUMHPi5k2X+8FgsZzrQAi5Ln5WmvjlzgRNOhPREw8EX1x3hCc1M7Gerve1AiVuI0+zUPmFJwHc4gjH/I1J7jZD/HZaq1yv4sAsfFH0PqUMA4QDGBkf6z+AQkGKYMSoOAYDVY4kUgkzv6iJsZAYhWEOIkjLkiD3wxo/JAjg8iEYzAjp0YcBHHXmspNDUknWZfIMPDZwExK0dWSoLjETBB29ihmtBGq2aSwAyaWmpvW0eHKBxET+xkp2RJFsKEZHTHxFOmzkEsrLDZOw5Zv69O2j5VrINZrDRBh1ftYhd+K/K0W0JC1+UH7BoAIoPGtwDEP+j6ESfx+v/Ar5b+RAOJh9U58n/j9QW2x1HCkQVhc6Af7sUp/Hjevx42/WLXiAAGXEFxgr0JDMmD47mWoftAmhvEDfl4EEApKejRsSMd/Z0M5lpNAQTvXRvCDHxNJFN8HiHWOSRFjZ954IawCxd4pA4UNCcb89WDzyb+L5bXJHqENedK+ADYiBwCb7/gBvoDwWgzeTdZ8G7a4DNulAsR6VWKjAASLTcoSzsFa2B7MDfaWmBPQIyQW7DMxLxZztDsfpB2kCT0LjrT4BLoW/Nk0x488luPIB7cwvQelQV2Yy9RhuS7Ui/xYjAe6u1idlpN2HCAQCW0RmuU03eqGpWNxPOn8LYBY3fZeq9TpVk88ZC08OeIGRntdfmaRS5rVpFYhUkTcmOAtnd2uUBpcKdqH47hxNADZ+8D4Cy0xGxfa0IcgQBBZP7V09LvS/Cxp/03axjnElTmNWqg9xaGzaf4wt54AwTiH0PNB04gP2mYshNA+w6HZNIEIWvU5q9OhDxw4YHs07e0dJt5GGpEXM6bjHgcuFoLoXr9+zb5zyGejNKQ47w2woA3ZQyVvToDmiQSENuOuCDShaGMW0bQNZWMviIuDsK0IwETZiEc4RO2ohXN5EXUIInjCQmtxfKde5EeZORgS4KJc5MM4CUpDLA4Jh4QH4ES6wxP7DkCM9tCK2A7W5Bri0PdoZnEHBnlRB+rEB6UQXF+fbsyTwlAAlqgkNmjdsQBH2+udd97xZzFtAYS114b5swUQG6YrVrQgASBm56bd9Y5L7ldnfuJe3fuWK8/Yrjslml1dZIdLE0H7j7/4g3v98B63vTBHxmKcTjupSc+qdC6u6ouaZ4Y0/Sory11qepb7N//vh+7vP6cj7icGDEQsjiZ7jrSqAJjamm1GkB5WofUECAgsN8pB5LBb4MpP7psuKSk162oIIkepc5kPN7F16pj/cinQ7N2zx2whOJ6+pLTELt+5eOmiEUIuCqqvr3e//c1vXJFE4VxmBhHGD0LbLmIOoHD675tvvmXqrl988bmOty+QPcuoKej09vZYHyBahyB3dnjVWO65wY4Co726ujoTx/M+TSJwjPqee+559+GHH1ocCDMADbBFlS631AFcbTo6n71dgCVTH57YYxQoL8CFOyWwuYHjOab8SOfX771nYLIjEhG49Vi4oqJiS+ec9pJzpQXIhUUA3FHt/17SQafkgSo67ceFR6T9yScfG5hga8LR+Jy2jYr6UGxL4bzqZof1bQHEw6bN2r7fAoi1be+1yi0AhPgI1zfa467cPed2Vux3ydMZWsUl2YUxU2IHPjp/xe2prXJFIg5sVrPCYw+PVSTiDlaXECJWoNxdkZSc6v54ptkdaqhw2ele3MIqF66DsBgRQngwgHyYW0+A4KoAuAKIGnufI1KBztYKl5OmMbxEq4t7qHkPkf/p22+bVtczzz7rPnj/fds/rdWK/7KuBpgV98UtcSjVHDx40Azn0MjErqJS149iiAfRvXb1mqvXKhtNS8KdOvWpa2m55fMSYSafVnEdHG9fqBvlIiLKEF6MOuH20P4skj0MgMM1qS3NTUbo9+/fLw3P7e4Pf/iDcUGndcxHgbgKuAKA7sSJk7rP+rzuI2lyxSLOadLOBBRYxY8MezMB+ipVedD3aM4dP37C+vPLL790x9UGv/3tb3Un93YZ/e1xP//5z+xoEriGgwcPKY1hu2OHBQJ3laCOPilO5Ie6sY5xc/XqFdMyJW0AgkuvADXMGwAJHGk9NkBAzBhUPEG3IANkYOIfWBvYFtugVhg2ljGKQ2vJthA0OWzfwIr17T9sXiuAxYm/JT01GpvbODa1k8VGxfcw4gFjXxQeVi4Y6JnGlMqXok4l7Qc6y0uGfSrztzSjSFd5h/onqaOtvKoY35fjKJ/4RBsE1jYIHpQGhGE19yBmREgGolOua4ib+CSvULasOuNO5UqekIyUeoq1nspEJEmz8QexCX2vokLkstNcWV66XcsZj7/1xVpAQ8X6lraancOGxMuqU5Lm2X8FsYubWG2mChjgHAgfd/wgITnaH/Bg8o9PCjykSs51qGGBQRiCoghCf1p/4fkAt54AAfG8KjBAlIaFO8SRS5hY6Yfb5RCz3JX9Far3EDNWxtwOx6VhEF7ed3d3+dW8jCQbd+40q2lW5YAqYjziAEaslKlvpYADjUzurcGu67wIN9wC7QVA3JI6f6G0M7FnYaXeLiNQDDnhdLgQjfQqVR4u0+qWISmiJziSQ4cOG7ih+EP5+CAyG5fdFkalxSorIi9EPnzIi3JhJsDBgoBknYCHaw5Y8XP/DaK2D3R3dtW2KhNhcbMdnA4Go3Ag/f19Arta43jgLmgTAK+oqFD0b864B4ANbdXTp7+ydsRynPu09+7bp/rcMJEU4rFPP/3UAwSri0SCHog+xB1/PgzEMPDCRgiEK8jEYGnRdkK+Rzg6g0rROIRH+jne2eYmZfeQG+HsEwbyrPPqq5WMdjUwBF7+SjdJgx3wgGhODWEQJ2Onim0GLkY8VdkJGcah9YRtBDYROdsbmA33DH/TiFI+ANDUsG5LUxkwpBu9fdPSz9t1QOH9hCMdD2JKQ+Ww2cVbARFlgOCnSSUXIz7iUE5ACkO+8R7ZaKieuZFdbqT5qsssp6zavFccazcRfgMz0o05r5WlMIAlIKu0JjH+G9NVn4N9Lru2waUVe62y1QSIyelZ19w15i60jbj+YR2Ili3ilEL/+GZIUt9WXPnMlZz9yPXvPu4u73tdEzfFZWeo7KpLe9+UKymQnFar1x0lmW5XleS+aff2Q6jzk/SkX6dmtTBRnxrxVXsxT/Rr0WrSnn4usSk6qT6PCnAztACQtp/GOY40mchYgduwVNpwF+laVLmxCY01gXi25Myp9BHH2Hi9fQBlJdx6AgRtE2gK7Uj9aErahEVIKFtoJ/9+HhCJgyOdD0VEAcZDhw6JiyizuNy7DkDQO7Q3tCssaImHyIf8+ZBnUMzhNxwZbR16Foph5SUN6Jv1uzzVX5QTx54CF27Z3e76DY1knJAnABL6jvDkRRrkC72kbISnTDzxB0TgDAAlOJZs/SYcoAE4BJfYDqRNfPKE++RJGYgHICcqAfAOuk19yfenuqPbOAhekCkvQRwigc6or7LBQQTCkBEVAeFIAIRjg4d3gAzvEVeB+L5T/f0NbJSYHcStGxr8Uo8VEQQcUrJyTJU1raBI9hHDRuw5cmNOjZdRVinDuC7rkCSh9djdW2YMlyXr6/HOu5YO6q7J6WpA2UOMd8pI7+QrbrxbbBGNrXfkBdGfFtuWlqczd7QaGWkSeyggGRURz9q2w6UXFFuc2Umx7DK+43gP4jFJU8XeAgDTAhY6HiKekp3n8ncfMGIPyEwqPyzCo3dvixvJdsXHnzfjPVRwx2T3kV5SbnYcM1FdwFS1ndFuthypSmdS9dOocKkKO6sOg5uZnRIR0HfyxVo8szpi7b+aADE6Mes+ujTo3j8/4EYnZBEsWpWRKr377BRtpM643KlR9/3f/ju3s+OM6y6qdf/Pn/5bbQymuooire7GZl1rr+xgBCileanu6V157pUDhS43U5P7CXdT4qg6Rzq1atc91FmFbmBs0JVmF4uwQYRihEsUJQCGut6ISlKSFlZjzW586CPn0k+61k5k7iMGBGwScoMfK0Jk24AEc6tOK9TpL6+46DfX3NTrR91wLvcwp5kFekV5qc3HlWjuQIQN8FYgQYgQdAGiBe0IxBBiRR6BmK1UfitQ5K0kYi0QvzCI38jSWP1//fXXJtfDKprORDaH7A52AyAAAIIlNcfyRiIRAxMGAYCBzA90Y8Ppj3/8o3vxxRctfoYQOCqAwGIa47iSp1913Z/8RvYLBS5VRm7R202yghbC6XfhgRNuTMZ0A+e/tKM5cut1sJZsHAARCHS67ByGLp9xOVqtj3fpkno9OZYjOS1Dx210W/Wyt9d7AzqstLUi5wgOM8YTMMElTGrFP3jpG9liFFsczm/KEmcx3n5Hxnc6BkQcAOlifJclIg2HAqAhxoITANSGLp+VtfdZAdNLArNuew9A9H7xocsUwA1e/Nrl7txn6WPLkVu32/Ie72gz7gL7DfLFqA+jwIJDJxSvysB1+MYlA8y1AIjxyVn32fUh19QVFeusw/Em5lzv4LTbs11aGgKPjDndO35TdfnmY3ej4pCbful1rcQQf3CyKathNbkIIRzEbnEPu6p0HtMTwEFMazMZ4p6SdC/YqcYuOj3mBieHbCExNjPuMlMz3Pi0rKDTtEjIkGaSmqRnos/GYnFGoctM4YbDBA5iVhvP0zqbLDlHbej3Cyyw/iB6AnRwiFvYqEzT6nUuqqtNR3RmWaEWFOKwPYFl89OvPi3CY/7ZAojHbMAnKHpczZXVPpbUEHfEQrA4DBSIPJwCKI/MCu4CS2lkbgAC7wkLqwV4IGNDdhfYItgYOBDYvMBBwCGMtFzTKvyQOAlNIA1uO2tJnAAiFlbvEGdW7GNalUOIAQ3OYZoeHTKCPi1iC8GFoJvxHWyRwIPfcBOsyOE6sLbG8npam11p0krIrq3XhNR9xDqSY1RnPxngkK8mJJyG+Hov5hEosHpHZAVQwZEAKhwDwqRkzwFQG7xw2rihvN0H9ZQxn9qKeg1c+Mriw42Qd4a4CDgbf4xI1EAta1tElEBiJ+XL2VTUjzLkNu5TG+je5ytnVY88l1mz+hwEIqb+4XHXM8RZV5A2qcyJmKUk+b0FdbBLCZwNwkKxtrDH5mgPvWcMIQrJy0rV5qpWtxJ5QOhshah3nFOEKIbfYbVIHP+h6f0Kk+Mr1tPNaG+AD5g3PoNuuvTgk7Xa9ZW1vxJ4uNFpqTsmefFhRoo2ESVqIt6UQAVBRFqyzi6b1XhWHYsEEKkCGX21uUI7eUcu4TtD3n8nTnB8D/7mF48i6JqPGoI/9nMLIB67CZ+YBOIAwaTFkpr9AjZ5GCQQdog/XAKbJIiJIPw4gAJQAAAQJ4UNHURRpAVbSVhWNgE80uTPURsQSkAC2T9nMDH4ObnVREwQdgENVtLsLcwhahHhtIP3FM4IuVbvdiqsygbHgJuW+IbZB5DALTBzED2lwMZC+Bc4k/UP9JkYJ1NHfgA2lIHjOvjOWU/JEvek6mDBKZWFsiGKSlKe5pjAqs+0VPEQTSG+YlXJngNiJkDL9k4kSgPgABdAEG4FkKOs1J39BkCBPY0ZcROADocZzij8wLkvTXSVIfEV7bqaIib6u1O69xPKF/1u5BpZqn+PNsrQfAl9CJGfUH9wwByEy+SXInCUDbGIHRMu0JvVxqppQoiAQcNStNrlpEz6Gr1+QAC5LGkQloPvcA11EY0b36fmsQ5/IPJwDtBhSfet/DMCOhXd/CgSdYKzSNXmsm8vfL0jPm/ZhOYdnyBiIgRtjbuH6JvPxviDrJ/9jJUq36OImBgX4RMWFPy+n6Osie8Zr4nx+E0Y/AgX6jb/nfzm+yQxLfJMTD98D2FIExd+h7SDX/gd3t/PP4QL6RNu4Xf8cCGtxPcL/UN6FuER/8QBArWn4EIjUggyoXH5HhoCv5A5/onvQhr44UI4+64/thELIfUvFcAPRAtPnFjaEFe+m0vw9x4LGohpS3axcLFIiq6O8xmFaPNPhQVsiOc3sUnDE3jzV0gf36+O/TtPFixN8pNbWG7zpNyWvk9TFMLymU+fyLQtg1VlkPPffXvrh/lbW2myzmkArjpAqL17dbz36IjAVQ4ggAOwjVMV11QMpWHRLyUE+hQijnZNgbQ6IACAA8252csoAABAAElEQVQPQPAdgkgYRCOcaooqJo6jt7kbgnhRxePmr2HlaSCkBHZsrzGZugVexz9q9SXlnkj4lxRBgRgzpimmPGizjeLCdGOeJ87bxy3fcgDCtw0b1VO2oEDNcu/evVYEypUIrpSRMntA8/eH4IdkA02kbdu22QKXxQvpEB8NIuYSC1/yIj0kH7Nw8pqPYY8kAEp4T7rE4z3x+GAMx94QUpfgR5iwiCYuv0k/lIt80VJiYeWN1eZsgc17DPp4sjfDwpvyEpc0SJ+8cYl5BZVnwvOe/WDSJX3yCnEs4iP8iQPElh3EI7TeKkZhEOB4MlgZJKvJQfh80N5gJe81Yzy6zhMxxCJMRv6xKkZ8lLh48GqxgGhwfiJ5ggPR8eIVLuwhDZxNOKXJxEC0xT/ywZhoXgzj0wttQthEF/zxW/guMdxG+U55qf29tdgopfPlWMl2XA5AILJGxRR9fTSDkE5A8EijWgS/u6c77ldQUKjvI7oHZMxhMIakgzGIMdy1a1fdW2/90ObNGdlVDEr8W6jwLHzQRkKFs6mpycYk+66trXdM3ZO900uyoUDMniqul6tKWTx7Yp1itgpdUmPldF2M4YLkpEtEP0d7s1gmV+lmO/Ztb91qkQhee58i9FxM1SFLbxy0ljtVeAIAPaoTEhkObGQ+IMXhkqPDh4/Yvdmcos3lWNhqoB7Loamc9ss9FrQBi0zIBX3GkeXcnQEgYmDI3TyAyKO6LYB41JZb5XiB6PFcC4CQPEz5SDd7rEUiroiIvz/PBTGQraJEsHkiKmLAM5ABrdY7dzVoJ1x93XZ7z6RhAlJmNle5FKi8HDVdTUzFZUJExUW06QRTDHRKZGAEp4E/YqaWFnTCs2XtWWJ54I9jVRi4GQ84fkLgRxuh7sh3e6fw8wTYk2HAjDA+7vqSZspJ+6xvKaxZF/0DoVnJdloOQHAV6C9/+UtbgGDdDBG9GLMCRqsLe4dh2StgA4DdAteQQlDhFlhAlevyp2FZUyMVeOmll2xPlDtrGLM8sTNIlyIMXC32FnTCD37wA3f6q9NmH4ChHJbPlSKuX8uqGK1ORKr7RHQhtlhhE480AK66OpRxho34c7EWdS0tKXUvKu9vvvlaHEuNGe2Rb5XK+MXnn7tIXZ3DruLFl140GwhuT+Q+FZSDsK7esSNiqqzfe/11A6e//Mt/b+DW0Nhg/dXTLatu5UX9ibtr506BR73VAa6hQYD3kZSDjp84rmNIDlo5F+3oJXhuAcQSGmk9gqw1QMxJo2Yiqms0Rz53M2kvu7ZOqVfKYYCTow30DBFxVkMQ7MqKMleuFREiprtSSiBMqVZtgAHnz0DcAY1LslCFKHNDHVeVFkmxAavO3t4+7WkNCgDgKpJN/FQqS1LC3GlrN/Ya4MAQqbS02MrR1HzLbpaDcAEonqXmsELddMcejvwpB0QXcABQADFEABAOjmBAfFWhC35Md95SXfs/lA1wiNtNrH0RHpojC4H1AgjsqCD6EF+IOgSaq20BCpRjWNGzN8o+KUZu/QP9pjBTVVllIh8slQEIxsLzzz9vHAaEd0YLFEQ/Qalmm0RN7TJ24zgNwAXwYJxA2NHmxAiP+6npL/oKTgabA9pmTPunRbKo5r5sLKvhFBobdxrXAdEmvVLNgc9OfWZtzTjkOBC4DOrDyp4VPuUjD8AMjmVQ+7x2Ba4M8XpkYoC1OAQfS+wCgSUAc/3aNVe7Xbc5an4hTgomCXAsHLExJg5j+3YZ2UmhiPS4khVwelT3WAABEWMVySewpDQGlYLnYdOXzWCuEKURvB+WzxJhCPkWc2gwafnqw6tjjAdUQOTx5vDDKX0caS3qyF+aRogsYMFMQ0gbwWyAQ5Qe5kwrR/FNsynkSSTYOZWFumFnYV5MKOqcGM7ePOCPymd15Ul6yovN6VCftQYI4yDmxlUvWZbO5YkVp7/8XkTYsLRVr9qO/QKsWykjZ7vQ/+j9G6ch7oH+5zuTAVsSCDq9xYSH8LCfwSRHjROOBAIP10E6DHyuFOV2OVtZyR/Hio949H7QsqK5AyHDn/LprT3DxGZcUk64E25+C7r3CrguTkUx0RzlDX0cVuyJv0Ph8Ev0D/XhfZhzIexKPdcTIBgDEGMAHnCn7vQrexLI6CkbfvQ7/nwnLAAS5Pb444f4h+8Qbd6RHr/5DgARRgmYPyDEPdakw7jFkRccAcCCsRtjPSw4yJ/FEmJQ7ihHDGVll4gsXwshygXnw7lHHJ/h7ynX+UsqA46wEG4rg36HJ/VEfEQ5yZd8AA/Cs1/H/p6VR+/xpx6EYc5RVus7jXnmCmOd/IweW67L/xMHCBIicQpCglQwfF/YKWTDJgjvMRPH0aikwQqAy4HUoqai6q2fqz0oiIiMNF2JWTuLjZUGEidP4iDEaPpAmKN3WqTmWuVVVRkIYvEgvqiMpkvjCM0m1GO5Qc4IhuKag2Lg9AAYMFwDmFJ19ejIzUsWPrumzoOWBoPJ7lQHs25Wff3GuOIqDppMaBVlSN0W2wl5mhaSDUhZb493tbu8nQdMrXVUth2ozzLYIPB2/IfSsONEKL+IP++wug53cQMKZteh1Qj+E7LlKDr2vAcaVYF8cDwZLLT1au5BWGZr+MfXT70U67I1zHpds6Jb6U/1rJ3eyaSGu+EYBAg+75j0yNX5Tjv5z6xNeER+xOEcIBY6nE0EoVpJsDAiw/hdoc6hvBBACBkLSNLnGcAaf9xK5WeJrfMf6kj/UU/qtVnrFgcIBhlqrhAhUBRiz2YMltR0MASKytLRAAhH4FJpNpSQ+6E1QBo833zzTbOEhtCjYjpw/guzA8iujjiMvzKKyzToJROWSipEHw4jXcdXjMkSmlX0pNRPIcppumOalTkGbalSI4Wgon7KJUIzOhfIbpdTWGwMUEXlTmostFUw2SCUmgqq+EOWAmaRzdWlZpCncln6Uj+d7O81rmJO9UrV6ZAAAwCDqirlxyCv6MgzBiID57/SvNbk1so3Kgvq0udeN7VYwCdZYhisrTPLtgmYtFlGnaTSCjiN3rquZ75UWrlatcjNCfAwFqS8TH4AiSNDio8+ZwDC2PYE9MkFiHWev+uWfQAIxn93d4+7Jpk2ezVwWnBGnD/ECa1dEjEw7+CwSjQHIThwQYj5wFRECxxlfejgAZujzM2VclsAsVItufnTuceSGmLPeeicFIgcDUtq2DHAgN8ff/yxgQMAgiU16l3I7vzJgFdNFsgO+70Aker6Tn/s8vccMsKOlTNEmiMmIMYQX7iCIVk02xEbiJg02IsOPW0WylMCgIrXfuQ6fvu2GZ4BEkVHnrWzjiDMmaXbjKAj7il9/nWzj2CypSCikB4/4io4E6yt+8+cchzTgfEdIJK366B9n9YZS7niBrJrtDmk+63z9xy286KwcQDAKGOyAKP3sz8IxNrEATXq/Kh2Awju0KZ+GPZx7AZGcsPXL9hNd9hxAHx9X39iwAdRgIMAnAAIrK+xzEYMN3Dx9LoDRHy1uvnH9YaqAdyshpstqAJA8JsVZlhphgKzmubj/QUaCscBcNY3Cg9I2MpbaSLe8GKOlVvtU44tgAi9sfWMcxAMQCyp4RjgIhikcA2sYhAn8ZuND+RmWFGzYcR7AASAQMUM4EDex4mInKUUbW1GSOy6P/6Ny5dRHOcVcVAeox6CblbM4hgADOTxiHRSkDNiRCdrYs5MMotlGc8BDN7KWZyMuBvOVsJRrhQR4hlpEhQcPKHzla6ZqCi9qMTEVExIOyBQwMQhgZzvZCClFT1sPuIdfmfvkBGgiPzQ1Qta7efa6h5REWdBURY4h8EL2uwSYUf8BaeSv/+oEf4hWTynF5Va+naWkiYx1tvZVdvdpMCHc6OyKqtN1IRxHG2DdTXHhGCtTd0Gznzuik+8sK4cxBZA2JBa8T+s+IOYIQCEqfBqHojmyyb7Xkd4GF+c1jdxbpLf+mkcBE/S0mknceDxfhrTBJQLwERaIT3/5sF/NzpAIMWgPR8mW4c+EW4p3FUAa+ZAENnhF/qN5/0ccWizpeZ1v3Q2on8cICC0N27cMHERxJ/GARxorKamJrOk3r17t4EFDQEY0AFGoGOiJ77TWAAGxDXa2iQQGDH5esG+o0YMIfgzAiD2KDjMbkZnHiHf5zymyYEeA45kgQYAQhqER3SDNTLhcNMivhZG4iY4DMQ4dlyFNnWYFgsdHAQcC2c4IbLi/COOtqAMM2LvEQelaGUPmAFa7En401qVktoBsRbOxFGKb9bb8geoNCrcrEADrgXCn6Sw/tgQbYgrnWkd6YH4iTYD+BCV8Z66ASp+v6Nf3M1nrvSZ1+L50o44nvQFbf0k7UFY5b6Df+hW+hOAEH/gxqb8WVYAAQ46xAhO10GJuCmdczU57Yk+R6njCDoxpTGhd8W5UgrQtNBPbUxqrOjlmM7V4iTeNKUBgHDoIp+luvUECNqG/HHMGdrDGxX63/hzqQ0SDVRRCcMc4cN3nP/uZJCmOS/ahKQj1D7WzHHQID8cB5MCOGgXYRcBLeP0CNKEHkIHw1xMzAsDOxQrcBwz1NBQf095ST9weRZok/2JAwREPTgaB0dDhCffgz9+oTMswII/9i7Waay8lZAisGl7b7qEC3kgf7VNYnWlxaezSYPpoFEf4pKVxdFrVkiIbewb4fks5kiHgaA8fBw/mCxtK5v3Jyppf6tuli5p+PaIv7fs9Ic0bNrG/lLdWFkoH98tiEL577F04u2hskll1DSY4vF8GMrDINsCCHpn8zvGAf0JQIi+uyGdhHuuJarLg9AEE2et/q/WCbn1ldL8U3VbeybdtfYxC49HusKMjrN57Vxhboo72ShuV35jQojPro24cT31094DFId3SFe/UpcF6QBG0luKW0+AQA21ubnJNumxb8BmBCO3EtkWIL5mYfr73//OPfvscya9QJqBFAPJBRv9KMlgi8M847dpv+k985+wPVINBTQAAQh3S3OzGc+hEQSQTKIQo5bi0h5UY7nvAZVaAIk5yGGkLNQoGxbR5HP9+jW7bwItKKQtgA1xkLjQ1+SFZGYzujhA0PBUdsttjBYIwLlWAGGES3+EU7YyZbFq90HQHCJG+m/+DBFGCStbLqbhiG9WqltuaS2QCBBaithqH5CY0mGJvEvTkh/NXo5Kp1WjIvJjOk2XtYm1vTynxSkAMHAZeVlSE9b+9IT8+oZ1N4nC0S/B5WTKzkSfNPktdXqvJ0D0SskFQzX2OCHALbIxYEMe4zHsFl599TX3q1/90vZFIchciAMh51Y1bGsyZMB2+9ZtAwOuHu3q6o6Lw7EtiEQi7q64hKeeOqn2TXKXL1+2k6YBDmx4PvvsMwuDNTThubb0qZNPucNHjhhHcerUKcW5JBuGF0xSgup2s6yeGxt3StJy08CnUjYZABXW3BwTQl0o/2akr1sAEWbSBnuuNUAgroDAdAxMuba+SVck0UWZ7nbgqG8uBWI1OjyOnNU3VK/CcrR3o1a628vW93C9DdZ1DyxOIkDQmAAtoiGA2RBBBJ6+tz2KWErECY6vdIFsDA0g4DhIg/4jCUNyBSCMxdMXOIoMAQ9xQv8R9H5uPQECovzer99zR48cNSUZQALr5lShJiKc733vdfeLX7xjx1lQl1u6KQ17B8TfrVKqQeMLUTkLXqySe3p6XUQEmlV/i6yXkRpw/eb33/i+2e4YQMgqu0N3THMjHNeNVsvorL6+wcLTD3AXb7zxAzNM49gO7nd+TkZuABdAQNq1tbXGScDNcH0n2pxtd1plnX1EYJVvFtWJEpj7tf1G898CiI3WI7HyrDVAAARfXB92V+6Mm5iCVSsr1f07pIDQNe5ytVLNz051t7snDEgQgeTpMqEjkWy3p8Yb/2zQptxQxUoECNF0Xc4059r7J92wuAj2C9Tk1v7poubsG0yLJeA6WIABbg0w4JknDmNbMde6OgdY941ob08IAdhIgmL3Ug+N+ePVcwXwNaU6ODFdG7YK/zC3ngDBNZunZfnMaj4SqTPRULuAgUP2mBOIbsJ+AVqWqNizd5Cl/UdssfhuRpgSHyFKCjetIerhGtJLly4LfJPdM888Y1wGR3sQDxEWaWCkxyGS7D+w8icN2iPYbHA3NbYoNTXVArA2SwOxEvEIw4fzkKp11hNgwflMlAnjts3IQcTVXFdaxIS8jg6lgdE68KsiWeGqARMbisbHhY7gXSLS0rGkdb+NHtJNTCMx7YdNhI38nnrheIY2WM1NaghPhzgHHKIlfneKm2gQEPAdwsJq9WbnuIk89goUCMelQHAYT6KzsaXxxzlOLM3TUvz5VIvVlbCxHlM7+fbAz26Es1V8uE5yfg9idk77CeLM2nRdKwSe8CbWU0KIiXLUrmpy168b/aZF/YtydB3kJJyCrvNVvBMNugBLWXHj3w31CyCPOCkdpFEaiJvGJmfECaa5HeV+H2KjAwRzHeUY6AQ0gfkcAAu6wIf5ED4hjBpvsW65xw9LaAg5aaCNyQkBHBeDIx81tblwvlc87Zg//UO+PHnH/iLZkh5+OL5TBzgPGwekG/vEktlUjzgHgWEciEfl6BwqzO9gMc3v0Dl8D5bXoaMg4HwnPoiJhTWsH53Ld9JB6wAgwtHAAAefoDmAqixnipAO6YU0ec9KAcc7ykc+lCN0eDgDhTITD0fe5Ev4zeaoG45naNfVBAgmCmb8yHMxziLPyakZrap0L4ZmDu8x39coUKkk/9amJ2caoWES+ouy8s9PEE8kqYM/qE9aILF39H18Uqma+JMWNWZSMSa4PIj0uNidc6CQ9Ya0mMmmNSYPjkCAijIhrcn0B3EEiVFe/Dm2g7FAenagn8KbZoye6Qo7KqtlHMchcFCglVPaKaMTOvJBmmmjUkPOlh1MflaeAFEq3yoAYTxw+DJPzciWJTrkMnUHSbY+HBcCyRmUX3Qi6mqKq1VHNGHmAYJ2nBT4oqXEFa/BBUJFlfkeo2HhtYmTABKAWQ/dYkff+D0iAACCRPnIS1/FmXgtJjgPfj/MBYJMOivhIPjWp6oQfU/6PJmX5MFYwK1UfitR5q00fAvEAYIOu3LlinUkpv5oNWFJjYoXHUyn0oEQYDoW9ouO5Ux02LH6+nqTuzEJScvYPD2R3yFH5PgNdv7JgzBoBaA+C8t49epVd/ToUbPkxigPlo/8ODALhzEelxVxZzaAgLwRjQY+lAWwomyUm/d8J3+AijSC1bev8ub4SxvheK4FQHAE9522u7oTos/ak36G1d5eU21PSBXtTVtzFhMGW9z1gNUvclgOwevRIXy0Ob8htAADRBoizwVDubmyTo+dqRTYcp7cEVEkkQKH9VVVVuhIZ1mci1j3aVwxxjhDiTEFm86lQ4QvKSkyq2LKiAMECMORyT6NHvsNEDTU7XB3dHosIGRnPbHyY3mttq2t2eauXL9pdSqUrHjXzkY3plvkeqN90gzSYWwZ+cY50BujU1FXpvumGV/TAoCJmQk3Ni3xW1qO6472uixdKcrFQnbuzsSIy8vIE/el+aLb6IqyCiQy4niXeYAgnY3otgBiI/bK+pQpDhBkzymGwZKaO6jZFIJYQ2D5/cknn9iKnM0ZVvpwCGza4PCDOKDaBXFh8NfV1RnB5ggP0gVUMMaDaENECA9otGjziO8AEps9AA6DFOJB/oAUeZE2q2jiAEwABkZ5gBnySAgIQAUnwkmH+/fvt9VsJBIxYmEF3SR/1hogACHalvPyOXyM9sfRlxBfjjeGuEKEKRsrc8JB+Dk5M0+cIU9W79MCG4CbMMQJK0QIJ/JbfnOLHMtjiDbgBK1kzJA2N87BsUTV98QJXC3kFMAxjkXxGDOUDz/KC2BBgEmLJw71xmyBFecdhfzgkro1Pjh1ljEGiBCHwwEBIwNlEXo4hCAmIMGe8T43oVNvuTo0LVkANt7vSrJ0N/rUiKvN3mZhWbn3jAlIUzNd93iPq87ZJoCQ7Qxq3lY/DxDkZwWyJ983gIu1GfWGY6O8K+G2OIiVaMX1SSMOEEwKiDfEmMnG4IAtDGINJjWEGxERH1b+vMcPcGCVj54x6TBpmcSACkAAYedOaojGhQsXLG2IPGmTH5tOpMFFHfiTN/HJE+KAvJD3nMXOKhbVMQCAdPft22fpwDmwuiUeZQBYACTKgngKwraZHHXA8aROtEPoC77jhygNcFypiQzxNpGRnrHsjdKSPh+In2i+6Cw6/IECK4jKGegdP/iNDB0/S1Nh+eXTkKcc70gL5xfzpC5/5cNeh0+Ft5TJ+9svyqYvIZyVSn5IaPCzlwSUI6SVAm8rA2H4DpEmFf22cnoRldXN8rZX9/whLbgGUvU1E1jpWtIUEX7SAwR8/Xx/+VKqHQQmVq6E1PwYlQfV3GhOdaEJsDtaqeItFyDCmGdO26JF4x0bBVtYaDCgIYRdAQuE4Eec8B36RTzeI0mAftAH4RPCWn8pHjQC+wsWmMQJtIJ+Cgui8H1hX2607lvp8sQBgoZgRc7qHkJPg9DI+KM2BmFmRc6Ki46AMBEGx+9AtHgCBKEh+U0awY8O4x0dETqKNCB2YTDQweQTOpAnfnArDDa4BvImPqBAB4c0SZ+0+FAu/Mmf52Zy1A3Hk7rSjrQP7RjaeuUBQpuasuz1FrmsqufbjG9qRpchOTa0Fb17ikj5KOk9YRUYeTd6+mxwI2OPE2TIjv5DjLOkVUMavCdccAAEeWEARuITehfk8PLx+emp7nWZyoNRaHJ8heO9CmOBApH2Xt5mA80g0pqQ3B7tIBzyfNLBnsPim+/Wn5VqgeUABPMcYEA0zZMFKOAATYKI8/z0008ksj5ui0vmALQJGsBik0Ujm8+XL1123PnAYhbRM8Z2eTqMk0UtY5Z0oEHMJYzfiIfYm3fEoRxT2n8K3xFtsodKHOjKd8XFAYJGDC5MdhqL70YEYt8Jg1/wD3Ee9kxMc2HYB71LDBvKcb8OWqxMIe3EdDbDd+qK47kWAEFuEFk0Zq7eHZcG06QryBGVlqYN7yD2Edk7lOZL5CMCe7N9PK55QzwMsngSGPuIfbXZplGD3xfXddyKnlYXvSetOmnV1Er1Eg7jjqyFr9zVXgIZiUJj/LVD7yoLdQS8vDr7p0xLB+LNxixaO3nKr64i05UVoByhfareSdfcxbHwHnzwAyew38iRSmi6qrJrW5bZd4ALF1ujph46KtuO/Srr9tJ0hzoocVbbAZb+BIDVzunR0mfO3G+OPUqKywEIiP3HH33kKiV9ACS4dwRjN9qrokJKLqJTH338kaurq3OvvfY9U2P9VMZr586ddSdOnLRyTwsskFxEFIZLhbqk3sqFQqTX3Nzs9kgCgciafU0uJ+K+kjaprOKQNgwITCgzwNSnfTU00QArrvI8fvy47CvmT514lPbYTHHiAAFSblZiupkafKllXWuAoFysqEekl98vlcsJcRKsqBEVQcR5Zovwo0bJYr93SGdkKfyMfuhhYeEKiJclQlsocMmUppMUoVz34JSBB2mwqodDKZTKZrGOiiDuqNQzh6ISC+iYCFQ0SQe7C/LCjehoiegEqp6s9r22Dvsb2ALkZWk/Q2kMKj5pUGZ+ExOuBIJPvqRJngAM9eyR7QCqouAwQFio/NDMUrBVdeQH4FOujTrfKF/gvleiMZYDEFhSc5o013ti+AbHzE1sUzq77MCBg7bix5gN8fULsmZGSeGixNYoukDwSyWiZu7AMbB3CuFvk63D4cOHzcIamwquGGUPkyMwvpHNRa3CYTAHmBxSuOamJltonJQFNWBFe8A9cNc1UhTK9F1xWwCxQXt6PQBCtMsIJkSM74kuEE4ILQ6QeJAjHEHjaSYEpm6884ARyzPhPV95H/KC4OMSs+Q9zrh9vSBM4nv/9t6/9ytTyGstuIcAEAAc7WBtoYwTwQK/lVzBJ7YCaUPwaCtrQ/Lmn/9hT8Qr6wUQiFE5H4k9zUhdnUQ6qaa1RvE40mKfVvEDEgexr4ARGuJj04xUnWqk4ELcvHzd/ywAuXnjpnEiEHT2NyORiBsXoDRKYQYOg31NRNJff33auJMKcQ+EQwGH+pMeHAfxUdU/efKkiavI87vitgBig/Y0ExkHa41Iwu9B6JIhqZWu1h6Ez8+LFS3zJf6JE5slhv8uB6NbIdDAGSq/wyPDupDey8NplyAjR+SbCBor1WYQ/34dNQEB5PKhfBFTbqdjhY4lMf7rCRArVc+tdFamBVbNkvphxbNjv3X8NfcncFQ3S1eOwDbtCRkU3c+htsjdERZOaonBmT/xY2kR5lv3SYfAepI/eUKIucJUy1kZZ0kTRZteD3OJeVGORGfvtLllSzGWZUo/fg+2X6YlBr/vd9KhPfxH1xcqnwmpg2ZoEq8GQExJfjMwEnVnm25JJl8lK94MqaxKpVXgBMGIr5pUJVRTUSKgHB2d3fp0uYb6HWZLENoDNVaM3VinciSyV/PUJrfKj3Fby21/GVVpiW7dU5tDDCFOqJnyHZXZ4eFRyYrzTSXWDOdUFgzXMDhDFZZ4XGLfrvxTJXuqkHiBzUr8kV3zJJ32ji4RvwwjxKRD+dlshFCjqkt+qPeySsURBlC2MsmTcHzXH/WnAuhBe5i/fvCd/C2MpXD/PxoOFo+EuiVOaWm5berdyMGx4cjNldqwCPeJ48e0qi23Nrl/ast/g0rxjaZmAwPsTTjxtKZa8vmhEbU1QOXvFqcvllKfpZRgOSKmpaS3FWbtWiDOQaDixeTiw3c/eSbteyBITASIBQ7tIRzhYQuJwzvCEo7BxZMVESwa6fGOlRGDjzsRBi985XLqdtsdCBAWbnrjop9w1wNyg9kp6dHrfog5GRxxjzMTdKT5qi7b2WnXgnIXQxKTXc/J/h67Y4E7IrhNLlX3TXCEdpKAhDshCMc9viTCPdfRtlsus6LabpHjTghuirO7H2JEfVZ1SxaRAWxmVQ/CACxcMjTe0aYLkGQdq8uKACIuEuJmOPIavnHR7oLI0SVEU5KF+rssRFVETMKx5txLAQgYtVF+Vj7lRbvNqGzJssYdu9uiOun6VV2i5FSXufxil8nVpsqf9oQArpSa65Ta9tzNVvfBucvuz549ateiIt8lDxx68WZhLcLPiZm1NdVWjpvNt6Sm3KMD0WrN0C2sQCHiEGGcJ8ZebFEpogcos4pta2uXbLdcBLzTNh9ZyVZUeDVngKdL6WLIhpU8dhGMMTYQ7SJ4rXzhpliBd3XpRE+Vn43HMS06sJaukjYedhEBIAAFxiHh8vJzXaHEC4zbnt5+Xfk5ZkCIJTllzVT9CGvjVGlFZZgH4aTcE7Lr4B1pD0izhTAV5WWuQOVZCkFVEjGA0H4NY1bjqpeNUPUphoK2F6g2q9IBcrQH6a+k8/NaCyI59oMoM30F9vE99B/PpdRnKWXbAoiltNLGDBMHCIg58jcIPsQfQo7hGpMOmwIGMAOG96wesTGAOLE5xCCHkAQAQK5HONTGsFfgHenjv2fPHpP9zer4gqFLZ3R5jy7oEVE14itCzHWcRjT13VbjmlHcwgZ4cD0n909zxWdW9Q6Xp2tCh3WbW5LOf8+uqdMFRTftWlOaOrOq1m6S4zIhborjnmjuiOYmN0Ajt2GPG2u/YzfMdf/xPbtmNENXn461tbhp3XedJeAgrN16p3xnxkatHNN6Ut6JLlnm5uZZGQCZoatn7Za5nB2NblBl4lKhgr1HdCNdp8pc4YZ1lSngk5wqIqW652xv0D3U3ZaWKmqXJc3CIZToDHwROW7ZA6C4cCi9tFIbwlrFFpa7TMldVwMg2Ige0wq2q3/IVRTptj0Io/qLYy6QUZvRmIgGHAXEEmINwYSoQgDQLmEc+JW4XxwAKKisYlFtxEcr8wy1Ad8hVBBYiKAtOkSgeMc4wZEuxBhOgVUveakYeiocBDwGPuGeZgCMMqFxkqL+gYMgLd4jysH5caizihSX7wAJeXBGD+WEYOJPfdkjUEEtHmXFj7Qpuz/2Q0aAKiMOq3HS5N3DHOUnPdJfGJ46LuZnqyJKsCB9axNluND/QWUgjs///gBAf2xEgAj1Tazfg+pu/aY2e1CYxLT4HvJYLM7Cdwt/h7Tu5x/eh+fDwj3sfUjnYU/S4UOdQr0Wpr3wd0gzDhAESLyTml17AILJj3Uz9hGclQ44ABoQf4xV0CFGNQx1McKwwcN57oTBH/1iVkU4NoY4cgMdZDc5bgDBXdF5uo507E6LVv068VCTelrqaFNDrJy10tM1oqzYubaUlXh2Tb1xCna3s4gLVIPrPdN09/OIVu4FB04YgZ3SVZ9R3RGdqpvquDIUMU96YYkRXbWSgKHCVv6IcLgSdPjaBeNkxjtalZaMcARKnstoMW4luzqiO6dvGJDAKURV3vTiUgvDPdR935yyG/Ty6ve68Z524wDw51Y9wGzo8hkDwTRxHOO65zqvYZ8A6rYRnhlxSeMCK8Asg+tMxQFl1URcdm29qifOquOOGWmtJkDQP4wBO6uI1WPsN/60l1FmfP3/ewYa8e438Cx+wp8QDq8wgRNe35OOaKmVg/fKgr/6MMgpkv7goxd8cMHPfsR+J75PDENYn+R8fIsnf59ySGX+afkkvE/Md2He87Hu/UZRFwIE6YS2IJ2QFvtP0xob0zryIzU9W+A1b18EYAO8MxqLaQJWuIDgQnqAXhD58Q7RHvN5aIgN2gJT11yMQ9mIAEH7sOhkcRQ4QeoJPVqsDrxDZZbFLgvZpTjiYGtBHBYKiY53qLqSX+CMWUARjvIE96A0QhiehKMvKDsLm4WO+lJXuFzKvxTAThxDIT36knwoK+mEvS0Wc6TNZj+O34SlLGH84X8PQGBJDfFm5UUFAudAg1BAjFbIgAaE+JMpIEID0VC8Q3eYozWIg1U0HATpABjEr6urM2CZ1Up88MJpv8LWCpkrQOEi/HWcWjFqtcZvpiuEeEziIH7DDUD8uc4T8Q7+TALuu54Q4Z1lVafVGdd5jrWL2GslTvwkHY0ASLA6JzxEO4ieIN6IeEjPOAy9ZwXPFagzalzuoIYL4NpSC8e90pqYKSLocxIHZW3b4fq+/sTKnFW13cqH2ClLoDLR3e7SxfVE4UzEkZAWV5fCrVDeOXVMmsRqgAKipDRdSWr1E1eU27DXuKhRAR0S8qRicRA5q8NBMBi23Oq3gKZVHCAAOyZpb0+3u6E5k5uXK5XLHaZOOSOR6u1b59zVS6dc1myay9ZibHvDEVe5rVEiyHHXKxGn7V+Icz3w6t91tfW7pSKcaiK4GzpxgKNnWLA1NDZq7nFlZoq7fOGsuyqx7o0bN12x7mb/Oz/4odseqY8R2HlYXE+AAAQC3THCrwYzDk9zGn+sqClfSXEJKwKjPSYWFGEbligyVXQHOkSYd9/9ldlGwE0CiIEosrglLewioGUQYt5BHDlO6IguB4JwBrCgHCxur1y5LDXXA0YjSf/ChfN2URBlJjw0kzTx50IhwIRTIvxRNRKH6h15kJ69E+1MFq2FcI8KmPJFeyHyjAnSRL2Xdxj8QWupJ3SW79Bc0qCMGAhCsy/qngq+UxbqBy0mrc9kJ8LlSUVFxZ7TV9qUA9oNI0D9aVfy5oQMFv4B9OIAQQZNTU2mHhYqS6OBJhB80JjjMkIFeVIIzmsKhaLiNBKVs87VfCNzKkaD8qHzeDejK/36vv5YnZxsq/JUEUeIvsn4YeW1WmIFpT/+fmoRYgaE3RUtP5xt5Jq8XqIb4rJnIfGQMvDcgVZfpMnGNXsPiVd6WgKWhsqlO6opB2GViH+lPFhxsVcAkJC3WlCvtQ8S0lJIW6FZfaL6of/kR9jwCWVVO9jGuNLiFX/gjELatvEey5+9liTJ10kLQBoUgKUUlLg5fTI1YGhTOpPBwgBKRHxf+Ef7S9/FivtoCWzFum8L+OGAaus8QNCHHe0d7puvPne/ffs/uZ0Nda7h8LPu6RdfETHpcr/6xf/hBntuuRxXJe5y2m0XCJx4/s/deF+bu33+G3fhm8uu6+IZ98qP/1e34/BzrkQE5sqlC+6XulCnp6PdgKFxz173/Msv217P2//lr13m9IDr6+5w/dEp9+Ibf98df+olzWk0pub3OpinzNGVGlesYKElpAmdIX2eECHyCLSC79AZ7BBa77TqfK88W1i23vEKDYi1b9++5SYlCo1EIkbgxrWPg4SitLRMgHpL+0VR99ZbPzTa9M477+hstjqjR4gpUZYoKCh0r732miQeX7tuGeBVCSw4oQEaxhE+b7/9ttqqwr300stmsQ2biX9Tc7OA9boZyu3evcfUaTHAq6urMzVbiPW2bdWuU/QQOvpP/9k/s3q9/fZ/FUBkuhNSkQVgaIvy8grVq0ALg14j5hB2xLGHDh7Sfly7FtKDdqYcKrvQ2Z27dkrdtsWIOBIarkUlHSzD0TxDpReV3J//7Gcm2WnW2XaU5/XXX7e2/vnPfur2CdggO9S1XPuAnFnX1NRsihsAMAuIHu350ScvvPiiLS4YzHGAgHCHAcETYpHo+B3e478wTOK7hXETw8bDKb0QTtmRov33fD+/ExwBQnl8YP8y+PEr+Ac/0gxVCO98rG//DXG+/cb7hPIlhluY5j3viGaR5lNMfD/ve99voegGgiIkgAIybzp+dQEi5Hzfom29eIQWYNz7eeABguHDAgsi8Id3/tYNt5x19Q07XVpJjTv4wvfd55//2l04/75GUYo72viUa+0WN5yd7k6eeN5Fh++49o919aUUCvoHR9wLP/qHbsdLP3JJU6OuTbYCty6ec4VOezgyeR/RSbPbGne5l1991X38wXtuvL/DTeoI8hHtUz/z6g/cnn3HXHGJDhpkcRJz6wkQrLI5SoPVLfTh+LHjtjfarutGWb2zIuaeaPaumpqbRLBPmJi7Q4R137792hO9IgD4nu1zvvvuu7aKLtWq+Oq1qyaG45ieCq2aCccRQqyqL/239s49tqsju+PH+IXBNoRHINiAf2AMBAMJEN4km2xIQ7ZJ2iS72+5qq0jblaqqVfNX1apqpVatKvXv/pXu/lFtqyYbQrJJSoAqgU2gCa9sMOZlsHkZm4fBGNv4gY37/cz1wPUvDmAw+FJmrJ/vvXPnzsw9M/d8Z86cc0bbiq5evdox688++0xMUh4DNOLGYC9fIFVSUiJvw6PdNbOPlJhrldZem5vZB3uMY9zUlW1Pi4sn25bNm+2VV14R088SQ/6tuz9l8hRnnIcj0dnyH1etspctW+Y02XjXQo36MfJjs6GTJ07a9373e3ZMu+Uxs5ggwOK7xzYEZY255eXunQFZlDAwEOS3c+cORzMG7Wx7ytLAKCljbNmyxfmsw6u2pxkzD1wrAbosAzDL4pk2zU6wYk+lUq43DJmaq++M4dg/BTx4cmSkCSi4j0MIf7cAov+ahNjBpADjBNoTgGDx/LgA4vOP3raGKrmK0D7Jk0rnWN7kR23zb35tu3ZuV+I8WzJvoSzFmy1//Gi3J/P29//LDm3eIDcQDdbWk2lFM2faI6tWS7trjMSgjdZaf8ryO1tkSd5tLcOkPps/xn7vtdds17ZPrf7YYa1bSOkkI9eekogppTWzseMna0SfDIBgpgHj9gZyqPqyvkn9YFoimx3XLII9o1kTwFq6UZp+zBDOnj3jgGX16uccsz9wYL8bZWPs9rA0zVingWliYHdae8wAGuSDaAr1aRx/nhBzZjSNSJyRPaIpRHXMCpjpIFqvlxV2vhg6Pp8Qo2OFzeyB2TxrsmjMLVy0UDXNsDox9ZbWFgc0zIwYobOlKeJ2wAZAPHWq1m2JgCsPZiV4QF68eLHzSt0taQqgw37X2RI7A1SIjthDGyBnxjKjrMzNIo5p5tChQQflMcMAPJHesDc278naE7OEKQIFeAkirOECWpYBMBJ8aMxDiu90tEPURLg2g3DqdfTaEBJBgQAQiWiGQa9EHCBghrViKJU7ttru9W/bs9990h559Amtp5XZMa0/bNrw31ax57hN1wfNQnTJjOn2gz/4gb35j39v+7Z+ao2SG6MZVzRNI8XUZFvz/Z9aR3OTHav8WkoPJ+WqJNvatA9FYcks+501a2z7ts12pGKHGGKTTZK4ClHW1NRsyb7Hi/lF2mO88FDOIABPyveSBq5RBwYgEKmi/QUYEGDYxJGGNYLt2790AFBaOsOtLRCPuJsBFSNwAvnyDAyS++TBfZ+XS6R/iKN4FqbMtxidR7YzPBfVBXsZbGmi9QtfXmSDE2m1IaZmTs47kQ6AoCzyjDT8urTF6m4BRYsTXyHepz6kI5AnTJ7yOffacuTJNWm5T31IQ0A0D41YX6Esyo4HaMCzfvAJ10dUTloCMxN/HgDCkSR5/4YCIGBedDxftv9IHXV08yo3FRhHkJYO7oZ0iuvzDDe5R1p+0am7ftD/QRo+TqdGK2I0Nl60wxIJbfqPf7UlC+ZY0aOLbdKcpfpIuyVT/pV98P5GLbyOsOJJE2xaL0CcqDpsG//z5/bJx5tcg80pL7MFa16x1/7ojyWHr7Zf/uJNqz2430bm5VjZ40/YK3/4Exs/cZJ9tfNz+2zj+3ZUsvTFTz9nT313jU0VeMS1o2ifoQSIB71/JO39A0AkrUV66+MZLkc/UvAiJj5gfowaBmuRGsd25y9dsTrtj3yiocPGaB/jhwuyrEneTvPlpO+yHOm1ymle7yDDzjbJ6FGO7/CCirfUY/Kk2tzWbbOK8uy0PMHm50aL8Y88lG1jCzXCwXV3CA5YPUAAwLTjWcnXd3/+P9pUq9QeLplphdLAg/Mj+jgoWffp+jPuXvHkYrcg2y45ce3RGtu6aYOTH696drXNKJ9no8eOc0aFhw4esg0fb5Rl+Tj7zjPf0drGdLeR02mVc/hghe3bs9tSUsFesGiJRCYT3ag63jSDDRCstdB3GZXebJE6Xo9wPvQUCAAx9G3Qbw1uBhAwGQCCaWSfkX6/ud08Ek+qXx9ttePnOp2XUzydMmMoE8M/ca7DeVbFS2ud3GpfbO2yorFaKNT1BAFApzy4HpH771EjIgv60xc6bfaUPDt6WrLUGSNtltxpsz9ECNHMKw4QyNEP7N9v/7tNxp+SYa9YuVJb6s5yg4ImiR3OX2i0OnkkZW+CUmk5FRUVW82RKtv0wTrLaJKluTRiUP+etWSlFc8qt4rffm2bP/3STpyUiqRAev6CcntuzTOyb+m2tWvfUTlSx5YIoqRkmr362qu2dOmybzRLAIhvkOSBjQgAkdCmv9cAwb4NtZo5dElLAmbOdf1FuVieMsK559Z6nBMpHTjVpplEtz2ektab5MHss4C4pEl7NJAGUOnEbXf2MDfLmDYxV+CS6e7djNQAnX9vn7a/OH/vhkfllURIShcxoVmCtg1rgDBmZM/Pa70AH1MntRiKbH3vrp3WKYv6PBl6vvrDH9o//d3fWIPczaxZsshKtPh68UKDNXRl2MynX7KdMlKdWjRJC7FjnQuRai2Szn6s3C61Ntmbb77pFjOxdXpGqp54J2WRNz0MNUCk9wFfP9pT3etaH+lvYAT4Epit+L5DfhEoR3Hp70c67vtnXQb6x2yHOF8frn3weXPtnlfb4Y2A4MvmnGf9L36PZwjUhfvk7eOI92XGyyE+PVA/0vhn/XPUwZ+nPxPP05/H39/Xn7h16zQQka+bnrBInU7Gob32jcuRHwtQcRETjTeYMwgV4TprsxhTFKJOlzecxTIYd++iltKhM5+tfRtYCKNeAAR10Q1t4KL9oTVaZeGM/aT5DtyzQg7qTFo+I7/nMYtsQhqJoK7r3WPNTSLf8ckD9T7P8XH8x4dFIgyNCCwA4mIDR3tAA+XQ0fklKUBnTweOqCRu3brV2QdFuu0FtmTpUquXf6mz8tHU2nLJPt203lovnrMn5j9u85Y9aX/7F39qi1PF9vismdYmdyXQ52Sr/DqNK7FuuXZZ/Nh8zSwLNdOT/YG0YLplY1QtY8t6ae7AiGpqauyNN97Q7GGpm4HGGR+0Smegd0o/REy0D+1JWeTP0S/YEk/wzIo+Qb/iPn3f0UtpaGvOK/futTJpbl3rd2pv0tPnamtPOvsPZtaUQZ7QFfVSNJDwnHtcrruLpEGEGir3eQ5/XxgXdkoURl5o+qDJg2YQKrWomBfJYM3Xk2d4J/o9P8SBqJCy2I/WE/yUumPXcUXp2DcdjaUZM6IFdMqlb6JuukvqtMuWL3cL6dSZ56gzZXAN/Tj3tODIsxyxa8B9Ee8LbaAt6qvlUoX19SOd/1F/6Mo98iB/+ArXX2lvDAYP0Am7EPoJcQEgXLMn6x8NSvANy0dDR6Fx6QR0hsEFiMhi9VDVEffRjJHKG07rcKoHc4ah85HQoehYzveSxB7duHtQXVD5Azj4uNT3naoeHwHpsSTlA2HbRry38jzpeAe3GZHSdOs+VrBogNBZUQEdqzogYkGXG31vPJ4CSrw3aagTTKNAHlDPyLlfxBS0XqKPCzfWhbJMRi2Q8m43QH/cWhDI53bmJb4toQfNynvD3DjClNjPgPfhPkwJw6xT0uuvl7pqi5jKNunVVx86aE/On2tLl6+0f/iXf7bFpVNtwbRpdvlSs7WrHS7IFce4mY9bYbfWf6Bjdp58a8mJpiyO65ov2wG5oYFJwrhQ+1wuhvT66687RgDd4jS6WwBBGfQHDxAwPUdTOowC7w+j3r17t+sH+fIagAPDiDYm5lrmVFrZmwG1zZaWZrcGM1k2BtgL0BcOH65y9hJsPIRfsClTJssO4byAuN6J06DvBx984DYQApwxNHtCKqWUgUYZzBLGOEr9BtuwCnmXmCkGzAZD5XPmaPOhOvdNlpZOl5roWbcGOFZqp7xLRUWFe7dUqsRtVIR9AxsQoRbLTHGE8kPdFhCh7WfIyr1O60KI/ebNf0y73k208WLOvJ8HCECFAMPG0M4bxxE3Ru+CDQN9BDVdVHJJh/oqNhXQmb5HHqjGYrfBd1WkGSbGeHyzfEv4I+MbRh129qzZLv1i2YtgV3HqVF0ACIidtOCZCkd+AER/MwgsLfmw7jRQBowV0QY+fnCI57yhtrS6zgzzb5fXU7g/HxV66u3tnS5dBApieMqDeJgoHzr5waCJa1Y+dM7x48b2go1GVW7UJ0eOWThybHOggoUp2lE42UOlr02gCMC4zq6XJM656BaD5a15d2iANSgqhTAgvK/CgCl7pOT6fAi3G7quyg+YZP35w/P1u25MOpD8mtvl30feebPk7kUkugYQ0BxmgI8zPlSYJfr3ixYt0jtctkMH9tpp6eJ/8unn1ijaLywush/9+Ef2y40fW1bLBRul2UGu8rwikeDZ3JH245/+mZ2uOWot8vElh+bOPXyPwLVgwiTNRuqdTjtlAEjYA7z44ovuhy4/8T4MNkD4ESptFQcIBjvE+f7LEZcPO3bskHfgqc6auk39AtuAkqklDqgZ4eIgtEh2BzBBdoRDTMbsKEd9lrqnSlJuVobrEtJhaHZO+v/YOWBX8cknn7jvaaryxDL7+efXOEeRPAujZBe5ItEa8OY3f958N9NjgyE8/14SKE90thHVskGY6UbwDXKpcey47BAEMBjaMYDavmO7M4ajb1+82OhmCGVKzwgfAFuodj6l/PfJUI861Ch+vgDlK9l9zJ1b7r4HDO0AxjNnTtsxzWZK9G4ACZsnQcvp00udBTnAxXaojZqxVFcfEU2mulkWMxQACuM37EQAJwCD8pkpZGtABsCyDgbIUD7gMUX9o2JvhYCxPgCE/zCSdIR5EDjyiwOEG3mrI9NBBgsg/LtTFusI6cGptCqSW75u/aXRNx4xwd76p6fx16SDwYs79L6jv3P9KB5PAhfh5bvX7/Y9ixiNp1faPV36+33v3PyqXUZltU11NnbEGCvMlWt31Ze8bjUw+9h35qCVPDTFCnIRO1wHCPLBCAyDLD+a5rhKrg7Qhz8mtxl73nnbNladsAlFxfbsqmW28oU1YkJtVvXlZ1b5xVbr0D4OhbKUnr38KSuXCOrwwSrbrxH4RPkV68mW51ox1MllZQ7I33rrLVu/fr1jUIDQyy+/bC+88IJjXPF3uhsA4QcRABH503f7AwgGFocEYDA0fEoxa6ZuAFqdQKBUo+5Dmk3hi+lcg3xYyahuRqnENhoIkC8jb/wLYfwFQ2d2BGOESfPOzCC2bdvqXG5cuHBezZhhT8kVCd8RgW8Lp6WMuAEdDN0QLVHWCInqAAwGTzgdrZebFEbwiHMOHjjgwJ3nC1QultKV+yrtpZdednliIT1abj4QjTEoAAjpSwwMyBOXH+zNkSefdDBw6IXtBgZ1BAY7zEjwyzROg6yaGg0ElK587lyX1wW9LxbaABVl4XqEb4aBEu/G9eGqKmdEVyp6UW9mGoAEs3uM+/BWzOwVLTjicOHBbC6ImFwTJOtfnAlz7kVMdBo+BOI8QAxWzRHzX5b2UocWqNlrmsC2oKiostdzjpYZ2HOaBewu3fegQTrS5Lg0cqqmNNxn72d+gAAslR+5wvgzlT4vO2K2aFBRpl7JBSV3achvuJgcKriXOyRfVf0Y6F5L15ufq5/yy1X92mUr5PbKVrnUgZClAtHAYo9sJbtp6OqRkdRVycCHZdvZy+ckx5evmkyJQ1Sxbt0ryNZsQi4sVGOXl387QasbgTrRl0Uj8uYr8vOlZCNky5CdNoOA8TGC/VwLywf2fqWF5Tx7TK40li5bIVHQSLnUkFz8aJWdOY+TzHxLTSu1cdJagnlgWbthw8d2oeGsLVvxpKywF2t2Nl6uEjTCFVO5rJEjM7NCMZZ8MSzq3tBQJ6ZW7frPsJ4r8t8zy8Y+PEX3VFeI3hsGGyAQ3/ADHDxAcOwPICgba2DERfR53pVAWgIASl6Ih/ZI/o5IhpkB74cLDhg0AUO3zEzWB6LZKd8KKuEc0RzjiGYYI2pESVz7wCyA74u8qAOBesFUASxENLnSHOMcBs8PRjpJDJV6k9cuKRZQ3ooVKx3A8R7MZDG8Iy/3niqH9/Flwcg5p1+Qt6cP53z3/puHdgAps4CpJVNVu2iQRV7Ulx91gE4+D67JhzwoByAljrx4Xw+QiHgx2tsrcdkCzUg++uijABCuByTwH41J4Eij05B0FDouPxqY68EIlATjP9/cbYfPqOOLqbbIrmHE8GE2Ki/TJo/LdQwW5r+/9rIDCuwgYN6ASKY6dVnRcDFpPSd7CewiYNReowkQgFFmaXEbXjQ2X24PZEMBWyJ9tcpslnbUCNlckB9h+oThVpg3TAzarKquTekk+hJgEPAzBGjpW7MxI6O8uAbAqurarU0PtQns3EKm8ls4faSNVN7Z1/mAy6e/f+3dHdbSJdfOmTnWIZl+QdZIAzQ6rmptpEueNAUcI7I0YlUcNR2WES2G0k6dSs9Hl5epTa40e+CZkZly1S1wINCkEROLXEv/4uf/Zht+/Y6VT8h3z53rHm7ff/1ntnLFCjH6s26Bs6dL9ijNjZYltdXUtFny5HrWdkokcFgO+3pUh6takF60aLE9s2K5Y35upCiAoD4smKZSJSq4w47s+cQ6Wxst9ehjWjyt1ztlW8nsZ6UOKw+jNEpvgHnxDvFZhb93O0cYFf2X/MjXMzAYGtc+DKQ8vgWYHIyNfPgW7maAljB56gsgpAfuRe0atS805H0Gy04pvTwPMrz7QOiWnk9/17QP74KSydp33w0A0R+RkhBHpyRw9ADBB0HjEUdn9R3Ep72TeovniklfdQZvgAU/8kWffmxBpuToWgDWSL7hkkYpYv4w8mgmEZU6cbR2Y9Movbld22k2XRGz7HGzCpjPFQ3/WevN0X3eCiAYVyi5u+61Ks+zSu/ESLpJHPljZFco2wrsLBqaVabyI16vrzQa1UGfngwrEIiMGilxm8CDvCgb0AGsKCtXZU58SGsqOt7qcoQg2AFAVka0ppJO164ejdIEDASAIgoApdwv6EUBFFguaXw60rgqoWlwmgAACU9JREFU6z4MpbKy0v76r/7SRl+9ZD9ZPt8xnvWVki0Xz7Q//5OfidOwEK/yu/OsoVFg0XNZ/nLG21ebNluO/PNktGq/AzH3mktav5HPpVefX201EiOwpoBohXBMcuspMrDr7jxju9b/u+WIcaUWPm05E1N2/OJliRSW2rRxowRg1xk1cnja4E4Zj3+ed00HCN93PUD4tK7S4V9iKBDsIBLTFN+siGf6HP2U1E81iYvf96OXeFw8Rx8fj0s/h5nCwGDALv/eBDBjRuLiGb33r69TwAQJ3HNpdE4+iKjEy108913ghtLxDFINZh1cUJ4TRUWprv0HgBzf0nOIl+J1upZIJ+n1Iy/yJPQWoRGm8qLgAQRESJH46OYPpaflmvBtz9NeyJdZmBye2WOTtIsf79ckGVmHQGlKcZGrM1vddmukrx6gHzMiqUY2Nmk7XYm4ujpdKZ0CyR4RdLQ0txAt0UfoLzDliBFrIbujRXutSCVWf90SkXVkoOmUrbWOUbJ6j8RnN3/Lb6aIM3Z/Hj96AOBJzrl3vV7XR7/+mW+WEGKGkgIBIIaS+rdQtmfsfFRM1dMBws8m/JEsHSOF08eCzycWFU6HmAK0GYwcSPUjeEAVcMGmI0JXF9Gnpg58aN5ewHNNLcbrmGxvu8fbG5DkOppPSdvM5RalRzttoMDpK5PO1P01R//zoOCPxPvZhJ/9kp9/1ud9oyPPE/oT9fCenq7cjwNUep6khf7xuqWnSb+mbJ7h2bhoK71OPk1/daR+fo1kIO+dXpd7cR0A4l5Q+Q7KoCMS6HB+MYm49B+djuDj3UXsn88nFhVOAwXuiAL9MTfifLw/jzNg4uKyfJ/GV8Qzd/qrv+fPfZqvpfmFxo5TqWYqquDTsNsazJpFXLSZYNDkw/fj86MM1ix4BvsGtJ1YqKae/juKAwvpCOTFAjdeY4uKip3NAXYHBLSdciX+RcNIFLBaXaOyTL5APgEwJn/ck3NkfYhF8iSHABBJbp3eutFB6eDMIFiD4Nr/SOLPOfprdxL+BQrcYwrAhAn+6BmtZ84cAQiO/Y3w0dtHvZW+jkoquvnYvaCG+bAYKvcvSpsIVdIGqZ6SzxipvOKSBCPAL7/8wh6T0RlM/7zUWCkfZn5Aaqjcx2YCQzj2YoC5sw7EngvsNIdqK1plnKPhxGZAhHOyw0BrqUzqwtXVR9y2pKtWPemsrp02kICjQHkzs8OOCA20muoaZ/hJeQzs2rWgjiorm/6ck7oqu7rNVz29dpYrKIH/AkAksFH6qxKjIj4aFh89IJAu/dw/68HCX4djoMC9oAAMmxA/pp/Tj4mLi5h83XBN8YX2UC6Wvj+2DGx+A/OHeWMpzMgfLS023UFDaN++SjkxLHU7szmFB21lPHt2ZA/AbAJQwVUGQMCGOOXlc+03W7bYnPI5lkpFO8Nh4UwZ1Ono0Ro38kcllK1BW1W+t5j+fe0SV1d3Siqsu21aKuWM1/x+EbyLJg7axOmC29MZUKBsAIetTUeMlKW73oEZCO8BiCxYsDAAhG/4cLwzCsQBgpw8AKQffSk+3l+HY6DAvaCABwPK8ufpxxsBRJMW7jFUwxdSZeVeWe3jB6ndudZg5M8oni1C2R6zqUl7aVQddpbMGJBhIMZsY5aM0TBEw70FBnaFMhY8LitnXHdM1ogeGwqM5JYvX+H2vwZsGNlXVOyRId4MGdW1OvEUFs8RSLQ6pj9PRmmNqh871WF4hnUzsxBcVSAywgYCtzDMVhBvlaRKHDAh7sLAD3A7eOCgA45RowodWDlguRcNc5tlhBnEbRLuXj8WFzHFy44DQfycNOnX8efCeaDAYFLAg4DPM34dP+d+XMTU3z3ESPjdQlyDcRqiKHyD4YcL0RHaX87L7d4KJ/qZJaeFbsSuET9H8sTFCmmwCMYSmjxh0DBkVH9h4KwRMMtAbItxHr7G8Nk0fnzkrI7nEUsBNNQBy2IWl1vkNoZ8cMKXJTcyV1Hh1nvhT+y8ZkC4A8E9zPC84S7/Tm3jCbAAVgAXdSQv8vYiOE+3pB0DQCStRb6lPh4gvIipv2QBEPqjSogbKgqkM3/qQZyfQcB009PQh30/9uccYaSk5cc1ecBoyYMfKtYs+PpnETdhz0H6OBPmPt8SYEE81z5PZgH8uOfjqLPPk/j4tbuI/evh+Vhd/S1ABfkT5VE2gXOfn4tI6L8AEAltmPRqxQHC3/Md11+HY6BAkikA0yXcCCCSXP8HsW4BIO6TVu8PIOJVD2ARp0Y4TwIFPCCk1yUARDpFknsdACK5bdOnZjcDiD6Jw0WgQIIpEAAiwY2TVrUAEGkESeplAIiktkyo10ApEABioBQbuvQBIIaO9gMqOQDEgMgVEieYAgEgEtw4aVULAJFGkKReBoBIasuEeg2UAgEgBkqxoUu/du3a4O576Mh/6yUHgLh1WoWUyaZAAIhkt0+8dmEGEadGgs8DQCS4cULVBkSBABADIteQJg4ziCEl/60XHgDi1mkVUiabAgEgkt0+8doFgIhTI8HnASAS3DihagOiQACIAZFrSBMHgBhS8t964QEgbp1WIWWyKRAAItntE6/du2FP6jg5knseACK5bRNqNjAKBIAYGL2GMnUAiKGk/gDKDgAxAGKFpImmQACIRDdPn8qtW7fOMmpra3vy5Jp2WO/2fX1ShIshpQC7VAEOBQWFztMk3lxDCBS4nynQ3Nxs7MTmtgxll52Ehiy59GZTorg32IRW9a5V67333rMMbfHXM/qh0dooPdrf9a6VFjIeMAVwwodb41HyXY/L4AAQAyZheCBhFGCPh0716dzcnITVrG919Om5zYbuB7fcfWt+51fwHVyff/jhh5axa+fOnlSqJPHb3935a99/OdBIbGRSqBkEm5IEgLj/2jDUuC8F2PCHzXbYFOjbPL72feLeX8Egu7QREBsUPYgAgdQCIN+5c6dlCCV6nnhikduF6d43RSjxRhSgo7Zpt6sAEDeiUrh3P1HgfgIItgZlI6IHLSC1YOvUuro6y5Cuaw+bhI8bP85yc3Ki3ZSgCHMsDu5fdH7tmhMfogT+SkfkikT6o7/l5Y3X87qepr+0Sc/j7tcPgGBRj43OKY3tEUMIFLifKXDpUpMTm+bAa67xiIF8//fgu4PAKqZAM4j/T2sQ/c3YfBxH+E27BqRst1pZWekkFv8Hec4VhyV0on0AAAAASUVORK5CYII=",k3=({cursor:i,onPaneMouseMove:u,onPaneMouseUp:c,onPaneDoubleClick:f})=>(ue.useEffect(()=>{const r=document.createElement("div");return r.style.position="fixed",r.style.top="0",r.style.right="0",r.style.bottom="0",r.style.left="0",r.style.zIndex="9999",r.style.cursor=i,document.body.appendChild(r),u&&r.addEventListener("mousemove",u),c&&r.addEventListener("mouseup",c),f&&document.body.addEventListener("dblclick",f),()=>{u&&r.removeEventListener("mousemove",u),c&&r.removeEventListener("mouseup",c),f&&document.body.removeEventListener("dblclick",f),document.body.removeChild(r)}},[i,u,c,f]),m.jsx(m.Fragment,{})),J3={position:"absolute",top:0,right:0,bottom:0,left:0},F3=({orientation:i,offsets:u,setOffsets:c,resizerColor:f,resizerWidth:r,minColumnWidth:o})=>{const h=o||0,[v,y]=ue.useState(null),[A,x]=Hh(),T={position:"absolute",right:i==="horizontal"?void 0:0,bottom:i==="horizontal"?0:void 0,width:i==="horizontal"?7:void 0,height:i==="horizontal"?void 0:7,borderTopWidth:i==="horizontal"?void 0:(7-r)/2,borderRightWidth:i==="horizontal"?(7-r)/2:void 0,borderBottomWidth:i==="horizontal"?void 0:(7-r)/2,borderLeftWidth:i==="horizontal"?(7-r)/2:void 0,borderColor:"transparent",borderStyle:"solid",cursor:i==="horizontal"?"ew-resize":"ns-resize"};return m.jsxs("div",{style:{position:"absolute",top:0,right:0,bottom:0,left:-(7-r)/2,zIndex:100,pointerEvents:"none"},ref:x,children:[!!v&&m.jsx(k3,{cursor:i==="horizontal"?"ew-resize":"ns-resize",onPaneMouseUp:()=>y(null),onPaneMouseMove:D=>{if(!D.buttons)y(null);else if(v){const X=i==="horizontal"?D.clientX-v.clientX:D.clientY-v.clientY,q=v.offset+X,p=v.index>0?u[v.index-1]:0,E=i==="horizontal"?A.width:A.height,b=Math.min(Math.max(p+h,q),E-h)-u[v.index];for(let R=v.index;R<u.length;++R)u[R]=u[R]+b;c([...u])}}}),u.map((D,X)=>m.jsx("div",{style:{...T,top:i==="horizontal"?0:D,left:i==="horizontal"?D:0,pointerEvents:"initial"},onMouseDown:q=>y({clientX:q.clientX,clientY:q.clientY,offset:D,index:X}),children:m.jsx("div",{style:{...J3,background:f}})},X))]})};async function Zf(i){const u=new Image;return i&&(u.src=i,await new Promise((c,f)=>{u.onload=c,u.onerror=c})),u}const nr={backgroundImage:`linear-gradient(45deg, #80808020 25%, transparent 25%),
                    linear-gradient(-45deg, #80808020 25%, transparent 25%),
                    linear-gradient(45deg, transparent 75%, #80808020 75%),
                    linear-gradient(-45deg, transparent 75%, #80808020 75%)`,backgroundSize:"20px 20px",backgroundPosition:"0 0, 0 10px, 10px -10px, -10px 0px",boxShadow:`rgb(0 0 0 / 10%) 0px 1.8px 1.9px,
              rgb(0 0 0 / 15%) 0px 6.1px 6.3px,
              rgb(0 0 0 / 10%) 0px -2px 4px,
              rgb(0 0 0 / 15%) 0px -6.1px 12px,
              rgb(0 0 0 / 25%) 0px 6px 12px`},Vh=({diff:i,noTargetBlank:u,hideDetails:c})=>{const[f,r]=it.useState(i.diff?"diff":"actual"),[o,h]=it.useState(!1),[v,y]=it.useState(null),[A,x]=it.useState("Expected"),[T,D]=it.useState(null),[X,q]=it.useState(null),[p,E]=Hh();it.useEffect(()=>{(async()=>{var z,I,k,nt;y(await Zf((z=i.expected)==null?void 0:z.attachment.path)),x(((I=i.expected)==null?void 0:I.title)||"Expected"),D(await Zf((k=i.actual)==null?void 0:k.attachment.path)),q(await Zf((nt=i.diff)==null?void 0:nt.attachment.path))})()},[i]);const b=v&&T&&X,R=b?Math.max(v.naturalWidth,T.naturalWidth,200):500,N=b?Math.max(v.naturalHeight,T.naturalHeight,200):500,V=Math.min(1,(p.width-30)/R),F=Math.min(1,(p.width-50)/R/2),H=R*V,j=N*V,Y={flex:"none",margin:"0 10px",cursor:"pointer",userSelect:"none"};return m.jsx("div",{"data-testid":"test-result-image-mismatch",style:{display:"flex",flexDirection:"column",alignItems:"center",flex:"auto"},ref:E,children:b&&m.jsxs(m.Fragment,{children:[m.jsxs("div",{"data-testid":"test-result-image-mismatch-tabs",style:{display:"flex",margin:"10px 0 20px"},children:[i.diff&&m.jsx("div",{style:{...Y,fontWeight:f==="diff"?600:"initial"},onClick:()=>r("diff"),children:"Diff"}),m.jsx("div",{style:{...Y,fontWeight:f==="actual"?600:"initial"},onClick:()=>r("actual"),children:"Actual"}),m.jsx("div",{style:{...Y,fontWeight:f==="expected"?600:"initial"},onClick:()=>r("expected"),children:A}),m.jsx("div",{style:{...Y,fontWeight:f==="sxs"?600:"initial"},onClick:()=>r("sxs"),children:"Side by side"}),m.jsx("div",{style:{...Y,fontWeight:f==="slider"?600:"initial"},onClick:()=>r("slider"),children:"Slider"})]}),m.jsxs("div",{style:{display:"flex",justifyContent:"center",flex:"auto",minHeight:j+60},children:[i.diff&&f==="diff"&&m.jsx(yn,{image:X,alt:"Diff",hideSize:c,canvasWidth:H,canvasHeight:j,scale:V}),i.diff&&f==="actual"&&m.jsx(yn,{image:T,alt:"Actual",hideSize:c,canvasWidth:H,canvasHeight:j,scale:V}),i.diff&&f==="expected"&&m.jsx(yn,{image:v,alt:A,hideSize:c,canvasWidth:H,canvasHeight:j,scale:V}),i.diff&&f==="slider"&&m.jsx(W3,{expectedImage:v,actualImage:T,hideSize:c,canvasWidth:H,canvasHeight:j,scale:V,expectedTitle:A}),i.diff&&f==="sxs"&&m.jsxs("div",{style:{display:"flex"},children:[m.jsx(yn,{image:v,title:A,hideSize:c,canvasWidth:F*R,canvasHeight:F*N,scale:F}),m.jsx(yn,{image:o?X:T,title:o?"Diff":"Actual",onClick:()=>h(!o),hideSize:c,canvasWidth:F*R,canvasHeight:F*N,scale:F})]}),!i.diff&&f==="actual"&&m.jsx(yn,{image:T,title:"Actual",hideSize:c,canvasWidth:H,canvasHeight:j,scale:V}),!i.diff&&f==="expected"&&m.jsx(yn,{image:v,title:A,hideSize:c,canvasWidth:H,canvasHeight:j,scale:V}),!i.diff&&f==="sxs"&&m.jsxs("div",{style:{display:"flex"},children:[m.jsx(yn,{image:v,title:A,canvasWidth:F*R,canvasHeight:F*N,scale:F}),m.jsx(yn,{image:T,title:"Actual",canvasWidth:F*R,canvasHeight:F*N,scale:F})]})]}),!c&&m.jsxs("div",{style:{alignSelf:"start",lineHeight:"18px",marginLeft:"15px"},children:[m.jsx("div",{children:i.diff&&m.jsx("a",{target:"_blank",href:i.diff.attachment.path,rel:"noreferrer",children:i.diff.attachment.name})}),m.jsx("div",{children:m.jsx("a",{target:u?"":"_blank",href:i.actual.attachment.path,rel:"noreferrer",children:i.actual.attachment.name})}),m.jsx("div",{children:m.jsx("a",{target:u?"":"_blank",href:i.expected.attachment.path,rel:"noreferrer",children:i.expected.attachment.name})})]})]})})},W3=({expectedImage:i,actualImage:u,canvasWidth:c,canvasHeight:f,scale:r,expectedTitle:o,hideSize:h})=>{const v={position:"absolute",top:0,left:0},[y,A]=it.useState(c/2),x=i.naturalWidth===u.naturalWidth&&i.naturalHeight===u.naturalHeight;return m.jsxs("div",{style:{flex:"none",display:"flex",alignItems:"center",flexDirection:"column",userSelect:"none"},children:[!h&&m.jsxs("div",{style:{margin:5},children:[!x&&m.jsx("span",{style:{flex:"none",margin:"0 5px"},children:"Actual "}),!x&&m.jsx("span",{children:u.naturalWidth}),!x&&m.jsx("span",{style:{flex:"none",margin:"0 5px"},children:"x"}),!x&&m.jsx("span",{children:u.naturalHeight}),!x&&m.jsxs("span",{style:{flex:"none",margin:"0 5px 0 15px"},children:[o," "]}),m.jsx("span",{children:i.naturalWidth}),m.jsx("span",{style:{flex:"none",margin:"0 5px"},children:"x"}),m.jsx("span",{children:i.naturalHeight})]}),m.jsxs("div",{style:{position:"relative",width:c,height:f,margin:15,...nr},children:[m.jsx(F3,{orientation:"horizontal",offsets:[y],setOffsets:T=>A(T[0]),resizerColor:"#57606a80",resizerWidth:6}),m.jsx("img",{alt:o,style:{width:i.naturalWidth*r,height:i.naturalHeight*r},draggable:"false",src:i.src}),m.jsx("div",{style:{...v,bottom:0,overflow:"hidden",width:y,...nr},children:m.jsx("img",{alt:"Actual",style:{width:u.naturalWidth*r,height:u.naturalHeight*r},draggable:"false",src:u.src})})]})]})},yn=({image:i,title:u,alt:c,hideSize:f,canvasWidth:r,canvasHeight:o,scale:h,onClick:v})=>m.jsxs("div",{style:{flex:"none",display:"flex",alignItems:"center",flexDirection:"column"},children:[!f&&m.jsxs("div",{style:{margin:5},children:[u&&m.jsx("span",{style:{flex:"none",margin:"0 5px"},children:u}),m.jsx("span",{children:i.naturalWidth}),m.jsx("span",{style:{flex:"none",margin:"0 5px"},children:"x"}),m.jsx("span",{children:i.naturalHeight})]}),m.jsx("div",{style:{display:"flex",flex:"none",width:r,height:o,margin:15,...nr},children:m.jsx("img",{width:i.naturalWidth*h,height:i.naturalHeight*h,alt:u||c,style:{cursor:v?"pointer":"initial"},draggable:"false",src:i.src,onClick:v})})]});function _3(i,u){const c=/(\x1b\[(\d+(;\d+)*)m)|([^\x1b]+)/g,f=[];let r,o={},h=!1,v=u==null?void 0:u.fg,y=u==null?void 0:u.bg;for(;(r=c.exec(i))!==null;){const[,,A,,x]=r;if(A)for(const T of A.split(";")){const D=+T;switch(D){case 0:o={};break;case 1:o["font-weight"]="bold";break;case 2:o.opacity="0.8";break;case 3:o["font-style"]="italic";break;case 4:o["text-decoration"]="underline";break;case 7:h=!0;break;case 8:o.display="none";break;case 9:o["text-decoration"]="line-through";break;case 22:delete o["font-weight"],delete o["font-style"],delete o.opacity,delete o["text-decoration"];break;case 23:delete o["font-weight"],delete o["font-style"],delete o.opacity;break;case 24:delete o["text-decoration"];break;case 27:h=!1;break;case 30:case 31:case 32:case 33:case 34:case 35:case 36:case 37:v=b2[D-30];break;case 39:v=u==null?void 0:u.fg;break;case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:y=b2[D-40];break;case 49:y=u==null?void 0:u.bg;break;case 53:o["text-decoration"]="overline";break;case 90:case 91:case 92:case 93:case 94:case 95:case 96:case 97:v=S2[D-90];break;case 100:case 101:case 102:case 103:case 104:case 105:case 106:case 107:y=S2[D-100];break}}else if(x){const T={...o},D=h?y:v;D!==void 0&&(T.color=D),h&&v&&(T["background-color"]=v),f.push(`<span style="${$3(T)}">${P3(x)}</span>`)}}return f.join("")}const b2={0:"var(--vscode-terminal-ansiBlack)",1:"var(--vscode-terminal-ansiRed)",2:"var(--vscode-terminal-ansiGreen)",3:"var(--vscode-terminal-ansiYellow)",4:"var(--vscode-terminal-ansiBlue)",5:"var(--vscode-terminal-ansiMagenta)",6:"var(--vscode-terminal-ansiCyan)",7:"var(--vscode-terminal-ansiWhite)"},S2={0:"var(--vscode-terminal-ansiBrightBlack)",1:"var(--vscode-terminal-ansiBrightRed)",2:"var(--vscode-terminal-ansiBrightGreen)",3:"var(--vscode-terminal-ansiBrightYellow)",4:"var(--vscode-terminal-ansiBrightBlue)",5:"var(--vscode-terminal-ansiBrightMagenta)",6:"var(--vscode-terminal-ansiBrightCyan)",7:"var(--vscode-terminal-ansiBrightWhite)"};function P3(i){return i.replace(/[&"<>]/g,u=>({"&":"&amp;",'"':"&quot;","<":"&lt;",">":"&gt;"})[u])}function $3(i){return Object.entries(i).map(([u,c])=>`${u}: ${c}`).join("; ")}const Ar=({code:i,children:u,testId:c})=>{const f=it.useMemo(()=>nv(i),[i]);return m.jsxs("div",{className:"test-error-container test-error-text","data-testid":c,children:[u,m.jsx("div",{className:"test-error-view",dangerouslySetInnerHTML:{__html:f||""}})]})},tv=({prompt:i})=>{const[u,c]=it.useState(!1);return m.jsx("button",{className:"button",style:{minWidth:100},onClick:async()=>{await navigator.clipboard.writeText(i),c(!0),setTimeout(()=>{c(!1)},3e3)},children:u?"Copied":"Copy prompt"})},ev=({diff:i})=>m.jsx("div",{"data-testid":"test-screenshot-error-view",className:"test-error-view",children:m.jsx(Vh,{diff:i,hideDetails:!0},"image-diff")});function nv(i){return _3(i||"",{bg:"var(--color-canvas-subtle)",fg:"var(--color-fg-default)"})}const Zh=({file:i,projectNames:u,isFileExpanded:c,setFileExpanded:f,footer:r})=>m.jsx(gr,{expanded:c?c(i.fileId):void 0,noInsets:!0,setExpanded:f?(o=>f(i.fileId,o)):void 0,header:m.jsx("span",{className:"chip-header-allow-selection",children:i.fileName}),footer:r,children:m.jsx(Ih,{tests:i.tests,projectNames:u})}),Ih=({tests:i,projectNames:u,runs:c,selectedTestId:f})=>{const r=se();return m.jsx("div",{role:"list",children:i.map((o,h)=>{const v=c==null?void 0:c[h],y=v!==void 0?o.results[v]:void 0,A=il({test:o,result:y},r),x=f===o.testId;return m.jsxs("div",{className:Ze("test-file-test","test-file-test-outcome-"+o.outcome,x&&"test-file-test-selected"),role:"listitem","aria-current":x,children:[m.jsxs("div",{className:"hbox",style:{alignItems:"flex-start"},children:[m.jsxs("div",{className:"hbox",children:[m.jsx("span",{className:"test-file-test-status-icon",children:fc(o.outcome)}),m.jsxs("span",{children:[m.jsx(bn,{href:A,title:[...o.path,o.title].join(" â€º "),children:m.jsx("span",{className:"test-file-title",children:[...o.path,o.title].join(" â€º ")})}),m.jsx(Qh,{style:{marginLeft:"6px"},projectNames:u,activeProjectName:o.projectName,otherLabels:o.tags})]})]}),m.jsx("span",{"data-testid":"test-duration",style:{minWidth:"50px",textAlign:"right"},children:Ta(o.duration)})]}),m.jsx("div",{className:"test-file-details-row",children:m.jsxs("div",{className:"test-file-details-row-items",children:[m.jsx(bn,{href:A,title:[...o.path,o.title].join(" â€º "),className:"test-file-path-link",children:m.jsxs("span",{className:"test-file-path",children:[o.location.file,":",o.location.line]})}),m.jsx(lv,{test:o}),m.jsx(av,{test:o}),m.jsx(zh,{test:o,dim:!0})]})})]},`test-${o.testId}`)})})};function lv({test:i}){const u=se();for(const c of i.results)for(const f of c.attachments)if(f.contentType.startsWith("image/")&&f.name.match(/-(expected|actual|diff)/))return m.jsx(dr,{href:il({test:i,result:c,anchor:`attachment-${c.attachments.indexOf(f)}`},u),title:"View images",dim:!0,children:m3()})}function av({test:i}){const u=se(),c=i.results.find(f=>f.attachments.some(r=>r.name==="video"));return c?m.jsx(dr,{href:il({test:i,result:c,anchor:"attachment-video"},u),title:"View video",dim:!0,children:g3()}):void 0}const iv=new RegExp("([\\u001B\\u009B][[\\]()#?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)|(?:(?:\\d{0,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~])))","g");function T2(i){return i.replace(iv,"")}function uv(i,u){var f;const c=new Map;for(const r of i){const o=r.name.match(/^(.*)-(expected|actual|diff|previous)(\.[^.]+)?$/);if(!o)continue;const[,h,v,y=""]=o,A=h+y;let x=c.get(A);x||(x={name:A,anchors:[`attachment-${h}`]},c.set(A,x)),x.anchors.push(`attachment-${u.attachments.indexOf(r)}`),v==="actual"&&(x.actual={attachment:r}),v==="expected"&&(x.expected={attachment:r,title:"Expected"}),v==="previous"&&(x.expected={attachment:r,title:"Previous"}),v==="diff"&&(x.diff={attachment:r})}for(const[r,o]of c)!o.actual||!o.expected?c.delete(r):(i.delete(o.actual.attachment),i.delete(o.expected.attachment),i.delete((f=o.diff)==null?void 0:f.attachment));return[...c.values()]}const cv=({report:i,test:u,result:c})=>{const{screenshots:f,videos:r,traces:o,otherAttachments:h,diffs:v,errors:y,otherAttachmentAnchors:A,screenshotAnchors:x,errorContext:T}=it.useMemo(()=>{const p=c.attachments.filter(z=>!z.name.startsWith("_")),E=new Set(p.filter(z=>z.contentType.startsWith("image/"))),b=[...E].map(z=>`attachment-${p.indexOf(z)}`),R=p.filter(z=>z.contentType.startsWith("video/")),N=p.filter(z=>z.name==="trace"),V=p.find(z=>z.name==="error-context"),F=new Set(p);[...E,...R,...N].forEach(z=>F.delete(z));const H=[...F].map(z=>`attachment-${p.indexOf(z)}`),j=uv(E,c),Y=c.errors.map(z=>z.message);return{screenshots:[...E],videos:R,traces:N,otherAttachments:F,diffs:j,errors:Y,otherAttachmentAnchors:H,screenshotAnchors:b,errorContext:V}},[c]),[D,X]=it.useState("");it.useEffect(()=>X(""),[c]);const q=E3(async()=>{var F;if((F=i.json().options)!=null&&F.noCopyPrompt||!T)return;let p=T.path?await fetch(T.path).then(H=>H.text()):T.body;if(!p)return;const E=c.attachments.find(H=>H.name==="stdout"),b=c.attachments.find(H=>H.name==="stderr"),R=E!=null&&E.body&&E.contentType==="text/plain"?E.body:void 0,N=b!=null&&b.body&&b.contentType==="text/plain"?b.body:void 0;R&&(p+=`

# Stdout

\`\`\`
`+T2(R)+"\n```"),N&&(p+=`

# Stderr

\`\`\`
`+T2(N)+"\n```");const V=i.json().metadata;return V!=null&&V.gitDiff&&(p+=`

# Local changes

\`\`\`diff
`+V.gitDiff+"\n```"),p},[T,i,c],void 0);return m.jsxs("div",{className:"test-result",children:[!!y.length&&m.jsxs(ke,{header:"Errors",children:[q&&m.jsx("div",{style:{position:"absolute",right:"16px",padding:"10px",zIndex:1},children:m.jsx(tv,{prompt:q})}),y.map((p,E)=>{const b=sv(p,v);return m.jsxs(m.Fragment,{children:[m.jsx(Ar,{code:p},"test-result-error-message-"+E),b&&m.jsx(ev,{diff:b})]})})]}),!!c.steps.length&&m.jsxs(ke,{header:"Test Steps",children:[m.jsxs("form",{className:"subnav-search step-filter",onSubmit:p=>p.preventDefault(),children:[Oh(),m.jsx("input",{className:"form-control subnav-search-input input-contrast width-full",type:"search",spellCheck:!1,placeholder:"Filter steps","aria-label":"Filter steps",value:D,onChange:p=>X(p.target.value)})]}),c.steps.map((p,E)=>m.jsx(Jh,{step:p,result:c,test:u,depth:0,filterText:D},`step-${E}`))]}),v.map((p,E)=>m.jsx(xi,{id:p.anchors,children:m.jsx(ke,{dataTestId:"test-results-image-diff",header:`Image mismatch: ${p.name}`,revealOnAnchorId:p.anchors,children:m.jsx(Vh,{diff:p})})},`diff-${E}`)),!!f.length&&m.jsx(ke,{header:"Screenshots",revealOnAnchorId:x,children:f.map((p,E)=>m.jsxs(xi,{id:`attachment-${c.attachments.indexOf(p)}`,children:[m.jsx("a",{href:Ve(p.path),children:m.jsx("img",{className:"screenshot",src:Ve(p.path)})}),m.jsx($u,{attachment:p,result:c})]},`screenshot-${E}`))}),!!o.length&&m.jsx(xi,{id:"attachment-trace",children:m.jsx(ke,{header:"Traces",revealOnAnchorId:"attachment-trace",children:m.jsxs("div",{children:[m.jsx("a",{href:Ve(Lh(o)),children:m.jsx("img",{className:"screenshot",src:K3,style:{width:192,height:117,marginLeft:20}})}),o.map((p,E)=>m.jsx($u,{attachment:p,result:c,linkName:o.length===1?"trace":`trace-${E+1}`},`trace-${E}`))]})})}),!!r.length&&m.jsx(xi,{id:"attachment-video",children:m.jsx(ke,{header:"Videos",revealOnAnchorId:"attachment-video",children:r.map(p=>m.jsxs("div",{children:[m.jsx("video",{controls:!0,children:m.jsx("source",{src:Ve(p.path),type:p.contentType})}),m.jsx($u,{attachment:p,result:c})]},p.path))})}),!!h.size&&m.jsx(ke,{header:"Attachments",revealOnAnchorId:A,dataTestId:"attachments",children:[...h].map((p,E)=>m.jsx(xi,{id:`attachment-${c.attachments.indexOf(p)}`,children:m.jsx($u,{attachment:p,result:c,openInNewTab:p.contentType.startsWith("text/html")})},`attachment-link-${E}`))}),m.jsx(ke,{header:`Executed in Worker #${c.workerIndex}`,dataTestId:"worker-test-list",initialExpanded:!1,noInsets:!0,body:()=>{const p=fv(i).get(c.workerIndex)||{tests:[],runs:[]};return m.jsx(Ih,{tests:p.tests,runs:p.runs,projectNames:i.json().projectNames,selectedTestId:u.testId})}})]})};function sv(i,u){const c=i.split(`
`)[0];if(!(!c.includes("toHaveScreenshot")&&!c.includes("toMatchSnapshot")))return u.find(f=>i.includes(f.name))}function qh(i,u){return i.title.toLowerCase().includes(u.toLowerCase())}function Kh(i,u){return i.steps.some(c=>qh(c,u)||Kh(c,u))}function kh(i){return i.steps.some(u=>u.attachments.length>0||kh(u))}const Jh=({test:i,step:u,result:c,depth:f,filterText:r})=>{const o=se();let h=!1,v=m.jsx("span",{children:u.title});if(r){const y=!!r&&qh(u,r),A=!!r&&Kh(u,r);if(!y&&!A)return null;if(h=A,y){const x=u.title.toLowerCase().split(r.toLowerCase()),T=[];let D=0;for(let X=0;X<x.length;X++)X&&(T.push(m.jsx("span",{className:"step-title-highlight",children:u.title.substring(D,D+r.length)},X)),D+=r.length),T.push(x[X]),D+=x[X].length;v=T}}return m.jsx(q3,{title:m.jsxs("div",{"aria-label":u.title,className:"step-title-container",children:[fc(u.error||u.duration===-1?"failed":u.skipped?"skipped":"passed"),m.jsxs("span",{className:"step-title-text",children:[v,u.count>1&&m.jsxs(m.Fragment,{children:[" âœ• ",m.jsx("span",{className:"test-result-counter",children:u.count})]}),u.location&&m.jsxs("span",{className:"test-result-path",children:["â€” ",u.location.file,":",u.location.line]})]}),m.jsx("span",{className:"step-spacer"}),u.attachments.length>0&&m.jsx("a",{className:"step-attachment-link",title:"reveal attachment",href:Ve(il({test:i,result:c,anchor:`attachment-${u.attachments[0]}`},o)),onClick:y=>{y.stopPropagation()},children:Rh()}),u.attachments.length===0&&kh(u)&&m.jsx("span",{className:"step-indirect-attachment-indicator",title:"contains attachment","aria-label":"contains attachment",children:d3()}),m.jsx("span",{className:"step-duration",children:Ta(u.duration)})]}),loadChildren:u.steps.length||u.snippet?()=>{const y=u.snippet?[m.jsx(Ar,{testId:"test-snippet",code:u.snippet},"line")]:[],A=u.steps.map((x,T)=>m.jsx(Jh,{step:x,depth:f+1,result:c,test:i,filterText:r},T));return y.concat(A)}:void 0,depth:f,expandByDefault:h})},C2=Symbol("workerLists");function fv(i){let u=i[C2];if(!u){const c=new Map;for(const f of i.json().files)for(const r of f.tests)for(let o=0;o<r.results.length;o++){let h=c.get(r.results[o].workerIndex);h||(h=[],c.set(r.results[o].workerIndex,h)),h.push({test:r,time:new Date(r.results[o].startTime).valueOf(),run:o})}u=new Map;for(const[f,r]of c)r.sort((o,h)=>o.time-h.time),u.set(f,{tests:r.map(o=>o.test),runs:r.map(o=>o.run)});i[C2]=u}return u}const rv=({report:i,test:u,run:c,next:f,prev:r})=>{const[o,h]=it.useState(c),v=se(),y=u.annotations.filter(A=>!A.type.startsWith("_"))??[];return D2(y,u.repeatEachIndex),m.jsxs(m.Fragment,{children:[m.jsx(mr,{title:u.title,leftSuperHeader:m.jsx("div",{className:"test-case-path",children:u.path.join(" â€º ")}),rightSuperHeader:m.jsxs(m.Fragment,{children:[m.jsx("div",{className:Ze(!r&&"hidden"),children:m.jsx(bn,{href:il({test:r},v),children:"Â« previous"})}),m.jsx("div",{style:{width:10}}),m.jsx("div",{className:Ze(!f&&"hidden"),children:m.jsx(bn,{href:il({test:f},v),children:"next Â»"})})]})}),m.jsxs("div",{className:"hbox",style:{lineHeight:"24px"},children:[m.jsx("div",{className:"test-case-location",children:m.jsxs(or,{value:`${u.location.file}:${u.location.line}`,children:[u.location.file,":",u.location.line]})}),m.jsx("div",{style:{flex:"auto"}}),m.jsx(zh,{test:u,trailingSeparator:!0}),m.jsx("div",{className:"test-case-duration",children:Ta(u.duration)})]}),m.jsx(Qh,{style:{marginLeft:"6px"},projectNames:i.json().projectNames,activeProjectName:u.projectName,otherLabels:u.tags}),u.results.length===0&&y.length!==0&&m.jsx(ke,{header:"Annotations",dataTestId:"test-case-annotations",children:y.map((A,x)=>m.jsx(O2,{annotation:A},x))}),m.jsx(I3,{tabs:u.results.map((A,x)=>({id:String(x),title:m.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[fc(A.status)," ",ov(x),u.results.length>1&&m.jsx("span",{className:"test-case-run-duration",children:Ta(A.duration)})]}),render:()=>{const T=A.annotations.filter(D=>!D.type.startsWith("_"));return D2(T,u.repeatEachIndex),m.jsxs(m.Fragment,{children:[!!T.length&&m.jsx(ke,{header:"Annotations",dataTestId:"test-case-annotations",children:T.map((D,X)=>m.jsx(O2,{annotation:D},X))}),m.jsx(cv,{test:u,result:A,report:i})]})}}))||[],selectedTab:String(o),setSelectedTab:A=>h(+A)})]})};function O2({annotation:{type:i,description:u}}){return m.jsxs("div",{className:"test-case-annotation",children:[m.jsx("span",{style:{fontWeight:"bold"},children:i}),u&&m.jsxs(or,{value:u,children:[": ",Di(u)]})]})}function D2(i,u){u&&i.push({type:"repeatEachIndex",description:String(u)})}function ov(i){return i?`Retry #${i}`:"Run"}class dv extends it.Component{constructor(){super(...arguments),this.state={error:null,errorInfo:null}}componentDidCatch(u,c){this.setState({error:u,errorInfo:c})}render(){var u,c,f;return this.state.error||this.state.errorInfo?m.jsxs("div",{className:"metadata-view p-3",children:[m.jsx("p",{children:"An error was encountered when trying to render metadata."}),m.jsx("p",{children:m.jsxs("pre",{style:{overflow:"scroll"},children:[(u=this.state.error)==null?void 0:u.message,m.jsx("br",{}),(c=this.state.error)==null?void 0:c.stack,m.jsx("br",{}),(f=this.state.errorInfo)==null?void 0:f.componentStack]})})]}):this.props.children}}const hv=i=>m.jsx(dv,{children:m.jsx(mv,{metadata:i.metadata})}),mv=i=>{const u=i.metadata,c=se().has("show-metadata-other")?Object.entries(i.metadata).filter(([r])=>!Fh.has(r)):[];if(u.ci||u.gitCommit||c.length>0)return m.jsxs("div",{className:"metadata-view",children:[u.ci&&!u.gitCommit&&m.jsx(gv,{info:u.ci}),u.gitCommit&&m.jsx(Av,{ci:u.ci,commit:u.gitCommit}),c.length>0&&m.jsxs(m.Fragment,{children:[(u.gitCommit||u.ci)&&m.jsx("div",{className:"metadata-separator"}),m.jsx("div",{className:"metadata-section metadata-properties",role:"list",children:c.map(([r,o])=>{const h=typeof o!="object"||o===null||o===void 0?String(o):JSON.stringify(o),v=h.length>1e3?h.slice(0,1e3)+"â€¦":h;return m.jsx("div",{className:"copyable-property",role:"listitem",children:m.jsxs(or,{value:h,children:[m.jsx("span",{style:{fontWeight:"bold"},title:r,children:r}),": ",m.jsx("span",{title:v,children:Di(v)})]})},r)})})]})]})},gv=({info:i})=>{const u=i.prTitle||`Commit ${i.commitHash}`,c=i.prHref||i.commitHref;return m.jsx("div",{className:"metadata-section",role:"list",children:m.jsx("div",{role:"listitem",children:m.jsx("a",{href:Ve(c),target:"_blank",rel:"noopener noreferrer",title:u,children:u})})})},Av=({ci:i,commit:u})=>{const c=(i==null?void 0:i.prTitle)||u.subject,f=(i==null?void 0:i.prHref)||(i==null?void 0:i.commitHref),r=` <${u.author.email}>`,o=`${u.author.name}${r}`,h=Intl.DateTimeFormat(void 0,{dateStyle:"medium"}).format(u.committer.time),v=Intl.DateTimeFormat(void 0,{dateStyle:"full",timeStyle:"long"}).format(u.committer.time);return m.jsxs("div",{className:"metadata-section",role:"list",children:[m.jsxs("div",{role:"listitem",children:[f&&m.jsx("a",{href:Ve(f),target:"_blank",rel:"noopener noreferrer",title:c,children:c}),!f&&m.jsx("span",{title:c,children:c})]}),m.jsxs("div",{role:"listitem",className:"hbox",children:[m.jsx("span",{className:"mr-1",children:o}),m.jsxs("span",{title:v,children:[" on ",h]})]})]})},Fh=new Set(["ci","gitCommit","gitDiff","actualWorkers"]),vv=i=>{const u=Object.entries(i).filter(([c])=>!Fh.has(c));return!i.ci&&!i.gitCommit&&!u.length},yv=({files:i,expandedFiles:u,setExpandedFiles:c,projectNames:f})=>{const r=it.useMemo(()=>{const o=[];let h=0;for(const v of i)h+=v.tests.length,o.push({file:v,defaultExpanded:h<200});return o},[i]);return m.jsx(m.Fragment,{children:r.length>0?r.map(({file:o,defaultExpanded:h})=>m.jsx(Zh,{file:o,projectNames:f,isFileExpanded:v=>{const y=u.get(v);return y===void 0?h:!!y},setFileExpanded:(v,y)=>{const A=new Map(u);A.set(v,y),c(A)}},`file-${o.fileId}`)):m.jsx("div",{className:"chip-header test-file-no-files",children:"No tests found"})})},R2=({report:i,filteredStats:u,metadataVisible:c,toggleMetadataVisible:f,errorsVisible:r,setErrorsVisible:o})=>{if(!i)return null;const h=i.projectNames.length===1&&!!i.projectNames[0],v=!h&&!u,y=!vv(i.metadata)&&m.jsxs("div",{className:Ze("metadata-toggle",!v&&"metadata-toggle-second-line"),role:"button",onClick:f,title:c?"Hide metadata":"Show metadata",children:[c?Mi():Sa(),"Metadata"]}),A=m.jsxs("div",{className:"test-file-header-info",children:[h&&m.jsxs("div",{"data-testid":"project-name",children:["Project: ",i.projectNames[0]]}),u&&m.jsxs("div",{"data-testid":"filtered-tests-count",children:["Filtered: ",u.total," ",!!u.total&&"("+Ta(u.duration)+")"]}),v&&y]}),x=m.jsxs(m.Fragment,{children:[m.jsx("div",{"data-testid":"overall-time",style:{marginRight:"10px"},children:i?new Date(i.startTime).toLocaleString():""}),m.jsxs("div",{"data-testid":"overall-duration",children:["Total time: ",Ta(i.duration??0)]})]});return m.jsxs(m.Fragment,{children:[m.jsx(mr,{title:i.options.title,leftSuperHeader:A,rightSuperHeader:x}),!v&&y,c&&m.jsx(hv,{metadata:i.metadata}),!!i.errors.length&&m.jsx(gr,{header:"Errors",dataTestId:"report-errors",expanded:r,setExpanded:o,children:i.errors.map((T,D)=>m.jsx(Ar,{code:T},"test-report-error-message-"+D))})]})},Wh=i=>{const u=Math.round(i/1e3),c=Math.floor(u/60),f=u%60;return c===0?`${f}s`:`${c}m ${f}s`},Ev=({entries:i})=>{const f=Math.max(...i.map(j=>j.label.length))*10,o={top:20,right:20,bottom:40,left:Math.min(800*.5,Math.max(50,f))},h=800-o.left-o.right,v=Math.min(...i.map(j=>j.startTime)),y=Math.max(...i.map(j=>j.startTime+j.duration));let A,x;const T=y-v;T<60*1e3?(A=10*1e3,x=!0):T<300*1e3?(A=30*1e3,x=!0):T<1800*1e3?(A=300*1e3,x=!1):(A=600*1e3,x=!1);const D=Math.ceil(v/A)*A,X=(j,Y)=>{const z=new Date(j).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:x?"2-digit":void 0});if(Y)return z;if(z.endsWith(" AM")||z.endsWith(" PM"))return z.slice(0,-3)},p=(y-v)*1.1,E=Math.ceil(p/A)*A,b=h/E,R=20,N=8,V=i.length*(R+N),F=[];for(let j=D;j<=v+E;j+=A){const Y=j-v;F.push({x:Y*b,label:X(j,j===D)})}const H=V+o.top+o.bottom;return m.jsx("svg",{viewBox:`0 0 800 ${H}`,preserveAspectRatio:"xMidYMid meet",style:{width:"100%",height:"auto"},role:"img",children:m.jsxs("g",{transform:`translate(${o.left}, ${o.top})`,role:"presentation",children:[F.map(({x:j,label:Y},z)=>m.jsxs("g",{"aria-hidden":"true",children:[m.jsx("line",{x1:j,y1:0,x2:j,y2:V,stroke:"var(--color-border-muted)",strokeWidth:"1"}),m.jsx("text",{x:j,y:V+20,textAnchor:"middle",dominantBaseline:"middle",fontSize:"12",fill:"var(--color-fg-muted)",children:Y})]},z)),i.map((j,Y)=>{const z=j.startTime-v,I=j.duration*b,k=z*b,nt=Y*(R+N),P=["var(--color-scale-blue-2)","var(--color-scale-blue-3)","var(--color-scale-blue-4)"],st=P[Y%P.length];return m.jsxs("g",{role:"listitem","aria-label":j.tooltip,children:[m.jsx("rect",{className:"gantt-bar",x:k,y:nt,width:I,height:R,fill:st,rx:"2",children:m.jsx("title",{children:j.tooltip})}),m.jsx("text",{x:k+I+6,y:nt+R/2,dominantBaseline:"middle",fontSize:"12",fill:"var(--color-fg-muted)","aria-hidden":"true",children:Wh(j.duration)}),m.jsx("text",{x:-10,y:nt+R/2,textAnchor:"end",dominantBaseline:"middle",fontSize:"12",fill:"var(--color-fg-muted)","aria-hidden":"true",children:j.label})]},Y)}),m.jsx("line",{x1:0,y1:0,x2:0,y2:V,stroke:"var(--color-fg-muted)",strokeWidth:"1","aria-hidden":"true"}),m.jsx("line",{x1:0,y1:V,x2:h,y2:V,stroke:"var(--color-fg-muted)",strokeWidth:"1","aria-hidden":"true"})]})})};function pv({report:i,tests:u}){return m.jsxs(m.Fragment,{children:[m.jsx(bv,{report:i}),m.jsx(xv,{report:i,tests:u})]})}function xv({report:i,tests:u}){const[c,f]=ue.useState(50);return m.jsx(Zh,{file:{fileId:"slowest",fileName:"Slowest Tests",tests:u.slice(0,c),stats:null},projectNames:i.json().projectNames,footer:c<u.length?m.jsxs("button",{className:"link-badge fullwidth-link",style:{padding:"8px 5px"},onClick:()=>f(r=>r+50),children:[Mi(),"Show 50 more"]}):void 0})}function bv({report:i}){const u=i.json().machines;if(u.length===0)return null;const c=u.map(f=>{const r=f.tag.join(" "),o=new Date(f.startTime).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:"short"});let h=`${r} started at ${o}, runs ${Wh(f.duration)}`;return f.shardIndex&&(h+=` (shard ${f.shardIndex})`),{label:r,tooltip:h,startTime:f.startTime,duration:f.duration,shardIndex:f.shardIndex??1}}).sort((f,r)=>f.label.localeCompare(r.label)||f.shardIndex-r.shardIndex);return m.jsx(ke,{header:"Timeline",children:m.jsx(Ev,{entries:c})})}const Sv=i=>!i.has("testId")&&!i.has("speedboard"),Tv=i=>i.has("testId"),Cv=i=>i.has("speedboard")&&!i.has("testId"),Ov=({report:i})=>{var H,j;const u=se(),[c,f]=it.useState(new Map),[r,o]=it.useState(u.get("q")||""),[h,v]=it.useState(!1),[y,A]=it.useState(!0),x=u.has("speedboard"),[T]=Bh("mergeFiles",!1),D=u.get("testId"),X=((H=u.get("q"))==null?void 0:H.toString())||"",q=X?"&q="+X:"",p=(j=i==null?void 0:i.json())==null?void 0:j.options.title,E=it.useMemo(()=>{const Y=new Map;for(const z of(i==null?void 0:i.json().files)||[])for(const I of z.tests)Y.set(I.testId,z.fileId);return Y},[i]),b=it.useMemo(()=>uc.parse(r),[r]),R=it.useMemo(()=>b.empty()?void 0:Rv((i==null?void 0:i.json().files)||[],b),[i,b]),N=it.useMemo(()=>x?jv(i,b):T?Mv(i,b):wv(i,b),[i,b,T,x]),{prev:V,next:F}=it.useMemo(()=>{const Y=N.tests.findIndex(k=>k.testId===D),z=Y>0?N.tests[Y-1]:void 0,I=Y<N.tests.length-1?N.tests[Y+1]:void 0;return{prev:z,next:I}},[D,N]);return it.useEffect(()=>{const Y=z=>{if(z.target instanceof HTMLInputElement||z.target instanceof HTMLTextAreaElement||z.shiftKey||z.ctrlKey||z.metaKey||z.altKey)return;const I=new URLSearchParams(u);switch(z.key){case"a":z.preventDefault(),ll("#?");break;case"p":z.preventDefault(),I.delete("testId"),I.delete("speedboard"),ll(Ml(I,"s:passed",!1));break;case"f":z.preventDefault(),I.delete("testId"),I.delete("speedboard"),ll(Ml(I,"s:failed",!1));break;case"ArrowLeft":V&&(z.preventDefault(),I.delete("testId"),ll(il({test:V},I)+q));break;case"ArrowRight":F&&(z.preventDefault(),I.delete("testId"),ll(il({test:F},I)+q));break}};return document.addEventListener("keydown",Y),()=>document.removeEventListener("keydown",Y)},[V,F,q,X,u]),it.useEffect(()=>{p?document.title=p:document.title="Playwright Test Report"},[p]),m.jsx("div",{className:"htmlreport vbox px-4 pb-4",children:m.jsxs("main",{children:[i&&m.jsx(G3,{stats:i.json().stats,filterText:r,setFilterText:o}),m.jsxs(Vf,{predicate:Sv,children:[m.jsx(R2,{report:i==null?void 0:i.json(),filteredStats:R,metadataVisible:h,toggleMetadataVisible:()=>v(Y=>!Y),errorsVisible:y,setErrorsVisible:A}),m.jsx(yv,{files:N.files,expandedFiles:c,setExpandedFiles:f,projectNames:(i==null?void 0:i.json().projectNames)||[]})]}),m.jsxs(Vf,{predicate:Cv,children:[m.jsx(R2,{report:i==null?void 0:i.json(),filteredStats:R,metadataVisible:h,toggleMetadataVisible:()=>v(Y=>!Y),errorsVisible:y,setErrorsVisible:A}),i&&m.jsx(pv,{report:i,tests:N.tests})]}),m.jsx(Vf,{predicate:Tv,children:i&&m.jsx(Dv,{report:i,next:F,prev:V,testId:D,testIdToFileIdMap:E})})]})})},Dv=({report:i,testIdToFileIdMap:u,next:c,prev:f,testId:r})=>{const[o,h]=it.useState("loading"),v=+(se().get("run")||"0");return it.useEffect(()=>{(async()=>{if(!r||typeof o=="object"&&r===o.testId)return;const y=u.get(r);if(!y){h("not-found");return}const A=await i.entry(`${y}.json`);h((A==null?void 0:A.tests.find(x=>x.testId===r))||"not-found")})()},[o,i,r,u]),o==="loading"?m.jsx("div",{className:"test-case-column"}):o==="not-found"?m.jsxs("div",{className:"test-case-column",children:[m.jsx(mr,{title:"Test not found"}),m.jsxs("div",{className:"test-case-location",children:["Test ID: ",r]})]}):m.jsx("div",{className:"test-case-column",children:m.jsx(rv,{report:i,next:c,prev:f,test:o,run:v})})};function Rv(i,u){const c={total:0,duration:0};for(const f of i){const r=f.tests.filter(o=>u.matches(o));c.total+=r.length;for(const o of r)c.duration+=o.duration}return c}function wv(i,u){const c={files:[],tests:[]};for(const f of(i==null?void 0:i.json().files)||[]){const r=f.tests.filter(o=>u.matches(o));r.length&&c.files.push({...f,tests:r}),c.tests.push(...r)}return c}function Mv(i,u){const c=[],f=new Map;for(const o of(i==null?void 0:i.json().files)||[]){const h=o.tests.filter(v=>u.matches(v));for(const v of h){const y=v.path[0]??"<anonymous>";let A=f.get(y);A||(A={fileId:y,fileName:y,tests:[],stats:{total:0,expected:0,unexpected:0,flaky:0,skipped:0,ok:!0}},f.set(y,A),c.push(A));const x={...v,path:v.path.slice(1)};A.tests.push(x)}}c.sort((o,h)=>o.fileName.localeCompare(h.fileName));const r={files:c,tests:[]};for(const o of c)r.tests.push(...o.tests);return r}function jv(i,u){const f=((i==null?void 0:i.json().files)||[]).flatMap(r=>r.tests).filter(r=>u.matches(r));return f.sort((r,o)=>o.duration-r.duration),{files:[],tests:f}}const Nv="data:image/svg+xml,%3csvg%20width='400'%20height='400'%20viewBox='0%200%20400%20400'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M136.444%20221.556C123.558%20225.213%20115.104%20231.625%20109.535%20238.032C114.869%20233.364%20122.014%20229.08%20131.652%20226.348C141.51%20223.554%20149.92%20223.574%20156.869%20224.915V219.481C150.941%20218.939%20144.145%20219.371%20136.444%20221.556ZM108.946%20175.876L61.0895%20188.484C61.0895%20188.484%2061.9617%20189.716%2063.5767%20191.36L104.153%20180.668C104.153%20180.668%20103.578%20188.077%2098.5847%20194.705C108.03%20187.559%20108.946%20175.876%20108.946%20175.876ZM149.005%20288.347C81.6582%20306.486%2046.0272%20228.438%2035.2396%20187.928C30.2556%20169.229%2028.0799%20155.067%2027.5%20145.928C27.4377%20144.979%2027.4665%20144.179%2027.5336%20143.446C24.04%20143.657%2022.3674%20145.473%2022.7077%20150.721C23.2876%20159.855%2025.4633%20174.016%2030.4473%20192.721C41.2301%20233.225%2076.8659%20311.273%20144.213%20293.134C158.872%20289.185%20169.885%20281.992%20178.152%20272.81C170.532%20279.692%20160.995%20285.112%20149.005%20288.347ZM161.661%20128.11V132.903H188.077C187.535%20131.206%20186.989%20129.677%20186.447%20128.11H161.661Z'%20fill='%232D4552'/%3e%3cpath%20d='M193.981%20167.584C205.861%20170.958%20212.144%20179.287%20215.465%20186.658L228.711%20190.42C228.711%20190.42%20226.904%20164.623%20203.57%20157.995C181.741%20151.793%20168.308%20170.124%20166.674%20172.496C173.024%20167.972%20182.297%20164.268%20193.981%20167.584ZM299.422%20186.777C277.573%20180.547%20264.145%20198.916%20262.535%20201.255C268.89%20196.736%20278.158%20193.031%20289.837%20196.362C301.698%20199.741%20307.976%20208.06%20311.307%20215.436L324.572%20219.212C324.572%20219.212%20322.736%20193.41%20299.422%20186.777ZM286.262%20254.795L176.072%20223.99C176.072%20223.99%20177.265%20230.038%20181.842%20237.869L274.617%20263.805C282.255%20259.386%20286.262%20254.795%20286.262%20254.795ZM209.867%20321.102C122.618%20297.71%20133.166%20186.543%20147.284%20133.865C153.097%20112.156%20159.073%2096.0203%20164.029%2085.204C161.072%2084.5953%20158.623%2086.1529%20156.203%2091.0746C150.941%20101.747%20144.212%20119.124%20137.7%20143.45C123.586%20196.127%20113.038%20307.29%20200.283%20330.682C241.406%20341.699%20273.442%20324.955%20297.323%20298.659C274.655%20319.19%20245.714%20330.701%20209.867%20321.102Z'%20fill='%232D4552'/%3e%3cpath%20d='M161.661%20262.296V239.863L99.3324%20257.537C99.3324%20257.537%20103.938%20230.777%20136.444%20221.556C146.302%20218.762%20154.713%20218.781%20161.661%20220.123V128.11H192.869C189.471%20117.61%20186.184%20109.526%20183.423%20103.909C178.856%2094.612%20174.174%20100.775%20163.545%20109.665C156.059%20115.919%20137.139%20129.261%20108.668%20136.933C80.1966%20144.61%2057.179%20142.574%2047.5752%20140.911C33.9601%20138.562%2026.8387%20135.572%2027.5049%20145.928C28.0847%20155.062%2030.2605%20169.224%2035.2445%20187.928C46.0272%20228.433%2081.663%20306.481%20149.01%20288.342C166.602%20283.602%20179.019%20274.233%20187.626%20262.291H161.661V262.296ZM61.0848%20188.484L108.946%20175.876C108.946%20175.876%20107.551%20194.288%2089.6087%20199.018C71.6614%20203.743%2061.0848%20188.484%2061.0848%20188.484Z'%20fill='%23E2574C'/%3e%3cpath%20d='M341.786%20129.174C329.345%20131.355%20299.498%20134.072%20262.612%20124.185C225.716%20114.304%20201.236%2097.0224%20191.537%2088.8994C177.788%2077.3834%20171.74%2069.3802%20165.788%2081.4857C160.526%2092.163%20153.797%20109.54%20147.284%20133.866C133.171%20186.543%20122.623%20297.706%20209.867%20321.098C297.093%20344.47%20343.53%20242.92%20357.644%20190.238C364.157%20165.917%20367.013%20147.5%20367.799%20135.625C368.695%20122.173%20359.455%20126.078%20341.786%20129.174ZM166.497%20172.756C166.497%20172.756%20180.246%20151.372%20203.565%20158C226.899%20164.628%20228.706%20190.425%20228.706%20190.425L166.497%20172.756ZM223.42%20268.713C182.403%20256.698%20176.077%20223.99%20176.077%20223.99L286.262%20254.796C286.262%20254.791%20264.021%20280.578%20223.42%20268.713ZM262.377%20201.495C262.377%20201.495%20276.107%20180.126%20299.422%20186.773C322.736%20193.411%20324.572%20219.208%20324.572%20219.208L262.377%20201.495Z'%20fill='%232EAD33'/%3e%3cpath%20d='M139.88%20246.04L99.3324%20257.532C99.3324%20257.532%20103.737%20232.44%20133.607%20222.496L110.647%20136.33L108.663%20136.933C80.1918%20144.611%2057.1742%20142.574%2047.5704%20140.911C33.9554%20138.563%2026.834%20135.572%2027.5001%20145.929C28.08%20155.063%2030.2557%20169.224%2035.2397%20187.929C46.0225%20228.433%2081.6583%20306.481%20149.005%20288.342L150.989%20287.719L139.88%20246.04ZM61.0848%20188.485L108.946%20175.876C108.946%20175.876%20107.551%20194.288%2089.6087%20199.018C71.6615%20203.743%2061.0848%20188.485%2061.0848%20188.485Z'%20fill='%23D65348'/%3e%3cpath%20d='M225.27%20269.163L223.415%20268.712C182.398%20256.698%20176.072%20223.99%20176.072%20223.99L232.89%20239.872L262.971%20124.281L262.607%20124.185C225.711%20114.304%20201.232%2097.0224%20191.532%2088.8994C177.783%2077.3834%20171.735%2069.3802%20165.783%2081.4857C160.526%2092.163%20153.797%20109.54%20147.284%20133.866C133.171%20186.543%20122.623%20297.706%20209.867%20321.097L211.655%20321.5L225.27%20269.163ZM166.497%20172.756C166.497%20172.756%20180.246%20151.372%20203.565%20158C226.899%20164.628%20228.706%20190.425%20228.706%20190.425L166.497%20172.756Z'%20fill='%231D8D22'/%3e%3cpath%20d='M141.946%20245.451L131.072%20248.537C133.641%20263.019%20138.169%20276.917%20145.276%20289.195C146.513%20288.922%20147.74%20288.687%20149%20288.342C152.302%20287.451%20155.364%20286.348%20158.312%20285.145C150.371%20273.361%20145.118%20259.789%20141.946%20245.451ZM137.7%20143.451C132.112%20164.307%20127.113%20194.326%20128.489%20224.436C130.952%20223.367%20133.554%20222.371%20136.444%20221.551L138.457%20221.101C136.003%20188.939%20141.308%20156.165%20147.284%20133.866C148.799%20128.225%20150.318%20122.978%20151.832%20118.085C149.393%20119.637%20146.767%20121.228%20143.776%20122.867C141.759%20129.093%20139.722%20135.898%20137.7%20143.451Z'%20fill='%23C04B41'/%3e%3c/svg%3e",If=t3,vr=document.createElement("link");vr.rel="shortcut icon";vr.href=Nv;document.head.appendChild(vr);const Hv=()=>{const[i,u]=it.useState();return it.useEffect(()=>{const c=new Bv;c.load().then(()=>{var f;(f=document.getElementById("playwrightReportBase64"))==null||f.remove(),u(c)})},[]),m.jsx(R3,{children:m.jsx(Ov,{report:i})})};window.onload=()=>{Q3(),s3.createRoot(document.querySelector("#root")).render(m.jsx(Hv,{}))};class Bv{constructor(){this._entries=new Map}async load(){const u=document.getElementById("playwrightReportBase64").content.textContent,c=new If.ZipReader(new If.Data64URIReader(u),{useWebWorkers:!1});for(const f of await c.getEntries())this._entries.set(f.filename,f);this._json=await this.entry("report.json")}json(){return this._json}async entry(u){const c=this._entries.get(u),f=new If.TextWriter;return await c.getData(f),JSON.parse(await f.getData())}}
.CodeMirror{font-family:monospace;height:300px;color:#000;direction:ltr}.CodeMirror-lines{padding:4px 0}.CodeMirror pre.CodeMirror-line,.CodeMirror pre.CodeMirror-line-like{padding:0 4px}.CodeMirror-scrollbar-filler,.CodeMirror-gutter-filler{background-color:#fff}.CodeMirror-gutters{border-right:1px solid #ddd;background-color:#f7f7f7;white-space:nowrap}.CodeMirror-linenumber{padding:0 3px 0 5px;min-width:20px;text-align:right;color:#999;white-space:nowrap}.CodeMirror-guttermarker{color:#000}.CodeMirror-guttermarker-subtle{color:#999}.CodeMirror-cursor{border-left:1px solid black;border-right:none;width:0}.CodeMirror div.CodeMirror-secondarycursor{border-left:1px solid silver}.cm-fat-cursor .CodeMirror-cursor{width:auto;border:0!important;background:#7e7}.cm-fat-cursor div.CodeMirror-cursors{z-index:1}.cm-fat-cursor .CodeMirror-line::selection,.cm-fat-cursor .CodeMirror-line>span::selection,.cm-fat-cursor .CodeMirror-line>span>span::selection{background:transparent}.cm-fat-cursor .CodeMirror-line::-moz-selection,.cm-fat-cursor .CodeMirror-line>span::-moz-selection,.cm-fat-cursor .CodeMirror-line>span>span::-moz-selection{background:transparent}.cm-fat-cursor{caret-color:transparent}@-moz-keyframes blink{50%{background-color:transparent}}@-webkit-keyframes blink{50%{background-color:transparent}}@keyframes blink{50%{background-color:transparent}}.cm-tab{display:inline-block;text-decoration:inherit}.CodeMirror-rulers{position:absolute;left:0;right:0;top:-50px;bottom:0;overflow:hidden}.CodeMirror-ruler{border-left:1px solid #ccc;top:0;bottom:0;position:absolute}.cm-s-default .cm-header{color:#00f}.cm-s-default .cm-quote{color:#090}.cm-negative{color:#d44}.cm-positive{color:#292}.cm-header,.cm-strong{font-weight:700}.cm-em{font-style:italic}.cm-link{text-decoration:underline}.cm-strikethrough{text-decoration:line-through}.cm-s-default .cm-keyword{color:#708}.cm-s-default .cm-atom{color:#219}.cm-s-default .cm-number{color:#164}.cm-s-default .cm-def{color:#00f}.cm-s-default .cm-variable-2{color:#05a}.cm-s-default .cm-variable-3,.cm-s-default .cm-type{color:#085}.cm-s-default .cm-comment{color:#a50}.cm-s-default .cm-string{color:#a11}.cm-s-default .cm-string-2{color:#f50}.cm-s-default .cm-meta,.cm-s-default .cm-qualifier{color:#555}.cm-s-default .cm-builtin{color:#30a}.cm-s-default .cm-bracket{color:#997}.cm-s-default .cm-tag{color:#170}.cm-s-default .cm-attribute{color:#00c}.cm-s-default .cm-hr{color:#999}.cm-s-default .cm-link{color:#00c}.cm-s-default .cm-error,.cm-invalidchar{color:red}.CodeMirror-composing{border-bottom:2px solid}div.CodeMirror span.CodeMirror-matchingbracket{color:#0b0}div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#a22}.CodeMirror-matchingtag{background:#ff96004d}.CodeMirror-activeline-background{background:#e8f2ff}.CodeMirror{position:relative;overflow:hidden;background:#fff}.CodeMirror-scroll{overflow:scroll!important;margin-bottom:-50px;margin-right:-50px;padding-bottom:50px;height:100%;outline:none;position:relative;z-index:0}.CodeMirror-sizer{position:relative;border-right:50px solid transparent}.CodeMirror-vscrollbar,.CodeMirror-hscrollbar,.CodeMirror-scrollbar-filler,.CodeMirror-gutter-filler{position:absolute;z-index:6;display:none;outline:none}.CodeMirror-vscrollbar{right:0;top:0;overflow-x:hidden;overflow-y:scroll}.CodeMirror-hscrollbar{bottom:0;left:0;overflow-y:hidden;overflow-x:scroll}.CodeMirror-scrollbar-filler{right:0;bottom:0}.CodeMirror-gutter-filler{left:0;bottom:0}.CodeMirror-gutters{position:absolute;left:0;top:0;min-height:100%;z-index:3}.CodeMirror-gutter{white-space:normal;height:100%;display:inline-block;vertical-align:top;margin-bottom:-50px}.CodeMirror-gutter-wrapper{position:absolute;z-index:4;background:none!important;border:none!important}.CodeMirror-gutter-background{position:absolute;top:0;bottom:0;z-index:4}.CodeMirror-gutter-elt{position:absolute;cursor:default;z-index:4}.CodeMirror-gutter-wrapper ::selection{background-color:transparent}.CodeMirror-gutter-wrapper ::-moz-selection{background-color:transparent}.CodeMirror-lines{cursor:text;min-height:1px}.CodeMirror pre.CodeMirror-line,.CodeMirror pre.CodeMirror-line-like{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;border-width:0;background:transparent;font-family:inherit;font-size:inherit;margin:0;white-space:pre;word-wrap:normal;line-height:inherit;color:inherit;z-index:2;position:relative;overflow:visible;-webkit-tap-highlight-color:transparent;-webkit-font-variant-ligatures:contextual;font-variant-ligatures:contextual}.CodeMirror-wrap pre.CodeMirror-line,.CodeMirror-wrap pre.CodeMirror-line-like{word-wrap:break-word;white-space:pre-wrap;word-break:normal}.CodeMirror-linebackground{position:absolute;left:0;right:0;top:0;bottom:0;z-index:0}.CodeMirror-linewidget{position:relative;z-index:2;padding:.1px}.CodeMirror-rtl pre{direction:rtl}.CodeMirror-code{outline:none}.CodeMirror-scroll,.CodeMirror-sizer,.CodeMirror-gutter,.CodeMirror-gutters,.CodeMirror-linenumber{-moz-box-sizing:content-box;box-sizing:content-box}.CodeMirror-measure{position:absolute;width:100%;height:0;overflow:hidden;visibility:hidden}.CodeMirror-cursor{position:absolute;pointer-events:none}.CodeMirror-measure pre{position:static}div.CodeMirror-cursors{visibility:hidden;position:relative;z-index:3}div.CodeMirror-dragcursors,.CodeMirror-focused div.CodeMirror-cursors{visibility:visible}.CodeMirror-selected{background:#d9d9d9}.CodeMirror-focused .CodeMirror-selected{background:#d7d4f0}.CodeMirror-crosshair{cursor:crosshair}.CodeMirror-line::selection,.CodeMirror-line>span::selection,.CodeMirror-line>span>span::selection{background:#d7d4f0}.CodeMirror-line::-moz-selection,.CodeMirror-line>span::-moz-selection,.CodeMirror-line>span>span::-moz-selection{background:#d7d4f0}.cm-searching{background-color:#ffa;background-color:#ff06}.cm-force-border{padding-right:.1px}@media print{.CodeMirror div.CodeMirror-cursors{visibility:hidden}}.cm-tab-wrap-hack:after{content:""}span.CodeMirror-selectedtext{background:none}.CodeMirror-dialog{position:absolute;left:0;right:0;background:inherit;z-index:15;padding:.1em .8em;overflow:hidden;color:inherit}.CodeMirror-dialog-top{border-bottom:1px solid #eee;top:0}.CodeMirror-dialog-bottom{border-top:1px solid #eee;bottom:0}.CodeMirror-dialog input{border:none;outline:none;background:transparent;width:20em;color:inherit;font-family:monospace}.CodeMirror-dialog button{font-size:70%}
import{g as Ju}from"./index-Bq-mQf8S.js";var vi={exports:{}},Zu=vi.exports,pa;function mt(){return pa||(pa=1,(function(ct,xt){(function(b,pe){ct.exports=pe()})(Zu,(function(){var b=navigator.userAgent,pe=navigator.platform,_=/gecko\/\d/i.test(b),te=/MSIE \d/.test(b),oe=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(b),Q=/Edge\/(\d+)/.exec(b),k=te||oe||Q,I=k&&(te?document.documentMode||6:+(Q||oe)[1]),Y=!Q&&/WebKit\//.test(b),ne=Y&&/Qt\/\d+\.\d+/.test(b),S=!Q&&/Chrome\/(\d+)/.exec(b),R=S&&+S[1],A=/Opera\//.test(b),$=/Apple Computer/.test(navigator.vendor),ue=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(b),O=/PhantomJS/.test(b),w=$&&(/Mobile\/\w+/.test(b)||navigator.maxTouchPoints>2),M=/Android/.test(b),N=w||M||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(b),z=w||/Mac/.test(pe),X=/\bCrOS\b/.test(b),q=/win/i.test(pe),p=A&&b.match(/Version\/(\d*\.\d*)/);p&&(p=Number(p[1])),p&&p>=15&&(A=!1,Y=!0);var W=z&&(ne||A&&(p==null||p<12.11)),J=_||k&&I>=9;function P(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var V=function(e,t){var n=e.className,r=P(t).exec(n);if(r){var i=n.slice(r.index+r[0].length);e.className=n.slice(0,r.index)+(i?r[1]+i:"")}};function F(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function G(e,t){return F(e).appendChild(t)}function c(e,t,n,r){var i=document.createElement(e);if(n&&(i.className=n),r&&(i.style.cssText=r),typeof t=="string")i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o<t.length;++o)i.appendChild(t[o]);return i}function T(e,t,n,r){var i=c(e,t,n,r);return i.setAttribute("role","presentation"),i}var C;document.createRange?C=function(e,t,n,r){var i=document.createRange();return i.setEnd(r||e,n),i.setStart(e,t),i}:C=function(e,t,n){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch{return r}return r.collapse(!0),r.moveEnd("character",n),r.moveStart("character",t),r};function g(e,t){if(t.nodeType==3&&(t=t.parentNode),e.contains)return e.contains(t);do if(t.nodeType==11&&(t=t.host),t==e)return!0;while(t=t.parentNode)}function y(e){var t=e.ownerDocument||e,n;try{n=e.activeElement}catch{n=t.body||null}for(;n&&n.shadowRoot&&n.shadowRoot.activeElement;)n=n.shadowRoot.activeElement;return n}function j(e,t){var n=e.className;P(t).test(n)||(e.className+=(n?" ":"")+t)}function de(e,t){for(var n=e.split(" "),r=0;r<n.length;r++)n[r]&&!P(n[r]).test(t)&&(t+=" "+n[r]);return t}var v=function(e){e.select()};w?v=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:k&&(v=function(e){try{e.select()}catch{}});function d(e){return e.display.wrapper.ownerDocument}function fe(e){return Te(e.display.wrapper)}function Te(e){return e.getRootNode?e.getRootNode():e.ownerDocument}function le(e){return d(e).defaultView}function xe(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function Me(e,t,n){t||(t={});for(var r in e)e.hasOwnProperty(r)&&(n!==!1||!t.hasOwnProperty(r))&&(t[r]=e[r]);return t}function Fe(e,t,n,r,i){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var o=r||0,l=i||0;;){var a=e.indexOf("	",o);if(a<0||a>=t)return l+(t-o);l+=a-o,l+=n-l%n,o=a+1}}var Ce=function(){this.id=null,this.f=null,this.time=0,this.handler=xe(this.onTimeout,this)};Ce.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},Ce.prototype.set=function(e,t){this.f=t;var n=+new Date+e;(!this.id||n<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=n)};function ve(e,t){for(var n=0;n<e.length;++n)if(e[n]==t)return n;return-1}var Oe=50,qe={toString:function(){return"CodeMirror.Pass"}},$e={scroll:!1},dt={origin:"*mouse"},Pe={origin:"+move"};function _e(e,t,n){for(var r=0,i=0;;){var o=e.indexOf("	",r);o==-1&&(o=e.length);var l=o-r;if(o==e.length||i+l>=t)return r+Math.min(l,t-i);if(i+=o-r,i+=n-i%n,r=o+1,i>=t)return r}}var Ue=[""];function et(e){for(;Ue.length<=e;)Ue.push(we(Ue)+" ");return Ue[e]}function we(e){return e[e.length-1]}function Ie(e,t){for(var n=[],r=0;r<e.length;r++)n[r]=t(e[r],r);return n}function E(e,t,n){for(var r=0,i=n(t);r<e.length&&n(e[r])<=i;)r++;e.splice(r,0,t)}function ee(){}function K(e,t){var n;return Object.create?n=Object.create(e):(ee.prototype=e,n=new ee),t&&Me(t,n),n}var ze=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function me(e){return/\w/.test(e)||e>"Â€"&&(e.toUpperCase()!=e.toLowerCase()||ze.test(e))}function De(e,t){return t?t.source.indexOf("\\w")>-1&&me(e)?!0:t.test(e):me(e)}function be(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var Be=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function Ne(e){return e.charCodeAt(0)>=768&&Be.test(e)}function Mt(e,t,n){for(;(n<0?t>0:t<e.length)&&Ne(e.charAt(t));)t+=n;return t}function Pt(e,t,n){for(var r=t>n?-1:1;;){if(t==n)return t;var i=(t+n)/2,o=r<0?Math.ceil(i):Math.floor(i);if(o==t)return e(o)?t:n;e(o)?n=o:t=o+r}}function or(e,t,n,r){if(!e)return r(t,n,"ltr",0);for(var i=!1,o=0;o<e.length;++o){var l=e[o];(l.from<n&&l.to>t||t==n&&l.to==t)&&(r(Math.max(l.from,t),Math.min(l.to,n),l.level==1?"rtl":"ltr",o),i=!0)}i||r(t,n,"ltr")}var br=null;function lr(e,t,n){var r;br=null;for(var i=0;i<e.length;++i){var o=e[i];if(o.from<t&&o.to>t)return i;o.to==t&&(o.from!=o.to&&n=="before"?r=i:br=i),o.from==t&&(o.from!=o.to&&n!="before"?r=i:br=i)}return r??br}var mi=(function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function n(u){return u<=247?e.charAt(u):1424<=u&&u<=1524?"R":1536<=u&&u<=1785?t.charAt(u-1536):1774<=u&&u<=2220?"r":8192<=u&&u<=8203?"w":u==8204?"b":"L"}var r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,i=/[stwN]/,o=/[LRr]/,l=/[Lb1n]/,a=/[1n]/;function s(u,h,x){this.level=u,this.from=h,this.to=x}return function(u,h){var x=h=="ltr"?"L":"R";if(u.length==0||h=="ltr"&&!r.test(u))return!1;for(var D=u.length,L=[],H=0;H<D;++H)L.push(n(u.charCodeAt(H)));for(var Z=0,ie=x;Z<D;++Z){var ae=L[Z];ae=="m"?L[Z]=ie:ie=ae}for(var he=0,se=x;he<D;++he){var ge=L[he];ge=="1"&&se=="r"?L[he]="n":o.test(ge)&&(se=ge,ge=="r"&&(L[he]="R"))}for(var Le=1,ke=L[0];Le<D-1;++Le){var Ee=L[Le];Ee=="+"&&ke=="1"&&L[Le+1]=="1"?L[Le]="1":Ee==","&&ke==L[Le+1]&&(ke=="1"||ke=="n")&&(L[Le]=ke),ke=Ee}for(var Ke=0;Ke<D;++Ke){var st=L[Ke];if(st==",")L[Ke]="N";else if(st=="%"){var Xe=void 0;for(Xe=Ke+1;Xe<D&&L[Xe]=="%";++Xe);for(var Nt=Ke&&L[Ke-1]=="!"||Xe<D&&L[Xe]=="1"?"1":"N",Tt=Ke;Tt<Xe;++Tt)L[Tt]=Nt;Ke=Xe-1}}for(var tt=0,Ct=x;tt<D;++tt){var ft=L[tt];Ct=="L"&&ft=="1"?L[tt]="L":o.test(ft)&&(Ct=ft)}for(var nt=0;nt<D;++nt)if(i.test(L[nt])){var rt=void 0;for(rt=nt+1;rt<D&&i.test(L[rt]);++rt);for(var Ze=(nt?L[nt-1]:x)=="L",Dt=(rt<D?L[rt]:x)=="L",nn=Ze==Dt?Ze?"L":"R":x,yr=nt;yr<rt;++yr)L[yr]=nn;nt=rt-1}for(var vt=[],Jt,ut=0;ut<D;)if(l.test(L[ut])){var co=ut;for(++ut;ut<D&&l.test(L[ut]);++ut);vt.push(new s(0,co,ut))}else{var ir=ut,Ar=vt.length,Nr=h=="rtl"?1:0;for(++ut;ut<D&&L[ut]!="L";++ut);for(var bt=ir;bt<ut;)if(a.test(L[bt])){ir<bt&&(vt.splice(Ar,0,new s(1,ir,bt)),Ar+=Nr);var on=bt;for(++bt;bt<ut&&a.test(L[bt]);++bt);vt.splice(Ar,0,new s(2,on,bt)),Ar+=Nr,ir=bt}else++bt;ir<ut&&vt.splice(Ar,0,new s(1,ir,ut))}return h=="ltr"&&(vt[0].level==1&&(Jt=u.match(/^\s+/))&&(vt[0].from=Jt[0].length,vt.unshift(new s(0,0,Jt[0].length))),we(vt).level==1&&(Jt=u.match(/\s+$/))&&(we(vt).to-=Jt[0].length,vt.push(new s(0,D-Jt[0].length,D)))),h=="rtl"?vt.reverse():vt}})();function Re(e,t){var n=e.order;return n==null&&(n=e.order=mi(e.text,t)),n}var Bn=[],Se=function(e,t,n){if(e.addEventListener)e.addEventListener(t,n,!1);else if(e.attachEvent)e.attachEvent("on"+t,n);else{var r=e._handlers||(e._handlers={});r[t]=(r[t]||Bn).concat(n)}};function Zt(e,t){return e._handlers&&e._handlers[t]||Bn}function ht(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n,!1);else if(e.detachEvent)e.detachEvent("on"+t,n);else{var r=e._handlers,i=r&&r[t];if(i){var o=ve(i,n);o>-1&&(r[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function Ye(e,t){var n=Zt(e,t);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),i=0;i<n.length;++i)n[i].apply(null,r)}function Qe(e,t,n){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),Ye(e,n||t.type,e,t),kt(t)||t.codemirrorIgnore}function It(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var n=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),r=0;r<t.length;++r)ve(n,t[r])==-1&&n.push(t[r])}function Ft(e,t){return Zt(e,t).length>0}function Bt(e){e.prototype.on=function(t,n){Se(this,t,n)},e.prototype.off=function(t,n){ht(this,t,n)}}function pt(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Er(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function kt(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function ar(e){pt(e),Er(e)}function ln(e){return e.target||e.srcElement}function Rt(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),z&&e.ctrlKey&&t==1&&(t=3),t}var xi=(function(){if(k&&I<9)return!1;var e=c("div");return"draggable"in e||"dragDrop"in e})(),Or;function Rn(e){if(Or==null){var t=c("span","â€‹");G(e,c("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(Or=t.offsetWidth<=1&&t.offsetHeight>2&&!(k&&I<8))}var n=Or?c("span","â€‹"):c("span","Â ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}var an;function sr(e){if(an!=null)return an;var t=G(e,document.createTextNode("AØ®A")),n=C(t,0,1).getBoundingClientRect(),r=C(t,1,2).getBoundingClientRect();return F(e),!n||n.left==n.right?!1:an=r.right-n.right<3}var zt=`

b`.split(/\n/).length!=3?function(e){for(var t=0,n=[],r=e.length;t<=r;){var i=e.indexOf(`
`,t);i==-1&&(i=e.length);var o=e.slice(t,e.charAt(i-1)=="\r"?i-1:i),l=o.indexOf("\r");l!=-1?(n.push(o.slice(0,l)),t+=l+1):(n.push(o),t=i+1)}return n}:function(e){return e.split(/\r\n?|\n/)},ur=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch{return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch{}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},Wn=(function(){var e=c("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")})(),Wt=null;function yi(e){if(Wt!=null)return Wt;var t=G(e,c("span","x")),n=t.getBoundingClientRect(),r=C(t,0,1).getBoundingClientRect();return Wt=Math.abs(n.left-r.left)>1}var Pr={},Ht={};function _t(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Pr[e]=t}function kr(e,t){Ht[e]=t}function Ir(e){if(typeof e=="string"&&Ht.hasOwnProperty(e))e=Ht[e];else if(e&&typeof e.name=="string"&&Ht.hasOwnProperty(e.name)){var t=Ht[e.name];typeof t=="string"&&(t={name:t}),e=K(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Ir("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Ir("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function zr(e,t){t=Ir(t);var n=Pr[t.name];if(!n)return zr(e,"text/plain");var r=n(e,t);if(fr.hasOwnProperty(t.name)){var i=fr[t.name];for(var o in i)i.hasOwnProperty(o)&&(r.hasOwnProperty(o)&&(r["_"+o]=r[o]),r[o]=i[o])}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var l in t.modeProps)r[l]=t.modeProps[l];return r}var fr={};function Br(e,t){var n=fr.hasOwnProperty(e)?fr[e]:fr[e]={};Me(t,n)}function Gt(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var i=t[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n}function sn(e,t){for(var n;e.innerMode&&(n=e.innerMode(t),!(!n||n.mode==e));)t=n.state,e=n.mode;return n||{mode:e,state:t}}function Rr(e,t,n){return e.startState?e.startState(t,n):!0}var Je=function(e,t,n){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};Je.prototype.eol=function(){return this.pos>=this.string.length},Je.prototype.sol=function(){return this.pos==this.lineStart},Je.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Je.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Je.prototype.eat=function(e){var t=this.string.charAt(this.pos),n;if(typeof e=="string"?n=t==e:n=t&&(e.test?e.test(t):e(t)),n)return++this.pos,t},Je.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Je.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Je.prototype.skipToEnd=function(){this.pos=this.string.length},Je.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Je.prototype.backUp=function(e){this.pos-=e},Je.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=Fe(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?Fe(this.string,this.lineStart,this.tabSize):0)},Je.prototype.indentation=function(){return Fe(this.string,null,this.tabSize)-(this.lineStart?Fe(this.string,this.lineStart,this.tabSize):0)},Je.prototype.match=function(e,t,n){if(typeof e=="string"){var r=function(l){return n?l.toLowerCase():l},i=this.string.substr(this.pos,e.length);if(r(i)==r(e))return t!==!1&&(this.pos+=e.length),!0}else{var o=this.string.slice(this.pos).match(e);return o&&o.index>0?null:(o&&t!==!1&&(this.pos+=o[0].length),o)}},Je.prototype.current=function(){return this.string.slice(this.start,this.pos)},Je.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Je.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Je.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function ye(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var n=e;!n.lines;)for(var r=0;;++r){var i=n.children[r],o=i.chunkSize();if(t<o){n=i;break}t-=o}return n.lines[t]}function $t(e,t,n){var r=[],i=t.line;return e.iter(t.line,n.line+1,function(o){var l=o.text;i==n.line&&(l=l.slice(0,n.ch)),i==t.line&&(l=l.slice(t.ch)),r.push(l),++i}),r}function un(e,t,n){var r=[];return e.iter(t,n,function(i){r.push(i.text)}),r}function Et(e,t){var n=t-e.height;if(n)for(var r=e;r;r=r.parent)r.height+=n}function f(e){if(e.parent==null)return null;for(var t=e.parent,n=ve(t.lines,e),r=t.parent;r;t=r,r=r.parent)for(var i=0;r.children[i]!=t;++i)n+=r.children[i].chunkSize();return n+t.first}function m(e,t){var n=e.first;e:do{for(var r=0;r<e.children.length;++r){var i=e.children[r],o=i.height;if(t<o){e=i;continue e}t-=o,n+=i.chunkSize()}return n}while(!e.lines);for(var l=0;l<e.lines.length;++l){var a=e.lines[l],s=a.height;if(t<s)break;t-=s}return n+l}function U(e,t){return t>=e.first&&t<e.first+e.size}function re(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function B(e,t,n){if(n===void 0&&(n=null),!(this instanceof B))return new B(e,t,n);this.line=e,this.ch=t,this.sticky=n}function ce(e,t){return e.line-t.line||e.ch-t.ch}function We(e,t){return e.sticky==t.sticky&&ce(e,t)==0}function it(e){return B(e.line,e.ch)}function wt(e,t){return ce(e,t)<0?t:e}function Wr(e,t){return ce(e,t)<0?e:t}function go(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function Ae(e,t){if(t.line<e.first)return B(e.first,0);var n=e.first+e.size-1;return t.line>n?B(n,ye(e,n).text.length):Za(t,ye(e,t.line).text.length)}function Za(e,t){var n=e.ch;return n==null||n>t?B(e.line,t):n<0?B(e.line,0):e}function vo(e,t){for(var n=[],r=0;r<t.length;r++)n[r]=Ae(e,t[r]);return n}var Hn=function(e,t){this.state=e,this.lookAhead=t},Xt=function(e,t,n,r){this.state=t,this.doc=e,this.line=n,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};Xt.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},Xt.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},Xt.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Xt.fromSaved=function(e,t,n){return t instanceof Hn?new Xt(e,Gt(e.mode,t.state),n,t.lookAhead):new Xt(e,Gt(e.mode,t),n)},Xt.prototype.save=function(e){var t=e!==!1?Gt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new Hn(t,this.maxLookAhead):t};function mo(e,t,n,r){var i=[e.state.modeGen],o={};So(e,t.text,e.doc.mode,n,function(u,h){return i.push(u,h)},o,r);for(var l=n.state,a=function(u){n.baseTokens=i;var h=e.state.overlays[u],x=1,D=0;n.state=!0,So(e,t.text,h.mode,n,function(L,H){for(var Z=x;D<L;){var ie=i[x];ie>L&&i.splice(x,1,L,i[x+1],ie),x+=2,D=Math.min(L,ie)}if(H)if(h.opaque)i.splice(Z,x-Z,L,"overlay "+H),x=Z+2;else for(;Z<x;Z+=2){var ae=i[Z+1];i[Z+1]=(ae?ae+" ":"")+"overlay "+H}},o),n.state=l,n.baseTokens=null,n.baseTokenPos=1},s=0;s<e.state.overlays.length;++s)a(s);return{styles:i,classes:o.bgClass||o.textClass?o:null}}function xo(e,t,n){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=fn(e,f(t)),i=t.text.length>e.options.maxHighlightLength&&Gt(e.doc.mode,r.state),o=mo(e,t,r);i&&(r.state=i),t.stateAfter=r.save(!i),t.styles=o.styles,o.classes?t.styleClasses=o.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function fn(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return new Xt(r,!0,t);var o=$a(e,t,n),l=o>r.first&&ye(r,o-1).stateAfter,a=l?Xt.fromSaved(r,l,o):new Xt(r,Rr(r.mode),o);return r.iter(o,t,function(s){bi(e,s.text,a);var u=a.line;s.stateAfter=u==t-1||u%5==0||u>=i.viewFrom&&u<i.viewTo?a.save():null,a.nextLine()}),n&&(r.modeFrontier=a.line),a}function bi(e,t,n,r){var i=e.doc.mode,o=new Je(t,e.options.tabSize,n);for(o.start=o.pos=r||0,t==""&&yo(i,n.state);!o.eol();)ki(i,o,n.state),o.start=o.pos}function yo(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var n=sn(e,t);if(n.mode.blankLine)return n.mode.blankLine(n.state)}}function ki(e,t,n,r){for(var i=0;i<10;i++){r&&(r[0]=sn(e,n).mode);var o=e.token(t,n);if(t.pos>t.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}var bo=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function ko(e,t,n,r){var i=e.doc,o=i.mode,l;t=Ae(i,t);var a=ye(i,t.line),s=fn(e,t.line,n),u=new Je(a.text,e.options.tabSize,s),h;for(r&&(h=[]);(r||u.pos<t.ch)&&!u.eol();)u.start=u.pos,l=ki(o,u,s.state),r&&h.push(new bo(u,l,Gt(i.mode,s.state)));return r?h:new bo(u,l,s.state)}function wo(e,t){if(e)for(;;){var n=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!n)break;e=e.slice(0,n.index)+e.slice(n.index+n[0].length);var r=n[1]?"bgClass":"textClass";t[r]==null?t[r]=n[2]:new RegExp("(?:^|\\s)"+n[2]+"(?:$|\\s)").test(t[r])||(t[r]+=" "+n[2])}return e}function So(e,t,n,r,i,o,l){var a=n.flattenSpans;a==null&&(a=e.options.flattenSpans);var s=0,u=null,h=new Je(t,e.options.tabSize,r),x,D=e.options.addModeClass&&[null];for(t==""&&wo(yo(n,r.state),o);!h.eol();){if(h.pos>e.options.maxHighlightLength?(a=!1,l&&bi(e,t,r,h.pos),h.pos=t.length,x=null):x=wo(ki(n,h,r.state,D),o),D){var L=D[0].name;L&&(x="m-"+(x?L+" "+x:L))}if(!a||u!=x){for(;s<h.start;)s=Math.min(h.start,s+5e3),i(s,u);u=x}h.start=h.pos}for(;s<h.pos;){var H=Math.min(h.pos,s+5e3);i(H,u),s=H}}function $a(e,t,n){for(var r,i,o=e.doc,l=n?-1:t-(e.doc.mode.innerMode?1e3:100),a=t;a>l;--a){if(a<=o.first)return o.first;var s=ye(o,a-1),u=s.stateAfter;if(u&&(!n||a+(u instanceof Hn?u.lookAhead:0)<=o.modeFrontier))return a;var h=Fe(s.text,null,e.options.tabSize);(i==null||r>h)&&(i=a-1,r=h)}return i}function Va(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontier<t-10)){for(var n=e.first,r=t-1;r>n;r--){var i=ye(e,r).stateAfter;if(i&&(!(i instanceof Hn)||r+i.lookAhead<t)){n=r+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,n)}}var Lo=!1,Vt=!1;function es(){Lo=!0}function ts(){Vt=!0}function _n(e,t,n){this.marker=e,this.from=t,this.to=n}function cn(e,t){if(e)for(var n=0;n<e.length;++n){var r=e[n];if(r.marker==t)return r}}function rs(e,t){for(var n,r=0;r<e.length;++r)e[r]!=t&&(n||(n=[])).push(e[r]);return n}function ns(e,t,n){var r=n&&window.WeakSet&&(n.markedSpans||(n.markedSpans=new WeakSet));r&&e.markedSpans&&r.has(e.markedSpans)?e.markedSpans.push(t):(e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],r&&r.add(e.markedSpans)),t.marker.attachLine(e)}function is(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var o=e[i],l=o.marker,a=o.from==null||(l.inclusiveLeft?o.from<=t:o.from<t);if(a||o.from==t&&l.type=="bookmark"&&(!n||!o.marker.insertLeft)){var s=o.to==null||(l.inclusiveRight?o.to>=t:o.to>t);(r||(r=[])).push(new _n(l,o.from,s?null:o.to))}}return r}function os(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var o=e[i],l=o.marker,a=o.to==null||(l.inclusiveRight?o.to>=t:o.to>t);if(a||o.from==t&&l.type=="bookmark"&&(!n||o.marker.insertLeft)){var s=o.from==null||(l.inclusiveLeft?o.from<=t:o.from<t);(r||(r=[])).push(new _n(l,s?null:o.from-t,o.to==null?null:o.to-t))}}return r}function wi(e,t){if(t.full)return null;var n=U(e,t.from.line)&&ye(e,t.from.line).markedSpans,r=U(e,t.to.line)&&ye(e,t.to.line).markedSpans;if(!n&&!r)return null;var i=t.from.ch,o=t.to.ch,l=ce(t.from,t.to)==0,a=is(n,i,l),s=os(r,o,l),u=t.text.length==1,h=we(t.text).length+(u?i:0);if(a)for(var x=0;x<a.length;++x){var D=a[x];if(D.to==null){var L=cn(s,D.marker);L?u&&(D.to=L.to==null?null:L.to+h):D.to=i}}if(s)for(var H=0;H<s.length;++H){var Z=s[H];if(Z.to!=null&&(Z.to+=h),Z.from==null){var ie=cn(a,Z.marker);ie||(Z.from=h,u&&(a||(a=[])).push(Z))}else Z.from+=h,u&&(a||(a=[])).push(Z)}a&&(a=To(a)),s&&s!=a&&(s=To(s));var ae=[a];if(!u){var he=t.text.length-2,se;if(he>0&&a)for(var ge=0;ge<a.length;++ge)a[ge].to==null&&(se||(se=[])).push(new _n(a[ge].marker,null,null));for(var Le=0;Le<he;++Le)ae.push(se);ae.push(s)}return ae}function To(e){for(var t=0;t<e.length;++t){var n=e[t];n.from!=null&&n.from==n.to&&n.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function ls(e,t,n){var r=null;if(e.iter(t.line,n.line+1,function(L){if(L.markedSpans)for(var H=0;H<L.markedSpans.length;++H){var Z=L.markedSpans[H].marker;Z.readOnly&&(!r||ve(r,Z)==-1)&&(r||(r=[])).push(Z)}}),!r)return null;for(var i=[{from:t,to:n}],o=0;o<r.length;++o)for(var l=r[o],a=l.find(0),s=0;s<i.length;++s){var u=i[s];if(!(ce(u.to,a.from)<0||ce(u.from,a.to)>0)){var h=[s,1],x=ce(u.from,a.from),D=ce(u.to,a.to);(x<0||!l.inclusiveLeft&&!x)&&h.push({from:u.from,to:a.from}),(D>0||!l.inclusiveRight&&!D)&&h.push({from:a.to,to:u.to}),i.splice.apply(i,h),s+=h.length-3}}return i}function Co(e){var t=e.markedSpans;if(t){for(var n=0;n<t.length;++n)t[n].marker.detachLine(e);e.markedSpans=null}}function Do(e,t){if(t){for(var n=0;n<t.length;++n)t[n].marker.attachLine(e);e.markedSpans=t}}function qn(e){return e.inclusiveLeft?-1:0}function jn(e){return e.inclusiveRight?1:0}function Si(e,t){var n=e.lines.length-t.lines.length;if(n!=0)return n;var r=e.find(),i=t.find(),o=ce(r.from,i.from)||qn(e)-qn(t);if(o)return-o;var l=ce(r.to,i.to)||jn(e)-jn(t);return l||t.id-e.id}function Mo(e,t){var n=Vt&&e.markedSpans,r;if(n)for(var i=void 0,o=0;o<n.length;++o)i=n[o],i.marker.collapsed&&(t?i.from:i.to)==null&&(!r||Si(r,i.marker)<0)&&(r=i.marker);return r}function Fo(e){return Mo(e,!0)}function Kn(e){return Mo(e,!1)}function as(e,t){var n=Vt&&e.markedSpans,r;if(n)for(var i=0;i<n.length;++i){var o=n[i];o.marker.collapsed&&(o.from==null||o.from<t)&&(o.to==null||o.to>t)&&(!r||Si(r,o.marker)<0)&&(r=o.marker)}return r}function Ao(e,t,n,r,i){var o=ye(e,t),l=Vt&&o.markedSpans;if(l)for(var a=0;a<l.length;++a){var s=l[a];if(s.marker.collapsed){var u=s.marker.find(0),h=ce(u.from,n)||qn(s.marker)-qn(i),x=ce(u.to,r)||jn(s.marker)-jn(i);if(!(h>=0&&x<=0||h<=0&&x>=0)&&(h<=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?ce(u.to,n)>=0:ce(u.to,n)>0)||h>=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?ce(u.from,r)<=0:ce(u.from,r)<0)))return!0}}}function qt(e){for(var t;t=Fo(e);)e=t.find(-1,!0).line;return e}function ss(e){for(var t;t=Kn(e);)e=t.find(1,!0).line;return e}function us(e){for(var t,n;t=Kn(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}function Li(e,t){var n=ye(e,t),r=qt(n);return n==r?t:f(r)}function No(e,t){if(t>e.lastLine())return t;var n=ye(e,t),r;if(!cr(e,n))return t;for(;r=Kn(n);)n=r.find(1,!0).line;return f(n)+1}function cr(e,t){var n=Vt&&t.markedSpans;if(n){for(var r=void 0,i=0;i<n.length;++i)if(r=n[i],!!r.marker.collapsed){if(r.from==null)return!0;if(!r.marker.widgetNode&&r.from==0&&r.marker.inclusiveLeft&&Ti(e,t,r))return!0}}}function Ti(e,t,n){if(n.to==null){var r=n.marker.find(1,!0);return Ti(e,r.line,cn(r.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.to==t.text.length)return!0;for(var i=void 0,o=0;o<t.markedSpans.length;++o)if(i=t.markedSpans[o],i.marker.collapsed&&!i.marker.widgetNode&&i.from==n.to&&(i.to==null||i.to!=n.from)&&(i.marker.inclusiveLeft||n.marker.inclusiveRight)&&Ti(e,t,i))return!0}function er(e){e=qt(e);for(var t=0,n=e.parent,r=0;r<n.lines.length;++r){var i=n.lines[r];if(i==e)break;t+=i.height}for(var o=n.parent;o;n=o,o=n.parent)for(var l=0;l<o.children.length;++l){var a=o.children[l];if(a==n)break;t+=a.height}return t}function Un(e){if(e.height==0)return 0;for(var t=e.text.length,n,r=e;n=Fo(r);){var i=n.find(0,!0);r=i.from.line,t+=i.from.ch-i.to.ch}for(r=e;n=Kn(r);){var o=n.find(0,!0);t-=r.text.length-o.from.ch,r=o.to.line,t+=r.text.length-o.to.ch}return t}function Ci(e){var t=e.display,n=e.doc;t.maxLine=ye(n,n.first),t.maxLineLength=Un(t.maxLine),t.maxLineChanged=!0,n.iter(function(r){var i=Un(r);i>t.maxLineLength&&(t.maxLineLength=i,t.maxLine=r)})}var Hr=function(e,t,n){this.text=e,Do(this,t),this.height=n?n(this):1};Hr.prototype.lineNo=function(){return f(this)},Bt(Hr);function fs(e,t,n,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),Co(e),Do(e,n);var i=r?r(e):1;i!=e.height&&Et(e,i)}function cs(e){e.parent=null,Co(e)}var ds={},hs={};function Eo(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?hs:ds;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function Oo(e,t){var n=T("span",null,null,Y?"padding-right: .1px":null),r={pre:T("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var o=i?t.rest[i-1]:t.line,l=void 0;r.pos=0,r.addToken=gs,sr(e.display.measure)&&(l=Re(o,e.doc.direction))&&(r.addToken=ms(r.addToken,l)),r.map=[];var a=t!=e.display.externalMeasured&&f(o);xs(o,r,xo(e,o,a)),o.styleClasses&&(o.styleClasses.bgClass&&(r.bgClass=de(o.styleClasses.bgClass,r.bgClass||"")),o.styleClasses.textClass&&(r.textClass=de(o.styleClasses.textClass,r.textClass||""))),r.map.length==0&&r.map.push(0,0,r.content.appendChild(Rn(e.display.measure))),i==0?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(Y){var s=r.content.lastChild;(/\bcm-tab\b/.test(s.className)||s.querySelector&&s.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return Ye(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=de(r.pre.className,r.textClass||"")),r}function ps(e){var t=c("span","â€¢","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function gs(e,t,n,r,i,o,l){if(t){var a=e.splitSpaces?vs(t,e.trailingSpace):t,s=e.cm.state.specialChars,u=!1,h;if(!s.test(t))e.col+=t.length,h=document.createTextNode(a),e.map.push(e.pos,e.pos+t.length,h),k&&I<9&&(u=!0),e.pos+=t.length;else{h=document.createDocumentFragment();for(var x=0;;){s.lastIndex=x;var D=s.exec(t),L=D?D.index-x:t.length-x;if(L){var H=document.createTextNode(a.slice(x,x+L));k&&I<9?h.appendChild(c("span",[H])):h.appendChild(H),e.map.push(e.pos,e.pos+L,H),e.col+=L,e.pos+=L}if(!D)break;x+=L+1;var Z=void 0;if(D[0]=="	"){var ie=e.cm.options.tabSize,ae=ie-e.col%ie;Z=h.appendChild(c("span",et(ae),"cm-tab")),Z.setAttribute("role","presentation"),Z.setAttribute("cm-text","	"),e.col+=ae}else D[0]=="\r"||D[0]==`
`?(Z=h.appendChild(c("span",D[0]=="\r"?"â��":"â�¤","cm-invalidchar")),Z.setAttribute("cm-text",D[0]),e.col+=1):(Z=e.cm.options.specialCharPlaceholder(D[0]),Z.setAttribute("cm-text",D[0]),k&&I<9?h.appendChild(c("span",[Z])):h.appendChild(Z),e.col+=1);e.map.push(e.pos,e.pos+1,Z),e.pos++}}if(e.trailingSpace=a.charCodeAt(t.length-1)==32,n||r||i||u||o||l){var he=n||"";r&&(he+=r),i&&(he+=i);var se=c("span",[h],he,o);if(l)for(var ge in l)l.hasOwnProperty(ge)&&ge!="style"&&ge!="class"&&se.setAttribute(ge,l[ge]);return e.content.appendChild(se)}e.content.appendChild(h)}}function vs(e,t){if(e.length>1&&!/  /.test(e))return e;for(var n=t,r="",i=0;i<e.length;i++){var o=e.charAt(i);o==" "&&n&&(i==e.length-1||e.charCodeAt(i+1)==32)&&(o="Â "),r+=o,n=o==" "}return r}function ms(e,t){return function(n,r,i,o,l,a,s){i=i?i+" cm-force-border":"cm-force-border";for(var u=n.pos,h=u+r.length;;){for(var x=void 0,D=0;D<t.length&&(x=t[D],!(x.to>u&&x.from<=u));D++);if(x.to>=h)return e(n,r,i,o,l,a,s);e(n,r.slice(0,x.to-u),i,o,null,a,s),o=null,r=r.slice(x.to-u),u=x.to}}}function Po(e,t,n,r){var i=!r&&n.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!r&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",n.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function xs(e,t,n){var r=e.markedSpans,i=e.text,o=0;if(!r){for(var l=1;l<n.length;l+=2)t.addToken(t,i.slice(o,o=n[l]),Eo(n[l+1],t.cm.options));return}for(var a=i.length,s=0,u=1,h="",x,D,L=0,H,Z,ie,ae,he;;){if(L==s){H=Z=ie=D="",he=null,ae=null,L=1/0;for(var se=[],ge=void 0,Le=0;Le<r.length;++Le){var ke=r[Le],Ee=ke.marker;if(Ee.type=="bookmark"&&ke.from==s&&Ee.widgetNode)se.push(Ee);else if(ke.from<=s&&(ke.to==null||ke.to>s||Ee.collapsed&&ke.to==s&&ke.from==s)){if(ke.to!=null&&ke.to!=s&&L>ke.to&&(L=ke.to,Z=""),Ee.className&&(H+=" "+Ee.className),Ee.css&&(D=(D?D+";":"")+Ee.css),Ee.startStyle&&ke.from==s&&(ie+=" "+Ee.startStyle),Ee.endStyle&&ke.to==L&&(ge||(ge=[])).push(Ee.endStyle,ke.to),Ee.title&&((he||(he={})).title=Ee.title),Ee.attributes)for(var Ke in Ee.attributes)(he||(he={}))[Ke]=Ee.attributes[Ke];Ee.collapsed&&(!ae||Si(ae.marker,Ee)<0)&&(ae=ke)}else ke.from>s&&L>ke.from&&(L=ke.from)}if(ge)for(var st=0;st<ge.length;st+=2)ge[st+1]==L&&(Z+=" "+ge[st]);if(!ae||ae.from==s)for(var Xe=0;Xe<se.length;++Xe)Po(t,0,se[Xe]);if(ae&&(ae.from||0)==s){if(Po(t,(ae.to==null?a+1:ae.to)-s,ae.marker,ae.from==null),ae.to==null)return;ae.to==s&&(ae=!1)}}if(s>=a)break;for(var Nt=Math.min(a,L);;){if(h){var Tt=s+h.length;if(!ae){var tt=Tt>Nt?h.slice(0,Nt-s):h;t.addToken(t,tt,x?x+H:H,ie,s+tt.length==L?Z:"",D,he)}if(Tt>=Nt){h=h.slice(Nt-s),s=Nt;break}s=Tt,ie=""}h=i.slice(o,o=n[u++]),x=Eo(n[u++],t.cm.options)}}}function Io(e,t,n){this.line=t,this.rest=us(t),this.size=this.rest?f(we(this.rest))-n+1:1,this.node=this.text=null,this.hidden=cr(e,t)}function Gn(e,t,n){for(var r=[],i,o=t;o<n;o=i){var l=new Io(e.doc,ye(e.doc,o),o);i=o+l.size,r.push(l)}return r}var _r=null;function ys(e){_r?_r.ops.push(e):e.ownsGroup=_r={ops:[e],delayedCallbacks:[]}}function bs(e){var t=e.delayedCallbacks,n=0;do{for(;n<t.length;n++)t[n].call(null);for(var r=0;r<e.ops.length;r++){var i=e.ops[r];if(i.cursorActivityHandlers)for(;i.cursorActivityCalled<i.cursorActivityHandlers.length;)i.cursorActivityHandlers[i.cursorActivityCalled++].call(null,i.cm)}}while(n<t.length)}function ks(e,t){var n=e.ownsGroup;if(n)try{bs(n)}finally{_r=null,t(n)}}var dn=null;function ot(e,t){var n=Zt(e,t);if(n.length){var r=Array.prototype.slice.call(arguments,2),i;_r?i=_r.delayedCallbacks:dn?i=dn:(i=dn=[],setTimeout(ws,0));for(var o=function(a){i.push(function(){return n[a].apply(null,r)})},l=0;l<n.length;++l)o(l)}}function ws(){var e=dn;dn=null;for(var t=0;t<e.length;++t)e[t]()}function zo(e,t,n,r){for(var i=0;i<t.changes.length;i++){var o=t.changes[i];o=="text"?Ls(e,t):o=="gutter"?Ro(e,t,n,r):o=="class"?Di(e,t):o=="widget"&&Ts(e,t,r)}t.changes=null}function hn(e){return e.node==e.text&&(e.node=c("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),k&&I<8&&(e.node.style.zIndex=2)),e.node}function Ss(e,t){var n=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(n&&(n+=" CodeMirror-linebackground"),t.background)n?t.background.className=n:(t.background.parentNode.removeChild(t.background),t.background=null);else if(n){var r=hn(t);t.background=r.insertBefore(c("div",null,n),r.firstChild),e.display.input.setUneditable(t.background)}}function Bo(e,t){var n=e.display.externalMeasured;return n&&n.line==t.line?(e.display.externalMeasured=null,t.measure=n.measure,n.built):Oo(e,t)}function Ls(e,t){var n=t.text.className,r=Bo(e,t);t.text==t.node&&(t.node=r.pre),t.text.parentNode.replaceChild(r.pre,t.text),t.text=r.pre,r.bgClass!=t.bgClass||r.textClass!=t.textClass?(t.bgClass=r.bgClass,t.textClass=r.textClass,Di(e,t)):n&&(t.text.className=n)}function Di(e,t){Ss(e,t),t.line.wrapClass?hn(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var n=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=n||""}function Ro(e,t,n,r){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var i=hn(t);t.gutterBackground=c("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px; width: "+r.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),i.insertBefore(t.gutterBackground,t.text)}var o=t.line.gutterMarkers;if(e.options.lineNumbers||o){var l=hn(t),a=t.gutter=c("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px");if(a.setAttribute("aria-hidden","true"),e.display.input.setUneditable(a),l.insertBefore(a,t.text),t.line.gutterClass&&(a.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!o||!o["CodeMirror-linenumbers"])&&(t.lineNumber=a.appendChild(c("div",re(e.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),o)for(var s=0;s<e.display.gutterSpecs.length;++s){var u=e.display.gutterSpecs[s].className,h=o.hasOwnProperty(u)&&o[u];h&&a.appendChild(c("div",[h],"CodeMirror-gutter-elt","left: "+r.gutterLeft[u]+"px; width: "+r.gutterWidth[u]+"px"))}}}function Ts(e,t,n){t.alignable&&(t.alignable=null);for(var r=P("CodeMirror-linewidget"),i=t.node.firstChild,o=void 0;i;i=o)o=i.nextSibling,r.test(i.className)&&t.node.removeChild(i);Wo(e,t,n)}function Cs(e,t,n,r){var i=Bo(e,t);return t.text=t.node=i.pre,i.bgClass&&(t.bgClass=i.bgClass),i.textClass&&(t.textClass=i.textClass),Di(e,t),Ro(e,t,n,r),Wo(e,t,r),t.node}function Wo(e,t,n){if(Ho(e,t.line,t,n,!0),t.rest)for(var r=0;r<t.rest.length;r++)Ho(e,t.rest[r],t,n,!1)}function Ho(e,t,n,r,i){if(t.widgets)for(var o=hn(n),l=0,a=t.widgets;l<a.length;++l){var s=a[l],u=c("div",[s.node],"CodeMirror-linewidget"+(s.className?" "+s.className:""));s.handleMouseEvents||u.setAttribute("cm-ignore-events","true"),Ds(s,u,n,r),e.display.input.setUneditable(u),i&&s.above?o.insertBefore(u,n.gutter||n.text):o.appendChild(u),ot(s,"redraw")}}function Ds(e,t,n,r){if(e.noHScroll){(n.alignable||(n.alignable=[])).push(t);var i=r.wrapperWidth;t.style.left=r.fixedPos+"px",e.coverGutter||(i-=r.gutterTotalWidth,t.style.paddingLeft=r.gutterTotalWidth+"px"),t.style.width=i+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-r.gutterTotalWidth+"px"))}function pn(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!g(document.body,e.node)){var n="position: relative;";e.coverGutter&&(n+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(n+="width: "+t.display.wrapper.clientWidth+"px;"),G(t.display.measure,c("div",[e.node],null,n))}return e.height=e.node.parentNode.offsetHeight}function tr(e,t){for(var n=ln(t);n!=e.wrapper;n=n.parentNode)if(!n||n.nodeType==1&&n.getAttribute("cm-ignore-events")=="true"||n.parentNode==e.sizer&&n!=e.mover)return!0}function Xn(e){return e.lineSpace.offsetTop}function Mi(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function _o(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=G(e.measure,c("pre","x","CodeMirror-line-like")),n=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,r={left:parseInt(n.paddingLeft),right:parseInt(n.paddingRight)};return!isNaN(r.left)&&!isNaN(r.right)&&(e.cachedPaddingH=r),r}function Yt(e){return Oe-e.display.nativeBarWidth}function wr(e){return e.display.scroller.clientWidth-Yt(e)-e.display.barWidth}function Fi(e){return e.display.scroller.clientHeight-Yt(e)-e.display.barHeight}function Ms(e,t,n){var r=e.options.lineWrapping,i=r&&wr(e);if(!t.measure.heights||r&&t.measure.width!=i){var o=t.measure.heights=[];if(r){t.measure.width=i;for(var l=t.text.firstChild.getClientRects(),a=0;a<l.length-1;a++){var s=l[a],u=l[a+1];Math.abs(s.bottom-u.bottom)>2&&o.push((s.bottom+u.top)/2-n.top)}}o.push(n.bottom-n.top)}}function qo(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};if(e.rest){for(var r=0;r<e.rest.length;r++)if(e.rest[r]==t)return{map:e.measure.maps[r],cache:e.measure.caches[r]};for(var i=0;i<e.rest.length;i++)if(f(e.rest[i])>n)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}}function Fs(e,t){t=qt(t);var n=f(t),r=e.display.externalMeasured=new Io(e.doc,t,n);r.lineN=n;var i=r.built=Oo(e,r);return r.text=i.pre,G(e.display.lineMeasure,i.pre),r}function jo(e,t,n,r){return Qt(e,qr(e,t),n,r)}function Ai(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[Tr(e,t)];var n=e.display.externalMeasured;if(n&&t>=n.lineN&&t<n.lineN+n.size)return n}function qr(e,t){var n=f(t),r=Ai(e,n);r&&!r.text?r=null:r&&r.changes&&(zo(e,r,n,Ii(e)),e.curOp.forceUpdate=!0),r||(r=Fs(e,t));var i=qo(r,t,n);return{line:t,view:r,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function Qt(e,t,n,r,i){t.before&&(n=-1);var o=n+(r||""),l;return t.cache.hasOwnProperty(o)?l=t.cache[o]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(Ms(e,t.view,t.rect),t.hasHeights=!0),l=Ns(e,t,n,r),l.bogus||(t.cache[o]=l)),{left:l.left,right:l.right,top:i?l.rtop:l.top,bottom:i?l.rbottom:l.bottom}}var Ko={left:0,right:0,top:0,bottom:0};function Uo(e,t,n){for(var r,i,o,l,a,s,u=0;u<e.length;u+=3)if(a=e[u],s=e[u+1],t<a?(i=0,o=1,l="left"):t<s?(i=t-a,o=i+1):(u==e.length-3||t==s&&e[u+3]>t)&&(o=s-a,i=o-1,t>=s&&(l="right")),i!=null){if(r=e[u+2],a==s&&n==(r.insertLeft?"left":"right")&&(l=n),n=="left"&&i==0)for(;u&&e[u-2]==e[u-3]&&e[u-1].insertLeft;)r=e[(u-=3)+2],l="left";if(n=="right"&&i==s-a)for(;u<e.length-3&&e[u+3]==e[u+4]&&!e[u+5].insertLeft;)r=e[(u+=3)+2],l="right";break}return{node:r,start:i,end:o,collapse:l,coverStart:a,coverEnd:s}}function As(e,t){var n=Ko;if(t=="left")for(var r=0;r<e.length&&(n=e[r]).left==n.right;r++);else for(var i=e.length-1;i>=0&&(n=e[i]).left==n.right;i--);return n}function Ns(e,t,n,r){var i=Uo(t.map,n,r),o=i.node,l=i.start,a=i.end,s=i.collapse,u;if(o.nodeType==3){for(var h=0;h<4;h++){for(;l&&Ne(t.line.text.charAt(i.coverStart+l));)--l;for(;i.coverStart+a<i.coverEnd&&Ne(t.line.text.charAt(i.coverStart+a));)++a;if(k&&I<9&&l==0&&a==i.coverEnd-i.coverStart?u=o.parentNode.getBoundingClientRect():u=As(C(o,l,a).getClientRects(),r),u.left||u.right||l==0)break;a=l,l=l-1,s="right"}k&&I<11&&(u=Es(e.display.measure,u))}else{l>0&&(s=r="right");var x;e.options.lineWrapping&&(x=o.getClientRects()).length>1?u=x[r=="right"?x.length-1:0]:u=o.getBoundingClientRect()}if(k&&I<9&&!l&&(!u||!u.left&&!u.right)){var D=o.parentNode.getClientRects()[0];D?u={left:D.left,right:D.left+Kr(e.display),top:D.top,bottom:D.bottom}:u=Ko}for(var L=u.top-t.rect.top,H=u.bottom-t.rect.top,Z=(L+H)/2,ie=t.view.measure.heights,ae=0;ae<ie.length-1&&!(Z<ie[ae]);ae++);var he=ae?ie[ae-1]:0,se=ie[ae],ge={left:(s=="right"?u.right:u.left)-t.rect.left,right:(s=="left"?u.left:u.right)-t.rect.left,top:he,bottom:se};return!u.left&&!u.right&&(ge.bogus=!0),e.options.singleCursorHeightPerLine||(ge.rtop=L,ge.rbottom=H),ge}function Es(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!yi(e))return t;var n=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*n,right:t.right*n,top:t.top*r,bottom:t.bottom*r}}function Go(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function Xo(e){e.display.externalMeasure=null,F(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)Go(e.display.view[t])}function gn(e){Xo(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function Yo(e){return S&&M?-(e.body.getBoundingClientRect().left-parseInt(getComputedStyle(e.body).marginLeft)):e.defaultView.pageXOffset||(e.documentElement||e.body).scrollLeft}function Qo(e){return S&&M?-(e.body.getBoundingClientRect().top-parseInt(getComputedStyle(e.body).marginTop)):e.defaultView.pageYOffset||(e.documentElement||e.body).scrollTop}function Ni(e){var t=qt(e),n=t.widgets,r=0;if(n)for(var i=0;i<n.length;++i)n[i].above&&(r+=pn(n[i]));return r}function Yn(e,t,n,r,i){if(!i){var o=Ni(t);n.top+=o,n.bottom+=o}if(r=="line")return n;r||(r="local");var l=er(t);if(r=="local"?l+=Xn(e.display):l-=e.display.viewOffset,r=="page"||r=="window"){var a=e.display.lineSpace.getBoundingClientRect();l+=a.top+(r=="window"?0:Qo(d(e)));var s=a.left+(r=="window"?0:Yo(d(e)));n.left+=s,n.right+=s}return n.top+=l,n.bottom+=l,n}function Jo(e,t,n){if(n=="div")return t;var r=t.left,i=t.top;if(n=="page")r-=Yo(d(e)),i-=Qo(d(e));else if(n=="local"||!n){var o=e.display.sizer.getBoundingClientRect();r+=o.left,i+=o.top}var l=e.display.lineSpace.getBoundingClientRect();return{left:r-l.left,top:i-l.top}}function Qn(e,t,n,r,i){return r||(r=ye(e.doc,t.line)),Yn(e,r,jo(e,r,t.ch,i),n)}function jt(e,t,n,r,i,o){r=r||ye(e.doc,t.line),i||(i=qr(e,r));function l(H,Z){var ie=Qt(e,i,H,Z?"right":"left",o);return Z?ie.left=ie.right:ie.right=ie.left,Yn(e,r,ie,n)}var a=Re(r,e.doc.direction),s=t.ch,u=t.sticky;if(s>=r.text.length?(s=r.text.length,u="before"):s<=0&&(s=0,u="after"),!a)return l(u=="before"?s-1:s,u=="before");function h(H,Z,ie){var ae=a[Z],he=ae.level==1;return l(ie?H-1:H,he!=ie)}var x=lr(a,s,u),D=br,L=h(s,x,u=="before");return D!=null&&(L.other=h(s,D,u!="before")),L}function Zo(e,t){var n=0;t=Ae(e.doc,t),e.options.lineWrapping||(n=Kr(e.display)*t.ch);var r=ye(e.doc,t.line),i=er(r)+Xn(e.display);return{left:n,right:n,top:i,bottom:i+r.height}}function Ei(e,t,n,r,i){var o=B(e,t,n);return o.xRel=i,r&&(o.outside=r),o}function Oi(e,t,n){var r=e.doc;if(n+=e.display.viewOffset,n<0)return Ei(r.first,0,null,-1,-1);var i=m(r,n),o=r.first+r.size-1;if(i>o)return Ei(r.first+r.size-1,ye(r,o).text.length,null,1,1);t<0&&(t=0);for(var l=ye(r,i);;){var a=Os(e,l,i,t,n),s=as(l,a.ch+(a.xRel>0||a.outside>0?1:0));if(!s)return a;var u=s.find(1);if(u.line==i)return u;l=ye(r,i=u.line)}}function $o(e,t,n,r){r-=Ni(t);var i=t.text.length,o=Pt(function(l){return Qt(e,n,l-1).bottom<=r},i,0);return i=Pt(function(l){return Qt(e,n,l).top>r},o,i),{begin:o,end:i}}function Vo(e,t,n,r){n||(n=qr(e,t));var i=Yn(e,t,Qt(e,n,r),"line").top;return $o(e,t,n,i)}function Pi(e,t,n,r){return e.bottom<=n?!1:e.top>n?!0:(r?e.left:e.right)>t}function Os(e,t,n,r,i){i-=er(t);var o=qr(e,t),l=Ni(t),a=0,s=t.text.length,u=!0,h=Re(t,e.doc.direction);if(h){var x=(e.options.lineWrapping?Is:Ps)(e,t,n,o,h,r,i);u=x.level!=1,a=u?x.from:x.to-1,s=u?x.to:x.from-1}var D=null,L=null,H=Pt(function(Le){var ke=Qt(e,o,Le);return ke.top+=l,ke.bottom+=l,Pi(ke,r,i,!1)?(ke.top<=i&&ke.left<=r&&(D=Le,L=ke),!0):!1},a,s),Z,ie,ae=!1;if(L){var he=r-L.left<L.right-r,se=he==u;H=D+(se?0:1),ie=se?"after":"before",Z=he?L.left:L.right}else{!u&&(H==s||H==a)&&H++,ie=H==0?"after":H==t.text.length?"before":Qt(e,o,H-(u?1:0)).bottom+l<=i==u?"after":"before";var ge=jt(e,B(n,H,ie),"line",t,o);Z=ge.left,ae=i<ge.top?-1:i>=ge.bottom?1:0}return H=Mt(t.text,H,1),Ei(n,H,ie,ae,r-Z)}function Ps(e,t,n,r,i,o,l){var a=Pt(function(x){var D=i[x],L=D.level!=1;return Pi(jt(e,B(n,L?D.to:D.from,L?"before":"after"),"line",t,r),o,l,!0)},0,i.length-1),s=i[a];if(a>0){var u=s.level!=1,h=jt(e,B(n,u?s.from:s.to,u?"after":"before"),"line",t,r);Pi(h,o,l,!0)&&h.top>l&&(s=i[a-1])}return s}function Is(e,t,n,r,i,o,l){var a=$o(e,t,r,l),s=a.begin,u=a.end;/\s/.test(t.text.charAt(u-1))&&u--;for(var h=null,x=null,D=0;D<i.length;D++){var L=i[D];if(!(L.from>=u||L.to<=s)){var H=L.level!=1,Z=Qt(e,r,H?Math.min(u,L.to)-1:Math.max(s,L.from)).right,ie=Z<o?o-Z+1e9:Z-o;(!h||x>ie)&&(h=L,x=ie)}}return h||(h=i[i.length-1]),h.from<s&&(h={from:s,to:h.to,level:h.level}),h.to>u&&(h={from:h.from,to:u,level:h.level}),h}var Sr;function jr(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(Sr==null){Sr=c("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)Sr.appendChild(document.createTextNode("x")),Sr.appendChild(c("br"));Sr.appendChild(document.createTextNode("x"))}G(e.measure,Sr);var n=Sr.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),F(e.measure),n||1}function Kr(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=c("span","xxxxxxxxxx"),n=c("pre",[t],"CodeMirror-line-like");G(e.measure,n);var r=t.getBoundingClientRect(),i=(r.right-r.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function Ii(e){for(var t=e.display,n={},r={},i=t.gutters.clientLeft,o=t.gutters.firstChild,l=0;o;o=o.nextSibling,++l){var a=e.display.gutterSpecs[l].className;n[a]=o.offsetLeft+o.clientLeft+i,r[a]=o.clientWidth}return{fixedPos:zi(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function zi(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function el(e){var t=jr(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/Kr(e.display)-3);return function(i){if(cr(e.doc,i))return 0;var o=0;if(i.widgets)for(var l=0;l<i.widgets.length;l++)i.widgets[l].height&&(o+=i.widgets[l].height);return n?o+(Math.ceil(i.text.length/r)||1)*t:o+t}}function Bi(e){var t=e.doc,n=el(e);t.iter(function(r){var i=n(r);i!=r.height&&Et(r,i)})}function Lr(e,t,n,r){var i=e.display;if(!n&&ln(t).getAttribute("cm-not-content")=="true")return null;var o,l,a=i.lineSpace.getBoundingClientRect();try{o=t.clientX-a.left,l=t.clientY-a.top}catch{return null}var s=Oi(e,o,l),u;if(r&&s.xRel>0&&(u=ye(e.doc,s.line).text).length==s.ch){var h=Fe(u,u.length,e.options.tabSize)-u.length;s=B(s.line,Math.max(0,Math.round((o-_o(e.display).left)/Kr(e.display))-h))}return s}function Tr(e,t){if(t>=e.display.viewTo||(t-=e.display.viewFrom,t<0))return null;for(var n=e.display.view,r=0;r<n.length;r++)if(t-=n[r].size,t<0)return r}function St(e,t,n,r){t==null&&(t=e.doc.first),n==null&&(n=e.doc.first+e.doc.size),r||(r=0);var i=e.display;if(r&&n<i.viewTo&&(i.updateLineNumbers==null||i.updateLineNumbers>t)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)Vt&&Li(e.doc,t)<i.viewTo&&hr(e);else if(n<=i.viewFrom)Vt&&No(e.doc,n+r)>i.viewFrom?hr(e):(i.viewFrom+=r,i.viewTo+=r);else if(t<=i.viewFrom&&n>=i.viewTo)hr(e);else if(t<=i.viewFrom){var o=Jn(e,n,n+r,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=r):hr(e)}else if(n>=i.viewTo){var l=Jn(e,t,t,-1);l?(i.view=i.view.slice(0,l.index),i.viewTo=l.lineN):hr(e)}else{var a=Jn(e,t,t,-1),s=Jn(e,n,n+r,1);a&&s?(i.view=i.view.slice(0,a.index).concat(Gn(e,a.lineN,s.lineN)).concat(i.view.slice(s.index)),i.viewTo+=r):hr(e)}var u=i.externalMeasured;u&&(n<u.lineN?u.lineN+=r:t<u.lineN+u.size&&(i.externalMeasured=null))}function dr(e,t,n){e.curOp.viewChanged=!0;var r=e.display,i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size&&(r.externalMeasured=null),!(t<r.viewFrom||t>=r.viewTo)){var o=r.view[Tr(e,t)];if(o.node!=null){var l=o.changes||(o.changes=[]);ve(l,n)==-1&&l.push(n)}}}function hr(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Jn(e,t,n,r){var i=Tr(e,t),o,l=e.display.view;if(!Vt||n==e.doc.first+e.doc.size)return{index:i,lineN:n};for(var a=e.display.viewFrom,s=0;s<i;s++)a+=l[s].size;if(a!=t){if(r>0){if(i==l.length-1)return null;o=a+l[i].size-t,i++}else o=a-t;t+=o,n+=o}for(;Li(e.doc,n)!=n;){if(i==(r<0?0:l.length-1))return null;n+=r*l[i-(r<0?1:0)].size,i+=r}return{index:i,lineN:n}}function zs(e,t,n){var r=e.display,i=r.view;i.length==0||t>=r.viewTo||n<=r.viewFrom?(r.view=Gn(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=Gn(e,t,r.viewFrom).concat(r.view):r.viewFrom<t&&(r.view=r.view.slice(Tr(e,t))),r.viewFrom=t,r.viewTo<n?r.view=r.view.concat(Gn(e,r.viewTo,n)):r.viewTo>n&&(r.view=r.view.slice(0,Tr(e,n)))),r.viewTo=n}function tl(e){for(var t=e.display.view,n=0,r=0;r<t.length;r++){var i=t[r];!i.hidden&&(!i.node||i.changes)&&++n}return n}function vn(e){e.display.input.showSelection(e.display.input.prepareSelection())}function rl(e,t){t===void 0&&(t=!0);var n=e.doc,r={},i=r.cursors=document.createDocumentFragment(),o=r.selection=document.createDocumentFragment(),l=e.options.$customCursor;l&&(t=!0);for(var a=0;a<n.sel.ranges.length;a++)if(!(!t&&a==n.sel.primIndex)){var s=n.sel.ranges[a];if(!(s.from().line>=e.display.viewTo||s.to().line<e.display.viewFrom)){var u=s.empty();if(l){var h=l(e,s);h&&Ri(e,h,i)}else(u||e.options.showCursorWhenSelecting)&&Ri(e,s.head,i);u||Bs(e,s,o)}}return r}function Ri(e,t,n){var r=jt(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),i=n.appendChild(c("div","Â ","CodeMirror-cursor"));if(i.style.left=r.left+"px",i.style.top=r.top+"px",i.style.height=Math.max(0,r.bottom-r.top)*e.options.cursorHeight+"px",/\bcm-fat-cursor\b/.test(e.getWrapperElement().className)){var o=Qn(e,t,"div",null,null),l=o.right-o.left;i.style.width=(l>0?l:e.defaultCharWidth())+"px"}if(r.other){var a=n.appendChild(c("div","Â ","CodeMirror-cursor CodeMirror-secondarycursor"));a.style.display="",a.style.left=r.other.left+"px",a.style.top=r.other.top+"px",a.style.height=(r.other.bottom-r.other.top)*.85+"px"}}function Zn(e,t){return e.top-t.top||e.left-t.left}function Bs(e,t,n){var r=e.display,i=e.doc,o=document.createDocumentFragment(),l=_o(e.display),a=l.left,s=Math.max(r.sizerWidth,wr(e)-r.sizer.offsetLeft)-l.right,u=i.direction=="ltr";function h(se,ge,Le,ke){ge<0&&(ge=0),ge=Math.round(ge),ke=Math.round(ke),o.appendChild(c("div",null,"CodeMirror-selected","position: absolute; left: "+se+`px;
                             top: `+ge+"px; width: "+(Le??s-se)+`px;
                             height: `+(ke-ge)+"px"))}function x(se,ge,Le){var ke=ye(i,se),Ee=ke.text.length,Ke,st;function Xe(tt,Ct){return Qn(e,B(se,tt),"div",ke,Ct)}function Nt(tt,Ct,ft){var nt=Vo(e,ke,null,tt),rt=Ct=="ltr"==(ft=="after")?"left":"right",Ze=ft=="after"?nt.begin:nt.end-(/\s/.test(ke.text.charAt(nt.end-1))?2:1);return Xe(Ze,rt)[rt]}var Tt=Re(ke,i.direction);return or(Tt,ge||0,Le??Ee,function(tt,Ct,ft,nt){var rt=ft=="ltr",Ze=Xe(tt,rt?"left":"right"),Dt=Xe(Ct-1,rt?"right":"left"),nn=ge==null&&tt==0,yr=Le==null&&Ct==Ee,vt=nt==0,Jt=!Tt||nt==Tt.length-1;if(Dt.top-Ze.top<=3){var ut=(u?nn:yr)&&vt,co=(u?yr:nn)&&Jt,ir=ut?a:(rt?Ze:Dt).left,Ar=co?s:(rt?Dt:Ze).right;h(ir,Ze.top,Ar-ir,Ze.bottom)}else{var Nr,bt,on,ho;rt?(Nr=u&&nn&&vt?a:Ze.left,bt=u?s:Nt(tt,ft,"before"),on=u?a:Nt(Ct,ft,"after"),ho=u&&yr&&Jt?s:Dt.right):(Nr=u?Nt(tt,ft,"before"):a,bt=!u&&nn&&vt?s:Ze.right,on=!u&&yr&&Jt?a:Dt.left,ho=u?Nt(Ct,ft,"after"):s),h(Nr,Ze.top,bt-Nr,Ze.bottom),Ze.bottom<Dt.top&&h(a,Ze.bottom,null,Dt.top),h(on,Dt.top,ho-on,Dt.bottom)}(!Ke||Zn(Ze,Ke)<0)&&(Ke=Ze),Zn(Dt,Ke)<0&&(Ke=Dt),(!st||Zn(Ze,st)<0)&&(st=Ze),Zn(Dt,st)<0&&(st=Dt)}),{start:Ke,end:st}}var D=t.from(),L=t.to();if(D.line==L.line)x(D.line,D.ch,L.ch);else{var H=ye(i,D.line),Z=ye(i,L.line),ie=qt(H)==qt(Z),ae=x(D.line,D.ch,ie?H.text.length+1:null).end,he=x(L.line,ie?0:null,L.ch).start;ie&&(ae.top<he.top-2?(h(ae.right,ae.top,null,ae.bottom),h(a,he.top,he.left,he.bottom)):h(ae.right,ae.top,he.left-ae.right,ae.bottom)),ae.bottom<he.top&&h(a,ae.bottom,null,he.top)}n.appendChild(o)}function Wi(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var n=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||Ur(e),t.cursorDiv.style.visibility=(n=!n)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function nl(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||_i(e))}function Hi(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&Ur(e))},100)}function _i(e,t){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),e.options.readOnly!="nocursor"&&(e.state.focused||(Ye(e,"focus",e,t),e.state.focused=!0,j(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),Y&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Wi(e))}function Ur(e,t){e.state.delayingBlurEvent||(e.state.focused&&(Ye(e,"blur",e,t),e.state.focused=!1,V(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function $n(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=Math.max(0,t.scroller.getBoundingClientRect().top),i=t.lineDiv.getBoundingClientRect().top,o=0,l=0;l<t.view.length;l++){var a=t.view[l],s=e.options.lineWrapping,u=void 0,h=0;if(!a.hidden){if(i+=a.line.height,k&&I<8){var x=a.node.offsetTop+a.node.offsetHeight;u=x-n,n=x}else{var D=a.node.getBoundingClientRect();u=D.bottom-D.top,!s&&a.text.firstChild&&(h=a.text.firstChild.getBoundingClientRect().right-D.left-1)}var L=a.line.height-u;if((L>.005||L<-.005)&&(i<r&&(o-=L),Et(a.line,u),il(a.line),a.rest))for(var H=0;H<a.rest.length;H++)il(a.rest[H]);if(h>e.display.sizerWidth){var Z=Math.ceil(h/Kr(e.display));Z>e.display.maxLineLength&&(e.display.maxLineLength=Z,e.display.maxLine=a.line,e.display.maxLineChanged=!0)}}}Math.abs(o)>2&&(t.scroller.scrollTop+=o)}function il(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var n=e.widgets[t],r=n.node.parentNode;r&&(n.height=r.offsetHeight)}}function Vn(e,t,n){var r=n&&n.top!=null?Math.max(0,n.top):e.scroller.scrollTop;r=Math.floor(r-Xn(e));var i=n&&n.bottom!=null?n.bottom:r+e.wrapper.clientHeight,o=m(t,r),l=m(t,i);if(n&&n.ensure){var a=n.ensure.from.line,s=n.ensure.to.line;a<o?(o=a,l=m(t,er(ye(t,a))+e.wrapper.clientHeight)):Math.min(s,t.lastLine())>=l&&(o=m(t,er(ye(t,s))-e.wrapper.clientHeight),l=s)}return{from:o,to:Math.max(l,o+1)}}function Rs(e,t){if(!Qe(e,"scrollCursorIntoView")){var n=e.display,r=n.sizer.getBoundingClientRect(),i=null,o=n.wrapper.ownerDocument;if(t.top+r.top<0?i=!0:t.bottom+r.top>(o.defaultView.innerHeight||o.documentElement.clientHeight)&&(i=!1),i!=null&&!O){var l=c("div","â€‹",null,`position: absolute;
                         top: `+(t.top-n.viewOffset-Xn(e.display))+`px;
                         height: `+(t.bottom-t.top+Yt(e)+n.barHeight)+`px;
                         left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(l),l.scrollIntoView(i),e.display.lineSpace.removeChild(l)}}}function Ws(e,t,n,r){r==null&&(r=0);var i;!e.options.lineWrapping&&t==n&&(n=t.sticky=="before"?B(t.line,t.ch+1,"before"):t,t=t.ch?B(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t);for(var o=0;o<5;o++){var l=!1,a=jt(e,t),s=!n||n==t?a:jt(e,n);i={left:Math.min(a.left,s.left),top:Math.min(a.top,s.top)-r,right:Math.max(a.left,s.left),bottom:Math.max(a.bottom,s.bottom)+r};var u=qi(e,i),h=e.doc.scrollTop,x=e.doc.scrollLeft;if(u.scrollTop!=null&&(xn(e,u.scrollTop),Math.abs(e.doc.scrollTop-h)>1&&(l=!0)),u.scrollLeft!=null&&(Cr(e,u.scrollLeft),Math.abs(e.doc.scrollLeft-x)>1&&(l=!0)),!l)break}return i}function Hs(e,t){var n=qi(e,t);n.scrollTop!=null&&xn(e,n.scrollTop),n.scrollLeft!=null&&Cr(e,n.scrollLeft)}function qi(e,t){var n=e.display,r=jr(e.display);t.top<0&&(t.top=0);var i=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:n.scroller.scrollTop,o=Fi(e),l={};t.bottom-t.top>o&&(t.bottom=t.top+o);var a=e.doc.height+Mi(n),s=t.top<r,u=t.bottom>a-r;if(t.top<i)l.scrollTop=s?0:t.top;else if(t.bottom>i+o){var h=Math.min(t.top,(u?a:t.bottom)-o);h!=i&&(l.scrollTop=h)}var x=e.options.fixedGutter?0:n.gutters.offsetWidth,D=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:n.scroller.scrollLeft-x,L=wr(e)-n.gutters.offsetWidth,H=t.right-t.left>L;return H&&(t.right=t.left+L),t.left<10?l.scrollLeft=0:t.left<D?l.scrollLeft=Math.max(0,t.left+x-(H?0:10)):t.right>L+D-3&&(l.scrollLeft=t.right+(H?0:10)-L),l}function ji(e,t){t!=null&&(ei(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t)}function Gr(e){ei(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function mn(e,t,n){(t!=null||n!=null)&&ei(e),t!=null&&(e.curOp.scrollLeft=t),n!=null&&(e.curOp.scrollTop=n)}function _s(e,t){ei(e),e.curOp.scrollToPos=t}function ei(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var n=Zo(e,t.from),r=Zo(e,t.to);ol(e,n,r,t.margin)}}function ol(e,t,n,r){var i=qi(e,{left:Math.min(t.left,n.left),top:Math.min(t.top,n.top)-r,right:Math.max(t.right,n.right),bottom:Math.max(t.bottom,n.bottom)+r});mn(e,i.scrollLeft,i.scrollTop)}function xn(e,t){Math.abs(e.doc.scrollTop-t)<2||(_||Ui(e,{top:t}),ll(e,t,!0),_&&Ui(e),kn(e,100))}function ll(e,t,n){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),!(e.display.scroller.scrollTop==t&&!n)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function Cr(e,t,n,r){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),!((n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r)&&(e.doc.scrollLeft=t,cl(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function yn(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+Mi(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?n:0,docHeight:r,scrollHeight:r+Yt(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var Dr=function(e,t,n){this.cm=n;var r=this.vert=c("div",[c("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=c("div",[c("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=i.tabIndex=-1,e(r),e(i),Se(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),Se(i,"scroll",function(){i.clientWidth&&t(i.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,k&&I<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Dr.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var i=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.scrollTop=0,this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=n?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(n?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+o)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(r==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:t?r:0}},Dr.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Dr.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Dr.prototype.zeroWidthHack=function(){var e=z&&!ue?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.visibility=this.vert.style.visibility="hidden",this.disableHoriz=new Ce,this.disableVert=new Ce},Dr.prototype.enableZeroWidthBar=function(e,t,n){e.style.visibility="";function r(){var i=e.getBoundingClientRect(),o=n=="vert"?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1);o!=e?e.style.visibility="hidden":t.set(1e3,r)}t.set(1e3,r)},Dr.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var bn=function(){};bn.prototype.update=function(){return{bottom:0,right:0}},bn.prototype.setScrollLeft=function(){},bn.prototype.setScrollTop=function(){},bn.prototype.clear=function(){};function Xr(e,t){t||(t=yn(e));var n=e.display.barWidth,r=e.display.barHeight;al(e,t);for(var i=0;i<4&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&$n(e),al(e,yn(e)),n=e.display.barWidth,r=e.display.barHeight}function al(e,t){var n=e.display,r=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px",n.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=r.bottom+"px",n.scrollbarFiller.style.width=r.right+"px"):n.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}var sl={native:Dr,null:bn};function ul(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&V(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new sl[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),Se(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,n){n=="horizontal"?Cr(e,t):xn(e,t)},e),e.display.scrollbars.addClass&&j(e.display.wrapper,e.display.scrollbars.addClass)}var qs=0;function Mr(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++qs,markArrays:null},ys(e.curOp)}function Fr(e){var t=e.curOp;t&&ks(t,function(n){for(var r=0;r<n.ops.length;r++)n.ops[r].cm.curOp=null;js(n)})}function js(e){for(var t=e.ops,n=0;n<t.length;n++)Ks(t[n]);for(var r=0;r<t.length;r++)Us(t[r]);for(var i=0;i<t.length;i++)Gs(t[i]);for(var o=0;o<t.length;o++)Xs(t[o]);for(var l=0;l<t.length;l++)Ys(t[l])}function Ks(e){var t=e.cm,n=t.display;Js(t),e.updateMaxLine&&Ci(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<n.viewFrom||e.scrollToPos.to.line>=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new ti(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Us(e){e.updatedDisplay=e.mustUpdate&&Ki(e.cm,e.update)}function Gs(e){var t=e.cm,n=t.display;e.updatedDisplay&&$n(t),e.barMeasure=yn(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=jo(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+Yt(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-wr(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function Xs(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&Cr(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var n=e.focus&&e.focus==y(fe(t));e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,n),(e.updatedDisplay||e.startHeight!=t.doc.height)&&Xr(t,e.barMeasure),e.updatedDisplay&&Xi(t,e.barMeasure),e.selectionChanged&&Wi(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),n&&nl(e.cm)}function Ys(e){var t=e.cm,n=t.display,r=t.doc;if(e.updatedDisplay&&fl(t,e.update),n.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(n.wheelStartX=n.wheelStartY=null),e.scrollTop!=null&&ll(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&Cr(t,e.scrollLeft,!0,!0),e.scrollToPos){var i=Ws(t,Ae(r,e.scrollToPos.from),Ae(r,e.scrollToPos.to),e.scrollToPos.margin);Rs(t,i)}var o=e.maybeHiddenMarkers,l=e.maybeUnhiddenMarkers;if(o)for(var a=0;a<o.length;++a)o[a].lines.length||Ye(o[a],"hide");if(l)for(var s=0;s<l.length;++s)l[s].lines.length&&Ye(l[s],"unhide");n.wrapper.offsetHeight&&(r.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&Ye(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function At(e,t){if(e.curOp)return t();Mr(e);try{return t()}finally{Fr(e)}}function lt(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Mr(e);try{return t.apply(e,arguments)}finally{Fr(e)}}}function yt(e){return function(){if(this.curOp)return e.apply(this,arguments);Mr(this);try{return e.apply(this,arguments)}finally{Fr(this)}}}function at(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);Mr(t);try{return e.apply(this,arguments)}finally{Fr(t)}}}function kn(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,xe(Qs,e))}function Qs(e){var t=e.doc;if(!(t.highlightFrontier>=e.display.viewTo)){var n=+new Date+e.options.workTime,r=fn(e,t.highlightFrontier),i=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),function(o){if(r.line>=e.display.viewFrom){var l=o.styles,a=o.text.length>e.options.maxHighlightLength?Gt(t.mode,r.state):null,s=mo(e,o,r,!0);a&&(r.state=a),o.styles=s.styles;var u=o.styleClasses,h=s.classes;h?o.styleClasses=h:u&&(o.styleClasses=null);for(var x=!l||l.length!=o.styles.length||u!=h&&(!u||!h||u.bgClass!=h.bgClass||u.textClass!=h.textClass),D=0;!x&&D<l.length;++D)x=l[D]!=o.styles[D];x&&i.push(r.line),o.stateAfter=r.save(),r.nextLine()}else o.text.length<=e.options.maxHighlightLength&&bi(e,o.text,r),o.stateAfter=r.line%5==0?r.save():null,r.nextLine();if(+new Date>n)return kn(e,e.options.workDelay),!0}),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),i.length&&At(e,function(){for(var o=0;o<i.length;o++)dr(e,i[o],"text")})}}var ti=function(e,t,n){var r=e.display;this.viewport=t,this.visible=Vn(r,e.doc,t),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=wr(e),this.force=n,this.dims=Ii(e),this.events=[]};ti.prototype.signal=function(e,t){Ft(e,t)&&this.events.push(arguments)},ti.prototype.finish=function(){for(var e=0;e<this.events.length;e++)Ye.apply(null,this.events[e])};function Js(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=Yt(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Yt(e)+"px",t.scrollbarsClipped=!0)}function Zs(e){if(e.hasFocus())return null;var t=y(fe(e));if(!t||!g(e.display.lineDiv,t))return null;var n={activeElt:t};if(window.getSelection){var r=le(e).getSelection();r.anchorNode&&r.extend&&g(e.display.lineDiv,r.anchorNode)&&(n.anchorNode=r.anchorNode,n.anchorOffset=r.anchorOffset,n.focusNode=r.focusNode,n.focusOffset=r.focusOffset)}return n}function $s(e){if(!(!e||!e.activeElt||e.activeElt==y(Te(e.activeElt)))&&(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&g(document.body,e.anchorNode)&&g(document.body,e.focusNode))){var t=e.activeElt.ownerDocument,n=t.defaultView.getSelection(),r=t.createRange();r.setEnd(e.anchorNode,e.anchorOffset),r.collapse(!1),n.removeAllRanges(),n.addRange(r),n.extend(e.focusNode,e.focusOffset)}}function Ki(e,t){var n=e.display,r=e.doc;if(t.editorIsHidden)return hr(e),!1;if(!t.force&&t.visible.from>=n.viewFrom&&t.visible.to<=n.viewTo&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&tl(e)==0)return!1;dl(e)&&(hr(e),t.dims=Ii(e));var i=r.first+r.size,o=Math.max(t.visible.from-e.options.viewportMargin,r.first),l=Math.min(i,t.visible.to+e.options.viewportMargin);n.viewFrom<o&&o-n.viewFrom<20&&(o=Math.max(r.first,n.viewFrom)),n.viewTo>l&&n.viewTo-l<20&&(l=Math.min(i,n.viewTo)),Vt&&(o=Li(e.doc,o),l=No(e.doc,l));var a=o!=n.viewFrom||l!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;zs(e,o,l),n.viewOffset=er(ye(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var s=tl(e);if(!a&&s==0&&!t.force&&n.renderedView==n.view&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo))return!1;var u=Zs(e);return s>4&&(n.lineDiv.style.display="none"),Vs(e,n.updateLineNumbers,t.dims),s>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,$s(u),F(n.cursorDiv),F(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,a&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,kn(e,400)),n.updateLineNumbers=null,!0}function fl(e,t){for(var n=t.viewport,r=!0;;r=!1){if(!r||!e.options.lineWrapping||t.oldDisplayWidth==wr(e)){if(n&&n.top!=null&&(n={top:Math.min(e.doc.height+Mi(e.display)-Fi(e),n.top)}),t.visible=Vn(e.display,e.doc,n),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else r&&(t.visible=Vn(e.display,e.doc,n));if(!Ki(e,t))break;$n(e);var i=yn(e);vn(e),Xr(e,i),Xi(e,i),t.force=!1}t.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function Ui(e,t){var n=new ti(e,t);if(Ki(e,n)){$n(e),fl(e,n);var r=yn(e);vn(e),Xr(e,r),Xi(e,r),n.finish()}}function Vs(e,t,n){var r=e.display,i=e.options.lineNumbers,o=r.lineDiv,l=o.firstChild;function a(H){var Z=H.nextSibling;return Y&&z&&e.display.currentWheelTarget==H?H.style.display="none":H.parentNode.removeChild(H),Z}for(var s=r.view,u=r.viewFrom,h=0;h<s.length;h++){var x=s[h];if(!x.hidden)if(!x.node||x.node.parentNode!=o){var D=Cs(e,x,u,n);o.insertBefore(D,l)}else{for(;l!=x.node;)l=a(l);var L=i&&t!=null&&t<=u&&x.lineNumber;x.changes&&(ve(x.changes,"gutter")>-1&&(L=!1),zo(e,x,u,n)),L&&(F(x.lineNumber),x.lineNumber.appendChild(document.createTextNode(re(e.options,u)))),l=x.node.nextSibling}u+=x.size}for(;l;)l=a(l)}function Gi(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px",ot(e,"gutterChanged",e)}function Xi(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+Yt(e)+"px"}function cl(e){var t=e.display,n=t.view;if(!(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))){for(var r=zi(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=r+"px",l=0;l<n.length;l++)if(!n[l].hidden){e.options.fixedGutter&&(n[l].gutter&&(n[l].gutter.style.left=o),n[l].gutterBackground&&(n[l].gutterBackground.style.left=o));var a=n[l].alignable;if(a)for(var s=0;s<a.length;s++)a[s].style.left=o}e.options.fixedGutter&&(t.gutters.style.left=r+i+"px")}}function dl(e){if(!e.options.lineNumbers)return!1;var t=e.doc,n=re(e.options,t.first+t.size-1),r=e.display;if(n.length!=r.lineNumChars){var i=r.measure.appendChild(c("div",[c("div",n)],"CodeMirror-linenumber CodeMirror-gutter-elt")),o=i.firstChild.offsetWidth,l=i.offsetWidth-o;return r.lineGutter.style.width="",r.lineNumInnerWidth=Math.max(o,r.lineGutter.offsetWidth-l)+1,r.lineNumWidth=r.lineNumInnerWidth+l,r.lineNumChars=r.lineNumInnerWidth?n.length:-1,r.lineGutter.style.width=r.lineNumWidth+"px",Gi(e.display),!0}return!1}function Yi(e,t){for(var n=[],r=!1,i=0;i<e.length;i++){var o=e[i],l=null;if(typeof o!="string"&&(l=o.style,o=o.className),o=="CodeMirror-linenumbers")if(t)r=!0;else continue;n.push({className:o,style:l})}return t&&!r&&n.push({className:"CodeMirror-linenumbers",style:null}),n}function hl(e){var t=e.gutters,n=e.gutterSpecs;F(t),e.lineGutter=null;for(var r=0;r<n.length;++r){var i=n[r],o=i.className,l=i.style,a=t.appendChild(c("div",null,"CodeMirror-gutter "+o));l&&(a.style.cssText=l),o=="CodeMirror-linenumbers"&&(e.lineGutter=a,a.style.width=(e.lineNumWidth||1)+"px")}t.style.display=n.length?"":"none",Gi(e)}function wn(e){hl(e.display),St(e),cl(e)}function eu(e,t,n,r){var i=this;this.input=n,i.scrollbarFiller=c("div",null,"CodeMirror-scrollbar-filler"),i.scrollbarFiller.setAttribute("cm-not-content","true"),i.gutterFiller=c("div",null,"CodeMirror-gutter-filler"),i.gutterFiller.setAttribute("cm-not-content","true"),i.lineDiv=T("div",null,"CodeMirror-code"),i.selectionDiv=c("div",null,null,"position: relative; z-index: 1"),i.cursorDiv=c("div",null,"CodeMirror-cursors"),i.measure=c("div",null,"CodeMirror-measure"),i.lineMeasure=c("div",null,"CodeMirror-measure"),i.lineSpace=T("div",[i.measure,i.lineMeasure,i.selectionDiv,i.cursorDiv,i.lineDiv],null,"position: relative; outline: none");var o=T("div",[i.lineSpace],"CodeMirror-lines");i.mover=c("div",[o],null,"position: relative"),i.sizer=c("div",[i.mover],"CodeMirror-sizer"),i.sizerWidth=null,i.heightForcer=c("div",null,null,"position: absolute; height: "+Oe+"px; width: 1px;"),i.gutters=c("div",null,"CodeMirror-gutters"),i.lineGutter=null,i.scroller=c("div",[i.sizer,i.heightForcer,i.gutters],"CodeMirror-scroll"),i.scroller.setAttribute("tabIndex","-1"),i.wrapper=c("div",[i.scrollbarFiller,i.gutterFiller,i.scroller],"CodeMirror"),S&&R>=105&&(i.wrapper.style.clipPath="inset(0px)"),i.wrapper.setAttribute("translate","no"),k&&I<8&&(i.gutters.style.zIndex=-1,i.scroller.style.paddingRight=0),!Y&&!(_&&N)&&(i.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(i.wrapper):e(i.wrapper)),i.viewFrom=i.viewTo=t.first,i.reportedViewFrom=i.reportedViewTo=t.first,i.view=[],i.renderedView=null,i.externalMeasured=null,i.viewOffset=0,i.lastWrapHeight=i.lastWrapWidth=0,i.updateLineNumbers=null,i.nativeBarWidth=i.barHeight=i.barWidth=0,i.scrollbarsClipped=!1,i.lineNumWidth=i.lineNumInnerWidth=i.lineNumChars=null,i.alignWidgets=!1,i.cachedCharWidth=i.cachedTextHeight=i.cachedPaddingH=null,i.maxLine=null,i.maxLineLength=0,i.maxLineChanged=!1,i.wheelDX=i.wheelDY=i.wheelStartX=i.wheelStartY=null,i.shift=!1,i.selForContextMenu=null,i.activeTouch=null,i.gutterSpecs=Yi(r.gutters,r.lineNumbers),hl(i),n.init(i)}var ri=0,rr=null;k?rr=-.53:_?rr=15:S?rr=-.7:$&&(rr=-1/3);function pl(e){var t=e.wheelDeltaX,n=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),n==null&&e.detail&&e.axis==e.VERTICAL_AXIS?n=e.detail:n==null&&(n=e.wheelDelta),{x:t,y:n}}function tu(e){var t=pl(e);return t.x*=rr,t.y*=rr,t}function gl(e,t){S&&R==102&&(e.display.chromeScrollHack==null?e.display.sizer.style.pointerEvents="none":clearTimeout(e.display.chromeScrollHack),e.display.chromeScrollHack=setTimeout(function(){e.display.chromeScrollHack=null,e.display.sizer.style.pointerEvents=""},100));var n=pl(t),r=n.x,i=n.y,o=rr;t.deltaMode===0&&(r=t.deltaX,i=t.deltaY,o=1);var l=e.display,a=l.scroller,s=a.scrollWidth>a.clientWidth,u=a.scrollHeight>a.clientHeight;if(r&&s||i&&u){if(i&&z&&Y){e:for(var h=t.target,x=l.view;h!=a;h=h.parentNode)for(var D=0;D<x.length;D++)if(x[D].node==h){e.display.currentWheelTarget=h;break e}}if(r&&!_&&!A&&o!=null){i&&u&&xn(e,Math.max(0,a.scrollTop+i*o)),Cr(e,Math.max(0,a.scrollLeft+r*o)),(!i||i&&u)&&pt(t),l.wheelStartX=null;return}if(i&&o!=null){var L=i*o,H=e.doc.scrollTop,Z=H+l.wrapper.clientHeight;L<0?H=Math.max(0,H+L-50):Z=Math.min(e.doc.height,Z+L+50),Ui(e,{top:H,bottom:Z})}ri<20&&t.deltaMode!==0&&(l.wheelStartX==null?(l.wheelStartX=a.scrollLeft,l.wheelStartY=a.scrollTop,l.wheelDX=r,l.wheelDY=i,setTimeout(function(){if(l.wheelStartX!=null){var ie=a.scrollLeft-l.wheelStartX,ae=a.scrollTop-l.wheelStartY,he=ae&&l.wheelDY&&ae/l.wheelDY||ie&&l.wheelDX&&ie/l.wheelDX;l.wheelStartX=l.wheelStartY=null,he&&(rr=(rr*ri+he)/(ri+1),++ri)}},200)):(l.wheelDX+=r,l.wheelDY+=i))}}var Ot=function(e,t){this.ranges=e,this.primIndex=t};Ot.prototype.primary=function(){return this.ranges[this.primIndex]},Ot.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var n=this.ranges[t],r=e.ranges[t];if(!We(n.anchor,r.anchor)||!We(n.head,r.head))return!1}return!0},Ot.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new He(it(this.ranges[t].anchor),it(this.ranges[t].head));return new Ot(e,this.primIndex)},Ot.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},Ot.prototype.contains=function(e,t){t||(t=e);for(var n=0;n<this.ranges.length;n++){var r=this.ranges[n];if(ce(t,r.from())>=0&&ce(e,r.to())<=0)return n}return-1};var He=function(e,t){this.anchor=e,this.head=t};He.prototype.from=function(){return Wr(this.anchor,this.head)},He.prototype.to=function(){return wt(this.anchor,this.head)},He.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Kt(e,t,n){var r=e&&e.options.selectionsMayTouch,i=t[n];t.sort(function(D,L){return ce(D.from(),L.from())}),n=ve(t,i);for(var o=1;o<t.length;o++){var l=t[o],a=t[o-1],s=ce(a.to(),l.from());if(r&&!l.empty()?s>0:s>=0){var u=Wr(a.from(),l.from()),h=wt(a.to(),l.to()),x=a.empty()?l.from()==l.head:a.from()==a.head;o<=n&&--n,t.splice(--o,2,new He(x?h:u,x?u:h))}}return new Ot(t,n)}function pr(e,t){return new Ot([new He(e,t||e)],0)}function gr(e){return e.text?B(e.from.line+e.text.length-1,we(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function vl(e,t){if(ce(e,t.from)<0)return e;if(ce(e,t.to)<=0)return gr(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=gr(t).ch-t.to.ch),B(n,r)}function Qi(e,t){for(var n=[],r=0;r<e.sel.ranges.length;r++){var i=e.sel.ranges[r];n.push(new He(vl(i.anchor,t),vl(i.head,t)))}return Kt(e.cm,n,e.sel.primIndex)}function ml(e,t,n){return e.line==t.line?B(n.line,e.ch-t.ch+n.ch):B(n.line+(e.line-t.line),e.ch)}function ru(e,t,n){for(var r=[],i=B(e.first,0),o=i,l=0;l<t.length;l++){var a=t[l],s=ml(a.from,i,o),u=ml(gr(a),i,o);if(i=a.to,o=u,n=="around"){var h=e.sel.ranges[l],x=ce(h.head,h.anchor)<0;r[l]=new He(x?u:s,x?s:u)}else r[l]=new He(s,s)}return new Ot(r,e.sel.primIndex)}function Ji(e){e.doc.mode=zr(e.options,e.doc.modeOption),Sn(e)}function Sn(e){e.doc.iter(function(t){t.stateAfter&&(t.stateAfter=null),t.styles&&(t.styles=null)}),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,kn(e,100),e.state.modeGen++,e.curOp&&St(e)}function xl(e,t){return t.from.ch==0&&t.to.ch==0&&we(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Zi(e,t,n,r){function i(he){return n?n[he]:null}function o(he,se,ge){fs(he,se,ge,r),ot(he,"change",he,t)}function l(he,se){for(var ge=[],Le=he;Le<se;++Le)ge.push(new Hr(u[Le],i(Le),r));return ge}var a=t.from,s=t.to,u=t.text,h=ye(e,a.line),x=ye(e,s.line),D=we(u),L=i(u.length-1),H=s.line-a.line;if(t.full)e.insert(0,l(0,u.length)),e.remove(u.length,e.size-u.length);else if(xl(e,t)){var Z=l(0,u.length-1);o(x,x.text,L),H&&e.remove(a.line,H),Z.length&&e.insert(a.line,Z)}else if(h==x)if(u.length==1)o(h,h.text.slice(0,a.ch)+D+h.text.slice(s.ch),L);else{var ie=l(1,u.length-1);ie.push(new Hr(D+h.text.slice(s.ch),L,r)),o(h,h.text.slice(0,a.ch)+u[0],i(0)),e.insert(a.line+1,ie)}else if(u.length==1)o(h,h.text.slice(0,a.ch)+u[0]+x.text.slice(s.ch),i(0)),e.remove(a.line+1,H);else{o(h,h.text.slice(0,a.ch)+u[0],i(0)),o(x,D+x.text.slice(s.ch),L);var ae=l(1,u.length-1);H>1&&e.remove(a.line+1,H-1),e.insert(a.line+1,ae)}ot(e,"change",e,t)}function vr(e,t,n){function r(i,o,l){if(i.linked)for(var a=0;a<i.linked.length;++a){var s=i.linked[a];if(s.doc!=o){var u=l&&s.sharedHist;n&&!u||(t(s.doc,u),r(s.doc,i,u))}}}r(e,null,!0)}function yl(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,Bi(e),Ji(e),bl(e),e.options.direction=t.direction,e.options.lineWrapping||Ci(e),e.options.mode=t.modeOption,St(e)}function bl(e){(e.doc.direction=="rtl"?j:V)(e.display.lineDiv,"CodeMirror-rtl")}function nu(e){At(e,function(){bl(e),St(e)})}function ni(e){this.done=[],this.undone=[],this.undoDepth=e?e.undoDepth:1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e?e.maxGeneration:1}function $i(e,t){var n={from:it(t.from),to:gr(t),text:$t(e,t.from,t.to)};return Sl(e,n,t.from.line,t.to.line+1),vr(e,function(r){return Sl(r,n,t.from.line,t.to.line+1)},!0),n}function kl(e){for(;e.length;){var t=we(e);if(t.ranges)e.pop();else break}}function iu(e,t){if(t)return kl(e.done),we(e.done);if(e.done.length&&!we(e.done).ranges)return we(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),we(e.done)}function wl(e,t,n,r){var i=e.history;i.undone.length=0;var o=+new Date,l,a;if((i.lastOp==r||i.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&i.lastModTime>o-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(l=iu(i,i.lastOp==r)))a=we(l.changes),ce(t.from,t.to)==0&&ce(t.from,a.to)==0?a.to=gr(t):l.changes.push($i(e,t));else{var s=we(i.done);for((!s||!s.ranges)&&ii(e.sel,i.done),l={changes:[$i(e,t)],generation:i.generation},i.done.push(l);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(n),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=o,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=t.origin,a||Ye(e,"historyAdded")}function ou(e,t,n,r){var i=t.charAt(0);return i=="*"||i=="+"&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function lu(e,t,n,r){var i=e.history,o=r&&r.origin;n==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||ou(e,o,we(i.done),t))?i.done[i.done.length-1]=t:ii(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=n,r&&r.clearRedo!==!1&&kl(i.undone)}function ii(e,t){var n=we(t);n&&n.ranges&&n.equals(e)||t.push(e)}function Sl(e,t,n,r){var i=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),function(l){l.markedSpans&&((i||(i=t["spans_"+e.id]={}))[o]=l.markedSpans),++o})}function au(e){if(!e)return null;for(var t,n=0;n<e.length;++n)e[n].marker.explicitlyCleared?t||(t=e.slice(0,n)):t&&t.push(e[n]);return t?t.length?t:null:e}function su(e,t){var n=t["spans_"+e.id];if(!n)return null;for(var r=[],i=0;i<t.text.length;++i)r.push(au(n[i]));return r}function Ll(e,t){var n=su(e,t),r=wi(e,t);if(!n)return r;if(!r)return n;for(var i=0;i<n.length;++i){var o=n[i],l=r[i];if(o&&l)e:for(var a=0;a<l.length;++a){for(var s=l[a],u=0;u<o.length;++u)if(o[u].marker==s.marker)continue e;o.push(s)}else l&&(n[i]=l)}return n}function Yr(e,t,n){for(var r=[],i=0;i<e.length;++i){var o=e[i];if(o.ranges){r.push(n?Ot.prototype.deepCopy.call(o):o);continue}var l=o.changes,a=[];r.push({changes:a});for(var s=0;s<l.length;++s){var u=l[s],h=void 0;if(a.push({from:u.from,to:u.to,text:u.text}),t)for(var x in u)(h=x.match(/^spans_(\d+)$/))&&ve(t,Number(h[1]))>-1&&(we(a)[x]=u[x],delete u[x])}}return r}function Vi(e,t,n,r){if(r){var i=e.anchor;if(n){var o=ce(t,i)<0;o!=ce(n,i)<0?(i=t,t=n):o!=ce(t,n)<0&&(t=n)}return new He(i,t)}else return new He(n||t,t)}function oi(e,t,n,r,i){i==null&&(i=e.cm&&(e.cm.display.shift||e.extend)),gt(e,new Ot([Vi(e.sel.primary(),t,n,i)],0),r)}function Tl(e,t,n){for(var r=[],i=e.cm&&(e.cm.display.shift||e.extend),o=0;o<e.sel.ranges.length;o++)r[o]=Vi(e.sel.ranges[o],t[o],null,i);var l=Kt(e.cm,r,e.sel.primIndex);gt(e,l,n)}function eo(e,t,n,r){var i=e.sel.ranges.slice(0);i[t]=n,gt(e,Kt(e.cm,i,e.sel.primIndex),r)}function Cl(e,t,n,r){gt(e,pr(t,n),r)}function uu(e,t,n){var r={ranges:t.ranges,update:function(i){this.ranges=[];for(var o=0;o<i.length;o++)this.ranges[o]=new He(Ae(e,i[o].anchor),Ae(e,i[o].head))},origin:n&&n.origin};return Ye(e,"beforeSelectionChange",e,r),e.cm&&Ye(e.cm,"beforeSelectionChange",e.cm,r),r.ranges!=t.ranges?Kt(e.cm,r.ranges,r.ranges.length-1):t}function Dl(e,t,n){var r=e.history.done,i=we(r);i&&i.ranges?(r[r.length-1]=t,li(e,t,n)):gt(e,t,n)}function gt(e,t,n){li(e,t,n),lu(e,e.sel,e.cm?e.cm.curOp.id:NaN,n)}function li(e,t,n){(Ft(e,"beforeSelectionChange")||e.cm&&Ft(e.cm,"beforeSelectionChange"))&&(t=uu(e,t,n));var r=n&&n.bias||(ce(t.primary().head,e.sel.primary().head)<0?-1:1);Ml(e,Al(e,t,r,!0)),!(n&&n.scroll===!1)&&e.cm&&e.cm.getOption("readOnly")!="nocursor"&&Gr(e.cm)}function Ml(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,It(e.cm)),ot(e,"cursorActivity",e))}function Fl(e){Ml(e,Al(e,e.sel,null,!1))}function Al(e,t,n,r){for(var i,o=0;o<t.ranges.length;o++){var l=t.ranges[o],a=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[o],s=ai(e,l.anchor,a&&a.anchor,n,r),u=l.head==l.anchor?s:ai(e,l.head,a&&a.head,n,r);(i||s!=l.anchor||u!=l.head)&&(i||(i=t.ranges.slice(0,o)),i[o]=new He(s,u))}return i?Kt(e.cm,i,t.primIndex):t}function Qr(e,t,n,r,i){var o=ye(e,t.line);if(o.markedSpans)for(var l=0;l<o.markedSpans.length;++l){var a=o.markedSpans[l],s=a.marker,u="selectLeft"in s?!s.selectLeft:s.inclusiveLeft,h="selectRight"in s?!s.selectRight:s.inclusiveRight;if((a.from==null||(u?a.from<=t.ch:a.from<t.ch))&&(a.to==null||(h?a.to>=t.ch:a.to>t.ch))){if(i&&(Ye(s,"beforeCursorEnter"),s.explicitlyCleared))if(o.markedSpans){--l;continue}else break;if(!s.atomic)continue;if(n){var x=s.find(r<0?1:-1),D=void 0;if((r<0?h:u)&&(x=Nl(e,x,-r,x&&x.line==t.line?o:null)),x&&x.line==t.line&&(D=ce(x,n))&&(r<0?D<0:D>0))return Qr(e,x,t,r,i)}var L=s.find(r<0?-1:1);return(r<0?u:h)&&(L=Nl(e,L,r,L.line==t.line?o:null)),L?Qr(e,L,t,r,i):null}}return t}function ai(e,t,n,r,i){var o=r||1,l=Qr(e,t,n,o,i)||!i&&Qr(e,t,n,o,!0)||Qr(e,t,n,-o,i)||!i&&Qr(e,t,n,-o,!0);return l||(e.cantEdit=!0,B(e.first,0))}function Nl(e,t,n,r){return n<0&&t.ch==0?t.line>e.first?Ae(e,B(t.line-1)):null:n>0&&t.ch==(r||ye(e,t.line)).text.length?t.line<e.first+e.size-1?B(t.line+1,0):null:new B(t.line,t.ch+n)}function El(e){e.setSelection(B(e.firstLine(),0),B(e.lastLine()),$e)}function Ol(e,t,n){var r={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return r.canceled=!0}};return n&&(r.update=function(i,o,l,a){i&&(r.from=Ae(e,i)),o&&(r.to=Ae(e,o)),l&&(r.text=l),a!==void 0&&(r.origin=a)}),Ye(e,"beforeChange",e,r),e.cm&&Ye(e.cm,"beforeChange",e.cm,r),r.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:r.from,to:r.to,text:r.text,origin:r.origin}}function Jr(e,t,n){if(e.cm){if(!e.cm.curOp)return lt(e.cm,Jr)(e,t,n);if(e.cm.state.suppressEdits)return}if(!((Ft(e,"beforeChange")||e.cm&&Ft(e.cm,"beforeChange"))&&(t=Ol(e,t,!0),!t))){var r=Lo&&!n&&ls(e,t.from,t.to);if(r)for(var i=r.length-1;i>=0;--i)Pl(e,{from:r[i].from,to:r[i].to,text:i?[""]:t.text,origin:t.origin});else Pl(e,t)}}function Pl(e,t){if(!(t.text.length==1&&t.text[0]==""&&ce(t.from,t.to)==0)){var n=Qi(e,t);wl(e,t,n,e.cm?e.cm.curOp.id:NaN),Ln(e,t,n,wi(e,t));var r=[];vr(e,function(i,o){!o&&ve(r,i.history)==-1&&(Rl(i.history,t),r.push(i.history)),Ln(i,t,null,wi(i,t))})}}function si(e,t,n){var r=e.cm&&e.cm.state.suppressEdits;if(!(r&&!n)){for(var i=e.history,o,l=e.sel,a=t=="undo"?i.done:i.undone,s=t=="undo"?i.undone:i.done,u=0;u<a.length&&(o=a[u],!(n?o.ranges&&!o.equals(e.sel):!o.ranges));u++);if(u!=a.length){for(i.lastOrigin=i.lastSelOrigin=null;;)if(o=a.pop(),o.ranges){if(ii(o,s),n&&!o.equals(e.sel)){gt(e,o,{clearRedo:!1});return}l=o}else if(r){a.push(o);return}else break;var h=[];ii(l,s),s.push({changes:h,generation:i.generation}),i.generation=o.generation||++i.maxGeneration;for(var x=Ft(e,"beforeChange")||e.cm&&Ft(e.cm,"beforeChange"),D=function(Z){var ie=o.changes[Z];if(ie.origin=t,x&&!Ol(e,ie,!1))return a.length=0,{};h.push($i(e,ie));var ae=Z?Qi(e,ie):we(a);Ln(e,ie,ae,Ll(e,ie)),!Z&&e.cm&&e.cm.scrollIntoView({from:ie.from,to:gr(ie)});var he=[];vr(e,function(se,ge){!ge&&ve(he,se.history)==-1&&(Rl(se.history,ie),he.push(se.history)),Ln(se,ie,null,Ll(se,ie))})},L=o.changes.length-1;L>=0;--L){var H=D(L);if(H)return H.v}}}}function Il(e,t){if(t!=0&&(e.first+=t,e.sel=new Ot(Ie(e.sel.ranges,function(i){return new He(B(i.anchor.line+t,i.anchor.ch),B(i.head.line+t,i.head.ch))}),e.sel.primIndex),e.cm)){St(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;r<n.viewTo;r++)dr(e.cm,r,"gutter")}}function Ln(e,t,n,r){if(e.cm&&!e.cm.curOp)return lt(e.cm,Ln)(e,t,n,r);if(t.to.line<e.first){Il(e,t.text.length-1-(t.to.line-t.from.line));return}if(!(t.from.line>e.lastLine())){if(t.from.line<e.first){var i=t.text.length-1-(e.first-t.from.line);Il(e,i),t={from:B(e.first,0),to:B(t.to.line+i,t.to.ch),text:[we(t.text)],origin:t.origin}}var o=e.lastLine();t.to.line>o&&(t={from:t.from,to:B(o,ye(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=$t(e,t.from,t.to),n||(n=Qi(e,t)),e.cm?fu(e.cm,t,r):Zi(e,t,r),li(e,n,$e),e.cantEdit&&ai(e,B(e.firstLine(),0))&&(e.cantEdit=!1)}}function fu(e,t,n){var r=e.doc,i=e.display,o=t.from,l=t.to,a=!1,s=o.line;e.options.lineWrapping||(s=f(qt(ye(r,o.line))),r.iter(s,l.line+1,function(L){if(L==i.maxLine)return a=!0,!0})),r.sel.contains(t.from,t.to)>-1&&It(e),Zi(r,t,n,el(e)),e.options.lineWrapping||(r.iter(s,o.line+t.text.length,function(L){var H=Un(L);H>i.maxLineLength&&(i.maxLine=L,i.maxLineLength=H,i.maxLineChanged=!0,a=!1)}),a&&(e.curOp.updateMaxLine=!0)),Va(r,o.line),kn(e,400);var u=t.text.length-(l.line-o.line)-1;t.full?St(e):o.line==l.line&&t.text.length==1&&!xl(e.doc,t)?dr(e,o.line,"text"):St(e,o.line,l.line+1,u);var h=Ft(e,"changes"),x=Ft(e,"change");if(x||h){var D={from:o,to:l,text:t.text,removed:t.removed,origin:t.origin};x&&ot(e,"change",e,D),h&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(D)}e.display.selForContextMenu=null}function Zr(e,t,n,r,i){var o;r||(r=n),ce(r,n)<0&&(o=[r,n],n=o[0],r=o[1]),typeof t=="string"&&(t=e.splitLines(t)),Jr(e,{from:n,to:r,text:t,origin:i})}function zl(e,t,n,r){n<e.line?e.line+=r:t<e.line&&(e.line=t,e.ch=0)}function Bl(e,t,n,r){for(var i=0;i<e.length;++i){var o=e[i],l=!0;if(o.ranges){o.copied||(o=e[i]=o.deepCopy(),o.copied=!0);for(var a=0;a<o.ranges.length;a++)zl(o.ranges[a].anchor,t,n,r),zl(o.ranges[a].head,t,n,r);continue}for(var s=0;s<o.changes.length;++s){var u=o.changes[s];if(n<u.from.line)u.from=B(u.from.line+r,u.from.ch),u.to=B(u.to.line+r,u.to.ch);else if(t<=u.to.line){l=!1;break}}l||(e.splice(0,i+1),i=0)}}function Rl(e,t){var n=t.from.line,r=t.to.line,i=t.text.length-(r-n)-1;Bl(e.done,n,r,i),Bl(e.undone,n,r,i)}function Tn(e,t,n,r){var i=t,o=t;return typeof t=="number"?o=ye(e,go(e,t)):i=f(t),i==null?null:(r(o,i)&&e.cm&&dr(e.cm,i,n),o)}function Cn(e){this.lines=e,this.parent=null;for(var t=0,n=0;n<e.length;++n)e[n].parent=this,t+=e[n].height;this.height=t}Cn.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var n=e,r=e+t;n<r;++n){var i=this.lines[n];this.height-=i.height,cs(i),ot(i,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,n){this.height+=n,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var r=0;r<t.length;++r)t[r].parent=this},iterN:function(e,t,n){for(var r=e+t;e<r;++e)if(n(this.lines[e]))return!0}};function Dn(e){this.children=e;for(var t=0,n=0,r=0;r<e.length;++r){var i=e[r];t+=i.chunkSize(),n+=i.height,i.parent=this}this.size=t,this.height=n,this.parent=null}Dn.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var n=0;n<this.children.length;++n){var r=this.children[n],i=r.chunkSize();if(e<i){var o=Math.min(t,i-e),l=r.height;if(r.removeInner(e,o),this.height-=l-r.height,i==o&&(this.children.splice(n--,1),r.parent=null),(t-=o)==0)break;e=0}else e-=i}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof Cn))){var a=[];this.collapse(a),this.children=[new Cn(a)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,n){this.size+=t.length,this.height+=n;for(var r=0;r<this.children.length;++r){var i=this.children[r],o=i.chunkSize();if(e<=o){if(i.insertInner(e,t,n),i.lines&&i.lines.length>50){for(var l=i.lines.length%25+25,a=l;a<i.lines.length;){var s=new Cn(i.lines.slice(a,a+=25));i.height-=s.height,this.children.splice(++r,0,s),s.parent=this}i.lines=i.lines.slice(0,l),this.maybeSpill()}break}e-=o}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=e.children.splice(e.children.length-5,5),n=new Dn(t);if(e.parent){e.size-=n.size,e.height-=n.height;var i=ve(e.parent.children,e);e.parent.children.splice(i+1,0,n)}else{var r=new Dn(e.children);r.parent=e,e.children=[r,n],e=r}n.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var r=0;r<this.children.length;++r){var i=this.children[r],o=i.chunkSize();if(e<o){var l=Math.min(t,o-e);if(i.iterN(e,l,n))return!0;if((t-=l)==0)break;e=0}else e-=o}}};var Mn=function(e,t,n){if(n)for(var r in n)n.hasOwnProperty(r)&&(this[r]=n[r]);this.doc=e,this.node=t};Mn.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,n=this.line,r=f(n);if(!(r==null||!t)){for(var i=0;i<t.length;++i)t[i]==this&&t.splice(i--,1);t.length||(n.widgets=null);var o=pn(this);Et(n,Math.max(0,n.height-o)),e&&(At(e,function(){Wl(e,n,-o),dr(e,r,"widget")}),ot(e,"lineWidgetCleared",e,this,r))}},Mn.prototype.changed=function(){var e=this,t=this.height,n=this.doc.cm,r=this.line;this.height=null;var i=pn(this)-t;i&&(cr(this.doc,r)||Et(r,r.height+i),n&&At(n,function(){n.curOp.forceUpdate=!0,Wl(n,r,i),ot(n,"lineWidgetChanged",n,e,f(r))}))},Bt(Mn);function Wl(e,t,n){er(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&ji(e,n)}function cu(e,t,n,r){var i=new Mn(e,n,r),o=e.cm;return o&&i.noHScroll&&(o.display.alignWidgets=!0),Tn(e,t,"widget",function(l){var a=l.widgets||(l.widgets=[]);if(i.insertAt==null?a.push(i):a.splice(Math.min(a.length,Math.max(0,i.insertAt)),0,i),i.line=l,o&&!cr(e,l)){var s=er(l)<e.scrollTop;Et(l,l.height+pn(i)),s&&ji(o,i.height),o.curOp.forceUpdate=!0}return!0}),o&&ot(o,"lineWidgetAdded",o,i,typeof t=="number"?t:f(t)),i}var Hl=0,mr=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++Hl};mr.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&Mr(e),Ft(this,"clear")){var n=this.find();n&&ot(this,"clear",n.from,n.to)}for(var r=null,i=null,o=0;o<this.lines.length;++o){var l=this.lines[o],a=cn(l.markedSpans,this);e&&!this.collapsed?dr(e,f(l),"text"):e&&(a.to!=null&&(i=f(l)),a.from!=null&&(r=f(l))),l.markedSpans=rs(l.markedSpans,a),a.from==null&&this.collapsed&&!cr(this.doc,l)&&e&&Et(l,jr(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var s=0;s<this.lines.length;++s){var u=qt(this.lines[s]),h=Un(u);h>e.display.maxLineLength&&(e.display.maxLine=u,e.display.maxLineLength=h,e.display.maxLineChanged=!0)}r!=null&&e&&this.collapsed&&St(e,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Fl(e.doc)),e&&ot(e,"markerCleared",e,this,r,i),t&&Fr(e),this.parent&&this.parent.clear()}},mr.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var n,r,i=0;i<this.lines.length;++i){var o=this.lines[i],l=cn(o.markedSpans,this);if(l.from!=null&&(n=B(t?o:f(o),l.from),e==-1))return n;if(l.to!=null&&(r=B(t?o:f(o),l.to),e==1))return r}return n&&{from:n,to:r}},mr.prototype.changed=function(){var e=this,t=this.find(-1,!0),n=this,r=this.doc.cm;!t||!r||At(r,function(){var i=t.line,o=f(t.line),l=Ai(r,o);if(l&&(Go(l),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,!cr(n.doc,i)&&n.height!=null){var a=n.height;n.height=null;var s=pn(n)-a;s&&Et(i,i.height+s)}ot(r,"markerChanged",r,e)})},mr.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||ve(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},mr.prototype.detachLine=function(e){if(this.lines.splice(ve(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},Bt(mr);function $r(e,t,n,r,i){if(r&&r.shared)return du(e,t,n,r,i);if(e.cm&&!e.cm.curOp)return lt(e.cm,$r)(e,t,n,r,i);var o=new mr(e,i),l=ce(t,n);if(r&&Me(r,o,!1),l>0||l==0&&o.clearWhenEmpty!==!1)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=T("span",[o.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(Ao(e,t.line,t,n,o)||t.line!=n.line&&Ao(e,n.line,t,n,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");ts()}o.addToHistory&&wl(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var a=t.line,s=e.cm,u;if(e.iter(a,n.line+1,function(x){s&&o.collapsed&&!s.options.lineWrapping&&qt(x)==s.display.maxLine&&(u=!0),o.collapsed&&a!=t.line&&Et(x,0),ns(x,new _n(o,a==t.line?t.ch:null,a==n.line?n.ch:null),e.cm&&e.cm.curOp),++a}),o.collapsed&&e.iter(t.line,n.line+1,function(x){cr(e,x)&&Et(x,0)}),o.clearOnEnter&&Se(o,"beforeCursorEnter",function(){return o.clear()}),o.readOnly&&(es(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++Hl,o.atomic=!0),s){if(u&&(s.curOp.updateMaxLine=!0),o.collapsed)St(s,t.line,n.line+1);else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(var h=t.line;h<=n.line;h++)dr(s,h,"text");o.atomic&&Fl(s.doc),ot(s,"markerAdded",s,o)}return o}var Fn=function(e,t){this.markers=e,this.primary=t;for(var n=0;n<e.length;++n)e[n].parent=this};Fn.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();ot(this,"clear")}},Fn.prototype.find=function(e,t){return this.primary.find(e,t)},Bt(Fn);function du(e,t,n,r,i){r=Me(r),r.shared=!1;var o=[$r(e,t,n,r,i)],l=o[0],a=r.widgetNode;return vr(e,function(s){a&&(r.widgetNode=a.cloneNode(!0)),o.push($r(s,Ae(s,t),Ae(s,n),r,i));for(var u=0;u<s.linked.length;++u)if(s.linked[u].isParent)return;l=we(o)}),new Fn(o,l)}function _l(e){return e.findMarks(B(e.first,0),e.clipPos(B(e.lastLine())),function(t){return t.parent})}function hu(e,t){for(var n=0;n<t.length;n++){var r=t[n],i=r.find(),o=e.clipPos(i.from),l=e.clipPos(i.to);if(ce(o,l)){var a=$r(e,o,l,r.primary,r.primary.type);r.markers.push(a),a.parent=r}}}function pu(e){for(var t=function(r){var i=e[r],o=[i.primary.doc];vr(i.primary.doc,function(s){return o.push(s)});for(var l=0;l<i.markers.length;l++){var a=i.markers[l];ve(o,a.doc)==-1&&(a.parent=null,i.markers.splice(l--,1))}},n=0;n<e.length;n++)t(n)}var gu=0,Lt=function(e,t,n,r,i){if(!(this instanceof Lt))return new Lt(e,t,n,r,i);n==null&&(n=0),Dn.call(this,[new Cn([new Hr("",null)])]),this.first=n,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=n;var o=B(n,0);this.sel=pr(o),this.history=new ni(null),this.id=++gu,this.modeOption=t,this.lineSep=r,this.direction=i=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),Zi(this,{from:o,to:o,text:e}),gt(this,pr(o),$e)};Lt.prototype=K(Dn.prototype,{constructor:Lt,iter:function(e,t,n){n?this.iterN(e-this.first,t-e,n):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var n=0,r=0;r<t.length;++r)n+=t[r].height;this.insertInner(e-this.first,t,n)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=un(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:at(function(e){var t=B(this.first,0),n=this.first+this.size-1;Jr(this,{from:t,to:B(n,ye(this,n).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&mn(this.cm,0,0),gt(this,pr(t),$e)}),replaceRange:function(e,t,n,r){t=Ae(this,t),n=n?Ae(this,n):t,Zr(this,e,t,n,r)},getRange:function(e,t,n){var r=$t(this,Ae(this,e),Ae(this,t));return n===!1?r:n===""?r.join(""):r.join(n||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(U(this,e))return ye(this,e)},getLineNumber:function(e){return f(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=ye(this,e)),qt(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return Ae(this,e)},getCursor:function(e){var t=this.sel.primary(),n;return e==null||e=="head"?n=t.head:e=="anchor"?n=t.anchor:e=="end"||e=="to"||e===!1?n=t.to():n=t.from(),n},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:at(function(e,t,n){Cl(this,Ae(this,typeof e=="number"?B(e,t||0):e),null,n)}),setSelection:at(function(e,t,n){Cl(this,Ae(this,e),Ae(this,t||e),n)}),extendSelection:at(function(e,t,n){oi(this,Ae(this,e),t&&Ae(this,t),n)}),extendSelections:at(function(e,t){Tl(this,vo(this,e),t)}),extendSelectionsBy:at(function(e,t){var n=Ie(this.sel.ranges,e);Tl(this,vo(this,n),t)}),setSelections:at(function(e,t,n){if(e.length){for(var r=[],i=0;i<e.length;i++)r[i]=new He(Ae(this,e[i].anchor),Ae(this,e[i].head||e[i].anchor));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),gt(this,Kt(this.cm,r,t),n)}}),addSelection:at(function(e,t,n){var r=this.sel.ranges.slice(0);r.push(new He(Ae(this,e),Ae(this,t||e))),gt(this,Kt(this.cm,r,r.length-1),n)}),getSelection:function(e){for(var t=this.sel.ranges,n,r=0;r<t.length;r++){var i=$t(this,t[r].from(),t[r].to());n=n?n.concat(i):i}return e===!1?n:n.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],n=this.sel.ranges,r=0;r<n.length;r++){var i=$t(this,n[r].from(),n[r].to());e!==!1&&(i=i.join(e||this.lineSeparator())),t[r]=i}return t},replaceSelection:function(e,t,n){for(var r=[],i=0;i<this.sel.ranges.length;i++)r[i]=e;this.replaceSelections(r,t,n||"+input")},replaceSelections:at(function(e,t,n){for(var r=[],i=this.sel,o=0;o<i.ranges.length;o++){var l=i.ranges[o];r[o]={from:l.from(),to:l.to(),text:this.splitLines(e[o]),origin:n}}for(var a=t&&t!="end"&&ru(this,r,t),s=r.length-1;s>=0;s--)Jr(this,r[s]);a?Dl(this,a):this.cm&&Gr(this.cm)}),undo:at(function(){si(this,"undo")}),redo:at(function(){si(this,"redo")}),undoSelection:at(function(){si(this,"undo",!0)}),redoSelection:at(function(){si(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,r=0;r<e.done.length;r++)e.done[r].ranges||++t;for(var i=0;i<e.undone.length;i++)e.undone[i].ranges||++n;return{undo:t,redo:n}},clearHistory:function(){var e=this;this.history=new ni(this.history),vr(this,function(t){return t.history=e.history},!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:Yr(this.history.done),undone:Yr(this.history.undone)}},setHistory:function(e){var t=this.history=new ni(this.history);t.done=Yr(e.done.slice(0),null,!0),t.undone=Yr(e.undone.slice(0),null,!0)},setGutterMarker:at(function(e,t,n){return Tn(this,e,"gutter",function(r){var i=r.gutterMarkers||(r.gutterMarkers={});return i[t]=n,!n&&be(i)&&(r.gutterMarkers=null),!0})}),clearGutter:at(function(e){var t=this;this.iter(function(n){n.gutterMarkers&&n.gutterMarkers[e]&&Tn(t,n,"gutter",function(){return n.gutterMarkers[e]=null,be(n.gutterMarkers)&&(n.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!U(this,e)||(t=e,e=ye(this,e),!e))return null}else if(t=f(e),t==null)return null;return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:at(function(e,t,n){return Tn(this,e,t=="gutter"?"gutter":"class",function(r){var i=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!r[i])r[i]=n;else{if(P(n).test(r[i]))return!1;r[i]+=" "+n}return!0})}),removeLineClass:at(function(e,t,n){return Tn(this,e,t=="gutter"?"gutter":"class",function(r){var i=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",o=r[i];if(o)if(n==null)r[i]=null;else{var l=o.match(P(n));if(!l)return!1;var a=l.index+l[0].length;r[i]=o.slice(0,l.index)+(!l.index||a==o.length?"":" ")+o.slice(a)||null}else return!1;return!0})}),addLineWidget:at(function(e,t,n){return cu(this,e,t,n)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,n){return $r(this,Ae(this,e),Ae(this,t),n,n&&n.type||"range")},setBookmark:function(e,t){var n={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=Ae(this,e),$r(this,e,e,n,"bookmark")},findMarksAt:function(e){e=Ae(this,e);var t=[],n=ye(this,e.line).markedSpans;if(n)for(var r=0;r<n.length;++r){var i=n[r];(i.from==null||i.from<=e.ch)&&(i.to==null||i.to>=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,n){e=Ae(this,e),t=Ae(this,t);var r=[],i=e.line;return this.iter(e.line,t.line+1,function(o){var l=o.markedSpans;if(l)for(var a=0;a<l.length;a++){var s=l[a];!(s.to!=null&&i==e.line&&e.ch>=s.to||s.from==null&&i!=e.line||s.from!=null&&i==t.line&&s.from>=t.ch)&&(!n||n(s.marker))&&r.push(s.marker.parent||s.marker)}++i}),r},getAllMarks:function(){var e=[];return this.iter(function(t){var n=t.markedSpans;if(n)for(var r=0;r<n.length;++r)n[r].from!=null&&e.push(n[r].marker)}),e},posFromIndex:function(e){var t,n=this.first,r=this.lineSeparator().length;return this.iter(function(i){var o=i.text.length+r;if(o>e)return t=e,!0;e-=o,++n}),Ae(this,B(n,t))},indexFromPos:function(e){e=Ae(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var n=this.lineSeparator().length;return this.iter(this.first,e.line,function(r){t+=r.text.length+n}),t},copy:function(e){var t=new Lt(un(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,n=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<n&&(n=e.to);var r=new Lt(un(this,t,n),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(r.history=this.history),(this.linked||(this.linked=[])).push({doc:r,sharedHist:e.sharedHist}),r.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],hu(r,_l(this)),r},unlinkDoc:function(e){if(e instanceof Ge&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var n=this.linked[t];if(n.doc==e){this.linked.splice(t,1),e.unlinkDoc(this),pu(_l(this));break}}if(e.history==this.history){var r=[e.id];vr(e,function(i){return r.push(i.id)},!0),e.history=new ni(null),e.history.done=Yr(this.history.done,r),e.history.undone=Yr(this.history.undone,r)}},iterLinkedDocs:function(e){vr(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):zt(e)},lineSeparator:function(){return this.lineSep||`
`},setDirection:at(function(e){e!="rtl"&&(e="ltr"),e!=this.direction&&(this.direction=e,this.iter(function(t){return t.order=null}),this.cm&&nu(this.cm))})}),Lt.prototype.eachLine=Lt.prototype.iter;var ql=0;function vu(e){var t=this;if(jl(t),!(Qe(t,e)||tr(t.display,e))){pt(e),k&&(ql=+new Date);var n=Lr(t,e,!0),r=e.dataTransfer.files;if(!(!n||t.isReadOnly()))if(r&&r.length&&window.FileReader&&window.File)for(var i=r.length,o=Array(i),l=0,a=function(){++l==i&&lt(t,function(){n=Ae(t.doc,n);var L={from:n,to:n,text:t.doc.splitLines(o.filter(function(H){return H!=null}).join(t.doc.lineSeparator())),origin:"paste"};Jr(t.doc,L),Dl(t.doc,pr(Ae(t.doc,n),Ae(t.doc,gr(L))))})()},s=function(L,H){if(t.options.allowDropFileTypes&&ve(t.options.allowDropFileTypes,L.type)==-1){a();return}var Z=new FileReader;Z.onerror=function(){return a()},Z.onload=function(){var ie=Z.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(ie)){a();return}o[H]=ie,a()},Z.readAsText(L)},u=0;u<r.length;u++)s(r[u],u);else{if(t.state.draggingText&&t.doc.sel.contains(n)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var h=e.dataTransfer.getData("Text");if(h){var x;if(t.state.draggingText&&!t.state.draggingText.copy&&(x=t.listSelections()),li(t.doc,pr(n,n)),x)for(var D=0;D<x.length;++D)Zr(t.doc,"",x[D].anchor,x[D].head,"drag");t.replaceSelection(h,"around","paste"),t.display.input.focus()}}catch{}}}}function mu(e,t){if(k&&(!e.state.draggingText||+new Date-ql<100)){ar(t);return}if(!(Qe(e,t)||tr(e.display,t))&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!$)){var n=c("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",A&&(n.width=n.height=1,e.display.wrapper.appendChild(n),n._top=n.offsetTop),t.dataTransfer.setDragImage(n,0,0),A&&n.parentNode.removeChild(n)}}function xu(e,t){var n=Lr(e,t);if(n){var r=document.createDocumentFragment();Ri(e,n,r),e.display.dragCursor||(e.display.dragCursor=c("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),G(e.display.dragCursor,r)}}function jl(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Kl(e){if(document.getElementsByClassName){for(var t=document.getElementsByClassName("CodeMirror"),n=[],r=0;r<t.length;r++){var i=t[r].CodeMirror;i&&n.push(i)}n.length&&n[0].operation(function(){for(var o=0;o<n.length;o++)e(n[o])})}}var Ul=!1;function yu(){Ul||(bu(),Ul=!0)}function bu(){var e;Se(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,Kl(ku)},100))}),Se(window,"blur",function(){return Kl(Ur)})}function ku(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var xr={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},An=0;An<10;An++)xr[An+48]=xr[An+96]=String(An);for(var ui=65;ui<=90;ui++)xr[ui]=String.fromCharCode(ui);for(var Nn=1;Nn<=12;Nn++)xr[Nn+111]=xr[Nn+63235]="F"+Nn;var nr={};nr.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},nr.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},nr.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},nr.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},nr.default=z?nr.macDefault:nr.pcDefault;function wu(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var n,r,i,o,l=0;l<t.length-1;l++){var a=t[l];if(/^(cmd|meta|m)$/i.test(a))o=!0;else if(/^a(lt)?$/i.test(a))n=!0;else if(/^(c|ctrl|control)$/i.test(a))r=!0;else if(/^s(hift)?$/i.test(a))i=!0;else throw new Error("Unrecognized modifier name: "+a)}return n&&(e="Alt-"+e),r&&(e="Ctrl-"+e),o&&(e="Cmd-"+e),i&&(e="Shift-"+e),e}function Su(e){var t={};for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];if(/^(name|fallthrough|(de|at)tach)$/.test(n))continue;if(r=="..."){delete e[n];continue}for(var i=Ie(n.split(" "),wu),o=0;o<i.length;o++){var l=void 0,a=void 0;o==i.length-1?(a=i.join(" "),l=r):(a=i.slice(0,o+1).join(" "),l="...");var s=t[a];if(!s)t[a]=l;else if(s!=l)throw new Error("Inconsistent bindings for "+a)}delete e[n]}for(var u in t)e[u]=t[u];return e}function Vr(e,t,n,r){t=fi(t);var i=t.call?t.call(e,r):t[e];if(i===!1)return"nothing";if(i==="...")return"multi";if(i!=null&&n(i))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return Vr(e,t.fallthrough,n,r);for(var o=0;o<t.fallthrough.length;o++){var l=Vr(e,t.fallthrough[o],n,r);if(l)return l}}}function Gl(e){var t=typeof e=="string"?e:xr[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function Xl(e,t,n){var r=e;return t.altKey&&r!="Alt"&&(e="Alt-"+e),(W?t.metaKey:t.ctrlKey)&&r!="Ctrl"&&(e="Ctrl-"+e),(W?t.ctrlKey:t.metaKey)&&r!="Mod"&&(e="Cmd-"+e),!n&&t.shiftKey&&r!="Shift"&&(e="Shift-"+e),e}function Yl(e,t){if(A&&e.keyCode==34&&e.char)return!1;var n=xr[e.keyCode];return n==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(n=e.code),Xl(n,e,t))}function fi(e){return typeof e=="string"?nr[e]:e}function en(e,t){for(var n=e.doc.sel.ranges,r=[],i=0;i<n.length;i++){for(var o=t(n[i]);r.length&&ce(o.from,we(r).to)<=0;){var l=r.pop();if(ce(l.from,o.from)<0){o.from=l.from;break}}r.push(o)}At(e,function(){for(var a=r.length-1;a>=0;a--)Zr(e.doc,"",r[a].from,r[a].to,"+delete");Gr(e)})}function to(e,t,n){var r=Mt(e.text,t+n,n);return r<0||r>e.text.length?null:r}function ro(e,t,n){var r=to(e,t.ch,n);return r==null?null:new B(t.line,r,n<0?"after":"before")}function no(e,t,n,r,i){if(e){t.doc.direction=="rtl"&&(i=-i);var o=Re(n,t.doc.direction);if(o){var l=i<0?we(o):o[0],a=i<0==(l.level==1),s=a?"after":"before",u;if(l.level>0||t.doc.direction=="rtl"){var h=qr(t,n);u=i<0?n.text.length-1:0;var x=Qt(t,h,u).top;u=Pt(function(D){return Qt(t,h,D).top==x},i<0==(l.level==1)?l.from:l.to-1,u),s=="before"&&(u=to(n,u,1))}else u=i<0?l.to:l.from;return new B(r,u,s)}}return new B(r,i<0?n.text.length:0,i<0?"before":"after")}function Lu(e,t,n,r){var i=Re(t,e.doc.direction);if(!i)return ro(t,n,r);n.ch>=t.text.length?(n.ch=t.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var o=lr(i,n.ch,n.sticky),l=i[o];if(e.doc.direction=="ltr"&&l.level%2==0&&(r>0?l.to>n.ch:l.from<n.ch))return ro(t,n,r);var a=function(ae,he){return to(t,ae instanceof B?ae.ch:ae,he)},s,u=function(ae){return e.options.lineWrapping?(s=s||qr(e,t),Vo(e,t,s,ae)):{begin:0,end:t.text.length}},h=u(n.sticky=="before"?a(n,-1):n.ch);if(e.doc.direction=="rtl"||l.level==1){var x=l.level==1==r<0,D=a(n,x?1:-1);if(D!=null&&(x?D<=l.to&&D<=h.end:D>=l.from&&D>=h.begin)){var L=x?"before":"after";return new B(n.line,D,L)}}var H=function(ae,he,se){for(var ge=function(Ke,st){return st?new B(n.line,a(Ke,1),"before"):new B(n.line,Ke,"after")};ae>=0&&ae<i.length;ae+=he){var Le=i[ae],ke=he>0==(Le.level!=1),Ee=ke?se.begin:a(se.end,-1);if(Le.from<=Ee&&Ee<Le.to||(Ee=ke?Le.from:a(Le.to,-1),se.begin<=Ee&&Ee<se.end))return ge(Ee,ke)}},Z=H(o+r,r,h);if(Z)return Z;var ie=r>0?h.end:a(h.begin,-1);return ie!=null&&!(r>0&&ie==t.text.length)&&(Z=H(r>0?0:i.length-1,r,u(ie)),Z)?Z:null}var En={selectAll:El,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),$e)},killLine:function(e){return en(e,function(t){if(t.empty()){var n=ye(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line<e.lastLine()?{from:t.head,to:B(t.head.line+1,0)}:{from:t.head,to:B(t.head.line,n)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return en(e,function(t){return{from:B(t.from().line,0),to:Ae(e.doc,B(t.to().line+1,0))}})},delLineLeft:function(e){return en(e,function(t){return{from:B(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return en(e,function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:n},"div");return{from:r,to:t.from()}})},delWrappedLineRight:function(e){return en(e,function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div");return{from:t.from(),to:r}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(B(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(B(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return Ql(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return Jl(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return Tu(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var n=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div")},Pe)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var n=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:n},"div")},Pe)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var n=e.cursorCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:n},"div");return r.ch<e.getLine(r.line).search(/\S/)?Jl(e,t.head):r},Pe)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"codepoint")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection("	")},insertSoftTab:function(e){for(var t=[],n=e.listSelections(),r=e.options.tabSize,i=0;i<n.length;i++){var o=n[i].from(),l=Fe(e.getLine(o.line),o.ch,r);t.push(et(r-l%r))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return At(e,function(){for(var t=e.listSelections(),n=[],r=0;r<t.length;r++)if(t[r].empty()){var i=t[r].head,o=ye(e.doc,i.line).text;if(o){if(i.ch==o.length&&(i=new B(i.line,i.ch-1)),i.ch>0)i=new B(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),B(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var l=ye(e.doc,i.line-1).text;l&&(i=new B(i.line,1),e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+l.charAt(l.length-1),B(i.line-1,l.length-1),i,"+transpose"))}}n.push(new He(i,i))}e.setSelections(n)})},newlineAndIndent:function(e){return At(e,function(){for(var t=e.listSelections(),n=t.length-1;n>=0;n--)e.replaceRange(e.doc.lineSeparator(),t[n].anchor,t[n].head,"+input");t=e.listSelections();for(var r=0;r<t.length;r++)e.indentLine(t[r].from().line,null,!0);Gr(e)})},openLine:function(e){return e.replaceSelection(`
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function Ql(e,t){var n=ye(e.doc,t),r=qt(n);return r!=n&&(t=f(r)),no(!0,e,r,t,1)}function Tu(e,t){var n=ye(e.doc,t),r=ss(n);return r!=n&&(t=f(r)),no(!0,e,n,t,-1)}function Jl(e,t){var n=Ql(e,t.line),r=ye(e.doc,n.line),i=Re(r,e.doc.direction);if(!i||i[0].level==0){var o=Math.max(n.ch,r.text.search(/\S/)),l=t.line==n.line&&t.ch<=o&&t.ch;return B(n.line,l?0:o,n.sticky)}return n}function ci(e,t,n){if(typeof t=="string"&&(t=En[t],!t))return!1;e.display.input.ensurePolled();var r=e.display.shift,i=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),n&&(e.display.shift=!1),i=t(e)!=qe}finally{e.display.shift=r,e.state.suppressEdits=!1}return i}function Cu(e,t,n){for(var r=0;r<e.state.keyMaps.length;r++){var i=Vr(t,e.state.keyMaps[r],n,e);if(i)return i}return e.options.extraKeys&&Vr(t,e.options.extraKeys,n,e)||Vr(t,e.options.keyMap,n,e)}var Du=new Ce;function On(e,t,n,r){var i=e.state.keySeq;if(i){if(Gl(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:Du.set(50,function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())}),Zl(e,i+" "+t,n,r))return!0}return Zl(e,t,n,r)}function Zl(e,t,n,r){var i=Cu(e,t,r);return i=="multi"&&(e.state.keySeq=t),i=="handled"&&ot(e,"keyHandled",e,t,n),(i=="handled"||i=="multi")&&(pt(n),Wi(e)),!!i}function $l(e,t){var n=Yl(t,!0);return n?t.shiftKey&&!e.state.keySeq?On(e,"Shift-"+n,t,function(r){return ci(e,r,!0)})||On(e,n,t,function(r){if(typeof r=="string"?/^go[A-Z]/.test(r):r.motion)return ci(e,r)}):On(e,n,t,function(r){return ci(e,r)}):!1}function Mu(e,t,n){return On(e,"'"+n+"'",t,function(r){return ci(e,r,!0)})}var io=null;function Vl(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField())&&(t.curOp.focus=y(fe(t)),!Qe(t,e))){k&&I<11&&e.keyCode==27&&(e.returnValue=!1);var n=e.keyCode;t.display.shift=n==16||e.shiftKey;var r=$l(t,e);A&&(io=r?n:null,!r&&n==88&&!Wn&&(z?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),_&&!z&&!r&&n==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),n==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&Fu(t)}}function Fu(e){var t=e.display.lineDiv;j(t,"CodeMirror-crosshair");function n(r){(r.keyCode==18||!r.altKey)&&(V(t,"CodeMirror-crosshair"),ht(document,"keyup",n),ht(document,"mouseover",n))}Se(document,"keyup",n),Se(document,"mouseover",n)}function ea(e){e.keyCode==16&&(this.doc.sel.shift=!1),Qe(this,e)}function ta(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField())&&!(tr(t.display,e)||Qe(t,e)||e.ctrlKey&&!e.altKey||z&&e.metaKey)){var n=e.keyCode,r=e.charCode;if(A&&n==io){io=null,pt(e);return}if(!(A&&(!e.which||e.which<10)&&$l(t,e))){var i=String.fromCharCode(r??n);i!="\b"&&(Mu(t,e,i)||t.display.input.onKeyPress(e))}}}var Au=400,oo=function(e,t,n){this.time=e,this.pos=t,this.button=n};oo.prototype.compare=function(e,t,n){return this.time+Au>e&&ce(t,this.pos)==0&&n==this.button};var Pn,In;function Nu(e,t){var n=+new Date;return In&&In.compare(n,e,t)?(Pn=In=null,"triple"):Pn&&Pn.compare(n,e,t)?(In=new oo(n,e,t),Pn=null,"double"):(Pn=new oo(n,e,t),In=null,"single")}function ra(e){var t=this,n=t.display;if(!(Qe(t,e)||n.activeTouch&&n.input.supportsTouch())){if(n.input.ensurePolled(),n.shift=e.shiftKey,tr(n,e)){Y||(n.scroller.draggable=!1,setTimeout(function(){return n.scroller.draggable=!0},100));return}if(!lo(t,e)){var r=Lr(t,e),i=Rt(e),o=r?Nu(r,i):"single";le(t).focus(),i==1&&t.state.selectingText&&t.state.selectingText(e),!(r&&Eu(t,i,r,o,e))&&(i==1?r?Pu(t,r,o,e):ln(e)==n.scroller&&pt(e):i==2?(r&&oi(t.doc,r),setTimeout(function(){return n.input.focus()},20)):i==3&&(J?t.display.input.onContextMenu(e):Hi(t)))}}}function Eu(e,t,n,r,i){var o="Click";return r=="double"?o="Double"+o:r=="triple"&&(o="Triple"+o),o=(t==1?"Left":t==2?"Middle":"Right")+o,On(e,Xl(o,i),i,function(l){if(typeof l=="string"&&(l=En[l]),!l)return!1;var a=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),a=l(e,n)!=qe}finally{e.state.suppressEdits=!1}return a})}function Ou(e,t,n){var r=e.getOption("configureMouse"),i=r?r(e,t,n):{};if(i.unit==null){var o=X?n.shiftKey&&n.metaKey:n.altKey;i.unit=o?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(i.extend==null||e.doc.extend)&&(i.extend=e.doc.extend||n.shiftKey),i.addNew==null&&(i.addNew=z?n.metaKey:n.ctrlKey),i.moveOnDrag==null&&(i.moveOnDrag=!(z?n.altKey:n.ctrlKey)),i}function Pu(e,t,n,r){k?setTimeout(xe(nl,e),0):e.curOp.focus=y(fe(e));var i=Ou(e,n,r),o=e.doc.sel,l;e.options.dragDrop&&xi&&!e.isReadOnly()&&n=="single"&&(l=o.contains(t))>-1&&(ce((l=o.ranges[l]).from(),t)<0||t.xRel>0)&&(ce(l.to(),t)>0||t.xRel<0)?Iu(e,r,t,i):zu(e,r,t,i)}function Iu(e,t,n,r){var i=e.display,o=!1,l=lt(e,function(u){Y&&(i.scroller.draggable=!1),e.state.draggingText=!1,e.state.delayingBlurEvent&&(e.hasFocus()?e.state.delayingBlurEvent=!1:Hi(e)),ht(i.wrapper.ownerDocument,"mouseup",l),ht(i.wrapper.ownerDocument,"mousemove",a),ht(i.scroller,"dragstart",s),ht(i.scroller,"drop",l),o||(pt(u),r.addNew||oi(e.doc,n,null,null,r.extend),Y&&!$||k&&I==9?setTimeout(function(){i.wrapper.ownerDocument.body.focus({preventScroll:!0}),i.input.focus()},20):i.input.focus())}),a=function(u){o=o||Math.abs(t.clientX-u.clientX)+Math.abs(t.clientY-u.clientY)>=10},s=function(){return o=!0};Y&&(i.scroller.draggable=!0),e.state.draggingText=l,l.copy=!r.moveOnDrag,Se(i.wrapper.ownerDocument,"mouseup",l),Se(i.wrapper.ownerDocument,"mousemove",a),Se(i.scroller,"dragstart",s),Se(i.scroller,"drop",l),e.state.delayingBlurEvent=!0,setTimeout(function(){return i.input.focus()},20),i.scroller.dragDrop&&i.scroller.dragDrop()}function na(e,t,n){if(n=="char")return new He(t,t);if(n=="word")return e.findWordAt(t);if(n=="line")return new He(B(t.line,0),Ae(e.doc,B(t.line+1,0)));var r=n(e,t);return new He(r.from,r.to)}function zu(e,t,n,r){k&&Hi(e);var i=e.display,o=e.doc;pt(t);var l,a,s=o.sel,u=s.ranges;if(r.addNew&&!r.extend?(a=o.sel.contains(n),a>-1?l=u[a]:l=new He(n,n)):(l=o.sel.primary(),a=o.sel.primIndex),r.unit=="rectangle")r.addNew||(l=new He(n,n)),n=Lr(e,t,!0,!0),a=-1;else{var h=na(e,n,r.unit);r.extend?l=Vi(l,h.anchor,h.head,r.extend):l=h}r.addNew?a==-1?(a=u.length,gt(o,Kt(e,u.concat([l]),a),{scroll:!1,origin:"*mouse"})):u.length>1&&u[a].empty()&&r.unit=="char"&&!r.extend?(gt(o,Kt(e,u.slice(0,a).concat(u.slice(a+1)),0),{scroll:!1,origin:"*mouse"}),s=o.sel):eo(o,a,l,dt):(a=0,gt(o,new Ot([l],0),dt),s=o.sel);var x=n;function D(se){if(ce(x,se)!=0)if(x=se,r.unit=="rectangle"){for(var ge=[],Le=e.options.tabSize,ke=Fe(ye(o,n.line).text,n.ch,Le),Ee=Fe(ye(o,se.line).text,se.ch,Le),Ke=Math.min(ke,Ee),st=Math.max(ke,Ee),Xe=Math.min(n.line,se.line),Nt=Math.min(e.lastLine(),Math.max(n.line,se.line));Xe<=Nt;Xe++){var Tt=ye(o,Xe).text,tt=_e(Tt,Ke,Le);Ke==st?ge.push(new He(B(Xe,tt),B(Xe,tt))):Tt.length>tt&&ge.push(new He(B(Xe,tt),B(Xe,_e(Tt,st,Le))))}ge.length||ge.push(new He(n,n)),gt(o,Kt(e,s.ranges.slice(0,a).concat(ge),a),{origin:"*mouse",scroll:!1}),e.scrollIntoView(se)}else{var Ct=l,ft=na(e,se,r.unit),nt=Ct.anchor,rt;ce(ft.anchor,nt)>0?(rt=ft.head,nt=Wr(Ct.from(),ft.anchor)):(rt=ft.anchor,nt=wt(Ct.to(),ft.head));var Ze=s.ranges.slice(0);Ze[a]=Bu(e,new He(Ae(o,nt),rt)),gt(o,Kt(e,Ze,a),dt)}}var L=i.wrapper.getBoundingClientRect(),H=0;function Z(se){var ge=++H,Le=Lr(e,se,!0,r.unit=="rectangle");if(Le)if(ce(Le,x)!=0){e.curOp.focus=y(fe(e)),D(Le);var ke=Vn(i,o);(Le.line>=ke.to||Le.line<ke.from)&&setTimeout(lt(e,function(){H==ge&&Z(se)}),150)}else{var Ee=se.clientY<L.top?-20:se.clientY>L.bottom?20:0;Ee&&setTimeout(lt(e,function(){H==ge&&(i.scroller.scrollTop+=Ee,Z(se))}),50)}}function ie(se){e.state.selectingText=!1,H=1/0,se&&(pt(se),i.input.focus()),ht(i.wrapper.ownerDocument,"mousemove",ae),ht(i.wrapper.ownerDocument,"mouseup",he),o.history.lastSelOrigin=null}var ae=lt(e,function(se){se.buttons===0||!Rt(se)?ie(se):Z(se)}),he=lt(e,ie);e.state.selectingText=he,Se(i.wrapper.ownerDocument,"mousemove",ae),Se(i.wrapper.ownerDocument,"mouseup",he)}function Bu(e,t){var n=t.anchor,r=t.head,i=ye(e.doc,n.line);if(ce(n,r)==0&&n.sticky==r.sticky)return t;var o=Re(i);if(!o)return t;var l=lr(o,n.ch,n.sticky),a=o[l];if(a.from!=n.ch&&a.to!=n.ch)return t;var s=l+(a.from==n.ch==(a.level!=1)?0:1);if(s==0||s==o.length)return t;var u;if(r.line!=n.line)u=(r.line-n.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var h=lr(o,r.ch,r.sticky),x=h-l||(r.ch-n.ch)*(a.level==1?-1:1);h==s-1||h==s?u=x<0:u=x>0}var D=o[s+(u?-1:0)],L=u==(D.level==1),H=L?D.from:D.to,Z=L?"after":"before";return n.ch==H&&n.sticky==Z?t:new He(new B(n.line,H,Z),r)}function ia(e,t,n,r){var i,o;if(t.touches)i=t.touches[0].clientX,o=t.touches[0].clientY;else try{i=t.clientX,o=t.clientY}catch{return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&pt(t);var l=e.display,a=l.lineDiv.getBoundingClientRect();if(o>a.bottom||!Ft(e,n))return kt(t);o-=a.top-l.viewOffset;for(var s=0;s<e.display.gutterSpecs.length;++s){var u=l.gutters.childNodes[s];if(u&&u.getBoundingClientRect().right>=i){var h=m(e.doc,o),x=e.display.gutterSpecs[s];return Ye(e,n,e,h,x.className,t),kt(t)}}}function lo(e,t){return ia(e,t,"gutterClick",!0)}function oa(e,t){tr(e.display,t)||Ru(e,t)||Qe(e,t,"contextmenu")||J||e.display.input.onContextMenu(t)}function Ru(e,t){return Ft(e,"gutterContextMenu")?ia(e,t,"gutterContextMenu",!1):!1}function la(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),gn(e)}var tn={toString:function(){return"CodeMirror.Init"}},aa={},di={};function Wu(e){var t=e.optionHandlers;function n(r,i,o,l){e.defaults[r]=i,o&&(t[r]=l?function(a,s,u){u!=tn&&o(a,s,u)}:o)}e.defineOption=n,e.Init=tn,n("value","",function(r,i){return r.setValue(i)},!0),n("mode",null,function(r,i){r.doc.modeOption=i,Ji(r)},!0),n("indentUnit",2,Ji,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,function(r){Sn(r),gn(r),St(r)},!0),n("lineSeparator",null,function(r,i){if(r.doc.lineSep=i,!!i){var o=[],l=r.doc.first;r.doc.iter(function(s){for(var u=0;;){var h=s.text.indexOf(i,u);if(h==-1)break;u=h+i.length,o.push(B(l,h))}l++});for(var a=o.length-1;a>=0;a--)Zr(r.doc,i,o[a],B(o[a].line,o[a].ch+i.length))}}),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\u202d\u202e\u2066\u2067\u2069\ufeff\ufff9-\ufffc]/g,function(r,i,o){r.state.specialChars=new RegExp(i.source+(i.test("	")?"":"|	"),"g"),o!=tn&&r.refresh()}),n("specialCharPlaceholder",ps,function(r){return r.refresh()},!0),n("electricChars",!0),n("inputStyle",N?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),n("spellcheck",!1,function(r,i){return r.getInputField().spellcheck=i},!0),n("autocorrect",!1,function(r,i){return r.getInputField().autocorrect=i},!0),n("autocapitalize",!1,function(r,i){return r.getInputField().autocapitalize=i},!0),n("rtlMoveVisually",!q),n("wholeLineUpdateBefore",!0),n("theme","default",function(r){la(r),wn(r)},!0),n("keyMap","default",function(r,i,o){var l=fi(i),a=o!=tn&&fi(o);a&&a.detach&&a.detach(r,l),l.attach&&l.attach(r,a||null)}),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,_u,!0),n("gutters",[],function(r,i){r.display.gutterSpecs=Yi(i,r.options.lineNumbers),wn(r)},!0),n("fixedGutter",!0,function(r,i){r.display.gutters.style.left=i?zi(r.display)+"px":"0",r.refresh()},!0),n("coverGutterNextToScrollbar",!1,function(r){return Xr(r)},!0),n("scrollbarStyle","native",function(r){ul(r),Xr(r),r.display.scrollbars.setScrollTop(r.doc.scrollTop),r.display.scrollbars.setScrollLeft(r.doc.scrollLeft)},!0),n("lineNumbers",!1,function(r,i){r.display.gutterSpecs=Yi(r.options.gutters,i),wn(r)},!0),n("firstLineNumber",1,wn,!0),n("lineNumberFormatter",function(r){return r},wn,!0),n("showCursorWhenSelecting",!1,vn,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,function(r,i){i=="nocursor"&&(Ur(r),r.display.input.blur()),r.display.input.readOnlyChanged(i)}),n("screenReaderLabel",null,function(r,i){i=i===""?null:i,r.display.input.screenReaderLabelChanged(i)}),n("disableInput",!1,function(r,i){i||r.display.input.reset()},!0),n("dragDrop",!0,Hu),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,vn,!0),n("singleCursorHeightPerLine",!0,vn,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,Sn,!0),n("addModeClass",!1,Sn,!0),n("pollInterval",100),n("undoDepth",200,function(r,i){return r.doc.history.undoDepth=i}),n("historyEventDelay",1250),n("viewportMargin",10,function(r){return r.refresh()},!0),n("maxHighlightLength",1e4,Sn,!0),n("moveInputWithCursor",!0,function(r,i){i||r.display.input.resetPosition()}),n("tabindex",null,function(r,i){return r.display.input.getField().tabIndex=i||""}),n("autofocus",null),n("direction","ltr",function(r,i){return r.doc.setDirection(i)},!0),n("phrases",null)}function Hu(e,t,n){var r=n&&n!=tn;if(!t!=!r){var i=e.display.dragFunctions,o=t?Se:ht;o(e.display.scroller,"dragstart",i.start),o(e.display.scroller,"dragenter",i.enter),o(e.display.scroller,"dragover",i.over),o(e.display.scroller,"dragleave",i.leave),o(e.display.scroller,"drop",i.drop)}}function _u(e){e.options.lineWrapping?(j(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(V(e.display.wrapper,"CodeMirror-wrap"),Ci(e)),Bi(e),St(e),gn(e),setTimeout(function(){return Xr(e)},100)}function Ge(e,t){var n=this;if(!(this instanceof Ge))return new Ge(e,t);this.options=t=t?Me(t):{},Me(aa,t,!1);var r=t.value;typeof r=="string"?r=new Lt(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var i=new Ge.inputStyles[t.inputStyle](this),o=this.display=new eu(e,r,i,t);o.wrapper.CodeMirror=this,la(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),ul(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new Ce,keySeq:null,specialChars:null},t.autofocus&&!N&&o.input.focus(),k&&I<11&&setTimeout(function(){return n.display.input.reset(!0)},20),qu(this),yu(),Mr(this),this.curOp.forceUpdate=!0,yl(this,r),t.autofocus&&!N||this.hasFocus()?setTimeout(function(){n.hasFocus()&&!n.state.focused&&_i(n)},20):Ur(this);for(var l in di)di.hasOwnProperty(l)&&di[l](this,t[l],tn);dl(this),t.finishInit&&t.finishInit(this);for(var a=0;a<ao.length;++a)ao[a](this);Fr(this),Y&&t.lineWrapping&&getComputedStyle(o.lineDiv).textRendering=="optimizelegibility"&&(o.lineDiv.style.textRendering="auto")}Ge.defaults=aa,Ge.optionHandlers=di;function qu(e){var t=e.display;Se(t.scroller,"mousedown",lt(e,ra)),k&&I<11?Se(t.scroller,"dblclick",lt(e,function(s){if(!Qe(e,s)){var u=Lr(e,s);if(!(!u||lo(e,s)||tr(e.display,s))){pt(s);var h=e.findWordAt(u);oi(e.doc,h.anchor,h.head)}}})):Se(t.scroller,"dblclick",function(s){return Qe(e,s)||pt(s)}),Se(t.scroller,"contextmenu",function(s){return oa(e,s)}),Se(t.input.getField(),"contextmenu",function(s){t.scroller.contains(s.target)||oa(e,s)});var n,r={end:0};function i(){t.activeTouch&&(n=setTimeout(function(){return t.activeTouch=null},1e3),r=t.activeTouch,r.end=+new Date)}function o(s){if(s.touches.length!=1)return!1;var u=s.touches[0];return u.radiusX<=1&&u.radiusY<=1}function l(s,u){if(u.left==null)return!0;var h=u.left-s.left,x=u.top-s.top;return h*h+x*x>400}Se(t.scroller,"touchstart",function(s){if(!Qe(e,s)&&!o(s)&&!lo(e,s)){t.input.ensurePolled(),clearTimeout(n);var u=+new Date;t.activeTouch={start:u,moved:!1,prev:u-r.end<=300?r:null},s.touches.length==1&&(t.activeTouch.left=s.touches[0].pageX,t.activeTouch.top=s.touches[0].pageY)}}),Se(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),Se(t.scroller,"touchend",function(s){var u=t.activeTouch;if(u&&!tr(t,s)&&u.left!=null&&!u.moved&&new Date-u.start<300){var h=e.coordsChar(t.activeTouch,"page"),x;!u.prev||l(u,u.prev)?x=new He(h,h):!u.prev.prev||l(u,u.prev.prev)?x=e.findWordAt(h):x=new He(B(h.line,0),Ae(e.doc,B(h.line+1,0))),e.setSelection(x.anchor,x.head),e.focus(),pt(s)}i()}),Se(t.scroller,"touchcancel",i),Se(t.scroller,"scroll",function(){t.scroller.clientHeight&&(xn(e,t.scroller.scrollTop),Cr(e,t.scroller.scrollLeft,!0),Ye(e,"scroll",e))}),Se(t.scroller,"mousewheel",function(s){return gl(e,s)}),Se(t.scroller,"DOMMouseScroll",function(s){return gl(e,s)}),Se(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(s){Qe(e,s)||ar(s)},over:function(s){Qe(e,s)||(xu(e,s),ar(s))},start:function(s){return mu(e,s)},drop:lt(e,vu),leave:function(s){Qe(e,s)||jl(e)}};var a=t.input.getField();Se(a,"keyup",function(s){return ea.call(e,s)}),Se(a,"keydown",lt(e,Vl)),Se(a,"keypress",lt(e,ta)),Se(a,"focus",function(s){return _i(e,s)}),Se(a,"blur",function(s){return Ur(e,s)})}var ao=[];Ge.defineInitHook=function(e){return ao.push(e)};function zn(e,t,n,r){var i=e.doc,o;n==null&&(n="add"),n=="smart"&&(i.mode.indent?o=fn(e,t).state:n="prev");var l=e.options.tabSize,a=ye(i,t),s=Fe(a.text,null,l);a.stateAfter&&(a.stateAfter=null);var u=a.text.match(/^\s*/)[0],h;if(!r&&!/\S/.test(a.text))h=0,n="not";else if(n=="smart"&&(h=i.mode.indent(o,a.text.slice(u.length),a.text),h==qe||h>150)){if(!r)return;n="prev"}n=="prev"?t>i.first?h=Fe(ye(i,t-1).text,null,l):h=0:n=="add"?h=s+e.options.indentUnit:n=="subtract"?h=s-e.options.indentUnit:typeof n=="number"&&(h=s+n),h=Math.max(0,h);var x="",D=0;if(e.options.indentWithTabs)for(var L=Math.floor(h/l);L;--L)D+=l,x+="	";if(D<h&&(x+=et(h-D)),x!=u)return Zr(i,x,B(t,0),B(t,u.length),"+input"),a.stateAfter=null,!0;for(var H=0;H<i.sel.ranges.length;H++){var Z=i.sel.ranges[H];if(Z.head.line==t&&Z.head.ch<u.length){var ie=B(t,u.length);eo(i,H,new He(ie,ie));break}}}var Ut=null;function hi(e){Ut=e}function so(e,t,n,r,i){var o=e.doc;e.display.shift=!1,r||(r=o.sel);var l=+new Date-200,a=i=="paste"||e.state.pasteIncoming>l,s=zt(t),u=null;if(a&&r.ranges.length>1)if(Ut&&Ut.text.join(`
`)==t){if(r.ranges.length%Ut.text.length==0){u=[];for(var h=0;h<Ut.text.length;h++)u.push(o.splitLines(Ut.text[h]))}}else s.length==r.ranges.length&&e.options.pasteLinesPerSelection&&(u=Ie(s,function(ae){return[ae]}));for(var x=e.curOp.updateInput,D=r.ranges.length-1;D>=0;D--){var L=r.ranges[D],H=L.from(),Z=L.to();L.empty()&&(n&&n>0?H=B(H.line,H.ch-n):e.state.overwrite&&!a?Z=B(Z.line,Math.min(ye(o,Z.line).text.length,Z.ch+we(s).length)):a&&Ut&&Ut.lineWise&&Ut.text.join(`
`)==s.join(`
`)&&(H=Z=B(H.line,0)));var ie={from:H,to:Z,text:u?u[D%u.length]:s,origin:i||(a?"paste":e.state.cutIncoming>l?"cut":"+input")};Jr(e.doc,ie),ot(e,"inputRead",e,ie)}t&&!a&&ua(e,t),Gr(e),e.curOp.updateInput<2&&(e.curOp.updateInput=x),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function sa(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&t.hasFocus()&&At(t,function(){return so(t,n,0,null,"paste")}),!0}function ua(e,t){if(!(!e.options.electricChars||!e.options.smartIndent))for(var n=e.doc.sel,r=n.ranges.length-1;r>=0;r--){var i=n.ranges[r];if(!(i.head.ch>100||r&&n.ranges[r-1].head.line==i.head.line)){var o=e.getModeAt(i.head),l=!1;if(o.electricChars){for(var a=0;a<o.electricChars.length;a++)if(t.indexOf(o.electricChars.charAt(a))>-1){l=zn(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(ye(e.doc,i.head.line).text.slice(0,i.head.ch))&&(l=zn(e,i.head.line,"smart"));l&&ot(e,"electricInput",e,i.head.line)}}}function fa(e){for(var t=[],n=[],r=0;r<e.doc.sel.ranges.length;r++){var i=e.doc.sel.ranges[r].head.line,o={anchor:B(i,0),head:B(i+1,0)};n.push(o),t.push(e.getRange(o.anchor,o.head))}return{text:t,ranges:n}}function uo(e,t,n,r){e.setAttribute("autocorrect",n?"on":"off"),e.setAttribute("autocapitalize",r?"on":"off"),e.setAttribute("spellcheck",!!t)}function ca(){var e=c("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; min-height: 1em; outline: none"),t=c("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return Y?e.style.width="1000px":e.setAttribute("wrap","off"),w&&(e.style.border="1px solid black"),t}function ju(e){var t=e.optionHandlers,n=e.helpers={};e.prototype={constructor:e,focus:function(){le(this).focus(),this.display.input.focus()},setOption:function(r,i){var o=this.options,l=o[r];o[r]==i&&r!="mode"||(o[r]=i,t.hasOwnProperty(r)&&lt(this,t[r])(this,i,l),Ye(this,"optionChange",this,r))},getOption:function(r){return this.options[r]},getDoc:function(){return this.doc},addKeyMap:function(r,i){this.state.keyMaps[i?"push":"unshift"](fi(r))},removeKeyMap:function(r){for(var i=this.state.keyMaps,o=0;o<i.length;++o)if(i[o]==r||i[o].name==r)return i.splice(o,1),!0},addOverlay:yt(function(r,i){var o=r.token?r:e.getMode(this.options,r);if(o.startState)throw new Error("Overlays may not be stateful.");E(this.state.overlays,{mode:o,modeSpec:r,opaque:i&&i.opaque,priority:i&&i.priority||0},function(l){return l.priority}),this.state.modeGen++,St(this)}),removeOverlay:yt(function(r){for(var i=this.state.overlays,o=0;o<i.length;++o){var l=i[o].modeSpec;if(l==r||typeof r=="string"&&l.name==r){i.splice(o,1),this.state.modeGen++,St(this);return}}}),indentLine:yt(function(r,i,o){typeof i!="string"&&typeof i!="number"&&(i==null?i=this.options.smartIndent?"smart":"prev":i=i?"add":"subtract"),U(this.doc,r)&&zn(this,r,i,o)}),indentSelection:yt(function(r){for(var i=this.doc.sel.ranges,o=-1,l=0;l<i.length;l++){var a=i[l];if(a.empty())a.head.line>o&&(zn(this,a.head.line,r,!0),o=a.head.line,l==this.doc.sel.primIndex&&Gr(this));else{var s=a.from(),u=a.to(),h=Math.max(o,s.line);o=Math.min(this.lastLine(),u.line-(u.ch?0:1))+1;for(var x=h;x<o;++x)zn(this,x,r);var D=this.doc.sel.ranges;s.ch==0&&i.length==D.length&&D[l].from().ch>0&&eo(this.doc,l,new He(s,D[l].to()),$e)}}}),getTokenAt:function(r,i){return ko(this,r,i)},getLineTokens:function(r,i){return ko(this,B(r),i,!0)},getTokenTypeAt:function(r){r=Ae(this.doc,r);var i=xo(this,ye(this.doc,r.line)),o=0,l=(i.length-1)/2,a=r.ch,s;if(a==0)s=i[2];else for(;;){var u=o+l>>1;if((u?i[u*2-1]:0)>=a)l=u;else if(i[u*2+1]<a)o=u+1;else{s=i[u*2+2];break}}var h=s?s.indexOf("overlay "):-1;return h<0?s:h==0?null:s.slice(0,h-1)},getModeAt:function(r){var i=this.doc.mode;return i.innerMode?e.innerMode(i,this.getTokenAt(r).state).mode:i},getHelper:function(r,i){return this.getHelpers(r,i)[0]},getHelpers:function(r,i){var o=[];if(!n.hasOwnProperty(i))return o;var l=n[i],a=this.getModeAt(r);if(typeof a[i]=="string")l[a[i]]&&o.push(l[a[i]]);else if(a[i])for(var s=0;s<a[i].length;s++){var u=l[a[i][s]];u&&o.push(u)}else a.helperType&&l[a.helperType]?o.push(l[a.helperType]):l[a.name]&&o.push(l[a.name]);for(var h=0;h<l._global.length;h++){var x=l._global[h];x.pred(a,this)&&ve(o,x.val)==-1&&o.push(x.val)}return o},getStateAfter:function(r,i){var o=this.doc;return r=go(o,r??o.first+o.size-1),fn(this,r+1,i).state},cursorCoords:function(r,i){var o,l=this.doc.sel.primary();return r==null?o=l.head:typeof r=="object"?o=Ae(this.doc,r):o=r?l.from():l.to(),jt(this,o,i||"page")},charCoords:function(r,i){return Qn(this,Ae(this.doc,r),i||"page")},coordsChar:function(r,i){return r=Jo(this,r,i||"page"),Oi(this,r.left,r.top)},lineAtHeight:function(r,i){return r=Jo(this,{top:r,left:0},i||"page").top,m(this.doc,r+this.display.viewOffset)},heightAtLine:function(r,i,o){var l=!1,a;if(typeof r=="number"){var s=this.doc.first+this.doc.size-1;r<this.doc.first?r=this.doc.first:r>s&&(r=s,l=!0),a=ye(this.doc,r)}else a=r;return Yn(this,a,{top:0,left:0},i||"page",o||l).top+(l?this.doc.height-er(a):0)},defaultTextHeight:function(){return jr(this.display)},defaultCharWidth:function(){return Kr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(r,i,o,l,a){var s=this.display;r=jt(this,Ae(this.doc,r));var u=r.bottom,h=r.left;if(i.style.position="absolute",i.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(i),s.sizer.appendChild(i),l=="over")u=r.top;else if(l=="above"||l=="near"){var x=Math.max(s.wrapper.clientHeight,this.doc.height),D=Math.max(s.sizer.clientWidth,s.lineSpace.clientWidth);(l=="above"||r.bottom+i.offsetHeight>x)&&r.top>i.offsetHeight?u=r.top-i.offsetHeight:r.bottom+i.offsetHeight<=x&&(u=r.bottom),h+i.offsetWidth>D&&(h=D-i.offsetWidth)}i.style.top=u+"px",i.style.left=i.style.right="",a=="right"?(h=s.sizer.clientWidth-i.offsetWidth,i.style.right="0px"):(a=="left"?h=0:a=="middle"&&(h=(s.sizer.clientWidth-i.offsetWidth)/2),i.style.left=h+"px"),o&&Hs(this,{left:h,top:u,right:h+i.offsetWidth,bottom:u+i.offsetHeight})},triggerOnKeyDown:yt(Vl),triggerOnKeyPress:yt(ta),triggerOnKeyUp:ea,triggerOnMouseDown:yt(ra),execCommand:function(r){if(En.hasOwnProperty(r))return En[r].call(null,this)},triggerElectric:yt(function(r){ua(this,r)}),findPosH:function(r,i,o,l){var a=1;i<0&&(a=-1,i=-i);for(var s=Ae(this.doc,r),u=0;u<i&&(s=fo(this.doc,s,a,o,l),!s.hitSide);++u);return s},moveH:yt(function(r,i){var o=this;this.extendSelectionsBy(function(l){return o.display.shift||o.doc.extend||l.empty()?fo(o.doc,l.head,r,i,o.options.rtlMoveVisually):r<0?l.from():l.to()},Pe)}),deleteH:yt(function(r,i){var o=this.doc.sel,l=this.doc;o.somethingSelected()?l.replaceSelection("",null,"+delete"):en(this,function(a){var s=fo(l,a.head,r,i,!1);return r<0?{from:s,to:a.head}:{from:a.head,to:s}})}),findPosV:function(r,i,o,l){var a=1,s=l;i<0&&(a=-1,i=-i);for(var u=Ae(this.doc,r),h=0;h<i;++h){var x=jt(this,u,"div");if(s==null?s=x.left:x.left=s,u=da(this,x,a,o),u.hitSide)break}return u},moveV:yt(function(r,i){var o=this,l=this.doc,a=[],s=!this.display.shift&&!l.extend&&l.sel.somethingSelected();if(l.extendSelectionsBy(function(h){if(s)return r<0?h.from():h.to();var x=jt(o,h.head,"div");h.goalColumn!=null&&(x.left=h.goalColumn),a.push(x.left);var D=da(o,x,r,i);return i=="page"&&h==l.sel.primary()&&ji(o,Qn(o,D,"div").top-x.top),D},Pe),a.length)for(var u=0;u<l.sel.ranges.length;u++)l.sel.ranges[u].goalColumn=a[u]}),findWordAt:function(r){var i=this.doc,o=ye(i,r.line).text,l=r.ch,a=r.ch;if(o){var s=this.getHelper(r,"wordChars");(r.sticky=="before"||a==o.length)&&l?--l:++a;for(var u=o.charAt(l),h=De(u,s)?function(x){return De(x,s)}:/\s/.test(u)?function(x){return/\s/.test(x)}:function(x){return!/\s/.test(x)&&!De(x)};l>0&&h(o.charAt(l-1));)--l;for(;a<o.length&&h(o.charAt(a));)++a}return new He(B(r.line,l),B(r.line,a))},toggleOverwrite:function(r){r!=null&&r==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?j(this.display.cursorDiv,"CodeMirror-overwrite"):V(this.display.cursorDiv,"CodeMirror-overwrite"),Ye(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==y(fe(this))},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:yt(function(r,i){mn(this,r,i)}),getScrollInfo:function(){var r=this.display.scroller;return{left:r.scrollLeft,top:r.scrollTop,height:r.scrollHeight-Yt(this)-this.display.barHeight,width:r.scrollWidth-Yt(this)-this.display.barWidth,clientHeight:Fi(this),clientWidth:wr(this)}},scrollIntoView:yt(function(r,i){r==null?(r={from:this.doc.sel.primary().head,to:null},i==null&&(i=this.options.cursorScrollMargin)):typeof r=="number"?r={from:B(r,0),to:null}:r.from==null&&(r={from:r,to:null}),r.to||(r.to=r.from),r.margin=i||0,r.from.line!=null?_s(this,r):ol(this,r.from,r.to,r.margin)}),setSize:yt(function(r,i){var o=this,l=function(s){return typeof s=="number"||/^\d+$/.test(String(s))?s+"px":s};r!=null&&(this.display.wrapper.style.width=l(r)),i!=null&&(this.display.wrapper.style.height=l(i)),this.options.lineWrapping&&Xo(this);var a=this.display.viewFrom;this.doc.iter(a,this.display.viewTo,function(s){if(s.widgets){for(var u=0;u<s.widgets.length;u++)if(s.widgets[u].noHScroll){dr(o,a,"widget");break}}++a}),this.curOp.forceUpdate=!0,Ye(this,"refresh",this)}),operation:function(r){return At(this,r)},startOperation:function(){return Mr(this)},endOperation:function(){return Fr(this)},refresh:yt(function(){var r=this.display.cachedTextHeight;St(this),this.curOp.forceUpdate=!0,gn(this),mn(this,this.doc.scrollLeft,this.doc.scrollTop),Gi(this.display),(r==null||Math.abs(r-jr(this.display))>.5||this.options.lineWrapping)&&Bi(this),Ye(this,"refresh",this)}),swapDoc:yt(function(r){var i=this.doc;return i.cm=null,this.state.selectingText&&this.state.selectingText(),yl(this,r),gn(this),this.display.input.reset(),mn(this,r.scrollLeft,r.scrollTop),this.curOp.forceScroll=!0,ot(this,"swapDoc",this,i),i}),phrase:function(r){var i=this.options.phrases;return i&&Object.prototype.hasOwnProperty.call(i,r)?i[r]:r},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},Bt(e),e.registerHelper=function(r,i,o){n.hasOwnProperty(r)||(n[r]=e[r]={_global:[]}),n[r][i]=o},e.registerGlobalHelper=function(r,i,o,l){e.registerHelper(r,i,l),n[r]._global.push({pred:o,val:l})}}function fo(e,t,n,r,i){var o=t,l=n,a=ye(e,t.line),s=i&&e.direction=="rtl"?-n:n;function u(){var he=t.line+s;return he<e.first||he>=e.first+e.size?!1:(t=new B(he,t.ch,t.sticky),a=ye(e,he))}function h(he){var se;if(r=="codepoint"){var ge=a.text.charCodeAt(t.ch+(n>0?0:-1));if(isNaN(ge))se=null;else{var Le=n>0?ge>=55296&&ge<56320:ge>=56320&&ge<57343;se=new B(t.line,Math.max(0,Math.min(a.text.length,t.ch+n*(Le?2:1))),-n)}}else i?se=Lu(e.cm,a,t,n):se=ro(a,t,n);if(se==null)if(!he&&u())t=no(i,e.cm,a,t.line,s);else return!1;else t=se;return!0}if(r=="char"||r=="codepoint")h();else if(r=="column")h(!0);else if(r=="word"||r=="group")for(var x=null,D=r=="group",L=e.cm&&e.cm.getHelper(t,"wordChars"),H=!0;!(n<0&&!h(!H));H=!1){var Z=a.text.charAt(t.ch)||`
`,ie=De(Z,L)?"w":D&&Z==`
`?"n":!D||/\s/.test(Z)?null:"p";if(D&&!H&&!ie&&(ie="s"),x&&x!=ie){n<0&&(n=1,h(),t.sticky="after");break}if(ie&&(x=ie),n>0&&!h(!H))break}var ae=ai(e,t,o,l,!0);return We(o,ae)&&(ae.hitSide=!0),ae}function da(e,t,n,r){var i=e.doc,o=t.left,l;if(r=="page"){var a=Math.min(e.display.wrapper.clientHeight,le(e).innerHeight||i(e).documentElement.clientHeight),s=Math.max(a-.5*jr(e.display),3);l=(n>0?t.bottom:t.top)+n*s}else r=="line"&&(l=n>0?t.bottom+3:t.top-3);for(var u;u=Oi(e,o,l),!!u.outside;){if(n<0?l<=0:l>=i.height){u.hitSide=!0;break}l+=n*5}return u}var je=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new Ce,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};je.prototype.init=function(e){var t=this,n=this,r=n.cm,i=n.div=e.lineDiv;i.contentEditable=!0,uo(i,r.options.spellcheck,r.options.autocorrect,r.options.autocapitalize);function o(a){for(var s=a.target;s;s=s.parentNode){if(s==i)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(s.className))break}return!1}Se(i,"paste",function(a){!o(a)||Qe(r,a)||sa(a,r)||I<=11&&setTimeout(lt(r,function(){return t.updateFromDOM()}),20)}),Se(i,"compositionstart",function(a){t.composing={data:a.data,done:!1}}),Se(i,"compositionupdate",function(a){t.composing||(t.composing={data:a.data,done:!1})}),Se(i,"compositionend",function(a){t.composing&&(a.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),Se(i,"touchstart",function(){return n.forceCompositionEnd()}),Se(i,"input",function(){t.composing||t.readFromDOMSoon()});function l(a){if(!(!o(a)||Qe(r,a))){if(r.somethingSelected())hi({lineWise:!1,text:r.getSelections()}),a.type=="cut"&&r.replaceSelection("",null,"cut");else if(r.options.lineWiseCopyCut){var s=fa(r);hi({lineWise:!0,text:s.text}),a.type=="cut"&&r.operation(function(){r.setSelections(s.ranges,0,$e),r.replaceSelection("",null,"cut")})}else return;if(a.clipboardData){a.clipboardData.clearData();var u=Ut.text.join(`
`);if(a.clipboardData.setData("Text",u),a.clipboardData.getData("Text")==u){a.preventDefault();return}}var h=ca(),x=h.firstChild;uo(x),r.display.lineSpace.insertBefore(h,r.display.lineSpace.firstChild),x.value=Ut.text.join(`
`);var D=y(Te(i));v(x),setTimeout(function(){r.display.lineSpace.removeChild(h),D.focus(),D==i&&n.showPrimarySelection()},50)}}Se(i,"copy",l),Se(i,"cut",l)},je.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},je.prototype.prepareSelection=function(){var e=rl(this.cm,!1);return e.focus=y(Te(this.div))==this.div,e},je.prototype.showSelection=function(e,t){!e||!this.cm.display.view.length||((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},je.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},je.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,n=t.doc.sel.primary(),r=n.from(),i=n.to();if(t.display.viewTo==t.display.viewFrom||r.line>=t.display.viewTo||i.line<t.display.viewFrom){e.removeAllRanges();return}var o=pi(t,e.anchorNode,e.anchorOffset),l=pi(t,e.focusNode,e.focusOffset);if(!(o&&!o.bad&&l&&!l.bad&&ce(Wr(o,l),r)==0&&ce(wt(o,l),i)==0)){var a=t.display.view,s=r.line>=t.display.viewFrom&&ha(t,r)||{node:a[0].measure.map[2],offset:0},u=i.line<t.display.viewTo&&ha(t,i);if(!u){var h=a[a.length-1].measure,x=h.maps?h.maps[h.maps.length-1]:h.map;u={node:x[x.length-1],offset:x[x.length-2]-x[x.length-3]}}if(!s||!u){e.removeAllRanges();return}var D=e.rangeCount&&e.getRangeAt(0),L;try{L=C(s.node,s.offset,u.offset,u.node)}catch{}L&&(!_&&t.state.focused?(e.collapse(s.node,s.offset),L.collapsed||(e.removeAllRanges(),e.addRange(L))):(e.removeAllRanges(),e.addRange(L)),D&&e.anchorNode==null?e.addRange(D):_&&this.startGracePeriod()),this.rememberSelection()}},je.prototype.startGracePeriod=function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation(function(){return e.cm.curOp.selectionChanged=!0})},20)},je.prototype.showMultipleSelections=function(e){G(this.cm.display.cursorDiv,e.cursors),G(this.cm.display.selectionDiv,e.selection)},je.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},je.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return g(this.div,t)},je.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||y(Te(this.div))!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},je.prototype.blur=function(){this.div.blur()},je.prototype.getField=function(){return this.div},je.prototype.supportsTouch=function(){return!0},je.prototype.receivedFocus=function(){var e=this,t=this;this.selectionInEditor()?setTimeout(function(){return e.pollSelection()},20):At(this.cm,function(){return t.cm.curOp.selectionChanged=!0});function n(){t.cm.state.focused&&(t.pollSelection(),t.polling.set(t.cm.options.pollInterval,n))}this.polling.set(this.cm.options.pollInterval,n)},je.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},je.prototype.pollSelection=function(){if(!(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())){var e=this.getSelection(),t=this.cm;if(M&&S&&this.cm.display.gutterSpecs.length&&Ku(e.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(!this.composing){this.rememberSelection();var n=pi(t,e.anchorNode,e.anchorOffset),r=pi(t,e.focusNode,e.focusOffset);n&&r&&At(t,function(){gt(t.doc,pr(n,r),$e),(n.bad||r.bad)&&(t.curOp.selectionChanged=!0)})}}},je.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,n=e.doc.sel.primary(),r=n.from(),i=n.to();if(r.ch==0&&r.line>e.firstLine()&&(r=B(r.line-1,ye(e.doc,r.line-1).length)),i.ch==ye(e.doc,i.line).text.length&&i.line<e.lastLine()&&(i=B(i.line+1,0)),r.line<t.viewFrom||i.line>t.viewTo-1)return!1;var o,l,a;r.line==t.viewFrom||(o=Tr(e,r.line))==0?(l=f(t.view[0].line),a=t.view[0].node):(l=f(t.view[o].line),a=t.view[o-1].node.nextSibling);var s=Tr(e,i.line),u,h;if(s==t.view.length-1?(u=t.viewTo-1,h=t.lineDiv.lastChild):(u=f(t.view[s+1].line)-1,h=t.view[s+1].node.previousSibling),!a)return!1;for(var x=e.doc.splitLines(Uu(e,a,h,l,u)),D=$t(e.doc,B(l,0),B(u,ye(e.doc,u).text.length));x.length>1&&D.length>1;)if(we(x)==we(D))x.pop(),D.pop(),u--;else if(x[0]==D[0])x.shift(),D.shift(),l++;else break;for(var L=0,H=0,Z=x[0],ie=D[0],ae=Math.min(Z.length,ie.length);L<ae&&Z.charCodeAt(L)==ie.charCodeAt(L);)++L;for(var he=we(x),se=we(D),ge=Math.min(he.length-(x.length==1?L:0),se.length-(D.length==1?L:0));H<ge&&he.charCodeAt(he.length-H-1)==se.charCodeAt(se.length-H-1);)++H;if(x.length==1&&D.length==1&&l==r.line)for(;L&&L>r.ch&&he.charCodeAt(he.length-H-1)==se.charCodeAt(se.length-H-1);)L--,H++;x[x.length-1]=he.slice(0,he.length-H).replace(/^\u200b+/,""),x[0]=x[0].slice(L).replace(/\u200b+$/,"");var Le=B(l,L),ke=B(u,D.length?we(D).length-H:0);if(x.length>1||x[0]||ce(Le,ke))return Zr(e.doc,x,Le,ke,"+input"),!0},je.prototype.ensurePolled=function(){this.forceCompositionEnd()},je.prototype.reset=function(){this.forceCompositionEnd()},je.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},je.prototype.readFromDOMSoon=function(){var e=this;this.readDOMTimeout==null&&(this.readDOMTimeout=setTimeout(function(){if(e.readDOMTimeout=null,e.composing)if(e.composing.done)e.composing=null;else return;e.updateFromDOM()},80))},je.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&At(this.cm,function(){return St(e.cm)})},je.prototype.setUneditable=function(e){e.contentEditable="false"},je.prototype.onKeyPress=function(e){e.charCode==0||this.composing||(e.preventDefault(),this.cm.isReadOnly()||lt(this.cm,so)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0))},je.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},je.prototype.onContextMenu=function(){},je.prototype.resetPosition=function(){},je.prototype.needsContentAttribute=!0;function ha(e,t){var n=Ai(e,t.line);if(!n||n.hidden)return null;var r=ye(e.doc,t.line),i=qo(n,r,t.line),o=Re(r,e.doc.direction),l="left";if(o){var a=lr(o,t.ch);l=a%2?"right":"left"}var s=Uo(i.map,t.ch,l);return s.offset=s.collapse=="right"?s.end:s.start,s}function Ku(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function rn(e,t){return t&&(e.bad=!0),e}function Uu(e,t,n,r,i){var o="",l=!1,a=e.doc.lineSeparator(),s=!1;function u(L){return function(H){return H.id==L}}function h(){l&&(o+=a,s&&(o+=a),l=s=!1)}function x(L){L&&(h(),o+=L)}function D(L){if(L.nodeType==1){var H=L.getAttribute("cm-text");if(H){x(H);return}var Z=L.getAttribute("cm-marker"),ie;if(Z){var ae=e.findMarks(B(r,0),B(i+1,0),u(+Z));ae.length&&(ie=ae[0].find(0))&&x($t(e.doc,ie.from,ie.to).join(a));return}if(L.getAttribute("contenteditable")=="false")return;var he=/^(pre|div|p|li|table|br)$/i.test(L.nodeName);if(!/^br$/i.test(L.nodeName)&&L.textContent.length==0)return;he&&h();for(var se=0;se<L.childNodes.length;se++)D(L.childNodes[se]);/^(pre|p)$/i.test(L.nodeName)&&(s=!0),he&&(l=!0)}else L.nodeType==3&&x(L.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;D(t),t!=n;)t=t.nextSibling,s=!1;return o}function pi(e,t,n){var r;if(t==e.display.lineDiv){if(r=e.display.lineDiv.childNodes[n],!r)return rn(e.clipPos(B(e.display.viewTo-1)),!0);t=null,n=0}else for(r=t;;r=r.parentNode){if(!r||r==e.display.lineDiv)return null;if(r.parentNode&&r.parentNode==e.display.lineDiv)break}for(var i=0;i<e.display.view.length;i++){var o=e.display.view[i];if(o.node==r)return Gu(o,t,n)}}function Gu(e,t,n){var r=e.text.firstChild,i=!1;if(!t||!g(r,t))return rn(B(f(e.line),0),!0);if(t==r&&(i=!0,t=r.childNodes[n],n=0,!t)){var o=e.rest?we(e.rest):e.line;return rn(B(f(o),o.text.length),i)}var l=t.nodeType==3?t:null,a=t;for(!l&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(l=t.firstChild,n&&(n=l.nodeValue.length));a.parentNode!=r;)a=a.parentNode;var s=e.measure,u=s.maps;function h(ie,ae,he){for(var se=-1;se<(u?u.length:0);se++)for(var ge=se<0?s.map:u[se],Le=0;Le<ge.length;Le+=3){var ke=ge[Le+2];if(ke==ie||ke==ae){var Ee=f(se<0?e.line:e.rest[se]),Ke=ge[Le]+he;return(he<0||ke!=ie)&&(Ke=ge[Le+(he?1:0)]),B(Ee,Ke)}}}var x=h(l,a,n);if(x)return rn(x,i);for(var D=a.nextSibling,L=l?l.nodeValue.length-n:0;D;D=D.nextSibling){if(x=h(D,D.firstChild,0),x)return rn(B(x.line,x.ch-L),i);L+=D.textContent.length}for(var H=a.previousSibling,Z=n;H;H=H.previousSibling){if(x=h(H,H.firstChild,-1),x)return rn(B(x.line,x.ch+Z),i);Z+=H.textContent.length}}var Ve=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new Ce,this.hasSelection=!1,this.composing=null,this.resetting=!1};Ve.prototype.init=function(e){var t=this,n=this,r=this.cm;this.createField(e);var i=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),w&&(i.style.width="0px"),Se(i,"input",function(){k&&I>=9&&t.hasSelection&&(t.hasSelection=null),n.poll()}),Se(i,"paste",function(l){Qe(r,l)||sa(l,r)||(r.state.pasteIncoming=+new Date,n.fastPoll())});function o(l){if(!Qe(r,l)){if(r.somethingSelected())hi({lineWise:!1,text:r.getSelections()});else if(r.options.lineWiseCopyCut){var a=fa(r);hi({lineWise:!0,text:a.text}),l.type=="cut"?r.setSelections(a.ranges,null,$e):(n.prevInput="",i.value=a.text.join(`
`),v(i))}else return;l.type=="cut"&&(r.state.cutIncoming=+new Date)}}Se(i,"cut",o),Se(i,"copy",o),Se(e.scroller,"paste",function(l){if(!(tr(e,l)||Qe(r,l))){if(!i.dispatchEvent){r.state.pasteIncoming=+new Date,n.focus();return}var a=new Event("paste");a.clipboardData=l.clipboardData,i.dispatchEvent(a)}}),Se(e.lineSpace,"selectstart",function(l){tr(e,l)||pt(l)}),Se(i,"compositionstart",function(){var l=r.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:l,range:r.markText(l,r.getCursor("to"),{className:"CodeMirror-composing"})}}),Se(i,"compositionend",function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)})},Ve.prototype.createField=function(e){this.wrapper=ca(),this.textarea=this.wrapper.firstChild;var t=this.cm.options;uo(this.textarea,t.spellcheck,t.autocorrect,t.autocapitalize)},Ve.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},Ve.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,r=rl(e);if(e.options.moveInputWithCursor){var i=jt(e,n.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),l=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+l.top-o.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+l.left-o.left))}return r},Ve.prototype.showSelection=function(e){var t=this.cm,n=t.display;G(n.cursorDiv,e.cursors),G(n.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Ve.prototype.reset=function(e){if(!(this.contextMenuPending||this.composing&&e)){var t=this.cm;if(this.resetting=!0,t.somethingSelected()){this.prevInput="";var n=t.getSelection();this.textarea.value=n,t.state.focused&&v(this.textarea),k&&I>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",k&&I>=9&&(this.hasSelection=null));this.resetting=!1}},Ve.prototype.getField=function(){return this.textarea},Ve.prototype.supportsTouch=function(){return!1},Ve.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!N||y(Te(this.textarea))!=this.textarea))try{this.textarea.focus()}catch{}},Ve.prototype.blur=function(){this.textarea.blur()},Ve.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Ve.prototype.receivedFocus=function(){this.slowPoll()},Ve.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},Ve.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function n(){var r=t.poll();!r&&!e?(e=!0,t.polling.set(60,n)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,n)},Ve.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||this.resetting||!t.state.focused||ur(n)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=n.value;if(i==r&&!t.somethingSelected())return!1;if(k&&I>=9&&this.hasSelection===i||z&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var o=i.charCodeAt(0);if(o==8203&&!r&&(r="â€‹"),o==8666)return this.reset(),this.cm.execCommand("undo")}for(var l=0,a=Math.min(r.length,i.length);l<a&&r.charCodeAt(l)==i.charCodeAt(l);)++l;return At(t,function(){so(t,i.slice(l),r.length-l,null,e.composing?"*compose":null),i.length>1e3||i.indexOf(`
`)>-1?n.value=e.prevInput="":e.prevInput=i,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Ve.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Ve.prototype.onKeyPress=function(){k&&I>=9&&(this.hasSelection=null),this.fastPoll()},Ve.prototype.onContextMenu=function(e){var t=this,n=t.cm,r=n.display,i=t.textarea;t.contextMenuPending&&t.contextMenuPending();var o=Lr(n,e),l=r.scroller.scrollTop;if(!o||A)return;var a=n.options.resetSelectionOnContextMenu;a&&n.doc.sel.contains(o)==-1&&lt(n,gt)(n.doc,pr(o),$e);var s=i.style.cssText,u=t.wrapper.style.cssText,h=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",i.style.cssText=`position: absolute; width: 30px; height: 30px;
      top: `+(e.clientY-h.top-5)+"px; left: "+(e.clientX-h.left-5)+`px;
      z-index: 1000; background: `+(k?"rgba(255, 255, 255, .05)":"transparent")+`;
      outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var x;Y&&(x=i.ownerDocument.defaultView.scrollY),r.input.focus(),Y&&i.ownerDocument.defaultView.scrollTo(null,x),r.input.reset(),n.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=L,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll);function D(){if(i.selectionStart!=null){var Z=n.somethingSelected(),ie="â€‹"+(Z?i.value:"");i.value="â‡š",i.value=ie,t.prevInput=Z?"":"â€‹",i.selectionStart=1,i.selectionEnd=ie.length,r.selForContextMenu=n.doc.sel}}function L(){if(t.contextMenuPending==L&&(t.contextMenuPending=!1,t.wrapper.style.cssText=u,i.style.cssText=s,k&&I<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=l),i.selectionStart!=null)){(!k||k&&I<9)&&D();var Z=0,ie=function(){r.selForContextMenu==n.doc.sel&&i.selectionStart==0&&i.selectionEnd>0&&t.prevInput=="â€‹"?lt(n,El)(n):Z++<10?r.detectingSelectAll=setTimeout(ie,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(ie,200)}}if(k&&I>=9&&D(),J){ar(e);var H=function(){ht(window,"mouseup",H),setTimeout(L,20)};Se(window,"mouseup",H)}else setTimeout(L,50)},Ve.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},Ve.prototype.setUneditable=function(){},Ve.prototype.needsContentAttribute=!1;function Xu(e,t){if(t=t?Me(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),t.autofocus==null){var n=y(Te(e));t.autofocus=n==e||e.getAttribute("autofocus")!=null&&n==document.body}function r(){e.value=a.getValue()}var i;if(e.form&&(Se(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var o=e.form;i=o.submit;try{var l=o.submit=function(){r(),o.submit=i,o.submit(),o.submit=l}}catch{}}t.finishInit=function(s){s.save=r,s.getTextArea=function(){return e},s.toTextArea=function(){s.toTextArea=isNaN,r(),e.parentNode.removeChild(s.getWrapperElement()),e.style.display="",e.form&&(ht(e.form,"submit",r),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=i))}},e.style.display="none";var a=Ge(function(s){return e.parentNode.insertBefore(s,e.nextSibling)},t);return a}function Yu(e){e.off=ht,e.on=Se,e.wheelEventPixels=tu,e.Doc=Lt,e.splitLines=zt,e.countColumn=Fe,e.findColumn=_e,e.isWordChar=me,e.Pass=qe,e.signal=Ye,e.Line=Hr,e.changeEnd=gr,e.scrollbarModel=sl,e.Pos=B,e.cmpPos=ce,e.modes=Pr,e.mimeModes=Ht,e.resolveMode=Ir,e.getMode=zr,e.modeExtensions=fr,e.extendMode=Br,e.copyState=Gt,e.startState=Rr,e.innerMode=sn,e.commands=En,e.keyMap=nr,e.keyName=Yl,e.isModifierKey=Gl,e.lookupKey=Vr,e.normalizeKeyMap=Su,e.StringStream=Je,e.SharedTextMarker=Fn,e.TextMarker=mr,e.LineWidget=Mn,e.e_preventDefault=pt,e.e_stopPropagation=Er,e.e_stop=ar,e.addClass=j,e.contains=g,e.rmClass=V,e.keyNames=xr}Wu(Ge),ju(Ge);var Qu="iter insert remove copy getEditor constructor".split(" ");for(var gi in Lt.prototype)Lt.prototype.hasOwnProperty(gi)&&ve(Qu,gi)<0&&(Ge.prototype[gi]=(function(e){return function(){return e.apply(this.doc,arguments)}})(Lt.prototype[gi]));return Bt(Lt),Ge.inputStyles={textarea:Ve,contenteditable:je},Ge.defineMode=function(e){!Ge.defaults.mode&&e!="null"&&(Ge.defaults.mode=e),_t.apply(this,arguments)},Ge.defineMIME=kr,Ge.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Ge.defineMIME("text/plain","null"),Ge.defineExtension=function(e,t){Ge.prototype[e]=t},Ge.defineDocExtension=function(e,t){Lt.prototype[e]=t},Ge.fromTextArea=Xu,Yu(Ge),Ge.version="5.65.18",Ge}))})(vi)),vi.exports}var $u=mt();const df=Ju($u);var ga={exports:{}},va;function Xa(){return va||(va=1,(function(ct,xt){(function(b){b(mt())})(function(b){b.defineMode("css",function(J,P){var V=P.inline;P.propertyKeywords||(P=b.resolveMode("text/css"));var F=J.indentUnit,G=P.tokenHooks,c=P.documentTypes||{},T=P.mediaTypes||{},C=P.mediaFeatures||{},g=P.mediaValueKeywords||{},y=P.propertyKeywords||{},j=P.nonStandardPropertyKeywords||{},de=P.fontProperties||{},v=P.counterDescriptors||{},d=P.colorKeywords||{},fe=P.valueKeywords||{},Te=P.allowNested,le=P.lineComment,xe=P.supportsAtComponent===!0,Me=J.highlightNonStandardPropertyKeywords!==!1,Fe,Ce;function ve(E,ee){return Fe=ee,E}function Oe(E,ee){var K=E.next();if(G[K]){var ze=G[K](E,ee);if(ze!==!1)return ze}if(K=="@")return E.eatWhile(/[\w\\\-]/),ve("def",E.current());if(K=="="||(K=="~"||K=="|")&&E.eat("="))return ve(null,"compare");if(K=='"'||K=="'")return ee.tokenize=qe(K),ee.tokenize(E,ee);if(K=="#")return E.eatWhile(/[\w\\\-]/),ve("atom","hash");if(K=="!")return E.match(/^\s*\w*/),ve("keyword","important");if(/\d/.test(K)||K=="."&&E.eat(/\d/))return E.eatWhile(/[\w.%]/),ve("number","unit");if(K==="-"){if(/[\d.]/.test(E.peek()))return E.eatWhile(/[\w.%]/),ve("number","unit");if(E.match(/^-[\w\\\-]*/))return E.eatWhile(/[\w\\\-]/),E.match(/^\s*:/,!1)?ve("variable-2","variable-definition"):ve("variable-2","variable");if(E.match(/^\w+-/))return ve("meta","meta")}else return/[,+>*\/]/.test(K)?ve(null,"select-op"):K=="."&&E.match(/^-?[_a-z][_a-z0-9-]*/i)?ve("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(K)?ve(null,K):E.match(/^[\w-.]+(?=\()/)?(/^(url(-prefix)?|domain|regexp)$/i.test(E.current())&&(ee.tokenize=$e),ve("variable callee","variable")):/[\w\\\-]/.test(K)?(E.eatWhile(/[\w\\\-]/),ve("property","word")):ve(null,null)}function qe(E){return function(ee,K){for(var ze=!1,me;(me=ee.next())!=null;){if(me==E&&!ze){E==")"&&ee.backUp(1);break}ze=!ze&&me=="\\"}return(me==E||!ze&&E!=")")&&(K.tokenize=null),ve("string","string")}}function $e(E,ee){return E.next(),E.match(/^\s*[\"\')]/,!1)?ee.tokenize=null:ee.tokenize=qe(")"),ve(null,"(")}function dt(E,ee,K){this.type=E,this.indent=ee,this.prev=K}function Pe(E,ee,K,ze){return E.context=new dt(K,ee.indentation()+(ze===!1?0:F),E.context),K}function _e(E){return E.context.prev&&(E.context=E.context.prev),E.context.type}function Ue(E,ee,K){return Ie[K.context.type](E,ee,K)}function et(E,ee,K,ze){for(var me=ze||1;me>0;me--)K.context=K.context.prev;return Ue(E,ee,K)}function we(E){var ee=E.current().toLowerCase();fe.hasOwnProperty(ee)?Ce="atom":d.hasOwnProperty(ee)?Ce="keyword":Ce="variable"}var Ie={};return Ie.top=function(E,ee,K){if(E=="{")return Pe(K,ee,"block");if(E=="}"&&K.context.prev)return _e(K);if(xe&&/@component/i.test(E))return Pe(K,ee,"atComponentBlock");if(/^@(-moz-)?document$/i.test(E))return Pe(K,ee,"documentTypes");if(/^@(media|supports|(-moz-)?document|import)$/i.test(E))return Pe(K,ee,"atBlock");if(/^@(font-face|counter-style)/i.test(E))return K.stateArg=E,"restricted_atBlock_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/i.test(E))return"keyframes";if(E&&E.charAt(0)=="@")return Pe(K,ee,"at");if(E=="hash")Ce="builtin";else if(E=="word")Ce="tag";else{if(E=="variable-definition")return"maybeprop";if(E=="interpolation")return Pe(K,ee,"interpolation");if(E==":")return"pseudo";if(Te&&E=="(")return Pe(K,ee,"parens")}return K.context.type},Ie.block=function(E,ee,K){if(E=="word"){var ze=ee.current().toLowerCase();return y.hasOwnProperty(ze)?(Ce="property","maybeprop"):j.hasOwnProperty(ze)?(Ce=Me?"string-2":"property","maybeprop"):Te?(Ce=ee.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block"):(Ce+=" error","maybeprop")}else return E=="meta"?"block":!Te&&(E=="hash"||E=="qualifier")?(Ce="error","block"):Ie.top(E,ee,K)},Ie.maybeprop=function(E,ee,K){return E==":"?Pe(K,ee,"prop"):Ue(E,ee,K)},Ie.prop=function(E,ee,K){if(E==";")return _e(K);if(E=="{"&&Te)return Pe(K,ee,"propBlock");if(E=="}"||E=="{")return et(E,ee,K);if(E=="(")return Pe(K,ee,"parens");if(E=="hash"&&!/^#([0-9a-fA-F]{3,4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(ee.current()))Ce+=" error";else if(E=="word")we(ee);else if(E=="interpolation")return Pe(K,ee,"interpolation");return"prop"},Ie.propBlock=function(E,ee,K){return E=="}"?_e(K):E=="word"?(Ce="property","maybeprop"):K.context.type},Ie.parens=function(E,ee,K){return E=="{"||E=="}"?et(E,ee,K):E==")"?_e(K):E=="("?Pe(K,ee,"parens"):E=="interpolation"?Pe(K,ee,"interpolation"):(E=="word"&&we(ee),"parens")},Ie.pseudo=function(E,ee,K){return E=="meta"?"pseudo":E=="word"?(Ce="variable-3",K.context.type):Ue(E,ee,K)},Ie.documentTypes=function(E,ee,K){return E=="word"&&c.hasOwnProperty(ee.current())?(Ce="tag",K.context.type):Ie.atBlock(E,ee,K)},Ie.atBlock=function(E,ee,K){if(E=="(")return Pe(K,ee,"atBlock_parens");if(E=="}"||E==";")return et(E,ee,K);if(E=="{")return _e(K)&&Pe(K,ee,Te?"block":"top");if(E=="interpolation")return Pe(K,ee,"interpolation");if(E=="word"){var ze=ee.current().toLowerCase();ze=="only"||ze=="not"||ze=="and"||ze=="or"?Ce="keyword":T.hasOwnProperty(ze)?Ce="attribute":C.hasOwnProperty(ze)?Ce="property":g.hasOwnProperty(ze)?Ce="keyword":y.hasOwnProperty(ze)?Ce="property":j.hasOwnProperty(ze)?Ce=Me?"string-2":"property":fe.hasOwnProperty(ze)?Ce="atom":d.hasOwnProperty(ze)?Ce="keyword":Ce="error"}return K.context.type},Ie.atComponentBlock=function(E,ee,K){return E=="}"?et(E,ee,K):E=="{"?_e(K)&&Pe(K,ee,Te?"block":"top",!1):(E=="word"&&(Ce="error"),K.context.type)},Ie.atBlock_parens=function(E,ee,K){return E==")"?_e(K):E=="{"||E=="}"?et(E,ee,K,2):Ie.atBlock(E,ee,K)},Ie.restricted_atBlock_before=function(E,ee,K){return E=="{"?Pe(K,ee,"restricted_atBlock"):E=="word"&&K.stateArg=="@counter-style"?(Ce="variable","restricted_atBlock_before"):Ue(E,ee,K)},Ie.restricted_atBlock=function(E,ee,K){return E=="}"?(K.stateArg=null,_e(K)):E=="word"?(K.stateArg=="@font-face"&&!de.hasOwnProperty(ee.current().toLowerCase())||K.stateArg=="@counter-style"&&!v.hasOwnProperty(ee.current().toLowerCase())?Ce="error":Ce="property","maybeprop"):"restricted_atBlock"},Ie.keyframes=function(E,ee,K){return E=="word"?(Ce="variable","keyframes"):E=="{"?Pe(K,ee,"top"):Ue(E,ee,K)},Ie.at=function(E,ee,K){return E==";"?_e(K):E=="{"||E=="}"?et(E,ee,K):(E=="word"?Ce="tag":E=="hash"&&(Ce="builtin"),"at")},Ie.interpolation=function(E,ee,K){return E=="}"?_e(K):E=="{"||E==";"?et(E,ee,K):(E=="word"?Ce="variable":E!="variable"&&E!="("&&E!=")"&&(Ce="error"),"interpolation")},{startState:function(E){return{tokenize:null,state:V?"block":"top",stateArg:null,context:new dt(V?"block":"top",E||0,null)}},token:function(E,ee){if(!ee.tokenize&&E.eatSpace())return null;var K=(ee.tokenize||Oe)(E,ee);return K&&typeof K=="object"&&(Fe=K[1],K=K[0]),Ce=K,Fe!="comment"&&(ee.state=Ie[ee.state](Fe,E,ee)),Ce},indent:function(E,ee){var K=E.context,ze=ee&&ee.charAt(0),me=K.indent;return K.type=="prop"&&(ze=="}"||ze==")")&&(K=K.prev),K.prev&&(ze=="}"&&(K.type=="block"||K.type=="top"||K.type=="interpolation"||K.type=="restricted_atBlock")?(K=K.prev,me=K.indent):(ze==")"&&(K.type=="parens"||K.type=="atBlock_parens")||ze=="{"&&(K.type=="at"||K.type=="atBlock"))&&(me=Math.max(0,K.indent-F))),me},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:le,fold:"brace"}});function pe(J){for(var P={},V=0;V<J.length;++V)P[J[V].toLowerCase()]=!0;return P}var _=["domain","regexp","url","url-prefix"],te=pe(_),oe=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],Q=pe(oe),k=["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid","orientation","device-pixel-ratio","min-device-pixel-ratio","max-device-pixel-ratio","pointer","any-pointer","hover","any-hover","prefers-color-scheme","dynamic-range","video-dynamic-range"],I=pe(k),Y=["landscape","portrait","none","coarse","fine","on-demand","hover","interlace","progressive","dark","light","standard","high"],ne=pe(Y),S=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","all","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","binding","bleed","block-size","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-content","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-gap","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-gap","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","inset","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","left","letter-spacing","line-break","line-height","line-height-step","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","place-content","place-items","place-self","play-during","position","presentation-level","punctuation-trim","quotes","region-break-after","region-break-before","region-break-inside","region-fragment","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotate","rotation","rotation-point","row-gap","ruby-align","ruby-overhang","ruby-position","ruby-span","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-type","shape-image-threshold","shape-inside","shape-margin","shape-outside","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-orientation","text-outline","text-overflow","text-rendering","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","touch-action","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-select","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index","clip-path","clip-rule","mask","enable-background","filter","flood-color","flood-opacity","lighting-color","stop-color","stop-opacity","pointer-events","color-interpolation","color-interpolation-filters","color-rendering","fill","fill-opacity","fill-rule","image-rendering","marker","marker-end","marker-mid","marker-start","paint-order","shape-rendering","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-rendering","baseline-shift","dominant-baseline","glyph-orientation-horizontal","glyph-orientation-vertical","text-anchor","writing-mode"],R=pe(S),A=["accent-color","aspect-ratio","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","content-visibility","margin-block","margin-block-end","margin-block-start","margin-inline","margin-inline-end","margin-inline-start","overflow-anchor","overscroll-behavior","padding-block","padding-block-end","padding-block-start","padding-inline","padding-inline-end","padding-inline-start","scroll-snap-stop","scrollbar-3d-light-color","scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-track-color","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","shape-inside","zoom"],$=pe(A),ue=["font-display","font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"],O=pe(ue),w=["additive-symbols","fallback","negative","pad","prefix","range","speak-as","suffix","symbols","system"],M=pe(w),N=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkgrey","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightgrey","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],z=pe(N),X=["above","absolute","activeborder","additive","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","blur","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","brightness","bullets","button","buttonface","buttonhighlight","buttonshadow","buttontext","calc","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","conic-gradient","contain","content","contents","content-box","context-menu","continuous","contrast","copy","counter","counters","cover","crop","cross","crosshair","cubic-bezier","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","devanagari","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","drop-shadow","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ethiopic-numeric","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","georgian","grayscale","graytext","grid","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hard-light","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","hue","hue-rotate","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","japanese-formal","japanese-informal","justify","kannada","katakana","katakana-iroha","keep-all","khmer","korean-hangul-formal","korean-hanja-formal","korean-hanja-informal","landscape","lao","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","luminosity","malayalam","manipulation","match","matrix","matrix3d","media-play-button","media-slider","media-sliderthumb","media-volume-slider","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","multiple_mask_images","multiply","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","octal","opacity","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeating-conic-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturate","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","self-start","self-end","semi-condensed","semi-expanded","separate","sepia","serif","show","sidama","simp-chinese-formal","simp-chinese-informal","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","somali","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","square-button","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","tamil","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","trad-chinese-formal","trad-chinese-informal","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"],q=pe(X),p=_.concat(oe).concat(k).concat(Y).concat(S).concat(A).concat(N).concat(X);b.registerHelper("hintWords","css",p);function W(J,P){for(var V=!1,F;(F=J.next())!=null;){if(V&&F=="/"){P.tokenize=null;break}V=F=="*"}return["comment","comment"]}b.defineMIME("text/css",{documentTypes:te,mediaTypes:Q,mediaFeatures:I,mediaValueKeywords:ne,propertyKeywords:R,nonStandardPropertyKeywords:$,fontProperties:O,counterDescriptors:M,colorKeywords:z,valueKeywords:q,tokenHooks:{"/":function(J,P){return J.eat("*")?(P.tokenize=W,W(J,P)):!1}},name:"css"}),b.defineMIME("text/x-scss",{mediaTypes:Q,mediaFeatures:I,mediaValueKeywords:ne,propertyKeywords:R,nonStandardPropertyKeywords:$,colorKeywords:z,valueKeywords:q,fontProperties:O,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(J,P){return J.eat("/")?(J.skipToEnd(),["comment","comment"]):J.eat("*")?(P.tokenize=W,W(J,P)):["operator","operator"]},":":function(J){return J.match(/^\s*\{/,!1)?[null,null]:!1},$:function(J){return J.match(/^[\w-]+/),J.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"]},"#":function(J){return J.eat("{")?[null,"interpolation"]:!1}},name:"css",helperType:"scss"}),b.defineMIME("text/x-less",{mediaTypes:Q,mediaFeatures:I,mediaValueKeywords:ne,propertyKeywords:R,nonStandardPropertyKeywords:$,colorKeywords:z,valueKeywords:q,fontProperties:O,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(J,P){return J.eat("/")?(J.skipToEnd(),["comment","comment"]):J.eat("*")?(P.tokenize=W,W(J,P)):["operator","operator"]},"@":function(J){return J.eat("{")?[null,"interpolation"]:J.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/i,!1)?!1:(J.eatWhile(/[\w\\\-]/),J.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"])},"&":function(){return["atom","atom"]}},name:"css",helperType:"less"}),b.defineMIME("text/x-gss",{documentTypes:te,mediaTypes:Q,mediaFeatures:I,propertyKeywords:R,nonStandardPropertyKeywords:$,fontProperties:O,counterDescriptors:M,colorKeywords:z,valueKeywords:q,supportsAtComponent:!0,tokenHooks:{"/":function(J,P){return J.eat("*")?(P.tokenize=W,W(J,P)):!1}},name:"css",helperType:"gss"})})})()),ga.exports}Xa();var ma={exports:{}},xa={exports:{}},ya;function Ya(){return ya||(ya=1,(function(ct,xt){(function(b){b(mt())})(function(b){var pe={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},_={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};b.defineMode("xml",function(te,oe){var Q=te.indentUnit,k={},I=oe.htmlMode?pe:_;for(var Y in I)k[Y]=I[Y];for(var Y in oe)k[Y]=oe[Y];var ne,S;function R(c,T){function C(j){return T.tokenize=j,j(c,T)}var g=c.next();if(g=="<")return c.eat("!")?c.eat("[")?c.match("CDATA[")?C(ue("atom","]]>")):null:c.match("--")?C(ue("comment","-->")):c.match("DOCTYPE",!0,!0)?(c.eatWhile(/[\w\._\-]/),C(O(1))):null:c.eat("?")?(c.eatWhile(/[\w\._\-]/),T.tokenize=ue("meta","?>"),"meta"):(ne=c.eat("/")?"closeTag":"openTag",T.tokenize=A,"tag bracket");if(g=="&"){var y;return c.eat("#")?c.eat("x")?y=c.eatWhile(/[a-fA-F\d]/)&&c.eat(";"):y=c.eatWhile(/[\d]/)&&c.eat(";"):y=c.eatWhile(/[\w\.\-:]/)&&c.eat(";"),y?"atom":"error"}else return c.eatWhile(/[^&<]/),null}R.isInText=!0;function A(c,T){var C=c.next();if(C==">"||C=="/"&&c.eat(">"))return T.tokenize=R,ne=C==">"?"endTag":"selfcloseTag","tag bracket";if(C=="=")return ne="equals",null;if(C=="<"){T.tokenize=R,T.state=X,T.tagName=T.tagStart=null;var g=T.tokenize(c,T);return g?g+" tag error":"tag error"}else return/[\'\"]/.test(C)?(T.tokenize=$(C),T.stringStartCol=c.column(),T.tokenize(c,T)):(c.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function $(c){var T=function(C,g){for(;!C.eol();)if(C.next()==c){g.tokenize=A;break}return"string"};return T.isInAttribute=!0,T}function ue(c,T){return function(C,g){for(;!C.eol();){if(C.match(T)){g.tokenize=R;break}C.next()}return c}}function O(c){return function(T,C){for(var g;(g=T.next())!=null;){if(g=="<")return C.tokenize=O(c+1),C.tokenize(T,C);if(g==">")if(c==1){C.tokenize=R;break}else return C.tokenize=O(c-1),C.tokenize(T,C)}return"meta"}}function w(c){return c&&c.toLowerCase()}function M(c,T,C){this.prev=c.context,this.tagName=T||"",this.indent=c.indented,this.startOfLine=C,(k.doNotIndent.hasOwnProperty(T)||c.context&&c.context.noIndent)&&(this.noIndent=!0)}function N(c){c.context&&(c.context=c.context.prev)}function z(c,T){for(var C;;){if(!c.context||(C=c.context.tagName,!k.contextGrabbers.hasOwnProperty(w(C))||!k.contextGrabbers[w(C)].hasOwnProperty(w(T))))return;N(c)}}function X(c,T,C){return c=="openTag"?(C.tagStart=T.column(),q):c=="closeTag"?p:X}function q(c,T,C){return c=="word"?(C.tagName=T.current(),S="tag",P):k.allowMissingTagName&&c=="endTag"?(S="tag bracket",P(c,T,C)):(S="error",q)}function p(c,T,C){if(c=="word"){var g=T.current();return C.context&&C.context.tagName!=g&&k.implicitlyClosed.hasOwnProperty(w(C.context.tagName))&&N(C),C.context&&C.context.tagName==g||k.matchClosing===!1?(S="tag",W):(S="tag error",J)}else return k.allowMissingTagName&&c=="endTag"?(S="tag bracket",W(c,T,C)):(S="error",J)}function W(c,T,C){return c!="endTag"?(S="error",W):(N(C),X)}function J(c,T,C){return S="error",W(c,T,C)}function P(c,T,C){if(c=="word")return S="attribute",V;if(c=="endTag"||c=="selfcloseTag"){var g=C.tagName,y=C.tagStart;return C.tagName=C.tagStart=null,c=="selfcloseTag"||k.autoSelfClosers.hasOwnProperty(w(g))?z(C,g):(z(C,g),C.context=new M(C,g,y==C.indented)),X}return S="error",P}function V(c,T,C){return c=="equals"?F:(k.allowMissing||(S="error"),P(c,T,C))}function F(c,T,C){return c=="string"?G:c=="word"&&k.allowUnquoted?(S="string",P):(S="error",P(c,T,C))}function G(c,T,C){return c=="string"?G:P(c,T,C)}return{startState:function(c){var T={tokenize:R,state:X,indented:c||0,tagName:null,tagStart:null,context:null};return c!=null&&(T.baseIndent=c),T},token:function(c,T){if(!T.tagName&&c.sol()&&(T.indented=c.indentation()),c.eatSpace())return null;ne=null;var C=T.tokenize(c,T);return(C||ne)&&C!="comment"&&(S=null,T.state=T.state(ne||C,c,T),S&&(C=S=="error"?C+" error":S)),C},indent:function(c,T,C){var g=c.context;if(c.tokenize.isInAttribute)return c.tagStart==c.indented?c.stringStartCol+1:c.indented+Q;if(g&&g.noIndent)return b.Pass;if(c.tokenize!=A&&c.tokenize!=R)return C?C.match(/^(\s*)/)[0].length:0;if(c.tagName)return k.multilineTagIndentPastTag!==!1?c.tagStart+c.tagName.length+2:c.tagStart+Q*(k.multilineTagIndentFactor||1);if(k.alignCDATA&&/<!\[CDATA\[/.test(T))return 0;var y=T&&/^<(\/)?([\w_:\.-]*)/.exec(T);if(y&&y[1])for(;g;)if(g.tagName==y[2]){g=g.prev;break}else if(k.implicitlyClosed.hasOwnProperty(w(g.tagName)))g=g.prev;else break;else if(y)for(;g;){var j=k.contextGrabbers[w(g.tagName)];if(j&&j.hasOwnProperty(w(y[2])))g=g.prev;else break}for(;g&&g.prev&&!g.startOfLine;)g=g.prev;return g?g.indent+Q:c.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:k.htmlMode?"html":"xml",helperType:k.htmlMode?"html":"xml",skipAttribute:function(c){c.state==F&&(c.state=P)},xmlCurrentTag:function(c){return c.tagName?{name:c.tagName,close:c.type=="closeTag"}:null},xmlCurrentContext:function(c){for(var T=[],C=c.context;C;C=C.prev)T.push(C.tagName);return T.reverse()}}}),b.defineMIME("text/xml","xml"),b.defineMIME("application/xml","xml"),b.mimeModes.hasOwnProperty("text/html")||b.defineMIME("text/html",{name:"xml",htmlMode:!0})})})()),xa.exports}var ba={exports:{}},ka;function Qa(){return ka||(ka=1,(function(ct,xt){(function(b){b(mt())})(function(b){b.defineMode("javascript",function(pe,_){var te=pe.indentUnit,oe=_.statementIndent,Q=_.jsonld,k=_.json||Q,I=_.trackScope!==!1,Y=_.typescript,ne=_.wordCharacters||/[\w$\xa1-\uffff]/,S=(function(){function f(it){return{type:it,style:"keyword"}}var m=f("keyword a"),U=f("keyword b"),re=f("keyword c"),B=f("keyword d"),ce=f("operator"),We={type:"atom",style:"atom"};return{if:f("if"),while:m,with:m,else:U,do:U,try:U,finally:U,return:B,break:B,continue:B,new:f("new"),delete:re,void:re,throw:re,debugger:f("debugger"),var:f("var"),const:f("var"),let:f("var"),function:f("function"),catch:f("catch"),for:f("for"),switch:f("switch"),case:f("case"),default:f("default"),in:ce,typeof:ce,instanceof:ce,true:We,false:We,null:We,undefined:We,NaN:We,Infinity:We,this:f("this"),class:f("class"),super:f("atom"),yield:re,export:f("export"),import:f("import"),extends:re,await:re}})(),R=/[+\-*&%=<>!?|~^@]/,A=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function $(f){for(var m=!1,U,re=!1;(U=f.next())!=null;){if(!m){if(U=="/"&&!re)return;U=="["?re=!0:re&&U=="]"&&(re=!1)}m=!m&&U=="\\"}}var ue,O;function w(f,m,U){return ue=f,O=U,m}function M(f,m){var U=f.next();if(U=='"'||U=="'")return m.tokenize=N(U),m.tokenize(f,m);if(U=="."&&f.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return w("number","number");if(U=="."&&f.match(".."))return w("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(U))return w(U);if(U=="="&&f.eat(">"))return w("=>","operator");if(U=="0"&&f.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return w("number","number");if(/\d/.test(U))return f.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),w("number","number");if(U=="/")return f.eat("*")?(m.tokenize=z,z(f,m)):f.eat("/")?(f.skipToEnd(),w("comment","comment")):Et(f,m,1)?($(f),f.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),w("regexp","string-2")):(f.eat("="),w("operator","operator",f.current()));if(U=="`")return m.tokenize=X,X(f,m);if(U=="#"&&f.peek()=="!")return f.skipToEnd(),w("meta","meta");if(U=="#"&&f.eatWhile(ne))return w("variable","property");if(U=="<"&&f.match("!--")||U=="-"&&f.match("->")&&!/\S/.test(f.string.slice(0,f.start)))return f.skipToEnd(),w("comment","comment");if(R.test(U))return(U!=">"||!m.lexical||m.lexical.type!=">")&&(f.eat("=")?(U=="!"||U=="=")&&f.eat("="):/[<>*+\-|&?]/.test(U)&&(f.eat(U),U==">"&&f.eat(U))),U=="?"&&f.eat(".")?w("."):w("operator","operator",f.current());if(ne.test(U)){f.eatWhile(ne);var re=f.current();if(m.lastType!="."){if(S.propertyIsEnumerable(re)){var B=S[re];return w(B.type,B.style,re)}if(re=="async"&&f.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/,!1))return w("async","keyword",re)}return w("variable","variable",re)}}function N(f){return function(m,U){var re=!1,B;if(Q&&m.peek()=="@"&&m.match(A))return U.tokenize=M,w("jsonld-keyword","meta");for(;(B=m.next())!=null&&!(B==f&&!re);)re=!re&&B=="\\";return re||(U.tokenize=M),w("string","string")}}function z(f,m){for(var U=!1,re;re=f.next();){if(re=="/"&&U){m.tokenize=M;break}U=re=="*"}return w("comment","comment")}function X(f,m){for(var U=!1,re;(re=f.next())!=null;){if(!U&&(re=="`"||re=="$"&&f.eat("{"))){m.tokenize=M;break}U=!U&&re=="\\"}return w("quasi","string-2",f.current())}var q="([{}])";function p(f,m){m.fatArrowAt&&(m.fatArrowAt=null);var U=f.string.indexOf("=>",f.start);if(!(U<0)){if(Y){var re=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(f.string.slice(f.start,U));re&&(U=re.index)}for(var B=0,ce=!1,We=U-1;We>=0;--We){var it=f.string.charAt(We),wt=q.indexOf(it);if(wt>=0&&wt<3){if(!B){++We;break}if(--B==0){it=="("&&(ce=!0);break}}else if(wt>=3&&wt<6)++B;else if(ne.test(it))ce=!0;else if(/["'\/`]/.test(it))for(;;--We){if(We==0)return;var Wr=f.string.charAt(We-1);if(Wr==it&&f.string.charAt(We-2)!="\\"){We--;break}}else if(ce&&!B){++We;break}}ce&&!B&&(m.fatArrowAt=We)}}var W={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,import:!0,"jsonld-keyword":!0};function J(f,m,U,re,B,ce){this.indented=f,this.column=m,this.type=U,this.prev=B,this.info=ce,re!=null&&(this.align=re)}function P(f,m){if(!I)return!1;for(var U=f.localVars;U;U=U.next)if(U.name==m)return!0;for(var re=f.context;re;re=re.prev)for(var U=re.vars;U;U=U.next)if(U.name==m)return!0}function V(f,m,U,re,B){var ce=f.cc;for(F.state=f,F.stream=B,F.marked=null,F.cc=ce,F.style=m,f.lexical.hasOwnProperty("align")||(f.lexical.align=!0);;){var We=ce.length?ce.pop():k?ve:Fe;if(We(U,re)){for(;ce.length&&ce[ce.length-1].lex;)ce.pop()();return F.marked?F.marked:U=="variable"&&P(f,re)?"variable-2":m}}}var F={state:null,marked:null,cc:null};function G(){for(var f=arguments.length-1;f>=0;f--)F.cc.push(arguments[f])}function c(){return G.apply(null,arguments),!0}function T(f,m){for(var U=m;U;U=U.next)if(U.name==f)return!0;return!1}function C(f){var m=F.state;if(F.marked="def",!!I){if(m.context){if(m.lexical.info=="var"&&m.context&&m.context.block){var U=g(f,m.context);if(U!=null){m.context=U;return}}else if(!T(f,m.localVars)){m.localVars=new de(f,m.localVars);return}}_.globalVars&&!T(f,m.globalVars)&&(m.globalVars=new de(f,m.globalVars))}}function g(f,m){if(m)if(m.block){var U=g(f,m.prev);return U?U==m.prev?m:new j(U,m.vars,!0):null}else return T(f,m.vars)?m:new j(m.prev,new de(f,m.vars),!1);else return null}function y(f){return f=="public"||f=="private"||f=="protected"||f=="abstract"||f=="readonly"}function j(f,m,U){this.prev=f,this.vars=m,this.block=U}function de(f,m){this.name=f,this.next=m}var v=new de("this",new de("arguments",null));function d(){F.state.context=new j(F.state.context,F.state.localVars,!1),F.state.localVars=v}function fe(){F.state.context=new j(F.state.context,F.state.localVars,!0),F.state.localVars=null}d.lex=fe.lex=!0;function Te(){F.state.localVars=F.state.context.vars,F.state.context=F.state.context.prev}Te.lex=!0;function le(f,m){var U=function(){var re=F.state,B=re.indented;if(re.lexical.type=="stat")B=re.lexical.indented;else for(var ce=re.lexical;ce&&ce.type==")"&&ce.align;ce=ce.prev)B=ce.indented;re.lexical=new J(B,F.stream.column(),f,null,re.lexical,m)};return U.lex=!0,U}function xe(){var f=F.state;f.lexical.prev&&(f.lexical.type==")"&&(f.indented=f.lexical.indented),f.lexical=f.lexical.prev)}xe.lex=!0;function Me(f){function m(U){return U==f?c():f==";"||U=="}"||U==")"||U=="]"?G():c(m)}return m}function Fe(f,m){return f=="var"?c(le("vardef",m),Er,Me(";"),xe):f=="keyword a"?c(le("form"),qe,Fe,xe):f=="keyword b"?c(le("form"),Fe,xe):f=="keyword d"?F.stream.match(/^\s*$/,!1)?c():c(le("stat"),dt,Me(";"),xe):f=="debugger"?c(Me(";")):f=="{"?c(le("}"),fe,Pt,xe,Te):f==";"?c():f=="if"?(F.state.lexical.info=="else"&&F.state.cc[F.state.cc.length-1]==xe&&F.state.cc.pop()(),c(le("form"),qe,Fe,xe,Or)):f=="function"?c(zt):f=="for"?c(le("form"),fe,Rn,Fe,Te,xe):f=="class"||Y&&m=="interface"?(F.marked="keyword",c(le("form",f=="class"?f:m),Pr,xe)):f=="variable"?Y&&m=="declare"?(F.marked="keyword",c(Fe)):Y&&(m=="module"||m=="enum"||m=="type")&&F.stream.match(/^\s*\w/,!1)?(F.marked="keyword",m=="enum"?c(ye):m=="type"?c(Wn,Me("operator"),Re,Me(";")):c(le("form"),kt,Me("{"),le("}"),Pt,xe,xe)):Y&&m=="namespace"?(F.marked="keyword",c(le("form"),ve,Fe,xe)):Y&&m=="abstract"?(F.marked="keyword",c(Fe)):c(le("stat"),ze):f=="switch"?c(le("form"),qe,Me("{"),le("}","switch"),fe,Pt,xe,xe,Te):f=="case"?c(ve,Me(":")):f=="default"?c(Me(":")):f=="catch"?c(le("form"),d,Ce,Fe,xe,Te):f=="export"?c(le("stat"),Ir,xe):f=="import"?c(le("stat"),fr,xe):f=="async"?c(Fe):m=="@"?c(ve,Fe):G(le("stat"),ve,Me(";"),xe)}function Ce(f){if(f=="(")return c(Wt,Me(")"))}function ve(f,m){return $e(f,m,!1)}function Oe(f,m){return $e(f,m,!0)}function qe(f){return f!="("?G():c(le(")"),dt,Me(")"),xe)}function $e(f,m,U){if(F.state.fatArrowAt==F.stream.start){var re=U?Ie:we;if(f=="(")return c(d,le(")"),Ne(Wt,")"),xe,Me("=>"),re,Te);if(f=="variable")return G(d,kt,Me("=>"),re,Te)}var B=U?_e:Pe;return W.hasOwnProperty(f)?c(B):f=="function"?c(zt,B):f=="class"||Y&&m=="interface"?(F.marked="keyword",c(le("form"),yi,xe)):f=="keyword c"||f=="async"?c(U?Oe:ve):f=="("?c(le(")"),dt,Me(")"),xe,B):f=="operator"||f=="spread"?c(U?Oe:ve):f=="["?c(le("]"),Je,xe,B):f=="{"?Mt(De,"}",null,B):f=="quasi"?G(Ue,B):f=="new"?c(E(U)):c()}function dt(f){return f.match(/[;\}\)\],]/)?G():G(ve)}function Pe(f,m){return f==","?c(dt):_e(f,m,!1)}function _e(f,m,U){var re=U==!1?Pe:_e,B=U==!1?ve:Oe;if(f=="=>")return c(d,U?Ie:we,Te);if(f=="operator")return/\+\+|--/.test(m)||Y&&m=="!"?c(re):Y&&m=="<"&&F.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,!1)?c(le(">"),Ne(Re,">"),xe,re):m=="?"?c(ve,Me(":"),B):c(B);if(f=="quasi")return G(Ue,re);if(f!=";"){if(f=="(")return Mt(Oe,")","call",re);if(f==".")return c(me,re);if(f=="[")return c(le("]"),dt,Me("]"),xe,re);if(Y&&m=="as")return F.marked="keyword",c(Re,re);if(f=="regexp")return F.state.lastType=F.marked="operator",F.stream.backUp(F.stream.pos-F.stream.start-1),c(B)}}function Ue(f,m){return f!="quasi"?G():m.slice(m.length-2)!="${"?c(Ue):c(dt,et)}function et(f){if(f=="}")return F.marked="string-2",F.state.tokenize=X,c(Ue)}function we(f){return p(F.stream,F.state),G(f=="{"?Fe:ve)}function Ie(f){return p(F.stream,F.state),G(f=="{"?Fe:Oe)}function E(f){return function(m){return m=="."?c(f?K:ee):m=="variable"&&Y?c(Ft,f?_e:Pe):G(f?Oe:ve)}}function ee(f,m){if(m=="target")return F.marked="keyword",c(Pe)}function K(f,m){if(m=="target")return F.marked="keyword",c(_e)}function ze(f){return f==":"?c(xe,Fe):G(Pe,Me(";"),xe)}function me(f){if(f=="variable")return F.marked="property",c()}function De(f,m){if(f=="async")return F.marked="property",c(De);if(f=="variable"||F.style=="keyword"){if(F.marked="property",m=="get"||m=="set")return c(be);var U;return Y&&F.state.fatArrowAt==F.stream.start&&(U=F.stream.match(/^\s*:\s*/,!1))&&(F.state.fatArrowAt=F.stream.pos+U[0].length),c(Be)}else{if(f=="number"||f=="string")return F.marked=Q?"property":F.style+" property",c(Be);if(f=="jsonld-keyword")return c(Be);if(Y&&y(m))return F.marked="keyword",c(De);if(f=="[")return c(ve,or,Me("]"),Be);if(f=="spread")return c(Oe,Be);if(m=="*")return F.marked="keyword",c(De);if(f==":")return G(Be)}}function be(f){return f!="variable"?G(Be):(F.marked="property",c(zt))}function Be(f){if(f==":")return c(Oe);if(f=="(")return G(zt)}function Ne(f,m,U){function re(B,ce){if(U?U.indexOf(B)>-1:B==","){var We=F.state.lexical;return We.info=="call"&&(We.pos=(We.pos||0)+1),c(function(it,wt){return it==m||wt==m?G():G(f)},re)}return B==m||ce==m?c():U&&U.indexOf(";")>-1?G(f):c(Me(m))}return function(B,ce){return B==m||ce==m?c():G(f,re)}}function Mt(f,m,U){for(var re=3;re<arguments.length;re++)F.cc.push(arguments[re]);return c(le(m,U),Ne(f,m),xe)}function Pt(f){return f=="}"?c():G(Fe,Pt)}function or(f,m){if(Y){if(f==":")return c(Re);if(m=="?")return c(or)}}function br(f,m){if(Y&&(f==":"||m=="in"))return c(Re)}function lr(f){if(Y&&f==":")return F.stream.match(/^\s*\w+\s+is\b/,!1)?c(ve,mi,Re):c(Re)}function mi(f,m){if(m=="is")return F.marked="keyword",c()}function Re(f,m){if(m=="keyof"||m=="typeof"||m=="infer"||m=="readonly")return F.marked="keyword",c(m=="typeof"?Oe:Re);if(f=="variable"||m=="void")return F.marked="type",c(It);if(m=="|"||m=="&")return c(Re);if(f=="string"||f=="number"||f=="atom")return c(It);if(f=="[")return c(le("]"),Ne(Re,"]",","),xe,It);if(f=="{")return c(le("}"),Se,xe,It);if(f=="(")return c(Ne(Qe,")"),Bn,It);if(f=="<")return c(Ne(Re,">"),Re);if(f=="quasi")return G(ht,It)}function Bn(f){if(f=="=>")return c(Re)}function Se(f){return f.match(/[\}\)\]]/)?c():f==","||f==";"?c(Se):G(Zt,Se)}function Zt(f,m){if(f=="variable"||F.style=="keyword")return F.marked="property",c(Zt);if(m=="?"||f=="number"||f=="string")return c(Zt);if(f==":")return c(Re);if(f=="[")return c(Me("variable"),br,Me("]"),Zt);if(f=="(")return G(ur,Zt);if(!f.match(/[;\}\)\],]/))return c()}function ht(f,m){return f!="quasi"?G():m.slice(m.length-2)!="${"?c(ht):c(Re,Ye)}function Ye(f){if(f=="}")return F.marked="string-2",F.state.tokenize=X,c(ht)}function Qe(f,m){return f=="variable"&&F.stream.match(/^\s*[?:]/,!1)||m=="?"?c(Qe):f==":"?c(Re):f=="spread"?c(Qe):G(Re)}function It(f,m){if(m=="<")return c(le(">"),Ne(Re,">"),xe,It);if(m=="|"||f=="."||m=="&")return c(Re);if(f=="[")return c(Re,Me("]"),It);if(m=="extends"||m=="implements")return F.marked="keyword",c(Re);if(m=="?")return c(Re,Me(":"),Re)}function Ft(f,m){if(m=="<")return c(le(">"),Ne(Re,">"),xe,It)}function Bt(){return G(Re,pt)}function pt(f,m){if(m=="=")return c(Re)}function Er(f,m){return m=="enum"?(F.marked="keyword",c(ye)):G(kt,or,Rt,xi)}function kt(f,m){if(Y&&y(m))return F.marked="keyword",c(kt);if(f=="variable")return C(m),c();if(f=="spread")return c(kt);if(f=="[")return Mt(ln,"]");if(f=="{")return Mt(ar,"}")}function ar(f,m){return f=="variable"&&!F.stream.match(/^\s*:/,!1)?(C(m),c(Rt)):(f=="variable"&&(F.marked="property"),f=="spread"?c(kt):f=="}"?G():f=="["?c(ve,Me("]"),Me(":"),ar):c(Me(":"),kt,Rt))}function ln(){return G(kt,Rt)}function Rt(f,m){if(m=="=")return c(Oe)}function xi(f){if(f==",")return c(Er)}function Or(f,m){if(f=="keyword b"&&m=="else")return c(le("form","else"),Fe,xe)}function Rn(f,m){if(m=="await")return c(Rn);if(f=="(")return c(le(")"),an,xe)}function an(f){return f=="var"?c(Er,sr):f=="variable"?c(sr):G(sr)}function sr(f,m){return f==")"?c():f==";"?c(sr):m=="in"||m=="of"?(F.marked="keyword",c(ve,sr)):G(ve,sr)}function zt(f,m){if(m=="*")return F.marked="keyword",c(zt);if(f=="variable")return C(m),c(zt);if(f=="(")return c(d,le(")"),Ne(Wt,")"),xe,lr,Fe,Te);if(Y&&m=="<")return c(le(">"),Ne(Bt,">"),xe,zt)}function ur(f,m){if(m=="*")return F.marked="keyword",c(ur);if(f=="variable")return C(m),c(ur);if(f=="(")return c(d,le(")"),Ne(Wt,")"),xe,lr,Te);if(Y&&m=="<")return c(le(">"),Ne(Bt,">"),xe,ur)}function Wn(f,m){if(f=="keyword"||f=="variable")return F.marked="type",c(Wn);if(m=="<")return c(le(">"),Ne(Bt,">"),xe)}function Wt(f,m){return m=="@"&&c(ve,Wt),f=="spread"?c(Wt):Y&&y(m)?(F.marked="keyword",c(Wt)):Y&&f=="this"?c(or,Rt):G(kt,or,Rt)}function yi(f,m){return f=="variable"?Pr(f,m):Ht(f,m)}function Pr(f,m){if(f=="variable")return C(m),c(Ht)}function Ht(f,m){if(m=="<")return c(le(">"),Ne(Bt,">"),xe,Ht);if(m=="extends"||m=="implements"||Y&&f==",")return m=="implements"&&(F.marked="keyword"),c(Y?Re:ve,Ht);if(f=="{")return c(le("}"),_t,xe)}function _t(f,m){if(f=="async"||f=="variable"&&(m=="static"||m=="get"||m=="set"||Y&&y(m))&&F.stream.match(/^\s+#?[\w$\xa1-\uffff]/,!1))return F.marked="keyword",c(_t);if(f=="variable"||F.style=="keyword")return F.marked="property",c(kr,_t);if(f=="number"||f=="string")return c(kr,_t);if(f=="[")return c(ve,or,Me("]"),kr,_t);if(m=="*")return F.marked="keyword",c(_t);if(Y&&f=="(")return G(ur,_t);if(f==";"||f==",")return c(_t);if(f=="}")return c();if(m=="@")return c(ve,_t)}function kr(f,m){if(m=="!"||m=="?")return c(kr);if(f==":")return c(Re,Rt);if(m=="=")return c(Oe);var U=F.state.lexical.prev,re=U&&U.info=="interface";return G(re?ur:zt)}function Ir(f,m){return m=="*"?(F.marked="keyword",c(Rr,Me(";"))):m=="default"?(F.marked="keyword",c(ve,Me(";"))):f=="{"?c(Ne(zr,"}"),Rr,Me(";")):G(Fe)}function zr(f,m){if(m=="as")return F.marked="keyword",c(Me("variable"));if(f=="variable")return G(Oe,zr)}function fr(f){return f=="string"?c():f=="("?G(ve):f=="."?G(Pe):G(Br,Gt,Rr)}function Br(f,m){return f=="{"?Mt(Br,"}"):(f=="variable"&&C(m),m=="*"&&(F.marked="keyword"),c(sn))}function Gt(f){if(f==",")return c(Br,Gt)}function sn(f,m){if(m=="as")return F.marked="keyword",c(Br)}function Rr(f,m){if(m=="from")return F.marked="keyword",c(ve)}function Je(f){return f=="]"?c():G(Ne(Oe,"]"))}function ye(){return G(le("form"),kt,Me("{"),le("}"),Ne($t,"}"),xe,xe)}function $t(){return G(kt,Rt)}function un(f,m){return f.lastType=="operator"||f.lastType==","||R.test(m.charAt(0))||/[,.]/.test(m.charAt(0))}function Et(f,m,U){return m.tokenize==M&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(m.lastType)||m.lastType=="quasi"&&/\{\s*$/.test(f.string.slice(0,f.pos-(U||0)))}return{startState:function(f){var m={tokenize:M,lastType:"sof",cc:[],lexical:new J((f||0)-te,0,"block",!1),localVars:_.localVars,context:_.localVars&&new j(null,null,!1),indented:f||0};return _.globalVars&&typeof _.globalVars=="object"&&(m.globalVars=_.globalVars),m},token:function(f,m){if(f.sol()&&(m.lexical.hasOwnProperty("align")||(m.lexical.align=!1),m.indented=f.indentation(),p(f,m)),m.tokenize!=z&&f.eatSpace())return null;var U=m.tokenize(f,m);return ue=="comment"?U:(m.lastType=ue=="operator"&&(O=="++"||O=="--")?"incdec":ue,V(m,U,ue,O,f))},indent:function(f,m){if(f.tokenize==z||f.tokenize==X)return b.Pass;if(f.tokenize!=M)return 0;var U=m&&m.charAt(0),re=f.lexical,B;if(!/^\s*else\b/.test(m))for(var ce=f.cc.length-1;ce>=0;--ce){var We=f.cc[ce];if(We==xe)re=re.prev;else if(We!=Or&&We!=Te)break}for(;(re.type=="stat"||re.type=="form")&&(U=="}"||(B=f.cc[f.cc.length-1])&&(B==Pe||B==_e)&&!/^[,\.=+\-*:?[\(]/.test(m));)re=re.prev;oe&&re.type==")"&&re.prev.type=="stat"&&(re=re.prev);var it=re.type,wt=U==it;return it=="vardef"?re.indented+(f.lastType=="operator"||f.lastType==","?re.info.length+1:0):it=="form"&&U=="{"?re.indented:it=="form"?re.indented+te:it=="stat"?re.indented+(un(f,m)?oe||te:0):re.info=="switch"&&!wt&&_.doubleIndentSwitch!=!1?re.indented+(/^(?:case|default)\b/.test(m)?te:2*te):re.align?re.column+(wt?0:1):re.indented+(wt?0:te)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:k?null:"/*",blockCommentEnd:k?null:"*/",blockCommentContinue:k?null:" * ",lineComment:k?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:k?"json":"javascript",jsonldMode:Q,jsonMode:k,expressionAllowed:Et,skipExpression:function(f){V(f,"atom","atom","true",new b.StringStream("",2,null))}}}),b.registerHelper("wordChars","javascript",/[\w$]/),b.defineMIME("text/javascript","javascript"),b.defineMIME("text/ecmascript","javascript"),b.defineMIME("application/javascript","javascript"),b.defineMIME("application/x-javascript","javascript"),b.defineMIME("application/ecmascript","javascript"),b.defineMIME("application/json",{name:"javascript",json:!0}),b.defineMIME("application/x-json",{name:"javascript",json:!0}),b.defineMIME("application/manifest+json",{name:"javascript",json:!0}),b.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),b.defineMIME("text/typescript",{name:"javascript",typescript:!0}),b.defineMIME("application/typescript",{name:"javascript",typescript:!0})})})()),ba.exports}var wa;function Vu(){return wa||(wa=1,(function(ct,xt){(function(b){b(mt(),Ya(),Qa(),Xa())})(function(b){var pe={script:[["lang",/(javascript|babel)/i,"javascript"],["type",/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i,"javascript"],["type",/./,"text/plain"],[null,null,"javascript"]],style:[["lang",/^css$/i,"css"],["type",/^(text\/)?(x-)?(stylesheet|css)$/i,"css"],["type",/./,"text/plain"],[null,null,"css"]]};function _(ne,S,R){var A=ne.current(),$=A.search(S);return $>-1?ne.backUp(A.length-$):A.match(/<\/?$/)&&(ne.backUp(A.length),ne.match(S,!1)||ne.match(A)),R}var te={};function oe(ne){var S=te[ne];return S||(te[ne]=new RegExp("\\s+"+ne+`\\s*=\\s*('|")?([^'"]+)('|")?\\s*`))}function Q(ne,S){var R=ne.match(oe(S));return R?/^\s*(.*?)\s*$/.exec(R[2])[1]:""}function k(ne,S){return new RegExp((S?"^":"")+"</\\s*"+ne+"\\s*>","i")}function I(ne,S){for(var R in ne)for(var A=S[R]||(S[R]=[]),$=ne[R],ue=$.length-1;ue>=0;ue--)A.unshift($[ue])}function Y(ne,S){for(var R=0;R<ne.length;R++){var A=ne[R];if(!A[0]||A[1].test(Q(S,A[0])))return A[2]}}b.defineMode("htmlmixed",function(ne,S){var R=b.getMode(ne,{name:"xml",htmlMode:!0,multilineTagIndentFactor:S.multilineTagIndentFactor,multilineTagIndentPastTag:S.multilineTagIndentPastTag,allowMissingTagName:S.allowMissingTagName}),A={},$=S&&S.tags,ue=S&&S.scriptTypes;if(I(pe,A),$&&I($,A),ue)for(var O=ue.length-1;O>=0;O--)A.script.unshift(["type",ue[O].matches,ue[O].mode]);function w(M,N){var z=R.token(M,N.htmlState),X=/\btag\b/.test(z),q;if(X&&!/[<>\s\/]/.test(M.current())&&(q=N.htmlState.tagName&&N.htmlState.tagName.toLowerCase())&&A.hasOwnProperty(q))N.inTag=q+" ";else if(N.inTag&&X&&/>$/.test(M.current())){var p=/^([\S]+) (.*)/.exec(N.inTag);N.inTag=null;var W=M.current()==">"&&Y(A[p[1]],p[2]),J=b.getMode(ne,W),P=k(p[1],!0),V=k(p[1],!1);N.token=function(F,G){return F.match(P,!1)?(G.token=w,G.localState=G.localMode=null,null):_(F,V,G.localMode.token(F,G.localState))},N.localMode=J,N.localState=b.startState(J,R.indent(N.htmlState,"",""))}else N.inTag&&(N.inTag+=M.current(),M.eol()&&(N.inTag+=" "));return z}return{startState:function(){var M=b.startState(R);return{token:w,inTag:null,localMode:null,localState:null,htmlState:M}},copyState:function(M){var N;return M.localState&&(N=b.copyState(M.localMode,M.localState)),{token:M.token,inTag:M.inTag,localMode:M.localMode,localState:N,htmlState:b.copyState(R,M.htmlState)}},token:function(M,N){return N.token(M,N)},indent:function(M,N,z){return!M.localMode||/^\s*<\//.test(N)?R.indent(M.htmlState,N,z):M.localMode.indent?M.localMode.indent(M.localState,N,z):b.Pass},innerMode:function(M){return{state:M.localState||M.htmlState,mode:M.localMode||R}}}},"xml","javascript","css"),b.defineMIME("text/html","htmlmixed")})})()),ma.exports}Vu();Qa();var Sa={exports:{}},La;function ef(){return La||(La=1,(function(ct,xt){(function(b){b(mt())})(function(b){function pe(I){return new RegExp("^(("+I.join(")|(")+"))\\b")}var _=pe(["and","or","not","is"]),te=["as","assert","break","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","lambda","pass","raise","return","try","while","with","yield","in","False","True"],oe=["abs","all","any","bin","bool","bytearray","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip","__import__","NotImplemented","Ellipsis","__debug__"];b.registerHelper("hintWords","python",te.concat(oe).concat(["exec","print"]));function Q(I){return I.scopes[I.scopes.length-1]}b.defineMode("python",function(I,Y){for(var ne="error",S=Y.delimiters||Y.singleDelimiters||/^[\(\)\[\]\{\}@,:`=;\.\\]/,R=[Y.singleOperators,Y.doubleOperators,Y.doubleDelimiters,Y.tripleDelimiters,Y.operators||/^([-+*/%\/&|^]=?|[<>=]+|\/\/=?|\*\*=?|!=|[~!@]|\.\.\.)/],A=0;A<R.length;A++)R[A]||R.splice(A--,1);var $=Y.hangingIndent||I.indentUnit,ue=te,O=oe;Y.extra_keywords!=null&&(ue=ue.concat(Y.extra_keywords)),Y.extra_builtins!=null&&(O=O.concat(Y.extra_builtins));var w=!(Y.version&&Number(Y.version)<3);if(w){var M=Y.identifiers||/^[_A-Za-z\u00A1-\uFFFF][_A-Za-z0-9\u00A1-\uFFFF]*/;ue=ue.concat(["nonlocal","None","aiter","anext","async","await","breakpoint","match","case"]),O=O.concat(["ascii","bytes","exec","print"]);var N=new RegExp(`^(([rbuf]|(br)|(rb)|(fr)|(rf))?('{3}|"{3}|['"]))`,"i")}else{var M=Y.identifiers||/^[_A-Za-z][_A-Za-z0-9]*/;ue=ue.concat(["exec","print"]),O=O.concat(["apply","basestring","buffer","cmp","coerce","execfile","file","intern","long","raw_input","reduce","reload","unichr","unicode","xrange","None"]);var N=new RegExp(`^(([rubf]|(ur)|(br))?('{3}|"{3}|['"]))`,"i")}var z=pe(ue),X=pe(O);function q(T,C){var g=T.sol()&&C.lastToken!="\\";if(g&&(C.indent=T.indentation()),g&&Q(C).type=="py"){var y=Q(C).offset;if(T.eatSpace()){var j=T.indentation();return j>y?P(C):j<y&&F(T,C)&&T.peek()!="#"&&(C.errorToken=!0),null}else{var de=p(T,C);return y>0&&F(T,C)&&(de+=" "+ne),de}}return p(T,C)}function p(T,C,g){if(T.eatSpace())return null;if(!g&&T.match(/^#.*/))return"comment";if(T.match(/^[0-9\.]/,!1)){var y=!1;if(T.match(/^[\d_]*\.\d+(e[\+\-]?\d+)?/i)&&(y=!0),T.match(/^[\d_]+\.\d*/)&&(y=!0),T.match(/^\.\d+/)&&(y=!0),y)return T.eat(/J/i),"number";var j=!1;if(T.match(/^0x[0-9a-f_]+/i)&&(j=!0),T.match(/^0b[01_]+/i)&&(j=!0),T.match(/^0o[0-7_]+/i)&&(j=!0),T.match(/^[1-9][\d_]*(e[\+\-]?[\d_]+)?/)&&(T.eat(/J/i),j=!0),T.match(/^0(?![\dx])/i)&&(j=!0),j)return T.eat(/L/i),"number"}if(T.match(N)){var de=T.current().toLowerCase().indexOf("f")!==-1;return de?(C.tokenize=W(T.current(),C.tokenize),C.tokenize(T,C)):(C.tokenize=J(T.current(),C.tokenize),C.tokenize(T,C))}for(var v=0;v<R.length;v++)if(T.match(R[v]))return"operator";return T.match(S)?"punctuation":C.lastToken=="."&&T.match(M)?"property":T.match(z)||T.match(_)?"keyword":T.match(X)?"builtin":T.match(/^(self|cls)\b/)?"variable-2":T.match(M)?C.lastToken=="def"||C.lastToken=="class"?"def":"variable":(T.next(),g?null:ne)}function W(T,C){for(;"rubf".indexOf(T.charAt(0).toLowerCase())>=0;)T=T.substr(1);var g=T.length==1,y="string";function j(v){return function(d,fe){var Te=p(d,fe,!0);return Te=="punctuation"&&(d.current()=="{"?fe.tokenize=j(v+1):d.current()=="}"&&(v>1?fe.tokenize=j(v-1):fe.tokenize=de)),Te}}function de(v,d){for(;!v.eol();)if(v.eatWhile(/[^'"\{\}\\]/),v.eat("\\")){if(v.next(),g&&v.eol())return y}else{if(v.match(T))return d.tokenize=C,y;if(v.match("{{"))return y;if(v.match("{",!1))return d.tokenize=j(0),v.current()?y:d.tokenize(v,d);if(v.match("}}"))return y;if(v.match("}"))return ne;v.eat(/['"]/)}if(g){if(Y.singleLineStringErrors)return ne;d.tokenize=C}return y}return de.isString=!0,de}function J(T,C){for(;"rubf".indexOf(T.charAt(0).toLowerCase())>=0;)T=T.substr(1);var g=T.length==1,y="string";function j(de,v){for(;!de.eol();)if(de.eatWhile(/[^'"\\]/),de.eat("\\")){if(de.next(),g&&de.eol())return y}else{if(de.match(T))return v.tokenize=C,y;de.eat(/['"]/)}if(g){if(Y.singleLineStringErrors)return ne;v.tokenize=C}return y}return j.isString=!0,j}function P(T){for(;Q(T).type!="py";)T.scopes.pop();T.scopes.push({offset:Q(T).offset+I.indentUnit,type:"py",align:null})}function V(T,C,g){var y=T.match(/^[\s\[\{\(]*(?:#|$)/,!1)?null:T.column()+1;C.scopes.push({offset:C.indent+$,type:g,align:y})}function F(T,C){for(var g=T.indentation();C.scopes.length>1&&Q(C).offset>g;){if(Q(C).type!="py")return!0;C.scopes.pop()}return Q(C).offset!=g}function G(T,C){T.sol()&&(C.beginningOfLine=!0,C.dedent=!1);var g=C.tokenize(T,C),y=T.current();if(C.beginningOfLine&&y=="@")return T.match(M,!1)?"meta":w?"operator":ne;if(/\S/.test(y)&&(C.beginningOfLine=!1),(g=="variable"||g=="builtin")&&C.lastToken=="meta"&&(g="meta"),(y=="pass"||y=="return")&&(C.dedent=!0),y=="lambda"&&(C.lambda=!0),y==":"&&!C.lambda&&Q(C).type=="py"&&T.match(/^\s*(?:#|$)/,!1)&&P(C),y.length==1&&!/string|comment/.test(g)){var j="[({".indexOf(y);if(j!=-1&&V(T,C,"])}".slice(j,j+1)),j="])}".indexOf(y),j!=-1)if(Q(C).type==y)C.indent=C.scopes.pop().offset-$;else return ne}return C.dedent&&T.eol()&&Q(C).type=="py"&&C.scopes.length>1&&C.scopes.pop(),g}var c={startState:function(T){return{tokenize:q,scopes:[{offset:T||0,type:"py",align:null}],indent:T||0,lastToken:null,lambda:!1,dedent:0}},token:function(T,C){var g=C.errorToken;g&&(C.errorToken=!1);var y=G(T,C);return y&&y!="comment"&&(C.lastToken=y=="keyword"||y=="punctuation"?T.current():y),y=="punctuation"&&(y=null),T.eol()&&C.lambda&&(C.lambda=!1),g?y+" "+ne:y},indent:function(T,C){if(T.tokenize!=q)return T.tokenize.isString?b.Pass:0;var g=Q(T),y=g.type==C.charAt(0)||g.type=="py"&&!T.dedent&&/^(else:|elif |except |finally:)/.test(C);return g.align!=null?g.align-(y?1:0):g.offset-(y?$:0)},electricInput:/^\s*([\}\]\)]|else:|elif |except |finally:)$/,closeBrackets:{triples:`'"`},lineComment:"#",fold:"indent"};return c}),b.defineMIME("text/x-python","python");var k=function(I){return I.split(" ")};b.defineMIME("text/x-cython",{name:"python",extra_keywords:k("by cdef cimport cpdef ctypedef enum except extern gil include nogil property public readonly struct union DEF IF ELIF ELSE")})})})()),Sa.exports}ef();var Ta={exports:{}},Ca;function tf(){return Ca||(Ca=1,(function(ct,xt){(function(b){b(mt())})(function(b){function pe(g,y,j,de,v,d){this.indented=g,this.column=y,this.type=j,this.info=de,this.align=v,this.prev=d}function _(g,y,j,de){var v=g.indented;return g.context&&g.context.type=="statement"&&j!="statement"&&(v=g.context.indented),g.context=new pe(v,y,j,de,null,g.context)}function te(g){var y=g.context.type;return(y==")"||y=="]"||y=="}")&&(g.indented=g.context.indented),g.context=g.context.prev}function oe(g,y,j){if(y.prevToken=="variable"||y.prevToken=="type"||/\S(?:[^- ]>|[*\]])\s*$|\*$/.test(g.string.slice(0,j))||y.typeAtEndOfLine&&g.column()==g.indentation())return!0}function Q(g){for(;;){if(!g||g.type=="top")return!0;if(g.type=="}"&&g.prev.info!="namespace")return!1;g=g.prev}}b.defineMode("clike",function(g,y){var j=g.indentUnit,de=y.statementIndentUnit||j,v=y.dontAlignCalls,d=y.keywords||{},fe=y.types||{},Te=y.builtin||{},le=y.blockKeywords||{},xe=y.defKeywords||{},Me=y.atoms||{},Fe=y.hooks||{},Ce=y.multiLineStrings,ve=y.indentStatements!==!1,Oe=y.indentSwitch!==!1,qe=y.namespaceSeparator,$e=y.isPunctuationChar||/[\[\]{}\(\),;\:\.]/,dt=y.numberStart||/[\d\.]/,Pe=y.number||/^(?:0x[a-f\d]+|0b[01]+|(?:\d+\.?\d*|\.\d+)(?:e[-+]?\d+)?)(u|ll?|l|f)?/i,_e=y.isOperatorChar||/[+\-*&%=<>!?|\/]/,Ue=y.isIdentifierChar||/[\w\$_\xa1-\uffff]/,et=y.isReservedIdentifier||!1,we,Ie;function E(me,De){var be=me.next();if(Fe[be]){var Be=Fe[be](me,De);if(Be!==!1)return Be}if(be=='"'||be=="'")return De.tokenize=ee(be),De.tokenize(me,De);if(dt.test(be)){if(me.backUp(1),me.match(Pe))return"number";me.next()}if($e.test(be))return we=be,null;if(be=="/"){if(me.eat("*"))return De.tokenize=K,K(me,De);if(me.eat("/"))return me.skipToEnd(),"comment"}if(_e.test(be)){for(;!me.match(/^\/[\/*]/,!1)&&me.eat(_e););return"operator"}if(me.eatWhile(Ue),qe)for(;me.match(qe);)me.eatWhile(Ue);var Ne=me.current();return I(d,Ne)?(I(le,Ne)&&(we="newstatement"),I(xe,Ne)&&(Ie=!0),"keyword"):I(fe,Ne)?"type":I(Te,Ne)||et&&et(Ne)?(I(le,Ne)&&(we="newstatement"),"builtin"):I(Me,Ne)?"atom":"variable"}function ee(me){return function(De,be){for(var Be=!1,Ne,Mt=!1;(Ne=De.next())!=null;){if(Ne==me&&!Be){Mt=!0;break}Be=!Be&&Ne=="\\"}return(Mt||!(Be||Ce))&&(be.tokenize=null),"string"}}function K(me,De){for(var be=!1,Be;Be=me.next();){if(Be=="/"&&be){De.tokenize=null;break}be=Be=="*"}return"comment"}function ze(me,De){y.typeFirstDefinitions&&me.eol()&&Q(De.context)&&(De.typeAtEndOfLine=oe(me,De,me.pos))}return{startState:function(me){return{tokenize:null,context:new pe((me||0)-j,0,"top",null,!1),indented:0,startOfLine:!0,prevToken:null}},token:function(me,De){var be=De.context;if(me.sol()&&(be.align==null&&(be.align=!1),De.indented=me.indentation(),De.startOfLine=!0),me.eatSpace())return ze(me,De),null;we=Ie=null;var Be=(De.tokenize||E)(me,De);if(Be=="comment"||Be=="meta")return Be;if(be.align==null&&(be.align=!0),we==";"||we==":"||we==","&&me.match(/^\s*(?:\/\/.*)?$/,!1))for(;De.context.type=="statement";)te(De);else if(we=="{")_(De,me.column(),"}");else if(we=="[")_(De,me.column(),"]");else if(we=="(")_(De,me.column(),")");else if(we=="}"){for(;be.type=="statement";)be=te(De);for(be.type=="}"&&(be=te(De));be.type=="statement";)be=te(De)}else we==be.type?te(De):ve&&((be.type=="}"||be.type=="top")&&we!=";"||be.type=="statement"&&we=="newstatement")&&_(De,me.column(),"statement",me.current());if(Be=="variable"&&(De.prevToken=="def"||y.typeFirstDefinitions&&oe(me,De,me.start)&&Q(De.context)&&me.match(/^\s*\(/,!1))&&(Be="def"),Fe.token){var Ne=Fe.token(me,De,Be);Ne!==void 0&&(Be=Ne)}return Be=="def"&&y.styleDefs===!1&&(Be="variable"),De.startOfLine=!1,De.prevToken=Ie?"def":Be||we,ze(me,De),Be},indent:function(me,De){if(me.tokenize!=E&&me.tokenize!=null||me.typeAtEndOfLine&&Q(me.context))return b.Pass;var be=me.context,Be=De&&De.charAt(0),Ne=Be==be.type;if(be.type=="statement"&&Be=="}"&&(be=be.prev),y.dontIndentStatements)for(;be.type=="statement"&&y.dontIndentStatements.test(be.info);)be=be.prev;if(Fe.indent){var Mt=Fe.indent(me,be,De,j);if(typeof Mt=="number")return Mt}var Pt=be.prev&&be.prev.info=="switch";if(y.allmanIndentation&&/[{(]/.test(Be)){for(;be.type!="top"&&be.type!="}";)be=be.prev;return be.indented}return be.type=="statement"?be.indented+(Be=="{"?0:de):be.align&&(!v||be.type!=")")?be.column+(Ne?0:1):be.type==")"&&!Ne?be.indented+de:be.indented+(Ne?0:j)+(!Ne&&Pt&&!/^(?:case|default)\b/.test(De)?j:0)},electricInput:Oe?/^\s*(?:case .*?:|default:|\{\}?|\})$/:/^\s*[{}]$/,blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:"//",fold:"brace"}});function k(g){for(var y={},j=g.split(" "),de=0;de<j.length;++de)y[j[de]]=!0;return y}function I(g,y){return typeof g=="function"?g(y):g.propertyIsEnumerable(y)}var Y="auto if break case register continue return default do sizeof static else struct switch extern typedef union for goto while enum const volatile inline restrict asm fortran",ne="alignas alignof and and_eq audit axiom bitand bitor catch class compl concept constexpr const_cast decltype delete dynamic_cast explicit export final friend import module mutable namespace new noexcept not not_eq operator or or_eq override private protected public reinterpret_cast requires static_assert static_cast template this thread_local throw try typeid typename using virtual xor xor_eq",S="bycopy byref in inout oneway out self super atomic nonatomic retain copy readwrite readonly strong weak assign typeof nullable nonnull null_resettable _cmd @interface @implementation @end @protocol @encode @property @synthesize @dynamic @class @public @package @private @protected @required @optional @try @catch @finally @import @selector @encode @defs @synchronized @autoreleasepool @compatibility_alias @available",R="FOUNDATION_EXPORT FOUNDATION_EXTERN NS_INLINE NS_FORMAT_FUNCTION  NS_RETURNS_RETAINEDNS_ERROR_ENUM NS_RETURNS_NOT_RETAINED NS_RETURNS_INNER_POINTER NS_DESIGNATED_INITIALIZER NS_ENUM NS_OPTIONS NS_REQUIRES_NIL_TERMINATION NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_END NS_SWIFT_NAME NS_REFINED_FOR_SWIFT",A=k("int long char short double float unsigned signed void bool"),$=k("SEL instancetype id Class Protocol BOOL");function ue(g){return I(A,g)||/.+_t$/.test(g)}function O(g){return ue(g)||I($,g)}var w="case do else for if switch while struct enum union",M="struct enum union";function N(g,y){if(!y.startOfLine)return!1;for(var j,de=null;j=g.peek();){if(j=="\\"&&g.match(/^.$/)){de=N;break}else if(j=="/"&&g.match(/^\/[\/\*]/,!1))break;g.next()}return y.tokenize=de,"meta"}function z(g,y){return y.prevToken=="type"?"type":!1}function X(g){return!g||g.length<2||g[0]!="_"?!1:g[1]=="_"||g[1]!==g[1].toLowerCase()}function q(g){return g.eatWhile(/[\w\.']/),"number"}function p(g,y){if(g.backUp(1),g.match(/^(?:R|u8R|uR|UR|LR)/)){var j=g.match(/^"([^\s\\()]{0,16})\(/);return j?(y.cpp11RawStringDelim=j[1],y.tokenize=P,P(g,y)):!1}return g.match(/^(?:u8|u|U|L)/)?g.match(/^["']/,!1)?"string":!1:(g.next(),!1)}function W(g){var y=/(\w+)::~?(\w+)$/.exec(g);return y&&y[1]==y[2]}function J(g,y){for(var j;(j=g.next())!=null;)if(j=='"'&&!g.eat('"')){y.tokenize=null;break}return"string"}function P(g,y){var j=y.cpp11RawStringDelim.replace(/[^\w\s]/g,"\\$&"),de=g.match(new RegExp(".*?\\)"+j+'"'));return de?y.tokenize=null:g.skipToEnd(),"string"}function V(g,y){typeof g=="string"&&(g=[g]);var j=[];function de(d){if(d)for(var fe in d)d.hasOwnProperty(fe)&&j.push(fe)}de(y.keywords),de(y.types),de(y.builtin),de(y.atoms),j.length&&(y.helperType=g[0],b.registerHelper("hintWords",g[0],j));for(var v=0;v<g.length;++v)b.defineMIME(g[v],y)}V(["text/x-csrc","text/x-c","text/x-chdr"],{name:"clike",keywords:k(Y),types:ue,blockKeywords:k(w),defKeywords:k(M),typeFirstDefinitions:!0,atoms:k("NULL true false"),isReservedIdentifier:X,hooks:{"#":N,"*":z},modeProps:{fold:["brace","include"]}}),V(["text/x-c++src","text/x-c++hdr"],{name:"clike",keywords:k(Y+" "+ne),types:ue,blockKeywords:k(w+" class try catch"),defKeywords:k(M+" class namespace"),typeFirstDefinitions:!0,atoms:k("true false NULL nullptr"),dontIndentStatements:/^template$/,isIdentifierChar:/[\w\$_~\xa1-\uffff]/,isReservedIdentifier:X,hooks:{"#":N,"*":z,u:p,U:p,L:p,R:p,0:q,1:q,2:q,3:q,4:q,5:q,6:q,7:q,8:q,9:q,token:function(g,y,j){if(j=="variable"&&g.peek()=="("&&(y.prevToken==";"||y.prevToken==null||y.prevToken=="}")&&W(g.current()))return"def"}},namespaceSeparator:"::",modeProps:{fold:["brace","include"]}}),V("text/x-java",{name:"clike",keywords:k("abstract assert break case catch class const continue default do else enum extends final finally for goto if implements import instanceof interface native new package private protected public return static strictfp super switch synchronized this throw throws transient try volatile while @interface"),types:k("var byte short int long float double boolean char void Boolean Byte Character Double Float Integer Long Number Object Short String StringBuffer StringBuilder Void"),blockKeywords:k("catch class do else finally for if switch try while"),defKeywords:k("class interface enum @interface"),typeFirstDefinitions:!0,atoms:k("true false null"),number:/^(?:0x[a-f\d_]+|0b[01_]+|(?:[\d_]+\.?\d*|\.\d+)(?:e[-+]?[\d_]+)?)(u|ll?|l|f)?/i,hooks:{"@":function(g){return g.match("interface",!1)?!1:(g.eatWhile(/[\w\$_]/),"meta")},'"':function(g,y){return g.match(/""$/)?(y.tokenize=F,y.tokenize(g,y)):!1}},modeProps:{fold:["brace","import"]}}),V("text/x-csharp",{name:"clike",keywords:k("abstract as async await base break case catch checked class const continue default delegate do else enum event explicit extern finally fixed for foreach goto if implicit in init interface internal is lock namespace new operator out override params private protected public readonly record ref required return sealed sizeof stackalloc static struct switch this throw try typeof unchecked unsafe using virtual void volatile while add alias ascending descending dynamic from get global group into join let orderby partial remove select set value var yield"),types:k("Action Boolean Byte Char DateTime DateTimeOffset Decimal Double Func Guid Int16 Int32 Int64 Object SByte Single String Task TimeSpan UInt16 UInt32 UInt64 bool byte char decimal double short int long object sbyte float string ushort uint ulong"),blockKeywords:k("catch class do else finally for foreach if struct switch try while"),defKeywords:k("class interface namespace record struct var"),typeFirstDefinitions:!0,atoms:k("true false null"),hooks:{"@":function(g,y){return g.eat('"')?(y.tokenize=J,J(g,y)):(g.eatWhile(/[\w\$_]/),"meta")}}});function F(g,y){for(var j=!1;!g.eol();){if(!j&&g.match('"""')){y.tokenize=null;break}j=g.next()=="\\"&&!j}return"string"}function G(g){return function(y,j){for(var de;de=y.next();)if(de=="*"&&y.eat("/"))if(g==1){j.tokenize=null;break}else return j.tokenize=G(g-1),j.tokenize(y,j);else if(de=="/"&&y.eat("*"))return j.tokenize=G(g+1),j.tokenize(y,j);return"comment"}}V("text/x-scala",{name:"clike",keywords:k("abstract case catch class def do else extends final finally for forSome if implicit import lazy match new null object override package private protected return sealed super this throw trait try type val var while with yield _ assert assume require print println printf readLine readBoolean readByte readShort readChar readInt readLong readFloat readDouble"),types:k("AnyVal App Application Array BufferedIterator BigDecimal BigInt Char Console Either Enumeration Equiv Error Exception Fractional Function IndexedSeq Int Integral Iterable Iterator List Map Numeric Nil NotNull Option Ordered Ordering PartialFunction PartialOrdering Product Proxy Range Responder Seq Serializable Set Specializable Stream StringBuilder StringContext Symbol Throwable Traversable TraversableOnce Tuple Unit Vector Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable Compiler Double Exception Float Integer Long Math Number Object Package Pair Process Runtime Runnable SecurityManager Short StackTraceElement StrictMath String StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void"),multiLineStrings:!0,blockKeywords:k("catch class enum do else finally for forSome if match switch try while"),defKeywords:k("class enum def object package trait type val var"),atoms:k("true false null"),indentStatements:!1,indentSwitch:!1,isOperatorChar:/[+\-*&%=<>!?|\/#:@]/,hooks:{"@":function(g){return g.eatWhile(/[\w\$_]/),"meta"},'"':function(g,y){return g.match('""')?(y.tokenize=F,y.tokenize(g,y)):!1},"'":function(g){return g.match(/^(\\[^'\s]+|[^\\'])'/)?"string-2":(g.eatWhile(/[\w\$_\xa1-\uffff]/),"atom")},"=":function(g,y){var j=y.context;return j.type=="}"&&j.align&&g.eat(">")?(y.context=new pe(j.indented,j.column,j.type,j.info,null,j.prev),"operator"):!1},"/":function(g,y){return g.eat("*")?(y.tokenize=G(1),y.tokenize(g,y)):!1}},modeProps:{closeBrackets:{pairs:'()[]{}""',triples:'"'}}});function c(g){return function(y,j){for(var de=!1,v,d=!1;!y.eol();){if(!g&&!de&&y.match('"')){d=!0;break}if(g&&y.match('"""')){d=!0;break}v=y.next(),!de&&v=="$"&&y.match("{")&&y.skipTo("}"),de=!de&&v=="\\"&&!g}return(d||!g)&&(j.tokenize=null),"string"}}V("text/x-kotlin",{name:"clike",keywords:k("package as typealias class interface this super val operator var fun for is in This throw return annotation break continue object if else while do try when !in !is as? file import where by get set abstract enum open inner override private public internal protected catch finally out final vararg reified dynamic companion constructor init sealed field property receiver param sparam lateinit data inline noinline tailrec external annotation crossinline const operator infix suspend actual expect setparam value"),types:k("Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable Compiler Double Exception Float Integer Long Math Number Object Package Pair Process Runtime Runnable SecurityManager Short StackTraceElement StrictMath String StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void Annotation Any BooleanArray ByteArray Char CharArray DeprecationLevel DoubleArray Enum FloatArray Function Int IntArray Lazy LazyThreadSafetyMode LongArray Nothing ShortArray Unit"),intendSwitch:!1,indentStatements:!1,multiLineStrings:!0,number:/^(?:0x[a-f\d_]+|0b[01_]+|(?:[\d_]+(\.\d+)?|\.\d+)(?:e[-+]?[\d_]+)?)(u|ll?|l|f)?/i,blockKeywords:k("catch class do else finally for if where try while enum"),defKeywords:k("class val var object interface fun"),atoms:k("true false null this"),hooks:{"@":function(g){return g.eatWhile(/[\w\$_]/),"meta"},"*":function(g,y){return y.prevToken=="."?"variable":"operator"},'"':function(g,y){return y.tokenize=c(g.match('""')),y.tokenize(g,y)},"/":function(g,y){return g.eat("*")?(y.tokenize=G(1),y.tokenize(g,y)):!1},indent:function(g,y,j,de){var v=j&&j.charAt(0);if((g.prevToken=="}"||g.prevToken==")")&&j=="")return g.indented;if(g.prevToken=="operator"&&j!="}"&&g.context.type!="}"||g.prevToken=="variable"&&v=="."||(g.prevToken=="}"||g.prevToken==")")&&v==".")return de*2+y.indented;if(y.align&&y.type=="}")return y.indented+(g.context.type==(j||"").charAt(0)?0:de)}},modeProps:{closeBrackets:{triples:'"'}}}),V(["x-shader/x-vertex","x-shader/x-fragment"],{name:"clike",keywords:k("sampler1D sampler2D sampler3D samplerCube sampler1DShadow sampler2DShadow const attribute uniform varying break continue discard return for while do if else struct in out inout"),types:k("float int bool void vec2 vec3 vec4 ivec2 ivec3 ivec4 bvec2 bvec3 bvec4 mat2 mat3 mat4"),blockKeywords:k("for while do if else struct"),builtin:k("radians degrees sin cos tan asin acos atan pow exp log exp2 sqrt inversesqrt abs sign floor ceil fract mod min max clamp mix step smoothstep length distance dot cross normalize ftransform faceforward reflect refract matrixCompMult lessThan lessThanEqual greaterThan greaterThanEqual equal notEqual any all not texture1D texture1DProj texture1DLod texture1DProjLod texture2D texture2DProj texture2DLod texture2DProjLod texture3D texture3DProj texture3DLod texture3DProjLod textureCube textureCubeLod shadow1D shadow2D shadow1DProj shadow2DProj shadow1DLod shadow2DLod shadow1DProjLod shadow2DProjLod dFdx dFdy fwidth noise1 noise2 noise3 noise4"),atoms:k("true false gl_FragColor gl_SecondaryColor gl_Normal gl_Vertex gl_MultiTexCoord0 gl_MultiTexCoord1 gl_MultiTexCoord2 gl_MultiTexCoord3 gl_MultiTexCoord4 gl_MultiTexCoord5 gl_MultiTexCoord6 gl_MultiTexCoord7 gl_FogCoord gl_PointCoord gl_Position gl_PointSize gl_ClipVertex gl_FrontColor gl_BackColor gl_FrontSecondaryColor gl_BackSecondaryColor gl_TexCoord gl_FogFragCoord gl_FragCoord gl_FrontFacing gl_FragData gl_FragDepth gl_ModelViewMatrix gl_ProjectionMatrix gl_ModelViewProjectionMatrix gl_TextureMatrix gl_NormalMatrix gl_ModelViewMatrixInverse gl_ProjectionMatrixInverse gl_ModelViewProjectionMatrixInverse gl_TextureMatrixTranspose gl_ModelViewMatrixInverseTranspose gl_ProjectionMatrixInverseTranspose gl_ModelViewProjectionMatrixInverseTranspose gl_TextureMatrixInverseTranspose gl_NormalScale gl_DepthRange gl_ClipPlane gl_Point gl_FrontMaterial gl_BackMaterial gl_LightSource gl_LightModel gl_FrontLightModelProduct gl_BackLightModelProduct gl_TextureColor gl_EyePlaneS gl_EyePlaneT gl_EyePlaneR gl_EyePlaneQ gl_FogParameters gl_MaxLights gl_MaxClipPlanes gl_MaxTextureUnits gl_MaxTextureCoords gl_MaxVertexAttribs gl_MaxVertexUniformComponents gl_MaxVaryingFloats gl_MaxVertexTextureImageUnits gl_MaxTextureImageUnits gl_MaxFragmentUniformComponents gl_MaxCombineTextureImageUnits gl_MaxDrawBuffers"),indentSwitch:!1,hooks:{"#":N},modeProps:{fold:["brace","include"]}}),V("text/x-nesc",{name:"clike",keywords:k(Y+" as atomic async call command component components configuration event generic implementation includes interface module new norace nx_struct nx_union post provides signal task uses abstract extends"),types:ue,blockKeywords:k(w),atoms:k("null true false"),hooks:{"#":N},modeProps:{fold:["brace","include"]}}),V("text/x-objectivec",{name:"clike",keywords:k(Y+" "+S),types:O,builtin:k(R),blockKeywords:k(w+" @synthesize @try @catch @finally @autoreleasepool @synchronized"),defKeywords:k(M+" @interface @implementation @protocol @class"),dontIndentStatements:/^@.*$/,typeFirstDefinitions:!0,atoms:k("YES NO NULL Nil nil true false nullptr"),isReservedIdentifier:X,hooks:{"#":N,"*":z},modeProps:{fold:["brace","include"]}}),V("text/x-objectivec++",{name:"clike",keywords:k(Y+" "+S+" "+ne),types:O,builtin:k(R),blockKeywords:k(w+" @synthesize @try @catch @finally @autoreleasepool @synchronized class try catch"),defKeywords:k(M+" @interface @implementation @protocol @class class namespace"),dontIndentStatements:/^@.*$|^template$/,typeFirstDefinitions:!0,atoms:k("YES NO NULL Nil nil true false nullptr"),isReservedIdentifier:X,hooks:{"#":N,"*":z,u:p,U:p,L:p,R:p,0:q,1:q,2:q,3:q,4:q,5:q,6:q,7:q,8:q,9:q,token:function(g,y,j){if(j=="variable"&&g.peek()=="("&&(y.prevToken==";"||y.prevToken==null||y.prevToken=="}")&&W(g.current()))return"def"}},namespaceSeparator:"::",modeProps:{fold:["brace","include"]}}),V("text/x-squirrel",{name:"clike",keywords:k("base break clone continue const default delete enum extends function in class foreach local resume return this throw typeof yield constructor instanceof static"),types:ue,blockKeywords:k("case catch class else for foreach if switch try while"),defKeywords:k("function local class"),typeFirstDefinitions:!0,atoms:k("true false null"),hooks:{"#":N},modeProps:{fold:["brace","include"]}});var T=null;function C(g){return function(y,j){for(var de=!1,v,d=!1;!y.eol();){if(!de&&y.match('"')&&(g=="single"||y.match('""'))){d=!0;break}if(!de&&y.match("``")){T=C(g),d=!0;break}v=y.next(),de=g=="single"&&!de&&v=="\\"}return d&&(j.tokenize=null),"string"}}V("text/x-ceylon",{name:"clike",keywords:k("abstracts alias assembly assert assign break case catch class continue dynamic else exists extends finally for function given if import in interface is let module new nonempty object of out outer package return satisfies super switch then this throw try value void while"),types:function(g){var y=g.charAt(0);return y===y.toUpperCase()&&y!==y.toLowerCase()},blockKeywords:k("case catch class dynamic else finally for function if interface module new object switch try while"),defKeywords:k("class dynamic function interface module object package value"),builtin:k("abstract actual aliased annotation by default deprecated doc final formal late license native optional sealed see serializable shared suppressWarnings tagged throws variable"),isPunctuationChar:/[\[\]{}\(\),;\:\.`]/,isOperatorChar:/[+\-*&%=<>!?|^~:\/]/,numberStart:/[\d#$]/,number:/^(?:#[\da-fA-F_]+|\$[01_]+|[\d_]+[kMGTPmunpf]?|[\d_]+\.[\d_]+(?:[eE][-+]?\d+|[kMGTPmunpf]|)|)/i,multiLineStrings:!0,typeFirstDefinitions:!0,atoms:k("true false null larger smaller equal empty finished"),indentSwitch:!1,styleDefs:!1,hooks:{"@":function(g){return g.eatWhile(/[\w\$_]/),"meta"},'"':function(g,y){return y.tokenize=C(g.match('""')?"triple":"single"),y.tokenize(g,y)},"`":function(g,y){return!T||!g.match("`")?!1:(y.tokenize=T,T=null,y.tokenize(g,y))},"'":function(g){return g.eatWhile(/[\w\$_\xa1-\uffff]/),"atom"},token:function(g,y,j){if((j=="variable"||j=="type")&&y.prevToken==".")return"variable-2"}},modeProps:{fold:["brace","import"],closeBrackets:{triples:'"'}}})})})()),Ta.exports}tf();var Da={exports:{}},Ma={exports:{}},Fa;function rf(){return Fa||(Fa=1,(function(ct,xt){(function(b){b(mt())})(function(b){b.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-encrypted","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["asc","pgp","sig"]},{name:"ASN.1",mime:"text/x-ttcn-asn",mode:"asn.1",ext:["asn","asn1"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"Brainfuck",mime:"text/x-brainfuck",mode:"brainfuck",ext:["b","bf"]},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h","ino"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy","cbl"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp","cs"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj","cljc","cljx"]},{name:"ClojureScript",mime:"text/x-clojurescript",mode:"clojure",ext:["cljs"]},{name:"Closure Stylesheets (GSS)",mime:"text/x-gss",mode:"css",ext:["gss"]},{name:"CMake",mime:"text/x-cmake",mode:"cmake",ext:["cmake","cmake.in"],file:/^CMakeLists\.txt$/},{name:"CoffeeScript",mimes:["application/vnd.coffeescript","text/coffeescript","text/x-coffeescript"],mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"Crystal",mime:"text/x-crystal",mode:"crystal",ext:["cr"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"edn",mime:"application/edn",mode:"clojure",ext:["edn"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Elm",mime:"text/x-elm",mode:"elm",ext:["elm"]},{name:"Embedded JavaScript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Esper",mime:"text/x-esper",mode:"sql"},{name:"Factor",mime:"text/x-factor",mode:"factor",ext:["factor"]},{name:"FCL",mime:"text/x-fcl",mode:"fcl"},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90","f95"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history)\.md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy","gradle"],file:/^Jenkinsfile$/},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haskell (Literate)",mime:"text/x-literate-haskell",mode:"haskell-literate",ext:["lhs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm","handlebars","hbs"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Pug",mime:"text/x-pug",mode:"pug",ext:["jade","pug"],alias:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"JSX",mime:"text/jsx",mode:"jsx",ext:["jsx"]},{name:"Jinja2",mime:"text/jinja2",mode:"jinja2",ext:["j2","jinja","jinja2"]},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"],alias:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"clike",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb","wl","wls"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps",ext:["mps"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"mbox",mime:"application/mbox",mode:"mbox",ext:["mbox"]},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NSIS",mime:"text/x-nsis",mode:"nsis",ext:["nsh","nsi"]},{name:"NTriples",mimes:["application/n-triples","application/n-quads","text/n-triples"],mode:"ntriples",ext:["nt","nq"]},{name:"Objective-C",mime:"text/x-objectivec",mode:"clike",ext:["m"],alias:["objective-c","objc"]},{name:"Objective-C++",mime:"text/x-objectivec++",mode:"clike",ext:["mm"],alias:["objective-c++","objc++"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Oz",mime:"text/x-oz",mode:"oz",ext:["oz"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mimes:["text/x-php","application/x-httpd-php","application/x-httpd-php-open"],mode:"php",ext:["php","php3","php4","php5","php7","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"PostgreSQL",mime:"text/x-pgsql",mode:"sql"},{name:"PowerShell",mime:"application/x-powershell",mode:"powershell",ext:["ps1","psd1","psm1"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"ProtoBuf",mime:"text/x-protobuf",mode:"protobuf",ext:["proto"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["BUILD","bzl","py","pyw"],file:/^(BUCK|BUILD)$/},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r","R"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"SAS",mime:"text/x-sas",mode:"sas",ext:["sas"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mimes:["text/x-sh","application/x-sh"],mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"],file:/^PKGBUILD$/},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"SML",mime:"text/x-sml",mode:"mllike",ext:["sml","sig","fun","smackspec"]},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"SQLite",mime:"text/x-sqlite",mode:"sql"},{name:"Squirrel",mime:"text/x-squirrel",mode:"clike",ext:["nut"]},{name:"Stylus",mime:"text/x-styl",mode:"stylus",ext:["styl"]},{name:"Swift",mime:"text/x-swift",mode:"swift",ext:["swift"]},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx","tex"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v","sv","svh"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"text/troff",mode:"troff",ext:["1","2","3","4","5","6","7","8","9"]},{name:"TTCN",mime:"text/x-ttcn",mode:"ttcn",ext:["ttcn","ttcn3","ttcnpp"]},{name:"TTCN_CFG",mime:"text/x-ttcn-cfg",mode:"ttcn-cfg",ext:["cfg"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"TypeScript-JSX",mime:"text/typescript-jsx",mode:"jsx",ext:["tsx"],alias:["tsx"]},{name:"Twig",mime:"text/x-twig",mode:"twig"},{name:"Web IDL",mime:"text/x-webidl",mode:"webidl",ext:["webidl"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"VHDL",mime:"text/x-vhdl",mode:"vhdl",ext:["vhd","vhdl"]},{name:"Vue.js Component",mimes:["script/x-vue","text/x-vue"],mode:"vue",ext:["vue"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd","svg"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"Yacas",mime:"text/x-yacas",mode:"yacas",ext:["ys"]},{name:"YAML",mimes:["text/x-yaml","text/yaml"],mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]},{name:"mscgen",mime:"text/x-mscgen",mode:"mscgen",ext:["mscgen","mscin","msc"]},{name:"xu",mime:"text/x-xu",mode:"mscgen",ext:["xu"]},{name:"msgenny",mime:"text/x-msgenny",mode:"mscgen",ext:["msgenny"]},{name:"WebAssembly",mime:"text/webassembly",mode:"wast",ext:["wat","wast"]}];for(var pe=0;pe<b.modeInfo.length;pe++){var _=b.modeInfo[pe];_.mimes&&(_.mime=_.mimes[0])}b.findModeByMIME=function(te){te=te.toLowerCase();for(var oe=0;oe<b.modeInfo.length;oe++){var Q=b.modeInfo[oe];if(Q.mime==te)return Q;if(Q.mimes){for(var k=0;k<Q.mimes.length;k++)if(Q.mimes[k]==te)return Q}}if(/\+xml$/.test(te))return b.findModeByMIME("application/xml");if(/\+json$/.test(te))return b.findModeByMIME("application/json")},b.findModeByExtension=function(te){te=te.toLowerCase();for(var oe=0;oe<b.modeInfo.length;oe++){var Q=b.modeInfo[oe];if(Q.ext){for(var k=0;k<Q.ext.length;k++)if(Q.ext[k]==te)return Q}}},b.findModeByFileName=function(te){for(var oe=0;oe<b.modeInfo.length;oe++){var Q=b.modeInfo[oe];if(Q.file&&Q.file.test(te))return Q}var k=te.lastIndexOf("."),I=k>-1&&te.substring(k+1,te.length);if(I)return b.findModeByExtension(I)},b.findModeByName=function(te){te=te.toLowerCase();for(var oe=0;oe<b.modeInfo.length;oe++){var Q=b.modeInfo[oe];if(Q.name.toLowerCase()==te)return Q;if(Q.alias){for(var k=0;k<Q.alias.length;k++)if(Q.alias[k].toLowerCase()==te)return Q}}}})})()),Ma.exports}var Aa;function nf(){return Aa||(Aa=1,(function(ct,xt){(function(b){b(mt(),Ya(),rf())})(function(b){b.defineMode("markdown",function(pe,_){var te=b.getMode(pe,"text/html"),oe=te.name=="null";function Q(v){if(b.findModeByName){var d=b.findModeByName(v);d&&(v=d.mime||d.mimes[0])}var fe=b.getMode(pe,v);return fe.name=="null"?null:fe}_.highlightFormatting===void 0&&(_.highlightFormatting=!1),_.maxBlockquoteDepth===void 0&&(_.maxBlockquoteDepth=0),_.taskLists===void 0&&(_.taskLists=!1),_.strikethrough===void 0&&(_.strikethrough=!1),_.emoji===void 0&&(_.emoji=!1),_.fencedCodeBlockHighlighting===void 0&&(_.fencedCodeBlockHighlighting=!0),_.fencedCodeBlockDefaultMode===void 0&&(_.fencedCodeBlockDefaultMode="text/plain"),_.xml===void 0&&(_.xml=!0),_.tokenTypeOverrides===void 0&&(_.tokenTypeOverrides={});var k={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"image",imageAltText:"image-alt-text",imageMarker:"image-marker",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough",emoji:"builtin"};for(var I in k)k.hasOwnProperty(I)&&_.tokenTypeOverrides[I]&&(k[I]=_.tokenTypeOverrides[I]);var Y=/^([*\-_])(?:\s*\1){2,}\s*$/,ne=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,S=/^\[(x| )\](?=\s)/i,R=_.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,A=/^ {0,3}(?:\={1,}|-{2,})\s*$/,$=/^[^#!\[\]*_\\<>` "'(~:]+/,ue=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,O=/^\s*\[[^\]]+?\]:.*$/,w=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/,M="    ";function N(v,d,fe){return d.f=d.inline=fe,fe(v,d)}function z(v,d,fe){return d.f=d.block=fe,fe(v,d)}function X(v){return!v||!/\S/.test(v.string)}function q(v){if(v.linkTitle=!1,v.linkHref=!1,v.linkText=!1,v.em=!1,v.strong=!1,v.strikethrough=!1,v.quote=0,v.indentedCode=!1,v.f==W){var d=oe;if(!d){var fe=b.innerMode(te,v.htmlState);d=fe.mode.name=="xml"&&fe.state.tagStart===null&&!fe.state.context&&fe.state.tokenize.isInText}d&&(v.f=F,v.block=p,v.htmlState=null)}return v.trailingSpace=0,v.trailingSpaceNewLine=!1,v.prevLine=v.thisLine,v.thisLine={stream:null},null}function p(v,d){var fe=v.column()===d.indentation,Te=X(d.prevLine.stream),le=d.indentedCode,xe=d.prevLine.hr,Me=d.list!==!1,Fe=(d.listStack[d.listStack.length-1]||0)+3;d.indentedCode=!1;var Ce=d.indentation;if(d.indentationDiff===null&&(d.indentationDiff=d.indentation,Me)){for(d.list=null;Ce<d.listStack[d.listStack.length-1];)d.listStack.pop(),d.listStack.length?d.indentation=d.listStack[d.listStack.length-1]:d.list=!1;d.list!==!1&&(d.indentationDiff=Ce-d.listStack[d.listStack.length-1])}var ve=!Te&&!xe&&!d.prevLine.header&&(!Me||!le)&&!d.prevLine.fencedCodeEnd,Oe=(d.list===!1||xe||Te)&&d.indentation<=Fe&&v.match(Y),qe=null;if(d.indentationDiff>=4&&(le||d.prevLine.fencedCodeEnd||d.prevLine.header||Te))return v.skipToEnd(),d.indentedCode=!0,k.code;if(v.eatSpace())return null;if(fe&&d.indentation<=Fe&&(qe=v.match(R))&&qe[1].length<=6)return d.quote=0,d.header=qe[1].length,d.thisLine.header=!0,_.highlightFormatting&&(d.formatting="header"),d.f=d.inline,P(d);if(d.indentation<=Fe&&v.eat(">"))return d.quote=fe?1:d.quote+1,_.highlightFormatting&&(d.formatting="quote"),v.eatSpace(),P(d);if(!Oe&&!d.setext&&fe&&d.indentation<=Fe&&(qe=v.match(ne))){var $e=qe[1]?"ol":"ul";return d.indentation=Ce+v.current().length,d.list=!0,d.quote=0,d.listStack.push(d.indentation),d.em=!1,d.strong=!1,d.code=!1,d.strikethrough=!1,_.taskLists&&v.match(S,!1)&&(d.taskList=!0),d.f=d.inline,_.highlightFormatting&&(d.formatting=["list","list-"+$e]),P(d)}else{if(fe&&d.indentation<=Fe&&(qe=v.match(ue,!0)))return d.quote=0,d.fencedEndRE=new RegExp(qe[1]+"+ *$"),d.localMode=_.fencedCodeBlockHighlighting&&Q(qe[2]||_.fencedCodeBlockDefaultMode),d.localMode&&(d.localState=b.startState(d.localMode)),d.f=d.block=J,_.highlightFormatting&&(d.formatting="code-block"),d.code=-1,P(d);if(d.setext||(!ve||!Me)&&!d.quote&&d.list===!1&&!d.code&&!Oe&&!O.test(v.string)&&(qe=v.lookAhead(1))&&(qe=qe.match(A)))return d.setext?(d.header=d.setext,d.setext=0,v.skipToEnd(),_.highlightFormatting&&(d.formatting="header")):(d.header=qe[0].charAt(0)=="="?1:2,d.setext=d.header),d.thisLine.header=!0,d.f=d.inline,P(d);if(Oe)return v.skipToEnd(),d.hr=!0,d.thisLine.hr=!0,k.hr;if(v.peek()==="[")return N(v,d,g)}return N(v,d,d.inline)}function W(v,d){var fe=te.token(v,d.htmlState);if(!oe){var Te=b.innerMode(te,d.htmlState);(Te.mode.name=="xml"&&Te.state.tagStart===null&&!Te.state.context&&Te.state.tokenize.isInText||d.md_inside&&v.current().indexOf(">")>-1)&&(d.f=F,d.block=p,d.htmlState=null)}return fe}function J(v,d){var fe=d.listStack[d.listStack.length-1]||0,Te=d.indentation<fe,le=fe+3;if(d.fencedEndRE&&d.indentation<=le&&(Te||v.match(d.fencedEndRE))){_.highlightFormatting&&(d.formatting="code-block");var xe;return Te||(xe=P(d)),d.localMode=d.localState=null,d.block=p,d.f=F,d.fencedEndRE=null,d.code=0,d.thisLine.fencedCodeEnd=!0,Te?z(v,d,d.block):xe}else return d.localMode?d.localMode.token(v,d.localState):(v.skipToEnd(),k.code)}function P(v){var d=[];if(v.formatting){d.push(k.formatting),typeof v.formatting=="string"&&(v.formatting=[v.formatting]);for(var fe=0;fe<v.formatting.length;fe++)d.push(k.formatting+"-"+v.formatting[fe]),v.formatting[fe]==="header"&&d.push(k.formatting+"-"+v.formatting[fe]+"-"+v.header),v.formatting[fe]==="quote"&&(!_.maxBlockquoteDepth||_.maxBlockquoteDepth>=v.quote?d.push(k.formatting+"-"+v.formatting[fe]+"-"+v.quote):d.push("error"))}if(v.taskOpen)return d.push("meta"),d.length?d.join(" "):null;if(v.taskClosed)return d.push("property"),d.length?d.join(" "):null;if(v.linkHref?d.push(k.linkHref,"url"):(v.strong&&d.push(k.strong),v.em&&d.push(k.em),v.strikethrough&&d.push(k.strikethrough),v.emoji&&d.push(k.emoji),v.linkText&&d.push(k.linkText),v.code&&d.push(k.code),v.image&&d.push(k.image),v.imageAltText&&d.push(k.imageAltText,"link"),v.imageMarker&&d.push(k.imageMarker)),v.header&&d.push(k.header,k.header+"-"+v.header),v.quote&&(d.push(k.quote),!_.maxBlockquoteDepth||_.maxBlockquoteDepth>=v.quote?d.push(k.quote+"-"+v.quote):d.push(k.quote+"-"+_.maxBlockquoteDepth)),v.list!==!1){var Te=(v.listStack.length-1)%3;Te?Te===1?d.push(k.list2):d.push(k.list3):d.push(k.list1)}return v.trailingSpaceNewLine?d.push("trailing-space-new-line"):v.trailingSpace&&d.push("trailing-space-"+(v.trailingSpace%2?"a":"b")),d.length?d.join(" "):null}function V(v,d){if(v.match($,!0))return P(d)}function F(v,d){var fe=d.text(v,d);if(typeof fe<"u")return fe;if(d.list)return d.list=null,P(d);if(d.taskList){var Te=v.match(S,!0)[1]===" ";return Te?d.taskOpen=!0:d.taskClosed=!0,_.highlightFormatting&&(d.formatting="task"),d.taskList=!1,P(d)}if(d.taskOpen=!1,d.taskClosed=!1,d.header&&v.match(/^#+$/,!0))return _.highlightFormatting&&(d.formatting="header"),P(d);var le=v.next();if(d.linkTitle){d.linkTitle=!1;var xe=le;le==="("&&(xe=")"),xe=(xe+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var Me="^\\s*(?:[^"+xe+"\\\\]+|\\\\\\\\|\\\\.)"+xe;if(v.match(new RegExp(Me),!0))return k.linkHref}if(le==="`"){var Fe=d.formatting;_.highlightFormatting&&(d.formatting="code"),v.eatWhile("`");var Ce=v.current().length;if(d.code==0&&(!d.quote||Ce==1))return d.code=Ce,P(d);if(Ce==d.code){var ve=P(d);return d.code=0,ve}else return d.formatting=Fe,P(d)}else if(d.code)return P(d);if(le==="\\"&&(v.next(),_.highlightFormatting)){var Oe=P(d),qe=k.formatting+"-escape";return Oe?Oe+" "+qe:qe}if(le==="!"&&v.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return d.imageMarker=!0,d.image=!0,_.highlightFormatting&&(d.formatting="image"),P(d);if(le==="["&&d.imageMarker&&v.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return d.imageMarker=!1,d.imageAltText=!0,_.highlightFormatting&&(d.formatting="image"),P(d);if(le==="]"&&d.imageAltText){_.highlightFormatting&&(d.formatting="image");var Oe=P(d);return d.imageAltText=!1,d.image=!1,d.inline=d.f=c,Oe}if(le==="["&&!d.image)return d.linkText&&v.match(/^.*?\]/)||(d.linkText=!0,_.highlightFormatting&&(d.formatting="link")),P(d);if(le==="]"&&d.linkText){_.highlightFormatting&&(d.formatting="link");var Oe=P(d);return d.linkText=!1,d.inline=d.f=v.match(/\(.*?\)| ?\[.*?\]/,!1)?c:F,Oe}if(le==="<"&&v.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){d.f=d.inline=G,_.highlightFormatting&&(d.formatting="link");var Oe=P(d);return Oe?Oe+=" ":Oe="",Oe+k.linkInline}if(le==="<"&&v.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){d.f=d.inline=G,_.highlightFormatting&&(d.formatting="link");var Oe=P(d);return Oe?Oe+=" ":Oe="",Oe+k.linkEmail}if(_.xml&&le==="<"&&v.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var $e=v.string.indexOf(">",v.pos);if($e!=-1){var dt=v.string.substring(v.start,$e);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(dt)&&(d.md_inside=!0)}return v.backUp(1),d.htmlState=b.startState(te),z(v,d,W)}if(_.xml&&le==="<"&&v.match(/^\/\w*?>/))return d.md_inside=!1,"tag";if(le==="*"||le==="_"){for(var Pe=1,_e=v.pos==1?" ":v.string.charAt(v.pos-2);Pe<3&&v.eat(le);)Pe++;var Ue=v.peek()||" ",et=!/\s/.test(Ue)&&(!w.test(Ue)||/\s/.test(_e)||w.test(_e)),we=!/\s/.test(_e)&&(!w.test(_e)||/\s/.test(Ue)||w.test(Ue)),Ie=null,E=null;if(Pe%2&&(!d.em&&et&&(le==="*"||!we||w.test(_e))?Ie=!0:d.em==le&&we&&(le==="*"||!et||w.test(Ue))&&(Ie=!1)),Pe>1&&(!d.strong&&et&&(le==="*"||!we||w.test(_e))?E=!0:d.strong==le&&we&&(le==="*"||!et||w.test(Ue))&&(E=!1)),E!=null||Ie!=null){_.highlightFormatting&&(d.formatting=Ie==null?"strong":E==null?"em":"strong em"),Ie===!0&&(d.em=le),E===!0&&(d.strong=le);var ve=P(d);return Ie===!1&&(d.em=!1),E===!1&&(d.strong=!1),ve}}else if(le===" "&&(v.eat("*")||v.eat("_"))){if(v.peek()===" ")return P(d);v.backUp(1)}if(_.strikethrough){if(le==="~"&&v.eatWhile(le)){if(d.strikethrough){_.highlightFormatting&&(d.formatting="strikethrough");var ve=P(d);return d.strikethrough=!1,ve}else if(v.match(/^[^\s]/,!1))return d.strikethrough=!0,_.highlightFormatting&&(d.formatting="strikethrough"),P(d)}else if(le===" "&&v.match("~~",!0)){if(v.peek()===" ")return P(d);v.backUp(2)}}if(_.emoji&&le===":"&&v.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){d.emoji=!0,_.highlightFormatting&&(d.formatting="emoji");var ee=P(d);return d.emoji=!1,ee}return le===" "&&(v.match(/^ +$/,!1)?d.trailingSpace++:d.trailingSpace&&(d.trailingSpaceNewLine=!0)),P(d)}function G(v,d){var fe=v.next();if(fe===">"){d.f=d.inline=F,_.highlightFormatting&&(d.formatting="link");var Te=P(d);return Te?Te+=" ":Te="",Te+k.linkInline}return v.match(/^[^>]+/,!0),k.linkInline}function c(v,d){if(v.eatSpace())return null;var fe=v.next();return fe==="("||fe==="["?(d.f=d.inline=C(fe==="("?")":"]"),_.highlightFormatting&&(d.formatting="link-string"),d.linkHref=!0,P(d)):"error"}var T={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function C(v){return function(d,fe){var Te=d.next();if(Te===v){fe.f=fe.inline=F,_.highlightFormatting&&(fe.formatting="link-string");var le=P(fe);return fe.linkHref=!1,le}return d.match(T[v]),fe.linkHref=!0,P(fe)}}function g(v,d){return v.match(/^([^\]\\]|\\.)*\]:/,!1)?(d.f=y,v.next(),_.highlightFormatting&&(d.formatting="link"),d.linkText=!0,P(d)):N(v,d,F)}function y(v,d){if(v.match("]:",!0)){d.f=d.inline=j,_.highlightFormatting&&(d.formatting="link");var fe=P(d);return d.linkText=!1,fe}return v.match(/^([^\]\\]|\\.)+/,!0),k.linkText}function j(v,d){return v.eatSpace()?null:(v.match(/^[^\s]+/,!0),v.peek()===void 0?d.linkTitle=!0:v.match(/^(?:\s+(?:"(?:[^"\\]|\\.)+"|'(?:[^'\\]|\\.)+'|\((?:[^)\\]|\\.)+\)))?/,!0),d.f=d.inline=F,k.linkHref+" url")}var de={startState:function(){return{f:p,prevLine:{stream:null},thisLine:{stream:null},block:p,htmlState:null,indentation:0,inline:F,text:V,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,setext:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,emoji:!1,fencedEndRE:null}},copyState:function(v){return{f:v.f,prevLine:v.prevLine,thisLine:v.thisLine,block:v.block,htmlState:v.htmlState&&b.copyState(te,v.htmlState),indentation:v.indentation,localMode:v.localMode,localState:v.localMode?b.copyState(v.localMode,v.localState):null,inline:v.inline,text:v.text,formatting:!1,linkText:v.linkText,linkTitle:v.linkTitle,linkHref:v.linkHref,code:v.code,em:v.em,strong:v.strong,strikethrough:v.strikethrough,emoji:v.emoji,header:v.header,setext:v.setext,hr:v.hr,taskList:v.taskList,list:v.list,listStack:v.listStack.slice(0),quote:v.quote,indentedCode:v.indentedCode,trailingSpace:v.trailingSpace,trailingSpaceNewLine:v.trailingSpaceNewLine,md_inside:v.md_inside,fencedEndRE:v.fencedEndRE}},token:function(v,d){if(d.formatting=!1,v!=d.thisLine.stream){if(d.header=0,d.hr=!1,v.match(/^\s*$/,!0))return q(d),null;if(d.prevLine=d.thisLine,d.thisLine={stream:v},d.taskList=!1,d.trailingSpace=0,d.trailingSpaceNewLine=!1,!d.localState&&(d.f=d.block,d.f!=W)){var fe=v.match(/^\s*/,!0)[0].replace(/\t/g,M).length;if(d.indentation=fe,d.indentationDiff=null,fe>0)return null}}return d.f(v,d)},innerMode:function(v){return v.block==W?{state:v.htmlState,mode:te}:v.localState?{state:v.localState,mode:v.localMode}:{state:v,mode:de}},indent:function(v,d,fe){return v.block==W&&te.indent?te.indent(v.htmlState,d,fe):v.localState&&v.localMode.indent?v.localMode.indent(v.localState,d,fe):b.Pass},blankLine:q,getType:P,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return de},"xml"),b.defineMIME("text/markdown","markdown"),b.defineMIME("text/x-markdown","markdown")})})()),Da.exports}nf();var Na={exports:{}},Ea;function of(){return Ea||(Ea=1,(function(ct,xt){(function(b){b(mt())})(function(b){b.defineOption("placeholder","",function(I,Y,ne){var S=ne&&ne!=b.Init;if(Y&&!S)I.on("blur",oe),I.on("change",Q),I.on("swapDoc",Q),b.on(I.getInputField(),"compositionupdate",I.state.placeholderCompose=function(){te(I)}),Q(I);else if(!Y&&S){I.off("blur",oe),I.off("change",Q),I.off("swapDoc",Q),b.off(I.getInputField(),"compositionupdate",I.state.placeholderCompose),pe(I);var R=I.getWrapperElement();R.className=R.className.replace(" CodeMirror-empty","")}Y&&!I.hasFocus()&&oe(I)});function pe(I){I.state.placeholder&&(I.state.placeholder.parentNode.removeChild(I.state.placeholder),I.state.placeholder=null)}function _(I){pe(I);var Y=I.state.placeholder=document.createElement("pre");Y.style.cssText="height: 0; overflow: visible",Y.style.direction=I.getOption("direction"),Y.className="CodeMirror-placeholder CodeMirror-line-like";var ne=I.getOption("placeholder");typeof ne=="string"&&(ne=document.createTextNode(ne)),Y.appendChild(ne),I.display.lineSpace.insertBefore(Y,I.display.lineSpace.firstChild)}function te(I){setTimeout(function(){var Y=!1;if(I.lineCount()==1){var ne=I.getInputField();Y=ne.nodeName=="TEXTAREA"?!I.getLine(0).length:!/[^\u200b]/.test(ne.querySelector(".CodeMirror-line").textContent)}Y?_(I):pe(I)},20)}function oe(I){k(I)&&_(I)}function Q(I){var Y=I.getWrapperElement(),ne=k(I);Y.className=Y.className.replace(" CodeMirror-empty","")+(ne?" CodeMirror-empty":""),ne?_(I):pe(I)}function k(I){return I.lineCount()===1&&I.getLine(0)===""}})})()),Na.exports}of();var Oa={exports:{}},Pa;function lf(){return Pa||(Pa=1,(function(ct,xt){(function(b){b(mt())})(function(b){b.defineSimpleMode=function(S,R){b.defineMode(S,function(A){return b.simpleMode(A,R)})},b.simpleMode=function(S,R){pe(R,"start");var A={},$=R.meta||{},ue=!1;for(var O in R)if(O!=$&&R.hasOwnProperty(O))for(var w=A[O]=[],M=R[O],N=0;N<M.length;N++){var z=M[N];w.push(new oe(z,R)),(z.indent||z.dedent)&&(ue=!0)}var X={startState:function(){return{state:"start",pending:null,local:null,localState:null,indent:ue?[]:null}},copyState:function(p){var W={state:p.state,pending:p.pending,local:p.local,localState:null,indent:p.indent&&p.indent.slice(0)};p.localState&&(W.localState=b.copyState(p.local.mode,p.localState)),p.stack&&(W.stack=p.stack.slice(0));for(var J=p.persistentStates;J;J=J.next)W.persistentStates={mode:J.mode,spec:J.spec,state:J.state==p.localState?W.localState:b.copyState(J.mode,J.state),next:W.persistentStates};return W},token:Q(A,S),innerMode:function(p){return p.local&&{mode:p.local.mode,state:p.localState}},indent:ne(A,$)};if($)for(var q in $)$.hasOwnProperty(q)&&(X[q]=$[q]);return X};function pe(S,R){if(!S.hasOwnProperty(R))throw new Error("Undefined state "+R+" in simple mode")}function _(S,R){if(!S)return/(?:)/;var A="";return S instanceof RegExp?(S.ignoreCase&&(A="i"),S.unicode&&(A+="u"),S=S.source):S=String(S),new RegExp((R===!1?"":"^")+"(?:"+S+")",A)}function te(S){if(!S)return null;if(S.apply)return S;if(typeof S=="string")return S.replace(/\./g," ");for(var R=[],A=0;A<S.length;A++)R.push(S[A]&&S[A].replace(/\./g," "));return R}function oe(S,R){(S.next||S.push)&&pe(R,S.next||S.push),this.regex=_(S.regex),this.token=te(S.token),this.data=S}function Q(S,R){return function(A,$){if($.pending){var ue=$.pending.shift();return $.pending.length==0&&($.pending=null),A.pos+=ue.text.length,ue.token}if($.local)if($.local.end&&A.match($.local.end)){var O=$.local.endToken||null;return $.local=$.localState=null,O}else{var O=$.local.mode.token(A,$.localState),w;return $.local.endScan&&(w=$.local.endScan.exec(A.current()))&&(A.pos=A.start+w.index),O}for(var M=S[$.state],N=0;N<M.length;N++){var z=M[N],X=(!z.data.sol||A.sol())&&A.match(z.regex);if(X){z.data.next?$.state=z.data.next:z.data.push?(($.stack||($.stack=[])).push($.state),$.state=z.data.push):z.data.pop&&$.stack&&$.stack.length&&($.state=$.stack.pop()),z.data.mode&&I(R,$,z.data.mode,z.token),z.data.indent&&$.indent.push(A.indentation()+R.indentUnit),z.data.dedent&&$.indent.pop();var q=z.token;if(q&&q.apply&&(q=q(X)),X.length>2&&z.token&&typeof z.token!="string"){for(var p=2;p<X.length;p++)X[p]&&($.pending||($.pending=[])).push({text:X[p],token:z.token[p-1]});return A.backUp(X[0].length-(X[1]?X[1].length:0)),q[0]}else return q&&q.join?q[0]:q}}return A.next(),null}}function k(S,R){if(S===R)return!0;if(!S||typeof S!="object"||!R||typeof R!="object")return!1;var A=0;for(var $ in S)if(S.hasOwnProperty($)){if(!R.hasOwnProperty($)||!k(S[$],R[$]))return!1;A++}for(var $ in R)R.hasOwnProperty($)&&A--;return A==0}function I(S,R,A,$){var ue;if(A.persistent)for(var O=R.persistentStates;O&&!ue;O=O.next)(A.spec?k(A.spec,O.spec):A.mode==O.mode)&&(ue=O);var w=ue?ue.mode:A.mode||b.getMode(S,A.spec),M=ue?ue.state:b.startState(w);A.persistent&&!ue&&(R.persistentStates={mode:w,spec:A.spec,state:M,next:R.persistentStates}),R.localState=M,R.local={mode:w,end:A.end&&_(A.end),endScan:A.end&&A.forceEnd!==!1&&_(A.end,!1),endToken:$&&$.join?$[$.length-1]:$}}function Y(S,R){for(var A=0;A<R.length;A++)if(R[A]===S)return!0}function ne(S,R){return function(A,$,ue){if(A.local&&A.local.mode.indent)return A.local.mode.indent(A.localState,$,ue);if(A.indent==null||A.local||R.dontIndentStates&&Y(A.state,R.dontIndentStates)>-1)return b.Pass;var O=A.indent.length-1,w=S[A.state];e:for(;;){for(var M=0;M<w.length;M++){var N=w[M];if(N.data.dedent&&N.data.dedentIfLineStart!==!1){var z=N.regex.exec($);if(z&&z[0]){O--,(N.next||N.push)&&(w=S[N.next||N.push]),$=$.slice(z[0].length);continue e}}}break}return O<0?0:A.indent[O]}}})})()),Oa.exports}lf();var Ia={exports:{}},za;function af(){return za||(za=1,(function(ct,xt){(function(b){b(mt())})(function(b){var pe=/MSIE \d/.test(navigator.userAgent)&&(document.documentMode==null||document.documentMode<8),_=b.Pos,te={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<","<":">>",">":"<<"};function oe(S){return S&&S.bracketRegex||/[(){}[\]]/}function Q(S,R,A){var $=S.getLineHandle(R.line),ue=R.ch-1,O=A&&A.afterCursor;O==null&&(O=/(^| )cm-fat-cursor($| )/.test(S.getWrapperElement().className));var w=oe(A),M=!O&&ue>=0&&w.test($.text.charAt(ue))&&te[$.text.charAt(ue)]||w.test($.text.charAt(ue+1))&&te[$.text.charAt(++ue)];if(!M)return null;var N=M.charAt(1)==">"?1:-1;if(A&&A.strict&&N>0!=(ue==R.ch))return null;var z=S.getTokenTypeAt(_(R.line,ue+1)),X=k(S,_(R.line,ue+(N>0?1:0)),N,z,A);return X==null?null:{from:_(R.line,ue),to:X&&X.pos,match:X&&X.ch==M.charAt(0),forward:N>0}}function k(S,R,A,$,ue){for(var O=ue&&ue.maxScanLineLength||1e4,w=ue&&ue.maxScanLines||1e3,M=[],N=oe(ue),z=A>0?Math.min(R.line+w,S.lastLine()+1):Math.max(S.firstLine()-1,R.line-w),X=R.line;X!=z;X+=A){var q=S.getLine(X);if(q){var p=A>0?0:q.length-1,W=A>0?q.length:-1;if(!(q.length>O))for(X==R.line&&(p=R.ch-(A<0?1:0));p!=W;p+=A){var J=q.charAt(p);if(N.test(J)&&($===void 0||(S.getTokenTypeAt(_(X,p+1))||"")==($||""))){var P=te[J];if(P&&P.charAt(1)==">"==A>0)M.push(J);else if(M.length)M.pop();else return{pos:_(X,p),ch:J}}}}}return X-A==(A>0?S.lastLine():S.firstLine())?!1:null}function I(S,R,A){for(var $=S.state.matchBrackets.maxHighlightLineLength||1e3,ue=A&&A.highlightNonMatching,O=[],w=S.listSelections(),M=0;M<w.length;M++){var N=w[M].empty()&&Q(S,w[M].head,A);if(N&&(N.match||ue!==!1)&&S.getLine(N.from.line).length<=$){var z=N.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket";O.push(S.markText(N.from,_(N.from.line,N.from.ch+1),{className:z})),N.to&&S.getLine(N.to.line).length<=$&&O.push(S.markText(N.to,_(N.to.line,N.to.ch+1),{className:z}))}}if(O.length){pe&&S.state.focused&&S.focus();var X=function(){S.operation(function(){for(var q=0;q<O.length;q++)O[q].clear()})};if(R)setTimeout(X,800);else return X}}function Y(S){S.operation(function(){S.state.matchBrackets.currentlyHighlighted&&(S.state.matchBrackets.currentlyHighlighted(),S.state.matchBrackets.currentlyHighlighted=null),S.state.matchBrackets.currentlyHighlighted=I(S,!1,S.state.matchBrackets)})}function ne(S){S.state.matchBrackets&&S.state.matchBrackets.currentlyHighlighted&&(S.state.matchBrackets.currentlyHighlighted(),S.state.matchBrackets.currentlyHighlighted=null)}b.defineOption("matchBrackets",!1,function(S,R,A){A&&A!=b.Init&&(S.off("cursorActivity",Y),S.off("focus",Y),S.off("blur",ne),ne(S)),R&&(S.state.matchBrackets=typeof R=="object"?R:{},S.on("cursorActivity",Y),S.on("focus",Y),S.on("blur",ne))}),b.defineExtension("matchBrackets",function(){I(this,!0)}),b.defineExtension("findMatchingBracket",function(S,R,A){return(A||typeof R=="boolean")&&(A?(A.strict=R,R=A):R=R?{strict:!0}:null),Q(this,S,R)}),b.defineExtension("scanForBracket",function(S,R,A,$){return k(this,S,R,A,$)})})})()),Ia.exports}af();var Ba={exports:{}},Ra;function sf(){return Ra||(Ra=1,(function(ct,xt){(function(b){b(mt())})(function(b){var pe={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},_=b.Pos;b.defineOption("autoCloseBrackets",!1,function(O,w,M){M&&M!=b.Init&&(O.removeKeyMap(oe),O.state.closeBrackets=null),w&&(Q(te(w,"pairs")),O.state.closeBrackets=w,O.addKeyMap(oe))});function te(O,w){return w=="pairs"&&typeof O=="string"?O:typeof O=="object"&&O[w]!=null?O[w]:pe[w]}var oe={Backspace:Y,Enter:ne};function Q(O){for(var w=0;w<O.length;w++){var M=O.charAt(w),N="'"+M+"'";oe[N]||(oe[N]=k(M))}}Q(pe.pairs+"`");function k(O){return function(w){return A(w,O)}}function I(O){var w=O.state.closeBrackets;if(!w||w.override)return w;var M=O.getModeAt(O.getCursor());return M.closeBrackets||w}function Y(O){var w=I(O);if(!w||O.getOption("disableInput"))return b.Pass;for(var M=te(w,"pairs"),N=O.listSelections(),z=0;z<N.length;z++){if(!N[z].empty())return b.Pass;var X=$(O,N[z].head);if(!X||M.indexOf(X)%2!=0)return b.Pass}for(var z=N.length-1;z>=0;z--){var q=N[z].head;O.replaceRange("",_(q.line,q.ch-1),_(q.line,q.ch+1),"+delete")}}function ne(O){var w=I(O),M=w&&te(w,"explode");if(!M||O.getOption("disableInput"))return b.Pass;for(var N=O.listSelections(),z=0;z<N.length;z++){if(!N[z].empty())return b.Pass;var X=$(O,N[z].head);if(!X||M.indexOf(X)%2!=0)return b.Pass}O.operation(function(){var q=O.lineSeparator()||`
`;O.replaceSelection(q+q,null),S(O,-1),N=O.listSelections();for(var p=0;p<N.length;p++){var W=N[p].head.line;O.indentLine(W,null,!0),O.indentLine(W+1,null,!0)}})}function S(O,w){for(var M=[],N=O.listSelections(),z=0,X=0;X<N.length;X++){var q=N[X];q.head==O.getCursor()&&(z=X);var p=q.head.ch||w>0?{line:q.head.line,ch:q.head.ch+w}:{line:q.head.line-1};M.push({anchor:p,head:p})}O.setSelections(M,z)}function R(O){var w=b.cmpPos(O.anchor,O.head)>0;return{anchor:new _(O.anchor.line,O.anchor.ch+(w?-1:1)),head:new _(O.head.line,O.head.ch+(w?1:-1))}}function A(O,w){var M=I(O);if(!M||O.getOption("disableInput"))return b.Pass;var N=te(M,"pairs"),z=N.indexOf(w);if(z==-1)return b.Pass;for(var X=te(M,"closeBefore"),q=te(M,"triples"),p=N.charAt(z+1)==w,W=O.listSelections(),J=z%2==0,P,V=0;V<W.length;V++){var F=W[V],G=F.head,c,T=O.getRange(G,_(G.line,G.ch+1));if(J&&!F.empty())c="surround";else if((p||!J)&&T==w)p&&ue(O,G)?c="both":q.indexOf(w)>=0&&O.getRange(G,_(G.line,G.ch+3))==w+w+w?c="skipThree":c="skip";else if(p&&G.ch>1&&q.indexOf(w)>=0&&O.getRange(_(G.line,G.ch-2),G)==w+w){if(G.ch>2&&/\bstring/.test(O.getTokenTypeAt(_(G.line,G.ch-2))))return b.Pass;c="addFour"}else if(p){var C=G.ch==0?" ":O.getRange(_(G.line,G.ch-1),G);if(!b.isWordChar(T)&&C!=w&&!b.isWordChar(C))c="both";else return b.Pass}else if(J&&(T.length===0||/\s/.test(T)||X.indexOf(T)>-1))c="both";else return b.Pass;if(!P)P=c;else if(P!=c)return b.Pass}var g=z%2?N.charAt(z-1):w,y=z%2?w:N.charAt(z+1);O.operation(function(){if(P=="skip")S(O,1);else if(P=="skipThree")S(O,3);else if(P=="surround"){for(var j=O.getSelections(),de=0;de<j.length;de++)j[de]=g+j[de]+y;O.replaceSelections(j,"around"),j=O.listSelections().slice();for(var de=0;de<j.length;de++)j[de]=R(j[de]);O.setSelections(j)}else P=="both"?(O.replaceSelection(g+y,null),O.triggerElectric(g+y),S(O,-1)):P=="addFour"&&(O.replaceSelection(g+g+g+g,"before"),S(O,1))})}function $(O,w){var M=O.getRange(_(w.line,w.ch-1),_(w.line,w.ch+1));return M.length==2?M:null}function ue(O,w){var M=O.getTokenAt(_(w.line,w.ch+1));return/\bstring/.test(M.type)&&M.start==w.ch&&(w.ch==0||!/\bstring/.test(O.getTokenTypeAt(w)))}})})()),Ba.exports}sf();var Wa={exports:{}},Ha={exports:{}},_a;function Ja(){return _a||(_a=1,(function(ct,xt){(function(b){b(mt())})(function(b){var pe=b.Pos;function _(w){var M=w.flags;return M??(w.ignoreCase?"i":"")+(w.global?"g":"")+(w.multiline?"m":"")}function te(w,M){for(var N=_(w),z=N,X=0;X<M.length;X++)z.indexOf(M.charAt(X))==-1&&(z+=M.charAt(X));return N==z?w:new RegExp(w.source,z)}function oe(w){return/\\s|\\n|\n|\\W|\\D|\[\^/.test(w.source)}function Q(w,M,N){M=te(M,"g");for(var z=N.line,X=N.ch,q=w.lastLine();z<=q;z++,X=0){M.lastIndex=X;var p=w.getLine(z),W=M.exec(p);if(W)return{from:pe(z,W.index),to:pe(z,W.index+W[0].length),match:W}}}function k(w,M,N){if(!oe(M))return Q(w,M,N);M=te(M,"gm");for(var z,X=1,q=N.line,p=w.lastLine();q<=p;){for(var W=0;W<X&&!(q>p);W++){var J=w.getLine(q++);z=z==null?J:z+`
`+J}X=X*2,M.lastIndex=N.ch;var P=M.exec(z);if(P){var V=z.slice(0,P.index).split(`
`),F=P[0].split(`
`),G=N.line+V.length-1,c=V[V.length-1].length;return{from:pe(G,c),to:pe(G+F.length-1,F.length==1?c+F[0].length:F[F.length-1].length),match:P}}}}function I(w,M,N){for(var z,X=0;X<=w.length;){M.lastIndex=X;var q=M.exec(w);if(!q)break;var p=q.index+q[0].length;if(p>w.length-N)break;(!z||p>z.index+z[0].length)&&(z=q),X=q.index+1}return z}function Y(w,M,N){M=te(M,"g");for(var z=N.line,X=N.ch,q=w.firstLine();z>=q;z--,X=-1){var p=w.getLine(z),W=I(p,M,X<0?0:p.length-X);if(W)return{from:pe(z,W.index),to:pe(z,W.index+W[0].length),match:W}}}function ne(w,M,N){if(!oe(M))return Y(w,M,N);M=te(M,"gm");for(var z,X=1,q=w.getLine(N.line).length-N.ch,p=N.line,W=w.firstLine();p>=W;){for(var J=0;J<X&&p>=W;J++){var P=w.getLine(p--);z=z==null?P:P+`
`+z}X*=2;var V=I(z,M,q);if(V){var F=z.slice(0,V.index).split(`
`),G=V[0].split(`
`),c=p+F.length,T=F[F.length-1].length;return{from:pe(c,T),to:pe(c+G.length-1,G.length==1?T+G[0].length:G[G.length-1].length),match:V}}}}var S,R;String.prototype.normalize?(S=function(w){return w.normalize("NFD").toLowerCase()},R=function(w){return w.normalize("NFD")}):(S=function(w){return w.toLowerCase()},R=function(w){return w});function A(w,M,N,z){if(w.length==M.length)return N;for(var X=0,q=N+Math.max(0,w.length-M.length);;){if(X==q)return X;var p=X+q>>1,W=z(w.slice(0,p)).length;if(W==N)return p;W>N?q=p:X=p+1}}function $(w,M,N,z){if(!M.length)return null;var X=z?S:R,q=X(M).split(/\r|\n\r?/);e:for(var p=N.line,W=N.ch,J=w.lastLine()+1-q.length;p<=J;p++,W=0){var P=w.getLine(p).slice(W),V=X(P);if(q.length==1){var F=V.indexOf(q[0]);if(F==-1)continue e;var N=A(P,V,F,X)+W;return{from:pe(p,A(P,V,F,X)+W),to:pe(p,A(P,V,F+q[0].length,X)+W)}}else{var G=V.length-q[0].length;if(V.slice(G)!=q[0])continue e;for(var c=1;c<q.length-1;c++)if(X(w.getLine(p+c))!=q[c])continue e;var T=w.getLine(p+q.length-1),C=X(T),g=q[q.length-1];if(C.slice(0,g.length)!=g)continue e;return{from:pe(p,A(P,V,G,X)+W),to:pe(p+q.length-1,A(T,C,g.length,X))}}}}function ue(w,M,N,z){if(!M.length)return null;var X=z?S:R,q=X(M).split(/\r|\n\r?/);e:for(var p=N.line,W=N.ch,J=w.firstLine()-1+q.length;p>=J;p--,W=-1){var P=w.getLine(p);W>-1&&(P=P.slice(0,W));var V=X(P);if(q.length==1){var F=V.lastIndexOf(q[0]);if(F==-1)continue e;return{from:pe(p,A(P,V,F,X)),to:pe(p,A(P,V,F+q[0].length,X))}}else{var G=q[q.length-1];if(V.slice(0,G.length)!=G)continue e;for(var c=1,N=p-q.length+1;c<q.length-1;c++)if(X(w.getLine(N+c))!=q[c])continue e;var T=w.getLine(p+1-q.length),C=X(T);if(C.slice(C.length-q[0].length)!=q[0])continue e;return{from:pe(p+1-q.length,A(T,C,T.length-q[0].length,X)),to:pe(p,A(P,V,G.length,X))}}}}function O(w,M,N,z){this.atOccurrence=!1,this.afterEmptyMatch=!1,this.doc=w,N=N?w.clipPos(N):pe(0,0),this.pos={from:N,to:N};var X;typeof z=="object"?X=z.caseFold:(X=z,z=null),typeof M=="string"?(X==null&&(X=!1),this.matches=function(q,p){return(q?ue:$)(w,M,p,X)}):(M=te(M,"gm"),!z||z.multiline!==!1?this.matches=function(q,p){return(q?ne:k)(w,M,p)}:this.matches=function(q,p){return(q?Y:Q)(w,M,p)})}O.prototype={findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(w){var M=this.doc.clipPos(w?this.pos.from:this.pos.to);if(this.afterEmptyMatch&&this.atOccurrence&&(M=pe(M.line,M.ch),w?(M.ch--,M.ch<0&&(M.line--,M.ch=(this.doc.getLine(M.line)||"").length)):(M.ch++,M.ch>(this.doc.getLine(M.line)||"").length&&(M.ch=0,M.line++)),b.cmpPos(M,this.doc.clipPos(M))!=0))return this.atOccurrence=!1;var N=this.matches(w,M);if(this.afterEmptyMatch=N&&b.cmpPos(N.from,N.to)==0,N)return this.pos=N,this.atOccurrence=!0,this.pos.match||!0;var z=pe(w?this.doc.firstLine():this.doc.lastLine()+1,0);return this.pos={from:z,to:z},this.atOccurrence=!1},from:function(){if(this.atOccurrence)return this.pos.from},to:function(){if(this.atOccurrence)return this.pos.to},replace:function(w,M){if(this.atOccurrence){var N=b.splitLines(w);this.doc.replaceRange(N,this.pos.from,this.pos.to,M),this.pos.to=pe(this.pos.from.line+N.length-1,N[N.length-1].length+(N.length==1?this.pos.from.ch:0))}}},b.defineExtension("getSearchCursor",function(w,M,N){return new O(this.doc,w,M,N)}),b.defineDocExtension("getSearchCursor",function(w,M,N){return new O(this,w,M,N)}),b.defineExtension("selectMatches",function(w,M){for(var N=[],z=this.getSearchCursor(w,this.getCursor("from"),M);z.findNext()&&!(b.cmpPos(z.to(),this.getCursor("to"))>0);)N.push({anchor:z.from(),head:z.to()});N.length&&this.setSelections(N,0)})})})()),Ha.exports}var qa={exports:{}},ja;function po(){return ja||(ja=1,(function(ct,xt){(function(b){b(mt())})(function(b){function pe(te,oe,Q){var k=te.getWrapperElement(),I;return I=k.appendChild(document.createElement("div")),Q?I.className="CodeMirror-dialog CodeMirror-dialog-bottom":I.className="CodeMirror-dialog CodeMirror-dialog-top",typeof oe=="string"?I.innerHTML=oe:I.appendChild(oe),b.addClass(k,"dialog-opened"),I}function _(te,oe){te.state.currentNotificationClose&&te.state.currentNotificationClose(),te.state.currentNotificationClose=oe}b.defineExtension("openDialog",function(te,oe,Q){Q||(Q={}),_(this,null);var k=pe(this,te,Q.bottom),I=!1,Y=this;function ne(A){if(typeof A=="string")S.value=A;else{if(I)return;I=!0,b.rmClass(k.parentNode,"dialog-opened"),k.parentNode.removeChild(k),Y.focus(),Q.onClose&&Q.onClose(k)}}var S=k.getElementsByTagName("input")[0],R;return S?(S.focus(),Q.value&&(S.value=Q.value,Q.selectValueOnOpen!==!1&&S.select()),Q.onInput&&b.on(S,"input",function(A){Q.onInput(A,S.value,ne)}),Q.onKeyUp&&b.on(S,"keyup",function(A){Q.onKeyUp(A,S.value,ne)}),b.on(S,"keydown",function(A){Q&&Q.onKeyDown&&Q.onKeyDown(A,S.value,ne)||((A.keyCode==27||Q.closeOnEnter!==!1&&A.keyCode==13)&&(S.blur(),b.e_stop(A),ne()),A.keyCode==13&&oe(S.value,A))}),Q.closeOnBlur!==!1&&b.on(k,"focusout",function(A){A.relatedTarget!==null&&ne()})):(R=k.getElementsByTagName("button")[0])&&(b.on(R,"click",function(){ne(),Y.focus()}),Q.closeOnBlur!==!1&&b.on(R,"blur",ne),R.focus()),ne}),b.defineExtension("openConfirm",function(te,oe,Q){_(this,null);var k=pe(this,te,Q&&Q.bottom),I=k.getElementsByTagName("button"),Y=!1,ne=this,S=1;function R(){Y||(Y=!0,b.rmClass(k.parentNode,"dialog-opened"),k.parentNode.removeChild(k),ne.focus())}I[0].focus();for(var A=0;A<I.length;++A){var $=I[A];(function(ue){b.on($,"click",function(O){b.e_preventDefault(O),R(),ue&&ue(ne)})})(oe[A]),b.on($,"blur",function(){--S,setTimeout(function(){S<=0&&R()},200)}),b.on($,"focus",function(){++S})}}),b.defineExtension("openNotification",function(te,oe){_(this,ne);var Q=pe(this,te,oe&&oe.bottom),k=!1,I,Y=oe&&typeof oe.duration<"u"?oe.duration:5e3;function ne(){k||(k=!0,clearTimeout(I),b.rmClass(Q.parentNode,"dialog-opened"),Q.parentNode.removeChild(Q))}return b.on(Q,"click",function(S){b.e_preventDefault(S),ne()}),Y&&(I=setTimeout(ne,Y)),ne})})})()),qa.exports}var Ka;function uf(){return Ka||(Ka=1,(function(ct,xt){(function(b){b(mt(),Ja(),po())})(function(b){b.defineOption("search",{bottom:!1});function pe(p,W){return typeof p=="string"?p=new RegExp(p.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),W?"gi":"g"):p.global||(p=new RegExp(p.source,p.ignoreCase?"gi":"g")),{token:function(J){p.lastIndex=J.pos;var P=p.exec(J.string);if(P&&P.index==J.pos)return J.pos+=P[0].length||1,"searching";P?J.pos=P.index:J.skipToEnd()}}}function _(){this.posFrom=this.posTo=this.lastQuery=this.query=null,this.overlay=null}function te(p){return p.state.search||(p.state.search=new _)}function oe(p){return typeof p=="string"&&p==p.toLowerCase()}function Q(p,W,J){return p.getSearchCursor(W,J,{caseFold:oe(W),multiline:!0})}function k(p,W,J,P,V){p.openDialog(W,P,{value:J,selectValueOnOpen:!0,closeOnEnter:!1,onClose:function(){ue(p)},onKeyDown:V,bottom:p.options.search.bottom})}function I(p,W,J,P,V){p.openDialog?p.openDialog(W,V,{value:P,selectValueOnOpen:!0,bottom:p.options.search.bottom}):V(prompt(J,P))}function Y(p,W,J,P){p.openConfirm?p.openConfirm(W,P):confirm(J)&&P[0]()}function ne(p){return p.replace(/\\([nrt\\])/g,function(W,J){return J=="n"?`
`:J=="r"?"\r":J=="t"?"	":J=="\\"?"\\":W})}function S(p){var W=p.match(/^\/(.*)\/([a-z]*)$/);if(W)try{p=new RegExp(W[1],W[2].indexOf("i")==-1?"":"i")}catch{}else p=ne(p);return(typeof p=="string"?p=="":p.test(""))&&(p=/x^/),p}function R(p,W,J){W.queryText=J,W.query=S(J),p.removeOverlay(W.overlay,oe(W.query)),W.overlay=pe(W.query,oe(W.query)),p.addOverlay(W.overlay),p.showMatchesOnScrollbar&&(W.annotate&&(W.annotate.clear(),W.annotate=null),W.annotate=p.showMatchesOnScrollbar(W.query,oe(W.query)))}function A(p,W,J,P){var V=te(p);if(V.query)return $(p,W);var F=p.getSelection()||V.lastQuery;if(F instanceof RegExp&&F.source=="x^"&&(F=null),J&&p.openDialog){var G=null,c=function(T,C){b.e_stop(C),T&&(T!=V.queryText&&(R(p,V,T),V.posFrom=V.posTo=p.getCursor()),G&&(G.style.opacity=1),$(p,C.shiftKey,function(g,y){var j;y.line<3&&document.querySelector&&(j=p.display.wrapper.querySelector(".CodeMirror-dialog"))&&j.getBoundingClientRect().bottom-4>p.cursorCoords(y,"window").top&&((G=j).style.opacity=.4)}))};k(p,w(p),F,c,function(T,C){var g=b.keyName(T),y=p.getOption("extraKeys"),j=y&&y[g]||b.keyMap[p.getOption("keyMap")][g];j=="findNext"||j=="findPrev"||j=="findPersistentNext"||j=="findPersistentPrev"?(b.e_stop(T),R(p,te(p),C),p.execCommand(j)):(j=="find"||j=="findPersistent")&&(b.e_stop(T),c(C,T))}),P&&F&&(R(p,V,F),$(p,W))}else I(p,w(p),"Search for:",F,function(T){T&&!V.query&&p.operation(function(){R(p,V,T),V.posFrom=V.posTo=p.getCursor(),$(p,W)})})}function $(p,W,J){p.operation(function(){var P=te(p),V=Q(p,P.query,W?P.posFrom:P.posTo);!V.find(W)&&(V=Q(p,P.query,W?b.Pos(p.lastLine()):b.Pos(p.firstLine(),0)),!V.find(W))||(p.setSelection(V.from(),V.to()),p.scrollIntoView({from:V.from(),to:V.to()},20),P.posFrom=V.from(),P.posTo=V.to(),J&&J(V.from(),V.to()))})}function ue(p){p.operation(function(){var W=te(p);W.lastQuery=W.query,W.query&&(W.query=W.queryText=null,p.removeOverlay(W.overlay),W.annotate&&(W.annotate.clear(),W.annotate=null))})}function O(p,W){var J=p?document.createElement(p):document.createDocumentFragment();for(var P in W)J[P]=W[P];for(var V=2;V<arguments.length;V++){var F=arguments[V];J.appendChild(typeof F=="string"?document.createTextNode(F):F)}return J}function w(p){var W=O("label",{className:"CodeMirror-search-label"},p.phrase("Search:"),O("input",{type:"text",style:"width: 10em",className:"CodeMirror-search-field",id:"CodeMirror-search-field"}));return W.setAttribute("for","CodeMirror-search-field"),O("",null,W," ",O("span",{style:"color: #666",className:"CodeMirror-search-hint"},p.phrase("(Use /re/ syntax for regexp search)")))}function M(p){return O("",null," ",O("input",{type:"text",style:"width: 10em",className:"CodeMirror-search-field"})," ",O("span",{style:"color: #666",className:"CodeMirror-search-hint"},p.phrase("(Use /re/ syntax for regexp search)")))}function N(p){return O("",null,O("span",{className:"CodeMirror-search-label"},p.phrase("With:"))," ",O("input",{type:"text",style:"width: 10em",className:"CodeMirror-search-field"}))}function z(p){return O("",null,O("span",{className:"CodeMirror-search-label"},p.phrase("Replace?"))," ",O("button",{},p.phrase("Yes"))," ",O("button",{},p.phrase("No"))," ",O("button",{},p.phrase("All"))," ",O("button",{},p.phrase("Stop")))}function X(p,W,J){p.operation(function(){for(var P=Q(p,W);P.findNext();)if(typeof W!="string"){var V=p.getRange(P.from(),P.to()).match(W);P.replace(J.replace(/\$(\d)/g,function(F,G){return V[G]}))}else P.replace(J)})}function q(p,W){if(!p.getOption("readOnly")){var J=p.getSelection()||te(p).lastQuery,P=W?p.phrase("Replace all:"):p.phrase("Replace:"),V=O("",null,O("span",{className:"CodeMirror-search-label"},P),M(p));I(p,V,P,J,function(F){F&&(F=S(F),I(p,N(p),p.phrase("Replace with:"),"",function(G){if(G=ne(G),W)X(p,F,G);else{ue(p);var c=Q(p,F,p.getCursor("from")),T=function(){var g=c.from(),y;!(y=c.findNext())&&(c=Q(p,F),!(y=c.findNext())||g&&c.from().line==g.line&&c.from().ch==g.ch)||(p.setSelection(c.from(),c.to()),p.scrollIntoView({from:c.from(),to:c.to()}),Y(p,z(p),p.phrase("Replace?"),[function(){C(y)},T,function(){X(p,F,G)}]))},C=function(g){c.replace(typeof F=="string"?G:G.replace(/\$(\d)/g,function(y,j){return g[j]})),T()};T()}}))})}}b.commands.find=function(p){ue(p),A(p)},b.commands.findPersistent=function(p){ue(p),A(p,!1,!0)},b.commands.findPersistentNext=function(p){A(p,!1,!0,!0)},b.commands.findPersistentPrev=function(p){A(p,!0,!0,!0)},b.commands.findNext=A,b.commands.findPrev=function(p){A(p,!0)},b.commands.clearSearch=ue,b.commands.replace=q,b.commands.replaceAll=function(p){q(p,!0)}})})()),Wa.exports}uf();Ja();var Ua={exports:{}},Ga;function ff(){return Ga||(Ga=1,(function(ct,xt){(function(b){b(mt(),po())})(function(b){b.defineOption("search",{bottom:!1});function pe(oe,Q,k,I,Y){oe.openDialog?oe.openDialog(Q,Y,{value:I,selectValueOnOpen:!0,bottom:oe.options.search.bottom}):Y(prompt(k,I))}function _(oe){return oe.phrase("Jump to line:")+' <input type="text" style="width: 10em" class="CodeMirror-search-field"/> <span style="color: #888" class="CodeMirror-search-hint">'+oe.phrase("(Use line:column or scroll% syntax)")+"</span>"}function te(oe,Q){var k=Number(Q);return/^[-+]/.test(Q)?oe.getCursor().line+k:k-1}b.commands.jumpToLine=function(oe){var Q=oe.getCursor();pe(oe,_(oe),oe.phrase("Jump to line:"),Q.line+1+":"+Q.ch,function(k){if(k){var I;if(I=/^\s*([\+\-]?\d+)\s*\:\s*(\d+)\s*$/.exec(k))oe.setCursor(te(oe,I[1]),Number(I[2]));else if(I=/^\s*([\+\-]?\d+(\.\d+)?)\%\s*/.exec(k)){var Y=Math.round(oe.lineCount()*Number(I[1])/100);/^[-+]/.test(I[1])&&(Y=Q.line+Y+1),oe.setCursor(Y-1,Q.ch)}else(I=/^\s*\:?\s*([\+\-]?\d+)\s*/.exec(k))&&oe.setCursor(te(oe,I[1]),Q.ch)}})},b.keyMap.default["Alt-G"]="jumpToLine"})})()),Ua.exports}ff();po();export{df as default};
     €  0GSUB ‹%z  8   TOS/27OKG  Œ   `cmapC›?{  	$  Þglyfòm(y  '¤  ÷headX— S   à   6hhea[ù   ¼   $hmtxAÿú  ì  8loca‹ÇV  $  žmaxpï�      name“÷¹K ¸  øpostcFÂ  °  $   ,    ,ÿÿÿþ.               Î      Tûùq_<õ ,    |%°€    |%°€ÿÿÿý.-             Îu         
 
   ÿ          
 0 > DFLT latn                      liga                     +�    Ë Ò   * Ë Ò   �  M                         PfEd Àê`ñ,   G                     ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,ÿÿ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,ÿÿ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,ÿÿ,  ,  ,  ,  ,  ,  ,  ,ÿÿ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,ÿÿ,  ,  ,  ,ÿÿ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,           ,     &           ,  
  & ô      êˆêŒêÇêÉë	ëNì4ñÿÿ  ê`êŠê�êÉêÌëëPñÿÿ                   b f Ö ÖPÖž    ñJG ´7•%nt NÃ`ji ‘ 60 † Ï þ A“ y ¾ › ˆC¨ É ¦ ¼ € ‹‘yˆ†z‰�‹„ ¾�    
            \ ] ^ _ b c " # $ % & ) + , - . / 0 2 3 4 5 < 9 = > ? @ B C F H I K U V W X g i k n r t u v w x z { | } ~  � ‚ „ … ‡ ‰ Œ � � “ ” • – — ˜ ™ š œ ž Ÿ   ¡ ¢ £ ¥ ¨ © ª ” « ¬ ® ¸ ¹ ½ À Ä Å È Ê Ë Ì Í Ó Ô Õ Ö × Ø Ù Ú ï ò ó ö ù ú û ü  (,-./123456;<=>?@ABDFHIKLNOPQRYZ[\]_defhkmqrsuv{|}~�‚ƒ…‡ŠŒŽ—˜¡¢¤¦§©ª«¬­±³´µ¸¹º¼½ÄÅÆÇÈÌÍ ô õ ÷ ø ` a p : q d� o s m [ ' (	 � ’ Æ²   e îU’* ºcb"w+9 Z» D
 Ž Á ÿ: *)! 7 8 J”¶°®¯ °SV lÉËÊš›œ�žŸ™  S$ �Â j Ñ Ý Ü Û Q P O  Ò ¯ ± Y hX ¤ f  Â Ã'   ! ý · í Þ ß ä â ã æ ç é ë ì á à– Î8 Š    	 ê å è  Ç ;   M ² ³^ Lap Ð£¥ Gl §¿ 1&E R ðMo ƒ €xg · µ ¶ÁÀ EWT T » ¿#  ­                                                                                                                                                                                                                                                                         ¸      Î  ê`  ê`     êa  êa   ñ  êb  êb  J  êc  êc  G  êd  êd   ´  êe  êe  7  êf  êf  •  êg  êg  %  êh  êh  n  êi  êi    êj  êj  t  êk  êk   N  êl  êl  Ã  êm  êm  `  ên  ên  j  êo  êo  i  êp  êp   ‘  êq  êq   6  êr  êr  0  ês  ês   †  êt  êt   Ï  êu  êu   þ  êv  êv   A  êw  êw  “  êx  êx   y  êy  êy     êz  êz  ¾  ê{  ê{   ›  ê|  ê|   ˆ  ê}  ê}  C  ê~  ê~    ê  ê    ê€  ê€    ê�  ê�  ¨  ê‚  ê‚   É  êƒ  êƒ   ¦  ê„  ê„   ¼  ê…  ê…     ê†  ê†  €  ê‡  ê‡   ‹  êˆ  êˆ  ‘  êŠ  êŠ  y  ê‹  ê‹  ˆ  êŒ  êŒ  †  ê�  ê�  z  ê�  ê�  ‰  ê‘  ê‘  �  ê’  ê’  ‹  ê“  ê“  „  ê”  ê”   ¾  ê•  ê•    ê–  ê–  �  ê—  ê—     ê˜  ê˜     ê™  ê™     êš  êš   
  ê›  ê›     êœ  êœ     ê�  ê�     êž  êž     êŸ  êŸ     ê   ê      ê¡  ê¡     ê¢  ê¢     ê£  ê£     ê¤  ê¤     ê¥  ê¥     ê¦  ê¦   \  ê§  ê§   ]  ê¨  ê¨   ^  ê©  ê©   _  êª  êª   b  ê«  ê«   c  ê¬  ê¬   "  ê­  ê­   #  ê®  ê®   $  ê¯  ê¯   %  ê°  ê°   &  ê±  ê±   )  ê²  ê²   +  ê³  ê³   ,  ê´  ê´   -  êµ  êµ   .  ê¶  ê¶   /  ê·  ê·   0  ê¸  ê¸   2  ê¹  ê¹   3  êº  êº   4  ê»  ê»   5  ê¼  ê¼   <  ê½  ê½   9  ê¾  ê¾   =  ê¿  ê¿   >  êÀ  êÀ   ?  êÁ  êÁ   @  êÂ  êÂ   B  êÃ  êÃ   C  êÄ  êÄ   F  êÅ  êÅ   H  êÆ  êÆ   I  êÇ  êÇ   K  êÉ  êÉ   U  êÌ  êÌ   V  êÍ  êÍ   W  êÎ  êÎ   X  êÏ  êÏ   g  êÐ  êÐ   i  êÑ  êÑ   k  êÒ  êÒ   n  êÓ  êÓ   r  êÔ  êÔ   t  êÕ  êÕ   u  êÖ  êÖ   v  ê×  ê×   w  êØ  êØ   x  êÙ  êÙ   z  êÚ  êÚ   {  êÛ  êÛ   |  êÜ  êÜ   }  êÝ  êÝ   ~  êÞ  êÞ     êß  êß   �  êà  êà   ‚  êá  êá   „  êâ  êâ   …  êã  êã   ‡  êä  êä   ‰  êå  êå   Œ  êæ  êæ   �  êç  êç   �  êè  êè   “  êé  êé   ”  êê  êê   •  êë  êë   –  êì  êì   —  êí  êí   ˜  êî  êî   ™  êï  êï   š  êð  êð   œ  êñ  êñ   ž  êò  êò   Ÿ  êó  êó      êô  êô   ¡  êõ  êõ   ¢  êö  êö   £  ê÷  ê÷   ¥  êø  êø   ¨  êù  êù   ©  êú  êú   ª  êû  êû   ”  êü  êü   «  êý  êý   ¬  êþ  êþ   ®  êÿ  êÿ   ¸  ë   ë    ¹  ë  ë   ½  ë  ë   À  ë  ë   Ä  ë  ë   Å  ë  ë   È  ë  ë   Ê  ë  ë   Ë  ë  ë   Ì  ë	  ë	   Í  ë  ë   Ó  ë  ë   Ô  ë  ë   Õ  ë  ë   Ö  ë  ë   ×  ë  ë   Ø  ë  ë   Ù  ë  ë   Ú  ë  ë   ï  ë  ë   ò  ë  ë   ó  ë  ë   ö  ë  ë   ù  ë  ë   ú  ë  ë   û  ë  ë   ü  ë  ë     ë  ë    ë  ë    ë  ë    ë  ë    ë   ë     ë!  ë!    ë"  ë"    ë#  ë#    ë$  ë$    ë%  ë%    ë&  ë&    ë'  ë'    ë(  ë(    ë)  ë)    ë*  ë*     ë+  ë+  (  ë,  ë,  ,  ë-  ë-  -  ë.  ë.  .  ë/  ë/  /  ë0  ë0  1  ë1  ë1  2  ë2  ë2  3  ë3  ë3  4  ë4  ë4  5  ë5  ë5  6  ë6  ë6  ;  ë7  ë7  <  ë8  ë8  =  ë9  ë9  >  ë:  ë:  ?  ë;  ë;  @  ë<  ë<  A  ë=  ë=  B  ë>  ë>  D  ë?  ë?  F  ë@  ë@  H  ëA  ëA  I  ëB  ëB  K  ëC  ëC  L  ëD  ëD  N  ëE  ëE  O  ëF  ëF  P  ëG  ëG  Q  ëH  ëH  R  ëI  ëI  Y  ëJ  ëJ  Z  ëK  ëK  [  ëL  ëL  \  ëM  ëM  ]  ëN  ëN  _  ëP  ëP  d  ëQ  ëQ  e  ëR  ëR  f  ëS  ëS  h  ëT  ëT  k  ëU  ëU  m  ëV  ëV  q  ëW  ëW  r  ëX  ëX  s  ëY  ëY  u  ëZ  ëZ  v  ë[  ë[  {  ë\  ë\  |  ë]  ë]  }  ë^  ë^  ~  ë_  ë_  �  ë`  ë`  ‚  ëa  ëa  ƒ  ëb  ëb  …  ëc  ëc  ‡  ëd  ëd  Š  ëe  ëe  Œ  ëf  ëf  Ž  ëg  ëg  —  ëh  ëh  ˜  ëi  ëi  ¡  ëj  ëj  ¢  ëk  ëk  ¤  ël  ël  ¦  ëm  ëm  §  ën  ën  ©  ëo  ëo  ª  ëp  ëp  «  ëq  ëq  ¬  ër  ër  ­  ës  ës  ±  ët  ët  ³  ëu  ëu  ´  ëv  ëv  µ  ëw  ëw  ¸  ëx  ëx  ¹  ëy  ëy  º  ëz  ëz  ¼  ë{  ë{  ½  ë|  ë|  Ä  ë}  ë}  Å  ë~  ë~  Æ  ë  ë  Ç  ë€  ë€  È  ë�  ë�  Ì  ë‚  ë‚  Í  ëƒ  ëƒ   ô  ë„  ë„   õ  ë…  ë…   ÷  ë†  ë†   ø  ë‡  ë‡   `  ëˆ  ëˆ   a  ë‰  ë‰   p  ëŠ  ëŠ   :  ë‹  ë‹   q  ëŒ  ëŒ   d  ë�  ë�  �  ëŽ  ëŽ   o  ë�  ë�   s  ë�  ë�   m  ë‘  ë‘   [  ë’  ë’   '  ë“  ë“   (  ë”  ë”  	  ë•  ë•   �  ë–  ë–   ’  ë—  ë—   Æ  ë˜  ë˜  ²  ë™  ë™     ëš  ëš     ë›  ë›   e  ëœ  ëœ   î  ë�  ë�    ëž  ëž  U  ëŸ  ëŸ  ’  ë   ë   *  ë¡  ë¡   º  ë¢  ë¢  c  ë£  ë£  b  ë¤  ë¤  "  ë¥  ë¥  w  ë¦  ë¦  +  ë§  ë§  9  ë¨  ë¨   Z  ë©  ë©  »  ëª  ëª   D  ë«  ë«  
  ë¬  ë¬   Ž  ë­  ë­   Á  ë®  ë®   ÿ  ë¯  ë¯    ë°  ë°  :  ë±  ë±   *  ë²  ë²  )  ë³  ë³  !  ë´  ë´   7  ëµ  ëµ   8  ë¶  ë¶   J  ë·  ë·  ”  ë¸  ë¸  ¶  ë¹  ë¹  °  ëº  ëº  ®  ë»  ë»  ¯  ë¼  ë¼   °  ë½  ë½  S  ë¾  ë¾  V  ë¿  ë¿    ëÀ  ëÀ   l  ëÁ  ëÁ  É  ëÂ  ëÂ  Ë  ëÃ  ëÃ  Ê  ëÄ  ëÄ  š  ëÅ  ëÅ  ›  ëÆ  ëÆ  œ  ëÇ  ëÇ  �  ëÈ  ëÈ  ž  ëÉ  ëÉ  Ÿ  ëÊ  ëÊ  ™  ëË  ëË     ëÌ  ëÌ   S  ëÍ  ëÍ  $  ëÎ  ëÎ   �  ëÏ  ëÏ  Â  ëÐ  ëÐ   j  ëÑ  ëÑ   Ñ  ëÒ  ëÒ   Ý  ëÓ  ëÓ   Ü  ëÔ  ëÔ   Û  ëÕ  ëÕ   Q  ëÖ  ëÖ   P  ë×  ë×   O  ëØ  ëØ     ëÙ  ëÙ   Ò  ëÚ  ëÚ   ¯  ëÛ  ëÛ   ±  ëÜ  ëÜ   Y  ëÝ  ëÝ   h  ëÞ  ëÞ  X  ëß  ëß   ¤  ëà  ëà   f  ëá  ëá     ëâ  ëâ   Â  ëã  ëã   Ã  ëä  ëä  '  ëå  ëå      ëæ  ëæ   !  ëç  ëç   ý  ëè  ëè     ëé  ëé  ·  ëê  ëê    ëë  ëë   í  ëì  ëì   Þ  ëí  ëí   ß  ëî  ëî   ä  ëï  ëï   â  ëð  ëð   ã  ëñ  ëñ   æ  ëò  ëò   ç  ëó  ëó   é  ëô  ëô   ë  ëõ  ëõ   ì  ëö  ëö   á  ë÷  ë÷   à  ëø  ëø  –  ëù  ëù   Î  ëú  ëú  8  ëû  ëû   Š  ëü  ëü     ëý  ëý     ëþ  ëþ     ëÿ  ëÿ   	  ì   ì    ê  ì  ì   å  ì  ì   è  ì  ì     ì  ì   Ç  ì  ì    ì  ì    ì  ì   ;  ì  ì     ì	  ì	     ì
  ì
   M  ì  ì   ²  ì  ì   ³  ì  ì  ^  ì  ì   L  ì  ì  a  ì  ì  p  ì  ì   Ð  ì  ì    ì  ì  £  ì  ì  ¥  ì  ì   G  ì  ì  l  ì  ì   §  ì  ì  ¿  ì  ì   1  ì  ì  &  ì  ì    ì  ì    ì  ì  E  ì  ì   R  ì  ì   ð  ì   ì   M  ì!  ì!  o  ì"  ì"   ƒ  ì#  ì#   €  ì$  ì$  x  ì%  ì%  g  ì&  ì&   ·  ì'  ì'   µ  ì(  ì(   ¶  ì)  ì)  Á  ì*  ì*  À  ì+  ì+   E  ì,  ì,  W  ì-  ì-  T  ì.  ì.   T  ì/  ì/   »  ì0  ì0    ì1  ì1    ì2  ì2   ¿  ì3  ì3  #  ì4  ì4     ñ  ñ   ­       ” Ô è2l¦à.BVj~’¦ÈÞ8ŠäfÌjj˜ê¦Zš$Bª		Ô
ˆ
Î
öPbt†˜àú6b�ô*>fŽü.|¶Ð&€È&²Þbœð&J¸`8Ž¸Ä6ŠôT¶ì(8HThvš2Lš
6H‚Ìü>Zp¢Äè4´ä
Xvœ¼à6Xˆºæ0\„¼–Èâ  x º!!z!²""l"´"ú#:# #Â#ð$$$¢$À$Ü$ø%F%„%¸%æ&X&Ê'B'Ž'¸(8(^(ä)x)ô*|*Æ+
+ž+Þ,,J,ˆ-*-¤-È.b.ä/"/l/€/Æ/ê00V0|0Ú1
1l1¨1Ö22|2¬2Ê33L3p3Þ444p4 4î5¦5Ø6>6¦6ú7<7j7‚7š7¸7à88&8D8b8€8˜8¶8Î8ì999V9’9ä:~:¾:â;D;\;x<<&<F<x<Ü<ú=L=x=¦=ì>>2>J>d>�>¼>â??r?Œ?â@@d@Ž@ÊAABAvAÆAøB&B`B~BÂBêCpCªD$DnEREŠE¼F"FFF”FÔG6GŽGÊHHdHÜI0I‚I˜IÈJJFJ^J†J¦KK:KÄL"L„L¶MM2M˜MÈMîNFNbNpO*O�O´P.PªPðQ`Q˜QÐR(RVR†SSpSÌT&TNTrT–TîUU2U†UâVV\V‚V¶VðW:W˜WÊWèX$X°YY”YúZZZÐ[[B[œ\\V\Â]J^^.^L_:_l_‚_¨_ò`8`X`Š`Îa^a€aºaúbbJblb¢c8clc˜cÞd–dÀe@e|eæffHf¾fúg>g€g¼hhNh¦hÊii¬jlmºmæn
nvnžnÊnâoobo�oâp€pºpÊpÚpêpúqZqšqÚr$rjrÚssRsØttt¤töu(uduºuüvHvhvÚww`wºwÚxxDxžx¼y€yðz’{
{N{Š     ÿÿ,,  " 4 d  %4."2?>"'7>32'&4>2'.0=.'&'67676'6.".54>2,(ERE(&\&–)"

"X	‡	

	#<H<#–)E((E)!<

<b

	‹		[	


	0$<##<$0          (  %4'>7.&#>32"2>4.#""#	
%²''.''Å%
	%"'.''.'         %##5#5353qpp©pppp           #3375375#5353'#3ô		
	Î
		×áÏ¼&pp	8
Ÿ		Ÿ
8/&&©––q         Ì   7'573'7'78(88(¼(88(ƒ(89((98(       	  #  7537#'74."2>'".4>2e(&88°3>33>3,2,,2,”(lj&7733>33,,2,,        	  $  7'35#7'72.>"2>4.”(lj&7733>33,,2,,e(&88°3>33>3,2,,2,      	  #  7#375'.>2'2>4."˜(lj&7733>33,,2,,Ç(&88¯3>33>3,2,,2,       	  #  ?357'#.>24."2>e(&88°3>33>3,2,,2,˜(lj&7733>33,,2,,        	  737'5#';^^NNƒ]]NÄÄN      ó 	  77'35#7ƒ]]NÄÄNò^^MN      ñ 	  ?5'#3©^^NÃÃN(]]NN      É á 	  7#'7537É//Š//hh      Ñ Ï 	  7'573#z//iic//      Ñ Ï 	  7'7#53'¢//hhÎ//      É á 	  ?3'#5^//²//ii      	   7'573#?5'#3O<<,éé,�<<,éé,<<,,v<<,,      	  %'#735^^NM©^^NÃÃN         %  ?62"&4?64&"2?>.26m0"‚tt(‚((m�h .|oo&|&&

h           %''5'5Af:¨^V%è 5%%K�9%!Ka      "  ' 6  %'.#";26?;2>"/37#3#6/3# K
X
L	7
8X	kl9*WELEL,áá	!+	P4}áá        , 5 =  73&'#7347#75367'535#37632.627'7654&#"8^K$&		pIr*- 	O
N!
9		HNOKKŽ		‰&	 ,*YNFO!        
     %'535#3;26'753#73HpJ
¼
ˆ&$n'‚.�KKŽ
�NOGK99         * 1 :  7##76=4>367&'&326537'&526'#7264&"ô	
µ	&BB	^%S!!.!!˜)
	$)!!m„!.!!.!        *&  ' . 3 8 A  "76=4>#326537'&"&537&'77&264&"¢
	
&U	
zB	R%u‚”•3!!.!!
))$‘!LÝ
g••!.!!.!        *&  ' . 2  &'&76=4>3'&=7#"&'26'#Ï&=l	B&%{	þ÷$)		)
¬)!		þ÷        ! 4  7&=4.'&326537"&53'76=4>û&BB	c%n		
f&!$)!)
&        á ô     7532#'32654#'3264&+^? "**%+'&8¼XD" 	        " & * . 2 6  #/#337375/#53#573#3#3'3#7#33#3#gg		cc	Œ]Yz^Z–9999999¼8888888
»

»¸©›¡&988      ô    #775'#53ê¨
MMDD–	ôVVôÛKKÒ      G q }  71#";#".'1&'5&754'1&'5&'1&+532>716=&71671>;35#"'1&'5&'1&=6'5&'1.+32#">54&q

	
	”	
"!ô

z
"!      G q ~ Š  71#";#".'1&'5&754'1&'5&'1&+532>716=&71671>;35#"'1&'5&'1&=6'5&'1.+32#632.6'77'7q

	
	”	
6!"Bô

z
	!"          )  %#5'##375'3#5'#'5#553757B	^	B		ô	¨KK–K
8	Kƒ&]K	8
Ká

	–

–*	

	+8K`+		*_         " ? [ d  632516=>&'..6#+0#1.="&=46;27>&'.547&>#"&462X"3)!		
69(		(r			$#		4$:		 &'+:51@:§//&&[	
		

$#		          3#'535'35#ô		ô	áááá	á		áB––&         1 9 I  754&"#'#;726?7'567135#56/7'#5462".5475Ì - 	&(%#"$%)'
m 	Ø  %#$&''              # ' + / 3 7 ; ? C G K O  #5##5##375#535#53#33##373##33#7#33##33#7#33##3'3#–		ô	áááá¼&&%
á		á×¨^^„„^       = y ‚  7.&/&'.?>54'.#"32>?654&/&/&'"&'&'.5&>?6323276?>273#537ë
)	
 "!
	
E			

/W>^W}'		
"! 

T		
	

E	ãW^>W       D €  ?#53#52#".54>?632?>2>?6'6/&/&"#"/.4>?64/&#"¢W=]X1	
"! 

)		

	
	E		¯X]=W#

 !!		'Z	E		
	        á   $ /  7#'##73'&'##51#"&54?4#"56323265¦=7¶"$	Q((�Y>>7
&
      % ô  
    %#'777'#'7%’:4‹�RP
):4é­S
I¤mb^S
I       ú   %/77Ÿ?8—î¼YO²       
     $ +  7#'773#3##33#'37''#'7737''F––––––––––J" /"Ø%&&h!LZ!       ó Á   ?#'7–QXXoRWW        Á ô   7'57oRWW–QXX        Ï ó   7'7'½RWW–QXX        ô Ï   7'73–QXX½RWW        7 ;  335335333#3#3###5##5##5#'5#535#535#5357335#^&&&&&&%%%%%%ƒƒ%%%%%%%%%%%–ƒ       ý ý   777'7''…UUUUUUU–UUUUUUU        ô ô    735#538¼––ô¼¼©–        –   %#5Ï–      ô     735#53'353#35#8©ƒƒpƒ&©Î¨¨–„ƒ©         â â   72"'.'&46767>–




	á


	
        2".46767>–!1
		!$!			!
1!$!			!$!		         * D  &"11>71676716&'1&'1&'1&'1&'".46767>2´
S!$!			!$!1
	

®			!$!		
1!$!           2".4>7.34&'>–$<##<H<##<LŸB;$âŸB;$#<H<##<H<#ƒ%Ÿ	7!%Ÿ	7       ¼ ¼   7.462¼  –         ¼ ¼ 
   7.>2654&#"6¦
		Œ

	      á â     72>4."7"&462'–##(##E((1K#(##(#K(         4 = F O  #375#533264&"##532653264&#"#.#53462"&'2"&4632"&46ô		ô	©+
8%%&
0
©q

8

y	



	ô		ôê%8á,	
		
&©

y







       ô       777'7'''!5!!5!5#35#¼  Çþúþú––––@  ƒKB	9         " , 6  7#5335'#5#4&"##35>.5#'37'3'#5'ƒ8–
 

A	

†%$|%&¨%/		¼	å	



¬dd$$[$dd          $  7''77/73##'57;35##3¢)ƒ&„&K&ƒK„„”zƒ&„Kƒ8„        è è   77'7''–DEEDDEE‰EDDEEDD        ö / 9  73#5264&'#'.'&'";#"&'.>76>537#'à!!
				&+_((¼ /!
#"vfe((      ö 2 <  73+53264&'#'.'&';#"&'.7>>'#5'73à!!%%
//		&+((¼ /!
+Hfe((       ö  .  73+"&'.>76>3264&+'.'&'"3à!!Œ		&+ƒ
¼ /!#"s
            '  3#73#3#3#3#3#'353#5#375'^%KK&KKKKKK&KK]áááÏ¼Î^^ÏqqÏ      ô     7'573757'X1188‘228¸^Ã1289128`»	        ,  + A S ] e  3#54&/&'&=33#54&'5&'&=31#54&/&'&=732++".=5#;267364&#8

L
	
K	

pÅ(8"¼©!9!		



		



		



	p'"9888!!P8              7#3'73##'57;35##3©^^Kƒ&„&K&ƒK„„ƒƒƒ&„Kƒ8„          "2>4.52–$<##<H<##<$33#<H<##<H<#óá3>3    
    ,      # + / 3 =  375'53375'5373#'7357375'#53#53'#375'		8

.%/		8

.%8	8

8	%Ÿ		9		
%%%%n::""	8

8	8&&%
8		8
9&&/

8		/%%ƒ	q		q	8&^%""         '  ?'5#'573#5#375375'#7#53#'K		á
Î	v#		–		KB„	X/	–		TK„	B"
]

]
KK	  
      
    # ' - 1 8  #335'3#'3#3755#'#5'#7375#5#3=#7#573p%%K%%©		8%&	(
	6ƒá	
		„	%(!
B6K%%8	K%%^	          #  3&'5#3?3#'5#'5">54&ô	
á.
(6/	Î"!
€	h–
!(	
6/	©z"!         #37375#5'#53ô		/6	z(
.á
©	/6	©Ÿ(!
–     ÿý- , 2 6 C J  7#5#.'35#>735#3654."327&7//62.67''«.-.	#<H<##<$7&L$G!"."'--.$<##<H<#JL&7$$&
 ! ?-%     , , 2 6 ?  7#5#.'35#>735#3654."327&7//264&"«.-.	#<H<##<$7&L$/ /!!/ '--.$<##<H<#JL&7$$U!!/!!           # 0  7//35#.'35#>735#2>4."©&L&T$y..-.^$<##<H<##<©L&LT$$.--.z#<H<##<H<#  ÿÿ  ,   N g q {  72"&=464&"265'763"'&'&/.'&=46737&547676276?5'#"'&'#"7&26767264.uV2&#)R)#&I
$F$
!!:0*'*0q				²		‚PPb((             ?3#'7'#3'53'KeD–©8^–¼yáC‹ƒ8»ó¼Ï         ô   ( 6  7'77>54.#"&#6326".4>2>4."§/(I	
'e$''.''�80+	'.(+$$'.''.'         â      %#53#7#";26=4&3#áááááá@&&Î%^–ƒƒp      Ï –   73#^pp–      	   ( 0 : H  >.632>54.7.>64&7>/&#"&>IA;$6A:%& /%0.$‚(

T	
4	&86A;$7A:¨/*	 -/*Š)	!+.$9+       ô  $ 5  74."#26?5#'2"'.4676"'./577ô,2,5H5]*`*#((#ê¦¦

ÄŒ       ( % , 5 ? F  7."'#372677'67535#5'7'2#46.'53'357557'5‰ K82K*Ž0GGi�¥ƒ		

	
K³VD_ /dF_n         % , 5 ?  7."'#372677'67535#5'7'2#46.'53'757'#‰ K82K©lVŽƒ		

	
K«qH9_D       ), % , 5 @  7."'#372677'67535#5'7'2#46.'53757'&'57‰ K82K¸€j¢	
ƒ		


K`QCgv~         ã ã       7>.6>&'&7#3#3l($!($)J8888Ô"($!($^#*;      á â     7"2>4.#57#5–##(##KKKá#(##(#^9       æ á    7#37#'73ºV,,V,:::áKKK3333      æ á   7#'73å+V,,V–KKK        á á    73'3'K–K#F#^ƒl=      á á   7#–K–á�        ô ô    ?57'9]]]444–^^])455       ô ô   7'–^^^ô^^^        ã ã     7>.6'#3'53Ô"($"($'l($"($%KK        D L V  73+54'35#&#=&/7'773#'"&''7&'5#5357'7>2.34675#6X±\`¬	
†#-
4W 	8
J±
¬[\g#.
3;
	

		T
       	   #37755K>ƒiáÕ¼]L˜       	   3#7755/\„!]áÙ¼^B„      	 . 8  ?57'#+".=4.54>2#;265^©lVŽ

ÿqH9_D`

         7 D  7&'7'&'&7676'76767''7''726?".54?ÿ	Q	:a#	6:ä		Q:n#	:                 753'3#7#535%7'77q¨]]]]¨¨þúeeJqKK©­CDuc1         Ø ô    73#7#5T„ô¼¼¼¼     ÿý  $  7&'>.5#35#>'757'#†'#
-2#/1	,
#%(©YCŽK%2,2

¡q;-_D       ô  	   -  753767#&'#%!52>.3#'53>&'7a	‰iaþúÇ! 	%*'*%	q		8
q	
¼¼"*$+           7&'>54.5#35#>ï&:5
(23)*DEA#57#–.!
 /$;"K-         þ  	   #3''55ý\„!]áÙ¼^B„          7.4623/#3?#53¼  TP__Pa__O– Y²YJ²Y      	   %/#3?#53P__Pa__O¦Y²YJ²Y      ü     ?'77P––nôdd­“J             753>32#5."3#'"&462!04 '.)5Nu ÀK/."�         ê 
   737'5#'"&462–
I11I/yI1tt1IA       ê 
   #7357'"&462–
I11II1tt1Iá           !  %5#.#"35>2#37264.304 '.)5Nu ÀK/."�            #'57#3ô¼·²²¼¼²      +,   A I Y  75'77''7373#1'"&/'7'&'+535475'7354>2354&"5#2>54+[&('&&('t$",.+)$&$)*.,#$"kY%z›	"‹	&((&&)(�$"+)(* #$2-!!-         7526765#'573'5#337'5#'KU		ô	ák	.(//
»

­‘©	//yy/        á     %5'#37575#53'57=	©		©	=]––K99Ó#(		„		&#	kmp]
"           ) 2  73#'573?335#/##">4&2.467"264&ÉG		ô		G8“áB0AP !!.!!ô
¨

¨
¹–  !.!!.!        ô     3#'535#3#T–

–	ƒƒ/%%	ô		ôêá¼             3#'535###33535#á

á	ÎÎp8888	á		áØÏ&888             3#'535#3#5ô		ô	áá–%p&	ô		ôêá&%q&            3#'535264&"ô		ô	áq!!.!!	ô		ô	áá©!.!!.!       	    %  #'57335'##33535#5#3#7/¶8©qq©8qK%%&&%^^‹+88¨áó¨9K&&%ƒÎ+»Î8           7#5'3#'535#¼^Bá

á	ÎÎ©p	á		áØÏ          3#'535#37'#ô		ô	áá%8^^8	ô		ôêá„8KK8         	     #'57335'##33535#5#3#É8©pp©9pK%%%%%]]8¨áó¨9K&&%ƒ         ô        ?3#'735#535#73#'535#535#&	^		^	KKKKz^		^	KKKKê

¨

	q
¨

¨Ÿ&%K       ÷
   35#7>7>.5B	B0"#

ab!,,B			##ba,,!'        	    #?577'7ø›,Mšì!–!šM,›Ë8
!–!            %'#5'#337'53#53753	�	^		/	¼	óK–©	„²
T		—U		gqq]K       ©     7"&462"&462"&462K

^^–          73##5#53535335#535#53#K88888áqqqz		ôá888ýg]ƒ%
Î	        â á   !  7''7'777".4>24&"26¬$#(##(#!.!!.!o##(##!!.!!       ( 4  '.767>676'4&'&'&'7''7'7¡)&&0'&+!&&& !"&-------)7+'	"*..ô	"%*	NH
|///////         / C P T  #'73&'#/'7/5?'7?375'7'2..>>.635°4
&&--&&
'
	&,,&		&,-&&$	
#!" ^-&&
4
&&-,&		&,,&	
'
&&0
	4#!"!             7#35#'73##'57;35##3©^^&ƒ&„&K&ƒK„„ƒ&^^©ƒ&„Kƒ8„        ã    7'7'7#5'3#õ,CC,½%©-DC-8ƒ       ,,      #  73#'7355733#'75##;5#©]]]þç^^Îq^^^^^^]]]]¨p^^p^^^^         & 7 ;  67>727264/1'&""&47"632>'..3)J€hb,	
%9	#303% )J€ht,	Q.#+,/       è   (  72"&46"264&'2&'.".7>–*3#	9J9	#3»))>+#--#+   ÿÿ    ; D  753#5#37375'>4."354>;23'&'.'"&462T		
©!&""		˜#

2'	^
	#	q	±	##	



''         	    ' 1 ; @  #'57335'32654#"42"35#57##535573732654#"42"Æ>
Î		‘ˆ¼8h<-- >¶		ô	á¨9L%%2=-j-=$%2         	    !  #'5733'#35#'57'?'7Æ>
Î		‘88„¼B	J"))$))">¶		ô	K9á–	BŽ#))D))"          % ) - 6  3335/#35#7##375'#'#57+577264&"&p	B>‘		B8ƒ88g–		–	(O]/%B	)>	ô	á98	q		q
K('P.A 	         ( . 7 ? I  %/#3533355375'#53##532'#3246'4#32'536'7##53#3>‘	q	BK8Å		Î

	¼¼–

B	
M!Ù>	g^B	)998	q		q	^]89&	8#9          ! + 2  735#75733#'5#'5733#5#/#'#3?35##35#&
Sk		Î
		Sk
gDqD;qhA¼k^K		
–		/	©

.%898K]       
   ,  73#'57357##737#/#37'7'7##467‘		ô		^…wTfzzPP1)+ô
»		Î
Ìgq–9I**               *  #535#'5##5733'#375#53#5'7#53Æ>
A8B	q	‘88ƒ		ƒ
pp21!8>¶	–	BKT	K9^
ƒ		ƒyp8!12        
  # ' + / 3 7 ; ? I  3#'5#335/5###5#'5#353535'#573#5#573#5#5;5#75#35/Î

»	KK&		
	&s8	^		ô	&»vT/

/á%&QQzy         	    %/#375#533'58q©©^K88Ü8á¨¨áK99       ,      ##375375'##5337#533Ûq9—;8&–9KK–^8,8¼9—á»q»8        #5'5]K^ YhhY           #5'53575#]K^p&^á YhhY q^^Y       û - S  7'6&'&'.7567676?67676'76?'>76&'/6&'1&767«
	
	
	
	
	%;		

			
	%		
G%%		#		;

           ''37''3
pqwwpqwppwqqw           777'#77'#pqvxpqv¡qqxèppx      î     7'3777'#àJKQQ£MLSRÿJJQQÎLLRR   ÿÿ.   + 2  73&'5##3#'57337#/#37>.67''‘	vU`o		^zzPP1($!($8-' ô
Tq			Î
69B"($!($R;4           $ (  73#5##3#'57337#/#373#73#?‘	wT^g		^zzPP&%&ô
Aq	Î
695pppij       %      73?'#5'#/#733###73?3Î	2	
l^	PgUG	½ºEm&„.

ÎÅ%91^       
    %#/#375#53?3'##533^		ô	áUwzPPzô
Î		»•q9      , ô  # @ I S  732+".=4>";26=4&#"#";26=3264&+54&"&46"&>2K–##–##!!–!!z‰
ô#8""9#!8!!8!%
@          7 @ I  7'#'73?7'?5/7''7'#''7'57'77"&462264&"«

%--%
%,-%
'&--&'
4
'%--&'@&Ú--%

%+-%
%C-&'4
'%--&'4
'&-ƒ"       " & 9 L P  7#65&'&/&"&'&#"#375#535#5&57676762347676762##53ý				á
„]]8	
6^^^á			©		© –

©–           & 0 4  73#'573&'5#'5#'3#'5735462354.358KV		‘>B	q¼8A		q		3%
%^&	ô	>0	B999K
K		K
	788      á,    3#5.467264&"�&&&&	(,L*:*LL*:*{((      ÿþ  * I U  7'7'7#&=.>323'>..676754&+'5732>.‹((#		5
È
		#((#	8((h		g›{
!h((²
              #3'7537'3##3©^NM^Î]NN]¨&      - 4 ? J W  7..'27>54'&'&#">56.'5>4.>'".>.>ù!*	
		$¨

�	›	*
	_	-
%2
‚
{	    ÿþ ! - 9 J U a  7#".>75.>32.">'2>..676753>.6'77'7''i			,	È


  Ð^
_	Ÿ
ž{
C…Ø           ,  * 6 J V  7".>75.>36.#">'2>.#54&+'5732#5#53533#i
	,	È#((#8888Ð^
	_Ÿž/((		Å888        , 8 A J S \  7>54.#"32>54&'&'5.>2'".>"&462264&"'264&"5264&"T				Ð''/¾	_
^u
ƒ
Ÿ'/ˆH    ÿÿ      5  7375/#3#57#5##33533#7'7#";#"&46;'78©8%%9©ƒ%%%%]]](8		8(qK¨89¨KK%%&&K™('(         " .  %/#3&'#535#34'3533##5#">54&8pd	Up9
n'%%%%%%p"!Ü8á
â9:Bp
g%%&&&"!    ÿþ  * 6 W c  7".>75.>36.#">'2>..676754&+'5732>.6i
	,	È
	#((#
Ð^
	_Ÿž{
h((		ª	       	  ! % )  7357'#375'#"&'3#5326'3#3#ƒ2BB6		á

B!i,Î+ ' =ð""2AA;	^		^	KK\        	  !  7357'#375'#"&'3#5326ƒ2BB6		á

B!i,Î+ ' ðmm2AA;	^		^	KK         	  !  7537#'7375'#"&'3#5326ƒ2BB6		á

B!i,Î+ ' ­ll1BB[	^		^	KK            # '  73#'573'5#37'#7'#7337#'#53#5390F

á	Îh*i6++6#Bl3
6?%.q	©		Z!0©Al ^p8mH89      ! l  %"&=6&'76767654/6'&'&#"&='&'&/.'.>75&7&'&547&?66676 	))		
 	
)*	ê-
..
	

/+

   ÿÿ  -, T  "26='&'&/./&7631767&'&5471&73263267613>54.–)E(.			

	
/)E,(E) :*

'	'
)
+:)E(            73535#5##3'3#'535#qqq99BÎ

Î	¼¼8q99^
Î		ÎÅ¼     -,  j  "2>4.#"&=4&'>7654&'>4&'#"&/.+&/.#737+.>2–)E((ERE((E	  		
,
$7>7$
,,(ERE((ERE(þð#												
	,:>22>:,	    
        * 1 7 A H M S  2".4>.'65&'#36'564'#36'&'+#673&547##&'67#7>7Ÿ!8!!8B8!!8}	2,/AHC
		/,4,
&	/
7	B	%!8B8  8B8!K8
	
				
A
J1     ,  ' *  ?5'#";5#".6;7#'3#'535#73q&(8		8_2X9¨¨K8½'('K8¨Œ|–K9        0  77'2>4.#"32"&'7'7#";#"&46;'7ZGG1://''-%6(8		8(nEE"/80'.'a('(        ¼    %!!!!þúþú¼&        	    ! ) -  7'573573#75#7573#75#7375'##5(  ðÎ	&		&8	&		&8	&		&áÆ««™™……	uu}``PP      ,    %#'537#''7373ý	ÎaDK`&8	ýô¸aDKa&        ,  
      %#'5373#73#3#3#73#ý	8%%ƒ&&K&&8%%ƒ&&8	ýôÏ&8%&%&%8%       ,      & *  735#5#7573#75#7375'##5573#75#ýó%
%

%ƒ
%

%^
%

%&ôý%–

–	ƒƒ²¼		¼	©©³q		q	^^      Ï ô        73#3#3#73#3#3#^%%%%%%K%%%%%%ô&%&%&¼&%&%&        	    ! ) - 5 9 = A  3#3#'5#'573'35##'573'35##'573'35##'573'35+35#3&&	z&		&	%Œ8		8
9&&A&		&	%Œ8		8
9&&&&&&á	ôg	&		&
%	8

8
%–	&		&
9
8		8	&p        %.'."'."7>4	



		oo	Ò	


		


nn       =  %.'."'."767654'.4>76767676	



	oo	
ab
	
	Ò	
		
	oo	
aa         %  7>&'.5#35#>&'6'7'5#ý<A8	B)HJ.1KF8B>+6E99!-B	">M<!"	&,6GK          '#'5##'5'7357335'�w
8	&	8
wD&	8
%Klz		BB		zlX‚B		B‚D        ô â    , 0  735##5#3533'676764.'&'&+3537+532#3y11j.	  
¼¼qp11p001	
p.$
f        $ . ; ? C  733##'5#'5#'5735735.54625#3?3'1&'267'#373#ŸK	



	://
				
K	B–/	"5(	
	L8á	&
	9	4-6	
(a8n)&.
			3       	    7375/#7#533?3'##/#73ô	4�	4ôá/V15	K51&	T�‹Y	8„       ô Ï   7;'7'7#"&=K�00�Î%0/%        ' + /  &'.>>7>&'.7'35##5¡)7<&+ !13&>@"*-,$ó755;2	”%KK             #'57#3#'57#3'7'––––––––ô++KKK9KKKŽ++        '     ?3#5#3#''75#áá]]~3 =%ôqq– ~±3V>   	         $ * 2 8 A  764''7&''7&"62'647&7&7'"767''264&"ï#	,'!?	#-#	-'!?	#L'!?	##	M!	##	:       #  0 9  7/7>#.7'.'35>7'7'264&"c=$()%2H>,­$))$$# +=Â<$&$4	'"C=%&	"
        $  ">'6.".>'264&"�%>5HD*"- 4,=:#&')DI4=%,#á#:=,4 &g        à   7#727676?654.#73&©\&	V
&	-‡	‡	         1  7#'5#/?76?#'35737'"&'&/3ß“		PP	“€	?@	
!
}2	2}	}	##	        F �  75#"111+321135#".=4&'&'67>=4676332>716716'5471676;5#"'5&'5&'1&=6'5&'1.#32#q	
	
			M	
	
			ô

	¼	

	        ª     7>&'&7"&462'"&462Œ
	)
	V^        9 E  #"'###'5?&54>6716.3573573?327>.6Õ#/	
8	^%,	 ^%		
	 +&
		+]#	Š 	$
_		B
	      / 6 9 = @ G  %'35#5##3#326735#'3#37/#53#326735"&'3'#7#?#"&'3^^:%%©%%:·/&vƒv& /©KKK–//–K-‹Š-      ÿý-     , 3  #3757'373#"'#37&762.67''™
oo
sÖ^aam!QT"'Q!m
+!"."LJJAA?BJ77
7J	=
 ! ?-%      ,     (  #3757'373#"'#37&7264&"™
oo
sÖ^aam!QT"'Q!m
 /!!/ LJJAA?BJ77
7J	!!/!!           3#'57737#''373�
ss
ot^^aÓm
q"TQLm!QT"qLJJ9A??7JJ77yJ77J          375'#53&á¼¼ááóá           375'53&áá»ááóáá           375'53353&ááKKKááóáááá               73#'7353#73#7#3áááÏ&&9%%]%%áááá           375'5375373#&áá%p&&ááóááK–––á              375'53353353&áá%p&áá¨––––––           73#'735335áá–9áá––áá             375'533#&áááááááá©––9            73#'735335áá8–áááá––            375'53&ááááá¨––           375'53353&ááK„ááôáááá            375'#53&á„„ááóá            375'53353&ááƒKááôáááá            375'53&ááƒááóáá          375'53&ááááááÎÎ            #  375'53?3#'73573#'7358KKK9999K999¼¼Ï¼¼¼8888ƒ9999      (      #  ?3#'735?/7/73#'735^	&		&	)#F#2@A¿	&		&	ý

Î		Å¼¼ÂÀ°°

Î		Å¼¼        7  7"264&'7'373'#;#&=4&'.547>32á!!.!!	

#"

	'ƒ!.!!.!]R)

	
'	       ; X l  7676?67654.";2>5'#&'+"&=3>37267676301'&'&'&'6762"'&'&4¨

			%3

		
				x

		)P


				       õ ! +  7'#&=4&'.547>32#;265Û	
	'3)Š	
	
'.)           3#353#'5!#5'7#53UKá	ô	~czáKU		ôzc~        ô $ I  732+5326=4&+".=4>5+".=4>;#";2675.S9		9   :		:ô$L$        ô     753'3#7#5qKq––¼áK^^         ô      73#3#53#53#&¨¨––ááÎÎƒ&„K          
   3 k  73#573#3##3'?64'&'&"354?2335#2"./&'133?/+573?'4&#547>2+3»»»»»»»Ó% 9*88R:	         ô     753'!!7#5©©þúÎÎK^^       ô       73#3#53#'3#;#K©©ƒƒ¼¼8ÎÎ8ƒ&„K©      ô          7#3#33##373##33##3&%ÎÎÎÎÎÎÎÎÎÎÎô%&&¼%&&      #   ' 3 ?  7'5#"'&7>37'#&676763>.6>&'&¬dd(0GF$.	B+			PL	#, A#68!
J		$,;        %."#>2060%8@8%©++ 33         â   ' 3  7.#1"376'4&';'&5>&>&'>.6Ë
";
;A 	00	 "	&		ú
"*ww!aa!(		      ô     ?3#'735'54&"354628–––!.! –^^^^%!!%%%             7#54."#375'4>##53ô#(#¼©!.!p–¼¼©%""%pp8 !%ƒp          0  "3754623754.#53#53'54&"#54>2–$<#89#<\88©999 .!84<4#<$^^^^$<#á888 44          #375'#'#53?›
~	ô	ƒj Ùá¨K•		•8?…r        ô     ?3#'735#7#	ô		ô	ákd¼^ê

¨

•ŒŒR\I         ô     7755'57&AK8KBÅ�)�°�#�#�)�      ô     3##'3#3g�)�°�#�#�)�BK8KA         ü      73#3#?'#3?53#lw#ww#wd,�/,,�/�w#wý88BFK	FGK	8       ü      77535'5?37#775/88AGK	GFK	8Àw#ww#wd,�/,,�/�w#w       Ï    73#7#'#5375##7w'!!(œ%$76Îzccc/-z++BB66       î     ?'.7/567'5&çr&@X××­@
¡


$=	,9Š=       î õ 8 B  7'.74>32#"5#"&4>367332654&#"77'32676#"Ä!&$
	%%	L	D '#'		"
<
 )
8$        , á     %!5!!5!5!5!,þÔ,þÔ,þÔ,Î©8        ë þ & ;  7'#711354./.7'67&/354>7Å((4Õ((	S
      þ   #  7462"&553'.53;2>53#^!.!!.!/+""+Ø!!K!!�&&&+##+        þ     4  75462"&7"2>=4.53'.53;2>53#g&&/$+""+�KK KKþç&&&+##+          ##3353?5/##53'3#–g		gT((TPÀÀ§^^%
K	ƒƒ&%K8	       
  %  ''5?5'#571?'7#'573¡tuutgggg#..q..rK¬KK¬K«B–B66B–BZ/../      ô   "  %'#353?54'7'56737/7€€+KI?BAB10AgggÂ22w^""G(((      	   '  75#'37'7357'#3#'573'7'7#À!!00n!!05!AA!11eA!11!Ac @@ 00“ @@ 0P  10- 01                 73#535##735375'533#q	–		/&„„ë		–

Œƒƒƒƒ		ƒ
K9^
ƒ		ƒ
&K           ' + 4  %#&#">=2"&>7&#26=73552"&46'.1–	'„ƒ/©/	'U8•		�
'qT
%	&�         	    737'#'55#37''7'74II4	H;;..·  !    ÎHôH	^X;Ç;KI !  !       ,     #5#5#3#'5733#5#53533#²@K^KT		~68888A%KÏ	á	9Î888       ,   (  #/#35#53?335##533#5#53533#^		g^UwzPPz8888	Î
q%T8ô888      ô Å   7+7'7'326=á�00�Å%0
0%       Ò    (  76.6.>&'7+7'7'326=,.	'.	F	
	
œM00MÅ	'.	'.
	
	%%0/%              3#'5353##33#ô		ô	á¼––qqqqKK
»

»	©©&      ,,         # ' + / 3 7 ; ? C K O S W [ _  7#53#53#53#53#53#53#73##53#5;#3#53#53#5353#53+5373#'7353#3#3#'3#%%%8&%ÎKƒƒƒ%–^^Î8989%%&K©©©©&&%ƒ               #  73#'73573#'735#33##3&©©©–^^^]áááá&%%&        ú % @ I R  %676'#&&"&'&12767654"'&'&5476722763'"264&3"264&	B	Sƒ!

JJÂ
	
 )

) xR     -   " .  3&'5##'535#"#7>..>8Ï	
]\^^Ã
	,,	
	d^ÌÏÏÏq
',,
K   
       $ - H b w ’ ž §  7.676'.>&76&'&6264&"3#"&="&=46;#"37&+"33>=26=4#+"&=#5&6;2#5326=354&+&'32#'">54&"&462«	

	+			œ""	"	‹
.&	.4""	"®		Õ	&	
	
¥
")	*5z
;,	,<J??=	v5*	)"
Ù
&       ,    ! %  #'57533533533535#3##33#ô¼&&%©¼¼&pppppppp,ôôþçô&88         ô 
     7/5??5'755¡lsskK
@9±^^q^&ô	~	  	~	wllk
00      # - B  %'5'54'&'&#"76?2>'&>&/&4?>&'5\9		D
]
–DR
	HO:\=8	D]*	³ªDQ5		
5I            72>4."7#'77–$<##<H<##<+$O#<H<##<H<#M+$O         /  737''7'.767>676'4&'&'&vUO$V)&&0'&+!&&& !"&`VO$Ž)7+'	"*..ô	"%*	NH
      þ     '  ?7"&462264&""&>2264&"D––'—'>¼¼€'']''         # E  7##33535#'.>&'>.632#54&+"3;#"&75"&7546ô%%%%T
		&	

.	.			q&%%¸
			E3?	,2         Ï   ) =  2"&467"264&#"3;26=26'54&5&6;2#+"&=– .		
J	.	T2,	
+2T33??        , -  353375337533753#5##5##5##5#!75'%

%

%

%8//8qqg

gg

gg

g¼999999KK¼          -  73.'7#523#".54672>765#5"¼I(#3p	/\3",+ 0 q	
+3¼(I\3#
	pƒ +,"3Ì+
	q 03      á  7  %#"&'#+5#'735323>3#'&'.'>76?36
	<<	
6	M		MÎƒ
		
K
	K
	
ƒ       - 6 P  31&/576?67#3#'5#5467675.5>"'.'&67676Kƒ	
			[^
	
K
	
Œ6
MM	<<	
6˜       á  7  3#'5#5467675.53.'&/576?67Kƒ	
	
K	
K
	
ƒ6
	<<	
6	M		M         ( . 1  '.767>676'4&'&'&'7'77¡)&&0'&+!&&& !"&'TT:)7+'	"*..ô	"%*	NH
«88_N'      ð    755G©¥�ápg¾_         â    ##35>='#5##.=3ƒ	%%	&;"p8	B+99+B	88s88         ï    ' /  7#'##73'&'1532#'32654#32654# >8n)#^((�Y>>7��/>4              #  3#'535##3'#5335#3#'#33#&ááááÎ¼¼––8KK%%9KKKKK¼¼¼¼8ƒK%8%      ë ë    ?3#'735B	–		–	„á		–		�„„              3#'535#3#7#373#ô		ô	áá&&q&&%&&	ô		ôêá¼¼qq–       ô   7'#'##3?3735Ý!#5<
#	Cƒq}]Q2_„X         < @  "2>4.".>27."34>23546?>4&3#�!8!!8B8!!8!008//
.!8B8  8B8!á/8008/ž			
^     
  "  7232#"&5467232#"&5467†# //™$ 0.ê3$+*&5N#3$+*&5N#         % 1 C N R V  7467'7.77.467''>4&'77>4&'#'7.>264.#3'#8	

	�



K@h@	&6Ã&,1,&		M		!†&)&,1,B
‘!!‘	'$8%%           * 3 ?  736.75.>264&"27"&'77264&"33##5#53á ;@.9 .#31z.		/7%%%%Ÿ 9.@; /4'+/	
/8&%%      ô      # ' + / 3 7 ; ? C  %#";26=4&#53#3#373##3'3#7#3'3##33#53#7#33#Ï

ÏÏÏ9%ƒ]]ƒ&&^K88&&ôƒƒ–ƒ8988]         â á     7264&"7".4>24&"26–S#(##(#!.!!.!ƒ##(##!!.!!         1  7264&"7'.767>676'4&'&'&– )&&0'&+!&&& !"&q  ¨)7+'	"*..ô	"%*	NH
      ë
   #53'.'.>5ê	B0"#

ab!,,B			##ba,,!'   
    *,   ! . 2 6 : > B G  7'7#";#.4673'7#'573'35#73#535##5#33##373##3'13#‹+<<+Ex

x
xddFx

2(d<<<<<<<<<<<**ó+(+þÿ
 

 
Œx
 
Œ<F‚È<<      	   7#53#5>&'7.>X2A
9@+$%+31%ô
A%?<0A5
#03,#03,            37'#5'7'73#¼0	00	00	00	0–KK;::[K      -   , 2 8  3&'5#3#535#'5"2>4.".4>27'7'7'þ		
êaN:k
×$$*$$ 	K	lV° 	Äl$*$$*$ˆ  '	         ò    7'7''75'òKKPP®MMRRyJKPPVMLSR      ©   %!5!þú–          & : D X a s {  †  762"'#53264&"'7546;#"77354#"6232?"&54?#5#"&54?4"5>72526275"&4625&'"'73#'735'735Ú	Œ',,;	,	7	}©©©p„ú	J4N(
 			¯				K]]]]&^q        â   ' : B F  77'546;5#"'3>4&"'#3=462"&#"&5&632&"27'375'3#<+)o
^ƒƒƒƒæ+*/	'\	
	–[ppp           7'32354.+7vKK=$'4&<)";LK<G'9&:   	     ( , 0 4 ; K S W [  7#535#"35#"'&'4=45676;#375#'#33#3##53#'73##5#"&=4635#";5#'35#ô©KP	
®KT
ƒ8BT		/		 &&99q–
²

&
Tqƒ88ê	q	^p9      ,   / ? G W `  7121#1"&5146121#1"&51467121#1"&51467121#1"&514637#'7#326735#."".>ŸDTU88%1%99%1%l''á%K%yETT­    !'         	  # ,  7357'#7357'##326735#."".>–DTUDDTU88%1%99%1%l''üDTT..ETT4    !'         / 8 A J  %4.'&=>."2>&'57>=>'462"&"&4627"&4624432»

g/á¡

Ž        ,   "  7#326735#."".>'537#'7^88%1%99%1%l''8DTUK    !'^yyETT         	  "  7357'##326735#."".>–DTU88%1%99%1%l''üffDTTm    !'         & * . 2 6 =  %5'#";5#"'&'&=47676;#37'53'3#3##3#53#
·®KT
¼©–	8qŸ	²
&	B––ƒg88             3#'5#'535#3?3#35#ô		6/	zzá.
(	¼	6/	¼²©©
!(™^%         	     #'57335'##33535#5#3#É8©pp©9pK%%%%%]]8¨áó¨9K&&%ƒ        ,    # 0 V f  7"&462264&"264&""&46267"&'7?32+"&='57546;5.5462";>=4&#–888.	
	
	/ !p  /	
Tp–  E



	·	!%!!%!	;qq            ( . 7  "#37567653''67/6767675#5#76.6/.%$N	p8	!ó1j@@#$0/$H%·!	8q	N$%./Tj1@$/0$#8%8�	     %  ( 5 >  757333#6737#&'?35#/#"&4623".4>2264&"	^l
	2	F3-lUgP
U&##B'·F

.„
q%1W$A''         & 3 <  73#6737#&'?37#/#573"&4623".4>2264&"‘		lVw	zzP
		^&##B'ô
»	
„1F
�$A''         ô ô     7#52'234.234.^&&.N-3V3+38&¬-N.3V3K+3      ô 	    7375/#'73'3||>|>ƒo5t5o2"T¥||>>vo55""S             7553'#5'!©¤Ž0/ápg¾_/ff         ø     2 9  ?5''757'#&671654'1.611.716#'77Ÿwš†cjŸC.†!&).-#J#/PgYB¬j-Y@-,

 #          75575'4©¥�V¤¤ŽŽápg¾_umn__             755#'7537"©¥Ž=/ápg¾_Ž/ff         	  . 5  ?57'#&671654'5.611.716#'77^©lVŽ(	+1	0$ O%ÿqH9_D

!%         	  . :  ?57'#&671654'5.611.716'77'7'^©lVŽ(	+1	0$ ,ÿqH9_D

!            &  %/##375375#5335353#5/#53 	/		¼	/	K¨q]%q&^’ú	/	¼		/	 Î¨99%%K^&            # '  #5'##5#3#'57335#'??7'Ï
	q%8
.œ?&&zr9rg
a	 KK¼¼K99r8r‡	a        	    #'57335'##5335ú	ô		ØÎá"ƒK&Ø		ô	áÊKK99              #  735#3#'#573#7#5#533#53#3#'538¼¼&pp8	B8ó9B		B9á8B	K–%KKA
	A8–B		B          # '  7#535375#353535+335'7#'573#3B/%©	/8%/×%	Ÿ	„		„	%KKá%/
%/	²/%%/			^		&    ÿÿ,   /  "732>4.4>2".#'77373'#–'EF''Y$$U(()(%)'EF'-'T#‚((((%(       ) 2 :  7''7.>&'54.>.677'76'6&#"l		GG$AB)	/2')$"($O
N!î5		EEE:7#*
d!($"($[NFO!        ,-    "7>.#".4>2#¿3	ddC87!''.&&,!8<sr&@A(»'.''.'          7'77'øøÑÑeppo	Wb_V             ! )  73#3#3#!7354>;2335#'##5#qKKKKKK«þô#p#¦pp¦–ô^K^©¨&Ïô8%%8        . 7 U ^  3#5#3#'535#5&''7&7'767537''264&"5&''7&7'767537''264&"ô	áƒ�	áá]

					e				
z9„	Î/&©






/m





/				         # 7 ? S  7'573'##5##5##5#35##'573'##5#35##5##5##75'#753353353353353/		Î

A¼&�		Î

Œ¼&Œ

Î			&Î
8		8
9&&ƒ	8

8	8&&ƒ	8

8	%%       ,,  7 C N  7'#''7'57'773775/7'/#'73?7/632.63264.ø44+,<,*44*,<,+122+

+22+

+`		¿<,*44+,<,+44+l
+22+
+22+K-        þ  # < F  7232#"&'#"&>73>3"264&#7232#"&'#"&4673>"264&#qhjLhjz–        % = @ B  7#375##53#54675462"&=#7"36767632?'.20#1^B		Î
»8*!EE
L!
		DD9á	¼		8/©p/!4
II

z !(IH¢       $ E Q  7.7572>76763'67>=#&'&/&'&>."3›
	

		l		
	
	
h	
	
%	#<		<#	Ñ3	3Q1         #  755'#75375#5/3'53#'57Ï	©	^B	9DƒLKK:]\./å*

Ê	 		*œÔ­../          %  775'#175375'#5/3'5#53'7'Ï	©	^B	9DƒLKK{^]..å"

	Á	 		",œÔ­@..           " + 8  >.6>.7"&462"&462"&'>7'MG?( ;E?()<6"3;6"<^B
%*#	;F@'<E?·2=6!2<5_S	        1 X  7"&462'"#33573#"";>4&#4&#54.#46;23232+"&46;546;75'#"&–/"©B&
	©		&ê+!%  B/K

8	       
     " ,  35375'3##3'375'53'#37#'37'ƒ„q&&8&&8ƒƒƒ%%^&&88.:&%9%K^^q^^9&–H&&     ÿÿ, , 5 > G  %4.+"5>.">&'>;267>'462"&"&4627"&462	%$$%Î8gÅ
[$$r$$
IÂn         , W  726?>?>././.26?>?>././.e


						x
a
				

				O
      , @ k   726?>?>././.?'./7>26?>?>./././7>?'.e


						
		v
			a
				

				‡
			È
2				          #375#53#53ÏÏƒ^^q^^ÏÏÏÏÏÏ            #375#535#53ÏÏÏÏÏÏÏÏÏ^^         M œ ¦  7&#.#21273#;>'&/.6?3267654'&'&&'54&'+46;5&67'#"&>;26?&'>73235&67>76&'&&/">4&#h


'}	

d	n
<

!

	
ƒú		#

	
			¹	
	

	
p       	      7'#7'7377#373'7´eRPPRíRªRR,,$$$·bb@d>>d@	OO4P„----      	  7'#7'7´eRPPR·bb@d>>d@       	     ?3'7''7#'5#xeRPPRƒ$$,jR·bb@d>>d@G--3O           ,  73#7'.767>676'4&'&'&qKK0)&&0'&+!&&& !"&¼K¨)7+'	"*..ô	"%*	NH
         ô 	   % .  735#35#7#3#375264&"7"&462264&"&		ê	»S%
á
¨
©–
¨g         	   35#53575'#3#		/%%Å		/&&
Î	¼á	Î
¼       ô    ?3#'7##7'7'353'7'7#3	ô		ô	ôqL'88(MI'77'Iqê

¨

ŸA'77((77'A          $ ( ,  7375'##575'#373375'##537'/7Õ2"^#&K%	X2#^O8%%%�=v2""%K&m	
2#K	*&8&x=        5 > G P Y b  ">32>4.##.5&764&"'"&=4>2#7"&462"&>2'26."7"&>2"&462–0%#=##=#
,
3=448
ƒ
‹
%0$<G<$õ+ 33=4¼‹V@       ô      73##3'73#'735K–––––Îááá¼&p––––          " &  ?3#535##5'#37'#57'53'3##3ƒqKKq&ppp‹KKKK&KKô^^89^^^^8]          " & *  #353#3753#'#375'#533#3#73#qqKKpKD&]ppp^KKKKqKK88^^8^^q^–        ï    733'7#'7#7#‹>)!†(G6…E>>@
@ ‰H	c‰^„              %'#3?5'57'757^ƒ

^ƒ
 TT	W}WzzØ/BT/BT‘*F&'?,W=I9       	    %/#375#5533>‘		Î
8„q	BÙ>	ô		¶9ááB	–      â  !  7"#.673>."&462#Ø%::"'á #p''        ë  % ? J e  7>76'6'.#"5#35766'&75&76'767232?356&#"&476?7?5"&4625'&"‡
			P				
œ
		

_4�L	


	?9/*                %#53#3'#3#3'#37#3'#5#3]]&&K©©%ÎÎ^pp–]]ƒƒp]]áK^K©99              7'#3?5'5'757ý]^		^]
zUUPYYY^TTá88q88q£2a.A551C2e.            )  35#7'3'?7>.6>&'&K–
	¼(K–v +*# "

&KbŸ!*%ƒ8Kx
# " T &       F �  75#"111+321135#".=4&'&'67>=4676332>716716'5471676;5#"'5&'5&'1&=6'5&'1.#32#q	
	
			M	
	
		
ô

	¼	

           3#3##5##5#535#53533535ÎKKKKKKKKKKKKKKKKKKKKKK]KK          ) 5 B O S  #"&54676674.7733##5#53'''7'77.">'.>7#36


LdcS////l!!!!!!!:�KK	%"dc‡///%!!!!!!!p		

4       á  " )  7#54&+;#5326=#"#53'7'#'7'Î
9
p7"!§!"¼	gg	%L"!!"        C  7".767&4767>7'7"276?6767>54''7&5#@
)68%D 	‰D#I 		100
&>86 Eõ&B%K		001      ô    375'53#535#535#535#535K––––&&KK&&Káá%á&&%       	      ! %  35335'537#373#7#373#35#'3#/	Ï	ê&8]&	ØÏÏØ	þú          ) 6 @ R  375'53'354#"6232?"&54?##5362"'264&"275"&4625&&&ááá£	+	E	©©¼©©: 			J	!	               %  375'3#73#'7#35373#'7#35&áááá88%8^99%9888K99999999        á 	   # ' +  735#35#7#3#375#/5?35'77'75&%/		/%ê/&&/	<T	.T	P?BBÎ	–
–ƒ
–'/	%/&WW      +  # '  7'>7#'7..''73''7g=6 '',1@:2'('.’ßç3'(*³1'('¾Ð     +  #  7'73'67.7'37'.>&'()=9EI0Í''.HE:<'‘'(/!:/('%: 0             # ' + /  #3753##53#5'3#3#533533#535#53'53ýá		á
áÎÎƒ888K888888K888888
Î		Î	8%8%%8%%9&&&&&%%%      '  # 0  #372>?4&'5&#"32'73'?øb}a**%I%TsT	
E}b*
"
%*!(J&Tt9
E            + 8  7264&"7".4>2264&"7".4>22>4."–S#(##(#K!!.!!š#<H<##<H<#ƒ33>33ƒ##(##L!.!!.!8$<##<H<##<”3>33>3          
    ?''7#733##3Ckd"ä™+n¨¨¨¨¨¨®]V"*&K&%&              *  ///?'?'77'77'77'#'#5#7Ó'>C
0/Cg*
8
#+!.9## ]
b.-MMs[8KaNI      #  G Q n  %'&"2?>=4&='"57473764"&54754?2621&327##54?17#"/.=46?62. YY		YY		M

$T		YYY	é55	j	55	j	Ÿ|4	g5j55     ,    $ ( 0 4 8  7#'"27#".4>2.3#3#7!!75!5!5!5!Ì&%S
		
	%�þæ			þúþú©^^				»	ô		ôê¨&    ÿÿ   ò- -5;JPRW^cdnt  "+7656=#.'.>'370#61&31#&'&7333'#&'.7&74'56751?6736767167676?3761231716'27162'1&1#5&'#1&7141"'1&1"73'1641'65147"'4'&'&76767>.72576?6?651&?097.'21&'7"#2#0'4"4&671?6.77'''&'76'031256547…H#	2

&			T		6'Œà+�
&						-@!
			

)


»z™ŸW      - Z ± Ï>  7#"&'&/"""&'&/.465'4676?'4>7>5'454>32'2;2?4/./=4>323265'.#"'&#"=."265#"/&62>&/.72767675?4>754?6?/&/&5'&/&""&/&"22>76?6=/&#""&/ù	

		
		~

C			
@


	[
	


		
�	ä

	
	

        +      /77'7//ô"ô"á áM^=E2=		ò	
ñèß�/7''            #375#53#535#53ýá		á
„]]q^^^^	ô		ôqgÏÏ^^    ÿÿ      ' 4 D  7"&462"&462.''3&57"&462676&''"1>&'&#ö!!¦!!2"
1 a!!
	ÒD&	)
ó!e!t(!2	"| #
              73#'735753#ááá¯55>KKáááá955=
3       á  
    73733'77#3733'767?,	+
,…=?d©qqB((z©++BCC      ô     %#53#5335#áááááááÎ&q&q&           7".?#.767>73+f4#§n#	)J	B
g          6  7".?#.767>73+'"732?326=4&#f4#§n >	r	#	)J	B
gÑC	.hB           36+.=46;76Æ4#§m
	)J
B
g          6  36+.=46;7627676&#'576."#"3Æ4#§m!=
r	
	)J
B
gÐC	.hB         / A M R h  %''7'&"32767672>4+".7677"'.7>;3737'7/'#'7'&/7>4&''':9		$"â*FI© ,
"#"Ê6#
+Š:;:ë'(:;%!·,FK… 
##"'$6@,}<<<       ô     # '  73##'5#53546;2+335##373#73#¼8ƒ8888^ƒƒ&&ô©©¼©ƒƒƒƒƒ         Ï   ?3#&ÒjÄ

f        Ï   '5Ä

fÒj       Ï   7'57h

f&Òj        Ï   %#'73Òih

f       ÿ >  %"&'67"&'&'7.'&513&'&'&767'5476762676	$+-**
		

å"
	
			
       " & *  7#'375'#3#375'#7#375'53#5#53ý ?

K		>!		8

:9		8
–8^%Î&&^^	K		K	^
8		8
VV
8		8z99ƒ%%%%          " & *  #3'375'#3#375'#737553#57#53ý8		9:

8		!>		K

? 
á%^8ƒ&&	8
VV
8		8
]
K		K
]
8/&&ƒ88ƒ&        # ' + / 3  7#'5'#5375'#3##37573375'3#3##53#53ý! 
	

%				 "		&	 C 
%
„889¼K G
%	&		&	%
G 	&		"  "		&ÅK8K        	  -  75'73''37'57#53'#3#'7'73#37#5�""""bEEN888:9OEEO988:8²K!"K8K""Kg79--79--         	    ' + 3 7 ? C G K  '#5'75#'37'7#'573'35##'573'35##'573'35##'573'35+35#36(''(N%		%
&�8

8	8&&B%		%
&�8

8	8&&%%%%'RT'èRR''b	&		&
%	8

8
%–	&		&
9
8		8	&p            754>3.#375'3#5^)#.8&¼&&¼©% *%pppp      	   ' /  737'#'55#37'>'6'7'64'7'6'74II4	H;;..Å%&ÑHôH	^W;Æ:K%*$'+/         / [ _  73737575'5'#'##37#5/?53?3#'7#567>32#546?>4'1.'1&"#53� -
  	. /

/))((	 
-  .	  
-  -
((((q			
]       , B N Z b f j  74626?'."577>#"&"276?"./&'"&>4&'3#.54737!!75!5!5!5!e				s				ž		Ïþæ			þúþúT	"	


	
Î	ô		ôê¨&          7#'#'5'57573733#'37''�/

/ .	  
-?F@ 
-  -
  	.  -
0FA       / 6  73737575'5'#'##37#5/?53?3#'737''� -
  	. /

/))((F@ 
-  .	  
-  -
(((( FA        ô    !  7375'#53535#35#'535#35#–qqq©		8		ô––©–^K	„	8&	^	    ÿÿ.   &  3&'5#3#535#'5>.67''ô	à]K8g	¤($!($8-' 
gS©
»t"($!($R;4     ,   + 1 7  3&'5#3#535#'5"2>4.".4>32'7'7''7'ô	à]K8g	Î##(##!!		0
gS©
»g#(##(#ƒ!.!C.        ,   +  3&'5#3#535#'5"2>4.".4>32ô	à]K8g	Î##(##!!
gS©
»g#(##(#ƒ!.!      ÿþ.  . 1  3&'5#3#535#'52'.'.7>76'ô	à]K8g	Î

	
:9
gS©
»g
	
	
K&K           #3#35#5375#53ô		g8–8g	áá
»

»²©      , ô  3 7 ; G S  732+"/&"+"&=46";2?62;26=4&#3#%3#'2+"&46;2+"&463K–!!

!!	"	áŸ/–/ô!K!



!K!K		K8888%          )  754'&"6577>=6&'7"/&4·O(,Œ¡4èH!;šj	”á		Ï		¥�	       *  7'&/"/&4?'&4?627>#553Ì`*$$*b2<II='X 	!"	 Y\A87.I         # 0 8 @  73535#5##3##33535#75##33535&"2?64"&4?7'762R–J	ŒŒ¢yÎ^–.�	Œžy             3#'73'5#=3Ž{öƒkÖ_æÎÉ&KK        ô   '  735#5#'375>4&'5'#".4>2�%
K		K
z#(##(#ƒ/8Z,2,)		),2,)		z##(##         á     5#";#35#5#"&46;#53ág^8&#^Ï^'ÏÏ     , ÷   ' 7 C  53!53!7#5##"&54?4#"563232651#531632"'32654&"þÔ€
"$
	?*^&&88	&
˜C;          #375#535#53ô		ô	áááá
Î		ÎÅ„&          / E Z z Š  7&'&7>2327354&'.=4>37."5#3532>4'.=>6>25'&26?5'.467#53#'573I			
k^
	

ÜKT		|'66&rë
	1.t

	`
	M	q	'67%      %- $ ? L  23'.=2>7>.'.">5//?—
!"

ˆ)		)
	4Q$	[,J&#

#'L	89" 		 "`'3k       %- $ ? i q  22'.=>7>.'.">5'#'54>?>4&'&"#'4>7673#'—
!"

ˆ)		)

`
,J&#

#'L	89" 		 "
a      %- $ ? S  22'.=>7>.'.">5/#'#37375'7—
!"

ˆ)		)

G%%%%%%%%,J&#

#'L	89" 		 "&&%%&&%%          +  7'.>267>54."75#5##335âPOH9?G0d'.&&E%&&¹&OP+EB#5€''-'K%%%%          #  7'.>267>54."'3#âPOH9?G0d'.&&]]¹&OP+EB#5€''-']      Æ                                                 (      
 $ /        S  	   f  	   t  	   ‚  	   �  	   ž  	   ¶  	 
 H Ä  	  &codiconRegularcodiconcodiconVersion 1.11codiconThe icon font for Visual Studio Codehttp://fontello.com c o d i c o n R e g u l a r c o d i c o n c o d i c o n V e r s i o n   1 . 1 1 c o d i c o n T h e   i c o n   f o n t   f o r   V i s u a l   S t u d i o   C o d e h t t p : / / f o n t e l l o . c o m                              Î	
 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€�‚ƒ„…†‡ˆ‰Š‹Œ�Ž��‘’“”•–—˜™š›œ�žŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ 	
 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€�‚ƒ„…†‡ˆ‰Š‹Œ�Ž��‘’“”•–—˜™š›œ�žŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ accountactivate-breakpointsaddarchive
arrow-botharrow-circle-downarrow-circle-leftarrow-circle-rightarrow-circle-up
arrow-down
arrow-leftarrow-rightarrow-small-downarrow-small-leftarrow-small-rightarrow-small-up
arrow-swaparrow-upattachazure-devopsazurebeaker-stopbeakerbell-dotbell-slash-dot
bell-slashbellblankboldbookbookmarkbracket-dotbracket-error	briefcase	broadcastbrowserbugcalendarcall-incomingcall-outgoingcase-sensitive	check-allcheck	checklistchevron-downchevron-leftchevron-right
chevron-upchipchrome-closechrome-maximizechrome-minimizechrome-restorecircle-filledcircle-large-filledcircle-largecircle-slashcircle-small-filledcircle-smallcirclecircuit-board	clear-allclippy	close-allclosecloud-downloadcloud-uploadcloudcode-osscodecoffeecollapse-all
color-modecombinecomment-discussioncomment-draftcomment-unresolvedcommentcompass-activecompass-dotcompasscopilotcopycoveragecredit-carddash	dashboarddatabase	debug-alldebug-alt-small	debug-alt'debug-breakpoint-conditional-unverifieddebug-breakpoint-conditional debug-breakpoint-data-unverifieddebug-breakpoint-data$debug-breakpoint-function-unverifieddebug-breakpoint-functiondebug-breakpoint-log-unverifieddebug-breakpoint-logdebug-breakpoint-unsupporteddebug-consoledebug-continue-smalldebug-continuedebug-coveragedebug-disconnectdebug-line-by-linedebug-pausedebug-rerundebug-restart-framedebug-restartdebug-reverse-continuedebug-stackframe-activedebug-stackframedebug-startdebug-step-backdebug-step-intodebug-step-outdebug-step-over
debug-stopdebugdesktop-downloaddevice-camera-videodevice-cameradevice-mobile
diff-addeddiff-ignoreddiff-modifieddiff-multiplediff-removeddiff-renameddiff-singlediffdiscardediteditor-layoutellipsisempty-windowerror-smallerrorexclude
expand-allexport
extensions
eye-closedeyefeedbackfile-binary	file-code
file-mediafile-pdffile-submodulefile-symlink-directoryfile-symlink-filefile-zipfilefilesfilter-filledfilterflame	fold-downfold-upfoldfolder-activefolder-libraryfolder-openedfoldergamegeargiftgist-secret
git-commitgit-compare	git-fetch	git-mergegit-pull-request-closedgit-pull-request-creategit-pull-request-draftgit-pull-request-go-to-changesgit-pull-request-new-changesgit-pull-requestgit-stash-applygit-stash-pop	git-stashgithub-action
github-altgithub-invertedgithub-projectgithubglobe
go-to-filego-to-searchgrabber
graph-left
graph-linegraph-scattergraphgrippergroup-by-ref-typeheart-filledhearthistoryhomehorizontal-rulehubotinboxindentinfoinsertinspectissue-draftissue-reopenedissuesitalicjerseyjsonkebab-verticalkeylawlayers-active
layers-dotlayerslayout-activitybar-leftlayout-activitybar-rightlayout-centeredlayout-menubarlayout-panel-centerlayout-panel-justifylayout-panel-leftlayout-panel-offlayout-panel-rightlayout-panellayout-sidebar-left-offlayout-sidebar-leftlayout-sidebar-right-offlayout-sidebar-rightlayout-statusbarlayoutlibrarylightbulb-autofixlightbulb-sparkle	lightbulblink-externallinklist-filter	list-flatlist-orderedlist-selection	list-treelist-unordered
live-shareloadinglocation
lock-smalllockmagnet	mail-readmail
map-filledmap-vertical-filledmap-verticalmapmarkdown	megaphonementionmenumerge
mic-filledmic	milestonemirrormortar-boardmovemultiple-windowsmusicmutenew-file
new-foldernewline
no-newlinenotenotebook-templatenotebookoctofaceopen-previeworganizationoutputpackagepaintcanpass-filledpass
percentage
person-addpersonpiano	pie-chartpinpinned-dirtypinnedplay-circleplayplugpreserve-casepreviewprimitive-squareprojectpulsequestionquoteradio-tower	reactionsrecord-keysrecord-smallrecordredo
referencesrefreshregexremote-explorerremoteremovereplace-allreplacereply
repo-clone
repo-fetchrepo-force-pushrepo-forked	repo-pull	repo-pushreporeportrequest-changesrobotrocketroot-folder-openedroot-folderrssruby	run-aboverun-all-coveragerun-all	run-belowrun-coverage
run-errorssave-allsave-assavescreen-fullscreen-normalsearch-fuzzysearch-stopsearchsendserver-environmentserver-processserversettings-gearsettingsshareshieldsign-insign-outsmileysnakesort-precedencesource-controlsparkle-filledsparklesplit-horizontalsplit-verticalsquirrel
star-empty	star-full	star-halfstop-circlesurround-withsymbol-arraysymbol-booleansymbol-classsymbol-colorsymbol-constantsymbol-enum-membersymbol-enumsymbol-eventsymbol-fieldsymbol-filesymbol-interface
symbol-keysymbol-keywordsymbol-methodsymbol-miscsymbol-namespacesymbol-numericsymbol-operatorsymbol-parametersymbol-propertysymbol-rulersymbol-snippetsymbol-stringsymbol-structuresymbol-variablesync-ignoredsynctabletagtargettasklist	telescopeterminal-bashterminal-cmdterminal-debianterminal-linuxterminal-powershellterminal-tmuxterminal-ubuntuterminal	text-size
three-barsthumbsdown-filled
thumbsdownthumbsup-filledthumbsuptoolstrashtriangle-downtriangle-lefttriangle-righttriangle-uptwittertype-hierarchy-subtype-hierarchy-supertype-hierarchyunfoldungroup-by-ref-typeunlockunmute
unverifiedvariable-groupverified-filledverifiedversions	vm-active
vm-connect
vm-outline
vm-runningvmvrvscode-insidersvscodewandwarningwatch
whitespace
whole-wordwindow	word-wrapworkspace-trustedworkspace-unknownworkspace-untrustedzoom-inzoom-out  :root{color-scheme:light dark}body{--transparent-blue: #2196F355;--light-pink: #ff69b460;--gray: #888888;--sidebar-width: 250px;--box-shadow: rgba(0, 0, 0, .133) 0px 1.6px 3.6px 0px, rgba(0, 0, 0, .11) 0px .3px .9px 0px}html,body{width:100%;height:100%;padding:0;margin:0;overflow:hidden;display:flex;overscroll-behavior-x:none}#root{width:100%;height:100%;display:flex}body,dialog{background-color:var(--vscode-panel-background);color:var(--vscode-foreground);font-family:var(--vscode-font-family);font-weight:var(--vscode-font-weight);font-size:var(--vscode-font-size);-webkit-font-smoothing:antialiased}a{color:var(--vscode-textLink-foreground)}dialog{border:none;padding:0;box-shadow:var(--box-shadow);line-height:28px;max-width:400px}dialog .title{display:flex;align-items:center;margin:0;padding:0 5px;height:32px;background-color:var(--vscode-sideBar-background);max-width:400px}dialog .title .codicon{margin-right:3px}dialog .body{padding:10px;text-align:center}.button{color:var(--vscode-button-foreground);background:var(--vscode-button-background);margin:10px;border:none;height:28px;min-width:40px;cursor:pointer;-webkit-user-select:none;user-select:none}.button:focus{outline:1px solid var(--vscode-focusBorder)}.button:hover{background:var(--vscode-button-hoverBackground)}.button.secondary{color:var(--vscode-button-secondaryForeground);background:var(--vscode-button-secondaryBackground)}.button.secondary:hover{background:var(--vscode-button-secondaryHoverBackground)}*{box-sizing:border-box;min-width:0;min-height:0}*[hidden],.hidden{display:none!important}.invisible{visibility:hidden!important}svg{fill:currentColor}.vbox{display:flex;flex-direction:column;flex:auto;position:relative}.fill{position:absolute;top:0;right:0;bottom:0;left:0}.hbox{display:flex;flex:auto;position:relative}.spacer{flex:auto}.codicon-check{color:var(--vscode-charts-green)}.codicon-error{color:var(--vscode-errorForeground)}.codicon-warning{color:var(--vscode-list-warningForeground)}.codicon-circle-outline{color:var(--vscode-disabledForeground)}input[type=text],input[type=search]{color:var(--vscode-input-foreground);background-color:var(--vscode-input-background);border:none;outline:none}.codicon-loading{animation:spin 1s infinite linear}::placeholder{color:var(--vscode-input-placeholderForeground)}@keyframes spin{to{transform:rotate(360deg)}}@font-face{font-family:codicon;src:url(/assets/codicon-DCmgc-ay.ttf) format("truetype")}.codicon{font: 16px/1 codicon;flex:none;display:inline-block;text-decoration:none;text-rendering:auto;text-align:center;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.codicon-add:before{content:"î© "}.codicon-plus:before{content:"î© "}.codicon-gist-new:before{content:"î© "}.codicon-repo-create:before{content:"î© "}.codicon-lightbulb:before{content:"î©¡"}.codicon-light-bulb:before{content:"î©¡"}.codicon-repo:before{content:"î©¢"}.codicon-repo-delete:before{content:"î©¢"}.codicon-gist-fork:before{content:"î©£"}.codicon-repo-forked:before{content:"î©£"}.codicon-git-pull-request:before{content:"î©¤"}.codicon-git-pull-request-abandoned:before{content:"î©¤"}.codicon-record-keys:before{content:"î©¥"}.codicon-keyboard:before{content:"î©¥"}.codicon-tag:before{content:"î©¦"}.codicon-git-pull-request-label:before{content:"î©¦"}.codicon-tag-add:before{content:"î©¦"}.codicon-tag-remove:before{content:"î©¦"}.codicon-person:before{content:"î©§"}.codicon-person-follow:before{content:"î©§"}.codicon-person-outline:before{content:"î©§"}.codicon-person-filled:before{content:"î©§"}.codicon-git-branch:before{content:"î©¨"}.codicon-git-branch-create:before{content:"î©¨"}.codicon-git-branch-delete:before{content:"î©¨"}.codicon-source-control:before{content:"î©¨"}.codicon-mirror:before{content:"î©©"}.codicon-mirror-public:before{content:"î©©"}.codicon-star:before{content:"î©ª"}.codicon-star-add:before{content:"î©ª"}.codicon-star-delete:before{content:"î©ª"}.codicon-star-empty:before{content:"î©ª"}.codicon-comment:before{content:"î©«"}.codicon-comment-add:before{content:"î©«"}.codicon-alert:before{content:"î©¬"}.codicon-warning:before{content:"î©¬"}.codicon-search:before{content:"î©­"}.codicon-search-save:before{content:"î©­"}.codicon-log-out:before{content:"î©®"}.codicon-sign-out:before{content:"î©®"}.codicon-log-in:before{content:"î©¯"}.codicon-sign-in:before{content:"î©¯"}.codicon-eye:before{content:"î©°"}.codicon-eye-unwatch:before{content:"î©°"}.codicon-eye-watch:before{content:"î©°"}.codicon-circle-filled:before{content:"î©±"}.codicon-primitive-dot:before{content:"î©±"}.codicon-close-dirty:before{content:"î©±"}.codicon-debug-breakpoint:before{content:"î©±"}.codicon-debug-breakpoint-disabled:before{content:"î©±"}.codicon-debug-hint:before{content:"î©±"}.codicon-terminal-decoration-success:before{content:"î©±"}.codicon-primitive-square:before{content:"î©²"}.codicon-edit:before{content:"î©³"}.codicon-pencil:before{content:"î©³"}.codicon-info:before{content:"î©´"}.codicon-issue-opened:before{content:"î©´"}.codicon-gist-private:before{content:"î©µ"}.codicon-git-fork-private:before{content:"î©µ"}.codicon-lock:before{content:"î©µ"}.codicon-mirror-private:before{content:"î©µ"}.codicon-close:before{content:"î©¶"}.codicon-remove-close:before{content:"î©¶"}.codicon-x:before{content:"î©¶"}.codicon-repo-sync:before{content:"î©·"}.codicon-sync:before{content:"î©·"}.codicon-clone:before{content:"î©¸"}.codicon-desktop-download:before{content:"î©¸"}.codicon-beaker:before{content:"î©¹"}.codicon-microscope:before{content:"î©¹"}.codicon-vm:before{content:"î©º"}.codicon-device-desktop:before{content:"î©º"}.codicon-file:before{content:"î©»"}.codicon-file-text:before{content:"î©»"}.codicon-more:before{content:"î©¼"}.codicon-ellipsis:before{content:"î©¼"}.codicon-kebab-horizontal:before{content:"î©¼"}.codicon-mail-reply:before{content:"î©½"}.codicon-reply:before{content:"î©½"}.codicon-organization:before{content:"î©¾"}.codicon-organization-filled:before{content:"î©¾"}.codicon-organization-outline:before{content:"î©¾"}.codicon-new-file:before{content:"î©¿"}.codicon-file-add:before{content:"î©¿"}.codicon-new-folder:before{content:"îª€"}.codicon-file-directory-create:before{content:"îª€"}.codicon-trash:before{content:"îª�"}.codicon-trashcan:before{content:"îª�"}.codicon-history:before{content:"îª‚"}.codicon-clock:before{content:"îª‚"}.codicon-folder:before{content:"îªƒ"}.codicon-file-directory:before{content:"îªƒ"}.codicon-symbol-folder:before{content:"îªƒ"}.codicon-logo-github:before{content:"îª„"}.codicon-mark-github:before{content:"îª„"}.codicon-github:before{content:"îª„"}.codicon-terminal:before{content:"îª…"}.codicon-console:before{content:"îª…"}.codicon-repl:before{content:"îª…"}.codicon-zap:before{content:"îª†"}.codicon-symbol-event:before{content:"îª†"}.codicon-error:before{content:"îª‡"}.codicon-stop:before{content:"îª‡"}.codicon-variable:before{content:"îªˆ"}.codicon-symbol-variable:before{content:"îªˆ"}.codicon-array:before{content:"îªŠ"}.codicon-symbol-array:before{content:"îªŠ"}.codicon-symbol-module:before{content:"îª‹"}.codicon-symbol-package:before{content:"îª‹"}.codicon-symbol-namespace:before{content:"îª‹"}.codicon-symbol-object:before{content:"îª‹"}.codicon-symbol-method:before{content:"îªŒ"}.codicon-symbol-function:before{content:"îªŒ"}.codicon-symbol-constructor:before{content:"îªŒ"}.codicon-symbol-boolean:before{content:"îª�"}.codicon-symbol-null:before{content:"îª�"}.codicon-symbol-numeric:before{content:"îª�"}.codicon-symbol-number:before{content:"îª�"}.codicon-symbol-structure:before{content:"îª‘"}.codicon-symbol-struct:before{content:"îª‘"}.codicon-symbol-parameter:before{content:"îª’"}.codicon-symbol-type-parameter:before{content:"îª’"}.codicon-symbol-key:before{content:"îª“"}.codicon-symbol-text:before{content:"îª“"}.codicon-symbol-reference:before{content:"îª”"}.codicon-go-to-file:before{content:"îª”"}.codicon-symbol-enum:before{content:"îª•"}.codicon-symbol-value:before{content:"îª•"}.codicon-symbol-ruler:before{content:"îª–"}.codicon-symbol-unit:before{content:"îª–"}.codicon-activate-breakpoints:before{content:"îª—"}.codicon-archive:before{content:"îª˜"}.codicon-arrow-both:before{content:"îª™"}.codicon-arrow-down:before{content:"îªš"}.codicon-arrow-left:before{content:"îª›"}.codicon-arrow-right:before{content:"îªœ"}.codicon-arrow-small-down:before{content:"îª�"}.codicon-arrow-small-left:before{content:"îªž"}.codicon-arrow-small-right:before{content:"îªŸ"}.codicon-arrow-small-up:before{content:"îª "}.codicon-arrow-up:before{content:"îª¡"}.codicon-bell:before{content:"îª¢"}.codicon-bold:before{content:"îª£"}.codicon-book:before{content:"îª¤"}.codicon-bookmark:before{content:"îª¥"}.codicon-debug-breakpoint-conditional-unverified:before{content:"îª¦"}.codicon-debug-breakpoint-conditional:before{content:"îª§"}.codicon-debug-breakpoint-conditional-disabled:before{content:"îª§"}.codicon-debug-breakpoint-data-unverified:before{content:"îª¨"}.codicon-debug-breakpoint-data:before{content:"îª©"}.codicon-debug-breakpoint-data-disabled:before{content:"îª©"}.codicon-debug-breakpoint-log-unverified:before{content:"îªª"}.codicon-debug-breakpoint-log:before{content:"îª«"}.codicon-debug-breakpoint-log-disabled:before{content:"îª«"}.codicon-briefcase:before{content:"îª¬"}.codicon-broadcast:before{content:"îª­"}.codicon-browser:before{content:"îª®"}.codicon-bug:before{content:"îª¯"}.codicon-calendar:before{content:"îª°"}.codicon-case-sensitive:before{content:"îª±"}.codicon-check:before{content:"îª²"}.codicon-checklist:before{content:"îª³"}.codicon-chevron-down:before{content:"îª´"}.codicon-chevron-left:before{content:"îªµ"}.codicon-chevron-right:before{content:"îª¶"}.codicon-chevron-up:before{content:"îª·"}.codicon-chrome-close:before{content:"îª¸"}.codicon-chrome-maximize:before{content:"îª¹"}.codicon-chrome-minimize:before{content:"îªº"}.codicon-chrome-restore:before{content:"îª»"}.codicon-circle-outline:before{content:"îª¼"}.codicon-circle:before{content:"îª¼"}.codicon-debug-breakpoint-unverified:before{content:"îª¼"}.codicon-terminal-decoration-incomplete:before{content:"îª¼"}.codicon-circle-slash:before{content:"îª½"}.codicon-circuit-board:before{content:"îª¾"}.codicon-clear-all:before{content:"îª¿"}.codicon-clippy:before{content:"î«€"}.codicon-close-all:before{content:"î«�"}.codicon-cloud-download:before{content:"î«‚"}.codicon-cloud-upload:before{content:"î«ƒ"}.codicon-code:before{content:"î«„"}.codicon-collapse-all:before{content:"î«…"}.codicon-color-mode:before{content:"î«†"}.codicon-comment-discussion:before{content:"î«‡"}.codicon-credit-card:before{content:"î«‰"}.codicon-dash:before{content:"î«Œ"}.codicon-dashboard:before{content:"î«�"}.codicon-database:before{content:"î«Ž"}.codicon-debug-continue:before{content:"î«�"}.codicon-debug-disconnect:before{content:"î«�"}.codicon-debug-pause:before{content:"î«‘"}.codicon-debug-restart:before{content:"î«’"}.codicon-debug-start:before{content:"î«“"}.codicon-debug-step-into:before{content:"î«”"}.codicon-debug-step-out:before{content:"î«•"}.codicon-debug-step-over:before{content:"î«–"}.codicon-debug-stop:before{content:"î«—"}.codicon-debug:before{content:"î«˜"}.codicon-device-camera-video:before{content:"î«™"}.codicon-device-camera:before{content:"î«š"}.codicon-device-mobile:before{content:"î«›"}.codicon-diff-added:before{content:"î«œ"}.codicon-diff-ignored:before{content:"î«�"}.codicon-diff-modified:before{content:"î«ž"}.codicon-diff-removed:before{content:"î«Ÿ"}.codicon-diff-renamed:before{content:"î« "}.codicon-diff:before{content:"î«¡"}.codicon-diff-sidebyside:before{content:"î«¡"}.codicon-discard:before{content:"î«¢"}.codicon-editor-layout:before{content:"î«£"}.codicon-empty-window:before{content:"î«¤"}.codicon-exclude:before{content:"î«¥"}.codicon-extensions:before{content:"î«¦"}.codicon-eye-closed:before{content:"î«§"}.codicon-file-binary:before{content:"î«¨"}.codicon-file-code:before{content:"î«©"}.codicon-file-media:before{content:"î«ª"}.codicon-file-pdf:before{content:"î««"}.codicon-file-submodule:before{content:"î«¬"}.codicon-file-symlink-directory:before{content:"î«­"}.codicon-file-symlink-file:before{content:"î«®"}.codicon-file-zip:before{content:"î«¯"}.codicon-files:before{content:"î«°"}.codicon-filter:before{content:"î«±"}.codicon-flame:before{content:"î«²"}.codicon-fold-down:before{content:"î«³"}.codicon-fold-up:before{content:"î«´"}.codicon-fold:before{content:"î«µ"}.codicon-folder-active:before{content:"î«¶"}.codicon-folder-opened:before{content:"î«·"}.codicon-gear:before{content:"î«¸"}.codicon-gift:before{content:"î«¹"}.codicon-gist-secret:before{content:"î«º"}.codicon-gist:before{content:"î«»"}.codicon-git-commit:before{content:"î«¼"}.codicon-git-compare:before{content:"î«½"}.codicon-compare-changes:before{content:"î«½"}.codicon-git-merge:before{content:"î«¾"}.codicon-github-action:before{content:"î«¿"}.codicon-github-alt:before{content:"î¬€"}.codicon-globe:before{content:"î¬�"}.codicon-grabber:before{content:"î¬‚"}.codicon-graph:before{content:"î¬ƒ"}.codicon-gripper:before{content:"î¬„"}.codicon-heart:before{content:"î¬…"}.codicon-home:before{content:"î¬†"}.codicon-horizontal-rule:before{content:"î¬‡"}.codicon-hubot:before{content:"î¬ˆ"}.codicon-inbox:before{content:"î¬‰"}.codicon-issue-reopened:before{content:"î¬‹"}.codicon-issues:before{content:"î¬Œ"}.codicon-italic:before{content:"î¬�"}.codicon-jersey:before{content:"î¬Ž"}.codicon-json:before{content:"î¬�"}.codicon-kebab-vertical:before{content:"î¬�"}.codicon-key:before{content:"î¬‘"}.codicon-law:before{content:"î¬’"}.codicon-lightbulb-autofix:before{content:"î¬“"}.codicon-link-external:before{content:"î¬”"}.codicon-link:before{content:"î¬•"}.codicon-list-ordered:before{content:"î¬–"}.codicon-list-unordered:before{content:"î¬—"}.codicon-live-share:before{content:"î¬˜"}.codicon-loading:before{content:"î¬™"}.codicon-location:before{content:"î¬š"}.codicon-mail-read:before{content:"î¬›"}.codicon-mail:before{content:"î¬œ"}.codicon-markdown:before{content:"î¬�"}.codicon-megaphone:before{content:"î¬ž"}.codicon-mention:before{content:"î¬Ÿ"}.codicon-milestone:before{content:"î¬ "}.codicon-git-pull-request-milestone:before{content:"î¬ "}.codicon-mortar-board:before{content:"î¬¡"}.codicon-move:before{content:"î¬¢"}.codicon-multiple-windows:before{content:"î¬£"}.codicon-mute:before{content:"î¬¤"}.codicon-no-newline:before{content:"î¬¥"}.codicon-note:before{content:"î¬¦"}.codicon-octoface:before{content:"î¬§"}.codicon-open-preview:before{content:"î¬¨"}.codicon-package:before{content:"î¬©"}.codicon-paintcan:before{content:"î¬ª"}.codicon-pin:before{content:"î¬«"}.codicon-play:before{content:"î¬¬"}.codicon-run:before{content:"î¬¬"}.codicon-plug:before{content:"î¬­"}.codicon-preserve-case:before{content:"î¬®"}.codicon-preview:before{content:"î¬¯"}.codicon-project:before{content:"î¬°"}.codicon-pulse:before{content:"î¬±"}.codicon-question:before{content:"î¬²"}.codicon-quote:before{content:"î¬³"}.codicon-radio-tower:before{content:"î¬´"}.codicon-reactions:before{content:"î¬µ"}.codicon-references:before{content:"î¬¶"}.codicon-refresh:before{content:"î¬·"}.codicon-regex:before{content:"î¬¸"}.codicon-remote-explorer:before{content:"î¬¹"}.codicon-remote:before{content:"î¬º"}.codicon-remove:before{content:"î¬»"}.codicon-replace-all:before{content:"î¬¼"}.codicon-replace:before{content:"î¬½"}.codicon-repo-clone:before{content:"î¬¾"}.codicon-repo-force-push:before{content:"î¬¿"}.codicon-repo-pull:before{content:"î­€"}.codicon-repo-push:before{content:"î­�"}.codicon-report:before{content:"î­‚"}.codicon-request-changes:before{content:"î­ƒ"}.codicon-rocket:before{content:"î­„"}.codicon-root-folder-opened:before{content:"î­…"}.codicon-root-folder:before{content:"î­†"}.codicon-rss:before{content:"î­‡"}.codicon-ruby:before{content:"î­ˆ"}.codicon-save-all:before{content:"î­‰"}.codicon-save-as:before{content:"î­Š"}.codicon-save:before{content:"î­‹"}.codicon-screen-full:before{content:"î­Œ"}.codicon-screen-normal:before{content:"î­�"}.codicon-search-stop:before{content:"î­Ž"}.codicon-server:before{content:"î­�"}.codicon-settings-gear:before{content:"î­‘"}.codicon-settings:before{content:"î­’"}.codicon-shield:before{content:"î­“"}.codicon-smiley:before{content:"î­”"}.codicon-sort-precedence:before{content:"î­•"}.codicon-split-horizontal:before{content:"î­–"}.codicon-split-vertical:before{content:"î­—"}.codicon-squirrel:before{content:"î­˜"}.codicon-star-full:before{content:"î­™"}.codicon-star-half:before{content:"î­š"}.codicon-symbol-class:before{content:"î­›"}.codicon-symbol-color:before{content:"î­œ"}.codicon-symbol-constant:before{content:"î­�"}.codicon-symbol-enum-member:before{content:"î­ž"}.codicon-symbol-field:before{content:"î­Ÿ"}.codicon-symbol-file:before{content:"î­ "}.codicon-symbol-interface:before{content:"î­¡"}.codicon-symbol-keyword:before{content:"î­¢"}.codicon-symbol-misc:before{content:"î­£"}.codicon-symbol-operator:before{content:"î­¤"}.codicon-symbol-property:before{content:"î­¥"}.codicon-wrench:before{content:"î­¥"}.codicon-wrench-subaction:before{content:"î­¥"}.codicon-symbol-snippet:before{content:"î­¦"}.codicon-tasklist:before{content:"î­§"}.codicon-telescope:before{content:"î­¨"}.codicon-text-size:before{content:"î­©"}.codicon-three-bars:before{content:"î­ª"}.codicon-thumbsdown:before{content:"î­«"}.codicon-thumbsup:before{content:"î­¬"}.codicon-tools:before{content:"î­­"}.codicon-triangle-down:before{content:"î­®"}.codicon-triangle-left:before{content:"î­¯"}.codicon-triangle-right:before{content:"î­°"}.codicon-triangle-up:before{content:"î­±"}.codicon-twitter:before{content:"î­²"}.codicon-unfold:before{content:"î­³"}.codicon-unlock:before{content:"î­´"}.codicon-unmute:before{content:"î­µ"}.codicon-unverified:before{content:"î­¶"}.codicon-verified:before{content:"î­·"}.codicon-versions:before{content:"î­¸"}.codicon-vm-active:before{content:"î­¹"}.codicon-vm-outline:before{content:"î­º"}.codicon-vm-running:before{content:"î­»"}.codicon-watch:before{content:"î­¼"}.codicon-whitespace:before{content:"î­½"}.codicon-whole-word:before{content:"î­¾"}.codicon-window:before{content:"î­¿"}.codicon-word-wrap:before{content:"î®€"}.codicon-zoom-in:before{content:"î®�"}.codicon-zoom-out:before{content:"î®‚"}.codicon-list-filter:before{content:"î®ƒ"}.codicon-list-flat:before{content:"î®„"}.codicon-list-selection:before{content:"î®…"}.codicon-selection:before{content:"î®…"}.codicon-list-tree:before{content:"î®†"}.codicon-debug-breakpoint-function-unverified:before{content:"î®‡"}.codicon-debug-breakpoint-function:before{content:"î®ˆ"}.codicon-debug-breakpoint-function-disabled:before{content:"î®ˆ"}.codicon-debug-stackframe-active:before{content:"î®‰"}.codicon-circle-small-filled:before{content:"î®Š"}.codicon-debug-stackframe-dot:before{content:"î®Š"}.codicon-terminal-decoration-mark:before{content:"î®Š"}.codicon-debug-stackframe:before{content:"î®‹"}.codicon-debug-stackframe-focused:before{content:"î®‹"}.codicon-debug-breakpoint-unsupported:before{content:"î®Œ"}.codicon-symbol-string:before{content:"î®�"}.codicon-debug-reverse-continue:before{content:"î®Ž"}.codicon-debug-step-back:before{content:"î®�"}.codicon-debug-restart-frame:before{content:"î®�"}.codicon-debug-alt:before{content:"î®‘"}.codicon-call-incoming:before{content:"î®’"}.codicon-call-outgoing:before{content:"î®“"}.codicon-menu:before{content:"î®”"}.codicon-expand-all:before{content:"î®•"}.codicon-feedback:before{content:"î®–"}.codicon-git-pull-request-reviewer:before{content:"î®–"}.codicon-group-by-ref-type:before{content:"î®—"}.codicon-ungroup-by-ref-type:before{content:"î®˜"}.codicon-account:before{content:"î®™"}.codicon-git-pull-request-assignee:before{content:"î®™"}.codicon-bell-dot:before{content:"î®š"}.codicon-debug-console:before{content:"î®›"}.codicon-library:before{content:"î®œ"}.codicon-output:before{content:"î®�"}.codicon-run-all:before{content:"î®ž"}.codicon-sync-ignored:before{content:"î®Ÿ"}.codicon-pinned:before{content:"î® "}.codicon-github-inverted:before{content:"î®¡"}.codicon-server-process:before{content:"î®¢"}.codicon-server-environment:before{content:"î®£"}.codicon-pass:before{content:"î®¤"}.codicon-issue-closed:before{content:"î®¤"}.codicon-stop-circle:before{content:"î®¥"}.codicon-play-circle:before{content:"î®¦"}.codicon-record:before{content:"î®§"}.codicon-debug-alt-small:before{content:"î®¨"}.codicon-vm-connect:before{content:"î®©"}.codicon-cloud:before{content:"î®ª"}.codicon-merge:before{content:"î®«"}.codicon-export:before{content:"î®¬"}.codicon-graph-left:before{content:"î®­"}.codicon-magnet:before{content:"î®®"}.codicon-notebook:before{content:"î®¯"}.codicon-redo:before{content:"î®°"}.codicon-check-all:before{content:"î®±"}.codicon-pinned-dirty:before{content:"î®²"}.codicon-pass-filled:before{content:"î®³"}.codicon-circle-large-filled:before{content:"î®´"}.codicon-circle-large:before{content:"î®µ"}.codicon-circle-large-outline:before{content:"î®µ"}.codicon-combine:before{content:"î®¶"}.codicon-gather:before{content:"î®¶"}.codicon-table:before{content:"î®·"}.codicon-variable-group:before{content:"î®¸"}.codicon-type-hierarchy:before{content:"î®¹"}.codicon-type-hierarchy-sub:before{content:"î®º"}.codicon-type-hierarchy-super:before{content:"î®»"}.codicon-git-pull-request-create:before{content:"î®¼"}.codicon-run-above:before{content:"î®½"}.codicon-run-below:before{content:"î®¾"}.codicon-notebook-template:before{content:"î®¿"}.codicon-debug-rerun:before{content:"î¯€"}.codicon-workspace-trusted:before{content:"î¯�"}.codicon-workspace-untrusted:before{content:"î¯‚"}.codicon-workspace-unknown:before{content:"î¯ƒ"}.codicon-terminal-cmd:before{content:"î¯„"}.codicon-terminal-debian:before{content:"î¯…"}.codicon-terminal-linux:before{content:"î¯†"}.codicon-terminal-powershell:before{content:"î¯‡"}.codicon-terminal-tmux:before{content:"î¯ˆ"}.codicon-terminal-ubuntu:before{content:"î¯‰"}.codicon-terminal-bash:before{content:"î¯Š"}.codicon-arrow-swap:before{content:"î¯‹"}.codicon-copy:before{content:"î¯Œ"}.codicon-person-add:before{content:"î¯�"}.codicon-filter-filled:before{content:"î¯Ž"}.codicon-wand:before{content:"î¯�"}.codicon-debug-line-by-line:before{content:"î¯�"}.codicon-inspect:before{content:"î¯‘"}.codicon-layers:before{content:"î¯’"}.codicon-layers-dot:before{content:"î¯“"}.codicon-layers-active:before{content:"î¯”"}.codicon-compass:before{content:"î¯•"}.codicon-compass-dot:before{content:"î¯–"}.codicon-compass-active:before{content:"î¯—"}.codicon-azure:before{content:"î¯˜"}.codicon-issue-draft:before{content:"î¯™"}.codicon-git-pull-request-closed:before{content:"î¯š"}.codicon-git-pull-request-draft:before{content:"î¯›"}.codicon-debug-all:before{content:"î¯œ"}.codicon-debug-coverage:before{content:"î¯�"}.codicon-run-errors:before{content:"î¯ž"}.codicon-folder-library:before{content:"î¯Ÿ"}.codicon-debug-continue-small:before{content:"î¯ "}.codicon-beaker-stop:before{content:"î¯¡"}.codicon-graph-line:before{content:"î¯¢"}.codicon-graph-scatter:before{content:"î¯£"}.codicon-pie-chart:before{content:"î¯¤"}.codicon-bracket:before{content:"î¬�"}.codicon-bracket-dot:before{content:"î¯¥"}.codicon-bracket-error:before{content:"î¯¦"}.codicon-lock-small:before{content:"î¯§"}.codicon-azure-devops:before{content:"î¯¨"}.codicon-verified-filled:before{content:"î¯©"}.codicon-newline:before{content:"î¯ª"}.codicon-layout:before{content:"î¯«"}.codicon-layout-activitybar-left:before{content:"î¯¬"}.codicon-layout-activitybar-right:before{content:"î¯­"}.codicon-layout-panel-left:before{content:"î¯®"}.codicon-layout-panel-center:before{content:"î¯¯"}.codicon-layout-panel-justify:before{content:"î¯°"}.codicon-layout-panel-right:before{content:"î¯±"}.codicon-layout-panel:before{content:"î¯²"}.codicon-layout-sidebar-left:before{content:"î¯³"}.codicon-layout-sidebar-right:before{content:"î¯´"}.codicon-layout-statusbar:before{content:"î¯µ"}.codicon-layout-menubar:before{content:"î¯¶"}.codicon-layout-centered:before{content:"î¯·"}.codicon-target:before{content:"î¯¸"}.codicon-indent:before{content:"î¯¹"}.codicon-record-small:before{content:"î¯º"}.codicon-error-small:before{content:"î¯»"}.codicon-terminal-decoration-error:before{content:"î¯»"}.codicon-arrow-circle-down:before{content:"î¯¼"}.codicon-arrow-circle-left:before{content:"î¯½"}.codicon-arrow-circle-right:before{content:"î¯¾"}.codicon-arrow-circle-up:before{content:"î¯¿"}.codicon-layout-sidebar-right-off:before{content:"î°€"}.codicon-layout-panel-off:before{content:"î°�"}.codicon-layout-sidebar-left-off:before{content:"î°‚"}.codicon-blank:before{content:"î°ƒ"}.codicon-heart-filled:before{content:"î°„"}.codicon-map:before{content:"î°…"}.codicon-map-horizontal:before{content:"î°…"}.codicon-fold-horizontal:before{content:"î°…"}.codicon-map-filled:before{content:"î°†"}.codicon-map-horizontal-filled:before{content:"î°†"}.codicon-fold-horizontal-filled:before{content:"î°†"}.codicon-circle-small:before{content:"î°‡"}.codicon-bell-slash:before{content:"î°ˆ"}.codicon-bell-slash-dot:before{content:"î°‰"}.codicon-comment-unresolved:before{content:"î°Š"}.codicon-git-pull-request-go-to-changes:before{content:"î°‹"}.codicon-git-pull-request-new-changes:before{content:"î°Œ"}.codicon-search-fuzzy:before{content:"î°�"}.codicon-comment-draft:before{content:"î°Ž"}.codicon-send:before{content:"î°�"}.codicon-sparkle:before{content:"î°�"}.codicon-insert:before{content:"î°‘"}.codicon-mic:before{content:"î°’"}.codicon-thumbsdown-filled:before{content:"î°“"}.codicon-thumbsup-filled:before{content:"î°”"}.codicon-coffee:before{content:"î°•"}.codicon-snake:before{content:"î°–"}.codicon-game:before{content:"î°—"}.codicon-vr:before{content:"î°˜"}.codicon-chip:before{content:"î°™"}.codicon-piano:before{content:"î°š"}.codicon-music:before{content:"î°›"}.codicon-mic-filled:before{content:"î°œ"}.codicon-repo-fetch:before{content:"î°�"}.codicon-copilot:before{content:"î°ž"}.codicon-lightbulb-sparkle:before{content:"î°Ÿ"}.codicon-robot:before{content:"î° "}.codicon-sparkle-filled:before{content:"î°¡"}.codicon-diff-single:before{content:"î°¢"}.codicon-diff-multiple:before{content:"î°£"}.codicon-surround-with:before{content:"î°¤"}.codicon-share:before{content:"î°¥"}.codicon-git-stash:before{content:"î°¦"}.codicon-git-stash-apply:before{content:"î°§"}.codicon-git-stash-pop:before{content:"î°¨"}.codicon-vscode:before{content:"î°©"}.codicon-vscode-insiders:before{content:"î°ª"}.codicon-code-oss:before{content:"î°«"}.codicon-run-coverage:before{content:"î°¬"}.codicon-run-all-coverage:before{content:"î°­"}.codicon-coverage:before{content:"î°®"}.codicon-github-project:before{content:"î°¯"}.codicon-map-vertical:before{content:"î°°"}.codicon-fold-vertical:before{content:"î°°"}.codicon-map-vertical-filled:before{content:"î°±"}.codicon-fold-vertical-filled:before{content:"î°±"}.codicon-go-to-search:before{content:"î°²"}.codicon-percentage:before{content:"î°³"}.codicon-sort-percentage:before{content:"î°³"}.codicon-attach:before{content:"î°´"}.codicon-git-fetch:before{content:"ï„�"}.cm-wrapper{line-height:18px}.cm-wrapper,.cm-wrapper>div{width:100%;height:100%}.CodeMirror span.cm-meta{color:var(--vscode-editor-foreground)}.CodeMirror span.cm-number{color:var(--vscode-debugTokenExpression-number)}.CodeMirror span.cm-keyword,.CodeMirror span.cm-builtin{color:var(--vscode-debugTokenExpression-name)}.CodeMirror span.cm-operator{color:var(--vscode-editor-foreground)}.CodeMirror span.cm-string,.CodeMirror span.cm-string-2{color:var(--vscode-debugTokenExpression-string)}.CodeMirror span.cm-error{color:var(--vscode-errorForeground)}.CodeMirror span.cm-def,.CodeMirror span.cm-tag{color:#0070c1}.CodeMirror span.cm-comment,.CodeMirror span.cm-link{color:green}.CodeMirror span.cm-variable,.CodeMirror span.cm-variable-2,.CodeMirror span.cm-atom{color:#0070c1}.CodeMirror span.cm-property{color:#795e26}.CodeMirror span.cm-qualifier,.CodeMirror span.cm-attribute{color:#001080}.CodeMirror span.cm-variable-3,.CodeMirror span.cm-type{color:#267f99}:root.dark-mode .CodeMirror span.cm-def,:root.dark-mode .CodeMirror span.cm-tag{color:var(--vscode-debugView-valueChangedHighlight)}:root.dark-mode .CodeMirror span.cm-comment,:root.dark-mode .CodeMirror span.cm-link{color:#6a9955}:root.dark-mode .CodeMirror span.cm-variable,:root.dark-mode .CodeMirror span.cm-variable-2,:root.dark-mode .CodeMirror span.cm-atom{color:#4fc1ff}:root.dark-mode .CodeMirror span.cm-property{color:#dcdcaa}:root.dark-mode .CodeMirror span.cm-qualifier,:root.dark-mode .CodeMirror span.cm-attribute{color:#9cdcfe}:root.dark-mode .CodeMirror span.cm-variable-3,:root.dark-mode .CodeMirror span.cm-type{color:#4ec9b0}.CodeMirror span.cm-bracket{color:var(--vscode-editorBracketHighlight-foreground3)}.CodeMirror-cursor{border-left:1px solid var(--vscode-editor-foreground)!important}.CodeMirror div.CodeMirror-selected{background:var(--vscode-terminal-inactiveSelectionBackground)}.CodeMirror .CodeMirror-gutters{z-index:0;background:1px solid var(--vscode-editorGroup-border);border-right:none}.CodeMirror .CodeMirror-gutter-elt{background-color:var(--vscode-editorGutter-background)}.CodeMirror .CodeMirror-gutterwrapper{border-right:1px solid var(--vscode-editorGroup-border);color:var(--vscode-editorLineNumber-foreground)}.CodeMirror .CodeMirror-matchingbracket{background-color:var(--vscode-editorBracketPairGuide-background1);color:var(--vscode-editorBracketHighlight-foreground1)!important}.CodeMirror{font-family:var(--vscode-editor-font-family)!important;color:var(--vscode-editor-foreground)!important;background-color:var(--vscode-editor-background)!important;font-weight:var(--vscode-editor-font-weight)!important;font-size:var(--vscode-editor-font-size)!important}.CodeMirror .source-line-running{background-color:var(--vscode-editor-selectionBackground);z-index:2}.CodeMirror .source-line-paused{background-color:var(--vscode-editor-selectionHighlightBackground);z-index:2}.CodeMirror .source-line-error-widget{background-color:var(--vscode-inputValidation-errorBackground);white-space:pre-wrap;margin:3px 10px;padding:5px}.CodeMirror span.cm-link,span.cm-linkified{color:var(--vscode-textLink-foreground);text-decoration:underline;cursor:pointer}.CodeMirror .source-line-error-underline{text-decoration:underline;text-decoration-color:var(--vscode-errorForeground);text-decoration-style:wavy}.CodeMirror-placeholder{color:var(--vscode-input-placeholderForeground)!important}.CodeMirror-dialog-top{padding-top:8px!important}.split-view{display:flex;flex:auto;position:relative}.split-view.vertical{flex-direction:column}.split-view.vertical.sidebar-first{flex-direction:column-reverse}.split-view.horizontal{flex-direction:row}.split-view.horizontal.sidebar-first{flex-direction:row-reverse}.split-view-main{display:flex;flex:auto}.split-view-sidebar{display:flex;flex:none}.split-view.vertical:not(.sidebar-first)>.split-view-sidebar{border-top:1px solid var(--vscode-panel-border)}.split-view.horizontal:not(.sidebar-first)>.split-view-sidebar{border-left:1px solid var(--vscode-panel-border)}.split-view.vertical.sidebar-first>.split-view-sidebar{border-bottom:1px solid var(--vscode-panel-border)}.split-view.horizontal.sidebar-first>.split-view-sidebar{border-right:1px solid var(--vscode-panel-border)}.split-view-resizer{position:absolute;z-index:100}.split-view.vertical>.split-view-resizer{left:0;right:0;height:12px;cursor:ns-resize}.split-view.horizontal>.split-view-resizer{top:0;bottom:0;width:12px;cursor:ew-resize}.tabbed-pane{display:flex;flex:auto;overflow:hidden}.tabbed-pane .toolbar{background-color:var(--vscode-sideBar-background)}.tabbed-pane .tab-content{display:flex;flex:auto;overflow:hidden;position:relative;flex-direction:column}.tabbed-pane-tab{padding:2px 6px 0;cursor:pointer;display:flex;align-items:center;justify-content:center;-webkit-user-select:none;user-select:none;border-bottom:2px solid transparent;outline:none;height:100%}.tabbed-pane-tab-label{max-width:250px;white-space:pre;overflow:hidden;text-overflow:ellipsis;display:inline-block}.tabbed-pane-tab.selected{background-color:var(--vscode-tab-activeBackground)}.tabbed-pane-tab-counter{padding:0 4px;background:var(--vscode-menu-separatorBackground);border-radius:8px;height:16px;margin-left:4px;line-height:16px;min-width:18px;display:flex;align-items:center;justify-content:center}.tabbed-pane-tab-counter.error{background:var(--vscode-list-errorForeground);color:var(--vscode-button-foreground)}.toolbar{position:relative;display:flex;color:var(--vscode-sideBarTitle-foreground);min-height:30px;align-items:center;flex:none;padding-right:4px}.toolbar.toolbar-sidebar-background{background-color:var(--vscode-sideBar-background)}.toolbar:not(.no-shadow):after{content:"";display:block;position:absolute;pointer-events:none;top:0;bottom:0;left:-2px;right:-2px;box-shadow:var(--vscode-scrollbar-shadow) 0 6px 6px -6px;z-index:100}.toolbar.no-min-height{min-height:0}.toolbar input{padding:0 5px;line-height:24px;outline:none;margin:0 4px}.toolbar select{background:none;outline:none;padding:3px;margin:2px}.toolbar option{background-color:var(--vscode-tab-activeBackground)}.toolbar input,.toolbar select{border:none;color:var(--vscode-input-foreground);background-color:var(--vscode-input-background)}:root{--vscode-font-family: system-ui, "Ubuntu", "Droid Sans", sans-serif;--vscode-font-weight: normal;--vscode-font-size: 13px;--vscode-editor-font-family: "Droid Sans Mono", "monospace", monospace;--vscode-editor-font-weight: normal;--vscode-editor-font-size: 14px;--vscode-foreground: #616161;--vscode-disabledForeground: rgba(97, 97, 97, .5);--vscode-errorForeground: #a1260d;--vscode-descriptionForeground: #717171;--vscode-icon-foreground: #424242;--vscode-focusBorder: #0090f1;--vscode-textSeparator-foreground: rgba(0, 0, 0, .18);--vscode-textLink-foreground: #006ab1;--vscode-textLink-activeForeground: #006ab1;--vscode-textPreformat-foreground: #a31515;--vscode-textBlockQuote-background: rgba(127, 127, 127, .1);--vscode-textBlockQuote-border: rgba(0, 122, 204, .5);--vscode-textCodeBlock-background: rgba(220, 220, 220, .4);--vscode-widget-shadow: rgba(0, 0, 0, .16);--vscode-input-background: #ffffff;--vscode-input-foreground: #616161;--vscode-inputOption-activeBorder: #007acc;--vscode-inputOption-hoverBackground: rgba(184, 184, 184, .31);--vscode-inputOption-activeBackground: rgba(0, 144, 241, .2);--vscode-inputOption-activeForeground: #000000;--vscode-input-placeholderForeground: #767676;--vscode-inputValidation-infoBackground: #d6ecf2;--vscode-inputValidation-infoBorder: #007acc;--vscode-inputValidation-warningBackground: #f6f5d2;--vscode-inputValidation-warningBorder: #b89500;--vscode-inputValidation-errorBackground: #f2dede;--vscode-inputValidation-errorBorder: #be1100;--vscode-dropdown-background: #ffffff;--vscode-dropdown-border: #cecece;--vscode-checkbox-background: #ffffff;--vscode-checkbox-border: #cecece;--vscode-button-foreground: #ffffff;--vscode-button-separator: rgba(255, 255, 255, .4);--vscode-button-background: #007acc;--vscode-button-hoverBackground: #0062a3;--vscode-button-secondaryForeground: #ffffff;--vscode-button-secondaryBackground: #5f6a79;--vscode-button-secondaryHoverBackground: #4c5561;--vscode-badge-background: #c4c4c4;--vscode-badge-foreground: #333333;--vscode-scrollbar-shadow: #dddddd;--vscode-scrollbarSlider-background: rgba(100, 100, 100, .4);--vscode-scrollbarSlider-hoverBackground: rgba(100, 100, 100, .7);--vscode-scrollbarSlider-activeBackground: rgba(0, 0, 0, .6);--vscode-progressBar-background: #0e70c0;--vscode-editorError-foreground: #e51400;--vscode-editorWarning-foreground: #bf8803;--vscode-editorInfo-foreground: #1a85ff;--vscode-editorHint-foreground: #6c6c6c;--vscode-sash-hoverBorder: #0090f1;--vscode-editor-background: #ffffff;--vscode-editor-foreground: #000000;--vscode-editorStickyScroll-background: #ffffff;--vscode-editorStickyScrollHover-background: #f0f0f0;--vscode-editorWidget-background: #f3f3f3;--vscode-editorWidget-foreground: #616161;--vscode-editorWidget-border: #c8c8c8;--vscode-quickInput-background: #f3f3f3;--vscode-quickInput-foreground: #616161;--vscode-quickInputTitle-background: rgba(0, 0, 0, .06);--vscode-pickerGroup-foreground: #0066bf;--vscode-pickerGroup-border: #cccedb;--vscode-keybindingLabel-background: rgba(221, 221, 221, .4);--vscode-keybindingLabel-foreground: #555555;--vscode-keybindingLabel-border: rgba(204, 204, 204, .4);--vscode-keybindingLabel-bottomBorder: rgba(187, 187, 187, .4);--vscode-editor-selectionBackground: #add6ff;--vscode-editor-inactiveSelectionBackground: #e5ebf1;--vscode-editor-selectionHighlightBackground: rgba(173, 214, 255, .5);--vscode-editor-findMatchBackground: #a8ac94;--vscode-editor-findMatchHighlightBackground: rgba(234, 92, 0, .33);--vscode-editor-findRangeHighlightBackground: rgba(180, 180, 180, .3);--vscode-searchEditor-findMatchBackground: rgba(234, 92, 0, .22);--vscode-editor-hoverHighlightBackground: rgba(173, 214, 255, .15);--vscode-editorHoverWidget-background: #f3f3f3;--vscode-editorHoverWidget-foreground: #616161;--vscode-editorHoverWidget-border: #c8c8c8;--vscode-editorHoverWidget-statusBarBackground: #e7e7e7;--vscode-editorLink-activeForeground: #0000ff;--vscode-editorInlayHint-foreground: rgba(51, 51, 51, .8);--vscode-editorInlayHint-background: rgba(196, 196, 196, .3);--vscode-editorInlayHint-typeForeground: rgba(51, 51, 51, .8);--vscode-editorInlayHint-typeBackground: rgba(196, 196, 196, .3);--vscode-editorInlayHint-parameterForeground: rgba(51, 51, 51, .8);--vscode-editorInlayHint-parameterBackground: rgba(196, 196, 196, .3);--vscode-editorLightBulb-foreground: #ddb100;--vscode-editorLightBulbAutoFix-foreground: #007acc;--vscode-diffEditor-insertedTextBackground: rgba(156, 204, 44, .4);--vscode-diffEditor-removedTextBackground: rgba(255, 0, 0, .3);--vscode-diffEditor-insertedLineBackground: rgba(155, 185, 85, .2);--vscode-diffEditor-removedLineBackground: rgba(255, 0, 0, .2);--vscode-diffEditor-diagonalFill: rgba(34, 34, 34, .2);--vscode-list-focusOutline: #0090f1;--vscode-list-focusAndSelectionOutline: #90c2f9;--vscode-list-activeSelectionBackground: #0060c0;--vscode-list-activeSelectionForeground: #ffffff;--vscode-list-activeSelectionIconForeground: #ffffff;--vscode-list-inactiveSelectionBackground: #e4e6f1;--vscode-list-hoverBackground: #e8e8e8;--vscode-list-dropBackground: #d6ebff;--vscode-list-highlightForeground: #0066bf;--vscode-list-focusHighlightForeground: #bbe7ff;--vscode-list-invalidItemForeground: #b89500;--vscode-list-errorForeground: #b01011;--vscode-list-warningForeground: #855f00;--vscode-listFilterWidget-background: #f3f3f3;--vscode-listFilterWidget-outline: rgba(0, 0, 0, 0);--vscode-listFilterWidget-noMatchesOutline: #be1100;--vscode-listFilterWidget-shadow: rgba(0, 0, 0, .16);--vscode-list-filterMatchBackground: rgba(234, 92, 0, .33);--vscode-tree-indentGuidesStroke: #a9a9a9;--vscode-tree-tableColumnsBorder: rgba(97, 97, 97, .13);--vscode-tree-tableOddRowsBackground: rgba(97, 97, 97, .04);--vscode-list-deemphasizedForeground: #8e8e90;--vscode-quickInputList-focusForeground: #ffffff;--vscode-quickInputList-focusIconForeground: #ffffff;--vscode-quickInputList-focusBackground: #0060c0;--vscode-menu-foreground: #616161;--vscode-menu-background: #ffffff;--vscode-menu-selectionForeground: #ffffff;--vscode-menu-selectionBackground: #0060c0;--vscode-menu-separatorBackground: #d4d4d4;--vscode-toolbar-hoverBackground: rgba(184, 184, 184, .31);--vscode-toolbar-activeBackground: rgba(166, 166, 166, .31);--vscode-editor-snippetTabstopHighlightBackground: rgba(10, 50, 100, .2);--vscode-editor-snippetFinalTabstopHighlightBorder: rgba(10, 50, 100, .5);--vscode-breadcrumb-foreground: rgba(97, 97, 97, .8);--vscode-breadcrumb-background: #ffffff;--vscode-breadcrumb-focusForeground: #4e4e4e;--vscode-breadcrumb-activeSelectionForeground: #4e4e4e;--vscode-breadcrumbPicker-background: #f3f3f3;--vscode-merge-currentHeaderBackground: rgba(64, 200, 174, .5);--vscode-merge-currentContentBackground: rgba(64, 200, 174, .2);--vscode-merge-incomingHeaderBackground: rgba(64, 166, 255, .5);--vscode-merge-incomingContentBackground: rgba(64, 166, 255, .2);--vscode-merge-commonHeaderBackground: rgba(96, 96, 96, .4);--vscode-merge-commonContentBackground: rgba(96, 96, 96, .16);--vscode-editorOverviewRuler-currentContentForeground: rgba(64, 200, 174, .5);--vscode-editorOverviewRuler-incomingContentForeground: rgba(64, 166, 255, .5);--vscode-editorOverviewRuler-commonContentForeground: rgba(96, 96, 96, .4);--vscode-editorOverviewRuler-findMatchForeground: rgba(209, 134, 22, .49);--vscode-editorOverviewRuler-selectionHighlightForeground: rgba(160, 160, 160, .8);--vscode-minimap-findMatchHighlight: #d18616;--vscode-minimap-selectionOccurrenceHighlight: #c9c9c9;--vscode-minimap-selectionHighlight: #add6ff;--vscode-minimap-errorHighlight: rgba(255, 18, 18, .7);--vscode-minimap-warningHighlight: #bf8803;--vscode-minimap-foregroundOpacity: #000000;--vscode-minimapSlider-background: rgba(100, 100, 100, .2);--vscode-minimapSlider-hoverBackground: rgba(100, 100, 100, .35);--vscode-minimapSlider-activeBackground: rgba(0, 0, 0, .3);--vscode-problemsErrorIcon-foreground: #e51400;--vscode-problemsWarningIcon-foreground: #bf8803;--vscode-problemsInfoIcon-foreground: #1a85ff;--vscode-charts-foreground: #616161;--vscode-charts-lines: rgba(97, 97, 97, .5);--vscode-charts-red: #e51400;--vscode-charts-blue: #1a85ff;--vscode-charts-yellow: #bf8803;--vscode-charts-orange: #d18616;--vscode-charts-green: #388a34;--vscode-charts-purple: #652d90;--vscode-editor-lineHighlightBorder: #eeeeee;--vscode-editor-rangeHighlightBackground: rgba(253, 255, 0, .2);--vscode-editor-symbolHighlightBackground: rgba(234, 92, 0, .33);--vscode-editorCursor-foreground: #000000;--vscode-editorWhitespace-foreground: rgba(51, 51, 51, .2);--vscode-editorIndentGuide-background: #d3d3d3;--vscode-editorIndentGuide-activeBackground: #939393;--vscode-editorLineNumber-foreground: #237893;--vscode-editorActiveLineNumber-foreground: #0b216f;--vscode-editorLineNumber-activeForeground: #0b216f;--vscode-editorRuler-foreground: #d3d3d3;--vscode-editorCodeLens-foreground: #919191;--vscode-editorBracketMatch-background: rgba(0, 100, 0, .1);--vscode-editorBracketMatch-border: #b9b9b9;--vscode-editorOverviewRuler-border: rgba(127, 127, 127, .3);--vscode-editorGutter-background: #ffffff;--vscode-editorUnnecessaryCode-opacity: rgba(0, 0, 0, .47);--vscode-editorGhostText-foreground: rgba(0, 0, 0, .47);--vscode-editorOverviewRuler-rangeHighlightForeground: rgba(0, 122, 204, .6);--vscode-editorOverviewRuler-errorForeground: rgba(255, 18, 18, .7);--vscode-editorOverviewRuler-warningForeground: #bf8803;--vscode-editorOverviewRuler-infoForeground: #1a85ff;--vscode-editorBracketHighlight-foreground1: #0431fa;--vscode-editorBracketHighlight-foreground2: #319331;--vscode-editorBracketHighlight-foreground3: #7b3814;--vscode-editorBracketHighlight-foreground4: rgba(0, 0, 0, 0);--vscode-editorBracketHighlight-foreground5: rgba(0, 0, 0, 0);--vscode-editorBracketHighlight-foreground6: rgba(0, 0, 0, 0);--vscode-editorBracketHighlight-unexpectedBracket\.foreground: rgba(255, 18, 18, .8);--vscode-editorBracketPairGuide-background1: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-background2: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-background3: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-background4: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-background5: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-background6: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-activeBackground1: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-activeBackground2: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-activeBackground3: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-activeBackground4: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-activeBackground5: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-activeBackground6: rgba(0, 0, 0, 0);--vscode-editorUnicodeHighlight-border: #cea33d;--vscode-editorUnicodeHighlight-background: rgba(206, 163, 61, .08);--vscode-symbolIcon-arrayForeground: #616161;--vscode-symbolIcon-booleanForeground: #616161;--vscode-symbolIcon-classForeground: #d67e00;--vscode-symbolIcon-colorForeground: #616161;--vscode-symbolIcon-constantForeground: #616161;--vscode-symbolIcon-constructorForeground: #652d90;--vscode-symbolIcon-enumeratorForeground: #d67e00;--vscode-symbolIcon-enumeratorMemberForeground: #007acc;--vscode-symbolIcon-eventForeground: #d67e00;--vscode-symbolIcon-fieldForeground: #007acc;--vscode-symbolIcon-fileForeground: #616161;--vscode-symbolIcon-folderForeground: #616161;--vscode-symbolIcon-functionForeground: #652d90;--vscode-symbolIcon-interfaceForeground: #007acc;--vscode-symbolIcon-keyForeground: #616161;--vscode-symbolIcon-keywordForeground: #616161;--vscode-symbolIcon-methodForeground: #652d90;--vscode-symbolIcon-moduleForeground: #616161;--vscode-symbolIcon-namespaceForeground: #616161;--vscode-symbolIcon-nullForeground: #616161;--vscode-symbolIcon-numberForeground: #616161;--vscode-symbolIcon-objectForeground: #616161;--vscode-symbolIcon-operatorForeground: #616161;--vscode-symbolIcon-packageForeground: #616161;--vscode-symbolIcon-propertyForeground: #616161;--vscode-symbolIcon-referenceForeground: #616161;--vscode-symbolIcon-snippetForeground: #616161;--vscode-symbolIcon-stringForeground: #616161;--vscode-symbolIcon-structForeground: #616161;--vscode-symbolIcon-textForeground: #616161;--vscode-symbolIcon-typeParameterForeground: #616161;--vscode-symbolIcon-unitForeground: #616161;--vscode-symbolIcon-variableForeground: #007acc;--vscode-editorHoverWidget-highlightForeground: #0066bf;--vscode-editorOverviewRuler-bracketMatchForeground: #a0a0a0;--vscode-editor-foldBackground: rgba(173, 214, 255, .3);--vscode-editorGutter-foldingControlForeground: #424242;--vscode-editor-linkedEditingBackground: rgba(255, 0, 0, .3);--vscode-editor-wordHighlightBackground: rgba(87, 87, 87, .25);--vscode-editor-wordHighlightStrongBackground: rgba(14, 99, 156, .25);--vscode-editorOverviewRuler-wordHighlightForeground: rgba(160, 160, 160, .8);--vscode-editorOverviewRuler-wordHighlightStrongForeground: rgba(192, 160, 192, .8);--vscode-peekViewTitle-background: rgba(26, 133, 255, .1);--vscode-peekViewTitleLabel-foreground: #000000;--vscode-peekViewTitleDescription-foreground: #616161;--vscode-peekView-border: #1a85ff;--vscode-peekViewResult-background: #f3f3f3;--vscode-peekViewResult-lineForeground: #646465;--vscode-peekViewResult-fileForeground: #1e1e1e;--vscode-peekViewResult-selectionBackground: rgba(51, 153, 255, .2);--vscode-peekViewResult-selectionForeground: #6c6c6c;--vscode-peekViewEditor-background: #f2f8fc;--vscode-peekViewEditorGutter-background: #f2f8fc;--vscode-peekViewResult-matchHighlightBackground: rgba(234, 92, 0, .3);--vscode-peekViewEditor-matchHighlightBackground: rgba(245, 216, 2, .87);--vscode-editorMarkerNavigationError-background: #e51400;--vscode-editorMarkerNavigationError-headerBackground: rgba(229, 20, 0, .1);--vscode-editorMarkerNavigationWarning-background: #bf8803;--vscode-editorMarkerNavigationWarning-headerBackground: rgba(191, 136, 3, .1);--vscode-editorMarkerNavigationInfo-background: #1a85ff;--vscode-editorMarkerNavigationInfo-headerBackground: rgba(26, 133, 255, .1);--vscode-editorMarkerNavigation-background: #ffffff;--vscode-editorSuggestWidget-background: #f3f3f3;--vscode-editorSuggestWidget-border: #c8c8c8;--vscode-editorSuggestWidget-foreground: #000000;--vscode-editorSuggestWidget-selectedForeground: #ffffff;--vscode-editorSuggestWidget-selectedIconForeground: #ffffff;--vscode-editorSuggestWidget-selectedBackground: #0060c0;--vscode-editorSuggestWidget-highlightForeground: #0066bf;--vscode-editorSuggestWidget-focusHighlightForeground: #bbe7ff;--vscode-editorSuggestWidgetStatus-foreground: rgba(0, 0, 0, .5);--vscode-tab-activeBackground: #ffffff;--vscode-tab-unfocusedActiveBackground: #ffffff;--vscode-tab-inactiveBackground: #ececec;--vscode-tab-unfocusedInactiveBackground: #ececec;--vscode-tab-activeForeground: #333333;--vscode-tab-inactiveForeground: rgba(51, 51, 51, .7);--vscode-tab-unfocusedActiveForeground: rgba(51, 51, 51, .7);--vscode-tab-unfocusedInactiveForeground: rgba(51, 51, 51, .35);--vscode-tab-border: #f3f3f3;--vscode-tab-lastPinnedBorder: rgba(97, 97, 97, .19);--vscode-tab-activeModifiedBorder: #33aaee;--vscode-tab-inactiveModifiedBorder: rgba(51, 170, 238, .5);--vscode-tab-unfocusedActiveModifiedBorder: rgba(51, 170, 238, .7);--vscode-tab-unfocusedInactiveModifiedBorder: rgba(51, 170, 238, .25);--vscode-editorPane-background: #ffffff;--vscode-editorGroupHeader-tabsBackground: #f3f3f3;--vscode-editorGroupHeader-noTabsBackground: #ffffff;--vscode-editorGroup-border: #e7e7e7;--vscode-editorGroup-dropBackground: rgba(38, 119, 203, .18);--vscode-editorGroup-dropIntoPromptForeground: #616161;--vscode-editorGroup-dropIntoPromptBackground: #f3f3f3;--vscode-sideBySideEditor-horizontalBorder: #e7e7e7;--vscode-sideBySideEditor-verticalBorder: #e7e7e7;--vscode-panel-background: #ffffff;--vscode-panel-border: rgba(128, 128, 128, .35);--vscode-panelTitle-activeForeground: #424242;--vscode-panelTitle-inactiveForeground: rgba(66, 66, 66, .75);--vscode-panelTitle-activeBorder: #424242;--vscode-panelInput-border: #dddddd;--vscode-panel-dropBorder: #424242;--vscode-panelSection-dropBackground: rgba(38, 119, 203, .18);--vscode-panelSectionHeader-background: rgba(128, 128, 128, .2);--vscode-panelSection-border: rgba(128, 128, 128, .35);--vscode-banner-background: #004386;--vscode-banner-foreground: #ffffff;--vscode-banner-iconForeground: #1a85ff;--vscode-statusBar-foreground: #ffffff;--vscode-statusBar-noFolderForeground: #ffffff;--vscode-statusBar-background: #007acc;--vscode-statusBar-noFolderBackground: #68217a;--vscode-statusBar-focusBorder: #ffffff;--vscode-statusBarItem-activeBackground: rgba(255, 255, 255, .18);--vscode-statusBarItem-focusBorder: #ffffff;--vscode-statusBarItem-hoverBackground: rgba(255, 255, 255, .12);--vscode-statusBarItem-compactHoverBackground: rgba(255, 255, 255, .2);--vscode-statusBarItem-prominentForeground: #ffffff;--vscode-statusBarItem-prominentBackground: rgba(0, 0, 0, .5);--vscode-statusBarItem-prominentHoverBackground: rgba(0, 0, 0, .3);--vscode-statusBarItem-errorBackground: #c72e0f;--vscode-statusBarItem-errorForeground: #ffffff;--vscode-statusBarItem-warningBackground: #725102;--vscode-statusBarItem-warningForeground: #ffffff;--vscode-activityBar-background: #2c2c2c;--vscode-activityBar-foreground: #ffffff;--vscode-activityBar-inactiveForeground: rgba(255, 255, 255, .4);--vscode-activityBar-activeBorder: #ffffff;--vscode-activityBar-dropBorder: #ffffff;--vscode-activityBarBadge-background: #007acc;--vscode-activityBarBadge-foreground: #ffffff;--vscode-statusBarItem-remoteBackground: #16825d;--vscode-statusBarItem-remoteForeground: #ffffff;--vscode-extensionBadge-remoteBackground: #007acc;--vscode-extensionBadge-remoteForeground: #ffffff;--vscode-sideBar-background: #f3f3f3;--vscode-sideBarTitle-foreground: #6f6f6f;--vscode-sideBar-dropBackground: rgba(38, 119, 203, .18);--vscode-sideBarSectionHeader-background: rgba(0, 0, 0, 0);--vscode-sideBarSectionHeader-border: rgba(97, 97, 97, .19);--vscode-titleBar-activeForeground: #333333;--vscode-titleBar-inactiveForeground: rgba(51, 51, 51, .6);--vscode-titleBar-activeBackground: #dddddd;--vscode-titleBar-inactiveBackground: rgba(221, 221, 221, .6);--vscode-menubar-selectionForeground: #333333;--vscode-menubar-selectionBackground: rgba(184, 184, 184, .31);--vscode-notifications-foreground: #616161;--vscode-notifications-background: #f3f3f3;--vscode-notificationLink-foreground: #006ab1;--vscode-notificationCenterHeader-background: #e7e7e7;--vscode-notifications-border: #e7e7e7;--vscode-notificationsErrorIcon-foreground: #e51400;--vscode-notificationsWarningIcon-foreground: #bf8803;--vscode-notificationsInfoIcon-foreground: #1a85ff;--vscode-commandCenter-foreground: #333333;--vscode-commandCenter-activeForeground: #333333;--vscode-commandCenter-activeBackground: rgba(184, 184, 184, .31);--vscode-commandCenter-border: rgba(128, 128, 128, .35);--vscode-editorCommentsWidget-resolvedBorder: rgba(97, 97, 97, .5);--vscode-editorCommentsWidget-unresolvedBorder: #1a85ff;--vscode-editorCommentsWidget-rangeBackground: rgba(26, 133, 255, .1);--vscode-editorCommentsWidget-rangeBorder: rgba(26, 133, 255, .4);--vscode-editorCommentsWidget-rangeActiveBackground: rgba(26, 133, 255, .1);--vscode-editorCommentsWidget-rangeActiveBorder: rgba(26, 133, 255, .4);--vscode-editorGutter-commentRangeForeground: #d5d8e9;--vscode-debugToolBar-background: #f3f3f3;--vscode-debugIcon-startForeground: #388a34;--vscode-editor-stackFrameHighlightBackground: rgba(255, 255, 102, .45);--vscode-editor-focusedStackFrameHighlightBackground: rgba(206, 231, 206, .45);--vscode-mergeEditor-change\.background: rgba(155, 185, 85, .2);--vscode-mergeEditor-change\.word\.background: rgba(156, 204, 44, .4);--vscode-mergeEditor-conflict\.unhandledUnfocused\.border: rgba(255, 166, 0, .48);--vscode-mergeEditor-conflict\.unhandledFocused\.border: #ffa600;--vscode-mergeEditor-conflict\.handledUnfocused\.border: rgba(134, 134, 134, .29);--vscode-mergeEditor-conflict\.handledFocused\.border: rgba(193, 193, 193, .8);--vscode-mergeEditor-conflict\.handled\.minimapOverViewRuler: rgba(173, 172, 168, .93);--vscode-mergeEditor-conflict\.unhandled\.minimapOverViewRuler: #fcba03;--vscode-mergeEditor-conflictingLines\.background: rgba(255, 234, 0, .28);--vscode-settings-headerForeground: #444444;--vscode-settings-modifiedItemIndicator: #66afe0;--vscode-settings-headerBorder: rgba(128, 128, 128, .35);--vscode-settings-sashBorder: rgba(128, 128, 128, .35);--vscode-settings-dropdownBackground: #ffffff;--vscode-settings-dropdownBorder: #cecece;--vscode-settings-dropdownListBorder: #c8c8c8;--vscode-settings-checkboxBackground: #ffffff;--vscode-settings-checkboxBorder: #cecece;--vscode-settings-textInputBackground: #ffffff;--vscode-settings-textInputForeground: #616161;--vscode-settings-textInputBorder: #cecece;--vscode-settings-numberInputBackground: #ffffff;--vscode-settings-numberInputForeground: #616161;--vscode-settings-numberInputBorder: #cecece;--vscode-settings-focusedRowBackground: rgba(232, 232, 232, .6);--vscode-settings-rowHoverBackground: rgba(232, 232, 232, .3);--vscode-settings-focusedRowBorder: rgba(0, 0, 0, .12);--vscode-terminal-foreground: #333333;--vscode-terminal-selectionBackground: #add6ff;--vscode-terminal-inactiveSelectionBackground: #e5ebf1;--vscode-terminalCommandDecoration-defaultBackground: rgba(0, 0, 0, .25);--vscode-terminalCommandDecoration-successBackground: #2090d3;--vscode-terminalCommandDecoration-errorBackground: #e51400;--vscode-terminalOverviewRuler-cursorForeground: rgba(160, 160, 160, .8);--vscode-terminal-border: rgba(128, 128, 128, .35);--vscode-terminal-findMatchBackground: #a8ac94;--vscode-terminal-findMatchHighlightBackground: rgba(234, 92, 0, .33);--vscode-terminalOverviewRuler-findMatchForeground: rgba(209, 134, 22, .49);--vscode-terminal-dropBackground: rgba(38, 119, 203, .18);--vscode-testing-iconFailed: #f14c4c;--vscode-testing-iconErrored: #f14c4c;--vscode-testing-iconPassed: #73c991;--vscode-testing-runAction: #73c991;--vscode-testing-iconQueued: #cca700;--vscode-testing-iconUnset: #848484;--vscode-testing-iconSkipped: #848484;--vscode-testing-peekBorder: #e51400;--vscode-testing-peekHeaderBackground: rgba(229, 20, 0, .1);--vscode-testing-message\.error\.decorationForeground: #e51400;--vscode-testing-message\.error\.lineBackground: rgba(255, 0, 0, .2);--vscode-testing-message\.info\.decorationForeground: rgba(0, 0, 0, .5);--vscode-welcomePage-tileBackground: #f3f3f3;--vscode-welcomePage-tileHoverBackground: #dbdbdb;--vscode-welcomePage-tileShadow: rgba(0, 0, 0, .16);--vscode-welcomePage-progress\.background: #ffffff;--vscode-welcomePage-progress\.foreground: #006ab1;--vscode-debugExceptionWidget-border: #a31515;--vscode-debugExceptionWidget-background: #f1dfde;--vscode-ports-iconRunningProcessForeground: #369432;--vscode-statusBar-debuggingBackground: #cc6633;--vscode-statusBar-debuggingForeground: #ffffff;--vscode-editor-inlineValuesForeground: rgba(0, 0, 0, .5);--vscode-editor-inlineValuesBackground: rgba(255, 200, 0, .2);--vscode-editorGutter-modifiedBackground: #2090d3;--vscode-editorGutter-addedBackground: #48985d;--vscode-editorGutter-deletedBackground: #e51400;--vscode-minimapGutter-modifiedBackground: #2090d3;--vscode-minimapGutter-addedBackground: #48985d;--vscode-minimapGutter-deletedBackground: #e51400;--vscode-editorOverviewRuler-modifiedForeground: rgba(32, 144, 211, .6);--vscode-editorOverviewRuler-addedForeground: rgba(72, 152, 93, .6);--vscode-editorOverviewRuler-deletedForeground: rgba(229, 20, 0, .6);--vscode-debugIcon-breakpointForeground: #e51400;--vscode-debugIcon-breakpointDisabledForeground: #848484;--vscode-debugIcon-breakpointUnverifiedForeground: #848484;--vscode-debugIcon-breakpointCurrentStackframeForeground: #be8700;--vscode-debugIcon-breakpointStackframeForeground: #89d185;--vscode-notebook-cellBorderColor: #e8e8e8;--vscode-notebook-focusedEditorBorder: #0090f1;--vscode-notebookStatusSuccessIcon-foreground: #388a34;--vscode-notebookStatusErrorIcon-foreground: #a1260d;--vscode-notebookStatusRunningIcon-foreground: #616161;--vscode-notebook-cellToolbarSeparator: rgba(128, 128, 128, .35);--vscode-notebook-selectedCellBackground: rgba(200, 221, 241, .31);--vscode-notebook-selectedCellBorder: #e8e8e8;--vscode-notebook-focusedCellBorder: #0090f1;--vscode-notebook-inactiveFocusedCellBorder: #e8e8e8;--vscode-notebook-cellStatusBarItemHoverBackground: rgba(0, 0, 0, .08);--vscode-notebook-cellInsertionIndicator: #0090f1;--vscode-notebookScrollbarSlider-background: rgba(100, 100, 100, .4);--vscode-notebookScrollbarSlider-hoverBackground: rgba(100, 100, 100, .7);--vscode-notebookScrollbarSlider-activeBackground: rgba(0, 0, 0, .6);--vscode-notebook-symbolHighlightBackground: rgba(253, 255, 0, .2);--vscode-notebook-cellEditorBackground: #f3f3f3;--vscode-notebook-editorBackground: #ffffff;--vscode-keybindingTable-headerBackground: rgba(97, 97, 97, .04);--vscode-keybindingTable-rowsBackground: rgba(97, 97, 97, .04);--vscode-scm-providerBorder: #c8c8c8;--vscode-searchEditor-textInputBorder: #cecece;--vscode-debugTokenExpression-name: #9b46b0;--vscode-debugTokenExpression-value: rgba(108, 108, 108, .8);--vscode-debugTokenExpression-string: #a31515;--vscode-debugTokenExpression-boolean: #0000ff;--vscode-debugTokenExpression-number: #098658;--vscode-debugTokenExpression-error: #e51400;--vscode-debugView-exceptionLabelForeground: #ffffff;--vscode-debugView-exceptionLabelBackground: #a31515;--vscode-debugView-stateLabelForeground: #616161;--vscode-debugView-stateLabelBackground: rgba(136, 136, 136, .27);--vscode-debugView-valueChangedHighlight: #569cd6;--vscode-debugConsole-infoForeground: #1a85ff;--vscode-debugConsole-warningForeground: #bf8803;--vscode-debugConsole-errorForeground: #a1260d;--vscode-debugConsole-sourceForeground: #616161;--vscode-debugConsoleInputIcon-foreground: #616161;--vscode-debugIcon-pauseForeground: #007acc;--vscode-debugIcon-stopForeground: #a1260d;--vscode-debugIcon-disconnectForeground: #a1260d;--vscode-debugIcon-restartForeground: #388a34;--vscode-debugIcon-stepOverForeground: #007acc;--vscode-debugIcon-stepIntoForeground: #007acc;--vscode-debugIcon-stepOutForeground: #007acc;--vscode-debugIcon-continueForeground: #007acc;--vscode-debugIcon-stepBackForeground: #007acc;--vscode-extensionButton-prominentBackground: #007acc;--vscode-extensionButton-prominentForeground: #ffffff;--vscode-extensionButton-prominentHoverBackground: #0062a3;--vscode-extensionIcon-starForeground: #df6100;--vscode-extensionIcon-verifiedForeground: #006ab1;--vscode-extensionIcon-preReleaseForeground: #1d9271;--vscode-extensionIcon-sponsorForeground: #b51e78;--vscode-terminal-ansiBlack: #000000;--vscode-terminal-ansiRed: #cd3131;--vscode-terminal-ansiGreen: #00bc00;--vscode-terminal-ansiYellow: #949800;--vscode-terminal-ansiBlue: #0451a5;--vscode-terminal-ansiMagenta: #bc05bc;--vscode-terminal-ansiCyan: #0598bc;--vscode-terminal-ansiWhite: #555555;--vscode-terminal-ansiBrightBlack: #666666;--vscode-terminal-ansiBrightRed: #cd3131;--vscode-terminal-ansiBrightGreen: #14ce14;--vscode-terminal-ansiBrightYellow: #b5ba00;--vscode-terminal-ansiBrightBlue: #0451a5;--vscode-terminal-ansiBrightMagenta: #bc05bc;--vscode-terminal-ansiBrightCyan: #0598bc;--vscode-terminal-ansiBrightWhite: #a5a5a5;--vscode-interactive-activeCodeBorder: #1a85ff;--vscode-interactive-inactiveCodeBorder: #e4e6f1;--vscode-gitDecoration-addedResourceForeground: #587c0c;--vscode-gitDecoration-modifiedResourceForeground: #895503;--vscode-gitDecoration-deletedResourceForeground: #ad0707;--vscode-gitDecoration-renamedResourceForeground: #007100;--vscode-gitDecoration-untrackedResourceForeground: #007100;--vscode-gitDecoration-ignoredResourceForeground: #8e8e90;--vscode-gitDecoration-stageModifiedResourceForeground: #895503;--vscode-gitDecoration-stageDeletedResourceForeground: #ad0707;--vscode-gitDecoration-conflictingResourceForeground: #ad0707;--vscode-gitDecoration-submoduleResourceForeground: #1258a7}:root.light-mode{color-scheme:light}:root.dark-mode{color-scheme:dark;--vscode-font-family: system-ui, "Ubuntu", "Droid Sans", sans-serif;--vscode-font-weight: normal;--vscode-font-size: 13px;--vscode-editor-font-family: "Droid Sans Mono", "monospace", monospace;--vscode-editor-font-weight: normal;--vscode-editor-font-size: 14px;--vscode-foreground: #cccccc;--vscode-disabledForeground: rgba(204, 204, 204, .5);--vscode-errorForeground: #f48771;--vscode-descriptionForeground: rgba(204, 204, 204, .7);--vscode-icon-foreground: #c5c5c5;--vscode-focusBorder: #007fd4;--vscode-textSeparator-foreground: rgba(255, 255, 255, .18);--vscode-textLink-foreground: #3794ff;--vscode-textLink-activeForeground: #3794ff;--vscode-textPreformat-foreground: #d7ba7d;--vscode-textBlockQuote-background: rgba(127, 127, 127, .1);--vscode-textBlockQuote-border: rgba(0, 122, 204, .5);--vscode-textCodeBlock-background: rgba(10, 10, 10, .4);--vscode-widget-shadow: rgba(0, 0, 0, .36);--vscode-input-background: #3c3c3c;--vscode-input-foreground: #cccccc;--vscode-inputOption-activeBorder: #007acc;--vscode-inputOption-hoverBackground: rgba(90, 93, 94, .5);--vscode-inputOption-activeBackground: rgba(0, 127, 212, .4);--vscode-inputOption-activeForeground: #ffffff;--vscode-input-placeholderForeground: #a6a6a6;--vscode-inputValidation-infoBackground: #063b49;--vscode-inputValidation-infoBorder: #007acc;--vscode-inputValidation-warningBackground: #352a05;--vscode-inputValidation-warningBorder: #b89500;--vscode-inputValidation-errorBackground: #5a1d1d;--vscode-inputValidation-errorBorder: #be1100;--vscode-dropdown-background: #3c3c3c;--vscode-dropdown-foreground: #f0f0f0;--vscode-dropdown-border: #3c3c3c;--vscode-checkbox-background: #3c3c3c;--vscode-checkbox-foreground: #f0f0f0;--vscode-checkbox-border: #3c3c3c;--vscode-button-foreground: #ffffff;--vscode-button-separator: rgba(255, 255, 255, .4);--vscode-button-background: #0e639c;--vscode-button-hoverBackground: #1177bb;--vscode-button-secondaryForeground: #ffffff;--vscode-button-secondaryBackground: #3a3d41;--vscode-button-secondaryHoverBackground: #45494e;--vscode-badge-background: #4d4d4d;--vscode-badge-foreground: #ffffff;--vscode-scrollbar-shadow: #000000;--vscode-scrollbarSlider-background: rgba(121, 121, 121, .4);--vscode-scrollbarSlider-hoverBackground: rgba(100, 100, 100, .7);--vscode-scrollbarSlider-activeBackground: rgba(191, 191, 191, .4);--vscode-progressBar-background: #0e70c0;--vscode-editorError-foreground: #f14c4c;--vscode-editorWarning-foreground: #cca700;--vscode-editorInfo-foreground: #3794ff;--vscode-editorHint-foreground: rgba(238, 238, 238, .7);--vscode-sash-hoverBorder: #007fd4;--vscode-editor-background: #1e1e1e;--vscode-editor-foreground: #d4d4d4;--vscode-editorStickyScroll-background: #1e1e1e;--vscode-editorStickyScrollHover-background: #2a2d2e;--vscode-editorWidget-background: #252526;--vscode-editorWidget-foreground: #cccccc;--vscode-editorWidget-border: #454545;--vscode-quickInput-background: #252526;--vscode-quickInput-foreground: #cccccc;--vscode-quickInputTitle-background: rgba(255, 255, 255, .1);--vscode-pickerGroup-foreground: #3794ff;--vscode-pickerGroup-border: #3f3f46;--vscode-keybindingLabel-background: rgba(128, 128, 128, .17);--vscode-keybindingLabel-foreground: #cccccc;--vscode-keybindingLabel-border: rgba(51, 51, 51, .6);--vscode-keybindingLabel-bottomBorder: rgba(68, 68, 68, .6);--vscode-editor-selectionBackground: #264f78;--vscode-editor-inactiveSelectionBackground: #3a3d41;--vscode-editor-selectionHighlightBackground: rgba(173, 214, 255, .15);--vscode-editor-findMatchBackground: #515c6a;--vscode-editor-findMatchHighlightBackground: rgba(234, 92, 0, .33);--vscode-editor-findRangeHighlightBackground: rgba(58, 61, 65, .4);--vscode-searchEditor-findMatchBackground: rgba(234, 92, 0, .22);--vscode-editor-hoverHighlightBackground: rgba(38, 79, 120, .25);--vscode-editorHoverWidget-background: #252526;--vscode-editorHoverWidget-foreground: #cccccc;--vscode-editorHoverWidget-border: #454545;--vscode-editorHoverWidget-statusBarBackground: #2c2c2d;--vscode-editorLink-activeForeground: #4e94ce;--vscode-editorInlayHint-foreground: rgba(255, 255, 255, .8);--vscode-editorInlayHint-background: rgba(77, 77, 77, .6);--vscode-editorInlayHint-typeForeground: rgba(255, 255, 255, .8);--vscode-editorInlayHint-typeBackground: rgba(77, 77, 77, .6);--vscode-editorInlayHint-parameterForeground: rgba(255, 255, 255, .8);--vscode-editorInlayHint-parameterBackground: rgba(77, 77, 77, .6);--vscode-editorLightBulb-foreground: #ffcc00;--vscode-editorLightBulbAutoFix-foreground: #75beff;--vscode-diffEditor-insertedTextBackground: rgba(156, 204, 44, .2);--vscode-diffEditor-removedTextBackground: rgba(255, 0, 0, .4);--vscode-diffEditor-insertedLineBackground: rgba(155, 185, 85, .2);--vscode-diffEditor-removedLineBackground: rgba(255, 0, 0, .2);--vscode-diffEditor-diagonalFill: rgba(204, 204, 204, .2);--vscode-list-focusOutline: #007fd4;--vscode-list-activeSelectionBackground: #04395e;--vscode-list-activeSelectionForeground: #ffffff;--vscode-list-activeSelectionIconForeground: #ffffff;--vscode-list-inactiveSelectionBackground: #37373d;--vscode-list-hoverBackground: #2a2d2e;--vscode-list-dropBackground: #383b3d;--vscode-list-highlightForeground: #2aaaff;--vscode-list-focusHighlightForeground: #2aaaff;--vscode-list-invalidItemForeground: #b89500;--vscode-list-errorForeground: #f88070;--vscode-list-warningForeground: #cca700;--vscode-listFilterWidget-background: #252526;--vscode-listFilterWidget-outline: rgba(0, 0, 0, 0);--vscode-listFilterWidget-noMatchesOutline: #be1100;--vscode-listFilterWidget-shadow: rgba(0, 0, 0, .36);--vscode-list-filterMatchBackground: rgba(234, 92, 0, .33);--vscode-tree-indentGuidesStroke: #585858;--vscode-tree-tableColumnsBorder: rgba(204, 204, 204, .13);--vscode-tree-tableOddRowsBackground: rgba(204, 204, 204, .04);--vscode-list-deemphasizedForeground: #8c8c8c;--vscode-quickInputList-focusForeground: #ffffff;--vscode-quickInputList-focusIconForeground: #ffffff;--vscode-quickInputList-focusBackground: #04395e;--vscode-menu-foreground: #cccccc;--vscode-menu-background: #303031;--vscode-menu-selectionForeground: #ffffff;--vscode-menu-selectionBackground: #04395e;--vscode-menu-separatorBackground: #606060;--vscode-toolbar-hoverBackground: rgba(90, 93, 94, .31);--vscode-toolbar-activeBackground: rgba(99, 102, 103, .31);--vscode-editor-snippetTabstopHighlightBackground: rgba(124, 124, 124, .3);--vscode-editor-snippetFinalTabstopHighlightBorder: #525252;--vscode-breadcrumb-foreground: rgba(204, 204, 204, .8);--vscode-breadcrumb-background: #1e1e1e;--vscode-breadcrumb-focusForeground: #e0e0e0;--vscode-breadcrumb-activeSelectionForeground: #e0e0e0;--vscode-breadcrumbPicker-background: #252526;--vscode-merge-currentHeaderBackground: rgba(64, 200, 174, .5);--vscode-merge-currentContentBackground: rgba(64, 200, 174, .2);--vscode-merge-incomingHeaderBackground: rgba(64, 166, 255, .5);--vscode-merge-incomingContentBackground: rgba(64, 166, 255, .2);--vscode-merge-commonHeaderBackground: rgba(96, 96, 96, .4);--vscode-merge-commonContentBackground: rgba(96, 96, 96, .16);--vscode-editorOverviewRuler-currentContentForeground: rgba(64, 200, 174, .5);--vscode-editorOverviewRuler-incomingContentForeground: rgba(64, 166, 255, .5);--vscode-editorOverviewRuler-commonContentForeground: rgba(96, 96, 96, .4);--vscode-editorOverviewRuler-findMatchForeground: rgba(209, 134, 22, .49);--vscode-editorOverviewRuler-selectionHighlightForeground: rgba(160, 160, 160, .8);--vscode-minimap-findMatchHighlight: #d18616;--vscode-minimap-selectionOccurrenceHighlight: #676767;--vscode-minimap-selectionHighlight: #264f78;--vscode-minimap-errorHighlight: rgba(255, 18, 18, .7);--vscode-minimap-warningHighlight: #cca700;--vscode-minimap-foregroundOpacity: #000000;--vscode-minimapSlider-background: rgba(121, 121, 121, .2);--vscode-minimapSlider-hoverBackground: rgba(100, 100, 100, .35);--vscode-minimapSlider-activeBackground: rgba(191, 191, 191, .2);--vscode-problemsErrorIcon-foreground: #f14c4c;--vscode-problemsWarningIcon-foreground: #cca700;--vscode-problemsInfoIcon-foreground: #3794ff;--vscode-charts-foreground: #cccccc;--vscode-charts-lines: rgba(204, 204, 204, .5);--vscode-charts-red: #f14c4c;--vscode-charts-blue: #3794ff;--vscode-charts-yellow: #cca700;--vscode-charts-orange: #d18616;--vscode-charts-green: #89d185;--vscode-charts-purple: #b180d7;--vscode-editor-lineHighlightBorder: #282828;--vscode-editor-rangeHighlightBackground: rgba(255, 255, 255, .04);--vscode-editor-symbolHighlightBackground: rgba(234, 92, 0, .33);--vscode-editorCursor-foreground: #aeafad;--vscode-editorWhitespace-foreground: rgba(227, 228, 226, .16);--vscode-editorIndentGuide-background: #404040;--vscode-editorIndentGuide-activeBackground: #707070;--vscode-editorLineNumber-foreground: #858585;--vscode-editorActiveLineNumber-foreground: #c6c6c6;--vscode-editorLineNumber-activeForeground: #c6c6c6;--vscode-editorRuler-foreground: #5a5a5a;--vscode-editorCodeLens-foreground: #999999;--vscode-editorBracketMatch-background: rgba(0, 100, 0, .1);--vscode-editorBracketMatch-border: #888888;--vscode-editorOverviewRuler-border: rgba(127, 127, 127, .3);--vscode-editorGutter-background: #1e1e1e;--vscode-editorUnnecessaryCode-opacity: rgba(0, 0, 0, .67);--vscode-editorGhostText-foreground: rgba(255, 255, 255, .34);--vscode-editorOverviewRuler-rangeHighlightForeground: rgba(0, 122, 204, .6);--vscode-editorOverviewRuler-errorForeground: rgba(255, 18, 18, .7);--vscode-editorOverviewRuler-warningForeground: #cca700;--vscode-editorOverviewRuler-infoForeground: #3794ff;--vscode-editorBracketHighlight-foreground1: #ffd700;--vscode-editorBracketHighlight-foreground2: #da70d6;--vscode-editorBracketHighlight-foreground3: #179fff;--vscode-editorBracketHighlight-foreground4: rgba(0, 0, 0, 0);--vscode-editorBracketHighlight-foreground5: rgba(0, 0, 0, 0);--vscode-editorBracketHighlight-foreground6: rgba(0, 0, 0, 0);--vscode-editorBracketHighlight-unexpectedBracket\.foreground: rgba(255, 18, 18, .8);--vscode-editorBracketPairGuide-background1: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-background2: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-background3: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-background4: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-background5: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-background6: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-activeBackground1: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-activeBackground2: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-activeBackground3: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-activeBackground4: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-activeBackground5: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-activeBackground6: rgba(0, 0, 0, 0);--vscode-editorUnicodeHighlight-border: #bd9b03;--vscode-editorUnicodeHighlight-background: rgba(189, 155, 3, .15);--vscode-symbolIcon-arrayForeground: #cccccc;--vscode-symbolIcon-booleanForeground: #cccccc;--vscode-symbolIcon-classForeground: #ee9d28;--vscode-symbolIcon-colorForeground: #cccccc;--vscode-symbolIcon-constantForeground: #cccccc;--vscode-symbolIcon-constructorForeground: #b180d7;--vscode-symbolIcon-enumeratorForeground: #ee9d28;--vscode-symbolIcon-enumeratorMemberForeground: #75beff;--vscode-symbolIcon-eventForeground: #ee9d28;--vscode-symbolIcon-fieldForeground: #75beff;--vscode-symbolIcon-fileForeground: #cccccc;--vscode-symbolIcon-folderForeground: #cccccc;--vscode-symbolIcon-functionForeground: #b180d7;--vscode-symbolIcon-interfaceForeground: #75beff;--vscode-symbolIcon-keyForeground: #cccccc;--vscode-symbolIcon-keywordForeground: #cccccc;--vscode-symbolIcon-methodForeground: #b180d7;--vscode-symbolIcon-moduleForeground: #cccccc;--vscode-symbolIcon-namespaceForeground: #cccccc;--vscode-symbolIcon-nullForeground: #cccccc;--vscode-symbolIcon-numberForeground: #cccccc;--vscode-symbolIcon-objectForeground: #cccccc;--vscode-symbolIcon-operatorForeground: #cccccc;--vscode-symbolIcon-packageForeground: #cccccc;--vscode-symbolIcon-propertyForeground: #cccccc;--vscode-symbolIcon-referenceForeground: #cccccc;--vscode-symbolIcon-snippetForeground: #cccccc;--vscode-symbolIcon-stringForeground: #cccccc;--vscode-symbolIcon-structForeground: #cccccc;--vscode-symbolIcon-textForeground: #cccccc;--vscode-symbolIcon-typeParameterForeground: #cccccc;--vscode-symbolIcon-unitForeground: #cccccc;--vscode-symbolIcon-variableForeground: #75beff;--vscode-editorHoverWidget-highlightForeground: #2aaaff;--vscode-editorOverviewRuler-bracketMatchForeground: #a0a0a0;--vscode-editor-foldBackground: rgba(38, 79, 120, .3);--vscode-editorGutter-foldingControlForeground: #c5c5c5;--vscode-editor-linkedEditingBackground: rgba(255, 0, 0, .3);--vscode-editor-wordHighlightBackground: rgba(87, 87, 87, .72);--vscode-editor-wordHighlightStrongBackground: rgba(0, 73, 114, .72);--vscode-editorOverviewRuler-wordHighlightForeground: rgba(160, 160, 160, .8);--vscode-editorOverviewRuler-wordHighlightStrongForeground: rgba(192, 160, 192, .8);--vscode-peekViewTitle-background: rgba(55, 148, 255, .1);--vscode-peekViewTitleLabel-foreground: #ffffff;--vscode-peekViewTitleDescription-foreground: rgba(204, 204, 204, .7);--vscode-peekView-border: #3794ff;--vscode-peekViewResult-background: #252526;--vscode-peekViewResult-lineForeground: #bbbbbb;--vscode-peekViewResult-fileForeground: #ffffff;--vscode-peekViewResult-selectionBackground: rgba(51, 153, 255, .2);--vscode-peekViewResult-selectionForeground: #ffffff;--vscode-peekViewEditor-background: #001f33;--vscode-peekViewEditorGutter-background: #001f33;--vscode-peekViewResult-matchHighlightBackground: rgba(234, 92, 0, .3);--vscode-peekViewEditor-matchHighlightBackground: rgba(255, 143, 0, .6);--vscode-editorMarkerNavigationError-background: #f14c4c;--vscode-editorMarkerNavigationError-headerBackground: rgba(241, 76, 76, .1);--vscode-editorMarkerNavigationWarning-background: #cca700;--vscode-editorMarkerNavigationWarning-headerBackground: rgba(204, 167, 0, .1);--vscode-editorMarkerNavigationInfo-background: #3794ff;--vscode-editorMarkerNavigationInfo-headerBackground: rgba(55, 148, 255, .1);--vscode-editorMarkerNavigation-background: #1e1e1e;--vscode-editorSuggestWidget-background: #252526;--vscode-editorSuggestWidget-border: #454545;--vscode-editorSuggestWidget-foreground: #d4d4d4;--vscode-editorSuggestWidget-selectedForeground: #ffffff;--vscode-editorSuggestWidget-selectedIconForeground: #ffffff;--vscode-editorSuggestWidget-selectedBackground: #04395e;--vscode-editorSuggestWidget-highlightForeground: #2aaaff;--vscode-editorSuggestWidget-focusHighlightForeground: #2aaaff;--vscode-editorSuggestWidgetStatus-foreground: rgba(212, 212, 212, .5);--vscode-tab-activeBackground: #1e1e1e;--vscode-tab-unfocusedActiveBackground: #1e1e1e;--vscode-tab-inactiveBackground: #2d2d2d;--vscode-tab-unfocusedInactiveBackground: #2d2d2d;--vscode-tab-activeForeground: #ffffff;--vscode-tab-inactiveForeground: rgba(255, 255, 255, .5);--vscode-tab-unfocusedActiveForeground: rgba(255, 255, 255, .5);--vscode-tab-unfocusedInactiveForeground: rgba(255, 255, 255, .25);--vscode-tab-border: #252526;--vscode-tab-lastPinnedBorder: rgba(204, 204, 204, .2);--vscode-tab-activeModifiedBorder: #3399cc;--vscode-tab-inactiveModifiedBorder: rgba(51, 153, 204, .5);--vscode-tab-unfocusedActiveModifiedBorder: rgba(51, 153, 204, .5);--vscode-tab-unfocusedInactiveModifiedBorder: rgba(51, 153, 204, .25);--vscode-editorPane-background: #1e1e1e;--vscode-editorGroupHeader-tabsBackground: #252526;--vscode-editorGroupHeader-noTabsBackground: #1e1e1e;--vscode-editorGroup-border: #444444;--vscode-editorGroup-dropBackground: rgba(83, 89, 93, .5);--vscode-editorGroup-dropIntoPromptForeground: #cccccc;--vscode-editorGroup-dropIntoPromptBackground: #252526;--vscode-sideBySideEditor-horizontalBorder: #444444;--vscode-sideBySideEditor-verticalBorder: #444444;--vscode-panel-background: #1e1e1e;--vscode-panel-border: rgba(128, 128, 128, .35);--vscode-panelTitle-activeForeground: #e7e7e7;--vscode-panelTitle-inactiveForeground: rgba(231, 231, 231, .6);--vscode-panelTitle-activeBorder: #e7e7e7;--vscode-panel-dropBorder: #e7e7e7;--vscode-panelSection-dropBackground: rgba(83, 89, 93, .5);--vscode-panelSectionHeader-background: rgba(128, 128, 128, .2);--vscode-panelSection-border: rgba(128, 128, 128, .35);--vscode-banner-background: #04395e;--vscode-banner-foreground: #ffffff;--vscode-banner-iconForeground: #3794ff;--vscode-statusBar-foreground: #ffffff;--vscode-statusBar-noFolderForeground: #ffffff;--vscode-statusBar-background: #007acc;--vscode-statusBar-noFolderBackground: #68217a;--vscode-statusBar-focusBorder: #ffffff;--vscode-statusBarItem-activeBackground: rgba(255, 255, 255, .18);--vscode-statusBarItem-focusBorder: #ffffff;--vscode-statusBarItem-hoverBackground: rgba(255, 255, 255, .12);--vscode-statusBarItem-compactHoverBackground: rgba(255, 255, 255, .2);--vscode-statusBarItem-prominentForeground: #ffffff;--vscode-statusBarItem-prominentBackground: rgba(0, 0, 0, .5);--vscode-statusBarItem-prominentHoverBackground: rgba(0, 0, 0, .3);--vscode-statusBarItem-errorBackground: #c72e0f;--vscode-statusBarItem-errorForeground: #ffffff;--vscode-statusBarItem-warningBackground: #7a6400;--vscode-statusBarItem-warningForeground: #ffffff;--vscode-activityBar-background: #333333;--vscode-activityBar-foreground: #ffffff;--vscode-activityBar-inactiveForeground: rgba(255, 255, 255, .4);--vscode-activityBar-activeBorder: #ffffff;--vscode-activityBar-dropBorder: #ffffff;--vscode-activityBarBadge-background: #007acc;--vscode-activityBarBadge-foreground: #ffffff;--vscode-statusBarItem-remoteBackground: #16825d;--vscode-statusBarItem-remoteForeground: #ffffff;--vscode-extensionBadge-remoteBackground: #007acc;--vscode-extensionBadge-remoteForeground: #ffffff;--vscode-sideBar-background: #252526;--vscode-sideBarTitle-foreground: #bbbbbb;--vscode-sideBar-dropBackground: rgba(83, 89, 93, .5);--vscode-sideBarSectionHeader-background: rgba(0, 0, 0, 0);--vscode-sideBarSectionHeader-border: rgba(204, 204, 204, .2);--vscode-titleBar-activeForeground: #cccccc;--vscode-titleBar-inactiveForeground: rgba(204, 204, 204, .6);--vscode-titleBar-activeBackground: #3c3c3c;--vscode-titleBar-inactiveBackground: rgba(60, 60, 60, .6);--vscode-menubar-selectionForeground: #cccccc;--vscode-menubar-selectionBackground: rgba(90, 93, 94, .31);--vscode-notifications-foreground: #cccccc;--vscode-notifications-background: #252526;--vscode-notificationLink-foreground: #3794ff;--vscode-notificationCenterHeader-background: #303031;--vscode-notifications-border: #303031;--vscode-notificationsErrorIcon-foreground: #f14c4c;--vscode-notificationsWarningIcon-foreground: #cca700;--vscode-notificationsInfoIcon-foreground: #3794ff;--vscode-commandCenter-foreground: #cccccc;--vscode-commandCenter-activeForeground: #cccccc;--vscode-commandCenter-activeBackground: rgba(90, 93, 94, .31);--vscode-commandCenter-border: rgba(128, 128, 128, .35);--vscode-editorCommentsWidget-resolvedBorder: rgba(204, 204, 204, .5);--vscode-editorCommentsWidget-unresolvedBorder: #3794ff;--vscode-editorCommentsWidget-rangeBackground: rgba(55, 148, 255, .1);--vscode-editorCommentsWidget-rangeBorder: rgba(55, 148, 255, .4);--vscode-editorCommentsWidget-rangeActiveBackground: rgba(55, 148, 255, .1);--vscode-editorCommentsWidget-rangeActiveBorder: rgba(55, 148, 255, .4);--vscode-editorGutter-commentRangeForeground: #37373d;--vscode-debugToolBar-background: #333333;--vscode-debugIcon-startForeground: #89d185;--vscode-editor-stackFrameHighlightBackground: rgba(255, 255, 0, .2);--vscode-editor-focusedStackFrameHighlightBackground: rgba(122, 189, 122, .3);--vscode-mergeEditor-change\.background: rgba(155, 185, 85, .2);--vscode-mergeEditor-change\.word\.background: rgba(156, 204, 44, .2);--vscode-mergeEditor-conflict\.unhandledUnfocused\.border: rgba(255, 166, 0, .48);--vscode-mergeEditor-conflict\.unhandledFocused\.border: #ffa600;--vscode-mergeEditor-conflict\.handledUnfocused\.border: rgba(134, 134, 134, .29);--vscode-mergeEditor-conflict\.handledFocused\.border: rgba(193, 193, 193, .8);--vscode-mergeEditor-conflict\.handled\.minimapOverViewRuler: rgba(173, 172, 168, .93);--vscode-mergeEditor-conflict\.unhandled\.minimapOverViewRuler: #fcba03;--vscode-mergeEditor-conflictingLines\.background: rgba(255, 234, 0, .28);--vscode-settings-headerForeground: #e7e7e7;--vscode-settings-modifiedItemIndicator: #0c7d9d;--vscode-settings-headerBorder: rgba(128, 128, 128, .35);--vscode-settings-sashBorder: rgba(128, 128, 128, .35);--vscode-settings-dropdownBackground: #3c3c3c;--vscode-settings-dropdownForeground: #f0f0f0;--vscode-settings-dropdownBorder: #3c3c3c;--vscode-settings-dropdownListBorder: #454545;--vscode-settings-checkboxBackground: #3c3c3c;--vscode-settings-checkboxForeground: #f0f0f0;--vscode-settings-checkboxBorder: #3c3c3c;--vscode-settings-textInputBackground: #3c3c3c;--vscode-settings-textInputForeground: #cccccc;--vscode-settings-numberInputBackground: #3c3c3c;--vscode-settings-numberInputForeground: #cccccc;--vscode-settings-focusedRowBackground: rgba(42, 45, 46, .6);--vscode-settings-rowHoverBackground: rgba(42, 45, 46, .3);--vscode-settings-focusedRowBorder: rgba(255, 255, 255, .12);--vscode-terminal-foreground: #cccccc;--vscode-terminal-selectionBackground: #264f78;--vscode-terminal-inactiveSelectionBackground: #3a3d41;--vscode-terminalCommandDecoration-defaultBackground: rgba(255, 255, 255, .25);--vscode-terminalCommandDecoration-successBackground: #1b81a8;--vscode-terminalCommandDecoration-errorBackground: #f14c4c;--vscode-terminalOverviewRuler-cursorForeground: rgba(160, 160, 160, .8);--vscode-terminal-border: rgba(128, 128, 128, .35);--vscode-terminal-findMatchBackground: #515c6a;--vscode-terminal-findMatchHighlightBackground: rgba(234, 92, 0, .33);--vscode-terminalOverviewRuler-findMatchForeground: rgba(209, 134, 22, .49);--vscode-terminal-dropBackground: rgba(83, 89, 93, .5);--vscode-testing-iconFailed: #f14c4c;--vscode-testing-iconErrored: #f14c4c;--vscode-testing-iconPassed: #73c991;--vscode-testing-runAction: #73c991;--vscode-testing-iconQueued: #cca700;--vscode-testing-iconUnset: #848484;--vscode-testing-iconSkipped: #848484;--vscode-testing-peekBorder: #f14c4c;--vscode-testing-peekHeaderBackground: rgba(241, 76, 76, .1);--vscode-testing-message\.error\.decorationForeground: #f14c4c;--vscode-testing-message\.error\.lineBackground: rgba(255, 0, 0, .2);--vscode-testing-message\.info\.decorationForeground: rgba(212, 212, 212, .5);--vscode-welcomePage-tileBackground: #252526;--vscode-welcomePage-tileHoverBackground: #2c2c2d;--vscode-welcomePage-tileShadow: rgba(0, 0, 0, .36);--vscode-welcomePage-progress\.background: #3c3c3c;--vscode-welcomePage-progress\.foreground: #3794ff;--vscode-debugExceptionWidget-border: #a31515;--vscode-debugExceptionWidget-background: #420b0d;--vscode-ports-iconRunningProcessForeground: #369432;--vscode-statusBar-debuggingBackground: #cc6633;--vscode-statusBar-debuggingForeground: #ffffff;--vscode-editor-inlineValuesForeground: rgba(255, 255, 255, .5);--vscode-editor-inlineValuesBackground: rgba(255, 200, 0, .2);--vscode-editorGutter-modifiedBackground: #1b81a8;--vscode-editorGutter-addedBackground: #487e02;--vscode-editorGutter-deletedBackground: #f14c4c;--vscode-minimapGutter-modifiedBackground: #1b81a8;--vscode-minimapGutter-addedBackground: #487e02;--vscode-minimapGutter-deletedBackground: #f14c4c;--vscode-editorOverviewRuler-modifiedForeground: rgba(27, 129, 168, .6);--vscode-editorOverviewRuler-addedForeground: rgba(72, 126, 2, .6);--vscode-editorOverviewRuler-deletedForeground: rgba(241, 76, 76, .6);--vscode-debugIcon-breakpointForeground: #e51400;--vscode-debugIcon-breakpointDisabledForeground: #848484;--vscode-debugIcon-breakpointUnverifiedForeground: #848484;--vscode-debugIcon-breakpointCurrentStackframeForeground: #ffcc00;--vscode-debugIcon-breakpointStackframeForeground: #89d185;--vscode-notebook-cellBorderColor: #37373d;--vscode-notebook-focusedEditorBorder: #007fd4;--vscode-notebookStatusSuccessIcon-foreground: #89d185;--vscode-notebookStatusErrorIcon-foreground: #f48771;--vscode-notebookStatusRunningIcon-foreground: #cccccc;--vscode-notebook-cellToolbarSeparator: rgba(128, 128, 128, .35);--vscode-notebook-selectedCellBackground: #37373d;--vscode-notebook-selectedCellBorder: #37373d;--vscode-notebook-focusedCellBorder: #007fd4;--vscode-notebook-inactiveFocusedCellBorder: #37373d;--vscode-notebook-cellStatusBarItemHoverBackground: rgba(255, 255, 255, .15);--vscode-notebook-cellInsertionIndicator: #007fd4;--vscode-notebookScrollbarSlider-background: rgba(121, 121, 121, .4);--vscode-notebookScrollbarSlider-hoverBackground: rgba(100, 100, 100, .7);--vscode-notebookScrollbarSlider-activeBackground: rgba(191, 191, 191, .4);--vscode-notebook-symbolHighlightBackground: rgba(255, 255, 255, .04);--vscode-notebook-cellEditorBackground: #252526;--vscode-notebook-editorBackground: #1e1e1e;--vscode-keybindingTable-headerBackground: rgba(204, 204, 204, .04);--vscode-keybindingTable-rowsBackground: rgba(204, 204, 204, .04);--vscode-scm-providerBorder: #454545;--vscode-debugTokenExpression-name: #c586c0;--vscode-debugTokenExpression-value: rgba(204, 204, 204, .6);--vscode-debugTokenExpression-string: #ce9178;--vscode-debugTokenExpression-boolean: #4e94ce;--vscode-debugTokenExpression-number: #b5cea8;--vscode-debugTokenExpression-error: #f48771;--vscode-debugView-exceptionLabelForeground: #cccccc;--vscode-debugView-exceptionLabelBackground: #6c2022;--vscode-debugView-stateLabelForeground: #cccccc;--vscode-debugView-stateLabelBackground: rgba(136, 136, 136, .27);--vscode-debugView-valueChangedHighlight: #569cd6;--vscode-debugConsole-infoForeground: #3794ff;--vscode-debugConsole-warningForeground: #cca700;--vscode-debugConsole-errorForeground: #f48771;--vscode-debugConsole-sourceForeground: #cccccc;--vscode-debugConsoleInputIcon-foreground: #cccccc;--vscode-debugIcon-pauseForeground: #75beff;--vscode-debugIcon-stopForeground: #f48771;--vscode-debugIcon-disconnectForeground: #f48771;--vscode-debugIcon-restartForeground: #89d185;--vscode-debugIcon-stepOverForeground: #75beff;--vscode-debugIcon-stepIntoForeground: #75beff;--vscode-debugIcon-stepOutForeground: #75beff;--vscode-debugIcon-continueForeground: #75beff;--vscode-debugIcon-stepBackForeground: #75beff;--vscode-extensionButton-prominentBackground: #0e639c;--vscode-extensionButton-prominentForeground: #ffffff;--vscode-extensionButton-prominentHoverBackground: #1177bb;--vscode-extensionIcon-starForeground: #ff8e00;--vscode-extensionIcon-verifiedForeground: #3794ff;--vscode-extensionIcon-preReleaseForeground: #1d9271;--vscode-extensionIcon-sponsorForeground: #d758b3;--vscode-terminal-ansiBlack: #000000;--vscode-terminal-ansiRed: #cd3131;--vscode-terminal-ansiGreen: #0dbc79;--vscode-terminal-ansiYellow: #e5e510;--vscode-terminal-ansiBlue: #2472c8;--vscode-terminal-ansiMagenta: #bc3fbc;--vscode-terminal-ansiCyan: #11a8cd;--vscode-terminal-ansiWhite: #e5e5e5;--vscode-terminal-ansiBrightBlack: #666666;--vscode-terminal-ansiBrightRed: #f14c4c;--vscode-terminal-ansiBrightGreen: #23d18b;--vscode-terminal-ansiBrightYellow: #f5f543;--vscode-terminal-ansiBrightBlue: #3b8eea;--vscode-terminal-ansiBrightMagenta: #d670d6;--vscode-terminal-ansiBrightCyan: #29b8db;--vscode-terminal-ansiBrightWhite: #e5e5e5;--vscode-interactive-activeCodeBorder: #3794ff;--vscode-interactive-inactiveCodeBorder: #37373d;--vscode-gitDecoration-addedResourceForeground: #81b88b;--vscode-gitDecoration-modifiedResourceForeground: #e2c08d;--vscode-gitDecoration-deletedResourceForeground: #c74e39;--vscode-gitDecoration-renamedResourceForeground: #73c991;--vscode-gitDecoration-untrackedResourceForeground: #73c991;--vscode-gitDecoration-ignoredResourceForeground: #8c8c8c;--vscode-gitDecoration-stageModifiedResourceForeground: #e2c08d;--vscode-gitDecoration-stageDeletedResourceForeground: #c74e39;--vscode-gitDecoration-conflictingResourceForeground: #e4676b;--vscode-gitDecoration-submoduleResourceForeground: #8db9e2}.toolbar-button{position:relative;flex:none;border:none;outline:none;color:var(--vscode-sideBarTitle-foreground);background:transparent;padding:4px;cursor:pointer;display:inline-flex;align-items:center;border-radius:4px}.toolbar-button:disabled{color:var(--vscode-disabledForeground)!important;cursor:default}.toolbar-button:not(:disabled):hover{background-color:var(--vscode-toolbar-hoverBackground)}.toolbar-button:not(:disabled):active{background-color:var(--vscode-toolbar-activeBackground)}.toolbar-button.toggled{color:var(--vscode-notificationLink-foreground)}.toolbar-button-error-badge{position:absolute;top:2px;right:2px;width:7px;height:7px;border-radius:50%;background-color:var(--vscode-notificationsErrorIcon-foreground)}.toolbar-separator{flex:none;background-color:var(--vscode-menu-separatorBackground);width:1px;padding:0;margin:5px 4px;height:16px}.call-log{display:flex;flex-direction:column;flex:auto;line-height:20px;white-space:pre;overflow:auto}.call-log-message{flex:none;padding:3px 0 3px 36px;display:flex;align-items:center}.call-log-call{display:flex;flex:none;flex-direction:column;border-top:1px solid var(--vscode-panel-border)}.call-log-call-header{height:24px;display:flex;align-items:center;padding:0 2px;z-index:2}.call-log-call .codicon{padding:0 4px;flex:none}.call-log .codicon-check{color:#21a945;font-weight:700}.call-log-call.error{background-color:var(--vscode-inputValidation-errorBackground);border-top:1px solid var(--vscode-panel-border)}.call-log-call.error .call-log-call-header,.call-log-message.error,.call-log .codicon-error{color:var(--vscode-errorForeground)}.call-log-details{flex:0 1 auto;overflow-x:hidden;text-overflow:ellipsis}.call-log-url{color:var(--vscode-charts-blue)}.call-log-selector{color:var(--vscode-charts-orange);white-space:nowrap}.call-log-time{flex:none;margin-left:4px;color:var(--gray)}.call-log-call .codicon.preview{visibility:hidden;color:var(--vscode-sideBarTitle-foreground);cursor:pointer}.call-log-call .codicon.preview:hover{color:inherit}.call-log-call:hover .codicon.preview{visibility:visible}.recorder{display:flex;flex-direction:column;flex:auto}.recorder-chooser{border:none;background:none;outline:none;color:var(--vscode-sideBarTitle-foreground);min-width:100px}.recorder .codicon{font-size:16px}.recorder .codicon.circle-large-filled,.recorder .codicon.stop-circle{font-size:15px}.recorder .toolbar-button.toggled.stop-circle{color:#a1260d}:root.dark-mode .recorder .toolbar-button.toggled.stop-circle{color:#f48771}.recorder .toolbar-button:not([disabled]) .codicon-debug-continue,.recorder .toolbar-button:not([disabled]) .codicon-debug-step-over{color:#01bb01}.recorder .toolbar-button:not([disabled]):hover .codicon-debug-continue,.recorder .toolbar-button:not([disabled]):hover .codicon-debug-step-over{color:#41ca1e}.recorder .selector-input{flex:auto}.setting{display:flex;align-items:center}.setting-theme{display:grid;margin-left:22px}.setting label{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;cursor:pointer}.setting input{margin-right:5px;flex-shrink:0}
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/codeMirrorModule-DeBYQozu.js","assets/codeMirrorModule-DYBRYzYX.css"])))=>i.map(i=>d[i]);
(function(){const l=document.createElement("link").relList;if(l&&l.supports&&l.supports("modulepreload"))return;for(const c of document.querySelectorAll('link[rel="modulepreload"]'))s(c);new MutationObserver(c=>{for(const o of c)if(o.type==="childList")for(const h of o.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&s(h)}).observe(document,{childList:!0,subtree:!0});function a(c){const o={};return c.integrity&&(o.integrity=c.integrity),c.referrerPolicy&&(o.referrerPolicy=c.referrerPolicy),c.crossOrigin==="use-credentials"?o.credentials="include":c.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function s(c){if(c.ep)return;c.ep=!0;const o=a(c);fetch(c.href,o)}})();function b1(u){return u&&u.__esModule&&Object.prototype.hasOwnProperty.call(u,"default")?u.default:u}var lf={exports:{}},Oa={};/**
 * @license React
 * react-jsx-runtime.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var Wm;function S1(){if(Wm)return Oa;Wm=1;var u=Symbol.for("react.transitional.element"),l=Symbol.for("react.fragment");function a(s,c,o){var h=null;if(o!==void 0&&(h=""+o),c.key!==void 0&&(h=""+c.key),"key"in c){o={};for(var m in c)m!=="key"&&(o[m]=c[m])}else o=c;return c=o.ref,{$$typeof:u,type:s,key:h,ref:c!==void 0?c:null,props:o}}return Oa.Fragment=l,Oa.jsx=a,Oa.jsxs=a,Oa}var Im;function T1(){return Im||(Im=1,lf.exports=S1()),lf.exports}var X=T1(),af={exports:{}},ue={};/**
 * @license React
 * react.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var Fm;function E1(){if(Fm)return ue;Fm=1;var u=Symbol.for("react.transitional.element"),l=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),h=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),v=Symbol.for("react.activity"),O=Symbol.iterator;function E(_){return _===null||typeof _!="object"?null:(_=O&&_[O]||_["@@iterator"],typeof _=="function"?_:null)}var x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,w={};function M(_,Y,J){this.props=_,this.context=Y,this.refs=w,this.updater=J||x}M.prototype.isReactComponent={},M.prototype.setState=function(_,Y){if(typeof _!="object"&&typeof _!="function"&&_!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,_,Y,"setState")},M.prototype.forceUpdate=function(_){this.updater.enqueueForceUpdate(this,_,"forceUpdate")};function R(){}R.prototype=M.prototype;function K(_,Y,J){this.props=_,this.context=Y,this.refs=w,this.updater=J||x}var Q=K.prototype=new R;Q.constructor=K,S(Q,M.prototype),Q.isPureReactComponent=!0;var Z=Array.isArray;function W(){}var k={H:null,A:null,T:null,S:null},V=Object.prototype.hasOwnProperty;function U(_,Y,J){var F=J.ref;return{$$typeof:u,type:_,key:Y,ref:F!==void 0?F:null,props:J}}function ae(_,Y){return U(_.type,Y,_.props)}function te(_){return typeof _=="object"&&_!==null&&_.$$typeof===u}function $(_){var Y={"=":"=0",":":"=2"};return"$"+_.replace(/[=:]/g,function(J){return Y[J]})}var ee=/\/+/g;function we(_,Y){return typeof _=="object"&&_!==null&&_.key!=null?$(""+_.key):Y.toString(36)}function se(_){switch(_.status){case"fulfilled":return _.value;case"rejected":throw _.reason;default:switch(typeof _.status=="string"?_.then(W,W):(_.status="pending",_.then(function(Y){_.status==="pending"&&(_.status="fulfilled",_.value=Y)},function(Y){_.status==="pending"&&(_.status="rejected",_.reason=Y)})),_.status){case"fulfilled":return _.value;case"rejected":throw _.reason}}throw _}function D(_,Y,J,F,re){var me=typeof _;(me==="undefined"||me==="boolean")&&(_=null);var Ae=!1;if(_===null)Ae=!0;else switch(me){case"bigint":case"string":case"number":Ae=!0;break;case"object":switch(_.$$typeof){case u:case l:Ae=!0;break;case b:return Ae=_._init,D(Ae(_._payload),Y,J,F,re)}}if(Ae)return re=re(_),Ae=F===""?"."+we(_,0):F,Z(re)?(J="",Ae!=null&&(J=Ae.replace(ee,"$&/")+"/"),D(re,Y,J,"",function(Di){return Di})):re!=null&&(te(re)&&(re=ae(re,J+(re.key==null||_&&_.key===re.key?"":(""+re.key).replace(ee,"$&/")+"/")+Ae)),Y.push(re)),1;Ae=0;var rt=F===""?".":F+":";if(Z(_))for(var Ye=0;Ye<_.length;Ye++)F=_[Ye],me=rt+we(F,Ye),Ae+=D(F,Y,J,me,re);else if(Ye=E(_),typeof Ye=="function")for(_=Ye.call(_),Ye=0;!(F=_.next()).done;)F=F.value,me=rt+we(F,Ye++),Ae+=D(F,Y,J,me,re);else if(me==="object"){if(typeof _.then=="function")return D(se(_),Y,J,F,re);throw Y=String(_),Error("Objects are not valid as a React child (found: "+(Y==="[object Object]"?"object with keys {"+Object.keys(_).join(", ")+"}":Y)+"). If you meant to render a collection of children, use an array instead.")}return Ae}function G(_,Y,J){if(_==null)return _;var F=[],re=0;return D(_,F,"","",function(me){return Y.call(J,me,re++)}),F}function ne(_){if(_._status===-1){var Y=_._result;Y=Y(),Y.then(function(J){(_._status===0||_._status===-1)&&(_._status=1,_._result=J)},function(J){(_._status===0||_._status===-1)&&(_._status=2,_._result=J)}),_._status===-1&&(_._status=0,_._result=Y)}if(_._status===1)return _._result.default;throw _._result}var de=typeof reportError=="function"?reportError:function(_){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var Y=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof _=="object"&&_!==null&&typeof _.message=="string"?String(_.message):String(_),error:_});if(!window.dispatchEvent(Y))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",_);return}console.error(_)},Ne={map:G,forEach:function(_,Y,J){G(_,function(){Y.apply(this,arguments)},J)},count:function(_){var Y=0;return G(_,function(){Y++}),Y},toArray:function(_){return G(_,function(Y){return Y})||[]},only:function(_){if(!te(_))throw Error("React.Children.only expected to receive a single React element child.");return _}};return ue.Activity=v,ue.Children=Ne,ue.Component=M,ue.Fragment=a,ue.Profiler=c,ue.PureComponent=K,ue.StrictMode=s,ue.Suspense=p,ue.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=k,ue.__COMPILER_RUNTIME={__proto__:null,c:function(_){return k.H.useMemoCache(_)}},ue.cache=function(_){return function(){return _.apply(null,arguments)}},ue.cacheSignal=function(){return null},ue.cloneElement=function(_,Y,J){if(_==null)throw Error("The argument must be a React element, but you passed "+_+".");var F=S({},_.props),re=_.key;if(Y!=null)for(me in Y.key!==void 0&&(re=""+Y.key),Y)!V.call(Y,me)||me==="key"||me==="__self"||me==="__source"||me==="ref"&&Y.ref===void 0||(F[me]=Y[me]);var me=arguments.length-2;if(me===1)F.children=J;else if(1<me){for(var Ae=Array(me),rt=0;rt<me;rt++)Ae[rt]=arguments[rt+2];F.children=Ae}return U(_.type,re,F)},ue.createContext=function(_){return _={$$typeof:h,_currentValue:_,_currentValue2:_,_threadCount:0,Provider:null,Consumer:null},_.Provider=_,_.Consumer={$$typeof:o,_context:_},_},ue.createElement=function(_,Y,J){var F,re={},me=null;if(Y!=null)for(F in Y.key!==void 0&&(me=""+Y.key),Y)V.call(Y,F)&&F!=="key"&&F!=="__self"&&F!=="__source"&&(re[F]=Y[F]);var Ae=arguments.length-2;if(Ae===1)re.children=J;else if(1<Ae){for(var rt=Array(Ae),Ye=0;Ye<Ae;Ye++)rt[Ye]=arguments[Ye+2];re.children=rt}if(_&&_.defaultProps)for(F in Ae=_.defaultProps,Ae)re[F]===void 0&&(re[F]=Ae[F]);return U(_,me,re)},ue.createRef=function(){return{current:null}},ue.forwardRef=function(_){return{$$typeof:m,render:_}},ue.isValidElement=te,ue.lazy=function(_){return{$$typeof:b,_payload:{_status:-1,_result:_},_init:ne}},ue.memo=function(_,Y){return{$$typeof:g,type:_,compare:Y===void 0?null:Y}},ue.startTransition=function(_){var Y=k.T,J={};k.T=J;try{var F=_(),re=k.S;re!==null&&re(J,F),typeof F=="object"&&F!==null&&typeof F.then=="function"&&F.then(W,de)}catch(me){de(me)}finally{Y!==null&&J.types!==null&&(Y.types=J.types),k.T=Y}},ue.unstable_useCacheRefresh=function(){return k.H.useCacheRefresh()},ue.use=function(_){return k.H.use(_)},ue.useActionState=function(_,Y,J){return k.H.useActionState(_,Y,J)},ue.useCallback=function(_,Y){return k.H.useCallback(_,Y)},ue.useContext=function(_){return k.H.useContext(_)},ue.useDebugValue=function(){},ue.useDeferredValue=function(_,Y){return k.H.useDeferredValue(_,Y)},ue.useEffect=function(_,Y){return k.H.useEffect(_,Y)},ue.useEffectEvent=function(_){return k.H.useEffectEvent(_)},ue.useId=function(){return k.H.useId()},ue.useImperativeHandle=function(_,Y,J){return k.H.useImperativeHandle(_,Y,J)},ue.useInsertionEffect=function(_,Y){return k.H.useInsertionEffect(_,Y)},ue.useLayoutEffect=function(_,Y){return k.H.useLayoutEffect(_,Y)},ue.useMemo=function(_,Y){return k.H.useMemo(_,Y)},ue.useOptimistic=function(_,Y){return k.H.useOptimistic(_,Y)},ue.useReducer=function(_,Y,J){return k.H.useReducer(_,Y,J)},ue.useRef=function(_){return k.H.useRef(_)},ue.useState=function(_){return k.H.useState(_)},ue.useSyncExternalStore=function(_,Y,J){return k.H.useSyncExternalStore(_,Y,J)},ue.useTransition=function(){return k.H.useTransition()},ue.version="19.2.1",ue}var Pm;function xf(){return Pm||(Pm=1,af.exports=E1()),af.exports}var he=xf();const An=b1(he);function Mg(){const u=An.useRef(null),[l]=Sf(u);return[l,u]}function Sf(u){const[l,a]=An.useState(new DOMRect(0,0,10,10)),s=An.useCallback(()=>{const c=u==null?void 0:u.current;c&&a(c.getBoundingClientRect())},[u]);return An.useLayoutEffect(()=>{const c=u==null?void 0:u.current;if(!c)return;s();const o=new ResizeObserver(s);return o.observe(c),window.addEventListener("resize",s),()=>{o.disconnect(),window.removeEventListener("resize",s)}},[s,u]),[l,s]}function eg(u){const l=document.createElement("textarea");l.style.position="absolute",l.style.zIndex="-1000",l.value=u,document.body.appendChild(l),l.select(),document.execCommand("copy"),l.remove()}function pu(u,l){u&&(l=Tl.getObject(u,l));const[a,s]=An.useState(l),c=An.useCallback(o=>{u?Tl.setObject(u,o):s(o)},[u,s]);return An.useEffect(()=>{if(u){const o=()=>s(Tl.getObject(u,l));return Tl.onChangeEmitter.addEventListener(u,o),()=>Tl.onChangeEmitter.removeEventListener(u,o)}},[l,u]),[a,c]}class w1{constructor(){this.onChangeEmitter=new EventTarget}getString(l,a){return localStorage[l]||a}setString(l,a){var s;localStorage[l]=a,this.onChangeEmitter.dispatchEvent(new Event(l)),(s=window.saveSettings)==null||s.call(window)}getObject(l,a){if(!localStorage[l])return a;try{return JSON.parse(localStorage[l])}catch{return a}}setObject(l,a){var s;localStorage[l]=JSON.stringify(a),this.onChangeEmitter.dispatchEvent(new Event(l)),(s=window.saveSettings)==null||s.call(window)}}const Tl=new w1;function Ol(...u){return u.filter(Boolean).join(" ")}const tg="\\u0000-\\u0020\\u007f-\\u009f",A1=new RegExp("(?:[a-zA-Z][a-zA-Z0-9+.-]{2,}:\\/\\/|www\\.)[^\\s"+tg+'"]{2,}[^\\s'+tg+`"')}\\],:;.!?]`,"ug"),O1="system",Cg="theme",_1=[{label:"Dark mode",value:"dark-mode"},{label:"Light mode",value:"light-mode"},{label:"System",value:"system"}],zg=window.matchMedia("(prefers-color-scheme: dark)");function N1(){document.playwrightThemeInitialized||(document.playwrightThemeInitialized=!0,document.defaultView.addEventListener("focus",u=>{u.target.document.nodeType===Node.DOCUMENT_NODE&&document.body.classList.remove("inactive")},!1),document.defaultView.addEventListener("blur",u=>{document.body.classList.add("inactive")},!1),Tf(Ef()),zg.addEventListener("change",()=>{Tf(Ef())}))}const M1=new Set;function Tf(u){const l=C1(),a=u==="system"?zg.matches?"dark-mode":"light-mode":u;if(l!==a){l&&document.documentElement.classList.remove(l),document.documentElement.classList.add(a);for(const s of M1)s(a)}}function Ef(){return Tl.getString(Cg,O1)}function C1(){return document.documentElement.classList.contains("dark-mode")?"dark-mode":document.documentElement.classList.contains("light-mode")?"light-mode":null}function z1(){const[u,l]=An.useState(Ef());return An.useEffect(()=>{Tl.setString(Cg,u),Tf(u)},[u]),[u,l]}var sf={exports:{}},_a={},uf={exports:{}},cf={};/**
 * @license React
 * scheduler.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var ng;function x1(){return ng||(ng=1,(function(u){function l(D,G){var ne=D.length;D.push(G);e:for(;0<ne;){var de=ne-1>>>1,Ne=D[de];if(0<c(Ne,G))D[de]=G,D[ne]=Ne,ne=de;else break e}}function a(D){return D.length===0?null:D[0]}function s(D){if(D.length===0)return null;var G=D[0],ne=D.pop();if(ne!==G){D[0]=ne;e:for(var de=0,Ne=D.length,_=Ne>>>1;de<_;){var Y=2*(de+1)-1,J=D[Y],F=Y+1,re=D[F];if(0>c(J,ne))F<Ne&&0>c(re,J)?(D[de]=re,D[F]=ne,de=F):(D[de]=J,D[Y]=ne,de=Y);else if(F<Ne&&0>c(re,ne))D[de]=re,D[F]=ne,de=F;else break e}}return G}function c(D,G){var ne=D.sortIndex-G.sortIndex;return ne!==0?ne:D.id-G.id}if(u.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;u.unstable_now=function(){return o.now()}}else{var h=Date,m=h.now();u.unstable_now=function(){return h.now()-m}}var p=[],g=[],b=1,v=null,O=3,E=!1,x=!1,S=!1,w=!1,M=typeof setTimeout=="function"?setTimeout:null,R=typeof clearTimeout=="function"?clearTimeout:null,K=typeof setImmediate<"u"?setImmediate:null;function Q(D){for(var G=a(g);G!==null;){if(G.callback===null)s(g);else if(G.startTime<=D)s(g),G.sortIndex=G.expirationTime,l(p,G);else break;G=a(g)}}function Z(D){if(S=!1,Q(D),!x)if(a(p)!==null)x=!0,W||(W=!0,$());else{var G=a(g);G!==null&&se(Z,G.startTime-D)}}var W=!1,k=-1,V=5,U=-1;function ae(){return w?!0:!(u.unstable_now()-U<V)}function te(){if(w=!1,W){var D=u.unstable_now();U=D;var G=!0;try{e:{x=!1,S&&(S=!1,R(k),k=-1),E=!0;var ne=O;try{t:{for(Q(D),v=a(p);v!==null&&!(v.expirationTime>D&&ae());){var de=v.callback;if(typeof de=="function"){v.callback=null,O=v.priorityLevel;var Ne=de(v.expirationTime<=D);if(D=u.unstable_now(),typeof Ne=="function"){v.callback=Ne,Q(D),G=!0;break t}v===a(p)&&s(p),Q(D)}else s(p);v=a(p)}if(v!==null)G=!0;else{var _=a(g);_!==null&&se(Z,_.startTime-D),G=!1}}break e}finally{v=null,O=ne,E=!1}G=void 0}}finally{G?$():W=!1}}}var $;if(typeof K=="function")$=function(){K(te)};else if(typeof MessageChannel<"u"){var ee=new MessageChannel,we=ee.port2;ee.port1.onmessage=te,$=function(){we.postMessage(null)}}else $=function(){M(te,0)};function se(D,G){k=M(function(){D(u.unstable_now())},G)}u.unstable_IdlePriority=5,u.unstable_ImmediatePriority=1,u.unstable_LowPriority=4,u.unstable_NormalPriority=3,u.unstable_Profiling=null,u.unstable_UserBlockingPriority=2,u.unstable_cancelCallback=function(D){D.callback=null},u.unstable_forceFrameRate=function(D){0>D||125<D?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):V=0<D?Math.floor(1e3/D):5},u.unstable_getCurrentPriorityLevel=function(){return O},u.unstable_next=function(D){switch(O){case 1:case 2:case 3:var G=3;break;default:G=O}var ne=O;O=G;try{return D()}finally{O=ne}},u.unstable_requestPaint=function(){w=!0},u.unstable_runWithPriority=function(D,G){switch(D){case 1:case 2:case 3:case 4:case 5:break;default:D=3}var ne=O;O=D;try{return G()}finally{O=ne}},u.unstable_scheduleCallback=function(D,G,ne){var de=u.unstable_now();switch(typeof ne=="object"&&ne!==null?(ne=ne.delay,ne=typeof ne=="number"&&0<ne?de+ne:de):ne=de,D){case 1:var Ne=-1;break;case 2:Ne=250;break;case 5:Ne=1073741823;break;case 4:Ne=1e4;break;default:Ne=5e3}return Ne=ne+Ne,D={id:b++,callback:G,priorityLevel:D,startTime:ne,expirationTime:Ne,sortIndex:-1},ne>de?(D.sortIndex=ne,l(g,D),a(p)===null&&D===a(g)&&(S?(R(k),k=-1):S=!0,se(Z,ne-de))):(D.sortIndex=Ne,l(p,D),x||E||(x=!0,W||(W=!0,$()))),D},u.unstable_shouldYield=ae,u.unstable_wrapCallback=function(D){var G=O;return function(){var ne=O;O=G;try{return D.apply(this,arguments)}finally{O=ne}}}})(cf)),cf}var lg;function D1(){return lg||(lg=1,uf.exports=x1()),uf.exports}var rf={exports:{}},st={};/**
 * @license React
 * react-dom.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var ig;function L1(){if(ig)return st;ig=1;var u=xf();function l(p){var g="https://react.dev/errors/"+p;if(1<arguments.length){g+="?args[]="+encodeURIComponent(arguments[1]);for(var b=2;b<arguments.length;b++)g+="&args[]="+encodeURIComponent(arguments[b])}return"Minified React error #"+p+"; visit "+g+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(){}var s={d:{f:a,r:function(){throw Error(l(522))},D:a,C:a,L:a,m:a,X:a,S:a,M:a},p:0,findDOMNode:null},c=Symbol.for("react.portal");function o(p,g,b){var v=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:c,key:v==null?null:""+v,children:p,containerInfo:g,implementation:b}}var h=u.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function m(p,g){if(p==="font")return"";if(typeof g=="string")return g==="use-credentials"?g:""}return st.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=s,st.createPortal=function(p,g){var b=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!g||g.nodeType!==1&&g.nodeType!==9&&g.nodeType!==11)throw Error(l(299));return o(p,g,null,b)},st.flushSync=function(p){var g=h.T,b=s.p;try{if(h.T=null,s.p=2,p)return p()}finally{h.T=g,s.p=b,s.d.f()}},st.preconnect=function(p,g){typeof p=="string"&&(g?(g=g.crossOrigin,g=typeof g=="string"?g==="use-credentials"?g:"":void 0):g=null,s.d.C(p,g))},st.prefetchDNS=function(p){typeof p=="string"&&s.d.D(p)},st.preinit=function(p,g){if(typeof p=="string"&&g&&typeof g.as=="string"){var b=g.as,v=m(b,g.crossOrigin),O=typeof g.integrity=="string"?g.integrity:void 0,E=typeof g.fetchPriority=="string"?g.fetchPriority:void 0;b==="style"?s.d.S(p,typeof g.precedence=="string"?g.precedence:void 0,{crossOrigin:v,integrity:O,fetchPriority:E}):b==="script"&&s.d.X(p,{crossOrigin:v,integrity:O,fetchPriority:E,nonce:typeof g.nonce=="string"?g.nonce:void 0})}},st.preinitModule=function(p,g){if(typeof p=="string")if(typeof g=="object"&&g!==null){if(g.as==null||g.as==="script"){var b=m(g.as,g.crossOrigin);s.d.M(p,{crossOrigin:b,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0})}}else g==null&&s.d.M(p)},st.preload=function(p,g){if(typeof p=="string"&&typeof g=="object"&&g!==null&&typeof g.as=="string"){var b=g.as,v=m(b,g.crossOrigin);s.d.L(p,b,{crossOrigin:v,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0,type:typeof g.type=="string"?g.type:void 0,fetchPriority:typeof g.fetchPriority=="string"?g.fetchPriority:void 0,referrerPolicy:typeof g.referrerPolicy=="string"?g.referrerPolicy:void 0,imageSrcSet:typeof g.imageSrcSet=="string"?g.imageSrcSet:void 0,imageSizes:typeof g.imageSizes=="string"?g.imageSizes:void 0,media:typeof g.media=="string"?g.media:void 0})}},st.preloadModule=function(p,g){if(typeof p=="string")if(g){var b=m(g.as,g.crossOrigin);s.d.m(p,{as:typeof g.as=="string"&&g.as!=="script"?g.as:void 0,crossOrigin:b,integrity:typeof g.integrity=="string"?g.integrity:void 0})}else s.d.m(p)},st.requestFormReset=function(p){s.d.r(p)},st.unstable_batchedUpdates=function(p,g){return p(g)},st.useFormState=function(p,g,b){return h.H.useFormState(p,g,b)},st.useFormStatus=function(){return h.H.useHostTransitionStatus()},st.version="19.2.1",st}var ag;function U1(){if(ag)return rf.exports;ag=1;function u(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(u)}catch(l){console.error(l)}}return u(),rf.exports=L1(),rf.exports}/**
 * @license React
 * react-dom-client.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var sg;function R1(){if(sg)return _a;sg=1;var u=D1(),l=xf(),a=U1();function s(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function c(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function h(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function m(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function p(e){if(o(e)!==e)throw Error(s(188))}function g(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(s(188));return t!==e?null:e}for(var n=e,i=t;;){var r=n.return;if(r===null)break;var f=r.alternate;if(f===null){if(i=r.return,i!==null){n=i;continue}break}if(r.child===f.child){for(f=r.child;f;){if(f===n)return p(r),e;if(f===i)return p(r),t;f=f.sibling}throw Error(s(188))}if(n.return!==i.return)n=r,i=f;else{for(var d=!1,y=r.child;y;){if(y===n){d=!0,n=r,i=f;break}if(y===i){d=!0,i=r,n=f;break}y=y.sibling}if(!d){for(y=f.child;y;){if(y===n){d=!0,n=f,i=r;break}if(y===i){d=!0,i=f,n=r;break}y=y.sibling}if(!d)throw Error(s(189))}}if(n.alternate!==i)throw Error(s(190))}if(n.tag!==3)throw Error(s(188));return n.stateNode.current===n?e:t}function b(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=b(e),t!==null)return t;e=e.sibling}return null}var v=Object.assign,O=Symbol.for("react.element"),E=Symbol.for("react.transitional.element"),x=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),w=Symbol.for("react.strict_mode"),M=Symbol.for("react.profiler"),R=Symbol.for("react.consumer"),K=Symbol.for("react.context"),Q=Symbol.for("react.forward_ref"),Z=Symbol.for("react.suspense"),W=Symbol.for("react.suspense_list"),k=Symbol.for("react.memo"),V=Symbol.for("react.lazy"),U=Symbol.for("react.activity"),ae=Symbol.for("react.memo_cache_sentinel"),te=Symbol.iterator;function $(e){return e===null||typeof e!="object"?null:(e=te&&e[te]||e["@@iterator"],typeof e=="function"?e:null)}var ee=Symbol.for("react.client.reference");function we(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ee?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case S:return"Fragment";case M:return"Profiler";case w:return"StrictMode";case Z:return"Suspense";case W:return"SuspenseList";case U:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case x:return"Portal";case K:return e.displayName||"Context";case R:return(e._context.displayName||"Context")+".Consumer";case Q:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case k:return t=e.displayName||null,t!==null?t:we(e.type)||"Memo";case V:t=e._payload,e=e._init;try{return we(e(t))}catch{}}return null}var se=Array.isArray,D=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,G=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ne={pending:!1,data:null,method:null,action:null},de=[],Ne=-1;function _(e){return{current:e}}function Y(e){0>Ne||(e.current=de[Ne],de[Ne]=null,Ne--)}function J(e,t){Ne++,de[Ne]=e.current,e.current=t}var F=_(null),re=_(null),me=_(null),Ae=_(null);function rt(e,t){switch(J(me,t),J(re,e),J(F,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?bm(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=bm(t),e=Sm(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}Y(F),J(F,e)}function Ye(){Y(F),Y(re),Y(me)}function Di(e){e.memoizedState!==null&&J(Ae,e);var t=F.current,n=Sm(t,e.type);t!==n&&(J(re,e),J(F,n))}function ka(e){re.current===e&&(Y(F),Y(re)),Ae.current===e&&(Y(Ae),Ta._currentValue=ne)}var qu,Zf;function nl(e){if(qu===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);qu=t&&t[1]||"",Zf=-1<n.stack.indexOf(`
    at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
`+qu+e+Zf}var Hu=!1;function Yu(e,t){if(!e||Hu)return"";Hu=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var i={DetermineComponentFrameRoot:function(){try{if(t){var H=function(){throw Error()};if(Object.defineProperty(H.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(H,[])}catch(j){var L=j}Reflect.construct(e,[],H)}else{try{H.call()}catch(j){L=j}e.call(H.prototype)}}else{try{throw Error()}catch(j){L=j}(H=e())&&typeof H.catch=="function"&&H.catch(function(){})}}catch(j){if(j&&L&&typeof j.stack=="string")return[j.stack,L.stack]}return[null,null]}};i.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var r=Object.getOwnPropertyDescriptor(i.DetermineComponentFrameRoot,"name");r&&r.configurable&&Object.defineProperty(i.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var f=i.DetermineComponentFrameRoot(),d=f[0],y=f[1];if(d&&y){var T=d.split(`
`),z=y.split(`
`);for(r=i=0;i<T.length&&!T[i].includes("DetermineComponentFrameRoot");)i++;for(;r<z.length&&!z[r].includes("DetermineComponentFrameRoot");)r++;if(i===T.length||r===z.length)for(i=T.length-1,r=z.length-1;1<=i&&0<=r&&T[i]!==z[r];)r--;for(;1<=i&&0<=r;i--,r--)if(T[i]!==z[r]){if(i!==1||r!==1)do if(i--,r--,0>r||T[i]!==z[r]){var B=`
`+T[i].replace(" at new "," at ");return e.displayName&&B.includes("<anonymous>")&&(B=B.replace("<anonymous>",e.displayName)),B}while(1<=i&&0<=r);break}}}finally{Hu=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?nl(n):""}function Wp(e,t){switch(e.tag){case 26:case 27:case 5:return nl(e.type);case 16:return nl("Lazy");case 13:return e.child!==t&&t!==null?nl("Suspense Fallback"):nl("Suspense");case 19:return nl("SuspenseList");case 0:case 15:return Yu(e.type,!1);case 11:return Yu(e.type.render,!1);case 1:return Yu(e.type,!0);case 31:return nl("Activity");default:return""}}function Jf(e){try{var t="",n=null;do t+=Wp(e,n),n=e,e=e.return;while(e);return t}catch(i){return`
Error generating stack: `+i.message+`
`+i.stack}}var $u=Object.prototype.hasOwnProperty,Ku=u.unstable_scheduleCallback,Gu=u.unstable_cancelCallback,Ip=u.unstable_shouldYield,Fp=u.unstable_requestPaint,Et=u.unstable_now,Pp=u.unstable_getCurrentPriorityLevel,Wf=u.unstable_ImmediatePriority,If=u.unstable_UserBlockingPriority,qa=u.unstable_NormalPriority,ey=u.unstable_LowPriority,Ff=u.unstable_IdlePriority,ty=u.log,ny=u.unstable_setDisableYieldValue,Li=null,wt=null;function _n(e){if(typeof ty=="function"&&ny(e),wt&&typeof wt.setStrictMode=="function")try{wt.setStrictMode(Li,e)}catch{}}var At=Math.clz32?Math.clz32:ay,ly=Math.log,iy=Math.LN2;function ay(e){return e>>>=0,e===0?32:31-(ly(e)/iy|0)|0}var Ha=256,Ya=262144,$a=4194304;function ll(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Ka(e,t,n){var i=e.pendingLanes;if(i===0)return 0;var r=0,f=e.suspendedLanes,d=e.pingedLanes;e=e.warmLanes;var y=i&134217727;return y!==0?(i=y&~f,i!==0?r=ll(i):(d&=y,d!==0?r=ll(d):n||(n=y&~e,n!==0&&(r=ll(n))))):(y=i&~f,y!==0?r=ll(y):d!==0?r=ll(d):n||(n=i&~e,n!==0&&(r=ll(n)))),r===0?0:t!==0&&t!==r&&(t&f)===0&&(f=r&-r,n=t&-t,f>=n||f===32&&(n&4194048)!==0)?t:r}function Ui(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function sy(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Pf(){var e=$a;return $a<<=1,($a&62914560)===0&&($a=4194304),e}function Vu(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ri(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function uy(e,t,n,i,r,f){var d=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var y=e.entanglements,T=e.expirationTimes,z=e.hiddenUpdates;for(n=d&~n;0<n;){var B=31-At(n),H=1<<B;y[B]=0,T[B]=-1;var L=z[B];if(L!==null)for(z[B]=null,B=0;B<L.length;B++){var j=L[B];j!==null&&(j.lane&=-536870913)}n&=~H}i!==0&&eo(e,i,0),f!==0&&r===0&&e.tag!==0&&(e.suspendedLanes|=f&~(d&~t))}function eo(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var i=31-At(t);e.entangledLanes|=t,e.entanglements[i]=e.entanglements[i]|1073741824|n&261930}function to(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var i=31-At(n),r=1<<i;r&t|e[i]&t&&(e[i]|=t),n&=~r}}function no(e,t){var n=t&-t;return n=(n&42)!==0?1:Qu(n),(n&(e.suspendedLanes|t))!==0?0:n}function Qu(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Xu(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function lo(){var e=G.p;return e!==0?e:(e=window.event,e===void 0?32:Km(e.type))}function io(e,t){var n=G.p;try{return G.p=e,t()}finally{G.p=n}}var Nn=Math.random().toString(36).slice(2),tt="__reactFiber$"+Nn,ht="__reactProps$"+Nn,Cl="__reactContainer$"+Nn,Zu="__reactEvents$"+Nn,cy="__reactListeners$"+Nn,ry="__reactHandles$"+Nn,ao="__reactResources$"+Nn,ji="__reactMarker$"+Nn;function Ju(e){delete e[tt],delete e[ht],delete e[Zu],delete e[cy],delete e[ry]}function zl(e){var t=e[tt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Cl]||n[tt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Nm(e);e!==null;){if(n=e[tt])return n;e=Nm(e)}return t}e=n,n=e.parentNode}return null}function xl(e){if(e=e[tt]||e[Cl]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Bi(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(s(33))}function Dl(e){var t=e[ao];return t||(t=e[ao]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Pe(e){e[ji]=!0}var so=new Set,uo={};function il(e,t){Ll(e,t),Ll(e+"Capture",t)}function Ll(e,t){for(uo[e]=t,e=0;e<t.length;e++)so.add(t[e])}var fy=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),co={},ro={};function oy(e){return $u.call(ro,e)?!0:$u.call(co,e)?!1:fy.test(e)?ro[e]=!0:(co[e]=!0,!1)}function Ga(e,t,n){if(oy(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var i=t.toLowerCase().slice(0,5);if(i!=="data-"&&i!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+n)}}function Va(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+n)}}function ln(e,t,n,i){if(i===null)e.removeAttribute(n);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,""+i)}}function Ut(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function fo(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function hy(e,t,n){var i=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof i<"u"&&typeof i.get=="function"&&typeof i.set=="function"){var r=i.get,f=i.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return r.call(this)},set:function(d){n=""+d,f.call(this,d)}}),Object.defineProperty(e,t,{enumerable:i.enumerable}),{getValue:function(){return n},setValue:function(d){n=""+d},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Wu(e){if(!e._valueTracker){var t=fo(e)?"checked":"value";e._valueTracker=hy(e,t,""+e[t])}}function oo(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),i="";return e&&(i=fo(e)?e.checked?"true":"false":e.value),e=i,e!==n?(t.setValue(e),!0):!1}function Qa(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var dy=/[\n"\\]/g;function Rt(e){return e.replace(dy,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Iu(e,t,n,i,r,f,d,y){e.name="",d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"?e.type=d:e.removeAttribute("type"),t!=null?d==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Ut(t)):e.value!==""+Ut(t)&&(e.value=""+Ut(t)):d!=="submit"&&d!=="reset"||e.removeAttribute("value"),t!=null?Fu(e,d,Ut(t)):n!=null?Fu(e,d,Ut(n)):i!=null&&e.removeAttribute("value"),r==null&&f!=null&&(e.defaultChecked=!!f),r!=null&&(e.checked=r&&typeof r!="function"&&typeof r!="symbol"),y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"?e.name=""+Ut(y):e.removeAttribute("name")}function ho(e,t,n,i,r,f,d,y){if(f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"&&(e.type=f),t!=null||n!=null){if(!(f!=="submit"&&f!=="reset"||t!=null)){Wu(e);return}n=n!=null?""+Ut(n):"",t=t!=null?""+Ut(t):n,y||t===e.value||(e.value=t),e.defaultValue=t}i=i??r,i=typeof i!="function"&&typeof i!="symbol"&&!!i,e.checked=y?e.checked:!!i,e.defaultChecked=!!i,d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"&&(e.name=d),Wu(e)}function Fu(e,t,n){t==="number"&&Qa(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function Ul(e,t,n,i){if(e=e.options,t){t={};for(var r=0;r<n.length;r++)t["$"+n[r]]=!0;for(n=0;n<e.length;n++)r=t.hasOwnProperty("$"+e[n].value),e[n].selected!==r&&(e[n].selected=r),r&&i&&(e[n].defaultSelected=!0)}else{for(n=""+Ut(n),t=null,r=0;r<e.length;r++){if(e[r].value===n){e[r].selected=!0,i&&(e[r].defaultSelected=!0);return}t!==null||e[r].disabled||(t=e[r])}t!==null&&(t.selected=!0)}}function mo(e,t,n){if(t!=null&&(t=""+Ut(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+Ut(n):""}function go(e,t,n,i){if(t==null){if(i!=null){if(n!=null)throw Error(s(92));if(se(i)){if(1<i.length)throw Error(s(93));i=i[0]}n=i}n==null&&(n=""),t=n}n=Ut(t),e.defaultValue=n,i=e.textContent,i===n&&i!==""&&i!==null&&(e.value=i),Wu(e)}function Rl(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var my=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function po(e,t,n){var i=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?i?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":i?e.setProperty(t,n):typeof n!="number"||n===0||my.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function yo(e,t,n){if(t!=null&&typeof t!="object")throw Error(s(62));if(e=e.style,n!=null){for(var i in n)!n.hasOwnProperty(i)||t!=null&&t.hasOwnProperty(i)||(i.indexOf("--")===0?e.setProperty(i,""):i==="float"?e.cssFloat="":e[i]="");for(var r in t)i=t[r],t.hasOwnProperty(r)&&n[r]!==i&&po(e,r,i)}else for(var f in t)t.hasOwnProperty(f)&&po(e,f,t[f])}function Pu(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var gy=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),py=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Xa(e){return py.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function an(){}var ec=null;function tc(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var jl=null,Bl=null;function vo(e){var t=xl(e);if(t&&(e=t.stateNode)){var n=e[ht]||null;e:switch(e=t.stateNode,t.type){case"input":if(Iu(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+Rt(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var i=n[t];if(i!==e&&i.form===e.form){var r=i[ht]||null;if(!r)throw Error(s(90));Iu(i,r.value,r.defaultValue,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name)}}for(t=0;t<n.length;t++)i=n[t],i.form===e.form&&oo(i)}break e;case"textarea":mo(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&Ul(e,!!n.multiple,t,!1)}}}var nc=!1;function bo(e,t,n){if(nc)return e(t,n);nc=!0;try{var i=e(t);return i}finally{if(nc=!1,(jl!==null||Bl!==null)&&(Us(),jl&&(t=jl,e=Bl,Bl=jl=null,vo(t),e)))for(t=0;t<e.length;t++)vo(e[t])}}function ki(e,t){var n=e.stateNode;if(n===null)return null;var i=n[ht]||null;if(i===null)return null;n=i[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(i=!i.disabled)||(e=e.type,i=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!i;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(s(231,t,typeof n));return n}var sn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),lc=!1;if(sn)try{var qi={};Object.defineProperty(qi,"passive",{get:function(){lc=!0}}),window.addEventListener("test",qi,qi),window.removeEventListener("test",qi,qi)}catch{lc=!1}var Mn=null,ic=null,Za=null;function So(){if(Za)return Za;var e,t=ic,n=t.length,i,r="value"in Mn?Mn.value:Mn.textContent,f=r.length;for(e=0;e<n&&t[e]===r[e];e++);var d=n-e;for(i=1;i<=d&&t[n-i]===r[f-i];i++);return Za=r.slice(e,1<i?1-i:void 0)}function Ja(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Wa(){return!0}function To(){return!1}function dt(e){function t(n,i,r,f,d){this._reactName=n,this._targetInst=r,this.type=i,this.nativeEvent=f,this.target=d,this.currentTarget=null;for(var y in e)e.hasOwnProperty(y)&&(n=e[y],this[y]=n?n(f):f[y]);return this.isDefaultPrevented=(f.defaultPrevented!=null?f.defaultPrevented:f.returnValue===!1)?Wa:To,this.isPropagationStopped=To,this}return v(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Wa)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Wa)},persist:function(){},isPersistent:Wa}),t}var al={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ia=dt(al),Hi=v({},al,{view:0,detail:0}),yy=dt(Hi),ac,sc,Yi,Fa=v({},Hi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:cc,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Yi&&(Yi&&e.type==="mousemove"?(ac=e.screenX-Yi.screenX,sc=e.screenY-Yi.screenY):sc=ac=0,Yi=e),ac)},movementY:function(e){return"movementY"in e?e.movementY:sc}}),Eo=dt(Fa),vy=v({},Fa,{dataTransfer:0}),by=dt(vy),Sy=v({},Hi,{relatedTarget:0}),uc=dt(Sy),Ty=v({},al,{animationName:0,elapsedTime:0,pseudoElement:0}),Ey=dt(Ty),wy=v({},al,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Ay=dt(wy),Oy=v({},al,{data:0}),wo=dt(Oy),_y={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Ny={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},My={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Cy(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=My[e])?!!t[e]:!1}function cc(){return Cy}var zy=v({},Hi,{key:function(e){if(e.key){var t=_y[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Ja(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Ny[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:cc,charCode:function(e){return e.type==="keypress"?Ja(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ja(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),xy=dt(zy),Dy=v({},Fa,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ao=dt(Dy),Ly=v({},Hi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:cc}),Uy=dt(Ly),Ry=v({},al,{propertyName:0,elapsedTime:0,pseudoElement:0}),jy=dt(Ry),By=v({},Fa,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),ky=dt(By),qy=v({},al,{newState:0,oldState:0}),Hy=dt(qy),Yy=[9,13,27,32],rc=sn&&"CompositionEvent"in window,$i=null;sn&&"documentMode"in document&&($i=document.documentMode);var $y=sn&&"TextEvent"in window&&!$i,Oo=sn&&(!rc||$i&&8<$i&&11>=$i),_o=" ",No=!1;function Mo(e,t){switch(e){case"keyup":return Yy.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Co(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var kl=!1;function Ky(e,t){switch(e){case"compositionend":return Co(t);case"keypress":return t.which!==32?null:(No=!0,_o);case"textInput":return e=t.data,e===_o&&No?null:e;default:return null}}function Gy(e,t){if(kl)return e==="compositionend"||!rc&&Mo(e,t)?(e=So(),Za=ic=Mn=null,kl=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Oo&&t.locale!=="ko"?null:t.data;default:return null}}var Vy={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function zo(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Vy[e.type]:t==="textarea"}function xo(e,t,n,i){jl?Bl?Bl.push(i):Bl=[i]:jl=i,t=Ys(t,"onChange"),0<t.length&&(n=new Ia("onChange","change",null,n,i),e.push({event:n,listeners:t}))}var Ki=null,Gi=null;function Qy(e){dm(e,0)}function Pa(e){var t=Bi(e);if(oo(t))return e}function Do(e,t){if(e==="change")return t}var Lo=!1;if(sn){var fc;if(sn){var oc="oninput"in document;if(!oc){var Uo=document.createElement("div");Uo.setAttribute("oninput","return;"),oc=typeof Uo.oninput=="function"}fc=oc}else fc=!1;Lo=fc&&(!document.documentMode||9<document.documentMode)}function Ro(){Ki&&(Ki.detachEvent("onpropertychange",jo),Gi=Ki=null)}function jo(e){if(e.propertyName==="value"&&Pa(Gi)){var t=[];xo(t,Gi,e,tc(e)),bo(Qy,t)}}function Xy(e,t,n){e==="focusin"?(Ro(),Ki=t,Gi=n,Ki.attachEvent("onpropertychange",jo)):e==="focusout"&&Ro()}function Zy(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Pa(Gi)}function Jy(e,t){if(e==="click")return Pa(t)}function Wy(e,t){if(e==="input"||e==="change")return Pa(t)}function Iy(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Ot=typeof Object.is=="function"?Object.is:Iy;function Vi(e,t){if(Ot(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;for(i=0;i<n.length;i++){var r=n[i];if(!$u.call(t,r)||!Ot(e[r],t[r]))return!1}return!0}function Bo(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function ko(e,t){var n=Bo(e);e=0;for(var i;n;){if(n.nodeType===3){if(i=e+n.textContent.length,e<=t&&i>=t)return{node:n,offset:t-e};e=i}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Bo(n)}}function qo(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?qo(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Ho(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Qa(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Qa(e.document)}return t}function hc(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var Fy=sn&&"documentMode"in document&&11>=document.documentMode,ql=null,dc=null,Qi=null,mc=!1;function Yo(e,t,n){var i=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;mc||ql==null||ql!==Qa(i)||(i=ql,"selectionStart"in i&&hc(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),Qi&&Vi(Qi,i)||(Qi=i,i=Ys(dc,"onSelect"),0<i.length&&(t=new Ia("onSelect","select",null,t,n),e.push({event:t,listeners:i}),t.target=ql)))}function sl(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Hl={animationend:sl("Animation","AnimationEnd"),animationiteration:sl("Animation","AnimationIteration"),animationstart:sl("Animation","AnimationStart"),transitionrun:sl("Transition","TransitionRun"),transitionstart:sl("Transition","TransitionStart"),transitioncancel:sl("Transition","TransitionCancel"),transitionend:sl("Transition","TransitionEnd")},gc={},$o={};sn&&($o=document.createElement("div").style,"AnimationEvent"in window||(delete Hl.animationend.animation,delete Hl.animationiteration.animation,delete Hl.animationstart.animation),"TransitionEvent"in window||delete Hl.transitionend.transition);function ul(e){if(gc[e])return gc[e];if(!Hl[e])return e;var t=Hl[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in $o)return gc[e]=t[n];return e}var Ko=ul("animationend"),Go=ul("animationiteration"),Vo=ul("animationstart"),Py=ul("transitionrun"),e0=ul("transitionstart"),t0=ul("transitioncancel"),Qo=ul("transitionend"),Xo=new Map,pc="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");pc.push("scrollEnd");function Qt(e,t){Xo.set(e,t),il(t,[e])}var es=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},jt=[],Yl=0,yc=0;function ts(){for(var e=Yl,t=yc=Yl=0;t<e;){var n=jt[t];jt[t++]=null;var i=jt[t];jt[t++]=null;var r=jt[t];jt[t++]=null;var f=jt[t];if(jt[t++]=null,i!==null&&r!==null){var d=i.pending;d===null?r.next=r:(r.next=d.next,d.next=r),i.pending=r}f!==0&&Zo(n,r,f)}}function ns(e,t,n,i){jt[Yl++]=e,jt[Yl++]=t,jt[Yl++]=n,jt[Yl++]=i,yc|=i,e.lanes|=i,e=e.alternate,e!==null&&(e.lanes|=i)}function vc(e,t,n,i){return ns(e,t,n,i),ls(e)}function cl(e,t){return ns(e,null,null,t),ls(e)}function Zo(e,t,n){e.lanes|=n;var i=e.alternate;i!==null&&(i.lanes|=n);for(var r=!1,f=e.return;f!==null;)f.childLanes|=n,i=f.alternate,i!==null&&(i.childLanes|=n),f.tag===22&&(e=f.stateNode,e===null||e._visibility&1||(r=!0)),e=f,f=f.return;return e.tag===3?(f=e.stateNode,r&&t!==null&&(r=31-At(n),e=f.hiddenUpdates,i=e[r],i===null?e[r]=[t]:i.push(t),t.lane=n|536870912),f):null}function ls(e){if(50<ma)throw ma=0,Nr=null,Error(s(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var $l={};function n0(e,t,n,i){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function _t(e,t,n,i){return new n0(e,t,n,i)}function bc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function un(e,t){var n=e.alternate;return n===null?(n=_t(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function Jo(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function is(e,t,n,i,r,f){var d=0;if(i=e,typeof e=="function")bc(e)&&(d=1);else if(typeof e=="string")d=u1(e,n,F.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case U:return e=_t(31,n,t,r),e.elementType=U,e.lanes=f,e;case S:return rl(n.children,r,f,t);case w:d=8,r|=24;break;case M:return e=_t(12,n,t,r|2),e.elementType=M,e.lanes=f,e;case Z:return e=_t(13,n,t,r),e.elementType=Z,e.lanes=f,e;case W:return e=_t(19,n,t,r),e.elementType=W,e.lanes=f,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case K:d=10;break e;case R:d=9;break e;case Q:d=11;break e;case k:d=14;break e;case V:d=16,i=null;break e}d=29,n=Error(s(130,e===null?"null":typeof e,"")),i=null}return t=_t(d,n,t,r),t.elementType=e,t.type=i,t.lanes=f,t}function rl(e,t,n,i){return e=_t(7,e,i,t),e.lanes=n,e}function Sc(e,t,n){return e=_t(6,e,null,t),e.lanes=n,e}function Wo(e){var t=_t(18,null,null,0);return t.stateNode=e,t}function Tc(e,t,n){return t=_t(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Io=new WeakMap;function Bt(e,t){if(typeof e=="object"&&e!==null){var n=Io.get(e);return n!==void 0?n:(t={value:e,source:t,stack:Jf(t)},Io.set(e,t),t)}return{value:e,source:t,stack:Jf(t)}}var Kl=[],Gl=0,as=null,Xi=0,kt=[],qt=0,Cn=null,It=1,Ft="";function cn(e,t){Kl[Gl++]=Xi,Kl[Gl++]=as,as=e,Xi=t}function Fo(e,t,n){kt[qt++]=It,kt[qt++]=Ft,kt[qt++]=Cn,Cn=e;var i=It;e=Ft;var r=32-At(i)-1;i&=~(1<<r),n+=1;var f=32-At(t)+r;if(30<f){var d=r-r%5;f=(i&(1<<d)-1).toString(32),i>>=d,r-=d,It=1<<32-At(t)+r|n<<r|i,Ft=f+e}else It=1<<f|n<<r|i,Ft=e}function Ec(e){e.return!==null&&(cn(e,1),Fo(e,1,0))}function wc(e){for(;e===as;)as=Kl[--Gl],Kl[Gl]=null,Xi=Kl[--Gl],Kl[Gl]=null;for(;e===Cn;)Cn=kt[--qt],kt[qt]=null,Ft=kt[--qt],kt[qt]=null,It=kt[--qt],kt[qt]=null}function Po(e,t){kt[qt++]=It,kt[qt++]=Ft,kt[qt++]=Cn,It=t.id,Ft=t.overflow,Cn=e}var nt=null,Le=null,be=!1,zn=null,Ht=!1,Ac=Error(s(519));function xn(e){var t=Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Zi(Bt(t,e)),Ac}function eh(e){var t=e.stateNode,n=e.type,i=e.memoizedProps;switch(t[tt]=e,t[ht]=i,n){case"dialog":pe("cancel",t),pe("close",t);break;case"iframe":case"object":case"embed":pe("load",t);break;case"video":case"audio":for(n=0;n<pa.length;n++)pe(pa[n],t);break;case"source":pe("error",t);break;case"img":case"image":case"link":pe("error",t),pe("load",t);break;case"details":pe("toggle",t);break;case"input":pe("invalid",t),ho(t,i.value,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name,!0);break;case"select":pe("invalid",t);break;case"textarea":pe("invalid",t),go(t,i.value,i.defaultValue,i.children)}n=i.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||i.suppressHydrationWarning===!0||ym(t.textContent,n)?(i.popover!=null&&(pe("beforetoggle",t),pe("toggle",t)),i.onScroll!=null&&pe("scroll",t),i.onScrollEnd!=null&&pe("scrollend",t),i.onClick!=null&&(t.onclick=an),t=!0):t=!1,t||xn(e,!0)}function th(e){for(nt=e.return;nt;)switch(nt.tag){case 5:case 31:case 13:Ht=!1;return;case 27:case 3:Ht=!0;return;default:nt=nt.return}}function Vl(e){if(e!==nt)return!1;if(!be)return th(e),be=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||$r(e.type,e.memoizedProps)),n=!n),n&&Le&&xn(e),th(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(317));Le=_m(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(317));Le=_m(e)}else t===27?(t=Le,Vn(e.type)?(e=Xr,Xr=null,Le=e):Le=t):Le=nt?$t(e.stateNode.nextSibling):null;return!0}function fl(){Le=nt=null,be=!1}function Oc(){var e=zn;return e!==null&&(yt===null?yt=e:yt.push.apply(yt,e),zn=null),e}function Zi(e){zn===null?zn=[e]:zn.push(e)}var _c=_(null),ol=null,rn=null;function Dn(e,t,n){J(_c,t._currentValue),t._currentValue=n}function fn(e){e._currentValue=_c.current,Y(_c)}function Nc(e,t,n){for(;e!==null;){var i=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,i!==null&&(i.childLanes|=t)):i!==null&&(i.childLanes&t)!==t&&(i.childLanes|=t),e===n)break;e=e.return}}function Mc(e,t,n,i){var r=e.child;for(r!==null&&(r.return=e);r!==null;){var f=r.dependencies;if(f!==null){var d=r.child;f=f.firstContext;e:for(;f!==null;){var y=f;f=r;for(var T=0;T<t.length;T++)if(y.context===t[T]){f.lanes|=n,y=f.alternate,y!==null&&(y.lanes|=n),Nc(f.return,n,e),i||(d=null);break e}f=y.next}}else if(r.tag===18){if(d=r.return,d===null)throw Error(s(341));d.lanes|=n,f=d.alternate,f!==null&&(f.lanes|=n),Nc(d,n,e),d=null}else d=r.child;if(d!==null)d.return=r;else for(d=r;d!==null;){if(d===e){d=null;break}if(r=d.sibling,r!==null){r.return=d.return,d=r;break}d=d.return}r=d}}function Ql(e,t,n,i){e=null;for(var r=t,f=!1;r!==null;){if(!f){if((r.flags&524288)!==0)f=!0;else if((r.flags&262144)!==0)break}if(r.tag===10){var d=r.alternate;if(d===null)throw Error(s(387));if(d=d.memoizedProps,d!==null){var y=r.type;Ot(r.pendingProps.value,d.value)||(e!==null?e.push(y):e=[y])}}else if(r===Ae.current){if(d=r.alternate,d===null)throw Error(s(387));d.memoizedState.memoizedState!==r.memoizedState.memoizedState&&(e!==null?e.push(Ta):e=[Ta])}r=r.return}e!==null&&Mc(t,e,n,i),t.flags|=262144}function ss(e){for(e=e.firstContext;e!==null;){if(!Ot(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function hl(e){ol=e,rn=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function lt(e){return nh(ol,e)}function us(e,t){return ol===null&&hl(e),nh(e,t)}function nh(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},rn===null){if(e===null)throw Error(s(308));rn=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else rn=rn.next=t;return n}var l0=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,i){e.push(i)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},i0=u.unstable_scheduleCallback,a0=u.unstable_NormalPriority,Qe={$$typeof:K,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Cc(){return{controller:new l0,data:new Map,refCount:0}}function Ji(e){e.refCount--,e.refCount===0&&i0(a0,function(){e.controller.abort()})}var Wi=null,zc=0,Xl=0,Zl=null;function s0(e,t){if(Wi===null){var n=Wi=[];zc=0,Xl=Lr(),Zl={status:"pending",value:void 0,then:function(i){n.push(i)}}}return zc++,t.then(lh,lh),t}function lh(){if(--zc===0&&Wi!==null){Zl!==null&&(Zl.status="fulfilled");var e=Wi;Wi=null,Xl=0,Zl=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function u0(e,t){var n=[],i={status:"pending",value:null,reason:null,then:function(r){n.push(r)}};return e.then(function(){i.status="fulfilled",i.value=t;for(var r=0;r<n.length;r++)(0,n[r])(t)},function(r){for(i.status="rejected",i.reason=r,r=0;r<n.length;r++)(0,n[r])(void 0)}),i}var ih=D.S;D.S=function(e,t){Yd=Et(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&s0(e,t),ih!==null&&ih(e,t)};var dl=_(null);function xc(){var e=dl.current;return e!==null?e:xe.pooledCache}function cs(e,t){t===null?J(dl,dl.current):J(dl,t.pool)}function ah(){var e=xc();return e===null?null:{parent:Qe._currentValue,pool:e}}var Jl=Error(s(460)),Dc=Error(s(474)),rs=Error(s(542)),fs={then:function(){}};function sh(e){return e=e.status,e==="fulfilled"||e==="rejected"}function uh(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(an,an),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,rh(e),e;default:if(typeof t.status=="string")t.then(an,an);else{if(e=xe,e!==null&&100<e.shellSuspendCounter)throw Error(s(482));e=t,e.status="pending",e.then(function(i){if(t.status==="pending"){var r=t;r.status="fulfilled",r.value=i}},function(i){if(t.status==="pending"){var r=t;r.status="rejected",r.reason=i}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,rh(e),e}throw gl=t,Jl}}function ml(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(gl=n,Jl):n}}var gl=null;function ch(){if(gl===null)throw Error(s(459));var e=gl;return gl=null,e}function rh(e){if(e===Jl||e===rs)throw Error(s(483))}var Wl=null,Ii=0;function os(e){var t=Ii;return Ii+=1,Wl===null&&(Wl=[]),uh(Wl,e,t)}function Fi(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function hs(e,t){throw t.$$typeof===O?Error(s(525)):(e=Object.prototype.toString.call(t),Error(s(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function fh(e){function t(N,A){if(e){var C=N.deletions;C===null?(N.deletions=[A],N.flags|=16):C.push(A)}}function n(N,A){if(!e)return null;for(;A!==null;)t(N,A),A=A.sibling;return null}function i(N){for(var A=new Map;N!==null;)N.key!==null?A.set(N.key,N):A.set(N.index,N),N=N.sibling;return A}function r(N,A){return N=un(N,A),N.index=0,N.sibling=null,N}function f(N,A,C){return N.index=C,e?(C=N.alternate,C!==null?(C=C.index,C<A?(N.flags|=67108866,A):C):(N.flags|=67108866,A)):(N.flags|=1048576,A)}function d(N){return e&&N.alternate===null&&(N.flags|=67108866),N}function y(N,A,C,q){return A===null||A.tag!==6?(A=Sc(C,N.mode,q),A.return=N,A):(A=r(A,C),A.return=N,A)}function T(N,A,C,q){var le=C.type;return le===S?B(N,A,C.props.children,q,C.key):A!==null&&(A.elementType===le||typeof le=="object"&&le!==null&&le.$$typeof===V&&ml(le)===A.type)?(A=r(A,C.props),Fi(A,C),A.return=N,A):(A=is(C.type,C.key,C.props,null,N.mode,q),Fi(A,C),A.return=N,A)}function z(N,A,C,q){return A===null||A.tag!==4||A.stateNode.containerInfo!==C.containerInfo||A.stateNode.implementation!==C.implementation?(A=Tc(C,N.mode,q),A.return=N,A):(A=r(A,C.children||[]),A.return=N,A)}function B(N,A,C,q,le){return A===null||A.tag!==7?(A=rl(C,N.mode,q,le),A.return=N,A):(A=r(A,C),A.return=N,A)}function H(N,A,C){if(typeof A=="string"&&A!==""||typeof A=="number"||typeof A=="bigint")return A=Sc(""+A,N.mode,C),A.return=N,A;if(typeof A=="object"&&A!==null){switch(A.$$typeof){case E:return C=is(A.type,A.key,A.props,null,N.mode,C),Fi(C,A),C.return=N,C;case x:return A=Tc(A,N.mode,C),A.return=N,A;case V:return A=ml(A),H(N,A,C)}if(se(A)||$(A))return A=rl(A,N.mode,C,null),A.return=N,A;if(typeof A.then=="function")return H(N,os(A),C);if(A.$$typeof===K)return H(N,us(N,A),C);hs(N,A)}return null}function L(N,A,C,q){var le=A!==null?A.key:null;if(typeof C=="string"&&C!==""||typeof C=="number"||typeof C=="bigint")return le!==null?null:y(N,A,""+C,q);if(typeof C=="object"&&C!==null){switch(C.$$typeof){case E:return C.key===le?T(N,A,C,q):null;case x:return C.key===le?z(N,A,C,q):null;case V:return C=ml(C),L(N,A,C,q)}if(se(C)||$(C))return le!==null?null:B(N,A,C,q,null);if(typeof C.then=="function")return L(N,A,os(C),q);if(C.$$typeof===K)return L(N,A,us(N,C),q);hs(N,C)}return null}function j(N,A,C,q,le){if(typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint")return N=N.get(C)||null,y(A,N,""+q,le);if(typeof q=="object"&&q!==null){switch(q.$$typeof){case E:return N=N.get(q.key===null?C:q.key)||null,T(A,N,q,le);case x:return N=N.get(q.key===null?C:q.key)||null,z(A,N,q,le);case V:return q=ml(q),j(N,A,C,q,le)}if(se(q)||$(q))return N=N.get(C)||null,B(A,N,q,le,null);if(typeof q.then=="function")return j(N,A,C,os(q),le);if(q.$$typeof===K)return j(N,A,C,us(A,q),le);hs(A,q)}return null}function I(N,A,C,q){for(var le=null,Se=null,P=A,oe=A=0,ve=null;P!==null&&oe<C.length;oe++){P.index>oe?(ve=P,P=null):ve=P.sibling;var Te=L(N,P,C[oe],q);if(Te===null){P===null&&(P=ve);break}e&&P&&Te.alternate===null&&t(N,P),A=f(Te,A,oe),Se===null?le=Te:Se.sibling=Te,Se=Te,P=ve}if(oe===C.length)return n(N,P),be&&cn(N,oe),le;if(P===null){for(;oe<C.length;oe++)P=H(N,C[oe],q),P!==null&&(A=f(P,A,oe),Se===null?le=P:Se.sibling=P,Se=P);return be&&cn(N,oe),le}for(P=i(P);oe<C.length;oe++)ve=j(P,N,oe,C[oe],q),ve!==null&&(e&&ve.alternate!==null&&P.delete(ve.key===null?oe:ve.key),A=f(ve,A,oe),Se===null?le=ve:Se.sibling=ve,Se=ve);return e&&P.forEach(function(Wn){return t(N,Wn)}),be&&cn(N,oe),le}function ie(N,A,C,q){if(C==null)throw Error(s(151));for(var le=null,Se=null,P=A,oe=A=0,ve=null,Te=C.next();P!==null&&!Te.done;oe++,Te=C.next()){P.index>oe?(ve=P,P=null):ve=P.sibling;var Wn=L(N,P,Te.value,q);if(Wn===null){P===null&&(P=ve);break}e&&P&&Wn.alternate===null&&t(N,P),A=f(Wn,A,oe),Se===null?le=Wn:Se.sibling=Wn,Se=Wn,P=ve}if(Te.done)return n(N,P),be&&cn(N,oe),le;if(P===null){for(;!Te.done;oe++,Te=C.next())Te=H(N,Te.value,q),Te!==null&&(A=f(Te,A,oe),Se===null?le=Te:Se.sibling=Te,Se=Te);return be&&cn(N,oe),le}for(P=i(P);!Te.done;oe++,Te=C.next())Te=j(P,N,oe,Te.value,q),Te!==null&&(e&&Te.alternate!==null&&P.delete(Te.key===null?oe:Te.key),A=f(Te,A,oe),Se===null?le=Te:Se.sibling=Te,Se=Te);return e&&P.forEach(function(v1){return t(N,v1)}),be&&cn(N,oe),le}function ze(N,A,C,q){if(typeof C=="object"&&C!==null&&C.type===S&&C.key===null&&(C=C.props.children),typeof C=="object"&&C!==null){switch(C.$$typeof){case E:e:{for(var le=C.key;A!==null;){if(A.key===le){if(le=C.type,le===S){if(A.tag===7){n(N,A.sibling),q=r(A,C.props.children),q.return=N,N=q;break e}}else if(A.elementType===le||typeof le=="object"&&le!==null&&le.$$typeof===V&&ml(le)===A.type){n(N,A.sibling),q=r(A,C.props),Fi(q,C),q.return=N,N=q;break e}n(N,A);break}else t(N,A);A=A.sibling}C.type===S?(q=rl(C.props.children,N.mode,q,C.key),q.return=N,N=q):(q=is(C.type,C.key,C.props,null,N.mode,q),Fi(q,C),q.return=N,N=q)}return d(N);case x:e:{for(le=C.key;A!==null;){if(A.key===le)if(A.tag===4&&A.stateNode.containerInfo===C.containerInfo&&A.stateNode.implementation===C.implementation){n(N,A.sibling),q=r(A,C.children||[]),q.return=N,N=q;break e}else{n(N,A);break}else t(N,A);A=A.sibling}q=Tc(C,N.mode,q),q.return=N,N=q}return d(N);case V:return C=ml(C),ze(N,A,C,q)}if(se(C))return I(N,A,C,q);if($(C)){if(le=$(C),typeof le!="function")throw Error(s(150));return C=le.call(C),ie(N,A,C,q)}if(typeof C.then=="function")return ze(N,A,os(C),q);if(C.$$typeof===K)return ze(N,A,us(N,C),q);hs(N,C)}return typeof C=="string"&&C!==""||typeof C=="number"||typeof C=="bigint"?(C=""+C,A!==null&&A.tag===6?(n(N,A.sibling),q=r(A,C),q.return=N,N=q):(n(N,A),q=Sc(C,N.mode,q),q.return=N,N=q),d(N)):n(N,A)}return function(N,A,C,q){try{Ii=0;var le=ze(N,A,C,q);return Wl=null,le}catch(P){if(P===Jl||P===rs)throw P;var Se=_t(29,P,null,N.mode);return Se.lanes=q,Se.return=N,Se}finally{}}}var pl=fh(!0),oh=fh(!1),Ln=!1;function Lc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Uc(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Un(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Rn(e,t,n){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,(Ee&2)!==0){var r=i.pending;return r===null?t.next=t:(t.next=r.next,r.next=t),i.pending=t,t=ls(e),Zo(e,null,n),t}return ns(e,i,t,n),ls(e)}function Pi(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var i=t.lanes;i&=e.pendingLanes,n|=i,t.lanes=n,to(e,n)}}function Rc(e,t){var n=e.updateQueue,i=e.alternate;if(i!==null&&(i=i.updateQueue,n===i)){var r=null,f=null;if(n=n.firstBaseUpdate,n!==null){do{var d={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};f===null?r=f=d:f=f.next=d,n=n.next}while(n!==null);f===null?r=f=t:f=f.next=t}else r=f=t;n={baseState:i.baseState,firstBaseUpdate:r,lastBaseUpdate:f,shared:i.shared,callbacks:i.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var jc=!1;function ea(){if(jc){var e=Zl;if(e!==null)throw e}}function ta(e,t,n,i){jc=!1;var r=e.updateQueue;Ln=!1;var f=r.firstBaseUpdate,d=r.lastBaseUpdate,y=r.shared.pending;if(y!==null){r.shared.pending=null;var T=y,z=T.next;T.next=null,d===null?f=z:d.next=z,d=T;var B=e.alternate;B!==null&&(B=B.updateQueue,y=B.lastBaseUpdate,y!==d&&(y===null?B.firstBaseUpdate=z:y.next=z,B.lastBaseUpdate=T))}if(f!==null){var H=r.baseState;d=0,B=z=T=null,y=f;do{var L=y.lane&-536870913,j=L!==y.lane;if(j?(ye&L)===L:(i&L)===L){L!==0&&L===Xl&&(jc=!0),B!==null&&(B=B.next={lane:0,tag:y.tag,payload:y.payload,callback:null,next:null});e:{var I=e,ie=y;L=t;var ze=n;switch(ie.tag){case 1:if(I=ie.payload,typeof I=="function"){H=I.call(ze,H,L);break e}H=I;break e;case 3:I.flags=I.flags&-65537|128;case 0:if(I=ie.payload,L=typeof I=="function"?I.call(ze,H,L):I,L==null)break e;H=v({},H,L);break e;case 2:Ln=!0}}L=y.callback,L!==null&&(e.flags|=64,j&&(e.flags|=8192),j=r.callbacks,j===null?r.callbacks=[L]:j.push(L))}else j={lane:L,tag:y.tag,payload:y.payload,callback:y.callback,next:null},B===null?(z=B=j,T=H):B=B.next=j,d|=L;if(y=y.next,y===null){if(y=r.shared.pending,y===null)break;j=y,y=j.next,j.next=null,r.lastBaseUpdate=j,r.shared.pending=null}}while(!0);B===null&&(T=H),r.baseState=T,r.firstBaseUpdate=z,r.lastBaseUpdate=B,f===null&&(r.shared.lanes=0),Hn|=d,e.lanes=d,e.memoizedState=H}}function hh(e,t){if(typeof e!="function")throw Error(s(191,e));e.call(t)}function dh(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)hh(n[e],t)}var Il=_(null),ds=_(0);function mh(e,t){e=bn,J(ds,e),J(Il,t),bn=e|t.baseLanes}function Bc(){J(ds,bn),J(Il,Il.current)}function kc(){bn=ds.current,Y(Il),Y(ds)}var Nt=_(null),Yt=null;function jn(e){var t=e.alternate;J($e,$e.current&1),J(Nt,e),Yt===null&&(t===null||Il.current!==null||t.memoizedState!==null)&&(Yt=e)}function qc(e){J($e,$e.current),J(Nt,e),Yt===null&&(Yt=e)}function gh(e){e.tag===22?(J($e,$e.current),J(Nt,e),Yt===null&&(Yt=e)):Bn()}function Bn(){J($e,$e.current),J(Nt,Nt.current)}function Mt(e){Y(Nt),Yt===e&&(Yt=null),Y($e)}var $e=_(0);function ms(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||Vr(n)||Qr(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var on=0,fe=null,Me=null,Xe=null,gs=!1,Fl=!1,yl=!1,ps=0,na=0,Pl=null,c0=0;function qe(){throw Error(s(321))}function Hc(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Ot(e[n],t[n]))return!1;return!0}function Yc(e,t,n,i,r,f){return on=f,fe=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,D.H=e===null||e.memoizedState===null?Fh:nr,yl=!1,f=n(i,r),yl=!1,Fl&&(f=yh(t,n,i,r)),ph(e),f}function ph(e){D.H=aa;var t=Me!==null&&Me.next!==null;if(on=0,Xe=Me=fe=null,gs=!1,na=0,Pl=null,t)throw Error(s(300));e===null||Ze||(e=e.dependencies,e!==null&&ss(e)&&(Ze=!0))}function yh(e,t,n,i){fe=e;var r=0;do{if(Fl&&(Pl=null),na=0,Fl=!1,25<=r)throw Error(s(301));if(r+=1,Xe=Me=null,e.updateQueue!=null){var f=e.updateQueue;f.lastEffect=null,f.events=null,f.stores=null,f.memoCache!=null&&(f.memoCache.index=0)}D.H=Ph,f=t(n,i)}while(Fl);return f}function r0(){var e=D.H,t=e.useState()[0];return t=typeof t.then=="function"?la(t):t,e=e.useState()[0],(Me!==null?Me.memoizedState:null)!==e&&(fe.flags|=1024),t}function $c(){var e=ps!==0;return ps=0,e}function Kc(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Gc(e){if(gs){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}gs=!1}on=0,Xe=Me=fe=null,Fl=!1,na=ps=0,Pl=null}function ft(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Xe===null?fe.memoizedState=Xe=e:Xe=Xe.next=e,Xe}function Ke(){if(Me===null){var e=fe.alternate;e=e!==null?e.memoizedState:null}else e=Me.next;var t=Xe===null?fe.memoizedState:Xe.next;if(t!==null)Xe=t,Me=e;else{if(e===null)throw fe.alternate===null?Error(s(467)):Error(s(310));Me=e,e={memoizedState:Me.memoizedState,baseState:Me.baseState,baseQueue:Me.baseQueue,queue:Me.queue,next:null},Xe===null?fe.memoizedState=Xe=e:Xe=Xe.next=e}return Xe}function ys(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function la(e){var t=na;return na+=1,Pl===null&&(Pl=[]),e=uh(Pl,e,t),t=fe,(Xe===null?t.memoizedState:Xe.next)===null&&(t=t.alternate,D.H=t===null||t.memoizedState===null?Fh:nr),e}function vs(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return la(e);if(e.$$typeof===K)return lt(e)}throw Error(s(438,String(e)))}function Vc(e){var t=null,n=fe.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var i=fe.alternate;i!==null&&(i=i.updateQueue,i!==null&&(i=i.memoCache,i!=null&&(t={data:i.data.map(function(r){return r.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=ys(),fe.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),i=0;i<e;i++)n[i]=ae;return t.index++,n}function hn(e,t){return typeof t=="function"?t(e):t}function bs(e){var t=Ke();return Qc(t,Me,e)}function Qc(e,t,n){var i=e.queue;if(i===null)throw Error(s(311));i.lastRenderedReducer=n;var r=e.baseQueue,f=i.pending;if(f!==null){if(r!==null){var d=r.next;r.next=f.next,f.next=d}t.baseQueue=r=f,i.pending=null}if(f=e.baseState,r===null)e.memoizedState=f;else{t=r.next;var y=d=null,T=null,z=t,B=!1;do{var H=z.lane&-536870913;if(H!==z.lane?(ye&H)===H:(on&H)===H){var L=z.revertLane;if(L===0)T!==null&&(T=T.next={lane:0,revertLane:0,gesture:null,action:z.action,hasEagerState:z.hasEagerState,eagerState:z.eagerState,next:null}),H===Xl&&(B=!0);else if((on&L)===L){z=z.next,L===Xl&&(B=!0);continue}else H={lane:0,revertLane:z.revertLane,gesture:null,action:z.action,hasEagerState:z.hasEagerState,eagerState:z.eagerState,next:null},T===null?(y=T=H,d=f):T=T.next=H,fe.lanes|=L,Hn|=L;H=z.action,yl&&n(f,H),f=z.hasEagerState?z.eagerState:n(f,H)}else L={lane:H,revertLane:z.revertLane,gesture:z.gesture,action:z.action,hasEagerState:z.hasEagerState,eagerState:z.eagerState,next:null},T===null?(y=T=L,d=f):T=T.next=L,fe.lanes|=H,Hn|=H;z=z.next}while(z!==null&&z!==t);if(T===null?d=f:T.next=y,!Ot(f,e.memoizedState)&&(Ze=!0,B&&(n=Zl,n!==null)))throw n;e.memoizedState=f,e.baseState=d,e.baseQueue=T,i.lastRenderedState=f}return r===null&&(i.lanes=0),[e.memoizedState,i.dispatch]}function Xc(e){var t=Ke(),n=t.queue;if(n===null)throw Error(s(311));n.lastRenderedReducer=e;var i=n.dispatch,r=n.pending,f=t.memoizedState;if(r!==null){n.pending=null;var d=r=r.next;do f=e(f,d.action),d=d.next;while(d!==r);Ot(f,t.memoizedState)||(Ze=!0),t.memoizedState=f,t.baseQueue===null&&(t.baseState=f),n.lastRenderedState=f}return[f,i]}function vh(e,t,n){var i=fe,r=Ke(),f=be;if(f){if(n===void 0)throw Error(s(407));n=n()}else n=t();var d=!Ot((Me||r).memoizedState,n);if(d&&(r.memoizedState=n,Ze=!0),r=r.queue,Wc(Th.bind(null,i,r,e),[e]),r.getSnapshot!==t||d||Xe!==null&&Xe.memoizedState.tag&1){if(i.flags|=2048,ei(9,{destroy:void 0},Sh.bind(null,i,r,n,t),null),xe===null)throw Error(s(349));f||(on&127)!==0||bh(i,t,n)}return n}function bh(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=fe.updateQueue,t===null?(t=ys(),fe.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Sh(e,t,n,i){t.value=n,t.getSnapshot=i,Eh(t)&&wh(e)}function Th(e,t,n){return n(function(){Eh(t)&&wh(e)})}function Eh(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Ot(e,n)}catch{return!0}}function wh(e){var t=cl(e,2);t!==null&&vt(t,e,2)}function Zc(e){var t=ft();if(typeof e=="function"){var n=e;if(e=n(),yl){_n(!0);try{n()}finally{_n(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:hn,lastRenderedState:e},t}function Ah(e,t,n,i){return e.baseState=n,Qc(e,Me,typeof i=="function"?i:hn)}function f0(e,t,n,i,r){if(Es(e))throw Error(s(485));if(e=t.action,e!==null){var f={payload:r,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(d){f.listeners.push(d)}};D.T!==null?n(!0):f.isTransition=!1,i(f),n=t.pending,n===null?(f.next=t.pending=f,Oh(t,f)):(f.next=n.next,t.pending=n.next=f)}}function Oh(e,t){var n=t.action,i=t.payload,r=e.state;if(t.isTransition){var f=D.T,d={};D.T=d;try{var y=n(r,i),T=D.S;T!==null&&T(d,y),_h(e,t,y)}catch(z){Jc(e,t,z)}finally{f!==null&&d.types!==null&&(f.types=d.types),D.T=f}}else try{f=n(r,i),_h(e,t,f)}catch(z){Jc(e,t,z)}}function _h(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(i){Nh(e,t,i)},function(i){return Jc(e,t,i)}):Nh(e,t,n)}function Nh(e,t,n){t.status="fulfilled",t.value=n,Mh(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Oh(e,n)))}function Jc(e,t,n){var i=e.pending;if(e.pending=null,i!==null){i=i.next;do t.status="rejected",t.reason=n,Mh(t),t=t.next;while(t!==i)}e.action=null}function Mh(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Ch(e,t){return t}function zh(e,t){if(be){var n=xe.formState;if(n!==null){e:{var i=fe;if(be){if(Le){t:{for(var r=Le,f=Ht;r.nodeType!==8;){if(!f){r=null;break t}if(r=$t(r.nextSibling),r===null){r=null;break t}}f=r.data,r=f==="F!"||f==="F"?r:null}if(r){Le=$t(r.nextSibling),i=r.data==="F!";break e}}xn(i)}i=!1}i&&(t=n[0])}}return n=ft(),n.memoizedState=n.baseState=t,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ch,lastRenderedState:t},n.queue=i,n=Jh.bind(null,fe,i),i.dispatch=n,i=Zc(!1),f=tr.bind(null,fe,!1,i.queue),i=ft(),r={state:t,dispatch:null,action:e,pending:null},i.queue=r,n=f0.bind(null,fe,r,f,n),r.dispatch=n,i.memoizedState=e,[t,n,!1]}function xh(e){var t=Ke();return Dh(t,Me,e)}function Dh(e,t,n){if(t=Qc(e,t,Ch)[0],e=bs(hn)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var i=la(t)}catch(d){throw d===Jl?rs:d}else i=t;t=Ke();var r=t.queue,f=r.dispatch;return n!==t.memoizedState&&(fe.flags|=2048,ei(9,{destroy:void 0},o0.bind(null,r,n),null)),[i,f,e]}function o0(e,t){e.action=t}function Lh(e){var t=Ke(),n=Me;if(n!==null)return Dh(t,n,e);Ke(),t=t.memoizedState,n=Ke();var i=n.queue.dispatch;return n.memoizedState=e,[t,i,!1]}function ei(e,t,n,i){return e={tag:e,create:n,deps:i,inst:t,next:null},t=fe.updateQueue,t===null&&(t=ys(),fe.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(i=n.next,n.next=e,e.next=i,t.lastEffect=e),e}function Uh(){return Ke().memoizedState}function Ss(e,t,n,i){var r=ft();fe.flags|=e,r.memoizedState=ei(1|t,{destroy:void 0},n,i===void 0?null:i)}function Ts(e,t,n,i){var r=Ke();i=i===void 0?null:i;var f=r.memoizedState.inst;Me!==null&&i!==null&&Hc(i,Me.memoizedState.deps)?r.memoizedState=ei(t,f,n,i):(fe.flags|=e,r.memoizedState=ei(1|t,f,n,i))}function Rh(e,t){Ss(8390656,8,e,t)}function Wc(e,t){Ts(2048,8,e,t)}function h0(e){fe.flags|=4;var t=fe.updateQueue;if(t===null)t=ys(),fe.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function jh(e){var t=Ke().memoizedState;return h0({ref:t,nextImpl:e}),function(){if((Ee&2)!==0)throw Error(s(440));return t.impl.apply(void 0,arguments)}}function Bh(e,t){return Ts(4,2,e,t)}function kh(e,t){return Ts(4,4,e,t)}function qh(e,t){if(typeof t=="function"){e=e();var n=t(e);return function(){typeof n=="function"?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Hh(e,t,n){n=n!=null?n.concat([e]):null,Ts(4,4,qh.bind(null,t,e),n)}function Ic(){}function Yh(e,t){var n=Ke();t=t===void 0?null:t;var i=n.memoizedState;return t!==null&&Hc(t,i[1])?i[0]:(n.memoizedState=[e,t],e)}function $h(e,t){var n=Ke();t=t===void 0?null:t;var i=n.memoizedState;if(t!==null&&Hc(t,i[1]))return i[0];if(i=e(),yl){_n(!0);try{e()}finally{_n(!1)}}return n.memoizedState=[i,t],i}function Fc(e,t,n){return n===void 0||(on&1073741824)!==0&&(ye&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=Kd(),fe.lanes|=e,Hn|=e,n)}function Kh(e,t,n,i){return Ot(n,t)?n:Il.current!==null?(e=Fc(e,n,i),Ot(e,t)||(Ze=!0),e):(on&42)===0||(on&1073741824)!==0&&(ye&261930)===0?(Ze=!0,e.memoizedState=n):(e=Kd(),fe.lanes|=e,Hn|=e,t)}function Gh(e,t,n,i,r){var f=G.p;G.p=f!==0&&8>f?f:8;var d=D.T,y={};D.T=y,tr(e,!1,t,n);try{var T=r(),z=D.S;if(z!==null&&z(y,T),T!==null&&typeof T=="object"&&typeof T.then=="function"){var B=u0(T,i);ia(e,t,B,xt(e))}else ia(e,t,i,xt(e))}catch(H){ia(e,t,{then:function(){},status:"rejected",reason:H},xt())}finally{G.p=f,d!==null&&y.types!==null&&(d.types=y.types),D.T=d}}function d0(){}function Pc(e,t,n,i){if(e.tag!==5)throw Error(s(476));var r=Vh(e).queue;Gh(e,r,t,ne,n===null?d0:function(){return Qh(e),n(i)})}function Vh(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ne,baseState:ne,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:hn,lastRenderedState:ne},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:hn,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Qh(e){var t=Vh(e);t.next===null&&(t=e.alternate.memoizedState),ia(e,t.next.queue,{},xt())}function er(){return lt(Ta)}function Xh(){return Ke().memoizedState}function Zh(){return Ke().memoizedState}function m0(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=xt();e=Un(n);var i=Rn(t,e,n);i!==null&&(vt(i,t,n),Pi(i,t,n)),t={cache:Cc()},e.payload=t;return}t=t.return}}function g0(e,t,n){var i=xt();n={lane:i,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Es(e)?Wh(t,n):(n=vc(e,t,n,i),n!==null&&(vt(n,e,i),Ih(n,t,i)))}function Jh(e,t,n){var i=xt();ia(e,t,n,i)}function ia(e,t,n,i){var r={lane:i,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Es(e))Wh(t,r);else{var f=e.alternate;if(e.lanes===0&&(f===null||f.lanes===0)&&(f=t.lastRenderedReducer,f!==null))try{var d=t.lastRenderedState,y=f(d,n);if(r.hasEagerState=!0,r.eagerState=y,Ot(y,d))return ns(e,t,r,0),xe===null&&ts(),!1}catch{}finally{}if(n=vc(e,t,r,i),n!==null)return vt(n,e,i),Ih(n,t,i),!0}return!1}function tr(e,t,n,i){if(i={lane:2,revertLane:Lr(),gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},Es(e)){if(t)throw Error(s(479))}else t=vc(e,n,i,2),t!==null&&vt(t,e,2)}function Es(e){var t=e.alternate;return e===fe||t!==null&&t===fe}function Wh(e,t){Fl=gs=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ih(e,t,n){if((n&4194048)!==0){var i=t.lanes;i&=e.pendingLanes,n|=i,t.lanes=n,to(e,n)}}var aa={readContext:lt,use:vs,useCallback:qe,useContext:qe,useEffect:qe,useImperativeHandle:qe,useLayoutEffect:qe,useInsertionEffect:qe,useMemo:qe,useReducer:qe,useRef:qe,useState:qe,useDebugValue:qe,useDeferredValue:qe,useTransition:qe,useSyncExternalStore:qe,useId:qe,useHostTransitionStatus:qe,useFormState:qe,useActionState:qe,useOptimistic:qe,useMemoCache:qe,useCacheRefresh:qe};aa.useEffectEvent=qe;var Fh={readContext:lt,use:vs,useCallback:function(e,t){return ft().memoizedState=[e,t===void 0?null:t],e},useContext:lt,useEffect:Rh,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,Ss(4194308,4,qh.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ss(4194308,4,e,t)},useInsertionEffect:function(e,t){Ss(4,2,e,t)},useMemo:function(e,t){var n=ft();t=t===void 0?null:t;var i=e();if(yl){_n(!0);try{e()}finally{_n(!1)}}return n.memoizedState=[i,t],i},useReducer:function(e,t,n){var i=ft();if(n!==void 0){var r=n(t);if(yl){_n(!0);try{n(t)}finally{_n(!1)}}}else r=t;return i.memoizedState=i.baseState=r,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:r},i.queue=e,e=e.dispatch=g0.bind(null,fe,e),[i.memoizedState,e]},useRef:function(e){var t=ft();return e={current:e},t.memoizedState=e},useState:function(e){e=Zc(e);var t=e.queue,n=Jh.bind(null,fe,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Ic,useDeferredValue:function(e,t){var n=ft();return Fc(n,e,t)},useTransition:function(){var e=Zc(!1);return e=Gh.bind(null,fe,e.queue,!0,!1),ft().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var i=fe,r=ft();if(be){if(n===void 0)throw Error(s(407));n=n()}else{if(n=t(),xe===null)throw Error(s(349));(ye&127)!==0||bh(i,t,n)}r.memoizedState=n;var f={value:n,getSnapshot:t};return r.queue=f,Rh(Th.bind(null,i,f,e),[e]),i.flags|=2048,ei(9,{destroy:void 0},Sh.bind(null,i,f,n,t),null),n},useId:function(){var e=ft(),t=xe.identifierPrefix;if(be){var n=Ft,i=It;n=(i&~(1<<32-At(i)-1)).toString(32)+n,t="_"+t+"R_"+n,n=ps++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=c0++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:er,useFormState:zh,useActionState:zh,useOptimistic:function(e){var t=ft();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=tr.bind(null,fe,!0,n),n.dispatch=t,[e,t]},useMemoCache:Vc,useCacheRefresh:function(){return ft().memoizedState=m0.bind(null,fe)},useEffectEvent:function(e){var t=ft(),n={impl:e};return t.memoizedState=n,function(){if((Ee&2)!==0)throw Error(s(440));return n.impl.apply(void 0,arguments)}}},nr={readContext:lt,use:vs,useCallback:Yh,useContext:lt,useEffect:Wc,useImperativeHandle:Hh,useInsertionEffect:Bh,useLayoutEffect:kh,useMemo:$h,useReducer:bs,useRef:Uh,useState:function(){return bs(hn)},useDebugValue:Ic,useDeferredValue:function(e,t){var n=Ke();return Kh(n,Me.memoizedState,e,t)},useTransition:function(){var e=bs(hn)[0],t=Ke().memoizedState;return[typeof e=="boolean"?e:la(e),t]},useSyncExternalStore:vh,useId:Xh,useHostTransitionStatus:er,useFormState:xh,useActionState:xh,useOptimistic:function(e,t){var n=Ke();return Ah(n,Me,e,t)},useMemoCache:Vc,useCacheRefresh:Zh};nr.useEffectEvent=jh;var Ph={readContext:lt,use:vs,useCallback:Yh,useContext:lt,useEffect:Wc,useImperativeHandle:Hh,useInsertionEffect:Bh,useLayoutEffect:kh,useMemo:$h,useReducer:Xc,useRef:Uh,useState:function(){return Xc(hn)},useDebugValue:Ic,useDeferredValue:function(e,t){var n=Ke();return Me===null?Fc(n,e,t):Kh(n,Me.memoizedState,e,t)},useTransition:function(){var e=Xc(hn)[0],t=Ke().memoizedState;return[typeof e=="boolean"?e:la(e),t]},useSyncExternalStore:vh,useId:Xh,useHostTransitionStatus:er,useFormState:Lh,useActionState:Lh,useOptimistic:function(e,t){var n=Ke();return Me!==null?Ah(n,Me,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:Vc,useCacheRefresh:Zh};Ph.useEffectEvent=jh;function lr(e,t,n,i){t=e.memoizedState,n=n(i,t),n=n==null?t:v({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var ir={enqueueSetState:function(e,t,n){e=e._reactInternals;var i=xt(),r=Un(i);r.payload=t,n!=null&&(r.callback=n),t=Rn(e,r,i),t!==null&&(vt(t,e,i),Pi(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var i=xt(),r=Un(i);r.tag=1,r.payload=t,n!=null&&(r.callback=n),t=Rn(e,r,i),t!==null&&(vt(t,e,i),Pi(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=xt(),i=Un(n);i.tag=2,t!=null&&(i.callback=t),t=Rn(e,i,n),t!==null&&(vt(t,e,n),Pi(t,e,n))}};function ed(e,t,n,i,r,f,d){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(i,f,d):t.prototype&&t.prototype.isPureReactComponent?!Vi(n,i)||!Vi(r,f):!0}function td(e,t,n,i){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,i),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,i),t.state!==e&&ir.enqueueReplaceState(t,t.state,null)}function vl(e,t){var n=t;if("ref"in t){n={};for(var i in t)i!=="ref"&&(n[i]=t[i])}if(e=e.defaultProps){n===t&&(n=v({},n));for(var r in e)n[r]===void 0&&(n[r]=e[r])}return n}function nd(e){es(e)}function ld(e){console.error(e)}function id(e){es(e)}function ws(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(i){setTimeout(function(){throw i})}}function ad(e,t,n){try{var i=e.onCaughtError;i(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(r){setTimeout(function(){throw r})}}function ar(e,t,n){return n=Un(n),n.tag=3,n.payload={element:null},n.callback=function(){ws(e,t)},n}function sd(e){return e=Un(e),e.tag=3,e}function ud(e,t,n,i){var r=n.type.getDerivedStateFromError;if(typeof r=="function"){var f=i.value;e.payload=function(){return r(f)},e.callback=function(){ad(t,n,i)}}var d=n.stateNode;d!==null&&typeof d.componentDidCatch=="function"&&(e.callback=function(){ad(t,n,i),typeof r!="function"&&(Yn===null?Yn=new Set([this]):Yn.add(this));var y=i.stack;this.componentDidCatch(i.value,{componentStack:y!==null?y:""})})}function p0(e,t,n,i,r){if(n.flags|=32768,i!==null&&typeof i=="object"&&typeof i.then=="function"){if(t=n.alternate,t!==null&&Ql(t,n,r,!0),n=Nt.current,n!==null){switch(n.tag){case 31:case 13:return Yt===null?Rs():n.alternate===null&&He===0&&(He=3),n.flags&=-257,n.flags|=65536,n.lanes=r,i===fs?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([i]):t.add(i),zr(e,i,r)),!1;case 22:return n.flags|=65536,i===fs?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([i])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([i]):n.add(i)),zr(e,i,r)),!1}throw Error(s(435,n.tag))}return zr(e,i,r),Rs(),!1}if(be)return t=Nt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=r,i!==Ac&&(e=Error(s(422),{cause:i}),Zi(Bt(e,n)))):(i!==Ac&&(t=Error(s(423),{cause:i}),Zi(Bt(t,n))),e=e.current.alternate,e.flags|=65536,r&=-r,e.lanes|=r,i=Bt(i,n),r=ar(e.stateNode,i,r),Rc(e,r),He!==4&&(He=2)),!1;var f=Error(s(520),{cause:i});if(f=Bt(f,n),da===null?da=[f]:da.push(f),He!==4&&(He=2),t===null)return!0;i=Bt(i,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=r&-r,n.lanes|=e,e=ar(n.stateNode,i,e),Rc(n,e),!1;case 1:if(t=n.type,f=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||f!==null&&typeof f.componentDidCatch=="function"&&(Yn===null||!Yn.has(f))))return n.flags|=65536,r&=-r,n.lanes|=r,r=sd(r),ud(r,e,n,i),Rc(n,r),!1}n=n.return}while(n!==null);return!1}var sr=Error(s(461)),Ze=!1;function it(e,t,n,i){t.child=e===null?oh(t,null,n,i):pl(t,e.child,n,i)}function cd(e,t,n,i,r){n=n.render;var f=t.ref;if("ref"in i){var d={};for(var y in i)y!=="ref"&&(d[y]=i[y])}else d=i;return hl(t),i=Yc(e,t,n,d,f,r),y=$c(),e!==null&&!Ze?(Kc(e,t,r),dn(e,t,r)):(be&&y&&Ec(t),t.flags|=1,it(e,t,i,r),t.child)}function rd(e,t,n,i,r){if(e===null){var f=n.type;return typeof f=="function"&&!bc(f)&&f.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=f,fd(e,t,f,i,r)):(e=is(n.type,null,i,t,t.mode,r),e.ref=t.ref,e.return=t,t.child=e)}if(f=e.child,!mr(e,r)){var d=f.memoizedProps;if(n=n.compare,n=n!==null?n:Vi,n(d,i)&&e.ref===t.ref)return dn(e,t,r)}return t.flags|=1,e=un(f,i),e.ref=t.ref,e.return=t,t.child=e}function fd(e,t,n,i,r){if(e!==null){var f=e.memoizedProps;if(Vi(f,i)&&e.ref===t.ref)if(Ze=!1,t.pendingProps=i=f,mr(e,r))(e.flags&131072)!==0&&(Ze=!0);else return t.lanes=e.lanes,dn(e,t,r)}return ur(e,t,n,i,r)}function od(e,t,n,i){var r=i.children,f=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.mode==="hidden"){if((t.flags&128)!==0){if(f=f!==null?f.baseLanes|n:n,e!==null){for(i=t.child=e.child,r=0;i!==null;)r=r|i.lanes|i.childLanes,i=i.sibling;i=r&~f}else i=0,t.child=null;return hd(e,t,f,n,i)}if((n&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&cs(t,f!==null?f.cachePool:null),f!==null?mh(t,f):Bc(),gh(t);else return i=t.lanes=536870912,hd(e,t,f!==null?f.baseLanes|n:n,n,i)}else f!==null?(cs(t,f.cachePool),mh(t,f),Bn(),t.memoizedState=null):(e!==null&&cs(t,null),Bc(),Bn());return it(e,t,r,n),t.child}function sa(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function hd(e,t,n,i,r){var f=xc();return f=f===null?null:{parent:Qe._currentValue,pool:f},t.memoizedState={baseLanes:n,cachePool:f},e!==null&&cs(t,null),Bc(),gh(t),e!==null&&Ql(e,t,i,!0),t.childLanes=r,null}function As(e,t){return t=_s({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function dd(e,t,n){return pl(t,e.child,null,n),e=As(t,t.pendingProps),e.flags|=2,Mt(t),t.memoizedState=null,e}function y0(e,t,n){var i=t.pendingProps,r=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(be){if(i.mode==="hidden")return e=As(t,i),t.lanes=536870912,sa(null,e);if(qc(t),(e=Le)?(e=Om(e,Ht),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Cn!==null?{id:It,overflow:Ft}:null,retryLane:536870912,hydrationErrors:null},n=Wo(e),n.return=t,t.child=n,nt=t,Le=null)):e=null,e===null)throw xn(t);return t.lanes=536870912,null}return As(t,i)}var f=e.memoizedState;if(f!==null){var d=f.dehydrated;if(qc(t),r)if(t.flags&256)t.flags&=-257,t=dd(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(s(558));else if(Ze||Ql(e,t,n,!1),r=(n&e.childLanes)!==0,Ze||r){if(i=xe,i!==null&&(d=no(i,n),d!==0&&d!==f.retryLane))throw f.retryLane=d,cl(e,d),vt(i,e,d),sr;Rs(),t=dd(e,t,n)}else e=f.treeContext,Le=$t(d.nextSibling),nt=t,be=!0,zn=null,Ht=!1,e!==null&&Po(t,e),t=As(t,i),t.flags|=4096;return t}return e=un(e.child,{mode:i.mode,children:i.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Os(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(s(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function ur(e,t,n,i,r){return hl(t),n=Yc(e,t,n,i,void 0,r),i=$c(),e!==null&&!Ze?(Kc(e,t,r),dn(e,t,r)):(be&&i&&Ec(t),t.flags|=1,it(e,t,n,r),t.child)}function md(e,t,n,i,r,f){return hl(t),t.updateQueue=null,n=yh(t,i,n,r),ph(e),i=$c(),e!==null&&!Ze?(Kc(e,t,f),dn(e,t,f)):(be&&i&&Ec(t),t.flags|=1,it(e,t,n,f),t.child)}function gd(e,t,n,i,r){if(hl(t),t.stateNode===null){var f=$l,d=n.contextType;typeof d=="object"&&d!==null&&(f=lt(d)),f=new n(i,f),t.memoizedState=f.state!==null&&f.state!==void 0?f.state:null,f.updater=ir,t.stateNode=f,f._reactInternals=t,f=t.stateNode,f.props=i,f.state=t.memoizedState,f.refs={},Lc(t),d=n.contextType,f.context=typeof d=="object"&&d!==null?lt(d):$l,f.state=t.memoizedState,d=n.getDerivedStateFromProps,typeof d=="function"&&(lr(t,n,d,i),f.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof f.getSnapshotBeforeUpdate=="function"||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(d=f.state,typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount(),d!==f.state&&ir.enqueueReplaceState(f,f.state,null),ta(t,i,f,r),ea(),f.state=t.memoizedState),typeof f.componentDidMount=="function"&&(t.flags|=4194308),i=!0}else if(e===null){f=t.stateNode;var y=t.memoizedProps,T=vl(n,y);f.props=T;var z=f.context,B=n.contextType;d=$l,typeof B=="object"&&B!==null&&(d=lt(B));var H=n.getDerivedStateFromProps;B=typeof H=="function"||typeof f.getSnapshotBeforeUpdate=="function",y=t.pendingProps!==y,B||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(y||z!==d)&&td(t,f,i,d),Ln=!1;var L=t.memoizedState;f.state=L,ta(t,i,f,r),ea(),z=t.memoizedState,y||L!==z||Ln?(typeof H=="function"&&(lr(t,n,H,i),z=t.memoizedState),(T=Ln||ed(t,n,T,i,L,z,d))?(B||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount()),typeof f.componentDidMount=="function"&&(t.flags|=4194308)):(typeof f.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=i,t.memoizedState=z),f.props=i,f.state=z,f.context=d,i=T):(typeof f.componentDidMount=="function"&&(t.flags|=4194308),i=!1)}else{f=t.stateNode,Uc(e,t),d=t.memoizedProps,B=vl(n,d),f.props=B,H=t.pendingProps,L=f.context,z=n.contextType,T=$l,typeof z=="object"&&z!==null&&(T=lt(z)),y=n.getDerivedStateFromProps,(z=typeof y=="function"||typeof f.getSnapshotBeforeUpdate=="function")||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(d!==H||L!==T)&&td(t,f,i,T),Ln=!1,L=t.memoizedState,f.state=L,ta(t,i,f,r),ea();var j=t.memoizedState;d!==H||L!==j||Ln||e!==null&&e.dependencies!==null&&ss(e.dependencies)?(typeof y=="function"&&(lr(t,n,y,i),j=t.memoizedState),(B=Ln||ed(t,n,B,i,L,j,T)||e!==null&&e.dependencies!==null&&ss(e.dependencies))?(z||typeof f.UNSAFE_componentWillUpdate!="function"&&typeof f.componentWillUpdate!="function"||(typeof f.componentWillUpdate=="function"&&f.componentWillUpdate(i,j,T),typeof f.UNSAFE_componentWillUpdate=="function"&&f.UNSAFE_componentWillUpdate(i,j,T)),typeof f.componentDidUpdate=="function"&&(t.flags|=4),typeof f.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof f.componentDidUpdate!="function"||d===e.memoizedProps&&L===e.memoizedState||(t.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||d===e.memoizedProps&&L===e.memoizedState||(t.flags|=1024),t.memoizedProps=i,t.memoizedState=j),f.props=i,f.state=j,f.context=T,i=B):(typeof f.componentDidUpdate!="function"||d===e.memoizedProps&&L===e.memoizedState||(t.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||d===e.memoizedProps&&L===e.memoizedState||(t.flags|=1024),i=!1)}return f=i,Os(e,t),i=(t.flags&128)!==0,f||i?(f=t.stateNode,n=i&&typeof n.getDerivedStateFromError!="function"?null:f.render(),t.flags|=1,e!==null&&i?(t.child=pl(t,e.child,null,r),t.child=pl(t,null,n,r)):it(e,t,n,r),t.memoizedState=f.state,e=t.child):e=dn(e,t,r),e}function pd(e,t,n,i){return fl(),t.flags|=256,it(e,t,n,i),t.child}var cr={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function rr(e){return{baseLanes:e,cachePool:ah()}}function fr(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=zt),e}function yd(e,t,n){var i=t.pendingProps,r=!1,f=(t.flags&128)!==0,d;if((d=f)||(d=e!==null&&e.memoizedState===null?!1:($e.current&2)!==0),d&&(r=!0,t.flags&=-129),d=(t.flags&32)!==0,t.flags&=-33,e===null){if(be){if(r?jn(t):Bn(),(e=Le)?(e=Om(e,Ht),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Cn!==null?{id:It,overflow:Ft}:null,retryLane:536870912,hydrationErrors:null},n=Wo(e),n.return=t,t.child=n,nt=t,Le=null)):e=null,e===null)throw xn(t);return Qr(e)?t.lanes=32:t.lanes=536870912,null}var y=i.children;return i=i.fallback,r?(Bn(),r=t.mode,y=_s({mode:"hidden",children:y},r),i=rl(i,r,n,null),y.return=t,i.return=t,y.sibling=i,t.child=y,i=t.child,i.memoizedState=rr(n),i.childLanes=fr(e,d,n),t.memoizedState=cr,sa(null,i)):(jn(t),or(t,y))}var T=e.memoizedState;if(T!==null&&(y=T.dehydrated,y!==null)){if(f)t.flags&256?(jn(t),t.flags&=-257,t=hr(e,t,n)):t.memoizedState!==null?(Bn(),t.child=e.child,t.flags|=128,t=null):(Bn(),y=i.fallback,r=t.mode,i=_s({mode:"visible",children:i.children},r),y=rl(y,r,n,null),y.flags|=2,i.return=t,y.return=t,i.sibling=y,t.child=i,pl(t,e.child,null,n),i=t.child,i.memoizedState=rr(n),i.childLanes=fr(e,d,n),t.memoizedState=cr,t=sa(null,i));else if(jn(t),Qr(y)){if(d=y.nextSibling&&y.nextSibling.dataset,d)var z=d.dgst;d=z,i=Error(s(419)),i.stack="",i.digest=d,Zi({value:i,source:null,stack:null}),t=hr(e,t,n)}else if(Ze||Ql(e,t,n,!1),d=(n&e.childLanes)!==0,Ze||d){if(d=xe,d!==null&&(i=no(d,n),i!==0&&i!==T.retryLane))throw T.retryLane=i,cl(e,i),vt(d,e,i),sr;Vr(y)||Rs(),t=hr(e,t,n)}else Vr(y)?(t.flags|=192,t.child=e.child,t=null):(e=T.treeContext,Le=$t(y.nextSibling),nt=t,be=!0,zn=null,Ht=!1,e!==null&&Po(t,e),t=or(t,i.children),t.flags|=4096);return t}return r?(Bn(),y=i.fallback,r=t.mode,T=e.child,z=T.sibling,i=un(T,{mode:"hidden",children:i.children}),i.subtreeFlags=T.subtreeFlags&65011712,z!==null?y=un(z,y):(y=rl(y,r,n,null),y.flags|=2),y.return=t,i.return=t,i.sibling=y,t.child=i,sa(null,i),i=t.child,y=e.child.memoizedState,y===null?y=rr(n):(r=y.cachePool,r!==null?(T=Qe._currentValue,r=r.parent!==T?{parent:T,pool:T}:r):r=ah(),y={baseLanes:y.baseLanes|n,cachePool:r}),i.memoizedState=y,i.childLanes=fr(e,d,n),t.memoizedState=cr,sa(e.child,i)):(jn(t),n=e.child,e=n.sibling,n=un(n,{mode:"visible",children:i.children}),n.return=t,n.sibling=null,e!==null&&(d=t.deletions,d===null?(t.deletions=[e],t.flags|=16):d.push(e)),t.child=n,t.memoizedState=null,n)}function or(e,t){return t=_s({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function _s(e,t){return e=_t(22,e,null,t),e.lanes=0,e}function hr(e,t,n){return pl(t,e.child,null,n),e=or(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function vd(e,t,n){e.lanes|=t;var i=e.alternate;i!==null&&(i.lanes|=t),Nc(e.return,t,n)}function dr(e,t,n,i,r,f){var d=e.memoizedState;d===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:i,tail:n,tailMode:r,treeForkCount:f}:(d.isBackwards=t,d.rendering=null,d.renderingStartTime=0,d.last=i,d.tail=n,d.tailMode=r,d.treeForkCount=f)}function bd(e,t,n){var i=t.pendingProps,r=i.revealOrder,f=i.tail;i=i.children;var d=$e.current,y=(d&2)!==0;if(y?(d=d&1|2,t.flags|=128):d&=1,J($e,d),it(e,t,i,n),i=be?Xi:0,!y&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&vd(e,n,t);else if(e.tag===19)vd(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(r){case"forwards":for(n=t.child,r=null;n!==null;)e=n.alternate,e!==null&&ms(e)===null&&(r=n),n=n.sibling;n=r,n===null?(r=t.child,t.child=null):(r=n.sibling,n.sibling=null),dr(t,!1,r,n,f,i);break;case"backwards":case"unstable_legacy-backwards":for(n=null,r=t.child,t.child=null;r!==null;){if(e=r.alternate,e!==null&&ms(e)===null){t.child=r;break}e=r.sibling,r.sibling=n,n=r,r=e}dr(t,!0,n,null,f,i);break;case"together":dr(t,!1,null,null,void 0,i);break;default:t.memoizedState=null}return t.child}function dn(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Hn|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Ql(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(s(153));if(t.child!==null){for(e=t.child,n=un(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=un(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function mr(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&ss(e)))}function v0(e,t,n){switch(t.tag){case 3:rt(t,t.stateNode.containerInfo),Dn(t,Qe,e.memoizedState.cache),fl();break;case 27:case 5:Di(t);break;case 4:rt(t,t.stateNode.containerInfo);break;case 10:Dn(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,qc(t),null;break;case 13:var i=t.memoizedState;if(i!==null)return i.dehydrated!==null?(jn(t),t.flags|=128,null):(n&t.child.childLanes)!==0?yd(e,t,n):(jn(t),e=dn(e,t,n),e!==null?e.sibling:null);jn(t);break;case 19:var r=(e.flags&128)!==0;if(i=(n&t.childLanes)!==0,i||(Ql(e,t,n,!1),i=(n&t.childLanes)!==0),r){if(i)return bd(e,t,n);t.flags|=128}if(r=t.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),J($e,$e.current),i)break;return null;case 22:return t.lanes=0,od(e,t,n,t.pendingProps);case 24:Dn(t,Qe,e.memoizedState.cache)}return dn(e,t,n)}function Sd(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)Ze=!0;else{if(!mr(e,n)&&(t.flags&128)===0)return Ze=!1,v0(e,t,n);Ze=(e.flags&131072)!==0}else Ze=!1,be&&(t.flags&1048576)!==0&&Fo(t,Xi,t.index);switch(t.lanes=0,t.tag){case 16:e:{var i=t.pendingProps;if(e=ml(t.elementType),t.type=e,typeof e=="function")bc(e)?(i=vl(e,i),t.tag=1,t=gd(null,t,e,i,n)):(t.tag=0,t=ur(null,t,e,i,n));else{if(e!=null){var r=e.$$typeof;if(r===Q){t.tag=11,t=cd(null,t,e,i,n);break e}else if(r===k){t.tag=14,t=rd(null,t,e,i,n);break e}}throw t=we(e)||e,Error(s(306,t,""))}}return t;case 0:return ur(e,t,t.type,t.pendingProps,n);case 1:return i=t.type,r=vl(i,t.pendingProps),gd(e,t,i,r,n);case 3:e:{if(rt(t,t.stateNode.containerInfo),e===null)throw Error(s(387));i=t.pendingProps;var f=t.memoizedState;r=f.element,Uc(e,t),ta(t,i,null,n);var d=t.memoizedState;if(i=d.cache,Dn(t,Qe,i),i!==f.cache&&Mc(t,[Qe],n,!0),ea(),i=d.element,f.isDehydrated)if(f={element:i,isDehydrated:!1,cache:d.cache},t.updateQueue.baseState=f,t.memoizedState=f,t.flags&256){t=pd(e,t,i,n);break e}else if(i!==r){r=Bt(Error(s(424)),t),Zi(r),t=pd(e,t,i,n);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(Le=$t(e.firstChild),nt=t,be=!0,zn=null,Ht=!0,n=oh(t,null,i,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(fl(),i===r){t=dn(e,t,n);break e}it(e,t,i,n)}t=t.child}return t;case 26:return Os(e,t),e===null?(n=xm(t.type,null,t.pendingProps,null))?t.memoizedState=n:be||(n=t.type,e=t.pendingProps,i=$s(me.current).createElement(n),i[tt]=t,i[ht]=e,at(i,n,e),Pe(i),t.stateNode=i):t.memoizedState=xm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Di(t),e===null&&be&&(i=t.stateNode=Mm(t.type,t.pendingProps,me.current),nt=t,Ht=!0,r=Le,Vn(t.type)?(Xr=r,Le=$t(i.firstChild)):Le=r),it(e,t,t.pendingProps.children,n),Os(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&be&&((r=i=Le)&&(i=Z0(i,t.type,t.pendingProps,Ht),i!==null?(t.stateNode=i,nt=t,Le=$t(i.firstChild),Ht=!1,r=!0):r=!1),r||xn(t)),Di(t),r=t.type,f=t.pendingProps,d=e!==null?e.memoizedProps:null,i=f.children,$r(r,f)?i=null:d!==null&&$r(r,d)&&(t.flags|=32),t.memoizedState!==null&&(r=Yc(e,t,r0,null,null,n),Ta._currentValue=r),Os(e,t),it(e,t,i,n),t.child;case 6:return e===null&&be&&((e=n=Le)&&(n=J0(n,t.pendingProps,Ht),n!==null?(t.stateNode=n,nt=t,Le=null,e=!0):e=!1),e||xn(t)),null;case 13:return yd(e,t,n);case 4:return rt(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=pl(t,null,i,n):it(e,t,i,n),t.child;case 11:return cd(e,t,t.type,t.pendingProps,n);case 7:return it(e,t,t.pendingProps,n),t.child;case 8:return it(e,t,t.pendingProps.children,n),t.child;case 12:return it(e,t,t.pendingProps.children,n),t.child;case 10:return i=t.pendingProps,Dn(t,t.type,i.value),it(e,t,i.children,n),t.child;case 9:return r=t.type._context,i=t.pendingProps.children,hl(t),r=lt(r),i=i(r),t.flags|=1,it(e,t,i,n),t.child;case 14:return rd(e,t,t.type,t.pendingProps,n);case 15:return fd(e,t,t.type,t.pendingProps,n);case 19:return bd(e,t,n);case 31:return y0(e,t,n);case 22:return od(e,t,n,t.pendingProps);case 24:return hl(t),i=lt(Qe),e===null?(r=xc(),r===null&&(r=xe,f=Cc(),r.pooledCache=f,f.refCount++,f!==null&&(r.pooledCacheLanes|=n),r=f),t.memoizedState={parent:i,cache:r},Lc(t),Dn(t,Qe,r)):((e.lanes&n)!==0&&(Uc(e,t),ta(t,null,null,n),ea()),r=e.memoizedState,f=t.memoizedState,r.parent!==i?(r={parent:i,cache:i},t.memoizedState=r,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=r),Dn(t,Qe,i)):(i=f.cache,Dn(t,Qe,i),i!==r.cache&&Mc(t,[Qe],n,!0))),it(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(s(156,t.tag))}function mn(e){e.flags|=4}function gr(e,t,n,i,r){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(r&335544128)===r)if(e.stateNode.complete)e.flags|=8192;else if(Xd())e.flags|=8192;else throw gl=fs,Dc}else e.flags&=-16777217}function Td(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!jm(t))if(Xd())e.flags|=8192;else throw gl=fs,Dc}function Ns(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Pf():536870912,e.lanes|=t,ii|=t)}function ua(e,t){if(!be)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var i=null;n!==null;)n.alternate!==null&&(i=n),n=n.sibling;i===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:i.sibling=null}}function Ue(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,i=0;if(t)for(var r=e.child;r!==null;)n|=r.lanes|r.childLanes,i|=r.subtreeFlags&65011712,i|=r.flags&65011712,r.return=e,r=r.sibling;else for(r=e.child;r!==null;)n|=r.lanes|r.childLanes,i|=r.subtreeFlags,i|=r.flags,r.return=e,r=r.sibling;return e.subtreeFlags|=i,e.childLanes=n,t}function b0(e,t,n){var i=t.pendingProps;switch(wc(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ue(t),null;case 1:return Ue(t),null;case 3:return n=t.stateNode,i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),fn(Qe),Ye(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Vl(t)?mn(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Oc())),Ue(t),null;case 26:var r=t.type,f=t.memoizedState;return e===null?(mn(t),f!==null?(Ue(t),Td(t,f)):(Ue(t),gr(t,r,null,i,n))):f?f!==e.memoizedState?(mn(t),Ue(t),Td(t,f)):(Ue(t),t.flags&=-16777217):(e=e.memoizedProps,e!==i&&mn(t),Ue(t),gr(t,r,e,i,n)),null;case 27:if(ka(t),n=me.current,r=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==i&&mn(t);else{if(!i){if(t.stateNode===null)throw Error(s(166));return Ue(t),null}e=F.current,Vl(t)?eh(t):(e=Mm(r,i,n),t.stateNode=e,mn(t))}return Ue(t),null;case 5:if(ka(t),r=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==i&&mn(t);else{if(!i){if(t.stateNode===null)throw Error(s(166));return Ue(t),null}if(f=F.current,Vl(t))eh(t);else{var d=$s(me.current);switch(f){case 1:f=d.createElementNS("http://www.w3.org/2000/svg",r);break;case 2:f=d.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;default:switch(r){case"svg":f=d.createElementNS("http://www.w3.org/2000/svg",r);break;case"math":f=d.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;case"script":f=d.createElement("div"),f.innerHTML="<script><\/script>",f=f.removeChild(f.firstChild);break;case"select":f=typeof i.is=="string"?d.createElement("select",{is:i.is}):d.createElement("select"),i.multiple?f.multiple=!0:i.size&&(f.size=i.size);break;default:f=typeof i.is=="string"?d.createElement(r,{is:i.is}):d.createElement(r)}}f[tt]=t,f[ht]=i;e:for(d=t.child;d!==null;){if(d.tag===5||d.tag===6)f.appendChild(d.stateNode);else if(d.tag!==4&&d.tag!==27&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===t)break e;for(;d.sibling===null;){if(d.return===null||d.return===t)break e;d=d.return}d.sibling.return=d.return,d=d.sibling}t.stateNode=f;e:switch(at(f,r,i),r){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}i&&mn(t)}}return Ue(t),gr(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==i&&mn(t);else{if(typeof i!="string"&&t.stateNode===null)throw Error(s(166));if(e=me.current,Vl(t)){if(e=t.stateNode,n=t.memoizedProps,i=null,r=nt,r!==null)switch(r.tag){case 27:case 5:i=r.memoizedProps}e[tt]=t,e=!!(e.nodeValue===n||i!==null&&i.suppressHydrationWarning===!0||ym(e.nodeValue,n)),e||xn(t,!0)}else e=$s(e).createTextNode(i),e[tt]=t,t.stateNode=e}return Ue(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(i=Vl(t),n!==null){if(e===null){if(!i)throw Error(s(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(557));e[tt]=t}else fl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ue(t),e=!1}else n=Oc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Mt(t),t):(Mt(t),null);if((t.flags&128)!==0)throw Error(s(558))}return Ue(t),null;case 13:if(i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(r=Vl(t),i!==null&&i.dehydrated!==null){if(e===null){if(!r)throw Error(s(318));if(r=t.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(s(317));r[tt]=t}else fl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ue(t),r=!1}else r=Oc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=r),r=!0;if(!r)return t.flags&256?(Mt(t),t):(Mt(t),null)}return Mt(t),(t.flags&128)!==0?(t.lanes=n,t):(n=i!==null,e=e!==null&&e.memoizedState!==null,n&&(i=t.child,r=null,i.alternate!==null&&i.alternate.memoizedState!==null&&i.alternate.memoizedState.cachePool!==null&&(r=i.alternate.memoizedState.cachePool.pool),f=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(f=i.memoizedState.cachePool.pool),f!==r&&(i.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Ns(t,t.updateQueue),Ue(t),null);case 4:return Ye(),e===null&&Br(t.stateNode.containerInfo),Ue(t),null;case 10:return fn(t.type),Ue(t),null;case 19:if(Y($e),i=t.memoizedState,i===null)return Ue(t),null;if(r=(t.flags&128)!==0,f=i.rendering,f===null)if(r)ua(i,!1);else{if(He!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(f=ms(e),f!==null){for(t.flags|=128,ua(i,!1),e=f.updateQueue,t.updateQueue=e,Ns(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Jo(n,e),n=n.sibling;return J($e,$e.current&1|2),be&&cn(t,i.treeForkCount),t.child}e=e.sibling}i.tail!==null&&Et()>Ds&&(t.flags|=128,r=!0,ua(i,!1),t.lanes=4194304)}else{if(!r)if(e=ms(f),e!==null){if(t.flags|=128,r=!0,e=e.updateQueue,t.updateQueue=e,Ns(t,e),ua(i,!0),i.tail===null&&i.tailMode==="hidden"&&!f.alternate&&!be)return Ue(t),null}else 2*Et()-i.renderingStartTime>Ds&&n!==536870912&&(t.flags|=128,r=!0,ua(i,!1),t.lanes=4194304);i.isBackwards?(f.sibling=t.child,t.child=f):(e=i.last,e!==null?e.sibling=f:t.child=f,i.last=f)}return i.tail!==null?(e=i.tail,i.rendering=e,i.tail=e.sibling,i.renderingStartTime=Et(),e.sibling=null,n=$e.current,J($e,r?n&1|2:n&1),be&&cn(t,i.treeForkCount),e):(Ue(t),null);case 22:case 23:return Mt(t),kc(),i=t.memoizedState!==null,e!==null?e.memoizedState!==null!==i&&(t.flags|=8192):i&&(t.flags|=8192),i?(n&536870912)!==0&&(t.flags&128)===0&&(Ue(t),t.subtreeFlags&6&&(t.flags|=8192)):Ue(t),n=t.updateQueue,n!==null&&Ns(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),i=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(i=t.memoizedState.cachePool.pool),i!==n&&(t.flags|=2048),e!==null&&Y(dl),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),fn(Qe),Ue(t),null;case 25:return null;case 30:return null}throw Error(s(156,t.tag))}function S0(e,t){switch(wc(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return fn(Qe),Ye(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ka(t),null;case 31:if(t.memoizedState!==null){if(Mt(t),t.alternate===null)throw Error(s(340));fl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Mt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(s(340));fl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Y($e),null;case 4:return Ye(),null;case 10:return fn(t.type),null;case 22:case 23:return Mt(t),kc(),e!==null&&Y(dl),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return fn(Qe),null;case 25:return null;default:return null}}function Ed(e,t){switch(wc(t),t.tag){case 3:fn(Qe),Ye();break;case 26:case 27:case 5:ka(t);break;case 4:Ye();break;case 31:t.memoizedState!==null&&Mt(t);break;case 13:Mt(t);break;case 19:Y($e);break;case 10:fn(t.type);break;case 22:case 23:Mt(t),kc(),e!==null&&Y(dl);break;case 24:fn(Qe)}}function ca(e,t){try{var n=t.updateQueue,i=n!==null?n.lastEffect:null;if(i!==null){var r=i.next;n=r;do{if((n.tag&e)===e){i=void 0;var f=n.create,d=n.inst;i=f(),d.destroy=i}n=n.next}while(n!==r)}}catch(y){_e(t,t.return,y)}}function kn(e,t,n){try{var i=t.updateQueue,r=i!==null?i.lastEffect:null;if(r!==null){var f=r.next;i=f;do{if((i.tag&e)===e){var d=i.inst,y=d.destroy;if(y!==void 0){d.destroy=void 0,r=t;var T=n,z=y;try{z()}catch(B){_e(r,T,B)}}}i=i.next}while(i!==f)}}catch(B){_e(t,t.return,B)}}function wd(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{dh(t,n)}catch(i){_e(e,e.return,i)}}}function Ad(e,t,n){n.props=vl(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(i){_e(e,t,i)}}function ra(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var i=e.stateNode;break;case 30:i=e.stateNode;break;default:i=e.stateNode}typeof n=="function"?e.refCleanup=n(i):n.current=i}}catch(r){_e(e,t,r)}}function Pt(e,t){var n=e.ref,i=e.refCleanup;if(n!==null)if(typeof i=="function")try{i()}catch(r){_e(e,t,r)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(r){_e(e,t,r)}else n.current=null}function Od(e){var t=e.type,n=e.memoizedProps,i=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&i.focus();break e;case"img":n.src?i.src=n.src:n.srcSet&&(i.srcset=n.srcSet)}}catch(r){_e(e,e.return,r)}}function pr(e,t,n){try{var i=e.stateNode;$0(i,e.type,n,t),i[ht]=t}catch(r){_e(e,e.return,r)}}function _d(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Vn(e.type)||e.tag===4}function yr(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||_d(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Vn(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function vr(e,t,n){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=an));else if(i!==4&&(i===27&&Vn(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(vr(e,t,n),e=e.sibling;e!==null;)vr(e,t,n),e=e.sibling}function Ms(e,t,n){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(i!==4&&(i===27&&Vn(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Ms(e,t,n),e=e.sibling;e!==null;)Ms(e,t,n),e=e.sibling}function Nd(e){var t=e.stateNode,n=e.memoizedProps;try{for(var i=e.type,r=t.attributes;r.length;)t.removeAttributeNode(r[0]);at(t,i,n),t[tt]=e,t[ht]=n}catch(f){_e(e,e.return,f)}}var gn=!1,Je=!1,br=!1,Md=typeof WeakSet=="function"?WeakSet:Set,et=null;function T0(e,t){if(e=e.containerInfo,Hr=Js,e=Ho(e),hc(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var i=n.getSelection&&n.getSelection();if(i&&i.rangeCount!==0){n=i.anchorNode;var r=i.anchorOffset,f=i.focusNode;i=i.focusOffset;try{n.nodeType,f.nodeType}catch{n=null;break e}var d=0,y=-1,T=-1,z=0,B=0,H=e,L=null;t:for(;;){for(var j;H!==n||r!==0&&H.nodeType!==3||(y=d+r),H!==f||i!==0&&H.nodeType!==3||(T=d+i),H.nodeType===3&&(d+=H.nodeValue.length),(j=H.firstChild)!==null;)L=H,H=j;for(;;){if(H===e)break t;if(L===n&&++z===r&&(y=d),L===f&&++B===i&&(T=d),(j=H.nextSibling)!==null)break;H=L,L=H.parentNode}H=j}n=y===-1||T===-1?null:{start:y,end:T}}else n=null}n=n||{start:0,end:0}}else n=null;for(Yr={focusedElem:e,selectionRange:n},Js=!1,et=t;et!==null;)if(t=et,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,et=e;else for(;et!==null;){switch(t=et,f=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(n=0;n<e.length;n++)r=e[n],r.ref.impl=r.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&f!==null){e=void 0,n=t,r=f.memoizedProps,f=f.memoizedState,i=n.stateNode;try{var I=vl(n.type,r);e=i.getSnapshotBeforeUpdate(I,f),i.__reactInternalSnapshotBeforeUpdate=e}catch(ie){_e(n,n.return,ie)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)Gr(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Gr(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(s(163))}if(e=t.sibling,e!==null){e.return=t.return,et=e;break}et=t.return}}function Cd(e,t,n){var i=n.flags;switch(n.tag){case 0:case 11:case 15:yn(e,n),i&4&&ca(5,n);break;case 1:if(yn(e,n),i&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(d){_e(n,n.return,d)}else{var r=vl(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(r,t,e.__reactInternalSnapshotBeforeUpdate)}catch(d){_e(n,n.return,d)}}i&64&&wd(n),i&512&&ra(n,n.return);break;case 3:if(yn(e,n),i&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{dh(e,t)}catch(d){_e(n,n.return,d)}}break;case 27:t===null&&i&4&&Nd(n);case 26:case 5:yn(e,n),t===null&&i&4&&Od(n),i&512&&ra(n,n.return);break;case 12:yn(e,n);break;case 31:yn(e,n),i&4&&Dd(e,n);break;case 13:yn(e,n),i&4&&Ld(e,n),i&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=z0.bind(null,n),W0(e,n))));break;case 22:if(i=n.memoizedState!==null||gn,!i){t=t!==null&&t.memoizedState!==null||Je,r=gn;var f=Je;gn=i,(Je=t)&&!f?vn(e,n,(n.subtreeFlags&8772)!==0):yn(e,n),gn=r,Je=f}break;case 30:break;default:yn(e,n)}}function zd(e){var t=e.alternate;t!==null&&(e.alternate=null,zd(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Ju(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Re=null,mt=!1;function pn(e,t,n){for(n=n.child;n!==null;)xd(e,t,n),n=n.sibling}function xd(e,t,n){if(wt&&typeof wt.onCommitFiberUnmount=="function")try{wt.onCommitFiberUnmount(Li,n)}catch{}switch(n.tag){case 26:Je||Pt(n,t),pn(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Je||Pt(n,t);var i=Re,r=mt;Vn(n.type)&&(Re=n.stateNode,mt=!1),pn(e,t,n),va(n.stateNode),Re=i,mt=r;break;case 5:Je||Pt(n,t);case 6:if(i=Re,r=mt,Re=null,pn(e,t,n),Re=i,mt=r,Re!==null)if(mt)try{(Re.nodeType===9?Re.body:Re.nodeName==="HTML"?Re.ownerDocument.body:Re).removeChild(n.stateNode)}catch(f){_e(n,t,f)}else try{Re.removeChild(n.stateNode)}catch(f){_e(n,t,f)}break;case 18:Re!==null&&(mt?(e=Re,wm(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),hi(e)):wm(Re,n.stateNode));break;case 4:i=Re,r=mt,Re=n.stateNode.containerInfo,mt=!0,pn(e,t,n),Re=i,mt=r;break;case 0:case 11:case 14:case 15:kn(2,n,t),Je||kn(4,n,t),pn(e,t,n);break;case 1:Je||(Pt(n,t),i=n.stateNode,typeof i.componentWillUnmount=="function"&&Ad(n,t,i)),pn(e,t,n);break;case 21:pn(e,t,n);break;case 22:Je=(i=Je)||n.memoizedState!==null,pn(e,t,n),Je=i;break;default:pn(e,t,n)}}function Dd(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{hi(e)}catch(n){_e(t,t.return,n)}}}function Ld(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{hi(e)}catch(n){_e(t,t.return,n)}}function E0(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Md),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Md),t;default:throw Error(s(435,e.tag))}}function Cs(e,t){var n=E0(e);t.forEach(function(i){if(!n.has(i)){n.add(i);var r=x0.bind(null,e,i);i.then(r,r)}})}function gt(e,t){var n=t.deletions;if(n!==null)for(var i=0;i<n.length;i++){var r=n[i],f=e,d=t,y=d;e:for(;y!==null;){switch(y.tag){case 27:if(Vn(y.type)){Re=y.stateNode,mt=!1;break e}break;case 5:Re=y.stateNode,mt=!1;break e;case 3:case 4:Re=y.stateNode.containerInfo,mt=!0;break e}y=y.return}if(Re===null)throw Error(s(160));xd(f,d,r),Re=null,mt=!1,f=r.alternate,f!==null&&(f.return=null),r.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Ud(t,e),t=t.sibling}var Xt=null;function Ud(e,t){var n=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:gt(t,e),pt(e),i&4&&(kn(3,e,e.return),ca(3,e),kn(5,e,e.return));break;case 1:gt(t,e),pt(e),i&512&&(Je||n===null||Pt(n,n.return)),i&64&&gn&&(e=e.updateQueue,e!==null&&(i=e.callbacks,i!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?i:n.concat(i))));break;case 26:var r=Xt;if(gt(t,e),pt(e),i&512&&(Je||n===null||Pt(n,n.return)),i&4){var f=n!==null?n.memoizedState:null;if(i=e.memoizedState,n===null)if(i===null)if(e.stateNode===null){e:{i=e.type,n=e.memoizedProps,r=r.ownerDocument||r;t:switch(i){case"title":f=r.getElementsByTagName("title")[0],(!f||f[ji]||f[tt]||f.namespaceURI==="http://www.w3.org/2000/svg"||f.hasAttribute("itemprop"))&&(f=r.createElement(i),r.head.insertBefore(f,r.querySelector("head > title"))),at(f,i,n),f[tt]=e,Pe(f),i=f;break e;case"link":var d=Um("link","href",r).get(i+(n.href||""));if(d){for(var y=0;y<d.length;y++)if(f=d[y],f.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&f.getAttribute("rel")===(n.rel==null?null:n.rel)&&f.getAttribute("title")===(n.title==null?null:n.title)&&f.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){d.splice(y,1);break t}}f=r.createElement(i),at(f,i,n),r.head.appendChild(f);break;case"meta":if(d=Um("meta","content",r).get(i+(n.content||""))){for(y=0;y<d.length;y++)if(f=d[y],f.getAttribute("content")===(n.content==null?null:""+n.content)&&f.getAttribute("name")===(n.name==null?null:n.name)&&f.getAttribute("property")===(n.property==null?null:n.property)&&f.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&f.getAttribute("charset")===(n.charSet==null?null:n.charSet)){d.splice(y,1);break t}}f=r.createElement(i),at(f,i,n),r.head.appendChild(f);break;default:throw Error(s(468,i))}f[tt]=e,Pe(f),i=f}e.stateNode=i}else Rm(r,e.type,e.stateNode);else e.stateNode=Lm(r,i,e.memoizedProps);else f!==i?(f===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):f.count--,i===null?Rm(r,e.type,e.stateNode):Lm(r,i,e.memoizedProps)):i===null&&e.stateNode!==null&&pr(e,e.memoizedProps,n.memoizedProps)}break;case 27:gt(t,e),pt(e),i&512&&(Je||n===null||Pt(n,n.return)),n!==null&&i&4&&pr(e,e.memoizedProps,n.memoizedProps);break;case 5:if(gt(t,e),pt(e),i&512&&(Je||n===null||Pt(n,n.return)),e.flags&32){r=e.stateNode;try{Rl(r,"")}catch(I){_e(e,e.return,I)}}i&4&&e.stateNode!=null&&(r=e.memoizedProps,pr(e,r,n!==null?n.memoizedProps:r)),i&1024&&(br=!0);break;case 6:if(gt(t,e),pt(e),i&4){if(e.stateNode===null)throw Error(s(162));i=e.memoizedProps,n=e.stateNode;try{n.nodeValue=i}catch(I){_e(e,e.return,I)}}break;case 3:if(Vs=null,r=Xt,Xt=Ks(t.containerInfo),gt(t,e),Xt=r,pt(e),i&4&&n!==null&&n.memoizedState.isDehydrated)try{hi(t.containerInfo)}catch(I){_e(e,e.return,I)}br&&(br=!1,Rd(e));break;case 4:i=Xt,Xt=Ks(e.stateNode.containerInfo),gt(t,e),pt(e),Xt=i;break;case 12:gt(t,e),pt(e);break;case 31:gt(t,e),pt(e),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,Cs(e,i)));break;case 13:gt(t,e),pt(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(xs=Et()),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,Cs(e,i)));break;case 22:r=e.memoizedState!==null;var T=n!==null&&n.memoizedState!==null,z=gn,B=Je;if(gn=z||r,Je=B||T,gt(t,e),Je=B,gn=z,pt(e),i&8192)e:for(t=e.stateNode,t._visibility=r?t._visibility&-2:t._visibility|1,r&&(n===null||T||gn||Je||bl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){T=n=t;try{if(f=T.stateNode,r)d=f.style,typeof d.setProperty=="function"?d.setProperty("display","none","important"):d.display="none";else{y=T.stateNode;var H=T.memoizedProps.style,L=H!=null&&H.hasOwnProperty("display")?H.display:null;y.style.display=L==null||typeof L=="boolean"?"":(""+L).trim()}}catch(I){_e(T,T.return,I)}}}else if(t.tag===6){if(n===null){T=t;try{T.stateNode.nodeValue=r?"":T.memoizedProps}catch(I){_e(T,T.return,I)}}}else if(t.tag===18){if(n===null){T=t;try{var j=T.stateNode;r?Am(j,!0):Am(T.stateNode,!1)}catch(I){_e(T,T.return,I)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}i&4&&(i=e.updateQueue,i!==null&&(n=i.retryQueue,n!==null&&(i.retryQueue=null,Cs(e,n))));break;case 19:gt(t,e),pt(e),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,Cs(e,i)));break;case 30:break;case 21:break;default:gt(t,e),pt(e)}}function pt(e){var t=e.flags;if(t&2){try{for(var n,i=e.return;i!==null;){if(_d(i)){n=i;break}i=i.return}if(n==null)throw Error(s(160));switch(n.tag){case 27:var r=n.stateNode,f=yr(e);Ms(e,f,r);break;case 5:var d=n.stateNode;n.flags&32&&(Rl(d,""),n.flags&=-33);var y=yr(e);Ms(e,y,d);break;case 3:case 4:var T=n.stateNode.containerInfo,z=yr(e);vr(e,z,T);break;default:throw Error(s(161))}}catch(B){_e(e,e.return,B)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Rd(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Rd(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function yn(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Cd(e,t.alternate,t),t=t.sibling}function bl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:kn(4,t,t.return),bl(t);break;case 1:Pt(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&Ad(t,t.return,n),bl(t);break;case 27:va(t.stateNode);case 26:case 5:Pt(t,t.return),bl(t);break;case 22:t.memoizedState===null&&bl(t);break;case 30:bl(t);break;default:bl(t)}e=e.sibling}}function vn(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var i=t.alternate,r=e,f=t,d=f.flags;switch(f.tag){case 0:case 11:case 15:vn(r,f,n),ca(4,f);break;case 1:if(vn(r,f,n),i=f,r=i.stateNode,typeof r.componentDidMount=="function")try{r.componentDidMount()}catch(z){_e(i,i.return,z)}if(i=f,r=i.updateQueue,r!==null){var y=i.stateNode;try{var T=r.shared.hiddenCallbacks;if(T!==null)for(r.shared.hiddenCallbacks=null,r=0;r<T.length;r++)hh(T[r],y)}catch(z){_e(i,i.return,z)}}n&&d&64&&wd(f),ra(f,f.return);break;case 27:Nd(f);case 26:case 5:vn(r,f,n),n&&i===null&&d&4&&Od(f),ra(f,f.return);break;case 12:vn(r,f,n);break;case 31:vn(r,f,n),n&&d&4&&Dd(r,f);break;case 13:vn(r,f,n),n&&d&4&&Ld(r,f);break;case 22:f.memoizedState===null&&vn(r,f,n),ra(f,f.return);break;case 30:break;default:vn(r,f,n)}t=t.sibling}}function Sr(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&Ji(n))}function Tr(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ji(e))}function Zt(e,t,n,i){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)jd(e,t,n,i),t=t.sibling}function jd(e,t,n,i){var r=t.flags;switch(t.tag){case 0:case 11:case 15:Zt(e,t,n,i),r&2048&&ca(9,t);break;case 1:Zt(e,t,n,i);break;case 3:Zt(e,t,n,i),r&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ji(e)));break;case 12:if(r&2048){Zt(e,t,n,i),e=t.stateNode;try{var f=t.memoizedProps,d=f.id,y=f.onPostCommit;typeof y=="function"&&y(d,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(T){_e(t,t.return,T)}}else Zt(e,t,n,i);break;case 31:Zt(e,t,n,i);break;case 13:Zt(e,t,n,i);break;case 23:break;case 22:f=t.stateNode,d=t.alternate,t.memoizedState!==null?f._visibility&2?Zt(e,t,n,i):fa(e,t):f._visibility&2?Zt(e,t,n,i):(f._visibility|=2,ti(e,t,n,i,(t.subtreeFlags&10256)!==0||!1)),r&2048&&Sr(d,t);break;case 24:Zt(e,t,n,i),r&2048&&Tr(t.alternate,t);break;default:Zt(e,t,n,i)}}function ti(e,t,n,i,r){for(r=r&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var f=e,d=t,y=n,T=i,z=d.flags;switch(d.tag){case 0:case 11:case 15:ti(f,d,y,T,r),ca(8,d);break;case 23:break;case 22:var B=d.stateNode;d.memoizedState!==null?B._visibility&2?ti(f,d,y,T,r):fa(f,d):(B._visibility|=2,ti(f,d,y,T,r)),r&&z&2048&&Sr(d.alternate,d);break;case 24:ti(f,d,y,T,r),r&&z&2048&&Tr(d.alternate,d);break;default:ti(f,d,y,T,r)}t=t.sibling}}function fa(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,i=t,r=i.flags;switch(i.tag){case 22:fa(n,i),r&2048&&Sr(i.alternate,i);break;case 24:fa(n,i),r&2048&&Tr(i.alternate,i);break;default:fa(n,i)}t=t.sibling}}var oa=8192;function ni(e,t,n){if(e.subtreeFlags&oa)for(e=e.child;e!==null;)Bd(e,t,n),e=e.sibling}function Bd(e,t,n){switch(e.tag){case 26:ni(e,t,n),e.flags&oa&&e.memoizedState!==null&&c1(n,Xt,e.memoizedState,e.memoizedProps);break;case 5:ni(e,t,n);break;case 3:case 4:var i=Xt;Xt=Ks(e.stateNode.containerInfo),ni(e,t,n),Xt=i;break;case 22:e.memoizedState===null&&(i=e.alternate,i!==null&&i.memoizedState!==null?(i=oa,oa=16777216,ni(e,t,n),oa=i):ni(e,t,n));break;default:ni(e,t,n)}}function kd(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function ha(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var i=t[n];et=i,Hd(i,e)}kd(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)qd(e),e=e.sibling}function qd(e){switch(e.tag){case 0:case 11:case 15:ha(e),e.flags&2048&&kn(9,e,e.return);break;case 3:ha(e);break;case 12:ha(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,zs(e)):ha(e);break;default:ha(e)}}function zs(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var i=t[n];et=i,Hd(i,e)}kd(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:kn(8,t,t.return),zs(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,zs(t));break;default:zs(t)}e=e.sibling}}function Hd(e,t){for(;et!==null;){var n=et;switch(n.tag){case 0:case 11:case 15:kn(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var i=n.memoizedState.cachePool.pool;i!=null&&i.refCount++}break;case 24:Ji(n.memoizedState.cache)}if(i=n.child,i!==null)i.return=n,et=i;else e:for(n=e;et!==null;){i=et;var r=i.sibling,f=i.return;if(zd(i),i===n){et=null;break e}if(r!==null){r.return=f,et=r;break e}et=f}}}var w0={getCacheForType:function(e){var t=lt(Qe),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return lt(Qe).controller.signal}},A0=typeof WeakMap=="function"?WeakMap:Map,Ee=0,xe=null,ge=null,ye=0,Oe=0,Ct=null,qn=!1,li=!1,Er=!1,bn=0,He=0,Hn=0,Sl=0,wr=0,zt=0,ii=0,da=null,yt=null,Ar=!1,xs=0,Yd=0,Ds=1/0,Ls=null,Yn=null,Ie=0,$n=null,ai=null,Sn=0,Or=0,_r=null,$d=null,ma=0,Nr=null;function xt(){return(Ee&2)!==0&&ye!==0?ye&-ye:D.T!==null?Lr():lo()}function Kd(){if(zt===0)if((ye&536870912)===0||be){var e=Ya;Ya<<=1,(Ya&3932160)===0&&(Ya=262144),zt=e}else zt=536870912;return e=Nt.current,e!==null&&(e.flags|=32),zt}function vt(e,t,n){(e===xe&&(Oe===2||Oe===9)||e.cancelPendingCommit!==null)&&(si(e,0),Kn(e,ye,zt,!1)),Ri(e,n),((Ee&2)===0||e!==xe)&&(e===xe&&((Ee&2)===0&&(Sl|=n),He===4&&Kn(e,ye,zt,!1)),en(e))}function Gd(e,t,n){if((Ee&6)!==0)throw Error(s(327));var i=!n&&(t&127)===0&&(t&e.expiredLanes)===0||Ui(e,t),r=i?N0(e,t):Cr(e,t,!0),f=i;do{if(r===0){li&&!i&&Kn(e,t,0,!1);break}else{if(n=e.current.alternate,f&&!O0(n)){r=Cr(e,t,!1),f=!1;continue}if(r===2){if(f=t,e.errorRecoveryDisabledLanes&f)var d=0;else d=e.pendingLanes&-536870913,d=d!==0?d:d&536870912?536870912:0;if(d!==0){t=d;e:{var y=e;r=da;var T=y.current.memoizedState.isDehydrated;if(T&&(si(y,d).flags|=256),d=Cr(y,d,!1),d!==2){if(Er&&!T){y.errorRecoveryDisabledLanes|=f,Sl|=f,r=4;break e}f=yt,yt=r,f!==null&&(yt===null?yt=f:yt.push.apply(yt,f))}r=d}if(f=!1,r!==2)continue}}if(r===1){si(e,0),Kn(e,t,0,!0);break}e:{switch(i=e,f=r,f){case 0:case 1:throw Error(s(345));case 4:if((t&4194048)!==t)break;case 6:Kn(i,t,zt,!qn);break e;case 2:yt=null;break;case 3:case 5:break;default:throw Error(s(329))}if((t&62914560)===t&&(r=xs+300-Et(),10<r)){if(Kn(i,t,zt,!qn),Ka(i,0,!0)!==0)break e;Sn=t,i.timeoutHandle=Tm(Vd.bind(null,i,n,yt,Ls,Ar,t,zt,Sl,ii,qn,f,"Throttled",-0,0),r);break e}Vd(i,n,yt,Ls,Ar,t,zt,Sl,ii,qn,f,null,-0,0)}}break}while(!0);en(e)}function Vd(e,t,n,i,r,f,d,y,T,z,B,H,L,j){if(e.timeoutHandle=-1,H=t.subtreeFlags,H&8192||(H&16785408)===16785408){H={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:an},Bd(t,f,H);var I=(f&62914560)===f?xs-Et():(f&4194048)===f?Yd-Et():0;if(I=r1(H,I),I!==null){Sn=f,e.cancelPendingCommit=I(Pd.bind(null,e,t,f,n,i,r,d,y,T,B,H,null,L,j)),Kn(e,f,d,!z);return}}Pd(e,t,f,n,i,r,d,y,T)}function O0(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var i=0;i<n.length;i++){var r=n[i],f=r.getSnapshot;r=r.value;try{if(!Ot(f(),r))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Kn(e,t,n,i){t&=~wr,t&=~Sl,e.suspendedLanes|=t,e.pingedLanes&=~t,i&&(e.warmLanes|=t),i=e.expirationTimes;for(var r=t;0<r;){var f=31-At(r),d=1<<f;i[f]=-1,r&=~d}n!==0&&eo(e,n,t)}function Us(){return(Ee&6)===0?(ga(0),!1):!0}function Mr(){if(ge!==null){if(Oe===0)var e=ge.return;else e=ge,rn=ol=null,Gc(e),Wl=null,Ii=0,e=ge;for(;e!==null;)Ed(e.alternate,e),e=e.return;ge=null}}function si(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,V0(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Sn=0,Mr(),xe=e,ge=n=un(e.current,null),ye=t,Oe=0,Ct=null,qn=!1,li=Ui(e,t),Er=!1,ii=zt=wr=Sl=Hn=He=0,yt=da=null,Ar=!1,(t&8)!==0&&(t|=t&32);var i=e.entangledLanes;if(i!==0)for(e=e.entanglements,i&=t;0<i;){var r=31-At(i),f=1<<r;t|=e[r],i&=~f}return bn=t,ts(),n}function Qd(e,t){fe=null,D.H=aa,t===Jl||t===rs?(t=ch(),Oe=3):t===Dc?(t=ch(),Oe=4):Oe=t===sr?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Ct=t,ge===null&&(He=1,ws(e,Bt(t,e.current)))}function Xd(){var e=Nt.current;return e===null?!0:(ye&4194048)===ye?Yt===null:(ye&62914560)===ye||(ye&536870912)!==0?e===Yt:!1}function Zd(){var e=D.H;return D.H=aa,e===null?aa:e}function Jd(){var e=D.A;return D.A=w0,e}function Rs(){He=4,qn||(ye&4194048)!==ye&&Nt.current!==null||(li=!0),(Hn&134217727)===0&&(Sl&134217727)===0||xe===null||Kn(xe,ye,zt,!1)}function Cr(e,t,n){var i=Ee;Ee|=2;var r=Zd(),f=Jd();(xe!==e||ye!==t)&&(Ls=null,si(e,t)),t=!1;var d=He;e:do try{if(Oe!==0&&ge!==null){var y=ge,T=Ct;switch(Oe){case 8:Mr(),d=6;break e;case 3:case 2:case 9:case 6:Nt.current===null&&(t=!0);var z=Oe;if(Oe=0,Ct=null,ui(e,y,T,z),n&&li){d=0;break e}break;default:z=Oe,Oe=0,Ct=null,ui(e,y,T,z)}}_0(),d=He;break}catch(B){Qd(e,B)}while(!0);return t&&e.shellSuspendCounter++,rn=ol=null,Ee=i,D.H=r,D.A=f,ge===null&&(xe=null,ye=0,ts()),d}function _0(){for(;ge!==null;)Wd(ge)}function N0(e,t){var n=Ee;Ee|=2;var i=Zd(),r=Jd();xe!==e||ye!==t?(Ls=null,Ds=Et()+500,si(e,t)):li=Ui(e,t);e:do try{if(Oe!==0&&ge!==null){t=ge;var f=Ct;t:switch(Oe){case 1:Oe=0,Ct=null,ui(e,t,f,1);break;case 2:case 9:if(sh(f)){Oe=0,Ct=null,Id(t);break}t=function(){Oe!==2&&Oe!==9||xe!==e||(Oe=7),en(e)},f.then(t,t);break e;case 3:Oe=7;break e;case 4:Oe=5;break e;case 7:sh(f)?(Oe=0,Ct=null,Id(t)):(Oe=0,Ct=null,ui(e,t,f,7));break;case 5:var d=null;switch(ge.tag){case 26:d=ge.memoizedState;case 5:case 27:var y=ge;if(d?jm(d):y.stateNode.complete){Oe=0,Ct=null;var T=y.sibling;if(T!==null)ge=T;else{var z=y.return;z!==null?(ge=z,js(z)):ge=null}break t}}Oe=0,Ct=null,ui(e,t,f,5);break;case 6:Oe=0,Ct=null,ui(e,t,f,6);break;case 8:Mr(),He=6;break e;default:throw Error(s(462))}}M0();break}catch(B){Qd(e,B)}while(!0);return rn=ol=null,D.H=i,D.A=r,Ee=n,ge!==null?0:(xe=null,ye=0,ts(),He)}function M0(){for(;ge!==null&&!Ip();)Wd(ge)}function Wd(e){var t=Sd(e.alternate,e,bn);e.memoizedProps=e.pendingProps,t===null?js(e):ge=t}function Id(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=md(n,t,t.pendingProps,t.type,void 0,ye);break;case 11:t=md(n,t,t.pendingProps,t.type.render,t.ref,ye);break;case 5:Gc(t);default:Ed(n,t),t=ge=Jo(t,bn),t=Sd(n,t,bn)}e.memoizedProps=e.pendingProps,t===null?js(e):ge=t}function ui(e,t,n,i){rn=ol=null,Gc(t),Wl=null,Ii=0;var r=t.return;try{if(p0(e,r,t,n,ye)){He=1,ws(e,Bt(n,e.current)),ge=null;return}}catch(f){if(r!==null)throw ge=r,f;He=1,ws(e,Bt(n,e.current)),ge=null;return}t.flags&32768?(be||i===1?e=!0:li||(ye&536870912)!==0?e=!1:(qn=e=!0,(i===2||i===9||i===3||i===6)&&(i=Nt.current,i!==null&&i.tag===13&&(i.flags|=16384))),Fd(t,e)):js(t)}function js(e){var t=e;do{if((t.flags&32768)!==0){Fd(t,qn);return}e=t.return;var n=b0(t.alternate,t,bn);if(n!==null){ge=n;return}if(t=t.sibling,t!==null){ge=t;return}ge=t=e}while(t!==null);He===0&&(He=5)}function Fd(e,t){do{var n=S0(e.alternate,e);if(n!==null){n.flags&=32767,ge=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){ge=e;return}ge=e=n}while(e!==null);He=6,ge=null}function Pd(e,t,n,i,r,f,d,y,T){e.cancelPendingCommit=null;do Bs();while(Ie!==0);if((Ee&6)!==0)throw Error(s(327));if(t!==null){if(t===e.current)throw Error(s(177));if(f=t.lanes|t.childLanes,f|=yc,uy(e,n,f,d,y,T),e===xe&&(ge=xe=null,ye=0),ai=t,$n=e,Sn=n,Or=f,_r=r,$d=i,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,D0(qa,function(){return im(),null})):(e.callbackNode=null,e.callbackPriority=0),i=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||i){i=D.T,D.T=null,r=G.p,G.p=2,d=Ee,Ee|=4;try{T0(e,t,n)}finally{Ee=d,G.p=r,D.T=i}}Ie=1,em(),tm(),nm()}}function em(){if(Ie===1){Ie=0;var e=$n,t=ai,n=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||n){n=D.T,D.T=null;var i=G.p;G.p=2;var r=Ee;Ee|=4;try{Ud(t,e);var f=Yr,d=Ho(e.containerInfo),y=f.focusedElem,T=f.selectionRange;if(d!==y&&y&&y.ownerDocument&&qo(y.ownerDocument.documentElement,y)){if(T!==null&&hc(y)){var z=T.start,B=T.end;if(B===void 0&&(B=z),"selectionStart"in y)y.selectionStart=z,y.selectionEnd=Math.min(B,y.value.length);else{var H=y.ownerDocument||document,L=H&&H.defaultView||window;if(L.getSelection){var j=L.getSelection(),I=y.textContent.length,ie=Math.min(T.start,I),ze=T.end===void 0?ie:Math.min(T.end,I);!j.extend&&ie>ze&&(d=ze,ze=ie,ie=d);var N=ko(y,ie),A=ko(y,ze);if(N&&A&&(j.rangeCount!==1||j.anchorNode!==N.node||j.anchorOffset!==N.offset||j.focusNode!==A.node||j.focusOffset!==A.offset)){var C=H.createRange();C.setStart(N.node,N.offset),j.removeAllRanges(),ie>ze?(j.addRange(C),j.extend(A.node,A.offset)):(C.setEnd(A.node,A.offset),j.addRange(C))}}}}for(H=[],j=y;j=j.parentNode;)j.nodeType===1&&H.push({element:j,left:j.scrollLeft,top:j.scrollTop});for(typeof y.focus=="function"&&y.focus(),y=0;y<H.length;y++){var q=H[y];q.element.scrollLeft=q.left,q.element.scrollTop=q.top}}Js=!!Hr,Yr=Hr=null}finally{Ee=r,G.p=i,D.T=n}}e.current=t,Ie=2}}function tm(){if(Ie===2){Ie=0;var e=$n,t=ai,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=D.T,D.T=null;var i=G.p;G.p=2;var r=Ee;Ee|=4;try{Cd(e,t.alternate,t)}finally{Ee=r,G.p=i,D.T=n}}Ie=3}}function nm(){if(Ie===4||Ie===3){Ie=0,Fp();var e=$n,t=ai,n=Sn,i=$d;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Ie=5:(Ie=0,ai=$n=null,lm(e,e.pendingLanes));var r=e.pendingLanes;if(r===0&&(Yn=null),Xu(n),t=t.stateNode,wt&&typeof wt.onCommitFiberRoot=="function")try{wt.onCommitFiberRoot(Li,t,void 0,(t.current.flags&128)===128)}catch{}if(i!==null){t=D.T,r=G.p,G.p=2,D.T=null;try{for(var f=e.onRecoverableError,d=0;d<i.length;d++){var y=i[d];f(y.value,{componentStack:y.stack})}}finally{D.T=t,G.p=r}}(Sn&3)!==0&&Bs(),en(e),r=e.pendingLanes,(n&261930)!==0&&(r&42)!==0?e===Nr?ma++:(ma=0,Nr=e):ma=0,ga(0)}}function lm(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Ji(t)))}function Bs(){return em(),tm(),nm(),im()}function im(){if(Ie!==5)return!1;var e=$n,t=Or;Or=0;var n=Xu(Sn),i=D.T,r=G.p;try{G.p=32>n?32:n,D.T=null,n=_r,_r=null;var f=$n,d=Sn;if(Ie=0,ai=$n=null,Sn=0,(Ee&6)!==0)throw Error(s(331));var y=Ee;if(Ee|=4,qd(f.current),jd(f,f.current,d,n),Ee=y,ga(0,!1),wt&&typeof wt.onPostCommitFiberRoot=="function")try{wt.onPostCommitFiberRoot(Li,f)}catch{}return!0}finally{G.p=r,D.T=i,lm(e,t)}}function am(e,t,n){t=Bt(n,t),t=ar(e.stateNode,t,2),e=Rn(e,t,2),e!==null&&(Ri(e,2),en(e))}function _e(e,t,n){if(e.tag===3)am(e,e,n);else for(;t!==null;){if(t.tag===3){am(t,e,n);break}else if(t.tag===1){var i=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(Yn===null||!Yn.has(i))){e=Bt(n,e),n=sd(2),i=Rn(t,n,2),i!==null&&(ud(n,i,t,e),Ri(i,2),en(i));break}}t=t.return}}function zr(e,t,n){var i=e.pingCache;if(i===null){i=e.pingCache=new A0;var r=new Set;i.set(t,r)}else r=i.get(t),r===void 0&&(r=new Set,i.set(t,r));r.has(n)||(Er=!0,r.add(n),e=C0.bind(null,e,t,n),t.then(e,e))}function C0(e,t,n){var i=e.pingCache;i!==null&&i.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,xe===e&&(ye&n)===n&&(He===4||He===3&&(ye&62914560)===ye&&300>Et()-xs?(Ee&2)===0&&si(e,0):wr|=n,ii===ye&&(ii=0)),en(e)}function sm(e,t){t===0&&(t=Pf()),e=cl(e,t),e!==null&&(Ri(e,t),en(e))}function z0(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),sm(e,n)}function x0(e,t){var n=0;switch(e.tag){case 31:case 13:var i=e.stateNode,r=e.memoizedState;r!==null&&(n=r.retryLane);break;case 19:i=e.stateNode;break;case 22:i=e.stateNode._retryCache;break;default:throw Error(s(314))}i!==null&&i.delete(t),sm(e,n)}function D0(e,t){return Ku(e,t)}var ks=null,ci=null,xr=!1,qs=!1,Dr=!1,Gn=0;function en(e){e!==ci&&e.next===null&&(ci===null?ks=ci=e:ci=ci.next=e),qs=!0,xr||(xr=!0,U0())}function ga(e,t){if(!Dr&&qs){Dr=!0;do for(var n=!1,i=ks;i!==null;){if(e!==0){var r=i.pendingLanes;if(r===0)var f=0;else{var d=i.suspendedLanes,y=i.pingedLanes;f=(1<<31-At(42|e)+1)-1,f&=r&~(d&~y),f=f&201326741?f&201326741|1:f?f|2:0}f!==0&&(n=!0,fm(i,f))}else f=ye,f=Ka(i,i===xe?f:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),(f&3)===0||Ui(i,f)||(n=!0,fm(i,f));i=i.next}while(n);Dr=!1}}function L0(){um()}function um(){qs=xr=!1;var e=0;Gn!==0&&G0()&&(e=Gn);for(var t=Et(),n=null,i=ks;i!==null;){var r=i.next,f=cm(i,t);f===0?(i.next=null,n===null?ks=r:n.next=r,r===null&&(ci=n)):(n=i,(e!==0||(f&3)!==0)&&(qs=!0)),i=r}Ie!==0&&Ie!==5||ga(e),Gn!==0&&(Gn=0)}function cm(e,t){for(var n=e.suspendedLanes,i=e.pingedLanes,r=e.expirationTimes,f=e.pendingLanes&-62914561;0<f;){var d=31-At(f),y=1<<d,T=r[d];T===-1?((y&n)===0||(y&i)!==0)&&(r[d]=sy(y,t)):T<=t&&(e.expiredLanes|=y),f&=~y}if(t=xe,n=ye,n=Ka(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i=e.callbackNode,n===0||e===t&&(Oe===2||Oe===9)||e.cancelPendingCommit!==null)return i!==null&&i!==null&&Gu(i),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||Ui(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(i!==null&&Gu(i),Xu(n)){case 2:case 8:n=If;break;case 32:n=qa;break;case 268435456:n=Ff;break;default:n=qa}return i=rm.bind(null,e),n=Ku(n,i),e.callbackPriority=t,e.callbackNode=n,t}return i!==null&&i!==null&&Gu(i),e.callbackPriority=2,e.callbackNode=null,2}function rm(e,t){if(Ie!==0&&Ie!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Bs()&&e.callbackNode!==n)return null;var i=ye;return i=Ka(e,e===xe?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i===0?null:(Gd(e,i,t),cm(e,Et()),e.callbackNode!=null&&e.callbackNode===n?rm.bind(null,e):null)}function fm(e,t){if(Bs())return null;Gd(e,t,!0)}function U0(){Q0(function(){(Ee&6)!==0?Ku(Wf,L0):um()})}function Lr(){if(Gn===0){var e=Xl;e===0&&(e=Ha,Ha<<=1,(Ha&261888)===0&&(Ha=256)),Gn=e}return Gn}function om(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Xa(""+e)}function hm(e,t){var n=t.ownerDocument.createElement("input");return n.name=t.name,n.value=t.value,e.id&&n.setAttribute("form",e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function R0(e,t,n,i,r){if(t==="submit"&&n&&n.stateNode===r){var f=om((r[ht]||null).action),d=i.submitter;d&&(t=(t=d[ht]||null)?om(t.formAction):d.getAttribute("formAction"),t!==null&&(f=t,d=null));var y=new Ia("action","action",null,i,r);e.push({event:y,listeners:[{instance:null,listener:function(){if(i.defaultPrevented){if(Gn!==0){var T=d?hm(r,d):new FormData(r);Pc(n,{pending:!0,data:T,method:r.method,action:f},null,T)}}else typeof f=="function"&&(y.preventDefault(),T=d?hm(r,d):new FormData(r),Pc(n,{pending:!0,data:T,method:r.method,action:f},f,T))},currentTarget:r}]})}}for(var Ur=0;Ur<pc.length;Ur++){var Rr=pc[Ur],j0=Rr.toLowerCase(),B0=Rr[0].toUpperCase()+Rr.slice(1);Qt(j0,"on"+B0)}Qt(Ko,"onAnimationEnd"),Qt(Go,"onAnimationIteration"),Qt(Vo,"onAnimationStart"),Qt("dblclick","onDoubleClick"),Qt("focusin","onFocus"),Qt("focusout","onBlur"),Qt(Py,"onTransitionRun"),Qt(e0,"onTransitionStart"),Qt(t0,"onTransitionCancel"),Qt(Qo,"onTransitionEnd"),Ll("onMouseEnter",["mouseout","mouseover"]),Ll("onMouseLeave",["mouseout","mouseover"]),Ll("onPointerEnter",["pointerout","pointerover"]),Ll("onPointerLeave",["pointerout","pointerover"]),il("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),il("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),il("onBeforeInput",["compositionend","keypress","textInput","paste"]),il("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),il("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),il("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var pa="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),k0=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(pa));function dm(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var i=e[n],r=i.event;i=i.listeners;e:{var f=void 0;if(t)for(var d=i.length-1;0<=d;d--){var y=i[d],T=y.instance,z=y.currentTarget;if(y=y.listener,T!==f&&r.isPropagationStopped())break e;f=y,r.currentTarget=z;try{f(r)}catch(B){es(B)}r.currentTarget=null,f=T}else for(d=0;d<i.length;d++){if(y=i[d],T=y.instance,z=y.currentTarget,y=y.listener,T!==f&&r.isPropagationStopped())break e;f=y,r.currentTarget=z;try{f(r)}catch(B){es(B)}r.currentTarget=null,f=T}}}}function pe(e,t){var n=t[Zu];n===void 0&&(n=t[Zu]=new Set);var i=e+"__bubble";n.has(i)||(mm(t,e,2,!1),n.add(i))}function jr(e,t,n){var i=0;t&&(i|=4),mm(n,e,i,t)}var Hs="_reactListening"+Math.random().toString(36).slice(2);function Br(e){if(!e[Hs]){e[Hs]=!0,so.forEach(function(n){n!=="selectionchange"&&(k0.has(n)||jr(n,!1,e),jr(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Hs]||(t[Hs]=!0,jr("selectionchange",!1,t))}}function mm(e,t,n,i){switch(Km(t)){case 2:var r=h1;break;case 8:r=d1;break;default:r=Fr}n=r.bind(null,t,n,e),r=void 0,!lc||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(r=!0),i?r!==void 0?e.addEventListener(t,n,{capture:!0,passive:r}):e.addEventListener(t,n,!0):r!==void 0?e.addEventListener(t,n,{passive:r}):e.addEventListener(t,n,!1)}function kr(e,t,n,i,r){var f=i;if((t&1)===0&&(t&2)===0&&i!==null)e:for(;;){if(i===null)return;var d=i.tag;if(d===3||d===4){var y=i.stateNode.containerInfo;if(y===r)break;if(d===4)for(d=i.return;d!==null;){var T=d.tag;if((T===3||T===4)&&d.stateNode.containerInfo===r)return;d=d.return}for(;y!==null;){if(d=zl(y),d===null)return;if(T=d.tag,T===5||T===6||T===26||T===27){i=f=d;continue e}y=y.parentNode}}i=i.return}bo(function(){var z=f,B=tc(n),H=[];e:{var L=Xo.get(e);if(L!==void 0){var j=Ia,I=e;switch(e){case"keypress":if(Ja(n)===0)break e;case"keydown":case"keyup":j=xy;break;case"focusin":I="focus",j=uc;break;case"focusout":I="blur",j=uc;break;case"beforeblur":case"afterblur":j=uc;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":j=Eo;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":j=by;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":j=Uy;break;case Ko:case Go:case Vo:j=Ey;break;case Qo:j=jy;break;case"scroll":case"scrollend":j=yy;break;case"wheel":j=ky;break;case"copy":case"cut":case"paste":j=Ay;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":j=Ao;break;case"toggle":case"beforetoggle":j=Hy}var ie=(t&4)!==0,ze=!ie&&(e==="scroll"||e==="scrollend"),N=ie?L!==null?L+"Capture":null:L;ie=[];for(var A=z,C;A!==null;){var q=A;if(C=q.stateNode,q=q.tag,q!==5&&q!==26&&q!==27||C===null||N===null||(q=ki(A,N),q!=null&&ie.push(ya(A,q,C))),ze)break;A=A.return}0<ie.length&&(L=new j(L,I,null,n,B),H.push({event:L,listeners:ie}))}}if((t&7)===0){e:{if(L=e==="mouseover"||e==="pointerover",j=e==="mouseout"||e==="pointerout",L&&n!==ec&&(I=n.relatedTarget||n.fromElement)&&(zl(I)||I[Cl]))break e;if((j||L)&&(L=B.window===B?B:(L=B.ownerDocument)?L.defaultView||L.parentWindow:window,j?(I=n.relatedTarget||n.toElement,j=z,I=I?zl(I):null,I!==null&&(ze=o(I),ie=I.tag,I!==ze||ie!==5&&ie!==27&&ie!==6)&&(I=null)):(j=null,I=z),j!==I)){if(ie=Eo,q="onMouseLeave",N="onMouseEnter",A="mouse",(e==="pointerout"||e==="pointerover")&&(ie=Ao,q="onPointerLeave",N="onPointerEnter",A="pointer"),ze=j==null?L:Bi(j),C=I==null?L:Bi(I),L=new ie(q,A+"leave",j,n,B),L.target=ze,L.relatedTarget=C,q=null,zl(B)===z&&(ie=new ie(N,A+"enter",I,n,B),ie.target=C,ie.relatedTarget=ze,q=ie),ze=q,j&&I)t:{for(ie=q0,N=j,A=I,C=0,q=N;q;q=ie(q))C++;q=0;for(var le=A;le;le=ie(le))q++;for(;0<C-q;)N=ie(N),C--;for(;0<q-C;)A=ie(A),q--;for(;C--;){if(N===A||A!==null&&N===A.alternate){ie=N;break t}N=ie(N),A=ie(A)}ie=null}else ie=null;j!==null&&gm(H,L,j,ie,!1),I!==null&&ze!==null&&gm(H,ze,I,ie,!0)}}e:{if(L=z?Bi(z):window,j=L.nodeName&&L.nodeName.toLowerCase(),j==="select"||j==="input"&&L.type==="file")var Se=Do;else if(zo(L))if(Lo)Se=Wy;else{Se=Zy;var P=Xy}else j=L.nodeName,!j||j.toLowerCase()!=="input"||L.type!=="checkbox"&&L.type!=="radio"?z&&Pu(z.elementType)&&(Se=Do):Se=Jy;if(Se&&(Se=Se(e,z))){xo(H,Se,n,B);break e}P&&P(e,L,z),e==="focusout"&&z&&L.type==="number"&&z.memoizedProps.value!=null&&Fu(L,"number",L.value)}switch(P=z?Bi(z):window,e){case"focusin":(zo(P)||P.contentEditable==="true")&&(ql=P,dc=z,Qi=null);break;case"focusout":Qi=dc=ql=null;break;case"mousedown":mc=!0;break;case"contextmenu":case"mouseup":case"dragend":mc=!1,Yo(H,n,B);break;case"selectionchange":if(Fy)break;case"keydown":case"keyup":Yo(H,n,B)}var oe;if(rc)e:{switch(e){case"compositionstart":var ve="onCompositionStart";break e;case"compositionend":ve="onCompositionEnd";break e;case"compositionupdate":ve="onCompositionUpdate";break e}ve=void 0}else kl?Mo(e,n)&&(ve="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(ve="onCompositionStart");ve&&(Oo&&n.locale!=="ko"&&(kl||ve!=="onCompositionStart"?ve==="onCompositionEnd"&&kl&&(oe=So()):(Mn=B,ic="value"in Mn?Mn.value:Mn.textContent,kl=!0)),P=Ys(z,ve),0<P.length&&(ve=new wo(ve,e,null,n,B),H.push({event:ve,listeners:P}),oe?ve.data=oe:(oe=Co(n),oe!==null&&(ve.data=oe)))),(oe=$y?Ky(e,n):Gy(e,n))&&(ve=Ys(z,"onBeforeInput"),0<ve.length&&(P=new wo("onBeforeInput","beforeinput",null,n,B),H.push({event:P,listeners:ve}),P.data=oe)),R0(H,e,z,n,B)}dm(H,t)})}function ya(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ys(e,t){for(var n=t+"Capture",i=[];e!==null;){var r=e,f=r.stateNode;if(r=r.tag,r!==5&&r!==26&&r!==27||f===null||(r=ki(e,n),r!=null&&i.unshift(ya(e,r,f)),r=ki(e,t),r!=null&&i.push(ya(e,r,f))),e.tag===3)return i;e=e.return}return[]}function q0(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function gm(e,t,n,i,r){for(var f=t._reactName,d=[];n!==null&&n!==i;){var y=n,T=y.alternate,z=y.stateNode;if(y=y.tag,T!==null&&T===i)break;y!==5&&y!==26&&y!==27||z===null||(T=z,r?(z=ki(n,f),z!=null&&d.unshift(ya(n,z,T))):r||(z=ki(n,f),z!=null&&d.push(ya(n,z,T)))),n=n.return}d.length!==0&&e.push({event:t,listeners:d})}var H0=/\r\n?/g,Y0=/\u0000|\uFFFD/g;function pm(e){return(typeof e=="string"?e:""+e).replace(H0,`
`).replace(Y0,"")}function ym(e,t){return t=pm(t),pm(e)===t}function Ce(e,t,n,i,r,f){switch(n){case"children":typeof i=="string"?t==="body"||t==="textarea"&&i===""||Rl(e,i):(typeof i=="number"||typeof i=="bigint")&&t!=="body"&&Rl(e,""+i);break;case"className":Va(e,"class",i);break;case"tabIndex":Va(e,"tabindex",i);break;case"dir":case"role":case"viewBox":case"width":case"height":Va(e,n,i);break;case"style":yo(e,i,f);break;case"data":if(t!=="object"){Va(e,"data",i);break}case"src":case"href":if(i===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(i==null||typeof i=="function"||typeof i=="symbol"||typeof i=="boolean"){e.removeAttribute(n);break}i=Xa(""+i),e.setAttribute(n,i);break;case"action":case"formAction":if(typeof i=="function"){e.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof f=="function"&&(n==="formAction"?(t!=="input"&&Ce(e,t,"name",r.name,r,null),Ce(e,t,"formEncType",r.formEncType,r,null),Ce(e,t,"formMethod",r.formMethod,r,null),Ce(e,t,"formTarget",r.formTarget,r,null)):(Ce(e,t,"encType",r.encType,r,null),Ce(e,t,"method",r.method,r,null),Ce(e,t,"target",r.target,r,null)));if(i==null||typeof i=="symbol"||typeof i=="boolean"){e.removeAttribute(n);break}i=Xa(""+i),e.setAttribute(n,i);break;case"onClick":i!=null&&(e.onclick=an);break;case"onScroll":i!=null&&pe("scroll",e);break;case"onScrollEnd":i!=null&&pe("scrollend",e);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(s(61));if(n=i.__html,n!=null){if(r.children!=null)throw Error(s(60));e.innerHTML=n}}break;case"multiple":e.multiple=i&&typeof i!="function"&&typeof i!="symbol";break;case"muted":e.muted=i&&typeof i!="function"&&typeof i!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(i==null||typeof i=="function"||typeof i=="boolean"||typeof i=="symbol"){e.removeAttribute("xlink:href");break}n=Xa(""+i),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":i!=null&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(n,""+i):e.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":i&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":i===!0?e.setAttribute(n,""):i!==!1&&i!=null&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(n,i):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":i!=null&&typeof i!="function"&&typeof i!="symbol"&&!isNaN(i)&&1<=i?e.setAttribute(n,i):e.removeAttribute(n);break;case"rowSpan":case"start":i==null||typeof i=="function"||typeof i=="symbol"||isNaN(i)?e.removeAttribute(n):e.setAttribute(n,i);break;case"popover":pe("beforetoggle",e),pe("toggle",e),Ga(e,"popover",i);break;case"xlinkActuate":ln(e,"http://www.w3.org/1999/xlink","xlink:actuate",i);break;case"xlinkArcrole":ln(e,"http://www.w3.org/1999/xlink","xlink:arcrole",i);break;case"xlinkRole":ln(e,"http://www.w3.org/1999/xlink","xlink:role",i);break;case"xlinkShow":ln(e,"http://www.w3.org/1999/xlink","xlink:show",i);break;case"xlinkTitle":ln(e,"http://www.w3.org/1999/xlink","xlink:title",i);break;case"xlinkType":ln(e,"http://www.w3.org/1999/xlink","xlink:type",i);break;case"xmlBase":ln(e,"http://www.w3.org/XML/1998/namespace","xml:base",i);break;case"xmlLang":ln(e,"http://www.w3.org/XML/1998/namespace","xml:lang",i);break;case"xmlSpace":ln(e,"http://www.w3.org/XML/1998/namespace","xml:space",i);break;case"is":Ga(e,"is",i);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=gy.get(n)||n,Ga(e,n,i))}}function qr(e,t,n,i,r,f){switch(n){case"style":yo(e,i,f);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(s(61));if(n=i.__html,n!=null){if(r.children!=null)throw Error(s(60));e.innerHTML=n}}break;case"children":typeof i=="string"?Rl(e,i):(typeof i=="number"||typeof i=="bigint")&&Rl(e,""+i);break;case"onScroll":i!=null&&pe("scroll",e);break;case"onScrollEnd":i!=null&&pe("scrollend",e);break;case"onClick":i!=null&&(e.onclick=an);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!uo.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(r=n.endsWith("Capture"),t=n.slice(2,r?n.length-7:void 0),f=e[ht]||null,f=f!=null?f[n]:null,typeof f=="function"&&e.removeEventListener(t,f,r),typeof i=="function")){typeof f!="function"&&f!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,i,r);break e}n in e?e[n]=i:i===!0?e.setAttribute(n,""):Ga(e,n,i)}}}function at(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":pe("error",e),pe("load",e);var i=!1,r=!1,f;for(f in n)if(n.hasOwnProperty(f)){var d=n[f];if(d!=null)switch(f){case"src":i=!0;break;case"srcSet":r=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(s(137,t));default:Ce(e,t,f,d,n,null)}}r&&Ce(e,t,"srcSet",n.srcSet,n,null),i&&Ce(e,t,"src",n.src,n,null);return;case"input":pe("invalid",e);var y=f=d=r=null,T=null,z=null;for(i in n)if(n.hasOwnProperty(i)){var B=n[i];if(B!=null)switch(i){case"name":r=B;break;case"type":d=B;break;case"checked":T=B;break;case"defaultChecked":z=B;break;case"value":f=B;break;case"defaultValue":y=B;break;case"children":case"dangerouslySetInnerHTML":if(B!=null)throw Error(s(137,t));break;default:Ce(e,t,i,B,n,null)}}ho(e,f,y,T,z,d,r,!1);return;case"select":pe("invalid",e),i=d=f=null;for(r in n)if(n.hasOwnProperty(r)&&(y=n[r],y!=null))switch(r){case"value":f=y;break;case"defaultValue":d=y;break;case"multiple":i=y;default:Ce(e,t,r,y,n,null)}t=f,n=d,e.multiple=!!i,t!=null?Ul(e,!!i,t,!1):n!=null&&Ul(e,!!i,n,!0);return;case"textarea":pe("invalid",e),f=r=i=null;for(d in n)if(n.hasOwnProperty(d)&&(y=n[d],y!=null))switch(d){case"value":i=y;break;case"defaultValue":r=y;break;case"children":f=y;break;case"dangerouslySetInnerHTML":if(y!=null)throw Error(s(91));break;default:Ce(e,t,d,y,n,null)}go(e,i,r,f);return;case"option":for(T in n)if(n.hasOwnProperty(T)&&(i=n[T],i!=null))switch(T){case"selected":e.selected=i&&typeof i!="function"&&typeof i!="symbol";break;default:Ce(e,t,T,i,n,null)}return;case"dialog":pe("beforetoggle",e),pe("toggle",e),pe("cancel",e),pe("close",e);break;case"iframe":case"object":pe("load",e);break;case"video":case"audio":for(i=0;i<pa.length;i++)pe(pa[i],e);break;case"image":pe("error",e),pe("load",e);break;case"details":pe("toggle",e);break;case"embed":case"source":case"link":pe("error",e),pe("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(z in n)if(n.hasOwnProperty(z)&&(i=n[z],i!=null))switch(z){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,t));default:Ce(e,t,z,i,n,null)}return;default:if(Pu(t)){for(B in n)n.hasOwnProperty(B)&&(i=n[B],i!==void 0&&qr(e,t,B,i,n,void 0));return}}for(y in n)n.hasOwnProperty(y)&&(i=n[y],i!=null&&Ce(e,t,y,i,n,null))}function $0(e,t,n,i){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var r=null,f=null,d=null,y=null,T=null,z=null,B=null;for(j in n){var H=n[j];if(n.hasOwnProperty(j)&&H!=null)switch(j){case"checked":break;case"value":break;case"defaultValue":T=H;default:i.hasOwnProperty(j)||Ce(e,t,j,null,i,H)}}for(var L in i){var j=i[L];if(H=n[L],i.hasOwnProperty(L)&&(j!=null||H!=null))switch(L){case"type":f=j;break;case"name":r=j;break;case"checked":z=j;break;case"defaultChecked":B=j;break;case"value":d=j;break;case"defaultValue":y=j;break;case"children":case"dangerouslySetInnerHTML":if(j!=null)throw Error(s(137,t));break;default:j!==H&&Ce(e,t,L,j,i,H)}}Iu(e,d,y,T,z,B,f,r);return;case"select":j=d=y=L=null;for(f in n)if(T=n[f],n.hasOwnProperty(f)&&T!=null)switch(f){case"value":break;case"multiple":j=T;default:i.hasOwnProperty(f)||Ce(e,t,f,null,i,T)}for(r in i)if(f=i[r],T=n[r],i.hasOwnProperty(r)&&(f!=null||T!=null))switch(r){case"value":L=f;break;case"defaultValue":y=f;break;case"multiple":d=f;default:f!==T&&Ce(e,t,r,f,i,T)}t=y,n=d,i=j,L!=null?Ul(e,!!n,L,!1):!!i!=!!n&&(t!=null?Ul(e,!!n,t,!0):Ul(e,!!n,n?[]:"",!1));return;case"textarea":j=L=null;for(y in n)if(r=n[y],n.hasOwnProperty(y)&&r!=null&&!i.hasOwnProperty(y))switch(y){case"value":break;case"children":break;default:Ce(e,t,y,null,i,r)}for(d in i)if(r=i[d],f=n[d],i.hasOwnProperty(d)&&(r!=null||f!=null))switch(d){case"value":L=r;break;case"defaultValue":j=r;break;case"children":break;case"dangerouslySetInnerHTML":if(r!=null)throw Error(s(91));break;default:r!==f&&Ce(e,t,d,r,i,f)}mo(e,L,j);return;case"option":for(var I in n)if(L=n[I],n.hasOwnProperty(I)&&L!=null&&!i.hasOwnProperty(I))switch(I){case"selected":e.selected=!1;break;default:Ce(e,t,I,null,i,L)}for(T in i)if(L=i[T],j=n[T],i.hasOwnProperty(T)&&L!==j&&(L!=null||j!=null))switch(T){case"selected":e.selected=L&&typeof L!="function"&&typeof L!="symbol";break;default:Ce(e,t,T,L,i,j)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var ie in n)L=n[ie],n.hasOwnProperty(ie)&&L!=null&&!i.hasOwnProperty(ie)&&Ce(e,t,ie,null,i,L);for(z in i)if(L=i[z],j=n[z],i.hasOwnProperty(z)&&L!==j&&(L!=null||j!=null))switch(z){case"children":case"dangerouslySetInnerHTML":if(L!=null)throw Error(s(137,t));break;default:Ce(e,t,z,L,i,j)}return;default:if(Pu(t)){for(var ze in n)L=n[ze],n.hasOwnProperty(ze)&&L!==void 0&&!i.hasOwnProperty(ze)&&qr(e,t,ze,void 0,i,L);for(B in i)L=i[B],j=n[B],!i.hasOwnProperty(B)||L===j||L===void 0&&j===void 0||qr(e,t,B,L,i,j);return}}for(var N in n)L=n[N],n.hasOwnProperty(N)&&L!=null&&!i.hasOwnProperty(N)&&Ce(e,t,N,null,i,L);for(H in i)L=i[H],j=n[H],!i.hasOwnProperty(H)||L===j||L==null&&j==null||Ce(e,t,H,L,i,j)}function vm(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function K0(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),i=0;i<n.length;i++){var r=n[i],f=r.transferSize,d=r.initiatorType,y=r.duration;if(f&&y&&vm(d)){for(d=0,y=r.responseEnd,i+=1;i<n.length;i++){var T=n[i],z=T.startTime;if(z>y)break;var B=T.transferSize,H=T.initiatorType;B&&vm(H)&&(T=T.responseEnd,d+=B*(T<y?1:(y-z)/(T-z)))}if(--i,t+=8*(f+d)/(r.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Hr=null,Yr=null;function $s(e){return e.nodeType===9?e:e.ownerDocument}function bm(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Sm(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function $r(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Kr=null;function G0(){var e=window.event;return e&&e.type==="popstate"?e===Kr?!1:(Kr=e,!0):(Kr=null,!1)}var Tm=typeof setTimeout=="function"?setTimeout:void 0,V0=typeof clearTimeout=="function"?clearTimeout:void 0,Em=typeof Promise=="function"?Promise:void 0,Q0=typeof queueMicrotask=="function"?queueMicrotask:typeof Em<"u"?function(e){return Em.resolve(null).then(e).catch(X0)}:Tm;function X0(e){setTimeout(function(){throw e})}function Vn(e){return e==="head"}function wm(e,t){var n=t,i=0;do{var r=n.nextSibling;if(e.removeChild(n),r&&r.nodeType===8)if(n=r.data,n==="/$"||n==="/&"){if(i===0){e.removeChild(r),hi(t);return}i--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")i++;else if(n==="html")va(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,va(n);for(var f=n.firstChild;f;){var d=f.nextSibling,y=f.nodeName;f[ji]||y==="SCRIPT"||y==="STYLE"||y==="LINK"&&f.rel.toLowerCase()==="stylesheet"||n.removeChild(f),f=d}}else n==="body"&&va(e.ownerDocument.body);n=r}while(n);hi(t)}function Am(e,t){var n=e;e=0;do{var i=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",n.getAttribute("style")===""&&n.removeAttribute("style")):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(e===0)break;e--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||e++;n=i}while(n)}function Gr(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":Gr(n),Ju(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function Z0(e,t,n,i){for(;e.nodeType===1;){var r=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!i&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(i){if(!e[ji])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(f=e.getAttribute("rel"),f==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(f!==r.rel||e.getAttribute("href")!==(r.href==null||r.href===""?null:r.href)||e.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin)||e.getAttribute("title")!==(r.title==null?null:r.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(f=e.getAttribute("src"),(f!==(r.src==null?null:r.src)||e.getAttribute("type")!==(r.type==null?null:r.type)||e.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin))&&f&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var f=r.name==null?null:""+r.name;if(r.type==="hidden"&&e.getAttribute("name")===f)return e}else return e;if(e=$t(e.nextSibling),e===null)break}return null}function J0(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=$t(e.nextSibling),e===null))return null;return e}function Om(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=$t(e.nextSibling),e===null))return null;return e}function Vr(e){return e.data==="$?"||e.data==="$~"}function Qr(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function W0(e,t){var n=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||n.readyState!=="loading")t();else{var i=function(){t(),n.removeEventListener("DOMContentLoaded",i)};n.addEventListener("DOMContentLoaded",i),e._reactRetry=i}}function $t(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var Xr=null;function _m(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return $t(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function Nm(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"){if(t===0)return e;t--}else n!=="/$"&&n!=="/&"||t++}e=e.previousSibling}return null}function Mm(e,t,n){switch(t=$s(n),e){case"html":if(e=t.documentElement,!e)throw Error(s(452));return e;case"head":if(e=t.head,!e)throw Error(s(453));return e;case"body":if(e=t.body,!e)throw Error(s(454));return e;default:throw Error(s(451))}}function va(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Ju(e)}var Kt=new Map,Cm=new Set;function Ks(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Tn=G.d;G.d={f:I0,r:F0,D:P0,C:e1,L:t1,m:n1,X:i1,S:l1,M:a1};function I0(){var e=Tn.f(),t=Us();return e||t}function F0(e){var t=xl(e);t!==null&&t.tag===5&&t.type==="form"?Qh(t):Tn.r(e)}var ri=typeof document>"u"?null:document;function zm(e,t,n){var i=ri;if(i&&typeof t=="string"&&t){var r=Rt(t);r='link[rel="'+e+'"][href="'+r+'"]',typeof n=="string"&&(r+='[crossorigin="'+n+'"]'),Cm.has(r)||(Cm.add(r),e={rel:e,crossOrigin:n,href:t},i.querySelector(r)===null&&(t=i.createElement("link"),at(t,"link",e),Pe(t),i.head.appendChild(t)))}}function P0(e){Tn.D(e),zm("dns-prefetch",e,null)}function e1(e,t){Tn.C(e,t),zm("preconnect",e,t)}function t1(e,t,n){Tn.L(e,t,n);var i=ri;if(i&&e&&t){var r='link[rel="preload"][as="'+Rt(t)+'"]';t==="image"&&n&&n.imageSrcSet?(r+='[imagesrcset="'+Rt(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(r+='[imagesizes="'+Rt(n.imageSizes)+'"]')):r+='[href="'+Rt(e)+'"]';var f=r;switch(t){case"style":f=fi(e);break;case"script":f=oi(e)}Kt.has(f)||(e=v({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),Kt.set(f,e),i.querySelector(r)!==null||t==="style"&&i.querySelector(ba(f))||t==="script"&&i.querySelector(Sa(f))||(t=i.createElement("link"),at(t,"link",e),Pe(t),i.head.appendChild(t)))}}function n1(e,t){Tn.m(e,t);var n=ri;if(n&&e){var i=t&&typeof t.as=="string"?t.as:"script",r='link[rel="modulepreload"][as="'+Rt(i)+'"][href="'+Rt(e)+'"]',f=r;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":f=oi(e)}if(!Kt.has(f)&&(e=v({rel:"modulepreload",href:e},t),Kt.set(f,e),n.querySelector(r)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(Sa(f)))return}i=n.createElement("link"),at(i,"link",e),Pe(i),n.head.appendChild(i)}}}function l1(e,t,n){Tn.S(e,t,n);var i=ri;if(i&&e){var r=Dl(i).hoistableStyles,f=fi(e);t=t||"default";var d=r.get(f);if(!d){var y={loading:0,preload:null};if(d=i.querySelector(ba(f)))y.loading=5;else{e=v({rel:"stylesheet",href:e,"data-precedence":t},n),(n=Kt.get(f))&&Zr(e,n);var T=d=i.createElement("link");Pe(T),at(T,"link",e),T._p=new Promise(function(z,B){T.onload=z,T.onerror=B}),T.addEventListener("load",function(){y.loading|=1}),T.addEventListener("error",function(){y.loading|=2}),y.loading|=4,Gs(d,t,i)}d={type:"stylesheet",instance:d,count:1,state:y},r.set(f,d)}}}function i1(e,t){Tn.X(e,t);var n=ri;if(n&&e){var i=Dl(n).hoistableScripts,r=oi(e),f=i.get(r);f||(f=n.querySelector(Sa(r)),f||(e=v({src:e,async:!0},t),(t=Kt.get(r))&&Jr(e,t),f=n.createElement("script"),Pe(f),at(f,"link",e),n.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},i.set(r,f))}}function a1(e,t){Tn.M(e,t);var n=ri;if(n&&e){var i=Dl(n).hoistableScripts,r=oi(e),f=i.get(r);f||(f=n.querySelector(Sa(r)),f||(e=v({src:e,async:!0,type:"module"},t),(t=Kt.get(r))&&Jr(e,t),f=n.createElement("script"),Pe(f),at(f,"link",e),n.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},i.set(r,f))}}function xm(e,t,n,i){var r=(r=me.current)?Ks(r):null;if(!r)throw Error(s(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=fi(n.href),n=Dl(r).hoistableStyles,i=n.get(t),i||(i={type:"style",instance:null,count:0,state:null},n.set(t,i)),i):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=fi(n.href);var f=Dl(r).hoistableStyles,d=f.get(e);if(d||(r=r.ownerDocument||r,d={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},f.set(e,d),(f=r.querySelector(ba(e)))&&!f._p&&(d.instance=f,d.state.loading=5),Kt.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Kt.set(e,n),f||s1(r,e,n,d.state))),t&&i===null)throw Error(s(528,""));return d}if(t&&i!==null)throw Error(s(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=oi(n),n=Dl(r).hoistableScripts,i=n.get(t),i||(i={type:"script",instance:null,count:0,state:null},n.set(t,i)),i):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,e))}}function fi(e){return'href="'+Rt(e)+'"'}function ba(e){return'link[rel="stylesheet"]['+e+"]"}function Dm(e){return v({},e,{"data-precedence":e.precedence,precedence:null})}function s1(e,t,n,i){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?i.loading=1:(t=e.createElement("link"),i.preload=t,t.addEventListener("load",function(){return i.loading|=1}),t.addEventListener("error",function(){return i.loading|=2}),at(t,"link",n),Pe(t),e.head.appendChild(t))}function oi(e){return'[src="'+Rt(e)+'"]'}function Sa(e){return"script[async]"+e}function Lm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var i=e.querySelector('style[data-href~="'+Rt(n.href)+'"]');if(i)return t.instance=i,Pe(i),i;var r=v({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return i=(e.ownerDocument||e).createElement("style"),Pe(i),at(i,"style",r),Gs(i,n.precedence,e),t.instance=i;case"stylesheet":r=fi(n.href);var f=e.querySelector(ba(r));if(f)return t.state.loading|=4,t.instance=f,Pe(f),f;i=Dm(n),(r=Kt.get(r))&&Zr(i,r),f=(e.ownerDocument||e).createElement("link"),Pe(f);var d=f;return d._p=new Promise(function(y,T){d.onload=y,d.onerror=T}),at(f,"link",i),t.state.loading|=4,Gs(f,n.precedence,e),t.instance=f;case"script":return f=oi(n.src),(r=e.querySelector(Sa(f)))?(t.instance=r,Pe(r),r):(i=n,(r=Kt.get(f))&&(i=v({},n),Jr(i,r)),e=e.ownerDocument||e,r=e.createElement("script"),Pe(r),at(r,"link",i),e.head.appendChild(r),t.instance=r);case"void":return null;default:throw Error(s(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(i=t.instance,t.state.loading|=4,Gs(i,n.precedence,e));return t.instance}function Gs(e,t,n){for(var i=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),r=i.length?i[i.length-1]:null,f=r,d=0;d<i.length;d++){var y=i[d];if(y.dataset.precedence===t)f=y;else if(f!==r)break}f?f.parentNode.insertBefore(e,f.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Zr(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Jr(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Vs=null;function Um(e,t,n){if(Vs===null){var i=new Map,r=Vs=new Map;r.set(n,i)}else r=Vs,i=r.get(n),i||(i=new Map,r.set(n,i));if(i.has(e))return i;for(i.set(e,null),n=n.getElementsByTagName(e),r=0;r<n.length;r++){var f=n[r];if(!(f[ji]||f[tt]||e==="link"&&f.getAttribute("rel")==="stylesheet")&&f.namespaceURI!=="http://www.w3.org/2000/svg"){var d=f.getAttribute(t)||"";d=e+d;var y=i.get(d);y?y.push(f):i.set(d,[f])}}return i}function Rm(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function u1(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function jm(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function c1(e,t,n,i){if(n.type==="stylesheet"&&(typeof i.media!="string"||matchMedia(i.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var r=fi(i.href),f=t.querySelector(ba(r));if(f){t=f._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Qs.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=f,Pe(f);return}f=t.ownerDocument||t,i=Dm(i),(r=Kt.get(r))&&Zr(i,r),f=f.createElement("link"),Pe(f);var d=f;d._p=new Promise(function(y,T){d.onload=y,d.onerror=T}),at(f,"link",i),n.instance=f}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=Qs.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var Wr=0;function r1(e,t){return e.stylesheets&&e.count===0&&Zs(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var i=setTimeout(function(){if(e.stylesheets&&Zs(e,e.stylesheets),e.unsuspend){var f=e.unsuspend;e.unsuspend=null,f()}},6e4+t);0<e.imgBytes&&Wr===0&&(Wr=62500*K0());var r=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Zs(e,e.stylesheets),e.unsuspend)){var f=e.unsuspend;e.unsuspend=null,f()}},(e.imgBytes>Wr?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(i),clearTimeout(r)}}:null}function Qs(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Zs(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Xs=null;function Zs(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Xs=new Map,t.forEach(f1,e),Xs=null,Qs.call(e))}function f1(e,t){if(!(t.state.loading&4)){var n=Xs.get(e);if(n)var i=n.get(null);else{n=new Map,Xs.set(e,n);for(var r=e.querySelectorAll("link[data-precedence],style[data-precedence]"),f=0;f<r.length;f++){var d=r[f];(d.nodeName==="LINK"||d.getAttribute("media")!=="not all")&&(n.set(d.dataset.precedence,d),i=d)}i&&n.set(null,i)}r=t.instance,d=r.getAttribute("data-precedence"),f=n.get(d)||i,f===i&&n.set(null,r),n.set(d,r),this.count++,i=Qs.bind(this),r.addEventListener("load",i),r.addEventListener("error",i),f?f.parentNode.insertBefore(r,f.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(r,e.firstChild)),t.state.loading|=4}}var Ta={$$typeof:K,Provider:null,Consumer:null,_currentValue:ne,_currentValue2:ne,_threadCount:0};function o1(e,t,n,i,r,f,d,y,T){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Vu(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Vu(0),this.hiddenUpdates=Vu(null),this.identifierPrefix=i,this.onUncaughtError=r,this.onCaughtError=f,this.onRecoverableError=d,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=T,this.incompleteTransitions=new Map}function Bm(e,t,n,i,r,f,d,y,T,z,B,H){return e=new o1(e,t,n,d,T,z,B,H,y),t=1,f===!0&&(t|=24),f=_t(3,null,null,t),e.current=f,f.stateNode=e,t=Cc(),t.refCount++,e.pooledCache=t,t.refCount++,f.memoizedState={element:i,isDehydrated:n,cache:t},Lc(f),e}function km(e){return e?(e=$l,e):$l}function qm(e,t,n,i,r,f){r=km(r),i.context===null?i.context=r:i.pendingContext=r,i=Un(t),i.payload={element:n},f=f===void 0?null:f,f!==null&&(i.callback=f),n=Rn(e,i,t),n!==null&&(vt(n,e,t),Pi(n,e,t))}function Hm(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Ir(e,t){Hm(e,t),(e=e.alternate)&&Hm(e,t)}function Ym(e){if(e.tag===13||e.tag===31){var t=cl(e,67108864);t!==null&&vt(t,e,67108864),Ir(e,67108864)}}function $m(e){if(e.tag===13||e.tag===31){var t=xt();t=Qu(t);var n=cl(e,t);n!==null&&vt(n,e,t),Ir(e,t)}}var Js=!0;function h1(e,t,n,i){var r=D.T;D.T=null;var f=G.p;try{G.p=2,Fr(e,t,n,i)}finally{G.p=f,D.T=r}}function d1(e,t,n,i){var r=D.T;D.T=null;var f=G.p;try{G.p=8,Fr(e,t,n,i)}finally{G.p=f,D.T=r}}function Fr(e,t,n,i){if(Js){var r=Pr(i);if(r===null)kr(e,t,i,Ws,n),Gm(e,i);else if(g1(r,e,t,n,i))i.stopPropagation();else if(Gm(e,i),t&4&&-1<m1.indexOf(e)){for(;r!==null;){var f=xl(r);if(f!==null)switch(f.tag){case 3:if(f=f.stateNode,f.current.memoizedState.isDehydrated){var d=ll(f.pendingLanes);if(d!==0){var y=f;for(y.pendingLanes|=2,y.entangledLanes|=2;d;){var T=1<<31-At(d);y.entanglements[1]|=T,d&=~T}en(f),(Ee&6)===0&&(Ds=Et()+500,ga(0))}}break;case 31:case 13:y=cl(f,2),y!==null&&vt(y,f,2),Us(),Ir(f,2)}if(f=Pr(i),f===null&&kr(e,t,i,Ws,n),f===r)break;r=f}r!==null&&i.stopPropagation()}else kr(e,t,i,null,n)}}function Pr(e){return e=tc(e),ef(e)}var Ws=null;function ef(e){if(Ws=null,e=zl(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=h(t),e!==null)return e;e=null}else if(n===31){if(e=m(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Ws=e,null}function Km(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Pp()){case Wf:return 2;case If:return 8;case qa:case ey:return 32;case Ff:return 268435456;default:return 32}default:return 32}}var tf=!1,Qn=null,Xn=null,Zn=null,Ea=new Map,wa=new Map,Jn=[],m1="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Gm(e,t){switch(e){case"focusin":case"focusout":Qn=null;break;case"dragenter":case"dragleave":Xn=null;break;case"mouseover":case"mouseout":Zn=null;break;case"pointerover":case"pointerout":Ea.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":wa.delete(t.pointerId)}}function Aa(e,t,n,i,r,f){return e===null||e.nativeEvent!==f?(e={blockedOn:t,domEventName:n,eventSystemFlags:i,nativeEvent:f,targetContainers:[r]},t!==null&&(t=xl(t),t!==null&&Ym(t)),e):(e.eventSystemFlags|=i,t=e.targetContainers,r!==null&&t.indexOf(r)===-1&&t.push(r),e)}function g1(e,t,n,i,r){switch(t){case"focusin":return Qn=Aa(Qn,e,t,n,i,r),!0;case"dragenter":return Xn=Aa(Xn,e,t,n,i,r),!0;case"mouseover":return Zn=Aa(Zn,e,t,n,i,r),!0;case"pointerover":var f=r.pointerId;return Ea.set(f,Aa(Ea.get(f)||null,e,t,n,i,r)),!0;case"gotpointercapture":return f=r.pointerId,wa.set(f,Aa(wa.get(f)||null,e,t,n,i,r)),!0}return!1}function Vm(e){var t=zl(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=h(n),t!==null){e.blockedOn=t,io(e.priority,function(){$m(n)});return}}else if(t===31){if(t=m(n),t!==null){e.blockedOn=t,io(e.priority,function(){$m(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Is(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Pr(e.nativeEvent);if(n===null){n=e.nativeEvent;var i=new n.constructor(n.type,n);ec=i,n.target.dispatchEvent(i),ec=null}else return t=xl(n),t!==null&&Ym(t),e.blockedOn=n,!1;t.shift()}return!0}function Qm(e,t,n){Is(e)&&n.delete(t)}function p1(){tf=!1,Qn!==null&&Is(Qn)&&(Qn=null),Xn!==null&&Is(Xn)&&(Xn=null),Zn!==null&&Is(Zn)&&(Zn=null),Ea.forEach(Qm),wa.forEach(Qm)}function Fs(e,t){e.blockedOn===t&&(e.blockedOn=null,tf||(tf=!0,u.unstable_scheduleCallback(u.unstable_NormalPriority,p1)))}var Ps=null;function Xm(e){Ps!==e&&(Ps=e,u.unstable_scheduleCallback(u.unstable_NormalPriority,function(){Ps===e&&(Ps=null);for(var t=0;t<e.length;t+=3){var n=e[t],i=e[t+1],r=e[t+2];if(typeof i!="function"){if(ef(i||n)===null)continue;break}var f=xl(n);f!==null&&(e.splice(t,3),t-=3,Pc(f,{pending:!0,data:r,method:n.method,action:i},i,r))}}))}function hi(e){function t(T){return Fs(T,e)}Qn!==null&&Fs(Qn,e),Xn!==null&&Fs(Xn,e),Zn!==null&&Fs(Zn,e),Ea.forEach(t),wa.forEach(t);for(var n=0;n<Jn.length;n++){var i=Jn[n];i.blockedOn===e&&(i.blockedOn=null)}for(;0<Jn.length&&(n=Jn[0],n.blockedOn===null);)Vm(n),n.blockedOn===null&&Jn.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(i=0;i<n.length;i+=3){var r=n[i],f=n[i+1],d=r[ht]||null;if(typeof f=="function")d||Xm(n);else if(d){var y=null;if(f&&f.hasAttribute("formAction")){if(r=f,d=f[ht]||null)y=d.formAction;else if(ef(r)!==null)continue}else y=d.action;typeof y=="function"?n[i+1]=y:(n.splice(i,3),i-=3),Xm(n)}}}function Zm(){function e(f){f.canIntercept&&f.info==="react-transition"&&f.intercept({handler:function(){return new Promise(function(d){return r=d})},focusReset:"manual",scroll:"manual"})}function t(){r!==null&&(r(),r=null),i||setTimeout(n,20)}function n(){if(!i&&!navigation.transition){var f=navigation.currentEntry;f&&f.url!=null&&navigation.navigate(f.url,{state:f.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var i=!1,r=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){i=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),r!==null&&(r(),r=null)}}}function nf(e){this._internalRoot=e}eu.prototype.render=nf.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(s(409));var n=t.current,i=xt();qm(n,i,e,t,null,null)},eu.prototype.unmount=nf.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;qm(e.current,2,null,e,null,null),Us(),t[Cl]=null}};function eu(e){this._internalRoot=e}eu.prototype.unstable_scheduleHydration=function(e){if(e){var t=lo();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Jn.length&&t!==0&&t<Jn[n].priority;n++);Jn.splice(n,0,e),n===0&&Vm(e)}};var Jm=l.version;if(Jm!=="19.2.1")throw Error(s(527,Jm,"19.2.1"));G.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(s(188)):(e=Object.keys(e).join(","),Error(s(268,e)));return e=g(t),e=e!==null?b(e):null,e=e===null?null:e.stateNode,e};var y1={bundleType:0,version:"19.2.1",rendererPackageName:"react-dom",currentDispatcherRef:D,reconcilerVersion:"19.2.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var tu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!tu.isDisabled&&tu.supportsFiber)try{Li=tu.inject(y1),wt=tu}catch{}}return _a.createRoot=function(e,t){if(!c(e))throw Error(s(299));var n=!1,i="",r=nd,f=ld,d=id;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(i=t.identifierPrefix),t.onUncaughtError!==void 0&&(r=t.onUncaughtError),t.onCaughtError!==void 0&&(f=t.onCaughtError),t.onRecoverableError!==void 0&&(d=t.onRecoverableError)),t=Bm(e,1,!1,null,null,n,i,null,r,f,d,Zm),e[Cl]=t.current,Br(e),new nf(t)},_a.hydrateRoot=function(e,t,n){if(!c(e))throw Error(s(299));var i=!1,r="",f=nd,d=ld,y=id,T=null;return n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(r=n.identifierPrefix),n.onUncaughtError!==void 0&&(f=n.onUncaughtError),n.onCaughtError!==void 0&&(d=n.onCaughtError),n.onRecoverableError!==void 0&&(y=n.onRecoverableError),n.formState!==void 0&&(T=n.formState)),t=Bm(e,1,!0,t,n??null,i,r,T,f,d,y,Zm),t.context=km(null),n=t.current,i=xt(),i=Qu(i),r=Un(i),r.callback=null,Rn(n,r,i),n=i,t.current.lanes=n,Ri(t,n),en(t),e[Cl]=t.current,Br(e),new eu(t)},_a.version="19.2.1",_a}var ug;function j1(){if(ug)return sf.exports;ug=1;function u(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(u)}catch(l){console.error(l)}}return u(),sf.exports=R1(),sf.exports}var B1=j1();const k1="modulepreload",q1=function(u){return"/"+u},cg={},H1=function(l,a,s){let c=Promise.resolve();if(a&&a.length>0){let h=function(g){return Promise.all(g.map(b=>Promise.resolve(b).then(v=>({status:"fulfilled",value:v}),v=>({status:"rejected",reason:v}))))};document.getElementsByTagName("link");const m=document.querySelector("meta[property=csp-nonce]"),p=(m==null?void 0:m.nonce)||(m==null?void 0:m.getAttribute("nonce"));c=h(a.map(g=>{if(g=q1(g),g in cg)return;cg[g]=!0;const b=g.endsWith(".css"),v=b?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${g}"]${v}`))return;const O=document.createElement("link");if(O.rel=b?"stylesheet":k1,b||(O.as="script"),O.crossOrigin="",O.href=g,p&&O.setAttribute("nonce",p),document.head.appendChild(O),b)return new Promise((E,x)=>{O.addEventListener("load",E),O.addEventListener("error",()=>x(new Error(`Unable to preload CSS for ${g}`)))})}))}function o(h){const m=new Event("vite:preloadError",{cancelable:!0});if(m.payload=h,window.dispatchEvent(m),!m.defaultPrevented)throw h}return c.then(h=>{for(const m of h||[])m.status==="rejected"&&o(m.reason);return l().catch(o)})};function Y1(u,l){const a=/(\x1b\[(\d+(;\d+)*)m)|([^\x1b]+)/g,s=[];let c,o={},h=!1,m=l==null?void 0:l.fg,p=l==null?void 0:l.bg;for(;(c=a.exec(u))!==null;){const[,,g,,b]=c;if(g)for(const v of g.split(";")){const O=+v;switch(O){case 0:o={};break;case 1:o["font-weight"]="bold";break;case 2:o.opacity="0.8";break;case 3:o["font-style"]="italic";break;case 4:o["text-decoration"]="underline";break;case 7:h=!0;break;case 8:o.display="none";break;case 9:o["text-decoration"]="line-through";break;case 22:delete o["font-weight"],delete o["font-style"],delete o.opacity,delete o["text-decoration"];break;case 23:delete o["font-weight"],delete o["font-style"],delete o.opacity;break;case 24:delete o["text-decoration"];break;case 27:h=!1;break;case 30:case 31:case 32:case 33:case 34:case 35:case 36:case 37:m=rg[O-30];break;case 39:m=l==null?void 0:l.fg;break;case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:p=rg[O-40];break;case 49:p=l==null?void 0:l.bg;break;case 53:o["text-decoration"]="overline";break;case 90:case 91:case 92:case 93:case 94:case 95:case 96:case 97:m=fg[O-90];break;case 100:case 101:case 102:case 103:case 104:case 105:case 106:case 107:p=fg[O-100];break}}else if(b){const v={...o},O=h?p:m;O!==void 0&&(v.color=O),h&&m&&(v["background-color"]=m),s.push(`<span style="${K1(v)}">${$1(b)}</span>`)}}return s.join("")}const rg={0:"var(--vscode-terminal-ansiBlack)",1:"var(--vscode-terminal-ansiRed)",2:"var(--vscode-terminal-ansiGreen)",3:"var(--vscode-terminal-ansiYellow)",4:"var(--vscode-terminal-ansiBlue)",5:"var(--vscode-terminal-ansiMagenta)",6:"var(--vscode-terminal-ansiCyan)",7:"var(--vscode-terminal-ansiWhite)"},fg={0:"var(--vscode-terminal-ansiBrightBlack)",1:"var(--vscode-terminal-ansiBrightRed)",2:"var(--vscode-terminal-ansiBrightGreen)",3:"var(--vscode-terminal-ansiBrightYellow)",4:"var(--vscode-terminal-ansiBrightBlue)",5:"var(--vscode-terminal-ansiBrightMagenta)",6:"var(--vscode-terminal-ansiBrightCyan)",7:"var(--vscode-terminal-ansiBrightWhite)"};function $1(u){return u.replace(/[&"<>]/g,l=>({"&":"&amp;",'"':"&quot;","<":"&lt;",">":"&gt;"})[l])}function K1(u){return Object.entries(u).map(([l,a])=>`${l}: ${a}`).join("; ")}const ff=({text:u,highlighter:l,mimeType:a,linkify:s,readOnly:c,highlight:o,revealLine:h,lineNumbers:m,isFocused:p,focusOnChange:g,wrapLines:b,onChange:v,dataTestId:O,placeholder:E})=>{const[x,S]=Mg(),[w]=he.useState(H1(()=>import("./codeMirrorModule-DeBYQozu.js"),__vite__mapDeps([0,1])).then(Q=>Q.default)),M=he.useRef(null),[R,K]=he.useState();return he.useEffect(()=>{(async()=>{var V,U;const Q=await w;V1(Q);const Z=S.current;if(!Z)return;const W=X1(l)||Q1(a)||(s?"text/linkified":"");if(M.current&&W===M.current.cm.getOption("mode")&&!!c===M.current.cm.getOption("readOnly")&&m===M.current.cm.getOption("lineNumbers")&&b===M.current.cm.getOption("lineWrapping")&&E===M.current.cm.getOption("placeholder"))return;(U=(V=M.current)==null?void 0:V.cm)==null||U.getWrapperElement().remove();const k=Q(Z,{value:"",mode:W,readOnly:!!c,lineNumbers:m,lineWrapping:b,placeholder:E,matchBrackets:!0,autoCloseBrackets:!0,extraKeys:{"Ctrl-F":"findPersistent","Cmd-F":"findPersistent"}});return M.current={cm:k},p&&k.focus(),K(k),k})()},[w,R,S,l,a,s,m,b,c,p,E]),he.useEffect(()=>{M.current&&M.current.cm.setSize(x.width,x.height)},[x]),he.useLayoutEffect(()=>{var W;if(!R)return;let Q=!1;if(R.getValue()!==u&&(R.setValue(u),Q=!0,g&&(R.execCommand("selectAll"),R.focus())),Q||JSON.stringify(o)!==JSON.stringify(M.current.highlight)){for(const U of M.current.highlight||[])R.removeLineClass(U.line-1,"wrap");for(const U of o||[])R.addLineClass(U.line-1,"wrap",`source-line-${U.type}`);for(const U of M.current.widgets||[])R.removeLineWidget(U);for(const U of M.current.markers||[])U.clear();const k=[],V=[];for(const U of o||[]){if(U.type!=="subtle-error"&&U.type!=="error")continue;const ae=(W=M.current)==null?void 0:W.cm.getLine(U.line-1);if(ae){const te={};te.title=U.message||"",V.push(R.markText({line:U.line-1,ch:0},{line:U.line-1,ch:U.column||ae.length},{className:"source-line-error-underline",attributes:te}))}if(U.type==="error"){const te=document.createElement("div");te.innerHTML=Y1(U.message||"",{bg:"var(--vscode-inputValidation-errorBackground)",fg:"var(--vscode-editor-foreground)"}),te.className="source-line-error-widget",k.push(R.addLineWidget(U.line,te,{above:!0,coverGutter:!1}))}}M.current.highlight=o,M.current.widgets=k,M.current.markers=V}typeof h=="number"&&M.current.cm.lineCount()>=h&&R.scrollIntoView({line:Math.max(0,h-1),ch:0},50);let Z;return v&&(Z=()=>v(R.getValue()),R.on("change",Z)),()=>{Z&&R.off("change",Z)}},[R,u,o,h,g,v]),X.jsx("div",{"data-testid":O,className:"cm-wrapper",ref:S,onClick:G1})};function G1(u){var a;if(!(u.target instanceof HTMLElement))return;let l;u.target.classList.contains("cm-linkified")?l=u.target.textContent:u.target.classList.contains("cm-link")&&((a=u.target.nextElementSibling)!=null&&a.classList.contains("cm-url"))&&(l=u.target.nextElementSibling.textContent.slice(1,-1)),l&&(u.preventDefault(),u.stopPropagation(),window.open(l,"_blank"))}let og=!1;function V1(u){og||(og=!0,u.defineSimpleMode("text/linkified",{start:[{regex:A1,token:"linkified"}]}))}function Q1(u){if(u){if(u.includes("javascript")||u.includes("json"))return"javascript";if(u.includes("python"))return"python";if(u.includes("csharp"))return"text/x-csharp";if(u.includes("java"))return"text/x-java";if(u.includes("markdown"))return"markdown";if(u.includes("html")||u.includes("svg"))return"htmlmixed";if(u.includes("css"))return"css"}}function X1(u){if(u)return{javascript:"javascript",jsonl:"javascript",python:"python",csharp:"text/x-csharp",java:"text/x-java",markdown:"markdown",html:"htmlmixed",css:"css",yaml:"yaml"}[u]}const Z1=50,J1=({sidebarSize:u,sidebarHidden:l=!1,sidebarIsFirst:a=!1,orientation:s="vertical",minSidebarSize:c=Z1,settingName:o,sidebar:h,main:m})=>{const p=Math.max(c,u)*window.devicePixelRatio,[g,b]=pu(o?o+"."+s+":size":void 0,p),[v,O]=pu(o?o+"."+s+":size":void 0,p),[E,x]=he.useState(null),[S,w]=Mg();let M;s==="vertical"?(M=v/window.devicePixelRatio,S&&S.height<M&&(M=S.height-10)):(M=g/window.devicePixelRatio,S&&S.width<M&&(M=S.width-10)),document.body.style.userSelect=E?"none":"inherit";let R={};return s==="vertical"?a?R={top:E?0:M-4,bottom:E?0:void 0,height:E?"initial":8}:R={bottom:E?0:M-4,top:E?0:void 0,height:E?"initial":8}:a?R={left:E?0:M-4,right:E?0:void 0,width:E?"initial":8}:R={right:E?0:M-4,left:E?0:void 0,width:E?"initial":8},X.jsxs("div",{className:Ol("split-view",s,a&&"sidebar-first"),ref:w,children:[X.jsx("div",{className:"split-view-main",children:m}),!l&&X.jsx("div",{style:{flexBasis:M},className:"split-view-sidebar",children:h}),!l&&X.jsx("div",{style:R,className:"split-view-resizer",onMouseDown:K=>x({offset:s==="vertical"?K.clientY:K.clientX,size:M}),onMouseUp:()=>x(null),onMouseMove:K=>{if(!K.buttons)x(null);else if(E){const Z=(s==="vertical"?K.clientY:K.clientX)-E.offset,W=a?E.size+Z:E.size-Z,V=K.target.parentElement.getBoundingClientRect(),U=Math.min(Math.max(c,W),(s==="vertical"?V.height:V.width)-c);s==="vertical"?O(U*window.devicePixelRatio):b(U*window.devicePixelRatio)}}})]})},xg=({noShadow:u,children:l,noMinHeight:a,className:s,sidebarBackground:c,onClick:o})=>X.jsx("div",{className:Ol("toolbar",u&&"no-shadow",a&&"no-min-height",s,c&&"toolbar-sidebar-background"),onClick:o,children:l}),W1=({tabs:u,selectedTab:l,setSelectedTab:a,leftToolbar:s,rightToolbar:c,dataTestId:o,mode:h})=>{const m=he.useId(),p=he.useRef(null);l||(l=u[0].id),h||(h="default");const g=b=>{var x;const v=Array.from(((x=p.current)==null?void 0:x.querySelectorAll('[role="tab"]'))??[]),O=v.findIndex(S=>S===document.activeElement);if(O===-1)return;let E=O;if(b.key==="ArrowRight")E=(O+1)%v.length;else if(b.key==="ArrowLeft")E=(O-1+v.length)%v.length;else if(b.key==="Home")E=0;else if(b.key==="End")E=v.length-1;else return;b.preventDefault(),v[E].focus(),a==null||a(u[E].id)};return X.jsx("div",{className:"tabbed-pane","data-testid":o,children:X.jsxs("div",{className:"vbox",children:[X.jsxs(xg,{children:[s&&X.jsxs("div",{style:{flex:"none",display:"flex",margin:"0 4px",alignItems:"center"},children:[...s]}),h==="default"&&X.jsx("div",{style:{flex:"auto",display:"flex",height:"100%",overflow:"hidden"},role:"tablist",onKeyDown:g,ref:p,children:[...u.map(b=>X.jsx(I1,{id:b.id,ariaControls:`${m}-${b.id}`,title:b.title,count:b.count,errorCount:b.errorCount,selected:l===b.id,onSelect:a,tabIndex:l===b.id?0:-1},b.id))]}),h==="select"&&X.jsx("div",{style:{flex:"auto",display:"flex",height:"100%",overflow:"hidden"},role:"tablist",children:X.jsx("select",{style:{width:"100%",background:"none",cursor:"pointer"},value:l,onChange:b=>{a==null||a(u[b.currentTarget.selectedIndex].id)},children:u.map(b=>{let v="";return b.count&&(v=` (${b.count})`),b.errorCount&&(v=` (${b.errorCount})`),X.jsxs("option",{value:b.id,role:"tab","aria-controls":`${m}-${b.id}`,children:[b.title,v]},b.id)})})}),c&&X.jsxs("div",{style:{flex:"none",display:"flex",alignItems:"center"},children:[...c]})]}),u.map(b=>{const v="tab-content tab-"+b.id;if(b.component)return X.jsx("div",{id:`${m}-${b.id}`,role:"tabpanel","aria-label":b.title,className:v,style:{display:l===b.id?"inherit":"none"},children:b.component},b.id);if(l===b.id)return X.jsx("div",{id:`${m}-${b.id}`,role:"tabpanel","aria-label":b.title,className:v,children:b.render()},b.id)})]})})},I1=({id:u,title:l,count:a,errorCount:s,selected:c,onSelect:o,ariaControls:h,tabIndex:m})=>X.jsxs("div",{className:Ol("tabbed-pane-tab",c&&"selected"),onClick:()=>o==null?void 0:o(u),role:"tab",title:l,tabIndex:m??(c?0:-1),"aria-controls":h,"aria-selected":c,children:[X.jsx("div",{className:"tabbed-pane-tab-label",children:l}),!!a&&X.jsx("div",{className:"tabbed-pane-tab-counter",children:a}),!!s&&X.jsx("div",{className:"tabbed-pane-tab-counter error",children:s})]}),F1=({sources:u,fileId:l,setFileId:a})=>X.jsx("select",{className:"source-chooser",hidden:!u.length,title:"Source chooser",value:l,onChange:s=>{a(s.target.selectedOptions[0].value)},children:P1(u)});function P1(u){const l=c=>c.replace(/.*[/\\]([^/\\]+)/,"$1"),a=c=>X.jsx("option",{value:c.id,children:l(c.label)},c.id),s=new Map;for(const c of u){let o=s.get(c.group||"Debugger");o||(o=[],s.set(c.group||"Debugger",o)),o.push(c)}return[...s.entries()].map(([c,o])=>X.jsx("optgroup",{label:c,children:o.filter(h=>(h.group||"Debugger")===c).map(h=>a(h))},c))}function ev(){return{id:"default",isRecorded:!1,text:"",language:"javascript",label:"",highlight:[]}}const Dt=he.forwardRef(function({children:l,title:a="",icon:s,disabled:c=!1,toggled:o=!1,onClick:h=()=>{},style:m,testId:p,className:g,ariaLabel:b,errorBadge:v},O){const E=he.useId();return X.jsxs("button",{ref:O,className:Ol(g,"toolbar-button",s,o&&"toggled"),onMouseDown:dg,onClick:h,onDoubleClick:dg,title:a,disabled:!!c,style:m,"data-testid":p,"aria-label":b||a,"aria-describedby":v?E:void 0,children:[s&&X.jsx("span",{className:`codicon codicon-${s}`,style:l?{marginRight:5}:{}}),l,v&&X.jsx("span",{id:E,className:"toolbar-button-error-badge",title:v,"aria-label":v})]})}),hg=({style:u})=>X.jsx("div",{className:"toolbar-separator",style:u}),dg=u=>{u.stopPropagation(),u.preventDefault()};function tv(u){if(u<0||!isFinite(u))return"-";if(u===0)return"0ms";if(u<1e3)return u.toFixed(0)+"ms";const l=u/1e3;if(l<60)return l.toFixed(1)+"s";const a=l/60;if(a<60)return a.toFixed(1)+"m";const s=a/60;return s<24?s.toFixed(1)+"h":(s/24).toFixed(1)+"d"}const We=function(u,l,a){return u>=l&&u<=a};function bt(u){return We(u,48,57)}function mg(u){return bt(u)||We(u,65,70)||We(u,97,102)}function nv(u){return We(u,65,90)}function lv(u){return We(u,97,122)}function iv(u){return nv(u)||lv(u)}function av(u){return u>=128}function uu(u){return iv(u)||av(u)||u===95}function gg(u){return uu(u)||bt(u)||u===45}function sv(u){return We(u,0,8)||u===11||We(u,14,31)||u===127}function cu(u){return u===10}function En(u){return cu(u)||u===9||u===32}const uv=1114111;class Df extends Error{constructor(l){super(l),this.name="InvalidCharacterError"}}function cv(u){const l=[];for(let a=0;a<u.length;a++){let s=u.charCodeAt(a);if(s===13&&u.charCodeAt(a+1)===10&&(s=10,a++),(s===13||s===12)&&(s=10),s===0&&(s=65533),We(s,55296,56319)&&We(u.charCodeAt(a+1),56320,57343)){const c=s-55296,o=u.charCodeAt(a+1)-56320;s=Math.pow(2,16)+c*Math.pow(2,10)+o,a++}l.push(s)}return l}function Fe(u){if(u<=65535)return String.fromCharCode(u);u-=Math.pow(2,16);const l=Math.floor(u/Math.pow(2,10))+55296,a=u%Math.pow(2,10)+56320;return String.fromCharCode(l)+String.fromCharCode(a)}function rv(u){const l=cv(u);let a=-1;const s=[];let c;const o=function($){return $>=l.length?-1:l[$]},h=function($){if($===void 0&&($=1),$>3)throw"Spec Error: no more than three codepoints of lookahead.";return o(a+$)},m=function($){return $===void 0&&($=1),a+=$,c=o(a),!0},p=function(){return a-=1,!0},g=function($){return $===void 0&&($=c),$===-1},b=function(){if(v(),m(),En(c)){for(;En(h());)m();return new wf}else{if(c===34)return x();if(c===35)if(gg(h())||M(h(1),h(2))){const $=new Qg("");return K(h(1),h(2),h(3))&&($.type="id"),$.value=k(),$}else return new ut(c);else return c===36?h()===61?(m(),new dv):new ut(c):c===39?x():c===40?new Yg:c===41?new $g:c===42?h()===61?(m(),new mv):new ut(c):c===43?W()?(p(),O()):new ut(c):c===44?new Bg:c===45?W()?(p(),O()):h(1)===45&&h(2)===62?(m(2),new Ug):Q()?(p(),E()):new ut(c):c===46?W()?(p(),O()):new ut(c):c===58?new Rg:c===59?new jg:c===60?h(1)===33&&h(2)===45&&h(3)===45?(m(3),new Lg):new ut(c):c===64?K(h(1),h(2),h(3))?new Vg(k()):new ut(c):c===91?new Hg:c===92?R()?(p(),E()):new ut(c):c===93?new Af:c===94?h()===61?(m(),new hv):new ut(c):c===123?new kg:c===124?h()===61?(m(),new ov):h()===124?(m(),new Kg):new ut(c):c===125?new qg:c===126?h()===61?(m(),new fv):new ut(c):bt(c)?(p(),O()):uu(c)?(p(),E()):g()?new fu:new ut(c)}},v=function(){for(;h(1)===47&&h(2)===42;)for(m(2);;)if(m(),c===42&&h()===47){m();break}else if(g())return},O=function(){const $=V();if(K(h(1),h(2),h(3))){const ee=new gv;return ee.value=$.value,ee.repr=$.repr,ee.type=$.type,ee.unit=k(),ee}else if(h()===37){m();const ee=new Wg;return ee.value=$.value,ee.repr=$.repr,ee}else{const ee=new Jg;return ee.value=$.value,ee.repr=$.repr,ee.type=$.type,ee}},E=function(){const $=k();if($.toLowerCase()==="url"&&h()===40){for(m();En(h(1))&&En(h(2));)m();return h()===34||h()===39?new ou($):En(h())&&(h(2)===34||h(2)===39)?new ou($):S()}else return h()===40?(m(),new ou($)):new Gg($)},x=function($){$===void 0&&($=c);let ee="";for(;m();){if(c===$||g())return new Xg(ee);if(cu(c))return p(),new Dg;c===92?g(h())||(cu(h())?m():ee+=Fe(w())):ee+=Fe(c)}throw new Error("Internal error")},S=function(){const $=new Zg("");for(;En(h());)m();if(g(h()))return $;for(;m();){if(c===41||g())return $;if(En(c)){for(;En(h());)m();return h()===41||g(h())?(m(),$):(ae(),new ru)}else{if(c===34||c===39||c===40||sv(c))return ae(),new ru;if(c===92)if(R())$.value+=Fe(w());else return ae(),new ru;else $.value+=Fe(c)}}throw new Error("Internal error")},w=function(){if(m(),mg(c)){const $=[c];for(let we=0;we<5&&mg(h());we++)m(),$.push(c);En(h())&&m();let ee=parseInt($.map(function(we){return String.fromCharCode(we)}).join(""),16);return ee>uv&&(ee=65533),ee}else return g()?65533:c},M=function($,ee){return!($!==92||cu(ee))},R=function(){return M(c,h())},K=function($,ee,we){return $===45?uu(ee)||ee===45||M(ee,we):uu($)?!0:$===92?M($,ee):!1},Q=function(){return K(c,h(1),h(2))},Z=function($,ee,we){return $===43||$===45?!!(bt(ee)||ee===46&&bt(we)):$===46?!!bt(ee):!!bt($)},W=function(){return Z(c,h(1),h(2))},k=function(){let $="";for(;m();)if(gg(c))$+=Fe(c);else if(R())$+=Fe(w());else return p(),$;throw new Error("Internal parse error")},V=function(){let $="",ee="integer";for((h()===43||h()===45)&&(m(),$+=Fe(c));bt(h());)m(),$+=Fe(c);if(h(1)===46&&bt(h(2)))for(m(),$+=Fe(c),m(),$+=Fe(c),ee="number";bt(h());)m(),$+=Fe(c);const we=h(1),se=h(2),D=h(3);if((we===69||we===101)&&bt(se))for(m(),$+=Fe(c),m(),$+=Fe(c),ee="number";bt(h());)m(),$+=Fe(c);else if((we===69||we===101)&&(se===43||se===45)&&bt(D))for(m(),$+=Fe(c),m(),$+=Fe(c),m(),$+=Fe(c),ee="number";bt(h());)m(),$+=Fe(c);const G=U($);return{type:ee,value:G,repr:$}},U=function($){return+$},ae=function(){for(;m();){if(c===41||g())return;R()&&w()}};let te=0;for(;!g(h());)if(s.push(b()),te++,te>l.length*2)throw new Error("I'm infinite-looping!");return s}class Ve{constructor(){this.tokenType=""}toJSON(){return{token:this.tokenType}}toString(){return this.tokenType}toSource(){return""+this}}class Dg extends Ve{constructor(){super(...arguments),this.tokenType="BADSTRING"}}class ru extends Ve{constructor(){super(...arguments),this.tokenType="BADURL"}}class wf extends Ve{constructor(){super(...arguments),this.tokenType="WHITESPACE"}toString(){return"WS"}toSource(){return" "}}class Lg extends Ve{constructor(){super(...arguments),this.tokenType="CDO"}toSource(){return"<!--"}}class Ug extends Ve{constructor(){super(...arguments),this.tokenType="CDC"}toSource(){return"-->"}}class Rg extends Ve{constructor(){super(...arguments),this.tokenType=":"}}class jg extends Ve{constructor(){super(...arguments),this.tokenType=";"}}class Bg extends Ve{constructor(){super(...arguments),this.tokenType=","}}class Ai extends Ve{constructor(){super(...arguments),this.value="",this.mirror=""}}class kg extends Ai{constructor(){super(),this.tokenType="{",this.value="{",this.mirror="}"}}class qg extends Ai{constructor(){super(),this.tokenType="}",this.value="}",this.mirror="{"}}class Hg extends Ai{constructor(){super(),this.tokenType="[",this.value="[",this.mirror="]"}}class Af extends Ai{constructor(){super(),this.tokenType="]",this.value="]",this.mirror="["}}class Yg extends Ai{constructor(){super(),this.tokenType="(",this.value="(",this.mirror=")"}}class $g extends Ai{constructor(){super(),this.tokenType=")",this.value=")",this.mirror="("}}class fv extends Ve{constructor(){super(...arguments),this.tokenType="~="}}class ov extends Ve{constructor(){super(...arguments),this.tokenType="|="}}class hv extends Ve{constructor(){super(...arguments),this.tokenType="^="}}class dv extends Ve{constructor(){super(...arguments),this.tokenType="$="}}class mv extends Ve{constructor(){super(...arguments),this.tokenType="*="}}class Kg extends Ve{constructor(){super(...arguments),this.tokenType="||"}}class fu extends Ve{constructor(){super(...arguments),this.tokenType="EOF"}toSource(){return""}}class ut extends Ve{constructor(l){super(),this.tokenType="DELIM",this.value="",this.value=Fe(l)}toString(){return"DELIM("+this.value+")"}toJSON(){const l=this.constructor.prototype.constructor.prototype.toJSON.call(this);return l.value=this.value,l}toSource(){return this.value==="\\"?`\\
`:this.value}}class Oi extends Ve{constructor(){super(...arguments),this.value=""}ASCIIMatch(l){return this.value.toLowerCase()===l.toLowerCase()}toJSON(){const l=this.constructor.prototype.constructor.prototype.toJSON.call(this);return l.value=this.value,l}}class Gg extends Oi{constructor(l){super(),this.tokenType="IDENT",this.value=l}toString(){return"IDENT("+this.value+")"}toSource(){return Ua(this.value)}}class ou extends Oi{constructor(l){super(),this.tokenType="FUNCTION",this.value=l,this.mirror=")"}toString(){return"FUNCTION("+this.value+")"}toSource(){return Ua(this.value)+"("}}class Vg extends Oi{constructor(l){super(),this.tokenType="AT-KEYWORD",this.value=l}toString(){return"AT("+this.value+")"}toSource(){return"@"+Ua(this.value)}}class Qg extends Oi{constructor(l){super(),this.tokenType="HASH",this.value=l,this.type="unrestricted"}toString(){return"HASH("+this.value+")"}toJSON(){const l=this.constructor.prototype.constructor.prototype.toJSON.call(this);return l.value=this.value,l.type=this.type,l}toSource(){return this.type==="id"?"#"+Ua(this.value):"#"+pv(this.value)}}class Xg extends Oi{constructor(l){super(),this.tokenType="STRING",this.value=l}toString(){return'"'+Ig(this.value)+'"'}}class Zg extends Oi{constructor(l){super(),this.tokenType="URL",this.value=l}toString(){return"URL("+this.value+")"}toSource(){return'url("'+Ig(this.value)+'")'}}class Jg extends Ve{constructor(){super(),this.tokenType="NUMBER",this.type="integer",this.repr=""}toString(){return this.type==="integer"?"INT("+this.value+")":"NUMBER("+this.value+")"}toJSON(){const l=super.toJSON();return l.value=this.value,l.type=this.type,l.repr=this.repr,l}toSource(){return this.repr}}class Wg extends Ve{constructor(){super(),this.tokenType="PERCENTAGE",this.repr=""}toString(){return"PERCENTAGE("+this.value+")"}toJSON(){const l=this.constructor.prototype.constructor.prototype.toJSON.call(this);return l.value=this.value,l.repr=this.repr,l}toSource(){return this.repr+"%"}}class gv extends Ve{constructor(){super(),this.tokenType="DIMENSION",this.type="integer",this.repr="",this.unit=""}toString(){return"DIM("+this.value+","+this.unit+")"}toJSON(){const l=this.constructor.prototype.constructor.prototype.toJSON.call(this);return l.value=this.value,l.type=this.type,l.repr=this.repr,l.unit=this.unit,l}toSource(){const l=this.repr;let a=Ua(this.unit);return a[0].toLowerCase()==="e"&&(a[1]==="-"||We(a.charCodeAt(1),48,57))&&(a="\\65 "+a.slice(1,a.length)),l+a}}function Ua(u){u=""+u;let l="";const a=u.charCodeAt(0);for(let s=0;s<u.length;s++){const c=u.charCodeAt(s);if(c===0)throw new Df("Invalid character: the input contains U+0000.");We(c,1,31)||c===127||s===0&&We(c,48,57)||s===1&&We(c,48,57)&&a===45?l+="\\"+c.toString(16)+" ":c>=128||c===45||c===95||We(c,48,57)||We(c,65,90)||We(c,97,122)?l+=u[s]:l+="\\"+u[s]}return l}function pv(u){u=""+u;let l="";for(let a=0;a<u.length;a++){const s=u.charCodeAt(a);if(s===0)throw new Df("Invalid character: the input contains U+0000.");s>=128||s===45||s===95||We(s,48,57)||We(s,65,90)||We(s,97,122)?l+=u[a]:l+="\\"+s.toString(16)+" "}return l}function Ig(u){u=""+u;let l="";for(let a=0;a<u.length;a++){const s=u.charCodeAt(a);if(s===0)throw new Df("Invalid character: the input contains U+0000.");We(s,1,31)||s===127?l+="\\"+s.toString(16)+" ":s===34||s===92?l+="\\"+u[a]:l+=u[a]}return l}class St extends Error{}function yv(u,l){let a;try{a=rv(u),a[a.length-1]instanceof fu||a.push(new fu)}catch(U){const ae=U.message+` while parsing css selector "${u}". Did you mean to CSS.escape it?`,te=(U.stack||"").indexOf(U.message);throw te!==-1&&(U.stack=U.stack.substring(0,te)+ae+U.stack.substring(te+U.message.length)),U.message=ae,U}const s=a.find(U=>U instanceof Vg||U instanceof Dg||U instanceof ru||U instanceof Kg||U instanceof Lg||U instanceof Ug||U instanceof jg||U instanceof kg||U instanceof qg||U instanceof Zg||U instanceof Wg);if(s)throw new St(`Unsupported token "${s.toSource()}" while parsing css selector "${u}". Did you mean to CSS.escape it?`);let c=0;const o=new Set;function h(){return new St(`Unexpected token "${a[c].toSource()}" while parsing css selector "${u}". Did you mean to CSS.escape it?`)}function m(){for(;a[c]instanceof wf;)c++}function p(U=c){return a[U]instanceof Gg}function g(U=c){return a[U]instanceof Xg}function b(U=c){return a[U]instanceof Jg}function v(U=c){return a[U]instanceof Bg}function O(U=c){return a[U]instanceof Yg}function E(U=c){return a[U]instanceof $g}function x(U=c){return a[U]instanceof ou}function S(U=c){return a[U]instanceof ut&&a[U].value==="*"}function w(U=c){return a[U]instanceof fu}function M(U=c){return a[U]instanceof ut&&[">","+","~"].includes(a[U].value)}function R(U=c){return v(U)||E(U)||w(U)||M(U)||a[U]instanceof wf}function K(){const U=[Q()];for(;m(),!!v();)c++,U.push(Q());return U}function Q(){return m(),b()||g()?a[c++].value:Z()}function Z(){const U={simples:[]};for(m(),M()?U.simples.push({selector:{functions:[{name:"scope",args:[]}]},combinator:""}):U.simples.push({selector:W(),combinator:""});;){if(m(),M())U.simples[U.simples.length-1].combinator=a[c++].value,m();else if(R())break;U.simples.push({combinator:"",selector:W()})}return U}function W(){let U="";const ae=[];for(;!R();)if(p()||S())U+=a[c++].toSource();else if(a[c]instanceof Qg)U+=a[c++].toSource();else if(a[c]instanceof ut&&a[c].value===".")if(c++,p())U+="."+a[c++].toSource();else throw h();else if(a[c]instanceof Rg)if(c++,p())if(!l.has(a[c].value.toLowerCase()))U+=":"+a[c++].toSource();else{const te=a[c++].value.toLowerCase();ae.push({name:te,args:[]}),o.add(te)}else if(x()){const te=a[c++].value.toLowerCase();if(l.has(te)?(ae.push({name:te,args:K()}),o.add(te)):U+=`:${te}(${k()})`,m(),!E())throw h();c++}else throw h();else if(a[c]instanceof Hg){for(U+="[",c++;!(a[c]instanceof Af)&&!w();)U+=a[c++].toSource();if(!(a[c]instanceof Af))throw h();U+="]",c++}else throw h();if(!U&&!ae.length)throw h();return{css:U||void 0,functions:ae}}function k(){let U="",ae=1;for(;!w()&&((O()||x())&&ae++,E()&&ae--,!!ae);)U+=a[c++].toSource();return U}const V=K();if(!w())throw h();if(V.some(U=>typeof U!="object"||!("simples"in U)))throw new St(`Error while parsing css selector "${u}". Did you mean to CSS.escape it?`);return{selector:V,names:Array.from(o)}}const pg=new Set(["internal:has","internal:has-not","internal:and","internal:or","internal:chain","left-of","right-of","above","below","near"]),vv=new Set(["left-of","right-of","above","below","near"]),bv=new Set(["not","is","where","has","scope","light","visible","text","text-matches","text-is","has-text","above","below","right-of","left-of","near","nth-match"]);function Fg(u){const l=Tv(u),a=[];for(const s of l.parts){if(s.name==="css"||s.name==="css:light"){s.name==="css:light"&&(s.body=":light("+s.body+")");const c=yv(s.body,bv);a.push({name:"css",body:c.selector,source:s.body});continue}if(pg.has(s.name)){let c,o;try{const g=JSON.parse("["+s.body+"]");if(!Array.isArray(g)||g.length<1||g.length>2||typeof g[0]!="string")throw new St(`Malformed selector: ${s.name}=`+s.body);if(c=g[0],g.length===2){if(typeof g[1]!="number"||!vv.has(s.name))throw new St(`Malformed selector: ${s.name}=`+s.body);o=g[1]}}catch{throw new St(`Malformed selector: ${s.name}=`+s.body)}const h={name:s.name,source:s.body,body:{parsed:Fg(c),distance:o}},m=[...h.body.parsed.parts].reverse().find(g=>g.name==="internal:control"&&g.body==="enter-frame"),p=m?h.body.parsed.parts.indexOf(m):-1;p!==-1&&Sv(h.body.parsed.parts.slice(0,p+1),a.slice(0,p+1))&&h.body.parsed.parts.splice(0,p+1),a.push(h);continue}a.push({...s,source:s.body})}if(pg.has(a[0].name))throw new St(`"${a[0].name}" selector cannot be first`);return{capture:l.capture,parts:a}}function Sv(u,l){return In({parts:u})===In({parts:l})}function In(u,l){return typeof u=="string"?u:u.parts.map((a,s)=>{let c=!0;!l&&s!==u.capture&&(a.name==="css"||a.name==="xpath"&&a.source.startsWith("//")||a.source.startsWith(".."))&&(c=!1);const o=c?a.name+"=":"";return`${s===u.capture?"*":""}${o}${a.source}`}).join(" >> ")}function Tv(u){let l=0,a,s=0;const c={parts:[]},o=()=>{const m=u.substring(s,l).trim(),p=m.indexOf("=");let g,b;p!==-1&&m.substring(0,p).trim().match(/^[a-zA-Z_0-9-+:*]+$/)?(g=m.substring(0,p).trim(),b=m.substring(p+1)):m.length>1&&m[0]==='"'&&m[m.length-1]==='"'||m.length>1&&m[0]==="'"&&m[m.length-1]==="'"?(g="text",b=m):/^\(*\/\//.test(m)||m.startsWith("..")?(g="xpath",b=m):(g="css",b=m);let v=!1;if(g[0]==="*"&&(v=!0,g=g.substring(1)),c.parts.push({name:g,body:b}),v){if(c.capture!==void 0)throw new St("Only one of the selectors can capture using * modifier");c.capture=c.parts.length-1}};if(!u.includes(">>"))return l=u.length,o(),c;const h=()=>{const p=u.substring(s,l).match(/^\s*text\s*=(.*)$/);return!!p&&!!p[1]};for(;l<u.length;){const m=u[l];m==="\\"&&l+1<u.length?l+=2:m===a?(a=void 0,l++):!a&&(m==='"'||m==="'"||m==="`")&&!h()?(a=m,l++):!a&&m===">"&&u[l+1]===">"?(o(),l+=2,s=l):l++}return o(),c}function of(u,l){let a=0,s=u.length===0;const c=()=>u[a]||"",o=()=>{const w=c();return++a,s=a>=u.length,w},h=w=>{throw s?new St(`Unexpected end of selector while parsing selector \`${u}\``):new St(`Error while parsing selector \`${u}\` - unexpected symbol "${c()}" at position ${a}`+(w?" during "+w:""))};function m(){for(;!s&&/\s/.test(c());)o()}function p(w){return w>="Â€"||w>="0"&&w<="9"||w>="A"&&w<="Z"||w>="a"&&w<="z"||w>="0"&&w<="9"||w==="_"||w==="-"}function g(){let w="";for(m();!s&&p(c());)w+=o();return w}function b(w){let M=o();for(M!==w&&h("parsing quoted string");!s&&c()!==w;)c()==="\\"&&o(),M+=o();return c()!==w&&h("parsing quoted string"),M+=o(),M}function v(){o()!=="/"&&h("parsing regular expression");let w="",M=!1;for(;!s;){if(c()==="\\")w+=o(),s&&h("parsing regular expression");else if(M&&c()==="]")M=!1;else if(!M&&c()==="[")M=!0;else if(!M&&c()==="/")break;w+=o()}o()!=="/"&&h("parsing regular expression");let R="";for(;!s&&c().match(/[dgimsuy]/);)R+=o();try{return new RegExp(w,R)}catch(K){throw new St(`Error while parsing selector \`${u}\`: ${K.message}`)}}function O(){let w="";return m(),c()==="'"||c()==='"'?w=b(c()).slice(1,-1):w=g(),w||h("parsing property path"),w}function E(){m();let w="";return s||(w+=o()),!s&&w!=="="&&(w+=o()),["=","*=","^=","$=","|=","~="].includes(w)||h("parsing operator"),w}function x(){o();const w=[];for(w.push(O()),m();c()===".";)o(),w.push(O()),m();if(c()==="]")return o(),{name:w.join("."),jsonPath:w,op:"<truthy>",value:null,caseSensitive:!1};const M=E();let R,K=!0;if(m(),c()==="/"){if(M!=="=")throw new St(`Error while parsing selector \`${u}\` - cannot use ${M} in attribute with regular expression`);R=v()}else if(c()==="'"||c()==='"')R=b(c()).slice(1,-1),m(),c()==="i"||c()==="I"?(K=!1,o()):(c()==="s"||c()==="S")&&(K=!0,o());else{for(R="";!s&&(p(c())||c()==="+"||c()===".");)R+=o();R==="true"?R=!0:R==="false"&&(R=!1)}if(m(),c()!=="]"&&h("parsing attribute value"),o(),M!=="="&&typeof R!="string")throw new St(`Error while parsing selector \`${u}\` - cannot use ${M} in attribute with non-string matching value - ${R}`);return{name:w.join("."),jsonPath:w,op:M,value:R,caseSensitive:K}}const S={name:"",attributes:[]};for(S.name=g(),m();c()==="[";)S.attributes.push(x()),m();if(s||h(void 0),!S.name&&!S.attributes.length)throw new St(`Error while parsing selector \`${u}\` - selector cannot be empty`);return S}function wu(u,l="'"){const a=JSON.stringify(u),s=a.substring(1,a.length-1).replace(/\\"/g,'"');if(l==="'")return l+s.replace(/[']/g,"\\'")+l;if(l==='"')return l+s.replace(/["]/g,'\\"')+l;if(l==="`")return l+s.replace(/[`]/g,"\\`")+l;throw new Error("Invalid escape char")}function yu(u){return u.charAt(0).toUpperCase()+u.substring(1)}function Pg(u){return u.replace(/([a-z0-9])([A-Z])/g,"$1_$2").replace(/([A-Z])([A-Z][a-z])/g,"$1_$2").toLowerCase()}function Au(u){return u.replace(/(^|[^\\])(\\\\)*\\(['"`])/g,"$1$2$3")}function ep(u,l,a=!1){return Ev(u,l,a,1)[0]}function Ev(u,l,a=!1,s=20,c){try{return gi(new Cv[u](c),Fg(l),a,s)}catch{return[l]}}function gi(u,l,a=!1,s=20){const c=[...l.parts],o=[];let h=a?"frame-locator":"page";for(let m=0;m<c.length;m++){const p=c[m],g=h;if(h="locator",p.name==="internal:describe")continue;if(p.name==="nth"){p.body==="0"?o.push([u.generateLocator(g,"first",""),u.generateLocator(g,"nth","0")]):p.body==="-1"?o.push([u.generateLocator(g,"last",""),u.generateLocator(g,"nth","-1")]):o.push([u.generateLocator(g,"nth",p.body)]);continue}if(p.name==="visible"){o.push([u.generateLocator(g,"visible",p.body),u.generateLocator(g,"default",`visible=${p.body}`)]);continue}if(p.name==="internal:text"){const{exact:x,text:S}=Na(p.body);o.push([u.generateLocator(g,"text",S,{exact:x})]);continue}if(p.name==="internal:has-text"){const{exact:x,text:S}=Na(p.body);if(!x){o.push([u.generateLocator(g,"has-text",S,{exact:x})]);continue}}if(p.name==="internal:has-not-text"){const{exact:x,text:S}=Na(p.body);if(!x){o.push([u.generateLocator(g,"has-not-text",S,{exact:x})]);continue}}if(p.name==="internal:has"){const x=gi(u,p.body.parsed,!1,s);o.push(x.map(S=>u.generateLocator(g,"has",S)));continue}if(p.name==="internal:has-not"){const x=gi(u,p.body.parsed,!1,s);o.push(x.map(S=>u.generateLocator(g,"hasNot",S)));continue}if(p.name==="internal:and"){const x=gi(u,p.body.parsed,!1,s);o.push(x.map(S=>u.generateLocator(g,"and",S)));continue}if(p.name==="internal:or"){const x=gi(u,p.body.parsed,!1,s);o.push(x.map(S=>u.generateLocator(g,"or",S)));continue}if(p.name==="internal:chain"){const x=gi(u,p.body.parsed,!1,s);o.push(x.map(S=>u.generateLocator(g,"chain",S)));continue}if(p.name==="internal:label"){const{exact:x,text:S}=Na(p.body);o.push([u.generateLocator(g,"label",S,{exact:x})]);continue}if(p.name==="internal:role"){const x=of(p.body),S={attrs:[]};for(const w of x.attributes)if(w.name==="name"){if(S.exact!==void 0&&S.exact!==w.caseSensitive)throw new Error(`Conflicting exactness in internal:role selector: ${In({parts:[p]})}`);S.exact=w.caseSensitive,S.name=w.value}else if(w.name==="description"){if(S.exact!==void 0&&S.exact!==w.caseSensitive)throw new Error(`Conflicting exactness in internal:role selector: ${In({parts:[p]})}`);S.exact=w.caseSensitive,S.description=w.value}else w.name==="level"&&typeof w.value=="string"&&(w.value=+w.value),S.attrs.push({name:w.name==="include-hidden"?"includeHidden":w.name,value:w.value});o.push([u.generateLocator(g,"role",x.name,S)]);continue}if(p.name==="internal:testid"){const x=of(p.body),{value:S}=x.attributes[0];o.push([u.generateLocator(g,"test-id",S)]);continue}if(p.name==="internal:attr"){const x=of(p.body),{name:S,value:w,caseSensitive:M}=x.attributes[0],R=w,K=!!M;if(S==="placeholder"){o.push([u.generateLocator(g,"placeholder",R,{exact:K})]);continue}if(S==="alt"){o.push([u.generateLocator(g,"alt",R,{exact:K})]);continue}if(S==="title"){o.push([u.generateLocator(g,"title",R,{exact:K})]);continue}}if(p.name==="internal:control"&&p.body==="enter-frame"){const x=o[o.length-1],S=c[m-1],w=x.map(M=>u.chainLocators([M,u.generateLocator(g,"frame","")]));["xpath","css"].includes(S.name)&&w.push(u.generateLocator(g,"frame-locator",In({parts:[S]})),u.generateLocator(g,"frame-locator",In({parts:[S]},!0))),x.splice(0,x.length,...w),h="frame-locator";continue}const b=c[m+1],v=In({parts:[p]}),O=u.generateLocator(g,"default",v);if(b&&["internal:has-text","internal:has-not-text"].includes(b.name)){const{exact:x,text:S}=Na(b.body);if(!x){const w=u.generateLocator("locator",b.name==="internal:has-text"?"has-text":"has-not-text",S,{exact:x}),M={};b.name==="internal:has-text"?M.hasText=S:M.hasNotText=S;const R=u.generateLocator(g,"default",v,M);o.push([u.chainLocators([O,w]),R]),m++;continue}}let E;if(["xpath","css"].includes(p.name)){const x=In({parts:[p]},!0);E=u.generateLocator(g,"default",x)}o.push([O,E].filter(Boolean))}return wv(u,o,s)}function wv(u,l,a){const s=l.map(()=>""),c=[],o=h=>{if(h===l.length)return c.push(u.chainLocators(s)),c.length<a;for(const m of l[h])if(s[h]=m,!o(h+1))return!1;return!0};return o(0),c}function Na(u){let l=!1;const a=u.match(/^\/(.*)\/([igm]*)$/);return a?{text:new RegExp(a[1],a[2])}:(u.endsWith('"')?(u=JSON.parse(u),l=!0):u.endsWith('"s')?(u=JSON.parse(u.substring(0,u.length-1)),l=!0):u.endsWith('"i')&&(u=JSON.parse(u.substring(0,u.length-1)),l=!1),{exact:l,text:u})}class Av{constructor(l){this.preferredQuote=l}generateLocator(l,a,s,c={}){switch(a){case"default":return c.hasText!==void 0?`locator(${this.quote(s)}, { hasText: ${this.toHasText(c.hasText)} })`:c.hasNotText!==void 0?`locator(${this.quote(s)}, { hasNotText: ${this.toHasText(c.hasNotText)} })`:`locator(${this.quote(s)})`;case"frame-locator":return`frameLocator(${this.quote(s)})`;case"frame":return"contentFrame()";case"nth":return`nth(${s})`;case"first":return"first()";case"last":return"last()";case"visible":return`filter({ visible: ${s==="true"?"true":"false"} })`;case"role":const o=[];Ge(c.name)?o.push(`name: ${this.regexToSourceString(c.name)}`):typeof c.name=="string"&&o.push(`name: ${this.quote(c.name)}`),Ge(c.description)?o.push(`description: ${this.regexToSourceString(c.description)}`):typeof c.description=="string"&&o.push(`description: ${this.quote(c.description)}`),c.exact&&(typeof c.name=="string"||typeof c.description=="string")&&o.push("exact: true");for(const{name:m,value:p}of c.attrs)o.push(`${m}: ${typeof p=="string"?this.quote(p):p}`);const h=o.length?`, { ${o.join(", ")} }`:"";return`getByRole(${this.quote(s)}${h})`;case"has-text":return`filter({ hasText: ${this.toHasText(s)} })`;case"has-not-text":return`filter({ hasNotText: ${this.toHasText(s)} })`;case"has":return`filter({ has: ${s} })`;case"hasNot":return`filter({ hasNot: ${s} })`;case"and":return`and(${s})`;case"or":return`or(${s})`;case"chain":return`locator(${s})`;case"test-id":return`getByTestId(${this.toTestIdValue(s)})`;case"text":return this.toCallWithExact("getByText",s,!!c.exact);case"alt":return this.toCallWithExact("getByAltText",s,!!c.exact);case"placeholder":return this.toCallWithExact("getByPlaceholder",s,!!c.exact);case"label":return this.toCallWithExact("getByLabel",s,!!c.exact);case"title":return this.toCallWithExact("getByTitle",s,!!c.exact);default:throw new Error("Unknown selector kind "+a)}}chainLocators(l){return l.join(".")}regexToSourceString(l){return Au(String(l))}toCallWithExact(l,a,s){return Ge(a)?`${l}(${this.regexToSourceString(a)})`:s?`${l}(${this.quote(a)}, { exact: true })`:`${l}(${this.quote(a)})`}toHasText(l){return Ge(l)?this.regexToSourceString(l):this.quote(l)}toTestIdValue(l){return Ge(l)?this.regexToSourceString(l):this.quote(l)}quote(l){return wu(l,this.preferredQuote??"'")}}class Ov{generateLocator(l,a,s,c={}){switch(a){case"default":return c.hasText!==void 0?`locator(${this.quote(s)}, has_text=${this.toHasText(c.hasText)})`:c.hasNotText!==void 0?`locator(${this.quote(s)}, has_not_text=${this.toHasText(c.hasNotText)})`:`locator(${this.quote(s)})`;case"frame-locator":return`frame_locator(${this.quote(s)})`;case"frame":return"content_frame";case"nth":return`nth(${s})`;case"first":return"first";case"last":return"last";case"visible":return`filter(visible=${s==="true"?"True":"False"})`;case"role":const o=[];Ge(c.name)?o.push(`name=${this.regexToString(c.name)}`):typeof c.name=="string"&&o.push(`name=${this.quote(c.name)}`),Ge(c.description)?o.push(`description=${this.regexToString(c.description)}`):typeof c.description=="string"&&o.push(`description=${this.quote(c.description)}`),c.exact&&(typeof c.name=="string"||typeof c.description=="string")&&o.push("exact=True");for(const{name:m,value:p}of c.attrs){let g=typeof p=="string"?this.quote(p):p;typeof p=="boolean"&&(g=p?"True":"False"),o.push(`${Pg(m)}=${g}`)}const h=o.length?`, ${o.join(", ")}`:"";return`get_by_role(${this.quote(s)}${h})`;case"has-text":return`filter(has_text=${this.toHasText(s)})`;case"has-not-text":return`filter(has_not_text=${this.toHasText(s)})`;case"has":return`filter(has=${s})`;case"hasNot":return`filter(has_not=${s})`;case"and":return`and_(${s})`;case"or":return`or_(${s})`;case"chain":return`locator(${s})`;case"test-id":return`get_by_test_id(${this.toTestIdValue(s)})`;case"text":return this.toCallWithExact("get_by_text",s,!!c.exact);case"alt":return this.toCallWithExact("get_by_alt_text",s,!!c.exact);case"placeholder":return this.toCallWithExact("get_by_placeholder",s,!!c.exact);case"label":return this.toCallWithExact("get_by_label",s,!!c.exact);case"title":return this.toCallWithExact("get_by_title",s,!!c.exact);default:throw new Error("Unknown selector kind "+a)}}chainLocators(l){return l.join(".")}regexToString(l){const a=l.flags.includes("i")?", re.IGNORECASE":"";return`re.compile(r"${Au(l.source).replace(/\\\//,"/").replace(/"/g,'\\"')}"${a})`}toCallWithExact(l,a,s){return Ge(a)?`${l}(${this.regexToString(a)})`:s?`${l}(${this.quote(a)}, exact=True)`:`${l}(${this.quote(a)})`}toHasText(l){return Ge(l)?this.regexToString(l):`${this.quote(l)}`}toTestIdValue(l){return Ge(l)?this.regexToString(l):this.quote(l)}quote(l){return wu(l,'"')}}class _v{generateLocator(l,a,s,c={}){let o;switch(l){case"page":o="Page";break;case"frame-locator":o="FrameLocator";break;case"locator":o="Locator";break}switch(a){case"default":return c.hasText!==void 0?`locator(${this.quote(s)}, new ${o}.LocatorOptions().setHasText(${this.toHasText(c.hasText)}))`:c.hasNotText!==void 0?`locator(${this.quote(s)}, new ${o}.LocatorOptions().setHasNotText(${this.toHasText(c.hasNotText)}))`:`locator(${this.quote(s)})`;case"frame-locator":return`frameLocator(${this.quote(s)})`;case"frame":return"contentFrame()";case"nth":return`nth(${s})`;case"first":return"first()";case"last":return"last()";case"visible":return`filter(new ${o}.FilterOptions().setVisible(${s==="true"?"true":"false"}))`;case"role":const h=[];Ge(c.name)?h.push(`.setName(${this.regexToString(c.name)})`):typeof c.name=="string"&&h.push(`.setName(${this.quote(c.name)})`),Ge(c.description)?h.push(`.setDescription(${this.regexToString(c.description)})`):typeof c.description=="string"&&h.push(`.setDescription(${this.quote(c.description)})`),c.exact&&(typeof c.name=="string"||typeof c.description=="string")&&h.push(".setExact(true)");for(const{name:p,value:g}of c.attrs)h.push(`.set${yu(p)}(${typeof g=="string"?this.quote(g):g})`);const m=h.length?`, new ${o}.GetByRoleOptions()${h.join("")}`:"";return`getByRole(AriaRole.${Pg(s).toUpperCase()}${m})`;case"has-text":return`filter(new ${o}.FilterOptions().setHasText(${this.toHasText(s)}))`;case"has-not-text":return`filter(new ${o}.FilterOptions().setHasNotText(${this.toHasText(s)}))`;case"has":return`filter(new ${o}.FilterOptions().setHas(${s}))`;case"hasNot":return`filter(new ${o}.FilterOptions().setHasNot(${s}))`;case"and":return`and(${s})`;case"or":return`or(${s})`;case"chain":return`locator(${s})`;case"test-id":return`getByTestId(${this.toTestIdValue(s)})`;case"text":return this.toCallWithExact(o,"getByText",s,!!c.exact);case"alt":return this.toCallWithExact(o,"getByAltText",s,!!c.exact);case"placeholder":return this.toCallWithExact(o,"getByPlaceholder",s,!!c.exact);case"label":return this.toCallWithExact(o,"getByLabel",s,!!c.exact);case"title":return this.toCallWithExact(o,"getByTitle",s,!!c.exact);default:throw new Error("Unknown selector kind "+a)}}chainLocators(l){return l.join(".")}regexToString(l){const a=l.flags.includes("i")?", Pattern.CASE_INSENSITIVE":"";return`Pattern.compile(${this.quote(Au(l.source))}${a})`}toCallWithExact(l,a,s,c){return Ge(s)?`${a}(${this.regexToString(s)})`:c?`${a}(${this.quote(s)}, new ${l}.${yu(a)}Options().setExact(true))`:`${a}(${this.quote(s)})`}toHasText(l){return Ge(l)?this.regexToString(l):this.quote(l)}toTestIdValue(l){return Ge(l)?this.regexToString(l):this.quote(l)}quote(l){return wu(l,'"')}}class Nv{generateLocator(l,a,s,c={}){switch(a){case"default":return c.hasText!==void 0?`Locator(${this.quote(s)}, new() { ${this.toHasText(c.hasText)} })`:c.hasNotText!==void 0?`Locator(${this.quote(s)}, new() { ${this.toHasNotText(c.hasNotText)} })`:`Locator(${this.quote(s)})`;case"frame-locator":return`FrameLocator(${this.quote(s)})`;case"frame":return"ContentFrame";case"nth":return`Nth(${s})`;case"first":return"First";case"last":return"Last";case"visible":return`Filter(new() { Visible = ${s==="true"?"true":"false"} })`;case"role":const o=[];Ge(c.name)?o.push(`NameRegex = ${this.regexToString(c.name)}`):typeof c.name=="string"&&o.push(`Name = ${this.quote(c.name)}`),Ge(c.description)?o.push(`DescriptionRegex = ${this.regexToString(c.description)}`):typeof c.description=="string"&&o.push(`Description = ${this.quote(c.description)}`),c.exact&&(typeof c.name=="string"||typeof c.description=="string")&&o.push("Exact = true");for(const{name:m,value:p}of c.attrs)o.push(`${yu(m)} = ${typeof p=="string"?this.quote(p):p}`);const h=o.length?`, new() { ${o.join(", ")} }`:"";return`GetByRole(AriaRole.${yu(s)}${h})`;case"has-text":return`Filter(new() { ${this.toHasText(s)} })`;case"has-not-text":return`Filter(new() { ${this.toHasNotText(s)} })`;case"has":return`Filter(new() { Has = ${s} })`;case"hasNot":return`Filter(new() { HasNot = ${s} })`;case"and":return`And(${s})`;case"or":return`Or(${s})`;case"chain":return`Locator(${s})`;case"test-id":return`GetByTestId(${this.toTestIdValue(s)})`;case"text":return this.toCallWithExact("GetByText",s,!!c.exact);case"alt":return this.toCallWithExact("GetByAltText",s,!!c.exact);case"placeholder":return this.toCallWithExact("GetByPlaceholder",s,!!c.exact);case"label":return this.toCallWithExact("GetByLabel",s,!!c.exact);case"title":return this.toCallWithExact("GetByTitle",s,!!c.exact);default:throw new Error("Unknown selector kind "+a)}}chainLocators(l){return l.join(".")}regexToString(l){const a=l.flags.includes("i")?", RegexOptions.IgnoreCase":"";return`new Regex(${this.quote(Au(l.source))}${a})`}toCallWithExact(l,a,s){return Ge(a)?`${l}(${this.regexToString(a)})`:s?`${l}(${this.quote(a)}, new() { Exact = true })`:`${l}(${this.quote(a)})`}toHasText(l){return Ge(l)?`HasTextRegex = ${this.regexToString(l)}`:`HasText = ${this.quote(l)}`}toTestIdValue(l){return Ge(l)?this.regexToString(l):this.quote(l)}toHasNotText(l){return Ge(l)?`HasNotTextRegex = ${this.regexToString(l)}`:`HasNotText = ${this.quote(l)}`}quote(l){return wu(l,'"')}}class Mv{generateLocator(l,a,s,c={}){return JSON.stringify({kind:a,body:s,options:c})}chainLocators(l){const a=l.map(s=>JSON.parse(s));for(let s=0;s<a.length-1;++s)a[s].next=a[s+1];return JSON.stringify(a[0])}}const Cv={javascript:Av,python:Ov,java:_v,csharp:Nv,jsonl:Mv};function Ge(u){return u instanceof RegExp}const zv=({language:u,log:l})=>{const a=he.useRef(null),[s,c]=he.useState(new Map);return he.useLayoutEffect(()=>{var o;l.find(h=>h.reveal)&&((o=a.current)==null||o.scrollIntoView({block:"center",inline:"nearest"}))},[a,l]),X.jsxs("div",{className:"call-log",style:{flex:"auto"},children:[l.map(o=>{const h=s.get(o.id),m=typeof h=="boolean"?h:o.status!=="done",p=o.params.selector?ep(u,o.params.selector):null;let g=o.title,b="";return o.title.startsWith("expect.to")||o.title.startsWith("expect.not.to")?(g="expect(",b=`).${o.title.substring(7)}()`):o.title.startsWith("locator.")?(g="",b=`.${o.title.substring(8)}()`):(p||o.params.url)&&(g=o.title+"(",b=")"),X.jsxs("div",{className:Ol("call-log-call",o.status),children:[X.jsxs("div",{className:"call-log-call-header",children:[X.jsx("span",{className:Ol("codicon",`codicon-chevron-${m?"down":"right"}`),style:{cursor:"pointer"},onClick:()=>{const v=new Map(s);v.set(o.id,!m),c(v)}}),g,o.params.url?X.jsx("span",{className:"call-log-details",children:X.jsx("span",{className:"call-log-url",title:o.params.url,children:o.params.url})}):void 0,p?X.jsx("span",{className:"call-log-details",children:X.jsx("span",{className:"call-log-selector",title:`page.${p}`,children:`page.${p}`})}):void 0,b,X.jsx("span",{className:Ol("codicon",xv(o))}),typeof o.duration=="number"?X.jsxs("span",{className:"call-log-time",children:["â€” ",tv(o.duration)]}):void 0]}),(m?o.messages:[]).map((v,O)=>X.jsx("div",{className:"call-log-message",children:v.trim()},O)),!!o.error&&X.jsx("div",{className:"call-log-message error",hidden:!m,children:o.error})]},o.id)}),X.jsx("div",{ref:a})]})};function xv(u){switch(u.status){case"done":return"codicon-check";case"in-progress":return"codicon-clock";case"paused":return"codicon-debug-pause";case"error":return"codicon-error"}}const Lf=Symbol.for("yaml.alias"),Of=Symbol.for("yaml.document"),Pn=Symbol.for("yaml.map"),tp=Symbol.for("yaml.pair"),nn=Symbol.for("yaml.scalar"),_i=Symbol.for("yaml.seq"),Vt=Symbol.for("yaml.node.type"),tl=u=>!!u&&typeof u=="object"&&u[Vt]===Lf,Nl=u=>!!u&&typeof u=="object"&&u[Vt]===Of,Ni=u=>!!u&&typeof u=="object"&&u[Vt]===Pn,je=u=>!!u&&typeof u=="object"&&u[Vt]===tp,De=u=>!!u&&typeof u=="object"&&u[Vt]===nn,Mi=u=>!!u&&typeof u=="object"&&u[Vt]===_i;function Be(u){if(u&&typeof u=="object")switch(u[Vt]){case Pn:case _i:return!0}return!1}function ke(u){if(u&&typeof u=="object")switch(u[Vt]){case Lf:case Pn:case nn:case _i:return!0}return!1}const np=u=>(De(u)||Be(u))&&!!u.anchor,Tt=Symbol("break visit"),lp=Symbol("skip children"),tn=Symbol("remove node");function Ml(u,l){const a=ip(l);Nl(u)?pi(null,u.contents,a,Object.freeze([u]))===tn&&(u.contents=null):pi(null,u,a,Object.freeze([]))}Ml.BREAK=Tt;Ml.SKIP=lp;Ml.REMOVE=tn;function pi(u,l,a,s){const c=ap(u,l,a,s);if(ke(c)||je(c))return sp(u,s,c),pi(u,c,a,s);if(typeof c!="symbol"){if(Be(l)){s=Object.freeze(s.concat(l));for(let o=0;o<l.items.length;++o){const h=pi(o,l.items[o],a,s);if(typeof h=="number")o=h-1;else{if(h===Tt)return Tt;h===tn&&(l.items.splice(o,1),o-=1)}}}else if(je(l)){s=Object.freeze(s.concat(l));const o=pi("key",l.key,a,s);if(o===Tt)return Tt;o===tn&&(l.key=null);const h=pi("value",l.value,a,s);if(h===Tt)return Tt;h===tn&&(l.value=null)}}return c}async function Ou(u,l){const a=ip(l);Nl(u)?await yi(null,u.contents,a,Object.freeze([u]))===tn&&(u.contents=null):await yi(null,u,a,Object.freeze([]))}Ou.BREAK=Tt;Ou.SKIP=lp;Ou.REMOVE=tn;async function yi(u,l,a,s){const c=await ap(u,l,a,s);if(ke(c)||je(c))return sp(u,s,c),yi(u,c,a,s);if(typeof c!="symbol"){if(Be(l)){s=Object.freeze(s.concat(l));for(let o=0;o<l.items.length;++o){const h=await yi(o,l.items[o],a,s);if(typeof h=="number")o=h-1;else{if(h===Tt)return Tt;h===tn&&(l.items.splice(o,1),o-=1)}}}else if(je(l)){s=Object.freeze(s.concat(l));const o=await yi("key",l.key,a,s);if(o===Tt)return Tt;o===tn&&(l.key=null);const h=await yi("value",l.value,a,s);if(h===Tt)return Tt;h===tn&&(l.value=null)}}return c}function ip(u){return typeof u=="object"&&(u.Collection||u.Node||u.Value)?Object.assign({Alias:u.Node,Map:u.Node,Scalar:u.Node,Seq:u.Node},u.Value&&{Map:u.Value,Scalar:u.Value,Seq:u.Value},u.Collection&&{Map:u.Collection,Seq:u.Collection},u):u}function ap(u,l,a,s){var c,o,h,m,p;if(typeof a=="function")return a(u,l,s);if(Ni(l))return(c=a.Map)==null?void 0:c.call(a,u,l,s);if(Mi(l))return(o=a.Seq)==null?void 0:o.call(a,u,l,s);if(je(l))return(h=a.Pair)==null?void 0:h.call(a,u,l,s);if(De(l))return(m=a.Scalar)==null?void 0:m.call(a,u,l,s);if(tl(l))return(p=a.Alias)==null?void 0:p.call(a,u,l,s)}function sp(u,l,a){const s=l[l.length-1];if(Be(s))s.items[u]=a;else if(je(s))u==="key"?s.key=a:s.value=a;else if(Nl(s))s.contents=a;else{const c=tl(s)?"alias":"scalar";throw new Error(`Cannot replace node with ${c} parent`)}}const Dv={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},Lv=u=>u.replace(/[!,[\]{}]/g,l=>Dv[l]);class ot{constructor(l,a){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},ot.defaultYaml,l),this.tags=Object.assign({},ot.defaultTags,a)}clone(){const l=new ot(this.yaml,this.tags);return l.docStart=this.docStart,l}atDocument(){const l=new ot(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:ot.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},ot.defaultTags);break}return l}add(l,a){this.atNextDocument&&(this.yaml={explicit:ot.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},ot.defaultTags),this.atNextDocument=!1);const s=l.trim().split(/[ \t]+/),c=s.shift();switch(c){case"%TAG":{if(s.length!==2&&(a(0,"%TAG directive should contain exactly two parts"),s.length<2))return!1;const[o,h]=s;return this.tags[o]=h,!0}case"%YAML":{if(this.yaml.explicit=!0,s.length!==1)return a(0,"%YAML directive should contain exactly one part"),!1;const[o]=s;if(o==="1.1"||o==="1.2")return this.yaml.version=o,!0;{const h=/^\d+\.\d+$/.test(o);return a(6,`Unsupported YAML version ${o}`,h),!1}}default:return a(0,`Unknown directive ${c}`,!0),!1}}tagName(l,a){if(l==="!")return"!";if(l[0]!=="!")return a(`Not a valid tag: ${l}`),null;if(l[1]==="<"){const h=l.slice(2,-1);return h==="!"||h==="!!"?(a(`Verbatim tags aren't resolved, so ${l} is invalid.`),null):(l[l.length-1]!==">"&&a("Verbatim tags must end with a >"),h)}const[,s,c]=l.match(/^(.*!)([^!]*)$/s);c||a(`The ${l} tag has no suffix`);const o=this.tags[s];if(o)try{return o+decodeURIComponent(c)}catch(h){return a(String(h)),null}return s==="!"?l:(a(`Could not resolve tag: ${l}`),null)}tagString(l){for(const[a,s]of Object.entries(this.tags))if(l.startsWith(s))return a+Lv(l.substring(s.length));return l[0]==="!"?l:`!<${l}>`}toString(l){const a=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],s=Object.entries(this.tags);let c;if(l&&s.length>0&&ke(l.contents)){const o={};Ml(l.contents,(h,m)=>{ke(m)&&m.tag&&(o[m.tag]=!0)}),c=Object.keys(o)}else c=[];for(const[o,h]of s)o==="!!"&&h==="tag:yaml.org,2002:"||(!l||c.some(m=>m.startsWith(h)))&&a.push(`%TAG ${o} ${h}`);return a.join(`
`)}}ot.defaultYaml={explicit:!1,version:"1.2"};ot.defaultTags={"!!":"tag:yaml.org,2002:"};function up(u){if(/[\x00-\x19\s,[\]{}]/.test(u)){const a=`Anchor must not contain whitespace or control characters: ${JSON.stringify(u)}`;throw new Error(a)}return!0}function cp(u){const l=new Set;return Ml(u,{Value(a,s){s.anchor&&l.add(s.anchor)}}),l}function rp(u,l){for(let a=1;;++a){const s=`${u}${a}`;if(!l.has(s))return s}}function Uv(u,l){const a=[],s=new Map;let c=null;return{onAnchor:o=>{a.push(o),c??(c=cp(u));const h=rp(l,c);return c.add(h),h},setAnchors:()=>{for(const o of a){const h=s.get(o);if(typeof h=="object"&&h.anchor&&(De(h.node)||Be(h.node)))h.node.anchor=h.anchor;else{const m=new Error("Failed to resolve repeated object (this should not happen)");throw m.source=o,m}}},sourceObjects:s}}function vi(u,l,a,s){if(s&&typeof s=="object")if(Array.isArray(s))for(let c=0,o=s.length;c<o;++c){const h=s[c],m=vi(u,s,String(c),h);m===void 0?delete s[c]:m!==h&&(s[c]=m)}else if(s instanceof Map)for(const c of Array.from(s.keys())){const o=s.get(c),h=vi(u,s,c,o);h===void 0?s.delete(c):h!==o&&s.set(c,h)}else if(s instanceof Set)for(const c of Array.from(s)){const o=vi(u,s,c,c);o===void 0?s.delete(c):o!==c&&(s.delete(c),s.add(o))}else for(const[c,o]of Object.entries(s)){const h=vi(u,s,c,o);h===void 0?delete s[c]:h!==o&&(s[c]=h)}return u.call(l,a,s)}function Gt(u,l,a){if(Array.isArray(u))return u.map((s,c)=>Gt(s,String(c),a));if(u&&typeof u.toJSON=="function"){if(!a||!np(u))return u.toJSON(l,a);const s={aliasCount:0,count:1,res:void 0};a.anchors.set(u,s),a.onCreate=o=>{s.res=o,delete a.onCreate};const c=u.toJSON(l,a);return a.onCreate&&a.onCreate(c),c}return typeof u=="bigint"&&!(a!=null&&a.keep)?Number(u):u}class Uf{constructor(l){Object.defineProperty(this,Vt,{value:l})}clone(){const l=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(l.range=this.range.slice()),l}toJS(l,{mapAsMap:a,maxAliasCount:s,onAnchor:c,reviver:o}={}){if(!Nl(l))throw new TypeError("A document argument is required");const h={anchors:new Map,doc:l,keep:!0,mapAsMap:a===!0,mapKeyWarned:!1,maxAliasCount:typeof s=="number"?s:100},m=Gt(this,"",h);if(typeof c=="function")for(const{count:p,res:g}of h.anchors.values())c(g,p);return typeof o=="function"?vi(o,{"":m},"",m):m}}class _u extends Uf{constructor(l){super(Lf),this.source=l,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(l,a){let s;a!=null&&a.aliasResolveCache?s=a.aliasResolveCache:(s=[],Ml(l,{Node:(o,h)=>{(tl(h)||np(h))&&s.push(h)}}),a&&(a.aliasResolveCache=s));let c;for(const o of s){if(o===this)break;o.anchor===this.source&&(c=o)}return c}toJSON(l,a){if(!a)return{source:this.source};const{anchors:s,doc:c,maxAliasCount:o}=a,h=this.resolve(c,a);if(!h){const p=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(p)}let m=s.get(h);if(m||(Gt(h,null,a),m=s.get(h)),(m==null?void 0:m.res)===void 0){const p="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(p)}if(o>=0&&(m.count+=1,m.aliasCount===0&&(m.aliasCount=hu(c,h,s)),m.count*m.aliasCount>o)){const p="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(p)}return m.res}toString(l,a,s){const c=`*${this.source}`;if(l){if(up(this.source),l.options.verifyAliasOrder&&!l.anchors.has(this.source)){const o=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(o)}if(l.implicitKey)return`${c} `}return c}}function hu(u,l,a){if(tl(l)){const s=l.resolve(u),c=a&&s&&a.get(s);return c?c.count*c.aliasCount:0}else if(Be(l)){let s=0;for(const c of l.items){const o=hu(u,c,a);o>s&&(s=o)}return s}else if(je(l)){const s=hu(u,l.key,a),c=hu(u,l.value,a);return Math.max(s,c)}return 1}const fp=u=>!u||typeof u!="function"&&typeof u!="object";class ce extends Uf{constructor(l){super(nn),this.value=l}toJSON(l,a){return a!=null&&a.keep?this.value:Gt(this.value,l,a)}toString(){return String(this.value)}}ce.BLOCK_FOLDED="BLOCK_FOLDED";ce.BLOCK_LITERAL="BLOCK_LITERAL";ce.PLAIN="PLAIN";ce.QUOTE_DOUBLE="QUOTE_DOUBLE";ce.QUOTE_SINGLE="QUOTE_SINGLE";const Rv="tag:yaml.org,2002:";function jv(u,l,a){if(l){const s=a.filter(o=>o.tag===l),c=s.find(o=>!o.format)??s[0];if(!c)throw new Error(`Tag ${l} not found`);return c}return a.find(s=>{var c;return((c=s.identify)==null?void 0:c.call(s,u))&&!s.format})}function xa(u,l,a){var v,O,E;if(Nl(u)&&(u=u.contents),ke(u))return u;if(je(u)){const x=(O=(v=a.schema[Pn]).createNode)==null?void 0:O.call(v,a.schema,null,a);return x.items.push(u),x}(u instanceof String||u instanceof Number||u instanceof Boolean||typeof BigInt<"u"&&u instanceof BigInt)&&(u=u.valueOf());const{aliasDuplicateObjects:s,onAnchor:c,onTagObj:o,schema:h,sourceObjects:m}=a;let p;if(s&&u&&typeof u=="object"){if(p=m.get(u),p)return p.anchor??(p.anchor=c(u)),new _u(p.anchor);p={anchor:null,node:null},m.set(u,p)}l!=null&&l.startsWith("!!")&&(l=Rv+l.slice(2));let g=jv(u,l,h.tags);if(!g){if(u&&typeof u.toJSON=="function"&&(u=u.toJSON()),!u||typeof u!="object"){const x=new ce(u);return p&&(p.node=x),x}g=u instanceof Map?h[Pn]:Symbol.iterator in Object(u)?h[_i]:h[Pn]}o&&(o(g),delete a.onTagObj);const b=g!=null&&g.createNode?g.createNode(a.schema,u,a):typeof((E=g==null?void 0:g.nodeClass)==null?void 0:E.from)=="function"?g.nodeClass.from(a.schema,u,a):new ce(u);return l?b.tag=l:g.default||(b.tag=g.tag),p&&(p.node=b),b}function vu(u,l,a){let s=a;for(let c=l.length-1;c>=0;--c){const o=l[c];if(typeof o=="number"&&Number.isInteger(o)&&o>=0){const h=[];h[o]=s,s=h}else s=new Map([[o,s]])}return xa(s,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:u,sourceObjects:new Map})}const Ca=u=>u==null||typeof u=="object"&&!!u[Symbol.iterator]().next().done;class op extends Uf{constructor(l,a){super(l),Object.defineProperty(this,"schema",{value:a,configurable:!0,enumerable:!1,writable:!0})}clone(l){const a=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return l&&(a.schema=l),a.items=a.items.map(s=>ke(s)||je(s)?s.clone(l):s),this.range&&(a.range=this.range.slice()),a}addIn(l,a){if(Ca(l))this.add(a);else{const[s,...c]=l,o=this.get(s,!0);if(Be(o))o.addIn(c,a);else if(o===void 0&&this.schema)this.set(s,vu(this.schema,c,a));else throw new Error(`Expected YAML collection at ${s}. Remaining path: ${c}`)}}deleteIn(l){const[a,...s]=l;if(s.length===0)return this.delete(a);const c=this.get(a,!0);if(Be(c))return c.deleteIn(s);throw new Error(`Expected YAML collection at ${a}. Remaining path: ${s}`)}getIn(l,a){const[s,...c]=l,o=this.get(s,!0);return c.length===0?!a&&De(o)?o.value:o:Be(o)?o.getIn(c,a):void 0}hasAllNullValues(l){return this.items.every(a=>{if(!je(a))return!1;const s=a.value;return s==null||l&&De(s)&&s.value==null&&!s.commentBefore&&!s.comment&&!s.tag})}hasIn(l){const[a,...s]=l;if(s.length===0)return this.has(a);const c=this.get(a,!0);return Be(c)?c.hasIn(s):!1}setIn(l,a){const[s,...c]=l;if(c.length===0)this.set(s,a);else{const o=this.get(s,!0);if(Be(o))o.setIn(c,a);else if(o===void 0&&this.schema)this.set(s,vu(this.schema,c,a));else throw new Error(`Expected YAML collection at ${s}. Remaining path: ${c}`)}}}const Bv=u=>u.replace(/^(?!$)(?: $)?/gm,"#");function wn(u,l){return/^\n+$/.test(u)?u.substring(1):l?u.replace(/^(?! *$)/gm,l):u}const El=(u,l,a)=>u.endsWith(`
`)?wn(a,l):a.includes(`
`)?`
`+wn(a,l):(u.endsWith(" ")?"":" ")+a,hp="flow",_f="block",du="quoted";function Nu(u,l,a="flow",{indentAtStart:s,lineWidth:c=80,minContentWidth:o=20,onFold:h,onOverflow:m}={}){if(!c||c<0)return u;c<o&&(o=0);const p=Math.max(1+o,1+c-l.length);if(u.length<=p)return u;const g=[],b={};let v=c-l.length;typeof s=="number"&&(s>c-Math.max(2,o)?g.push(0):v=c-s);let O,E,x=!1,S=-1,w=-1,M=-1;a===_f&&(S=yg(u,S,l.length),S!==-1&&(v=S+p));for(let K;K=u[S+=1];){if(a===du&&K==="\\"){switch(w=S,u[S+1]){case"x":S+=3;break;case"u":S+=5;break;case"U":S+=9;break;default:S+=1}M=S}if(K===`
`)a===_f&&(S=yg(u,S,l.length)),v=S+l.length+p,O=void 0;else{if(K===" "&&E&&E!==" "&&E!==`
`&&E!=="	"){const Q=u[S+1];Q&&Q!==" "&&Q!==`
`&&Q!=="	"&&(O=S)}if(S>=v)if(O)g.push(O),v=O+p,O=void 0;else if(a===du){for(;E===" "||E==="	";)E=K,K=u[S+=1],x=!0;const Q=S>M+1?S-2:w-1;if(b[Q])return u;g.push(Q),b[Q]=!0,v=Q+p,O=void 0}else x=!0}E=K}if(x&&m&&m(),g.length===0)return u;h&&h();let R=u.slice(0,g[0]);for(let K=0;K<g.length;++K){const Q=g[K],Z=g[K+1]||u.length;Q===0?R=`
${l}${u.slice(0,Z)}`:(a===du&&b[Q]&&(R+=`${u[Q]}\\`),R+=`
${l}${u.slice(Q+1,Z)}`)}return R}function yg(u,l,a){let s=l,c=l+1,o=u[c];for(;o===" "||o==="	";)if(l<c+a)o=u[++l];else{do o=u[++l];while(o&&o!==`
`);s=l,c=l+1,o=u[c]}return s}const Mu=(u,l)=>({indentAtStart:l?u.indent.length:u.indentAtStart,lineWidth:u.options.lineWidth,minContentWidth:u.options.minContentWidth}),Cu=u=>/^(%|---|\.\.\.)/m.test(u);function kv(u,l,a){if(!l||l<0)return!1;const s=l-a,c=u.length;if(c<=s)return!1;for(let o=0,h=0;o<c;++o)if(u[o]===`
`){if(o-h>s)return!0;if(h=o+1,c-h<=s)return!1}return!0}function za(u,l){const a=JSON.stringify(u);if(l.options.doubleQuotedAsJSON)return a;const{implicitKey:s}=l,c=l.options.doubleQuotedMinMultiLineLength,o=l.indent||(Cu(u)?"  ":"");let h="",m=0;for(let p=0,g=a[p];g;g=a[++p])if(g===" "&&a[p+1]==="\\"&&a[p+2]==="n"&&(h+=a.slice(m,p)+"\\ ",p+=1,m=p,g="\\"),g==="\\")switch(a[p+1]){case"u":{h+=a.slice(m,p);const b=a.substr(p+2,4);switch(b){case"0000":h+="\\0";break;case"0007":h+="\\a";break;case"000b":h+="\\v";break;case"001b":h+="\\e";break;case"0085":h+="\\N";break;case"00a0":h+="\\_";break;case"2028":h+="\\L";break;case"2029":h+="\\P";break;default:b.substr(0,2)==="00"?h+="\\x"+b.substr(2):h+=a.substr(p,6)}p+=5,m=p+1}break;case"n":if(s||a[p+2]==='"'||a.length<c)p+=1;else{for(h+=a.slice(m,p)+`

`;a[p+2]==="\\"&&a[p+3]==="n"&&a[p+4]!=='"';)h+=`
`,p+=2;h+=o,a[p+2]===" "&&(h+="\\"),p+=1,m=p+1}break;default:p+=1}return h=m?h+a.slice(m):a,s?h:Nu(h,o,du,Mu(l,!1))}function Nf(u,l){if(l.options.singleQuote===!1||l.implicitKey&&u.includes(`
`)||/[ \t]\n|\n[ \t]/.test(u))return za(u,l);const a=l.indent||(Cu(u)?"  ":""),s="'"+u.replace(/'/g,"''").replace(/\n+/g,`$&
${a}`)+"'";return l.implicitKey?s:Nu(s,a,hp,Mu(l,!1))}function bi(u,l){const{singleQuote:a}=l.options;let s;if(a===!1)s=za;else{const c=u.includes('"'),o=u.includes("'");c&&!o?s=Nf:o&&!c?s=za:s=a?Nf:za}return s(u,l)}let Mf;try{Mf=new RegExp(`(^|(?<!
))
+(?!
|$)`,"g")}catch{Mf=/\n+(?!\n|$)/g}function mu({comment:u,type:l,value:a},s,c,o){const{blockQuote:h,commentString:m,lineWidth:p}=s.options;if(!h||/\n[\t ]+$/.test(a))return bi(a,s);const g=s.indent||(s.forceBlockIndent||Cu(a)?"  ":""),b=h==="literal"?!0:h==="folded"||l===ce.BLOCK_FOLDED?!1:l===ce.BLOCK_LITERAL?!0:!kv(a,p,g.length);if(!a)return b?`|
`:`>
`;let v,O;for(O=a.length;O>0;--O){const Z=a[O-1];if(Z!==`
`&&Z!=="	"&&Z!==" ")break}let E=a.substring(O);const x=E.indexOf(`
`);x===-1?v="-":a===E||x!==E.length-1?(v="+",o&&o()):v="",E&&(a=a.slice(0,-E.length),E[E.length-1]===`
`&&(E=E.slice(0,-1)),E=E.replace(Mf,`$&${g}`));let S=!1,w,M=-1;for(w=0;w<a.length;++w){const Z=a[w];if(Z===" ")S=!0;else if(Z===`
`)M=w;else break}let R=a.substring(0,M<w?M+1:w);R&&(a=a.substring(R.length),R=R.replace(/\n+/g,`$&${g}`));let Q=(S?g?"2":"1":"")+v;if(u&&(Q+=" "+m(u.replace(/ ?[\r\n]+/g," ")),c&&c()),!b){const Z=a.replace(/\n+/g,`
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${g}`);let W=!1;const k=Mu(s,!0);h!=="folded"&&l!==ce.BLOCK_FOLDED&&(k.onOverflow=()=>{W=!0});const V=Nu(`${R}${Z}${E}`,g,_f,k);if(!W)return`>${Q}
${g}${V}`}return a=a.replace(/\n+/g,`$&${g}`),`|${Q}
${g}${R}${a}${E}`}function qv(u,l,a,s){const{type:c,value:o}=u,{actualString:h,implicitKey:m,indent:p,indentStep:g,inFlow:b}=l;if(m&&o.includes(`
`)||b&&/[[\]{},]/.test(o))return bi(o,l);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(o))return m||b||!o.includes(`
`)?bi(o,l):mu(u,l,a,s);if(!m&&!b&&c!==ce.PLAIN&&o.includes(`
`))return mu(u,l,a,s);if(Cu(o)){if(p==="")return l.forceBlockIndent=!0,mu(u,l,a,s);if(m&&p===g)return bi(o,l)}const v=o.replace(/\n+/g,`$&
${p}`);if(h){const O=S=>{var w;return S.default&&S.tag!=="tag:yaml.org,2002:str"&&((w=S.test)==null?void 0:w.test(v))},{compat:E,tags:x}=l.doc.schema;if(x.some(O)||E!=null&&E.some(O))return bi(o,l)}return m?v:Nu(v,p,hp,Mu(l,!1))}function Ra(u,l,a,s){const{implicitKey:c,inFlow:o}=l,h=typeof u.value=="string"?u:Object.assign({},u,{value:String(u.value)});let{type:m}=u;m!==ce.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(h.value)&&(m=ce.QUOTE_DOUBLE);const p=b=>{switch(b){case ce.BLOCK_FOLDED:case ce.BLOCK_LITERAL:return c||o?bi(h.value,l):mu(h,l,a,s);case ce.QUOTE_DOUBLE:return za(h.value,l);case ce.QUOTE_SINGLE:return Nf(h.value,l);case ce.PLAIN:return qv(h,l,a,s);default:return null}};let g=p(m);if(g===null){const{defaultKeyType:b,defaultStringType:v}=l.options,O=c&&b||v;if(g=p(O),g===null)throw new Error(`Unsupported default string type ${O}`)}return g}function dp(u,l){const a=Object.assign({blockQuote:!0,commentString:Bv,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},u.schema.toStringOptions,l);let s;switch(a.collectionStyle){case"block":s=!1;break;case"flow":s=!0;break;default:s=null}return{anchors:new Set,doc:u,flowCollectionPadding:a.flowCollectionPadding?" ":"",indent:"",indentStep:typeof a.indent=="number"?" ".repeat(a.indent):"  ",inFlow:s,options:a}}function Hv(u,l){var c;if(l.tag){const o=u.filter(h=>h.tag===l.tag);if(o.length>0)return o.find(h=>h.format===l.format)??o[0]}let a,s;if(De(l)){s=l.value;let o=u.filter(h=>{var m;return(m=h.identify)==null?void 0:m.call(h,s)});if(o.length>1){const h=o.filter(m=>m.test);h.length>0&&(o=h)}a=o.find(h=>h.format===l.format)??o.find(h=>!h.format)}else s=l,a=u.find(o=>o.nodeClass&&s instanceof o.nodeClass);if(!a){const o=((c=s==null?void 0:s.constructor)==null?void 0:c.name)??(s===null?"null":typeof s);throw new Error(`Tag not resolved for ${o} value`)}return a}function Yv(u,l,{anchors:a,doc:s}){if(!s.directives)return"";const c=[],o=(De(u)||Be(u))&&u.anchor;o&&up(o)&&(a.add(o),c.push(`&${o}`));const h=u.tag??(l.default?null:l.tag);return h&&c.push(s.directives.tagString(h)),c.join(" ")}function Ei(u,l,a,s){var p;if(je(u))return u.toString(l,a,s);if(tl(u)){if(l.doc.directives)return u.toString(l);if((p=l.resolvedAliases)!=null&&p.has(u))throw new TypeError("Cannot stringify circular structure without alias nodes");l.resolvedAliases?l.resolvedAliases.add(u):l.resolvedAliases=new Set([u]),u=u.resolve(l.doc)}let c;const o=ke(u)?u:l.doc.createNode(u,{onTagObj:g=>c=g});c??(c=Hv(l.doc.schema.tags,o));const h=Yv(o,c,l);h.length>0&&(l.indentAtStart=(l.indentAtStart??0)+h.length+1);const m=typeof c.stringify=="function"?c.stringify(o,l,a,s):De(o)?Ra(o,l,a,s):o.toString(l,a,s);return h?De(o)||m[0]==="{"||m[0]==="["?`${h} ${m}`:`${h}
${l.indent}${m}`:m}function $v({key:u,value:l},a,s,c){const{allNullValues:o,doc:h,indent:m,indentStep:p,options:{commentString:g,indentSeq:b,simpleKeys:v}}=a;let O=ke(u)&&u.comment||null;if(v){if(O)throw new Error("With simple keys, key nodes cannot have comments");if(Be(u)||!ke(u)&&typeof u=="object"){const k="With simple keys, collection cannot be used as a key value";throw new Error(k)}}let E=!v&&(!u||O&&l==null&&!a.inFlow||Be(u)||(De(u)?u.type===ce.BLOCK_FOLDED||u.type===ce.BLOCK_LITERAL:typeof u=="object"));a=Object.assign({},a,{allNullValues:!1,implicitKey:!E&&(v||!o),indent:m+p});let x=!1,S=!1,w=Ei(u,a,()=>x=!0,()=>S=!0);if(!E&&!a.inFlow&&w.length>1024){if(v)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");E=!0}if(a.inFlow){if(o||l==null)return x&&s&&s(),w===""?"?":E?`? ${w}`:w}else if(o&&!v||l==null&&E)return w=`? ${w}`,O&&!x?w+=El(w,a.indent,g(O)):S&&c&&c(),w;x&&(O=null),E?(O&&(w+=El(w,a.indent,g(O))),w=`? ${w}
${m}:`):(w=`${w}:`,O&&(w+=El(w,a.indent,g(O))));let M,R,K;ke(l)?(M=!!l.spaceBefore,R=l.commentBefore,K=l.comment):(M=!1,R=null,K=null,l&&typeof l=="object"&&(l=h.createNode(l))),a.implicitKey=!1,!E&&!O&&De(l)&&(a.indentAtStart=w.length+1),S=!1,!b&&p.length>=2&&!a.inFlow&&!E&&Mi(l)&&!l.flow&&!l.tag&&!l.anchor&&(a.indent=a.indent.substring(2));let Q=!1;const Z=Ei(l,a,()=>Q=!0,()=>S=!0);let W=" ";if(O||M||R){if(W=M?`
`:"",R){const k=g(R);W+=`
${wn(k,a.indent)}`}Z===""&&!a.inFlow?W===`
`&&K&&(W=`

`):W+=`
${a.indent}`}else if(!E&&Be(l)){const k=Z[0],V=Z.indexOf(`
`),U=V!==-1,ae=a.inFlow??l.flow??l.items.length===0;if(U||!ae){let te=!1;if(U&&(k==="&"||k==="!")){let $=Z.indexOf(" ");k==="&"&&$!==-1&&$<V&&Z[$+1]==="!"&&($=Z.indexOf(" ",$+1)),($===-1||V<$)&&(te=!0)}te||(W=`
${a.indent}`)}}else(Z===""||Z[0]===`
`)&&(W="");return w+=W+Z,a.inFlow?Q&&s&&s():K&&!Q?w+=El(w,a.indent,g(K)):S&&c&&c(),w}function mp(u,l){(u==="debug"||u==="warn")&&console.warn(l)}const nu="<<",On={identify:u=>u===nu||typeof u=="symbol"&&u.description===nu,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new ce(Symbol(nu)),{addToJSMap:gp}),stringify:()=>nu},Kv=(u,l)=>(On.identify(l)||De(l)&&(!l.type||l.type===ce.PLAIN)&&On.identify(l.value))&&(u==null?void 0:u.doc.schema.tags.some(a=>a.tag===On.tag&&a.default));function gp(u,l,a){if(a=u&&tl(a)?a.resolve(u.doc):a,Mi(a))for(const s of a.items)hf(u,l,s);else if(Array.isArray(a))for(const s of a)hf(u,l,s);else hf(u,l,a)}function hf(u,l,a){const s=u&&tl(a)?a.resolve(u.doc):a;if(!Ni(s))throw new Error("Merge sources must be maps or map aliases");const c=s.toJSON(null,u,Map);for(const[o,h]of c)l instanceof Map?l.has(o)||l.set(o,h):l instanceof Set?l.add(o):Object.prototype.hasOwnProperty.call(l,o)||Object.defineProperty(l,o,{value:h,writable:!0,enumerable:!0,configurable:!0});return l}function pp(u,l,{key:a,value:s}){if(ke(a)&&a.addToJSMap)a.addToJSMap(u,l,s);else if(Kv(u,a))gp(u,l,s);else{const c=Gt(a,"",u);if(l instanceof Map)l.set(c,Gt(s,c,u));else if(l instanceof Set)l.add(c);else{const o=Gv(a,c,u),h=Gt(s,o,u);o in l?Object.defineProperty(l,o,{value:h,writable:!0,enumerable:!0,configurable:!0}):l[o]=h}}return l}function Gv(u,l,a){if(l===null)return"";if(typeof l!="object")return String(l);if(ke(u)&&(a!=null&&a.doc)){const s=dp(a.doc,{});s.anchors=new Set;for(const o of a.anchors.keys())s.anchors.add(o.anchor);s.inFlow=!0,s.inStringifyKey=!0;const c=u.toString(s);if(!a.mapKeyWarned){let o=JSON.stringify(c);o.length>40&&(o=o.substring(0,36)+'..."'),mp(a.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${o}. Set mapAsMap: true to use object keys.`),a.mapKeyWarned=!0}return c}return JSON.stringify(l)}function Rf(u,l,a){const s=xa(u,void 0,a),c=xa(l,void 0,a);return new ct(s,c)}class ct{constructor(l,a=null){Object.defineProperty(this,Vt,{value:tp}),this.key=l,this.value=a}clone(l){let{key:a,value:s}=this;return ke(a)&&(a=a.clone(l)),ke(s)&&(s=s.clone(l)),new ct(a,s)}toJSON(l,a){const s=a!=null&&a.mapAsMap?new Map:{};return pp(a,s,this)}toString(l,a,s){return l!=null&&l.doc?$v(this,l,a,s):JSON.stringify(this)}}function yp(u,l,a){return(l.inFlow??u.flow?Qv:Vv)(u,l,a)}function Vv({comment:u,items:l},a,{blockItemPrefix:s,flowChars:c,itemIndent:o,onChompKeep:h,onComment:m}){const{indent:p,options:{commentString:g}}=a,b=Object.assign({},a,{indent:o,type:null});let v=!1;const O=[];for(let x=0;x<l.length;++x){const S=l[x];let w=null;if(ke(S))!v&&S.spaceBefore&&O.push(""),bu(a,O,S.commentBefore,v),S.comment&&(w=S.comment);else if(je(S)){const R=ke(S.key)?S.key:null;R&&(!v&&R.spaceBefore&&O.push(""),bu(a,O,R.commentBefore,v))}v=!1;let M=Ei(S,b,()=>w=null,()=>v=!0);w&&(M+=El(M,o,g(w))),v&&w&&(v=!1),O.push(s+M)}let E;if(O.length===0)E=c.start+c.end;else{E=O[0];for(let x=1;x<O.length;++x){const S=O[x];E+=S?`
${p}${S}`:`
`}}return u?(E+=`
`+wn(g(u),p),m&&m()):v&&h&&h(),E}function Qv({items:u},l,{flowChars:a,itemIndent:s}){const{indent:c,indentStep:o,flowCollectionPadding:h,options:{commentString:m}}=l;s+=o;const p=Object.assign({},l,{indent:s,inFlow:!0,type:null});let g=!1,b=0;const v=[];for(let x=0;x<u.length;++x){const S=u[x];let w=null;if(ke(S))S.spaceBefore&&v.push(""),bu(l,v,S.commentBefore,!1),S.comment&&(w=S.comment);else if(je(S)){const R=ke(S.key)?S.key:null;R&&(R.spaceBefore&&v.push(""),bu(l,v,R.commentBefore,!1),R.comment&&(g=!0));const K=ke(S.value)?S.value:null;K?(K.comment&&(w=K.comment),K.commentBefore&&(g=!0)):S.value==null&&(R!=null&&R.comment)&&(w=R.comment)}w&&(g=!0);let M=Ei(S,p,()=>w=null);g||(g=v.length>b||M.includes(`
`)),x<u.length-1?M+=",":l.options.trailingComma&&(l.options.lineWidth>0&&(g||(g=v.reduce((R,K)=>R+K.length+2,2)+(M.length+2)>l.options.lineWidth)),g&&(M+=",")),w&&(M+=El(M,s,m(w))),v.push(M),b=v.length}const{start:O,end:E}=a;if(v.length===0)return O+E;if(!g){const x=v.reduce((S,w)=>S+w.length+2,2);g=l.options.lineWidth>0&&x>l.options.lineWidth}if(g){let x=O;for(const S of v)x+=S?`
${o}${c}${S}`:`
`;return`${x}
${c}${E}`}else return`${O}${h}${v.join(" ")}${h}${E}`}function bu({indent:u,options:{commentString:l}},a,s,c){if(s&&c&&(s=s.replace(/^\n+/,"")),s){const o=wn(l(s),u);a.push(o.trimStart())}}function wl(u,l){const a=De(l)?l.value:l;for(const s of u)if(je(s)&&(s.key===l||s.key===a||De(s.key)&&s.key.value===a))return s}class Lt extends op{static get tagName(){return"tag:yaml.org,2002:map"}constructor(l){super(Pn,l),this.items=[]}static from(l,a,s){const{keepUndefined:c,replacer:o}=s,h=new this(l),m=(p,g)=>{if(typeof o=="function")g=o.call(a,p,g);else if(Array.isArray(o)&&!o.includes(p))return;(g!==void 0||c)&&h.items.push(Rf(p,g,s))};if(a instanceof Map)for(const[p,g]of a)m(p,g);else if(a&&typeof a=="object")for(const p of Object.keys(a))m(p,a[p]);return typeof l.sortMapEntries=="function"&&h.items.sort(l.sortMapEntries),h}add(l,a){var h;let s;je(l)?s=l:!l||typeof l!="object"||!("key"in l)?s=new ct(l,l==null?void 0:l.value):s=new ct(l.key,l.value);const c=wl(this.items,s.key),o=(h=this.schema)==null?void 0:h.sortMapEntries;if(c){if(!a)throw new Error(`Key ${s.key} already set`);De(c.value)&&fp(s.value)?c.value.value=s.value:c.value=s.value}else if(o){const m=this.items.findIndex(p=>o(s,p)<0);m===-1?this.items.push(s):this.items.splice(m,0,s)}else this.items.push(s)}delete(l){const a=wl(this.items,l);return a?this.items.splice(this.items.indexOf(a),1).length>0:!1}get(l,a){const s=wl(this.items,l),c=s==null?void 0:s.value;return(!a&&De(c)?c.value:c)??void 0}has(l){return!!wl(this.items,l)}set(l,a){this.add(new ct(l,a),!0)}toJSON(l,a,s){const c=s?new s:a!=null&&a.mapAsMap?new Map:{};a!=null&&a.onCreate&&a.onCreate(c);for(const o of this.items)pp(a,c,o);return c}toString(l,a,s){if(!l)return JSON.stringify(this);for(const c of this.items)if(!je(c))throw new Error(`Map items must all be pairs; found ${JSON.stringify(c)} instead`);return!l.allNullValues&&this.hasAllNullValues(!1)&&(l=Object.assign({},l,{allNullValues:!0})),yp(this,l,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:l.indent||"",onChompKeep:s,onComment:a})}}const Ci={collection:"map",default:!0,nodeClass:Lt,tag:"tag:yaml.org,2002:map",resolve(u,l){return Ni(u)||l("Expected a mapping for this tag"),u},createNode:(u,l,a)=>Lt.from(u,l,a)};class el extends op{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(l){super(_i,l),this.items=[]}add(l){this.items.push(l)}delete(l){const a=lu(l);return typeof a!="number"?!1:this.items.splice(a,1).length>0}get(l,a){const s=lu(l);if(typeof s!="number")return;const c=this.items[s];return!a&&De(c)?c.value:c}has(l){const a=lu(l);return typeof a=="number"&&a<this.items.length}set(l,a){const s=lu(l);if(typeof s!="number")throw new Error(`Expected a valid index, not ${l}.`);const c=this.items[s];De(c)&&fp(a)?c.value=a:this.items[s]=a}toJSON(l,a){const s=[];a!=null&&a.onCreate&&a.onCreate(s);let c=0;for(const o of this.items)s.push(Gt(o,String(c++),a));return s}toString(l,a,s){return l?yp(this,l,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(l.indent||"")+"  ",onChompKeep:s,onComment:a}):JSON.stringify(this)}static from(l,a,s){const{replacer:c}=s,o=new this(l);if(a&&Symbol.iterator in Object(a)){let h=0;for(let m of a){if(typeof c=="function"){const p=a instanceof Set?m:String(h++);m=c.call(a,p,m)}o.items.push(xa(m,void 0,s))}}return o}}function lu(u){let l=De(u)?u.value:u;return l&&typeof l=="string"&&(l=Number(l)),typeof l=="number"&&Number.isInteger(l)&&l>=0?l:null}const zi={collection:"seq",default:!0,nodeClass:el,tag:"tag:yaml.org,2002:seq",resolve(u,l){return Mi(u)||l("Expected a sequence for this tag"),u},createNode:(u,l,a)=>el.from(u,l,a)},zu={identify:u=>typeof u=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:u=>u,stringify(u,l,a,s){return l=Object.assign({actualString:!0},l),Ra(u,l,a,s)}},xu={identify:u=>u==null,createNode:()=>new ce(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new ce(null),stringify:({source:u},l)=>typeof u=="string"&&xu.test.test(u)?u:l.options.nullStr},jf={identify:u=>typeof u=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:u=>new ce(u[0]==="t"||u[0]==="T"),stringify({source:u,value:l},a){if(u&&jf.test.test(u)){const s=u[0]==="t"||u[0]==="T";if(l===s)return u}return l?a.options.trueStr:a.options.falseStr}};function Wt({format:u,minFractionDigits:l,tag:a,value:s}){if(typeof s=="bigint")return String(s);const c=typeof s=="number"?s:Number(s);if(!isFinite(c))return isNaN(c)?".nan":c<0?"-.inf":".inf";let o=Object.is(s,-0)?"-0":JSON.stringify(s);if(!u&&l&&(!a||a==="tag:yaml.org,2002:float")&&/^\d/.test(o)){let h=o.indexOf(".");h<0&&(h=o.length,o+=".");let m=l-(o.length-h-1);for(;m-- >0;)o+="0"}return o}const vp={identify:u=>typeof u=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:u=>u.slice(-3).toLowerCase()==="nan"?NaN:u[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Wt},bp={identify:u=>typeof u=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:u=>parseFloat(u),stringify(u){const l=Number(u.value);return isFinite(l)?l.toExponential():Wt(u)}},Sp={identify:u=>typeof u=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(u){const l=new ce(parseFloat(u)),a=u.indexOf(".");return a!==-1&&u[u.length-1]==="0"&&(l.minFractionDigits=u.length-a-1),l},stringify:Wt},Du=u=>typeof u=="bigint"||Number.isInteger(u),Bf=(u,l,a,{intAsBigInt:s})=>s?BigInt(u):parseInt(u.substring(l),a);function Tp(u,l,a){const{value:s}=u;return Du(s)&&s>=0?a+s.toString(l):Wt(u)}const Ep={identify:u=>Du(u)&&u>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(u,l,a)=>Bf(u,2,8,a),stringify:u=>Tp(u,8,"0o")},wp={identify:Du,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(u,l,a)=>Bf(u,0,10,a),stringify:Wt},Ap={identify:u=>Du(u)&&u>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(u,l,a)=>Bf(u,2,16,a),stringify:u=>Tp(u,16,"0x")},Xv=[Ci,zi,zu,xu,jf,Ep,wp,Ap,vp,bp,Sp];function vg(u){return typeof u=="bigint"||Number.isInteger(u)}const iu=({value:u})=>JSON.stringify(u),Zv=[{identify:u=>typeof u=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:u=>u,stringify:iu},{identify:u=>u==null,createNode:()=>new ce(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:iu},{identify:u=>typeof u=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:u=>u==="true",stringify:iu},{identify:vg,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(u,l,{intAsBigInt:a})=>a?BigInt(u):parseInt(u,10),stringify:({value:u})=>vg(u)?u.toString():JSON.stringify(u)},{identify:u=>typeof u=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:u=>parseFloat(u),stringify:iu}],Jv={default:!0,tag:"",test:/^/,resolve(u,l){return l(`Unresolved plain scalar ${JSON.stringify(u)}`),u}},Wv=[Ci,zi].concat(Zv,Jv),kf={identify:u=>u instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(u,l){if(typeof atob=="function"){const a=atob(u.replace(/[\n\r]/g,"")),s=new Uint8Array(a.length);for(let c=0;c<a.length;++c)s[c]=a.charCodeAt(c);return s}else return l("This environment does not support reading binary tags; either Buffer or atob is required"),u},stringify({comment:u,type:l,value:a},s,c,o){if(!a)return"";const h=a;let m;if(typeof btoa=="function"){let p="";for(let g=0;g<h.length;++g)p+=String.fromCharCode(h[g]);m=btoa(p)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(l??(l=ce.BLOCK_LITERAL),l!==ce.QUOTE_DOUBLE){const p=Math.max(s.options.lineWidth-s.indent.length,s.options.minContentWidth),g=Math.ceil(m.length/p),b=new Array(g);for(let v=0,O=0;v<g;++v,O+=p)b[v]=m.substr(O,p);m=b.join(l===ce.BLOCK_LITERAL?`
`:" ")}return Ra({comment:u,type:l,value:m},s,c,o)}};function Op(u,l){if(Mi(u))for(let a=0;a<u.items.length;++a){let s=u.items[a];if(!je(s)){if(Ni(s)){s.items.length>1&&l("Each pair must have its own sequence indicator");const c=s.items[0]||new ct(new ce(null));if(s.commentBefore&&(c.key.commentBefore=c.key.commentBefore?`${s.commentBefore}
${c.key.commentBefore}`:s.commentBefore),s.comment){const o=c.value??c.key;o.comment=o.comment?`${s.comment}
${o.comment}`:s.comment}s=c}u.items[a]=je(s)?s:new ct(s)}}else l("Expected a sequence for this tag");return u}function _p(u,l,a){const{replacer:s}=a,c=new el(u);c.tag="tag:yaml.org,2002:pairs";let o=0;if(l&&Symbol.iterator in Object(l))for(let h of l){typeof s=="function"&&(h=s.call(l,String(o++),h));let m,p;if(Array.isArray(h))if(h.length===2)m=h[0],p=h[1];else throw new TypeError(`Expected [key, value] tuple: ${h}`);else if(h&&h instanceof Object){const g=Object.keys(h);if(g.length===1)m=g[0],p=h[m];else throw new TypeError(`Expected tuple with one key, not ${g.length} keys`)}else m=h;c.items.push(Rf(m,p,a))}return c}const qf={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Op,createNode:_p};class Si extends el{constructor(){super(),this.add=Lt.prototype.add.bind(this),this.delete=Lt.prototype.delete.bind(this),this.get=Lt.prototype.get.bind(this),this.has=Lt.prototype.has.bind(this),this.set=Lt.prototype.set.bind(this),this.tag=Si.tag}toJSON(l,a){if(!a)return super.toJSON(l);const s=new Map;a!=null&&a.onCreate&&a.onCreate(s);for(const c of this.items){let o,h;if(je(c)?(o=Gt(c.key,"",a),h=Gt(c.value,o,a)):o=Gt(c,"",a),s.has(o))throw new Error("Ordered maps must not include duplicate keys");s.set(o,h)}return s}static from(l,a,s){const c=_p(l,a,s),o=new this;return o.items=c.items,o}}Si.tag="tag:yaml.org,2002:omap";const Hf={collection:"seq",identify:u=>u instanceof Map,nodeClass:Si,default:!1,tag:"tag:yaml.org,2002:omap",resolve(u,l){const a=Op(u,l),s=[];for(const{key:c}of a.items)De(c)&&(s.includes(c.value)?l(`Ordered maps must not include duplicate keys: ${c.value}`):s.push(c.value));return Object.assign(new Si,a)},createNode:(u,l,a)=>Si.from(u,l,a)};function Np({value:u,source:l},a){return l&&(u?Mp:Cp).test.test(l)?l:u?a.options.trueStr:a.options.falseStr}const Mp={identify:u=>u===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new ce(!0),stringify:Np},Cp={identify:u=>u===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new ce(!1),stringify:Np},Iv={identify:u=>typeof u=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:u=>u.slice(-3).toLowerCase()==="nan"?NaN:u[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Wt},Fv={identify:u=>typeof u=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:u=>parseFloat(u.replace(/_/g,"")),stringify(u){const l=Number(u.value);return isFinite(l)?l.toExponential():Wt(u)}},Pv={identify:u=>typeof u=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(u){const l=new ce(parseFloat(u.replace(/_/g,""))),a=u.indexOf(".");if(a!==-1){const s=u.substring(a+1).replace(/_/g,"");s[s.length-1]==="0"&&(l.minFractionDigits=s.length)}return l},stringify:Wt},ja=u=>typeof u=="bigint"||Number.isInteger(u);function Lu(u,l,a,{intAsBigInt:s}){const c=u[0];if((c==="-"||c==="+")&&(l+=1),u=u.substring(l).replace(/_/g,""),s){switch(a){case 2:u=`0b${u}`;break;case 8:u=`0o${u}`;break;case 16:u=`0x${u}`;break}const h=BigInt(u);return c==="-"?BigInt(-1)*h:h}const o=parseInt(u,a);return c==="-"?-1*o:o}function Yf(u,l,a){const{value:s}=u;if(ja(s)){const c=s.toString(l);return s<0?"-"+a+c.substr(1):a+c}return Wt(u)}const eb={identify:ja,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(u,l,a)=>Lu(u,2,2,a),stringify:u=>Yf(u,2,"0b")},tb={identify:ja,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(u,l,a)=>Lu(u,1,8,a),stringify:u=>Yf(u,8,"0")},nb={identify:ja,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(u,l,a)=>Lu(u,0,10,a),stringify:Wt},lb={identify:ja,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(u,l,a)=>Lu(u,2,16,a),stringify:u=>Yf(u,16,"0x")};class Ti extends Lt{constructor(l){super(l),this.tag=Ti.tag}add(l){let a;je(l)?a=l:l&&typeof l=="object"&&"key"in l&&"value"in l&&l.value===null?a=new ct(l.key,null):a=new ct(l,null),wl(this.items,a.key)||this.items.push(a)}get(l,a){const s=wl(this.items,l);return!a&&je(s)?De(s.key)?s.key.value:s.key:s}set(l,a){if(typeof a!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof a}`);const s=wl(this.items,l);s&&!a?this.items.splice(this.items.indexOf(s),1):!s&&a&&this.items.push(new ct(l))}toJSON(l,a){return super.toJSON(l,a,Set)}toString(l,a,s){if(!l)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},l,{allNullValues:!0}),a,s);throw new Error("Set items must all have null values")}static from(l,a,s){const{replacer:c}=s,o=new this(l);if(a&&Symbol.iterator in Object(a))for(let h of a)typeof c=="function"&&(h=c.call(a,h,h)),o.items.push(Rf(h,null,s));return o}}Ti.tag="tag:yaml.org,2002:set";const $f={collection:"map",identify:u=>u instanceof Set,nodeClass:Ti,default:!1,tag:"tag:yaml.org,2002:set",createNode:(u,l,a)=>Ti.from(u,l,a),resolve(u,l){if(Ni(u)){if(u.hasAllNullValues(!0))return Object.assign(new Ti,u);l("Set items must all have null values")}else l("Expected a mapping for this tag");return u}};function Kf(u,l){const a=u[0],s=a==="-"||a==="+"?u.substring(1):u,c=h=>l?BigInt(h):Number(h),o=s.replace(/_/g,"").split(":").reduce((h,m)=>h*c(60)+c(m),c(0));return a==="-"?c(-1)*o:o}function zp(u){let{value:l}=u,a=h=>h;if(typeof l=="bigint")a=h=>BigInt(h);else if(isNaN(l)||!isFinite(l))return Wt(u);let s="";l<0&&(s="-",l*=a(-1));const c=a(60),o=[l%c];return l<60?o.unshift(0):(l=(l-o[0])/c,o.unshift(l%c),l>=60&&(l=(l-o[0])/c,o.unshift(l))),s+o.map(h=>String(h).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const xp={identify:u=>typeof u=="bigint"||Number.isInteger(u),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(u,l,{intAsBigInt:a})=>Kf(u,a),stringify:zp},Dp={identify:u=>typeof u=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:u=>Kf(u,!1),stringify:zp},Uu={identify:u=>u instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(u){const l=u.match(Uu.test);if(!l)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,a,s,c,o,h,m]=l.map(Number),p=l[7]?Number((l[7]+"00").substr(1,3)):0;let g=Date.UTC(a,s-1,c,o||0,h||0,m||0,p);const b=l[8];if(b&&b!=="Z"){let v=Kf(b,!1);Math.abs(v)<30&&(v*=60),g-=6e4*v}return new Date(g)},stringify:({value:u})=>(u==null?void 0:u.toISOString().replace(/(T00:00:00)?\.000Z$/,""))??""},bg=[Ci,zi,zu,xu,Mp,Cp,eb,tb,nb,lb,Iv,Fv,Pv,kf,On,Hf,qf,$f,xp,Dp,Uu],Sg=new Map([["core",Xv],["failsafe",[Ci,zi,zu]],["json",Wv],["yaml11",bg],["yaml-1.1",bg]]),Tg={binary:kf,bool:jf,float:Sp,floatExp:bp,floatNaN:vp,floatTime:Dp,int:wp,intHex:Ap,intOct:Ep,intTime:xp,map:Ci,merge:On,null:xu,omap:Hf,pairs:qf,seq:zi,set:$f,timestamp:Uu},ib={"tag:yaml.org,2002:binary":kf,"tag:yaml.org,2002:merge":On,"tag:yaml.org,2002:omap":Hf,"tag:yaml.org,2002:pairs":qf,"tag:yaml.org,2002:set":$f,"tag:yaml.org,2002:timestamp":Uu};function df(u,l,a){const s=Sg.get(l);if(s&&!u)return a&&!s.includes(On)?s.concat(On):s.slice();let c=s;if(!c)if(Array.isArray(u))c=[];else{const o=Array.from(Sg.keys()).filter(h=>h!=="yaml11").map(h=>JSON.stringify(h)).join(", ");throw new Error(`Unknown schema "${l}"; use one of ${o} or define customTags array`)}if(Array.isArray(u))for(const o of u)c=c.concat(o);else typeof u=="function"&&(c=u(c.slice()));return a&&(c=c.concat(On)),c.reduce((o,h)=>{const m=typeof h=="string"?Tg[h]:h;if(!m){const p=JSON.stringify(h),g=Object.keys(Tg).map(b=>JSON.stringify(b)).join(", ");throw new Error(`Unknown custom tag ${p}; use one of ${g}`)}return o.includes(m)||o.push(m),o},[])}const ab=(u,l)=>u.key<l.key?-1:u.key>l.key?1:0;class Ru{constructor({compat:l,customTags:a,merge:s,resolveKnownTags:c,schema:o,sortMapEntries:h,toStringDefaults:m}){this.compat=Array.isArray(l)?df(l,"compat"):l?df(null,l):null,this.name=typeof o=="string"&&o||"core",this.knownTags=c?ib:{},this.tags=df(a,this.name,s),this.toStringOptions=m??null,Object.defineProperty(this,Pn,{value:Ci}),Object.defineProperty(this,nn,{value:zu}),Object.defineProperty(this,_i,{value:zi}),this.sortMapEntries=typeof h=="function"?h:h===!0?ab:null}clone(){const l=Object.create(Ru.prototype,Object.getOwnPropertyDescriptors(this));return l.tags=this.tags.slice(),l}}function sb(u,l){var p;const a=[];let s=l.directives===!0;if(l.directives!==!1&&u.directives){const g=u.directives.toString(u);g?(a.push(g),s=!0):u.directives.docStart&&(s=!0)}s&&a.push("---");const c=dp(u,l),{commentString:o}=c.options;if(u.commentBefore){a.length!==1&&a.unshift("");const g=o(u.commentBefore);a.unshift(wn(g,""))}let h=!1,m=null;if(u.contents){if(ke(u.contents)){if(u.contents.spaceBefore&&s&&a.push(""),u.contents.commentBefore){const v=o(u.contents.commentBefore);a.push(wn(v,""))}c.forceBlockIndent=!!u.comment,m=u.contents.comment}const g=m?void 0:()=>h=!0;let b=Ei(u.contents,c,()=>m=null,g);m&&(b+=El(b,"",o(m))),(b[0]==="|"||b[0]===">")&&a[a.length-1]==="---"?a[a.length-1]=`--- ${b}`:a.push(b)}else a.push(Ei(u.contents,c));if((p=u.directives)!=null&&p.docEnd)if(u.comment){const g=o(u.comment);g.includes(`
`)?(a.push("..."),a.push(wn(g,""))):a.push(`... ${g}`)}else a.push("...");else{let g=u.comment;g&&h&&(g=g.replace(/^\n+/,"")),g&&((!h||m)&&a[a.length-1]!==""&&a.push(""),a.push(wn(o(g),"")))}return a.join(`
`)+`
`}class xi{constructor(l,a,s){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Vt,{value:Of});let c=null;typeof a=="function"||Array.isArray(a)?c=a:s===void 0&&a&&(s=a,a=void 0);const o=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},s);this.options=o;let{version:h}=o;s!=null&&s._directives?(this.directives=s._directives.atDocument(),this.directives.yaml.explicit&&(h=this.directives.yaml.version)):this.directives=new ot({version:h}),this.setSchema(h,s),this.contents=l===void 0?null:this.createNode(l,c,s)}clone(){const l=Object.create(xi.prototype,{[Vt]:{value:Of}});return l.commentBefore=this.commentBefore,l.comment=this.comment,l.errors=this.errors.slice(),l.warnings=this.warnings.slice(),l.options=Object.assign({},this.options),this.directives&&(l.directives=this.directives.clone()),l.schema=this.schema.clone(),l.contents=ke(this.contents)?this.contents.clone(l.schema):this.contents,this.range&&(l.range=this.range.slice()),l}add(l){di(this.contents)&&this.contents.add(l)}addIn(l,a){di(this.contents)&&this.contents.addIn(l,a)}createAlias(l,a){if(!l.anchor){const s=cp(this);l.anchor=!a||s.has(a)?rp(a||"a",s):a}return new _u(l.anchor)}createNode(l,a,s){let c;if(typeof a=="function")l=a.call({"":l},"",l),c=a;else if(Array.isArray(a)){const w=R=>typeof R=="number"||R instanceof String||R instanceof Number,M=a.filter(w).map(String);M.length>0&&(a=a.concat(M)),c=a}else s===void 0&&a&&(s=a,a=void 0);const{aliasDuplicateObjects:o,anchorPrefix:h,flow:m,keepUndefined:p,onTagObj:g,tag:b}=s??{},{onAnchor:v,setAnchors:O,sourceObjects:E}=Uv(this,h||"a"),x={aliasDuplicateObjects:o??!0,keepUndefined:p??!1,onAnchor:v,onTagObj:g,replacer:c,schema:this.schema,sourceObjects:E},S=xa(l,b,x);return m&&Be(S)&&(S.flow=!0),O(),S}createPair(l,a,s={}){const c=this.createNode(l,null,s),o=this.createNode(a,null,s);return new ct(c,o)}delete(l){return di(this.contents)?this.contents.delete(l):!1}deleteIn(l){return Ca(l)?this.contents==null?!1:(this.contents=null,!0):di(this.contents)?this.contents.deleteIn(l):!1}get(l,a){return Be(this.contents)?this.contents.get(l,a):void 0}getIn(l,a){return Ca(l)?!a&&De(this.contents)?this.contents.value:this.contents:Be(this.contents)?this.contents.getIn(l,a):void 0}has(l){return Be(this.contents)?this.contents.has(l):!1}hasIn(l){return Ca(l)?this.contents!==void 0:Be(this.contents)?this.contents.hasIn(l):!1}set(l,a){this.contents==null?this.contents=vu(this.schema,[l],a):di(this.contents)&&this.contents.set(l,a)}setIn(l,a){Ca(l)?this.contents=a:this.contents==null?this.contents=vu(this.schema,Array.from(l),a):di(this.contents)&&this.contents.setIn(l,a)}setSchema(l,a={}){typeof l=="number"&&(l=String(l));let s;switch(l){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new ot({version:"1.1"}),s={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=l:this.directives=new ot({version:l}),s={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,s=null;break;default:{const c=JSON.stringify(l);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${c}`)}}if(a.schema instanceof Object)this.schema=a.schema;else if(s)this.schema=new Ru(Object.assign(s,a));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:l,jsonArg:a,mapAsMap:s,maxAliasCount:c,onAnchor:o,reviver:h}={}){const m={anchors:new Map,doc:this,keep:!l,mapAsMap:s===!0,mapKeyWarned:!1,maxAliasCount:typeof c=="number"?c:100},p=Gt(this.contents,a??"",m);if(typeof o=="function")for(const{count:g,res:b}of m.anchors.values())o(b,g);return typeof h=="function"?vi(h,{"":p},"",p):p}toJSON(l,a){return this.toJS({json:!0,jsonArg:l,mapAsMap:!1,onAnchor:a})}toString(l={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in l&&(!Number.isInteger(l.indent)||Number(l.indent)<=0)){const a=JSON.stringify(l.indent);throw new Error(`"indent" option must be a positive integer, not ${a}`)}return sb(this,l)}}function di(u){if(Be(u))return!0;throw new Error("Expected a YAML collection as document contents")}class Gf extends Error{constructor(l,a,s,c){super(),this.name=l,this.code=s,this.message=c,this.pos=a}}class Al extends Gf{constructor(l,a,s){super("YAMLParseError",l,a,s)}}class Lp extends Gf{constructor(l,a,s){super("YAMLWarning",l,a,s)}}const Su=(u,l)=>a=>{if(a.pos[0]===-1)return;a.linePos=a.pos.map(m=>l.linePos(m));const{line:s,col:c}=a.linePos[0];a.message+=` at line ${s}, column ${c}`;let o=c-1,h=u.substring(l.lineStarts[s-1],l.lineStarts[s]).replace(/[\n\r]+$/,"");if(o>=60&&h.length>80){const m=Math.min(o-39,h.length-79);h="â€¦"+h.substring(m),o-=m-1}if(h.length>80&&(h=h.substring(0,79)+"â€¦"),s>1&&/^ *$/.test(h.substring(0,o))){let m=u.substring(l.lineStarts[s-2],l.lineStarts[s-1]);m.length>80&&(m=m.substring(0,79)+`â€¦
`),h=m+h}if(/[^ ]/.test(h)){let m=1;const p=a.linePos[1];(p==null?void 0:p.line)===s&&p.col>c&&(m=Math.max(1,Math.min(p.col-c,80-o)));const g=" ".repeat(o)+"^".repeat(m);a.message+=`:

${h}
${g}
`}};function wi(u,{flow:l,indicator:a,next:s,offset:c,onError:o,parentIndent:h,startOnNewline:m}){let p=!1,g=m,b=m,v="",O="",E=!1,x=!1,S=null,w=null,M=null,R=null,K=null,Q=null,Z=null;for(const V of u)switch(x&&(V.type!=="space"&&V.type!=="newline"&&V.type!=="comma"&&o(V.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),x=!1),S&&(g&&V.type!=="comment"&&V.type!=="newline"&&o(S,"TAB_AS_INDENT","Tabs are not allowed as indentation"),S=null),V.type){case"space":!l&&(a!=="doc-start"||(s==null?void 0:s.type)!=="flow-collection")&&V.source.includes("	")&&(S=V),b=!0;break;case"comment":{b||o(V,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const U=V.source.substring(1)||" ";v?v+=O+U:v=U,O="",g=!1;break}case"newline":g?v?v+=V.source:(!Q||a!=="seq-item-ind")&&(p=!0):O+=V.source,g=!0,E=!0,(w||M)&&(R=V),b=!0;break;case"anchor":w&&o(V,"MULTIPLE_ANCHORS","A node can have at most one anchor"),V.source.endsWith(":")&&o(V.offset+V.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),w=V,Z??(Z=V.offset),g=!1,b=!1,x=!0;break;case"tag":{M&&o(V,"MULTIPLE_TAGS","A node can have at most one tag"),M=V,Z??(Z=V.offset),g=!1,b=!1,x=!0;break}case a:(w||M)&&o(V,"BAD_PROP_ORDER",`Anchors and tags must be after the ${V.source} indicator`),Q&&o(V,"UNEXPECTED_TOKEN",`Unexpected ${V.source} in ${l??"collection"}`),Q=V,g=a==="seq-item-ind"||a==="explicit-key-ind",b=!1;break;case"comma":if(l){K&&o(V,"UNEXPECTED_TOKEN",`Unexpected , in ${l}`),K=V,g=!1,b=!1;break}default:o(V,"UNEXPECTED_TOKEN",`Unexpected ${V.type} token`),g=!1,b=!1}const W=u[u.length-1],k=W?W.offset+W.source.length:c;return x&&s&&s.type!=="space"&&s.type!=="newline"&&s.type!=="comma"&&(s.type!=="scalar"||s.source!=="")&&o(s.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),S&&(g&&S.indent<=h||(s==null?void 0:s.type)==="block-map"||(s==null?void 0:s.type)==="block-seq")&&o(S,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:K,found:Q,spaceBefore:p,comment:v,hasNewline:E,anchor:w,tag:M,newlineAfterProp:R,end:k,start:Z??k}}function Da(u){if(!u)return null;switch(u.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(u.source.includes(`
`))return!0;if(u.end){for(const l of u.end)if(l.type==="newline")return!0}return!1;case"flow-collection":for(const l of u.items){for(const a of l.start)if(a.type==="newline")return!0;if(l.sep){for(const a of l.sep)if(a.type==="newline")return!0}if(Da(l.key)||Da(l.value))return!0}return!1;default:return!0}}function Cf(u,l,a){if((l==null?void 0:l.type)==="flow-collection"){const s=l.end[0];s.indent===u&&(s.source==="]"||s.source==="}")&&Da(l)&&a(s,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function Up(u,l,a){const{uniqueKeys:s}=u.options;if(s===!1)return!1;const c=typeof s=="function"?s:(o,h)=>o===h||De(o)&&De(h)&&o.value===h.value;return l.some(o=>c(o.key,a))}const Eg="All mapping items must start at the same column";function ub({composeNode:u,composeEmptyNode:l},a,s,c,o){var b;const h=(o==null?void 0:o.nodeClass)??Lt,m=new h(a.schema);a.atRoot&&(a.atRoot=!1);let p=s.offset,g=null;for(const v of s.items){const{start:O,key:E,sep:x,value:S}=v,w=wi(O,{indicator:"explicit-key-ind",next:E??(x==null?void 0:x[0]),offset:p,onError:c,parentIndent:s.indent,startOnNewline:!0}),M=!w.found;if(M){if(E&&(E.type==="block-seq"?c(p,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in E&&E.indent!==s.indent&&c(p,"BAD_INDENT",Eg)),!w.anchor&&!w.tag&&!x){g=w.end,w.comment&&(m.comment?m.comment+=`
`+w.comment:m.comment=w.comment);continue}(w.newlineAfterProp||Da(E))&&c(E??O[O.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else((b=w.found)==null?void 0:b.indent)!==s.indent&&c(p,"BAD_INDENT",Eg);a.atKey=!0;const R=w.end,K=E?u(a,E,w,c):l(a,R,O,null,w,c);a.schema.compat&&Cf(s.indent,E,c),a.atKey=!1,Up(a,m.items,K)&&c(R,"DUPLICATE_KEY","Map keys must be unique");const Q=wi(x??[],{indicator:"map-value-ind",next:S,offset:K.range[2],onError:c,parentIndent:s.indent,startOnNewline:!E||E.type==="block-scalar"});if(p=Q.end,Q.found){M&&((S==null?void 0:S.type)==="block-map"&&!Q.hasNewline&&c(p,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),a.options.strict&&w.start<Q.found.offset-1024&&c(K.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const Z=S?u(a,S,Q,c):l(a,p,x,null,Q,c);a.schema.compat&&Cf(s.indent,S,c),p=Z.range[2];const W=new ct(K,Z);a.options.keepSourceTokens&&(W.srcToken=v),m.items.push(W)}else{M&&c(K.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),Q.comment&&(K.comment?K.comment+=`
`+Q.comment:K.comment=Q.comment);const Z=new ct(K);a.options.keepSourceTokens&&(Z.srcToken=v),m.items.push(Z)}}return g&&g<p&&c(g,"IMPOSSIBLE","Map comment with trailing content"),m.range=[s.offset,p,g??p],m}function cb({composeNode:u,composeEmptyNode:l},a,s,c,o){const h=(o==null?void 0:o.nodeClass)??el,m=new h(a.schema);a.atRoot&&(a.atRoot=!1),a.atKey&&(a.atKey=!1);let p=s.offset,g=null;for(const{start:b,value:v}of s.items){const O=wi(b,{indicator:"seq-item-ind",next:v,offset:p,onError:c,parentIndent:s.indent,startOnNewline:!0});if(!O.found)if(O.anchor||O.tag||v)(v==null?void 0:v.type)==="block-seq"?c(O.end,"BAD_INDENT","All sequence items must start at the same column"):c(p,"MISSING_CHAR","Sequence item without - indicator");else{g=O.end,O.comment&&(m.comment=O.comment);continue}const E=v?u(a,v,O,c):l(a,O.end,b,null,O,c);a.schema.compat&&Cf(s.indent,v,c),p=E.range[2],m.items.push(E)}return m.range=[s.offset,p,g??p],m}function Ba(u,l,a,s){let c="";if(u){let o=!1,h="";for(const m of u){const{source:p,type:g}=m;switch(g){case"space":o=!0;break;case"comment":{a&&!o&&s(m,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const b=p.substring(1)||" ";c?c+=h+b:c=b,h="";break}case"newline":c&&(h+=p),o=!0;break;default:s(m,"UNEXPECTED_TOKEN",`Unexpected ${g} at node end`)}l+=p.length}}return{comment:c,offset:l}}const mf="Block collections are not allowed within flow collections",gf=u=>u&&(u.type==="block-map"||u.type==="block-seq");function rb({composeNode:u,composeEmptyNode:l},a,s,c,o){var w;const h=s.start.source==="{",m=h?"flow map":"flow sequence",p=(o==null?void 0:o.nodeClass)??(h?Lt:el),g=new p(a.schema);g.flow=!0;const b=a.atRoot;b&&(a.atRoot=!1),a.atKey&&(a.atKey=!1);let v=s.offset+s.start.source.length;for(let M=0;M<s.items.length;++M){const R=s.items[M],{start:K,key:Q,sep:Z,value:W}=R,k=wi(K,{flow:m,indicator:"explicit-key-ind",next:Q??(Z==null?void 0:Z[0]),offset:v,onError:c,parentIndent:s.indent,startOnNewline:!1});if(!k.found){if(!k.anchor&&!k.tag&&!Z&&!W){M===0&&k.comma?c(k.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${m}`):M<s.items.length-1&&c(k.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${m}`),k.comment&&(g.comment?g.comment+=`
`+k.comment:g.comment=k.comment),v=k.end;continue}!h&&a.options.strict&&Da(Q)&&c(Q,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(M===0)k.comma&&c(k.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${m}`);else if(k.comma||c(k.start,"MISSING_CHAR",`Missing , between ${m} items`),k.comment){let V="";e:for(const U of K)switch(U.type){case"comma":case"space":break;case"comment":V=U.source.substring(1);break e;default:break e}if(V){let U=g.items[g.items.length-1];je(U)&&(U=U.value??U.key),U.comment?U.comment+=`
`+V:U.comment=V,k.comment=k.comment.substring(V.length+1)}}if(!h&&!Z&&!k.found){const V=W?u(a,W,k,c):l(a,k.end,Z,null,k,c);g.items.push(V),v=V.range[2],gf(W)&&c(V.range,"BLOCK_IN_FLOW",mf)}else{a.atKey=!0;const V=k.end,U=Q?u(a,Q,k,c):l(a,V,K,null,k,c);gf(Q)&&c(U.range,"BLOCK_IN_FLOW",mf),a.atKey=!1;const ae=wi(Z??[],{flow:m,indicator:"map-value-ind",next:W,offset:U.range[2],onError:c,parentIndent:s.indent,startOnNewline:!1});if(ae.found){if(!h&&!k.found&&a.options.strict){if(Z)for(const ee of Z){if(ee===ae.found)break;if(ee.type==="newline"){c(ee,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}k.start<ae.found.offset-1024&&c(ae.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else W&&("source"in W&&((w=W.source)==null?void 0:w[0])===":"?c(W,"MISSING_CHAR",`Missing space after : in ${m}`):c(ae.start,"MISSING_CHAR",`Missing , or : between ${m} items`));const te=W?u(a,W,ae,c):ae.found?l(a,ae.end,Z,null,ae,c):null;te?gf(W)&&c(te.range,"BLOCK_IN_FLOW",mf):ae.comment&&(U.comment?U.comment+=`
`+ae.comment:U.comment=ae.comment);const $=new ct(U,te);if(a.options.keepSourceTokens&&($.srcToken=R),h){const ee=g;Up(a,ee.items,U)&&c(V,"DUPLICATE_KEY","Map keys must be unique"),ee.items.push($)}else{const ee=new Lt(a.schema);ee.flow=!0,ee.items.push($);const we=(te??U).range;ee.range=[U.range[0],we[1],we[2]],g.items.push(ee)}v=te?te.range[2]:ae.end}}const O=h?"}":"]",[E,...x]=s.end;let S=v;if((E==null?void 0:E.source)===O)S=E.offset+E.source.length;else{const M=m[0].toUpperCase()+m.substring(1),R=b?`${M} must end with a ${O}`:`${M} in block collection must be sufficiently indented and end with a ${O}`;c(v,b?"MISSING_CHAR":"BAD_INDENT",R),E&&E.source.length!==1&&x.unshift(E)}if(x.length>0){const M=Ba(x,S,a.options.strict,c);M.comment&&(g.comment?g.comment+=`
`+M.comment:g.comment=M.comment),g.range=[s.offset,S,M.offset]}else g.range=[s.offset,S,S];return g}function pf(u,l,a,s,c,o){const h=a.type==="block-map"?ub(u,l,a,s,o):a.type==="block-seq"?cb(u,l,a,s,o):rb(u,l,a,s,o),m=h.constructor;return c==="!"||c===m.tagName?(h.tag=m.tagName,h):(c&&(h.tag=c),h)}function fb(u,l,a,s,c){var O;const o=s.tag,h=o?l.directives.tagName(o.source,E=>c(o,"TAG_RESOLVE_FAILED",E)):null;if(a.type==="block-seq"){const{anchor:E,newlineAfterProp:x}=s,S=E&&o?E.offset>o.offset?E:o:E??o;S&&(!x||x.offset<S.offset)&&c(S,"MISSING_CHAR","Missing newline after block sequence props")}const m=a.type==="block-map"?"map":a.type==="block-seq"?"seq":a.start.source==="{"?"map":"seq";if(!o||!h||h==="!"||h===Lt.tagName&&m==="map"||h===el.tagName&&m==="seq")return pf(u,l,a,c,h);let p=l.schema.tags.find(E=>E.tag===h&&E.collection===m);if(!p){const E=l.schema.knownTags[h];if((E==null?void 0:E.collection)===m)l.schema.tags.push(Object.assign({},E,{default:!1})),p=E;else return E?c(o,"BAD_COLLECTION_TYPE",`${E.tag} used for ${m} collection, but expects ${E.collection??"scalar"}`,!0):c(o,"TAG_RESOLVE_FAILED",`Unresolved tag: ${h}`,!0),pf(u,l,a,c,h)}const g=pf(u,l,a,c,h,p),b=((O=p.resolve)==null?void 0:O.call(p,g,E=>c(o,"TAG_RESOLVE_FAILED",E),l.options))??g,v=ke(b)?b:new ce(b);return v.range=g.range,v.tag=h,p!=null&&p.format&&(v.format=p.format),v}function Rp(u,l,a){const s=l.offset,c=ob(l,u.options.strict,a);if(!c)return{value:"",type:null,comment:"",range:[s,s,s]};const o=c.mode===">"?ce.BLOCK_FOLDED:ce.BLOCK_LITERAL,h=l.source?hb(l.source):[];let m=h.length;for(let S=h.length-1;S>=0;--S){const w=h[S][1];if(w===""||w==="\r")m=S;else break}if(m===0){const S=c.chomp==="+"&&h.length>0?`
`.repeat(Math.max(1,h.length-1)):"";let w=s+c.length;return l.source&&(w+=l.source.length),{value:S,type:o,comment:c.comment,range:[s,w,w]}}let p=l.indent+c.indent,g=l.offset+c.length,b=0;for(let S=0;S<m;++S){const[w,M]=h[S];if(M===""||M==="\r")c.indent===0&&w.length>p&&(p=w.length);else{w.length<p&&a(g+w.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),c.indent===0&&(p=w.length),b=S,p===0&&!u.atRoot&&a(g,"BAD_INDENT","Block scalar values in collections must be indented");break}g+=w.length+M.length+1}for(let S=h.length-1;S>=m;--S)h[S][0].length>p&&(m=S+1);let v="",O="",E=!1;for(let S=0;S<b;++S)v+=h[S][0].slice(p)+`
`;for(let S=b;S<m;++S){let[w,M]=h[S];g+=w.length+M.length+1;const R=M[M.length-1]==="\r";if(R&&(M=M.slice(0,-1)),M&&w.length<p){const Q=`Block scalar lines must not be less indented than their ${c.indent?"explicit indentation indicator":"first line"}`;a(g-M.length-(R?2:1),"BAD_INDENT",Q),w=""}o===ce.BLOCK_LITERAL?(v+=O+w.slice(p)+M,O=`
`):w.length>p||M[0]==="	"?(O===" "?O=`
`:!E&&O===`
`&&(O=`

`),v+=O+w.slice(p)+M,O=`
`,E=!0):M===""?O===`
`?v+=`
`:O=`
`:(v+=O+M,O=" ",E=!1)}switch(c.chomp){case"-":break;case"+":for(let S=m;S<h.length;++S)v+=`
`+h[S][0].slice(p);v[v.length-1]!==`
`&&(v+=`
`);break;default:v+=`
`}const x=s+c.length+l.source.length;return{value:v,type:o,comment:c.comment,range:[s,x,x]}}function ob({offset:u,props:l},a,s){if(l[0].type!=="block-scalar-header")return s(l[0],"IMPOSSIBLE","Block scalar header not found"),null;const{source:c}=l[0],o=c[0];let h=0,m="",p=-1;for(let O=1;O<c.length;++O){const E=c[O];if(!m&&(E==="-"||E==="+"))m=E;else{const x=Number(E);!h&&x?h=x:p===-1&&(p=u+O)}}p!==-1&&s(p,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${c}`);let g=!1,b="",v=c.length;for(let O=1;O<l.length;++O){const E=l[O];switch(E.type){case"space":g=!0;case"newline":v+=E.source.length;break;case"comment":a&&!g&&s(E,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),v+=E.source.length,b=E.source.substring(1);break;case"error":s(E,"UNEXPECTED_TOKEN",E.message),v+=E.source.length;break;default:{const x=`Unexpected token in block scalar header: ${E.type}`;s(E,"UNEXPECTED_TOKEN",x);const S=E.source;S&&typeof S=="string"&&(v+=S.length)}}}return{mode:o,indent:h,chomp:m,comment:b,length:v}}function hb(u){const l=u.split(/\n( *)/),a=l[0],s=a.match(/^( *)/),o=[s!=null&&s[1]?[s[1],a.slice(s[1].length)]:["",a]];for(let h=1;h<l.length;h+=2)o.push([l[h],l[h+1]]);return o}function jp(u,l,a){const{offset:s,type:c,source:o,end:h}=u;let m,p;const g=(O,E,x)=>a(s+O,E,x);switch(c){case"scalar":m=ce.PLAIN,p=db(o,g);break;case"single-quoted-scalar":m=ce.QUOTE_SINGLE,p=mb(o,g);break;case"double-quoted-scalar":m=ce.QUOTE_DOUBLE,p=gb(o,g);break;default:return a(u,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${c}`),{value:"",type:null,comment:"",range:[s,s+o.length,s+o.length]}}const b=s+o.length,v=Ba(h,b,l,a);return{value:p,type:m,comment:v.comment,range:[s,b,v.offset]}}function db(u,l){let a="";switch(u[0]){case"	":a="a tab character";break;case",":a="flow indicator character ,";break;case"%":a="directive indicator character %";break;case"|":case">":{a=`block scalar indicator ${u[0]}`;break}case"@":case"`":{a=`reserved character ${u[0]}`;break}}return a&&l(0,"BAD_SCALAR_START",`Plain value cannot start with ${a}`),Bp(u)}function mb(u,l){return(u[u.length-1]!=="'"||u.length===1)&&l(u.length,"MISSING_CHAR","Missing closing 'quote"),Bp(u.slice(1,-1)).replace(/''/g,"'")}function Bp(u){let l,a;try{l=new RegExp(`(.*?)(?<![ 	])[ 	]*\r?
`,"sy"),a=new RegExp(`[ 	]*(.*?)(?:(?<![ 	])[ 	]*)?\r?
`,"sy")}catch{l=/(.*?)[ \t]*\r?\n/sy,a=/[ \t]*(.*?)[ \t]*\r?\n/sy}let s=l.exec(u);if(!s)return u;let c=s[1],o=" ",h=l.lastIndex;for(a.lastIndex=h;s=a.exec(u);)s[1]===""?o===`
`?c+=o:o=`
`:(c+=o+s[1],o=" "),h=a.lastIndex;const m=/[ \t]*(.*)/sy;return m.lastIndex=h,s=m.exec(u),c+o+((s==null?void 0:s[1])??"")}function gb(u,l){let a="";for(let s=1;s<u.length-1;++s){const c=u[s];if(!(c==="\r"&&u[s+1]===`
`))if(c===`
`){const{fold:o,offset:h}=pb(u,s);a+=o,s=h}else if(c==="\\"){let o=u[++s];const h=yb[o];if(h)a+=h;else if(o===`
`)for(o=u[s+1];o===" "||o==="	";)o=u[++s+1];else if(o==="\r"&&u[s+1]===`
`)for(o=u[++s+1];o===" "||o==="	";)o=u[++s+1];else if(o==="x"||o==="u"||o==="U"){const m={x:2,u:4,U:8}[o];a+=vb(u,s+1,m,l),s+=m}else{const m=u.substr(s-1,2);l(s-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${m}`),a+=m}}else if(c===" "||c==="	"){const o=s;let h=u[s+1];for(;h===" "||h==="	";)h=u[++s+1];h!==`
`&&!(h==="\r"&&u[s+2]===`
`)&&(a+=s>o?u.slice(o,s+1):c)}else a+=c}return(u[u.length-1]!=='"'||u.length===1)&&l(u.length,"MISSING_CHAR",'Missing closing "quote'),a}function pb(u,l){let a="",s=u[l+1];for(;(s===" "||s==="	"||s===`
`||s==="\r")&&!(s==="\r"&&u[l+2]!==`
`);)s===`
`&&(a+=`
`),l+=1,s=u[l+1];return a||(a=" "),{fold:a,offset:l}}const yb={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
`,r:"\r",t:"	",v:"\v",N:"Â…",_:"Â ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\","	":"	"};function vb(u,l,a,s){const c=u.substr(l,a),h=c.length===a&&/^[0-9a-fA-F]+$/.test(c)?parseInt(c,16):NaN;if(isNaN(h)){const m=u.substr(l-2,a+2);return s(l-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${m}`),m}return String.fromCodePoint(h)}function kp(u,l,a,s){const{value:c,type:o,comment:h,range:m}=l.type==="block-scalar"?Rp(u,l,s):jp(l,u.options.strict,s),p=a?u.directives.tagName(a.source,v=>s(a,"TAG_RESOLVE_FAILED",v)):null;let g;u.options.stringKeys&&u.atKey?g=u.schema[nn]:p?g=bb(u.schema,c,p,a,s):l.type==="scalar"?g=Sb(u,c,l,s):g=u.schema[nn];let b;try{const v=g.resolve(c,O=>s(a??l,"TAG_RESOLVE_FAILED",O),u.options);b=De(v)?v:new ce(v)}catch(v){const O=v instanceof Error?v.message:String(v);s(a??l,"TAG_RESOLVE_FAILED",O),b=new ce(c)}return b.range=m,b.source=c,o&&(b.type=o),p&&(b.tag=p),g.format&&(b.format=g.format),h&&(b.comment=h),b}function bb(u,l,a,s,c){var m;if(a==="!")return u[nn];const o=[];for(const p of u.tags)if(!p.collection&&p.tag===a)if(p.default&&p.test)o.push(p);else return p;for(const p of o)if((m=p.test)!=null&&m.test(l))return p;const h=u.knownTags[a];return h&&!h.collection?(u.tags.push(Object.assign({},h,{default:!1,test:void 0})),h):(c(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${a}`,a!=="tag:yaml.org,2002:str"),u[nn])}function Sb({atKey:u,directives:l,schema:a},s,c,o){const h=a.tags.find(m=>{var p;return(m.default===!0||u&&m.default==="key")&&((p=m.test)==null?void 0:p.test(s))})||a[nn];if(a.compat){const m=a.compat.find(p=>{var g;return p.default&&((g=p.test)==null?void 0:g.test(s))})??a[nn];if(h.tag!==m.tag){const p=l.tagString(h.tag),g=l.tagString(m.tag),b=`Value may be parsed as either ${p} or ${g}`;o(c,"TAG_RESOLVE_FAILED",b,!0)}}return h}function Tb(u,l,a){if(l){a??(a=l.length);for(let s=a-1;s>=0;--s){let c=l[s];switch(c.type){case"space":case"comment":case"newline":u-=c.source.length;continue}for(c=l[++s];(c==null?void 0:c.type)==="space";)u+=c.source.length,c=l[++s];break}}return u}const Eb={composeNode:qp,composeEmptyNode:Vf};function qp(u,l,a,s){const c=u.atKey,{spaceBefore:o,comment:h,anchor:m,tag:p}=a;let g,b=!0;switch(l.type){case"alias":g=wb(u,l,s),(m||p)&&s(l,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":g=kp(u,l,p,s),m&&(g.anchor=m.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{g=fb(Eb,u,l,a,s),m&&(g.anchor=m.source.substring(1))}catch(v){const O=v instanceof Error?v.message:String(v);s(l,"RESOURCE_EXHAUSTION",O)}break;default:{const v=l.type==="error"?l.message:`Unsupported token (type: ${l.type})`;s(l,"UNEXPECTED_TOKEN",v),b=!1}}return g??(g=Vf(u,l.offset,void 0,null,a,s)),m&&g.anchor===""&&s(m,"BAD_ALIAS","Anchor cannot be an empty string"),c&&u.options.stringKeys&&(!De(g)||typeof g.value!="string"||g.tag&&g.tag!=="tag:yaml.org,2002:str")&&s(p??l,"NON_STRING_KEY","With stringKeys, all keys must be strings"),o&&(g.spaceBefore=!0),h&&(l.type==="scalar"&&l.source===""?g.comment=h:g.commentBefore=h),u.options.keepSourceTokens&&b&&(g.srcToken=l),g}function Vf(u,l,a,s,{spaceBefore:c,comment:o,anchor:h,tag:m,end:p},g){const b={type:"scalar",offset:Tb(l,a,s),indent:-1,source:""},v=kp(u,b,m,g);return h&&(v.anchor=h.source.substring(1),v.anchor===""&&g(h,"BAD_ALIAS","Anchor cannot be an empty string")),c&&(v.spaceBefore=!0),o&&(v.comment=o,v.range[2]=p),v}function wb({options:u},{offset:l,source:a,end:s},c){const o=new _u(a.substring(1));o.source===""&&c(l,"BAD_ALIAS","Alias cannot be an empty string"),o.source.endsWith(":")&&c(l+a.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const h=l+a.length,m=Ba(s,h,u.strict,c);return o.range=[l,h,m.offset],m.comment&&(o.comment=m.comment),o}function Ab(u,l,{offset:a,start:s,value:c,end:o},h){const m=Object.assign({_directives:l},u),p=new xi(void 0,m),g={atKey:!1,atRoot:!0,directives:p.directives,options:p.options,schema:p.schema},b=wi(s,{indicator:"doc-start",next:c??(o==null?void 0:o[0]),offset:a,onError:h,parentIndent:0,startOnNewline:!0});b.found&&(p.directives.docStart=!0,c&&(c.type==="block-map"||c.type==="block-seq")&&!b.hasNewline&&h(b.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),p.contents=c?qp(g,c,b,h):Vf(g,b.end,s,null,b,h);const v=p.contents.range[2],O=Ba(o,v,!1,h);return O.comment&&(p.comment=O.comment),p.range=[a,v,O.offset],p}function Ma(u){if(typeof u=="number")return[u,u+1];if(Array.isArray(u))return u.length===2?u:[u[0],u[1]];const{offset:l,source:a}=u;return[l,l+(typeof a=="string"?a.length:1)]}function wg(u){var c;let l="",a=!1,s=!1;for(let o=0;o<u.length;++o){const h=u[o];switch(h[0]){case"#":l+=(l===""?"":s?`

`:`
`)+(h.substring(1)||" "),a=!0,s=!1;break;case"%":((c=u[o+1])==null?void 0:c[0])!=="#"&&(o+=1),a=!1;break;default:a||(s=!0),a=!1}}return{comment:l,afterEmptyLine:s}}class Qf{constructor(l={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(a,s,c,o)=>{const h=Ma(a);o?this.warnings.push(new Lp(h,s,c)):this.errors.push(new Al(h,s,c))},this.directives=new ot({version:l.version||"1.2"}),this.options=l}decorate(l,a){const{comment:s,afterEmptyLine:c}=wg(this.prelude);if(s){const o=l.contents;if(a)l.comment=l.comment?`${l.comment}
${s}`:s;else if(c||l.directives.docStart||!o)l.commentBefore=s;else if(Be(o)&&!o.flow&&o.items.length>0){let h=o.items[0];je(h)&&(h=h.key);const m=h.commentBefore;h.commentBefore=m?`${s}
${m}`:s}else{const h=o.commentBefore;o.commentBefore=h?`${s}
${h}`:s}}a?(Array.prototype.push.apply(l.errors,this.errors),Array.prototype.push.apply(l.warnings,this.warnings)):(l.errors=this.errors,l.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:wg(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(l,a=!1,s=-1){for(const c of l)yield*this.next(c);yield*this.end(a,s)}*next(l){switch(l.type){case"directive":this.directives.add(l.source,(a,s,c)=>{const o=Ma(l);o[0]+=a,this.onError(o,"BAD_DIRECTIVE",s,c)}),this.prelude.push(l.source),this.atDirectives=!0;break;case"document":{const a=Ab(this.options,this.directives,l,this.onError);this.atDirectives&&!a.directives.docStart&&this.onError(l,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(a,!1),this.doc&&(yield this.doc),this.doc=a,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(l.source);break;case"error":{const a=l.source?`${l.message}: ${JSON.stringify(l.source)}`:l.message,s=new Al(Ma(l),"UNEXPECTED_TOKEN",a);this.atDirectives||!this.doc?this.errors.push(s):this.doc.errors.push(s);break}case"doc-end":{if(!this.doc){const s="Unexpected doc-end without preceding document";this.errors.push(new Al(Ma(l),"UNEXPECTED_TOKEN",s));break}this.doc.directives.docEnd=!0;const a=Ba(l.end,l.offset+l.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),a.comment){const s=this.doc.comment;this.doc.comment=s?`${s}
${a.comment}`:a.comment}this.doc.range[2]=a.offset;break}default:this.errors.push(new Al(Ma(l),"UNEXPECTED_TOKEN",`Unsupported token ${l.type}`))}}*end(l=!1,a=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(l){const s=Object.assign({_directives:this.directives},this.options),c=new xi(void 0,s);this.atDirectives&&this.onError(a,"MISSING_CHAR","Missing directives-end indicator line"),c.range=[0,a,a],this.decorate(c,!1),yield c}}}function Ob(u,l=!0,a){if(u){const s=(c,o,h)=>{const m=typeof c=="number"?c:Array.isArray(c)?c[0]:c.offset;if(a)a(m,o,h);else throw new Al([m,m+1],o,h)};switch(u.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return jp(u,l,s);case"block-scalar":return Rp({options:{strict:l}},u,s)}}return null}function _b(u,l){const{implicitKey:a=!1,indent:s,inFlow:c=!1,offset:o=-1,type:h="PLAIN"}=l,m=Ra({type:h,value:u},{implicitKey:a,indent:s>0?" ".repeat(s):"",inFlow:c,options:{blockQuote:!0,lineWidth:-1}}),p=l.end??[{type:"newline",offset:-1,indent:s,source:`
`}];switch(m[0]){case"|":case">":{const g=m.indexOf(`
`),b=m.substring(0,g),v=m.substring(g+1)+`
`,O=[{type:"block-scalar-header",offset:o,indent:s,source:b}];return Hp(O,p)||O.push({type:"newline",offset:-1,indent:s,source:`
`}),{type:"block-scalar",offset:o,indent:s,props:O,source:v}}case'"':return{type:"double-quoted-scalar",offset:o,indent:s,source:m,end:p};case"'":return{type:"single-quoted-scalar",offset:o,indent:s,source:m,end:p};default:return{type:"scalar",offset:o,indent:s,source:m,end:p}}}function Nb(u,l,a={}){let{afterKey:s=!1,implicitKey:c=!1,inFlow:o=!1,type:h}=a,m="indent"in u?u.indent:null;if(s&&typeof m=="number"&&(m+=2),!h)switch(u.type){case"single-quoted-scalar":h="QUOTE_SINGLE";break;case"double-quoted-scalar":h="QUOTE_DOUBLE";break;case"block-scalar":{const g=u.props[0];if(g.type!=="block-scalar-header")throw new Error("Invalid block scalar header");h=g.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:h="PLAIN"}const p=Ra({type:h,value:l},{implicitKey:c||m===null,indent:m!==null&&m>0?" ".repeat(m):"",inFlow:o,options:{blockQuote:!0,lineWidth:-1}});switch(p[0]){case"|":case">":Mb(u,p);break;case'"':yf(u,p,"double-quoted-scalar");break;case"'":yf(u,p,"single-quoted-scalar");break;default:yf(u,p,"scalar")}}function Mb(u,l){const a=l.indexOf(`
`),s=l.substring(0,a),c=l.substring(a+1)+`
`;if(u.type==="block-scalar"){const o=u.props[0];if(o.type!=="block-scalar-header")throw new Error("Invalid block scalar header");o.source=s,u.source=c}else{const{offset:o}=u,h="indent"in u?u.indent:-1,m=[{type:"block-scalar-header",offset:o,indent:h,source:s}];Hp(m,"end"in u?u.end:void 0)||m.push({type:"newline",offset:-1,indent:h,source:`
`});for(const p of Object.keys(u))p!=="type"&&p!=="offset"&&delete u[p];Object.assign(u,{type:"block-scalar",indent:h,props:m,source:c})}}function Hp(u,l){if(l)for(const a of l)switch(a.type){case"space":case"comment":u.push(a);break;case"newline":return u.push(a),!0}return!1}function yf(u,l,a){switch(u.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":u.type=a,u.source=l;break;case"block-scalar":{const s=u.props.slice(1);let c=l.length;u.props[0].type==="block-scalar-header"&&(c-=u.props[0].source.length);for(const o of s)o.offset+=c;delete u.props,Object.assign(u,{type:a,source:l,end:s});break}case"block-map":case"block-seq":{const c={type:"newline",offset:u.offset+l.length,indent:u.indent,source:`
`};delete u.items,Object.assign(u,{type:a,source:l,end:[c]});break}default:{const s="indent"in u?u.indent:-1,c="end"in u&&Array.isArray(u.end)?u.end.filter(o=>o.type==="space"||o.type==="comment"||o.type==="newline"):[];for(const o of Object.keys(u))o!=="type"&&o!=="offset"&&delete u[o];Object.assign(u,{type:a,indent:s,source:l,end:c})}}}const Cb=u=>"type"in u?Tu(u):gu(u);function Tu(u){switch(u.type){case"block-scalar":{let l="";for(const a of u.props)l+=Tu(a);return l+u.source}case"block-map":case"block-seq":{let l="";for(const a of u.items)l+=gu(a);return l}case"flow-collection":{let l=u.start.source;for(const a of u.items)l+=gu(a);for(const a of u.end)l+=a.source;return l}case"document":{let l=gu(u);if(u.end)for(const a of u.end)l+=a.source;return l}default:{let l=u.source;if("end"in u&&u.end)for(const a of u.end)l+=a.source;return l}}}function gu({start:u,key:l,sep:a,value:s}){let c="";for(const o of u)c+=o.source;if(l&&(c+=Tu(l)),a)for(const o of a)c+=o.source;return s&&(c+=Tu(s)),c}const zf=Symbol("break visit"),zb=Symbol("skip children"),Yp=Symbol("remove item");function _l(u,l){"type"in u&&u.type==="document"&&(u={start:u.start,value:u.value}),$p(Object.freeze([]),u,l)}_l.BREAK=zf;_l.SKIP=zb;_l.REMOVE=Yp;_l.itemAtPath=(u,l)=>{let a=u;for(const[s,c]of l){const o=a==null?void 0:a[s];if(o&&"items"in o)a=o.items[c];else return}return a};_l.parentCollection=(u,l)=>{const a=_l.itemAtPath(u,l.slice(0,-1)),s=l[l.length-1][0],c=a==null?void 0:a[s];if(c&&"items"in c)return c;throw new Error("Parent collection not found")};function $p(u,l,a){let s=a(l,u);if(typeof s=="symbol")return s;for(const c of["key","value"]){const o=l[c];if(o&&"items"in o){for(let h=0;h<o.items.length;++h){const m=$p(Object.freeze(u.concat([[c,h]])),o.items[h],a);if(typeof m=="number")h=m-1;else{if(m===zf)return zf;m===Yp&&(o.items.splice(h,1),h-=1)}}typeof s=="function"&&c==="key"&&(s=s(l,u))}}return typeof s=="function"?s(l,u):s}const ju="\uFEFF",Bu="",ku="",La="",xb=u=>!!u&&"items"in u,Db=u=>!!u&&(u.type==="scalar"||u.type==="single-quoted-scalar"||u.type==="double-quoted-scalar"||u.type==="block-scalar");function Lb(u){switch(u){case ju:return"<BOM>";case Bu:return"<DOC>";case ku:return"<FLOW_END>";case La:return"<SCALAR>";default:return JSON.stringify(u)}}function Kp(u){switch(u){case ju:return"byte-order-mark";case Bu:return"doc-mode";case ku:return"flow-error-end";case La:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
`:case`\r
`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(u[0]){case" ":case"	":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}const Ub=Object.freeze(Object.defineProperty({__proto__:null,BOM:ju,DOCUMENT:Bu,FLOW_END:ku,SCALAR:La,createScalarToken:_b,isCollection:xb,isScalar:Db,prettyToken:Lb,resolveAsScalar:Ob,setScalarValue:Nb,stringify:Cb,tokenType:Kp,visit:_l},Symbol.toStringTag,{value:"Module"}));function Jt(u){switch(u){case void 0:case" ":case`
`:case"\r":case"	":return!0;default:return!1}}const Ag=new Set("0123456789ABCDEFabcdef"),Rb=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),au=new Set(",[]{}"),jb=new Set(` ,[]{}
\r	`),vf=u=>!u||jb.has(u);class Gp{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(l,a=!1){if(l){if(typeof l!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+l:l,this.lineEndPos=null}this.atEnd=!a;let s=this.next??"stream";for(;s&&(a||this.hasChars(1));)s=yield*this.parseNext(s)}atLineEnd(){let l=this.pos,a=this.buffer[l];for(;a===" "||a==="	";)a=this.buffer[++l];return!a||a==="#"||a===`
`?!0:a==="\r"?this.buffer[l+1]===`
`:!1}charAt(l){return this.buffer[this.pos+l]}continueScalar(l){let a=this.buffer[l];if(this.indentNext>0){let s=0;for(;a===" ";)a=this.buffer[++s+l];if(a==="\r"){const c=this.buffer[s+l+1];if(c===`
`||!c&&!this.atEnd)return l+s+1}return a===`
`||s>=this.indentNext||!a&&!this.atEnd?l+s:-1}if(a==="-"||a==="."){const s=this.buffer.substr(l,3);if((s==="---"||s==="...")&&Jt(this.buffer[l+3]))return-1}return l}getLine(){let l=this.lineEndPos;return(typeof l!="number"||l!==-1&&l<this.pos)&&(l=this.buffer.indexOf(`
`,this.pos),this.lineEndPos=l),l===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[l-1]==="\r"&&(l-=1),this.buffer.substring(this.pos,l))}hasChars(l){return this.pos+l<=this.buffer.length}setNext(l){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=l,null}peek(l){return this.buffer.substr(this.pos,l)}*parseNext(l){switch(l){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let l=this.getLine();if(l===null)return this.setNext("stream");if(l[0]===ju&&(yield*this.pushCount(1),l=l.substring(1)),l[0]==="%"){let a=l.length,s=l.indexOf("#");for(;s!==-1;){const o=l[s-1];if(o===" "||o==="	"){a=s-1;break}else s=l.indexOf("#",s+1)}for(;;){const o=l[a-1];if(o===" "||o==="	")a-=1;else break}const c=(yield*this.pushCount(a))+(yield*this.pushSpaces(!0));return yield*this.pushCount(l.length-c),this.pushNewline(),"stream"}if(this.atLineEnd()){const a=yield*this.pushSpaces(!0);return yield*this.pushCount(l.length-a),yield*this.pushNewline(),"stream"}return yield Bu,yield*this.parseLineStart()}*parseLineStart(){const l=this.charAt(0);if(!l&&!this.atEnd)return this.setNext("line-start");if(l==="-"||l==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");const a=this.peek(3);if((a==="---"||a==="...")&&Jt(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,a==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!Jt(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){const[l,a]=this.peek(2);if(!a&&!this.atEnd)return this.setNext("block-start");if((l==="-"||l==="?"||l===":")&&Jt(a)){const s=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=s,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);const l=this.getLine();if(l===null)return this.setNext("doc");let a=yield*this.pushIndicators();switch(l[a]){case"#":yield*this.pushCount(l.length-a);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(vf),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return a+=yield*this.parseBlockScalarHeader(),a+=yield*this.pushSpaces(!0),yield*this.pushCount(l.length-a),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let l,a,s=-1;do l=yield*this.pushNewline(),l>0?(a=yield*this.pushSpaces(!1),this.indentValue=s=a):a=0,a+=yield*this.pushSpaces(!0);while(l+a>0);const c=this.getLine();if(c===null)return this.setNext("flow");if((s!==-1&&s<this.indentNext&&c[0]!=="#"||s===0&&(c.startsWith("---")||c.startsWith("..."))&&Jt(c[3]))&&!(s===this.indentNext-1&&this.flowLevel===1&&(c[0]==="]"||c[0]==="}")))return this.flowLevel=0,yield ku,yield*this.parseLineStart();let o=0;for(;c[o]===",";)o+=yield*this.pushCount(1),o+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(o+=yield*this.pushIndicators(),c[o]){case void 0:return"flow";case"#":return yield*this.pushCount(c.length-o),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(vf),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{const h=this.charAt(1);if(this.flowKey||Jt(h)||h===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){const l=this.charAt(0);let a=this.buffer.indexOf(l,this.pos+1);if(l==="'")for(;a!==-1&&this.buffer[a+1]==="'";)a=this.buffer.indexOf("'",a+2);else for(;a!==-1;){let o=0;for(;this.buffer[a-1-o]==="\\";)o+=1;if(o%2===0)break;a=this.buffer.indexOf('"',a+1)}const s=this.buffer.substring(0,a);let c=s.indexOf(`
`,this.pos);if(c!==-1){for(;c!==-1;){const o=this.continueScalar(c+1);if(o===-1)break;c=s.indexOf(`
`,o)}c!==-1&&(a=c-(s[c-1]==="\r"?2:1))}if(a===-1){if(!this.atEnd)return this.setNext("quoted-scalar");a=this.buffer.length}return yield*this.pushToIndex(a+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let l=this.pos;for(;;){const a=this.buffer[++l];if(a==="+")this.blockScalarKeep=!0;else if(a>"0"&&a<="9")this.blockScalarIndent=Number(a)-1;else if(a!=="-")break}return yield*this.pushUntil(a=>Jt(a)||a==="#")}*parseBlockScalar(){let l=this.pos-1,a=0,s;e:for(let o=this.pos;s=this.buffer[o];++o)switch(s){case" ":a+=1;break;case`
`:l=o,a=0;break;case"\r":{const h=this.buffer[o+1];if(!h&&!this.atEnd)return this.setNext("block-scalar");if(h===`
`)break}default:break e}if(!s&&!this.atEnd)return this.setNext("block-scalar");if(a>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=a:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{const o=this.continueScalar(l+1);if(o===-1)break;l=this.buffer.indexOf(`
`,o)}while(l!==-1);if(l===-1){if(!this.atEnd)return this.setNext("block-scalar");l=this.buffer.length}}let c=l+1;for(s=this.buffer[c];s===" ";)s=this.buffer[++c];if(s==="	"){for(;s==="	"||s===" "||s==="\r"||s===`
`;)s=this.buffer[++c];l=c-1}else if(!this.blockScalarKeep)do{let o=l-1,h=this.buffer[o];h==="\r"&&(h=this.buffer[--o]);const m=o;for(;h===" ";)h=this.buffer[--o];if(h===`
`&&o>=this.pos&&o+1+a>m)l=o;else break}while(!0);return yield La,yield*this.pushToIndex(l+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const l=this.flowLevel>0;let a=this.pos-1,s=this.pos-1,c;for(;c=this.buffer[++s];)if(c===":"){const o=this.buffer[s+1];if(Jt(o)||l&&au.has(o))break;a=s}else if(Jt(c)){let o=this.buffer[s+1];if(c==="\r"&&(o===`
`?(s+=1,c=`
`,o=this.buffer[s+1]):a=s),o==="#"||l&&au.has(o))break;if(c===`
`){const h=this.continueScalar(s+1);if(h===-1)break;s=Math.max(s,h-2)}}else{if(l&&au.has(c))break;a=s}return!c&&!this.atEnd?this.setNext("plain-scalar"):(yield La,yield*this.pushToIndex(a+1,!0),l?"flow":"doc")}*pushCount(l){return l>0?(yield this.buffer.substr(this.pos,l),this.pos+=l,l):0}*pushToIndex(l,a){const s=this.buffer.slice(this.pos,l);return s?(yield s,this.pos+=s.length,s.length):(a&&(yield""),0)}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(vf))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{const l=this.flowLevel>0,a=this.charAt(1);if(Jt(a)||l&&au.has(a))return l?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}return 0}*pushTag(){if(this.charAt(1)==="<"){let l=this.pos+2,a=this.buffer[l];for(;!Jt(a)&&a!==">";)a=this.buffer[++l];return yield*this.pushToIndex(a===">"?l+1:l,!1)}else{let l=this.pos+1,a=this.buffer[l];for(;a;)if(Rb.has(a))a=this.buffer[++l];else if(a==="%"&&Ag.has(this.buffer[l+1])&&Ag.has(this.buffer[l+2]))a=this.buffer[l+=3];else break;return yield*this.pushToIndex(l,!1)}}*pushNewline(){const l=this.buffer[this.pos];return l===`
`?yield*this.pushCount(1):l==="\r"&&this.charAt(1)===`
`?yield*this.pushCount(2):0}*pushSpaces(l){let a=this.pos-1,s;do s=this.buffer[++a];while(s===" "||l&&s==="	");const c=a-this.pos;return c>0&&(yield this.buffer.substr(this.pos,c),this.pos=a),c}*pushUntil(l){let a=this.pos,s=this.buffer[a];for(;!l(s);)s=this.buffer[++a];return yield*this.pushToIndex(a,!1)}}class Vp{constructor(){this.lineStarts=[],this.addNewLine=l=>this.lineStarts.push(l),this.linePos=l=>{let a=0,s=this.lineStarts.length;for(;a<s;){const o=a+s>>1;this.lineStarts[o]<l?a=o+1:s=o}if(this.lineStarts[a]===l)return{line:a+1,col:1};if(a===0)return{line:0,col:l};const c=this.lineStarts[a-1];return{line:a,col:l-c+1}}}}function Fn(u,l){for(let a=0;a<u.length;++a)if(u[a].type===l)return!0;return!1}function Og(u){for(let l=0;l<u.length;++l)switch(u[l].type){case"space":case"comment":case"newline":break;default:return l}return-1}function Qp(u){switch(u==null?void 0:u.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function su(u){switch(u.type){case"document":return u.start;case"block-map":{const l=u.items[u.items.length-1];return l.sep??l.start}case"block-seq":return u.items[u.items.length-1].start;default:return[]}}function mi(u){var a;if(u.length===0)return[];let l=u.length;e:for(;--l>=0;)switch(u[l].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;((a=u[++l])==null?void 0:a.type)==="space";);return u.splice(l,u.length)}function _g(u){if(u.start.type==="flow-seq-start")for(const l of u.items)l.sep&&!l.value&&!Fn(l.start,"explicit-key-ind")&&!Fn(l.sep,"map-value-ind")&&(l.key&&(l.value=l.key),delete l.key,Qp(l.value)?l.value.end?Array.prototype.push.apply(l.value.end,l.sep):l.value.end=l.sep:Array.prototype.push.apply(l.start,l.sep),delete l.sep)}class Xf{constructor(l){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new Gp,this.onNewLine=l}*parse(l,a=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(const s of this.lexer.lex(l,a))yield*this.next(s);a||(yield*this.end())}*next(l){if(this.source=l,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=l.length;return}const a=Kp(l);if(a)if(a==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=a,yield*this.step(),a){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+l.length);break;case"space":this.atNewLine&&l[0]===" "&&(this.indent+=l.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=l.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=l.length}else{const s=`Not a YAML token: ${l}`;yield*this.pop({type:"error",offset:this.offset,message:s,source:l}),this.offset+=l.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){const l=this.peek(1);if(this.type==="doc-end"&&(l==null?void 0:l.type)!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!l)return yield*this.stream();switch(l.type){case"document":return yield*this.document(l);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(l);case"block-scalar":return yield*this.blockScalar(l);case"block-map":return yield*this.blockMap(l);case"block-seq":return yield*this.blockSequence(l);case"flow-collection":return yield*this.flowCollection(l);case"doc-end":return yield*this.documentEnd(l)}yield*this.pop()}peek(l){return this.stack[this.stack.length-l]}*pop(l){const a=l??this.stack.pop();if(!a)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield a;else{const s=this.peek(1);switch(a.type==="block-scalar"?a.indent="indent"in s?s.indent:0:a.type==="flow-collection"&&s.type==="document"&&(a.indent=0),a.type==="flow-collection"&&_g(a),s.type){case"document":s.value=a;break;case"block-scalar":s.props.push(a);break;case"block-map":{const c=s.items[s.items.length-1];if(c.value){s.items.push({start:[],key:a,sep:[]}),this.onKeyLine=!0;return}else if(c.sep)c.value=a;else{Object.assign(c,{key:a,sep:[]}),this.onKeyLine=!c.explicitKey;return}break}case"block-seq":{const c=s.items[s.items.length-1];c.value?s.items.push({start:[],value:a}):c.value=a;break}case"flow-collection":{const c=s.items[s.items.length-1];!c||c.value?s.items.push({start:[],key:a,sep:[]}):c.sep?c.value=a:Object.assign(c,{key:a,sep:[]});return}default:yield*this.pop(),yield*this.pop(a)}if((s.type==="document"||s.type==="block-map"||s.type==="block-seq")&&(a.type==="block-map"||a.type==="block-seq")){const c=a.items[a.items.length-1];c&&!c.sep&&!c.value&&c.start.length>0&&Og(c.start)===-1&&(a.indent===0||c.start.every(o=>o.type!=="comment"||o.indent<a.indent))&&(s.type==="document"?s.end=c.start:s.items.push({start:c.start}),a.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{const l={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&l.start.push(this.sourceToken),this.stack.push(l);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(l){if(l.value)return yield*this.lineEnd(l);switch(this.type){case"doc-start":{Og(l.start)!==-1?(yield*this.pop(),yield*this.step()):l.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":l.start.push(this.sourceToken);return}const a=this.startBlockValue(l);a?this.stack.push(a):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(l){if(this.type==="map-value-ind"){const a=su(this.peek(2)),s=mi(a);let c;l.end?(c=l.end,c.push(this.sourceToken),delete l.end):c=[this.sourceToken];const o={type:"block-map",offset:l.offset,indent:l.indent,items:[{start:s,key:l,sep:c}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=o}else yield*this.lineEnd(l)}*blockScalar(l){switch(this.type){case"space":case"comment":case"newline":l.props.push(this.sourceToken);return;case"scalar":if(l.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let a=this.source.indexOf(`
`)+1;for(;a!==0;)this.onNewLine(this.offset+a),a=this.source.indexOf(`
`,a)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(l){var s;const a=l.items[l.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,a.value){const c="end"in a.value?a.value.end:void 0,o=Array.isArray(c)?c[c.length-1]:void 0;(o==null?void 0:o.type)==="comment"?c==null||c.push(this.sourceToken):l.items.push({start:[this.sourceToken]})}else a.sep?a.sep.push(this.sourceToken):a.start.push(this.sourceToken);return;case"space":case"comment":if(a.value)l.items.push({start:[this.sourceToken]});else if(a.sep)a.sep.push(this.sourceToken);else{if(this.atIndentedComment(a.start,l.indent)){const c=l.items[l.items.length-2],o=(s=c==null?void 0:c.value)==null?void 0:s.end;if(Array.isArray(o)){Array.prototype.push.apply(o,a.start),o.push(this.sourceToken),l.items.pop();return}}a.start.push(this.sourceToken)}return}if(this.indent>=l.indent){const c=!this.onKeyLine&&this.indent===l.indent,o=c&&(a.sep||a.explicitKey)&&this.type!=="seq-item-ind";let h=[];if(o&&a.sep&&!a.value){const m=[];for(let p=0;p<a.sep.length;++p){const g=a.sep[p];switch(g.type){case"newline":m.push(p);break;case"space":break;case"comment":g.indent>l.indent&&(m.length=0);break;default:m.length=0}}m.length>=2&&(h=a.sep.splice(m[1]))}switch(this.type){case"anchor":case"tag":o||a.value?(h.push(this.sourceToken),l.items.push({start:h}),this.onKeyLine=!0):a.sep?a.sep.push(this.sourceToken):a.start.push(this.sourceToken);return;case"explicit-key-ind":!a.sep&&!a.explicitKey?(a.start.push(this.sourceToken),a.explicitKey=!0):o||a.value?(h.push(this.sourceToken),l.items.push({start:h,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(a.explicitKey)if(a.sep)if(a.value)l.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Fn(a.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:h,key:null,sep:[this.sourceToken]}]});else if(Qp(a.key)&&!Fn(a.sep,"newline")){const m=mi(a.start),p=a.key,g=a.sep;g.push(this.sourceToken),delete a.key,delete a.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:m,key:p,sep:g}]})}else h.length>0?a.sep=a.sep.concat(h,this.sourceToken):a.sep.push(this.sourceToken);else if(Fn(a.start,"newline"))Object.assign(a,{key:null,sep:[this.sourceToken]});else{const m=mi(a.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:m,key:null,sep:[this.sourceToken]}]})}else a.sep?a.value||o?l.items.push({start:h,key:null,sep:[this.sourceToken]}):Fn(a.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):a.sep.push(this.sourceToken):Object.assign(a,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const m=this.flowScalar(this.type);o||a.value?(l.items.push({start:h,key:m,sep:[]}),this.onKeyLine=!0):a.sep?this.stack.push(m):(Object.assign(a,{key:m,sep:[]}),this.onKeyLine=!0);return}default:{const m=this.startBlockValue(l);if(m){if(m.type==="block-seq"){if(!a.explicitKey&&a.sep&&!Fn(a.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else c&&l.items.push({start:h});this.stack.push(m);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(l){var s;const a=l.items[l.items.length-1];switch(this.type){case"newline":if(a.value){const c="end"in a.value?a.value.end:void 0,o=Array.isArray(c)?c[c.length-1]:void 0;(o==null?void 0:o.type)==="comment"?c==null||c.push(this.sourceToken):l.items.push({start:[this.sourceToken]})}else a.start.push(this.sourceToken);return;case"space":case"comment":if(a.value)l.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(a.start,l.indent)){const c=l.items[l.items.length-2],o=(s=c==null?void 0:c.value)==null?void 0:s.end;if(Array.isArray(o)){Array.prototype.push.apply(o,a.start),o.push(this.sourceToken),l.items.pop();return}}a.start.push(this.sourceToken)}return;case"anchor":case"tag":if(a.value||this.indent<=l.indent)break;a.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==l.indent)break;a.value||Fn(a.start,"seq-item-ind")?l.items.push({start:[this.sourceToken]}):a.start.push(this.sourceToken);return}if(this.indent>l.indent){const c=this.startBlockValue(l);if(c){this.stack.push(c);return}}yield*this.pop(),yield*this.step()}*flowCollection(l){const a=l.items[l.items.length-1];if(this.type==="flow-error-end"){let s;do yield*this.pop(),s=this.peek(1);while((s==null?void 0:s.type)==="flow-collection")}else if(l.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!a||a.sep?l.items.push({start:[this.sourceToken]}):a.start.push(this.sourceToken);return;case"map-value-ind":!a||a.value?l.items.push({start:[],key:null,sep:[this.sourceToken]}):a.sep?a.sep.push(this.sourceToken):Object.assign(a,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!a||a.value?l.items.push({start:[this.sourceToken]}):a.sep?a.sep.push(this.sourceToken):a.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const c=this.flowScalar(this.type);!a||a.value?l.items.push({start:[],key:c,sep:[]}):a.sep?this.stack.push(c):Object.assign(a,{key:c,sep:[]});return}case"flow-map-end":case"flow-seq-end":l.end.push(this.sourceToken);return}const s=this.startBlockValue(l);s?this.stack.push(s):(yield*this.pop(),yield*this.step())}else{const s=this.peek(2);if(s.type==="block-map"&&(this.type==="map-value-ind"&&s.indent===l.indent||this.type==="newline"&&!s.items[s.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&s.type!=="flow-collection"){const c=su(s),o=mi(c);_g(l);const h=l.end.splice(1,l.end.length);h.push(this.sourceToken);const m={type:"block-map",offset:l.offset,indent:l.indent,items:[{start:o,key:l,sep:h}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=m}else yield*this.lineEnd(l)}}flowScalar(l){if(this.onNewLine){let a=this.source.indexOf(`
`)+1;for(;a!==0;)this.onNewLine(this.offset+a),a=this.source.indexOf(`
`,a)+1}return{type:l,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(l){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const a=su(l),s=mi(a);return s.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const a=su(l),s=mi(a);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(l,a){return this.type!=="comment"||this.indent<=a?!1:l.every(s=>s.type==="newline"||s.type==="space")}*documentEnd(l){this.type!=="doc-mode"&&(l.end?l.end.push(this.sourceToken):l.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(l){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:l.end?l.end.push(this.sourceToken):l.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}}function Xp(u){const l=u.prettyErrors!==!1;return{lineCounter:u.lineCounter||l&&new Vp||null,prettyErrors:l}}function Bb(u,l={}){const{lineCounter:a,prettyErrors:s}=Xp(l),c=new Xf(a==null?void 0:a.addNewLine),o=new Qf(l),h=Array.from(o.compose(c.parse(u)));if(s&&a)for(const m of h)m.errors.forEach(Su(u,a)),m.warnings.forEach(Su(u,a));return h.length>0?h:Object.assign([],{empty:!0},o.streamInfo())}function Zp(u,l={}){const{lineCounter:a,prettyErrors:s}=Xp(l),c=new Xf(a==null?void 0:a.addNewLine),o=new Qf(l);let h=null;for(const m of o.compose(c.parse(u),!0,u.length))if(!h)h=m;else if(h.options.logLevel!=="silent"){h.errors.push(new Al(m.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return s&&a&&(h.errors.forEach(Su(u,a)),h.warnings.forEach(Su(u,a))),h}function kb(u,l,a){let s;typeof l=="function"?s=l:a===void 0&&l&&typeof l=="object"&&(a=l);const c=Zp(u,a);if(!c)return null;if(c.warnings.forEach(o=>mp(c.options.logLevel,o)),c.errors.length>0){if(c.options.logLevel!=="silent")throw c.errors[0];c.errors=[]}return c.toJS(Object.assign({reviver:s},a))}function qb(u,l,a){let s=null;if(typeof l=="function"||Array.isArray(l)?s=l:a===void 0&&l&&(a=l),typeof a=="string"&&(a=a.length),typeof a=="number"){const c=Math.round(a);a=c<1?void 0:c>8?{indent:8}:{indent:c}}if(u===void 0){const{keepUndefined:c}=a??l??{};if(!c)return}return Nl(u)&&!s?u.toString(a):new xi(u,s,a).toString(a)}const Hb=Object.freeze(Object.defineProperty({__proto__:null,Alias:_u,CST:Ub,Composer:Qf,Document:xi,Lexer:Gp,LineCounter:Vp,Pair:ct,Parser:Xf,Scalar:ce,Schema:Ru,YAMLError:Gf,YAMLMap:Lt,YAMLParseError:Al,YAMLSeq:el,YAMLWarning:Lp,isAlias:tl,isCollection:Be,isDocument:Nl,isMap:Ni,isNode:ke,isPair:je,isScalar:De,isSeq:Mi,parse:kb,parseAllDocuments:Bb,parseDocument:Zp,stringify:qb,visit:Ml,visitAsync:Ou},Symbol.toStringTag,{value:"Module"}));function Yb(u,l,a={}){var O;const s=new u.LineCounter,c={keepSourceTokens:!0,lineCounter:s,...a},o=u.parseDocument(l,c),h=[],m=E=>[s.linePos(E[0]),s.linePos(E[1])],p=E=>{h.push({message:E.message,range:[s.linePos(E.pos[0]),s.linePos(E.pos[1])]})},g=(E,x)=>{for(const S of x.items){if(S instanceof u.Scalar&&typeof S.value=="string"){const R=Eu.parse(S,c,h);R&&(E.children=E.children||[],E.children.push(R));continue}if(S instanceof u.YAMLMap){b(E,S);continue}h.push({message:"Sequence items should be strings or maps",range:m(S.range||x.range)})}},b=(E,x)=>{for(const S of x.items){if(E.children=E.children||[],!(S.key instanceof u.Scalar&&typeof S.key.value=="string")){h.push({message:"Only string keys are supported",range:m(S.key.range||x.range)});continue}const M=S.key,R=S.value;if(M.value==="text"){if(!(R instanceof u.Scalar&&typeof R.value=="string")){h.push({message:"Text value should be a string",range:m(S.value.range||x.range)});continue}E.children.push({kind:"text",text:bf(R.value)});continue}if(M.value==="/children"){if(!(R instanceof u.Scalar&&typeof R.value=="string")||R.value!=="contain"&&R.value!=="equal"&&R.value!=="deep-equal"){h.push({message:'Strict value should be "contain", "equal" or "deep-equal"',range:m(S.value.range||x.range)});continue}E.containerMode=R.value;continue}if(M.value.startsWith("/")){if(!(R instanceof u.Scalar&&typeof R.value=="string")){h.push({message:"Property value should be a string",range:m(S.value.range||x.range)});continue}E.props=E.props??{},E.props[M.value.slice(1)]=bf(R.value);continue}const K=Eu.parse(M,c,h);if(!K)continue;if(R instanceof u.Scalar){const W=typeof R.value;if(W!=="string"&&W!=="number"&&W!=="boolean"){h.push({message:"Node value should be a string or a sequence",range:m(S.value.range||x.range)});continue}E.children.push({...K,children:[{kind:"text",text:bf(String(R.value))}]});continue}if(R instanceof u.YAMLSeq){E.children.push(K),g(K,R);continue}h.push({message:"Map values should be strings or sequences",range:m(S.value.range||x.range)})}},v={kind:"role",role:"fragment"};return o.errors.forEach(p),h.length?{errors:h,fragment:v}:(o.contents instanceof u.YAMLSeq||h.push({message:'Aria snapshot must be a YAML sequence, elements starting with " -"',range:o.contents?m(o.contents.range):[{line:0,col:0},{line:0,col:0}]}),h.length?{errors:h,fragment:v}:(g(v,o.contents),h.length?{errors:h,fragment:$b}:((O=v.children)==null?void 0:O.length)===1&&(!v.containerMode||v.containerMode==="contain")?{fragment:v.children[0],errors:[]}:{fragment:v,errors:[]}))}const $b={kind:"role",role:"fragment"};function Jp(u){return u.replace(/[\u200b\u00ad]/g,"").replace(/[\r\n\s\t]+/g," ").trim()}function bf(u){return{raw:u,normalized:Jp(u)}}class Eu{static parse(l,a,s){try{return new Eu(l.value)._parse()}catch(c){if(c instanceof Ng){const o=a.prettyErrors===!1?c.message:c.message+`:

`+l.value+`
`+" ".repeat(c.pos)+`^
`;return s.push({message:o,range:[a.lineCounter.linePos(l.range[0]),a.lineCounter.linePos(l.range[0]+c.pos)]}),null}throw c}}constructor(l){this._input=l,this._pos=0,this._length=l.length}_peek(){return this._input[this._pos]||""}_next(){return this._pos<this._length?this._input[this._pos++]:null}_eof(){return this._pos>=this._length}_isWhitespace(){return!this._eof()&&/\s/.test(this._peek())}_skipWhitespace(){for(;this._isWhitespace();)this._pos++}_readIdentifier(l){this._eof()&&this._throwError(`Unexpected end of input when expecting ${l}`);const a=this._pos;for(;!this._eof()&&/[a-zA-Z]/.test(this._peek());)this._pos++;return this._input.slice(a,this._pos)}_readString(){let l="",a=!1;for(;!this._eof();){const s=this._next();if(a)l+=s,a=!1;else if(s==="\\")a=!0;else{if(s==='"')return l;l+=s}}this._throwError("Unterminated string")}_throwError(l,a=0){throw new Ng(l,a||this._pos)}_readRegex(){let l="",a=!1,s=!1;for(;!this._eof();){const c=this._next();if(a)l+=c,a=!1;else if(c==="\\")a=!0,l+=c;else{if(c==="/"&&!s)return{pattern:l};c==="["?(s=!0,l+=c):c==="]"&&s?(l+=c,s=!1):l+=c}}this._throwError("Unterminated regex")}_readStringOrRegex(){const l=this._peek();return l==='"'?(this._next(),Jp(this._readString())):l==="/"?(this._next(),this._readRegex()):null}_readAttributes(l){let a=this._pos;for(;this._skipWhitespace(),this._peek()==="[";){this._next(),this._skipWhitespace(),a=this._pos;const s=this._readIdentifier("attribute");this._skipWhitespace();let c="";if(this._peek()==="=")for(this._next(),this._skipWhitespace(),a=this._pos;this._peek()!=="]"&&!this._isWhitespace()&&!this._eof();)c+=this._next();this._skipWhitespace(),this._peek()!=="]"&&this._throwError("Expected ]"),this._next(),this._applyAttribute(l,s,c||"true",a)}}_parse(){this._skipWhitespace();const l=this._readIdentifier("role");this._skipWhitespace();const a=this._readStringOrRegex()||"",s={kind:"role",role:l,name:a};return this._readAttributes(s),this._skipWhitespace(),this._eof()||this._throwError("Unexpected input"),s}_applyAttribute(l,a,s,c){if(a==="checked"){this._assert(s==="true"||s==="false"||s==="mixed",'Value of "checked" attribute must be a boolean or "mixed"',c),l.checked=s==="true"?!0:s==="false"?!1:"mixed";return}if(a==="disabled"){this._assert(s==="true"||s==="false",'Value of "disabled" attribute must be a boolean',c),l.disabled=s==="true";return}if(a==="expanded"){this._assert(s==="true"||s==="false",'Value of "expanded" attribute must be a boolean',c),l.expanded=s==="true";return}if(a==="active"){this._assert(s==="true"||s==="false",'Value of "active" attribute must be a boolean',c),l.active=s==="true";return}if(a==="invalid"){this._assert(s==="true"||s==="false"||s==="grammar"||s==="spelling",'Value of "invalid" attribute must be a boolean, "grammar" or "spelling"',c),l.invalid=s==="true"?!0:s==="false"?!1:s;return}if(a==="level"){this._assert(!isNaN(Number(s)),'Value of "level" attribute must be a number',c),l.level=Number(s);return}if(a==="pressed"){this._assert(s==="true"||s==="false"||s==="mixed",'Value of "pressed" attribute must be a boolean or "mixed"',c),l.pressed=s==="true"?!0:s==="false"?!1:"mixed";return}if(a==="selected"){this._assert(s==="true"||s==="false",'Value of "selected" attribute must be a boolean',c),l.selected=s==="true";return}this._assert(!1,`Unsupported attribute [${a}]`,c)}_assert(l,a,s){l||this._throwError(a||"Assertion error",s)}}class Ng extends Error{constructor(l,a){super(l),this.pos=a}}const Kb=({className:u,style:l,open:a,isModal:s,minWidth:c,verticalOffset:o,requestClose:h,anchor:m,dataTestId:p,children:g})=>{const b=he.useRef(null),[v,O]=he.useState(0),[E]=Sf(b),[x,S]=Sf(m),w=m?Gb(E,x,o):void 0;return he.useEffect(()=>{const M=K=>{!b.current||!(K.target instanceof Node)||b.current.contains(K.target)||h==null||h()},R=K=>{K.key==="Escape"&&(h==null||h())};return a?(document.addEventListener("mousedown",M),document.addEventListener("keydown",R),()=>{document.removeEventListener("mousedown",M),document.removeEventListener("keydown",R)}):()=>{}},[a,h]),he.useLayoutEffect(()=>S(),[a,S]),he.useEffect(()=>{const M=()=>O(R=>R+1);return window.addEventListener("resize",M),()=>{window.removeEventListener("resize",M)}},[]),he.useLayoutEffect(()=>{b.current&&(a?s?b.current.showModal():b.current.show():b.current.close())},[a,s]),X.jsx("dialog",{ref:b,style:{position:"fixed",margin:w?0:void 0,zIndex:110,top:w==null?void 0:w.top,left:w==null?void 0:w.left,minWidth:c||0,...l},className:u,"data-testid":p,children:g})};function Gb(u,l,a=4,s=4){let c=Math.max(s,l.left);c+u.width>window.innerWidth-s&&(c=window.innerWidth-u.width-s);let o=Math.max(0,l.bottom)+a;return o+u.height>window.innerHeight-a&&(Math.max(0,l.top)>u.height+a?o=Math.max(0,l.top)-u.height-a:o=window.innerHeight-a-u.height),{left:c,top:o}}const Vb=({})=>{const[u,l]=he.useState([]),[a,s]=he.useState(!1),[c,o]=he.useState(new Map),[h,m]=he.useState("none"),[p,g]=he.useState(),[b,v]=pu("recorderPropertiesTab","log"),[O,E]=he.useState(),[x,S]=he.useState(),[w,M]=he.useState(!1),[R,K]=z1(),[Q,Z]=pu("autoExpect",!1),W=he.useRef(null),k=he.useMemo(Qb,[]),[V,U]=he.useState(""),ae=he.useRef(null),te=he.useMemo(()=>u.find(D=>D.id===p)??ev(),[u,p]);he.useLayoutEffect(()=>{const se={modeChanged:({mode:D})=>m(D),sourcesUpdated:({sources:D})=>{l(D),window.playwrightSourcesEchoForTest=D},pageNavigated:({url:D})=>{document.title=D?`Playwright Inspector - ${D}`:"Playwright Inspector"},pauseStateChanged:({paused:D})=>s(D),callLogsUpdated:({callLogs:D})=>{o(G=>{const ne=new Map(G);for(const de of D)de.reveal=!G.has(de.id),ne.set(de.id,de);return ne})},sourceRevealRequested:({sourceId:D})=>g(D),elementPicked:({elementInfo:D,userGesture:G})=>{const ne=te.language;U(ep(ne,D.selector)),E(D.ariaSnapshot),S([]),G&&b!=="locator"&&b!=="aria"&&v("locator"),h==="inspecting"&&b==="aria"||k.setMode({mode:h==="inspecting"?"standby":"recording"}).catch(()=>{})}};window.dispatch=D=>{se[D.method].call(se,D.params)}},[k,h,b,v,te]),he.useEffect(()=>{k.setAutoExpect({autoExpect:Q})},[Q,k]),he.useLayoutEffect(()=>{var se;(se=ae.current)==null||se.scrollIntoView({block:"center",inline:"nearest"})},[ae]),he.useLayoutEffect(()=>{const se=D=>{switch(D.key){case"F8":D.preventDefault(),a?k.resume():k.pause();break;case"F10":D.preventDefault(),a&&k.step();break}};return document.addEventListener("keydown",se),()=>document.removeEventListener("keydown",se)},[a,k]);const $=he.useCallback(se=>{(h==="none"||h==="inspecting")&&k.setMode({mode:"standby"}),U(se),k.highlightRequested({selector:se})},[h,k]),ee=he.useCallback(se=>{(h==="none"||h==="inspecting")&&k.setMode({mode:"standby"});const{fragment:D,errors:G}=Yb(Hb,se,{prettyErrors:!1}),ne=G.map(de=>({message:de.message,line:de.range[1].line,column:de.range[1].col,type:"subtle-error"}));S(ne),E(se),G.length||k.highlightRequested({ariaTemplate:D})},[h,k]),we=h==="recording"||h==="recording-inspecting"||h==="assertingText"||h==="assertingVisibility";return X.jsxs("div",{className:"recorder",children:[X.jsxs(xg,{children:[X.jsx(Dt,{icon:we?"stop-circle":"circle-large-filled",title:we?"Stop Recording":"Start Recording",toggled:we,onClick:()=>{k.setMode({mode:h==="none"||h==="standby"||h==="inspecting"?"recording":"standby"})},children:"Record"}),X.jsx(hg,{}),X.jsx(Dt,{icon:"inspect",title:"Pick locator",toggled:h==="inspecting"||h==="recording-inspecting",onClick:()=>{const se={inspecting:"standby",none:"inspecting",standby:"inspecting",recording:"recording-inspecting","recording-inspecting":"recording",assertingText:"recording-inspecting",assertingVisibility:"recording-inspecting",assertingValue:"recording-inspecting",assertingSnapshot:"recording-inspecting"}[h];k.setMode({mode:se}).catch(()=>{})}}),X.jsx(Dt,{icon:"eye",title:"Assert visibility",toggled:h==="assertingVisibility",disabled:h==="none"||h==="standby"||h==="inspecting",onClick:()=>{k.setMode({mode:h==="assertingVisibility"?"recording":"assertingVisibility"})}}),X.jsx(Dt,{icon:"whole-word",title:"Assert text",toggled:h==="assertingText",disabled:h==="none"||h==="standby"||h==="inspecting",onClick:()=>{k.setMode({mode:h==="assertingText"?"recording":"assertingText"})}}),X.jsx(Dt,{icon:"symbol-constant",title:"Assert value",toggled:h==="assertingValue",disabled:h==="none"||h==="standby"||h==="inspecting",onClick:()=>{k.setMode({mode:h==="assertingValue"?"recording":"assertingValue"})}}),X.jsx(Dt,{icon:"gist",title:"Assert snapshot",toggled:h==="assertingSnapshot",disabled:h==="none"||h==="standby"||h==="inspecting",onClick:()=>{k.setMode({mode:h==="assertingSnapshot"?"recording":"assertingSnapshot"})}}),X.jsx(hg,{}),X.jsx(Dt,{icon:"files",title:"Copy",disabled:!te||!te.text,onClick:()=>{eg(te.text)}}),X.jsx(Dt,{icon:"debug-continue",title:"Resume (F8)",ariaLabel:"Resume",disabled:!a,onClick:()=>{k.resume()}}),X.jsx(Dt,{icon:"debug-pause",title:"Pause (F8)",ariaLabel:"Pause",disabled:a,onClick:()=>{k.pause()}}),X.jsx(Dt,{icon:"debug-step-over",title:"Step over (F10)",ariaLabel:"Step over",disabled:!a,onClick:()=>{k.step()}}),X.jsx("div",{style:{flex:"auto"}}),X.jsx("div",{children:"Target:"}),X.jsx(F1,{fileId:te.id,sources:u,setFileId:se=>{g(se),k.fileChanged({fileId:se})}}),X.jsx(Dt,{icon:"clear-all",title:"Clear",disabled:!te||!te.text,onClick:()=>{k.clear()}}),X.jsx(Dt,{ref:W,icon:"settings-gear",title:"Settings",onClick:()=>M(se=>!se)}),X.jsxs(Kb,{style:{padding:"4px 8px"},open:w,verticalOffset:8,requestClose:()=>M(!1),anchor:W,dataTestId:"settings-dialog",children:[X.jsxs("div",{className:"setting setting-theme",children:[X.jsx("label",{htmlFor:"dark-mode-setting",children:"Theme:"}),X.jsx("select",{id:"dark-mode-setting",value:R,onChange:se=>K(se.target.value),children:_1.map(se=>X.jsx("option",{value:se.value,children:se.label},se.value))})]},"dark-mode-setting"),X.jsxs("div",{className:"setting",title:"Automatically generate assertions while recording",children:[X.jsx("input",{type:"checkbox",id:"auto-expect-setting",checked:Q,onChange:()=>{k.setAutoExpect({autoExpect:!Q}),Z(!Q)}}),X.jsx("label",{htmlFor:"auto-expect-setting",children:"Generate assertions"})]},"auto-expect-setting")]})]}),X.jsx(J1,{sidebarSize:200,main:X.jsx(ff,{text:te.text,highlighter:te.language,highlight:te.highlight,revealLine:te.revealLine,readOnly:!0,lineNumbers:!0}),sidebar:X.jsx(W1,{rightToolbar:b==="locator"||b==="aria"?[X.jsx(Dt,{icon:"files",title:"Copy",onClick:()=>eg((b==="locator"?V:O)||"")},1)]:[],tabs:[{id:"locator",title:"Locator",render:()=>X.jsx(ff,{text:V,placeholder:"Type locator to inspect",highlighter:te.language,focusOnChange:!0,onChange:$,wrapLines:!0})},{id:"log",title:"Log",render:()=>X.jsx(zv,{language:te.language,log:Array.from(c.values())})},{id:"aria",title:"Aria",render:()=>X.jsx(ff,{text:O||"",placeholder:"Type aria template to match",highlighter:"yaml",onChange:ee,highlight:x,wrapLines:!0})}],selectedTab:b,setSelectedTab:v})})]})};function Qb(){return new Proxy({},{get:(u,l)=>{if(typeof l=="string")return a=>window.sendCommand({method:l,params:a})}})}(async()=>(N1(),B1.createRoot(document.querySelector("#root")).render(X.jsx(Vb,{}))))();export{b1 as g};
<!--
  Copyright (c) Microsoft Corporation.

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<!DOCTYPE html>
<html lang="en" translate="no">
  <head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="icon" href="/playwright-logo.svg" type="image/svg+xml">
    <title>Playwright Inspector</title>
    <script type="module" crossorigin src="/assets/index-Bq-mQf8S.js"></script>
    <link rel="stylesheet" crossorigin href="/assets/index-4ZiSSCmn.css">
  </head>
  <body>
    <div id="root"></div>
  </body>
</html>
<svg width="400" height="400" viewBox="0 0 400 400" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M136.444 221.556C123.558 225.213 115.104 231.625 109.535 238.032C114.869 233.364 122.014 229.08 131.652 226.348C141.51 223.554 149.92 223.574 156.869 224.915V219.481C150.941 218.939 144.145 219.371 136.444 221.556ZM108.946 175.876L61.0895 188.484C61.0895 188.484 61.9617 189.716 63.5767 191.36L104.153 180.668C104.153 180.668 103.578 188.077 98.5847 194.705C108.03 187.559 108.946 175.876 108.946 175.876ZM149.005 288.347C81.6582 306.486 46.0272 228.438 35.2396 187.928C30.2556 169.229 28.0799 155.067 27.5 145.928C27.4377 144.979 27.4665 144.179 27.5336 143.446C24.04 143.657 22.3674 145.473 22.7077 150.721C23.2876 159.855 25.4633 174.016 30.4473 192.721C41.2301 233.225 76.8659 311.273 144.213 293.134C158.872 289.185 169.885 281.992 178.152 272.81C170.532 279.692 160.995 285.112 149.005 288.347ZM161.661 128.11V132.903H188.077C187.535 131.206 186.989 129.677 186.447 128.11H161.661Z" fill="#2D4552"/>
<path d="M193.981 167.584C205.861 170.958 212.144 179.287 215.465 186.658L228.711 190.42C228.711 190.42 226.904 164.623 203.57 157.995C181.741 151.793 168.308 170.124 166.674 172.496C173.024 167.972 182.297 164.268 193.981 167.584ZM299.422 186.777C277.573 180.547 264.145 198.916 262.535 201.255C268.89 196.736 278.158 193.031 289.837 196.362C301.698 199.741 307.976 208.06 311.307 215.436L324.572 219.212C324.572 219.212 322.736 193.41 299.422 186.777ZM286.262 254.795L176.072 223.99C176.072 223.99 177.265 230.038 181.842 237.869L274.617 263.805C282.255 259.386 286.262 254.795 286.262 254.795ZM209.867 321.102C122.618 297.71 133.166 186.543 147.284 133.865C153.097 112.156 159.073 96.0203 164.029 85.204C161.072 84.5953 158.623 86.1529 156.203 91.0746C150.941 101.747 144.212 119.124 137.7 143.45C123.586 196.127 113.038 307.29 200.283 330.682C241.406 341.699 273.442 324.955 297.323 298.659C274.655 319.19 245.714 330.701 209.867 321.102Z" fill="#2D4552"/>
<path d="M161.661 262.296V239.863L99.3324 257.537C99.3324 257.537 103.938 230.777 136.444 221.556C146.302 218.762 154.713 218.781 161.661 220.123V128.11H192.869C189.471 117.61 186.184 109.526 183.423 103.909C178.856 94.612 174.174 100.775 163.545 109.665C156.059 115.919 137.139 129.261 108.668 136.933C80.1966 144.61 57.179 142.574 47.5752 140.911C33.9601 138.562 26.8387 135.572 27.5049 145.928C28.0847 155.062 30.2605 169.224 35.2445 187.928C46.0272 228.433 81.663 306.481 149.01 288.342C166.602 283.602 179.019 274.233 187.626 262.291H161.661V262.296ZM61.0848 188.484L108.946 175.876C108.946 175.876 107.551 194.288 89.6087 199.018C71.6614 203.743 61.0848 188.484 61.0848 188.484Z" fill="#E2574C"/>
<path d="M341.786 129.174C329.345 131.355 299.498 134.072 262.612 124.185C225.716 114.304 201.236 97.0224 191.537 88.8994C177.788 77.3834 171.74 69.3802 165.788 81.4857C160.526 92.163 153.797 109.54 147.284 133.866C133.171 186.543 122.623 297.706 209.867 321.098C297.093 344.47 343.53 242.92 357.644 190.238C364.157 165.917 367.013 147.5 367.799 135.625C368.695 122.173 359.455 126.078 341.786 129.174ZM166.497 172.756C166.497 172.756 180.246 151.372 203.565 158C226.899 164.628 228.706 190.425 228.706 190.425L166.497 172.756ZM223.42 268.713C182.403 256.698 176.077 223.99 176.077 223.99L286.262 254.796C286.262 254.791 264.021 280.578 223.42 268.713ZM262.377 201.495C262.377 201.495 276.107 180.126 299.422 186.773C322.736 193.411 324.572 219.208 324.572 219.208L262.377 201.495Z" fill="#2EAD33"/>
<path d="M139.88 246.04L99.3324 257.532C99.3324 257.532 103.737 232.44 133.607 222.496L110.647 136.33L108.663 136.933C80.1918 144.611 57.1742 142.574 47.5704 140.911C33.9554 138.563 26.834 135.572 27.5001 145.929C28.08 155.063 30.2557 169.224 35.2397 187.929C46.0225 228.433 81.6583 306.481 149.005 288.342L150.989 287.719L139.88 246.04ZM61.0848 188.485L108.946 175.876C108.946 175.876 107.551 194.288 89.6087 199.018C71.6615 203.743 61.0848 188.485 61.0848 188.485Z" fill="#D65348"/>
<path d="M225.27 269.163L223.415 268.712C182.398 256.698 176.072 223.99 176.072 223.99L232.89 239.872L262.971 124.281L262.607 124.185C225.711 114.304 201.232 97.0224 191.532 88.8994C177.783 77.3834 171.735 69.3802 165.783 81.4857C160.526 92.163 153.797 109.54 147.284 133.866C133.171 186.543 122.623 297.706 209.867 321.097L211.655 321.5L225.27 269.163ZM166.497 172.756C166.497 172.756 180.246 151.372 203.565 158C226.899 164.628 228.706 190.425 228.706 190.425L166.497 172.756Z" fill="#1D8D22"/>
<path d="M141.946 245.451L131.072 248.537C133.641 263.019 138.169 276.917 145.276 289.195C146.513 288.922 147.74 288.687 149 288.342C152.302 287.451 155.364 286.348 158.312 285.145C150.371 273.361 145.118 259.789 141.946 245.451ZM137.7 143.451C132.112 164.307 127.113 194.326 128.489 224.436C130.952 223.367 133.554 222.371 136.444 221.551L138.457 221.101C136.003 188.939 141.308 156.165 147.284 133.866C148.799 128.225 150.318 122.978 151.832 118.085C149.393 119.637 146.767 121.228 143.776 122.867C141.759 129.093 139.722 135.898 137.7 143.451Z" fill="#C04B41"/>
</svg>
import{v as Ju}from"./defaultSettingsView-BNmKHKpQ.js";import"./urlMatch-BYQrIQwR.js";var vi={exports:{}},Zu=vi.exports,pa;function mt(){return pa||(pa=1,(function(ct,xt){(function(b,pe){ct.exports=pe()})(Zu,(function(){var b=navigator.userAgent,pe=navigator.platform,_=/gecko\/\d/i.test(b),te=/MSIE \d/.test(b),oe=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(b),Q=/Edge\/(\d+)/.exec(b),k=te||oe||Q,I=k&&(te?document.documentMode||6:+(Q||oe)[1]),Y=!Q&&/WebKit\//.test(b),ne=Y&&/Qt\/\d+\.\d+/.test(b),S=!Q&&/Chrome\/(\d+)/.exec(b),R=S&&+S[1],A=/Opera\//.test(b),$=/Apple Computer/.test(navigator.vendor),ue=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(b),O=/PhantomJS/.test(b),w=$&&(/Mobile\/\w+/.test(b)||navigator.maxTouchPoints>2),M=/Android/.test(b),N=w||M||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(b),z=w||/Mac/.test(pe),X=/\bCrOS\b/.test(b),q=/win/i.test(pe),p=A&&b.match(/Version\/(\d*\.\d*)/);p&&(p=Number(p[1])),p&&p>=15&&(A=!1,Y=!0);var W=z&&(ne||A&&(p==null||p<12.11)),J=_||k&&I>=9;function P(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var V=function(e,t){var n=e.className,r=P(t).exec(n);if(r){var i=n.slice(r.index+r[0].length);e.className=n.slice(0,r.index)+(i?r[1]+i:"")}};function F(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function G(e,t){return F(e).appendChild(t)}function c(e,t,n,r){var i=document.createElement(e);if(n&&(i.className=n),r&&(i.style.cssText=r),typeof t=="string")i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o<t.length;++o)i.appendChild(t[o]);return i}function T(e,t,n,r){var i=c(e,t,n,r);return i.setAttribute("role","presentation"),i}var C;document.createRange?C=function(e,t,n,r){var i=document.createRange();return i.setEnd(r||e,n),i.setStart(e,t),i}:C=function(e,t,n){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch{return r}return r.collapse(!0),r.moveEnd("character",n),r.moveStart("character",t),r};function g(e,t){if(t.nodeType==3&&(t=t.parentNode),e.contains)return e.contains(t);do if(t.nodeType==11&&(t=t.host),t==e)return!0;while(t=t.parentNode)}function y(e){var t=e.ownerDocument||e,n;try{n=e.activeElement}catch{n=t.body||null}for(;n&&n.shadowRoot&&n.shadowRoot.activeElement;)n=n.shadowRoot.activeElement;return n}function j(e,t){var n=e.className;P(t).test(n)||(e.className+=(n?" ":"")+t)}function de(e,t){for(var n=e.split(" "),r=0;r<n.length;r++)n[r]&&!P(n[r]).test(t)&&(t+=" "+n[r]);return t}var v=function(e){e.select()};w?v=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:k&&(v=function(e){try{e.select()}catch{}});function d(e){return e.display.wrapper.ownerDocument}function fe(e){return Te(e.display.wrapper)}function Te(e){return e.getRootNode?e.getRootNode():e.ownerDocument}function le(e){return d(e).defaultView}function xe(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function Me(e,t,n){t||(t={});for(var r in e)e.hasOwnProperty(r)&&(n!==!1||!t.hasOwnProperty(r))&&(t[r]=e[r]);return t}function Fe(e,t,n,r,i){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var o=r||0,l=i||0;;){var a=e.indexOf("	",o);if(a<0||a>=t)return l+(t-o);l+=a-o,l+=n-l%n,o=a+1}}var Ce=function(){this.id=null,this.f=null,this.time=0,this.handler=xe(this.onTimeout,this)};Ce.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},Ce.prototype.set=function(e,t){this.f=t;var n=+new Date+e;(!this.id||n<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=n)};function ve(e,t){for(var n=0;n<e.length;++n)if(e[n]==t)return n;return-1}var Oe=50,qe={toString:function(){return"CodeMirror.Pass"}},$e={scroll:!1},dt={origin:"*mouse"},Pe={origin:"+move"};function _e(e,t,n){for(var r=0,i=0;;){var o=e.indexOf("	",r);o==-1&&(o=e.length);var l=o-r;if(o==e.length||i+l>=t)return r+Math.min(l,t-i);if(i+=o-r,i+=n-i%n,r=o+1,i>=t)return r}}var Ue=[""];function et(e){for(;Ue.length<=e;)Ue.push(we(Ue)+" ");return Ue[e]}function we(e){return e[e.length-1]}function Ie(e,t){for(var n=[],r=0;r<e.length;r++)n[r]=t(e[r],r);return n}function E(e,t,n){for(var r=0,i=n(t);r<e.length&&n(e[r])<=i;)r++;e.splice(r,0,t)}function ee(){}function K(e,t){var n;return Object.create?n=Object.create(e):(ee.prototype=e,n=new ee),t&&Me(t,n),n}var ze=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function me(e){return/\w/.test(e)||e>"Â€"&&(e.toUpperCase()!=e.toLowerCase()||ze.test(e))}function De(e,t){return t?t.source.indexOf("\\w")>-1&&me(e)?!0:t.test(e):me(e)}function be(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var Be=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function Ne(e){return e.charCodeAt(0)>=768&&Be.test(e)}function Mt(e,t,n){for(;(n<0?t>0:t<e.length)&&Ne(e.charAt(t));)t+=n;return t}function Pt(e,t,n){for(var r=t>n?-1:1;;){if(t==n)return t;var i=(t+n)/2,o=r<0?Math.ceil(i):Math.floor(i);if(o==t)return e(o)?t:n;e(o)?n=o:t=o+r}}function or(e,t,n,r){if(!e)return r(t,n,"ltr",0);for(var i=!1,o=0;o<e.length;++o){var l=e[o];(l.from<n&&l.to>t||t==n&&l.to==t)&&(r(Math.max(l.from,t),Math.min(l.to,n),l.level==1?"rtl":"ltr",o),i=!0)}i||r(t,n,"ltr")}var br=null;function lr(e,t,n){var r;br=null;for(var i=0;i<e.length;++i){var o=e[i];if(o.from<t&&o.to>t)return i;o.to==t&&(o.from!=o.to&&n=="before"?r=i:br=i),o.from==t&&(o.from!=o.to&&n!="before"?r=i:br=i)}return r??br}var mi=(function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function n(u){return u<=247?e.charAt(u):1424<=u&&u<=1524?"R":1536<=u&&u<=1785?t.charAt(u-1536):1774<=u&&u<=2220?"r":8192<=u&&u<=8203?"w":u==8204?"b":"L"}var r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,i=/[stwN]/,o=/[LRr]/,l=/[Lb1n]/,a=/[1n]/;function s(u,h,x){this.level=u,this.from=h,this.to=x}return function(u,h){var x=h=="ltr"?"L":"R";if(u.length==0||h=="ltr"&&!r.test(u))return!1;for(var D=u.length,L=[],H=0;H<D;++H)L.push(n(u.charCodeAt(H)));for(var Z=0,ie=x;Z<D;++Z){var ae=L[Z];ae=="m"?L[Z]=ie:ie=ae}for(var he=0,se=x;he<D;++he){var ge=L[he];ge=="1"&&se=="r"?L[he]="n":o.test(ge)&&(se=ge,ge=="r"&&(L[he]="R"))}for(var Le=1,ke=L[0];Le<D-1;++Le){var Ee=L[Le];Ee=="+"&&ke=="1"&&L[Le+1]=="1"?L[Le]="1":Ee==","&&ke==L[Le+1]&&(ke=="1"||ke=="n")&&(L[Le]=ke),ke=Ee}for(var Ke=0;Ke<D;++Ke){var st=L[Ke];if(st==",")L[Ke]="N";else if(st=="%"){var Xe=void 0;for(Xe=Ke+1;Xe<D&&L[Xe]=="%";++Xe);for(var Nt=Ke&&L[Ke-1]=="!"||Xe<D&&L[Xe]=="1"?"1":"N",Tt=Ke;Tt<Xe;++Tt)L[Tt]=Nt;Ke=Xe-1}}for(var tt=0,Ct=x;tt<D;++tt){var ft=L[tt];Ct=="L"&&ft=="1"?L[tt]="L":o.test(ft)&&(Ct=ft)}for(var nt=0;nt<D;++nt)if(i.test(L[nt])){var rt=void 0;for(rt=nt+1;rt<D&&i.test(L[rt]);++rt);for(var Ze=(nt?L[nt-1]:x)=="L",Dt=(rt<D?L[rt]:x)=="L",nn=Ze==Dt?Ze?"L":"R":x,yr=nt;yr<rt;++yr)L[yr]=nn;nt=rt-1}for(var vt=[],Jt,ut=0;ut<D;)if(l.test(L[ut])){var co=ut;for(++ut;ut<D&&l.test(L[ut]);++ut);vt.push(new s(0,co,ut))}else{var ir=ut,Ar=vt.length,Nr=h=="rtl"?1:0;for(++ut;ut<D&&L[ut]!="L";++ut);for(var bt=ir;bt<ut;)if(a.test(L[bt])){ir<bt&&(vt.splice(Ar,0,new s(1,ir,bt)),Ar+=Nr);var on=bt;for(++bt;bt<ut&&a.test(L[bt]);++bt);vt.splice(Ar,0,new s(2,on,bt)),Ar+=Nr,ir=bt}else++bt;ir<ut&&vt.splice(Ar,0,new s(1,ir,ut))}return h=="ltr"&&(vt[0].level==1&&(Jt=u.match(/^\s+/))&&(vt[0].from=Jt[0].length,vt.unshift(new s(0,0,Jt[0].length))),we(vt).level==1&&(Jt=u.match(/\s+$/))&&(we(vt).to-=Jt[0].length,vt.push(new s(0,D-Jt[0].length,D)))),h=="rtl"?vt.reverse():vt}})();function Re(e,t){var n=e.order;return n==null&&(n=e.order=mi(e.text,t)),n}var Bn=[],Se=function(e,t,n){if(e.addEventListener)e.addEventListener(t,n,!1);else if(e.attachEvent)e.attachEvent("on"+t,n);else{var r=e._handlers||(e._handlers={});r[t]=(r[t]||Bn).concat(n)}};function Zt(e,t){return e._handlers&&e._handlers[t]||Bn}function ht(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n,!1);else if(e.detachEvent)e.detachEvent("on"+t,n);else{var r=e._handlers,i=r&&r[t];if(i){var o=ve(i,n);o>-1&&(r[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function Ye(e,t){var n=Zt(e,t);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),i=0;i<n.length;++i)n[i].apply(null,r)}function Qe(e,t,n){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),Ye(e,n||t.type,e,t),kt(t)||t.codemirrorIgnore}function It(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var n=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),r=0;r<t.length;++r)ve(n,t[r])==-1&&n.push(t[r])}function Ft(e,t){return Zt(e,t).length>0}function Bt(e){e.prototype.on=function(t,n){Se(this,t,n)},e.prototype.off=function(t,n){ht(this,t,n)}}function pt(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Er(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function kt(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function ar(e){pt(e),Er(e)}function ln(e){return e.target||e.srcElement}function Rt(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),z&&e.ctrlKey&&t==1&&(t=3),t}var xi=(function(){if(k&&I<9)return!1;var e=c("div");return"draggable"in e||"dragDrop"in e})(),Or;function Rn(e){if(Or==null){var t=c("span","â€‹");G(e,c("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(Or=t.offsetWidth<=1&&t.offsetHeight>2&&!(k&&I<8))}var n=Or?c("span","â€‹"):c("span","Â ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}var an;function sr(e){if(an!=null)return an;var t=G(e,document.createTextNode("AØ®A")),n=C(t,0,1).getBoundingClientRect(),r=C(t,1,2).getBoundingClientRect();return F(e),!n||n.left==n.right?!1:an=r.right-n.right<3}var zt=`

b`.split(/\n/).length!=3?function(e){for(var t=0,n=[],r=e.length;t<=r;){var i=e.indexOf(`
`,t);i==-1&&(i=e.length);var o=e.slice(t,e.charAt(i-1)=="\r"?i-1:i),l=o.indexOf("\r");l!=-1?(n.push(o.slice(0,l)),t+=l+1):(n.push(o),t=i+1)}return n}:function(e){return e.split(/\r\n?|\n/)},ur=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch{return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch{}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},Wn=(function(){var e=c("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")})(),Wt=null;function yi(e){if(Wt!=null)return Wt;var t=G(e,c("span","x")),n=t.getBoundingClientRect(),r=C(t,0,1).getBoundingClientRect();return Wt=Math.abs(n.left-r.left)>1}var Pr={},Ht={};function _t(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Pr[e]=t}function kr(e,t){Ht[e]=t}function Ir(e){if(typeof e=="string"&&Ht.hasOwnProperty(e))e=Ht[e];else if(e&&typeof e.name=="string"&&Ht.hasOwnProperty(e.name)){var t=Ht[e.name];typeof t=="string"&&(t={name:t}),e=K(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Ir("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Ir("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function zr(e,t){t=Ir(t);var n=Pr[t.name];if(!n)return zr(e,"text/plain");var r=n(e,t);if(fr.hasOwnProperty(t.name)){var i=fr[t.name];for(var o in i)i.hasOwnProperty(o)&&(r.hasOwnProperty(o)&&(r["_"+o]=r[o]),r[o]=i[o])}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var l in t.modeProps)r[l]=t.modeProps[l];return r}var fr={};function Br(e,t){var n=fr.hasOwnProperty(e)?fr[e]:fr[e]={};Me(t,n)}function Gt(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var i=t[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n}function sn(e,t){for(var n;e.innerMode&&(n=e.innerMode(t),!(!n||n.mode==e));)t=n.state,e=n.mode;return n||{mode:e,state:t}}function Rr(e,t,n){return e.startState?e.startState(t,n):!0}var Je=function(e,t,n){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};Je.prototype.eol=function(){return this.pos>=this.string.length},Je.prototype.sol=function(){return this.pos==this.lineStart},Je.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Je.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Je.prototype.eat=function(e){var t=this.string.charAt(this.pos),n;if(typeof e=="string"?n=t==e:n=t&&(e.test?e.test(t):e(t)),n)return++this.pos,t},Je.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Je.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Je.prototype.skipToEnd=function(){this.pos=this.string.length},Je.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Je.prototype.backUp=function(e){this.pos-=e},Je.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=Fe(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?Fe(this.string,this.lineStart,this.tabSize):0)},Je.prototype.indentation=function(){return Fe(this.string,null,this.tabSize)-(this.lineStart?Fe(this.string,this.lineStart,this.tabSize):0)},Je.prototype.match=function(e,t,n){if(typeof e=="string"){var r=function(l){return n?l.toLowerCase():l},i=this.string.substr(this.pos,e.length);if(r(i)==r(e))return t!==!1&&(this.pos+=e.length),!0}else{var o=this.string.slice(this.pos).match(e);return o&&o.index>0?null:(o&&t!==!1&&(this.pos+=o[0].length),o)}},Je.prototype.current=function(){return this.string.slice(this.start,this.pos)},Je.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Je.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Je.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function ye(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var n=e;!n.lines;)for(var r=0;;++r){var i=n.children[r],o=i.chunkSize();if(t<o){n=i;break}t-=o}return n.lines[t]}function $t(e,t,n){var r=[],i=t.line;return e.iter(t.line,n.line+1,function(o){var l=o.text;i==n.line&&(l=l.slice(0,n.ch)),i==t.line&&(l=l.slice(t.ch)),r.push(l),++i}),r}function un(e,t,n){var r=[];return e.iter(t,n,function(i){r.push(i.text)}),r}function Et(e,t){var n=t-e.height;if(n)for(var r=e;r;r=r.parent)r.height+=n}function f(e){if(e.parent==null)return null;for(var t=e.parent,n=ve(t.lines,e),r=t.parent;r;t=r,r=r.parent)for(var i=0;r.children[i]!=t;++i)n+=r.children[i].chunkSize();return n+t.first}function m(e,t){var n=e.first;e:do{for(var r=0;r<e.children.length;++r){var i=e.children[r],o=i.height;if(t<o){e=i;continue e}t-=o,n+=i.chunkSize()}return n}while(!e.lines);for(var l=0;l<e.lines.length;++l){var a=e.lines[l],s=a.height;if(t<s)break;t-=s}return n+l}function U(e,t){return t>=e.first&&t<e.first+e.size}function re(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function B(e,t,n){if(n===void 0&&(n=null),!(this instanceof B))return new B(e,t,n);this.line=e,this.ch=t,this.sticky=n}function ce(e,t){return e.line-t.line||e.ch-t.ch}function We(e,t){return e.sticky==t.sticky&&ce(e,t)==0}function it(e){return B(e.line,e.ch)}function wt(e,t){return ce(e,t)<0?t:e}function Wr(e,t){return ce(e,t)<0?e:t}function go(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function Ae(e,t){if(t.line<e.first)return B(e.first,0);var n=e.first+e.size-1;return t.line>n?B(n,ye(e,n).text.length):Za(t,ye(e,t.line).text.length)}function Za(e,t){var n=e.ch;return n==null||n>t?B(e.line,t):n<0?B(e.line,0):e}function vo(e,t){for(var n=[],r=0;r<t.length;r++)n[r]=Ae(e,t[r]);return n}var Hn=function(e,t){this.state=e,this.lookAhead=t},Xt=function(e,t,n,r){this.state=t,this.doc=e,this.line=n,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};Xt.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},Xt.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},Xt.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Xt.fromSaved=function(e,t,n){return t instanceof Hn?new Xt(e,Gt(e.mode,t.state),n,t.lookAhead):new Xt(e,Gt(e.mode,t),n)},Xt.prototype.save=function(e){var t=e!==!1?Gt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new Hn(t,this.maxLookAhead):t};function mo(e,t,n,r){var i=[e.state.modeGen],o={};So(e,t.text,e.doc.mode,n,function(u,h){return i.push(u,h)},o,r);for(var l=n.state,a=function(u){n.baseTokens=i;var h=e.state.overlays[u],x=1,D=0;n.state=!0,So(e,t.text,h.mode,n,function(L,H){for(var Z=x;D<L;){var ie=i[x];ie>L&&i.splice(x,1,L,i[x+1],ie),x+=2,D=Math.min(L,ie)}if(H)if(h.opaque)i.splice(Z,x-Z,L,"overlay "+H),x=Z+2;else for(;Z<x;Z+=2){var ae=i[Z+1];i[Z+1]=(ae?ae+" ":"")+"overlay "+H}},o),n.state=l,n.baseTokens=null,n.baseTokenPos=1},s=0;s<e.state.overlays.length;++s)a(s);return{styles:i,classes:o.bgClass||o.textClass?o:null}}function xo(e,t,n){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=fn(e,f(t)),i=t.text.length>e.options.maxHighlightLength&&Gt(e.doc.mode,r.state),o=mo(e,t,r);i&&(r.state=i),t.stateAfter=r.save(!i),t.styles=o.styles,o.classes?t.styleClasses=o.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function fn(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return new Xt(r,!0,t);var o=$a(e,t,n),l=o>r.first&&ye(r,o-1).stateAfter,a=l?Xt.fromSaved(r,l,o):new Xt(r,Rr(r.mode),o);return r.iter(o,t,function(s){bi(e,s.text,a);var u=a.line;s.stateAfter=u==t-1||u%5==0||u>=i.viewFrom&&u<i.viewTo?a.save():null,a.nextLine()}),n&&(r.modeFrontier=a.line),a}function bi(e,t,n,r){var i=e.doc.mode,o=new Je(t,e.options.tabSize,n);for(o.start=o.pos=r||0,t==""&&yo(i,n.state);!o.eol();)ki(i,o,n.state),o.start=o.pos}function yo(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var n=sn(e,t);if(n.mode.blankLine)return n.mode.blankLine(n.state)}}function ki(e,t,n,r){for(var i=0;i<10;i++){r&&(r[0]=sn(e,n).mode);var o=e.token(t,n);if(t.pos>t.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}var bo=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function ko(e,t,n,r){var i=e.doc,o=i.mode,l;t=Ae(i,t);var a=ye(i,t.line),s=fn(e,t.line,n),u=new Je(a.text,e.options.tabSize,s),h;for(r&&(h=[]);(r||u.pos<t.ch)&&!u.eol();)u.start=u.pos,l=ki(o,u,s.state),r&&h.push(new bo(u,l,Gt(i.mode,s.state)));return r?h:new bo(u,l,s.state)}function wo(e,t){if(e)for(;;){var n=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!n)break;e=e.slice(0,n.index)+e.slice(n.index+n[0].length);var r=n[1]?"bgClass":"textClass";t[r]==null?t[r]=n[2]:new RegExp("(?:^|\\s)"+n[2]+"(?:$|\\s)").test(t[r])||(t[r]+=" "+n[2])}return e}function So(e,t,n,r,i,o,l){var a=n.flattenSpans;a==null&&(a=e.options.flattenSpans);var s=0,u=null,h=new Je(t,e.options.tabSize,r),x,D=e.options.addModeClass&&[null];for(t==""&&wo(yo(n,r.state),o);!h.eol();){if(h.pos>e.options.maxHighlightLength?(a=!1,l&&bi(e,t,r,h.pos),h.pos=t.length,x=null):x=wo(ki(n,h,r.state,D),o),D){var L=D[0].name;L&&(x="m-"+(x?L+" "+x:L))}if(!a||u!=x){for(;s<h.start;)s=Math.min(h.start,s+5e3),i(s,u);u=x}h.start=h.pos}for(;s<h.pos;){var H=Math.min(h.pos,s+5e3);i(H,u),s=H}}function $a(e,t,n){for(var r,i,o=e.doc,l=n?-1:t-(e.doc.mode.innerMode?1e3:100),a=t;a>l;--a){if(a<=o.first)return o.first;var s=ye(o,a-1),u=s.stateAfter;if(u&&(!n||a+(u instanceof Hn?u.lookAhead:0)<=o.modeFrontier))return a;var h=Fe(s.text,null,e.options.tabSize);(i==null||r>h)&&(i=a-1,r=h)}return i}function Va(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontier<t-10)){for(var n=e.first,r=t-1;r>n;r--){var i=ye(e,r).stateAfter;if(i&&(!(i instanceof Hn)||r+i.lookAhead<t)){n=r+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,n)}}var Lo=!1,Vt=!1;function es(){Lo=!0}function ts(){Vt=!0}function _n(e,t,n){this.marker=e,this.from=t,this.to=n}function cn(e,t){if(e)for(var n=0;n<e.length;++n){var r=e[n];if(r.marker==t)return r}}function rs(e,t){for(var n,r=0;r<e.length;++r)e[r]!=t&&(n||(n=[])).push(e[r]);return n}function ns(e,t,n){var r=n&&window.WeakSet&&(n.markedSpans||(n.markedSpans=new WeakSet));r&&e.markedSpans&&r.has(e.markedSpans)?e.markedSpans.push(t):(e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],r&&r.add(e.markedSpans)),t.marker.attachLine(e)}function is(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var o=e[i],l=o.marker,a=o.from==null||(l.inclusiveLeft?o.from<=t:o.from<t);if(a||o.from==t&&l.type=="bookmark"&&(!n||!o.marker.insertLeft)){var s=o.to==null||(l.inclusiveRight?o.to>=t:o.to>t);(r||(r=[])).push(new _n(l,o.from,s?null:o.to))}}return r}function os(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var o=e[i],l=o.marker,a=o.to==null||(l.inclusiveRight?o.to>=t:o.to>t);if(a||o.from==t&&l.type=="bookmark"&&(!n||o.marker.insertLeft)){var s=o.from==null||(l.inclusiveLeft?o.from<=t:o.from<t);(r||(r=[])).push(new _n(l,s?null:o.from-t,o.to==null?null:o.to-t))}}return r}function wi(e,t){if(t.full)return null;var n=U(e,t.from.line)&&ye(e,t.from.line).markedSpans,r=U(e,t.to.line)&&ye(e,t.to.line).markedSpans;if(!n&&!r)return null;var i=t.from.ch,o=t.to.ch,l=ce(t.from,t.to)==0,a=is(n,i,l),s=os(r,o,l),u=t.text.length==1,h=we(t.text).length+(u?i:0);if(a)for(var x=0;x<a.length;++x){var D=a[x];if(D.to==null){var L=cn(s,D.marker);L?u&&(D.to=L.to==null?null:L.to+h):D.to=i}}if(s)for(var H=0;H<s.length;++H){var Z=s[H];if(Z.to!=null&&(Z.to+=h),Z.from==null){var ie=cn(a,Z.marker);ie||(Z.from=h,u&&(a||(a=[])).push(Z))}else Z.from+=h,u&&(a||(a=[])).push(Z)}a&&(a=To(a)),s&&s!=a&&(s=To(s));var ae=[a];if(!u){var he=t.text.length-2,se;if(he>0&&a)for(var ge=0;ge<a.length;++ge)a[ge].to==null&&(se||(se=[])).push(new _n(a[ge].marker,null,null));for(var Le=0;Le<he;++Le)ae.push(se);ae.push(s)}return ae}function To(e){for(var t=0;t<e.length;++t){var n=e[t];n.from!=null&&n.from==n.to&&n.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function ls(e,t,n){var r=null;if(e.iter(t.line,n.line+1,function(L){if(L.markedSpans)for(var H=0;H<L.markedSpans.length;++H){var Z=L.markedSpans[H].marker;Z.readOnly&&(!r||ve(r,Z)==-1)&&(r||(r=[])).push(Z)}}),!r)return null;for(var i=[{from:t,to:n}],o=0;o<r.length;++o)for(var l=r[o],a=l.find(0),s=0;s<i.length;++s){var u=i[s];if(!(ce(u.to,a.from)<0||ce(u.from,a.to)>0)){var h=[s,1],x=ce(u.from,a.from),D=ce(u.to,a.to);(x<0||!l.inclusiveLeft&&!x)&&h.push({from:u.from,to:a.from}),(D>0||!l.inclusiveRight&&!D)&&h.push({from:a.to,to:u.to}),i.splice.apply(i,h),s+=h.length-3}}return i}function Co(e){var t=e.markedSpans;if(t){for(var n=0;n<t.length;++n)t[n].marker.detachLine(e);e.markedSpans=null}}function Do(e,t){if(t){for(var n=0;n<t.length;++n)t[n].marker.attachLine(e);e.markedSpans=t}}function qn(e){return e.inclusiveLeft?-1:0}function jn(e){return e.inclusiveRight?1:0}function Si(e,t){var n=e.lines.length-t.lines.length;if(n!=0)return n;var r=e.find(),i=t.find(),o=ce(r.from,i.from)||qn(e)-qn(t);if(o)return-o;var l=ce(r.to,i.to)||jn(e)-jn(t);return l||t.id-e.id}function Mo(e,t){var n=Vt&&e.markedSpans,r;if(n)for(var i=void 0,o=0;o<n.length;++o)i=n[o],i.marker.collapsed&&(t?i.from:i.to)==null&&(!r||Si(r,i.marker)<0)&&(r=i.marker);return r}function Fo(e){return Mo(e,!0)}function Kn(e){return Mo(e,!1)}function as(e,t){var n=Vt&&e.markedSpans,r;if(n)for(var i=0;i<n.length;++i){var o=n[i];o.marker.collapsed&&(o.from==null||o.from<t)&&(o.to==null||o.to>t)&&(!r||Si(r,o.marker)<0)&&(r=o.marker)}return r}function Ao(e,t,n,r,i){var o=ye(e,t),l=Vt&&o.markedSpans;if(l)for(var a=0;a<l.length;++a){var s=l[a];if(s.marker.collapsed){var u=s.marker.find(0),h=ce(u.from,n)||qn(s.marker)-qn(i),x=ce(u.to,r)||jn(s.marker)-jn(i);if(!(h>=0&&x<=0||h<=0&&x>=0)&&(h<=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?ce(u.to,n)>=0:ce(u.to,n)>0)||h>=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?ce(u.from,r)<=0:ce(u.from,r)<0)))return!0}}}function qt(e){for(var t;t=Fo(e);)e=t.find(-1,!0).line;return e}function ss(e){for(var t;t=Kn(e);)e=t.find(1,!0).line;return e}function us(e){for(var t,n;t=Kn(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}function Li(e,t){var n=ye(e,t),r=qt(n);return n==r?t:f(r)}function No(e,t){if(t>e.lastLine())return t;var n=ye(e,t),r;if(!cr(e,n))return t;for(;r=Kn(n);)n=r.find(1,!0).line;return f(n)+1}function cr(e,t){var n=Vt&&t.markedSpans;if(n){for(var r=void 0,i=0;i<n.length;++i)if(r=n[i],!!r.marker.collapsed){if(r.from==null)return!0;if(!r.marker.widgetNode&&r.from==0&&r.marker.inclusiveLeft&&Ti(e,t,r))return!0}}}function Ti(e,t,n){if(n.to==null){var r=n.marker.find(1,!0);return Ti(e,r.line,cn(r.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.to==t.text.length)return!0;for(var i=void 0,o=0;o<t.markedSpans.length;++o)if(i=t.markedSpans[o],i.marker.collapsed&&!i.marker.widgetNode&&i.from==n.to&&(i.to==null||i.to!=n.from)&&(i.marker.inclusiveLeft||n.marker.inclusiveRight)&&Ti(e,t,i))return!0}function er(e){e=qt(e);for(var t=0,n=e.parent,r=0;r<n.lines.length;++r){var i=n.lines[r];if(i==e)break;t+=i.height}for(var o=n.parent;o;n=o,o=n.parent)for(var l=0;l<o.children.length;++l){var a=o.children[l];if(a==n)break;t+=a.height}return t}function Un(e){if(e.height==0)return 0;for(var t=e.text.length,n,r=e;n=Fo(r);){var i=n.find(0,!0);r=i.from.line,t+=i.from.ch-i.to.ch}for(r=e;n=Kn(r);){var o=n.find(0,!0);t-=r.text.length-o.from.ch,r=o.to.line,t+=r.text.length-o.to.ch}return t}function Ci(e){var t=e.display,n=e.doc;t.maxLine=ye(n,n.first),t.maxLineLength=Un(t.maxLine),t.maxLineChanged=!0,n.iter(function(r){var i=Un(r);i>t.maxLineLength&&(t.maxLineLength=i,t.maxLine=r)})}var Hr=function(e,t,n){this.text=e,Do(this,t),this.height=n?n(this):1};Hr.prototype.lineNo=function(){return f(this)},Bt(Hr);function fs(e,t,n,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),Co(e),Do(e,n);var i=r?r(e):1;i!=e.height&&Et(e,i)}function cs(e){e.parent=null,Co(e)}var ds={},hs={};function Eo(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?hs:ds;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function Oo(e,t){var n=T("span",null,null,Y?"padding-right: .1px":null),r={pre:T("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var o=i?t.rest[i-1]:t.line,l=void 0;r.pos=0,r.addToken=gs,sr(e.display.measure)&&(l=Re(o,e.doc.direction))&&(r.addToken=ms(r.addToken,l)),r.map=[];var a=t!=e.display.externalMeasured&&f(o);xs(o,r,xo(e,o,a)),o.styleClasses&&(o.styleClasses.bgClass&&(r.bgClass=de(o.styleClasses.bgClass,r.bgClass||"")),o.styleClasses.textClass&&(r.textClass=de(o.styleClasses.textClass,r.textClass||""))),r.map.length==0&&r.map.push(0,0,r.content.appendChild(Rn(e.display.measure))),i==0?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(Y){var s=r.content.lastChild;(/\bcm-tab\b/.test(s.className)||s.querySelector&&s.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return Ye(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=de(r.pre.className,r.textClass||"")),r}function ps(e){var t=c("span","â€¢","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function gs(e,t,n,r,i,o,l){if(t){var a=e.splitSpaces?vs(t,e.trailingSpace):t,s=e.cm.state.specialChars,u=!1,h;if(!s.test(t))e.col+=t.length,h=document.createTextNode(a),e.map.push(e.pos,e.pos+t.length,h),k&&I<9&&(u=!0),e.pos+=t.length;else{h=document.createDocumentFragment();for(var x=0;;){s.lastIndex=x;var D=s.exec(t),L=D?D.index-x:t.length-x;if(L){var H=document.createTextNode(a.slice(x,x+L));k&&I<9?h.appendChild(c("span",[H])):h.appendChild(H),e.map.push(e.pos,e.pos+L,H),e.col+=L,e.pos+=L}if(!D)break;x+=L+1;var Z=void 0;if(D[0]=="	"){var ie=e.cm.options.tabSize,ae=ie-e.col%ie;Z=h.appendChild(c("span",et(ae),"cm-tab")),Z.setAttribute("role","presentation"),Z.setAttribute("cm-text","	"),e.col+=ae}else D[0]=="\r"||D[0]==`
`?(Z=h.appendChild(c("span",D[0]=="\r"?"â��":"â�¤","cm-invalidchar")),Z.setAttribute("cm-text",D[0]),e.col+=1):(Z=e.cm.options.specialCharPlaceholder(D[0]),Z.setAttribute("cm-text",D[0]),k&&I<9?h.appendChild(c("span",[Z])):h.appendChild(Z),e.col+=1);e.map.push(e.pos,e.pos+1,Z),e.pos++}}if(e.trailingSpace=a.charCodeAt(t.length-1)==32,n||r||i||u||o||l){var he=n||"";r&&(he+=r),i&&(he+=i);var se=c("span",[h],he,o);if(l)for(var ge in l)l.hasOwnProperty(ge)&&ge!="style"&&ge!="class"&&se.setAttribute(ge,l[ge]);return e.content.appendChild(se)}e.content.appendChild(h)}}function vs(e,t){if(e.length>1&&!/  /.test(e))return e;for(var n=t,r="",i=0;i<e.length;i++){var o=e.charAt(i);o==" "&&n&&(i==e.length-1||e.charCodeAt(i+1)==32)&&(o="Â "),r+=o,n=o==" "}return r}function ms(e,t){return function(n,r,i,o,l,a,s){i=i?i+" cm-force-border":"cm-force-border";for(var u=n.pos,h=u+r.length;;){for(var x=void 0,D=0;D<t.length&&(x=t[D],!(x.to>u&&x.from<=u));D++);if(x.to>=h)return e(n,r,i,o,l,a,s);e(n,r.slice(0,x.to-u),i,o,null,a,s),o=null,r=r.slice(x.to-u),u=x.to}}}function Po(e,t,n,r){var i=!r&&n.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!r&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",n.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function xs(e,t,n){var r=e.markedSpans,i=e.text,o=0;if(!r){for(var l=1;l<n.length;l+=2)t.addToken(t,i.slice(o,o=n[l]),Eo(n[l+1],t.cm.options));return}for(var a=i.length,s=0,u=1,h="",x,D,L=0,H,Z,ie,ae,he;;){if(L==s){H=Z=ie=D="",he=null,ae=null,L=1/0;for(var se=[],ge=void 0,Le=0;Le<r.length;++Le){var ke=r[Le],Ee=ke.marker;if(Ee.type=="bookmark"&&ke.from==s&&Ee.widgetNode)se.push(Ee);else if(ke.from<=s&&(ke.to==null||ke.to>s||Ee.collapsed&&ke.to==s&&ke.from==s)){if(ke.to!=null&&ke.to!=s&&L>ke.to&&(L=ke.to,Z=""),Ee.className&&(H+=" "+Ee.className),Ee.css&&(D=(D?D+";":"")+Ee.css),Ee.startStyle&&ke.from==s&&(ie+=" "+Ee.startStyle),Ee.endStyle&&ke.to==L&&(ge||(ge=[])).push(Ee.endStyle,ke.to),Ee.title&&((he||(he={})).title=Ee.title),Ee.attributes)for(var Ke in Ee.attributes)(he||(he={}))[Ke]=Ee.attributes[Ke];Ee.collapsed&&(!ae||Si(ae.marker,Ee)<0)&&(ae=ke)}else ke.from>s&&L>ke.from&&(L=ke.from)}if(ge)for(var st=0;st<ge.length;st+=2)ge[st+1]==L&&(Z+=" "+ge[st]);if(!ae||ae.from==s)for(var Xe=0;Xe<se.length;++Xe)Po(t,0,se[Xe]);if(ae&&(ae.from||0)==s){if(Po(t,(ae.to==null?a+1:ae.to)-s,ae.marker,ae.from==null),ae.to==null)return;ae.to==s&&(ae=!1)}}if(s>=a)break;for(var Nt=Math.min(a,L);;){if(h){var Tt=s+h.length;if(!ae){var tt=Tt>Nt?h.slice(0,Nt-s):h;t.addToken(t,tt,x?x+H:H,ie,s+tt.length==L?Z:"",D,he)}if(Tt>=Nt){h=h.slice(Nt-s),s=Nt;break}s=Tt,ie=""}h=i.slice(o,o=n[u++]),x=Eo(n[u++],t.cm.options)}}}function Io(e,t,n){this.line=t,this.rest=us(t),this.size=this.rest?f(we(this.rest))-n+1:1,this.node=this.text=null,this.hidden=cr(e,t)}function Gn(e,t,n){for(var r=[],i,o=t;o<n;o=i){var l=new Io(e.doc,ye(e.doc,o),o);i=o+l.size,r.push(l)}return r}var _r=null;function ys(e){_r?_r.ops.push(e):e.ownsGroup=_r={ops:[e],delayedCallbacks:[]}}function bs(e){var t=e.delayedCallbacks,n=0;do{for(;n<t.length;n++)t[n].call(null);for(var r=0;r<e.ops.length;r++){var i=e.ops[r];if(i.cursorActivityHandlers)for(;i.cursorActivityCalled<i.cursorActivityHandlers.length;)i.cursorActivityHandlers[i.cursorActivityCalled++].call(null,i.cm)}}while(n<t.length)}function ks(e,t){var n=e.ownsGroup;if(n)try{bs(n)}finally{_r=null,t(n)}}var dn=null;function ot(e,t){var n=Zt(e,t);if(n.length){var r=Array.prototype.slice.call(arguments,2),i;_r?i=_r.delayedCallbacks:dn?i=dn:(i=dn=[],setTimeout(ws,0));for(var o=function(a){i.push(function(){return n[a].apply(null,r)})},l=0;l<n.length;++l)o(l)}}function ws(){var e=dn;dn=null;for(var t=0;t<e.length;++t)e[t]()}function zo(e,t,n,r){for(var i=0;i<t.changes.length;i++){var o=t.changes[i];o=="text"?Ls(e,t):o=="gutter"?Ro(e,t,n,r):o=="class"?Di(e,t):o=="widget"&&Ts(e,t,r)}t.changes=null}function hn(e){return e.node==e.text&&(e.node=c("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),k&&I<8&&(e.node.style.zIndex=2)),e.node}function Ss(e,t){var n=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(n&&(n+=" CodeMirror-linebackground"),t.background)n?t.background.className=n:(t.background.parentNode.removeChild(t.background),t.background=null);else if(n){var r=hn(t);t.background=r.insertBefore(c("div",null,n),r.firstChild),e.display.input.setUneditable(t.background)}}function Bo(e,t){var n=e.display.externalMeasured;return n&&n.line==t.line?(e.display.externalMeasured=null,t.measure=n.measure,n.built):Oo(e,t)}function Ls(e,t){var n=t.text.className,r=Bo(e,t);t.text==t.node&&(t.node=r.pre),t.text.parentNode.replaceChild(r.pre,t.text),t.text=r.pre,r.bgClass!=t.bgClass||r.textClass!=t.textClass?(t.bgClass=r.bgClass,t.textClass=r.textClass,Di(e,t)):n&&(t.text.className=n)}function Di(e,t){Ss(e,t),t.line.wrapClass?hn(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var n=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=n||""}function Ro(e,t,n,r){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var i=hn(t);t.gutterBackground=c("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px; width: "+r.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),i.insertBefore(t.gutterBackground,t.text)}var o=t.line.gutterMarkers;if(e.options.lineNumbers||o){var l=hn(t),a=t.gutter=c("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px");if(a.setAttribute("aria-hidden","true"),e.display.input.setUneditable(a),l.insertBefore(a,t.text),t.line.gutterClass&&(a.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!o||!o["CodeMirror-linenumbers"])&&(t.lineNumber=a.appendChild(c("div",re(e.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),o)for(var s=0;s<e.display.gutterSpecs.length;++s){var u=e.display.gutterSpecs[s].className,h=o.hasOwnProperty(u)&&o[u];h&&a.appendChild(c("div",[h],"CodeMirror-gutter-elt","left: "+r.gutterLeft[u]+"px; width: "+r.gutterWidth[u]+"px"))}}}function Ts(e,t,n){t.alignable&&(t.alignable=null);for(var r=P("CodeMirror-linewidget"),i=t.node.firstChild,o=void 0;i;i=o)o=i.nextSibling,r.test(i.className)&&t.node.removeChild(i);Wo(e,t,n)}function Cs(e,t,n,r){var i=Bo(e,t);return t.text=t.node=i.pre,i.bgClass&&(t.bgClass=i.bgClass),i.textClass&&(t.textClass=i.textClass),Di(e,t),Ro(e,t,n,r),Wo(e,t,r),t.node}function Wo(e,t,n){if(Ho(e,t.line,t,n,!0),t.rest)for(var r=0;r<t.rest.length;r++)Ho(e,t.rest[r],t,n,!1)}function Ho(e,t,n,r,i){if(t.widgets)for(var o=hn(n),l=0,a=t.widgets;l<a.length;++l){var s=a[l],u=c("div",[s.node],"CodeMirror-linewidget"+(s.className?" "+s.className:""));s.handleMouseEvents||u.setAttribute("cm-ignore-events","true"),Ds(s,u,n,r),e.display.input.setUneditable(u),i&&s.above?o.insertBefore(u,n.gutter||n.text):o.appendChild(u),ot(s,"redraw")}}function Ds(e,t,n,r){if(e.noHScroll){(n.alignable||(n.alignable=[])).push(t);var i=r.wrapperWidth;t.style.left=r.fixedPos+"px",e.coverGutter||(i-=r.gutterTotalWidth,t.style.paddingLeft=r.gutterTotalWidth+"px"),t.style.width=i+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-r.gutterTotalWidth+"px"))}function pn(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!g(document.body,e.node)){var n="position: relative;";e.coverGutter&&(n+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(n+="width: "+t.display.wrapper.clientWidth+"px;"),G(t.display.measure,c("div",[e.node],null,n))}return e.height=e.node.parentNode.offsetHeight}function tr(e,t){for(var n=ln(t);n!=e.wrapper;n=n.parentNode)if(!n||n.nodeType==1&&n.getAttribute("cm-ignore-events")=="true"||n.parentNode==e.sizer&&n!=e.mover)return!0}function Xn(e){return e.lineSpace.offsetTop}function Mi(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function _o(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=G(e.measure,c("pre","x","CodeMirror-line-like")),n=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,r={left:parseInt(n.paddingLeft),right:parseInt(n.paddingRight)};return!isNaN(r.left)&&!isNaN(r.right)&&(e.cachedPaddingH=r),r}function Yt(e){return Oe-e.display.nativeBarWidth}function wr(e){return e.display.scroller.clientWidth-Yt(e)-e.display.barWidth}function Fi(e){return e.display.scroller.clientHeight-Yt(e)-e.display.barHeight}function Ms(e,t,n){var r=e.options.lineWrapping,i=r&&wr(e);if(!t.measure.heights||r&&t.measure.width!=i){var o=t.measure.heights=[];if(r){t.measure.width=i;for(var l=t.text.firstChild.getClientRects(),a=0;a<l.length-1;a++){var s=l[a],u=l[a+1];Math.abs(s.bottom-u.bottom)>2&&o.push((s.bottom+u.top)/2-n.top)}}o.push(n.bottom-n.top)}}function qo(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};if(e.rest){for(var r=0;r<e.rest.length;r++)if(e.rest[r]==t)return{map:e.measure.maps[r],cache:e.measure.caches[r]};for(var i=0;i<e.rest.length;i++)if(f(e.rest[i])>n)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}}function Fs(e,t){t=qt(t);var n=f(t),r=e.display.externalMeasured=new Io(e.doc,t,n);r.lineN=n;var i=r.built=Oo(e,r);return r.text=i.pre,G(e.display.lineMeasure,i.pre),r}function jo(e,t,n,r){return Qt(e,qr(e,t),n,r)}function Ai(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[Tr(e,t)];var n=e.display.externalMeasured;if(n&&t>=n.lineN&&t<n.lineN+n.size)return n}function qr(e,t){var n=f(t),r=Ai(e,n);r&&!r.text?r=null:r&&r.changes&&(zo(e,r,n,Ii(e)),e.curOp.forceUpdate=!0),r||(r=Fs(e,t));var i=qo(r,t,n);return{line:t,view:r,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function Qt(e,t,n,r,i){t.before&&(n=-1);var o=n+(r||""),l;return t.cache.hasOwnProperty(o)?l=t.cache[o]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(Ms(e,t.view,t.rect),t.hasHeights=!0),l=Ns(e,t,n,r),l.bogus||(t.cache[o]=l)),{left:l.left,right:l.right,top:i?l.rtop:l.top,bottom:i?l.rbottom:l.bottom}}var Ko={left:0,right:0,top:0,bottom:0};function Uo(e,t,n){for(var r,i,o,l,a,s,u=0;u<e.length;u+=3)if(a=e[u],s=e[u+1],t<a?(i=0,o=1,l="left"):t<s?(i=t-a,o=i+1):(u==e.length-3||t==s&&e[u+3]>t)&&(o=s-a,i=o-1,t>=s&&(l="right")),i!=null){if(r=e[u+2],a==s&&n==(r.insertLeft?"left":"right")&&(l=n),n=="left"&&i==0)for(;u&&e[u-2]==e[u-3]&&e[u-1].insertLeft;)r=e[(u-=3)+2],l="left";if(n=="right"&&i==s-a)for(;u<e.length-3&&e[u+3]==e[u+4]&&!e[u+5].insertLeft;)r=e[(u+=3)+2],l="right";break}return{node:r,start:i,end:o,collapse:l,coverStart:a,coverEnd:s}}function As(e,t){var n=Ko;if(t=="left")for(var r=0;r<e.length&&(n=e[r]).left==n.right;r++);else for(var i=e.length-1;i>=0&&(n=e[i]).left==n.right;i--);return n}function Ns(e,t,n,r){var i=Uo(t.map,n,r),o=i.node,l=i.start,a=i.end,s=i.collapse,u;if(o.nodeType==3){for(var h=0;h<4;h++){for(;l&&Ne(t.line.text.charAt(i.coverStart+l));)--l;for(;i.coverStart+a<i.coverEnd&&Ne(t.line.text.charAt(i.coverStart+a));)++a;if(k&&I<9&&l==0&&a==i.coverEnd-i.coverStart?u=o.parentNode.getBoundingClientRect():u=As(C(o,l,a).getClientRects(),r),u.left||u.right||l==0)break;a=l,l=l-1,s="right"}k&&I<11&&(u=Es(e.display.measure,u))}else{l>0&&(s=r="right");var x;e.options.lineWrapping&&(x=o.getClientRects()).length>1?u=x[r=="right"?x.length-1:0]:u=o.getBoundingClientRect()}if(k&&I<9&&!l&&(!u||!u.left&&!u.right)){var D=o.parentNode.getClientRects()[0];D?u={left:D.left,right:D.left+Kr(e.display),top:D.top,bottom:D.bottom}:u=Ko}for(var L=u.top-t.rect.top,H=u.bottom-t.rect.top,Z=(L+H)/2,ie=t.view.measure.heights,ae=0;ae<ie.length-1&&!(Z<ie[ae]);ae++);var he=ae?ie[ae-1]:0,se=ie[ae],ge={left:(s=="right"?u.right:u.left)-t.rect.left,right:(s=="left"?u.left:u.right)-t.rect.left,top:he,bottom:se};return!u.left&&!u.right&&(ge.bogus=!0),e.options.singleCursorHeightPerLine||(ge.rtop=L,ge.rbottom=H),ge}function Es(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!yi(e))return t;var n=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*n,right:t.right*n,top:t.top*r,bottom:t.bottom*r}}function Go(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function Xo(e){e.display.externalMeasure=null,F(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)Go(e.display.view[t])}function gn(e){Xo(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function Yo(e){return S&&M?-(e.body.getBoundingClientRect().left-parseInt(getComputedStyle(e.body).marginLeft)):e.defaultView.pageXOffset||(e.documentElement||e.body).scrollLeft}function Qo(e){return S&&M?-(e.body.getBoundingClientRect().top-parseInt(getComputedStyle(e.body).marginTop)):e.defaultView.pageYOffset||(e.documentElement||e.body).scrollTop}function Ni(e){var t=qt(e),n=t.widgets,r=0;if(n)for(var i=0;i<n.length;++i)n[i].above&&(r+=pn(n[i]));return r}function Yn(e,t,n,r,i){if(!i){var o=Ni(t);n.top+=o,n.bottom+=o}if(r=="line")return n;r||(r="local");var l=er(t);if(r=="local"?l+=Xn(e.display):l-=e.display.viewOffset,r=="page"||r=="window"){var a=e.display.lineSpace.getBoundingClientRect();l+=a.top+(r=="window"?0:Qo(d(e)));var s=a.left+(r=="window"?0:Yo(d(e)));n.left+=s,n.right+=s}return n.top+=l,n.bottom+=l,n}function Jo(e,t,n){if(n=="div")return t;var r=t.left,i=t.top;if(n=="page")r-=Yo(d(e)),i-=Qo(d(e));else if(n=="local"||!n){var o=e.display.sizer.getBoundingClientRect();r+=o.left,i+=o.top}var l=e.display.lineSpace.getBoundingClientRect();return{left:r-l.left,top:i-l.top}}function Qn(e,t,n,r,i){return r||(r=ye(e.doc,t.line)),Yn(e,r,jo(e,r,t.ch,i),n)}function jt(e,t,n,r,i,o){r=r||ye(e.doc,t.line),i||(i=qr(e,r));function l(H,Z){var ie=Qt(e,i,H,Z?"right":"left",o);return Z?ie.left=ie.right:ie.right=ie.left,Yn(e,r,ie,n)}var a=Re(r,e.doc.direction),s=t.ch,u=t.sticky;if(s>=r.text.length?(s=r.text.length,u="before"):s<=0&&(s=0,u="after"),!a)return l(u=="before"?s-1:s,u=="before");function h(H,Z,ie){var ae=a[Z],he=ae.level==1;return l(ie?H-1:H,he!=ie)}var x=lr(a,s,u),D=br,L=h(s,x,u=="before");return D!=null&&(L.other=h(s,D,u!="before")),L}function Zo(e,t){var n=0;t=Ae(e.doc,t),e.options.lineWrapping||(n=Kr(e.display)*t.ch);var r=ye(e.doc,t.line),i=er(r)+Xn(e.display);return{left:n,right:n,top:i,bottom:i+r.height}}function Ei(e,t,n,r,i){var o=B(e,t,n);return o.xRel=i,r&&(o.outside=r),o}function Oi(e,t,n){var r=e.doc;if(n+=e.display.viewOffset,n<0)return Ei(r.first,0,null,-1,-1);var i=m(r,n),o=r.first+r.size-1;if(i>o)return Ei(r.first+r.size-1,ye(r,o).text.length,null,1,1);t<0&&(t=0);for(var l=ye(r,i);;){var a=Os(e,l,i,t,n),s=as(l,a.ch+(a.xRel>0||a.outside>0?1:0));if(!s)return a;var u=s.find(1);if(u.line==i)return u;l=ye(r,i=u.line)}}function $o(e,t,n,r){r-=Ni(t);var i=t.text.length,o=Pt(function(l){return Qt(e,n,l-1).bottom<=r},i,0);return i=Pt(function(l){return Qt(e,n,l).top>r},o,i),{begin:o,end:i}}function Vo(e,t,n,r){n||(n=qr(e,t));var i=Yn(e,t,Qt(e,n,r),"line").top;return $o(e,t,n,i)}function Pi(e,t,n,r){return e.bottom<=n?!1:e.top>n?!0:(r?e.left:e.right)>t}function Os(e,t,n,r,i){i-=er(t);var o=qr(e,t),l=Ni(t),a=0,s=t.text.length,u=!0,h=Re(t,e.doc.direction);if(h){var x=(e.options.lineWrapping?Is:Ps)(e,t,n,o,h,r,i);u=x.level!=1,a=u?x.from:x.to-1,s=u?x.to:x.from-1}var D=null,L=null,H=Pt(function(Le){var ke=Qt(e,o,Le);return ke.top+=l,ke.bottom+=l,Pi(ke,r,i,!1)?(ke.top<=i&&ke.left<=r&&(D=Le,L=ke),!0):!1},a,s),Z,ie,ae=!1;if(L){var he=r-L.left<L.right-r,se=he==u;H=D+(se?0:1),ie=se?"after":"before",Z=he?L.left:L.right}else{!u&&(H==s||H==a)&&H++,ie=H==0?"after":H==t.text.length?"before":Qt(e,o,H-(u?1:0)).bottom+l<=i==u?"after":"before";var ge=jt(e,B(n,H,ie),"line",t,o);Z=ge.left,ae=i<ge.top?-1:i>=ge.bottom?1:0}return H=Mt(t.text,H,1),Ei(n,H,ie,ae,r-Z)}function Ps(e,t,n,r,i,o,l){var a=Pt(function(x){var D=i[x],L=D.level!=1;return Pi(jt(e,B(n,L?D.to:D.from,L?"before":"after"),"line",t,r),o,l,!0)},0,i.length-1),s=i[a];if(a>0){var u=s.level!=1,h=jt(e,B(n,u?s.from:s.to,u?"after":"before"),"line",t,r);Pi(h,o,l,!0)&&h.top>l&&(s=i[a-1])}return s}function Is(e,t,n,r,i,o,l){var a=$o(e,t,r,l),s=a.begin,u=a.end;/\s/.test(t.text.charAt(u-1))&&u--;for(var h=null,x=null,D=0;D<i.length;D++){var L=i[D];if(!(L.from>=u||L.to<=s)){var H=L.level!=1,Z=Qt(e,r,H?Math.min(u,L.to)-1:Math.max(s,L.from)).right,ie=Z<o?o-Z+1e9:Z-o;(!h||x>ie)&&(h=L,x=ie)}}return h||(h=i[i.length-1]),h.from<s&&(h={from:s,to:h.to,level:h.level}),h.to>u&&(h={from:h.from,to:u,level:h.level}),h}var Sr;function jr(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(Sr==null){Sr=c("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)Sr.appendChild(document.createTextNode("x")),Sr.appendChild(c("br"));Sr.appendChild(document.createTextNode("x"))}G(e.measure,Sr);var n=Sr.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),F(e.measure),n||1}function Kr(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=c("span","xxxxxxxxxx"),n=c("pre",[t],"CodeMirror-line-like");G(e.measure,n);var r=t.getBoundingClientRect(),i=(r.right-r.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function Ii(e){for(var t=e.display,n={},r={},i=t.gutters.clientLeft,o=t.gutters.firstChild,l=0;o;o=o.nextSibling,++l){var a=e.display.gutterSpecs[l].className;n[a]=o.offsetLeft+o.clientLeft+i,r[a]=o.clientWidth}return{fixedPos:zi(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function zi(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function el(e){var t=jr(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/Kr(e.display)-3);return function(i){if(cr(e.doc,i))return 0;var o=0;if(i.widgets)for(var l=0;l<i.widgets.length;l++)i.widgets[l].height&&(o+=i.widgets[l].height);return n?o+(Math.ceil(i.text.length/r)||1)*t:o+t}}function Bi(e){var t=e.doc,n=el(e);t.iter(function(r){var i=n(r);i!=r.height&&Et(r,i)})}function Lr(e,t,n,r){var i=e.display;if(!n&&ln(t).getAttribute("cm-not-content")=="true")return null;var o,l,a=i.lineSpace.getBoundingClientRect();try{o=t.clientX-a.left,l=t.clientY-a.top}catch{return null}var s=Oi(e,o,l),u;if(r&&s.xRel>0&&(u=ye(e.doc,s.line).text).length==s.ch){var h=Fe(u,u.length,e.options.tabSize)-u.length;s=B(s.line,Math.max(0,Math.round((o-_o(e.display).left)/Kr(e.display))-h))}return s}function Tr(e,t){if(t>=e.display.viewTo||(t-=e.display.viewFrom,t<0))return null;for(var n=e.display.view,r=0;r<n.length;r++)if(t-=n[r].size,t<0)return r}function St(e,t,n,r){t==null&&(t=e.doc.first),n==null&&(n=e.doc.first+e.doc.size),r||(r=0);var i=e.display;if(r&&n<i.viewTo&&(i.updateLineNumbers==null||i.updateLineNumbers>t)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)Vt&&Li(e.doc,t)<i.viewTo&&hr(e);else if(n<=i.viewFrom)Vt&&No(e.doc,n+r)>i.viewFrom?hr(e):(i.viewFrom+=r,i.viewTo+=r);else if(t<=i.viewFrom&&n>=i.viewTo)hr(e);else if(t<=i.viewFrom){var o=Jn(e,n,n+r,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=r):hr(e)}else if(n>=i.viewTo){var l=Jn(e,t,t,-1);l?(i.view=i.view.slice(0,l.index),i.viewTo=l.lineN):hr(e)}else{var a=Jn(e,t,t,-1),s=Jn(e,n,n+r,1);a&&s?(i.view=i.view.slice(0,a.index).concat(Gn(e,a.lineN,s.lineN)).concat(i.view.slice(s.index)),i.viewTo+=r):hr(e)}var u=i.externalMeasured;u&&(n<u.lineN?u.lineN+=r:t<u.lineN+u.size&&(i.externalMeasured=null))}function dr(e,t,n){e.curOp.viewChanged=!0;var r=e.display,i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size&&(r.externalMeasured=null),!(t<r.viewFrom||t>=r.viewTo)){var o=r.view[Tr(e,t)];if(o.node!=null){var l=o.changes||(o.changes=[]);ve(l,n)==-1&&l.push(n)}}}function hr(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Jn(e,t,n,r){var i=Tr(e,t),o,l=e.display.view;if(!Vt||n==e.doc.first+e.doc.size)return{index:i,lineN:n};for(var a=e.display.viewFrom,s=0;s<i;s++)a+=l[s].size;if(a!=t){if(r>0){if(i==l.length-1)return null;o=a+l[i].size-t,i++}else o=a-t;t+=o,n+=o}for(;Li(e.doc,n)!=n;){if(i==(r<0?0:l.length-1))return null;n+=r*l[i-(r<0?1:0)].size,i+=r}return{index:i,lineN:n}}function zs(e,t,n){var r=e.display,i=r.view;i.length==0||t>=r.viewTo||n<=r.viewFrom?(r.view=Gn(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=Gn(e,t,r.viewFrom).concat(r.view):r.viewFrom<t&&(r.view=r.view.slice(Tr(e,t))),r.viewFrom=t,r.viewTo<n?r.view=r.view.concat(Gn(e,r.viewTo,n)):r.viewTo>n&&(r.view=r.view.slice(0,Tr(e,n)))),r.viewTo=n}function tl(e){for(var t=e.display.view,n=0,r=0;r<t.length;r++){var i=t[r];!i.hidden&&(!i.node||i.changes)&&++n}return n}function vn(e){e.display.input.showSelection(e.display.input.prepareSelection())}function rl(e,t){t===void 0&&(t=!0);var n=e.doc,r={},i=r.cursors=document.createDocumentFragment(),o=r.selection=document.createDocumentFragment(),l=e.options.$customCursor;l&&(t=!0);for(var a=0;a<n.sel.ranges.length;a++)if(!(!t&&a==n.sel.primIndex)){var s=n.sel.ranges[a];if(!(s.from().line>=e.display.viewTo||s.to().line<e.display.viewFrom)){var u=s.empty();if(l){var h=l(e,s);h&&Ri(e,h,i)}else(u||e.options.showCursorWhenSelecting)&&Ri(e,s.head,i);u||Bs(e,s,o)}}return r}function Ri(e,t,n){var r=jt(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),i=n.appendChild(c("div","Â ","CodeMirror-cursor"));if(i.style.left=r.left+"px",i.style.top=r.top+"px",i.style.height=Math.max(0,r.bottom-r.top)*e.options.cursorHeight+"px",/\bcm-fat-cursor\b/.test(e.getWrapperElement().className)){var o=Qn(e,t,"div",null,null),l=o.right-o.left;i.style.width=(l>0?l:e.defaultCharWidth())+"px"}if(r.other){var a=n.appendChild(c("div","Â ","CodeMirror-cursor CodeMirror-secondarycursor"));a.style.display="",a.style.left=r.other.left+"px",a.style.top=r.other.top+"px",a.style.height=(r.other.bottom-r.other.top)*.85+"px"}}function Zn(e,t){return e.top-t.top||e.left-t.left}function Bs(e,t,n){var r=e.display,i=e.doc,o=document.createDocumentFragment(),l=_o(e.display),a=l.left,s=Math.max(r.sizerWidth,wr(e)-r.sizer.offsetLeft)-l.right,u=i.direction=="ltr";function h(se,ge,Le,ke){ge<0&&(ge=0),ge=Math.round(ge),ke=Math.round(ke),o.appendChild(c("div",null,"CodeMirror-selected","position: absolute; left: "+se+`px;
                             top: `+ge+"px; width: "+(Le??s-se)+`px;
                             height: `+(ke-ge)+"px"))}function x(se,ge,Le){var ke=ye(i,se),Ee=ke.text.length,Ke,st;function Xe(tt,Ct){return Qn(e,B(se,tt),"div",ke,Ct)}function Nt(tt,Ct,ft){var nt=Vo(e,ke,null,tt),rt=Ct=="ltr"==(ft=="after")?"left":"right",Ze=ft=="after"?nt.begin:nt.end-(/\s/.test(ke.text.charAt(nt.end-1))?2:1);return Xe(Ze,rt)[rt]}var Tt=Re(ke,i.direction);return or(Tt,ge||0,Le??Ee,function(tt,Ct,ft,nt){var rt=ft=="ltr",Ze=Xe(tt,rt?"left":"right"),Dt=Xe(Ct-1,rt?"right":"left"),nn=ge==null&&tt==0,yr=Le==null&&Ct==Ee,vt=nt==0,Jt=!Tt||nt==Tt.length-1;if(Dt.top-Ze.top<=3){var ut=(u?nn:yr)&&vt,co=(u?yr:nn)&&Jt,ir=ut?a:(rt?Ze:Dt).left,Ar=co?s:(rt?Dt:Ze).right;h(ir,Ze.top,Ar-ir,Ze.bottom)}else{var Nr,bt,on,ho;rt?(Nr=u&&nn&&vt?a:Ze.left,bt=u?s:Nt(tt,ft,"before"),on=u?a:Nt(Ct,ft,"after"),ho=u&&yr&&Jt?s:Dt.right):(Nr=u?Nt(tt,ft,"before"):a,bt=!u&&nn&&vt?s:Ze.right,on=!u&&yr&&Jt?a:Dt.left,ho=u?Nt(Ct,ft,"after"):s),h(Nr,Ze.top,bt-Nr,Ze.bottom),Ze.bottom<Dt.top&&h(a,Ze.bottom,null,Dt.top),h(on,Dt.top,ho-on,Dt.bottom)}(!Ke||Zn(Ze,Ke)<0)&&(Ke=Ze),Zn(Dt,Ke)<0&&(Ke=Dt),(!st||Zn(Ze,st)<0)&&(st=Ze),Zn(Dt,st)<0&&(st=Dt)}),{start:Ke,end:st}}var D=t.from(),L=t.to();if(D.line==L.line)x(D.line,D.ch,L.ch);else{var H=ye(i,D.line),Z=ye(i,L.line),ie=qt(H)==qt(Z),ae=x(D.line,D.ch,ie?H.text.length+1:null).end,he=x(L.line,ie?0:null,L.ch).start;ie&&(ae.top<he.top-2?(h(ae.right,ae.top,null,ae.bottom),h(a,he.top,he.left,he.bottom)):h(ae.right,ae.top,he.left-ae.right,ae.bottom)),ae.bottom<he.top&&h(a,ae.bottom,null,he.top)}n.appendChild(o)}function Wi(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var n=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||Ur(e),t.cursorDiv.style.visibility=(n=!n)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function nl(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||_i(e))}function Hi(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&Ur(e))},100)}function _i(e,t){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),e.options.readOnly!="nocursor"&&(e.state.focused||(Ye(e,"focus",e,t),e.state.focused=!0,j(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),Y&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Wi(e))}function Ur(e,t){e.state.delayingBlurEvent||(e.state.focused&&(Ye(e,"blur",e,t),e.state.focused=!1,V(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function $n(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=Math.max(0,t.scroller.getBoundingClientRect().top),i=t.lineDiv.getBoundingClientRect().top,o=0,l=0;l<t.view.length;l++){var a=t.view[l],s=e.options.lineWrapping,u=void 0,h=0;if(!a.hidden){if(i+=a.line.height,k&&I<8){var x=a.node.offsetTop+a.node.offsetHeight;u=x-n,n=x}else{var D=a.node.getBoundingClientRect();u=D.bottom-D.top,!s&&a.text.firstChild&&(h=a.text.firstChild.getBoundingClientRect().right-D.left-1)}var L=a.line.height-u;if((L>.005||L<-.005)&&(i<r&&(o-=L),Et(a.line,u),il(a.line),a.rest))for(var H=0;H<a.rest.length;H++)il(a.rest[H]);if(h>e.display.sizerWidth){var Z=Math.ceil(h/Kr(e.display));Z>e.display.maxLineLength&&(e.display.maxLineLength=Z,e.display.maxLine=a.line,e.display.maxLineChanged=!0)}}}Math.abs(o)>2&&(t.scroller.scrollTop+=o)}function il(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var n=e.widgets[t],r=n.node.parentNode;r&&(n.height=r.offsetHeight)}}function Vn(e,t,n){var r=n&&n.top!=null?Math.max(0,n.top):e.scroller.scrollTop;r=Math.floor(r-Xn(e));var i=n&&n.bottom!=null?n.bottom:r+e.wrapper.clientHeight,o=m(t,r),l=m(t,i);if(n&&n.ensure){var a=n.ensure.from.line,s=n.ensure.to.line;a<o?(o=a,l=m(t,er(ye(t,a))+e.wrapper.clientHeight)):Math.min(s,t.lastLine())>=l&&(o=m(t,er(ye(t,s))-e.wrapper.clientHeight),l=s)}return{from:o,to:Math.max(l,o+1)}}function Rs(e,t){if(!Qe(e,"scrollCursorIntoView")){var n=e.display,r=n.sizer.getBoundingClientRect(),i=null,o=n.wrapper.ownerDocument;if(t.top+r.top<0?i=!0:t.bottom+r.top>(o.defaultView.innerHeight||o.documentElement.clientHeight)&&(i=!1),i!=null&&!O){var l=c("div","â€‹",null,`position: absolute;
                         top: `+(t.top-n.viewOffset-Xn(e.display))+`px;
                         height: `+(t.bottom-t.top+Yt(e)+n.barHeight)+`px;
                         left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(l),l.scrollIntoView(i),e.display.lineSpace.removeChild(l)}}}function Ws(e,t,n,r){r==null&&(r=0);var i;!e.options.lineWrapping&&t==n&&(n=t.sticky=="before"?B(t.line,t.ch+1,"before"):t,t=t.ch?B(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t);for(var o=0;o<5;o++){var l=!1,a=jt(e,t),s=!n||n==t?a:jt(e,n);i={left:Math.min(a.left,s.left),top:Math.min(a.top,s.top)-r,right:Math.max(a.left,s.left),bottom:Math.max(a.bottom,s.bottom)+r};var u=qi(e,i),h=e.doc.scrollTop,x=e.doc.scrollLeft;if(u.scrollTop!=null&&(xn(e,u.scrollTop),Math.abs(e.doc.scrollTop-h)>1&&(l=!0)),u.scrollLeft!=null&&(Cr(e,u.scrollLeft),Math.abs(e.doc.scrollLeft-x)>1&&(l=!0)),!l)break}return i}function Hs(e,t){var n=qi(e,t);n.scrollTop!=null&&xn(e,n.scrollTop),n.scrollLeft!=null&&Cr(e,n.scrollLeft)}function qi(e,t){var n=e.display,r=jr(e.display);t.top<0&&(t.top=0);var i=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:n.scroller.scrollTop,o=Fi(e),l={};t.bottom-t.top>o&&(t.bottom=t.top+o);var a=e.doc.height+Mi(n),s=t.top<r,u=t.bottom>a-r;if(t.top<i)l.scrollTop=s?0:t.top;else if(t.bottom>i+o){var h=Math.min(t.top,(u?a:t.bottom)-o);h!=i&&(l.scrollTop=h)}var x=e.options.fixedGutter?0:n.gutters.offsetWidth,D=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:n.scroller.scrollLeft-x,L=wr(e)-n.gutters.offsetWidth,H=t.right-t.left>L;return H&&(t.right=t.left+L),t.left<10?l.scrollLeft=0:t.left<D?l.scrollLeft=Math.max(0,t.left+x-(H?0:10)):t.right>L+D-3&&(l.scrollLeft=t.right+(H?0:10)-L),l}function ji(e,t){t!=null&&(ei(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t)}function Gr(e){ei(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function mn(e,t,n){(t!=null||n!=null)&&ei(e),t!=null&&(e.curOp.scrollLeft=t),n!=null&&(e.curOp.scrollTop=n)}function _s(e,t){ei(e),e.curOp.scrollToPos=t}function ei(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var n=Zo(e,t.from),r=Zo(e,t.to);ol(e,n,r,t.margin)}}function ol(e,t,n,r){var i=qi(e,{left:Math.min(t.left,n.left),top:Math.min(t.top,n.top)-r,right:Math.max(t.right,n.right),bottom:Math.max(t.bottom,n.bottom)+r});mn(e,i.scrollLeft,i.scrollTop)}function xn(e,t){Math.abs(e.doc.scrollTop-t)<2||(_||Ui(e,{top:t}),ll(e,t,!0),_&&Ui(e),kn(e,100))}function ll(e,t,n){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),!(e.display.scroller.scrollTop==t&&!n)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function Cr(e,t,n,r){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),!((n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r)&&(e.doc.scrollLeft=t,cl(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function yn(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+Mi(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?n:0,docHeight:r,scrollHeight:r+Yt(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var Dr=function(e,t,n){this.cm=n;var r=this.vert=c("div",[c("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=c("div",[c("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=i.tabIndex=-1,e(r),e(i),Se(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),Se(i,"scroll",function(){i.clientWidth&&t(i.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,k&&I<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Dr.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var i=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.scrollTop=0,this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=n?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(n?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+o)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(r==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:t?r:0}},Dr.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Dr.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Dr.prototype.zeroWidthHack=function(){var e=z&&!ue?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.visibility=this.vert.style.visibility="hidden",this.disableHoriz=new Ce,this.disableVert=new Ce},Dr.prototype.enableZeroWidthBar=function(e,t,n){e.style.visibility="";function r(){var i=e.getBoundingClientRect(),o=n=="vert"?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1);o!=e?e.style.visibility="hidden":t.set(1e3,r)}t.set(1e3,r)},Dr.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var bn=function(){};bn.prototype.update=function(){return{bottom:0,right:0}},bn.prototype.setScrollLeft=function(){},bn.prototype.setScrollTop=function(){},bn.prototype.clear=function(){};function Xr(e,t){t||(t=yn(e));var n=e.display.barWidth,r=e.display.barHeight;al(e,t);for(var i=0;i<4&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&$n(e),al(e,yn(e)),n=e.display.barWidth,r=e.display.barHeight}function al(e,t){var n=e.display,r=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px",n.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=r.bottom+"px",n.scrollbarFiller.style.width=r.right+"px"):n.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}var sl={native:Dr,null:bn};function ul(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&V(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new sl[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),Se(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,n){n=="horizontal"?Cr(e,t):xn(e,t)},e),e.display.scrollbars.addClass&&j(e.display.wrapper,e.display.scrollbars.addClass)}var qs=0;function Mr(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++qs,markArrays:null},ys(e.curOp)}function Fr(e){var t=e.curOp;t&&ks(t,function(n){for(var r=0;r<n.ops.length;r++)n.ops[r].cm.curOp=null;js(n)})}function js(e){for(var t=e.ops,n=0;n<t.length;n++)Ks(t[n]);for(var r=0;r<t.length;r++)Us(t[r]);for(var i=0;i<t.length;i++)Gs(t[i]);for(var o=0;o<t.length;o++)Xs(t[o]);for(var l=0;l<t.length;l++)Ys(t[l])}function Ks(e){var t=e.cm,n=t.display;Js(t),e.updateMaxLine&&Ci(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<n.viewFrom||e.scrollToPos.to.line>=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new ti(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Us(e){e.updatedDisplay=e.mustUpdate&&Ki(e.cm,e.update)}function Gs(e){var t=e.cm,n=t.display;e.updatedDisplay&&$n(t),e.barMeasure=yn(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=jo(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+Yt(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-wr(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function Xs(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&Cr(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var n=e.focus&&e.focus==y(fe(t));e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,n),(e.updatedDisplay||e.startHeight!=t.doc.height)&&Xr(t,e.barMeasure),e.updatedDisplay&&Xi(t,e.barMeasure),e.selectionChanged&&Wi(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),n&&nl(e.cm)}function Ys(e){var t=e.cm,n=t.display,r=t.doc;if(e.updatedDisplay&&fl(t,e.update),n.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(n.wheelStartX=n.wheelStartY=null),e.scrollTop!=null&&ll(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&Cr(t,e.scrollLeft,!0,!0),e.scrollToPos){var i=Ws(t,Ae(r,e.scrollToPos.from),Ae(r,e.scrollToPos.to),e.scrollToPos.margin);Rs(t,i)}var o=e.maybeHiddenMarkers,l=e.maybeUnhiddenMarkers;if(o)for(var a=0;a<o.length;++a)o[a].lines.length||Ye(o[a],"hide");if(l)for(var s=0;s<l.length;++s)l[s].lines.length&&Ye(l[s],"unhide");n.wrapper.offsetHeight&&(r.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&Ye(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function At(e,t){if(e.curOp)return t();Mr(e);try{return t()}finally{Fr(e)}}function lt(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Mr(e);try{return t.apply(e,arguments)}finally{Fr(e)}}}function yt(e){return function(){if(this.curOp)return e.apply(this,arguments);Mr(this);try{return e.apply(this,arguments)}finally{Fr(this)}}}function at(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);Mr(t);try{return e.apply(this,arguments)}finally{Fr(t)}}}function kn(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,xe(Qs,e))}function Qs(e){var t=e.doc;if(!(t.highlightFrontier>=e.display.viewTo)){var n=+new Date+e.options.workTime,r=fn(e,t.highlightFrontier),i=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),function(o){if(r.line>=e.display.viewFrom){var l=o.styles,a=o.text.length>e.options.maxHighlightLength?Gt(t.mode,r.state):null,s=mo(e,o,r,!0);a&&(r.state=a),o.styles=s.styles;var u=o.styleClasses,h=s.classes;h?o.styleClasses=h:u&&(o.styleClasses=null);for(var x=!l||l.length!=o.styles.length||u!=h&&(!u||!h||u.bgClass!=h.bgClass||u.textClass!=h.textClass),D=0;!x&&D<l.length;++D)x=l[D]!=o.styles[D];x&&i.push(r.line),o.stateAfter=r.save(),r.nextLine()}else o.text.length<=e.options.maxHighlightLength&&bi(e,o.text,r),o.stateAfter=r.line%5==0?r.save():null,r.nextLine();if(+new Date>n)return kn(e,e.options.workDelay),!0}),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),i.length&&At(e,function(){for(var o=0;o<i.length;o++)dr(e,i[o],"text")})}}var ti=function(e,t,n){var r=e.display;this.viewport=t,this.visible=Vn(r,e.doc,t),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=wr(e),this.force=n,this.dims=Ii(e),this.events=[]};ti.prototype.signal=function(e,t){Ft(e,t)&&this.events.push(arguments)},ti.prototype.finish=function(){for(var e=0;e<this.events.length;e++)Ye.apply(null,this.events[e])};function Js(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=Yt(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Yt(e)+"px",t.scrollbarsClipped=!0)}function Zs(e){if(e.hasFocus())return null;var t=y(fe(e));if(!t||!g(e.display.lineDiv,t))return null;var n={activeElt:t};if(window.getSelection){var r=le(e).getSelection();r.anchorNode&&r.extend&&g(e.display.lineDiv,r.anchorNode)&&(n.anchorNode=r.anchorNode,n.anchorOffset=r.anchorOffset,n.focusNode=r.focusNode,n.focusOffset=r.focusOffset)}return n}function $s(e){if(!(!e||!e.activeElt||e.activeElt==y(Te(e.activeElt)))&&(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&g(document.body,e.anchorNode)&&g(document.body,e.focusNode))){var t=e.activeElt.ownerDocument,n=t.defaultView.getSelection(),r=t.createRange();r.setEnd(e.anchorNode,e.anchorOffset),r.collapse(!1),n.removeAllRanges(),n.addRange(r),n.extend(e.focusNode,e.focusOffset)}}function Ki(e,t){var n=e.display,r=e.doc;if(t.editorIsHidden)return hr(e),!1;if(!t.force&&t.visible.from>=n.viewFrom&&t.visible.to<=n.viewTo&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&tl(e)==0)return!1;dl(e)&&(hr(e),t.dims=Ii(e));var i=r.first+r.size,o=Math.max(t.visible.from-e.options.viewportMargin,r.first),l=Math.min(i,t.visible.to+e.options.viewportMargin);n.viewFrom<o&&o-n.viewFrom<20&&(o=Math.max(r.first,n.viewFrom)),n.viewTo>l&&n.viewTo-l<20&&(l=Math.min(i,n.viewTo)),Vt&&(o=Li(e.doc,o),l=No(e.doc,l));var a=o!=n.viewFrom||l!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;zs(e,o,l),n.viewOffset=er(ye(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var s=tl(e);if(!a&&s==0&&!t.force&&n.renderedView==n.view&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo))return!1;var u=Zs(e);return s>4&&(n.lineDiv.style.display="none"),Vs(e,n.updateLineNumbers,t.dims),s>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,$s(u),F(n.cursorDiv),F(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,a&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,kn(e,400)),n.updateLineNumbers=null,!0}function fl(e,t){for(var n=t.viewport,r=!0;;r=!1){if(!r||!e.options.lineWrapping||t.oldDisplayWidth==wr(e)){if(n&&n.top!=null&&(n={top:Math.min(e.doc.height+Mi(e.display)-Fi(e),n.top)}),t.visible=Vn(e.display,e.doc,n),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else r&&(t.visible=Vn(e.display,e.doc,n));if(!Ki(e,t))break;$n(e);var i=yn(e);vn(e),Xr(e,i),Xi(e,i),t.force=!1}t.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function Ui(e,t){var n=new ti(e,t);if(Ki(e,n)){$n(e),fl(e,n);var r=yn(e);vn(e),Xr(e,r),Xi(e,r),n.finish()}}function Vs(e,t,n){var r=e.display,i=e.options.lineNumbers,o=r.lineDiv,l=o.firstChild;function a(H){var Z=H.nextSibling;return Y&&z&&e.display.currentWheelTarget==H?H.style.display="none":H.parentNode.removeChild(H),Z}for(var s=r.view,u=r.viewFrom,h=0;h<s.length;h++){var x=s[h];if(!x.hidden)if(!x.node||x.node.parentNode!=o){var D=Cs(e,x,u,n);o.insertBefore(D,l)}else{for(;l!=x.node;)l=a(l);var L=i&&t!=null&&t<=u&&x.lineNumber;x.changes&&(ve(x.changes,"gutter")>-1&&(L=!1),zo(e,x,u,n)),L&&(F(x.lineNumber),x.lineNumber.appendChild(document.createTextNode(re(e.options,u)))),l=x.node.nextSibling}u+=x.size}for(;l;)l=a(l)}function Gi(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px",ot(e,"gutterChanged",e)}function Xi(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+Yt(e)+"px"}function cl(e){var t=e.display,n=t.view;if(!(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))){for(var r=zi(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=r+"px",l=0;l<n.length;l++)if(!n[l].hidden){e.options.fixedGutter&&(n[l].gutter&&(n[l].gutter.style.left=o),n[l].gutterBackground&&(n[l].gutterBackground.style.left=o));var a=n[l].alignable;if(a)for(var s=0;s<a.length;s++)a[s].style.left=o}e.options.fixedGutter&&(t.gutters.style.left=r+i+"px")}}function dl(e){if(!e.options.lineNumbers)return!1;var t=e.doc,n=re(e.options,t.first+t.size-1),r=e.display;if(n.length!=r.lineNumChars){var i=r.measure.appendChild(c("div",[c("div",n)],"CodeMirror-linenumber CodeMirror-gutter-elt")),o=i.firstChild.offsetWidth,l=i.offsetWidth-o;return r.lineGutter.style.width="",r.lineNumInnerWidth=Math.max(o,r.lineGutter.offsetWidth-l)+1,r.lineNumWidth=r.lineNumInnerWidth+l,r.lineNumChars=r.lineNumInnerWidth?n.length:-1,r.lineGutter.style.width=r.lineNumWidth+"px",Gi(e.display),!0}return!1}function Yi(e,t){for(var n=[],r=!1,i=0;i<e.length;i++){var o=e[i],l=null;if(typeof o!="string"&&(l=o.style,o=o.className),o=="CodeMirror-linenumbers")if(t)r=!0;else continue;n.push({className:o,style:l})}return t&&!r&&n.push({className:"CodeMirror-linenumbers",style:null}),n}function hl(e){var t=e.gutters,n=e.gutterSpecs;F(t),e.lineGutter=null;for(var r=0;r<n.length;++r){var i=n[r],o=i.className,l=i.style,a=t.appendChild(c("div",null,"CodeMirror-gutter "+o));l&&(a.style.cssText=l),o=="CodeMirror-linenumbers"&&(e.lineGutter=a,a.style.width=(e.lineNumWidth||1)+"px")}t.style.display=n.length?"":"none",Gi(e)}function wn(e){hl(e.display),St(e),cl(e)}function eu(e,t,n,r){var i=this;this.input=n,i.scrollbarFiller=c("div",null,"CodeMirror-scrollbar-filler"),i.scrollbarFiller.setAttribute("cm-not-content","true"),i.gutterFiller=c("div",null,"CodeMirror-gutter-filler"),i.gutterFiller.setAttribute("cm-not-content","true"),i.lineDiv=T("div",null,"CodeMirror-code"),i.selectionDiv=c("div",null,null,"position: relative; z-index: 1"),i.cursorDiv=c("div",null,"CodeMirror-cursors"),i.measure=c("div",null,"CodeMirror-measure"),i.lineMeasure=c("div",null,"CodeMirror-measure"),i.lineSpace=T("div",[i.measure,i.lineMeasure,i.selectionDiv,i.cursorDiv,i.lineDiv],null,"position: relative; outline: none");var o=T("div",[i.lineSpace],"CodeMirror-lines");i.mover=c("div",[o],null,"position: relative"),i.sizer=c("div",[i.mover],"CodeMirror-sizer"),i.sizerWidth=null,i.heightForcer=c("div",null,null,"position: absolute; height: "+Oe+"px; width: 1px;"),i.gutters=c("div",null,"CodeMirror-gutters"),i.lineGutter=null,i.scroller=c("div",[i.sizer,i.heightForcer,i.gutters],"CodeMirror-scroll"),i.scroller.setAttribute("tabIndex","-1"),i.wrapper=c("div",[i.scrollbarFiller,i.gutterFiller,i.scroller],"CodeMirror"),S&&R>=105&&(i.wrapper.style.clipPath="inset(0px)"),i.wrapper.setAttribute("translate","no"),k&&I<8&&(i.gutters.style.zIndex=-1,i.scroller.style.paddingRight=0),!Y&&!(_&&N)&&(i.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(i.wrapper):e(i.wrapper)),i.viewFrom=i.viewTo=t.first,i.reportedViewFrom=i.reportedViewTo=t.first,i.view=[],i.renderedView=null,i.externalMeasured=null,i.viewOffset=0,i.lastWrapHeight=i.lastWrapWidth=0,i.updateLineNumbers=null,i.nativeBarWidth=i.barHeight=i.barWidth=0,i.scrollbarsClipped=!1,i.lineNumWidth=i.lineNumInnerWidth=i.lineNumChars=null,i.alignWidgets=!1,i.cachedCharWidth=i.cachedTextHeight=i.cachedPaddingH=null,i.maxLine=null,i.maxLineLength=0,i.maxLineChanged=!1,i.wheelDX=i.wheelDY=i.wheelStartX=i.wheelStartY=null,i.shift=!1,i.selForContextMenu=null,i.activeTouch=null,i.gutterSpecs=Yi(r.gutters,r.lineNumbers),hl(i),n.init(i)}var ri=0,rr=null;k?rr=-.53:_?rr=15:S?rr=-.7:$&&(rr=-1/3);function pl(e){var t=e.wheelDeltaX,n=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),n==null&&e.detail&&e.axis==e.VERTICAL_AXIS?n=e.detail:n==null&&(n=e.wheelDelta),{x:t,y:n}}function tu(e){var t=pl(e);return t.x*=rr,t.y*=rr,t}function gl(e,t){S&&R==102&&(e.display.chromeScrollHack==null?e.display.sizer.style.pointerEvents="none":clearTimeout(e.display.chromeScrollHack),e.display.chromeScrollHack=setTimeout(function(){e.display.chromeScrollHack=null,e.display.sizer.style.pointerEvents=""},100));var n=pl(t),r=n.x,i=n.y,o=rr;t.deltaMode===0&&(r=t.deltaX,i=t.deltaY,o=1);var l=e.display,a=l.scroller,s=a.scrollWidth>a.clientWidth,u=a.scrollHeight>a.clientHeight;if(r&&s||i&&u){if(i&&z&&Y){e:for(var h=t.target,x=l.view;h!=a;h=h.parentNode)for(var D=0;D<x.length;D++)if(x[D].node==h){e.display.currentWheelTarget=h;break e}}if(r&&!_&&!A&&o!=null){i&&u&&xn(e,Math.max(0,a.scrollTop+i*o)),Cr(e,Math.max(0,a.scrollLeft+r*o)),(!i||i&&u)&&pt(t),l.wheelStartX=null;return}if(i&&o!=null){var L=i*o,H=e.doc.scrollTop,Z=H+l.wrapper.clientHeight;L<0?H=Math.max(0,H+L-50):Z=Math.min(e.doc.height,Z+L+50),Ui(e,{top:H,bottom:Z})}ri<20&&t.deltaMode!==0&&(l.wheelStartX==null?(l.wheelStartX=a.scrollLeft,l.wheelStartY=a.scrollTop,l.wheelDX=r,l.wheelDY=i,setTimeout(function(){if(l.wheelStartX!=null){var ie=a.scrollLeft-l.wheelStartX,ae=a.scrollTop-l.wheelStartY,he=ae&&l.wheelDY&&ae/l.wheelDY||ie&&l.wheelDX&&ie/l.wheelDX;l.wheelStartX=l.wheelStartY=null,he&&(rr=(rr*ri+he)/(ri+1),++ri)}},200)):(l.wheelDX+=r,l.wheelDY+=i))}}var Ot=function(e,t){this.ranges=e,this.primIndex=t};Ot.prototype.primary=function(){return this.ranges[this.primIndex]},Ot.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var n=this.ranges[t],r=e.ranges[t];if(!We(n.anchor,r.anchor)||!We(n.head,r.head))return!1}return!0},Ot.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new He(it(this.ranges[t].anchor),it(this.ranges[t].head));return new Ot(e,this.primIndex)},Ot.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},Ot.prototype.contains=function(e,t){t||(t=e);for(var n=0;n<this.ranges.length;n++){var r=this.ranges[n];if(ce(t,r.from())>=0&&ce(e,r.to())<=0)return n}return-1};var He=function(e,t){this.anchor=e,this.head=t};He.prototype.from=function(){return Wr(this.anchor,this.head)},He.prototype.to=function(){return wt(this.anchor,this.head)},He.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Kt(e,t,n){var r=e&&e.options.selectionsMayTouch,i=t[n];t.sort(function(D,L){return ce(D.from(),L.from())}),n=ve(t,i);for(var o=1;o<t.length;o++){var l=t[o],a=t[o-1],s=ce(a.to(),l.from());if(r&&!l.empty()?s>0:s>=0){var u=Wr(a.from(),l.from()),h=wt(a.to(),l.to()),x=a.empty()?l.from()==l.head:a.from()==a.head;o<=n&&--n,t.splice(--o,2,new He(x?h:u,x?u:h))}}return new Ot(t,n)}function pr(e,t){return new Ot([new He(e,t||e)],0)}function gr(e){return e.text?B(e.from.line+e.text.length-1,we(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function vl(e,t){if(ce(e,t.from)<0)return e;if(ce(e,t.to)<=0)return gr(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=gr(t).ch-t.to.ch),B(n,r)}function Qi(e,t){for(var n=[],r=0;r<e.sel.ranges.length;r++){var i=e.sel.ranges[r];n.push(new He(vl(i.anchor,t),vl(i.head,t)))}return Kt(e.cm,n,e.sel.primIndex)}function ml(e,t,n){return e.line==t.line?B(n.line,e.ch-t.ch+n.ch):B(n.line+(e.line-t.line),e.ch)}function ru(e,t,n){for(var r=[],i=B(e.first,0),o=i,l=0;l<t.length;l++){var a=t[l],s=ml(a.from,i,o),u=ml(gr(a),i,o);if(i=a.to,o=u,n=="around"){var h=e.sel.ranges[l],x=ce(h.head,h.anchor)<0;r[l]=new He(x?u:s,x?s:u)}else r[l]=new He(s,s)}return new Ot(r,e.sel.primIndex)}function Ji(e){e.doc.mode=zr(e.options,e.doc.modeOption),Sn(e)}function Sn(e){e.doc.iter(function(t){t.stateAfter&&(t.stateAfter=null),t.styles&&(t.styles=null)}),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,kn(e,100),e.state.modeGen++,e.curOp&&St(e)}function xl(e,t){return t.from.ch==0&&t.to.ch==0&&we(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Zi(e,t,n,r){function i(he){return n?n[he]:null}function o(he,se,ge){fs(he,se,ge,r),ot(he,"change",he,t)}function l(he,se){for(var ge=[],Le=he;Le<se;++Le)ge.push(new Hr(u[Le],i(Le),r));return ge}var a=t.from,s=t.to,u=t.text,h=ye(e,a.line),x=ye(e,s.line),D=we(u),L=i(u.length-1),H=s.line-a.line;if(t.full)e.insert(0,l(0,u.length)),e.remove(u.length,e.size-u.length);else if(xl(e,t)){var Z=l(0,u.length-1);o(x,x.text,L),H&&e.remove(a.line,H),Z.length&&e.insert(a.line,Z)}else if(h==x)if(u.length==1)o(h,h.text.slice(0,a.ch)+D+h.text.slice(s.ch),L);else{var ie=l(1,u.length-1);ie.push(new Hr(D+h.text.slice(s.ch),L,r)),o(h,h.text.slice(0,a.ch)+u[0],i(0)),e.insert(a.line+1,ie)}else if(u.length==1)o(h,h.text.slice(0,a.ch)+u[0]+x.text.slice(s.ch),i(0)),e.remove(a.line+1,H);else{o(h,h.text.slice(0,a.ch)+u[0],i(0)),o(x,D+x.text.slice(s.ch),L);var ae=l(1,u.length-1);H>1&&e.remove(a.line+1,H-1),e.insert(a.line+1,ae)}ot(e,"change",e,t)}function vr(e,t,n){function r(i,o,l){if(i.linked)for(var a=0;a<i.linked.length;++a){var s=i.linked[a];if(s.doc!=o){var u=l&&s.sharedHist;n&&!u||(t(s.doc,u),r(s.doc,i,u))}}}r(e,null,!0)}function yl(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,Bi(e),Ji(e),bl(e),e.options.direction=t.direction,e.options.lineWrapping||Ci(e),e.options.mode=t.modeOption,St(e)}function bl(e){(e.doc.direction=="rtl"?j:V)(e.display.lineDiv,"CodeMirror-rtl")}function nu(e){At(e,function(){bl(e),St(e)})}function ni(e){this.done=[],this.undone=[],this.undoDepth=e?e.undoDepth:1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e?e.maxGeneration:1}function $i(e,t){var n={from:it(t.from),to:gr(t),text:$t(e,t.from,t.to)};return Sl(e,n,t.from.line,t.to.line+1),vr(e,function(r){return Sl(r,n,t.from.line,t.to.line+1)},!0),n}function kl(e){for(;e.length;){var t=we(e);if(t.ranges)e.pop();else break}}function iu(e,t){if(t)return kl(e.done),we(e.done);if(e.done.length&&!we(e.done).ranges)return we(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),we(e.done)}function wl(e,t,n,r){var i=e.history;i.undone.length=0;var o=+new Date,l,a;if((i.lastOp==r||i.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&i.lastModTime>o-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(l=iu(i,i.lastOp==r)))a=we(l.changes),ce(t.from,t.to)==0&&ce(t.from,a.to)==0?a.to=gr(t):l.changes.push($i(e,t));else{var s=we(i.done);for((!s||!s.ranges)&&ii(e.sel,i.done),l={changes:[$i(e,t)],generation:i.generation},i.done.push(l);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(n),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=o,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=t.origin,a||Ye(e,"historyAdded")}function ou(e,t,n,r){var i=t.charAt(0);return i=="*"||i=="+"&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function lu(e,t,n,r){var i=e.history,o=r&&r.origin;n==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||ou(e,o,we(i.done),t))?i.done[i.done.length-1]=t:ii(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=n,r&&r.clearRedo!==!1&&kl(i.undone)}function ii(e,t){var n=we(t);n&&n.ranges&&n.equals(e)||t.push(e)}function Sl(e,t,n,r){var i=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),function(l){l.markedSpans&&((i||(i=t["spans_"+e.id]={}))[o]=l.markedSpans),++o})}function au(e){if(!e)return null;for(var t,n=0;n<e.length;++n)e[n].marker.explicitlyCleared?t||(t=e.slice(0,n)):t&&t.push(e[n]);return t?t.length?t:null:e}function su(e,t){var n=t["spans_"+e.id];if(!n)return null;for(var r=[],i=0;i<t.text.length;++i)r.push(au(n[i]));return r}function Ll(e,t){var n=su(e,t),r=wi(e,t);if(!n)return r;if(!r)return n;for(var i=0;i<n.length;++i){var o=n[i],l=r[i];if(o&&l)e:for(var a=0;a<l.length;++a){for(var s=l[a],u=0;u<o.length;++u)if(o[u].marker==s.marker)continue e;o.push(s)}else l&&(n[i]=l)}return n}function Yr(e,t,n){for(var r=[],i=0;i<e.length;++i){var o=e[i];if(o.ranges){r.push(n?Ot.prototype.deepCopy.call(o):o);continue}var l=o.changes,a=[];r.push({changes:a});for(var s=0;s<l.length;++s){var u=l[s],h=void 0;if(a.push({from:u.from,to:u.to,text:u.text}),t)for(var x in u)(h=x.match(/^spans_(\d+)$/))&&ve(t,Number(h[1]))>-1&&(we(a)[x]=u[x],delete u[x])}}return r}function Vi(e,t,n,r){if(r){var i=e.anchor;if(n){var o=ce(t,i)<0;o!=ce(n,i)<0?(i=t,t=n):o!=ce(t,n)<0&&(t=n)}return new He(i,t)}else return new He(n||t,t)}function oi(e,t,n,r,i){i==null&&(i=e.cm&&(e.cm.display.shift||e.extend)),gt(e,new Ot([Vi(e.sel.primary(),t,n,i)],0),r)}function Tl(e,t,n){for(var r=[],i=e.cm&&(e.cm.display.shift||e.extend),o=0;o<e.sel.ranges.length;o++)r[o]=Vi(e.sel.ranges[o],t[o],null,i);var l=Kt(e.cm,r,e.sel.primIndex);gt(e,l,n)}function eo(e,t,n,r){var i=e.sel.ranges.slice(0);i[t]=n,gt(e,Kt(e.cm,i,e.sel.primIndex),r)}function Cl(e,t,n,r){gt(e,pr(t,n),r)}function uu(e,t,n){var r={ranges:t.ranges,update:function(i){this.ranges=[];for(var o=0;o<i.length;o++)this.ranges[o]=new He(Ae(e,i[o].anchor),Ae(e,i[o].head))},origin:n&&n.origin};return Ye(e,"beforeSelectionChange",e,r),e.cm&&Ye(e.cm,"beforeSelectionChange",e.cm,r),r.ranges!=t.ranges?Kt(e.cm,r.ranges,r.ranges.length-1):t}function Dl(e,t,n){var r=e.history.done,i=we(r);i&&i.ranges?(r[r.length-1]=t,li(e,t,n)):gt(e,t,n)}function gt(e,t,n){li(e,t,n),lu(e,e.sel,e.cm?e.cm.curOp.id:NaN,n)}function li(e,t,n){(Ft(e,"beforeSelectionChange")||e.cm&&Ft(e.cm,"beforeSelectionChange"))&&(t=uu(e,t,n));var r=n&&n.bias||(ce(t.primary().head,e.sel.primary().head)<0?-1:1);Ml(e,Al(e,t,r,!0)),!(n&&n.scroll===!1)&&e.cm&&e.cm.getOption("readOnly")!="nocursor"&&Gr(e.cm)}function Ml(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,It(e.cm)),ot(e,"cursorActivity",e))}function Fl(e){Ml(e,Al(e,e.sel,null,!1))}function Al(e,t,n,r){for(var i,o=0;o<t.ranges.length;o++){var l=t.ranges[o],a=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[o],s=ai(e,l.anchor,a&&a.anchor,n,r),u=l.head==l.anchor?s:ai(e,l.head,a&&a.head,n,r);(i||s!=l.anchor||u!=l.head)&&(i||(i=t.ranges.slice(0,o)),i[o]=new He(s,u))}return i?Kt(e.cm,i,t.primIndex):t}function Qr(e,t,n,r,i){var o=ye(e,t.line);if(o.markedSpans)for(var l=0;l<o.markedSpans.length;++l){var a=o.markedSpans[l],s=a.marker,u="selectLeft"in s?!s.selectLeft:s.inclusiveLeft,h="selectRight"in s?!s.selectRight:s.inclusiveRight;if((a.from==null||(u?a.from<=t.ch:a.from<t.ch))&&(a.to==null||(h?a.to>=t.ch:a.to>t.ch))){if(i&&(Ye(s,"beforeCursorEnter"),s.explicitlyCleared))if(o.markedSpans){--l;continue}else break;if(!s.atomic)continue;if(n){var x=s.find(r<0?1:-1),D=void 0;if((r<0?h:u)&&(x=Nl(e,x,-r,x&&x.line==t.line?o:null)),x&&x.line==t.line&&(D=ce(x,n))&&(r<0?D<0:D>0))return Qr(e,x,t,r,i)}var L=s.find(r<0?-1:1);return(r<0?u:h)&&(L=Nl(e,L,r,L.line==t.line?o:null)),L?Qr(e,L,t,r,i):null}}return t}function ai(e,t,n,r,i){var o=r||1,l=Qr(e,t,n,o,i)||!i&&Qr(e,t,n,o,!0)||Qr(e,t,n,-o,i)||!i&&Qr(e,t,n,-o,!0);return l||(e.cantEdit=!0,B(e.first,0))}function Nl(e,t,n,r){return n<0&&t.ch==0?t.line>e.first?Ae(e,B(t.line-1)):null:n>0&&t.ch==(r||ye(e,t.line)).text.length?t.line<e.first+e.size-1?B(t.line+1,0):null:new B(t.line,t.ch+n)}function El(e){e.setSelection(B(e.firstLine(),0),B(e.lastLine()),$e)}function Ol(e,t,n){var r={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return r.canceled=!0}};return n&&(r.update=function(i,o,l,a){i&&(r.from=Ae(e,i)),o&&(r.to=Ae(e,o)),l&&(r.text=l),a!==void 0&&(r.origin=a)}),Ye(e,"beforeChange",e,r),e.cm&&Ye(e.cm,"beforeChange",e.cm,r),r.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:r.from,to:r.to,text:r.text,origin:r.origin}}function Jr(e,t,n){if(e.cm){if(!e.cm.curOp)return lt(e.cm,Jr)(e,t,n);if(e.cm.state.suppressEdits)return}if(!((Ft(e,"beforeChange")||e.cm&&Ft(e.cm,"beforeChange"))&&(t=Ol(e,t,!0),!t))){var r=Lo&&!n&&ls(e,t.from,t.to);if(r)for(var i=r.length-1;i>=0;--i)Pl(e,{from:r[i].from,to:r[i].to,text:i?[""]:t.text,origin:t.origin});else Pl(e,t)}}function Pl(e,t){if(!(t.text.length==1&&t.text[0]==""&&ce(t.from,t.to)==0)){var n=Qi(e,t);wl(e,t,n,e.cm?e.cm.curOp.id:NaN),Ln(e,t,n,wi(e,t));var r=[];vr(e,function(i,o){!o&&ve(r,i.history)==-1&&(Rl(i.history,t),r.push(i.history)),Ln(i,t,null,wi(i,t))})}}function si(e,t,n){var r=e.cm&&e.cm.state.suppressEdits;if(!(r&&!n)){for(var i=e.history,o,l=e.sel,a=t=="undo"?i.done:i.undone,s=t=="undo"?i.undone:i.done,u=0;u<a.length&&(o=a[u],!(n?o.ranges&&!o.equals(e.sel):!o.ranges));u++);if(u!=a.length){for(i.lastOrigin=i.lastSelOrigin=null;;)if(o=a.pop(),o.ranges){if(ii(o,s),n&&!o.equals(e.sel)){gt(e,o,{clearRedo:!1});return}l=o}else if(r){a.push(o);return}else break;var h=[];ii(l,s),s.push({changes:h,generation:i.generation}),i.generation=o.generation||++i.maxGeneration;for(var x=Ft(e,"beforeChange")||e.cm&&Ft(e.cm,"beforeChange"),D=function(Z){var ie=o.changes[Z];if(ie.origin=t,x&&!Ol(e,ie,!1))return a.length=0,{};h.push($i(e,ie));var ae=Z?Qi(e,ie):we(a);Ln(e,ie,ae,Ll(e,ie)),!Z&&e.cm&&e.cm.scrollIntoView({from:ie.from,to:gr(ie)});var he=[];vr(e,function(se,ge){!ge&&ve(he,se.history)==-1&&(Rl(se.history,ie),he.push(se.history)),Ln(se,ie,null,Ll(se,ie))})},L=o.changes.length-1;L>=0;--L){var H=D(L);if(H)return H.v}}}}function Il(e,t){if(t!=0&&(e.first+=t,e.sel=new Ot(Ie(e.sel.ranges,function(i){return new He(B(i.anchor.line+t,i.anchor.ch),B(i.head.line+t,i.head.ch))}),e.sel.primIndex),e.cm)){St(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;r<n.viewTo;r++)dr(e.cm,r,"gutter")}}function Ln(e,t,n,r){if(e.cm&&!e.cm.curOp)return lt(e.cm,Ln)(e,t,n,r);if(t.to.line<e.first){Il(e,t.text.length-1-(t.to.line-t.from.line));return}if(!(t.from.line>e.lastLine())){if(t.from.line<e.first){var i=t.text.length-1-(e.first-t.from.line);Il(e,i),t={from:B(e.first,0),to:B(t.to.line+i,t.to.ch),text:[we(t.text)],origin:t.origin}}var o=e.lastLine();t.to.line>o&&(t={from:t.from,to:B(o,ye(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=$t(e,t.from,t.to),n||(n=Qi(e,t)),e.cm?fu(e.cm,t,r):Zi(e,t,r),li(e,n,$e),e.cantEdit&&ai(e,B(e.firstLine(),0))&&(e.cantEdit=!1)}}function fu(e,t,n){var r=e.doc,i=e.display,o=t.from,l=t.to,a=!1,s=o.line;e.options.lineWrapping||(s=f(qt(ye(r,o.line))),r.iter(s,l.line+1,function(L){if(L==i.maxLine)return a=!0,!0})),r.sel.contains(t.from,t.to)>-1&&It(e),Zi(r,t,n,el(e)),e.options.lineWrapping||(r.iter(s,o.line+t.text.length,function(L){var H=Un(L);H>i.maxLineLength&&(i.maxLine=L,i.maxLineLength=H,i.maxLineChanged=!0,a=!1)}),a&&(e.curOp.updateMaxLine=!0)),Va(r,o.line),kn(e,400);var u=t.text.length-(l.line-o.line)-1;t.full?St(e):o.line==l.line&&t.text.length==1&&!xl(e.doc,t)?dr(e,o.line,"text"):St(e,o.line,l.line+1,u);var h=Ft(e,"changes"),x=Ft(e,"change");if(x||h){var D={from:o,to:l,text:t.text,removed:t.removed,origin:t.origin};x&&ot(e,"change",e,D),h&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(D)}e.display.selForContextMenu=null}function Zr(e,t,n,r,i){var o;r||(r=n),ce(r,n)<0&&(o=[r,n],n=o[0],r=o[1]),typeof t=="string"&&(t=e.splitLines(t)),Jr(e,{from:n,to:r,text:t,origin:i})}function zl(e,t,n,r){n<e.line?e.line+=r:t<e.line&&(e.line=t,e.ch=0)}function Bl(e,t,n,r){for(var i=0;i<e.length;++i){var o=e[i],l=!0;if(o.ranges){o.copied||(o=e[i]=o.deepCopy(),o.copied=!0);for(var a=0;a<o.ranges.length;a++)zl(o.ranges[a].anchor,t,n,r),zl(o.ranges[a].head,t,n,r);continue}for(var s=0;s<o.changes.length;++s){var u=o.changes[s];if(n<u.from.line)u.from=B(u.from.line+r,u.from.ch),u.to=B(u.to.line+r,u.to.ch);else if(t<=u.to.line){l=!1;break}}l||(e.splice(0,i+1),i=0)}}function Rl(e,t){var n=t.from.line,r=t.to.line,i=t.text.length-(r-n)-1;Bl(e.done,n,r,i),Bl(e.undone,n,r,i)}function Tn(e,t,n,r){var i=t,o=t;return typeof t=="number"?o=ye(e,go(e,t)):i=f(t),i==null?null:(r(o,i)&&e.cm&&dr(e.cm,i,n),o)}function Cn(e){this.lines=e,this.parent=null;for(var t=0,n=0;n<e.length;++n)e[n].parent=this,t+=e[n].height;this.height=t}Cn.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var n=e,r=e+t;n<r;++n){var i=this.lines[n];this.height-=i.height,cs(i),ot(i,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,n){this.height+=n,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var r=0;r<t.length;++r)t[r].parent=this},iterN:function(e,t,n){for(var r=e+t;e<r;++e)if(n(this.lines[e]))return!0}};function Dn(e){this.children=e;for(var t=0,n=0,r=0;r<e.length;++r){var i=e[r];t+=i.chunkSize(),n+=i.height,i.parent=this}this.size=t,this.height=n,this.parent=null}Dn.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var n=0;n<this.children.length;++n){var r=this.children[n],i=r.chunkSize();if(e<i){var o=Math.min(t,i-e),l=r.height;if(r.removeInner(e,o),this.height-=l-r.height,i==o&&(this.children.splice(n--,1),r.parent=null),(t-=o)==0)break;e=0}else e-=i}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof Cn))){var a=[];this.collapse(a),this.children=[new Cn(a)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,n){this.size+=t.length,this.height+=n;for(var r=0;r<this.children.length;++r){var i=this.children[r],o=i.chunkSize();if(e<=o){if(i.insertInner(e,t,n),i.lines&&i.lines.length>50){for(var l=i.lines.length%25+25,a=l;a<i.lines.length;){var s=new Cn(i.lines.slice(a,a+=25));i.height-=s.height,this.children.splice(++r,0,s),s.parent=this}i.lines=i.lines.slice(0,l),this.maybeSpill()}break}e-=o}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=e.children.splice(e.children.length-5,5),n=new Dn(t);if(e.parent){e.size-=n.size,e.height-=n.height;var i=ve(e.parent.children,e);e.parent.children.splice(i+1,0,n)}else{var r=new Dn(e.children);r.parent=e,e.children=[r,n],e=r}n.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var r=0;r<this.children.length;++r){var i=this.children[r],o=i.chunkSize();if(e<o){var l=Math.min(t,o-e);if(i.iterN(e,l,n))return!0;if((t-=l)==0)break;e=0}else e-=o}}};var Mn=function(e,t,n){if(n)for(var r in n)n.hasOwnProperty(r)&&(this[r]=n[r]);this.doc=e,this.node=t};Mn.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,n=this.line,r=f(n);if(!(r==null||!t)){for(var i=0;i<t.length;++i)t[i]==this&&t.splice(i--,1);t.length||(n.widgets=null);var o=pn(this);Et(n,Math.max(0,n.height-o)),e&&(At(e,function(){Wl(e,n,-o),dr(e,r,"widget")}),ot(e,"lineWidgetCleared",e,this,r))}},Mn.prototype.changed=function(){var e=this,t=this.height,n=this.doc.cm,r=this.line;this.height=null;var i=pn(this)-t;i&&(cr(this.doc,r)||Et(r,r.height+i),n&&At(n,function(){n.curOp.forceUpdate=!0,Wl(n,r,i),ot(n,"lineWidgetChanged",n,e,f(r))}))},Bt(Mn);function Wl(e,t,n){er(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&ji(e,n)}function cu(e,t,n,r){var i=new Mn(e,n,r),o=e.cm;return o&&i.noHScroll&&(o.display.alignWidgets=!0),Tn(e,t,"widget",function(l){var a=l.widgets||(l.widgets=[]);if(i.insertAt==null?a.push(i):a.splice(Math.min(a.length,Math.max(0,i.insertAt)),0,i),i.line=l,o&&!cr(e,l)){var s=er(l)<e.scrollTop;Et(l,l.height+pn(i)),s&&ji(o,i.height),o.curOp.forceUpdate=!0}return!0}),o&&ot(o,"lineWidgetAdded",o,i,typeof t=="number"?t:f(t)),i}var Hl=0,mr=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++Hl};mr.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&Mr(e),Ft(this,"clear")){var n=this.find();n&&ot(this,"clear",n.from,n.to)}for(var r=null,i=null,o=0;o<this.lines.length;++o){var l=this.lines[o],a=cn(l.markedSpans,this);e&&!this.collapsed?dr(e,f(l),"text"):e&&(a.to!=null&&(i=f(l)),a.from!=null&&(r=f(l))),l.markedSpans=rs(l.markedSpans,a),a.from==null&&this.collapsed&&!cr(this.doc,l)&&e&&Et(l,jr(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var s=0;s<this.lines.length;++s){var u=qt(this.lines[s]),h=Un(u);h>e.display.maxLineLength&&(e.display.maxLine=u,e.display.maxLineLength=h,e.display.maxLineChanged=!0)}r!=null&&e&&this.collapsed&&St(e,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Fl(e.doc)),e&&ot(e,"markerCleared",e,this,r,i),t&&Fr(e),this.parent&&this.parent.clear()}},mr.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var n,r,i=0;i<this.lines.length;++i){var o=this.lines[i],l=cn(o.markedSpans,this);if(l.from!=null&&(n=B(t?o:f(o),l.from),e==-1))return n;if(l.to!=null&&(r=B(t?o:f(o),l.to),e==1))return r}return n&&{from:n,to:r}},mr.prototype.changed=function(){var e=this,t=this.find(-1,!0),n=this,r=this.doc.cm;!t||!r||At(r,function(){var i=t.line,o=f(t.line),l=Ai(r,o);if(l&&(Go(l),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,!cr(n.doc,i)&&n.height!=null){var a=n.height;n.height=null;var s=pn(n)-a;s&&Et(i,i.height+s)}ot(r,"markerChanged",r,e)})},mr.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||ve(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},mr.prototype.detachLine=function(e){if(this.lines.splice(ve(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},Bt(mr);function $r(e,t,n,r,i){if(r&&r.shared)return du(e,t,n,r,i);if(e.cm&&!e.cm.curOp)return lt(e.cm,$r)(e,t,n,r,i);var o=new mr(e,i),l=ce(t,n);if(r&&Me(r,o,!1),l>0||l==0&&o.clearWhenEmpty!==!1)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=T("span",[o.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(Ao(e,t.line,t,n,o)||t.line!=n.line&&Ao(e,n.line,t,n,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");ts()}o.addToHistory&&wl(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var a=t.line,s=e.cm,u;if(e.iter(a,n.line+1,function(x){s&&o.collapsed&&!s.options.lineWrapping&&qt(x)==s.display.maxLine&&(u=!0),o.collapsed&&a!=t.line&&Et(x,0),ns(x,new _n(o,a==t.line?t.ch:null,a==n.line?n.ch:null),e.cm&&e.cm.curOp),++a}),o.collapsed&&e.iter(t.line,n.line+1,function(x){cr(e,x)&&Et(x,0)}),o.clearOnEnter&&Se(o,"beforeCursorEnter",function(){return o.clear()}),o.readOnly&&(es(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++Hl,o.atomic=!0),s){if(u&&(s.curOp.updateMaxLine=!0),o.collapsed)St(s,t.line,n.line+1);else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(var h=t.line;h<=n.line;h++)dr(s,h,"text");o.atomic&&Fl(s.doc),ot(s,"markerAdded",s,o)}return o}var Fn=function(e,t){this.markers=e,this.primary=t;for(var n=0;n<e.length;++n)e[n].parent=this};Fn.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();ot(this,"clear")}},Fn.prototype.find=function(e,t){return this.primary.find(e,t)},Bt(Fn);function du(e,t,n,r,i){r=Me(r),r.shared=!1;var o=[$r(e,t,n,r,i)],l=o[0],a=r.widgetNode;return vr(e,function(s){a&&(r.widgetNode=a.cloneNode(!0)),o.push($r(s,Ae(s,t),Ae(s,n),r,i));for(var u=0;u<s.linked.length;++u)if(s.linked[u].isParent)return;l=we(o)}),new Fn(o,l)}function _l(e){return e.findMarks(B(e.first,0),e.clipPos(B(e.lastLine())),function(t){return t.parent})}function hu(e,t){for(var n=0;n<t.length;n++){var r=t[n],i=r.find(),o=e.clipPos(i.from),l=e.clipPos(i.to);if(ce(o,l)){var a=$r(e,o,l,r.primary,r.primary.type);r.markers.push(a),a.parent=r}}}function pu(e){for(var t=function(r){var i=e[r],o=[i.primary.doc];vr(i.primary.doc,function(s){return o.push(s)});for(var l=0;l<i.markers.length;l++){var a=i.markers[l];ve(o,a.doc)==-1&&(a.parent=null,i.markers.splice(l--,1))}},n=0;n<e.length;n++)t(n)}var gu=0,Lt=function(e,t,n,r,i){if(!(this instanceof Lt))return new Lt(e,t,n,r,i);n==null&&(n=0),Dn.call(this,[new Cn([new Hr("",null)])]),this.first=n,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=n;var o=B(n,0);this.sel=pr(o),this.history=new ni(null),this.id=++gu,this.modeOption=t,this.lineSep=r,this.direction=i=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),Zi(this,{from:o,to:o,text:e}),gt(this,pr(o),$e)};Lt.prototype=K(Dn.prototype,{constructor:Lt,iter:function(e,t,n){n?this.iterN(e-this.first,t-e,n):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var n=0,r=0;r<t.length;++r)n+=t[r].height;this.insertInner(e-this.first,t,n)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=un(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:at(function(e){var t=B(this.first,0),n=this.first+this.size-1;Jr(this,{from:t,to:B(n,ye(this,n).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&mn(this.cm,0,0),gt(this,pr(t),$e)}),replaceRange:function(e,t,n,r){t=Ae(this,t),n=n?Ae(this,n):t,Zr(this,e,t,n,r)},getRange:function(e,t,n){var r=$t(this,Ae(this,e),Ae(this,t));return n===!1?r:n===""?r.join(""):r.join(n||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(U(this,e))return ye(this,e)},getLineNumber:function(e){return f(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=ye(this,e)),qt(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return Ae(this,e)},getCursor:function(e){var t=this.sel.primary(),n;return e==null||e=="head"?n=t.head:e=="anchor"?n=t.anchor:e=="end"||e=="to"||e===!1?n=t.to():n=t.from(),n},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:at(function(e,t,n){Cl(this,Ae(this,typeof e=="number"?B(e,t||0):e),null,n)}),setSelection:at(function(e,t,n){Cl(this,Ae(this,e),Ae(this,t||e),n)}),extendSelection:at(function(e,t,n){oi(this,Ae(this,e),t&&Ae(this,t),n)}),extendSelections:at(function(e,t){Tl(this,vo(this,e),t)}),extendSelectionsBy:at(function(e,t){var n=Ie(this.sel.ranges,e);Tl(this,vo(this,n),t)}),setSelections:at(function(e,t,n){if(e.length){for(var r=[],i=0;i<e.length;i++)r[i]=new He(Ae(this,e[i].anchor),Ae(this,e[i].head||e[i].anchor));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),gt(this,Kt(this.cm,r,t),n)}}),addSelection:at(function(e,t,n){var r=this.sel.ranges.slice(0);r.push(new He(Ae(this,e),Ae(this,t||e))),gt(this,Kt(this.cm,r,r.length-1),n)}),getSelection:function(e){for(var t=this.sel.ranges,n,r=0;r<t.length;r++){var i=$t(this,t[r].from(),t[r].to());n=n?n.concat(i):i}return e===!1?n:n.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],n=this.sel.ranges,r=0;r<n.length;r++){var i=$t(this,n[r].from(),n[r].to());e!==!1&&(i=i.join(e||this.lineSeparator())),t[r]=i}return t},replaceSelection:function(e,t,n){for(var r=[],i=0;i<this.sel.ranges.length;i++)r[i]=e;this.replaceSelections(r,t,n||"+input")},replaceSelections:at(function(e,t,n){for(var r=[],i=this.sel,o=0;o<i.ranges.length;o++){var l=i.ranges[o];r[o]={from:l.from(),to:l.to(),text:this.splitLines(e[o]),origin:n}}for(var a=t&&t!="end"&&ru(this,r,t),s=r.length-1;s>=0;s--)Jr(this,r[s]);a?Dl(this,a):this.cm&&Gr(this.cm)}),undo:at(function(){si(this,"undo")}),redo:at(function(){si(this,"redo")}),undoSelection:at(function(){si(this,"undo",!0)}),redoSelection:at(function(){si(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,r=0;r<e.done.length;r++)e.done[r].ranges||++t;for(var i=0;i<e.undone.length;i++)e.undone[i].ranges||++n;return{undo:t,redo:n}},clearHistory:function(){var e=this;this.history=new ni(this.history),vr(this,function(t){return t.history=e.history},!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:Yr(this.history.done),undone:Yr(this.history.undone)}},setHistory:function(e){var t=this.history=new ni(this.history);t.done=Yr(e.done.slice(0),null,!0),t.undone=Yr(e.undone.slice(0),null,!0)},setGutterMarker:at(function(e,t,n){return Tn(this,e,"gutter",function(r){var i=r.gutterMarkers||(r.gutterMarkers={});return i[t]=n,!n&&be(i)&&(r.gutterMarkers=null),!0})}),clearGutter:at(function(e){var t=this;this.iter(function(n){n.gutterMarkers&&n.gutterMarkers[e]&&Tn(t,n,"gutter",function(){return n.gutterMarkers[e]=null,be(n.gutterMarkers)&&(n.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!U(this,e)||(t=e,e=ye(this,e),!e))return null}else if(t=f(e),t==null)return null;return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:at(function(e,t,n){return Tn(this,e,t=="gutter"?"gutter":"class",function(r){var i=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!r[i])r[i]=n;else{if(P(n).test(r[i]))return!1;r[i]+=" "+n}return!0})}),removeLineClass:at(function(e,t,n){return Tn(this,e,t=="gutter"?"gutter":"class",function(r){var i=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",o=r[i];if(o)if(n==null)r[i]=null;else{var l=o.match(P(n));if(!l)return!1;var a=l.index+l[0].length;r[i]=o.slice(0,l.index)+(!l.index||a==o.length?"":" ")+o.slice(a)||null}else return!1;return!0})}),addLineWidget:at(function(e,t,n){return cu(this,e,t,n)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,n){return $r(this,Ae(this,e),Ae(this,t),n,n&&n.type||"range")},setBookmark:function(e,t){var n={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=Ae(this,e),$r(this,e,e,n,"bookmark")},findMarksAt:function(e){e=Ae(this,e);var t=[],n=ye(this,e.line).markedSpans;if(n)for(var r=0;r<n.length;++r){var i=n[r];(i.from==null||i.from<=e.ch)&&(i.to==null||i.to>=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,n){e=Ae(this,e),t=Ae(this,t);var r=[],i=e.line;return this.iter(e.line,t.line+1,function(o){var l=o.markedSpans;if(l)for(var a=0;a<l.length;a++){var s=l[a];!(s.to!=null&&i==e.line&&e.ch>=s.to||s.from==null&&i!=e.line||s.from!=null&&i==t.line&&s.from>=t.ch)&&(!n||n(s.marker))&&r.push(s.marker.parent||s.marker)}++i}),r},getAllMarks:function(){var e=[];return this.iter(function(t){var n=t.markedSpans;if(n)for(var r=0;r<n.length;++r)n[r].from!=null&&e.push(n[r].marker)}),e},posFromIndex:function(e){var t,n=this.first,r=this.lineSeparator().length;return this.iter(function(i){var o=i.text.length+r;if(o>e)return t=e,!0;e-=o,++n}),Ae(this,B(n,t))},indexFromPos:function(e){e=Ae(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var n=this.lineSeparator().length;return this.iter(this.first,e.line,function(r){t+=r.text.length+n}),t},copy:function(e){var t=new Lt(un(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,n=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<n&&(n=e.to);var r=new Lt(un(this,t,n),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(r.history=this.history),(this.linked||(this.linked=[])).push({doc:r,sharedHist:e.sharedHist}),r.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],hu(r,_l(this)),r},unlinkDoc:function(e){if(e instanceof Ge&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var n=this.linked[t];if(n.doc==e){this.linked.splice(t,1),e.unlinkDoc(this),pu(_l(this));break}}if(e.history==this.history){var r=[e.id];vr(e,function(i){return r.push(i.id)},!0),e.history=new ni(null),e.history.done=Yr(this.history.done,r),e.history.undone=Yr(this.history.undone,r)}},iterLinkedDocs:function(e){vr(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):zt(e)},lineSeparator:function(){return this.lineSep||`
`},setDirection:at(function(e){e!="rtl"&&(e="ltr"),e!=this.direction&&(this.direction=e,this.iter(function(t){return t.order=null}),this.cm&&nu(this.cm))})}),Lt.prototype.eachLine=Lt.prototype.iter;var ql=0;function vu(e){var t=this;if(jl(t),!(Qe(t,e)||tr(t.display,e))){pt(e),k&&(ql=+new Date);var n=Lr(t,e,!0),r=e.dataTransfer.files;if(!(!n||t.isReadOnly()))if(r&&r.length&&window.FileReader&&window.File)for(var i=r.length,o=Array(i),l=0,a=function(){++l==i&&lt(t,function(){n=Ae(t.doc,n);var L={from:n,to:n,text:t.doc.splitLines(o.filter(function(H){return H!=null}).join(t.doc.lineSeparator())),origin:"paste"};Jr(t.doc,L),Dl(t.doc,pr(Ae(t.doc,n),Ae(t.doc,gr(L))))})()},s=function(L,H){if(t.options.allowDropFileTypes&&ve(t.options.allowDropFileTypes,L.type)==-1){a();return}var Z=new FileReader;Z.onerror=function(){return a()},Z.onload=function(){var ie=Z.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(ie)){a();return}o[H]=ie,a()},Z.readAsText(L)},u=0;u<r.length;u++)s(r[u],u);else{if(t.state.draggingText&&t.doc.sel.contains(n)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var h=e.dataTransfer.getData("Text");if(h){var x;if(t.state.draggingText&&!t.state.draggingText.copy&&(x=t.listSelections()),li(t.doc,pr(n,n)),x)for(var D=0;D<x.length;++D)Zr(t.doc,"",x[D].anchor,x[D].head,"drag");t.replaceSelection(h,"around","paste"),t.display.input.focus()}}catch{}}}}function mu(e,t){if(k&&(!e.state.draggingText||+new Date-ql<100)){ar(t);return}if(!(Qe(e,t)||tr(e.display,t))&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!$)){var n=c("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",A&&(n.width=n.height=1,e.display.wrapper.appendChild(n),n._top=n.offsetTop),t.dataTransfer.setDragImage(n,0,0),A&&n.parentNode.removeChild(n)}}function xu(e,t){var n=Lr(e,t);if(n){var r=document.createDocumentFragment();Ri(e,n,r),e.display.dragCursor||(e.display.dragCursor=c("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),G(e.display.dragCursor,r)}}function jl(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Kl(e){if(document.getElementsByClassName){for(var t=document.getElementsByClassName("CodeMirror"),n=[],r=0;r<t.length;r++){var i=t[r].CodeMirror;i&&n.push(i)}n.length&&n[0].operation(function(){for(var o=0;o<n.length;o++)e(n[o])})}}var Ul=!1;function yu(){Ul||(bu(),Ul=!0)}function bu(){var e;Se(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,Kl(ku)},100))}),Se(window,"blur",function(){return Kl(Ur)})}function ku(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var xr={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},An=0;An<10;An++)xr[An+48]=xr[An+96]=String(An);for(var ui=65;ui<=90;ui++)xr[ui]=String.fromCharCode(ui);for(var Nn=1;Nn<=12;Nn++)xr[Nn+111]=xr[Nn+63235]="F"+Nn;var nr={};nr.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},nr.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},nr.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},nr.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},nr.default=z?nr.macDefault:nr.pcDefault;function wu(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var n,r,i,o,l=0;l<t.length-1;l++){var a=t[l];if(/^(cmd|meta|m)$/i.test(a))o=!0;else if(/^a(lt)?$/i.test(a))n=!0;else if(/^(c|ctrl|control)$/i.test(a))r=!0;else if(/^s(hift)?$/i.test(a))i=!0;else throw new Error("Unrecognized modifier name: "+a)}return n&&(e="Alt-"+e),r&&(e="Ctrl-"+e),o&&(e="Cmd-"+e),i&&(e="Shift-"+e),e}function Su(e){var t={};for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];if(/^(name|fallthrough|(de|at)tach)$/.test(n))continue;if(r=="..."){delete e[n];continue}for(var i=Ie(n.split(" "),wu),o=0;o<i.length;o++){var l=void 0,a=void 0;o==i.length-1?(a=i.join(" "),l=r):(a=i.slice(0,o+1).join(" "),l="...");var s=t[a];if(!s)t[a]=l;else if(s!=l)throw new Error("Inconsistent bindings for "+a)}delete e[n]}for(var u in t)e[u]=t[u];return e}function Vr(e,t,n,r){t=fi(t);var i=t.call?t.call(e,r):t[e];if(i===!1)return"nothing";if(i==="...")return"multi";if(i!=null&&n(i))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return Vr(e,t.fallthrough,n,r);for(var o=0;o<t.fallthrough.length;o++){var l=Vr(e,t.fallthrough[o],n,r);if(l)return l}}}function Gl(e){var t=typeof e=="string"?e:xr[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function Xl(e,t,n){var r=e;return t.altKey&&r!="Alt"&&(e="Alt-"+e),(W?t.metaKey:t.ctrlKey)&&r!="Ctrl"&&(e="Ctrl-"+e),(W?t.ctrlKey:t.metaKey)&&r!="Mod"&&(e="Cmd-"+e),!n&&t.shiftKey&&r!="Shift"&&(e="Shift-"+e),e}function Yl(e,t){if(A&&e.keyCode==34&&e.char)return!1;var n=xr[e.keyCode];return n==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(n=e.code),Xl(n,e,t))}function fi(e){return typeof e=="string"?nr[e]:e}function en(e,t){for(var n=e.doc.sel.ranges,r=[],i=0;i<n.length;i++){for(var o=t(n[i]);r.length&&ce(o.from,we(r).to)<=0;){var l=r.pop();if(ce(l.from,o.from)<0){o.from=l.from;break}}r.push(o)}At(e,function(){for(var a=r.length-1;a>=0;a--)Zr(e.doc,"",r[a].from,r[a].to,"+delete");Gr(e)})}function to(e,t,n){var r=Mt(e.text,t+n,n);return r<0||r>e.text.length?null:r}function ro(e,t,n){var r=to(e,t.ch,n);return r==null?null:new B(t.line,r,n<0?"after":"before")}function no(e,t,n,r,i){if(e){t.doc.direction=="rtl"&&(i=-i);var o=Re(n,t.doc.direction);if(o){var l=i<0?we(o):o[0],a=i<0==(l.level==1),s=a?"after":"before",u;if(l.level>0||t.doc.direction=="rtl"){var h=qr(t,n);u=i<0?n.text.length-1:0;var x=Qt(t,h,u).top;u=Pt(function(D){return Qt(t,h,D).top==x},i<0==(l.level==1)?l.from:l.to-1,u),s=="before"&&(u=to(n,u,1))}else u=i<0?l.to:l.from;return new B(r,u,s)}}return new B(r,i<0?n.text.length:0,i<0?"before":"after")}function Lu(e,t,n,r){var i=Re(t,e.doc.direction);if(!i)return ro(t,n,r);n.ch>=t.text.length?(n.ch=t.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var o=lr(i,n.ch,n.sticky),l=i[o];if(e.doc.direction=="ltr"&&l.level%2==0&&(r>0?l.to>n.ch:l.from<n.ch))return ro(t,n,r);var a=function(ae,he){return to(t,ae instanceof B?ae.ch:ae,he)},s,u=function(ae){return e.options.lineWrapping?(s=s||qr(e,t),Vo(e,t,s,ae)):{begin:0,end:t.text.length}},h=u(n.sticky=="before"?a(n,-1):n.ch);if(e.doc.direction=="rtl"||l.level==1){var x=l.level==1==r<0,D=a(n,x?1:-1);if(D!=null&&(x?D<=l.to&&D<=h.end:D>=l.from&&D>=h.begin)){var L=x?"before":"after";return new B(n.line,D,L)}}var H=function(ae,he,se){for(var ge=function(Ke,st){return st?new B(n.line,a(Ke,1),"before"):new B(n.line,Ke,"after")};ae>=0&&ae<i.length;ae+=he){var Le=i[ae],ke=he>0==(Le.level!=1),Ee=ke?se.begin:a(se.end,-1);if(Le.from<=Ee&&Ee<Le.to||(Ee=ke?Le.from:a(Le.to,-1),se.begin<=Ee&&Ee<se.end))return ge(Ee,ke)}},Z=H(o+r,r,h);if(Z)return Z;var ie=r>0?h.end:a(h.begin,-1);return ie!=null&&!(r>0&&ie==t.text.length)&&(Z=H(r>0?0:i.length-1,r,u(ie)),Z)?Z:null}var En={selectAll:El,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),$e)},killLine:function(e){return en(e,function(t){if(t.empty()){var n=ye(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line<e.lastLine()?{from:t.head,to:B(t.head.line+1,0)}:{from:t.head,to:B(t.head.line,n)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return en(e,function(t){return{from:B(t.from().line,0),to:Ae(e.doc,B(t.to().line+1,0))}})},delLineLeft:function(e){return en(e,function(t){return{from:B(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return en(e,function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:n},"div");return{from:r,to:t.from()}})},delWrappedLineRight:function(e){return en(e,function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div");return{from:t.from(),to:r}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(B(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(B(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return Ql(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return Jl(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return Tu(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var n=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div")},Pe)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var n=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:n},"div")},Pe)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var n=e.cursorCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:n},"div");return r.ch<e.getLine(r.line).search(/\S/)?Jl(e,t.head):r},Pe)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"codepoint")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection("	")},insertSoftTab:function(e){for(var t=[],n=e.listSelections(),r=e.options.tabSize,i=0;i<n.length;i++){var o=n[i].from(),l=Fe(e.getLine(o.line),o.ch,r);t.push(et(r-l%r))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return At(e,function(){for(var t=e.listSelections(),n=[],r=0;r<t.length;r++)if(t[r].empty()){var i=t[r].head,o=ye(e.doc,i.line).text;if(o){if(i.ch==o.length&&(i=new B(i.line,i.ch-1)),i.ch>0)i=new B(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),B(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var l=ye(e.doc,i.line-1).text;l&&(i=new B(i.line,1),e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+l.charAt(l.length-1),B(i.line-1,l.length-1),i,"+transpose"))}}n.push(new He(i,i))}e.setSelections(n)})},newlineAndIndent:function(e){return At(e,function(){for(var t=e.listSelections(),n=t.length-1;n>=0;n--)e.replaceRange(e.doc.lineSeparator(),t[n].anchor,t[n].head,"+input");t=e.listSelections();for(var r=0;r<t.length;r++)e.indentLine(t[r].from().line,null,!0);Gr(e)})},openLine:function(e){return e.replaceSelection(`
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function Ql(e,t){var n=ye(e.doc,t),r=qt(n);return r!=n&&(t=f(r)),no(!0,e,r,t,1)}function Tu(e,t){var n=ye(e.doc,t),r=ss(n);return r!=n&&(t=f(r)),no(!0,e,n,t,-1)}function Jl(e,t){var n=Ql(e,t.line),r=ye(e.doc,n.line),i=Re(r,e.doc.direction);if(!i||i[0].level==0){var o=Math.max(n.ch,r.text.search(/\S/)),l=t.line==n.line&&t.ch<=o&&t.ch;return B(n.line,l?0:o,n.sticky)}return n}function ci(e,t,n){if(typeof t=="string"&&(t=En[t],!t))return!1;e.display.input.ensurePolled();var r=e.display.shift,i=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),n&&(e.display.shift=!1),i=t(e)!=qe}finally{e.display.shift=r,e.state.suppressEdits=!1}return i}function Cu(e,t,n){for(var r=0;r<e.state.keyMaps.length;r++){var i=Vr(t,e.state.keyMaps[r],n,e);if(i)return i}return e.options.extraKeys&&Vr(t,e.options.extraKeys,n,e)||Vr(t,e.options.keyMap,n,e)}var Du=new Ce;function On(e,t,n,r){var i=e.state.keySeq;if(i){if(Gl(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:Du.set(50,function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())}),Zl(e,i+" "+t,n,r))return!0}return Zl(e,t,n,r)}function Zl(e,t,n,r){var i=Cu(e,t,r);return i=="multi"&&(e.state.keySeq=t),i=="handled"&&ot(e,"keyHandled",e,t,n),(i=="handled"||i=="multi")&&(pt(n),Wi(e)),!!i}function $l(e,t){var n=Yl(t,!0);return n?t.shiftKey&&!e.state.keySeq?On(e,"Shift-"+n,t,function(r){return ci(e,r,!0)})||On(e,n,t,function(r){if(typeof r=="string"?/^go[A-Z]/.test(r):r.motion)return ci(e,r)}):On(e,n,t,function(r){return ci(e,r)}):!1}function Mu(e,t,n){return On(e,"'"+n+"'",t,function(r){return ci(e,r,!0)})}var io=null;function Vl(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField())&&(t.curOp.focus=y(fe(t)),!Qe(t,e))){k&&I<11&&e.keyCode==27&&(e.returnValue=!1);var n=e.keyCode;t.display.shift=n==16||e.shiftKey;var r=$l(t,e);A&&(io=r?n:null,!r&&n==88&&!Wn&&(z?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),_&&!z&&!r&&n==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),n==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&Fu(t)}}function Fu(e){var t=e.display.lineDiv;j(t,"CodeMirror-crosshair");function n(r){(r.keyCode==18||!r.altKey)&&(V(t,"CodeMirror-crosshair"),ht(document,"keyup",n),ht(document,"mouseover",n))}Se(document,"keyup",n),Se(document,"mouseover",n)}function ea(e){e.keyCode==16&&(this.doc.sel.shift=!1),Qe(this,e)}function ta(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField())&&!(tr(t.display,e)||Qe(t,e)||e.ctrlKey&&!e.altKey||z&&e.metaKey)){var n=e.keyCode,r=e.charCode;if(A&&n==io){io=null,pt(e);return}if(!(A&&(!e.which||e.which<10)&&$l(t,e))){var i=String.fromCharCode(r??n);i!="\b"&&(Mu(t,e,i)||t.display.input.onKeyPress(e))}}}var Au=400,oo=function(e,t,n){this.time=e,this.pos=t,this.button=n};oo.prototype.compare=function(e,t,n){return this.time+Au>e&&ce(t,this.pos)==0&&n==this.button};var Pn,In;function Nu(e,t){var n=+new Date;return In&&In.compare(n,e,t)?(Pn=In=null,"triple"):Pn&&Pn.compare(n,e,t)?(In=new oo(n,e,t),Pn=null,"double"):(Pn=new oo(n,e,t),In=null,"single")}function ra(e){var t=this,n=t.display;if(!(Qe(t,e)||n.activeTouch&&n.input.supportsTouch())){if(n.input.ensurePolled(),n.shift=e.shiftKey,tr(n,e)){Y||(n.scroller.draggable=!1,setTimeout(function(){return n.scroller.draggable=!0},100));return}if(!lo(t,e)){var r=Lr(t,e),i=Rt(e),o=r?Nu(r,i):"single";le(t).focus(),i==1&&t.state.selectingText&&t.state.selectingText(e),!(r&&Eu(t,i,r,o,e))&&(i==1?r?Pu(t,r,o,e):ln(e)==n.scroller&&pt(e):i==2?(r&&oi(t.doc,r),setTimeout(function(){return n.input.focus()},20)):i==3&&(J?t.display.input.onContextMenu(e):Hi(t)))}}}function Eu(e,t,n,r,i){var o="Click";return r=="double"?o="Double"+o:r=="triple"&&(o="Triple"+o),o=(t==1?"Left":t==2?"Middle":"Right")+o,On(e,Xl(o,i),i,function(l){if(typeof l=="string"&&(l=En[l]),!l)return!1;var a=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),a=l(e,n)!=qe}finally{e.state.suppressEdits=!1}return a})}function Ou(e,t,n){var r=e.getOption("configureMouse"),i=r?r(e,t,n):{};if(i.unit==null){var o=X?n.shiftKey&&n.metaKey:n.altKey;i.unit=o?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(i.extend==null||e.doc.extend)&&(i.extend=e.doc.extend||n.shiftKey),i.addNew==null&&(i.addNew=z?n.metaKey:n.ctrlKey),i.moveOnDrag==null&&(i.moveOnDrag=!(z?n.altKey:n.ctrlKey)),i}function Pu(e,t,n,r){k?setTimeout(xe(nl,e),0):e.curOp.focus=y(fe(e));var i=Ou(e,n,r),o=e.doc.sel,l;e.options.dragDrop&&xi&&!e.isReadOnly()&&n=="single"&&(l=o.contains(t))>-1&&(ce((l=o.ranges[l]).from(),t)<0||t.xRel>0)&&(ce(l.to(),t)>0||t.xRel<0)?Iu(e,r,t,i):zu(e,r,t,i)}function Iu(e,t,n,r){var i=e.display,o=!1,l=lt(e,function(u){Y&&(i.scroller.draggable=!1),e.state.draggingText=!1,e.state.delayingBlurEvent&&(e.hasFocus()?e.state.delayingBlurEvent=!1:Hi(e)),ht(i.wrapper.ownerDocument,"mouseup",l),ht(i.wrapper.ownerDocument,"mousemove",a),ht(i.scroller,"dragstart",s),ht(i.scroller,"drop",l),o||(pt(u),r.addNew||oi(e.doc,n,null,null,r.extend),Y&&!$||k&&I==9?setTimeout(function(){i.wrapper.ownerDocument.body.focus({preventScroll:!0}),i.input.focus()},20):i.input.focus())}),a=function(u){o=o||Math.abs(t.clientX-u.clientX)+Math.abs(t.clientY-u.clientY)>=10},s=function(){return o=!0};Y&&(i.scroller.draggable=!0),e.state.draggingText=l,l.copy=!r.moveOnDrag,Se(i.wrapper.ownerDocument,"mouseup",l),Se(i.wrapper.ownerDocument,"mousemove",a),Se(i.scroller,"dragstart",s),Se(i.scroller,"drop",l),e.state.delayingBlurEvent=!0,setTimeout(function(){return i.input.focus()},20),i.scroller.dragDrop&&i.scroller.dragDrop()}function na(e,t,n){if(n=="char")return new He(t,t);if(n=="word")return e.findWordAt(t);if(n=="line")return new He(B(t.line,0),Ae(e.doc,B(t.line+1,0)));var r=n(e,t);return new He(r.from,r.to)}function zu(e,t,n,r){k&&Hi(e);var i=e.display,o=e.doc;pt(t);var l,a,s=o.sel,u=s.ranges;if(r.addNew&&!r.extend?(a=o.sel.contains(n),a>-1?l=u[a]:l=new He(n,n)):(l=o.sel.primary(),a=o.sel.primIndex),r.unit=="rectangle")r.addNew||(l=new He(n,n)),n=Lr(e,t,!0,!0),a=-1;else{var h=na(e,n,r.unit);r.extend?l=Vi(l,h.anchor,h.head,r.extend):l=h}r.addNew?a==-1?(a=u.length,gt(o,Kt(e,u.concat([l]),a),{scroll:!1,origin:"*mouse"})):u.length>1&&u[a].empty()&&r.unit=="char"&&!r.extend?(gt(o,Kt(e,u.slice(0,a).concat(u.slice(a+1)),0),{scroll:!1,origin:"*mouse"}),s=o.sel):eo(o,a,l,dt):(a=0,gt(o,new Ot([l],0),dt),s=o.sel);var x=n;function D(se){if(ce(x,se)!=0)if(x=se,r.unit=="rectangle"){for(var ge=[],Le=e.options.tabSize,ke=Fe(ye(o,n.line).text,n.ch,Le),Ee=Fe(ye(o,se.line).text,se.ch,Le),Ke=Math.min(ke,Ee),st=Math.max(ke,Ee),Xe=Math.min(n.line,se.line),Nt=Math.min(e.lastLine(),Math.max(n.line,se.line));Xe<=Nt;Xe++){var Tt=ye(o,Xe).text,tt=_e(Tt,Ke,Le);Ke==st?ge.push(new He(B(Xe,tt),B(Xe,tt))):Tt.length>tt&&ge.push(new He(B(Xe,tt),B(Xe,_e(Tt,st,Le))))}ge.length||ge.push(new He(n,n)),gt(o,Kt(e,s.ranges.slice(0,a).concat(ge),a),{origin:"*mouse",scroll:!1}),e.scrollIntoView(se)}else{var Ct=l,ft=na(e,se,r.unit),nt=Ct.anchor,rt;ce(ft.anchor,nt)>0?(rt=ft.head,nt=Wr(Ct.from(),ft.anchor)):(rt=ft.anchor,nt=wt(Ct.to(),ft.head));var Ze=s.ranges.slice(0);Ze[a]=Bu(e,new He(Ae(o,nt),rt)),gt(o,Kt(e,Ze,a),dt)}}var L=i.wrapper.getBoundingClientRect(),H=0;function Z(se){var ge=++H,Le=Lr(e,se,!0,r.unit=="rectangle");if(Le)if(ce(Le,x)!=0){e.curOp.focus=y(fe(e)),D(Le);var ke=Vn(i,o);(Le.line>=ke.to||Le.line<ke.from)&&setTimeout(lt(e,function(){H==ge&&Z(se)}),150)}else{var Ee=se.clientY<L.top?-20:se.clientY>L.bottom?20:0;Ee&&setTimeout(lt(e,function(){H==ge&&(i.scroller.scrollTop+=Ee,Z(se))}),50)}}function ie(se){e.state.selectingText=!1,H=1/0,se&&(pt(se),i.input.focus()),ht(i.wrapper.ownerDocument,"mousemove",ae),ht(i.wrapper.ownerDocument,"mouseup",he),o.history.lastSelOrigin=null}var ae=lt(e,function(se){se.buttons===0||!Rt(se)?ie(se):Z(se)}),he=lt(e,ie);e.state.selectingText=he,Se(i.wrapper.ownerDocument,"mousemove",ae),Se(i.wrapper.ownerDocument,"mouseup",he)}function Bu(e,t){var n=t.anchor,r=t.head,i=ye(e.doc,n.line);if(ce(n,r)==0&&n.sticky==r.sticky)return t;var o=Re(i);if(!o)return t;var l=lr(o,n.ch,n.sticky),a=o[l];if(a.from!=n.ch&&a.to!=n.ch)return t;var s=l+(a.from==n.ch==(a.level!=1)?0:1);if(s==0||s==o.length)return t;var u;if(r.line!=n.line)u=(r.line-n.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var h=lr(o,r.ch,r.sticky),x=h-l||(r.ch-n.ch)*(a.level==1?-1:1);h==s-1||h==s?u=x<0:u=x>0}var D=o[s+(u?-1:0)],L=u==(D.level==1),H=L?D.from:D.to,Z=L?"after":"before";return n.ch==H&&n.sticky==Z?t:new He(new B(n.line,H,Z),r)}function ia(e,t,n,r){var i,o;if(t.touches)i=t.touches[0].clientX,o=t.touches[0].clientY;else try{i=t.clientX,o=t.clientY}catch{return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&pt(t);var l=e.display,a=l.lineDiv.getBoundingClientRect();if(o>a.bottom||!Ft(e,n))return kt(t);o-=a.top-l.viewOffset;for(var s=0;s<e.display.gutterSpecs.length;++s){var u=l.gutters.childNodes[s];if(u&&u.getBoundingClientRect().right>=i){var h=m(e.doc,o),x=e.display.gutterSpecs[s];return Ye(e,n,e,h,x.className,t),kt(t)}}}function lo(e,t){return ia(e,t,"gutterClick",!0)}function oa(e,t){tr(e.display,t)||Ru(e,t)||Qe(e,t,"contextmenu")||J||e.display.input.onContextMenu(t)}function Ru(e,t){return Ft(e,"gutterContextMenu")?ia(e,t,"gutterContextMenu",!1):!1}function la(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),gn(e)}var tn={toString:function(){return"CodeMirror.Init"}},aa={},di={};function Wu(e){var t=e.optionHandlers;function n(r,i,o,l){e.defaults[r]=i,o&&(t[r]=l?function(a,s,u){u!=tn&&o(a,s,u)}:o)}e.defineOption=n,e.Init=tn,n("value","",function(r,i){return r.setValue(i)},!0),n("mode",null,function(r,i){r.doc.modeOption=i,Ji(r)},!0),n("indentUnit",2,Ji,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,function(r){Sn(r),gn(r),St(r)},!0),n("lineSeparator",null,function(r,i){if(r.doc.lineSep=i,!!i){var o=[],l=r.doc.first;r.doc.iter(function(s){for(var u=0;;){var h=s.text.indexOf(i,u);if(h==-1)break;u=h+i.length,o.push(B(l,h))}l++});for(var a=o.length-1;a>=0;a--)Zr(r.doc,i,o[a],B(o[a].line,o[a].ch+i.length))}}),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\u202d\u202e\u2066\u2067\u2069\ufeff\ufff9-\ufffc]/g,function(r,i,o){r.state.specialChars=new RegExp(i.source+(i.test("	")?"":"|	"),"g"),o!=tn&&r.refresh()}),n("specialCharPlaceholder",ps,function(r){return r.refresh()},!0),n("electricChars",!0),n("inputStyle",N?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),n("spellcheck",!1,function(r,i){return r.getInputField().spellcheck=i},!0),n("autocorrect",!1,function(r,i){return r.getInputField().autocorrect=i},!0),n("autocapitalize",!1,function(r,i){return r.getInputField().autocapitalize=i},!0),n("rtlMoveVisually",!q),n("wholeLineUpdateBefore",!0),n("theme","default",function(r){la(r),wn(r)},!0),n("keyMap","default",function(r,i,o){var l=fi(i),a=o!=tn&&fi(o);a&&a.detach&&a.detach(r,l),l.attach&&l.attach(r,a||null)}),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,_u,!0),n("gutters",[],function(r,i){r.display.gutterSpecs=Yi(i,r.options.lineNumbers),wn(r)},!0),n("fixedGutter",!0,function(r,i){r.display.gutters.style.left=i?zi(r.display)+"px":"0",r.refresh()},!0),n("coverGutterNextToScrollbar",!1,function(r){return Xr(r)},!0),n("scrollbarStyle","native",function(r){ul(r),Xr(r),r.display.scrollbars.setScrollTop(r.doc.scrollTop),r.display.scrollbars.setScrollLeft(r.doc.scrollLeft)},!0),n("lineNumbers",!1,function(r,i){r.display.gutterSpecs=Yi(r.options.gutters,i),wn(r)},!0),n("firstLineNumber",1,wn,!0),n("lineNumberFormatter",function(r){return r},wn,!0),n("showCursorWhenSelecting",!1,vn,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,function(r,i){i=="nocursor"&&(Ur(r),r.display.input.blur()),r.display.input.readOnlyChanged(i)}),n("screenReaderLabel",null,function(r,i){i=i===""?null:i,r.display.input.screenReaderLabelChanged(i)}),n("disableInput",!1,function(r,i){i||r.display.input.reset()},!0),n("dragDrop",!0,Hu),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,vn,!0),n("singleCursorHeightPerLine",!0,vn,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,Sn,!0),n("addModeClass",!1,Sn,!0),n("pollInterval",100),n("undoDepth",200,function(r,i){return r.doc.history.undoDepth=i}),n("historyEventDelay",1250),n("viewportMargin",10,function(r){return r.refresh()},!0),n("maxHighlightLength",1e4,Sn,!0),n("moveInputWithCursor",!0,function(r,i){i||r.display.input.resetPosition()}),n("tabindex",null,function(r,i){return r.display.input.getField().tabIndex=i||""}),n("autofocus",null),n("direction","ltr",function(r,i){return r.doc.setDirection(i)},!0),n("phrases",null)}function Hu(e,t,n){var r=n&&n!=tn;if(!t!=!r){var i=e.display.dragFunctions,o=t?Se:ht;o(e.display.scroller,"dragstart",i.start),o(e.display.scroller,"dragenter",i.enter),o(e.display.scroller,"dragover",i.over),o(e.display.scroller,"dragleave",i.leave),o(e.display.scroller,"drop",i.drop)}}function _u(e){e.options.lineWrapping?(j(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(V(e.display.wrapper,"CodeMirror-wrap"),Ci(e)),Bi(e),St(e),gn(e),setTimeout(function(){return Xr(e)},100)}function Ge(e,t){var n=this;if(!(this instanceof Ge))return new Ge(e,t);this.options=t=t?Me(t):{},Me(aa,t,!1);var r=t.value;typeof r=="string"?r=new Lt(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var i=new Ge.inputStyles[t.inputStyle](this),o=this.display=new eu(e,r,i,t);o.wrapper.CodeMirror=this,la(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),ul(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new Ce,keySeq:null,specialChars:null},t.autofocus&&!N&&o.input.focus(),k&&I<11&&setTimeout(function(){return n.display.input.reset(!0)},20),qu(this),yu(),Mr(this),this.curOp.forceUpdate=!0,yl(this,r),t.autofocus&&!N||this.hasFocus()?setTimeout(function(){n.hasFocus()&&!n.state.focused&&_i(n)},20):Ur(this);for(var l in di)di.hasOwnProperty(l)&&di[l](this,t[l],tn);dl(this),t.finishInit&&t.finishInit(this);for(var a=0;a<ao.length;++a)ao[a](this);Fr(this),Y&&t.lineWrapping&&getComputedStyle(o.lineDiv).textRendering=="optimizelegibility"&&(o.lineDiv.style.textRendering="auto")}Ge.defaults=aa,Ge.optionHandlers=di;function qu(e){var t=e.display;Se(t.scroller,"mousedown",lt(e,ra)),k&&I<11?Se(t.scroller,"dblclick",lt(e,function(s){if(!Qe(e,s)){var u=Lr(e,s);if(!(!u||lo(e,s)||tr(e.display,s))){pt(s);var h=e.findWordAt(u);oi(e.doc,h.anchor,h.head)}}})):Se(t.scroller,"dblclick",function(s){return Qe(e,s)||pt(s)}),Se(t.scroller,"contextmenu",function(s){return oa(e,s)}),Se(t.input.getField(),"contextmenu",function(s){t.scroller.contains(s.target)||oa(e,s)});var n,r={end:0};function i(){t.activeTouch&&(n=setTimeout(function(){return t.activeTouch=null},1e3),r=t.activeTouch,r.end=+new Date)}function o(s){if(s.touches.length!=1)return!1;var u=s.touches[0];return u.radiusX<=1&&u.radiusY<=1}function l(s,u){if(u.left==null)return!0;var h=u.left-s.left,x=u.top-s.top;return h*h+x*x>400}Se(t.scroller,"touchstart",function(s){if(!Qe(e,s)&&!o(s)&&!lo(e,s)){t.input.ensurePolled(),clearTimeout(n);var u=+new Date;t.activeTouch={start:u,moved:!1,prev:u-r.end<=300?r:null},s.touches.length==1&&(t.activeTouch.left=s.touches[0].pageX,t.activeTouch.top=s.touches[0].pageY)}}),Se(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),Se(t.scroller,"touchend",function(s){var u=t.activeTouch;if(u&&!tr(t,s)&&u.left!=null&&!u.moved&&new Date-u.start<300){var h=e.coordsChar(t.activeTouch,"page"),x;!u.prev||l(u,u.prev)?x=new He(h,h):!u.prev.prev||l(u,u.prev.prev)?x=e.findWordAt(h):x=new He(B(h.line,0),Ae(e.doc,B(h.line+1,0))),e.setSelection(x.anchor,x.head),e.focus(),pt(s)}i()}),Se(t.scroller,"touchcancel",i),Se(t.scroller,"scroll",function(){t.scroller.clientHeight&&(xn(e,t.scroller.scrollTop),Cr(e,t.scroller.scrollLeft,!0),Ye(e,"scroll",e))}),Se(t.scroller,"mousewheel",function(s){return gl(e,s)}),Se(t.scroller,"DOMMouseScroll",function(s){return gl(e,s)}),Se(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(s){Qe(e,s)||ar(s)},over:function(s){Qe(e,s)||(xu(e,s),ar(s))},start:function(s){return mu(e,s)},drop:lt(e,vu),leave:function(s){Qe(e,s)||jl(e)}};var a=t.input.getField();Se(a,"keyup",function(s){return ea.call(e,s)}),Se(a,"keydown",lt(e,Vl)),Se(a,"keypress",lt(e,ta)),Se(a,"focus",function(s){return _i(e,s)}),Se(a,"blur",function(s){return Ur(e,s)})}var ao=[];Ge.defineInitHook=function(e){return ao.push(e)};function zn(e,t,n,r){var i=e.doc,o;n==null&&(n="add"),n=="smart"&&(i.mode.indent?o=fn(e,t).state:n="prev");var l=e.options.tabSize,a=ye(i,t),s=Fe(a.text,null,l);a.stateAfter&&(a.stateAfter=null);var u=a.text.match(/^\s*/)[0],h;if(!r&&!/\S/.test(a.text))h=0,n="not";else if(n=="smart"&&(h=i.mode.indent(o,a.text.slice(u.length),a.text),h==qe||h>150)){if(!r)return;n="prev"}n=="prev"?t>i.first?h=Fe(ye(i,t-1).text,null,l):h=0:n=="add"?h=s+e.options.indentUnit:n=="subtract"?h=s-e.options.indentUnit:typeof n=="number"&&(h=s+n),h=Math.max(0,h);var x="",D=0;if(e.options.indentWithTabs)for(var L=Math.floor(h/l);L;--L)D+=l,x+="	";if(D<h&&(x+=et(h-D)),x!=u)return Zr(i,x,B(t,0),B(t,u.length),"+input"),a.stateAfter=null,!0;for(var H=0;H<i.sel.ranges.length;H++){var Z=i.sel.ranges[H];if(Z.head.line==t&&Z.head.ch<u.length){var ie=B(t,u.length);eo(i,H,new He(ie,ie));break}}}var Ut=null;function hi(e){Ut=e}function so(e,t,n,r,i){var o=e.doc;e.display.shift=!1,r||(r=o.sel);var l=+new Date-200,a=i=="paste"||e.state.pasteIncoming>l,s=zt(t),u=null;if(a&&r.ranges.length>1)if(Ut&&Ut.text.join(`
`)==t){if(r.ranges.length%Ut.text.length==0){u=[];for(var h=0;h<Ut.text.length;h++)u.push(o.splitLines(Ut.text[h]))}}else s.length==r.ranges.length&&e.options.pasteLinesPerSelection&&(u=Ie(s,function(ae){return[ae]}));for(var x=e.curOp.updateInput,D=r.ranges.length-1;D>=0;D--){var L=r.ranges[D],H=L.from(),Z=L.to();L.empty()&&(n&&n>0?H=B(H.line,H.ch-n):e.state.overwrite&&!a?Z=B(Z.line,Math.min(ye(o,Z.line).text.length,Z.ch+we(s).length)):a&&Ut&&Ut.lineWise&&Ut.text.join(`
`)==s.join(`
`)&&(H=Z=B(H.line,0)));var ie={from:H,to:Z,text:u?u[D%u.length]:s,origin:i||(a?"paste":e.state.cutIncoming>l?"cut":"+input")};Jr(e.doc,ie),ot(e,"inputRead",e,ie)}t&&!a&&ua(e,t),Gr(e),e.curOp.updateInput<2&&(e.curOp.updateInput=x),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function sa(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&t.hasFocus()&&At(t,function(){return so(t,n,0,null,"paste")}),!0}function ua(e,t){if(!(!e.options.electricChars||!e.options.smartIndent))for(var n=e.doc.sel,r=n.ranges.length-1;r>=0;r--){var i=n.ranges[r];if(!(i.head.ch>100||r&&n.ranges[r-1].head.line==i.head.line)){var o=e.getModeAt(i.head),l=!1;if(o.electricChars){for(var a=0;a<o.electricChars.length;a++)if(t.indexOf(o.electricChars.charAt(a))>-1){l=zn(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(ye(e.doc,i.head.line).text.slice(0,i.head.ch))&&(l=zn(e,i.head.line,"smart"));l&&ot(e,"electricInput",e,i.head.line)}}}function fa(e){for(var t=[],n=[],r=0;r<e.doc.sel.ranges.length;r++){var i=e.doc.sel.ranges[r].head.line,o={anchor:B(i,0),head:B(i+1,0)};n.push(o),t.push(e.getRange(o.anchor,o.head))}return{text:t,ranges:n}}function uo(e,t,n,r){e.setAttribute("autocorrect",n?"on":"off"),e.setAttribute("autocapitalize",r?"on":"off"),e.setAttribute("spellcheck",!!t)}function ca(){var e=c("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; min-height: 1em; outline: none"),t=c("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return Y?e.style.width="1000px":e.setAttribute("wrap","off"),w&&(e.style.border="1px solid black"),t}function ju(e){var t=e.optionHandlers,n=e.helpers={};e.prototype={constructor:e,focus:function(){le(this).focus(),this.display.input.focus()},setOption:function(r,i){var o=this.options,l=o[r];o[r]==i&&r!="mode"||(o[r]=i,t.hasOwnProperty(r)&&lt(this,t[r])(this,i,l),Ye(this,"optionChange",this,r))},getOption:function(r){return this.options[r]},getDoc:function(){return this.doc},addKeyMap:function(r,i){this.state.keyMaps[i?"push":"unshift"](fi(r))},removeKeyMap:function(r){for(var i=this.state.keyMaps,o=0;o<i.length;++o)if(i[o]==r||i[o].name==r)return i.splice(o,1),!0},addOverlay:yt(function(r,i){var o=r.token?r:e.getMode(this.options,r);if(o.startState)throw new Error("Overlays may not be stateful.");E(this.state.overlays,{mode:o,modeSpec:r,opaque:i&&i.opaque,priority:i&&i.priority||0},function(l){return l.priority}),this.state.modeGen++,St(this)}),removeOverlay:yt(function(r){for(var i=this.state.overlays,o=0;o<i.length;++o){var l=i[o].modeSpec;if(l==r||typeof r=="string"&&l.name==r){i.splice(o,1),this.state.modeGen++,St(this);return}}}),indentLine:yt(function(r,i,o){typeof i!="string"&&typeof i!="number"&&(i==null?i=this.options.smartIndent?"smart":"prev":i=i?"add":"subtract"),U(this.doc,r)&&zn(this,r,i,o)}),indentSelection:yt(function(r){for(var i=this.doc.sel.ranges,o=-1,l=0;l<i.length;l++){var a=i[l];if(a.empty())a.head.line>o&&(zn(this,a.head.line,r,!0),o=a.head.line,l==this.doc.sel.primIndex&&Gr(this));else{var s=a.from(),u=a.to(),h=Math.max(o,s.line);o=Math.min(this.lastLine(),u.line-(u.ch?0:1))+1;for(var x=h;x<o;++x)zn(this,x,r);var D=this.doc.sel.ranges;s.ch==0&&i.length==D.length&&D[l].from().ch>0&&eo(this.doc,l,new He(s,D[l].to()),$e)}}}),getTokenAt:function(r,i){return ko(this,r,i)},getLineTokens:function(r,i){return ko(this,B(r),i,!0)},getTokenTypeAt:function(r){r=Ae(this.doc,r);var i=xo(this,ye(this.doc,r.line)),o=0,l=(i.length-1)/2,a=r.ch,s;if(a==0)s=i[2];else for(;;){var u=o+l>>1;if((u?i[u*2-1]:0)>=a)l=u;else if(i[u*2+1]<a)o=u+1;else{s=i[u*2+2];break}}var h=s?s.indexOf("overlay "):-1;return h<0?s:h==0?null:s.slice(0,h-1)},getModeAt:function(r){var i=this.doc.mode;return i.innerMode?e.innerMode(i,this.getTokenAt(r).state).mode:i},getHelper:function(r,i){return this.getHelpers(r,i)[0]},getHelpers:function(r,i){var o=[];if(!n.hasOwnProperty(i))return o;var l=n[i],a=this.getModeAt(r);if(typeof a[i]=="string")l[a[i]]&&o.push(l[a[i]]);else if(a[i])for(var s=0;s<a[i].length;s++){var u=l[a[i][s]];u&&o.push(u)}else a.helperType&&l[a.helperType]?o.push(l[a.helperType]):l[a.name]&&o.push(l[a.name]);for(var h=0;h<l._global.length;h++){var x=l._global[h];x.pred(a,this)&&ve(o,x.val)==-1&&o.push(x.val)}return o},getStateAfter:function(r,i){var o=this.doc;return r=go(o,r??o.first+o.size-1),fn(this,r+1,i).state},cursorCoords:function(r,i){var o,l=this.doc.sel.primary();return r==null?o=l.head:typeof r=="object"?o=Ae(this.doc,r):o=r?l.from():l.to(),jt(this,o,i||"page")},charCoords:function(r,i){return Qn(this,Ae(this.doc,r),i||"page")},coordsChar:function(r,i){return r=Jo(this,r,i||"page"),Oi(this,r.left,r.top)},lineAtHeight:function(r,i){return r=Jo(this,{top:r,left:0},i||"page").top,m(this.doc,r+this.display.viewOffset)},heightAtLine:function(r,i,o){var l=!1,a;if(typeof r=="number"){var s=this.doc.first+this.doc.size-1;r<this.doc.first?r=this.doc.first:r>s&&(r=s,l=!0),a=ye(this.doc,r)}else a=r;return Yn(this,a,{top:0,left:0},i||"page",o||l).top+(l?this.doc.height-er(a):0)},defaultTextHeight:function(){return jr(this.display)},defaultCharWidth:function(){return Kr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(r,i,o,l,a){var s=this.display;r=jt(this,Ae(this.doc,r));var u=r.bottom,h=r.left;if(i.style.position="absolute",i.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(i),s.sizer.appendChild(i),l=="over")u=r.top;else if(l=="above"||l=="near"){var x=Math.max(s.wrapper.clientHeight,this.doc.height),D=Math.max(s.sizer.clientWidth,s.lineSpace.clientWidth);(l=="above"||r.bottom+i.offsetHeight>x)&&r.top>i.offsetHeight?u=r.top-i.offsetHeight:r.bottom+i.offsetHeight<=x&&(u=r.bottom),h+i.offsetWidth>D&&(h=D-i.offsetWidth)}i.style.top=u+"px",i.style.left=i.style.right="",a=="right"?(h=s.sizer.clientWidth-i.offsetWidth,i.style.right="0px"):(a=="left"?h=0:a=="middle"&&(h=(s.sizer.clientWidth-i.offsetWidth)/2),i.style.left=h+"px"),o&&Hs(this,{left:h,top:u,right:h+i.offsetWidth,bottom:u+i.offsetHeight})},triggerOnKeyDown:yt(Vl),triggerOnKeyPress:yt(ta),triggerOnKeyUp:ea,triggerOnMouseDown:yt(ra),execCommand:function(r){if(En.hasOwnProperty(r))return En[r].call(null,this)},triggerElectric:yt(function(r){ua(this,r)}),findPosH:function(r,i,o,l){var a=1;i<0&&(a=-1,i=-i);for(var s=Ae(this.doc,r),u=0;u<i&&(s=fo(this.doc,s,a,o,l),!s.hitSide);++u);return s},moveH:yt(function(r,i){var o=this;this.extendSelectionsBy(function(l){return o.display.shift||o.doc.extend||l.empty()?fo(o.doc,l.head,r,i,o.options.rtlMoveVisually):r<0?l.from():l.to()},Pe)}),deleteH:yt(function(r,i){var o=this.doc.sel,l=this.doc;o.somethingSelected()?l.replaceSelection("",null,"+delete"):en(this,function(a){var s=fo(l,a.head,r,i,!1);return r<0?{from:s,to:a.head}:{from:a.head,to:s}})}),findPosV:function(r,i,o,l){var a=1,s=l;i<0&&(a=-1,i=-i);for(var u=Ae(this.doc,r),h=0;h<i;++h){var x=jt(this,u,"div");if(s==null?s=x.left:x.left=s,u=da(this,x,a,o),u.hitSide)break}return u},moveV:yt(function(r,i){var o=this,l=this.doc,a=[],s=!this.display.shift&&!l.extend&&l.sel.somethingSelected();if(l.extendSelectionsBy(function(h){if(s)return r<0?h.from():h.to();var x=jt(o,h.head,"div");h.goalColumn!=null&&(x.left=h.goalColumn),a.push(x.left);var D=da(o,x,r,i);return i=="page"&&h==l.sel.primary()&&ji(o,Qn(o,D,"div").top-x.top),D},Pe),a.length)for(var u=0;u<l.sel.ranges.length;u++)l.sel.ranges[u].goalColumn=a[u]}),findWordAt:function(r){var i=this.doc,o=ye(i,r.line).text,l=r.ch,a=r.ch;if(o){var s=this.getHelper(r,"wordChars");(r.sticky=="before"||a==o.length)&&l?--l:++a;for(var u=o.charAt(l),h=De(u,s)?function(x){return De(x,s)}:/\s/.test(u)?function(x){return/\s/.test(x)}:function(x){return!/\s/.test(x)&&!De(x)};l>0&&h(o.charAt(l-1));)--l;for(;a<o.length&&h(o.charAt(a));)++a}return new He(B(r.line,l),B(r.line,a))},toggleOverwrite:function(r){r!=null&&r==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?j(this.display.cursorDiv,"CodeMirror-overwrite"):V(this.display.cursorDiv,"CodeMirror-overwrite"),Ye(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==y(fe(this))},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:yt(function(r,i){mn(this,r,i)}),getScrollInfo:function(){var r=this.display.scroller;return{left:r.scrollLeft,top:r.scrollTop,height:r.scrollHeight-Yt(this)-this.display.barHeight,width:r.scrollWidth-Yt(this)-this.display.barWidth,clientHeight:Fi(this),clientWidth:wr(this)}},scrollIntoView:yt(function(r,i){r==null?(r={from:this.doc.sel.primary().head,to:null},i==null&&(i=this.options.cursorScrollMargin)):typeof r=="number"?r={from:B(r,0),to:null}:r.from==null&&(r={from:r,to:null}),r.to||(r.to=r.from),r.margin=i||0,r.from.line!=null?_s(this,r):ol(this,r.from,r.to,r.margin)}),setSize:yt(function(r,i){var o=this,l=function(s){return typeof s=="number"||/^\d+$/.test(String(s))?s+"px":s};r!=null&&(this.display.wrapper.style.width=l(r)),i!=null&&(this.display.wrapper.style.height=l(i)),this.options.lineWrapping&&Xo(this);var a=this.display.viewFrom;this.doc.iter(a,this.display.viewTo,function(s){if(s.widgets){for(var u=0;u<s.widgets.length;u++)if(s.widgets[u].noHScroll){dr(o,a,"widget");break}}++a}),this.curOp.forceUpdate=!0,Ye(this,"refresh",this)}),operation:function(r){return At(this,r)},startOperation:function(){return Mr(this)},endOperation:function(){return Fr(this)},refresh:yt(function(){var r=this.display.cachedTextHeight;St(this),this.curOp.forceUpdate=!0,gn(this),mn(this,this.doc.scrollLeft,this.doc.scrollTop),Gi(this.display),(r==null||Math.abs(r-jr(this.display))>.5||this.options.lineWrapping)&&Bi(this),Ye(this,"refresh",this)}),swapDoc:yt(function(r){var i=this.doc;return i.cm=null,this.state.selectingText&&this.state.selectingText(),yl(this,r),gn(this),this.display.input.reset(),mn(this,r.scrollLeft,r.scrollTop),this.curOp.forceScroll=!0,ot(this,"swapDoc",this,i),i}),phrase:function(r){var i=this.options.phrases;return i&&Object.prototype.hasOwnProperty.call(i,r)?i[r]:r},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},Bt(e),e.registerHelper=function(r,i,o){n.hasOwnProperty(r)||(n[r]=e[r]={_global:[]}),n[r][i]=o},e.registerGlobalHelper=function(r,i,o,l){e.registerHelper(r,i,l),n[r]._global.push({pred:o,val:l})}}function fo(e,t,n,r,i){var o=t,l=n,a=ye(e,t.line),s=i&&e.direction=="rtl"?-n:n;function u(){var he=t.line+s;return he<e.first||he>=e.first+e.size?!1:(t=new B(he,t.ch,t.sticky),a=ye(e,he))}function h(he){var se;if(r=="codepoint"){var ge=a.text.charCodeAt(t.ch+(n>0?0:-1));if(isNaN(ge))se=null;else{var Le=n>0?ge>=55296&&ge<56320:ge>=56320&&ge<57343;se=new B(t.line,Math.max(0,Math.min(a.text.length,t.ch+n*(Le?2:1))),-n)}}else i?se=Lu(e.cm,a,t,n):se=ro(a,t,n);if(se==null)if(!he&&u())t=no(i,e.cm,a,t.line,s);else return!1;else t=se;return!0}if(r=="char"||r=="codepoint")h();else if(r=="column")h(!0);else if(r=="word"||r=="group")for(var x=null,D=r=="group",L=e.cm&&e.cm.getHelper(t,"wordChars"),H=!0;!(n<0&&!h(!H));H=!1){var Z=a.text.charAt(t.ch)||`
`,ie=De(Z,L)?"w":D&&Z==`
`?"n":!D||/\s/.test(Z)?null:"p";if(D&&!H&&!ie&&(ie="s"),x&&x!=ie){n<0&&(n=1,h(),t.sticky="after");break}if(ie&&(x=ie),n>0&&!h(!H))break}var ae=ai(e,t,o,l,!0);return We(o,ae)&&(ae.hitSide=!0),ae}function da(e,t,n,r){var i=e.doc,o=t.left,l;if(r=="page"){var a=Math.min(e.display.wrapper.clientHeight,le(e).innerHeight||i(e).documentElement.clientHeight),s=Math.max(a-.5*jr(e.display),3);l=(n>0?t.bottom:t.top)+n*s}else r=="line"&&(l=n>0?t.bottom+3:t.top-3);for(var u;u=Oi(e,o,l),!!u.outside;){if(n<0?l<=0:l>=i.height){u.hitSide=!0;break}l+=n*5}return u}var je=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new Ce,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};je.prototype.init=function(e){var t=this,n=this,r=n.cm,i=n.div=e.lineDiv;i.contentEditable=!0,uo(i,r.options.spellcheck,r.options.autocorrect,r.options.autocapitalize);function o(a){for(var s=a.target;s;s=s.parentNode){if(s==i)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(s.className))break}return!1}Se(i,"paste",function(a){!o(a)||Qe(r,a)||sa(a,r)||I<=11&&setTimeout(lt(r,function(){return t.updateFromDOM()}),20)}),Se(i,"compositionstart",function(a){t.composing={data:a.data,done:!1}}),Se(i,"compositionupdate",function(a){t.composing||(t.composing={data:a.data,done:!1})}),Se(i,"compositionend",function(a){t.composing&&(a.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),Se(i,"touchstart",function(){return n.forceCompositionEnd()}),Se(i,"input",function(){t.composing||t.readFromDOMSoon()});function l(a){if(!(!o(a)||Qe(r,a))){if(r.somethingSelected())hi({lineWise:!1,text:r.getSelections()}),a.type=="cut"&&r.replaceSelection("",null,"cut");else if(r.options.lineWiseCopyCut){var s=fa(r);hi({lineWise:!0,text:s.text}),a.type=="cut"&&r.operation(function(){r.setSelections(s.ranges,0,$e),r.replaceSelection("",null,"cut")})}else return;if(a.clipboardData){a.clipboardData.clearData();var u=Ut.text.join(`
`);if(a.clipboardData.setData("Text",u),a.clipboardData.getData("Text")==u){a.preventDefault();return}}var h=ca(),x=h.firstChild;uo(x),r.display.lineSpace.insertBefore(h,r.display.lineSpace.firstChild),x.value=Ut.text.join(`
`);var D=y(Te(i));v(x),setTimeout(function(){r.display.lineSpace.removeChild(h),D.focus(),D==i&&n.showPrimarySelection()},50)}}Se(i,"copy",l),Se(i,"cut",l)},je.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},je.prototype.prepareSelection=function(){var e=rl(this.cm,!1);return e.focus=y(Te(this.div))==this.div,e},je.prototype.showSelection=function(e,t){!e||!this.cm.display.view.length||((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},je.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},je.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,n=t.doc.sel.primary(),r=n.from(),i=n.to();if(t.display.viewTo==t.display.viewFrom||r.line>=t.display.viewTo||i.line<t.display.viewFrom){e.removeAllRanges();return}var o=pi(t,e.anchorNode,e.anchorOffset),l=pi(t,e.focusNode,e.focusOffset);if(!(o&&!o.bad&&l&&!l.bad&&ce(Wr(o,l),r)==0&&ce(wt(o,l),i)==0)){var a=t.display.view,s=r.line>=t.display.viewFrom&&ha(t,r)||{node:a[0].measure.map[2],offset:0},u=i.line<t.display.viewTo&&ha(t,i);if(!u){var h=a[a.length-1].measure,x=h.maps?h.maps[h.maps.length-1]:h.map;u={node:x[x.length-1],offset:x[x.length-2]-x[x.length-3]}}if(!s||!u){e.removeAllRanges();return}var D=e.rangeCount&&e.getRangeAt(0),L;try{L=C(s.node,s.offset,u.offset,u.node)}catch{}L&&(!_&&t.state.focused?(e.collapse(s.node,s.offset),L.collapsed||(e.removeAllRanges(),e.addRange(L))):(e.removeAllRanges(),e.addRange(L)),D&&e.anchorNode==null?e.addRange(D):_&&this.startGracePeriod()),this.rememberSelection()}},je.prototype.startGracePeriod=function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation(function(){return e.cm.curOp.selectionChanged=!0})},20)},je.prototype.showMultipleSelections=function(e){G(this.cm.display.cursorDiv,e.cursors),G(this.cm.display.selectionDiv,e.selection)},je.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},je.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return g(this.div,t)},je.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||y(Te(this.div))!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},je.prototype.blur=function(){this.div.blur()},je.prototype.getField=function(){return this.div},je.prototype.supportsTouch=function(){return!0},je.prototype.receivedFocus=function(){var e=this,t=this;this.selectionInEditor()?setTimeout(function(){return e.pollSelection()},20):At(this.cm,function(){return t.cm.curOp.selectionChanged=!0});function n(){t.cm.state.focused&&(t.pollSelection(),t.polling.set(t.cm.options.pollInterval,n))}this.polling.set(this.cm.options.pollInterval,n)},je.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},je.prototype.pollSelection=function(){if(!(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())){var e=this.getSelection(),t=this.cm;if(M&&S&&this.cm.display.gutterSpecs.length&&Ku(e.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(!this.composing){this.rememberSelection();var n=pi(t,e.anchorNode,e.anchorOffset),r=pi(t,e.focusNode,e.focusOffset);n&&r&&At(t,function(){gt(t.doc,pr(n,r),$e),(n.bad||r.bad)&&(t.curOp.selectionChanged=!0)})}}},je.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,n=e.doc.sel.primary(),r=n.from(),i=n.to();if(r.ch==0&&r.line>e.firstLine()&&(r=B(r.line-1,ye(e.doc,r.line-1).length)),i.ch==ye(e.doc,i.line).text.length&&i.line<e.lastLine()&&(i=B(i.line+1,0)),r.line<t.viewFrom||i.line>t.viewTo-1)return!1;var o,l,a;r.line==t.viewFrom||(o=Tr(e,r.line))==0?(l=f(t.view[0].line),a=t.view[0].node):(l=f(t.view[o].line),a=t.view[o-1].node.nextSibling);var s=Tr(e,i.line),u,h;if(s==t.view.length-1?(u=t.viewTo-1,h=t.lineDiv.lastChild):(u=f(t.view[s+1].line)-1,h=t.view[s+1].node.previousSibling),!a)return!1;for(var x=e.doc.splitLines(Uu(e,a,h,l,u)),D=$t(e.doc,B(l,0),B(u,ye(e.doc,u).text.length));x.length>1&&D.length>1;)if(we(x)==we(D))x.pop(),D.pop(),u--;else if(x[0]==D[0])x.shift(),D.shift(),l++;else break;for(var L=0,H=0,Z=x[0],ie=D[0],ae=Math.min(Z.length,ie.length);L<ae&&Z.charCodeAt(L)==ie.charCodeAt(L);)++L;for(var he=we(x),se=we(D),ge=Math.min(he.length-(x.length==1?L:0),se.length-(D.length==1?L:0));H<ge&&he.charCodeAt(he.length-H-1)==se.charCodeAt(se.length-H-1);)++H;if(x.length==1&&D.length==1&&l==r.line)for(;L&&L>r.ch&&he.charCodeAt(he.length-H-1)==se.charCodeAt(se.length-H-1);)L--,H++;x[x.length-1]=he.slice(0,he.length-H).replace(/^\u200b+/,""),x[0]=x[0].slice(L).replace(/\u200b+$/,"");var Le=B(l,L),ke=B(u,D.length?we(D).length-H:0);if(x.length>1||x[0]||ce(Le,ke))return Zr(e.doc,x,Le,ke,"+input"),!0},je.prototype.ensurePolled=function(){this.forceCompositionEnd()},je.prototype.reset=function(){this.forceCompositionEnd()},je.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},je.prototype.readFromDOMSoon=function(){var e=this;this.readDOMTimeout==null&&(this.readDOMTimeout=setTimeout(function(){if(e.readDOMTimeout=null,e.composing)if(e.composing.done)e.composing=null;else return;e.updateFromDOM()},80))},je.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&At(this.cm,function(){return St(e.cm)})},je.prototype.setUneditable=function(e){e.contentEditable="false"},je.prototype.onKeyPress=function(e){e.charCode==0||this.composing||(e.preventDefault(),this.cm.isReadOnly()||lt(this.cm,so)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0))},je.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},je.prototype.onContextMenu=function(){},je.prototype.resetPosition=function(){},je.prototype.needsContentAttribute=!0;function ha(e,t){var n=Ai(e,t.line);if(!n||n.hidden)return null;var r=ye(e.doc,t.line),i=qo(n,r,t.line),o=Re(r,e.doc.direction),l="left";if(o){var a=lr(o,t.ch);l=a%2?"right":"left"}var s=Uo(i.map,t.ch,l);return s.offset=s.collapse=="right"?s.end:s.start,s}function Ku(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function rn(e,t){return t&&(e.bad=!0),e}function Uu(e,t,n,r,i){var o="",l=!1,a=e.doc.lineSeparator(),s=!1;function u(L){return function(H){return H.id==L}}function h(){l&&(o+=a,s&&(o+=a),l=s=!1)}function x(L){L&&(h(),o+=L)}function D(L){if(L.nodeType==1){var H=L.getAttribute("cm-text");if(H){x(H);return}var Z=L.getAttribute("cm-marker"),ie;if(Z){var ae=e.findMarks(B(r,0),B(i+1,0),u(+Z));ae.length&&(ie=ae[0].find(0))&&x($t(e.doc,ie.from,ie.to).join(a));return}if(L.getAttribute("contenteditable")=="false")return;var he=/^(pre|div|p|li|table|br)$/i.test(L.nodeName);if(!/^br$/i.test(L.nodeName)&&L.textContent.length==0)return;he&&h();for(var se=0;se<L.childNodes.length;se++)D(L.childNodes[se]);/^(pre|p)$/i.test(L.nodeName)&&(s=!0),he&&(l=!0)}else L.nodeType==3&&x(L.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;D(t),t!=n;)t=t.nextSibling,s=!1;return o}function pi(e,t,n){var r;if(t==e.display.lineDiv){if(r=e.display.lineDiv.childNodes[n],!r)return rn(e.clipPos(B(e.display.viewTo-1)),!0);t=null,n=0}else for(r=t;;r=r.parentNode){if(!r||r==e.display.lineDiv)return null;if(r.parentNode&&r.parentNode==e.display.lineDiv)break}for(var i=0;i<e.display.view.length;i++){var o=e.display.view[i];if(o.node==r)return Gu(o,t,n)}}function Gu(e,t,n){var r=e.text.firstChild,i=!1;if(!t||!g(r,t))return rn(B(f(e.line),0),!0);if(t==r&&(i=!0,t=r.childNodes[n],n=0,!t)){var o=e.rest?we(e.rest):e.line;return rn(B(f(o),o.text.length),i)}var l=t.nodeType==3?t:null,a=t;for(!l&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(l=t.firstChild,n&&(n=l.nodeValue.length));a.parentNode!=r;)a=a.parentNode;var s=e.measure,u=s.maps;function h(ie,ae,he){for(var se=-1;se<(u?u.length:0);se++)for(var ge=se<0?s.map:u[se],Le=0;Le<ge.length;Le+=3){var ke=ge[Le+2];if(ke==ie||ke==ae){var Ee=f(se<0?e.line:e.rest[se]),Ke=ge[Le]+he;return(he<0||ke!=ie)&&(Ke=ge[Le+(he?1:0)]),B(Ee,Ke)}}}var x=h(l,a,n);if(x)return rn(x,i);for(var D=a.nextSibling,L=l?l.nodeValue.length-n:0;D;D=D.nextSibling){if(x=h(D,D.firstChild,0),x)return rn(B(x.line,x.ch-L),i);L+=D.textContent.length}for(var H=a.previousSibling,Z=n;H;H=H.previousSibling){if(x=h(H,H.firstChild,-1),x)return rn(B(x.line,x.ch+Z),i);Z+=H.textContent.length}}var Ve=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new Ce,this.hasSelection=!1,this.composing=null,this.resetting=!1};Ve.prototype.init=function(e){var t=this,n=this,r=this.cm;this.createField(e);var i=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),w&&(i.style.width="0px"),Se(i,"input",function(){k&&I>=9&&t.hasSelection&&(t.hasSelection=null),n.poll()}),Se(i,"paste",function(l){Qe(r,l)||sa(l,r)||(r.state.pasteIncoming=+new Date,n.fastPoll())});function o(l){if(!Qe(r,l)){if(r.somethingSelected())hi({lineWise:!1,text:r.getSelections()});else if(r.options.lineWiseCopyCut){var a=fa(r);hi({lineWise:!0,text:a.text}),l.type=="cut"?r.setSelections(a.ranges,null,$e):(n.prevInput="",i.value=a.text.join(`
`),v(i))}else return;l.type=="cut"&&(r.state.cutIncoming=+new Date)}}Se(i,"cut",o),Se(i,"copy",o),Se(e.scroller,"paste",function(l){if(!(tr(e,l)||Qe(r,l))){if(!i.dispatchEvent){r.state.pasteIncoming=+new Date,n.focus();return}var a=new Event("paste");a.clipboardData=l.clipboardData,i.dispatchEvent(a)}}),Se(e.lineSpace,"selectstart",function(l){tr(e,l)||pt(l)}),Se(i,"compositionstart",function(){var l=r.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:l,range:r.markText(l,r.getCursor("to"),{className:"CodeMirror-composing"})}}),Se(i,"compositionend",function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)})},Ve.prototype.createField=function(e){this.wrapper=ca(),this.textarea=this.wrapper.firstChild;var t=this.cm.options;uo(this.textarea,t.spellcheck,t.autocorrect,t.autocapitalize)},Ve.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},Ve.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,r=rl(e);if(e.options.moveInputWithCursor){var i=jt(e,n.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),l=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+l.top-o.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+l.left-o.left))}return r},Ve.prototype.showSelection=function(e){var t=this.cm,n=t.display;G(n.cursorDiv,e.cursors),G(n.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Ve.prototype.reset=function(e){if(!(this.contextMenuPending||this.composing&&e)){var t=this.cm;if(this.resetting=!0,t.somethingSelected()){this.prevInput="";var n=t.getSelection();this.textarea.value=n,t.state.focused&&v(this.textarea),k&&I>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",k&&I>=9&&(this.hasSelection=null));this.resetting=!1}},Ve.prototype.getField=function(){return this.textarea},Ve.prototype.supportsTouch=function(){return!1},Ve.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!N||y(Te(this.textarea))!=this.textarea))try{this.textarea.focus()}catch{}},Ve.prototype.blur=function(){this.textarea.blur()},Ve.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Ve.prototype.receivedFocus=function(){this.slowPoll()},Ve.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},Ve.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function n(){var r=t.poll();!r&&!e?(e=!0,t.polling.set(60,n)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,n)},Ve.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||this.resetting||!t.state.focused||ur(n)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=n.value;if(i==r&&!t.somethingSelected())return!1;if(k&&I>=9&&this.hasSelection===i||z&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var o=i.charCodeAt(0);if(o==8203&&!r&&(r="â€‹"),o==8666)return this.reset(),this.cm.execCommand("undo")}for(var l=0,a=Math.min(r.length,i.length);l<a&&r.charCodeAt(l)==i.charCodeAt(l);)++l;return At(t,function(){so(t,i.slice(l),r.length-l,null,e.composing?"*compose":null),i.length>1e3||i.indexOf(`
`)>-1?n.value=e.prevInput="":e.prevInput=i,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Ve.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Ve.prototype.onKeyPress=function(){k&&I>=9&&(this.hasSelection=null),this.fastPoll()},Ve.prototype.onContextMenu=function(e){var t=this,n=t.cm,r=n.display,i=t.textarea;t.contextMenuPending&&t.contextMenuPending();var o=Lr(n,e),l=r.scroller.scrollTop;if(!o||A)return;var a=n.options.resetSelectionOnContextMenu;a&&n.doc.sel.contains(o)==-1&&lt(n,gt)(n.doc,pr(o),$e);var s=i.style.cssText,u=t.wrapper.style.cssText,h=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",i.style.cssText=`position: absolute; width: 30px; height: 30px;
      top: `+(e.clientY-h.top-5)+"px; left: "+(e.clientX-h.left-5)+`px;
      z-index: 1000; background: `+(k?"rgba(255, 255, 255, .05)":"transparent")+`;
      outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var x;Y&&(x=i.ownerDocument.defaultView.scrollY),r.input.focus(),Y&&i.ownerDocument.defaultView.scrollTo(null,x),r.input.reset(),n.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=L,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll);function D(){if(i.selectionStart!=null){var Z=n.somethingSelected(),ie="â€‹"+(Z?i.value:"");i.value="â‡š",i.value=ie,t.prevInput=Z?"":"â€‹",i.selectionStart=1,i.selectionEnd=ie.length,r.selForContextMenu=n.doc.sel}}function L(){if(t.contextMenuPending==L&&(t.contextMenuPending=!1,t.wrapper.style.cssText=u,i.style.cssText=s,k&&I<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=l),i.selectionStart!=null)){(!k||k&&I<9)&&D();var Z=0,ie=function(){r.selForContextMenu==n.doc.sel&&i.selectionStart==0&&i.selectionEnd>0&&t.prevInput=="â€‹"?lt(n,El)(n):Z++<10?r.detectingSelectAll=setTimeout(ie,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(ie,200)}}if(k&&I>=9&&D(),J){ar(e);var H=function(){ht(window,"mouseup",H),setTimeout(L,20)};Se(window,"mouseup",H)}else setTimeout(L,50)},Ve.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},Ve.prototype.setUneditable=function(){},Ve.prototype.needsContentAttribute=!1;function Xu(e,t){if(t=t?Me(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),t.autofocus==null){var n=y(Te(e));t.autofocus=n==e||e.getAttribute("autofocus")!=null&&n==document.body}function r(){e.value=a.getValue()}var i;if(e.form&&(Se(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var o=e.form;i=o.submit;try{var l=o.submit=function(){r(),o.submit=i,o.submit(),o.submit=l}}catch{}}t.finishInit=function(s){s.save=r,s.getTextArea=function(){return e},s.toTextArea=function(){s.toTextArea=isNaN,r(),e.parentNode.removeChild(s.getWrapperElement()),e.style.display="",e.form&&(ht(e.form,"submit",r),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=i))}},e.style.display="none";var a=Ge(function(s){return e.parentNode.insertBefore(s,e.nextSibling)},t);return a}function Yu(e){e.off=ht,e.on=Se,e.wheelEventPixels=tu,e.Doc=Lt,e.splitLines=zt,e.countColumn=Fe,e.findColumn=_e,e.isWordChar=me,e.Pass=qe,e.signal=Ye,e.Line=Hr,e.changeEnd=gr,e.scrollbarModel=sl,e.Pos=B,e.cmpPos=ce,e.modes=Pr,e.mimeModes=Ht,e.resolveMode=Ir,e.getMode=zr,e.modeExtensions=fr,e.extendMode=Br,e.copyState=Gt,e.startState=Rr,e.innerMode=sn,e.commands=En,e.keyMap=nr,e.keyName=Yl,e.isModifierKey=Gl,e.lookupKey=Vr,e.normalizeKeyMap=Su,e.StringStream=Je,e.SharedTextMarker=Fn,e.TextMarker=mr,e.LineWidget=Mn,e.e_preventDefault=pt,e.e_stopPropagation=Er,e.e_stop=ar,e.addClass=j,e.contains=g,e.rmClass=V,e.keyNames=xr}Wu(Ge),ju(Ge);var Qu="iter insert remove copy getEditor constructor".split(" ");for(var gi in Lt.prototype)Lt.prototype.hasOwnProperty(gi)&&ve(Qu,gi)<0&&(Ge.prototype[gi]=(function(e){return function(){return e.apply(this.doc,arguments)}})(Lt.prototype[gi]));return Bt(Lt),Ge.inputStyles={textarea:Ve,contenteditable:je},Ge.defineMode=function(e){!Ge.defaults.mode&&e!="null"&&(Ge.defaults.mode=e),_t.apply(this,arguments)},Ge.defineMIME=kr,Ge.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Ge.defineMIME("text/plain","null"),Ge.defineExtension=function(e,t){Ge.prototype[e]=t},Ge.defineDocExtension=function(e,t){Lt.prototype[e]=t},Ge.fromTextArea=Xu,Yu(Ge),Ge.version="5.65.18",Ge}))})(vi)),vi.exports}var $u=mt();const hf=Ju($u);var ga={exports:{}},va;function Xa(){return va||(va=1,(function(ct,xt){(function(b){b(mt())})(function(b){b.defineMode("css",function(J,P){var V=P.inline;P.propertyKeywords||(P=b.resolveMode("text/css"));var F=J.indentUnit,G=P.tokenHooks,c=P.documentTypes||{},T=P.mediaTypes||{},C=P.mediaFeatures||{},g=P.mediaValueKeywords||{},y=P.propertyKeywords||{},j=P.nonStandardPropertyKeywords||{},de=P.fontProperties||{},v=P.counterDescriptors||{},d=P.colorKeywords||{},fe=P.valueKeywords||{},Te=P.allowNested,le=P.lineComment,xe=P.supportsAtComponent===!0,Me=J.highlightNonStandardPropertyKeywords!==!1,Fe,Ce;function ve(E,ee){return Fe=ee,E}function Oe(E,ee){var K=E.next();if(G[K]){var ze=G[K](E,ee);if(ze!==!1)return ze}if(K=="@")return E.eatWhile(/[\w\\\-]/),ve("def",E.current());if(K=="="||(K=="~"||K=="|")&&E.eat("="))return ve(null,"compare");if(K=='"'||K=="'")return ee.tokenize=qe(K),ee.tokenize(E,ee);if(K=="#")return E.eatWhile(/[\w\\\-]/),ve("atom","hash");if(K=="!")return E.match(/^\s*\w*/),ve("keyword","important");if(/\d/.test(K)||K=="."&&E.eat(/\d/))return E.eatWhile(/[\w.%]/),ve("number","unit");if(K==="-"){if(/[\d.]/.test(E.peek()))return E.eatWhile(/[\w.%]/),ve("number","unit");if(E.match(/^-[\w\\\-]*/))return E.eatWhile(/[\w\\\-]/),E.match(/^\s*:/,!1)?ve("variable-2","variable-definition"):ve("variable-2","variable");if(E.match(/^\w+-/))return ve("meta","meta")}else return/[,+>*\/]/.test(K)?ve(null,"select-op"):K=="."&&E.match(/^-?[_a-z][_a-z0-9-]*/i)?ve("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(K)?ve(null,K):E.match(/^[\w-.]+(?=\()/)?(/^(url(-prefix)?|domain|regexp)$/i.test(E.current())&&(ee.tokenize=$e),ve("variable callee","variable")):/[\w\\\-]/.test(K)?(E.eatWhile(/[\w\\\-]/),ve("property","word")):ve(null,null)}function qe(E){return function(ee,K){for(var ze=!1,me;(me=ee.next())!=null;){if(me==E&&!ze){E==")"&&ee.backUp(1);break}ze=!ze&&me=="\\"}return(me==E||!ze&&E!=")")&&(K.tokenize=null),ve("string","string")}}function $e(E,ee){return E.next(),E.match(/^\s*[\"\')]/,!1)?ee.tokenize=null:ee.tokenize=qe(")"),ve(null,"(")}function dt(E,ee,K){this.type=E,this.indent=ee,this.prev=K}function Pe(E,ee,K,ze){return E.context=new dt(K,ee.indentation()+(ze===!1?0:F),E.context),K}function _e(E){return E.context.prev&&(E.context=E.context.prev),E.context.type}function Ue(E,ee,K){return Ie[K.context.type](E,ee,K)}function et(E,ee,K,ze){for(var me=ze||1;me>0;me--)K.context=K.context.prev;return Ue(E,ee,K)}function we(E){var ee=E.current().toLowerCase();fe.hasOwnProperty(ee)?Ce="atom":d.hasOwnProperty(ee)?Ce="keyword":Ce="variable"}var Ie={};return Ie.top=function(E,ee,K){if(E=="{")return Pe(K,ee,"block");if(E=="}"&&K.context.prev)return _e(K);if(xe&&/@component/i.test(E))return Pe(K,ee,"atComponentBlock");if(/^@(-moz-)?document$/i.test(E))return Pe(K,ee,"documentTypes");if(/^@(media|supports|(-moz-)?document|import)$/i.test(E))return Pe(K,ee,"atBlock");if(/^@(font-face|counter-style)/i.test(E))return K.stateArg=E,"restricted_atBlock_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/i.test(E))return"keyframes";if(E&&E.charAt(0)=="@")return Pe(K,ee,"at");if(E=="hash")Ce="builtin";else if(E=="word")Ce="tag";else{if(E=="variable-definition")return"maybeprop";if(E=="interpolation")return Pe(K,ee,"interpolation");if(E==":")return"pseudo";if(Te&&E=="(")return Pe(K,ee,"parens")}return K.context.type},Ie.block=function(E,ee,K){if(E=="word"){var ze=ee.current().toLowerCase();return y.hasOwnProperty(ze)?(Ce="property","maybeprop"):j.hasOwnProperty(ze)?(Ce=Me?"string-2":"property","maybeprop"):Te?(Ce=ee.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block"):(Ce+=" error","maybeprop")}else return E=="meta"?"block":!Te&&(E=="hash"||E=="qualifier")?(Ce="error","block"):Ie.top(E,ee,K)},Ie.maybeprop=function(E,ee,K){return E==":"?Pe(K,ee,"prop"):Ue(E,ee,K)},Ie.prop=function(E,ee,K){if(E==";")return _e(K);if(E=="{"&&Te)return Pe(K,ee,"propBlock");if(E=="}"||E=="{")return et(E,ee,K);if(E=="(")return Pe(K,ee,"parens");if(E=="hash"&&!/^#([0-9a-fA-F]{3,4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(ee.current()))Ce+=" error";else if(E=="word")we(ee);else if(E=="interpolation")return Pe(K,ee,"interpolation");return"prop"},Ie.propBlock=function(E,ee,K){return E=="}"?_e(K):E=="word"?(Ce="property","maybeprop"):K.context.type},Ie.parens=function(E,ee,K){return E=="{"||E=="}"?et(E,ee,K):E==")"?_e(K):E=="("?Pe(K,ee,"parens"):E=="interpolation"?Pe(K,ee,"interpolation"):(E=="word"&&we(ee),"parens")},Ie.pseudo=function(E,ee,K){return E=="meta"?"pseudo":E=="word"?(Ce="variable-3",K.context.type):Ue(E,ee,K)},Ie.documentTypes=function(E,ee,K){return E=="word"&&c.hasOwnProperty(ee.current())?(Ce="tag",K.context.type):Ie.atBlock(E,ee,K)},Ie.atBlock=function(E,ee,K){if(E=="(")return Pe(K,ee,"atBlock_parens");if(E=="}"||E==";")return et(E,ee,K);if(E=="{")return _e(K)&&Pe(K,ee,Te?"block":"top");if(E=="interpolation")return Pe(K,ee,"interpolation");if(E=="word"){var ze=ee.current().toLowerCase();ze=="only"||ze=="not"||ze=="and"||ze=="or"?Ce="keyword":T.hasOwnProperty(ze)?Ce="attribute":C.hasOwnProperty(ze)?Ce="property":g.hasOwnProperty(ze)?Ce="keyword":y.hasOwnProperty(ze)?Ce="property":j.hasOwnProperty(ze)?Ce=Me?"string-2":"property":fe.hasOwnProperty(ze)?Ce="atom":d.hasOwnProperty(ze)?Ce="keyword":Ce="error"}return K.context.type},Ie.atComponentBlock=function(E,ee,K){return E=="}"?et(E,ee,K):E=="{"?_e(K)&&Pe(K,ee,Te?"block":"top",!1):(E=="word"&&(Ce="error"),K.context.type)},Ie.atBlock_parens=function(E,ee,K){return E==")"?_e(K):E=="{"||E=="}"?et(E,ee,K,2):Ie.atBlock(E,ee,K)},Ie.restricted_atBlock_before=function(E,ee,K){return E=="{"?Pe(K,ee,"restricted_atBlock"):E=="word"&&K.stateArg=="@counter-style"?(Ce="variable","restricted_atBlock_before"):Ue(E,ee,K)},Ie.restricted_atBlock=function(E,ee,K){return E=="}"?(K.stateArg=null,_e(K)):E=="word"?(K.stateArg=="@font-face"&&!de.hasOwnProperty(ee.current().toLowerCase())||K.stateArg=="@counter-style"&&!v.hasOwnProperty(ee.current().toLowerCase())?Ce="error":Ce="property","maybeprop"):"restricted_atBlock"},Ie.keyframes=function(E,ee,K){return E=="word"?(Ce="variable","keyframes"):E=="{"?Pe(K,ee,"top"):Ue(E,ee,K)},Ie.at=function(E,ee,K){return E==";"?_e(K):E=="{"||E=="}"?et(E,ee,K):(E=="word"?Ce="tag":E=="hash"&&(Ce="builtin"),"at")},Ie.interpolation=function(E,ee,K){return E=="}"?_e(K):E=="{"||E==";"?et(E,ee,K):(E=="word"?Ce="variable":E!="variable"&&E!="("&&E!=")"&&(Ce="error"),"interpolation")},{startState:function(E){return{tokenize:null,state:V?"block":"top",stateArg:null,context:new dt(V?"block":"top",E||0,null)}},token:function(E,ee){if(!ee.tokenize&&E.eatSpace())return null;var K=(ee.tokenize||Oe)(E,ee);return K&&typeof K=="object"&&(Fe=K[1],K=K[0]),Ce=K,Fe!="comment"&&(ee.state=Ie[ee.state](Fe,E,ee)),Ce},indent:function(E,ee){var K=E.context,ze=ee&&ee.charAt(0),me=K.indent;return K.type=="prop"&&(ze=="}"||ze==")")&&(K=K.prev),K.prev&&(ze=="}"&&(K.type=="block"||K.type=="top"||K.type=="interpolation"||K.type=="restricted_atBlock")?(K=K.prev,me=K.indent):(ze==")"&&(K.type=="parens"||K.type=="atBlock_parens")||ze=="{"&&(K.type=="at"||K.type=="atBlock"))&&(me=Math.max(0,K.indent-F))),me},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:le,fold:"brace"}});function pe(J){for(var P={},V=0;V<J.length;++V)P[J[V].toLowerCase()]=!0;return P}var _=["domain","regexp","url","url-prefix"],te=pe(_),oe=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],Q=pe(oe),k=["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid","orientation","device-pixel-ratio","min-device-pixel-ratio","max-device-pixel-ratio","pointer","any-pointer","hover","any-hover","prefers-color-scheme","dynamic-range","video-dynamic-range"],I=pe(k),Y=["landscape","portrait","none","coarse","fine","on-demand","hover","interlace","progressive","dark","light","standard","high"],ne=pe(Y),S=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","all","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","binding","bleed","block-size","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-content","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-gap","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-gap","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","inset","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","left","letter-spacing","line-break","line-height","line-height-step","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","place-content","place-items","place-self","play-during","position","presentation-level","punctuation-trim","quotes","region-break-after","region-break-before","region-break-inside","region-fragment","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotate","rotation","rotation-point","row-gap","ruby-align","ruby-overhang","ruby-position","ruby-span","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-type","shape-image-threshold","shape-inside","shape-margin","shape-outside","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-orientation","text-outline","text-overflow","text-rendering","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","touch-action","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-select","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index","clip-path","clip-rule","mask","enable-background","filter","flood-color","flood-opacity","lighting-color","stop-color","stop-opacity","pointer-events","color-interpolation","color-interpolation-filters","color-rendering","fill","fill-opacity","fill-rule","image-rendering","marker","marker-end","marker-mid","marker-start","paint-order","shape-rendering","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-rendering","baseline-shift","dominant-baseline","glyph-orientation-horizontal","glyph-orientation-vertical","text-anchor","writing-mode"],R=pe(S),A=["accent-color","aspect-ratio","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","content-visibility","margin-block","margin-block-end","margin-block-start","margin-inline","margin-inline-end","margin-inline-start","overflow-anchor","overscroll-behavior","padding-block","padding-block-end","padding-block-start","padding-inline","padding-inline-end","padding-inline-start","scroll-snap-stop","scrollbar-3d-light-color","scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-track-color","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","shape-inside","zoom"],$=pe(A),ue=["font-display","font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"],O=pe(ue),w=["additive-symbols","fallback","negative","pad","prefix","range","speak-as","suffix","symbols","system"],M=pe(w),N=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkgrey","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightgrey","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],z=pe(N),X=["above","absolute","activeborder","additive","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","blur","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","brightness","bullets","button","buttonface","buttonhighlight","buttonshadow","buttontext","calc","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","conic-gradient","contain","content","contents","content-box","context-menu","continuous","contrast","copy","counter","counters","cover","crop","cross","crosshair","cubic-bezier","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","devanagari","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","drop-shadow","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ethiopic-numeric","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","georgian","grayscale","graytext","grid","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hard-light","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","hue","hue-rotate","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","japanese-formal","japanese-informal","justify","kannada","katakana","katakana-iroha","keep-all","khmer","korean-hangul-formal","korean-hanja-formal","korean-hanja-informal","landscape","lao","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","luminosity","malayalam","manipulation","match","matrix","matrix3d","media-play-button","media-slider","media-sliderthumb","media-volume-slider","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","multiple_mask_images","multiply","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","octal","opacity","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeating-conic-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturate","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","self-start","self-end","semi-condensed","semi-expanded","separate","sepia","serif","show","sidama","simp-chinese-formal","simp-chinese-informal","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","somali","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","square-button","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","tamil","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","trad-chinese-formal","trad-chinese-informal","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"],q=pe(X),p=_.concat(oe).concat(k).concat(Y).concat(S).concat(A).concat(N).concat(X);b.registerHelper("hintWords","css",p);function W(J,P){for(var V=!1,F;(F=J.next())!=null;){if(V&&F=="/"){P.tokenize=null;break}V=F=="*"}return["comment","comment"]}b.defineMIME("text/css",{documentTypes:te,mediaTypes:Q,mediaFeatures:I,mediaValueKeywords:ne,propertyKeywords:R,nonStandardPropertyKeywords:$,fontProperties:O,counterDescriptors:M,colorKeywords:z,valueKeywords:q,tokenHooks:{"/":function(J,P){return J.eat("*")?(P.tokenize=W,W(J,P)):!1}},name:"css"}),b.defineMIME("text/x-scss",{mediaTypes:Q,mediaFeatures:I,mediaValueKeywords:ne,propertyKeywords:R,nonStandardPropertyKeywords:$,colorKeywords:z,valueKeywords:q,fontProperties:O,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(J,P){return J.eat("/")?(J.skipToEnd(),["comment","comment"]):J.eat("*")?(P.tokenize=W,W(J,P)):["operator","operator"]},":":function(J){return J.match(/^\s*\{/,!1)?[null,null]:!1},$:function(J){return J.match(/^[\w-]+/),J.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"]},"#":function(J){return J.eat("{")?[null,"interpolation"]:!1}},name:"css",helperType:"scss"}),b.defineMIME("text/x-less",{mediaTypes:Q,mediaFeatures:I,mediaValueKeywords:ne,propertyKeywords:R,nonStandardPropertyKeywords:$,colorKeywords:z,valueKeywords:q,fontProperties:O,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(J,P){return J.eat("/")?(J.skipToEnd(),["comment","comment"]):J.eat("*")?(P.tokenize=W,W(J,P)):["operator","operator"]},"@":function(J){return J.eat("{")?[null,"interpolation"]:J.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/i,!1)?!1:(J.eatWhile(/[\w\\\-]/),J.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"])},"&":function(){return["atom","atom"]}},name:"css",helperType:"less"}),b.defineMIME("text/x-gss",{documentTypes:te,mediaTypes:Q,mediaFeatures:I,propertyKeywords:R,nonStandardPropertyKeywords:$,fontProperties:O,counterDescriptors:M,colorKeywords:z,valueKeywords:q,supportsAtComponent:!0,tokenHooks:{"/":function(J,P){return J.eat("*")?(P.tokenize=W,W(J,P)):!1}},name:"css",helperType:"gss"})})})()),ga.exports}Xa();var ma={exports:{}},xa={exports:{}},ya;function Ya(){return ya||(ya=1,(function(ct,xt){(function(b){b(mt())})(function(b){var pe={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},_={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};b.defineMode("xml",function(te,oe){var Q=te.indentUnit,k={},I=oe.htmlMode?pe:_;for(var Y in I)k[Y]=I[Y];for(var Y in oe)k[Y]=oe[Y];var ne,S;function R(c,T){function C(j){return T.tokenize=j,j(c,T)}var g=c.next();if(g=="<")return c.eat("!")?c.eat("[")?c.match("CDATA[")?C(ue("atom","]]>")):null:c.match("--")?C(ue("comment","-->")):c.match("DOCTYPE",!0,!0)?(c.eatWhile(/[\w\._\-]/),C(O(1))):null:c.eat("?")?(c.eatWhile(/[\w\._\-]/),T.tokenize=ue("meta","?>"),"meta"):(ne=c.eat("/")?"closeTag":"openTag",T.tokenize=A,"tag bracket");if(g=="&"){var y;return c.eat("#")?c.eat("x")?y=c.eatWhile(/[a-fA-F\d]/)&&c.eat(";"):y=c.eatWhile(/[\d]/)&&c.eat(";"):y=c.eatWhile(/[\w\.\-:]/)&&c.eat(";"),y?"atom":"error"}else return c.eatWhile(/[^&<]/),null}R.isInText=!0;function A(c,T){var C=c.next();if(C==">"||C=="/"&&c.eat(">"))return T.tokenize=R,ne=C==">"?"endTag":"selfcloseTag","tag bracket";if(C=="=")return ne="equals",null;if(C=="<"){T.tokenize=R,T.state=X,T.tagName=T.tagStart=null;var g=T.tokenize(c,T);return g?g+" tag error":"tag error"}else return/[\'\"]/.test(C)?(T.tokenize=$(C),T.stringStartCol=c.column(),T.tokenize(c,T)):(c.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function $(c){var T=function(C,g){for(;!C.eol();)if(C.next()==c){g.tokenize=A;break}return"string"};return T.isInAttribute=!0,T}function ue(c,T){return function(C,g){for(;!C.eol();){if(C.match(T)){g.tokenize=R;break}C.next()}return c}}function O(c){return function(T,C){for(var g;(g=T.next())!=null;){if(g=="<")return C.tokenize=O(c+1),C.tokenize(T,C);if(g==">")if(c==1){C.tokenize=R;break}else return C.tokenize=O(c-1),C.tokenize(T,C)}return"meta"}}function w(c){return c&&c.toLowerCase()}function M(c,T,C){this.prev=c.context,this.tagName=T||"",this.indent=c.indented,this.startOfLine=C,(k.doNotIndent.hasOwnProperty(T)||c.context&&c.context.noIndent)&&(this.noIndent=!0)}function N(c){c.context&&(c.context=c.context.prev)}function z(c,T){for(var C;;){if(!c.context||(C=c.context.tagName,!k.contextGrabbers.hasOwnProperty(w(C))||!k.contextGrabbers[w(C)].hasOwnProperty(w(T))))return;N(c)}}function X(c,T,C){return c=="openTag"?(C.tagStart=T.column(),q):c=="closeTag"?p:X}function q(c,T,C){return c=="word"?(C.tagName=T.current(),S="tag",P):k.allowMissingTagName&&c=="endTag"?(S="tag bracket",P(c,T,C)):(S="error",q)}function p(c,T,C){if(c=="word"){var g=T.current();return C.context&&C.context.tagName!=g&&k.implicitlyClosed.hasOwnProperty(w(C.context.tagName))&&N(C),C.context&&C.context.tagName==g||k.matchClosing===!1?(S="tag",W):(S="tag error",J)}else return k.allowMissingTagName&&c=="endTag"?(S="tag bracket",W(c,T,C)):(S="error",J)}function W(c,T,C){return c!="endTag"?(S="error",W):(N(C),X)}function J(c,T,C){return S="error",W(c,T,C)}function P(c,T,C){if(c=="word")return S="attribute",V;if(c=="endTag"||c=="selfcloseTag"){var g=C.tagName,y=C.tagStart;return C.tagName=C.tagStart=null,c=="selfcloseTag"||k.autoSelfClosers.hasOwnProperty(w(g))?z(C,g):(z(C,g),C.context=new M(C,g,y==C.indented)),X}return S="error",P}function V(c,T,C){return c=="equals"?F:(k.allowMissing||(S="error"),P(c,T,C))}function F(c,T,C){return c=="string"?G:c=="word"&&k.allowUnquoted?(S="string",P):(S="error",P(c,T,C))}function G(c,T,C){return c=="string"?G:P(c,T,C)}return{startState:function(c){var T={tokenize:R,state:X,indented:c||0,tagName:null,tagStart:null,context:null};return c!=null&&(T.baseIndent=c),T},token:function(c,T){if(!T.tagName&&c.sol()&&(T.indented=c.indentation()),c.eatSpace())return null;ne=null;var C=T.tokenize(c,T);return(C||ne)&&C!="comment"&&(S=null,T.state=T.state(ne||C,c,T),S&&(C=S=="error"?C+" error":S)),C},indent:function(c,T,C){var g=c.context;if(c.tokenize.isInAttribute)return c.tagStart==c.indented?c.stringStartCol+1:c.indented+Q;if(g&&g.noIndent)return b.Pass;if(c.tokenize!=A&&c.tokenize!=R)return C?C.match(/^(\s*)/)[0].length:0;if(c.tagName)return k.multilineTagIndentPastTag!==!1?c.tagStart+c.tagName.length+2:c.tagStart+Q*(k.multilineTagIndentFactor||1);if(k.alignCDATA&&/<!\[CDATA\[/.test(T))return 0;var y=T&&/^<(\/)?([\w_:\.-]*)/.exec(T);if(y&&y[1])for(;g;)if(g.tagName==y[2]){g=g.prev;break}else if(k.implicitlyClosed.hasOwnProperty(w(g.tagName)))g=g.prev;else break;else if(y)for(;g;){var j=k.contextGrabbers[w(g.tagName)];if(j&&j.hasOwnProperty(w(y[2])))g=g.prev;else break}for(;g&&g.prev&&!g.startOfLine;)g=g.prev;return g?g.indent+Q:c.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:k.htmlMode?"html":"xml",helperType:k.htmlMode?"html":"xml",skipAttribute:function(c){c.state==F&&(c.state=P)},xmlCurrentTag:function(c){return c.tagName?{name:c.tagName,close:c.type=="closeTag"}:null},xmlCurrentContext:function(c){for(var T=[],C=c.context;C;C=C.prev)T.push(C.tagName);return T.reverse()}}}),b.defineMIME("text/xml","xml"),b.defineMIME("application/xml","xml"),b.mimeModes.hasOwnProperty("text/html")||b.defineMIME("text/html",{name:"xml",htmlMode:!0})})})()),xa.exports}var ba={exports:{}},ka;function Qa(){return ka||(ka=1,(function(ct,xt){(function(b){b(mt())})(function(b){b.defineMode("javascript",function(pe,_){var te=pe.indentUnit,oe=_.statementIndent,Q=_.jsonld,k=_.json||Q,I=_.trackScope!==!1,Y=_.typescript,ne=_.wordCharacters||/[\w$\xa1-\uffff]/,S=(function(){function f(it){return{type:it,style:"keyword"}}var m=f("keyword a"),U=f("keyword b"),re=f("keyword c"),B=f("keyword d"),ce=f("operator"),We={type:"atom",style:"atom"};return{if:f("if"),while:m,with:m,else:U,do:U,try:U,finally:U,return:B,break:B,continue:B,new:f("new"),delete:re,void:re,throw:re,debugger:f("debugger"),var:f("var"),const:f("var"),let:f("var"),function:f("function"),catch:f("catch"),for:f("for"),switch:f("switch"),case:f("case"),default:f("default"),in:ce,typeof:ce,instanceof:ce,true:We,false:We,null:We,undefined:We,NaN:We,Infinity:We,this:f("this"),class:f("class"),super:f("atom"),yield:re,export:f("export"),import:f("import"),extends:re,await:re}})(),R=/[+\-*&%=<>!?|~^@]/,A=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function $(f){for(var m=!1,U,re=!1;(U=f.next())!=null;){if(!m){if(U=="/"&&!re)return;U=="["?re=!0:re&&U=="]"&&(re=!1)}m=!m&&U=="\\"}}var ue,O;function w(f,m,U){return ue=f,O=U,m}function M(f,m){var U=f.next();if(U=='"'||U=="'")return m.tokenize=N(U),m.tokenize(f,m);if(U=="."&&f.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return w("number","number");if(U=="."&&f.match(".."))return w("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(U))return w(U);if(U=="="&&f.eat(">"))return w("=>","operator");if(U=="0"&&f.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return w("number","number");if(/\d/.test(U))return f.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),w("number","number");if(U=="/")return f.eat("*")?(m.tokenize=z,z(f,m)):f.eat("/")?(f.skipToEnd(),w("comment","comment")):Et(f,m,1)?($(f),f.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),w("regexp","string-2")):(f.eat("="),w("operator","operator",f.current()));if(U=="`")return m.tokenize=X,X(f,m);if(U=="#"&&f.peek()=="!")return f.skipToEnd(),w("meta","meta");if(U=="#"&&f.eatWhile(ne))return w("variable","property");if(U=="<"&&f.match("!--")||U=="-"&&f.match("->")&&!/\S/.test(f.string.slice(0,f.start)))return f.skipToEnd(),w("comment","comment");if(R.test(U))return(U!=">"||!m.lexical||m.lexical.type!=">")&&(f.eat("=")?(U=="!"||U=="=")&&f.eat("="):/[<>*+\-|&?]/.test(U)&&(f.eat(U),U==">"&&f.eat(U))),U=="?"&&f.eat(".")?w("."):w("operator","operator",f.current());if(ne.test(U)){f.eatWhile(ne);var re=f.current();if(m.lastType!="."){if(S.propertyIsEnumerable(re)){var B=S[re];return w(B.type,B.style,re)}if(re=="async"&&f.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/,!1))return w("async","keyword",re)}return w("variable","variable",re)}}function N(f){return function(m,U){var re=!1,B;if(Q&&m.peek()=="@"&&m.match(A))return U.tokenize=M,w("jsonld-keyword","meta");for(;(B=m.next())!=null&&!(B==f&&!re);)re=!re&&B=="\\";return re||(U.tokenize=M),w("string","string")}}function z(f,m){for(var U=!1,re;re=f.next();){if(re=="/"&&U){m.tokenize=M;break}U=re=="*"}return w("comment","comment")}function X(f,m){for(var U=!1,re;(re=f.next())!=null;){if(!U&&(re=="`"||re=="$"&&f.eat("{"))){m.tokenize=M;break}U=!U&&re=="\\"}return w("quasi","string-2",f.current())}var q="([{}])";function p(f,m){m.fatArrowAt&&(m.fatArrowAt=null);var U=f.string.indexOf("=>",f.start);if(!(U<0)){if(Y){var re=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(f.string.slice(f.start,U));re&&(U=re.index)}for(var B=0,ce=!1,We=U-1;We>=0;--We){var it=f.string.charAt(We),wt=q.indexOf(it);if(wt>=0&&wt<3){if(!B){++We;break}if(--B==0){it=="("&&(ce=!0);break}}else if(wt>=3&&wt<6)++B;else if(ne.test(it))ce=!0;else if(/["'\/`]/.test(it))for(;;--We){if(We==0)return;var Wr=f.string.charAt(We-1);if(Wr==it&&f.string.charAt(We-2)!="\\"){We--;break}}else if(ce&&!B){++We;break}}ce&&!B&&(m.fatArrowAt=We)}}var W={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,import:!0,"jsonld-keyword":!0};function J(f,m,U,re,B,ce){this.indented=f,this.column=m,this.type=U,this.prev=B,this.info=ce,re!=null&&(this.align=re)}function P(f,m){if(!I)return!1;for(var U=f.localVars;U;U=U.next)if(U.name==m)return!0;for(var re=f.context;re;re=re.prev)for(var U=re.vars;U;U=U.next)if(U.name==m)return!0}function V(f,m,U,re,B){var ce=f.cc;for(F.state=f,F.stream=B,F.marked=null,F.cc=ce,F.style=m,f.lexical.hasOwnProperty("align")||(f.lexical.align=!0);;){var We=ce.length?ce.pop():k?ve:Fe;if(We(U,re)){for(;ce.length&&ce[ce.length-1].lex;)ce.pop()();return F.marked?F.marked:U=="variable"&&P(f,re)?"variable-2":m}}}var F={state:null,marked:null,cc:null};function G(){for(var f=arguments.length-1;f>=0;f--)F.cc.push(arguments[f])}function c(){return G.apply(null,arguments),!0}function T(f,m){for(var U=m;U;U=U.next)if(U.name==f)return!0;return!1}function C(f){var m=F.state;if(F.marked="def",!!I){if(m.context){if(m.lexical.info=="var"&&m.context&&m.context.block){var U=g(f,m.context);if(U!=null){m.context=U;return}}else if(!T(f,m.localVars)){m.localVars=new de(f,m.localVars);return}}_.globalVars&&!T(f,m.globalVars)&&(m.globalVars=new de(f,m.globalVars))}}function g(f,m){if(m)if(m.block){var U=g(f,m.prev);return U?U==m.prev?m:new j(U,m.vars,!0):null}else return T(f,m.vars)?m:new j(m.prev,new de(f,m.vars),!1);else return null}function y(f){return f=="public"||f=="private"||f=="protected"||f=="abstract"||f=="readonly"}function j(f,m,U){this.prev=f,this.vars=m,this.block=U}function de(f,m){this.name=f,this.next=m}var v=new de("this",new de("arguments",null));function d(){F.state.context=new j(F.state.context,F.state.localVars,!1),F.state.localVars=v}function fe(){F.state.context=new j(F.state.context,F.state.localVars,!0),F.state.localVars=null}d.lex=fe.lex=!0;function Te(){F.state.localVars=F.state.context.vars,F.state.context=F.state.context.prev}Te.lex=!0;function le(f,m){var U=function(){var re=F.state,B=re.indented;if(re.lexical.type=="stat")B=re.lexical.indented;else for(var ce=re.lexical;ce&&ce.type==")"&&ce.align;ce=ce.prev)B=ce.indented;re.lexical=new J(B,F.stream.column(),f,null,re.lexical,m)};return U.lex=!0,U}function xe(){var f=F.state;f.lexical.prev&&(f.lexical.type==")"&&(f.indented=f.lexical.indented),f.lexical=f.lexical.prev)}xe.lex=!0;function Me(f){function m(U){return U==f?c():f==";"||U=="}"||U==")"||U=="]"?G():c(m)}return m}function Fe(f,m){return f=="var"?c(le("vardef",m),Er,Me(";"),xe):f=="keyword a"?c(le("form"),qe,Fe,xe):f=="keyword b"?c(le("form"),Fe,xe):f=="keyword d"?F.stream.match(/^\s*$/,!1)?c():c(le("stat"),dt,Me(";"),xe):f=="debugger"?c(Me(";")):f=="{"?c(le("}"),fe,Pt,xe,Te):f==";"?c():f=="if"?(F.state.lexical.info=="else"&&F.state.cc[F.state.cc.length-1]==xe&&F.state.cc.pop()(),c(le("form"),qe,Fe,xe,Or)):f=="function"?c(zt):f=="for"?c(le("form"),fe,Rn,Fe,Te,xe):f=="class"||Y&&m=="interface"?(F.marked="keyword",c(le("form",f=="class"?f:m),Pr,xe)):f=="variable"?Y&&m=="declare"?(F.marked="keyword",c(Fe)):Y&&(m=="module"||m=="enum"||m=="type")&&F.stream.match(/^\s*\w/,!1)?(F.marked="keyword",m=="enum"?c(ye):m=="type"?c(Wn,Me("operator"),Re,Me(";")):c(le("form"),kt,Me("{"),le("}"),Pt,xe,xe)):Y&&m=="namespace"?(F.marked="keyword",c(le("form"),ve,Fe,xe)):Y&&m=="abstract"?(F.marked="keyword",c(Fe)):c(le("stat"),ze):f=="switch"?c(le("form"),qe,Me("{"),le("}","switch"),fe,Pt,xe,xe,Te):f=="case"?c(ve,Me(":")):f=="default"?c(Me(":")):f=="catch"?c(le("form"),d,Ce,Fe,xe,Te):f=="export"?c(le("stat"),Ir,xe):f=="import"?c(le("stat"),fr,xe):f=="async"?c(Fe):m=="@"?c(ve,Fe):G(le("stat"),ve,Me(";"),xe)}function Ce(f){if(f=="(")return c(Wt,Me(")"))}function ve(f,m){return $e(f,m,!1)}function Oe(f,m){return $e(f,m,!0)}function qe(f){return f!="("?G():c(le(")"),dt,Me(")"),xe)}function $e(f,m,U){if(F.state.fatArrowAt==F.stream.start){var re=U?Ie:we;if(f=="(")return c(d,le(")"),Ne(Wt,")"),xe,Me("=>"),re,Te);if(f=="variable")return G(d,kt,Me("=>"),re,Te)}var B=U?_e:Pe;return W.hasOwnProperty(f)?c(B):f=="function"?c(zt,B):f=="class"||Y&&m=="interface"?(F.marked="keyword",c(le("form"),yi,xe)):f=="keyword c"||f=="async"?c(U?Oe:ve):f=="("?c(le(")"),dt,Me(")"),xe,B):f=="operator"||f=="spread"?c(U?Oe:ve):f=="["?c(le("]"),Je,xe,B):f=="{"?Mt(De,"}",null,B):f=="quasi"?G(Ue,B):f=="new"?c(E(U)):c()}function dt(f){return f.match(/[;\}\)\],]/)?G():G(ve)}function Pe(f,m){return f==","?c(dt):_e(f,m,!1)}function _e(f,m,U){var re=U==!1?Pe:_e,B=U==!1?ve:Oe;if(f=="=>")return c(d,U?Ie:we,Te);if(f=="operator")return/\+\+|--/.test(m)||Y&&m=="!"?c(re):Y&&m=="<"&&F.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,!1)?c(le(">"),Ne(Re,">"),xe,re):m=="?"?c(ve,Me(":"),B):c(B);if(f=="quasi")return G(Ue,re);if(f!=";"){if(f=="(")return Mt(Oe,")","call",re);if(f==".")return c(me,re);if(f=="[")return c(le("]"),dt,Me("]"),xe,re);if(Y&&m=="as")return F.marked="keyword",c(Re,re);if(f=="regexp")return F.state.lastType=F.marked="operator",F.stream.backUp(F.stream.pos-F.stream.start-1),c(B)}}function Ue(f,m){return f!="quasi"?G():m.slice(m.length-2)!="${"?c(Ue):c(dt,et)}function et(f){if(f=="}")return F.marked="string-2",F.state.tokenize=X,c(Ue)}function we(f){return p(F.stream,F.state),G(f=="{"?Fe:ve)}function Ie(f){return p(F.stream,F.state),G(f=="{"?Fe:Oe)}function E(f){return function(m){return m=="."?c(f?K:ee):m=="variable"&&Y?c(Ft,f?_e:Pe):G(f?Oe:ve)}}function ee(f,m){if(m=="target")return F.marked="keyword",c(Pe)}function K(f,m){if(m=="target")return F.marked="keyword",c(_e)}function ze(f){return f==":"?c(xe,Fe):G(Pe,Me(";"),xe)}function me(f){if(f=="variable")return F.marked="property",c()}function De(f,m){if(f=="async")return F.marked="property",c(De);if(f=="variable"||F.style=="keyword"){if(F.marked="property",m=="get"||m=="set")return c(be);var U;return Y&&F.state.fatArrowAt==F.stream.start&&(U=F.stream.match(/^\s*:\s*/,!1))&&(F.state.fatArrowAt=F.stream.pos+U[0].length),c(Be)}else{if(f=="number"||f=="string")return F.marked=Q?"property":F.style+" property",c(Be);if(f=="jsonld-keyword")return c(Be);if(Y&&y(m))return F.marked="keyword",c(De);if(f=="[")return c(ve,or,Me("]"),Be);if(f=="spread")return c(Oe,Be);if(m=="*")return F.marked="keyword",c(De);if(f==":")return G(Be)}}function be(f){return f!="variable"?G(Be):(F.marked="property",c(zt))}function Be(f){if(f==":")return c(Oe);if(f=="(")return G(zt)}function Ne(f,m,U){function re(B,ce){if(U?U.indexOf(B)>-1:B==","){var We=F.state.lexical;return We.info=="call"&&(We.pos=(We.pos||0)+1),c(function(it,wt){return it==m||wt==m?G():G(f)},re)}return B==m||ce==m?c():U&&U.indexOf(";")>-1?G(f):c(Me(m))}return function(B,ce){return B==m||ce==m?c():G(f,re)}}function Mt(f,m,U){for(var re=3;re<arguments.length;re++)F.cc.push(arguments[re]);return c(le(m,U),Ne(f,m),xe)}function Pt(f){return f=="}"?c():G(Fe,Pt)}function or(f,m){if(Y){if(f==":")return c(Re);if(m=="?")return c(or)}}function br(f,m){if(Y&&(f==":"||m=="in"))return c(Re)}function lr(f){if(Y&&f==":")return F.stream.match(/^\s*\w+\s+is\b/,!1)?c(ve,mi,Re):c(Re)}function mi(f,m){if(m=="is")return F.marked="keyword",c()}function Re(f,m){if(m=="keyof"||m=="typeof"||m=="infer"||m=="readonly")return F.marked="keyword",c(m=="typeof"?Oe:Re);if(f=="variable"||m=="void")return F.marked="type",c(It);if(m=="|"||m=="&")return c(Re);if(f=="string"||f=="number"||f=="atom")return c(It);if(f=="[")return c(le("]"),Ne(Re,"]",","),xe,It);if(f=="{")return c(le("}"),Se,xe,It);if(f=="(")return c(Ne(Qe,")"),Bn,It);if(f=="<")return c(Ne(Re,">"),Re);if(f=="quasi")return G(ht,It)}function Bn(f){if(f=="=>")return c(Re)}function Se(f){return f.match(/[\}\)\]]/)?c():f==","||f==";"?c(Se):G(Zt,Se)}function Zt(f,m){if(f=="variable"||F.style=="keyword")return F.marked="property",c(Zt);if(m=="?"||f=="number"||f=="string")return c(Zt);if(f==":")return c(Re);if(f=="[")return c(Me("variable"),br,Me("]"),Zt);if(f=="(")return G(ur,Zt);if(!f.match(/[;\}\)\],]/))return c()}function ht(f,m){return f!="quasi"?G():m.slice(m.length-2)!="${"?c(ht):c(Re,Ye)}function Ye(f){if(f=="}")return F.marked="string-2",F.state.tokenize=X,c(ht)}function Qe(f,m){return f=="variable"&&F.stream.match(/^\s*[?:]/,!1)||m=="?"?c(Qe):f==":"?c(Re):f=="spread"?c(Qe):G(Re)}function It(f,m){if(m=="<")return c(le(">"),Ne(Re,">"),xe,It);if(m=="|"||f=="."||m=="&")return c(Re);if(f=="[")return c(Re,Me("]"),It);if(m=="extends"||m=="implements")return F.marked="keyword",c(Re);if(m=="?")return c(Re,Me(":"),Re)}function Ft(f,m){if(m=="<")return c(le(">"),Ne(Re,">"),xe,It)}function Bt(){return G(Re,pt)}function pt(f,m){if(m=="=")return c(Re)}function Er(f,m){return m=="enum"?(F.marked="keyword",c(ye)):G(kt,or,Rt,xi)}function kt(f,m){if(Y&&y(m))return F.marked="keyword",c(kt);if(f=="variable")return C(m),c();if(f=="spread")return c(kt);if(f=="[")return Mt(ln,"]");if(f=="{")return Mt(ar,"}")}function ar(f,m){return f=="variable"&&!F.stream.match(/^\s*:/,!1)?(C(m),c(Rt)):(f=="variable"&&(F.marked="property"),f=="spread"?c(kt):f=="}"?G():f=="["?c(ve,Me("]"),Me(":"),ar):c(Me(":"),kt,Rt))}function ln(){return G(kt,Rt)}function Rt(f,m){if(m=="=")return c(Oe)}function xi(f){if(f==",")return c(Er)}function Or(f,m){if(f=="keyword b"&&m=="else")return c(le("form","else"),Fe,xe)}function Rn(f,m){if(m=="await")return c(Rn);if(f=="(")return c(le(")"),an,xe)}function an(f){return f=="var"?c(Er,sr):f=="variable"?c(sr):G(sr)}function sr(f,m){return f==")"?c():f==";"?c(sr):m=="in"||m=="of"?(F.marked="keyword",c(ve,sr)):G(ve,sr)}function zt(f,m){if(m=="*")return F.marked="keyword",c(zt);if(f=="variable")return C(m),c(zt);if(f=="(")return c(d,le(")"),Ne(Wt,")"),xe,lr,Fe,Te);if(Y&&m=="<")return c(le(">"),Ne(Bt,">"),xe,zt)}function ur(f,m){if(m=="*")return F.marked="keyword",c(ur);if(f=="variable")return C(m),c(ur);if(f=="(")return c(d,le(")"),Ne(Wt,")"),xe,lr,Te);if(Y&&m=="<")return c(le(">"),Ne(Bt,">"),xe,ur)}function Wn(f,m){if(f=="keyword"||f=="variable")return F.marked="type",c(Wn);if(m=="<")return c(le(">"),Ne(Bt,">"),xe)}function Wt(f,m){return m=="@"&&c(ve,Wt),f=="spread"?c(Wt):Y&&y(m)?(F.marked="keyword",c(Wt)):Y&&f=="this"?c(or,Rt):G(kt,or,Rt)}function yi(f,m){return f=="variable"?Pr(f,m):Ht(f,m)}function Pr(f,m){if(f=="variable")return C(m),c(Ht)}function Ht(f,m){if(m=="<")return c(le(">"),Ne(Bt,">"),xe,Ht);if(m=="extends"||m=="implements"||Y&&f==",")return m=="implements"&&(F.marked="keyword"),c(Y?Re:ve,Ht);if(f=="{")return c(le("}"),_t,xe)}function _t(f,m){if(f=="async"||f=="variable"&&(m=="static"||m=="get"||m=="set"||Y&&y(m))&&F.stream.match(/^\s+#?[\w$\xa1-\uffff]/,!1))return F.marked="keyword",c(_t);if(f=="variable"||F.style=="keyword")return F.marked="property",c(kr,_t);if(f=="number"||f=="string")return c(kr,_t);if(f=="[")return c(ve,or,Me("]"),kr,_t);if(m=="*")return F.marked="keyword",c(_t);if(Y&&f=="(")return G(ur,_t);if(f==";"||f==",")return c(_t);if(f=="}")return c();if(m=="@")return c(ve,_t)}function kr(f,m){if(m=="!"||m=="?")return c(kr);if(f==":")return c(Re,Rt);if(m=="=")return c(Oe);var U=F.state.lexical.prev,re=U&&U.info=="interface";return G(re?ur:zt)}function Ir(f,m){return m=="*"?(F.marked="keyword",c(Rr,Me(";"))):m=="default"?(F.marked="keyword",c(ve,Me(";"))):f=="{"?c(Ne(zr,"}"),Rr,Me(";")):G(Fe)}function zr(f,m){if(m=="as")return F.marked="keyword",c(Me("variable"));if(f=="variable")return G(Oe,zr)}function fr(f){return f=="string"?c():f=="("?G(ve):f=="."?G(Pe):G(Br,Gt,Rr)}function Br(f,m){return f=="{"?Mt(Br,"}"):(f=="variable"&&C(m),m=="*"&&(F.marked="keyword"),c(sn))}function Gt(f){if(f==",")return c(Br,Gt)}function sn(f,m){if(m=="as")return F.marked="keyword",c(Br)}function Rr(f,m){if(m=="from")return F.marked="keyword",c(ve)}function Je(f){return f=="]"?c():G(Ne(Oe,"]"))}function ye(){return G(le("form"),kt,Me("{"),le("}"),Ne($t,"}"),xe,xe)}function $t(){return G(kt,Rt)}function un(f,m){return f.lastType=="operator"||f.lastType==","||R.test(m.charAt(0))||/[,.]/.test(m.charAt(0))}function Et(f,m,U){return m.tokenize==M&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(m.lastType)||m.lastType=="quasi"&&/\{\s*$/.test(f.string.slice(0,f.pos-(U||0)))}return{startState:function(f){var m={tokenize:M,lastType:"sof",cc:[],lexical:new J((f||0)-te,0,"block",!1),localVars:_.localVars,context:_.localVars&&new j(null,null,!1),indented:f||0};return _.globalVars&&typeof _.globalVars=="object"&&(m.globalVars=_.globalVars),m},token:function(f,m){if(f.sol()&&(m.lexical.hasOwnProperty("align")||(m.lexical.align=!1),m.indented=f.indentation(),p(f,m)),m.tokenize!=z&&f.eatSpace())return null;var U=m.tokenize(f,m);return ue=="comment"?U:(m.lastType=ue=="operator"&&(O=="++"||O=="--")?"incdec":ue,V(m,U,ue,O,f))},indent:function(f,m){if(f.tokenize==z||f.tokenize==X)return b.Pass;if(f.tokenize!=M)return 0;var U=m&&m.charAt(0),re=f.lexical,B;if(!/^\s*else\b/.test(m))for(var ce=f.cc.length-1;ce>=0;--ce){var We=f.cc[ce];if(We==xe)re=re.prev;else if(We!=Or&&We!=Te)break}for(;(re.type=="stat"||re.type=="form")&&(U=="}"||(B=f.cc[f.cc.length-1])&&(B==Pe||B==_e)&&!/^[,\.=+\-*:?[\(]/.test(m));)re=re.prev;oe&&re.type==")"&&re.prev.type=="stat"&&(re=re.prev);var it=re.type,wt=U==it;return it=="vardef"?re.indented+(f.lastType=="operator"||f.lastType==","?re.info.length+1:0):it=="form"&&U=="{"?re.indented:it=="form"?re.indented+te:it=="stat"?re.indented+(un(f,m)?oe||te:0):re.info=="switch"&&!wt&&_.doubleIndentSwitch!=!1?re.indented+(/^(?:case|default)\b/.test(m)?te:2*te):re.align?re.column+(wt?0:1):re.indented+(wt?0:te)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:k?null:"/*",blockCommentEnd:k?null:"*/",blockCommentContinue:k?null:" * ",lineComment:k?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:k?"json":"javascript",jsonldMode:Q,jsonMode:k,expressionAllowed:Et,skipExpression:function(f){V(f,"atom","atom","true",new b.StringStream("",2,null))}}}),b.registerHelper("wordChars","javascript",/[\w$]/),b.defineMIME("text/javascript","javascript"),b.defineMIME("text/ecmascript","javascript"),b.defineMIME("application/javascript","javascript"),b.defineMIME("application/x-javascript","javascript"),b.defineMIME("application/ecmascript","javascript"),b.defineMIME("application/json",{name:"javascript",json:!0}),b.defineMIME("application/x-json",{name:"javascript",json:!0}),b.defineMIME("application/manifest+json",{name:"javascript",json:!0}),b.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),b.defineMIME("text/typescript",{name:"javascript",typescript:!0}),b.defineMIME("application/typescript",{name:"javascript",typescript:!0})})})()),ba.exports}var wa;function Vu(){return wa||(wa=1,(function(ct,xt){(function(b){b(mt(),Ya(),Qa(),Xa())})(function(b){var pe={script:[["lang",/(javascript|babel)/i,"javascript"],["type",/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i,"javascript"],["type",/./,"text/plain"],[null,null,"javascript"]],style:[["lang",/^css$/i,"css"],["type",/^(text\/)?(x-)?(stylesheet|css)$/i,"css"],["type",/./,"text/plain"],[null,null,"css"]]};function _(ne,S,R){var A=ne.current(),$=A.search(S);return $>-1?ne.backUp(A.length-$):A.match(/<\/?$/)&&(ne.backUp(A.length),ne.match(S,!1)||ne.match(A)),R}var te={};function oe(ne){var S=te[ne];return S||(te[ne]=new RegExp("\\s+"+ne+`\\s*=\\s*('|")?([^'"]+)('|")?\\s*`))}function Q(ne,S){var R=ne.match(oe(S));return R?/^\s*(.*?)\s*$/.exec(R[2])[1]:""}function k(ne,S){return new RegExp((S?"^":"")+"</\\s*"+ne+"\\s*>","i")}function I(ne,S){for(var R in ne)for(var A=S[R]||(S[R]=[]),$=ne[R],ue=$.length-1;ue>=0;ue--)A.unshift($[ue])}function Y(ne,S){for(var R=0;R<ne.length;R++){var A=ne[R];if(!A[0]||A[1].test(Q(S,A[0])))return A[2]}}b.defineMode("htmlmixed",function(ne,S){var R=b.getMode(ne,{name:"xml",htmlMode:!0,multilineTagIndentFactor:S.multilineTagIndentFactor,multilineTagIndentPastTag:S.multilineTagIndentPastTag,allowMissingTagName:S.allowMissingTagName}),A={},$=S&&S.tags,ue=S&&S.scriptTypes;if(I(pe,A),$&&I($,A),ue)for(var O=ue.length-1;O>=0;O--)A.script.unshift(["type",ue[O].matches,ue[O].mode]);function w(M,N){var z=R.token(M,N.htmlState),X=/\btag\b/.test(z),q;if(X&&!/[<>\s\/]/.test(M.current())&&(q=N.htmlState.tagName&&N.htmlState.tagName.toLowerCase())&&A.hasOwnProperty(q))N.inTag=q+" ";else if(N.inTag&&X&&/>$/.test(M.current())){var p=/^([\S]+) (.*)/.exec(N.inTag);N.inTag=null;var W=M.current()==">"&&Y(A[p[1]],p[2]),J=b.getMode(ne,W),P=k(p[1],!0),V=k(p[1],!1);N.token=function(F,G){return F.match(P,!1)?(G.token=w,G.localState=G.localMode=null,null):_(F,V,G.localMode.token(F,G.localState))},N.localMode=J,N.localState=b.startState(J,R.indent(N.htmlState,"",""))}else N.inTag&&(N.inTag+=M.current(),M.eol()&&(N.inTag+=" "));return z}return{startState:function(){var M=b.startState(R);return{token:w,inTag:null,localMode:null,localState:null,htmlState:M}},copyState:function(M){var N;return M.localState&&(N=b.copyState(M.localMode,M.localState)),{token:M.token,inTag:M.inTag,localMode:M.localMode,localState:N,htmlState:b.copyState(R,M.htmlState)}},token:function(M,N){return N.token(M,N)},indent:function(M,N,z){return!M.localMode||/^\s*<\//.test(N)?R.indent(M.htmlState,N,z):M.localMode.indent?M.localMode.indent(M.localState,N,z):b.Pass},innerMode:function(M){return{state:M.localState||M.htmlState,mode:M.localMode||R}}}},"xml","javascript","css"),b.defineMIME("text/html","htmlmixed")})})()),ma.exports}Vu();Qa();var Sa={exports:{}},La;function ef(){return La||(La=1,(function(ct,xt){(function(b){b(mt())})(function(b){function pe(I){return new RegExp("^(("+I.join(")|(")+"))\\b")}var _=pe(["and","or","not","is"]),te=["as","assert","break","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","lambda","pass","raise","return","try","while","with","yield","in","False","True"],oe=["abs","all","any","bin","bool","bytearray","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip","__import__","NotImplemented","Ellipsis","__debug__"];b.registerHelper("hintWords","python",te.concat(oe).concat(["exec","print"]));function Q(I){return I.scopes[I.scopes.length-1]}b.defineMode("python",function(I,Y){for(var ne="error",S=Y.delimiters||Y.singleDelimiters||/^[\(\)\[\]\{\}@,:`=;\.\\]/,R=[Y.singleOperators,Y.doubleOperators,Y.doubleDelimiters,Y.tripleDelimiters,Y.operators||/^([-+*/%\/&|^]=?|[<>=]+|\/\/=?|\*\*=?|!=|[~!@]|\.\.\.)/],A=0;A<R.length;A++)R[A]||R.splice(A--,1);var $=Y.hangingIndent||I.indentUnit,ue=te,O=oe;Y.extra_keywords!=null&&(ue=ue.concat(Y.extra_keywords)),Y.extra_builtins!=null&&(O=O.concat(Y.extra_builtins));var w=!(Y.version&&Number(Y.version)<3);if(w){var M=Y.identifiers||/^[_A-Za-z\u00A1-\uFFFF][_A-Za-z0-9\u00A1-\uFFFF]*/;ue=ue.concat(["nonlocal","None","aiter","anext","async","await","breakpoint","match","case"]),O=O.concat(["ascii","bytes","exec","print"]);var N=new RegExp(`^(([rbuf]|(br)|(rb)|(fr)|(rf))?('{3}|"{3}|['"]))`,"i")}else{var M=Y.identifiers||/^[_A-Za-z][_A-Za-z0-9]*/;ue=ue.concat(["exec","print"]),O=O.concat(["apply","basestring","buffer","cmp","coerce","execfile","file","intern","long","raw_input","reduce","reload","unichr","unicode","xrange","None"]);var N=new RegExp(`^(([rubf]|(ur)|(br))?('{3}|"{3}|['"]))`,"i")}var z=pe(ue),X=pe(O);function q(T,C){var g=T.sol()&&C.lastToken!="\\";if(g&&(C.indent=T.indentation()),g&&Q(C).type=="py"){var y=Q(C).offset;if(T.eatSpace()){var j=T.indentation();return j>y?P(C):j<y&&F(T,C)&&T.peek()!="#"&&(C.errorToken=!0),null}else{var de=p(T,C);return y>0&&F(T,C)&&(de+=" "+ne),de}}return p(T,C)}function p(T,C,g){if(T.eatSpace())return null;if(!g&&T.match(/^#.*/))return"comment";if(T.match(/^[0-9\.]/,!1)){var y=!1;if(T.match(/^[\d_]*\.\d+(e[\+\-]?\d+)?/i)&&(y=!0),T.match(/^[\d_]+\.\d*/)&&(y=!0),T.match(/^\.\d+/)&&(y=!0),y)return T.eat(/J/i),"number";var j=!1;if(T.match(/^0x[0-9a-f_]+/i)&&(j=!0),T.match(/^0b[01_]+/i)&&(j=!0),T.match(/^0o[0-7_]+/i)&&(j=!0),T.match(/^[1-9][\d_]*(e[\+\-]?[\d_]+)?/)&&(T.eat(/J/i),j=!0),T.match(/^0(?![\dx])/i)&&(j=!0),j)return T.eat(/L/i),"number"}if(T.match(N)){var de=T.current().toLowerCase().indexOf("f")!==-1;return de?(C.tokenize=W(T.current(),C.tokenize),C.tokenize(T,C)):(C.tokenize=J(T.current(),C.tokenize),C.tokenize(T,C))}for(var v=0;v<R.length;v++)if(T.match(R[v]))return"operator";return T.match(S)?"punctuation":C.lastToken=="."&&T.match(M)?"property":T.match(z)||T.match(_)?"keyword":T.match(X)?"builtin":T.match(/^(self|cls)\b/)?"variable-2":T.match(M)?C.lastToken=="def"||C.lastToken=="class"?"def":"variable":(T.next(),g?null:ne)}function W(T,C){for(;"rubf".indexOf(T.charAt(0).toLowerCase())>=0;)T=T.substr(1);var g=T.length==1,y="string";function j(v){return function(d,fe){var Te=p(d,fe,!0);return Te=="punctuation"&&(d.current()=="{"?fe.tokenize=j(v+1):d.current()=="}"&&(v>1?fe.tokenize=j(v-1):fe.tokenize=de)),Te}}function de(v,d){for(;!v.eol();)if(v.eatWhile(/[^'"\{\}\\]/),v.eat("\\")){if(v.next(),g&&v.eol())return y}else{if(v.match(T))return d.tokenize=C,y;if(v.match("{{"))return y;if(v.match("{",!1))return d.tokenize=j(0),v.current()?y:d.tokenize(v,d);if(v.match("}}"))return y;if(v.match("}"))return ne;v.eat(/['"]/)}if(g){if(Y.singleLineStringErrors)return ne;d.tokenize=C}return y}return de.isString=!0,de}function J(T,C){for(;"rubf".indexOf(T.charAt(0).toLowerCase())>=0;)T=T.substr(1);var g=T.length==1,y="string";function j(de,v){for(;!de.eol();)if(de.eatWhile(/[^'"\\]/),de.eat("\\")){if(de.next(),g&&de.eol())return y}else{if(de.match(T))return v.tokenize=C,y;de.eat(/['"]/)}if(g){if(Y.singleLineStringErrors)return ne;v.tokenize=C}return y}return j.isString=!0,j}function P(T){for(;Q(T).type!="py";)T.scopes.pop();T.scopes.push({offset:Q(T).offset+I.indentUnit,type:"py",align:null})}function V(T,C,g){var y=T.match(/^[\s\[\{\(]*(?:#|$)/,!1)?null:T.column()+1;C.scopes.push({offset:C.indent+$,type:g,align:y})}function F(T,C){for(var g=T.indentation();C.scopes.length>1&&Q(C).offset>g;){if(Q(C).type!="py")return!0;C.scopes.pop()}return Q(C).offset!=g}function G(T,C){T.sol()&&(C.beginningOfLine=!0,C.dedent=!1);var g=C.tokenize(T,C),y=T.current();if(C.beginningOfLine&&y=="@")return T.match(M,!1)?"meta":w?"operator":ne;if(/\S/.test(y)&&(C.beginningOfLine=!1),(g=="variable"||g=="builtin")&&C.lastToken=="meta"&&(g="meta"),(y=="pass"||y=="return")&&(C.dedent=!0),y=="lambda"&&(C.lambda=!0),y==":"&&!C.lambda&&Q(C).type=="py"&&T.match(/^\s*(?:#|$)/,!1)&&P(C),y.length==1&&!/string|comment/.test(g)){var j="[({".indexOf(y);if(j!=-1&&V(T,C,"])}".slice(j,j+1)),j="])}".indexOf(y),j!=-1)if(Q(C).type==y)C.indent=C.scopes.pop().offset-$;else return ne}return C.dedent&&T.eol()&&Q(C).type=="py"&&C.scopes.length>1&&C.scopes.pop(),g}var c={startState:function(T){return{tokenize:q,scopes:[{offset:T||0,type:"py",align:null}],indent:T||0,lastToken:null,lambda:!1,dedent:0}},token:function(T,C){var g=C.errorToken;g&&(C.errorToken=!1);var y=G(T,C);return y&&y!="comment"&&(C.lastToken=y=="keyword"||y=="punctuation"?T.current():y),y=="punctuation"&&(y=null),T.eol()&&C.lambda&&(C.lambda=!1),g?y+" "+ne:y},indent:function(T,C){if(T.tokenize!=q)return T.tokenize.isString?b.Pass:0;var g=Q(T),y=g.type==C.charAt(0)||g.type=="py"&&!T.dedent&&/^(else:|elif |except |finally:)/.test(C);return g.align!=null?g.align-(y?1:0):g.offset-(y?$:0)},electricInput:/^\s*([\}\]\)]|else:|elif |except |finally:)$/,closeBrackets:{triples:`'"`},lineComment:"#",fold:"indent"};return c}),b.defineMIME("text/x-python","python");var k=function(I){return I.split(" ")};b.defineMIME("text/x-cython",{name:"python",extra_keywords:k("by cdef cimport cpdef ctypedef enum except extern gil include nogil property public readonly struct union DEF IF ELIF ELSE")})})})()),Sa.exports}ef();var Ta={exports:{}},Ca;function tf(){return Ca||(Ca=1,(function(ct,xt){(function(b){b(mt())})(function(b){function pe(g,y,j,de,v,d){this.indented=g,this.column=y,this.type=j,this.info=de,this.align=v,this.prev=d}function _(g,y,j,de){var v=g.indented;return g.context&&g.context.type=="statement"&&j!="statement"&&(v=g.context.indented),g.context=new pe(v,y,j,de,null,g.context)}function te(g){var y=g.context.type;return(y==")"||y=="]"||y=="}")&&(g.indented=g.context.indented),g.context=g.context.prev}function oe(g,y,j){if(y.prevToken=="variable"||y.prevToken=="type"||/\S(?:[^- ]>|[*\]])\s*$|\*$/.test(g.string.slice(0,j))||y.typeAtEndOfLine&&g.column()==g.indentation())return!0}function Q(g){for(;;){if(!g||g.type=="top")return!0;if(g.type=="}"&&g.prev.info!="namespace")return!1;g=g.prev}}b.defineMode("clike",function(g,y){var j=g.indentUnit,de=y.statementIndentUnit||j,v=y.dontAlignCalls,d=y.keywords||{},fe=y.types||{},Te=y.builtin||{},le=y.blockKeywords||{},xe=y.defKeywords||{},Me=y.atoms||{},Fe=y.hooks||{},Ce=y.multiLineStrings,ve=y.indentStatements!==!1,Oe=y.indentSwitch!==!1,qe=y.namespaceSeparator,$e=y.isPunctuationChar||/[\[\]{}\(\),;\:\.]/,dt=y.numberStart||/[\d\.]/,Pe=y.number||/^(?:0x[a-f\d]+|0b[01]+|(?:\d+\.?\d*|\.\d+)(?:e[-+]?\d+)?)(u|ll?|l|f)?/i,_e=y.isOperatorChar||/[+\-*&%=<>!?|\/]/,Ue=y.isIdentifierChar||/[\w\$_\xa1-\uffff]/,et=y.isReservedIdentifier||!1,we,Ie;function E(me,De){var be=me.next();if(Fe[be]){var Be=Fe[be](me,De);if(Be!==!1)return Be}if(be=='"'||be=="'")return De.tokenize=ee(be),De.tokenize(me,De);if(dt.test(be)){if(me.backUp(1),me.match(Pe))return"number";me.next()}if($e.test(be))return we=be,null;if(be=="/"){if(me.eat("*"))return De.tokenize=K,K(me,De);if(me.eat("/"))return me.skipToEnd(),"comment"}if(_e.test(be)){for(;!me.match(/^\/[\/*]/,!1)&&me.eat(_e););return"operator"}if(me.eatWhile(Ue),qe)for(;me.match(qe);)me.eatWhile(Ue);var Ne=me.current();return I(d,Ne)?(I(le,Ne)&&(we="newstatement"),I(xe,Ne)&&(Ie=!0),"keyword"):I(fe,Ne)?"type":I(Te,Ne)||et&&et(Ne)?(I(le,Ne)&&(we="newstatement"),"builtin"):I(Me,Ne)?"atom":"variable"}function ee(me){return function(De,be){for(var Be=!1,Ne,Mt=!1;(Ne=De.next())!=null;){if(Ne==me&&!Be){Mt=!0;break}Be=!Be&&Ne=="\\"}return(Mt||!(Be||Ce))&&(be.tokenize=null),"string"}}function K(me,De){for(var be=!1,Be;Be=me.next();){if(Be=="/"&&be){De.tokenize=null;break}be=Be=="*"}return"comment"}function ze(me,De){y.typeFirstDefinitions&&me.eol()&&Q(De.context)&&(De.typeAtEndOfLine=oe(me,De,me.pos))}return{startState:function(me){return{tokenize:null,context:new pe((me||0)-j,0,"top",null,!1),indented:0,startOfLine:!0,prevToken:null}},token:function(me,De){var be=De.context;if(me.sol()&&(be.align==null&&(be.align=!1),De.indented=me.indentation(),De.startOfLine=!0),me.eatSpace())return ze(me,De),null;we=Ie=null;var Be=(De.tokenize||E)(me,De);if(Be=="comment"||Be=="meta")return Be;if(be.align==null&&(be.align=!0),we==";"||we==":"||we==","&&me.match(/^\s*(?:\/\/.*)?$/,!1))for(;De.context.type=="statement";)te(De);else if(we=="{")_(De,me.column(),"}");else if(we=="[")_(De,me.column(),"]");else if(we=="(")_(De,me.column(),")");else if(we=="}"){for(;be.type=="statement";)be=te(De);for(be.type=="}"&&(be=te(De));be.type=="statement";)be=te(De)}else we==be.type?te(De):ve&&((be.type=="}"||be.type=="top")&&we!=";"||be.type=="statement"&&we=="newstatement")&&_(De,me.column(),"statement",me.current());if(Be=="variable"&&(De.prevToken=="def"||y.typeFirstDefinitions&&oe(me,De,me.start)&&Q(De.context)&&me.match(/^\s*\(/,!1))&&(Be="def"),Fe.token){var Ne=Fe.token(me,De,Be);Ne!==void 0&&(Be=Ne)}return Be=="def"&&y.styleDefs===!1&&(Be="variable"),De.startOfLine=!1,De.prevToken=Ie?"def":Be||we,ze(me,De),Be},indent:function(me,De){if(me.tokenize!=E&&me.tokenize!=null||me.typeAtEndOfLine&&Q(me.context))return b.Pass;var be=me.context,Be=De&&De.charAt(0),Ne=Be==be.type;if(be.type=="statement"&&Be=="}"&&(be=be.prev),y.dontIndentStatements)for(;be.type=="statement"&&y.dontIndentStatements.test(be.info);)be=be.prev;if(Fe.indent){var Mt=Fe.indent(me,be,De,j);if(typeof Mt=="number")return Mt}var Pt=be.prev&&be.prev.info=="switch";if(y.allmanIndentation&&/[{(]/.test(Be)){for(;be.type!="top"&&be.type!="}";)be=be.prev;return be.indented}return be.type=="statement"?be.indented+(Be=="{"?0:de):be.align&&(!v||be.type!=")")?be.column+(Ne?0:1):be.type==")"&&!Ne?be.indented+de:be.indented+(Ne?0:j)+(!Ne&&Pt&&!/^(?:case|default)\b/.test(De)?j:0)},electricInput:Oe?/^\s*(?:case .*?:|default:|\{\}?|\})$/:/^\s*[{}]$/,blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:"//",fold:"brace"}});function k(g){for(var y={},j=g.split(" "),de=0;de<j.length;++de)y[j[de]]=!0;return y}function I(g,y){return typeof g=="function"?g(y):g.propertyIsEnumerable(y)}var Y="auto if break case register continue return default do sizeof static else struct switch extern typedef union for goto while enum const volatile inline restrict asm fortran",ne="alignas alignof and and_eq audit axiom bitand bitor catch class compl concept constexpr const_cast decltype delete dynamic_cast explicit export final friend import module mutable namespace new noexcept not not_eq operator or or_eq override private protected public reinterpret_cast requires static_assert static_cast template this thread_local throw try typeid typename using virtual xor xor_eq",S="bycopy byref in inout oneway out self super atomic nonatomic retain copy readwrite readonly strong weak assign typeof nullable nonnull null_resettable _cmd @interface @implementation @end @protocol @encode @property @synthesize @dynamic @class @public @package @private @protected @required @optional @try @catch @finally @import @selector @encode @defs @synchronized @autoreleasepool @compatibility_alias @available",R="FOUNDATION_EXPORT FOUNDATION_EXTERN NS_INLINE NS_FORMAT_FUNCTION  NS_RETURNS_RETAINEDNS_ERROR_ENUM NS_RETURNS_NOT_RETAINED NS_RETURNS_INNER_POINTER NS_DESIGNATED_INITIALIZER NS_ENUM NS_OPTIONS NS_REQUIRES_NIL_TERMINATION NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_END NS_SWIFT_NAME NS_REFINED_FOR_SWIFT",A=k("int long char short double float unsigned signed void bool"),$=k("SEL instancetype id Class Protocol BOOL");function ue(g){return I(A,g)||/.+_t$/.test(g)}function O(g){return ue(g)||I($,g)}var w="case do else for if switch while struct enum union",M="struct enum union";function N(g,y){if(!y.startOfLine)return!1;for(var j,de=null;j=g.peek();){if(j=="\\"&&g.match(/^.$/)){de=N;break}else if(j=="/"&&g.match(/^\/[\/\*]/,!1))break;g.next()}return y.tokenize=de,"meta"}function z(g,y){return y.prevToken=="type"?"type":!1}function X(g){return!g||g.length<2||g[0]!="_"?!1:g[1]=="_"||g[1]!==g[1].toLowerCase()}function q(g){return g.eatWhile(/[\w\.']/),"number"}function p(g,y){if(g.backUp(1),g.match(/^(?:R|u8R|uR|UR|LR)/)){var j=g.match(/^"([^\s\\()]{0,16})\(/);return j?(y.cpp11RawStringDelim=j[1],y.tokenize=P,P(g,y)):!1}return g.match(/^(?:u8|u|U|L)/)?g.match(/^["']/,!1)?"string":!1:(g.next(),!1)}function W(g){var y=/(\w+)::~?(\w+)$/.exec(g);return y&&y[1]==y[2]}function J(g,y){for(var j;(j=g.next())!=null;)if(j=='"'&&!g.eat('"')){y.tokenize=null;break}return"string"}function P(g,y){var j=y.cpp11RawStringDelim.replace(/[^\w\s]/g,"\\$&"),de=g.match(new RegExp(".*?\\)"+j+'"'));return de?y.tokenize=null:g.skipToEnd(),"string"}function V(g,y){typeof g=="string"&&(g=[g]);var j=[];function de(d){if(d)for(var fe in d)d.hasOwnProperty(fe)&&j.push(fe)}de(y.keywords),de(y.types),de(y.builtin),de(y.atoms),j.length&&(y.helperType=g[0],b.registerHelper("hintWords",g[0],j));for(var v=0;v<g.length;++v)b.defineMIME(g[v],y)}V(["text/x-csrc","text/x-c","text/x-chdr"],{name:"clike",keywords:k(Y),types:ue,blockKeywords:k(w),defKeywords:k(M),typeFirstDefinitions:!0,atoms:k("NULL true false"),isReservedIdentifier:X,hooks:{"#":N,"*":z},modeProps:{fold:["brace","include"]}}),V(["text/x-c++src","text/x-c++hdr"],{name:"clike",keywords:k(Y+" "+ne),types:ue,blockKeywords:k(w+" class try catch"),defKeywords:k(M+" class namespace"),typeFirstDefinitions:!0,atoms:k("true false NULL nullptr"),dontIndentStatements:/^template$/,isIdentifierChar:/[\w\$_~\xa1-\uffff]/,isReservedIdentifier:X,hooks:{"#":N,"*":z,u:p,U:p,L:p,R:p,0:q,1:q,2:q,3:q,4:q,5:q,6:q,7:q,8:q,9:q,token:function(g,y,j){if(j=="variable"&&g.peek()=="("&&(y.prevToken==";"||y.prevToken==null||y.prevToken=="}")&&W(g.current()))return"def"}},namespaceSeparator:"::",modeProps:{fold:["brace","include"]}}),V("text/x-java",{name:"clike",keywords:k("abstract assert break case catch class const continue default do else enum extends final finally for goto if implements import instanceof interface native new package private protected public return static strictfp super switch synchronized this throw throws transient try volatile while @interface"),types:k("var byte short int long float double boolean char void Boolean Byte Character Double Float Integer Long Number Object Short String StringBuffer StringBuilder Void"),blockKeywords:k("catch class do else finally for if switch try while"),defKeywords:k("class interface enum @interface"),typeFirstDefinitions:!0,atoms:k("true false null"),number:/^(?:0x[a-f\d_]+|0b[01_]+|(?:[\d_]+\.?\d*|\.\d+)(?:e[-+]?[\d_]+)?)(u|ll?|l|f)?/i,hooks:{"@":function(g){return g.match("interface",!1)?!1:(g.eatWhile(/[\w\$_]/),"meta")},'"':function(g,y){return g.match(/""$/)?(y.tokenize=F,y.tokenize(g,y)):!1}},modeProps:{fold:["brace","import"]}}),V("text/x-csharp",{name:"clike",keywords:k("abstract as async await base break case catch checked class const continue default delegate do else enum event explicit extern finally fixed for foreach goto if implicit in init interface internal is lock namespace new operator out override params private protected public readonly record ref required return sealed sizeof stackalloc static struct switch this throw try typeof unchecked unsafe using virtual void volatile while add alias ascending descending dynamic from get global group into join let orderby partial remove select set value var yield"),types:k("Action Boolean Byte Char DateTime DateTimeOffset Decimal Double Func Guid Int16 Int32 Int64 Object SByte Single String Task TimeSpan UInt16 UInt32 UInt64 bool byte char decimal double short int long object sbyte float string ushort uint ulong"),blockKeywords:k("catch class do else finally for foreach if struct switch try while"),defKeywords:k("class interface namespace record struct var"),typeFirstDefinitions:!0,atoms:k("true false null"),hooks:{"@":function(g,y){return g.eat('"')?(y.tokenize=J,J(g,y)):(g.eatWhile(/[\w\$_]/),"meta")}}});function F(g,y){for(var j=!1;!g.eol();){if(!j&&g.match('"""')){y.tokenize=null;break}j=g.next()=="\\"&&!j}return"string"}function G(g){return function(y,j){for(var de;de=y.next();)if(de=="*"&&y.eat("/"))if(g==1){j.tokenize=null;break}else return j.tokenize=G(g-1),j.tokenize(y,j);else if(de=="/"&&y.eat("*"))return j.tokenize=G(g+1),j.tokenize(y,j);return"comment"}}V("text/x-scala",{name:"clike",keywords:k("abstract case catch class def do else extends final finally for forSome if implicit import lazy match new null object override package private protected return sealed super this throw trait try type val var while with yield _ assert assume require print println printf readLine readBoolean readByte readShort readChar readInt readLong readFloat readDouble"),types:k("AnyVal App Application Array BufferedIterator BigDecimal BigInt Char Console Either Enumeration Equiv Error Exception Fractional Function IndexedSeq Int Integral Iterable Iterator List Map Numeric Nil NotNull Option Ordered Ordering PartialFunction PartialOrdering Product Proxy Range Responder Seq Serializable Set Specializable Stream StringBuilder StringContext Symbol Throwable Traversable TraversableOnce Tuple Unit Vector Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable Compiler Double Exception Float Integer Long Math Number Object Package Pair Process Runtime Runnable SecurityManager Short StackTraceElement StrictMath String StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void"),multiLineStrings:!0,blockKeywords:k("catch class enum do else finally for forSome if match switch try while"),defKeywords:k("class enum def object package trait type val var"),atoms:k("true false null"),indentStatements:!1,indentSwitch:!1,isOperatorChar:/[+\-*&%=<>!?|\/#:@]/,hooks:{"@":function(g){return g.eatWhile(/[\w\$_]/),"meta"},'"':function(g,y){return g.match('""')?(y.tokenize=F,y.tokenize(g,y)):!1},"'":function(g){return g.match(/^(\\[^'\s]+|[^\\'])'/)?"string-2":(g.eatWhile(/[\w\$_\xa1-\uffff]/),"atom")},"=":function(g,y){var j=y.context;return j.type=="}"&&j.align&&g.eat(">")?(y.context=new pe(j.indented,j.column,j.type,j.info,null,j.prev),"operator"):!1},"/":function(g,y){return g.eat("*")?(y.tokenize=G(1),y.tokenize(g,y)):!1}},modeProps:{closeBrackets:{pairs:'()[]{}""',triples:'"'}}});function c(g){return function(y,j){for(var de=!1,v,d=!1;!y.eol();){if(!g&&!de&&y.match('"')){d=!0;break}if(g&&y.match('"""')){d=!0;break}v=y.next(),!de&&v=="$"&&y.match("{")&&y.skipTo("}"),de=!de&&v=="\\"&&!g}return(d||!g)&&(j.tokenize=null),"string"}}V("text/x-kotlin",{name:"clike",keywords:k("package as typealias class interface this super val operator var fun for is in This throw return annotation break continue object if else while do try when !in !is as? file import where by get set abstract enum open inner override private public internal protected catch finally out final vararg reified dynamic companion constructor init sealed field property receiver param sparam lateinit data inline noinline tailrec external annotation crossinline const operator infix suspend actual expect setparam value"),types:k("Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable Compiler Double Exception Float Integer Long Math Number Object Package Pair Process Runtime Runnable SecurityManager Short StackTraceElement StrictMath String StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void Annotation Any BooleanArray ByteArray Char CharArray DeprecationLevel DoubleArray Enum FloatArray Function Int IntArray Lazy LazyThreadSafetyMode LongArray Nothing ShortArray Unit"),intendSwitch:!1,indentStatements:!1,multiLineStrings:!0,number:/^(?:0x[a-f\d_]+|0b[01_]+|(?:[\d_]+(\.\d+)?|\.\d+)(?:e[-+]?[\d_]+)?)(u|ll?|l|f)?/i,blockKeywords:k("catch class do else finally for if where try while enum"),defKeywords:k("class val var object interface fun"),atoms:k("true false null this"),hooks:{"@":function(g){return g.eatWhile(/[\w\$_]/),"meta"},"*":function(g,y){return y.prevToken=="."?"variable":"operator"},'"':function(g,y){return y.tokenize=c(g.match('""')),y.tokenize(g,y)},"/":function(g,y){return g.eat("*")?(y.tokenize=G(1),y.tokenize(g,y)):!1},indent:function(g,y,j,de){var v=j&&j.charAt(0);if((g.prevToken=="}"||g.prevToken==")")&&j=="")return g.indented;if(g.prevToken=="operator"&&j!="}"&&g.context.type!="}"||g.prevToken=="variable"&&v=="."||(g.prevToken=="}"||g.prevToken==")")&&v==".")return de*2+y.indented;if(y.align&&y.type=="}")return y.indented+(g.context.type==(j||"").charAt(0)?0:de)}},modeProps:{closeBrackets:{triples:'"'}}}),V(["x-shader/x-vertex","x-shader/x-fragment"],{name:"clike",keywords:k("sampler1D sampler2D sampler3D samplerCube sampler1DShadow sampler2DShadow const attribute uniform varying break continue discard return for while do if else struct in out inout"),types:k("float int bool void vec2 vec3 vec4 ivec2 ivec3 ivec4 bvec2 bvec3 bvec4 mat2 mat3 mat4"),blockKeywords:k("for while do if else struct"),builtin:k("radians degrees sin cos tan asin acos atan pow exp log exp2 sqrt inversesqrt abs sign floor ceil fract mod min max clamp mix step smoothstep length distance dot cross normalize ftransform faceforward reflect refract matrixCompMult lessThan lessThanEqual greaterThan greaterThanEqual equal notEqual any all not texture1D texture1DProj texture1DLod texture1DProjLod texture2D texture2DProj texture2DLod texture2DProjLod texture3D texture3DProj texture3DLod texture3DProjLod textureCube textureCubeLod shadow1D shadow2D shadow1DProj shadow2DProj shadow1DLod shadow2DLod shadow1DProjLod shadow2DProjLod dFdx dFdy fwidth noise1 noise2 noise3 noise4"),atoms:k("true false gl_FragColor gl_SecondaryColor gl_Normal gl_Vertex gl_MultiTexCoord0 gl_MultiTexCoord1 gl_MultiTexCoord2 gl_MultiTexCoord3 gl_MultiTexCoord4 gl_MultiTexCoord5 gl_MultiTexCoord6 gl_MultiTexCoord7 gl_FogCoord gl_PointCoord gl_Position gl_PointSize gl_ClipVertex gl_FrontColor gl_BackColor gl_FrontSecondaryColor gl_BackSecondaryColor gl_TexCoord gl_FogFragCoord gl_FragCoord gl_FrontFacing gl_FragData gl_FragDepth gl_ModelViewMatrix gl_ProjectionMatrix gl_ModelViewProjectionMatrix gl_TextureMatrix gl_NormalMatrix gl_ModelViewMatrixInverse gl_ProjectionMatrixInverse gl_ModelViewProjectionMatrixInverse gl_TextureMatrixTranspose gl_ModelViewMatrixInverseTranspose gl_ProjectionMatrixInverseTranspose gl_ModelViewProjectionMatrixInverseTranspose gl_TextureMatrixInverseTranspose gl_NormalScale gl_DepthRange gl_ClipPlane gl_Point gl_FrontMaterial gl_BackMaterial gl_LightSource gl_LightModel gl_FrontLightModelProduct gl_BackLightModelProduct gl_TextureColor gl_EyePlaneS gl_EyePlaneT gl_EyePlaneR gl_EyePlaneQ gl_FogParameters gl_MaxLights gl_MaxClipPlanes gl_MaxTextureUnits gl_MaxTextureCoords gl_MaxVertexAttribs gl_MaxVertexUniformComponents gl_MaxVaryingFloats gl_MaxVertexTextureImageUnits gl_MaxTextureImageUnits gl_MaxFragmentUniformComponents gl_MaxCombineTextureImageUnits gl_MaxDrawBuffers"),indentSwitch:!1,hooks:{"#":N},modeProps:{fold:["brace","include"]}}),V("text/x-nesc",{name:"clike",keywords:k(Y+" as atomic async call command component components configuration event generic implementation includes interface module new norace nx_struct nx_union post provides signal task uses abstract extends"),types:ue,blockKeywords:k(w),atoms:k("null true false"),hooks:{"#":N},modeProps:{fold:["brace","include"]}}),V("text/x-objectivec",{name:"clike",keywords:k(Y+" "+S),types:O,builtin:k(R),blockKeywords:k(w+" @synthesize @try @catch @finally @autoreleasepool @synchronized"),defKeywords:k(M+" @interface @implementation @protocol @class"),dontIndentStatements:/^@.*$/,typeFirstDefinitions:!0,atoms:k("YES NO NULL Nil nil true false nullptr"),isReservedIdentifier:X,hooks:{"#":N,"*":z},modeProps:{fold:["brace","include"]}}),V("text/x-objectivec++",{name:"clike",keywords:k(Y+" "+S+" "+ne),types:O,builtin:k(R),blockKeywords:k(w+" @synthesize @try @catch @finally @autoreleasepool @synchronized class try catch"),defKeywords:k(M+" @interface @implementation @protocol @class class namespace"),dontIndentStatements:/^@.*$|^template$/,typeFirstDefinitions:!0,atoms:k("YES NO NULL Nil nil true false nullptr"),isReservedIdentifier:X,hooks:{"#":N,"*":z,u:p,U:p,L:p,R:p,0:q,1:q,2:q,3:q,4:q,5:q,6:q,7:q,8:q,9:q,token:function(g,y,j){if(j=="variable"&&g.peek()=="("&&(y.prevToken==";"||y.prevToken==null||y.prevToken=="}")&&W(g.current()))return"def"}},namespaceSeparator:"::",modeProps:{fold:["brace","include"]}}),V("text/x-squirrel",{name:"clike",keywords:k("base break clone continue const default delete enum extends function in class foreach local resume return this throw typeof yield constructor instanceof static"),types:ue,blockKeywords:k("case catch class else for foreach if switch try while"),defKeywords:k("function local class"),typeFirstDefinitions:!0,atoms:k("true false null"),hooks:{"#":N},modeProps:{fold:["brace","include"]}});var T=null;function C(g){return function(y,j){for(var de=!1,v,d=!1;!y.eol();){if(!de&&y.match('"')&&(g=="single"||y.match('""'))){d=!0;break}if(!de&&y.match("``")){T=C(g),d=!0;break}v=y.next(),de=g=="single"&&!de&&v=="\\"}return d&&(j.tokenize=null),"string"}}V("text/x-ceylon",{name:"clike",keywords:k("abstracts alias assembly assert assign break case catch class continue dynamic else exists extends finally for function given if import in interface is let module new nonempty object of out outer package return satisfies super switch then this throw try value void while"),types:function(g){var y=g.charAt(0);return y===y.toUpperCase()&&y!==y.toLowerCase()},blockKeywords:k("case catch class dynamic else finally for function if interface module new object switch try while"),defKeywords:k("class dynamic function interface module object package value"),builtin:k("abstract actual aliased annotation by default deprecated doc final formal late license native optional sealed see serializable shared suppressWarnings tagged throws variable"),isPunctuationChar:/[\[\]{}\(\),;\:\.`]/,isOperatorChar:/[+\-*&%=<>!?|^~:\/]/,numberStart:/[\d#$]/,number:/^(?:#[\da-fA-F_]+|\$[01_]+|[\d_]+[kMGTPmunpf]?|[\d_]+\.[\d_]+(?:[eE][-+]?\d+|[kMGTPmunpf]|)|)/i,multiLineStrings:!0,typeFirstDefinitions:!0,atoms:k("true false null larger smaller equal empty finished"),indentSwitch:!1,styleDefs:!1,hooks:{"@":function(g){return g.eatWhile(/[\w\$_]/),"meta"},'"':function(g,y){return y.tokenize=C(g.match('""')?"triple":"single"),y.tokenize(g,y)},"`":function(g,y){return!T||!g.match("`")?!1:(y.tokenize=T,T=null,y.tokenize(g,y))},"'":function(g){return g.eatWhile(/[\w\$_\xa1-\uffff]/),"atom"},token:function(g,y,j){if((j=="variable"||j=="type")&&y.prevToken==".")return"variable-2"}},modeProps:{fold:["brace","import"],closeBrackets:{triples:'"'}}})})})()),Ta.exports}tf();var Da={exports:{}},Ma={exports:{}},Fa;function rf(){return Fa||(Fa=1,(function(ct,xt){(function(b){b(mt())})(function(b){b.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-encrypted","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["asc","pgp","sig"]},{name:"ASN.1",mime:"text/x-ttcn-asn",mode:"asn.1",ext:["asn","asn1"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"Brainfuck",mime:"text/x-brainfuck",mode:"brainfuck",ext:["b","bf"]},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h","ino"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy","cbl"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp","cs"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj","cljc","cljx"]},{name:"ClojureScript",mime:"text/x-clojurescript",mode:"clojure",ext:["cljs"]},{name:"Closure Stylesheets (GSS)",mime:"text/x-gss",mode:"css",ext:["gss"]},{name:"CMake",mime:"text/x-cmake",mode:"cmake",ext:["cmake","cmake.in"],file:/^CMakeLists\.txt$/},{name:"CoffeeScript",mimes:["application/vnd.coffeescript","text/coffeescript","text/x-coffeescript"],mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"Crystal",mime:"text/x-crystal",mode:"crystal",ext:["cr"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"edn",mime:"application/edn",mode:"clojure",ext:["edn"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Elm",mime:"text/x-elm",mode:"elm",ext:["elm"]},{name:"Embedded JavaScript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Esper",mime:"text/x-esper",mode:"sql"},{name:"Factor",mime:"text/x-factor",mode:"factor",ext:["factor"]},{name:"FCL",mime:"text/x-fcl",mode:"fcl"},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90","f95"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history)\.md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy","gradle"],file:/^Jenkinsfile$/},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haskell (Literate)",mime:"text/x-literate-haskell",mode:"haskell-literate",ext:["lhs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm","handlebars","hbs"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Pug",mime:"text/x-pug",mode:"pug",ext:["jade","pug"],alias:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"JSX",mime:"text/jsx",mode:"jsx",ext:["jsx"]},{name:"Jinja2",mime:"text/jinja2",mode:"jinja2",ext:["j2","jinja","jinja2"]},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"],alias:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"clike",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb","wl","wls"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps",ext:["mps"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"mbox",mime:"application/mbox",mode:"mbox",ext:["mbox"]},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NSIS",mime:"text/x-nsis",mode:"nsis",ext:["nsh","nsi"]},{name:"NTriples",mimes:["application/n-triples","application/n-quads","text/n-triples"],mode:"ntriples",ext:["nt","nq"]},{name:"Objective-C",mime:"text/x-objectivec",mode:"clike",ext:["m"],alias:["objective-c","objc"]},{name:"Objective-C++",mime:"text/x-objectivec++",mode:"clike",ext:["mm"],alias:["objective-c++","objc++"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Oz",mime:"text/x-oz",mode:"oz",ext:["oz"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mimes:["text/x-php","application/x-httpd-php","application/x-httpd-php-open"],mode:"php",ext:["php","php3","php4","php5","php7","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"PostgreSQL",mime:"text/x-pgsql",mode:"sql"},{name:"PowerShell",mime:"application/x-powershell",mode:"powershell",ext:["ps1","psd1","psm1"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"ProtoBuf",mime:"text/x-protobuf",mode:"protobuf",ext:["proto"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["BUILD","bzl","py","pyw"],file:/^(BUCK|BUILD)$/},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r","R"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"SAS",mime:"text/x-sas",mode:"sas",ext:["sas"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mimes:["text/x-sh","application/x-sh"],mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"],file:/^PKGBUILD$/},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"SML",mime:"text/x-sml",mode:"mllike",ext:["sml","sig","fun","smackspec"]},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"SQLite",mime:"text/x-sqlite",mode:"sql"},{name:"Squirrel",mime:"text/x-squirrel",mode:"clike",ext:["nut"]},{name:"Stylus",mime:"text/x-styl",mode:"stylus",ext:["styl"]},{name:"Swift",mime:"text/x-swift",mode:"swift",ext:["swift"]},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx","tex"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v","sv","svh"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"text/troff",mode:"troff",ext:["1","2","3","4","5","6","7","8","9"]},{name:"TTCN",mime:"text/x-ttcn",mode:"ttcn",ext:["ttcn","ttcn3","ttcnpp"]},{name:"TTCN_CFG",mime:"text/x-ttcn-cfg",mode:"ttcn-cfg",ext:["cfg"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"TypeScript-JSX",mime:"text/typescript-jsx",mode:"jsx",ext:["tsx"],alias:["tsx"]},{name:"Twig",mime:"text/x-twig",mode:"twig"},{name:"Web IDL",mime:"text/x-webidl",mode:"webidl",ext:["webidl"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"VHDL",mime:"text/x-vhdl",mode:"vhdl",ext:["vhd","vhdl"]},{name:"Vue.js Component",mimes:["script/x-vue","text/x-vue"],mode:"vue",ext:["vue"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd","svg"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"Yacas",mime:"text/x-yacas",mode:"yacas",ext:["ys"]},{name:"YAML",mimes:["text/x-yaml","text/yaml"],mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]},{name:"mscgen",mime:"text/x-mscgen",mode:"mscgen",ext:["mscgen","mscin","msc"]},{name:"xu",mime:"text/x-xu",mode:"mscgen",ext:["xu"]},{name:"msgenny",mime:"text/x-msgenny",mode:"mscgen",ext:["msgenny"]},{name:"WebAssembly",mime:"text/webassembly",mode:"wast",ext:["wat","wast"]}];for(var pe=0;pe<b.modeInfo.length;pe++){var _=b.modeInfo[pe];_.mimes&&(_.mime=_.mimes[0])}b.findModeByMIME=function(te){te=te.toLowerCase();for(var oe=0;oe<b.modeInfo.length;oe++){var Q=b.modeInfo[oe];if(Q.mime==te)return Q;if(Q.mimes){for(var k=0;k<Q.mimes.length;k++)if(Q.mimes[k]==te)return Q}}if(/\+xml$/.test(te))return b.findModeByMIME("application/xml");if(/\+json$/.test(te))return b.findModeByMIME("application/json")},b.findModeByExtension=function(te){te=te.toLowerCase();for(var oe=0;oe<b.modeInfo.length;oe++){var Q=b.modeInfo[oe];if(Q.ext){for(var k=0;k<Q.ext.length;k++)if(Q.ext[k]==te)return Q}}},b.findModeByFileName=function(te){for(var oe=0;oe<b.modeInfo.length;oe++){var Q=b.modeInfo[oe];if(Q.file&&Q.file.test(te))return Q}var k=te.lastIndexOf("."),I=k>-1&&te.substring(k+1,te.length);if(I)return b.findModeByExtension(I)},b.findModeByName=function(te){te=te.toLowerCase();for(var oe=0;oe<b.modeInfo.length;oe++){var Q=b.modeInfo[oe];if(Q.name.toLowerCase()==te)return Q;if(Q.alias){for(var k=0;k<Q.alias.length;k++)if(Q.alias[k].toLowerCase()==te)return Q}}}})})()),Ma.exports}var Aa;function nf(){return Aa||(Aa=1,(function(ct,xt){(function(b){b(mt(),Ya(),rf())})(function(b){b.defineMode("markdown",function(pe,_){var te=b.getMode(pe,"text/html"),oe=te.name=="null";function Q(v){if(b.findModeByName){var d=b.findModeByName(v);d&&(v=d.mime||d.mimes[0])}var fe=b.getMode(pe,v);return fe.name=="null"?null:fe}_.highlightFormatting===void 0&&(_.highlightFormatting=!1),_.maxBlockquoteDepth===void 0&&(_.maxBlockquoteDepth=0),_.taskLists===void 0&&(_.taskLists=!1),_.strikethrough===void 0&&(_.strikethrough=!1),_.emoji===void 0&&(_.emoji=!1),_.fencedCodeBlockHighlighting===void 0&&(_.fencedCodeBlockHighlighting=!0),_.fencedCodeBlockDefaultMode===void 0&&(_.fencedCodeBlockDefaultMode="text/plain"),_.xml===void 0&&(_.xml=!0),_.tokenTypeOverrides===void 0&&(_.tokenTypeOverrides={});var k={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"image",imageAltText:"image-alt-text",imageMarker:"image-marker",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough",emoji:"builtin"};for(var I in k)k.hasOwnProperty(I)&&_.tokenTypeOverrides[I]&&(k[I]=_.tokenTypeOverrides[I]);var Y=/^([*\-_])(?:\s*\1){2,}\s*$/,ne=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,S=/^\[(x| )\](?=\s)/i,R=_.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,A=/^ {0,3}(?:\={1,}|-{2,})\s*$/,$=/^[^#!\[\]*_\\<>` "'(~:]+/,ue=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,O=/^\s*\[[^\]]+?\]:.*$/,w=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/,M="    ";function N(v,d,fe){return d.f=d.inline=fe,fe(v,d)}function z(v,d,fe){return d.f=d.block=fe,fe(v,d)}function X(v){return!v||!/\S/.test(v.string)}function q(v){if(v.linkTitle=!1,v.linkHref=!1,v.linkText=!1,v.em=!1,v.strong=!1,v.strikethrough=!1,v.quote=0,v.indentedCode=!1,v.f==W){var d=oe;if(!d){var fe=b.innerMode(te,v.htmlState);d=fe.mode.name=="xml"&&fe.state.tagStart===null&&!fe.state.context&&fe.state.tokenize.isInText}d&&(v.f=F,v.block=p,v.htmlState=null)}return v.trailingSpace=0,v.trailingSpaceNewLine=!1,v.prevLine=v.thisLine,v.thisLine={stream:null},null}function p(v,d){var fe=v.column()===d.indentation,Te=X(d.prevLine.stream),le=d.indentedCode,xe=d.prevLine.hr,Me=d.list!==!1,Fe=(d.listStack[d.listStack.length-1]||0)+3;d.indentedCode=!1;var Ce=d.indentation;if(d.indentationDiff===null&&(d.indentationDiff=d.indentation,Me)){for(d.list=null;Ce<d.listStack[d.listStack.length-1];)d.listStack.pop(),d.listStack.length?d.indentation=d.listStack[d.listStack.length-1]:d.list=!1;d.list!==!1&&(d.indentationDiff=Ce-d.listStack[d.listStack.length-1])}var ve=!Te&&!xe&&!d.prevLine.header&&(!Me||!le)&&!d.prevLine.fencedCodeEnd,Oe=(d.list===!1||xe||Te)&&d.indentation<=Fe&&v.match(Y),qe=null;if(d.indentationDiff>=4&&(le||d.prevLine.fencedCodeEnd||d.prevLine.header||Te))return v.skipToEnd(),d.indentedCode=!0,k.code;if(v.eatSpace())return null;if(fe&&d.indentation<=Fe&&(qe=v.match(R))&&qe[1].length<=6)return d.quote=0,d.header=qe[1].length,d.thisLine.header=!0,_.highlightFormatting&&(d.formatting="header"),d.f=d.inline,P(d);if(d.indentation<=Fe&&v.eat(">"))return d.quote=fe?1:d.quote+1,_.highlightFormatting&&(d.formatting="quote"),v.eatSpace(),P(d);if(!Oe&&!d.setext&&fe&&d.indentation<=Fe&&(qe=v.match(ne))){var $e=qe[1]?"ol":"ul";return d.indentation=Ce+v.current().length,d.list=!0,d.quote=0,d.listStack.push(d.indentation),d.em=!1,d.strong=!1,d.code=!1,d.strikethrough=!1,_.taskLists&&v.match(S,!1)&&(d.taskList=!0),d.f=d.inline,_.highlightFormatting&&(d.formatting=["list","list-"+$e]),P(d)}else{if(fe&&d.indentation<=Fe&&(qe=v.match(ue,!0)))return d.quote=0,d.fencedEndRE=new RegExp(qe[1]+"+ *$"),d.localMode=_.fencedCodeBlockHighlighting&&Q(qe[2]||_.fencedCodeBlockDefaultMode),d.localMode&&(d.localState=b.startState(d.localMode)),d.f=d.block=J,_.highlightFormatting&&(d.formatting="code-block"),d.code=-1,P(d);if(d.setext||(!ve||!Me)&&!d.quote&&d.list===!1&&!d.code&&!Oe&&!O.test(v.string)&&(qe=v.lookAhead(1))&&(qe=qe.match(A)))return d.setext?(d.header=d.setext,d.setext=0,v.skipToEnd(),_.highlightFormatting&&(d.formatting="header")):(d.header=qe[0].charAt(0)=="="?1:2,d.setext=d.header),d.thisLine.header=!0,d.f=d.inline,P(d);if(Oe)return v.skipToEnd(),d.hr=!0,d.thisLine.hr=!0,k.hr;if(v.peek()==="[")return N(v,d,g)}return N(v,d,d.inline)}function W(v,d){var fe=te.token(v,d.htmlState);if(!oe){var Te=b.innerMode(te,d.htmlState);(Te.mode.name=="xml"&&Te.state.tagStart===null&&!Te.state.context&&Te.state.tokenize.isInText||d.md_inside&&v.current().indexOf(">")>-1)&&(d.f=F,d.block=p,d.htmlState=null)}return fe}function J(v,d){var fe=d.listStack[d.listStack.length-1]||0,Te=d.indentation<fe,le=fe+3;if(d.fencedEndRE&&d.indentation<=le&&(Te||v.match(d.fencedEndRE))){_.highlightFormatting&&(d.formatting="code-block");var xe;return Te||(xe=P(d)),d.localMode=d.localState=null,d.block=p,d.f=F,d.fencedEndRE=null,d.code=0,d.thisLine.fencedCodeEnd=!0,Te?z(v,d,d.block):xe}else return d.localMode?d.localMode.token(v,d.localState):(v.skipToEnd(),k.code)}function P(v){var d=[];if(v.formatting){d.push(k.formatting),typeof v.formatting=="string"&&(v.formatting=[v.formatting]);for(var fe=0;fe<v.formatting.length;fe++)d.push(k.formatting+"-"+v.formatting[fe]),v.formatting[fe]==="header"&&d.push(k.formatting+"-"+v.formatting[fe]+"-"+v.header),v.formatting[fe]==="quote"&&(!_.maxBlockquoteDepth||_.maxBlockquoteDepth>=v.quote?d.push(k.formatting+"-"+v.formatting[fe]+"-"+v.quote):d.push("error"))}if(v.taskOpen)return d.push("meta"),d.length?d.join(" "):null;if(v.taskClosed)return d.push("property"),d.length?d.join(" "):null;if(v.linkHref?d.push(k.linkHref,"url"):(v.strong&&d.push(k.strong),v.em&&d.push(k.em),v.strikethrough&&d.push(k.strikethrough),v.emoji&&d.push(k.emoji),v.linkText&&d.push(k.linkText),v.code&&d.push(k.code),v.image&&d.push(k.image),v.imageAltText&&d.push(k.imageAltText,"link"),v.imageMarker&&d.push(k.imageMarker)),v.header&&d.push(k.header,k.header+"-"+v.header),v.quote&&(d.push(k.quote),!_.maxBlockquoteDepth||_.maxBlockquoteDepth>=v.quote?d.push(k.quote+"-"+v.quote):d.push(k.quote+"-"+_.maxBlockquoteDepth)),v.list!==!1){var Te=(v.listStack.length-1)%3;Te?Te===1?d.push(k.list2):d.push(k.list3):d.push(k.list1)}return v.trailingSpaceNewLine?d.push("trailing-space-new-line"):v.trailingSpace&&d.push("trailing-space-"+(v.trailingSpace%2?"a":"b")),d.length?d.join(" "):null}function V(v,d){if(v.match($,!0))return P(d)}function F(v,d){var fe=d.text(v,d);if(typeof fe<"u")return fe;if(d.list)return d.list=null,P(d);if(d.taskList){var Te=v.match(S,!0)[1]===" ";return Te?d.taskOpen=!0:d.taskClosed=!0,_.highlightFormatting&&(d.formatting="task"),d.taskList=!1,P(d)}if(d.taskOpen=!1,d.taskClosed=!1,d.header&&v.match(/^#+$/,!0))return _.highlightFormatting&&(d.formatting="header"),P(d);var le=v.next();if(d.linkTitle){d.linkTitle=!1;var xe=le;le==="("&&(xe=")"),xe=(xe+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var Me="^\\s*(?:[^"+xe+"\\\\]+|\\\\\\\\|\\\\.)"+xe;if(v.match(new RegExp(Me),!0))return k.linkHref}if(le==="`"){var Fe=d.formatting;_.highlightFormatting&&(d.formatting="code"),v.eatWhile("`");var Ce=v.current().length;if(d.code==0&&(!d.quote||Ce==1))return d.code=Ce,P(d);if(Ce==d.code){var ve=P(d);return d.code=0,ve}else return d.formatting=Fe,P(d)}else if(d.code)return P(d);if(le==="\\"&&(v.next(),_.highlightFormatting)){var Oe=P(d),qe=k.formatting+"-escape";return Oe?Oe+" "+qe:qe}if(le==="!"&&v.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return d.imageMarker=!0,d.image=!0,_.highlightFormatting&&(d.formatting="image"),P(d);if(le==="["&&d.imageMarker&&v.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return d.imageMarker=!1,d.imageAltText=!0,_.highlightFormatting&&(d.formatting="image"),P(d);if(le==="]"&&d.imageAltText){_.highlightFormatting&&(d.formatting="image");var Oe=P(d);return d.imageAltText=!1,d.image=!1,d.inline=d.f=c,Oe}if(le==="["&&!d.image)return d.linkText&&v.match(/^.*?\]/)||(d.linkText=!0,_.highlightFormatting&&(d.formatting="link")),P(d);if(le==="]"&&d.linkText){_.highlightFormatting&&(d.formatting="link");var Oe=P(d);return d.linkText=!1,d.inline=d.f=v.match(/\(.*?\)| ?\[.*?\]/,!1)?c:F,Oe}if(le==="<"&&v.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){d.f=d.inline=G,_.highlightFormatting&&(d.formatting="link");var Oe=P(d);return Oe?Oe+=" ":Oe="",Oe+k.linkInline}if(le==="<"&&v.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){d.f=d.inline=G,_.highlightFormatting&&(d.formatting="link");var Oe=P(d);return Oe?Oe+=" ":Oe="",Oe+k.linkEmail}if(_.xml&&le==="<"&&v.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var $e=v.string.indexOf(">",v.pos);if($e!=-1){var dt=v.string.substring(v.start,$e);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(dt)&&(d.md_inside=!0)}return v.backUp(1),d.htmlState=b.startState(te),z(v,d,W)}if(_.xml&&le==="<"&&v.match(/^\/\w*?>/))return d.md_inside=!1,"tag";if(le==="*"||le==="_"){for(var Pe=1,_e=v.pos==1?" ":v.string.charAt(v.pos-2);Pe<3&&v.eat(le);)Pe++;var Ue=v.peek()||" ",et=!/\s/.test(Ue)&&(!w.test(Ue)||/\s/.test(_e)||w.test(_e)),we=!/\s/.test(_e)&&(!w.test(_e)||/\s/.test(Ue)||w.test(Ue)),Ie=null,E=null;if(Pe%2&&(!d.em&&et&&(le==="*"||!we||w.test(_e))?Ie=!0:d.em==le&&we&&(le==="*"||!et||w.test(Ue))&&(Ie=!1)),Pe>1&&(!d.strong&&et&&(le==="*"||!we||w.test(_e))?E=!0:d.strong==le&&we&&(le==="*"||!et||w.test(Ue))&&(E=!1)),E!=null||Ie!=null){_.highlightFormatting&&(d.formatting=Ie==null?"strong":E==null?"em":"strong em"),Ie===!0&&(d.em=le),E===!0&&(d.strong=le);var ve=P(d);return Ie===!1&&(d.em=!1),E===!1&&(d.strong=!1),ve}}else if(le===" "&&(v.eat("*")||v.eat("_"))){if(v.peek()===" ")return P(d);v.backUp(1)}if(_.strikethrough){if(le==="~"&&v.eatWhile(le)){if(d.strikethrough){_.highlightFormatting&&(d.formatting="strikethrough");var ve=P(d);return d.strikethrough=!1,ve}else if(v.match(/^[^\s]/,!1))return d.strikethrough=!0,_.highlightFormatting&&(d.formatting="strikethrough"),P(d)}else if(le===" "&&v.match("~~",!0)){if(v.peek()===" ")return P(d);v.backUp(2)}}if(_.emoji&&le===":"&&v.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){d.emoji=!0,_.highlightFormatting&&(d.formatting="emoji");var ee=P(d);return d.emoji=!1,ee}return le===" "&&(v.match(/^ +$/,!1)?d.trailingSpace++:d.trailingSpace&&(d.trailingSpaceNewLine=!0)),P(d)}function G(v,d){var fe=v.next();if(fe===">"){d.f=d.inline=F,_.highlightFormatting&&(d.formatting="link");var Te=P(d);return Te?Te+=" ":Te="",Te+k.linkInline}return v.match(/^[^>]+/,!0),k.linkInline}function c(v,d){if(v.eatSpace())return null;var fe=v.next();return fe==="("||fe==="["?(d.f=d.inline=C(fe==="("?")":"]"),_.highlightFormatting&&(d.formatting="link-string"),d.linkHref=!0,P(d)):"error"}var T={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function C(v){return function(d,fe){var Te=d.next();if(Te===v){fe.f=fe.inline=F,_.highlightFormatting&&(fe.formatting="link-string");var le=P(fe);return fe.linkHref=!1,le}return d.match(T[v]),fe.linkHref=!0,P(fe)}}function g(v,d){return v.match(/^([^\]\\]|\\.)*\]:/,!1)?(d.f=y,v.next(),_.highlightFormatting&&(d.formatting="link"),d.linkText=!0,P(d)):N(v,d,F)}function y(v,d){if(v.match("]:",!0)){d.f=d.inline=j,_.highlightFormatting&&(d.formatting="link");var fe=P(d);return d.linkText=!1,fe}return v.match(/^([^\]\\]|\\.)+/,!0),k.linkText}function j(v,d){return v.eatSpace()?null:(v.match(/^[^\s]+/,!0),v.peek()===void 0?d.linkTitle=!0:v.match(/^(?:\s+(?:"(?:[^"\\]|\\.)+"|'(?:[^'\\]|\\.)+'|\((?:[^)\\]|\\.)+\)))?/,!0),d.f=d.inline=F,k.linkHref+" url")}var de={startState:function(){return{f:p,prevLine:{stream:null},thisLine:{stream:null},block:p,htmlState:null,indentation:0,inline:F,text:V,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,setext:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,emoji:!1,fencedEndRE:null}},copyState:function(v){return{f:v.f,prevLine:v.prevLine,thisLine:v.thisLine,block:v.block,htmlState:v.htmlState&&b.copyState(te,v.htmlState),indentation:v.indentation,localMode:v.localMode,localState:v.localMode?b.copyState(v.localMode,v.localState):null,inline:v.inline,text:v.text,formatting:!1,linkText:v.linkText,linkTitle:v.linkTitle,linkHref:v.linkHref,code:v.code,em:v.em,strong:v.strong,strikethrough:v.strikethrough,emoji:v.emoji,header:v.header,setext:v.setext,hr:v.hr,taskList:v.taskList,list:v.list,listStack:v.listStack.slice(0),quote:v.quote,indentedCode:v.indentedCode,trailingSpace:v.trailingSpace,trailingSpaceNewLine:v.trailingSpaceNewLine,md_inside:v.md_inside,fencedEndRE:v.fencedEndRE}},token:function(v,d){if(d.formatting=!1,v!=d.thisLine.stream){if(d.header=0,d.hr=!1,v.match(/^\s*$/,!0))return q(d),null;if(d.prevLine=d.thisLine,d.thisLine={stream:v},d.taskList=!1,d.trailingSpace=0,d.trailingSpaceNewLine=!1,!d.localState&&(d.f=d.block,d.f!=W)){var fe=v.match(/^\s*/,!0)[0].replace(/\t/g,M).length;if(d.indentation=fe,d.indentationDiff=null,fe>0)return null}}return d.f(v,d)},innerMode:function(v){return v.block==W?{state:v.htmlState,mode:te}:v.localState?{state:v.localState,mode:v.localMode}:{state:v,mode:de}},indent:function(v,d,fe){return v.block==W&&te.indent?te.indent(v.htmlState,d,fe):v.localState&&v.localMode.indent?v.localMode.indent(v.localState,d,fe):b.Pass},blankLine:q,getType:P,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return de},"xml"),b.defineMIME("text/markdown","markdown"),b.defineMIME("text/x-markdown","markdown")})})()),Da.exports}nf();var Na={exports:{}},Ea;function of(){return Ea||(Ea=1,(function(ct,xt){(function(b){b(mt())})(function(b){b.defineOption("placeholder","",function(I,Y,ne){var S=ne&&ne!=b.Init;if(Y&&!S)I.on("blur",oe),I.on("change",Q),I.on("swapDoc",Q),b.on(I.getInputField(),"compositionupdate",I.state.placeholderCompose=function(){te(I)}),Q(I);else if(!Y&&S){I.off("blur",oe),I.off("change",Q),I.off("swapDoc",Q),b.off(I.getInputField(),"compositionupdate",I.state.placeholderCompose),pe(I);var R=I.getWrapperElement();R.className=R.className.replace(" CodeMirror-empty","")}Y&&!I.hasFocus()&&oe(I)});function pe(I){I.state.placeholder&&(I.state.placeholder.parentNode.removeChild(I.state.placeholder),I.state.placeholder=null)}function _(I){pe(I);var Y=I.state.placeholder=document.createElement("pre");Y.style.cssText="height: 0; overflow: visible",Y.style.direction=I.getOption("direction"),Y.className="CodeMirror-placeholder CodeMirror-line-like";var ne=I.getOption("placeholder");typeof ne=="string"&&(ne=document.createTextNode(ne)),Y.appendChild(ne),I.display.lineSpace.insertBefore(Y,I.display.lineSpace.firstChild)}function te(I){setTimeout(function(){var Y=!1;if(I.lineCount()==1){var ne=I.getInputField();Y=ne.nodeName=="TEXTAREA"?!I.getLine(0).length:!/[^\u200b]/.test(ne.querySelector(".CodeMirror-line").textContent)}Y?_(I):pe(I)},20)}function oe(I){k(I)&&_(I)}function Q(I){var Y=I.getWrapperElement(),ne=k(I);Y.className=Y.className.replace(" CodeMirror-empty","")+(ne?" CodeMirror-empty":""),ne?_(I):pe(I)}function k(I){return I.lineCount()===1&&I.getLine(0)===""}})})()),Na.exports}of();var Oa={exports:{}},Pa;function lf(){return Pa||(Pa=1,(function(ct,xt){(function(b){b(mt())})(function(b){b.defineSimpleMode=function(S,R){b.defineMode(S,function(A){return b.simpleMode(A,R)})},b.simpleMode=function(S,R){pe(R,"start");var A={},$=R.meta||{},ue=!1;for(var O in R)if(O!=$&&R.hasOwnProperty(O))for(var w=A[O]=[],M=R[O],N=0;N<M.length;N++){var z=M[N];w.push(new oe(z,R)),(z.indent||z.dedent)&&(ue=!0)}var X={startState:function(){return{state:"start",pending:null,local:null,localState:null,indent:ue?[]:null}},copyState:function(p){var W={state:p.state,pending:p.pending,local:p.local,localState:null,indent:p.indent&&p.indent.slice(0)};p.localState&&(W.localState=b.copyState(p.local.mode,p.localState)),p.stack&&(W.stack=p.stack.slice(0));for(var J=p.persistentStates;J;J=J.next)W.persistentStates={mode:J.mode,spec:J.spec,state:J.state==p.localState?W.localState:b.copyState(J.mode,J.state),next:W.persistentStates};return W},token:Q(A,S),innerMode:function(p){return p.local&&{mode:p.local.mode,state:p.localState}},indent:ne(A,$)};if($)for(var q in $)$.hasOwnProperty(q)&&(X[q]=$[q]);return X};function pe(S,R){if(!S.hasOwnProperty(R))throw new Error("Undefined state "+R+" in simple mode")}function _(S,R){if(!S)return/(?:)/;var A="";return S instanceof RegExp?(S.ignoreCase&&(A="i"),S.unicode&&(A+="u"),S=S.source):S=String(S),new RegExp((R===!1?"":"^")+"(?:"+S+")",A)}function te(S){if(!S)return null;if(S.apply)return S;if(typeof S=="string")return S.replace(/\./g," ");for(var R=[],A=0;A<S.length;A++)R.push(S[A]&&S[A].replace(/\./g," "));return R}function oe(S,R){(S.next||S.push)&&pe(R,S.next||S.push),this.regex=_(S.regex),this.token=te(S.token),this.data=S}function Q(S,R){return function(A,$){if($.pending){var ue=$.pending.shift();return $.pending.length==0&&($.pending=null),A.pos+=ue.text.length,ue.token}if($.local)if($.local.end&&A.match($.local.end)){var O=$.local.endToken||null;return $.local=$.localState=null,O}else{var O=$.local.mode.token(A,$.localState),w;return $.local.endScan&&(w=$.local.endScan.exec(A.current()))&&(A.pos=A.start+w.index),O}for(var M=S[$.state],N=0;N<M.length;N++){var z=M[N],X=(!z.data.sol||A.sol())&&A.match(z.regex);if(X){z.data.next?$.state=z.data.next:z.data.push?(($.stack||($.stack=[])).push($.state),$.state=z.data.push):z.data.pop&&$.stack&&$.stack.length&&($.state=$.stack.pop()),z.data.mode&&I(R,$,z.data.mode,z.token),z.data.indent&&$.indent.push(A.indentation()+R.indentUnit),z.data.dedent&&$.indent.pop();var q=z.token;if(q&&q.apply&&(q=q(X)),X.length>2&&z.token&&typeof z.token!="string"){for(var p=2;p<X.length;p++)X[p]&&($.pending||($.pending=[])).push({text:X[p],token:z.token[p-1]});return A.backUp(X[0].length-(X[1]?X[1].length:0)),q[0]}else return q&&q.join?q[0]:q}}return A.next(),null}}function k(S,R){if(S===R)return!0;if(!S||typeof S!="object"||!R||typeof R!="object")return!1;var A=0;for(var $ in S)if(S.hasOwnProperty($)){if(!R.hasOwnProperty($)||!k(S[$],R[$]))return!1;A++}for(var $ in R)R.hasOwnProperty($)&&A--;return A==0}function I(S,R,A,$){var ue;if(A.persistent)for(var O=R.persistentStates;O&&!ue;O=O.next)(A.spec?k(A.spec,O.spec):A.mode==O.mode)&&(ue=O);var w=ue?ue.mode:A.mode||b.getMode(S,A.spec),M=ue?ue.state:b.startState(w);A.persistent&&!ue&&(R.persistentStates={mode:w,spec:A.spec,state:M,next:R.persistentStates}),R.localState=M,R.local={mode:w,end:A.end&&_(A.end),endScan:A.end&&A.forceEnd!==!1&&_(A.end,!1),endToken:$&&$.join?$[$.length-1]:$}}function Y(S,R){for(var A=0;A<R.length;A++)if(R[A]===S)return!0}function ne(S,R){return function(A,$,ue){if(A.local&&A.local.mode.indent)return A.local.mode.indent(A.localState,$,ue);if(A.indent==null||A.local||R.dontIndentStates&&Y(A.state,R.dontIndentStates)>-1)return b.Pass;var O=A.indent.length-1,w=S[A.state];e:for(;;){for(var M=0;M<w.length;M++){var N=w[M];if(N.data.dedent&&N.data.dedentIfLineStart!==!1){var z=N.regex.exec($);if(z&&z[0]){O--,(N.next||N.push)&&(w=S[N.next||N.push]),$=$.slice(z[0].length);continue e}}}break}return O<0?0:A.indent[O]}}})})()),Oa.exports}lf();var Ia={exports:{}},za;function af(){return za||(za=1,(function(ct,xt){(function(b){b(mt())})(function(b){var pe=/MSIE \d/.test(navigator.userAgent)&&(document.documentMode==null||document.documentMode<8),_=b.Pos,te={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<","<":">>",">":"<<"};function oe(S){return S&&S.bracketRegex||/[(){}[\]]/}function Q(S,R,A){var $=S.getLineHandle(R.line),ue=R.ch-1,O=A&&A.afterCursor;O==null&&(O=/(^| )cm-fat-cursor($| )/.test(S.getWrapperElement().className));var w=oe(A),M=!O&&ue>=0&&w.test($.text.charAt(ue))&&te[$.text.charAt(ue)]||w.test($.text.charAt(ue+1))&&te[$.text.charAt(++ue)];if(!M)return null;var N=M.charAt(1)==">"?1:-1;if(A&&A.strict&&N>0!=(ue==R.ch))return null;var z=S.getTokenTypeAt(_(R.line,ue+1)),X=k(S,_(R.line,ue+(N>0?1:0)),N,z,A);return X==null?null:{from:_(R.line,ue),to:X&&X.pos,match:X&&X.ch==M.charAt(0),forward:N>0}}function k(S,R,A,$,ue){for(var O=ue&&ue.maxScanLineLength||1e4,w=ue&&ue.maxScanLines||1e3,M=[],N=oe(ue),z=A>0?Math.min(R.line+w,S.lastLine()+1):Math.max(S.firstLine()-1,R.line-w),X=R.line;X!=z;X+=A){var q=S.getLine(X);if(q){var p=A>0?0:q.length-1,W=A>0?q.length:-1;if(!(q.length>O))for(X==R.line&&(p=R.ch-(A<0?1:0));p!=W;p+=A){var J=q.charAt(p);if(N.test(J)&&($===void 0||(S.getTokenTypeAt(_(X,p+1))||"")==($||""))){var P=te[J];if(P&&P.charAt(1)==">"==A>0)M.push(J);else if(M.length)M.pop();else return{pos:_(X,p),ch:J}}}}}return X-A==(A>0?S.lastLine():S.firstLine())?!1:null}function I(S,R,A){for(var $=S.state.matchBrackets.maxHighlightLineLength||1e3,ue=A&&A.highlightNonMatching,O=[],w=S.listSelections(),M=0;M<w.length;M++){var N=w[M].empty()&&Q(S,w[M].head,A);if(N&&(N.match||ue!==!1)&&S.getLine(N.from.line).length<=$){var z=N.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket";O.push(S.markText(N.from,_(N.from.line,N.from.ch+1),{className:z})),N.to&&S.getLine(N.to.line).length<=$&&O.push(S.markText(N.to,_(N.to.line,N.to.ch+1),{className:z}))}}if(O.length){pe&&S.state.focused&&S.focus();var X=function(){S.operation(function(){for(var q=0;q<O.length;q++)O[q].clear()})};if(R)setTimeout(X,800);else return X}}function Y(S){S.operation(function(){S.state.matchBrackets.currentlyHighlighted&&(S.state.matchBrackets.currentlyHighlighted(),S.state.matchBrackets.currentlyHighlighted=null),S.state.matchBrackets.currentlyHighlighted=I(S,!1,S.state.matchBrackets)})}function ne(S){S.state.matchBrackets&&S.state.matchBrackets.currentlyHighlighted&&(S.state.matchBrackets.currentlyHighlighted(),S.state.matchBrackets.currentlyHighlighted=null)}b.defineOption("matchBrackets",!1,function(S,R,A){A&&A!=b.Init&&(S.off("cursorActivity",Y),S.off("focus",Y),S.off("blur",ne),ne(S)),R&&(S.state.matchBrackets=typeof R=="object"?R:{},S.on("cursorActivity",Y),S.on("focus",Y),S.on("blur",ne))}),b.defineExtension("matchBrackets",function(){I(this,!0)}),b.defineExtension("findMatchingBracket",function(S,R,A){return(A||typeof R=="boolean")&&(A?(A.strict=R,R=A):R=R?{strict:!0}:null),Q(this,S,R)}),b.defineExtension("scanForBracket",function(S,R,A,$){return k(this,S,R,A,$)})})})()),Ia.exports}af();var Ba={exports:{}},Ra;function sf(){return Ra||(Ra=1,(function(ct,xt){(function(b){b(mt())})(function(b){var pe={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},_=b.Pos;b.defineOption("autoCloseBrackets",!1,function(O,w,M){M&&M!=b.Init&&(O.removeKeyMap(oe),O.state.closeBrackets=null),w&&(Q(te(w,"pairs")),O.state.closeBrackets=w,O.addKeyMap(oe))});function te(O,w){return w=="pairs"&&typeof O=="string"?O:typeof O=="object"&&O[w]!=null?O[w]:pe[w]}var oe={Backspace:Y,Enter:ne};function Q(O){for(var w=0;w<O.length;w++){var M=O.charAt(w),N="'"+M+"'";oe[N]||(oe[N]=k(M))}}Q(pe.pairs+"`");function k(O){return function(w){return A(w,O)}}function I(O){var w=O.state.closeBrackets;if(!w||w.override)return w;var M=O.getModeAt(O.getCursor());return M.closeBrackets||w}function Y(O){var w=I(O);if(!w||O.getOption("disableInput"))return b.Pass;for(var M=te(w,"pairs"),N=O.listSelections(),z=0;z<N.length;z++){if(!N[z].empty())return b.Pass;var X=$(O,N[z].head);if(!X||M.indexOf(X)%2!=0)return b.Pass}for(var z=N.length-1;z>=0;z--){var q=N[z].head;O.replaceRange("",_(q.line,q.ch-1),_(q.line,q.ch+1),"+delete")}}function ne(O){var w=I(O),M=w&&te(w,"explode");if(!M||O.getOption("disableInput"))return b.Pass;for(var N=O.listSelections(),z=0;z<N.length;z++){if(!N[z].empty())return b.Pass;var X=$(O,N[z].head);if(!X||M.indexOf(X)%2!=0)return b.Pass}O.operation(function(){var q=O.lineSeparator()||`
`;O.replaceSelection(q+q,null),S(O,-1),N=O.listSelections();for(var p=0;p<N.length;p++){var W=N[p].head.line;O.indentLine(W,null,!0),O.indentLine(W+1,null,!0)}})}function S(O,w){for(var M=[],N=O.listSelections(),z=0,X=0;X<N.length;X++){var q=N[X];q.head==O.getCursor()&&(z=X);var p=q.head.ch||w>0?{line:q.head.line,ch:q.head.ch+w}:{line:q.head.line-1};M.push({anchor:p,head:p})}O.setSelections(M,z)}function R(O){var w=b.cmpPos(O.anchor,O.head)>0;return{anchor:new _(O.anchor.line,O.anchor.ch+(w?-1:1)),head:new _(O.head.line,O.head.ch+(w?1:-1))}}function A(O,w){var M=I(O);if(!M||O.getOption("disableInput"))return b.Pass;var N=te(M,"pairs"),z=N.indexOf(w);if(z==-1)return b.Pass;for(var X=te(M,"closeBefore"),q=te(M,"triples"),p=N.charAt(z+1)==w,W=O.listSelections(),J=z%2==0,P,V=0;V<W.length;V++){var F=W[V],G=F.head,c,T=O.getRange(G,_(G.line,G.ch+1));if(J&&!F.empty())c="surround";else if((p||!J)&&T==w)p&&ue(O,G)?c="both":q.indexOf(w)>=0&&O.getRange(G,_(G.line,G.ch+3))==w+w+w?c="skipThree":c="skip";else if(p&&G.ch>1&&q.indexOf(w)>=0&&O.getRange(_(G.line,G.ch-2),G)==w+w){if(G.ch>2&&/\bstring/.test(O.getTokenTypeAt(_(G.line,G.ch-2))))return b.Pass;c="addFour"}else if(p){var C=G.ch==0?" ":O.getRange(_(G.line,G.ch-1),G);if(!b.isWordChar(T)&&C!=w&&!b.isWordChar(C))c="both";else return b.Pass}else if(J&&(T.length===0||/\s/.test(T)||X.indexOf(T)>-1))c="both";else return b.Pass;if(!P)P=c;else if(P!=c)return b.Pass}var g=z%2?N.charAt(z-1):w,y=z%2?w:N.charAt(z+1);O.operation(function(){if(P=="skip")S(O,1);else if(P=="skipThree")S(O,3);else if(P=="surround"){for(var j=O.getSelections(),de=0;de<j.length;de++)j[de]=g+j[de]+y;O.replaceSelections(j,"around"),j=O.listSelections().slice();for(var de=0;de<j.length;de++)j[de]=R(j[de]);O.setSelections(j)}else P=="both"?(O.replaceSelection(g+y,null),O.triggerElectric(g+y),S(O,-1)):P=="addFour"&&(O.replaceSelection(g+g+g+g,"before"),S(O,1))})}function $(O,w){var M=O.getRange(_(w.line,w.ch-1),_(w.line,w.ch+1));return M.length==2?M:null}function ue(O,w){var M=O.getTokenAt(_(w.line,w.ch+1));return/\bstring/.test(M.type)&&M.start==w.ch&&(w.ch==0||!/\bstring/.test(O.getTokenTypeAt(w)))}})})()),Ba.exports}sf();var Wa={exports:{}},Ha={exports:{}},_a;function Ja(){return _a||(_a=1,(function(ct,xt){(function(b){b(mt())})(function(b){var pe=b.Pos;function _(w){var M=w.flags;return M??(w.ignoreCase?"i":"")+(w.global?"g":"")+(w.multiline?"m":"")}function te(w,M){for(var N=_(w),z=N,X=0;X<M.length;X++)z.indexOf(M.charAt(X))==-1&&(z+=M.charAt(X));return N==z?w:new RegExp(w.source,z)}function oe(w){return/\\s|\\n|\n|\\W|\\D|\[\^/.test(w.source)}function Q(w,M,N){M=te(M,"g");for(var z=N.line,X=N.ch,q=w.lastLine();z<=q;z++,X=0){M.lastIndex=X;var p=w.getLine(z),W=M.exec(p);if(W)return{from:pe(z,W.index),to:pe(z,W.index+W[0].length),match:W}}}function k(w,M,N){if(!oe(M))return Q(w,M,N);M=te(M,"gm");for(var z,X=1,q=N.line,p=w.lastLine();q<=p;){for(var W=0;W<X&&!(q>p);W++){var J=w.getLine(q++);z=z==null?J:z+`
`+J}X=X*2,M.lastIndex=N.ch;var P=M.exec(z);if(P){var V=z.slice(0,P.index).split(`
`),F=P[0].split(`
`),G=N.line+V.length-1,c=V[V.length-1].length;return{from:pe(G,c),to:pe(G+F.length-1,F.length==1?c+F[0].length:F[F.length-1].length),match:P}}}}function I(w,M,N){for(var z,X=0;X<=w.length;){M.lastIndex=X;var q=M.exec(w);if(!q)break;var p=q.index+q[0].length;if(p>w.length-N)break;(!z||p>z.index+z[0].length)&&(z=q),X=q.index+1}return z}function Y(w,M,N){M=te(M,"g");for(var z=N.line,X=N.ch,q=w.firstLine();z>=q;z--,X=-1){var p=w.getLine(z),W=I(p,M,X<0?0:p.length-X);if(W)return{from:pe(z,W.index),to:pe(z,W.index+W[0].length),match:W}}}function ne(w,M,N){if(!oe(M))return Y(w,M,N);M=te(M,"gm");for(var z,X=1,q=w.getLine(N.line).length-N.ch,p=N.line,W=w.firstLine();p>=W;){for(var J=0;J<X&&p>=W;J++){var P=w.getLine(p--);z=z==null?P:P+`
`+z}X*=2;var V=I(z,M,q);if(V){var F=z.slice(0,V.index).split(`
`),G=V[0].split(`
`),c=p+F.length,T=F[F.length-1].length;return{from:pe(c,T),to:pe(c+G.length-1,G.length==1?T+G[0].length:G[G.length-1].length),match:V}}}}var S,R;String.prototype.normalize?(S=function(w){return w.normalize("NFD").toLowerCase()},R=function(w){return w.normalize("NFD")}):(S=function(w){return w.toLowerCase()},R=function(w){return w});function A(w,M,N,z){if(w.length==M.length)return N;for(var X=0,q=N+Math.max(0,w.length-M.length);;){if(X==q)return X;var p=X+q>>1,W=z(w.slice(0,p)).length;if(W==N)return p;W>N?q=p:X=p+1}}function $(w,M,N,z){if(!M.length)return null;var X=z?S:R,q=X(M).split(/\r|\n\r?/);e:for(var p=N.line,W=N.ch,J=w.lastLine()+1-q.length;p<=J;p++,W=0){var P=w.getLine(p).slice(W),V=X(P);if(q.length==1){var F=V.indexOf(q[0]);if(F==-1)continue e;var N=A(P,V,F,X)+W;return{from:pe(p,A(P,V,F,X)+W),to:pe(p,A(P,V,F+q[0].length,X)+W)}}else{var G=V.length-q[0].length;if(V.slice(G)!=q[0])continue e;for(var c=1;c<q.length-1;c++)if(X(w.getLine(p+c))!=q[c])continue e;var T=w.getLine(p+q.length-1),C=X(T),g=q[q.length-1];if(C.slice(0,g.length)!=g)continue e;return{from:pe(p,A(P,V,G,X)+W),to:pe(p+q.length-1,A(T,C,g.length,X))}}}}function ue(w,M,N,z){if(!M.length)return null;var X=z?S:R,q=X(M).split(/\r|\n\r?/);e:for(var p=N.line,W=N.ch,J=w.firstLine()-1+q.length;p>=J;p--,W=-1){var P=w.getLine(p);W>-1&&(P=P.slice(0,W));var V=X(P);if(q.length==1){var F=V.lastIndexOf(q[0]);if(F==-1)continue e;return{from:pe(p,A(P,V,F,X)),to:pe(p,A(P,V,F+q[0].length,X))}}else{var G=q[q.length-1];if(V.slice(0,G.length)!=G)continue e;for(var c=1,N=p-q.length+1;c<q.length-1;c++)if(X(w.getLine(N+c))!=q[c])continue e;var T=w.getLine(p+1-q.length),C=X(T);if(C.slice(C.length-q[0].length)!=q[0])continue e;return{from:pe(p+1-q.length,A(T,C,T.length-q[0].length,X)),to:pe(p,A(P,V,G.length,X))}}}}function O(w,M,N,z){this.atOccurrence=!1,this.afterEmptyMatch=!1,this.doc=w,N=N?w.clipPos(N):pe(0,0),this.pos={from:N,to:N};var X;typeof z=="object"?X=z.caseFold:(X=z,z=null),typeof M=="string"?(X==null&&(X=!1),this.matches=function(q,p){return(q?ue:$)(w,M,p,X)}):(M=te(M,"gm"),!z||z.multiline!==!1?this.matches=function(q,p){return(q?ne:k)(w,M,p)}:this.matches=function(q,p){return(q?Y:Q)(w,M,p)})}O.prototype={findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(w){var M=this.doc.clipPos(w?this.pos.from:this.pos.to);if(this.afterEmptyMatch&&this.atOccurrence&&(M=pe(M.line,M.ch),w?(M.ch--,M.ch<0&&(M.line--,M.ch=(this.doc.getLine(M.line)||"").length)):(M.ch++,M.ch>(this.doc.getLine(M.line)||"").length&&(M.ch=0,M.line++)),b.cmpPos(M,this.doc.clipPos(M))!=0))return this.atOccurrence=!1;var N=this.matches(w,M);if(this.afterEmptyMatch=N&&b.cmpPos(N.from,N.to)==0,N)return this.pos=N,this.atOccurrence=!0,this.pos.match||!0;var z=pe(w?this.doc.firstLine():this.doc.lastLine()+1,0);return this.pos={from:z,to:z},this.atOccurrence=!1},from:function(){if(this.atOccurrence)return this.pos.from},to:function(){if(this.atOccurrence)return this.pos.to},replace:function(w,M){if(this.atOccurrence){var N=b.splitLines(w);this.doc.replaceRange(N,this.pos.from,this.pos.to,M),this.pos.to=pe(this.pos.from.line+N.length-1,N[N.length-1].length+(N.length==1?this.pos.from.ch:0))}}},b.defineExtension("getSearchCursor",function(w,M,N){return new O(this.doc,w,M,N)}),b.defineDocExtension("getSearchCursor",function(w,M,N){return new O(this,w,M,N)}),b.defineExtension("selectMatches",function(w,M){for(var N=[],z=this.getSearchCursor(w,this.getCursor("from"),M);z.findNext()&&!(b.cmpPos(z.to(),this.getCursor("to"))>0);)N.push({anchor:z.from(),head:z.to()});N.length&&this.setSelections(N,0)})})})()),Ha.exports}var qa={exports:{}},ja;function po(){return ja||(ja=1,(function(ct,xt){(function(b){b(mt())})(function(b){function pe(te,oe,Q){var k=te.getWrapperElement(),I;return I=k.appendChild(document.createElement("div")),Q?I.className="CodeMirror-dialog CodeMirror-dialog-bottom":I.className="CodeMirror-dialog CodeMirror-dialog-top",typeof oe=="string"?I.innerHTML=oe:I.appendChild(oe),b.addClass(k,"dialog-opened"),I}function _(te,oe){te.state.currentNotificationClose&&te.state.currentNotificationClose(),te.state.currentNotificationClose=oe}b.defineExtension("openDialog",function(te,oe,Q){Q||(Q={}),_(this,null);var k=pe(this,te,Q.bottom),I=!1,Y=this;function ne(A){if(typeof A=="string")S.value=A;else{if(I)return;I=!0,b.rmClass(k.parentNode,"dialog-opened"),k.parentNode.removeChild(k),Y.focus(),Q.onClose&&Q.onClose(k)}}var S=k.getElementsByTagName("input")[0],R;return S?(S.focus(),Q.value&&(S.value=Q.value,Q.selectValueOnOpen!==!1&&S.select()),Q.onInput&&b.on(S,"input",function(A){Q.onInput(A,S.value,ne)}),Q.onKeyUp&&b.on(S,"keyup",function(A){Q.onKeyUp(A,S.value,ne)}),b.on(S,"keydown",function(A){Q&&Q.onKeyDown&&Q.onKeyDown(A,S.value,ne)||((A.keyCode==27||Q.closeOnEnter!==!1&&A.keyCode==13)&&(S.blur(),b.e_stop(A),ne()),A.keyCode==13&&oe(S.value,A))}),Q.closeOnBlur!==!1&&b.on(k,"focusout",function(A){A.relatedTarget!==null&&ne()})):(R=k.getElementsByTagName("button")[0])&&(b.on(R,"click",function(){ne(),Y.focus()}),Q.closeOnBlur!==!1&&b.on(R,"blur",ne),R.focus()),ne}),b.defineExtension("openConfirm",function(te,oe,Q){_(this,null);var k=pe(this,te,Q&&Q.bottom),I=k.getElementsByTagName("button"),Y=!1,ne=this,S=1;function R(){Y||(Y=!0,b.rmClass(k.parentNode,"dialog-opened"),k.parentNode.removeChild(k),ne.focus())}I[0].focus();for(var A=0;A<I.length;++A){var $=I[A];(function(ue){b.on($,"click",function(O){b.e_preventDefault(O),R(),ue&&ue(ne)})})(oe[A]),b.on($,"blur",function(){--S,setTimeout(function(){S<=0&&R()},200)}),b.on($,"focus",function(){++S})}}),b.defineExtension("openNotification",function(te,oe){_(this,ne);var Q=pe(this,te,oe&&oe.bottom),k=!1,I,Y=oe&&typeof oe.duration<"u"?oe.duration:5e3;function ne(){k||(k=!0,clearTimeout(I),b.rmClass(Q.parentNode,"dialog-opened"),Q.parentNode.removeChild(Q))}return b.on(Q,"click",function(S){b.e_preventDefault(S),ne()}),Y&&(I=setTimeout(ne,Y)),ne})})})()),qa.exports}var Ka;function uf(){return Ka||(Ka=1,(function(ct,xt){(function(b){b(mt(),Ja(),po())})(function(b){b.defineOption("search",{bottom:!1});function pe(p,W){return typeof p=="string"?p=new RegExp(p.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),W?"gi":"g"):p.global||(p=new RegExp(p.source,p.ignoreCase?"gi":"g")),{token:function(J){p.lastIndex=J.pos;var P=p.exec(J.string);if(P&&P.index==J.pos)return J.pos+=P[0].length||1,"searching";P?J.pos=P.index:J.skipToEnd()}}}function _(){this.posFrom=this.posTo=this.lastQuery=this.query=null,this.overlay=null}function te(p){return p.state.search||(p.state.search=new _)}function oe(p){return typeof p=="string"&&p==p.toLowerCase()}function Q(p,W,J){return p.getSearchCursor(W,J,{caseFold:oe(W),multiline:!0})}function k(p,W,J,P,V){p.openDialog(W,P,{value:J,selectValueOnOpen:!0,closeOnEnter:!1,onClose:function(){ue(p)},onKeyDown:V,bottom:p.options.search.bottom})}function I(p,W,J,P,V){p.openDialog?p.openDialog(W,V,{value:P,selectValueOnOpen:!0,bottom:p.options.search.bottom}):V(prompt(J,P))}function Y(p,W,J,P){p.openConfirm?p.openConfirm(W,P):confirm(J)&&P[0]()}function ne(p){return p.replace(/\\([nrt\\])/g,function(W,J){return J=="n"?`
`:J=="r"?"\r":J=="t"?"	":J=="\\"?"\\":W})}function S(p){var W=p.match(/^\/(.*)\/([a-z]*)$/);if(W)try{p=new RegExp(W[1],W[2].indexOf("i")==-1?"":"i")}catch{}else p=ne(p);return(typeof p=="string"?p=="":p.test(""))&&(p=/x^/),p}function R(p,W,J){W.queryText=J,W.query=S(J),p.removeOverlay(W.overlay,oe(W.query)),W.overlay=pe(W.query,oe(W.query)),p.addOverlay(W.overlay),p.showMatchesOnScrollbar&&(W.annotate&&(W.annotate.clear(),W.annotate=null),W.annotate=p.showMatchesOnScrollbar(W.query,oe(W.query)))}function A(p,W,J,P){var V=te(p);if(V.query)return $(p,W);var F=p.getSelection()||V.lastQuery;if(F instanceof RegExp&&F.source=="x^"&&(F=null),J&&p.openDialog){var G=null,c=function(T,C){b.e_stop(C),T&&(T!=V.queryText&&(R(p,V,T),V.posFrom=V.posTo=p.getCursor()),G&&(G.style.opacity=1),$(p,C.shiftKey,function(g,y){var j;y.line<3&&document.querySelector&&(j=p.display.wrapper.querySelector(".CodeMirror-dialog"))&&j.getBoundingClientRect().bottom-4>p.cursorCoords(y,"window").top&&((G=j).style.opacity=.4)}))};k(p,w(p),F,c,function(T,C){var g=b.keyName(T),y=p.getOption("extraKeys"),j=y&&y[g]||b.keyMap[p.getOption("keyMap")][g];j=="findNext"||j=="findPrev"||j=="findPersistentNext"||j=="findPersistentPrev"?(b.e_stop(T),R(p,te(p),C),p.execCommand(j)):(j=="find"||j=="findPersistent")&&(b.e_stop(T),c(C,T))}),P&&F&&(R(p,V,F),$(p,W))}else I(p,w(p),"Search for:",F,function(T){T&&!V.query&&p.operation(function(){R(p,V,T),V.posFrom=V.posTo=p.getCursor(),$(p,W)})})}function $(p,W,J){p.operation(function(){var P=te(p),V=Q(p,P.query,W?P.posFrom:P.posTo);!V.find(W)&&(V=Q(p,P.query,W?b.Pos(p.lastLine()):b.Pos(p.firstLine(),0)),!V.find(W))||(p.setSelection(V.from(),V.to()),p.scrollIntoView({from:V.from(),to:V.to()},20),P.posFrom=V.from(),P.posTo=V.to(),J&&J(V.from(),V.to()))})}function ue(p){p.operation(function(){var W=te(p);W.lastQuery=W.query,W.query&&(W.query=W.queryText=null,p.removeOverlay(W.overlay),W.annotate&&(W.annotate.clear(),W.annotate=null))})}function O(p,W){var J=p?document.createElement(p):document.createDocumentFragment();for(var P in W)J[P]=W[P];for(var V=2;V<arguments.length;V++){var F=arguments[V];J.appendChild(typeof F=="string"?document.createTextNode(F):F)}return J}function w(p){var W=O("label",{className:"CodeMirror-search-label"},p.phrase("Search:"),O("input",{type:"text",style:"width: 10em",className:"CodeMirror-search-field",id:"CodeMirror-search-field"}));return W.setAttribute("for","CodeMirror-search-field"),O("",null,W," ",O("span",{style:"color: #666",className:"CodeMirror-search-hint"},p.phrase("(Use /re/ syntax for regexp search)")))}function M(p){return O("",null," ",O("input",{type:"text",style:"width: 10em",className:"CodeMirror-search-field"})," ",O("span",{style:"color: #666",className:"CodeMirror-search-hint"},p.phrase("(Use /re/ syntax for regexp search)")))}function N(p){return O("",null,O("span",{className:"CodeMirror-search-label"},p.phrase("With:"))," ",O("input",{type:"text",style:"width: 10em",className:"CodeMirror-search-field"}))}function z(p){return O("",null,O("span",{className:"CodeMirror-search-label"},p.phrase("Replace?"))," ",O("button",{},p.phrase("Yes"))," ",O("button",{},p.phrase("No"))," ",O("button",{},p.phrase("All"))," ",O("button",{},p.phrase("Stop")))}function X(p,W,J){p.operation(function(){for(var P=Q(p,W);P.findNext();)if(typeof W!="string"){var V=p.getRange(P.from(),P.to()).match(W);P.replace(J.replace(/\$(\d)/g,function(F,G){return V[G]}))}else P.replace(J)})}function q(p,W){if(!p.getOption("readOnly")){var J=p.getSelection()||te(p).lastQuery,P=W?p.phrase("Replace all:"):p.phrase("Replace:"),V=O("",null,O("span",{className:"CodeMirror-search-label"},P),M(p));I(p,V,P,J,function(F){F&&(F=S(F),I(p,N(p),p.phrase("Replace with:"),"",function(G){if(G=ne(G),W)X(p,F,G);else{ue(p);var c=Q(p,F,p.getCursor("from")),T=function(){var g=c.from(),y;!(y=c.findNext())&&(c=Q(p,F),!(y=c.findNext())||g&&c.from().line==g.line&&c.from().ch==g.ch)||(p.setSelection(c.from(),c.to()),p.scrollIntoView({from:c.from(),to:c.to()}),Y(p,z(p),p.phrase("Replace?"),[function(){C(y)},T,function(){X(p,F,G)}]))},C=function(g){c.replace(typeof F=="string"?G:G.replace(/\$(\d)/g,function(y,j){return g[j]})),T()};T()}}))})}}b.commands.find=function(p){ue(p),A(p)},b.commands.findPersistent=function(p){ue(p),A(p,!1,!0)},b.commands.findPersistentNext=function(p){A(p,!1,!0,!0)},b.commands.findPersistentPrev=function(p){A(p,!0,!0,!0)},b.commands.findNext=A,b.commands.findPrev=function(p){A(p,!0)},b.commands.clearSearch=ue,b.commands.replace=q,b.commands.replaceAll=function(p){q(p,!0)}})})()),Wa.exports}uf();Ja();var Ua={exports:{}},Ga;function ff(){return Ga||(Ga=1,(function(ct,xt){(function(b){b(mt(),po())})(function(b){b.defineOption("search",{bottom:!1});function pe(oe,Q,k,I,Y){oe.openDialog?oe.openDialog(Q,Y,{value:I,selectValueOnOpen:!0,bottom:oe.options.search.bottom}):Y(prompt(k,I))}function _(oe){return oe.phrase("Jump to line:")+' <input type="text" style="width: 10em" class="CodeMirror-search-field"/> <span style="color: #888" class="CodeMirror-search-hint">'+oe.phrase("(Use line:column or scroll% syntax)")+"</span>"}function te(oe,Q){var k=Number(Q);return/^[-+]/.test(Q)?oe.getCursor().line+k:k-1}b.commands.jumpToLine=function(oe){var Q=oe.getCursor();pe(oe,_(oe),oe.phrase("Jump to line:"),Q.line+1+":"+Q.ch,function(k){if(k){var I;if(I=/^\s*([\+\-]?\d+)\s*\:\s*(\d+)\s*$/.exec(k))oe.setCursor(te(oe,I[1]),Number(I[2]));else if(I=/^\s*([\+\-]?\d+(\.\d+)?)\%\s*/.exec(k)){var Y=Math.round(oe.lineCount()*Number(I[1])/100);/^[-+]/.test(I[1])&&(Y=Q.line+Y+1),oe.setCursor(Y-1,Q.ch)}else(I=/^\s*\:?\s*([\+\-]?\d+)\s*/.exec(k))&&oe.setCursor(te(oe,I[1]),Q.ch)}})},b.keyMap.default["Alt-G"]="jumpToLine"})})()),Ua.exports}ff();po();export{hf as default};
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./codeMirrorModule-LEHpjmcn.js","./urlMatch-BYQrIQwR.js","../codeMirrorModule.DYBRYzYX.css"])))=>i.map(i=>d[i]);
import{i as mx}from"./urlMatch-BYQrIQwR.js";function yx(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var rh={exports:{}},ja={};/**
 * @license React
 * react-jsx-runtime.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var Fy;function bx(){if(Fy)return ja;Fy=1;var n=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function i(r,a,o){var u=null;if(o!==void 0&&(u=""+o),a.key!==void 0&&(u=""+a.key),"key"in a){o={};for(var f in a)f!=="key"&&(o[f]=a[f])}else o=a;return a=o.ref,{$$typeof:n,type:r,key:u,ref:a!==void 0?a:null,props:o}}return ja.Fragment=e,ja.jsx=i,ja.jsxs=i,ja}var Qy;function vx(){return Qy||(Qy=1,rh.exports=bx()),rh.exports}var b=vx(),ah={exports:{}},he={};/**
 * @license React
 * react.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var Py;function Sx(){if(Py)return he;Py=1;var n=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),u=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),y=Symbol.for("react.activity"),S=Symbol.iterator;function w(M){return M===null||typeof M!="object"?null:(M=S&&M[S]||M["@@iterator"],typeof M=="function"?M:null)}var E={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},x=Object.assign,_={};function A(M,X,W){this.props=M,this.context=X,this.refs=_,this.updater=W||E}A.prototype.isReactComponent={},A.prototype.setState=function(M,X){if(typeof M!="object"&&typeof M!="function"&&M!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,M,X,"setState")},A.prototype.forceUpdate=function(M){this.updater.enqueueForceUpdate(this,M,"forceUpdate")};function C(){}C.prototype=A.prototype;function H(M,X,W){this.props=M,this.context=X,this.refs=_,this.updater=W||E}var V=H.prototype=new C;V.constructor=H,x(V,A.prototype),V.isPureReactComponent=!0;var K=Array.isArray;function Q(){}var j={H:null,A:null,T:null,S:null},I=Object.prototype.hasOwnProperty;function O(M,X,W){var te=W.ref;return{$$typeof:n,type:M,key:X,ref:te!==void 0?te:null,props:W}}function P(M,X){return O(M.type,X,M.props)}function J(M){return typeof M=="object"&&M!==null&&M.$$typeof===n}function $(M){var X={"=":"=0",":":"=2"};return"$"+M.replace(/[=:]/g,function(W){return X[W]})}var ee=/\/+/g;function ce(M,X){return typeof M=="object"&&M!==null&&M.key!=null?$(""+M.key):X.toString(36)}function Me(M){switch(M.status){case"fulfilled":return M.value;case"rejected":throw M.reason;default:switch(typeof M.status=="string"?M.then(Q,Q):(M.status="pending",M.then(function(X){M.status==="pending"&&(M.status="fulfilled",M.value=X)},function(X){M.status==="pending"&&(M.status="rejected",M.reason=X)})),M.status){case"fulfilled":return M.value;case"rejected":throw M.reason}}throw M}function q(M,X,W,te,ue){var se=typeof M;(se==="undefined"||se==="boolean")&&(M=null);var xe=!1;if(M===null)xe=!0;else switch(se){case"bigint":case"string":case"number":xe=!0;break;case"object":switch(M.$$typeof){case n:case e:xe=!0;break;case m:return xe=M._init,q(xe(M._payload),X,W,te,ue)}}if(xe)return ue=ue(M),xe=te===""?"."+ce(M,0):te,K(ue)?(W="",xe!=null&&(W=xe.replace(ee,"$&/")+"/"),q(ue,X,W,"",function(Rn){return Rn})):ue!=null&&(J(ue)&&(ue=P(ue,W+(ue.key==null||M&&M.key===ue.key?"":(""+ue.key).replace(ee,"$&/")+"/")+xe)),X.push(ue)),1;xe=0;var nt=te===""?".":te+":";if(K(M))for(var Re=0;Re<M.length;Re++)te=M[Re],se=nt+ce(te,Re),xe+=q(te,X,W,se,ue);else if(Re=w(M),typeof Re=="function")for(M=Re.call(M),Re=0;!(te=M.next()).done;)te=te.value,se=nt+ce(te,Re++),xe+=q(te,X,W,se,ue);else if(se==="object"){if(typeof M.then=="function")return q(Me(M),X,W,te,ue);throw X=String(M),Error("Objects are not valid as a React child (found: "+(X==="[object Object]"?"object with keys {"+Object.keys(M).join(", ")+"}":X)+"). If you meant to render a collection of children, use an array instead.")}return xe}function Z(M,X,W){if(M==null)return M;var te=[],ue=0;return q(M,te,"","",function(se){return X.call(W,se,ue++)}),te}function re(M){if(M._status===-1){var X=M._result;X=X(),X.then(function(W){(M._status===0||M._status===-1)&&(M._status=1,M._result=W)},function(W){(M._status===0||M._status===-1)&&(M._status=2,M._result=W)}),M._status===-1&&(M._status=0,M._result=X)}if(M._status===1)return M._result.default;throw M._result}var me=typeof reportError=="function"?reportError:function(M){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var X=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof M=="object"&&M!==null&&typeof M.message=="string"?String(M.message):String(M),error:M});if(!window.dispatchEvent(X))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",M);return}console.error(M)},Ee={map:Z,forEach:function(M,X,W){Z(M,function(){X.apply(this,arguments)},W)},count:function(M){var X=0;return Z(M,function(){X++}),X},toArray:function(M){return Z(M,function(X){return X})||[]},only:function(M){if(!J(M))throw Error("React.Children.only expected to receive a single React element child.");return M}};return he.Activity=y,he.Children=Ee,he.Component=A,he.Fragment=i,he.Profiler=a,he.PureComponent=H,he.StrictMode=r,he.Suspense=d,he.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=j,he.__COMPILER_RUNTIME={__proto__:null,c:function(M){return j.H.useMemoCache(M)}},he.cache=function(M){return function(){return M.apply(null,arguments)}},he.cacheSignal=function(){return null},he.cloneElement=function(M,X,W){if(M==null)throw Error("The argument must be a React element, but you passed "+M+".");var te=x({},M.props),ue=M.key;if(X!=null)for(se in X.key!==void 0&&(ue=""+X.key),X)!I.call(X,se)||se==="key"||se==="__self"||se==="__source"||se==="ref"&&X.ref===void 0||(te[se]=X[se]);var se=arguments.length-2;if(se===1)te.children=W;else if(1<se){for(var xe=Array(se),nt=0;nt<se;nt++)xe[nt]=arguments[nt+2];te.children=xe}return O(M.type,ue,te)},he.createContext=function(M){return M={$$typeof:u,_currentValue:M,_currentValue2:M,_threadCount:0,Provider:null,Consumer:null},M.Provider=M,M.Consumer={$$typeof:o,_context:M},M},he.createElement=function(M,X,W){var te,ue={},se=null;if(X!=null)for(te in X.key!==void 0&&(se=""+X.key),X)I.call(X,te)&&te!=="key"&&te!=="__self"&&te!=="__source"&&(ue[te]=X[te]);var xe=arguments.length-2;if(xe===1)ue.children=W;else if(1<xe){for(var nt=Array(xe),Re=0;Re<xe;Re++)nt[Re]=arguments[Re+2];ue.children=nt}if(M&&M.defaultProps)for(te in xe=M.defaultProps,xe)ue[te]===void 0&&(ue[te]=xe[te]);return O(M,se,ue)},he.createRef=function(){return{current:null}},he.forwardRef=function(M){return{$$typeof:f,render:M}},he.isValidElement=J,he.lazy=function(M){return{$$typeof:m,_payload:{_status:-1,_result:M},_init:re}},he.memo=function(M,X){return{$$typeof:g,type:M,compare:X===void 0?null:X}},he.startTransition=function(M){var X=j.T,W={};j.T=W;try{var te=M(),ue=j.S;ue!==null&&ue(W,te),typeof te=="object"&&te!==null&&typeof te.then=="function"&&te.then(Q,me)}catch(se){me(se)}finally{X!==null&&W.types!==null&&(X.types=W.types),j.T=X}},he.unstable_useCacheRefresh=function(){return j.H.useCacheRefresh()},he.use=function(M){return j.H.use(M)},he.useActionState=function(M,X,W){return j.H.useActionState(M,X,W)},he.useCallback=function(M,X){return j.H.useCallback(M,X)},he.useContext=function(M){return j.H.useContext(M)},he.useDebugValue=function(){},he.useDeferredValue=function(M,X){return j.H.useDeferredValue(M,X)},he.useEffect=function(M,X){return j.H.useEffect(M,X)},he.useEffectEvent=function(M){return j.H.useEffectEvent(M)},he.useId=function(){return j.H.useId()},he.useImperativeHandle=function(M,X,W){return j.H.useImperativeHandle(M,X,W)},he.useInsertionEffect=function(M,X){return j.H.useInsertionEffect(M,X)},he.useLayoutEffect=function(M,X){return j.H.useLayoutEffect(M,X)},he.useMemo=function(M,X){return j.H.useMemo(M,X)},he.useOptimistic=function(M,X){return j.H.useOptimistic(M,X)},he.useReducer=function(M,X,W){return j.H.useReducer(M,X,W)},he.useRef=function(M){return j.H.useRef(M)},he.useState=function(M){return j.H.useState(M)},he.useSyncExternalStore=function(M,X,W){return j.H.useSyncExternalStore(M,X,W)},he.useTransition=function(){return j.H.useTransition()},he.version="19.2.1",he}var Jy;function ed(){return Jy||(Jy=1,ah.exports=Sx()),ah.exports}var R=ed();const Et=yx(R);function yc(n,e,i,r){const[a,o]=Et.useState(i);return Et.useEffect(()=>{let u=!1;return n().then(f=>{u||o(f)}),()=>{u=!0}},e),a}function gs(){const n=Et.useRef(null),[e]=kh(n);return[e,n]}function kh(n){const[e,i]=Et.useState(new DOMRect(0,0,10,10)),r=Et.useCallback(()=>{const a=n==null?void 0:n.current;a&&i(a.getBoundingClientRect())},[n]);return Et.useLayoutEffect(()=>{const a=n==null?void 0:n.current;if(!a)return;r();const o=new ResizeObserver(r);return o.observe(a),window.addEventListener("resize",r),()=>{o.disconnect(),window.removeEventListener("resize",r)}},[r,n]),[e,r]}function u0(n,e,i,r,a){let o=0,u=n.length;for(;o<u;){const f=o+u>>1;i(e,n[f])>=0?o=f+1:u=f}return u}function Zy(n){const e=document.createElement("textarea");e.style.position="absolute",e.style.zIndex="-1000",e.value=n,document.body.appendChild(e),e.select(),document.execCommand("copy"),e.remove()}function jt(n,e){n&&(e=ls.getObject(n,e));const[i,r]=Et.useState(e),a=Et.useCallback(o=>{n?ls.setObject(n,o):r(o)},[n,r]);return Et.useEffect(()=>{if(n){const o=()=>r(ls.getObject(n,e));return ls.onChangeEmitter.addEventListener(n,o),()=>ls.onChangeEmitter.removeEventListener(n,o)}},[e,n]),[i,a]}const Mh=new Map,f0=new Map;let sc;function or(n,e){const[i,r]=Et.useState();f0.set(n,{setter:r,defaultValue:e});const a=Et.useCallback(o=>{const u=Mh.get(sc||"default")||{};u[n]=o,Mh.set(sc||"default",u),r(o)},[n]);return[i,a]}function wx(n){if(sc===n)return;sc=n;const e=Mh.get(n)||{};for(const[i,r]of f0.entries())r.setter(e[i]||r.defaultValue)}class xx{constructor(){this.onChangeEmitter=new EventTarget}getString(e,i){return localStorage[e]||i}setString(e,i){var r;localStorage[e]=i,this.onChangeEmitter.dispatchEvent(new Event(e)),(r=window.saveSettings)==null||r.call(window)}getObject(e,i){if(!localStorage[e])return i;try{return JSON.parse(localStorage[e])}catch{return i}}setObject(e,i){var r;localStorage[e]=JSON.stringify(i),this.onChangeEmitter.dispatchEvent(new Event(e)),(r=window.saveSettings)==null||r.call(window)}}const ls=new xx;function ut(...n){return n.filter(Boolean).join(" ")}function td(n){n&&(n!=null&&n.scrollIntoViewIfNeeded?n.scrollIntoViewIfNeeded(!1):n==null||n.scrollIntoView())}const Wy="\\u0000-\\u0020\\u007f-\\u009f",h0=new RegExp("(?:[a-zA-Z][a-zA-Z0-9+.-]{2,}:\\/\\/|www\\.)[^\\s"+Wy+'"]{2,}[^\\s'+Wy+`"')}\\],:;.!?]`,"ug");function _x(){const[n,e]=Et.useState(!1),i=Et.useCallback(()=>{const r=[];return e(a=>(r.push(setTimeout(()=>e(!1),1e3)),a?(r.push(setTimeout(()=>e(!0),50)),!1):!0)),()=>r.forEach(clearTimeout)},[e]);return[n,i]}const Ex="system",d0="theme",Tx=[{label:"Dark mode",value:"dark-mode"},{label:"Light mode",value:"light-mode"},{label:"System",value:"system"}],p0=window.matchMedia("(prefers-color-scheme: dark)");function B2(){document.playwrightThemeInitialized||(document.playwrightThemeInitialized=!0,document.defaultView.addEventListener("focus",n=>{n.target.document.nodeType===Node.DOCUMENT_NODE&&document.body.classList.remove("inactive")},!1),document.defaultView.addEventListener("blur",n=>{document.body.classList.add("inactive")},!1),Oh(jh()),p0.addEventListener("change",()=>{Oh(jh())}))}const nd=new Set;function Oh(n){const e=Ax(),i=n==="system"?p0.matches?"dark-mode":"light-mode":n;if(e!==i){e&&document.documentElement.classList.remove(e),document.documentElement.classList.add(i);for(const r of nd)r(i)}}function q2(n){nd.add(n)}function $2(n){nd.delete(n)}function jh(){return ls.getString(d0,Ex)}function Ax(){return document.documentElement.classList.contains("dark-mode")?"dark-mode":document.documentElement.classList.contains("light-mode")?"light-mode":null}function Cx(){const[n,e]=Et.useState(jh());return Et.useEffect(()=>{ls.setString(d0,n),Oh(n)},[n]),[n,e]}var lh={exports:{}},La={},oh={exports:{}},ch={};/**
 * @license React
 * scheduler.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var eb;function Nx(){return eb||(eb=1,(function(n){function e(q,Z){var re=q.length;q.push(Z);e:for(;0<re;){var me=re-1>>>1,Ee=q[me];if(0<a(Ee,Z))q[me]=Z,q[re]=Ee,re=me;else break e}}function i(q){return q.length===0?null:q[0]}function r(q){if(q.length===0)return null;var Z=q[0],re=q.pop();if(re!==Z){q[0]=re;e:for(var me=0,Ee=q.length,M=Ee>>>1;me<M;){var X=2*(me+1)-1,W=q[X],te=X+1,ue=q[te];if(0>a(W,re))te<Ee&&0>a(ue,W)?(q[me]=ue,q[te]=re,me=te):(q[me]=W,q[X]=re,me=X);else if(te<Ee&&0>a(ue,re))q[me]=ue,q[te]=re,me=te;else break e}}return Z}function a(q,Z){var re=q.sortIndex-Z.sortIndex;return re!==0?re:q.id-Z.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;n.unstable_now=function(){return o.now()}}else{var u=Date,f=u.now();n.unstable_now=function(){return u.now()-f}}var d=[],g=[],m=1,y=null,S=3,w=!1,E=!1,x=!1,_=!1,A=typeof setTimeout=="function"?setTimeout:null,C=typeof clearTimeout=="function"?clearTimeout:null,H=typeof setImmediate<"u"?setImmediate:null;function V(q){for(var Z=i(g);Z!==null;){if(Z.callback===null)r(g);else if(Z.startTime<=q)r(g),Z.sortIndex=Z.expirationTime,e(d,Z);else break;Z=i(g)}}function K(q){if(x=!1,V(q),!E)if(i(d)!==null)E=!0,Q||(Q=!0,$());else{var Z=i(g);Z!==null&&Me(K,Z.startTime-q)}}var Q=!1,j=-1,I=5,O=-1;function P(){return _?!0:!(n.unstable_now()-O<I)}function J(){if(_=!1,Q){var q=n.unstable_now();O=q;var Z=!0;try{e:{E=!1,x&&(x=!1,C(j),j=-1),w=!0;var re=S;try{t:{for(V(q),y=i(d);y!==null&&!(y.expirationTime>q&&P());){var me=y.callback;if(typeof me=="function"){y.callback=null,S=y.priorityLevel;var Ee=me(y.expirationTime<=q);if(q=n.unstable_now(),typeof Ee=="function"){y.callback=Ee,V(q),Z=!0;break t}y===i(d)&&r(d),V(q)}else r(d);y=i(d)}if(y!==null)Z=!0;else{var M=i(g);M!==null&&Me(K,M.startTime-q),Z=!1}}break e}finally{y=null,S=re,w=!1}Z=void 0}}finally{Z?$():Q=!1}}}var $;if(typeof H=="function")$=function(){H(J)};else if(typeof MessageChannel<"u"){var ee=new MessageChannel,ce=ee.port2;ee.port1.onmessage=J,$=function(){ce.postMessage(null)}}else $=function(){A(J,0)};function Me(q,Z){j=A(function(){q(n.unstable_now())},Z)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(q){q.callback=null},n.unstable_forceFrameRate=function(q){0>q||125<q?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):I=0<q?Math.floor(1e3/q):5},n.unstable_getCurrentPriorityLevel=function(){return S},n.unstable_next=function(q){switch(S){case 1:case 2:case 3:var Z=3;break;default:Z=S}var re=S;S=Z;try{return q()}finally{S=re}},n.unstable_requestPaint=function(){_=!0},n.unstable_runWithPriority=function(q,Z){switch(q){case 1:case 2:case 3:case 4:case 5:break;default:q=3}var re=S;S=q;try{return Z()}finally{S=re}},n.unstable_scheduleCallback=function(q,Z,re){var me=n.unstable_now();switch(typeof re=="object"&&re!==null?(re=re.delay,re=typeof re=="number"&&0<re?me+re:me):re=me,q){case 1:var Ee=-1;break;case 2:Ee=250;break;case 5:Ee=1073741823;break;case 4:Ee=1e4;break;default:Ee=5e3}return Ee=re+Ee,q={id:m++,callback:Z,priorityLevel:q,startTime:re,expirationTime:Ee,sortIndex:-1},re>me?(q.sortIndex=re,e(g,q),i(d)===null&&q===i(g)&&(x?(C(j),j=-1):x=!0,Me(K,re-me))):(q.sortIndex=Ee,e(d,q),E||w||(E=!0,Q||(Q=!0,$()))),q},n.unstable_shouldYield=P,n.unstable_wrapCallback=function(q){var Z=S;return function(){var re=S;S=Z;try{return q.apply(this,arguments)}finally{S=re}}}})(ch)),ch}var tb;function kx(){return tb||(tb=1,oh.exports=Nx()),oh.exports}var uh={exports:{}},At={};/**
 * @license React
 * react-dom.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var nb;function Mx(){if(nb)return At;nb=1;var n=ed();function e(d){var g="https://react.dev/errors/"+d;if(1<arguments.length){g+="?args[]="+encodeURIComponent(arguments[1]);for(var m=2;m<arguments.length;m++)g+="&args[]="+encodeURIComponent(arguments[m])}return"Minified React error #"+d+"; visit "+g+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(){}var r={d:{f:i,r:function(){throw Error(e(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},a=Symbol.for("react.portal");function o(d,g,m){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:y==null?null:""+y,children:d,containerInfo:g,implementation:m}}var u=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(d,g){if(d==="font")return"";if(typeof g=="string")return g==="use-credentials"?g:""}return At.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,At.createPortal=function(d,g){var m=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!g||g.nodeType!==1&&g.nodeType!==9&&g.nodeType!==11)throw Error(e(299));return o(d,g,null,m)},At.flushSync=function(d){var g=u.T,m=r.p;try{if(u.T=null,r.p=2,d)return d()}finally{u.T=g,r.p=m,r.d.f()}},At.preconnect=function(d,g){typeof d=="string"&&(g?(g=g.crossOrigin,g=typeof g=="string"?g==="use-credentials"?g:"":void 0):g=null,r.d.C(d,g))},At.prefetchDNS=function(d){typeof d=="string"&&r.d.D(d)},At.preinit=function(d,g){if(typeof d=="string"&&g&&typeof g.as=="string"){var m=g.as,y=f(m,g.crossOrigin),S=typeof g.integrity=="string"?g.integrity:void 0,w=typeof g.fetchPriority=="string"?g.fetchPriority:void 0;m==="style"?r.d.S(d,typeof g.precedence=="string"?g.precedence:void 0,{crossOrigin:y,integrity:S,fetchPriority:w}):m==="script"&&r.d.X(d,{crossOrigin:y,integrity:S,fetchPriority:w,nonce:typeof g.nonce=="string"?g.nonce:void 0})}},At.preinitModule=function(d,g){if(typeof d=="string")if(typeof g=="object"&&g!==null){if(g.as==null||g.as==="script"){var m=f(g.as,g.crossOrigin);r.d.M(d,{crossOrigin:m,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0})}}else g==null&&r.d.M(d)},At.preload=function(d,g){if(typeof d=="string"&&typeof g=="object"&&g!==null&&typeof g.as=="string"){var m=g.as,y=f(m,g.crossOrigin);r.d.L(d,m,{crossOrigin:y,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0,type:typeof g.type=="string"?g.type:void 0,fetchPriority:typeof g.fetchPriority=="string"?g.fetchPriority:void 0,referrerPolicy:typeof g.referrerPolicy=="string"?g.referrerPolicy:void 0,imageSrcSet:typeof g.imageSrcSet=="string"?g.imageSrcSet:void 0,imageSizes:typeof g.imageSizes=="string"?g.imageSizes:void 0,media:typeof g.media=="string"?g.media:void 0})}},At.preloadModule=function(d,g){if(typeof d=="string")if(g){var m=f(g.as,g.crossOrigin);r.d.m(d,{as:typeof g.as=="string"&&g.as!=="script"?g.as:void 0,crossOrigin:m,integrity:typeof g.integrity=="string"?g.integrity:void 0})}else r.d.m(d)},At.requestFormReset=function(d){r.d.r(d)},At.unstable_batchedUpdates=function(d,g){return d(g)},At.useFormState=function(d,g,m){return u.H.useFormState(d,g,m)},At.useFormStatus=function(){return u.H.useHostTransitionStatus()},At.version="19.2.1",At}var ib;function Ox(){if(ib)return uh.exports;ib=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}return n(),uh.exports=Mx(),uh.exports}/**
 * @license React
 * react-dom-client.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var sb;function jx(){if(sb)return La;sb=1;var n=kx(),e=ed(),i=Ox();function r(t){var s="https://react.dev/errors/"+t;if(1<arguments.length){s+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)s+="&args[]="+encodeURIComponent(arguments[l])}return"Minified React error #"+t+"; visit "+s+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function o(t){var s=t,l=t;if(t.alternate)for(;s.return;)s=s.return;else{t=s;do s=t,(s.flags&4098)!==0&&(l=s.return),t=s.return;while(t)}return s.tag===3?l:null}function u(t){if(t.tag===13){var s=t.memoizedState;if(s===null&&(t=t.alternate,t!==null&&(s=t.memoizedState)),s!==null)return s.dehydrated}return null}function f(t){if(t.tag===31){var s=t.memoizedState;if(s===null&&(t=t.alternate,t!==null&&(s=t.memoizedState)),s!==null)return s.dehydrated}return null}function d(t){if(o(t)!==t)throw Error(r(188))}function g(t){var s=t.alternate;if(!s){if(s=o(t),s===null)throw Error(r(188));return s!==t?null:t}for(var l=t,c=s;;){var h=l.return;if(h===null)break;var p=h.alternate;if(p===null){if(c=h.return,c!==null){l=c;continue}break}if(h.child===p.child){for(p=h.child;p;){if(p===l)return d(h),t;if(p===c)return d(h),s;p=p.sibling}throw Error(r(188))}if(l.return!==c.return)l=h,c=p;else{for(var v=!1,T=h.child;T;){if(T===l){v=!0,l=h,c=p;break}if(T===c){v=!0,c=h,l=p;break}T=T.sibling}if(!v){for(T=p.child;T;){if(T===l){v=!0,l=p,c=h;break}if(T===c){v=!0,c=p,l=h;break}T=T.sibling}if(!v)throw Error(r(189))}}if(l.alternate!==c)throw Error(r(190))}if(l.tag!==3)throw Error(r(188));return l.stateNode.current===l?t:s}function m(t){var s=t.tag;if(s===5||s===26||s===27||s===6)return t;for(t=t.child;t!==null;){if(s=m(t),s!==null)return s;t=t.sibling}return null}var y=Object.assign,S=Symbol.for("react.element"),w=Symbol.for("react.transitional.element"),E=Symbol.for("react.portal"),x=Symbol.for("react.fragment"),_=Symbol.for("react.strict_mode"),A=Symbol.for("react.profiler"),C=Symbol.for("react.consumer"),H=Symbol.for("react.context"),V=Symbol.for("react.forward_ref"),K=Symbol.for("react.suspense"),Q=Symbol.for("react.suspense_list"),j=Symbol.for("react.memo"),I=Symbol.for("react.lazy"),O=Symbol.for("react.activity"),P=Symbol.for("react.memo_cache_sentinel"),J=Symbol.iterator;function $(t){return t===null||typeof t!="object"?null:(t=J&&t[J]||t["@@iterator"],typeof t=="function"?t:null)}var ee=Symbol.for("react.client.reference");function ce(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===ee?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case x:return"Fragment";case A:return"Profiler";case _:return"StrictMode";case K:return"Suspense";case Q:return"SuspenseList";case O:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case E:return"Portal";case H:return t.displayName||"Context";case C:return(t._context.displayName||"Context")+".Consumer";case V:var s=t.render;return t=t.displayName,t||(t=s.displayName||s.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case j:return s=t.displayName||null,s!==null?s:ce(t.type)||"Memo";case I:s=t._payload,t=t._init;try{return ce(t(s))}catch{}}return null}var Me=Array.isArray,q=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Z=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,re={pending:!1,data:null,method:null,action:null},me=[],Ee=-1;function M(t){return{current:t}}function X(t){0>Ee||(t.current=me[Ee],me[Ee]=null,Ee--)}function W(t,s){Ee++,me[Ee]=t.current,t.current=s}var te=M(null),ue=M(null),se=M(null),xe=M(null);function nt(t,s){switch(W(se,s),W(ue,t),W(te,null),s.nodeType){case 9:case 11:t=(t=s.documentElement)&&(t=t.namespaceURI)?yy(t):0;break;default:if(t=s.tagName,s=s.namespaceURI)s=yy(s),t=by(s,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}X(te),W(te,t)}function Re(){X(te),X(ue),X(se)}function Rn(t){t.memoizedState!==null&&W(xe,t);var s=te.current,l=by(s,t.type);s!==l&&(W(ue,t),W(te,l))}function fe(t){ue.current===t&&(X(te),X(ue)),xe.current===t&&(X(xe),Na._currentValue=re)}var _e,Ue;function He(t){if(_e===void 0)try{throw Error()}catch(l){var s=l.stack.trim().match(/\n( *(at )?)/);_e=s&&s[1]||"",Ue=-1<l.stack.indexOf(`
    at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
`+_e+t+Ue}var Xt=!1;function Ye(t,s){if(!t||Xt)return"";Xt=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var c={DetermineComponentFrameRoot:function(){try{if(s){var F=function(){throw Error()};if(Object.defineProperty(F.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(F,[])}catch(B){var U=B}Reflect.construct(t,[],F)}else{try{F.call()}catch(B){U=B}t.call(F.prototype)}}else{try{throw Error()}catch(B){U=B}(F=t())&&typeof F.catch=="function"&&F.catch(function(){})}}catch(B){if(B&&U&&typeof B.stack=="string")return[B.stack,U.stack]}return[null,null]}};c.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var h=Object.getOwnPropertyDescriptor(c.DetermineComponentFrameRoot,"name");h&&h.configurable&&Object.defineProperty(c.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var p=c.DetermineComponentFrameRoot(),v=p[0],T=p[1];if(v&&T){var N=v.split(`
`),z=T.split(`
`);for(h=c=0;c<N.length&&!N[c].includes("DetermineComponentFrameRoot");)c++;for(;h<z.length&&!z[h].includes("DetermineComponentFrameRoot");)h++;if(c===N.length||h===z.length)for(c=N.length-1,h=z.length-1;1<=c&&0<=h&&N[c]!==z[h];)h--;for(;1<=c&&0<=h;c--,h--)if(N[c]!==z[h]){if(c!==1||h!==1)do if(c--,h--,0>h||N[c]!==z[h]){var G=`
`+N[c].replace(" at new "," at ");return t.displayName&&G.includes("<anonymous>")&&(G=G.replace("<anonymous>",t.displayName)),G}while(1<=c&&0<=h);break}}}finally{Xt=!1,Error.prepareStackTrace=l}return(l=t?t.displayName||t.name:"")?He(l):""}function Yt(t,s){switch(t.tag){case 26:case 27:case 5:return He(t.type);case 16:return He("Lazy");case 13:return t.child!==s&&s!==null?He("Suspense Fallback"):He("Suspense");case 19:return He("SuspenseList");case 0:case 15:return Ye(t.type,!1);case 11:return Ye(t.type.render,!1);case 1:return Ye(t.type,!0);case 31:return He("Activity");default:return""}}function bs(t){try{var s="",l=null;do s+=Yt(t,l),l=t,t=t.return;while(t);return s}catch(c){return`
Error generating stack: `+c.message+`
`+c.stack}}var qr=Object.prototype.hasOwnProperty,vs=n.unstable_scheduleCallback,Ss=n.unstable_cancelCallback,ws=n.unstable_shouldYield,qc=n.unstable_requestPaint,it=n.unstable_now,$c=n.unstable_getCurrentPriorityLevel,yl=n.unstable_ImmediatePriority,bl=n.unstable_UserBlockingPriority,xs=n.unstable_NormalPriority,vl=n.unstable_LowPriority,_s=n.unstable_IdlePriority,Ic=n.log,Vc=n.unstable_setDisableYieldValue,Bi=null,ft=null;function Ft(t){if(typeof Ic=="function"&&Vc(t),ft&&typeof ft.setStrictMode=="function")try{ft.setStrictMode(Bi,t)}catch{}}var kt=Math.clz32?Math.clz32:Sl,Gc=Math.log,Kc=Math.LN2;function Sl(t){return t>>>=0,t===0?32:31-(Gc(t)/Kc|0)|0}var le=256,Tn=262144,sn=4194304;function qi(t){var s=t&42;if(s!==0)return s;switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function wl(t,s,l){var c=t.pendingLanes;if(c===0)return 0;var h=0,p=t.suspendedLanes,v=t.pingedLanes;t=t.warmLanes;var T=c&134217727;return T!==0?(c=T&~p,c!==0?h=qi(c):(v&=T,v!==0?h=qi(v):l||(l=T&~t,l!==0&&(h=qi(l))))):(T=c&~p,T!==0?h=qi(T):v!==0?h=qi(v):l||(l=c&~t,l!==0&&(h=qi(l)))),h===0?0:s!==0&&s!==h&&(s&p)===0&&(p=h&-h,l=s&-s,p>=l||p===32&&(l&4194048)!==0)?s:h}function $r(t,s){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&s)===0}function iw(t,s){switch(t){case 1:case 2:case 4:case 8:case 64:return s+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return s+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Zd(){var t=sn;return sn<<=1,(sn&62914560)===0&&(sn=4194304),t}function Xc(t){for(var s=[],l=0;31>l;l++)s.push(t);return s}function Ir(t,s){t.pendingLanes|=s,s!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function sw(t,s,l,c,h,p){var v=t.pendingLanes;t.pendingLanes=l,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=l,t.entangledLanes&=l,t.errorRecoveryDisabledLanes&=l,t.shellSuspendCounter=0;var T=t.entanglements,N=t.expirationTimes,z=t.hiddenUpdates;for(l=v&~l;0<l;){var G=31-kt(l),F=1<<G;T[G]=0,N[G]=-1;var U=z[G];if(U!==null)for(z[G]=null,G=0;G<U.length;G++){var B=U[G];B!==null&&(B.lane&=-536870913)}l&=~F}c!==0&&Wd(t,c,0),p!==0&&h===0&&t.tag!==0&&(t.suspendedLanes|=p&~(v&~s))}function Wd(t,s,l){t.pendingLanes|=s,t.suspendedLanes&=~s;var c=31-kt(s);t.entangledLanes|=s,t.entanglements[c]=t.entanglements[c]|1073741824|l&261930}function ep(t,s){var l=t.entangledLanes|=s;for(t=t.entanglements;l;){var c=31-kt(l),h=1<<c;h&s|t[c]&s&&(t[c]|=s),l&=~h}}function tp(t,s){var l=s&-s;return l=(l&42)!==0?1:Yc(l),(l&(t.suspendedLanes|s))!==0?0:l}function Yc(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function Fc(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function np(){var t=Z.p;return t!==0?t:(t=window.event,t===void 0?32:$y(t.type))}function ip(t,s){var l=Z.p;try{return Z.p=t,s()}finally{Z.p=l}}var li=Math.random().toString(36).slice(2),bt="__reactFiber$"+li,Lt="__reactProps$"+li,Es="__reactContainer$"+li,Qc="__reactEvents$"+li,rw="__reactListeners$"+li,aw="__reactHandles$"+li,sp="__reactResources$"+li,Vr="__reactMarker$"+li;function Pc(t){delete t[bt],delete t[Lt],delete t[Qc],delete t[rw],delete t[aw]}function Ts(t){var s=t[bt];if(s)return s;for(var l=t.parentNode;l;){if(s=l[Es]||l[bt]){if(l=s.alternate,s.child!==null||l!==null&&l.child!==null)for(t=Ty(t);t!==null;){if(l=t[bt])return l;t=Ty(t)}return s}t=l,l=t.parentNode}return null}function As(t){if(t=t[bt]||t[Es]){var s=t.tag;if(s===5||s===6||s===13||s===31||s===26||s===27||s===3)return t}return null}function Gr(t){var s=t.tag;if(s===5||s===26||s===27||s===6)return t.stateNode;throw Error(r(33))}function Cs(t){var s=t[sp];return s||(s=t[sp]={hoistableStyles:new Map,hoistableScripts:new Map}),s}function gt(t){t[Vr]=!0}var rp=new Set,ap={};function $i(t,s){Ns(t,s),Ns(t+"Capture",s)}function Ns(t,s){for(ap[t]=s,t=0;t<s.length;t++)rp.add(s[t])}var lw=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),lp={},op={};function ow(t){return qr.call(op,t)?!0:qr.call(lp,t)?!1:lw.test(t)?op[t]=!0:(lp[t]=!0,!1)}function xl(t,s,l){if(ow(s))if(l===null)t.removeAttribute(s);else{switch(typeof l){case"undefined":case"function":case"symbol":t.removeAttribute(s);return;case"boolean":var c=s.toLowerCase().slice(0,5);if(c!=="data-"&&c!=="aria-"){t.removeAttribute(s);return}}t.setAttribute(s,""+l)}}function _l(t,s,l){if(l===null)t.removeAttribute(s);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(s);return}t.setAttribute(s,""+l)}}function Dn(t,s,l,c){if(c===null)t.removeAttribute(l);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(l);return}t.setAttributeNS(s,l,""+c)}}function rn(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function cp(t){var s=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function cw(t,s,l){var c=Object.getOwnPropertyDescriptor(t.constructor.prototype,s);if(!t.hasOwnProperty(s)&&typeof c<"u"&&typeof c.get=="function"&&typeof c.set=="function"){var h=c.get,p=c.set;return Object.defineProperty(t,s,{configurable:!0,get:function(){return h.call(this)},set:function(v){l=""+v,p.call(this,v)}}),Object.defineProperty(t,s,{enumerable:c.enumerable}),{getValue:function(){return l},setValue:function(v){l=""+v},stopTracking:function(){t._valueTracker=null,delete t[s]}}}}function Jc(t){if(!t._valueTracker){var s=cp(t)?"checked":"value";t._valueTracker=cw(t,s,""+t[s])}}function up(t){if(!t)return!1;var s=t._valueTracker;if(!s)return!0;var l=s.getValue(),c="";return t&&(c=cp(t)?t.checked?"true":"false":t.value),t=c,t!==l?(s.setValue(t),!0):!1}function El(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var uw=/[\n"\\]/g;function an(t){return t.replace(uw,function(s){return"\\"+s.charCodeAt(0).toString(16)+" "})}function Zc(t,s,l,c,h,p,v,T){t.name="",v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"?t.type=v:t.removeAttribute("type"),s!=null?v==="number"?(s===0&&t.value===""||t.value!=s)&&(t.value=""+rn(s)):t.value!==""+rn(s)&&(t.value=""+rn(s)):v!=="submit"&&v!=="reset"||t.removeAttribute("value"),s!=null?Wc(t,v,rn(s)):l!=null?Wc(t,v,rn(l)):c!=null&&t.removeAttribute("value"),h==null&&p!=null&&(t.defaultChecked=!!p),h!=null&&(t.checked=h&&typeof h!="function"&&typeof h!="symbol"),T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"?t.name=""+rn(T):t.removeAttribute("name")}function fp(t,s,l,c,h,p,v,T){if(p!=null&&typeof p!="function"&&typeof p!="symbol"&&typeof p!="boolean"&&(t.type=p),s!=null||l!=null){if(!(p!=="submit"&&p!=="reset"||s!=null)){Jc(t);return}l=l!=null?""+rn(l):"",s=s!=null?""+rn(s):l,T||s===t.value||(t.value=s),t.defaultValue=s}c=c??h,c=typeof c!="function"&&typeof c!="symbol"&&!!c,t.checked=T?t.checked:!!c,t.defaultChecked=!!c,v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"&&(t.name=v),Jc(t)}function Wc(t,s,l){s==="number"&&El(t.ownerDocument)===t||t.defaultValue===""+l||(t.defaultValue=""+l)}function ks(t,s,l,c){if(t=t.options,s){s={};for(var h=0;h<l.length;h++)s["$"+l[h]]=!0;for(l=0;l<t.length;l++)h=s.hasOwnProperty("$"+t[l].value),t[l].selected!==h&&(t[l].selected=h),h&&c&&(t[l].defaultSelected=!0)}else{for(l=""+rn(l),s=null,h=0;h<t.length;h++){if(t[h].value===l){t[h].selected=!0,c&&(t[h].defaultSelected=!0);return}s!==null||t[h].disabled||(s=t[h])}s!==null&&(s.selected=!0)}}function hp(t,s,l){if(s!=null&&(s=""+rn(s),s!==t.value&&(t.value=s),l==null)){t.defaultValue!==s&&(t.defaultValue=s);return}t.defaultValue=l!=null?""+rn(l):""}function dp(t,s,l,c){if(s==null){if(c!=null){if(l!=null)throw Error(r(92));if(Me(c)){if(1<c.length)throw Error(r(93));c=c[0]}l=c}l==null&&(l=""),s=l}l=rn(s),t.defaultValue=l,c=t.textContent,c===l&&c!==""&&c!==null&&(t.value=c),Jc(t)}function Ms(t,s){if(s){var l=t.firstChild;if(l&&l===t.lastChild&&l.nodeType===3){l.nodeValue=s;return}}t.textContent=s}var fw=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function pp(t,s,l){var c=s.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?c?t.setProperty(s,""):s==="float"?t.cssFloat="":t[s]="":c?t.setProperty(s,l):typeof l!="number"||l===0||fw.has(s)?s==="float"?t.cssFloat=l:t[s]=(""+l).trim():t[s]=l+"px"}function gp(t,s,l){if(s!=null&&typeof s!="object")throw Error(r(62));if(t=t.style,l!=null){for(var c in l)!l.hasOwnProperty(c)||s!=null&&s.hasOwnProperty(c)||(c.indexOf("--")===0?t.setProperty(c,""):c==="float"?t.cssFloat="":t[c]="");for(var h in s)c=s[h],s.hasOwnProperty(h)&&l[h]!==c&&pp(t,h,c)}else for(var p in s)s.hasOwnProperty(p)&&pp(t,p,s[p])}function eu(t){if(t.indexOf("-")===-1)return!1;switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var hw=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),dw=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Tl(t){return dw.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function zn(){}var tu=null;function nu(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Os=null,js=null;function mp(t){var s=As(t);if(s&&(t=s.stateNode)){var l=t[Lt]||null;e:switch(t=s.stateNode,s.type){case"input":if(Zc(t,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),s=l.name,l.type==="radio"&&s!=null){for(l=t;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+an(""+s)+'"][type="radio"]'),s=0;s<l.length;s++){var c=l[s];if(c!==t&&c.form===t.form){var h=c[Lt]||null;if(!h)throw Error(r(90));Zc(c,h.value,h.defaultValue,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name)}}for(s=0;s<l.length;s++)c=l[s],c.form===t.form&&up(c)}break e;case"textarea":hp(t,l.value,l.defaultValue);break e;case"select":s=l.value,s!=null&&ks(t,!!l.multiple,s,!1)}}}var iu=!1;function yp(t,s,l){if(iu)return t(s,l);iu=!0;try{var c=t(s);return c}finally{if(iu=!1,(Os!==null||js!==null)&&(ho(),Os&&(s=Os,t=js,js=Os=null,mp(s),t)))for(s=0;s<t.length;s++)mp(t[s])}}function Kr(t,s){var l=t.stateNode;if(l===null)return null;var c=l[Lt]||null;if(c===null)return null;l=c[s];e:switch(s){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(c=!c.disabled)||(t=t.type,c=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!c;break e;default:t=!1}if(t)return null;if(l&&typeof l!="function")throw Error(r(231,s,typeof l));return l}var Un=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),su=!1;if(Un)try{var Xr={};Object.defineProperty(Xr,"passive",{get:function(){su=!0}}),window.addEventListener("test",Xr,Xr),window.removeEventListener("test",Xr,Xr)}catch{su=!1}var oi=null,ru=null,Al=null;function bp(){if(Al)return Al;var t,s=ru,l=s.length,c,h="value"in oi?oi.value:oi.textContent,p=h.length;for(t=0;t<l&&s[t]===h[t];t++);var v=l-t;for(c=1;c<=v&&s[l-c]===h[p-c];c++);return Al=h.slice(t,1<c?1-c:void 0)}function Cl(t){var s=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&s===13&&(t=13)):t=s,t===10&&(t=13),32<=t||t===13?t:0}function Nl(){return!0}function vp(){return!1}function Rt(t){function s(l,c,h,p,v){this._reactName=l,this._targetInst=h,this.type=c,this.nativeEvent=p,this.target=v,this.currentTarget=null;for(var T in t)t.hasOwnProperty(T)&&(l=t[T],this[T]=l?l(p):p[T]);return this.isDefaultPrevented=(p.defaultPrevented!=null?p.defaultPrevented:p.returnValue===!1)?Nl:vp,this.isPropagationStopped=vp,this}return y(s.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=Nl)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=Nl)},persist:function(){},isPersistent:Nl}),s}var Ii={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},kl=Rt(Ii),Yr=y({},Ii,{view:0,detail:0}),pw=Rt(Yr),au,lu,Fr,Ml=y({},Yr,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:cu,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==Fr&&(Fr&&t.type==="mousemove"?(au=t.screenX-Fr.screenX,lu=t.screenY-Fr.screenY):lu=au=0,Fr=t),au)},movementY:function(t){return"movementY"in t?t.movementY:lu}}),Sp=Rt(Ml),gw=y({},Ml,{dataTransfer:0}),mw=Rt(gw),yw=y({},Yr,{relatedTarget:0}),ou=Rt(yw),bw=y({},Ii,{animationName:0,elapsedTime:0,pseudoElement:0}),vw=Rt(bw),Sw=y({},Ii,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),ww=Rt(Sw),xw=y({},Ii,{data:0}),wp=Rt(xw),_w={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Ew={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Tw={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Aw(t){var s=this.nativeEvent;return s.getModifierState?s.getModifierState(t):(t=Tw[t])?!!s[t]:!1}function cu(){return Aw}var Cw=y({},Yr,{key:function(t){if(t.key){var s=_w[t.key]||t.key;if(s!=="Unidentified")return s}return t.type==="keypress"?(t=Cl(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?Ew[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:cu,charCode:function(t){return t.type==="keypress"?Cl(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Cl(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),Nw=Rt(Cw),kw=y({},Ml,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),xp=Rt(kw),Mw=y({},Yr,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:cu}),Ow=Rt(Mw),jw=y({},Ii,{propertyName:0,elapsedTime:0,pseudoElement:0}),Lw=Rt(jw),Rw=y({},Ml,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),Dw=Rt(Rw),zw=y({},Ii,{newState:0,oldState:0}),Uw=Rt(zw),Hw=[9,13,27,32],uu=Un&&"CompositionEvent"in window,Qr=null;Un&&"documentMode"in document&&(Qr=document.documentMode);var Bw=Un&&"TextEvent"in window&&!Qr,_p=Un&&(!uu||Qr&&8<Qr&&11>=Qr),Ep=" ",Tp=!1;function Ap(t,s){switch(t){case"keyup":return Hw.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Cp(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Ls=!1;function qw(t,s){switch(t){case"compositionend":return Cp(s);case"keypress":return s.which!==32?null:(Tp=!0,Ep);case"textInput":return t=s.data,t===Ep&&Tp?null:t;default:return null}}function $w(t,s){if(Ls)return t==="compositionend"||!uu&&Ap(t,s)?(t=bp(),Al=ru=oi=null,Ls=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(s.ctrlKey||s.altKey||s.metaKey)||s.ctrlKey&&s.altKey){if(s.char&&1<s.char.length)return s.char;if(s.which)return String.fromCharCode(s.which)}return null;case"compositionend":return _p&&s.locale!=="ko"?null:s.data;default:return null}}var Iw={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Np(t){var s=t&&t.nodeName&&t.nodeName.toLowerCase();return s==="input"?!!Iw[t.type]:s==="textarea"}function kp(t,s,l,c){Os?js?js.push(c):js=[c]:Os=c,s=So(s,"onChange"),0<s.length&&(l=new kl("onChange","change",null,l,c),t.push({event:l,listeners:s}))}var Pr=null,Jr=null;function Vw(t){fy(t,0)}function Ol(t){var s=Gr(t);if(up(s))return t}function Mp(t,s){if(t==="change")return s}var Op=!1;if(Un){var fu;if(Un){var hu="oninput"in document;if(!hu){var jp=document.createElement("div");jp.setAttribute("oninput","return;"),hu=typeof jp.oninput=="function"}fu=hu}else fu=!1;Op=fu&&(!document.documentMode||9<document.documentMode)}function Lp(){Pr&&(Pr.detachEvent("onpropertychange",Rp),Jr=Pr=null)}function Rp(t){if(t.propertyName==="value"&&Ol(Jr)){var s=[];kp(s,Jr,t,nu(t)),yp(Vw,s)}}function Gw(t,s,l){t==="focusin"?(Lp(),Pr=s,Jr=l,Pr.attachEvent("onpropertychange",Rp)):t==="focusout"&&Lp()}function Kw(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Ol(Jr)}function Xw(t,s){if(t==="click")return Ol(s)}function Yw(t,s){if(t==="input"||t==="change")return Ol(s)}function Fw(t,s){return t===s&&(t!==0||1/t===1/s)||t!==t&&s!==s}var Qt=typeof Object.is=="function"?Object.is:Fw;function Zr(t,s){if(Qt(t,s))return!0;if(typeof t!="object"||t===null||typeof s!="object"||s===null)return!1;var l=Object.keys(t),c=Object.keys(s);if(l.length!==c.length)return!1;for(c=0;c<l.length;c++){var h=l[c];if(!qr.call(s,h)||!Qt(t[h],s[h]))return!1}return!0}function Dp(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function zp(t,s){var l=Dp(t);t=0;for(var c;l;){if(l.nodeType===3){if(c=t+l.textContent.length,t<=s&&c>=s)return{node:l,offset:s-t};t=c}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=Dp(l)}}function Up(t,s){return t&&s?t===s?!0:t&&t.nodeType===3?!1:s&&s.nodeType===3?Up(t,s.parentNode):"contains"in t?t.contains(s):t.compareDocumentPosition?!!(t.compareDocumentPosition(s)&16):!1:!1}function Hp(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var s=El(t.document);s instanceof t.HTMLIFrameElement;){try{var l=typeof s.contentWindow.location.href=="string"}catch{l=!1}if(l)t=s.contentWindow;else break;s=El(t.document)}return s}function du(t){var s=t&&t.nodeName&&t.nodeName.toLowerCase();return s&&(s==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||s==="textarea"||t.contentEditable==="true")}var Qw=Un&&"documentMode"in document&&11>=document.documentMode,Rs=null,pu=null,Wr=null,gu=!1;function Bp(t,s,l){var c=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;gu||Rs==null||Rs!==El(c)||(c=Rs,"selectionStart"in c&&du(c)?c={start:c.selectionStart,end:c.selectionEnd}:(c=(c.ownerDocument&&c.ownerDocument.defaultView||window).getSelection(),c={anchorNode:c.anchorNode,anchorOffset:c.anchorOffset,focusNode:c.focusNode,focusOffset:c.focusOffset}),Wr&&Zr(Wr,c)||(Wr=c,c=So(pu,"onSelect"),0<c.length&&(s=new kl("onSelect","select",null,s,l),t.push({event:s,listeners:c}),s.target=Rs)))}function Vi(t,s){var l={};return l[t.toLowerCase()]=s.toLowerCase(),l["Webkit"+t]="webkit"+s,l["Moz"+t]="moz"+s,l}var Ds={animationend:Vi("Animation","AnimationEnd"),animationiteration:Vi("Animation","AnimationIteration"),animationstart:Vi("Animation","AnimationStart"),transitionrun:Vi("Transition","TransitionRun"),transitionstart:Vi("Transition","TransitionStart"),transitioncancel:Vi("Transition","TransitionCancel"),transitionend:Vi("Transition","TransitionEnd")},mu={},qp={};Un&&(qp=document.createElement("div").style,"AnimationEvent"in window||(delete Ds.animationend.animation,delete Ds.animationiteration.animation,delete Ds.animationstart.animation),"TransitionEvent"in window||delete Ds.transitionend.transition);function Gi(t){if(mu[t])return mu[t];if(!Ds[t])return t;var s=Ds[t],l;for(l in s)if(s.hasOwnProperty(l)&&l in qp)return mu[t]=s[l];return t}var $p=Gi("animationend"),Ip=Gi("animationiteration"),Vp=Gi("animationstart"),Pw=Gi("transitionrun"),Jw=Gi("transitionstart"),Zw=Gi("transitioncancel"),Gp=Gi("transitionend"),Kp=new Map,yu="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");yu.push("scrollEnd");function vn(t,s){Kp.set(t,s),$i(s,[t])}var jl=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var s=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(s))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},ln=[],zs=0,bu=0;function Ll(){for(var t=zs,s=bu=zs=0;s<t;){var l=ln[s];ln[s++]=null;var c=ln[s];ln[s++]=null;var h=ln[s];ln[s++]=null;var p=ln[s];if(ln[s++]=null,c!==null&&h!==null){var v=c.pending;v===null?h.next=h:(h.next=v.next,v.next=h),c.pending=h}p!==0&&Xp(l,h,p)}}function Rl(t,s,l,c){ln[zs++]=t,ln[zs++]=s,ln[zs++]=l,ln[zs++]=c,bu|=c,t.lanes|=c,t=t.alternate,t!==null&&(t.lanes|=c)}function vu(t,s,l,c){return Rl(t,s,l,c),Dl(t)}function Ki(t,s){return Rl(t,null,null,s),Dl(t)}function Xp(t,s,l){t.lanes|=l;var c=t.alternate;c!==null&&(c.lanes|=l);for(var h=!1,p=t.return;p!==null;)p.childLanes|=l,c=p.alternate,c!==null&&(c.childLanes|=l),p.tag===22&&(t=p.stateNode,t===null||t._visibility&1||(h=!0)),t=p,p=p.return;return t.tag===3?(p=t.stateNode,h&&s!==null&&(h=31-kt(l),t=p.hiddenUpdates,c=t[h],c===null?t[h]=[s]:c.push(s),s.lane=l|536870912),p):null}function Dl(t){if(50<wa)throw wa=0,kf=null,Error(r(185));for(var s=t.return;s!==null;)t=s,s=t.return;return t.tag===3?t.stateNode:null}var Us={};function Ww(t,s,l,c){this.tag=t,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=s,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=c,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Pt(t,s,l,c){return new Ww(t,s,l,c)}function Su(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Hn(t,s){var l=t.alternate;return l===null?(l=Pt(t.tag,s,t.key,t.mode),l.elementType=t.elementType,l.type=t.type,l.stateNode=t.stateNode,l.alternate=t,t.alternate=l):(l.pendingProps=s,l.type=t.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=t.flags&65011712,l.childLanes=t.childLanes,l.lanes=t.lanes,l.child=t.child,l.memoizedProps=t.memoizedProps,l.memoizedState=t.memoizedState,l.updateQueue=t.updateQueue,s=t.dependencies,l.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext},l.sibling=t.sibling,l.index=t.index,l.ref=t.ref,l.refCleanup=t.refCleanup,l}function Yp(t,s){t.flags&=65011714;var l=t.alternate;return l===null?(t.childLanes=0,t.lanes=s,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=l.childLanes,t.lanes=l.lanes,t.child=l.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=l.memoizedProps,t.memoizedState=l.memoizedState,t.updateQueue=l.updateQueue,t.type=l.type,s=l.dependencies,t.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext}),t}function zl(t,s,l,c,h,p){var v=0;if(c=t,typeof t=="function")Su(t)&&(v=1);else if(typeof t=="string")v=sx(t,l,te.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case O:return t=Pt(31,l,s,h),t.elementType=O,t.lanes=p,t;case x:return Xi(l.children,h,p,s);case _:v=8,h|=24;break;case A:return t=Pt(12,l,s,h|2),t.elementType=A,t.lanes=p,t;case K:return t=Pt(13,l,s,h),t.elementType=K,t.lanes=p,t;case Q:return t=Pt(19,l,s,h),t.elementType=Q,t.lanes=p,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case H:v=10;break e;case C:v=9;break e;case V:v=11;break e;case j:v=14;break e;case I:v=16,c=null;break e}v=29,l=Error(r(130,t===null?"null":typeof t,"")),c=null}return s=Pt(v,l,s,h),s.elementType=t,s.type=c,s.lanes=p,s}function Xi(t,s,l,c){return t=Pt(7,t,c,s),t.lanes=l,t}function wu(t,s,l){return t=Pt(6,t,null,s),t.lanes=l,t}function Fp(t){var s=Pt(18,null,null,0);return s.stateNode=t,s}function xu(t,s,l){return s=Pt(4,t.children!==null?t.children:[],t.key,s),s.lanes=l,s.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},s}var Qp=new WeakMap;function on(t,s){if(typeof t=="object"&&t!==null){var l=Qp.get(t);return l!==void 0?l:(s={value:t,source:s,stack:bs(s)},Qp.set(t,s),s)}return{value:t,source:s,stack:bs(s)}}var Hs=[],Bs=0,Ul=null,ea=0,cn=[],un=0,ci=null,An=1,Cn="";function Bn(t,s){Hs[Bs++]=ea,Hs[Bs++]=Ul,Ul=t,ea=s}function Pp(t,s,l){cn[un++]=An,cn[un++]=Cn,cn[un++]=ci,ci=t;var c=An;t=Cn;var h=32-kt(c)-1;c&=~(1<<h),l+=1;var p=32-kt(s)+h;if(30<p){var v=h-h%5;p=(c&(1<<v)-1).toString(32),c>>=v,h-=v,An=1<<32-kt(s)+h|l<<h|c,Cn=p+t}else An=1<<p|l<<h|c,Cn=t}function _u(t){t.return!==null&&(Bn(t,1),Pp(t,1,0))}function Eu(t){for(;t===Ul;)Ul=Hs[--Bs],Hs[Bs]=null,ea=Hs[--Bs],Hs[Bs]=null;for(;t===ci;)ci=cn[--un],cn[un]=null,Cn=cn[--un],cn[un]=null,An=cn[--un],cn[un]=null}function Jp(t,s){cn[un++]=An,cn[un++]=Cn,cn[un++]=ci,An=s.id,Cn=s.overflow,ci=t}var vt=null,Be=null,we=!1,ui=null,fn=!1,Tu=Error(r(519));function fi(t){var s=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw ta(on(s,t)),Tu}function Zp(t){var s=t.stateNode,l=t.type,c=t.memoizedProps;switch(s[bt]=t,s[Lt]=c,l){case"dialog":be("cancel",s),be("close",s);break;case"iframe":case"object":case"embed":be("load",s);break;case"video":case"audio":for(l=0;l<_a.length;l++)be(_a[l],s);break;case"source":be("error",s);break;case"img":case"image":case"link":be("error",s),be("load",s);break;case"details":be("toggle",s);break;case"input":be("invalid",s),fp(s,c.value,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name,!0);break;case"select":be("invalid",s);break;case"textarea":be("invalid",s),dp(s,c.value,c.defaultValue,c.children)}l=c.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||s.textContent===""+l||c.suppressHydrationWarning===!0||gy(s.textContent,l)?(c.popover!=null&&(be("beforetoggle",s),be("toggle",s)),c.onScroll!=null&&be("scroll",s),c.onScrollEnd!=null&&be("scrollend",s),c.onClick!=null&&(s.onclick=zn),s=!0):s=!1,s||fi(t,!0)}function Wp(t){for(vt=t.return;vt;)switch(vt.tag){case 5:case 31:case 13:fn=!1;return;case 27:case 3:fn=!0;return;default:vt=vt.return}}function qs(t){if(t!==vt)return!1;if(!we)return Wp(t),we=!0,!1;var s=t.tag,l;if((l=s!==3&&s!==27)&&((l=s===5)&&(l=t.type,l=!(l!=="form"&&l!=="button")||Gf(t.type,t.memoizedProps)),l=!l),l&&Be&&fi(t),Wp(t),s===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(r(317));Be=Ey(t)}else if(s===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(r(317));Be=Ey(t)}else s===27?(s=Be,Ti(t.type)?(t=Qf,Qf=null,Be=t):Be=s):Be=vt?dn(t.stateNode.nextSibling):null;return!0}function Yi(){Be=vt=null,we=!1}function Au(){var t=ui;return t!==null&&(Ht===null?Ht=t:Ht.push.apply(Ht,t),ui=null),t}function ta(t){ui===null?ui=[t]:ui.push(t)}var Cu=M(null),Fi=null,qn=null;function hi(t,s,l){W(Cu,s._currentValue),s._currentValue=l}function $n(t){t._currentValue=Cu.current,X(Cu)}function Nu(t,s,l){for(;t!==null;){var c=t.alternate;if((t.childLanes&s)!==s?(t.childLanes|=s,c!==null&&(c.childLanes|=s)):c!==null&&(c.childLanes&s)!==s&&(c.childLanes|=s),t===l)break;t=t.return}}function ku(t,s,l,c){var h=t.child;for(h!==null&&(h.return=t);h!==null;){var p=h.dependencies;if(p!==null){var v=h.child;p=p.firstContext;e:for(;p!==null;){var T=p;p=h;for(var N=0;N<s.length;N++)if(T.context===s[N]){p.lanes|=l,T=p.alternate,T!==null&&(T.lanes|=l),Nu(p.return,l,t),c||(v=null);break e}p=T.next}}else if(h.tag===18){if(v=h.return,v===null)throw Error(r(341));v.lanes|=l,p=v.alternate,p!==null&&(p.lanes|=l),Nu(v,l,t),v=null}else v=h.child;if(v!==null)v.return=h;else for(v=h;v!==null;){if(v===t){v=null;break}if(h=v.sibling,h!==null){h.return=v.return,v=h;break}v=v.return}h=v}}function $s(t,s,l,c){t=null;for(var h=s,p=!1;h!==null;){if(!p){if((h.flags&524288)!==0)p=!0;else if((h.flags&262144)!==0)break}if(h.tag===10){var v=h.alternate;if(v===null)throw Error(r(387));if(v=v.memoizedProps,v!==null){var T=h.type;Qt(h.pendingProps.value,v.value)||(t!==null?t.push(T):t=[T])}}else if(h===xe.current){if(v=h.alternate,v===null)throw Error(r(387));v.memoizedState.memoizedState!==h.memoizedState.memoizedState&&(t!==null?t.push(Na):t=[Na])}h=h.return}t!==null&&ku(s,t,l,c),s.flags|=262144}function Hl(t){for(t=t.firstContext;t!==null;){if(!Qt(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function Qi(t){Fi=t,qn=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function St(t){return eg(Fi,t)}function Bl(t,s){return Fi===null&&Qi(t),eg(t,s)}function eg(t,s){var l=s._currentValue;if(s={context:s,memoizedValue:l,next:null},qn===null){if(t===null)throw Error(r(308));qn=s,t.dependencies={lanes:0,firstContext:s},t.flags|=524288}else qn=qn.next=s;return l}var e1=typeof AbortController<"u"?AbortController:function(){var t=[],s=this.signal={aborted:!1,addEventListener:function(l,c){t.push(c)}};this.abort=function(){s.aborted=!0,t.forEach(function(l){return l()})}},t1=n.unstable_scheduleCallback,n1=n.unstable_NormalPriority,st={$$typeof:H,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Mu(){return{controller:new e1,data:new Map,refCount:0}}function na(t){t.refCount--,t.refCount===0&&t1(n1,function(){t.controller.abort()})}var ia=null,Ou=0,Is=0,Vs=null;function i1(t,s){if(ia===null){var l=ia=[];Ou=0,Is=Df(),Vs={status:"pending",value:void 0,then:function(c){l.push(c)}}}return Ou++,s.then(tg,tg),s}function tg(){if(--Ou===0&&ia!==null){Vs!==null&&(Vs.status="fulfilled");var t=ia;ia=null,Is=0,Vs=null;for(var s=0;s<t.length;s++)(0,t[s])()}}function s1(t,s){var l=[],c={status:"pending",value:null,reason:null,then:function(h){l.push(h)}};return t.then(function(){c.status="fulfilled",c.value=s;for(var h=0;h<l.length;h++)(0,l[h])(s)},function(h){for(c.status="rejected",c.reason=h,h=0;h<l.length;h++)(0,l[h])(void 0)}),c}var ng=q.S;q.S=function(t,s){Bm=it(),typeof s=="object"&&s!==null&&typeof s.then=="function"&&i1(t,s),ng!==null&&ng(t,s)};var Pi=M(null);function ju(){var t=Pi.current;return t!==null?t:De.pooledCache}function ql(t,s){s===null?W(Pi,Pi.current):W(Pi,s.pool)}function ig(){var t=ju();return t===null?null:{parent:st._currentValue,pool:t}}var Gs=Error(r(460)),Lu=Error(r(474)),$l=Error(r(542)),Il={then:function(){}};function sg(t){return t=t.status,t==="fulfilled"||t==="rejected"}function rg(t,s,l){switch(l=t[l],l===void 0?t.push(s):l!==s&&(s.then(zn,zn),s=l),s.status){case"fulfilled":return s.value;case"rejected":throw t=s.reason,lg(t),t;default:if(typeof s.status=="string")s.then(zn,zn);else{if(t=De,t!==null&&100<t.shellSuspendCounter)throw Error(r(482));t=s,t.status="pending",t.then(function(c){if(s.status==="pending"){var h=s;h.status="fulfilled",h.value=c}},function(c){if(s.status==="pending"){var h=s;h.status="rejected",h.reason=c}})}switch(s.status){case"fulfilled":return s.value;case"rejected":throw t=s.reason,lg(t),t}throw Zi=s,Gs}}function Ji(t){try{var s=t._init;return s(t._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(Zi=l,Gs):l}}var Zi=null;function ag(){if(Zi===null)throw Error(r(459));var t=Zi;return Zi=null,t}function lg(t){if(t===Gs||t===$l)throw Error(r(483))}var Ks=null,sa=0;function Vl(t){var s=sa;return sa+=1,Ks===null&&(Ks=[]),rg(Ks,t,s)}function ra(t,s){s=s.props.ref,t.ref=s!==void 0?s:null}function Gl(t,s){throw s.$$typeof===S?Error(r(525)):(t=Object.prototype.toString.call(s),Error(r(31,t==="[object Object]"?"object with keys {"+Object.keys(s).join(", ")+"}":t)))}function og(t){function s(L,k){if(t){var D=L.deletions;D===null?(L.deletions=[k],L.flags|=16):D.push(k)}}function l(L,k){if(!t)return null;for(;k!==null;)s(L,k),k=k.sibling;return null}function c(L){for(var k=new Map;L!==null;)L.key!==null?k.set(L.key,L):k.set(L.index,L),L=L.sibling;return k}function h(L,k){return L=Hn(L,k),L.index=0,L.sibling=null,L}function p(L,k,D){return L.index=D,t?(D=L.alternate,D!==null?(D=D.index,D<k?(L.flags|=67108866,k):D):(L.flags|=67108866,k)):(L.flags|=1048576,k)}function v(L){return t&&L.alternate===null&&(L.flags|=67108866),L}function T(L,k,D,Y){return k===null||k.tag!==6?(k=wu(D,L.mode,Y),k.return=L,k):(k=h(k,D),k.return=L,k)}function N(L,k,D,Y){var ae=D.type;return ae===x?G(L,k,D.props.children,Y,D.key):k!==null&&(k.elementType===ae||typeof ae=="object"&&ae!==null&&ae.$$typeof===I&&Ji(ae)===k.type)?(k=h(k,D.props),ra(k,D),k.return=L,k):(k=zl(D.type,D.key,D.props,null,L.mode,Y),ra(k,D),k.return=L,k)}function z(L,k,D,Y){return k===null||k.tag!==4||k.stateNode.containerInfo!==D.containerInfo||k.stateNode.implementation!==D.implementation?(k=xu(D,L.mode,Y),k.return=L,k):(k=h(k,D.children||[]),k.return=L,k)}function G(L,k,D,Y,ae){return k===null||k.tag!==7?(k=Xi(D,L.mode,Y,ae),k.return=L,k):(k=h(k,D),k.return=L,k)}function F(L,k,D){if(typeof k=="string"&&k!==""||typeof k=="number"||typeof k=="bigint")return k=wu(""+k,L.mode,D),k.return=L,k;if(typeof k=="object"&&k!==null){switch(k.$$typeof){case w:return D=zl(k.type,k.key,k.props,null,L.mode,D),ra(D,k),D.return=L,D;case E:return k=xu(k,L.mode,D),k.return=L,k;case I:return k=Ji(k),F(L,k,D)}if(Me(k)||$(k))return k=Xi(k,L.mode,D,null),k.return=L,k;if(typeof k.then=="function")return F(L,Vl(k),D);if(k.$$typeof===H)return F(L,Bl(L,k),D);Gl(L,k)}return null}function U(L,k,D,Y){var ae=k!==null?k.key:null;if(typeof D=="string"&&D!==""||typeof D=="number"||typeof D=="bigint")return ae!==null?null:T(L,k,""+D,Y);if(typeof D=="object"&&D!==null){switch(D.$$typeof){case w:return D.key===ae?N(L,k,D,Y):null;case E:return D.key===ae?z(L,k,D,Y):null;case I:return D=Ji(D),U(L,k,D,Y)}if(Me(D)||$(D))return ae!==null?null:G(L,k,D,Y,null);if(typeof D.then=="function")return U(L,k,Vl(D),Y);if(D.$$typeof===H)return U(L,k,Bl(L,D),Y);Gl(L,D)}return null}function B(L,k,D,Y,ae){if(typeof Y=="string"&&Y!==""||typeof Y=="number"||typeof Y=="bigint")return L=L.get(D)||null,T(k,L,""+Y,ae);if(typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case w:return L=L.get(Y.key===null?D:Y.key)||null,N(k,L,Y,ae);case E:return L=L.get(Y.key===null?D:Y.key)||null,z(k,L,Y,ae);case I:return Y=Ji(Y),B(L,k,D,Y,ae)}if(Me(Y)||$(Y))return L=L.get(D)||null,G(k,L,Y,ae,null);if(typeof Y.then=="function")return B(L,k,D,Vl(Y),ae);if(Y.$$typeof===H)return B(L,k,D,Bl(k,Y),ae);Gl(k,Y)}return null}function ne(L,k,D,Y){for(var ae=null,Te=null,ie=k,ge=k=0,Se=null;ie!==null&&ge<D.length;ge++){ie.index>ge?(Se=ie,ie=null):Se=ie.sibling;var Ae=U(L,ie,D[ge],Y);if(Ae===null){ie===null&&(ie=Se);break}t&&ie&&Ae.alternate===null&&s(L,ie),k=p(Ae,k,ge),Te===null?ae=Ae:Te.sibling=Ae,Te=Ae,ie=Se}if(ge===D.length)return l(L,ie),we&&Bn(L,ge),ae;if(ie===null){for(;ge<D.length;ge++)ie=F(L,D[ge],Y),ie!==null&&(k=p(ie,k,ge),Te===null?ae=ie:Te.sibling=ie,Te=ie);return we&&Bn(L,ge),ae}for(ie=c(ie);ge<D.length;ge++)Se=B(ie,L,ge,D[ge],Y),Se!==null&&(t&&Se.alternate!==null&&ie.delete(Se.key===null?ge:Se.key),k=p(Se,k,ge),Te===null?ae=Se:Te.sibling=Se,Te=Se);return t&&ie.forEach(function(Mi){return s(L,Mi)}),we&&Bn(L,ge),ae}function oe(L,k,D,Y){if(D==null)throw Error(r(151));for(var ae=null,Te=null,ie=k,ge=k=0,Se=null,Ae=D.next();ie!==null&&!Ae.done;ge++,Ae=D.next()){ie.index>ge?(Se=ie,ie=null):Se=ie.sibling;var Mi=U(L,ie,Ae.value,Y);if(Mi===null){ie===null&&(ie=Se);break}t&&ie&&Mi.alternate===null&&s(L,ie),k=p(Mi,k,ge),Te===null?ae=Mi:Te.sibling=Mi,Te=Mi,ie=Se}if(Ae.done)return l(L,ie),we&&Bn(L,ge),ae;if(ie===null){for(;!Ae.done;ge++,Ae=D.next())Ae=F(L,Ae.value,Y),Ae!==null&&(k=p(Ae,k,ge),Te===null?ae=Ae:Te.sibling=Ae,Te=Ae);return we&&Bn(L,ge),ae}for(ie=c(ie);!Ae.done;ge++,Ae=D.next())Ae=B(ie,L,ge,Ae.value,Y),Ae!==null&&(t&&Ae.alternate!==null&&ie.delete(Ae.key===null?ge:Ae.key),k=p(Ae,k,ge),Te===null?ae=Ae:Te.sibling=Ae,Te=Ae);return t&&ie.forEach(function(gx){return s(L,gx)}),we&&Bn(L,ge),ae}function Le(L,k,D,Y){if(typeof D=="object"&&D!==null&&D.type===x&&D.key===null&&(D=D.props.children),typeof D=="object"&&D!==null){switch(D.$$typeof){case w:e:{for(var ae=D.key;k!==null;){if(k.key===ae){if(ae=D.type,ae===x){if(k.tag===7){l(L,k.sibling),Y=h(k,D.props.children),Y.return=L,L=Y;break e}}else if(k.elementType===ae||typeof ae=="object"&&ae!==null&&ae.$$typeof===I&&Ji(ae)===k.type){l(L,k.sibling),Y=h(k,D.props),ra(Y,D),Y.return=L,L=Y;break e}l(L,k);break}else s(L,k);k=k.sibling}D.type===x?(Y=Xi(D.props.children,L.mode,Y,D.key),Y.return=L,L=Y):(Y=zl(D.type,D.key,D.props,null,L.mode,Y),ra(Y,D),Y.return=L,L=Y)}return v(L);case E:e:{for(ae=D.key;k!==null;){if(k.key===ae)if(k.tag===4&&k.stateNode.containerInfo===D.containerInfo&&k.stateNode.implementation===D.implementation){l(L,k.sibling),Y=h(k,D.children||[]),Y.return=L,L=Y;break e}else{l(L,k);break}else s(L,k);k=k.sibling}Y=xu(D,L.mode,Y),Y.return=L,L=Y}return v(L);case I:return D=Ji(D),Le(L,k,D,Y)}if(Me(D))return ne(L,k,D,Y);if($(D)){if(ae=$(D),typeof ae!="function")throw Error(r(150));return D=ae.call(D),oe(L,k,D,Y)}if(typeof D.then=="function")return Le(L,k,Vl(D),Y);if(D.$$typeof===H)return Le(L,k,Bl(L,D),Y);Gl(L,D)}return typeof D=="string"&&D!==""||typeof D=="number"||typeof D=="bigint"?(D=""+D,k!==null&&k.tag===6?(l(L,k.sibling),Y=h(k,D),Y.return=L,L=Y):(l(L,k),Y=wu(D,L.mode,Y),Y.return=L,L=Y),v(L)):l(L,k)}return function(L,k,D,Y){try{sa=0;var ae=Le(L,k,D,Y);return Ks=null,ae}catch(ie){if(ie===Gs||ie===$l)throw ie;var Te=Pt(29,ie,null,L.mode);return Te.lanes=Y,Te.return=L,Te}finally{}}}var Wi=og(!0),cg=og(!1),di=!1;function Ru(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Du(t,s){t=t.updateQueue,s.updateQueue===t&&(s.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function pi(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function gi(t,s,l){var c=t.updateQueue;if(c===null)return null;if(c=c.shared,(Ce&2)!==0){var h=c.pending;return h===null?s.next=s:(s.next=h.next,h.next=s),c.pending=s,s=Dl(t),Xp(t,null,l),s}return Rl(t,c,s,l),Dl(t)}function aa(t,s,l){if(s=s.updateQueue,s!==null&&(s=s.shared,(l&4194048)!==0)){var c=s.lanes;c&=t.pendingLanes,l|=c,s.lanes=l,ep(t,l)}}function zu(t,s){var l=t.updateQueue,c=t.alternate;if(c!==null&&(c=c.updateQueue,l===c)){var h=null,p=null;if(l=l.firstBaseUpdate,l!==null){do{var v={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};p===null?h=p=v:p=p.next=v,l=l.next}while(l!==null);p===null?h=p=s:p=p.next=s}else h=p=s;l={baseState:c.baseState,firstBaseUpdate:h,lastBaseUpdate:p,shared:c.shared,callbacks:c.callbacks},t.updateQueue=l;return}t=l.lastBaseUpdate,t===null?l.firstBaseUpdate=s:t.next=s,l.lastBaseUpdate=s}var Uu=!1;function la(){if(Uu){var t=Vs;if(t!==null)throw t}}function oa(t,s,l,c){Uu=!1;var h=t.updateQueue;di=!1;var p=h.firstBaseUpdate,v=h.lastBaseUpdate,T=h.shared.pending;if(T!==null){h.shared.pending=null;var N=T,z=N.next;N.next=null,v===null?p=z:v.next=z,v=N;var G=t.alternate;G!==null&&(G=G.updateQueue,T=G.lastBaseUpdate,T!==v&&(T===null?G.firstBaseUpdate=z:T.next=z,G.lastBaseUpdate=N))}if(p!==null){var F=h.baseState;v=0,G=z=N=null,T=p;do{var U=T.lane&-536870913,B=U!==T.lane;if(B?(ve&U)===U:(c&U)===U){U!==0&&U===Is&&(Uu=!0),G!==null&&(G=G.next={lane:0,tag:T.tag,payload:T.payload,callback:null,next:null});e:{var ne=t,oe=T;U=s;var Le=l;switch(oe.tag){case 1:if(ne=oe.payload,typeof ne=="function"){F=ne.call(Le,F,U);break e}F=ne;break e;case 3:ne.flags=ne.flags&-65537|128;case 0:if(ne=oe.payload,U=typeof ne=="function"?ne.call(Le,F,U):ne,U==null)break e;F=y({},F,U);break e;case 2:di=!0}}U=T.callback,U!==null&&(t.flags|=64,B&&(t.flags|=8192),B=h.callbacks,B===null?h.callbacks=[U]:B.push(U))}else B={lane:U,tag:T.tag,payload:T.payload,callback:T.callback,next:null},G===null?(z=G=B,N=F):G=G.next=B,v|=U;if(T=T.next,T===null){if(T=h.shared.pending,T===null)break;B=T,T=B.next,B.next=null,h.lastBaseUpdate=B,h.shared.pending=null}}while(!0);G===null&&(N=F),h.baseState=N,h.firstBaseUpdate=z,h.lastBaseUpdate=G,p===null&&(h.shared.lanes=0),Si|=v,t.lanes=v,t.memoizedState=F}}function ug(t,s){if(typeof t!="function")throw Error(r(191,t));t.call(s)}function fg(t,s){var l=t.callbacks;if(l!==null)for(t.callbacks=null,t=0;t<l.length;t++)ug(l[t],s)}var Xs=M(null),Kl=M(0);function hg(t,s){t=Pn,W(Kl,t),W(Xs,s),Pn=t|s.baseLanes}function Hu(){W(Kl,Pn),W(Xs,Xs.current)}function Bu(){Pn=Kl.current,X(Xs),X(Kl)}var Jt=M(null),hn=null;function mi(t){var s=t.alternate;W(Pe,Pe.current&1),W(Jt,t),hn===null&&(s===null||Xs.current!==null||s.memoizedState!==null)&&(hn=t)}function qu(t){W(Pe,Pe.current),W(Jt,t),hn===null&&(hn=t)}function dg(t){t.tag===22?(W(Pe,Pe.current),W(Jt,t),hn===null&&(hn=t)):yi()}function yi(){W(Pe,Pe.current),W(Jt,Jt.current)}function Zt(t){X(Jt),hn===t&&(hn=null),X(Pe)}var Pe=M(0);function Xl(t){for(var s=t;s!==null;){if(s.tag===13){var l=s.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||Yf(l)||Ff(l)))return s}else if(s.tag===19&&(s.memoizedProps.revealOrder==="forwards"||s.memoizedProps.revealOrder==="backwards"||s.memoizedProps.revealOrder==="unstable_legacy-backwards"||s.memoizedProps.revealOrder==="together")){if((s.flags&128)!==0)return s}else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break;for(;s.sibling===null;){if(s.return===null||s.return===t)return null;s=s.return}s.sibling.return=s.return,s=s.sibling}return null}var In=0,pe=null,Oe=null,rt=null,Yl=!1,Ys=!1,es=!1,Fl=0,ca=0,Fs=null,r1=0;function Fe(){throw Error(r(321))}function $u(t,s){if(s===null)return!1;for(var l=0;l<s.length&&l<t.length;l++)if(!Qt(t[l],s[l]))return!1;return!0}function Iu(t,s,l,c,h,p){return In=p,pe=s,s.memoizedState=null,s.updateQueue=null,s.lanes=0,q.H=t===null||t.memoizedState===null?Pg:sf,es=!1,p=l(c,h),es=!1,Ys&&(p=gg(s,l,c,h)),pg(t),p}function pg(t){q.H=ha;var s=Oe!==null&&Oe.next!==null;if(In=0,rt=Oe=pe=null,Yl=!1,ca=0,Fs=null,s)throw Error(r(300));t===null||at||(t=t.dependencies,t!==null&&Hl(t)&&(at=!0))}function gg(t,s,l,c){pe=t;var h=0;do{if(Ys&&(Fs=null),ca=0,Ys=!1,25<=h)throw Error(r(301));if(h+=1,rt=Oe=null,t.updateQueue!=null){var p=t.updateQueue;p.lastEffect=null,p.events=null,p.stores=null,p.memoCache!=null&&(p.memoCache.index=0)}q.H=Jg,p=s(l,c)}while(Ys);return p}function a1(){var t=q.H,s=t.useState()[0];return s=typeof s.then=="function"?ua(s):s,t=t.useState()[0],(Oe!==null?Oe.memoizedState:null)!==t&&(pe.flags|=1024),s}function Vu(){var t=Fl!==0;return Fl=0,t}function Gu(t,s,l){s.updateQueue=t.updateQueue,s.flags&=-2053,t.lanes&=~l}function Ku(t){if(Yl){for(t=t.memoizedState;t!==null;){var s=t.queue;s!==null&&(s.pending=null),t=t.next}Yl=!1}In=0,rt=Oe=pe=null,Ys=!1,ca=Fl=0,Fs=null}function Mt(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return rt===null?pe.memoizedState=rt=t:rt=rt.next=t,rt}function Je(){if(Oe===null){var t=pe.alternate;t=t!==null?t.memoizedState:null}else t=Oe.next;var s=rt===null?pe.memoizedState:rt.next;if(s!==null)rt=s,Oe=t;else{if(t===null)throw pe.alternate===null?Error(r(467)):Error(r(310));Oe=t,t={memoizedState:Oe.memoizedState,baseState:Oe.baseState,baseQueue:Oe.baseQueue,queue:Oe.queue,next:null},rt===null?pe.memoizedState=rt=t:rt=rt.next=t}return rt}function Ql(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ua(t){var s=ca;return ca+=1,Fs===null&&(Fs=[]),t=rg(Fs,t,s),s=pe,(rt===null?s.memoizedState:rt.next)===null&&(s=s.alternate,q.H=s===null||s.memoizedState===null?Pg:sf),t}function Pl(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return ua(t);if(t.$$typeof===H)return St(t)}throw Error(r(438,String(t)))}function Xu(t){var s=null,l=pe.updateQueue;if(l!==null&&(s=l.memoCache),s==null){var c=pe.alternate;c!==null&&(c=c.updateQueue,c!==null&&(c=c.memoCache,c!=null&&(s={data:c.data.map(function(h){return h.slice()}),index:0})))}if(s==null&&(s={data:[],index:0}),l===null&&(l=Ql(),pe.updateQueue=l),l.memoCache=s,l=s.data[s.index],l===void 0)for(l=s.data[s.index]=Array(t),c=0;c<t;c++)l[c]=P;return s.index++,l}function Vn(t,s){return typeof s=="function"?s(t):s}function Jl(t){var s=Je();return Yu(s,Oe,t)}function Yu(t,s,l){var c=t.queue;if(c===null)throw Error(r(311));c.lastRenderedReducer=l;var h=t.baseQueue,p=c.pending;if(p!==null){if(h!==null){var v=h.next;h.next=p.next,p.next=v}s.baseQueue=h=p,c.pending=null}if(p=t.baseState,h===null)t.memoizedState=p;else{s=h.next;var T=v=null,N=null,z=s,G=!1;do{var F=z.lane&-536870913;if(F!==z.lane?(ve&F)===F:(In&F)===F){var U=z.revertLane;if(U===0)N!==null&&(N=N.next={lane:0,revertLane:0,gesture:null,action:z.action,hasEagerState:z.hasEagerState,eagerState:z.eagerState,next:null}),F===Is&&(G=!0);else if((In&U)===U){z=z.next,U===Is&&(G=!0);continue}else F={lane:0,revertLane:z.revertLane,gesture:null,action:z.action,hasEagerState:z.hasEagerState,eagerState:z.eagerState,next:null},N===null?(T=N=F,v=p):N=N.next=F,pe.lanes|=U,Si|=U;F=z.action,es&&l(p,F),p=z.hasEagerState?z.eagerState:l(p,F)}else U={lane:F,revertLane:z.revertLane,gesture:z.gesture,action:z.action,hasEagerState:z.hasEagerState,eagerState:z.eagerState,next:null},N===null?(T=N=U,v=p):N=N.next=U,pe.lanes|=F,Si|=F;z=z.next}while(z!==null&&z!==s);if(N===null?v=p:N.next=T,!Qt(p,t.memoizedState)&&(at=!0,G&&(l=Vs,l!==null)))throw l;t.memoizedState=p,t.baseState=v,t.baseQueue=N,c.lastRenderedState=p}return h===null&&(c.lanes=0),[t.memoizedState,c.dispatch]}function Fu(t){var s=Je(),l=s.queue;if(l===null)throw Error(r(311));l.lastRenderedReducer=t;var c=l.dispatch,h=l.pending,p=s.memoizedState;if(h!==null){l.pending=null;var v=h=h.next;do p=t(p,v.action),v=v.next;while(v!==h);Qt(p,s.memoizedState)||(at=!0),s.memoizedState=p,s.baseQueue===null&&(s.baseState=p),l.lastRenderedState=p}return[p,c]}function mg(t,s,l){var c=pe,h=Je(),p=we;if(p){if(l===void 0)throw Error(r(407));l=l()}else l=s();var v=!Qt((Oe||h).memoizedState,l);if(v&&(h.memoizedState=l,at=!0),h=h.queue,Ju(vg.bind(null,c,h,t),[t]),h.getSnapshot!==s||v||rt!==null&&rt.memoizedState.tag&1){if(c.flags|=2048,Qs(9,{destroy:void 0},bg.bind(null,c,h,l,s),null),De===null)throw Error(r(349));p||(In&127)!==0||yg(c,s,l)}return l}function yg(t,s,l){t.flags|=16384,t={getSnapshot:s,value:l},s=pe.updateQueue,s===null?(s=Ql(),pe.updateQueue=s,s.stores=[t]):(l=s.stores,l===null?s.stores=[t]:l.push(t))}function bg(t,s,l,c){s.value=l,s.getSnapshot=c,Sg(s)&&wg(t)}function vg(t,s,l){return l(function(){Sg(s)&&wg(t)})}function Sg(t){var s=t.getSnapshot;t=t.value;try{var l=s();return!Qt(t,l)}catch{return!0}}function wg(t){var s=Ki(t,2);s!==null&&Bt(s,t,2)}function Qu(t){var s=Mt();if(typeof t=="function"){var l=t;if(t=l(),es){Ft(!0);try{l()}finally{Ft(!1)}}}return s.memoizedState=s.baseState=t,s.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Vn,lastRenderedState:t},s}function xg(t,s,l,c){return t.baseState=l,Yu(t,Oe,typeof c=="function"?c:Vn)}function l1(t,s,l,c,h){if(eo(t))throw Error(r(485));if(t=s.action,t!==null){var p={payload:h,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(v){p.listeners.push(v)}};q.T!==null?l(!0):p.isTransition=!1,c(p),l=s.pending,l===null?(p.next=s.pending=p,_g(s,p)):(p.next=l.next,s.pending=l.next=p)}}function _g(t,s){var l=s.action,c=s.payload,h=t.state;if(s.isTransition){var p=q.T,v={};q.T=v;try{var T=l(h,c),N=q.S;N!==null&&N(v,T),Eg(t,s,T)}catch(z){Pu(t,s,z)}finally{p!==null&&v.types!==null&&(p.types=v.types),q.T=p}}else try{p=l(h,c),Eg(t,s,p)}catch(z){Pu(t,s,z)}}function Eg(t,s,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(c){Tg(t,s,c)},function(c){return Pu(t,s,c)}):Tg(t,s,l)}function Tg(t,s,l){s.status="fulfilled",s.value=l,Ag(s),t.state=l,s=t.pending,s!==null&&(l=s.next,l===s?t.pending=null:(l=l.next,s.next=l,_g(t,l)))}function Pu(t,s,l){var c=t.pending;if(t.pending=null,c!==null){c=c.next;do s.status="rejected",s.reason=l,Ag(s),s=s.next;while(s!==c)}t.action=null}function Ag(t){t=t.listeners;for(var s=0;s<t.length;s++)(0,t[s])()}function Cg(t,s){return s}function Ng(t,s){if(we){var l=De.formState;if(l!==null){e:{var c=pe;if(we){if(Be){t:{for(var h=Be,p=fn;h.nodeType!==8;){if(!p){h=null;break t}if(h=dn(h.nextSibling),h===null){h=null;break t}}p=h.data,h=p==="F!"||p==="F"?h:null}if(h){Be=dn(h.nextSibling),c=h.data==="F!";break e}}fi(c)}c=!1}c&&(s=l[0])}}return l=Mt(),l.memoizedState=l.baseState=s,c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Cg,lastRenderedState:s},l.queue=c,l=Yg.bind(null,pe,c),c.dispatch=l,c=Qu(!1),p=nf.bind(null,pe,!1,c.queue),c=Mt(),h={state:s,dispatch:null,action:t,pending:null},c.queue=h,l=l1.bind(null,pe,h,p,l),h.dispatch=l,c.memoizedState=t,[s,l,!1]}function kg(t){var s=Je();return Mg(s,Oe,t)}function Mg(t,s,l){if(s=Yu(t,s,Cg)[0],t=Jl(Vn)[0],typeof s=="object"&&s!==null&&typeof s.then=="function")try{var c=ua(s)}catch(v){throw v===Gs?$l:v}else c=s;s=Je();var h=s.queue,p=h.dispatch;return l!==s.memoizedState&&(pe.flags|=2048,Qs(9,{destroy:void 0},o1.bind(null,h,l),null)),[c,p,t]}function o1(t,s){t.action=s}function Og(t){var s=Je(),l=Oe;if(l!==null)return Mg(s,l,t);Je(),s=s.memoizedState,l=Je();var c=l.queue.dispatch;return l.memoizedState=t,[s,c,!1]}function Qs(t,s,l,c){return t={tag:t,create:l,deps:c,inst:s,next:null},s=pe.updateQueue,s===null&&(s=Ql(),pe.updateQueue=s),l=s.lastEffect,l===null?s.lastEffect=t.next=t:(c=l.next,l.next=t,t.next=c,s.lastEffect=t),t}function jg(){return Je().memoizedState}function Zl(t,s,l,c){var h=Mt();pe.flags|=t,h.memoizedState=Qs(1|s,{destroy:void 0},l,c===void 0?null:c)}function Wl(t,s,l,c){var h=Je();c=c===void 0?null:c;var p=h.memoizedState.inst;Oe!==null&&c!==null&&$u(c,Oe.memoizedState.deps)?h.memoizedState=Qs(s,p,l,c):(pe.flags|=t,h.memoizedState=Qs(1|s,p,l,c))}function Lg(t,s){Zl(8390656,8,t,s)}function Ju(t,s){Wl(2048,8,t,s)}function c1(t){pe.flags|=4;var s=pe.updateQueue;if(s===null)s=Ql(),pe.updateQueue=s,s.events=[t];else{var l=s.events;l===null?s.events=[t]:l.push(t)}}function Rg(t){var s=Je().memoizedState;return c1({ref:s,nextImpl:t}),function(){if((Ce&2)!==0)throw Error(r(440));return s.impl.apply(void 0,arguments)}}function Dg(t,s){return Wl(4,2,t,s)}function zg(t,s){return Wl(4,4,t,s)}function Ug(t,s){if(typeof s=="function"){t=t();var l=s(t);return function(){typeof l=="function"?l():s(null)}}if(s!=null)return t=t(),s.current=t,function(){s.current=null}}function Hg(t,s,l){l=l!=null?l.concat([t]):null,Wl(4,4,Ug.bind(null,s,t),l)}function Zu(){}function Bg(t,s){var l=Je();s=s===void 0?null:s;var c=l.memoizedState;return s!==null&&$u(s,c[1])?c[0]:(l.memoizedState=[t,s],t)}function qg(t,s){var l=Je();s=s===void 0?null:s;var c=l.memoizedState;if(s!==null&&$u(s,c[1]))return c[0];if(c=t(),es){Ft(!0);try{t()}finally{Ft(!1)}}return l.memoizedState=[c,s],c}function Wu(t,s,l){return l===void 0||(In&1073741824)!==0&&(ve&261930)===0?t.memoizedState=s:(t.memoizedState=l,t=$m(),pe.lanes|=t,Si|=t,l)}function $g(t,s,l,c){return Qt(l,s)?l:Xs.current!==null?(t=Wu(t,l,c),Qt(t,s)||(at=!0),t):(In&42)===0||(In&1073741824)!==0&&(ve&261930)===0?(at=!0,t.memoizedState=l):(t=$m(),pe.lanes|=t,Si|=t,s)}function Ig(t,s,l,c,h){var p=Z.p;Z.p=p!==0&&8>p?p:8;var v=q.T,T={};q.T=T,nf(t,!1,s,l);try{var N=h(),z=q.S;if(z!==null&&z(T,N),N!==null&&typeof N=="object"&&typeof N.then=="function"){var G=s1(N,c);fa(t,s,G,tn(t))}else fa(t,s,c,tn(t))}catch(F){fa(t,s,{then:function(){},status:"rejected",reason:F},tn())}finally{Z.p=p,v!==null&&T.types!==null&&(v.types=T.types),q.T=v}}function u1(){}function ef(t,s,l,c){if(t.tag!==5)throw Error(r(476));var h=Vg(t).queue;Ig(t,h,s,re,l===null?u1:function(){return Gg(t),l(c)})}function Vg(t){var s=t.memoizedState;if(s!==null)return s;s={memoizedState:re,baseState:re,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Vn,lastRenderedState:re},next:null};var l={};return s.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Vn,lastRenderedState:l},next:null},t.memoizedState=s,t=t.alternate,t!==null&&(t.memoizedState=s),s}function Gg(t){var s=Vg(t);s.next===null&&(s=t.alternate.memoizedState),fa(t,s.next.queue,{},tn())}function tf(){return St(Na)}function Kg(){return Je().memoizedState}function Xg(){return Je().memoizedState}function f1(t){for(var s=t.return;s!==null;){switch(s.tag){case 24:case 3:var l=tn();t=pi(l);var c=gi(s,t,l);c!==null&&(Bt(c,s,l),aa(c,s,l)),s={cache:Mu()},t.payload=s;return}s=s.return}}function h1(t,s,l){var c=tn();l={lane:c,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},eo(t)?Fg(s,l):(l=vu(t,s,l,c),l!==null&&(Bt(l,t,c),Qg(l,s,c)))}function Yg(t,s,l){var c=tn();fa(t,s,l,c)}function fa(t,s,l,c){var h={lane:c,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(eo(t))Fg(s,h);else{var p=t.alternate;if(t.lanes===0&&(p===null||p.lanes===0)&&(p=s.lastRenderedReducer,p!==null))try{var v=s.lastRenderedState,T=p(v,l);if(h.hasEagerState=!0,h.eagerState=T,Qt(T,v))return Rl(t,s,h,0),De===null&&Ll(),!1}catch{}finally{}if(l=vu(t,s,h,c),l!==null)return Bt(l,t,c),Qg(l,s,c),!0}return!1}function nf(t,s,l,c){if(c={lane:2,revertLane:Df(),gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},eo(t)){if(s)throw Error(r(479))}else s=vu(t,l,c,2),s!==null&&Bt(s,t,2)}function eo(t){var s=t.alternate;return t===pe||s!==null&&s===pe}function Fg(t,s){Ys=Yl=!0;var l=t.pending;l===null?s.next=s:(s.next=l.next,l.next=s),t.pending=s}function Qg(t,s,l){if((l&4194048)!==0){var c=s.lanes;c&=t.pendingLanes,l|=c,s.lanes=l,ep(t,l)}}var ha={readContext:St,use:Pl,useCallback:Fe,useContext:Fe,useEffect:Fe,useImperativeHandle:Fe,useLayoutEffect:Fe,useInsertionEffect:Fe,useMemo:Fe,useReducer:Fe,useRef:Fe,useState:Fe,useDebugValue:Fe,useDeferredValue:Fe,useTransition:Fe,useSyncExternalStore:Fe,useId:Fe,useHostTransitionStatus:Fe,useFormState:Fe,useActionState:Fe,useOptimistic:Fe,useMemoCache:Fe,useCacheRefresh:Fe};ha.useEffectEvent=Fe;var Pg={readContext:St,use:Pl,useCallback:function(t,s){return Mt().memoizedState=[t,s===void 0?null:s],t},useContext:St,useEffect:Lg,useImperativeHandle:function(t,s,l){l=l!=null?l.concat([t]):null,Zl(4194308,4,Ug.bind(null,s,t),l)},useLayoutEffect:function(t,s){return Zl(4194308,4,t,s)},useInsertionEffect:function(t,s){Zl(4,2,t,s)},useMemo:function(t,s){var l=Mt();s=s===void 0?null:s;var c=t();if(es){Ft(!0);try{t()}finally{Ft(!1)}}return l.memoizedState=[c,s],c},useReducer:function(t,s,l){var c=Mt();if(l!==void 0){var h=l(s);if(es){Ft(!0);try{l(s)}finally{Ft(!1)}}}else h=s;return c.memoizedState=c.baseState=h,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:h},c.queue=t,t=t.dispatch=h1.bind(null,pe,t),[c.memoizedState,t]},useRef:function(t){var s=Mt();return t={current:t},s.memoizedState=t},useState:function(t){t=Qu(t);var s=t.queue,l=Yg.bind(null,pe,s);return s.dispatch=l,[t.memoizedState,l]},useDebugValue:Zu,useDeferredValue:function(t,s){var l=Mt();return Wu(l,t,s)},useTransition:function(){var t=Qu(!1);return t=Ig.bind(null,pe,t.queue,!0,!1),Mt().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,s,l){var c=pe,h=Mt();if(we){if(l===void 0)throw Error(r(407));l=l()}else{if(l=s(),De===null)throw Error(r(349));(ve&127)!==0||yg(c,s,l)}h.memoizedState=l;var p={value:l,getSnapshot:s};return h.queue=p,Lg(vg.bind(null,c,p,t),[t]),c.flags|=2048,Qs(9,{destroy:void 0},bg.bind(null,c,p,l,s),null),l},useId:function(){var t=Mt(),s=De.identifierPrefix;if(we){var l=Cn,c=An;l=(c&~(1<<32-kt(c)-1)).toString(32)+l,s="_"+s+"R_"+l,l=Fl++,0<l&&(s+="H"+l.toString(32)),s+="_"}else l=r1++,s="_"+s+"r_"+l.toString(32)+"_";return t.memoizedState=s},useHostTransitionStatus:tf,useFormState:Ng,useActionState:Ng,useOptimistic:function(t){var s=Mt();s.memoizedState=s.baseState=t;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return s.queue=l,s=nf.bind(null,pe,!0,l),l.dispatch=s,[t,s]},useMemoCache:Xu,useCacheRefresh:function(){return Mt().memoizedState=f1.bind(null,pe)},useEffectEvent:function(t){var s=Mt(),l={impl:t};return s.memoizedState=l,function(){if((Ce&2)!==0)throw Error(r(440));return l.impl.apply(void 0,arguments)}}},sf={readContext:St,use:Pl,useCallback:Bg,useContext:St,useEffect:Ju,useImperativeHandle:Hg,useInsertionEffect:Dg,useLayoutEffect:zg,useMemo:qg,useReducer:Jl,useRef:jg,useState:function(){return Jl(Vn)},useDebugValue:Zu,useDeferredValue:function(t,s){var l=Je();return $g(l,Oe.memoizedState,t,s)},useTransition:function(){var t=Jl(Vn)[0],s=Je().memoizedState;return[typeof t=="boolean"?t:ua(t),s]},useSyncExternalStore:mg,useId:Kg,useHostTransitionStatus:tf,useFormState:kg,useActionState:kg,useOptimistic:function(t,s){var l=Je();return xg(l,Oe,t,s)},useMemoCache:Xu,useCacheRefresh:Xg};sf.useEffectEvent=Rg;var Jg={readContext:St,use:Pl,useCallback:Bg,useContext:St,useEffect:Ju,useImperativeHandle:Hg,useInsertionEffect:Dg,useLayoutEffect:zg,useMemo:qg,useReducer:Fu,useRef:jg,useState:function(){return Fu(Vn)},useDebugValue:Zu,useDeferredValue:function(t,s){var l=Je();return Oe===null?Wu(l,t,s):$g(l,Oe.memoizedState,t,s)},useTransition:function(){var t=Fu(Vn)[0],s=Je().memoizedState;return[typeof t=="boolean"?t:ua(t),s]},useSyncExternalStore:mg,useId:Kg,useHostTransitionStatus:tf,useFormState:Og,useActionState:Og,useOptimistic:function(t,s){var l=Je();return Oe!==null?xg(l,Oe,t,s):(l.baseState=t,[t,l.queue.dispatch])},useMemoCache:Xu,useCacheRefresh:Xg};Jg.useEffectEvent=Rg;function rf(t,s,l,c){s=t.memoizedState,l=l(c,s),l=l==null?s:y({},s,l),t.memoizedState=l,t.lanes===0&&(t.updateQueue.baseState=l)}var af={enqueueSetState:function(t,s,l){t=t._reactInternals;var c=tn(),h=pi(c);h.payload=s,l!=null&&(h.callback=l),s=gi(t,h,c),s!==null&&(Bt(s,t,c),aa(s,t,c))},enqueueReplaceState:function(t,s,l){t=t._reactInternals;var c=tn(),h=pi(c);h.tag=1,h.payload=s,l!=null&&(h.callback=l),s=gi(t,h,c),s!==null&&(Bt(s,t,c),aa(s,t,c))},enqueueForceUpdate:function(t,s){t=t._reactInternals;var l=tn(),c=pi(l);c.tag=2,s!=null&&(c.callback=s),s=gi(t,c,l),s!==null&&(Bt(s,t,l),aa(s,t,l))}};function Zg(t,s,l,c,h,p,v){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(c,p,v):s.prototype&&s.prototype.isPureReactComponent?!Zr(l,c)||!Zr(h,p):!0}function Wg(t,s,l,c){t=s.state,typeof s.componentWillReceiveProps=="function"&&s.componentWillReceiveProps(l,c),typeof s.UNSAFE_componentWillReceiveProps=="function"&&s.UNSAFE_componentWillReceiveProps(l,c),s.state!==t&&af.enqueueReplaceState(s,s.state,null)}function ts(t,s){var l=s;if("ref"in s){l={};for(var c in s)c!=="ref"&&(l[c]=s[c])}if(t=t.defaultProps){l===s&&(l=y({},l));for(var h in t)l[h]===void 0&&(l[h]=t[h])}return l}function em(t){jl(t)}function tm(t){console.error(t)}function nm(t){jl(t)}function to(t,s){try{var l=t.onUncaughtError;l(s.value,{componentStack:s.stack})}catch(c){setTimeout(function(){throw c})}}function im(t,s,l){try{var c=t.onCaughtError;c(l.value,{componentStack:l.stack,errorBoundary:s.tag===1?s.stateNode:null})}catch(h){setTimeout(function(){throw h})}}function lf(t,s,l){return l=pi(l),l.tag=3,l.payload={element:null},l.callback=function(){to(t,s)},l}function sm(t){return t=pi(t),t.tag=3,t}function rm(t,s,l,c){var h=l.type.getDerivedStateFromError;if(typeof h=="function"){var p=c.value;t.payload=function(){return h(p)},t.callback=function(){im(s,l,c)}}var v=l.stateNode;v!==null&&typeof v.componentDidCatch=="function"&&(t.callback=function(){im(s,l,c),typeof h!="function"&&(wi===null?wi=new Set([this]):wi.add(this));var T=c.stack;this.componentDidCatch(c.value,{componentStack:T!==null?T:""})})}function d1(t,s,l,c,h){if(l.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){if(s=l.alternate,s!==null&&$s(s,l,h,!0),l=Jt.current,l!==null){switch(l.tag){case 31:case 13:return hn===null?po():l.alternate===null&&Qe===0&&(Qe=3),l.flags&=-257,l.flags|=65536,l.lanes=h,c===Il?l.flags|=16384:(s=l.updateQueue,s===null?l.updateQueue=new Set([c]):s.add(c),jf(t,c,h)),!1;case 22:return l.flags|=65536,c===Il?l.flags|=16384:(s=l.updateQueue,s===null?(s={transitions:null,markerInstances:null,retryQueue:new Set([c])},l.updateQueue=s):(l=s.retryQueue,l===null?s.retryQueue=new Set([c]):l.add(c)),jf(t,c,h)),!1}throw Error(r(435,l.tag))}return jf(t,c,h),po(),!1}if(we)return s=Jt.current,s!==null?((s.flags&65536)===0&&(s.flags|=256),s.flags|=65536,s.lanes=h,c!==Tu&&(t=Error(r(422),{cause:c}),ta(on(t,l)))):(c!==Tu&&(s=Error(r(423),{cause:c}),ta(on(s,l))),t=t.current.alternate,t.flags|=65536,h&=-h,t.lanes|=h,c=on(c,l),h=lf(t.stateNode,c,h),zu(t,h),Qe!==4&&(Qe=2)),!1;var p=Error(r(520),{cause:c});if(p=on(p,l),Sa===null?Sa=[p]:Sa.push(p),Qe!==4&&(Qe=2),s===null)return!0;c=on(c,l),l=s;do{switch(l.tag){case 3:return l.flags|=65536,t=h&-h,l.lanes|=t,t=lf(l.stateNode,c,t),zu(l,t),!1;case 1:if(s=l.type,p=l.stateNode,(l.flags&128)===0&&(typeof s.getDerivedStateFromError=="function"||p!==null&&typeof p.componentDidCatch=="function"&&(wi===null||!wi.has(p))))return l.flags|=65536,h&=-h,l.lanes|=h,h=sm(h),rm(h,t,l,c),zu(l,h),!1}l=l.return}while(l!==null);return!1}var of=Error(r(461)),at=!1;function wt(t,s,l,c){s.child=t===null?cg(s,null,l,c):Wi(s,t.child,l,c)}function am(t,s,l,c,h){l=l.render;var p=s.ref;if("ref"in c){var v={};for(var T in c)T!=="ref"&&(v[T]=c[T])}else v=c;return Qi(s),c=Iu(t,s,l,v,p,h),T=Vu(),t!==null&&!at?(Gu(t,s,h),Gn(t,s,h)):(we&&T&&_u(s),s.flags|=1,wt(t,s,c,h),s.child)}function lm(t,s,l,c,h){if(t===null){var p=l.type;return typeof p=="function"&&!Su(p)&&p.defaultProps===void 0&&l.compare===null?(s.tag=15,s.type=p,om(t,s,p,c,h)):(t=zl(l.type,null,c,s,s.mode,h),t.ref=s.ref,t.return=s,s.child=t)}if(p=t.child,!mf(t,h)){var v=p.memoizedProps;if(l=l.compare,l=l!==null?l:Zr,l(v,c)&&t.ref===s.ref)return Gn(t,s,h)}return s.flags|=1,t=Hn(p,c),t.ref=s.ref,t.return=s,s.child=t}function om(t,s,l,c,h){if(t!==null){var p=t.memoizedProps;if(Zr(p,c)&&t.ref===s.ref)if(at=!1,s.pendingProps=c=p,mf(t,h))(t.flags&131072)!==0&&(at=!0);else return s.lanes=t.lanes,Gn(t,s,h)}return cf(t,s,l,c,h)}function cm(t,s,l,c){var h=c.children,p=t!==null?t.memoizedState:null;if(t===null&&s.stateNode===null&&(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),c.mode==="hidden"){if((s.flags&128)!==0){if(p=p!==null?p.baseLanes|l:l,t!==null){for(c=s.child=t.child,h=0;c!==null;)h=h|c.lanes|c.childLanes,c=c.sibling;c=h&~p}else c=0,s.child=null;return um(t,s,p,l,c)}if((l&536870912)!==0)s.memoizedState={baseLanes:0,cachePool:null},t!==null&&ql(s,p!==null?p.cachePool:null),p!==null?hg(s,p):Hu(),dg(s);else return c=s.lanes=536870912,um(t,s,p!==null?p.baseLanes|l:l,l,c)}else p!==null?(ql(s,p.cachePool),hg(s,p),yi(),s.memoizedState=null):(t!==null&&ql(s,null),Hu(),yi());return wt(t,s,h,l),s.child}function da(t,s){return t!==null&&t.tag===22||s.stateNode!==null||(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.sibling}function um(t,s,l,c,h){var p=ju();return p=p===null?null:{parent:st._currentValue,pool:p},s.memoizedState={baseLanes:l,cachePool:p},t!==null&&ql(s,null),Hu(),dg(s),t!==null&&$s(t,s,c,!0),s.childLanes=h,null}function no(t,s){return s=so({mode:s.mode,children:s.children},t.mode),s.ref=t.ref,t.child=s,s.return=t,s}function fm(t,s,l){return Wi(s,t.child,null,l),t=no(s,s.pendingProps),t.flags|=2,Zt(s),s.memoizedState=null,t}function p1(t,s,l){var c=s.pendingProps,h=(s.flags&128)!==0;if(s.flags&=-129,t===null){if(we){if(c.mode==="hidden")return t=no(s,c),s.lanes=536870912,da(null,t);if(qu(s),(t=Be)?(t=_y(t,fn),t=t!==null&&t.data==="&"?t:null,t!==null&&(s.memoizedState={dehydrated:t,treeContext:ci!==null?{id:An,overflow:Cn}:null,retryLane:536870912,hydrationErrors:null},l=Fp(t),l.return=s,s.child=l,vt=s,Be=null)):t=null,t===null)throw fi(s);return s.lanes=536870912,null}return no(s,c)}var p=t.memoizedState;if(p!==null){var v=p.dehydrated;if(qu(s),h)if(s.flags&256)s.flags&=-257,s=fm(t,s,l);else if(s.memoizedState!==null)s.child=t.child,s.flags|=128,s=null;else throw Error(r(558));else if(at||$s(t,s,l,!1),h=(l&t.childLanes)!==0,at||h){if(c=De,c!==null&&(v=tp(c,l),v!==0&&v!==p.retryLane))throw p.retryLane=v,Ki(t,v),Bt(c,t,v),of;po(),s=fm(t,s,l)}else t=p.treeContext,Be=dn(v.nextSibling),vt=s,we=!0,ui=null,fn=!1,t!==null&&Jp(s,t),s=no(s,c),s.flags|=4096;return s}return t=Hn(t.child,{mode:c.mode,children:c.children}),t.ref=s.ref,s.child=t,t.return=s,t}function io(t,s){var l=s.ref;if(l===null)t!==null&&t.ref!==null&&(s.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error(r(284));(t===null||t.ref!==l)&&(s.flags|=4194816)}}function cf(t,s,l,c,h){return Qi(s),l=Iu(t,s,l,c,void 0,h),c=Vu(),t!==null&&!at?(Gu(t,s,h),Gn(t,s,h)):(we&&c&&_u(s),s.flags|=1,wt(t,s,l,h),s.child)}function hm(t,s,l,c,h,p){return Qi(s),s.updateQueue=null,l=gg(s,c,l,h),pg(t),c=Vu(),t!==null&&!at?(Gu(t,s,p),Gn(t,s,p)):(we&&c&&_u(s),s.flags|=1,wt(t,s,l,p),s.child)}function dm(t,s,l,c,h){if(Qi(s),s.stateNode===null){var p=Us,v=l.contextType;typeof v=="object"&&v!==null&&(p=St(v)),p=new l(c,p),s.memoizedState=p.state!==null&&p.state!==void 0?p.state:null,p.updater=af,s.stateNode=p,p._reactInternals=s,p=s.stateNode,p.props=c,p.state=s.memoizedState,p.refs={},Ru(s),v=l.contextType,p.context=typeof v=="object"&&v!==null?St(v):Us,p.state=s.memoizedState,v=l.getDerivedStateFromProps,typeof v=="function"&&(rf(s,l,v,c),p.state=s.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof p.getSnapshotBeforeUpdate=="function"||typeof p.UNSAFE_componentWillMount!="function"&&typeof p.componentWillMount!="function"||(v=p.state,typeof p.componentWillMount=="function"&&p.componentWillMount(),typeof p.UNSAFE_componentWillMount=="function"&&p.UNSAFE_componentWillMount(),v!==p.state&&af.enqueueReplaceState(p,p.state,null),oa(s,c,p,h),la(),p.state=s.memoizedState),typeof p.componentDidMount=="function"&&(s.flags|=4194308),c=!0}else if(t===null){p=s.stateNode;var T=s.memoizedProps,N=ts(l,T);p.props=N;var z=p.context,G=l.contextType;v=Us,typeof G=="object"&&G!==null&&(v=St(G));var F=l.getDerivedStateFromProps;G=typeof F=="function"||typeof p.getSnapshotBeforeUpdate=="function",T=s.pendingProps!==T,G||typeof p.UNSAFE_componentWillReceiveProps!="function"&&typeof p.componentWillReceiveProps!="function"||(T||z!==v)&&Wg(s,p,c,v),di=!1;var U=s.memoizedState;p.state=U,oa(s,c,p,h),la(),z=s.memoizedState,T||U!==z||di?(typeof F=="function"&&(rf(s,l,F,c),z=s.memoizedState),(N=di||Zg(s,l,N,c,U,z,v))?(G||typeof p.UNSAFE_componentWillMount!="function"&&typeof p.componentWillMount!="function"||(typeof p.componentWillMount=="function"&&p.componentWillMount(),typeof p.UNSAFE_componentWillMount=="function"&&p.UNSAFE_componentWillMount()),typeof p.componentDidMount=="function"&&(s.flags|=4194308)):(typeof p.componentDidMount=="function"&&(s.flags|=4194308),s.memoizedProps=c,s.memoizedState=z),p.props=c,p.state=z,p.context=v,c=N):(typeof p.componentDidMount=="function"&&(s.flags|=4194308),c=!1)}else{p=s.stateNode,Du(t,s),v=s.memoizedProps,G=ts(l,v),p.props=G,F=s.pendingProps,U=p.context,z=l.contextType,N=Us,typeof z=="object"&&z!==null&&(N=St(z)),T=l.getDerivedStateFromProps,(z=typeof T=="function"||typeof p.getSnapshotBeforeUpdate=="function")||typeof p.UNSAFE_componentWillReceiveProps!="function"&&typeof p.componentWillReceiveProps!="function"||(v!==F||U!==N)&&Wg(s,p,c,N),di=!1,U=s.memoizedState,p.state=U,oa(s,c,p,h),la();var B=s.memoizedState;v!==F||U!==B||di||t!==null&&t.dependencies!==null&&Hl(t.dependencies)?(typeof T=="function"&&(rf(s,l,T,c),B=s.memoizedState),(G=di||Zg(s,l,G,c,U,B,N)||t!==null&&t.dependencies!==null&&Hl(t.dependencies))?(z||typeof p.UNSAFE_componentWillUpdate!="function"&&typeof p.componentWillUpdate!="function"||(typeof p.componentWillUpdate=="function"&&p.componentWillUpdate(c,B,N),typeof p.UNSAFE_componentWillUpdate=="function"&&p.UNSAFE_componentWillUpdate(c,B,N)),typeof p.componentDidUpdate=="function"&&(s.flags|=4),typeof p.getSnapshotBeforeUpdate=="function"&&(s.flags|=1024)):(typeof p.componentDidUpdate!="function"||v===t.memoizedProps&&U===t.memoizedState||(s.flags|=4),typeof p.getSnapshotBeforeUpdate!="function"||v===t.memoizedProps&&U===t.memoizedState||(s.flags|=1024),s.memoizedProps=c,s.memoizedState=B),p.props=c,p.state=B,p.context=N,c=G):(typeof p.componentDidUpdate!="function"||v===t.memoizedProps&&U===t.memoizedState||(s.flags|=4),typeof p.getSnapshotBeforeUpdate!="function"||v===t.memoizedProps&&U===t.memoizedState||(s.flags|=1024),c=!1)}return p=c,io(t,s),c=(s.flags&128)!==0,p||c?(p=s.stateNode,l=c&&typeof l.getDerivedStateFromError!="function"?null:p.render(),s.flags|=1,t!==null&&c?(s.child=Wi(s,t.child,null,h),s.child=Wi(s,null,l,h)):wt(t,s,l,h),s.memoizedState=p.state,t=s.child):t=Gn(t,s,h),t}function pm(t,s,l,c){return Yi(),s.flags|=256,wt(t,s,l,c),s.child}var uf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function ff(t){return{baseLanes:t,cachePool:ig()}}function hf(t,s,l){return t=t!==null?t.childLanes&~l:0,s&&(t|=en),t}function gm(t,s,l){var c=s.pendingProps,h=!1,p=(s.flags&128)!==0,v;if((v=p)||(v=t!==null&&t.memoizedState===null?!1:(Pe.current&2)!==0),v&&(h=!0,s.flags&=-129),v=(s.flags&32)!==0,s.flags&=-33,t===null){if(we){if(h?mi(s):yi(),(t=Be)?(t=_y(t,fn),t=t!==null&&t.data!=="&"?t:null,t!==null&&(s.memoizedState={dehydrated:t,treeContext:ci!==null?{id:An,overflow:Cn}:null,retryLane:536870912,hydrationErrors:null},l=Fp(t),l.return=s,s.child=l,vt=s,Be=null)):t=null,t===null)throw fi(s);return Ff(t)?s.lanes=32:s.lanes=536870912,null}var T=c.children;return c=c.fallback,h?(yi(),h=s.mode,T=so({mode:"hidden",children:T},h),c=Xi(c,h,l,null),T.return=s,c.return=s,T.sibling=c,s.child=T,c=s.child,c.memoizedState=ff(l),c.childLanes=hf(t,v,l),s.memoizedState=uf,da(null,c)):(mi(s),df(s,T))}var N=t.memoizedState;if(N!==null&&(T=N.dehydrated,T!==null)){if(p)s.flags&256?(mi(s),s.flags&=-257,s=pf(t,s,l)):s.memoizedState!==null?(yi(),s.child=t.child,s.flags|=128,s=null):(yi(),T=c.fallback,h=s.mode,c=so({mode:"visible",children:c.children},h),T=Xi(T,h,l,null),T.flags|=2,c.return=s,T.return=s,c.sibling=T,s.child=c,Wi(s,t.child,null,l),c=s.child,c.memoizedState=ff(l),c.childLanes=hf(t,v,l),s.memoizedState=uf,s=da(null,c));else if(mi(s),Ff(T)){if(v=T.nextSibling&&T.nextSibling.dataset,v)var z=v.dgst;v=z,c=Error(r(419)),c.stack="",c.digest=v,ta({value:c,source:null,stack:null}),s=pf(t,s,l)}else if(at||$s(t,s,l,!1),v=(l&t.childLanes)!==0,at||v){if(v=De,v!==null&&(c=tp(v,l),c!==0&&c!==N.retryLane))throw N.retryLane=c,Ki(t,c),Bt(v,t,c),of;Yf(T)||po(),s=pf(t,s,l)}else Yf(T)?(s.flags|=192,s.child=t.child,s=null):(t=N.treeContext,Be=dn(T.nextSibling),vt=s,we=!0,ui=null,fn=!1,t!==null&&Jp(s,t),s=df(s,c.children),s.flags|=4096);return s}return h?(yi(),T=c.fallback,h=s.mode,N=t.child,z=N.sibling,c=Hn(N,{mode:"hidden",children:c.children}),c.subtreeFlags=N.subtreeFlags&65011712,z!==null?T=Hn(z,T):(T=Xi(T,h,l,null),T.flags|=2),T.return=s,c.return=s,c.sibling=T,s.child=c,da(null,c),c=s.child,T=t.child.memoizedState,T===null?T=ff(l):(h=T.cachePool,h!==null?(N=st._currentValue,h=h.parent!==N?{parent:N,pool:N}:h):h=ig(),T={baseLanes:T.baseLanes|l,cachePool:h}),c.memoizedState=T,c.childLanes=hf(t,v,l),s.memoizedState=uf,da(t.child,c)):(mi(s),l=t.child,t=l.sibling,l=Hn(l,{mode:"visible",children:c.children}),l.return=s,l.sibling=null,t!==null&&(v=s.deletions,v===null?(s.deletions=[t],s.flags|=16):v.push(t)),s.child=l,s.memoizedState=null,l)}function df(t,s){return s=so({mode:"visible",children:s},t.mode),s.return=t,t.child=s}function so(t,s){return t=Pt(22,t,null,s),t.lanes=0,t}function pf(t,s,l){return Wi(s,t.child,null,l),t=df(s,s.pendingProps.children),t.flags|=2,s.memoizedState=null,t}function mm(t,s,l){t.lanes|=s;var c=t.alternate;c!==null&&(c.lanes|=s),Nu(t.return,s,l)}function gf(t,s,l,c,h,p){var v=t.memoizedState;v===null?t.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:c,tail:l,tailMode:h,treeForkCount:p}:(v.isBackwards=s,v.rendering=null,v.renderingStartTime=0,v.last=c,v.tail=l,v.tailMode=h,v.treeForkCount=p)}function ym(t,s,l){var c=s.pendingProps,h=c.revealOrder,p=c.tail;c=c.children;var v=Pe.current,T=(v&2)!==0;if(T?(v=v&1|2,s.flags|=128):v&=1,W(Pe,v),wt(t,s,c,l),c=we?ea:0,!T&&t!==null&&(t.flags&128)!==0)e:for(t=s.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&mm(t,l,s);else if(t.tag===19)mm(t,l,s);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===s)break e;for(;t.sibling===null;){if(t.return===null||t.return===s)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(h){case"forwards":for(l=s.child,h=null;l!==null;)t=l.alternate,t!==null&&Xl(t)===null&&(h=l),l=l.sibling;l=h,l===null?(h=s.child,s.child=null):(h=l.sibling,l.sibling=null),gf(s,!1,h,l,p,c);break;case"backwards":case"unstable_legacy-backwards":for(l=null,h=s.child,s.child=null;h!==null;){if(t=h.alternate,t!==null&&Xl(t)===null){s.child=h;break}t=h.sibling,h.sibling=l,l=h,h=t}gf(s,!0,l,null,p,c);break;case"together":gf(s,!1,null,null,void 0,c);break;default:s.memoizedState=null}return s.child}function Gn(t,s,l){if(t!==null&&(s.dependencies=t.dependencies),Si|=s.lanes,(l&s.childLanes)===0)if(t!==null){if($s(t,s,l,!1),(l&s.childLanes)===0)return null}else return null;if(t!==null&&s.child!==t.child)throw Error(r(153));if(s.child!==null){for(t=s.child,l=Hn(t,t.pendingProps),s.child=l,l.return=s;t.sibling!==null;)t=t.sibling,l=l.sibling=Hn(t,t.pendingProps),l.return=s;l.sibling=null}return s.child}function mf(t,s){return(t.lanes&s)!==0?!0:(t=t.dependencies,!!(t!==null&&Hl(t)))}function g1(t,s,l){switch(s.tag){case 3:nt(s,s.stateNode.containerInfo),hi(s,st,t.memoizedState.cache),Yi();break;case 27:case 5:Rn(s);break;case 4:nt(s,s.stateNode.containerInfo);break;case 10:hi(s,s.type,s.memoizedProps.value);break;case 31:if(s.memoizedState!==null)return s.flags|=128,qu(s),null;break;case 13:var c=s.memoizedState;if(c!==null)return c.dehydrated!==null?(mi(s),s.flags|=128,null):(l&s.child.childLanes)!==0?gm(t,s,l):(mi(s),t=Gn(t,s,l),t!==null?t.sibling:null);mi(s);break;case 19:var h=(t.flags&128)!==0;if(c=(l&s.childLanes)!==0,c||($s(t,s,l,!1),c=(l&s.childLanes)!==0),h){if(c)return ym(t,s,l);s.flags|=128}if(h=s.memoizedState,h!==null&&(h.rendering=null,h.tail=null,h.lastEffect=null),W(Pe,Pe.current),c)break;return null;case 22:return s.lanes=0,cm(t,s,l,s.pendingProps);case 24:hi(s,st,t.memoizedState.cache)}return Gn(t,s,l)}function bm(t,s,l){if(t!==null)if(t.memoizedProps!==s.pendingProps)at=!0;else{if(!mf(t,l)&&(s.flags&128)===0)return at=!1,g1(t,s,l);at=(t.flags&131072)!==0}else at=!1,we&&(s.flags&1048576)!==0&&Pp(s,ea,s.index);switch(s.lanes=0,s.tag){case 16:e:{var c=s.pendingProps;if(t=Ji(s.elementType),s.type=t,typeof t=="function")Su(t)?(c=ts(t,c),s.tag=1,s=dm(null,s,t,c,l)):(s.tag=0,s=cf(null,s,t,c,l));else{if(t!=null){var h=t.$$typeof;if(h===V){s.tag=11,s=am(null,s,t,c,l);break e}else if(h===j){s.tag=14,s=lm(null,s,t,c,l);break e}}throw s=ce(t)||t,Error(r(306,s,""))}}return s;case 0:return cf(t,s,s.type,s.pendingProps,l);case 1:return c=s.type,h=ts(c,s.pendingProps),dm(t,s,c,h,l);case 3:e:{if(nt(s,s.stateNode.containerInfo),t===null)throw Error(r(387));c=s.pendingProps;var p=s.memoizedState;h=p.element,Du(t,s),oa(s,c,null,l);var v=s.memoizedState;if(c=v.cache,hi(s,st,c),c!==p.cache&&ku(s,[st],l,!0),la(),c=v.element,p.isDehydrated)if(p={element:c,isDehydrated:!1,cache:v.cache},s.updateQueue.baseState=p,s.memoizedState=p,s.flags&256){s=pm(t,s,c,l);break e}else if(c!==h){h=on(Error(r(424)),s),ta(h),s=pm(t,s,c,l);break e}else{switch(t=s.stateNode.containerInfo,t.nodeType){case 9:t=t.body;break;default:t=t.nodeName==="HTML"?t.ownerDocument.body:t}for(Be=dn(t.firstChild),vt=s,we=!0,ui=null,fn=!0,l=cg(s,null,c,l),s.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling}else{if(Yi(),c===h){s=Gn(t,s,l);break e}wt(t,s,c,l)}s=s.child}return s;case 26:return io(t,s),t===null?(l=ky(s.type,null,s.pendingProps,null))?s.memoizedState=l:we||(l=s.type,t=s.pendingProps,c=wo(se.current).createElement(l),c[bt]=s,c[Lt]=t,xt(c,l,t),gt(c),s.stateNode=c):s.memoizedState=ky(s.type,t.memoizedProps,s.pendingProps,t.memoizedState),null;case 27:return Rn(s),t===null&&we&&(c=s.stateNode=Ay(s.type,s.pendingProps,se.current),vt=s,fn=!0,h=Be,Ti(s.type)?(Qf=h,Be=dn(c.firstChild)):Be=h),wt(t,s,s.pendingProps.children,l),io(t,s),t===null&&(s.flags|=4194304),s.child;case 5:return t===null&&we&&((h=c=Be)&&(c=K1(c,s.type,s.pendingProps,fn),c!==null?(s.stateNode=c,vt=s,Be=dn(c.firstChild),fn=!1,h=!0):h=!1),h||fi(s)),Rn(s),h=s.type,p=s.pendingProps,v=t!==null?t.memoizedProps:null,c=p.children,Gf(h,p)?c=null:v!==null&&Gf(h,v)&&(s.flags|=32),s.memoizedState!==null&&(h=Iu(t,s,a1,null,null,l),Na._currentValue=h),io(t,s),wt(t,s,c,l),s.child;case 6:return t===null&&we&&((t=l=Be)&&(l=X1(l,s.pendingProps,fn),l!==null?(s.stateNode=l,vt=s,Be=null,t=!0):t=!1),t||fi(s)),null;case 13:return gm(t,s,l);case 4:return nt(s,s.stateNode.containerInfo),c=s.pendingProps,t===null?s.child=Wi(s,null,c,l):wt(t,s,c,l),s.child;case 11:return am(t,s,s.type,s.pendingProps,l);case 7:return wt(t,s,s.pendingProps,l),s.child;case 8:return wt(t,s,s.pendingProps.children,l),s.child;case 12:return wt(t,s,s.pendingProps.children,l),s.child;case 10:return c=s.pendingProps,hi(s,s.type,c.value),wt(t,s,c.children,l),s.child;case 9:return h=s.type._context,c=s.pendingProps.children,Qi(s),h=St(h),c=c(h),s.flags|=1,wt(t,s,c,l),s.child;case 14:return lm(t,s,s.type,s.pendingProps,l);case 15:return om(t,s,s.type,s.pendingProps,l);case 19:return ym(t,s,l);case 31:return p1(t,s,l);case 22:return cm(t,s,l,s.pendingProps);case 24:return Qi(s),c=St(st),t===null?(h=ju(),h===null&&(h=De,p=Mu(),h.pooledCache=p,p.refCount++,p!==null&&(h.pooledCacheLanes|=l),h=p),s.memoizedState={parent:c,cache:h},Ru(s),hi(s,st,h)):((t.lanes&l)!==0&&(Du(t,s),oa(s,null,null,l),la()),h=t.memoizedState,p=s.memoizedState,h.parent!==c?(h={parent:c,cache:c},s.memoizedState=h,s.lanes===0&&(s.memoizedState=s.updateQueue.baseState=h),hi(s,st,c)):(c=p.cache,hi(s,st,c),c!==h.cache&&ku(s,[st],l,!0))),wt(t,s,s.pendingProps.children,l),s.child;case 29:throw s.pendingProps}throw Error(r(156,s.tag))}function Kn(t){t.flags|=4}function yf(t,s,l,c,h){if((s=(t.mode&32)!==0)&&(s=!1),s){if(t.flags|=16777216,(h&335544128)===h)if(t.stateNode.complete)t.flags|=8192;else if(Km())t.flags|=8192;else throw Zi=Il,Lu}else t.flags&=-16777217}function vm(t,s){if(s.type!=="stylesheet"||(s.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!Ry(s))if(Km())t.flags|=8192;else throw Zi=Il,Lu}function ro(t,s){s!==null&&(t.flags|=4),t.flags&16384&&(s=t.tag!==22?Zd():536870912,t.lanes|=s,Ws|=s)}function pa(t,s){if(!we)switch(t.tailMode){case"hidden":s=t.tail;for(var l=null;s!==null;)s.alternate!==null&&(l=s),s=s.sibling;l===null?t.tail=null:l.sibling=null;break;case"collapsed":l=t.tail;for(var c=null;l!==null;)l.alternate!==null&&(c=l),l=l.sibling;c===null?s||t.tail===null?t.tail=null:t.tail.sibling=null:c.sibling=null}}function qe(t){var s=t.alternate!==null&&t.alternate.child===t.child,l=0,c=0;if(s)for(var h=t.child;h!==null;)l|=h.lanes|h.childLanes,c|=h.subtreeFlags&65011712,c|=h.flags&65011712,h.return=t,h=h.sibling;else for(h=t.child;h!==null;)l|=h.lanes|h.childLanes,c|=h.subtreeFlags,c|=h.flags,h.return=t,h=h.sibling;return t.subtreeFlags|=c,t.childLanes=l,s}function m1(t,s,l){var c=s.pendingProps;switch(Eu(s),s.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return qe(s),null;case 1:return qe(s),null;case 3:return l=s.stateNode,c=null,t!==null&&(c=t.memoizedState.cache),s.memoizedState.cache!==c&&(s.flags|=2048),$n(st),Re(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(t===null||t.child===null)&&(qs(s)?Kn(s):t===null||t.memoizedState.isDehydrated&&(s.flags&256)===0||(s.flags|=1024,Au())),qe(s),null;case 26:var h=s.type,p=s.memoizedState;return t===null?(Kn(s),p!==null?(qe(s),vm(s,p)):(qe(s),yf(s,h,null,c,l))):p?p!==t.memoizedState?(Kn(s),qe(s),vm(s,p)):(qe(s),s.flags&=-16777217):(t=t.memoizedProps,t!==c&&Kn(s),qe(s),yf(s,h,t,c,l)),null;case 27:if(fe(s),l=se.current,h=s.type,t!==null&&s.stateNode!=null)t.memoizedProps!==c&&Kn(s);else{if(!c){if(s.stateNode===null)throw Error(r(166));return qe(s),null}t=te.current,qs(s)?Zp(s):(t=Ay(h,c,l),s.stateNode=t,Kn(s))}return qe(s),null;case 5:if(fe(s),h=s.type,t!==null&&s.stateNode!=null)t.memoizedProps!==c&&Kn(s);else{if(!c){if(s.stateNode===null)throw Error(r(166));return qe(s),null}if(p=te.current,qs(s))Zp(s);else{var v=wo(se.current);switch(p){case 1:p=v.createElementNS("http://www.w3.org/2000/svg",h);break;case 2:p=v.createElementNS("http://www.w3.org/1998/Math/MathML",h);break;default:switch(h){case"svg":p=v.createElementNS("http://www.w3.org/2000/svg",h);break;case"math":p=v.createElementNS("http://www.w3.org/1998/Math/MathML",h);break;case"script":p=v.createElement("div"),p.innerHTML="<script><\/script>",p=p.removeChild(p.firstChild);break;case"select":p=typeof c.is=="string"?v.createElement("select",{is:c.is}):v.createElement("select"),c.multiple?p.multiple=!0:c.size&&(p.size=c.size);break;default:p=typeof c.is=="string"?v.createElement(h,{is:c.is}):v.createElement(h)}}p[bt]=s,p[Lt]=c;e:for(v=s.child;v!==null;){if(v.tag===5||v.tag===6)p.appendChild(v.stateNode);else if(v.tag!==4&&v.tag!==27&&v.child!==null){v.child.return=v,v=v.child;continue}if(v===s)break e;for(;v.sibling===null;){if(v.return===null||v.return===s)break e;v=v.return}v.sibling.return=v.return,v=v.sibling}s.stateNode=p;e:switch(xt(p,h,c),h){case"button":case"input":case"select":case"textarea":c=!!c.autoFocus;break e;case"img":c=!0;break e;default:c=!1}c&&Kn(s)}}return qe(s),yf(s,s.type,t===null?null:t.memoizedProps,s.pendingProps,l),null;case 6:if(t&&s.stateNode!=null)t.memoizedProps!==c&&Kn(s);else{if(typeof c!="string"&&s.stateNode===null)throw Error(r(166));if(t=se.current,qs(s)){if(t=s.stateNode,l=s.memoizedProps,c=null,h=vt,h!==null)switch(h.tag){case 27:case 5:c=h.memoizedProps}t[bt]=s,t=!!(t.nodeValue===l||c!==null&&c.suppressHydrationWarning===!0||gy(t.nodeValue,l)),t||fi(s,!0)}else t=wo(t).createTextNode(c),t[bt]=s,s.stateNode=t}return qe(s),null;case 31:if(l=s.memoizedState,t===null||t.memoizedState!==null){if(c=qs(s),l!==null){if(t===null){if(!c)throw Error(r(318));if(t=s.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(r(557));t[bt]=s}else Yi(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;qe(s),t=!1}else l=Au(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=l),t=!0;if(!t)return s.flags&256?(Zt(s),s):(Zt(s),null);if((s.flags&128)!==0)throw Error(r(558))}return qe(s),null;case 13:if(c=s.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(h=qs(s),c!==null&&c.dehydrated!==null){if(t===null){if(!h)throw Error(r(318));if(h=s.memoizedState,h=h!==null?h.dehydrated:null,!h)throw Error(r(317));h[bt]=s}else Yi(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;qe(s),h=!1}else h=Au(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=h),h=!0;if(!h)return s.flags&256?(Zt(s),s):(Zt(s),null)}return Zt(s),(s.flags&128)!==0?(s.lanes=l,s):(l=c!==null,t=t!==null&&t.memoizedState!==null,l&&(c=s.child,h=null,c.alternate!==null&&c.alternate.memoizedState!==null&&c.alternate.memoizedState.cachePool!==null&&(h=c.alternate.memoizedState.cachePool.pool),p=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(p=c.memoizedState.cachePool.pool),p!==h&&(c.flags|=2048)),l!==t&&l&&(s.child.flags|=8192),ro(s,s.updateQueue),qe(s),null);case 4:return Re(),t===null&&Bf(s.stateNode.containerInfo),qe(s),null;case 10:return $n(s.type),qe(s),null;case 19:if(X(Pe),c=s.memoizedState,c===null)return qe(s),null;if(h=(s.flags&128)!==0,p=c.rendering,p===null)if(h)pa(c,!1);else{if(Qe!==0||t!==null&&(t.flags&128)!==0)for(t=s.child;t!==null;){if(p=Xl(t),p!==null){for(s.flags|=128,pa(c,!1),t=p.updateQueue,s.updateQueue=t,ro(s,t),s.subtreeFlags=0,t=l,l=s.child;l!==null;)Yp(l,t),l=l.sibling;return W(Pe,Pe.current&1|2),we&&Bn(s,c.treeForkCount),s.child}t=t.sibling}c.tail!==null&&it()>uo&&(s.flags|=128,h=!0,pa(c,!1),s.lanes=4194304)}else{if(!h)if(t=Xl(p),t!==null){if(s.flags|=128,h=!0,t=t.updateQueue,s.updateQueue=t,ro(s,t),pa(c,!0),c.tail===null&&c.tailMode==="hidden"&&!p.alternate&&!we)return qe(s),null}else 2*it()-c.renderingStartTime>uo&&l!==536870912&&(s.flags|=128,h=!0,pa(c,!1),s.lanes=4194304);c.isBackwards?(p.sibling=s.child,s.child=p):(t=c.last,t!==null?t.sibling=p:s.child=p,c.last=p)}return c.tail!==null?(t=c.tail,c.rendering=t,c.tail=t.sibling,c.renderingStartTime=it(),t.sibling=null,l=Pe.current,W(Pe,h?l&1|2:l&1),we&&Bn(s,c.treeForkCount),t):(qe(s),null);case 22:case 23:return Zt(s),Bu(),c=s.memoizedState!==null,t!==null?t.memoizedState!==null!==c&&(s.flags|=8192):c&&(s.flags|=8192),c?(l&536870912)!==0&&(s.flags&128)===0&&(qe(s),s.subtreeFlags&6&&(s.flags|=8192)):qe(s),l=s.updateQueue,l!==null&&ro(s,l.retryQueue),l=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),c=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(c=s.memoizedState.cachePool.pool),c!==l&&(s.flags|=2048),t!==null&&X(Pi),null;case 24:return l=null,t!==null&&(l=t.memoizedState.cache),s.memoizedState.cache!==l&&(s.flags|=2048),$n(st),qe(s),null;case 25:return null;case 30:return null}throw Error(r(156,s.tag))}function y1(t,s){switch(Eu(s),s.tag){case 1:return t=s.flags,t&65536?(s.flags=t&-65537|128,s):null;case 3:return $n(st),Re(),t=s.flags,(t&65536)!==0&&(t&128)===0?(s.flags=t&-65537|128,s):null;case 26:case 27:case 5:return fe(s),null;case 31:if(s.memoizedState!==null){if(Zt(s),s.alternate===null)throw Error(r(340));Yi()}return t=s.flags,t&65536?(s.flags=t&-65537|128,s):null;case 13:if(Zt(s),t=s.memoizedState,t!==null&&t.dehydrated!==null){if(s.alternate===null)throw Error(r(340));Yi()}return t=s.flags,t&65536?(s.flags=t&-65537|128,s):null;case 19:return X(Pe),null;case 4:return Re(),null;case 10:return $n(s.type),null;case 22:case 23:return Zt(s),Bu(),t!==null&&X(Pi),t=s.flags,t&65536?(s.flags=t&-65537|128,s):null;case 24:return $n(st),null;case 25:return null;default:return null}}function Sm(t,s){switch(Eu(s),s.tag){case 3:$n(st),Re();break;case 26:case 27:case 5:fe(s);break;case 4:Re();break;case 31:s.memoizedState!==null&&Zt(s);break;case 13:Zt(s);break;case 19:X(Pe);break;case 10:$n(s.type);break;case 22:case 23:Zt(s),Bu(),t!==null&&X(Pi);break;case 24:$n(st)}}function ga(t,s){try{var l=s.updateQueue,c=l!==null?l.lastEffect:null;if(c!==null){var h=c.next;l=h;do{if((l.tag&t)===t){c=void 0;var p=l.create,v=l.inst;c=p(),v.destroy=c}l=l.next}while(l!==h)}}catch(T){ke(s,s.return,T)}}function bi(t,s,l){try{var c=s.updateQueue,h=c!==null?c.lastEffect:null;if(h!==null){var p=h.next;c=p;do{if((c.tag&t)===t){var v=c.inst,T=v.destroy;if(T!==void 0){v.destroy=void 0,h=s;var N=l,z=T;try{z()}catch(G){ke(h,N,G)}}}c=c.next}while(c!==p)}}catch(G){ke(s,s.return,G)}}function wm(t){var s=t.updateQueue;if(s!==null){var l=t.stateNode;try{fg(s,l)}catch(c){ke(t,t.return,c)}}}function xm(t,s,l){l.props=ts(t.type,t.memoizedProps),l.state=t.memoizedState;try{l.componentWillUnmount()}catch(c){ke(t,s,c)}}function ma(t,s){try{var l=t.ref;if(l!==null){switch(t.tag){case 26:case 27:case 5:var c=t.stateNode;break;case 30:c=t.stateNode;break;default:c=t.stateNode}typeof l=="function"?t.refCleanup=l(c):l.current=c}}catch(h){ke(t,s,h)}}function Nn(t,s){var l=t.ref,c=t.refCleanup;if(l!==null)if(typeof c=="function")try{c()}catch(h){ke(t,s,h)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(h){ke(t,s,h)}else l.current=null}function _m(t){var s=t.type,l=t.memoizedProps,c=t.stateNode;try{e:switch(s){case"button":case"input":case"select":case"textarea":l.autoFocus&&c.focus();break e;case"img":l.src?c.src=l.src:l.srcSet&&(c.srcset=l.srcSet)}}catch(h){ke(t,t.return,h)}}function bf(t,s,l){try{var c=t.stateNode;B1(c,t.type,l,s),c[Lt]=s}catch(h){ke(t,t.return,h)}}function Em(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&Ti(t.type)||t.tag===4}function vf(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Em(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&Ti(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Sf(t,s,l){var c=t.tag;if(c===5||c===6)t=t.stateNode,s?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(t,s):(s=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,s.appendChild(t),l=l._reactRootContainer,l!=null||s.onclick!==null||(s.onclick=zn));else if(c!==4&&(c===27&&Ti(t.type)&&(l=t.stateNode,s=null),t=t.child,t!==null))for(Sf(t,s,l),t=t.sibling;t!==null;)Sf(t,s,l),t=t.sibling}function ao(t,s,l){var c=t.tag;if(c===5||c===6)t=t.stateNode,s?l.insertBefore(t,s):l.appendChild(t);else if(c!==4&&(c===27&&Ti(t.type)&&(l=t.stateNode),t=t.child,t!==null))for(ao(t,s,l),t=t.sibling;t!==null;)ao(t,s,l),t=t.sibling}function Tm(t){var s=t.stateNode,l=t.memoizedProps;try{for(var c=t.type,h=s.attributes;h.length;)s.removeAttributeNode(h[0]);xt(s,c,l),s[bt]=t,s[Lt]=l}catch(p){ke(t,t.return,p)}}var Xn=!1,lt=!1,wf=!1,Am=typeof WeakSet=="function"?WeakSet:Set,mt=null;function b1(t,s){if(t=t.containerInfo,If=No,t=Hp(t),du(t)){if("selectionStart"in t)var l={start:t.selectionStart,end:t.selectionEnd};else e:{l=(l=t.ownerDocument)&&l.defaultView||window;var c=l.getSelection&&l.getSelection();if(c&&c.rangeCount!==0){l=c.anchorNode;var h=c.anchorOffset,p=c.focusNode;c=c.focusOffset;try{l.nodeType,p.nodeType}catch{l=null;break e}var v=0,T=-1,N=-1,z=0,G=0,F=t,U=null;t:for(;;){for(var B;F!==l||h!==0&&F.nodeType!==3||(T=v+h),F!==p||c!==0&&F.nodeType!==3||(N=v+c),F.nodeType===3&&(v+=F.nodeValue.length),(B=F.firstChild)!==null;)U=F,F=B;for(;;){if(F===t)break t;if(U===l&&++z===h&&(T=v),U===p&&++G===c&&(N=v),(B=F.nextSibling)!==null)break;F=U,U=F.parentNode}F=B}l=T===-1||N===-1?null:{start:T,end:N}}else l=null}l=l||{start:0,end:0}}else l=null;for(Vf={focusedElem:t,selectionRange:l},No=!1,mt=s;mt!==null;)if(s=mt,t=s.child,(s.subtreeFlags&1028)!==0&&t!==null)t.return=s,mt=t;else for(;mt!==null;){switch(s=mt,p=s.alternate,t=s.flags,s.tag){case 0:if((t&4)!==0&&(t=s.updateQueue,t=t!==null?t.events:null,t!==null))for(l=0;l<t.length;l++)h=t[l],h.ref.impl=h.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&p!==null){t=void 0,l=s,h=p.memoizedProps,p=p.memoizedState,c=l.stateNode;try{var ne=ts(l.type,h);t=c.getSnapshotBeforeUpdate(ne,p),c.__reactInternalSnapshotBeforeUpdate=t}catch(oe){ke(l,l.return,oe)}}break;case 3:if((t&1024)!==0){if(t=s.stateNode.containerInfo,l=t.nodeType,l===9)Xf(t);else if(l===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":Xf(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((t&1024)!==0)throw Error(r(163))}if(t=s.sibling,t!==null){t.return=s.return,mt=t;break}mt=s.return}}function Cm(t,s,l){var c=l.flags;switch(l.tag){case 0:case 11:case 15:Fn(t,l),c&4&&ga(5,l);break;case 1:if(Fn(t,l),c&4)if(t=l.stateNode,s===null)try{t.componentDidMount()}catch(v){ke(l,l.return,v)}else{var h=ts(l.type,s.memoizedProps);s=s.memoizedState;try{t.componentDidUpdate(h,s,t.__reactInternalSnapshotBeforeUpdate)}catch(v){ke(l,l.return,v)}}c&64&&wm(l),c&512&&ma(l,l.return);break;case 3:if(Fn(t,l),c&64&&(t=l.updateQueue,t!==null)){if(s=null,l.child!==null)switch(l.child.tag){case 27:case 5:s=l.child.stateNode;break;case 1:s=l.child.stateNode}try{fg(t,s)}catch(v){ke(l,l.return,v)}}break;case 27:s===null&&c&4&&Tm(l);case 26:case 5:Fn(t,l),s===null&&c&4&&_m(l),c&512&&ma(l,l.return);break;case 12:Fn(t,l);break;case 31:Fn(t,l),c&4&&Mm(t,l);break;case 13:Fn(t,l),c&4&&Om(t,l),c&64&&(t=l.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(l=C1.bind(null,l),Y1(t,l))));break;case 22:if(c=l.memoizedState!==null||Xn,!c){s=s!==null&&s.memoizedState!==null||lt,h=Xn;var p=lt;Xn=c,(lt=s)&&!p?Qn(t,l,(l.subtreeFlags&8772)!==0):Fn(t,l),Xn=h,lt=p}break;case 30:break;default:Fn(t,l)}}function Nm(t){var s=t.alternate;s!==null&&(t.alternate=null,Nm(s)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(s=t.stateNode,s!==null&&Pc(s)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var $e=null,Dt=!1;function Yn(t,s,l){for(l=l.child;l!==null;)km(t,s,l),l=l.sibling}function km(t,s,l){if(ft&&typeof ft.onCommitFiberUnmount=="function")try{ft.onCommitFiberUnmount(Bi,l)}catch{}switch(l.tag){case 26:lt||Nn(l,s),Yn(t,s,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:lt||Nn(l,s);var c=$e,h=Dt;Ti(l.type)&&($e=l.stateNode,Dt=!1),Yn(t,s,l),Ta(l.stateNode),$e=c,Dt=h;break;case 5:lt||Nn(l,s);case 6:if(c=$e,h=Dt,$e=null,Yn(t,s,l),$e=c,Dt=h,$e!==null)if(Dt)try{($e.nodeType===9?$e.body:$e.nodeName==="HTML"?$e.ownerDocument.body:$e).removeChild(l.stateNode)}catch(p){ke(l,s,p)}else try{$e.removeChild(l.stateNode)}catch(p){ke(l,s,p)}break;case 18:$e!==null&&(Dt?(t=$e,wy(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,l.stateNode),lr(t)):wy($e,l.stateNode));break;case 4:c=$e,h=Dt,$e=l.stateNode.containerInfo,Dt=!0,Yn(t,s,l),$e=c,Dt=h;break;case 0:case 11:case 14:case 15:bi(2,l,s),lt||bi(4,l,s),Yn(t,s,l);break;case 1:lt||(Nn(l,s),c=l.stateNode,typeof c.componentWillUnmount=="function"&&xm(l,s,c)),Yn(t,s,l);break;case 21:Yn(t,s,l);break;case 22:lt=(c=lt)||l.memoizedState!==null,Yn(t,s,l),lt=c;break;default:Yn(t,s,l)}}function Mm(t,s){if(s.memoizedState===null&&(t=s.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{lr(t)}catch(l){ke(s,s.return,l)}}}function Om(t,s){if(s.memoizedState===null&&(t=s.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{lr(t)}catch(l){ke(s,s.return,l)}}function v1(t){switch(t.tag){case 31:case 13:case 19:var s=t.stateNode;return s===null&&(s=t.stateNode=new Am),s;case 22:return t=t.stateNode,s=t._retryCache,s===null&&(s=t._retryCache=new Am),s;default:throw Error(r(435,t.tag))}}function lo(t,s){var l=v1(t);s.forEach(function(c){if(!l.has(c)){l.add(c);var h=N1.bind(null,t,c);c.then(h,h)}})}function zt(t,s){var l=s.deletions;if(l!==null)for(var c=0;c<l.length;c++){var h=l[c],p=t,v=s,T=v;e:for(;T!==null;){switch(T.tag){case 27:if(Ti(T.type)){$e=T.stateNode,Dt=!1;break e}break;case 5:$e=T.stateNode,Dt=!1;break e;case 3:case 4:$e=T.stateNode.containerInfo,Dt=!0;break e}T=T.return}if($e===null)throw Error(r(160));km(p,v,h),$e=null,Dt=!1,p=h.alternate,p!==null&&(p.return=null),h.return=null}if(s.subtreeFlags&13886)for(s=s.child;s!==null;)jm(s,t),s=s.sibling}var Sn=null;function jm(t,s){var l=t.alternate,c=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:zt(s,t),Ut(t),c&4&&(bi(3,t,t.return),ga(3,t),bi(5,t,t.return));break;case 1:zt(s,t),Ut(t),c&512&&(lt||l===null||Nn(l,l.return)),c&64&&Xn&&(t=t.updateQueue,t!==null&&(c=t.callbacks,c!==null&&(l=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=l===null?c:l.concat(c))));break;case 26:var h=Sn;if(zt(s,t),Ut(t),c&512&&(lt||l===null||Nn(l,l.return)),c&4){var p=l!==null?l.memoizedState:null;if(c=t.memoizedState,l===null)if(c===null)if(t.stateNode===null){e:{c=t.type,l=t.memoizedProps,h=h.ownerDocument||h;t:switch(c){case"title":p=h.getElementsByTagName("title")[0],(!p||p[Vr]||p[bt]||p.namespaceURI==="http://www.w3.org/2000/svg"||p.hasAttribute("itemprop"))&&(p=h.createElement(c),h.head.insertBefore(p,h.querySelector("head > title"))),xt(p,c,l),p[bt]=t,gt(p),c=p;break e;case"link":var v=jy("link","href",h).get(c+(l.href||""));if(v){for(var T=0;T<v.length;T++)if(p=v[T],p.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&p.getAttribute("rel")===(l.rel==null?null:l.rel)&&p.getAttribute("title")===(l.title==null?null:l.title)&&p.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){v.splice(T,1);break t}}p=h.createElement(c),xt(p,c,l),h.head.appendChild(p);break;case"meta":if(v=jy("meta","content",h).get(c+(l.content||""))){for(T=0;T<v.length;T++)if(p=v[T],p.getAttribute("content")===(l.content==null?null:""+l.content)&&p.getAttribute("name")===(l.name==null?null:l.name)&&p.getAttribute("property")===(l.property==null?null:l.property)&&p.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&p.getAttribute("charset")===(l.charSet==null?null:l.charSet)){v.splice(T,1);break t}}p=h.createElement(c),xt(p,c,l),h.head.appendChild(p);break;default:throw Error(r(468,c))}p[bt]=t,gt(p),c=p}t.stateNode=c}else Ly(h,t.type,t.stateNode);else t.stateNode=Oy(h,c,t.memoizedProps);else p!==c?(p===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):p.count--,c===null?Ly(h,t.type,t.stateNode):Oy(h,c,t.memoizedProps)):c===null&&t.stateNode!==null&&bf(t,t.memoizedProps,l.memoizedProps)}break;case 27:zt(s,t),Ut(t),c&512&&(lt||l===null||Nn(l,l.return)),l!==null&&c&4&&bf(t,t.memoizedProps,l.memoizedProps);break;case 5:if(zt(s,t),Ut(t),c&512&&(lt||l===null||Nn(l,l.return)),t.flags&32){h=t.stateNode;try{Ms(h,"")}catch(ne){ke(t,t.return,ne)}}c&4&&t.stateNode!=null&&(h=t.memoizedProps,bf(t,h,l!==null?l.memoizedProps:h)),c&1024&&(wf=!0);break;case 6:if(zt(s,t),Ut(t),c&4){if(t.stateNode===null)throw Error(r(162));c=t.memoizedProps,l=t.stateNode;try{l.nodeValue=c}catch(ne){ke(t,t.return,ne)}}break;case 3:if(Eo=null,h=Sn,Sn=xo(s.containerInfo),zt(s,t),Sn=h,Ut(t),c&4&&l!==null&&l.memoizedState.isDehydrated)try{lr(s.containerInfo)}catch(ne){ke(t,t.return,ne)}wf&&(wf=!1,Lm(t));break;case 4:c=Sn,Sn=xo(t.stateNode.containerInfo),zt(s,t),Ut(t),Sn=c;break;case 12:zt(s,t),Ut(t);break;case 31:zt(s,t),Ut(t),c&4&&(c=t.updateQueue,c!==null&&(t.updateQueue=null,lo(t,c)));break;case 13:zt(s,t),Ut(t),t.child.flags&8192&&t.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(co=it()),c&4&&(c=t.updateQueue,c!==null&&(t.updateQueue=null,lo(t,c)));break;case 22:h=t.memoizedState!==null;var N=l!==null&&l.memoizedState!==null,z=Xn,G=lt;if(Xn=z||h,lt=G||N,zt(s,t),lt=G,Xn=z,Ut(t),c&8192)e:for(s=t.stateNode,s._visibility=h?s._visibility&-2:s._visibility|1,h&&(l===null||N||Xn||lt||ns(t)),l=null,s=t;;){if(s.tag===5||s.tag===26){if(l===null){N=l=s;try{if(p=N.stateNode,h)v=p.style,typeof v.setProperty=="function"?v.setProperty("display","none","important"):v.display="none";else{T=N.stateNode;var F=N.memoizedProps.style,U=F!=null&&F.hasOwnProperty("display")?F.display:null;T.style.display=U==null||typeof U=="boolean"?"":(""+U).trim()}}catch(ne){ke(N,N.return,ne)}}}else if(s.tag===6){if(l===null){N=s;try{N.stateNode.nodeValue=h?"":N.memoizedProps}catch(ne){ke(N,N.return,ne)}}}else if(s.tag===18){if(l===null){N=s;try{var B=N.stateNode;h?xy(B,!0):xy(N.stateNode,!1)}catch(ne){ke(N,N.return,ne)}}}else if((s.tag!==22&&s.tag!==23||s.memoizedState===null||s===t)&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break e;for(;s.sibling===null;){if(s.return===null||s.return===t)break e;l===s&&(l=null),s=s.return}l===s&&(l=null),s.sibling.return=s.return,s=s.sibling}c&4&&(c=t.updateQueue,c!==null&&(l=c.retryQueue,l!==null&&(c.retryQueue=null,lo(t,l))));break;case 19:zt(s,t),Ut(t),c&4&&(c=t.updateQueue,c!==null&&(t.updateQueue=null,lo(t,c)));break;case 30:break;case 21:break;default:zt(s,t),Ut(t)}}function Ut(t){var s=t.flags;if(s&2){try{for(var l,c=t.return;c!==null;){if(Em(c)){l=c;break}c=c.return}if(l==null)throw Error(r(160));switch(l.tag){case 27:var h=l.stateNode,p=vf(t);ao(t,p,h);break;case 5:var v=l.stateNode;l.flags&32&&(Ms(v,""),l.flags&=-33);var T=vf(t);ao(t,T,v);break;case 3:case 4:var N=l.stateNode.containerInfo,z=vf(t);Sf(t,z,N);break;default:throw Error(r(161))}}catch(G){ke(t,t.return,G)}t.flags&=-3}s&4096&&(t.flags&=-4097)}function Lm(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var s=t;Lm(s),s.tag===5&&s.flags&1024&&s.stateNode.reset(),t=t.sibling}}function Fn(t,s){if(s.subtreeFlags&8772)for(s=s.child;s!==null;)Cm(t,s.alternate,s),s=s.sibling}function ns(t){for(t=t.child;t!==null;){var s=t;switch(s.tag){case 0:case 11:case 14:case 15:bi(4,s,s.return),ns(s);break;case 1:Nn(s,s.return);var l=s.stateNode;typeof l.componentWillUnmount=="function"&&xm(s,s.return,l),ns(s);break;case 27:Ta(s.stateNode);case 26:case 5:Nn(s,s.return),ns(s);break;case 22:s.memoizedState===null&&ns(s);break;case 30:ns(s);break;default:ns(s)}t=t.sibling}}function Qn(t,s,l){for(l=l&&(s.subtreeFlags&8772)!==0,s=s.child;s!==null;){var c=s.alternate,h=t,p=s,v=p.flags;switch(p.tag){case 0:case 11:case 15:Qn(h,p,l),ga(4,p);break;case 1:if(Qn(h,p,l),c=p,h=c.stateNode,typeof h.componentDidMount=="function")try{h.componentDidMount()}catch(z){ke(c,c.return,z)}if(c=p,h=c.updateQueue,h!==null){var T=c.stateNode;try{var N=h.shared.hiddenCallbacks;if(N!==null)for(h.shared.hiddenCallbacks=null,h=0;h<N.length;h++)ug(N[h],T)}catch(z){ke(c,c.return,z)}}l&&v&64&&wm(p),ma(p,p.return);break;case 27:Tm(p);case 26:case 5:Qn(h,p,l),l&&c===null&&v&4&&_m(p),ma(p,p.return);break;case 12:Qn(h,p,l);break;case 31:Qn(h,p,l),l&&v&4&&Mm(h,p);break;case 13:Qn(h,p,l),l&&v&4&&Om(h,p);break;case 22:p.memoizedState===null&&Qn(h,p,l),ma(p,p.return);break;case 30:break;default:Qn(h,p,l)}s=s.sibling}}function xf(t,s){var l=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),t=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(t=s.memoizedState.cachePool.pool),t!==l&&(t!=null&&t.refCount++,l!=null&&na(l))}function _f(t,s){t=null,s.alternate!==null&&(t=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==t&&(s.refCount++,t!=null&&na(t))}function wn(t,s,l,c){if(s.subtreeFlags&10256)for(s=s.child;s!==null;)Rm(t,s,l,c),s=s.sibling}function Rm(t,s,l,c){var h=s.flags;switch(s.tag){case 0:case 11:case 15:wn(t,s,l,c),h&2048&&ga(9,s);break;case 1:wn(t,s,l,c);break;case 3:wn(t,s,l,c),h&2048&&(t=null,s.alternate!==null&&(t=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==t&&(s.refCount++,t!=null&&na(t)));break;case 12:if(h&2048){wn(t,s,l,c),t=s.stateNode;try{var p=s.memoizedProps,v=p.id,T=p.onPostCommit;typeof T=="function"&&T(v,s.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(N){ke(s,s.return,N)}}else wn(t,s,l,c);break;case 31:wn(t,s,l,c);break;case 13:wn(t,s,l,c);break;case 23:break;case 22:p=s.stateNode,v=s.alternate,s.memoizedState!==null?p._visibility&2?wn(t,s,l,c):ya(t,s):p._visibility&2?wn(t,s,l,c):(p._visibility|=2,Ps(t,s,l,c,(s.subtreeFlags&10256)!==0||!1)),h&2048&&xf(v,s);break;case 24:wn(t,s,l,c),h&2048&&_f(s.alternate,s);break;default:wn(t,s,l,c)}}function Ps(t,s,l,c,h){for(h=h&&((s.subtreeFlags&10256)!==0||!1),s=s.child;s!==null;){var p=t,v=s,T=l,N=c,z=v.flags;switch(v.tag){case 0:case 11:case 15:Ps(p,v,T,N,h),ga(8,v);break;case 23:break;case 22:var G=v.stateNode;v.memoizedState!==null?G._visibility&2?Ps(p,v,T,N,h):ya(p,v):(G._visibility|=2,Ps(p,v,T,N,h)),h&&z&2048&&xf(v.alternate,v);break;case 24:Ps(p,v,T,N,h),h&&z&2048&&_f(v.alternate,v);break;default:Ps(p,v,T,N,h)}s=s.sibling}}function ya(t,s){if(s.subtreeFlags&10256)for(s=s.child;s!==null;){var l=t,c=s,h=c.flags;switch(c.tag){case 22:ya(l,c),h&2048&&xf(c.alternate,c);break;case 24:ya(l,c),h&2048&&_f(c.alternate,c);break;default:ya(l,c)}s=s.sibling}}var ba=8192;function Js(t,s,l){if(t.subtreeFlags&ba)for(t=t.child;t!==null;)Dm(t,s,l),t=t.sibling}function Dm(t,s,l){switch(t.tag){case 26:Js(t,s,l),t.flags&ba&&t.memoizedState!==null&&rx(l,Sn,t.memoizedState,t.memoizedProps);break;case 5:Js(t,s,l);break;case 3:case 4:var c=Sn;Sn=xo(t.stateNode.containerInfo),Js(t,s,l),Sn=c;break;case 22:t.memoizedState===null&&(c=t.alternate,c!==null&&c.memoizedState!==null?(c=ba,ba=16777216,Js(t,s,l),ba=c):Js(t,s,l));break;default:Js(t,s,l)}}function zm(t){var s=t.alternate;if(s!==null&&(t=s.child,t!==null)){s.child=null;do s=t.sibling,t.sibling=null,t=s;while(t!==null)}}function va(t){var s=t.deletions;if((t.flags&16)!==0){if(s!==null)for(var l=0;l<s.length;l++){var c=s[l];mt=c,Hm(c,t)}zm(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Um(t),t=t.sibling}function Um(t){switch(t.tag){case 0:case 11:case 15:va(t),t.flags&2048&&bi(9,t,t.return);break;case 3:va(t);break;case 12:va(t);break;case 22:var s=t.stateNode;t.memoizedState!==null&&s._visibility&2&&(t.return===null||t.return.tag!==13)?(s._visibility&=-3,oo(t)):va(t);break;default:va(t)}}function oo(t){var s=t.deletions;if((t.flags&16)!==0){if(s!==null)for(var l=0;l<s.length;l++){var c=s[l];mt=c,Hm(c,t)}zm(t)}for(t=t.child;t!==null;){switch(s=t,s.tag){case 0:case 11:case 15:bi(8,s,s.return),oo(s);break;case 22:l=s.stateNode,l._visibility&2&&(l._visibility&=-3,oo(s));break;default:oo(s)}t=t.sibling}}function Hm(t,s){for(;mt!==null;){var l=mt;switch(l.tag){case 0:case 11:case 15:bi(8,l,s);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var c=l.memoizedState.cachePool.pool;c!=null&&c.refCount++}break;case 24:na(l.memoizedState.cache)}if(c=l.child,c!==null)c.return=l,mt=c;else e:for(l=t;mt!==null;){c=mt;var h=c.sibling,p=c.return;if(Nm(c),c===l){mt=null;break e}if(h!==null){h.return=p,mt=h;break e}mt=p}}}var S1={getCacheForType:function(t){var s=St(st),l=s.data.get(t);return l===void 0&&(l=t(),s.data.set(t,l)),l},cacheSignal:function(){return St(st).controller.signal}},w1=typeof WeakMap=="function"?WeakMap:Map,Ce=0,De=null,ye=null,ve=0,Ne=0,Wt=null,vi=!1,Zs=!1,Ef=!1,Pn=0,Qe=0,Si=0,is=0,Tf=0,en=0,Ws=0,Sa=null,Ht=null,Af=!1,co=0,Bm=0,uo=1/0,fo=null,wi=null,ht=0,xi=null,er=null,Jn=0,Cf=0,Nf=null,qm=null,wa=0,kf=null;function tn(){return(Ce&2)!==0&&ve!==0?ve&-ve:q.T!==null?Df():np()}function $m(){if(en===0)if((ve&536870912)===0||we){var t=Tn;Tn<<=1,(Tn&3932160)===0&&(Tn=262144),en=t}else en=536870912;return t=Jt.current,t!==null&&(t.flags|=32),en}function Bt(t,s,l){(t===De&&(Ne===2||Ne===9)||t.cancelPendingCommit!==null)&&(tr(t,0),_i(t,ve,en,!1)),Ir(t,l),((Ce&2)===0||t!==De)&&(t===De&&((Ce&2)===0&&(is|=l),Qe===4&&_i(t,ve,en,!1)),kn(t))}function Im(t,s,l){if((Ce&6)!==0)throw Error(r(327));var c=!l&&(s&127)===0&&(s&t.expiredLanes)===0||$r(t,s),h=c?E1(t,s):Of(t,s,!0),p=c;do{if(h===0){Zs&&!c&&_i(t,s,0,!1);break}else{if(l=t.current.alternate,p&&!x1(l)){h=Of(t,s,!1),p=!1;continue}if(h===2){if(p=s,t.errorRecoveryDisabledLanes&p)var v=0;else v=t.pendingLanes&-536870913,v=v!==0?v:v&536870912?536870912:0;if(v!==0){s=v;e:{var T=t;h=Sa;var N=T.current.memoizedState.isDehydrated;if(N&&(tr(T,v).flags|=256),v=Of(T,v,!1),v!==2){if(Ef&&!N){T.errorRecoveryDisabledLanes|=p,is|=p,h=4;break e}p=Ht,Ht=h,p!==null&&(Ht===null?Ht=p:Ht.push.apply(Ht,p))}h=v}if(p=!1,h!==2)continue}}if(h===1){tr(t,0),_i(t,s,0,!0);break}e:{switch(c=t,p=h,p){case 0:case 1:throw Error(r(345));case 4:if((s&4194048)!==s)break;case 6:_i(c,s,en,!vi);break e;case 2:Ht=null;break;case 3:case 5:break;default:throw Error(r(329))}if((s&62914560)===s&&(h=co+300-it(),10<h)){if(_i(c,s,en,!vi),wl(c,0,!0)!==0)break e;Jn=s,c.timeoutHandle=vy(Vm.bind(null,c,l,Ht,fo,Af,s,en,is,Ws,vi,p,"Throttled",-0,0),h);break e}Vm(c,l,Ht,fo,Af,s,en,is,Ws,vi,p,null,-0,0)}}break}while(!0);kn(t)}function Vm(t,s,l,c,h,p,v,T,N,z,G,F,U,B){if(t.timeoutHandle=-1,F=s.subtreeFlags,F&8192||(F&16785408)===16785408){F={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:zn},Dm(s,p,F);var ne=(p&62914560)===p?co-it():(p&4194048)===p?Bm-it():0;if(ne=ax(F,ne),ne!==null){Jn=p,t.cancelPendingCommit=ne(Jm.bind(null,t,s,p,l,c,h,v,T,N,G,F,null,U,B)),_i(t,p,v,!z);return}}Jm(t,s,p,l,c,h,v,T,N)}function x1(t){for(var s=t;;){var l=s.tag;if((l===0||l===11||l===15)&&s.flags&16384&&(l=s.updateQueue,l!==null&&(l=l.stores,l!==null)))for(var c=0;c<l.length;c++){var h=l[c],p=h.getSnapshot;h=h.value;try{if(!Qt(p(),h))return!1}catch{return!1}}if(l=s.child,s.subtreeFlags&16384&&l!==null)l.return=s,s=l;else{if(s===t)break;for(;s.sibling===null;){if(s.return===null||s.return===t)return!0;s=s.return}s.sibling.return=s.return,s=s.sibling}}return!0}function _i(t,s,l,c){s&=~Tf,s&=~is,t.suspendedLanes|=s,t.pingedLanes&=~s,c&&(t.warmLanes|=s),c=t.expirationTimes;for(var h=s;0<h;){var p=31-kt(h),v=1<<p;c[p]=-1,h&=~v}l!==0&&Wd(t,l,s)}function ho(){return(Ce&6)===0?(xa(0),!1):!0}function Mf(){if(ye!==null){if(Ne===0)var t=ye.return;else t=ye,qn=Fi=null,Ku(t),Ks=null,sa=0,t=ye;for(;t!==null;)Sm(t.alternate,t),t=t.return;ye=null}}function tr(t,s){var l=t.timeoutHandle;l!==-1&&(t.timeoutHandle=-1,I1(l)),l=t.cancelPendingCommit,l!==null&&(t.cancelPendingCommit=null,l()),Jn=0,Mf(),De=t,ye=l=Hn(t.current,null),ve=s,Ne=0,Wt=null,vi=!1,Zs=$r(t,s),Ef=!1,Ws=en=Tf=is=Si=Qe=0,Ht=Sa=null,Af=!1,(s&8)!==0&&(s|=s&32);var c=t.entangledLanes;if(c!==0)for(t=t.entanglements,c&=s;0<c;){var h=31-kt(c),p=1<<h;s|=t[h],c&=~p}return Pn=s,Ll(),l}function Gm(t,s){pe=null,q.H=ha,s===Gs||s===$l?(s=ag(),Ne=3):s===Lu?(s=ag(),Ne=4):Ne=s===of?8:s!==null&&typeof s=="object"&&typeof s.then=="function"?6:1,Wt=s,ye===null&&(Qe=1,to(t,on(s,t.current)))}function Km(){var t=Jt.current;return t===null?!0:(ve&4194048)===ve?hn===null:(ve&62914560)===ve||(ve&536870912)!==0?t===hn:!1}function Xm(){var t=q.H;return q.H=ha,t===null?ha:t}function Ym(){var t=q.A;return q.A=S1,t}function po(){Qe=4,vi||(ve&4194048)!==ve&&Jt.current!==null||(Zs=!0),(Si&134217727)===0&&(is&134217727)===0||De===null||_i(De,ve,en,!1)}function Of(t,s,l){var c=Ce;Ce|=2;var h=Xm(),p=Ym();(De!==t||ve!==s)&&(fo=null,tr(t,s)),s=!1;var v=Qe;e:do try{if(Ne!==0&&ye!==null){var T=ye,N=Wt;switch(Ne){case 8:Mf(),v=6;break e;case 3:case 2:case 9:case 6:Jt.current===null&&(s=!0);var z=Ne;if(Ne=0,Wt=null,nr(t,T,N,z),l&&Zs){v=0;break e}break;default:z=Ne,Ne=0,Wt=null,nr(t,T,N,z)}}_1(),v=Qe;break}catch(G){Gm(t,G)}while(!0);return s&&t.shellSuspendCounter++,qn=Fi=null,Ce=c,q.H=h,q.A=p,ye===null&&(De=null,ve=0,Ll()),v}function _1(){for(;ye!==null;)Fm(ye)}function E1(t,s){var l=Ce;Ce|=2;var c=Xm(),h=Ym();De!==t||ve!==s?(fo=null,uo=it()+500,tr(t,s)):Zs=$r(t,s);e:do try{if(Ne!==0&&ye!==null){s=ye;var p=Wt;t:switch(Ne){case 1:Ne=0,Wt=null,nr(t,s,p,1);break;case 2:case 9:if(sg(p)){Ne=0,Wt=null,Qm(s);break}s=function(){Ne!==2&&Ne!==9||De!==t||(Ne=7),kn(t)},p.then(s,s);break e;case 3:Ne=7;break e;case 4:Ne=5;break e;case 7:sg(p)?(Ne=0,Wt=null,Qm(s)):(Ne=0,Wt=null,nr(t,s,p,7));break;case 5:var v=null;switch(ye.tag){case 26:v=ye.memoizedState;case 5:case 27:var T=ye;if(v?Ry(v):T.stateNode.complete){Ne=0,Wt=null;var N=T.sibling;if(N!==null)ye=N;else{var z=T.return;z!==null?(ye=z,go(z)):ye=null}break t}}Ne=0,Wt=null,nr(t,s,p,5);break;case 6:Ne=0,Wt=null,nr(t,s,p,6);break;case 8:Mf(),Qe=6;break e;default:throw Error(r(462))}}T1();break}catch(G){Gm(t,G)}while(!0);return qn=Fi=null,q.H=c,q.A=h,Ce=l,ye!==null?0:(De=null,ve=0,Ll(),Qe)}function T1(){for(;ye!==null&&!ws();)Fm(ye)}function Fm(t){var s=bm(t.alternate,t,Pn);t.memoizedProps=t.pendingProps,s===null?go(t):ye=s}function Qm(t){var s=t,l=s.alternate;switch(s.tag){case 15:case 0:s=hm(l,s,s.pendingProps,s.type,void 0,ve);break;case 11:s=hm(l,s,s.pendingProps,s.type.render,s.ref,ve);break;case 5:Ku(s);default:Sm(l,s),s=ye=Yp(s,Pn),s=bm(l,s,Pn)}t.memoizedProps=t.pendingProps,s===null?go(t):ye=s}function nr(t,s,l,c){qn=Fi=null,Ku(s),Ks=null,sa=0;var h=s.return;try{if(d1(t,h,s,l,ve)){Qe=1,to(t,on(l,t.current)),ye=null;return}}catch(p){if(h!==null)throw ye=h,p;Qe=1,to(t,on(l,t.current)),ye=null;return}s.flags&32768?(we||c===1?t=!0:Zs||(ve&536870912)!==0?t=!1:(vi=t=!0,(c===2||c===9||c===3||c===6)&&(c=Jt.current,c!==null&&c.tag===13&&(c.flags|=16384))),Pm(s,t)):go(s)}function go(t){var s=t;do{if((s.flags&32768)!==0){Pm(s,vi);return}t=s.return;var l=m1(s.alternate,s,Pn);if(l!==null){ye=l;return}if(s=s.sibling,s!==null){ye=s;return}ye=s=t}while(s!==null);Qe===0&&(Qe=5)}function Pm(t,s){do{var l=y1(t.alternate,t);if(l!==null){l.flags&=32767,ye=l;return}if(l=t.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!s&&(t=t.sibling,t!==null)){ye=t;return}ye=t=l}while(t!==null);Qe=6,ye=null}function Jm(t,s,l,c,h,p,v,T,N){t.cancelPendingCommit=null;do mo();while(ht!==0);if((Ce&6)!==0)throw Error(r(327));if(s!==null){if(s===t.current)throw Error(r(177));if(p=s.lanes|s.childLanes,p|=bu,sw(t,l,p,v,T,N),t===De&&(ye=De=null,ve=0),er=s,xi=t,Jn=l,Cf=p,Nf=h,qm=c,(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,k1(xs,function(){return ny(),null})):(t.callbackNode=null,t.callbackPriority=0),c=(s.flags&13878)!==0,(s.subtreeFlags&13878)!==0||c){c=q.T,q.T=null,h=Z.p,Z.p=2,v=Ce,Ce|=4;try{b1(t,s,l)}finally{Ce=v,Z.p=h,q.T=c}}ht=1,Zm(),Wm(),ey()}}function Zm(){if(ht===1){ht=0;var t=xi,s=er,l=(s.flags&13878)!==0;if((s.subtreeFlags&13878)!==0||l){l=q.T,q.T=null;var c=Z.p;Z.p=2;var h=Ce;Ce|=4;try{jm(s,t);var p=Vf,v=Hp(t.containerInfo),T=p.focusedElem,N=p.selectionRange;if(v!==T&&T&&T.ownerDocument&&Up(T.ownerDocument.documentElement,T)){if(N!==null&&du(T)){var z=N.start,G=N.end;if(G===void 0&&(G=z),"selectionStart"in T)T.selectionStart=z,T.selectionEnd=Math.min(G,T.value.length);else{var F=T.ownerDocument||document,U=F&&F.defaultView||window;if(U.getSelection){var B=U.getSelection(),ne=T.textContent.length,oe=Math.min(N.start,ne),Le=N.end===void 0?oe:Math.min(N.end,ne);!B.extend&&oe>Le&&(v=Le,Le=oe,oe=v);var L=zp(T,oe),k=zp(T,Le);if(L&&k&&(B.rangeCount!==1||B.anchorNode!==L.node||B.anchorOffset!==L.offset||B.focusNode!==k.node||B.focusOffset!==k.offset)){var D=F.createRange();D.setStart(L.node,L.offset),B.removeAllRanges(),oe>Le?(B.addRange(D),B.extend(k.node,k.offset)):(D.setEnd(k.node,k.offset),B.addRange(D))}}}}for(F=[],B=T;B=B.parentNode;)B.nodeType===1&&F.push({element:B,left:B.scrollLeft,top:B.scrollTop});for(typeof T.focus=="function"&&T.focus(),T=0;T<F.length;T++){var Y=F[T];Y.element.scrollLeft=Y.left,Y.element.scrollTop=Y.top}}No=!!If,Vf=If=null}finally{Ce=h,Z.p=c,q.T=l}}t.current=s,ht=2}}function Wm(){if(ht===2){ht=0;var t=xi,s=er,l=(s.flags&8772)!==0;if((s.subtreeFlags&8772)!==0||l){l=q.T,q.T=null;var c=Z.p;Z.p=2;var h=Ce;Ce|=4;try{Cm(t,s.alternate,s)}finally{Ce=h,Z.p=c,q.T=l}}ht=3}}function ey(){if(ht===4||ht===3){ht=0,qc();var t=xi,s=er,l=Jn,c=qm;(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?ht=5:(ht=0,er=xi=null,ty(t,t.pendingLanes));var h=t.pendingLanes;if(h===0&&(wi=null),Fc(l),s=s.stateNode,ft&&typeof ft.onCommitFiberRoot=="function")try{ft.onCommitFiberRoot(Bi,s,void 0,(s.current.flags&128)===128)}catch{}if(c!==null){s=q.T,h=Z.p,Z.p=2,q.T=null;try{for(var p=t.onRecoverableError,v=0;v<c.length;v++){var T=c[v];p(T.value,{componentStack:T.stack})}}finally{q.T=s,Z.p=h}}(Jn&3)!==0&&mo(),kn(t),h=t.pendingLanes,(l&261930)!==0&&(h&42)!==0?t===kf?wa++:(wa=0,kf=t):wa=0,xa(0)}}function ty(t,s){(t.pooledCacheLanes&=s)===0&&(s=t.pooledCache,s!=null&&(t.pooledCache=null,na(s)))}function mo(){return Zm(),Wm(),ey(),ny()}function ny(){if(ht!==5)return!1;var t=xi,s=Cf;Cf=0;var l=Fc(Jn),c=q.T,h=Z.p;try{Z.p=32>l?32:l,q.T=null,l=Nf,Nf=null;var p=xi,v=Jn;if(ht=0,er=xi=null,Jn=0,(Ce&6)!==0)throw Error(r(331));var T=Ce;if(Ce|=4,Um(p.current),Rm(p,p.current,v,l),Ce=T,xa(0,!1),ft&&typeof ft.onPostCommitFiberRoot=="function")try{ft.onPostCommitFiberRoot(Bi,p)}catch{}return!0}finally{Z.p=h,q.T=c,ty(t,s)}}function iy(t,s,l){s=on(l,s),s=lf(t.stateNode,s,2),t=gi(t,s,2),t!==null&&(Ir(t,2),kn(t))}function ke(t,s,l){if(t.tag===3)iy(t,t,l);else for(;s!==null;){if(s.tag===3){iy(s,t,l);break}else if(s.tag===1){var c=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof c.componentDidCatch=="function"&&(wi===null||!wi.has(c))){t=on(l,t),l=sm(2),c=gi(s,l,2),c!==null&&(rm(l,c,s,t),Ir(c,2),kn(c));break}}s=s.return}}function jf(t,s,l){var c=t.pingCache;if(c===null){c=t.pingCache=new w1;var h=new Set;c.set(s,h)}else h=c.get(s),h===void 0&&(h=new Set,c.set(s,h));h.has(l)||(Ef=!0,h.add(l),t=A1.bind(null,t,s,l),s.then(t,t))}function A1(t,s,l){var c=t.pingCache;c!==null&&c.delete(s),t.pingedLanes|=t.suspendedLanes&l,t.warmLanes&=~l,De===t&&(ve&l)===l&&(Qe===4||Qe===3&&(ve&62914560)===ve&&300>it()-co?(Ce&2)===0&&tr(t,0):Tf|=l,Ws===ve&&(Ws=0)),kn(t)}function sy(t,s){s===0&&(s=Zd()),t=Ki(t,s),t!==null&&(Ir(t,s),kn(t))}function C1(t){var s=t.memoizedState,l=0;s!==null&&(l=s.retryLane),sy(t,l)}function N1(t,s){var l=0;switch(t.tag){case 31:case 13:var c=t.stateNode,h=t.memoizedState;h!==null&&(l=h.retryLane);break;case 19:c=t.stateNode;break;case 22:c=t.stateNode._retryCache;break;default:throw Error(r(314))}c!==null&&c.delete(s),sy(t,l)}function k1(t,s){return vs(t,s)}var yo=null,ir=null,Lf=!1,bo=!1,Rf=!1,Ei=0;function kn(t){t!==ir&&t.next===null&&(ir===null?yo=ir=t:ir=ir.next=t),bo=!0,Lf||(Lf=!0,O1())}function xa(t,s){if(!Rf&&bo){Rf=!0;do for(var l=!1,c=yo;c!==null;){if(t!==0){var h=c.pendingLanes;if(h===0)var p=0;else{var v=c.suspendedLanes,T=c.pingedLanes;p=(1<<31-kt(42|t)+1)-1,p&=h&~(v&~T),p=p&201326741?p&201326741|1:p?p|2:0}p!==0&&(l=!0,oy(c,p))}else p=ve,p=wl(c,c===De?p:0,c.cancelPendingCommit!==null||c.timeoutHandle!==-1),(p&3)===0||$r(c,p)||(l=!0,oy(c,p));c=c.next}while(l);Rf=!1}}function M1(){ry()}function ry(){bo=Lf=!1;var t=0;Ei!==0&&$1()&&(t=Ei);for(var s=it(),l=null,c=yo;c!==null;){var h=c.next,p=ay(c,s);p===0?(c.next=null,l===null?yo=h:l.next=h,h===null&&(ir=l)):(l=c,(t!==0||(p&3)!==0)&&(bo=!0)),c=h}ht!==0&&ht!==5||xa(t),Ei!==0&&(Ei=0)}function ay(t,s){for(var l=t.suspendedLanes,c=t.pingedLanes,h=t.expirationTimes,p=t.pendingLanes&-62914561;0<p;){var v=31-kt(p),T=1<<v,N=h[v];N===-1?((T&l)===0||(T&c)!==0)&&(h[v]=iw(T,s)):N<=s&&(t.expiredLanes|=T),p&=~T}if(s=De,l=ve,l=wl(t,t===s?l:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),c=t.callbackNode,l===0||t===s&&(Ne===2||Ne===9)||t.cancelPendingCommit!==null)return c!==null&&c!==null&&Ss(c),t.callbackNode=null,t.callbackPriority=0;if((l&3)===0||$r(t,l)){if(s=l&-l,s===t.callbackPriority)return s;switch(c!==null&&Ss(c),Fc(l)){case 2:case 8:l=bl;break;case 32:l=xs;break;case 268435456:l=_s;break;default:l=xs}return c=ly.bind(null,t),l=vs(l,c),t.callbackPriority=s,t.callbackNode=l,s}return c!==null&&c!==null&&Ss(c),t.callbackPriority=2,t.callbackNode=null,2}function ly(t,s){if(ht!==0&&ht!==5)return t.callbackNode=null,t.callbackPriority=0,null;var l=t.callbackNode;if(mo()&&t.callbackNode!==l)return null;var c=ve;return c=wl(t,t===De?c:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),c===0?null:(Im(t,c,s),ay(t,it()),t.callbackNode!=null&&t.callbackNode===l?ly.bind(null,t):null)}function oy(t,s){if(mo())return null;Im(t,s,!0)}function O1(){V1(function(){(Ce&6)!==0?vs(yl,M1):ry()})}function Df(){if(Ei===0){var t=Is;t===0&&(t=le,le<<=1,(le&261888)===0&&(le=256)),Ei=t}return Ei}function cy(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:Tl(""+t)}function uy(t,s){var l=s.ownerDocument.createElement("input");return l.name=s.name,l.value=s.value,t.id&&l.setAttribute("form",t.id),s.parentNode.insertBefore(l,s),t=new FormData(t),l.parentNode.removeChild(l),t}function j1(t,s,l,c,h){if(s==="submit"&&l&&l.stateNode===h){var p=cy((h[Lt]||null).action),v=c.submitter;v&&(s=(s=v[Lt]||null)?cy(s.formAction):v.getAttribute("formAction"),s!==null&&(p=s,v=null));var T=new kl("action","action",null,c,h);t.push({event:T,listeners:[{instance:null,listener:function(){if(c.defaultPrevented){if(Ei!==0){var N=v?uy(h,v):new FormData(h);ef(l,{pending:!0,data:N,method:h.method,action:p},null,N)}}else typeof p=="function"&&(T.preventDefault(),N=v?uy(h,v):new FormData(h),ef(l,{pending:!0,data:N,method:h.method,action:p},p,N))},currentTarget:h}]})}}for(var zf=0;zf<yu.length;zf++){var Uf=yu[zf],L1=Uf.toLowerCase(),R1=Uf[0].toUpperCase()+Uf.slice(1);vn(L1,"on"+R1)}vn($p,"onAnimationEnd"),vn(Ip,"onAnimationIteration"),vn(Vp,"onAnimationStart"),vn("dblclick","onDoubleClick"),vn("focusin","onFocus"),vn("focusout","onBlur"),vn(Pw,"onTransitionRun"),vn(Jw,"onTransitionStart"),vn(Zw,"onTransitionCancel"),vn(Gp,"onTransitionEnd"),Ns("onMouseEnter",["mouseout","mouseover"]),Ns("onMouseLeave",["mouseout","mouseover"]),Ns("onPointerEnter",["pointerout","pointerover"]),Ns("onPointerLeave",["pointerout","pointerover"]),$i("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),$i("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),$i("onBeforeInput",["compositionend","keypress","textInput","paste"]),$i("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),$i("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),$i("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var _a="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),D1=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(_a));function fy(t,s){s=(s&4)!==0;for(var l=0;l<t.length;l++){var c=t[l],h=c.event;c=c.listeners;e:{var p=void 0;if(s)for(var v=c.length-1;0<=v;v--){var T=c[v],N=T.instance,z=T.currentTarget;if(T=T.listener,N!==p&&h.isPropagationStopped())break e;p=T,h.currentTarget=z;try{p(h)}catch(G){jl(G)}h.currentTarget=null,p=N}else for(v=0;v<c.length;v++){if(T=c[v],N=T.instance,z=T.currentTarget,T=T.listener,N!==p&&h.isPropagationStopped())break e;p=T,h.currentTarget=z;try{p(h)}catch(G){jl(G)}h.currentTarget=null,p=N}}}}function be(t,s){var l=s[Qc];l===void 0&&(l=s[Qc]=new Set);var c=t+"__bubble";l.has(c)||(hy(s,t,2,!1),l.add(c))}function Hf(t,s,l){var c=0;s&&(c|=4),hy(l,t,c,s)}var vo="_reactListening"+Math.random().toString(36).slice(2);function Bf(t){if(!t[vo]){t[vo]=!0,rp.forEach(function(l){l!=="selectionchange"&&(D1.has(l)||Hf(l,!1,t),Hf(l,!0,t))});var s=t.nodeType===9?t:t.ownerDocument;s===null||s[vo]||(s[vo]=!0,Hf("selectionchange",!1,s))}}function hy(t,s,l,c){switch($y(s)){case 2:var h=cx;break;case 8:h=ux;break;default:h=eh}l=h.bind(null,s,l,t),h=void 0,!su||s!=="touchstart"&&s!=="touchmove"&&s!=="wheel"||(h=!0),c?h!==void 0?t.addEventListener(s,l,{capture:!0,passive:h}):t.addEventListener(s,l,!0):h!==void 0?t.addEventListener(s,l,{passive:h}):t.addEventListener(s,l,!1)}function qf(t,s,l,c,h){var p=c;if((s&1)===0&&(s&2)===0&&c!==null)e:for(;;){if(c===null)return;var v=c.tag;if(v===3||v===4){var T=c.stateNode.containerInfo;if(T===h)break;if(v===4)for(v=c.return;v!==null;){var N=v.tag;if((N===3||N===4)&&v.stateNode.containerInfo===h)return;v=v.return}for(;T!==null;){if(v=Ts(T),v===null)return;if(N=v.tag,N===5||N===6||N===26||N===27){c=p=v;continue e}T=T.parentNode}}c=c.return}yp(function(){var z=p,G=nu(l),F=[];e:{var U=Kp.get(t);if(U!==void 0){var B=kl,ne=t;switch(t){case"keypress":if(Cl(l)===0)break e;case"keydown":case"keyup":B=Nw;break;case"focusin":ne="focus",B=ou;break;case"focusout":ne="blur",B=ou;break;case"beforeblur":case"afterblur":B=ou;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":B=Sp;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":B=mw;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":B=Ow;break;case $p:case Ip:case Vp:B=vw;break;case Gp:B=Lw;break;case"scroll":case"scrollend":B=pw;break;case"wheel":B=Dw;break;case"copy":case"cut":case"paste":B=ww;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":B=xp;break;case"toggle":case"beforetoggle":B=Uw}var oe=(s&4)!==0,Le=!oe&&(t==="scroll"||t==="scrollend"),L=oe?U!==null?U+"Capture":null:U;oe=[];for(var k=z,D;k!==null;){var Y=k;if(D=Y.stateNode,Y=Y.tag,Y!==5&&Y!==26&&Y!==27||D===null||L===null||(Y=Kr(k,L),Y!=null&&oe.push(Ea(k,Y,D))),Le)break;k=k.return}0<oe.length&&(U=new B(U,ne,null,l,G),F.push({event:U,listeners:oe}))}}if((s&7)===0){e:{if(U=t==="mouseover"||t==="pointerover",B=t==="mouseout"||t==="pointerout",U&&l!==tu&&(ne=l.relatedTarget||l.fromElement)&&(Ts(ne)||ne[Es]))break e;if((B||U)&&(U=G.window===G?G:(U=G.ownerDocument)?U.defaultView||U.parentWindow:window,B?(ne=l.relatedTarget||l.toElement,B=z,ne=ne?Ts(ne):null,ne!==null&&(Le=o(ne),oe=ne.tag,ne!==Le||oe!==5&&oe!==27&&oe!==6)&&(ne=null)):(B=null,ne=z),B!==ne)){if(oe=Sp,Y="onMouseLeave",L="onMouseEnter",k="mouse",(t==="pointerout"||t==="pointerover")&&(oe=xp,Y="onPointerLeave",L="onPointerEnter",k="pointer"),Le=B==null?U:Gr(B),D=ne==null?U:Gr(ne),U=new oe(Y,k+"leave",B,l,G),U.target=Le,U.relatedTarget=D,Y=null,Ts(G)===z&&(oe=new oe(L,k+"enter",ne,l,G),oe.target=D,oe.relatedTarget=Le,Y=oe),Le=Y,B&&ne)t:{for(oe=z1,L=B,k=ne,D=0,Y=L;Y;Y=oe(Y))D++;Y=0;for(var ae=k;ae;ae=oe(ae))Y++;for(;0<D-Y;)L=oe(L),D--;for(;0<Y-D;)k=oe(k),Y--;for(;D--;){if(L===k||k!==null&&L===k.alternate){oe=L;break t}L=oe(L),k=oe(k)}oe=null}else oe=null;B!==null&&dy(F,U,B,oe,!1),ne!==null&&Le!==null&&dy(F,Le,ne,oe,!0)}}e:{if(U=z?Gr(z):window,B=U.nodeName&&U.nodeName.toLowerCase(),B==="select"||B==="input"&&U.type==="file")var Te=Mp;else if(Np(U))if(Op)Te=Yw;else{Te=Kw;var ie=Gw}else B=U.nodeName,!B||B.toLowerCase()!=="input"||U.type!=="checkbox"&&U.type!=="radio"?z&&eu(z.elementType)&&(Te=Mp):Te=Xw;if(Te&&(Te=Te(t,z))){kp(F,Te,l,G);break e}ie&&ie(t,U,z),t==="focusout"&&z&&U.type==="number"&&z.memoizedProps.value!=null&&Wc(U,"number",U.value)}switch(ie=z?Gr(z):window,t){case"focusin":(Np(ie)||ie.contentEditable==="true")&&(Rs=ie,pu=z,Wr=null);break;case"focusout":Wr=pu=Rs=null;break;case"mousedown":gu=!0;break;case"contextmenu":case"mouseup":case"dragend":gu=!1,Bp(F,l,G);break;case"selectionchange":if(Qw)break;case"keydown":case"keyup":Bp(F,l,G)}var ge;if(uu)e:{switch(t){case"compositionstart":var Se="onCompositionStart";break e;case"compositionend":Se="onCompositionEnd";break e;case"compositionupdate":Se="onCompositionUpdate";break e}Se=void 0}else Ls?Ap(t,l)&&(Se="onCompositionEnd"):t==="keydown"&&l.keyCode===229&&(Se="onCompositionStart");Se&&(_p&&l.locale!=="ko"&&(Ls||Se!=="onCompositionStart"?Se==="onCompositionEnd"&&Ls&&(ge=bp()):(oi=G,ru="value"in oi?oi.value:oi.textContent,Ls=!0)),ie=So(z,Se),0<ie.length&&(Se=new wp(Se,t,null,l,G),F.push({event:Se,listeners:ie}),ge?Se.data=ge:(ge=Cp(l),ge!==null&&(Se.data=ge)))),(ge=Bw?qw(t,l):$w(t,l))&&(Se=So(z,"onBeforeInput"),0<Se.length&&(ie=new wp("onBeforeInput","beforeinput",null,l,G),F.push({event:ie,listeners:Se}),ie.data=ge)),j1(F,t,z,l,G)}fy(F,s)})}function Ea(t,s,l){return{instance:t,listener:s,currentTarget:l}}function So(t,s){for(var l=s+"Capture",c=[];t!==null;){var h=t,p=h.stateNode;if(h=h.tag,h!==5&&h!==26&&h!==27||p===null||(h=Kr(t,l),h!=null&&c.unshift(Ea(t,h,p)),h=Kr(t,s),h!=null&&c.push(Ea(t,h,p))),t.tag===3)return c;t=t.return}return[]}function z1(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function dy(t,s,l,c,h){for(var p=s._reactName,v=[];l!==null&&l!==c;){var T=l,N=T.alternate,z=T.stateNode;if(T=T.tag,N!==null&&N===c)break;T!==5&&T!==26&&T!==27||z===null||(N=z,h?(z=Kr(l,p),z!=null&&v.unshift(Ea(l,z,N))):h||(z=Kr(l,p),z!=null&&v.push(Ea(l,z,N)))),l=l.return}v.length!==0&&t.push({event:s,listeners:v})}var U1=/\r\n?/g,H1=/\u0000|\uFFFD/g;function py(t){return(typeof t=="string"?t:""+t).replace(U1,`
`).replace(H1,"")}function gy(t,s){return s=py(s),py(t)===s}function je(t,s,l,c,h,p){switch(l){case"children":typeof c=="string"?s==="body"||s==="textarea"&&c===""||Ms(t,c):(typeof c=="number"||typeof c=="bigint")&&s!=="body"&&Ms(t,""+c);break;case"className":_l(t,"class",c);break;case"tabIndex":_l(t,"tabindex",c);break;case"dir":case"role":case"viewBox":case"width":case"height":_l(t,l,c);break;case"style":gp(t,c,p);break;case"data":if(s!=="object"){_l(t,"data",c);break}case"src":case"href":if(c===""&&(s!=="a"||l!=="href")){t.removeAttribute(l);break}if(c==null||typeof c=="function"||typeof c=="symbol"||typeof c=="boolean"){t.removeAttribute(l);break}c=Tl(""+c),t.setAttribute(l,c);break;case"action":case"formAction":if(typeof c=="function"){t.setAttribute(l,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof p=="function"&&(l==="formAction"?(s!=="input"&&je(t,s,"name",h.name,h,null),je(t,s,"formEncType",h.formEncType,h,null),je(t,s,"formMethod",h.formMethod,h,null),je(t,s,"formTarget",h.formTarget,h,null)):(je(t,s,"encType",h.encType,h,null),je(t,s,"method",h.method,h,null),je(t,s,"target",h.target,h,null)));if(c==null||typeof c=="symbol"||typeof c=="boolean"){t.removeAttribute(l);break}c=Tl(""+c),t.setAttribute(l,c);break;case"onClick":c!=null&&(t.onclick=zn);break;case"onScroll":c!=null&&be("scroll",t);break;case"onScrollEnd":c!=null&&be("scrollend",t);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(r(61));if(l=c.__html,l!=null){if(h.children!=null)throw Error(r(60));t.innerHTML=l}}break;case"multiple":t.multiple=c&&typeof c!="function"&&typeof c!="symbol";break;case"muted":t.muted=c&&typeof c!="function"&&typeof c!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(c==null||typeof c=="function"||typeof c=="boolean"||typeof c=="symbol"){t.removeAttribute("xlink:href");break}l=Tl(""+c),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":c!=null&&typeof c!="function"&&typeof c!="symbol"?t.setAttribute(l,""+c):t.removeAttribute(l);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":c&&typeof c!="function"&&typeof c!="symbol"?t.setAttribute(l,""):t.removeAttribute(l);break;case"capture":case"download":c===!0?t.setAttribute(l,""):c!==!1&&c!=null&&typeof c!="function"&&typeof c!="symbol"?t.setAttribute(l,c):t.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":c!=null&&typeof c!="function"&&typeof c!="symbol"&&!isNaN(c)&&1<=c?t.setAttribute(l,c):t.removeAttribute(l);break;case"rowSpan":case"start":c==null||typeof c=="function"||typeof c=="symbol"||isNaN(c)?t.removeAttribute(l):t.setAttribute(l,c);break;case"popover":be("beforetoggle",t),be("toggle",t),xl(t,"popover",c);break;case"xlinkActuate":Dn(t,"http://www.w3.org/1999/xlink","xlink:actuate",c);break;case"xlinkArcrole":Dn(t,"http://www.w3.org/1999/xlink","xlink:arcrole",c);break;case"xlinkRole":Dn(t,"http://www.w3.org/1999/xlink","xlink:role",c);break;case"xlinkShow":Dn(t,"http://www.w3.org/1999/xlink","xlink:show",c);break;case"xlinkTitle":Dn(t,"http://www.w3.org/1999/xlink","xlink:title",c);break;case"xlinkType":Dn(t,"http://www.w3.org/1999/xlink","xlink:type",c);break;case"xmlBase":Dn(t,"http://www.w3.org/XML/1998/namespace","xml:base",c);break;case"xmlLang":Dn(t,"http://www.w3.org/XML/1998/namespace","xml:lang",c);break;case"xmlSpace":Dn(t,"http://www.w3.org/XML/1998/namespace","xml:space",c);break;case"is":xl(t,"is",c);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=hw.get(l)||l,xl(t,l,c))}}function $f(t,s,l,c,h,p){switch(l){case"style":gp(t,c,p);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(r(61));if(l=c.__html,l!=null){if(h.children!=null)throw Error(r(60));t.innerHTML=l}}break;case"children":typeof c=="string"?Ms(t,c):(typeof c=="number"||typeof c=="bigint")&&Ms(t,""+c);break;case"onScroll":c!=null&&be("scroll",t);break;case"onScrollEnd":c!=null&&be("scrollend",t);break;case"onClick":c!=null&&(t.onclick=zn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!ap.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(h=l.endsWith("Capture"),s=l.slice(2,h?l.length-7:void 0),p=t[Lt]||null,p=p!=null?p[l]:null,typeof p=="function"&&t.removeEventListener(s,p,h),typeof c=="function")){typeof p!="function"&&p!==null&&(l in t?t[l]=null:t.hasAttribute(l)&&t.removeAttribute(l)),t.addEventListener(s,c,h);break e}l in t?t[l]=c:c===!0?t.setAttribute(l,""):xl(t,l,c)}}}function xt(t,s,l){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":be("error",t),be("load",t);var c=!1,h=!1,p;for(p in l)if(l.hasOwnProperty(p)){var v=l[p];if(v!=null)switch(p){case"src":c=!0;break;case"srcSet":h=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,s));default:je(t,s,p,v,l,null)}}h&&je(t,s,"srcSet",l.srcSet,l,null),c&&je(t,s,"src",l.src,l,null);return;case"input":be("invalid",t);var T=p=v=h=null,N=null,z=null;for(c in l)if(l.hasOwnProperty(c)){var G=l[c];if(G!=null)switch(c){case"name":h=G;break;case"type":v=G;break;case"checked":N=G;break;case"defaultChecked":z=G;break;case"value":p=G;break;case"defaultValue":T=G;break;case"children":case"dangerouslySetInnerHTML":if(G!=null)throw Error(r(137,s));break;default:je(t,s,c,G,l,null)}}fp(t,p,T,N,z,v,h,!1);return;case"select":be("invalid",t),c=v=p=null;for(h in l)if(l.hasOwnProperty(h)&&(T=l[h],T!=null))switch(h){case"value":p=T;break;case"defaultValue":v=T;break;case"multiple":c=T;default:je(t,s,h,T,l,null)}s=p,l=v,t.multiple=!!c,s!=null?ks(t,!!c,s,!1):l!=null&&ks(t,!!c,l,!0);return;case"textarea":be("invalid",t),p=h=c=null;for(v in l)if(l.hasOwnProperty(v)&&(T=l[v],T!=null))switch(v){case"value":c=T;break;case"defaultValue":h=T;break;case"children":p=T;break;case"dangerouslySetInnerHTML":if(T!=null)throw Error(r(91));break;default:je(t,s,v,T,l,null)}dp(t,c,h,p);return;case"option":for(N in l)if(l.hasOwnProperty(N)&&(c=l[N],c!=null))switch(N){case"selected":t.selected=c&&typeof c!="function"&&typeof c!="symbol";break;default:je(t,s,N,c,l,null)}return;case"dialog":be("beforetoggle",t),be("toggle",t),be("cancel",t),be("close",t);break;case"iframe":case"object":be("load",t);break;case"video":case"audio":for(c=0;c<_a.length;c++)be(_a[c],t);break;case"image":be("error",t),be("load",t);break;case"details":be("toggle",t);break;case"embed":case"source":case"link":be("error",t),be("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(z in l)if(l.hasOwnProperty(z)&&(c=l[z],c!=null))switch(z){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,s));default:je(t,s,z,c,l,null)}return;default:if(eu(s)){for(G in l)l.hasOwnProperty(G)&&(c=l[G],c!==void 0&&$f(t,s,G,c,l,void 0));return}}for(T in l)l.hasOwnProperty(T)&&(c=l[T],c!=null&&je(t,s,T,c,l,null))}function B1(t,s,l,c){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var h=null,p=null,v=null,T=null,N=null,z=null,G=null;for(B in l){var F=l[B];if(l.hasOwnProperty(B)&&F!=null)switch(B){case"checked":break;case"value":break;case"defaultValue":N=F;default:c.hasOwnProperty(B)||je(t,s,B,null,c,F)}}for(var U in c){var B=c[U];if(F=l[U],c.hasOwnProperty(U)&&(B!=null||F!=null))switch(U){case"type":p=B;break;case"name":h=B;break;case"checked":z=B;break;case"defaultChecked":G=B;break;case"value":v=B;break;case"defaultValue":T=B;break;case"children":case"dangerouslySetInnerHTML":if(B!=null)throw Error(r(137,s));break;default:B!==F&&je(t,s,U,B,c,F)}}Zc(t,v,T,N,z,G,p,h);return;case"select":B=v=T=U=null;for(p in l)if(N=l[p],l.hasOwnProperty(p)&&N!=null)switch(p){case"value":break;case"multiple":B=N;default:c.hasOwnProperty(p)||je(t,s,p,null,c,N)}for(h in c)if(p=c[h],N=l[h],c.hasOwnProperty(h)&&(p!=null||N!=null))switch(h){case"value":U=p;break;case"defaultValue":T=p;break;case"multiple":v=p;default:p!==N&&je(t,s,h,p,c,N)}s=T,l=v,c=B,U!=null?ks(t,!!l,U,!1):!!c!=!!l&&(s!=null?ks(t,!!l,s,!0):ks(t,!!l,l?[]:"",!1));return;case"textarea":B=U=null;for(T in l)if(h=l[T],l.hasOwnProperty(T)&&h!=null&&!c.hasOwnProperty(T))switch(T){case"value":break;case"children":break;default:je(t,s,T,null,c,h)}for(v in c)if(h=c[v],p=l[v],c.hasOwnProperty(v)&&(h!=null||p!=null))switch(v){case"value":U=h;break;case"defaultValue":B=h;break;case"children":break;case"dangerouslySetInnerHTML":if(h!=null)throw Error(r(91));break;default:h!==p&&je(t,s,v,h,c,p)}hp(t,U,B);return;case"option":for(var ne in l)if(U=l[ne],l.hasOwnProperty(ne)&&U!=null&&!c.hasOwnProperty(ne))switch(ne){case"selected":t.selected=!1;break;default:je(t,s,ne,null,c,U)}for(N in c)if(U=c[N],B=l[N],c.hasOwnProperty(N)&&U!==B&&(U!=null||B!=null))switch(N){case"selected":t.selected=U&&typeof U!="function"&&typeof U!="symbol";break;default:je(t,s,N,U,c,B)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var oe in l)U=l[oe],l.hasOwnProperty(oe)&&U!=null&&!c.hasOwnProperty(oe)&&je(t,s,oe,null,c,U);for(z in c)if(U=c[z],B=l[z],c.hasOwnProperty(z)&&U!==B&&(U!=null||B!=null))switch(z){case"children":case"dangerouslySetInnerHTML":if(U!=null)throw Error(r(137,s));break;default:je(t,s,z,U,c,B)}return;default:if(eu(s)){for(var Le in l)U=l[Le],l.hasOwnProperty(Le)&&U!==void 0&&!c.hasOwnProperty(Le)&&$f(t,s,Le,void 0,c,U);for(G in c)U=c[G],B=l[G],!c.hasOwnProperty(G)||U===B||U===void 0&&B===void 0||$f(t,s,G,U,c,B);return}}for(var L in l)U=l[L],l.hasOwnProperty(L)&&U!=null&&!c.hasOwnProperty(L)&&je(t,s,L,null,c,U);for(F in c)U=c[F],B=l[F],!c.hasOwnProperty(F)||U===B||U==null&&B==null||je(t,s,F,U,c,B)}function my(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function q1(){if(typeof performance.getEntriesByType=="function"){for(var t=0,s=0,l=performance.getEntriesByType("resource"),c=0;c<l.length;c++){var h=l[c],p=h.transferSize,v=h.initiatorType,T=h.duration;if(p&&T&&my(v)){for(v=0,T=h.responseEnd,c+=1;c<l.length;c++){var N=l[c],z=N.startTime;if(z>T)break;var G=N.transferSize,F=N.initiatorType;G&&my(F)&&(N=N.responseEnd,v+=G*(N<T?1:(T-z)/(N-z)))}if(--c,s+=8*(p+v)/(h.duration/1e3),t++,10<t)break}}if(0<t)return s/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var If=null,Vf=null;function wo(t){return t.nodeType===9?t:t.ownerDocument}function yy(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function by(t,s){if(t===0)switch(s){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&s==="foreignObject"?0:t}function Gf(t,s){return t==="textarea"||t==="noscript"||typeof s.children=="string"||typeof s.children=="number"||typeof s.children=="bigint"||typeof s.dangerouslySetInnerHTML=="object"&&s.dangerouslySetInnerHTML!==null&&s.dangerouslySetInnerHTML.__html!=null}var Kf=null;function $1(){var t=window.event;return t&&t.type==="popstate"?t===Kf?!1:(Kf=t,!0):(Kf=null,!1)}var vy=typeof setTimeout=="function"?setTimeout:void 0,I1=typeof clearTimeout=="function"?clearTimeout:void 0,Sy=typeof Promise=="function"?Promise:void 0,V1=typeof queueMicrotask=="function"?queueMicrotask:typeof Sy<"u"?function(t){return Sy.resolve(null).then(t).catch(G1)}:vy;function G1(t){setTimeout(function(){throw t})}function Ti(t){return t==="head"}function wy(t,s){var l=s,c=0;do{var h=l.nextSibling;if(t.removeChild(l),h&&h.nodeType===8)if(l=h.data,l==="/$"||l==="/&"){if(c===0){t.removeChild(h),lr(s);return}c--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")c++;else if(l==="html")Ta(t.ownerDocument.documentElement);else if(l==="head"){l=t.ownerDocument.head,Ta(l);for(var p=l.firstChild;p;){var v=p.nextSibling,T=p.nodeName;p[Vr]||T==="SCRIPT"||T==="STYLE"||T==="LINK"&&p.rel.toLowerCase()==="stylesheet"||l.removeChild(p),p=v}}else l==="body"&&Ta(t.ownerDocument.body);l=h}while(l);lr(s)}function xy(t,s){var l=t;t=0;do{var c=l.nextSibling;if(l.nodeType===1?s?(l._stashedDisplay=l.style.display,l.style.display="none"):(l.style.display=l._stashedDisplay||"",l.getAttribute("style")===""&&l.removeAttribute("style")):l.nodeType===3&&(s?(l._stashedText=l.nodeValue,l.nodeValue=""):l.nodeValue=l._stashedText||""),c&&c.nodeType===8)if(l=c.data,l==="/$"){if(t===0)break;t--}else l!=="$"&&l!=="$?"&&l!=="$~"&&l!=="$!"||t++;l=c}while(l)}function Xf(t){var s=t.firstChild;for(s&&s.nodeType===10&&(s=s.nextSibling);s;){var l=s;switch(s=s.nextSibling,l.nodeName){case"HTML":case"HEAD":case"BODY":Xf(l),Pc(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}t.removeChild(l)}}function K1(t,s,l,c){for(;t.nodeType===1;){var h=l;if(t.nodeName.toLowerCase()!==s.toLowerCase()){if(!c&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(c){if(!t[Vr])switch(s){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(p=t.getAttribute("rel"),p==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(p!==h.rel||t.getAttribute("href")!==(h.href==null||h.href===""?null:h.href)||t.getAttribute("crossorigin")!==(h.crossOrigin==null?null:h.crossOrigin)||t.getAttribute("title")!==(h.title==null?null:h.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(p=t.getAttribute("src"),(p!==(h.src==null?null:h.src)||t.getAttribute("type")!==(h.type==null?null:h.type)||t.getAttribute("crossorigin")!==(h.crossOrigin==null?null:h.crossOrigin))&&p&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(s==="input"&&t.type==="hidden"){var p=h.name==null?null:""+h.name;if(h.type==="hidden"&&t.getAttribute("name")===p)return t}else return t;if(t=dn(t.nextSibling),t===null)break}return null}function X1(t,s,l){if(s==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!l||(t=dn(t.nextSibling),t===null))return null;return t}function _y(t,s){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!s||(t=dn(t.nextSibling),t===null))return null;return t}function Yf(t){return t.data==="$?"||t.data==="$~"}function Ff(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function Y1(t,s){var l=t.ownerDocument;if(t.data==="$~")t._reactRetry=s;else if(t.data!=="$?"||l.readyState!=="loading")s();else{var c=function(){s(),l.removeEventListener("DOMContentLoaded",c)};l.addEventListener("DOMContentLoaded",c),t._reactRetry=c}}function dn(t){for(;t!=null;t=t.nextSibling){var s=t.nodeType;if(s===1||s===3)break;if(s===8){if(s=t.data,s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"||s==="F!"||s==="F")break;if(s==="/$"||s==="/&")return null}}return t}var Qf=null;function Ey(t){t=t.nextSibling;for(var s=0;t;){if(t.nodeType===8){var l=t.data;if(l==="/$"||l==="/&"){if(s===0)return dn(t.nextSibling);s--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||s++}t=t.nextSibling}return null}function Ty(t){t=t.previousSibling;for(var s=0;t;){if(t.nodeType===8){var l=t.data;if(l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"){if(s===0)return t;s--}else l!=="/$"&&l!=="/&"||s++}t=t.previousSibling}return null}function Ay(t,s,l){switch(s=wo(l),t){case"html":if(t=s.documentElement,!t)throw Error(r(452));return t;case"head":if(t=s.head,!t)throw Error(r(453));return t;case"body":if(t=s.body,!t)throw Error(r(454));return t;default:throw Error(r(451))}}function Ta(t){for(var s=t.attributes;s.length;)t.removeAttributeNode(s[0]);Pc(t)}var pn=new Map,Cy=new Set;function xo(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var Zn=Z.d;Z.d={f:F1,r:Q1,D:P1,C:J1,L:Z1,m:W1,X:tx,S:ex,M:nx};function F1(){var t=Zn.f(),s=ho();return t||s}function Q1(t){var s=As(t);s!==null&&s.tag===5&&s.type==="form"?Gg(s):Zn.r(t)}var sr=typeof document>"u"?null:document;function Ny(t,s,l){var c=sr;if(c&&typeof s=="string"&&s){var h=an(s);h='link[rel="'+t+'"][href="'+h+'"]',typeof l=="string"&&(h+='[crossorigin="'+l+'"]'),Cy.has(h)||(Cy.add(h),t={rel:t,crossOrigin:l,href:s},c.querySelector(h)===null&&(s=c.createElement("link"),xt(s,"link",t),gt(s),c.head.appendChild(s)))}}function P1(t){Zn.D(t),Ny("dns-prefetch",t,null)}function J1(t,s){Zn.C(t,s),Ny("preconnect",t,s)}function Z1(t,s,l){Zn.L(t,s,l);var c=sr;if(c&&t&&s){var h='link[rel="preload"][as="'+an(s)+'"]';s==="image"&&l&&l.imageSrcSet?(h+='[imagesrcset="'+an(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(h+='[imagesizes="'+an(l.imageSizes)+'"]')):h+='[href="'+an(t)+'"]';var p=h;switch(s){case"style":p=rr(t);break;case"script":p=ar(t)}pn.has(p)||(t=y({rel:"preload",href:s==="image"&&l&&l.imageSrcSet?void 0:t,as:s},l),pn.set(p,t),c.querySelector(h)!==null||s==="style"&&c.querySelector(Aa(p))||s==="script"&&c.querySelector(Ca(p))||(s=c.createElement("link"),xt(s,"link",t),gt(s),c.head.appendChild(s)))}}function W1(t,s){Zn.m(t,s);var l=sr;if(l&&t){var c=s&&typeof s.as=="string"?s.as:"script",h='link[rel="modulepreload"][as="'+an(c)+'"][href="'+an(t)+'"]',p=h;switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":p=ar(t)}if(!pn.has(p)&&(t=y({rel:"modulepreload",href:t},s),pn.set(p,t),l.querySelector(h)===null)){switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(Ca(p)))return}c=l.createElement("link"),xt(c,"link",t),gt(c),l.head.appendChild(c)}}}function ex(t,s,l){Zn.S(t,s,l);var c=sr;if(c&&t){var h=Cs(c).hoistableStyles,p=rr(t);s=s||"default";var v=h.get(p);if(!v){var T={loading:0,preload:null};if(v=c.querySelector(Aa(p)))T.loading=5;else{t=y({rel:"stylesheet",href:t,"data-precedence":s},l),(l=pn.get(p))&&Pf(t,l);var N=v=c.createElement("link");gt(N),xt(N,"link",t),N._p=new Promise(function(z,G){N.onload=z,N.onerror=G}),N.addEventListener("load",function(){T.loading|=1}),N.addEventListener("error",function(){T.loading|=2}),T.loading|=4,_o(v,s,c)}v={type:"stylesheet",instance:v,count:1,state:T},h.set(p,v)}}}function tx(t,s){Zn.X(t,s);var l=sr;if(l&&t){var c=Cs(l).hoistableScripts,h=ar(t),p=c.get(h);p||(p=l.querySelector(Ca(h)),p||(t=y({src:t,async:!0},s),(s=pn.get(h))&&Jf(t,s),p=l.createElement("script"),gt(p),xt(p,"link",t),l.head.appendChild(p)),p={type:"script",instance:p,count:1,state:null},c.set(h,p))}}function nx(t,s){Zn.M(t,s);var l=sr;if(l&&t){var c=Cs(l).hoistableScripts,h=ar(t),p=c.get(h);p||(p=l.querySelector(Ca(h)),p||(t=y({src:t,async:!0,type:"module"},s),(s=pn.get(h))&&Jf(t,s),p=l.createElement("script"),gt(p),xt(p,"link",t),l.head.appendChild(p)),p={type:"script",instance:p,count:1,state:null},c.set(h,p))}}function ky(t,s,l,c){var h=(h=se.current)?xo(h):null;if(!h)throw Error(r(446));switch(t){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(s=rr(l.href),l=Cs(h).hoistableStyles,c=l.get(s),c||(c={type:"style",instance:null,count:0,state:null},l.set(s,c)),c):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){t=rr(l.href);var p=Cs(h).hoistableStyles,v=p.get(t);if(v||(h=h.ownerDocument||h,v={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},p.set(t,v),(p=h.querySelector(Aa(t)))&&!p._p&&(v.instance=p,v.state.loading=5),pn.has(t)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},pn.set(t,l),p||ix(h,t,l,v.state))),s&&c===null)throw Error(r(528,""));return v}if(s&&c!==null)throw Error(r(529,""));return null;case"script":return s=l.async,l=l.src,typeof l=="string"&&s&&typeof s!="function"&&typeof s!="symbol"?(s=ar(l),l=Cs(h).hoistableScripts,c=l.get(s),c||(c={type:"script",instance:null,count:0,state:null},l.set(s,c)),c):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,t))}}function rr(t){return'href="'+an(t)+'"'}function Aa(t){return'link[rel="stylesheet"]['+t+"]"}function My(t){return y({},t,{"data-precedence":t.precedence,precedence:null})}function ix(t,s,l,c){t.querySelector('link[rel="preload"][as="style"]['+s+"]")?c.loading=1:(s=t.createElement("link"),c.preload=s,s.addEventListener("load",function(){return c.loading|=1}),s.addEventListener("error",function(){return c.loading|=2}),xt(s,"link",l),gt(s),t.head.appendChild(s))}function ar(t){return'[src="'+an(t)+'"]'}function Ca(t){return"script[async]"+t}function Oy(t,s,l){if(s.count++,s.instance===null)switch(s.type){case"style":var c=t.querySelector('style[data-href~="'+an(l.href)+'"]');if(c)return s.instance=c,gt(c),c;var h=y({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return c=(t.ownerDocument||t).createElement("style"),gt(c),xt(c,"style",h),_o(c,l.precedence,t),s.instance=c;case"stylesheet":h=rr(l.href);var p=t.querySelector(Aa(h));if(p)return s.state.loading|=4,s.instance=p,gt(p),p;c=My(l),(h=pn.get(h))&&Pf(c,h),p=(t.ownerDocument||t).createElement("link"),gt(p);var v=p;return v._p=new Promise(function(T,N){v.onload=T,v.onerror=N}),xt(p,"link",c),s.state.loading|=4,_o(p,l.precedence,t),s.instance=p;case"script":return p=ar(l.src),(h=t.querySelector(Ca(p)))?(s.instance=h,gt(h),h):(c=l,(h=pn.get(p))&&(c=y({},l),Jf(c,h)),t=t.ownerDocument||t,h=t.createElement("script"),gt(h),xt(h,"link",c),t.head.appendChild(h),s.instance=h);case"void":return null;default:throw Error(r(443,s.type))}else s.type==="stylesheet"&&(s.state.loading&4)===0&&(c=s.instance,s.state.loading|=4,_o(c,l.precedence,t));return s.instance}function _o(t,s,l){for(var c=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),h=c.length?c[c.length-1]:null,p=h,v=0;v<c.length;v++){var T=c[v];if(T.dataset.precedence===s)p=T;else if(p!==h)break}p?p.parentNode.insertBefore(t,p.nextSibling):(s=l.nodeType===9?l.head:l,s.insertBefore(t,s.firstChild))}function Pf(t,s){t.crossOrigin==null&&(t.crossOrigin=s.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=s.referrerPolicy),t.title==null&&(t.title=s.title)}function Jf(t,s){t.crossOrigin==null&&(t.crossOrigin=s.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=s.referrerPolicy),t.integrity==null&&(t.integrity=s.integrity)}var Eo=null;function jy(t,s,l){if(Eo===null){var c=new Map,h=Eo=new Map;h.set(l,c)}else h=Eo,c=h.get(l),c||(c=new Map,h.set(l,c));if(c.has(t))return c;for(c.set(t,null),l=l.getElementsByTagName(t),h=0;h<l.length;h++){var p=l[h];if(!(p[Vr]||p[bt]||t==="link"&&p.getAttribute("rel")==="stylesheet")&&p.namespaceURI!=="http://www.w3.org/2000/svg"){var v=p.getAttribute(s)||"";v=t+v;var T=c.get(v);T?T.push(p):c.set(v,[p])}}return c}function Ly(t,s,l){t=t.ownerDocument||t,t.head.insertBefore(l,s==="title"?t.querySelector("head > title"):null)}function sx(t,s,l){if(l===1||s.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof s.precedence!="string"||typeof s.href!="string"||s.href==="")break;return!0;case"link":if(typeof s.rel!="string"||typeof s.href!="string"||s.href===""||s.onLoad||s.onError)break;switch(s.rel){case"stylesheet":return t=s.disabled,typeof s.precedence=="string"&&t==null;default:return!0}case"script":if(s.async&&typeof s.async!="function"&&typeof s.async!="symbol"&&!s.onLoad&&!s.onError&&s.src&&typeof s.src=="string")return!0}return!1}function Ry(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function rx(t,s,l,c){if(l.type==="stylesheet"&&(typeof c.media!="string"||matchMedia(c.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var h=rr(c.href),p=s.querySelector(Aa(h));if(p){s=p._p,s!==null&&typeof s=="object"&&typeof s.then=="function"&&(t.count++,t=To.bind(t),s.then(t,t)),l.state.loading|=4,l.instance=p,gt(p);return}p=s.ownerDocument||s,c=My(c),(h=pn.get(h))&&Pf(c,h),p=p.createElement("link"),gt(p);var v=p;v._p=new Promise(function(T,N){v.onload=T,v.onerror=N}),xt(p,"link",c),l.instance=p}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(l,s),(s=l.state.preload)&&(l.state.loading&3)===0&&(t.count++,l=To.bind(t),s.addEventListener("load",l),s.addEventListener("error",l))}}var Zf=0;function ax(t,s){return t.stylesheets&&t.count===0&&Co(t,t.stylesheets),0<t.count||0<t.imgCount?function(l){var c=setTimeout(function(){if(t.stylesheets&&Co(t,t.stylesheets),t.unsuspend){var p=t.unsuspend;t.unsuspend=null,p()}},6e4+s);0<t.imgBytes&&Zf===0&&(Zf=62500*q1());var h=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&Co(t,t.stylesheets),t.unsuspend)){var p=t.unsuspend;t.unsuspend=null,p()}},(t.imgBytes>Zf?50:800)+s);return t.unsuspend=l,function(){t.unsuspend=null,clearTimeout(c),clearTimeout(h)}}:null}function To(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Co(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Ao=null;function Co(t,s){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Ao=new Map,s.forEach(lx,t),Ao=null,To.call(t))}function lx(t,s){if(!(s.state.loading&4)){var l=Ao.get(t);if(l)var c=l.get(null);else{l=new Map,Ao.set(t,l);for(var h=t.querySelectorAll("link[data-precedence],style[data-precedence]"),p=0;p<h.length;p++){var v=h[p];(v.nodeName==="LINK"||v.getAttribute("media")!=="not all")&&(l.set(v.dataset.precedence,v),c=v)}c&&l.set(null,c)}h=s.instance,v=h.getAttribute("data-precedence"),p=l.get(v)||c,p===c&&l.set(null,h),l.set(v,h),this.count++,c=To.bind(this),h.addEventListener("load",c),h.addEventListener("error",c),p?p.parentNode.insertBefore(h,p.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(h,t.firstChild)),s.state.loading|=4}}var Na={$$typeof:H,Provider:null,Consumer:null,_currentValue:re,_currentValue2:re,_threadCount:0};function ox(t,s,l,c,h,p,v,T,N){this.tag=1,this.containerInfo=t,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Xc(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Xc(0),this.hiddenUpdates=Xc(null),this.identifierPrefix=c,this.onUncaughtError=h,this.onCaughtError=p,this.onRecoverableError=v,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=N,this.incompleteTransitions=new Map}function Dy(t,s,l,c,h,p,v,T,N,z,G,F){return t=new ox(t,s,l,v,N,z,G,F,T),s=1,p===!0&&(s|=24),p=Pt(3,null,null,s),t.current=p,p.stateNode=t,s=Mu(),s.refCount++,t.pooledCache=s,s.refCount++,p.memoizedState={element:c,isDehydrated:l,cache:s},Ru(p),t}function zy(t){return t?(t=Us,t):Us}function Uy(t,s,l,c,h,p){h=zy(h),c.context===null?c.context=h:c.pendingContext=h,c=pi(s),c.payload={element:l},p=p===void 0?null:p,p!==null&&(c.callback=p),l=gi(t,c,s),l!==null&&(Bt(l,t,s),aa(l,t,s))}function Hy(t,s){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var l=t.retryLane;t.retryLane=l!==0&&l<s?l:s}}function Wf(t,s){Hy(t,s),(t=t.alternate)&&Hy(t,s)}function By(t){if(t.tag===13||t.tag===31){var s=Ki(t,67108864);s!==null&&Bt(s,t,67108864),Wf(t,67108864)}}function qy(t){if(t.tag===13||t.tag===31){var s=tn();s=Yc(s);var l=Ki(t,s);l!==null&&Bt(l,t,s),Wf(t,s)}}var No=!0;function cx(t,s,l,c){var h=q.T;q.T=null;var p=Z.p;try{Z.p=2,eh(t,s,l,c)}finally{Z.p=p,q.T=h}}function ux(t,s,l,c){var h=q.T;q.T=null;var p=Z.p;try{Z.p=8,eh(t,s,l,c)}finally{Z.p=p,q.T=h}}function eh(t,s,l,c){if(No){var h=th(c);if(h===null)qf(t,s,c,ko,l),Iy(t,c);else if(hx(h,t,s,l,c))c.stopPropagation();else if(Iy(t,c),s&4&&-1<fx.indexOf(t)){for(;h!==null;){var p=As(h);if(p!==null)switch(p.tag){case 3:if(p=p.stateNode,p.current.memoizedState.isDehydrated){var v=qi(p.pendingLanes);if(v!==0){var T=p;for(T.pendingLanes|=2,T.entangledLanes|=2;v;){var N=1<<31-kt(v);T.entanglements[1]|=N,v&=~N}kn(p),(Ce&6)===0&&(uo=it()+500,xa(0))}}break;case 31:case 13:T=Ki(p,2),T!==null&&Bt(T,p,2),ho(),Wf(p,2)}if(p=th(c),p===null&&qf(t,s,c,ko,l),p===h)break;h=p}h!==null&&c.stopPropagation()}else qf(t,s,c,null,l)}}function th(t){return t=nu(t),nh(t)}var ko=null;function nh(t){if(ko=null,t=Ts(t),t!==null){var s=o(t);if(s===null)t=null;else{var l=s.tag;if(l===13){if(t=u(s),t!==null)return t;t=null}else if(l===31){if(t=f(s),t!==null)return t;t=null}else if(l===3){if(s.stateNode.current.memoizedState.isDehydrated)return s.tag===3?s.stateNode.containerInfo:null;t=null}else s!==t&&(t=null)}}return ko=t,null}function $y(t){switch(t){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch($c()){case yl:return 2;case bl:return 8;case xs:case vl:return 32;case _s:return 268435456;default:return 32}default:return 32}}var ih=!1,Ai=null,Ci=null,Ni=null,ka=new Map,Ma=new Map,ki=[],fx="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Iy(t,s){switch(t){case"focusin":case"focusout":Ai=null;break;case"dragenter":case"dragleave":Ci=null;break;case"mouseover":case"mouseout":Ni=null;break;case"pointerover":case"pointerout":ka.delete(s.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ma.delete(s.pointerId)}}function Oa(t,s,l,c,h,p){return t===null||t.nativeEvent!==p?(t={blockedOn:s,domEventName:l,eventSystemFlags:c,nativeEvent:p,targetContainers:[h]},s!==null&&(s=As(s),s!==null&&By(s)),t):(t.eventSystemFlags|=c,s=t.targetContainers,h!==null&&s.indexOf(h)===-1&&s.push(h),t)}function hx(t,s,l,c,h){switch(s){case"focusin":return Ai=Oa(Ai,t,s,l,c,h),!0;case"dragenter":return Ci=Oa(Ci,t,s,l,c,h),!0;case"mouseover":return Ni=Oa(Ni,t,s,l,c,h),!0;case"pointerover":var p=h.pointerId;return ka.set(p,Oa(ka.get(p)||null,t,s,l,c,h)),!0;case"gotpointercapture":return p=h.pointerId,Ma.set(p,Oa(Ma.get(p)||null,t,s,l,c,h)),!0}return!1}function Vy(t){var s=Ts(t.target);if(s!==null){var l=o(s);if(l!==null){if(s=l.tag,s===13){if(s=u(l),s!==null){t.blockedOn=s,ip(t.priority,function(){qy(l)});return}}else if(s===31){if(s=f(l),s!==null){t.blockedOn=s,ip(t.priority,function(){qy(l)});return}}else if(s===3&&l.stateNode.current.memoizedState.isDehydrated){t.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}t.blockedOn=null}function Mo(t){if(t.blockedOn!==null)return!1;for(var s=t.targetContainers;0<s.length;){var l=th(t.nativeEvent);if(l===null){l=t.nativeEvent;var c=new l.constructor(l.type,l);tu=c,l.target.dispatchEvent(c),tu=null}else return s=As(l),s!==null&&By(s),t.blockedOn=l,!1;s.shift()}return!0}function Gy(t,s,l){Mo(t)&&l.delete(s)}function dx(){ih=!1,Ai!==null&&Mo(Ai)&&(Ai=null),Ci!==null&&Mo(Ci)&&(Ci=null),Ni!==null&&Mo(Ni)&&(Ni=null),ka.forEach(Gy),Ma.forEach(Gy)}function Oo(t,s){t.blockedOn===s&&(t.blockedOn=null,ih||(ih=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,dx)))}var jo=null;function Ky(t){jo!==t&&(jo=t,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){jo===t&&(jo=null);for(var s=0;s<t.length;s+=3){var l=t[s],c=t[s+1],h=t[s+2];if(typeof c!="function"){if(nh(c||l)===null)continue;break}var p=As(l);p!==null&&(t.splice(s,3),s-=3,ef(p,{pending:!0,data:h,method:l.method,action:c},c,h))}}))}function lr(t){function s(N){return Oo(N,t)}Ai!==null&&Oo(Ai,t),Ci!==null&&Oo(Ci,t),Ni!==null&&Oo(Ni,t),ka.forEach(s),Ma.forEach(s);for(var l=0;l<ki.length;l++){var c=ki[l];c.blockedOn===t&&(c.blockedOn=null)}for(;0<ki.length&&(l=ki[0],l.blockedOn===null);)Vy(l),l.blockedOn===null&&ki.shift();if(l=(t.ownerDocument||t).$$reactFormReplay,l!=null)for(c=0;c<l.length;c+=3){var h=l[c],p=l[c+1],v=h[Lt]||null;if(typeof p=="function")v||Ky(l);else if(v){var T=null;if(p&&p.hasAttribute("formAction")){if(h=p,v=p[Lt]||null)T=v.formAction;else if(nh(h)!==null)continue}else T=v.action;typeof T=="function"?l[c+1]=T:(l.splice(c,3),c-=3),Ky(l)}}}function Xy(){function t(p){p.canIntercept&&p.info==="react-transition"&&p.intercept({handler:function(){return new Promise(function(v){return h=v})},focusReset:"manual",scroll:"manual"})}function s(){h!==null&&(h(),h=null),c||setTimeout(l,20)}function l(){if(!c&&!navigation.transition){var p=navigation.currentEntry;p&&p.url!=null&&navigation.navigate(p.url,{state:p.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var c=!1,h=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",s),navigation.addEventListener("navigateerror",s),setTimeout(l,100),function(){c=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",s),navigation.removeEventListener("navigateerror",s),h!==null&&(h(),h=null)}}}function sh(t){this._internalRoot=t}Lo.prototype.render=sh.prototype.render=function(t){var s=this._internalRoot;if(s===null)throw Error(r(409));var l=s.current,c=tn();Uy(l,c,t,s,null,null)},Lo.prototype.unmount=sh.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var s=t.containerInfo;Uy(t.current,2,null,t,null,null),ho(),s[Es]=null}};function Lo(t){this._internalRoot=t}Lo.prototype.unstable_scheduleHydration=function(t){if(t){var s=np();t={blockedOn:null,target:t,priority:s};for(var l=0;l<ki.length&&s!==0&&s<ki[l].priority;l++);ki.splice(l,0,t),l===0&&Vy(t)}};var Yy=e.version;if(Yy!=="19.2.1")throw Error(r(527,Yy,"19.2.1"));Z.findDOMNode=function(t){var s=t._reactInternals;if(s===void 0)throw typeof t.render=="function"?Error(r(188)):(t=Object.keys(t).join(","),Error(r(268,t)));return t=g(s),t=t!==null?m(t):null,t=t===null?null:t.stateNode,t};var px={bundleType:0,version:"19.2.1",rendererPackageName:"react-dom",currentDispatcherRef:q,reconcilerVersion:"19.2.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ro=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ro.isDisabled&&Ro.supportsFiber)try{Bi=Ro.inject(px),ft=Ro}catch{}}return La.createRoot=function(t,s){if(!a(t))throw Error(r(299));var l=!1,c="",h=em,p=tm,v=nm;return s!=null&&(s.unstable_strictMode===!0&&(l=!0),s.identifierPrefix!==void 0&&(c=s.identifierPrefix),s.onUncaughtError!==void 0&&(h=s.onUncaughtError),s.onCaughtError!==void 0&&(p=s.onCaughtError),s.onRecoverableError!==void 0&&(v=s.onRecoverableError)),s=Dy(t,1,!1,null,null,l,c,null,h,p,v,Xy),t[Es]=s.current,Bf(t),new sh(s)},La.hydrateRoot=function(t,s,l){if(!a(t))throw Error(r(299));var c=!1,h="",p=em,v=tm,T=nm,N=null;return l!=null&&(l.unstable_strictMode===!0&&(c=!0),l.identifierPrefix!==void 0&&(h=l.identifierPrefix),l.onUncaughtError!==void 0&&(p=l.onUncaughtError),l.onCaughtError!==void 0&&(v=l.onCaughtError),l.onRecoverableError!==void 0&&(T=l.onRecoverableError),l.formState!==void 0&&(N=l.formState)),s=Dy(t,1,!0,s,l??null,c,h,N,p,v,T,Xy),s.context=zy(null),l=s.current,c=tn(),c=Yc(c),h=pi(c),h.callback=null,gi(l,h,c),l=c,s.current.lanes=l,Ir(s,l),kn(s),t[Es]=s.current,Bf(t),new Lo(s)},La.version="19.2.1",La}var rb;function Lx(){if(rb)return lh.exports;rb=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}return n(),lh.exports=jx(),lh.exports}var I2=Lx();const Rx=new Map([["Android.devices",{internal:!0}],["AndroidSocket.write",{internal:!0}],["AndroidSocket.close",{internal:!0}],["AndroidDevice.wait",{title:"Wait"}],["AndroidDevice.fill",{title:'Fill "{text}"'}],["AndroidDevice.tap",{title:"Tap"}],["AndroidDevice.drag",{title:"Drag"}],["AndroidDevice.fling",{title:"Fling"}],["AndroidDevice.longTap",{title:"Long tap"}],["AndroidDevice.pinchClose",{title:"Pinch close"}],["AndroidDevice.pinchOpen",{title:"Pinch open"}],["AndroidDevice.scroll",{title:"Scroll"}],["AndroidDevice.swipe",{title:"Swipe"}],["AndroidDevice.info",{internal:!0}],["AndroidDevice.screenshot",{title:"Screenshot"}],["AndroidDevice.inputType",{title:"Type"}],["AndroidDevice.inputPress",{title:"Press"}],["AndroidDevice.inputTap",{title:"Tap"}],["AndroidDevice.inputSwipe",{title:"Swipe"}],["AndroidDevice.inputDrag",{title:"Drag"}],["AndroidDevice.launchBrowser",{title:"Launch browser"}],["AndroidDevice.open",{title:"Open app"}],["AndroidDevice.shell",{title:"Execute shell command",group:"configuration"}],["AndroidDevice.installApk",{title:"Install apk"}],["AndroidDevice.push",{title:"Push"}],["AndroidDevice.connectToWebView",{title:"Connect to Web View"}],["AndroidDevice.close",{internal:!0}],["APIRequestContext.fetch",{title:'{method} "{url}"'}],["APIRequestContext.fetchResponseBody",{title:"Get response body",group:"getter"}],["APIRequestContext.fetchLog",{internal:!0}],["APIRequestContext.storageState",{title:"Get storage state",group:"configuration"}],["APIRequestContext.disposeAPIResponse",{internal:!0}],["APIRequestContext.dispose",{internal:!0,potentiallyClosesScope:!0}],["Artifact.pathAfterFinished",{internal:!0}],["Artifact.saveAs",{internal:!0}],["Artifact.saveAsStream",{internal:!0}],["Artifact.failure",{internal:!0}],["Artifact.stream",{internal:!0}],["Artifact.cancel",{internal:!0}],["Artifact.delete",{internal:!0,potentiallyClosesScope:!0}],["Stream.read",{internal:!0}],["Stream.close",{internal:!0}],["WritableStream.write",{internal:!0}],["WritableStream.close",{internal:!0}],["Browser.startServer",{title:"Start server"}],["Browser.stopServer",{title:"Stop server"}],["Browser.close",{title:"Close browser",pause:!0,potentiallyClosesScope:!0}],["Browser.killForTests",{internal:!0,potentiallyClosesScope:!0}],["Browser.defaultUserAgentForTest",{internal:!0}],["Browser.newContext",{title:"Create context"}],["Browser.newContextForReuse",{internal:!0}],["Browser.disconnectFromReusedContext",{internal:!0}],["Browser.newBrowserCDPSession",{title:"Create CDP session",group:"configuration"}],["Browser.startTracing",{title:"Start browser tracing",group:"configuration"}],["Browser.stopTracing",{title:"Stop browser tracing",group:"configuration"}],["BrowserContext.addCookies",{title:"Add cookies",group:"configuration"}],["BrowserContext.addInitScript",{title:"Add init script",group:"configuration"}],["BrowserContext.clearCookies",{title:"Clear cookies",group:"configuration"}],["BrowserContext.clearPermissions",{title:"Clear permissions",group:"configuration"}],["BrowserContext.close",{title:"Close context",pause:!0,potentiallyClosesScope:!0}],["BrowserContext.cookies",{title:"Get cookies",group:"getter"}],["BrowserContext.exposeBinding",{title:"Expose binding",group:"configuration"}],["BrowserContext.grantPermissions",{title:"Grant permissions",group:"configuration"}],["BrowserContext.newPage",{title:"Create page"}],["BrowserContext.registerSelectorEngine",{internal:!0}],["BrowserContext.setTestIdAttributeName",{internal:!0}],["BrowserContext.setExtraHTTPHeaders",{title:"Set extra HTTP headers",group:"configuration"}],["BrowserContext.setGeolocation",{title:"Set geolocation",group:"configuration"}],["BrowserContext.setHTTPCredentials",{title:"Set HTTP credentials",group:"configuration"}],["BrowserContext.setNetworkInterceptionPatterns",{title:"Route requests",group:"route"}],["BrowserContext.setWebSocketInterceptionPatterns",{title:"Route WebSockets",group:"route"}],["BrowserContext.setOffline",{title:"Set offline mode"}],["BrowserContext.storageState",{title:"Get storage state",group:"configuration"}],["BrowserContext.setStorageState",{title:"Set storage state",group:"configuration"}],["BrowserContext.pause",{title:"Pause"}],["BrowserContext.enableRecorder",{internal:!0}],["BrowserContext.disableRecorder",{internal:!0}],["BrowserContext.exposeConsoleApi",{internal:!0}],["BrowserContext.newCDPSession",{title:"Create CDP session",group:"configuration"}],["BrowserContext.createTempFiles",{internal:!0}],["BrowserContext.updateSubscription",{internal:!0}],["BrowserContext.clockFastForward",{title:'Fast forward clock "{ticksNumber|ticksString}"'}],["BrowserContext.clockInstall",{title:'Install clock "{timeNumber|timeString}"'}],["BrowserContext.clockPauseAt",{title:'Pause clock "{timeNumber|timeString}"'}],["BrowserContext.clockResume",{title:"Resume clock"}],["BrowserContext.clockRunFor",{title:'Run clock "{ticksNumber|ticksString}"'}],["BrowserContext.clockSetFixedTime",{title:'Set fixed time "{timeNumber|timeString}"'}],["BrowserContext.clockSetSystemTime",{title:'Set system time "{timeNumber|timeString}"'}],["BrowserContext.credentialsInstall",{title:"Install virtual WebAuthn authenticator",group:"configuration"}],["BrowserContext.credentialsCreate",{title:'Create virtual credential for "{rpId}"',group:"configuration"}],["BrowserContext.credentialsGet",{title:"Get virtual credentials",group:"configuration"}],["BrowserContext.credentialsDelete",{title:"Delete virtual credential",group:"configuration"}],["BrowserType.launch",{title:"Launch browser"}],["BrowserType.launchPersistentContext",{title:"Launch persistent context"}],["BrowserType.connectOverCDP",{title:"Connect over CDP"}],["BrowserType.connectToWorker",{title:"Connect to worker"}],["Disposable.dispose",{internal:!0,potentiallyClosesScope:!0}],["Electron.launch",{title:"Launch electron"}],["ElectronApplication.browserWindow",{internal:!0}],["ElectronApplication.evaluateExpression",{title:"Evaluate"}],["ElectronApplication.evaluateExpressionHandle",{title:"Evaluate"}],["ElectronApplication.updateSubscription",{internal:!0}],["Frame.evalOnSelector",{title:"Evaluate",snapshot:!0,pause:!0}],["Frame.evalOnSelectorAll",{title:"Evaluate",snapshot:!0,pause:!0}],["Frame.addScriptTag",{title:"Add script tag",snapshot:!0,pause:!0}],["Frame.addStyleTag",{title:"Add style tag",snapshot:!0,pause:!0}],["Frame.ariaSnapshot",{title:"Aria snapshot",group:"getter"}],["Frame.blur",{title:"Blur",slowMo:!0,snapshot:!0,pause:!0}],["Frame.check",{title:"Check",slowMo:!0,snapshot:!0,pause:!0,input:!0,isAutoWaiting:!0}],["Frame.click",{title:"Click",slowMo:!0,snapshot:!0,pause:!0,input:!0,isAutoWaiting:!0,potentiallyClosesScope:!0}],["Frame.content",{title:"Get content",snapshot:!0,pause:!0}],["Frame.dragAndDrop",{title:"Drag and drop",slowMo:!0,snapshot:!0,pause:!0,input:!0,isAutoWaiting:!0}],["Frame.drop",{title:"Drop files or data onto an element",slowMo:!0,snapshot:!0,pause:!0,input:!0,isAutoWaiting:!0}],["Frame.dblclick",{title:"Double click",slowMo:!0,snapshot:!0,pause:!0,input:!0,isAutoWaiting:!0}],["Frame.dispatchEvent",{title:'Dispatch "{type}"',slowMo:!0,snapshot:!0,pause:!0}],["Frame.evaluateExpression",{title:"Evaluate",snapshot:!0,pause:!0}],["Frame.evaluateExpressionHandle",{title:"Evaluate",snapshot:!0,pause:!0}],["Frame.fill",{title:'Fill "{value}"',slowMo:!0,snapshot:!0,pause:!0,input:!0,isAutoWaiting:!0}],["Frame.focus",{title:"Focus",slowMo:!0,snapshot:!0,pause:!0}],["Frame.frameElement",{title:"Get frame element",group:"getter"}],["Frame.resolveSelector",{internal:!0}],["Frame.highlight",{internal:!0}],["Frame.hideHighlight",{internal:!0}],["Frame.getAttribute",{title:'Get attribute "{name}"',snapshot:!0,pause:!0,group:"getter"}],["Frame.goto",{title:'Navigate to "{url}"',slowMo:!0,snapshot:!0,pause:!0}],["Frame.hover",{title:"Hover",slowMo:!0,snapshot:!0,pause:!0,input:!0,isAutoWaiting:!0}],["Frame.innerHTML",{title:"Get HTML",snapshot:!0,pause:!0,group:"getter"}],["Frame.innerText",{title:"Get inner text",snapshot:!0,pause:!0,group:"getter"}],["Frame.inputValue",{title:"Get input value",snapshot:!0,pause:!0,group:"getter"}],["Frame.isChecked",{title:"Is checked",snapshot:!0,pause:!0,group:"getter"}],["Frame.isDisabled",{title:"Is disabled",snapshot:!0,pause:!0,group:"getter"}],["Frame.isEnabled",{title:"Is enabled",snapshot:!0,pause:!0,group:"getter"}],["Frame.isHidden",{title:"Is hidden",snapshot:!0,pause:!0,group:"getter"}],["Frame.isVisible",{title:"Is visible",snapshot:!0,pause:!0,group:"getter"}],["Frame.isEditable",{title:"Is editable",snapshot:!0,pause:!0,group:"getter"}],["Frame.press",{title:'Press "{key}"',slowMo:!0,snapshot:!0,pause:!0,input:!0,isAutoWaiting:!0}],["Frame.querySelector",{title:"Query selector",snapshot:!0}],["Frame.querySelectorAll",{title:"Query selector all",snapshot:!0}],["Frame.queryCount",{title:"Query count",snapshot:!0,pause:!0}],["Frame.selectOption",{title:"Select option",slowMo:!0,snapshot:!0,pause:!0,input:!0,isAutoWaiting:!0}],["Frame.setContent",{title:"Set content",snapshot:!0,pause:!0}],["Frame.setInputFiles",{title:"Set input files",slowMo:!0,snapshot:!0,pause:!0,input:!0,isAutoWaiting:!0}],["Frame.tap",{title:"Tap",slowMo:!0,snapshot:!0,pause:!0,input:!0,isAutoWaiting:!0}],["Frame.textContent",{title:"Get text content",snapshot:!0,pause:!0,group:"getter"}],["Frame.title",{title:"Get page title",group:"getter"}],["Frame.type",{title:'Type "{text}"',slowMo:!0,snapshot:!0,pause:!0,input:!0,isAutoWaiting:!0}],["Frame.uncheck",{title:"Uncheck",slowMo:!0,snapshot:!0,pause:!0,input:!0,isAutoWaiting:!0}],["Frame.waitForTimeout",{title:"Wait for timeout",snapshot:!0}],["Frame.waitForFunction",{title:"Wait for function",snapshot:!0,pause:!0}],["Frame.waitForSelector",{title:"Wait for selector",snapshot:!0}],["Frame.expect",{title:'Expect "{expression}"',snapshot:!0,pause:!0}],["JSHandle.dispose",{internal:!0,potentiallyClosesScope:!0}],["ElementHandle.dispose",{internal:!0,potentiallyClosesScope:!0}],["JSHandle.evaluateExpression",{title:"Evaluate",snapshot:!0,pause:!0}],["ElementHandle.evaluateExpression",{title:"Evaluate",snapshot:!0,pause:!0}],["JSHandle.evaluateExpressionHandle",{title:"Evaluate",snapshot:!0,pause:!0}],["ElementHandle.evaluateExpressionHandle",{title:"Evaluate",snapshot:!0,pause:!0}],["JSHandle.getPropertyList",{title:"Get property list",group:"getter"}],["ElementHandle.getPropertyList",{title:"Get property list",group:"getter"}],["JSHandle.getProperty",{title:"Get JS property",group:"getter"}],["ElementHandle.getProperty",{title:"Get JS property",group:"getter"}],["JSHandle.jsonValue",{title:"Get JSON value",group:"getter"}],["ElementHandle.jsonValue",{title:"Get JSON value",group:"getter"}],["ElementHandle.evalOnSelector",{title:"Evaluate",snapshot:!0,pause:!0}],["ElementHandle.evalOnSelectorAll",{title:"Evaluate",snapshot:!0,pause:!0}],["ElementHandle.boundingBox",{title:"Get bounding box",snapshot:!0,pause:!0}],["ElementHandle.check",{title:"Check",slowMo:!0,snapshot:!0,pause:!0,input:!0,isAutoWaiting:!0}],["ElementHandle.click",{title:"Click",slowMo:!0,snapshot:!0,pause:!0,input:!0,isAutoWaiting:!0}],["ElementHandle.contentFrame",{title:"Get content frame",group:"getter"}],["ElementHandle.dblclick",{title:"Double click",slowMo:!0,snapshot:!0,pause:!0,input:!0,isAutoWaiting:!0}],["ElementHandle.dispatchEvent",{title:"Dispatch event",slowMo:!0,snapshot:!0,pause:!0}],["ElementHandle.fill",{title:'Fill "{value}"',slowMo:!0,snapshot:!0,pause:!0,input:!0,isAutoWaiting:!0}],["ElementHandle.focus",{title:"Focus",slowMo:!0,snapshot:!0,pause:!0}],["ElementHandle.getAttribute",{title:"Get attribute",snapshot:!0,pause:!0,group:"getter"}],["ElementHandle.hover",{title:"Hover",slowMo:!0,snapshot:!0,pause:!0,input:!0,isAutoWaiting:!0}],["ElementHandle.innerHTML",{title:"Get HTML",snapshot:!0,pause:!0,group:"getter"}],["ElementHandle.innerText",{title:"Get inner text",snapshot:!0,pause:!0,group:"getter"}],["ElementHandle.inputValue",{title:"Get input value",snapshot:!0,pause:!0,group:"getter"}],["ElementHandle.isChecked",{title:"Is checked",snapshot:!0,pause:!0,group:"getter"}],["ElementHandle.isDisabled",{title:"Is disabled",snapshot:!0,pause:!0,group:"getter"}],["ElementHandle.isEditable",{title:"Is editable",snapshot:!0,pause:!0,group:"getter"}],["ElementHandle.isEnabled",{title:"Is enabled",snapshot:!0,pause:!0,group:"getter"}],["ElementHandle.isHidden",{title:"Is hidden",snapshot:!0,pause:!0,group:"getter"}],["ElementHandle.isVisible",{title:"Is visible",snapshot:!0,pause:!0,group:"getter"}],["ElementHandle.ownerFrame",{title:"Get owner frame",group:"getter"}],["ElementHandle.press",{title:'Press "{key}"',slowMo:!0,snapshot:!0,pause:!0,input:!0,isAutoWaiting:!0}],["ElementHandle.querySelector",{title:"Query selector",snapshot:!0}],["ElementHandle.querySelectorAll",{title:"Query selector all",snapshot:!0}],["ElementHandle.screenshot",{title:"Screenshot",snapshot:!0,pause:!0}],["ElementHandle.scrollIntoViewIfNeeded",{title:"Scroll into view",slowMo:!0,snapshot:!0,pause:!0}],["ElementHandle.selectOption",{title:"Select option",slowMo:!0,snapshot:!0,pause:!0,input:!0,isAutoWaiting:!0}],["ElementHandle.selectText",{title:"Select text",slowMo:!0,snapshot:!0,pause:!0}],["ElementHandle.setInputFiles",{title:"Set input files",slowMo:!0,snapshot:!0,pause:!0,input:!0,isAutoWaiting:!0}],["ElementHandle.tap",{title:"Tap",slowMo:!0,snapshot:!0,pause:!0,input:!0,isAutoWaiting:!0}],["ElementHandle.textContent",{title:"Get text content",snapshot:!0,pause:!0,group:"getter"}],["ElementHandle.type",{title:"Type",slowMo:!0,snapshot:!0,pause:!0,input:!0,isAutoWaiting:!0}],["ElementHandle.uncheck",{title:"Uncheck",slowMo:!0,snapshot:!0,pause:!0,input:!0,isAutoWaiting:!0}],["ElementHandle.waitForElementState",{title:"Wait for state",snapshot:!0,pause:!0}],["ElementHandle.waitForSelector",{title:"Wait for selector",snapshot:!0}],["LocalUtils.zip",{internal:!0}],["LocalUtils.harOpen",{internal:!0}],["LocalUtils.harLookup",{internal:!0}],["LocalUtils.harClose",{internal:!0}],["LocalUtils.harUnzip",{internal:!0}],["LocalUtils.connect",{internal:!0}],["LocalUtils.tracingStarted",{internal:!0}],["LocalUtils.addStackToTracingNoReply",{internal:!0}],["LocalUtils.traceDiscarded",{internal:!0}],["LocalUtils.globToRegex",{internal:!0}],["Request.response",{internal:!0}],["Request.rawRequestHeaders",{internal:!0}],["Route.redirectNavigationRequest",{internal:!0}],["Route.abort",{title:"Abort request",group:"route"}],["Route.continue",{title:"Continue request",group:"route"}],["Route.fulfill",{title:"Fulfill request",group:"route"}],["WebSocketRoute.connect",{title:"Connect WebSocket to server",group:"route"}],["WebSocketRoute.ensureOpened",{internal:!0}],["WebSocketRoute.sendToPage",{title:"Send WebSocket message",group:"route"}],["WebSocketRoute.sendToServer",{title:"Send WebSocket message",group:"route"}],["WebSocketRoute.closePage",{internal:!0}],["WebSocketRoute.closeServer",{internal:!0}],["Response.body",{title:"Get response body",group:"getter"}],["Response.securityDetails",{internal:!0}],["Response.serverAddr",{internal:!0}],["Response.rawResponseHeaders",{internal:!0}],["Response.httpVersion",{internal:!0}],["Response.sizes",{internal:!0}],["Page.addInitScript",{title:"Add init script",group:"configuration"}],["Page.close",{title:"Close page",pause:!0,potentiallyClosesScope:!0}],["Page.runBeforeUnload",{title:"Run beforeunload",pause:!0}],["Page.clearConsoleMessages",{title:"Clear console messages"}],["Page.consoleMessages",{title:"Get console messages",group:"getter"}],["Page.emulateMedia",{title:"Emulate media",snapshot:!0,pause:!0}],["Page.exposeBinding",{title:"Expose binding",group:"configuration"}],["Page.goBack",{title:"Go back",slowMo:!0,snapshot:!0,pause:!0}],["Page.goForward",{title:"Go forward",slowMo:!0,snapshot:!0,pause:!0}],["Page.requestGC",{title:"Request garbage collection",group:"configuration"}],["Page.registerLocatorHandler",{title:"Register locator handler"}],["Page.resolveLocatorHandlerNoReply",{internal:!0}],["Page.unregisterLocatorHandler",{title:"Unregister locator handler"}],["Page.reload",{title:"Reload",slowMo:!0,snapshot:!0,pause:!0}],["Page.expectScreenshot",{title:"Expect screenshot",snapshot:!0,pause:!0}],["Page.screenshot",{title:"Screenshot",snapshot:!0,pause:!0}],["Page.setExtraHTTPHeaders",{title:"Set extra HTTP headers",group:"configuration"}],["Page.setNetworkInterceptionPatterns",{title:"Route requests",group:"route"}],["Page.setWebSocketInterceptionPatterns",{title:"Route WebSockets",group:"route"}],["Page.setViewportSize",{title:"Set viewport size",snapshot:!0,pause:!0}],["Page.keyboardDown",{title:'Key down "{key}"',slowMo:!0,snapshot:!0,pause:!0,input:!0}],["Page.keyboardUp",{title:'Key up "{key}"',slowMo:!0,snapshot:!0,pause:!0,input:!0}],["Page.keyboardInsertText",{title:'Insert "{text}"',slowMo:!0,snapshot:!0,pause:!0,input:!0}],["Page.keyboardType",{title:'Type "{text}"',slowMo:!0,snapshot:!0,pause:!0,input:!0}],["Page.keyboardPress",{title:'Press "{key}"',slowMo:!0,snapshot:!0,pause:!0,input:!0}],["Page.mouseMove",{title:"Mouse move",slowMo:!0,snapshot:!0,pause:!0,input:!0}],["Page.mouseDown",{title:"Mouse down",slowMo:!0,snapshot:!0,pause:!0,input:!0}],["Page.mouseUp",{title:"Mouse up",slowMo:!0,snapshot:!0,pause:!0,input:!0}],["Page.mouseClick",{title:"Click",slowMo:!0,snapshot:!0,pause:!0,input:!0}],["Page.mouseWheel",{title:"Mouse wheel",slowMo:!0,snapshot:!0,pause:!0,input:!0}],["Page.touchscreenTap",{title:"Tap",slowMo:!0,snapshot:!0,pause:!0,input:!0}],["Page.clearPageErrors",{title:"Clear page errors"}],["Page.pageErrors",{title:"Get page errors",group:"getter"}],["Page.pdf",{title:"PDF"}],["Page.requests",{title:"Get network requests",group:"getter"}],["Page.startJSCoverage",{title:"Start JS coverage",group:"configuration"}],["Page.stopJSCoverage",{title:"Stop JS coverage",group:"configuration"}],["Page.startCSSCoverage",{title:"Start CSS coverage",group:"configuration"}],["Page.stopCSSCoverage",{title:"Stop CSS coverage",group:"configuration"}],["Page.bringToFront",{title:"Bring to front"}],["Page.pickLocator",{title:"Pick locator",group:"configuration"}],["Page.cancelPickLocator",{title:"Cancel pick locator",group:"configuration"}],["Page.hideHighlight",{title:"Hide all element highlights",group:"configuration"}],["Page.screencastShowOverlay",{title:"Show overlay",group:"configuration"}],["Page.screencastRemoveOverlay",{title:"Remove overlay",group:"configuration"}],["Page.screencastChapter",{title:"Show chapter overlay",group:"configuration"}],["Page.screencastSetOverlayVisible",{title:"Set overlay visibility",group:"configuration"}],["Page.screencastShowActions",{title:"Show actions",group:"configuration"}],["Page.screencastHideActions",{title:"Remove actions",group:"configuration"}],["Page.screencastStart",{title:"Start screencast",group:"configuration"}],["Page.screencastStop",{title:"Stop screencast",group:"configuration"}],["Page.updateSubscription",{internal:!0}],["Page.setDockTile",{internal:!0}],["Page.webStorageItems",{title:"Get WebStorage items",group:"getter"}],["Page.webStorageGetItem",{title:"Get WebStorage item",group:"getter"}],["Page.webStorageSetItem",{title:"Set WebStorage item",group:"configuration"}],["Page.webStorageRemoveItem",{title:"Remove WebStorage item",group:"configuration"}],["Page.webStorageClear",{title:"Clear WebStorage",group:"configuration"}],["Root.initialize",{internal:!0}],["Playwright.newRequest",{title:"Create request context"}],["DebugController.initialize",{internal:!0}],["DebugController.setReportStateChanged",{internal:!0}],["DebugController.setRecorderMode",{internal:!0}],["DebugController.highlight",{internal:!0}],["DebugController.hideHighlight",{internal:!0}],["DebugController.resume",{internal:!0}],["DebugController.kill",{internal:!0}],["SocksSupport.socksConnected",{internal:!0}],["SocksSupport.socksFailed",{internal:!0}],["SocksSupport.socksData",{internal:!0}],["SocksSupport.socksError",{internal:!0}],["SocksSupport.socksEnd",{internal:!0}],["JsonPipe.send",{internal:!0}],["JsonPipe.close",{internal:!0}],["CDPSession.send",{title:"Send CDP command",group:"configuration"}],["CDPSession.detach",{title:"Detach CDP session",potentiallyClosesScope:!0,group:"configuration"}],["BindingCall.reject",{internal:!0}],["BindingCall.resolve",{internal:!0}],["Debugger.requestPause",{title:"Pause on next call",group:"configuration"}],["Debugger.resume",{title:"Resume",group:"configuration"}],["Debugger.next",{title:"Step to next call",group:"configuration"}],["Debugger.runTo",{title:"Run to location",group:"configuration"}],["Dialog.accept",{title:"Accept dialog"}],["Dialog.dismiss",{title:"Dismiss dialog"}],["Tracing.tracingStart",{title:"Start tracing",group:"configuration"}],["Tracing.tracingStartChunk",{title:"Start tracing",group:"configuration"}],["Tracing.tracingGroup",{title:'Trace "{name}"'}],["Tracing.tracingGroupEnd",{title:"Group end"}],["Tracing.tracingStopChunk",{title:"Stop tracing",group:"configuration"}],["Tracing.tracingStop",{title:"Stop tracing",group:"configuration"}],["Tracing.harStart",{internal:!0}],["Tracing.harExport",{internal:!0}],["Worker.disconnect",{title:"Disconnect from worker",potentiallyClosesScope:!0}],["Worker.evaluateExpression",{title:"Evaluate"}],["Worker.evaluateExpressionHandle",{title:"Evaluate"}],["Worker.updateSubscription",{internal:!0}]]);function id(n){return Rx.get(n.type+"."+n.method)}function g0(n,e){var i;return(i=Dx(n,e))==null?void 0:i.replaceAll(`
`,"\\n")}function Dx(n,e){if(n)for(const i of e.split("|")){if(i==="url")try{const a=new URL(n[i]);return a.protocol==="data:"?a.protocol:["about:","chrome:","edge:"].includes(a.protocol)?n[i]:a.pathname+a.search}catch{if(n[i]!==void 0)return n[i]}if(i==="timeNumber"&&n[i]!==void 0)return new Date(n[i]).toString();const r=zx(n,i);if(r!==void 0)return r}}function zx(n,e){const i=e.split(".");let r=n;for(const a of i){if(typeof r!="object"||r===null)return;r=r[a]}if(r!==void 0)return String(r)}function Ux(n){var i;return(n.title??((i=id(n))==null?void 0:i.title)??n.method).replace(/\{([^}]+)\}/g,(r,a)=>g0(n.params,a)??r)}function Hx(n){var e;return(e=id(n))==null?void 0:e.group}const Ia=Symbol("context"),m0=Symbol("nextInContext"),y0=Symbol("prevByEndTime"),b0=Symbol("nextByStartTime"),ab=Symbol("events");class V2{constructor(e,i){var a,o;i.forEach(u=>Bx(u));const r=i.find(u=>u.origin==="library");this.traceUri=e,this.browserName=(r==null?void 0:r.browserName)||"",this.sdkLanguage=r==null?void 0:r.sdkLanguage,this.channel=r==null?void 0:r.channel,this.testIdAttributeName=r==null?void 0:r.testIdAttributeName,this.platform=(r==null?void 0:r.platform)||"",this.playwrightVersion=(a=i.find(u=>u.playwrightVersion))==null?void 0:a.playwrightVersion,this.title=(r==null?void 0:r.title)||"",this.options=(r==null?void 0:r.options)||{},this.testTimeout=(o=i.find(u=>u.origin==="testRunner"))==null?void 0:o.testTimeout,this.actions=qx(i),this.pages=[].concat(...i.map(u=>u.pages)),this.wallTime=i.map(u=>u.wallTime).reduce((u,f)=>Math.min(u||Number.MAX_VALUE,f),Number.MAX_VALUE),this.startTime=i.map(u=>u.startTime).reduce((u,f)=>Math.min(u,f),Number.MAX_VALUE),this.endTime=i.map(u=>u.endTime).reduce((u,f)=>Math.max(u,f),Number.MIN_VALUE),this.events=[].concat(...i.map(u=>u.events)),this.stdio=[].concat(...i.map(u=>u.stdio)),this.errors=[].concat(...i.map(u=>u.errors)),this.hasSource=i.some(u=>u.hasSource),this.hasStepData=i.some(u=>u.origin==="testRunner"),this.resources=[...i.map(u=>u.resources)].flat().map(u=>({...u,id:`${u.pageref}-${u.startedDateTime}-${u.request.url}`})),this.attachments=this.actions.flatMap(u=>{var f;return((f=u.attachments)==null?void 0:f.map(d=>({...d,callId:u.callId,traceUri:e})))??[]}),this.visibleAttachments=this.attachments.filter(u=>!u.name.startsWith("_")),this.events.sort((u,f)=>u.time-f.time),this.resources.sort((u,f)=>u._monotonicTime-f._monotonicTime),this.errorDescriptors=this.hasStepData?this._errorDescriptorsFromTestRunner():this._errorDescriptorsFromActions(),this.sources=Yx(this.actions,this.errorDescriptors),this.actionCounters=new Map;for(const u of this.actions)u.group=u.group??Hx({type:u.class,method:u.method}),u.group&&this.actionCounters.set(u.group,1+(this.actionCounters.get(u.group)||0))}createRelativeUrl(e){const i=new URL("http://localhost/"+e);return i.searchParams.set("trace",this.traceUri),i.toString().substring(17)}failedAction(){return this.actions.findLast(e=>e.error)}filteredActions(e){const i=new Set(e);return this.actions.filter(r=>!r.group||i.has(r.group))}renderActionTree(e){const i=this.filteredActions(e??[]),{rootItem:r}=v0(i),a=[],o=(u,f)=>{const d=Ux({...u.action,type:u.action.class});a.push(`${f}${d||u.id}`);for(const g of u.children)o(g,f+"  ")};return r.children.forEach(u=>o(u,"")),a}_errorDescriptorsFromActions(){var i;const e=[];for(const r of this.actions||[])(i=r.error)!=null&&i.message&&e.push({action:r,stack:r.stack,message:r.error.message});return e}_errorDescriptorsFromTestRunner(){return this.errors.filter(e=>!!e.message).map((e,i)=>({stack:e.stack,message:e.message}))}}function Bx(n){for(const i of n.pages)i[Ia]=n;for(let i=0;i<n.actions.length;++i){const r=n.actions[i];r[Ia]=n}let e;for(let i=n.actions.length-1;i>=0;i--){const r=n.actions[i];r[m0]=e,r.class!=="Route"&&(e=r)}for(const i of n.events)i[Ia]=n;for(const i of n.resources)i[Ia]=n}function qx(n){const e=[],i=$x(n);e.push(...i),e.sort((r,a)=>a.parentId===r.callId?1:r.parentId===a.callId?-1:r.endTime-a.endTime);for(let r=1;r<e.length;++r)e[r][y0]=e[r-1];e.sort((r,a)=>a.parentId===r.callId?-1:r.parentId===a.callId?1:r.startTime-a.startTime);for(let r=0;r+1<e.length;++r)e[r][b0]=e[r+1];return e}let lb=0;function $x(n){const e=new Map,i=n.filter(u=>u.origin==="library"),r=n.filter(u=>u.origin==="testRunner");if(!r.length||!i.length)return n.map(u=>u.actions.map(f=>({...f,context:u}))).flat();for(const u of i)for(const f of u.actions)e.set(f.stepId||`tmp-step@${++lb}`,{...f,context:u});const a=Vx(r,e);a&&Ix(i,a);const o=new Map;for(const u of r)for(const f of u.actions){const d=f.stepId&&e.get(f.stepId);if(d){o.set(f.callId,d.callId),f.error&&(d.error=f.error),f.attachments&&(d.attachments=f.attachments),f.annotations&&(d.annotations=f.annotations),f.parentId&&(d.parentId=o.get(f.parentId)??f.parentId),f.group&&(d.group=f.group),d.startTime=f.startTime,d.endTime=f.endTime;continue}f.parentId&&(f.parentId=o.get(f.parentId)??f.parentId),e.set(f.stepId||`tmp-step@${++lb}`,{...f,context:u})}return[...e.values()]}function Ix(n,e){for(const i of n){i.startTime+=e,i.endTime+=e;for(const r of i.actions)r.startTime&&(r.startTime+=e),r.endTime&&(r.endTime+=e);for(const r of i.events)r.time+=e;for(const r of i.stdio)r.timestamp+=e;for(const r of i.pages)for(const a of r.screencastFrames)a.timestamp+=e;for(const r of i.resources)r._monotonicTime&&(r._monotonicTime+=e)}}function Vx(n,e){for(const i of n)for(const r of i.actions){if(!r.startTime)continue;const a=r.stepId?e.get(r.stepId):void 0;if(a)return r.startTime-a.startTime}return 0}function v0(n){const e=new Map;for(const a of n)e.set(a.callId,{id:a.callId,parent:void 0,children:[],action:a});const i={action:{...Fx},id:"",parent:void 0,children:[]};for(const a of e.values()){i.action.startTime=Math.min(i.action.startTime,a.action.startTime),i.action.endTime=Math.max(i.action.endTime,a.action.endTime);const o=a.action.parentId&&e.get(a.action.parentId)||i;o.children.push(a),a.parent=o}const r=a=>{for(const o of a.children)o.action.stack=o.action.stack??a.action.stack,r(o)};return r(i),{rootItem:i,itemMap:e}}function S0(n){return n[Ia]}function Gx(n){return n[m0]}function ob(n){return n[y0]}function cb(n){return n[b0]}function Kx(n){let e=0,i=0;for(const r of Xx(n)){if(r.type==="console"){const a=r.messageType;a==="warning"?++i:a==="error"&&++e}r.type==="event"&&r.method==="pageError"&&++e}return{errors:e,warnings:i}}function Xx(n){let e=n[ab];if(e)return e;const i=Gx(n);return e=S0(n).events.filter(r=>r.time>=n.startTime&&(!i||r.time<i.startTime)),n[ab]=e,e}function Yx(n,e){var r;const i=new Map;for(const a of n)for(const o of a.stack||[]){let u=i.get(o.file);u||(u={errors:[],content:void 0},i.set(o.file,u))}for(const a of e){const{action:o,stack:u,message:f}=a;!o||!u||(r=i.get(u[0].file))==null||r.errors.push({line:u[0].line||0,message:f})}return i}const Fx={type:"action",callId:"",startTime:0,endTime:0,class:"",method:"",params:{},log:[],context:{origin:"library",startTime:0,endTime:0,browserName:"",wallTime:0,options:{},pages:[],resources:[],actions:[],events:[],stdio:[],errors:[],hasSource:!1,contextId:""}},Qx=50,il=({sidebarSize:n,sidebarHidden:e=!1,sidebarIsFirst:i=!1,orientation:r="vertical",minSidebarSize:a=Qx,settingName:o,sidebar:u,main:f})=>{const d=Math.max(a,n)*window.devicePixelRatio,[g,m]=jt(o?o+"."+r+":size":void 0,d),[y,S]=jt(o?o+"."+r+":size":void 0,d),[w,E]=R.useState(null),[x,_]=gs();let A;r==="vertical"?(A=y/window.devicePixelRatio,x&&x.height<A&&(A=x.height-10)):(A=g/window.devicePixelRatio,x&&x.width<A&&(A=x.width-10)),document.body.style.userSelect=w?"none":"inherit";let C={};return r==="vertical"?i?C={top:w?0:A-4,bottom:w?0:void 0,height:w?"initial":8}:C={bottom:w?0:A-4,top:w?0:void 0,height:w?"initial":8}:i?C={left:w?0:A-4,right:w?0:void 0,width:w?"initial":8}:C={right:w?0:A-4,left:w?0:void 0,width:w?"initial":8},b.jsxs("div",{className:ut("split-view",r,i&&"sidebar-first"),ref:_,children:[b.jsx("div",{className:"split-view-main",children:f}),!e&&b.jsx("div",{style:{flexBasis:A},className:"split-view-sidebar",children:u}),!e&&b.jsx("div",{style:C,className:"split-view-resizer",onMouseDown:H=>E({offset:r==="vertical"?H.clientY:H.clientX,size:A}),onMouseUp:()=>E(null),onMouseMove:H=>{if(!H.buttons)E(null);else if(w){const K=(r==="vertical"?H.clientY:H.clientX)-w.offset,Q=i?w.size+K:w.size-K,I=H.target.parentElement.getBoundingClientRect(),O=Math.min(Math.max(a,Q),(r==="vertical"?I.height:I.width)-a);r==="vertical"?S(O*window.devicePixelRatio):m(O*window.devicePixelRatio)}}})]})};function yt(n){if(n<0||!isFinite(n))return"-";if(n===0)return"0ms";if(n<1e3)return n.toFixed(0)+"ms";const e=n/1e3;if(e<60)return e.toFixed(1)+"s";const i=e/60;if(i<60)return i.toFixed(1)+"m";const r=i/60;return r<24?r.toFixed(1)+"h":(r/24).toFixed(1)+"d"}function bc(n){if(n<0||!isFinite(n))return"-";if(n===0)return"0";if(n<1e3)return n.toFixed(0);const e=n/1024;if(e<1e3)return e.toFixed(1)+"K";const i=e/1024;return i<1e3?i.toFixed(1)+"M":(i/1024).toFixed(1)+"G"}const ot=function(n,e,i){return n>=e&&n<=i};function qt(n){return ot(n,48,57)}function ub(n){return qt(n)||ot(n,65,70)||ot(n,97,102)}function Px(n){return ot(n,65,90)}function Jx(n){return ot(n,97,122)}function Zx(n){return Px(n)||Jx(n)}function Wx(n){return n>=128}function Xo(n){return Zx(n)||Wx(n)||n===95}function fb(n){return Xo(n)||qt(n)||n===45}function e_(n){return ot(n,0,8)||n===11||ot(n,14,31)||n===127}function Yo(n){return n===10}function Wn(n){return Yo(n)||n===9||n===32}const t_=1114111;class sd extends Error{constructor(e){super(e),this.name="InvalidCharacterError"}}function n_(n){const e=[];for(let i=0;i<n.length;i++){let r=n.charCodeAt(i);if(r===13&&n.charCodeAt(i+1)===10&&(r=10,i++),(r===13||r===12)&&(r=10),r===0&&(r=65533),ot(r,55296,56319)&&ot(n.charCodeAt(i+1),56320,57343)){const a=r-55296,o=n.charCodeAt(i+1)-56320;r=Math.pow(2,16)+a*Math.pow(2,10)+o,i++}e.push(r)}return e}function dt(n){if(n<=65535)return String.fromCharCode(n);n-=Math.pow(2,16);const e=Math.floor(n/Math.pow(2,10))+55296,i=n%Math.pow(2,10)+56320;return String.fromCharCode(e)+String.fromCharCode(i)}function w0(n){const e=n_(n);let i=-1;const r=[];let a;const o=function($){return $>=e.length?-1:e[$]},u=function($){if($===void 0&&($=1),$>3)throw"Spec Error: no more than three codepoints of lookahead.";return o(i+$)},f=function($){return $===void 0&&($=1),i+=$,a=o(i),!0},d=function(){return i-=1,!0},g=function($){return $===void 0&&($=a),$===-1},m=function(){if(y(),f(),Wn(a)){for(;Wn(u());)f();return new rc}else{if(a===34)return E();if(a===35)if(fb(u())||A(u(1),u(2))){const $=new R0("");return H(u(1),u(2),u(3))&&($.type="id"),$.value=j(),$}else return new _t(a);else return a===36?u()===61?(f(),new a_):new _t(a):a===39?E():a===40?new O0:a===41?new rd:a===42?u()===61?(f(),new l_):new _t(a):a===43?Q()?(d(),S()):new _t(a):a===44?new C0:a===45?Q()?(d(),S()):u(1)===45&&u(2)===62?(f(2),new E0):V()?(d(),w()):new _t(a):a===46?Q()?(d(),S()):new _t(a):a===58?new T0:a===59?new A0:a===60?u(1)===33&&u(2)===45&&u(3)===45?(f(3),new _0):new _t(a):a===64?H(u(1),u(2),u(3))?new L0(j()):new _t(a):a===91?new M0:a===92?C()?(d(),w()):new _t(a):a===93?new Lh:a===94?u()===61?(f(),new r_):new _t(a):a===123?new N0:a===124?u()===61?(f(),new s_):u()===124?(f(),new j0):new _t(a):a===125?new k0:a===126?u()===61?(f(),new i_):new _t(a):qt(a)?(d(),S()):Xo(a)?(d(),w()):g()?new Qo:new _t(a)}},y=function(){for(;u(1)===47&&u(2)===42;)for(f(2);;)if(f(),a===42&&u()===47){f();break}else if(g())return},S=function(){const $=I();if(H(u(1),u(2),u(3))){const ee=new o_;return ee.value=$.value,ee.repr=$.repr,ee.type=$.type,ee.unit=j(),ee}else if(u()===37){f();const ee=new U0;return ee.value=$.value,ee.repr=$.repr,ee}else{const ee=new z0;return ee.value=$.value,ee.repr=$.repr,ee.type=$.type,ee}},w=function(){const $=j();if($.toLowerCase()==="url"&&u()===40){for(f();Wn(u(1))&&Wn(u(2));)f();return u()===34||u()===39?new Fa($):Wn(u())&&(u(2)===34||u(2)===39)?new Fa($):x()}else return u()===40?(f(),new Fa($)):new ad($)},E=function($){$===void 0&&($=a);let ee="";for(;f();){if(a===$||g())return new ld(ee);if(Yo(a))return d(),new x0;a===92?g(u())||(Yo(u())?f():ee+=dt(_())):ee+=dt(a)}throw new Error("Internal error")},x=function(){const $=new D0("");for(;Wn(u());)f();if(g(u()))return $;for(;f();){if(a===41||g())return $;if(Wn(a)){for(;Wn(u());)f();return u()===41||g(u())?(f(),$):(P(),new Fo)}else{if(a===34||a===39||a===40||e_(a))return P(),new Fo;if(a===92)if(C())$.value+=dt(_());else return P(),new Fo;else $.value+=dt(a)}}throw new Error("Internal error")},_=function(){if(f(),ub(a)){const $=[a];for(let ce=0;ce<5&&ub(u());ce++)f(),$.push(a);Wn(u())&&f();let ee=parseInt($.map(function(ce){return String.fromCharCode(ce)}).join(""),16);return ee>t_&&(ee=65533),ee}else return g()?65533:a},A=function($,ee){return!($!==92||Yo(ee))},C=function(){return A(a,u())},H=function($,ee,ce){return $===45?Xo(ee)||ee===45||A(ee,ce):Xo($)?!0:$===92?A($,ee):!1},V=function(){return H(a,u(1),u(2))},K=function($,ee,ce){return $===43||$===45?!!(qt(ee)||ee===46&&qt(ce)):$===46?!!qt(ee):!!qt($)},Q=function(){return K(a,u(1),u(2))},j=function(){let $="";for(;f();)if(fb(a))$+=dt(a);else if(C())$+=dt(_());else return d(),$;throw new Error("Internal parse error")},I=function(){let $="",ee="integer";for((u()===43||u()===45)&&(f(),$+=dt(a));qt(u());)f(),$+=dt(a);if(u(1)===46&&qt(u(2)))for(f(),$+=dt(a),f(),$+=dt(a),ee="number";qt(u());)f(),$+=dt(a);const ce=u(1),Me=u(2),q=u(3);if((ce===69||ce===101)&&qt(Me))for(f(),$+=dt(a),f(),$+=dt(a),ee="number";qt(u());)f(),$+=dt(a);else if((ce===69||ce===101)&&(Me===43||Me===45)&&qt(q))for(f(),$+=dt(a),f(),$+=dt(a),f(),$+=dt(a),ee="number";qt(u());)f(),$+=dt(a);const Z=O($);return{type:ee,value:Z,repr:$}},O=function($){return+$},P=function(){for(;f();){if(a===41||g())return;C()&&_()}};let J=0;for(;!g(u());)if(r.push(m()),J++,J>e.length*2)throw new Error("I'm infinite-looping!");return r}class tt{constructor(){this.tokenType=""}toJSON(){return{token:this.tokenType}}toString(){return this.tokenType}toSource(){return""+this}}class x0 extends tt{constructor(){super(...arguments),this.tokenType="BADSTRING"}}class Fo extends tt{constructor(){super(...arguments),this.tokenType="BADURL"}}class rc extends tt{constructor(){super(...arguments),this.tokenType="WHITESPACE"}toString(){return"WS"}toSource(){return" "}}class _0 extends tt{constructor(){super(...arguments),this.tokenType="CDO"}toSource(){return"<!--"}}class E0 extends tt{constructor(){super(...arguments),this.tokenType="CDC"}toSource(){return"-->"}}class T0 extends tt{constructor(){super(...arguments),this.tokenType=":"}}class A0 extends tt{constructor(){super(...arguments),this.tokenType=";"}}class C0 extends tt{constructor(){super(...arguments),this.tokenType=","}}class Mr extends tt{constructor(){super(...arguments),this.value="",this.mirror=""}}class N0 extends Mr{constructor(){super(),this.tokenType="{",this.value="{",this.mirror="}"}}class k0 extends Mr{constructor(){super(),this.tokenType="}",this.value="}",this.mirror="{"}}class M0 extends Mr{constructor(){super(),this.tokenType="[",this.value="[",this.mirror="]"}}class Lh extends Mr{constructor(){super(),this.tokenType="]",this.value="]",this.mirror="["}}class O0 extends Mr{constructor(){super(),this.tokenType="(",this.value="(",this.mirror=")"}}class rd extends Mr{constructor(){super(),this.tokenType=")",this.value=")",this.mirror="("}}class i_ extends tt{constructor(){super(...arguments),this.tokenType="~="}}class s_ extends tt{constructor(){super(...arguments),this.tokenType="|="}}class r_ extends tt{constructor(){super(...arguments),this.tokenType="^="}}class a_ extends tt{constructor(){super(...arguments),this.tokenType="$="}}class l_ extends tt{constructor(){super(...arguments),this.tokenType="*="}}class j0 extends tt{constructor(){super(...arguments),this.tokenType="||"}}class Qo extends tt{constructor(){super(...arguments),this.tokenType="EOF"}toSource(){return""}}class _t extends tt{constructor(e){super(),this.tokenType="DELIM",this.value="",this.value=dt(e)}toString(){return"DELIM("+this.value+")"}toJSON(){const e=this.constructor.prototype.constructor.prototype.toJSON.call(this);return e.value=this.value,e}toSource(){return this.value==="\\"?`\\
`:this.value}}class Or extends tt{constructor(){super(...arguments),this.value=""}ASCIIMatch(e){return this.value.toLowerCase()===e.toLowerCase()}toJSON(){const e=this.constructor.prototype.constructor.prototype.toJSON.call(this);return e.value=this.value,e}}class ad extends Or{constructor(e){super(),this.tokenType="IDENT",this.value=e}toString(){return"IDENT("+this.value+")"}toSource(){return ul(this.value)}}class Fa extends Or{constructor(e){super(),this.tokenType="FUNCTION",this.value=e,this.mirror=")"}toString(){return"FUNCTION("+this.value+")"}toSource(){return ul(this.value)+"("}}class L0 extends Or{constructor(e){super(),this.tokenType="AT-KEYWORD",this.value=e}toString(){return"AT("+this.value+")"}toSource(){return"@"+ul(this.value)}}class R0 extends Or{constructor(e){super(),this.tokenType="HASH",this.value=e,this.type="unrestricted"}toString(){return"HASH("+this.value+")"}toJSON(){const e=this.constructor.prototype.constructor.prototype.toJSON.call(this);return e.value=this.value,e.type=this.type,e}toSource(){return this.type==="id"?"#"+ul(this.value):"#"+c_(this.value)}}class ld extends Or{constructor(e){super(),this.tokenType="STRING",this.value=e}toString(){return'"'+H0(this.value)+'"'}}class D0 extends Or{constructor(e){super(),this.tokenType="URL",this.value=e}toString(){return"URL("+this.value+")"}toSource(){return'url("'+H0(this.value)+'")'}}class z0 extends tt{constructor(){super(),this.tokenType="NUMBER",this.type="integer",this.repr=""}toString(){return this.type==="integer"?"INT("+this.value+")":"NUMBER("+this.value+")"}toJSON(){const e=super.toJSON();return e.value=this.value,e.type=this.type,e.repr=this.repr,e}toSource(){return this.repr}}class U0 extends tt{constructor(){super(),this.tokenType="PERCENTAGE",this.repr=""}toString(){return"PERCENTAGE("+this.value+")"}toJSON(){const e=this.constructor.prototype.constructor.prototype.toJSON.call(this);return e.value=this.value,e.repr=this.repr,e}toSource(){return this.repr+"%"}}class o_ extends tt{constructor(){super(),this.tokenType="DIMENSION",this.type="integer",this.repr="",this.unit=""}toString(){return"DIM("+this.value+","+this.unit+")"}toJSON(){const e=this.constructor.prototype.constructor.prototype.toJSON.call(this);return e.value=this.value,e.type=this.type,e.repr=this.repr,e.unit=this.unit,e}toSource(){const e=this.repr;let i=ul(this.unit);return i[0].toLowerCase()==="e"&&(i[1]==="-"||ot(i.charCodeAt(1),48,57))&&(i="\\65 "+i.slice(1,i.length)),e+i}}function ul(n){n=""+n;let e="";const i=n.charCodeAt(0);for(let r=0;r<n.length;r++){const a=n.charCodeAt(r);if(a===0)throw new sd("Invalid character: the input contains U+0000.");ot(a,1,31)||a===127||r===0&&ot(a,48,57)||r===1&&ot(a,48,57)&&i===45?e+="\\"+a.toString(16)+" ":a>=128||a===45||a===95||ot(a,48,57)||ot(a,65,90)||ot(a,97,122)?e+=n[r]:e+="\\"+n[r]}return e}function c_(n){n=""+n;let e="";for(let i=0;i<n.length;i++){const r=n.charCodeAt(i);if(r===0)throw new sd("Invalid character: the input contains U+0000.");r>=128||r===45||r===95||ot(r,48,57)||ot(r,65,90)||ot(r,97,122)?e+=n[i]:e+="\\"+r.toString(16)+" "}return e}function H0(n){n=""+n;let e="";for(let i=0;i<n.length;i++){const r=n.charCodeAt(i);if(r===0)throw new sd("Invalid character: the input contains U+0000.");ot(r,1,31)||r===127?e+="\\"+r.toString(16)+" ":r===34||r===92?e+="\\"+n[i]:e+=n[i]}return e}class $t extends Error{}function u_(n,e){let i;try{i=w0(n),i[i.length-1]instanceof Qo||i.push(new Qo)}catch(O){const P=O.message+` while parsing css selector "${n}". Did you mean to CSS.escape it?`,J=(O.stack||"").indexOf(O.message);throw J!==-1&&(O.stack=O.stack.substring(0,J)+P+O.stack.substring(J+O.message.length)),O.message=P,O}const r=i.find(O=>O instanceof L0||O instanceof x0||O instanceof Fo||O instanceof j0||O instanceof _0||O instanceof E0||O instanceof A0||O instanceof N0||O instanceof k0||O instanceof D0||O instanceof U0);if(r)throw new $t(`Unsupported token "${r.toSource()}" while parsing css selector "${n}". Did you mean to CSS.escape it?`);let a=0;const o=new Set;function u(){return new $t(`Unexpected token "${i[a].toSource()}" while parsing css selector "${n}". Did you mean to CSS.escape it?`)}function f(){for(;i[a]instanceof rc;)a++}function d(O=a){return i[O]instanceof ad}function g(O=a){return i[O]instanceof ld}function m(O=a){return i[O]instanceof z0}function y(O=a){return i[O]instanceof C0}function S(O=a){return i[O]instanceof O0}function w(O=a){return i[O]instanceof rd}function E(O=a){return i[O]instanceof Fa}function x(O=a){return i[O]instanceof _t&&i[O].value==="*"}function _(O=a){return i[O]instanceof Qo}function A(O=a){return i[O]instanceof _t&&[">","+","~"].includes(i[O].value)}function C(O=a){return y(O)||w(O)||_(O)||A(O)||i[O]instanceof rc}function H(){const O=[V()];for(;f(),!!y();)a++,O.push(V());return O}function V(){return f(),m()||g()?i[a++].value:K()}function K(){const O={simples:[]};for(f(),A()?O.simples.push({selector:{functions:[{name:"scope",args:[]}]},combinator:""}):O.simples.push({selector:Q(),combinator:""});;){if(f(),A())O.simples[O.simples.length-1].combinator=i[a++].value,f();else if(C())break;O.simples.push({combinator:"",selector:Q()})}return O}function Q(){let O="";const P=[];for(;!C();)if(d()||x())O+=i[a++].toSource();else if(i[a]instanceof R0)O+=i[a++].toSource();else if(i[a]instanceof _t&&i[a].value===".")if(a++,d())O+="."+i[a++].toSource();else throw u();else if(i[a]instanceof T0)if(a++,d())if(!e.has(i[a].value.toLowerCase()))O+=":"+i[a++].toSource();else{const J=i[a++].value.toLowerCase();P.push({name:J,args:[]}),o.add(J)}else if(E()){const J=i[a++].value.toLowerCase();if(e.has(J)?(P.push({name:J,args:H()}),o.add(J)):O+=`:${J}(${j()})`,f(),!w())throw u();a++}else throw u();else if(i[a]instanceof M0){for(O+="[",a++;!(i[a]instanceof Lh)&&!_();)O+=i[a++].toSource();if(!(i[a]instanceof Lh))throw u();O+="]",a++}else throw u();if(!O&&!P.length)throw u();return{css:O||void 0,functions:P}}function j(){let O="",P=1;for(;!_()&&((S()||E())&&P++,w()&&P--,!!P);)O+=i[a++].toSource();return O}const I=H();if(!_())throw u();if(I.some(O=>typeof O!="object"||!("simples"in O)))throw new $t(`Error while parsing css selector "${n}". Did you mean to CSS.escape it?`);return{selector:I,names:Array.from(o)}}const Rh=new Set(["internal:has","internal:has-not","internal:and","internal:or","internal:chain","left-of","right-of","above","below","near"]),f_=new Set(["left-of","right-of","above","below","near"]),B0=new Set(["not","is","where","has","scope","light","visible","text","text-matches","text-is","has-text","above","below","right-of","left-of","near","nth-match"]);function fl(n){const e=p_(n),i=[];for(const r of e.parts){if(r.name==="css"||r.name==="css:light"){r.name==="css:light"&&(r.body=":light("+r.body+")");const a=u_(r.body,B0);i.push({name:"css",body:a.selector,source:r.body});continue}if(Rh.has(r.name)){let a,o;try{const g=JSON.parse("["+r.body+"]");if(!Array.isArray(g)||g.length<1||g.length>2||typeof g[0]!="string")throw new $t(`Malformed selector: ${r.name}=`+r.body);if(a=g[0],g.length===2){if(typeof g[1]!="number"||!f_.has(r.name))throw new $t(`Malformed selector: ${r.name}=`+r.body);o=g[1]}}catch{throw new $t(`Malformed selector: ${r.name}=`+r.body)}const u={name:r.name,source:r.body,body:{parsed:fl(a),distance:o}},f=[...u.body.parsed.parts].reverse().find(g=>g.name==="internal:control"&&g.body==="enter-frame"),d=f?u.body.parsed.parts.indexOf(f):-1;d!==-1&&h_(u.body.parsed.parts.slice(0,d+1),i.slice(0,d+1))&&u.body.parsed.parts.splice(0,d+1),i.push(u);continue}i.push({...r,source:r.body})}if(Rh.has(i[0].name))throw new $t(`"${i[0].name}" selector cannot be first`);return{capture:e.capture,parts:i}}function h_(n,e){return It({parts:n})===It({parts:e})}function It(n,e){return typeof n=="string"?n:n.parts.map((i,r)=>{let a=!0;!e&&r!==n.capture&&(i.name==="css"||i.name==="xpath"&&i.source.startsWith("//")||i.source.startsWith(".."))&&(a=!1);const o=a?i.name+"=":"";return`${r===n.capture?"*":""}${o}${i.source}`}).join(" >> ")}function d_(n,e){const i=(r,a)=>{for(const o of r.parts)e(o,a),Rh.has(o.name)&&i(o.body.parsed,!0)};i(n,!1)}function p_(n){let e=0,i,r=0;const a={parts:[]},o=()=>{const f=n.substring(r,e).trim(),d=f.indexOf("=");let g,m;d!==-1&&f.substring(0,d).trim().match(/^[a-zA-Z_0-9-+:*]+$/)?(g=f.substring(0,d).trim(),m=f.substring(d+1)):f.length>1&&f[0]==='"'&&f[f.length-1]==='"'||f.length>1&&f[0]==="'"&&f[f.length-1]==="'"?(g="text",m=f):/^\(*\/\//.test(f)||f.startsWith("..")?(g="xpath",m=f):(g="css",m=f);let y=!1;if(g[0]==="*"&&(y=!0,g=g.substring(1)),a.parts.push({name:g,body:m}),y){if(a.capture!==void 0)throw new $t("Only one of the selectors can capture using * modifier");a.capture=a.parts.length-1}};if(!n.includes(">>"))return e=n.length,o(),a;const u=()=>{const d=n.substring(r,e).match(/^\s*text\s*=(.*)$/);return!!d&&!!d[1]};for(;e<n.length;){const f=n[e];f==="\\"&&e+1<n.length?e+=2:f===i?(i=void 0,e++):!i&&(f==='"'||f==="'"||f==="`")&&!u()?(i=f,e++):!i&&f===">"&&n[e+1]===">"?(o(),e+=2,r=e):e++}return o(),a}function Er(n,e){let i=0,r=n.length===0;const a=()=>n[i]||"",o=()=>{const _=a();return++i,r=i>=n.length,_},u=_=>{throw r?new $t(`Unexpected end of selector while parsing selector \`${n}\``):new $t(`Error while parsing selector \`${n}\` - unexpected symbol "${a()}" at position ${i}`+(_?" during "+_:""))};function f(){for(;!r&&/\s/.test(a());)o()}function d(_){return _>="Â€"||_>="0"&&_<="9"||_>="A"&&_<="Z"||_>="a"&&_<="z"||_>="0"&&_<="9"||_==="_"||_==="-"}function g(){let _="";for(f();!r&&d(a());)_+=o();return _}function m(_){let A=o();for(A!==_&&u("parsing quoted string");!r&&a()!==_;)a()==="\\"&&o(),A+=o();return a()!==_&&u("parsing quoted string"),A+=o(),A}function y(){o()!=="/"&&u("parsing regular expression");let _="",A=!1;for(;!r;){if(a()==="\\")_+=o(),r&&u("parsing regular expression");else if(A&&a()==="]")A=!1;else if(!A&&a()==="[")A=!0;else if(!A&&a()==="/")break;_+=o()}o()!=="/"&&u("parsing regular expression");let C="";for(;!r&&a().match(/[dgimsuy]/);)C+=o();try{return new RegExp(_,C)}catch(H){throw new $t(`Error while parsing selector \`${n}\`: ${H.message}`)}}function S(){let _="";return f(),a()==="'"||a()==='"'?_=m(a()).slice(1,-1):_=g(),_||u("parsing property path"),_}function w(){f();let _="";return r||(_+=o()),!r&&_!=="="&&(_+=o()),["=","*=","^=","$=","|=","~="].includes(_)||u("parsing operator"),_}function E(){o();const _=[];for(_.push(S()),f();a()===".";)o(),_.push(S()),f();if(a()==="]")return o(),{name:_.join("."),jsonPath:_,op:"<truthy>",value:null,caseSensitive:!1};const A=w();let C,H=!0;if(f(),a()==="/"){if(A!=="=")throw new $t(`Error while parsing selector \`${n}\` - cannot use ${A} in attribute with regular expression`);C=y()}else if(a()==="'"||a()==='"')C=m(a()).slice(1,-1),f(),a()==="i"||a()==="I"?(H=!1,o()):(a()==="s"||a()==="S")&&(H=!0,o());else{for(C="";!r&&(d(a())||a()==="+"||a()===".");)C+=o();C==="true"?C=!0:C==="false"&&(C=!1)}if(f(),a()!=="]"&&u("parsing attribute value"),o(),A!=="="&&typeof C!="string")throw new $t(`Error while parsing selector \`${n}\` - cannot use ${A} in attribute with non-string matching value - ${C}`);return{name:_.join("."),jsonPath:_,op:A,value:C,caseSensitive:H}}const x={name:"",attributes:[]};for(x.name=g(),f();a()==="[";)x.attributes.push(E()),f();if(r||u(void 0),!x.name&&!x.attributes.length)throw new $t(`Error while parsing selector \`${n}\` - selector cannot be empty`);return x}function vc(n,e="'"){const i=JSON.stringify(n),r=i.substring(1,i.length-1).replace(/\\"/g,'"');if(e==="'")return e+r.replace(/[']/g,"\\'")+e;if(e==='"')return e+r.replace(/["]/g,'\\"')+e;if(e==="`")return e+r.replace(/[`]/g,"\\`")+e;throw new Error("Invalid escape char")}function ac(n){return n.charAt(0).toUpperCase()+n.substring(1)}function q0(n){return n.replace(/([a-z0-9])([A-Z])/g,"$1_$2").replace(/([A-Z])([A-Z][a-z])/g,"$1_$2").toLowerCase()}function gr(n){return`"${n.replace(/["\\]/g,e=>"\\"+e)}"`}let ss;function g_(){ss=new Map}function pt(n){let e=ss==null?void 0:ss.get(n);return e===void 0&&(e=n.replace(/[\u200b\u00ad]/g,"").trim().replace(/\s+/g," "),ss==null||ss.set(n,e)),e}function Sc(n){return n.replace(/(^|[^\\])(\\\\)*\\(['"`])/g,"$1$2$3")}function $0(n){return n.unicode||n.unicodeSets?String(n):String(n).replace(/(^|[^\\])(\\\\)*(["'`])/g,"$1$2\\$3").replace(/>>/g,"\\>\\>")}function Vt(n,e){return typeof n!="string"?$0(n):`${JSON.stringify(n)}${e?"s":"i"}`}function Ze(n,e){return typeof n!="string"?$0(n):`"${n.replace(/\\/g,"\\\\").replace(/["]/g,'\\"')}"${e?"s":"i"}`}function m_(n,e,i=""){if(n.length<=e)return n;const r=[...n];return r.length>e?r.slice(0,e-i.length).join("")+i:r.join("")}function hb(n,e){return m_(n,e,"â€¦")}function lc(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function y_(n,e){const i=n.length,r=e.length;let a=0,o=0;const u=Array(i+1).fill(null).map(()=>Array(r+1).fill(0));for(let f=1;f<=i;f++)for(let d=1;d<=r;d++)n[f-1]===e[d-1]&&(u[f][d]=u[f-1][d-1]+1,u[f][d]>a&&(a=u[f][d],o=f));return n.slice(o-a,o)}function I0(n,e){try{const i=fl(e),r=b_(i);return r||os(new G0[n],i,!1,1)[0]}catch{return e}}function b_(n){const e=n.parts[n.parts.length-1];if((e==null?void 0:e.name)==="internal:describe"){const i=JSON.parse(e.body);if(typeof i=="string")return i}}function Ri(n,e,i=!1){return V0(n,e,i,1)[0]}function V0(n,e,i=!1,r=20,a){try{return os(new G0[n](a),fl(e),i,r)}catch{return[e]}}function os(n,e,i=!1,r=20){const a=[...e.parts],o=[];let u=i?"frame-locator":"page";for(let f=0;f<a.length;f++){const d=a[f],g=u;if(u="locator",d.name==="internal:describe")continue;if(d.name==="nth"){d.body==="0"?o.push([n.generateLocator(g,"first",""),n.generateLocator(g,"nth","0")]):d.body==="-1"?o.push([n.generateLocator(g,"last",""),n.generateLocator(g,"nth","-1")]):o.push([n.generateLocator(g,"nth",d.body)]);continue}if(d.name==="visible"){o.push([n.generateLocator(g,"visible",d.body),n.generateLocator(g,"default",`visible=${d.body}`)]);continue}if(d.name==="internal:text"){const{exact:E,text:x}=Ra(d.body);o.push([n.generateLocator(g,"text",x,{exact:E})]);continue}if(d.name==="internal:has-text"){const{exact:E,text:x}=Ra(d.body);if(!E){o.push([n.generateLocator(g,"has-text",x,{exact:E})]);continue}}if(d.name==="internal:has-not-text"){const{exact:E,text:x}=Ra(d.body);if(!E){o.push([n.generateLocator(g,"has-not-text",x,{exact:E})]);continue}}if(d.name==="internal:has"){const E=os(n,d.body.parsed,!1,r);o.push(E.map(x=>n.generateLocator(g,"has",x)));continue}if(d.name==="internal:has-not"){const E=os(n,d.body.parsed,!1,r);o.push(E.map(x=>n.generateLocator(g,"hasNot",x)));continue}if(d.name==="internal:and"){const E=os(n,d.body.parsed,!1,r);o.push(E.map(x=>n.generateLocator(g,"and",x)));continue}if(d.name==="internal:or"){const E=os(n,d.body.parsed,!1,r);o.push(E.map(x=>n.generateLocator(g,"or",x)));continue}if(d.name==="internal:chain"){const E=os(n,d.body.parsed,!1,r);o.push(E.map(x=>n.generateLocator(g,"chain",x)));continue}if(d.name==="internal:label"){const{exact:E,text:x}=Ra(d.body);o.push([n.generateLocator(g,"label",x,{exact:E})]);continue}if(d.name==="internal:role"){const E=Er(d.body),x={attrs:[]};for(const _ of E.attributes)if(_.name==="name"){if(x.exact!==void 0&&x.exact!==_.caseSensitive)throw new Error(`Conflicting exactness in internal:role selector: ${It({parts:[d]})}`);x.exact=_.caseSensitive,x.name=_.value}else if(_.name==="description"){if(x.exact!==void 0&&x.exact!==_.caseSensitive)throw new Error(`Conflicting exactness in internal:role selector: ${It({parts:[d]})}`);x.exact=_.caseSensitive,x.description=_.value}else _.name==="level"&&typeof _.value=="string"&&(_.value=+_.value),x.attrs.push({name:_.name==="include-hidden"?"includeHidden":_.name,value:_.value});o.push([n.generateLocator(g,"role",E.name,x)]);continue}if(d.name==="internal:testid"){const E=Er(d.body),{value:x}=E.attributes[0];o.push([n.generateLocator(g,"test-id",x)]);continue}if(d.name==="internal:attr"){const E=Er(d.body),{name:x,value:_,caseSensitive:A}=E.attributes[0],C=_,H=!!A;if(x==="placeholder"){o.push([n.generateLocator(g,"placeholder",C,{exact:H})]);continue}if(x==="alt"){o.push([n.generateLocator(g,"alt",C,{exact:H})]);continue}if(x==="title"){o.push([n.generateLocator(g,"title",C,{exact:H})]);continue}}if(d.name==="internal:control"&&d.body==="enter-frame"){const E=o[o.length-1],x=a[f-1],_=E.map(A=>n.chainLocators([A,n.generateLocator(g,"frame","")]));["xpath","css"].includes(x.name)&&_.push(n.generateLocator(g,"frame-locator",It({parts:[x]})),n.generateLocator(g,"frame-locator",It({parts:[x]},!0))),E.splice(0,E.length,..._),u="frame-locator";continue}const m=a[f+1],y=It({parts:[d]}),S=n.generateLocator(g,"default",y);if(m&&["internal:has-text","internal:has-not-text"].includes(m.name)){const{exact:E,text:x}=Ra(m.body);if(!E){const _=n.generateLocator("locator",m.name==="internal:has-text"?"has-text":"has-not-text",x,{exact:E}),A={};m.name==="internal:has-text"?A.hasText=x:A.hasNotText=x;const C=n.generateLocator(g,"default",y,A);o.push([n.chainLocators([S,_]),C]),f++;continue}}let w;if(["xpath","css"].includes(d.name)){const E=It({parts:[d]},!0);w=n.generateLocator(g,"default",E)}o.push([S,w].filter(Boolean))}return v_(n,o,r)}function v_(n,e,i){const r=e.map(()=>""),a=[],o=u=>{if(u===e.length)return a.push(n.chainLocators(r)),a.length<i;for(const f of e[u])if(r[u]=f,!o(u+1))return!1;return!0};return o(0),a}function Ra(n){let e=!1;const i=n.match(/^\/(.*)\/([igm]*)$/);return i?{text:new RegExp(i[1],i[2])}:(n.endsWith('"')?(n=JSON.parse(n),e=!0):n.endsWith('"s')?(n=JSON.parse(n.substring(0,n.length-1)),e=!0):n.endsWith('"i')&&(n=JSON.parse(n.substring(0,n.length-1)),e=!1),{exact:e,text:n})}class S_{constructor(e){this.preferredQuote=e}generateLocator(e,i,r,a={}){switch(i){case"default":return a.hasText!==void 0?`locator(${this.quote(r)}, { hasText: ${this.toHasText(a.hasText)} })`:a.hasNotText!==void 0?`locator(${this.quote(r)}, { hasNotText: ${this.toHasText(a.hasNotText)} })`:`locator(${this.quote(r)})`;case"frame-locator":return`frameLocator(${this.quote(r)})`;case"frame":return"contentFrame()";case"nth":return`nth(${r})`;case"first":return"first()";case"last":return"last()";case"visible":return`filter({ visible: ${r==="true"?"true":"false"} })`;case"role":const o=[];We(a.name)?o.push(`name: ${this.regexToSourceString(a.name)}`):typeof a.name=="string"&&o.push(`name: ${this.quote(a.name)}`),We(a.description)?o.push(`description: ${this.regexToSourceString(a.description)}`):typeof a.description=="string"&&o.push(`description: ${this.quote(a.description)}`),a.exact&&(typeof a.name=="string"||typeof a.description=="string")&&o.push("exact: true");for(const{name:f,value:d}of a.attrs)o.push(`${f}: ${typeof d=="string"?this.quote(d):d}`);const u=o.length?`, { ${o.join(", ")} }`:"";return`getByRole(${this.quote(r)}${u})`;case"has-text":return`filter({ hasText: ${this.toHasText(r)} })`;case"has-not-text":return`filter({ hasNotText: ${this.toHasText(r)} })`;case"has":return`filter({ has: ${r} })`;case"hasNot":return`filter({ hasNot: ${r} })`;case"and":return`and(${r})`;case"or":return`or(${r})`;case"chain":return`locator(${r})`;case"test-id":return`getByTestId(${this.toTestIdValue(r)})`;case"text":return this.toCallWithExact("getByText",r,!!a.exact);case"alt":return this.toCallWithExact("getByAltText",r,!!a.exact);case"placeholder":return this.toCallWithExact("getByPlaceholder",r,!!a.exact);case"label":return this.toCallWithExact("getByLabel",r,!!a.exact);case"title":return this.toCallWithExact("getByTitle",r,!!a.exact);default:throw new Error("Unknown selector kind "+i)}}chainLocators(e){return e.join(".")}regexToSourceString(e){return Sc(String(e))}toCallWithExact(e,i,r){return We(i)?`${e}(${this.regexToSourceString(i)})`:r?`${e}(${this.quote(i)}, { exact: true })`:`${e}(${this.quote(i)})`}toHasText(e){return We(e)?this.regexToSourceString(e):this.quote(e)}toTestIdValue(e){return We(e)?this.regexToSourceString(e):this.quote(e)}quote(e){return vc(e,this.preferredQuote??"'")}}class w_{generateLocator(e,i,r,a={}){switch(i){case"default":return a.hasText!==void 0?`locator(${this.quote(r)}, has_text=${this.toHasText(a.hasText)})`:a.hasNotText!==void 0?`locator(${this.quote(r)}, has_not_text=${this.toHasText(a.hasNotText)})`:`locator(${this.quote(r)})`;case"frame-locator":return`frame_locator(${this.quote(r)})`;case"frame":return"content_frame";case"nth":return`nth(${r})`;case"first":return"first";case"last":return"last";case"visible":return`filter(visible=${r==="true"?"True":"False"})`;case"role":const o=[];We(a.name)?o.push(`name=${this.regexToString(a.name)}`):typeof a.name=="string"&&o.push(`name=${this.quote(a.name)}`),We(a.description)?o.push(`description=${this.regexToString(a.description)}`):typeof a.description=="string"&&o.push(`description=${this.quote(a.description)}`),a.exact&&(typeof a.name=="string"||typeof a.description=="string")&&o.push("exact=True");for(const{name:f,value:d}of a.attrs){let g=typeof d=="string"?this.quote(d):d;typeof d=="boolean"&&(g=d?"True":"False"),o.push(`${q0(f)}=${g}`)}const u=o.length?`, ${o.join(", ")}`:"";return`get_by_role(${this.quote(r)}${u})`;case"has-text":return`filter(has_text=${this.toHasText(r)})`;case"has-not-text":return`filter(has_not_text=${this.toHasText(r)})`;case"has":return`filter(has=${r})`;case"hasNot":return`filter(has_not=${r})`;case"and":return`and_(${r})`;case"or":return`or_(${r})`;case"chain":return`locator(${r})`;case"test-id":return`get_by_test_id(${this.toTestIdValue(r)})`;case"text":return this.toCallWithExact("get_by_text",r,!!a.exact);case"alt":return this.toCallWithExact("get_by_alt_text",r,!!a.exact);case"placeholder":return this.toCallWithExact("get_by_placeholder",r,!!a.exact);case"label":return this.toCallWithExact("get_by_label",r,!!a.exact);case"title":return this.toCallWithExact("get_by_title",r,!!a.exact);default:throw new Error("Unknown selector kind "+i)}}chainLocators(e){return e.join(".")}regexToString(e){const i=e.flags.includes("i")?", re.IGNORECASE":"";return`re.compile(r"${Sc(e.source).replace(/\\\//,"/").replace(/"/g,'\\"')}"${i})`}toCallWithExact(e,i,r){return We(i)?`${e}(${this.regexToString(i)})`:r?`${e}(${this.quote(i)}, exact=True)`:`${e}(${this.quote(i)})`}toHasText(e){return We(e)?this.regexToString(e):`${this.quote(e)}`}toTestIdValue(e){return We(e)?this.regexToString(e):this.quote(e)}quote(e){return vc(e,'"')}}class x_{generateLocator(e,i,r,a={}){let o;switch(e){case"page":o="Page";break;case"frame-locator":o="FrameLocator";break;case"locator":o="Locator";break}switch(i){case"default":return a.hasText!==void 0?`locator(${this.quote(r)}, new ${o}.LocatorOptions().setHasText(${this.toHasText(a.hasText)}))`:a.hasNotText!==void 0?`locator(${this.quote(r)}, new ${o}.LocatorOptions().setHasNotText(${this.toHasText(a.hasNotText)}))`:`locator(${this.quote(r)})`;case"frame-locator":return`frameLocator(${this.quote(r)})`;case"frame":return"contentFrame()";case"nth":return`nth(${r})`;case"first":return"first()";case"last":return"last()";case"visible":return`filter(new ${o}.FilterOptions().setVisible(${r==="true"?"true":"false"}))`;case"role":const u=[];We(a.name)?u.push(`.setName(${this.regexToString(a.name)})`):typeof a.name=="string"&&u.push(`.setName(${this.quote(a.name)})`),We(a.description)?u.push(`.setDescription(${this.regexToString(a.description)})`):typeof a.description=="string"&&u.push(`.setDescription(${this.quote(a.description)})`),a.exact&&(typeof a.name=="string"||typeof a.description=="string")&&u.push(".setExact(true)");for(const{name:d,value:g}of a.attrs)u.push(`.set${ac(d)}(${typeof g=="string"?this.quote(g):g})`);const f=u.length?`, new ${o}.GetByRoleOptions()${u.join("")}`:"";return`getByRole(AriaRole.${q0(r).toUpperCase()}${f})`;case"has-text":return`filter(new ${o}.FilterOptions().setHasText(${this.toHasText(r)}))`;case"has-not-text":return`filter(new ${o}.FilterOptions().setHasNotText(${this.toHasText(r)}))`;case"has":return`filter(new ${o}.FilterOptions().setHas(${r}))`;case"hasNot":return`filter(new ${o}.FilterOptions().setHasNot(${r}))`;case"and":return`and(${r})`;case"or":return`or(${r})`;case"chain":return`locator(${r})`;case"test-id":return`getByTestId(${this.toTestIdValue(r)})`;case"text":return this.toCallWithExact(o,"getByText",r,!!a.exact);case"alt":return this.toCallWithExact(o,"getByAltText",r,!!a.exact);case"placeholder":return this.toCallWithExact(o,"getByPlaceholder",r,!!a.exact);case"label":return this.toCallWithExact(o,"getByLabel",r,!!a.exact);case"title":return this.toCallWithExact(o,"getByTitle",r,!!a.exact);default:throw new Error("Unknown selector kind "+i)}}chainLocators(e){return e.join(".")}regexToString(e){const i=e.flags.includes("i")?", Pattern.CASE_INSENSITIVE":"";return`Pattern.compile(${this.quote(Sc(e.source))}${i})`}toCallWithExact(e,i,r,a){return We(r)?`${i}(${this.regexToString(r)})`:a?`${i}(${this.quote(r)}, new ${e}.${ac(i)}Options().setExact(true))`:`${i}(${this.quote(r)})`}toHasText(e){return We(e)?this.regexToString(e):this.quote(e)}toTestIdValue(e){return We(e)?this.regexToString(e):this.quote(e)}quote(e){return vc(e,'"')}}class __{generateLocator(e,i,r,a={}){switch(i){case"default":return a.hasText!==void 0?`Locator(${this.quote(r)}, new() { ${this.toHasText(a.hasText)} })`:a.hasNotText!==void 0?`Locator(${this.quote(r)}, new() { ${this.toHasNotText(a.hasNotText)} })`:`Locator(${this.quote(r)})`;case"frame-locator":return`FrameLocator(${this.quote(r)})`;case"frame":return"ContentFrame";case"nth":return`Nth(${r})`;case"first":return"First";case"last":return"Last";case"visible":return`Filter(new() { Visible = ${r==="true"?"true":"false"} })`;case"role":const o=[];We(a.name)?o.push(`NameRegex = ${this.regexToString(a.name)}`):typeof a.name=="string"&&o.push(`Name = ${this.quote(a.name)}`),We(a.description)?o.push(`DescriptionRegex = ${this.regexToString(a.description)}`):typeof a.description=="string"&&o.push(`Description = ${this.quote(a.description)}`),a.exact&&(typeof a.name=="string"||typeof a.description=="string")&&o.push("Exact = true");for(const{name:f,value:d}of a.attrs)o.push(`${ac(f)} = ${typeof d=="string"?this.quote(d):d}`);const u=o.length?`, new() { ${o.join(", ")} }`:"";return`GetByRole(AriaRole.${ac(r)}${u})`;case"has-text":return`Filter(new() { ${this.toHasText(r)} })`;case"has-not-text":return`Filter(new() { ${this.toHasNotText(r)} })`;case"has":return`Filter(new() { Has = ${r} })`;case"hasNot":return`Filter(new() { HasNot = ${r} })`;case"and":return`And(${r})`;case"or":return`Or(${r})`;case"chain":return`Locator(${r})`;case"test-id":return`GetByTestId(${this.toTestIdValue(r)})`;case"text":return this.toCallWithExact("GetByText",r,!!a.exact);case"alt":return this.toCallWithExact("GetByAltText",r,!!a.exact);case"placeholder":return this.toCallWithExact("GetByPlaceholder",r,!!a.exact);case"label":return this.toCallWithExact("GetByLabel",r,!!a.exact);case"title":return this.toCallWithExact("GetByTitle",r,!!a.exact);default:throw new Error("Unknown selector kind "+i)}}chainLocators(e){return e.join(".")}regexToString(e){const i=e.flags.includes("i")?", RegexOptions.IgnoreCase":"";return`new Regex(${this.quote(Sc(e.source))}${i})`}toCallWithExact(e,i,r){return We(i)?`${e}(${this.regexToString(i)})`:r?`${e}(${this.quote(i)}, new() { Exact = true })`:`${e}(${this.quote(i)})`}toHasText(e){return We(e)?`HasTextRegex = ${this.regexToString(e)}`:`HasText = ${this.quote(e)}`}toTestIdValue(e){return We(e)?this.regexToString(e):this.quote(e)}toHasNotText(e){return We(e)?`HasNotTextRegex = ${this.regexToString(e)}`:`HasNotText = ${this.quote(e)}`}quote(e){return vc(e,'"')}}class E_{generateLocator(e,i,r,a={}){return JSON.stringify({kind:i,body:r,options:a})}chainLocators(e){const i=e.map(r=>JSON.parse(r));for(let r=0;r<i.length-1;++r)i[r].next=i[r+1];return JSON.stringify(i[0])}}const G0={javascript:S_,python:w_,java:x_,csharp:__,jsonl:E_};function We(n){return n instanceof RegExp}const db=new Map;function T_({name:n,rootItem:e,render:i,title:r,icon:a,isError:o,isVisible:u,selectedItem:f,onAccepted:d,onSelected:g,onHighlighted:m,treeState:y,setTreeState:S,noItemsMessage:w,dataTestId:E,autoExpandDepth:x,revealSelectedKey:_}){const A=R.useMemo(()=>A_(e,f,y.expandedItems,x||0,u),[e,f,y,x,u]),C=R.useRef(null),[H,V]=R.useState();R.useEffect(()=>{m==null||m(H)},[m,H]),R.useEffect(()=>{const j=C.current;if(!j)return;const I=()=>{db.set(n,j.scrollTop)};return j.addEventListener("scroll",I,{passive:!0}),()=>j.removeEventListener("scroll",I)},[n]),R.useEffect(()=>{C.current&&(C.current.scrollTop=db.get(n)||0)},[n]),R.useEffect(()=>{var I;if(_===void 0)return;const j=(I=C.current)==null?void 0:I.querySelector('[aria-selected="true"]');j&&td(j)},[_]);const K=R.useCallback(j=>{const{expanded:I}=A.get(j);if(I){for(let O=f;O;O=O.parent)if(O===j){g==null||g(j);break}y.expandedItems.set(j.id,!1)}else y.expandedItems.set(j.id,!0);S({...y})},[A,f,g,y,S]),Q=R.useCallback(j=>{const{expanded:I}=A.get(j),O=[j];for(;O.length;){const P=O.pop();O.push(...P.children),y.expandedItems.set(P.id,!I)}S({...y})},[A,y,S]);return b.jsx("div",{className:ut("tree-view vbox",n+"-tree-view"),"data-testid":E||n+"-tree",children:b.jsxs("div",{className:ut("tree-view-content"),role:A.size>0?"tree":void 0,tabIndex:0,onKeyDown:j=>{if(f&&j.key==="Enter"){d==null||d(f);return}if(j.key!=="ArrowDown"&&j.key!=="ArrowUp"&&j.key!=="ArrowLeft"&&j.key!=="ArrowRight")return;if(j.stopPropagation(),j.preventDefault(),f&&j.key==="ArrowLeft"){const{expanded:O,parent:P}=A.get(f);O?(y.expandedItems.set(f.id,!1),S({...y})):P&&(g==null||g(P));return}if(f&&j.key==="ArrowRight"){f.children.length&&(y.expandedItems.set(f.id,!0),S({...y}));return}let I=f;if(j.key==="ArrowDown"&&(f?I=A.get(f).next:A.size&&(I=[...A.keys()][0])),j.key==="ArrowUp"){if(f)I=A.get(f).prev;else if(A.size){const O=[...A.keys()];I=O[O.length-1]}}m==null||m(void 0),I&&(g==null||g(I)),V(void 0)},ref:C,children:[w&&A.size===0&&b.jsx("div",{className:"tree-view-empty",children:w}),e.children.map(j=>A.get(j)&&b.jsx(K0,{item:j,treeItems:A,selectedItem:f,onSelected:g,onAccepted:d,isError:o,toggleExpanded:K,toggleSubtree:Q,highlightedItem:H,setHighlightedItem:V,render:i,icon:a,title:r},j.id))]})})}function K0({item:n,treeItems:e,selectedItem:i,onSelected:r,highlightedItem:a,setHighlightedItem:o,isError:u,onAccepted:f,toggleExpanded:d,toggleSubtree:g,render:m,title:y,icon:S}){const w=R.useId(),E=R.useRef(null);R.useEffect(()=>{(i==null?void 0:i.id)===n.id&&E.current&&td(E.current)},[n.id,i==null?void 0:i.id]);const x=e.get(n),_=x.depth,A=x.expanded;let C="codicon-blank";typeof A=="boolean"&&(C=A?"codicon-chevron-down":"codicon-chevron-right");const H=m(n),V=A&&n.children.length?n.children:[],K=y==null?void 0:y(n),Q=(S==null?void 0:S(n))||"codicon-blank";return b.jsxs("div",{ref:E,role:"treeitem","aria-selected":n===i,"aria-expanded":A,"aria-controls":w,title:K,className:"vbox",style:{flex:"none"},children:[b.jsxs("div",{onDoubleClick:()=>f==null?void 0:f(n),className:ut("tree-view-entry",i===n&&"selected",a===n&&"highlighted",(u==null?void 0:u(n))&&"error"),onClick:()=>r==null?void 0:r(n),onMouseEnter:()=>o(n),onMouseLeave:()=>o(void 0),children:[_?new Array(_).fill(0).map((j,I)=>b.jsx("div",{className:"tree-view-indent"},"indent-"+I)):void 0,b.jsx("div",{"aria-hidden":"true",className:"codicon "+C,style:{minWidth:16,marginRight:4},onDoubleClick:j=>{j.preventDefault(),j.stopPropagation()},onClick:j=>{j.stopPropagation(),j.preventDefault(),j.altKey?g(n):d(n)}}),S&&b.jsx("div",{className:"codicon "+Q,style:{minWidth:16,marginRight:4},"aria-label":"["+Q.replace("codicon","icon")+"]"}),typeof H=="string"?b.jsx("div",{style:{textOverflow:"ellipsis",overflow:"hidden"},children:H}):H]}),!!V.length&&b.jsx("div",{id:w,role:"group",children:V.map(j=>e.get(j)&&b.jsx(K0,{item:j,treeItems:e,selectedItem:i,onSelected:r,onAccepted:f,isError:u,toggleExpanded:d,toggleSubtree:g,highlightedItem:a,setHighlightedItem:o,render:m,title:y,icon:S},j.id))})]})}function Dh(n,e,i){const r=i.get(n.id);if(r!==void 0)return r;const a=e(n),o=a==="if-needed"?n.children.some(u=>Dh(u,e,i)):a;return i.set(n.id,o),o}function A_(n,e,i,r,a=()=>!0){const o=new Map;if(!Dh(n,a,o))return new Map;const u=new Map,f=new Set;for(let m=e==null?void 0:e.parent;m;m=m.parent)f.add(m.id);let d=null;const g=(m,y)=>{for(const S of m.children){if(!Dh(S,a,o))continue;const w=f.has(S.id)||i.get(S.id),E=r>y&&u.size<25&&w!==!1,x=S.children.length?w??E:void 0,_={depth:y,expanded:x,parent:n===m?null:m,next:null,prev:d};d&&(u.get(d).next=S),d=S,u.set(S,_),x&&g(S,y+1)}};return g(n,0),u}const ct=R.forwardRef(function({children:e,title:i="",icon:r,disabled:a=!1,toggled:o=!1,onClick:u=()=>{},style:f,testId:d,className:g,ariaLabel:m,errorBadge:y},S){const w=R.useId();return b.jsxs("button",{ref:S,className:ut(g,"toolbar-button",r,o&&"toggled"),onMouseDown:pb,onClick:u,onDoubleClick:pb,title:i,disabled:!!a,style:f,"data-testid":d,"aria-label":m||i,"aria-describedby":y?w:void 0,children:[r&&b.jsx("span",{className:`codicon codicon-${r}`,style:e?{marginRight:5}:{}}),e,y&&b.jsx("span",{id:w,className:"toolbar-button-error-badge",title:y,"aria-label":y})]})}),pb=n=>{n.stopPropagation(),n.preventDefault()};function X0(n){return n==="scheduled"?"codicon-clock":n==="running"?"codicon-loading":n==="failed"?"codicon-error":n==="passed"?"codicon-check":n==="skipped"?"codicon-circle-slash":"codicon-circle-outline"}function C_(n){return n==="scheduled"?"Pending":n==="running"?"Running":n==="failed"?"Failed":n==="passed"?"Passed":n==="skipped"?"Skipped":"Did not run"}const N_=T_,k_=({actions:n,selectedAction:e,selectedTime:i,setSelectedTime:r,treeState:a,setTreeState:o,sdkLanguage:u,onSelected:f,onHighlighted:d,revealConsole:g,revealActionAttachment:m,isLive:y,actionFilterText:S})=>{const{rootItem:w,itemMap:E}=R.useMemo(()=>v0(n),[n]),{selectedItem:x}=R.useMemo(()=>({selectedItem:e?E.get(e.callId):void 0}),[E,e]),_=R.useCallback(O=>{var P;return!!((P=O.action.error)!=null&&P.message)},[]),A=R.useCallback(O=>r({minimum:O.action.startTime,maximum:O.action.endTime}),[r]),C=R.useCallback(O=>{var J;const P=!!m&&!!((J=O.action.attachments)!=null&&J.length);return od(O.action,{sdkLanguage:u,revealConsole:g,revealActionAttachment:()=>m==null?void 0:m(O.action.callId),isLive:y,showDuration:!0,showBadges:!0,showAttachments:P})},[y,g,m,u]),H=R.useCallback(O=>{if(!(!i||!O.action||O.action.startTime<=i.maximum&&O.action.endTime>=i.minimum))return!1;const J=cd(O.action).title;return S?J.toLowerCase().includes(S.toLowerCase())?!0:"if-needed":!0},[i,S]),V=R.useCallback(O=>{f==null||f(O.action)},[f]),K=R.useCallback(O=>{d==null||d(O==null?void 0:O.action)},[d]),[Q,j]=R.useState(),I=R.useCallback(()=>{r(void 0),j(O=>(O??0)+1)},[r]);return b.jsxs("div",{className:"vbox action-list-container",children:[i&&b.jsxs("div",{className:"action-list-show-all",onClick:I,children:[b.jsx("span",{className:"codicon codicon-triangle-left"}),"Show all"]}),b.jsx(N_,{name:"actions",rootItem:w,treeState:a,setTreeState:o,selectedItem:x,onSelected:V,onHighlighted:K,onAccepted:A,isError:_,isVisible:H,render:C,autoExpandDepth:S!=null&&S.trim()?5:0,revealSelectedKey:Q})]})},od=(n,e)=>{var _;const{sdkLanguage:i,revealConsole:r,revealActionAttachment:a,isLive:o,showDuration:u,showBadges:f,showAttachments:d}=e,{errors:g,warnings:m}=Kx(n),y=n.params.selector?I0(i||"javascript",n.params.selector):void 0,S=n.class==="Test"&&n.method==="test.step"&&((_=n.annotations)==null?void 0:_.some(A=>A.type==="skip"));let w="";n.endTime?w=yt(n.endTime-n.startTime):n.error?w="Timed out":o||(w="-");const{elements:E,title:x}=cd(n);return b.jsxs("div",{className:"action-title vbox",children:[b.jsxs("div",{className:"hbox",children:[b.jsx("span",{className:"action-title-method",title:x,children:E}),(u||f||d||S)&&b.jsx("div",{className:"spacer"}),d&&b.jsx(ct,{icon:"attach",title:"Open Attachment",onClick:()=>a==null?void 0:a()}),u&&!S&&b.jsx("div",{className:"action-duration",children:w||b.jsx("span",{className:"codicon codicon-loading"})}),S&&b.jsx("span",{className:ut("action-skipped","codicon",X0("skipped")),title:"skipped"}),f&&b.jsxs("div",{className:"action-icons",onClick:()=>r==null?void 0:r(),children:[!!g&&b.jsxs("div",{className:"action-icon",children:[b.jsx("span",{className:"codicon codicon-error"}),b.jsx("span",{className:"action-icon-value",children:g})]}),!!m&&b.jsxs("div",{className:"action-icon",children:[b.jsx("span",{className:"codicon codicon-warning"}),b.jsx("span",{className:"action-icon-value",children:m})]})]})]}),y&&b.jsx("div",{className:"action-title-selector",title:y,children:y})]})};function cd(n,e){var g;let i=n.title??((g=id({type:n.class,method:n.method}))==null?void 0:g.title)??n.method;i=i.replace(/\n/g," ");const r=[],a=[];let o=0;const u=/\{([^}]+)\}/g;let f;for(;(f=u.exec(i))!==null;){const[m,y]=f,S=i.slice(o,f.index);r.push(S),a.push(S);const w=g0(n.params,y);w===void 0?(r.push(m),a.push(m)):f.index===0?(r.push(w),a.push(w)):(r.push(b.jsx("span",{className:"action-title-param",children:w},r.length)),a.push(w)),o=f.index+m.length}if(o<i.length){const m=i.slice(o);r.push(m),a.push(m)}const d=n.params.selector?I0("javascript",n.params.selector):void 0;return d&&(a.push(" "),a.push(d)),{elements:r,title:a.join("")}}const ud=({value:n,description:e})=>{const[i,r]=R.useState("copy"),a=R.useCallback(()=>{(typeof n=="function"?n():Promise.resolve(n)).then(u=>{navigator.clipboard.writeText(u).then(()=>{r("check"),setTimeout(()=>{r("copy")},3e3)},()=>{r("close")})},()=>{r("close")})},[n]);return b.jsx(ct,{title:e||"Copy",icon:i,onClick:a})},Po=({value:n,description:e,copiedDescription:i=e,style:r})=>{const[a,o]=R.useState(!1),u=R.useCallback(async()=>{const f=typeof n=="function"?await n():n;await navigator.clipboard.writeText(f),o(!0),setTimeout(()=>o(!1),3e3)},[n]);return b.jsx(ct,{style:r,title:e,onClick:u,className:"copy-to-clipboard-text-button",children:a?i:e})},ai=({text:n})=>b.jsx("div",{className:"fill",style:{display:"flex",alignItems:"center",justifyContent:"center",fontSize:24,fontWeight:"bold",opacity:.5},children:n}),M_=({action:n,startTimeOffset:e,sdkLanguage:i})=>{const r=R.useMemo(()=>Object.keys((n==null?void 0:n.params)??{}).filter(f=>f!=="info"),[n]);if(!n)return b.jsx(ai,{text:"No action selected"});const a=n.startTime-e,o=yt(a),{title:u}=cd(n);return b.jsxs("div",{className:"call-tab",children:[b.jsx("div",{className:"call-line",children:u}),b.jsx("div",{className:"call-section",children:"Time"}),Do({name:"start",type:"literal",text:o}),Do({name:"duration",type:"literal",text:O_(n)}),!!r.length&&b.jsxs(b.Fragment,{children:[b.jsx("div",{className:"call-section",children:"Parameters"}),r.map(f=>Do(gb(n,f,n.params[f],i)))]}),!!n.result&&b.jsxs(b.Fragment,{children:[b.jsx("div",{className:"call-section",children:"Return value"}),Object.keys(n.result).map(f=>Do(gb(n,f,n.result[f],i)))]})]})};function O_(n){return n.endTime?yt(n.endTime-n.startTime):n.error?"Timed Out":"Running"}function Do(n){let e=n.text;return e.length>1e3&&(e=e.slice(0,1e3)+"â€¦"),e=e.replace(/\n/g,"â†µ"),n.type==="string"&&(e=`"${e}"`),b.jsxs("div",{className:"call-line",children:[n.name,":",b.jsx("span",{className:ut("call-value",n.type),title:e,children:e}),["literal","string","number","object","locator"].includes(n.type)&&b.jsx(ud,{value:n.text})]},n.name)}function gb(n,e,i,r){const a=n.method.includes("eval")||n.method==="waitForFunction";if(e==="files")return{text:"<files>",type:"string",name:e};if((e==="eventInit"||e==="expectedValue"||e==="arg"&&a)&&(i=Qa(i.value,new Array(10).fill({handle:"<handle>"}))),e==="value"&&a&&(i=Qa(i,new Array(10).fill({handle:"<handle>"}))),e==="received"&&n.method==="expect"){const f=i&&typeof i=="object"&&("value"in i||"ariaSnapshot"in i)?i.value:i;i=f!==void 0?Qa(f,new Array(10).fill({handle:"<handle>"})):void 0}if(e==="selector")return{text:Ri(r||"javascript",n.params.selector),type:"locator",name:"locator"};const o=typeof i;return o!=="object"||i===null?{text:String(i),type:o,name:e}:i.guid?{text:"<handle>",type:"handle",name:e}:{text:JSON.stringify(i),type:"object",name:e}}function Qa(n,e){if(n.n!==void 0)return n.n;if(n.s!==void 0)return n.s;if(n.b!==void 0)return n.b;if(n.v!==void 0){if(n.v==="undefined")return;if(n.v==="null")return null;if(n.v==="NaN")return NaN;if(n.v==="Infinity")return 1/0;if(n.v==="-Infinity")return-1/0;if(n.v==="-0")return-0}if(n.d!==void 0)return new Date(n.d);if(n.r!==void 0)return new RegExp(n.r.p,n.r.f);if(n.a!==void 0)return n.a.map(i=>Qa(i,e));if(n.o!==void 0){const i={};for(const{k:r,v:a}of n.o)i[r]=Qa(a,e);return i}return n.h!==void 0?e===void 0?"<object>":e[n.h]:"<object>"}const mb=new Map;function hl({name:n,items:e=[],id:i,render:r,icon:a,isError:o,isWarning:u,isInfo:f,selectedItem:d,onAccepted:g,onSelected:m,onHighlighted:y,onIconClicked:S,noItemsMessage:w,dataTestId:E,notSelectable:x,ariaLabel:_}){const A=R.useRef(null),[C,H]=R.useState();return R.useEffect(()=>{y==null||y(C)},[y,C]),R.useEffect(()=>{const V=A.current;if(!V)return;const K=()=>{mb.set(n,V.scrollTop)};return V.addEventListener("scroll",K,{passive:!0}),()=>V.removeEventListener("scroll",K)},[n]),R.useEffect(()=>{A.current&&(A.current.scrollTop=mb.get(n)||0)},[n]),b.jsx("div",{className:ut("list-view vbox",n+"-list-view"),role:e.length>0?"listbox":void 0,"aria-label":_,children:b.jsxs("div",{className:ut("list-view-content",x&&"not-selectable"),tabIndex:0,onKeyDown:V=>{var I;if(d&&V.key==="Enter"){g==null||g(d,e.indexOf(d));return}if(V.key!=="ArrowDown"&&V.key!=="ArrowUp")return;V.stopPropagation(),V.preventDefault();const K=d?e.indexOf(d):-1;let Q=K;V.key==="ArrowDown"&&(K===-1?Q=0:Q=Math.min(K+1,e.length-1)),V.key==="ArrowUp"&&(K===-1?Q=e.length-1:Q=Math.max(K-1,0));const j=(I=A.current)==null?void 0:I.children.item(Q);td(j||void 0),y==null||y(void 0),m==null||m(e[Q],Q),H(void 0)},ref:A,children:[w&&e.length===0&&b.jsx("div",{className:"list-view-empty",children:w}),e.map((V,K)=>{const Q=r(V,K);return b.jsxs("div",{onDoubleClick:()=>g==null?void 0:g(V,K),role:"option",className:ut("list-view-entry",d===V&&"selected",!x&&C===V&&"highlighted",(o==null?void 0:o(V,K))&&"error",(u==null?void 0:u(V,K))&&"warning",(f==null?void 0:f(V,K))&&"info"),"aria-selected":d===V,onClick:()=>m==null?void 0:m(V,K),onMouseEnter:()=>H(V),onMouseLeave:()=>H(void 0),children:[a&&b.jsx("div",{className:"codicon "+(a(V,K)||"codicon-blank"),style:{minWidth:16,marginRight:4},onDoubleClick:j=>{j.preventDefault(),j.stopPropagation()},onClick:j=>{j.stopPropagation(),j.preventDefault(),S==null||S(V,K)}}),typeof Q=="string"?b.jsx("div",{style:{textOverflow:"ellipsis",overflow:"hidden"},children:Q}):Q]},(i==null?void 0:i(V,K))||K)})]})})}const j_=hl,L_=({action:n,isLive:e})=>{const i=R.useMemo(()=>{var u;if(!n||!n.log.length)return[];const r=n.log,a=n.context.wallTime-n.context.startTime,o=[];for(let f=0;f<r.length;++f){let d="";if(r[f].time!==-1){const g=(u=r[f])==null?void 0:u.time;f+1<r.length?d=yt(r[f+1].time-g):n.endTime>0?d=yt(n.endTime-g):e?d=yt(Date.now()-a-g):d="-"}o.push({message:r[f].message,time:d})}return o},[n,e]);return i.length?b.jsx(j_,{name:"log",ariaLabel:"Log entries",items:i,render:r=>b.jsxs("div",{className:"log-list-item",children:[b.jsx("span",{className:"log-list-duration",children:r.time}),r.message]}),notSelectable:!0}):b.jsx(ai,{text:"No log entries"})};function sl(n,e){const i=/(\x1b\[(\d+(;\d+)*)m)|([^\x1b]+)/g,r=[];let a,o={},u=!1,f=e==null?void 0:e.fg,d=e==null?void 0:e.bg;for(;(a=i.exec(n))!==null;){const[,,g,,m]=a;if(g)for(const y of g.split(";")){const S=+y;switch(S){case 0:o={};break;case 1:o["font-weight"]="bold";break;case 2:o.opacity="0.8";break;case 3:o["font-style"]="italic";break;case 4:o["text-decoration"]="underline";break;case 7:u=!0;break;case 8:o.display="none";break;case 9:o["text-decoration"]="line-through";break;case 22:delete o["font-weight"],delete o["font-style"],delete o.opacity,delete o["text-decoration"];break;case 23:delete o["font-weight"],delete o["font-style"],delete o.opacity;break;case 24:delete o["text-decoration"];break;case 27:u=!1;break;case 30:case 31:case 32:case 33:case 34:case 35:case 36:case 37:f=yb[S-30];break;case 39:f=e==null?void 0:e.fg;break;case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:d=yb[S-40];break;case 49:d=e==null?void 0:e.bg;break;case 53:o["text-decoration"]="overline";break;case 90:case 91:case 92:case 93:case 94:case 95:case 96:case 97:f=bb[S-90];break;case 100:case 101:case 102:case 103:case 104:case 105:case 106:case 107:d=bb[S-100];break}}else if(m){const y={...o},S=u?d:f;S!==void 0&&(y.color=S),u&&f&&(y["background-color"]=f),r.push(`<span style="${D_(y)}">${R_(m)}</span>`)}}return r.join("")}const yb={0:"var(--vscode-terminal-ansiBlack)",1:"var(--vscode-terminal-ansiRed)",2:"var(--vscode-terminal-ansiGreen)",3:"var(--vscode-terminal-ansiYellow)",4:"var(--vscode-terminal-ansiBlue)",5:"var(--vscode-terminal-ansiMagenta)",6:"var(--vscode-terminal-ansiCyan)",7:"var(--vscode-terminal-ansiWhite)"},bb={0:"var(--vscode-terminal-ansiBrightBlack)",1:"var(--vscode-terminal-ansiBrightRed)",2:"var(--vscode-terminal-ansiBrightGreen)",3:"var(--vscode-terminal-ansiBrightYellow)",4:"var(--vscode-terminal-ansiBrightBlue)",5:"var(--vscode-terminal-ansiBrightMagenta)",6:"var(--vscode-terminal-ansiBrightCyan)",7:"var(--vscode-terminal-ansiBrightWhite)"};function R_(n){return n.replace(/[&"<>]/g,e=>({"&":"&amp;",'"':"&quot;","<":"&lt;",">":"&gt;"})[e])}function D_(n){return Object.entries(n).map(([e,i])=>`${e}: ${i}`).join("; ")}const z_=({error:n})=>{const e=R.useMemo(()=>sl(n,{bg:"var(--vscode-editor-background)",fg:"var(--vscode-editor-foreground)"}),[n]);return b.jsx("div",{className:"error-message",dangerouslySetInnerHTML:{__html:e||""}})},Y0=({cursor:n,onPaneMouseMove:e,onPaneMouseUp:i,onPaneDoubleClick:r})=>(Et.useEffect(()=>{const a=document.createElement("div");return a.style.position="fixed",a.style.top="0",a.style.right="0",a.style.bottom="0",a.style.left="0",a.style.zIndex="9999",a.style.cursor=n,document.body.appendChild(a),e&&a.addEventListener("mousemove",e),i&&a.addEventListener("mouseup",i),r&&document.body.addEventListener("dblclick",r),()=>{e&&a.removeEventListener("mousemove",e),i&&a.removeEventListener("mouseup",i),r&&document.body.removeEventListener("dblclick",r),document.body.removeChild(a)}},[n,e,i,r]),b.jsx(b.Fragment,{})),U_={position:"absolute",top:0,right:0,bottom:0,left:0},F0=({orientation:n,offsets:e,setOffsets:i,resizerColor:r,resizerWidth:a,minColumnWidth:o})=>{const u=o||0,[f,d]=Et.useState(null),[g,m]=gs(),y={position:"absolute",right:n==="horizontal"?void 0:0,bottom:n==="horizontal"?0:void 0,width:n==="horizontal"?7:void 0,height:n==="horizontal"?void 0:7,borderTopWidth:n==="horizontal"?void 0:(7-a)/2,borderRightWidth:n==="horizontal"?(7-a)/2:void 0,borderBottomWidth:n==="horizontal"?void 0:(7-a)/2,borderLeftWidth:n==="horizontal"?(7-a)/2:void 0,borderColor:"transparent",borderStyle:"solid",cursor:n==="horizontal"?"ew-resize":"ns-resize"};return b.jsxs("div",{style:{position:"absolute",top:0,right:0,bottom:0,left:-(7-a)/2,zIndex:100,pointerEvents:"none"},ref:m,children:[!!f&&b.jsx(Y0,{cursor:n==="horizontal"?"ew-resize":"ns-resize",onPaneMouseUp:()=>d(null),onPaneMouseMove:S=>{if(!S.buttons)d(null);else if(f){const w=n==="horizontal"?S.clientX-f.clientX:S.clientY-f.clientY,E=f.offset+w,x=f.index>0?e[f.index-1]:0,_=n==="horizontal"?g.width:g.height,A=Math.min(Math.max(x+u,E),_-u)-e[f.index];for(let C=f.index;C<e.length;++C)e[C]=e[C]+A;i([...e])}}}),e.map((S,w)=>b.jsx("div",{style:{...y,top:n==="horizontal"?0:S,left:n==="horizontal"?S:0,pointerEvents:"initial"},onMouseDown:E=>d({clientX:E.clientX,clientY:E.clientY,offset:S,index:w}),children:b.jsx("div",{style:{...U_,background:r}})},w))]})};async function fh(n){const e=new Image;return n&&(e.src=n,await new Promise((i,r)=>{e.onload=i,e.onerror=i})),e}const zh={backgroundImage:`linear-gradient(45deg, #80808020 25%, transparent 25%),
                    linear-gradient(-45deg, #80808020 25%, transparent 25%),
                    linear-gradient(45deg, transparent 75%, #80808020 75%),
                    linear-gradient(-45deg, transparent 75%, #80808020 75%)`,backgroundSize:"20px 20px",backgroundPosition:"0 0, 0 10px, 10px -10px, -10px 0px",boxShadow:`rgb(0 0 0 / 10%) 0px 1.8px 1.9px,
              rgb(0 0 0 / 15%) 0px 6.1px 6.3px,
              rgb(0 0 0 / 10%) 0px -2px 4px,
              rgb(0 0 0 / 15%) 0px -6.1px 12px,
              rgb(0 0 0 / 25%) 0px 6px 12px`},H_=({diff:n,noTargetBlank:e,hideDetails:i})=>{const[r,a]=R.useState(n.diff?"diff":"actual"),[o,u]=R.useState(!1),[f,d]=R.useState(null),[g,m]=R.useState("Expected"),[y,S]=R.useState(null),[w,E]=R.useState(null),[x,_]=gs();R.useEffect(()=>{(async()=>{var O,P,J,$;d(await fh((O=n.expected)==null?void 0:O.attachment.path)),m(((P=n.expected)==null?void 0:P.title)||"Expected"),S(await fh((J=n.actual)==null?void 0:J.attachment.path)),E(await fh(($=n.diff)==null?void 0:$.attachment.path))})()},[n]);const A=f&&y&&w,C=A?Math.max(f.naturalWidth,y.naturalWidth,200):500,H=A?Math.max(f.naturalHeight,y.naturalHeight,200):500,V=Math.min(1,(x.width-30)/C),K=Math.min(1,(x.width-50)/C/2),Q=C*V,j=H*V,I={flex:"none",margin:"0 10px",cursor:"pointer",userSelect:"none"};return b.jsx("div",{"data-testid":"test-result-image-mismatch",style:{display:"flex",flexDirection:"column",alignItems:"center",flex:"auto"},ref:_,children:A&&b.jsxs(b.Fragment,{children:[b.jsxs("div",{"data-testid":"test-result-image-mismatch-tabs",style:{display:"flex",margin:"10px 0 20px"},children:[n.diff&&b.jsx("div",{style:{...I,fontWeight:r==="diff"?600:"initial"},onClick:()=>a("diff"),children:"Diff"}),b.jsx("div",{style:{...I,fontWeight:r==="actual"?600:"initial"},onClick:()=>a("actual"),children:"Actual"}),b.jsx("div",{style:{...I,fontWeight:r==="expected"?600:"initial"},onClick:()=>a("expected"),children:g}),b.jsx("div",{style:{...I,fontWeight:r==="sxs"?600:"initial"},onClick:()=>a("sxs"),children:"Side by side"}),b.jsx("div",{style:{...I,fontWeight:r==="slider"?600:"initial"},onClick:()=>a("slider"),children:"Slider"})]}),b.jsxs("div",{style:{display:"flex",justifyContent:"center",flex:"auto",minHeight:j+60},children:[n.diff&&r==="diff"&&b.jsx(ei,{image:w,alt:"Diff",hideSize:i,canvasWidth:Q,canvasHeight:j,scale:V}),n.diff&&r==="actual"&&b.jsx(ei,{image:y,alt:"Actual",hideSize:i,canvasWidth:Q,canvasHeight:j,scale:V}),n.diff&&r==="expected"&&b.jsx(ei,{image:f,alt:g,hideSize:i,canvasWidth:Q,canvasHeight:j,scale:V}),n.diff&&r==="slider"&&b.jsx(B_,{expectedImage:f,actualImage:y,hideSize:i,canvasWidth:Q,canvasHeight:j,scale:V,expectedTitle:g}),n.diff&&r==="sxs"&&b.jsxs("div",{style:{display:"flex"},children:[b.jsx(ei,{image:f,title:g,hideSize:i,canvasWidth:K*C,canvasHeight:K*H,scale:K}),b.jsx(ei,{image:o?w:y,title:o?"Diff":"Actual",onClick:()=>u(!o),hideSize:i,canvasWidth:K*C,canvasHeight:K*H,scale:K})]}),!n.diff&&r==="actual"&&b.jsx(ei,{image:y,title:"Actual",hideSize:i,canvasWidth:Q,canvasHeight:j,scale:V}),!n.diff&&r==="expected"&&b.jsx(ei,{image:f,title:g,hideSize:i,canvasWidth:Q,canvasHeight:j,scale:V}),!n.diff&&r==="sxs"&&b.jsxs("div",{style:{display:"flex"},children:[b.jsx(ei,{image:f,title:g,canvasWidth:K*C,canvasHeight:K*H,scale:K}),b.jsx(ei,{image:y,title:"Actual",canvasWidth:K*C,canvasHeight:K*H,scale:K})]})]}),!i&&b.jsxs("div",{style:{alignSelf:"start",lineHeight:"18px",marginLeft:"15px"},children:[b.jsx("div",{children:n.diff&&b.jsx("a",{target:"_blank",href:n.diff.attachment.path,rel:"noreferrer",children:n.diff.attachment.name})}),b.jsx("div",{children:b.jsx("a",{target:e?"":"_blank",href:n.actual.attachment.path,rel:"noreferrer",children:n.actual.attachment.name})}),b.jsx("div",{children:b.jsx("a",{target:e?"":"_blank",href:n.expected.attachment.path,rel:"noreferrer",children:n.expected.attachment.name})})]})]})})},B_=({expectedImage:n,actualImage:e,canvasWidth:i,canvasHeight:r,scale:a,expectedTitle:o,hideSize:u})=>{const f={position:"absolute",top:0,left:0},[d,g]=R.useState(i/2),m=n.naturalWidth===e.naturalWidth&&n.naturalHeight===e.naturalHeight;return b.jsxs("div",{style:{flex:"none",display:"flex",alignItems:"center",flexDirection:"column",userSelect:"none"},children:[!u&&b.jsxs("div",{style:{margin:5},children:[!m&&b.jsx("span",{style:{flex:"none",margin:"0 5px"},children:"Actual "}),!m&&b.jsx("span",{children:e.naturalWidth}),!m&&b.jsx("span",{style:{flex:"none",margin:"0 5px"},children:"x"}),!m&&b.jsx("span",{children:e.naturalHeight}),!m&&b.jsxs("span",{style:{flex:"none",margin:"0 5px 0 15px"},children:[o," "]}),b.jsx("span",{children:n.naturalWidth}),b.jsx("span",{style:{flex:"none",margin:"0 5px"},children:"x"}),b.jsx("span",{children:n.naturalHeight})]}),b.jsxs("div",{style:{position:"relative",width:i,height:r,margin:15,...zh},children:[b.jsx(F0,{orientation:"horizontal",offsets:[d],setOffsets:y=>g(y[0]),resizerColor:"#57606a80",resizerWidth:6}),b.jsx("img",{alt:o,style:{width:n.naturalWidth*a,height:n.naturalHeight*a},draggable:"false",src:n.src}),b.jsx("div",{style:{...f,bottom:0,overflow:"hidden",width:d,...zh},children:b.jsx("img",{alt:"Actual",style:{width:e.naturalWidth*a,height:e.naturalHeight*a},draggable:"false",src:e.src})})]})]})},ei=({image:n,title:e,alt:i,hideSize:r,canvasWidth:a,canvasHeight:o,scale:u,onClick:f})=>b.jsxs("div",{style:{flex:"none",display:"flex",alignItems:"center",flexDirection:"column"},children:[!r&&b.jsxs("div",{style:{margin:5},children:[e&&b.jsx("span",{style:{flex:"none",margin:"0 5px"},children:e}),b.jsx("span",{children:n.naturalWidth}),b.jsx("span",{style:{flex:"none",margin:"0 5px"},children:"x"}),b.jsx("span",{children:n.naturalHeight})]}),b.jsx("div",{style:{display:"flex",flex:"none",width:a,height:o,margin:15,...zh},children:b.jsx("img",{width:n.naturalWidth*u,height:n.naturalHeight*u,alt:e||i,style:{cursor:f?"pointer":"initial"},draggable:"false",src:n.src,onClick:f})})]}),q_="modulepreload",$_=function(n,e){return new URL(n,e).href},vb={},I_=function(e,i,r){let a=Promise.resolve();if(i&&i.length>0){let u=function(m){return Promise.all(m.map(y=>Promise.resolve(y).then(S=>({status:"fulfilled",value:S}),S=>({status:"rejected",reason:S}))))};const f=document.getElementsByTagName("link"),d=document.querySelector("meta[property=csp-nonce]"),g=(d==null?void 0:d.nonce)||(d==null?void 0:d.getAttribute("nonce"));a=u(i.map(m=>{if(m=$_(m,r),m in vb)return;vb[m]=!0;const y=m.endsWith(".css"),S=y?'[rel="stylesheet"]':"";if(!!r)for(let x=f.length-1;x>=0;x--){const _=f[x];if(_.href===m&&(!y||_.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${m}"]${S}`))return;const E=document.createElement("link");if(E.rel=y?"stylesheet":q_,y||(E.as="script"),E.crossOrigin="",E.href=m,g&&E.setAttribute("nonce",g),document.head.appendChild(E),y)return new Promise((x,_)=>{E.addEventListener("load",x),E.addEventListener("error",()=>_(new Error(`Unable to preload CSS for ${m}`)))})}))}function o(u){const f=new Event("vite:preloadError",{cancelable:!0});if(f.payload=u,window.dispatchEvent(f),!f.defaultPrevented)throw u}return a.then(u=>{for(const f of u||[])f.status==="rejected"&&o(f.reason);return e().catch(o)})},V_=20,ds=({text:n,highlighter:e,mimeType:i,linkify:r,readOnly:a,highlight:o,revealLine:u,lineNumbers:f,isFocused:d,focusOnChange:g,wrapLines:m,onChange:y,dataTestId:S,placeholder:w})=>{const[E,x]=gs(),[_]=R.useState(I_(()=>import("./codeMirrorModule-LEHpjmcn.js"),__vite__mapDeps([0,1,2]),import.meta.url).then(V=>V.default)),A=R.useRef(null),[C,H]=R.useState();return R.useEffect(()=>{(async()=>{var I,O;const V=await _;K_(V);const K=x.current;if(!K)return;const Q=Y_(e)||X_(i)||(r?"text/linkified":"");if(A.current&&Q===A.current.cm.getOption("mode")&&!!a===A.current.cm.getOption("readOnly")&&f===A.current.cm.getOption("lineNumbers")&&m===A.current.cm.getOption("lineWrapping")&&w===A.current.cm.getOption("placeholder"))return;(O=(I=A.current)==null?void 0:I.cm)==null||O.getWrapperElement().remove();const j=V(K,{value:"",mode:Q,readOnly:!!a,lineNumbers:f,lineWrapping:m,placeholder:w,matchBrackets:!0,autoCloseBrackets:!0,extraKeys:{"Ctrl-F":"findPersistent","Cmd-F":"findPersistent"}});return A.current={cm:j},d&&j.focus(),H(j),j})()},[_,C,x,e,i,r,f,m,a,d,w]),R.useEffect(()=>{A.current&&A.current.cm.setSize(E.width,E.height)},[E]),R.useLayoutEffect(()=>{var Q;if(!C)return;let V=!1;if(C.getValue()!==n&&(C.setValue(n),V=!0,g&&(C.execCommand("selectAll"),C.focus())),V||JSON.stringify(o)!==JSON.stringify(A.current.highlight)){for(const O of A.current.highlight||[])C.removeLineClass(O.line-1,"wrap");for(const O of o||[])C.addLineClass(O.line-1,"wrap",`source-line-${O.type}`);for(const O of A.current.widgets||[])C.removeLineWidget(O);for(const O of A.current.markers||[])O.clear();const j=[],I=[];for(const O of o||[]){if(O.type!=="subtle-error"&&O.type!=="error")continue;const P=(Q=A.current)==null?void 0:Q.cm.getLine(O.line-1);if(P){const J={};J.title=O.message||"",I.push(C.markText({line:O.line-1,ch:0},{line:O.line-1,ch:O.column||P.length},{className:"source-line-error-underline",attributes:J}))}if(O.type==="error"){const J=document.createElement("div");J.innerHTML=sl(O.message||"",{bg:"var(--vscode-inputValidation-errorBackground)",fg:"var(--vscode-editor-foreground)"}),J.className="source-line-error-widget",j.push(C.addLineWidget(O.line,J,{above:!0,coverGutter:!1}))}}A.current.highlight=o,A.current.widgets=j,A.current.markers=I}typeof u=="number"&&A.current.cm.lineCount()>=u&&C.scrollIntoView({line:Math.max(0,u-1),ch:0},50);let K;return y&&(K=()=>y(C.getValue()),C.on("change",K)),()=>{K&&C.off("change",K)}},[C,n,o,u,g,y]),b.jsx("div",{"data-testid":S,className:"cm-wrapper",ref:x,onClick:G_})};function G_(n){var i;if(!(n.target instanceof HTMLElement))return;let e;n.target.classList.contains("cm-linkified")?e=n.target.textContent:n.target.classList.contains("cm-link")&&((i=n.target.nextElementSibling)!=null&&i.classList.contains("cm-url"))&&(e=n.target.nextElementSibling.textContent.slice(1,-1)),e&&(n.preventDefault(),n.stopPropagation(),window.open(e,"_blank"))}let Sb=!1;function K_(n){Sb||(Sb=!0,n.defineSimpleMode("text/linkified",{start:[{regex:h0,token:"linkified"}]}))}function X_(n){if(n){if(n.includes("javascript")||n.includes("json"))return"javascript";if(n.includes("python"))return"python";if(n.includes("csharp"))return"text/x-csharp";if(n.includes("java"))return"text/x-java";if(n.includes("markdown"))return"markdown";if(n.includes("html")||n.includes("svg"))return"htmlmixed";if(n.includes("css"))return"css"}}function Y_(n){if(n)return{javascript:"javascript",jsonl:"javascript",python:"python",csharp:"text/x-csharp",java:"text/x-java",markdown:"markdown",html:"htmlmixed",css:"css",yaml:"yaml"}[n]}function F_(n){return!!n.match(/^(application\/json|application\/.*?\+json|text\/(x-)?json)(;\s*charset=.*)?$/)}function Q_(n){return!!n.match(/^(application\/xml|application\/.*?\+xml|text\/xml)(;\s*charset=.*)?$/)}function P_(n){return!!n.match(/^(text\/.*?|application\/(json|(x-)?javascript|xml.*?|ecmascript|graphql|x-www-form-urlencoded)|image\/svg(\+xml)?|application\/.*?(\+json|\+xml))(;\s*charset=.*)?$/)}const Q0=({title:n,children:e,setExpanded:i,expanded:r,expandOnTitleClick:a,className:o})=>{const u=R.useId(),f=R.useId(),d=R.useCallback(()=>i(!r),[r,i]),g=b.jsx("div",{className:ut("codicon",r?"codicon-chevron-down":"codicon-chevron-right"),style:{cursor:"pointer",color:"var(--vscode-foreground)",marginLeft:"5px"},onClick:a?void 0:d});return b.jsxs("div",{className:ut("expandable",r&&"expanded",o),children:[a?b.jsxs("div",{id:u,role:"button","aria-expanded":r,"aria-controls":f,className:"expandable-title",onClick:d,children:[g,n]}):b.jsxs("div",{className:"expandable-title",children:[g,n]}),r&&b.jsx("div",{id:f,"aria-labelledby":u,role:"region",className:"expandable-content",children:e})]})};function P0(n){const e=[];let i=0,r;for(;(r=h0.exec(n))!==null;){const o=n.substring(i,r.index);o&&e.push(o);const u=r[0];e.push(J_(u)),i=r.index+u.length}const a=n.substring(i);return a&&e.push(a),e}function J_(n){let e=n;return e.startsWith("www.")&&(e="https://"+e),b.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",children:n})}const J0=R.createContext(void 0),Ln=()=>R.useContext(J0),Z_=({attachment:n,reveal:e})=>{const i=Ln(),[r,a]=R.useState(!1),[o,u]=R.useState(null),[f,d]=R.useState(null),[g,m]=_x(),y=R.useRef(null),S=P_(n.contentType),w=!!n.sha1||!!n.path;R.useEffect(()=>{var _;if(e)return(_=y.current)==null||_.scrollIntoView({behavior:"smooth"}),m()},[e,m]),R.useEffect(()=>{r&&o===null&&f===null&&(d("Loading ..."),fetch(wc(i,n)).then(_=>_.text()).then(_=>{u(_),d(null)}).catch(_=>{d("Failed to load: "+_.message)}))},[i,r,o,f,n]);const E=R.useMemo(()=>{const _=o?o.split(`
`).length:0;return Math.min(Math.max(5,_),20)*V_},[o]),x=b.jsxs("span",{style:{marginLeft:5},ref:y,"aria-label":n.name,children:[b.jsx("span",{children:P0(n.name)}),w&&b.jsx("a",{style:{marginLeft:5},href:Jo(i,n),children:"download"})]});return!S||!w?b.jsx("div",{style:{marginLeft:20},children:x}):b.jsxs("div",{className:ut(g&&"yellow-flash"),children:[b.jsx(Q0,{title:x,expanded:r,setExpanded:a,expandOnTitleClick:!0,children:f&&b.jsx("i",{children:f})}),r&&o!==null&&b.jsx("div",{className:"vbox",style:{height:E},children:b.jsx(ds,{text:o,readOnly:!0,mimeType:n.contentType,linkify:!0,lineNumbers:!0,wrapLines:!1})})]})},W_=({revealedAttachmentCallId:n})=>{const e=Ln(),{diffMap:i,screenshots:r,attachments:a}=R.useMemo(()=>{const o=new Set((e==null?void 0:e.visibleAttachments)??[]),u=new Set,f=new Map;for(const d of o){if(!d.path&&!d.sha1)continue;const g=d.name.match(/^(.*)-(expected|actual|diff)\.png$/);if(g){const m=g[1],y=g[2],S=f.get(m)||{expected:void 0,actual:void 0,diff:void 0};S[y]=d,f.set(m,S),o.delete(d)}else d.contentType.startsWith("image/")&&(u.add(d),o.delete(d))}return{diffMap:f,attachments:o,screenshots:u}},[e]);return!i.size&&!r.size&&!a.size?b.jsx(ai,{text:"No attachments"}):b.jsxs("div",{className:"attachments-tab",children:[[...i.values()].map(({expected:o,actual:u,diff:f})=>b.jsxs(b.Fragment,{children:[o&&u&&b.jsx("div",{className:"attachments-section",children:"Image diff"}),o&&u&&b.jsx(H_,{noTargetBlank:!0,diff:{name:"Image diff",expected:{attachment:{...o,path:Jo(e,o)},title:"Expected"},actual:{attachment:{...u,path:Jo(e,u)}},diff:f?{attachment:{...f,path:Jo(e,f)}}:void 0}})]})),r.size?b.jsx("div",{className:"attachments-section",children:"Screenshots"}):void 0,[...r.values()].map((o,u)=>{const f=wc(e,o);return b.jsxs("div",{className:"attachment-item",children:[b.jsx("div",{children:b.jsx("img",{draggable:"false",src:f})}),b.jsx("div",{children:b.jsx("a",{target:"_blank",href:f,rel:"noreferrer",children:o.name})})]},`screenshot-${u}`)}),a.size?b.jsx("div",{className:"attachments-section",children:"Attachments"}):void 0,[...a.values()].map((o,u)=>b.jsx("div",{className:"attachment-item",children:b.jsx(Z_,{attachment:o,reveal:n&&o.callId===n.callId?n:void 0})},eE(o,u)))]})};function wc(n,e){return n&&e.sha1?n.createRelativeUrl(`sha1/${e.sha1}`):`file?path=${encodeURIComponent(e.path)}`}function Jo(n,e){let i=e.contentType?`&dn=${encodeURIComponent(e.name)}`:"";return e.contentType&&(i+=`&dct=${encodeURIComponent(e.contentType)}`),wc(n,e)+i}function eE(n,e){return e+"-"+(n.sha1?"sha1-"+n.sha1:"path-"+n.path)}const tE=({prompt:n})=>b.jsx(Po,{value:n,description:"Copy prompt",copiedDescription:b.jsxs(b.Fragment,{children:["Copied ",b.jsx("span",{className:"codicon codicon-copy",style:{marginLeft:"5px"}})]}),style:{width:"120px",justifyContent:"center"}});function nE(n){return R.useMemo(()=>{if(!n)return{errors:new Map};const e=new Map;for(const i of n.errorDescriptors)e.set(i.message,i);return{errors:e}},[n])}function iE({message:n,error:e,sdkLanguage:i,revealInSource:r}){var f;let a,o;const u=(f=e.stack)==null?void 0:f[0];return u&&(a=u.file.replace(/.*[/\\](.*)/,"$1")+":"+u.line,o=u.file+":"+u.line),b.jsxs("div",{style:{display:"flex",flexDirection:"column",overflowX:"clip"},children:[b.jsxs("div",{className:"hbox",style:{alignItems:"center",padding:"5px 10px",minHeight:36,fontWeight:"bold",color:"var(--vscode-errorForeground)",flex:0},children:[e.action&&od(e.action,{sdkLanguage:i}),a&&b.jsxs("div",{className:"action-location",children:["@ ",b.jsx("span",{title:o,onClick:()=>r(e),children:a})]})]}),b.jsx(z_,{error:n})]})}const sE=({errorsModel:n,sdkLanguage:e,revealInSource:i,wallTime:r,testRunMetadata:a})=>{const o=Ln(),u=yc(async()=>{const f=o==null?void 0:o.attachments.find(g=>g.name==="error-context");if(!f)return;let d=await fetch(wc(o,f)).then(g=>g.text());if(d)return a!=null&&a.gitDiff&&(d+=`

# Local changes

\`\`\`diff
`+a.gitDiff+"\n```"),d},[o,a],void 0);return n.errors.size?b.jsxs("div",{className:"fill",style:{overflow:"auto"},children:[b.jsx("span",{style:{position:"absolute",right:"5px",top:"5px",zIndex:1},children:u&&b.jsx(tE,{prompt:u})}),[...n.errors.entries()].map(([f,d])=>{const g=`error-${r}-${f}`;return b.jsx(iE,{message:f,error:d,revealInSource:i,sdkLanguage:e},g)})]}):b.jsx(ai,{text:"No errors"})},rE=hl,Da={log:{bg:"var(--vscode-editor-background)",fg:"var(--vscode-editor-foreground)"},warning:{fg:"var(--vscode-list-warningForeground)",bg:"var(--vscode-inputValidation-warningBackground)"},error:{fg:"var(--vscode-list-errorForeground)",bg:"var(--vscode-inputValidation-errorBackground)"}};function aE(n,e,i){const{entries:r}=R.useMemo(()=>{if(!n)return{entries:[]};const o=[];function u(d){var y,S,w,E,x,_;const g=o[o.length-1];g&&((y=d.browserMessage)==null?void 0:y.bodyString)===((S=g.browserMessage)==null?void 0:S.bodyString)&&((w=d.browserMessage)==null?void 0:w.location)===((E=g.browserMessage)==null?void 0:E.location)&&d.browserError===g.browserError&&((x=d.nodeMessage)==null?void 0:x.html)===((_=g.nodeMessage)==null?void 0:_.html)&&d.isError===g.isError&&d.isWarning===g.isWarning&&d.timestamp-g.timestamp<1e3?g.repeat++:o.push({...d,repeat:1})}const f=[...n.events,...n.stdio].sort((d,g)=>{const m="time"in d?d.time:d.timestamp,y="time"in g?g.time:g.timestamp;return m-y});for(const d of f){if(d.type==="console"){const g=d.messageType==="error"?Da.error:d.messageType==="warning"?Da.warning:Da.log,m=d.args&&d.args.length?oE(d.args,g):Z0(d.text,g),y=d.location.url,w=`${y?y.substring(y.lastIndexOf("/")+1):"<anonymous>"}:${d.location.lineNumber}`;u({browserMessage:{body:m,bodyString:d.text,location:w},isError:d.messageType==="error",isWarning:d.messageType==="warning",timestamp:d.time})}if(d.type==="event"&&d.method==="pageError"&&u({browserError:d.params.error,isError:!0,isWarning:!1,timestamp:d.time}),d.type==="stderr"||d.type==="stdout"){let g="";const m=d.type==="stderr"?Da.error:Da.log;d.text&&(g=sl(d.text.trim(),m)||""),d.base64&&(g=sl(atob(d.base64).trim(),m)||""),u({nodeMessage:{html:g},isError:d.type==="stderr",isWarning:!1,timestamp:d.timestamp})}}return{entries:o}},[n,i]);return{entries:R.useMemo(()=>e?r.filter(o=>o.timestamp>=e.minimum&&o.timestamp<=e.maximum):r,[r,e])}}const lE=({consoleModel:n,boundaries:e,onEntryHovered:i,onAccepted:r})=>n.entries.length?b.jsx("div",{className:"console-tab",children:b.jsx(rE,{name:"console",onAccepted:r,onHighlighted:a=>i==null?void 0:i(a?{minimum:a.timestamp,maximum:a.timestamp}:void 0),items:n.entries,isError:a=>a.isError,isWarning:a=>a.isWarning,render:a=>{const o=yt(a.timestamp-e.minimum),u=b.jsx("span",{className:"console-time",children:o}),f=a.isError?"status-error":a.isWarning?"status-warning":"status-none",d=a.browserMessage||a.browserError?b.jsx("span",{className:ut("codicon","codicon-browser",f),title:"Browser message"}):b.jsx("span",{className:ut("codicon","codicon-file",f),title:"Runner message"});let g,m,y,S;const{browserMessage:w,browserError:E,nodeMessage:x}=a;if(w&&(g=w.location,m=w.body),E){const{error:_,value:A}=E;_?(m=_.message,S=_.stack):m=String(A)}return x&&(y=x.html),b.jsxs("div",{className:"console-line",children:[u,d,g&&b.jsx("span",{className:"console-location",children:g}),a.repeat>1&&b.jsx("span",{className:"console-repeat",children:a.repeat}),m&&b.jsx("span",{className:"console-line-message",children:m}),y&&b.jsx("span",{className:"console-line-message",dangerouslySetInnerHTML:{__html:y}}),S&&b.jsx("div",{className:"console-stack",children:S})]})}})}):b.jsx(ai,{text:"No console entries"});function oE(n,e){if(n.length===1)return Z0(n[0].preview,e);const i=typeof n[0].value=="string"&&n[0].value.includes("%"),r=i?n[0].value:"",a=i?n.slice(1):n;let o=0;const u=/%([%sdifoOc])/g;let f;const d=[];let g=[];d.push(b.jsx("span",{children:g},d.length+1));let m=0;for(;(f=u.exec(r))!==null;){const y=r.substring(m,f.index);g.push(b.jsx("span",{children:y},g.length+1)),m=f.index+2;const S=f[0][1];if(S==="%")g.push(b.jsx("span",{children:"%"},g.length+1));else if(S==="s"||S==="o"||S==="O"||S==="d"||S==="i"||S==="f"){const w=a[o++],E={};typeof(w==null?void 0:w.value)!="string"&&(E.color="var(--vscode-debugTokenExpression-number)"),g.push(b.jsx("span",{style:E,children:(w==null?void 0:w.preview)||""},g.length+1))}else if(S==="c"){g=[];const w=a[o++],E=w?cE(w.preview):{};d.push(b.jsx("span",{style:E,children:g},d.length+1))}}for(m<r.length&&g.push(b.jsx("span",{children:r.substring(m)},g.length+1));o<a.length;o++){const y=a[o],S={};g.length&&g.push(b.jsx("span",{children:" "},g.length+1)),typeof(y==null?void 0:y.value)!="string"&&(S.color="var(--vscode-debugTokenExpression-number)"),g.push(b.jsx("span",{style:S,children:(y==null?void 0:y.preview)||""},g.length+1))}return d}function Z0(n,e){return[b.jsx("span",{dangerouslySetInnerHTML:{__html:sl(n.trim(),e)}})]}function cE(n){try{const e={},i=n.split(";");for(const r of i){const a=r.trim();if(!a)continue;let[o,u]=a.split(":");if(o=o.trim(),u=u.trim(),!uE(o))continue;const f=o.replace(/-([a-z])/g,d=>d[1].toUpperCase());e[f]=u}return e}catch{return{}}}function uE(n){return["background","border","color","font","line","margin","padding","text"].some(i=>n.startsWith(i))}const dl=({noShadow:n,children:e,noMinHeight:i,className:r,sidebarBackground:a,onClick:o})=>b.jsx("div",{className:ut("toolbar",n&&"no-shadow",i&&"no-min-height",r,a&&"toolbar-sidebar-background"),onClick:o,children:e}),oc=({tabs:n,selectedTab:e,setSelectedTab:i,leftToolbar:r,rightToolbar:a,dataTestId:o,mode:u})=>{const f=R.useId(),d=R.useRef(null);e||(e=n[0].id),u||(u="default");const g=m=>{var E;const y=Array.from(((E=d.current)==null?void 0:E.querySelectorAll('[role="tab"]'))??[]),S=y.findIndex(x=>x===document.activeElement);if(S===-1)return;let w=S;if(m.key==="ArrowRight")w=(S+1)%y.length;else if(m.key==="ArrowLeft")w=(S-1+y.length)%y.length;else if(m.key==="Home")w=0;else if(m.key==="End")w=y.length-1;else return;m.preventDefault(),y[w].focus(),i==null||i(n[w].id)};return b.jsx("div",{className:"tabbed-pane","data-testid":o,children:b.jsxs("div",{className:"vbox",children:[b.jsxs(dl,{children:[r&&b.jsxs("div",{style:{flex:"none",display:"flex",margin:"0 4px",alignItems:"center"},children:[...r]}),u==="default"&&b.jsx("div",{style:{flex:"auto",display:"flex",height:"100%",overflow:"hidden"},role:"tablist",onKeyDown:g,ref:d,children:[...n.map(m=>b.jsx(W0,{id:m.id,ariaControls:`${f}-${m.id}`,title:m.title,count:m.count,errorCount:m.errorCount,selected:e===m.id,onSelect:i,tabIndex:e===m.id?0:-1},m.id))]}),u==="select"&&b.jsx("div",{style:{flex:"auto",display:"flex",height:"100%",overflow:"hidden"},role:"tablist",children:b.jsx("select",{style:{width:"100%",background:"none",cursor:"pointer"},value:e,onChange:m=>{i==null||i(n[m.currentTarget.selectedIndex].id)},children:n.map(m=>{let y="";return m.count&&(y=` (${m.count})`),m.errorCount&&(y=` (${m.errorCount})`),b.jsxs("option",{value:m.id,role:"tab","aria-controls":`${f}-${m.id}`,children:[m.title,y]},m.id)})})}),a&&b.jsxs("div",{style:{flex:"none",display:"flex",alignItems:"center"},children:[...a]})]}),n.map(m=>{const y="tab-content tab-"+m.id;if(m.component)return b.jsx("div",{id:`${f}-${m.id}`,role:"tabpanel","aria-label":m.title,className:y,style:{display:e===m.id?"inherit":"none"},children:m.component},m.id);if(e===m.id)return b.jsx("div",{id:`${f}-${m.id}`,role:"tabpanel","aria-label":m.title,className:y,children:m.render()},m.id)})]})})},W0=({id:n,title:e,count:i,errorCount:r,selected:a,onSelect:o,ariaControls:u,tabIndex:f})=>b.jsxs("div",{className:ut("tabbed-pane-tab",a&&"selected"),onClick:()=>o==null?void 0:o(n),role:"tab",title:e,tabIndex:f??(a?0:-1),"aria-controls":u,"aria-selected":a,children:[b.jsx("div",{className:"tabbed-pane-tab-label",children:e}),!!i&&b.jsx("div",{className:"tabbed-pane-tab-counter",children:i}),!!r&&b.jsx("div",{className:"tabbed-pane-tab-counter error",children:r})]});async function fE(n,e){const i=navigator.platform.includes("Win")?"win":"unix";let r=[];const a=new Set(["accept-encoding","host","method","path","scheme","version","authority","protocol"]);function o(S){return'^"'+S.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/[^a-zA-Z0-9\s_\-:=+~'\/.',?;()*`]/g,"^$&").replace(/%(?=[a-zA-Z0-9_])/g,"%^").replace(/[^ -~\r\n]/g," ").replace(/\r?\n|\r/g,`^

`)+'^"'}function u(S){function w(E){let _=E.charCodeAt(0).toString(16);for(;_.length<4;)_="0"+_;return"\\u"+_}return/[\0-\x1F\x7F-\x9F!]|\'/.test(S)?"$'"+S.replace(/\\/g,"\\\\").replace(/\'/g,"\\'").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\0-\x1F\x7F-\x9F!]/g,w)+"'":"'"+S+"'"}const f=i==="win"?o:u;r.push(f(e.request.url).replace(/[[{}\]]/g,"\\$&"));let d="GET";const g=[],m=await ev(n,e);m&&(g.push("--data-raw "+f(m)),a.add("content-length"),d="POST"),e.request.method!==d&&r.push("-X "+f(e.request.method));const y=e.request.headers;for(let S=0;S<y.length;S++){const w=y[S],E=w.name.replace(/^:/,"");if(a.has(E.toLowerCase()))continue;const x=w.value;x.trim()?E.toLowerCase()==="cookie"?r.push("-b "+f(x)):r.push("-H "+f(E+": "+x)):r.push("-H "+f(E+";"))}return r=r.concat(g),"curl "+r.join(r.length>=3?i==="win"?` ^
  `:` \\
  `:" ")}async function hE(n,e,i=0){const r=new Set(["method","path","scheme","version","accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","via","user-agent"]),a=new Set(["cookie","authorization"]),o=JSON.stringify(e.request.url),u=e.request.headers,f=u.reduce((x,_)=>{const A=_.name;return!r.has(A.toLowerCase())&&!A.includes(":")&&x.append(A,_.value),x},new Headers),d={};for(const x of f)d[x[0]]=x[1];const g=e.request.cookies.length||u.some(({name:x})=>a.has(x.toLowerCase()))?"include":"omit",m=u.find(({name:x})=>x.toLowerCase()==="referer"),y=m?m.value:void 0,S=await ev(n,e),w={headers:Object.keys(d).length?d:void 0,referrer:y,body:S,method:e.request.method,mode:"cors"};if(i===1){const x=u.find(A=>A.name.toLowerCase()==="cookie"),_={};delete w.mode,x&&(_.cookie=x.value),y&&(delete w.referrer,_.Referer=y),Object.keys(_).length&&(w.headers={...d,..._})}else w.credentials=g;const E=JSON.stringify(w,null,2);return`fetch(${o}, ${E});`}async function ev(n,e){var i,r;return n&&((i=e.request.postData)!=null&&i._sha1)?await fetch(n.createRelativeUrl(`sha1/${e.request.postData._sha1}`)).then(a=>a.text()):(r=e.request.postData)==null?void 0:r.text}class dE{generatePlaywrightRequestCall(e,i){let r=e.method.toLowerCase();const a=new URL(e.url),o=`${a.origin}${a.pathname}`,u={};["delete","get","head","post","put","patch"].includes(r)||(u.method=r,r="fetch"),a.searchParams.size&&(u.params=Object.fromEntries(a.searchParams.entries())),i&&(u.data=i),e.headers.length&&(u.headers=Object.fromEntries(e.headers.map(g=>[g.name,g.value])));const f=[`'${o}'`];return Object.keys(u).length>0&&f.push(this.prettyPrintObject(u)),`await page.request.${r}(${f.join(", ")});`}prettyPrintObject(e,i=2,r=0){if(e===null)return"null";if(e===void 0)return"undefined";if(typeof e!="object")return typeof e=="string"?this.stringLiteral(e):String(e);if(Array.isArray(e)){if(e.length===0)return"[]";const f=" ".repeat(r*i),d=" ".repeat((r+1)*i);return`[
${e.map(m=>`${d}${this.prettyPrintObject(m,i,r+1)}`).join(`,
`)}
${f}]`}if(Object.keys(e).length===0)return"{}";const a=" ".repeat(r*i),o=" ".repeat((r+1)*i);return`{
${Object.entries(e).map(([f,d])=>{const g=this.prettyPrintObject(d,i,r+1),m=/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(f)?f:this.stringLiteral(f);return`${o}${m}: ${g}`}).join(`,
`)}
${a}}`}stringLiteral(e){return e=e.replace(/\\/g,"\\\\").replace(/'/g,"\\'"),e.includes(`
`)||e.includes("\r")||e.includes("	")?"`"+e+"`":`'${e}'`}}class pE{generatePlaywrightRequestCall(e,i){const r=new URL(e.url),o=[`"${`${r.origin}${r.pathname}`}"`];let u=e.method.toLowerCase();["delete","get","head","post","put","patch"].includes(u)||(o.push(`method="${u}"`),u="fetch"),r.searchParams.size&&o.push(`params=${this.prettyPrintObject(Object.fromEntries(r.searchParams.entries()))}`),i&&o.push(`data=${this.prettyPrintObject(i)}`),e.headers.length&&o.push(`headers=${this.prettyPrintObject(Object.fromEntries(e.headers.map(d=>[d.name,d.value])))}`);const f=o.length===1?o[0]:`
${o.map(d=>this.indent(d,2)).join(`,
`)}
`;return`await page.request.${u}(${f})`}indent(e,i){return e.split(`
`).map(r=>" ".repeat(i)+r).join(`
`)}prettyPrintObject(e,i=2,r=0){if(e===null||e===void 0)return"None";if(typeof e!="object")return typeof e=="string"?this.stringLiteral(e):typeof e=="boolean"?e?"True":"False":String(e);if(Array.isArray(e)){if(e.length===0)return"[]";const f=" ".repeat(r*i),d=" ".repeat((r+1)*i);return`[
${e.map(m=>`${d}${this.prettyPrintObject(m,i,r+1)}`).join(`,
`)}
${f}]`}if(Object.keys(e).length===0)return"{}";const a=" ".repeat(r*i),o=" ".repeat((r+1)*i);return`{
${Object.entries(e).map(([f,d])=>{const g=this.prettyPrintObject(d,i,r+1);return`${o}${this.stringLiteral(f)}: ${g}`}).join(`,
`)}
${a}}`}stringLiteral(e){return JSON.stringify(e)}}class gE{generatePlaywrightRequestCall(e,i){const r=new URL(e.url),a=`${r.origin}${r.pathname}`,o={},u=[];let f=e.method.toLowerCase();["delete","get","head","post","put","patch"].includes(f)||(o.Method=f,f="fetch"),r.searchParams.size&&(o.Params=Object.fromEntries(r.searchParams.entries())),i&&(o.Data=i),e.headers.length&&(o.Headers=Object.fromEntries(e.headers.map(m=>[m.name,m.value])));const d=[`"${a}"`];return Object.keys(o).length>0&&d.push(this.prettyPrintObject(o)),`${u.join(`
`)}${u.length?`
`:""}await request.${this.toFunctionName(f)}(${d.join(", ")});`}toFunctionName(e){return e[0].toUpperCase()+e.slice(1)+"Async"}prettyPrintObject(e,i=2,r=0){if(e===null||e===void 0)return"null";if(typeof e!="object")return typeof e=="string"?this.stringLiteral(e):typeof e=="boolean"?e?"true":"false":String(e);if(Array.isArray(e)){if(e.length===0)return"new object[] {}";const f=" ".repeat(r*i),d=" ".repeat((r+1)*i);return`new object[] {
${e.map(m=>`${d}${this.prettyPrintObject(m,i,r+1)}`).join(`,
`)}
${f}}`}if(Object.keys(e).length===0)return"new {}";const a=" ".repeat(r*i),o=" ".repeat((r+1)*i);return`new() {
${Object.entries(e).map(([f,d])=>{const g=this.prettyPrintObject(d,i,r+1),m=r===0?f:`[${this.stringLiteral(f)}]`;return`${o}${m} = ${g}`}).join(`,
`)}
${a}}`}stringLiteral(e){return JSON.stringify(e)}}class mE{generatePlaywrightRequestCall(e,i){const r=new URL(e.url),a=[`"${r.origin}${r.pathname}"`],o=[];let u=e.method.toLowerCase();["delete","get","head","post","put","patch"].includes(u)||(o.push(`setMethod("${u}")`),u="fetch");for(const[f,d]of r.searchParams)o.push(`setQueryParam(${this.stringLiteral(f)}, ${this.stringLiteral(d)})`);i&&o.push(`setData(${this.stringLiteral(i)})`);for(const f of e.headers)o.push(`setHeader(${this.stringLiteral(f.name)}, ${this.stringLiteral(f.value)})`);return o.length>0&&a.push(`RequestOptions.create()
  .${o.join(`
  .`)}
`),`request.${u}(${a.join(", ")});`}stringLiteral(e){return JSON.stringify(e)}}function yE(n){if(n==="javascript")return new dE;if(n==="python")return new pE;if(n==="csharp")return new gE;if(n==="java")return new mE;throw new Error("Unsupported language: "+n)}const bE=({resource:n,sdkLanguage:e,startTimeOffset:i,onClose:r})=>{const[a,o]=R.useState("headers"),u=Ln(),f=yc(async()=>{if(u&&n.request.postData){const d=n.request.headers.find(m=>m.name.toLowerCase()==="content-type"),g=d?d.value:"";return n.request.postData._sha1?{text:await(await fetch(u.createRelativeUrl(`sha1/${n.request.postData._sha1}`))).text(),mimeType:g}:{text:n.request.postData.text,mimeType:g}}else return null},[n],null);return b.jsx(oc,{leftToolbar:[b.jsx(ct,{icon:"close",title:"Close",onClick:r},"close")],rightToolbar:[b.jsx(vE,{requestBody:f,resource:n,sdkLanguage:e},"dropdown")],tabs:[{id:"headers",title:"Headers",render:()=>b.jsx(tv,{resource:n,startTimeOffset:i})},{id:"payload",title:"Payload",render:()=>b.jsx(SE,{resource:n,requestBody:f})},{id:"response",title:"Response",render:()=>b.jsx(wE,{resource:n})}],selectedTab:a,setSelectedTab:o})},vE=({resource:n,sdkLanguage:e,requestBody:i})=>{const r=Ln(),a=b.jsxs(b.Fragment,{children:[b.jsx("span",{className:"codicon codicon-check",style:{marginRight:"5px"}})," Copied "]}),o=async()=>yE(e).generatePlaywrightRequestCall(n.request,i==null?void 0:i.text);return b.jsxs("div",{className:"copy-request-dropdown",children:[b.jsxs(ct,{className:"copy-request-dropdown-toggle",children:[b.jsx("span",{className:"codicon codicon-copy",style:{marginRight:"5px"}}),"Copy request",b.jsx("span",{className:"codicon codicon-chevron-down",style:{marginLeft:"5px"}})]}),b.jsxs("div",{className:"copy-request-dropdown-menu",children:[b.jsx(Po,{description:"Copy as cURL",copiedDescription:a,value:()=>fE(r,n)}),b.jsx(Po,{description:"Copy as Fetch",copiedDescription:a,value:()=>hE(r,n)}),b.jsx(Po,{description:"Copy as Playwright",copiedDescription:a,value:o})]})]})},fd=({toggled:n,error:e,onToggle:i})=>b.jsx(ct,{icon:"json",title:"Pretty print",toggled:n,errorBadge:e?"Formatting failed":void 0,onClick:r=>{r.stopPropagation(),i()}}),Pa=({title:n,data:e,showCount:i,children:r,titleChildren:a,className:o})=>{const[u,f]=jt(`trace-viewer-network-details-${n.replaceAll(" ","-")}`,!0);return b.jsxs(Q0,{expanded:u,setExpanded:f,expandOnTitleClick:!0,title:b.jsxs(b.Fragment,{children:[b.jsxs("span",{className:"network-request-details-header",children:[n,i&&b.jsxs("span",{className:"network-request-details-header-count",children:[" Ã— ",(e==null?void 0:e.length)??0]})]}),a]}),className:o,children:[e&&b.jsx("table",{className:"network-request-details-table",children:b.jsx("tbody",{children:e.map(({name:d,value:g},m)=>g!==null&&b.jsxs("tr",{children:[b.jsx("td",{children:d}),b.jsx("td",{children:g})]},m))})}),r]})},tv=({resource:n,startTimeOffset:e})=>{const i=R.useMemo(()=>Object.entries({URL:n.request.url,Method:n.request.method,"Status Code":n.response.status===-1?"canceled":n.response.status>0&&b.jsxs("span",{className:kE(n.response.status),children:[" ",n.response.status," ",n.response.statusText]}),Start:yt(e),Duration:yt(n.time)}).map(([r,a])=>({name:r,value:a})),[n,e]);return b.jsxs("div",{className:"vbox network-request-details-tab",children:[b.jsx(Pa,{title:"General",data:i}),b.jsx(Pa,{title:"Request Headers",showCount:!0,data:n.request.headers}),b.jsx(Pa,{title:"Response Headers",showCount:!0,data:n.response.headers})]})},SE=({resource:n,requestBody:e})=>{const[i,r]=jt("trace-viewer-network-details-show-formatted-payload",!0),a=n.request.queryString.length>0,o=!!(e||n.request.postData),u=hd(e,i);return b.jsxs("div",{className:"vbox network-request-details-tab",children:[!a&&!o&&b.jsx("em",{className:"network-request-no-payload",children:"No payload for this request."}),a&&b.jsx(Pa,{title:"Query String Parameters",showCount:!0,data:n.request.queryString}),e&&b.jsx(Pa,{title:"Request Body",className:"network-request-request-body",titleChildren:b.jsxs(b.Fragment,{children:[b.jsx("div",{style:{margin:"auto"}}),b.jsx(fd,{toggled:i,error:u.error,onToggle:()=>r(!i)})]}),children:b.jsx(ds,{text:u.text,mimeType:e.mimeType,readOnly:!0,lineNumbers:!0})})]})},wE=({resource:n})=>{const e=Ln(),[i,r]=R.useState(null);R.useEffect(()=>{(async()=>{if(e&&n.response.content._sha1){const d=n.response.content.mimeType.includes("image"),g=n.response.content.mimeType.includes("font"),m=await fetch(e.createRelativeUrl(`sha1/${n.response.content._sha1}`));if(d){const y=await m.blob(),S=new FileReader,w=new Promise(E=>S.onload=E);S.readAsDataURL(y),r({dataUrl:(await w).target.result})}else if(g){const y=await m.arrayBuffer();r({font:y})}else r({text:await m.text(),mimeType:n.response.content.mimeType})}else r(null)})()},[n,e]);const[a,o]=jt("trace-viewer-network-details-show-formatted-response",!0),u=hd(i,a);return b.jsxs("div",{className:"vbox network-request-details-tab",children:[!n.response.content._sha1&&b.jsx("div",{children:"Response body is not available for this request."}),i&&i.font&&b.jsx(xE,{font:i.font}),i&&i.dataUrl&&b.jsx("div",{children:b.jsx("img",{draggable:"false",src:i.dataUrl})}),i&&i.text!==void 0&&b.jsxs("div",{className:"vbox network-response-body",children:[b.jsx(ds,{text:u.text,mimeType:i.mimeType,readOnly:!0,lineNumbers:!0}),b.jsxs(dl,{noShadow:!0,noMinHeight:!0,className:"network-response-toolbar",children:[b.jsx("div",{style:{margin:"auto"}}),b.jsx(fd,{toggled:a,error:u.error,onToggle:()=>o(!a)})]})]})]})},xE=({font:n})=>{const[e,i]=R.useState(!1);return R.useEffect(()=>{let r;try{r=new FontFace("font-preview",n),r.status==="loaded"&&document.fonts.add(r),r.status==="error"&&i(!0)}catch{i(!0)}return()=>{document.fonts.delete(r)}},[n]),e?b.jsx("div",{className:"network-font-preview-error",children:"Could not load font preview"}):b.jsxs("div",{className:"network-font-preview",children:["ABCDEFGHIJKLM",b.jsx("br",{}),"NOPQRSTUVWXYZ",b.jsx("br",{}),"abcdefghijklm",b.jsx("br",{}),"nopqrstuvwxyz",b.jsx("br",{}),"1234567890"]})},_E=({resource:n,startTimeOffset:e,onClose:i})=>{const[r,a]=R.useState("messages");return b.jsx(oc,{leftToolbar:[b.jsx(ct,{icon:"close",title:"Close",onClick:i},"close")],tabs:[{id:"headers",title:"Headers",render:()=>b.jsx(tv,{resource:n,startTimeOffset:e})},{id:"messages",title:"Messages",render:()=>b.jsx(EE,{resource:n})}],selectedTab:r,setSelectedTab:a})},EE=({resource:n})=>{const e=Ln(),i=yc(async()=>{if(n._webSocketMessages)return n._webSocketMessages.map((d,g)=>({...d,index:g,byteLength:Uh(d)}));if(e&&n.response.content._sha1)try{const d=await fetch(e.createRelativeUrl(`sha1/${n.response.content._sha1}`));return d.ok?(await d.text()).split(`
`).filter(Boolean).map(y=>JSON.parse(y)).map((y,S)=>({...y,index:S,byteLength:Uh(y)})):[]}catch{return[]}return[]},[n,e],void 0),[r,a]=R.useState(void 0),o=r!==void 0?i==null?void 0:i[r]:void 0,u=R.useMemo(()=>{if(i){for(const d of i)if(d.time>0)return d.time}},[i]);if(i===void 0)return b.jsx(ai,{text:"Loading..."});if(i.length===0)return b.jsx(ai,{text:"No messages captured"});const f=b.jsx(TE,{name:"network-websocket-messages",ariaLabel:"WebSocket messages",items:i,id:d=>String(d.index),selectedItem:o,onSelected:d=>a(d.index),render:d=>CE(d,u)});return o?b.jsx(il,{sidebarSize:200,orientation:"vertical",sidebarIsFirst:!1,settingName:"networkWebSocketMessageDetails",main:f,sidebar:b.jsx(AE,{message:o})}):f},TE=hl,AE=({message:n})=>{const[e,i]=jt("trace-viewer-network-details-show-formatted-message",!0),r=R.useMemo(()=>{if(n.opcode===1){const o=n.data;let u;try{JSON.parse(o),u="application/json"}catch{u="text/plain"}return{text:o,mimeType:u}}if(n.opcode===8||n.opcode===9||n.opcode===10){if(!n.data)return{text:""};try{return{text:LE(n.data),mimeType:"text/plain"}}catch{return{text:wb(n.data)}}}return{text:wb(n.data)}},[n]),a=hd(r,e);return b.jsxs("div",{className:"vbox network-websocket-message-detail",children:[b.jsxs(dl,{noShadow:!0,noMinHeight:!0,className:"network-websocket-message-detail-toolbar",children:[b.jsxs("span",{className:"network-websocket-message-detail-summary",children:[n.type==="send"?"Sent":"Received"," Â· ",nv(n.opcode)," Â· ",bc(Uh(n))]}),b.jsx("div",{style:{margin:"auto"}}),b.jsx(fd,{toggled:e,error:a.error,onToggle:()=>i(!e)})]}),b.jsx("div",{className:"vbox network-websocket-message-detail-body",children:b.jsx(ds,{text:a.text,mimeType:r.mimeType,readOnly:!0,lineNumbers:!0})})]})};function CE(n,e){const i=n.type==="send"?"codicon-arrow-up":"codicon-arrow-down",r=n.type==="send"?"Sent":"Received",a=nv(n.opcode),o=n.time>0&&e!==void 0?yt(n.time-e):"-",u=NE(n);return b.jsxs("div",{className:"network-websocket-message-row",children:[b.jsx("span",{className:`network-websocket-message-direction-${n.type} codicon ${i}`,title:r}),b.jsx("span",{className:"network-websocket-message-preview",title:u,children:u}),b.jsx("span",{className:"network-websocket-message-opcode",title:`Opcode ${n.opcode}`,children:a}),b.jsx("span",{className:"network-websocket-message-length",title:`${n.byteLength} bytes`,children:bc(n.byteLength)}),b.jsx("span",{className:"network-websocket-message-time",children:o})]})}function nv(n){switch(n){case 0:return"Continuation";case 1:return"Text";case 2:return"Binary";case 8:return"Close";case 9:return"Ping";case 10:return"Pong";default:return`Opcode ${n}`}}function Uh(n){return n.opcode===1?new TextEncoder().encode(n.data).length:iv(n.data)}function NE(n){if(n.opcode===1){const e=n.data.replace(/\s+/g," ");return e.length>200?e.substring(0,200)+"â€¦":e}return n.opcode===8?"(close)":n.opcode===9?"(ping)":n.opcode===10?"(pong)":`(binary, ${bc(iv(n.data))})`}function kE(n){return n<300||n===304?"green-circle":n<400?"yellow-circle":"red-circle"}const ME=/<[^>]+>[^<]*<\//;function OE(n,e="  "){let i=0;const r=[],a=n.replace(/>\s*</g,`>
<`).split(`
`);for(const o of a){const u=o.trim();u&&(u.startsWith("</")?(i=Math.max(i-1,0),r.push(e.repeat(i)+u)):u.endsWith("/>")||u.startsWith("<?")||ME.test(u)?r.push(e.repeat(i)+u):u.startsWith("<")?(r.push(e.repeat(i)+u),i++):r.push(e.repeat(i)+u))}return r.join(`
`)}function jE(n,e){return!n.trim()||!e?n:F_(e)?JSON.stringify(JSON.parse(n),null,2):Q_(e)?OE(n):e.includes("application/x-www-form-urlencoded")?decodeURIComponent(n):n}const hd=(n,e)=>R.useMemo(()=>{if((n==null?void 0:n.text)===void 0)return{text:""};if(!e)return{text:n.text};try{return{text:jE(n.text,n.mimeType)}}catch{return{text:n.text,error:!0}}},[n,e]);function iv(n){if(!n)return 0;const e=n[n.length-2]==="="?2:n[n.length-1]==="="?1:0;return Math.max(0,Math.floor(n.length*3/4)-e)}function LE(n){const e=atob(n),i=new Uint8Array(e.length);for(let r=0;r<e.length;++r)i[r]=e.charCodeAt(r);return new TextDecoder("utf-8",{fatal:!1}).decode(i)}function wb(n){if(!n)return"";const e=atob(n),i=[];for(let r=0;r<e.length;r+=16){const a=Math.min(16,e.length-r),o=[],u=[];for(let f=0;f<16;++f){if(f<a){const d=e.charCodeAt(r+f);o.push(d.toString(16).padStart(2,"0")),u.push(d>=32&&d<127?e[r+f]:".")}else o.push("  ");f===7&&o.push("")}i.push(`${r.toString(16).padStart(8,"0")}  ${o.join(" ")}  ${u.join("")}`)}return i.join(`
`)}function RE(n){const[e,i]=R.useState([]);R.useEffect(()=>{const o=[];for(let u=0;u<n.columns.length-1;++u){const f=n.columns[u];o[u]=(o[u-1]||0)+n.columnWidths.get(f)}i(o)},[n.columns,n.columnWidths]);function r(o){const u=new Map(n.columnWidths.entries());for(let f=0;f<o.length;++f){const d=o[f]-(o[f-1]||0),g=n.columns[f];u.set(g,d)}n.setColumnWidths(u)}const a=R.useCallback(o=>{var u,f;(f=n.setSorting)==null||f.call(n,{by:o,negate:((u=n.sorting)==null?void 0:u.by)===o?!n.sorting.negate:!1})},[n]);return b.jsxs("div",{className:`grid-view ${n.name}-grid-view`,children:[b.jsx(F0,{orientation:"horizontal",offsets:e,setOffsets:r,resizerColor:"var(--vscode-panel-border)",resizerWidth:1,minColumnWidth:25}),b.jsxs("div",{className:"vbox",children:[b.jsx("div",{className:"grid-view-header",children:n.columns.map((o,u)=>b.jsxs("div",{className:"grid-view-header-cell "+DE(o,n.sorting),style:{width:u<n.columns.length-1?n.columnWidths.get(o):void 0},onClick:()=>n.setSorting&&a(o),children:[b.jsx("span",{className:"grid-view-header-cell-title",children:n.columnTitle(o)}),b.jsx("span",{className:"codicon codicon-triangle-up"}),b.jsx("span",{className:"codicon codicon-triangle-down"})]},n.columnTitle(o)))}),b.jsx(hl,{name:n.name,items:n.items,ariaLabel:n.ariaLabel,id:n.id,render:(o,u)=>b.jsx(b.Fragment,{children:n.columns.map((f,d)=>{const{body:g,title:m}=n.render(o,f,u);return b.jsx("div",{className:`grid-view-cell grid-view-column-${String(f)}`,title:m,style:{width:d<n.columns.length-1?n.columnWidths.get(f):void 0},children:g},n.columnTitle(f))})}),icon:n.icon,isError:n.isError,isWarning:n.isWarning,isInfo:n.isInfo,selectedItem:n.selectedItem,onAccepted:n.onAccepted,onSelected:n.onSelected,onHighlighted:n.onHighlighted,onIconClicked:n.onIconClicked,noItemsMessage:n.noItemsMessage,dataTestId:n.dataTestId,notSelectable:n.notSelectable})]})]})}function DE(n,e){return n===(e==null?void 0:e.by)?" filter-"+(e.negate?"negative":"positive"):""}const zE=["Fetch","HTML","JS","CSS","Font","Image","WS"],UE={searchValue:"",resourceTypes:new Set},HE=({filterState:n,onFilterStateChange:e})=>b.jsxs("div",{className:"network-filters",children:[b.jsx("input",{type:"search",placeholder:"Filter network",spellCheck:!1,value:n.searchValue,onChange:i=>e({...n,searchValue:i.target.value})}),b.jsxs("div",{className:"network-filters-resource-types",role:"tablist","aria-multiselectable":"true",children:[b.jsx("div",{title:"All",onClick:()=>e({...n,resourceTypes:new Set}),className:`network-filters-resource-type ${n.resourceTypes.size===0?"selected":""}`,children:"All"}),zE.map(i=>b.jsx("div",{title:i,onClick:r=>{let a;r.ctrlKey||r.metaKey?a=n.resourceTypes.symmetricDifference(new Set([i])):a=new Set([i]),e({...n,resourceTypes:a})},className:`network-filters-resource-type ${n.resourceTypes.has(i)?"selected":""}`,role:"tab","aria-selected":n.resourceTypes.has(i),children:i},i))]})]}),BE=RE;function qE(n,e,i){const r=R.useMemo(()=>((n==null?void 0:n.resources)||[]).filter(f=>e?!!f._monotonicTime&&f._monotonicTime>=e.minimum&&f._monotonicTime<=e.maximum:!0),[n,e,i]),a=R.useMemo(()=>new XE(n),[n]);return{resources:r,contextIdMap:a}}const $E=({boundaries:n,networkModel:e,onResourceHovered:i,sdkLanguage:r})=>{const[a,o]=R.useState(void 0),[u,f]=R.useState(void 0),[d,g]=R.useState(UE),{renderedEntries:m}=R.useMemo(()=>{const _=e.resources.map(A=>YE(A,n,e.contextIdMap)).filter(WE(d));return a&&PE(_,a),{renderedEntries:_}},[e.resources,e.contextIdMap,d,a,n]),y=R.useMemo(()=>u?m.find(_=>_.resource.id===u):void 0,[u,m]),[S,w]=R.useState(()=>new Map(sv().map(_=>[_,VE(_)]))),E=R.useCallback(_=>{g(_),f(void 0)},[]);if(!e.resources.length)return b.jsx(ai,{text:"No network calls"});const x=b.jsx(BE,{name:"network",ariaLabel:"Network requests",items:m,selectedItem:y,onSelected:_=>f(_.resource.id),onHighlighted:_=>i==null?void 0:i(_?FE(_.resource):void 0),columns:GE(!!y,m),columnTitle:IE,columnWidths:S,setColumnWidths:w,isError:_=>_.status.code>=400||_.status.code===-1,isInfo:_=>!!_.route,render:(_,A)=>KE(_,A),sorting:a,setSorting:o});return b.jsxs(b.Fragment,{children:[b.jsx(HE,{filterState:d,onFilterStateChange:E}),!y&&x,y&&b.jsx(il,{sidebarSize:S.get("name"),sidebarIsFirst:!0,orientation:"horizontal",settingName:"networkResourceDetails",main:y.resource._resourceType==="websocket"?b.jsx(_E,{resource:y.resource,startTimeOffset:y.start,onClose:()=>f(void 0)}):b.jsx(bE,{resource:y.resource,sdkLanguage:r,startTimeOffset:y.start,onClose:()=>f(void 0)}),sidebar:x})]})},IE=n=>n==="contextId"?"Source":n==="name"?"Name":n==="method"?"Method":n==="status"?"Status":n==="contentType"?"Content Type":n==="duration"?"Duration":n==="size"?"Size":n==="start"?"Start":n==="route"?"Route":"",VE=n=>n==="name"?200:n==="method"||n==="status"?60:n==="contentType"?200:n==="contextId"?60:100;function GE(n,e){if(n){const r=["name"];return xb(e)&&r.unshift("contextId"),r}let i=sv();return xb(e)||(i=i.filter(r=>r!=="contextId")),i}function sv(){return["contextId","name","method","status","contentType","duration","size","start","route"]}const KE=(n,e)=>e==="contextId"?{body:n.contextId,title:n.name.url}:e==="name"?{body:n.name.name,title:n.name.url}:e==="method"?{body:n.method}:e==="status"?{body:n.status.code===-1?"canceled":n.status.code>0?n.status.code:"",title:n.status.code===-1?"canceled":n.status.text}:e==="contentType"?{body:n.contentType}:e==="duration"?{body:yt(n.duration)}:e==="size"?{body:bc(n.size)}:e==="start"?{body:yt(n.start)}:e==="route"?{body:n.route}:{body:""};class XE{constructor(e){this._pagerefToShortId=new Map,this._contextToId=new Map,this._lastPageId=0,this._lastApiRequestContextId=0}contextId(e){return e.pageref?this._pageId(e.pageref):e._apiRequest?this._apiRequestContextId(e):""}_pageId(e){let i=this._pagerefToShortId.get(e);return i||(++this._lastPageId,i="page#"+this._lastPageId,this._pagerefToShortId.set(e,i)),i}_apiRequestContextId(e){const i=S0(e);if(!i)return"";let r=this._contextToId.get(i);return r||(++this._lastApiRequestContextId,r="api#"+this._lastApiRequestContextId,this._contextToId.set(i,r)),r}}function xb(n){const e=new Set;for(const i of n)if(e.add(i.contextId),e.size>1)return!0;return!1}const YE=(n,e,i)=>{const r=QE(n);let a;try{const u=new URL(n.request.url);a=u.pathname.substring(u.pathname.lastIndexOf("/")+1),a||(a=u.host),u.search&&(a+=u.search)}catch{a=n.request.url}let o;if(n._resourceType==="websocket")o="websocket";else{o=n.response.content.mimeType;const u=o.match(/^(.*);\s*charset=.*$/);u&&(o=u[1])}return{name:{name:a,url:n.request.url},method:n.request.method,status:{code:n.response.status,text:n.response.statusText},contentType:o,duration:n.time,size:n.response._transferSize>0?n.response._transferSize:n.response.bodySize,start:n._monotonicTime-e.minimum,route:r,resource:n,contextId:i.contextId(n)}};function FE(n){if(n._monotonicTime)return{minimum:n._monotonicTime,maximum:n._monotonicTime+n.time}}function QE(n){return n._wasAborted?"aborted":n._wasContinued?"continued":n._wasFulfilled?"fulfilled":n._apiRequest?"api":""}function PE(n,e){const i=JE(e==null?void 0:e.by);i&&n.sort(i),e.negate&&n.reverse()}function JE(n){if(n==="start")return(e,i)=>e.start-i.start;if(n==="duration")return(e,i)=>e.duration-i.duration;if(n==="status")return(e,i)=>e.status.code-i.status.code;if(n==="method")return(e,i)=>{const r=e.method,a=i.method;return r.localeCompare(a)};if(n==="size")return(e,i)=>e.size-i.size;if(n==="contentType")return(e,i)=>e.contentType.localeCompare(i.contentType);if(n==="name")return(e,i)=>e.name.name.localeCompare(i.name.name);if(n==="route")return(e,i)=>e.route.localeCompare(i.route);if(n==="contextId")return(e,i)=>e.contextId.localeCompare(i.contextId)}const ZE={Fetch:n=>n.contentType==="application/json",HTML:n=>n.contentType==="text/html",CSS:n=>n.contentType==="text/css",JS:n=>n.contentType.includes("javascript"),Font:n=>n.contentType.includes("font"),Image:n=>n.contentType.includes("image"),WS:n=>n.resource._resourceType==="websocket"};function WE({searchValue:n,resourceTypes:e}){return i=>(e.size===0||Array.from(e).some(a=>ZE[a](i)))&&i.name.url.toLowerCase().includes(n.toLowerCase())}function eT(n,e){if(n.role!==e.role||n.name!==e.name||!tT(n,e)||cc(n)!==cc(e))return!1;const i=Object.keys(n.props),r=Object.keys(e.props);return i.length===r.length&&i.every(a=>n.props[a]===e.props[a])}function cc(n){return n.box.cursor==="pointer"}function tT(n,e){return n.active===e.active&&n.checked===e.checked&&n.disabled===e.disabled&&n.expanded===e.expanded&&n.invalid===e.invalid&&n.selected===e.selected&&n.level===e.level&&n.pressed===e.pressed}function dd(n,e,i={}){var S;const r=new n.LineCounter,a={keepSourceTokens:!0,lineCounter:r,...i},o=n.parseDocument(e,a),u=[],f=w=>[r.linePos(w[0]),r.linePos(w[1])],d=w=>{u.push({message:w.message,range:[r.linePos(w.pos[0]),r.linePos(w.pos[1])]})},g=(w,E)=>{for(const x of E.items){if(x instanceof n.Scalar&&typeof x.value=="string"){const C=uc.parse(x,a,u);C&&(w.children=w.children||[],w.children.push(C));continue}if(x instanceof n.YAMLMap){m(w,x);continue}u.push({message:"Sequence items should be strings or maps",range:f(x.range||E.range)})}},m=(w,E)=>{for(const x of E.items){if(w.children=w.children||[],!(x.key instanceof n.Scalar&&typeof x.key.value=="string")){u.push({message:"Only string keys are supported",range:f(x.key.range||E.range)});continue}const A=x.key,C=x.value;if(A.value==="text"){if(!(C instanceof n.Scalar&&typeof C.value=="string")){u.push({message:"Text value should be a string",range:f(x.value.range||E.range)});continue}w.children.push({kind:"text",text:hh(C.value)});continue}if(A.value==="/children"){if(!(C instanceof n.Scalar&&typeof C.value=="string")||C.value!=="contain"&&C.value!=="equal"&&C.value!=="deep-equal"){u.push({message:'Strict value should be "contain", "equal" or "deep-equal"',range:f(x.value.range||E.range)});continue}w.containerMode=C.value;continue}if(A.value.startsWith("/")){if(!(C instanceof n.Scalar&&typeof C.value=="string")){u.push({message:"Property value should be a string",range:f(x.value.range||E.range)});continue}w.props=w.props??{},w.props[A.value.slice(1)]=hh(C.value);continue}const H=uc.parse(A,a,u);if(!H)continue;if(C instanceof n.Scalar){const Q=typeof C.value;if(Q!=="string"&&Q!=="number"&&Q!=="boolean"){u.push({message:"Node value should be a string or a sequence",range:f(x.value.range||E.range)});continue}w.children.push({...H,children:[{kind:"text",text:hh(String(C.value))}]});continue}if(C instanceof n.YAMLSeq){w.children.push(H),g(H,C);continue}u.push({message:"Map values should be strings or sequences",range:f(x.value.range||E.range)})}},y={kind:"role",role:"fragment"};return o.errors.forEach(d),u.length?{errors:u,fragment:y}:(o.contents instanceof n.YAMLSeq||u.push({message:'Aria snapshot must be a YAML sequence, elements starting with " -"',range:o.contents?f(o.contents.range):[{line:0,col:0},{line:0,col:0}]}),u.length?{errors:u,fragment:y}:(g(y,o.contents),u.length?{errors:u,fragment:nT}:((S=y.children)==null?void 0:S.length)===1&&(!y.containerMode||y.containerMode==="contain")?{fragment:y.children[0],errors:[]}:{fragment:y,errors:[]}))}const nT={kind:"role",role:"fragment"};function rv(n){return n.replace(/[\u200b\u00ad]/g,"").replace(/[\r\n\s\t]+/g," ").trim()}function hh(n){return{raw:n,normalized:rv(n)}}class uc{static parse(e,i,r){try{return new uc(e.value)._parse()}catch(a){if(a instanceof _b){const o=i.prettyErrors===!1?a.message:a.message+`:

`+e.value+`
`+" ".repeat(a.pos)+`^
`;return r.push({message:o,range:[i.lineCounter.linePos(e.range[0]),i.lineCounter.linePos(e.range[0]+a.pos)]}),null}throw a}}constructor(e){this._input=e,this._pos=0,this._length=e.length}_peek(){return this._input[this._pos]||""}_next(){return this._pos<this._length?this._input[this._pos++]:null}_eof(){return this._pos>=this._length}_isWhitespace(){return!this._eof()&&/\s/.test(this._peek())}_skipWhitespace(){for(;this._isWhitespace();)this._pos++}_readIdentifier(e){this._eof()&&this._throwError(`Unexpected end of input when expecting ${e}`);const i=this._pos;for(;!this._eof()&&/[a-zA-Z]/.test(this._peek());)this._pos++;return this._input.slice(i,this._pos)}_readString(){let e="",i=!1;for(;!this._eof();){const r=this._next();if(i)e+=r,i=!1;else if(r==="\\")i=!0;else{if(r==='"')return e;e+=r}}this._throwError("Unterminated string")}_throwError(e,i=0){throw new _b(e,i||this._pos)}_readRegex(){let e="",i=!1,r=!1;for(;!this._eof();){const a=this._next();if(i)e+=a,i=!1;else if(a==="\\")i=!0,e+=a;else{if(a==="/"&&!r)return{pattern:e};a==="["?(r=!0,e+=a):a==="]"&&r?(e+=a,r=!1):e+=a}}this._throwError("Unterminated regex")}_readStringOrRegex(){const e=this._peek();return e==='"'?(this._next(),rv(this._readString())):e==="/"?(this._next(),this._readRegex()):null}_readAttributes(e){let i=this._pos;for(;this._skipWhitespace(),this._peek()==="[";){this._next(),this._skipWhitespace(),i=this._pos;const r=this._readIdentifier("attribute");this._skipWhitespace();let a="";if(this._peek()==="=")for(this._next(),this._skipWhitespace(),i=this._pos;this._peek()!=="]"&&!this._isWhitespace()&&!this._eof();)a+=this._next();this._skipWhitespace(),this._peek()!=="]"&&this._throwError("Expected ]"),this._next(),this._applyAttribute(e,r,a||"true",i)}}_parse(){this._skipWhitespace();const e=this._readIdentifier("role");this._skipWhitespace();const i=this._readStringOrRegex()||"",r={kind:"role",role:e,name:i};return this._readAttributes(r),this._skipWhitespace(),this._eof()||this._throwError("Unexpected input"),r}_applyAttribute(e,i,r,a){if(i==="checked"){this._assert(r==="true"||r==="false"||r==="mixed",'Value of "checked" attribute must be a boolean or "mixed"',a),e.checked=r==="true"?!0:r==="false"?!1:"mixed";return}if(i==="disabled"){this._assert(r==="true"||r==="false",'Value of "disabled" attribute must be a boolean',a),e.disabled=r==="true";return}if(i==="expanded"){this._assert(r==="true"||r==="false",'Value of "expanded" attribute must be a boolean',a),e.expanded=r==="true";return}if(i==="active"){this._assert(r==="true"||r==="false",'Value of "active" attribute must be a boolean',a),e.active=r==="true";return}if(i==="invalid"){this._assert(r==="true"||r==="false"||r==="grammar"||r==="spelling",'Value of "invalid" attribute must be a boolean, "grammar" or "spelling"',a),e.invalid=r==="true"?!0:r==="false"?!1:r;return}if(i==="level"){this._assert(!isNaN(Number(r)),'Value of "level" attribute must be a number',a),e.level=Number(r);return}if(i==="pressed"){this._assert(r==="true"||r==="false"||r==="mixed",'Value of "pressed" attribute must be a boolean or "mixed"',a),e.pressed=r==="true"?!0:r==="false"?!1:"mixed";return}if(i==="selected"){this._assert(r==="true"||r==="false",'Value of "selected" attribute must be a boolean',a),e.selected=r==="true";return}this._assert(!1,`Unsupported attribute [${i}]`,a)}_assert(e,i,r){e||this._throwError(i||"Assertion error",r)}}class _b extends Error{constructor(e,i){super(e),this.pos=i}}function iT(n,e){var u,f;function i(d,g,m){let y=1,S=m+y;for(const w of d.children||[])typeof w=="string"?(y++,S++):(y+=i(w,g,S),S+=y);if(!["none","presentation","fragment","iframe","generic"].includes(d.role)&&d.name){let w=g.get(d.role);w||(w=new Map,g.set(d.role,w));const E=w.get(d.name),x=y*100-m;(!E||E.sizeAndPosition<x)&&w.set(d.name,{node:d,sizeAndPosition:x})}return y}const r=new Map;n&&i(n,r,0);const a=new Map;i(e,a,0);const o=[];for(const[d,g]of a)for(const[m,y]of g)((u=r.get(d))==null?void 0:u.get(m))||o.push(y);return o.sort((d,g)=>g.sizeAndPosition-d.sizeAndPosition),(f=o[0])==null?void 0:f.node}function pd(n,e,i){return`internal:attr=[${n}=${Ze(e,(i==null?void 0:i.exact)||!1)}]`}function av(n){return n.split(",")}function lv(n){return n.includes(",")?JSON.stringify(n):n}function sT(n,e){return`internal:testid=[${lv(n)}=${Ze(e,!0)}]`}function rT(n,e){return"internal:label="+Vt(n,!!(e!=null&&e.exact))}function aT(n,e){return pd("alt",n,e)}function lT(n,e){return pd("title",n,e)}function oT(n,e){return pd("placeholder",n,e)}function cT(n,e){return"internal:text="+Vt(n,!!(e!=null&&e.exact))}function uT(n,e={}){const i=[];return e.checked!==void 0&&i.push(["checked",String(e.checked)]),e.disabled!==void 0&&i.push(["disabled",String(e.disabled)]),e.selected!==void 0&&i.push(["selected",String(e.selected)]),e.expanded!==void 0&&i.push(["expanded",String(e.expanded)]),e.includeHidden!==void 0&&i.push(["include-hidden",String(e.includeHidden)]),e.level!==void 0&&i.push(["level",String(e.level)]),e.name!==void 0&&i.push(["name",Ze(e.name,!!e.exact)]),e.description!==void 0&&i.push(["description",Ze(e.description,!!e.exact)]),e.pressed!==void 0&&i.push(["pressed",String(e.pressed)]),`internal:role=${n}${i.map(([r,a])=>`[${r}=${a}]`).join("")}`}function fT(n){return ov(n)?"'"+n.replace(/'/g,"''")+"'":n}function dh(n){return ov(n)?'"'+n.replace(/[\\"\x00-\x1f\x7f-\x9f]/g,e=>{switch(e){case"\\":return"\\\\";case'"':return'\\"';case"\b":return"\\b";case"\f":return"\\f";case`
`:return"\\n";case"\r":return"\\r";case"	":return"\\t";default:return"\\x"+e.charCodeAt(0).toString(16).padStart(2,"0")}})+'"':n}function ov(n){return!!(n.length===0||/^\s|\s$/.test(n)||/[\x00-\x08\x0b\x0c\x0e-\x1f\x7f-\x9f]/.test(n)||/^-/.test(n)||/[\n:](\s|$)/.test(n)||/\s#/.test(n)||/[\n\r]/.test(n)||/^[&*\],?!>|@"'#%]/.test(n)||/[{}`]/.test(n)||/^\[/.test(n)||!isNaN(Number(n))||["y","n","yes","no","true","false","on","off","null"].includes(n.toLowerCase()))}let cv={};function hT(n){cv=n}function Hh(n,e){for(;e;){if(n.contains(e))return!0;e=fv(e)}return!1}function Ct(n){if(n.parentElement)return n.parentElement;if(n.parentNode&&n.parentNode.nodeType===11&&n.parentNode.host)return n.parentNode.host}function uv(n){let e=n;for(;e.parentNode;)e=e.parentNode;if(e.nodeType===11||e.nodeType===9)return e}function fv(n){for(;n.parentElement;)n=n.parentElement;return Ct(n)}function Va(n,e,i){for(;n;){const r=n.closest(e);if(i&&r!==i&&(r!=null&&r.contains(i)))return;if(r)return r;n=fv(n)}}function Ui(n,e){const i=e==="::before"?md:e==="::after"?yd:gd;if(i&&i.has(n))return i.get(n);const r=n.ownerDocument&&n.ownerDocument.defaultView?n.ownerDocument.defaultView.getComputedStyle(n,e):void 0;return i==null||i.set(n,r),r}function hv(n,e){if(e=e??Ui(n),!e)return!0;if(Element.prototype.checkVisibility&&cv.browserNameForWorkarounds!=="webkit"){if(!n.checkVisibility())return!1}else{const i=n.closest("details,summary");if(i!==n&&(i==null?void 0:i.nodeName)==="DETAILS"&&!i.open)return!1}return e.visibility==="visible"}function fc(n){const e=Ui(n);if(!e)return{visible:!0,inline:!1};const i=e.cursor;if(e.display==="contents"){for(let a=n.firstChild;a;a=a.nextSibling){if(a.nodeType===1&&ii(a))return{visible:!0,inline:!1,cursor:i};if(a.nodeType===3&&dv(a))return{visible:!0,inline:!0,cursor:i}}return{visible:!1,inline:!1,cursor:i}}if(!hv(n,e))return{cursor:i,visible:!1,inline:!1};const r=n.getBoundingClientRect();return{cursor:i,visible:r.width>0&&r.height>0,inline:e.display==="inline"}}function ii(n){return fc(n).visible}function dv(n){const e=n.ownerDocument.createRange();e.selectNode(n);const i=e.getBoundingClientRect();return i.width>0&&i.height>0}function et(n){const e=n.tagName;return typeof e=="string"?e.toUpperCase():n instanceof HTMLFormElement?"FORM":n.tagName.toUpperCase()}let gd,md,yd,pv=0;function bd(){++pv,gd??(gd=new Map),md??(md=new Map),yd??(yd=new Map)}function vd(){--pv||(gd=void 0,md=void 0,yd=void 0)}function Eb(n){return n.hasAttribute("aria-label")||n.hasAttribute("aria-labelledby")}const Tb="article:not([role]), aside:not([role]), main:not([role]), nav:not([role]), section:not([role]), [role=article], [role=complementary], [role=main], [role=navigation], [role=region]",dT=[["aria-atomic",void 0],["aria-busy",void 0],["aria-controls",void 0],["aria-current",void 0],["aria-describedby",void 0],["aria-details",void 0],["aria-dropeffect",void 0],["aria-flowto",void 0],["aria-grabbed",void 0],["aria-hidden",void 0],["aria-keyshortcuts",void 0],["aria-label",["caption","code","deletion","emphasis","generic","insertion","paragraph","presentation","strong","subscript","superscript"]],["aria-labelledby",["caption","code","deletion","emphasis","generic","insertion","paragraph","presentation","strong","subscript","superscript"]],["aria-live",void 0],["aria-owns",void 0],["aria-relevant",void 0],["aria-roledescription",["generic"]]];function gv(n,e){return dT.some(([i,r])=>!(r!=null&&r.includes(e||""))&&n.hasAttribute(i))}function mv(n){return!Number.isNaN(Number(String(n.getAttribute("tabindex"))))}function pT(n){return!kv(n)&&(gT(n)||mv(n))}function gT(n){const e=et(n);return["BUTTON","DETAILS","SELECT","TEXTAREA"].includes(e)?!0:e==="A"||e==="AREA"?n.hasAttribute("href"):e==="INPUT"?!n.hidden:!1}const ph={A:n=>n.hasAttribute("href")?"link":null,AREA:n=>n.hasAttribute("href")?"link":null,ARTICLE:()=>"article",ASIDE:()=>"complementary",BLOCKQUOTE:()=>"blockquote",BUTTON:()=>"button",CAPTION:()=>"caption",CODE:()=>"code",DATALIST:()=>"listbox",DD:()=>"definition",DEL:()=>"deletion",DETAILS:()=>"group",DFN:()=>"term",DIALOG:()=>"dialog",DT:()=>"term",EM:()=>"emphasis",FIELDSET:()=>"group",FIGURE:()=>"figure",FOOTER:n=>Va(n,Tb)?null:"contentinfo",FORM:n=>Eb(n)?"form":null,H1:()=>"heading",H2:()=>"heading",H3:()=>"heading",H4:()=>"heading",H5:()=>"heading",H6:()=>"heading",HEADER:n=>Va(n,Tb)?null:"banner",HR:()=>"separator",HTML:()=>"document",IMG:n=>n.getAttribute("alt")===""&&!n.getAttribute("title")&&!gv(n)&&!mv(n)?"presentation":"img",INPUT:n=>{const e=n.type.toLowerCase();if(e==="search")return n.hasAttribute("list")?"combobox":"searchbox";if(["email","tel","text","url",""].includes(e)){const i=jr(n,n.getAttribute("list"))[0];return i&&et(i)==="DATALIST"?"combobox":"textbox"}return e==="hidden"?null:e==="file"?"button":OT[e]||"textbox"},INS:()=>"insertion",LI:()=>"listitem",MAIN:()=>"main",MARK:()=>"mark",MATH:()=>"math",MENU:()=>"list",METER:()=>"meter",NAV:()=>"navigation",OL:()=>"list",OPTGROUP:()=>"group",OPTION:()=>"option",OUTPUT:()=>"status",P:()=>"paragraph",PROGRESS:()=>"progressbar",SEARCH:()=>"search",SECTION:n=>Eb(n)?"region":null,SELECT:n=>n.hasAttribute("multiple")||n.size>1?"listbox":"combobox",STRONG:()=>"strong",SUB:()=>"subscript",SUP:()=>"superscript",SVG:()=>"img",TABLE:()=>"table",TBODY:()=>"rowgroup",TD:n=>{const e=Va(n,"table"),i=e?Sd(e):"";return i==="grid"||i==="treegrid"?"gridcell":"cell"},TEXTAREA:()=>"textbox",TFOOT:()=>"rowgroup",TH:n=>{const e=n.getAttribute("scope");if(e==="col"||e==="colgroup")return"columnheader";if(e==="row"||e==="rowgroup")return"rowheader";const i=n.nextElementSibling,r=n.previousElementSibling,a=n.parentElement&&et(n.parentElement)==="TR"?n.parentElement:void 0;if(!i&&!r){if(a){const o=Va(a,"table");if(o&&o.rows.length<=1)return null}return"columnheader"}return Ab(i)&&Ab(r)?"columnheader":Cb(i)||Cb(r)?"rowheader":"columnheader"},THEAD:()=>"rowgroup",TIME:()=>"time",TR:()=>"row",UL:()=>"list"};function Ab(n){return!!n&&et(n)==="TH"}function Cb(n){var e;return!n||et(n)!=="TD"?!1:!!((e=n.textContent)!=null&&e.trim()||n.children.length>0)}const mT={DD:["DL","DIV"],DIV:["DL"],DT:["DL","DIV"],LI:["OL","UL"],TBODY:["TABLE"],TD:["TR"],TFOOT:["TABLE"],TH:["TR"],THEAD:["TABLE"],TR:["THEAD","TBODY","TFOOT","TABLE"]};function Nb(n){var r;const e=((r=ph[et(n)])==null?void 0:r.call(ph,n))||"";if(!e)return null;let i=n;for(;i;){const a=Ct(i),o=mT[et(i)];if(!o||!a||!o.includes(et(a)))break;const u=Sd(a);if((u==="none"||u==="presentation")&&!yv(a,u))return u;i=a}return e}const yT=["alert","alertdialog","application","article","banner","blockquote","button","caption","cell","checkbox","code","columnheader","combobox","complementary","contentinfo","definition","deletion","dialog","directory","document","emphasis","feed","figure","form","generic","grid","gridcell","group","heading","img","insertion","link","list","listbox","listitem","log","main","mark","marquee","math","meter","menu","menubar","menuitem","menuitemcheckbox","menuitemradio","navigation","none","note","option","paragraph","presentation","progressbar","radio","radiogroup","region","row","rowgroup","rowheader","scrollbar","search","searchbox","separator","slider","spinbutton","status","strong","subscript","superscript","switch","tab","table","tablist","tabpanel","term","textbox","time","timer","toolbar","tooltip","tree","treegrid","treeitem"];function Sd(n){return(n.getAttribute("role")||"").split(" ").map(i=>i.trim()).find(i=>yT.includes(i))||null}function yv(n,e){return gv(n,e)||pT(n)}function Tt(n){const e=Sd(n);if(!e)return Nb(n);if(e==="none"||e==="presentation"){const i=Nb(n);if(yv(n,i))return i}return e}function bv(n){return n===null?void 0:n.toLowerCase()==="true"}function vv(n){return["STYLE","SCRIPT","NOSCRIPT","TEMPLATE"].includes(et(n))}function gn(n){if(vv(n))return!0;const e=Ui(n),i=n.nodeName==="SLOT";if((e==null?void 0:e.display)==="contents"&&!i){for(let a=n.firstChild;a;a=a.nextSibling)if(a.nodeType===1&&!gn(a)||a.nodeType===3&&dv(a))return!1;return!0}return!(n.nodeName==="OPTION"&&!!n.closest("select"))&&!i&&!hv(n,e)?!0:Sv(n)}function Sv(n){let e=ji==null?void 0:ji.get(n);if(e===void 0){if(e=!1,n.parentElement&&n.parentElement.shadowRoot&&!n.assignedSlot&&(e=!0),!e){const i=Ui(n);e=!i||i.display==="none"||bv(n.getAttribute("aria-hidden"))===!0}if(!e){const i=Ct(n);i&&(e=Sv(i))}ji==null||ji.set(n,e)}return e}function jr(n,e){if(!e)return[];const i=uv(n);if(!i)return[];try{const r=e.split(" ").filter(o=>!!o),a=[];for(const o of r){const u=i.querySelector("#"+CSS.escape(o));u&&!a.includes(u)&&a.push(u)}return a}catch{return[]}}function ti(n){return n.trim()}function Ja(n){return n.split("Â ").map(e=>e.replace(/\r\n/g,`
`).replace(/[\u200b\u00ad]/g,"").replace(/\s\s*/g," ")).join("Â ").trim()}function kb(n,e){const i=[...n.querySelectorAll(e)];for(const r of jr(n,n.getAttribute("aria-owns")))r.matches(e)&&i.push(r),i.push(...r.querySelectorAll(e));return i}function Za(n,e){const i=e==="::before"?jd:e==="::after"?Ld:Od;if(i!=null&&i.has(n))return i==null?void 0:i.get(n);const r=Ui(n,e);let a;if(r){const o=r.content;o&&o!=="none"&&o!=="normal"&&r.display!=="none"&&r.visibility!=="hidden"&&(a=bT(n,o,!!e))}return e&&a!==void 0&&((r==null?void 0:r.display)||"inline")!=="inline"&&(a=" "+a+" "),i&&i.set(n,a),a}function bT(n,e,i){if(!(!e||e==="none"||e==="normal"))try{let r=w0(e).filter(f=>!(f instanceof rc));const a=r.findIndex(f=>f instanceof _t&&f.value==="/");if(a!==-1)r=r.slice(a+1);else if(!i)return;const o=[];let u=0;for(;u<r.length;)if(r[u]instanceof ld)o.push(r[u].value),u++;else if(u+2<r.length&&r[u]instanceof Fa&&r[u].value==="attr"&&r[u+1]instanceof ad&&r[u+2]instanceof rd){const f=r[u+1].value;o.push(n.getAttribute(f)||""),u+=3}else return;return o.join("")}catch{}}function wv(n){const e=n.getAttribute("aria-labelledby");if(e===null)return null;const i=jr(n,e);return i.length?i:null}function vT(n,e){const i=["button","cell","checkbox","columnheader","gridcell","heading","link","menuitem","menuitemcheckbox","menuitemradio","option","radio","row","rowheader","switch","tab","tooltip","treeitem"].includes(n),r=e&&["","caption","code","contentinfo","definition","deletion","emphasis","insertion","list","listitem","mark","none","paragraph","presentation","region","row","rowgroup","section","strong","subscript","superscript","table","term","time"].includes(n);return i||r}function rl(n,e){const i=e?Nd:Cd;let r=i==null?void 0:i.get(n);return r===void 0&&(r="",["caption","code","definition","deletion","emphasis","generic","insertion","mark","paragraph","presentation","strong","subscript","suggestion","superscript","term","time"].includes(Tt(n)||"")||(r=Ja(_n(n,{includeHidden:e,visitedElements:new Set,embeddedInTargetElement:"self"}))),i==null||i.set(n,r)),r}function al(n,e){const i=e?Md:kd;let r=i==null?void 0:i.get(n);if(r===void 0){if(r="",n.hasAttribute("aria-describedby")){const a=jr(n,n.getAttribute("aria-describedby"));r=Ja(a.map(o=>_n(o,{includeHidden:e,visitedElements:new Set,embeddedInDescribedBy:{element:o,hidden:gn(o)}})).join(" "))}else n.hasAttribute("aria-description")?r=Ja(n.getAttribute("aria-description")||""):r=Ja(n.getAttribute("title")||"");i==null||i.set(n,r)}return r}const ST=["application","checkbox","columnheader","combobox","gridcell","listbox","radiogroup","rowheader","searchbox","slider","spinbutton","switch","textbox","tree"];function xv(n){const e=n.getAttribute("aria-invalid");return!e||e.trim()===""||e.toLocaleLowerCase()==="false"?"false":e==="true"||e==="grammar"||e==="spelling"?e:"true"}function wT(n){if("validity"in n){const e=n.validity;return(e==null?void 0:e.valid)===!1}return!1}function xT(n){const e=yr;let i=yr==null?void 0:yr.get(n);if(i===void 0){i="";const r=xv(n)!=="false",a=wT(n);if(r||a){const o=n.getAttribute("aria-errormessage");i=jr(n,o).map(d=>Ja(_n(d,{visitedElements:new Set,embeddedInDescribedBy:{element:d,hidden:gn(d)}}))).join(" ").trim()}e==null||e.set(n,i)}return i}function _n(n,e){var d,g,m,y;if(e.visitedElements.has(n))return"";const i={...e,embeddedInTargetElement:e.embeddedInTargetElement==="self"?"descendant":e.embeddedInTargetElement};if(!e.includeHidden){const S=!!((d=e.embeddedInLabelledBy)!=null&&d.hidden)||!!((g=e.embeddedInDescribedBy)!=null&&g.hidden)||!!((m=e.embeddedInNativeTextAlternative)!=null&&m.hidden)||!!((y=e.embeddedInLabel)!=null&&y.hidden);if(vv(n)||!S&&gn(n))return e.visitedElements.add(n),""}const r=wv(n);if(!e.embeddedInLabelledBy){const S=(r||[]).map(w=>_n(w,{...e,embeddedInLabelledBy:{element:w,hidden:gn(w)},embeddedInDescribedBy:void 0,embeddedInTargetElement:void 0,embeddedInLabel:void 0,embeddedInNativeTextAlternative:void 0})).join(" ");if(S)return S}const a=Tt(n)||"",o=et(n);if(e.embeddedInLabel||e.embeddedInLabelledBy||e.embeddedInTargetElement==="descendant"){const S=[...n.labels||[]].includes(n),w=(r||[]).includes(n);if(!S&&!w){if(a==="textbox")return e.visitedElements.add(n),o==="INPUT"||o==="TEXTAREA"?n.value:n.textContent||"";if(["combobox","listbox"].includes(a)){e.visitedElements.add(n);let E;if(o==="SELECT")E=[...n.selectedOptions],!E.length&&n.options.length&&E.push(n.options[0]);else{const x=a==="combobox"?kb(n,"*").find(_=>Tt(_)==="listbox"):n;E=x?kb(x,'[aria-selected="true"]').filter(_=>Tt(_)==="option"):[]}return!E.length&&o==="INPUT"?n.value:E.map(x=>_n(x,i)).join(" ")}if(["progressbar","scrollbar","slider","spinbutton","meter"].includes(a))return e.visitedElements.add(n),n.hasAttribute("aria-valuetext")?n.getAttribute("aria-valuetext")||"":n.hasAttribute("aria-valuenow")?n.getAttribute("aria-valuenow")||"":n.getAttribute("value")||"";if(["menu"].includes(a))return e.visitedElements.add(n),""}}const u=n.getAttribute("aria-label")||"";if(ti(u))return e.visitedElements.add(n),u;if(!["presentation","none"].includes(a)){if(o==="INPUT"&&["button","submit","reset"].includes(n.type)){e.visitedElements.add(n);const S=n.value||"";return ti(S)?S:n.type==="submit"?"Submit":n.type==="reset"?"Reset":n.getAttribute("title")||""}if(o==="INPUT"&&n.type==="file"){e.visitedElements.add(n);const S=n.labels||[];return S.length&&!e.embeddedInLabelledBy?za(S,e):"Choose File"}if(o==="INPUT"&&n.type==="image"){e.visitedElements.add(n);const S=n.labels||[];if(S.length&&!e.embeddedInLabelledBy)return za(S,e);const w=n.getAttribute("alt")||"";if(ti(w))return w;const E=n.getAttribute("title")||"";return ti(E)?E:"Submit"}if(!r&&o==="BUTTON"){e.visitedElements.add(n);const S=n.labels||[];if(S.length)return za(S,e)}if(!r&&o==="OUTPUT"){e.visitedElements.add(n);const S=n.labels||[];return S.length?za(S,e):n.getAttribute("title")||""}if(!r&&(o==="TEXTAREA"||o==="SELECT"||o==="INPUT")){e.visitedElements.add(n);const S=n.labels||[];if(S.length)return za(S,e);const w=o==="INPUT"&&["text","password","search","tel","email","url"].includes(n.type)||o==="TEXTAREA",E=n.getAttribute("placeholder")||"",x=n.getAttribute("title")||"";return!w||x?x:E}if(!r&&o==="FIELDSET"){e.visitedElements.add(n);for(let w=n.firstElementChild;w;w=w.nextElementSibling)if(et(w)==="LEGEND")return _n(w,{...i,embeddedInNativeTextAlternative:{element:w,hidden:gn(w)}});return n.getAttribute("title")||""}if(!r&&o==="FIGURE"){e.visitedElements.add(n);for(let w=n.firstElementChild;w;w=w.nextElementSibling)if(et(w)==="FIGCAPTION")return _n(w,{...i,embeddedInNativeTextAlternative:{element:w,hidden:gn(w)}});return n.getAttribute("title")||""}if(o==="IMG"){e.visitedElements.add(n);const S=n.getAttribute("alt")||"";return ti(S)?S:n.getAttribute("title")||""}if(o==="TABLE"){e.visitedElements.add(n);for(let w=n.firstElementChild;w;w=w.nextElementSibling)if(et(w)==="CAPTION")return _n(w,{...i,embeddedInNativeTextAlternative:{element:w,hidden:gn(w)}});const S=n.getAttribute("summary")||"";if(S)return S}if(o==="AREA"){e.visitedElements.add(n);const S=n.getAttribute("alt")||"";return ti(S)?S:n.getAttribute("title")||""}if(o==="SVG"||n.ownerSVGElement){e.visitedElements.add(n);for(let S=n.firstElementChild;S;S=S.nextElementSibling)if(et(S)==="TITLE"&&S.ownerSVGElement)return _n(S,{...i,embeddedInLabelledBy:{element:S,hidden:gn(S)}})}if(n.ownerSVGElement&&o==="A"){const S=n.getAttribute("xlink:title")||"";if(ti(S))return e.visitedElements.add(n),S}}const f=o==="SUMMARY"&&!["presentation","none"].includes(a);if(vT(a,e.embeddedInTargetElement==="descendant")||f||e.embeddedInLabelledBy||e.embeddedInDescribedBy||e.embeddedInLabel||e.embeddedInNativeTextAlternative){e.visitedElements.add(n);const S=_T(n,i);if(e.embeddedInTargetElement==="self"?ti(S):S)return S}if(!["presentation","none"].includes(a)||o==="IFRAME"){e.visitedElements.add(n);const S=n.getAttribute("title")||"";if(ti(S))return S}return e.visitedElements.add(n),""}function _T(n,e){const i=[],r=(o,u)=>{var f;if(!(u&&o.assignedSlot))if(o.nodeType===1){const d=((f=Ui(o))==null?void 0:f.display)||"inline";let g=_n(o,e);(d!=="inline"||o.nodeName==="BR")&&(g=" "+g+" "),i.push(g)}else o.nodeType===3&&i.push(o.textContent||"")};i.push(Za(n,"::before")||"");const a=Za(n);if(a!==void 0)i.push(a);else{const o=n.nodeName==="SLOT"?n.assignedNodes():[];if(o.length)for(const u of o)r(u,!1);else{for(let u=n.firstChild;u;u=u.nextSibling)r(u,!0);if(n.shadowRoot)for(let u=n.shadowRoot.firstChild;u;u=u.nextSibling)r(u,!0);for(const u of jr(n,n.getAttribute("aria-owns")))r(u,!0)}}return i.push(Za(n,"::after")||""),i.join("")}const wd=["gridcell","option","row","tab","rowheader","columnheader","treeitem"];function _v(n){return et(n)==="OPTION"?n.selected:wd.includes(Tt(n)||"")?bv(n.getAttribute("aria-selected"))===!0:!1}const xd=["checkbox","menuitemcheckbox","option","radio","switch","menuitemradio","treeitem"];function Ev(n){const e=_d(n,!0);return e==="error"?!1:e}function ET(n){return _d(n,!0)}function TT(n){return _d(n,!1)}function _d(n,e){const i=et(n);if(e&&i==="INPUT"&&n.indeterminate)return"mixed";if(i==="INPUT"&&["checkbox","radio"].includes(n.type))return n.checked;if(xd.includes(Tt(n)||"")){const r=n.getAttribute("aria-checked");return r==="true"?!0:e&&r==="mixed"?"mixed":!1}return"error"}const AT=["checkbox","combobox","grid","gridcell","listbox","radiogroup","slider","spinbutton","textbox","columnheader","rowheader","searchbox","switch","treegrid"];function CT(n){const e=et(n);return["INPUT","TEXTAREA","SELECT"].includes(e)?n.hasAttribute("readonly"):AT.includes(Tt(n)||"")?n.getAttribute("aria-readonly")==="true":n.isContentEditable?!1:"error"}const Ed=["button"];function Tv(n){if(Ed.includes(Tt(n)||"")){const e=n.getAttribute("aria-pressed");if(e==="true")return!0;if(e==="mixed")return"mixed"}return!1}const Td=["application","button","checkbox","combobox","gridcell","link","listbox","menuitem","row","rowheader","tab","treeitem","columnheader","menuitemcheckbox","menuitemradio","rowheader","switch"];function Av(n){if(et(n)==="DETAILS")return n.open;if(Td.includes(Tt(n)||"")){const e=n.getAttribute("aria-expanded");return e===null?void 0:e==="true"}}const Ad=["heading","listitem","row","treeitem"];function Cv(n){const e={H1:1,H2:2,H3:3,H4:4,H5:5,H6:6}[et(n)];if(e)return e;if(Ad.includes(Tt(n)||"")){const i=n.getAttribute("aria-level"),r=i===null?Number.NaN:Number(i);if(Number.isInteger(r)&&r>=1)return r}return 0}const Nv=["application","button","composite","gridcell","group","input","link","menuitem","scrollbar","separator","tab","checkbox","columnheader","combobox","grid","listbox","menu","menubar","menuitemcheckbox","menuitemradio","option","radio","radiogroup","row","rowheader","searchbox","select","slider","spinbutton","switch","tablist","textbox","toolbar","tree","treegrid","treeitem"];function hc(n){return kv(n)||Mv(n)}function kv(n){return["BUTTON","INPUT","SELECT","TEXTAREA","OPTION","OPTGROUP"].includes(et(n))&&(n.hasAttribute("disabled")||NT(n)||kT(n))}function NT(n){return et(n)==="OPTION"&&!!n.closest("OPTGROUP[DISABLED]")}function kT(n){const e=n==null?void 0:n.closest("FIELDSET[DISABLED]");if(!e)return!1;const i=e.querySelector(":scope > LEGEND");return!i||!i.contains(n)}function Mv(n,e=!1){if(!n)return!1;if(e||Nv.includes(Tt(n)||"")){const i=(n.getAttribute("aria-disabled")||"").toLowerCase();return i==="true"?!0:i==="false"?!1:Mv(Ct(n),!0)}return!1}function za(n,e){return[...n].map(i=>_n(i,{...e,embeddedInLabel:{element:i,hidden:gn(i)},embeddedInNativeTextAlternative:void 0,embeddedInLabelledBy:void 0,embeddedInDescribedBy:void 0,embeddedInTargetElement:void 0})).filter(i=>!!i).join(" ")}function MT(n){const e=Rd;let i=n,r;const a=[];for(;i;i=Ct(i)){const o=e.get(i);if(o!==void 0){r=o;break}a.push(i);const u=Ui(i);if(!u){r=!0;break}const f=u.pointerEvents;if(f){r=f!=="none";break}}r===void 0&&(r=!0);for(const o of a)e.set(o,r);return r}let Cd,Nd,kd,Md,yr,ji,Od,jd,Ld,Rd,Ov=0;function xc(){bd(),++Ov,Cd??(Cd=new Map),Nd??(Nd=new Map),kd??(kd=new Map),Md??(Md=new Map),yr??(yr=new Map),ji??(ji=new Map),Od??(Od=new Map),jd??(jd=new Map),Ld??(Ld=new Map),Rd??(Rd=new Map)}function _c(){--Ov||(Cd=void 0,Nd=void 0,kd=void 0,Md=void 0,yr=void 0,ji=void 0,Od=void 0,jd=void 0,Ld=void 0,Rd=void 0),vd()}const OT={button:"button",checkbox:"checkbox",image:"button",number:"spinbutton",radio:"radio",range:"slider",reset:"button",submit:"button"};let jT=0;function jv(n){const e=n.boxes;return n.mode==="ai"?{visibility:"ariaOrVisible",refs:"interactable",refPrefix:n.refPrefix,includeGenericRole:!0,renderActive:!n.doNotRenderActive,renderCursorPointer:!0,renderBoxes:e}:n.mode==="autoexpect"?{visibility:"ariaAndVisible",refs:"none",renderBoxes:e}:n.mode==="codegen"?{visibility:"aria",refs:"none",renderStringsAsRegex:!0,renderBoxes:e}:{visibility:"aria",refs:"none",renderBoxes:e}}function br(n,e){const i=jv(e),r=new Set,a={root:{role:"fragment",name:"",children:[],props:{},box:fc(n),receivesPointerEvents:!0},elements:new Map,refs:new Map,iframeRefs:[]};Bh(a.root,n);const o=(f,d,g)=>{if(r.has(d))return;if(r.add(d),d.nodeType===Node.TEXT_NODE&&d.nodeValue){if(!g)return;const x=d.nodeValue;f.role!=="textbox"&&x&&f.children.push(d.nodeValue||"");return}if(d.nodeType!==Node.ELEMENT_NODE)return;const m=d,y=!gn(m);let S=y;if(i.visibility==="ariaOrVisible"&&(S=y||ii(m)),i.visibility==="ariaAndVisible"&&(S=y&&ii(m)),i.visibility==="aria"&&!S)return;const w=[];if(m.hasAttribute("aria-owns")){const x=m.getAttribute("aria-owns").split(/\s+/);for(const _ of x){const A=n.ownerDocument.getElementById(_);A&&w.push(A)}}const E=S?LT(m,i):null;E&&(E.ref&&(a.elements.set(E.ref,m),a.refs.set(m,E.ref),E.role==="iframe"&&a.iframeRefs.push(E.ref)),f.children.push(E)),u(E||f,m,w,S)};function u(f,d,g,m){var E;const S=(((E=Ui(d))==null?void 0:E.display)||"inline")!=="inline"||d.nodeName==="BR"?" ":"";S&&f.children.push(S),f.children.push(Za(d,"::before")||"");const w=d.nodeName==="SLOT"?d.assignedNodes():[];if(w.length)for(const x of w)o(f,x,m);else{for(let x=d.firstChild;x;x=x.nextSibling)x.assignedSlot||o(f,x,m);if(d.shadowRoot)for(let x=d.shadowRoot.firstChild;x;x=x.nextSibling)o(f,x,m)}for(const x of g)o(f,x,m);if(f.children.push(Za(d,"::after")||""),S&&f.children.push(S),f.children.length===1&&f.name===f.children[0]&&(f.children=[]),f.role==="link"&&d.hasAttribute("href")){const x=d.getAttribute("href");f.props.url=x}if(f.role==="textbox"&&d.hasAttribute("placeholder")&&d.getAttribute("placeholder")!==f.name){const x=d.getAttribute("placeholder");f.props.placeholder=x}}xc();try{o(a.root,n,!0)}finally{_c()}return DT(a.root),RT(a.root),a}function Mb(n,e){if(e.refs==="none"||e.refs==="interactable"&&(!n.box.visible||!n.receivesPointerEvents))return;const i=Ec(n);let r=i._ariaRef;(!r||r.role!==n.role||r.name!==n.name)&&(r={role:n.role,name:n.name,ref:(e.refPrefix??"")+"e"+ ++jT},i._ariaRef=r),n.ref=r.ref}function LT(n,e){const i=n.ownerDocument.activeElement===n;if(n.nodeName==="IFRAME"){const g={role:"iframe",name:"",children:[],props:{},box:fc(n),receivesPointerEvents:!0,active:i};return Bh(g,n),Mb(g,e),g}const r=e.includeGenericRole?"generic":null,a=Tt(n)??r;if(!a||a==="presentation"||a==="none")return null;const o=pt(rl(n,!1)||""),u=MT(n),f=fc(n);if(a==="generic"&&f.inline&&n.childNodes.length===1&&n.childNodes[0].nodeType===Node.TEXT_NODE)return null;const d={role:a,name:o,children:[],props:{},box:f,receivesPointerEvents:u,active:i};if(Bh(d,n),Mb(d,e),xd.includes(a)&&(d.checked=Ev(n)),Nv.includes(a)&&(d.disabled=hc(n)),Td.includes(a)&&(d.expanded=Av(n)),ST.includes(a)){const g=xv(n);d.invalid=g==="false"?!1:g==="true"?!0:g}return Ad.includes(a)&&(d.level=Cv(n)),Ed.includes(a)&&(d.pressed=Tv(n)),wd.includes(a)&&(d.selected=_v(n)),(n instanceof HTMLInputElement||n instanceof HTMLTextAreaElement)&&n.type!=="checkbox"&&n.type!=="radio"&&n.type!=="file"&&(d.children=[n.value]),d}function RT(n){const e=i=>{const r=[];for(const o of i.children||[]){if(typeof o=="string"){r.push(o);continue}const u=e(o);r.push(...u)}return i.role==="generic"&&!i.name&&r.length<=1&&r.every(o=>typeof o!="string"&&!!o.ref)?r:(i.children=r,[i])};e(n)}function DT(n){const e=(r,a)=>{if(!r.length)return;const o=pt(r.join(""));o&&a.push(o),r.length=0},i=r=>{const a=[],o=[];for(const u of r.children||[])typeof u=="string"?o.push(u):(e(o,a),i(u),a.push(u));e(o,a),r.children=a.length?a:[],r.children.length===1&&r.children[0]===r.name&&(r.children=[])};i(n)}function zT(n,e){return e?n?typeof e=="string"?n===e:!!n.match(new RegExp(e.pattern)):!1:!0}function Ob(n,e){if(!(e!=null&&e.normalized))return!0;if(!n)return!1;if(n===e.normalized||n===e.raw)return!0;const i=UT(e);return i?!!n.match(i):!1}const gh=Symbol("cachedRegex");function UT(n){if(n[gh]!==void 0)return n[gh];const{raw:e}=n,i=e.startsWith("/")&&e.endsWith("/")&&e.length>1;let r;try{r=i?new RegExp(e.slice(1,-1)):null}catch{r=null}return n[gh]=r,r}function jb(n,e){const i=br(n,{mode:"default"});return{matches:Lv(i.root,e,!1,!1),received:{raw:vr(i,{mode:"default"}).text,regex:vr(i,{mode:"codegen"}).text}}}function HT(n,e){const i=br(n,{mode:"default"}).root;return Lv(i,e,!0,!1).map(a=>Ec(a))}function Dd(n,e,i){var r;return typeof n=="string"&&e.kind==="text"?Ob(n,e.text):n===null||typeof n!="object"||e.kind!=="role"||e.role!=="fragment"&&e.role!==n.role||e.checked!==void 0&&e.checked!==n.checked||e.disabled!==void 0&&e.disabled!==n.disabled||e.expanded!==void 0&&e.expanded!==n.expanded||e.invalid!==void 0&&e.invalid!==n.invalid||e.level!==void 0&&e.level!==n.level||e.pressed!==void 0&&e.pressed!==n.pressed||e.selected!==void 0&&e.selected!==n.selected||!zT(n.name,e.name)||!Ob(n.props.url,(r=e.props)==null?void 0:r.url)?!1:e.containerMode==="contain"?Rb(n.children||[],e.children||[]):e.containerMode==="equal"?Lb(n.children||[],e.children||[],!1):e.containerMode==="deep-equal"||i?Lb(n.children||[],e.children||[],!0):Rb(n.children||[],e.children||[])}function Lb(n,e,i){if(e.length!==n.length)return!1;for(let r=0;r<e.length;++r)if(!Dd(n[r],e[r],i))return!1;return!0}function Rb(n,e){if(e.length>n.length)return!1;const i=n.slice(),r=e.slice();for(const a of r){let o=i.shift();for(;o&&!Dd(o,a,!1);)o=i.shift();if(!o)return!1}return!0}function Lv(n,e,i,r){const a=[],o=(u,f)=>{if(Dd(u,e,r)){const d=typeof u=="string"?f:u;return d&&a.push(d),!i}if(typeof u=="string")return!1;for(const d of u.children||[])if(o(d,u))return!0;return!1};return o(n,null),a}function Rv(n,e=new Map){n!=null&&n.ref&&e.set(n.ref,n);for(const i of(n==null?void 0:n.children)||[])typeof i!="string"&&Rv(i,e);return e}function BT(n,e){var o;const i=Rv(e==null?void 0:e.root),r=new Map,a=(u,f)=>{let d=u.children.length===(f==null?void 0:f.children.length)&&eT(u,f),g=d;for(let m=0;m<u.children.length;m++){const y=u.children[m],S=f==null?void 0:f.children[m];if(typeof y=="string")d&&(d=y===S),g&&(g=y===S);else{let w=typeof S!="string"?S:void 0;y.ref&&(w=i.get(y.ref));const E=a(y,w);(!w||!E&&!y.ref||w!==S)&&(g=!1),d&&(d=E&&w===S)}}return r.set(u,d?"same":g?"skip":"changed"),d};return a(n.root,i.get((o=e==null?void 0:e.root)==null?void 0:o.ref)),r}function qT(n,e){const i=[],r=a=>{const o=e.get(a);if(o!=="same")if(o==="skip")for(const u of a.children)typeof u!="string"&&r(u);else i.push(a)};for(const a of n)typeof a=="string"?i.push(a):r(a);return i}function zo(n){return"  ".repeat(n)}function vr(n,e,i){const r=jv(e),a=[],o={},u=r.renderStringsAsRegex?IT:()=>!0,f=r.renderStringsAsRegex?$T:E=>E;let d=n.root.role==="fragment"?n.root.children:[n.root];const g=BT(n,i);i&&(d=qT(d,g));const m=(E,x)=>{if(e.depth&&x>e.depth)return;const _=dh(f(E));_&&a.push(zo(x)+"- text: "+_)},y=(E,x)=>{let _=E.role;if(E.name&&E.name.length<=900){const A=f(E.name);if(A){const C=A.startsWith("/")&&A.endsWith("/")?A:JSON.stringify(A);_+=" "+C}}if(E.checked==="mixed"&&(_+=" [checked=mixed]"),E.checked===!0&&(_+=" [checked]"),E.disabled&&(_+=" [disabled]"),E.expanded&&(_+=" [expanded]"),E.active&&r.renderActive&&(_+=" [active]"),(E.invalid==="grammar"||E.invalid==="spelling")&&(_+=` [invalid=${E.invalid}]`),E.invalid===!0&&(_+=" [invalid]"),E.level&&(_+=` [level=${E.level}]`),E.pressed==="mixed"&&(_+=" [pressed=mixed]"),E.pressed===!0&&(_+=" [pressed]"),E.selected===!0&&(_+=" [selected]"),E.ref&&(_+=` [ref=${E.ref}]`,x&&cc(E)&&(_+=" [cursor=pointer]")),r.renderBoxes){const A=Ec(E);if(A){const C=A.getBoundingClientRect();_+=` [box=${Math.round(C.x)},${Math.round(C.y)},${Math.round(C.width)},${Math.round(C.height)}]`}}return _},S=E=>(E==null?void 0:E.children.length)===1&&typeof E.children[0]=="string"&&!Object.keys(E.props).length?E.children[0]:void 0,w=(E,x,_)=>{if(e.depth&&x>e.depth)return;if(E.role==="iframe"&&E.ref&&(o[E.ref]=x),g.get(E)==="same"&&E.ref){a.push(zo(x)+`- ref=${E.ref} [unchanged]`);return}const A=!!i&&!x,C=zo(x)+"- "+(A?"<changed> ":"")+fT(y(E,_)),H=S(E),V=!!e.depth&&x===e.depth;if(!H&&(!E.children.length||V)&&!Object.keys(E.props).length)a.push(C);else if(H!==void 0)u(E,H)?a.push(C+": "+dh(f(H))):a.push(C);else{a.push(C+":");for(const[j,I]of Object.entries(E.props))a.push(zo(x+1)+"- /"+j+": "+dh(I));const Q=!!E.ref&&_&&cc(E);for(const j of E.children)typeof j=="string"?m(u(E,j)?j:"",x+1):w(j,x+1,_&&!Q)}};for(const E of d)typeof E=="string"?m(E,0):w(E,0,!!r.renderCursorPointer);return{text:a.join(`
`),iframeDepths:o}}function $T(n){const e=[{regex:/\b[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}\b/,replacement:"[0-9a-fA-F-]+"},{regex:/\b[\d,.]+[bkmBKM]+\b/,replacement:"[\\d,.]+[bkmBKM]+"},{regex:/\b\d+[hmsp]+\b/,replacement:"\\d+[hmsp]+"},{regex:/\b[\d,.]+[hmsp]+\b/,replacement:"[\\d,.]+[hmsp]+"},{regex:/\b\d+,\d+\b/,replacement:"\\d+,\\d+"},{regex:/\b\d+\.\d{2,}\b/,replacement:"\\d+\\.\\d+"},{regex:/\b\d{2,}\.\d+\b/,replacement:"\\d+\\.\\d+"},{regex:/\b\d{2,}\b/,replacement:"\\d+"}];let i="",r=0;const a=new RegExp(e.map(o=>"("+o.regex.source+")").join("|"),"g");return n.replace(a,(o,...u)=>{const f=u[u.length-2],d=u.slice(0,-2);i+=lc(n.slice(r,f));for(let g=0;g<d.length;g++)if(d[g]){const{replacement:m}=e[g];i+=m;break}return r=f+o.length,o}),i?(i+=lc(n.slice(r)),String(new RegExp(i))):n}function IT(n,e){if(!e.length)return!1;if(!n.name)return!0;const i=e.length<=200&&n.name.length<=200?y_(e,n.name):"";let r=e;for(;i&&r.includes(i);)r=r.replace(i,"");return r.trim().length/e.length>.1}const Dv=Symbol("element");function Ec(n){return n[Dv]}function Bh(n,e){n[Dv]=e}function VT(n,e){const i=iT(n,e);return i?Ec(i):void 0}const Db=":host{font-size:13px;font-family:system-ui,Ubuntu,Droid Sans,sans-serif;color:#333;color-scheme:light}svg{position:absolute;height:0}x-pw-tooltip{-webkit-backdrop-filter:blur(5px);backdrop-filter:blur(5px);background-color:#fff;border-radius:6px;box-shadow:0 .5rem 1.2rem #0000004d;display:none;font-size:12.8px;font-weight:400;left:0;line-height:1.5;max-width:600px;position:absolute;top:0;padding:0;flex-direction:column;overflow:hidden}x-pw-tooltip-line{display:flex;max-width:600px;padding:6px;-webkit-user-select:none;user-select:none;cursor:pointer}x-pw-tooltip-footer{display:flex;max-width:600px;padding:6px;-webkit-user-select:none;user-select:none;color:#777}x-pw-dialog{background-color:#fff;pointer-events:auto;border-radius:6px;box-shadow:0 .5rem 1.2rem #0000004d;display:flex;flex-direction:column;position:absolute;z-index:10;font-size:13px}x-pw-dialog:not(.autosize){width:400px;height:150px}x-pw-dialog-body{display:flex;flex-direction:column;flex:auto}x-pw-dialog-body label{margin:5px 8px;display:flex;flex-direction:row;align-items:center}x-pw-highlight{position:absolute;top:0;left:0;width:0;height:0}x-pw-action-point{position:absolute;width:20px;height:20px;background:red;border-radius:10px;margin:-10px 0 0 -10px;z-index:2}x-pw-action-cursor{position:absolute;width:18px;height:22px;pointer-events:none;z-index:4;filter:drop-shadow(0 1px 2px rgba(0,0,0,.4))}x-pw-action-cursor svg{width:100%;height:100%;position:static}x-pw-title{position:absolute;-webkit-backdrop-filter:blur(5px);backdrop-filter:blur(5px);background-color:#00000080;color:#fff;border-radius:6px;padding:6px;font-size:24px;line-height:1.4;white-space:nowrap;-webkit-user-select:none;user-select:none;z-index:3}x-pw-user-overlays,x-pw-user-overlay{position:absolute;top:0;right:0;bottom:0;left:0}@keyframes pw-fade-out{0%{opacity:1}to{opacity:0}}x-pw-separator{height:1px;margin:6px 9px;background:#949494e5}x-pw-tool-gripper{height:28px;width:24px;margin:2px 0;cursor:grab}x-pw-tool-gripper:active{cursor:grabbing}x-pw-tool-gripper>x-div{width:16px;height:16px;margin:6px 4px;clip-path:url(#icon-gripper);background-color:#555}x-pw-tools-list>label{display:flex;align-items:center;margin:0 10px;-webkit-user-select:none;user-select:none}x-pw-tools-list{display:flex;width:100%;border-bottom:1px solid #dddddd}x-pw-tool-item{pointer-events:auto;height:28px;width:28px;border-radius:3px}x-pw-tool-item:not(.disabled){cursor:pointer}x-pw-tool-item:not(.disabled):hover{background-color:#dbdbdb}x-pw-tool-item.toggled{background-color:#8acae480}x-pw-tool-item.toggled:not(.disabled):hover{background-color:#8acae4c4}x-pw-tool-item>x-div{width:16px;height:16px;margin:6px;background-color:#3a3a3a}x-pw-tool-item.disabled>x-div{background-color:#61616180;cursor:default}x-pw-tool-item.record.toggled{background-color:transparent}x-pw-tool-item.record.toggled:not(.disabled):hover{background-color:#dbdbdb}x-pw-tool-item.record.toggled>x-div{background-color:#a1260d}x-pw-tool-item.record.disabled.toggled>x-div{opacity:.8}x-pw-tool-item.accept>x-div{background-color:#388a34}x-pw-tool-item.record>x-div{clip-path:url(#icon-circle-large-filled)}x-pw-tool-item.record.toggled>x-div{clip-path:url(#icon-stop-circle)}x-pw-tool-item.pick-locator>x-div{clip-path:url(#icon-inspect)}x-pw-tool-item.text>x-div{clip-path:url(#icon-whole-word)}x-pw-tool-item.visibility>x-div{clip-path:url(#icon-eye)}x-pw-tool-item.value>x-div{clip-path:url(#icon-symbol-constant)}x-pw-tool-item.snapshot>x-div{clip-path:url(#icon-gist)}x-pw-tool-item.accept>x-div{clip-path:url(#icon-check)}x-pw-tool-item.cancel>x-div{clip-path:url(#icon-close)}x-pw-tool-item.succeeded>x-div{clip-path:url(#icon-pass);background-color:#388a34!important}x-pw-overlay{position:absolute;top:0;max-width:min-content;z-index:2147483647;background:transparent;pointer-events:auto}x-pw-overlay x-pw-tools-list{background-color:#fffd;box-shadow:#0000001a 0 5px 5px;border-radius:3px;border-bottom:none}x-pw-overlay x-pw-tool-item{margin:2px}textarea.text-editor{font-family:system-ui,Ubuntu,Droid Sans,sans-serif;flex:auto;border:none;margin:6px 10px;color:#333;outline:1px solid transparent!important;resize:none;padding:0;font-size:13px}textarea.text-editor.does-not-match{outline:1px solid red!important}x-div{display:block}x-spacer{flex:auto}*{box-sizing:border-box}*[hidden]{display:none!important}x-locator-editor{flex:none;width:100%;height:60px;padding:4px;border-bottom:1px solid #dddddd;outline:1px solid transparent}x-locator-editor.does-not-match{outline:1px solid red}.CodeMirror{width:100%!important;height:100%!important}x-pw-action-list{flex:auto;display:flex;flex-direction:column;-webkit-user-select:none;user-select:none}x-pw-action-item{padding:6px 10px;cursor:pointer;overflow:hidden}x-pw-action-item:hover{background-color:#f2f2f2}x-pw-action-item:last-child{border-bottom-left-radius:6px;border-bottom-right-radius:6px}";class mh{constructor(e){this._renderedEntries=[],this._userOverlays=new Map,this._userOverlayHidden=!1,this._language="javascript",this._elementHighlightSelectors=new Map,this._injectedScript=e;const i=e.document;if(this._isUnderTest=e.isUnderTest,this._glassPaneElement=i.createElement("x-pw-glass"),this._glassPaneElement.setAttribute("popover","manual"),this._glassPaneElement.style.inset="0",this._glassPaneElement.style.width="100%",this._glassPaneElement.style.height="100%",this._glassPaneElement.style.maxWidth="none",this._glassPaneElement.style.maxHeight="none",this._glassPaneElement.style.padding="0",this._glassPaneElement.style.margin="0",this._glassPaneElement.style.border="none",this._glassPaneElement.style.overflow="visible",this._glassPaneElement.style.pointerEvents="none",this._glassPaneElement.style.display="flex",this._glassPaneElement.style.backgroundColor="transparent",this._actionPointElement=i.createElement("x-pw-action-point"),this._actionPointElement.setAttribute("hidden","true"),this._actionCursorElement=i.createElement("x-pw-action-cursor"),this._actionCursorElement.style.visibility="hidden",this._actionCursorElement.appendChild(this._createCursorSvg(i)),this._titleElement=i.createElement("x-pw-title"),this._titleElement.setAttribute("hidden","true"),this._userOverlayContainer=i.createElement("x-pw-user-overlays"),this._userOverlayContainer.setAttribute("hidden","true"),this._glassPaneShadow=this._glassPaneElement.attachShadow({mode:this._isUnderTest?"open":"closed"}),typeof this._glassPaneShadow.adoptedStyleSheets.push=="function"){const r=new this._injectedScript.window.CSSStyleSheet;r.replaceSync(Db),this._glassPaneShadow.adoptedStyleSheets.push(r)}else{const r=this._injectedScript.document.createElement("style");r.textContent=Db,this._glassPaneShadow.appendChild(r)}this._glassPaneShadow.appendChild(this._actionPointElement),this._glassPaneShadow.appendChild(this._actionCursorElement),this._glassPaneShadow.appendChild(this._titleElement),this._glassPaneShadow.appendChild(this._userOverlayContainer)}install(){this._injectedScript.document.documentElement&&((!this._injectedScript.document.documentElement.contains(this._glassPaneElement)||this._glassPaneElement.nextElementSibling)&&this._injectedScript.document.documentElement.appendChild(this._glassPaneElement),this._bringToFront())}_bringToFront(){this._glassPaneElement.hidePopover(),this._glassPaneElement.showPopover()}setLanguage(e){this._language=e}addElementHighlight(e,i){const r=It(e);this._elementHighlightSelectors.set(r,{selector:e,cssStyle:i}),this._ensureElementHighlightRaf()}removeElementHighlight(e){const i=It(e);this._elementHighlightSelectors.delete(i)&&this._elementHighlightSelectors.size===0&&(this._rafRequest&&(this._injectedScript.utils.builtins.cancelAnimationFrame(this._rafRequest),this._rafRequest=void 0),this.clearHighlight())}_ensureElementHighlightRaf(){if(this._rafRequest)return;const e=()=>{const i=[];for(const{selector:r,cssStyle:a}of this._elementHighlightSelectors.values()){const o=this._injectedScript.querySelectorAll(r,this._injectedScript.document.documentElement),u=Ri(this._language,It(r)),f=o.length>1?"#f6b26b7f":"#6fa8dc7f";for(let d=0;d<o.length;++d){const g=o.length>1?` [${d+1} of ${o.length}]`:"";i.push({element:o[d],color:f,tooltipText:u+g,cssStyle:a})}}this.updateHighlight(i),this._rafRequest=this._injectedScript.utils.builtins.requestAnimationFrame(e)};this._rafRequest=this._injectedScript.utils.builtins.requestAnimationFrame(e)}uninstall(){this._rafRequest&&(this._injectedScript.utils.builtins.cancelAnimationFrame(this._rafRequest),this._rafRequest=void 0),this._elementHighlightSelectors.clear(),this._glassPaneElement.remove()}showActionPoint(e,i,r){this._actionPointElement.style.top=i+"px",this._actionPointElement.style.left=e+"px",this._actionPointElement.hidden=!1,r?this._actionPointElement.style.animation=`pw-fade-out ${r}ms ease-out forwards`:this._actionPointElement.style.animation=""}hideActionPoint(){this._actionPointElement.hidden=!0}moveActionCursor(e,i,r){const a=r?Math.max(80,Math.min(r*.6,400)):0;this._actionCursorElement.style.transition=`top ${a}ms ease, left ${a}ms ease`,this._actionCursorElement.style.left=e+"px",this._actionCursorElement.style.top=i+"px",this._actionCursorElement.style.visibility="visible"}hideActionCursor(){this._actionCursorElement.style.visibility="hidden"}_createCursorSvg(e){const i="http://www.w3.org/2000/svg",r=e.createElementNS(i,"svg");r.setAttribute("viewBox","0 0 18 22");const a=e.createElementNS(i,"path");return a.setAttribute("d","M1 1 L1 17 L5.5 13 L8 20.5 L11 19.5 L8.5 12 L15 12 Z"),a.setAttribute("fill","white"),a.setAttribute("stroke","black"),a.setAttribute("stroke-width","1.5"),a.setAttribute("stroke-linejoin","round"),r.appendChild(a),r}showActionTitle(e,i,r,a){if(this._titleElement.textContent=e,this._titleElement.hidden=!1,i){const o=i/4;this._titleElement.style.animation=`pw-fade-out ${o}ms ease-out ${i-o}ms forwards`}else this._titleElement.style.animation="";switch(this._titleElement.style.top="",this._titleElement.style.bottom="",this._titleElement.style.left="",this._titleElement.style.right="",this._titleElement.style.transform="",r){case"top-left":this._titleElement.style.top="6px",this._titleElement.style.left="6px";break;case"top":this._titleElement.style.top="6px",this._titleElement.style.left="50%",this._titleElement.style.transform="translateX(-50%)";break;case"bottom-left":this._titleElement.style.bottom="6px",this._titleElement.style.left="6px";break;case"bottom":this._titleElement.style.bottom="6px",this._titleElement.style.left="50%",this._titleElement.style.transform="translateX(-50%)";break;case"bottom-right":this._titleElement.style.bottom="6px",this._titleElement.style.right="6px";break;case"top-right":default:this._titleElement.style.top="6px",this._titleElement.style.right="6px";break}a&&(this._titleElement.style.fontSize=a+"px")}hideActionTitle(){this._titleElement.hidden=!0}addUserOverlay(e,i){const r=this._injectedScript.document.createElement("div");r.className="x-pw-user-overlay",r.innerHTML=i;for(const a of r.querySelectorAll("script"))a.remove();for(const a of r.querySelectorAll("*"))for(const o of[...a.attributes])o.name.startsWith("on")&&a.removeAttribute(o.name);return this._userOverlays.set(e,r),this._userOverlayContainer.appendChild(r),this._userOverlayContainer.hidden=this._userOverlayHidden,e}getUserOverlay(e){return this._userOverlays.get(e)}removeUserOverlay(e){const i=this._userOverlays.get(e);i&&(i.remove(),this._userOverlays.delete(e)),this._userOverlays.size===0&&(this._userOverlayContainer.hidden=!0)}setUserOverlaysVisible(e){this._userOverlayHidden=!e,this._userOverlayContainer.hidden=!e||this._userOverlays.size===0}clearHighlight(){var e,i;for(const r of this._renderedEntries)(e=r.highlightElement)==null||e.remove(),(i=r.tooltipElement)==null||i.remove();this._renderedEntries=[]}maskElements(e,i){this.updateHighlight(e.map(r=>({element:r,color:i})))}updateHighlight(e){if(!this._highlightIsUpToDate(e)){this.clearHighlight();for(const i of e){const r=this._createHighlightElement();this._glassPaneShadow.appendChild(r);let a;if(i.tooltipText){a=this._injectedScript.document.createElement("x-pw-tooltip"),this._glassPaneShadow.appendChild(a),a.style.top="0",a.style.left="0",a.style.display="flex";const o=this._injectedScript.document.createElement("x-pw-tooltip-line");o.textContent=i.tooltipText,a.appendChild(o)}this._renderedEntries.push({targetElement:i.element,box:zb(i.box),color:i.color,borderColor:i.borderColor,fadeDuration:i.fadeDuration,cssStyle:i.cssStyle,tooltipElement:a,highlightElement:r})}for(const i of this._renderedEntries){if(!i.box&&!i.targetElement||(i.box=i.box||i.targetElement.getBoundingClientRect(),!i.tooltipElement))continue;const{anchorLeft:r,anchorTop:a}=this.tooltipPosition(i.box,i.tooltipElement);i.tooltipTop=a,i.tooltipLeft=r}for(const i of this._renderedEntries){i.tooltipElement&&(i.tooltipElement.style.top=i.tooltipTop+"px",i.tooltipElement.style.left=i.tooltipLeft+"px");const r=i.box;i.highlightElement.style.backgroundColor=i.color,i.highlightElement.style.left=r.x+"px",i.highlightElement.style.top=r.y+"px",i.highlightElement.style.width=r.width+"px",i.highlightElement.style.height=r.height+"px",i.highlightElement.style.display="block",i.borderColor&&(i.highlightElement.style.border="2px solid "+i.borderColor),i.fadeDuration&&(i.highlightElement.style.animation=`pw-fade-out ${i.fadeDuration}ms ease-out forwards`),i.cssStyle&&(i.highlightElement.style.cssText+=";"+i.cssStyle),this._isUnderTest&&console.error("Highlight box for test: "+JSON.stringify({x:r.x,y:r.y,width:r.width,height:r.height}))}}}firstBox(){var e;return(e=this._renderedEntries[0])==null?void 0:e.box}firstTooltipBox(){const e=this._renderedEntries[0];if(!(!e||!e.tooltipElement||e.tooltipLeft===void 0||e.tooltipTop===void 0))return{x:e.tooltipLeft,y:e.tooltipTop,left:e.tooltipLeft,top:e.tooltipTop,width:e.tooltipElement.offsetWidth,height:e.tooltipElement.offsetHeight,bottom:e.tooltipTop+e.tooltipElement.offsetHeight,right:e.tooltipLeft+e.tooltipElement.offsetWidth,toJSON:()=>{}}}tooltipPosition(e,i){const r=i.offsetWidth,a=i.offsetHeight,o=this._glassPaneElement.offsetWidth,u=this._glassPaneElement.offsetHeight;let f=Math.max(5,e.left);f+r>o-5&&(f=o-r-5);let d=Math.max(0,e.bottom)+5;return d+a>u-5&&(Math.max(0,e.top)>a+5?d=Math.max(0,e.top)-a-5:d=u-5-a),{anchorLeft:f,anchorTop:d}}_highlightIsUpToDate(e){if(e.length!==this._renderedEntries.length)return!1;for(let i=0;i<this._renderedEntries.length;++i){if(e[i].element!==this._renderedEntries[i].targetElement||e[i].color!==this._renderedEntries[i].color||e[i].cssStyle!==this._renderedEntries[i].cssStyle)return!1;const r=this._renderedEntries[i].box;if(!r)return!1;const a=e[i].box?zb(e[i].box):e[i].element.getBoundingClientRect();if(a.top!==r.top||a.right!==r.right||a.bottom!==r.bottom||a.left!==r.left)return!1}return!0}_createHighlightElement(){return this._injectedScript.document.createElement("x-pw-highlight")}appendChild(e){this._glassPaneShadow.appendChild(e)}onGlassPaneClick(e){this._glassPaneElement.style.pointerEvents="auto",this._glassPaneElement.style.backgroundColor="rgba(0, 0, 0, 0.3)",this._glassPaneElement.addEventListener("click",e)}offGlassPaneClick(e){this._glassPaneElement.style.pointerEvents="none",this._glassPaneElement.style.backgroundColor="transparent",this._glassPaneElement.removeEventListener("click",e)}}function zb(n){if(n)return new DOMRect(n.x,n.y,n.width,n.height)}function GT(n,e,i){const r=n.left-e.right;if(!(r<0||i!==void 0&&r>i))return r+Math.max(e.bottom-n.bottom,0)+Math.max(n.top-e.top,0)}function KT(n,e,i){const r=e.left-n.right;if(!(r<0||i!==void 0&&r>i))return r+Math.max(e.bottom-n.bottom,0)+Math.max(n.top-e.top,0)}function XT(n,e,i){const r=e.top-n.bottom;if(!(r<0||i!==void 0&&r>i))return r+Math.max(n.left-e.left,0)+Math.max(e.right-n.right,0)}function YT(n,e,i){const r=n.top-e.bottom;if(!(r<0||i!==void 0&&r>i))return r+Math.max(n.left-e.left,0)+Math.max(e.right-n.right,0)}function FT(n,e,i){const r=i===void 0?50:i;let a=0;return n.left-e.right>=0&&(a+=n.left-e.right),e.left-n.right>=0&&(a+=e.left-n.right),e.top-n.bottom>=0&&(a+=e.top-n.bottom),n.top-e.bottom>=0&&(a+=n.top-e.bottom),a>r?void 0:a}const QT=["left-of","right-of","above","below","near"];function zv(n,e,i,r){const a=e.getBoundingClientRect(),o={"left-of":KT,"right-of":GT,above:XT,below:YT,near:FT}[n];let u;for(const f of i){if(f===e)continue;const d=o(a,f.getBoundingClientRect(),r);d!==void 0&&(u===void 0||d<u)&&(u=d)}return u}function Ub(n,e){const i=typeof n=="string"&&!e.caseSensitive?n.toUpperCase():n,r=typeof e.value=="string"&&!e.caseSensitive?e.value.toUpperCase():e.value;return e.op==="<truthy>"?!!i:e.op==="="?r instanceof RegExp?typeof i=="string"&&!!i.match(r):i===r:typeof i!="string"||typeof r!="string"?!1:e.op==="*="?i.includes(r):e.op==="^="?i.startsWith(r):e.op==="$="?i.endsWith(r):e.op==="|="?i===r||i.startsWith(r+"-"):e.op==="~="?i.split(" ").includes(r):!1}function zd(n){const e=n.ownerDocument;return n.nodeName==="SCRIPT"||n.nodeName==="NOSCRIPT"||n.nodeName==="STYLE"||e.head&&e.head.contains(n)}function Kt(n,e){let i=n.get(e);if(i===void 0){if(i={full:"",normalized:"",immediate:[]},!zd(e)){let r="";if(e instanceof HTMLInputElement&&(e.type==="submit"||e.type==="button"))i={full:e.value,normalized:pt(e.value),immediate:[e.value]};else{for(let a=e.firstChild;a;a=a.nextSibling)if(a.nodeType===Node.TEXT_NODE)i.full+=a.nodeValue||"",r+=a.nodeValue||"";else{if(a.nodeType===Node.COMMENT_NODE)continue;r&&i.immediate.push(r),r="",a.nodeType===Node.ELEMENT_NODE&&(i.full+=Kt(n,a).full)}r&&i.immediate.push(r),e.shadowRoot&&(i.full+=Kt(n,e.shadowRoot).full),i.full&&(i.normalized=pt(i.full))}}n.set(e,i)}return i}function Tc(n,e,i){if(zd(e)||!i(Kt(n,e)))return"none";for(let r=e.firstChild;r;r=r.nextSibling)if(r.nodeType===Node.ELEMENT_NODE&&i(Kt(n,r)))return"selfAndChildren";return e.shadowRoot&&i(Kt(n,e.shadowRoot))?"selfAndChildren":"self"}function Uv(n,e){const i=wv(e);if(i)return i.map(o=>Kt(n,o));const r=e.getAttribute("aria-label");if(r!==null&&r.trim())return[{full:r,normalized:pt(r),immediate:[r]}];const a=e.nodeName==="INPUT"&&e.type!=="hidden";if(["BUTTON","METER","OUTPUT","PROGRESS","SELECT","TEXTAREA"].includes(e.nodeName)||a){const o=e.labels;if(o)return[...o].map(u=>Kt(n,u))}return[]}const Hv=["selected","checked","pressed","expanded","level","disabled","name","description","include-hidden"];Hv.sort();function Ua(n,e,i){if(!e.includes(i))throw new Error(`"${n}" attribute is only supported for roles: ${e.slice().sort().map(r=>`"${r}"`).join(", ")}`)}function cr(n,e){if(n.op!=="<truthy>"&&!e.includes(n.value))throw new Error(`"${n.name}" must be one of ${e.map(i=>JSON.stringify(i)).join(", ")}`)}function ur(n,e){if(!e.includes(n.op))throw new Error(`"${n.name}" does not support "${n.op}" matcher`)}function PT(n,e){const i={role:e};for(const r of n)switch(r.name){case"checked":{Ua(r.name,xd,e),cr(r,[!0,!1,"mixed"]),ur(r,["<truthy>","="]),i.checked=r.op==="<truthy>"?!0:r.value;break}case"pressed":{Ua(r.name,Ed,e),cr(r,[!0,!1,"mixed"]),ur(r,["<truthy>","="]),i.pressed=r.op==="<truthy>"?!0:r.value;break}case"selected":{Ua(r.name,wd,e),cr(r,[!0,!1]),ur(r,["<truthy>","="]),i.selected=r.op==="<truthy>"?!0:r.value;break}case"expanded":{Ua(r.name,Td,e),cr(r,[!0,!1]),ur(r,["<truthy>","="]),i.expanded=r.op==="<truthy>"?!0:r.value;break}case"level":{if(Ua(r.name,Ad,e),typeof r.value=="string"&&(r.value=+r.value),r.op!=="="||typeof r.value!="number"||Number.isNaN(r.value))throw new Error('"level" attribute must be compared to a number');i.level=r.value;break}case"disabled":{cr(r,[!0,!1]),ur(r,["<truthy>","="]),i.disabled=r.op==="<truthy>"?!0:r.value;break}case"name":{if(r.op==="<truthy>")throw new Error('"name" attribute must have a value');if(typeof r.value!="string"&&!(r.value instanceof RegExp))throw new Error('"name" attribute must be a string or a regular expression');i.name=r.value,i.nameOp=r.op,i.nameExact=r.caseSensitive;break}case"description":{if(r.op==="<truthy>")throw new Error('"description" attribute must have a value');if(typeof r.value!="string"&&!(r.value instanceof RegExp))throw new Error('"description" attribute must be a string or a regular expression');i.description=r.value,i.descriptionOp=r.op,i.descriptionExact=r.caseSensitive;break}case"include-hidden":{cr(r,[!0,!1]),ur(r,["<truthy>","="]),i.includeHidden=r.op==="<truthy>"?!0:r.value;break}default:throw new Error(`Unknown attribute "${r.name}", must be one of ${Hv.map(a=>`"${a}"`).join(", ")}.`)}return i}function JT(n,e,i){const r=[],a=u=>{if(Tt(u)===e.role&&!(e.selected!==void 0&&_v(u)!==e.selected)&&!(e.checked!==void 0&&Ev(u)!==e.checked)&&!(e.pressed!==void 0&&Tv(u)!==e.pressed)&&!(e.expanded!==void 0&&Av(u)!==e.expanded)&&!(e.level!==void 0&&Cv(u)!==e.level)&&!(e.disabled!==void 0&&hc(u)!==e.disabled)&&!(!e.includeHidden&&gn(u))){if(e.name!==void 0){const f=pt(rl(u,!!e.includeHidden));if(typeof e.name=="string"&&(e.name=pt(e.name)),i&&!e.nameExact&&e.nameOp==="="&&(e.nameOp="*="),!Ub(f,{op:e.nameOp||"=",value:e.name,caseSensitive:!!e.nameExact}))return}if(e.description!==void 0){const f=pt(al(u,!!e.includeHidden));if(typeof e.description=="string"&&(e.description=pt(e.description)),i&&!e.descriptionExact&&e.descriptionOp==="="&&(e.descriptionOp="*="),!Ub(f,{op:e.descriptionOp||"=",value:e.description,caseSensitive:!!e.descriptionExact}))return}r.push(u)}},o=u=>{const f=[];u.shadowRoot&&f.push(u.shadowRoot);for(const d of u.querySelectorAll("*"))a(d),d.shadowRoot&&f.push(d.shadowRoot);f.forEach(o)};return o(n),r}function Hb(n){return{queryAll:(e,i)=>{const r=Er(i),a=r.name.toLowerCase();if(!a)throw new Error("Role must not be empty");const o=PT(r.attributes,a);xc();try{return JT(e,o,n)}finally{_c()}}}}class ZT{constructor(){this._retainCacheCounter=0,this._cacheText=new Map,this._cacheQueryCSS=new Map,this._cacheMatches=new Map,this._cacheQuery=new Map,this._cacheMatchesSimple=new Map,this._cacheMatchesParents=new Map,this._cacheCallMatches=new Map,this._cacheCallQuery=new Map,this._cacheQuerySimple=new Map,this._engines=new Map,this._engines.set("not",tA),this._engines.set("is",Ga),this._engines.set("where",Ga),this._engines.set("has",WT),this._engines.set("scope",eA),this._engines.set("light",nA),this._engines.set("visible",iA),this._engines.set("text",sA),this._engines.set("text-is",rA),this._engines.set("text-matches",aA),this._engines.set("has-text",lA),this._engines.set("right-of",Ha("right-of")),this._engines.set("left-of",Ha("left-of")),this._engines.set("above",Ha("above")),this._engines.set("below",Ha("below")),this._engines.set("near",Ha("near")),this._engines.set("nth-match",oA);const e=[...this._engines.keys()];e.sort();const i=[...B0];if(i.sort(),e.join("|")!==i.join("|"))throw new Error(`Please keep customCSSNames in sync with evaluator engines: ${e.join("|")} vs ${i.join("|")}`)}begin(){++this._retainCacheCounter}end(){--this._retainCacheCounter,this._retainCacheCounter||(this._cacheQueryCSS.clear(),this._cacheMatches.clear(),this._cacheQuery.clear(),this._cacheMatchesSimple.clear(),this._cacheMatchesParents.clear(),this._cacheCallMatches.clear(),this._cacheCallQuery.clear(),this._cacheQuerySimple.clear(),this._cacheText.clear())}_cached(e,i,r,a){e.has(i)||e.set(i,[]);const o=e.get(i),u=o.find(d=>r.every((g,m)=>d.rest[m]===g));if(u)return u.result;const f=a();return o.push({rest:r,result:f}),f}_checkSelector(e){if(!(typeof e=="object"&&e&&(Array.isArray(e)||"simples"in e&&e.simples.length)))throw new Error(`Malformed selector "${e}"`);return e}matches(e,i,r){const a=this._checkSelector(i);this.begin();try{return this._cached(this._cacheMatches,e,[a,r.scope,r.pierceShadow,r.originalScope],()=>Array.isArray(a)?this._matchesEngine(Ga,e,a,r):(this._hasScopeClause(a)&&(r=this._expandContextForScopeMatching(r)),this._matchesSimple(e,a.simples[a.simples.length-1].selector,r)?this._matchesParents(e,a,a.simples.length-2,r):!1))}finally{this.end()}}query(e,i){const r=this._checkSelector(i);this.begin();try{return this._cached(this._cacheQuery,r,[e.scope,e.pierceShadow,e.originalScope],()=>{if(Array.isArray(r))return this._queryEngine(Ga,e,r);this._hasScopeClause(r)&&(e=this._expandContextForScopeMatching(e));const a=this._scoreMap;this._scoreMap=new Map;let o=this._querySimple(e,r.simples[r.simples.length-1].selector);return o=o.filter(u=>this._matchesParents(u,r,r.simples.length-2,e)),this._scoreMap.size&&o.sort((u,f)=>{const d=this._scoreMap.get(u),g=this._scoreMap.get(f);return d===g?0:d===void 0?1:g===void 0?-1:d-g}),this._scoreMap=a,o})}finally{this.end()}}_markScore(e,i){this._scoreMap&&this._scoreMap.set(e,i)}_hasScopeClause(e){return e.simples.some(i=>i.selector.functions.some(r=>r.name==="scope"))}_expandContextForScopeMatching(e){if(e.scope.nodeType!==1)return e;const i=Ct(e.scope);return i?{...e,scope:i,originalScope:e.originalScope||e.scope}:e}_matchesSimple(e,i,r){return this._cached(this._cacheMatchesSimple,e,[i,r.scope,r.pierceShadow,r.originalScope],()=>{if(e===r.scope||i.css&&!this._matchesCSS(e,i.css))return!1;for(const a of i.functions)if(!this._matchesEngine(this._getEngine(a.name),e,a.args,r))return!1;return!0})}_querySimple(e,i){return i.functions.length?this._cached(this._cacheQuerySimple,i,[e.scope,e.pierceShadow,e.originalScope],()=>{let r=i.css;const a=i.functions;r==="*"&&a.length&&(r=void 0);let o,u=-1;r!==void 0?o=this._queryCSS(e,r):(u=a.findIndex(f=>this._getEngine(f.name).query!==void 0),u===-1&&(u=0),o=this._queryEngine(this._getEngine(a[u].name),e,a[u].args));for(let f=0;f<a.length;f++){if(f===u)continue;const d=this._getEngine(a[f].name);d.matches!==void 0&&(o=o.filter(g=>this._matchesEngine(d,g,a[f].args,e)))}for(let f=0;f<a.length;f++){if(f===u)continue;const d=this._getEngine(a[f].name);d.matches===void 0&&(o=o.filter(g=>this._matchesEngine(d,g,a[f].args,e)))}return o}):this._queryCSS(e,i.css||"*")}_matchesParents(e,i,r,a){return r<0?!0:this._cached(this._cacheMatchesParents,e,[i,r,a.scope,a.pierceShadow,a.originalScope],()=>{const{selector:o,combinator:u}=i.simples[r];if(u===">"){const f=Uo(e,a);return!f||!this._matchesSimple(f,o,a)?!1:this._matchesParents(f,i,r-1,a)}if(u==="+"){const f=yh(e,a);return!f||!this._matchesSimple(f,o,a)?!1:this._matchesParents(f,i,r-1,a)}if(u===""){let f=Uo(e,a);for(;f;){if(this._matchesSimple(f,o,a)){if(this._matchesParents(f,i,r-1,a))return!0;if(i.simples[r-1].combinator==="")break}f=Uo(f,a)}return!1}if(u==="~"){let f=yh(e,a);for(;f;){if(this._matchesSimple(f,o,a)){if(this._matchesParents(f,i,r-1,a))return!0;if(i.simples[r-1].combinator==="~")break}f=yh(f,a)}return!1}if(u===">="){let f=e;for(;f;){if(this._matchesSimple(f,o,a)){if(this._matchesParents(f,i,r-1,a))return!0;if(i.simples[r-1].combinator==="")break}f=Uo(f,a)}return!1}throw new Error(`Unsupported combinator "${u}"`)})}_matchesEngine(e,i,r,a){if(e.matches)return this._callMatches(e,i,r,a);if(e.query)return this._callQuery(e,r,a).includes(i);throw new Error('Selector engine should implement "matches" or "query"')}_queryEngine(e,i,r){if(e.query)return this._callQuery(e,r,i);if(e.matches)return this._queryCSS(i,"*").filter(a=>this._callMatches(e,a,r,i));throw new Error('Selector engine should implement "matches" or "query"')}_callMatches(e,i,r,a){return this._cached(this._cacheCallMatches,i,[e,a.scope,a.pierceShadow,a.originalScope,...r],()=>e.matches(i,r,a,this))}_callQuery(e,i,r){return this._cached(this._cacheCallQuery,e,[r.scope,r.pierceShadow,r.originalScope,...i],()=>e.query(r,i,this))}_matchesCSS(e,i){return e.matches(i)}_queryCSS(e,i){return this._cached(this._cacheQueryCSS,i,[e.scope,e.pierceShadow,e.originalScope],()=>{let r=[];function a(o){if(r=r.concat([...o.querySelectorAll(i)]),!!e.pierceShadow){o.shadowRoot&&a(o.shadowRoot);for(const u of o.querySelectorAll("*"))u.shadowRoot&&a(u.shadowRoot)}}return a(e.scope),r})}_getEngine(e){const i=this._engines.get(e);if(!i)throw new Error(`Unknown selector engine "${e}"`);return i}}const Ga={matches(n,e,i,r){if(e.length===0)throw new Error('"is" engine expects non-empty selector list');return e.some(a=>r.matches(n,a,i))},query(n,e,i){if(e.length===0)throw new Error('"is" engine expects non-empty selector list');let r=[];for(const a of e)r=r.concat(i.query(n,a));return e.length===1?r:Bv(r)}},WT={matches(n,e,i,r){if(e.length===0)throw new Error('"has" engine expects non-empty selector list');return r.query({...i,scope:n},e).length>0}},eA={matches(n,e,i,r){if(e.length!==0)throw new Error('"scope" engine expects no arguments');const a=i.originalScope||i.scope;return a.nodeType===9?n===a.documentElement:n===a},query(n,e,i){if(e.length!==0)throw new Error('"scope" engine expects no arguments');const r=n.originalScope||n.scope;if(r.nodeType===9){const a=r.documentElement;return a?[a]:[]}return r.nodeType===1?[r]:[]}},tA={matches(n,e,i,r){if(e.length===0)throw new Error('"not" engine expects non-empty selector list');return!r.matches(n,e,i)}},nA={query(n,e,i){return i.query({...n,pierceShadow:!1},e)},matches(n,e,i,r){return r.matches(n,e,{...i,pierceShadow:!1})}},iA={matches(n,e,i,r){if(e.length)throw new Error('"visible" engine expects no arguments');return ii(n)}},sA={matches(n,e,i,r){if(e.length!==1||typeof e[0]!="string")throw new Error('"text" engine expects a single string');const a=pt(e[0]).toLowerCase(),o=u=>u.normalized.toLowerCase().includes(a);return Tc(r._cacheText,n,o)==="self"}},rA={matches(n,e,i,r){if(e.length!==1||typeof e[0]!="string")throw new Error('"text-is" engine expects a single string');const a=pt(e[0]),o=u=>!a&&!u.immediate.length?!0:u.immediate.some(f=>pt(f)===a);return Tc(r._cacheText,n,o)!=="none"}},aA={matches(n,e,i,r){if(e.length===0||typeof e[0]!="string"||e.length>2||e.length===2&&typeof e[1]!="string")throw new Error('"text-matches" engine expects a regexp body and optional regexp flags');const a=new RegExp(e[0],e.length===2?e[1]:void 0),o=u=>a.test(u.full);return Tc(r._cacheText,n,o)==="self"}},lA={matches(n,e,i,r){if(e.length!==1||typeof e[0]!="string")throw new Error('"has-text" engine expects a single string');if(zd(n))return!1;const a=pt(e[0]).toLowerCase();return(u=>u.normalized.toLowerCase().includes(a))(Kt(r._cacheText,n))}};function Ha(n){return{matches(e,i,r,a){const o=i.length&&typeof i[i.length-1]=="number"?i[i.length-1]:void 0,u=o===void 0?i:i.slice(0,i.length-1);if(i.length<1+(o===void 0?0:1))throw new Error(`"${n}" engine expects a selector list and optional maximum distance in pixels`);const f=a.query(r,u),d=zv(n,e,f,o);return d===void 0?!1:(a._markScore(e,d),!0)}}}const oA={query(n,e,i){let r=e[e.length-1];if(e.length<2)throw new Error('"nth-match" engine expects non-empty selector list and an index argument');if(typeof r!="number"||r<1)throw new Error('"nth-match" engine expects a one-based index as the last argument');const a=Ga.query(n,e.slice(0,e.length-1),i);return r--,r<a.length?[a[r]]:[]}};function Uo(n,e){if(n!==e.scope)return e.pierceShadow?Ct(n):n.parentElement||void 0}function yh(n,e){if(n!==e.scope)return n.previousElementSibling||void 0}function Bv(n){const e=new Map,i=[],r=[];function a(u){let f=e.get(u);if(f)return f;const d=Ct(u);return d?a(d).children.push(u):i.push(u),f={children:[],taken:!1},e.set(u,f),f}for(const u of n)a(u).taken=!0;function o(u){const f=e.get(u);if(f.taken&&r.push(u),f.children.length>1){const d=new Set(f.children);f.children=[];let g=u.firstElementChild;for(;g&&f.children.length<d.size;)d.has(g)&&f.children.push(g),g=g.nextElementSibling;for(g=u.shadowRoot?u.shadowRoot.firstElementChild:null;g&&f.children.length<d.size;)d.has(g)&&f.children.push(g),g=g.nextElementSibling}f.children.forEach(o)}return i.forEach(o),r}const qv=10,Lr=qv/2,Bb=1,cA=2,uA=10,fA=50,qh=100,$v=120,Iv=140,Vv=160,Zo=180,Gv=200,qb=250,hA=$v+Lr,dA=Iv+Lr,$b=qh+Lr,pA=Vv+Lr,gA=Zo+Lr,mA=Gv+Lr,yA=300,bA=500,$h=510,bh=520,Kv=530,Ih=1e4,vA=1e7,SA=1e3;function Ib(n,e,i){n._evaluator.begin();const r={allowText:new Map,disallowText:new Map};xc(),bd();try{let a=[];if(i.forTextExpect){let f=Ka(n,e.ownerDocument.documentElement,i);for(let d=e;d;d=Ct(d)){const g=rs(r,n,d,{...i,noText:!0});if(!g)continue;if(as(g)<=SA){f=g;break}}a=[Wo(f)]}else{if(!e.matches("input,textarea,select")&&!e.isContentEditable){const f=Va(e,"button,select,input,[role=button],[role=checkbox],[role=radio],a,[role=link]",i.root);f&&ii(f)&&(e=f)}if(i.multiple){const f=rs(r,n,e,i),d=rs(r,n,e,{...i,noText:!0});let g=[f,d];if(r.allowText.clear(),r.disallowText.clear(),f&&vh(f)&&g.push(rs(r,n,e,{...i,noCSSId:!0})),d&&vh(d)&&g.push(rs(r,n,e,{...i,noText:!0,noCSSId:!0})),g=g.filter(Boolean),!g.length){const m=Ka(n,e,i);g.push(m),vh(m)&&g.push(Ka(n,e,{...i,noCSSId:!0}))}a=[...new Set(g.map(m=>Wo(m)))]}else{const f=rs(r,n,e,i)||Ka(n,e,i);a=[Wo(f)]}}const o=a[0],u=n.parseSelector(o);return{selector:o,selectors:a,elements:n.querySelectorAll(u,i.root??e.ownerDocument)}}finally{vd(),_c(),n._evaluator.end()}}function rs(n,e,i,r){if(r.root&&!Hh(r.root,i))throw new Error("Target element must belong to the root's subtree");if(i===r.root)return[{engine:"css",selector:":scope",score:1}];if(i.ownerDocument.documentElement===i)return[{engine:"css",selector:"html",score:1}];let a=null;const o=f=>{(!a||as(f)<as(a))&&(a=f)},u=[];if(!r.noText)for(const f of xA(e,i,!r.isRecursive))u.push({candidate:f,isTextCandidate:!0});for(const f of wA(e,i,r))r.omitInternalEngines&&f.engine.startsWith("internal:")||u.push({candidate:[f],isTextCandidate:!1});u.sort((f,d)=>as(f.candidate)-as(d.candidate));for(const{candidate:f,isTextCandidate:d}of u){const g=e.querySelectorAll(e.parseSelector(Wo(f)),r.root??i.ownerDocument);if(!g.includes(i))continue;if(g.length===1){o(f);break}const m=g.indexOf(i);if(!(m>5)&&(o([...f,{engine:"nth",selector:String(m),score:Ih}]),!r.isRecursive))for(let y=Ct(i);y&&y!==r.root;y=Ct(y)){const S=g.filter(H=>Hh(y,H)&&H!==y),w=S.indexOf(i);if(S.length>5||w===-1||w===m&&S.length>1)continue;const E=S.length===1?f:[...f,{engine:"nth",selector:String(w),score:Ih}];if(a&&as([{engine:"",selector:"",score:1},...E])>=as(a))continue;const _=!!r.noText||d,A=_?n.disallowText:n.allowText;let C=A.get(y);C===void 0&&(C=rs(n,e,y,{...r,isRecursive:!0,noText:_})||Ka(e,y,r),A.set(y,C)),C&&o([...C,...E])}}return a}function wA(n,e,i){const r=[],a=av(i.testIdAttributeName);{for(const f of["data-testid","data-test-id","data-test"])!a.includes(f)&&e.getAttribute(f)&&r.push({engine:"css",selector:`[${f}=${gr(e.getAttribute(f))}]`,score:cA});if(!i.noCSSId){const f=e.getAttribute("id");f&&!_A(f)&&r.push({engine:"css",selector:Xv(f),score:bA})}r.push({engine:"css",selector:ni(e),score:Kv})}if(e.nodeName==="IFRAME"){for(const f of["name","title"])e.getAttribute(f)&&r.push({engine:"css",selector:`${ni(e)}[${f}=${gr(e.getAttribute(f))}]`,score:uA});for(const f of a)e.getAttribute(f)&&r.push({engine:"css",selector:`[${f}=${gr(e.getAttribute(f))}]`,score:Bb});return Vh([r]),r}for(const f of a)e.getAttribute(f)&&r.push({engine:"internal:testid",selector:`[${f}=${Ze(e.getAttribute(f),!0)}]`,score:Bb});if(e.nodeName==="INPUT"||e.nodeName==="TEXTAREA"){const f=e;if(f.placeholder){r.push({engine:"internal:attr",selector:`[placeholder=${Ze(f.placeholder,!0)}]`,score:hA});for(const d of cs(f.placeholder))r.push({engine:"internal:attr",selector:`[placeholder=${Ze(d.text,!1)}]`,score:$v-d.scoreBonus})}}const o=Uv(n._evaluator._cacheText,e);for(const f of o){const d=f.normalized;r.push({engine:"internal:label",selector:Vt(d,!0),score:dA});for(const g of cs(d))r.push({engine:"internal:label",selector:Vt(g.text,!1),score:Iv-g.scoreBonus})}const u=Tt(e);return u&&!["none","presentation"].includes(u)&&r.push({engine:"internal:role",selector:u,score:$h}),e.getAttribute("name")&&["BUTTON","FORM","FIELDSET","FRAME","IFRAME","INPUT","KEYGEN","OBJECT","OUTPUT","SELECT","TEXTAREA","MAP","META","PARAM"].includes(e.nodeName)&&r.push({engine:"css",selector:`${ni(e)}[name=${gr(e.getAttribute("name"))}]`,score:bh}),["INPUT","TEXTAREA"].includes(e.nodeName)&&e.getAttribute("type")!=="hidden"&&e.getAttribute("type")&&r.push({engine:"css",selector:`${ni(e)}[type=${gr(e.getAttribute("type"))}]`,score:bh}),["INPUT","TEXTAREA","SELECT"].includes(e.nodeName)&&e.getAttribute("type")!=="hidden"&&r.push({engine:"css",selector:ni(e),score:bh+1}),Vh([r]),r}function xA(n,e,i){if(e.nodeName==="SELECT")return[];const r=[],a=e.getAttribute("title");if(a){r.push([{engine:"internal:attr",selector:`[title=${Ze(a,!0)}]`,score:mA}]);for(const g of cs(a))r.push([{engine:"internal:attr",selector:`[title=${Ze(g.text,!1)}]`,score:Gv-g.scoreBonus}])}const o=e.getAttribute("alt");if(o&&["APPLET","AREA","IMG","INPUT"].includes(e.nodeName)){r.push([{engine:"internal:attr",selector:`[alt=${Ze(o,!0)}]`,score:pA}]);for(const g of cs(o))r.push([{engine:"internal:attr",selector:`[alt=${Ze(g.text,!1)}]`,score:Vv-g.scoreBonus}])}const u=Kt(n._evaluator._cacheText,e).normalized,f=u?cs(u):[];if(u){if(i){u.length<=80&&r.push([{engine:"internal:text",selector:Vt(u,!0),score:gA}]);for(const m of f)r.push([{engine:"internal:text",selector:Vt(m.text,!1),score:Zo-m.scoreBonus}])}const g={engine:"css",selector:ni(e),score:Kv};for(const m of f)r.push([g,{engine:"internal:has-text",selector:Vt(m.text,!1),score:Zo-m.scoreBonus}]);if(i&&u.length<=80){const m=new RegExp("^"+lc(u)+"$");r.push([g,{engine:"internal:has-text",selector:Vt(m,!1),score:qb}])}}const d=Tt(e);if(d&&!["none","presentation"].includes(d)){const g=rl(e,!1);if(g&&!g.match(new RegExp("^\\p{Co}+$","u"))){const m={engine:"internal:role",selector:`${d}[name=${Ze(g,!0)}]`,score:$b};r.push([m]);for(const S of cs(g))r.push([{engine:"internal:role",selector:`${d}[name=${Ze(S.text,!1)}]`,score:qh-S.scoreBonus}]);const y=al(e,!1);if(y){r.push([{engine:"internal:role",selector:`${d}[name=${Ze(g,!0)}][description=${Ze(y,!0)}]`,score:$b+1}]);for(const S of cs(g))r.push([{engine:"internal:role",selector:`${d}[name=${Ze(S.text,!1)}][description=${Ze(y,!1)}]`,score:qh-S.scoreBonus+1}])}}else{const m={engine:"internal:role",selector:`${d}`,score:$h},y=al(e,!1);y&&r.push([{engine:"internal:role",selector:`${d}[description=${Ze(y,!0)}]`,score:$h+1}]);for(const S of f)r.push([m,{engine:"internal:has-text",selector:Vt(S.text,!1),score:Zo-S.scoreBonus}]);if(i&&u.length<=80){const S=new RegExp("^"+lc(u)+"$");r.push([m,{engine:"internal:has-text",selector:Vt(S,!1),score:qb}])}}}return Vh(r),r}function Xv(n){return/^[a-zA-Z][a-zA-Z0-9\-\_]+$/.test(n)?"#"+n:`[id=${gr(n)}]`}function vh(n){return n.some(e=>e.engine==="css"&&(e.selector.startsWith("#")||e.selector.startsWith('[id="')))}function Ka(n,e,i){const r=i.root??e.ownerDocument,a=[];function o(f){const d=a.slice();f&&d.unshift(f);const g=d.join(" > "),m=n.parseSelector(g);return n.querySelector(m,r,!1)===e?g:void 0}function u(f){const d={engine:"css",selector:f,score:vA},g=n.parseSelector(f),m=n.querySelectorAll(g,r);if(m.length===1)return[d];const y={engine:"nth",selector:String(m.indexOf(e)),score:Ih};return[d,y]}for(let f=e;f&&f!==r;f=Ct(f)){let d="";if(f.id&&!i.noCSSId){const y=Xv(f.id),S=o(y);if(S)return u(S);d=y}const g=f.parentNode,m=[...f.classList].map(EA);for(let y=0;y<m.length;++y){const S="."+m.slice(0,y+1).join("."),w=o(S);if(w)return u(w);!d&&g&&g.querySelectorAll(S).length===1&&(d=S)}if(g){const y=[...g.children],S=f.nodeName,E=y.filter(_=>_.nodeName===S).indexOf(f)===0?ni(f):`${ni(f)}:nth-child(${1+y.indexOf(f)})`,x=o(E);if(x)return u(x);d||(d=E)}else d||(d=ni(f));a.unshift(d)}return u(o())}function Vh(n){for(const e of n)for(const i of e)i.score>fA&&i.score<yA&&(i.score+=Math.min(qv,i.selector.length/10|0))}function Wo(n){const e=[];let i="";for(const{engine:r,selector:a}of n)e.length&&(i!=="css"||r!=="css"||a.startsWith(":nth-match("))&&e.push(">>"),i=r,r==="css"?e.push(a):e.push(`${r}=${a}`);return e.join(" ")}function as(n){let e=0;for(let i=0;i<n.length;i++)e+=n[i].score*(n.length-i);return e}function _A(n){let e,i=0;for(let r=0;r<n.length;++r){const a=n[r];let o;if(!(a==="-"||a==="_")){if(a>="a"&&a<="z"?o="lower":a>="A"&&a<="Z"?o="upper":a>="0"&&a<="9"?o="digit":o="other",o==="lower"&&e==="upper"){e=o;continue}e&&e!==o&&++i,e=o}}return i>=n.length/4}function Ho(n,e){if(n.length<=e)return n;n=n.substring(0,e);const i=n.match(/^(.*)\b(.+?)$/);return i?i[1].trimEnd():""}function cs(n){let e=[];{const i=n.match(/^([\d.,]+)[^.,\w]/),r=i?i[1].length:0;if(r){const a=Ho(n.substring(r).trimStart(),80);e.push({text:a,scoreBonus:a.length<=30?2:1})}}{const i=n.match(/[^.,\w]([\d.,]+)$/),r=i?i[1].length:0;if(r){const a=Ho(n.substring(0,n.length-r).trimEnd(),80);e.push({text:a,scoreBonus:a.length<=30?2:1})}}return n.length<=30?e.push({text:n,scoreBonus:0}):(e.push({text:Ho(n,80),scoreBonus:0}),e.push({text:Ho(n,30),scoreBonus:1})),e=e.filter(i=>i.text),e.length||e.push({text:n.substring(0,80),scoreBonus:0}),e}function ni(n){return n.nodeName.toLocaleLowerCase().replace(/[:\.]/g,e=>"\\"+e)}function EA(n){let e="";for(let i=0;i<n.length;i++)e+=TA(n,i);return e}function TA(n,e){const i=n.charCodeAt(e);return i===0?"ï¿½":i>=1&&i<=31||i>=48&&i<=57&&(e===0||e===1&&n.charCodeAt(0)===45)?"\\"+i.toString(16)+" ":e===0&&i===45&&n.length===1?"\\"+n.charAt(e):i>=128||i===45||i===95||i>=48&&i<=57||i>=65&&i<=90||i>=97&&i<=122?n.charAt(e):"\\"+n.charAt(e)}const Vb={queryAll(n,e){e.startsWith("/")&&n.nodeType!==Node.DOCUMENT_NODE&&(e="."+e);const i=[],r=n.ownerDocument||n;if(!r)return i;const a=r.evaluate(e,n,null,XPathResult.ORDERED_NODE_ITERATOR_TYPE);for(let o=a.iterateNext();o;o=a.iterateNext())o.nodeType===Node.ELEMENT_NODE&&i.push(o);return i}},Ba=Symbol("selector"),AA=class Xa{constructor(e,i,r){if(r!=null&&r.hasText&&(i+=` >> internal:has-text=${Vt(r.hasText,!1)}`),r!=null&&r.hasNotText&&(i+=` >> internal:has-not-text=${Vt(r.hasNotText,!1)}`),r!=null&&r.has&&(i+=" >> internal:has="+JSON.stringify(r.has[Ba])),r!=null&&r.hasNot&&(i+=" >> internal:has-not="+JSON.stringify(r.hasNot[Ba])),(r==null?void 0:r.visible)!==void 0&&(i+=` >> visible=${r.visible?"true":"false"}`),this[Ba]=i,i){const u=e.parseSelector(i);this.element=e.querySelector(u,e.document,!1),this.elements=e.querySelectorAll(u,e.document)}const a=i,o=this;o.locator=(u,f)=>new Xa(e,a?a+" >> "+u:u,f),o.getByTestId=u=>o.locator(sT(e.testIdAttributeNameForStrictErrorAndConsoleCodegen(),u)),o.getByAltText=(u,f)=>o.locator(aT(u,f)),o.getByLabel=(u,f)=>o.locator(rT(u,f)),o.getByPlaceholder=(u,f)=>o.locator(oT(u,f)),o.getByText=(u,f)=>o.locator(cT(u,f)),o.getByTitle=(u,f)=>o.locator(lT(u,f)),o.getByRole=(u,f={})=>o.locator(uT(u,f)),o.filter=u=>new Xa(e,i,u),o.first=()=>o.locator("nth=0"),o.last=()=>o.locator("nth=-1"),o.nth=u=>o.locator(`nth=${u}`),o.and=u=>new Xa(e,a+" >> internal:and="+JSON.stringify(u[Ba])),o.or=u=>new Xa(e,a+" >> internal:or="+JSON.stringify(u[Ba]))}};let CA=AA;class NA{constructor(e){this._injectedScript=e}install(){this._injectedScript.window.playwright||(this._injectedScript.window.playwright={$:(e,i)=>this._querySelector(e,!!i),$$:e=>this._querySelectorAll(e),inspect:e=>this._inspect(e),selector:e=>this._selector(e),generateLocator:(e,i)=>this._generateLocator(e,i),ariaSnapshot:(e,i)=>this._injectedScript.ariaSnapshot(e||this._injectedScript.document.body,i||{mode:"default"}),resume:()=>this._resume(),...new CA(this._injectedScript,"")},delete this._injectedScript.window.playwright.filter,delete this._injectedScript.window.playwright.first,delete this._injectedScript.window.playwright.last,delete this._injectedScript.window.playwright.nth,delete this._injectedScript.window.playwright.and,delete this._injectedScript.window.playwright.or)}_querySelector(e,i){if(typeof e!="string")throw new Error("Usage: playwright.query('Playwright >> selector').");const r=this._injectedScript.parseSelector(e);return this._injectedScript.querySelector(r,this._injectedScript.document,i)}_querySelectorAll(e){if(typeof e!="string")throw new Error("Usage: playwright.$$('Playwright >> selector').");const i=this._injectedScript.parseSelector(e);return this._injectedScript.querySelectorAll(i,this._injectedScript.document)}_inspect(e){if(typeof e!="string")throw new Error("Usage: playwright.inspect('Playwright >> selector').");this._injectedScript.window.inspect(this._querySelector(e,!1))}_selector(e){if(!(e instanceof Element))throw new Error("Usage: playwright.selector(element).");return this._injectedScript.generateSelectorSimple(e)}_generateLocator(e,i){if(!(e instanceof Element))throw new Error("Usage: playwright.locator(element).");const r=this._injectedScript.generateSelectorSimple(e);return Ri(i||"javascript",r)}_resume(){if(!this._injectedScript.window.__pw_resume)return!1;this._injectedScript.window.__pw_resume().catch(()=>{})}}function kA(n){try{return n instanceof RegExp||Object.prototype.toString.call(n)==="[object RegExp]"}catch{return!1}}function MA(n){try{return n instanceof Date||Object.prototype.toString.call(n)==="[object Date]"}catch{return!1}}function OA(n){try{return n instanceof URL||Object.prototype.toString.call(n)==="[object URL]"}catch{return!1}}function jA(n){var e;try{return n instanceof Error||n&&((e=Object.getPrototypeOf(n))==null?void 0:e.name)==="Error"}catch{return!1}}function LA(n,e){try{return n instanceof e||Object.prototype.toString.call(n)===`[object ${e.name}]`}catch{return!1}}function RA(n){try{return n instanceof ArrayBuffer||Object.prototype.toString.call(n)==="[object ArrayBuffer]"}catch{return!1}}const Yv={i8:Int8Array,ui8:Uint8Array,ui8c:Uint8ClampedArray,i16:Int16Array,ui16:Uint16Array,i32:Int32Array,ui32:Uint32Array,f32:Float32Array,f64:Float64Array,bi64:BigInt64Array,bui64:BigUint64Array};function Gb(n){if("toBase64"in n)return n.toBase64();const e=Array.from(new Uint8Array(n.buffer,n.byteOffset,n.byteLength)).map(i=>String.fromCharCode(i)).join("");return btoa(e)}function Kb(n,e){const i=atob(n),r=new Uint8Array(i.length);for(let a=0;a<i.length;a++)r[a]=i.charCodeAt(a);return new e(r.buffer)}function Gh(n,e=[],i=new Map){if(!Object.is(n,void 0)){if(typeof n=="object"&&n){if("ref"in n)return i.get(n.ref);if("v"in n)return n.v==="undefined"?void 0:n.v==="null"?null:n.v==="NaN"?NaN:n.v==="Infinity"?1/0:n.v==="-Infinity"?-1/0:n.v==="-0"?-0:void 0;if("d"in n)return new Date(n.d);if("u"in n)return new URL(n.u);if("bi"in n)return BigInt(n.bi);if("e"in n){const r=new Error(n.e.m);return r.name=n.e.n,r.stack=n.e.s,r}if("r"in n)return new RegExp(n.r.p,n.r.f);if("a"in n){const r=[];i.set(n.id,r);for(const a of n.a)r.push(Gh(a,e,i));return r}if("o"in n){const r={};i.set(n.id,r);for(const{k:a,v:o}of n.o)a!=="__proto__"&&(r[a]=Gh(o,e,i));return r}if("h"in n)return e[n.h];if("ta"in n)return Kb(n.ta.b,Yv[n.ta.k]);if("ab"in n)return Kb(n.ab.b,Uint8Array).buffer}return n}}function DA(n,e){return Kh(n,e,{visited:new Map,lastId:0})}function Kh(n,e,i){if(n&&typeof n=="object"){if(typeof globalThis.Window=="function"&&n instanceof globalThis.Window)return"ref: <Window>";if(typeof globalThis.Document=="function"&&n instanceof globalThis.Document)return"ref: <Document>";if(typeof globalThis.Node=="function"&&n instanceof globalThis.Node)return"ref: <Node>"}return Fv(n,e,i)}function Fv(n,e,i){var o;const r=e(n);if("fallThrough"in r)n=r.fallThrough;else return r;if(typeof n=="symbol")return{v:"undefined"};if(Object.is(n,void 0))return{v:"undefined"};if(Object.is(n,null))return{v:"null"};if(Object.is(n,NaN))return{v:"NaN"};if(Object.is(n,1/0))return{v:"Infinity"};if(Object.is(n,-1/0))return{v:"-Infinity"};if(Object.is(n,-0))return{v:"-0"};if(typeof n=="boolean"||typeof n=="number"||typeof n=="string")return n;if(typeof n=="bigint")return{bi:n.toString()};if(jA(n)){let u;return(o=n.stack)!=null&&o.startsWith(n.name+": "+n.message)?u=n.stack:u=`${n.name}: ${n.message}
${n.stack}`,{e:{n:n.name,m:n.message,s:u}}}if(MA(n))return{d:n.toJSON()};if(OA(n))return{u:n.toJSON()};if(kA(n))return{r:{p:n.source,f:n.flags}};for(const[u,f]of Object.entries(Yv))if(LA(n,f))return{ta:{b:Gb(n),k:u}};if(RA(n))return{ab:{b:Gb(new Uint8Array(n))}};const a=i.visited.get(n);if(a)return{ref:a};if(Array.isArray(n)){const u=[],f=++i.lastId;i.visited.set(n,f);for(let d=0;d<n.length;++d)u.push(Kh(n[d],e,i));return{a:u,id:f}}if(typeof n=="object"){const u=[],f=++i.lastId;i.visited.set(n,f);for(const g of Object.keys(n)){let m;try{m=n[g]}catch{continue}g==="toJSON"&&typeof m=="function"?u.push({k:g,v:{o:[],id:0}}):u.push({k:g,v:Kh(m,e,i)})}let d;try{u.length===0&&n.toJSON&&typeof n.toJSON=="function"&&(d={value:n.toJSON()})}catch{}return d?Fv(d.value,e,i):{o:u,id:f}}}class zA{constructor(e,i){var r,a,o,u,f,d,g,m;this.global=e,this.isUnderTest=i,e.__pwClock?this.builtins=e.__pwClock.builtins:this.builtins={setTimeout:(r=e.setTimeout)==null?void 0:r.bind(e),clearTimeout:(a=e.clearTimeout)==null?void 0:a.bind(e),setInterval:(o=e.setInterval)==null?void 0:o.bind(e),clearInterval:(u=e.clearInterval)==null?void 0:u.bind(e),requestAnimationFrame:(f=e.requestAnimationFrame)==null?void 0:f.bind(e),cancelAnimationFrame:(d=e.cancelAnimationFrame)==null?void 0:d.bind(e),requestIdleCallback:(g=e.requestIdleCallback)==null?void 0:g.bind(e),cancelIdleCallback:(m=e.cancelIdleCallback)==null?void 0:m.bind(e),performance:e.performance,Intl:e.Intl,Date:e.Date,AbortSignal:e.AbortSignal},this.isUnderTest&&(e.builtins=this.builtins)}evaluate(e,i,r,a,...o){const u=o.slice(0,a),f=o.slice(a),d=[];for(let m=0;m<u.length;m++)d[m]=Gh(u[m],f);let g=this.global.eval(r);return e===!0?g=g(...d):e===!1?g=g:typeof g=="function"&&(g=g(...d)),i?this._promiseAwareJsonValueNoThrow(g):g}jsonValue(e,i){if(i!==void 0)return DA(i,r=>({fallThrough:r}))}_promiseAwareJsonValueNoThrow(e){const i=r=>{try{return this.jsonValue(!0,r)}catch{return}};return e&&typeof e=="object"&&typeof e.then=="function"?(async()=>{const r=await e;return i(r)})():i(e)}}class Qv{constructor(e,i){this._testIdAttributeNameForStrictErrorAndConsoleCodegen="data-testid",this._lastAriaSnapshotForTrack=new Map,this.utils={asLocator:Ri,cacheNormalizedWhitespaces:g_,elementText:Kt,getAriaRole:Tt,getElementAccessibleDescription:al,getElementAccessibleName:rl,isElementVisible:ii,isInsideScope:Hh,normalizeWhiteSpace:pt,parseAriaSnapshot:dd,generateAriaTree:br,findNewElement:VT,builtins:null},this.window=e,this.document=e.document,this.isUnderTest=i.isUnderTest,this.utils.builtins=new zA(e,i.isUnderTest).builtins,this._sdkLanguage=i.sdkLanguage,this._testIdAttributeNameForStrictErrorAndConsoleCodegen=i.testIdAttributeName,this._evaluator=new ZT,this.consoleApi=new NA(this),this.onGlobalListenersRemoved=new Set,this._autoClosingTags=new Set(["AREA","BASE","BR","COL","COMMAND","EMBED","HR","IMG","INPUT","KEYGEN","LINK","MENUITEM","META","PARAM","SOURCE","TRACK","WBR"]),this._booleanAttributes=new Set(["checked","selected","disabled","readonly","multiple"]),this._eventTypes=new Map([["auxclick","mouse"],["click","mouse"],["dblclick","mouse"],["mousedown","mouse"],["mouseeenter","mouse"],["mouseleave","mouse"],["mousemove","mouse"],["mouseout","mouse"],["mouseover","mouse"],["mouseup","mouse"],["mouseleave","mouse"],["mousewheel","mouse"],["keydown","keyboard"],["keyup","keyboard"],["keypress","keyboard"],["textInput","keyboard"],["touchstart","touch"],["touchmove","touch"],["touchend","touch"],["touchcancel","touch"],["pointerover","pointer"],["pointerout","pointer"],["pointerenter","pointer"],["pointerleave","pointer"],["pointerdown","pointer"],["pointerup","pointer"],["pointermove","pointer"],["pointercancel","pointer"],["gotpointercapture","pointer"],["lostpointercapture","pointer"],["focus","focus"],["blur","focus"],["drag","drag"],["dragstart","drag"],["dragend","drag"],["dragover","drag"],["dragenter","drag"],["dragleave","drag"],["dragexit","drag"],["drop","drag"],["wheel","wheel"],["deviceorientation","deviceorientation"],["deviceorientationabsolute","deviceorientation"],["devicemotion","devicemotion"]]),this._hoverHitTargetInterceptorEvents=new Set(["mousemove"]),this._tapHitTargetInterceptorEvents=new Set(["pointerdown","pointerup","touchstart","touchend","touchcancel"]),this._mouseHitTargetInterceptorEvents=new Set(["mousedown","mouseup","pointerdown","pointerup","click","auxclick","dblclick","contextmenu"]),this._allHitTargetInterceptorEvents=new Set([...this._hoverHitTargetInterceptorEvents,...this._tapHitTargetInterceptorEvents,...this._mouseHitTargetInterceptorEvents]),this._engines=new Map,this._engines.set("xpath",Vb),this._engines.set("xpath:light",Vb),this._engines.set("role",Hb(!1)),this._engines.set("text",this._createTextEngine(!0,!1)),this._engines.set("text:light",this._createTextEngine(!1,!1)),this._engines.set("id",this._createAttributeEngine("id",!0)),this._engines.set("id:light",this._createAttributeEngine("id",!1)),this._engines.set("data-testid",this._createAttributeEngine("data-testid",!0)),this._engines.set("data-testid:light",this._createAttributeEngine("data-testid",!1)),this._engines.set("data-test-id",this._createAttributeEngine("data-test-id",!0)),this._engines.set("data-test-id:light",this._createAttributeEngine("data-test-id",!1)),this._engines.set("data-test",this._createAttributeEngine("data-test",!0)),this._engines.set("data-test:light",this._createAttributeEngine("data-test",!1)),this._engines.set("css",this._createCSSEngine()),this._engines.set("nth",{queryAll:()=>[]}),this._engines.set("visible",this._createVisibleEngine()),this._engines.set("internal:control",this._createControlEngine()),this._engines.set("internal:has",this._createHasEngine()),this._engines.set("internal:has-not",this._createHasNotEngine()),this._engines.set("internal:and",{queryAll:()=>[]}),this._engines.set("internal:or",{queryAll:()=>[]}),this._engines.set("internal:chain",this._createInternalChainEngine()),this._engines.set("internal:label",this._createInternalLabelEngine()),this._engines.set("internal:text",this._createTextEngine(!0,!0)),this._engines.set("internal:has-text",this._createInternalHasTextEngine()),this._engines.set("internal:has-not-text",this._createInternalHasNotTextEngine()),this._engines.set("internal:attr",this._createNamedAttributeEngine()),this._engines.set("internal:testid",this._createTestIdEngine()),this._engines.set("internal:role",Hb(!0)),this._engines.set("internal:describe",this._createDescribeEngine()),this._engines.set("aria-ref",this._createAriaRefEngine());for(const{name:r,source:a}of i.customEngines)this._engines.set(r,this.eval(a));this._stableRafCount=i.stableRafCount,this._browserName=i.browserName,this._shouldPrependErrorPrefix=!!i.shouldPrependErrorPrefix,this._isUtilityWorld=!!i.isUtilityWorld,hT({browserNameForWorkarounds:i.browserName}),this._setupGlobalListenersRemovalDetection(),this._setupHitTargetInterceptors(),this.isUnderTest&&(this.window.__injectedScript=this)}eval(e){return this.window.eval(e)}testIdAttributeNameForStrictErrorAndConsoleCodegen(){return this._testIdAttributeNameForStrictErrorAndConsoleCodegen}parseSelector(e){const i=fl(e);return d_(i,r=>{if(!this._engines.has(r.name))throw this.createStacklessError(`Unknown engine "${r.name}" while parsing selector ${e}`)}),i}generateSelector(e,i){return Ib(this,e,i)}generateSelectorSimple(e,i){return Ib(this,e,{...i,testIdAttributeName:this._testIdAttributeNameForStrictErrorAndConsoleCodegen}).selector}querySelector(e,i,r){const a=this.querySelectorAll(e,i);if(r&&a.length>1)throw this.strictModeViolationError(e,a);return this.checkDeprecatedSelectorUsage(e,a),a[0]}_queryNth(e,i){const r=[...e];let a=+i.body;return a===-1&&(a=r.length-1),new Set(r.slice(a,a+1))}_queryLayoutSelector(e,i,r){const a=i.name,o=i.body,u=[],f=this.querySelectorAll(o.parsed,r);for(const d of e){const g=zv(a,d,f,o.distance);g!==void 0&&u.push({element:d,score:g})}return u.sort((d,g)=>d.score-g.score),new Set(u.map(d=>d.element))}ariaSnapshot(e,i){return this.incrementalAriaSnapshot(e,i).full}incrementalAriaSnapshot(e,i){if(e.nodeType!==Node.ELEMENT_NODE)throw this.createStacklessError("Can only capture aria snapshot of Element nodes.");const r=br(e,i),a=vr(r,i);let o;if(i.track){const u=this._lastAriaSnapshotForTrack.get(i.track);u&&(o=vr(r,i,u).text),this._lastAriaSnapshotForTrack.set(i.track,r)}return this._lastAriaSnapshotForQuery=r,{full:a.text,incremental:o,iframeRefs:r.iframeRefs,iframeDepths:a.iframeDepths}}ariaSnapshotForRecorder(){const e=br(this.document.body,{mode:"ai"}),{text:i}=vr(e,{mode:"ai"});return{ariaSnapshot:i,refs:e.refs}}getAllElementsMatchingExpectAriaTemplate(e,i){return HT(e.documentElement,i)}querySelectorAll(e,i){if(e.capture!==void 0){if(e.parts.some(a=>a.name==="nth"))throw this.createStacklessError("Can't query n-th element in a request with the capture.");const r={parts:e.parts.slice(0,e.capture+1)};if(e.capture<e.parts.length-1){const a={parts:e.parts.slice(e.capture+1)},o={name:"internal:has",body:{parsed:a},source:It(a)};r.parts.push(o)}return this.querySelectorAll(r,i)}if(!i.querySelectorAll)throw this.createStacklessError("Node is not queryable.");if(e.capture!==void 0)throw this.createStacklessError("Internal error: there should not be a capture in the selector.");if(i.nodeType===11&&e.parts.length===1&&e.parts[0].name==="css"&&e.parts[0].source===":scope")return[i];this._evaluator.begin();try{let r=new Set([i]);for(const a of e.parts)if(a.name==="nth")r=this._queryNth(r,a);else if(a.name==="internal:and"){const o=this.querySelectorAll(a.body.parsed,i);r=new Set(o.filter(u=>r.has(u)))}else if(a.name==="internal:or"){const o=this.querySelectorAll(a.body.parsed,i);r=new Set(Bv(new Set([...r,...o])))}else if(QT.includes(a.name))r=this._queryLayoutSelector(r,a,i);else{const o=new Set;for(const u of r){const f=this._queryEngineAll(a,u);for(const d of f)o.add(d)}r=o}return[...r]}finally{this._evaluator.end()}}_queryEngineAll(e,i){const r=this._engines.get(e.name).queryAll(i,e.body);for(const a of r)if(!("nodeName"in a))throw this.createStacklessError(`Expected a Node but got ${Object.prototype.toString.call(a)}`);return r}_createAttributeEngine(e,i){const r=a=>[{simples:[{selector:{css:`[${e}=${JSON.stringify(a)}]`,functions:[]},combinator:""}]}];return{queryAll:(a,o)=>this._evaluator.query({scope:a,pierceShadow:i},r(o))}}_createCSSEngine(){return{queryAll:(e,i)=>this._evaluator.query({scope:e,pierceShadow:!0},i)}}_createTextEngine(e,i){return{queryAll:(a,o)=>{const{matcher:u,kind:f}=qo(o,i),d=[];let g=null;const m=S=>{if(f==="lax"&&g&&g.contains(S))return!1;const w=Tc(this._evaluator._cacheText,S,u);w==="none"&&(g=S),(w==="self"||w==="selfAndChildren"&&f==="strict"&&!i)&&d.push(S)};a.nodeType===Node.ELEMENT_NODE&&m(a);const y=this._evaluator._queryCSS({scope:a,pierceShadow:e},"*");for(const S of y)m(S);return d}}}_createInternalHasTextEngine(){return{queryAll:(e,i)=>{if(e.nodeType!==1)return[];const r=e,a=Kt(this._evaluator._cacheText,r),{matcher:o}=qo(i,!0);return o(a)?[r]:[]}}}_createInternalHasNotTextEngine(){return{queryAll:(e,i)=>{if(e.nodeType!==1)return[];const r=e,a=Kt(this._evaluator._cacheText,r),{matcher:o}=qo(i,!0);return o(a)?[]:[r]}}}_createInternalLabelEngine(){return{queryAll:(e,i)=>{const{matcher:r}=qo(i,!0);return this._evaluator._queryCSS({scope:e,pierceShadow:!0},"*").filter(o=>Uv(this._evaluator._cacheText,o).some(u=>r(u)))}}}_createNamedAttributeEngine(){return{queryAll:(i,r)=>{const a=Er(r);if(a.name||a.attributes.length!==1)throw new Error("Malformed attribute selector: "+r);const{name:o}=a.attributes[0],u=Xb(a.attributes[0]);return this._evaluator._queryCSS({scope:i,pierceShadow:!0},`[${o}]`).filter(d=>u(d.getAttribute(o)))}}}_createTestIdEngine(){return{queryAll:(i,r)=>{const a=Er(r);if(a.name||a.attributes.length!==1)throw new Error("Malformed test id selector: "+r);const o=av(a.attributes[0].name),u=Xb(a.attributes[0]),f=o.map(g=>`[${g}]`).join(",");return this._evaluator._queryCSS({scope:i,pierceShadow:!0},f).filter(g=>o.some(m=>{const y=g.getAttribute(m);return y!==null&&u(y)}))}}}_createDescribeEngine(){return{queryAll:i=>i.nodeType!==1?[]:[i]}}_createControlEngine(){return{queryAll(e,i){if(i==="enter-frame")return[];if(i==="return-empty")return[];if(i==="component")return e.nodeType!==1?[]:[e.childElementCount===1?e.firstElementChild:e];throw new Error(`Internal error, unknown internal:control selector ${i}`)}}}_createHasEngine(){return{queryAll:(i,r)=>i.nodeType!==1?[]:!!this.querySelector(r.parsed,i,!1)?[i]:[]}}_createHasNotEngine(){return{queryAll:(i,r)=>i.nodeType!==1?[]:!!this.querySelector(r.parsed,i,!1)?[]:[i]}}_createVisibleEngine(){return{queryAll:(i,r)=>{if(i.nodeType!==1)return[];const a=r==="true";return ii(i)===a?[i]:[]}}}_createInternalChainEngine(){return{queryAll:(i,r)=>this.querySelectorAll(r.parsed,i)}}extend(e,i){const r=this.window.eval(`
    (() => {
      const module = {};
      ${e}
      return module.exports.default();
    })()`);return new r(this,i)}async viewportRatio(e){return await new Promise(i=>{const r=new IntersectionObserver(a=>{i(a[0].intersectionRatio),r.disconnect()});r.observe(e),this.utils.builtins.requestAnimationFrame(()=>{})})}getElementBorderWidth(e){if(e.nodeType!==Node.ELEMENT_NODE||!e.ownerDocument||!e.ownerDocument.defaultView)return{left:0,top:0};const i=e.ownerDocument.defaultView.getComputedStyle(e);return{left:parseInt(i.borderLeftWidth||"",10),top:parseInt(i.borderTopWidth||"",10)}}describeIFrameStyle(e){if(!e.ownerDocument||!e.ownerDocument.defaultView)return"error:notconnected";const i=e.ownerDocument.defaultView;for(let a=e;a;a=Ct(a))if(i.getComputedStyle(a).transform!=="none")return"transformed";const r=i.getComputedStyle(e);return{left:parseInt(r.borderLeftWidth||"",10)+parseInt(r.paddingLeft||"",10),top:parseInt(r.borderTopWidth||"",10)+parseInt(r.paddingTop||"",10)}}retarget(e,i){let r=e.nodeType===Node.ELEMENT_NODE?e:e.parentElement;if(!r)return null;if(i==="none")return r;if(!r.matches("input, textarea, select")&&!r.isContentEditable&&(i==="button-link"?r=r.closest("button, [role=button], a, [role=link]")||r:r=r.closest("button, [role=button], [role=checkbox], [role=radio]")||r),i==="follow-label"&&!r.matches("a, input, textarea, button, select, [role=link], [role=button], [role=checkbox], [role=radio]")&&!r.isContentEditable){const a=r.closest("label");a&&a.control&&(r=a.control)}return r}async checkElementStates(e,i){if(i.includes("stable")){const r=await this._checkElementIsStable(e);if(r===!1)return{missingState:"stable"};if(r==="error:notconnected")return"error:notconnected"}for(const r of i)if(r!=="stable"){const a=this.elementState(e,r);if(a.received==="error:notconnected")return"error:notconnected";if(!a.matches)return{missingState:r}}}async _checkElementIsStable(e){const i=Symbol("continuePolling");let r,a=0,o=0;const u=()=>{const y=this.retarget(e,"no-follow-label");if(!y)return"error:notconnected";const S=this.utils.builtins.performance.now();if(this._stableRafCount>1&&S-o<15)return i;o=S;const w=y.getBoundingClientRect(),E={x:w.top,y:w.left,width:w.width,height:w.height};if(r){if(!(E.x===r.x&&E.y===r.y&&E.width===r.width&&E.height===r.height))return!1;if(++a>=this._stableRafCount)return!0}return r=E,i};let f,d;const g=new Promise((y,S)=>{f=y,d=S}),m=()=>{try{const y=u();y!==i?f(y):this.utils.builtins.requestAnimationFrame(m)}catch(y){d(y)}};return this.utils.builtins.requestAnimationFrame(m),g}_createAriaRefEngine(){return{queryAll:(i,r)=>{var o,u;const a=(u=(o=this._lastAriaSnapshotForQuery)==null?void 0:o.elements)==null?void 0:u.get(r);return a&&a.isConnected?[a]:[]}}}elementState(e,i){const r=this.retarget(e,["visible","hidden"].includes(i)?"none":"follow-label");if(!r||!r.isConnected)return i==="hidden"?{matches:!0,received:"hidden"}:{matches:!1,received:"error:notconnected"};if(i==="visible"||i==="hidden"){const a=ii(r);return{matches:i==="visible"?a:!a,received:a?"visible":"hidden"}}if(i==="disabled"||i==="enabled"){const a=hc(r);return{matches:i==="disabled"?a:!a,received:a?"disabled":"enabled"}}if(i==="editable"){const a=hc(r),o=CT(r);if(o==="error")throw this.createStacklessError("Element is not an <input>, <textarea>, <select> or [contenteditable] and does not have a role allowing [aria-readonly]");return{matches:!a&&!o,received:a?"disabled":o?"readOnly":"editable"}}if(i==="checked"||i==="unchecked"){const a=i==="checked",o=TT(r);if(o==="error")throw this.createStacklessError("Not a checkbox or radio button");const u=r.nodeName==="INPUT"&&r.type==="radio";return{matches:a===o,received:o?"checked":"unchecked",isRadio:u}}if(i==="indeterminate"){const a=ET(r);if(a==="error")throw this.createStacklessError("Not a checkbox or radio button");return{matches:a==="mixed",received:a===!0?"checked":a===!1?"unchecked":"mixed"}}throw this.createStacklessError(`Unexpected element state "${i}"`)}selectOptions(e,i){const r=this.retarget(e,"follow-label");if(!r)return"error:notconnected";if(r.nodeName.toLowerCase()!=="select")throw this.createStacklessError("Element is not a <select> element");const a=r,o=[...a.options],u=[];let f=i.slice();for(let d=0;d<o.length;d++){const g=o[d],m=pt(g.label),y=S=>{if(S instanceof Node)return g===S;const w=x=>x===g.label||pt(x)===m;let E=!0;return S.valueOrLabel!==void 0&&(E=E&&(S.valueOrLabel===g.value||w(S.valueOrLabel))),S.value!==void 0&&(E=E&&S.value===g.value),S.label!==void 0&&(E=E&&w(S.label)),S.index!==void 0&&(E=E&&S.index===d),E};if(f.some(y)){if(!this.elementState(g,"enabled").matches)return"error:optionnotenabled";if(u.push(g),a.multiple)f=f.filter(S=>!y(S));else{f=[];break}}}return f.length?"error:optionsnotfound":(a.value=void 0,u.forEach(d=>d.selected=!0),a.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),a.dispatchEvent(new Event("change",{bubbles:!0})),u.map(d=>d.value))}fill(e,i){const r=this.retarget(e,"follow-label");if(!r)return"error:notconnected";if(r.nodeName.toLowerCase()==="input"){const a=r,o=a.type.toLowerCase(),u=new Set(["color","date","time","datetime-local","month","range","week"]);if(!new Set(["","email","number","password","search","tel","text","url"]).has(o)&&!u.has(o))throw this.createStacklessError(`Input of type "${o}" cannot be filled`);if(o==="number"&&(i=i.trim(),isNaN(Number(i))))throw this.createStacklessError("Cannot type text into input[type=number]");if(o==="color"&&(i=i.toLowerCase()),u.has(o)){if(i=i.trim(),a.focus(),a.value=i,a.value!==i)throw this.createStacklessError("Malformed value");return r.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),r.dispatchEvent(new Event("change",{bubbles:!0})),"done"}}else if(r.nodeName.toLowerCase()!=="textarea"){if(!r.isContentEditable)throw this.createStacklessError("Element is not an <input>, <textarea> or [contenteditable] element")}return this.selectText(r),"needsinput"}selectText(e){const i=this.retarget(e,"follow-label");if(!i)return"error:notconnected";if(i.nodeName.toLowerCase()==="input"){const o=i;return o.select(),o.focus(),"done"}if(i.nodeName.toLowerCase()==="textarea"){const o=i;return o.selectionStart=0,o.selectionEnd=o.value.length,o.focus(),"done"}i.focus();const r=i.ownerDocument.createRange();r.selectNodeContents(i);const a=i.ownerDocument.defaultView.getSelection();return a&&(a.removeAllRanges(),a.addRange(r)),"done"}_activelyFocused(e){const i=e.getRootNode().activeElement,r=i===e&&!!e.ownerDocument&&e.ownerDocument.hasFocus();return{activeElement:i,isFocused:r}}focusNode(e,i){if(!e.isConnected)return"error:notconnected";if(e.nodeType!==Node.ELEMENT_NODE)throw this.createStacklessError("Node is not an element");const{activeElement:r,isFocused:a}=this._activelyFocused(e);if(e.isContentEditable&&!a&&r&&r.blur&&r.blur(),e.focus(),e.focus(),i&&!a&&e.nodeName.toLowerCase()==="input")try{e.setSelectionRange(0,0)}catch{}return"done"}blurNode(e){if(!e.isConnected)return"error:notconnected";if(e.nodeType!==Node.ELEMENT_NODE)throw this.createStacklessError("Node is not an element");return e.blur(),"done"}setInputFiles(e,i){if(e.nodeType!==Node.ELEMENT_NODE)return"Node is not of type HTMLElement";const r=e;if(r.nodeName!=="INPUT")return"Not an <input> element";const a=r;if((a.getAttribute("type")||"").toLowerCase()!=="file")return"Not an input[type=file] element";const u=i.map(d=>{const g=Uint8Array.from(atob(d.buffer),m=>m.charCodeAt(0));return new File([g],d.name,{type:d.mimeType,lastModified:d.lastModifiedMs})}),f=new DataTransfer;for(const d of u)f.items.add(d);a.files=f.files,a.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),a.dispatchEvent(new Event("change",{bubbles:!0}))}expectHitTarget(e,i){const r=[];let a=i;for(;a;){const m=uv(a);if(!m||(r.push(m),m.nodeType===9))break;a=m.host}let o;for(let m=r.length-1;m>=0;m--){const y=r[m],S=y.elementsFromPoint(e.x,e.y),w=y.elementFromPoint(e.x,e.y);if(w&&S[0]&&Ct(w)===S[0]){const x=this.window.getComputedStyle(w);(x==null?void 0:x.display)==="contents"&&S.unshift(w)}S[0]&&S[0].shadowRoot===y&&S[1]===w&&S.shift();const E=S[0];if(!E||(o=E,m&&E!==r[m-1].host))break}const u=[];for(;o&&o!==i;)u.push(o),o=o.assignedSlot??Ct(o);if(o===i)return"done";const f=this.previewNode(u[0]||this.document.documentElement);let d,g=i;for(;g;){const m=u.indexOf(g);if(m!==-1){m>1&&(d=this.previewNode(u[m-1]));break}g=Ct(g)}return d?{hitTargetDescription:`${f} from ${d} subtree`}:{hitTargetDescription:f}}setupHitTargetInterceptor(e,i,r,a){const o=this.retarget(e,"button-link");if(!o||!o.isConnected)return"error:notconnected";if(r){const m=this.expectHitTarget(r,o);if(m!=="done")return m.hitTargetDescription}if(i==="drag")return{stop:()=>"done"};const u={hover:this._hoverHitTargetInterceptorEvents,tap:this._tapHitTargetInterceptorEvents,mouse:this._mouseHitTargetInterceptorEvents}[i];let f;const d=m=>{if(!u.has(m.type)||!m.isTrusted&&!m.__pwTrustedSynthetic)return;const y=this.window.TouchEvent&&m instanceof this.window.TouchEvent?m.touches[0]:m;f===void 0&&y&&(f=this.expectHitTarget({x:y.clientX,y:y.clientY},o)),(a||f!=="done"&&f!==void 0)&&(m.preventDefault(),m.stopPropagation(),m.stopImmediatePropagation())},g=()=>(this._hitTargetInterceptor===d&&(this._hitTargetInterceptor=void 0),f||"done");return this._hitTargetInterceptor=d,{stop:g}}dispatchEvent(e,i,r){var u,f,d;let a;const o={bubbles:!0,cancelable:!0,composed:!0,...r};switch(this._eventTypes.get(i)){case"mouse":a=new MouseEvent(i,o);break;case"keyboard":a=new KeyboardEvent(i,o);break;case"touch":{if(this._browserName==="webkit"){const g=y=>{var E,x;if(y instanceof Touch)return y;let S=y.pageX;S===void 0&&y.clientX!==void 0&&(S=y.clientX+(((E=this.document.scrollingElement)==null?void 0:E.scrollLeft)||0));let w=y.pageY;return w===void 0&&y.clientY!==void 0&&(w=y.clientY+(((x=this.document.scrollingElement)==null?void 0:x.scrollTop)||0)),this.document.createTouch(this.window,y.target??e,y.identifier,S,w,y.screenX,y.screenY,y.radiusX,y.radiusY,y.rotationAngle,y.force)},m=y=>y instanceof TouchList||!y?y:this.document.createTouchList(...y.map(g));o.target??(o.target=e),o.touches=m(o.touches),o.targetTouches=m(o.targetTouches),o.changedTouches=m(o.changedTouches),a=new TouchEvent(i,o)}else o.target??(o.target=e),o.touches=(u=o.touches)==null?void 0:u.map(g=>g instanceof Touch?g:new Touch({...g,target:g.target??e})),o.targetTouches=(f=o.targetTouches)==null?void 0:f.map(g=>g instanceof Touch?g:new Touch({...g,target:g.target??e})),o.changedTouches=(d=o.changedTouches)==null?void 0:d.map(g=>g instanceof Touch?g:new Touch({...g,target:g.target??e})),a=new TouchEvent(i,o);break}case"pointer":a=new PointerEvent(i,o);break;case"focus":a=new FocusEvent(i,o);break;case"drag":a=new DragEvent(i,o);break;case"wheel":a=new WheelEvent(i,o);break;case"deviceorientation":try{a=new DeviceOrientationEvent(i,o)}catch{const{bubbles:g,cancelable:m,alpha:y,beta:S,gamma:w,absolute:E}=o;a=this.document.createEvent("DeviceOrientationEvent"),a.initDeviceOrientationEvent(i,g,m,y,S,w,E)}break;case"devicemotion":try{a=new DeviceMotionEvent(i,o)}catch{const{bubbles:g,cancelable:m,acceleration:y,accelerationIncludingGravity:S,rotationRate:w,interval:E}=o;a=this.document.createEvent("DeviceMotionEvent"),a.initDeviceMotionEvent(i,g,m,y,S,w,E)}break;default:a=new Event(i,o);break}e.dispatchEvent(a)}previewNode(e){if(e.nodeType===Node.TEXT_NODE)return Bo(`#text=${e.nodeValue||""}`);if(e.nodeType!==Node.ELEMENT_NODE)return Bo(`<${e.nodeName.toLowerCase()} />`);const i=e,r=[];for(let d=0;d<i.attributes.length;d++){const{name:g,value:m}=i.attributes[d];g!=="style"&&(!m&&this._booleanAttributes.has(g)?r.push(` ${g}`):r.push(` ${g}="${m}"`))}r.sort((d,g)=>d.length-g.length);const a=hb(r.join(""),500);if(this._autoClosingTags.has(i.nodeName))return Bo(`<${i.nodeName.toLowerCase()}${a}/>`);const o=i.childNodes;let u=!1;if(o.length<=5){u=!0;for(let d=0;d<o.length;d++)u=u&&o[d].nodeType===Node.TEXT_NODE}const f=u?i.textContent||"":o.length?"â€¦":"";return Bo(`<${i.nodeName.toLowerCase()}${a}>${hb(f,50)}</${i.nodeName.toLowerCase()}>`)}_generateSelectors(e){this._evaluator.begin(),xc(),bd();try{const i=this._isUtilityWorld&&this._browserName==="firefox"?2:10;return e.slice(0,i).map(a=>({preview:this.previewNode(a),selector:this.generateSelectorSimple(a)})).map((a,o)=>`${o+1}) ${a.preview} aka ${Ri(this._sdkLanguage,a.selector)}`)}finally{vd(),_c(),this._evaluator.end()}}strictModeViolationError(e,i){const r=this._generateSelectors(i).map(a=>`
    `+a);return r.length<i.length&&r.push(`
    ...`),this.createStacklessError(`strict mode violation: ${Ri(this._sdkLanguage,It(e))} resolved to ${i.length} elements:${r.join("")}
`)}checkDeprecatedSelectorUsage(e,i){const r=new Set(["_react","_vue","xpath:light","text:light","id:light","data-testid:light","data-test-id:light","data-test:light"]);if(!i.length)return;const a=e.parts.find(u=>r.has(u.name));if(!a)return;const o=this._generateSelectors(i).map(u=>`
    `+u);throw o.length<i.length&&o.push(`
    ...`),this.createStacklessError(`"${a.name}" selector is not supported: ${Ri(this._sdkLanguage,It(e))} resolved to ${i.length} element${i.length===1?"":"s"}:${o.join("")}
`)}createStacklessError(e){const i=this._shouldPrependErrorPrefix?new Error("Error: "+e):new Error(e);return this._browserName==="firefox"?(i.stack="",i):(delete i.stack,i)}createHighlight(){return new mh(this)}maskSelectors(e,i){const r=this._createHighlight(),a=[];for(const o of e)a.push(this.querySelectorAll(o,this.document.documentElement));r.maskElements(a.flat(),i)}_createHighlight(){return this._highlight&&this.hideHighlight(),this._highlight=new mh(this),this._highlight.install(),this._highlight}_ensureHighlight(){return this._highlight||(this._highlight=new mh(this),this._highlight.install()),this._highlight}addHighlight(e,i){this._ensureHighlight().addElementHighlight(e,i)}removeHighlight(e){this._ensureHighlight().removeElementHighlight(e)}setScreencastAnnotation(e){const i=this._ensureHighlight();if(!e){i.updateHighlight([]),i.hideActionPoint(),i.hideActionTitle(),i.hideActionCursor();return}const r=e.duration??500;e.box&&i.updateHighlight([{box:e.box,color:"rgba(0, 128, 255, 0.15)",borderColor:"rgba(0, 128, 255, 0.6)",fadeDuration:r}]),e.point&&(e.cursor!=="none"&&i.moveActionCursor(e.point.x,e.point.y,r),i.showActionPoint(e.point.x,e.point.y,r)),e.actionTitle&&i.showActionTitle(e.actionTitle,r,e.position,e.fontSize)}addUserOverlay(e,i){this._ensureHighlight().addUserOverlay(e,i)}getUserOverlay(e){return this._ensureHighlight().getUserOverlay(e)}removeUserOverlay(e){this._ensureHighlight().removeUserOverlay(e)}setUserOverlaysVisible(e){this._ensureHighlight().setUserOverlaysVisible(e)}hideHighlight(){this._highlight&&(this._highlight.uninstall(),delete this._highlight)}markTargetElements(e){const i=new CustomEvent("__playwright_reset_targets__",{bubbles:!0,cancelable:!0,composed:!0});this.document.dispatchEvent(i);const r=new CustomEvent("__playwright_mark_target__",{bubbles:!0,cancelable:!0,composed:!0});for(const a of e)a.dispatchEvent(r)}_setupGlobalListenersRemovalDetection(){const e="__playwright_global_listeners_check__";let i=!1;const r=()=>i=!0;this.window.addEventListener(e,r),new MutationObserver(a=>{if(a.some(u=>Array.from(u.addedNodes).includes(this.document.documentElement))&&(i=!1,this.window.dispatchEvent(new CustomEvent(e)),!i)){this.window.addEventListener(e,r);for(const u of this.onGlobalListenersRemoved)u()}}).observe(this.document,{childList:!0})}_setupHitTargetInterceptors(){const e=r=>{var a;return(a=this._hitTargetInterceptor)==null?void 0:a.call(this,r)},i=()=>{for(const r of this._allHitTargetInterceptorEvents)this.window.addEventListener(r,e,{capture:!0,passive:!1})};i(),this.onGlobalListenersRemoved.add(i)}async expect(e,i,r){const a=await this._expectCore(e,i,r),o=a.matches!==i.isNot?void 0:this._ariaSnapshotForExpect(e,i);return a.received===void 0&&o===void 0?{matches:a.matches,missingReceived:a.missingReceived}:{matches:a.matches,received:{value:a.received,ariaSnapshot:o},missingReceived:a.missingReceived}}_ariaSnapshotForExpect(e,i){const r=i.expression;if(!(r==="to.have.count"||r.endsWith(".array"))&&r!=="to.match.aria"){if(e&&ii(e)){const a=r==="to.have.text";return this._renderAriaSnapshot(e,{mode:"default",depth:a?void 0:1})}if(this.document.body)return this._renderAriaSnapshot(this.document.body,{mode:"default"})}}_renderAriaSnapshot(e,i){return vr(br(e,i),i).text}async _expectCore(e,i,r){var o,u;if(i.expression==="to.have.count"||i.expression.endsWith(".array"))return this.expectArray(r,i);if(!e){if(!i.isNot&&i.expression==="to.be.hidden")return{matches:!0};if(i.isNot&&i.expression==="to.be.visible")return{matches:!1};if(!i.isNot&&i.expression==="to.be.detached")return{matches:!0};if(i.isNot&&i.expression==="to.be.attached")return{matches:!1};if(i.isNot&&i.expression==="to.be.in.viewport")return{matches:!1};if(i.expression==="to.have.title"&&((o=i==null?void 0:i.expectedText)!=null&&o[0])){const f=new fr(i.expectedText[0]),d=this.document.title;return{received:d,matches:f.matches(d)}}if(i.expression==="to.have.url"&&((u=i==null?void 0:i.expectedText)!=null&&u[0])){const f=new fr(i.expectedText[0]),d=this.document.location.href;return{received:d,matches:f.matches(d)}}if(i.expression==="to.match.aria"&&!i.selector){if(!this.document.body)return{matches:i.isNot,missingReceived:!0};const f=jb(this.document.body,i.expectedValue);return{received:f.received,matches:!!f.matches.length}}return{matches:i.isNot,missingReceived:!0}}return await this.expectSingleElement(e,i)}async expectSingleElement(e,i){var a;const r=i.expression;{let o;if(r==="to.have.attribute"){const u=e.hasAttribute(i.expressionArg);o={matches:u,received:u?"attribute present":"attribute not present"}}else if(r==="to.be.checked"){const{checked:u,indeterminate:f}=i.expectedValue;if(f){if(u!==void 0)throw this.createStacklessError("Can't assert indeterminate and checked at the same time");o=this.elementState(e,"indeterminate")}else o=this.elementState(e,u===!1?"unchecked":"checked")}else if(r==="to.be.disabled")o=this.elementState(e,"disabled");else if(r==="to.be.editable")o=this.elementState(e,"editable");else if(r==="to.be.readonly")o=this.elementState(e,"editable"),o.matches=!o.matches;else if(r==="to.be.empty")if(e.nodeName==="INPUT"||e.nodeName==="TEXTAREA"){const u=e.value;o={matches:!u,received:u?"notEmpty":"empty"}}else{const u=(a=e.textContent)==null?void 0:a.trim();o={matches:!u,received:u?"notEmpty":"empty"}}else if(r==="to.be.enabled")o=this.elementState(e,"enabled");else if(r==="to.be.focused"){const u=this._activelyFocused(e).isFocused;o={matches:u,received:u?"focused":"inactive"}}else r==="to.be.hidden"?o=this.elementState(e,"hidden"):r==="to.be.visible"?o=this.elementState(e,"visible"):r==="to.be.attached"?o={matches:!0,received:"attached"}:r==="to.be.detached"&&(o={matches:!1,received:"attached"});if(o){if(o.received==="error:notconnected")throw this.createStacklessError("Element is not connected");return o}}if(r==="to.have.property"){let o=e;const u=i.expressionArg.split(".");for(let g=0;g<u.length-1;g++){if(typeof o!="object"||!(u[g]in o))return{received:void 0,matches:!1};o=o[u[g]]}const f=o[u[u.length-1]],d=Xh(f,i.expectedValue);return{received:f,matches:d}}if(r==="to.be.in.viewport"){const o=await this.viewportRatio(e);return{received:`viewport ratio ${o}`,matches:o>0&&o>(i.expectedNumber??0)-1e-9}}if(r==="to.have.values"){if(e=this.retarget(e,"follow-label"),e.nodeName!=="SELECT"||!e.multiple)throw this.createStacklessError("Not a select element with a multiple attribute");const o=[...e.selectedOptions].map(u=>u.value);return o.length!==i.expectedText.length?{received:o,matches:!1}:{received:o,matches:o.map((u,f)=>new fr(i.expectedText[f]).matches(u)).every(Boolean)}}if(r==="to.match.aria"){const o=jb(e,i.expectedValue);return{received:o.received,matches:!!o.matches.length}}{let o;if(r==="to.have.attribute.value"){const u=e.getAttribute(i.expressionArg);if(u===null)return{received:null,matches:!1};o=u}else if(["to.have.class","to.contain.class"].includes(r)){if(!i.expectedText)throw this.createStacklessError("Expected text is not provided for "+r);return{received:e.classList.toString(),matches:new fr(i.expectedText[0]).matchesClassList(this,e.classList,r==="to.contain.class")}}else if(r==="to.have.css")o=this.window.getComputedStyle(e,i.pseudo?`::${i.pseudo}`:void 0).getPropertyValue(i.expressionArg);else if(r==="to.have.id")o=e.id;else if(r==="to.have.text")o=i.useInnerText?e.innerText:Kt(new Map,e).full;else if(r==="to.have.accessible.name")o=rl(e,!1);else if(r==="to.have.accessible.description")o=al(e,!1);else if(r==="to.have.accessible.error.message")o=xT(e);else if(r==="to.have.role")o=Tt(e)||"";else if(r==="to.have.value"){if(e=this.retarget(e,"follow-label"),e.nodeName!=="INPUT"&&e.nodeName!=="TEXTAREA"&&e.nodeName!=="SELECT")throw this.createStacklessError("Not an input element");o=e.value}if(o!==void 0&&i.expectedText){const u=new fr(i.expectedText[0]);return{received:o,matches:u.matches(o)}}}throw this.createStacklessError("Unknown expect matcher: "+r)}expectArray(e,i){const r=i.expression;if(r==="to.have.count"){const d=e.length,g=d===i.expectedNumber;return{received:d,matches:g}}if(!i.expectedText)throw this.createStacklessError("Expected text is not provided for "+r);if(["to.have.class.array","to.contain.class.array"].includes(r)){const d=e.map(y=>y.classList),g=d.map(String);if(d.length!==i.expectedText.length)return{received:g,matches:!1};const m=this._matchSequentially(i.expectedText,d,(y,S)=>y.matchesClassList(this,S,r==="to.contain.class.array"));return{received:g,matches:m}}if(!["to.contain.text.array","to.have.text.array"].includes(r))throw this.createStacklessError("Unknown expect matcher: "+r);const a=e.map(d=>i.useInnerText?d.innerText:Kt(new Map,d).full),o=r!=="to.contain.text.array";if(!(a.length===i.expectedText.length||!o))return{received:a,matches:!1};const f=this._matchSequentially(i.expectedText,a,(d,g)=>d.matches(g));return{received:a,matches:f}}_matchSequentially(e,i,r){const a=e.map(f=>new fr(f));let o=0,u=0;for(;o<a.length&&u<i.length;)r(a[o],i[u])&&++o,++u;return o===a.length}}function Bo(n){return n.replace(/\n/g,"â†µ").replace(/\t/g,"â‡†")}function Xb(n){const{value:e,caseSensitive:i}=n;if(e instanceof RegExp)return a=>!!a.match(e);if(i)return a=>a===e;const r=e.toLowerCase();return a=>a.toLowerCase().includes(r)}function UA(n){if(n=n.substring(1,n.length-1),!n.includes("\\"))return n;const e=[];let i=0;for(;i<n.length;)n[i]==="\\"&&i+1<n.length&&i++,e.push(n[i++]);return e.join("")}function qo(n,e){if(n[0]==="/"&&n.lastIndexOf("/")>0){const a=n.lastIndexOf("/"),o=new RegExp(n.substring(1,a),n.substring(a+1));return{matcher:u=>o.test(u.full),kind:"regex"}}const i=e?JSON.parse.bind(JSON):UA;let r=!1;return n.length>1&&n[0]==='"'&&n[n.length-1]==='"'?(n=i(n),r=!0):e&&n.length>1&&n[0]==='"'&&n[n.length-2]==='"'&&n[n.length-1]==="i"?(n=i(n.substring(0,n.length-1)),r=!1):e&&n.length>1&&n[0]==='"'&&n[n.length-2]==='"'&&n[n.length-1]==="s"?(n=i(n.substring(0,n.length-1)),r=!0):n.length>1&&n[0]==="'"&&n[n.length-1]==="'"&&(n=i(n),r=!0),n=pt(n),r?e?{kind:"strict",matcher:o=>o.normalized===n}:{matcher:o=>!n&&!o.immediate.length?!0:o.immediate.some(u=>pt(u)===n),kind:"strict"}:(n=n.toLowerCase(),{kind:"lax",matcher:a=>a.normalized.toLowerCase().includes(n)})}class fr{constructor(e){if(this._normalizeWhiteSpace=e.normalizeWhiteSpace,this._ignoreCase=e.ignoreCase,this._string=e.matchSubstring?void 0:this.normalize(e.string),this._substring=e.matchSubstring?this.normalize(e.string):void 0,e.regexSource){const i=new Set((e.regexFlags||"").split(""));e.ignoreCase===!1&&i.delete("i"),e.ignoreCase===!0&&i.add("i"),this._regex=new RegExp(e.regexSource,[...i].join(""))}}matches(e){return this._regex||(e=this.normalize(e)),this._string!==void 0?e===this._string:this._substring!==void 0?e.includes(this._substring):this._regex?!!this._regex.test(e):!1}matchesClassList(e,i,r){if(r){if(this._regex)throw e.createStacklessError("Partial matching does not support regular expressions. Please provide a string value.");return this._string.split(/\s+/g).filter(Boolean).every(a=>i.contains(a))}return this.matches(i.toString())}normalize(e){return e&&(this._normalizeWhiteSpace&&(e=pt(e)),this._ignoreCase&&(e=e.toLocaleLowerCase()),e)}}function Xh(n,e){if(n===e)return!0;if(n&&e&&typeof n=="object"&&typeof e=="object"){if(n.constructor!==e.constructor)return!1;if(Array.isArray(n)){if(n.length!==e.length)return!1;for(let r=0;r<n.length;++r)if(!Xh(n[r],e[r]))return!1;return!0}if(n instanceof RegExp)return n.source===e.source&&n.flags===e.flags;if(n.valueOf!==Object.prototype.valueOf)return n.valueOf()===e.valueOf();if(n.toString!==Object.prototype.toString)return n.toString()===e.toString();const i=Object.keys(n);if(i.length!==Object.keys(e).length)return!1;for(let r=0;r<i.length;++r)if(!e.hasOwnProperty(i[r]))return!1;for(const r of i)if(!Xh(n[r],e[r]))return!1;return!0}return typeof n=="number"&&typeof e=="number"?isNaN(n)&&isNaN(e):!1}const HA={tagName:"svg",children:[{tagName:"defs",children:[{tagName:"clipPath",attrs:{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",id:"icon-gripper"},children:[{tagName:"path",attrs:{d:"M5 3h2v2H5zm0 4h2v2H5zm0 4h2v2H5zm4-8h2v2H9zm0 4h2v2H9zm0 4h2v2H9z"}}]},{tagName:"clipPath",attrs:{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",id:"icon-circle-large-filled"},children:[{tagName:"path",attrs:{d:"M8 1a6.8 6.8 0 0 1 1.86.253 6.899 6.899 0 0 1 3.083 1.805 6.903 6.903 0 0 1 1.804 3.083C14.916 6.738 15 7.357 15 8s-.084 1.262-.253 1.86a6.9 6.9 0 0 1-.704 1.674 7.157 7.157 0 0 1-2.516 2.509 6.966 6.966 0 0 1-1.668.71A6.984 6.984 0 0 1 8 15a6.984 6.984 0 0 1-1.86-.246 7.098 7.098 0 0 1-1.674-.711 7.3 7.3 0 0 1-1.415-1.094 7.295 7.295 0 0 1-1.094-1.415 7.098 7.098 0 0 1-.71-1.675A6.985 6.985 0 0 1 1 8c0-.643.082-1.262.246-1.86a6.968 6.968 0 0 1 .711-1.667 7.156 7.156 0 0 1 2.509-2.516 6.895 6.895 0 0 1 1.675-.704A6.808 6.808 0 0 1 8 1z"}}]},{tagName:"clipPath",attrs:{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",id:"icon-stop-circle"},children:[{tagName:"path",attrs:{d:"M6 6h4v4H6z"}},{tagName:"path",attrs:{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M8.6 1c1.6.1 3.1.9 4.2 2 1.3 1.4 2 3.1 2 5.1 0 1.6-.6 3.1-1.6 4.4-1 1.2-2.4 2.1-4 2.4-1.6.3-3.2.1-4.6-.7-1.4-.8-2.5-2-3.1-3.5C.9 9.2.8 7.5 1.3 6c.5-1.6 1.4-2.9 2.8-3.8C5.4 1.3 7 .9 8.6 1zm.5 12.9c1.3-.3 2.5-1 3.4-2.1.8-1.1 1.3-2.4 1.2-3.8 0-1.6-.6-3.2-1.7-4.3-1-1-2.2-1.6-3.6-1.7-1.3-.1-2.7.2-3.8 1-1.1.8-1.9 1.9-2.3 3.3-.4 1.3-.4 2.7.2 4 .6 1.3 1.5 2.3 2.7 3 1.2.7 2.6.9 3.9.6z"}}]},{tagName:"clipPath",attrs:{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",id:"icon-inspect"},children:[{tagName:"path",attrs:{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M1 3l1-1h12l1 1v6h-1V3H2v8h5v1H2l-1-1V3zm14.707 9.707L9 6v9.414l2.707-2.707h4zM10 13V8.414l3.293 3.293h-2L10 13z"}}]},{tagName:"clipPath",attrs:{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",id:"icon-whole-word"},children:[{tagName:"path",attrs:{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0 11H1V13H15V11H16V14H15H1H0V11Z"}},{tagName:"path",attrs:{d:"M6.84048 11H5.95963V10.1406H5.93814C5.555 10.7995 4.99104 11.1289 4.24625 11.1289C3.69839 11.1289 3.26871 10.9839 2.95718 10.6938C2.64924 10.4038 2.49527 10.0189 2.49527 9.53906C2.49527 8.51139 3.10041 7.91341 4.3107 7.74512L5.95963 7.51416C5.95963 6.57959 5.58186 6.1123 4.82632 6.1123C4.16389 6.1123 3.56591 6.33789 3.03238 6.78906V5.88672C3.57307 5.54297 4.19612 5.37109 4.90152 5.37109C6.19416 5.37109 6.84048 6.05501 6.84048 7.42285V11ZM5.95963 8.21777L4.63297 8.40039C4.22476 8.45768 3.91682 8.55973 3.70914 8.70654C3.50145 8.84977 3.39761 9.10579 3.39761 9.47461C3.39761 9.74316 3.4925 9.96338 3.68228 10.1353C3.87564 10.3035 4.13166 10.3877 4.45035 10.3877C4.8872 10.3877 5.24706 10.2355 5.52994 9.93115C5.8164 9.62321 5.95963 9.2347 5.95963 8.76562V8.21777Z"}},{tagName:"path",attrs:{d:"M9.3475 10.2051H9.32601V11H8.44515V2.85742H9.32601V6.4668H9.3475C9.78076 5.73633 10.4146 5.37109 11.2489 5.37109C11.9543 5.37109 12.5057 5.61816 12.9032 6.1123C13.3042 6.60286 13.5047 7.26172 13.5047 8.08887C13.5047 9.00911 13.2809 9.74674 12.8333 10.3018C12.3857 10.8532 11.7734 11.1289 10.9964 11.1289C10.2695 11.1289 9.71989 10.821 9.3475 10.2051ZM9.32601 7.98682V8.75488C9.32601 9.20964 9.47282 9.59635 9.76644 9.91504C10.0636 10.2301 10.4396 10.3877 10.8944 10.3877C11.4279 10.3877 11.8451 10.1836 12.1458 9.77539C12.4502 9.36719 12.6024 8.79964 12.6024 8.07275C12.6024 7.46045 12.4609 6.98063 12.1781 6.6333C11.8952 6.28597 11.512 6.1123 11.0286 6.1123C10.5166 6.1123 10.1048 6.29134 9.7933 6.64941C9.48177 7.00391 9.32601 7.44971 9.32601 7.98682Z"}}]},{tagName:"clipPath",attrs:{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",id:"icon-eye"},children:[{tagName:"path",attrs:{d:"M7.99993 6.00316C9.47266 6.00316 10.6666 7.19708 10.6666 8.66981C10.6666 10.1426 9.47266 11.3365 7.99993 11.3365C6.52715 11.3365 5.33324 10.1426 5.33324 8.66981C5.33324 7.19708 6.52715 6.00316 7.99993 6.00316ZM7.99993 7.00315C7.07946 7.00315 6.33324 7.74935 6.33324 8.66981C6.33324 9.59028 7.07946 10.3365 7.99993 10.3365C8.9204 10.3365 9.6666 9.59028 9.6666 8.66981C9.6666 7.74935 8.9204 7.00315 7.99993 7.00315ZM7.99993 3.66675C11.0756 3.66675 13.7307 5.76675 14.4673 8.70968C14.5344 8.97755 14.3716 9.24908 14.1037 9.31615C13.8358 9.38315 13.5643 9.22041 13.4973 8.95248C12.8713 6.45205 10.6141 4.66675 7.99993 4.66675C5.38454 4.66675 3.12664 6.45359 2.50182 8.95555C2.43491 9.22341 2.16348 9.38635 1.89557 9.31948C1.62766 9.25255 1.46471 8.98115 1.53162 8.71321C2.26701 5.76856 4.9229 3.66675 7.99993 3.66675Z"}}]},{tagName:"clipPath",attrs:{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",id:"icon-symbol-constant"},children:[{tagName:"path",attrs:{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M4 6h8v1H4V6zm8 3H4v1h8V9z"}},{tagName:"path",attrs:{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M1 4l1-1h12l1 1v8l-1 1H2l-1-1V4zm1 0v8h12V4H2z"}}]},{tagName:"clipPath",attrs:{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",id:"icon-check"},children:[{tagName:"path",attrs:{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M14.431 3.323l-8.47 10-.79-.036-3.35-4.77.818-.574 2.978 4.24 8.051-9.506.764.646z"}}]},{tagName:"clipPath",attrs:{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",id:"icon-close"},children:[{tagName:"path",attrs:{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M8 8.707l3.646 3.647.708-.707L8.707 8l3.647-3.646-.707-.708L8 7.293 4.354 3.646l-.707.708L7.293 8l-3.646 3.646.707.708L8 8.707z"}}]},{tagName:"clipPath",attrs:{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",id:"icon-pass"},children:[{tagName:"path",attrs:{d:"M6.27 10.87h.71l4.56-4.56-.71-.71-4.2 4.21-1.92-1.92L4 8.6l2.27 2.27z"}},{tagName:"path",attrs:{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M8.6 1c1.6.1 3.1.9 4.2 2 1.3 1.4 2 3.1 2 5.1 0 1.6-.6 3.1-1.6 4.4-1 1.2-2.4 2.1-4 2.4-1.6.3-3.2.1-4.6-.7-1.4-.8-2.5-2-3.1-3.5C.9 9.2.8 7.5 1.3 6c.5-1.6 1.4-2.9 2.8-3.8C5.4 1.3 7 .9 8.6 1zm.5 12.9c1.3-.3 2.5-1 3.4-2.1.8-1.1 1.3-2.4 1.2-3.8 0-1.6-.6-3.2-1.7-4.3-1-1-2.2-1.6-3.6-1.7-1.3-.1-2.7.2-3.8 1-1.1.8-1.9 1.9-2.3 3.3-.4 1.3-.4 2.7.2 4 .6 1.3 1.5 2.3 2.7 3 1.2.7 2.6.9 3.9.6z"}}]},{tagName:"clipPath",attrs:{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",id:"icon-gist"},children:[{tagName:"path",attrs:{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M10.57 1.14l3.28 3.3.15.36v9.7l-.5.5h-11l-.5-.5v-13l.5-.5h7.72l.35.14zM10 5h3l-3-3v3zM3 2v12h10V6H9.5L9 5.5V2H3zm2.062 7.533l1.817-1.828L6.17 7 4 9.179v.707l2.171 2.174.707-.707-1.816-1.82zM8.8 7.714l.7-.709 2.189 2.175v.709L9.5 12.062l-.705-.709 1.831-1.82L8.8 7.714z"}}]}]}]},mn={multiple:"#f6b26b7f",single:"#6fa8dc7f",assert:"#8acae480",action:"#dc6f6f7f"};class Yb{}class Sh{constructor(e,i){this._hoveredModel=null,this._hoveredElement=null,this._recorder=e,this._assertVisibility=i}cursor(){return"pointer"}uninstall(){this._hoveredModel=null,this._hoveredElement=null}onClick(e){var i;Ge(e),e.button===0&&(i=this._hoveredModel)!=null&&i.selector&&this._commit(this._hoveredModel.selector,this._hoveredModel)}onPointerDown(e){Ge(e)}onPointerUp(e){Ge(e)}onMouseDown(e){Ge(e)}onMouseUp(e){Ge(e)}onMouseMove(e){var a;Ge(e);let i=this._recorder.deepEventTarget(e);if(i.isConnected||(i=null),this._hoveredElement===i)return;this._hoveredElement=i;let r=null;if(this._hoveredElement){const o=this._recorder.injectedScript.generateSelector(this._hoveredElement,{testIdAttributeName:this._recorder.state.testIdAttributeName,multiple:!1});r={selector:o.selector,elements:o.elements,tooltipText:this._recorder.injectedScript.utils.asLocator(this._recorder.state.language,o.selector),color:this._assertVisibility?mn.assert:mn.single}}((a=this._hoveredModel)==null?void 0:a.selector)!==(r==null?void 0:r.selector)&&(this._hoveredModel=r,this._recorder.updateHighlight(r,!0))}onMouseEnter(e){Ge(e)}onMouseLeave(e){Ge(e);const i=this._recorder.injectedScript.window;i.top!==i&&this._recorder.deepEventTarget(e).nodeType===Node.DOCUMENT_NODE&&this._reset(!0)}onKeyDown(e){Ge(e),e.key==="Escape"&&this._assertVisibility&&this._recorder.setMode("recording")}onKeyUp(e){Ge(e)}onScroll(e){this._reset(!1)}_commit(e,i){var r;this._assertVisibility?(this._recorder.recordAction({name:"assertVisible",selector:e,signals:[]}),this._recorder.setMode("recording"),(r=this._recorder.overlay)==null||r.flashToolSucceeded("assertingVisibility")):this._recorder.elementPicked(e,i)}_reset(e){this._hoveredElement=null,this._hoveredModel=null,this._recorder.updateHighlight(null,e)}}class BA{constructor(e){this._hoveredModel=null,this._hoveredElement=null,this._activeModel=null,this._expectProgrammaticKeyUp=!1,this._observer=null,this._recorder=e,this._performingActions=new Set,this._dialog=new Pv(e)}cursor(){return"pointer"}_installObserverIfNeeded(){var e;this._observer||(e=this._recorder.injectedScript.document)!=null&&e.body&&(this._observer=new MutationObserver(i=>{if(this._hoveredElement)for(const r of i)for(const a of r.removedNodes)(a===this._hoveredElement||a.contains(this._hoveredElement))&&this._resetHoveredModel()}),this._observer.observe(this._recorder.injectedScript.document.body,{childList:!0,subtree:!0}))}uninstall(){var e;(e=this._observer)==null||e.disconnect(),this._observer=null,this._hoveredModel=null,this._hoveredElement=null,this._activeModel=null,this._expectProgrammaticKeyUp=!1,this._dialog.close()}onClick(e){if(this._dialog.isShowing()){e.button===2&&e.type==="auxclick"&&Ge(e);return}if(tl(this._hoveredElement)||this._shouldIgnoreMouseEvent(e)||this._actionInProgress(e)||this._consumedDueToNoModel(e,this._hoveredModel))return;if(e.button===2&&e.type==="auxclick"){this._showActionListDialog(this._hoveredModel,e);return}const i=el(this._recorder.deepEventTarget(e));if(i&&e.detail===1){this._performAction({name:i.checked?"check":"uncheck",selector:this._hoveredModel.selector,signals:[]});return}this._cancelPendingClickAction(),e.detail===1&&(this._pendingClickAction={action:{name:"click",selector:this._hoveredModel.selector,position:Wa(e),signals:[],button:Yh(e),modifiers:Tr(e),clickCount:e.detail},timeout:this._recorder.injectedScript.utils.builtins.setTimeout(()=>this._commitPendingClickAction(),200)})}onDblClick(e){this._dialog.isShowing()||tl(this._hoveredElement)||this._shouldIgnoreMouseEvent(e)||this._actionInProgress(e)||this._consumedDueToNoModel(e,this._hoveredModel)||(this._cancelPendingClickAction(),this._performAction({name:"click",selector:this._hoveredModel.selector,position:Wa(e),signals:[],button:Yh(e),modifiers:Tr(e),clickCount:e.detail}))}_commitPendingClickAction(){this._pendingClickAction&&this._performAction(this._pendingClickAction.action),this._cancelPendingClickAction()}_cancelPendingClickAction(){this._pendingClickAction&&this._recorder.injectedScript.utils.builtins.clearTimeout(this._pendingClickAction.timeout),this._pendingClickAction=void 0}onContextMenu(e){if(this._dialog.isShowing()){Ge(e);return}this._shouldIgnoreMouseEvent(e)||this._actionInProgress(e)||this._consumedDueToNoModel(e,this._hoveredModel)||this._showActionListDialog(this._hoveredModel,e)}onPointerDown(e){this._dialog.isShowing()||this._shouldIgnoreMouseEvent(e)||this._consumeWhenAboutToPerform(e)}onPointerUp(e){this._dialog.isShowing()||this._shouldIgnoreMouseEvent(e)||this._consumeWhenAboutToPerform(e)}onMouseDown(e){this._dialog.isShowing()||this._shouldIgnoreMouseEvent(e)||(this._consumeWhenAboutToPerform(e),this._activeModel=this._hoveredModel)}onMouseUp(e){this._dialog.isShowing()||this._shouldIgnoreMouseEvent(e)||this._consumeWhenAboutToPerform(e)}onMouseMove(e){if(this._dialog.isShowing())return;const i=this._recorder.deepEventTarget(e);this._hoveredElement!==i&&(this._hoveredElement=i,this._updateModelForHoveredElement())}onMouseLeave(e){if(this._dialog.isShowing())return;const i=this._recorder.injectedScript.window;i.top!==i&&this._recorder.deepEventTarget(e).nodeType===Node.DOCUMENT_NODE&&(this._hoveredElement=null,this._updateModelForHoveredElement())}onFocus(e){this._dialog.isShowing()||this._onFocus(!0)}onInput(e){if(this._dialog.isShowing())return;const i=this._recorder.deepEventTarget(e);if(i.nodeName==="INPUT"&&i.type.toLowerCase()==="file"){const r=i===this._hoveredElement?this._hoveredModel.selector:this._recorder.injectedScript.generateSelector(i,{testIdAttributeName:this._recorder.state.testIdAttributeName}).selector;this._recordAction({name:"setInputFiles",selector:r,signals:[],files:[...i.files||[]].map(a=>a.name)});return}if(tl(i)){this._recordAction({name:"fill",selector:this._hoveredModel.selector,signals:[],text:i.value});return}if(["INPUT","TEXTAREA"].includes(i.nodeName)||i.isContentEditable){if(i.nodeName==="INPUT"&&["checkbox","radio"].includes(i.type.toLowerCase())||this._consumedDueWrongTarget(e))return;this._recordAction({name:"fill",selector:this._activeModel.selector,signals:[],text:i.isContentEditable?i.innerText:i.value})}if(i.nodeName==="SELECT"){const r=i;this._recordAction({name:"select",selector:this._activeModel.selector,options:[...r.selectedOptions].map(a=>a.value),signals:[]})}}onKeyDown(e){if(!this._dialog.isShowing()&&this._shouldGenerateKeyPressFor(e)){if(this._actionInProgress(e)){this._expectProgrammaticKeyUp=!0;return}if(!this._consumedDueWrongTarget(e)){if(e.key===" "){const i=el(this._recorder.deepEventTarget(e));if(i&&e.detail===0){this._performAction({name:i.checked?"uncheck":"check",selector:this._activeModel.selector,signals:[]});return}}this._performAction({name:"press",selector:this._activeModel.selector,signals:[],key:e.key,modifiers:Tr(e)})}}}onKeyUp(e){if(!this._dialog.isShowing()&&this._shouldGenerateKeyPressFor(e)){if(!this._expectProgrammaticKeyUp){Ge(e);return}this._expectProgrammaticKeyUp=!1}}onScroll(e){this._dialog.isShowing()||this._resetHoveredModel()}_showActionListDialog(e,i){Ge(i);const r=Wa(i),a=[{title:"Click",cb:()=>this._performAction({name:"click",selector:e.selector,position:r,signals:[],button:"left",modifiers:0,clickCount:0})},{title:"Right click",cb:()=>this._performAction({name:"click",selector:e.selector,position:r,signals:[],button:"right",modifiers:0,clickCount:0})},{title:"Double click",cb:()=>this._performAction({name:"click",selector:e.selector,position:r,signals:[],button:"left",modifiers:0,clickCount:2})},{title:"Hover",cb:()=>this._performAction({name:"hover",selector:e.selector,position:r,signals:[]})},{title:"Pick locator",cb:()=>this._recorder.elementPicked(e.selector,e)}],o=this._recorder.document.createElement("x-pw-action-list");o.setAttribute("role","list"),o.setAttribute("aria-label","Choose action");for(const g of a){const m=this._recorder.document.createElement("x-pw-action-item");m.setAttribute("role","listitem"),m.textContent=g.title,m.setAttribute("aria-label",g.title),m.addEventListener("click",()=>{this._dialog.close(),g.cb()}),o.appendChild(m)}const u=this._dialog.show({label:"Choose action",body:o,autosize:!0}),f=this._recorder.highlight.firstTooltipBox()||e.elements[0].getBoundingClientRect(),d=this._recorder.highlight.tooltipPosition(f,u);this._dialog.moveTo(d.anchorTop,d.anchorLeft)}_resetHoveredModel(){this._hoveredModel=null,this._hoveredElement=null,this._updateHighlight(!1)}_onFocus(e){const i=VA(this._recorder.document);if(e&&i===this._recorder.document.body)return;const r=i?this._recorder.injectedScript.generateSelector(i,{testIdAttributeName:this._recorder.state.testIdAttributeName}):null;this._activeModel=r&&r.selector?{...r,color:mn.action}:null,e&&(this._hoveredElement=i,this._updateModelForHoveredElement())}_shouldIgnoreMouseEvent(e){return Jv(this._recorder.deepEventTarget(e))}_actionInProgress(e){const i=e instanceof KeyboardEvent,r=e instanceof MouseEvent||e instanceof PointerEvent;for(const a of this._performingActions)if(i&&a.name==="press"&&e.key===a.key||r&&(a.name==="click"||a.name==="hover"||a.name==="check"||a.name==="uncheck"))return!0;return Ge(e),!1}_consumedDueToNoModel(e,i){return i?!1:(Ge(e),!0)}_consumedDueWrongTarget(e){return this._activeModel&&this._activeModel.elements[0]===this._recorder.deepEventTarget(e)?!1:(Ge(e),!0)}_consumeWhenAboutToPerform(e){this._performingActions.size||Ge(e)}_reportPerformedActionForTests(){this._recorder.injectedScript.isUnderTest&&console.error("Action performed for test: "+JSON.stringify({hovered:this._hoveredModel?this._hoveredModel.selector:null,active:this._activeModel?this._activeModel.selector:null}))}_recordAction(e){this._recorder.recordAction(e).then(()=>this._reportPerformedActionForTests())}_performAction(e){this._recorder.updateHighlight(null,!1),this._performingActions.add(e),this._recorder.performAction(e).finally(()=>{this._performingActions.delete(e),this._onFocus(!1)}).then(()=>this._reportPerformedActionForTests())}_shouldGenerateKeyPressFor(e){if(typeof e.key!="string"||e.key==="Enter"&&(this._recorder.deepEventTarget(e).nodeName==="TEXTAREA"||this._recorder.deepEventTarget(e).isContentEditable)||["Backspace","Delete","AltGraph"].includes(e.key)||e.key==="@"&&e.code==="KeyL")return!1;if(navigator.platform.includes("Mac")){if(e.key==="v"&&e.metaKey)return!1}else if(e.key==="v"&&e.ctrlKey||e.key==="Insert"&&e.shiftKey)return!1;if(["Shift","Control","Meta","Alt","Process"].includes(e.key))return!1;const i=e.ctrlKey||e.altKey||e.metaKey;return e.key.length===1&&!i?!!el(this._recorder.deepEventTarget(e)):!0}_updateModelForHoveredElement(){if(this._installObserverIfNeeded(),this._performingActions.size)return;if(!this._hoveredElement||!this._hoveredElement.isConnected){this._hoveredModel=null,this._hoveredElement=null,this._updateHighlight(!0);return}const{selector:e,elements:i}=this._recorder.injectedScript.generateSelector(this._hoveredElement,{testIdAttributeName:this._recorder.state.testIdAttributeName});this._hoveredModel&&this._hoveredModel.selector===e||(this._hoveredModel=e?{selector:e,elements:i,color:mn.action}:null,this._updateHighlight(!0))}_updateHighlight(e){this._recorder.updateHighlight(this._hoveredModel,e)}}class qA{constructor(e){this._recorder=e}install(){this._recorder.highlight.uninstall()}uninstall(){this._recorder.highlight.install()}onClick(e){const i=this._recorder.deepEventTarget(e);if(tl(i)||e.button===2&&e.type==="auxclick"||this._shouldIgnoreMouseEvent(e))return;const r=el(i),{ariaSnapshot:a,selector:o,ref:u}=this._ariaSnapshot(i);if(r&&e.detail===1){this._recorder.recordAction({name:r.checked?"check":"uncheck",selector:o,ref:u,signals:[],ariaSnapshot:a});return}this._recorder.recordAction({name:"click",selector:o,ref:u,ariaSnapshot:a,position:Wa(e),signals:[],button:Yh(e),modifiers:Tr(e),clickCount:e.detail})}onContextMenu(e){const i=this._recorder.deepEventTarget(e),{ariaSnapshot:r,selector:a,ref:o}=this._ariaSnapshot(i);this._recorder.recordAction({name:"click",selector:a,ref:o,ariaSnapshot:r,position:Wa(e),signals:[],button:"right",modifiers:Tr(e),clickCount:1})}onInput(e){const i=this._recorder.deepEventTarget(e),{ariaSnapshot:r,selector:a,ref:o}=this._ariaSnapshot(i);if(tl(i)){this._recorder.recordAction({name:"fill",selector:a,ref:o,ariaSnapshot:r,signals:[],text:i.value});return}if(["INPUT","TEXTAREA"].includes(i.nodeName)||i.isContentEditable){if(i.nodeName==="INPUT"&&["checkbox","radio"].includes(i.type.toLowerCase()))return;this._recorder.recordAction({name:"fill",ref:o,selector:a,ariaSnapshot:r,signals:[],text:i.isContentEditable?i.innerText:i.value});return}if(i.nodeName==="SELECT"){const u=i;this._recorder.recordAction({name:"select",selector:a,ref:o,ariaSnapshot:r,options:[...u.selectedOptions].map(f=>f.value),signals:[]});return}}onKeyDown(e){if(!this._shouldGenerateKeyPressFor(e))return;const i=this._recorder.deepEventTarget(e),{ariaSnapshot:r,selector:a,ref:o}=this._ariaSnapshot(i);if(e.key===" "){const u=el(i);if(u&&e.detail===0){this._recorder.recordAction({name:u.checked?"uncheck":"check",selector:a,ref:o,ariaSnapshot:r,signals:[]});return}}this._recorder.recordAction({name:"press",selector:a,ref:o,ariaSnapshot:r,signals:[],key:e.key,modifiers:Tr(e)})}_shouldIgnoreMouseEvent(e){return Jv(this._recorder.deepEventTarget(e))}_shouldGenerateKeyPressFor(e){if(typeof e.key!="string"||e.key==="Enter"&&(this._recorder.deepEventTarget(e).nodeName==="TEXTAREA"||this._recorder.deepEventTarget(e).isContentEditable)||["Backspace","Delete","AltGraph"].includes(e.key)||e.key==="@"&&e.code==="KeyL")return!1;if(navigator.platform.includes("Mac")){if(e.key==="v"&&e.metaKey)return!1}else if(e.key==="v"&&e.ctrlKey||e.key==="Insert"&&e.shiftKey)return!1;if(["Shift","Control","Meta","Alt","Process"].includes(e.key))return!1;const i=e.ctrlKey||e.altKey||e.metaKey;return e.key.length===1&&!i?!this._isEditable(this._recorder.deepEventTarget(e)):!0}_isEditable(e){return!!(e.nodeName==="TEXTAREA"||e.nodeName==="INPUT"||e.isContentEditable)}_ariaSnapshot(e){const{ariaSnapshot:i,refs:r}=this._recorder.injectedScript.ariaSnapshotForRecorder(),a=e?r.get(e):void 0,o=e?this._recorder.injectedScript.generateSelector(e,{testIdAttributeName:this._recorder.state.testIdAttributeName}):void 0;return{ariaSnapshot:i,selector:o==null?void 0:o.selector,ref:a}}}class wh{constructor(e,i){this._hoverHighlight=null,this._action=null,this._recorder=e,this._textCache=new Map,this._kind=i,this._dialog=new Pv(e)}cursor(){return"pointer"}uninstall(){this._dialog.close(),this._hoverHighlight=null}onClick(e){Ge(e),this._kind==="value"?this._commitAssertValue():this._dialog.isShowing()||this._showDialog()}onMouseDown(e){const i=this._recorder.deepEventTarget(e);this._elementHasValue(i)&&e.preventDefault()}onPointerUp(e){var r;const i=(r=this._hoverHighlight)==null?void 0:r.elements[0];this._kind==="value"&&i&&(i.nodeName==="INPUT"||i.nodeName==="SELECT")&&i.disabled&&this._commitAssertValue()}onMouseMove(e){var r;if(this._dialog.isShowing())return;const i=this._recorder.deepEventTarget(e);if(((r=this._hoverHighlight)==null?void 0:r.elements[0])!==i){if(this._kind==="text"||this._kind==="snapshot")this._hoverHighlight=this._recorder.injectedScript.utils.elementText(this._textCache,i).full?{elements:[i],selector:"",color:mn.assert}:null;else if(this._elementHasValue(i)){const a=this._recorder.injectedScript.generateSelector(i,{testIdAttributeName:this._recorder.state.testIdAttributeName});this._hoverHighlight={selector:a.selector,elements:a.elements,color:mn.assert}}else this._hoverHighlight=null;this._recorder.updateHighlight(this._hoverHighlight,!0)}}onKeyDown(e){e.key==="Escape"&&this._recorder.setMode("recording"),Ge(e)}onScroll(e){this._recorder.updateHighlight(this._hoverHighlight,!1)}_elementHasValue(e){return e.nodeName==="TEXTAREA"||e.nodeName==="SELECT"||e.nodeName==="INPUT"&&!["button","image","reset","submit"].includes(e.type)}_generateAction(){var i;this._textCache.clear();const e=(i=this._hoverHighlight)==null?void 0:i.elements[0];if(!e)return null;if(this._kind==="value"){if(!this._elementHasValue(e))return null;const{selector:r}=this._recorder.injectedScript.generateSelector(e,{testIdAttributeName:this._recorder.state.testIdAttributeName});return e.nodeName==="INPUT"&&["checkbox","radio"].includes(e.type.toLowerCase())?{name:"assertChecked",selector:r,signals:[],checked:!e.checked}:{name:"assertValue",selector:r,signals:[],value:e.value}}else if(this._kind==="snapshot"){const r=this._recorder.injectedScript.generateSelector(e,{testIdAttributeName:this._recorder.state.testIdAttributeName,forTextExpect:!0});return this._hoverHighlight={selector:r.selector,elements:r.elements,color:mn.assert},this._recorder.updateHighlight(this._hoverHighlight,!0),{name:"assertSnapshot",selector:this._hoverHighlight.selector,signals:[],ariaSnapshot:this._recorder.injectedScript.ariaSnapshot(e,{mode:"codegen"})}}else{const r=this._recorder.injectedScript.generateSelector(e,{testIdAttributeName:this._recorder.state.testIdAttributeName,forTextExpect:!0});return this._hoverHighlight={selector:r.selector,elements:r.elements,color:mn.assert},this._recorder.updateHighlight(this._hoverHighlight,!0),{name:"assertText",selector:this._hoverHighlight.selector,signals:[],text:this._recorder.injectedScript.utils.elementText(this._textCache,e).normalized,substring:!0}}}_renderValue(e){return(e==null?void 0:e.name)==="assertText"?this._recorder.injectedScript.utils.normalizeWhiteSpace(e.text):(e==null?void 0:e.name)==="assertChecked"?String(e.checked):(e==null?void 0:e.name)==="assertValue"?e.value:(e==null?void 0:e.name)==="assertSnapshot"?e.ariaSnapshot:""}_commit(){!this._action||!this._dialog.isShowing()||(this._dialog.close(),this._recorder.recordAction(this._action),this._recorder.setMode("recording"))}_showDialog(){var e,i,r,a;(e=this._hoverHighlight)!=null&&e.elements[0]&&(this._action=this._generateAction(),((i=this._action)==null?void 0:i.name)==="assertText"?this._showTextDialog(this._action):((r=this._action)==null?void 0:r.name)==="assertSnapshot"&&(this._recorder.recordAction(this._action),this._recorder.setMode("recording"),(a=this._recorder.overlay)==null||a.flashToolSucceeded("assertingSnapshot")))}_showTextDialog(e){const i=this._recorder.document.createElement("textarea");i.setAttribute("spellcheck","false"),i.value=this._renderValue(e),i.classList.add("text-editor");const r=()=>{var y;const f=this._recorder.injectedScript.utils.normalizeWhiteSpace(i.value),d=(y=this._hoverHighlight)==null?void 0:y.elements[0];if(!d)return;e.text=f;const g=this._recorder.injectedScript.utils.elementText(this._textCache,d).normalized,m=f&&g.includes(f);i.classList.toggle("does-not-match",!m)};i.addEventListener("input",r);const o=this._dialog.show({label:"Assert that element contains text",body:i,onCommit:()=>this._commit()}),u=this._recorder.highlight.tooltipPosition(this._recorder.highlight.firstBox(),o);this._dialog.moveTo(u.anchorTop,u.anchorLeft),i.focus()}_commitAssertValue(){var i;if(this._kind!=="value")return;const e=this._generateAction();e&&(this._recorder.recordAction(e),this._recorder.setMode("recording"),(i=this._recorder.overlay)==null||i.flashToolSucceeded("assertingValue"))}}class $A{constructor(e){this._listeners=[],this._offsetX=0,this._measure={width:0,height:0},this._recorder=e;const i=this._recorder.document;this._overlayElement=i.createElement("x-pw-overlay");const r=i.createElement("x-pw-tools-list");this._overlayElement.appendChild(r),this._dragHandle=i.createElement("x-pw-tool-gripper"),this._dragHandle.appendChild(i.createElement("x-div")),r.appendChild(this._dragHandle),this._recordToggle=this._recorder.document.createElement("x-pw-tool-item"),this._recordToggle.title="Record",this._recordToggle.classList.add("record"),this._recordToggle.appendChild(this._recorder.document.createElement("x-div")),r.appendChild(this._recordToggle),this._pickLocatorToggle=this._recorder.document.createElement("x-pw-tool-item"),this._pickLocatorToggle.title="Pick locator",this._pickLocatorToggle.classList.add("pick-locator"),this._pickLocatorToggle.appendChild(this._recorder.document.createElement("x-div")),r.appendChild(this._pickLocatorToggle),this._assertVisibilityToggle=this._recorder.document.createElement("x-pw-tool-item"),this._assertVisibilityToggle.title="Assert visibility",this._assertVisibilityToggle.classList.add("visibility"),this._assertVisibilityToggle.appendChild(this._recorder.document.createElement("x-div")),r.appendChild(this._assertVisibilityToggle),this._assertTextToggle=this._recorder.document.createElement("x-pw-tool-item"),this._assertTextToggle.title="Assert text",this._assertTextToggle.classList.add("text"),this._assertTextToggle.appendChild(this._recorder.document.createElement("x-div")),r.appendChild(this._assertTextToggle),this._assertValuesToggle=this._recorder.document.createElement("x-pw-tool-item"),this._assertValuesToggle.title="Assert value",this._assertValuesToggle.classList.add("value"),this._assertValuesToggle.appendChild(this._recorder.document.createElement("x-div")),r.appendChild(this._assertValuesToggle),this._assertSnapshotToggle=this._recorder.document.createElement("x-pw-tool-item"),this._assertSnapshotToggle.title="Assert snapshot",this._assertSnapshotToggle.classList.add("snapshot"),this._assertSnapshotToggle.appendChild(this._recorder.document.createElement("x-div")),r.appendChild(this._assertSnapshotToggle),this._updateVisualPosition(),this._refreshListeners()}_refreshListeners(){Zv(this._listeners),this._listeners=[Ie(this._dragHandle,"mousedown",e=>{this._dragState={offsetX:this._offsetX,dragStart:{x:e.clientX,y:0}}}),Ie(this._recordToggle,"click",()=>{this._recordToggle.classList.contains("disabled")||this._recorder.setMode(this._recorder.state.mode==="none"||this._recorder.state.mode==="standby"||this._recorder.state.mode==="inspecting"?"recording":"standby")}),Ie(this._pickLocatorToggle,"click",()=>{if(this._pickLocatorToggle.classList.contains("disabled"))return;const e={inspecting:"standby",none:"inspecting",standby:"inspecting",recording:"recording-inspecting","recording-inspecting":"recording",assertingText:"recording-inspecting",assertingVisibility:"recording-inspecting",assertingValue:"recording-inspecting",assertingSnapshot:"recording-inspecting"};this._recorder.setMode(e[this._recorder.state.mode])}),Ie(this._assertVisibilityToggle,"click",()=>{this._assertVisibilityToggle.classList.contains("disabled")||this._recorder.setMode(this._recorder.state.mode==="assertingVisibility"?"recording":"assertingVisibility")}),Ie(this._assertTextToggle,"click",()=>{this._assertTextToggle.classList.contains("disabled")||this._recorder.setMode(this._recorder.state.mode==="assertingText"?"recording":"assertingText")}),Ie(this._assertValuesToggle,"click",()=>{this._assertValuesToggle.classList.contains("disabled")||this._recorder.setMode(this._recorder.state.mode==="assertingValue"?"recording":"assertingValue")}),Ie(this._assertSnapshotToggle,"click",()=>{this._assertSnapshotToggle.classList.contains("disabled")||this._recorder.setMode(this._recorder.state.mode==="assertingSnapshot"?"recording":"assertingSnapshot")})]}install(){this._recorder.highlight.appendChild(this._overlayElement),this._refreshListeners(),this._updateVisualPosition()}contains(e){return this._recorder.injectedScript.utils.isInsideScope(this._overlayElement,e)}setUIState(e){const i=e.mode==="recording"||e.mode==="assertingText"||e.mode==="assertingVisibility"||e.mode==="assertingValue"||e.mode==="assertingSnapshot"||e.mode==="recording-inspecting";this._recordToggle.classList.toggle("toggled",i),this._recordToggle.title=i?"Stop Recording":"Start Recording",this._pickLocatorToggle.classList.toggle("toggled",e.mode==="inspecting"||e.mode==="recording-inspecting"),this._assertVisibilityToggle.classList.toggle("toggled",e.mode==="assertingVisibility"),this._assertVisibilityToggle.classList.toggle("disabled",e.mode==="none"||e.mode==="standby"||e.mode==="inspecting"),this._assertTextToggle.classList.toggle("toggled",e.mode==="assertingText"),this._assertTextToggle.classList.toggle("disabled",e.mode==="none"||e.mode==="standby"||e.mode==="inspecting"),this._assertValuesToggle.classList.toggle("toggled",e.mode==="assertingValue"),this._assertValuesToggle.classList.toggle("disabled",e.mode==="none"||e.mode==="standby"||e.mode==="inspecting"),this._assertSnapshotToggle.classList.toggle("toggled",e.mode==="assertingSnapshot"),this._assertSnapshotToggle.classList.toggle("disabled",e.mode==="none"||e.mode==="standby"||e.mode==="inspecting"),this._offsetX!==e.overlay.offsetX&&(this._offsetX=e.overlay.offsetX,this._updateVisualPosition()),e.mode==="none"?this._hideOverlay():this._showOverlay()}flashToolSucceeded(e){let i;e==="assertingVisibility"?i=this._assertVisibilityToggle:e==="assertingSnapshot"?i=this._assertSnapshotToggle:i=this._assertValuesToggle,i.classList.add("succeeded"),this._recorder.injectedScript.utils.builtins.setTimeout(()=>i.classList.remove("succeeded"),2e3)}_hideOverlay(){this._overlayElement.setAttribute("hidden","true")}_showOverlay(){this._overlayElement.hasAttribute("hidden")&&(this._overlayElement.removeAttribute("hidden"),this._updateVisualPosition())}_updateVisualPosition(){this._measure=this._overlayElement.getBoundingClientRect(),this._overlayElement.style.left=(this._recorder.injectedScript.window.innerWidth-this._measure.width)/2+this._offsetX+"px"}onMouseMove(e){if(!e.buttons)return this._dragState=void 0,!1;if(this._dragState){this._offsetX=this._dragState.offsetX+e.clientX-this._dragState.dragStart.x;const i=(this._recorder.injectedScript.window.innerWidth-this._measure.width)/2-10;return this._offsetX=Math.max(-i,Math.min(i,this._offsetX)),this._updateVisualPosition(),this._recorder.setOverlayState({offsetX:this._offsetX}),Ge(e),!0}return!1}onMouseUp(e){return this._dragState?(Ge(e),!0):!1}onClick(e){return this._dragState?(this._dragState=void 0,Ge(e),!0):!1}onDblClick(e){return!1}}class IA{constructor(e,i){var r,a;this._listeners=[],this._lastHighlightedSelector=void 0,this._lastHighlightedAriaTemplateJSON="undefined",this.state={mode:"none",testIdAttributeName:"data-testid",language:"javascript",overlay:{offsetX:0}},this._delegate={},this.document=e.document,this.injectedScript=e,this.highlight=e.createHighlight(),this._tools={none:new Yb,standby:new Yb,inspecting:new Sh(this,!1),recording:(i==null?void 0:i.recorderMode)==="api"?new qA(this):new BA(this),"recording-inspecting":new Sh(this,!1),assertingText:new wh(this,"text"),assertingVisibility:new Sh(this,!0),assertingValue:new wh(this,"value"),assertingSnapshot:new wh(this,"snapshot")},this._currentTool=this._tools.none,(a=(r=this._currentTool).install)==null||a.call(r),e.window.top===e.window&&!(i!=null&&i.hideToolbar)&&(this.overlay=new $A(this),this.overlay.setUIState(this.state)),this._stylesheet=new e.window.CSSStyleSheet,this._stylesheet.replaceSync(`
      body[data-pw-cursor=pointer] *, body[data-pw-cursor=pointer] *::after { cursor: pointer !important; }
      body[data-pw-cursor=text] *, body[data-pw-cursor=text] *::after { cursor: text !important; }
    `),this.installListeners(),e.utils.cacheNormalizedWhitespaces(),e.isUnderTest&&console.error("Recorder script ready for test"),e.consoleApi.install()}installListeners(){var r,a,o;Zv(this._listeners),this._listeners=[Ie(this.document,"click",u=>this._onClick(u),!0),Ie(this.document,"auxclick",u=>this._onClick(u),!0),Ie(this.document,"dblclick",u=>this._onDblClick(u),!0),Ie(this.document,"contextmenu",u=>this._onContextMenu(u),!0),Ie(this.document,"dragstart",u=>this._onDragStart(u),!0),Ie(this.document,"input",u=>this._onInput(u),!0),Ie(this.document,"keydown",u=>this._onKeyDown(u),!0),Ie(this.document,"keyup",u=>this._onKeyUp(u),!0),Ie(this.document,"pointerdown",u=>this._onPointerDown(u),!0),Ie(this.document,"pointerup",u=>this._onPointerUp(u),!0),Ie(this.document,"mousedown",u=>this._onMouseDown(u),!0),Ie(this.document,"mouseup",u=>this._onMouseUp(u),!0),Ie(this.document,"mousemove",u=>this._onMouseMove(u),!0),Ie(this.document,"mouseleave",u=>this._onMouseLeave(u),!0),Ie(this.document,"mouseenter",u=>this._onMouseEnter(u),!0),Ie(this.document,"focus",u=>this._onFocus(u),!0),Ie(this.document,"scroll",u=>this._onScroll(u),!0)],this.highlight.install();let e;const i=()=>{this.highlight.install(),e=this.injectedScript.utils.builtins.setTimeout(i,500)};e=this.injectedScript.utils.builtins.setTimeout(i,500),this._listeners.push(()=>this.injectedScript.utils.builtins.clearTimeout(e)),this.highlight.appendChild(Wv(this.document,HA)),(r=this.overlay)==null||r.install(),(o=(a=this._currentTool)==null?void 0:a.install)==null||o.call(a),this.document.adoptedStyleSheets.push(this._stylesheet)}_switchCurrentTool(){var r,a,o,u,f,d;const e=this._tools[this.state.mode];if(e===this._currentTool)return;(a=(r=this._currentTool).uninstall)==null||a.call(r),this.clearHighlight(),this._currentTool=e,(u=(o=this._currentTool).install)==null||u.call(o);const i=(f=e.cursor)==null?void 0:f.call(e);i&&((d=this.injectedScript.document.body)==null||d.setAttribute("data-pw-cursor",i))}setUIState(e,i){var o;this._delegate=i,e.actionPoint&&this.state.actionPoint&&e.actionPoint.x===this.state.actionPoint.x&&e.actionPoint.y===this.state.actionPoint.y||!e.actionPoint&&!this.state.actionPoint||(e.actionPoint?this.highlight.showActionPoint(e.actionPoint.x,e.actionPoint.y):this.highlight.hideActionPoint()),this.state=e,this.highlight.setLanguage(e.language),this._switchCurrentTool(),(o=this.overlay)==null||o.setUIState(e);let r="noop";if(e.actionSelector!==this._lastHighlightedSelector){const u=e.actionSelector?KA(this.injectedScript,e.language,e.actionSelector,this.document):null;r=u!=null&&u.length?u:"clear",this._lastHighlightedSelector=u!=null&&u.length?e.actionSelector:void 0}const a=JSON.stringify(e.ariaTemplate);if(this._lastHighlightedAriaTemplateJSON!==a){const u=e.ariaTemplate?this.injectedScript.getAllElementsMatchingExpectAriaTemplate(this.document,e.ariaTemplate):[];if(u.length){const f=u.length>1?mn.multiple:mn.single;r=u.map(d=>({element:d,color:f})),this._lastHighlightedAriaTemplateJSON=a}else this._lastHighlightedSelector||(r="clear"),this._lastHighlightedAriaTemplateJSON="undefined"}r==="clear"?this.highlight.clearHighlight():r!=="noop"&&this.highlight.updateHighlight(r)}clearHighlight(){this.updateHighlight(null,!1)}_onClick(e){var i,r,a;e.isTrusted&&((i=this.overlay)!=null&&i.onClick(e)||this._ignoreOverlayEvent(e)||(a=(r=this._currentTool).onClick)==null||a.call(r,e))}_onDblClick(e){var i,r,a;e.isTrusted&&((i=this.overlay)!=null&&i.onDblClick(e)||this._ignoreOverlayEvent(e)||(a=(r=this._currentTool).onDblClick)==null||a.call(r,e))}_onContextMenu(e){var i,r;e.isTrusted&&((r=(i=this._currentTool).onContextMenu)==null||r.call(i,e))}_onDragStart(e){var i,r;e.isTrusted&&(this._ignoreOverlayEvent(e)||(r=(i=this._currentTool).onDragStart)==null||r.call(i,e))}_onPointerDown(e){var i,r;e.isTrusted&&(this._ignoreOverlayEvent(e)||(r=(i=this._currentTool).onPointerDown)==null||r.call(i,e))}_onPointerUp(e){var i,r;e.isTrusted&&(this._ignoreOverlayEvent(e)||(r=(i=this._currentTool).onPointerUp)==null||r.call(i,e))}_onMouseDown(e){var i,r;e.isTrusted&&(this._ignoreOverlayEvent(e)||(r=(i=this._currentTool).onMouseDown)==null||r.call(i,e))}_onMouseUp(e){var i,r,a;e.isTrusted&&((i=this.overlay)!=null&&i.onMouseUp(e)||this._ignoreOverlayEvent(e)||(a=(r=this._currentTool).onMouseUp)==null||a.call(r,e))}_onMouseMove(e){var i,r,a;e.isTrusted&&((i=this.overlay)!=null&&i.onMouseMove(e)||this._ignoreOverlayEvent(e)||(a=(r=this._currentTool).onMouseMove)==null||a.call(r,e))}_onMouseEnter(e){var i,r;e.isTrusted&&(this._ignoreOverlayEvent(e)||(r=(i=this._currentTool).onMouseEnter)==null||r.call(i,e))}_onMouseLeave(e){var i,r;e.isTrusted&&(this._ignoreOverlayEvent(e)||(r=(i=this._currentTool).onMouseLeave)==null||r.call(i,e))}_onFocus(e){var i,r;e.isTrusted&&(this._ignoreOverlayEvent(e)||(r=(i=this._currentTool).onFocus)==null||r.call(i,e))}_onScroll(e){var i,r;e.isTrusted&&(this._lastHighlightedSelector=void 0,this._lastHighlightedAriaTemplateJSON="undefined",this.highlight.hideActionPoint(),(r=(i=this._currentTool).onScroll)==null||r.call(i,e))}_onInput(e){var i,r;this._ignoreOverlayEvent(e)||(r=(i=this._currentTool).onInput)==null||r.call(i,e)}_onKeyDown(e){var i,r;e.isTrusted&&(this._ignoreOverlayEvent(e)||(r=(i=this._currentTool).onKeyDown)==null||r.call(i,e))}_onKeyUp(e){var i,r;e.isTrusted&&(this._ignoreOverlayEvent(e)||(r=(i=this._currentTool).onKeyUp)==null||r.call(i,e))}updateHighlight(e,i){this._lastHighlightedSelector=void 0,this._lastHighlightedAriaTemplateJSON="undefined",this._updateHighlight(e,i)}_updateHighlight(e,i){var a,o;let r=e==null?void 0:e.tooltipText;r===void 0&&(e!=null&&e.selector)&&(r=this.injectedScript.utils.asLocator(this.state.language,e.selector)),e?this.highlight.updateHighlight(e.elements.map(u=>({element:u,color:e.color,tooltipText:r}))):this.highlight.clearHighlight(),i&&((o=(a=this._delegate).highlightUpdated)==null||o.call(a))}_ignoreOverlayEvent(e){return e.composedPath().some(i=>(i.nodeName||"").toLowerCase()==="x-pw-glass")}deepEventTarget(e){var i;for(const r of e.composedPath())if(!((i=this.overlay)!=null&&i.contains(r)))return r;return e.composedPath()[0]}setMode(e){var i,r;(r=(i=this._delegate).setMode)==null||r.call(i,e)}_captureAutoExpectSnapshot(){const e=this.injectedScript.document.documentElement;return e?this.injectedScript.utils.generateAriaTree(e,{mode:"autoexpect"}):void 0}async performAction(e){var r,a,o;const i=this._lastActionAutoexpectSnapshot;if(this._lastActionAutoexpectSnapshot=this._captureAutoExpectSnapshot(),!XA(e)&&this._lastActionAutoexpectSnapshot){const u=this.injectedScript.utils.findNewElement(i==null?void 0:i.root,(r=this._lastActionAutoexpectSnapshot)==null?void 0:r.root);e.preconditionSelector=u?this.injectedScript.generateSelector(u,{testIdAttributeName:this.state.testIdAttributeName}).selector:void 0,e.preconditionSelector===e.selector&&(e.preconditionSelector=void 0)}await((o=(a=this._delegate).performAction)==null?void 0:o.call(a,e).catch(()=>{}))}async recordAction(e){var i,r;this._lastActionAutoexpectSnapshot=this._captureAutoExpectSnapshot(),await((r=(i=this._delegate).recordAction)==null?void 0:r.call(i,e))}setOverlayState(e){var i,r;(r=(i=this._delegate).setOverlayState)==null||r.call(i,e)}elementPicked(e,i){var a,o;const r=this.injectedScript.ariaSnapshot(i.elements[0],{mode:"default"});(o=(a=this._delegate).elementPicked)==null||o.call(a,{selector:e,ariaSnapshot:r})}}let Pv=class{constructor(e){this._dialogElement=null,this._recorder=e}isShowing(){return!!this._dialogElement}show(e){const i=this._recorder.document.createElement("x-pw-tool-item");i.title="Accept",i.classList.add("accept"),i.appendChild(this._recorder.document.createElement("x-div")),i.addEventListener("click",()=>{var f;return(f=e.onCommit)==null?void 0:f.call(e)});const r=this._recorder.document.createElement("x-pw-tool-item");r.title="Close",r.classList.add("cancel"),r.appendChild(this._recorder.document.createElement("x-div")),r.addEventListener("click",()=>{var f;this.close(),(f=e.onCancel)==null||f.call(e)}),this._dialogElement=this._recorder.document.createElement("x-pw-dialog"),e.autosize&&this._dialogElement.classList.add("autosize"),this._keyboardListener=f=>{var d;if(f.key==="Escape"){this.close(),(d=e.onCancel)==null||d.call(e);return}if(e.onCommit&&f.key==="Enter"&&(f.ctrlKey||f.metaKey)){this._dialogElement&&e.onCommit();return}},this._onGlassPaneClickHandler=f=>{var d;this.close(),(d=e.onCancel)==null||d.call(e)},this._dialogElement.addEventListener("click",f=>f.stopPropagation());const a=this._recorder.document.createElement("x-pw-tools-list"),o=this._recorder.document.createElement("label");o.textContent=e.label,a.appendChild(o),a.appendChild(this._recorder.document.createElement("x-spacer")),e.onCommit&&a.appendChild(i),a.appendChild(r),this._dialogElement.appendChild(a);const u=this._recorder.document.createElement("x-pw-dialog-body");return u.appendChild(e.body),this._dialogElement.appendChild(u),this._recorder.highlight.appendChild(this._dialogElement),this._recorder.highlight.onGlassPaneClick(this._onGlassPaneClickHandler),this._recorder.document.addEventListener("keydown",this._keyboardListener,!0),this._dialogElement}moveTo(e,i){this._dialogElement&&(this._dialogElement.style.top=e+"px",this._dialogElement.style.left=i+"px")}close(){this._dialogElement&&(this._dialogElement.remove(),this._recorder.highlight.offGlassPaneClick(this._onGlassPaneClickHandler),this._recorder.document.removeEventListener("keydown",this._keyboardListener),this._dialogElement=null)}};function VA(n){let e=n.activeElement;for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function Tr(n){return(n.altKey?1:0)|(n.ctrlKey?2:0)|(n.metaKey?4:0)|(n.shiftKey?8:0)}function Yh(n){switch(n.which){case 1:return"left";case 2:return"middle";case 3:return"right"}return"left"}function Wa(n){if(n.target.nodeName==="CANVAS")return{x:n.offsetX,y:n.offsetY}}function Ge(n){n.preventDefault(),n.stopPropagation(),n.stopImmediatePropagation()}function el(n){if(!n||n.nodeName!=="INPUT")return null;const e=n;return["checkbox","radio"].includes(e.type)?e:null}function tl(n){return!n||n.nodeName!=="INPUT"?!1:n.type.toLowerCase()==="range"}const GA=new Set(["color","date","datetime-local","file","month","range","time","week"]);function Jv(n){const e=n.nodeName;return!!(e==="SELECT"||e==="OPTION"||e==="INPUT"&&GA.has(n.type))}function Ie(n,e,i,r){return n.addEventListener(e,i,r),()=>{n.removeEventListener(e,i,r)}}function Zv(n){for(const e of n)e();n.splice(0,n.length)}function KA(n,e,i,r){try{const a=n.parseSelector(i),o=n.querySelectorAll(a,r),u=o.length>1?mn.multiple:mn.single,f=n.utils.asLocator(e,i);return o.map((d,g)=>{const m=o.length>1?` [${g+1} of ${o.length}]`:"";return{element:d,color:u,tooltipText:f+m}})}catch{return[]}}function Wv(n,{tagName:e,attrs:i,children:r}){const a=n.createElementNS("http://www.w3.org/2000/svg",e);if(i)for(const[o,u]of Object.entries(i))a.setAttribute(o,u);if(r)for(const o of r)a.appendChild(Wv(n,o));return a}function XA(n){return n.name.startsWith("assert")}const YA="data:text/html;base64,"+btoa("<body></body><style>body { color-scheme: light dark; background: light-dark(white, #333) }</style>");function FA(n,e){n=n.replace(/AriaRole\s*\.\s*([\w]+)/g,(o,u)=>u.toLowerCase()).replace(/(get_by_role|getByRole)\s*\(\s*(?:["'`])([^'"`]+)['"`]/g,(o,u,f)=>`${u}(${f.toLowerCase()}`);const i=[];let r="";for(let o=0;o<n.length;++o){const u=n[o];if(u!=='"'&&u!=="'"&&u!=="`"&&u!=="/"){r+=u;continue}const f=n[o-1]==="r"||n[o]==="/";++o;let d="";for(;o<n.length;){if(n[o]==="\\"){f?(n[o+1]!==u&&(d+=n[o]),++o,d+=n[o]):(++o,n[o]==="n"?d+=`
`:n[o]==="r"?d+="\r":n[o]==="t"?d+="	":d+=n[o]),++o;continue}if(n[o]!==u){d+=n[o++];continue}break}i.push({quote:u,text:d}),r+=(u==="/"?"r":"")+"$"+i.length}r=r.toLowerCase().replace(/get_by_alt_text/g,"getbyalttext").replace(/get_by_test_id/g,"getbytestid").replace(/get_by_([\w]+)/g,"getby$1").replace(/has_not_text/g,"hasnottext").replace(/has_text/g,"hastext").replace(/has_not/g,"hasnot").replace(/frame_locator/g,"framelocator").replace(/content_frame/g,"contentframe").replace(/[{}\s]/g,"").replace(/new\(\)/g,"").replace(/new[\w]+\.[\w]+options\(\)/g,"").replace(/\.set/g,",set").replace(/\.or_\(/g,"or(").replace(/\.and_\(/g,"and(").replace(/:/g,"=").replace(/,re\.ignorecase/g,"i").replace(/,pattern.case_insensitive/g,"i").replace(/,regexoptions.ignorecase/g,"i").replace(/re.compile\(([^)]+)\)/g,"$1").replace(/pattern.compile\(([^)]+)\)/g,"r$1").replace(/newregex\(([^)]+)\)/g,"r$1").replace(/string=/g,"=").replace(/regex=/g,"=").replace(/,,/g,",").replace(/,\)/g,")");const a=i.map(o=>o.quote).filter(o=>"'\"`".includes(o))[0];return{selector:eS(r,i,e),preferredQuote:a}}function Fb(n){return[...n.matchAll(/\$\d+/g)].length}function Qb(n,e){return n.replace(/\$(\d+)/g,(i,r)=>`$${r-e}`)}function eS(n,e,i){for(;;){const a=n.match(/filter\(,?(has=|hasnot=|sethas\(|sethasnot\()/);if(!a)break;const o=a.index+a[0].length;let u=0,f=o;for(;f<n.length&&(n[f]==="("?u++:n[f]===")"&&u--,!(u<0));f++);let d=n.substring(0,o),g=0;["sethas(","sethasnot("].includes(a[1])&&(g=1,d=d.replace(/sethas\($/,"has=").replace(/sethasnot\($/,"hasnot="));const m=Fb(n.substring(0,o)),y=Qb(n.substring(o,f),m),S=Fb(y),w=e.slice(m,m+S),E=JSON.stringify(eS(y,w,i));n=d.replace(/=$/,"2=")+`$${m+1}`+Qb(n.substring(f+g),S-1);const x=e.slice(0,m),_=e.slice(m+S);e=x.concat([{quote:'"',text:E}]).concat(_)}n=n.replace(/\,set([\w]+)\(([^)]+)\)/g,(a,o,u)=>","+o.toLowerCase()+"="+u.toLowerCase()).replace(/framelocator\(([^)]+)\)/g,"$1.internal:control=enter-frame").replace(/contentframe(\(\))?/g,"internal:control=enter-frame").replace(/locator\(([^)]+),hastext=([^),]+)\)/g,"locator($1).internal:has-text=$2").replace(/locator\(([^)]+),hasnottext=([^),]+)\)/g,"locator($1).internal:has-not-text=$2").replace(/locator\(([^)]+),hastext=([^),]+)\)/g,"locator($1).internal:has-text=$2").replace(/locator\(([^)]+)\)/g,"$1").replace(/getbyrole\(([^)]+)\)/g,"internal:role=$1").replace(/getbytext\(([^)]+)\)/g,"internal:text=$1").replace(/getbylabel\(([^)]+)\)/g,"internal:label=$1").replace(/getbytestid\(([^)]+)\)/g,`internal:testid=[${lv(i)}=$1]`).replace(/getby(placeholder|alt|title)(?:text)?\(([^)]+)\)/g,"internal:attr=[$1=$2]").replace(/first(\(\))?/g,"nth=0").replace(/last(\(\))?/g,"nth=-1").replace(/nth\(([^)]+)\)/g,"nth=$1").replace(/filter\(,?visible=true\)/g,"visible=true").replace(/filter\(,?visible=false\)/g,"visible=false").replace(/filter\(,?hastext=([^)]+)\)/g,"internal:has-text=$1").replace(/filter\(,?hasnottext=([^)]+)\)/g,"internal:has-not-text=$1").replace(/filter\(,?has2=([^)]+)\)/g,"internal:has=$1").replace(/filter\(,?hasnot2=([^)]+)\)/g,"internal:has-not=$1").replace(/,exact=false/g,"").replace(/(,name=\$\d+)(,description=\$\d+),exact=true/g,"$1s$2s").replace(/,exact=true/g,"s").replace(/,includehidden=/g,",include-hidden=").replace(/\,/g,"][");const r=n.split(".");for(let a=0;a<r.length-1;a++)if(r[a]==="internal:control=enter-frame"&&r[a+1].startsWith("nth=")){const[o]=r.splice(a,1);r.splice(a+1,0,o)}return r.map(a=>!a.startsWith("internal:")||a==="internal:control"?a.replace(/\$(\d+)/g,(o,u)=>e[+u-1].text):(a=a.includes("[")?a.replace(/\]/,"")+"]":a,a=a.replace(/(?:r)\$(\d+)(i)?/g,(o,u,f)=>{const d=e[+u-1];return a.startsWith("internal:attr")||a.startsWith("internal:testid")||a.startsWith("internal:role")?Ze(new RegExp(d.text),!1)+(f||""):Vt(new RegExp(d.text,f),!1)}).replace(/\$(\d+)(i|s)?/g,(o,u,f)=>{const d=e[+u-1];return a.startsWith("internal:has=")||a.startsWith("internal:has-not=")?d.text:a.startsWith("internal:testid")?Ze(d.text,!0):a.startsWith("internal:attr")||a.startsWith("internal:role")?Ze(d.text,f==="s"):Vt(d.text,f==="s")}),a)).join(" >> ")}function QA(n,e,i="data-testid"){try{return PA(n,e,i)}catch{return""}}function PA(n,e,i="data-testid"){try{return fl(e),e}catch{}const{selector:r,preferredQuote:a}=FA(e,i),o=V0(n,r,void 0,void 0,a),u=Pb(n,e);return o.some(f=>Pb(n,f)===u)?r:""}function Pb(n,e){return e=e.replace(/\s/g,""),n==="javascript"&&(e=e.replace(/\\?["`]/g,"'").replace(/,{}/g,"")),e}const JA=({url:n})=>b.jsxs("div",{className:"browser-frame-header",children:[b.jsxs("div",{className:"browser-traffic-lights",children:[b.jsx("span",{className:"browser-frame-dot",style:{backgroundColor:"rgb(242, 95, 88)"}}),b.jsx("span",{className:"browser-frame-dot",style:{backgroundColor:"rgb(251, 190, 60)"}}),b.jsx("span",{className:"browser-frame-dot",style:{backgroundColor:"rgb(88, 203, 66)"}})]}),b.jsxs("div",{className:"browser-frame-address-bar",title:n||"about:blank",children:[b.jsx("span",{className:"browser-frame-address",children:n||"about:blank"}),n&&b.jsx(ud,{value:n})]}),b.jsx("div",{style:{marginLeft:"auto"},children:b.jsxs("div",{children:[b.jsx("span",{className:"browser-frame-menu-bar"}),b.jsx("span",{className:"browser-frame-menu-bar"}),b.jsx("span",{className:"browser-frame-menu-bar"})]})})]}),Ud=Symbol.for("yaml.alias"),Fh=Symbol.for("yaml.document"),Di=Symbol.for("yaml.map"),tS=Symbol.for("yaml.pair"),jn=Symbol.for("yaml.scalar"),Rr=Symbol.for("yaml.seq"),bn=Symbol.for("yaml.node.type"),Hi=n=>!!n&&typeof n=="object"&&n[bn]===Ud,ms=n=>!!n&&typeof n=="object"&&n[bn]===Fh,Dr=n=>!!n&&typeof n=="object"&&n[bn]===Di,Ve=n=>!!n&&typeof n=="object"&&n[bn]===tS,ze=n=>!!n&&typeof n=="object"&&n[bn]===jn,zr=n=>!!n&&typeof n=="object"&&n[bn]===Rr;function Ke(n){if(n&&typeof n=="object")switch(n[bn]){case Di:case Rr:return!0}return!1}function Xe(n){if(n&&typeof n=="object")switch(n[bn]){case Ud:case Di:case jn:case Rr:return!0}return!1}const nS=n=>(ze(n)||Ke(n))&&!!n.anchor,Gt=Symbol("break visit"),iS=Symbol("skip children"),On=Symbol("remove node");function ys(n,e){const i=sS(e);ms(n)?Sr(null,n.contents,i,Object.freeze([n]))===On&&(n.contents=null):Sr(null,n,i,Object.freeze([]))}ys.BREAK=Gt;ys.SKIP=iS;ys.REMOVE=On;function Sr(n,e,i,r){const a=rS(n,e,i,r);if(Xe(a)||Ve(a))return aS(n,r,a),Sr(n,a,i,r);if(typeof a!="symbol"){if(Ke(e)){r=Object.freeze(r.concat(e));for(let o=0;o<e.items.length;++o){const u=Sr(o,e.items[o],i,r);if(typeof u=="number")o=u-1;else{if(u===Gt)return Gt;u===On&&(e.items.splice(o,1),o-=1)}}}else if(Ve(e)){r=Object.freeze(r.concat(e));const o=Sr("key",e.key,i,r);if(o===Gt)return Gt;o===On&&(e.key=null);const u=Sr("value",e.value,i,r);if(u===Gt)return Gt;u===On&&(e.value=null)}}return a}async function Ac(n,e){const i=sS(e);ms(n)?await wr(null,n.contents,i,Object.freeze([n]))===On&&(n.contents=null):await wr(null,n,i,Object.freeze([]))}Ac.BREAK=Gt;Ac.SKIP=iS;Ac.REMOVE=On;async function wr(n,e,i,r){const a=await rS(n,e,i,r);if(Xe(a)||Ve(a))return aS(n,r,a),wr(n,a,i,r);if(typeof a!="symbol"){if(Ke(e)){r=Object.freeze(r.concat(e));for(let o=0;o<e.items.length;++o){const u=await wr(o,e.items[o],i,r);if(typeof u=="number")o=u-1;else{if(u===Gt)return Gt;u===On&&(e.items.splice(o,1),o-=1)}}}else if(Ve(e)){r=Object.freeze(r.concat(e));const o=await wr("key",e.key,i,r);if(o===Gt)return Gt;o===On&&(e.key=null);const u=await wr("value",e.value,i,r);if(u===Gt)return Gt;u===On&&(e.value=null)}}return a}function sS(n){return typeof n=="object"&&(n.Collection||n.Node||n.Value)?Object.assign({Alias:n.Node,Map:n.Node,Scalar:n.Node,Seq:n.Node},n.Value&&{Map:n.Value,Scalar:n.Value,Seq:n.Value},n.Collection&&{Map:n.Collection,Seq:n.Collection},n):n}function rS(n,e,i,r){var a,o,u,f,d;if(typeof i=="function")return i(n,e,r);if(Dr(e))return(a=i.Map)==null?void 0:a.call(i,n,e,r);if(zr(e))return(o=i.Seq)==null?void 0:o.call(i,n,e,r);if(Ve(e))return(u=i.Pair)==null?void 0:u.call(i,n,e,r);if(ze(e))return(f=i.Scalar)==null?void 0:f.call(i,n,e,r);if(Hi(e))return(d=i.Alias)==null?void 0:d.call(i,n,e,r)}function aS(n,e,i){const r=e[e.length-1];if(Ke(r))r.items[n]=i;else if(Ve(r))n==="key"?r.key=i:r.value=i;else if(ms(r))r.contents=i;else{const a=Hi(r)?"alias":"scalar";throw new Error(`Cannot replace node with ${a} parent`)}}const ZA={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},WA=n=>n.replace(/[!,[\]{}]/g,e=>ZA[e]);class Ot{constructor(e,i){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},Ot.defaultYaml,e),this.tags=Object.assign({},Ot.defaultTags,i)}clone(){const e=new Ot(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){const e=new Ot(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:Ot.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},Ot.defaultTags);break}return e}add(e,i){this.atNextDocument&&(this.yaml={explicit:Ot.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},Ot.defaultTags),this.atNextDocument=!1);const r=e.trim().split(/[ \t]+/),a=r.shift();switch(a){case"%TAG":{if(r.length!==2&&(i(0,"%TAG directive should contain exactly two parts"),r.length<2))return!1;const[o,u]=r;return this.tags[o]=u,!0}case"%YAML":{if(this.yaml.explicit=!0,r.length!==1)return i(0,"%YAML directive should contain exactly one part"),!1;const[o]=r;if(o==="1.1"||o==="1.2")return this.yaml.version=o,!0;{const u=/^\d+\.\d+$/.test(o);return i(6,`Unsupported YAML version ${o}`,u),!1}}default:return i(0,`Unknown directive ${a}`,!0),!1}}tagName(e,i){if(e==="!")return"!";if(e[0]!=="!")return i(`Not a valid tag: ${e}`),null;if(e[1]==="<"){const u=e.slice(2,-1);return u==="!"||u==="!!"?(i(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&i("Verbatim tags must end with a >"),u)}const[,r,a]=e.match(/^(.*!)([^!]*)$/s);a||i(`The ${e} tag has no suffix`);const o=this.tags[r];if(o)try{return o+decodeURIComponent(a)}catch(u){return i(String(u)),null}return r==="!"?e:(i(`Could not resolve tag: ${e}`),null)}tagString(e){for(const[i,r]of Object.entries(this.tags))if(e.startsWith(r))return i+WA(e.substring(r.length));return e[0]==="!"?e:`!<${e}>`}toString(e){const i=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],r=Object.entries(this.tags);let a;if(e&&r.length>0&&Xe(e.contents)){const o={};ys(e.contents,(u,f)=>{Xe(f)&&f.tag&&(o[f.tag]=!0)}),a=Object.keys(o)}else a=[];for(const[o,u]of r)o==="!!"&&u==="tag:yaml.org,2002:"||(!e||a.some(f=>f.startsWith(u)))&&i.push(`%TAG ${o} ${u}`);return i.join(`
`)}}Ot.defaultYaml={explicit:!1,version:"1.2"};Ot.defaultTags={"!!":"tag:yaml.org,2002:"};function lS(n){if(/[\x00-\x19\s,[\]{}]/.test(n)){const i=`Anchor must not contain whitespace or control characters: ${JSON.stringify(n)}`;throw new Error(i)}return!0}function oS(n){const e=new Set;return ys(n,{Value(i,r){r.anchor&&e.add(r.anchor)}}),e}function cS(n,e){for(let i=1;;++i){const r=`${n}${i}`;if(!e.has(r))return r}}function eC(n,e){const i=[],r=new Map;let a=null;return{onAnchor:o=>{i.push(o),a??(a=oS(n));const u=cS(e,a);return a.add(u),u},setAnchors:()=>{for(const o of i){const u=r.get(o);if(typeof u=="object"&&u.anchor&&(ze(u.node)||Ke(u.node)))u.node.anchor=u.anchor;else{const f=new Error("Failed to resolve repeated object (this should not happen)");throw f.source=o,f}}},sourceObjects:r}}function xr(n,e,i,r){if(r&&typeof r=="object")if(Array.isArray(r))for(let a=0,o=r.length;a<o;++a){const u=r[a],f=xr(n,r,String(a),u);f===void 0?delete r[a]:f!==u&&(r[a]=f)}else if(r instanceof Map)for(const a of Array.from(r.keys())){const o=r.get(a),u=xr(n,r,a,o);u===void 0?r.delete(a):u!==o&&r.set(a,u)}else if(r instanceof Set)for(const a of Array.from(r)){const o=xr(n,r,a,a);o===void 0?r.delete(a):o!==a&&(r.delete(a),r.add(o))}else for(const[a,o]of Object.entries(r)){const u=xr(n,r,a,o);u===void 0?delete r[a]:u!==o&&(r[a]=u)}return n.call(e,i,r)}function yn(n,e,i){if(Array.isArray(n))return n.map((r,a)=>yn(r,String(a),i));if(n&&typeof n.toJSON=="function"){if(!i||!nS(n))return n.toJSON(e,i);const r={aliasCount:0,count:1,res:void 0};i.anchors.set(n,r),i.onCreate=o=>{r.res=o,delete i.onCreate};const a=n.toJSON(e,i);return i.onCreate&&i.onCreate(a),a}return typeof n=="bigint"&&!(i!=null&&i.keep)?Number(n):n}class Hd{constructor(e){Object.defineProperty(this,bn,{value:e})}clone(){const e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:i,maxAliasCount:r,onAnchor:a,reviver:o}={}){if(!ms(e))throw new TypeError("A document argument is required");const u={anchors:new Map,doc:e,keep:!0,mapAsMap:i===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},f=yn(this,"",u);if(typeof a=="function")for(const{count:d,res:g}of u.anchors.values())a(g,d);return typeof o=="function"?xr(o,{"":f},"",f):f}}class Cc extends Hd{constructor(e){super(Ud),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,i){let r;i!=null&&i.aliasResolveCache?r=i.aliasResolveCache:(r=[],ys(e,{Node:(o,u)=>{(Hi(u)||nS(u))&&r.push(u)}}),i&&(i.aliasResolveCache=r));let a;for(const o of r){if(o===this)break;o.anchor===this.source&&(a=o)}return a}toJSON(e,i){if(!i)return{source:this.source};const{anchors:r,doc:a,maxAliasCount:o}=i,u=this.resolve(a,i);if(!u){const d=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(d)}let f=r.get(u);if(f||(yn(u,null,i),f=r.get(u)),(f==null?void 0:f.res)===void 0){const d="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(d)}if(o>=0&&(f.count+=1,f.aliasCount===0&&(f.aliasCount=ec(a,u,r)),f.count*f.aliasCount>o)){const d="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(d)}return f.res}toString(e,i,r){const a=`*${this.source}`;if(e){if(lS(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){const o=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(o)}if(e.implicitKey)return`${a} `}return a}}function ec(n,e,i){if(Hi(e)){const r=e.resolve(n),a=i&&r&&i.get(r);return a?a.count*a.aliasCount:0}else if(Ke(e)){let r=0;for(const a of e.items){const o=ec(n,a,i);o>r&&(r=o)}return r}else if(Ve(e)){const r=ec(n,e.key,i),a=ec(n,e.value,i);return Math.max(r,a)}return 1}const uS=n=>!n||typeof n!="function"&&typeof n!="object";class de extends Hd{constructor(e){super(jn),this.value=e}toJSON(e,i){return i!=null&&i.keep?this.value:yn(this.value,e,i)}toString(){return String(this.value)}}de.BLOCK_FOLDED="BLOCK_FOLDED";de.BLOCK_LITERAL="BLOCK_LITERAL";de.PLAIN="PLAIN";de.QUOTE_DOUBLE="QUOTE_DOUBLE";de.QUOTE_SINGLE="QUOTE_SINGLE";const tC="tag:yaml.org,2002:";function nC(n,e,i){if(e){const r=i.filter(o=>o.tag===e),a=r.find(o=>!o.format)??r[0];if(!a)throw new Error(`Tag ${e} not found`);return a}return i.find(r=>{var a;return((a=r.identify)==null?void 0:a.call(r,n))&&!r.format})}function ll(n,e,i){var y,S,w;if(ms(n)&&(n=n.contents),Xe(n))return n;if(Ve(n)){const E=(S=(y=i.schema[Di]).createNode)==null?void 0:S.call(y,i.schema,null,i);return E.items.push(n),E}(n instanceof String||n instanceof Number||n instanceof Boolean||typeof BigInt<"u"&&n instanceof BigInt)&&(n=n.valueOf());const{aliasDuplicateObjects:r,onAnchor:a,onTagObj:o,schema:u,sourceObjects:f}=i;let d;if(r&&n&&typeof n=="object"){if(d=f.get(n),d)return d.anchor??(d.anchor=a(n)),new Cc(d.anchor);d={anchor:null,node:null},f.set(n,d)}e!=null&&e.startsWith("!!")&&(e=tC+e.slice(2));let g=nC(n,e,u.tags);if(!g){if(n&&typeof n.toJSON=="function"&&(n=n.toJSON()),!n||typeof n!="object"){const E=new de(n);return d&&(d.node=E),E}g=n instanceof Map?u[Di]:Symbol.iterator in Object(n)?u[Rr]:u[Di]}o&&(o(g),delete i.onTagObj);const m=g!=null&&g.createNode?g.createNode(i.schema,n,i):typeof((w=g==null?void 0:g.nodeClass)==null?void 0:w.from)=="function"?g.nodeClass.from(i.schema,n,i):new de(n);return e?m.tag=e:g.default||(m.tag=g.tag),d&&(d.node=m),m}function dc(n,e,i){let r=i;for(let a=e.length-1;a>=0;--a){const o=e[a];if(typeof o=="number"&&Number.isInteger(o)&&o>=0){const u=[];u[o]=r,r=u}else r=new Map([[o,r]])}return ll(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:n,sourceObjects:new Map})}const Ya=n=>n==null||typeof n=="object"&&!!n[Symbol.iterator]().next().done;class fS extends Hd{constructor(e,i){super(e),Object.defineProperty(this,"schema",{value:i,configurable:!0,enumerable:!1,writable:!0})}clone(e){const i=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(i.schema=e),i.items=i.items.map(r=>Xe(r)||Ve(r)?r.clone(e):r),this.range&&(i.range=this.range.slice()),i}addIn(e,i){if(Ya(e))this.add(i);else{const[r,...a]=e,o=this.get(r,!0);if(Ke(o))o.addIn(a,i);else if(o===void 0&&this.schema)this.set(r,dc(this.schema,a,i));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${a}`)}}deleteIn(e){const[i,...r]=e;if(r.length===0)return this.delete(i);const a=this.get(i,!0);if(Ke(a))return a.deleteIn(r);throw new Error(`Expected YAML collection at ${i}. Remaining path: ${r}`)}getIn(e,i){const[r,...a]=e,o=this.get(r,!0);return a.length===0?!i&&ze(o)?o.value:o:Ke(o)?o.getIn(a,i):void 0}hasAllNullValues(e){return this.items.every(i=>{if(!Ve(i))return!1;const r=i.value;return r==null||e&&ze(r)&&r.value==null&&!r.commentBefore&&!r.comment&&!r.tag})}hasIn(e){const[i,...r]=e;if(r.length===0)return this.has(i);const a=this.get(i,!0);return Ke(a)?a.hasIn(r):!1}setIn(e,i){const[r,...a]=e;if(a.length===0)this.set(r,i);else{const o=this.get(r,!0);if(Ke(o))o.setIn(a,i);else if(o===void 0&&this.schema)this.set(r,dc(this.schema,a,i));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${a}`)}}}const iC=n=>n.replace(/^(?!$)(?: $)?/gm,"#");function si(n,e){return/^\n+$/.test(n)?n.substring(1):e?n.replace(/^(?! *$)/gm,e):n}const us=(n,e,i)=>n.endsWith(`
`)?si(i,e):i.includes(`
`)?`
`+si(i,e):(n.endsWith(" ")?"":" ")+i,hS="flow",Qh="block",tc="quoted";function Nc(n,e,i="flow",{indentAtStart:r,lineWidth:a=80,minContentWidth:o=20,onFold:u,onOverflow:f}={}){if(!a||a<0)return n;a<o&&(o=0);const d=Math.max(1+o,1+a-e.length);if(n.length<=d)return n;const g=[],m={};let y=a-e.length;typeof r=="number"&&(r>a-Math.max(2,o)?g.push(0):y=a-r);let S,w,E=!1,x=-1,_=-1,A=-1;i===Qh&&(x=Jb(n,x,e.length),x!==-1&&(y=x+d));for(let H;H=n[x+=1];){if(i===tc&&H==="\\"){switch(_=x,n[x+1]){case"x":x+=3;break;case"u":x+=5;break;case"U":x+=9;break;default:x+=1}A=x}if(H===`
`)i===Qh&&(x=Jb(n,x,e.length)),y=x+e.length+d,S=void 0;else{if(H===" "&&w&&w!==" "&&w!==`
`&&w!=="	"){const V=n[x+1];V&&V!==" "&&V!==`
`&&V!=="	"&&(S=x)}if(x>=y)if(S)g.push(S),y=S+d,S=void 0;else if(i===tc){for(;w===" "||w==="	";)w=H,H=n[x+=1],E=!0;const V=x>A+1?x-2:_-1;if(m[V])return n;g.push(V),m[V]=!0,y=V+d,S=void 0}else E=!0}w=H}if(E&&f&&f(),g.length===0)return n;u&&u();let C=n.slice(0,g[0]);for(let H=0;H<g.length;++H){const V=g[H],K=g[H+1]||n.length;V===0?C=`
${e}${n.slice(0,K)}`:(i===tc&&m[V]&&(C+=`${n[V]}\\`),C+=`
${e}${n.slice(V+1,K)}`)}return C}function Jb(n,e,i){let r=e,a=e+1,o=n[a];for(;o===" "||o==="	";)if(e<a+i)o=n[++e];else{do o=n[++e];while(o&&o!==`
`);r=e,a=e+1,o=n[a]}return r}const kc=(n,e)=>({indentAtStart:e?n.indent.length:n.indentAtStart,lineWidth:n.options.lineWidth,minContentWidth:n.options.minContentWidth}),Mc=n=>/^(%|---|\.\.\.)/m.test(n);function sC(n,e,i){if(!e||e<0)return!1;const r=e-i,a=n.length;if(a<=r)return!1;for(let o=0,u=0;o<a;++o)if(n[o]===`
`){if(o-u>r)return!0;if(u=o+1,a-u<=r)return!1}return!0}function nl(n,e){const i=JSON.stringify(n);if(e.options.doubleQuotedAsJSON)return i;const{implicitKey:r}=e,a=e.options.doubleQuotedMinMultiLineLength,o=e.indent||(Mc(n)?"  ":"");let u="",f=0;for(let d=0,g=i[d];g;g=i[++d])if(g===" "&&i[d+1]==="\\"&&i[d+2]==="n"&&(u+=i.slice(f,d)+"\\ ",d+=1,f=d,g="\\"),g==="\\")switch(i[d+1]){case"u":{u+=i.slice(f,d);const m=i.substr(d+2,4);switch(m){case"0000":u+="\\0";break;case"0007":u+="\\a";break;case"000b":u+="\\v";break;case"001b":u+="\\e";break;case"0085":u+="\\N";break;case"00a0":u+="\\_";break;case"2028":u+="\\L";break;case"2029":u+="\\P";break;default:m.substr(0,2)==="00"?u+="\\x"+m.substr(2):u+=i.substr(d,6)}d+=5,f=d+1}break;case"n":if(r||i[d+2]==='"'||i.length<a)d+=1;else{for(u+=i.slice(f,d)+`

`;i[d+2]==="\\"&&i[d+3]==="n"&&i[d+4]!=='"';)u+=`
`,d+=2;u+=o,i[d+2]===" "&&(u+="\\"),d+=1,f=d+1}break;default:d+=1}return u=f?u+i.slice(f):i,r?u:Nc(u,o,tc,kc(e,!1))}function Ph(n,e){if(e.options.singleQuote===!1||e.implicitKey&&n.includes(`
`)||/[ \t]\n|\n[ \t]/.test(n))return nl(n,e);const i=e.indent||(Mc(n)?"  ":""),r="'"+n.replace(/'/g,"''").replace(/\n+/g,`$&
${i}`)+"'";return e.implicitKey?r:Nc(r,i,hS,kc(e,!1))}function _r(n,e){const{singleQuote:i}=e.options;let r;if(i===!1)r=nl;else{const a=n.includes('"'),o=n.includes("'");a&&!o?r=Ph:o&&!a?r=nl:r=i?Ph:nl}return r(n,e)}let Jh;try{Jh=new RegExp(`(^|(?<!
))
+(?!
|$)`,"g")}catch{Jh=/\n+(?!\n|$)/g}function nc({comment:n,type:e,value:i},r,a,o){const{blockQuote:u,commentString:f,lineWidth:d}=r.options;if(!u||/\n[\t ]+$/.test(i))return _r(i,r);const g=r.indent||(r.forceBlockIndent||Mc(i)?"  ":""),m=u==="literal"?!0:u==="folded"||e===de.BLOCK_FOLDED?!1:e===de.BLOCK_LITERAL?!0:!sC(i,d,g.length);if(!i)return m?`|
`:`>
`;let y,S;for(S=i.length;S>0;--S){const K=i[S-1];if(K!==`
`&&K!=="	"&&K!==" ")break}let w=i.substring(S);const E=w.indexOf(`
`);E===-1?y="-":i===w||E!==w.length-1?(y="+",o&&o()):y="",w&&(i=i.slice(0,-w.length),w[w.length-1]===`
`&&(w=w.slice(0,-1)),w=w.replace(Jh,`$&${g}`));let x=!1,_,A=-1;for(_=0;_<i.length;++_){const K=i[_];if(K===" ")x=!0;else if(K===`
`)A=_;else break}let C=i.substring(0,A<_?A+1:_);C&&(i=i.substring(C.length),C=C.replace(/\n+/g,`$&${g}`));let V=(x?g?"2":"1":"")+y;if(n&&(V+=" "+f(n.replace(/ ?[\r\n]+/g," ")),a&&a()),!m){const K=i.replace(/\n+/g,`
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${g}`);let Q=!1;const j=kc(r,!0);u!=="folded"&&e!==de.BLOCK_FOLDED&&(j.onOverflow=()=>{Q=!0});const I=Nc(`${C}${K}${w}`,g,Qh,j);if(!Q)return`>${V}
${g}${I}`}return i=i.replace(/\n+/g,`$&${g}`),`|${V}
${g}${C}${i}${w}`}function rC(n,e,i,r){const{type:a,value:o}=n,{actualString:u,implicitKey:f,indent:d,indentStep:g,inFlow:m}=e;if(f&&o.includes(`
`)||m&&/[[\]{},]/.test(o))return _r(o,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(o))return f||m||!o.includes(`
`)?_r(o,e):nc(n,e,i,r);if(!f&&!m&&a!==de.PLAIN&&o.includes(`
`))return nc(n,e,i,r);if(Mc(o)){if(d==="")return e.forceBlockIndent=!0,nc(n,e,i,r);if(f&&d===g)return _r(o,e)}const y=o.replace(/\n+/g,`$&
${d}`);if(u){const S=x=>{var _;return x.default&&x.tag!=="tag:yaml.org,2002:str"&&((_=x.test)==null?void 0:_.test(y))},{compat:w,tags:E}=e.doc.schema;if(E.some(S)||w!=null&&w.some(S))return _r(o,e)}return f?y:Nc(y,d,hS,kc(e,!1))}function pl(n,e,i,r){const{implicitKey:a,inFlow:o}=e,u=typeof n.value=="string"?n:Object.assign({},n,{value:String(n.value)});let{type:f}=n;f!==de.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(u.value)&&(f=de.QUOTE_DOUBLE);const d=m=>{switch(m){case de.BLOCK_FOLDED:case de.BLOCK_LITERAL:return a||o?_r(u.value,e):nc(u,e,i,r);case de.QUOTE_DOUBLE:return nl(u.value,e);case de.QUOTE_SINGLE:return Ph(u.value,e);case de.PLAIN:return rC(u,e,i,r);default:return null}};let g=d(f);if(g===null){const{defaultKeyType:m,defaultStringType:y}=e.options,S=a&&m||y;if(g=d(S),g===null)throw new Error(`Unsupported default string type ${S}`)}return g}function dS(n,e){const i=Object.assign({blockQuote:!0,commentString:iC,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},n.schema.toStringOptions,e);let r;switch(i.collectionStyle){case"block":r=!1;break;case"flow":r=!0;break;default:r=null}return{anchors:new Set,doc:n,flowCollectionPadding:i.flowCollectionPadding?" ":"",indent:"",indentStep:typeof i.indent=="number"?" ".repeat(i.indent):"  ",inFlow:r,options:i}}function aC(n,e){var a;if(e.tag){const o=n.filter(u=>u.tag===e.tag);if(o.length>0)return o.find(u=>u.format===e.format)??o[0]}let i,r;if(ze(e)){r=e.value;let o=n.filter(u=>{var f;return(f=u.identify)==null?void 0:f.call(u,r)});if(o.length>1){const u=o.filter(f=>f.test);u.length>0&&(o=u)}i=o.find(u=>u.format===e.format)??o.find(u=>!u.format)}else r=e,i=n.find(o=>o.nodeClass&&r instanceof o.nodeClass);if(!i){const o=((a=r==null?void 0:r.constructor)==null?void 0:a.name)??(r===null?"null":typeof r);throw new Error(`Tag not resolved for ${o} value`)}return i}function lC(n,e,{anchors:i,doc:r}){if(!r.directives)return"";const a=[],o=(ze(n)||Ke(n))&&n.anchor;o&&lS(o)&&(i.add(o),a.push(`&${o}`));const u=n.tag??(e.default?null:e.tag);return u&&a.push(r.directives.tagString(u)),a.join(" ")}function Nr(n,e,i,r){var d;if(Ve(n))return n.toString(e,i,r);if(Hi(n)){if(e.doc.directives)return n.toString(e);if((d=e.resolvedAliases)!=null&&d.has(n))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(n):e.resolvedAliases=new Set([n]),n=n.resolve(e.doc)}let a;const o=Xe(n)?n:e.doc.createNode(n,{onTagObj:g=>a=g});a??(a=aC(e.doc.schema.tags,o));const u=lC(o,a,e);u.length>0&&(e.indentAtStart=(e.indentAtStart??0)+u.length+1);const f=typeof a.stringify=="function"?a.stringify(o,e,i,r):ze(o)?pl(o,e,i,r):o.toString(e,i,r);return u?ze(o)||f[0]==="{"||f[0]==="["?`${u} ${f}`:`${u}
${e.indent}${f}`:f}function oC({key:n,value:e},i,r,a){const{allNullValues:o,doc:u,indent:f,indentStep:d,options:{commentString:g,indentSeq:m,simpleKeys:y}}=i;let S=Xe(n)&&n.comment||null;if(y){if(S)throw new Error("With simple keys, key nodes cannot have comments");if(Ke(n)||!Xe(n)&&typeof n=="object"){const j="With simple keys, collection cannot be used as a key value";throw new Error(j)}}let w=!y&&(!n||S&&e==null&&!i.inFlow||Ke(n)||(ze(n)?n.type===de.BLOCK_FOLDED||n.type===de.BLOCK_LITERAL:typeof n=="object"));i=Object.assign({},i,{allNullValues:!1,implicitKey:!w&&(y||!o),indent:f+d});let E=!1,x=!1,_=Nr(n,i,()=>E=!0,()=>x=!0);if(!w&&!i.inFlow&&_.length>1024){if(y)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");w=!0}if(i.inFlow){if(o||e==null)return E&&r&&r(),_===""?"?":w?`? ${_}`:_}else if(o&&!y||e==null&&w)return _=`? ${_}`,S&&!E?_+=us(_,i.indent,g(S)):x&&a&&a(),_;E&&(S=null),w?(S&&(_+=us(_,i.indent,g(S))),_=`? ${_}
${f}:`):(_=`${_}:`,S&&(_+=us(_,i.indent,g(S))));let A,C,H;Xe(e)?(A=!!e.spaceBefore,C=e.commentBefore,H=e.comment):(A=!1,C=null,H=null,e&&typeof e=="object"&&(e=u.createNode(e))),i.implicitKey=!1,!w&&!S&&ze(e)&&(i.indentAtStart=_.length+1),x=!1,!m&&d.length>=2&&!i.inFlow&&!w&&zr(e)&&!e.flow&&!e.tag&&!e.anchor&&(i.indent=i.indent.substring(2));let V=!1;const K=Nr(e,i,()=>V=!0,()=>x=!0);let Q=" ";if(S||A||C){if(Q=A?`
`:"",C){const j=g(C);Q+=`
${si(j,i.indent)}`}K===""&&!i.inFlow?Q===`
`&&H&&(Q=`

`):Q+=`
${i.indent}`}else if(!w&&Ke(e)){const j=K[0],I=K.indexOf(`
`),O=I!==-1,P=i.inFlow??e.flow??e.items.length===0;if(O||!P){let J=!1;if(O&&(j==="&"||j==="!")){let $=K.indexOf(" ");j==="&"&&$!==-1&&$<I&&K[$+1]==="!"&&($=K.indexOf(" ",$+1)),($===-1||I<$)&&(J=!0)}J||(Q=`
${i.indent}`)}}else(K===""||K[0]===`
`)&&(Q="");return _+=Q+K,i.inFlow?V&&r&&r():H&&!V?_+=us(_,i.indent,g(H)):x&&a&&a(),_}function pS(n,e){(n==="debug"||n==="warn")&&console.warn(e)}const $o="<<",ri={identify:n=>n===$o||typeof n=="symbol"&&n.description===$o,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new de(Symbol($o)),{addToJSMap:gS}),stringify:()=>$o},cC=(n,e)=>(ri.identify(e)||ze(e)&&(!e.type||e.type===de.PLAIN)&&ri.identify(e.value))&&(n==null?void 0:n.doc.schema.tags.some(i=>i.tag===ri.tag&&i.default));function gS(n,e,i){if(i=n&&Hi(i)?i.resolve(n.doc):i,zr(i))for(const r of i.items)xh(n,e,r);else if(Array.isArray(i))for(const r of i)xh(n,e,r);else xh(n,e,i)}function xh(n,e,i){const r=n&&Hi(i)?i.resolve(n.doc):i;if(!Dr(r))throw new Error("Merge sources must be maps or map aliases");const a=r.toJSON(null,n,Map);for(const[o,u]of a)e instanceof Map?e.has(o)||e.set(o,u):e instanceof Set?e.add(o):Object.prototype.hasOwnProperty.call(e,o)||Object.defineProperty(e,o,{value:u,writable:!0,enumerable:!0,configurable:!0});return e}function mS(n,e,{key:i,value:r}){if(Xe(i)&&i.addToJSMap)i.addToJSMap(n,e,r);else if(cC(n,i))gS(n,e,r);else{const a=yn(i,"",n);if(e instanceof Map)e.set(a,yn(r,a,n));else if(e instanceof Set)e.add(a);else{const o=uC(i,a,n),u=yn(r,o,n);o in e?Object.defineProperty(e,o,{value:u,writable:!0,enumerable:!0,configurable:!0}):e[o]=u}}return e}function uC(n,e,i){if(e===null)return"";if(typeof e!="object")return String(e);if(Xe(n)&&(i!=null&&i.doc)){const r=dS(i.doc,{});r.anchors=new Set;for(const o of i.anchors.keys())r.anchors.add(o.anchor);r.inFlow=!0,r.inStringifyKey=!0;const a=n.toString(r);if(!i.mapKeyWarned){let o=JSON.stringify(a);o.length>40&&(o=o.substring(0,36)+'..."'),pS(i.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${o}. Set mapAsMap: true to use object keys.`),i.mapKeyWarned=!0}return a}return JSON.stringify(e)}function Bd(n,e,i){const r=ll(n,void 0,i),a=ll(e,void 0,i);return new Nt(r,a)}class Nt{constructor(e,i=null){Object.defineProperty(this,bn,{value:tS}),this.key=e,this.value=i}clone(e){let{key:i,value:r}=this;return Xe(i)&&(i=i.clone(e)),Xe(r)&&(r=r.clone(e)),new Nt(i,r)}toJSON(e,i){const r=i!=null&&i.mapAsMap?new Map:{};return mS(i,r,this)}toString(e,i,r){return e!=null&&e.doc?oC(this,e,i,r):JSON.stringify(this)}}function yS(n,e,i){return(e.inFlow??n.flow?hC:fC)(n,e,i)}function fC({comment:n,items:e},i,{blockItemPrefix:r,flowChars:a,itemIndent:o,onChompKeep:u,onComment:f}){const{indent:d,options:{commentString:g}}=i,m=Object.assign({},i,{indent:o,type:null});let y=!1;const S=[];for(let E=0;E<e.length;++E){const x=e[E];let _=null;if(Xe(x))!y&&x.spaceBefore&&S.push(""),pc(i,S,x.commentBefore,y),x.comment&&(_=x.comment);else if(Ve(x)){const C=Xe(x.key)?x.key:null;C&&(!y&&C.spaceBefore&&S.push(""),pc(i,S,C.commentBefore,y))}y=!1;let A=Nr(x,m,()=>_=null,()=>y=!0);_&&(A+=us(A,o,g(_))),y&&_&&(y=!1),S.push(r+A)}let w;if(S.length===0)w=a.start+a.end;else{w=S[0];for(let E=1;E<S.length;++E){const x=S[E];w+=x?`
${d}${x}`:`
`}}return n?(w+=`
`+si(g(n),d),f&&f()):y&&u&&u(),w}function hC({items:n},e,{flowChars:i,itemIndent:r}){const{indent:a,indentStep:o,flowCollectionPadding:u,options:{commentString:f}}=e;r+=o;const d=Object.assign({},e,{indent:r,inFlow:!0,type:null});let g=!1,m=0;const y=[];for(let E=0;E<n.length;++E){const x=n[E];let _=null;if(Xe(x))x.spaceBefore&&y.push(""),pc(e,y,x.commentBefore,!1),x.comment&&(_=x.comment);else if(Ve(x)){const C=Xe(x.key)?x.key:null;C&&(C.spaceBefore&&y.push(""),pc(e,y,C.commentBefore,!1),C.comment&&(g=!0));const H=Xe(x.value)?x.value:null;H?(H.comment&&(_=H.comment),H.commentBefore&&(g=!0)):x.value==null&&(C!=null&&C.comment)&&(_=C.comment)}_&&(g=!0);let A=Nr(x,d,()=>_=null);g||(g=y.length>m||A.includes(`
`)),E<n.length-1?A+=",":e.options.trailingComma&&(e.options.lineWidth>0&&(g||(g=y.reduce((C,H)=>C+H.length+2,2)+(A.length+2)>e.options.lineWidth)),g&&(A+=",")),_&&(A+=us(A,r,f(_))),y.push(A),m=y.length}const{start:S,end:w}=i;if(y.length===0)return S+w;if(!g){const E=y.reduce((x,_)=>x+_.length+2,2);g=e.options.lineWidth>0&&E>e.options.lineWidth}if(g){let E=S;for(const x of y)E+=x?`
${o}${a}${x}`:`
`;return`${E}
${a}${w}`}else return`${S}${u}${y.join(" ")}${u}${w}`}function pc({indent:n,options:{commentString:e}},i,r,a){if(r&&a&&(r=r.replace(/^\n+/,"")),r){const o=si(e(r),n);i.push(o.trimStart())}}function fs(n,e){const i=ze(e)?e.value:e;for(const r of n)if(Ve(r)&&(r.key===e||r.key===i||ze(r.key)&&r.key.value===i))return r}class nn extends fS{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(Di,e),this.items=[]}static from(e,i,r){const{keepUndefined:a,replacer:o}=r,u=new this(e),f=(d,g)=>{if(typeof o=="function")g=o.call(i,d,g);else if(Array.isArray(o)&&!o.includes(d))return;(g!==void 0||a)&&u.items.push(Bd(d,g,r))};if(i instanceof Map)for(const[d,g]of i)f(d,g);else if(i&&typeof i=="object")for(const d of Object.keys(i))f(d,i[d]);return typeof e.sortMapEntries=="function"&&u.items.sort(e.sortMapEntries),u}add(e,i){var u;let r;Ve(e)?r=e:!e||typeof e!="object"||!("key"in e)?r=new Nt(e,e==null?void 0:e.value):r=new Nt(e.key,e.value);const a=fs(this.items,r.key),o=(u=this.schema)==null?void 0:u.sortMapEntries;if(a){if(!i)throw new Error(`Key ${r.key} already set`);ze(a.value)&&uS(r.value)?a.value.value=r.value:a.value=r.value}else if(o){const f=this.items.findIndex(d=>o(r,d)<0);f===-1?this.items.push(r):this.items.splice(f,0,r)}else this.items.push(r)}delete(e){const i=fs(this.items,e);return i?this.items.splice(this.items.indexOf(i),1).length>0:!1}get(e,i){const r=fs(this.items,e),a=r==null?void 0:r.value;return(!i&&ze(a)?a.value:a)??void 0}has(e){return!!fs(this.items,e)}set(e,i){this.add(new Nt(e,i),!0)}toJSON(e,i,r){const a=r?new r:i!=null&&i.mapAsMap?new Map:{};i!=null&&i.onCreate&&i.onCreate(a);for(const o of this.items)mS(i,a,o);return a}toString(e,i,r){if(!e)return JSON.stringify(this);for(const a of this.items)if(!Ve(a))throw new Error(`Map items must all be pairs; found ${JSON.stringify(a)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),yS(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:r,onComment:i})}}const Ur={collection:"map",default:!0,nodeClass:nn,tag:"tag:yaml.org,2002:map",resolve(n,e){return Dr(n)||e("Expected a mapping for this tag"),n},createNode:(n,e,i)=>nn.from(n,e,i)};class zi extends fS{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(Rr,e),this.items=[]}add(e){this.items.push(e)}delete(e){const i=Io(e);return typeof i!="number"?!1:this.items.splice(i,1).length>0}get(e,i){const r=Io(e);if(typeof r!="number")return;const a=this.items[r];return!i&&ze(a)?a.value:a}has(e){const i=Io(e);return typeof i=="number"&&i<this.items.length}set(e,i){const r=Io(e);if(typeof r!="number")throw new Error(`Expected a valid index, not ${e}.`);const a=this.items[r];ze(a)&&uS(i)?a.value=i:this.items[r]=i}toJSON(e,i){const r=[];i!=null&&i.onCreate&&i.onCreate(r);let a=0;for(const o of this.items)r.push(yn(o,String(a++),i));return r}toString(e,i,r){return e?yS(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+"  ",onChompKeep:r,onComment:i}):JSON.stringify(this)}static from(e,i,r){const{replacer:a}=r,o=new this(e);if(i&&Symbol.iterator in Object(i)){let u=0;for(let f of i){if(typeof a=="function"){const d=i instanceof Set?f:String(u++);f=a.call(i,d,f)}o.items.push(ll(f,void 0,r))}}return o}}function Io(n){let e=ze(n)?n.value:n;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}const Hr={collection:"seq",default:!0,nodeClass:zi,tag:"tag:yaml.org,2002:seq",resolve(n,e){return zr(n)||e("Expected a sequence for this tag"),n},createNode:(n,e,i)=>zi.from(n,e,i)},Oc={identify:n=>typeof n=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:n=>n,stringify(n,e,i,r){return e=Object.assign({actualString:!0},e),pl(n,e,i,r)}},jc={identify:n=>n==null,createNode:()=>new de(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new de(null),stringify:({source:n},e)=>typeof n=="string"&&jc.test.test(n)?n:e.options.nullStr},qd={identify:n=>typeof n=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:n=>new de(n[0]==="t"||n[0]==="T"),stringify({source:n,value:e},i){if(n&&qd.test.test(n)){const r=n[0]==="t"||n[0]==="T";if(e===r)return n}return e?i.options.trueStr:i.options.falseStr}};function En({format:n,minFractionDigits:e,tag:i,value:r}){if(typeof r=="bigint")return String(r);const a=typeof r=="number"?r:Number(r);if(!isFinite(a))return isNaN(a)?".nan":a<0?"-.inf":".inf";let o=Object.is(r,-0)?"-0":JSON.stringify(r);if(!n&&e&&(!i||i==="tag:yaml.org,2002:float")&&/^\d/.test(o)){let u=o.indexOf(".");u<0&&(u=o.length,o+=".");let f=e-(o.length-u-1);for(;f-- >0;)o+="0"}return o}const bS={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:n=>n.slice(-3).toLowerCase()==="nan"?NaN:n[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:En},vS={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:n=>parseFloat(n),stringify(n){const e=Number(n.value);return isFinite(e)?e.toExponential():En(n)}},SS={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(n){const e=new de(parseFloat(n)),i=n.indexOf(".");return i!==-1&&n[n.length-1]==="0"&&(e.minFractionDigits=n.length-i-1),e},stringify:En},Lc=n=>typeof n=="bigint"||Number.isInteger(n),$d=(n,e,i,{intAsBigInt:r})=>r?BigInt(n):parseInt(n.substring(e),i);function wS(n,e,i){const{value:r}=n;return Lc(r)&&r>=0?i+r.toString(e):En(n)}const xS={identify:n=>Lc(n)&&n>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(n,e,i)=>$d(n,2,8,i),stringify:n=>wS(n,8,"0o")},_S={identify:Lc,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(n,e,i)=>$d(n,0,10,i),stringify:En},ES={identify:n=>Lc(n)&&n>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(n,e,i)=>$d(n,2,16,i),stringify:n=>wS(n,16,"0x")},dC=[Ur,Hr,Oc,jc,qd,xS,_S,ES,bS,vS,SS];function Zb(n){return typeof n=="bigint"||Number.isInteger(n)}const Vo=({value:n})=>JSON.stringify(n),pC=[{identify:n=>typeof n=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:n=>n,stringify:Vo},{identify:n=>n==null,createNode:()=>new de(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Vo},{identify:n=>typeof n=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:n=>n==="true",stringify:Vo},{identify:Zb,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(n,e,{intAsBigInt:i})=>i?BigInt(n):parseInt(n,10),stringify:({value:n})=>Zb(n)?n.toString():JSON.stringify(n)},{identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:n=>parseFloat(n),stringify:Vo}],gC={default:!0,tag:"",test:/^/,resolve(n,e){return e(`Unresolved plain scalar ${JSON.stringify(n)}`),n}},mC=[Ur,Hr].concat(pC,gC),Id={identify:n=>n instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(n,e){if(typeof atob=="function"){const i=atob(n.replace(/[\n\r]/g,"")),r=new Uint8Array(i.length);for(let a=0;a<i.length;++a)r[a]=i.charCodeAt(a);return r}else return e("This environment does not support reading binary tags; either Buffer or atob is required"),n},stringify({comment:n,type:e,value:i},r,a,o){if(!i)return"";const u=i;let f;if(typeof btoa=="function"){let d="";for(let g=0;g<u.length;++g)d+=String.fromCharCode(u[g]);f=btoa(d)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(e??(e=de.BLOCK_LITERAL),e!==de.QUOTE_DOUBLE){const d=Math.max(r.options.lineWidth-r.indent.length,r.options.minContentWidth),g=Math.ceil(f.length/d),m=new Array(g);for(let y=0,S=0;y<g;++y,S+=d)m[y]=f.substr(S,d);f=m.join(e===de.BLOCK_LITERAL?`
`:" ")}return pl({comment:n,type:e,value:f},r,a,o)}};function TS(n,e){if(zr(n))for(let i=0;i<n.items.length;++i){let r=n.items[i];if(!Ve(r)){if(Dr(r)){r.items.length>1&&e("Each pair must have its own sequence indicator");const a=r.items[0]||new Nt(new de(null));if(r.commentBefore&&(a.key.commentBefore=a.key.commentBefore?`${r.commentBefore}
${a.key.commentBefore}`:r.commentBefore),r.comment){const o=a.value??a.key;o.comment=o.comment?`${r.comment}
${o.comment}`:r.comment}r=a}n.items[i]=Ve(r)?r:new Nt(r)}}else e("Expected a sequence for this tag");return n}function AS(n,e,i){const{replacer:r}=i,a=new zi(n);a.tag="tag:yaml.org,2002:pairs";let o=0;if(e&&Symbol.iterator in Object(e))for(let u of e){typeof r=="function"&&(u=r.call(e,String(o++),u));let f,d;if(Array.isArray(u))if(u.length===2)f=u[0],d=u[1];else throw new TypeError(`Expected [key, value] tuple: ${u}`);else if(u&&u instanceof Object){const g=Object.keys(u);if(g.length===1)f=g[0],d=u[f];else throw new TypeError(`Expected tuple with one key, not ${g.length} keys`)}else f=u;a.items.push(Bd(f,d,i))}return a}const Vd={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:TS,createNode:AS};class Ar extends zi{constructor(){super(),this.add=nn.prototype.add.bind(this),this.delete=nn.prototype.delete.bind(this),this.get=nn.prototype.get.bind(this),this.has=nn.prototype.has.bind(this),this.set=nn.prototype.set.bind(this),this.tag=Ar.tag}toJSON(e,i){if(!i)return super.toJSON(e);const r=new Map;i!=null&&i.onCreate&&i.onCreate(r);for(const a of this.items){let o,u;if(Ve(a)?(o=yn(a.key,"",i),u=yn(a.value,o,i)):o=yn(a,"",i),r.has(o))throw new Error("Ordered maps must not include duplicate keys");r.set(o,u)}return r}static from(e,i,r){const a=AS(e,i,r),o=new this;return o.items=a.items,o}}Ar.tag="tag:yaml.org,2002:omap";const Gd={collection:"seq",identify:n=>n instanceof Map,nodeClass:Ar,default:!1,tag:"tag:yaml.org,2002:omap",resolve(n,e){const i=TS(n,e),r=[];for(const{key:a}of i.items)ze(a)&&(r.includes(a.value)?e(`Ordered maps must not include duplicate keys: ${a.value}`):r.push(a.value));return Object.assign(new Ar,i)},createNode:(n,e,i)=>Ar.from(n,e,i)};function CS({value:n,source:e},i){return e&&(n?NS:kS).test.test(e)?e:n?i.options.trueStr:i.options.falseStr}const NS={identify:n=>n===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new de(!0),stringify:CS},kS={identify:n=>n===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new de(!1),stringify:CS},yC={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:n=>n.slice(-3).toLowerCase()==="nan"?NaN:n[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:En},bC={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:n=>parseFloat(n.replace(/_/g,"")),stringify(n){const e=Number(n.value);return isFinite(e)?e.toExponential():En(n)}},vC={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(n){const e=new de(parseFloat(n.replace(/_/g,""))),i=n.indexOf(".");if(i!==-1){const r=n.substring(i+1).replace(/_/g,"");r[r.length-1]==="0"&&(e.minFractionDigits=r.length)}return e},stringify:En},gl=n=>typeof n=="bigint"||Number.isInteger(n);function Rc(n,e,i,{intAsBigInt:r}){const a=n[0];if((a==="-"||a==="+")&&(e+=1),n=n.substring(e).replace(/_/g,""),r){switch(i){case 2:n=`0b${n}`;break;case 8:n=`0o${n}`;break;case 16:n=`0x${n}`;break}const u=BigInt(n);return a==="-"?BigInt(-1)*u:u}const o=parseInt(n,i);return a==="-"?-1*o:o}function Kd(n,e,i){const{value:r}=n;if(gl(r)){const a=r.toString(e);return r<0?"-"+i+a.substr(1):i+a}return En(n)}const SC={identify:gl,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(n,e,i)=>Rc(n,2,2,i),stringify:n=>Kd(n,2,"0b")},wC={identify:gl,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(n,e,i)=>Rc(n,1,8,i),stringify:n=>Kd(n,8,"0")},xC={identify:gl,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(n,e,i)=>Rc(n,0,10,i),stringify:En},_C={identify:gl,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(n,e,i)=>Rc(n,2,16,i),stringify:n=>Kd(n,16,"0x")};class Cr extends nn{constructor(e){super(e),this.tag=Cr.tag}add(e){let i;Ve(e)?i=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?i=new Nt(e.key,null):i=new Nt(e,null),fs(this.items,i.key)||this.items.push(i)}get(e,i){const r=fs(this.items,e);return!i&&Ve(r)?ze(r.key)?r.key.value:r.key:r}set(e,i){if(typeof i!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof i}`);const r=fs(this.items,e);r&&!i?this.items.splice(this.items.indexOf(r),1):!r&&i&&this.items.push(new Nt(e))}toJSON(e,i){return super.toJSON(e,i,Set)}toString(e,i,r){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),i,r);throw new Error("Set items must all have null values")}static from(e,i,r){const{replacer:a}=r,o=new this(e);if(i&&Symbol.iterator in Object(i))for(let u of i)typeof a=="function"&&(u=a.call(i,u,u)),o.items.push(Bd(u,null,r));return o}}Cr.tag="tag:yaml.org,2002:set";const Xd={collection:"map",identify:n=>n instanceof Set,nodeClass:Cr,default:!1,tag:"tag:yaml.org,2002:set",createNode:(n,e,i)=>Cr.from(n,e,i),resolve(n,e){if(Dr(n)){if(n.hasAllNullValues(!0))return Object.assign(new Cr,n);e("Set items must all have null values")}else e("Expected a mapping for this tag");return n}};function Yd(n,e){const i=n[0],r=i==="-"||i==="+"?n.substring(1):n,a=u=>e?BigInt(u):Number(u),o=r.replace(/_/g,"").split(":").reduce((u,f)=>u*a(60)+a(f),a(0));return i==="-"?a(-1)*o:o}function MS(n){let{value:e}=n,i=u=>u;if(typeof e=="bigint")i=u=>BigInt(u);else if(isNaN(e)||!isFinite(e))return En(n);let r="";e<0&&(r="-",e*=i(-1));const a=i(60),o=[e%a];return e<60?o.unshift(0):(e=(e-o[0])/a,o.unshift(e%a),e>=60&&(e=(e-o[0])/a,o.unshift(e))),r+o.map(u=>String(u).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const OS={identify:n=>typeof n=="bigint"||Number.isInteger(n),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(n,e,{intAsBigInt:i})=>Yd(n,i),stringify:MS},jS={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:n=>Yd(n,!1),stringify:MS},Dc={identify:n=>n instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(n){const e=n.match(Dc.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,i,r,a,o,u,f]=e.map(Number),d=e[7]?Number((e[7]+"00").substr(1,3)):0;let g=Date.UTC(i,r-1,a,o||0,u||0,f||0,d);const m=e[8];if(m&&m!=="Z"){let y=Yd(m,!1);Math.abs(y)<30&&(y*=60),g-=6e4*y}return new Date(g)},stringify:({value:n})=>(n==null?void 0:n.toISOString().replace(/(T00:00:00)?\.000Z$/,""))??""},Wb=[Ur,Hr,Oc,jc,NS,kS,SC,wC,xC,_C,yC,bC,vC,Id,ri,Gd,Vd,Xd,OS,jS,Dc],e0=new Map([["core",dC],["failsafe",[Ur,Hr,Oc]],["json",mC],["yaml11",Wb],["yaml-1.1",Wb]]),t0={binary:Id,bool:qd,float:SS,floatExp:vS,floatNaN:bS,floatTime:jS,int:_S,intHex:ES,intOct:xS,intTime:OS,map:Ur,merge:ri,null:jc,omap:Gd,pairs:Vd,seq:Hr,set:Xd,timestamp:Dc},EC={"tag:yaml.org,2002:binary":Id,"tag:yaml.org,2002:merge":ri,"tag:yaml.org,2002:omap":Gd,"tag:yaml.org,2002:pairs":Vd,"tag:yaml.org,2002:set":Xd,"tag:yaml.org,2002:timestamp":Dc};function _h(n,e,i){const r=e0.get(e);if(r&&!n)return i&&!r.includes(ri)?r.concat(ri):r.slice();let a=r;if(!a)if(Array.isArray(n))a=[];else{const o=Array.from(e0.keys()).filter(u=>u!=="yaml11").map(u=>JSON.stringify(u)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${o} or define customTags array`)}if(Array.isArray(n))for(const o of n)a=a.concat(o);else typeof n=="function"&&(a=n(a.slice()));return i&&(a=a.concat(ri)),a.reduce((o,u)=>{const f=typeof u=="string"?t0[u]:u;if(!f){const d=JSON.stringify(u),g=Object.keys(t0).map(m=>JSON.stringify(m)).join(", ");throw new Error(`Unknown custom tag ${d}; use one of ${g}`)}return o.includes(f)||o.push(f),o},[])}const TC=(n,e)=>n.key<e.key?-1:n.key>e.key?1:0;class zc{constructor({compat:e,customTags:i,merge:r,resolveKnownTags:a,schema:o,sortMapEntries:u,toStringDefaults:f}){this.compat=Array.isArray(e)?_h(e,"compat"):e?_h(null,e):null,this.name=typeof o=="string"&&o||"core",this.knownTags=a?EC:{},this.tags=_h(i,this.name,r),this.toStringOptions=f??null,Object.defineProperty(this,Di,{value:Ur}),Object.defineProperty(this,jn,{value:Oc}),Object.defineProperty(this,Rr,{value:Hr}),this.sortMapEntries=typeof u=="function"?u:u===!0?TC:null}clone(){const e=Object.create(zc.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}}function AC(n,e){var d;const i=[];let r=e.directives===!0;if(e.directives!==!1&&n.directives){const g=n.directives.toString(n);g?(i.push(g),r=!0):n.directives.docStart&&(r=!0)}r&&i.push("---");const a=dS(n,e),{commentString:o}=a.options;if(n.commentBefore){i.length!==1&&i.unshift("");const g=o(n.commentBefore);i.unshift(si(g,""))}let u=!1,f=null;if(n.contents){if(Xe(n.contents)){if(n.contents.spaceBefore&&r&&i.push(""),n.contents.commentBefore){const y=o(n.contents.commentBefore);i.push(si(y,""))}a.forceBlockIndent=!!n.comment,f=n.contents.comment}const g=f?void 0:()=>u=!0;let m=Nr(n.contents,a,()=>f=null,g);f&&(m+=us(m,"",o(f))),(m[0]==="|"||m[0]===">")&&i[i.length-1]==="---"?i[i.length-1]=`--- ${m}`:i.push(m)}else i.push(Nr(n.contents,a));if((d=n.directives)!=null&&d.docEnd)if(n.comment){const g=o(n.comment);g.includes(`
`)?(i.push("..."),i.push(si(g,""))):i.push(`... ${g}`)}else i.push("...");else{let g=n.comment;g&&u&&(g=g.replace(/^\n+/,"")),g&&((!u||f)&&i[i.length-1]!==""&&i.push(""),i.push(si(o(g),"")))}return i.join(`
`)+`
`}class Br{constructor(e,i,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,bn,{value:Fh});let a=null;typeof i=="function"||Array.isArray(i)?a=i:r===void 0&&i&&(r=i,i=void 0);const o=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},r);this.options=o;let{version:u}=o;r!=null&&r._directives?(this.directives=r._directives.atDocument(),this.directives.yaml.explicit&&(u=this.directives.yaml.version)):this.directives=new Ot({version:u}),this.setSchema(u,r),this.contents=e===void 0?null:this.createNode(e,a,r)}clone(){const e=Object.create(Br.prototype,{[bn]:{value:Fh}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=Xe(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){hr(this.contents)&&this.contents.add(e)}addIn(e,i){hr(this.contents)&&this.contents.addIn(e,i)}createAlias(e,i){if(!e.anchor){const r=oS(this);e.anchor=!i||r.has(i)?cS(i||"a",r):i}return new Cc(e.anchor)}createNode(e,i,r){let a;if(typeof i=="function")e=i.call({"":e},"",e),a=i;else if(Array.isArray(i)){const _=C=>typeof C=="number"||C instanceof String||C instanceof Number,A=i.filter(_).map(String);A.length>0&&(i=i.concat(A)),a=i}else r===void 0&&i&&(r=i,i=void 0);const{aliasDuplicateObjects:o,anchorPrefix:u,flow:f,keepUndefined:d,onTagObj:g,tag:m}=r??{},{onAnchor:y,setAnchors:S,sourceObjects:w}=eC(this,u||"a"),E={aliasDuplicateObjects:o??!0,keepUndefined:d??!1,onAnchor:y,onTagObj:g,replacer:a,schema:this.schema,sourceObjects:w},x=ll(e,m,E);return f&&Ke(x)&&(x.flow=!0),S(),x}createPair(e,i,r={}){const a=this.createNode(e,null,r),o=this.createNode(i,null,r);return new Nt(a,o)}delete(e){return hr(this.contents)?this.contents.delete(e):!1}deleteIn(e){return Ya(e)?this.contents==null?!1:(this.contents=null,!0):hr(this.contents)?this.contents.deleteIn(e):!1}get(e,i){return Ke(this.contents)?this.contents.get(e,i):void 0}getIn(e,i){return Ya(e)?!i&&ze(this.contents)?this.contents.value:this.contents:Ke(this.contents)?this.contents.getIn(e,i):void 0}has(e){return Ke(this.contents)?this.contents.has(e):!1}hasIn(e){return Ya(e)?this.contents!==void 0:Ke(this.contents)?this.contents.hasIn(e):!1}set(e,i){this.contents==null?this.contents=dc(this.schema,[e],i):hr(this.contents)&&this.contents.set(e,i)}setIn(e,i){Ya(e)?this.contents=i:this.contents==null?this.contents=dc(this.schema,Array.from(e),i):hr(this.contents)&&this.contents.setIn(e,i)}setSchema(e,i={}){typeof e=="number"&&(e=String(e));let r;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new Ot({version:"1.1"}),r={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new Ot({version:e}),r={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,r=null;break;default:{const a=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${a}`)}}if(i.schema instanceof Object)this.schema=i.schema;else if(r)this.schema=new zc(Object.assign(r,i));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:i,mapAsMap:r,maxAliasCount:a,onAnchor:o,reviver:u}={}){const f={anchors:new Map,doc:this,keep:!e,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof a=="number"?a:100},d=yn(this.contents,i??"",f);if(typeof o=="function")for(const{count:g,res:m}of f.anchors.values())o(m,g);return typeof u=="function"?xr(u,{"":d},"",d):d}toJSON(e,i){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:i})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){const i=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${i}`)}return AC(this,e)}}function hr(n){if(Ke(n))return!0;throw new Error("Expected a YAML collection as document contents")}class Fd extends Error{constructor(e,i,r,a){super(),this.name=e,this.code=r,this.message=a,this.pos=i}}class hs extends Fd{constructor(e,i,r){super("YAMLParseError",e,i,r)}}class LS extends Fd{constructor(e,i,r){super("YAMLWarning",e,i,r)}}const gc=(n,e)=>i=>{if(i.pos[0]===-1)return;i.linePos=i.pos.map(f=>e.linePos(f));const{line:r,col:a}=i.linePos[0];i.message+=` at line ${r}, column ${a}`;let o=a-1,u=n.substring(e.lineStarts[r-1],e.lineStarts[r]).replace(/[\n\r]+$/,"");if(o>=60&&u.length>80){const f=Math.min(o-39,u.length-79);u="â€¦"+u.substring(f),o-=f-1}if(u.length>80&&(u=u.substring(0,79)+"â€¦"),r>1&&/^ *$/.test(u.substring(0,o))){let f=n.substring(e.lineStarts[r-2],e.lineStarts[r-1]);f.length>80&&(f=f.substring(0,79)+`â€¦
`),u=f+u}if(/[^ ]/.test(u)){let f=1;const d=i.linePos[1];(d==null?void 0:d.line)===r&&d.col>a&&(f=Math.max(1,Math.min(d.col-a,80-o)));const g=" ".repeat(o)+"^".repeat(f);i.message+=`:

${u}
${g}
`}};function kr(n,{flow:e,indicator:i,next:r,offset:a,onError:o,parentIndent:u,startOnNewline:f}){let d=!1,g=f,m=f,y="",S="",w=!1,E=!1,x=null,_=null,A=null,C=null,H=null,V=null,K=null;for(const I of n)switch(E&&(I.type!=="space"&&I.type!=="newline"&&I.type!=="comma"&&o(I.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),E=!1),x&&(g&&I.type!=="comment"&&I.type!=="newline"&&o(x,"TAB_AS_INDENT","Tabs are not allowed as indentation"),x=null),I.type){case"space":!e&&(i!=="doc-start"||(r==null?void 0:r.type)!=="flow-collection")&&I.source.includes("	")&&(x=I),m=!0;break;case"comment":{m||o(I,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const O=I.source.substring(1)||" ";y?y+=S+O:y=O,S="",g=!1;break}case"newline":g?y?y+=I.source:(!V||i!=="seq-item-ind")&&(d=!0):S+=I.source,g=!0,w=!0,(_||A)&&(C=I),m=!0;break;case"anchor":_&&o(I,"MULTIPLE_ANCHORS","A node can have at most one anchor"),I.source.endsWith(":")&&o(I.offset+I.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),_=I,K??(K=I.offset),g=!1,m=!1,E=!0;break;case"tag":{A&&o(I,"MULTIPLE_TAGS","A node can have at most one tag"),A=I,K??(K=I.offset),g=!1,m=!1,E=!0;break}case i:(_||A)&&o(I,"BAD_PROP_ORDER",`Anchors and tags must be after the ${I.source} indicator`),V&&o(I,"UNEXPECTED_TOKEN",`Unexpected ${I.source} in ${e??"collection"}`),V=I,g=i==="seq-item-ind"||i==="explicit-key-ind",m=!1;break;case"comma":if(e){H&&o(I,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),H=I,g=!1,m=!1;break}default:o(I,"UNEXPECTED_TOKEN",`Unexpected ${I.type} token`),g=!1,m=!1}const Q=n[n.length-1],j=Q?Q.offset+Q.source.length:a;return E&&r&&r.type!=="space"&&r.type!=="newline"&&r.type!=="comma"&&(r.type!=="scalar"||r.source!=="")&&o(r.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),x&&(g&&x.indent<=u||(r==null?void 0:r.type)==="block-map"||(r==null?void 0:r.type)==="block-seq")&&o(x,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:H,found:V,spaceBefore:d,comment:y,hasNewline:w,anchor:_,tag:A,newlineAfterProp:C,end:j,start:K??j}}function ol(n){if(!n)return null;switch(n.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(n.source.includes(`
`))return!0;if(n.end){for(const e of n.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(const e of n.items){for(const i of e.start)if(i.type==="newline")return!0;if(e.sep){for(const i of e.sep)if(i.type==="newline")return!0}if(ol(e.key)||ol(e.value))return!0}return!1;default:return!0}}function Zh(n,e,i){if((e==null?void 0:e.type)==="flow-collection"){const r=e.end[0];r.indent===n&&(r.source==="]"||r.source==="}")&&ol(e)&&i(r,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function RS(n,e,i){const{uniqueKeys:r}=n.options;if(r===!1)return!1;const a=typeof r=="function"?r:(o,u)=>o===u||ze(o)&&ze(u)&&o.value===u.value;return e.some(o=>a(o.key,i))}const n0="All mapping items must start at the same column";function CC({composeNode:n,composeEmptyNode:e},i,r,a,o){var m;const u=(o==null?void 0:o.nodeClass)??nn,f=new u(i.schema);i.atRoot&&(i.atRoot=!1);let d=r.offset,g=null;for(const y of r.items){const{start:S,key:w,sep:E,value:x}=y,_=kr(S,{indicator:"explicit-key-ind",next:w??(E==null?void 0:E[0]),offset:d,onError:a,parentIndent:r.indent,startOnNewline:!0}),A=!_.found;if(A){if(w&&(w.type==="block-seq"?a(d,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in w&&w.indent!==r.indent&&a(d,"BAD_INDENT",n0)),!_.anchor&&!_.tag&&!E){g=_.end,_.comment&&(f.comment?f.comment+=`
`+_.comment:f.comment=_.comment);continue}(_.newlineAfterProp||ol(w))&&a(w??S[S.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else((m=_.found)==null?void 0:m.indent)!==r.indent&&a(d,"BAD_INDENT",n0);i.atKey=!0;const C=_.end,H=w?n(i,w,_,a):e(i,C,S,null,_,a);i.schema.compat&&Zh(r.indent,w,a),i.atKey=!1,RS(i,f.items,H)&&a(C,"DUPLICATE_KEY","Map keys must be unique");const V=kr(E??[],{indicator:"map-value-ind",next:x,offset:H.range[2],onError:a,parentIndent:r.indent,startOnNewline:!w||w.type==="block-scalar"});if(d=V.end,V.found){A&&((x==null?void 0:x.type)==="block-map"&&!V.hasNewline&&a(d,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),i.options.strict&&_.start<V.found.offset-1024&&a(H.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const K=x?n(i,x,V,a):e(i,d,E,null,V,a);i.schema.compat&&Zh(r.indent,x,a),d=K.range[2];const Q=new Nt(H,K);i.options.keepSourceTokens&&(Q.srcToken=y),f.items.push(Q)}else{A&&a(H.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),V.comment&&(H.comment?H.comment+=`
`+V.comment:H.comment=V.comment);const K=new Nt(H);i.options.keepSourceTokens&&(K.srcToken=y),f.items.push(K)}}return g&&g<d&&a(g,"IMPOSSIBLE","Map comment with trailing content"),f.range=[r.offset,d,g??d],f}function NC({composeNode:n,composeEmptyNode:e},i,r,a,o){const u=(o==null?void 0:o.nodeClass)??zi,f=new u(i.schema);i.atRoot&&(i.atRoot=!1),i.atKey&&(i.atKey=!1);let d=r.offset,g=null;for(const{start:m,value:y}of r.items){const S=kr(m,{indicator:"seq-item-ind",next:y,offset:d,onError:a,parentIndent:r.indent,startOnNewline:!0});if(!S.found)if(S.anchor||S.tag||y)(y==null?void 0:y.type)==="block-seq"?a(S.end,"BAD_INDENT","All sequence items must start at the same column"):a(d,"MISSING_CHAR","Sequence item without - indicator");else{g=S.end,S.comment&&(f.comment=S.comment);continue}const w=y?n(i,y,S,a):e(i,S.end,m,null,S,a);i.schema.compat&&Zh(r.indent,y,a),d=w.range[2],f.items.push(w)}return f.range=[r.offset,d,g??d],f}function ml(n,e,i,r){let a="";if(n){let o=!1,u="";for(const f of n){const{source:d,type:g}=f;switch(g){case"space":o=!0;break;case"comment":{i&&!o&&r(f,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const m=d.substring(1)||" ";a?a+=u+m:a=m,u="";break}case"newline":a&&(u+=d),o=!0;break;default:r(f,"UNEXPECTED_TOKEN",`Unexpected ${g} at node end`)}e+=d.length}}return{comment:a,offset:e}}const Eh="Block collections are not allowed within flow collections",Th=n=>n&&(n.type==="block-map"||n.type==="block-seq");function kC({composeNode:n,composeEmptyNode:e},i,r,a,o){var _;const u=r.start.source==="{",f=u?"flow map":"flow sequence",d=(o==null?void 0:o.nodeClass)??(u?nn:zi),g=new d(i.schema);g.flow=!0;const m=i.atRoot;m&&(i.atRoot=!1),i.atKey&&(i.atKey=!1);let y=r.offset+r.start.source.length;for(let A=0;A<r.items.length;++A){const C=r.items[A],{start:H,key:V,sep:K,value:Q}=C,j=kr(H,{flow:f,indicator:"explicit-key-ind",next:V??(K==null?void 0:K[0]),offset:y,onError:a,parentIndent:r.indent,startOnNewline:!1});if(!j.found){if(!j.anchor&&!j.tag&&!K&&!Q){A===0&&j.comma?a(j.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${f}`):A<r.items.length-1&&a(j.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${f}`),j.comment&&(g.comment?g.comment+=`
`+j.comment:g.comment=j.comment),y=j.end;continue}!u&&i.options.strict&&ol(V)&&a(V,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(A===0)j.comma&&a(j.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${f}`);else if(j.comma||a(j.start,"MISSING_CHAR",`Missing , between ${f} items`),j.comment){let I="";e:for(const O of H)switch(O.type){case"comma":case"space":break;case"comment":I=O.source.substring(1);break e;default:break e}if(I){let O=g.items[g.items.length-1];Ve(O)&&(O=O.value??O.key),O.comment?O.comment+=`
`+I:O.comment=I,j.comment=j.comment.substring(I.length+1)}}if(!u&&!K&&!j.found){const I=Q?n(i,Q,j,a):e(i,j.end,K,null,j,a);g.items.push(I),y=I.range[2],Th(Q)&&a(I.range,"BLOCK_IN_FLOW",Eh)}else{i.atKey=!0;const I=j.end,O=V?n(i,V,j,a):e(i,I,H,null,j,a);Th(V)&&a(O.range,"BLOCK_IN_FLOW",Eh),i.atKey=!1;const P=kr(K??[],{flow:f,indicator:"map-value-ind",next:Q,offset:O.range[2],onError:a,parentIndent:r.indent,startOnNewline:!1});if(P.found){if(!u&&!j.found&&i.options.strict){if(K)for(const ee of K){if(ee===P.found)break;if(ee.type==="newline"){a(ee,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}j.start<P.found.offset-1024&&a(P.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else Q&&("source"in Q&&((_=Q.source)==null?void 0:_[0])===":"?a(Q,"MISSING_CHAR",`Missing space after : in ${f}`):a(P.start,"MISSING_CHAR",`Missing , or : between ${f} items`));const J=Q?n(i,Q,P,a):P.found?e(i,P.end,K,null,P,a):null;J?Th(Q)&&a(J.range,"BLOCK_IN_FLOW",Eh):P.comment&&(O.comment?O.comment+=`
`+P.comment:O.comment=P.comment);const $=new Nt(O,J);if(i.options.keepSourceTokens&&($.srcToken=C),u){const ee=g;RS(i,ee.items,O)&&a(I,"DUPLICATE_KEY","Map keys must be unique"),ee.items.push($)}else{const ee=new nn(i.schema);ee.flow=!0,ee.items.push($);const ce=(J??O).range;ee.range=[O.range[0],ce[1],ce[2]],g.items.push(ee)}y=J?J.range[2]:P.end}}const S=u?"}":"]",[w,...E]=r.end;let x=y;if((w==null?void 0:w.source)===S)x=w.offset+w.source.length;else{const A=f[0].toUpperCase()+f.substring(1),C=m?`${A} must end with a ${S}`:`${A} in block collection must be sufficiently indented and end with a ${S}`;a(y,m?"MISSING_CHAR":"BAD_INDENT",C),w&&w.source.length!==1&&E.unshift(w)}if(E.length>0){const A=ml(E,x,i.options.strict,a);A.comment&&(g.comment?g.comment+=`
`+A.comment:g.comment=A.comment),g.range=[r.offset,x,A.offset]}else g.range=[r.offset,x,x];return g}function Ah(n,e,i,r,a,o){const u=i.type==="block-map"?CC(n,e,i,r,o):i.type==="block-seq"?NC(n,e,i,r,o):kC(n,e,i,r,o),f=u.constructor;return a==="!"||a===f.tagName?(u.tag=f.tagName,u):(a&&(u.tag=a),u)}function MC(n,e,i,r,a){var S;const o=r.tag,u=o?e.directives.tagName(o.source,w=>a(o,"TAG_RESOLVE_FAILED",w)):null;if(i.type==="block-seq"){const{anchor:w,newlineAfterProp:E}=r,x=w&&o?w.offset>o.offset?w:o:w??o;x&&(!E||E.offset<x.offset)&&a(x,"MISSING_CHAR","Missing newline after block sequence props")}const f=i.type==="block-map"?"map":i.type==="block-seq"?"seq":i.start.source==="{"?"map":"seq";if(!o||!u||u==="!"||u===nn.tagName&&f==="map"||u===zi.tagName&&f==="seq")return Ah(n,e,i,a,u);let d=e.schema.tags.find(w=>w.tag===u&&w.collection===f);if(!d){const w=e.schema.knownTags[u];if((w==null?void 0:w.collection)===f)e.schema.tags.push(Object.assign({},w,{default:!1})),d=w;else return w?a(o,"BAD_COLLECTION_TYPE",`${w.tag} used for ${f} collection, but expects ${w.collection??"scalar"}`,!0):a(o,"TAG_RESOLVE_FAILED",`Unresolved tag: ${u}`,!0),Ah(n,e,i,a,u)}const g=Ah(n,e,i,a,u,d),m=((S=d.resolve)==null?void 0:S.call(d,g,w=>a(o,"TAG_RESOLVE_FAILED",w),e.options))??g,y=Xe(m)?m:new de(m);return y.range=g.range,y.tag=u,d!=null&&d.format&&(y.format=d.format),y}function DS(n,e,i){const r=e.offset,a=OC(e,n.options.strict,i);if(!a)return{value:"",type:null,comment:"",range:[r,r,r]};const o=a.mode===">"?de.BLOCK_FOLDED:de.BLOCK_LITERAL,u=e.source?jC(e.source):[];let f=u.length;for(let x=u.length-1;x>=0;--x){const _=u[x][1];if(_===""||_==="\r")f=x;else break}if(f===0){const x=a.chomp==="+"&&u.length>0?`
`.repeat(Math.max(1,u.length-1)):"";let _=r+a.length;return e.source&&(_+=e.source.length),{value:x,type:o,comment:a.comment,range:[r,_,_]}}let d=e.indent+a.indent,g=e.offset+a.length,m=0;for(let x=0;x<f;++x){const[_,A]=u[x];if(A===""||A==="\r")a.indent===0&&_.length>d&&(d=_.length);else{_.length<d&&i(g+_.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),a.indent===0&&(d=_.length),m=x,d===0&&!n.atRoot&&i(g,"BAD_INDENT","Block scalar values in collections must be indented");break}g+=_.length+A.length+1}for(let x=u.length-1;x>=f;--x)u[x][0].length>d&&(f=x+1);let y="",S="",w=!1;for(let x=0;x<m;++x)y+=u[x][0].slice(d)+`
`;for(let x=m;x<f;++x){let[_,A]=u[x];g+=_.length+A.length+1;const C=A[A.length-1]==="\r";if(C&&(A=A.slice(0,-1)),A&&_.length<d){const V=`Block scalar lines must not be less indented than their ${a.indent?"explicit indentation indicator":"first line"}`;i(g-A.length-(C?2:1),"BAD_INDENT",V),_=""}o===de.BLOCK_LITERAL?(y+=S+_.slice(d)+A,S=`
`):_.length>d||A[0]==="	"?(S===" "?S=`
`:!w&&S===`
`&&(S=`

`),y+=S+_.slice(d)+A,S=`
`,w=!0):A===""?S===`
`?y+=`
`:S=`
`:(y+=S+A,S=" ",w=!1)}switch(a.chomp){case"-":break;case"+":for(let x=f;x<u.length;++x)y+=`
`+u[x][0].slice(d);y[y.length-1]!==`
`&&(y+=`
`);break;default:y+=`
`}const E=r+a.length+e.source.length;return{value:y,type:o,comment:a.comment,range:[r,E,E]}}function OC({offset:n,props:e},i,r){if(e[0].type!=="block-scalar-header")return r(e[0],"IMPOSSIBLE","Block scalar header not found"),null;const{source:a}=e[0],o=a[0];let u=0,f="",d=-1;for(let S=1;S<a.length;++S){const w=a[S];if(!f&&(w==="-"||w==="+"))f=w;else{const E=Number(w);!u&&E?u=E:d===-1&&(d=n+S)}}d!==-1&&r(d,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${a}`);let g=!1,m="",y=a.length;for(let S=1;S<e.length;++S){const w=e[S];switch(w.type){case"space":g=!0;case"newline":y+=w.source.length;break;case"comment":i&&!g&&r(w,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),y+=w.source.length,m=w.source.substring(1);break;case"error":r(w,"UNEXPECTED_TOKEN",w.message),y+=w.source.length;break;default:{const E=`Unexpected token in block scalar header: ${w.type}`;r(w,"UNEXPECTED_TOKEN",E);const x=w.source;x&&typeof x=="string"&&(y+=x.length)}}}return{mode:o,indent:u,chomp:f,comment:m,length:y}}function jC(n){const e=n.split(/\n( *)/),i=e[0],r=i.match(/^( *)/),o=[r!=null&&r[1]?[r[1],i.slice(r[1].length)]:["",i]];for(let u=1;u<e.length;u+=2)o.push([e[u],e[u+1]]);return o}function zS(n,e,i){const{offset:r,type:a,source:o,end:u}=n;let f,d;const g=(S,w,E)=>i(r+S,w,E);switch(a){case"scalar":f=de.PLAIN,d=LC(o,g);break;case"single-quoted-scalar":f=de.QUOTE_SINGLE,d=RC(o,g);break;case"double-quoted-scalar":f=de.QUOTE_DOUBLE,d=DC(o,g);break;default:return i(n,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${a}`),{value:"",type:null,comment:"",range:[r,r+o.length,r+o.length]}}const m=r+o.length,y=ml(u,m,e,i);return{value:d,type:f,comment:y.comment,range:[r,m,y.offset]}}function LC(n,e){let i="";switch(n[0]){case"	":i="a tab character";break;case",":i="flow indicator character ,";break;case"%":i="directive indicator character %";break;case"|":case">":{i=`block scalar indicator ${n[0]}`;break}case"@":case"`":{i=`reserved character ${n[0]}`;break}}return i&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${i}`),US(n)}function RC(n,e){return(n[n.length-1]!=="'"||n.length===1)&&e(n.length,"MISSING_CHAR","Missing closing 'quote"),US(n.slice(1,-1)).replace(/''/g,"'")}function US(n){let e,i;try{e=new RegExp(`(.*?)(?<![ 	])[ 	]*\r?
`,"sy"),i=new RegExp(`[ 	]*(.*?)(?:(?<![ 	])[ 	]*)?\r?
`,"sy")}catch{e=/(.*?)[ \t]*\r?\n/sy,i=/[ \t]*(.*?)[ \t]*\r?\n/sy}let r=e.exec(n);if(!r)return n;let a=r[1],o=" ",u=e.lastIndex;for(i.lastIndex=u;r=i.exec(n);)r[1]===""?o===`
`?a+=o:o=`
`:(a+=o+r[1],o=" "),u=i.lastIndex;const f=/[ \t]*(.*)/sy;return f.lastIndex=u,r=f.exec(n),a+o+((r==null?void 0:r[1])??"")}function DC(n,e){let i="";for(let r=1;r<n.length-1;++r){const a=n[r];if(!(a==="\r"&&n[r+1]===`
`))if(a===`
`){const{fold:o,offset:u}=zC(n,r);i+=o,r=u}else if(a==="\\"){let o=n[++r];const u=UC[o];if(u)i+=u;else if(o===`
`)for(o=n[r+1];o===" "||o==="	";)o=n[++r+1];else if(o==="\r"&&n[r+1]===`
`)for(o=n[++r+1];o===" "||o==="	";)o=n[++r+1];else if(o==="x"||o==="u"||o==="U"){const f={x:2,u:4,U:8}[o];i+=HC(n,r+1,f,e),r+=f}else{const f=n.substr(r-1,2);e(r-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${f}`),i+=f}}else if(a===" "||a==="	"){const o=r;let u=n[r+1];for(;u===" "||u==="	";)u=n[++r+1];u!==`
`&&!(u==="\r"&&n[r+2]===`
`)&&(i+=r>o?n.slice(o,r+1):a)}else i+=a}return(n[n.length-1]!=='"'||n.length===1)&&e(n.length,"MISSING_CHAR",'Missing closing "quote'),i}function zC(n,e){let i="",r=n[e+1];for(;(r===" "||r==="	"||r===`
`||r==="\r")&&!(r==="\r"&&n[e+2]!==`
`);)r===`
`&&(i+=`
`),e+=1,r=n[e+1];return i||(i=" "),{fold:i,offset:e}}const UC={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
`,r:"\r",t:"	",v:"\v",N:"Â…",_:"Â ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\","	":"	"};function HC(n,e,i,r){const a=n.substr(e,i),u=a.length===i&&/^[0-9a-fA-F]+$/.test(a)?parseInt(a,16):NaN;if(isNaN(u)){const f=n.substr(e-2,i+2);return r(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${f}`),f}return String.fromCodePoint(u)}function HS(n,e,i,r){const{value:a,type:o,comment:u,range:f}=e.type==="block-scalar"?DS(n,e,r):zS(e,n.options.strict,r),d=i?n.directives.tagName(i.source,y=>r(i,"TAG_RESOLVE_FAILED",y)):null;let g;n.options.stringKeys&&n.atKey?g=n.schema[jn]:d?g=BC(n.schema,a,d,i,r):e.type==="scalar"?g=qC(n,a,e,r):g=n.schema[jn];let m;try{const y=g.resolve(a,S=>r(i??e,"TAG_RESOLVE_FAILED",S),n.options);m=ze(y)?y:new de(y)}catch(y){const S=y instanceof Error?y.message:String(y);r(i??e,"TAG_RESOLVE_FAILED",S),m=new de(a)}return m.range=f,m.source=a,o&&(m.type=o),d&&(m.tag=d),g.format&&(m.format=g.format),u&&(m.comment=u),m}function BC(n,e,i,r,a){var f;if(i==="!")return n[jn];const o=[];for(const d of n.tags)if(!d.collection&&d.tag===i)if(d.default&&d.test)o.push(d);else return d;for(const d of o)if((f=d.test)!=null&&f.test(e))return d;const u=n.knownTags[i];return u&&!u.collection?(n.tags.push(Object.assign({},u,{default:!1,test:void 0})),u):(a(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${i}`,i!=="tag:yaml.org,2002:str"),n[jn])}function qC({atKey:n,directives:e,schema:i},r,a,o){const u=i.tags.find(f=>{var d;return(f.default===!0||n&&f.default==="key")&&((d=f.test)==null?void 0:d.test(r))})||i[jn];if(i.compat){const f=i.compat.find(d=>{var g;return d.default&&((g=d.test)==null?void 0:g.test(r))})??i[jn];if(u.tag!==f.tag){const d=e.tagString(u.tag),g=e.tagString(f.tag),m=`Value may be parsed as either ${d} or ${g}`;o(a,"TAG_RESOLVE_FAILED",m,!0)}}return u}function $C(n,e,i){if(e){i??(i=e.length);for(let r=i-1;r>=0;--r){let a=e[r];switch(a.type){case"space":case"comment":case"newline":n-=a.source.length;continue}for(a=e[++r];(a==null?void 0:a.type)==="space";)n+=a.source.length,a=e[++r];break}}return n}const IC={composeNode:BS,composeEmptyNode:Qd};function BS(n,e,i,r){const a=n.atKey,{spaceBefore:o,comment:u,anchor:f,tag:d}=i;let g,m=!0;switch(e.type){case"alias":g=VC(n,e,r),(f||d)&&r(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":g=HS(n,e,d,r),f&&(g.anchor=f.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{g=MC(IC,n,e,i,r),f&&(g.anchor=f.source.substring(1))}catch(y){const S=y instanceof Error?y.message:String(y);r(e,"RESOURCE_EXHAUSTION",S)}break;default:{const y=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;r(e,"UNEXPECTED_TOKEN",y),m=!1}}return g??(g=Qd(n,e.offset,void 0,null,i,r)),f&&g.anchor===""&&r(f,"BAD_ALIAS","Anchor cannot be an empty string"),a&&n.options.stringKeys&&(!ze(g)||typeof g.value!="string"||g.tag&&g.tag!=="tag:yaml.org,2002:str")&&r(d??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),o&&(g.spaceBefore=!0),u&&(e.type==="scalar"&&e.source===""?g.comment=u:g.commentBefore=u),n.options.keepSourceTokens&&m&&(g.srcToken=e),g}function Qd(n,e,i,r,{spaceBefore:a,comment:o,anchor:u,tag:f,end:d},g){const m={type:"scalar",offset:$C(e,i,r),indent:-1,source:""},y=HS(n,m,f,g);return u&&(y.anchor=u.source.substring(1),y.anchor===""&&g(u,"BAD_ALIAS","Anchor cannot be an empty string")),a&&(y.spaceBefore=!0),o&&(y.comment=o,y.range[2]=d),y}function VC({options:n},{offset:e,source:i,end:r},a){const o=new Cc(i.substring(1));o.source===""&&a(e,"BAD_ALIAS","Alias cannot be an empty string"),o.source.endsWith(":")&&a(e+i.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const u=e+i.length,f=ml(r,u,n.strict,a);return o.range=[e,u,f.offset],f.comment&&(o.comment=f.comment),o}function GC(n,e,{offset:i,start:r,value:a,end:o},u){const f=Object.assign({_directives:e},n),d=new Br(void 0,f),g={atKey:!1,atRoot:!0,directives:d.directives,options:d.options,schema:d.schema},m=kr(r,{indicator:"doc-start",next:a??(o==null?void 0:o[0]),offset:i,onError:u,parentIndent:0,startOnNewline:!0});m.found&&(d.directives.docStart=!0,a&&(a.type==="block-map"||a.type==="block-seq")&&!m.hasNewline&&u(m.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),d.contents=a?BS(g,a,m,u):Qd(g,m.end,r,null,m,u);const y=d.contents.range[2],S=ml(o,y,!1,u);return S.comment&&(d.comment=S.comment),d.range=[i,y,S.offset],d}function qa(n){if(typeof n=="number")return[n,n+1];if(Array.isArray(n))return n.length===2?n:[n[0],n[1]];const{offset:e,source:i}=n;return[e,e+(typeof i=="string"?i.length:1)]}function i0(n){var a;let e="",i=!1,r=!1;for(let o=0;o<n.length;++o){const u=n[o];switch(u[0]){case"#":e+=(e===""?"":r?`

`:`
`)+(u.substring(1)||" "),i=!0,r=!1;break;case"%":((a=n[o+1])==null?void 0:a[0])!=="#"&&(o+=1),i=!1;break;default:i||(r=!0),i=!1}}return{comment:e,afterEmptyLine:r}}class Pd{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(i,r,a,o)=>{const u=qa(i);o?this.warnings.push(new LS(u,r,a)):this.errors.push(new hs(u,r,a))},this.directives=new Ot({version:e.version||"1.2"}),this.options=e}decorate(e,i){const{comment:r,afterEmptyLine:a}=i0(this.prelude);if(r){const o=e.contents;if(i)e.comment=e.comment?`${e.comment}
${r}`:r;else if(a||e.directives.docStart||!o)e.commentBefore=r;else if(Ke(o)&&!o.flow&&o.items.length>0){let u=o.items[0];Ve(u)&&(u=u.key);const f=u.commentBefore;u.commentBefore=f?`${r}
${f}`:r}else{const u=o.commentBefore;o.commentBefore=u?`${r}
${u}`:r}}i?(Array.prototype.push.apply(e.errors,this.errors),Array.prototype.push.apply(e.warnings,this.warnings)):(e.errors=this.errors,e.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:i0(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,i=!1,r=-1){for(const a of e)yield*this.next(a);yield*this.end(i,r)}*next(e){switch(e.type){case"directive":this.directives.add(e.source,(i,r,a)=>{const o=qa(e);o[0]+=i,this.onError(o,"BAD_DIRECTIVE",r,a)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{const i=GC(this.options,this.directives,e,this.onError);this.atDirectives&&!i.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(i,!1),this.doc&&(yield this.doc),this.doc=i,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{const i=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,r=new hs(qa(e),"UNEXPECTED_TOKEN",i);this.atDirectives||!this.doc?this.errors.push(r):this.doc.errors.push(r);break}case"doc-end":{if(!this.doc){const r="Unexpected doc-end without preceding document";this.errors.push(new hs(qa(e),"UNEXPECTED_TOKEN",r));break}this.doc.directives.docEnd=!0;const i=ml(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),i.comment){const r=this.doc.comment;this.doc.comment=r?`${r}
${i.comment}`:i.comment}this.doc.range[2]=i.offset;break}default:this.errors.push(new hs(qa(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,i=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){const r=Object.assign({_directives:this.directives},this.options),a=new Br(void 0,r);this.atDirectives&&this.onError(i,"MISSING_CHAR","Missing directives-end indicator line"),a.range=[0,i,i],this.decorate(a,!1),yield a}}}function KC(n,e=!0,i){if(n){const r=(a,o,u)=>{const f=typeof a=="number"?a:Array.isArray(a)?a[0]:a.offset;if(i)i(f,o,u);else throw new hs([f,f+1],o,u)};switch(n.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return zS(n,e,r);case"block-scalar":return DS({options:{strict:e}},n,r)}}return null}function XC(n,e){const{implicitKey:i=!1,indent:r,inFlow:a=!1,offset:o=-1,type:u="PLAIN"}=e,f=pl({type:u,value:n},{implicitKey:i,indent:r>0?" ".repeat(r):"",inFlow:a,options:{blockQuote:!0,lineWidth:-1}}),d=e.end??[{type:"newline",offset:-1,indent:r,source:`
`}];switch(f[0]){case"|":case">":{const g=f.indexOf(`
`),m=f.substring(0,g),y=f.substring(g+1)+`
`,S=[{type:"block-scalar-header",offset:o,indent:r,source:m}];return qS(S,d)||S.push({type:"newline",offset:-1,indent:r,source:`
`}),{type:"block-scalar",offset:o,indent:r,props:S,source:y}}case'"':return{type:"double-quoted-scalar",offset:o,indent:r,source:f,end:d};case"'":return{type:"single-quoted-scalar",offset:o,indent:r,source:f,end:d};default:return{type:"scalar",offset:o,indent:r,source:f,end:d}}}function YC(n,e,i={}){let{afterKey:r=!1,implicitKey:a=!1,inFlow:o=!1,type:u}=i,f="indent"in n?n.indent:null;if(r&&typeof f=="number"&&(f+=2),!u)switch(n.type){case"single-quoted-scalar":u="QUOTE_SINGLE";break;case"double-quoted-scalar":u="QUOTE_DOUBLE";break;case"block-scalar":{const g=n.props[0];if(g.type!=="block-scalar-header")throw new Error("Invalid block scalar header");u=g.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:u="PLAIN"}const d=pl({type:u,value:e},{implicitKey:a||f===null,indent:f!==null&&f>0?" ".repeat(f):"",inFlow:o,options:{blockQuote:!0,lineWidth:-1}});switch(d[0]){case"|":case">":FC(n,d);break;case'"':Ch(n,d,"double-quoted-scalar");break;case"'":Ch(n,d,"single-quoted-scalar");break;default:Ch(n,d,"scalar")}}function FC(n,e){const i=e.indexOf(`
`),r=e.substring(0,i),a=e.substring(i+1)+`
`;if(n.type==="block-scalar"){const o=n.props[0];if(o.type!=="block-scalar-header")throw new Error("Invalid block scalar header");o.source=r,n.source=a}else{const{offset:o}=n,u="indent"in n?n.indent:-1,f=[{type:"block-scalar-header",offset:o,indent:u,source:r}];qS(f,"end"in n?n.end:void 0)||f.push({type:"newline",offset:-1,indent:u,source:`
`});for(const d of Object.keys(n))d!=="type"&&d!=="offset"&&delete n[d];Object.assign(n,{type:"block-scalar",indent:u,props:f,source:a})}}function qS(n,e){if(e)for(const i of e)switch(i.type){case"space":case"comment":n.push(i);break;case"newline":return n.push(i),!0}return!1}function Ch(n,e,i){switch(n.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":n.type=i,n.source=e;break;case"block-scalar":{const r=n.props.slice(1);let a=e.length;n.props[0].type==="block-scalar-header"&&(a-=n.props[0].source.length);for(const o of r)o.offset+=a;delete n.props,Object.assign(n,{type:i,source:e,end:r});break}case"block-map":case"block-seq":{const a={type:"newline",offset:n.offset+e.length,indent:n.indent,source:`
`};delete n.items,Object.assign(n,{type:i,source:e,end:[a]});break}default:{const r="indent"in n?n.indent:-1,a="end"in n&&Array.isArray(n.end)?n.end.filter(o=>o.type==="space"||o.type==="comment"||o.type==="newline"):[];for(const o of Object.keys(n))o!=="type"&&o!=="offset"&&delete n[o];Object.assign(n,{type:i,indent:r,source:e,end:a})}}}const QC=n=>"type"in n?mc(n):ic(n);function mc(n){switch(n.type){case"block-scalar":{let e="";for(const i of n.props)e+=mc(i);return e+n.source}case"block-map":case"block-seq":{let e="";for(const i of n.items)e+=ic(i);return e}case"flow-collection":{let e=n.start.source;for(const i of n.items)e+=ic(i);for(const i of n.end)e+=i.source;return e}case"document":{let e=ic(n);if(n.end)for(const i of n.end)e+=i.source;return e}default:{let e=n.source;if("end"in n&&n.end)for(const i of n.end)e+=i.source;return e}}}function ic({start:n,key:e,sep:i,value:r}){let a="";for(const o of n)a+=o.source;if(e&&(a+=mc(e)),i)for(const o of i)a+=o.source;return r&&(a+=mc(r)),a}const Wh=Symbol("break visit"),PC=Symbol("skip children"),$S=Symbol("remove item");function ps(n,e){"type"in n&&n.type==="document"&&(n={start:n.start,value:n.value}),IS(Object.freeze([]),n,e)}ps.BREAK=Wh;ps.SKIP=PC;ps.REMOVE=$S;ps.itemAtPath=(n,e)=>{let i=n;for(const[r,a]of e){const o=i==null?void 0:i[r];if(o&&"items"in o)i=o.items[a];else return}return i};ps.parentCollection=(n,e)=>{const i=ps.itemAtPath(n,e.slice(0,-1)),r=e[e.length-1][0],a=i==null?void 0:i[r];if(a&&"items"in a)return a;throw new Error("Parent collection not found")};function IS(n,e,i){let r=i(e,n);if(typeof r=="symbol")return r;for(const a of["key","value"]){const o=e[a];if(o&&"items"in o){for(let u=0;u<o.items.length;++u){const f=IS(Object.freeze(n.concat([[a,u]])),o.items[u],i);if(typeof f=="number")u=f-1;else{if(f===Wh)return Wh;f===$S&&(o.items.splice(u,1),u-=1)}}typeof r=="function"&&a==="key"&&(r=r(e,n))}}return typeof r=="function"?r(e,n):r}const Uc="\uFEFF",Hc="",Bc="",cl="",JC=n=>!!n&&"items"in n,ZC=n=>!!n&&(n.type==="scalar"||n.type==="single-quoted-scalar"||n.type==="double-quoted-scalar"||n.type==="block-scalar");function WC(n){switch(n){case Uc:return"<BOM>";case Hc:return"<DOC>";case Bc:return"<FLOW_END>";case cl:return"<SCALAR>";default:return JSON.stringify(n)}}function VS(n){switch(n){case Uc:return"byte-order-mark";case Hc:return"doc-mode";case Bc:return"flow-error-end";case cl:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
`:case`\r
`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(n[0]){case" ":case"	":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}const e2=Object.freeze(Object.defineProperty({__proto__:null,BOM:Uc,DOCUMENT:Hc,FLOW_END:Bc,SCALAR:cl,createScalarToken:XC,isCollection:JC,isScalar:ZC,prettyToken:WC,resolveAsScalar:KC,setScalarValue:YC,stringify:QC,tokenType:VS,visit:ps},Symbol.toStringTag,{value:"Module"}));function xn(n){switch(n){case void 0:case" ":case`
`:case"\r":case"	":return!0;default:return!1}}const s0=new Set("0123456789ABCDEFabcdef"),t2=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Go=new Set(",[]{}"),n2=new Set(` ,[]{}
\r	`),Nh=n=>!n||n2.has(n);class GS{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,i=!1){if(e){if(typeof e!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!i;let r=this.next??"stream";for(;r&&(i||this.hasChars(1));)r=yield*this.parseNext(r)}atLineEnd(){let e=this.pos,i=this.buffer[e];for(;i===" "||i==="	";)i=this.buffer[++e];return!i||i==="#"||i===`
`?!0:i==="\r"?this.buffer[e+1]===`
`:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let i=this.buffer[e];if(this.indentNext>0){let r=0;for(;i===" ";)i=this.buffer[++r+e];if(i==="\r"){const a=this.buffer[r+e+1];if(a===`
`||!a&&!this.atEnd)return e+r+1}return i===`
`||r>=this.indentNext||!i&&!this.atEnd?e+r:-1}if(i==="-"||i==="."){const r=this.buffer.substr(e,3);if((r==="---"||r==="...")&&xn(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!="number"||e!==-1&&e<this.pos)&&(e=this.buffer.indexOf(`
`,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]==="\r"&&(e-=1),this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext("stream");if(e[0]===Uc&&(yield*this.pushCount(1),e=e.substring(1)),e[0]==="%"){let i=e.length,r=e.indexOf("#");for(;r!==-1;){const o=e[r-1];if(o===" "||o==="	"){i=r-1;break}else r=e.indexOf("#",r+1)}for(;;){const o=e[i-1];if(o===" "||o==="	")i-=1;else break}const a=(yield*this.pushCount(i))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-a),this.pushNewline(),"stream"}if(this.atLineEnd()){const i=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-i),yield*this.pushNewline(),"stream"}return yield Hc,yield*this.parseLineStart()}*parseLineStart(){const e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext("line-start");if(e==="-"||e==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");const i=this.peek(3);if((i==="---"||i==="...")&&xn(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,i==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!xn(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){const[e,i]=this.peek(2);if(!i&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&xn(i)){const r=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=r,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);const e=this.getLine();if(e===null)return this.setNext("doc");let i=yield*this.pushIndicators();switch(e[i]){case"#":yield*this.pushCount(e.length-i);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(Nh),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return i+=yield*this.parseBlockScalarHeader(),i+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-i),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,i,r=-1;do e=yield*this.pushNewline(),e>0?(i=yield*this.pushSpaces(!1),this.indentValue=r=i):i=0,i+=yield*this.pushSpaces(!0);while(e+i>0);const a=this.getLine();if(a===null)return this.setNext("flow");if((r!==-1&&r<this.indentNext&&a[0]!=="#"||r===0&&(a.startsWith("---")||a.startsWith("..."))&&xn(a[3]))&&!(r===this.indentNext-1&&this.flowLevel===1&&(a[0]==="]"||a[0]==="}")))return this.flowLevel=0,yield Bc,yield*this.parseLineStart();let o=0;for(;a[o]===",";)o+=yield*this.pushCount(1),o+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(o+=yield*this.pushIndicators(),a[o]){case void 0:return"flow";case"#":return yield*this.pushCount(a.length-o),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(Nh),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{const u=this.charAt(1);if(this.flowKey||xn(u)||u===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){const e=this.charAt(0);let i=this.buffer.indexOf(e,this.pos+1);if(e==="'")for(;i!==-1&&this.buffer[i+1]==="'";)i=this.buffer.indexOf("'",i+2);else for(;i!==-1;){let o=0;for(;this.buffer[i-1-o]==="\\";)o+=1;if(o%2===0)break;i=this.buffer.indexOf('"',i+1)}const r=this.buffer.substring(0,i);let a=r.indexOf(`
`,this.pos);if(a!==-1){for(;a!==-1;){const o=this.continueScalar(a+1);if(o===-1)break;a=r.indexOf(`
`,o)}a!==-1&&(i=a-(r[a-1]==="\r"?2:1))}if(i===-1){if(!this.atEnd)return this.setNext("quoted-scalar");i=this.buffer.length}return yield*this.pushToIndex(i+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){const i=this.buffer[++e];if(i==="+")this.blockScalarKeep=!0;else if(i>"0"&&i<="9")this.blockScalarIndent=Number(i)-1;else if(i!=="-")break}return yield*this.pushUntil(i=>xn(i)||i==="#")}*parseBlockScalar(){let e=this.pos-1,i=0,r;e:for(let o=this.pos;r=this.buffer[o];++o)switch(r){case" ":i+=1;break;case`
`:e=o,i=0;break;case"\r":{const u=this.buffer[o+1];if(!u&&!this.atEnd)return this.setNext("block-scalar");if(u===`
`)break}default:break e}if(!r&&!this.atEnd)return this.setNext("block-scalar");if(i>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=i:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{const o=this.continueScalar(e+1);if(o===-1)break;e=this.buffer.indexOf(`
`,o)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let a=e+1;for(r=this.buffer[a];r===" ";)r=this.buffer[++a];if(r==="	"){for(;r==="	"||r===" "||r==="\r"||r===`
`;)r=this.buffer[++a];e=a-1}else if(!this.blockScalarKeep)do{let o=e-1,u=this.buffer[o];u==="\r"&&(u=this.buffer[--o]);const f=o;for(;u===" ";)u=this.buffer[--o];if(u===`
`&&o>=this.pos&&o+1+i>f)e=o;else break}while(!0);return yield cl,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const e=this.flowLevel>0;let i=this.pos-1,r=this.pos-1,a;for(;a=this.buffer[++r];)if(a===":"){const o=this.buffer[r+1];if(xn(o)||e&&Go.has(o))break;i=r}else if(xn(a)){let o=this.buffer[r+1];if(a==="\r"&&(o===`
`?(r+=1,a=`
`,o=this.buffer[r+1]):i=r),o==="#"||e&&Go.has(o))break;if(a===`
`){const u=this.continueScalar(r+1);if(u===-1)break;r=Math.max(r,u-2)}}else{if(e&&Go.has(a))break;i=r}return!a&&!this.atEnd?this.setNext("plain-scalar"):(yield cl,yield*this.pushToIndex(i+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,i){const r=this.buffer.slice(this.pos,e);return r?(yield r,this.pos+=r.length,r.length):(i&&(yield""),0)}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(Nh))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{const e=this.flowLevel>0,i=this.charAt(1);if(xn(i)||e&&Go.has(i))return e?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}return 0}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,i=this.buffer[e];for(;!xn(i)&&i!==">";)i=this.buffer[++e];return yield*this.pushToIndex(i===">"?e+1:e,!1)}else{let e=this.pos+1,i=this.buffer[e];for(;i;)if(t2.has(i))i=this.buffer[++e];else if(i==="%"&&s0.has(this.buffer[e+1])&&s0.has(this.buffer[e+2]))i=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){const e=this.buffer[this.pos];return e===`
`?yield*this.pushCount(1):e==="\r"&&this.charAt(1)===`
`?yield*this.pushCount(2):0}*pushSpaces(e){let i=this.pos-1,r;do r=this.buffer[++i];while(r===" "||e&&r==="	");const a=i-this.pos;return a>0&&(yield this.buffer.substr(this.pos,a),this.pos=i),a}*pushUntil(e){let i=this.pos,r=this.buffer[i];for(;!e(r);)r=this.buffer[++i];return yield*this.pushToIndex(i,!1)}}class KS{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let i=0,r=this.lineStarts.length;for(;i<r;){const o=i+r>>1;this.lineStarts[o]<e?i=o+1:r=o}if(this.lineStarts[i]===e)return{line:i+1,col:1};if(i===0)return{line:0,col:e};const a=this.lineStarts[i-1];return{line:i,col:e-a+1}}}}function Li(n,e){for(let i=0;i<n.length;++i)if(n[i].type===e)return!0;return!1}function r0(n){for(let e=0;e<n.length;++e)switch(n[e].type){case"space":case"comment":case"newline":break;default:return e}return-1}function XS(n){switch(n==null?void 0:n.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function Ko(n){switch(n.type){case"document":return n.start;case"block-map":{const e=n.items[n.items.length-1];return e.sep??e.start}case"block-seq":return n.items[n.items.length-1].start;default:return[]}}function dr(n){var i;if(n.length===0)return[];let e=n.length;e:for(;--e>=0;)switch(n[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;((i=n[++e])==null?void 0:i.type)==="space";);return n.splice(e,n.length)}function a0(n){if(n.start.type==="flow-seq-start")for(const e of n.items)e.sep&&!e.value&&!Li(e.start,"explicit-key-ind")&&!Li(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,XS(e.value)?e.value.end?Array.prototype.push.apply(e.value.end,e.sep):e.value.end=e.sep:Array.prototype.push.apply(e.start,e.sep),delete e.sep)}class Jd{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new GS,this.onNewLine=e}*parse(e,i=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(const r of this.lexer.lex(e,i))yield*this.next(r);i||(yield*this.end())}*next(e){if(this.source=e,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}const i=VS(e);if(i)if(i==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=i,yield*this.step(),i){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case"space":this.atNewLine&&e[0]===" "&&(this.indent+=e.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=e.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}else{const r=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:r,source:e}),this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){const e=this.peek(1);if(this.type==="doc-end"&&(e==null?void 0:e.type)!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){const i=e??this.stack.pop();if(!i)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield i;else{const r=this.peek(1);switch(i.type==="block-scalar"?i.indent="indent"in r?r.indent:0:i.type==="flow-collection"&&r.type==="document"&&(i.indent=0),i.type==="flow-collection"&&a0(i),r.type){case"document":r.value=i;break;case"block-scalar":r.props.push(i);break;case"block-map":{const a=r.items[r.items.length-1];if(a.value){r.items.push({start:[],key:i,sep:[]}),this.onKeyLine=!0;return}else if(a.sep)a.value=i;else{Object.assign(a,{key:i,sep:[]}),this.onKeyLine=!a.explicitKey;return}break}case"block-seq":{const a=r.items[r.items.length-1];a.value?r.items.push({start:[],value:i}):a.value=i;break}case"flow-collection":{const a=r.items[r.items.length-1];!a||a.value?r.items.push({start:[],key:i,sep:[]}):a.sep?a.value=i:Object.assign(a,{key:i,sep:[]});return}default:yield*this.pop(),yield*this.pop(i)}if((r.type==="document"||r.type==="block-map"||r.type==="block-seq")&&(i.type==="block-map"||i.type==="block-seq")){const a=i.items[i.items.length-1];a&&!a.sep&&!a.value&&a.start.length>0&&r0(a.start)===-1&&(i.indent===0||a.start.every(o=>o.type!=="comment"||o.indent<i.indent))&&(r.type==="document"?r.end=a.start:r.items.push({start:a.start}),i.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{const e={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&e.start.push(this.sourceToken),this.stack.push(e);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case"doc-start":{r0(e.start)!==-1?(yield*this.pop(),yield*this.step()):e.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":e.start.push(this.sourceToken);return}const i=this.startBlockValue(e);i?this.stack.push(i):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if(this.type==="map-value-ind"){const i=Ko(this.peek(2)),r=dr(i);let a;e.end?(a=e.end,a.push(this.sourceToken),delete e.end):a=[this.sourceToken];const o={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:r,key:e,sep:a}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=o}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case"space":case"comment":case"newline":e.props.push(this.sourceToken);return;case"scalar":if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let i=this.source.indexOf(`
`)+1;for(;i!==0;)this.onNewLine(this.offset+i),i=this.source.indexOf(`
`,i)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){var r;const i=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,i.value){const a="end"in i.value?i.value.end:void 0,o=Array.isArray(a)?a[a.length-1]:void 0;(o==null?void 0:o.type)==="comment"?a==null||a.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else i.sep?i.sep.push(this.sourceToken):i.start.push(this.sourceToken);return;case"space":case"comment":if(i.value)e.items.push({start:[this.sourceToken]});else if(i.sep)i.sep.push(this.sourceToken);else{if(this.atIndentedComment(i.start,e.indent)){const a=e.items[e.items.length-2],o=(r=a==null?void 0:a.value)==null?void 0:r.end;if(Array.isArray(o)){Array.prototype.push.apply(o,i.start),o.push(this.sourceToken),e.items.pop();return}}i.start.push(this.sourceToken)}return}if(this.indent>=e.indent){const a=!this.onKeyLine&&this.indent===e.indent,o=a&&(i.sep||i.explicitKey)&&this.type!=="seq-item-ind";let u=[];if(o&&i.sep&&!i.value){const f=[];for(let d=0;d<i.sep.length;++d){const g=i.sep[d];switch(g.type){case"newline":f.push(d);break;case"space":break;case"comment":g.indent>e.indent&&(f.length=0);break;default:f.length=0}}f.length>=2&&(u=i.sep.splice(f[1]))}switch(this.type){case"anchor":case"tag":o||i.value?(u.push(this.sourceToken),e.items.push({start:u}),this.onKeyLine=!0):i.sep?i.sep.push(this.sourceToken):i.start.push(this.sourceToken);return;case"explicit-key-ind":!i.sep&&!i.explicitKey?(i.start.push(this.sourceToken),i.explicitKey=!0):o||i.value?(u.push(this.sourceToken),e.items.push({start:u,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(i.explicitKey)if(i.sep)if(i.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Li(i.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:u,key:null,sep:[this.sourceToken]}]});else if(XS(i.key)&&!Li(i.sep,"newline")){const f=dr(i.start),d=i.key,g=i.sep;g.push(this.sourceToken),delete i.key,delete i.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:f,key:d,sep:g}]})}else u.length>0?i.sep=i.sep.concat(u,this.sourceToken):i.sep.push(this.sourceToken);else if(Li(i.start,"newline"))Object.assign(i,{key:null,sep:[this.sourceToken]});else{const f=dr(i.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:f,key:null,sep:[this.sourceToken]}]})}else i.sep?i.value||o?e.items.push({start:u,key:null,sep:[this.sourceToken]}):Li(i.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):i.sep.push(this.sourceToken):Object.assign(i,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const f=this.flowScalar(this.type);o||i.value?(e.items.push({start:u,key:f,sep:[]}),this.onKeyLine=!0):i.sep?this.stack.push(f):(Object.assign(i,{key:f,sep:[]}),this.onKeyLine=!0);return}default:{const f=this.startBlockValue(e);if(f){if(f.type==="block-seq"){if(!i.explicitKey&&i.sep&&!Li(i.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else a&&e.items.push({start:u});this.stack.push(f);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){var r;const i=e.items[e.items.length-1];switch(this.type){case"newline":if(i.value){const a="end"in i.value?i.value.end:void 0,o=Array.isArray(a)?a[a.length-1]:void 0;(o==null?void 0:o.type)==="comment"?a==null||a.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else i.start.push(this.sourceToken);return;case"space":case"comment":if(i.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(i.start,e.indent)){const a=e.items[e.items.length-2],o=(r=a==null?void 0:a.value)==null?void 0:r.end;if(Array.isArray(o)){Array.prototype.push.apply(o,i.start),o.push(this.sourceToken),e.items.pop();return}}i.start.push(this.sourceToken)}return;case"anchor":case"tag":if(i.value||this.indent<=e.indent)break;i.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;i.value||Li(i.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):i.start.push(this.sourceToken);return}if(this.indent>e.indent){const a=this.startBlockValue(e);if(a){this.stack.push(a);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){const i=e.items[e.items.length-1];if(this.type==="flow-error-end"){let r;do yield*this.pop(),r=this.peek(1);while((r==null?void 0:r.type)==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!i||i.sep?e.items.push({start:[this.sourceToken]}):i.start.push(this.sourceToken);return;case"map-value-ind":!i||i.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):i.sep?i.sep.push(this.sourceToken):Object.assign(i,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!i||i.value?e.items.push({start:[this.sourceToken]}):i.sep?i.sep.push(this.sourceToken):i.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const a=this.flowScalar(this.type);!i||i.value?e.items.push({start:[],key:a,sep:[]}):i.sep?this.stack.push(a):Object.assign(i,{key:a,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}const r=this.startBlockValue(e);r?this.stack.push(r):(yield*this.pop(),yield*this.step())}else{const r=this.peek(2);if(r.type==="block-map"&&(this.type==="map-value-ind"&&r.indent===e.indent||this.type==="newline"&&!r.items[r.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&r.type!=="flow-collection"){const a=Ko(r),o=dr(a);a0(e);const u=e.end.splice(1,e.end.length);u.push(this.sourceToken);const f={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:o,key:e,sep:u}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=f}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let i=this.source.indexOf(`
`)+1;for(;i!==0;)this.onNewLine(this.offset+i),i=this.source.indexOf(`
`,i)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const i=Ko(e),r=dr(i);return r.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const i=Ko(e),r=dr(i);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,i){return this.type!=="comment"||this.indent<=i?!1:e.every(r=>r.type==="newline"||r.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}}function YS(n){const e=n.prettyErrors!==!1;return{lineCounter:n.lineCounter||e&&new KS||null,prettyErrors:e}}function i2(n,e={}){const{lineCounter:i,prettyErrors:r}=YS(e),a=new Jd(i==null?void 0:i.addNewLine),o=new Pd(e),u=Array.from(o.compose(a.parse(n)));if(r&&i)for(const f of u)f.errors.forEach(gc(n,i)),f.warnings.forEach(gc(n,i));return u.length>0?u:Object.assign([],{empty:!0},o.streamInfo())}function FS(n,e={}){const{lineCounter:i,prettyErrors:r}=YS(e),a=new Jd(i==null?void 0:i.addNewLine),o=new Pd(e);let u=null;for(const f of o.compose(a.parse(n),!0,n.length))if(!u)u=f;else if(u.options.logLevel!=="silent"){u.errors.push(new hs(f.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return r&&i&&(u.errors.forEach(gc(n,i)),u.warnings.forEach(gc(n,i))),u}function s2(n,e,i){let r;typeof e=="function"?r=e:i===void 0&&e&&typeof e=="object"&&(i=e);const a=FS(n,i);if(!a)return null;if(a.warnings.forEach(o=>pS(a.options.logLevel,o)),a.errors.length>0){if(a.options.logLevel!=="silent")throw a.errors[0];a.errors=[]}return a.toJS(Object.assign({reviver:r},i))}function r2(n,e,i){let r=null;if(typeof e=="function"||Array.isArray(e)?r=e:i===void 0&&e&&(i=e),typeof i=="string"&&(i=i.length),typeof i=="number"){const a=Math.round(i);i=a<1?void 0:a>8?{indent:8}:{indent:a}}if(n===void 0){const{keepUndefined:a}=i??e??{};if(!a)return}return ms(n)&&!r?n.toString(i):new Br(n,r,i).toString(i)}const QS=Object.freeze(Object.defineProperty({__proto__:null,Alias:Cc,CST:e2,Composer:Pd,Document:Br,Lexer:GS,LineCounter:KS,Pair:Nt,Parser:Jd,Scalar:de,Schema:zc,YAMLError:Fd,YAMLMap:nn,YAMLParseError:hs,YAMLSeq:zi,YAMLWarning:LS,isAlias:Hi,isCollection:Ke,isDocument:ms,isMap:Dr,isNode:Xe,isPair:Ve,isScalar:ze,isSeq:zr,parse:s2,parseAllDocuments:i2,parseDocument:FS,stringify:r2,visit:ys,visitAsync:Ac},Symbol.toStringTag,{value:"Module"})),l0=[.5,1,2];function a2(n,e,i,r,a){const[o,u]=R.useState(!1),[f,d]=R.useState(1),[g,m]=R.useState(!1),[y,S]=R.useState(void 0),[w,E]=R.useState(void 0),x=l0[f],_=e?n.indexOf(e):-1,A=a.minimum,C=a.maximum,H=C-A||1,V=r?r.minimum:A,K=r?r.maximum:C,Q=R.useMemo(()=>r?n.filter(fe=>fe.startTime>=r.minimum&&fe.startTime<=r.maximum):n,[n,r]),j=Q.length?n.indexOf(Q[0]):0,I=Q.length?n.indexOf(Q[Q.length-1]):n.length-1,O=R.useRef(n);O.current=n;const P=R.useRef(i);P.current=i;const J=R.useRef(null),$=R.useCallback(fe=>{let _e=0,Ue=n.length-1;for(;_e<Ue;){const He=_e+Ue+1>>1;n[He].startTime<=fe?_e=He:Ue=He-1}if(_e<n.length-1){const He=fe-n[_e].startTime;n[_e+1].startTime-fe<He&&(_e=_e+1)}return Math.max(j,Math.min(I,_e))},[n,j,I]),ee=e?e.startTime:A;let ce;g&&y!==void 0?ce=y*100:o&&w!==void 0?ce=Math.max(0,Math.min(100,(w-A)/H*100)):ce=Math.max(0,Math.min(100,(ee-A)/H*100));const Me=R.useRef(V);Me.current=V;const q=R.useRef(K);q.current=K,R.useEffect(()=>{if(!o)return;let fe,_e,Ue=ee;Ue<Me.current&&(Ue=Me.current);let He=_;E(Ue);const Xt=Ye=>{if(_e!==void 0){const bs=(Ye-_e)*x;Ue=Math.min(Ue+bs,q.current)}_e=Ye,E(Ue);const Yt=$(Ue);if(Yt!==He&&(He=Yt,P.current(O.current[Yt])),Ue>=q.current){u(!1);return}fe=requestAnimationFrame(Xt)};return fe=requestAnimationFrame(Xt),()=>cancelAnimationFrame(fe)},[o,x]),R.useEffect(()=>{o||E(void 0)},[o]);const Z=R.useCallback(()=>{if(!n.length)return;const fe=_>=I;!o&&fe&&i(n[j]),u(!o)},[o,n,_,i,j,I]),re=R.useCallback(()=>{u(!1),n.length&&i(n[j])},[n,i,j]),me=R.useCallback(()=>{const fe=Math.max(_-1,j);fe!==_&&i(n[fe])},[n,_,i,j]),Ee=R.useCallback(()=>{const fe=Math.min(_+1,I);fe!==_&&i(n[fe])},[n,_,i,I]),M=R.useCallback(()=>{d(fe=>(fe+1)%l0.length)},[]);R.useEffect(()=>{u(!1)},[n]);const X=R.useCallback(fe=>{const _e=J.current.getBoundingClientRect();return Math.max(0,Math.min(1,(fe.clientX-_e.left)/_e.width))},[]),W=R.useCallback(fe=>{if(!n.length)return;const _e=A+fe*H,Ue=$(_e);P.current(O.current[Ue])},[n,A,H,$]),te=R.useRef(null);R.useEffect(()=>()=>{var fe;return(fe=te.current)==null?void 0:fe.call(te)},[]);const ue=R.useCallback(fe=>{var Xt;if(!n.length||fe.button!==0)return;fe.preventDefault(),fe.stopPropagation(),(Xt=J.current)==null||Xt.focus(),m(!0),u(!1);const _e=X(fe);S(_e),W(_e);const Ue=Ye=>{const Yt=X(Ye);S(Yt),W(Yt)},He=Ye=>{document.removeEventListener("mousemove",Ue),document.removeEventListener("mouseup",He),te.current=null;const Yt=X(Ye);W(Yt),S(void 0),m(!1)};document.addEventListener("mousemove",Ue),document.addEventListener("mouseup",He),te.current=()=>{document.removeEventListener("mousemove",Ue),document.removeEventListener("mouseup",He)}},[n,W,X]),se=!o&&!g,xe=n.length>0&&n.length<=200?n.map(fe=>(fe.startTime-A)/H*100):void 0,nt=_>j,Re=_<I,Rn=o||_>j;return{playing:o,speed:x,currentIndex:_,percent:ce,animating:se,togglePlay:Z,stop:re,prev:me,next:Ee,cycleSpeed:M,onScrubberMouseDown:ue,scrubberRef:J,actionsLength:n.length,canPrev:nt,canNext:Re,canStop:Rn,ticks:xe}}const l2=({playback:n})=>b.jsxs(b.Fragment,{children:[b.jsx(ct,{icon:"chevron-left",title:"Previous action",onClick:n.prev,disabled:!n.canPrev}),b.jsx(ct,{icon:n.playing?"debug-pause":"play",disabled:!n.actionsLength,title:n.playing?"Pause":"Play",onClick:n.togglePlay}),b.jsx(ct,{icon:"debug-stop",title:"Stop",onClick:n.stop,disabled:!n.canStop}),b.jsx(ct,{icon:"chevron-right",title:"Next action",onClick:n.next,disabled:!n.canNext}),b.jsxs("button",{className:"playback-speed",onClick:n.cycleSpeed,title:"Playback speed",children:[n.speed,"x"]})]}),o2=({playback:n})=>{var i;const e=R.useCallback(r=>{r.key==="ArrowLeft"?(r.preventDefault(),n.prev()):r.key==="ArrowRight"&&(r.preventDefault(),n.next())},[n]);return b.jsxs("div",{className:"playback-scrubber",ref:n.scrubberRef,onMouseDown:n.onScrubberMouseDown,onKeyDown:e,tabIndex:0,role:"slider","aria-label":"Playback position","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(n.percent),children:[b.jsx("div",{className:"playback-track"}),b.jsx("div",{className:"playback-track-filled"+(n.animating?" animated":""),style:{width:`${n.percent}%`}}),(i=n.ticks)==null?void 0:i.map((r,a)=>b.jsx("div",{className:"playback-tick",style:{left:`${r}%`}},a)),b.jsx("div",{className:"playback-thumb"+(n.animating?" animated":""),style:{left:`${n.percent}%`}})]})},c2=({action:n,model:e,sdkLanguage:i,testIdAttributeName:r,isInspecting:a,setIsInspecting:o,highlightedElement:u,setHighlightedElement:f,playback:d})=>{const[g,m]=R.useState("action"),[y]=jt("shouldPopulateCanvasFromScreenshot",!1),S=R.useMemo(()=>d2(n),[n]),{snapshotInfoUrl:w,snapshotUrl:E,popoutUrl:x}=R.useMemo(()=>{const A=S[g];return e&&A?p2(e.traceUri,A,y):{snapshotInfoUrl:void 0,snapshotUrl:void 0,popoutUrl:void 0}},[S,g,y,e]),_=R.useMemo(()=>w!==void 0?{snapshotInfoUrl:w,snapshotUrl:E,popoutUrl:x}:void 0,[w,E,x]);return b.jsxs("div",{className:"snapshot-tab vbox",children:[b.jsxs(dl,{children:[b.jsx(ct,{className:"pick-locator",title:"Pick locator",icon:"target",toggled:a,onClick:()=>o(!a)}),b.jsx("div",{className:"hbox",style:{height:"100%"},role:"tablist",children:["action","before","after"].map(A=>b.jsx(W0,{id:A,title:h2(A),selected:g===A,onSelect:()=>m(A)},A))}),b.jsx("div",{style:{flex:"auto"}}),b.jsx(l2,{playback:d}),b.jsx(ct,{icon:"link-external",title:"Open snapshot in a new tab",disabled:!(_!=null&&_.popoutUrl),onClick:()=>{const A=window.open((_==null?void 0:_.popoutUrl)||"","_blank");A==null||A.addEventListener("DOMContentLoaded",()=>{new Qv(A,{isUnderTest:JS,sdkLanguage:i,testIdAttributeName:r,stableRafCount:1,browserName:"chromium",customEngines:[]}).consoleApi.install()})}})]}),b.jsx(u2,{snapshotUrls:_,sdkLanguage:i,testIdAttributeName:r,isInspecting:a,setIsInspecting:o,highlightedElement:u,setHighlightedElement:f})]})},u2=({snapshotUrls:n,sdkLanguage:e,testIdAttributeName:i,isInspecting:r,setIsInspecting:a,highlightedElement:o,setHighlightedElement:u})=>{const f=R.useRef(null),d=R.useRef(null),[g,m]=R.useState({viewport:ZS,url:""}),y=R.useRef({iteration:0,visibleIframe:0});return R.useEffect(()=>{(async()=>{const S=y.current.iteration+1,w=1-y.current.visibleIframe;y.current.iteration=S;const E=await g2(n==null?void 0:n.snapshotInfoUrl);if(y.current.iteration!==S)return;const x=[f,d][w].current;if(x){let _=()=>{};const A=new Promise(C=>_=C);try{x.addEventListener("load",_),x.addEventListener("error",_);const C=(n==null?void 0:n.snapshotUrl)||YA;x.contentWindow?x.contentWindow.location.replace(C):x.src=C,await A}catch{}finally{x.removeEventListener("load",_),x.removeEventListener("error",_)}}y.current.iteration===S&&(y.current.visibleIframe=w,m(E))})()},[n]),b.jsxs("div",{className:"vbox",tabIndex:0,onKeyDown:S=>{S.key==="Escape"&&r&&a(!1)},children:[b.jsx(o0,{isInspecting:r,sdkLanguage:e,testIdAttributeName:i,highlightedElement:o,setHighlightedElement:u,iframe:f.current,iteration:y.current.iteration}),b.jsx(o0,{isInspecting:r,sdkLanguage:e,testIdAttributeName:i,highlightedElement:o,setHighlightedElement:u,iframe:d.current,iteration:y.current.iteration}),b.jsx(f2,{snapshotInfo:g,children:b.jsxs("div",{className:"snapshot-switcher",children:[b.jsx("iframe",{ref:f,name:"snapshot",title:"DOM Snapshot",sandbox:"allow-same-origin allow-scripts",className:ut(y.current.visibleIframe===0&&"snapshot-visible")}),b.jsx("iframe",{ref:d,name:"snapshot",title:"DOM Snapshot",sandbox:"allow-same-origin allow-scripts",className:ut(y.current.visibleIframe===1&&"snapshot-visible")})]})})]})},f2=({snapshotInfo:n,children:e})=>{const[i,r]=gs(),a=40,o={width:n.viewport.width,height:n.viewport.height},u={width:Math.max(o.width,480),height:Math.max(o.height+a,320)},f=Math.min(i.width/u.width,i.height/u.height,1),d={x:(i.width-u.width)/2,y:(i.height-u.height)/2};return b.jsx("div",{ref:r,className:"snapshot-wrapper",children:b.jsxs("div",{className:"snapshot-container",style:{width:u.width+"px",height:u.height+"px",transform:`translate(${d.x}px, ${d.y}px) scale(${f})`},children:[b.jsx(JA,{url:n.url}),b.jsx("div",{className:"snapshot-browser-body",children:b.jsx("div",{style:{width:o.width+"px",height:o.height+"px"},children:e})})]})})};function h2(n){return n==="before"?"Before":n==="after"?"After":n==="action"?"Action":n}const o0=({iframe:n,isInspecting:e,sdkLanguage:i,testIdAttributeName:r,highlightedElement:a,setHighlightedElement:o,iteration:u})=>(R.useEffect(()=>{const f=a.lastEdited==="ariaSnapshot"?a.ariaSnapshot:void 0,d=a.lastEdited==="locator"?a.locator:void 0,g=!!f||!!d||e,m=[],y=new URLSearchParams(window.location.search).get("isUnderTest")==="true";try{PS(m,g,i,r,y,"",n==null?void 0:n.contentWindow)}catch{}const S=f?dd(QS,f):void 0,w=d?QA(i,d,r):void 0;for(const{recorder:E,frameSelector:x}of m){const _=w!=null&&w.startsWith(x)?w.substring(x.length).trim():void 0,A=(S==null?void 0:S.errors.length)===0?S.fragment:void 0;E.setUIState({mode:e?"inspecting":"none",actionSelector:_,ariaTemplate:A,language:i,testIdAttributeName:r,overlay:{offsetX:0}},{async elementPicked(C){o({locator:Ri(i,x+C.selector),ariaSnapshot:C.ariaSnapshot,lastEdited:"none"})},highlightUpdated(){for(const C of m)C.recorder!==E&&C.recorder.clearHighlight()}})}},[n,e,a,o,i,r,u]),b.jsx(b.Fragment,{}));function PS(n,e,i,r,a,o,u){if(!u)return;const f=u;if(!f._recorder&&e){const d=new Qv(u,{isUnderTest:a,sdkLanguage:i,testIdAttributeName:r,stableRafCount:1,browserName:"chromium",customEngines:[]}),g=new IA(d);f._injectedScript=d,f._recorder={recorder:g,frameSelector:o},a&&(window._weakRecordersForTest=window._weakRecordersForTest||new Set,window._weakRecordersForTest.add(new WeakRef(g)))}f._recorder&&n.push(f._recorder);for(let d=0;d<u.frames.length;++d){const g=u.frames[d],m=g.frameElement?f._injectedScript.generateSelectorSimple(g.frameElement,{omitInternalEngines:!0,testIdAttributeName:r})+" >> internal:control=enter-frame >> ":"";PS(n,e,i,r,a,o+m,g)}}const $a=(n,e)=>{if(!n)return;const i=n[e];if(i){if(!n.pageId){console.error("snapshot action must have a pageId");return}return{action:n,snapshotName:i,pageId:n.pageId,point:n.point}}};function d2(n){if(!n)return{};let e=$a(n,"beforeSnapshot");if(!e){for(let a=ob(n);a;a=ob(a))if(a.endTime<=n.startTime&&a.afterSnapshot){e=$a(a,"afterSnapshot");break}}let i=$a(n,"afterSnapshot");if(!i){let a;for(let o=cb(n);o&&o.startTime<=n.endTime;o=cb(o))o.endTime>n.endTime||!o.afterSnapshot||a&&a.endTime>o.endTime||(a=o);a?i=$a(a,"afterSnapshot"):i=e}const r=$a(n,"inputSnapshot")??i;return r&&(r.point=n.point),{action:r,before:e,after:i}}const JS=new URLSearchParams(window.location.search).has("isUnderTest");function p2(n,e,i){const r=new URLSearchParams;r.set("trace",n),r.set("name",e.snapshotName),JS&&r.set("isUnderTest","true"),e.point&&(r.set("pointX",String(e.point.x)),r.set("pointY",String(e.point.y))),i&&r.set("shouldPopulateCanvasFromScreenshot","1");const a=new URL(`snapshot/${e.pageId}?${r.toString()}`,window.location.href).toString(),o=new URL(`snapshotInfo/${e.pageId}?${r.toString()}`,window.location.href).toString(),u=new URLSearchParams;u.set("r",a),u.set("trace",n);const f=new URL(`snapshot.html?${u.toString()}`,window.location.href).toString();return{snapshotInfoUrl:o,snapshotUrl:a,popoutUrl:f}}async function g2(n){const e={url:"",viewport:ZS,timestamp:void 0,wallTime:void 0};if(n){const r=await(await fetch(n)).json();r.error||(e.url=r.url,e.viewport=r.viewport,e.timestamp=r.timestamp,e.wallTime=r.wallTime)}return e}const ZS={width:1280,height:720},m2=hl,y2=({stack:n,setSelectedFrame:e,selectedFrame:i})=>{const r=n||[];return b.jsx(m2,{name:"stack-trace",ariaLabel:"Stack trace",items:r,selectedItem:r[i],render:a=>{const o=a.file[1]===":"?"\\":"/";return b.jsxs(b.Fragment,{children:[b.jsx("span",{className:"stack-trace-frame-function",children:a.function||"(anonymous)"}),b.jsx("span",{className:"stack-trace-frame-location",children:a.file.split(o).pop()}),b.jsx("span",{className:"stack-trace-frame-line",children:":"+a.line})]})},onSelected:a=>e(r.indexOf(a))})};function b2(n,e,i,r,a){const o=Ln();return yc(async()=>{var w,E,x,_;const u=n==null?void 0:n[e],f=u!=null&&u.file?u:a;if(!f)return{source:{file:"",errors:[],content:void 0},targetLine:0,highlight:[]};const d=f.file;let g=i.get(d);g||(g={errors:((w=a==null?void 0:a.source)==null?void 0:w.errors)||[],content:(E=a==null?void 0:a.source)==null?void 0:E.content},i.set(d,g));const m=(f==null?void 0:f.line)||((x=g.errors[0])==null?void 0:x.line)||0,y=r&&d.startsWith(r)?d.substring(r.length+1):d,S=g.errors.map(A=>({type:"error",line:A.line,message:A.message}));if(S.push({line:m,type:"running"}),((_=a==null?void 0:a.source)==null?void 0:_.content)!==void 0)g.content=a.source.content;else if(g.content===void 0||f===a){const A=await S2(d);try{let C=o?await fetch(o.createRelativeUrl(`sha1/src@${A}.txt`)):void 0;(!C||C.status===404)&&(C=await fetch(`file?path=${encodeURIComponent(d)}`)),C.status>=400?g.content="":g.content=await C.text()}catch{g.content=`<Unable to read "${d}">`}}return{model:o,source:g,highlight:S,targetLine:m,fileName:y,location:f}},[n,e,r,a],{source:{errors:[],content:"Loadingâ€¦"},highlight:[]})}const v2=({stack:n,sources:e,rootDir:i,fallbackLocation:r,stackFrameLocation:a,onOpenExternally:o})=>{const[u,f]=R.useState(),[d,g]=R.useState(0);R.useEffect(()=>{u!==n&&(f(n),g(0))},[n,u,f,g]);const{source:m,highlight:y,targetLine:S,fileName:w,location:E}=b2(n,d,e,i,r),x=R.useCallback(()=>{E&&(o?o(E):window.location.href=`vscode://file//${E.file}:${E.line}`)},[o,E]),_=((n==null?void 0:n.length)??0)>1,A=w2(w),C=A.endsWith(".md")?"markdown":"javascript";return b.jsx(il,{sidebarSize:200,orientation:a==="bottom"?"vertical":"horizontal",sidebarHidden:!_,main:b.jsxs("div",{className:"vbox","data-testid":"source-code",children:[w&&b.jsxs(dl,{children:[b.jsx("div",{className:"source-tab-file-name",title:w,children:b.jsx("div",{children:A})}),b.jsx(ud,{description:"Copy filename",value:A}),E&&b.jsx(ct,{icon:"link-external",title:"Open in VS Code",onClick:x})]}),b.jsx(ds,{text:m.content||"",highlighter:C,highlight:y,revealLine:S,readOnly:!0,lineNumbers:!0,dataTestId:"source-code-mirror"})]}),sidebar:b.jsx(y2,{stack:n,selectedFrame:d,setSelectedFrame:g})})};async function S2(n){const e=new TextEncoder().encode(n),i=await crypto.subtle.digest("SHA-1",e),r=[],a=new DataView(i);for(let o=0;o<a.byteLength;o+=1){const u=a.getUint8(o).toString(16).padStart(2,"0");r.push(u)}return r.join("")}function w2(n){if(!n)return"";const e=n!=null&&n.includes("/")?"/":"\\";return(n==null?void 0:n.split(e).pop())??""}const WS={width:200,height:45},mr=2.5,x2=WS.height+mr*2,_2=({boundaries:n,previewPoint:e})=>{var m,y;const i=Ln(),[r,a]=gs(),o=R.useRef(null);let u=0;if(o.current&&e){const S=o.current.getBoundingClientRect();u=(e.clientY-S.top+o.current.scrollTop)/x2|0}const f=(y=(m=i==null?void 0:i.pages)==null?void 0:m[u])==null?void 0:y.screencastFrames;let d,g;if(e!==void 0&&f&&f.length){const S=n.minimum+(n.maximum-n.minimum)*e.x/r.width;d=f[u0(f,S,ew)-1];const w={width:Math.min(800,window.innerWidth/2|0),height:Math.min(800,window.innerHeight/2|0)};g=d?tw({width:d.width,height:d.height},w):void 0}return b.jsxs("div",{className:"film-strip",ref:a,children:[b.jsx("div",{className:"film-strip-lanes",ref:o,children:i==null?void 0:i.pages.map((S,w)=>S.screencastFrames.length?b.jsx(E2,{boundaries:n,page:S,width:r.width},w):null)}),i&&(e==null?void 0:e.x)!==void 0&&b.jsxs("div",{className:"film-strip-hover",style:{top:r.bottom+5,left:Math.min(e.x,r.width-(g?g.width:0)-10)},children:[d&&g&&b.jsx("div",{style:{width:g.width,height:g.height},children:b.jsx("img",{src:i.createRelativeUrl(`sha1/${d.sha1}`),width:g.width,height:g.height})}),e.action&&b.jsx("div",{className:"film-strip-hover-title",children:od(e.action,e)})]})]})},E2=({boundaries:n,page:e,width:i})=>{const r=Ln(),a={width:0,height:0},o=e.screencastFrames;for(const _ of o)a.width=Math.max(a.width,_.width),a.height=Math.max(a.height,_.height);const u=tw(a,WS),f=o[0].timestamp,d=o[o.length-1].timestamp,g=n.maximum-n.minimum,m=(f-n.minimum)/g*i,y=(n.maximum-d)/g*i,w=(d-f)/g*i/(u.width+2*mr)|0,E=(d-f)/w,x=[];for(let _=0;f&&E&&_<w;++_){const A=f+E*_,C=u0(o,A,ew)-1;x.push(b.jsx("div",{className:"film-strip-frame",style:{width:u.width,height:u.height,backgroundImage:`url(${r==null?void 0:r.createRelativeUrl("sha1/"+o[C].sha1)})`,backgroundSize:`${u.width}px ${u.height}px`,margin:mr,marginRight:mr}},_))}return x.push(b.jsx("div",{className:"film-strip-frame",style:{width:u.width,height:u.height,backgroundImage:`url(${r==null?void 0:r.createRelativeUrl("sha1/"+o[o.length-1].sha1)})`,backgroundSize:`${u.width}px ${u.height}px`,margin:mr,marginRight:mr}},x.length)),b.jsx("div",{className:"film-strip-lane",style:{marginLeft:m+"px",marginRight:y+"px"},children:x})};function ew(n,e){return n-e.timestamp}function tw(n,e){const i=Math.max(n.width/e.width,n.height/e.height);return{width:n.width/i|0,height:n.height/i|0}}const T2=({model:n,boundaries:e,onSelected:i,selectedTime:r,setSelectedTime:a,highlightedTime:o,sdkLanguage:u,scrubber:f})=>{const[d,g]=gs(),[m,y]=R.useState(),[S,w]=R.useState(),[E]=jt("actionsFilter",[]),{offsets:x,curtainLeft:_,curtainRight:A}=R.useMemo(()=>{let P=r||e;if(m&&m.startX!==m.endX){const ce=Mn(d.width,e,m.startX),Me=Mn(d.width,e,m.endX);P={minimum:Math.min(ce,Me),maximum:Math.max(ce,Me)}}const J=Oi(d.width,e,P.minimum),ee=Oi(d.width,e,e.maximum)-Oi(d.width,e,P.maximum);return{offsets:A2(d.width,e),curtainLeft:J,curtainRight:ee}},[r,e,m,d]),C=R.useMemo(()=>n==null?void 0:n.filteredActions(E),[n,E]),H=R.useMemo(()=>{if(!o)return;const P=Oi(d.width,e,o.minimum),J=Oi(d.width,e,o.maximum);return{left:P,width:Math.max(2,J-P)}},[o,e,d]),V=R.useCallback(P=>{if(w(void 0),!g.current)return;const J=P.clientX-g.current.getBoundingClientRect().left,$=Mn(d.width,e,J),ee=r?Oi(d.width,e,r.minimum):0,ce=r?Oi(d.width,e,r.maximum):0;r&&Math.abs(J-ee)<10?y({startX:ce,endX:J,type:"resize"}):r&&Math.abs(J-ce)<10?y({startX:ee,endX:J,type:"resize"}):r&&$>r.minimum&&$<r.maximum&&P.clientY-g.current.getBoundingClientRect().top<20?y({startX:ee,endX:ce,pivot:J,type:"move"}):y({startX:J,endX:J,type:"resize"})},[e,d,g,r]),K=R.useCallback(P=>{if(!g.current)return;const J=P.clientX-g.current.getBoundingClientRect().left,$=Mn(d.width,e,J),ee=C==null?void 0:C.findLast(Z=>Z.startTime<=$);if(!P.buttons){y(void 0);return}if(ee&&i(ee),!m)return;let ce=m;if(m.type==="resize")ce={...m,endX:J};else{const Z=J-m.pivot;let re=m.startX+Z,me=m.endX+Z;re<0&&(re=0,me=re+(m.endX-m.startX)),me>d.width&&(me=d.width,re=me-(m.endX-m.startX)),ce={...m,startX:re,endX:me,pivot:J}}y(ce);const Me=Mn(d.width,e,ce.startX),q=Mn(d.width,e,ce.endX);Me!==q&&a({minimum:Math.min(Me,q),maximum:Math.max(Me,q)})},[e,m,d,C,i,g,a]),Q=R.useCallback(()=>{if(w(void 0),!!m){if(m.startX!==m.endX){const P=Mn(d.width,e,m.startX),J=Mn(d.width,e,m.endX);a({minimum:Math.min(P,J),maximum:Math.max(P,J)})}else{const P=Mn(d.width,e,m.startX),J=C==null?void 0:C.findLast($=>$.startTime<=P);J&&i(J),a(void 0)}y(void 0)}},[e,m,d,C,a,i]),j=R.useCallback(P=>{if(!g.current)return;const J=P.clientX-g.current.getBoundingClientRect().left,$=Mn(d.width,e,J),ee=C==null?void 0:C.findLast(ce=>ce.startTime<=$);w({x:J,clientY:P.clientY,action:ee,sdkLanguage:u})},[e,d,C,g,u]),I=R.useCallback(()=>{w(void 0)},[]),O=R.useCallback(()=>{a(void 0)},[a]);return b.jsxs("div",{className:"timeline-view-container",children:[!!m&&b.jsx(Y0,{cursor:(m==null?void 0:m.type)==="resize"?"ew-resize":"grab",onPaneMouseUp:Q,onPaneMouseMove:K,onPaneDoubleClick:O}),b.jsxs("div",{ref:g,className:"timeline-view",onMouseDown:V,onMouseMove:j,onMouseLeave:I,children:[b.jsx("div",{className:"timeline-grid",children:x.map((P,J)=>b.jsx("div",{className:"timeline-divider",style:{left:P.position+"px"},children:b.jsx("div",{className:"timeline-time",children:yt(P.time-e.minimum)})},J))}),b.jsx(_2,{boundaries:e,previewPoint:S}),f,H&&b.jsx("div",{className:"timeline-highlight",style:{left:H.left,width:H.width}}),r&&b.jsxs("div",{className:"timeline-window",children:[b.jsx("div",{className:"timeline-window-curtain left",style:{width:_}}),b.jsx("div",{className:"timeline-window-resizer",style:{left:-5}}),b.jsx("div",{className:"timeline-window-center",children:b.jsx("div",{className:"timeline-window-drag"})}),b.jsx("div",{className:"timeline-window-resizer",style:{left:5}}),b.jsx("div",{className:"timeline-window-curtain right",style:{width:A}})]})]})]})};function A2(n,e){let r=n/64;const a=e.maximum-e.minimum,o=n/a;let u=a/r;const f=Math.ceil(Math.log(u)/Math.LN10);u=Math.pow(10,f),u*o>=320&&(u=u/5),u*o>=128&&(u=u/2);const d=e.minimum;let g=e.maximum;g+=64/o,r=Math.ceil((g-d)/u),u||(r=0);const m=[];for(let y=0;y<r;++y){const S=d+u*y;m.push({position:Oi(n,e,S),time:S})}return m}function Oi(n,e,i){return(i-e.minimum)/(e.maximum-e.minimum)*n}function Mn(n,e,i){return i/n*(e.maximum-e.minimum)+e.minimum}const C2=({model:n})=>{var i,r;if(!n)return b.jsx(b.Fragment,{});const e=n.wallTime!==void 0?new Date(n.wallTime).toLocaleString(void 0,{timeZoneName:"short"}):void 0;return b.jsxs("div",{style:{flex:"auto",display:"block",overflow:"hidden auto"},children:[b.jsx("div",{className:"call-section",style:{paddingTop:2},children:"Time"}),!!e&&b.jsxs("div",{className:"call-line",children:["start time:",b.jsx("span",{className:"call-value datetime",title:e,children:e})]}),b.jsxs("div",{className:"call-line",children:["duration:",b.jsx("span",{className:"call-value number",title:yt(n.endTime-n.startTime),children:yt(n.endTime-n.startTime)})]}),n.testTimeout!==void 0&&b.jsxs("div",{className:"call-line",children:["test timeout:",b.jsx("span",{className:"call-value number",title:yt(n.testTimeout),children:yt(n.testTimeout)})]}),b.jsx("div",{className:"call-section",children:"Browser"}),b.jsxs("div",{className:"call-line",children:["engine:",b.jsx("span",{className:"call-value string",title:n.browserName,children:n.browserName})]}),n.channel&&b.jsxs("div",{className:"call-line",children:["channel:",b.jsx("span",{className:"call-value string",title:n.channel,children:n.channel})]}),n.platform&&b.jsxs("div",{className:"call-line",children:["platform:",b.jsx("span",{className:"call-value string",title:n.platform,children:n.platform})]}),n.playwrightVersion&&b.jsxs("div",{className:"call-line",children:["playwright version:",b.jsx("span",{className:"call-value string",title:n.playwrightVersion,children:n.playwrightVersion})]}),n.options.userAgent&&b.jsxs("div",{className:"call-line",children:["user agent:",b.jsx("span",{className:"call-value datetime",title:n.options.userAgent,children:n.options.userAgent})]}),n.options.baseURL&&b.jsxs(b.Fragment,{children:[b.jsx("div",{className:"call-section",style:{paddingTop:2},children:"Config"}),b.jsxs("div",{className:"call-line",children:["baseURL:",mx(n.options.baseURL)?b.jsx("a",{className:"call-value string",href:n.options.baseURL,title:n.options.baseURL,target:"_blank",rel:"noopener noreferrer",children:n.options.baseURL}):b.jsx("span",{className:"call-value string",title:n.options.baseURL,children:n.options.baseURL})]})]}),b.jsx("div",{className:"call-section",children:"Viewport"}),n.options.viewport&&b.jsxs("div",{className:"call-line",children:["width:",b.jsx("span",{className:"call-value number",title:String(!!((i=n.options.viewport)!=null&&i.width)),children:n.options.viewport.width})]}),n.options.viewport&&b.jsxs("div",{className:"call-line",children:["height:",b.jsx("span",{className:"call-value number",title:String(!!((r=n.options.viewport)!=null&&r.height)),children:n.options.viewport.height})]}),b.jsxs("div",{className:"call-line",children:["is mobile:",b.jsx("span",{className:"call-value boolean",title:String(!!n.options.isMobile),children:String(!!n.options.isMobile)})]}),n.options.deviceScaleFactor&&b.jsxs("div",{className:"call-line",children:["device scale:",b.jsx("span",{className:"call-value number",title:String(n.options.deviceScaleFactor),children:String(n.options.deviceScaleFactor)})]}),b.jsx("div",{className:"call-section",children:"Counts"}),b.jsxs("div",{className:"call-line",children:["pages:",b.jsx("span",{className:"call-value number",children:n.pages.length})]}),b.jsxs("div",{className:"call-line",children:["actions:",b.jsx("span",{className:"call-value number",children:n.actions.length})]}),b.jsxs("div",{className:"call-line",children:["events:",b.jsx("span",{className:"call-value number",children:n.events.length})]})]})},N2=({annotations:n})=>n.length?b.jsx("div",{className:"annotations-tab",children:n.map((e,i)=>b.jsxs("div",{className:"annotation-item",children:[b.jsx("span",{style:{fontWeight:"bold"},children:e.type}),e.description&&b.jsxs("span",{children:[": ",P0(e.description)]})]},`annotation-${i}`))}):b.jsx(ai,{text:"No annotations"}),k2=({sdkLanguage:n,isInspecting:e,setIsInspecting:i,highlightedElement:r,setHighlightedElement:a})=>{const[o,u]=R.useState(),f=R.useCallback(d=>{const{errors:g}=dd(QS,d,{prettyErrors:!1}),m=g.map(y=>({message:y.message,line:y.range[1].line,column:y.range[1].col,type:"subtle-error"}));u(m),a({...r,ariaSnapshot:d,lastEdited:"ariaSnapshot"}),i(!1)},[r,a,i]);return b.jsxs("div",{style:{flex:"auto",backgroundColor:"var(--vscode-sideBar-background)",padding:"0 10px 10px 10px",overflow:"auto"},children:[b.jsxs("div",{className:"hbox",style:{lineHeight:"28px",color:"var(--vscode-editorCodeLens-foreground)"},children:[b.jsx("div",{children:"Locator"}),b.jsx(ct,{style:{margin:"0 4px"},title:"Pick locator",icon:"target",toggled:e,onClick:()=>i(!e)}),b.jsx("div",{style:{flex:"auto"}}),b.jsx(ct,{icon:"files",title:"Copy locator",onClick:()=>{Zy(r.locator||"")}})]}),b.jsx("div",{style:{height:50},children:b.jsx(ds,{text:r.locator||"",highlighter:n,isFocused:!0,wrapLines:!0,onChange:d=>{a({...r,locator:d,lastEdited:"locator"}),i(!1)}})}),b.jsxs("div",{className:"hbox",style:{lineHeight:"28px",color:"var(--vscode-editorCodeLens-foreground)"},children:[b.jsx("div",{style:{flex:"auto"},children:"Aria snapshot"}),b.jsx(ct,{icon:"files",title:"Copy snapshot",onClick:()=>{Zy(r.ariaSnapshot||"")}})]}),b.jsx("div",{style:{height:150},children:b.jsx(ds,{text:r.ariaSnapshot||"",highlighter:"yaml",wrapLines:!1,highlight:o,onChange:f})})]})},M2=({className:n,style:e,open:i,isModal:r,minWidth:a,verticalOffset:o,requestClose:u,anchor:f,dataTestId:d,children:g})=>{const m=R.useRef(null),[y,S]=R.useState(0),[w]=kh(m),[E,x]=kh(f),_=f?O2(w,E,o):void 0;return R.useEffect(()=>{const A=H=>{!m.current||!(H.target instanceof Node)||m.current.contains(H.target)||u==null||u()},C=H=>{H.key==="Escape"&&(u==null||u())};return i?(document.addEventListener("mousedown",A),document.addEventListener("keydown",C),()=>{document.removeEventListener("mousedown",A),document.removeEventListener("keydown",C)}):()=>{}},[i,u]),R.useLayoutEffect(()=>x(),[i,x]),R.useEffect(()=>{const A=()=>S(C=>C+1);return window.addEventListener("resize",A),()=>{window.removeEventListener("resize",A)}},[]),R.useLayoutEffect(()=>{m.current&&(i?r?m.current.showModal():m.current.show():m.current.close())},[i,r]),b.jsx("dialog",{ref:m,style:{position:"fixed",margin:_?0:void 0,zIndex:110,top:_==null?void 0:_.top,left:_==null?void 0:_.left,minWidth:a||0,...e},className:n,"data-testid":d,children:g})};function O2(n,e,i=4,r=4){let a=Math.max(r,e.left);a+n.width>window.innerWidth-r&&(a=window.innerWidth-n.width-r);let o=Math.max(0,e.bottom)+i;return o+n.height>window.innerHeight-i&&(Math.max(0,e.top)>n.height+i?o=Math.max(0,e.top)-n.height-i:o=window.innerHeight-i-n.height),{left:a,top:o}}const j2=({title:n,icon:e,buttonChildren:i,anchorRef:r,dialogDataTestId:a,children:o})=>{const u=R.useRef(null),f=r??u,[d,g]=R.useState(!1);return b.jsxs(b.Fragment,{children:[b.jsx(ct,{ref:u,icon:e,title:n,onClick:()=>g(m=>!m),children:i}),b.jsx(M2,{style:{backgroundColor:"var(--vscode-sideBar-background)",padding:"4px 8px"},open:d,verticalOffset:8,requestClose:()=>g(!1),anchor:f,dataTestId:a,children:o})]})},nw=({settings:n})=>b.jsx("div",{className:"vbox settings-view",children:n.map(e=>{const i=`setting-${e.name.replaceAll(/\s+/g,"-")}`;return b.jsx("div",{className:`setting setting-${e.type}`,title:e.title,children:L2(e,i)},e.name)})}),L2=(n,e)=>{switch(n.type){case"check":return b.jsxs(b.Fragment,{children:[b.jsx("input",{type:"checkbox",id:e,checked:n.value,onChange:()=>n.set(!n.value)}),b.jsxs("label",{htmlFor:e,children:[n.name,!!n.count&&b.jsx("span",{className:"setting-counter",children:n.count})]})]});case"select":return b.jsxs(b.Fragment,{children:[b.jsxs("label",{htmlFor:e,children:[n.name,":",!!n.count&&b.jsx("span",{className:"setting-counter",children:n.count})]}),b.jsx("select",{id:e,value:n.value,onChange:i=>n.set(i.target.value),children:n.options.map(i=>b.jsx("option",{value:i.value,children:i.label},i.value))})]});default:return null}},K2=n=>{var i;const e=z2((i=n.model)==null?void 0:i.traceUri);return b.jsx(J0.Provider,{value:n.model,children:b.jsx(R2,{partition:e,...n})})},R2=n=>{var Sl;const{partition:e,model:i,showSourcesFirst:r,rootDir:a,fallbackLocation:o,isLive:u,hideTimeline:f,status:d,annotations:g,inert:m,onOpenExternally:y,revealSource:S,testRunMetadata:w}=n,[E,x]=jt("navigatorTab","actions"),[_,A]=jt("propertiesTab",r?"source":"call"),[C,H]=jt("propertiesSidebarLocation","bottom"),[V]=jt("actionsFilter",[]),[K,Q]=or("selectedCallId"),[j,I]=or("selectedTime"),[O,P]=or("highlightedCallId"),[J,$]=or("revealedErrorKey"),[ee,ce]=or("revealedAttachmentCallId"),[Me,q]=or("treeState",{expandedItems:new Map}),[Z,re]=R.useState("");wx(e);const[me,Ee]=R.useState({lastEdited:"none"}),[M,X]=R.useState(!1),[W,te]=R.useState(void 0),ue=R.useCallback(le=>{Q(le==null?void 0:le.callId),$(void 0)},[Q,$]),se=R.useMemo(()=>i==null?void 0:i.filteredActions(V),[i,V]),xe=((i==null?void 0:i.actions.length)??0)-((se==null?void 0:se.length)??0),nt=R.useMemo(()=>se==null?void 0:se.find(le=>le.callId===O),[se,O]),Re=R.useCallback(le=>{P(le==null?void 0:le.callId)},[P]),Rn=R.useMemo(()=>(i==null?void 0:i.sources)||new Map,[i]);R.useEffect(()=>{I(void 0),$(void 0)},[i,I,$]);const fe=R.useMemo(()=>{if(K){const Tn=se==null?void 0:se.find(sn=>sn.callId===K);if(Tn)return Tn}const le=i==null?void 0:i.failedAction();if(le)return le;if(se!=null&&se.length){let Tn=se.length-1;for(let sn=0;sn<se.length;++sn)if(se[sn].title==="After Hooks"&&sn){Tn=sn-1;break}return se[Tn]}},[i,se,K]),_e=R.useMemo(()=>nt||fe,[fe,nt]),Ue=R.useCallback(le=>{ue(le),Re(void 0)},[ue,Re]),{boundaries:He}=R.useMemo(()=>{const le={minimum:(i==null?void 0:i.startTime)||0,maximum:(i==null?void 0:i.endTime)||3e4};return le.minimum>le.maximum&&(le.minimum=0,le.maximum=3e4),le.maximum+=(le.maximum-le.minimum)/20,{boundaries:le}},[i]),Xt=a2(se||[],fe,Ue,j,He),Ye=R.useCallback(le=>{A(le),le!=="inspector"&&X(!1)},[A]),Yt=R.useCallback(le=>{!M&&le&&Ye("inspector"),X(le)},[X,Ye,M]),bs=R.useCallback(le=>{Ee(le),Ye("inspector")},[Ye]),qr=R.useCallback(le=>{Ye("attachments"),ce({callId:le})},[Ye,ce]);R.useEffect(()=>{S&&Ye("source")},[S,Ye]);const vs=aE(i,j),Ss=qE(i,j),ws=nE(i),qc=R.useMemo(()=>{var le;return J!==void 0?(le=ws.errors.get(J))==null?void 0:le.stack:_e==null?void 0:_e.stack},[_e,J,ws]),it=(i==null?void 0:i.sdkLanguage)||"javascript",$c={id:"inspector",title:"Locator",render:()=>b.jsx(k2,{sdkLanguage:it,isInspecting:M,setIsInspecting:Yt,highlightedElement:me,setHighlightedElement:Ee})},yl={id:"call",title:"Call",render:()=>b.jsx(M_,{action:_e,startTimeOffset:(i==null?void 0:i.startTime)??0,sdkLanguage:it})},bl={id:"log",title:"Log",render:()=>b.jsx(L_,{action:_e,isLive:u})},xs={id:"errors",title:"Errors",errorCount:ws.errors.size,render:()=>b.jsx(sE,{errorsModel:ws,testRunMetadata:w,sdkLanguage:it,revealInSource:le=>{le.action?ue(le.action):$(le.message),Ye("source")},wallTime:(i==null?void 0:i.wallTime)??0})};let vl;!fe&&o&&(vl=(Sl=o.source)==null?void 0:Sl.errors.length);const _s={id:"source",title:"Source",errorCount:vl,render:()=>b.jsx(v2,{stack:qc,sources:Rn,rootDir:a,stackFrameLocation:C==="bottom"?"right":"bottom",fallbackLocation:o,onOpenExternally:y})},Ic={id:"console",title:"Console",count:vs.entries.length,render:()=>b.jsx(lE,{consoleModel:vs,boundaries:He,selectedTime:j,onEntryHovered:te,onAccepted:le=>I({minimum:le.timestamp,maximum:le.timestamp})})},Vc={id:"network",title:"Network",count:Ss.resources.length,render:()=>b.jsx($E,{boundaries:He,networkModel:Ss,onResourceHovered:te,sdkLanguage:(i==null?void 0:i.sdkLanguage)??"javascript"})},Bi={id:"attachments",title:"Attachments",count:i==null?void 0:i.visibleAttachments.length,render:()=>b.jsx(W_,{revealedAttachmentCallId:ee})},ft=[$c,yl,bl,xs,Ic,Vc,_s,Bi];if(g!==void 0){const le={id:"annotations",title:"Annotations",count:g.length,render:()=>b.jsx(N2,{annotations:g})};ft.push(le)}if(r){const le=ft.indexOf(_s);ft.splice(le,1),ft.splice(1,0,_s)}let Ft=0;!u&&i&&i.endTime>=0?Ft=i.endTime-i.startTime:i&&i.wallTime&&(Ft=Date.now()-i.wallTime);const kt={id:"actions",title:"Actions",component:b.jsxs("div",{className:"vbox",children:[d&&b.jsxs("div",{className:"workbench-run-status","data-testid":"workbench-run-status",children:[b.jsx("span",{className:ut("codicon",X0(d))}),b.jsx("div",{children:C_(d)}),b.jsx("div",{className:"spacer"}),b.jsx("div",{className:"workbench-run-duration",children:Ft?yt(Ft):""})]}),b.jsx("div",{className:"workbench-action-filter",children:b.jsx("input",{type:"search",placeholder:"Filter actions","aria-label":"Filter actions",spellCheck:!1,value:Z,onChange:le=>re(le.target.value)})}),b.jsx(k_,{sdkLanguage:it,actions:se||[],selectedAction:i?fe:void 0,selectedTime:j,setSelectedTime:I,treeState:Me,setTreeState:q,onSelected:Ue,onHighlighted:Re,revealActionAttachment:qr,revealConsole:()=>Ye("console"),isLive:u,actionFilterText:Z})]})},Gc={id:"metadata",title:"Metadata",component:b.jsx(C2,{model:i})},Kc=E==="actions"&&b.jsx(D2,{counters:i==null?void 0:i.actionCounters,hiddenActionsCount:xe});return b.jsxs("div",{className:"vbox workbench",...m?{inert:!0}:{},children:[!f&&b.jsx(T2,{model:i,boundaries:He,onSelected:Ue,sdkLanguage:it,selectedTime:j,setSelectedTime:I,highlightedTime:W,scrubber:b.jsx(o2,{playback:Xt})}),b.jsx(il,{sidebarSize:250,orientation:C==="bottom"?"vertical":"horizontal",settingName:"propertiesSidebar",main:b.jsx(il,{sidebarSize:250,orientation:"horizontal",sidebarIsFirst:!0,settingName:"actionListSidebar",main:b.jsx(c2,{action:_e,model:i,sdkLanguage:it,testIdAttributeName:(i==null?void 0:i.testIdAttributeName)||"data-testid",isInspecting:M,setIsInspecting:Yt,highlightedElement:me,setHighlightedElement:bs,playback:Xt}),sidebar:b.jsx(oc,{tabs:[kt,Gc],rightToolbar:[Kc],selectedTab:E,setSelectedTab:x})}),sidebar:b.jsx(oc,{tabs:ft,selectedTab:_,setSelectedTab:Ye,rightToolbar:[C==="bottom"?b.jsx(ct,{title:"Dock to right",icon:"layout-sidebar-right-off",onClick:()=>{H("right")}}):b.jsx(ct,{title:"Dock to bottom",icon:"layout-panel-off",onClick:()=>{H("bottom")}})],mode:C==="bottom"?"default":"select"})})]})},D2=({counters:n,hiddenActionsCount:e})=>{const[i,r]=jt("actionsFilter",[]),a=R.useRef(null),o=b.jsxs(b.Fragment,{children:[e>0&&b.jsxs("span",{className:"workbench-actions-hidden-count",title:e+" actions hidden by filters",children:[e," hidden"]}),b.jsx("span",{ref:a,className:"codicon codicon-filter"})]});return b.jsx(j2,{title:"Filter actions",dialogDataTestId:"actions-filter-dialog",buttonChildren:o,anchorRef:a,children:b.jsx(nw,{settings:[{type:"check",value:i.includes("getter"),set:u=>r(u?[...i,"getter"]:i.filter(f=>f!=="getter")),name:"Getters",count:n==null?void 0:n.get("getter")},{type:"check",value:i.includes("route"),set:u=>r(u?[...i,"route"]:i.filter(f=>f!=="route")),name:"Network routes",count:n==null?void 0:n.get("route")},{type:"check",value:i.includes("configuration"),set:u=>r(u?[...i,"configuration"]:i.filter(f=>f!=="configuration")),name:"Configuration",count:n==null?void 0:n.get("configuration")}]})})};function z2(n){if(!n)return"default";const e=new URL(n,"http://localhost");return e.searchParams.delete("timestamp"),e.toString()}var c0;(n=>{function e(i){for(const r of i.splice(0))r.dispose()}n.disposeAll=e})(c0||(c0={}));class pr{constructor(){this._listeners=new Set,this.event=(e,i)=>{this._listeners.add(e);let r=!1;const a=this,o={dispose(){r||(r=!0,a._listeners.delete(e))}};return i&&i.push(o),o}}fire(e){const i=!this._deliveryQueue;this._deliveryQueue||(this._deliveryQueue=[]);for(const r of this._listeners)this._deliveryQueue.push({listener:r,event:e});if(i){for(let r=0;r<this._deliveryQueue.length;r++){const{listener:a,event:o}=this._deliveryQueue[r];a.call(null,o)}this._deliveryQueue=void 0}}dispose(){this._listeners.clear(),this._deliveryQueue&&(this._deliveryQueue=[])}}class U2 extends Error{}class X2{constructor(e){this._ws=new WebSocket(e)}onmessage(e){this._ws.addEventListener("message",i=>e(i.data.toString()))}onopen(e){this._ws.addEventListener("open",e)}onerror(e){this._ws.addEventListener("error",e)}onclose(e){this._ws.addEventListener("close",e)}send(e){this._ws.send(e)}close(){this._ws.close()}}class Y2{constructor(e){this._onCloseEmitter=new pr,this._onReportEmitter=new pr,this._onStdioEmitter=new pr,this._onTestFilesChangedEmitter=new pr,this._onLoadTraceRequestedEmitter=new pr,this._onTestPausedEmitter=new pr,this._lastId=0,this._callbacks=new Map,this._isClosed=!1,this.onClose=this._onCloseEmitter.event,this.onReport=this._onReportEmitter.event,this.onStdio=this._onStdioEmitter.event,this.onTestFilesChanged=this._onTestFilesChangedEmitter.event,this.onLoadTraceRequested=this._onLoadTraceRequestedEmitter.event,this.onTestPaused=this._onTestPausedEmitter.event,this._transport=e,this._transport.onmessage(r=>{const a=JSON.parse(r),{id:o,result:u,error:f,method:d,params:g}=a;if(o){const m=this._callbacks.get(o);if(!m)return;this._callbacks.delete(o),f?m.reject(new Error(f)):m.resolve(u)}else this._dispatchEvent(d,g)});const i=setInterval(()=>this._sendMessage("ping").catch(()=>{}),3e4);this._connectedPromise=new Promise((r,a)=>{this._transport.onopen(r),this._transport.onerror(a)}),this._transport.onclose(()=>{this._isClosed=!0,this._onCloseEmitter.fire(),clearInterval(i);for(const r of this._callbacks.values())r.reject(r.error);this._callbacks.clear()})}isClosed(){return this._isClosed}async _sendMessage(e,i){const r=globalThis.__logForTest;r==null||r({method:e,params:i}),await this._connectedPromise;const a=++this._lastId,o={id:a,method:e,params:i},u=new U2(`${e}: test server connection closed`);return this._transport.send(JSON.stringify(o)),new Promise((f,d)=>{this._callbacks.set(a,{resolve:f,reject:d,error:u})})}_sendMessageNoReply(e,i){this._sendMessage(e,i).catch(()=>{})}_dispatchEvent(e,i){e==="report"?this._onReportEmitter.fire(i):e==="stdio"?this._onStdioEmitter.fire(i):e==="testFilesChanged"?this._onTestFilesChangedEmitter.fire(i):e==="loadTraceRequested"?this._onLoadTraceRequestedEmitter.fire(i):e==="testPaused"&&this._onTestPausedEmitter.fire(i)}async initialize(e){await this._sendMessage("initialize",e)}async ping(e){await this._sendMessage("ping",e)}async pingNoReply(e){this._sendMessageNoReply("ping",e)}async watch(e){await this._sendMessage("watch",e)}watchNoReply(e){this._sendMessageNoReply("watch",e)}async open(e){await this._sendMessage("open",e)}openNoReply(e){this._sendMessageNoReply("open",e)}async resizeTerminal(e){await this._sendMessage("resizeTerminal",e)}resizeTerminalNoReply(e){this._sendMessageNoReply("resizeTerminal",e)}async checkBrowsers(e){return await this._sendMessage("checkBrowsers",e)}async installBrowsers(e){await this._sendMessage("installBrowsers",e)}async runGlobalSetup(e){return await this._sendMessage("runGlobalSetup",e)}async runGlobalTeardown(e){return await this._sendMessage("runGlobalTeardown",e)}async clearCache(e){return await this._sendMessage("clearCache",e)}async listFiles(e){return await this._sendMessage("listFiles",e)}async listTests(e){return await this._sendMessage("listTests",e)}async runTests(e){return await this._sendMessage("runTests",e)}async findRelatedTestFiles(e){return await this._sendMessage("findRelatedTestFiles",e)}async stopTests(e){await this._sendMessage("stopTests",e)}stopTestsNoReply(e){this._sendMessageNoReply("stopTests",e)}async closeGracefully(e){await this._sendMessage("closeGracefully",e)}close(){try{this._transport.close()}catch{}}}const F2=({location:n})=>{const[e,i]=jt("shouldPopulateCanvasFromScreenshot",!1),[r,a]=Cx(),[o,u]=jt("mergeFiles",!1);return b.jsx(nw,{settings:[{type:"select",value:r,set:a,name:"Theme",options:Tx},...n==="ui-mode"?[{type:"check",value:o,set:u,name:"Merge files"}]:[],{type:"check",value:e,set:i,name:"Display canvas content",title:"Attempt to display the captured canvas appearance in the snapshot preview. May not be accurate."}]})};export{j2 as D,Q0 as E,Et as R,il as S,V2 as T,X2 as W,I_ as _,Y2 as a,F2 as b,K2 as c,M2 as d,B2 as e,I2 as f,Ax as g,q2 as h,$2 as i,b as j,ut as k,T_ as l,yt as m,dl as n,ct as o,jt as p,nw as q,R as r,ls as s,X0 as t,gs as u,yx as v};
(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const e of document.querySelectorAll('link[rel="modulepreload"]'))s(e);new MutationObserver(e=>{for(const t of e)if(t.type==="childList")for(const o of t.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&s(o)}).observe(document,{childList:!0,subtree:!0});function n(e){const t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin==="use-credentials"?t.credentials="include":e.crossOrigin==="anonymous"?t.credentials="omit":t.credentials="same-origin",t}function s(e){if(e.ep)return;e.ep=!0;const t=n(e);fetch(e.href,t)}})();function c(i,r){try{return["http:","https:"].includes(new URL(i,r).protocol)}catch{return!1}}export{c as i};
var fe={exports:{}},pe;function be(){return pe||(pe=1,(function(ce,Se){(function(ie,Y){ce.exports=Y()})(globalThis,(()=>(()=>{var ie={4567:function(O,r,a){var l=this&&this.__decorate||function(e,t,o,f){var u,p=arguments.length,c=p<3?t:f===null?f=Object.getOwnPropertyDescriptor(t,o):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(e,t,o,f);else for(var m=e.length-1;m>=0;m--)(u=e[m])&&(c=(p<3?u(c):p>3?u(t,o,c):u(t,o))||c);return p>3&&c&&Object.defineProperty(t,o,c),c},_=this&&this.__param||function(e,t){return function(o,f){t(o,f,e)}};Object.defineProperty(r,"__esModule",{value:!0}),r.AccessibilityManager=void 0;const n=a(9042),d=a(9924),v=a(844),g=a(4725),h=a(2585),i=a(3656);let s=r.AccessibilityManager=class extends v.Disposable{constructor(e,t,o,f){super(),this._terminal=e,this._coreBrowserService=o,this._renderService=f,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let u=0;u<this._terminal.rows;u++)this._rowElements[u]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[u]);if(this._topBoundaryFocusListener=u=>this._handleBoundaryFocus(u,0),this._bottomBoundaryFocusListener=u=>this._handleBoundaryFocus(u,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new d.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize((u=>this._handleResize(u.rows)))),this.register(this._terminal.onRender((u=>this._refreshRows(u.start,u.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((u=>this._handleChar(u)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
`)))),this.register(this._terminal.onA11yTab((u=>this._handleTab(u)))),this.register(this._terminal.onKey((u=>this._handleKey(u.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,i.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,v.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(e){for(let t=0;t<e;t++)this._handleChar(" ")}_handleChar(e){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===`
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=n.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(e){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(e)||this._charsToConsume.push(e)}_refreshRows(e,t){this._liveRegionDebouncer.refresh(e,t,this._terminal.rows)}_renderRows(e,t){const o=this._terminal.buffer,f=o.lines.length.toString();for(let u=e;u<=t;u++){const p=o.lines.get(o.ydisp+u),c=[],m=(p==null?void 0:p.translateToString(!0,void 0,void 0,c))||"",y=(o.ydisp+u+1).toString(),k=this._rowElements[u];k&&(m.length===0?(k.innerText="Â ",this._rowColumns.set(k,[0,1])):(k.textContent=m,this._rowColumns.set(k,c)),k.setAttribute("aria-posinset",y),k.setAttribute("aria-setsize",f))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(e,t){const o=e.target,f=this._rowElements[t===0?1:this._rowElements.length-2];if(o.getAttribute("aria-posinset")===(t===0?"1":`${this._terminal.buffer.lines.length}`)||e.relatedTarget!==f)return;let u,p;if(t===0?(u=o,p=this._rowElements.pop(),this._rowContainer.removeChild(p)):(u=this._rowElements.shift(),p=o,this._rowContainer.removeChild(u)),u.removeEventListener("focus",this._topBoundaryFocusListener),p.removeEventListener("focus",this._bottomBoundaryFocusListener),t===0){const c=this._createAccessibilityTreeNode();this._rowElements.unshift(c),this._rowContainer.insertAdjacentElement("afterbegin",c)}else{const c=this._createAccessibilityTreeNode();this._rowElements.push(c),this._rowContainer.appendChild(c)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(t===0?-1:1),this._rowElements[t===0?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}_handleSelectionChange(){var m;if(this._rowElements.length===0)return;const e=document.getSelection();if(!e)return;if(e.isCollapsed)return void(this._rowContainer.contains(e.anchorNode)&&this._terminal.clearSelection());if(!e.anchorNode||!e.focusNode)return void console.error("anchorNode and/or focusNode are null");let t={node:e.anchorNode,offset:e.anchorOffset},o={node:e.focusNode,offset:e.focusOffset};if((t.node.compareDocumentPosition(o.node)&Node.DOCUMENT_POSITION_PRECEDING||t.node===o.node&&t.offset>o.offset)&&([t,o]=[o,t]),t.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(t={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(t.node))return;const f=this._rowElements.slice(-1)[0];if(o.node.compareDocumentPosition(f)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(o={node:f,offset:((m=f.textContent)==null?void 0:m.length)??0}),!this._rowContainer.contains(o.node))return;const u=({node:y,offset:k})=>{const L=y instanceof Text?y.parentNode:y;let w=parseInt(L==null?void 0:L.getAttribute("aria-posinset"),10)-1;if(isNaN(w))return console.warn("row is invalid. Race condition?"),null;const x=this._rowColumns.get(L);if(!x)return console.warn("columns is null. Race condition?"),null;let B=k<x.length?x[k]:x.slice(-1)[0]+1;return B>=this._terminal.cols&&(++w,B=0),{row:w,column:B}},p=u(t),c=u(o);if(p&&c){if(p.row>c.row||p.row===c.row&&p.column>=c.column)throw new Error("invalid range");this._terminal.select(p.column,p.row,(c.row-p.row)*this._terminal.cols-p.column+c.column)}}_handleResize(e){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let t=this._rowContainer.children.length;t<this._terminal.rows;t++)this._rowElements[t]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[t]);for(;this._rowElements.length>e;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const e=this._coreBrowserService.mainDocument.createElement("div");return e.setAttribute("role","listitem"),e.tabIndex=-1,this._refreshRowDimensions(e),e}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let e=0;e<this._terminal.rows;e++)this._refreshRowDimensions(this._rowElements[e])}}_refreshRowDimensions(e){e.style.height=`${this._renderService.dimensions.css.cell.height}px`}};r.AccessibilityManager=s=l([_(1,h.IInstantiationService),_(2,g.ICoreBrowserService),_(3,g.IRenderService)],s)},3614:(O,r)=>{function a(d){return d.replace(/\r?\n/g,"\r")}function l(d,v){return v?"\x1B[200~"+d+"\x1B[201~":d}function _(d,v,g,h){d=l(d=a(d),g.decPrivateModes.bracketedPasteMode&&h.rawOptions.ignoreBracketedPasteMode!==!0),g.triggerDataEvent(d,!0),v.value=""}function n(d,v,g){const h=g.getBoundingClientRect(),i=d.clientX-h.left-10,s=d.clientY-h.top-10;v.style.width="20px",v.style.height="20px",v.style.left=`${i}px`,v.style.top=`${s}px`,v.style.zIndex="1000",v.focus()}Object.defineProperty(r,"__esModule",{value:!0}),r.rightClickHandler=r.moveTextAreaUnderMouseCursor=r.paste=r.handlePasteEvent=r.copyHandler=r.bracketTextForPaste=r.prepareTextForTerminal=void 0,r.prepareTextForTerminal=a,r.bracketTextForPaste=l,r.copyHandler=function(d,v){d.clipboardData&&d.clipboardData.setData("text/plain",v.selectionText),d.preventDefault()},r.handlePasteEvent=function(d,v,g,h){d.stopPropagation(),d.clipboardData&&_(d.clipboardData.getData("text/plain"),v,g,h)},r.paste=_,r.moveTextAreaUnderMouseCursor=n,r.rightClickHandler=function(d,v,g,h,i){n(d,v,g),i&&h.rightClickSelect(d),v.value=h.selectionText,v.select()}},7239:(O,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ColorContrastCache=void 0;const l=a(1505);r.ColorContrastCache=class{constructor(){this._color=new l.TwoKeyMap,this._css=new l.TwoKeyMap}setCss(_,n,d){this._css.set(_,n,d)}getCss(_,n){return this._css.get(_,n)}setColor(_,n,d){this._color.set(_,n,d)}getColor(_,n){return this._color.get(_,n)}clear(){this._color.clear(),this._css.clear()}}},3656:(O,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.addDisposableDomListener=void 0,r.addDisposableDomListener=function(a,l,_,n){a.addEventListener(l,_,n);let d=!1;return{dispose:()=>{d||(d=!0,a.removeEventListener(l,_,n))}}}},3551:function(O,r,a){var l=this&&this.__decorate||function(s,e,t,o){var f,u=arguments.length,p=u<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,t):o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(s,e,t,o);else for(var c=s.length-1;c>=0;c--)(f=s[c])&&(p=(u<3?f(p):u>3?f(e,t,p):f(e,t))||p);return u>3&&p&&Object.defineProperty(e,t,p),p},_=this&&this.__param||function(s,e){return function(t,o){e(t,o,s)}};Object.defineProperty(r,"__esModule",{value:!0}),r.Linkifier=void 0;const n=a(3656),d=a(8460),v=a(844),g=a(2585),h=a(4725);let i=r.Linkifier=class extends v.Disposable{get currentLink(){return this._currentLink}constructor(s,e,t,o,f){super(),this._element=s,this._mouseService=e,this._renderService=t,this._bufferService=o,this._linkProviderService=f,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new d.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new d.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,v.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,v.toDisposable)((()=>{var u;this._lastMouseEvent=void 0,(u=this._activeProviderReplies)==null||u.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,n.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,n.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,n.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,n.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(s){this._lastMouseEvent=s;const e=this._positionFromMouseEvent(s,this._element,this._mouseService);if(!e)return;this._isMouseOut=!1;const t=s.composedPath();for(let o=0;o<t.length;o++){const f=t[o];if(f.classList.contains("xterm"))break;if(f.classList.contains("xterm-hover"))return}this._lastBufferCell&&e.x===this._lastBufferCell.x&&e.y===this._lastBufferCell.y||(this._handleHover(e),this._lastBufferCell=e)}_handleHover(s){if(this._activeLine!==s.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(s,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,s)||(this._clearCurrentLink(),this._askForLink(s,!0))}_askForLink(s,e){var o,f;this._activeProviderReplies&&e||((o=this._activeProviderReplies)==null||o.forEach((u=>{u==null||u.forEach((p=>{p.link.dispose&&p.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=s.y);let t=!1;for(const[u,p]of this._linkProviderService.linkProviders.entries())e?(f=this._activeProviderReplies)!=null&&f.get(u)&&(t=this._checkLinkProviderResult(u,s,t)):p.provideLinks(s.y,(c=>{var y,k;if(this._isMouseOut)return;const m=c==null?void 0:c.map((L=>({link:L})));(y=this._activeProviderReplies)==null||y.set(u,m),t=this._checkLinkProviderResult(u,s,t),((k=this._activeProviderReplies)==null?void 0:k.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(s.y,this._activeProviderReplies)}))}_removeIntersectingLinks(s,e){const t=new Set;for(let o=0;o<e.size;o++){const f=e.get(o);if(f)for(let u=0;u<f.length;u++){const p=f[u],c=p.link.range.start.y<s?0:p.link.range.start.x,m=p.link.range.end.y>s?this._bufferService.cols:p.link.range.end.x;for(let y=c;y<=m;y++){if(t.has(y)){f.splice(u--,1);break}t.add(y)}}}}_checkLinkProviderResult(s,e,t){var u;if(!this._activeProviderReplies)return t;const o=this._activeProviderReplies.get(s);let f=!1;for(let p=0;p<s;p++)this._activeProviderReplies.has(p)&&!this._activeProviderReplies.get(p)||(f=!0);if(!f&&o){const p=o.find((c=>this._linkAtPosition(c.link,e)));p&&(t=!0,this._handleNewLink(p))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!t)for(let p=0;p<this._activeProviderReplies.size;p++){const c=(u=this._activeProviderReplies.get(p))==null?void 0:u.find((m=>this._linkAtPosition(m.link,e)));if(c){t=!0,this._handleNewLink(c);break}}return t}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(s){if(!this._currentLink)return;const e=this._positionFromMouseEvent(s,this._element,this._mouseService);e&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,e)&&this._currentLink.link.activate(s,this._currentLink.link.text)}_clearCurrentLink(s,e){this._currentLink&&this._lastMouseEvent&&(!s||!e||this._currentLink.link.range.start.y>=s&&this._currentLink.link.range.end.y<=e)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,v.disposeArray)(this._linkCacheDisposables))}_handleNewLink(s){if(!this._lastMouseEvent)return;const e=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);e&&this._linkAtPosition(s.link,e)&&(this._currentLink=s,this._currentLink.state={decorations:{underline:s.link.decorations===void 0||s.link.decorations.underline,pointerCursor:s.link.decorations===void 0||s.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,s.link,this._lastMouseEvent),s.link.decorations={},Object.defineProperties(s.link.decorations,{pointerCursor:{get:()=>{var t,o;return(o=(t=this._currentLink)==null?void 0:t.state)==null?void 0:o.decorations.pointerCursor},set:t=>{var o;(o=this._currentLink)!=null&&o.state&&this._currentLink.state.decorations.pointerCursor!==t&&(this._currentLink.state.decorations.pointerCursor=t,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",t))}},underline:{get:()=>{var t,o;return(o=(t=this._currentLink)==null?void 0:t.state)==null?void 0:o.decorations.underline},set:t=>{var o,f,u;(o=this._currentLink)!=null&&o.state&&((u=(f=this._currentLink)==null?void 0:f.state)==null?void 0:u.decorations.underline)!==t&&(this._currentLink.state.decorations.underline=t,this._currentLink.state.isHovered&&this._fireUnderlineEvent(s.link,t))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((t=>{if(!this._currentLink)return;const o=t.start===0?0:t.start+1+this._bufferService.buffer.ydisp,f=this._bufferService.buffer.ydisp+1+t.end;if(this._currentLink.link.range.start.y>=o&&this._currentLink.link.range.end.y<=f&&(this._clearCurrentLink(o,f),this._lastMouseEvent)){const u=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);u&&this._askForLink(u,!1)}}))))}_linkHover(s,e,t){var o;(o=this._currentLink)!=null&&o.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(e,!0),this._currentLink.state.decorations.pointerCursor&&s.classList.add("xterm-cursor-pointer")),e.hover&&e.hover(t,e.text)}_fireUnderlineEvent(s,e){const t=s.range,o=this._bufferService.buffer.ydisp,f=this._createLinkUnderlineEvent(t.start.x-1,t.start.y-o-1,t.end.x,t.end.y-o-1,void 0);(e?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(f)}_linkLeave(s,e,t){var o;(o=this._currentLink)!=null&&o.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(e,!1),this._currentLink.state.decorations.pointerCursor&&s.classList.remove("xterm-cursor-pointer")),e.leave&&e.leave(t,e.text)}_linkAtPosition(s,e){const t=s.range.start.y*this._bufferService.cols+s.range.start.x,o=s.range.end.y*this._bufferService.cols+s.range.end.x,f=e.y*this._bufferService.cols+e.x;return t<=f&&f<=o}_positionFromMouseEvent(s,e,t){const o=t.getCoords(s,e,this._bufferService.cols,this._bufferService.rows);if(o)return{x:o[0],y:o[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(s,e,t,o,f){return{x1:s,y1:e,x2:t,y2:o,cols:this._bufferService.cols,fg:f}}};r.Linkifier=i=l([_(1,h.IMouseService),_(2,h.IRenderService),_(3,g.IBufferService),_(4,h.ILinkProviderService)],i)},9042:(O,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.tooMuchOutput=r.promptLabel=void 0,r.promptLabel="Terminal input",r.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(O,r,a){var l=this&&this.__decorate||function(h,i,s,e){var t,o=arguments.length,f=o<3?i:e===null?e=Object.getOwnPropertyDescriptor(i,s):e;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")f=Reflect.decorate(h,i,s,e);else for(var u=h.length-1;u>=0;u--)(t=h[u])&&(f=(o<3?t(f):o>3?t(i,s,f):t(i,s))||f);return o>3&&f&&Object.defineProperty(i,s,f),f},_=this&&this.__param||function(h,i){return function(s,e){i(s,e,h)}};Object.defineProperty(r,"__esModule",{value:!0}),r.OscLinkProvider=void 0;const n=a(511),d=a(2585);let v=r.OscLinkProvider=class{constructor(h,i,s){this._bufferService=h,this._optionsService=i,this._oscLinkService=s}provideLinks(h,i){var m;const s=this._bufferService.buffer.lines.get(h-1);if(!s)return void i(void 0);const e=[],t=this._optionsService.rawOptions.linkHandler,o=new n.CellData,f=s.getTrimmedLength();let u=-1,p=-1,c=!1;for(let y=0;y<f;y++)if(p!==-1||s.hasContent(y)){if(s.loadCell(y,o),o.hasExtendedAttrs()&&o.extended.urlId){if(p===-1){p=y,u=o.extended.urlId;continue}c=o.extended.urlId!==u}else p!==-1&&(c=!0);if(c||p!==-1&&y===f-1){const k=(m=this._oscLinkService.getLinkData(u))==null?void 0:m.uri;if(k){const L={start:{x:p+1,y:h},end:{x:y+(c||y!==f-1?0:1),y:h}};let w=!1;if(!(t!=null&&t.allowNonHttpProtocols))try{const x=new URL(k);["http:","https:"].includes(x.protocol)||(w=!0)}catch{w=!0}w||e.push({text:k,range:L,activate:(x,B)=>t?t.activate(x,B,L):g(0,B),hover:(x,B)=>{var P;return(P=t==null?void 0:t.hover)==null?void 0:P.call(t,x,B,L)},leave:(x,B)=>{var P;return(P=t==null?void 0:t.leave)==null?void 0:P.call(t,x,B,L)}})}c=!1,o.hasExtendedAttrs()&&o.extended.urlId?(p=y,u=o.extended.urlId):(p=-1,u=-1)}}i(e)}};function g(h,i){if(confirm(`Do you want to navigate to ${i}?

WARNING: This link could potentially be dangerous`)){const s=window.open();if(s){try{s.opener=null}catch{}s.location.href=i}else console.warn("Opening link blocked as opener could not be cleared")}}r.OscLinkProvider=v=l([_(0,d.IBufferService),_(1,d.IOptionsService),_(2,d.IOscLinkService)],v)},6193:(O,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.RenderDebouncer=void 0,r.RenderDebouncer=class{constructor(a,l){this._renderCallback=a,this._coreBrowserService=l,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(a){return this._refreshCallbacks.push(a),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(a,l,_){this._rowCount=_,a=a!==void 0?a:0,l=l!==void 0?l:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,a):a,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,l):l,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();const a=Math.max(this._rowStart,0),l=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(a,l),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const a of this._refreshCallbacks)a(0);this._refreshCallbacks=[]}}},3236:(O,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Terminal=void 0;const l=a(3614),_=a(3656),n=a(3551),d=a(9042),v=a(3730),g=a(1680),h=a(3107),i=a(5744),s=a(2950),e=a(1296),t=a(428),o=a(4269),f=a(5114),u=a(8934),p=a(3230),c=a(9312),m=a(4725),y=a(6731),k=a(8055),L=a(8969),w=a(8460),x=a(844),B=a(6114),P=a(8437),U=a(2584),I=a(7399),S=a(5941),b=a(9074),E=a(2585),D=a(5435),T=a(4567),H=a(779);class N extends L.CoreTerminal{get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}constructor(R={}){super(R),this.browser=B,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new x.MutableDisposable),this._onCursorMove=this.register(new w.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new w.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new w.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new w.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new w.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new w.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new w.EventEmitter),this._onBlur=this.register(new w.EventEmitter),this._onA11yCharEmitter=this.register(new w.EventEmitter),this._onA11yTabEmitter=this.register(new w.EventEmitter),this._onWillOpen=this.register(new w.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(b.DecorationService),this._instantiationService.setService(E.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(H.LinkProviderService),this._instantiationService.setService(m.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(v.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((C,M)=>this.refresh(C,M)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((C=>this._reportWindowsOptions(C)))),this.register(this._inputHandler.onColor((C=>this._handleColorEvent(C)))),this.register((0,w.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,w.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,w.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,w.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((C=>this._afterResize(C.cols,C.rows)))),this.register((0,x.toDisposable)((()=>{var C,M;this._customKeyEventHandler=void 0,(M=(C=this.element)==null?void 0:C.parentNode)==null||M.removeChild(this.element)})))}_handleColorEvent(R){if(this._themeService)for(const C of R){let M,A="";switch(C.index){case 256:M="foreground",A="10";break;case 257:M="background",A="11";break;case 258:M="cursor",A="12";break;default:M="ansi",A="4;"+C.index}switch(C.type){case 0:const W=k.color.toColorRGB(M==="ansi"?this._themeService.colors.ansi[C.index]:this._themeService.colors[M]);this.coreService.triggerDataEvent(`${U.C0.ESC}]${A};${(0,S.toRgbString)(W)}${U.C1_ESCAPED.ST}`);break;case 1:if(M==="ansi")this._themeService.modifyColors((F=>F.ansi[C.index]=k.channels.toColor(...C.color)));else{const F=M;this._themeService.modifyColors((z=>z[F]=k.channels.toColor(...C.color)))}break;case 2:this._themeService.restoreColor(C.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(R){R?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(T.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(R){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(U.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var R;return(R=this.textarea)==null?void 0:R.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(U.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;const R=this.buffer.ybase+this.buffer.y,C=this.buffer.lines.get(R);if(!C)return;const M=Math.min(this.buffer.x,this.cols-1),A=this._renderService.dimensions.css.cell.height,W=C.getWidth(M),F=this._renderService.dimensions.css.cell.width*W,z=this.buffer.y*this._renderService.dimensions.css.cell.height,q=M*this._renderService.dimensions.css.cell.width;this.textarea.style.left=q+"px",this.textarea.style.top=z+"px",this.textarea.style.width=F+"px",this.textarea.style.height=A+"px",this.textarea.style.lineHeight=A+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,_.addDisposableDomListener)(this.element,"copy",(C=>{this.hasSelection()&&(0,l.copyHandler)(C,this._selectionService)})));const R=C=>(0,l.handlePasteEvent)(C,this.textarea,this.coreService,this.optionsService);this.register((0,_.addDisposableDomListener)(this.textarea,"paste",R)),this.register((0,_.addDisposableDomListener)(this.element,"paste",R)),B.isFirefox?this.register((0,_.addDisposableDomListener)(this.element,"mousedown",(C=>{C.button===2&&(0,l.rightClickHandler)(C,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,_.addDisposableDomListener)(this.element,"contextmenu",(C=>{(0,l.rightClickHandler)(C,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),B.isLinux&&this.register((0,_.addDisposableDomListener)(this.element,"auxclick",(C=>{C.button===1&&(0,l.moveTextAreaUnderMouseCursor)(C,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,_.addDisposableDomListener)(this.textarea,"keyup",(R=>this._keyUp(R)),!0)),this.register((0,_.addDisposableDomListener)(this.textarea,"keydown",(R=>this._keyDown(R)),!0)),this.register((0,_.addDisposableDomListener)(this.textarea,"keypress",(R=>this._keyPress(R)),!0)),this.register((0,_.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,_.addDisposableDomListener)(this.textarea,"compositionupdate",(R=>this._compositionHelper.compositionupdate(R)))),this.register((0,_.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,_.addDisposableDomListener)(this.textarea,"input",(R=>this._inputEvent(R)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(R){var M;if(!R)throw new Error("Terminal requires a parent element.");if(R.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((M=this.element)==null?void 0:M.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=R.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),R.appendChild(this.element);const C=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),C.appendChild(this._viewportElement),this._viewportScrollArea=this._document.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this.register((0,_.addDisposableDomListener)(this.screenElement,"mousemove",(A=>this.updateCursorStyle(A)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),C.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",d.promptLabel),B.isChromeOS||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._coreBrowserService=this.register(this._instantiationService.createInstance(f.CoreBrowserService,this.textarea,R.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(m.ICoreBrowserService,this._coreBrowserService),this.register((0,_.addDisposableDomListener)(this.textarea,"focus",(A=>this._handleTextAreaFocus(A)))),this.register((0,_.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(t.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(m.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(y.ThemeService),this._instantiationService.setService(m.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(o.CharacterJoinerService),this._instantiationService.setService(m.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(p.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(m.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((A=>this._onRender.fire(A)))),this.onResize((A=>this._renderService.resize(A.cols,A.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(s.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(u.MouseService),this._instantiationService.setService(m.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(n.Linkifier,this.screenElement)),this.element.appendChild(C);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(g.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((A=>this.scrollLines(A.amount,A.suppressScrollEvent,1))),this.register(this._inputHandler.onRequestSyncScrollBar((()=>this.viewport.syncScrollArea()))),this.register(this.viewport),this.register(this.onCursorMove((()=>{this._renderService.handleCursorMove(),this._syncTextArea()}))),this.register(this.onResize((()=>this._renderService.handleResize(this.cols,this.rows)))),this.register(this.onBlur((()=>this._renderService.handleBlur()))),this.register(this.onFocus((()=>this._renderService.handleFocus()))),this.register(this._renderService.onDimensionsChange((()=>this.viewport.syncScrollArea()))),this._selectionService=this.register(this._instantiationService.createInstance(c.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(m.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((A=>this.scrollLines(A.amount,A.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((A=>this._renderService.handleSelectionChanged(A.start,A.end,A.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((A=>{this.textarea.value=A,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((A=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,_.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(h.BufferDecorationRenderer,this.screenElement)),this.register((0,_.addDisposableDomListener)(this.element,"mousedown",(A=>this._selectionService.handleMouseDown(A)))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(T.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(A=>this._handleScreenReaderModeOptionChange(A)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(i.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(A=>{!this._overviewRulerRenderer&&A&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(i.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(e.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const R=this,C=this.element;function M(F){const z=R._mouseService.getMouseReportCoords(F,R.screenElement);if(!z)return!1;let q,V;switch(F.overrideType||F.type){case"mousemove":V=32,F.buttons===void 0?(q=3,F.button!==void 0&&(q=F.button<3?F.button:3)):q=1&F.buttons?0:4&F.buttons?1:2&F.buttons?2:3;break;case"mouseup":V=0,q=F.button<3?F.button:3;break;case"mousedown":V=1,q=F.button<3?F.button:3;break;case"wheel":if(R._customWheelEventHandler&&R._customWheelEventHandler(F)===!1||R.viewport.getLinesScrolled(F)===0)return!1;V=F.deltaY<0?0:1,q=4;break;default:return!1}return!(V===void 0||q===void 0||q>4)&&R.coreMouseService.triggerMouseEvent({col:z.col,row:z.row,x:z.x,y:z.y,button:q,action:V,ctrl:F.ctrlKey,alt:F.altKey,shift:F.shiftKey})}const A={mouseup:null,wheel:null,mousedrag:null,mousemove:null},W={mouseup:F=>(M(F),F.buttons||(this._document.removeEventListener("mouseup",A.mouseup),A.mousedrag&&this._document.removeEventListener("mousemove",A.mousedrag)),this.cancel(F)),wheel:F=>(M(F),this.cancel(F,!0)),mousedrag:F=>{F.buttons&&M(F)},mousemove:F=>{F.buttons||M(F)}};this.register(this.coreMouseService.onProtocolChange((F=>{F?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(F)),this.element.classList.add("enable-mouse-events"),this._selectionService.disable()):(this._logService.debug("Unbinding from mouse events."),this.element.classList.remove("enable-mouse-events"),this._selectionService.enable()),8&F?A.mousemove||(C.addEventListener("mousemove",W.mousemove),A.mousemove=W.mousemove):(C.removeEventListener("mousemove",A.mousemove),A.mousemove=null),16&F?A.wheel||(C.addEventListener("wheel",W.wheel,{passive:!1}),A.wheel=W.wheel):(C.removeEventListener("wheel",A.wheel),A.wheel=null),2&F?A.mouseup||(A.mouseup=W.mouseup):(this._document.removeEventListener("mouseup",A.mouseup),A.mouseup=null),4&F?A.mousedrag||(A.mousedrag=W.mousedrag):(this._document.removeEventListener("mousemove",A.mousedrag),A.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,_.addDisposableDomListener)(C,"mousedown",(F=>{if(F.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(F))return M(F),A.mouseup&&this._document.addEventListener("mouseup",A.mouseup),A.mousedrag&&this._document.addEventListener("mousemove",A.mousedrag),this.cancel(F)}))),this.register((0,_.addDisposableDomListener)(C,"wheel",(F=>{if(!A.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(F)===!1)return!1;if(!this.buffer.hasScrollback){const z=this.viewport.getLinesScrolled(F);if(z===0)return;const q=U.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(F.deltaY<0?"A":"B");let V="";for(let X=0;X<Math.abs(z);X++)V+=q;return this.coreService.triggerDataEvent(V,!0),this.cancel(F,!0)}return this.viewport.handleWheel(F)?this.cancel(F):void 0}}),{passive:!1})),this.register((0,_.addDisposableDomListener)(C,"touchstart",(F=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(F),this.cancel(F)}),{passive:!0})),this.register((0,_.addDisposableDomListener)(C,"touchmove",(F=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(F)?void 0:this.cancel(F)}),{passive:!1}))}refresh(R,C){var M;(M=this._renderService)==null||M.refreshRows(R,C)}updateCursorStyle(R){var C;(C=this._selectionService)!=null&&C.shouldColumnSelect(R)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(R,C,M=0){var A;M===1?(super.scrollLines(R,C,M),this.refresh(0,this.rows-1)):(A=this.viewport)==null||A.scrollLines(R)}paste(R){(0,l.paste)(R,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(R){this._customKeyEventHandler=R}attachCustomWheelEventHandler(R){this._customWheelEventHandler=R}registerLinkProvider(R){return this._linkProviderService.registerLinkProvider(R)}registerCharacterJoiner(R){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const C=this._characterJoinerService.register(R);return this.refresh(0,this.rows-1),C}deregisterCharacterJoiner(R){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(R)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(R){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+R)}registerDecoration(R){return this._decorationService.registerDecoration(R)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(R,C,M){this._selectionService.setSelection(R,C,M)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(this._selectionService&&this._selectionService.hasSelection)return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){var R;(R=this._selectionService)==null||R.clearSelection()}selectAll(){var R;(R=this._selectionService)==null||R.selectAll()}selectLines(R,C){var M;(M=this._selectionService)==null||M.selectLines(R,C)}_keyDown(R){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(R)===!1)return!1;const C=this.browser.isMac&&this.options.macOptionIsMeta&&R.altKey;if(!C&&!this._compositionHelper.keydown(R))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;C||R.key!=="Dead"&&R.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const M=(0,I.evaluateKeyboardEvent)(R,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(R),M.type===3||M.type===2){const A=this.rows-1;return this.scrollLines(M.type===2?-A:A),this.cancel(R,!0)}return M.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,R)||(M.cancel&&this.cancel(R,!0),!M.key||!!(R.key&&!R.ctrlKey&&!R.altKey&&!R.metaKey&&R.key.length===1&&R.key.charCodeAt(0)>=65&&R.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(M.key!==U.C0.ETX&&M.key!==U.C0.CR||(this.textarea.value=""),this._onKey.fire({key:M.key,domEvent:R}),this._showCursor(),this.coreService.triggerDataEvent(M.key,!0),!this.optionsService.rawOptions.screenReaderMode||R.altKey||R.ctrlKey?this.cancel(R,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(R,C){const M=R.isMac&&!this.options.macOptionIsMeta&&C.altKey&&!C.ctrlKey&&!C.metaKey||R.isWindows&&C.altKey&&C.ctrlKey&&!C.metaKey||R.isWindows&&C.getModifierState("AltGraph");return C.type==="keypress"?M:M&&(!C.keyCode||C.keyCode>47)}_keyUp(R){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(R)===!1||((function(C){return C.keyCode===16||C.keyCode===17||C.keyCode===18})(R)||this.focus(),this.updateCursorStyle(R),this._keyPressHandled=!1)}_keyPress(R){let C;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(R)===!1)return!1;if(this.cancel(R),R.charCode)C=R.charCode;else if(R.which===null||R.which===void 0)C=R.keyCode;else{if(R.which===0||R.charCode===0)return!1;C=R.which}return!(!C||(R.altKey||R.ctrlKey||R.metaKey)&&!this._isThirdLevelShift(this.browser,R)||(C=String.fromCharCode(C),this._onKey.fire({key:C,domEvent:R}),this._showCursor(),this.coreService.triggerDataEvent(C,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(R){if(R.data&&R.inputType==="insertText"&&(!R.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const C=R.data;return this.coreService.triggerDataEvent(C,!0),this.cancel(R),!0}return!1}resize(R,C){R!==this.cols||C!==this.rows?super.resize(R,C):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(R,C){var M,A;(M=this._charSizeService)==null||M.measure(),(A=this.viewport)==null||A.syncScrollArea(!0)}clear(){var R;if(this.buffer.ybase!==0||this.buffer.y!==0){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let C=1;C<this.rows;C++)this.buffer.lines.push(this.buffer.getBlankLine(P.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(R=this.viewport)==null||R.reset(),this.refresh(0,this.rows-1)}}reset(){var C,M;this.options.rows=this.rows,this.options.cols=this.cols;const R=this._customKeyEventHandler;this._setup(),super.reset(),(C=this._selectionService)==null||C.reset(),this._decorationService.reset(),(M=this.viewport)==null||M.reset(),this._customKeyEventHandler=R,this.refresh(0,this.rows-1)}clearTextureAtlas(){var R;(R=this._renderService)==null||R.clearTextureAtlas()}_reportFocus(){var R;(R=this.element)!=null&&R.classList.contains("focus")?this.coreService.triggerDataEvent(U.C0.ESC+"[I"):this.coreService.triggerDataEvent(U.C0.ESC+"[O")}_reportWindowsOptions(R){if(this._renderService)switch(R){case D.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const C=this._renderService.dimensions.css.canvas.width.toFixed(0),M=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${U.C0.ESC}[4;${M};${C}t`);break;case D.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const A=this._renderService.dimensions.css.cell.width.toFixed(0),W=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${U.C0.ESC}[6;${W};${A}t`)}}cancel(R,C){if(this.options.cancelEvents||C)return R.preventDefault(),R.stopPropagation(),!1}}r.Terminal=N},9924:(O,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.TimeBasedDebouncer=void 0,r.TimeBasedDebouncer=class{constructor(a,l=1e3){this._renderCallback=a,this._debounceThresholdMS=l,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(a,l,_){this._rowCount=_,a=a!==void 0?a:0,l=l!==void 0?l:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,a):a,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,l):l;const n=Date.now();if(n-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=n,this._innerRefresh();else if(!this._additionalRefreshRequested){const d=n-this._lastRefreshMs,v=this._debounceThresholdMS-d;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),v)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const a=Math.max(this._rowStart,0),l=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(a,l)}}},1680:function(O,r,a){var l=this&&this.__decorate||function(s,e,t,o){var f,u=arguments.length,p=u<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,t):o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(s,e,t,o);else for(var c=s.length-1;c>=0;c--)(f=s[c])&&(p=(u<3?f(p):u>3?f(e,t,p):f(e,t))||p);return u>3&&p&&Object.defineProperty(e,t,p),p},_=this&&this.__param||function(s,e){return function(t,o){e(t,o,s)}};Object.defineProperty(r,"__esModule",{value:!0}),r.Viewport=void 0;const n=a(3656),d=a(4725),v=a(8460),g=a(844),h=a(2585);let i=r.Viewport=class extends g.Disposable{constructor(s,e,t,o,f,u,p,c){super(),this._viewportElement=s,this._scrollArea=e,this._bufferService=t,this._optionsService=o,this._charSizeService=f,this._renderService=u,this._coreBrowserService=p,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new v.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,n.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((m=>this._activeBuffer=m.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((m=>this._renderDimensions=m))),this._handleThemeChange(c.colors),this.register(c.onChangeColors((m=>this._handleThemeChange(m)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(s){this._viewportElement.style.backgroundColor=s.background.css}reset(){this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._coreBrowserService.window.requestAnimationFrame((()=>this.syncScrollArea()))}_refresh(s){if(s)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderDimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderDimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const e=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==e&&(this._lastRecordedBufferHeight=e,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const s=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==s&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=s),this._refreshAnimationFrame=null}syncScrollArea(s=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(s);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(s)}_handleScroll(s){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});const e=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:e,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const s=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(s*(this._smoothScrollState.target-this._smoothScrollState.origin)),s<1?this._coreBrowserService.window.requestAnimationFrame((()=>this._smoothScroll())):this._clearSmoothScrollState()}_smoothScrollPercent(){return this._optionsService.rawOptions.smoothScrollDuration&&this._smoothScrollState.startTime?Math.max(Math.min((Date.now()-this._smoothScrollState.startTime)/this._optionsService.rawOptions.smoothScrollDuration,1),0):1}_clearSmoothScrollState(){this._smoothScrollState.startTime=0,this._smoothScrollState.origin=-1,this._smoothScrollState.target=-1}_bubbleScroll(s,e){const t=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(e<0&&this._viewportElement.scrollTop!==0||e>0&&t<this._lastRecordedBufferHeight)||(s.cancelable&&s.preventDefault(),!1)}handleWheel(s){const e=this._getPixelsScrolled(s);return e!==0&&(this._optionsService.rawOptions.smoothScrollDuration?(this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target===-1?this._smoothScrollState.target=this._viewportElement.scrollTop+e:this._smoothScrollState.target+=e,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=e,this._bubbleScroll(s,e))}scrollLines(s){if(s!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const e=s*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+e,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:s,suppressScrollEvent:!1})}_getPixelsScrolled(s){if(s.deltaY===0||s.shiftKey)return 0;let e=this._applyScrollModifier(s.deltaY,s);return s.deltaMode===WheelEvent.DOM_DELTA_LINE?e*=this._currentRowHeight:s.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(e*=this._currentRowHeight*this._bufferService.rows),e}getBufferElements(s,e){var c;let t,o="";const f=[],u=e??this._bufferService.buffer.lines.length,p=this._bufferService.buffer.lines;for(let m=s;m<u;m++){const y=p.get(m);if(!y)continue;const k=(c=p.get(m+1))==null?void 0:c.isWrapped;if(o+=y.translateToString(!k),!k||m===p.length-1){const L=document.createElement("div");L.textContent=o,f.push(L),o.length>0&&(t=L),o=""}}return{bufferElements:f,cursorElement:t}}getLinesScrolled(s){if(s.deltaY===0||s.shiftKey)return 0;let e=this._applyScrollModifier(s.deltaY,s);return s.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(e/=this._currentRowHeight+0,this._wheelPartialScroll+=e,e=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):s.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(e*=this._bufferService.rows),e}_applyScrollModifier(s,e){const t=this._optionsService.rawOptions.fastScrollModifier;return t==="alt"&&e.altKey||t==="ctrl"&&e.ctrlKey||t==="shift"&&e.shiftKey?s*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:s*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(s){this._lastTouchY=s.touches[0].pageY}handleTouchMove(s){const e=this._lastTouchY-s.touches[0].pageY;return this._lastTouchY=s.touches[0].pageY,e!==0&&(this._viewportElement.scrollTop+=e,this._bubbleScroll(s,e))}};r.Viewport=i=l([_(2,h.IBufferService),_(3,h.IOptionsService),_(4,d.ICharSizeService),_(5,d.IRenderService),_(6,d.ICoreBrowserService),_(7,d.IThemeService)],i)},3107:function(O,r,a){var l=this&&this.__decorate||function(h,i,s,e){var t,o=arguments.length,f=o<3?i:e===null?e=Object.getOwnPropertyDescriptor(i,s):e;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")f=Reflect.decorate(h,i,s,e);else for(var u=h.length-1;u>=0;u--)(t=h[u])&&(f=(o<3?t(f):o>3?t(i,s,f):t(i,s))||f);return o>3&&f&&Object.defineProperty(i,s,f),f},_=this&&this.__param||function(h,i){return function(s,e){i(s,e,h)}};Object.defineProperty(r,"__esModule",{value:!0}),r.BufferDecorationRenderer=void 0;const n=a(4725),d=a(844),v=a(2585);let g=r.BufferDecorationRenderer=class extends d.Disposable{constructor(h,i,s,e,t){super(),this._screenElement=h,this._bufferService=i,this._coreBrowserService=s,this._decorationService=e,this._renderService=t,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this.register(this._renderService.onRenderedViewportChange((()=>this._doRefreshDecorations()))),this.register(this._renderService.onDimensionsChange((()=>{this._dimensionsChanged=!0,this._queueRefresh()}))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt}))),this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh()))),this.register(this._decorationService.onDecorationRemoved((o=>this._removeDecoration(o)))),this.register((0,d.toDisposable)((()=>{this._container.remove(),this._decorationElements.clear()})))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback((()=>{this._doRefreshDecorations(),this._animationFrame=void 0})))}_doRefreshDecorations(){for(const h of this._decorationService.decorations)this._renderDecoration(h);this._dimensionsChanged=!1}_renderDecoration(h){this._refreshStyle(h),this._dimensionsChanged&&this._refreshXPosition(h)}_createElement(h){var e;const i=this._coreBrowserService.mainDocument.createElement("div");i.classList.add("xterm-decoration"),i.classList.toggle("xterm-decoration-top-layer",((e=h==null?void 0:h.options)==null?void 0:e.layer)==="top"),i.style.width=`${Math.round((h.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,i.style.height=(h.options.height||1)*this._renderService.dimensions.css.cell.height+"px",i.style.top=(h.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",i.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const s=h.options.x??0;return s&&s>this._bufferService.cols&&(i.style.display="none"),this._refreshXPosition(h,i),i}_refreshStyle(h){const i=h.marker.line-this._bufferService.buffers.active.ydisp;if(i<0||i>=this._bufferService.rows)h.element&&(h.element.style.display="none",h.onRenderEmitter.fire(h.element));else{let s=this._decorationElements.get(h);s||(s=this._createElement(h),h.element=s,this._decorationElements.set(h,s),this._container.appendChild(s),h.onDispose((()=>{this._decorationElements.delete(h),s.remove()}))),s.style.top=i*this._renderService.dimensions.css.cell.height+"px",s.style.display=this._altBufferIsActive?"none":"block",h.onRenderEmitter.fire(s)}}_refreshXPosition(h,i=h.element){if(!i)return;const s=h.options.x??0;(h.options.anchor||"left")==="right"?i.style.right=s?s*this._renderService.dimensions.css.cell.width+"px":"":i.style.left=s?s*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(h){var i;(i=this._decorationElements.get(h))==null||i.remove(),this._decorationElements.delete(h),h.dispose()}};r.BufferDecorationRenderer=g=l([_(1,v.IBufferService),_(2,n.ICoreBrowserService),_(3,v.IDecorationService),_(4,n.IRenderService)],g)},5871:(O,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ColorZoneStore=void 0,r.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(a){if(a.options.overviewRulerOptions){for(const l of this._zones)if(l.color===a.options.overviewRulerOptions.color&&l.position===a.options.overviewRulerOptions.position){if(this._lineIntersectsZone(l,a.marker.line))return;if(this._lineAdjacentToZone(l,a.marker.line,a.options.overviewRulerOptions.position))return void this._addLineToZone(l,a.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=a.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=a.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=a.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=a.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:a.options.overviewRulerOptions.color,position:a.options.overviewRulerOptions.position,startBufferLine:a.marker.line,endBufferLine:a.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(a){this._linePadding=a}_lineIntersectsZone(a,l){return l>=a.startBufferLine&&l<=a.endBufferLine}_lineAdjacentToZone(a,l,_){return l>=a.startBufferLine-this._linePadding[_||"full"]&&l<=a.endBufferLine+this._linePadding[_||"full"]}_addLineToZone(a,l){a.startBufferLine=Math.min(a.startBufferLine,l),a.endBufferLine=Math.max(a.endBufferLine,l)}}},5744:function(O,r,a){var l=this&&this.__decorate||function(t,o,f,u){var p,c=arguments.length,m=c<3?o:u===null?u=Object.getOwnPropertyDescriptor(o,f):u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(t,o,f,u);else for(var y=t.length-1;y>=0;y--)(p=t[y])&&(m=(c<3?p(m):c>3?p(o,f,m):p(o,f))||m);return c>3&&m&&Object.defineProperty(o,f,m),m},_=this&&this.__param||function(t,o){return function(f,u){o(f,u,t)}};Object.defineProperty(r,"__esModule",{value:!0}),r.OverviewRulerRenderer=void 0;const n=a(5871),d=a(4725),v=a(844),g=a(2585),h={full:0,left:0,center:0,right:0},i={full:0,left:0,center:0,right:0},s={full:0,left:0,center:0,right:0};let e=r.OverviewRulerRenderer=class extends v.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(t,o,f,u,p,c,m){var k;super(),this._viewportElement=t,this._screenElement=o,this._bufferService=f,this._decorationService=u,this._renderService=p,this._optionsService=c,this._coreBrowserService=m,this._colorZoneStore=new n.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),(k=this._viewportElement.parentElement)==null||k.insertBefore(this._canvas,this._viewportElement);const y=this._canvas.getContext("2d");if(!y)throw new Error("Ctx cannot be null");this._ctx=y,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,v.toDisposable)((()=>{var L;(L=this._canvas)==null||L.remove()})))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh(void 0,!0)))),this.register(this._decorationService.onDecorationRemoved((()=>this._queueRefresh(void 0,!0))))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"}))),this.register(this._bufferService.onScroll((()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender((()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)}))),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",(()=>this._queueRefresh(!0)))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh(!0)))),this._queueRefresh(!0)}_refreshDrawConstants(){const t=Math.floor(this._canvas.width/3),o=Math.ceil(this._canvas.width/3);i.full=this._canvas.width,i.left=t,i.center=o,i.right=t,this._refreshDrawHeightConstants(),s.full=0,s.left=0,s.center=i.left,s.right=i.left+i.center}_refreshDrawHeightConstants(){h.full=Math.round(2*this._coreBrowserService.dpr);const t=this._canvas.height/this._bufferService.buffer.lines.length,o=Math.round(Math.max(Math.min(t,12),6)*this._coreBrowserService.dpr);h.left=o,h.center=o,h.right=o}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*h.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*h.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*h.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*h.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(const o of this._decorationService.decorations)this._colorZoneStore.addDecoration(o);this._ctx.lineWidth=1;const t=this._colorZoneStore.zones;for(const o of t)o.position!=="full"&&this._renderColorZone(o);for(const o of t)o.position==="full"&&this._renderColorZone(o);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(t){this._ctx.fillStyle=t.color,this._ctx.fillRect(s[t.position||"full"],Math.round((this._canvas.height-1)*(t.startBufferLine/this._bufferService.buffers.active.lines.length)-h[t.position||"full"]/2),i[t.position||"full"],Math.round((this._canvas.height-1)*((t.endBufferLine-t.startBufferLine)/this._bufferService.buffers.active.lines.length)+h[t.position||"full"]))}_queueRefresh(t,o){this._shouldUpdateDimensions=t||this._shouldUpdateDimensions,this._shouldUpdateAnchor=o||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};r.OverviewRulerRenderer=e=l([_(2,g.IBufferService),_(3,g.IDecorationService),_(4,d.IRenderService),_(5,g.IOptionsService),_(6,d.ICoreBrowserService)],e)},2950:function(O,r,a){var l=this&&this.__decorate||function(h,i,s,e){var t,o=arguments.length,f=o<3?i:e===null?e=Object.getOwnPropertyDescriptor(i,s):e;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")f=Reflect.decorate(h,i,s,e);else for(var u=h.length-1;u>=0;u--)(t=h[u])&&(f=(o<3?t(f):o>3?t(i,s,f):t(i,s))||f);return o>3&&f&&Object.defineProperty(i,s,f),f},_=this&&this.__param||function(h,i){return function(s,e){i(s,e,h)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CompositionHelper=void 0;const n=a(4725),d=a(2585),v=a(2584);let g=r.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(h,i,s,e,t,o){this._textarea=h,this._compositionView=i,this._bufferService=s,this._optionsService=e,this._coreService=t,this._renderService=o,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(h){this._compositionView.textContent=h.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(h){if(this._isComposing||this._isSendingComposition){if(h.keyCode===229||h.keyCode===16||h.keyCode===17||h.keyCode===18)return!1;this._finalizeComposition(!1)}return h.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(h){if(this._compositionView.classList.remove("active"),this._isComposing=!1,h){const i={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let s;this._isSendingComposition=!1,i.start+=this._dataAlreadySent.length,s=this._isComposing?this._textarea.value.substring(i.start,i.end):this._textarea.value.substring(i.start),s.length>0&&this._coreService.triggerDataEvent(s,!0)}}),0)}else{this._isSendingComposition=!1;const i=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(i,!0)}}_handleAnyTextareaChanges(){const h=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const i=this._textarea.value,s=i.replace(h,"");this._dataAlreadySent=s,i.length>h.length?this._coreService.triggerDataEvent(s,!0):i.length<h.length?this._coreService.triggerDataEvent(`${v.C0.DEL}`,!0):i.length===h.length&&i!==h&&this._coreService.triggerDataEvent(i,!0)}}),0)}updateCompositionElements(h){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const i=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),s=this._renderService.dimensions.css.cell.height,e=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,t=i*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=t+"px",this._compositionView.style.top=e+"px",this._compositionView.style.height=s+"px",this._compositionView.style.lineHeight=s+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const o=this._compositionView.getBoundingClientRect();this._textarea.style.left=t+"px",this._textarea.style.top=e+"px",this._textarea.style.width=Math.max(o.width,1)+"px",this._textarea.style.height=Math.max(o.height,1)+"px",this._textarea.style.lineHeight=o.height+"px"}h||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};r.CompositionHelper=g=l([_(2,d.IBufferService),_(3,d.IOptionsService),_(4,d.ICoreService),_(5,n.IRenderService)],g)},9806:(O,r)=>{function a(l,_,n){const d=n.getBoundingClientRect(),v=l.getComputedStyle(n),g=parseInt(v.getPropertyValue("padding-left")),h=parseInt(v.getPropertyValue("padding-top"));return[_.clientX-d.left-g,_.clientY-d.top-h]}Object.defineProperty(r,"__esModule",{value:!0}),r.getCoords=r.getCoordsRelativeToElement=void 0,r.getCoordsRelativeToElement=a,r.getCoords=function(l,_,n,d,v,g,h,i,s){if(!g)return;const e=a(l,_,n);return e?(e[0]=Math.ceil((e[0]+(s?h/2:0))/h),e[1]=Math.ceil(e[1]/i),e[0]=Math.min(Math.max(e[0],1),d+(s?1:0)),e[1]=Math.min(Math.max(e[1],1),v),e):void 0}},9504:(O,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.moveToCellSequence=void 0;const l=a(2584);function _(i,s,e,t){const o=i-n(i,e),f=s-n(s,e),u=Math.abs(o-f)-(function(p,c,m){let y=0;const k=p-n(p,m),L=c-n(c,m);for(let w=0;w<Math.abs(k-L);w++){const x=d(p,c)==="A"?-1:1,B=m.buffer.lines.get(k+x*w);B!=null&&B.isWrapped&&y++}return y})(i,s,e);return h(u,g(d(i,s),t))}function n(i,s){let e=0,t=s.buffer.lines.get(i),o=t==null?void 0:t.isWrapped;for(;o&&i>=0&&i<s.rows;)e++,t=s.buffer.lines.get(--i),o=t==null?void 0:t.isWrapped;return e}function d(i,s){return i>s?"A":"B"}function v(i,s,e,t,o,f){let u=i,p=s,c="";for(;u!==e||p!==t;)u+=o?1:-1,o&&u>f.cols-1?(c+=f.buffer.translateBufferLineToString(p,!1,i,u),u=0,i=0,p++):!o&&u<0&&(c+=f.buffer.translateBufferLineToString(p,!1,0,i+1),u=f.cols-1,i=u,p--);return c+f.buffer.translateBufferLineToString(p,!1,i,u)}function g(i,s){const e=s?"O":"[";return l.C0.ESC+e+i}function h(i,s){i=Math.floor(i);let e="";for(let t=0;t<i;t++)e+=s;return e}r.moveToCellSequence=function(i,s,e,t){const o=e.buffer.x,f=e.buffer.y;if(!e.buffer.hasScrollback)return(function(c,m,y,k,L,w){return _(m,k,L,w).length===0?"":h(v(c,m,c,m-n(m,L),!1,L).length,g("D",w))})(o,f,0,s,e,t)+_(f,s,e,t)+(function(c,m,y,k,L,w){let x;x=_(m,k,L,w).length>0?k-n(k,L):m;const B=k,P=(function(U,I,S,b,E,D){let T;return T=_(S,b,E,D).length>0?b-n(b,E):I,U<S&&T<=b||U>=S&&T<b?"C":"D"})(c,m,y,k,L,w);return h(v(c,x,y,B,P==="C",L).length,g(P,w))})(o,f,i,s,e,t);let u;if(f===s)return u=o>i?"D":"C",h(Math.abs(o-i),g(u,t));u=f>s?"D":"C";const p=Math.abs(f-s);return h((function(c,m){return m.cols-c})(f>s?i:o,e)+(p-1)*e.cols+1+((f>s?o:i)-1),g(u,t))}},1296:function(O,r,a){var l=this&&this.__decorate||function(w,x,B,P){var U,I=arguments.length,S=I<3?x:P===null?P=Object.getOwnPropertyDescriptor(x,B):P;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(w,x,B,P);else for(var b=w.length-1;b>=0;b--)(U=w[b])&&(S=(I<3?U(S):I>3?U(x,B,S):U(x,B))||S);return I>3&&S&&Object.defineProperty(x,B,S),S},_=this&&this.__param||function(w,x){return function(B,P){x(B,P,w)}};Object.defineProperty(r,"__esModule",{value:!0}),r.DomRenderer=void 0;const n=a(3787),d=a(2550),v=a(2223),g=a(6171),h=a(6052),i=a(4725),s=a(8055),e=a(8460),t=a(844),o=a(2585),f="xterm-dom-renderer-owner-",u="xterm-rows",p="xterm-fg-",c="xterm-bg-",m="xterm-focus",y="xterm-selection";let k=1,L=r.DomRenderer=class extends t.Disposable{constructor(w,x,B,P,U,I,S,b,E,D,T,H,N){super(),this._terminal=w,this._document=x,this._element=B,this._screenElement=P,this._viewportElement=U,this._helperContainer=I,this._linkifier2=S,this._charSizeService=E,this._optionsService=D,this._bufferService=T,this._coreBrowserService=H,this._themeService=N,this._terminalClass=k++,this._rowElements=[],this._selectionRenderModel=(0,h.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new e.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(u),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement("div"),this._selectionContainer.classList.add(y),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,g.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors(($=>this._injectCss($)))),this._injectCss(this._themeService.colors),this._rowFactory=b.createInstance(n.DomRendererRowFactory,document),this._element.classList.add(f+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline(($=>this._handleLinkHover($)))),this.register(this._linkifier2.onHideLinkUnderline(($=>this._handleLinkLeave($)))),this.register((0,t.toDisposable)((()=>{this._element.classList.remove(f+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new d.WidthCache(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){const w=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*w,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*w),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/w),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/w),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(const B of this._rowElements)B.style.width=`${this.dimensions.css.canvas.width}px`,B.style.height=`${this.dimensions.css.cell.height}px`,B.style.lineHeight=`${this.dimensions.css.cell.height}px`,B.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const x=`${this._terminalSelector} .${u} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=x,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(w){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let x=`${this._terminalSelector} .${u} { color: ${w.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;x+=`${this._terminalSelector} .${u} .xterm-dim { color: ${s.color.multiplyOpacity(w.foreground,.5).css};}`,x+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;const B=`blink_underline_${this._terminalClass}`,P=`blink_bar_${this._terminalClass}`,U=`blink_block_${this._terminalClass}`;x+=`@keyframes ${B} { 50% {  border-bottom-style: hidden; }}`,x+=`@keyframes ${P} { 50% {  box-shadow: none; }}`,x+=`@keyframes ${U} { 0% {  background-color: ${w.cursor.css};  color: ${w.cursorAccent.css}; } 50% {  background-color: inherit;  color: ${w.cursor.css}; }}`,x+=`${this._terminalSelector} .${u}.${m} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${B} 1s step-end infinite;}${this._terminalSelector} .${u}.${m} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${P} 1s step-end infinite;}${this._terminalSelector} .${u}.${m} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${U} 1s step-end infinite;}${this._terminalSelector} .${u} .xterm-cursor.xterm-cursor-block { background-color: ${w.cursor.css}; color: ${w.cursorAccent.css};}${this._terminalSelector} .${u} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${w.cursor.css} !important; color: ${w.cursorAccent.css} !important;}${this._terminalSelector} .${u} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${w.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${u} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${w.cursor.css} inset;}${this._terminalSelector} .${u} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${w.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,x+=`${this._terminalSelector} .${y} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${y} div { position: absolute; background-color: ${w.selectionBackgroundOpaque.css};}${this._terminalSelector} .${y} div { position: absolute; background-color: ${w.selectionInactiveBackgroundOpaque.css};}`;for(const[I,S]of w.ansi.entries())x+=`${this._terminalSelector} .${p}${I} { color: ${S.css}; }${this._terminalSelector} .${p}${I}.xterm-dim { color: ${s.color.multiplyOpacity(S,.5).css}; }${this._terminalSelector} .${c}${I} { background-color: ${S.css}; }`;x+=`${this._terminalSelector} .${p}${v.INVERTED_DEFAULT_COLOR} { color: ${s.color.opaque(w.background).css}; }${this._terminalSelector} .${p}${v.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${s.color.multiplyOpacity(s.color.opaque(w.background),.5).css}; }${this._terminalSelector} .${c}${v.INVERTED_DEFAULT_COLOR} { background-color: ${w.foreground.css}; }`,this._themeStyleElement.textContent=x}_setDefaultSpacing(){const w=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${w}px`,this._rowFactory.defaultSpacing=w}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(w,x){for(let B=this._rowElements.length;B<=x;B++){const P=this._document.createElement("div");this._rowContainer.appendChild(P),this._rowElements.push(P)}for(;this._rowElements.length>x;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(w,x){this._refreshRowElements(w,x),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(m),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(m),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(w,x,B){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(w,x,B),this.renderRows(0,this._bufferService.rows-1),!w||!x)return;this._selectionRenderModel.update(this._terminal,w,x,B);const P=this._selectionRenderModel.viewportStartRow,U=this._selectionRenderModel.viewportEndRow,I=this._selectionRenderModel.viewportCappedStartRow,S=this._selectionRenderModel.viewportCappedEndRow;if(I>=this._bufferService.rows||S<0)return;const b=this._document.createDocumentFragment();if(B){const E=w[0]>x[0];b.appendChild(this._createSelectionElement(I,E?x[0]:w[0],E?w[0]:x[0],S-I+1))}else{const E=P===I?w[0]:0,D=I===U?x[0]:this._bufferService.cols;b.appendChild(this._createSelectionElement(I,E,D));const T=S-I-1;if(b.appendChild(this._createSelectionElement(I+1,0,this._bufferService.cols,T)),I!==S){const H=U===S?x[0]:this._bufferService.cols;b.appendChild(this._createSelectionElement(S,0,H))}}this._selectionContainer.appendChild(b)}_createSelectionElement(w,x,B,P=1){const U=this._document.createElement("div"),I=x*this.dimensions.css.cell.width;let S=this.dimensions.css.cell.width*(B-x);return I+S>this.dimensions.css.canvas.width&&(S=this.dimensions.css.canvas.width-I),U.style.height=P*this.dimensions.css.cell.height+"px",U.style.top=w*this.dimensions.css.cell.height+"px",U.style.left=`${I}px`,U.style.width=`${S}px`,U}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(const w of this._rowElements)w.replaceChildren()}renderRows(w,x){const B=this._bufferService.buffer,P=B.ybase+B.y,U=Math.min(B.x,this._bufferService.cols-1),I=this._optionsService.rawOptions.cursorBlink,S=this._optionsService.rawOptions.cursorStyle,b=this._optionsService.rawOptions.cursorInactiveStyle;for(let E=w;E<=x;E++){const D=E+B.ydisp,T=this._rowElements[E],H=B.lines.get(D);if(!T||!H)break;T.replaceChildren(...this._rowFactory.createRow(H,D,D===P,S,b,U,I,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${f}${this._terminalClass}`}_handleLinkHover(w){this._setCellUnderline(w.x1,w.x2,w.y1,w.y2,w.cols,!0)}_handleLinkLeave(w){this._setCellUnderline(w.x1,w.x2,w.y1,w.y2,w.cols,!1)}_setCellUnderline(w,x,B,P,U,I){B<0&&(w=0),P<0&&(x=0);const S=this._bufferService.rows-1;B=Math.max(Math.min(B,S),0),P=Math.max(Math.min(P,S),0),U=Math.min(U,this._bufferService.cols);const b=this._bufferService.buffer,E=b.ybase+b.y,D=Math.min(b.x,U-1),T=this._optionsService.rawOptions.cursorBlink,H=this._optionsService.rawOptions.cursorStyle,N=this._optionsService.rawOptions.cursorInactiveStyle;for(let $=B;$<=P;++$){const R=$+b.ydisp,C=this._rowElements[$],M=b.lines.get(R);if(!C||!M)break;C.replaceChildren(...this._rowFactory.createRow(M,R,R===E,H,N,D,T,this.dimensions.css.cell.width,this._widthCache,I?$===B?w:0:-1,I?($===P?x:U)-1:-1))}}};r.DomRenderer=L=l([_(7,o.IInstantiationService),_(8,i.ICharSizeService),_(9,o.IOptionsService),_(10,o.IBufferService),_(11,i.ICoreBrowserService),_(12,i.IThemeService)],L)},3787:function(O,r,a){var l=this&&this.__decorate||function(u,p,c,m){var y,k=arguments.length,L=k<3?p:m===null?m=Object.getOwnPropertyDescriptor(p,c):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(u,p,c,m);else for(var w=u.length-1;w>=0;w--)(y=u[w])&&(L=(k<3?y(L):k>3?y(p,c,L):y(p,c))||L);return k>3&&L&&Object.defineProperty(p,c,L),L},_=this&&this.__param||function(u,p){return function(c,m){p(c,m,u)}};Object.defineProperty(r,"__esModule",{value:!0}),r.DomRendererRowFactory=void 0;const n=a(2223),d=a(643),v=a(511),g=a(2585),h=a(8055),i=a(4725),s=a(4269),e=a(6171),t=a(3734);let o=r.DomRendererRowFactory=class{constructor(u,p,c,m,y,k,L){this._document=u,this._characterJoinerService=p,this._optionsService=c,this._coreBrowserService=m,this._coreService=y,this._decorationService=k,this._themeService=L,this._workCell=new v.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(u,p,c){this._selectionStart=u,this._selectionEnd=p,this._columnSelectMode=c}createRow(u,p,c,m,y,k,L,w,x,B,P){const U=[],I=this._characterJoinerService.getJoinedCharacters(p),S=this._themeService.colors;let b,E=u.getNoBgTrimmedLength();c&&E<k+1&&(E=k+1);let D=0,T="",H=0,N=0,$=0,R=!1,C=0,M=!1,A=0;const W=[],F=B!==-1&&P!==-1;for(let z=0;z<E;z++){u.loadCell(z,this._workCell);let q=this._workCell.getWidth();if(q===0)continue;let V=!1,X=z,j=this._workCell;if(I.length>0&&z===I[0][0]){V=!0;const K=I.shift();j=new s.JoinedCellData(this._workCell,u.translateToString(!0,K[0],K[1]),K[1]-K[0]),X=K[1]-1,q=j.getWidth()}const se=this._isCellInSelection(z,p),le=c&&z===k,de=F&&z>=B&&z<=P;let _e=!1;this._decorationService.forEachDecorationAtCell(z,p,void 0,(K=>{_e=!0}));let ae=j.getChars()||d.WHITESPACE_CELL_CHAR;if(ae===" "&&(j.isUnderline()||j.isOverline())&&(ae="Â "),A=q*w-x.get(ae,j.isBold(),j.isItalic()),b){if(D&&(se&&M||!se&&!M&&j.bg===H)&&(se&&M&&S.selectionForeground||j.fg===N)&&j.extended.ext===$&&de===R&&A===C&&!le&&!V&&!_e){j.isInvisible()?T+=d.WHITESPACE_CELL_CHAR:T+=ae,D++;continue}D&&(b.textContent=T),b=this._document.createElement("span"),D=0,T=""}else b=this._document.createElement("span");if(H=j.bg,N=j.fg,$=j.extended.ext,R=de,C=A,M=se,V&&k>=z&&k<=X&&(k=z),!this._coreService.isCursorHidden&&le&&this._coreService.isCursorInitialized){if(W.push("xterm-cursor"),this._coreBrowserService.isFocused)L&&W.push("xterm-cursor-blink"),W.push(m==="bar"?"xterm-cursor-bar":m==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(y)switch(y){case"outline":W.push("xterm-cursor-outline");break;case"block":W.push("xterm-cursor-block");break;case"bar":W.push("xterm-cursor-bar");break;case"underline":W.push("xterm-cursor-underline")}}if(j.isBold()&&W.push("xterm-bold"),j.isItalic()&&W.push("xterm-italic"),j.isDim()&&W.push("xterm-dim"),T=j.isInvisible()?d.WHITESPACE_CELL_CHAR:j.getChars()||d.WHITESPACE_CELL_CHAR,j.isUnderline()&&(W.push(`xterm-underline-${j.extended.underlineStyle}`),T===" "&&(T="Â "),!j.isUnderlineColorDefault()))if(j.isUnderlineColorRGB())b.style.textDecorationColor=`rgb(${t.AttributeData.toColorRGB(j.getUnderlineColor()).join(",")})`;else{let K=j.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&j.isBold()&&K<8&&(K+=8),b.style.textDecorationColor=S.ansi[K].css}j.isOverline()&&(W.push("xterm-overline"),T===" "&&(T="Â ")),j.isStrikethrough()&&W.push("xterm-strikethrough"),de&&(b.style.textDecoration="underline");let J=j.getFgColor(),re=j.getFgColorMode(),Z=j.getBgColor(),ne=j.getBgColorMode();const ue=!!j.isInverse();if(ue){const K=J;J=Z,Z=K;const Ce=re;re=ne,ne=Ce}let ee,he,te,oe=!1;switch(this._decorationService.forEachDecorationAtCell(z,p,void 0,(K=>{K.options.layer!=="top"&&oe||(K.backgroundColorRGB&&(ne=50331648,Z=K.backgroundColorRGB.rgba>>8&16777215,ee=K.backgroundColorRGB),K.foregroundColorRGB&&(re=50331648,J=K.foregroundColorRGB.rgba>>8&16777215,he=K.foregroundColorRGB),oe=K.options.layer==="top")})),!oe&&se&&(ee=this._coreBrowserService.isFocused?S.selectionBackgroundOpaque:S.selectionInactiveBackgroundOpaque,Z=ee.rgba>>8&16777215,ne=50331648,oe=!0,S.selectionForeground&&(re=50331648,J=S.selectionForeground.rgba>>8&16777215,he=S.selectionForeground)),oe&&W.push("xterm-decoration-top"),ne){case 16777216:case 33554432:te=S.ansi[Z],W.push(`xterm-bg-${Z}`);break;case 50331648:te=h.channels.toColor(Z>>16,Z>>8&255,255&Z),this._addStyle(b,`background-color:#${f((Z>>>0).toString(16),"0",6)}`);break;default:ue?(te=S.foreground,W.push(`xterm-bg-${n.INVERTED_DEFAULT_COLOR}`)):te=S.background}switch(ee||j.isDim()&&(ee=h.color.multiplyOpacity(te,.5)),re){case 16777216:case 33554432:j.isBold()&&J<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(J+=8),this._applyMinimumContrast(b,te,S.ansi[J],j,ee,void 0)||W.push(`xterm-fg-${J}`);break;case 50331648:const K=h.channels.toColor(J>>16&255,J>>8&255,255&J);this._applyMinimumContrast(b,te,K,j,ee,he)||this._addStyle(b,`color:#${f(J.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(b,te,S.foreground,j,ee,he)||ue&&W.push(`xterm-fg-${n.INVERTED_DEFAULT_COLOR}`)}W.length&&(b.className=W.join(" "),W.length=0),le||V||_e?b.textContent=T:D++,A!==this.defaultSpacing&&(b.style.letterSpacing=`${A}px`),U.push(b),z=X}return b&&D&&(b.textContent=T),U}_applyMinimumContrast(u,p,c,m,y,k){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,e.treatGlyphAsBackgroundColor)(m.getCode()))return!1;const L=this._getContrastCache(m);let w;if(y||k||(w=L.getColor(p.rgba,c.rgba)),w===void 0){const x=this._optionsService.rawOptions.minimumContrastRatio/(m.isDim()?2:1);w=h.color.ensureContrastRatio(y||p,k||c,x),L.setColor((y||p).rgba,(k||c).rgba,w??null)}return!!w&&(this._addStyle(u,`color:${w.css}`),!0)}_getContrastCache(u){return u.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(u,p){u.setAttribute("style",`${u.getAttribute("style")||""}${p};`)}_isCellInSelection(u,p){const c=this._selectionStart,m=this._selectionEnd;return!(!c||!m)&&(this._columnSelectMode?c[0]<=m[0]?u>=c[0]&&p>=c[1]&&u<m[0]&&p<=m[1]:u<c[0]&&p>=c[1]&&u>=m[0]&&p<=m[1]:p>c[1]&&p<m[1]||c[1]===m[1]&&p===c[1]&&u>=c[0]&&u<m[0]||c[1]<m[1]&&p===m[1]&&u<m[0]||c[1]<m[1]&&p===c[1]&&u>=c[0])}};function f(u,p,c){for(;u.length<c;)u=p+u;return u}r.DomRendererRowFactory=o=l([_(1,i.ICharacterJoinerService),_(2,g.IOptionsService),_(3,i.ICoreBrowserService),_(4,g.ICoreService),_(5,g.IDecorationService),_(6,i.IThemeService)],o)},2550:(O,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.WidthCache=void 0,r.WidthCache=class{constructor(a,l){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=a.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const _=a.createElement("span");_.classList.add("xterm-char-measure-element");const n=a.createElement("span");n.classList.add("xterm-char-measure-element"),n.style.fontWeight="bold";const d=a.createElement("span");d.classList.add("xterm-char-measure-element"),d.style.fontStyle="italic";const v=a.createElement("span");v.classList.add("xterm-char-measure-element"),v.style.fontWeight="bold",v.style.fontStyle="italic",this._measureElements=[_,n,d,v],this._container.appendChild(_),this._container.appendChild(n),this._container.appendChild(d),this._container.appendChild(v),l.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(a,l,_,n){a===this._font&&l===this._fontSize&&_===this._weight&&n===this._weightBold||(this._font=a,this._fontSize=l,this._weight=_,this._weightBold=n,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${_}`,this._measureElements[1].style.fontWeight=`${n}`,this._measureElements[2].style.fontWeight=`${_}`,this._measureElements[3].style.fontWeight=`${n}`,this.clear())}get(a,l,_){let n=0;if(!l&&!_&&a.length===1&&(n=a.charCodeAt(0))<256){if(this._flat[n]!==-9999)return this._flat[n];const g=this._measure(a,0);return g>0&&(this._flat[n]=g),g}let d=a;l&&(d+="B"),_&&(d+="I");let v=this._holey.get(d);if(v===void 0){let g=0;l&&(g|=1),_&&(g|=2),v=this._measure(a,g),v>0&&this._holey.set(d,v)}return v}_measure(a,l){const _=this._measureElements[l];return _.textContent=a.repeat(32),_.offsetWidth/32}}},2223:(O,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.TEXT_BASELINE=r.DIM_OPACITY=r.INVERTED_DEFAULT_COLOR=void 0;const l=a(6114);r.INVERTED_DEFAULT_COLOR=257,r.DIM_OPACITY=.5,r.TEXT_BASELINE=l.isFirefox||l.isLegacyEdge?"bottom":"ideographic"},6171:(O,r)=>{function a(_){return 57508<=_&&_<=57558}function l(_){return _>=128512&&_<=128591||_>=127744&&_<=128511||_>=128640&&_<=128767||_>=9728&&_<=9983||_>=9984&&_<=10175||_>=65024&&_<=65039||_>=129280&&_<=129535||_>=127462&&_<=127487}Object.defineProperty(r,"__esModule",{value:!0}),r.computeNextVariantOffset=r.createRenderDimensions=r.treatGlyphAsBackgroundColor=r.allowRescaling=r.isEmoji=r.isRestrictedPowerlineGlyph=r.isPowerlineGlyph=r.throwIfFalsy=void 0,r.throwIfFalsy=function(_){if(!_)throw new Error("value must not be falsy");return _},r.isPowerlineGlyph=a,r.isRestrictedPowerlineGlyph=function(_){return 57520<=_&&_<=57527},r.isEmoji=l,r.allowRescaling=function(_,n,d,v){return n===1&&d>Math.ceil(1.5*v)&&_!==void 0&&_>255&&!l(_)&&!a(_)&&!(function(g){return 57344<=g&&g<=63743})(_)},r.treatGlyphAsBackgroundColor=function(_){return a(_)||(function(n){return 9472<=n&&n<=9631})(_)},r.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},r.computeNextVariantOffset=function(_,n,d=0){return(_-(2*Math.round(n)-d))%(2*Math.round(n))}},6052:(O,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.createSelectionRenderModel=void 0;class a{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(_,n,d,v=!1){if(this.selectionStart=n,this.selectionEnd=d,!n||!d||n[0]===d[0]&&n[1]===d[1])return void this.clear();const g=_.buffers.active.ydisp,h=n[1]-g,i=d[1]-g,s=Math.max(h,0),e=Math.min(i,_.rows-1);s>=_.rows||e<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=v,this.viewportStartRow=h,this.viewportEndRow=i,this.viewportCappedStartRow=s,this.viewportCappedEndRow=e,this.startCol=n[0],this.endCol=d[0])}isCellSelected(_,n,d){return!!this.hasSelection&&(d-=_.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?n>=this.startCol&&d>=this.viewportCappedStartRow&&n<this.endCol&&d<=this.viewportCappedEndRow:n<this.startCol&&d>=this.viewportCappedStartRow&&n>=this.endCol&&d<=this.viewportCappedEndRow:d>this.viewportStartRow&&d<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&d===this.viewportStartRow&&n>=this.startCol&&n<this.endCol||this.viewportStartRow<this.viewportEndRow&&d===this.viewportEndRow&&n<this.endCol||this.viewportStartRow<this.viewportEndRow&&d===this.viewportStartRow&&n>=this.startCol)}}r.createSelectionRenderModel=function(){return new a}},456:(O,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.SelectionModel=void 0,r.SelectionModel=class{constructor(a){this._bufferService=a,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){const a=this.selectionStart[0]+this.selectionStartLength;return a>this._bufferService.cols?a%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(a/this._bufferService.cols)-1]:[a%this._bufferService.cols,this.selectionStart[1]+Math.floor(a/this._bufferService.cols)]:[a,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const a=this.selectionStart[0]+this.selectionStartLength;return a>this._bufferService.cols?[a%this._bufferService.cols,this.selectionStart[1]+Math.floor(a/this._bufferService.cols)]:[Math.max(a,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const a=this.selectionStart,l=this.selectionEnd;return!(!a||!l)&&(a[1]>l[1]||a[1]===l[1]&&a[0]>l[0])}handleTrim(a){return this.selectionStart&&(this.selectionStart[1]-=a),this.selectionEnd&&(this.selectionEnd[1]-=a),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(O,r,a){var l=this&&this.__decorate||function(e,t,o,f){var u,p=arguments.length,c=p<3?t:f===null?f=Object.getOwnPropertyDescriptor(t,o):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(e,t,o,f);else for(var m=e.length-1;m>=0;m--)(u=e[m])&&(c=(p<3?u(c):p>3?u(t,o,c):u(t,o))||c);return p>3&&c&&Object.defineProperty(t,o,c),c},_=this&&this.__param||function(e,t){return function(o,f){t(o,f,e)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CharSizeService=void 0;const n=a(2585),d=a(8460),v=a(844);let g=r.CharSizeService=class extends v.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(e,t,o){super(),this._optionsService=o,this.width=0,this.height=0,this._onCharSizeChange=this.register(new d.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new s(this._optionsService))}catch{this._measureStrategy=this.register(new i(e,t,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const e=this._measureStrategy.measure();e.width===this.width&&e.height===this.height||(this.width=e.width,this.height=e.height,this._onCharSizeChange.fire())}};r.CharSizeService=g=l([_(2,n.IOptionsService)],g);class h extends v.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(t,o){t!==void 0&&t>0&&o!==void 0&&o>0&&(this._result.width=t,this._result.height=o)}}class i extends h{constructor(t,o,f){super(),this._document=t,this._parentElement=o,this._optionsService=f,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}}class s extends h{constructor(t){super(),this._optionsService=t,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const o=this._ctx.measureText("W");if(!("width"in o&&"fontBoundingBoxAscent"in o&&"fontBoundingBoxDescent"in o))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const t=this._ctx.measureText("W");return this._validateAndSet(t.width,t.fontBoundingBoxAscent+t.fontBoundingBoxDescent),this._result}}},4269:function(O,r,a){var l=this&&this.__decorate||function(s,e,t,o){var f,u=arguments.length,p=u<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,t):o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(s,e,t,o);else for(var c=s.length-1;c>=0;c--)(f=s[c])&&(p=(u<3?f(p):u>3?f(e,t,p):f(e,t))||p);return u>3&&p&&Object.defineProperty(e,t,p),p},_=this&&this.__param||function(s,e){return function(t,o){e(t,o,s)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CharacterJoinerService=r.JoinedCellData=void 0;const n=a(3734),d=a(643),v=a(511),g=a(2585);class h extends n.AttributeData{constructor(e,t,o){super(),this.content=0,this.combinedData="",this.fg=e.fg,this.bg=e.bg,this.combinedData=t,this._width=o}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(e){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}r.JoinedCellData=h;let i=r.CharacterJoinerService=class me{constructor(e){this._bufferService=e,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new v.CellData}register(e){const t={id:this._nextCharacterJoinerId++,handler:e};return this._characterJoiners.push(t),t.id}deregister(e){for(let t=0;t<this._characterJoiners.length;t++)if(this._characterJoiners[t].id===e)return this._characterJoiners.splice(t,1),!0;return!1}getJoinedCharacters(e){if(this._characterJoiners.length===0)return[];const t=this._bufferService.buffer.lines.get(e);if(!t||t.length===0)return[];const o=[],f=t.translateToString(!0);let u=0,p=0,c=0,m=t.getFg(0),y=t.getBg(0);for(let k=0;k<t.getTrimmedLength();k++)if(t.loadCell(k,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==m||this._workCell.bg!==y){if(k-u>1){const L=this._getJoinedRanges(f,c,p,t,u);for(let w=0;w<L.length;w++)o.push(L[w])}u=k,c=p,m=this._workCell.fg,y=this._workCell.bg}p+=this._workCell.getChars().length||d.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-u>1){const k=this._getJoinedRanges(f,c,p,t,u);for(let L=0;L<k.length;L++)o.push(k[L])}return o}_getJoinedRanges(e,t,o,f,u){const p=e.substring(t,o);let c=[];try{c=this._characterJoiners[0].handler(p)}catch(m){console.error(m)}for(let m=1;m<this._characterJoiners.length;m++)try{const y=this._characterJoiners[m].handler(p);for(let k=0;k<y.length;k++)me._mergeRanges(c,y[k])}catch(y){console.error(y)}return this._stringRangesToCellRanges(c,f,u),c}_stringRangesToCellRanges(e,t,o){let f=0,u=!1,p=0,c=e[f];if(c){for(let m=o;m<this._bufferService.cols;m++){const y=t.getWidth(m),k=t.getString(m).length||d.WHITESPACE_CELL_CHAR.length;if(y!==0){if(!u&&c[0]<=p&&(c[0]=m,u=!0),c[1]<=p){if(c[1]=m,c=e[++f],!c)break;c[0]<=p?(c[0]=m,u=!0):u=!1}p+=k}}c&&(c[1]=this._bufferService.cols)}}static _mergeRanges(e,t){let o=!1;for(let f=0;f<e.length;f++){const u=e[f];if(o){if(t[1]<=u[0])return e[f-1][1]=t[1],e;if(t[1]<=u[1])return e[f-1][1]=Math.max(t[1],u[1]),e.splice(f,1),e;e.splice(f,1),f--}else{if(t[1]<=u[0])return e.splice(f,0,t),e;if(t[1]<=u[1])return u[0]=Math.min(t[0],u[0]),e;t[0]<u[1]&&(u[0]=Math.min(t[0],u[0]),o=!0)}}return o?e[e.length-1][1]=t[1]:e.push(t),e}};r.CharacterJoinerService=i=l([_(0,g.IBufferService)],i)},5114:(O,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CoreBrowserService=void 0;const l=a(844),_=a(8460),n=a(3656);class d extends l.Disposable{constructor(h,i,s){super(),this._textarea=h,this._window=i,this.mainDocument=s,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new v(this._window),this._onDprChange=this.register(new _.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new _.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((e=>this._screenDprMonitor.setWindow(e)))),this.register((0,_.forwardEvent)(this._screenDprMonitor.onDprChange,this._onDprChange)),this._textarea.addEventListener("focus",(()=>this._isFocused=!0)),this._textarea.addEventListener("blur",(()=>this._isFocused=!1))}get window(){return this._window}set window(h){this._window!==h&&(this._window=h,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask((()=>this._cachedIsFocused=void 0))),this._cachedIsFocused}}r.CoreBrowserService=d;class v extends l.Disposable{constructor(h){super(),this._parentWindow=h,this._windowResizeListener=this.register(new l.MutableDisposable),this._onDprChange=this.register(new _.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,l.toDisposable)((()=>this.clearListener())))}setWindow(h){this._parentWindow=h,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,n.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var h;this._outerListener&&((h=this._resolutionMediaMatchList)==null||h.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}}},779:(O,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.LinkProviderService=void 0;const l=a(844);class _ extends l.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,l.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(d){return this.linkProviders.push(d),{dispose:()=>{const v=this.linkProviders.indexOf(d);v!==-1&&this.linkProviders.splice(v,1)}}}}r.LinkProviderService=_},8934:function(O,r,a){var l=this&&this.__decorate||function(g,h,i,s){var e,t=arguments.length,o=t<3?h:s===null?s=Object.getOwnPropertyDescriptor(h,i):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(g,h,i,s);else for(var f=g.length-1;f>=0;f--)(e=g[f])&&(o=(t<3?e(o):t>3?e(h,i,o):e(h,i))||o);return t>3&&o&&Object.defineProperty(h,i,o),o},_=this&&this.__param||function(g,h){return function(i,s){h(i,s,g)}};Object.defineProperty(r,"__esModule",{value:!0}),r.MouseService=void 0;const n=a(4725),d=a(9806);let v=r.MouseService=class{constructor(g,h){this._renderService=g,this._charSizeService=h}getCoords(g,h,i,s,e){return(0,d.getCoords)(window,g,h,i,s,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,e)}getMouseReportCoords(g,h){const i=(0,d.getCoordsRelativeToElement)(window,g,h);if(this._charSizeService.hasValidSize)return i[0]=Math.min(Math.max(i[0],0),this._renderService.dimensions.css.canvas.width-1),i[1]=Math.min(Math.max(i[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(i[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(i[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(i[0]),y:Math.floor(i[1])}}};r.MouseService=v=l([_(0,n.IRenderService),_(1,n.ICharSizeService)],v)},3230:function(O,r,a){var l=this&&this.__decorate||function(e,t,o,f){var u,p=arguments.length,c=p<3?t:f===null?f=Object.getOwnPropertyDescriptor(t,o):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(e,t,o,f);else for(var m=e.length-1;m>=0;m--)(u=e[m])&&(c=(p<3?u(c):p>3?u(t,o,c):u(t,o))||c);return p>3&&c&&Object.defineProperty(t,o,c),c},_=this&&this.__param||function(e,t){return function(o,f){t(o,f,e)}};Object.defineProperty(r,"__esModule",{value:!0}),r.RenderService=void 0;const n=a(6193),d=a(4725),v=a(8460),g=a(844),h=a(7226),i=a(2585);let s=r.RenderService=class extends g.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(e,t,o,f,u,p,c,m){super(),this._rowCount=e,this._charSizeService=f,this._renderer=this.register(new g.MutableDisposable),this._pausedResizeTask=new h.DebouncedIdleTask,this._observerDisposable=this.register(new g.MutableDisposable),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new v.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new v.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new v.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new v.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new n.RenderDebouncer(((y,k)=>this._renderRows(y,k)),c),this.register(this._renderDebouncer),this.register(c.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(p.onResize((()=>this._fullRefresh()))),this.register(p.buffers.onBufferActivate((()=>{var y;return(y=this._renderer.value)==null?void 0:y.clear()}))),this.register(o.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(u.onDecorationRegistered((()=>this._fullRefresh()))),this.register(u.onDecorationRemoved((()=>this._fullRefresh()))),this.register(o.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(p.cols,p.rows),this._fullRefresh()}))),this.register(o.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(p.buffer.y,p.buffer.y,!0)))),this.register(m.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(c.window,t),this.register(c.onWindowChange((y=>this._registerIntersectionObserver(y,t))))}_registerIntersectionObserver(e,t){if("IntersectionObserver"in e){const o=new e.IntersectionObserver((f=>this._handleIntersectionChange(f[f.length-1])),{threshold:0});o.observe(t),this._observerDisposable.value=(0,g.toDisposable)((()=>o.disconnect()))}}_handleIntersectionChange(e){this._isPaused=e.isIntersecting===void 0?e.intersectionRatio===0:!e.isIntersecting,this._isPaused||this._charSizeService.hasValidSize||this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(e,t,o=!1){this._isPaused?this._needsFullRefresh=!0:(o||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(e,t,this._rowCount))}_renderRows(e,t){this._renderer.value&&(e=Math.min(e,this._rowCount-1),t=Math.min(t,this._rowCount-1),this._renderer.value.renderRows(e,t),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:e,end:t}),this._onRender.fire({start:e,end:t}),this._isNextRenderRedrawOnly=!0)}resize(e,t){this._rowCount=t,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(e){this._renderer.value=e,this._renderer.value&&(this._renderer.value.onRequestRedraw((t=>this.refreshRows(t.start,t.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(e){return this._renderDebouncer.addRefreshCallback(e)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var e,t;this._renderer.value&&((t=(e=this._renderer.value).clearTextureAtlas)==null||t.call(e),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(e,t){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var o;return(o=this._renderer.value)==null?void 0:o.handleResize(e,t)})):this._renderer.value.handleResize(e,t),this._fullRefresh())}handleCharSizeChanged(){var e;(e=this._renderer.value)==null||e.handleCharSizeChanged()}handleBlur(){var e;(e=this._renderer.value)==null||e.handleBlur()}handleFocus(){var e;(e=this._renderer.value)==null||e.handleFocus()}handleSelectionChanged(e,t,o){var f;this._selectionState.start=e,this._selectionState.end=t,this._selectionState.columnSelectMode=o,(f=this._renderer.value)==null||f.handleSelectionChanged(e,t,o)}handleCursorMove(){var e;(e=this._renderer.value)==null||e.handleCursorMove()}clear(){var e;(e=this._renderer.value)==null||e.clear()}};r.RenderService=s=l([_(2,i.IOptionsService),_(3,d.ICharSizeService),_(4,i.IDecorationService),_(5,i.IBufferService),_(6,d.ICoreBrowserService),_(7,d.IThemeService)],s)},9312:function(O,r,a){var l=this&&this.__decorate||function(c,m,y,k){var L,w=arguments.length,x=w<3?m:k===null?k=Object.getOwnPropertyDescriptor(m,y):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(c,m,y,k);else for(var B=c.length-1;B>=0;B--)(L=c[B])&&(x=(w<3?L(x):w>3?L(m,y,x):L(m,y))||x);return w>3&&x&&Object.defineProperty(m,y,x),x},_=this&&this.__param||function(c,m){return function(y,k){m(y,k,c)}};Object.defineProperty(r,"__esModule",{value:!0}),r.SelectionService=void 0;const n=a(9806),d=a(9504),v=a(456),g=a(4725),h=a(8460),i=a(844),s=a(6114),e=a(4841),t=a(511),o=a(2585),f="Â ",u=new RegExp(f,"g");let p=r.SelectionService=class extends i.Disposable{constructor(c,m,y,k,L,w,x,B,P){super(),this._element=c,this._screenElement=m,this._linkifier=y,this._bufferService=k,this._coreService=L,this._mouseService=w,this._optionsService=x,this._renderService=B,this._coreBrowserService=P,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new t.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new h.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new h.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new h.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new h.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=U=>this._handleMouseMove(U),this._mouseUpListener=U=>this._handleMouseUp(U),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((U=>this._handleTrim(U))),this.register(this._bufferService.buffers.onBufferActivate((U=>this._handleBufferActivate(U)))),this.enable(),this._model=new v.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,i.toDisposable)((()=>{this._removeMouseDownListeners()})))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){const c=this._model.finalSelectionStart,m=this._model.finalSelectionEnd;return!(!c||!m||c[0]===m[0]&&c[1]===m[1])}get selectionText(){const c=this._model.finalSelectionStart,m=this._model.finalSelectionEnd;if(!c||!m)return"";const y=this._bufferService.buffer,k=[];if(this._activeSelectionMode===3){if(c[0]===m[0])return"";const L=c[0]<m[0]?c[0]:m[0],w=c[0]<m[0]?m[0]:c[0];for(let x=c[1];x<=m[1];x++){const B=y.translateBufferLineToString(x,!0,L,w);k.push(B)}}else{const L=c[1]===m[1]?m[0]:void 0;k.push(y.translateBufferLineToString(c[1],!0,c[0],L));for(let w=c[1]+1;w<=m[1]-1;w++){const x=y.lines.get(w),B=y.translateBufferLineToString(w,!0);x!=null&&x.isWrapped?k[k.length-1]+=B:k.push(B)}if(c[1]!==m[1]){const w=y.lines.get(m[1]),x=y.translateBufferLineToString(m[1],!0,0,m[0]);w&&w.isWrapped?k[k.length-1]+=x:k.push(x)}}return k.map((L=>L.replace(u," "))).join(s.isWindows?`\r
`:`
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(c){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),s.isLinux&&c&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(c){const m=this._getMouseBufferCoords(c),y=this._model.finalSelectionStart,k=this._model.finalSelectionEnd;return!!(y&&k&&m)&&this._areCoordsInSelection(m,y,k)}isCellInSelection(c,m){const y=this._model.finalSelectionStart,k=this._model.finalSelectionEnd;return!(!y||!k)&&this._areCoordsInSelection([c,m],y,k)}_areCoordsInSelection(c,m,y){return c[1]>m[1]&&c[1]<y[1]||m[1]===y[1]&&c[1]===m[1]&&c[0]>=m[0]&&c[0]<y[0]||m[1]<y[1]&&c[1]===y[1]&&c[0]<y[0]||m[1]<y[1]&&c[1]===m[1]&&c[0]>=m[0]}_selectWordAtCursor(c,m){var L,w;const y=(w=(L=this._linkifier.currentLink)==null?void 0:L.link)==null?void 0:w.range;if(y)return this._model.selectionStart=[y.start.x-1,y.start.y-1],this._model.selectionStartLength=(0,e.getRangeLength)(y,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const k=this._getMouseBufferCoords(c);return!!k&&(this._selectWordAt(k,m),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(c,m){this._model.clearSelection(),c=Math.max(c,0),m=Math.min(m,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,c],this._model.selectionEnd=[this._bufferService.cols,m],this.refresh(),this._onSelectionChange.fire()}_handleTrim(c){this._model.handleTrim(c)&&this.refresh()}_getMouseBufferCoords(c){const m=this._mouseService.getCoords(c,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(m)return m[0]--,m[1]--,m[1]+=this._bufferService.buffer.ydisp,m}_getMouseEventScrollAmount(c){let m=(0,n.getCoordsRelativeToElement)(this._coreBrowserService.window,c,this._screenElement)[1];const y=this._renderService.dimensions.css.canvas.height;return m>=0&&m<=y?0:(m>y&&(m-=y),m=Math.min(Math.max(m,-50),50),m/=50,m/Math.abs(m)+Math.round(14*m))}shouldForceSelection(c){return s.isMac?c.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:c.shiftKey}handleMouseDown(c){if(this._mouseDownTimeStamp=c.timeStamp,(c.button!==2||!this.hasSelection)&&c.button===0){if(!this._enabled){if(!this.shouldForceSelection(c))return;c.stopPropagation()}c.preventDefault(),this._dragScrollAmount=0,this._enabled&&c.shiftKey?this._handleIncrementalClick(c):c.detail===1?this._handleSingleClick(c):c.detail===2?this._handleDoubleClick(c):c.detail===3&&this._handleTripleClick(c),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval((()=>this._dragScroll()),50)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(c){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(c))}_handleSingleClick(c){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(c)?3:0,this._model.selectionStart=this._getMouseBufferCoords(c),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const m=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);m&&m.length!==this._model.selectionStart[0]&&m.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(c){this._selectWordAtCursor(c,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(c){const m=this._getMouseBufferCoords(c);m&&(this._activeSelectionMode=2,this._selectLineAt(m[1]))}shouldColumnSelect(c){return c.altKey&&!(s.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(c){if(c.stopImmediatePropagation(),!this._model.selectionStart)return;const m=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(c),!this._model.selectionEnd)return void this.refresh(!0);this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(c),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const y=this._bufferService.buffer;if(this._model.selectionEnd[1]<y.lines.length){const k=y.lines.get(this._model.selectionEnd[1]);k&&k.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}m&&m[0]===this._model.selectionEnd[0]&&m[1]===this._model.selectionEnd[1]||this.refresh(!0)}_dragScroll(){if(this._model.selectionEnd&&this._model.selectionStart&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});const c=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(c.ydisp+this._bufferService.rows,c.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=c.ydisp),this.refresh()}}_handleMouseUp(c){const m=c.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&m<500&&c.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const y=this._mouseService.getCoords(c,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(y&&y[0]!==void 0&&y[1]!==void 0){const k=(0,d.moveToCellSequence)(y[0]-1,y[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(k,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const c=this._model.finalSelectionStart,m=this._model.finalSelectionEnd,y=!(!c||!m||c[0]===m[0]&&c[1]===m[1]);y?c&&m&&(this._oldSelectionStart&&this._oldSelectionEnd&&c[0]===this._oldSelectionStart[0]&&c[1]===this._oldSelectionStart[1]&&m[0]===this._oldSelectionEnd[0]&&m[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(c,m,y)):this._oldHasSelection&&this._fireOnSelectionChange(c,m,y)}_fireOnSelectionChange(c,m,y){this._oldSelectionStart=c,this._oldSelectionEnd=m,this._oldHasSelection=y,this._onSelectionChange.fire()}_handleBufferActivate(c){this.clearSelection(),this._trimListener.dispose(),this._trimListener=c.activeBuffer.lines.onTrim((m=>this._handleTrim(m)))}_convertViewportColToCharacterIndex(c,m){let y=m;for(let k=0;m>=k;k++){const L=c.loadCell(k,this._workCell).getChars().length;this._workCell.getWidth()===0?y--:L>1&&m!==k&&(y+=L-1)}return y}setSelection(c,m,y){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[c,m],this._model.selectionStartLength=y,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(c){this._isClickInSelection(c)||(this._selectWordAtCursor(c,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(c,m,y=!0,k=!0){if(c[0]>=this._bufferService.cols)return;const L=this._bufferService.buffer,w=L.lines.get(c[1]);if(!w)return;const x=L.translateBufferLineToString(c[1],!1);let B=this._convertViewportColToCharacterIndex(w,c[0]),P=B;const U=c[0]-B;let I=0,S=0,b=0,E=0;if(x.charAt(B)===" "){for(;B>0&&x.charAt(B-1)===" ";)B--;for(;P<x.length&&x.charAt(P+1)===" ";)P++}else{let H=c[0],N=c[0];w.getWidth(H)===0&&(I++,H--),w.getWidth(N)===2&&(S++,N++);const $=w.getString(N).length;for($>1&&(E+=$-1,P+=$-1);H>0&&B>0&&!this._isCharWordSeparator(w.loadCell(H-1,this._workCell));){w.loadCell(H-1,this._workCell);const R=this._workCell.getChars().length;this._workCell.getWidth()===0?(I++,H--):R>1&&(b+=R-1,B-=R-1),B--,H--}for(;N<w.length&&P+1<x.length&&!this._isCharWordSeparator(w.loadCell(N+1,this._workCell));){w.loadCell(N+1,this._workCell);const R=this._workCell.getChars().length;this._workCell.getWidth()===2?(S++,N++):R>1&&(E+=R-1,P+=R-1),P++,N++}}P++;let D=B+U-I+b,T=Math.min(this._bufferService.cols,P-B+I+S-b-E);if(m||x.slice(B,P).trim()!==""){if(y&&D===0&&w.getCodePoint(0)!==32){const H=L.lines.get(c[1]-1);if(H&&w.isWrapped&&H.getCodePoint(this._bufferService.cols-1)!==32){const N=this._getWordAt([this._bufferService.cols-1,c[1]-1],!1,!0,!1);if(N){const $=this._bufferService.cols-N.start;D-=$,T+=$}}}if(k&&D+T===this._bufferService.cols&&w.getCodePoint(this._bufferService.cols-1)!==32){const H=L.lines.get(c[1]+1);if(H!=null&&H.isWrapped&&H.getCodePoint(0)!==32){const N=this._getWordAt([0,c[1]+1],!1,!1,!0);N&&(T+=N.length)}}return{start:D,length:T}}}_selectWordAt(c,m){const y=this._getWordAt(c,m);if(y){for(;y.start<0;)y.start+=this._bufferService.cols,c[1]--;this._model.selectionStart=[y.start,c[1]],this._model.selectionStartLength=y.length}}_selectToWordAt(c){const m=this._getWordAt(c,!0);if(m){let y=c[1];for(;m.start<0;)m.start+=this._bufferService.cols,y--;if(!this._model.areSelectionValuesReversed())for(;m.start+m.length>this._bufferService.cols;)m.length-=this._bufferService.cols,y++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?m.start:m.start+m.length,y]}}_isCharWordSeparator(c){return c.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(c.getChars())>=0}_selectLineAt(c){const m=this._bufferService.buffer.getWrappedRangeForLine(c),y={start:{x:0,y:m.first},end:{x:this._bufferService.cols-1,y:m.last}};this._model.selectionStart=[0,m.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,e.getRangeLength)(y,this._bufferService.cols)}};r.SelectionService=p=l([_(3,o.IBufferService),_(4,o.ICoreService),_(5,g.IMouseService),_(6,o.IOptionsService),_(7,g.IRenderService),_(8,g.ICoreBrowserService)],p)},4725:(O,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ILinkProviderService=r.IThemeService=r.ICharacterJoinerService=r.ISelectionService=r.IRenderService=r.IMouseService=r.ICoreBrowserService=r.ICharSizeService=void 0;const l=a(8343);r.ICharSizeService=(0,l.createDecorator)("CharSizeService"),r.ICoreBrowserService=(0,l.createDecorator)("CoreBrowserService"),r.IMouseService=(0,l.createDecorator)("MouseService"),r.IRenderService=(0,l.createDecorator)("RenderService"),r.ISelectionService=(0,l.createDecorator)("SelectionService"),r.ICharacterJoinerService=(0,l.createDecorator)("CharacterJoinerService"),r.IThemeService=(0,l.createDecorator)("ThemeService"),r.ILinkProviderService=(0,l.createDecorator)("LinkProviderService")},6731:function(O,r,a){var l=this&&this.__decorate||function(p,c,m,y){var k,L=arguments.length,w=L<3?c:y===null?y=Object.getOwnPropertyDescriptor(c,m):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(p,c,m,y);else for(var x=p.length-1;x>=0;x--)(k=p[x])&&(w=(L<3?k(w):L>3?k(c,m,w):k(c,m))||w);return L>3&&w&&Object.defineProperty(c,m,w),w},_=this&&this.__param||function(p,c){return function(m,y){c(m,y,p)}};Object.defineProperty(r,"__esModule",{value:!0}),r.ThemeService=r.DEFAULT_ANSI_COLORS=void 0;const n=a(7239),d=a(8055),v=a(8460),g=a(844),h=a(2585),i=d.css.toColor("#ffffff"),s=d.css.toColor("#000000"),e=d.css.toColor("#ffffff"),t=d.css.toColor("#000000"),o={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};r.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const p=[d.css.toColor("#2e3436"),d.css.toColor("#cc0000"),d.css.toColor("#4e9a06"),d.css.toColor("#c4a000"),d.css.toColor("#3465a4"),d.css.toColor("#75507b"),d.css.toColor("#06989a"),d.css.toColor("#d3d7cf"),d.css.toColor("#555753"),d.css.toColor("#ef2929"),d.css.toColor("#8ae234"),d.css.toColor("#fce94f"),d.css.toColor("#729fcf"),d.css.toColor("#ad7fa8"),d.css.toColor("#34e2e2"),d.css.toColor("#eeeeec")],c=[0,95,135,175,215,255];for(let m=0;m<216;m++){const y=c[m/36%6|0],k=c[m/6%6|0],L=c[m%6];p.push({css:d.channels.toCss(y,k,L),rgba:d.channels.toRgba(y,k,L)})}for(let m=0;m<24;m++){const y=8+10*m;p.push({css:d.channels.toCss(y,y,y),rgba:d.channels.toRgba(y,y,y)})}return p})());let f=r.ThemeService=class extends g.Disposable{get colors(){return this._colors}constructor(p){super(),this._optionsService=p,this._contrastCache=new n.ColorContrastCache,this._halfContrastCache=new n.ColorContrastCache,this._onChangeColors=this.register(new v.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:i,background:s,cursor:e,cursorAccent:t,selectionForeground:void 0,selectionBackgroundTransparent:o,selectionBackgroundOpaque:d.color.blend(s,o),selectionInactiveBackgroundTransparent:o,selectionInactiveBackgroundOpaque:d.color.blend(s,o),ansi:r.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",(()=>this._contrastCache.clear()))),this.register(this._optionsService.onSpecificOptionChange("theme",(()=>this._setTheme(this._optionsService.rawOptions.theme))))}_setTheme(p={}){const c=this._colors;if(c.foreground=u(p.foreground,i),c.background=u(p.background,s),c.cursor=u(p.cursor,e),c.cursorAccent=u(p.cursorAccent,t),c.selectionBackgroundTransparent=u(p.selectionBackground,o),c.selectionBackgroundOpaque=d.color.blend(c.background,c.selectionBackgroundTransparent),c.selectionInactiveBackgroundTransparent=u(p.selectionInactiveBackground,c.selectionBackgroundTransparent),c.selectionInactiveBackgroundOpaque=d.color.blend(c.background,c.selectionInactiveBackgroundTransparent),c.selectionForeground=p.selectionForeground?u(p.selectionForeground,d.NULL_COLOR):void 0,c.selectionForeground===d.NULL_COLOR&&(c.selectionForeground=void 0),d.color.isOpaque(c.selectionBackgroundTransparent)&&(c.selectionBackgroundTransparent=d.color.opacity(c.selectionBackgroundTransparent,.3)),d.color.isOpaque(c.selectionInactiveBackgroundTransparent)&&(c.selectionInactiveBackgroundTransparent=d.color.opacity(c.selectionInactiveBackgroundTransparent,.3)),c.ansi=r.DEFAULT_ANSI_COLORS.slice(),c.ansi[0]=u(p.black,r.DEFAULT_ANSI_COLORS[0]),c.ansi[1]=u(p.red,r.DEFAULT_ANSI_COLORS[1]),c.ansi[2]=u(p.green,r.DEFAULT_ANSI_COLORS[2]),c.ansi[3]=u(p.yellow,r.DEFAULT_ANSI_COLORS[3]),c.ansi[4]=u(p.blue,r.DEFAULT_ANSI_COLORS[4]),c.ansi[5]=u(p.magenta,r.DEFAULT_ANSI_COLORS[5]),c.ansi[6]=u(p.cyan,r.DEFAULT_ANSI_COLORS[6]),c.ansi[7]=u(p.white,r.DEFAULT_ANSI_COLORS[7]),c.ansi[8]=u(p.brightBlack,r.DEFAULT_ANSI_COLORS[8]),c.ansi[9]=u(p.brightRed,r.DEFAULT_ANSI_COLORS[9]),c.ansi[10]=u(p.brightGreen,r.DEFAULT_ANSI_COLORS[10]),c.ansi[11]=u(p.brightYellow,r.DEFAULT_ANSI_COLORS[11]),c.ansi[12]=u(p.brightBlue,r.DEFAULT_ANSI_COLORS[12]),c.ansi[13]=u(p.brightMagenta,r.DEFAULT_ANSI_COLORS[13]),c.ansi[14]=u(p.brightCyan,r.DEFAULT_ANSI_COLORS[14]),c.ansi[15]=u(p.brightWhite,r.DEFAULT_ANSI_COLORS[15]),p.extendedAnsi){const m=Math.min(c.ansi.length-16,p.extendedAnsi.length);for(let y=0;y<m;y++)c.ansi[y+16]=u(p.extendedAnsi[y],r.DEFAULT_ANSI_COLORS[y+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(p){this._restoreColor(p),this._onChangeColors.fire(this.colors)}_restoreColor(p){if(p!==void 0)switch(p){case 256:this._colors.foreground=this._restoreColors.foreground;break;case 257:this._colors.background=this._restoreColors.background;break;case 258:this._colors.cursor=this._restoreColors.cursor;break;default:this._colors.ansi[p]=this._restoreColors.ansi[p]}else for(let c=0;c<this._restoreColors.ansi.length;++c)this._colors.ansi[c]=this._restoreColors.ansi[c]}modifyColors(p){p(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};function u(p,c){if(p!==void 0)try{return d.css.toColor(p)}catch{}return c}r.ThemeService=f=l([_(0,h.IOptionsService)],f)},6349:(O,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CircularList=void 0;const l=a(8460),_=a(844);class n extends _.Disposable{constructor(v){super(),this._maxLength=v,this.onDeleteEmitter=this.register(new l.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new l.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new l.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(v){if(this._maxLength===v)return;const g=new Array(v);for(let h=0;h<Math.min(v,this.length);h++)g[h]=this._array[this._getCyclicIndex(h)];this._array=g,this._maxLength=v,this._startIndex=0}get length(){return this._length}set length(v){if(v>this._length)for(let g=this._length;g<v;g++)this._array[g]=void 0;this._length=v}get(v){return this._array[this._getCyclicIndex(v)]}set(v,g){this._array[this._getCyclicIndex(v)]=g}push(v){this._array[this._getCyclicIndex(this._length)]=v,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(v,g,...h){if(g){for(let i=v;i<this._length-g;i++)this._array[this._getCyclicIndex(i)]=this._array[this._getCyclicIndex(i+g)];this._length-=g,this.onDeleteEmitter.fire({index:v,amount:g})}for(let i=this._length-1;i>=v;i--)this._array[this._getCyclicIndex(i+h.length)]=this._array[this._getCyclicIndex(i)];for(let i=0;i<h.length;i++)this._array[this._getCyclicIndex(v+i)]=h[i];if(h.length&&this.onInsertEmitter.fire({index:v,amount:h.length}),this._length+h.length>this._maxLength){const i=this._length+h.length-this._maxLength;this._startIndex+=i,this._length=this._maxLength,this.onTrimEmitter.fire(i)}else this._length+=h.length}trimStart(v){v>this._length&&(v=this._length),this._startIndex+=v,this._length-=v,this.onTrimEmitter.fire(v)}shiftElements(v,g,h){if(!(g<=0)){if(v<0||v>=this._length)throw new Error("start argument out of range");if(v+h<0)throw new Error("Cannot shift elements in list beyond index 0");if(h>0){for(let s=g-1;s>=0;s--)this.set(v+s+h,this.get(v+s));const i=v+g+h-this._length;if(i>0)for(this._length+=i;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let i=0;i<g;i++)this.set(v+i+h,this.get(v+i))}}_getCyclicIndex(v){return(this._startIndex+v)%this._maxLength}}r.CircularList=n},1439:(O,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.clone=void 0,r.clone=function a(l,_=5){if(typeof l!="object")return l;const n=Array.isArray(l)?[]:{};for(const d in l)n[d]=_<=1?l[d]:l[d]&&a(l[d],_-1);return n}},8055:(O,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.contrastRatio=r.toPaddedHex=r.rgba=r.rgb=r.css=r.color=r.channels=r.NULL_COLOR=void 0;let a=0,l=0,_=0,n=0;var d,v,g,h,i;function s(t){const o=t.toString(16);return o.length<2?"0"+o:o}function e(t,o){return t<o?(o+.05)/(t+.05):(t+.05)/(o+.05)}r.NULL_COLOR={css:"#00000000",rgba:0},(function(t){t.toCss=function(o,f,u,p){return p!==void 0?`#${s(o)}${s(f)}${s(u)}${s(p)}`:`#${s(o)}${s(f)}${s(u)}`},t.toRgba=function(o,f,u,p=255){return(o<<24|f<<16|u<<8|p)>>>0},t.toColor=function(o,f,u,p){return{css:t.toCss(o,f,u,p),rgba:t.toRgba(o,f,u,p)}}})(d||(r.channels=d={})),(function(t){function o(f,u){return n=Math.round(255*u),[a,l,_]=i.toChannels(f.rgba),{css:d.toCss(a,l,_,n),rgba:d.toRgba(a,l,_,n)}}t.blend=function(f,u){if(n=(255&u.rgba)/255,n===1)return{css:u.css,rgba:u.rgba};const p=u.rgba>>24&255,c=u.rgba>>16&255,m=u.rgba>>8&255,y=f.rgba>>24&255,k=f.rgba>>16&255,L=f.rgba>>8&255;return a=y+Math.round((p-y)*n),l=k+Math.round((c-k)*n),_=L+Math.round((m-L)*n),{css:d.toCss(a,l,_),rgba:d.toRgba(a,l,_)}},t.isOpaque=function(f){return(255&f.rgba)==255},t.ensureContrastRatio=function(f,u,p){const c=i.ensureContrastRatio(f.rgba,u.rgba,p);if(c)return d.toColor(c>>24&255,c>>16&255,c>>8&255)},t.opaque=function(f){const u=(255|f.rgba)>>>0;return[a,l,_]=i.toChannels(u),{css:d.toCss(a,l,_),rgba:u}},t.opacity=o,t.multiplyOpacity=function(f,u){return n=255&f.rgba,o(f,n*u/255)},t.toColorRGB=function(f){return[f.rgba>>24&255,f.rgba>>16&255,f.rgba>>8&255]}})(v||(r.color=v={})),(function(t){let o,f;try{const u=document.createElement("canvas");u.width=1,u.height=1;const p=u.getContext("2d",{willReadFrequently:!0});p&&(o=p,o.globalCompositeOperation="copy",f=o.createLinearGradient(0,0,1,1))}catch{}t.toColor=function(u){if(u.match(/#[\da-f]{3,8}/i))switch(u.length){case 4:return a=parseInt(u.slice(1,2).repeat(2),16),l=parseInt(u.slice(2,3).repeat(2),16),_=parseInt(u.slice(3,4).repeat(2),16),d.toColor(a,l,_);case 5:return a=parseInt(u.slice(1,2).repeat(2),16),l=parseInt(u.slice(2,3).repeat(2),16),_=parseInt(u.slice(3,4).repeat(2),16),n=parseInt(u.slice(4,5).repeat(2),16),d.toColor(a,l,_,n);case 7:return{css:u,rgba:(parseInt(u.slice(1),16)<<8|255)>>>0};case 9:return{css:u,rgba:parseInt(u.slice(1),16)>>>0}}const p=u.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(p)return a=parseInt(p[1]),l=parseInt(p[2]),_=parseInt(p[3]),n=Math.round(255*(p[5]===void 0?1:parseFloat(p[5]))),d.toColor(a,l,_,n);if(!o||!f)throw new Error("css.toColor: Unsupported css format");if(o.fillStyle=f,o.fillStyle=u,typeof o.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(o.fillRect(0,0,1,1),[a,l,_,n]=o.getImageData(0,0,1,1).data,n!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:d.toRgba(a,l,_,n),css:u}}})(g||(r.css=g={})),(function(t){function o(f,u,p){const c=f/255,m=u/255,y=p/255;return .2126*(c<=.03928?c/12.92:Math.pow((c+.055)/1.055,2.4))+.7152*(m<=.03928?m/12.92:Math.pow((m+.055)/1.055,2.4))+.0722*(y<=.03928?y/12.92:Math.pow((y+.055)/1.055,2.4))}t.relativeLuminance=function(f){return o(f>>16&255,f>>8&255,255&f)},t.relativeLuminance2=o})(h||(r.rgb=h={})),(function(t){function o(u,p,c){const m=u>>24&255,y=u>>16&255,k=u>>8&255;let L=p>>24&255,w=p>>16&255,x=p>>8&255,B=e(h.relativeLuminance2(L,w,x),h.relativeLuminance2(m,y,k));for(;B<c&&(L>0||w>0||x>0);)L-=Math.max(0,Math.ceil(.1*L)),w-=Math.max(0,Math.ceil(.1*w)),x-=Math.max(0,Math.ceil(.1*x)),B=e(h.relativeLuminance2(L,w,x),h.relativeLuminance2(m,y,k));return(L<<24|w<<16|x<<8|255)>>>0}function f(u,p,c){const m=u>>24&255,y=u>>16&255,k=u>>8&255;let L=p>>24&255,w=p>>16&255,x=p>>8&255,B=e(h.relativeLuminance2(L,w,x),h.relativeLuminance2(m,y,k));for(;B<c&&(L<255||w<255||x<255);)L=Math.min(255,L+Math.ceil(.1*(255-L))),w=Math.min(255,w+Math.ceil(.1*(255-w))),x=Math.min(255,x+Math.ceil(.1*(255-x))),B=e(h.relativeLuminance2(L,w,x),h.relativeLuminance2(m,y,k));return(L<<24|w<<16|x<<8|255)>>>0}t.blend=function(u,p){if(n=(255&p)/255,n===1)return p;const c=p>>24&255,m=p>>16&255,y=p>>8&255,k=u>>24&255,L=u>>16&255,w=u>>8&255;return a=k+Math.round((c-k)*n),l=L+Math.round((m-L)*n),_=w+Math.round((y-w)*n),d.toRgba(a,l,_)},t.ensureContrastRatio=function(u,p,c){const m=h.relativeLuminance(u>>8),y=h.relativeLuminance(p>>8);if(e(m,y)<c){if(y<m){const w=o(u,p,c),x=e(m,h.relativeLuminance(w>>8));if(x<c){const B=f(u,p,c);return x>e(m,h.relativeLuminance(B>>8))?w:B}return w}const k=f(u,p,c),L=e(m,h.relativeLuminance(k>>8));if(L<c){const w=o(u,p,c);return L>e(m,h.relativeLuminance(w>>8))?k:w}return k}},t.reduceLuminance=o,t.increaseLuminance=f,t.toChannels=function(u){return[u>>24&255,u>>16&255,u>>8&255,255&u]}})(i||(r.rgba=i={})),r.toPaddedHex=s,r.contrastRatio=e},8969:(O,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CoreTerminal=void 0;const l=a(844),_=a(2585),n=a(4348),d=a(7866),v=a(744),g=a(7302),h=a(6975),i=a(8460),s=a(1753),e=a(1480),t=a(7994),o=a(9282),f=a(5435),u=a(5981),p=a(2660);let c=!1;class m extends l.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new i.EventEmitter),this._onScroll.event((k=>{var L;(L=this._onScrollApi)==null||L.fire(k.position)}))),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(k){for(const L in k)this.optionsService.options[L]=k[L]}constructor(k){super(),this._windowsWrappingHeuristics=this.register(new l.MutableDisposable),this._onBinary=this.register(new i.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new i.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new i.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new i.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new i.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new i.EventEmitter),this._instantiationService=new n.InstantiationService,this.optionsService=this.register(new g.OptionsService(k)),this._instantiationService.setService(_.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(v.BufferService)),this._instantiationService.setService(_.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(d.LogService)),this._instantiationService.setService(_.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(h.CoreService)),this._instantiationService.setService(_.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(s.CoreMouseService)),this._instantiationService.setService(_.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(e.UnicodeService)),this._instantiationService.setService(_.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(t.CharsetService),this._instantiationService.setService(_.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(p.OscLinkService),this._instantiationService.setService(_.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new f.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,i.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,i.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,i.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,i.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom((()=>this.scrollToBottom()))),this.register(this.coreService.onUserInput((()=>this._writeBuffer.handleUserInput()))),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],(()=>this._handleWindowsPtyOptionChange()))),this.register(this._bufferService.onScroll((L=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this.register(this._inputHandler.onScroll((L=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this._writeBuffer=this.register(new u.WriteBuffer(((L,w)=>this._inputHandler.parse(L,w)))),this.register((0,i.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(k,L){this._writeBuffer.write(k,L)}writeSync(k,L){this._logService.logLevel<=_.LogLevelEnum.WARN&&!c&&(this._logService.warn("writeSync is unreliable and will be removed soon."),c=!0),this._writeBuffer.writeSync(k,L)}input(k,L=!0){this.coreService.triggerDataEvent(k,L)}resize(k,L){isNaN(k)||isNaN(L)||(k=Math.max(k,v.MINIMUM_COLS),L=Math.max(L,v.MINIMUM_ROWS),this._bufferService.resize(k,L))}scroll(k,L=!1){this._bufferService.scroll(k,L)}scrollLines(k,L,w){this._bufferService.scrollLines(k,L,w)}scrollPages(k){this.scrollLines(k*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(k){const L=k-this._bufferService.buffer.ydisp;L!==0&&this.scrollLines(L)}registerEscHandler(k,L){return this._inputHandler.registerEscHandler(k,L)}registerDcsHandler(k,L){return this._inputHandler.registerDcsHandler(k,L)}registerCsiHandler(k,L){return this._inputHandler.registerCsiHandler(k,L)}registerOscHandler(k,L){return this._inputHandler.registerOscHandler(k,L)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let k=!1;const L=this.optionsService.rawOptions.windowsPty;L&&L.buildNumber!==void 0&&L.buildNumber!==void 0?k=L.backend==="conpty"&&L.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(k=!0),k?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const k=[];k.push(this.onLineFeed(o.updateWindowsModeWrappedState.bind(null,this._bufferService))),k.push(this.registerCsiHandler({final:"H"},(()=>((0,o.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,l.toDisposable)((()=>{for(const L of k)L.dispose()}))}}}r.CoreTerminal=m},8460:(O,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.runAndSubscribe=r.forwardEvent=r.EventEmitter=void 0,r.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=a=>(this._listeners.push(a),{dispose:()=>{if(!this._disposed){for(let l=0;l<this._listeners.length;l++)if(this._listeners[l]===a)return void this._listeners.splice(l,1)}}})),this._event}fire(a,l){const _=[];for(let n=0;n<this._listeners.length;n++)_.push(this._listeners[n]);for(let n=0;n<_.length;n++)_[n].call(void 0,a,l)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},r.forwardEvent=function(a,l){return a((_=>l.fire(_)))},r.runAndSubscribe=function(a,l){return l(void 0),a((_=>l(_)))}},5435:function(O,r,a){var l=this&&this.__decorate||function(I,S,b,E){var D,T=arguments.length,H=T<3?S:E===null?E=Object.getOwnPropertyDescriptor(S,b):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")H=Reflect.decorate(I,S,b,E);else for(var N=I.length-1;N>=0;N--)(D=I[N])&&(H=(T<3?D(H):T>3?D(S,b,H):D(S,b))||H);return T>3&&H&&Object.defineProperty(S,b,H),H},_=this&&this.__param||function(I,S){return function(b,E){S(b,E,I)}};Object.defineProperty(r,"__esModule",{value:!0}),r.InputHandler=r.WindowsOptionsReportType=void 0;const n=a(2584),d=a(7116),v=a(2015),g=a(844),h=a(482),i=a(8437),s=a(8460),e=a(643),t=a(511),o=a(3734),f=a(2585),u=a(1480),p=a(6242),c=a(6351),m=a(5941),y={"(":0,")":1,"*":2,"+":3,"-":1,".":2},k=131072;function L(I,S){if(I>24)return S.setWinLines||!1;switch(I){case 1:return!!S.restoreWin;case 2:return!!S.minimizeWin;case 3:return!!S.setWinPosition;case 4:return!!S.setWinSizePixels;case 5:return!!S.raiseWin;case 6:return!!S.lowerWin;case 7:return!!S.refreshWin;case 8:return!!S.setWinSizeChars;case 9:return!!S.maximizeWin;case 10:return!!S.fullscreenWin;case 11:return!!S.getWinState;case 13:return!!S.getWinPosition;case 14:return!!S.getWinSizePixels;case 15:return!!S.getScreenSizePixels;case 16:return!!S.getCellSizePixels;case 18:return!!S.getWinSizeChars;case 19:return!!S.getScreenSizeChars;case 20:return!!S.getIconTitle;case 21:return!!S.getWinTitle;case 22:return!!S.pushTitle;case 23:return!!S.popTitle;case 24:return!!S.setWinLines}return!1}var w;(function(I){I[I.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",I[I.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(w||(r.WindowsOptionsReportType=w={}));let x=0;class B extends g.Disposable{getAttrData(){return this._curAttrData}constructor(S,b,E,D,T,H,N,$,R=new v.EscapeSequenceParser){super(),this._bufferService=S,this._charsetService=b,this._coreService=E,this._logService=D,this._optionsService=T,this._oscLinkService=H,this._coreMouseService=N,this._unicodeService=$,this._parser=R,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new h.StringToUtf32,this._utf8Decoder=new h.Utf8ToUtf32,this._workCell=new t.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=i.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=i.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new s.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new s.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new s.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new s.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new s.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new s.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new s.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new s.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new s.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new s.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new s.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new s.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new s.EventEmitter),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._dirtyRowTracker=new P(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((C=>this._activeBuffer=C.activeBuffer))),this._parser.setCsiHandlerFallback(((C,M)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(C),params:M.toArray()})})),this._parser.setEscHandlerFallback((C=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(C)})})),this._parser.setExecuteHandlerFallback((C=>{this._logService.debug("Unknown EXECUTE code: ",{code:C})})),this._parser.setOscHandlerFallback(((C,M,A)=>{this._logService.debug("Unknown OSC code: ",{identifier:C,action:M,data:A})})),this._parser.setDcsHandlerFallback(((C,M,A)=>{M==="HOOK"&&(A=A.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(C),action:M,payload:A})})),this._parser.setPrintHandler(((C,M,A)=>this.print(C,M,A))),this._parser.registerCsiHandler({final:"@"},(C=>this.insertChars(C))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(C=>this.scrollLeft(C))),this._parser.registerCsiHandler({final:"A"},(C=>this.cursorUp(C))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(C=>this.scrollRight(C))),this._parser.registerCsiHandler({final:"B"},(C=>this.cursorDown(C))),this._parser.registerCsiHandler({final:"C"},(C=>this.cursorForward(C))),this._parser.registerCsiHandler({final:"D"},(C=>this.cursorBackward(C))),this._parser.registerCsiHandler({final:"E"},(C=>this.cursorNextLine(C))),this._parser.registerCsiHandler({final:"F"},(C=>this.cursorPrecedingLine(C))),this._parser.registerCsiHandler({final:"G"},(C=>this.cursorCharAbsolute(C))),this._parser.registerCsiHandler({final:"H"},(C=>this.cursorPosition(C))),this._parser.registerCsiHandler({final:"I"},(C=>this.cursorForwardTab(C))),this._parser.registerCsiHandler({final:"J"},(C=>this.eraseInDisplay(C,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(C=>this.eraseInDisplay(C,!0))),this._parser.registerCsiHandler({final:"K"},(C=>this.eraseInLine(C,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(C=>this.eraseInLine(C,!0))),this._parser.registerCsiHandler({final:"L"},(C=>this.insertLines(C))),this._parser.registerCsiHandler({final:"M"},(C=>this.deleteLines(C))),this._parser.registerCsiHandler({final:"P"},(C=>this.deleteChars(C))),this._parser.registerCsiHandler({final:"S"},(C=>this.scrollUp(C))),this._parser.registerCsiHandler({final:"T"},(C=>this.scrollDown(C))),this._parser.registerCsiHandler({final:"X"},(C=>this.eraseChars(C))),this._parser.registerCsiHandler({final:"Z"},(C=>this.cursorBackwardTab(C))),this._parser.registerCsiHandler({final:"`"},(C=>this.charPosAbsolute(C))),this._parser.registerCsiHandler({final:"a"},(C=>this.hPositionRelative(C))),this._parser.registerCsiHandler({final:"b"},(C=>this.repeatPrecedingCharacter(C))),this._parser.registerCsiHandler({final:"c"},(C=>this.sendDeviceAttributesPrimary(C))),this._parser.registerCsiHandler({prefix:">",final:"c"},(C=>this.sendDeviceAttributesSecondary(C))),this._parser.registerCsiHandler({final:"d"},(C=>this.linePosAbsolute(C))),this._parser.registerCsiHandler({final:"e"},(C=>this.vPositionRelative(C))),this._parser.registerCsiHandler({final:"f"},(C=>this.hVPosition(C))),this._parser.registerCsiHandler({final:"g"},(C=>this.tabClear(C))),this._parser.registerCsiHandler({final:"h"},(C=>this.setMode(C))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(C=>this.setModePrivate(C))),this._parser.registerCsiHandler({final:"l"},(C=>this.resetMode(C))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(C=>this.resetModePrivate(C))),this._parser.registerCsiHandler({final:"m"},(C=>this.charAttributes(C))),this._parser.registerCsiHandler({final:"n"},(C=>this.deviceStatus(C))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(C=>this.deviceStatusPrivate(C))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(C=>this.softReset(C))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(C=>this.setCursorStyle(C))),this._parser.registerCsiHandler({final:"r"},(C=>this.setScrollRegion(C))),this._parser.registerCsiHandler({final:"s"},(C=>this.saveCursor(C))),this._parser.registerCsiHandler({final:"t"},(C=>this.windowOptions(C))),this._parser.registerCsiHandler({final:"u"},(C=>this.restoreCursor(C))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(C=>this.insertColumns(C))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(C=>this.deleteColumns(C))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(C=>this.selectProtected(C))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(C=>this.requestMode(C,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(C=>this.requestMode(C,!1))),this._parser.setExecuteHandler(n.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(n.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(n.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(n.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(n.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(n.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(n.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(n.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(n.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(n.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(n.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(n.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new p.OscHandler((C=>(this.setTitle(C),this.setIconName(C),!0)))),this._parser.registerOscHandler(1,new p.OscHandler((C=>this.setIconName(C)))),this._parser.registerOscHandler(2,new p.OscHandler((C=>this.setTitle(C)))),this._parser.registerOscHandler(4,new p.OscHandler((C=>this.setOrReportIndexedColor(C)))),this._parser.registerOscHandler(8,new p.OscHandler((C=>this.setHyperlink(C)))),this._parser.registerOscHandler(10,new p.OscHandler((C=>this.setOrReportFgColor(C)))),this._parser.registerOscHandler(11,new p.OscHandler((C=>this.setOrReportBgColor(C)))),this._parser.registerOscHandler(12,new p.OscHandler((C=>this.setOrReportCursorColor(C)))),this._parser.registerOscHandler(104,new p.OscHandler((C=>this.restoreIndexedColor(C)))),this._parser.registerOscHandler(110,new p.OscHandler((C=>this.restoreFgColor(C)))),this._parser.registerOscHandler(111,new p.OscHandler((C=>this.restoreBgColor(C)))),this._parser.registerOscHandler(112,new p.OscHandler((C=>this.restoreCursorColor(C)))),this._parser.registerEscHandler({final:"7"},(()=>this.saveCursor())),this._parser.registerEscHandler({final:"8"},(()=>this.restoreCursor())),this._parser.registerEscHandler({final:"D"},(()=>this.index())),this._parser.registerEscHandler({final:"E"},(()=>this.nextLine())),this._parser.registerEscHandler({final:"H"},(()=>this.tabSet())),this._parser.registerEscHandler({final:"M"},(()=>this.reverseIndex())),this._parser.registerEscHandler({final:"="},(()=>this.keypadApplicationMode())),this._parser.registerEscHandler({final:">"},(()=>this.keypadNumericMode())),this._parser.registerEscHandler({final:"c"},(()=>this.fullReset())),this._parser.registerEscHandler({final:"n"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"o"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"|"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"}"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"~"},(()=>this.setgLevel(1))),this._parser.registerEscHandler({intermediates:"%",final:"@"},(()=>this.selectDefaultCharset())),this._parser.registerEscHandler({intermediates:"%",final:"G"},(()=>this.selectDefaultCharset()));for(const C in d.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:C},(()=>this.selectCharset("("+C))),this._parser.registerEscHandler({intermediates:")",final:C},(()=>this.selectCharset(")"+C))),this._parser.registerEscHandler({intermediates:"*",final:C},(()=>this.selectCharset("*"+C))),this._parser.registerEscHandler({intermediates:"+",final:C},(()=>this.selectCharset("+"+C))),this._parser.registerEscHandler({intermediates:"-",final:C},(()=>this.selectCharset("-"+C))),this._parser.registerEscHandler({intermediates:".",final:C},(()=>this.selectCharset("."+C))),this._parser.registerEscHandler({intermediates:"/",final:C},(()=>this.selectCharset("/"+C)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((C=>(this._logService.error("Parsing error: ",C),C))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new c.DcsHandler(((C,M)=>this.requestStatusString(C,M))))}_preserveStack(S,b,E,D){this._parseStack.paused=!0,this._parseStack.cursorStartX=S,this._parseStack.cursorStartY=b,this._parseStack.decodedLength=E,this._parseStack.position=D}_logSlowResolvingAsync(S){this._logService.logLevel<=f.LogLevelEnum.WARN&&Promise.race([S,new Promise(((b,E)=>setTimeout((()=>E("#SLOW_TIMEOUT")),5e3)))]).catch((b=>{if(b!=="#SLOW_TIMEOUT")throw b;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(S,b){let E,D=this._activeBuffer.x,T=this._activeBuffer.y,H=0;const N=this._parseStack.paused;if(N){if(E=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,b))return this._logSlowResolvingAsync(E),E;D=this._parseStack.cursorStartX,T=this._parseStack.cursorStartY,this._parseStack.paused=!1,S.length>k&&(H=this._parseStack.position+k)}if(this._logService.logLevel<=f.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof S=="string"?` "${S}"`:` "${Array.prototype.map.call(S,(C=>String.fromCharCode(C))).join("")}"`),typeof S=="string"?S.split("").map((C=>C.charCodeAt(0))):S),this._parseBuffer.length<S.length&&this._parseBuffer.length<k&&(this._parseBuffer=new Uint32Array(Math.min(S.length,k))),N||this._dirtyRowTracker.clearRange(),S.length>k)for(let C=H;C<S.length;C+=k){const M=C+k<S.length?C+k:S.length,A=typeof S=="string"?this._stringDecoder.decode(S.substring(C,M),this._parseBuffer):this._utf8Decoder.decode(S.subarray(C,M),this._parseBuffer);if(E=this._parser.parse(this._parseBuffer,A))return this._preserveStack(D,T,A,C),this._logSlowResolvingAsync(E),E}else if(!N){const C=typeof S=="string"?this._stringDecoder.decode(S,this._parseBuffer):this._utf8Decoder.decode(S,this._parseBuffer);if(E=this._parser.parse(this._parseBuffer,C))return this._preserveStack(D,T,C,0),this._logSlowResolvingAsync(E),E}this._activeBuffer.x===D&&this._activeBuffer.y===T||this._onCursorMove.fire();const $=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),R=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);R<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(R,this._bufferService.rows-1),Math.min($,this._bufferService.rows-1))}print(S,b,E){let D,T;const H=this._charsetService.charset,N=this._optionsService.rawOptions.screenReaderMode,$=this._bufferService.cols,R=this._coreService.decPrivateModes.wraparound,C=this._coreService.modes.insertMode,M=this._curAttrData;let A=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&E-b>0&&A.getWidth(this._activeBuffer.x-1)===2&&A.setCellFromCodepoint(this._activeBuffer.x-1,0,1,M);let W=this._parser.precedingJoinState;for(let F=b;F<E;++F){if(D=S[F],D<127&&H){const X=H[String.fromCharCode(D)];X&&(D=X.charCodeAt(0))}const z=this._unicodeService.charProperties(D,W);T=u.UnicodeService.extractWidth(z);const q=u.UnicodeService.extractShouldJoin(z),V=q?u.UnicodeService.extractWidth(W):0;if(W=z,N&&this._onA11yChar.fire((0,h.stringFromCodePoint)(D)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+T-V>$){if(R){const X=A;let j=this._activeBuffer.x-V;for(this._activeBuffer.x=V,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),A=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),V>0&&A instanceof i.BufferLine&&A.copyCellsFrom(X,j,0,V,!1);j<$;)X.setCellFromCodepoint(j++,0,1,M)}else if(this._activeBuffer.x=$-1,T===2)continue}if(q&&this._activeBuffer.x){const X=A.getWidth(this._activeBuffer.x-1)?1:2;A.addCodepointToCell(this._activeBuffer.x-X,D,T);for(let j=T-V;--j>=0;)A.setCellFromCodepoint(this._activeBuffer.x++,0,0,M)}else if(C&&(A.insertCells(this._activeBuffer.x,T-V,this._activeBuffer.getNullCell(M)),A.getWidth($-1)===2&&A.setCellFromCodepoint($-1,e.NULL_CELL_CODE,e.NULL_CELL_WIDTH,M)),A.setCellFromCodepoint(this._activeBuffer.x++,D,T,M),T>0)for(;--T;)A.setCellFromCodepoint(this._activeBuffer.x++,0,0,M)}this._parser.precedingJoinState=W,this._activeBuffer.x<$&&E-b>0&&A.getWidth(this._activeBuffer.x)===0&&!A.hasContent(this._activeBuffer.x)&&A.setCellFromCodepoint(this._activeBuffer.x,0,1,M),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(S,b){return S.final!=="t"||S.prefix||S.intermediates?this._parser.registerCsiHandler(S,b):this._parser.registerCsiHandler(S,(E=>!L(E.params[0],this._optionsService.rawOptions.windowOptions)||b(E)))}registerDcsHandler(S,b){return this._parser.registerDcsHandler(S,new c.DcsHandler(b))}registerEscHandler(S,b){return this._parser.registerEscHandler(S,b)}registerOscHandler(S,b){return this._parser.registerOscHandler(S,new p.OscHandler(b))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){var S;if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&((S=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&S.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const b=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);b.hasWidth(this._activeBuffer.x)&&!b.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const S=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-S),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(S=this._bufferService.cols-1){this._activeBuffer.x=Math.min(S,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(S,b){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=S,this._activeBuffer.y=this._activeBuffer.scrollTop+b):(this._activeBuffer.x=S,this._activeBuffer.y=b),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(S,b){this._restrictCursor(),this._setCursor(this._activeBuffer.x+S,this._activeBuffer.y+b)}cursorUp(S){const b=this._activeBuffer.y-this._activeBuffer.scrollTop;return b>=0?this._moveCursor(0,-Math.min(b,S.params[0]||1)):this._moveCursor(0,-(S.params[0]||1)),!0}cursorDown(S){const b=this._activeBuffer.scrollBottom-this._activeBuffer.y;return b>=0?this._moveCursor(0,Math.min(b,S.params[0]||1)):this._moveCursor(0,S.params[0]||1),!0}cursorForward(S){return this._moveCursor(S.params[0]||1,0),!0}cursorBackward(S){return this._moveCursor(-(S.params[0]||1),0),!0}cursorNextLine(S){return this.cursorDown(S),this._activeBuffer.x=0,!0}cursorPrecedingLine(S){return this.cursorUp(S),this._activeBuffer.x=0,!0}cursorCharAbsolute(S){return this._setCursor((S.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(S){return this._setCursor(S.length>=2?(S.params[1]||1)-1:0,(S.params[0]||1)-1),!0}charPosAbsolute(S){return this._setCursor((S.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(S){return this._moveCursor(S.params[0]||1,0),!0}linePosAbsolute(S){return this._setCursor(this._activeBuffer.x,(S.params[0]||1)-1),!0}vPositionRelative(S){return this._moveCursor(0,S.params[0]||1),!0}hVPosition(S){return this.cursorPosition(S),!0}tabClear(S){const b=S.params[0];return b===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:b===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(S){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let b=S.params[0]||1;for(;b--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(S){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let b=S.params[0]||1;for(;b--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(S){const b=S.params[0];return b===1&&(this._curAttrData.bg|=536870912),b!==2&&b!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(S,b,E,D=!1,T=!1){const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+S);H.replaceCells(b,E,this._activeBuffer.getNullCell(this._eraseAttrData()),T),D&&(H.isWrapped=!1)}_resetBufferLine(S,b=!1){const E=this._activeBuffer.lines.get(this._activeBuffer.ybase+S);E&&(E.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),b),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+S),E.isWrapped=!1)}eraseInDisplay(S,b=!1){let E;switch(this._restrictCursor(this._bufferService.cols),S.params[0]){case 0:for(E=this._activeBuffer.y,this._dirtyRowTracker.markDirty(E),this._eraseInBufferLine(E++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,b);E<this._bufferService.rows;E++)this._resetBufferLine(E,b);this._dirtyRowTracker.markDirty(E);break;case 1:for(E=this._activeBuffer.y,this._dirtyRowTracker.markDirty(E),this._eraseInBufferLine(E,0,this._activeBuffer.x+1,!0,b),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(E+1).isWrapped=!1);E--;)this._resetBufferLine(E,b);this._dirtyRowTracker.markDirty(0);break;case 2:for(E=this._bufferService.rows,this._dirtyRowTracker.markDirty(E-1);E--;)this._resetBufferLine(E,b);this._dirtyRowTracker.markDirty(0);break;case 3:const D=this._activeBuffer.lines.length-this._bufferService.rows;D>0&&(this._activeBuffer.lines.trimStart(D),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-D,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-D,0),this._onScroll.fire(0))}return!0}eraseInLine(S,b=!1){switch(this._restrictCursor(this._bufferService.cols),S.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,b);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,b);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,b)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(S){this._restrictCursor();let b=S.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const E=this._activeBuffer.ybase+this._activeBuffer.y,D=this._bufferService.rows-1-this._activeBuffer.scrollBottom,T=this._bufferService.rows-1+this._activeBuffer.ybase-D+1;for(;b--;)this._activeBuffer.lines.splice(T-1,1),this._activeBuffer.lines.splice(E,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(S){this._restrictCursor();let b=S.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const E=this._activeBuffer.ybase+this._activeBuffer.y;let D;for(D=this._bufferService.rows-1-this._activeBuffer.scrollBottom,D=this._bufferService.rows-1+this._activeBuffer.ybase-D;b--;)this._activeBuffer.lines.splice(E,1),this._activeBuffer.lines.splice(D,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(S){this._restrictCursor();const b=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return b&&(b.insertCells(this._activeBuffer.x,S.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(S){this._restrictCursor();const b=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return b&&(b.deleteCells(this._activeBuffer.x,S.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(S){let b=S.params[0]||1;for(;b--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(S){let b=S.params[0]||1;for(;b--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(i.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(S){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const b=S.params[0]||1;for(let E=this._activeBuffer.scrollTop;E<=this._activeBuffer.scrollBottom;++E){const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+E);D.deleteCells(0,b,this._activeBuffer.getNullCell(this._eraseAttrData())),D.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(S){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const b=S.params[0]||1;for(let E=this._activeBuffer.scrollTop;E<=this._activeBuffer.scrollBottom;++E){const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+E);D.insertCells(0,b,this._activeBuffer.getNullCell(this._eraseAttrData())),D.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(S){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const b=S.params[0]||1;for(let E=this._activeBuffer.scrollTop;E<=this._activeBuffer.scrollBottom;++E){const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+E);D.insertCells(this._activeBuffer.x,b,this._activeBuffer.getNullCell(this._eraseAttrData())),D.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(S){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const b=S.params[0]||1;for(let E=this._activeBuffer.scrollTop;E<=this._activeBuffer.scrollBottom;++E){const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+E);D.deleteCells(this._activeBuffer.x,b,this._activeBuffer.getNullCell(this._eraseAttrData())),D.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(S){this._restrictCursor();const b=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return b&&(b.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(S.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(S){const b=this._parser.precedingJoinState;if(!b)return!0;const E=S.params[0]||1,D=u.UnicodeService.extractWidth(b),T=this._activeBuffer.x-D,H=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(T),N=new Uint32Array(H.length*E);let $=0;for(let C=0;C<H.length;){const M=H.codePointAt(C)||0;N[$++]=M,C+=M>65535?2:1}let R=$;for(let C=1;C<E;++C)N.copyWithin(R,0,$),R+=$;return this.print(N,0,R),!0}sendDeviceAttributesPrimary(S){return S.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(n.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(n.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(S){return S.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(n.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(n.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(S.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(n.C0.ESC+"[>83;40003;0c")),!0}_is(S){return(this._optionsService.rawOptions.termName+"").indexOf(S)===0}setMode(S){for(let b=0;b<S.length;b++)switch(S.params[b]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(S){for(let b=0;b<S.length;b++)switch(S.params[b]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,d.DEFAULT_CHARSET),this._charsetService.setgCharset(1,d.DEFAULT_CHARSET),this._charsetService.setgCharset(2,d.DEFAULT_CHARSET),this._charsetService.setgCharset(3,d.DEFAULT_CHARSET);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0}return!0}resetMode(S){for(let b=0;b<S.length;b++)switch(S.params[b]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(S){for(let b=0;b<S.length;b++)switch(S.params[b]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),S.params[b]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}return!0}requestMode(S,b){const E=this._coreService.decPrivateModes,{activeProtocol:D,activeEncoding:T}=this._coreMouseService,H=this._coreService,{buffers:N,cols:$}=this._bufferService,{active:R,alt:C}=N,M=this._optionsService.rawOptions,A=q=>q?1:2,W=S.params[0];return F=W,z=b?W===2?4:W===4?A(H.modes.insertMode):W===12?3:W===20?A(M.convertEol):0:W===1?A(E.applicationCursorKeys):W===3?M.windowOptions.setWinLines?$===80?2:$===132?1:0:0:W===6?A(E.origin):W===7?A(E.wraparound):W===8?3:W===9?A(D==="X10"):W===12?A(M.cursorBlink):W===25?A(!H.isCursorHidden):W===45?A(E.reverseWraparound):W===66?A(E.applicationKeypad):W===67?4:W===1e3?A(D==="VT200"):W===1002?A(D==="DRAG"):W===1003?A(D==="ANY"):W===1004?A(E.sendFocus):W===1005?4:W===1006?A(T==="SGR"):W===1015?4:W===1016?A(T==="SGR_PIXELS"):W===1048?1:W===47||W===1047||W===1049?A(R===C):W===2004?A(E.bracketedPasteMode):0,H.triggerDataEvent(`${n.C0.ESC}[${b?"":"?"}${F};${z}$y`),!0;var F,z}_updateAttrColor(S,b,E,D,T){return b===2?(S|=50331648,S&=-16777216,S|=o.AttributeData.fromColorRGB([E,D,T])):b===5&&(S&=-50331904,S|=33554432|255&E),S}_extractColor(S,b,E){const D=[0,0,-1,0,0,0];let T=0,H=0;do{if(D[H+T]=S.params[b+H],S.hasSubParams(b+H)){const N=S.getSubParams(b+H);let $=0;do D[1]===5&&(T=1),D[H+$+1+T]=N[$];while(++$<N.length&&$+H+1+T<D.length);break}if(D[1]===5&&H+T>=2||D[1]===2&&H+T>=5)break;D[1]&&(T=1)}while(++H+b<S.length&&H+T<D.length);for(let N=2;N<D.length;++N)D[N]===-1&&(D[N]=0);switch(D[0]){case 38:E.fg=this._updateAttrColor(E.fg,D[1],D[3],D[4],D[5]);break;case 48:E.bg=this._updateAttrColor(E.bg,D[1],D[3],D[4],D[5]);break;case 58:E.extended=E.extended.clone(),E.extended.underlineColor=this._updateAttrColor(E.extended.underlineColor,D[1],D[3],D[4],D[5])}return H}_processUnderline(S,b){b.extended=b.extended.clone(),(!~S||S>5)&&(S=1),b.extended.underlineStyle=S,b.fg|=268435456,S===0&&(b.fg&=-268435457),b.updateExtended()}_processSGR0(S){S.fg=i.DEFAULT_ATTR_DATA.fg,S.bg=i.DEFAULT_ATTR_DATA.bg,S.extended=S.extended.clone(),S.extended.underlineStyle=0,S.extended.underlineColor&=-67108864,S.updateExtended()}charAttributes(S){if(S.length===1&&S.params[0]===0)return this._processSGR0(this._curAttrData),!0;const b=S.length;let E;const D=this._curAttrData;for(let T=0;T<b;T++)E=S.params[T],E>=30&&E<=37?(D.fg&=-50331904,D.fg|=16777216|E-30):E>=40&&E<=47?(D.bg&=-50331904,D.bg|=16777216|E-40):E>=90&&E<=97?(D.fg&=-50331904,D.fg|=16777224|E-90):E>=100&&E<=107?(D.bg&=-50331904,D.bg|=16777224|E-100):E===0?this._processSGR0(D):E===1?D.fg|=134217728:E===3?D.bg|=67108864:E===4?(D.fg|=268435456,this._processUnderline(S.hasSubParams(T)?S.getSubParams(T)[0]:1,D)):E===5?D.fg|=536870912:E===7?D.fg|=67108864:E===8?D.fg|=1073741824:E===9?D.fg|=2147483648:E===2?D.bg|=134217728:E===21?this._processUnderline(2,D):E===22?(D.fg&=-134217729,D.bg&=-134217729):E===23?D.bg&=-67108865:E===24?(D.fg&=-268435457,this._processUnderline(0,D)):E===25?D.fg&=-536870913:E===27?D.fg&=-67108865:E===28?D.fg&=-1073741825:E===29?D.fg&=2147483647:E===39?(D.fg&=-67108864,D.fg|=16777215&i.DEFAULT_ATTR_DATA.fg):E===49?(D.bg&=-67108864,D.bg|=16777215&i.DEFAULT_ATTR_DATA.bg):E===38||E===48||E===58?T+=this._extractColor(S,T,D):E===53?D.bg|=1073741824:E===55?D.bg&=-1073741825:E===59?(D.extended=D.extended.clone(),D.extended.underlineColor=-1,D.updateExtended()):E===100?(D.fg&=-67108864,D.fg|=16777215&i.DEFAULT_ATTR_DATA.fg,D.bg&=-67108864,D.bg|=16777215&i.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",E);return!0}deviceStatus(S){switch(S.params[0]){case 5:this._coreService.triggerDataEvent(`${n.C0.ESC}[0n`);break;case 6:const b=this._activeBuffer.y+1,E=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${n.C0.ESC}[${b};${E}R`)}return!0}deviceStatusPrivate(S){if(S.params[0]===6){const b=this._activeBuffer.y+1,E=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${n.C0.ESC}[?${b};${E}R`)}return!0}softReset(S){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=i.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(S){const b=S.params[0]||1;switch(b){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const E=b%2==1;return this._optionsService.options.cursorBlink=E,!0}setScrollRegion(S){const b=S.params[0]||1;let E;return(S.length<2||(E=S.params[1])>this._bufferService.rows||E===0)&&(E=this._bufferService.rows),E>b&&(this._activeBuffer.scrollTop=b-1,this._activeBuffer.scrollBottom=E-1,this._setCursor(0,0)),!0}windowOptions(S){if(!L(S.params[0],this._optionsService.rawOptions.windowOptions))return!0;const b=S.length>1?S.params[1]:0;switch(S.params[0]){case 14:b!==2&&this._onRequestWindowsOptionsReport.fire(w.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(w.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${n.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:b!==0&&b!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),b!==0&&b!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:b!==0&&b!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),b!==0&&b!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(S){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(S){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(S){return this._windowTitle=S,this._onTitleChange.fire(S),!0}setIconName(S){return this._iconName=S,!0}setOrReportIndexedColor(S){const b=[],E=S.split(";");for(;E.length>1;){const D=E.shift(),T=E.shift();if(/^\d+$/.exec(D)){const H=parseInt(D);if(U(H))if(T==="?")b.push({type:0,index:H});else{const N=(0,m.parseColor)(T);N&&b.push({type:1,index:H,color:N})}}}return b.length&&this._onColor.fire(b),!0}setHyperlink(S){const b=S.split(";");return!(b.length<2)&&(b[1]?this._createHyperlink(b[0],b[1]):!b[0]&&this._finishHyperlink())}_createHyperlink(S,b){this._getCurrentLinkId()&&this._finishHyperlink();const E=S.split(":");let D;const T=E.findIndex((H=>H.startsWith("id=")));return T!==-1&&(D=E[T].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:D,uri:b}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(S,b){const E=S.split(";");for(let D=0;D<E.length&&!(b>=this._specialColors.length);++D,++b)if(E[D]==="?")this._onColor.fire([{type:0,index:this._specialColors[b]}]);else{const T=(0,m.parseColor)(E[D]);T&&this._onColor.fire([{type:1,index:this._specialColors[b],color:T}])}return!0}setOrReportFgColor(S){return this._setOrReportSpecialColor(S,0)}setOrReportBgColor(S){return this._setOrReportSpecialColor(S,1)}setOrReportCursorColor(S){return this._setOrReportSpecialColor(S,2)}restoreIndexedColor(S){if(!S)return this._onColor.fire([{type:2}]),!0;const b=[],E=S.split(";");for(let D=0;D<E.length;++D)if(/^\d+$/.exec(E[D])){const T=parseInt(E[D]);U(T)&&b.push({type:2,index:T})}return b.length&&this._onColor.fire(b),!0}restoreFgColor(S){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(S){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(S){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,d.DEFAULT_CHARSET),!0}selectCharset(S){return S.length!==2?(this.selectDefaultCharset(),!0):(S[0]==="/"||this._charsetService.setgCharset(y[S[0]],d.CHARSETS[S[1]]||d.DEFAULT_CHARSET),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){const S=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,S,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=i.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=i.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(S){return this._charsetService.setgLevel(S),!0}screenAlignmentPattern(){const S=new t.CellData;S.content=4194373,S.fg=this._curAttrData.fg,S.bg=this._curAttrData.bg,this._setCursor(0,0);for(let b=0;b<this._bufferService.rows;++b){const E=this._activeBuffer.ybase+this._activeBuffer.y+b,D=this._activeBuffer.lines.get(E);D&&(D.fill(S),D.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(S,b){const E=this._bufferService.buffer,D=this._optionsService.rawOptions;return(T=>(this._coreService.triggerDataEvent(`${n.C0.ESC}${T}${n.C0.ESC}\\`),!0))(S==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:S==='"p'?'P1$r61;1"p':S==="r"?`P1$r${E.scrollTop+1};${E.scrollBottom+1}r`:S==="m"?"P1$r0m":S===" q"?`P1$r${{block:2,underline:4,bar:6}[D.cursorStyle]-(D.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(S,b){this._dirtyRowTracker.markRangeDirty(S,b)}}r.InputHandler=B;let P=class{constructor(I){this._bufferService=I,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(I){I<this.start?this.start=I:I>this.end&&(this.end=I)}markRangeDirty(I,S){I>S&&(x=I,I=S,S=x),I<this.start&&(this.start=I),S>this.end&&(this.end=S)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function U(I){return 0<=I&&I<256}P=l([_(0,f.IBufferService)],P)},844:(O,r)=>{function a(l){for(const _ of l)_.dispose();l.length=0}Object.defineProperty(r,"__esModule",{value:!0}),r.getDisposeArrayDisposable=r.disposeArray=r.toDisposable=r.MutableDisposable=r.Disposable=void 0,r.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const l of this._disposables)l.dispose();this._disposables.length=0}register(l){return this._disposables.push(l),l}unregister(l){const _=this._disposables.indexOf(l);_!==-1&&this._disposables.splice(_,1)}},r.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(l){var _;this._isDisposed||l===this._value||((_=this._value)==null||_.dispose(),this._value=l)}clear(){this.value=void 0}dispose(){var l;this._isDisposed=!0,(l=this._value)==null||l.dispose(),this._value=void 0}},r.toDisposable=function(l){return{dispose:l}},r.disposeArray=a,r.getDisposeArrayDisposable=function(l){return{dispose:()=>a(l)}}},1505:(O,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.FourKeyMap=r.TwoKeyMap=void 0;class a{constructor(){this._data={}}set(_,n,d){this._data[_]||(this._data[_]={}),this._data[_][n]=d}get(_,n){return this._data[_]?this._data[_][n]:void 0}clear(){this._data={}}}r.TwoKeyMap=a,r.FourKeyMap=class{constructor(){this._data=new a}set(l,_,n,d,v){this._data.get(l,_)||this._data.set(l,_,new a),this._data.get(l,_).set(n,d,v)}get(l,_,n,d){var v;return(v=this._data.get(l,_))==null?void 0:v.get(n,d)}clear(){this._data.clear()}}},6114:(O,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.isChromeOS=r.isLinux=r.isWindows=r.isIphone=r.isIpad=r.isMac=r.getSafariVersion=r.isSafari=r.isLegacyEdge=r.isFirefox=r.isNode=void 0,r.isNode=typeof process<"u"&&"title"in process;const a=r.isNode?"node":navigator.userAgent,l=r.isNode?"node":navigator.platform;r.isFirefox=a.includes("Firefox"),r.isLegacyEdge=a.includes("Edge"),r.isSafari=/^((?!chrome|android).)*safari/i.test(a),r.getSafariVersion=function(){if(!r.isSafari)return 0;const _=a.match(/Version\/(\d+)/);return _===null||_.length<2?0:parseInt(_[1])},r.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(l),r.isIpad=l==="iPad",r.isIphone=l==="iPhone",r.isWindows=["Windows","Win16","Win32","WinCE"].includes(l),r.isLinux=l.indexOf("Linux")>=0,r.isChromeOS=/\bCrOS\b/.test(a)},6106:(O,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.SortedList=void 0;let a=0;r.SortedList=class{constructor(l){this._getKey=l,this._array=[]}clear(){this._array.length=0}insert(l){this._array.length!==0?(a=this._search(this._getKey(l)),this._array.splice(a,0,l)):this._array.push(l)}delete(l){if(this._array.length===0)return!1;const _=this._getKey(l);if(_===void 0||(a=this._search(_),a===-1)||this._getKey(this._array[a])!==_)return!1;do if(this._array[a]===l)return this._array.splice(a,1),!0;while(++a<this._array.length&&this._getKey(this._array[a])===_);return!1}*getKeyIterator(l){if(this._array.length!==0&&(a=this._search(l),!(a<0||a>=this._array.length)&&this._getKey(this._array[a])===l))do yield this._array[a];while(++a<this._array.length&&this._getKey(this._array[a])===l)}forEachByKey(l,_){if(this._array.length!==0&&(a=this._search(l),!(a<0||a>=this._array.length)&&this._getKey(this._array[a])===l))do _(this._array[a]);while(++a<this._array.length&&this._getKey(this._array[a])===l)}values(){return[...this._array].values()}_search(l){let _=0,n=this._array.length-1;for(;n>=_;){let d=_+n>>1;const v=this._getKey(this._array[d]);if(v>l)n=d-1;else{if(!(v<l)){for(;d>0&&this._getKey(this._array[d-1])===l;)d--;return d}_=d+1}}return _}}},7226:(O,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.DebouncedIdleTask=r.IdleTaskQueue=r.PriorityTaskQueue=void 0;const l=a(6114);class _{constructor(){this._tasks=[],this._i=0}enqueue(v){this._tasks.push(v),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(v){this._idleCallback=void 0;let g=0,h=0,i=v.timeRemaining(),s=0;for(;this._i<this._tasks.length;){if(g=Date.now(),this._tasks[this._i]()||this._i++,g=Math.max(1,Date.now()-g),h=Math.max(g,h),s=v.timeRemaining(),1.5*h>s)return i-g<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(i-g))}ms`),void this._start();i=s}this.clear()}}class n extends _{_requestCallback(v){return setTimeout((()=>v(this._createDeadline(16))))}_cancelCallback(v){clearTimeout(v)}_createDeadline(v){const g=Date.now()+v;return{timeRemaining:()=>Math.max(0,g-Date.now())}}}r.PriorityTaskQueue=n,r.IdleTaskQueue=!l.isNode&&"requestIdleCallback"in window?class extends _{_requestCallback(d){return requestIdleCallback(d)}_cancelCallback(d){cancelIdleCallback(d)}}:n,r.DebouncedIdleTask=class{constructor(){this._queue=new r.IdleTaskQueue}set(d){this._queue.clear(),this._queue.enqueue(d)}flush(){this._queue.flush()}}},9282:(O,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.updateWindowsModeWrappedState=void 0;const l=a(643);r.updateWindowsModeWrappedState=function(_){const n=_.buffer.lines.get(_.buffer.ybase+_.buffer.y-1),d=n==null?void 0:n.get(_.cols-1),v=_.buffer.lines.get(_.buffer.ybase+_.buffer.y);v&&d&&(v.isWrapped=d[l.CHAR_DATA_CODE_INDEX]!==l.NULL_CELL_CODE&&d[l.CHAR_DATA_CODE_INDEX]!==l.WHITESPACE_CELL_CODE)}},3734:(O,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ExtendedAttrs=r.AttributeData=void 0;class a{constructor(){this.fg=0,this.bg=0,this.extended=new l}static toColorRGB(n){return[n>>>16&255,n>>>8&255,255&n]}static fromColorRGB(n){return(255&n[0])<<16|(255&n[1])<<8|255&n[2]}clone(){const n=new a;return n.fg=this.fg,n.bg=this.bg,n.extended=this.extended.clone(),n}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}r.AttributeData=a;class l{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(n){this._ext=n}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(n){this._ext&=-469762049,this._ext|=n<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(n){this._ext&=-67108864,this._ext|=67108863&n}get urlId(){return this._urlId}set urlId(n){this._urlId=n}get underlineVariantOffset(){const n=(3758096384&this._ext)>>29;return n<0?4294967288^n:n}set underlineVariantOffset(n){this._ext&=536870911,this._ext|=n<<29&3758096384}constructor(n=0,d=0){this._ext=0,this._urlId=0,this._ext=n,this._urlId=d}clone(){return new l(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}r.ExtendedAttrs=l},9092:(O,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Buffer=r.MAX_BUFFER_SIZE=void 0;const l=a(6349),_=a(7226),n=a(3734),d=a(8437),v=a(4634),g=a(511),h=a(643),i=a(4863),s=a(7116);r.MAX_BUFFER_SIZE=4294967295,r.Buffer=class{constructor(e,t,o){this._hasScrollback=e,this._optionsService=t,this._bufferService=o,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=d.DEFAULT_ATTR_DATA.clone(),this.savedCharset=s.DEFAULT_CHARSET,this.markers=[],this._nullCell=g.CellData.fromCharData([0,h.NULL_CELL_CHAR,h.NULL_CELL_WIDTH,h.NULL_CELL_CODE]),this._whitespaceCell=g.CellData.fromCharData([0,h.WHITESPACE_CELL_CHAR,h.WHITESPACE_CELL_WIDTH,h.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new _.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new l.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(e){return e?(this._nullCell.fg=e.fg,this._nullCell.bg=e.bg,this._nullCell.extended=e.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new n.ExtendedAttrs),this._nullCell}getWhitespaceCell(e){return e?(this._whitespaceCell.fg=e.fg,this._whitespaceCell.bg=e.bg,this._whitespaceCell.extended=e.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new n.ExtendedAttrs),this._whitespaceCell}getBlankLine(e,t){return new d.BufferLine(this._bufferService.cols,this.getNullCell(e),t)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const e=this.ybase+this.y-this.ydisp;return e>=0&&e<this._rows}_getCorrectBufferLength(e){if(!this._hasScrollback)return e;const t=e+this._optionsService.rawOptions.scrollback;return t>r.MAX_BUFFER_SIZE?r.MAX_BUFFER_SIZE:t}fillViewportRows(e){if(this.lines.length===0){e===void 0&&(e=d.DEFAULT_ATTR_DATA);let t=this._rows;for(;t--;)this.lines.push(this.getBlankLine(e))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new l.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(e,t){const o=this.getNullCell(d.DEFAULT_ATTR_DATA);let f=0;const u=this._getCorrectBufferLength(t);if(u>this.lines.maxLength&&(this.lines.maxLength=u),this.lines.length>0){if(this._cols<e)for(let c=0;c<this.lines.length;c++)f+=+this.lines.get(c).resize(e,o);let p=0;if(this._rows<t)for(let c=this._rows;c<t;c++)this.lines.length<t+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new d.BufferLine(e,o)):this.ybase>0&&this.lines.length<=this.ybase+this.y+p+1?(this.ybase--,p++,this.ydisp>0&&this.ydisp--):this.lines.push(new d.BufferLine(e,o)));else for(let c=this._rows;c>t;c--)this.lines.length>t+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(u<this.lines.maxLength){const c=this.lines.length-u;c>0&&(this.lines.trimStart(c),this.ybase=Math.max(this.ybase-c,0),this.ydisp=Math.max(this.ydisp-c,0),this.savedY=Math.max(this.savedY-c,0)),this.lines.maxLength=u}this.x=Math.min(this.x,e-1),this.y=Math.min(this.y,t-1),p&&(this.y+=p),this.savedX=Math.min(this.savedX,e-1),this.scrollTop=0}if(this.scrollBottom=t-1,this._isReflowEnabled&&(this._reflow(e,t),this._cols>e))for(let p=0;p<this.lines.length;p++)f+=+this.lines.get(p).resize(e,o);this._cols=e,this._rows=t,this._memoryCleanupQueue.clear(),f>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let e=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,e=!1);let t=0;for(;this._memoryCleanupPosition<this.lines.length;)if(t+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),t>100)return!0;return e}get _isReflowEnabled(){const e=this._optionsService.rawOptions.windowsPty;return e&&e.buildNumber?this._hasScrollback&&e.backend==="conpty"&&e.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(e,t){this._cols!==e&&(e>this._cols?this._reflowLarger(e,t):this._reflowSmaller(e,t))}_reflowLarger(e,t){const o=(0,v.reflowLargerGetLinesToRemove)(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(d.DEFAULT_ATTR_DATA));if(o.length>0){const f=(0,v.reflowLargerCreateNewLayout)(this.lines,o);(0,v.reflowLargerApplyNewLayout)(this.lines,f.layout),this._reflowLargerAdjustViewport(e,t,f.countRemoved)}}_reflowLargerAdjustViewport(e,t,o){const f=this.getNullCell(d.DEFAULT_ATTR_DATA);let u=o;for(;u-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<t&&this.lines.push(new d.BufferLine(e,f))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-o,0)}_reflowSmaller(e,t){const o=this.getNullCell(d.DEFAULT_ATTR_DATA),f=[];let u=0;for(let p=this.lines.length-1;p>=0;p--){let c=this.lines.get(p);if(!c||!c.isWrapped&&c.getTrimmedLength()<=e)continue;const m=[c];for(;c.isWrapped&&p>0;)c=this.lines.get(--p),m.unshift(c);const y=this.ybase+this.y;if(y>=p&&y<p+m.length)continue;const k=m[m.length-1].getTrimmedLength(),L=(0,v.reflowSmallerGetNewLineLengths)(m,this._cols,e),w=L.length-m.length;let x;x=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+w):Math.max(0,this.lines.length-this.lines.maxLength+w);const B=[];for(let E=0;E<w;E++){const D=this.getBlankLine(d.DEFAULT_ATTR_DATA,!0);B.push(D)}B.length>0&&(f.push({start:p+m.length+u,newLines:B}),u+=B.length),m.push(...B);let P=L.length-1,U=L[P];U===0&&(P--,U=L[P]);let I=m.length-w-1,S=k;for(;I>=0;){const E=Math.min(S,U);if(m[P]===void 0)break;if(m[P].copyCellsFrom(m[I],S-E,U-E,E,!0),U-=E,U===0&&(P--,U=L[P]),S-=E,S===0){I--;const D=Math.max(I,0);S=(0,v.getWrappedLineTrimmedLength)(m,D,this._cols)}}for(let E=0;E<m.length;E++)L[E]<e&&m[E].setCell(L[E],o);let b=w-x;for(;b-- >0;)this.ybase===0?this.y<t-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+u)-t&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+w,this.ybase+t-1)}if(f.length>0){const p=[],c=[];for(let P=0;P<this.lines.length;P++)c.push(this.lines.get(P));const m=this.lines.length;let y=m-1,k=0,L=f[k];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+u);let w=0;for(let P=Math.min(this.lines.maxLength-1,m+u-1);P>=0;P--)if(L&&L.start>y+w){for(let U=L.newLines.length-1;U>=0;U--)this.lines.set(P--,L.newLines[U]);P++,p.push({index:y+1,amount:L.newLines.length}),w+=L.newLines.length,L=f[++k]}else this.lines.set(P,c[y--]);let x=0;for(let P=p.length-1;P>=0;P--)p[P].index+=x,this.lines.onInsertEmitter.fire(p[P]),x+=p[P].amount;const B=Math.max(0,m+u-this.lines.maxLength);B>0&&this.lines.onTrimEmitter.fire(B)}}translateBufferLineToString(e,t,o=0,f){const u=this.lines.get(e);return u?u.translateToString(t,o,f):""}getWrappedRangeForLine(e){let t=e,o=e;for(;t>0&&this.lines.get(t).isWrapped;)t--;for(;o+1<this.lines.length&&this.lines.get(o+1).isWrapped;)o++;return{first:t,last:o}}setupTabStops(e){for(e!=null?this.tabs[e]||(e=this.prevStop(e)):(this.tabs={},e=0);e<this._cols;e+=this._optionsService.rawOptions.tabStopWidth)this.tabs[e]=!0}prevStop(e){for(e==null&&(e=this.x);!this.tabs[--e]&&e>0;);return e>=this._cols?this._cols-1:e<0?0:e}nextStop(e){for(e==null&&(e=this.x);!this.tabs[++e]&&e<this._cols;);return e>=this._cols?this._cols-1:e<0?0:e}clearMarkers(e){this._isClearing=!0;for(let t=0;t<this.markers.length;t++)this.markers[t].line===e&&(this.markers[t].dispose(),this.markers.splice(t--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let e=0;e<this.markers.length;e++)this.markers[e].dispose(),this.markers.splice(e--,1);this._isClearing=!1}addMarker(e){const t=new i.Marker(e);return this.markers.push(t),t.register(this.lines.onTrim((o=>{t.line-=o,t.line<0&&t.dispose()}))),t.register(this.lines.onInsert((o=>{t.line>=o.index&&(t.line+=o.amount)}))),t.register(this.lines.onDelete((o=>{t.line>=o.index&&t.line<o.index+o.amount&&t.dispose(),t.line>o.index&&(t.line-=o.amount)}))),t.register(t.onDispose((()=>this._removeMarker(t)))),t}_removeMarker(e){this._isClearing||this.markers.splice(this.markers.indexOf(e),1)}}},8437:(O,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferLine=r.DEFAULT_ATTR_DATA=void 0;const l=a(3734),_=a(511),n=a(643),d=a(482);r.DEFAULT_ATTR_DATA=Object.freeze(new l.AttributeData);let v=0;class g{constructor(i,s,e=!1){this.isWrapped=e,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*i);const t=s||_.CellData.fromCharData([0,n.NULL_CELL_CHAR,n.NULL_CELL_WIDTH,n.NULL_CELL_CODE]);for(let o=0;o<i;++o)this.setCell(o,t);this.length=i}get(i){const s=this._data[3*i+0],e=2097151&s;return[this._data[3*i+1],2097152&s?this._combined[i]:e?(0,d.stringFromCodePoint)(e):"",s>>22,2097152&s?this._combined[i].charCodeAt(this._combined[i].length-1):e]}set(i,s){this._data[3*i+1]=s[n.CHAR_DATA_ATTR_INDEX],s[n.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[i]=s[1],this._data[3*i+0]=2097152|i|s[n.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*i+0]=s[n.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|s[n.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(i){return this._data[3*i+0]>>22}hasWidth(i){return 12582912&this._data[3*i+0]}getFg(i){return this._data[3*i+1]}getBg(i){return this._data[3*i+2]}hasContent(i){return 4194303&this._data[3*i+0]}getCodePoint(i){const s=this._data[3*i+0];return 2097152&s?this._combined[i].charCodeAt(this._combined[i].length-1):2097151&s}isCombined(i){return 2097152&this._data[3*i+0]}getString(i){const s=this._data[3*i+0];return 2097152&s?this._combined[i]:2097151&s?(0,d.stringFromCodePoint)(2097151&s):""}isProtected(i){return 536870912&this._data[3*i+2]}loadCell(i,s){return v=3*i,s.content=this._data[v+0],s.fg=this._data[v+1],s.bg=this._data[v+2],2097152&s.content&&(s.combinedData=this._combined[i]),268435456&s.bg&&(s.extended=this._extendedAttrs[i]),s}setCell(i,s){2097152&s.content&&(this._combined[i]=s.combinedData),268435456&s.bg&&(this._extendedAttrs[i]=s.extended),this._data[3*i+0]=s.content,this._data[3*i+1]=s.fg,this._data[3*i+2]=s.bg}setCellFromCodepoint(i,s,e,t){268435456&t.bg&&(this._extendedAttrs[i]=t.extended),this._data[3*i+0]=s|e<<22,this._data[3*i+1]=t.fg,this._data[3*i+2]=t.bg}addCodepointToCell(i,s,e){let t=this._data[3*i+0];2097152&t?this._combined[i]+=(0,d.stringFromCodePoint)(s):2097151&t?(this._combined[i]=(0,d.stringFromCodePoint)(2097151&t)+(0,d.stringFromCodePoint)(s),t&=-2097152,t|=2097152):t=s|4194304,e&&(t&=-12582913,t|=e<<22),this._data[3*i+0]=t}insertCells(i,s,e){if((i%=this.length)&&this.getWidth(i-1)===2&&this.setCellFromCodepoint(i-1,0,1,e),s<this.length-i){const t=new _.CellData;for(let o=this.length-i-s-1;o>=0;--o)this.setCell(i+s+o,this.loadCell(i+o,t));for(let o=0;o<s;++o)this.setCell(i+o,e)}else for(let t=i;t<this.length;++t)this.setCell(t,e);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,e)}deleteCells(i,s,e){if(i%=this.length,s<this.length-i){const t=new _.CellData;for(let o=0;o<this.length-i-s;++o)this.setCell(i+o,this.loadCell(i+s+o,t));for(let o=this.length-s;o<this.length;++o)this.setCell(o,e)}else for(let t=i;t<this.length;++t)this.setCell(t,e);i&&this.getWidth(i-1)===2&&this.setCellFromCodepoint(i-1,0,1,e),this.getWidth(i)!==0||this.hasContent(i)||this.setCellFromCodepoint(i,0,1,e)}replaceCells(i,s,e,t=!1){if(t)for(i&&this.getWidth(i-1)===2&&!this.isProtected(i-1)&&this.setCellFromCodepoint(i-1,0,1,e),s<this.length&&this.getWidth(s-1)===2&&!this.isProtected(s)&&this.setCellFromCodepoint(s,0,1,e);i<s&&i<this.length;)this.isProtected(i)||this.setCell(i,e),i++;else for(i&&this.getWidth(i-1)===2&&this.setCellFromCodepoint(i-1,0,1,e),s<this.length&&this.getWidth(s-1)===2&&this.setCellFromCodepoint(s,0,1,e);i<s&&i<this.length;)this.setCell(i++,e)}resize(i,s){if(i===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const e=3*i;if(i>this.length){if(this._data.buffer.byteLength>=4*e)this._data=new Uint32Array(this._data.buffer,0,e);else{const t=new Uint32Array(e);t.set(this._data),this._data=t}for(let t=this.length;t<i;++t)this.setCell(t,s)}else{this._data=this._data.subarray(0,e);const t=Object.keys(this._combined);for(let f=0;f<t.length;f++){const u=parseInt(t[f],10);u>=i&&delete this._combined[u]}const o=Object.keys(this._extendedAttrs);for(let f=0;f<o.length;f++){const u=parseInt(o[f],10);u>=i&&delete this._extendedAttrs[u]}}return this.length=i,4*e*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const i=new Uint32Array(this._data.length);return i.set(this._data),this._data=i,1}return 0}fill(i,s=!1){if(s)for(let e=0;e<this.length;++e)this.isProtected(e)||this.setCell(e,i);else{this._combined={},this._extendedAttrs={};for(let e=0;e<this.length;++e)this.setCell(e,i)}}copyFrom(i){this.length!==i.length?this._data=new Uint32Array(i._data):this._data.set(i._data),this.length=i.length,this._combined={};for(const s in i._combined)this._combined[s]=i._combined[s];this._extendedAttrs={};for(const s in i._extendedAttrs)this._extendedAttrs[s]=i._extendedAttrs[s];this.isWrapped=i.isWrapped}clone(){const i=new g(0);i._data=new Uint32Array(this._data),i.length=this.length;for(const s in this._combined)i._combined[s]=this._combined[s];for(const s in this._extendedAttrs)i._extendedAttrs[s]=this._extendedAttrs[s];return i.isWrapped=this.isWrapped,i}getTrimmedLength(){for(let i=this.length-1;i>=0;--i)if(4194303&this._data[3*i+0])return i+(this._data[3*i+0]>>22);return 0}getNoBgTrimmedLength(){for(let i=this.length-1;i>=0;--i)if(4194303&this._data[3*i+0]||50331648&this._data[3*i+2])return i+(this._data[3*i+0]>>22);return 0}copyCellsFrom(i,s,e,t,o){const f=i._data;if(o)for(let p=t-1;p>=0;p--){for(let c=0;c<3;c++)this._data[3*(e+p)+c]=f[3*(s+p)+c];268435456&f[3*(s+p)+2]&&(this._extendedAttrs[e+p]=i._extendedAttrs[s+p])}else for(let p=0;p<t;p++){for(let c=0;c<3;c++)this._data[3*(e+p)+c]=f[3*(s+p)+c];268435456&f[3*(s+p)+2]&&(this._extendedAttrs[e+p]=i._extendedAttrs[s+p])}const u=Object.keys(i._combined);for(let p=0;p<u.length;p++){const c=parseInt(u[p],10);c>=s&&(this._combined[c-s+e]=i._combined[c])}}translateToString(i,s,e,t){s=s??0,e=e??this.length,i&&(e=Math.min(e,this.getTrimmedLength())),t&&(t.length=0);let o="";for(;s<e;){const f=this._data[3*s+0],u=2097151&f,p=2097152&f?this._combined[s]:u?(0,d.stringFromCodePoint)(u):n.WHITESPACE_CELL_CHAR;if(o+=p,t)for(let c=0;c<p.length;++c)t.push(s);s+=f>>22||1}return t&&t.push(s),o}}r.BufferLine=g},4841:(O,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.getRangeLength=void 0,r.getRangeLength=function(a,l){if(a.start.y>a.end.y)throw new Error(`Buffer range end (${a.end.x}, ${a.end.y}) cannot be before start (${a.start.x}, ${a.start.y})`);return l*(a.end.y-a.start.y)+(a.end.x-a.start.x+1)}},4634:(O,r)=>{function a(l,_,n){if(_===l.length-1)return l[_].getTrimmedLength();const d=!l[_].hasContent(n-1)&&l[_].getWidth(n-1)===1,v=l[_+1].getWidth(0)===2;return d&&v?n-1:n}Object.defineProperty(r,"__esModule",{value:!0}),r.getWrappedLineTrimmedLength=r.reflowSmallerGetNewLineLengths=r.reflowLargerApplyNewLayout=r.reflowLargerCreateNewLayout=r.reflowLargerGetLinesToRemove=void 0,r.reflowLargerGetLinesToRemove=function(l,_,n,d,v){const g=[];for(let h=0;h<l.length-1;h++){let i=h,s=l.get(++i);if(!s.isWrapped)continue;const e=[l.get(h)];for(;i<l.length&&s.isWrapped;)e.push(s),s=l.get(++i);if(d>=h&&d<i){h+=e.length-1;continue}let t=0,o=a(e,t,_),f=1,u=0;for(;f<e.length;){const c=a(e,f,_),m=c-u,y=n-o,k=Math.min(m,y);e[t].copyCellsFrom(e[f],u,o,k,!1),o+=k,o===n&&(t++,o=0),u+=k,u===c&&(f++,u=0),o===0&&t!==0&&e[t-1].getWidth(n-1)===2&&(e[t].copyCellsFrom(e[t-1],n-1,o++,1,!1),e[t-1].setCell(n-1,v))}e[t].replaceCells(o,n,v);let p=0;for(let c=e.length-1;c>0&&(c>t||e[c].getTrimmedLength()===0);c--)p++;p>0&&(g.push(h+e.length-p),g.push(p)),h+=e.length-1}return g},r.reflowLargerCreateNewLayout=function(l,_){const n=[];let d=0,v=_[d],g=0;for(let h=0;h<l.length;h++)if(v===h){const i=_[++d];l.onDeleteEmitter.fire({index:h-g,amount:i}),h+=i-1,g+=i,v=_[++d]}else n.push(h);return{layout:n,countRemoved:g}},r.reflowLargerApplyNewLayout=function(l,_){const n=[];for(let d=0;d<_.length;d++)n.push(l.get(_[d]));for(let d=0;d<n.length;d++)l.set(d,n[d]);l.length=_.length},r.reflowSmallerGetNewLineLengths=function(l,_,n){const d=[],v=l.map(((s,e)=>a(l,e,_))).reduce(((s,e)=>s+e));let g=0,h=0,i=0;for(;i<v;){if(v-i<n){d.push(v-i);break}g+=n;const s=a(l,h,_);g>s&&(g-=s,h++);const e=l[h].getWidth(g-1)===2;e&&g--;const t=e?n-1:n;d.push(t),i+=t}return d},r.getWrappedLineTrimmedLength=a},5295:(O,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferSet=void 0;const l=a(8460),_=a(844),n=a(9092);class d extends _.Disposable{constructor(g,h){super(),this._optionsService=g,this._bufferService=h,this._onBufferActivate=this.register(new l.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.resize(this._bufferService.cols,this._bufferService.rows)))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",(()=>this.setupTabStops())))}reset(){this._normal=new n.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new n.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(g){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(g),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(g,h){this._normal.resize(g,h),this._alt.resize(g,h),this.setupTabStops(g)}setupTabStops(g){this._normal.setupTabStops(g),this._alt.setupTabStops(g)}}r.BufferSet=d},511:(O,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CellData=void 0;const l=a(482),_=a(643),n=a(3734);class d extends n.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new n.ExtendedAttrs,this.combinedData=""}static fromCharData(g){const h=new d;return h.setFromCharData(g),h}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,l.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(g){this.fg=g[_.CHAR_DATA_ATTR_INDEX],this.bg=0;let h=!1;if(g[_.CHAR_DATA_CHAR_INDEX].length>2)h=!0;else if(g[_.CHAR_DATA_CHAR_INDEX].length===2){const i=g[_.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=i&&i<=56319){const s=g[_.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=s&&s<=57343?this.content=1024*(i-55296)+s-56320+65536|g[_.CHAR_DATA_WIDTH_INDEX]<<22:h=!0}else h=!0}else this.content=g[_.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|g[_.CHAR_DATA_WIDTH_INDEX]<<22;h&&(this.combinedData=g[_.CHAR_DATA_CHAR_INDEX],this.content=2097152|g[_.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}r.CellData=d},643:(O,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.WHITESPACE_CELL_CODE=r.WHITESPACE_CELL_WIDTH=r.WHITESPACE_CELL_CHAR=r.NULL_CELL_CODE=r.NULL_CELL_WIDTH=r.NULL_CELL_CHAR=r.CHAR_DATA_CODE_INDEX=r.CHAR_DATA_WIDTH_INDEX=r.CHAR_DATA_CHAR_INDEX=r.CHAR_DATA_ATTR_INDEX=r.DEFAULT_EXT=r.DEFAULT_ATTR=r.DEFAULT_COLOR=void 0,r.DEFAULT_COLOR=0,r.DEFAULT_ATTR=256|r.DEFAULT_COLOR<<9,r.DEFAULT_EXT=0,r.CHAR_DATA_ATTR_INDEX=0,r.CHAR_DATA_CHAR_INDEX=1,r.CHAR_DATA_WIDTH_INDEX=2,r.CHAR_DATA_CODE_INDEX=3,r.NULL_CELL_CHAR="",r.NULL_CELL_WIDTH=1,r.NULL_CELL_CODE=0,r.WHITESPACE_CELL_CHAR=" ",r.WHITESPACE_CELL_WIDTH=1,r.WHITESPACE_CELL_CODE=32},4863:(O,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Marker=void 0;const l=a(8460),_=a(844);class n{get id(){return this._id}constructor(v){this.line=v,this.isDisposed=!1,this._disposables=[],this._id=n._nextId++,this._onDispose=this.register(new l.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,_.disposeArray)(this._disposables),this._disposables.length=0)}register(v){return this._disposables.push(v),v}}r.Marker=n,n._nextId=1},7116:(O,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.DEFAULT_CHARSET=r.CHARSETS=void 0,r.CHARSETS={},r.DEFAULT_CHARSET=r.CHARSETS.B,r.CHARSETS[0]={"`":"â—†",a:"â–’",b:"â�‰",c:"â�Œ",d:"â��",e:"â�Š",f:"Â°",g:"Â±",h:"â�¤",i:"â�‹",j:"â”˜",k:"â”�",l:"â”Œ",m:"â””",n:"â”¼",o:"âŽº",p:"âŽ»",q:"â”€",r:"âŽ¼",s:"âŽ½",t:"â”œ",u:"â”¤",v:"â”´",w:"â”¬",x:"â”‚",y:"â‰¤",z:"â‰¥","{":"Ï€","|":"â‰ ","}":"Â£","~":"Â·"},r.CHARSETS.A={"#":"Â£"},r.CHARSETS.B=void 0,r.CHARSETS[4]={"#":"Â£","@":"Â¾","[":"ij","\\":"Â½","]":"|","{":"Â¨","|":"f","}":"Â¼","~":"Â´"},r.CHARSETS.C=r.CHARSETS[5]={"[":"Ã„","\\":"Ã–","]":"Ã…","^":"Ãœ","`":"Ã©","{":"Ã¤","|":"Ã¶","}":"Ã¥","~":"Ã¼"},r.CHARSETS.R={"#":"Â£","@":"Ã ","[":"Â°","\\":"Ã§","]":"Â§","{":"Ã©","|":"Ã¹","}":"Ã¨","~":"Â¨"},r.CHARSETS.Q={"@":"Ã ","[":"Ã¢","\\":"Ã§","]":"Ãª","^":"Ã®","`":"Ã´","{":"Ã©","|":"Ã¹","}":"Ã¨","~":"Ã»"},r.CHARSETS.K={"@":"Â§","[":"Ã„","\\":"Ã–","]":"Ãœ","{":"Ã¤","|":"Ã¶","}":"Ã¼","~":"ÃŸ"},r.CHARSETS.Y={"#":"Â£","@":"Â§","[":"Â°","\\":"Ã§","]":"Ã©","`":"Ã¹","{":"Ã ","|":"Ã²","}":"Ã¨","~":"Ã¬"},r.CHARSETS.E=r.CHARSETS[6]={"@":"Ã„","[":"Ã†","\\":"Ã˜","]":"Ã…","^":"Ãœ","`":"Ã¤","{":"Ã¦","|":"Ã¸","}":"Ã¥","~":"Ã¼"},r.CHARSETS.Z={"#":"Â£","@":"Â§","[":"Â¡","\\":"Ã‘","]":"Â¿","{":"Â°","|":"Ã±","}":"Ã§"},r.CHARSETS.H=r.CHARSETS[7]={"@":"Ã‰","[":"Ã„","\\":"Ã–","]":"Ã…","^":"Ãœ","`":"Ã©","{":"Ã¤","|":"Ã¶","}":"Ã¥","~":"Ã¼"},r.CHARSETS["="]={"#":"Ã¹","@":"Ã ","[":"Ã©","\\":"Ã§","]":"Ãª","^":"Ã®",_:"Ã¨","`":"Ã´","{":"Ã¤","|":"Ã¶","}":"Ã¼","~":"Ã»"}},2584:(O,r)=>{var a,l,_;Object.defineProperty(r,"__esModule",{value:!0}),r.C1_ESCAPED=r.C1=r.C0=void 0,(function(n){n.NUL="\0",n.SOH="",n.STX="",n.ETX="",n.EOT="",n.ENQ="",n.ACK="",n.BEL="\x07",n.BS="\b",n.HT="	",n.LF=`
`,n.VT="\v",n.FF="\f",n.CR="\r",n.SO="",n.SI="",n.DLE="",n.DC1="",n.DC2="",n.DC3="",n.DC4="",n.NAK="",n.SYN="",n.ETB="",n.CAN="",n.EM="",n.SUB="",n.ESC="\x1B",n.FS="",n.GS="",n.RS="",n.US="",n.SP=" ",n.DEL=""})(a||(r.C0=a={})),(function(n){n.PAD="Â€",n.HOP="Â�",n.BPH="Â‚",n.NBH="Âƒ",n.IND="Â„",n.NEL="Â…",n.SSA="Â†",n.ESA="Â‡",n.HTS="Âˆ",n.HTJ="Â‰",n.VTS="ÂŠ",n.PLD="Â‹",n.PLU="ÂŒ",n.RI="Â�",n.SS2="ÂŽ",n.SS3="Â�",n.DCS="Â�",n.PU1="Â‘",n.PU2="Â’",n.STS="Â“",n.CCH="Â”",n.MW="Â•",n.SPA="Â–",n.EPA="Â—",n.SOS="Â˜",n.SGCI="Â™",n.SCI="Âš",n.CSI="Â›",n.ST="Âœ",n.OSC="Â�",n.PM="Âž",n.APC="ÂŸ"})(l||(r.C1=l={})),(function(n){n.ST=`${a.ESC}\\`})(_||(r.C1_ESCAPED=_={}))},7399:(O,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.evaluateKeyboardEvent=void 0;const l=a(2584),_={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};r.evaluateKeyboardEvent=function(n,d,v,g){const h={type:0,cancel:!1,key:void 0},i=(n.shiftKey?1:0)|(n.altKey?2:0)|(n.ctrlKey?4:0)|(n.metaKey?8:0);switch(n.keyCode){case 0:n.key==="UIKeyInputUpArrow"?h.key=d?l.C0.ESC+"OA":l.C0.ESC+"[A":n.key==="UIKeyInputLeftArrow"?h.key=d?l.C0.ESC+"OD":l.C0.ESC+"[D":n.key==="UIKeyInputRightArrow"?h.key=d?l.C0.ESC+"OC":l.C0.ESC+"[C":n.key==="UIKeyInputDownArrow"&&(h.key=d?l.C0.ESC+"OB":l.C0.ESC+"[B");break;case 8:h.key=n.ctrlKey?"\b":l.C0.DEL,n.altKey&&(h.key=l.C0.ESC+h.key);break;case 9:if(n.shiftKey){h.key=l.C0.ESC+"[Z";break}h.key=l.C0.HT,h.cancel=!0;break;case 13:h.key=n.altKey?l.C0.ESC+l.C0.CR:l.C0.CR,h.cancel=!0;break;case 27:h.key=l.C0.ESC,n.altKey&&(h.key=l.C0.ESC+l.C0.ESC),h.cancel=!0;break;case 37:if(n.metaKey)break;i?(h.key=l.C0.ESC+"[1;"+(i+1)+"D",h.key===l.C0.ESC+"[1;3D"&&(h.key=l.C0.ESC+(v?"b":"[1;5D"))):h.key=d?l.C0.ESC+"OD":l.C0.ESC+"[D";break;case 39:if(n.metaKey)break;i?(h.key=l.C0.ESC+"[1;"+(i+1)+"C",h.key===l.C0.ESC+"[1;3C"&&(h.key=l.C0.ESC+(v?"f":"[1;5C"))):h.key=d?l.C0.ESC+"OC":l.C0.ESC+"[C";break;case 38:if(n.metaKey)break;i?(h.key=l.C0.ESC+"[1;"+(i+1)+"A",v||h.key!==l.C0.ESC+"[1;3A"||(h.key=l.C0.ESC+"[1;5A")):h.key=d?l.C0.ESC+"OA":l.C0.ESC+"[A";break;case 40:if(n.metaKey)break;i?(h.key=l.C0.ESC+"[1;"+(i+1)+"B",v||h.key!==l.C0.ESC+"[1;3B"||(h.key=l.C0.ESC+"[1;5B")):h.key=d?l.C0.ESC+"OB":l.C0.ESC+"[B";break;case 45:n.shiftKey||n.ctrlKey||(h.key=l.C0.ESC+"[2~");break;case 46:h.key=i?l.C0.ESC+"[3;"+(i+1)+"~":l.C0.ESC+"[3~";break;case 36:h.key=i?l.C0.ESC+"[1;"+(i+1)+"H":d?l.C0.ESC+"OH":l.C0.ESC+"[H";break;case 35:h.key=i?l.C0.ESC+"[1;"+(i+1)+"F":d?l.C0.ESC+"OF":l.C0.ESC+"[F";break;case 33:n.shiftKey?h.type=2:n.ctrlKey?h.key=l.C0.ESC+"[5;"+(i+1)+"~":h.key=l.C0.ESC+"[5~";break;case 34:n.shiftKey?h.type=3:n.ctrlKey?h.key=l.C0.ESC+"[6;"+(i+1)+"~":h.key=l.C0.ESC+"[6~";break;case 112:h.key=i?l.C0.ESC+"[1;"+(i+1)+"P":l.C0.ESC+"OP";break;case 113:h.key=i?l.C0.ESC+"[1;"+(i+1)+"Q":l.C0.ESC+"OQ";break;case 114:h.key=i?l.C0.ESC+"[1;"+(i+1)+"R":l.C0.ESC+"OR";break;case 115:h.key=i?l.C0.ESC+"[1;"+(i+1)+"S":l.C0.ESC+"OS";break;case 116:h.key=i?l.C0.ESC+"[15;"+(i+1)+"~":l.C0.ESC+"[15~";break;case 117:h.key=i?l.C0.ESC+"[17;"+(i+1)+"~":l.C0.ESC+"[17~";break;case 118:h.key=i?l.C0.ESC+"[18;"+(i+1)+"~":l.C0.ESC+"[18~";break;case 119:h.key=i?l.C0.ESC+"[19;"+(i+1)+"~":l.C0.ESC+"[19~";break;case 120:h.key=i?l.C0.ESC+"[20;"+(i+1)+"~":l.C0.ESC+"[20~";break;case 121:h.key=i?l.C0.ESC+"[21;"+(i+1)+"~":l.C0.ESC+"[21~";break;case 122:h.key=i?l.C0.ESC+"[23;"+(i+1)+"~":l.C0.ESC+"[23~";break;case 123:h.key=i?l.C0.ESC+"[24;"+(i+1)+"~":l.C0.ESC+"[24~";break;default:if(!n.ctrlKey||n.shiftKey||n.altKey||n.metaKey)if(v&&!g||!n.altKey||n.metaKey)!v||n.altKey||n.ctrlKey||n.shiftKey||!n.metaKey?n.key&&!n.ctrlKey&&!n.altKey&&!n.metaKey&&n.keyCode>=48&&n.key.length===1?h.key=n.key:n.key&&n.ctrlKey&&(n.key==="_"&&(h.key=l.C0.US),n.key==="@"&&(h.key=l.C0.NUL)):n.keyCode===65&&(h.type=1);else{const s=_[n.keyCode],e=s==null?void 0:s[n.shiftKey?1:0];if(e)h.key=l.C0.ESC+e;else if(n.keyCode>=65&&n.keyCode<=90){const t=n.ctrlKey?n.keyCode-64:n.keyCode+32;let o=String.fromCharCode(t);n.shiftKey&&(o=o.toUpperCase()),h.key=l.C0.ESC+o}else if(n.keyCode===32)h.key=l.C0.ESC+(n.ctrlKey?l.C0.NUL:" ");else if(n.key==="Dead"&&n.code.startsWith("Key")){let t=n.code.slice(3,4);n.shiftKey||(t=t.toLowerCase()),h.key=l.C0.ESC+t,h.cancel=!0}}else n.keyCode>=65&&n.keyCode<=90?h.key=String.fromCharCode(n.keyCode-64):n.keyCode===32?h.key=l.C0.NUL:n.keyCode>=51&&n.keyCode<=55?h.key=String.fromCharCode(n.keyCode-51+27):n.keyCode===56?h.key=l.C0.DEL:n.keyCode===219?h.key=l.C0.ESC:n.keyCode===220?h.key=l.C0.FS:n.keyCode===221&&(h.key=l.C0.GS)}return h}},482:(O,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Utf8ToUtf32=r.StringToUtf32=r.utf32ToString=r.stringFromCodePoint=void 0,r.stringFromCodePoint=function(a){return a>65535?(a-=65536,String.fromCharCode(55296+(a>>10))+String.fromCharCode(a%1024+56320)):String.fromCharCode(a)},r.utf32ToString=function(a,l=0,_=a.length){let n="";for(let d=l;d<_;++d){let v=a[d];v>65535?(v-=65536,n+=String.fromCharCode(55296+(v>>10))+String.fromCharCode(v%1024+56320)):n+=String.fromCharCode(v)}return n},r.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(a,l){const _=a.length;if(!_)return 0;let n=0,d=0;if(this._interim){const v=a.charCodeAt(d++);56320<=v&&v<=57343?l[n++]=1024*(this._interim-55296)+v-56320+65536:(l[n++]=this._interim,l[n++]=v),this._interim=0}for(let v=d;v<_;++v){const g=a.charCodeAt(v);if(55296<=g&&g<=56319){if(++v>=_)return this._interim=g,n;const h=a.charCodeAt(v);56320<=h&&h<=57343?l[n++]=1024*(g-55296)+h-56320+65536:(l[n++]=g,l[n++]=h)}else g!==65279&&(l[n++]=g)}return n}},r.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(a,l){const _=a.length;if(!_)return 0;let n,d,v,g,h=0,i=0,s=0;if(this.interim[0]){let o=!1,f=this.interim[0];f&=(224&f)==192?31:(240&f)==224?15:7;let u,p=0;for(;(u=63&this.interim[++p])&&p<4;)f<<=6,f|=u;const c=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,m=c-p;for(;s<m;){if(s>=_)return 0;if(u=a[s++],(192&u)!=128){s--,o=!0;break}this.interim[p++]=u,f<<=6,f|=63&u}o||(c===2?f<128?s--:l[h++]=f:c===3?f<2048||f>=55296&&f<=57343||f===65279||(l[h++]=f):f<65536||f>1114111||(l[h++]=f)),this.interim.fill(0)}const e=_-4;let t=s;for(;t<_;){for(;!(!(t<e)||128&(n=a[t])||128&(d=a[t+1])||128&(v=a[t+2])||128&(g=a[t+3]));)l[h++]=n,l[h++]=d,l[h++]=v,l[h++]=g,t+=4;if(n=a[t++],n<128)l[h++]=n;else if((224&n)==192){if(t>=_)return this.interim[0]=n,h;if(d=a[t++],(192&d)!=128){t--;continue}if(i=(31&n)<<6|63&d,i<128){t--;continue}l[h++]=i}else if((240&n)==224){if(t>=_)return this.interim[0]=n,h;if(d=a[t++],(192&d)!=128){t--;continue}if(t>=_)return this.interim[0]=n,this.interim[1]=d,h;if(v=a[t++],(192&v)!=128){t--;continue}if(i=(15&n)<<12|(63&d)<<6|63&v,i<2048||i>=55296&&i<=57343||i===65279)continue;l[h++]=i}else if((248&n)==240){if(t>=_)return this.interim[0]=n,h;if(d=a[t++],(192&d)!=128){t--;continue}if(t>=_)return this.interim[0]=n,this.interim[1]=d,h;if(v=a[t++],(192&v)!=128){t--;continue}if(t>=_)return this.interim[0]=n,this.interim[1]=d,this.interim[2]=v,h;if(g=a[t++],(192&g)!=128){t--;continue}if(i=(7&n)<<18|(63&d)<<12|(63&v)<<6|63&g,i<65536||i>1114111)continue;l[h++]=i}}return h}}},225:(O,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.UnicodeV6=void 0;const l=a(1480),_=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],n=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let d;r.UnicodeV6=class{constructor(){if(this.version="6",!d){d=new Uint8Array(65536),d.fill(1),d[0]=0,d.fill(0,1,32),d.fill(0,127,160),d.fill(2,4352,4448),d[9001]=2,d[9002]=2,d.fill(2,11904,42192),d[12351]=1,d.fill(2,44032,55204),d.fill(2,63744,64256),d.fill(2,65040,65050),d.fill(2,65072,65136),d.fill(2,65280,65377),d.fill(2,65504,65511);for(let v=0;v<_.length;++v)d.fill(0,_[v][0],_[v][1]+1)}}wcwidth(v){return v<32?0:v<127?1:v<65536?d[v]:(function(g,h){let i,s=0,e=h.length-1;if(g<h[0][0]||g>h[e][1])return!1;for(;e>=s;)if(i=s+e>>1,g>h[i][1])s=i+1;else{if(!(g<h[i][0]))return!0;e=i-1}return!1})(v,n)?0:v>=131072&&v<=196605||v>=196608&&v<=262141?2:1}charProperties(v,g){let h=this.wcwidth(v),i=h===0&&g!==0;if(i){const s=l.UnicodeService.extractWidth(g);s===0?i=!1:s>h&&(h=s)}return l.UnicodeService.createPropertyValue(0,h,i)}}},5981:(O,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.WriteBuffer=void 0;const l=a(8460),_=a(844);class n extends _.Disposable{constructor(v){super(),this._action=v,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new l.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(v,g){if(g!==void 0&&this._syncCalls>g)return void(this._syncCalls=0);if(this._pendingData+=v.length,this._writeBuffer.push(v),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let h;for(this._isSyncWriting=!0;h=this._writeBuffer.shift();){this._action(h);const i=this._callbacks.shift();i&&i()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(v,g){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=v.length,this._writeBuffer.push(v),this._callbacks.push(g),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=v.length,this._writeBuffer.push(v),this._callbacks.push(g)}_innerWrite(v=0,g=!0){const h=v||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const i=this._writeBuffer[this._bufferOffset],s=this._action(i,g);if(s){const t=o=>Date.now()-h>=12?setTimeout((()=>this._innerWrite(0,o))):this._innerWrite(h,o);return void s.catch((o=>(queueMicrotask((()=>{throw o})),Promise.resolve(!1)))).then(t)}const e=this._callbacks[this._bufferOffset];if(e&&e(),this._bufferOffset++,this._pendingData-=i.length,Date.now()-h>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout((()=>this._innerWrite()))):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}r.WriteBuffer=n},5941:(O,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.toRgbString=r.parseColor=void 0;const a=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,l=/^[\da-f]+$/;function _(n,d){const v=n.toString(16),g=v.length<2?"0"+v:v;switch(d){case 4:return v[0];case 8:return g;case 12:return(g+g).slice(0,3);default:return g+g}}r.parseColor=function(n){if(!n)return;let d=n.toLowerCase();if(d.indexOf("rgb:")===0){d=d.slice(4);const v=a.exec(d);if(v){const g=v[1]?15:v[4]?255:v[7]?4095:65535;return[Math.round(parseInt(v[1]||v[4]||v[7]||v[10],16)/g*255),Math.round(parseInt(v[2]||v[5]||v[8]||v[11],16)/g*255),Math.round(parseInt(v[3]||v[6]||v[9]||v[12],16)/g*255)]}}else if(d.indexOf("#")===0&&(d=d.slice(1),l.exec(d)&&[3,6,9,12].includes(d.length))){const v=d.length/3,g=[0,0,0];for(let h=0;h<3;++h){const i=parseInt(d.slice(v*h,v*h+v),16);g[h]=v===1?i<<4:v===2?i:v===3?i>>4:i>>8}return g}},r.toRgbString=function(n,d=16){const[v,g,h]=n;return`rgb:${_(v,d)}/${_(g,d)}/${_(h,d)}`}},5770:(O,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.PAYLOAD_LIMIT=void 0,r.PAYLOAD_LIMIT=1e7},6351:(O,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.DcsHandler=r.DcsParser=void 0;const l=a(482),_=a(8742),n=a(5770),d=[];r.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=d,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=d}registerHandler(g,h){this._handlers[g]===void 0&&(this._handlers[g]=[]);const i=this._handlers[g];return i.push(h),{dispose:()=>{const s=i.indexOf(h);s!==-1&&i.splice(s,1)}}}clearHandler(g){this._handlers[g]&&delete this._handlers[g]}setHandlerFallback(g){this._handlerFb=g}reset(){if(this._active.length)for(let g=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;g>=0;--g)this._active[g].unhook(!1);this._stack.paused=!1,this._active=d,this._ident=0}hook(g,h){if(this.reset(),this._ident=g,this._active=this._handlers[g]||d,this._active.length)for(let i=this._active.length-1;i>=0;i--)this._active[i].hook(h);else this._handlerFb(this._ident,"HOOK",h)}put(g,h,i){if(this._active.length)for(let s=this._active.length-1;s>=0;s--)this._active[s].put(g,h,i);else this._handlerFb(this._ident,"PUT",(0,l.utf32ToString)(g,h,i))}unhook(g,h=!0){if(this._active.length){let i=!1,s=this._active.length-1,e=!1;if(this._stack.paused&&(s=this._stack.loopPosition-1,i=h,e=this._stack.fallThrough,this._stack.paused=!1),!e&&i===!1){for(;s>=0&&(i=this._active[s].unhook(g),i!==!0);s--)if(i instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=s,this._stack.fallThrough=!1,i;s--}for(;s>=0;s--)if(i=this._active[s].unhook(!1),i instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=s,this._stack.fallThrough=!0,i}else this._handlerFb(this._ident,"UNHOOK",g);this._active=d,this._ident=0}};const v=new _.Params;v.addParam(0),r.DcsHandler=class{constructor(g){this._handler=g,this._data="",this._params=v,this._hitLimit=!1}hook(g){this._params=g.length>1||g.params[0]?g.clone():v,this._data="",this._hitLimit=!1}put(g,h,i){this._hitLimit||(this._data+=(0,l.utf32ToString)(g,h,i),this._data.length>n.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(g){let h=!1;if(this._hitLimit)h=!1;else if(g&&(h=this._handler(this._data,this._params),h instanceof Promise))return h.then((i=>(this._params=v,this._data="",this._hitLimit=!1,i)));return this._params=v,this._data="",this._hitLimit=!1,h}}},2015:(O,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.EscapeSequenceParser=r.VT500_TRANSITION_TABLE=r.TransitionTable=void 0;const l=a(844),_=a(8742),n=a(6242),d=a(6351);class v{constructor(s){this.table=new Uint8Array(s)}setDefault(s,e){this.table.fill(s<<4|e)}add(s,e,t,o){this.table[e<<8|s]=t<<4|o}addMany(s,e,t,o){for(let f=0;f<s.length;f++)this.table[e<<8|s[f]]=t<<4|o}}r.TransitionTable=v;const g=160;r.VT500_TRANSITION_TABLE=(function(){const i=new v(4095),s=Array.apply(null,Array(256)).map(((p,c)=>c)),e=(p,c)=>s.slice(p,c),t=e(32,127),o=e(0,24);o.push(25),o.push.apply(o,e(28,32));const f=e(0,14);let u;for(u in i.setDefault(1,0),i.addMany(t,0,2,0),f)i.addMany([24,26,153,154],u,3,0),i.addMany(e(128,144),u,3,0),i.addMany(e(144,152),u,3,0),i.add(156,u,0,0),i.add(27,u,11,1),i.add(157,u,4,8),i.addMany([152,158,159],u,0,7),i.add(155,u,11,3),i.add(144,u,11,9);return i.addMany(o,0,3,0),i.addMany(o,1,3,1),i.add(127,1,0,1),i.addMany(o,8,0,8),i.addMany(o,3,3,3),i.add(127,3,0,3),i.addMany(o,4,3,4),i.add(127,4,0,4),i.addMany(o,6,3,6),i.addMany(o,5,3,5),i.add(127,5,0,5),i.addMany(o,2,3,2),i.add(127,2,0,2),i.add(93,1,4,8),i.addMany(t,8,5,8),i.add(127,8,5,8),i.addMany([156,27,24,26,7],8,6,0),i.addMany(e(28,32),8,0,8),i.addMany([88,94,95],1,0,7),i.addMany(t,7,0,7),i.addMany(o,7,0,7),i.add(156,7,0,0),i.add(127,7,0,7),i.add(91,1,11,3),i.addMany(e(64,127),3,7,0),i.addMany(e(48,60),3,8,4),i.addMany([60,61,62,63],3,9,4),i.addMany(e(48,60),4,8,4),i.addMany(e(64,127),4,7,0),i.addMany([60,61,62,63],4,0,6),i.addMany(e(32,64),6,0,6),i.add(127,6,0,6),i.addMany(e(64,127),6,0,0),i.addMany(e(32,48),3,9,5),i.addMany(e(32,48),5,9,5),i.addMany(e(48,64),5,0,6),i.addMany(e(64,127),5,7,0),i.addMany(e(32,48),4,9,5),i.addMany(e(32,48),1,9,2),i.addMany(e(32,48),2,9,2),i.addMany(e(48,127),2,10,0),i.addMany(e(48,80),1,10,0),i.addMany(e(81,88),1,10,0),i.addMany([89,90,92],1,10,0),i.addMany(e(96,127),1,10,0),i.add(80,1,11,9),i.addMany(o,9,0,9),i.add(127,9,0,9),i.addMany(e(28,32),9,0,9),i.addMany(e(32,48),9,9,12),i.addMany(e(48,60),9,8,10),i.addMany([60,61,62,63],9,9,10),i.addMany(o,11,0,11),i.addMany(e(32,128),11,0,11),i.addMany(e(28,32),11,0,11),i.addMany(o,10,0,10),i.add(127,10,0,10),i.addMany(e(28,32),10,0,10),i.addMany(e(48,60),10,8,10),i.addMany([60,61,62,63],10,0,11),i.addMany(e(32,48),10,9,12),i.addMany(o,12,0,12),i.add(127,12,0,12),i.addMany(e(28,32),12,0,12),i.addMany(e(32,48),12,9,12),i.addMany(e(48,64),12,0,11),i.addMany(e(64,127),12,12,13),i.addMany(e(64,127),10,12,13),i.addMany(e(64,127),9,12,13),i.addMany(o,13,13,13),i.addMany(t,13,13,13),i.add(127,13,0,13),i.addMany([27,156,24,26],13,14,0),i.add(g,0,2,0),i.add(g,8,5,8),i.add(g,6,0,6),i.add(g,11,0,11),i.add(g,13,13,13),i})();class h extends l.Disposable{constructor(s=r.VT500_TRANSITION_TABLE){super(),this._transitions=s,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new _.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(e,t,o)=>{},this._executeHandlerFb=e=>{},this._csiHandlerFb=(e,t)=>{},this._escHandlerFb=e=>{},this._errorHandlerFb=e=>e,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,l.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new n.OscParser),this._dcsParser=this.register(new d.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(s,e=[64,126]){let t=0;if(s.prefix){if(s.prefix.length>1)throw new Error("only one byte as prefix supported");if(t=s.prefix.charCodeAt(0),t&&60>t||t>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(s.intermediates){if(s.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let f=0;f<s.intermediates.length;++f){const u=s.intermediates.charCodeAt(f);if(32>u||u>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");t<<=8,t|=u}}if(s.final.length!==1)throw new Error("final must be a single byte");const o=s.final.charCodeAt(0);if(e[0]>o||o>e[1])throw new Error(`final must be in range ${e[0]} .. ${e[1]}`);return t<<=8,t|=o,t}identToString(s){const e=[];for(;s;)e.push(String.fromCharCode(255&s)),s>>=8;return e.reverse().join("")}setPrintHandler(s){this._printHandler=s}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(s,e){const t=this._identifier(s,[48,126]);this._escHandlers[t]===void 0&&(this._escHandlers[t]=[]);const o=this._escHandlers[t];return o.push(e),{dispose:()=>{const f=o.indexOf(e);f!==-1&&o.splice(f,1)}}}clearEscHandler(s){this._escHandlers[this._identifier(s,[48,126])]&&delete this._escHandlers[this._identifier(s,[48,126])]}setEscHandlerFallback(s){this._escHandlerFb=s}setExecuteHandler(s,e){this._executeHandlers[s.charCodeAt(0)]=e}clearExecuteHandler(s){this._executeHandlers[s.charCodeAt(0)]&&delete this._executeHandlers[s.charCodeAt(0)]}setExecuteHandlerFallback(s){this._executeHandlerFb=s}registerCsiHandler(s,e){const t=this._identifier(s);this._csiHandlers[t]===void 0&&(this._csiHandlers[t]=[]);const o=this._csiHandlers[t];return o.push(e),{dispose:()=>{const f=o.indexOf(e);f!==-1&&o.splice(f,1)}}}clearCsiHandler(s){this._csiHandlers[this._identifier(s)]&&delete this._csiHandlers[this._identifier(s)]}setCsiHandlerFallback(s){this._csiHandlerFb=s}registerDcsHandler(s,e){return this._dcsParser.registerHandler(this._identifier(s),e)}clearDcsHandler(s){this._dcsParser.clearHandler(this._identifier(s))}setDcsHandlerFallback(s){this._dcsParser.setHandlerFallback(s)}registerOscHandler(s,e){return this._oscParser.registerHandler(s,e)}clearOscHandler(s){this._oscParser.clearHandler(s)}setOscHandlerFallback(s){this._oscParser.setHandlerFallback(s)}setErrorHandler(s){this._errorHandler=s}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(s,e,t,o,f){this._parseStack.state=s,this._parseStack.handlers=e,this._parseStack.handlerPos=t,this._parseStack.transition=o,this._parseStack.chunkPos=f}parse(s,e,t){let o,f=0,u=0,p=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,p=this._parseStack.chunkPos+1;else{if(t===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const c=this._parseStack.handlers;let m=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(t===!1&&m>-1){for(;m>=0&&(o=c[m](this._params),o!==!0);m--)if(o instanceof Promise)return this._parseStack.handlerPos=m,o}this._parseStack.handlers=[];break;case 4:if(t===!1&&m>-1){for(;m>=0&&(o=c[m](),o!==!0);m--)if(o instanceof Promise)return this._parseStack.handlerPos=m,o}this._parseStack.handlers=[];break;case 6:if(f=s[this._parseStack.chunkPos],o=this._dcsParser.unhook(f!==24&&f!==26,t),o)return o;f===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(f=s[this._parseStack.chunkPos],o=this._oscParser.end(f!==24&&f!==26,t),o)return o;f===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,p=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let c=p;c<e;++c){switch(f=s[c],u=this._transitions.table[this.currentState<<8|(f<160?f:g)],u>>4){case 2:for(let w=c+1;;++w){if(w>=e||(f=s[w])<32||f>126&&f<g){this._printHandler(s,c,w),c=w-1;break}if(++w>=e||(f=s[w])<32||f>126&&f<g){this._printHandler(s,c,w),c=w-1;break}if(++w>=e||(f=s[w])<32||f>126&&f<g){this._printHandler(s,c,w),c=w-1;break}if(++w>=e||(f=s[w])<32||f>126&&f<g){this._printHandler(s,c,w),c=w-1;break}}break;case 3:this._executeHandlers[f]?this._executeHandlers[f]():this._executeHandlerFb(f),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:c,code:f,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const m=this._csiHandlers[this._collect<<8|f];let y=m?m.length-1:-1;for(;y>=0&&(o=m[y](this._params),o!==!0);y--)if(o instanceof Promise)return this._preserveStack(3,m,y,u,c),o;y<0&&this._csiHandlerFb(this._collect<<8|f,this._params),this.precedingJoinState=0;break;case 8:do switch(f){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(f-48)}while(++c<e&&(f=s[c])>47&&f<60);c--;break;case 9:this._collect<<=8,this._collect|=f;break;case 10:const k=this._escHandlers[this._collect<<8|f];let L=k?k.length-1:-1;for(;L>=0&&(o=k[L](),o!==!0);L--)if(o instanceof Promise)return this._preserveStack(4,k,L,u,c),o;L<0&&this._escHandlerFb(this._collect<<8|f),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|f,this._params);break;case 13:for(let w=c+1;;++w)if(w>=e||(f=s[w])===24||f===26||f===27||f>127&&f<g){this._dcsParser.put(s,c,w),c=w-1;break}break;case 14:if(o=this._dcsParser.unhook(f!==24&&f!==26),o)return this._preserveStack(6,[],0,u,c),o;f===27&&(u|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break;case 4:this._oscParser.start();break;case 5:for(let w=c+1;;w++)if(w>=e||(f=s[w])<32||f>127&&f<g){this._oscParser.put(s,c,w),c=w-1;break}break;case 6:if(o=this._oscParser.end(f!==24&&f!==26),o)return this._preserveStack(5,[],0,u,c),o;f===27&&(u|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&u}}}r.EscapeSequenceParser=h},6242:(O,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.OscHandler=r.OscParser=void 0;const l=a(5770),_=a(482),n=[];r.OscParser=class{constructor(){this._state=0,this._active=n,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(d,v){this._handlers[d]===void 0&&(this._handlers[d]=[]);const g=this._handlers[d];return g.push(v),{dispose:()=>{const h=g.indexOf(v);h!==-1&&g.splice(h,1)}}}clearHandler(d){this._handlers[d]&&delete this._handlers[d]}setHandlerFallback(d){this._handlerFb=d}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=n}reset(){if(this._state===2)for(let d=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;d>=0;--d)this._active[d].end(!1);this._stack.paused=!1,this._active=n,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||n,this._active.length)for(let d=this._active.length-1;d>=0;d--)this._active[d].start();else this._handlerFb(this._id,"START")}_put(d,v,g){if(this._active.length)for(let h=this._active.length-1;h>=0;h--)this._active[h].put(d,v,g);else this._handlerFb(this._id,"PUT",(0,_.utf32ToString)(d,v,g))}start(){this.reset(),this._state=1}put(d,v,g){if(this._state!==3){if(this._state===1)for(;v<g;){const h=d[v++];if(h===59){this._state=2,this._start();break}if(h<48||57<h)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+h-48}this._state===2&&g-v>0&&this._put(d,v,g)}}end(d,v=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let g=!1,h=this._active.length-1,i=!1;if(this._stack.paused&&(h=this._stack.loopPosition-1,g=v,i=this._stack.fallThrough,this._stack.paused=!1),!i&&g===!1){for(;h>=0&&(g=this._active[h].end(d),g!==!0);h--)if(g instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=h,this._stack.fallThrough=!1,g;h--}for(;h>=0;h--)if(g=this._active[h].end(!1),g instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=h,this._stack.fallThrough=!0,g}else this._handlerFb(this._id,"END",d);this._active=n,this._id=-1,this._state=0}}},r.OscHandler=class{constructor(d){this._handler=d,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(d,v,g){this._hitLimit||(this._data+=(0,_.utf32ToString)(d,v,g),this._data.length>l.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(d){let v=!1;if(this._hitLimit)v=!1;else if(d&&(v=this._handler(this._data),v instanceof Promise))return v.then((g=>(this._data="",this._hitLimit=!1,g)));return this._data="",this._hitLimit=!1,v}}},8742:(O,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Params=void 0;const a=2147483647;class l{static fromArray(n){const d=new l;if(!n.length)return d;for(let v=Array.isArray(n[0])?1:0;v<n.length;++v){const g=n[v];if(Array.isArray(g))for(let h=0;h<g.length;++h)d.addSubParam(g[h]);else d.addParam(g)}return d}constructor(n=32,d=32){if(this.maxLength=n,this.maxSubParamsLength=d,d>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(n),this.length=0,this._subParams=new Int32Array(d),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(n),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const n=new l(this.maxLength,this.maxSubParamsLength);return n.params.set(this.params),n.length=this.length,n._subParams.set(this._subParams),n._subParamsLength=this._subParamsLength,n._subParamsIdx.set(this._subParamsIdx),n._rejectDigits=this._rejectDigits,n._rejectSubDigits=this._rejectSubDigits,n._digitIsSub=this._digitIsSub,n}toArray(){const n=[];for(let d=0;d<this.length;++d){n.push(this.params[d]);const v=this._subParamsIdx[d]>>8,g=255&this._subParamsIdx[d];g-v>0&&n.push(Array.prototype.slice.call(this._subParams,v,g))}return n}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(n){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(n<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=n>a?a:n}}addSubParam(n){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(n<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=n>a?a:n,this._subParamsIdx[this.length-1]++}}hasSubParams(n){return(255&this._subParamsIdx[n])-(this._subParamsIdx[n]>>8)>0}getSubParams(n){const d=this._subParamsIdx[n]>>8,v=255&this._subParamsIdx[n];return v-d>0?this._subParams.subarray(d,v):null}getSubParamsAll(){const n={};for(let d=0;d<this.length;++d){const v=this._subParamsIdx[d]>>8,g=255&this._subParamsIdx[d];g-v>0&&(n[d]=this._subParams.slice(v,g))}return n}addDigit(n){let d;if(this._rejectDigits||!(d=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const v=this._digitIsSub?this._subParams:this.params,g=v[d-1];v[d-1]=~g?Math.min(10*g+n,a):n}}r.Params=l},5741:(O,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.AddonManager=void 0,r.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let a=this._addons.length-1;a>=0;a--)this._addons[a].instance.dispose()}loadAddon(a,l){const _={instance:l,dispose:l.dispose,isDisposed:!1};this._addons.push(_),l.dispose=()=>this._wrappedAddonDispose(_),l.activate(a)}_wrappedAddonDispose(a){if(a.isDisposed)return;let l=-1;for(let _=0;_<this._addons.length;_++)if(this._addons[_]===a){l=_;break}if(l===-1)throw new Error("Could not dispose an addon that has not been loaded");a.isDisposed=!0,a.dispose.apply(a.instance),this._addons.splice(l,1)}}},8771:(O,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferApiView=void 0;const l=a(3785),_=a(511);r.BufferApiView=class{constructor(n,d){this._buffer=n,this.type=d}init(n){return this._buffer=n,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(n){const d=this._buffer.lines.get(n);if(d)return new l.BufferLineApiView(d)}getNullCell(){return new _.CellData}}},3785:(O,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferLineApiView=void 0;const l=a(511);r.BufferLineApiView=class{constructor(_){this._line=_}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(_,n){if(!(_<0||_>=this._line.length))return n?(this._line.loadCell(_,n),n):this._line.loadCell(_,new l.CellData)}translateToString(_,n,d){return this._line.translateToString(_,n,d)}}},8285:(O,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferNamespaceApi=void 0;const l=a(8771),_=a(8460),n=a(844);class d extends n.Disposable{constructor(g){super(),this._core=g,this._onBufferChange=this.register(new _.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new l.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new l.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate((()=>this._onBufferChange.fire(this.active)))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}r.BufferNamespaceApi=d},7975:(O,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ParserApi=void 0,r.ParserApi=class{constructor(a){this._core=a}registerCsiHandler(a,l){return this._core.registerCsiHandler(a,(_=>l(_.toArray())))}addCsiHandler(a,l){return this.registerCsiHandler(a,l)}registerDcsHandler(a,l){return this._core.registerDcsHandler(a,((_,n)=>l(_,n.toArray())))}addDcsHandler(a,l){return this.registerDcsHandler(a,l)}registerEscHandler(a,l){return this._core.registerEscHandler(a,l)}addEscHandler(a,l){return this.registerEscHandler(a,l)}registerOscHandler(a,l){return this._core.registerOscHandler(a,l)}addOscHandler(a,l){return this.registerOscHandler(a,l)}}},7090:(O,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.UnicodeApi=void 0,r.UnicodeApi=class{constructor(a){this._core=a}register(a){this._core.unicodeService.register(a)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(a){this._core.unicodeService.activeVersion=a}}},744:function(O,r,a){var l=this&&this.__decorate||function(i,s,e,t){var o,f=arguments.length,u=f<3?s:t===null?t=Object.getOwnPropertyDescriptor(s,e):t;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")u=Reflect.decorate(i,s,e,t);else for(var p=i.length-1;p>=0;p--)(o=i[p])&&(u=(f<3?o(u):f>3?o(s,e,u):o(s,e))||u);return f>3&&u&&Object.defineProperty(s,e,u),u},_=this&&this.__param||function(i,s){return function(e,t){s(e,t,i)}};Object.defineProperty(r,"__esModule",{value:!0}),r.BufferService=r.MINIMUM_ROWS=r.MINIMUM_COLS=void 0;const n=a(8460),d=a(844),v=a(5295),g=a(2585);r.MINIMUM_COLS=2,r.MINIMUM_ROWS=1;let h=r.BufferService=class extends d.Disposable{get buffer(){return this.buffers.active}constructor(i){super(),this.isUserScrolling=!1,this._onResize=this.register(new n.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new n.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(i.rawOptions.cols||0,r.MINIMUM_COLS),this.rows=Math.max(i.rawOptions.rows||0,r.MINIMUM_ROWS),this.buffers=this.register(new v.BufferSet(i,this))}resize(i,s){this.cols=i,this.rows=s,this.buffers.resize(i,s),this._onResize.fire({cols:i,rows:s})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(i,s=!1){const e=this.buffer;let t;t=this._cachedBlankLine,t&&t.length===this.cols&&t.getFg(0)===i.fg&&t.getBg(0)===i.bg||(t=e.getBlankLine(i,s),this._cachedBlankLine=t),t.isWrapped=s;const o=e.ybase+e.scrollTop,f=e.ybase+e.scrollBottom;if(e.scrollTop===0){const u=e.lines.isFull;f===e.lines.length-1?u?e.lines.recycle().copyFrom(t):e.lines.push(t.clone()):e.lines.splice(f+1,0,t.clone()),u?this.isUserScrolling&&(e.ydisp=Math.max(e.ydisp-1,0)):(e.ybase++,this.isUserScrolling||e.ydisp++)}else{const u=f-o+1;e.lines.shiftElements(o+1,u-1,-1),e.lines.set(f,t.clone())}this.isUserScrolling||(e.ydisp=e.ybase),this._onScroll.fire(e.ydisp)}scrollLines(i,s,e){const t=this.buffer;if(i<0){if(t.ydisp===0)return;this.isUserScrolling=!0}else i+t.ydisp>=t.ybase&&(this.isUserScrolling=!1);const o=t.ydisp;t.ydisp=Math.max(Math.min(t.ydisp+i,t.ybase),0),o!==t.ydisp&&(s||this._onScroll.fire(t.ydisp))}};r.BufferService=h=l([_(0,g.IOptionsService)],h)},7994:(O,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CharsetService=void 0,r.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(a){this.glevel=a,this.charset=this._charsets[a]}setgCharset(a,l){this._charsets[a]=l,this.glevel===a&&(this.charset=l)}}},1753:function(O,r,a){var l=this&&this.__decorate||function(t,o,f,u){var p,c=arguments.length,m=c<3?o:u===null?u=Object.getOwnPropertyDescriptor(o,f):u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(t,o,f,u);else for(var y=t.length-1;y>=0;y--)(p=t[y])&&(m=(c<3?p(m):c>3?p(o,f,m):p(o,f))||m);return c>3&&m&&Object.defineProperty(o,f,m),m},_=this&&this.__param||function(t,o){return function(f,u){o(f,u,t)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CoreMouseService=void 0;const n=a(2585),d=a(8460),v=a(844),g={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:t=>t.button!==4&&t.action===1&&(t.ctrl=!1,t.alt=!1,t.shift=!1,!0)},VT200:{events:19,restrict:t=>t.action!==32},DRAG:{events:23,restrict:t=>t.action!==32||t.button!==3},ANY:{events:31,restrict:t=>!0}};function h(t,o){let f=(t.ctrl?16:0)|(t.shift?4:0)|(t.alt?8:0);return t.button===4?(f|=64,f|=t.action):(f|=3&t.button,4&t.button&&(f|=64),8&t.button&&(f|=128),t.action===32?f|=32:t.action!==0||o||(f|=3)),f}const i=String.fromCharCode,s={DEFAULT:t=>{const o=[h(t,!1)+32,t.col+32,t.row+32];return o[0]>255||o[1]>255||o[2]>255?"":`\x1B[M${i(o[0])}${i(o[1])}${i(o[2])}`},SGR:t=>{const o=t.action===0&&t.button!==4?"m":"M";return`\x1B[<${h(t,!0)};${t.col};${t.row}${o}`},SGR_PIXELS:t=>{const o=t.action===0&&t.button!==4?"m":"M";return`\x1B[<${h(t,!0)};${t.x};${t.y}${o}`}};let e=r.CoreMouseService=class extends v.Disposable{constructor(t,o){super(),this._bufferService=t,this._coreService=o,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new d.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const f of Object.keys(g))this.addProtocol(f,g[f]);for(const f of Object.keys(s))this.addEncoding(f,s[f]);this.reset()}addProtocol(t,o){this._protocols[t]=o}addEncoding(t,o){this._encodings[t]=o}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(t){if(!this._protocols[t])throw new Error(`unknown protocol "${t}"`);this._activeProtocol=t,this._onProtocolChange.fire(this._protocols[t].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(t){if(!this._encodings[t])throw new Error(`unknown encoding "${t}"`);this._activeEncoding=t}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(t){if(t.col<0||t.col>=this._bufferService.cols||t.row<0||t.row>=this._bufferService.rows||t.button===4&&t.action===32||t.button===3&&t.action!==32||t.button!==4&&(t.action===2||t.action===3)||(t.col++,t.row++,t.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,t,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(t))return!1;const o=this._encodings[this._activeEncoding](t);return o&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(o):this._coreService.triggerDataEvent(o,!0)),this._lastEvent=t,!0}explainEvents(t){return{down:!!(1&t),up:!!(2&t),drag:!!(4&t),move:!!(8&t),wheel:!!(16&t)}}_equalEvents(t,o,f){if(f){if(t.x!==o.x||t.y!==o.y)return!1}else if(t.col!==o.col||t.row!==o.row)return!1;return t.button===o.button&&t.action===o.action&&t.ctrl===o.ctrl&&t.alt===o.alt&&t.shift===o.shift}};r.CoreMouseService=e=l([_(0,n.IBufferService),_(1,n.ICoreService)],e)},6975:function(O,r,a){var l=this&&this.__decorate||function(e,t,o,f){var u,p=arguments.length,c=p<3?t:f===null?f=Object.getOwnPropertyDescriptor(t,o):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(e,t,o,f);else for(var m=e.length-1;m>=0;m--)(u=e[m])&&(c=(p<3?u(c):p>3?u(t,o,c):u(t,o))||c);return p>3&&c&&Object.defineProperty(t,o,c),c},_=this&&this.__param||function(e,t){return function(o,f){t(o,f,e)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CoreService=void 0;const n=a(1439),d=a(8460),v=a(844),g=a(2585),h=Object.freeze({insertMode:!1}),i=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let s=r.CoreService=class extends v.Disposable{constructor(e,t,o){super(),this._bufferService=e,this._logService=t,this._optionsService=o,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new d.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new d.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new d.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new d.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,n.clone)(h),this.decPrivateModes=(0,n.clone)(i)}reset(){this.modes=(0,n.clone)(h),this.decPrivateModes=(0,n.clone)(i)}triggerDataEvent(e,t=!1){if(this._optionsService.rawOptions.disableStdin)return;const o=this._bufferService.buffer;t&&this._optionsService.rawOptions.scrollOnUserInput&&o.ybase!==o.ydisp&&this._onRequestScrollToBottom.fire(),t&&this._onUserInput.fire(),this._logService.debug(`sending data "${e}"`,(()=>e.split("").map((f=>f.charCodeAt(0))))),this._onData.fire(e)}triggerBinaryEvent(e){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${e}"`,(()=>e.split("").map((t=>t.charCodeAt(0))))),this._onBinary.fire(e))}};r.CoreService=s=l([_(0,g.IBufferService),_(1,g.ILogService),_(2,g.IOptionsService)],s)},9074:(O,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.DecorationService=void 0;const l=a(8055),_=a(8460),n=a(844),d=a(6106);let v=0,g=0;class h extends n.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new d.SortedList((e=>e==null?void 0:e.marker.line)),this._onDecorationRegistered=this.register(new _.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new _.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,n.toDisposable)((()=>this.reset())))}registerDecoration(e){if(e.marker.isDisposed)return;const t=new i(e);if(t){const o=t.marker.onDispose((()=>t.dispose()));t.onDispose((()=>{t&&(this._decorations.delete(t)&&this._onDecorationRemoved.fire(t),o.dispose())})),this._decorations.insert(t),this._onDecorationRegistered.fire(t)}return t}reset(){for(const e of this._decorations.values())e.dispose();this._decorations.clear()}*getDecorationsAtCell(e,t,o){let f=0,u=0;for(const p of this._decorations.getKeyIterator(t))f=p.options.x??0,u=f+(p.options.width??1),e>=f&&e<u&&(!o||(p.options.layer??"bottom")===o)&&(yield p)}forEachDecorationAtCell(e,t,o,f){this._decorations.forEachByKey(t,(u=>{v=u.options.x??0,g=v+(u.options.width??1),e>=v&&e<g&&(!o||(u.options.layer??"bottom")===o)&&f(u)}))}}r.DecorationService=h;class i extends n.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=l.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=l.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(e){super(),this.options=e,this.onRenderEmitter=this.register(new _.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new _.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=e.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(O,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.InstantiationService=r.ServiceCollection=void 0;const l=a(2585),_=a(8343);class n{constructor(...v){this._entries=new Map;for(const[g,h]of v)this.set(g,h)}set(v,g){const h=this._entries.get(v);return this._entries.set(v,g),h}forEach(v){for(const[g,h]of this._entries.entries())v(g,h)}has(v){return this._entries.has(v)}get(v){return this._entries.get(v)}}r.ServiceCollection=n,r.InstantiationService=class{constructor(){this._services=new n,this._services.set(l.IInstantiationService,this)}setService(d,v){this._services.set(d,v)}getService(d){return this._services.get(d)}createInstance(d,...v){const g=(0,_.getServiceDependencies)(d).sort(((s,e)=>s.index-e.index)),h=[];for(const s of g){const e=this._services.get(s.id);if(!e)throw new Error(`[createInstance] ${d.name} depends on UNKNOWN service ${s.id}.`);h.push(e)}const i=g.length>0?g[0].index:v.length;if(v.length!==i)throw new Error(`[createInstance] First service dependency of ${d.name} at position ${i+1} conflicts with ${v.length} static arguments`);return new d(...v,...h)}}},7866:function(O,r,a){var l=this&&this.__decorate||function(i,s,e,t){var o,f=arguments.length,u=f<3?s:t===null?t=Object.getOwnPropertyDescriptor(s,e):t;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")u=Reflect.decorate(i,s,e,t);else for(var p=i.length-1;p>=0;p--)(o=i[p])&&(u=(f<3?o(u):f>3?o(s,e,u):o(s,e))||u);return f>3&&u&&Object.defineProperty(s,e,u),u},_=this&&this.__param||function(i,s){return function(e,t){s(e,t,i)}};Object.defineProperty(r,"__esModule",{value:!0}),r.traceCall=r.setTraceLogger=r.LogService=void 0;const n=a(844),d=a(2585),v={trace:d.LogLevelEnum.TRACE,debug:d.LogLevelEnum.DEBUG,info:d.LogLevelEnum.INFO,warn:d.LogLevelEnum.WARN,error:d.LogLevelEnum.ERROR,off:d.LogLevelEnum.OFF};let g,h=r.LogService=class extends n.Disposable{get logLevel(){return this._logLevel}constructor(i){super(),this._optionsService=i,this._logLevel=d.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),g=this}_updateLogLevel(){this._logLevel=v[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(i){for(let s=0;s<i.length;s++)typeof i[s]=="function"&&(i[s]=i[s]())}_log(i,s,e){this._evalLazyOptionalParams(e),i.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+s,...e)}trace(i,...s){var e;this._logLevel<=d.LogLevelEnum.TRACE&&this._log(((e=this._optionsService.options.logger)==null?void 0:e.trace.bind(this._optionsService.options.logger))??console.log,i,s)}debug(i,...s){var e;this._logLevel<=d.LogLevelEnum.DEBUG&&this._log(((e=this._optionsService.options.logger)==null?void 0:e.debug.bind(this._optionsService.options.logger))??console.log,i,s)}info(i,...s){var e;this._logLevel<=d.LogLevelEnum.INFO&&this._log(((e=this._optionsService.options.logger)==null?void 0:e.info.bind(this._optionsService.options.logger))??console.info,i,s)}warn(i,...s){var e;this._logLevel<=d.LogLevelEnum.WARN&&this._log(((e=this._optionsService.options.logger)==null?void 0:e.warn.bind(this._optionsService.options.logger))??console.warn,i,s)}error(i,...s){var e;this._logLevel<=d.LogLevelEnum.ERROR&&this._log(((e=this._optionsService.options.logger)==null?void 0:e.error.bind(this._optionsService.options.logger))??console.error,i,s)}};r.LogService=h=l([_(0,d.IOptionsService)],h),r.setTraceLogger=function(i){g=i},r.traceCall=function(i,s,e){if(typeof e.value!="function")throw new Error("not supported");const t=e.value;e.value=function(...o){if(g.logLevel!==d.LogLevelEnum.TRACE)return t.apply(this,o);g.trace(`GlyphRenderer#${t.name}(${o.map((u=>JSON.stringify(u))).join(", ")})`);const f=t.apply(this,o);return g.trace(`GlyphRenderer#${t.name} return`,f),f}}},7302:(O,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.OptionsService=r.DEFAULT_OPTIONS=void 0;const l=a(8460),_=a(844),n=a(6114);r.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:n.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const d=["normal","bold","100","200","300","400","500","600","700","800","900"];class v extends _.Disposable{constructor(h){super(),this._onOptionChange=this.register(new l.EventEmitter),this.onOptionChange=this._onOptionChange.event;const i={...r.DEFAULT_OPTIONS};for(const s in h)if(s in i)try{const e=h[s];i[s]=this._sanitizeAndValidateOption(s,e)}catch(e){console.error(e)}this.rawOptions=i,this.options={...i},this._setupOptions(),this.register((0,_.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(h,i){return this.onOptionChange((s=>{s===h&&i(this.rawOptions[h])}))}onMultipleOptionChange(h,i){return this.onOptionChange((s=>{h.indexOf(s)!==-1&&i()}))}_setupOptions(){const h=s=>{if(!(s in r.DEFAULT_OPTIONS))throw new Error(`No option with key "${s}"`);return this.rawOptions[s]},i=(s,e)=>{if(!(s in r.DEFAULT_OPTIONS))throw new Error(`No option with key "${s}"`);e=this._sanitizeAndValidateOption(s,e),this.rawOptions[s]!==e&&(this.rawOptions[s]=e,this._onOptionChange.fire(s))};for(const s in this.rawOptions){const e={get:h.bind(this,s),set:i.bind(this,s)};Object.defineProperty(this.options,s,e)}}_sanitizeAndValidateOption(h,i){switch(h){case"cursorStyle":if(i||(i=r.DEFAULT_OPTIONS[h]),!(function(s){return s==="block"||s==="underline"||s==="bar"})(i))throw new Error(`"${i}" is not a valid value for ${h}`);break;case"wordSeparator":i||(i=r.DEFAULT_OPTIONS[h]);break;case"fontWeight":case"fontWeightBold":if(typeof i=="number"&&1<=i&&i<=1e3)break;i=d.includes(i)?i:r.DEFAULT_OPTIONS[h];break;case"cursorWidth":i=Math.floor(i);case"lineHeight":case"tabStopWidth":if(i<1)throw new Error(`${h} cannot be less than 1, value: ${i}`);break;case"minimumContrastRatio":i=Math.max(1,Math.min(21,Math.round(10*i)/10));break;case"scrollback":if((i=Math.min(i,4294967295))<0)throw new Error(`${h} cannot be less than 0, value: ${i}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(i<=0)throw new Error(`${h} cannot be less than or equal to 0, value: ${i}`);break;case"rows":case"cols":if(!i&&i!==0)throw new Error(`${h} must be numeric, value: ${i}`);break;case"windowsPty":i=i??{}}return i}}r.OptionsService=v},2660:function(O,r,a){var l=this&&this.__decorate||function(v,g,h,i){var s,e=arguments.length,t=e<3?g:i===null?i=Object.getOwnPropertyDescriptor(g,h):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")t=Reflect.decorate(v,g,h,i);else for(var o=v.length-1;o>=0;o--)(s=v[o])&&(t=(e<3?s(t):e>3?s(g,h,t):s(g,h))||t);return e>3&&t&&Object.defineProperty(g,h,t),t},_=this&&this.__param||function(v,g){return function(h,i){g(h,i,v)}};Object.defineProperty(r,"__esModule",{value:!0}),r.OscLinkService=void 0;const n=a(2585);let d=r.OscLinkService=class{constructor(v){this._bufferService=v,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(v){const g=this._bufferService.buffer;if(v.id===void 0){const o=g.addMarker(g.ybase+g.y),f={data:v,id:this._nextId++,lines:[o]};return o.onDispose((()=>this._removeMarkerFromLink(f,o))),this._dataByLinkId.set(f.id,f),f.id}const h=v,i=this._getEntryIdKey(h),s=this._entriesWithId.get(i);if(s)return this.addLineToLink(s.id,g.ybase+g.y),s.id;const e=g.addMarker(g.ybase+g.y),t={id:this._nextId++,key:this._getEntryIdKey(h),data:h,lines:[e]};return e.onDispose((()=>this._removeMarkerFromLink(t,e))),this._entriesWithId.set(t.key,t),this._dataByLinkId.set(t.id,t),t.id}addLineToLink(v,g){const h=this._dataByLinkId.get(v);if(h&&h.lines.every((i=>i.line!==g))){const i=this._bufferService.buffer.addMarker(g);h.lines.push(i),i.onDispose((()=>this._removeMarkerFromLink(h,i)))}}getLinkData(v){var g;return(g=this._dataByLinkId.get(v))==null?void 0:g.data}_getEntryIdKey(v){return`${v.id};;${v.uri}`}_removeMarkerFromLink(v,g){const h=v.lines.indexOf(g);h!==-1&&(v.lines.splice(h,1),v.lines.length===0&&(v.data.id!==void 0&&this._entriesWithId.delete(v.key),this._dataByLinkId.delete(v.id)))}};r.OscLinkService=d=l([_(0,n.IBufferService)],d)},8343:(O,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.createDecorator=r.getServiceDependencies=r.serviceRegistry=void 0;const a="di$target",l="di$dependencies";r.serviceRegistry=new Map,r.getServiceDependencies=function(_){return _[l]||[]},r.createDecorator=function(_){if(r.serviceRegistry.has(_))return r.serviceRegistry.get(_);const n=function(d,v,g){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(h,i,s){i[a]===i?i[l].push({id:h,index:s}):(i[l]=[{id:h,index:s}],i[a]=i)})(n,d,g)};return n.toString=()=>_,r.serviceRegistry.set(_,n),n}},2585:(O,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.IDecorationService=r.IUnicodeService=r.IOscLinkService=r.IOptionsService=r.ILogService=r.LogLevelEnum=r.IInstantiationService=r.ICharsetService=r.ICoreService=r.ICoreMouseService=r.IBufferService=void 0;const l=a(8343);var _;r.IBufferService=(0,l.createDecorator)("BufferService"),r.ICoreMouseService=(0,l.createDecorator)("CoreMouseService"),r.ICoreService=(0,l.createDecorator)("CoreService"),r.ICharsetService=(0,l.createDecorator)("CharsetService"),r.IInstantiationService=(0,l.createDecorator)("InstantiationService"),(function(n){n[n.TRACE=0]="TRACE",n[n.DEBUG=1]="DEBUG",n[n.INFO=2]="INFO",n[n.WARN=3]="WARN",n[n.ERROR=4]="ERROR",n[n.OFF=5]="OFF"})(_||(r.LogLevelEnum=_={})),r.ILogService=(0,l.createDecorator)("LogService"),r.IOptionsService=(0,l.createDecorator)("OptionsService"),r.IOscLinkService=(0,l.createDecorator)("OscLinkService"),r.IUnicodeService=(0,l.createDecorator)("UnicodeService"),r.IDecorationService=(0,l.createDecorator)("DecorationService")},1480:(O,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.UnicodeService=void 0;const l=a(8460),_=a(225);class n{static extractShouldJoin(v){return(1&v)!=0}static extractWidth(v){return v>>1&3}static extractCharKind(v){return v>>3}static createPropertyValue(v,g,h=!1){return(16777215&v)<<3|(3&g)<<1|(h?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new l.EventEmitter,this.onChange=this._onChange.event;const v=new _.UnicodeV6;this.register(v),this._active=v.version,this._activeProvider=v}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(v){if(!this._providers[v])throw new Error(`unknown Unicode version "${v}"`);this._active=v,this._activeProvider=this._providers[v],this._onChange.fire(v)}register(v){this._providers[v.version]=v}wcwidth(v){return this._activeProvider.wcwidth(v)}getStringCellWidth(v){let g=0,h=0;const i=v.length;for(let s=0;s<i;++s){let e=v.charCodeAt(s);if(55296<=e&&e<=56319){if(++s>=i)return g+this.wcwidth(e);const f=v.charCodeAt(s);56320<=f&&f<=57343?e=1024*(e-55296)+f-56320+65536:g+=this.wcwidth(f)}const t=this.charProperties(e,h);let o=n.extractWidth(t);n.extractShouldJoin(t)&&(o-=n.extractWidth(h)),g+=o,h=t}return g}charProperties(v,g){return this._activeProvider.charProperties(v,g)}}r.UnicodeService=n}},Y={};function G(O){var r=Y[O];if(r!==void 0)return r.exports;var a=Y[O]={exports:{}};return ie[O].call(a.exports,a,a.exports,G),a.exports}var Q={};return(()=>{var O=Q;Object.defineProperty(O,"__esModule",{value:!0}),O.Terminal=void 0;const r=G(9042),a=G(3236),l=G(844),_=G(5741),n=G(8285),d=G(7975),v=G(7090),g=["cols","rows"];class h extends l.Disposable{constructor(s){super(),this._core=this.register(new a.Terminal(s)),this._addonManager=this.register(new _.AddonManager),this._publicOptions={...this._core.options};const e=o=>this._core.options[o],t=(o,f)=>{this._checkReadonlyOptions(o),this._core.options[o]=f};for(const o in this._core.options){const f={get:e.bind(this,o),set:t.bind(this,o)};Object.defineProperty(this._publicOptions,o,f)}}_checkReadonlyOptions(s){if(g.includes(s))throw new Error(`Option "${s}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new d.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new v.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new n.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const s=this._core.coreService.decPrivateModes;let e="none";switch(this._core.coreMouseService.activeProtocol){case"X10":e="x10";break;case"VT200":e="vt200";break;case"DRAG":e="drag";break;case"ANY":e="any"}return{applicationCursorKeysMode:s.applicationCursorKeys,applicationKeypadMode:s.applicationKeypad,bracketedPasteMode:s.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:e,originMode:s.origin,reverseWraparoundMode:s.reverseWraparound,sendFocusMode:s.sendFocus,wraparoundMode:s.wraparound}}get options(){return this._publicOptions}set options(s){for(const e in s)this._publicOptions[e]=s[e]}blur(){this._core.blur()}focus(){this._core.focus()}input(s,e=!0){this._core.input(s,e)}resize(s,e){this._verifyIntegers(s,e),this._core.resize(s,e)}open(s){this._core.open(s)}attachCustomKeyEventHandler(s){this._core.attachCustomKeyEventHandler(s)}attachCustomWheelEventHandler(s){this._core.attachCustomWheelEventHandler(s)}registerLinkProvider(s){return this._core.registerLinkProvider(s)}registerCharacterJoiner(s){return this._checkProposedApi(),this._core.registerCharacterJoiner(s)}deregisterCharacterJoiner(s){this._checkProposedApi(),this._core.deregisterCharacterJoiner(s)}registerMarker(s=0){return this._verifyIntegers(s),this._core.registerMarker(s)}registerDecoration(s){return this._checkProposedApi(),this._verifyPositiveIntegers(s.x??0,s.width??0,s.height??0),this._core.registerDecoration(s)}hasSelection(){return this._core.hasSelection()}select(s,e,t){this._verifyIntegers(s,e,t),this._core.select(s,e,t)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(s,e){this._verifyIntegers(s,e),this._core.selectLines(s,e)}dispose(){super.dispose()}scrollLines(s){this._verifyIntegers(s),this._core.scrollLines(s)}scrollPages(s){this._verifyIntegers(s),this._core.scrollPages(s)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(s){this._verifyIntegers(s),this._core.scrollToLine(s)}clear(){this._core.clear()}write(s,e){this._core.write(s,e)}writeln(s,e){this._core.write(s),this._core.write(`\r
`,e)}paste(s){this._core.paste(s)}refresh(s,e){this._verifyIntegers(s,e),this._core.refresh(s,e)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(s){this._addonManager.loadAddon(this,s)}static get strings(){return r}_verifyIntegers(...s){for(const e of s)if(e===1/0||isNaN(e)||e%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...s){for(const e of s)if(e&&(e===1/0||isNaN(e)||e%1!=0||e<0))throw new Error("This API only accepts positive integers")}}O.Terminal=h})(),Q})()))})(fe)),fe.exports}var we=be(),ve={exports:{}},ge;function ye(){return ge||(ge=1,(function(ce,Se){(function(ie,Y){ce.exports=Y()})(self,(()=>(()=>{var ie={};return(()=>{var Y=ie;Object.defineProperty(Y,"__esModule",{value:!0}),Y.FitAddon=void 0,Y.FitAddon=class{activate(G){this._terminal=G}dispose(){}fit(){const G=this.proposeDimensions();if(!G||!this._terminal||isNaN(G.cols)||isNaN(G.rows))return;const Q=this._terminal._core;this._terminal.rows===G.rows&&this._terminal.cols===G.cols||(Q._renderService.clear(),this._terminal.resize(G.cols,G.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const G=this._terminal._core,Q=G._renderService.dimensions;if(Q.css.cell.width===0||Q.css.cell.height===0)return;const O=this._terminal.options.scrollback===0?0:G.viewport.scrollBarWidth,r=window.getComputedStyle(this._terminal.element.parentElement),a=parseInt(r.getPropertyValue("height")),l=Math.max(0,parseInt(r.getPropertyValue("width"))),_=window.getComputedStyle(this._terminal.element),n=a-(parseInt(_.getPropertyValue("padding-top"))+parseInt(_.getPropertyValue("padding-bottom"))),d=l-(parseInt(_.getPropertyValue("padding-right"))+parseInt(_.getPropertyValue("padding-left")))-O;return{cols:Math.max(2,Math.floor(d/Q.css.cell.width)),rows:Math.max(1,Math.floor(n/Q.css.cell.height))}}}})(),ie})()))})(ve)),ve.exports}var Ee=ye();const ke={Terminal:we.Terminal,FitAddon:Ee.FitAddon};export{ke as default};
.CodeMirror{font-family:monospace;height:300px;color:#000;direction:ltr}.CodeMirror-lines{padding:4px 0}.CodeMirror pre.CodeMirror-line,.CodeMirror pre.CodeMirror-line-like{padding:0 4px}.CodeMirror-scrollbar-filler,.CodeMirror-gutter-filler{background-color:#fff}.CodeMirror-gutters{border-right:1px solid #ddd;background-color:#f7f7f7;white-space:nowrap}.CodeMirror-linenumber{padding:0 3px 0 5px;min-width:20px;text-align:right;color:#999;white-space:nowrap}.CodeMirror-guttermarker{color:#000}.CodeMirror-guttermarker-subtle{color:#999}.CodeMirror-cursor{border-left:1px solid black;border-right:none;width:0}.CodeMirror div.CodeMirror-secondarycursor{border-left:1px solid silver}.cm-fat-cursor .CodeMirror-cursor{width:auto;border:0!important;background:#7e7}.cm-fat-cursor div.CodeMirror-cursors{z-index:1}.cm-fat-cursor .CodeMirror-line::selection,.cm-fat-cursor .CodeMirror-line>span::selection,.cm-fat-cursor .CodeMirror-line>span>span::selection{background:transparent}.cm-fat-cursor .CodeMirror-line::-moz-selection,.cm-fat-cursor .CodeMirror-line>span::-moz-selection,.cm-fat-cursor .CodeMirror-line>span>span::-moz-selection{background:transparent}.cm-fat-cursor{caret-color:transparent}@-moz-keyframes blink{50%{background-color:transparent}}@-webkit-keyframes blink{50%{background-color:transparent}}@keyframes blink{50%{background-color:transparent}}.cm-tab{display:inline-block;text-decoration:inherit}.CodeMirror-rulers{position:absolute;left:0;right:0;top:-50px;bottom:0;overflow:hidden}.CodeMirror-ruler{border-left:1px solid #ccc;top:0;bottom:0;position:absolute}.cm-s-default .cm-header{color:#00f}.cm-s-default .cm-quote{color:#090}.cm-negative{color:#d44}.cm-positive{color:#292}.cm-header,.cm-strong{font-weight:700}.cm-em{font-style:italic}.cm-link{text-decoration:underline}.cm-strikethrough{text-decoration:line-through}.cm-s-default .cm-keyword{color:#708}.cm-s-default .cm-atom{color:#219}.cm-s-default .cm-number{color:#164}.cm-s-default .cm-def{color:#00f}.cm-s-default .cm-variable-2{color:#05a}.cm-s-default .cm-variable-3,.cm-s-default .cm-type{color:#085}.cm-s-default .cm-comment{color:#a50}.cm-s-default .cm-string{color:#a11}.cm-s-default .cm-string-2{color:#f50}.cm-s-default .cm-meta,.cm-s-default .cm-qualifier{color:#555}.cm-s-default .cm-builtin{color:#30a}.cm-s-default .cm-bracket{color:#997}.cm-s-default .cm-tag{color:#170}.cm-s-default .cm-attribute{color:#00c}.cm-s-default .cm-hr{color:#999}.cm-s-default .cm-link{color:#00c}.cm-s-default .cm-error,.cm-invalidchar{color:red}.CodeMirror-composing{border-bottom:2px solid}div.CodeMirror span.CodeMirror-matchingbracket{color:#0b0}div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#a22}.CodeMirror-matchingtag{background:#ff96004d}.CodeMirror-activeline-background{background:#e8f2ff}.CodeMirror{position:relative;overflow:hidden;background:#fff}.CodeMirror-scroll{overflow:scroll!important;margin-bottom:-50px;margin-right:-50px;padding-bottom:50px;height:100%;outline:none;position:relative;z-index:0}.CodeMirror-sizer{position:relative;border-right:50px solid transparent}.CodeMirror-vscrollbar,.CodeMirror-hscrollbar,.CodeMirror-scrollbar-filler,.CodeMirror-gutter-filler{position:absolute;z-index:6;display:none;outline:none}.CodeMirror-vscrollbar{right:0;top:0;overflow-x:hidden;overflow-y:scroll}.CodeMirror-hscrollbar{bottom:0;left:0;overflow-y:hidden;overflow-x:scroll}.CodeMirror-scrollbar-filler{right:0;bottom:0}.CodeMirror-gutter-filler{left:0;bottom:0}.CodeMirror-gutters{position:absolute;left:0;top:0;min-height:100%;z-index:3}.CodeMirror-gutter{white-space:normal;height:100%;display:inline-block;vertical-align:top;margin-bottom:-50px}.CodeMirror-gutter-wrapper{position:absolute;z-index:4;background:none!important;border:none!important}.CodeMirror-gutter-background{position:absolute;top:0;bottom:0;z-index:4}.CodeMirror-gutter-elt{position:absolute;cursor:default;z-index:4}.CodeMirror-gutter-wrapper ::selection{background-color:transparent}.CodeMirror-gutter-wrapper ::-moz-selection{background-color:transparent}.CodeMirror-lines{cursor:text;min-height:1px}.CodeMirror pre.CodeMirror-line,.CodeMirror pre.CodeMirror-line-like{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;border-width:0;background:transparent;font-family:inherit;font-size:inherit;margin:0;white-space:pre;word-wrap:normal;line-height:inherit;color:inherit;z-index:2;position:relative;overflow:visible;-webkit-tap-highlight-color:transparent;-webkit-font-variant-ligatures:contextual;font-variant-ligatures:contextual}.CodeMirror-wrap pre.CodeMirror-line,.CodeMirror-wrap pre.CodeMirror-line-like{word-wrap:break-word;white-space:pre-wrap;word-break:normal}.CodeMirror-linebackground{position:absolute;left:0;right:0;top:0;bottom:0;z-index:0}.CodeMirror-linewidget{position:relative;z-index:2;padding:.1px}.CodeMirror-rtl pre{direction:rtl}.CodeMirror-code{outline:none}.CodeMirror-scroll,.CodeMirror-sizer,.CodeMirror-gutter,.CodeMirror-gutters,.CodeMirror-linenumber{-moz-box-sizing:content-box;box-sizing:content-box}.CodeMirror-measure{position:absolute;width:100%;height:0;overflow:hidden;visibility:hidden}.CodeMirror-cursor{position:absolute;pointer-events:none}.CodeMirror-measure pre{position:static}div.CodeMirror-cursors{visibility:hidden;position:relative;z-index:3}div.CodeMirror-dragcursors,.CodeMirror-focused div.CodeMirror-cursors{visibility:visible}.CodeMirror-selected{background:#d9d9d9}.CodeMirror-focused .CodeMirror-selected{background:#d7d4f0}.CodeMirror-crosshair{cursor:crosshair}.CodeMirror-line::selection,.CodeMirror-line>span::selection,.CodeMirror-line>span>span::selection{background:#d7d4f0}.CodeMirror-line::-moz-selection,.CodeMirror-line>span::-moz-selection,.CodeMirror-line>span>span::-moz-selection{background:#d7d4f0}.cm-searching{background-color:#ffa;background-color:#ff06}.cm-force-border{padding-right:.1px}@media print{.CodeMirror div.CodeMirror-cursors{visibility:hidden}}.cm-tab-wrap-hack:after{content:""}span.CodeMirror-selectedtext{background:none}.CodeMirror-dialog{position:absolute;left:0;right:0;background:inherit;z-index:15;padding:.1em .8em;overflow:hidden;color:inherit}.CodeMirror-dialog-top{border-bottom:1px solid #eee;top:0}.CodeMirror-dialog-bottom{border-top:1px solid #eee;bottom:0}.CodeMirror-dialog input{border:none;outline:none;background:transparent;width:20em;color:inherit;font-family:monospace}.CodeMirror-dialog button{font-size:70%}
     €  0GSUB ‹%z  8   TOS/27OKG  Œ   `cmapC›?{  	$  Þglyfòm(y  '¤  ÷headX— S   à   6hhea[ù   ¼   $hmtxAÿú  ì  8loca‹ÇV  $  žmaxpï�      name“÷¹K ¸  øpostcFÂ  °  $   ,    ,ÿÿÿþ.               Î      Tûùq_<õ ,    |%°€    |%°€ÿÿÿý.-             Îu         
 
   ÿ          
 0 > DFLT latn                      liga                     +�    Ë Ò   * Ë Ò   �  M                         PfEd Àê`ñ,   G                     ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,ÿÿ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,ÿÿ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,ÿÿ,  ,  ,  ,  ,  ,  ,  ,ÿÿ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,ÿÿ,  ,  ,  ,ÿÿ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,           ,     &           ,  
  & ô      êˆêŒêÇêÉë	ëNì4ñÿÿ  ê`êŠê�êÉêÌëëPñÿÿ                   b f Ö ÖPÖž    ñJG ´7•%nt NÃ`ji ‘ 60 † Ï þ A“ y ¾ › ˆC¨ É ¦ ¼ € ‹‘yˆ†z‰�‹„ ¾�    
            \ ] ^ _ b c " # $ % & ) + , - . / 0 2 3 4 5 < 9 = > ? @ B C F H I K U V W X g i k n r t u v w x z { | } ~  � ‚ „ … ‡ ‰ Œ � � “ ” • – — ˜ ™ š œ ž Ÿ   ¡ ¢ £ ¥ ¨ © ª ” « ¬ ® ¸ ¹ ½ À Ä Å È Ê Ë Ì Í Ó Ô Õ Ö × Ø Ù Ú ï ò ó ö ù ú û ü  (,-./123456;<=>?@ABDFHIKLNOPQRYZ[\]_defhkmqrsuv{|}~�‚ƒ…‡ŠŒŽ—˜¡¢¤¦§©ª«¬­±³´µ¸¹º¼½ÄÅÆÇÈÌÍ ô õ ÷ ø ` a p : q d� o s m [ ' (	 � ’ Æ²   e îU’* ºcb"w+9 Z» D
 Ž Á ÿ: *)! 7 8 J”¶°®¯ °SV lÉËÊš›œ�žŸ™  S$ �Â j Ñ Ý Ü Û Q P O  Ò ¯ ± Y hX ¤ f  Â Ã'   ! ý · í Þ ß ä â ã æ ç é ë ì á à– Î8 Š    	 ê å è  Ç ;   M ² ³^ Lap Ð£¥ Gl §¿ 1&E R ðMo ƒ €xg · µ ¶ÁÀ EWT T » ¿#  ­                                                                                                                                                                                                                                                                         ¸      Î  ê`  ê`     êa  êa   ñ  êb  êb  J  êc  êc  G  êd  êd   ´  êe  êe  7  êf  êf  •  êg  êg  %  êh  êh  n  êi  êi    êj  êj  t  êk  êk   N  êl  êl  Ã  êm  êm  `  ên  ên  j  êo  êo  i  êp  êp   ‘  êq  êq   6  êr  êr  0  ês  ês   †  êt  êt   Ï  êu  êu   þ  êv  êv   A  êw  êw  “  êx  êx   y  êy  êy     êz  êz  ¾  ê{  ê{   ›  ê|  ê|   ˆ  ê}  ê}  C  ê~  ê~    ê  ê    ê€  ê€    ê�  ê�  ¨  ê‚  ê‚   É  êƒ  êƒ   ¦  ê„  ê„   ¼  ê…  ê…     ê†  ê†  €  ê‡  ê‡   ‹  êˆ  êˆ  ‘  êŠ  êŠ  y  ê‹  ê‹  ˆ  êŒ  êŒ  †  ê�  ê�  z  ê�  ê�  ‰  ê‘  ê‘  �  ê’  ê’  ‹  ê“  ê“  „  ê”  ê”   ¾  ê•  ê•    ê–  ê–  �  ê—  ê—     ê˜  ê˜     ê™  ê™     êš  êš   
  ê›  ê›     êœ  êœ     ê�  ê�     êž  êž     êŸ  êŸ     ê   ê      ê¡  ê¡     ê¢  ê¢     ê£  ê£     ê¤  ê¤     ê¥  ê¥     ê¦  ê¦   \  ê§  ê§   ]  ê¨  ê¨   ^  ê©  ê©   _  êª  êª   b  ê«  ê«   c  ê¬  ê¬   "  ê­  ê­   #  ê®  ê®   $  ê¯  ê¯   %  ê°  ê°   &  ê±  ê±   )  ê²  ê²   +  ê³  ê³   ,  ê´  ê´   -  êµ  êµ   .  ê¶  ê¶   /  ê·  ê·   0  ê¸  ê¸   2  ê¹  ê¹   3  êº  êº   4  ê»  ê»   5  ê¼  ê¼   <  ê½  ê½   9  ê¾  ê¾   =  ê¿  ê¿   >  êÀ  êÀ   ?  êÁ  êÁ   @  êÂ  êÂ   B  êÃ  êÃ   C  êÄ  êÄ   F  êÅ  êÅ   H  êÆ  êÆ   I  êÇ  êÇ   K  êÉ  êÉ   U  êÌ  êÌ   V  êÍ  êÍ   W  êÎ  êÎ   X  êÏ  êÏ   g  êÐ  êÐ   i  êÑ  êÑ   k  êÒ  êÒ   n  êÓ  êÓ   r  êÔ  êÔ   t  êÕ  êÕ   u  êÖ  êÖ   v  ê×  ê×   w  êØ  êØ   x  êÙ  êÙ   z  êÚ  êÚ   {  êÛ  êÛ   |  êÜ  êÜ   }  êÝ  êÝ   ~  êÞ  êÞ     êß  êß   �  êà  êà   ‚  êá  êá   „  êâ  êâ   …  êã  êã   ‡  êä  êä   ‰  êå  êå   Œ  êæ  êæ   �  êç  êç   �  êè  êè   “  êé  êé   ”  êê  êê   •  êë  êë   –  êì  êì   —  êí  êí   ˜  êî  êî   ™  êï  êï   š  êð  êð   œ  êñ  êñ   ž  êò  êò   Ÿ  êó  êó      êô  êô   ¡  êõ  êõ   ¢  êö  êö   £  ê÷  ê÷   ¥  êø  êø   ¨  êù  êù   ©  êú  êú   ª  êû  êû   ”  êü  êü   «  êý  êý   ¬  êþ  êþ   ®  êÿ  êÿ   ¸  ë   ë    ¹  ë  ë   ½  ë  ë   À  ë  ë   Ä  ë  ë   Å  ë  ë   È  ë  ë   Ê  ë  ë   Ë  ë  ë   Ì  ë	  ë	   Í  ë  ë   Ó  ë  ë   Ô  ë  ë   Õ  ë  ë   Ö  ë  ë   ×  ë  ë   Ø  ë  ë   Ù  ë  ë   Ú  ë  ë   ï  ë  ë   ò  ë  ë   ó  ë  ë   ö  ë  ë   ù  ë  ë   ú  ë  ë   û  ë  ë   ü  ë  ë     ë  ë    ë  ë    ë  ë    ë  ë    ë   ë     ë!  ë!    ë"  ë"    ë#  ë#    ë$  ë$    ë%  ë%    ë&  ë&    ë'  ë'    ë(  ë(    ë)  ë)    ë*  ë*     ë+  ë+  (  ë,  ë,  ,  ë-  ë-  -  ë.  ë.  .  ë/  ë/  /  ë0  ë0  1  ë1  ë1  2  ë2  ë2  3  ë3  ë3  4  ë4  ë4  5  ë5  ë5  6  ë6  ë6  ;  ë7  ë7  <  ë8  ë8  =  ë9  ë9  >  ë:  ë:  ?  ë;  ë;  @  ë<  ë<  A  ë=  ë=  B  ë>  ë>  D  ë?  ë?  F  ë@  ë@  H  ëA  ëA  I  ëB  ëB  K  ëC  ëC  L  ëD  ëD  N  ëE  ëE  O  ëF  ëF  P  ëG  ëG  Q  ëH  ëH  R  ëI  ëI  Y  ëJ  ëJ  Z  ëK  ëK  [  ëL  ëL  \  ëM  ëM  ]  ëN  ëN  _  ëP  ëP  d  ëQ  ëQ  e  ëR  ëR  f  ëS  ëS  h  ëT  ëT  k  ëU  ëU  m  ëV  ëV  q  ëW  ëW  r  ëX  ëX  s  ëY  ëY  u  ëZ  ëZ  v  ë[  ë[  {  ë\  ë\  |  ë]  ë]  }  ë^  ë^  ~  ë_  ë_  �  ë`  ë`  ‚  ëa  ëa  ƒ  ëb  ëb  …  ëc  ëc  ‡  ëd  ëd  Š  ëe  ëe  Œ  ëf  ëf  Ž  ëg  ëg  —  ëh  ëh  ˜  ëi  ëi  ¡  ëj  ëj  ¢  ëk  ëk  ¤  ël  ël  ¦  ëm  ëm  §  ën  ën  ©  ëo  ëo  ª  ëp  ëp  «  ëq  ëq  ¬  ër  ër  ­  ës  ës  ±  ët  ët  ³  ëu  ëu  ´  ëv  ëv  µ  ëw  ëw  ¸  ëx  ëx  ¹  ëy  ëy  º  ëz  ëz  ¼  ë{  ë{  ½  ë|  ë|  Ä  ë}  ë}  Å  ë~  ë~  Æ  ë  ë  Ç  ë€  ë€  È  ë�  ë�  Ì  ë‚  ë‚  Í  ëƒ  ëƒ   ô  ë„  ë„   õ  ë…  ë…   ÷  ë†  ë†   ø  ë‡  ë‡   `  ëˆ  ëˆ   a  ë‰  ë‰   p  ëŠ  ëŠ   :  ë‹  ë‹   q  ëŒ  ëŒ   d  ë�  ë�  �  ëŽ  ëŽ   o  ë�  ë�   s  ë�  ë�   m  ë‘  ë‘   [  ë’  ë’   '  ë“  ë“   (  ë”  ë”  	  ë•  ë•   �  ë–  ë–   ’  ë—  ë—   Æ  ë˜  ë˜  ²  ë™  ë™     ëš  ëš     ë›  ë›   e  ëœ  ëœ   î  ë�  ë�    ëž  ëž  U  ëŸ  ëŸ  ’  ë   ë   *  ë¡  ë¡   º  ë¢  ë¢  c  ë£  ë£  b  ë¤  ë¤  "  ë¥  ë¥  w  ë¦  ë¦  +  ë§  ë§  9  ë¨  ë¨   Z  ë©  ë©  »  ëª  ëª   D  ë«  ë«  
  ë¬  ë¬   Ž  ë­  ë­   Á  ë®  ë®   ÿ  ë¯  ë¯    ë°  ë°  :  ë±  ë±   *  ë²  ë²  )  ë³  ë³  !  ë´  ë´   7  ëµ  ëµ   8  ë¶  ë¶   J  ë·  ë·  ”  ë¸  ë¸  ¶  ë¹  ë¹  °  ëº  ëº  ®  ë»  ë»  ¯  ë¼  ë¼   °  ë½  ë½  S  ë¾  ë¾  V  ë¿  ë¿    ëÀ  ëÀ   l  ëÁ  ëÁ  É  ëÂ  ëÂ  Ë  ëÃ  ëÃ  Ê  ëÄ  ëÄ  š  ëÅ  ëÅ  ›  ëÆ  ëÆ  œ  ëÇ  ëÇ  �  ëÈ  ëÈ  ž  ëÉ  ëÉ  Ÿ  ëÊ  ëÊ  ™  ëË  ëË     ëÌ  ëÌ   S  ëÍ  ëÍ  $  ëÎ  ëÎ   �  ëÏ  ëÏ  Â  ëÐ  ëÐ   j  ëÑ  ëÑ   Ñ  ëÒ  ëÒ   Ý  ëÓ  ëÓ   Ü  ëÔ  ëÔ   Û  ëÕ  ëÕ   Q  ëÖ  ëÖ   P  ë×  ë×   O  ëØ  ëØ     ëÙ  ëÙ   Ò  ëÚ  ëÚ   ¯  ëÛ  ëÛ   ±  ëÜ  ëÜ   Y  ëÝ  ëÝ   h  ëÞ  ëÞ  X  ëß  ëß   ¤  ëà  ëà   f  ëá  ëá     ëâ  ëâ   Â  ëã  ëã   Ã  ëä  ëä  '  ëå  ëå      ëæ  ëæ   !  ëç  ëç   ý  ëè  ëè     ëé  ëé  ·  ëê  ëê    ëë  ëë   í  ëì  ëì   Þ  ëí  ëí   ß  ëî  ëî   ä  ëï  ëï   â  ëð  ëð   ã  ëñ  ëñ   æ  ëò  ëò   ç  ëó  ëó   é  ëô  ëô   ë  ëõ  ëõ   ì  ëö  ëö   á  ë÷  ë÷   à  ëø  ëø  –  ëù  ëù   Î  ëú  ëú  8  ëû  ëû   Š  ëü  ëü     ëý  ëý     ëþ  ëþ     ëÿ  ëÿ   	  ì   ì    ê  ì  ì   å  ì  ì   è  ì  ì     ì  ì   Ç  ì  ì    ì  ì    ì  ì   ;  ì  ì     ì	  ì	     ì
  ì
   M  ì  ì   ²  ì  ì   ³  ì  ì  ^  ì  ì   L  ì  ì  a  ì  ì  p  ì  ì   Ð  ì  ì    ì  ì  £  ì  ì  ¥  ì  ì   G  ì  ì  l  ì  ì   §  ì  ì  ¿  ì  ì   1  ì  ì  &  ì  ì    ì  ì    ì  ì  E  ì  ì   R  ì  ì   ð  ì   ì   M  ì!  ì!  o  ì"  ì"   ƒ  ì#  ì#   €  ì$  ì$  x  ì%  ì%  g  ì&  ì&   ·  ì'  ì'   µ  ì(  ì(   ¶  ì)  ì)  Á  ì*  ì*  À  ì+  ì+   E  ì,  ì,  W  ì-  ì-  T  ì.  ì.   T  ì/  ì/   »  ì0  ì0    ì1  ì1    ì2  ì2   ¿  ì3  ì3  #  ì4  ì4     ñ  ñ   ­       ” Ô è2l¦à.BVj~’¦ÈÞ8ŠäfÌjj˜ê¦Zš$Bª		Ô
ˆ
Î
öPbt†˜àú6b�ô*>fŽü.|¶Ð&€È&²Þbœð&J¸`8Ž¸Ä6ŠôT¶ì(8HThvš2Lš
6H‚Ìü>Zp¢Äè4´ä
Xvœ¼à6Xˆºæ0\„¼–Èâ  x º!!z!²""l"´"ú#:# #Â#ð$$$¢$À$Ü$ø%F%„%¸%æ&X&Ê'B'Ž'¸(8(^(ä)x)ô*|*Æ+
+ž+Þ,,J,ˆ-*-¤-È.b.ä/"/l/€/Æ/ê00V0|0Ú1
1l1¨1Ö22|2¬2Ê33L3p3Þ444p4 4î5¦5Ø6>6¦6ú7<7j7‚7š7¸7à88&8D8b8€8˜8¶8Î8ì999V9’9ä:~:¾:â;D;\;x<<&<F<x<Ü<ú=L=x=¦=ì>>2>J>d>�>¼>â??r?Œ?â@@d@Ž@ÊAABAvAÆAøB&B`B~BÂBêCpCªD$DnEREŠE¼F"FFF”FÔG6GŽGÊHHdHÜI0I‚I˜IÈJJFJ^J†J¦KK:KÄL"L„L¶MM2M˜MÈMîNFNbNpO*O�O´P.PªPðQ`Q˜QÐR(RVR†SSpSÌT&TNTrT–TîUU2U†UâVV\V‚V¶VðW:W˜WÊWèX$X°YY”YúZZZÐ[[B[œ\\V\Â]J^^.^L_:_l_‚_¨_ò`8`X`Š`Îa^a€aºaúbbJblb¢c8clc˜cÞd–dÀe@e|eæffHf¾fúg>g€g¼hhNh¦hÊii¬jlmºmæn
nvnžnÊnâoobo�oâp€pºpÊpÚpêpúqZqšqÚr$rjrÚssRsØttt¤töu(uduºuüvHvhvÚww`wºwÚxxDxžx¼y€yðz’{
{N{Š     ÿÿ,,  " 4 d  %4."2?>"'7>32'&4>2'.0=.'&'67676'6.".54>2,(ERE(&\&–)"

"X	‡	

	#<H<#–)E((E)!<

<b

	‹		[	


	0$<##<$0          (  %4'>7.&#>32"2>4.#""#	
%²''.''Å%
	%"'.''.'         %##5#5353qpp©pppp           #3375375#5353'#3ô		
	Î
		×áÏ¼&pp	8
Ÿ		Ÿ
8/&&©––q         Ì   7'573'7'78(88(¼(88(ƒ(89((98(       	  #  7537#'74."2>'".4>2e(&88°3>33>3,2,,2,”(lj&7733>33,,2,,        	  $  7'35#7'72.>"2>4.”(lj&7733>33,,2,,e(&88°3>33>3,2,,2,      	  #  7#375'.>2'2>4."˜(lj&7733>33,,2,,Ç(&88¯3>33>3,2,,2,       	  #  ?357'#.>24."2>e(&88°3>33>3,2,,2,˜(lj&7733>33,,2,,        	  737'5#';^^NNƒ]]NÄÄN      ó 	  77'35#7ƒ]]NÄÄNò^^MN      ñ 	  ?5'#3©^^NÃÃN(]]NN      É á 	  7#'7537É//Š//hh      Ñ Ï 	  7'573#z//iic//      Ñ Ï 	  7'7#53'¢//hhÎ//      É á 	  ?3'#5^//²//ii      	   7'573#?5'#3O<<,éé,�<<,éé,<<,,v<<,,      	  %'#735^^NM©^^NÃÃN         %  ?62"&4?64&"2?>.26m0"‚tt(‚((m�h .|oo&|&&

h           %''5'5Af:¨^V%è 5%%K�9%!Ka      "  ' 6  %'.#";26?;2>"/37#3#6/3# K
X
L	7
8X	kl9*WELEL,áá	!+	P4}áá        , 5 =  73&'#7347#75367'535#37632.627'7654&#"8^K$&		pIr*- 	O
N!
9		HNOKKŽ		‰&	 ,*YNFO!        
     %'535#3;26'753#73HpJ
¼
ˆ&$n'‚.�KKŽ
�NOGK99         * 1 :  7##76=4>367&'&326537'&526'#7264&"ô	
µ	&BB	^%S!!.!!˜)
	$)!!m„!.!!.!        *&  ' . 3 8 A  "76=4>#326537'&"&537&'77&264&"¢
	
&U	
zB	R%u‚”•3!!.!!
))$‘!LÝ
g••!.!!.!        *&  ' . 2  &'&76=4>3'&=7#"&'26'#Ï&=l	B&%{	þ÷$)		)
¬)!		þ÷        ! 4  7&=4.'&326537"&53'76=4>û&BB	c%n		
f&!$)!)
&        á ô     7532#'32654#'3264&+^? "**%+'&8¼XD" 	        " & * . 2 6  #/#337375/#53#573#3#3'3#7#33#3#gg		cc	Œ]Yz^Z–9999999¼8888888
»

»¸©›¡&988      ô    #775'#53ê¨
MMDD–	ôVVôÛKKÒ      G q }  71#";#".'1&'5&754'1&'5&'1&+532>716=&71671>;35#"'1&'5&'1&=6'5&'1.+32#">54&q

	
	”	
"!ô

z
"!      G q ~ Š  71#";#".'1&'5&754'1&'5&'1&+532>716=&71671>;35#"'1&'5&'1&=6'5&'1.+32#632.6'77'7q

	
	”	
6!"Bô

z
	!"          )  %#5'##375'3#5'#'5#553757B	^	B		ô	¨KK–K
8	Kƒ&]K	8
Ká

	–

–*	

	+8K`+		*_         " ? [ d  632516=>&'..6#+0#1.="&=46;27>&'.547&>#"&462X"3)!		
69(		(r			$#		4$:		 &'+:51@:§//&&[	
		

$#		          3#'535'35#ô		ô	áááá	á		áB––&         1 9 I  754&"#'#;726?7'567135#56/7'#5462".5475Ì - 	&(%#"$%)'
m 	Ø  %#$&''              # ' + / 3 7 ; ? C G K O  #5##5##375#535#53#33##373##33#7#33##33#7#33##3'3#–		ô	áááá¼&&%
á		á×¨^^„„^       = y ‚  7.&/&'.?>54'.#"32>?654&/&/&'"&'&'.5&>?6323276?>273#537ë
)	
 "!
	
E			

/W>^W}'		
"! 

T		
	

E	ãW^>W       D €  ?#53#52#".54>?632?>2>?6'6/&/&"#"/.4>?64/&#"¢W=]X1	
"! 

)		

	
	E		¯X]=W#

 !!		'Z	E		
	        á   $ /  7#'##73'&'##51#"&54?4#"56323265¦=7¶"$	Q((�Y>>7
&
      % ô  
    %#'777'#'7%’:4‹�RP
):4é­S
I¤mb^S
I       ú   %/77Ÿ?8—î¼YO²       
     $ +  7#'773#3##33#'37''#'7737''F––––––––––J" /"Ø%&&h!LZ!       ó Á   ?#'7–QXXoRWW        Á ô   7'57oRWW–QXX        Ï ó   7'7'½RWW–QXX        ô Ï   7'73–QXX½RWW        7 ;  335335333#3#3###5##5##5#'5#535#535#5357335#^&&&&&&%%%%%%ƒƒ%%%%%%%%%%%–ƒ       ý ý   777'7''…UUUUUUU–UUUUUUU        ô ô    735#538¼––ô¼¼©–        –   %#5Ï–      ô     735#53'353#35#8©ƒƒpƒ&©Î¨¨–„ƒ©         â â   72"'.'&46767>–




	á


	
        2".46767>–!1
		!$!			!
1!$!			!$!		         * D  &"11>71676716&'1&'1&'1&'1&'".46767>2´
S!$!			!$!1
	

®			!$!		
1!$!           2".4>7.34&'>–$<##<H<##<LŸB;$âŸB;$#<H<##<H<#ƒ%Ÿ	7!%Ÿ	7       ¼ ¼   7.462¼  –         ¼ ¼ 
   7.>2654&#"6¦
		Œ

	      á â     72>4."7"&462'–##(##E((1K#(##(#K(         4 = F O  #375#533264&"##532653264&#"#.#53462"&'2"&4632"&46ô		ô	©+
8%%&
0
©q

8

y	



	ô		ôê%8á,	
		
&©

y







       ô       777'7'''!5!!5!5#35#¼  Çþúþú––––@  ƒKB	9         " , 6  7#5335'#5#4&"##35>.5#'37'3'#5'ƒ8–
 

A	

†%$|%&¨%/		¼	å	



¬dd$$[$dd          $  7''77/73##'57;35##3¢)ƒ&„&K&ƒK„„”zƒ&„Kƒ8„        è è   77'7''–DEEDDEE‰EDDEEDD        ö / 9  73#5264&'#'.'&'";#"&'.>76>537#'à!!
				&+_((¼ /!
#"vfe((      ö 2 <  73+53264&'#'.'&';#"&'.7>>'#5'73à!!%%
//		&+((¼ /!
+Hfe((       ö  .  73+"&'.>76>3264&+'.'&'"3à!!Œ		&+ƒ
¼ /!#"s
            '  3#73#3#3#3#3#'353#5#375'^%KK&KKKKKK&KK]áááÏ¼Î^^ÏqqÏ      ô     7'573757'X1188‘228¸^Ã1289128`»	        ,  + A S ] e  3#54&/&'&=33#54&'5&'&=31#54&/&'&=732++".=5#;267364&#8

L
	
K	

pÅ(8"¼©!9!		



		



		



	p'"9888!!P8              7#3'73##'57;35##3©^^Kƒ&„&K&ƒK„„ƒƒƒ&„Kƒ8„          "2>4.52–$<##<H<##<$33#<H<##<H<#óá3>3    
    ,      # + / 3 =  375'53375'5373#'7357375'#53#53'#375'		8

.%/		8

.%8	8

8	%Ÿ		9		
%%%%n::""	8

8	8&&%
8		8
9&&/

8		/%%ƒ	q		q	8&^%""         '  ?'5#'573#5#375375'#7#53#'K		á
Î	v#		–		KB„	X/	–		TK„	B"
]

]
KK	  
      
    # ' - 1 8  #335'3#'3#3755#'#5'#7375#5#3=#7#573p%%K%%©		8%&	(
	6ƒá	
		„	%(!
B6K%%8	K%%^	          #  3&'5#3?3#'5#'5">54&ô	
á.
(6/	Î"!
€	h–
!(	
6/	©z"!         #37375#5'#53ô		/6	z(
.á
©	/6	©Ÿ(!
–     ÿý- , 2 6 C J  7#5#.'35#>735#3654."327&7//62.67''«.-.	#<H<##<$7&L$G!"."'--.$<##<H<#JL&7$$&
 ! ?-%     , , 2 6 ?  7#5#.'35#>735#3654."327&7//264&"«.-.	#<H<##<$7&L$/ /!!/ '--.$<##<H<#JL&7$$U!!/!!           # 0  7//35#.'35#>735#2>4."©&L&T$y..-.^$<##<H<##<©L&LT$$.--.z#<H<##<H<#  ÿÿ  ,   N g q {  72"&=464&"265'763"'&'&/.'&=46737&547676276?5'#"'&'#"7&26767264.uV2&#)R)#&I
$F$
!!:0*'*0q				²		‚PPb((             ?3#'7'#3'53'KeD–©8^–¼yáC‹ƒ8»ó¼Ï         ô   ( 6  7'77>54.#"&#6326".4>2>4."§/(I	
'e$''.''�80+	'.(+$$'.''.'         â      %#53#7#";26=4&3#áááááá@&&Î%^–ƒƒp      Ï –   73#^pp–      	   ( 0 : H  >.632>54.7.>64&7>/&#"&>IA;$6A:%& /%0.$‚(

T	
4	&86A;$7A:¨/*	 -/*Š)	!+.$9+       ô  $ 5  74."#26?5#'2"'.4676"'./577ô,2,5H5]*`*#((#ê¦¦

ÄŒ       ( % , 5 ? F  7."'#372677'67535#5'7'2#46.'53'357557'5‰ K82K*Ž0GGi�¥ƒ		

	
K³VD_ /dF_n         % , 5 ?  7."'#372677'67535#5'7'2#46.'53'757'#‰ K82K©lVŽƒ		

	
K«qH9_D       ), % , 5 @  7."'#372677'67535#5'7'2#46.'53757'&'57‰ K82K¸€j¢	
ƒ		


K`QCgv~         ã ã       7>.6>&'&7#3#3l($!($)J8888Ô"($!($^#*;      á â     7"2>4.#57#5–##(##KKKá#(##(#^9       æ á    7#37#'73ºV,,V,:::áKKK3333      æ á   7#'73å+V,,V–KKK        á á    73'3'K–K#F#^ƒl=      á á   7#–K–á�        ô ô    ?57'9]]]444–^^])455       ô ô   7'–^^^ô^^^        ã ã     7>.6'#3'53Ô"($"($'l($"($%KK        D L V  73+54'35#&#=&/7'773#'"&''7&'5#5357'7>2.34675#6X±\`¬	
†#-
4W 	8
J±
¬[\g#.
3;
	

		T
       	   #37755K>ƒiáÕ¼]L˜       	   3#7755/\„!]áÙ¼^B„      	 . 8  ?57'#+".=4.54>2#;265^©lVŽ

ÿqH9_D`

         7 D  7&'7'&'&7676'76767''7''726?".54?ÿ	Q	:a#	6:ä		Q:n#	:                 753'3#7#535%7'77q¨]]]]¨¨þúeeJqKK©­CDuc1         Ø ô    73#7#5T„ô¼¼¼¼     ÿý  $  7&'>.5#35#>'757'#†'#
-2#/1	,
#%(©YCŽK%2,2

¡q;-_D       ô  	   -  753767#&'#%!52>.3#'53>&'7a	‰iaþúÇ! 	%*'*%	q		8
q	
¼¼"*$+           7&'>54.5#35#>ï&:5
(23)*DEA#57#–.!
 /$;"K-         þ  	   #3''55ý\„!]áÙ¼^B„          7.4623/#3?#53¼  TP__Pa__O– Y²YJ²Y      	   %/#3?#53P__Pa__O¦Y²YJ²Y      ü     ?'77P––nôdd­“J             753>32#5."3#'"&462!04 '.)5Nu ÀK/."�         ê 
   737'5#'"&462–
I11I/yI1tt1IA       ê 
   #7357'"&462–
I11II1tt1Iá           !  %5#.#"35>2#37264.304 '.)5Nu ÀK/."�            #'57#3ô¼·²²¼¼²      +,   A I Y  75'77''7373#1'"&/'7'&'+535475'7354>2354&"5#2>54+[&('&&('t$",.+)$&$)*.,#$"kY%z›	"‹	&((&&)(�$"+)(* #$2-!!-         7526765#'573'5#337'5#'KU		ô	ák	.(//
»

­‘©	//yy/        á     %5'#37575#53'57=	©		©	=]––K99Ó#(		„		&#	kmp]
"           ) 2  73#'573?335#/##">4&2.467"264&ÉG		ô		G8“áB0AP !!.!!ô
¨

¨
¹–  !.!!.!        ô     3#'535#3#T–

–	ƒƒ/%%	ô		ôêá¼             3#'535###33535#á

á	ÎÎp8888	á		áØÏ&888             3#'535#3#5ô		ô	áá–%p&	ô		ôêá&%q&            3#'535264&"ô		ô	áq!!.!!	ô		ô	áá©!.!!.!       	    %  #'57335'##33535#5#3#7/¶8©qq©8qK%%&&%^^‹+88¨áó¨9K&&%ƒÎ+»Î8           7#5'3#'535#¼^Bá

á	ÎÎ©p	á		áØÏ          3#'535#37'#ô		ô	áá%8^^8	ô		ôêá„8KK8         	     #'57335'##33535#5#3#É8©pp©9pK%%%%%]]8¨áó¨9K&&%ƒ         ô        ?3#'735#535#73#'535#535#&	^		^	KKKKz^		^	KKKKê

¨

	q
¨

¨Ÿ&%K       ÷
   35#7>7>.5B	B0"#

ab!,,B			##ba,,!'        	    #?577'7ø›,Mšì!–!šM,›Ë8
!–!            %'#5'#337'53#53753	�	^		/	¼	óK–©	„²
T		—U		gqq]K       ©     7"&462"&462"&462K

^^–          73##5#53535335#535#53#K88888áqqqz		ôá888ýg]ƒ%
Î	        â á   !  7''7'777".4>24&"26¬$#(##(#!.!!.!o##(##!!.!!       ( 4  '.767>676'4&'&'&'7''7'7¡)&&0'&+!&&& !"&-------)7+'	"*..ô	"%*	NH
|///////         / C P T  #'73&'#/'7/5?'7?375'7'2..>>.635°4
&&--&&
'
	&,,&		&,-&&$	
#!" ^-&&
4
&&-,&		&,,&	
'
&&0
	4#!"!             7#35#'73##'57;35##3©^^&ƒ&„&K&ƒK„„ƒ&^^©ƒ&„Kƒ8„        ã    7'7'7#5'3#õ,CC,½%©-DC-8ƒ       ,,      #  73#'7355733#'75##;5#©]]]þç^^Îq^^^^^^]]]]¨p^^p^^^^         & 7 ;  67>727264/1'&""&47"632>'..3)J€hb,	
%9	#303% )J€ht,	Q.#+,/       è   (  72"&46"264&'2&'.".7>–*3#	9J9	#3»))>+#--#+   ÿÿ    ; D  753#5#37375'>4."354>;23'&'.'"&462T		
©!&""		˜#

2'	^
	#	q	±	##	



''         	    ' 1 ; @  #'57335'32654#"42"35#57##535573732654#"42"Æ>
Î		‘ˆ¼8h<-- >¶		ô	á¨9L%%2=-j-=$%2         	    !  #'5733'#35#'57'?'7Æ>
Î		‘88„¼B	J"))$))">¶		ô	K9á–	BŽ#))D))"          % ) - 6  3335/#35#7##375'#'#57+577264&"&p	B>‘		B8ƒ88g–		–	(O]/%B	)>	ô	á98	q		q
K('P.A 	         ( . 7 ? I  %/#3533355375'#53##532'#3246'4#32'536'7##53#3>‘	q	BK8Å		Î

	¼¼–

B	
M!Ù>	g^B	)998	q		q	^]89&	8#9          ! + 2  735#75733#'5#'5733#5#/#'#3?35##35#&
Sk		Î
		Sk
gDqD;qhA¼k^K		
–		/	©

.%898K]       
   ,  73#'57357##737#/#37'7'7##467‘		ô		^…wTfzzPP1)+ô
»		Î
Ìgq–9I**               *  #535#'5##5733'#375#53#5'7#53Æ>
A8B	q	‘88ƒ		ƒ
pp21!8>¶	–	BKT	K9^
ƒ		ƒyp8!12        
  # ' + / 3 7 ; ? I  3#'5#335/5###5#'5#353535'#573#5#573#5#5;5#75#35/Î

»	KK&		
	&s8	^		ô	&»vT/

/á%&QQzy         	    %/#375#533'58q©©^K88Ü8á¨¨áK99       ,      ##375375'##5337#533Ûq9—;8&–9KK–^8,8¼9—á»q»8        #5'5]K^ YhhY           #5'53575#]K^p&^á YhhY q^^Y       û - S  7'6&'&'.7567676?67676'76?'>76&'/6&'1&767«
	
	
	
	
	%;		

			
	%		
G%%		#		;

           ''37''3
pqwwpqwppwqqw           777'#77'#pqvxpqv¡qqxèppx      î     7'3777'#àJKQQ£MLSRÿJJQQÎLLRR   ÿÿ.   + 2  73&'5##3#'57337#/#37>.67''‘	vU`o		^zzPP1($!($8-' ô
Tq			Î
69B"($!($R;4           $ (  73#5##3#'57337#/#373#73#?‘	wT^g		^zzPP&%&ô
Aq	Î
695pppij       %      73?'#5'#/#733###73?3Î	2	
l^	PgUG	½ºEm&„.

ÎÅ%91^       
    %#/#375#53?3'##533^		ô	áUwzPPzô
Î		»•q9      , ô  # @ I S  732+".=4>";26=4&#"#";26=3264&+54&"&46"&>2K–##–##!!–!!z‰
ô#8""9#!8!!8!%
@          7 @ I  7'#'73?7'?5/7''7'#''7'57'77"&462264&"«

%--%
%,-%
'&--&'
4
'%--&'@&Ú--%

%+-%
%C-&'4
'%--&'4
'&-ƒ"       " & 9 L P  7#65&'&/&"&'&#"#375#535#5&57676762347676762##53ý				á
„]]8	
6^^^á			©		© –

©–           & 0 4  73#'573&'5#'5#'3#'5735462354.358KV		‘>B	q¼8A		q		3%
%^&	ô	>0	B999K
K		K
	788      á,    3#5.467264&"�&&&&	(,L*:*LL*:*{((      ÿþ  * I U  7'7'7#&=.>323'>..676754&+'5732>.‹((#		5
È
		#((#	8((h		g›{
!h((²
              #3'7537'3##3©^NM^Î]NN]¨&      - 4 ? J W  7..'27>54'&'&#">56.'5>4.>'".>.>ù!*	
		$¨

�	›	*
	_	-
%2
‚
{	    ÿþ ! - 9 J U a  7#".>75.>32.">'2>..676753>.6'77'7''i			,	È


  Ð^
_	Ÿ
ž{
C…Ø           ,  * 6 J V  7".>75.>36.#">'2>.#54&+'5732#5#53533#i
	,	È#((#8888Ð^
	_Ÿž/((		Å888        , 8 A J S \  7>54.#"32>54&'&'5.>2'".>"&462264&"'264&"5264&"T				Ð''/¾	_
^u
ƒ
Ÿ'/ˆH    ÿÿ      5  7375/#3#57#5##33533#7'7#";#"&46;'78©8%%9©ƒ%%%%]]](8		8(qK¨89¨KK%%&&K™('(         " .  %/#3&'#535#34'3533##5#">54&8pd	Up9
n'%%%%%%p"!Ü8á
â9:Bp
g%%&&&"!    ÿþ  * 6 W c  7".>75.>36.#">'2>..676754&+'5732>.6i
	,	È
	#((#
Ð^
	_Ÿž{
h((		ª	       	  ! % )  7357'#375'#"&'3#5326'3#3#ƒ2BB6		á

B!i,Î+ ' =ð""2AA;	^		^	KK\        	  !  7357'#375'#"&'3#5326ƒ2BB6		á

B!i,Î+ ' ðmm2AA;	^		^	KK         	  !  7537#'7375'#"&'3#5326ƒ2BB6		á

B!i,Î+ ' ­ll1BB[	^		^	KK            # '  73#'573'5#37'#7'#7337#'#53#5390F

á	Îh*i6++6#Bl3
6?%.q	©		Z!0©Al ^p8mH89      ! l  %"&=6&'76767654/6'&'&#"&='&'&/.'.>75&7&'&547&?66676 	))		
 	
)*	ê-
..
	

/+

   ÿÿ  -, T  "26='&'&/./&7631767&'&5471&73263267613>54.–)E(.			

	
/)E,(E) :*

'	'
)
+:)E(            73535#5##3'3#'535#qqq99BÎ

Î	¼¼8q99^
Î		ÎÅ¼     -,  j  "2>4.#"&=4&'>7654&'>4&'#"&/.+&/.#737+.>2–)E((ERE((E	  		
,
$7>7$
,,(ERE((ERE(þð#												
	,:>22>:,	    
        * 1 7 A H M S  2".4>.'65&'#36'564'#36'&'+#673&547##&'67#7>7Ÿ!8!!8B8!!8}	2,/AHC
		/,4,
&	/
7	B	%!8B8  8B8!K8
	
				
A
J1     ,  ' *  ?5'#";5#".6;7#'3#'535#73q&(8		8_2X9¨¨K8½'('K8¨Œ|–K9        0  77'2>4.#"32"&'7'7#";#"&46;'7ZGG1://''-%6(8		8(nEE"/80'.'a('(        ¼    %!!!!þúþú¼&        	    ! ) -  7'573573#75#7573#75#7375'##5(  ðÎ	&		&8	&		&8	&		&áÆ««™™……	uu}``PP      ,    %#'537#''7373ý	ÎaDK`&8	ýô¸aDKa&        ,  
      %#'5373#73#3#3#73#ý	8%%ƒ&&K&&8%%ƒ&&8	ýôÏ&8%&%&%8%       ,      & *  735#5#7573#75#7375'##5573#75#ýó%
%

%ƒ
%

%^
%

%&ôý%–

–	ƒƒ²¼		¼	©©³q		q	^^      Ï ô        73#3#3#73#3#3#^%%%%%%K%%%%%%ô&%&%&¼&%&%&        	    ! ) - 5 9 = A  3#3#'5#'573'35##'573'35##'573'35##'573'35+35#3&&	z&		&	%Œ8		8
9&&A&		&	%Œ8		8
9&&&&&&á	ôg	&		&
%	8

8
%–	&		&
9
8		8	&p        %.'."'."7>4	



		oo	Ò	


		


nn       =  %.'."'."767654'.4>76767676	



	oo	
ab
	
	Ò	
		
	oo	
aa         %  7>&'.5#35#>&'6'7'5#ý<A8	B)HJ.1KF8B>+6E99!-B	">M<!"	&,6GK          '#'5##'5'7357335'�w
8	&	8
wD&	8
%Klz		BB		zlX‚B		B‚D        ô â    , 0  735##5#3533'676764.'&'&+3537+532#3y11j.	  
¼¼qp11p001	
p.$
f        $ . ; ? C  733##'5#'5#'5735735.54625#3?3'1&'267'#373#ŸK	



	://
				
K	B–/	"5(	
	L8á	&
	9	4-6	
(a8n)&.
			3       	    7375/#7#533?3'##/#73ô	4�	4ôá/V15	K51&	T�‹Y	8„       ô Ï   7;'7'7#"&=K�00�Î%0/%        ' + /  &'.>>7>&'.7'35##5¡)7<&+ !13&>@"*-,$ó755;2	”%KK             #'57#3#'57#3'7'––––––––ô++KKK9KKKŽ++        '     ?3#5#3#''75#áá]]~3 =%ôqq– ~±3V>   	         $ * 2 8 A  764''7&''7&"62'647&7&7'"767''264&"ï#	,'!?	#-#	-'!?	#L'!?	##	M!	##	:       #  0 9  7/7>#.7'.'35>7'7'264&"c=$()%2H>,­$))$$# +=Â<$&$4	'"C=%&	"
        $  ">'6.".>'264&"�%>5HD*"- 4,=:#&')DI4=%,#á#:=,4 &g        à   7#727676?654.#73&©\&	V
&	-‡	‡	         1  7#'5#/?76?#'35737'"&'&/3ß“		PP	“€	?@	
!
}2	2}	}	##	        F �  75#"111+321135#".=4&'&'67>=4676332>716716'5471676;5#"'5&'5&'1&=6'5&'1.#32#q	
	
			M	
	
			ô

	¼	

	        ª     7>&'&7"&462'"&462Œ
	)
	V^        9 E  #"'###'5?&54>6716.3573573?327>.6Õ#/	
8	^%,	 ^%		
	 +&
		+]#	Š 	$
_		B
	      / 6 9 = @ G  %'35#5##3#326735#'3#37/#53#326735"&'3'#7#?#"&'3^^:%%©%%:·/&vƒv& /©KKK–//–K-‹Š-      ÿý-     , 3  #3757'373#"'#37&762.67''™
oo
sÖ^aam!QT"'Q!m
+!"."LJJAA?BJ77
7J	=
 ! ?-%      ,     (  #3757'373#"'#37&7264&"™
oo
sÖ^aam!QT"'Q!m
 /!!/ LJJAA?BJ77
7J	!!/!!           3#'57737#''373�
ss
ot^^aÓm
q"TQLm!QT"qLJJ9A??7JJ77yJ77J          375'#53&á¼¼ááóá           375'53&áá»ááóáá           375'53353&ááKKKááóáááá               73#'7353#73#7#3áááÏ&&9%%]%%áááá           375'5375373#&áá%p&&ááóááK–––á              375'53353353&áá%p&áá¨––––––           73#'735335áá–9áá––áá             375'533#&áááááááá©––9            73#'735335áá8–áááá––            375'53&ááááá¨––           375'53353&ááK„ááôáááá            375'#53&á„„ááóá            375'53353&ááƒKááôáááá            375'53&ááƒááóáá          375'53&ááááááÎÎ            #  375'53?3#'73573#'7358KKK9999K999¼¼Ï¼¼¼8888ƒ9999      (      #  ?3#'735?/7/73#'735^	&		&	)#F#2@A¿	&		&	ý

Î		Å¼¼ÂÀ°°

Î		Å¼¼        7  7"264&'7'373'#;#&=4&'.547>32á!!.!!	

#"

	'ƒ!.!!.!]R)

	
'	       ; X l  7676?67654.";2>5'#&'+"&=3>37267676301'&'&'&'6762"'&'&4¨

			%3

		
				x

		)P


				       õ ! +  7'#&=4&'.547>32#;265Û	
	'3)Š	
	
'.)           3#353#'5!#5'7#53UKá	ô	~czáKU		ôzc~        ô $ I  732+5326=4&+".=4>5+".=4>;#";2675.S9		9   :		:ô$L$        ô     753'3#7#5qKq––¼áK^^         ô      73#3#53#53#&¨¨––ááÎÎƒ&„K          
   3 k  73#573#3##3'?64'&'&"354?2335#2"./&'133?/+573?'4&#547>2+3»»»»»»»Ó% 9*88R:	         ô     753'!!7#5©©þúÎÎK^^       ô       73#3#53#'3#;#K©©ƒƒ¼¼8ÎÎ8ƒ&„K©      ô          7#3#33##373##33##3&%ÎÎÎÎÎÎÎÎÎÎÎô%&&¼%&&      #   ' 3 ?  7'5#"'&7>37'#&676763>.6>&'&¬dd(0GF$.	B+			PL	#, A#68!
J		$,;        %."#>2060%8@8%©++ 33         â   ' 3  7.#1"376'4&';'&5>&>&'>.6Ë
";
;A 	00	 "	&		ú
"*ww!aa!(		      ô     ?3#'735'54&"354628–––!.! –^^^^%!!%%%             7#54."#375'4>##53ô#(#¼©!.!p–¼¼©%""%pp8 !%ƒp          0  "3754623754.#53#53'54&"#54>2–$<#89#<\88©999 .!84<4#<$^^^^$<#á888 44          #375'#'#53?›
~	ô	ƒj Ùá¨K•		•8?…r        ô     ?3#'735#7#	ô		ô	ákd¼^ê

¨

•ŒŒR\I         ô     7755'57&AK8KBÅ�)�°�#�#�)�      ô     3##'3#3g�)�°�#�#�)�BK8KA         ü      73#3#?'#3?53#lw#ww#wd,�/,,�/�w#wý88BFK	FGK	8       ü      77535'5?37#775/88AGK	GFK	8Àw#ww#wd,�/,,�/�w#w       Ï    73#7#'#5375##7w'!!(œ%$76Îzccc/-z++BB66       î     ?'.7/567'5&çr&@X××­@
¡


$=	,9Š=       î õ 8 B  7'.74>32#"5#"&4>367332654&#"77'32676#"Ä!&$
	%%	L	D '#'		"
<
 )
8$        , á     %!5!!5!5!5!,þÔ,þÔ,þÔ,Î©8        ë þ & ;  7'#711354./.7'67&/354>7Å((4Õ((	S
      þ   #  7462"&553'.53;2>53#^!.!!.!/+""+Ø!!K!!�&&&+##+        þ     4  75462"&7"2>=4.53'.53;2>53#g&&/$+""+�KK KKþç&&&+##+          ##3353?5/##53'3#–g		gT((TPÀÀ§^^%
K	ƒƒ&%K8	       
  %  ''5?5'#571?'7#'573¡tuutgggg#..q..rK¬KK¬K«B–B66B–BZ/../      ô   "  %'#353?54'7'56737/7€€+KI?BAB10AgggÂ22w^""G(((      	   '  75#'37'7357'#3#'573'7'7#À!!00n!!05!AA!11eA!11!Ac @@ 00“ @@ 0P  10- 01                 73#535##735375'533#q	–		/&„„ë		–

Œƒƒƒƒ		ƒ
K9^
ƒ		ƒ
&K           ' + 4  %#&#">=2"&>7&#26=73552"&46'.1–	'„ƒ/©/	'U8•		�
'qT
%	&�         	    737'#'55#37''7'74II4	H;;..·  !    ÎHôH	^X;Ç;KI !  !       ,     #5#5#3#'5733#5#53533#²@K^KT		~68888A%KÏ	á	9Î888       ,   (  #/#35#53?335##533#5#53533#^		g^UwzPPz8888	Î
q%T8ô888      ô Å   7+7'7'326=á�00�Å%0
0%       Ò    (  76.6.>&'7+7'7'326=,.	'.	F	
	
œM00MÅ	'.	'.
	
	%%0/%              3#'5353##33#ô		ô	á¼––qqqqKK
»

»	©©&      ,,         # ' + / 3 7 ; ? C K O S W [ _  7#53#53#53#53#53#53#73##53#5;#3#53#53#5353#53+5373#'7353#3#3#'3#%%%8&%ÎKƒƒƒ%–^^Î8989%%&K©©©©&&%ƒ               #  73#'73573#'735#33##3&©©©–^^^]áááá&%%&        ú % @ I R  %676'#&&"&'&12767654"'&'&5476722763'"264&3"264&	B	Sƒ!

JJÂ
	
 )

) xR     -   " .  3&'5##'535#"#7>..>8Ï	
]\^^Ã
	,,	
	d^ÌÏÏÏq
',,
K   
       $ - H b w ’ ž §  7.676'.>&76&'&6264&"3#"&="&=46;#"37&+"33>=26=4#+"&=#5&6;2#5326=354&+&'32#'">54&"&462«	

	+			œ""	"	‹
.&	.4""	"®		Õ	&	
	
¥
")	*5z
;,	,<J??=	v5*	)"
Ù
&       ,    ! %  #'57533533533535#3##33#ô¼&&%©¼¼&pppppppp,ôôþçô&88         ô 
     7/5??5'755¡lsskK
@9±^^q^&ô	~	  	~	wllk
00      # - B  %'5'54'&'&#"76?2>'&>&/&4?>&'5\9		D
]
–DR
	HO:\=8	D]*	³ªDQ5		
5I            72>4."7#'77–$<##<H<##<+$O#<H<##<H<#M+$O         /  737''7'.767>676'4&'&'&vUO$V)&&0'&+!&&& !"&`VO$Ž)7+'	"*..ô	"%*	NH
      þ     '  ?7"&462264&""&>2264&"D––'—'>¼¼€'']''         # E  7##33535#'.>&'>.632#54&+"3;#"&75"&7546ô%%%%T
		&	

.	.			q&%%¸
			E3?	,2         Ï   ) =  2"&467"264&#"3;26=26'54&5&6;2#+"&=– .		
J	.	T2,	
+2T33??        , -  353375337533753#5##5##5##5#!75'%

%

%

%8//8qqg

gg

gg

g¼999999KK¼          -  73.'7#523#".54672>765#5"¼I(#3p	/\3",+ 0 q	
+3¼(I\3#
	pƒ +,"3Ì+
	q 03      á  7  %#"&'#+5#'735323>3#'&'.'>76?36
	<<	
6	M		MÎƒ
		
K
	K
	
ƒ       - 6 P  31&/576?67#3#'5#5467675.5>"'.'&67676Kƒ	
			[^
	
K
	
Œ6
MM	<<	
6˜       á  7  3#'5#5467675.53.'&/576?67Kƒ	
	
K	
K
	
ƒ6
	<<	
6	M		M         ( . 1  '.767>676'4&'&'&'7'77¡)&&0'&+!&&& !"&'TT:)7+'	"*..ô	"%*	NH
«88_N'      ð    755G©¥�ápg¾_         â    ##35>='#5##.=3ƒ	%%	&;"p8	B+99+B	88s88         ï    ' /  7#'##73'&'1532#'32654#32654# >8n)#^((�Y>>7��/>4              #  3#'535##3'#5335#3#'#33#&ááááÎ¼¼––8KK%%9KKKKK¼¼¼¼8ƒK%8%      ë ë    ?3#'735B	–		–	„á		–		�„„              3#'535#3#7#373#ô		ô	áá&&q&&%&&	ô		ôêá¼¼qq–       ô   7'#'##3?3735Ý!#5<
#	Cƒq}]Q2_„X         < @  "2>4.".>27."34>23546?>4&3#�!8!!8B8!!8!008//
.!8B8  8B8!á/8008/ž			
^     
  "  7232#"&5467232#"&5467†# //™$ 0.ê3$+*&5N#3$+*&5N#         % 1 C N R V  7467'7.77.467''>4&'77>4&'#'7.>264.#3'#8	

	�



K@h@	&6Ã&,1,&		M		!†&)&,1,B
‘!!‘	'$8%%           * 3 ?  736.75.>264&"27"&'77264&"33##5#53á ;@.9 .#31z.		/7%%%%Ÿ 9.@; /4'+/	
/8&%%      ô      # ' + / 3 7 ; ? C  %#";26=4&#53#3#373##3'3#7#3'3##33#53#7#33#Ï

ÏÏÏ9%ƒ]]ƒ&&^K88&&ôƒƒ–ƒ8988]         â á     7264&"7".4>24&"26–S#(##(#!.!!.!ƒ##(##!!.!!         1  7264&"7'.767>676'4&'&'&– )&&0'&+!&&& !"&q  ¨)7+'	"*..ô	"%*	NH
      ë
   #53'.'.>5ê	B0"#

ab!,,B			##ba,,!'   
    *,   ! . 2 6 : > B G  7'7#";#.4673'7#'573'35#73#535##5#33##373##3'13#‹+<<+Ex

x
xddFx

2(d<<<<<<<<<<<**ó+(+þÿ
 

 
Œx
 
Œ<F‚È<<      	   7#53#5>&'7.>X2A
9@+$%+31%ô
A%?<0A5
#03,#03,            37'#5'7'73#¼0	00	00	00	0–KK;::[K      -   , 2 8  3&'5#3#535#'5"2>4.".4>27'7'7'þ		
êaN:k
×$$*$$ 	K	lV° 	Äl$*$$*$ˆ  '	         ò    7'7''75'òKKPP®MMRRyJKPPVMLSR      ©   %!5!þú–          & : D X a s {  †  762"'#53264&"'7546;#"77354#"6232?"&54?#5#"&54?4"5>72526275"&4625&'"'73#'735'735Ú	Œ',,;	,	7	}©©©p„ú	J4N(
 			¯				K]]]]&^q        â   ' : B F  77'546;5#"'3>4&"'#3=462"&#"&5&632&"27'375'3#<+)o
^ƒƒƒƒæ+*/	'\	
	–[ppp           7'32354.+7vKK=$'4&<)";LK<G'9&:   	     ( , 0 4 ; K S W [  7#535#"35#"'&'4=45676;#375#'#33#3##53#'73##5#"&=4635#";5#'35#ô©KP	
®KT
ƒ8BT		/		 &&99q–
²

&
Tqƒ88ê	q	^p9      ,   / ? G W `  7121#1"&5146121#1"&51467121#1"&51467121#1"&514637#'7#326735#."".>ŸDTU88%1%99%1%l''á%K%yETT­    !'         	  # ,  7357'#7357'##326735#."".>–DTUDDTU88%1%99%1%l''üDTT..ETT4    !'         / 8 A J  %4.'&=>."2>&'57>=>'462"&"&4627"&4624432»

g/á¡

Ž        ,   "  7#326735#."".>'537#'7^88%1%99%1%l''8DTUK    !'^yyETT         	  "  7357'##326735#."".>–DTU88%1%99%1%l''üffDTTm    !'         & * . 2 6 =  %5'#";5#"'&'&=47676;#37'53'3#3##3#53#
·®KT
¼©–	8qŸ	²
&	B––ƒg88             3#'5#'535#3?3#35#ô		6/	zzá.
(	¼	6/	¼²©©
!(™^%         	     #'57335'##33535#5#3#É8©pp©9pK%%%%%]]8¨áó¨9K&&%ƒ        ,    # 0 V f  7"&462264&"264&""&46267"&'7?32+"&='57546;5.5462";>=4&#–888.	
	
	/ !p  /	
Tp–  E



	·	!%!!%!	;qq            ( . 7  "#37567653''67/6767675#5#76.6/.%$N	p8	!ó1j@@#$0/$H%·!	8q	N$%./Tj1@$/0$#8%8�	     %  ( 5 >  757333#6737#&'?35#/#"&4623".4>2264&"	^l
	2	F3-lUgP
U&##B'·F

.„
q%1W$A''         & 3 <  73#6737#&'?37#/#573"&4623".4>2264&"‘		lVw	zzP
		^&##B'ô
»	
„1F
�$A''         ô ô     7#52'234.234.^&&.N-3V3+38&¬-N.3V3K+3      ô 	    7375/#'73'3||>|>ƒo5t5o2"T¥||>>vo55""S             7553'#5'!©¤Ž0/ápg¾_/ff         ø     2 9  ?5''757'#&671654'1.611.716#'77Ÿwš†cjŸC.†!&).-#J#/PgYB¬j-Y@-,

 #          75575'4©¥�V¤¤ŽŽápg¾_umn__             755#'7537"©¥Ž=/ápg¾_Ž/ff         	  . 5  ?57'#&671654'5.611.716#'77^©lVŽ(	+1	0$ O%ÿqH9_D

!%         	  . :  ?57'#&671654'5.611.716'77'7'^©lVŽ(	+1	0$ ,ÿqH9_D

!            &  %/##375375#5335353#5/#53 	/		¼	/	K¨q]%q&^’ú	/	¼		/	 Î¨99%%K^&            # '  #5'##5#3#'57335#'??7'Ï
	q%8
.œ?&&zr9rg
a	 KK¼¼K99r8r‡	a        	    #'57335'##5335ú	ô		ØÎá"ƒK&Ø		ô	áÊKK99              #  735#3#'#573#7#5#533#53#3#'538¼¼&pp8	B8ó9B		B9á8B	K–%KKA
	A8–B		B          # '  7#535375#353535+335'7#'573#3B/%©	/8%/×%	Ÿ	„		„	%KKá%/
%/	²/%%/			^		&    ÿÿ,   /  "732>4.4>2".#'77373'#–'EF''Y$$U(()(%)'EF'-'T#‚((((%(       ) 2 :  7''7.>&'54.>.677'76'6&#"l		GG$AB)	/2')$"($O
N!î5		EEE:7#*
d!($"($[NFO!        ,-    "7>.#".4>2#¿3	ddC87!''.&&,!8<sr&@A(»'.''.'          7'77'øøÑÑeppo	Wb_V             ! )  73#3#3#!7354>;2335#'##5#qKKKKKK«þô#p#¦pp¦–ô^K^©¨&Ïô8%%8        . 7 U ^  3#5#3#'535#5&''7&7'767537''264&"5&''7&7'767537''264&"ô	áƒ�	áá]

					e				
z9„	Î/&©






/m





/				         # 7 ? S  7'573'##5##5##5#35##'573'##5#35##5##5##75'#753353353353353/		Î

A¼&�		Î

Œ¼&Œ

Î			&Î
8		8
9&&ƒ	8

8	8&&ƒ	8

8	%%       ,,  7 C N  7'#''7'57'773775/7'/#'73?7/632.63264.ø44+,<,*44*,<,+122+

+22+

+`		¿<,*44+,<,+44+l
+22+
+22+K-        þ  # < F  7232#"&'#"&>73>3"264&#7232#"&'#"&4673>"264&#qhjLhjz–        % = @ B  7#375##53#54675462"&=#7"36767632?'.20#1^B		Î
»8*!EE
L!
		DD9á	¼		8/©p/!4
II

z !(IH¢       $ E Q  7.7572>76763'67>=#&'&/&'&>."3›
	

		l		
	
	
h	
	
%	#<		<#	Ñ3	3Q1         #  755'#75375#5/3'53#'57Ï	©	^B	9DƒLKK:]\./å*

Ê	 		*œÔ­../          %  775'#175375'#5/3'5#53'7'Ï	©	^B	9DƒLKK{^]..å"

	Á	 		",œÔ­@..           " + 8  >.6>.7"&462"&462"&'>7'MG?( ;E?()<6"3;6"<^B
%*#	;F@'<E?·2=6!2<5_S	        1 X  7"&462'"#33573#"";>4&#4&#54.#46;23232+"&46;546;75'#"&–/"©B&
	©		&ê+!%  B/K

8	       
     " ,  35375'3##3'375'53'#37#'37'ƒ„q&&8&&8ƒƒƒ%%^&&88.:&%9%K^^q^^9&–H&&     ÿÿ, , 5 > G  %4.+"5>.">&'>;267>'462"&"&4627"&462	%$$%Î8gÅ
[$$r$$
IÂn         , W  726?>?>././.26?>?>././.e


						x
a
				

				O
      , @ k   726?>?>././.?'./7>26?>?>./././7>?'.e


						
		v
			a
				

				‡
			È
2				          #375#53#53ÏÏƒ^^q^^ÏÏÏÏÏÏ            #375#535#53ÏÏÏÏÏÏÏÏÏ^^         M œ ¦  7&#.#21273#;>'&/.6?3267654'&'&&'54&'+46;5&67'#"&>;26?&'>73235&67>76&'&&/">4&#h


'}	

d	n
<

!

	
ƒú		#

	
			¹	
	

	
p       	      7'#7'7377#373'7´eRPPRíRªRR,,$$$·bb@d>>d@	OO4P„----      	  7'#7'7´eRPPR·bb@d>>d@       	     ?3'7''7#'5#xeRPPRƒ$$,jR·bb@d>>d@G--3O           ,  73#7'.767>676'4&'&'&qKK0)&&0'&+!&&& !"&¼K¨)7+'	"*..ô	"%*	NH
         ô 	   % .  735#35#7#3#375264&"7"&462264&"&		ê	»S%
á
¨
©–
¨g         	   35#53575'#3#		/%%Å		/&&
Î	¼á	Î
¼       ô    ?3#'7##7'7'353'7'7#3	ô		ô	ôqL'88(MI'77'Iqê

¨

ŸA'77((77'A          $ ( ,  7375'##575'#373375'##537'/7Õ2"^#&K%	X2#^O8%%%�=v2""%K&m	
2#K	*&8&x=        5 > G P Y b  ">32>4.##.5&764&"'"&=4>2#7"&462"&>2'26."7"&>2"&462–0%#=##=#
,
3=448
ƒ
‹
%0$<G<$õ+ 33=4¼‹V@       ô      73##3'73#'735K–––––Îááá¼&p––––          " &  ?3#535##5'#37'#57'53'3##3ƒqKKq&ppp‹KKKK&KKô^^89^^^^8]          " & *  #353#3753#'#375'#533#3#73#qqKKpKD&]ppp^KKKKqKK88^^8^^q^–        ï    733'7#'7#7#‹>)!†(G6…E>>@
@ ‰H	c‰^„              %'#3?5'57'757^ƒ

^ƒ
 TT	W}WzzØ/BT/BT‘*F&'?,W=I9       	    %/#375#5533>‘		Î
8„q	BÙ>	ô		¶9ááB	–      â  !  7"#.673>."&462#Ø%::"'á #p''        ë  % ? J e  7>76'6'.#"5#35766'&75&76'767232?356&#"&476?7?5"&4625'&"‡
			P				
œ
		

_4�L	


	?9/*                %#53#3'#3#3'#37#3'#5#3]]&&K©©%ÎÎ^pp–]]ƒƒp]]áK^K©99              7'#3?5'5'757ý]^		^]
zUUPYYY^TTá88q88q£2a.A551C2e.            )  35#7'3'?7>.6>&'&K–
	¼(K–v +*# "

&KbŸ!*%ƒ8Kx
# " T &       F �  75#"111+321135#".=4&'&'67>=4676332>716716'5471676;5#"'5&'5&'1&=6'5&'1.#32#q	
	
			M	
	
		
ô

	¼	

           3#3##5##5#535#53533535ÎKKKKKKKKKKKKKKKKKKKKKK]KK          ) 5 B O S  #"&54676674.7733##5#53'''7'77.">'.>7#36


LdcS////l!!!!!!!:�KK	%"dc‡///%!!!!!!!p		

4       á  " )  7#54&+;#5326=#"#53'7'#'7'Î
9
p7"!§!"¼	gg	%L"!!"        C  7".767&4767>7'7"276?6767>54''7&5#@
)68%D 	‰D#I 		100
&>86 Eõ&B%K		001      ô    375'53#535#535#535#535K––––&&KK&&Káá%á&&%       	      ! %  35335'537#373#7#373#35#'3#/	Ï	ê&8]&	ØÏÏØ	þú          ) 6 @ R  375'53'354#"6232?"&54?##5362"'264&"275"&4625&&&ááá£	+	E	©©¼©©: 			J	!	               %  375'3#73#'7#35373#'7#35&áááá88%8^99%9888K99999999        á 	   # ' +  735#35#7#3#375#/5?35'77'75&%/		/%ê/&&/	<T	.T	P?BBÎ	–
–ƒ
–'/	%/&WW      +  # '  7'>7#'7..''73''7g=6 '',1@:2'('.’ßç3'(*³1'('¾Ð     +  #  7'73'67.7'37'.>&'()=9EI0Í''.HE:<'‘'(/!:/('%: 0             # ' + /  #3753##53#5'3#3#533533#535#53'53ýá		á
áÎÎƒ888K888888K888888
Î		Î	8%8%%8%%9&&&&&%%%      '  # 0  #372>?4&'5&#"32'73'?øb}a**%I%TsT	
E}b*
"
%*!(J&Tt9
E            + 8  7264&"7".4>2264&"7".4>22>4."–S#(##(#K!!.!!š#<H<##<H<#ƒ33>33ƒ##(##L!.!!.!8$<##<H<##<”3>33>3          
    ?''7#733##3Ckd"ä™+n¨¨¨¨¨¨®]V"*&K&%&              *  ///?'?'77'77'77'#'#5#7Ó'>C
0/Cg*
8
#+!.9## ]
b.-MMs[8KaNI      #  G Q n  %'&"2?>=4&='"57473764"&54754?2621&327##54?17#"/.=46?62. YY		YY		M

$T		YYY	é55	j	55	j	Ÿ|4	g5j55     ,    $ ( 0 4 8  7#'"27#".4>2.3#3#7!!75!5!5!5!Ì&%S
		
	%�þæ			þúþú©^^				»	ô		ôê¨&    ÿÿ   ò- -5;JPRW^cdnt  "+7656=#.'.>'370#61&31#&'&7333'#&'.7&74'56751?6736767167676?3761231716'27162'1&1#5&'#1&7141"'1&1"73'1641'65147"'4'&'&76767>.72576?6?651&?097.'21&'7"#2#0'4"4&671?6.77'''&'76'031256547…H#	2

&			T		6'Œà+�
&						-@!
			

)


»z™ŸW      - Z ± Ï>  7#"&'&/"""&'&/.465'4676?'4>7>5'454>32'2;2?4/./=4>323265'.#"'&#"=."265#"/&62>&/.72767675?4>754?6?/&/&5'&/&""&/&"22>76?6=/&#""&/ù	

		
		~

C			
@


	[
	


		
�	ä

	
	

        +      /77'7//ô"ô"á áM^=E2=		ò	
ñèß�/7''            #375#53#535#53ýá		á
„]]q^^^^	ô		ôqgÏÏ^^    ÿÿ      ' 4 D  7"&462"&462.''3&57"&462676&''"1>&'&#ö!!¦!!2"
1 a!!
	ÒD&	)
ó!e!t(!2	"| #
              73#'735753#ááá¯55>KKáááá955=
3       á  
    73733'77#3733'767?,	+
,…=?d©qqB((z©++BCC      ô     %#53#5335#áááááááÎ&q&q&           7".?#.767>73+f4#§n#	)J	B
g          6  7".?#.767>73+'"732?326=4&#f4#§n >	r	#	)J	B
gÑC	.hB           36+.=46;76Æ4#§m
	)J
B
g          6  36+.=46;7627676&#'576."#"3Æ4#§m!=
r	
	)J
B
gÐC	.hB         / A M R h  %''7'&"32767672>4+".7677"'.7>;3737'7/'#'7'&/7>4&''':9		$"â*FI© ,
"#"Ê6#
+Š:;:ë'(:;%!·,FK… 
##"'$6@,}<<<       ô     # '  73##'5#53546;2+335##373#73#¼8ƒ8888^ƒƒ&&ô©©¼©ƒƒƒƒƒ         Ï   ?3#&ÒjÄ

f        Ï   '5Ä

fÒj       Ï   7'57h

f&Òj        Ï   %#'73Òih

f       ÿ >  %"&'67"&'&'7.'&513&'&'&767'5476762676	$+-**
		

å"
	
			
       " & *  7#'375'#3#375'#7#375'53#5#53ý ?

K		>!		8

:9		8
–8^%Î&&^^	K		K	^
8		8
VV
8		8z99ƒ%%%%          " & *  #3'375'#3#375'#737553#57#53ý8		9:

8		!>		K

? 
á%^8ƒ&&	8
VV
8		8
]
K		K
]
8/&&ƒ88ƒ&        # ' + / 3  7#'5'#5375'#3##37573375'3#3##53#53ý! 
	

%				 "		&	 C 
%
„889¼K G
%	&		&	%
G 	&		"  "		&ÅK8K        	  -  75'73''37'57#53'#3#'7'73#37#5�""""bEEN888:9OEEO988:8²K!"K8K""Kg79--79--         	    ' + 3 7 ? C G K  '#5'75#'37'7#'573'35##'573'35##'573'35##'573'35+35#36(''(N%		%
&�8

8	8&&B%		%
&�8

8	8&&%%%%'RT'èRR''b	&		&
%	8

8
%–	&		&
9
8		8	&p            754>3.#375'3#5^)#.8&¼&&¼©% *%pppp      	   ' /  737'#'55#37'>'6'7'64'7'6'74II4	H;;..Å%&ÑHôH	^W;Æ:K%*$'+/         / [ _  73737575'5'#'##37#5/?53?3#'7#567>32#546?>4'1.'1&"#53� -
  	. /

/))((	 
-  .	  
-  -
((((q			
]       , B N Z b f j  74626?'."577>#"&"276?"./&'"&>4&'3#.54737!!75!5!5!5!e				s				ž		Ïþæ			þúþúT	"	


	
Î	ô		ôê¨&          7#'#'5'57573733#'37''�/

/ .	  
-?F@ 
-  -
  	.  -
0FA       / 6  73737575'5'#'##37#5/?53?3#'737''� -
  	. /

/))((F@ 
-  .	  
-  -
(((( FA        ô    !  7375'#53535#35#'535#35#–qqq©		8		ô––©–^K	„	8&	^	    ÿÿ.   &  3&'5#3#535#'5>.67''ô	à]K8g	¤($!($8-' 
gS©
»t"($!($R;4     ,   + 1 7  3&'5#3#535#'5"2>4.".4>32'7'7''7'ô	à]K8g	Î##(##!!		0
gS©
»g#(##(#ƒ!.!C.        ,   +  3&'5#3#535#'5"2>4.".4>32ô	à]K8g	Î##(##!!
gS©
»g#(##(#ƒ!.!      ÿþ.  . 1  3&'5#3#535#'52'.'.7>76'ô	à]K8g	Î

	
:9
gS©
»g
	
	
K&K           #3#35#5375#53ô		g8–8g	áá
»

»²©      , ô  3 7 ; G S  732+"/&"+"&=46";2?62;26=4&#3#%3#'2+"&46;2+"&463K–!!

!!	"	áŸ/–/ô!K!



!K!K		K8888%          )  754'&"6577>=6&'7"/&4·O(,Œ¡4èH!;šj	”á		Ï		¥�	       *  7'&/"/&4?'&4?627>#553Ì`*$$*b2<II='X 	!"	 Y\A87.I         # 0 8 @  73535#5##3##33535#75##33535&"2?64"&4?7'762R–J	ŒŒ¢yÎ^–.�	Œžy             3#'73'5#=3Ž{öƒkÖ_æÎÉ&KK        ô   '  735#5#'375>4&'5'#".4>2�%
K		K
z#(##(#ƒ/8Z,2,)		),2,)		z##(##         á     5#";#35#5#"&46;#53ág^8&#^Ï^'ÏÏ     , ÷   ' 7 C  53!53!7#5##"&54?4#"563232651#531632"'32654&"þÔ€
"$
	?*^&&88	&
˜C;          #375#535#53ô		ô	áááá
Î		ÎÅ„&          / E Z z Š  7&'&7>2327354&'.=4>37."5#3532>4'.=>6>25'&26?5'.467#53#'573I			
k^
	

ÜKT		|'66&rë
	1.t

	`
	M	q	'67%      %- $ ? L  23'.=2>7>.'.">5//?—
!"

ˆ)		)
	4Q$	[,J&#

#'L	89" 		 "`'3k       %- $ ? i q  22'.=>7>.'.">5'#'54>?>4&'&"#'4>7673#'—
!"

ˆ)		)

`
,J&#

#'L	89" 		 "
a      %- $ ? S  22'.=>7>.'.">5/#'#37375'7—
!"

ˆ)		)

G%%%%%%%%,J&#

#'L	89" 		 "&&%%&&%%          +  7'.>267>54."75#5##335âPOH9?G0d'.&&E%&&¹&OP+EB#5€''-'K%%%%          #  7'.>267>54."'3#âPOH9?G0d'.&&]]¹&OP+EB#5€''-']      Æ                                                 (      
 $ /        S  	   f  	   t  	   ‚  	   �  	   ž  	   ¶  	 
 H Ä  	  &codiconRegularcodiconcodiconVersion 1.11codiconThe icon font for Visual Studio Codehttp://fontello.com c o d i c o n R e g u l a r c o d i c o n c o d i c o n V e r s i o n   1 . 1 1 c o d i c o n T h e   i c o n   f o n t   f o r   V i s u a l   S t u d i o   C o d e h t t p : / / f o n t e l l o . c o m                              Î	
 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€�‚ƒ„…†‡ˆ‰Š‹Œ�Ž��‘’“”•–—˜™š›œ�žŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ 	
 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€�‚ƒ„…†‡ˆ‰Š‹Œ�Ž��‘’“”•–—˜™š›œ�žŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ accountactivate-breakpointsaddarchive
arrow-botharrow-circle-downarrow-circle-leftarrow-circle-rightarrow-circle-up
arrow-down
arrow-leftarrow-rightarrow-small-downarrow-small-leftarrow-small-rightarrow-small-up
arrow-swaparrow-upattachazure-devopsazurebeaker-stopbeakerbell-dotbell-slash-dot
bell-slashbellblankboldbookbookmarkbracket-dotbracket-error	briefcase	broadcastbrowserbugcalendarcall-incomingcall-outgoingcase-sensitive	check-allcheck	checklistchevron-downchevron-leftchevron-right
chevron-upchipchrome-closechrome-maximizechrome-minimizechrome-restorecircle-filledcircle-large-filledcircle-largecircle-slashcircle-small-filledcircle-smallcirclecircuit-board	clear-allclippy	close-allclosecloud-downloadcloud-uploadcloudcode-osscodecoffeecollapse-all
color-modecombinecomment-discussioncomment-draftcomment-unresolvedcommentcompass-activecompass-dotcompasscopilotcopycoveragecredit-carddash	dashboarddatabase	debug-alldebug-alt-small	debug-alt'debug-breakpoint-conditional-unverifieddebug-breakpoint-conditional debug-breakpoint-data-unverifieddebug-breakpoint-data$debug-breakpoint-function-unverifieddebug-breakpoint-functiondebug-breakpoint-log-unverifieddebug-breakpoint-logdebug-breakpoint-unsupporteddebug-consoledebug-continue-smalldebug-continuedebug-coveragedebug-disconnectdebug-line-by-linedebug-pausedebug-rerundebug-restart-framedebug-restartdebug-reverse-continuedebug-stackframe-activedebug-stackframedebug-startdebug-step-backdebug-step-intodebug-step-outdebug-step-over
debug-stopdebugdesktop-downloaddevice-camera-videodevice-cameradevice-mobile
diff-addeddiff-ignoreddiff-modifieddiff-multiplediff-removeddiff-renameddiff-singlediffdiscardediteditor-layoutellipsisempty-windowerror-smallerrorexclude
expand-allexport
extensions
eye-closedeyefeedbackfile-binary	file-code
file-mediafile-pdffile-submodulefile-symlink-directoryfile-symlink-filefile-zipfilefilesfilter-filledfilterflame	fold-downfold-upfoldfolder-activefolder-libraryfolder-openedfoldergamegeargiftgist-secret
git-commitgit-compare	git-fetch	git-mergegit-pull-request-closedgit-pull-request-creategit-pull-request-draftgit-pull-request-go-to-changesgit-pull-request-new-changesgit-pull-requestgit-stash-applygit-stash-pop	git-stashgithub-action
github-altgithub-invertedgithub-projectgithubglobe
go-to-filego-to-searchgrabber
graph-left
graph-linegraph-scattergraphgrippergroup-by-ref-typeheart-filledhearthistoryhomehorizontal-rulehubotinboxindentinfoinsertinspectissue-draftissue-reopenedissuesitalicjerseyjsonkebab-verticalkeylawlayers-active
layers-dotlayerslayout-activitybar-leftlayout-activitybar-rightlayout-centeredlayout-menubarlayout-panel-centerlayout-panel-justifylayout-panel-leftlayout-panel-offlayout-panel-rightlayout-panellayout-sidebar-left-offlayout-sidebar-leftlayout-sidebar-right-offlayout-sidebar-rightlayout-statusbarlayoutlibrarylightbulb-autofixlightbulb-sparkle	lightbulblink-externallinklist-filter	list-flatlist-orderedlist-selection	list-treelist-unordered
live-shareloadinglocation
lock-smalllockmagnet	mail-readmail
map-filledmap-vertical-filledmap-verticalmapmarkdown	megaphonementionmenumerge
mic-filledmic	milestonemirrormortar-boardmovemultiple-windowsmusicmutenew-file
new-foldernewline
no-newlinenotenotebook-templatenotebookoctofaceopen-previeworganizationoutputpackagepaintcanpass-filledpass
percentage
person-addpersonpiano	pie-chartpinpinned-dirtypinnedplay-circleplayplugpreserve-casepreviewprimitive-squareprojectpulsequestionquoteradio-tower	reactionsrecord-keysrecord-smallrecordredo
referencesrefreshregexremote-explorerremoteremovereplace-allreplacereply
repo-clone
repo-fetchrepo-force-pushrepo-forked	repo-pull	repo-pushreporeportrequest-changesrobotrocketroot-folder-openedroot-folderrssruby	run-aboverun-all-coveragerun-all	run-belowrun-coverage
run-errorssave-allsave-assavescreen-fullscreen-normalsearch-fuzzysearch-stopsearchsendserver-environmentserver-processserversettings-gearsettingsshareshieldsign-insign-outsmileysnakesort-precedencesource-controlsparkle-filledsparklesplit-horizontalsplit-verticalsquirrel
star-empty	star-full	star-halfstop-circlesurround-withsymbol-arraysymbol-booleansymbol-classsymbol-colorsymbol-constantsymbol-enum-membersymbol-enumsymbol-eventsymbol-fieldsymbol-filesymbol-interface
symbol-keysymbol-keywordsymbol-methodsymbol-miscsymbol-namespacesymbol-numericsymbol-operatorsymbol-parametersymbol-propertysymbol-rulersymbol-snippetsymbol-stringsymbol-structuresymbol-variablesync-ignoredsynctabletagtargettasklist	telescopeterminal-bashterminal-cmdterminal-debianterminal-linuxterminal-powershellterminal-tmuxterminal-ubuntuterminal	text-size
three-barsthumbsdown-filled
thumbsdownthumbsup-filledthumbsuptoolstrashtriangle-downtriangle-lefttriangle-righttriangle-uptwittertype-hierarchy-subtype-hierarchy-supertype-hierarchyunfoldungroup-by-ref-typeunlockunmute
unverifiedvariable-groupverified-filledverifiedversions	vm-active
vm-connect
vm-outline
vm-runningvmvrvscode-insidersvscodewandwarningwatch
whitespace
whole-wordwindow	word-wrapworkspace-trustedworkspace-unknownworkspace-untrustedzoom-inzoom-out  :root{color-scheme:light dark}body{--transparent-blue: #2196F355;--light-pink: #ff69b460;--gray: #888888;--sidebar-width: 250px;--box-shadow: rgba(0, 0, 0, .133) 0px 1.6px 3.6px 0px, rgba(0, 0, 0, .11) 0px .3px .9px 0px}html,body{width:100%;height:100%;padding:0;margin:0;overflow:hidden;display:flex;overscroll-behavior-x:none}#root{width:100%;height:100%;display:flex}body,dialog{background-color:var(--vscode-panel-background);color:var(--vscode-foreground);font-family:var(--vscode-font-family);font-weight:var(--vscode-font-weight);font-size:var(--vscode-font-size);-webkit-font-smoothing:antialiased}a{color:var(--vscode-textLink-foreground)}dialog{border:none;padding:0;box-shadow:var(--box-shadow);line-height:28px;max-width:400px}dialog .title{display:flex;align-items:center;margin:0;padding:0 5px;height:32px;background-color:var(--vscode-sideBar-background);max-width:400px}dialog .title .codicon{margin-right:3px}dialog .body{padding:10px;text-align:center}.button{color:var(--vscode-button-foreground);background:var(--vscode-button-background);margin:10px;border:none;height:28px;min-width:40px;cursor:pointer;-webkit-user-select:none;user-select:none}.button:focus{outline:1px solid var(--vscode-focusBorder)}.button:hover{background:var(--vscode-button-hoverBackground)}.button.secondary{color:var(--vscode-button-secondaryForeground);background:var(--vscode-button-secondaryBackground)}.button.secondary:hover{background:var(--vscode-button-secondaryHoverBackground)}*{box-sizing:border-box;min-width:0;min-height:0}*[hidden],.hidden{display:none!important}.invisible{visibility:hidden!important}svg{fill:currentColor}.vbox{display:flex;flex-direction:column;flex:auto;position:relative}.fill{position:absolute;top:0;right:0;bottom:0;left:0}.hbox{display:flex;flex:auto;position:relative}.spacer{flex:auto}.codicon-check{color:var(--vscode-charts-green)}.codicon-error{color:var(--vscode-errorForeground)}.codicon-warning{color:var(--vscode-list-warningForeground)}.codicon-circle-outline{color:var(--vscode-disabledForeground)}input[type=text],input[type=search]{color:var(--vscode-input-foreground);background-color:var(--vscode-input-background);border:none;outline:none}.codicon-loading{animation:spin 1s infinite linear}::placeholder{color:var(--vscode-input-placeholderForeground)}@keyframes spin{to{transform:rotate(360deg)}}@font-face{font-family:codicon;src:url(./codicon.DCmgc-ay.ttf) format("truetype")}.codicon{font: 16px/1 codicon;flex:none;display:inline-block;text-decoration:none;text-rendering:auto;text-align:center;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.codicon-add:before{content:"î© "}.codicon-plus:before{content:"î© "}.codicon-gist-new:before{content:"î© "}.codicon-repo-create:before{content:"î© "}.codicon-lightbulb:before{content:"î©¡"}.codicon-light-bulb:before{content:"î©¡"}.codicon-repo:before{content:"î©¢"}.codicon-repo-delete:before{content:"î©¢"}.codicon-gist-fork:before{content:"î©£"}.codicon-repo-forked:before{content:"î©£"}.codicon-git-pull-request:before{content:"î©¤"}.codicon-git-pull-request-abandoned:before{content:"î©¤"}.codicon-record-keys:before{content:"î©¥"}.codicon-keyboard:before{content:"î©¥"}.codicon-tag:before{content:"î©¦"}.codicon-git-pull-request-label:before{content:"î©¦"}.codicon-tag-add:before{content:"î©¦"}.codicon-tag-remove:before{content:"î©¦"}.codicon-person:before{content:"î©§"}.codicon-person-follow:before{content:"î©§"}.codicon-person-outline:before{content:"î©§"}.codicon-person-filled:before{content:"î©§"}.codicon-git-branch:before{content:"î©¨"}.codicon-git-branch-create:before{content:"î©¨"}.codicon-git-branch-delete:before{content:"î©¨"}.codicon-source-control:before{content:"î©¨"}.codicon-mirror:before{content:"î©©"}.codicon-mirror-public:before{content:"î©©"}.codicon-star:before{content:"î©ª"}.codicon-star-add:before{content:"î©ª"}.codicon-star-delete:before{content:"î©ª"}.codicon-star-empty:before{content:"î©ª"}.codicon-comment:before{content:"î©«"}.codicon-comment-add:before{content:"î©«"}.codicon-alert:before{content:"î©¬"}.codicon-warning:before{content:"î©¬"}.codicon-search:before{content:"î©­"}.codicon-search-save:before{content:"î©­"}.codicon-log-out:before{content:"î©®"}.codicon-sign-out:before{content:"î©®"}.codicon-log-in:before{content:"î©¯"}.codicon-sign-in:before{content:"î©¯"}.codicon-eye:before{content:"î©°"}.codicon-eye-unwatch:before{content:"î©°"}.codicon-eye-watch:before{content:"î©°"}.codicon-circle-filled:before{content:"î©±"}.codicon-primitive-dot:before{content:"î©±"}.codicon-close-dirty:before{content:"î©±"}.codicon-debug-breakpoint:before{content:"î©±"}.codicon-debug-breakpoint-disabled:before{content:"î©±"}.codicon-debug-hint:before{content:"î©±"}.codicon-terminal-decoration-success:before{content:"î©±"}.codicon-primitive-square:before{content:"î©²"}.codicon-edit:before{content:"î©³"}.codicon-pencil:before{content:"î©³"}.codicon-info:before{content:"î©´"}.codicon-issue-opened:before{content:"î©´"}.codicon-gist-private:before{content:"î©µ"}.codicon-git-fork-private:before{content:"î©µ"}.codicon-lock:before{content:"î©µ"}.codicon-mirror-private:before{content:"î©µ"}.codicon-close:before{content:"î©¶"}.codicon-remove-close:before{content:"î©¶"}.codicon-x:before{content:"î©¶"}.codicon-repo-sync:before{content:"î©·"}.codicon-sync:before{content:"î©·"}.codicon-clone:before{content:"î©¸"}.codicon-desktop-download:before{content:"î©¸"}.codicon-beaker:before{content:"î©¹"}.codicon-microscope:before{content:"î©¹"}.codicon-vm:before{content:"î©º"}.codicon-device-desktop:before{content:"î©º"}.codicon-file:before{content:"î©»"}.codicon-file-text:before{content:"î©»"}.codicon-more:before{content:"î©¼"}.codicon-ellipsis:before{content:"î©¼"}.codicon-kebab-horizontal:before{content:"î©¼"}.codicon-mail-reply:before{content:"î©½"}.codicon-reply:before{content:"î©½"}.codicon-organization:before{content:"î©¾"}.codicon-organization-filled:before{content:"î©¾"}.codicon-organization-outline:before{content:"î©¾"}.codicon-new-file:before{content:"î©¿"}.codicon-file-add:before{content:"î©¿"}.codicon-new-folder:before{content:"îª€"}.codicon-file-directory-create:before{content:"îª€"}.codicon-trash:before{content:"îª�"}.codicon-trashcan:before{content:"îª�"}.codicon-history:before{content:"îª‚"}.codicon-clock:before{content:"îª‚"}.codicon-folder:before{content:"îªƒ"}.codicon-file-directory:before{content:"îªƒ"}.codicon-symbol-folder:before{content:"îªƒ"}.codicon-logo-github:before{content:"îª„"}.codicon-mark-github:before{content:"îª„"}.codicon-github:before{content:"îª„"}.codicon-terminal:before{content:"îª…"}.codicon-console:before{content:"îª…"}.codicon-repl:before{content:"îª…"}.codicon-zap:before{content:"îª†"}.codicon-symbol-event:before{content:"îª†"}.codicon-error:before{content:"îª‡"}.codicon-stop:before{content:"îª‡"}.codicon-variable:before{content:"îªˆ"}.codicon-symbol-variable:before{content:"îªˆ"}.codicon-array:before{content:"îªŠ"}.codicon-symbol-array:before{content:"îªŠ"}.codicon-symbol-module:before{content:"îª‹"}.codicon-symbol-package:before{content:"îª‹"}.codicon-symbol-namespace:before{content:"îª‹"}.codicon-symbol-object:before{content:"îª‹"}.codicon-symbol-method:before{content:"îªŒ"}.codicon-symbol-function:before{content:"îªŒ"}.codicon-symbol-constructor:before{content:"îªŒ"}.codicon-symbol-boolean:before{content:"îª�"}.codicon-symbol-null:before{content:"îª�"}.codicon-symbol-numeric:before{content:"îª�"}.codicon-symbol-number:before{content:"îª�"}.codicon-symbol-structure:before{content:"îª‘"}.codicon-symbol-struct:before{content:"îª‘"}.codicon-symbol-parameter:before{content:"îª’"}.codicon-symbol-type-parameter:before{content:"îª’"}.codicon-symbol-key:before{content:"îª“"}.codicon-symbol-text:before{content:"îª“"}.codicon-symbol-reference:before{content:"îª”"}.codicon-go-to-file:before{content:"îª”"}.codicon-symbol-enum:before{content:"îª•"}.codicon-symbol-value:before{content:"îª•"}.codicon-symbol-ruler:before{content:"îª–"}.codicon-symbol-unit:before{content:"îª–"}.codicon-activate-breakpoints:before{content:"îª—"}.codicon-archive:before{content:"îª˜"}.codicon-arrow-both:before{content:"îª™"}.codicon-arrow-down:before{content:"îªš"}.codicon-arrow-left:before{content:"îª›"}.codicon-arrow-right:before{content:"îªœ"}.codicon-arrow-small-down:before{content:"îª�"}.codicon-arrow-small-left:before{content:"îªž"}.codicon-arrow-small-right:before{content:"îªŸ"}.codicon-arrow-small-up:before{content:"îª "}.codicon-arrow-up:before{content:"îª¡"}.codicon-bell:before{content:"îª¢"}.codicon-bold:before{content:"îª£"}.codicon-book:before{content:"îª¤"}.codicon-bookmark:before{content:"îª¥"}.codicon-debug-breakpoint-conditional-unverified:before{content:"îª¦"}.codicon-debug-breakpoint-conditional:before{content:"îª§"}.codicon-debug-breakpoint-conditional-disabled:before{content:"îª§"}.codicon-debug-breakpoint-data-unverified:before{content:"îª¨"}.codicon-debug-breakpoint-data:before{content:"îª©"}.codicon-debug-breakpoint-data-disabled:before{content:"îª©"}.codicon-debug-breakpoint-log-unverified:before{content:"îªª"}.codicon-debug-breakpoint-log:before{content:"îª«"}.codicon-debug-breakpoint-log-disabled:before{content:"îª«"}.codicon-briefcase:before{content:"îª¬"}.codicon-broadcast:before{content:"îª­"}.codicon-browser:before{content:"îª®"}.codicon-bug:before{content:"îª¯"}.codicon-calendar:before{content:"îª°"}.codicon-case-sensitive:before{content:"îª±"}.codicon-check:before{content:"îª²"}.codicon-checklist:before{content:"îª³"}.codicon-chevron-down:before{content:"îª´"}.codicon-chevron-left:before{content:"îªµ"}.codicon-chevron-right:before{content:"îª¶"}.codicon-chevron-up:before{content:"îª·"}.codicon-chrome-close:before{content:"îª¸"}.codicon-chrome-maximize:before{content:"îª¹"}.codicon-chrome-minimize:before{content:"îªº"}.codicon-chrome-restore:before{content:"îª»"}.codicon-circle-outline:before{content:"îª¼"}.codicon-circle:before{content:"îª¼"}.codicon-debug-breakpoint-unverified:before{content:"îª¼"}.codicon-terminal-decoration-incomplete:before{content:"îª¼"}.codicon-circle-slash:before{content:"îª½"}.codicon-circuit-board:before{content:"îª¾"}.codicon-clear-all:before{content:"îª¿"}.codicon-clippy:before{content:"î«€"}.codicon-close-all:before{content:"î«�"}.codicon-cloud-download:before{content:"î«‚"}.codicon-cloud-upload:before{content:"î«ƒ"}.codicon-code:before{content:"î«„"}.codicon-collapse-all:before{content:"î«…"}.codicon-color-mode:before{content:"î«†"}.codicon-comment-discussion:before{content:"î«‡"}.codicon-credit-card:before{content:"î«‰"}.codicon-dash:before{content:"î«Œ"}.codicon-dashboard:before{content:"î«�"}.codicon-database:before{content:"î«Ž"}.codicon-debug-continue:before{content:"î«�"}.codicon-debug-disconnect:before{content:"î«�"}.codicon-debug-pause:before{content:"î«‘"}.codicon-debug-restart:before{content:"î«’"}.codicon-debug-start:before{content:"î«“"}.codicon-debug-step-into:before{content:"î«”"}.codicon-debug-step-out:before{content:"î«•"}.codicon-debug-step-over:before{content:"î«–"}.codicon-debug-stop:before{content:"î«—"}.codicon-debug:before{content:"î«˜"}.codicon-device-camera-video:before{content:"î«™"}.codicon-device-camera:before{content:"î«š"}.codicon-device-mobile:before{content:"î«›"}.codicon-diff-added:before{content:"î«œ"}.codicon-diff-ignored:before{content:"î«�"}.codicon-diff-modified:before{content:"î«ž"}.codicon-diff-removed:before{content:"î«Ÿ"}.codicon-diff-renamed:before{content:"î« "}.codicon-diff:before{content:"î«¡"}.codicon-diff-sidebyside:before{content:"î«¡"}.codicon-discard:before{content:"î«¢"}.codicon-editor-layout:before{content:"î«£"}.codicon-empty-window:before{content:"î«¤"}.codicon-exclude:before{content:"î«¥"}.codicon-extensions:before{content:"î«¦"}.codicon-eye-closed:before{content:"î«§"}.codicon-file-binary:before{content:"î«¨"}.codicon-file-code:before{content:"î«©"}.codicon-file-media:before{content:"î«ª"}.codicon-file-pdf:before{content:"î««"}.codicon-file-submodule:before{content:"î«¬"}.codicon-file-symlink-directory:before{content:"î«­"}.codicon-file-symlink-file:before{content:"î«®"}.codicon-file-zip:before{content:"î«¯"}.codicon-files:before{content:"î«°"}.codicon-filter:before{content:"î«±"}.codicon-flame:before{content:"î«²"}.codicon-fold-down:before{content:"î«³"}.codicon-fold-up:before{content:"î«´"}.codicon-fold:before{content:"î«µ"}.codicon-folder-active:before{content:"î«¶"}.codicon-folder-opened:before{content:"î«·"}.codicon-gear:before{content:"î«¸"}.codicon-gift:before{content:"î«¹"}.codicon-gist-secret:before{content:"î«º"}.codicon-gist:before{content:"î«»"}.codicon-git-commit:before{content:"î«¼"}.codicon-git-compare:before{content:"î«½"}.codicon-compare-changes:before{content:"î«½"}.codicon-git-merge:before{content:"î«¾"}.codicon-github-action:before{content:"î«¿"}.codicon-github-alt:before{content:"î¬€"}.codicon-globe:before{content:"î¬�"}.codicon-grabber:before{content:"î¬‚"}.codicon-graph:before{content:"î¬ƒ"}.codicon-gripper:before{content:"î¬„"}.codicon-heart:before{content:"î¬…"}.codicon-home:before{content:"î¬†"}.codicon-horizontal-rule:before{content:"î¬‡"}.codicon-hubot:before{content:"î¬ˆ"}.codicon-inbox:before{content:"î¬‰"}.codicon-issue-reopened:before{content:"î¬‹"}.codicon-issues:before{content:"î¬Œ"}.codicon-italic:before{content:"î¬�"}.codicon-jersey:before{content:"î¬Ž"}.codicon-json:before{content:"î¬�"}.codicon-kebab-vertical:before{content:"î¬�"}.codicon-key:before{content:"î¬‘"}.codicon-law:before{content:"î¬’"}.codicon-lightbulb-autofix:before{content:"î¬“"}.codicon-link-external:before{content:"î¬”"}.codicon-link:before{content:"î¬•"}.codicon-list-ordered:before{content:"î¬–"}.codicon-list-unordered:before{content:"î¬—"}.codicon-live-share:before{content:"î¬˜"}.codicon-loading:before{content:"î¬™"}.codicon-location:before{content:"î¬š"}.codicon-mail-read:before{content:"î¬›"}.codicon-mail:before{content:"î¬œ"}.codicon-markdown:before{content:"î¬�"}.codicon-megaphone:before{content:"î¬ž"}.codicon-mention:before{content:"î¬Ÿ"}.codicon-milestone:before{content:"î¬ "}.codicon-git-pull-request-milestone:before{content:"î¬ "}.codicon-mortar-board:before{content:"î¬¡"}.codicon-move:before{content:"î¬¢"}.codicon-multiple-windows:before{content:"î¬£"}.codicon-mute:before{content:"î¬¤"}.codicon-no-newline:before{content:"î¬¥"}.codicon-note:before{content:"î¬¦"}.codicon-octoface:before{content:"î¬§"}.codicon-open-preview:before{content:"î¬¨"}.codicon-package:before{content:"î¬©"}.codicon-paintcan:before{content:"î¬ª"}.codicon-pin:before{content:"î¬«"}.codicon-play:before{content:"î¬¬"}.codicon-run:before{content:"î¬¬"}.codicon-plug:before{content:"î¬­"}.codicon-preserve-case:before{content:"î¬®"}.codicon-preview:before{content:"î¬¯"}.codicon-project:before{content:"î¬°"}.codicon-pulse:before{content:"î¬±"}.codicon-question:before{content:"î¬²"}.codicon-quote:before{content:"î¬³"}.codicon-radio-tower:before{content:"î¬´"}.codicon-reactions:before{content:"î¬µ"}.codicon-references:before{content:"î¬¶"}.codicon-refresh:before{content:"î¬·"}.codicon-regex:before{content:"î¬¸"}.codicon-remote-explorer:before{content:"î¬¹"}.codicon-remote:before{content:"î¬º"}.codicon-remove:before{content:"î¬»"}.codicon-replace-all:before{content:"î¬¼"}.codicon-replace:before{content:"î¬½"}.codicon-repo-clone:before{content:"î¬¾"}.codicon-repo-force-push:before{content:"î¬¿"}.codicon-repo-pull:before{content:"î­€"}.codicon-repo-push:before{content:"î­�"}.codicon-report:before{content:"î­‚"}.codicon-request-changes:before{content:"î­ƒ"}.codicon-rocket:before{content:"î­„"}.codicon-root-folder-opened:before{content:"î­…"}.codicon-root-folder:before{content:"î­†"}.codicon-rss:before{content:"î­‡"}.codicon-ruby:before{content:"î­ˆ"}.codicon-save-all:before{content:"î­‰"}.codicon-save-as:before{content:"î­Š"}.codicon-save:before{content:"î­‹"}.codicon-screen-full:before{content:"î­Œ"}.codicon-screen-normal:before{content:"î­�"}.codicon-search-stop:before{content:"î­Ž"}.codicon-server:before{content:"î­�"}.codicon-settings-gear:before{content:"î­‘"}.codicon-settings:before{content:"î­’"}.codicon-shield:before{content:"î­“"}.codicon-smiley:before{content:"î­”"}.codicon-sort-precedence:before{content:"î­•"}.codicon-split-horizontal:before{content:"î­–"}.codicon-split-vertical:before{content:"î­—"}.codicon-squirrel:before{content:"î­˜"}.codicon-star-full:before{content:"î­™"}.codicon-star-half:before{content:"î­š"}.codicon-symbol-class:before{content:"î­›"}.codicon-symbol-color:before{content:"î­œ"}.codicon-symbol-constant:before{content:"î­�"}.codicon-symbol-enum-member:before{content:"î­ž"}.codicon-symbol-field:before{content:"î­Ÿ"}.codicon-symbol-file:before{content:"î­ "}.codicon-symbol-interface:before{content:"î­¡"}.codicon-symbol-keyword:before{content:"î­¢"}.codicon-symbol-misc:before{content:"î­£"}.codicon-symbol-operator:before{content:"î­¤"}.codicon-symbol-property:before{content:"î­¥"}.codicon-wrench:before{content:"î­¥"}.codicon-wrench-subaction:before{content:"î­¥"}.codicon-symbol-snippet:before{content:"î­¦"}.codicon-tasklist:before{content:"î­§"}.codicon-telescope:before{content:"î­¨"}.codicon-text-size:before{content:"î­©"}.codicon-three-bars:before{content:"î­ª"}.codicon-thumbsdown:before{content:"î­«"}.codicon-thumbsup:before{content:"î­¬"}.codicon-tools:before{content:"î­­"}.codicon-triangle-down:before{content:"î­®"}.codicon-triangle-left:before{content:"î­¯"}.codicon-triangle-right:before{content:"î­°"}.codicon-triangle-up:before{content:"î­±"}.codicon-twitter:before{content:"î­²"}.codicon-unfold:before{content:"î­³"}.codicon-unlock:before{content:"î­´"}.codicon-unmute:before{content:"î­µ"}.codicon-unverified:before{content:"î­¶"}.codicon-verified:before{content:"î­·"}.codicon-versions:before{content:"î­¸"}.codicon-vm-active:before{content:"î­¹"}.codicon-vm-outline:before{content:"î­º"}.codicon-vm-running:before{content:"î­»"}.codicon-watch:before{content:"î­¼"}.codicon-whitespace:before{content:"î­½"}.codicon-whole-word:before{content:"î­¾"}.codicon-window:before{content:"î­¿"}.codicon-word-wrap:before{content:"î®€"}.codicon-zoom-in:before{content:"î®�"}.codicon-zoom-out:before{content:"î®‚"}.codicon-list-filter:before{content:"î®ƒ"}.codicon-list-flat:before{content:"î®„"}.codicon-list-selection:before{content:"î®…"}.codicon-selection:before{content:"î®…"}.codicon-list-tree:before{content:"î®†"}.codicon-debug-breakpoint-function-unverified:before{content:"î®‡"}.codicon-debug-breakpoint-function:before{content:"î®ˆ"}.codicon-debug-breakpoint-function-disabled:before{content:"î®ˆ"}.codicon-debug-stackframe-active:before{content:"î®‰"}.codicon-circle-small-filled:before{content:"î®Š"}.codicon-debug-stackframe-dot:before{content:"î®Š"}.codicon-terminal-decoration-mark:before{content:"î®Š"}.codicon-debug-stackframe:before{content:"î®‹"}.codicon-debug-stackframe-focused:before{content:"î®‹"}.codicon-debug-breakpoint-unsupported:before{content:"î®Œ"}.codicon-symbol-string:before{content:"î®�"}.codicon-debug-reverse-continue:before{content:"î®Ž"}.codicon-debug-step-back:before{content:"î®�"}.codicon-debug-restart-frame:before{content:"î®�"}.codicon-debug-alt:before{content:"î®‘"}.codicon-call-incoming:before{content:"î®’"}.codicon-call-outgoing:before{content:"î®“"}.codicon-menu:before{content:"î®”"}.codicon-expand-all:before{content:"î®•"}.codicon-feedback:before{content:"î®–"}.codicon-git-pull-request-reviewer:before{content:"î®–"}.codicon-group-by-ref-type:before{content:"î®—"}.codicon-ungroup-by-ref-type:before{content:"î®˜"}.codicon-account:before{content:"î®™"}.codicon-git-pull-request-assignee:before{content:"î®™"}.codicon-bell-dot:before{content:"î®š"}.codicon-debug-console:before{content:"î®›"}.codicon-library:before{content:"î®œ"}.codicon-output:before{content:"î®�"}.codicon-run-all:before{content:"î®ž"}.codicon-sync-ignored:before{content:"î®Ÿ"}.codicon-pinned:before{content:"î® "}.codicon-github-inverted:before{content:"î®¡"}.codicon-server-process:before{content:"î®¢"}.codicon-server-environment:before{content:"î®£"}.codicon-pass:before{content:"î®¤"}.codicon-issue-closed:before{content:"î®¤"}.codicon-stop-circle:before{content:"î®¥"}.codicon-play-circle:before{content:"î®¦"}.codicon-record:before{content:"î®§"}.codicon-debug-alt-small:before{content:"î®¨"}.codicon-vm-connect:before{content:"î®©"}.codicon-cloud:before{content:"î®ª"}.codicon-merge:before{content:"î®«"}.codicon-export:before{content:"î®¬"}.codicon-graph-left:before{content:"î®­"}.codicon-magnet:before{content:"î®®"}.codicon-notebook:before{content:"î®¯"}.codicon-redo:before{content:"î®°"}.codicon-check-all:before{content:"î®±"}.codicon-pinned-dirty:before{content:"î®²"}.codicon-pass-filled:before{content:"î®³"}.codicon-circle-large-filled:before{content:"î®´"}.codicon-circle-large:before{content:"î®µ"}.codicon-circle-large-outline:before{content:"î®µ"}.codicon-combine:before{content:"î®¶"}.codicon-gather:before{content:"î®¶"}.codicon-table:before{content:"î®·"}.codicon-variable-group:before{content:"î®¸"}.codicon-type-hierarchy:before{content:"î®¹"}.codicon-type-hierarchy-sub:before{content:"î®º"}.codicon-type-hierarchy-super:before{content:"î®»"}.codicon-git-pull-request-create:before{content:"î®¼"}.codicon-run-above:before{content:"î®½"}.codicon-run-below:before{content:"î®¾"}.codicon-notebook-template:before{content:"î®¿"}.codicon-debug-rerun:before{content:"î¯€"}.codicon-workspace-trusted:before{content:"î¯�"}.codicon-workspace-untrusted:before{content:"î¯‚"}.codicon-workspace-unknown:before{content:"î¯ƒ"}.codicon-terminal-cmd:before{content:"î¯„"}.codicon-terminal-debian:before{content:"î¯…"}.codicon-terminal-linux:before{content:"î¯†"}.codicon-terminal-powershell:before{content:"î¯‡"}.codicon-terminal-tmux:before{content:"î¯ˆ"}.codicon-terminal-ubuntu:before{content:"î¯‰"}.codicon-terminal-bash:before{content:"î¯Š"}.codicon-arrow-swap:before{content:"î¯‹"}.codicon-copy:before{content:"î¯Œ"}.codicon-person-add:before{content:"î¯�"}.codicon-filter-filled:before{content:"î¯Ž"}.codicon-wand:before{content:"î¯�"}.codicon-debug-line-by-line:before{content:"î¯�"}.codicon-inspect:before{content:"î¯‘"}.codicon-layers:before{content:"î¯’"}.codicon-layers-dot:before{content:"î¯“"}.codicon-layers-active:before{content:"î¯”"}.codicon-compass:before{content:"î¯•"}.codicon-compass-dot:before{content:"î¯–"}.codicon-compass-active:before{content:"î¯—"}.codicon-azure:before{content:"î¯˜"}.codicon-issue-draft:before{content:"î¯™"}.codicon-git-pull-request-closed:before{content:"î¯š"}.codicon-git-pull-request-draft:before{content:"î¯›"}.codicon-debug-all:before{content:"î¯œ"}.codicon-debug-coverage:before{content:"î¯�"}.codicon-run-errors:before{content:"î¯ž"}.codicon-folder-library:before{content:"î¯Ÿ"}.codicon-debug-continue-small:before{content:"î¯ "}.codicon-beaker-stop:before{content:"î¯¡"}.codicon-graph-line:before{content:"î¯¢"}.codicon-graph-scatter:before{content:"î¯£"}.codicon-pie-chart:before{content:"î¯¤"}.codicon-bracket:before{content:"î¬�"}.codicon-bracket-dot:before{content:"î¯¥"}.codicon-bracket-error:before{content:"î¯¦"}.codicon-lock-small:before{content:"î¯§"}.codicon-azure-devops:before{content:"î¯¨"}.codicon-verified-filled:before{content:"î¯©"}.codicon-newline:before{content:"î¯ª"}.codicon-layout:before{content:"î¯«"}.codicon-layout-activitybar-left:before{content:"î¯¬"}.codicon-layout-activitybar-right:before{content:"î¯­"}.codicon-layout-panel-left:before{content:"î¯®"}.codicon-layout-panel-center:before{content:"î¯¯"}.codicon-layout-panel-justify:before{content:"î¯°"}.codicon-layout-panel-right:before{content:"î¯±"}.codicon-layout-panel:before{content:"î¯²"}.codicon-layout-sidebar-left:before{content:"î¯³"}.codicon-layout-sidebar-right:before{content:"î¯´"}.codicon-layout-statusbar:before{content:"î¯µ"}.codicon-layout-menubar:before{content:"î¯¶"}.codicon-layout-centered:before{content:"î¯·"}.codicon-target:before{content:"î¯¸"}.codicon-indent:before{content:"î¯¹"}.codicon-record-small:before{content:"î¯º"}.codicon-error-small:before{content:"î¯»"}.codicon-terminal-decoration-error:before{content:"î¯»"}.codicon-arrow-circle-down:before{content:"î¯¼"}.codicon-arrow-circle-left:before{content:"î¯½"}.codicon-arrow-circle-right:before{content:"î¯¾"}.codicon-arrow-circle-up:before{content:"î¯¿"}.codicon-layout-sidebar-right-off:before{content:"î°€"}.codicon-layout-panel-off:before{content:"î°�"}.codicon-layout-sidebar-left-off:before{content:"î°‚"}.codicon-blank:before{content:"î°ƒ"}.codicon-heart-filled:before{content:"î°„"}.codicon-map:before{content:"î°…"}.codicon-map-horizontal:before{content:"î°…"}.codicon-fold-horizontal:before{content:"î°…"}.codicon-map-filled:before{content:"î°†"}.codicon-map-horizontal-filled:before{content:"î°†"}.codicon-fold-horizontal-filled:before{content:"î°†"}.codicon-circle-small:before{content:"î°‡"}.codicon-bell-slash:before{content:"î°ˆ"}.codicon-bell-slash-dot:before{content:"î°‰"}.codicon-comment-unresolved:before{content:"î°Š"}.codicon-git-pull-request-go-to-changes:before{content:"î°‹"}.codicon-git-pull-request-new-changes:before{content:"î°Œ"}.codicon-search-fuzzy:before{content:"î°�"}.codicon-comment-draft:before{content:"î°Ž"}.codicon-send:before{content:"î°�"}.codicon-sparkle:before{content:"î°�"}.codicon-insert:before{content:"î°‘"}.codicon-mic:before{content:"î°’"}.codicon-thumbsdown-filled:before{content:"î°“"}.codicon-thumbsup-filled:before{content:"î°”"}.codicon-coffee:before{content:"î°•"}.codicon-snake:before{content:"î°–"}.codicon-game:before{content:"î°—"}.codicon-vr:before{content:"î°˜"}.codicon-chip:before{content:"î°™"}.codicon-piano:before{content:"î°š"}.codicon-music:before{content:"î°›"}.codicon-mic-filled:before{content:"î°œ"}.codicon-repo-fetch:before{content:"î°�"}.codicon-copilot:before{content:"î°ž"}.codicon-lightbulb-sparkle:before{content:"î°Ÿ"}.codicon-robot:before{content:"î° "}.codicon-sparkle-filled:before{content:"î°¡"}.codicon-diff-single:before{content:"î°¢"}.codicon-diff-multiple:before{content:"î°£"}.codicon-surround-with:before{content:"î°¤"}.codicon-share:before{content:"î°¥"}.codicon-git-stash:before{content:"î°¦"}.codicon-git-stash-apply:before{content:"î°§"}.codicon-git-stash-pop:before{content:"î°¨"}.codicon-vscode:before{content:"î°©"}.codicon-vscode-insiders:before{content:"î°ª"}.codicon-code-oss:before{content:"î°«"}.codicon-run-coverage:before{content:"î°¬"}.codicon-run-all-coverage:before{content:"î°­"}.codicon-coverage:before{content:"î°®"}.codicon-github-project:before{content:"î°¯"}.codicon-map-vertical:before{content:"î°°"}.codicon-fold-vertical:before{content:"î°°"}.codicon-map-vertical-filled:before{content:"î°±"}.codicon-fold-vertical-filled:before{content:"î°±"}.codicon-go-to-search:before{content:"î°²"}.codicon-percentage:before{content:"î°³"}.codicon-sort-percentage:before{content:"î°³"}.codicon-attach:before{content:"î°´"}.codicon-git-fetch:before{content:"ï„�"}.split-view{display:flex;flex:auto;position:relative}.split-view.vertical{flex-direction:column}.split-view.vertical.sidebar-first{flex-direction:column-reverse}.split-view.horizontal{flex-direction:row}.split-view.horizontal.sidebar-first{flex-direction:row-reverse}.split-view-main{display:flex;flex:auto}.split-view-sidebar{display:flex;flex:none}.split-view.vertical:not(.sidebar-first)>.split-view-sidebar{border-top:1px solid var(--vscode-panel-border)}.split-view.horizontal:not(.sidebar-first)>.split-view-sidebar{border-left:1px solid var(--vscode-panel-border)}.split-view.vertical.sidebar-first>.split-view-sidebar{border-bottom:1px solid var(--vscode-panel-border)}.split-view.horizontal.sidebar-first>.split-view-sidebar{border-right:1px solid var(--vscode-panel-border)}.split-view-resizer{position:absolute;z-index:100}.split-view.vertical>.split-view-resizer{left:0;right:0;height:12px;cursor:ns-resize}.split-view.horizontal>.split-view-resizer{top:0;bottom:0;width:12px;cursor:ew-resize}.action-title>.hbox{align-items:center}.action-title-line{display:block;overflow:hidden;text-overflow:ellipsis}.action-title-selector{text-overflow:ellipsis;overflow:hidden;color:var(--vscode-tab-inactiveForeground);margin-top:-8px}.action-title-method{white-space:pre;overflow:hidden;text-overflow:ellipsis;font-weight:500}.action-title-param{color:var(--vscode-editorBracketHighlight-foreground1)}.action-location{display:flex;flex:none;margin:0 4px;color:var(--vscode-foreground)}.action-location>span{margin:0 4px;cursor:pointer;text-decoration:underline}.action-duration{display:flex;flex:none;align-items:center;margin:0 4px;color:var(--vscode-editorCodeLens-foreground)}.action-skipped{margin-right:4px}.action-icon{flex:none;display:flex;align-items:center;padding-right:3px}.action-icons{flex:none;display:flex;flex-direction:row;cursor:pointer;height:20px;position:relative;top:1px;border-bottom:1px solid transparent}.action-icons:hover{border-bottom:1px solid var(--vscode-sideBarTitle-foreground)}.action-error{color:var(--vscode-errorForeground);position:relative;margin-right:2px;flex:none}.action-parameter{display:inline;flex:none;padding-left:5px}.action-locator-parameter{color:var(--vscode-charts-orange)}.action-generic-parameter{color:var(--vscode-charts-purple)}.action-url{display:inline;flex:none;padding-left:5px;color:var(--vscode-charts-blue)}.action-list-show-all{display:flex;cursor:pointer;height:28px;align-items:center}.action-list-container{min-height:0;flex:auto;display:flex;flex-direction:column}.tree-view-content{display:flex;flex-direction:column;flex:auto;position:relative;-webkit-user-select:none;user-select:none;overflow:hidden auto;outline:1px solid transparent}.tree-view-entry{display:flex;flex:none;cursor:pointer;align-items:center;white-space:nowrap;line-height:28px;padding-left:5px}.tree-view-content.not-selectable>.tree-view-entry{cursor:inherit}.tree-view-entry.highlighted:not(.selected){background-color:var(--vscode-list-inactiveSelectionBackground)!important}.tree-view-entry.selected{z-index:10}.tree-view-indent{min-width:16px}.tree-view-content:focus .tree-view-entry.selected{background-color:var(--vscode-list-activeSelectionBackground);color:var(--vscode-list-activeSelectionForeground);outline:1px solid var(--vscode-focusBorder)}.tree-view-content .tree-view-entry.selected{background-color:var(--vscode-list-inactiveSelectionBackground)}.tree-view-content:focus .tree-view-entry.selected *{color:var(--vscode-list-activeSelectionForeground)!important;background-color:transparent!important}.tree-view-content:focus .tree-view-entry.selected .codicon{color:var(--vscode-list-activeSelectionForeground)!important}.tree-view-content:focus .tree-view-entry.selected button.eye.toggled{border-radius:6px;outline:1px solid var(--vscode-button-foreground)}.tree-view-empty{flex:auto;display:flex;align-items:center;justify-content:center}.tree-view-entry.error{color:var(--vscode-list-errorForeground);background-color:var(--vscode-inputValidation-errorBackground)}.tree-view-entry.warning{color:var(--vscode-list-warningForeground);background-color:var(--vscode-inputValidation-warningBackground)}.tree-view-entry.info{background-color:var(--vscode-inputValidation-infoBackground)}.toolbar-button{position:relative;flex:none;border:none;outline:none;color:var(--vscode-sideBarTitle-foreground);background:transparent;padding:4px;cursor:pointer;display:inline-flex;align-items:center;border-radius:4px}.toolbar-button:disabled{color:var(--vscode-disabledForeground)!important;cursor:default}.toolbar-button:not(:disabled):hover{background-color:var(--vscode-toolbar-hoverBackground)}.toolbar-button:not(:disabled):active{background-color:var(--vscode-toolbar-activeBackground)}.toolbar-button.toggled{color:var(--vscode-notificationLink-foreground)}.toolbar-button-error-badge{position:absolute;top:2px;right:2px;width:7px;height:7px;border-radius:50%;background-color:var(--vscode-notificationsErrorIcon-foreground)}.toolbar-separator{flex:none;background-color:var(--vscode-menu-separatorBackground);width:1px;padding:0;margin:5px 4px;height:16px}.call-tab{flex:auto;line-height:24px;white-space:pre;overflow:auto;-webkit-user-select:text;user-select:text}.call-error{border-bottom:1px solid var(--vscode-panel-border);padding:3px 0 3px 12px}.call-error .codicon{color:var(--vscode-errorForeground);position:relative;top:2px;margin-right:2px}.call-section{padding-left:6px;padding-top:2px;margin-top:2px;font-weight:700;text-transform:uppercase;font-size:10px;color:var(--vscode-sideBarTitle-foreground);line-height:24px}.call-section:not(:first-child){border-top:1px solid var(--vscode-panel-border)}.call-line{padding:4px 0 4px 6px;display:flex;align-items:center;text-overflow:ellipsis;overflow:hidden;line-height:20px;white-space:nowrap}.call-line:not(:hover) .toolbar-button.copy{display:none}.call-line .toolbar-button.copy,.call-line .toolbar-button.check{margin-left:5px;margin-top:-2px;margin-bottom:-2px}.call-value{margin-left:2px;text-overflow:ellipsis;overflow:hidden}a.call-value{text-decoration:none}a.call-value:hover{text-decoration:underline}.call-value:before{content:"Â "}.call-value.datetime,.call-value.string,.call-value.literal,.call-value.locator{color:var(--vscode-charts-orange)}.call-value.number,.call-value.bigint,.call-value.boolean,.call-value.symbol,.call-value.undefined,.call-value.function,.call-value.object{color:var(--vscode-charts-blue)}.call-tab .error-message{padding:5px;line-height:17px}.copy-to-clipboard-text-button{background-color:var(--vscode-editor-inactiveSelectionBackground);border:none;padding:4px 12px;cursor:pointer}.list-view-content{display:flex;flex-direction:column;flex:auto;position:relative;-webkit-user-select:none;user-select:none;overflow:hidden auto;outline:1px solid transparent}.list-view-entry{display:flex;flex:none;cursor:pointer;align-items:center;white-space:nowrap;line-height:28px;padding-left:5px}.list-view-content.not-selectable>.list-view-entry{cursor:inherit}.list-view-entry.highlighted:not(.selected){background-color:var(--vscode-list-inactiveSelectionBackground)!important}.list-view-entry.selected{z-index:10}.list-view-indent{min-width:16px}.list-view-content:focus .list-view-entry.selected{background-color:var(--vscode-list-activeSelectionBackground);color:var(--vscode-list-activeSelectionForeground);outline:1px solid var(--vscode-focusBorder)}.list-view-content .list-view-entry.selected{background-color:var(--vscode-list-inactiveSelectionBackground)}.list-view-content:focus .list-view-entry.selected *{color:var(--vscode-list-activeSelectionForeground)!important;background-color:transparent!important}.list-view-content:focus .list-view-entry.selected .codicon{color:var(--vscode-list-activeSelectionForeground)!important}.list-view-empty{flex:auto;display:flex;align-items:center;justify-content:center}.list-view-entry.error{color:var(--vscode-list-errorForeground);background-color:var(--vscode-inputValidation-errorBackground)}.list-view-entry.warning{color:var(--vscode-list-warningForeground);background-color:var(--vscode-inputValidation-warningBackground)}.list-view-entry.info{background-color:var(--vscode-inputValidation-infoBackground)}.log-list-duration{display:flex;flex:none;align-items:center;color:var(--vscode-editorCodeLens-foreground);float:right;margin-right:5px;-webkit-user-select:none;user-select:none}.log-list-item{text-wrap:wrap;-webkit-user-select:text;user-select:text;width:100%}.error-message{font-family:var(--vscode-editor-font-family);font-weight:var(--vscode-editor-font-weight);font-size:var(--vscode-editor-font-size);white-space:pre-wrap;word-break:break-word;padding:10px}.attachments-tab{flex:auto;line-height:24px;white-space:pre;overflow:auto;-webkit-user-select:text;user-select:text}.attachments-section{padding-left:6px;font-weight:700;text-transform:uppercase;font-size:12px;color:var(--vscode-sideBarTitle-foreground);line-height:24px}.attachments-section:not(:first-child){border-top:1px solid var(--vscode-panel-border);margin-top:10px}.attachment-item{margin:4px 8px}.attachment-title-highlight{text-decoration:underline var(--vscode-terminal-findMatchBackground);text-decoration-thickness:1.5px}.attachment-item img{flex:none;min-width:200px;max-width:80%;box-shadow:0 12px 28px #0003,0 2px 4px #0000001a}a.codicon-cloud-download:hover{background-color:var(--vscode-list-inactiveSelectionBackground)}.yellow-flash{animation:yellowflash-bg 2s}@keyframes yellowflash-bg{0%{background:var(--vscode-peekViewEditor-matchHighlightBackground)}to{background:transparent}}:root{--vscode-font-family: system-ui, "Ubuntu", "Droid Sans", sans-serif;--vscode-font-weight: normal;--vscode-font-size: 13px;--vscode-editor-font-family: "Droid Sans Mono", "monospace", monospace;--vscode-editor-font-weight: normal;--vscode-editor-font-size: 14px;--vscode-foreground: #616161;--vscode-disabledForeground: rgba(97, 97, 97, .5);--vscode-errorForeground: #a1260d;--vscode-descriptionForeground: #717171;--vscode-icon-foreground: #424242;--vscode-focusBorder: #0090f1;--vscode-textSeparator-foreground: rgba(0, 0, 0, .18);--vscode-textLink-foreground: #006ab1;--vscode-textLink-activeForeground: #006ab1;--vscode-textPreformat-foreground: #a31515;--vscode-textBlockQuote-background: rgba(127, 127, 127, .1);--vscode-textBlockQuote-border: rgba(0, 122, 204, .5);--vscode-textCodeBlock-background: rgba(220, 220, 220, .4);--vscode-widget-shadow: rgba(0, 0, 0, .16);--vscode-input-background: #ffffff;--vscode-input-foreground: #616161;--vscode-inputOption-activeBorder: #007acc;--vscode-inputOption-hoverBackground: rgba(184, 184, 184, .31);--vscode-inputOption-activeBackground: rgba(0, 144, 241, .2);--vscode-inputOption-activeForeground: #000000;--vscode-input-placeholderForeground: #767676;--vscode-inputValidation-infoBackground: #d6ecf2;--vscode-inputValidation-infoBorder: #007acc;--vscode-inputValidation-warningBackground: #f6f5d2;--vscode-inputValidation-warningBorder: #b89500;--vscode-inputValidation-errorBackground: #f2dede;--vscode-inputValidation-errorBorder: #be1100;--vscode-dropdown-background: #ffffff;--vscode-dropdown-border: #cecece;--vscode-checkbox-background: #ffffff;--vscode-checkbox-border: #cecece;--vscode-button-foreground: #ffffff;--vscode-button-separator: rgba(255, 255, 255, .4);--vscode-button-background: #007acc;--vscode-button-hoverBackground: #0062a3;--vscode-button-secondaryForeground: #ffffff;--vscode-button-secondaryBackground: #5f6a79;--vscode-button-secondaryHoverBackground: #4c5561;--vscode-badge-background: #c4c4c4;--vscode-badge-foreground: #333333;--vscode-scrollbar-shadow: #dddddd;--vscode-scrollbarSlider-background: rgba(100, 100, 100, .4);--vscode-scrollbarSlider-hoverBackground: rgba(100, 100, 100, .7);--vscode-scrollbarSlider-activeBackground: rgba(0, 0, 0, .6);--vscode-progressBar-background: #0e70c0;--vscode-editorError-foreground: #e51400;--vscode-editorWarning-foreground: #bf8803;--vscode-editorInfo-foreground: #1a85ff;--vscode-editorHint-foreground: #6c6c6c;--vscode-sash-hoverBorder: #0090f1;--vscode-editor-background: #ffffff;--vscode-editor-foreground: #000000;--vscode-editorStickyScroll-background: #ffffff;--vscode-editorStickyScrollHover-background: #f0f0f0;--vscode-editorWidget-background: #f3f3f3;--vscode-editorWidget-foreground: #616161;--vscode-editorWidget-border: #c8c8c8;--vscode-quickInput-background: #f3f3f3;--vscode-quickInput-foreground: #616161;--vscode-quickInputTitle-background: rgba(0, 0, 0, .06);--vscode-pickerGroup-foreground: #0066bf;--vscode-pickerGroup-border: #cccedb;--vscode-keybindingLabel-background: rgba(221, 221, 221, .4);--vscode-keybindingLabel-foreground: #555555;--vscode-keybindingLabel-border: rgba(204, 204, 204, .4);--vscode-keybindingLabel-bottomBorder: rgba(187, 187, 187, .4);--vscode-editor-selectionBackground: #add6ff;--vscode-editor-inactiveSelectionBackground: #e5ebf1;--vscode-editor-selectionHighlightBackground: rgba(173, 214, 255, .5);--vscode-editor-findMatchBackground: #a8ac94;--vscode-editor-findMatchHighlightBackground: rgba(234, 92, 0, .33);--vscode-editor-findRangeHighlightBackground: rgba(180, 180, 180, .3);--vscode-searchEditor-findMatchBackground: rgba(234, 92, 0, .22);--vscode-editor-hoverHighlightBackground: rgba(173, 214, 255, .15);--vscode-editorHoverWidget-background: #f3f3f3;--vscode-editorHoverWidget-foreground: #616161;--vscode-editorHoverWidget-border: #c8c8c8;--vscode-editorHoverWidget-statusBarBackground: #e7e7e7;--vscode-editorLink-activeForeground: #0000ff;--vscode-editorInlayHint-foreground: rgba(51, 51, 51, .8);--vscode-editorInlayHint-background: rgba(196, 196, 196, .3);--vscode-editorInlayHint-typeForeground: rgba(51, 51, 51, .8);--vscode-editorInlayHint-typeBackground: rgba(196, 196, 196, .3);--vscode-editorInlayHint-parameterForeground: rgba(51, 51, 51, .8);--vscode-editorInlayHint-parameterBackground: rgba(196, 196, 196, .3);--vscode-editorLightBulb-foreground: #ddb100;--vscode-editorLightBulbAutoFix-foreground: #007acc;--vscode-diffEditor-insertedTextBackground: rgba(156, 204, 44, .4);--vscode-diffEditor-removedTextBackground: rgba(255, 0, 0, .3);--vscode-diffEditor-insertedLineBackground: rgba(155, 185, 85, .2);--vscode-diffEditor-removedLineBackground: rgba(255, 0, 0, .2);--vscode-diffEditor-diagonalFill: rgba(34, 34, 34, .2);--vscode-list-focusOutline: #0090f1;--vscode-list-focusAndSelectionOutline: #90c2f9;--vscode-list-activeSelectionBackground: #0060c0;--vscode-list-activeSelectionForeground: #ffffff;--vscode-list-activeSelectionIconForeground: #ffffff;--vscode-list-inactiveSelectionBackground: #e4e6f1;--vscode-list-hoverBackground: #e8e8e8;--vscode-list-dropBackground: #d6ebff;--vscode-list-highlightForeground: #0066bf;--vscode-list-focusHighlightForeground: #bbe7ff;--vscode-list-invalidItemForeground: #b89500;--vscode-list-errorForeground: #b01011;--vscode-list-warningForeground: #855f00;--vscode-listFilterWidget-background: #f3f3f3;--vscode-listFilterWidget-outline: rgba(0, 0, 0, 0);--vscode-listFilterWidget-noMatchesOutline: #be1100;--vscode-listFilterWidget-shadow: rgba(0, 0, 0, .16);--vscode-list-filterMatchBackground: rgba(234, 92, 0, .33);--vscode-tree-indentGuidesStroke: #a9a9a9;--vscode-tree-tableColumnsBorder: rgba(97, 97, 97, .13);--vscode-tree-tableOddRowsBackground: rgba(97, 97, 97, .04);--vscode-list-deemphasizedForeground: #8e8e90;--vscode-quickInputList-focusForeground: #ffffff;--vscode-quickInputList-focusIconForeground: #ffffff;--vscode-quickInputList-focusBackground: #0060c0;--vscode-menu-foreground: #616161;--vscode-menu-background: #ffffff;--vscode-menu-selectionForeground: #ffffff;--vscode-menu-selectionBackground: #0060c0;--vscode-menu-separatorBackground: #d4d4d4;--vscode-toolbar-hoverBackground: rgba(184, 184, 184, .31);--vscode-toolbar-activeBackground: rgba(166, 166, 166, .31);--vscode-editor-snippetTabstopHighlightBackground: rgba(10, 50, 100, .2);--vscode-editor-snippetFinalTabstopHighlightBorder: rgba(10, 50, 100, .5);--vscode-breadcrumb-foreground: rgba(97, 97, 97, .8);--vscode-breadcrumb-background: #ffffff;--vscode-breadcrumb-focusForeground: #4e4e4e;--vscode-breadcrumb-activeSelectionForeground: #4e4e4e;--vscode-breadcrumbPicker-background: #f3f3f3;--vscode-merge-currentHeaderBackground: rgba(64, 200, 174, .5);--vscode-merge-currentContentBackground: rgba(64, 200, 174, .2);--vscode-merge-incomingHeaderBackground: rgba(64, 166, 255, .5);--vscode-merge-incomingContentBackground: rgba(64, 166, 255, .2);--vscode-merge-commonHeaderBackground: rgba(96, 96, 96, .4);--vscode-merge-commonContentBackground: rgba(96, 96, 96, .16);--vscode-editorOverviewRuler-currentContentForeground: rgba(64, 200, 174, .5);--vscode-editorOverviewRuler-incomingContentForeground: rgba(64, 166, 255, .5);--vscode-editorOverviewRuler-commonContentForeground: rgba(96, 96, 96, .4);--vscode-editorOverviewRuler-findMatchForeground: rgba(209, 134, 22, .49);--vscode-editorOverviewRuler-selectionHighlightForeground: rgba(160, 160, 160, .8);--vscode-minimap-findMatchHighlight: #d18616;--vscode-minimap-selectionOccurrenceHighlight: #c9c9c9;--vscode-minimap-selectionHighlight: #add6ff;--vscode-minimap-errorHighlight: rgba(255, 18, 18, .7);--vscode-minimap-warningHighlight: #bf8803;--vscode-minimap-foregroundOpacity: #000000;--vscode-minimapSlider-background: rgba(100, 100, 100, .2);--vscode-minimapSlider-hoverBackground: rgba(100, 100, 100, .35);--vscode-minimapSlider-activeBackground: rgba(0, 0, 0, .3);--vscode-problemsErrorIcon-foreground: #e51400;--vscode-problemsWarningIcon-foreground: #bf8803;--vscode-problemsInfoIcon-foreground: #1a85ff;--vscode-charts-foreground: #616161;--vscode-charts-lines: rgba(97, 97, 97, .5);--vscode-charts-red: #e51400;--vscode-charts-blue: #1a85ff;--vscode-charts-yellow: #bf8803;--vscode-charts-orange: #d18616;--vscode-charts-green: #388a34;--vscode-charts-purple: #652d90;--vscode-editor-lineHighlightBorder: #eeeeee;--vscode-editor-rangeHighlightBackground: rgba(253, 255, 0, .2);--vscode-editor-symbolHighlightBackground: rgba(234, 92, 0, .33);--vscode-editorCursor-foreground: #000000;--vscode-editorWhitespace-foreground: rgba(51, 51, 51, .2);--vscode-editorIndentGuide-background: #d3d3d3;--vscode-editorIndentGuide-activeBackground: #939393;--vscode-editorLineNumber-foreground: #237893;--vscode-editorActiveLineNumber-foreground: #0b216f;--vscode-editorLineNumber-activeForeground: #0b216f;--vscode-editorRuler-foreground: #d3d3d3;--vscode-editorCodeLens-foreground: #919191;--vscode-editorBracketMatch-background: rgba(0, 100, 0, .1);--vscode-editorBracketMatch-border: #b9b9b9;--vscode-editorOverviewRuler-border: rgba(127, 127, 127, .3);--vscode-editorGutter-background: #ffffff;--vscode-editorUnnecessaryCode-opacity: rgba(0, 0, 0, .47);--vscode-editorGhostText-foreground: rgba(0, 0, 0, .47);--vscode-editorOverviewRuler-rangeHighlightForeground: rgba(0, 122, 204, .6);--vscode-editorOverviewRuler-errorForeground: rgba(255, 18, 18, .7);--vscode-editorOverviewRuler-warningForeground: #bf8803;--vscode-editorOverviewRuler-infoForeground: #1a85ff;--vscode-editorBracketHighlight-foreground1: #0431fa;--vscode-editorBracketHighlight-foreground2: #319331;--vscode-editorBracketHighlight-foreground3: #7b3814;--vscode-editorBracketHighlight-foreground4: rgba(0, 0, 0, 0);--vscode-editorBracketHighlight-foreground5: rgba(0, 0, 0, 0);--vscode-editorBracketHighlight-foreground6: rgba(0, 0, 0, 0);--vscode-editorBracketHighlight-unexpectedBracket\.foreground: rgba(255, 18, 18, .8);--vscode-editorBracketPairGuide-background1: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-background2: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-background3: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-background4: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-background5: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-background6: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-activeBackground1: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-activeBackground2: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-activeBackground3: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-activeBackground4: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-activeBackground5: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-activeBackground6: rgba(0, 0, 0, 0);--vscode-editorUnicodeHighlight-border: #cea33d;--vscode-editorUnicodeHighlight-background: rgba(206, 163, 61, .08);--vscode-symbolIcon-arrayForeground: #616161;--vscode-symbolIcon-booleanForeground: #616161;--vscode-symbolIcon-classForeground: #d67e00;--vscode-symbolIcon-colorForeground: #616161;--vscode-symbolIcon-constantForeground: #616161;--vscode-symbolIcon-constructorForeground: #652d90;--vscode-symbolIcon-enumeratorForeground: #d67e00;--vscode-symbolIcon-enumeratorMemberForeground: #007acc;--vscode-symbolIcon-eventForeground: #d67e00;--vscode-symbolIcon-fieldForeground: #007acc;--vscode-symbolIcon-fileForeground: #616161;--vscode-symbolIcon-folderForeground: #616161;--vscode-symbolIcon-functionForeground: #652d90;--vscode-symbolIcon-interfaceForeground: #007acc;--vscode-symbolIcon-keyForeground: #616161;--vscode-symbolIcon-keywordForeground: #616161;--vscode-symbolIcon-methodForeground: #652d90;--vscode-symbolIcon-moduleForeground: #616161;--vscode-symbolIcon-namespaceForeground: #616161;--vscode-symbolIcon-nullForeground: #616161;--vscode-symbolIcon-numberForeground: #616161;--vscode-symbolIcon-objectForeground: #616161;--vscode-symbolIcon-operatorForeground: #616161;--vscode-symbolIcon-packageForeground: #616161;--vscode-symbolIcon-propertyForeground: #616161;--vscode-symbolIcon-referenceForeground: #616161;--vscode-symbolIcon-snippetForeground: #616161;--vscode-symbolIcon-stringForeground: #616161;--vscode-symbolIcon-structForeground: #616161;--vscode-symbolIcon-textForeground: #616161;--vscode-symbolIcon-typeParameterForeground: #616161;--vscode-symbolIcon-unitForeground: #616161;--vscode-symbolIcon-variableForeground: #007acc;--vscode-editorHoverWidget-highlightForeground: #0066bf;--vscode-editorOverviewRuler-bracketMatchForeground: #a0a0a0;--vscode-editor-foldBackground: rgba(173, 214, 255, .3);--vscode-editorGutter-foldingControlForeground: #424242;--vscode-editor-linkedEditingBackground: rgba(255, 0, 0, .3);--vscode-editor-wordHighlightBackground: rgba(87, 87, 87, .25);--vscode-editor-wordHighlightStrongBackground: rgba(14, 99, 156, .25);--vscode-editorOverviewRuler-wordHighlightForeground: rgba(160, 160, 160, .8);--vscode-editorOverviewRuler-wordHighlightStrongForeground: rgba(192, 160, 192, .8);--vscode-peekViewTitle-background: rgba(26, 133, 255, .1);--vscode-peekViewTitleLabel-foreground: #000000;--vscode-peekViewTitleDescription-foreground: #616161;--vscode-peekView-border: #1a85ff;--vscode-peekViewResult-background: #f3f3f3;--vscode-peekViewResult-lineForeground: #646465;--vscode-peekViewResult-fileForeground: #1e1e1e;--vscode-peekViewResult-selectionBackground: rgba(51, 153, 255, .2);--vscode-peekViewResult-selectionForeground: #6c6c6c;--vscode-peekViewEditor-background: #f2f8fc;--vscode-peekViewEditorGutter-background: #f2f8fc;--vscode-peekViewResult-matchHighlightBackground: rgba(234, 92, 0, .3);--vscode-peekViewEditor-matchHighlightBackground: rgba(245, 216, 2, .87);--vscode-editorMarkerNavigationError-background: #e51400;--vscode-editorMarkerNavigationError-headerBackground: rgba(229, 20, 0, .1);--vscode-editorMarkerNavigationWarning-background: #bf8803;--vscode-editorMarkerNavigationWarning-headerBackground: rgba(191, 136, 3, .1);--vscode-editorMarkerNavigationInfo-background: #1a85ff;--vscode-editorMarkerNavigationInfo-headerBackground: rgba(26, 133, 255, .1);--vscode-editorMarkerNavigation-background: #ffffff;--vscode-editorSuggestWidget-background: #f3f3f3;--vscode-editorSuggestWidget-border: #c8c8c8;--vscode-editorSuggestWidget-foreground: #000000;--vscode-editorSuggestWidget-selectedForeground: #ffffff;--vscode-editorSuggestWidget-selectedIconForeground: #ffffff;--vscode-editorSuggestWidget-selectedBackground: #0060c0;--vscode-editorSuggestWidget-highlightForeground: #0066bf;--vscode-editorSuggestWidget-focusHighlightForeground: #bbe7ff;--vscode-editorSuggestWidgetStatus-foreground: rgba(0, 0, 0, .5);--vscode-tab-activeBackground: #ffffff;--vscode-tab-unfocusedActiveBackground: #ffffff;--vscode-tab-inactiveBackground: #ececec;--vscode-tab-unfocusedInactiveBackground: #ececec;--vscode-tab-activeForeground: #333333;--vscode-tab-inactiveForeground: rgba(51, 51, 51, .7);--vscode-tab-unfocusedActiveForeground: rgba(51, 51, 51, .7);--vscode-tab-unfocusedInactiveForeground: rgba(51, 51, 51, .35);--vscode-tab-border: #f3f3f3;--vscode-tab-lastPinnedBorder: rgba(97, 97, 97, .19);--vscode-tab-activeModifiedBorder: #33aaee;--vscode-tab-inactiveModifiedBorder: rgba(51, 170, 238, .5);--vscode-tab-unfocusedActiveModifiedBorder: rgba(51, 170, 238, .7);--vscode-tab-unfocusedInactiveModifiedBorder: rgba(51, 170, 238, .25);--vscode-editorPane-background: #ffffff;--vscode-editorGroupHeader-tabsBackground: #f3f3f3;--vscode-editorGroupHeader-noTabsBackground: #ffffff;--vscode-editorGroup-border: #e7e7e7;--vscode-editorGroup-dropBackground: rgba(38, 119, 203, .18);--vscode-editorGroup-dropIntoPromptForeground: #616161;--vscode-editorGroup-dropIntoPromptBackground: #f3f3f3;--vscode-sideBySideEditor-horizontalBorder: #e7e7e7;--vscode-sideBySideEditor-verticalBorder: #e7e7e7;--vscode-panel-background: #ffffff;--vscode-panel-border: rgba(128, 128, 128, .35);--vscode-panelTitle-activeForeground: #424242;--vscode-panelTitle-inactiveForeground: rgba(66, 66, 66, .75);--vscode-panelTitle-activeBorder: #424242;--vscode-panelInput-border: #dddddd;--vscode-panel-dropBorder: #424242;--vscode-panelSection-dropBackground: rgba(38, 119, 203, .18);--vscode-panelSectionHeader-background: rgba(128, 128, 128, .2);--vscode-panelSection-border: rgba(128, 128, 128, .35);--vscode-banner-background: #004386;--vscode-banner-foreground: #ffffff;--vscode-banner-iconForeground: #1a85ff;--vscode-statusBar-foreground: #ffffff;--vscode-statusBar-noFolderForeground: #ffffff;--vscode-statusBar-background: #007acc;--vscode-statusBar-noFolderBackground: #68217a;--vscode-statusBar-focusBorder: #ffffff;--vscode-statusBarItem-activeBackground: rgba(255, 255, 255, .18);--vscode-statusBarItem-focusBorder: #ffffff;--vscode-statusBarItem-hoverBackground: rgba(255, 255, 255, .12);--vscode-statusBarItem-compactHoverBackground: rgba(255, 255, 255, .2);--vscode-statusBarItem-prominentForeground: #ffffff;--vscode-statusBarItem-prominentBackground: rgba(0, 0, 0, .5);--vscode-statusBarItem-prominentHoverBackground: rgba(0, 0, 0, .3);--vscode-statusBarItem-errorBackground: #c72e0f;--vscode-statusBarItem-errorForeground: #ffffff;--vscode-statusBarItem-warningBackground: #725102;--vscode-statusBarItem-warningForeground: #ffffff;--vscode-activityBar-background: #2c2c2c;--vscode-activityBar-foreground: #ffffff;--vscode-activityBar-inactiveForeground: rgba(255, 255, 255, .4);--vscode-activityBar-activeBorder: #ffffff;--vscode-activityBar-dropBorder: #ffffff;--vscode-activityBarBadge-background: #007acc;--vscode-activityBarBadge-foreground: #ffffff;--vscode-statusBarItem-remoteBackground: #16825d;--vscode-statusBarItem-remoteForeground: #ffffff;--vscode-extensionBadge-remoteBackground: #007acc;--vscode-extensionBadge-remoteForeground: #ffffff;--vscode-sideBar-background: #f3f3f3;--vscode-sideBarTitle-foreground: #6f6f6f;--vscode-sideBar-dropBackground: rgba(38, 119, 203, .18);--vscode-sideBarSectionHeader-background: rgba(0, 0, 0, 0);--vscode-sideBarSectionHeader-border: rgba(97, 97, 97, .19);--vscode-titleBar-activeForeground: #333333;--vscode-titleBar-inactiveForeground: rgba(51, 51, 51, .6);--vscode-titleBar-activeBackground: #dddddd;--vscode-titleBar-inactiveBackground: rgba(221, 221, 221, .6);--vscode-menubar-selectionForeground: #333333;--vscode-menubar-selectionBackground: rgba(184, 184, 184, .31);--vscode-notifications-foreground: #616161;--vscode-notifications-background: #f3f3f3;--vscode-notificationLink-foreground: #006ab1;--vscode-notificationCenterHeader-background: #e7e7e7;--vscode-notifications-border: #e7e7e7;--vscode-notificationsErrorIcon-foreground: #e51400;--vscode-notificationsWarningIcon-foreground: #bf8803;--vscode-notificationsInfoIcon-foreground: #1a85ff;--vscode-commandCenter-foreground: #333333;--vscode-commandCenter-activeForeground: #333333;--vscode-commandCenter-activeBackground: rgba(184, 184, 184, .31);--vscode-commandCenter-border: rgba(128, 128, 128, .35);--vscode-editorCommentsWidget-resolvedBorder: rgba(97, 97, 97, .5);--vscode-editorCommentsWidget-unresolvedBorder: #1a85ff;--vscode-editorCommentsWidget-rangeBackground: rgba(26, 133, 255, .1);--vscode-editorCommentsWidget-rangeBorder: rgba(26, 133, 255, .4);--vscode-editorCommentsWidget-rangeActiveBackground: rgba(26, 133, 255, .1);--vscode-editorCommentsWidget-rangeActiveBorder: rgba(26, 133, 255, .4);--vscode-editorGutter-commentRangeForeground: #d5d8e9;--vscode-debugToolBar-background: #f3f3f3;--vscode-debugIcon-startForeground: #388a34;--vscode-editor-stackFrameHighlightBackground: rgba(255, 255, 102, .45);--vscode-editor-focusedStackFrameHighlightBackground: rgba(206, 231, 206, .45);--vscode-mergeEditor-change\.background: rgba(155, 185, 85, .2);--vscode-mergeEditor-change\.word\.background: rgba(156, 204, 44, .4);--vscode-mergeEditor-conflict\.unhandledUnfocused\.border: rgba(255, 166, 0, .48);--vscode-mergeEditor-conflict\.unhandledFocused\.border: #ffa600;--vscode-mergeEditor-conflict\.handledUnfocused\.border: rgba(134, 134, 134, .29);--vscode-mergeEditor-conflict\.handledFocused\.border: rgba(193, 193, 193, .8);--vscode-mergeEditor-conflict\.handled\.minimapOverViewRuler: rgba(173, 172, 168, .93);--vscode-mergeEditor-conflict\.unhandled\.minimapOverViewRuler: #fcba03;--vscode-mergeEditor-conflictingLines\.background: rgba(255, 234, 0, .28);--vscode-settings-headerForeground: #444444;--vscode-settings-modifiedItemIndicator: #66afe0;--vscode-settings-headerBorder: rgba(128, 128, 128, .35);--vscode-settings-sashBorder: rgba(128, 128, 128, .35);--vscode-settings-dropdownBackground: #ffffff;--vscode-settings-dropdownBorder: #cecece;--vscode-settings-dropdownListBorder: #c8c8c8;--vscode-settings-checkboxBackground: #ffffff;--vscode-settings-checkboxBorder: #cecece;--vscode-settings-textInputBackground: #ffffff;--vscode-settings-textInputForeground: #616161;--vscode-settings-textInputBorder: #cecece;--vscode-settings-numberInputBackground: #ffffff;--vscode-settings-numberInputForeground: #616161;--vscode-settings-numberInputBorder: #cecece;--vscode-settings-focusedRowBackground: rgba(232, 232, 232, .6);--vscode-settings-rowHoverBackground: rgba(232, 232, 232, .3);--vscode-settings-focusedRowBorder: rgba(0, 0, 0, .12);--vscode-terminal-foreground: #333333;--vscode-terminal-selectionBackground: #add6ff;--vscode-terminal-inactiveSelectionBackground: #e5ebf1;--vscode-terminalCommandDecoration-defaultBackground: rgba(0, 0, 0, .25);--vscode-terminalCommandDecoration-successBackground: #2090d3;--vscode-terminalCommandDecoration-errorBackground: #e51400;--vscode-terminalOverviewRuler-cursorForeground: rgba(160, 160, 160, .8);--vscode-terminal-border: rgba(128, 128, 128, .35);--vscode-terminal-findMatchBackground: #a8ac94;--vscode-terminal-findMatchHighlightBackground: rgba(234, 92, 0, .33);--vscode-terminalOverviewRuler-findMatchForeground: rgba(209, 134, 22, .49);--vscode-terminal-dropBackground: rgba(38, 119, 203, .18);--vscode-testing-iconFailed: #f14c4c;--vscode-testing-iconErrored: #f14c4c;--vscode-testing-iconPassed: #73c991;--vscode-testing-runAction: #73c991;--vscode-testing-iconQueued: #cca700;--vscode-testing-iconUnset: #848484;--vscode-testing-iconSkipped: #848484;--vscode-testing-peekBorder: #e51400;--vscode-testing-peekHeaderBackground: rgba(229, 20, 0, .1);--vscode-testing-message\.error\.decorationForeground: #e51400;--vscode-testing-message\.error\.lineBackground: rgba(255, 0, 0, .2);--vscode-testing-message\.info\.decorationForeground: rgba(0, 0, 0, .5);--vscode-welcomePage-tileBackground: #f3f3f3;--vscode-welcomePage-tileHoverBackground: #dbdbdb;--vscode-welcomePage-tileShadow: rgba(0, 0, 0, .16);--vscode-welcomePage-progress\.background: #ffffff;--vscode-welcomePage-progress\.foreground: #006ab1;--vscode-debugExceptionWidget-border: #a31515;--vscode-debugExceptionWidget-background: #f1dfde;--vscode-ports-iconRunningProcessForeground: #369432;--vscode-statusBar-debuggingBackground: #cc6633;--vscode-statusBar-debuggingForeground: #ffffff;--vscode-editor-inlineValuesForeground: rgba(0, 0, 0, .5);--vscode-editor-inlineValuesBackground: rgba(255, 200, 0, .2);--vscode-editorGutter-modifiedBackground: #2090d3;--vscode-editorGutter-addedBackground: #48985d;--vscode-editorGutter-deletedBackground: #e51400;--vscode-minimapGutter-modifiedBackground: #2090d3;--vscode-minimapGutter-addedBackground: #48985d;--vscode-minimapGutter-deletedBackground: #e51400;--vscode-editorOverviewRuler-modifiedForeground: rgba(32, 144, 211, .6);--vscode-editorOverviewRuler-addedForeground: rgba(72, 152, 93, .6);--vscode-editorOverviewRuler-deletedForeground: rgba(229, 20, 0, .6);--vscode-debugIcon-breakpointForeground: #e51400;--vscode-debugIcon-breakpointDisabledForeground: #848484;--vscode-debugIcon-breakpointUnverifiedForeground: #848484;--vscode-debugIcon-breakpointCurrentStackframeForeground: #be8700;--vscode-debugIcon-breakpointStackframeForeground: #89d185;--vscode-notebook-cellBorderColor: #e8e8e8;--vscode-notebook-focusedEditorBorder: #0090f1;--vscode-notebookStatusSuccessIcon-foreground: #388a34;--vscode-notebookStatusErrorIcon-foreground: #a1260d;--vscode-notebookStatusRunningIcon-foreground: #616161;--vscode-notebook-cellToolbarSeparator: rgba(128, 128, 128, .35);--vscode-notebook-selectedCellBackground: rgba(200, 221, 241, .31);--vscode-notebook-selectedCellBorder: #e8e8e8;--vscode-notebook-focusedCellBorder: #0090f1;--vscode-notebook-inactiveFocusedCellBorder: #e8e8e8;--vscode-notebook-cellStatusBarItemHoverBackground: rgba(0, 0, 0, .08);--vscode-notebook-cellInsertionIndicator: #0090f1;--vscode-notebookScrollbarSlider-background: rgba(100, 100, 100, .4);--vscode-notebookScrollbarSlider-hoverBackground: rgba(100, 100, 100, .7);--vscode-notebookScrollbarSlider-activeBackground: rgba(0, 0, 0, .6);--vscode-notebook-symbolHighlightBackground: rgba(253, 255, 0, .2);--vscode-notebook-cellEditorBackground: #f3f3f3;--vscode-notebook-editorBackground: #ffffff;--vscode-keybindingTable-headerBackground: rgba(97, 97, 97, .04);--vscode-keybindingTable-rowsBackground: rgba(97, 97, 97, .04);--vscode-scm-providerBorder: #c8c8c8;--vscode-searchEditor-textInputBorder: #cecece;--vscode-debugTokenExpression-name: #9b46b0;--vscode-debugTokenExpression-value: rgba(108, 108, 108, .8);--vscode-debugTokenExpression-string: #a31515;--vscode-debugTokenExpression-boolean: #0000ff;--vscode-debugTokenExpression-number: #098658;--vscode-debugTokenExpression-error: #e51400;--vscode-debugView-exceptionLabelForeground: #ffffff;--vscode-debugView-exceptionLabelBackground: #a31515;--vscode-debugView-stateLabelForeground: #616161;--vscode-debugView-stateLabelBackground: rgba(136, 136, 136, .27);--vscode-debugView-valueChangedHighlight: #569cd6;--vscode-debugConsole-infoForeground: #1a85ff;--vscode-debugConsole-warningForeground: #bf8803;--vscode-debugConsole-errorForeground: #a1260d;--vscode-debugConsole-sourceForeground: #616161;--vscode-debugConsoleInputIcon-foreground: #616161;--vscode-debugIcon-pauseForeground: #007acc;--vscode-debugIcon-stopForeground: #a1260d;--vscode-debugIcon-disconnectForeground: #a1260d;--vscode-debugIcon-restartForeground: #388a34;--vscode-debugIcon-stepOverForeground: #007acc;--vscode-debugIcon-stepIntoForeground: #007acc;--vscode-debugIcon-stepOutForeground: #007acc;--vscode-debugIcon-continueForeground: #007acc;--vscode-debugIcon-stepBackForeground: #007acc;--vscode-extensionButton-prominentBackground: #007acc;--vscode-extensionButton-prominentForeground: #ffffff;--vscode-extensionButton-prominentHoverBackground: #0062a3;--vscode-extensionIcon-starForeground: #df6100;--vscode-extensionIcon-verifiedForeground: #006ab1;--vscode-extensionIcon-preReleaseForeground: #1d9271;--vscode-extensionIcon-sponsorForeground: #b51e78;--vscode-terminal-ansiBlack: #000000;--vscode-terminal-ansiRed: #cd3131;--vscode-terminal-ansiGreen: #00bc00;--vscode-terminal-ansiYellow: #949800;--vscode-terminal-ansiBlue: #0451a5;--vscode-terminal-ansiMagenta: #bc05bc;--vscode-terminal-ansiCyan: #0598bc;--vscode-terminal-ansiWhite: #555555;--vscode-terminal-ansiBrightBlack: #666666;--vscode-terminal-ansiBrightRed: #cd3131;--vscode-terminal-ansiBrightGreen: #14ce14;--vscode-terminal-ansiBrightYellow: #b5ba00;--vscode-terminal-ansiBrightBlue: #0451a5;--vscode-terminal-ansiBrightMagenta: #bc05bc;--vscode-terminal-ansiBrightCyan: #0598bc;--vscode-terminal-ansiBrightWhite: #a5a5a5;--vscode-interactive-activeCodeBorder: #1a85ff;--vscode-interactive-inactiveCodeBorder: #e4e6f1;--vscode-gitDecoration-addedResourceForeground: #587c0c;--vscode-gitDecoration-modifiedResourceForeground: #895503;--vscode-gitDecoration-deletedResourceForeground: #ad0707;--vscode-gitDecoration-renamedResourceForeground: #007100;--vscode-gitDecoration-untrackedResourceForeground: #007100;--vscode-gitDecoration-ignoredResourceForeground: #8e8e90;--vscode-gitDecoration-stageModifiedResourceForeground: #895503;--vscode-gitDecoration-stageDeletedResourceForeground: #ad0707;--vscode-gitDecoration-conflictingResourceForeground: #ad0707;--vscode-gitDecoration-submoduleResourceForeground: #1258a7}:root.light-mode{color-scheme:light}:root.dark-mode{color-scheme:dark;--vscode-font-family: system-ui, "Ubuntu", "Droid Sans", sans-serif;--vscode-font-weight: normal;--vscode-font-size: 13px;--vscode-editor-font-family: "Droid Sans Mono", "monospace", monospace;--vscode-editor-font-weight: normal;--vscode-editor-font-size: 14px;--vscode-foreground: #cccccc;--vscode-disabledForeground: rgba(204, 204, 204, .5);--vscode-errorForeground: #f48771;--vscode-descriptionForeground: rgba(204, 204, 204, .7);--vscode-icon-foreground: #c5c5c5;--vscode-focusBorder: #007fd4;--vscode-textSeparator-foreground: rgba(255, 255, 255, .18);--vscode-textLink-foreground: #3794ff;--vscode-textLink-activeForeground: #3794ff;--vscode-textPreformat-foreground: #d7ba7d;--vscode-textBlockQuote-background: rgba(127, 127, 127, .1);--vscode-textBlockQuote-border: rgba(0, 122, 204, .5);--vscode-textCodeBlock-background: rgba(10, 10, 10, .4);--vscode-widget-shadow: rgba(0, 0, 0, .36);--vscode-input-background: #3c3c3c;--vscode-input-foreground: #cccccc;--vscode-inputOption-activeBorder: #007acc;--vscode-inputOption-hoverBackground: rgba(90, 93, 94, .5);--vscode-inputOption-activeBackground: rgba(0, 127, 212, .4);--vscode-inputOption-activeForeground: #ffffff;--vscode-input-placeholderForeground: #a6a6a6;--vscode-inputValidation-infoBackground: #063b49;--vscode-inputValidation-infoBorder: #007acc;--vscode-inputValidation-warningBackground: #352a05;--vscode-inputValidation-warningBorder: #b89500;--vscode-inputValidation-errorBackground: #5a1d1d;--vscode-inputValidation-errorBorder: #be1100;--vscode-dropdown-background: #3c3c3c;--vscode-dropdown-foreground: #f0f0f0;--vscode-dropdown-border: #3c3c3c;--vscode-checkbox-background: #3c3c3c;--vscode-checkbox-foreground: #f0f0f0;--vscode-checkbox-border: #3c3c3c;--vscode-button-foreground: #ffffff;--vscode-button-separator: rgba(255, 255, 255, .4);--vscode-button-background: #0e639c;--vscode-button-hoverBackground: #1177bb;--vscode-button-secondaryForeground: #ffffff;--vscode-button-secondaryBackground: #3a3d41;--vscode-button-secondaryHoverBackground: #45494e;--vscode-badge-background: #4d4d4d;--vscode-badge-foreground: #ffffff;--vscode-scrollbar-shadow: #000000;--vscode-scrollbarSlider-background: rgba(121, 121, 121, .4);--vscode-scrollbarSlider-hoverBackground: rgba(100, 100, 100, .7);--vscode-scrollbarSlider-activeBackground: rgba(191, 191, 191, .4);--vscode-progressBar-background: #0e70c0;--vscode-editorError-foreground: #f14c4c;--vscode-editorWarning-foreground: #cca700;--vscode-editorInfo-foreground: #3794ff;--vscode-editorHint-foreground: rgba(238, 238, 238, .7);--vscode-sash-hoverBorder: #007fd4;--vscode-editor-background: #1e1e1e;--vscode-editor-foreground: #d4d4d4;--vscode-editorStickyScroll-background: #1e1e1e;--vscode-editorStickyScrollHover-background: #2a2d2e;--vscode-editorWidget-background: #252526;--vscode-editorWidget-foreground: #cccccc;--vscode-editorWidget-border: #454545;--vscode-quickInput-background: #252526;--vscode-quickInput-foreground: #cccccc;--vscode-quickInputTitle-background: rgba(255, 255, 255, .1);--vscode-pickerGroup-foreground: #3794ff;--vscode-pickerGroup-border: #3f3f46;--vscode-keybindingLabel-background: rgba(128, 128, 128, .17);--vscode-keybindingLabel-foreground: #cccccc;--vscode-keybindingLabel-border: rgba(51, 51, 51, .6);--vscode-keybindingLabel-bottomBorder: rgba(68, 68, 68, .6);--vscode-editor-selectionBackground: #264f78;--vscode-editor-inactiveSelectionBackground: #3a3d41;--vscode-editor-selectionHighlightBackground: rgba(173, 214, 255, .15);--vscode-editor-findMatchBackground: #515c6a;--vscode-editor-findMatchHighlightBackground: rgba(234, 92, 0, .33);--vscode-editor-findRangeHighlightBackground: rgba(58, 61, 65, .4);--vscode-searchEditor-findMatchBackground: rgba(234, 92, 0, .22);--vscode-editor-hoverHighlightBackground: rgba(38, 79, 120, .25);--vscode-editorHoverWidget-background: #252526;--vscode-editorHoverWidget-foreground: #cccccc;--vscode-editorHoverWidget-border: #454545;--vscode-editorHoverWidget-statusBarBackground: #2c2c2d;--vscode-editorLink-activeForeground: #4e94ce;--vscode-editorInlayHint-foreground: rgba(255, 255, 255, .8);--vscode-editorInlayHint-background: rgba(77, 77, 77, .6);--vscode-editorInlayHint-typeForeground: rgba(255, 255, 255, .8);--vscode-editorInlayHint-typeBackground: rgba(77, 77, 77, .6);--vscode-editorInlayHint-parameterForeground: rgba(255, 255, 255, .8);--vscode-editorInlayHint-parameterBackground: rgba(77, 77, 77, .6);--vscode-editorLightBulb-foreground: #ffcc00;--vscode-editorLightBulbAutoFix-foreground: #75beff;--vscode-diffEditor-insertedTextBackground: rgba(156, 204, 44, .2);--vscode-diffEditor-removedTextBackground: rgba(255, 0, 0, .4);--vscode-diffEditor-insertedLineBackground: rgba(155, 185, 85, .2);--vscode-diffEditor-removedLineBackground: rgba(255, 0, 0, .2);--vscode-diffEditor-diagonalFill: rgba(204, 204, 204, .2);--vscode-list-focusOutline: #007fd4;--vscode-list-activeSelectionBackground: #04395e;--vscode-list-activeSelectionForeground: #ffffff;--vscode-list-activeSelectionIconForeground: #ffffff;--vscode-list-inactiveSelectionBackground: #37373d;--vscode-list-hoverBackground: #2a2d2e;--vscode-list-dropBackground: #383b3d;--vscode-list-highlightForeground: #2aaaff;--vscode-list-focusHighlightForeground: #2aaaff;--vscode-list-invalidItemForeground: #b89500;--vscode-list-errorForeground: #f88070;--vscode-list-warningForeground: #cca700;--vscode-listFilterWidget-background: #252526;--vscode-listFilterWidget-outline: rgba(0, 0, 0, 0);--vscode-listFilterWidget-noMatchesOutline: #be1100;--vscode-listFilterWidget-shadow: rgba(0, 0, 0, .36);--vscode-list-filterMatchBackground: rgba(234, 92, 0, .33);--vscode-tree-indentGuidesStroke: #585858;--vscode-tree-tableColumnsBorder: rgba(204, 204, 204, .13);--vscode-tree-tableOddRowsBackground: rgba(204, 204, 204, .04);--vscode-list-deemphasizedForeground: #8c8c8c;--vscode-quickInputList-focusForeground: #ffffff;--vscode-quickInputList-focusIconForeground: #ffffff;--vscode-quickInputList-focusBackground: #04395e;--vscode-menu-foreground: #cccccc;--vscode-menu-background: #303031;--vscode-menu-selectionForeground: #ffffff;--vscode-menu-selectionBackground: #04395e;--vscode-menu-separatorBackground: #606060;--vscode-toolbar-hoverBackground: rgba(90, 93, 94, .31);--vscode-toolbar-activeBackground: rgba(99, 102, 103, .31);--vscode-editor-snippetTabstopHighlightBackground: rgba(124, 124, 124, .3);--vscode-editor-snippetFinalTabstopHighlightBorder: #525252;--vscode-breadcrumb-foreground: rgba(204, 204, 204, .8);--vscode-breadcrumb-background: #1e1e1e;--vscode-breadcrumb-focusForeground: #e0e0e0;--vscode-breadcrumb-activeSelectionForeground: #e0e0e0;--vscode-breadcrumbPicker-background: #252526;--vscode-merge-currentHeaderBackground: rgba(64, 200, 174, .5);--vscode-merge-currentContentBackground: rgba(64, 200, 174, .2);--vscode-merge-incomingHeaderBackground: rgba(64, 166, 255, .5);--vscode-merge-incomingContentBackground: rgba(64, 166, 255, .2);--vscode-merge-commonHeaderBackground: rgba(96, 96, 96, .4);--vscode-merge-commonContentBackground: rgba(96, 96, 96, .16);--vscode-editorOverviewRuler-currentContentForeground: rgba(64, 200, 174, .5);--vscode-editorOverviewRuler-incomingContentForeground: rgba(64, 166, 255, .5);--vscode-editorOverviewRuler-commonContentForeground: rgba(96, 96, 96, .4);--vscode-editorOverviewRuler-findMatchForeground: rgba(209, 134, 22, .49);--vscode-editorOverviewRuler-selectionHighlightForeground: rgba(160, 160, 160, .8);--vscode-minimap-findMatchHighlight: #d18616;--vscode-minimap-selectionOccurrenceHighlight: #676767;--vscode-minimap-selectionHighlight: #264f78;--vscode-minimap-errorHighlight: rgba(255, 18, 18, .7);--vscode-minimap-warningHighlight: #cca700;--vscode-minimap-foregroundOpacity: #000000;--vscode-minimapSlider-background: rgba(121, 121, 121, .2);--vscode-minimapSlider-hoverBackground: rgba(100, 100, 100, .35);--vscode-minimapSlider-activeBackground: rgba(191, 191, 191, .2);--vscode-problemsErrorIcon-foreground: #f14c4c;--vscode-problemsWarningIcon-foreground: #cca700;--vscode-problemsInfoIcon-foreground: #3794ff;--vscode-charts-foreground: #cccccc;--vscode-charts-lines: rgba(204, 204, 204, .5);--vscode-charts-red: #f14c4c;--vscode-charts-blue: #3794ff;--vscode-charts-yellow: #cca700;--vscode-charts-orange: #d18616;--vscode-charts-green: #89d185;--vscode-charts-purple: #b180d7;--vscode-editor-lineHighlightBorder: #282828;--vscode-editor-rangeHighlightBackground: rgba(255, 255, 255, .04);--vscode-editor-symbolHighlightBackground: rgba(234, 92, 0, .33);--vscode-editorCursor-foreground: #aeafad;--vscode-editorWhitespace-foreground: rgba(227, 228, 226, .16);--vscode-editorIndentGuide-background: #404040;--vscode-editorIndentGuide-activeBackground: #707070;--vscode-editorLineNumber-foreground: #858585;--vscode-editorActiveLineNumber-foreground: #c6c6c6;--vscode-editorLineNumber-activeForeground: #c6c6c6;--vscode-editorRuler-foreground: #5a5a5a;--vscode-editorCodeLens-foreground: #999999;--vscode-editorBracketMatch-background: rgba(0, 100, 0, .1);--vscode-editorBracketMatch-border: #888888;--vscode-editorOverviewRuler-border: rgba(127, 127, 127, .3);--vscode-editorGutter-background: #1e1e1e;--vscode-editorUnnecessaryCode-opacity: rgba(0, 0, 0, .67);--vscode-editorGhostText-foreground: rgba(255, 255, 255, .34);--vscode-editorOverviewRuler-rangeHighlightForeground: rgba(0, 122, 204, .6);--vscode-editorOverviewRuler-errorForeground: rgba(255, 18, 18, .7);--vscode-editorOverviewRuler-warningForeground: #cca700;--vscode-editorOverviewRuler-infoForeground: #3794ff;--vscode-editorBracketHighlight-foreground1: #ffd700;--vscode-editorBracketHighlight-foreground2: #da70d6;--vscode-editorBracketHighlight-foreground3: #179fff;--vscode-editorBracketHighlight-foreground4: rgba(0, 0, 0, 0);--vscode-editorBracketHighlight-foreground5: rgba(0, 0, 0, 0);--vscode-editorBracketHighlight-foreground6: rgba(0, 0, 0, 0);--vscode-editorBracketHighlight-unexpectedBracket\.foreground: rgba(255, 18, 18, .8);--vscode-editorBracketPairGuide-background1: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-background2: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-background3: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-background4: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-background5: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-background6: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-activeBackground1: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-activeBackground2: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-activeBackground3: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-activeBackground4: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-activeBackground5: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-activeBackground6: rgba(0, 0, 0, 0);--vscode-editorUnicodeHighlight-border: #bd9b03;--vscode-editorUnicodeHighlight-background: rgba(189, 155, 3, .15);--vscode-symbolIcon-arrayForeground: #cccccc;--vscode-symbolIcon-booleanForeground: #cccccc;--vscode-symbolIcon-classForeground: #ee9d28;--vscode-symbolIcon-colorForeground: #cccccc;--vscode-symbolIcon-constantForeground: #cccccc;--vscode-symbolIcon-constructorForeground: #b180d7;--vscode-symbolIcon-enumeratorForeground: #ee9d28;--vscode-symbolIcon-enumeratorMemberForeground: #75beff;--vscode-symbolIcon-eventForeground: #ee9d28;--vscode-symbolIcon-fieldForeground: #75beff;--vscode-symbolIcon-fileForeground: #cccccc;--vscode-symbolIcon-folderForeground: #cccccc;--vscode-symbolIcon-functionForeground: #b180d7;--vscode-symbolIcon-interfaceForeground: #75beff;--vscode-symbolIcon-keyForeground: #cccccc;--vscode-symbolIcon-keywordForeground: #cccccc;--vscode-symbolIcon-methodForeground: #b180d7;--vscode-symbolIcon-moduleForeground: #cccccc;--vscode-symbolIcon-namespaceForeground: #cccccc;--vscode-symbolIcon-nullForeground: #cccccc;--vscode-symbolIcon-numberForeground: #cccccc;--vscode-symbolIcon-objectForeground: #cccccc;--vscode-symbolIcon-operatorForeground: #cccccc;--vscode-symbolIcon-packageForeground: #cccccc;--vscode-symbolIcon-propertyForeground: #cccccc;--vscode-symbolIcon-referenceForeground: #cccccc;--vscode-symbolIcon-snippetForeground: #cccccc;--vscode-symbolIcon-stringForeground: #cccccc;--vscode-symbolIcon-structForeground: #cccccc;--vscode-symbolIcon-textForeground: #cccccc;--vscode-symbolIcon-typeParameterForeground: #cccccc;--vscode-symbolIcon-unitForeground: #cccccc;--vscode-symbolIcon-variableForeground: #75beff;--vscode-editorHoverWidget-highlightForeground: #2aaaff;--vscode-editorOverviewRuler-bracketMatchForeground: #a0a0a0;--vscode-editor-foldBackground: rgba(38, 79, 120, .3);--vscode-editorGutter-foldingControlForeground: #c5c5c5;--vscode-editor-linkedEditingBackground: rgba(255, 0, 0, .3);--vscode-editor-wordHighlightBackground: rgba(87, 87, 87, .72);--vscode-editor-wordHighlightStrongBackground: rgba(0, 73, 114, .72);--vscode-editorOverviewRuler-wordHighlightForeground: rgba(160, 160, 160, .8);--vscode-editorOverviewRuler-wordHighlightStrongForeground: rgba(192, 160, 192, .8);--vscode-peekViewTitle-background: rgba(55, 148, 255, .1);--vscode-peekViewTitleLabel-foreground: #ffffff;--vscode-peekViewTitleDescription-foreground: rgba(204, 204, 204, .7);--vscode-peekView-border: #3794ff;--vscode-peekViewResult-background: #252526;--vscode-peekViewResult-lineForeground: #bbbbbb;--vscode-peekViewResult-fileForeground: #ffffff;--vscode-peekViewResult-selectionBackground: rgba(51, 153, 255, .2);--vscode-peekViewResult-selectionForeground: #ffffff;--vscode-peekViewEditor-background: #001f33;--vscode-peekViewEditorGutter-background: #001f33;--vscode-peekViewResult-matchHighlightBackground: rgba(234, 92, 0, .3);--vscode-peekViewEditor-matchHighlightBackground: rgba(255, 143, 0, .6);--vscode-editorMarkerNavigationError-background: #f14c4c;--vscode-editorMarkerNavigationError-headerBackground: rgba(241, 76, 76, .1);--vscode-editorMarkerNavigationWarning-background: #cca700;--vscode-editorMarkerNavigationWarning-headerBackground: rgba(204, 167, 0, .1);--vscode-editorMarkerNavigationInfo-background: #3794ff;--vscode-editorMarkerNavigationInfo-headerBackground: rgba(55, 148, 255, .1);--vscode-editorMarkerNavigation-background: #1e1e1e;--vscode-editorSuggestWidget-background: #252526;--vscode-editorSuggestWidget-border: #454545;--vscode-editorSuggestWidget-foreground: #d4d4d4;--vscode-editorSuggestWidget-selectedForeground: #ffffff;--vscode-editorSuggestWidget-selectedIconForeground: #ffffff;--vscode-editorSuggestWidget-selectedBackground: #04395e;--vscode-editorSuggestWidget-highlightForeground: #2aaaff;--vscode-editorSuggestWidget-focusHighlightForeground: #2aaaff;--vscode-editorSuggestWidgetStatus-foreground: rgba(212, 212, 212, .5);--vscode-tab-activeBackground: #1e1e1e;--vscode-tab-unfocusedActiveBackground: #1e1e1e;--vscode-tab-inactiveBackground: #2d2d2d;--vscode-tab-unfocusedInactiveBackground: #2d2d2d;--vscode-tab-activeForeground: #ffffff;--vscode-tab-inactiveForeground: rgba(255, 255, 255, .5);--vscode-tab-unfocusedActiveForeground: rgba(255, 255, 255, .5);--vscode-tab-unfocusedInactiveForeground: rgba(255, 255, 255, .25);--vscode-tab-border: #252526;--vscode-tab-lastPinnedBorder: rgba(204, 204, 204, .2);--vscode-tab-activeModifiedBorder: #3399cc;--vscode-tab-inactiveModifiedBorder: rgba(51, 153, 204, .5);--vscode-tab-unfocusedActiveModifiedBorder: rgba(51, 153, 204, .5);--vscode-tab-unfocusedInactiveModifiedBorder: rgba(51, 153, 204, .25);--vscode-editorPane-background: #1e1e1e;--vscode-editorGroupHeader-tabsBackground: #252526;--vscode-editorGroupHeader-noTabsBackground: #1e1e1e;--vscode-editorGroup-border: #444444;--vscode-editorGroup-dropBackground: rgba(83, 89, 93, .5);--vscode-editorGroup-dropIntoPromptForeground: #cccccc;--vscode-editorGroup-dropIntoPromptBackground: #252526;--vscode-sideBySideEditor-horizontalBorder: #444444;--vscode-sideBySideEditor-verticalBorder: #444444;--vscode-panel-background: #1e1e1e;--vscode-panel-border: rgba(128, 128, 128, .35);--vscode-panelTitle-activeForeground: #e7e7e7;--vscode-panelTitle-inactiveForeground: rgba(231, 231, 231, .6);--vscode-panelTitle-activeBorder: #e7e7e7;--vscode-panel-dropBorder: #e7e7e7;--vscode-panelSection-dropBackground: rgba(83, 89, 93, .5);--vscode-panelSectionHeader-background: rgba(128, 128, 128, .2);--vscode-panelSection-border: rgba(128, 128, 128, .35);--vscode-banner-background: #04395e;--vscode-banner-foreground: #ffffff;--vscode-banner-iconForeground: #3794ff;--vscode-statusBar-foreground: #ffffff;--vscode-statusBar-noFolderForeground: #ffffff;--vscode-statusBar-background: #007acc;--vscode-statusBar-noFolderBackground: #68217a;--vscode-statusBar-focusBorder: #ffffff;--vscode-statusBarItem-activeBackground: rgba(255, 255, 255, .18);--vscode-statusBarItem-focusBorder: #ffffff;--vscode-statusBarItem-hoverBackground: rgba(255, 255, 255, .12);--vscode-statusBarItem-compactHoverBackground: rgba(255, 255, 255, .2);--vscode-statusBarItem-prominentForeground: #ffffff;--vscode-statusBarItem-prominentBackground: rgba(0, 0, 0, .5);--vscode-statusBarItem-prominentHoverBackground: rgba(0, 0, 0, .3);--vscode-statusBarItem-errorBackground: #c72e0f;--vscode-statusBarItem-errorForeground: #ffffff;--vscode-statusBarItem-warningBackground: #7a6400;--vscode-statusBarItem-warningForeground: #ffffff;--vscode-activityBar-background: #333333;--vscode-activityBar-foreground: #ffffff;--vscode-activityBar-inactiveForeground: rgba(255, 255, 255, .4);--vscode-activityBar-activeBorder: #ffffff;--vscode-activityBar-dropBorder: #ffffff;--vscode-activityBarBadge-background: #007acc;--vscode-activityBarBadge-foreground: #ffffff;--vscode-statusBarItem-remoteBackground: #16825d;--vscode-statusBarItem-remoteForeground: #ffffff;--vscode-extensionBadge-remoteBackground: #007acc;--vscode-extensionBadge-remoteForeground: #ffffff;--vscode-sideBar-background: #252526;--vscode-sideBarTitle-foreground: #bbbbbb;--vscode-sideBar-dropBackground: rgba(83, 89, 93, .5);--vscode-sideBarSectionHeader-background: rgba(0, 0, 0, 0);--vscode-sideBarSectionHeader-border: rgba(204, 204, 204, .2);--vscode-titleBar-activeForeground: #cccccc;--vscode-titleBar-inactiveForeground: rgba(204, 204, 204, .6);--vscode-titleBar-activeBackground: #3c3c3c;--vscode-titleBar-inactiveBackground: rgba(60, 60, 60, .6);--vscode-menubar-selectionForeground: #cccccc;--vscode-menubar-selectionBackground: rgba(90, 93, 94, .31);--vscode-notifications-foreground: #cccccc;--vscode-notifications-background: #252526;--vscode-notificationLink-foreground: #3794ff;--vscode-notificationCenterHeader-background: #303031;--vscode-notifications-border: #303031;--vscode-notificationsErrorIcon-foreground: #f14c4c;--vscode-notificationsWarningIcon-foreground: #cca700;--vscode-notificationsInfoIcon-foreground: #3794ff;--vscode-commandCenter-foreground: #cccccc;--vscode-commandCenter-activeForeground: #cccccc;--vscode-commandCenter-activeBackground: rgba(90, 93, 94, .31);--vscode-commandCenter-border: rgba(128, 128, 128, .35);--vscode-editorCommentsWidget-resolvedBorder: rgba(204, 204, 204, .5);--vscode-editorCommentsWidget-unresolvedBorder: #3794ff;--vscode-editorCommentsWidget-rangeBackground: rgba(55, 148, 255, .1);--vscode-editorCommentsWidget-rangeBorder: rgba(55, 148, 255, .4);--vscode-editorCommentsWidget-rangeActiveBackground: rgba(55, 148, 255, .1);--vscode-editorCommentsWidget-rangeActiveBorder: rgba(55, 148, 255, .4);--vscode-editorGutter-commentRangeForeground: #37373d;--vscode-debugToolBar-background: #333333;--vscode-debugIcon-startForeground: #89d185;--vscode-editor-stackFrameHighlightBackground: rgba(255, 255, 0, .2);--vscode-editor-focusedStackFrameHighlightBackground: rgba(122, 189, 122, .3);--vscode-mergeEditor-change\.background: rgba(155, 185, 85, .2);--vscode-mergeEditor-change\.word\.background: rgba(156, 204, 44, .2);--vscode-mergeEditor-conflict\.unhandledUnfocused\.border: rgba(255, 166, 0, .48);--vscode-mergeEditor-conflict\.unhandledFocused\.border: #ffa600;--vscode-mergeEditor-conflict\.handledUnfocused\.border: rgba(134, 134, 134, .29);--vscode-mergeEditor-conflict\.handledFocused\.border: rgba(193, 193, 193, .8);--vscode-mergeEditor-conflict\.handled\.minimapOverViewRuler: rgba(173, 172, 168, .93);--vscode-mergeEditor-conflict\.unhandled\.minimapOverViewRuler: #fcba03;--vscode-mergeEditor-conflictingLines\.background: rgba(255, 234, 0, .28);--vscode-settings-headerForeground: #e7e7e7;--vscode-settings-modifiedItemIndicator: #0c7d9d;--vscode-settings-headerBorder: rgba(128, 128, 128, .35);--vscode-settings-sashBorder: rgba(128, 128, 128, .35);--vscode-settings-dropdownBackground: #3c3c3c;--vscode-settings-dropdownForeground: #f0f0f0;--vscode-settings-dropdownBorder: #3c3c3c;--vscode-settings-dropdownListBorder: #454545;--vscode-settings-checkboxBackground: #3c3c3c;--vscode-settings-checkboxForeground: #f0f0f0;--vscode-settings-checkboxBorder: #3c3c3c;--vscode-settings-textInputBackground: #3c3c3c;--vscode-settings-textInputForeground: #cccccc;--vscode-settings-numberInputBackground: #3c3c3c;--vscode-settings-numberInputForeground: #cccccc;--vscode-settings-focusedRowBackground: rgba(42, 45, 46, .6);--vscode-settings-rowHoverBackground: rgba(42, 45, 46, .3);--vscode-settings-focusedRowBorder: rgba(255, 255, 255, .12);--vscode-terminal-foreground: #cccccc;--vscode-terminal-selectionBackground: #264f78;--vscode-terminal-inactiveSelectionBackground: #3a3d41;--vscode-terminalCommandDecoration-defaultBackground: rgba(255, 255, 255, .25);--vscode-terminalCommandDecoration-successBackground: #1b81a8;--vscode-terminalCommandDecoration-errorBackground: #f14c4c;--vscode-terminalOverviewRuler-cursorForeground: rgba(160, 160, 160, .8);--vscode-terminal-border: rgba(128, 128, 128, .35);--vscode-terminal-findMatchBackground: #515c6a;--vscode-terminal-findMatchHighlightBackground: rgba(234, 92, 0, .33);--vscode-terminalOverviewRuler-findMatchForeground: rgba(209, 134, 22, .49);--vscode-terminal-dropBackground: rgba(83, 89, 93, .5);--vscode-testing-iconFailed: #f14c4c;--vscode-testing-iconErrored: #f14c4c;--vscode-testing-iconPassed: #73c991;--vscode-testing-runAction: #73c991;--vscode-testing-iconQueued: #cca700;--vscode-testing-iconUnset: #848484;--vscode-testing-iconSkipped: #848484;--vscode-testing-peekBorder: #f14c4c;--vscode-testing-peekHeaderBackground: rgba(241, 76, 76, .1);--vscode-testing-message\.error\.decorationForeground: #f14c4c;--vscode-testing-message\.error\.lineBackground: rgba(255, 0, 0, .2);--vscode-testing-message\.info\.decorationForeground: rgba(212, 212, 212, .5);--vscode-welcomePage-tileBackground: #252526;--vscode-welcomePage-tileHoverBackground: #2c2c2d;--vscode-welcomePage-tileShadow: rgba(0, 0, 0, .36);--vscode-welcomePage-progress\.background: #3c3c3c;--vscode-welcomePage-progress\.foreground: #3794ff;--vscode-debugExceptionWidget-border: #a31515;--vscode-debugExceptionWidget-background: #420b0d;--vscode-ports-iconRunningProcessForeground: #369432;--vscode-statusBar-debuggingBackground: #cc6633;--vscode-statusBar-debuggingForeground: #ffffff;--vscode-editor-inlineValuesForeground: rgba(255, 255, 255, .5);--vscode-editor-inlineValuesBackground: rgba(255, 200, 0, .2);--vscode-editorGutter-modifiedBackground: #1b81a8;--vscode-editorGutter-addedBackground: #487e02;--vscode-editorGutter-deletedBackground: #f14c4c;--vscode-minimapGutter-modifiedBackground: #1b81a8;--vscode-minimapGutter-addedBackground: #487e02;--vscode-minimapGutter-deletedBackground: #f14c4c;--vscode-editorOverviewRuler-modifiedForeground: rgba(27, 129, 168, .6);--vscode-editorOverviewRuler-addedForeground: rgba(72, 126, 2, .6);--vscode-editorOverviewRuler-deletedForeground: rgba(241, 76, 76, .6);--vscode-debugIcon-breakpointForeground: #e51400;--vscode-debugIcon-breakpointDisabledForeground: #848484;--vscode-debugIcon-breakpointUnverifiedForeground: #848484;--vscode-debugIcon-breakpointCurrentStackframeForeground: #ffcc00;--vscode-debugIcon-breakpointStackframeForeground: #89d185;--vscode-notebook-cellBorderColor: #37373d;--vscode-notebook-focusedEditorBorder: #007fd4;--vscode-notebookStatusSuccessIcon-foreground: #89d185;--vscode-notebookStatusErrorIcon-foreground: #f48771;--vscode-notebookStatusRunningIcon-foreground: #cccccc;--vscode-notebook-cellToolbarSeparator: rgba(128, 128, 128, .35);--vscode-notebook-selectedCellBackground: #37373d;--vscode-notebook-selectedCellBorder: #37373d;--vscode-notebook-focusedCellBorder: #007fd4;--vscode-notebook-inactiveFocusedCellBorder: #37373d;--vscode-notebook-cellStatusBarItemHoverBackground: rgba(255, 255, 255, .15);--vscode-notebook-cellInsertionIndicator: #007fd4;--vscode-notebookScrollbarSlider-background: rgba(121, 121, 121, .4);--vscode-notebookScrollbarSlider-hoverBackground: rgba(100, 100, 100, .7);--vscode-notebookScrollbarSlider-activeBackground: rgba(191, 191, 191, .4);--vscode-notebook-symbolHighlightBackground: rgba(255, 255, 255, .04);--vscode-notebook-cellEditorBackground: #252526;--vscode-notebook-editorBackground: #1e1e1e;--vscode-keybindingTable-headerBackground: rgba(204, 204, 204, .04);--vscode-keybindingTable-rowsBackground: rgba(204, 204, 204, .04);--vscode-scm-providerBorder: #454545;--vscode-debugTokenExpression-name: #c586c0;--vscode-debugTokenExpression-value: rgba(204, 204, 204, .6);--vscode-debugTokenExpression-string: #ce9178;--vscode-debugTokenExpression-boolean: #4e94ce;--vscode-debugTokenExpression-number: #b5cea8;--vscode-debugTokenExpression-error: #f48771;--vscode-debugView-exceptionLabelForeground: #cccccc;--vscode-debugView-exceptionLabelBackground: #6c2022;--vscode-debugView-stateLabelForeground: #cccccc;--vscode-debugView-stateLabelBackground: rgba(136, 136, 136, .27);--vscode-debugView-valueChangedHighlight: #569cd6;--vscode-debugConsole-infoForeground: #3794ff;--vscode-debugConsole-warningForeground: #cca700;--vscode-debugConsole-errorForeground: #f48771;--vscode-debugConsole-sourceForeground: #cccccc;--vscode-debugConsoleInputIcon-foreground: #cccccc;--vscode-debugIcon-pauseForeground: #75beff;--vscode-debugIcon-stopForeground: #f48771;--vscode-debugIcon-disconnectForeground: #f48771;--vscode-debugIcon-restartForeground: #89d185;--vscode-debugIcon-stepOverForeground: #75beff;--vscode-debugIcon-stepIntoForeground: #75beff;--vscode-debugIcon-stepOutForeground: #75beff;--vscode-debugIcon-continueForeground: #75beff;--vscode-debugIcon-stepBackForeground: #75beff;--vscode-extensionButton-prominentBackground: #0e639c;--vscode-extensionButton-prominentForeground: #ffffff;--vscode-extensionButton-prominentHoverBackground: #1177bb;--vscode-extensionIcon-starForeground: #ff8e00;--vscode-extensionIcon-verifiedForeground: #3794ff;--vscode-extensionIcon-preReleaseForeground: #1d9271;--vscode-extensionIcon-sponsorForeground: #d758b3;--vscode-terminal-ansiBlack: #000000;--vscode-terminal-ansiRed: #cd3131;--vscode-terminal-ansiGreen: #0dbc79;--vscode-terminal-ansiYellow: #e5e510;--vscode-terminal-ansiBlue: #2472c8;--vscode-terminal-ansiMagenta: #bc3fbc;--vscode-terminal-ansiCyan: #11a8cd;--vscode-terminal-ansiWhite: #e5e5e5;--vscode-terminal-ansiBrightBlack: #666666;--vscode-terminal-ansiBrightRed: #f14c4c;--vscode-terminal-ansiBrightGreen: #23d18b;--vscode-terminal-ansiBrightYellow: #f5f543;--vscode-terminal-ansiBrightBlue: #3b8eea;--vscode-terminal-ansiBrightMagenta: #d670d6;--vscode-terminal-ansiBrightCyan: #29b8db;--vscode-terminal-ansiBrightWhite: #e5e5e5;--vscode-interactive-activeCodeBorder: #3794ff;--vscode-interactive-inactiveCodeBorder: #37373d;--vscode-gitDecoration-addedResourceForeground: #81b88b;--vscode-gitDecoration-modifiedResourceForeground: #e2c08d;--vscode-gitDecoration-deletedResourceForeground: #c74e39;--vscode-gitDecoration-renamedResourceForeground: #73c991;--vscode-gitDecoration-untrackedResourceForeground: #73c991;--vscode-gitDecoration-ignoredResourceForeground: #8c8c8c;--vscode-gitDecoration-stageModifiedResourceForeground: #e2c08d;--vscode-gitDecoration-stageDeletedResourceForeground: #c74e39;--vscode-gitDecoration-conflictingResourceForeground: #e4676b;--vscode-gitDecoration-submoduleResourceForeground: #8db9e2}.cm-wrapper{line-height:18px}.cm-wrapper,.cm-wrapper>div{width:100%;height:100%}.CodeMirror span.cm-meta{color:var(--vscode-editor-foreground)}.CodeMirror span.cm-number{color:var(--vscode-debugTokenExpression-number)}.CodeMirror span.cm-keyword,.CodeMirror span.cm-builtin{color:var(--vscode-debugTokenExpression-name)}.CodeMirror span.cm-operator{color:var(--vscode-editor-foreground)}.CodeMirror span.cm-string,.CodeMirror span.cm-string-2{color:var(--vscode-debugTokenExpression-string)}.CodeMirror span.cm-error{color:var(--vscode-errorForeground)}.CodeMirror span.cm-def,.CodeMirror span.cm-tag{color:#0070c1}.CodeMirror span.cm-comment,.CodeMirror span.cm-link{color:green}.CodeMirror span.cm-variable,.CodeMirror span.cm-variable-2,.CodeMirror span.cm-atom{color:#0070c1}.CodeMirror span.cm-property{color:#795e26}.CodeMirror span.cm-qualifier,.CodeMirror span.cm-attribute{color:#001080}.CodeMirror span.cm-variable-3,.CodeMirror span.cm-type{color:#267f99}:root.dark-mode .CodeMirror span.cm-def,:root.dark-mode .CodeMirror span.cm-tag{color:var(--vscode-debugView-valueChangedHighlight)}:root.dark-mode .CodeMirror span.cm-comment,:root.dark-mode .CodeMirror span.cm-link{color:#6a9955}:root.dark-mode .CodeMirror span.cm-variable,:root.dark-mode .CodeMirror span.cm-variable-2,:root.dark-mode .CodeMirror span.cm-atom{color:#4fc1ff}:root.dark-mode .CodeMirror span.cm-property{color:#dcdcaa}:root.dark-mode .CodeMirror span.cm-qualifier,:root.dark-mode .CodeMirror span.cm-attribute{color:#9cdcfe}:root.dark-mode .CodeMirror span.cm-variable-3,:root.dark-mode .CodeMirror span.cm-type{color:#4ec9b0}.CodeMirror span.cm-bracket{color:var(--vscode-editorBracketHighlight-foreground3)}.CodeMirror-cursor{border-left:1px solid var(--vscode-editor-foreground)!important}.CodeMirror div.CodeMirror-selected{background:var(--vscode-terminal-inactiveSelectionBackground)}.CodeMirror .CodeMirror-gutters{z-index:0;background:1px solid var(--vscode-editorGroup-border);border-right:none}.CodeMirror .CodeMirror-gutter-elt{background-color:var(--vscode-editorGutter-background)}.CodeMirror .CodeMirror-gutterwrapper{border-right:1px solid var(--vscode-editorGroup-border);color:var(--vscode-editorLineNumber-foreground)}.CodeMirror .CodeMirror-matchingbracket{background-color:var(--vscode-editorBracketPairGuide-background1);color:var(--vscode-editorBracketHighlight-foreground1)!important}.CodeMirror{font-family:var(--vscode-editor-font-family)!important;color:var(--vscode-editor-foreground)!important;background-color:var(--vscode-editor-background)!important;font-weight:var(--vscode-editor-font-weight)!important;font-size:var(--vscode-editor-font-size)!important}.CodeMirror .source-line-running{background-color:var(--vscode-editor-selectionBackground);z-index:2}.CodeMirror .source-line-paused{background-color:var(--vscode-editor-selectionHighlightBackground);z-index:2}.CodeMirror .source-line-error-widget{background-color:var(--vscode-inputValidation-errorBackground);white-space:pre-wrap;margin:3px 10px;padding:5px}.CodeMirror span.cm-link,span.cm-linkified{color:var(--vscode-textLink-foreground);text-decoration:underline;cursor:pointer}.CodeMirror .source-line-error-underline{text-decoration:underline;text-decoration-color:var(--vscode-errorForeground);text-decoration-style:wavy}.CodeMirror-placeholder{color:var(--vscode-input-placeholderForeground)!important}.CodeMirror-dialog-top{padding-top:8px!important}.expandable{flex:none;flex-direction:column;line-height:28px}.expandable-title{flex:none;display:flex;flex-direction:row;align-items:center;white-space:nowrap;-webkit-user-select:none;user-select:none;cursor:pointer}.expandable-content{margin-left:25px}.console-tab{display:flex;flex:auto;white-space:pre}.console-line{width:100%;-webkit-user-select:text;user-select:text}.console-line .codicon{padding:0 2px 0 3px;position:relative;flex:none;top:3px}.console-line.warning .codicon{color:#ff8c00}.console-line-message{word-break:break-word;white-space:pre-wrap;position:relative}.console-location{padding-right:3px;float:right;color:var(--vscode-editorCodeLens-foreground);-webkit-user-select:none;user-select:none}.console-time{float:left;min-width:50px;color:var(--vscode-editorCodeLens-foreground);-webkit-user-select:none;user-select:none}.console-stack{white-space:pre-wrap;margin-left:50px}.console-line .codicon.status-none:after,.console-line .codicon.status-error:after,.console-line .codicon.status-warning:after{display:inline-block;content:"a";color:transparent;border-radius:4px;width:8px;height:8px;position:relative;top:8px;left:-7px}.console-line .codicon.status-error:after{background-color:var(--vscode-errorForeground)}.console-line .codicon.status-warning:after{background-color:var(--vscode-list-warningForeground)}.console-repeat{display:inline-block;padding:0 2px;font-size:12px;line-height:18px;border-radius:6px;background-color:#8c959f;color:#fff;margin-right:10px;flex:none;font-weight:600}.network-request-status-route{color:var(--vscode-statusBar-foreground);background-color:var(--vscode-statusBar-background)}.network-request-status-route.api{color:var(--vscode-statusBar-foreground);background-color:var(--vscode-statusBarItem-remoteBackground)}.network-grid-view .grid-view-column-method,.network-grid-view .grid-view-column-status{text-align:center}.network-grid-view .grid-view-column-duration,.network-grid-view .grid-view-column-size,.network-grid-view .grid-view-column-start{text-align:end}.network-request-details-tab{-webkit-user-select:text;user-select:text;overflow:auto}.network-response-toolbar{border-top:1px solid var(--vscode-panel-border);border-bottom:none!important}.network-request-details-tab>*{flex:none}.network-request-no-payload{margin-left:14px}.network-request-details-tab .expandable-title{padding-left:3px;background-color:var(--vscode-sideBar-background)}.network-request-details-tab .expandable-content{margin-left:0;padding-left:28px;line-height:24px}.network-request-details-header{margin:3px 0 3px 14px;font-weight:700}.network-request-details-header-count{color:var(--vscode-editorCodeLens-foreground);font-weight:400}.network-request-details-table{width:100%;line-height:18px;padding:8px 0 8px 8px;white-space:pre-wrap}.network-request-details-table td:first-of-type{width:30%;min-width:160px;vertical-align:top}.network-request-details-table td:nth-of-type(2){word-break:break-all;vertical-align:center}.network-request-details-tab .cm-wrapper{overflow:hidden}.network-response-body{flex:1}.network-request-request-body{max-height:100%}.network-request-request-body .expandable-content{height:100%}.network-font-preview{font-family:font-preview;font-size:30px;line-height:40px;padding:16px 16px 16px 6px;overflow:hidden;text-overflow:ellipsis;text-align:center}.network-font-preview-error{margin-top:8px;text-align:center}.network-websocket-message-row{display:flex;flex-direction:row;align-items:center;gap:8px;width:100%;padding:2px 8px;white-space:nowrap;overflow:hidden}.network-websocket-message-row .codicon{flex:none}.network-websocket-message-direction-send{color:var(--vscode-charts-green)}.network-websocket-message-direction-receive{color:var(--vscode-charts-red)}.network-websocket-message-preview{flex:auto;font-family:var(--vscode-editor-font-family);text-overflow:ellipsis;overflow:hidden}.network-websocket-message-opcode,.network-websocket-message-length,.network-websocket-message-time{flex:none;color:var(--vscode-descriptionForeground);font-variant-numeric:tabular-nums}.network-websocket-message-opcode{min-width:80px;text-align:left}.network-websocket-message-length,.network-websocket-message-time{min-width:64px;text-align:right}.network-websocket-message-detail{flex:auto;overflow:hidden}.network-websocket-message-detail-toolbar{padding:0 8px;border-bottom:1px solid var(--vscode-panel-border)}.network-websocket-message-detail-summary{color:var(--vscode-descriptionForeground);white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.network-websocket-message-detail-body{flex:auto;overflow:hidden}.tab-network .toolbar{min-height:30px!important;background-color:initial!important;border-bottom:1px solid var(--vscode-panel-border)}.tab-network .toolbar:after{box-shadow:none!important}.tab-network .tabbed-pane-tab.selected{font-weight:700}.copy-request-dropdown .copy-request-dropdown-toggle{margin-right:14px;width:135px}.copy-request-dropdown:not(:hover) .copy-request-dropdown-menu{display:none}.copy-request-dropdown .copy-request-dropdown-menu{position:absolute;display:flex;flex-direction:column;width:135px;z-index:10;background-color:var(--vscode-list-dropBackground)}.copy-request-dropdown .copy-request-dropdown-menu button{padding:8px;text-align:left}.green-circle:before,.red-circle:before,.yellow-circle:before{content:"";display:inline-block;width:12px;height:12px;border-radius:6px;margin-right:2px;align-self:center}.green-circle:before{background-color:var(--vscode-charts-green)}.red-circle:before{background-color:var(--vscode-charts-red)}.yellow-circle:before{background-color:var(--vscode-charts-yellow)}.tabbed-pane{display:flex;flex:auto;overflow:hidden}.tabbed-pane .toolbar{background-color:var(--vscode-sideBar-background)}.tabbed-pane .tab-content{display:flex;flex:auto;overflow:hidden;position:relative;flex-direction:column}.tabbed-pane-tab{padding:2px 6px 0;cursor:pointer;display:flex;align-items:center;justify-content:center;-webkit-user-select:none;user-select:none;border-bottom:2px solid transparent;outline:none;height:100%}.tabbed-pane-tab-label{max-width:250px;white-space:pre;overflow:hidden;text-overflow:ellipsis;display:inline-block}.tabbed-pane-tab.selected{background-color:var(--vscode-tab-activeBackground)}.tabbed-pane-tab-counter{padding:0 4px;background:var(--vscode-menu-separatorBackground);border-radius:8px;height:16px;margin-left:4px;line-height:16px;min-width:18px;display:flex;align-items:center;justify-content:center}.tabbed-pane-tab-counter.error{background:var(--vscode-list-errorForeground);color:var(--vscode-button-foreground)}.toolbar{position:relative;display:flex;color:var(--vscode-sideBarTitle-foreground);min-height:30px;align-items:center;flex:none;padding-right:4px}.toolbar.toolbar-sidebar-background{background-color:var(--vscode-sideBar-background)}.toolbar:not(.no-shadow):after{content:"";display:block;position:absolute;pointer-events:none;top:0;bottom:0;left:-2px;right:-2px;box-shadow:var(--vscode-scrollbar-shadow) 0 6px 6px -6px;z-index:100}.toolbar.no-min-height{min-height:0}.toolbar input{padding:0 5px;line-height:24px;outline:none;margin:0 4px}.toolbar select{background:none;outline:none;padding:3px;margin:2px}.toolbar option{background-color:var(--vscode-tab-activeBackground)}.toolbar input,.toolbar select{border:none;color:var(--vscode-input-foreground);background-color:var(--vscode-input-background)}.grid-view{display:flex;position:relative;flex:auto}.grid-view .list-view-entry{padding-left:0}.grid-view-cell{overflow:hidden;text-overflow:ellipsis;padding:0 5px;flex:none}.grid-view-header{-webkit-user-select:none;user-select:none;display:flex;flex:0 0 30px;align-items:center;flex-direction:row;border-bottom:1px solid var(--vscode-panel-border)}.grid-view-header .codicon-triangle-up,.grid-view-header .codicon-triangle-down{display:none}.grid-view-header>.filter-positive .codicon-triangle-down{display:initial!important}.grid-view-header>.filter-negative .codicon-triangle-up{display:initial!important}.grid-view-header-cell{flex:none;align-items:center;overflow:hidden;text-overflow:ellipsis;padding-left:10px;cursor:pointer;display:flex;white-space:nowrap}.grid-view-header-cell-title{overflow:hidden;text-overflow:ellipsis;flex:auto}.network-filters{display:flex;gap:16px;background-color:var(--vscode-sideBar-background);padding:4px 8px;min-height:32px}.network-filters input[type=search]{padding:0 5px}.network-filters-resource-types{display:flex;gap:8px;align-items:center}.network-filters-resource-type{cursor:pointer;border-radius:2px;padding:3px 8px;text-align:center;overflow:hidden;text-overflow:ellipsis}.network-filters-resource-type.selected{background-color:var(--vscode-list-inactiveSelectionBackground)}.snapshot-tab{align-items:stretch;outline:none;overflow:hidden}.snapshot-tab .toolbar{background-color:var(--vscode-sideBar-background)}.snapshot-tab .toolbar .pick-locator{margin:0 4px}.snapshot-controls{flex:none;background-color:var(--vscode-sideBar-background);color:var(--vscode-sideBarTitle-foreground);display:flex;box-shadow:var(--box-shadow);height:32px;align-items:center;justify-content:center}.snapshot-toggle{margin-top:4px;padding:4px 8px;cursor:pointer;border-radius:20px;margin-left:4px;width:60px;display:flex;align-items:center;justify-content:center}.snapshot-toggle:hover{background-color:#ededed}.snapshot-toggle.toggled{background:var(--gray);color:#fff}.snapshot-tab:focus .snapshot-toggle.toggled{background:var(--vscode-charts-blue)}.snapshot-wrapper{flex:auto;margin:1px;padding:10px;position:relative;--browser-frame-header-height: 40px}.snapshot-container{display:block;box-shadow:0 12px 28px #0003,0 2px 4px #0000001a}.snapshot-browser-body{height:calc(100% - var(--browser-frame-header-height));background:conic-gradient(#eee 25%,#ddd 0,#ddd 50%,#eee 0,#eee 75%,#ddd 0) 0 0 / 40px 40px}.snapshot-switcher{width:100%;height:100%;position:relative}iframe[name=snapshot]{position:absolute;top:0;left:0;width:100%;height:100%;border:none;background:light-dark(white,#333);visibility:hidden}iframe.snapshot-visible[name=snapshot]{visibility:visible}.no-snapshot{text-align:center;padding:50px}.snapshot-tab .cm-wrapper{line-height:23px;margin-right:4px}.browser-frame-dot{border-radius:50%;display:inline-block;height:12px;width:12px}.browser-frame-address-bar{background-color:var(--vscode-input-background);border-radius:12.5px;color:var(--vscode-input-foreground);flex:1 0;font:400 16px Arial,sans-serif;margin:0 16px 0 8px;padding:5px 15px;display:flex;align-items:center;height:28px}.browser-frame-address{flex:auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.browser-frame-menu-bar{background-color:#aaa;display:block;height:3px;margin:3px 0;width:17px}.browser-frame-header{align-items:center;background:#ebedf0;display:flex;padding:8px 16px;border-top-left-radius:6px;border-top-right-radius:6px;height:var(--browser-frame-header-height)}:root.dark-mode .browser-frame-header{background:#444950}.browser-traffic-lights{display:grid;white-space:nowrap;grid-template-columns:auto auto auto;column-gap:6px;margin-right:8px}.playback-scrubber{position:relative;height:16px;cursor:pointer;-webkit-user-select:none;user-select:none;flex:none;outline:none}.playback-scrubber:focus-visible .playback-thumb{box-shadow:0 0 0 2px var(--vscode-focusBorder)}.playback-track{position:absolute;top:7px;left:0;right:0;height:2px;background-color:var(--vscode-panel-border);border-radius:1px}.playback-track-filled{position:absolute;top:7px;left:0;height:2px;background-color:var(--vscode-focusBorder);border-radius:1px}.playback-track-filled.animated{transition:width .15s ease-out}.playback-tick{position:absolute;top:4px;width:1px;height:8px;background-color:var(--vscode-foreground)}.playback-thumb{position:absolute;top:3px;width:10px;height:10px;margin-left:-5px;border-radius:50%;background-color:var(--vscode-focusBorder);z-index:1}.playback-thumb.animated{transition:left .15s ease-out}.playback-speed{background:none;border:none;color:inherit;font-size:12px;cursor:pointer;padding:2px 6px;min-width:36px;text-align:center;-webkit-user-select:none;user-select:none;border-radius:3px}.playback-speed:hover{background-color:var(--vscode-toolbar-hoverBackground)}.source-tab{flex:auto;position:relative;overflow:hidden;display:flex;flex-direction:row}.source-tab-file-name{padding-left:8px;height:100%;display:flex;align-items:center;flex:1 1 auto}.source-tab-file-name div{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.stack-trace-frame-function{flex:1 1 100px;overflow:hidden;text-overflow:ellipsis}.stack-trace-frame-location{flex:1 1 100px;overflow:hidden;text-overflow:ellipsis;text-align:end}.stack-trace-frame-line{flex:none}.film-strip{flex:none;display:flex;flex-direction:column;position:relative}.film-strip-lanes{flex:none;display:flex;flex-direction:column;position:relative;min-height:50px;max-height:200px;overflow-x:hidden;overflow-y:auto}.film-strip-lane{flex:none;display:flex}.film-strip-frame{flex:none;pointer-events:none;box-shadow:var(--box-shadow)}.film-strip-hover{position:absolute;top:0;left:0;background-color:var(--vscode-panel-background);box-shadow:#0002 0 1.6px 10px,#0000001c 0 .3px 10px;z-index:200;pointer-events:none}.film-strip-hover-title{padding:2px 4px;display:flex;align-items:center;overflow:hidden;line-height:28px}.timeline-view-container{flex:none;border-bottom:1px solid var(--vscode-panel-border)}.timeline-view{flex:none;position:relative;display:flex;flex-direction:column;padding-top:16px;cursor:text;-webkit-user-select:none;user-select:none;margin-left:10px}.timeline-divider{position:absolute;width:1px;top:0;bottom:0;background-color:var(--vscode-panel-border)}.timeline-time{position:absolute;top:4px;right:3px;font-size:80%;white-space:nowrap;pointer-events:none}.timeline-time-input{cursor:pointer}.timeline-grid{position:absolute;top:0;right:0;bottom:0;left:0}.timeline-highlight{position:absolute;top:0;bottom:0;pointer-events:none;background-color:#1a85ff33;border-left:2px solid var(--vscode-charts-blue);border-right:2px solid var(--vscode-charts-blue)}.timeline-window{display:flex;position:absolute;top:0;bottom:20px;left:0;right:0;pointer-events:none}.timeline-window-center{flex:auto}.timeline-window-drag{height:20px;cursor:grab;pointer-events:all}.timeline-window-curtain{flex:none;background-color:#3879d91a}:root.dark-mode .timeline-window-curtain{background-color:#161718bf}.timeline-window-resizer{flex:none;width:10px;cursor:ew-resize;pointer-events:all;position:relative;background-color:var(--vscode-panel-border);border-left:1px solid var(--vscode-panel-border);border-right:1px solid var(--vscode-panel-border)}.annotations-tab{flex:auto;line-height:24px;white-space:pre;overflow:auto;-webkit-user-select:text;user-select:text}.annotation-item{margin:4px 8px;text-wrap:wrap}.workbench-run-status{height:30px;padding:4px 4px 4px 5px;flex:none;display:flex;flex-direction:row;align-items:center;border-bottom:1px solid var(--vscode-panel-border)}.workbench-run-status.failed{color:var(--vscode-errorForeground)}.workbench-run-status .codicon{margin-right:4px}.workbench-run-duration{display:flex;flex:none;align-items:center;color:var(--vscode-editorCodeLens-foreground)}.workbench-actions-hidden-count{padding-right:4px;-webkit-user-select:none;user-select:none;color:var(--vscode-editorCodeLens-foreground)}.workbench-action-filter{margin-top:3px;border-bottom:1px solid var(--vscode-panel-border);flex:none}.workbench-action-filter input[type=search]{width:100%;padding:4px 8px;line-height:20px}.settings-view{display:flex;flex:none;padding:4px 0;row-gap:8px;-webkit-user-select:none;user-select:none}.settings-view .setting{display:flex;align-items:center}.settings-view .setting label{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;cursor:pointer}.settings-view .setting input{margin-right:5px;flex-shrink:0}.settings-view .setting-select{display:grid;grid-template-rows:auto auto;row-gap:8px;margin:0 16px 0 22px;line-height:initial}.settings-view .setting-select:not(:first-child){margin-top:4px}.settings-view .setting-counter{padding:0 4px;background:var(--vscode-menu-separatorBackground);border-radius:9px;height:18px;margin-left:4px;line-height:18px;min-width:18px;display:inline-flex;align-items:center;justify-content:center}
.drop-target{display:flex;align-items:center;justify-content:center;flex:auto;flex-direction:column;background-color:var(--vscode-editor-background);position:absolute;top:0;right:0;bottom:0;left:0;z-index:100;line-height:24px}body .drop-target{background:#fffc}:root.dark-mode .drop-target{background:#000c}.drop-target .title{font-size:24px;font-weight:700;margin-bottom:30px}.drop-target .info{max-width:400px;text-align:center}.drop-target .processing-error{font-size:24px;color:#e74c3c;font-weight:700;text-align:center;margin:30px;white-space:pre-line}.drop-target input{margin-top:50px}.drop-target button{color:#fff;background-color:#007acc;padding:8px 12px;border:none;margin:30px 0;cursor:pointer}.drop-target .version{color:var(--vscode-disabledForeground);margin-top:8px}.progress-dialog{width:400px;top:0;right:0;bottom:0;left:0;border:none;outline:none;background-color:var(--vscode-sideBar-background)}.progress-dialog::backdrop{background-color:#0006}.progress-content{padding:16px}.progress-content .title{background-color:unset;font-size:18px;font-weight:700;padding:0}.progress-wrapper{background-color:var(--vscode-commandCenter-activeBackground);width:100%;margin-top:16px;margin-bottom:8px}.inner-progress{background-color:var(--vscode-progressBar-background);height:4px}.workbench-loader-header{display:flex;background-color:var(--vscode-sideBar-background);flex:none;flex-basis:48px;line-height:48px;font-size:16px;align-items:center;box-shadow:var(--vscode-scrollbar-shadow) 0 6px 6px -6px}.workbench-loader{contain:size}.workbench-loader .workbench-loader-header{flex-basis:32px;line-height:32px;font-size:13px}.workbench-loader .workbench-loader-header .toolbar-button{margin:4px}.workbench-loader .logo{margin-left:16px;display:flex;align-items:center}.workbench-loader .logo img{height:32px;width:32px;pointer-events:none;flex:none}.workbench-loader .product{font-weight:600;margin-left:16px;flex:none}.workbench-loader .workbench-loader-header .title{margin-left:16px;overflow:hidden;text-overflow:ellipsis;text-wrap:nowrap}html,body{min-width:550px;min-height:450px;overflow:auto}
import"./assets/urlMatch-BYQrIQwR.js";import{T as x,r,a as C,W as F,j as e,D as z,b as I,c as P,d as A,e as O,f as V}from"./assets/defaultSettingsView-BNmKHKpQ.js";const $=()=>{const[o,c]=r.useState(!1),[n,l]=r.useState(),[h,u]=r.useState(),[p,b]=r.useState(N),[f,j]=r.useState({done:0,total:0}),[k,v]=r.useState(!1),[y,m]=r.useState(null),[T,R]=r.useState(null),[U,E]=r.useState(!1),g=r.useCallback(t=>{const s=new URL(window.location.href);if(!t.length)return;const i=t.item(0),a=URL.createObjectURL(i);s.searchParams.append("trace",a);const d=s.toString();window.history.pushState({},"",d),l(a),u(i.name),v(!1),m(null)},[]);r.useEffect(()=>{const t=async s=>{var a;if(!((a=s.clipboardData)!=null&&a.files.length))return;const i=["application/zip","application/x-zip-compressed"];for(const d of s.clipboardData.files)if(!i.includes(d.type))return;s.preventDefault(),g(s.clipboardData.files)};return document.addEventListener("paste",t),()=>document.removeEventListener("paste",t)}),r.useEffect(()=>{const t=s=>{const{method:i,params:a}=s.data;if(i!=="load"||!((a==null?void 0:a.trace)instanceof Blob))return;const d=new File([a.trace],"trace.zip",{type:"application/zip"}),w=new DataTransfer;w.items.add(d),g(w.files)};return window.addEventListener("message",t),()=>window.removeEventListener("message",t)});const W=r.useCallback(t=>{t.preventDefault(),g(t.dataTransfer.files)},[g]),M=r.useCallback(t=>{t.preventDefault(),t.target.files&&g(t.target.files)},[g]);r.useEffect(()=>{const t=new URL(window.location.href).searchParams,s=t.get("trace");if(c(t.has("isServer")),s!=null&&s.startsWith("file:")){R(s||null);return}if(t.has("isServer")){const i=new URLSearchParams(window.location.search).get("ws"),a=new URL(`../${i}`,window.location.toString());a.protocol=window.location.protocol==="https:"?"wss:":"ws:";const d=new C(new F(a));d.onLoadTraceRequested(async w=>{l(w.traceUrl),v(!1),m(null)}),d.initialize({}).catch(()=>{})}else s&&!s.startsWith("blob:")&&l(s)},[]);const S=r.useCallback(async t=>{const s=new URLSearchParams;s.set("trace",t);const i=await fetch(`contexts?${s.toString()}`);if(!i.ok){const{error:w}=await i.json();return m(w),w}const a=await i.json(),d=new x(t,a);j({done:0,total:0}),m(null),b(d)},[]);r.useEffect(()=>{(async()=>{if(!n){b(N);return}const t=s=>{s.data.method==="progress"&&j(s.data.params)};try{navigator.serviceWorker.addEventListener("message",t),j({done:0,total:1});let s=await S(n);s!=null&&s.includes("please grant permission for Local Network Access")&&(await fetch(n,{method:"HEAD",headers:{"x-pw-serviceworker":"skip"}}),s=await S(n)),s&&(o||l(void 0))}finally{navigator.serviceWorker.removeEventListener("message",t)}})()},[o,n,h,S]);const D=f.done!==f.total&&f.total!==0&&!y;r.useEffect(()=>{if(D){const t=setTimeout(()=>{E(!0)},200);return()=>clearTimeout(t)}else E(!1)},[D]);const L=!!(!o&&!k&&!T&&(!n||y));return e.jsxs("div",{className:"vbox workbench-loader",onDragOver:t=>{t.preventDefault(),t.dataTransfer.types.includes("Files")&&v(!0)},children:[e.jsxs("div",{className:"hbox workbench-loader-header",...L?{inert:!0}:{},children:[e.jsx("div",{className:"logo",children:e.jsx("img",{src:"playwright-logo.svg",alt:"Playwright logo"})}),e.jsx("div",{className:"product",children:"Playwright"}),p.title&&e.jsx("div",{className:"title",children:p.title}),e.jsx("div",{className:"spacer"}),e.jsx(z,{icon:"settings-gear",title:"Settings",dialogDataTestId:"settings-toolbar-dialog",children:e.jsx(I,{location:"trace-viewer"})})]}),e.jsx(P,{model:p,inert:L}),T&&e.jsxs("div",{className:"drop-target",children:[e.jsx("div",{children:"Trace Viewer uses Service Workers to show traces. To view trace:"}),e.jsxs("div",{style:{paddingTop:20},children:[e.jsxs("div",{children:["1. Click ",e.jsx("a",{href:T,children:"here"})," to put your trace into the download shelf"]}),e.jsxs("div",{children:["2. Go to ",e.jsx("a",{href:"https://trace.playwright.dev",children:"trace.playwright.dev"})]}),e.jsx("div",{children:"3. Drop the trace from the download shelf into the page"})]})]}),e.jsx(A,{open:U,isModal:!0,className:"progress-dialog",children:e.jsxs("div",{className:"progress-content",children:[e.jsx("div",{className:"title",role:"heading","aria-level":1,children:"Loading Playwright Trace..."}),e.jsx("div",{className:"progress-wrapper",children:e.jsx("div",{className:"inner-progress",style:{width:f.total?100*f.done/f.total+"%":0}})})]})}),L&&e.jsxs("div",{className:"drop-target",children:[e.jsx("div",{className:"processing-error",role:"alert",children:y}),e.jsx("div",{className:"title",role:"heading","aria-level":1,children:"Drop Playwright Trace to load"}),e.jsx("div",{children:"or"}),e.jsx("button",{onClick:()=>{const t=document.createElement("input");t.type="file",t.click(),t.addEventListener("change",s=>M(s))},type:"button",children:"Select file"}),e.jsx("div",{className:"info",children:"Playwright Trace Viewer is a Progressive Web App, it does not send your trace anywhere, it opens it locally."}),e.jsxs("div",{className:"version",children:["Playwright v","1.61.1"]})]}),o&&!n&&e.jsx("div",{className:"drop-target",children:e.jsx("div",{className:"title",children:"Select test to see the trace"})}),k&&e.jsx("div",{className:"drop-target",onDragLeave:()=>{v(!1)},onDrop:t=>W(t),children:e.jsx("div",{className:"title",children:"Release to analyse the Playwright Trace"})})]})},N=new x("",[]),q=({traceJson:o})=>{const[c,n]=r.useState(void 0),[l,h]=r.useState(0),u=r.useRef(null);return r.useEffect(()=>(u.current&&clearTimeout(u.current),u.current=setTimeout(async()=>{try{const p=await B(o);n(p)}catch{const p=new x("",[]);n(p)}finally{h(l+1)}},500),()=>{u.current&&clearTimeout(u.current)}),[o,l]),e.jsx(P,{isLive:!0,model:c})};async function B(o){const c=new URLSearchParams;c.set("trace",o);const l=await(await fetch(`contexts?${c.toString()}`)).json();return new x(o,l)}(async()=>{const o=new URLSearchParams(window.location.search);if(O(),window.location.protocol!=="file:"){if(o.get("isUnderTest")==="true"&&await new Promise(h=>setTimeout(h,1e3)),!navigator.serviceWorker)throw new Error(`Service workers are not supported.
Make sure to serve the Trace Viewer (${window.location}) via HTTPS or localhost.`);navigator.serviceWorker.register("sw.bundle.js"),navigator.serviceWorker.controller||await new Promise(h=>{navigator.serviceWorker.oncontrollerchange=()=>h()}),setInterval(function(){fetch("ping")},1e4)}const c=o.get("trace"),l=(c==null?void 0:c.endsWith(".json"))?e.jsx(q,{traceJson:c}):e.jsx($,{});V.createRoot(document.querySelector("#root")).render(l)})();

<!DOCTYPE html>
<html lang="en" translate="no">
  <head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="icon" href="./playwright-logo.svg" type="image/svg+xml">
    <link rel="manifest" href="./manifest.webmanifest">
    <title>Playwright Trace Viewer</title>
    <script type="module" crossorigin src="./index.DMMX1gXU.js"></script>
    <link rel="modulepreload" crossorigin href="./assets/urlMatch-BYQrIQwR.js">
    <link rel="modulepreload" crossorigin href="./assets/defaultSettingsView-BNmKHKpQ.js">
    <link rel="stylesheet" crossorigin href="./defaultSettingsView.CjdS-WJx.css">
    <link rel="stylesheet" crossorigin href="./index.CzXZzn5A.css">
  </head>
  <body>
    <div id="root"></div>
    <dialog id="fallback-error">
      <p>The Playwright Trace Viewer must be loaded over the <code>http://</code> or <code>https://</code> protocols.</p>
      <p>For more information, please see the <a href="https://aka.ms/playwright/trace-viewer-file-protocol">docs</a>.</p>
    </dialog>
    <script>
      if (!/^https?:/.test(window.location.protocol)) {
        const fallbackErrorDialog = document.getElementById('fallback-error');
        const isTraceViewerInsidePlaywrightReport = window.location.protocol === 'file:' && window.location.pathname.endsWith('/trace/index.html');
        // Best-effort to show the report path in the dialog.
        if (isTraceViewerInsidePlaywrightReport) {
          const reportPath = (() => {
            const base = decodeURIComponent(window.location.pathname).replace(/\/trace\/index\.html$/, '');
            if (navigator.platform === 'Win32')
              return base.replace(/^\//, '').replace(/\//g, '\\\\');
            return base;
          })();
          const reportLink = document.createElement('div');
          const command = `npx playwright show-report "${reportPath}"`;
          reportLink.innerHTML = `You can open the report via <code>${command}</code> from your Playwright project. <button type="button">Copy Command</button>`;
          fallbackErrorDialog.insertBefore(reportLink, fallbackErrorDialog.children[1]);
          reportLink.querySelector('button').addEventListener('click', () => navigator.clipboard.writeText(command));
        }
        fallbackErrorDialog.show();
      }
    </script>
  </body>
</html>
{
    "theme_color": "#000",
    "background_color": "#fff",
    "display": "standalone",
    "start_url": "index.html",
    "name": "Playwright Trace Viewer",
    "short_name": "Trace Viewer",
    "icons": [
        {
            "src": "playwright-logo.svg",
            "sizes": "48x48 72x72 96x96 128x128 150x150 256x256 512x512 1024x1024",
            "type": "image/svg+xml",
            "purpose": "any"
        }
    ]
}
<svg width="400" height="400" viewBox="0 0 400 400" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M136.444 221.556C123.558 225.213 115.104 231.625 109.535 238.032C114.869 233.364 122.014 229.08 131.652 226.348C141.51 223.554 149.92 223.574 156.869 224.915V219.481C150.941 218.939 144.145 219.371 136.444 221.556ZM108.946 175.876L61.0895 188.484C61.0895 188.484 61.9617 189.716 63.5767 191.36L104.153 180.668C104.153 180.668 103.578 188.077 98.5847 194.705C108.03 187.559 108.946 175.876 108.946 175.876ZM149.005 288.347C81.6582 306.486 46.0272 228.438 35.2396 187.928C30.2556 169.229 28.0799 155.067 27.5 145.928C27.4377 144.979 27.4665 144.179 27.5336 143.446C24.04 143.657 22.3674 145.473 22.7077 150.721C23.2876 159.855 25.4633 174.016 30.4473 192.721C41.2301 233.225 76.8659 311.273 144.213 293.134C158.872 289.185 169.885 281.992 178.152 272.81C170.532 279.692 160.995 285.112 149.005 288.347ZM161.661 128.11V132.903H188.077C187.535 131.206 186.989 129.677 186.447 128.11H161.661Z" fill="#2D4552"/>
<path d="M193.981 167.584C205.861 170.958 212.144 179.287 215.465 186.658L228.711 190.42C228.711 190.42 226.904 164.623 203.57 157.995C181.741 151.793 168.308 170.124 166.674 172.496C173.024 167.972 182.297 164.268 193.981 167.584ZM299.422 186.777C277.573 180.547 264.145 198.916 262.535 201.255C268.89 196.736 278.158 193.031 289.837 196.362C301.698 199.741 307.976 208.06 311.307 215.436L324.572 219.212C324.572 219.212 322.736 193.41 299.422 186.777ZM286.262 254.795L176.072 223.99C176.072 223.99 177.265 230.038 181.842 237.869L274.617 263.805C282.255 259.386 286.262 254.795 286.262 254.795ZM209.867 321.102C122.618 297.71 133.166 186.543 147.284 133.865C153.097 112.156 159.073 96.0203 164.029 85.204C161.072 84.5953 158.623 86.1529 156.203 91.0746C150.941 101.747 144.212 119.124 137.7 143.45C123.586 196.127 113.038 307.29 200.283 330.682C241.406 341.699 273.442 324.955 297.323 298.659C274.655 319.19 245.714 330.701 209.867 321.102Z" fill="#2D4552"/>
<path d="M161.661 262.296V239.863L99.3324 257.537C99.3324 257.537 103.938 230.777 136.444 221.556C146.302 218.762 154.713 218.781 161.661 220.123V128.11H192.869C189.471 117.61 186.184 109.526 183.423 103.909C178.856 94.612 174.174 100.775 163.545 109.665C156.059 115.919 137.139 129.261 108.668 136.933C80.1966 144.61 57.179 142.574 47.5752 140.911C33.9601 138.562 26.8387 135.572 27.5049 145.928C28.0847 155.062 30.2605 169.224 35.2445 187.928C46.0272 228.433 81.663 306.481 149.01 288.342C166.602 283.602 179.019 274.233 187.626 262.291H161.661V262.296ZM61.0848 188.484L108.946 175.876C108.946 175.876 107.551 194.288 89.6087 199.018C71.6614 203.743 61.0848 188.484 61.0848 188.484Z" fill="#E2574C"/>
<path d="M341.786 129.174C329.345 131.355 299.498 134.072 262.612 124.185C225.716 114.304 201.236 97.0224 191.537 88.8994C177.788 77.3834 171.74 69.3802 165.788 81.4857C160.526 92.163 153.797 109.54 147.284 133.866C133.171 186.543 122.623 297.706 209.867 321.098C297.093 344.47 343.53 242.92 357.644 190.238C364.157 165.917 367.013 147.5 367.799 135.625C368.695 122.173 359.455 126.078 341.786 129.174ZM166.497 172.756C166.497 172.756 180.246 151.372 203.565 158C226.899 164.628 228.706 190.425 228.706 190.425L166.497 172.756ZM223.42 268.713C182.403 256.698 176.077 223.99 176.077 223.99L286.262 254.796C286.262 254.791 264.021 280.578 223.42 268.713ZM262.377 201.495C262.377 201.495 276.107 180.126 299.422 186.773C322.736 193.411 324.572 219.208 324.572 219.208L262.377 201.495Z" fill="#2EAD33"/>
<path d="M139.88 246.04L99.3324 257.532C99.3324 257.532 103.737 232.44 133.607 222.496L110.647 136.33L108.663 136.933C80.1918 144.611 57.1742 142.574 47.5704 140.911C33.9554 138.563 26.834 135.572 27.5001 145.929C28.08 155.063 30.2557 169.224 35.2397 187.929C46.0225 228.433 81.6583 306.481 149.005 288.342L150.989 287.719L139.88 246.04ZM61.0848 188.485L108.946 175.876C108.946 175.876 107.551 194.288 89.6087 199.018C71.6615 203.743 61.0848 188.485 61.0848 188.485Z" fill="#D65348"/>
<path d="M225.27 269.163L223.415 268.712C182.398 256.698 176.072 223.99 176.072 223.99L232.89 239.872L262.971 124.281L262.607 124.185C225.711 114.304 201.232 97.0224 191.532 88.8994C177.783 77.3834 171.735 69.3802 165.783 81.4857C160.526 92.163 153.797 109.54 147.284 133.866C133.171 186.543 122.623 297.706 209.867 321.097L211.655 321.5L225.27 269.163ZM166.497 172.756C166.497 172.756 180.246 151.372 203.565 158C226.899 164.628 228.706 190.425 228.706 190.425L166.497 172.756Z" fill="#1D8D22"/>
<path d="M141.946 245.451L131.072 248.537C133.641 263.019 138.169 276.917 145.276 289.195C146.513 288.922 147.74 288.687 149 288.342C152.302 287.451 155.364 286.348 158.312 285.145C150.371 273.361 145.118 259.789 141.946 245.451ZM137.7 143.451C132.112 164.307 127.113 194.326 128.489 224.436C130.952 223.367 133.554 222.371 136.444 221.551L138.457 221.101C136.003 188.939 141.308 156.165 147.284 133.866C148.799 128.225 150.318 122.978 151.832 118.085C149.393 119.637 146.767 121.228 143.776 122.867C141.759 129.093 139.722 135.898 137.7 143.451Z" fill="#C04B41"/>
</svg>

<!DOCTYPE html>
<html lang="en">
  <script type="module" crossorigin src="./snapshot.v8KI4P3m.js"></script>
  <link rel="modulepreload" crossorigin href="./assets/urlMatch-BYQrIQwR.js">

  <body>
    <iframe src="about:blank" sandbox="allow-same-origin allow-scripts" style="position:absolute;top:0;left:0;right:0;bottom:0;width:100%;height:100%;border:none;"></iframe>
  </body>
</html>
import{i as c}from"./assets/urlMatch-BYQrIQwR.js";(async()=>{if(!navigator.serviceWorker)throw new Error(`Service workers are not supported.
Make sure to serve the Trace Viewer (${window.location}) via HTTPS or localhost.`);navigator.serviceWorker.register("sw.bundle.js"),navigator.serviceWorker.controller||await new Promise(t=>navigator.serviceWorker.oncontrollerchange=t);const e=new URL(location.href).searchParams.get("trace"),o=new URLSearchParams;e&&o.set("trace",e),await fetch("contexts?"+o.toString());const r=new URLSearchParams(location.search).get("r");if(!r||!c(r,location.href))return;const a=document.querySelector("iframe");a&&(a.src=r)})();
class Xs{constructor(t,e){this._snapshotIds=new Map,this._snapshotStorage=t,this._resourceLoader=e}serveSnapshot(t,e,n){const r=this._snapshot(t,e);if(!r)return new Response(null,{status:404});const i=r.render();return this._snapshotIds.set(n,r),new Response(i.html,{status:200,headers:{"Content-Type":"text/html; charset=utf-8"}})}async serveClosestScreenshot(t,e){const n=this._snapshot(t,e),r=n==null?void 0:n.closestScreenshot();return r?new Response(await this._resourceLoader(r)):new Response(null,{status:404})}serveSnapshotInfo(t,e){const n=this._snapshot(t,e);return this._respondWithJson(n?{viewport:n.viewport(),url:n.snapshot().frameUrl,timestamp:n.snapshot().timestamp,wallTime:n.snapshot().wallTime}:{error:"No snapshot found"})}_snapshot(t,e){const n=e.get("name");return this._snapshotStorage.snapshotByName(t,n)}_respondWithJson(t){return new Response(JSON.stringify(t),{status:200,headers:{"Cache-Control":"public, max-age=31536000","Content-Type":"application/json"}})}async serveResource(t,e,n){let r;const i=this._snapshotIds.get(n);for(const T of t)if(r=i==null?void 0:i.resourceByUrl($s(T),e),r)break;if(!r)return new Response(null,{status:404});const a=r.response.content._sha1,o=a?await this._resourceLoader(a)||new Blob([]):new Blob([]);let c=r.response.content.mimeType;/^text\/|^application\/(javascript|json)/.test(c)&&!c.includes("charset")&&(c=`${c}; charset=utf-8`);const d=new Headers;c!=="x-unknown"&&d.set("Content-Type",c);for(const{name:T,value:A}of r.response.headers)d.set(T,A);d.delete("Content-Encoding"),d.delete("Access-Control-Allow-Origin"),d.set("Access-Control-Allow-Origin","*"),d.delete("Content-Length"),d.set("Content-Length",String(o.size)),this._snapshotStorage.hasResourceOverride(r.request.url)?d.set("Cache-Control","no-store, no-cache, max-age=0"):d.set("Cache-Control","public, max-age=31536000");const{status:m}=r.response,w=m===101||m===204||m===205||m===304;return new Response(w?null:o,{headers:d,status:r.response.status,statusText:r.response.statusText})}}function $s(s){try{const t=new URL(s);return t.hash="",t.toString()}catch{return s}}function Js(s){const t=new Map,{files:e,stacks:n}=s;for(const r of n){const[i,a]=r;t.set(`call@${i}`,a.map(o=>({file:e[o[0]],line:o[1],column:o[2],function:o[3]})))}return t}const Un={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function Qs(s){return s.replace(/[&<>"']/ug,t=>Un[t])}function zs(s){return s.replace(/[&<]/ug,t=>Un[t])}function Mt(s,t,e){return s.find((n,r)=>{if(r===s.length-1)return!0;const i=s[r+1];return Math.abs(t(n)-e)<Math.abs(t(i)-e)})}function Hn(s){return Array.isArray(s)&&typeof s[0]=="string"}function er(s){return Array.isArray(s)&&Array.isArray(s[0])}class tr{constructor(t,e,n,r,i){this._htmlCache=t,this._resources=e,this._snapshots=n,this._index=i,this._snapshot=n[i],this._callId=n[i].callId,this._screencastFrames=r,this.snapshotName=n[i].snapshotName}snapshot(){return this._snapshots[this._index]}viewport(){return this._snapshots[this._index].viewport}closestScreenshot(){var r;const{wallTime:t,timestamp:e}=this.snapshot(),n=t&&((r=this._screencastFrames[0])!=null&&r.frameSwapWallTime)?Mt(this._screencastFrames,i=>i.frameSwapWallTime,t):Mt(this._screencastFrames,i=>i.timestamp,e);return n==null?void 0:n.sha1}render(){const t=[],e=(i,a,o,c)=>{if(typeof i=="string"){o==="STYLE"||o==="style"?t.push(fr(or(i))):t.push(zs(i));return}if(er(i)){const h=a-i[0][0];if(h>=0&&h<=a){const d=rr(this._snapshots[h]),m=i[0][1];if(m>=0&&m<d.length)return e(d[m],h,o,c)}}else if(Hn(i)){const[h,d,...m]=i;if(h.toUpperCase()==="SCRIPT")return;const w=h.toUpperCase(),T=w==="NOSCRIPT"?"X-NOSCRIPT":h,A=Object.entries(d||{});t.push("<",T);const u="__playwright_current_src__",l=w==="IFRAME"||w==="FRAME",f=w==="A",p=w==="IMG",g=w==="META",C=p&&A.some(_=>_[0]===u),O=w==="SOURCE"&&o==="PICTURE"&&(c==null?void 0:c.some(_=>_[0]===u)),b=g&&A.some(_=>_[0].toLowerCase()==="http-equiv"&&!sr.has(_[1].trim().toLowerCase()));for(const[_,E]of A){let y=_;if(_.toLowerCase().startsWith("on"))continue;l&&_.toLowerCase()==="src"&&(y="__playwright_src__"),l&&(_.toLowerCase()==="srcdoc"||_.toLowerCase()==="sandbox")&&(y="__playwright_"+_.toLowerCase()+"__"),w==="OBJECT"&&_.toLowerCase()==="data"&&(y="__playwright_data__"),w==="EMBED"&&_.toLowerCase()==="src"&&(y="__playwright_src__"),p&&_===u&&(y="src"),["src","srcset"].includes(_.toLowerCase())&&(C||O)&&(y="_"+y),b&&(_.toLowerCase()==="http-equiv"||_.toLowerCase()==="content")&&(y="_"+_);let x=E;!f&&(_.toLowerCase()==="href"||_.toLowerCase()==="src"||_===u)&&(x=lt(E)),t.push(" ",y,'="',Qs(x),'"')}t.push(">");for(const _ of m)e(_,a,T,A);nr.has(T)||t.push("</",T,">");return}else return},n=this._snapshot;return{html:this._htmlCache.getOrCompute(this,()=>{var c;e(n.html,this._index,void 0,void 0);const i=(c=n.doctype)==null?void 0:c.replace(/[^a-zA-Z0-9]/g,""),o=(i?`<!DOCTYPE ${i}>`:"")+["<style>*,*::before,*::after { visibility: hidden }</style>",`<script>${ir(this.viewport(),this._callId,this.snapshotName)}<\/script>`].join("")+t.join("");return{value:o,size:o.length}}),pageId:n.pageId,frameId:n.frameId,index:this._index}}resourceByUrl(t,e){const n=this._snapshot;let r,i;for(const o of this._resources){if(typeof o._monotonicTime=="number"&&o._monotonicTime>=n.timestamp)break;o.response.status!==304&&o.request.url===t&&o.request.method===e&&(o._frameref===n.frameId?r=o:i=o)}let a=r??i;if(a&&e.toUpperCase()==="GET"){let o=n.resourceOverrides.find(c=>c.url===t);if(o!=null&&o.ref){const c=this._index-o.ref;c>=0&&c<this._snapshots.length&&(o=this._snapshots[c].resourceOverrides.find(h=>h.url===t))}o!=null&&o.sha1&&(a={...a,response:{...a.response,content:{...a.response.content,_sha1:o.sha1}}})}return a}}const nr=new Set(["AREA","BASE","BR","COL","COMMAND","EMBED","HR","IMG","INPUT","KEYGEN","LINK","MENUITEM","META","PARAM","SOURCE","TRACK","WBR"]),sr=new Set(["content-type","content-language","default-style","x-ua-compatible"]);function rr(s){if(!s._nodes){const t=[],e=n=>{if(typeof n=="string")t.push(n);else if(Hn(n)){const[,,...r]=n;for(const i of r)e(i);t.push(n)}};e(s.html),s._nodes=t}return s._nodes}function ir(s,...t){function e(r,i,...a){const o=window,c=new URLSearchParams(o.location.search),h=c.has("shouldPopulateCanvasFromScreenshot"),d=c.has("isUnderTest"),m={viewport:i,frames:new WeakMap};o.__playwright_frame_bounding_rects__=m;const w="Recorded click position in absolute coordinates did not match the center of the clicked element. This is either due to the use of provided offset, or due to a difference between the test runner and the trace viewer operating systems.",T=[],A=[],u=[],l=[];let f=o;for(;f!==f.parent&&!f.location.pathname.match(/\/page@[a-z0-9]+$/);)f=f.parent;const p=O=>{for(const _ of O.querySelectorAll("[__playwright_scroll_top_]"))T.push(_);for(const _ of O.querySelectorAll("[__playwright_scroll_left_]"))A.push(_);for(const _ of O.querySelectorAll("[__playwright_value_]")){const E=_;E.type!=="file"&&(E.value=E.getAttribute("__playwright_value_")),_.removeAttribute("__playwright_value_")}for(const _ of O.querySelectorAll("[__playwright_checked_]"))_.checked=_.getAttribute("__playwright_checked_")==="true",_.removeAttribute("__playwright_checked_");for(const _ of O.querySelectorAll("[__playwright_selected_]"))_.selected=_.getAttribute("__playwright_selected_")==="true",_.removeAttribute("__playwright_selected_");for(const _ of O.querySelectorAll("[__playwright_popover_open_]")){try{_.showPopover()}catch{}_.removeAttribute("__playwright_popover_open_")}for(const _ of O.querySelectorAll("[__playwright_dialog_open_]")){try{_.getAttribute("__playwright_dialog_open_")==="modal"?_.showModal():_.show()}catch{}_.removeAttribute("__playwright_dialog_open_")}const b=_=>{const E=_.style;E.outline="2px solid #006ab1",E.backgroundColor="#6fa8dc7f",u.push(_)};for(const _ of O.querySelectorAll('[__playwright_target__=""]'))b(_);for(const _ of a)if(_)for(const E of O.querySelectorAll(`[__playwright_target__="${_}"]`))b(E);for(const _ of O.querySelectorAll("iframe, frame")){const E=_.getAttribute("__playwright_bounding_rect__");_.removeAttribute("__playwright_bounding_rect__");const y=E?JSON.parse(E):void 0;y&&m.frames.set(_,{boundingRect:y,scrollLeft:0,scrollTop:0});const x=_.getAttribute("__playwright_src__");if(!x)_.setAttribute("src",r);else{const S=new URL(o.location.href),I=S.pathname.lastIndexOf("/snapshot/");I!==-1&&(S.pathname=S.pathname.substring(0,I+1)),S.pathname+=x.substring(1),_.setAttribute("src",S.toString())}}{const _=O.querySelector("body[__playwright_custom_elements__]");if(_&&o.customElements){const E=(_.getAttribute("__playwright_custom_elements__")||"").split(",");for(const y of E)o.customElements.define(y,class extends HTMLElement{})}}for(const _ of O.querySelectorAll("template[__playwright_shadow_root_]")){const E=_,y=E.parentElement.attachShadow({mode:"open"});y.appendChild(E.content),E.remove(),p(y)}for(const _ of O.querySelectorAll("a"))_.addEventListener("click",E=>{E.preventDefault()});if("adoptedStyleSheets"in O){const _=[...O.adoptedStyleSheets];for(const E of O.querySelectorAll("template[__playwright_style_sheet_]")){const y=E,x=new CSSStyleSheet;x.replaceSync(y.getAttribute("__playwright_style_sheet_")),_.push(x)}O.adoptedStyleSheets=_}l.push(...O.querySelectorAll("canvas"))},g=()=>{o.removeEventListener("load",g);for(const _ of T)_.scrollTop=+_.getAttribute("__playwright_scroll_top_"),_.removeAttribute("__playwright_scroll_top_"),m.frames.has(_)&&(m.frames.get(_).scrollTop=_.scrollTop);for(const _ of A)_.scrollLeft=+_.getAttribute("__playwright_scroll_left_"),_.removeAttribute("__playwright_scroll_left_"),m.frames.has(_)&&(m.frames.get(_).scrollLeft=_.scrollLeft);o.document.styleSheets[0].disabled=!0;const O=new URL(o.location.href).searchParams;if(o===f&&O.get("pointX")&&O.get("pointY")){const _=+O.get("pointX"),E=+O.get("pointY"),y=o.document.createElement("x-pw-pointer");y.style.position="fixed",y.style.backgroundColor="#f44336",y.style.width="20px",y.style.height="20px",y.style.borderRadius="10px",y.style.margin="-10px 0 0 -10px",y.style.zIndex="2147483646",y.style.display="flex",y.style.alignItems="center",y.style.justifyContent="center";const x=u[0],S=x==null?void 0:x.getBoundingClientRect(),I=x?{x:S.left+S.width/2,y:S.top+S.height/2}:null;if(y.style.left=((I==null?void 0:I.x)??_)+"px",y.style.top=((I==null?void 0:I.y)??E)+"px",!(!I||Math.abs(I.x-_)<=10&&Math.abs(I.y-E)<=10)){const D=o.document.createElement("x-pw-pointer-warning");D.textContent="âš ",D.style.fontSize="19px",D.style.color="white",D.style.marginTop="-3.5px",D.style.userSelect="none",y.appendChild(D),y.setAttribute("title",w)}o.document.documentElement.appendChild(y)}if(l.length>0){let _=function(y,x){function S(){const I=o.document.createElement("canvas");I.width=I.width/Math.floor(I.width/24),I.height=I.height/Math.floor(I.height/24);const R=I.getContext("2d");return R.fillStyle="lightgray",R.fillRect(0,0,I.width,I.height),R.fillStyle="white",R.fillRect(0,0,I.width/2,I.height/2),R.fillRect(I.width/2,I.height/2,I.width,I.height),R.createPattern(I,"repeat")}y.fillStyle=S(),y.fillRect(0,0,x.width,x.height)};const E=new Image;E.onload=()=>{var y;for(const x of l){const S=x.getContext("2d"),I=x.getAttribute("__playwright_bounding_rect__");if(x.removeAttribute("__playwright_bounding_rect__"),!I)continue;let R;try{R=JSON.parse(I)}catch{continue}let D=o;for(;D!==f;){const q=D.frameElement;D=D.parent;const N=(y=D.__playwright_frame_bounding_rects__)==null?void 0:y.frames.get(q);if(!(N!=null&&N.boundingRect))break;const K=N.boundingRect.left-N.scrollLeft,L=N.boundingRect.top-N.scrollTop;R.left+=K,R.top+=L,R.right+=K,R.bottom+=L}const{width:k,height:P}=f.__playwright_frame_bounding_rects__.viewport;R.left=R.left/k,R.top=R.top/P,R.right=R.right/k,R.bottom=R.bottom/P;const U=R.right>1||R.bottom>1;if(R.left>1||R.top>1){x.title="Playwright couldn't capture canvas contents because it's located outside the viewport.";continue}_(S,x),h?(S.drawImage(E,R.left*E.width,R.top*E.height,(R.right-R.left)*E.width,(R.bottom-R.top)*E.height,0,0,x.width,x.height),U?x.title="Playwright couldn't capture full canvas contents because it's located partially outside the viewport.":x.title="Canvas contents are displayed on a best-effort basis based on viewport screenshots taken during test execution."):x.title="Canvas content display is disabled.",d&&console.log("canvas drawn:",JSON.stringify([R.left,R.top,R.right-R.left,R.bottom-R.top].map(q=>Math.floor(q*100))))}},E.onerror=()=>{for(const y of l){const x=y.getContext("2d");_(x,y),y.title="Playwright couldn't show canvas contents because the screenshot failed to load."}},E.src=location.href.replace("/snapshot","/closest-screenshot")}},C=()=>p(o.document);o.addEventListener("load",g),o.addEventListener("DOMContentLoaded",C)}const n=r=>JSON.stringify(r).replace(/</g,"\\u003c");return`
(${e.toString()})(${n(ur)},${n(s)}${t.map(r=>`, ${n(String(r))}`).join("")})`}const Wn=["about:","blob:","data:","file:","ftp:","http:","https:","mailto:","sftp:","ws:","wss:"],Ut="http://playwright.bloburl/#";function lt(s){s.startsWith(Ut)&&(s=s.substring(Ut.length));try{const t=new URL(s);if(t.protocol==="javascript:"||t.protocol==="vbscript:")return"javascript:void(0)";const e=t.protocol==="blob:",n=t.protocol==="file:";if(!e&&!n&&Wn.includes(t.protocol))return s;const r="pw-"+t.protocol.slice(0,t.protocol.length-1);return n||(t.protocol="https:"),t.hostname=t.hostname?`${r}--${t.hostname}`:r,n&&(t.protocol="https:"),t.toString()}catch{return s}}const ar=/url\(['"]?([\w-]+:)\/\//ig;function or(s){return s.replace(ar,(t,e)=>!(e==="blob:")&&!(e==="file:")&&Wn.includes(e)?t:t.replace(e+"//",`https://pw-${e.slice(0,-1)}--`))}const cr=/url\(\s*'([^']*)'\s*\)/ig,lr=/url\(\s*"([^"]*)"\s*\)/ig;function fr(s){const t=(e,n)=>n.includes("</")?e.replace(n,encodeURI(n)):e;return s.replace(cr,t).replace(lr,t)}const ur="data:text/html;base64,"+btoa("<body></body><style>body { color-scheme: light dark; background: light-dark(white, #333) }</style>");class dr{constructor(t){this._maxSize=t,this._map=new Map,this._size=0}getOrCompute(t,e){if(this._map.has(t)){const r=this._map.get(t);return this._map.delete(t),this._map.set(t,r),r.value}const n=e();for(;this._map.size&&this._size+n.size>this._maxSize;){const[r,i]=this._map.entries().next().value;this._size-=i.size,this._map.delete(r)}return this._map.set(t,n),this._size+=n.size,n.value}}class _r{constructor(){this._frameSnapshots=new Map,this._cache=new dr(1e8),this._contextToResources=new Map,this._resourceUrlsWithOverrides=new Set}addResource(t,e){e.request.url=lt(e.request.url),this._ensureResourcesForContext(t).push(e)}addFrameSnapshot(t,e,n){for(const o of e.resourceOverrides)o.url=lt(o.url);let r=this._frameSnapshots.get(e.frameId);r||(r={raw:[],renderers:[]},this._frameSnapshots.set(e.frameId,r),e.isMainFrame&&this._frameSnapshots.set(e.pageId,r)),r.raw.push(e);const i=this._ensureResourcesForContext(t),a=new tr(this._cache,i,r.raw,n,r.raw.length-1);return r.renderers.push(a),a}snapshotByName(t,e){const n=this._frameSnapshots.get(t);return n==null?void 0:n.renderers.find(r=>r.snapshotName===e)}snapshotsForTest(){return[...this._frameSnapshots.keys()]}finalize(){for(const t of this._contextToResources.values())t.sort((e,n)=>(e._monotonicTime||0)-(n._monotonicTime||0));for(const t of this._frameSnapshots.values())for(const e of t.raw)for(const n of e.resourceOverrides)this._resourceUrlsWithOverrides.add(n.url)}hasResourceOverride(t){return this._resourceUrlsWithOverrides.has(t)}_ensureResourcesForContext(t){let e=this._contextToResources.get(t);return e||(e=[],this._contextToResources.set(t,e)),e}}class Bn extends Error{constructor(t){super(t),this.name="TraceVersionError"}}const Ht=8;class hr{constructor(t,e){this._actionMap=new Map,this._pageEntries=new Map,this._jsHandles=new Map,this._consoleObjects=new Map,this._contextEntry=t,this._snapshotStorage=e}appendTrace(t){for(const e of t.split(`
`))this._appendEvent(e)}actions(){return[...this._actionMap.values()]}_pageEntry(t){let e=this._pageEntries.get(t);return e||(e={pageId:t,screencastFrames:[]},this._pageEntries.set(t,e),this._contextEntry.pages.push(e)),e}_appendEvent(t){if(!t)return;const e=this._modernize(JSON.parse(t));for(const n of e)this._innerAppendEvent(n)}_innerAppendEvent(t){const e=this._contextEntry;switch(t.type){case"context-options":{if(t.version>Ht)throw new Bn("The trace was created by a newer version of Playwright and is not supported by this version of the viewer. Please use latest Playwright to open the trace.");this._version=t.version,e.origin=t.origin,e.browserName=t.browserName,e.channel=t.channel,e.title=t.title,e.platform=t.platform,e.playwrightVersion=t.playwrightVersion,e.wallTime=t.wallTime,e.startTime=t.monotonicTime,e.sdkLanguage=t.sdkLanguage,e.options=t.options,e.testIdAttributeName=t.testIdAttributeName,e.contextId=t.contextId??"",e.testTimeout=t.testTimeout;break}case"screencast-frame":{this._pageEntry(t.pageId).screencastFrames.push(t);break}case"before":{this._actionMap.set(t.callId,{...t,type:"action",endTime:0,log:[]});break}case"input":{const n=this._actionMap.get(t.callId);n.inputSnapshot=t.inputSnapshot,n.point=t.point;break}case"log":{const n=this._actionMap.get(t.callId);if(!n)return;n.log.push({time:t.time,message:t.message});break}case"after":{const n=this._actionMap.get(t.callId);n.afterSnapshot=t.afterSnapshot,n.endTime=t.endTime,n.result=t.result,n.error=t.error,n.attachments=t.attachments,n.annotations=t.annotations,t.point&&(n.point=t.point);break}case"action":{this._actionMap.set(t.callId,{...t,log:[]});break}case"event":{e.events.push(t);break}case"stdout":{e.stdio.push(t);break}case"stderr":{e.stdio.push(t);break}case"error":{e.errors.push(t);break}case"console":{e.events.push(t);break}case"resource-snapshot":this._snapshotStorage.addResource(this._contextEntry.contextId,t.snapshot),e.resources.push(t.snapshot);break;case"frame-snapshot":this._snapshotStorage.addFrameSnapshot(this._contextEntry.contextId,t.snapshot,this._pageEntry(t.snapshot.pageId).screencastFrames);break}"pageId"in t&&t.pageId&&this._pageEntry(t.pageId),(t.type==="action"||t.type==="before")&&(e.startTime=Math.min(e.startTime,t.startTime)),(t.type==="action"||t.type==="after")&&(e.endTime=Math.max(e.endTime,t.endTime)),t.type==="event"&&(e.startTime=Math.min(e.startTime,t.time),e.endTime=Math.max(e.endTime,t.time)),t.type==="screencast-frame"&&(e.startTime=Math.min(e.startTime,t.timestamp),e.endTime=Math.max(e.endTime,t.timestamp))}_processedContextCreatedEvent(){return this._version!==void 0}_modernize(t){let e=this._version??t.version??6,n=[t];for(;e<Ht;++e)n=this[`_modernize_${e}_to_${e+1}`].call(this,n);return n}_modernize_0_to_1(t){for(const e of t)e.type==="action"&&typeof e.metadata.error=="string"&&(e.metadata.error={error:{name:"Error",message:e.metadata.error}});return t}_modernize_1_to_2(t){var e;for(const n of t)n.type!=="frame-snapshot"||!n.snapshot.isMainFrame||(n.snapshot.viewport=((e=this._contextEntry.options)==null?void 0:e.viewport)||{width:1280,height:720});return t}_modernize_2_to_3(t){for(const e of t){if(e.type!=="resource-snapshot"||e.snapshot.request)continue;const n=e.snapshot;e.snapshot={_frameref:n.frameId,request:{url:n.url,method:n.method,headers:n.requestHeaders,postData:n.requestSha1?{_sha1:n.requestSha1}:void 0},response:{status:n.status,headers:n.responseHeaders,content:{mimeType:n.contentType,_sha1:n.responseSha1}},_monotonicTime:n.timestamp}}return t}_modernize_3_to_4(t){const e=[];for(const n of t){const r=this._modernize_event_3_to_4(n);r&&e.push(r)}return e}_modernize_event_3_to_4(t){var n,r,i,a;if(t.type!=="action"&&t.type!=="event")return t;const e=t.metadata;return e.internal||e.method.startsWith("tracing")?null:t.type==="event"?e.method==="__create__"&&e.type==="ConsoleMessage"?{type:"object",class:e.type,guid:e.params.guid,initializer:e.params.initializer}:{type:"event",time:e.startTime,class:e.type,method:e.method,params:e.params,pageId:e.pageId}:{type:"action",callId:e.id,startTime:e.startTime,endTime:e.endTime,apiName:e.apiName||e.type+"."+e.method,class:e.type,method:e.method,params:e.params,wallTime:e.wallTime||Date.now(),log:e.log,beforeSnapshot:(n=e.snapshots.find(o=>o.title==="before"))==null?void 0:n.snapshotName,inputSnapshot:(r=e.snapshots.find(o=>o.title==="input"))==null?void 0:r.snapshotName,afterSnapshot:(i=e.snapshots.find(o=>o.title==="after"))==null?void 0:i.snapshotName,error:(a=e.error)==null?void 0:a.error,result:e.result,point:e.point,pageId:e.pageId}}_modernize_4_to_5(t){const e=[];for(const n of t){const r=this._modernize_event_4_to_5(n);r&&e.push(r)}return e}_modernize_event_4_to_5(t){var e,n;if(t.type==="event"&&t.method==="__create__"&&t.class==="JSHandle"&&this._jsHandles.set(t.params.guid,t.params.initializer),t.type==="object"){if(t.class!=="ConsoleMessage")return null;const r=(e=t.initializer.args)==null?void 0:e.map(i=>{if(i.guid){const a=this._jsHandles.get(i.guid);return{preview:(a==null?void 0:a.preview)||"",value:""}}return{preview:i.preview||"",value:i.value||""}});return this._consoleObjects.set(t.guid,{type:t.initializer.type,text:t.initializer.text,location:t.initializer.location,args:r}),null}if(t.type==="event"&&t.method==="console"){const r=this._consoleObjects.get(((n=t.params.message)==null?void 0:n.guid)||"");return r?{type:"console",time:t.time,pageId:t.pageId,messageType:r.type,text:r.text,args:r.args,location:r.location}:null}return t}_modernize_5_to_6(t){const e=[];for(const n of t)if(e.push(n),!(n.type!=="after"||!n.log.length))for(const r of n.log)e.push({type:"log",callId:n.callId,message:r,time:-1});return e}_modernize_6_to_7(t){const e=[];if(!this._processedContextCreatedEvent()&&t[0].type!=="context-options"){const n={type:"context-options",origin:"testRunner",version:6,browserName:"",options:{},platform:"unknown",wallTime:0,monotonicTime:0,sdkLanguage:"javascript",contextId:""};e.push(n)}for(const n of t){if(n.type==="context-options"){e.push({...n,monotonicTime:0,origin:"library",contextId:""});continue}if(n.type==="before"||n.type==="action"){this._contextEntry.wallTime||(this._contextEntry.wallTime=n.wallTime);const r=n,i=n;i.stepId=`${r.apiName}@${r.wallTime}`,e.push(i)}else e.push(n)}return e}_modernize_7_to_8(t){const e=[];for(const n of t)if(n.type==="before"||n.type==="action"){const r=n,i=n;r.apiName&&(i.title=r.apiName,delete i.apiName),i.stepId=r.stepId??r.callId,e.push(i)}else e.push(n);return e}}class pr{constructor(){this.contextEntries=[],this._resourceToContentType=new Map}async load(t,e,n){var h,d,m;this._backend=t;const r=(h=e==null?void 0:e.match(/(.+)\.trace$/))==null?void 0:h[1],i=[];let a=!1;for(const w of await this._backend.entryNames()){const T=w.match(/(.+)\.trace$/);T&&(!r||r===T[1])&&i.push(T[1]||""),w.includes("src@")&&(a=!0)}if(!i.length)throw new Error("Cannot find .trace file");this._snapshotStorage=new _r;const o=i.length*3;let c=0;for(const w of i){const T=mr();T.hasSource=a;const A=new hr(T,this._snapshotStorage),u=await this._backend.readText(w+".trace")||"";A.appendTrace(u),n==null||n(++c,o);const l=await this._backend.readText(w+".network")||"";if(A.appendTrace(l),n==null||n(++c,o),T.actions=A.actions().sort((p,g)=>p.startTime-g.startTime),!t.isLive()){for(const p of T.actions.slice().reverse())if(!p.endTime&&!p.error)for(const g of T.actions)g.parentId===p.callId&&p.endTime<g.endTime&&(p.endTime=g.endTime)}const f=await this._backend.readText(w+".stacks");if(f){const p=Js(JSON.parse(f));for(const g of T.actions)g.stack=g.stack||p.get(g.callId)}n==null||n(++c,o);for(const p of T.resources)(d=p.request.postData)!=null&&d._sha1&&this._resourceToContentType.set(p.request.postData._sha1,Wt(p.request.postData.mimeType)),(m=p.response.content)!=null&&m._sha1&&this._resourceToContentType.set(p.response.content._sha1,Wt(p.response.content.mimeType));this.contextEntries.push(T)}this._snapshotStorage.finalize()}async hasEntry(t){return this._backend.hasEntry(t)}async resourceForSha1(t){const e=await this._backend.readBlob("resources/"+t),n=this._resourceToContentType.get(t);return!e||n===void 0||n==="x-unknown"?e:new Blob([e],{type:n})}storage(){return this._snapshotStorage}}function Wt(s){const t=s.match(/^(.*);\s*charset=.*$/);return t?t[1]:s}function mr(){return{origin:"testRunner",startTime:Number.MAX_SAFE_INTEGER,wallTime:Number.MAX_SAFE_INTEGER,endTime:0,browserName:"",options:{deviceScaleFactor:1,isMobile:!1,viewport:{width:1280,height:800}},pages:[],resources:[],actions:[],events:[],errors:[],stdio:[],hasSource:!1,contextId:""}}function wr(s,t){const e=new Array(t.length).fill(0);return new Array(t.length).fill(0).map((n,r)=>(i,a)=>{e[r]=i/a*t[r]*1e3,s(e.reduce((o,c)=>o+c,0),1e3)})}const gr=15,v=0,ne=1,br=2,X=-2,W=-3,Bt=-4,se=-5,$=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535],jn=1440,yr=0,Er=4,xr=9,Tr=5,Sr=[96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,192,80,7,10,0,8,96,0,8,32,0,9,160,0,8,0,0,8,128,0,8,64,0,9,224,80,7,6,0,8,88,0,8,24,0,9,144,83,7,59,0,8,120,0,8,56,0,9,208,81,7,17,0,8,104,0,8,40,0,9,176,0,8,8,0,8,136,0,8,72,0,9,240,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,200,81,7,13,0,8,100,0,8,36,0,9,168,0,8,4,0,8,132,0,8,68,0,9,232,80,7,8,0,8,92,0,8,28,0,9,152,84,7,83,0,8,124,0,8,60,0,9,216,82,7,23,0,8,108,0,8,44,0,9,184,0,8,12,0,8,140,0,8,76,0,9,248,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,196,81,7,11,0,8,98,0,8,34,0,9,164,0,8,2,0,8,130,0,8,66,0,9,228,80,7,7,0,8,90,0,8,26,0,9,148,84,7,67,0,8,122,0,8,58,0,9,212,82,7,19,0,8,106,0,8,42,0,9,180,0,8,10,0,8,138,0,8,74,0,9,244,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,204,81,7,15,0,8,102,0,8,38,0,9,172,0,8,6,0,8,134,0,8,70,0,9,236,80,7,9,0,8,94,0,8,30,0,9,156,84,7,99,0,8,126,0,8,62,0,9,220,82,7,27,0,8,110,0,8,46,0,9,188,0,8,14,0,8,142,0,8,78,0,9,252,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,194,80,7,10,0,8,97,0,8,33,0,9,162,0,8,1,0,8,129,0,8,65,0,9,226,80,7,6,0,8,89,0,8,25,0,9,146,83,7,59,0,8,121,0,8,57,0,9,210,81,7,17,0,8,105,0,8,41,0,9,178,0,8,9,0,8,137,0,8,73,0,9,242,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,202,81,7,13,0,8,101,0,8,37,0,9,170,0,8,5,0,8,133,0,8,69,0,9,234,80,7,8,0,8,93,0,8,29,0,9,154,84,7,83,0,8,125,0,8,61,0,9,218,82,7,23,0,8,109,0,8,45,0,9,186,0,8,13,0,8,141,0,8,77,0,9,250,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,198,81,7,11,0,8,99,0,8,35,0,9,166,0,8,3,0,8,131,0,8,67,0,9,230,80,7,7,0,8,91,0,8,27,0,9,150,84,7,67,0,8,123,0,8,59,0,9,214,82,7,19,0,8,107,0,8,43,0,9,182,0,8,11,0,8,139,0,8,75,0,9,246,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,206,81,7,15,0,8,103,0,8,39,0,9,174,0,8,7,0,8,135,0,8,71,0,9,238,80,7,9,0,8,95,0,8,31,0,9,158,84,7,99,0,8,127,0,8,63,0,9,222,82,7,27,0,8,111,0,8,47,0,9,190,0,8,15,0,8,143,0,8,79,0,9,254,96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,193,80,7,10,0,8,96,0,8,32,0,9,161,0,8,0,0,8,128,0,8,64,0,9,225,80,7,6,0,8,88,0,8,24,0,9,145,83,7,59,0,8,120,0,8,56,0,9,209,81,7,17,0,8,104,0,8,40,0,9,177,0,8,8,0,8,136,0,8,72,0,9,241,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,201,81,7,13,0,8,100,0,8,36,0,9,169,0,8,4,0,8,132,0,8,68,0,9,233,80,7,8,0,8,92,0,8,28,0,9,153,84,7,83,0,8,124,0,8,60,0,9,217,82,7,23,0,8,108,0,8,44,0,9,185,0,8,12,0,8,140,0,8,76,0,9,249,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,197,81,7,11,0,8,98,0,8,34,0,9,165,0,8,2,0,8,130,0,8,66,0,9,229,80,7,7,0,8,90,0,8,26,0,9,149,84,7,67,0,8,122,0,8,58,0,9,213,82,7,19,0,8,106,0,8,42,0,9,181,0,8,10,0,8,138,0,8,74,0,9,245,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,205,81,7,15,0,8,102,0,8,38,0,9,173,0,8,6,0,8,134,0,8,70,0,9,237,80,7,9,0,8,94,0,8,30,0,9,157,84,7,99,0,8,126,0,8,62,0,9,221,82,7,27,0,8,110,0,8,46,0,9,189,0,8,14,0,8,142,0,8,78,0,9,253,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,195,80,7,10,0,8,97,0,8,33,0,9,163,0,8,1,0,8,129,0,8,65,0,9,227,80,7,6,0,8,89,0,8,25,0,9,147,83,7,59,0,8,121,0,8,57,0,9,211,81,7,17,0,8,105,0,8,41,0,9,179,0,8,9,0,8,137,0,8,73,0,9,243,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,203,81,7,13,0,8,101,0,8,37,0,9,171,0,8,5,0,8,133,0,8,69,0,9,235,80,7,8,0,8,93,0,8,29,0,9,155,84,7,83,0,8,125,0,8,61,0,9,219,82,7,23,0,8,109,0,8,45,0,9,187,0,8,13,0,8,141,0,8,77,0,9,251,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,199,81,7,11,0,8,99,0,8,35,0,9,167,0,8,3,0,8,131,0,8,67,0,9,231,80,7,7,0,8,91,0,8,27,0,9,151,84,7,67,0,8,123,0,8,59,0,9,215,82,7,19,0,8,107,0,8,43,0,9,183,0,8,11,0,8,139,0,8,75,0,9,247,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,207,81,7,15,0,8,103,0,8,39,0,9,175,0,8,7,0,8,135,0,8,71,0,9,239,80,7,9,0,8,95,0,8,31,0,9,159,84,7,99,0,8,127,0,8,63,0,9,223,82,7,27,0,8,111,0,8,47,0,9,191,0,8,15,0,8,143,0,8,79,0,9,255],Rr=[80,5,1,87,5,257,83,5,17,91,5,4097,81,5,5,89,5,1025,85,5,65,93,5,16385,80,5,3,88,5,513,84,5,33,92,5,8193,82,5,9,90,5,2049,86,5,129,192,5,24577,80,5,2,87,5,385,83,5,25,91,5,6145,81,5,7,89,5,1537,85,5,97,93,5,24577,80,5,4,88,5,769,84,5,49,92,5,12289,82,5,13,90,5,3073,86,5,193,192,5,24577],Ar=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],Or=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,112,112],Cr=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],Ir=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],ie=15;function ft(){const s=this;let t,e,n,r,i,a;function o(h,d,m,w,T,A,u,l,f,p,g){let C,O,b,_,E,y,x,S,I,R,D,k,P,U,F;R=0,E=m;do n[h[d+R]]++,R++,E--;while(E!==0);if(n[0]==m)return u[0]=-1,l[0]=0,v;for(S=l[0],y=1;y<=ie&&n[y]===0;y++);for(x=y,S<y&&(S=y),E=ie;E!==0&&n[E]===0;E--);for(b=E,S>E&&(S=E),l[0]=S,U=1<<y;y<E;y++,U<<=1)if((U-=n[y])<0)return W;if((U-=n[E])<0)return W;for(n[E]+=U,a[1]=y=0,R=1,P=2;--E!==0;)a[P]=y+=n[R],P++,R++;E=0,R=0;do(y=h[d+R])!==0&&(g[a[y]++]=E),R++;while(++E<m);for(m=a[b],a[0]=E=0,R=0,_=-1,k=-S,i[0]=0,D=0,F=0;x<=b;x++)for(C=n[x];C--!==0;){for(;x>k+S;){if(_++,k+=S,F=b-k,F=F>S?S:F,(O=1<<(y=x-k))>C+1&&(O-=C+1,P=x,y<F))for(;++y<F&&!((O<<=1)<=n[++P]);)O-=n[P];if(F=1<<y,p[0]+F>jn)return W;i[_]=D=p[0],p[0]+=F,_!==0?(a[_]=E,r[0]=y,r[1]=S,y=E>>>k-S,r[2]=D-i[_-1]-y,f.set(r,(i[_-1]+y)*3)):u[0]=D}for(r[1]=x-k,R>=m?r[0]=192:g[R]<w?(r[0]=g[R]<256?0:96,r[2]=g[R++]):(r[0]=A[g[R]-w]+16+64,r[2]=T[g[R++]-w]),O=1<<x-k,y=E>>>k;y<F;y+=O)f.set(r,(D+y)*3);for(y=1<<x-1;(E&y)!==0;y>>>=1)E^=y;for(E^=y,I=(1<<k)-1;(E&I)!=a[_];)_--,k-=S,I=(1<<k)-1}return U!==0&&b!=1?se:v}function c(h){let d;for(t||(t=[],e=[],n=new Int32Array(ie+1),r=[],i=new Int32Array(ie),a=new Int32Array(ie+1)),e.length<h&&(e=[]),d=0;d<h;d++)e[d]=0;for(d=0;d<ie+1;d++)n[d]=0;for(d=0;d<3;d++)r[d]=0;i.set(n.subarray(0,ie),0),a.set(n.subarray(0,ie+1),0)}s.inflate_trees_bits=function(h,d,m,w,T){let A;return c(19),t[0]=0,A=o(h,0,19,19,null,null,m,d,w,t,e),A==W?T.msg="oversubscribed dynamic bit lengths tree":(A==se||d[0]===0)&&(T.msg="incomplete dynamic bit lengths tree",A=W),A},s.inflate_trees_dynamic=function(h,d,m,w,T,A,u,l,f){let p;return c(288),t[0]=0,p=o(m,0,h,257,Ar,Or,A,w,l,t,e),p!=v||w[0]===0?(p==W?f.msg="oversubscribed literal/length tree":p!=Bt&&(f.msg="incomplete literal/length tree",p=W),p):(c(288),p=o(m,h,d,0,Cr,Ir,u,T,l,t,e),p!=v||T[0]===0&&h>257?(p==W?f.msg="oversubscribed distance tree":p==se?(f.msg="incomplete distance tree",p=W):p!=Bt&&(f.msg="empty distance tree with lengths",p=W),p):v)}}ft.inflate_trees_fixed=function(s,t,e,n){return s[0]=xr,t[0]=Tr,e[0]=Sr,n[0]=Rr,v};const He=0,jt=1,qt=2,Gt=3,Yt=4,Vt=5,Zt=6,ze=7,Kt=8,We=9;function Nr(){const s=this;let t,e=0,n,r=0,i=0,a=0,o=0,c=0,h=0,d=0,m,w=0,T,A=0;function u(l,f,p,g,C,O,b,_){let E,y,x,S,I,R,D,k,P,U,F,q,N,K,L,M;D=_.next_in_index,k=_.avail_in,I=b.bitb,R=b.bitk,P=b.write,U=P<b.read?b.read-P-1:b.end-P,F=$[l],q=$[f];do{for(;R<20;)k--,I|=(_.read_byte(D++)&255)<<R,R+=8;if(E=I&F,y=p,x=g,M=(x+E)*3,(S=y[M])===0){I>>=y[M+1],R-=y[M+1],b.win[P++]=y[M+2],U--;continue}do{if(I>>=y[M+1],R-=y[M+1],(S&16)!==0){for(S&=15,N=y[M+2]+(I&$[S]),I>>=S,R-=S;R<15;)k--,I|=(_.read_byte(D++)&255)<<R,R+=8;E=I&q,y=C,x=O,M=(x+E)*3,S=y[M];do if(I>>=y[M+1],R-=y[M+1],(S&16)!==0){for(S&=15;R<S;)k--,I|=(_.read_byte(D++)&255)<<R,R+=8;if(K=y[M+2]+(I&$[S]),I>>=S,R-=S,U-=N,P>=K)L=P-K,P-L>0&&2>P-L?(b.win[P++]=b.win[L++],b.win[P++]=b.win[L++],N-=2):(b.win.set(b.win.subarray(L,L+2),P),P+=2,L+=2,N-=2);else{L=P-K;do L+=b.end;while(L<0);if(S=b.end-L,N>S){if(N-=S,P-L>0&&S>P-L)do b.win[P++]=b.win[L++];while(--S!==0);else b.win.set(b.win.subarray(L,L+S),P),P+=S,L+=S,S=0;L=0}}if(P-L>0&&N>P-L)do b.win[P++]=b.win[L++];while(--N!==0);else b.win.set(b.win.subarray(L,L+N),P),P+=N,L+=N,N=0;break}else if((S&64)===0)E+=y[M+2],E+=I&$[S],M=(x+E)*3,S=y[M];else return _.msg="invalid distance code",N=_.avail_in-k,N=R>>3<N?R>>3:N,k+=N,D-=N,R-=N<<3,b.bitb=I,b.bitk=R,_.avail_in=k,_.total_in+=D-_.next_in_index,_.next_in_index=D,b.write=P,W;while(!0);break}if((S&64)===0){if(E+=y[M+2],E+=I&$[S],M=(x+E)*3,(S=y[M])===0){I>>=y[M+1],R-=y[M+1],b.win[P++]=y[M+2],U--;break}}else return(S&32)!==0?(N=_.avail_in-k,N=R>>3<N?R>>3:N,k+=N,D-=N,R-=N<<3,b.bitb=I,b.bitk=R,_.avail_in=k,_.total_in+=D-_.next_in_index,_.next_in_index=D,b.write=P,ne):(_.msg="invalid literal/length code",N=_.avail_in-k,N=R>>3<N?R>>3:N,k+=N,D-=N,R-=N<<3,b.bitb=I,b.bitk=R,_.avail_in=k,_.total_in+=D-_.next_in_index,_.next_in_index=D,b.write=P,W)}while(!0)}while(U>=258&&k>=10);return N=_.avail_in-k,N=R>>3<N?R>>3:N,k+=N,D-=N,R-=N<<3,b.bitb=I,b.bitk=R,_.avail_in=k,_.total_in+=D-_.next_in_index,_.next_in_index=D,b.write=P,v}s.init=function(l,f,p,g,C,O){t=He,h=l,d=f,m=p,w=g,T=C,A=O,n=null},s.proc=function(l,f,p){let g,C,O,b=0,_=0,E=0,y,x,S,I;for(E=f.next_in_index,y=f.avail_in,b=l.bitb,_=l.bitk,x=l.write,S=x<l.read?l.read-x-1:l.end-x;;)switch(t){case He:if(S>=258&&y>=10&&(l.bitb=b,l.bitk=_,f.avail_in=y,f.total_in+=E-f.next_in_index,f.next_in_index=E,l.write=x,p=u(h,d,m,w,T,A,l,f),E=f.next_in_index,y=f.avail_in,b=l.bitb,_=l.bitk,x=l.write,S=x<l.read?l.read-x-1:l.end-x,p!=v)){t=p==ne?ze:We;break}i=h,n=m,r=w,t=jt;case jt:for(g=i;_<g;){if(y!==0)p=v;else return l.bitb=b,l.bitk=_,f.avail_in=y,f.total_in+=E-f.next_in_index,f.next_in_index=E,l.write=x,l.inflate_flush(f,p);y--,b|=(f.read_byte(E++)&255)<<_,_+=8}if(C=(r+(b&$[g]))*3,b>>>=n[C+1],_-=n[C+1],O=n[C],O===0){a=n[C+2],t=Zt;break}if((O&16)!==0){o=O&15,e=n[C+2],t=qt;break}if((O&64)===0){i=O,r=C/3+n[C+2];break}if((O&32)!==0){t=ze;break}return t=We,f.msg="invalid literal/length code",p=W,l.bitb=b,l.bitk=_,f.avail_in=y,f.total_in+=E-f.next_in_index,f.next_in_index=E,l.write=x,l.inflate_flush(f,p);case qt:for(g=o;_<g;){if(y!==0)p=v;else return l.bitb=b,l.bitk=_,f.avail_in=y,f.total_in+=E-f.next_in_index,f.next_in_index=E,l.write=x,l.inflate_flush(f,p);y--,b|=(f.read_byte(E++)&255)<<_,_+=8}e+=b&$[g],b>>=g,_-=g,i=d,n=T,r=A,t=Gt;case Gt:for(g=i;_<g;){if(y!==0)p=v;else return l.bitb=b,l.bitk=_,f.avail_in=y,f.total_in+=E-f.next_in_index,f.next_in_index=E,l.write=x,l.inflate_flush(f,p);y--,b|=(f.read_byte(E++)&255)<<_,_+=8}if(C=(r+(b&$[g]))*3,b>>=n[C+1],_-=n[C+1],O=n[C],(O&16)!==0){o=O&15,c=n[C+2],t=Yt;break}if((O&64)===0){i=O,r=C/3+n[C+2];break}return t=We,f.msg="invalid distance code",p=W,l.bitb=b,l.bitk=_,f.avail_in=y,f.total_in+=E-f.next_in_index,f.next_in_index=E,l.write=x,l.inflate_flush(f,p);case Yt:for(g=o;_<g;){if(y!==0)p=v;else return l.bitb=b,l.bitk=_,f.avail_in=y,f.total_in+=E-f.next_in_index,f.next_in_index=E,l.write=x,l.inflate_flush(f,p);y--,b|=(f.read_byte(E++)&255)<<_,_+=8}c+=b&$[g],b>>=g,_-=g,t=Vt;case Vt:for(I=x-c;I<0;)I+=l.end;for(;e!==0;){if(S===0&&(x==l.end&&l.read!==0&&(x=0,S=x<l.read?l.read-x-1:l.end-x),S===0&&(l.write=x,p=l.inflate_flush(f,p),x=l.write,S=x<l.read?l.read-x-1:l.end-x,x==l.end&&l.read!==0&&(x=0,S=x<l.read?l.read-x-1:l.end-x),S===0)))return l.bitb=b,l.bitk=_,f.avail_in=y,f.total_in+=E-f.next_in_index,f.next_in_index=E,l.write=x,l.inflate_flush(f,p);l.win[x++]=l.win[I++],S--,I==l.end&&(I=0),e--}t=He;break;case Zt:if(S===0&&(x==l.end&&l.read!==0&&(x=0,S=x<l.read?l.read-x-1:l.end-x),S===0&&(l.write=x,p=l.inflate_flush(f,p),x=l.write,S=x<l.read?l.read-x-1:l.end-x,x==l.end&&l.read!==0&&(x=0,S=x<l.read?l.read-x-1:l.end-x),S===0)))return l.bitb=b,l.bitk=_,f.avail_in=y,f.total_in+=E-f.next_in_index,f.next_in_index=E,l.write=x,l.inflate_flush(f,p);p=v,l.win[x++]=a,S--,t=He;break;case ze:if(_>7&&(_-=8,y++,E--),l.write=x,p=l.inflate_flush(f,p),x=l.write,S=x<l.read?l.read-x-1:l.end-x,l.read!=l.write)return l.bitb=b,l.bitk=_,f.avail_in=y,f.total_in+=E-f.next_in_index,f.next_in_index=E,l.write=x,l.inflate_flush(f,p);t=Kt;case Kt:return p=ne,l.bitb=b,l.bitk=_,f.avail_in=y,f.total_in+=E-f.next_in_index,f.next_in_index=E,l.write=x,l.inflate_flush(f,p);case We:return p=W,l.bitb=b,l.bitk=_,f.avail_in=y,f.total_in+=E-f.next_in_index,f.next_in_index=E,l.write=x,l.inflate_flush(f,p);default:return p=X,l.bitb=b,l.bitk=_,f.avail_in=y,f.total_in+=E-f.next_in_index,f.next_in_index=E,l.write=x,l.inflate_flush(f,p)}},s.free=function(){}}const Xt=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],we=0,et=1,$t=2,Jt=3,Qt=4,zt=5,Be=6,je=7,en=8,he=9;function Dr(s,t){const e=this;let n=we,r=0,i=0,a=0,o;const c=[0],h=[0],d=new Nr;let m=0,w=new Int32Array(jn*3);const T=0,A=new ft;e.bitk=0,e.bitb=0,e.win=new Uint8Array(t),e.end=t,e.read=0,e.write=0,e.reset=function(u,l){l&&(l[0]=T),n==Be&&d.free(u),n=we,e.bitk=0,e.bitb=0,e.read=e.write=0},e.reset(s,null),e.inflate_flush=function(u,l){let f,p,g;return p=u.next_out_index,g=e.read,f=(g<=e.write?e.write:e.end)-g,f>u.avail_out&&(f=u.avail_out),f!==0&&l==se&&(l=v),u.avail_out-=f,u.total_out+=f,u.next_out.set(e.win.subarray(g,g+f),p),p+=f,g+=f,g==e.end&&(g=0,e.write==e.end&&(e.write=0),f=e.write-g,f>u.avail_out&&(f=u.avail_out),f!==0&&l==se&&(l=v),u.avail_out-=f,u.total_out+=f,u.next_out.set(e.win.subarray(g,g+f),p),p+=f,g+=f),u.next_out_index=p,e.read=g,l},e.proc=function(u,l){let f,p,g,C,O,b,_,E;for(C=u.next_in_index,O=u.avail_in,p=e.bitb,g=e.bitk,b=e.write,_=b<e.read?e.read-b-1:e.end-b;;){let y,x,S,I,R,D,k,P;switch(n){case we:for(;g<3;){if(O!==0)l=v;else return e.bitb=p,e.bitk=g,u.avail_in=O,u.total_in+=C-u.next_in_index,u.next_in_index=C,e.write=b,e.inflate_flush(u,l);O--,p|=(u.read_byte(C++)&255)<<g,g+=8}switch(f=p&7,m=f&1,f>>>1){case 0:p>>>=3,g-=3,f=g&7,p>>>=f,g-=f,n=et;break;case 1:y=[],x=[],S=[[]],I=[[]],ft.inflate_trees_fixed(y,x,S,I),d.init(y[0],x[0],S[0],0,I[0],0),p>>>=3,g-=3,n=Be;break;case 2:p>>>=3,g-=3,n=Jt;break;case 3:return p>>>=3,g-=3,n=he,u.msg="invalid block type",l=W,e.bitb=p,e.bitk=g,u.avail_in=O,u.total_in+=C-u.next_in_index,u.next_in_index=C,e.write=b,e.inflate_flush(u,l)}break;case et:for(;g<32;){if(O!==0)l=v;else return e.bitb=p,e.bitk=g,u.avail_in=O,u.total_in+=C-u.next_in_index,u.next_in_index=C,e.write=b,e.inflate_flush(u,l);O--,p|=(u.read_byte(C++)&255)<<g,g+=8}if((~p>>>16&65535)!=(p&65535))return n=he,u.msg="invalid stored block lengths",l=W,e.bitb=p,e.bitk=g,u.avail_in=O,u.total_in+=C-u.next_in_index,u.next_in_index=C,e.write=b,e.inflate_flush(u,l);r=p&65535,p=g=0,n=r!==0?$t:m!==0?je:we;break;case $t:if(O===0||_===0&&(b==e.end&&e.read!==0&&(b=0,_=b<e.read?e.read-b-1:e.end-b),_===0&&(e.write=b,l=e.inflate_flush(u,l),b=e.write,_=b<e.read?e.read-b-1:e.end-b,b==e.end&&e.read!==0&&(b=0,_=b<e.read?e.read-b-1:e.end-b),_===0)))return e.bitb=p,e.bitk=g,u.avail_in=O,u.total_in+=C-u.next_in_index,u.next_in_index=C,e.write=b,e.inflate_flush(u,l);if(l=v,f=r,f>O&&(f=O),f>_&&(f=_),e.win.set(u.read_buf(C,f),b),C+=f,O-=f,b+=f,_-=f,(r-=f)!==0)break;n=m!==0?je:we;break;case Jt:for(;g<14;){if(O!==0)l=v;else return e.bitb=p,e.bitk=g,u.avail_in=O,u.total_in+=C-u.next_in_index,u.next_in_index=C,e.write=b,e.inflate_flush(u,l);O--,p|=(u.read_byte(C++)&255)<<g,g+=8}if(i=f=p&16383,(f&31)>29||(f>>5&31)>29)return n=he,u.msg="too many length or distance symbols",l=W,e.bitb=p,e.bitk=g,u.avail_in=O,u.total_in+=C-u.next_in_index,u.next_in_index=C,e.write=b,e.inflate_flush(u,l);if(f=258+(f&31)+(f>>5&31),!o||o.length<f)o=[];else for(E=0;E<f;E++)o[E]=0;p>>>=14,g-=14,a=0,n=Qt;case Qt:for(;a<4+(i>>>10);){for(;g<3;){if(O!==0)l=v;else return e.bitb=p,e.bitk=g,u.avail_in=O,u.total_in+=C-u.next_in_index,u.next_in_index=C,e.write=b,e.inflate_flush(u,l);O--,p|=(u.read_byte(C++)&255)<<g,g+=8}o[Xt[a++]]=p&7,p>>>=3,g-=3}for(;a<19;)o[Xt[a++]]=0;if(c[0]=7,f=A.inflate_trees_bits(o,c,h,w,u),f!=v)return l=f,l==W&&(o=null,n=he),e.bitb=p,e.bitk=g,u.avail_in=O,u.total_in+=C-u.next_in_index,u.next_in_index=C,e.write=b,e.inflate_flush(u,l);a=0,n=zt;case zt:for(;f=i,!(a>=258+(f&31)+(f>>5&31));){let U,F;for(f=c[0];g<f;){if(O!==0)l=v;else return e.bitb=p,e.bitk=g,u.avail_in=O,u.total_in+=C-u.next_in_index,u.next_in_index=C,e.write=b,e.inflate_flush(u,l);O--,p|=(u.read_byte(C++)&255)<<g,g+=8}if(f=w[(h[0]+(p&$[f]))*3+1],F=w[(h[0]+(p&$[f]))*3+2],F<16)p>>>=f,g-=f,o[a++]=F;else{for(E=F==18?7:F-14,U=F==18?11:3;g<f+E;){if(O!==0)l=v;else return e.bitb=p,e.bitk=g,u.avail_in=O,u.total_in+=C-u.next_in_index,u.next_in_index=C,e.write=b,e.inflate_flush(u,l);O--,p|=(u.read_byte(C++)&255)<<g,g+=8}if(p>>>=f,g-=f,U+=p&$[E],p>>>=E,g-=E,E=a,f=i,E+U>258+(f&31)+(f>>5&31)||F==16&&E<1)return o=null,n=he,u.msg="invalid bit length repeat",l=W,e.bitb=p,e.bitk=g,u.avail_in=O,u.total_in+=C-u.next_in_index,u.next_in_index=C,e.write=b,e.inflate_flush(u,l);F=F==16?o[E-1]:0;do o[E++]=F;while(--U!==0);a=E}}if(h[0]=-1,R=[],D=[],k=[],P=[],R[0]=9,D[0]=6,f=i,f=A.inflate_trees_dynamic(257+(f&31),1+(f>>5&31),o,R,D,k,P,w,u),f!=v)return f==W&&(o=null,n=he),l=f,e.bitb=p,e.bitk=g,u.avail_in=O,u.total_in+=C-u.next_in_index,u.next_in_index=C,e.write=b,e.inflate_flush(u,l);d.init(R[0],D[0],w,k[0],w,P[0]),n=Be;case Be:if(e.bitb=p,e.bitk=g,u.avail_in=O,u.total_in+=C-u.next_in_index,u.next_in_index=C,e.write=b,(l=d.proc(e,u,l))!=ne)return e.inflate_flush(u,l);if(l=v,d.free(u),C=u.next_in_index,O=u.avail_in,p=e.bitb,g=e.bitk,b=e.write,_=b<e.read?e.read-b-1:e.end-b,m===0){n=we;break}n=je;case je:if(e.write=b,l=e.inflate_flush(u,l),b=e.write,_=b<e.read?e.read-b-1:e.end-b,e.read!=e.write)return e.bitb=p,e.bitk=g,u.avail_in=O,u.total_in+=C-u.next_in_index,u.next_in_index=C,e.write=b,e.inflate_flush(u,l);n=en;case en:return l=ne,e.bitb=p,e.bitk=g,u.avail_in=O,u.total_in+=C-u.next_in_index,u.next_in_index=C,e.write=b,e.inflate_flush(u,l);case he:return l=W,e.bitb=p,e.bitk=g,u.avail_in=O,u.total_in+=C-u.next_in_index,u.next_in_index=C,e.write=b,e.inflate_flush(u,l);default:return l=X,e.bitb=p,e.bitk=g,u.avail_in=O,u.total_in+=C-u.next_in_index,u.next_in_index=C,e.write=b,e.inflate_flush(u,l)}}},e.free=function(u){e.reset(u,null),e.win=null,w=null},e.set_dictionary=function(u,l,f){e.win.set(u.subarray(l,l+f),0),e.read=e.write=f},e.sync_point=function(){return n==et?1:0}}const Pr=32,kr=8,Lr=0,tn=1,nn=2,sn=3,rn=4,an=5,tt=6,Se=7,on=12,ae=13,vr=[0,0,255,255];function Fr(){const s=this;s.mode=0,s.method=0,s.was=[0],s.need=0,s.marker=0,s.wbits=0;function t(e){return!e||!e.istate?X:(e.total_in=e.total_out=0,e.msg=null,e.istate.mode=Se,e.istate.blocks.reset(e,null),v)}s.inflateEnd=function(e){return s.blocks&&s.blocks.free(e),s.blocks=null,v},s.inflateInit=function(e,n){return e.msg=null,s.blocks=null,n<8||n>15?(s.inflateEnd(e),X):(s.wbits=n,e.istate.blocks=new Dr(e,1<<n),t(e),v)},s.inflate=function(e,n){let r,i;if(!e||!e.istate||!e.next_in)return X;const a=e.istate;for(n=n==Er?se:v,r=se;;)switch(a.mode){case Lr:if(e.avail_in===0)return r;if(r=n,e.avail_in--,e.total_in++,((a.method=e.read_byte(e.next_in_index++))&15)!=kr){a.mode=ae,e.msg="unknown compression method",a.marker=5;break}if((a.method>>4)+8>a.wbits){a.mode=ae,e.msg="invalid win size",a.marker=5;break}a.mode=tn;case tn:if(e.avail_in===0)return r;if(r=n,e.avail_in--,e.total_in++,i=e.read_byte(e.next_in_index++)&255,((a.method<<8)+i)%31!==0){a.mode=ae,e.msg="incorrect header check",a.marker=5;break}if((i&Pr)===0){a.mode=Se;break}a.mode=nn;case nn:if(e.avail_in===0)return r;r=n,e.avail_in--,e.total_in++,a.need=(e.read_byte(e.next_in_index++)&255)<<24&4278190080,a.mode=sn;case sn:if(e.avail_in===0)return r;r=n,e.avail_in--,e.total_in++,a.need+=(e.read_byte(e.next_in_index++)&255)<<16&16711680,a.mode=rn;case rn:if(e.avail_in===0)return r;r=n,e.avail_in--,e.total_in++,a.need+=(e.read_byte(e.next_in_index++)&255)<<8&65280,a.mode=an;case an:return e.avail_in===0?r:(r=n,e.avail_in--,e.total_in++,a.need+=e.read_byte(e.next_in_index++)&255,a.mode=tt,br);case tt:return a.mode=ae,e.msg="need dictionary",a.marker=0,X;case Se:if(r=a.blocks.proc(e,r),r==W){a.mode=ae,a.marker=0;break}if(r==v&&(r=n),r!=ne)return r;r=n,a.blocks.reset(e,a.was),a.mode=on;case on:return e.avail_in=0,ne;case ae:return W;default:return X}},s.inflateSetDictionary=function(e,n,r){let i=0,a=r;if(!e||!e.istate||e.istate.mode!=tt)return X;const o=e.istate;return a>=1<<o.wbits&&(a=(1<<o.wbits)-1,i=r-a),o.blocks.set_dictionary(n,i,a),o.mode=Se,v},s.inflateSync=function(e){let n,r,i,a,o;if(!e||!e.istate)return X;const c=e.istate;if(c.mode!=ae&&(c.mode=ae,c.marker=0),(n=e.avail_in)===0)return se;for(r=e.next_in_index,i=c.marker;n!==0&&i<4;)e.read_byte(r)==vr[i]?i++:e.read_byte(r)!==0?i=0:i=4-i,r++,n--;return e.total_in+=r-e.next_in_index,e.next_in_index=r,e.avail_in=n,c.marker=i,i!=4?W:(a=e.total_in,o=e.total_out,t(e),e.total_in=a,e.total_out=o,c.mode=Se,v)},s.inflateSyncPoint=function(e){return!e||!e.istate||!e.istate.blocks?X:e.istate.blocks.sync_point()}}function qn(){}qn.prototype={inflateInit(s){const t=this;return t.istate=new Fr,s||(s=gr),t.istate.inflateInit(t,s)},inflate(s){const t=this;return t.istate?t.istate.inflate(t,s):X},inflateEnd(){const s=this;if(!s.istate)return X;const t=s.istate.inflateEnd(s);return s.istate=null,t},inflateSync(){const s=this;return s.istate?s.istate.inflateSync(s):X},inflateSetDictionary(s,t){const e=this;return e.istate?e.istate.inflateSetDictionary(e,s,t):X},read_byte(s){return this.next_in[s]},read_buf(s,t){return this.next_in.subarray(s,s+t)}};function Mr(s){const t=this,e=new qn,n=s&&s.chunkSize?Math.floor(s.chunkSize*2):128*1024,r=yr,i=new Uint8Array(n);let a=!1;e.inflateInit(),e.next_out=i,t.append=function(o,c){const h=[];let d,m,w=0,T=0,A=0;if(o.length!==0){e.next_in_index=0,e.next_in=o,e.avail_in=o.length;do{if(e.next_out_index=0,e.avail_out=n,e.avail_in===0&&!a&&(e.next_in_index=0,a=!0),d=e.inflate(r),a&&d===se){if(e.avail_in!==0)throw new Error("inflating: bad input")}else if(d!==v&&d!==ne)throw new Error("inflating: "+e.msg);if((a||d===ne)&&e.avail_in===o.length)throw new Error("inflating: bad input");e.next_out_index&&(e.next_out_index===n?h.push(new Uint8Array(i)):h.push(i.subarray(0,e.next_out_index))),A+=e.next_out_index,c&&e.next_in_index>0&&e.next_in_index!=w&&(c(e.next_in_index),w=e.next_in_index)}while(e.avail_in>0||e.avail_out===0);return h.length>1?(m=new Uint8Array(A),h.forEach(function(u){m.set(u,T),T+=u.length})):m=h[0]?new Uint8Array(h[0]):new Uint8Array,m}},t.flush=function(){e.inflateEnd()}}const pe=4294967295,le=65535,Ur=8,Hr=0,Wr=99,Br=67324752,Gn=134695760,jr=Gn,cn=33639248,qr=101010256,ln=101075792,Gr=117853008,te=22,nt=20,st=56,Yr=12,Vr=20,fn=4,Zr=1,Kr=39169,Xr=10,$r=1,Jr=21589,Qr=28789,zr=25461,ei=6534,un=1,ti=6,dn=8,_n=2048,hn=16,ni=61440,si=16384,ri=73,pn="/",rt=30,ii=10,ai=14,oi=18,j=void 0,de="undefined",Pe="function";class mn{constructor(t){return class extends TransformStream{constructor(e,n){const r=new t(n);super({transform(i,a){a.enqueue(r.append(i))},flush(i){const a=r.flush();a&&i.enqueue(a)}})}}}}const ci=64;let Yn=2;try{typeof navigator!=de&&navigator.hardwareConcurrency&&(Yn=navigator.hardwareConcurrency)}catch{}const li={chunkSize:512*1024,maxWorkers:Yn,terminateWorkerTimeout:5e3,useWebWorkers:!0,useCompressionStream:!0,workerScripts:j,CompressionStreamNative:typeof CompressionStream!=de&&CompressionStream,DecompressionStreamNative:typeof DecompressionStream!=de&&DecompressionStream},fe=Object.assign({},li);function Vn(){return fe}function fi(s){return Math.max(s.chunkSize,ci)}function Zn(s){const{baseURL:t,chunkSize:e,maxWorkers:n,terminateWorkerTimeout:r,useCompressionStream:i,useWebWorkers:a,Deflate:o,Inflate:c,CompressionStream:h,DecompressionStream:d,workerScripts:m}=s;if(oe("baseURL",t),oe("chunkSize",e),oe("maxWorkers",n),oe("terminateWorkerTimeout",r),oe("useCompressionStream",i),oe("useWebWorkers",a),o&&(fe.CompressionStream=new mn(o)),c&&(fe.DecompressionStream=new mn(c)),oe("CompressionStream",h),oe("DecompressionStream",d),m!==j){const{deflate:w,inflate:T}=m;if((w||T)&&(fe.workerScripts||(fe.workerScripts={})),w){if(!Array.isArray(w))throw new Error("workerScripts.deflate must be an array");fe.workerScripts.deflate=w}if(T){if(!Array.isArray(T))throw new Error("workerScripts.inflate must be an array");fe.workerScripts.inflate=T}}}function oe(s,t){t!==j&&(fe[s]=t)}function ui(){return"application/octet-stream"}const Kn=[];for(let s=0;s<256;s++){let t=s;for(let e=0;e<8;e++)t&1?t=t>>>1^3988292384:t=t>>>1;Kn[s]=t}class Ve{constructor(t){this.crc=t||-1}append(t){let e=this.crc|0;for(let n=0,r=t.length|0;n<r;n++)e=e>>>8^Kn[(e^t[n])&255];this.crc=e}get(){return~this.crc}}class Xn extends TransformStream{constructor(){let t;const e=new Ve;super({transform(n,r){e.append(n),r.enqueue(n)},flush(){const n=new Uint8Array(4);new DataView(n.buffer).setUint32(0,e.get()),t.value=n}}),t=this}}function di(s){if(typeof TextEncoder==de){s=unescape(encodeURIComponent(s));const t=new Uint8Array(s.length);for(let e=0;e<t.length;e++)t[e]=s.charCodeAt(e);return t}else return new TextEncoder().encode(s)}const Z={concat(s,t){if(s.length===0||t.length===0)return s.concat(t);const e=s[s.length-1],n=Z.getPartial(e);return n===32?s.concat(t):Z._shiftRight(t,n,e|0,s.slice(0,s.length-1))},bitLength(s){const t=s.length;if(t===0)return 0;const e=s[t-1];return(t-1)*32+Z.getPartial(e)},clamp(s,t){if(s.length*32<t)return s;s=s.slice(0,Math.ceil(t/32));const e=s.length;return t=t&31,e>0&&t&&(s[e-1]=Z.partial(t,s[e-1]&2147483648>>t-1,1)),s},partial(s,t,e){return s===32?t:(e?t|0:t<<32-s)+s*1099511627776},getPartial(s){return Math.round(s/1099511627776)||32},_shiftRight(s,t,e,n){for(n===void 0&&(n=[]);t>=32;t-=32)n.push(e),e=0;if(t===0)return n.concat(s);for(let a=0;a<s.length;a++)n.push(e|s[a]>>>t),e=s[a]<<32-t;const r=s.length?s[s.length-1]:0,i=Z.getPartial(r);return n.push(Z.partial(t+i&31,t+i>32?e:n.pop(),1)),n}},Ze={bytes:{fromBits(s){const e=Z.bitLength(s)/8,n=new Uint8Array(e);let r;for(let i=0;i<e;i++)(i&3)===0&&(r=s[i/4]),n[i]=r>>>24,r<<=8;return n},toBits(s){const t=[];let e,n=0;for(e=0;e<s.length;e++)n=n<<8|s[e],(e&3)===3&&(t.push(n),n=0);return e&3&&t.push(Z.partial(8*(e&3),n)),t}}},$n={};$n.sha1=class{constructor(s){const t=this;t.blockSize=512,t._init=[1732584193,4023233417,2562383102,271733878,3285377520],t._key=[1518500249,1859775393,2400959708,3395469782],s?(t._h=s._h.slice(0),t._buffer=s._buffer.slice(0),t._length=s._length):t.reset()}reset(){const s=this;return s._h=s._init.slice(0),s._buffer=[],s._length=0,s}update(s){const t=this;typeof s=="string"&&(s=Ze.utf8String.toBits(s));const e=t._buffer=Z.concat(t._buffer,s),n=t._length,r=t._length=n+Z.bitLength(s);if(r>9007199254740991)throw new Error("Cannot hash more than 2^53 - 1 bits");const i=new Uint32Array(e);let a=0;for(let o=t.blockSize+n-(t.blockSize+n&t.blockSize-1);o<=r;o+=t.blockSize)t._block(i.subarray(16*a,16*(a+1))),a+=1;return e.splice(0,16*a),t}finalize(){const s=this;let t=s._buffer;const e=s._h;t=Z.concat(t,[Z.partial(1,1)]);for(let n=t.length+2;n&15;n++)t.push(0);for(t.push(Math.floor(s._length/4294967296)),t.push(s._length|0);t.length;)s._block(t.splice(0,16));return s.reset(),e}_f(s,t,e,n){if(s<=19)return t&e|~t&n;if(s<=39)return t^e^n;if(s<=59)return t&e|t&n|e&n;if(s<=79)return t^e^n}_S(s,t){return t<<s|t>>>32-s}_block(s){const t=this,e=t._h,n=Array(80);for(let h=0;h<16;h++)n[h]=s[h];let r=e[0],i=e[1],a=e[2],o=e[3],c=e[4];for(let h=0;h<=79;h++){h>=16&&(n[h]=t._S(1,n[h-3]^n[h-8]^n[h-14]^n[h-16]));const d=t._S(5,r)+t._f(h,i,a,o)+c+n[h]+t._key[Math.floor(h/20)]|0;c=o,o=a,a=t._S(30,i),i=r,r=d}e[0]=e[0]+r|0,e[1]=e[1]+i|0,e[2]=e[2]+a|0,e[3]=e[3]+o|0,e[4]=e[4]+c|0}};const Jn={};Jn.aes=class{constructor(s){const t=this;t._tables=[[[],[],[],[],[]],[[],[],[],[],[]]],t._tables[0][0][0]||t._precompute();const e=t._tables[0][4],n=t._tables[1],r=s.length;let i,a,o,c=1;if(r!==4&&r!==6&&r!==8)throw new Error("invalid aes key size");for(t._key=[a=s.slice(0),o=[]],i=r;i<4*r+28;i++){let h=a[i-1];(i%r===0||r===8&&i%r===4)&&(h=e[h>>>24]<<24^e[h>>16&255]<<16^e[h>>8&255]<<8^e[h&255],i%r===0&&(h=h<<8^h>>>24^c<<24,c=c<<1^(c>>7)*283)),a[i]=a[i-r]^h}for(let h=0;i;h++,i--){const d=a[h&3?i:i-4];i<=4||h<4?o[h]=d:o[h]=n[0][e[d>>>24]]^n[1][e[d>>16&255]]^n[2][e[d>>8&255]]^n[3][e[d&255]]}}encrypt(s){return this._crypt(s,0)}decrypt(s){return this._crypt(s,1)}_precompute(){const s=this._tables[0],t=this._tables[1],e=s[4],n=t[4],r=[],i=[];let a,o,c,h;for(let d=0;d<256;d++)i[(r[d]=d<<1^(d>>7)*283)^d]=d;for(let d=a=0;!e[d];d^=o||1,a=i[a]||1){let m=a^a<<1^a<<2^a<<3^a<<4;m=m>>8^m&255^99,e[d]=m,n[m]=d,h=r[c=r[o=r[d]]];let w=h*16843009^c*65537^o*257^d*16843008,T=r[m]*257^m*16843008;for(let A=0;A<4;A++)s[A][d]=T=T<<24^T>>>8,t[A][m]=w=w<<24^w>>>8}for(let d=0;d<5;d++)s[d]=s[d].slice(0),t[d]=t[d].slice(0)}_crypt(s,t){if(s.length!==4)throw new Error("invalid aes block size");const e=this._key[t],n=e.length/4-2,r=[0,0,0,0],i=this._tables[t],a=i[0],o=i[1],c=i[2],h=i[3],d=i[4];let m=s[0]^e[0],w=s[t?3:1]^e[1],T=s[2]^e[2],A=s[t?1:3]^e[3],u=4,l,f,p;for(let g=0;g<n;g++)l=a[m>>>24]^o[w>>16&255]^c[T>>8&255]^h[A&255]^e[u],f=a[w>>>24]^o[T>>16&255]^c[A>>8&255]^h[m&255]^e[u+1],p=a[T>>>24]^o[A>>16&255]^c[m>>8&255]^h[w&255]^e[u+2],A=a[A>>>24]^o[m>>16&255]^c[w>>8&255]^h[T&255]^e[u+3],u+=4,m=l,w=f,T=p;for(let g=0;g<4;g++)r[t?3&-g:g]=d[m>>>24]<<24^d[w>>16&255]<<16^d[T>>8&255]<<8^d[A&255]^e[u++],l=m,m=w,w=T,T=A,A=l;return r}};const _i={getRandomValues(s){const t=new Uint32Array(s.buffer),e=n=>{let r=987654321;const i=4294967295;return function(){return r=36969*(r&65535)+(r>>16)&i,n=18e3*(n&65535)+(n>>16)&i,(((r<<16)+n&i)/4294967296+.5)*(Math.random()>.5?1:-1)}};for(let n=0,r;n<s.length;n+=4){const i=e((r||Math.random())*4294967296);r=i()*987654071,t[n/4]=i()*4294967296|0}return s}},Qn={};Qn.ctrGladman=class{constructor(s,t){this._prf=s,this._initIv=t,this._iv=t}reset(){this._iv=this._initIv}update(s){return this.calculate(this._prf,s,this._iv)}incWord(s){if((s>>24&255)===255){let t=s>>16&255,e=s>>8&255,n=s&255;t===255?(t=0,e===255?(e=0,n===255?n=0:++n):++e):++t,s=0,s+=t<<16,s+=e<<8,s+=n}else s+=1<<24;return s}incCounter(s){(s[0]=this.incWord(s[0]))===0&&(s[1]=this.incWord(s[1]))}calculate(s,t,e){let n;if(!(n=t.length))return[];const r=Z.bitLength(t);for(let i=0;i<n;i+=4){this.incCounter(e);const a=s.encrypt(e);t[i]^=a[0],t[i+1]^=a[1],t[i+2]^=a[2],t[i+3]^=a[3]}return Z.clamp(t,r)}};const me={importKey(s){return new me.hmacSha1(Ze.bytes.toBits(s))},pbkdf2(s,t,e,n){if(e=e||1e4,n<0||e<0)throw new Error("invalid params to pbkdf2");const r=(n>>5)+1<<2;let i,a,o,c,h;const d=new ArrayBuffer(r),m=new DataView(d);let w=0;const T=Z;for(t=Ze.bytes.toBits(t),h=1;w<(r||1);h++){for(i=a=s.encrypt(T.concat(t,[h])),o=1;o<e;o++)for(a=s.encrypt(a),c=0;c<a.length;c++)i[c]^=a[c];for(o=0;w<(r||1)&&o<i.length;o++)m.setInt32(w,i[o]),w+=4}return d.slice(0,n/8)}};me.hmacSha1=class{constructor(s){const t=this,e=t._hash=$n.sha1,n=[[],[]];t._baseHash=[new e,new e];const r=t._baseHash[0].blockSize/32;s.length>r&&(s=new e().update(s).finalize());for(let i=0;i<r;i++)n[0][i]=s[i]^909522486,n[1][i]=s[i]^1549556828;t._baseHash[0].update(n[0]),t._baseHash[1].update(n[1]),t._resultHash=new e(t._baseHash[0])}reset(){const s=this;s._resultHash=new s._hash(s._baseHash[0]),s._updated=!1}update(s){const t=this;t._updated=!0,t._resultHash.update(s)}digest(){const s=this,t=s._resultHash.finalize(),e=new s._hash(s._baseHash[1]).update(t).finalize();return s.reset(),e}encrypt(s){if(this._updated)throw new Error("encrypt on already updated hmac called!");return this.update(s),this.digest(s)}};const hi=typeof crypto!=de&&typeof crypto.getRandomValues==Pe,yt="Invalid password",Et="Invalid signature",xt="zipjs-abort-check-password";function zn(s){return hi?crypto.getRandomValues(s):_i.getRandomValues(s)}const ge=16,pi="raw",es={name:"PBKDF2"},mi={name:"HMAC"},wi="SHA-1",gi=Object.assign({hash:mi},es),ut=Object.assign({iterations:1e3,hash:{name:wi}},es),bi=["deriveBits"],Ce=[8,12,16],Re=[16,24,32],ce=10,yi=[0,0,0,0],$e=typeof crypto!=de,ke=$e&&crypto.subtle,ts=$e&&typeof ke!=de,z=Ze.bytes,Ei=Jn.aes,xi=Qn.ctrGladman,Ti=me.hmacSha1;let wn=$e&&ts&&typeof ke.importKey==Pe,gn=$e&&ts&&typeof ke.deriveBits==Pe;class Si extends TransformStream{constructor({password:t,rawPassword:e,signed:n,encryptionStrength:r,checkPasswordOnly:i}){super({start(){Object.assign(this,{ready:new Promise(a=>this.resolveReady=a),password:rs(t,e),signed:n,strength:r-1,pending:new Uint8Array})},async transform(a,o){const c=this,{password:h,strength:d,resolveReady:m,ready:w}=c;h?(await Ai(c,d,h,J(a,0,Ce[d]+2)),a=J(a,Ce[d]+2),i?o.error(new Error(xt)):m()):await w;const T=new Uint8Array(a.length-ce-(a.length-ce)%ge);o.enqueue(ns(c,a,T,0,ce,!0))},async flush(a){const{signed:o,ctr:c,hmac:h,pending:d,ready:m}=this;if(h&&c){await m;const w=J(d,0,d.length-ce),T=J(d,d.length-ce);let A=new Uint8Array;if(w.length){const u=Ne(z,w);h.update(u);const l=c.update(u);A=Ie(z,l)}if(o){const u=J(Ie(z,h.digest()),0,ce);for(let l=0;l<ce;l++)if(u[l]!=T[l])throw new Error(Et)}a.enqueue(A)}}})}}class Ri extends TransformStream{constructor({password:t,rawPassword:e,encryptionStrength:n}){let r;super({start(){Object.assign(this,{ready:new Promise(i=>this.resolveReady=i),password:rs(t,e),strength:n-1,pending:new Uint8Array})},async transform(i,a){const o=this,{password:c,strength:h,resolveReady:d,ready:m}=o;let w=new Uint8Array;c?(w=await Oi(o,h,c),d()):await m;const T=new Uint8Array(w.length+i.length-i.length%ge);T.set(w,0),a.enqueue(ns(o,i,T,w.length,0))},async flush(i){const{ctr:a,hmac:o,pending:c,ready:h}=this;if(o&&a){await h;let d=new Uint8Array;if(c.length){const m=a.update(Ne(z,c));o.update(m),d=Ie(z,m)}r.signature=Ie(z,o.digest()).slice(0,ce),i.enqueue(Tt(d,r.signature))}}}),r=this}}function ns(s,t,e,n,r,i){const{ctr:a,hmac:o,pending:c}=s,h=t.length-r;c.length&&(t=Tt(c,t),e=Ni(e,h-h%ge));let d;for(d=0;d<=h-ge;d+=ge){const m=Ne(z,J(t,d,d+ge));i&&o.update(m);const w=a.update(m);i||o.update(w),e.set(Ie(z,w),d+n)}return s.pending=J(t,d),e}async function Ai(s,t,e,n){const r=await ss(s,t,e,J(n,0,Ce[t])),i=J(n,Ce[t]);if(r[0]!=i[0]||r[1]!=i[1])throw new Error(yt)}async function Oi(s,t,e){const n=zn(new Uint8Array(Ce[t])),r=await ss(s,t,e,n);return Tt(n,r)}async function ss(s,t,e,n){s.password=null;const r=await Ci(pi,e,gi,!1,bi),i=await Ii(Object.assign({salt:n},ut),r,8*(Re[t]*2+2)),a=new Uint8Array(i),o=Ne(z,J(a,0,Re[t])),c=Ne(z,J(a,Re[t],Re[t]*2)),h=J(a,Re[t]*2);return Object.assign(s,{keys:{key:o,authentication:c,passwordVerification:h},ctr:new xi(new Ei(o),Array.from(yi)),hmac:new Ti(c)}),h}async function Ci(s,t,e,n,r){if(wn)try{return await ke.importKey(s,t,e,n,r)}catch{return wn=!1,me.importKey(t)}else return me.importKey(t)}async function Ii(s,t,e){if(gn)try{return await ke.deriveBits(s,t,e)}catch{return gn=!1,me.pbkdf2(t,s.salt,ut.iterations,e)}else return me.pbkdf2(t,s.salt,ut.iterations,e)}function rs(s,t){return t===j?di(s):t}function Tt(s,t){let e=s;return s.length+t.length&&(e=new Uint8Array(s.length+t.length),e.set(s,0),e.set(t,s.length)),e}function Ni(s,t){if(t&&t>s.length){const e=s;s=new Uint8Array(t),s.set(e,0)}return s}function J(s,t,e){return s.subarray(t,e)}function Ie(s,t){return s.fromBits(t)}function Ne(s,t){return s.toBits(t)}const Oe=12;class Di extends TransformStream{constructor({password:t,passwordVerification:e,checkPasswordOnly:n}){super({start(){Object.assign(this,{password:t,passwordVerification:e}),is(this,t)},transform(r,i){const a=this;if(a.password){const o=bn(a,r.subarray(0,Oe));if(a.password=null,o.at(-1)!=a.passwordVerification)throw new Error(yt);r=r.subarray(Oe)}n?i.error(new Error(xt)):i.enqueue(bn(a,r))}})}}class Pi extends TransformStream{constructor({password:t,passwordVerification:e}){super({start(){Object.assign(this,{password:t,passwordVerification:e}),is(this,t)},transform(n,r){const i=this;let a,o;if(i.password){i.password=null;const c=zn(new Uint8Array(Oe));c[Oe-1]=i.passwordVerification,a=new Uint8Array(n.length+c.length),a.set(yn(i,c),0),o=Oe}else a=new Uint8Array(n.length),o=0;a.set(yn(i,n),o),r.enqueue(a)}})}}function bn(s,t){const e=new Uint8Array(t.length);for(let n=0;n<t.length;n++)e[n]=as(s)^t[n],St(s,e[n]);return e}function yn(s,t){const e=new Uint8Array(t.length);for(let n=0;n<t.length;n++)e[n]=as(s)^t[n],St(s,t[n]);return e}function is(s,t){const e=[305419896,591751049,878082192];Object.assign(s,{keys:e,crcKey0:new Ve(e[0]),crcKey2:new Ve(e[2])});for(let n=0;n<t.length;n++)St(s,t.charCodeAt(n))}function St(s,t){let[e,n,r]=s.keys;s.crcKey0.append([t]),e=~s.crcKey0.get(),n=En(Math.imul(En(n+os(e)),134775813)+1),s.crcKey2.append([n>>>24]),r=~s.crcKey2.get(),s.keys=[e,n,r]}function as(s){const t=s.keys[2]|2;return os(Math.imul(t,t^1)>>>8)}function os(s){return s&255}function En(s){return s&4294967295}const Rt="Invalid uncompressed size",xn="deflate-raw";class ki extends TransformStream{constructor(t,{chunkSize:e,CompressionStream:n,CompressionStreamNative:r}){super({});const{compressed:i,encrypted:a,useCompressionStream:o,zipCrypto:c,signed:h,level:d}=t,m=this;let w,T,A=super.readable;(!a||c)&&h&&(w=new Xn,A=re(A,w)),i&&(A=ls(A,o,{level:d,chunkSize:e},r,n)),a&&(c?A=re(A,new Pi(t)):(T=new Ri(t),A=re(A,T))),cs(m,A,()=>{let u;a&&!c&&(u=T.signature),(!a||c)&&h&&(u=new DataView(w.value.buffer).getUint32(0)),m.signature=u})}}class Li extends TransformStream{constructor(t,{chunkSize:e,DecompressionStream:n,DecompressionStreamNative:r}){super({});const{zipCrypto:i,encrypted:a,signed:o,signature:c,compressed:h,useCompressionStream:d}=t;let m,w,T=super.readable;a&&(i?T=re(T,new Di(t)):(w=new Si(t),T=re(T,w))),h&&(T=ls(T,d,{chunkSize:e},r,n)),(!a||i)&&o&&(m=new Xn,T=re(T,m)),cs(this,T,()=>{if((!a||i)&&o){const A=new DataView(m.value.buffer);if(c!=A.getUint32(0,!1))throw new Error(Et)}})}}function cs(s,t,e){t=re(t,new TransformStream({flush:e})),Object.defineProperty(s,"readable",{get(){return t}})}function ls(s,t,e,n,r){try{const i=t&&n?n:r;s=re(s,new i(xn,e))}catch(i){if(t)s=re(s,new r(xn,e));else throw i}return s}function re(s,t){return s.pipeThrough(t)}const vi="message",Fi="start",Mi="pull",Tn="data",Ui="ack",Sn="close",Hi="deflate",fs="inflate";class Wi extends TransformStream{constructor(t,e){super({});const n=this,{codecType:r}=t;let i;r.startsWith(Hi)?i=ki:r.startsWith(fs)&&(i=Li),n.outputSize=0;let a=0;const o=new i(t,e),c=super.readable,h=new TransformStream({transform(m,w){m&&m.length&&(a+=m.length,w.enqueue(m))},flush(){Object.assign(n,{inputSize:a})}}),d=new TransformStream({transform(m,w){if(m&&m.length&&(w.enqueue(m),n.outputSize+=m.length,t.outputSize&&n.outputSize>t.outputSize))throw new Error(Rt)},flush(){const{signature:m}=o;Object.assign(n,{signature:m,inputSize:a})}});Object.defineProperty(n,"readable",{get(){return c.pipeThrough(h).pipeThrough(o).pipeThrough(d)}})}}class Bi extends TransformStream{constructor(t){let e;super({transform:n,flush(r){e&&e.length&&r.enqueue(e)}});function n(r,i){if(e){const a=new Uint8Array(e.length+r.length);a.set(e),a.set(r,e.length),r=a,e=null}r.length>t?(i.enqueue(r.slice(0,t)),n(r.slice(t),i)):e=r}}}let us=typeof Worker!=de;class it{constructor(t,{readable:e,writable:n},{options:r,config:i,streamOptions:a,useWebWorkers:o,transferStreams:c,scripts:h},d){const{signal:m}=a;return Object.assign(t,{busy:!0,readable:e.pipeThrough(new Bi(i.chunkSize)).pipeThrough(new ji(a),{signal:m}),writable:n,options:Object.assign({},r),scripts:h,transferStreams:c,terminate(){return new Promise(w=>{const{worker:T,busy:A}=t;T?(A?t.resolveTerminated=w:(T.terminate(),w()),t.interface=null):w()})},onTaskFinished(){const{resolveTerminated:w}=t;w&&(t.resolveTerminated=null,t.terminated=!0,t.worker.terminate(),w()),t.busy=!1,d(t)}}),(o&&us?qi:ds)(t,i)}}class ji extends TransformStream{constructor({onstart:t,onprogress:e,size:n,onend:r}){let i=0;super({async start(){t&&await at(t,n)},async transform(a,o){i+=a.length,e&&await at(e,i,n),o.enqueue(a)},async flush(){r&&await at(r,i)}})}}async function at(s,...t){try{await s(...t)}catch{}}function ds(s,t){return{run:()=>Gi(s,t)}}function qi(s,t){const{baseURL:e,chunkSize:n}=t;if(!s.interface){let r;try{r=Zi(s.scripts[0],e,s)}catch{return us=!1,ds(s,t)}Object.assign(s,{worker:r,interface:{run:()=>Yi(s,{chunkSize:n})}})}return s.interface}async function Gi({options:s,readable:t,writable:e,onTaskFinished:n},r){let i;try{i=new Wi(s,r),await t.pipeThrough(i).pipeTo(e,{preventClose:!0,preventAbort:!0});const{signature:a,inputSize:o,outputSize:c}=i;return{signature:a,inputSize:o,outputSize:c}}catch(a){throw i&&(a.outputSize=i.outputSize),a}finally{n()}}async function Yi(s,t){let e,n;const r=new Promise((w,T)=>{e=w,n=T});Object.assign(s,{reader:null,writer:null,resolveResult:e,rejectResult:n,result:r});const{readable:i,options:a,scripts:o}=s,{writable:c,closed:h}=Vi(s.writable),d=qe({type:Fi,scripts:o.slice(1),options:a,config:t,readable:i,writable:c},s);d||Object.assign(s,{reader:i.getReader(),writer:c.getWriter()});const m=await r;return d||await c.getWriter().close(),await h,m}function Vi(s){let t;const e=new Promise(r=>t=r);return{writable:new WritableStream({async write(r){const i=s.getWriter();await i.ready,await i.write(r),i.releaseLock()},close(){t()},abort(r){return s.getWriter().abort(r)}}),closed:e}}let Rn=!0,An=!0;function Zi(s,t,e){const n={type:"module"};let r,i;typeof s==Pe&&(s=s());try{r=new URL(s,t)}catch{r=s}if(Rn)try{i=new Worker(r)}catch{Rn=!1,i=new Worker(r,n)}else i=new Worker(r,n);return i.addEventListener(vi,a=>Ki(a,e)),i}function qe(s,{worker:t,writer:e,onTaskFinished:n,transferStreams:r}){try{const{value:i,readable:a,writable:o}=s,c=[];if(i&&(i.byteLength<i.buffer.byteLength?s.value=i.buffer.slice(0,i.byteLength):s.value=i.buffer,c.push(s.value)),r&&An?(a&&c.push(a),o&&c.push(o)):s.readable=s.writable=null,c.length)try{return t.postMessage(s,c),!0}catch{An=!1,s.readable=s.writable=null,t.postMessage(s)}else t.postMessage(s)}catch(i){throw e&&e.releaseLock(),n(),i}}async function Ki({data:s},t){const{type:e,value:n,messageId:r,result:i,error:a}=s,{reader:o,writer:c,resolveResult:h,rejectResult:d,onTaskFinished:m}=t;try{if(a){const{message:T,stack:A,code:u,name:l,outputSize:f}=a,p=new Error(T);Object.assign(p,{stack:A,code:u,name:l,outputSize:f}),w(p)}else{if(e==Mi){const{value:T,done:A}=await o.read();qe({type:Tn,value:T,done:A,messageId:r},t)}e==Tn&&(await c.ready,await c.write(new Uint8Array(n)),qe({type:Ui,messageId:r},t)),e==Sn&&w(null,i)}}catch(T){qe({type:Sn,messageId:r},t),w(T)}function w(T,A){T?d(T):h(A),c&&c.releaseLock(),m()}}let ue=[];const ot=[];let On=0;async function Xi(s,t){const{options:e,config:n}=t,{transferStreams:r,useWebWorkers:i,useCompressionStream:a,codecType:o,compressed:c,signed:h,encrypted:d}=e,{workerScripts:m,maxWorkers:w}=n;t.transferStreams=r||r===j;const T=!c&&!h&&!d&&!t.transferStreams;return t.useWebWorkers=!T&&(i||i===j&&n.useWebWorkers),t.scripts=t.useWebWorkers&&m?m[o]:[],e.useCompressionStream=a||a===j&&n.useCompressionStream,(await A()).run();async function A(){const l=ue.find(f=>!f.busy);if(l)return dt(l),new it(l,s,t,u);if(ue.length<w){const f={indexWorker:On};return On++,ue.push(f),new it(f,s,t,u)}else return new Promise(f=>ot.push({resolve:f,stream:s,workerOptions:t}))}function u(l){if(ot.length){const[{resolve:f,stream:p,workerOptions:g}]=ot.splice(0,1);f(new it(l,p,g,u))}else l.worker?(dt(l),$i(l,t)):ue=ue.filter(f=>f!=l)}}function $i(s,t){const{config:e}=t,{terminateWorkerTimeout:n}=e;Number.isFinite(n)&&n>=0&&(s.terminated?s.terminated=!1:s.terminateTimeout=setTimeout(async()=>{ue=ue.filter(r=>r!=s);try{await s.terminate()}catch{}},n))}function dt(s){const{terminateTimeout:t}=s;t&&(clearTimeout(t),s.terminateTimeout=null)}async function Ji(){await Promise.allSettled(ue.map(s=>(dt(s),s.terminate())))}const _s="HTTP error ",Le="HTTP Range not supported",hs="Writer iterator completed too soon",ps="Writer not initialized",Qi="text/plain",zi="Content-Length",ea="Content-Range",ta="Accept-Ranges",na="Range",sa="Content-Type",ra="HEAD",At="GET",ms="bytes",ia=64*1024,Ot="writable";class Je{constructor(){this.size=0}init(){this.initialized=!0}}class _e extends Je{get readable(){const t=this,{chunkSize:e=ia}=t,n=new ReadableStream({start(){this.chunkOffset=0},async pull(r){const{offset:i=0,size:a,diskNumberStart:o}=n,{chunkOffset:c}=this,h=a===j?e:Math.min(e,a-c),d=await G(t,i+c,h,o);r.enqueue(d),c+e>a||a===j&&!d.length&&h?r.close():this.chunkOffset+=e}});return n}}class Ct extends Je{constructor(){super();const t=this,e=new WritableStream({write(n){if(!t.initialized)throw new Error(ps);return t.writeUint8Array(n)}});Object.defineProperty(t,Ot,{get(){return e}})}writeUint8Array(){}}class aa extends _e{constructor(t){super();let e=t.length;for(;t.charAt(e-1)=="=";)e--;const n=t.indexOf(",")+1;Object.assign(this,{dataURI:t,dataStart:n,size:Math.floor((e-n)*.75)})}readUint8Array(t,e){const{dataStart:n,dataURI:r}=this,i=new Uint8Array(e),a=Math.floor(t/3)*4,o=atob(r.substring(a+n,Math.ceil((t+e)/3)*4+n)),c=t-Math.floor(a/4)*3;let h=0;for(let d=c;d<c+e&&d<o.length;d++)i[d-c]=o.charCodeAt(d),h++;return h<i.length?i.subarray(0,h):i}}class oa extends Ct{constructor(t){super(),Object.assign(this,{data:"data:"+(t||"")+";base64,",pending:[]})}writeUint8Array(t){const e=this;let n=0,r=e.pending;const i=e.pending.length;for(e.pending="",n=0;n<Math.floor((i+t.length)/3)*3-i;n++)r+=String.fromCharCode(t[n]);for(;n<t.length;n++)e.pending+=String.fromCharCode(t[n]);r.length&&(r.length>2?e.data+=btoa(r):e.pending+=r)}getData(){return this.data+btoa(this.pending)}}class It extends _e{constructor(t){super(),Object.assign(this,{blob:t,size:t.size})}async readUint8Array(t,e){const n=this,r=t+e;let a=await(t||r<n.size?n.blob.slice(t,r):n.blob).arrayBuffer();return a.byteLength>e&&(a=a.slice(t,r)),new Uint8Array(a)}}class ws extends Je{constructor(t){super();const e=this,n=new TransformStream,r=[];t&&r.push([sa,t]),Object.defineProperty(e,Ot,{get(){return n.writable}}),e.blob=new Response(n.readable,{headers:r}).blob()}getData(){return this.blob}}class ca extends It{constructor(t){super(new Blob([t],{type:Qi}))}}class la extends ws{constructor(t){super(t),Object.assign(this,{encoding:t,utf8:!t||t.toLowerCase()=="utf-8"})}async getData(){const{encoding:t,utf8:e}=this,n=await super.getData();if(n.text&&e)return n.text();{const r=new FileReader;return new Promise((i,a)=>{Object.assign(r,{onload:({target:o})=>i(o.result),onerror:()=>a(r.error)}),r.readAsText(n,t)})}}}class fa extends _e{constructor(t,e){super(),gs(this,t,e)}async init(){await bs(this,_t,Cn),super.init()}readUint8Array(t,e){return ys(this,t,e,_t,Cn)}}class ua extends _e{constructor(t,e){super(),gs(this,t,e)}async init(){await bs(this,ht,In),super.init()}readUint8Array(t,e){return ys(this,t,e,ht,In)}}function gs(s,t,e){const{preventHeadRequest:n,useRangeHeader:r,forceRangeRequests:i,combineSizeEocd:a}=e;e=Object.assign({},e),delete e.preventHeadRequest,delete e.useRangeHeader,delete e.forceRangeRequests,delete e.combineSizeEocd,delete e.useXHR,Object.assign(s,{url:t,options:e,preventHeadRequest:n,useRangeHeader:r,forceRangeRequests:i,combineSizeEocd:a})}async function bs(s,t,e){const{url:n,preventHeadRequest:r,useRangeHeader:i,forceRangeRequests:a,combineSizeEocd:o}=s;if(pa(n)&&(i||a)&&(typeof r>"u"||r)){const c=await t(At,s,Es(s,o?-te:void 0));if(!a&&c.headers.get(ta)!=ms)throw new Error(Le);{o&&(s.eocdCache=new Uint8Array(await c.arrayBuffer()));let h;const d=c.headers.get(ea);if(d){const m=d.trim().split(/\s*\/\s*/);if(m.length){const w=m[1];w&&w!="*"&&(h=Number(w))}}h===j?await Nn(s,t,e):s.size=h}}else await Nn(s,t,e)}async function ys(s,t,e,n,r){const{useRangeHeader:i,forceRangeRequests:a,eocdCache:o,size:c,options:h}=s;if(i||a){if(o&&t==c-te&&e==te)return o;if(t>=c)return new Uint8Array;{t+e>c&&(e=c-t);const d=await n(At,s,Es(s,t,e));if(d.status!=206)throw new Error(Le);return new Uint8Array(await d.arrayBuffer())}}else{const{data:d}=s;return d||await r(s,h),new Uint8Array(s.data.subarray(t,t+e))}}function Es(s,t=0,e=1){return Object.assign({},Nt(s),{[na]:ms+"="+(t<0?t:t+"-"+(t+e-1))})}function Nt({options:s}){const{headers:t}=s;if(t)return Symbol.iterator in t?Object.fromEntries(t):t}async function Cn(s){await xs(s,_t)}async function In(s){await xs(s,ht)}async function xs(s,t){const e=await t(At,s,Nt(s));s.data=new Uint8Array(await e.arrayBuffer()),s.size||(s.size=s.data.length)}async function Nn(s,t,e){if(s.preventHeadRequest)await e(s,s.options);else{const r=(await t(ra,s,Nt(s))).headers.get(zi);r?s.size=Number(r):await e(s,s.options)}}async function _t(s,{options:t,url:e},n){const r=await fetch(e,Object.assign({},t,{method:s,headers:n}));if(r.status<400)return r;throw r.status==416?new Error(Le):new Error(_s+(r.statusText||r.status))}function ht(s,{url:t},e){return new Promise((n,r)=>{const i=new XMLHttpRequest;if(i.addEventListener("load",()=>{if(i.status<400){const a=[];i.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach(o=>{const c=o.trim().split(/\s*:\s*/);c[0]=c[0].trim().replace(/^[a-z]|-[a-z]/g,h=>h.toUpperCase()),a.push(c)}),n({status:i.status,arrayBuffer:()=>i.response,headers:new Map(a)})}else r(i.status==416?new Error(Le):new Error(_s+(i.statusText||i.status)))},!1),i.addEventListener("error",a=>r(a.detail?a.detail.error:new Error("Network error")),!1),i.open(s,t),e)for(const a of Object.entries(e))i.setRequestHeader(a[0],a[1]);i.responseType="arraybuffer",i.send()})}class Ts extends _e{constructor(t,e={}){super(),Object.assign(this,{url:t,reader:e.useXHR?new ua(t,e):new fa(t,e)})}set size(t){}get size(){return this.reader.size}async init(){await this.reader.init(),super.init()}readUint8Array(t,e){return this.reader.readUint8Array(t,e)}}class da extends Ts{constructor(t,e={}){e.useRangeHeader=!0,super(t,e)}}class _a extends _e{constructor(t){super(),t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength),Object.assign(this,{array:t,size:t.length})}readUint8Array(t,e){return this.array.slice(t,t+e)}}class ha extends Ct{init(t=0){Object.assign(this,{offset:0,array:new Uint8Array(t)}),super.init()}writeUint8Array(t){const e=this;if(e.offset+t.length>e.array.length){const n=e.array;e.array=new Uint8Array(n.length+t.length),e.array.set(n)}e.array.set(t,e.offset),e.offset+=t.length}getData(){return this.array}}class Dt extends _e{constructor(t){super(),this.readers=t}async init(){const t=this,{readers:e}=t;t.lastDiskNumber=0,t.lastDiskOffset=0,await Promise.all(e.map(async(n,r)=>{await n.init(),r!=e.length-1&&(t.lastDiskOffset+=n.size),t.size+=n.size})),super.init()}async readUint8Array(t,e,n=0){const r=this,{readers:i}=this;let a,o=n;o==-1&&(o=i.length-1);let c=t;for(;i[o]&&c>=i[o].size;)c-=i[o].size,o++;const h=i[o];if(h){const d=h.size;if(c+e<=d)a=await G(h,c,e);else{const m=d-c;a=new Uint8Array(e);const w=await G(h,c,m);a.set(w,0);const T=await r.readUint8Array(t+m,e-m,n);a.set(T,m),w.length+T.length<e&&(a=a.subarray(0,w.length+T.length))}}else a=new Uint8Array;return r.lastDiskNumber=Math.max(o,r.lastDiskNumber),a}}class Ke extends Je{constructor(t,e=4294967295){super();const n=this;Object.assign(n,{diskNumber:0,diskOffset:0,size:0,maxSize:e,availableSize:e});let r,i,a;const o=new WritableStream({async write(d){const{availableSize:m}=n;if(a)d.length>=m?(await c(d.subarray(0,m)),await h(),n.diskOffset+=r.size,n.diskNumber++,a=null,await this.write(d.subarray(m))):await c(d);else{const{value:w,done:T}=await t.next();if(T&&!w)throw new Error(hs);r=w,r.size=0,r.maxSize&&(n.maxSize=r.maxSize),n.availableSize=n.maxSize,await De(r),i=w.writable,a=i.getWriter(),await this.write(d)}},async close(){await a.ready,await h()}});Object.defineProperty(n,Ot,{get(){return o}});async function c(d){const m=d.length;m&&(await a.ready,await a.write(d),r.size+=m,n.size+=m,n.availableSize-=m)}async function h(){await a.close()}}}class Ss{constructor(t){return Array.isArray(t)&&(t=new Dt(t)),t instanceof ReadableStream&&(t={readable:t}),t}}class Rs{constructor(t){return t.writable===j&&typeof t.next==Pe&&(t=new Ke(t)),t instanceof WritableStream&&(t={writable:t}),t.size===j&&(t.size=0),t instanceof Ke||Object.assign(t,{diskNumber:0,diskOffset:0,availableSize:1/0,maxSize:1/0}),t}}function pa(s){const{baseURL:t}=Vn(),{protocol:e}=new URL(s,t);return e=="http:"||e=="https:"}async function De(s,t){if(s.init&&!s.initialized)await s.init(t);else return Promise.resolve()}function G(s,t,e,n){return s.readUint8Array(t,e,n)}const ma=Dt,wa=Ke,As="\0â˜ºâ˜»â™¥â™¦â™£â™ â€¢â—˜â—‹â—™â™‚â™€â™ªâ™«â˜¼â–ºâ—„â†•â€¼Â¶Â§â–¬â†¨â†‘â†“â†’â†�âˆŸâ†”â–²â–¼ !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~âŒ‚Ã‡Ã¼Ã©Ã¢Ã¤Ã Ã¥Ã§ÃªÃ«Ã¨Ã¯Ã®Ã¬Ã„Ã…Ã‰Ã¦Ã†Ã´Ã¶Ã²Ã»Ã¹Ã¿Ã–ÃœÂ¢Â£Â¥â‚§Æ’Ã¡Ã­Ã³ÃºÃ±Ã‘ÂªÂºÂ¿âŒ�Â¬Â½Â¼Â¡Â«Â»â–‘â–’â–“â”‚â”¤â•¡â•¢â•–â••â•£â•‘â•—â•�â•œâ•›â”�â””â”´â”¬â”œâ”€â”¼â•žâ•Ÿâ•šâ•”â•©â•¦â• â•�â•¬â•§â•¨â•¤â•¥â•™â•˜â•’â•“â•«â•ªâ”˜â”Œâ–ˆâ–„â–Œâ–�â–€Î±ÃŸÎ“Ï€Î£ÏƒÂµÏ„Î¦Î˜Î©Î´âˆžÏ†Îµâˆ©â‰¡Â±â‰¥â‰¤âŒ âŒ¡Ã·â‰ˆÂ°âˆ™Â·âˆšâ�¿Â²â–  ".split(""),ga=As.length==256;function ba(s){if(ga){let t="";for(let e=0;e<s.length;e++)t+=As[s[e]];return t}else return new TextDecoder().decode(s)}function Ge(s,t){return t&&t.trim().toLowerCase()=="cp437"?ba(s):new TextDecoder(t).decode(s)}const Os="filename",Cs="rawFilename",Is="comment",Ns="rawComment",Ds="uncompressedSize",Ps="compressedSize",ks="offset",pt="diskNumberStart",mt="lastModDate",wt="rawLastModDate",Ls="lastAccessDate",ya="rawLastAccessDate",vs="creationDate",Ea="rawCreationDate",xa="internalFileAttribute",Ta="internalFileAttributes",Sa="externalFileAttribute",Ra="externalFileAttributes",Aa="msDosCompatible",Oa="zip64",Ca="encrypted",Ia="version",Na="versionMadeBy",Da="zipCrypto",Pa="directory",ka="executable",La="compressionMethod",va="signature",Fa="extraField",Ma=[Os,Cs,Ps,Ds,mt,wt,Is,Ns,Ls,vs,ks,pt,pt,xa,Ta,Sa,Ra,Aa,Oa,Ca,Ia,Na,Da,Pa,ka,La,va,Fa,"bitFlag","filenameUTF8","commentUTF8","rawExtraField","extraFieldZip64","extraFieldUnicodePath","extraFieldUnicodeComment","extraFieldAES","extraFieldNTFS","extraFieldExtendedTimestamp"];class Dn{constructor(t){Ma.forEach(e=>this[e]=t[e])}}const Ua="filenameEncoding",Ha="commentEncoding",Wa="decodeText",Ba="extractPrependedData",ja="extractAppendedData",qa="password",Ga="rawPassword",Ya="passThrough",Va="signal",Za="checkPasswordOnly",Ka="checkOverlappingEntryOnly",Xa="checkOverlappingEntry",$a="checkSignature",Ja="useWebWorkers",Qa="useCompressionStream",za="transferStreams",eo="preventClose",Ye="File format is not recognized",Fs="End of central directory not found",Ms="End of Zip64 central directory locator not found",Us="Central directory header not found",Hs="Local file header not found",Ws="Zip64 extra field not found",Bs="File contains encrypted entry",js="Encryption method not supported",gt="Compression method not supported",bt="Split zip file",qs="Overlapping entry found",Pn="utf-8",kn="cp437",to=[[Ds,pe],[Ps,pe],[ks,pe],[pt,le]],no={[le]:{getValue:H,bytes:4},[pe]:{getValue:ye,bytes:8}};class Gs{constructor(t,e={}){Object.assign(this,{reader:new Ss(t),options:e,config:Vn(),readRanges:[]})}async*getEntriesGenerator(t={}){const e=this;let{reader:n}=e;const{config:r}=e;if(await De(n),(n.size===j||!n.readUint8Array)&&(n=new It(await new Response(n.readable).blob()),await De(n)),n.size<te)throw new Error(Ye);n.chunkSize=fi(r);const i=await fo(n,qr,n.size,te,le*16);if(!i){const x=await G(n,0,4),S=B(x);throw H(S)==Gn?new Error(bt):new Error(Fs)}const a=B(i);let o=H(a,12),c=H(a,16);const h=i.offset,d=Y(a,20),m=h+te+d;let w=Y(a,4);const T=n.lastDiskNumber||0;let A=Y(a,6),u=Y(a,8),l=0,f=0;if(c==pe||o==pe||u==le||A==le){const x=await G(n,i.offset-nt,nt),S=B(x);if(H(S,0)==Gr){c=ye(S,8);let I=await G(n,c,st,-1),R=B(I);const D=i.offset-nt-st;if(H(R,0)!=ln&&c!=D){const k=c;c=D,c>k&&(l=c-k),I=await G(n,c,st,-1),R=B(I)}if(H(R,0)!=ln)throw new Error(Ms);w==le&&(w=H(R,16)),A==le&&(A=H(R,20)),u==le&&(u=ye(R,32)),o==pe&&(o=ye(R,40)),c-=o}}if(c>=n.size&&(l=n.size-c-o-te,c=n.size-o-te),T!=w)throw new Error(bt);if(c<0)throw new Error(Ye);let p=0,g=await G(n,c,o,A),C=B(g);if(o){const x=i.offset-o;if(H(C,p)!=cn&&c!=x){const S=c;c=x,c>S&&(l+=c-S),g=await G(n,c,o,A),C=B(g)}}const O=i.offset-c-(n.lastDiskOffset||0);if(o!=O&&O>=0&&(o=O,g=await G(n,c,o,A),C=B(g)),c<0||c>=n.size)throw new Error(Ye);const b=V(e,t,Ua),_=V(e,t,Ha);for(let x=0;x<u;x++){const S=new ro(n,r,e.options);if(H(C,p)!=cn)throw new Error(Us);Ys(S,C,p+6);const I=!!S.bitFlag.languageEncodingFlag,R=p+46,D=R+S.filenameLength,k=D+S.extraFieldLength,P=Y(C,p+4),U=P>>8==0,F=P>>8==3,q=g.subarray(R,D),N=Y(C,p+32),K=k+N,L=g.subarray(k,K),M=I,ve=I,xe=H(C,p+38),ee=U&&(be(C,p+38)&hn)==hn||F&&(xe>>16&ni)==si||q.length&&q.at(-1)==pn.charCodeAt(0),Q=F&&(xe>>16&ri)!=0,Pt=H(C,p+42)+l;Object.assign(S,{versionMadeBy:P,msDosCompatible:U,compressedSize:0,uncompressedSize:0,commentLength:N,directory:ee,offset:Pt,diskNumberStart:Y(C,p+34),internalFileAttributes:Y(C,p+36),externalFileAttributes:xe,rawFilename:q,filenameUTF8:M,commentUTF8:ve,rawExtraField:g.subarray(D,k),executable:Q}),S.internalFileAttribute=S.internalFileAttributes,S.externalFileAttribute=S.externalFileAttributes;const kt=V(e,t,Wa)||Ge,Lt=M?Pn:b||kn,vt=ve?Pn:_||kn;let Fe=kt(q,Lt);Fe===j&&(Fe=Ge(q,Lt));let Qe=kt(L,vt);Qe===j&&(Qe=Ge(L,vt)),Object.assign(S,{rawComment:L,filename:Fe,comment:Qe,directory:ee||Fe.endsWith(pn)}),f=Math.max(Pt,f),Vs(S,S,C,p+6),S.zipCrypto=S.encrypted&&!S.extraFieldAES;const Te=new Dn(S);Te.getData=(Me,Ue)=>S.getData(Me,Te,e.readRanges,Ue),Te.arrayBuffer=async Me=>{const Ue=new TransformStream,[Ks]=await Promise.all([new Response(Ue.readable).arrayBuffer(),S.getData(Ue,Te,e.readRanges,Me)]);return Ks},p=K;const{onprogress:Ft}=t;if(Ft)try{await Ft(x+1,u,new Dn(S))}catch{}yield Te}const E=V(e,t,Ba),y=V(e,t,ja);return E&&(e.prependedData=f>0?await G(n,0,f):new Uint8Array),e.comment=d?await G(n,h+te,d):new Uint8Array,y&&(e.appendedData=m<n.size?await G(n,m,n.size-m):new Uint8Array),!0}async getEntries(t={}){const e=[];for await(const n of this.getEntriesGenerator(t))e.push(n);return e}async close(){}}class so{constructor(t={}){const{readable:e,writable:n}=new TransformStream,r=new Gs(e,t).getEntriesGenerator();this.readable=new ReadableStream({async pull(i){const{done:a,value:o}=await r.next();if(a)return i.close();const c={...o,readable:(function(){const{readable:h,writable:d}=new TransformStream;if(o.getData)return o.getData(d),h})()};delete c.getData,i.enqueue(c)}}),this.writable=n}}class ro{constructor(t,e,n){Object.assign(this,{reader:t,config:e,options:n})}async getData(t,e,n,r={}){const i=this,{reader:a,offset:o,diskNumberStart:c,extraFieldAES:h,extraFieldZip64:d,compressionMethod:m,config:w,bitFlag:T,signature:A,rawLastModDate:u,uncompressedSize:l,compressedSize:f}=i,{dataDescriptor:p}=T,g=e.localDirectory={},C=await G(a,o,rt,c),O=B(C);let b=V(i,r,qa),_=V(i,r,Ga);const E=V(i,r,Ya);if(b=b&&b.length&&b,_=_&&_.length&&_,h&&h.originalCompressionMethod!=Wr)throw new Error(gt);if(m!=Hr&&m!=Ur&&!E)throw new Error(gt);if(H(O,0)!=Br)throw new Error(Hs);Ys(g,O,4);const{extraFieldLength:y,filenameLength:x,lastAccessDate:S,creationDate:I}=g;g.rawExtraField=y?await G(a,o+rt+x,y,c):new Uint8Array,Vs(i,g,O,4,!0),Object.assign(e,{lastAccessDate:S,creationDate:I});const R=i.encrypted&&g.encrypted&&!E,D=R&&!h;if(E||(e.zipCrypto=D),R){if(!D&&h.strength===j)throw new Error(js);if(!b&&!_)throw new Error(Bs)}const k=o+rt+x+y,P=f,U=a.readable;Object.assign(U,{diskNumberStart:c,offset:k,size:P});const F=V(i,r,Va),q=V(i,r,Za);let N=V(i,r,Xa);const K=V(i,r,Ka);K&&(N=!0);const{onstart:L,onprogress:M,onend:ve}=r,xe={options:{codecType:fs,password:b,rawPassword:_,zipCrypto:D,encryptionStrength:h&&h.strength,signed:V(i,r,$a)&&!E,passwordVerification:D&&(p?u>>>8&255:A>>>24&255),outputSize:l,signature:A,compressed:m!=0&&!E,encrypted:i.encrypted&&!E,useWebWorkers:V(i,r,Ja),useCompressionStream:V(i,r,Qa),transferStreams:V(i,r,za),checkPasswordOnly:q},config:w,streamOptions:{signal:F,size:P,onstart:L,onprogress:M,onend:ve}};N&&await lo({reader:a,fileEntry:e,offset:o,diskNumberStart:c,signature:A,compressedSize:f,uncompressedSize:l,dataOffset:k,dataDescriptor:p||g.bitFlag.dataDescriptor,extraFieldZip64:d||g.extraFieldZip64,readRanges:n});let ee;try{if(!K){q&&(t=new WritableStream),t=new Rs(t),await De(t,E?f:l),{writable:ee}=t;const{outputSize:Q}=await Xi({readable:U,writable:ee},xe);if(t.size+=Q,Q!=(E?f:l))throw new Error(Rt)}}catch(Q){if(Q.outputSize!==j&&(t.size+=Q.outputSize),!q||Q.message!=xt)throw Q}finally{!V(i,r,eo)&&ee&&!ee.locked&&await ee.getWriter().close()}return q||K?j:t.getData?t.getData():ee}}function Ys(s,t,e){const n=s.rawBitFlag=Y(t,e+2),r=(n&un)==un,i=H(t,e+6);Object.assign(s,{encrypted:r,version:Y(t,e),bitFlag:{level:(n&ti)>>1,dataDescriptor:(n&dn)==dn,languageEncodingFlag:(n&_n)==_n},rawLastModDate:i,lastModDate:uo(i),filenameLength:Y(t,e+22),extraFieldLength:Y(t,e+24)})}function Vs(s,t,e,n,r){const{rawExtraField:i}=t,a=t.extraField=new Map,o=B(new Uint8Array(i));let c=0;try{for(;c<i.length;){const f=Y(o,c),p=Y(o,c+2);a.set(f,{type:f,data:i.slice(c+4,c+4+p)}),c+=4+p}}catch{}const h=Y(e,n+4);Object.assign(t,{signature:H(e,n+ii),compressedSize:H(e,n+ai),uncompressedSize:H(e,n+oi)});const d=a.get(Zr);d&&(io(d,t),t.extraFieldZip64=d);const m=a.get(Qr);m&&(Ln(m,Os,Cs,t,s),t.extraFieldUnicodePath=m);const w=a.get(zr);w&&(Ln(w,Is,Ns,t,s),t.extraFieldUnicodeComment=w);const T=a.get(Kr);T?(ao(T,t,h),t.extraFieldAES=T):t.compressionMethod=h;const A=a.get(Xr);A&&(oo(A,t),t.extraFieldNTFS=A);const u=a.get(Jr);u&&(co(u,t,r),t.extraFieldExtendedTimestamp=u);const l=a.get(ei);l&&(t.extraFieldUSDZ=l)}function io(s,t){t.zip64=!0;const e=B(s.data),n=to.filter(([r,i])=>t[r]==i);for(let r=0,i=0;r<n.length;r++){const[a,o]=n[r];if(t[a]==o){const c=no[o];t[a]=s[a]=c.getValue(e,i),i+=c.bytes}else if(s[a])throw new Error(Ws)}}function Ln(s,t,e,n,r){const i=B(s.data),a=new Ve;a.append(r[e]);const o=B(new Uint8Array(4));o.setUint32(0,a.get(),!0);const c=H(i,1);Object.assign(s,{version:be(i,0),[t]:Ge(s.data.subarray(5)),valid:!r.bitFlag.languageEncodingFlag&&c==H(o,0)}),s.valid&&(n[t]=s[t],n[t+"UTF8"]=!0)}function ao(s,t,e){const n=B(s.data),r=be(n,4);Object.assign(s,{vendorVersion:be(n,0),vendorId:be(n,2),strength:r,originalCompressionMethod:e,compressionMethod:Y(n,5)}),t.compressionMethod=s.compressionMethod}function oo(s,t){const e=B(s.data);let n=4,r;try{for(;n<s.data.length&&!r;){const i=Y(e,n),a=Y(e,n+2);i==$r&&(r=s.data.slice(n+4,n+4+a)),n+=4+a}}catch{}try{if(r&&r.length==24){const i=B(r),a=i.getBigUint64(0,!0),o=i.getBigUint64(8,!0),c=i.getBigUint64(16,!0);Object.assign(s,{rawLastModDate:a,rawLastAccessDate:o,rawCreationDate:c});const h=ct(a),d=ct(o),m=ct(c),w={lastModDate:h,lastAccessDate:d,creationDate:m};Object.assign(s,w),Object.assign(t,w)}}catch{}}function co(s,t,e){const n=B(s.data),r=be(n,0),i=[],a=[];e?((r&1)==1&&(i.push(mt),a.push(wt)),(r&2)==2&&(i.push(Ls),a.push(ya)),(r&4)==4&&(i.push(vs),a.push(Ea))):s.data.length>=5&&(i.push(mt),a.push(wt));let o=1;i.forEach((c,h)=>{if(s.data.length>=o+4){const d=H(n,o);t[c]=s[c]=new Date(d*1e3);const m=a[h];s[m]=d}o+=4})}async function lo({reader:s,fileEntry:t,offset:e,diskNumberStart:n,signature:r,compressedSize:i,uncompressedSize:a,dataOffset:o,dataDescriptor:c,extraFieldZip64:h,readRanges:d}){let m=0;if(n)for(let A=0;A<n;A++){const u=s.readers[A];m+=u.size}let w=0;if(c&&(h?w=Vr:w=Yr),w){const A=await G(s,o+i,w+fn,n);if(H(B(A),0)==jr){const l=H(B(A),4);let f,p;h?(f=ye(B(A),8),p=ye(B(A),16)):(f=H(B(A),8),p=H(B(A),12)),(t.encrypted&&!t.zipCrypto||l==r)&&f==i&&p==a&&(w+=fn)}}const T={start:m+e,end:m+o+i+w,fileEntry:t};for(const A of d)if(A.fileEntry!=t&&T.start>=A.start&&T.start<A.end){const u=new Error(qs);throw u.overlappingEntry=A.fileEntry,u}d.push(T)}async function fo(s,t,e,n,r){const i=new Uint8Array(4),a=B(i);_o(a,0,t);const o=n+r;return await c(n)||await c(Math.min(o,e));async function c(h){const d=e-h,m=await G(s,d,h);for(let w=m.length-n;w>=0;w--)if(m[w]==i[0]&&m[w+1]==i[1]&&m[w+2]==i[2]&&m[w+3]==i[3])return{offset:d+w,buffer:m.slice(w,w+n).buffer}}}function V(s,t,e){return t[e]===j?s.options[e]:t[e]}function uo(s){const t=(s&4294901760)>>16,e=s&65535;try{return new Date(1980+((t&65024)>>9),((t&480)>>5)-1,t&31,(e&63488)>>11,(e&2016)>>5,(e&31)*2,0)}catch{}}function ct(s){return new Date(Number(s/BigInt(1e4)-BigInt(116444736e5)))}function be(s,t){return s.getUint8(t)}function Y(s,t){return s.getUint16(t,!0)}function H(s,t){return s.getUint32(t,!0)}function ye(s,t){return Number(s.getBigUint64(t,!0))}function _o(s,t,e){s.setUint32(t,e,!0)}function B(s){return new DataView(s.buffer)}Zn({Inflate:Mr});const ho=Object.freeze(Object.defineProperty({__proto__:null,BlobReader:It,BlobWriter:ws,Data64URIReader:aa,Data64URIWriter:oa,ERR_BAD_FORMAT:Ye,ERR_CENTRAL_DIRECTORY_NOT_FOUND:Us,ERR_ENCRYPTED:Bs,ERR_EOCDR_LOCATOR_ZIP64_NOT_FOUND:Ms,ERR_EOCDR_NOT_FOUND:Fs,ERR_EXTRAFIELD_ZIP64_NOT_FOUND:Ws,ERR_HTTP_RANGE:Le,ERR_INVALID_PASSWORD:yt,ERR_INVALID_SIGNATURE:Et,ERR_INVALID_UNCOMPRESSED_SIZE:Rt,ERR_ITERATOR_COMPLETED_TOO_SOON:hs,ERR_LOCAL_FILE_HEADER_NOT_FOUND:Hs,ERR_OVERLAPPING_ENTRY:qs,ERR_SPLIT_ZIP_FILE:bt,ERR_UNSUPPORTED_COMPRESSION:gt,ERR_UNSUPPORTED_ENCRYPTION:js,ERR_WRITER_NOT_INITIALIZED:ps,GenericReader:Ss,GenericWriter:Rs,HttpRangeReader:da,HttpReader:Ts,Reader:_e,SplitDataReader:Dt,SplitDataWriter:Ke,SplitZipReader:ma,SplitZipWriter:wa,TextReader:ca,TextWriter:la,Uint8ArrayReader:_a,Uint8ArrayWriter:ha,Writer:Ct,ZipReader:Gs,ZipReaderStream:so,configure:Zn,getMimeType:ui,initStream:De,readUint8Array:G,terminateWorkers:Ji},Symbol.toStringTag,{value:"Module"})),Ae=ho;class po{constructor(t,e){Ae.configure({baseURL:self.location.href}),this._zipReader=new Ae.ZipReader(new Ae.HttpReader(this._resolveTraceURI(t),{mode:"cors",preventHeadRequest:!0}),{useWebWorkers:!1}),this._entriesPromise=this._zipReader.getEntries({onprogress:e}).then(n=>{const r=new Map;for(const i of n)r.set(i.filename,i);return r})}_resolveTraceURI(t){return t.startsWith("https://www.dropbox.com/")?"https://dl.dropboxusercontent.com/"+t.substring(24):t}isLive(){return!1}async entryNames(){return[...(await this._entriesPromise).keys()]}async hasEntry(t){return(await this._entriesPromise).has(t)}async readText(t){var i;const n=(await this._entriesPromise).get(t);if(!n)return;const r=new Ae.TextWriter;return await((i=n.getData)==null?void 0:i.call(n,r)),r.getData()}async readBlob(t){const n=(await this._entriesPromise).get(t);if(!n)return;const r=new Ae.BlobWriter;return await n.getData(r),r.getData()}}class mo{constructor(t){this._entriesPromise=this._readFile(t).then(async e=>{if(!e)throw new Error("File not found");const n=await e.json(),r=new Map;for(const i of n.entries)r.set(i.name,i.path);return r})}isLive(){return!0}async entryNames(){return[...(await this._entriesPromise).keys()]}async hasEntry(t){return(await this._entriesPromise).has(t)}async readText(t){const e=await this._readEntry(t);return e==null?void 0:e.text()}async readBlob(t){const e=await this._readEntry(t);return(e==null?void 0:e.status)===200?await(e==null?void 0:e.blob()):void 0}async _readEntry(t){const n=(await this._entriesPromise).get(t);if(n)return this._readFile(n)}async _readFile(t){const e=await fetch(t);if(e.status!==404)return e}}self.addEventListener("install",function(s){self.skipWaiting()});self.addEventListener("activate",function(s){s.waitUntil(self.clients.claim())});const wo=new URL(self.registration.scope).pathname,Ee=new Map,Xe=new Map,vn=self.registration.scope.startsWith("https://");function go(){Ee.clear(),Xe.clear()}async function Fn(s,t,e){try{return{loadedTrace:await Zs(s,t,e)}}catch(n){return{errorResponse:new Response(JSON.stringify({error:n==null?void 0:n.message}),{status:500,headers:{"Content-Type":"application/json"}})}}}function Zs(s,t,e){const n=t.searchParams.get("trace");if(!n)throw new Error("trace parameter is missing");Xe.set(s,n);const r=Ee.get(n);if(r)return r;const i=bo(n,e);return Ee.set(n,i),i.catch(()=>Ee.delete(n)),i}async function bo(s,t){var r;await xo();const e=new pr;try{const[i,a]=wr(t,[.5,.4,.1]),o=So(s)||s.endsWith("traces.dir")?new mo(s):new po(s,i);await e.load(o,void 0,a)}catch(i){if(console.error(i),(r=i==null?void 0:i.message)!=null&&r.includes("Cannot find .trace file")&&await e.hasEntry("index.html"))throw new Error("Could not load trace. Did you upload a Playwright HTML report instead? Make sure to extract the archive first and then double-click the index.html file or put it on a web server.");if(i instanceof Bn)throw new Error(`Could not load trace from ${s}. ${i.message}`);let a=`Could not load trace from ${s}. Make sure a valid Playwright Trace is accessible over this url.`;const o=await navigator.permissions.query({name:"local-network-access"}).catch(()=>{});throw o&&o.state!=="granted"&&(a+=`

If your trace is in a local or private network, please grant permission for Local Network Access.`),new Error(a)}const n=new Xs(e.storage(),i=>e.resourceForSha1(i));return{traceLoader:e,snapshotServer:n}}async function yo(s){const t=s.request;if(t.url.startsWith("chrome-extension://"))return fetch(t);const e=new URL(t.url);let n;if(t.url.startsWith(self.registration.scope)&&(n=e.pathname.substring(wo.length-1)),n==="/restartServiceWorker")return go(),new Response(null,{status:200});if(n==="/ping")return new Response(null,{status:200});const r=!!s.resultingClientId,i=s.clientId?await self.clients.get(s.clientId):void 0;if(r&&!(n!=null&&n.startsWith("/sha1/"))){if(n!=null&&n.startsWith("/snapshot/")){const{errorResponse:a,loadedTrace:o}=await Fn(s.resultingClientId,e,To);if(a)return a;const c=n.substring(10),h=o.snapshotServer.serveSnapshot(c,e.searchParams,e.href);return vn&&h.headers.set("Content-Security-Policy","upgrade-insecure-requests"),h}return fetch(s.request)}if(!n){if(!i)return new Response("Sub-resource without a client",{status:500});const{snapshotServer:a}=await Zs(i.id,new URL(i.url),Mn(i));if(!a)return new Response(null,{status:404});const o=[t.url];return vn&&t.url.startsWith("https://")&&o.push(t.url.replace(/^https/,"http")),a.serveResource(o,t.method,i.url)}if(n==="/contexts"||n.startsWith("/snapshotInfo/")||n.startsWith("/closest-screenshot/")||n.startsWith("/sha1/")){if(!i)return new Response("Sub-resource without a client",{status:500});const{errorResponse:a,loadedTrace:o}=await Fn(i.id,e,Mn(i));if(a)return a;if(n==="/contexts")return new Response(JSON.stringify(o.traceLoader.contextEntries),{status:200,headers:{"Content-Type":"application/json"}});if(n.startsWith("/snapshotInfo/")){const c=n.substring(14);return o.snapshotServer.serveSnapshotInfo(c,e.searchParams)}if(n.startsWith("/closest-screenshot/")){const c=n.substring(20);return o.snapshotServer.serveClosestScreenshot(c,e.searchParams)}if(n.startsWith("/sha1/")){const c=await o.traceLoader.resourceForSha1(n.slice(6));return c?new Response(c,{status:200,headers:Eo(e.searchParams)}):new Response(null,{status:404})}}return fetch(s.request)}function Eo(s){const t=s.get("dn"),e=s.get("dct");if(!t)return;const n=new Headers;return n.set("Content-Disposition",`attachment; filename="attachment"; filename*=UTF-8''${encodeURIComponent(t)}`),e&&n.set("Content-Type",e),n}async function xo(){const s=await self.clients.matchAll(),t=new Set;for(const[e,n]of Xe){if(!s.find(r=>r.id===e)){Xe.delete(e);continue}t.add(n)}for(const e of Ee.keys())t.has(e)||Ee.delete(e)}function Mn(s){return(t,e)=>{s.postMessage({method:"progress",params:{done:t,total:e}})}}function To(s,t){}function So(s){const e=new URL(s,"http://localhost").searchParams.get("path");return!!(e!=null&&e.endsWith(".json"))}self.addEventListener("fetch",function(s){if(s.request.headers.get("x-pw-serviceworker")==="skip")return!1;s.respondWith(yo(s))});
.ui-mode-sidebar{background-color:var(--vscode-sideBar-background)}.ui-mode-sidebar>.settings-toolbar{border-top:1px solid var(--vscode-panel-border);cursor:pointer}.ui-mode-sidebar>.settings-view{margin:0 0 8px 23px}.ui-mode-sidebar .toolbar-button:not([disabled]) .codicon-play{color:var(--vscode-debugIcon-restartForeground)}.ui-mode-sidebar .toolbar-button:not([disabled]) .codicon-debug-stop{color:var(--vscode-debugIcon-stopForeground)}.ui-mode .section-toolbar{border-top:1px solid var(--vscode-panel-border)}.ui-mode .section-title{display:flex;flex:auto;flex-direction:row;align-items:center;font-size:11px;text-transform:uppercase;font-weight:700;text-overflow:ellipsis;overflow:hidden;padding:8px;height:30px}.ui-mode-sidebar img{flex:none;margin-left:6px;width:24px;height:24px}.ui-mode .disconnected{display:flex;align-items:center;justify-content:center;flex:auto;flex-direction:column;background-color:var(--vscode-editor-background);position:absolute;top:0;right:0;bottom:0;left:0;z-index:1000;line-height:24px}.disconnected .title{font-size:24px;font-weight:700;margin-bottom:30px}.status-line{flex:auto;white-space:nowrap;line-height:22px;padding-left:10px;display:flex;flex-direction:row;align-items:center;height:30px}.status-line>div{overflow:hidden;text-overflow:ellipsis}.status-line .status-line-failed{color:var(--vscode-testing-iconFailed)}.ui-mode-sidebar input[type=search]{flex:auto;padding:0 5px;line-height:24px;outline:none;margin:0 4px;border:none;color:var(--vscode-input-foreground);background-color:var(--vscode-input-background)}.ui-mode-sidebar select{flex:auto;padding:0 5px;height:24px;line-height:24px;outline:none;border:none;color:var(--vscode-input-foreground);background-color:var(--vscode-input-background)}:root{--vscode-font-family: system-ui, "Ubuntu", "Droid Sans", sans-serif;--vscode-font-weight: normal;--vscode-font-size: 13px;--vscode-editor-font-family: "Droid Sans Mono", "monospace", monospace;--vscode-editor-font-weight: normal;--vscode-editor-font-size: 14px;--vscode-foreground: #616161;--vscode-disabledForeground: rgba(97, 97, 97, .5);--vscode-errorForeground: #a1260d;--vscode-descriptionForeground: #717171;--vscode-icon-foreground: #424242;--vscode-focusBorder: #0090f1;--vscode-textSeparator-foreground: rgba(0, 0, 0, .18);--vscode-textLink-foreground: #006ab1;--vscode-textLink-activeForeground: #006ab1;--vscode-textPreformat-foreground: #a31515;--vscode-textBlockQuote-background: rgba(127, 127, 127, .1);--vscode-textBlockQuote-border: rgba(0, 122, 204, .5);--vscode-textCodeBlock-background: rgba(220, 220, 220, .4);--vscode-widget-shadow: rgba(0, 0, 0, .16);--vscode-input-background: #ffffff;--vscode-input-foreground: #616161;--vscode-inputOption-activeBorder: #007acc;--vscode-inputOption-hoverBackground: rgba(184, 184, 184, .31);--vscode-inputOption-activeBackground: rgba(0, 144, 241, .2);--vscode-inputOption-activeForeground: #000000;--vscode-input-placeholderForeground: #767676;--vscode-inputValidation-infoBackground: #d6ecf2;--vscode-inputValidation-infoBorder: #007acc;--vscode-inputValidation-warningBackground: #f6f5d2;--vscode-inputValidation-warningBorder: #b89500;--vscode-inputValidation-errorBackground: #f2dede;--vscode-inputValidation-errorBorder: #be1100;--vscode-dropdown-background: #ffffff;--vscode-dropdown-border: #cecece;--vscode-checkbox-background: #ffffff;--vscode-checkbox-border: #cecece;--vscode-button-foreground: #ffffff;--vscode-button-separator: rgba(255, 255, 255, .4);--vscode-button-background: #007acc;--vscode-button-hoverBackground: #0062a3;--vscode-button-secondaryForeground: #ffffff;--vscode-button-secondaryBackground: #5f6a79;--vscode-button-secondaryHoverBackground: #4c5561;--vscode-badge-background: #c4c4c4;--vscode-badge-foreground: #333333;--vscode-scrollbar-shadow: #dddddd;--vscode-scrollbarSlider-background: rgba(100, 100, 100, .4);--vscode-scrollbarSlider-hoverBackground: rgba(100, 100, 100, .7);--vscode-scrollbarSlider-activeBackground: rgba(0, 0, 0, .6);--vscode-progressBar-background: #0e70c0;--vscode-editorError-foreground: #e51400;--vscode-editorWarning-foreground: #bf8803;--vscode-editorInfo-foreground: #1a85ff;--vscode-editorHint-foreground: #6c6c6c;--vscode-sash-hoverBorder: #0090f1;--vscode-editor-background: #ffffff;--vscode-editor-foreground: #000000;--vscode-editorStickyScroll-background: #ffffff;--vscode-editorStickyScrollHover-background: #f0f0f0;--vscode-editorWidget-background: #f3f3f3;--vscode-editorWidget-foreground: #616161;--vscode-editorWidget-border: #c8c8c8;--vscode-quickInput-background: #f3f3f3;--vscode-quickInput-foreground: #616161;--vscode-quickInputTitle-background: rgba(0, 0, 0, .06);--vscode-pickerGroup-foreground: #0066bf;--vscode-pickerGroup-border: #cccedb;--vscode-keybindingLabel-background: rgba(221, 221, 221, .4);--vscode-keybindingLabel-foreground: #555555;--vscode-keybindingLabel-border: rgba(204, 204, 204, .4);--vscode-keybindingLabel-bottomBorder: rgba(187, 187, 187, .4);--vscode-editor-selectionBackground: #add6ff;--vscode-editor-inactiveSelectionBackground: #e5ebf1;--vscode-editor-selectionHighlightBackground: rgba(173, 214, 255, .5);--vscode-editor-findMatchBackground: #a8ac94;--vscode-editor-findMatchHighlightBackground: rgba(234, 92, 0, .33);--vscode-editor-findRangeHighlightBackground: rgba(180, 180, 180, .3);--vscode-searchEditor-findMatchBackground: rgba(234, 92, 0, .22);--vscode-editor-hoverHighlightBackground: rgba(173, 214, 255, .15);--vscode-editorHoverWidget-background: #f3f3f3;--vscode-editorHoverWidget-foreground: #616161;--vscode-editorHoverWidget-border: #c8c8c8;--vscode-editorHoverWidget-statusBarBackground: #e7e7e7;--vscode-editorLink-activeForeground: #0000ff;--vscode-editorInlayHint-foreground: rgba(51, 51, 51, .8);--vscode-editorInlayHint-background: rgba(196, 196, 196, .3);--vscode-editorInlayHint-typeForeground: rgba(51, 51, 51, .8);--vscode-editorInlayHint-typeBackground: rgba(196, 196, 196, .3);--vscode-editorInlayHint-parameterForeground: rgba(51, 51, 51, .8);--vscode-editorInlayHint-parameterBackground: rgba(196, 196, 196, .3);--vscode-editorLightBulb-foreground: #ddb100;--vscode-editorLightBulbAutoFix-foreground: #007acc;--vscode-diffEditor-insertedTextBackground: rgba(156, 204, 44, .4);--vscode-diffEditor-removedTextBackground: rgba(255, 0, 0, .3);--vscode-diffEditor-insertedLineBackground: rgba(155, 185, 85, .2);--vscode-diffEditor-removedLineBackground: rgba(255, 0, 0, .2);--vscode-diffEditor-diagonalFill: rgba(34, 34, 34, .2);--vscode-list-focusOutline: #0090f1;--vscode-list-focusAndSelectionOutline: #90c2f9;--vscode-list-activeSelectionBackground: #0060c0;--vscode-list-activeSelectionForeground: #ffffff;--vscode-list-activeSelectionIconForeground: #ffffff;--vscode-list-inactiveSelectionBackground: #e4e6f1;--vscode-list-hoverBackground: #e8e8e8;--vscode-list-dropBackground: #d6ebff;--vscode-list-highlightForeground: #0066bf;--vscode-list-focusHighlightForeground: #bbe7ff;--vscode-list-invalidItemForeground: #b89500;--vscode-list-errorForeground: #b01011;--vscode-list-warningForeground: #855f00;--vscode-listFilterWidget-background: #f3f3f3;--vscode-listFilterWidget-outline: rgba(0, 0, 0, 0);--vscode-listFilterWidget-noMatchesOutline: #be1100;--vscode-listFilterWidget-shadow: rgba(0, 0, 0, .16);--vscode-list-filterMatchBackground: rgba(234, 92, 0, .33);--vscode-tree-indentGuidesStroke: #a9a9a9;--vscode-tree-tableColumnsBorder: rgba(97, 97, 97, .13);--vscode-tree-tableOddRowsBackground: rgba(97, 97, 97, .04);--vscode-list-deemphasizedForeground: #8e8e90;--vscode-quickInputList-focusForeground: #ffffff;--vscode-quickInputList-focusIconForeground: #ffffff;--vscode-quickInputList-focusBackground: #0060c0;--vscode-menu-foreground: #616161;--vscode-menu-background: #ffffff;--vscode-menu-selectionForeground: #ffffff;--vscode-menu-selectionBackground: #0060c0;--vscode-menu-separatorBackground: #d4d4d4;--vscode-toolbar-hoverBackground: rgba(184, 184, 184, .31);--vscode-toolbar-activeBackground: rgba(166, 166, 166, .31);--vscode-editor-snippetTabstopHighlightBackground: rgba(10, 50, 100, .2);--vscode-editor-snippetFinalTabstopHighlightBorder: rgba(10, 50, 100, .5);--vscode-breadcrumb-foreground: rgba(97, 97, 97, .8);--vscode-breadcrumb-background: #ffffff;--vscode-breadcrumb-focusForeground: #4e4e4e;--vscode-breadcrumb-activeSelectionForeground: #4e4e4e;--vscode-breadcrumbPicker-background: #f3f3f3;--vscode-merge-currentHeaderBackground: rgba(64, 200, 174, .5);--vscode-merge-currentContentBackground: rgba(64, 200, 174, .2);--vscode-merge-incomingHeaderBackground: rgba(64, 166, 255, .5);--vscode-merge-incomingContentBackground: rgba(64, 166, 255, .2);--vscode-merge-commonHeaderBackground: rgba(96, 96, 96, .4);--vscode-merge-commonContentBackground: rgba(96, 96, 96, .16);--vscode-editorOverviewRuler-currentContentForeground: rgba(64, 200, 174, .5);--vscode-editorOverviewRuler-incomingContentForeground: rgba(64, 166, 255, .5);--vscode-editorOverviewRuler-commonContentForeground: rgba(96, 96, 96, .4);--vscode-editorOverviewRuler-findMatchForeground: rgba(209, 134, 22, .49);--vscode-editorOverviewRuler-selectionHighlightForeground: rgba(160, 160, 160, .8);--vscode-minimap-findMatchHighlight: #d18616;--vscode-minimap-selectionOccurrenceHighlight: #c9c9c9;--vscode-minimap-selectionHighlight: #add6ff;--vscode-minimap-errorHighlight: rgba(255, 18, 18, .7);--vscode-minimap-warningHighlight: #bf8803;--vscode-minimap-foregroundOpacity: #000000;--vscode-minimapSlider-background: rgba(100, 100, 100, .2);--vscode-minimapSlider-hoverBackground: rgba(100, 100, 100, .35);--vscode-minimapSlider-activeBackground: rgba(0, 0, 0, .3);--vscode-problemsErrorIcon-foreground: #e51400;--vscode-problemsWarningIcon-foreground: #bf8803;--vscode-problemsInfoIcon-foreground: #1a85ff;--vscode-charts-foreground: #616161;--vscode-charts-lines: rgba(97, 97, 97, .5);--vscode-charts-red: #e51400;--vscode-charts-blue: #1a85ff;--vscode-charts-yellow: #bf8803;--vscode-charts-orange: #d18616;--vscode-charts-green: #388a34;--vscode-charts-purple: #652d90;--vscode-editor-lineHighlightBorder: #eeeeee;--vscode-editor-rangeHighlightBackground: rgba(253, 255, 0, .2);--vscode-editor-symbolHighlightBackground: rgba(234, 92, 0, .33);--vscode-editorCursor-foreground: #000000;--vscode-editorWhitespace-foreground: rgba(51, 51, 51, .2);--vscode-editorIndentGuide-background: #d3d3d3;--vscode-editorIndentGuide-activeBackground: #939393;--vscode-editorLineNumber-foreground: #237893;--vscode-editorActiveLineNumber-foreground: #0b216f;--vscode-editorLineNumber-activeForeground: #0b216f;--vscode-editorRuler-foreground: #d3d3d3;--vscode-editorCodeLens-foreground: #919191;--vscode-editorBracketMatch-background: rgba(0, 100, 0, .1);--vscode-editorBracketMatch-border: #b9b9b9;--vscode-editorOverviewRuler-border: rgba(127, 127, 127, .3);--vscode-editorGutter-background: #ffffff;--vscode-editorUnnecessaryCode-opacity: rgba(0, 0, 0, .47);--vscode-editorGhostText-foreground: rgba(0, 0, 0, .47);--vscode-editorOverviewRuler-rangeHighlightForeground: rgba(0, 122, 204, .6);--vscode-editorOverviewRuler-errorForeground: rgba(255, 18, 18, .7);--vscode-editorOverviewRuler-warningForeground: #bf8803;--vscode-editorOverviewRuler-infoForeground: #1a85ff;--vscode-editorBracketHighlight-foreground1: #0431fa;--vscode-editorBracketHighlight-foreground2: #319331;--vscode-editorBracketHighlight-foreground3: #7b3814;--vscode-editorBracketHighlight-foreground4: rgba(0, 0, 0, 0);--vscode-editorBracketHighlight-foreground5: rgba(0, 0, 0, 0);--vscode-editorBracketHighlight-foreground6: rgba(0, 0, 0, 0);--vscode-editorBracketHighlight-unexpectedBracket\.foreground: rgba(255, 18, 18, .8);--vscode-editorBracketPairGuide-background1: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-background2: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-background3: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-background4: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-background5: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-background6: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-activeBackground1: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-activeBackground2: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-activeBackground3: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-activeBackground4: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-activeBackground5: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-activeBackground6: rgba(0, 0, 0, 0);--vscode-editorUnicodeHighlight-border: #cea33d;--vscode-editorUnicodeHighlight-background: rgba(206, 163, 61, .08);--vscode-symbolIcon-arrayForeground: #616161;--vscode-symbolIcon-booleanForeground: #616161;--vscode-symbolIcon-classForeground: #d67e00;--vscode-symbolIcon-colorForeground: #616161;--vscode-symbolIcon-constantForeground: #616161;--vscode-symbolIcon-constructorForeground: #652d90;--vscode-symbolIcon-enumeratorForeground: #d67e00;--vscode-symbolIcon-enumeratorMemberForeground: #007acc;--vscode-symbolIcon-eventForeground: #d67e00;--vscode-symbolIcon-fieldForeground: #007acc;--vscode-symbolIcon-fileForeground: #616161;--vscode-symbolIcon-folderForeground: #616161;--vscode-symbolIcon-functionForeground: #652d90;--vscode-symbolIcon-interfaceForeground: #007acc;--vscode-symbolIcon-keyForeground: #616161;--vscode-symbolIcon-keywordForeground: #616161;--vscode-symbolIcon-methodForeground: #652d90;--vscode-symbolIcon-moduleForeground: #616161;--vscode-symbolIcon-namespaceForeground: #616161;--vscode-symbolIcon-nullForeground: #616161;--vscode-symbolIcon-numberForeground: #616161;--vscode-symbolIcon-objectForeground: #616161;--vscode-symbolIcon-operatorForeground: #616161;--vscode-symbolIcon-packageForeground: #616161;--vscode-symbolIcon-propertyForeground: #616161;--vscode-symbolIcon-referenceForeground: #616161;--vscode-symbolIcon-snippetForeground: #616161;--vscode-symbolIcon-stringForeground: #616161;--vscode-symbolIcon-structForeground: #616161;--vscode-symbolIcon-textForeground: #616161;--vscode-symbolIcon-typeParameterForeground: #616161;--vscode-symbolIcon-unitForeground: #616161;--vscode-symbolIcon-variableForeground: #007acc;--vscode-editorHoverWidget-highlightForeground: #0066bf;--vscode-editorOverviewRuler-bracketMatchForeground: #a0a0a0;--vscode-editor-foldBackground: rgba(173, 214, 255, .3);--vscode-editorGutter-foldingControlForeground: #424242;--vscode-editor-linkedEditingBackground: rgba(255, 0, 0, .3);--vscode-editor-wordHighlightBackground: rgba(87, 87, 87, .25);--vscode-editor-wordHighlightStrongBackground: rgba(14, 99, 156, .25);--vscode-editorOverviewRuler-wordHighlightForeground: rgba(160, 160, 160, .8);--vscode-editorOverviewRuler-wordHighlightStrongForeground: rgba(192, 160, 192, .8);--vscode-peekViewTitle-background: rgba(26, 133, 255, .1);--vscode-peekViewTitleLabel-foreground: #000000;--vscode-peekViewTitleDescription-foreground: #616161;--vscode-peekView-border: #1a85ff;--vscode-peekViewResult-background: #f3f3f3;--vscode-peekViewResult-lineForeground: #646465;--vscode-peekViewResult-fileForeground: #1e1e1e;--vscode-peekViewResult-selectionBackground: rgba(51, 153, 255, .2);--vscode-peekViewResult-selectionForeground: #6c6c6c;--vscode-peekViewEditor-background: #f2f8fc;--vscode-peekViewEditorGutter-background: #f2f8fc;--vscode-peekViewResult-matchHighlightBackground: rgba(234, 92, 0, .3);--vscode-peekViewEditor-matchHighlightBackground: rgba(245, 216, 2, .87);--vscode-editorMarkerNavigationError-background: #e51400;--vscode-editorMarkerNavigationError-headerBackground: rgba(229, 20, 0, .1);--vscode-editorMarkerNavigationWarning-background: #bf8803;--vscode-editorMarkerNavigationWarning-headerBackground: rgba(191, 136, 3, .1);--vscode-editorMarkerNavigationInfo-background: #1a85ff;--vscode-editorMarkerNavigationInfo-headerBackground: rgba(26, 133, 255, .1);--vscode-editorMarkerNavigation-background: #ffffff;--vscode-editorSuggestWidget-background: #f3f3f3;--vscode-editorSuggestWidget-border: #c8c8c8;--vscode-editorSuggestWidget-foreground: #000000;--vscode-editorSuggestWidget-selectedForeground: #ffffff;--vscode-editorSuggestWidget-selectedIconForeground: #ffffff;--vscode-editorSuggestWidget-selectedBackground: #0060c0;--vscode-editorSuggestWidget-highlightForeground: #0066bf;--vscode-editorSuggestWidget-focusHighlightForeground: #bbe7ff;--vscode-editorSuggestWidgetStatus-foreground: rgba(0, 0, 0, .5);--vscode-tab-activeBackground: #ffffff;--vscode-tab-unfocusedActiveBackground: #ffffff;--vscode-tab-inactiveBackground: #ececec;--vscode-tab-unfocusedInactiveBackground: #ececec;--vscode-tab-activeForeground: #333333;--vscode-tab-inactiveForeground: rgba(51, 51, 51, .7);--vscode-tab-unfocusedActiveForeground: rgba(51, 51, 51, .7);--vscode-tab-unfocusedInactiveForeground: rgba(51, 51, 51, .35);--vscode-tab-border: #f3f3f3;--vscode-tab-lastPinnedBorder: rgba(97, 97, 97, .19);--vscode-tab-activeModifiedBorder: #33aaee;--vscode-tab-inactiveModifiedBorder: rgba(51, 170, 238, .5);--vscode-tab-unfocusedActiveModifiedBorder: rgba(51, 170, 238, .7);--vscode-tab-unfocusedInactiveModifiedBorder: rgba(51, 170, 238, .25);--vscode-editorPane-background: #ffffff;--vscode-editorGroupHeader-tabsBackground: #f3f3f3;--vscode-editorGroupHeader-noTabsBackground: #ffffff;--vscode-editorGroup-border: #e7e7e7;--vscode-editorGroup-dropBackground: rgba(38, 119, 203, .18);--vscode-editorGroup-dropIntoPromptForeground: #616161;--vscode-editorGroup-dropIntoPromptBackground: #f3f3f3;--vscode-sideBySideEditor-horizontalBorder: #e7e7e7;--vscode-sideBySideEditor-verticalBorder: #e7e7e7;--vscode-panel-background: #ffffff;--vscode-panel-border: rgba(128, 128, 128, .35);--vscode-panelTitle-activeForeground: #424242;--vscode-panelTitle-inactiveForeground: rgba(66, 66, 66, .75);--vscode-panelTitle-activeBorder: #424242;--vscode-panelInput-border: #dddddd;--vscode-panel-dropBorder: #424242;--vscode-panelSection-dropBackground: rgba(38, 119, 203, .18);--vscode-panelSectionHeader-background: rgba(128, 128, 128, .2);--vscode-panelSection-border: rgba(128, 128, 128, .35);--vscode-banner-background: #004386;--vscode-banner-foreground: #ffffff;--vscode-banner-iconForeground: #1a85ff;--vscode-statusBar-foreground: #ffffff;--vscode-statusBar-noFolderForeground: #ffffff;--vscode-statusBar-background: #007acc;--vscode-statusBar-noFolderBackground: #68217a;--vscode-statusBar-focusBorder: #ffffff;--vscode-statusBarItem-activeBackground: rgba(255, 255, 255, .18);--vscode-statusBarItem-focusBorder: #ffffff;--vscode-statusBarItem-hoverBackground: rgba(255, 255, 255, .12);--vscode-statusBarItem-compactHoverBackground: rgba(255, 255, 255, .2);--vscode-statusBarItem-prominentForeground: #ffffff;--vscode-statusBarItem-prominentBackground: rgba(0, 0, 0, .5);--vscode-statusBarItem-prominentHoverBackground: rgba(0, 0, 0, .3);--vscode-statusBarItem-errorBackground: #c72e0f;--vscode-statusBarItem-errorForeground: #ffffff;--vscode-statusBarItem-warningBackground: #725102;--vscode-statusBarItem-warningForeground: #ffffff;--vscode-activityBar-background: #2c2c2c;--vscode-activityBar-foreground: #ffffff;--vscode-activityBar-inactiveForeground: rgba(255, 255, 255, .4);--vscode-activityBar-activeBorder: #ffffff;--vscode-activityBar-dropBorder: #ffffff;--vscode-activityBarBadge-background: #007acc;--vscode-activityBarBadge-foreground: #ffffff;--vscode-statusBarItem-remoteBackground: #16825d;--vscode-statusBarItem-remoteForeground: #ffffff;--vscode-extensionBadge-remoteBackground: #007acc;--vscode-extensionBadge-remoteForeground: #ffffff;--vscode-sideBar-background: #f3f3f3;--vscode-sideBarTitle-foreground: #6f6f6f;--vscode-sideBar-dropBackground: rgba(38, 119, 203, .18);--vscode-sideBarSectionHeader-background: rgba(0, 0, 0, 0);--vscode-sideBarSectionHeader-border: rgba(97, 97, 97, .19);--vscode-titleBar-activeForeground: #333333;--vscode-titleBar-inactiveForeground: rgba(51, 51, 51, .6);--vscode-titleBar-activeBackground: #dddddd;--vscode-titleBar-inactiveBackground: rgba(221, 221, 221, .6);--vscode-menubar-selectionForeground: #333333;--vscode-menubar-selectionBackground: rgba(184, 184, 184, .31);--vscode-notifications-foreground: #616161;--vscode-notifications-background: #f3f3f3;--vscode-notificationLink-foreground: #006ab1;--vscode-notificationCenterHeader-background: #e7e7e7;--vscode-notifications-border: #e7e7e7;--vscode-notificationsErrorIcon-foreground: #e51400;--vscode-notificationsWarningIcon-foreground: #bf8803;--vscode-notificationsInfoIcon-foreground: #1a85ff;--vscode-commandCenter-foreground: #333333;--vscode-commandCenter-activeForeground: #333333;--vscode-commandCenter-activeBackground: rgba(184, 184, 184, .31);--vscode-commandCenter-border: rgba(128, 128, 128, .35);--vscode-editorCommentsWidget-resolvedBorder: rgba(97, 97, 97, .5);--vscode-editorCommentsWidget-unresolvedBorder: #1a85ff;--vscode-editorCommentsWidget-rangeBackground: rgba(26, 133, 255, .1);--vscode-editorCommentsWidget-rangeBorder: rgba(26, 133, 255, .4);--vscode-editorCommentsWidget-rangeActiveBackground: rgba(26, 133, 255, .1);--vscode-editorCommentsWidget-rangeActiveBorder: rgba(26, 133, 255, .4);--vscode-editorGutter-commentRangeForeground: #d5d8e9;--vscode-debugToolBar-background: #f3f3f3;--vscode-debugIcon-startForeground: #388a34;--vscode-editor-stackFrameHighlightBackground: rgba(255, 255, 102, .45);--vscode-editor-focusedStackFrameHighlightBackground: rgba(206, 231, 206, .45);--vscode-mergeEditor-change\.background: rgba(155, 185, 85, .2);--vscode-mergeEditor-change\.word\.background: rgba(156, 204, 44, .4);--vscode-mergeEditor-conflict\.unhandledUnfocused\.border: rgba(255, 166, 0, .48);--vscode-mergeEditor-conflict\.unhandledFocused\.border: #ffa600;--vscode-mergeEditor-conflict\.handledUnfocused\.border: rgba(134, 134, 134, .29);--vscode-mergeEditor-conflict\.handledFocused\.border: rgba(193, 193, 193, .8);--vscode-mergeEditor-conflict\.handled\.minimapOverViewRuler: rgba(173, 172, 168, .93);--vscode-mergeEditor-conflict\.unhandled\.minimapOverViewRuler: #fcba03;--vscode-mergeEditor-conflictingLines\.background: rgba(255, 234, 0, .28);--vscode-settings-headerForeground: #444444;--vscode-settings-modifiedItemIndicator: #66afe0;--vscode-settings-headerBorder: rgba(128, 128, 128, .35);--vscode-settings-sashBorder: rgba(128, 128, 128, .35);--vscode-settings-dropdownBackground: #ffffff;--vscode-settings-dropdownBorder: #cecece;--vscode-settings-dropdownListBorder: #c8c8c8;--vscode-settings-checkboxBackground: #ffffff;--vscode-settings-checkboxBorder: #cecece;--vscode-settings-textInputBackground: #ffffff;--vscode-settings-textInputForeground: #616161;--vscode-settings-textInputBorder: #cecece;--vscode-settings-numberInputBackground: #ffffff;--vscode-settings-numberInputForeground: #616161;--vscode-settings-numberInputBorder: #cecece;--vscode-settings-focusedRowBackground: rgba(232, 232, 232, .6);--vscode-settings-rowHoverBackground: rgba(232, 232, 232, .3);--vscode-settings-focusedRowBorder: rgba(0, 0, 0, .12);--vscode-terminal-foreground: #333333;--vscode-terminal-selectionBackground: #add6ff;--vscode-terminal-inactiveSelectionBackground: #e5ebf1;--vscode-terminalCommandDecoration-defaultBackground: rgba(0, 0, 0, .25);--vscode-terminalCommandDecoration-successBackground: #2090d3;--vscode-terminalCommandDecoration-errorBackground: #e51400;--vscode-terminalOverviewRuler-cursorForeground: rgba(160, 160, 160, .8);--vscode-terminal-border: rgba(128, 128, 128, .35);--vscode-terminal-findMatchBackground: #a8ac94;--vscode-terminal-findMatchHighlightBackground: rgba(234, 92, 0, .33);--vscode-terminalOverviewRuler-findMatchForeground: rgba(209, 134, 22, .49);--vscode-terminal-dropBackground: rgba(38, 119, 203, .18);--vscode-testing-iconFailed: #f14c4c;--vscode-testing-iconErrored: #f14c4c;--vscode-testing-iconPassed: #73c991;--vscode-testing-runAction: #73c991;--vscode-testing-iconQueued: #cca700;--vscode-testing-iconUnset: #848484;--vscode-testing-iconSkipped: #848484;--vscode-testing-peekBorder: #e51400;--vscode-testing-peekHeaderBackground: rgba(229, 20, 0, .1);--vscode-testing-message\.error\.decorationForeground: #e51400;--vscode-testing-message\.error\.lineBackground: rgba(255, 0, 0, .2);--vscode-testing-message\.info\.decorationForeground: rgba(0, 0, 0, .5);--vscode-welcomePage-tileBackground: #f3f3f3;--vscode-welcomePage-tileHoverBackground: #dbdbdb;--vscode-welcomePage-tileShadow: rgba(0, 0, 0, .16);--vscode-welcomePage-progress\.background: #ffffff;--vscode-welcomePage-progress\.foreground: #006ab1;--vscode-debugExceptionWidget-border: #a31515;--vscode-debugExceptionWidget-background: #f1dfde;--vscode-ports-iconRunningProcessForeground: #369432;--vscode-statusBar-debuggingBackground: #cc6633;--vscode-statusBar-debuggingForeground: #ffffff;--vscode-editor-inlineValuesForeground: rgba(0, 0, 0, .5);--vscode-editor-inlineValuesBackground: rgba(255, 200, 0, .2);--vscode-editorGutter-modifiedBackground: #2090d3;--vscode-editorGutter-addedBackground: #48985d;--vscode-editorGutter-deletedBackground: #e51400;--vscode-minimapGutter-modifiedBackground: #2090d3;--vscode-minimapGutter-addedBackground: #48985d;--vscode-minimapGutter-deletedBackground: #e51400;--vscode-editorOverviewRuler-modifiedForeground: rgba(32, 144, 211, .6);--vscode-editorOverviewRuler-addedForeground: rgba(72, 152, 93, .6);--vscode-editorOverviewRuler-deletedForeground: rgba(229, 20, 0, .6);--vscode-debugIcon-breakpointForeground: #e51400;--vscode-debugIcon-breakpointDisabledForeground: #848484;--vscode-debugIcon-breakpointUnverifiedForeground: #848484;--vscode-debugIcon-breakpointCurrentStackframeForeground: #be8700;--vscode-debugIcon-breakpointStackframeForeground: #89d185;--vscode-notebook-cellBorderColor: #e8e8e8;--vscode-notebook-focusedEditorBorder: #0090f1;--vscode-notebookStatusSuccessIcon-foreground: #388a34;--vscode-notebookStatusErrorIcon-foreground: #a1260d;--vscode-notebookStatusRunningIcon-foreground: #616161;--vscode-notebook-cellToolbarSeparator: rgba(128, 128, 128, .35);--vscode-notebook-selectedCellBackground: rgba(200, 221, 241, .31);--vscode-notebook-selectedCellBorder: #e8e8e8;--vscode-notebook-focusedCellBorder: #0090f1;--vscode-notebook-inactiveFocusedCellBorder: #e8e8e8;--vscode-notebook-cellStatusBarItemHoverBackground: rgba(0, 0, 0, .08);--vscode-notebook-cellInsertionIndicator: #0090f1;--vscode-notebookScrollbarSlider-background: rgba(100, 100, 100, .4);--vscode-notebookScrollbarSlider-hoverBackground: rgba(100, 100, 100, .7);--vscode-notebookScrollbarSlider-activeBackground: rgba(0, 0, 0, .6);--vscode-notebook-symbolHighlightBackground: rgba(253, 255, 0, .2);--vscode-notebook-cellEditorBackground: #f3f3f3;--vscode-notebook-editorBackground: #ffffff;--vscode-keybindingTable-headerBackground: rgba(97, 97, 97, .04);--vscode-keybindingTable-rowsBackground: rgba(97, 97, 97, .04);--vscode-scm-providerBorder: #c8c8c8;--vscode-searchEditor-textInputBorder: #cecece;--vscode-debugTokenExpression-name: #9b46b0;--vscode-debugTokenExpression-value: rgba(108, 108, 108, .8);--vscode-debugTokenExpression-string: #a31515;--vscode-debugTokenExpression-boolean: #0000ff;--vscode-debugTokenExpression-number: #098658;--vscode-debugTokenExpression-error: #e51400;--vscode-debugView-exceptionLabelForeground: #ffffff;--vscode-debugView-exceptionLabelBackground: #a31515;--vscode-debugView-stateLabelForeground: #616161;--vscode-debugView-stateLabelBackground: rgba(136, 136, 136, .27);--vscode-debugView-valueChangedHighlight: #569cd6;--vscode-debugConsole-infoForeground: #1a85ff;--vscode-debugConsole-warningForeground: #bf8803;--vscode-debugConsole-errorForeground: #a1260d;--vscode-debugConsole-sourceForeground: #616161;--vscode-debugConsoleInputIcon-foreground: #616161;--vscode-debugIcon-pauseForeground: #007acc;--vscode-debugIcon-stopForeground: #a1260d;--vscode-debugIcon-disconnectForeground: #a1260d;--vscode-debugIcon-restartForeground: #388a34;--vscode-debugIcon-stepOverForeground: #007acc;--vscode-debugIcon-stepIntoForeground: #007acc;--vscode-debugIcon-stepOutForeground: #007acc;--vscode-debugIcon-continueForeground: #007acc;--vscode-debugIcon-stepBackForeground: #007acc;--vscode-extensionButton-prominentBackground: #007acc;--vscode-extensionButton-prominentForeground: #ffffff;--vscode-extensionButton-prominentHoverBackground: #0062a3;--vscode-extensionIcon-starForeground: #df6100;--vscode-extensionIcon-verifiedForeground: #006ab1;--vscode-extensionIcon-preReleaseForeground: #1d9271;--vscode-extensionIcon-sponsorForeground: #b51e78;--vscode-terminal-ansiBlack: #000000;--vscode-terminal-ansiRed: #cd3131;--vscode-terminal-ansiGreen: #00bc00;--vscode-terminal-ansiYellow: #949800;--vscode-terminal-ansiBlue: #0451a5;--vscode-terminal-ansiMagenta: #bc05bc;--vscode-terminal-ansiCyan: #0598bc;--vscode-terminal-ansiWhite: #555555;--vscode-terminal-ansiBrightBlack: #666666;--vscode-terminal-ansiBrightRed: #cd3131;--vscode-terminal-ansiBrightGreen: #14ce14;--vscode-terminal-ansiBrightYellow: #b5ba00;--vscode-terminal-ansiBrightBlue: #0451a5;--vscode-terminal-ansiBrightMagenta: #bc05bc;--vscode-terminal-ansiBrightCyan: #0598bc;--vscode-terminal-ansiBrightWhite: #a5a5a5;--vscode-interactive-activeCodeBorder: #1a85ff;--vscode-interactive-inactiveCodeBorder: #e4e6f1;--vscode-gitDecoration-addedResourceForeground: #587c0c;--vscode-gitDecoration-modifiedResourceForeground: #895503;--vscode-gitDecoration-deletedResourceForeground: #ad0707;--vscode-gitDecoration-renamedResourceForeground: #007100;--vscode-gitDecoration-untrackedResourceForeground: #007100;--vscode-gitDecoration-ignoredResourceForeground: #8e8e90;--vscode-gitDecoration-stageModifiedResourceForeground: #895503;--vscode-gitDecoration-stageDeletedResourceForeground: #ad0707;--vscode-gitDecoration-conflictingResourceForeground: #ad0707;--vscode-gitDecoration-submoduleResourceForeground: #1258a7}:root.light-mode{color-scheme:light}:root.dark-mode{color-scheme:dark;--vscode-font-family: system-ui, "Ubuntu", "Droid Sans", sans-serif;--vscode-font-weight: normal;--vscode-font-size: 13px;--vscode-editor-font-family: "Droid Sans Mono", "monospace", monospace;--vscode-editor-font-weight: normal;--vscode-editor-font-size: 14px;--vscode-foreground: #cccccc;--vscode-disabledForeground: rgba(204, 204, 204, .5);--vscode-errorForeground: #f48771;--vscode-descriptionForeground: rgba(204, 204, 204, .7);--vscode-icon-foreground: #c5c5c5;--vscode-focusBorder: #007fd4;--vscode-textSeparator-foreground: rgba(255, 255, 255, .18);--vscode-textLink-foreground: #3794ff;--vscode-textLink-activeForeground: #3794ff;--vscode-textPreformat-foreground: #d7ba7d;--vscode-textBlockQuote-background: rgba(127, 127, 127, .1);--vscode-textBlockQuote-border: rgba(0, 122, 204, .5);--vscode-textCodeBlock-background: rgba(10, 10, 10, .4);--vscode-widget-shadow: rgba(0, 0, 0, .36);--vscode-input-background: #3c3c3c;--vscode-input-foreground: #cccccc;--vscode-inputOption-activeBorder: #007acc;--vscode-inputOption-hoverBackground: rgba(90, 93, 94, .5);--vscode-inputOption-activeBackground: rgba(0, 127, 212, .4);--vscode-inputOption-activeForeground: #ffffff;--vscode-input-placeholderForeground: #a6a6a6;--vscode-inputValidation-infoBackground: #063b49;--vscode-inputValidation-infoBorder: #007acc;--vscode-inputValidation-warningBackground: #352a05;--vscode-inputValidation-warningBorder: #b89500;--vscode-inputValidation-errorBackground: #5a1d1d;--vscode-inputValidation-errorBorder: #be1100;--vscode-dropdown-background: #3c3c3c;--vscode-dropdown-foreground: #f0f0f0;--vscode-dropdown-border: #3c3c3c;--vscode-checkbox-background: #3c3c3c;--vscode-checkbox-foreground: #f0f0f0;--vscode-checkbox-border: #3c3c3c;--vscode-button-foreground: #ffffff;--vscode-button-separator: rgba(255, 255, 255, .4);--vscode-button-background: #0e639c;--vscode-button-hoverBackground: #1177bb;--vscode-button-secondaryForeground: #ffffff;--vscode-button-secondaryBackground: #3a3d41;--vscode-button-secondaryHoverBackground: #45494e;--vscode-badge-background: #4d4d4d;--vscode-badge-foreground: #ffffff;--vscode-scrollbar-shadow: #000000;--vscode-scrollbarSlider-background: rgba(121, 121, 121, .4);--vscode-scrollbarSlider-hoverBackground: rgba(100, 100, 100, .7);--vscode-scrollbarSlider-activeBackground: rgba(191, 191, 191, .4);--vscode-progressBar-background: #0e70c0;--vscode-editorError-foreground: #f14c4c;--vscode-editorWarning-foreground: #cca700;--vscode-editorInfo-foreground: #3794ff;--vscode-editorHint-foreground: rgba(238, 238, 238, .7);--vscode-sash-hoverBorder: #007fd4;--vscode-editor-background: #1e1e1e;--vscode-editor-foreground: #d4d4d4;--vscode-editorStickyScroll-background: #1e1e1e;--vscode-editorStickyScrollHover-background: #2a2d2e;--vscode-editorWidget-background: #252526;--vscode-editorWidget-foreground: #cccccc;--vscode-editorWidget-border: #454545;--vscode-quickInput-background: #252526;--vscode-quickInput-foreground: #cccccc;--vscode-quickInputTitle-background: rgba(255, 255, 255, .1);--vscode-pickerGroup-foreground: #3794ff;--vscode-pickerGroup-border: #3f3f46;--vscode-keybindingLabel-background: rgba(128, 128, 128, .17);--vscode-keybindingLabel-foreground: #cccccc;--vscode-keybindingLabel-border: rgba(51, 51, 51, .6);--vscode-keybindingLabel-bottomBorder: rgba(68, 68, 68, .6);--vscode-editor-selectionBackground: #264f78;--vscode-editor-inactiveSelectionBackground: #3a3d41;--vscode-editor-selectionHighlightBackground: rgba(173, 214, 255, .15);--vscode-editor-findMatchBackground: #515c6a;--vscode-editor-findMatchHighlightBackground: rgba(234, 92, 0, .33);--vscode-editor-findRangeHighlightBackground: rgba(58, 61, 65, .4);--vscode-searchEditor-findMatchBackground: rgba(234, 92, 0, .22);--vscode-editor-hoverHighlightBackground: rgba(38, 79, 120, .25);--vscode-editorHoverWidget-background: #252526;--vscode-editorHoverWidget-foreground: #cccccc;--vscode-editorHoverWidget-border: #454545;--vscode-editorHoverWidget-statusBarBackground: #2c2c2d;--vscode-editorLink-activeForeground: #4e94ce;--vscode-editorInlayHint-foreground: rgba(255, 255, 255, .8);--vscode-editorInlayHint-background: rgba(77, 77, 77, .6);--vscode-editorInlayHint-typeForeground: rgba(255, 255, 255, .8);--vscode-editorInlayHint-typeBackground: rgba(77, 77, 77, .6);--vscode-editorInlayHint-parameterForeground: rgba(255, 255, 255, .8);--vscode-editorInlayHint-parameterBackground: rgba(77, 77, 77, .6);--vscode-editorLightBulb-foreground: #ffcc00;--vscode-editorLightBulbAutoFix-foreground: #75beff;--vscode-diffEditor-insertedTextBackground: rgba(156, 204, 44, .2);--vscode-diffEditor-removedTextBackground: rgba(255, 0, 0, .4);--vscode-diffEditor-insertedLineBackground: rgba(155, 185, 85, .2);--vscode-diffEditor-removedLineBackground: rgba(255, 0, 0, .2);--vscode-diffEditor-diagonalFill: rgba(204, 204, 204, .2);--vscode-list-focusOutline: #007fd4;--vscode-list-activeSelectionBackground: #04395e;--vscode-list-activeSelectionForeground: #ffffff;--vscode-list-activeSelectionIconForeground: #ffffff;--vscode-list-inactiveSelectionBackground: #37373d;--vscode-list-hoverBackground: #2a2d2e;--vscode-list-dropBackground: #383b3d;--vscode-list-highlightForeground: #2aaaff;--vscode-list-focusHighlightForeground: #2aaaff;--vscode-list-invalidItemForeground: #b89500;--vscode-list-errorForeground: #f88070;--vscode-list-warningForeground: #cca700;--vscode-listFilterWidget-background: #252526;--vscode-listFilterWidget-outline: rgba(0, 0, 0, 0);--vscode-listFilterWidget-noMatchesOutline: #be1100;--vscode-listFilterWidget-shadow: rgba(0, 0, 0, .36);--vscode-list-filterMatchBackground: rgba(234, 92, 0, .33);--vscode-tree-indentGuidesStroke: #585858;--vscode-tree-tableColumnsBorder: rgba(204, 204, 204, .13);--vscode-tree-tableOddRowsBackground: rgba(204, 204, 204, .04);--vscode-list-deemphasizedForeground: #8c8c8c;--vscode-quickInputList-focusForeground: #ffffff;--vscode-quickInputList-focusIconForeground: #ffffff;--vscode-quickInputList-focusBackground: #04395e;--vscode-menu-foreground: #cccccc;--vscode-menu-background: #303031;--vscode-menu-selectionForeground: #ffffff;--vscode-menu-selectionBackground: #04395e;--vscode-menu-separatorBackground: #606060;--vscode-toolbar-hoverBackground: rgba(90, 93, 94, .31);--vscode-toolbar-activeBackground: rgba(99, 102, 103, .31);--vscode-editor-snippetTabstopHighlightBackground: rgba(124, 124, 124, .3);--vscode-editor-snippetFinalTabstopHighlightBorder: #525252;--vscode-breadcrumb-foreground: rgba(204, 204, 204, .8);--vscode-breadcrumb-background: #1e1e1e;--vscode-breadcrumb-focusForeground: #e0e0e0;--vscode-breadcrumb-activeSelectionForeground: #e0e0e0;--vscode-breadcrumbPicker-background: #252526;--vscode-merge-currentHeaderBackground: rgba(64, 200, 174, .5);--vscode-merge-currentContentBackground: rgba(64, 200, 174, .2);--vscode-merge-incomingHeaderBackground: rgba(64, 166, 255, .5);--vscode-merge-incomingContentBackground: rgba(64, 166, 255, .2);--vscode-merge-commonHeaderBackground: rgba(96, 96, 96, .4);--vscode-merge-commonContentBackground: rgba(96, 96, 96, .16);--vscode-editorOverviewRuler-currentContentForeground: rgba(64, 200, 174, .5);--vscode-editorOverviewRuler-incomingContentForeground: rgba(64, 166, 255, .5);--vscode-editorOverviewRuler-commonContentForeground: rgba(96, 96, 96, .4);--vscode-editorOverviewRuler-findMatchForeground: rgba(209, 134, 22, .49);--vscode-editorOverviewRuler-selectionHighlightForeground: rgba(160, 160, 160, .8);--vscode-minimap-findMatchHighlight: #d18616;--vscode-minimap-selectionOccurrenceHighlight: #676767;--vscode-minimap-selectionHighlight: #264f78;--vscode-minimap-errorHighlight: rgba(255, 18, 18, .7);--vscode-minimap-warningHighlight: #cca700;--vscode-minimap-foregroundOpacity: #000000;--vscode-minimapSlider-background: rgba(121, 121, 121, .2);--vscode-minimapSlider-hoverBackground: rgba(100, 100, 100, .35);--vscode-minimapSlider-activeBackground: rgba(191, 191, 191, .2);--vscode-problemsErrorIcon-foreground: #f14c4c;--vscode-problemsWarningIcon-foreground: #cca700;--vscode-problemsInfoIcon-foreground: #3794ff;--vscode-charts-foreground: #cccccc;--vscode-charts-lines: rgba(204, 204, 204, .5);--vscode-charts-red: #f14c4c;--vscode-charts-blue: #3794ff;--vscode-charts-yellow: #cca700;--vscode-charts-orange: #d18616;--vscode-charts-green: #89d185;--vscode-charts-purple: #b180d7;--vscode-editor-lineHighlightBorder: #282828;--vscode-editor-rangeHighlightBackground: rgba(255, 255, 255, .04);--vscode-editor-symbolHighlightBackground: rgba(234, 92, 0, .33);--vscode-editorCursor-foreground: #aeafad;--vscode-editorWhitespace-foreground: rgba(227, 228, 226, .16);--vscode-editorIndentGuide-background: #404040;--vscode-editorIndentGuide-activeBackground: #707070;--vscode-editorLineNumber-foreground: #858585;--vscode-editorActiveLineNumber-foreground: #c6c6c6;--vscode-editorLineNumber-activeForeground: #c6c6c6;--vscode-editorRuler-foreground: #5a5a5a;--vscode-editorCodeLens-foreground: #999999;--vscode-editorBracketMatch-background: rgba(0, 100, 0, .1);--vscode-editorBracketMatch-border: #888888;--vscode-editorOverviewRuler-border: rgba(127, 127, 127, .3);--vscode-editorGutter-background: #1e1e1e;--vscode-editorUnnecessaryCode-opacity: rgba(0, 0, 0, .67);--vscode-editorGhostText-foreground: rgba(255, 255, 255, .34);--vscode-editorOverviewRuler-rangeHighlightForeground: rgba(0, 122, 204, .6);--vscode-editorOverviewRuler-errorForeground: rgba(255, 18, 18, .7);--vscode-editorOverviewRuler-warningForeground: #cca700;--vscode-editorOverviewRuler-infoForeground: #3794ff;--vscode-editorBracketHighlight-foreground1: #ffd700;--vscode-editorBracketHighlight-foreground2: #da70d6;--vscode-editorBracketHighlight-foreground3: #179fff;--vscode-editorBracketHighlight-foreground4: rgba(0, 0, 0, 0);--vscode-editorBracketHighlight-foreground5: rgba(0, 0, 0, 0);--vscode-editorBracketHighlight-foreground6: rgba(0, 0, 0, 0);--vscode-editorBracketHighlight-unexpectedBracket\.foreground: rgba(255, 18, 18, .8);--vscode-editorBracketPairGuide-background1: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-background2: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-background3: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-background4: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-background5: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-background6: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-activeBackground1: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-activeBackground2: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-activeBackground3: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-activeBackground4: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-activeBackground5: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-activeBackground6: rgba(0, 0, 0, 0);--vscode-editorUnicodeHighlight-border: #bd9b03;--vscode-editorUnicodeHighlight-background: rgba(189, 155, 3, .15);--vscode-symbolIcon-arrayForeground: #cccccc;--vscode-symbolIcon-booleanForeground: #cccccc;--vscode-symbolIcon-classForeground: #ee9d28;--vscode-symbolIcon-colorForeground: #cccccc;--vscode-symbolIcon-constantForeground: #cccccc;--vscode-symbolIcon-constructorForeground: #b180d7;--vscode-symbolIcon-enumeratorForeground: #ee9d28;--vscode-symbolIcon-enumeratorMemberForeground: #75beff;--vscode-symbolIcon-eventForeground: #ee9d28;--vscode-symbolIcon-fieldForeground: #75beff;--vscode-symbolIcon-fileForeground: #cccccc;--vscode-symbolIcon-folderForeground: #cccccc;--vscode-symbolIcon-functionForeground: #b180d7;--vscode-symbolIcon-interfaceForeground: #75beff;--vscode-symbolIcon-keyForeground: #cccccc;--vscode-symbolIcon-keywordForeground: #cccccc;--vscode-symbolIcon-methodForeground: #b180d7;--vscode-symbolIcon-moduleForeground: #cccccc;--vscode-symbolIcon-namespaceForeground: #cccccc;--vscode-symbolIcon-nullForeground: #cccccc;--vscode-symbolIcon-numberForeground: #cccccc;--vscode-symbolIcon-objectForeground: #cccccc;--vscode-symbolIcon-operatorForeground: #cccccc;--vscode-symbolIcon-packageForeground: #cccccc;--vscode-symbolIcon-propertyForeground: #cccccc;--vscode-symbolIcon-referenceForeground: #cccccc;--vscode-symbolIcon-snippetForeground: #cccccc;--vscode-symbolIcon-stringForeground: #cccccc;--vscode-symbolIcon-structForeground: #cccccc;--vscode-symbolIcon-textForeground: #cccccc;--vscode-symbolIcon-typeParameterForeground: #cccccc;--vscode-symbolIcon-unitForeground: #cccccc;--vscode-symbolIcon-variableForeground: #75beff;--vscode-editorHoverWidget-highlightForeground: #2aaaff;--vscode-editorOverviewRuler-bracketMatchForeground: #a0a0a0;--vscode-editor-foldBackground: rgba(38, 79, 120, .3);--vscode-editorGutter-foldingControlForeground: #c5c5c5;--vscode-editor-linkedEditingBackground: rgba(255, 0, 0, .3);--vscode-editor-wordHighlightBackground: rgba(87, 87, 87, .72);--vscode-editor-wordHighlightStrongBackground: rgba(0, 73, 114, .72);--vscode-editorOverviewRuler-wordHighlightForeground: rgba(160, 160, 160, .8);--vscode-editorOverviewRuler-wordHighlightStrongForeground: rgba(192, 160, 192, .8);--vscode-peekViewTitle-background: rgba(55, 148, 255, .1);--vscode-peekViewTitleLabel-foreground: #ffffff;--vscode-peekViewTitleDescription-foreground: rgba(204, 204, 204, .7);--vscode-peekView-border: #3794ff;--vscode-peekViewResult-background: #252526;--vscode-peekViewResult-lineForeground: #bbbbbb;--vscode-peekViewResult-fileForeground: #ffffff;--vscode-peekViewResult-selectionBackground: rgba(51, 153, 255, .2);--vscode-peekViewResult-selectionForeground: #ffffff;--vscode-peekViewEditor-background: #001f33;--vscode-peekViewEditorGutter-background: #001f33;--vscode-peekViewResult-matchHighlightBackground: rgba(234, 92, 0, .3);--vscode-peekViewEditor-matchHighlightBackground: rgba(255, 143, 0, .6);--vscode-editorMarkerNavigationError-background: #f14c4c;--vscode-editorMarkerNavigationError-headerBackground: rgba(241, 76, 76, .1);--vscode-editorMarkerNavigationWarning-background: #cca700;--vscode-editorMarkerNavigationWarning-headerBackground: rgba(204, 167, 0, .1);--vscode-editorMarkerNavigationInfo-background: #3794ff;--vscode-editorMarkerNavigationInfo-headerBackground: rgba(55, 148, 255, .1);--vscode-editorMarkerNavigation-background: #1e1e1e;--vscode-editorSuggestWidget-background: #252526;--vscode-editorSuggestWidget-border: #454545;--vscode-editorSuggestWidget-foreground: #d4d4d4;--vscode-editorSuggestWidget-selectedForeground: #ffffff;--vscode-editorSuggestWidget-selectedIconForeground: #ffffff;--vscode-editorSuggestWidget-selectedBackground: #04395e;--vscode-editorSuggestWidget-highlightForeground: #2aaaff;--vscode-editorSuggestWidget-focusHighlightForeground: #2aaaff;--vscode-editorSuggestWidgetStatus-foreground: rgba(212, 212, 212, .5);--vscode-tab-activeBackground: #1e1e1e;--vscode-tab-unfocusedActiveBackground: #1e1e1e;--vscode-tab-inactiveBackground: #2d2d2d;--vscode-tab-unfocusedInactiveBackground: #2d2d2d;--vscode-tab-activeForeground: #ffffff;--vscode-tab-inactiveForeground: rgba(255, 255, 255, .5);--vscode-tab-unfocusedActiveForeground: rgba(255, 255, 255, .5);--vscode-tab-unfocusedInactiveForeground: rgba(255, 255, 255, .25);--vscode-tab-border: #252526;--vscode-tab-lastPinnedBorder: rgba(204, 204, 204, .2);--vscode-tab-activeModifiedBorder: #3399cc;--vscode-tab-inactiveModifiedBorder: rgba(51, 153, 204, .5);--vscode-tab-unfocusedActiveModifiedBorder: rgba(51, 153, 204, .5);--vscode-tab-unfocusedInactiveModifiedBorder: rgba(51, 153, 204, .25);--vscode-editorPane-background: #1e1e1e;--vscode-editorGroupHeader-tabsBackground: #252526;--vscode-editorGroupHeader-noTabsBackground: #1e1e1e;--vscode-editorGroup-border: #444444;--vscode-editorGroup-dropBackground: rgba(83, 89, 93, .5);--vscode-editorGroup-dropIntoPromptForeground: #cccccc;--vscode-editorGroup-dropIntoPromptBackground: #252526;--vscode-sideBySideEditor-horizontalBorder: #444444;--vscode-sideBySideEditor-verticalBorder: #444444;--vscode-panel-background: #1e1e1e;--vscode-panel-border: rgba(128, 128, 128, .35);--vscode-panelTitle-activeForeground: #e7e7e7;--vscode-panelTitle-inactiveForeground: rgba(231, 231, 231, .6);--vscode-panelTitle-activeBorder: #e7e7e7;--vscode-panel-dropBorder: #e7e7e7;--vscode-panelSection-dropBackground: rgba(83, 89, 93, .5);--vscode-panelSectionHeader-background: rgba(128, 128, 128, .2);--vscode-panelSection-border: rgba(128, 128, 128, .35);--vscode-banner-background: #04395e;--vscode-banner-foreground: #ffffff;--vscode-banner-iconForeground: #3794ff;--vscode-statusBar-foreground: #ffffff;--vscode-statusBar-noFolderForeground: #ffffff;--vscode-statusBar-background: #007acc;--vscode-statusBar-noFolderBackground: #68217a;--vscode-statusBar-focusBorder: #ffffff;--vscode-statusBarItem-activeBackground: rgba(255, 255, 255, .18);--vscode-statusBarItem-focusBorder: #ffffff;--vscode-statusBarItem-hoverBackground: rgba(255, 255, 255, .12);--vscode-statusBarItem-compactHoverBackground: rgba(255, 255, 255, .2);--vscode-statusBarItem-prominentForeground: #ffffff;--vscode-statusBarItem-prominentBackground: rgba(0, 0, 0, .5);--vscode-statusBarItem-prominentHoverBackground: rgba(0, 0, 0, .3);--vscode-statusBarItem-errorBackground: #c72e0f;--vscode-statusBarItem-errorForeground: #ffffff;--vscode-statusBarItem-warningBackground: #7a6400;--vscode-statusBarItem-warningForeground: #ffffff;--vscode-activityBar-background: #333333;--vscode-activityBar-foreground: #ffffff;--vscode-activityBar-inactiveForeground: rgba(255, 255, 255, .4);--vscode-activityBar-activeBorder: #ffffff;--vscode-activityBar-dropBorder: #ffffff;--vscode-activityBarBadge-background: #007acc;--vscode-activityBarBadge-foreground: #ffffff;--vscode-statusBarItem-remoteBackground: #16825d;--vscode-statusBarItem-remoteForeground: #ffffff;--vscode-extensionBadge-remoteBackground: #007acc;--vscode-extensionBadge-remoteForeground: #ffffff;--vscode-sideBar-background: #252526;--vscode-sideBarTitle-foreground: #bbbbbb;--vscode-sideBar-dropBackground: rgba(83, 89, 93, .5);--vscode-sideBarSectionHeader-background: rgba(0, 0, 0, 0);--vscode-sideBarSectionHeader-border: rgba(204, 204, 204, .2);--vscode-titleBar-activeForeground: #cccccc;--vscode-titleBar-inactiveForeground: rgba(204, 204, 204, .6);--vscode-titleBar-activeBackground: #3c3c3c;--vscode-titleBar-inactiveBackground: rgba(60, 60, 60, .6);--vscode-menubar-selectionForeground: #cccccc;--vscode-menubar-selectionBackground: rgba(90, 93, 94, .31);--vscode-notifications-foreground: #cccccc;--vscode-notifications-background: #252526;--vscode-notificationLink-foreground: #3794ff;--vscode-notificationCenterHeader-background: #303031;--vscode-notifications-border: #303031;--vscode-notificationsErrorIcon-foreground: #f14c4c;--vscode-notificationsWarningIcon-foreground: #cca700;--vscode-notificationsInfoIcon-foreground: #3794ff;--vscode-commandCenter-foreground: #cccccc;--vscode-commandCenter-activeForeground: #cccccc;--vscode-commandCenter-activeBackground: rgba(90, 93, 94, .31);--vscode-commandCenter-border: rgba(128, 128, 128, .35);--vscode-editorCommentsWidget-resolvedBorder: rgba(204, 204, 204, .5);--vscode-editorCommentsWidget-unresolvedBorder: #3794ff;--vscode-editorCommentsWidget-rangeBackground: rgba(55, 148, 255, .1);--vscode-editorCommentsWidget-rangeBorder: rgba(55, 148, 255, .4);--vscode-editorCommentsWidget-rangeActiveBackground: rgba(55, 148, 255, .1);--vscode-editorCommentsWidget-rangeActiveBorder: rgba(55, 148, 255, .4);--vscode-editorGutter-commentRangeForeground: #37373d;--vscode-debugToolBar-background: #333333;--vscode-debugIcon-startForeground: #89d185;--vscode-editor-stackFrameHighlightBackground: rgba(255, 255, 0, .2);--vscode-editor-focusedStackFrameHighlightBackground: rgba(122, 189, 122, .3);--vscode-mergeEditor-change\.background: rgba(155, 185, 85, .2);--vscode-mergeEditor-change\.word\.background: rgba(156, 204, 44, .2);--vscode-mergeEditor-conflict\.unhandledUnfocused\.border: rgba(255, 166, 0, .48);--vscode-mergeEditor-conflict\.unhandledFocused\.border: #ffa600;--vscode-mergeEditor-conflict\.handledUnfocused\.border: rgba(134, 134, 134, .29);--vscode-mergeEditor-conflict\.handledFocused\.border: rgba(193, 193, 193, .8);--vscode-mergeEditor-conflict\.handled\.minimapOverViewRuler: rgba(173, 172, 168, .93);--vscode-mergeEditor-conflict\.unhandled\.minimapOverViewRuler: #fcba03;--vscode-mergeEditor-conflictingLines\.background: rgba(255, 234, 0, .28);--vscode-settings-headerForeground: #e7e7e7;--vscode-settings-modifiedItemIndicator: #0c7d9d;--vscode-settings-headerBorder: rgba(128, 128, 128, .35);--vscode-settings-sashBorder: rgba(128, 128, 128, .35);--vscode-settings-dropdownBackground: #3c3c3c;--vscode-settings-dropdownForeground: #f0f0f0;--vscode-settings-dropdownBorder: #3c3c3c;--vscode-settings-dropdownListBorder: #454545;--vscode-settings-checkboxBackground: #3c3c3c;--vscode-settings-checkboxForeground: #f0f0f0;--vscode-settings-checkboxBorder: #3c3c3c;--vscode-settings-textInputBackground: #3c3c3c;--vscode-settings-textInputForeground: #cccccc;--vscode-settings-numberInputBackground: #3c3c3c;--vscode-settings-numberInputForeground: #cccccc;--vscode-settings-focusedRowBackground: rgba(42, 45, 46, .6);--vscode-settings-rowHoverBackground: rgba(42, 45, 46, .3);--vscode-settings-focusedRowBorder: rgba(255, 255, 255, .12);--vscode-terminal-foreground: #cccccc;--vscode-terminal-selectionBackground: #264f78;--vscode-terminal-inactiveSelectionBackground: #3a3d41;--vscode-terminalCommandDecoration-defaultBackground: rgba(255, 255, 255, .25);--vscode-terminalCommandDecoration-successBackground: #1b81a8;--vscode-terminalCommandDecoration-errorBackground: #f14c4c;--vscode-terminalOverviewRuler-cursorForeground: rgba(160, 160, 160, .8);--vscode-terminal-border: rgba(128, 128, 128, .35);--vscode-terminal-findMatchBackground: #515c6a;--vscode-terminal-findMatchHighlightBackground: rgba(234, 92, 0, .33);--vscode-terminalOverviewRuler-findMatchForeground: rgba(209, 134, 22, .49);--vscode-terminal-dropBackground: rgba(83, 89, 93, .5);--vscode-testing-iconFailed: #f14c4c;--vscode-testing-iconErrored: #f14c4c;--vscode-testing-iconPassed: #73c991;--vscode-testing-runAction: #73c991;--vscode-testing-iconQueued: #cca700;--vscode-testing-iconUnset: #848484;--vscode-testing-iconSkipped: #848484;--vscode-testing-peekBorder: #f14c4c;--vscode-testing-peekHeaderBackground: rgba(241, 76, 76, .1);--vscode-testing-message\.error\.decorationForeground: #f14c4c;--vscode-testing-message\.error\.lineBackground: rgba(255, 0, 0, .2);--vscode-testing-message\.info\.decorationForeground: rgba(212, 212, 212, .5);--vscode-welcomePage-tileBackground: #252526;--vscode-welcomePage-tileHoverBackground: #2c2c2d;--vscode-welcomePage-tileShadow: rgba(0, 0, 0, .36);--vscode-welcomePage-progress\.background: #3c3c3c;--vscode-welcomePage-progress\.foreground: #3794ff;--vscode-debugExceptionWidget-border: #a31515;--vscode-debugExceptionWidget-background: #420b0d;--vscode-ports-iconRunningProcessForeground: #369432;--vscode-statusBar-debuggingBackground: #cc6633;--vscode-statusBar-debuggingForeground: #ffffff;--vscode-editor-inlineValuesForeground: rgba(255, 255, 255, .5);--vscode-editor-inlineValuesBackground: rgba(255, 200, 0, .2);--vscode-editorGutter-modifiedBackground: #1b81a8;--vscode-editorGutter-addedBackground: #487e02;--vscode-editorGutter-deletedBackground: #f14c4c;--vscode-minimapGutter-modifiedBackground: #1b81a8;--vscode-minimapGutter-addedBackground: #487e02;--vscode-minimapGutter-deletedBackground: #f14c4c;--vscode-editorOverviewRuler-modifiedForeground: rgba(27, 129, 168, .6);--vscode-editorOverviewRuler-addedForeground: rgba(72, 126, 2, .6);--vscode-editorOverviewRuler-deletedForeground: rgba(241, 76, 76, .6);--vscode-debugIcon-breakpointForeground: #e51400;--vscode-debugIcon-breakpointDisabledForeground: #848484;--vscode-debugIcon-breakpointUnverifiedForeground: #848484;--vscode-debugIcon-breakpointCurrentStackframeForeground: #ffcc00;--vscode-debugIcon-breakpointStackframeForeground: #89d185;--vscode-notebook-cellBorderColor: #37373d;--vscode-notebook-focusedEditorBorder: #007fd4;--vscode-notebookStatusSuccessIcon-foreground: #89d185;--vscode-notebookStatusErrorIcon-foreground: #f48771;--vscode-notebookStatusRunningIcon-foreground: #cccccc;--vscode-notebook-cellToolbarSeparator: rgba(128, 128, 128, .35);--vscode-notebook-selectedCellBackground: #37373d;--vscode-notebook-selectedCellBorder: #37373d;--vscode-notebook-focusedCellBorder: #007fd4;--vscode-notebook-inactiveFocusedCellBorder: #37373d;--vscode-notebook-cellStatusBarItemHoverBackground: rgba(255, 255, 255, .15);--vscode-notebook-cellInsertionIndicator: #007fd4;--vscode-notebookScrollbarSlider-background: rgba(121, 121, 121, .4);--vscode-notebookScrollbarSlider-hoverBackground: rgba(100, 100, 100, .7);--vscode-notebookScrollbarSlider-activeBackground: rgba(191, 191, 191, .4);--vscode-notebook-symbolHighlightBackground: rgba(255, 255, 255, .04);--vscode-notebook-cellEditorBackground: #252526;--vscode-notebook-editorBackground: #1e1e1e;--vscode-keybindingTable-headerBackground: rgba(204, 204, 204, .04);--vscode-keybindingTable-rowsBackground: rgba(204, 204, 204, .04);--vscode-scm-providerBorder: #454545;--vscode-debugTokenExpression-name: #c586c0;--vscode-debugTokenExpression-value: rgba(204, 204, 204, .6);--vscode-debugTokenExpression-string: #ce9178;--vscode-debugTokenExpression-boolean: #4e94ce;--vscode-debugTokenExpression-number: #b5cea8;--vscode-debugTokenExpression-error: #f48771;--vscode-debugView-exceptionLabelForeground: #cccccc;--vscode-debugView-exceptionLabelBackground: #6c2022;--vscode-debugView-stateLabelForeground: #cccccc;--vscode-debugView-stateLabelBackground: rgba(136, 136, 136, .27);--vscode-debugView-valueChangedHighlight: #569cd6;--vscode-debugConsole-infoForeground: #3794ff;--vscode-debugConsole-warningForeground: #cca700;--vscode-debugConsole-errorForeground: #f48771;--vscode-debugConsole-sourceForeground: #cccccc;--vscode-debugConsoleInputIcon-foreground: #cccccc;--vscode-debugIcon-pauseForeground: #75beff;--vscode-debugIcon-stopForeground: #f48771;--vscode-debugIcon-disconnectForeground: #f48771;--vscode-debugIcon-restartForeground: #89d185;--vscode-debugIcon-stepOverForeground: #75beff;--vscode-debugIcon-stepIntoForeground: #75beff;--vscode-debugIcon-stepOutForeground: #75beff;--vscode-debugIcon-continueForeground: #75beff;--vscode-debugIcon-stepBackForeground: #75beff;--vscode-extensionButton-prominentBackground: #0e639c;--vscode-extensionButton-prominentForeground: #ffffff;--vscode-extensionButton-prominentHoverBackground: #1177bb;--vscode-extensionIcon-starForeground: #ff8e00;--vscode-extensionIcon-verifiedForeground: #3794ff;--vscode-extensionIcon-preReleaseForeground: #1d9271;--vscode-extensionIcon-sponsorForeground: #d758b3;--vscode-terminal-ansiBlack: #000000;--vscode-terminal-ansiRed: #cd3131;--vscode-terminal-ansiGreen: #0dbc79;--vscode-terminal-ansiYellow: #e5e510;--vscode-terminal-ansiBlue: #2472c8;--vscode-terminal-ansiMagenta: #bc3fbc;--vscode-terminal-ansiCyan: #11a8cd;--vscode-terminal-ansiWhite: #e5e5e5;--vscode-terminal-ansiBrightBlack: #666666;--vscode-terminal-ansiBrightRed: #f14c4c;--vscode-terminal-ansiBrightGreen: #23d18b;--vscode-terminal-ansiBrightYellow: #f5f543;--vscode-terminal-ansiBrightBlue: #3b8eea;--vscode-terminal-ansiBrightMagenta: #d670d6;--vscode-terminal-ansiBrightCyan: #29b8db;--vscode-terminal-ansiBrightWhite: #e5e5e5;--vscode-interactive-activeCodeBorder: #3794ff;--vscode-interactive-inactiveCodeBorder: #37373d;--vscode-gitDecoration-addedResourceForeground: #81b88b;--vscode-gitDecoration-modifiedResourceForeground: #e2c08d;--vscode-gitDecoration-deletedResourceForeground: #c74e39;--vscode-gitDecoration-renamedResourceForeground: #73c991;--vscode-gitDecoration-untrackedResourceForeground: #73c991;--vscode-gitDecoration-ignoredResourceForeground: #8c8c8c;--vscode-gitDecoration-stageModifiedResourceForeground: #e2c08d;--vscode-gitDecoration-stageDeletedResourceForeground: #c74e39;--vscode-gitDecoration-conflictingResourceForeground: #e4676b;--vscode-gitDecoration-submoduleResourceForeground: #8db9e2}.xterm-wrapper{padding-left:5px}.xterm-wrapper .xterm-viewport{background-color:var(--vscode-panel-background)!important;color:var(--vscode-foreground)!important}.filters{flex:none;display:flex;flex-direction:column;margin:2px 0}.filter-list{padding:0 10px 10px;-webkit-user-select:none;user-select:none}.filter-title,.filter-summary{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;-webkit-user-select:none;user-select:none;cursor:pointer}.filter-label{color:var(--vscode-disabledForeground)}.filter-summary{line-height:24px;margin-left:24px}.filter-summary .filter-label{margin-left:5px}.filter-entry{line-height:24px}.filter-entry label{display:flex;align-items:center;cursor:pointer}.filter-entry input{flex:none;display:flex;align-items:center;cursor:pointer}.filter-entry label div{overflow:hidden;text-overflow:ellipsis}.ui-mode-tree-item{flex:auto}.ui-mode-tree-item-title{flex:auto;text-overflow:ellipsis;overflow:hidden}.ui-mode-tree-item-time{flex:none;color:var(--vscode-editorCodeLens-foreground);margin:0 4px;-webkit-user-select:none;user-select:none}.tests-tree-view .tree-view-entry.selected .ui-mode-tree-item-time,.tests-tree-view .tree-view-entry.highlighted .ui-mode-tree-item-time{display:none}.tests-tree-view .tree-view-entry:not(.highlighted):not(.selected) .toolbar-button:not(.toggled){display:none}.tag{display:inline-block;padding:0 8px;font-size:12px;font-weight:500;line-height:18px;border:1px solid transparent;border-radius:2em;background-color:#8c959f;color:#fff;margin:0 10px;flex:none;font-weight:600}.tag-color-0{background-color:#ddf4ff;color:#0550ae;border:1px solid #218bff}.tag-color-1{background-color:#fff8c5;color:#7d4e00;border:1px solid #bf8700}.tag-color-2{background-color:#fbefff;color:#6e40c9;border:1px solid #a475f9}.tag-color-3{background-color:#ffeff7;color:#99286e;border:1px solid #e85aad}.tag-color-4{background-color:#fff0eb;color:#9e2f1c;border:1px solid #EA6045}.tag-color-5{background-color:#fff1e5;color:#9b4215;border:1px solid #e16f24}.dark-mode .tag-color-0{background-color:#051d4d;color:#80ccff;border:1px solid #218bff}.dark-mode .tag-color-1{background-color:#3b2300;color:#eac54f;border:1px solid #bf8700}.dark-mode .tag-color-2{background-color:#271052;color:#d2a8ff;border:1px solid #a475f9}.dark-mode .tag-color-3{background-color:#42062a;color:#ff9bce;border:1px solid #e85aad}.dark-mode .tag-color-4{background-color:#460701;color:#ffa28b;border:1px solid #EC6547}.dark-mode .tag-color-5{background-color:#471700;color:#ffa657;border:1px solid #e16f24}
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./assets/xtermModule-CsJ4vdCR.js","./xtermModule.DYP7pi_n.css"])))=>i.map(i=>d[i]);
import"./assets/urlMatch-BYQrIQwR.js";import{u as Ht,r as H,g as qt,_ as Yt,h as Qt,i as Xt,j as o,R as d,E as Jt,s as Rt,k as vt,l as Zt,t as Gt,m as te,n as Y,o as M,T as Bt,c as ee,p as q,a as se,W as ie,S as ne,q as oe,b as re,e as ae,f as le}from"./assets/defaultSettingsView-BNmKHKpQ.js";var ce={};class mt{constructor(t,e={}){this.isListing=!1,this._tests=new Map,this._rootSuite=new tt("","root"),this._options=e,this._reporter=t}reset(){this._rootSuite._entries=[],this._tests.clear()}dispatch(t){const{method:e,params:s}=t;if(e==="onConfigure"){this._onConfigure(s.config);return}if(e==="onProject"){this._onProject(s.project);return}if(e==="onBegin"){this._onBegin();return}if(e==="onTestBegin"){this._onTestBegin(s.testId,s.result);return}if(e==="onTestPaused"){this._onTestPaused(s.testId,s.resultId,s.errors);return}if(e==="onTestEnd"){this._onTestEnd(s.test,s.result);return}if(e==="onStepBegin"){this._onStepBegin(s.testId,s.resultId,s.step);return}if(e==="onAttach"){this._onAttach(s.testId,s.resultId,s.attachments);return}if(e==="onStepEnd"){this._onStepEnd(s.testId,s.resultId,s.step);return}if(e==="onError"){this._onError(s.error,s.workerInfo);return}if(e==="onStdIO"){this._onStdIO(s.type,s.testId,s.resultId,s.data,s.isBase64);return}if(e==="onEnd")return this._onEnd(s.result);if(e==="onExit")return this._onExit()}_onConfigure(t){var e,s;this._rootDir=t.rootDir,this._config=this._parseConfig(t),(s=(e=this._reporter).onConfigure)==null||s.call(e,this._config)}_onProject(t){let e=this._options.mergeProjects?this._rootSuite.suites.find(r=>r.project().name===t.name):void 0;e||(e=new tt(t.name,"project"),this._rootSuite._addSuite(e));const s=this._parseProject(t);e._project=s;let n=-1;this._options.mergeProjects&&(n=this._config.projects.findIndex(r=>r.name===t.name)),n===-1?this._config.projects.push(s):this._config.projects[n]=s;for(const r of t.suites)this._mergeSuiteInto(r,e)}_onBegin(){var t,e;(e=(t=this._reporter).onBegin)==null||e.call(t,this._rootSuite)}_onTestBegin(t,e){var r,a;const s=this._tests.get(t);this._options.clearPreviousResultsWhenTestBegins&&(s.results=[]);const n=s._createTestResult(e.id);n.retry=e.retry,n.workerIndex=e.workerIndex,n.parallelIndex=e.parallelIndex,n.setStartTimeNumber(e.startTime),(a=(r=this._reporter).onTestBegin)==null||a.call(r,s,n)}_onTestPaused(t,e,s){var a,p;const n=this._tests.get(t),r=n.results.find(c=>c._id===e);r.errors.push(...s),r.error=r.errors[0],(p=(a=this._reporter).onTestPaused)==null||p.call(a,n,r)}_onTestEnd(t,e){var r,a;const s=this._tests.get(t.testId);s.timeout=t.timeout,s.expectedStatus=t.expectedStatus;const n=s.results.find(p=>p._id===e.id);n.duration=e.duration,n.status=e.status,n.errors.push(...e.errors??[]),n.error=n.errors[0],e.attachments&&(n.attachments=this._parseAttachments(e.attachments)),e.annotations&&(this._absoluteAnnotationLocationsInplace(e.annotations),n.annotations=e.annotations,s.annotations=e.annotations),(a=(r=this._reporter).onTestEnd)==null||a.call(r,s,n),n._stepMap=new Map}_onStepBegin(t,e,s){var g,l;const n=this._tests.get(t),r=n.results.find(w=>w._id===e),a=s.parentStepId?r._stepMap.get(s.parentStepId):void 0,p=this._absoluteLocation(s.location),c=new ue(s,a,p,r);a?a.steps.push(c):r.steps.push(c),r._stepMap.set(s.id,c),(l=(g=this._reporter).onStepBegin)==null||l.call(g,n,r,c)}_onStepEnd(t,e,s){var p,c;const n=this._tests.get(t),r=n.results.find(g=>g._id===e),a=r._stepMap.get(s.id);a._endPayload=s,a.duration=s.duration,a.error=s.error,(c=(p=this._reporter).onStepEnd)==null||c.call(p,n,r,a)}_onAttach(t,e,s){this._tests.get(t).results.find(a=>a._id===e).attachments.push(...s.map(a=>({name:a.name,contentType:a.contentType,path:a.path,body:a.base64&&globalThis.Buffer?Buffer.from(a.base64,"base64"):void 0})))}_onError(t,e){var n,r;let s;if(e){const a=this._config.projects.find(p=>p.name===e.projectName);a&&(s={workerIndex:e.workerIndex,parallelIndex:e.parallelIndex,config:this._config,project:a})}(r=(n=this._reporter).onError)==null||r.call(n,t,s)}_onStdIO(t,e,s,n,r){var g,l,w,k;const a=r?globalThis.Buffer?Buffer.from(n,"base64"):atob(n):n,p=e?this._tests.get(e):void 0,c=p&&s?p.results.find(h=>h._id===s):void 0;t==="stdout"?(c==null||c.stdout.push(a),(l=(g=this._reporter).onStdOut)==null||l.call(g,a,p,c)):(c==null||c.stderr.push(a),(k=(w=this._reporter).onStdErr)==null||k.call(w,a,p,c))}async _onEnd(t){var e,s;await((s=(e=this._reporter).onEnd)==null?void 0:s.call(e,ge(t)))}_onExit(){var t,e;return(e=(t=this._reporter).onExit)==null?void 0:e.call(t)}_parseConfig(t){const e=me(t);return this._options.configOverrides&&(e.configFile=this._options.configOverrides.configFile,e.reportSlowTests=this._options.configOverrides.reportSlowTests,e.quiet=this._options.configOverrides.quiet,e.reporter=[...this._options.configOverrides.reporter]),e}_parseProject(t){return{metadata:t.metadata,name:t.name,outputDir:this._absolutePath(t.outputDir),repeatEach:t.repeatEach,retries:t.retries,testDir:this._absolutePath(t.testDir),testIgnore:ct(t.testIgnore),testMatch:ct(t.testMatch),timeout:t.timeout,grep:ct(t.grep),grepInvert:ct(t.grepInvert),dependencies:t.dependencies,teardown:t.teardown,snapshotDir:this._absolutePath(t.snapshotDir),ignoreSnapshots:t.ignoreSnapshots??!1,use:t.use}}_parseAttachments(t){return t.map(e=>({...e,body:e.base64&&globalThis.Buffer?Buffer.from(e.base64,"base64"):void 0}))}_mergeSuiteInto(t,e){let s=e.suites.find(n=>n.title===t.title);s||(s=new tt(t.title,e.type==="project"?"file":"describe"),e._addSuite(s)),s.location=this._absoluteLocation(t.location),t.entries.forEach(n=>{"testId"in n?this._mergeTestInto(n,s):this._mergeSuiteInto(n,s)})}_mergeTestInto(t,e){let s=this._options.mergeTestCases?e.tests.find(n=>n.title===t.title&&n.repeatEachIndex===t.repeatEachIndex):void 0;s||(s=new de(t.testId,t.title,this._absoluteLocation(t.location),t.repeatEachIndex),e._addTest(s),this._tests.set(s.id,s)),this._updateTest(t,s)}_updateTest(t,e){return e.id=t.testId,e.location=this._absoluteLocation(t.location),e.retries=t.retries,e.tags=t.tags??[],e.annotations=t.annotations??[],this._absoluteAnnotationLocationsInplace(e.annotations),e}_absoluteAnnotationLocationsInplace(t){for(const e of t)e.location&&(e.location=this._absoluteLocation(e.location))}_absoluteLocation(t){return t&&{...t,file:this._absolutePath(t.file)}}_absolutePath(t){if(t!==void 0)return this._options.resolvePath?this._options.resolvePath(this._rootDir,t):this._rootDir+"/"+t}}class tt{constructor(t,e){this._entries=[],this._requireFile="",this._parallelMode="none",this.title=t,this._type=e}get type(){return this._type}get suites(){return this._entries.filter(t=>t.type!=="test")}get tests(){return this._entries.filter(t=>t.type==="test")}entries(){return this._entries}allTests(){const t=[],e=s=>{for(const n of s.entries())n.type==="test"?t.push(n):e(n)};return e(this),t}titlePath(){const t=this.parent?this.parent.titlePath():[];return(this.title||this._type!=="describe")&&t.push(this.title),t}project(){var t;return this._project??((t=this.parent)==null?void 0:t.project())}_addTest(t){t.parent=this,this._entries.push(t)}_addSuite(t){t.parent=this,this._entries.push(t)}}class de{constructor(t,e,s,n){this.fn=()=>{},this.results=[],this.type="test",this.expectedStatus="passed",this.timeout=0,this.annotations=[],this.retries=0,this.tags=[],this.repeatEachIndex=0,this.id=t,this.title=e,this.location=s,this.repeatEachIndex=n}titlePath(){const t=this.parent?this.parent.titlePath():[];return t.push(this.title),t}outcome(){return pe(this)}ok(){const t=this.outcome();return t==="expected"||t==="flaky"||t==="skipped"}_createTestResult(t){const e=new he(this.results.length,t);return this.results.push(e),e}}class ue{constructor(t,e,s,n){this.duration=-1,this.steps=[],this._startTime=0,this.title=t.title,this.category=t.category,this.location=s,this.parent=e,this._startTime=t.startTime,this._result=n}titlePath(){var e;return[...((e=this.parent)==null?void 0:e.titlePath())||[],this.title]}get startTime(){return new Date(this._startTime)}set startTime(t){this._startTime=+t}get attachments(){var t,e;return((e=(t=this._endPayload)==null?void 0:t.attachments)==null?void 0:e.map(s=>this._result.attachments[s]))??[]}get annotations(){var t;return((t=this._endPayload)==null?void 0:t.annotations)??[]}}class he{constructor(t,e){this.parallelIndex=-1,this.workerIndex=-1,this.duration=-1,this.stdout=[],this.stderr=[],this.attachments=[],this.annotations=[],this.status="skipped",this.steps=[],this.errors=[],this._stepMap=new Map,this._startTime=0,this.retry=t,this._id=e}setStartTimeNumber(t){this._startTime=t}get startTime(){return new Date(this._startTime)}set startTime(t){this._startTime=+t}}const fe={argv:[],failOnFlakyTests:!1,forbidOnly:!1,fullyParallel:!1,globalSetup:null,globalTeardown:null,globalTimeout:0,grep:/.*/,grepInvert:null,maxFailures:0,metadata:{},preserveOutput:"always",projects:[],reporter:[[ce.CI?"dot":"list"]],reportSlowTests:{max:5,threshold:3e5},configFile:"",rootDir:"",quiet:!1,shard:null,tags:[],updateSnapshots:"missing",updateSourceMethod:"patch",version:"",workers:0,webServer:null};function ct(i){return i.map(t=>t.s!==void 0?t.s:new RegExp(t.r.source,t.r.flags))}function pe(i){let t=0,e=0,s=0;for(const n of i.results)n.status==="interrupted"||(n.status==="skipped"&&i.expectedStatus==="skipped"?++t:n.status==="skipped"||(n.status===i.expectedStatus?++e:++s));return e===0&&s===0?"skipped":s===0?"expected":e===0&&t===0?"unexpected":"flaky"}function ge(i){return{status:i.status,startTime:new Date(i.startTime),duration:i.duration}}function me(i){return{...fe,...i}}class _t{constructor(t,e,s,n,r,a){this._treeItemById=new Map,this._treeItemByTestId=new Map;const p=n&&[...n.values()].some(Boolean);this.pathSeparator=r,this.rootItem={kind:"group",subKind:"folder",id:t,title:"",location:{file:"",line:0,column:0},duration:0,parent:void 0,children:[],status:"none",hasLoadErrors:!1},this._treeItemById.set(t,this.rootItem);const c=(g,l,w,k)=>{for(const h of k==="tests"?[]:l.suites){if(!h.title){c(g,h,w,"all");continue}let I=w.children.find(u=>u.kind==="group"&&u.title===h.title);I||(I={kind:"group",subKind:"describe",id:"suite:"+l.titlePath().join("")+""+h.title,title:h.title,location:h.location,duration:0,parent:w,children:[],status:"none",hasLoadErrors:!1},this._addChild(w,I)),c(g,h,I,"all")}for(const h of k==="suites"?[]:l.tests){const I=h.title;let u=w.children.find(E=>E.kind!=="group"&&E.title===I);u||(u={kind:"case",id:"test:"+h.titlePath().join(""),title:I,parent:w,children:[],tests:[],location:h.location,duration:0,status:"none",project:void 0,test:void 0,tags:h.tags},this._addChild(w,u));const b=h.results[0];let x="none";(b==null?void 0:b[et])==="scheduled"?x="scheduled":(b==null?void 0:b[et])==="running"?x="running":(b==null?void 0:b.status)==="skipped"?x="skipped":(b==null?void 0:b.status)==="interrupted"?x="none":b&&h.outcome()!=="expected"?x="failed":b&&h.outcome()==="expected"&&(x="passed"),u.tests.push(h);const j={kind:"test",id:h.id,title:g.name,location:h.location,test:h,parent:u,children:[],status:x,duration:h.results.length?Math.max(0,h.results[0].duration):0,project:g};this._addChild(u,j),this._treeItemByTestId.set(h.id,j),u.duration=u.children.reduce((E,y)=>E+y.duration,0)}};for(const g of(e==null?void 0:e.suites)||[])if(!(p&&!n.get(g.title)))for(const l of g.suites)if(a){if(c(g.project(),l,this.rootItem,"suites"),l.tests.length){const w=this._defaultDescribeItem();c(g.project(),l,w,"tests")}}else{const w=this._fileItem(l.location.file.split(r),!0);c(g.project(),l,w,"all")}for(const g of s){if(!g.location)continue;const l=this._fileItem(g.location.file.split(r),!0);l.hasLoadErrors=!0}}_addChild(t,e){t.children.push(e),e.parent=t,this._treeItemById.set(e.id,e)}filterTree(t,e,s){const n=t.trim().toLowerCase().split(" "),r=[...e.values()].some(Boolean),a=c=>{const g=[...c.tests[0].titlePath(),...c.tests[0].tags].join(" ").toLowerCase();return!n.every(l=>g.includes(l))&&!c.tests.some(l=>s==null?void 0:s.has(l.id))?!1:(c.children=c.children.filter(l=>!r||(s==null?void 0:s.has(l.test.id))||e.get(l.status)),c.tests=c.children.map(l=>l.test),!!c.children.length)},p=c=>{const g=[];for(const l of c.children)l.kind==="case"?a(l)&&g.push(l):(p(l),(l.children.length||l.hasLoadErrors)&&g.push(l));c.children=g};p(this.rootItem)}_fileItem(t,e){if(t.length===0)return this.rootItem;const s=t.join(this.pathSeparator),n=this._treeItemById.get(s);if(n)return n;const r=this._fileItem(t.slice(0,t.length-1),!1),a={kind:"group",subKind:e?"file":"folder",id:s,title:t[t.length-1],location:{file:s,line:0,column:0},duration:0,parent:r,children:[],status:"none",hasLoadErrors:!1};return this._addChild(r,a),a}_defaultDescribeItem(){let t=this._treeItemById.get("<anonymous>");return t||(t={kind:"group",subKind:"describe",id:"<anonymous>",title:"<anonymous>",location:{file:"",line:0,column:0},duration:0,parent:this.rootItem,children:[],status:"none",hasLoadErrors:!1},this._addChild(this.rootItem,t)),t}sortAndPropagateStatus(){Ct(this.rootItem)}flattenForSingleProject(){const t=e=>{e.kind==="case"&&e.children.length===1?(e.project=e.children[0].project,e.test=e.children[0].test,e.children=[],this._treeItemByTestId.set(e.test.id,e)):e.children.forEach(t)};t(this.rootItem)}shortenRoot(){let t=this.rootItem;for(;t.children.length===1&&t.children[0].kind==="group"&&t.children[0].subKind==="folder";)t=t.children[0];t.location=this.rootItem.location,this.rootItem=t}fileNames(){const t=new Set,e=s=>{s.kind==="group"&&s.subKind==="file"?t.add(s.id):s.children.forEach(e)};return e(this.rootItem),[...t]}flatTreeItems(){const t=[],e=s=>{t.push(s),s.children.forEach(e)};return e(this.rootItem),t}treeItemById(t){return this._treeItemById.get(t)}collectTestIds(t){return _e(t)}}function Ct(i){for(const a of i.children)Ct(a);i.kind==="group"&&i.children.sort((a,p)=>a.location.file.localeCompare(p.location.file)||a.location.line-p.location.line);let t=i.children.length>0,e=i.children.length>0,s=!1,n=!1,r=!1;for(const a of i.children)e=e&&a.status==="skipped",t=t&&(a.status==="passed"||a.status==="skipped"),s=s||a.status==="failed",n=n||a.status==="running",r=r||a.status==="scheduled";n?i.status="running":r?i.status="scheduled":s?i.status="failed":e?i.status="skipped":t&&(i.status="passed")}function _e(i){const t=new Set,e=new Set,s=n=>{if(n.kind!=="test"&&n.kind!=="case"){n.children.forEach(s);return}let r=n;for(;r&&r.parent&&!(r.kind==="group"&&r.subKind==="file");)r=r.parent;e.add(r.location.file),n.kind==="case"?n.tests.forEach(a=>t.add(a.id)):t.add(n.id)};return s(i),{testIds:t,locations:e}}const et=Symbol("statusEx");class ve{constructor(t){this.loadErrors=[],this.progress={total:0,passed:0,failed:0,skipped:0},this._lastRunTestCount=0,this._receiver=new mt(this._createReporter(),{mergeProjects:!0,mergeTestCases:!0,resolvePath:jt(t.pathSeparator),clearPreviousResultsWhenTestBegins:!0}),this._options=t}_createReporter(){return{version:()=>"v2",onConfigure:t=>{this.config=t,this._lastRunReceiver=new mt({version:()=>"v2",onBegin:e=>{this._lastRunTestCount=e.allTests().length,this._lastRunReceiver=void 0}},{mergeProjects:!0,mergeTestCases:!1,resolvePath:jt(this._options.pathSeparator)}),this._lastRunReceiver.dispatch({method:"onConfigure",params:{config:t}})},onBegin:t=>{var e;if(this.rootSuite||(this.rootSuite=t),this._testResultsSnapshot){for(const s of this.rootSuite.allTests())s.results=((e=this._testResultsSnapshot)==null?void 0:e.get(s.id))||s.results;this._testResultsSnapshot=void 0}this.progress.total=this._lastRunTestCount,this.progress.passed=0,this.progress.failed=0,this.progress.skipped=0,this._options.onUpdate(!0)},onEnd:()=>{this._options.onUpdate(!0)},onTestBegin:(t,e)=>{e[et]="running",this._options.onUpdate()},onTestEnd:(t,e)=>{t.outcome()==="skipped"?++this.progress.skipped:t.outcome()==="unexpected"?++this.progress.failed:++this.progress.passed,e[et]=e.status,this._options.onUpdate()},onError:t=>this._handleOnError(t),printsToStdio:()=>!1}}processGlobalReport(t){const e=new mt({version:()=>"v2",onConfigure:s=>{this.config=s},onError:s=>this._handleOnError(s)});for(const s of t)e.dispatch(s)}processListReport(t){var s;const e=((s=this.rootSuite)==null?void 0:s.allTests())||[];this._testResultsSnapshot=new Map(e.map(n=>[n.id,n.results])),this._receiver.reset();for(const n of t)this._receiver.dispatch(n)}processTestReportEvent(t){var e,s,n;(s=(e=this._lastRunReceiver)==null?void 0:e.dispatch(t))==null||s.catch(()=>{}),(n=this._receiver.dispatch(t))==null||n.catch(()=>{})}_handleOnError(t){var e,s;this.loadErrors.push(t),(s=(e=this._options).onError)==null||s.call(e,t),this._options.onUpdate()}asModel(){return{rootSuite:this.rootSuite||new tt("","root"),config:this.config,loadErrors:this.loadErrors,progress:this.progress}}}function jt(i){return(t,e)=>{const s=[];for(const n of[...t.split(i),...e.split(i)]){const r=i==="\\"&&s.length===1&&s[0].endsWith(":"),a=!s.length;if(!(!n&&!a&&!r)&&n!=="."){if(n===".."){s.pop();continue}s.push(n)}}return s.join(i)}}const we=({source:i})=>{const[t,e]=Ht(),[s,n]=H.useState(qt()),[r]=H.useState(Yt(()=>import("./assets/xtermModule-CsJ4vdCR.js"),__vite__mapDeps([0,1]),import.meta.url).then(p=>p.default)),a=H.useRef(null);return H.useEffect(()=>(Qt(n),()=>Xt(n)),[]),H.useEffect(()=>{const p=i.write,c=i.clear;return(async()=>{const{Terminal:g,FitAddon:l}=await r,w=e.current;if(!w)return;const k=s==="dark-mode"?xe:be;if(a.current&&a.current.terminal.options.theme===k)return;a.current&&(w.textContent="");const h=new g({convertEol:!0,fontSize:13,scrollback:1e4,fontFamily:"monospace",theme:k}),I=new l;h.loadAddon(I);for(const u of i.pending)h.write(u);i.write=(u=>{i.pending.push(u),h.write(u)}),i.clear=()=>{i.pending=[],h.clear()},h.open(w),I.fit(),a.current={terminal:h,fitAddon:I}})(),()=>{i.clear=c,i.write=p}},[r,a,e,i,s]),H.useEffect(()=>{setTimeout(()=>{a.current&&(a.current.fitAddon.fit(),i.resize(a.current.terminal.cols,a.current.terminal.rows))},250)},[t,i]),o.jsx("div",{"data-testid":"output",className:"xterm-wrapper",style:{flex:"auto"},ref:e})},be={foreground:"#383a42",background:"#fafafa",cursor:"#383a42",black:"#000000",red:"#e45649",green:"#50a14f",yellow:"#c18401",blue:"#4078f2",magenta:"#a626a4",cyan:"#0184bc",white:"#a0a0a0",brightBlack:"#000000",brightRed:"#e06c75",brightGreen:"#98c379",brightYellow:"#d19a66",brightBlue:"#4078f2",brightMagenta:"#a626a4",brightCyan:"#0184bc",brightWhite:"#383a42",selectionBackground:"#d7d7d7",selectionForeground:"#383a42"},xe={foreground:"#f8f8f2",background:"#1e1e1e",cursor:"#f8f8f0",black:"#000000",red:"#ff5555",green:"#50fa7b",yellow:"#f1fa8c",blue:"#bd93f9",magenta:"#ff79c6",cyan:"#8be9fd",white:"#bfbfbf",brightBlack:"#4d4d4d",brightRed:"#ff6e6e",brightGreen:"#69ff94",brightYellow:"#ffffa5",brightBlue:"#d6acff",brightMagenta:"#ff92df",brightCyan:"#a4ffff",brightWhite:"#e6e6e6",selectionBackground:"#44475a",selectionForeground:"#f8f8f2"},Se=({filterText:i,setFilterText:t,statusFilters:e,setStatusFilters:s,projectFilters:n,setProjectFilters:r,onlyChanged:a,setOnlyChanged:p,testModel:c,runTests:g})=>{const[l,w]=d.useState(!1),k=d.useRef(null);d.useEffect(()=>{var u;(u=k.current)==null||u.focus()},[]);const h=[...e.entries()].filter(([u,b])=>b).map(([u])=>u).join(" ")||"all",I=[...n.entries()].filter(([u,b])=>b).map(([u])=>u).join(" ")||"all";return o.jsxs("div",{className:"filters",children:[o.jsx(Jt,{expanded:l,setExpanded:w,title:o.jsx("input",{ref:k,type:"search",placeholder:"Filter (e.g. text, @tag)",spellCheck:!1,value:i,onChange:u=>{t(u.target.value)},onKeyDown:u=>{u.key==="Enter"&&g()}})}),o.jsxs("div",{className:"filter-summary",title:"Status: "+h+`
Projects: `+I+(a?`
Only changed`:""),onClick:()=>w(!l),children:[o.jsx("span",{className:"filter-label",children:"Status:"})," ",h,o.jsx("span",{className:"filter-label",children:"Projects:"})," ",I,a&&o.jsx(o.Fragment,{children:o.jsx("span",{className:"filter-label",children:"Only changed"})})]}),l&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"hbox",style:{marginLeft:14,maxHeight:200,overflowY:"auto"},children:[o.jsx("div",{className:"filter-list",role:"list","data-testid":"status-filters",children:[...e.entries()].map(([u,b])=>o.jsx("div",{className:"filter-entry",role:"listitem",children:o.jsxs("label",{children:[o.jsx("input",{type:"checkbox",checked:b,onChange:()=>{const x=new Map(e);x.set(u,!x.get(u)),s(x)}}),o.jsx("div",{children:u})]})},u))}),o.jsx("div",{className:"filter-list",role:"list","data-testid":"project-filters",children:[...n.entries()].map(([u,b])=>o.jsx("div",{className:"filter-entry",role:"listitem",children:o.jsxs("label",{children:[o.jsx("input",{type:"checkbox",checked:b,onChange:()=>{var E;const x=new Map(n);x.set(u,!x.get(u)),r(x);const j=(E=c==null?void 0:c.config)==null?void 0:E.configFile;j&&Rt.setObject(j+":projects",[...x.entries()].filter(([y,W])=>W).map(([y])=>y))}}),o.jsx("div",{children:u||"untitled"})]})},u))})]}),o.jsx("div",{className:"filter-entry",style:{marginLeft:24},children:o.jsxs("label",{children:[o.jsx("input",{type:"checkbox",checked:a,onChange:()=>p(!a)}),o.jsx("div",{children:"Show only changed files"})]})})]})]})},Te=({tag:i,style:t,onClick:e})=>o.jsx("span",{className:vt("tag",`tag-color-${ke(i)}`),onClick:e,style:{margin:"6px 0 0 6px",...t},title:`Click to filter by tag: ${i}`,children:i});function ke(i){let t=0;for(let e=0;e<i.length;e++)t=i.charCodeAt(e)+((t<<8)-t);return Math.abs(t%6)}const je=Zt,ye=({filterText:i,testModel:t,testServerConnection:e,testTree:s,runTests:n,runningState:r,watchAll:a,watchedTreeIds:p,setWatchedTreeIds:c,isLoading:g,onItemSelected:l,requestedCollapseAllCount:w,requestedExpandAllCount:k,setFilterText:h,onRevealSource:I})=>{const[u,b]=d.useState({expandedItems:new Map}),[x,j]=d.useState(),[E,y]=d.useState(w),[W,st]=d.useState(k);d.useEffect(()=>{if(E!==w){u.expandedItems.clear();for(const T of s.flatTreeItems())u.expandedItems.set(T.id,!1);y(w),j(void 0),b({...u});return}if(W!==k){u.expandedItems.clear();for(const T of s.flatTreeItems())u.expandedItems.set(T.id,!0);st(k),j(void 0),b({...u});return}if(!r||r.itemSelectedByUser)return;let f;const C=T=>{var F;T.children.forEach(C),!f&&T.status==="failed"&&(T.kind==="test"&&r.testIds.has(T.test.id)||T.kind==="case"&&r.testIds.has((F=T.tests[0])==null?void 0:F.id))&&(f=T)};C(s.rootItem),f&&j(f.id)},[r,j,s,E,y,w,W,st,k,u,b]);const N=d.useMemo(()=>{if(x)return s.treeItemById(x)},[x,s]);d.useEffect(()=>{if(!t)return;const f=Ie(N,t);let C;(N==null?void 0:N.kind)==="test"?C=N.test:(N==null?void 0:N.kind)==="case"&&N.tests.length===1&&(C=N.tests[0]),l({treeItem:N,testCase:C,testFile:f})},[t,N,l]),d.useEffect(()=>{if(!g)if(a)e==null||e.watchNoReply({fileNames:s.fileNames()});else{const f=new Set;for(const C of p.value){const T=s.treeItemById(C),F=T==null?void 0:T.location.file;F&&f.add(F)}e==null||e.watchNoReply({fileNames:[...f]})}},[g,s,a,p,e]);const z=f=>{j(f.id),n("bounce-if-busy",s.collectTestIds(f))},V=(f,C)=>{if(f.preventDefault(),f.stopPropagation(),f.metaKey||f.ctrlKey){const T=i.split(" ");T.includes(C)?h(T.filter(F=>F!==C).join(" ").trim()):h((i+" "+C).trim())}else h((i.split(" ").filter(T=>!T.startsWith("@")).join(" ")+" "+C).trim())};return o.jsx(je,{name:"tests",treeState:u,setTreeState:b,rootItem:s.rootItem,dataTestId:"test-tree",render:f=>{const C=f.id.replace(/[^\w\d-_]/g,"-"),T=C+"-label",F=C+"-time";return o.jsxs("div",{className:"hbox ui-mode-tree-item","aria-labelledby":`${T} ${F}`,children:[o.jsxs("div",{id:T,className:"ui-mode-tree-item-title",children:[o.jsx("span",{children:f.title}),f.kind==="case"?f.tags.map(Q=>o.jsx(Te,{tag:Q.slice(1),onClick:dt=>V(dt,Q)},Q)):null]}),!!f.duration&&f.status!=="skipped"&&o.jsx("div",{id:F,className:"ui-mode-tree-item-time",children:te(f.duration)}),o.jsxs(Y,{noMinHeight:!0,noShadow:!0,children:[o.jsx(M,{icon:"play",title:"Run",onClick:()=>z(f),disabled:!!r&&!r.completed}),o.jsx(M,{icon:"go-to-file",title:"Show source",onClick:I,style:f.kind==="group"&&f.subKind==="folder"?{visibility:"hidden"}:{}}),!a&&o.jsx(M,{icon:"eye",title:"Watch",onClick:()=>{p.value.has(f.id)?p.value.delete(f.id):p.value.add(f.id),c({...p})},toggled:p.value.has(f.id)})]})]})},icon:f=>Gt(f.status),title:f=>f.title,selectedItem:N,onAccepted:z,onSelected:f=>{r&&(r.itemSelectedByUser=!0),j(f.id)},isError:f=>f.kind==="group"?f.hasLoadErrors:!1,autoExpandDepth:i?5:1,noItemsMessage:g?"Loadingâ€¦":"No tests"})};function Ie(i,t){if(!(!i||!t))return{file:i.location.file,line:i.location.line,column:i.location.column,source:{errors:t.loadErrors.filter(e=>{var s;return((s=e.location)==null?void 0:s.file)===i.location.file}).map(e=>({line:e.location.line,message:e.message})),content:void 0}}}function Ee(i){return`.playwright-artifacts-${i}`}const Re=({item:i,rootDir:t,onOpenExternally:e,revealSource:s,pathSeparator:n})=>{var w,k;const[r,a]=d.useState(void 0),[p,c]=d.useState(0),g=d.useRef(null),{outputDir:l}=d.useMemo(()=>({outputDir:i.testCase?Be(i.testCase):void 0}),[i]);return d.useEffect(()=>{var b,x,j;g.current&&clearTimeout(g.current);const h=(b=i.testCase)==null?void 0:b.results[0];if(!h||((x=i.treeItem)==null?void 0:x.status)==="scheduled"){a(void 0);return}const I=h&&h.duration>=0&&h.attachments.find(E=>E.name==="trace");if(I&&I.path){yt(I.path,h.startTime.getTime()).then(E=>a({model:E,isLive:!1}));return}if(!l){a(void 0);return}const u=[l,Ee(h.workerIndex),"traces",`${(j=i.testCase)==null?void 0:j.id}.json`].join(n);return g.current=setTimeout(async()=>{try{const E=await yt(u,Date.now());a({model:E,isLive:!0})}catch{const E=new Bt("",[]);E.errorDescriptors.push(...h.errors.flatMap(y=>y.message?[{message:y.message}]:[])),a({model:E,isLive:!1})}finally{c(p+1)}},500),()=>{g.current&&clearTimeout(g.current)}},[l,i,a,p,c,n]),o.jsx(ee,{model:r==null?void 0:r.model,showSourcesFirst:!0,rootDir:t,fallbackLocation:i.testFile,isLive:r==null?void 0:r.isLive,status:(w=i.treeItem)==null?void 0:w.status,annotations:((k=i.testCase)==null?void 0:k.annotations)??[],onOpenExternally:e,revealSource:s},"workbench")},Be=i=>{var t;for(let e=i.parent;e;e=e.parent)if(e.project())return(t=e.project())==null?void 0:t.outputDir};async function yt(i,t){const e=`file?path=${encodeURIComponent(i)}&timestamp=${t}`,s=new URLSearchParams;s.set("trace",e);const r=await(await fetch(`contexts?${s.toString()}`)).json();return new Bt(e,r)}let It={cols:80};const K={pending:[],clear:()=>{},write:i=>K.pending.push(i),resize:()=>{}},A=new URLSearchParams(window.location.search),Ce=new URL(A.get("server")??"../",window.location.href),wt=new URL(A.get("ws"),Ce);wt.protocol=wt.protocol==="https:"?"wss:":"ws:";const P={args:A.getAll("arg"),grep:A.get("grep")||void 0,grepInvert:A.get("grepInvert")||void 0,projects:A.getAll("project"),workers:A.get("workers")||void 0,headed:A.has("headed"),updateSnapshots:A.get("updateSnapshots")||void 0,reporters:A.has("reporter")?A.getAll("reporter"):void 0,pathSeparator:A.get("pathSeparator")||"/"};P.updateSnapshots&&!["all","changed","none","missing"].includes(P.updateSnapshots)&&(P.updateSnapshots=void 0);const Et=navigator.platform==="MacIntel";function Pe(i){return i.startsWith("/")&&(i=i.substring(1)),i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ne(i,t,e){const s=i.passed+i.failed+i.skipped,n=t?s/t*100|0:0,r=[];return i.passed>0&&r.push(`${i.passed} passed`),i.failed>0&&r.push(o.jsxs("span",{className:"status-line-failed",children:[i.failed," failed"]},"failed")),i.skipped>0&&r.push(`${i.skipped} skipped`),o.jsx("div",{"data-testid":"status-line",className:"status-line",children:o.jsxs("div",{children:[e&&"Running ",s,"/",t," (",n,"%)",r.length>0&&" â€” ",r.map((a,p)=>o.jsxs(d.Fragment,{children:[p>0?", ":"",a]},p))]})})}const Le=({})=>{var Tt;const[i,t]=d.useState(""),[e,s]=d.useState(!1),[n,r]=d.useState(!1),[a,p]=d.useState(new Map([["passed",!1],["failed",!1],["skipped",!1]])),[c,g]=d.useState(new Map),[l,w]=d.useState(),[k,h]=d.useState(),[I,u]=d.useState({}),[b,x]=d.useState(!1),[j,E]=d.useState(),y=j&&!j.completed,[W,st]=q("watch-all",!1),[N,z]=d.useState({value:new Set}),V=d.useRef(Promise.resolve()),f=d.useRef({testIds:new Set,locations:new Set}),[C,T]=d.useState(0),[F,Q]=d.useState(0),[dt,Pt]=d.useState(!1),[bt,xt]=d.useState(!0),[v,Nt]=d.useState(),[it,Lt]=d.useState(),[nt,Dt]=d.useState(!1),[ot,Ft]=d.useState(!1),[Mt,St]=d.useState(!1),Ot=d.useCallback(()=>St(!0),[St]),[ut,At]=q("single-worker",!1),[ht,Ut]=q("updateSnapshots","missing"),[X,Wt]=q("only-changed",!1),[ft,Kt]=q("stop-on-failure",!1),[J]=q("mergeFiles",!1),Vt=d.useRef(null),rt=d.useCallback(()=>{Nt(m=>(m==null||m.close(),new se(new ie(wt))))},[]);d.useEffect(()=>{var m;(m=Vt.current)==null||m.focus(),x(!0),rt()},[rt]),d.useEffect(()=>{if(!v)return;const m=[v.onStdio(_=>{if(_.buffer){const S=atob(_.buffer);K.write(S)}else K.write(_.text);_.type==="stderr"&&r(!0)}),v.onClose(()=>Pt(!0))];return K.resize=(_,S)=>{It={cols:_,rows:S},v.resizeTerminalNoReply({cols:_,rows:S})},()=>{for(const _ of m)_.dispose()}},[v]),d.useEffect(()=>{if(!v)return;let m;const _=new ve({onUpdate:S=>{clearTimeout(m),m=void 0,S?w(_.asModel()):m||(m=setTimeout(()=>{w(_.asModel())},250))},onError:S=>{K.write((S.stack||S.value||"")+`
`),r(!0)},pathSeparator:P.pathSeparator});return Lt(_),w(void 0),x(!0),z({value:new Set}),(async()=>{try{await v.initialize({interceptStdio:!0,watchTestDirs:!0});const{status:S,report:B}=await v.runGlobalSetup({});if(_.processGlobalReport(B),S!=="passed")return;const L=await v.listTests({projects:P.projects,locations:P.args,grep:P.grep,grepInvert:P.grepInvert,onlyChanged:X});_.processListReport(L.report),v.onReport($=>{_.processTestReportEvent($)});const{hasBrowsers:O}=await v.checkBrowsers({});xt(O)}finally{x(!1)}})(),()=>{clearTimeout(m)}},[X,v]),d.useEffect(()=>{if(!l)return;const{config:m,rootSuite:_}=l,S=m.configFile?Rt.getObject(m.configFile+":projects",void 0):void 0,B=new Map(c);for(const L of B.keys())_.suites.find(O=>O.title===L)||B.delete(L);for(const L of _.suites)B.has(L.title)||B.set(L.title,!!(S!=null&&S.includes(L.title)));!S&&B.size&&![...B.values()].includes(!0)&&B.set(B.entries().next().value[0],!0),(c.size!==B.size||[...c].some(([L,O])=>B.get(L)!==O))&&g(B)},[c,l]),d.useEffect(()=>{y&&(l!=null&&l.progress)?h(l.progress):l||h(void 0)},[l,y]);const{testTree:at}=d.useMemo(()=>{if(!l)return{testTree:new _t("",new tt("","root"),[],c,P.pathSeparator,J)};const m=new _t("",l.rootSuite,l.loadErrors,c,P.pathSeparator,J);return m.filterTree(i,a,y?j==null?void 0:j.testIds:void 0),m.sortAndPropagateStatus(),m.shortenRoot(),m.flattenForSingleProject(),{testTree:m}},[i,l,a,c,j,y,J]),Z=d.useCallback((m,_)=>{if(!(!v||!l)&&!(m==="bounce-if-busy"&&y)){for(const S of _.testIds)f.current.testIds.add(S);for(const S of _.locations)f.current.locations.add(S);V.current=V.current.then(async()=>{var O,$,U;const{testIds:S,locations:B}=f.current;if(f.current={testIds:new Set,locations:new Set},!S.size)return;{for(const R of((O=l.rootSuite)==null?void 0:O.allTests())||[])if(S.has(R.id)){R.results=[];const D=R._createTestResult("pending");D[et]="scheduled"}w({...l})}const L="  ["+new Date().toLocaleTimeString()+"]";K.write("\x1B[2mâ€”".repeat(Math.max(0,It.cols-L.length))+L+"\x1B[22m"),h({total:0,passed:0,failed:0,skipped:0}),E({testIds:S}),await v.runTests({locations:[...B].map(Pe),grep:P.grep,grepInvert:P.grepInvert,testIds:[...S],projects:[...c].filter(([R,D])=>D).map(([R])=>R),updateSnapshots:ht,reporters:P.reporters,workers:ut?1:void 0,maxFailures:ft?1:void 0,trace:"on"});for(const R of(($=l.rootSuite)==null?void 0:$.allTests())||[])((U=R.results[0])==null?void 0:U.duration)===-1&&(R.results=[]);w({...l}),E(R=>R?{...R,completed:!0}:void 0)})}},[c,y,l,v,ht,ut,ft]),lt=d.useCallback(()=>Z("bounce-if-busy",at.collectTestIds(at.rootItem)),[Z,at]);d.useEffect(()=>{if(!v||!it)return;const m=v.onTestFilesChanged(async _=>{if(V.current=V.current.then(async()=>{x(!0);try{const U=await v.listTests({projects:P.projects,locations:P.args,grep:P.grep,grepInvert:P.grepInvert,onlyChanged:X});it.processListReport(U.report)}catch(U){console.log(U)}finally{x(!1)}}),await V.current,_.testFiles.length===0)return;const S=it.asModel(),B=new _t("",S.rootSuite,S.loadErrors,c,P.pathSeparator,J),L=[],O=[],$=new Set(_.testFiles);if(W){const U=R=>{const D=R.location.file;if(D&&$.has(D)){const G=B.collectTestIds(R);L.push(...G.locations),O.push(...G.testIds)}R.kind==="group"&&R.subKind==="folder"&&R.children.forEach(U)};U(B.rootItem)}else for(const U of N.value){const R=B.treeItemById(U);if(!R)continue;let D=R;for(;!(D.kind==="group"&&(D.subKind==="file"||D.subKind==="folder"))&&D.parent;)D=D.parent;const G=D==null?void 0:D.location.file;if(G&&$.has(G)){const kt=B.collectTestIds(R);L.push(...kt.locations),O.push(...kt.testIds)}}Z("queue-if-busy",{locations:L,testIds:O})});return()=>m.dispose()},[Z,v,W,N,it,c,J,X]),d.useEffect(()=>{if(!v)return;const m=_=>{_.code==="Backquote"&&_.ctrlKey?(_.preventDefault(),s(!e)):_.code==="F5"&&_.shiftKey?(_.preventDefault(),v==null||v.stopTestsNoReply({})):_.code==="F5"&&(_.preventDefault(),lt())};return addEventListener("keydown",m),()=>{removeEventListener("keydown",m)}},[lt,rt,v,e]);const pt=d.useRef(null),$t=d.useCallback(m=>{var _;m.preventDefault(),m.stopPropagation(),(_=pt.current)==null||_.showModal()},[]),gt=d.useCallback(m=>{var _;m.preventDefault(),m.stopPropagation(),(_=pt.current)==null||_.close()},[]),zt=d.useCallback(m=>{gt(m),s(!0),v==null||v.installBrowsers({}).then(async()=>{s(!1);const{hasBrowsers:_}=await(v==null?void 0:v.checkBrowsers({}));xt(_)})},[gt,v]);return o.jsxs("div",{className:"vbox ui-mode",children:[!bt&&o.jsxs("dialog",{ref:pt,children:[o.jsxs("div",{className:"title",children:[o.jsx("span",{className:"codicon codicon-lightbulb"}),"Install browsers"]}),o.jsxs("div",{className:"body",children:["Playwright did not find installed browsers.",o.jsx("br",{}),"Would you like to run `playwright install`?",o.jsx("br",{}),o.jsx("button",{className:"button",onClick:zt,children:"Install"}),o.jsx("button",{className:"button secondary",onClick:gt,children:"Dismiss"})]})]}),dt&&o.jsxs("div",{className:"disconnected",children:[o.jsx("div",{className:"title",children:"UI Mode disconnected"}),o.jsxs("div",{children:[o.jsx("a",{href:"#",onClick:()=>window.location.href="/",children:"Reload the page"})," to reconnect"]})]}),o.jsx(ne,{sidebarSize:250,minSidebarSize:150,orientation:"horizontal",sidebarIsFirst:!0,settingName:"testListSidebar",main:o.jsxs("div",{className:"vbox",children:[o.jsxs("div",{className:vt("vbox",!e&&"hidden"),children:[o.jsxs(Y,{children:[o.jsx("div",{className:"section-title",style:{flex:"none"},children:"Output"}),o.jsx(M,{icon:"circle-slash",title:"Clear output",onClick:()=>{K.clear(),r(!1)}}),o.jsx("div",{className:"spacer"}),o.jsx(M,{icon:"close",title:"Close",onClick:()=>s(!1)})]}),o.jsx(we,{source:K})]}),o.jsx("div",{className:vt("vbox",e&&"hidden"),children:o.jsx(Re,{pathSeparator:P.pathSeparator,item:I,rootDir:(Tt=l==null?void 0:l.config)==null?void 0:Tt.rootDir,revealSource:Mt,onOpenExternally:m=>v==null?void 0:v.openNoReply({location:{file:m.file,line:m.line,column:m.column}})})})]}),sidebar:o.jsxs("div",{className:"vbox ui-mode-sidebar",children:[o.jsxs(Y,{noShadow:!0,noMinHeight:!0,children:[o.jsx("img",{src:"playwright-logo.svg",alt:"Playwright logo"}),o.jsx("div",{className:"section-title",children:"Playwright"}),o.jsx(M,{icon:"refresh",title:"Reload",onClick:()=>rt(),disabled:y||b}),o.jsx("div",{style:{position:"relative"},children:o.jsx(M,{icon:"terminal",title:"Toggle output â€” "+(Et?"âŒƒ`":"Ctrl + `"),toggled:e,errorBadge:n?"Output contains error":void 0,onClick:()=>{s(!e)}})}),!bt&&o.jsx(M,{icon:"lightbulb-autofix",style:{color:"var(--vscode-list-warningForeground)"},title:"Playwright browsers are missing",onClick:$t})]}),o.jsx(Se,{filterText:i,setFilterText:t,statusFilters:a,setStatusFilters:p,projectFilters:c,setProjectFilters:g,onlyChanged:X,setOnlyChanged:Wt,testModel:l,runTests:lt}),o.jsxs(Y,{className:"section-toolbar",noMinHeight:!0,children:[!y&&!k&&o.jsx("div",{className:"section-title",children:"Tests"}),k&&Ne(k,y?j.testIds.size:k.total,!!y),o.jsx(M,{icon:"play",title:"Run all â€” F5",onClick:lt,disabled:y||b}),o.jsx(M,{icon:"debug-stop",title:"Stop â€” "+(Et?"â‡§F5":"Shift + F5"),onClick:()=>v==null?void 0:v.stopTests({}),disabled:!y||b,testId:"stop-button"}),o.jsx(M,{icon:"eye",title:"Watch all",toggled:W,onClick:()=>{z({value:new Set}),st(!W)}}),o.jsx(M,{icon:"collapse-all",title:"Collapse all",onClick:()=>{T(C+1)}}),o.jsx(M,{icon:"expand-all",title:"Expand all",onClick:()=>{Q(F+1)}})]}),o.jsx(ye,{filterText:i,testModel:l,testTree:at,testServerConnection:v,runningState:j,runTests:Z,onItemSelected:u,watchAll:W,watchedTreeIds:N,setWatchedTreeIds:z,isLoading:b,requestedCollapseAllCount:C,requestedExpandAllCount:F,setFilterText:t,onRevealSource:Ot}),o.jsxs(Y,{noShadow:!0,noMinHeight:!0,className:"settings-toolbar",onClick:()=>Ft(!ot),children:[o.jsx("span",{className:`codicon codicon-${ot?"chevron-down":"chevron-right"}`,style:{marginLeft:5},title:ot?"Hide Testing Options":"Show Testing Options"}),o.jsx("div",{className:"section-title",children:"Testing Options"})]}),ot&&o.jsx(oe,{settings:[{type:"check",value:ut,set:At,name:"Single worker"},{type:"check",value:ft,set:Kt,name:"Stop on first failure"},{type:"select",options:[{label:"All",value:"all"},{label:"Changed",value:"changed"},{label:"Missing",value:"missing"},{label:"None",value:"none"}],value:ht,set:Ut,name:"Update snapshots"}]}),o.jsxs(Y,{noShadow:!0,noMinHeight:!0,className:"settings-toolbar",onClick:()=>Dt(!nt),children:[o.jsx("span",{className:`codicon codicon-${nt?"chevron-down":"chevron-right"}`,style:{marginLeft:5},title:nt?"Hide Settings":"Show Settings"}),o.jsx("div",{className:"section-title",children:"Settings"})]}),nt&&o.jsx(re,{location:"ui-mode"})]})})]})};(async()=>{if(ae(),window.location.protocol!=="file:"){if(window.location.href.includes("isUnderTest=true")&&await new Promise(i=>setTimeout(i,1e3)),!navigator.serviceWorker)throw new Error(`Service workers are not supported.
Make sure to serve the website (${window.location}) via HTTPS or localhost.`);navigator.serviceWorker.register("sw.bundle.js"),navigator.serviceWorker.controller||await new Promise(i=>{navigator.serviceWorker.oncontrollerchange=()=>i()}),setInterval(function(){fetch("ping")},1e4)}le.createRoot(document.querySelector("#root")).render(o.jsx(Le,{}))})();

<!DOCTYPE html>
<html lang="en" translate="no">
  <head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="icon" href="./playwright-logo.svg" type="image/svg+xml">
    <title>Playwright Test</title>
    <script type="module" crossorigin src="./uiMode.Ut8wwJNp.js"></script>
    <link rel="modulepreload" crossorigin href="./assets/urlMatch-BYQrIQwR.js">
    <link rel="modulepreload" crossorigin href="./assets/defaultSettingsView-BNmKHKpQ.js">
    <link rel="stylesheet" crossorigin href="./defaultSettingsView.CjdS-WJx.css">
    <link rel="stylesheet" crossorigin href="./uiMode.BZQ54Kgt.css">
  </head>
  <body>
    <div id="root"></div>
  </body>
</html>
/**
 * Copyright (c) 2014 The xterm.js authors. All rights reserved.
 * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
 * https://github.com/chjj/term.js
 * @license MIT
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 *
 * Originally forked from (with the author's permission):
 *   Fabrice Bellard's javascript vt100 for jslinux:
 *   http://bellard.org/jslinux/
 *   Copyright (c) 2011 Fabrice Bellard
 *   The original design remains. The terminal itself
 *   has been extended to include xterm CSI codes, among
 *   other features.
 */.xterm{cursor:text;position:relative;user-select:none;-ms-user-select:none;-webkit-user-select:none}.xterm.focus,.xterm:focus{outline:none}.xterm .xterm-helpers{position:absolute;top:0;z-index:5}.xterm .xterm-helper-textarea{padding:0;border:0;margin:0;position:absolute;opacity:0;left:-9999em;top:0;width:0;height:0;z-index:-5;white-space:nowrap;overflow:hidden;resize:none}.xterm .composition-view{background:#000;color:#fff;display:none;position:absolute;white-space:nowrap;z-index:1}.xterm .composition-view.active{display:block}.xterm .xterm-viewport{background-color:#000;overflow-y:scroll;cursor:default;position:absolute;right:0;left:0;top:0;bottom:0}.xterm .xterm-screen{position:relative}.xterm .xterm-screen canvas{position:absolute;left:0;top:0}.xterm .xterm-scroll-area{visibility:hidden}.xterm-char-measure-element{display:inline-block;visibility:hidden;position:absolute;top:0;left:-9999em;line-height:normal}.xterm.enable-mouse-events{cursor:default}.xterm.xterm-cursor-pointer,.xterm .xterm-cursor-pointer{cursor:pointer}.xterm.column-select.focus{cursor:crosshair}.xterm .xterm-accessibility:not(.debug),.xterm .xterm-message{position:absolute;left:0;top:0;bottom:0;right:0;z-index:10;color:transparent;pointer-events:none}.xterm .xterm-accessibility-tree:not(.debug) *::selection{color:transparent}.xterm .xterm-accessibility-tree{-webkit-user-select:text;user-select:text;white-space:pre}.xterm .live-region{position:absolute;left:-9999px;width:1px;height:1px;overflow:hidden}.xterm-dim{opacity:1!important}.xterm-underline-1{text-decoration:underline}.xterm-underline-2{text-decoration:double underline}.xterm-underline-3{text-decoration:wavy underline}.xterm-underline-4{text-decoration:dotted underline}.xterm-underline-5{text-decoration:dashed underline}.xterm-overline{text-decoration:overline}.xterm-overline.xterm-underline-1{text-decoration:overline underline}.xterm-overline.xterm-underline-2{text-decoration:overline double underline}.xterm-overline.xterm-underline-3{text-decoration:overline wavy underline}.xterm-overline.xterm-underline-4{text-decoration:overline dotted underline}.xterm-overline.xterm-underline-5{text-decoration:overline dashed underline}.xterm-strikethrough{text-decoration:line-through}.xterm-screen .xterm-decoration-container .xterm-decoration{z-index:6;position:absolute}.xterm-screen .xterm-decoration-container .xterm-decoration.xterm-decoration-top-layer{z-index:7}.xterm-decoration-overview-ruler{z-index:8;position:absolute;top:0;right:0;pointer-events:none}.xterm-decoration-top{z-index:2;position:relative}
#!/bin/sh
#---------------------------------------------
#   xdg-open
#
#   Utility script to open a URL in the registered default application.
#
#   Refer to the usage() function below for usage.
#
#   Copyright 2009-2010, Fathi Boudra <fabo@freedesktop.org>
#   Copyright 2009-2010, Rex Dieter <rdieter@fedoraproject.org>
#   Copyright 2006, Kevin Krammer <kevin.krammer@gmx.at>
#   Copyright 2006, Jeremy White <jwhite@codeweavers.com>
#
#   LICENSE:
#
#   Permission is hereby granted, free of charge, to any person obtaining a
#   copy of this software and associated documentation files (the "Software"),
#   to deal in the Software without restriction, including without limitation
#   the rights to use, copy, modify, merge, publish, distribute, sublicense,
#   and/or sell copies of the Software, and to permit persons to whom the
#   Software is furnished to do so, subject to the following conditions:
#
#   The above copyright notice and this permission notice shall be included
#   in all copies or substantial portions of the Software.
#
#   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
#   OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
#   FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
#   THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
#   OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
#   ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
#   OTHER DEALINGS IN THE SOFTWARE.
#
#---------------------------------------------

manualpage()
{
cat << _MANUALPAGE
Name

   xdg-open -- opens a file or URL in the user's preferred
   application

Synopsis

   xdg-open { file | URL }

   xdg-open { --help | --manual | --version }

Description

   xdg-open opens a file or URL in the user's preferred
   application. If a URL is provided the URL will be opened in the
   user's preferred web browser. If a file is provided the file
   will be opened in the preferred application for files of that
   type. xdg-open supports file, ftp, http and https URLs.

   xdg-open is for use inside a desktop session only. It is not
   recommended to use xdg-open as root.

Options

   --help
          Show command synopsis.

   --manual
          Show this manual page.

   --version
          Show the xdg-utils version information.

Exit Codes

   An exit code of 0 indicates success while a non-zero exit code
   indicates failure. The following failure codes can be returned:

   1
          Error in command line syntax.

   2
          One of the files passed on the command line did not
          exist.

   3
          A required tool could not be found.

   4
          The action failed.

See Also

   xdg-mime(1), xdg-settings(1), MIME applications associations
   specification

Examples

xdg-open 'http://www.freedesktop.org/'

   Opens the freedesktop.org website in the user's default
   browser.

xdg-open /tmp/foobar.png

   Opens the PNG image file /tmp/foobar.png in the user's default
   image viewing application.
_MANUALPAGE
}

usage()
{
cat << _USAGE
   xdg-open -- opens a file or URL in the user's preferred
   application

Synopsis

   xdg-open { file | URL }

   xdg-open { --help | --manual | --version }

_USAGE
}

#@xdg-utils-common@

#----------------------------------------------------------------------------
#   Common utility functions included in all XDG wrapper scripts
#----------------------------------------------------------------------------

DEBUG()
{
  [ -z "${XDG_UTILS_DEBUG_LEVEL}" ] && return 0;
  [ ${XDG_UTILS_DEBUG_LEVEL} -lt $1 ] && return 0;
  shift
  echo "$@" >&2
}

# This handles backslashes but not quote marks.
first_word()
{
    read first rest
    echo "$first"
}

#-------------------------------------------------------------
# map a binary to a .desktop file
binary_to_desktop_file()
{
    search="${XDG_DATA_HOME:-$HOME/.local/share}:${XDG_DATA_DIRS:-/usr/local/share:/usr/share}"
    binary="`which "$1"`"
    binary="`readlink -f "$binary"`"
    base="`basename "$binary"`"
    IFS=:
    for dir in $search; do
        unset IFS
        [ "$dir" ] || continue
        [ -d "$dir/applications" ] || [ -d "$dir/applnk" ] || continue
        for file in "$dir"/applications/*.desktop "$dir"/applications/*/*.desktop "$dir"/applnk/*.desktop "$dir"/applnk/*/*.desktop; do
            [ -r "$file" ] || continue
            # Check to make sure it's worth the processing.
            grep -q "^Exec.*$base" "$file" || continue
            # Make sure it's a visible desktop file (e.g. not "preferred-web-browser.desktop").
            grep -Eq "^(NoDisplay|Hidden)=true" "$file" && continue
            command="`grep -E "^Exec(\[[^]=]*])?=" "$file" | cut -d= -f 2- | first_word`"
            command="`which "$command"`"
            if [ x"`readlink -f "$command"`" = x"$binary" ]; then
                # Fix any double slashes that got added path composition
                echo "$file" | sed -e 's,//*,/,g'
                return
            fi
        done
    done
}

#-------------------------------------------------------------
# map a .desktop file to a binary
desktop_file_to_binary()
{
    search="${XDG_DATA_HOME:-$HOME/.local/share}:${XDG_DATA_DIRS:-/usr/local/share:/usr/share}"
    desktop="`basename "$1"`"
    IFS=:
    for dir in $search; do
        unset IFS
        [ "$dir" ] && [ -d "$dir/applications" ] || [ -d "$dir/applnk" ] || continue
        # Check if desktop file contains -
        if [ "${desktop#*-}" != "$desktop" ]; then
            vendor=${desktop%-*}
            app=${desktop#*-}
            if [ -r $dir/applications/$vendor/$app ]; then
                file_path=$dir/applications/$vendor/$app
            elif [ -r $dir/applnk/$vendor/$app ]; then
                file_path=$dir/applnk/$vendor/$app
            fi
        fi
        if test -z "$file_path" ; then
            for indir in "$dir"/applications/ "$dir"/applications/*/ "$dir"/applnk/ "$dir"/applnk/*/; do
                file="$indir/$desktop"
                if [ -r "$file" ]; then
                    file_path=$file
                    break
                fi
            done
        fi
        if [ -r "$file_path" ]; then
            # Remove any arguments (%F, %f, %U, %u, etc.).
            command="`grep -E "^Exec(\[[^]=]*])?=" "$file_path" | cut -d= -f 2- | first_word`"
            command="`which "$command"`"
            readlink -f "$command"
            return
        fi
    done
}

#-------------------------------------------------------------
# Exit script on successfully completing the desired operation

exit_success()
{
    if [ $# -gt 0 ]; then
        echo "$@"
        echo
    fi

    exit 0
}


#-----------------------------------------
# Exit script on malformed arguments, not enough arguments
# or missing required option.
# prints usage information

exit_failure_syntax()
{
    if [ $# -gt 0 ]; then
        echo "xdg-open: $@" >&2
        echo "Try 'xdg-open --help' for more information." >&2
    else
        usage
        echo "Use 'man xdg-open' or 'xdg-open --manual' for additional info."
    fi

    exit 1
}

#-------------------------------------------------------------
# Exit script on missing file specified on command line

exit_failure_file_missing()
{
    if [ $# -gt 0 ]; then
        echo "xdg-open: $@" >&2
    fi

    exit 2
}

#-------------------------------------------------------------
# Exit script on failure to locate necessary tool applications

exit_failure_operation_impossible()
{
    if [ $# -gt 0 ]; then
        echo "xdg-open: $@" >&2
    fi

    exit 3
}

#-------------------------------------------------------------
# Exit script on failure returned by a tool application

exit_failure_operation_failed()
{
    if [ $# -gt 0 ]; then
        echo "xdg-open: $@" >&2
    fi

    exit 4
}

#------------------------------------------------------------
# Exit script on insufficient permission to read a specified file

exit_failure_file_permission_read()
{
    if [ $# -gt 0 ]; then
        echo "xdg-open: $@" >&2
    fi

    exit 5
}

#------------------------------------------------------------
# Exit script on insufficient permission to write a specified file

exit_failure_file_permission_write()
{
    if [ $# -gt 0 ]; then
        echo "xdg-open: $@" >&2
    fi

    exit 6
}

check_input_file()
{
    if [ ! -e "$1" ]; then
        exit_failure_file_missing "file '$1' does not exist"
    fi
    if [ ! -r "$1" ]; then
        exit_failure_file_permission_read "no permission to read file '$1'"
    fi
}

check_vendor_prefix()
{
    file_label="$2"
    [ -n "$file_label" ] || file_label="filename"
    file=`basename "$1"`
    case "$file" in
       [[:alpha:]]*-*)
         return
         ;;
    esac

    echo "xdg-open: $file_label '$file' does not have a proper vendor prefix" >&2
    echo 'A vendor prefix consists of alpha characters ([a-zA-Z]) and is terminated' >&2
    echo 'with a dash ("-"). An example '"$file_label"' is '"'example-$file'" >&2
    echo "Use --novendor to override or 'xdg-open --manual' for additional info." >&2
    exit 1
}

check_output_file()
{
    # if the file exists, check if it is writeable
    # if it does not exists, check if we are allowed to write on the directory
    if [ -e "$1" ]; then
        if [ ! -w "$1" ]; then
            exit_failure_file_permission_write "no permission to write to file '$1'"
        fi
    else
        DIR=`dirname "$1"`
        if [ ! -w "$DIR" ] || [ ! -x "$DIR" ]; then
            exit_failure_file_permission_write "no permission to create file '$1'"
        fi
    fi
}

#----------------------------------------
# Checks for shared commands, e.g. --help

check_common_commands()
{
    while [ $# -gt 0 ] ; do
        parm="$1"
        shift

        case "$parm" in
            --help)
            usage
            echo "Use 'man xdg-open' or 'xdg-open --manual' for additional info."
            exit_success
            ;;

            --manual)
            manualpage
            exit_success
            ;;

            --version)
            echo "xdg-open 1.1.3"
            exit_success
            ;;
        esac
    done
}

check_common_commands "$@"

[ -z "${XDG_UTILS_DEBUG_LEVEL}" ] && unset XDG_UTILS_DEBUG_LEVEL;
if [ ${XDG_UTILS_DEBUG_LEVEL-0} -lt 1 ]; then
    # Be silent
    xdg_redirect_output=" > /dev/null 2> /dev/null"
else
    # All output to stderr
    xdg_redirect_output=" >&2"
fi

#--------------------------------------
# Checks for known desktop environments
# set variable DE to the desktop environments name, lowercase

detectDE()
{
    # see https://bugs.freedesktop.org/show_bug.cgi?id=34164
    unset GREP_OPTIONS

    if [ -n "${XDG_CURRENT_DESKTOP}" ]; then
      case "${XDG_CURRENT_DESKTOP}" in
         # only recently added to menu-spec, pre-spec X- still in use
         Cinnamon|X-Cinnamon)
           DE=cinnamon;
           ;;
         ENLIGHTENMENT)
           DE=enlightenment;
           ;;
         # GNOME, GNOME-Classic:GNOME, or GNOME-Flashback:GNOME
         GNOME*)
           DE=gnome;
           ;;
         KDE)
           DE=kde;
           ;;
         # Deepin Desktop Environments
         DEEPIN|Deepin|deepin)
           DE=dde;
           ;;
         LXDE)
           DE=lxde;
           ;;
         LXQt)
           DE=lxqt;
           ;;
         MATE)
           DE=mate;
           ;;
         XFCE)
           DE=xfce
           ;;
         X-Generic)
           DE=generic
           ;;
      esac
    fi

    if [ x"$DE" = x"" ]; then
      # classic fallbacks
      if [ x"$KDE_FULL_SESSION" != x"" ]; then DE=kde;
      elif [ x"$GNOME_DESKTOP_SESSION_ID" != x"" ]; then DE=gnome;
      elif [ x"$MATE_DESKTOP_SESSION_ID" != x"" ]; then DE=mate;
      elif `dbus-send --print-reply --dest=org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.GetNameOwner string:org.gnome.SessionManager > /dev/null 2>&1` ; then DE=gnome;
      elif xprop -root _DT_SAVE_MODE 2> /dev/null | grep ' = \"xfce4\"$' >/dev/null 2>&1; then DE=xfce;
      elif xprop -root 2> /dev/null | grep -i '^xfce_desktop_window' >/dev/null 2>&1; then DE=xfce
      elif echo $DESKTOP | grep -q '^Enlightenment'; then DE=enlightenment;
      elif [ x"$LXQT_SESSION_CONFIG" != x"" ]; then DE=lxqt;
      fi
    fi

    if [ x"$DE" = x"" ]; then
      # fallback to checking $DESKTOP_SESSION
      case "$DESKTOP_SESSION" in
         gnome)
           DE=gnome;
           ;;
         LXDE|Lubuntu)
           DE=lxde; 
           ;;
         MATE)
           DE=mate;
           ;;
         xfce|xfce4|'Xfce Session')
           DE=xfce;
           ;;
      esac
    fi

    if [ x"$DE" = x"" ]; then
      # fallback to uname output for other platforms
      case "$(uname 2>/dev/null)" in 
        CYGWIN*)
          DE=cygwin;
          ;;
        Darwin)
          DE=darwin;
          ;;
      esac
    fi

    if [ x"$DE" = x"gnome" ]; then
      # gnome-default-applications-properties is only available in GNOME 2.x
      # but not in GNOME 3.x
      which gnome-default-applications-properties > /dev/null 2>&1  || DE="gnome3"
    fi

    if [ -f "$XDG_RUNTIME_DIR/flatpak-info" ]; then
      DE="flatpak"
    fi
}

#----------------------------------------------------------------------------
# kfmclient exec/openURL can give bogus exit value in KDE <= 3.5.4
# It also always returns 1 in KDE 3.4 and earlier
# Simply return 0 in such case

kfmclient_fix_exit_code()
{
    version=`LC_ALL=C.UTF-8 kde-config --version 2>/dev/null | grep '^KDE'`
    major=`echo $version | sed 's/KDE.*: \([0-9]\).*/\1/'`
    minor=`echo $version | sed 's/KDE.*: [0-9]*\.\([0-9]\).*/\1/'`
    release=`echo $version | sed 's/KDE.*: [0-9]*\.[0-9]*\.\([0-9]\).*/\1/'`
    test "$major" -gt 3 && return $1
    test "$minor" -gt 5 && return $1
    test "$release" -gt 4 && return $1
    return 0
}

#----------------------------------------------------------------------------
# Returns true if there is a graphical display attached.

has_display()
{
    if [ -n "$DISPLAY" ] || [ -n "$WAYLAND_DISPLAY" ]; then
        return 0
    else
        return 1
    fi
}

# This handles backslashes but not quote marks.
last_word()
{
    read first rest
    echo "$rest"
}

# Get the value of a key in a desktop file's Desktop Entry group.
# Example: Use get_key foo.desktop Exec
# to get the values of the Exec= key for the Desktop Entry group.
get_key()
{
    local file="${1}"
    local key="${2}"
    local desktop_entry=""

    IFS_="${IFS}"
    IFS=""
    while read line
    do
        case "$line" in
            "[Desktop Entry]")
                desktop_entry="y"
            ;;
            # Reset match flag for other groups
            "["*)
                desktop_entry=""
            ;;
            "${key}="*)
                # Only match Desktop Entry group
                if [ -n "${desktop_entry}" ]
                then
                    echo "${line}" | cut -d= -f 2-
                fi
        esac
    done < "${file}"
    IFS="${IFS_}"
}

# Returns true if argument is a file:// URL or path
is_file_url_or_path()
{
    if echo "$1" | grep -q '^file://' \
            || ! echo "$1" | egrep -q '^[[:alpha:]+\.\-]+:'; then
        return 0
    else
        return 1
    fi
}

# If argument is a file URL, convert it to a (percent-decoded) path.
# If not, leave it as it is.
file_url_to_path()
{
    local file="$1"
    if echo "$file" | grep -q '^file:///'; then
        file=${file#file://}
        file=${file%%#*}
        file=$(echo "$file" | sed -r 's/\?.*$//')
        local printf=printf
        if [ -x /usr/bin/printf ]; then
            printf=/usr/bin/printf
        fi
        file=$($printf "$(echo "$file" | sed -e 's@%\([a-f0-9A-F]\{2\}\)@\\x\1@g')")
    fi
    echo "$file"
}

open_cygwin()
{
    cygstart "$1"

    if [ $? -eq 0 ]; then
        exit_success
    else
        exit_failure_operation_failed
    fi
}

open_darwin()
{
    open "$1"

    if [ $? -eq 0 ]; then
        exit_success
    else
        exit_failure_operation_failed
    fi
}

open_kde()
{
    if [ -n "${KDE_SESSION_VERSION}" ]; then
      case "${KDE_SESSION_VERSION}" in
        4)
          kde-open "$1"
        ;;
        5)
          kde-open${KDE_SESSION_VERSION} "$1"
        ;;
      esac
    else
        kfmclient exec "$1"
        kfmclient_fix_exit_code $?
    fi

    if [ $? -eq 0 ]; then
        exit_success
    else
        exit_failure_operation_failed
    fi
}

open_dde()
{
    if dde-open -version >/dev/null 2>&1; then
        dde-open "$1"
    else
        open_generic "$1"
    fi

    if [ $? -eq 0 ]; then
        exit_success
    else
        exit_failure_operation_failed
    fi
}

open_gnome3()
{
    if gio help open 2>/dev/null 1>&2; then
        gio open "$1"
    elif gvfs-open --help 2>/dev/null 1>&2; then
        gvfs-open "$1"
    else
        open_generic "$1"
    fi

    if [ $? -eq 0 ]; then
        exit_success
    else
        exit_failure_operation_failed
    fi
}

open_gnome()
{
    if gio help open 2>/dev/null 1>&2; then
        gio open "$1"
    elif gvfs-open --help 2>/dev/null 1>&2; then
        gvfs-open "$1"
    elif gnome-open --help 2>/dev/null 1>&2; then
        gnome-open "$1"
    else
        open_generic "$1"
    fi

    if [ $? -eq 0 ]; then
        exit_success
    else
        exit_failure_operation_failed
    fi
}

open_mate()
{
    if gio help open 2>/dev/null 1>&2; then
        gio open "$1"
    elif gvfs-open --help 2>/dev/null 1>&2; then
        gvfs-open "$1"
    elif mate-open --help 2>/dev/null 1>&2; then
        mate-open "$1"
    else
        open_generic "$1"
    fi

    if [ $? -eq 0 ]; then
        exit_success
    else
        exit_failure_operation_failed
    fi
}

open_xfce()
{
    if exo-open --help 2>/dev/null 1>&2; then
        exo-open "$1"
    elif gio help open 2>/dev/null 1>&2; then
        gio open "$1"
    elif gvfs-open --help 2>/dev/null 1>&2; then
        gvfs-open "$1"
    else
        open_generic "$1"
    fi

    if [ $? -eq 0 ]; then
        exit_success
    else
        exit_failure_operation_failed
    fi
}

open_enlightenment()
{
    if enlightenment_open --help 2>/dev/null 1>&2; then
        enlightenment_open "$1"
    else
        open_generic "$1"
    fi

    if [ $? -eq 0 ]; then
        exit_success
    else
        exit_failure_operation_failed
    fi
}

open_flatpak()
{
    gdbus call --session \
        --dest org.freedesktop.portal.Desktop \
        --object-path /org/freedesktop/portal/desktop \
        --method org.freedesktop.portal.OpenURI.OpenURI \
        "" "$1" {}

    if [ $? -eq 0 ]; then
        exit_success
    else
        exit_failure_operation_failed
    fi
}

#-----------------------------------------
# Recursively search .desktop file

search_desktop_file()
{
    local default="$1"
    local dir="$2"
    local target="$3"

    local file=""
    # look for both vendor-app.desktop, vendor/app.desktop
    if [ -r "$dir/$default" ]; then
      file="$dir/$default"
    elif [ -r "$dir/`echo $default | sed -e 's|-|/|'`" ]; then
      file="$dir/`echo $default | sed -e 's|-|/|'`"
    fi

    if [ -r "$file" ] ; then
        command="$(get_key "${file}" "Exec" | first_word)"
        command_exec=`which $command 2>/dev/null`
        icon="$(get_key "${file}" "Icon")"
        # FIXME: Actually LC_MESSAGES should be used as described in
        # http://standards.freedesktop.org/desktop-entry-spec/latest/ar01s04.html
        localised_name="$(get_key "${file}" "Name")"
        set -- $(get_key "${file}" "Exec" | last_word)
        # We need to replace any occurrence of "%f", "%F" and
        # the like by the target file. We examine each
        # argument and append the modified argument to the
        # end then shift.
        local args=$#
        local replaced=0
        while [ $args -gt 0 ]; do
            case $1 in
                %[c])
                    replaced=1
                    arg="${localised_name}"
                    shift
                    set -- "$@" "$arg"
                    ;;
                %[fFuU])
                    replaced=1
                    arg="$target"
                    shift
                    set -- "$@" "$arg"
                    ;;
                %[i])
                    replaced=1
                    shift
                    set -- "$@" "--icon" "$icon"
                    ;;
                *)
                    arg="$1"
                    shift
                    set -- "$@" "$arg"
                    ;;
            esac
            args=$(( $args - 1 ))
        done
        [ $replaced -eq 1 ] || set -- "$@" "$target"
        "$command_exec" "$@"

        if [ $? -eq 0 ]; then
            exit_success
        fi
    fi

    for d in $dir/*/; do
        [ -d "$d" ] && search_desktop_file "$default" "$d" "$target"
    done
}


open_generic_xdg_mime()
{
    filetype="$2"
    default=`xdg-mime query default "$filetype"`
    if [ -n "$default" ] ; then
        xdg_user_dir="$XDG_DATA_HOME"
        [ -n "$xdg_user_dir" ] || xdg_user_dir="$HOME/.local/share"

        xdg_system_dirs="$XDG_DATA_DIRS"
        [ -n "$xdg_system_dirs" ] || xdg_system_dirs=/usr/local/share/:/usr/share/

DEBUG 3 "$xdg_user_dir:$xdg_system_dirs"
        for x in `echo "$xdg_user_dir:$xdg_system_dirs" | sed 's/:/ /g'`; do
            search_desktop_file "$default" "$x/applications/" "$1"
        done
    fi
}

open_generic_xdg_file_mime()
{
    filetype=`xdg-mime query filetype "$1" | sed "s/;.*//"`
    open_generic_xdg_mime "$1" "$filetype"
}

open_generic_xdg_x_scheme_handler()
{
    scheme="`echo $1 | sed -n 's/\(^[[:alnum:]+\.-]*\):.*$/\1/p'`"
    if [ -n $scheme ]; then
        filetype="x-scheme-handler/$scheme"
        open_generic_xdg_mime "$1" "$filetype"
    fi
}

has_single_argument()
{
  test $# = 1
}

open_envvar()
{
    local oldifs="$IFS"
    local browser browser_with_arg

    IFS=":"
    for browser in $BROWSER; do
        IFS="$oldifs"

        if [ -z "$browser" ]; then
            continue
        fi

        if echo "$browser" | grep -q %s; then
            # Avoid argument injection.
            # See https://bugs.freedesktop.org/show_bug.cgi?id=103807
            # URIs don't have IFS characters spaces anyway.
            has_single_argument $1 && $(printf "$browser" "$1")
        else
            $browser "$1"
        fi

        if [ $? -eq 0 ]; then
            exit_success
        fi
    done
}

open_generic()
{
    if is_file_url_or_path "$1"; then
        local file="$(file_url_to_path "$1")"

        check_input_file "$file"

        if has_display; then
            filetype=`xdg-mime query filetype "$file" | sed "s/;.*//"`
            open_generic_xdg_mime "$file" "$filetype"
        fi

        if which run-mailcap 2>/dev/null 1>&2; then
            run-mailcap --action=view "$file"
            if [ $? -eq 0 ]; then
                exit_success
            fi
        fi

        if has_display && mimeopen -v 2>/dev/null 1>&2; then
            mimeopen -L -n "$file"
            if [ $? -eq 0 ]; then
                exit_success
            fi
        fi
    fi

    if has_display; then
        open_generic_xdg_x_scheme_handler "$1"
    fi

    if [ -n "$BROWSER" ]; then
        open_envvar "$1"
    fi

    # if BROWSER variable is not set, check some well known browsers instead
    if [ x"$BROWSER" = x"" ]; then
        BROWSER=www-browser:links2:elinks:links:lynx:w3m
        if has_display; then
            BROWSER=x-www-browser:firefox:iceweasel:seamonkey:mozilla:epiphany:konqueror:chromium:chromium-browser:google-chrome:microsoft-edge:$BROWSER
        fi
    fi

    open_envvar "$1"

    exit_failure_operation_impossible "no method available for opening '$1'"
}

open_lxde()
{

    # pcmanfm only knows how to handle file:// urls and filepaths, it seems.
    if pcmanfm --help >/dev/null 2>&1 && is_file_url_or_path "$1"; then
        local file="$(file_url_to_path "$1")"

        # handle relative paths
        if ! echo "$file" | grep -q ^/; then
            file="$(pwd)/$file"
        fi

        pcmanfm "$file"
    else
        open_generic "$1"
    fi

    if [ $? -eq 0 ]; then
        exit_success
    else
        exit_failure_operation_failed
    fi
}

open_lxqt()
{
    open_generic "$1"
}

[ x"$1" != x"" ] || exit_failure_syntax

url=
while [ $# -gt 0 ] ; do
    parm="$1"
    shift

    case "$parm" in
      -*)
        exit_failure_syntax "unexpected option '$parm'"
        ;;

      *)
        if [ -n "$url" ] ; then
            exit_failure_syntax "unexpected argument '$parm'"
        fi
        url="$parm"
        ;;
    esac
done

if [ -z "${url}" ] ; then
    exit_failure_syntax "file or URL argument missing"
fi

detectDE

if [ x"$DE" = x"" ]; then
    DE=generic
fi

DEBUG 2 "Selected DE $DE"

# sanitize BROWSER (avoid caling ourselves in particular)
case "${BROWSER}" in
    *:"xdg-open"|"xdg-open":*)
        BROWSER=$(echo $BROWSER | sed -e 's|:xdg-open||g' -e 's|xdg-open:||g')
        ;;
    "xdg-open")
        BROWSER=
        ;;
esac

case "$DE" in
    kde)
    open_kde "$url"
    ;;

    dde)
    open_dde "$url"
    ;;

    gnome3|cinnamon)
    open_gnome3 "$url"
    ;;

    gnome)
    open_gnome "$url"
    ;;

    mate)
    open_mate "$url"
    ;;

    xfce)
    open_xfce "$url"
    ;;

    lxde)
    open_lxde "$url"
    ;;

    lxqt)
    open_lxqt "$url"
    ;;

    enlightenment)
    open_enlightenment "$url"
    ;;

    cygwin)
    open_cygwin "$url"
    ;;

    darwin)
    open_darwin "$url"
    ;;

    flatpak)
    open_flatpak "$url"
    ;;

    generic)
    open_generic "$url"
    ;;

    *)
    exit_failure_operation_impossible "no method available for opening '$url'"
    ;;
esac
{
  "name": "playwright-core",
  "version": "1.61.1",
  "description": "A high-level API to automate web browsers",
  "repository": {
    "type": "git",
    "url": "git+https://github.com/microsoft/playwright.git"
  },
  "homepage": "https://playwright.dev",
  "engines": {
    "node": ">=18"
  },
  "author": {
    "name": "Microsoft Corporation"
  },
  "license": "Apache-2.0",
  "exports": {
    ".": {
      "types": "./index.d.ts",
      "import": "./index.mjs",
      "require": "./index.js",
      "default": "./index.js"
    },
    "./package.json": "./package.json",
    "./lib/bootstrap": "./lib/bootstrap.js",
    "./lib/coreBundle": "./lib/coreBundle.js",
    "./lib/utilsBundle": "./lib/utilsBundle.js",
    "./lib/tools/cli-client/program": "./lib/tools/cli-client/program.js"
  },
  "bin": {
    "playwright-core": "cli.js"
  },
  "types": "types/types.d.ts"
}
# Blue Oak Model License

Version 1.0.0

## Purpose

This license gives everyone as much permission to work with
this software as possible, while protecting contributors
from liability.

## Acceptance

In order to receive this license, you must agree to its
rules.  The rules of this license are both obligations
under that agreement and conditions to your license.
You must not do anything with this software that triggers
a rule that you cannot or will not follow.

## Copyright

Each contributor licenses you to do everything with this
software that would otherwise infringe that contributor's
copyright in it.

## Notices

You must ensure that everyone who gets a copy of
any part of this software from you, with or without
changes, also gets the text of this license or a link to
<https://blueoakcouncil.org/license/1.0.0>.

## Excuse

If anyone notifies you in writing that you have not
complied with [Notices](#notices), you can keep your
license by taking all practical steps to comply within 30
days after the notice.  If you do not do so, your license
ends immediately.

## Patent

Each contributor licenses you to do everything with this
software that would otherwise infringe any patent claims
they can license or become able to license.

## Reliability

No contributor can revoke this license.

## No Liability

***As far as the law allows, this software comes as is,
without any warranty or condition, and no contributor
will be liable to anyone for any damages related to this
software or this license, under any kind of legal claim.***
;(function (sax) {
  // wrapper for non-node envs
  sax.parser = function (strict, opt) {
    return new SAXParser(strict, opt)
  }
  sax.SAXParser = SAXParser
  sax.SAXStream = SAXStream
  sax.createStream = createStream

  // When we pass the MAX_BUFFER_LENGTH position, start checking for buffer overruns.
  // When we check, schedule the next check for MAX_BUFFER_LENGTH - (max(buffer lengths)),
  // since that's the earliest that a buffer overrun could occur.  This way, checks are
  // as rare as required, but as often as necessary to ensure never crossing this bound.
  // Furthermore, buffers are only tested at most once per write(), so passing a very
  // large string into write() might have undesirable effects, but this is manageable by
  // the caller, so it is assumed to be safe.  Thus, a call to write() may, in the extreme
  // edge case, result in creating at most one complete copy of the string passed in.
  // Set to Infinity to have unlimited buffers.
  sax.MAX_BUFFER_LENGTH = 64 * 1024

  var buffers = [
    'comment',
    'sgmlDecl',
    'textNode',
    'tagName',
    'doctype',
    'procInstName',
    'procInstBody',
    'entity',
    'attribName',
    'attribValue',
    'cdata',
    'script',
  ]

  sax.EVENTS = [
    'text',
    'processinginstruction',
    'sgmldeclaration',
    'doctype',
    'comment',
    'opentagstart',
    'attribute',
    'opentag',
    'closetag',
    'opencdata',
    'cdata',
    'closecdata',
    'error',
    'end',
    'ready',
    'script',
    'opennamespace',
    'closenamespace',
  ]

  function SAXParser(strict, opt) {
    if (!(this instanceof SAXParser)) {
      return new SAXParser(strict, opt)
    }

    var parser = this
    clearBuffers(parser)
    parser.q = parser.c = ''
    parser.bufferCheckPosition = sax.MAX_BUFFER_LENGTH
    parser.encoding = null;
    parser.opt = opt || {}
    parser.opt.lowercase = parser.opt.lowercase || parser.opt.lowercasetags
    parser.looseCase = parser.opt.lowercase ? 'toLowerCase' : 'toUpperCase'
    parser.opt.maxEntityCount = parser.opt.maxEntityCount || 512
    parser.opt.maxEntityDepth = parser.opt.maxEntityDepth || 4
    parser.entityCount = parser.entityDepth = 0
    parser.tags = []
    parser.closed = parser.closedRoot = parser.sawRoot = false
    parser.tag = parser.error = null
    parser.strict = !!strict
    parser.noscript = !!(strict || parser.opt.noscript)
    parser.state = S.BEGIN
    parser.strictEntities = parser.opt.strictEntities
    parser.ENTITIES =
      parser.strictEntities ?
        Object.create(sax.XML_ENTITIES)
      : Object.create(sax.ENTITIES)
    parser.attribList = []

    // namespaces form a prototype chain.
    // it always points at the current tag,
    // which protos to its parent tag.
    if (parser.opt.xmlns) {
      parser.ns = Object.create(rootNS)
    }

    // disallow unquoted attribute values if not otherwise configured
    // and strict mode is true
    if (parser.opt.unquotedAttributeValues === undefined) {
      parser.opt.unquotedAttributeValues = !strict
    }

    // mostly just for error reporting
    parser.trackPosition = parser.opt.position !== false
    if (parser.trackPosition) {
      parser.position = parser.line = parser.column = 0
    }
    emit(parser, 'onready')
  }

  if (!Object.create) {
    Object.create = function (o) {
      function F() {}
      F.prototype = o
      var newf = new F()
      return newf
    }
  }

  if (!Object.keys) {
    Object.keys = function (o) {
      var a = []
      for (var i in o) if (o.hasOwnProperty(i)) a.push(i)
      return a
    }
  }

  function checkBufferLength(parser) {
    var maxAllowed = Math.max(sax.MAX_BUFFER_LENGTH, 10)
    var maxActual = 0
    for (var i = 0, l = buffers.length; i < l; i++) {
      var len = parser[buffers[i]].length
      if (len > maxAllowed) {
        // Text/cdata nodes can get big, and since they're buffered,
        // we can get here under normal conditions.
        // Avoid issues by emitting the text node now,
        // so at least it won't get any bigger.
        switch (buffers[i]) {
          case 'textNode':
            closeText(parser)
            break

          case 'cdata':
            emitNode(parser, 'oncdata', parser.cdata)
            parser.cdata = ''
            break

          case 'script':
            emitNode(parser, 'onscript', parser.script)
            parser.script = ''
            break

          default:
            error(parser, 'Max buffer length exceeded: ' + buffers[i])
        }
      }
      maxActual = Math.max(maxActual, len)
    }
    // schedule the next check for the earliest possible buffer overrun.
    var m = sax.MAX_BUFFER_LENGTH - maxActual
    parser.bufferCheckPosition = m + parser.position
  }

  function clearBuffers(parser) {
    for (var i = 0, l = buffers.length; i < l; i++) {
      parser[buffers[i]] = ''
    }
  }

  function flushBuffers(parser) {
    closeText(parser)
    if (parser.cdata !== '') {
      emitNode(parser, 'oncdata', parser.cdata)
      parser.cdata = ''
    }
    if (parser.script !== '') {
      emitNode(parser, 'onscript', parser.script)
      parser.script = ''
    }
  }

  SAXParser.prototype = {
    end: function () {
      end(this)
    },
    write: write,
    resume: function () {
      this.error = null
      return this
    },
    close: function () {
      return this.write(null)
    },
    flush: function () {
      flushBuffers(this)
    },
  }

  var Stream
  try {
    Stream = require('stream').Stream
  } catch (ex) {
    Stream = function () {}
  }
  if (!Stream) Stream = function () {}

  var streamWraps = sax.EVENTS.filter(function (ev) {
    return ev !== 'error' && ev !== 'end'
  })

  function createStream(strict, opt) {
    return new SAXStream(strict, opt)
  }

  function determineBufferEncoding(data, isEnd) {
    // BOM-based detection is the most reliable signal when present.
    if (data.length >= 2) {
      if (data[0] === 0xff && data[1] === 0xfe) {
        return 'utf-16le'
      }

      if (data[0] === 0xfe && data[1] === 0xff) {
        return 'utf-16be'
      }
    }

    if (data.length >= 3 && data[0] === 0xef && data[1] === 0xbb && data[2] === 0xbf) {
      return 'utf8'
    }

    if (data.length >= 4) {
      // XML documents without a BOM still start with "<?xml", which is enough
      // to distinguish UTF-16LE/BE from UTF-8 by looking at the zero bytes.
      if (data[0] === 0x3c && data[1] === 0x00 && data[2] === 0x3f && data[3] === 0x00) {
        return 'utf-16le'
      }

      if (data[0] === 0x00 && data[1] === 0x3c && data[2] === 0x00 && data[3] === 0x3f) {
        return 'utf-16be'
      }

      return 'utf8'
    }

    return isEnd ? 'utf8' : null
  }

  function SAXStream(strict, opt) {
    if (!(this instanceof SAXStream)) {
      return new SAXStream(strict, opt)
    }

    Stream.apply(this)

    this._parser = new SAXParser(strict, opt)
    this.writable = true
    this.readable = true

    var me = this

    this._parser.onend = function () {
      me.emit('end')
    }

    this._parser.onerror = function (er) {
      me.emit('error', er)

      // if didn't throw, then means error was handled.
      // go ahead and clear error, so we can write again.
      me._parser.error = null
    }

    this._decoder = null
    this._decoderBuffer = null
    streamWraps.forEach(function (ev) {
      Object.defineProperty(me, 'on' + ev, {
        get: function () {
          return me._parser['on' + ev]
        },
        set: function (h) {
          if (!h) {
            me.removeAllListeners(ev)
            me._parser['on' + ev] = h
            return h
          }
          me.on(ev, h)
        },
        enumerable: true,
        configurable: false,
      })
    })
  }

  SAXStream.prototype = Object.create(Stream.prototype, {
    constructor: {
      value: SAXStream,
    },
  })

  SAXStream.prototype._decodeBuffer = function (data, isEnd) {
    if (this._decoderBuffer) {
      // Keep incomplete leading bytes until we have enough data to infer the
      // stream encoding, then decode the buffered prefix together with the next chunk.
      data = Buffer.concat([this._decoderBuffer, data])
      this._decoderBuffer = null
    }

    if (!this._decoder) {
      var encoding = determineBufferEncoding(data, isEnd)
      if (!encoding) {
        // A very short first chunk may not contain enough bytes to detect the
        // encoding yet, so defer decoding until the next write/end call.
        this._decoderBuffer = data
        return ''
      }

      // Store the detected transport encoding so strict mode can compare it
      // with the optional encoding declared in the XML prolog later on.
      this._parser.encoding = encoding
      this._decoder = new TextDecoder(encoding)
    }

    return this._decoder.decode(data, { stream: !isEnd })
  }

  SAXStream.prototype.write = function (data) {
    if (
      typeof Buffer === 'function' &&
      typeof Buffer.isBuffer === 'function' &&
      Buffer.isBuffer(data)
    ) {
      data = this._decodeBuffer(data, false)
    } else if (this._decoderBuffer) {
      // Flush any buffered binary prefix before handling a string chunk.
      // This only matters if the caller mixes Buffer and string writes (used in test).
      var remaining = this._decodeBuffer(Buffer.alloc(0), true)
      if (remaining) {
        this._parser.write(remaining)
        this.emit('data', remaining)
      }
    }

    this._parser.write(data.toString())
    this.emit('data', data)
    return true
  }

  SAXStream.prototype.end = function (chunk) {
    if (chunk && chunk.length) {
      this.write(chunk)
    }
    // Flush any remaining decoded data from the TextDecoder
    if (this._decoderBuffer) {
      var finalChunk = this._decodeBuffer(Buffer.alloc(0), true)
      if (finalChunk) {
        this._parser.write(finalChunk)
        this.emit('data', finalChunk)
      }
    } else if (this._decoder) {
      var remaining = this._decoder.decode()
      if (remaining) {
        this._parser.write(remaining)
        this.emit('data', remaining)
      }
    }
    this._parser.end()
    return true
  }

  SAXStream.prototype.on = function (ev, handler) {
    var me = this
    if (!me._parser['on' + ev] && streamWraps.indexOf(ev) !== -1) {
      me._parser['on' + ev] = function () {
        var args =
          arguments.length === 1 ?
            [arguments[0]]
          : Array.apply(null, arguments)
        args.splice(0, 0, ev)
        me.emit.apply(me, args)
      }
    }

    return Stream.prototype.on.call(me, ev, handler)
  }

  // this really needs to be replaced with character classes.
  // XML allows all manner of ridiculous numbers and digits.
  var CDATA = '[CDATA['
  var DOCTYPE = 'DOCTYPE'
  var XML_NAMESPACE = 'http://www.w3.org/XML/1998/namespace'
  var XMLNS_NAMESPACE = 'http://www.w3.org/2000/xmlns/'
  var rootNS = { xml: XML_NAMESPACE, xmlns: XMLNS_NAMESPACE }

  // http://www.w3.org/TR/REC-xml/#NT-NameStartChar
  // This implementation works on strings, a single character at a time
  // as such, it cannot ever support astral-plane characters (10000-EFFFF)
  // without a significant breaking change to either this  parser, or the
  // JavaScript language.  Implementation of an emoji-capable xml parser
  // is left as an exercise for the reader.
  var nameStart =
    /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/

  var nameBody =
    /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/

  var entityStart =
    /[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/
  var entityBody =
    /[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/

  function isWhitespace(c) {
    return c === ' ' || c === '\n' || c === '\r' || c === '\t'
  }

  function isQuote(c) {
    return c === '"' || c === "'"
  }

  function isAttribEnd(c) {
    return c === '>' || isWhitespace(c)
  }

  function isMatch(regex, c) {
    return regex.test(c)
  }

  function notMatch(regex, c) {
    return !isMatch(regex, c)
  }

  var S = 0
  sax.STATE = {
    BEGIN: S++, // leading byte order mark or whitespace
    BEGIN_WHITESPACE: S++, // leading whitespace
    TEXT: S++, // general stuff
    TEXT_ENTITY: S++, // &amp and such.
    OPEN_WAKA: S++, // <
    SGML_DECL: S++, // <!BLARG
    SGML_DECL_QUOTED: S++, // <!BLARG foo "bar
    DOCTYPE: S++, // <!DOCTYPE
    DOCTYPE_QUOTED: S++, // <!DOCTYPE "//blah
    DOCTYPE_DTD: S++, // <!DOCTYPE "//blah" [ ...
    DOCTYPE_DTD_QUOTED: S++, // <!DOCTYPE "//blah" [ "foo
    COMMENT_STARTING: S++, // <!-
    COMMENT: S++, // <!--
    COMMENT_ENDING: S++, // <!-- blah -
    COMMENT_ENDED: S++, // <!-- blah --
    CDATA: S++, // <![CDATA[ something
    CDATA_ENDING: S++, // ]
    CDATA_ENDING_2: S++, // ]]
    PROC_INST: S++, // <?hi
    PROC_INST_BODY: S++, // <?hi there
    PROC_INST_ENDING: S++, // <?hi "there" ?
    OPEN_TAG: S++, // <strong
    OPEN_TAG_SLASH: S++, // <strong /
    ATTRIB: S++, // <a
    ATTRIB_NAME: S++, // <a foo
    ATTRIB_NAME_SAW_WHITE: S++, // <a foo _
    ATTRIB_VALUE: S++, // <a foo=
    ATTRIB_VALUE_QUOTED: S++, // <a foo="bar
    ATTRIB_VALUE_CLOSED: S++, // <a foo="bar"
    ATTRIB_VALUE_UNQUOTED: S++, // <a foo=bar
    ATTRIB_VALUE_ENTITY_Q: S++, // <foo bar="&quot;"
    ATTRIB_VALUE_ENTITY_U: S++, // <foo bar=&quot
    CLOSE_TAG: S++, // </a
    CLOSE_TAG_SAW_WHITE: S++, // </a   >
    SCRIPT: S++, // <script> ...
    SCRIPT_ENDING: S++, // <script> ... <
  }

  sax.XML_ENTITIES = {
    amp: '&',
    gt: '>',
    lt: '<',
    quot: '"',
    apos: "'",
  }

  sax.ENTITIES = {
    amp: '&',
    gt: '>',
    lt: '<',
    quot: '"',
    apos: "'",
    AElig: 198,
    Aacute: 193,
    Acirc: 194,
    Agrave: 192,
    Aring: 197,
    Atilde: 195,
    Auml: 196,
    Ccedil: 199,
    ETH: 208,
    Eacute: 201,
    Ecirc: 202,
    Egrave: 200,
    Euml: 203,
    Iacute: 205,
    Icirc: 206,
    Igrave: 204,
    Iuml: 207,
    Ntilde: 209,
    Oacute: 211,
    Ocirc: 212,
    Ograve: 210,
    Oslash: 216,
    Otilde: 213,
    Ouml: 214,
    THORN: 222,
    Uacute: 218,
    Ucirc: 219,
    Ugrave: 217,
    Uuml: 220,
    Yacute: 221,
    aacute: 225,
    acirc: 226,
    aelig: 230,
    agrave: 224,
    aring: 229,
    atilde: 227,
    auml: 228,
    ccedil: 231,
    eacute: 233,
    ecirc: 234,
    egrave: 232,
    eth: 240,
    euml: 235,
    iacute: 237,
    icirc: 238,
    igrave: 236,
    iuml: 239,
    ntilde: 241,
    oacute: 243,
    ocirc: 244,
    ograve: 242,
    oslash: 248,
    otilde: 245,
    ouml: 246,
    szlig: 223,
    thorn: 254,
    uacute: 250,
    ucirc: 251,
    ugrave: 249,
    uuml: 252,
    yacute: 253,
    yuml: 255,
    copy: 169,
    reg: 174,
    nbsp: 160,
    iexcl: 161,
    cent: 162,
    pound: 163,
    curren: 164,
    yen: 165,
    brvbar: 166,
    sect: 167,
    uml: 168,
    ordf: 170,
    laquo: 171,
    not: 172,
    shy: 173,
    macr: 175,
    deg: 176,
    plusmn: 177,
    sup1: 185,
    sup2: 178,
    sup3: 179,
    acute: 180,
    micro: 181,
    para: 182,
    middot: 183,
    cedil: 184,
    ordm: 186,
    raquo: 187,
    frac14: 188,
    frac12: 189,
    frac34: 190,
    iquest: 191,
    times: 215,
    divide: 247,
    OElig: 338,
    oelig: 339,
    Scaron: 352,
    scaron: 353,
    Yuml: 376,
    fnof: 402,
    circ: 710,
    tilde: 732,
    Alpha: 913,
    Beta: 914,
    Gamma: 915,
    Delta: 916,
    Epsilon: 917,
    Zeta: 918,
    Eta: 919,
    Theta: 920,
    Iota: 921,
    Kappa: 922,
    Lambda: 923,
    Mu: 924,
    Nu: 925,
    Xi: 926,
    Omicron: 927,
    Pi: 928,
    Rho: 929,
    Sigma: 931,
    Tau: 932,
    Upsilon: 933,
    Phi: 934,
    Chi: 935,
    Psi: 936,
    Omega: 937,
    alpha: 945,
    beta: 946,
    gamma: 947,
    delta: 948,
    epsilon: 949,
    zeta: 950,
    eta: 951,
    theta: 952,
    iota: 953,
    kappa: 954,
    lambda: 955,
    mu: 956,
    nu: 957,
    xi: 958,
    omicron: 959,
    pi: 960,
    rho: 961,
    sigmaf: 962,
    sigma: 963,
    tau: 964,
    upsilon: 965,
    phi: 966,
    chi: 967,
    psi: 968,
    omega: 969,
    thetasym: 977,
    upsih: 978,
    piv: 982,
    ensp: 8194,
    emsp: 8195,
    thinsp: 8201,
    zwnj: 8204,
    zwj: 8205,
    lrm: 8206,
    rlm: 8207,
    ndash: 8211,
    mdash: 8212,
    lsquo: 8216,
    rsquo: 8217,
    sbquo: 8218,
    ldquo: 8220,
    rdquo: 8221,
    bdquo: 8222,
    dagger: 8224,
    Dagger: 8225,
    bull: 8226,
    hellip: 8230,
    permil: 8240,
    prime: 8242,
    Prime: 8243,
    lsaquo: 8249,
    rsaquo: 8250,
    oline: 8254,
    frasl: 8260,
    euro: 8364,
    image: 8465,
    weierp: 8472,
    real: 8476,
    trade: 8482,
    alefsym: 8501,
    larr: 8592,
    uarr: 8593,
    rarr: 8594,
    darr: 8595,
    harr: 8596,
    crarr: 8629,
    lArr: 8656,
    uArr: 8657,
    rArr: 8658,
    dArr: 8659,
    hArr: 8660,
    forall: 8704,
    part: 8706,
    exist: 8707,
    empty: 8709,
    nabla: 8711,
    isin: 8712,
    notin: 8713,
    ni: 8715,
    prod: 8719,
    sum: 8721,
    minus: 8722,
    lowast: 8727,
    radic: 8730,
    prop: 8733,
    infin: 8734,
    ang: 8736,
    and: 8743,
    or: 8744,
    cap: 8745,
    cup: 8746,
    int: 8747,
    there4: 8756,
    sim: 8764,
    cong: 8773,
    asymp: 8776,
    ne: 8800,
    equiv: 8801,
    le: 8804,
    ge: 8805,
    sub: 8834,
    sup: 8835,
    nsub: 8836,
    sube: 8838,
    supe: 8839,
    oplus: 8853,
    otimes: 8855,
    perp: 8869,
    sdot: 8901,
    lceil: 8968,
    rceil: 8969,
    lfloor: 8970,
    rfloor: 8971,
    lang: 9001,
    rang: 9002,
    loz: 9674,
    spades: 9824,
    clubs: 9827,
    hearts: 9829,
    diams: 9830,
  }

  Object.keys(sax.ENTITIES).forEach(function (key) {
    var e = sax.ENTITIES[key]
    var s = typeof e === 'number' ? String.fromCharCode(e) : e
    sax.ENTITIES[key] = s
  })

  for (var s in sax.STATE) {
    sax.STATE[sax.STATE[s]] = s
  }

  // shorthand
  S = sax.STATE

  function emit(parser, event, data) {
    parser[event] && parser[event](data)
  }

  function getDeclaredEncoding(body) {
    var match = body && body.match(/(?:^|\s)encoding\s*=\s*(['"])([^'"]+)\1/i)
    return match ? match[2] : null
  }

  function normalizeEncodingName(encoding) {
    if (!encoding) {
      return null
    }

    return encoding.toLowerCase().replace(/[^a-z0-9]/g, '')
  }

  function encodingsMatch(detectedEncoding, declaredEncoding) {
    const detected = normalizeEncodingName(detectedEncoding)
    const declared = normalizeEncodingName(declaredEncoding)

    if (!detected || !declared) {
      return true
    }

    if (declared === 'utf16') {
      return detected === 'utf16le' || detected === 'utf16be'
    }

    return detected === declared
  }

  function validateXmlDeclarationEncoding(parser, data) {
    if (
      !parser.strict ||
      !parser.encoding ||
      !data ||
      data.name !== 'xml'
    ) {
      return
    }

    var declaredEncoding = getDeclaredEncoding(data.body)
    if (
      declaredEncoding &&
      !encodingsMatch(parser.encoding, declaredEncoding)
    ) {
      strictFail(
        parser,
        'XML declaration encoding ' +
          declaredEncoding +
          ' does not match detected stream encoding ' +
          parser.encoding.toUpperCase()
      )
    }
  }

  function emitNode(parser, nodeType, data) {
    if (parser.textNode) closeText(parser)
    emit(parser, nodeType, data)
  }

  function closeText(parser) {
    parser.textNode = textopts(parser.opt, parser.textNode)
    if (parser.textNode) emit(parser, 'ontext', parser.textNode)
    parser.textNode = ''
  }

  function textopts(opt, text) {
    if (opt.trim) text = text.trim()
    if (opt.normalize) text = text.replace(/\s+/g, ' ')
    return text
  }

  function error(parser, er) {
    closeText(parser)
    if (parser.trackPosition) {
      er +=
        '\nLine: ' +
        parser.line +
        '\nColumn: ' +
        parser.column +
        '\nChar: ' +
        parser.c
    }
    er = new Error(er)
    parser.error = er
    emit(parser, 'onerror', er)
    return parser
  }

  function end(parser) {
    if (parser.sawRoot && !parser.closedRoot)
      strictFail(parser, 'Unclosed root tag')
    if (
      parser.state !== S.BEGIN &&
      parser.state !== S.BEGIN_WHITESPACE &&
      parser.state !== S.TEXT
    ) {
      error(parser, 'Unexpected end')
    }
    closeText(parser)
    parser.c = ''
    parser.closed = true
    emit(parser, 'onend')
    SAXParser.call(parser, parser.strict, parser.opt)
    return parser
  }

  function strictFail(parser, message) {
    if (typeof parser !== 'object' || !(parser instanceof SAXParser)) {
      throw new Error('bad call to strictFail')
    }
    if (parser.strict) {
      error(parser, message)
    }
  }

  function newTag(parser) {
    if (!parser.strict) parser.tagName = parser.tagName[parser.looseCase]()
    var parent = parser.tags[parser.tags.length - 1] || parser
    var tag = (parser.tag = { name: parser.tagName, attributes: {} })

    // will be overridden if tag contails an xmlns="foo" or xmlns:foo="bar"
    if (parser.opt.xmlns) {
      tag.ns = parent.ns
    }
    parser.attribList.length = 0
    emitNode(parser, 'onopentagstart', tag)
  }

  function qname(name, attribute) {
    var i = name.indexOf(':')
    var qualName = i < 0 ? ['', name] : name.split(':')
    var prefix = qualName[0]
    var local = qualName[1]

    // <x "xmlns"="http://foo">
    if (attribute && name === 'xmlns') {
      prefix = 'xmlns'
      local = ''
    }

    return { prefix: prefix, local: local }
  }

  function attrib(parser) {
    if (!parser.strict) {
      parser.attribName = parser.attribName[parser.looseCase]()
    }

    if (
      parser.attribList.indexOf(parser.attribName) !== -1 ||
      parser.tag.attributes.hasOwnProperty(parser.attribName)
    ) {
      parser.attribName = parser.attribValue = ''
      return
    }

    if (parser.opt.xmlns) {
      var qn = qname(parser.attribName, true)
      var prefix = qn.prefix
      var local = qn.local

      if (prefix === 'xmlns') {
        // namespace binding attribute. push the binding into scope
        if (local === 'xml' && parser.attribValue !== XML_NAMESPACE) {
          strictFail(
            parser,
            'xml: prefix must be bound to ' +
              XML_NAMESPACE +
              '\n' +
              'Actual: ' +
              parser.attribValue
          )
        } else if (
          local === 'xmlns' &&
          parser.attribValue !== XMLNS_NAMESPACE
        ) {
          strictFail(
            parser,
            'xmlns: prefix must be bound to ' +
              XMLNS_NAMESPACE +
              '\n' +
              'Actual: ' +
              parser.attribValue
          )
        } else {
          var tag = parser.tag
          var parent = parser.tags[parser.tags.length - 1] || parser
          if (tag.ns === parent.ns) {
            tag.ns = Object.create(parent.ns)
          }
          tag.ns[local] = parser.attribValue
        }
      }

      // defer onattribute events until all attributes have been seen
      // so any new bindings can take effect. preserve attribute order
      // so deferred events can be emitted in document order
      parser.attribList.push([parser.attribName, parser.attribValue])
    } else {
      // in non-xmlns mode, we can emit the event right away
      parser.tag.attributes[parser.attribName] = parser.attribValue
      emitNode(parser, 'onattribute', {
        name: parser.attribName,
        value: parser.attribValue,
      })
    }

    parser.attribName = parser.attribValue = ''
  }

  function openTag(parser, selfClosing) {
    if (parser.opt.xmlns) {
      // emit namespace binding events
      var tag = parser.tag

      // add namespace info to tag
      var qn = qname(parser.tagName)
      tag.prefix = qn.prefix
      tag.local = qn.local
      tag.uri = tag.ns[qn.prefix] || ''

      if (tag.prefix && !tag.uri) {
        strictFail(
          parser,
          'Unbound namespace prefix: ' + JSON.stringify(parser.tagName)
        )
        tag.uri = qn.prefix
      }

      var parent = parser.tags[parser.tags.length - 1] || parser
      if (tag.ns && parent.ns !== tag.ns) {
        Object.keys(tag.ns).forEach(function (p) {
          emitNode(parser, 'onopennamespace', {
            prefix: p,
            uri: tag.ns[p],
          })
        })
      }

      // handle deferred onattribute events
      // Note: do not apply default ns to attributes:
      //   http://www.w3.org/TR/REC-xml-names/#defaulting
      for (var i = 0, l = parser.attribList.length; i < l; i++) {
        var nv = parser.attribList[i]
        var name = nv[0]
        var value = nv[1]
        var qualName = qname(name, true)
        var prefix = qualName.prefix
        var local = qualName.local
        var uri = prefix === '' ? '' : tag.ns[prefix] || ''
        var a = {
          name: name,
          value: value,
          prefix: prefix,
          local: local,
          uri: uri,
        }

        // if there's any attributes with an undefined namespace,
        // then fail on them now.
        if (prefix && prefix !== 'xmlns' && !uri) {
          strictFail(
            parser,
            'Unbound namespace prefix: ' + JSON.stringify(prefix)
          )
          a.uri = prefix
        }
        parser.tag.attributes[name] = a
        emitNode(parser, 'onattribute', a)
      }
      parser.attribList.length = 0
    }

    parser.tag.isSelfClosing = !!selfClosing

    // process the tag
    parser.sawRoot = true
    parser.tags.push(parser.tag)
    emitNode(parser, 'onopentag', parser.tag)
    if (!selfClosing) {
      // special case for <script> in non-strict mode.
      if (!parser.noscript && parser.tagName.toLowerCase() === 'script') {
        parser.state = S.SCRIPT
      } else {
        parser.state = S.TEXT
      }
      parser.tag = null
      parser.tagName = ''
    }
    parser.attribName = parser.attribValue = ''
    parser.attribList.length = 0
  }

  function closeTag(parser) {
    if (!parser.tagName) {
      strictFail(parser, 'Weird empty close tag.')
      parser.textNode += '</>'
      parser.state = S.TEXT
      return
    }

    if (parser.script) {
      if (parser.tagName !== 'script') {
        parser.script += '</' + parser.tagName + '>'
        parser.tagName = ''
        parser.state = S.SCRIPT
        return
      }
      emitNode(parser, 'onscript', parser.script)
      parser.script = ''
    }

    // first make sure that the closing tag actually exists.
    // <a><b></c></b></a> will close everything, otherwise.
    var t = parser.tags.length
    var tagName = parser.tagName
    if (!parser.strict) {
      tagName = tagName[parser.looseCase]()
    }
    var closeTo = tagName
    while (t--) {
      var close = parser.tags[t]
      if (close.name !== closeTo) {
        // fail the first time in strict mode
        strictFail(parser, 'Unexpected close tag')
      } else {
        break
      }
    }

    // didn't find it.  we already failed for strict, so just abort.
    if (t < 0) {
      strictFail(parser, 'Unmatched closing tag: ' + parser.tagName)
      parser.textNode += '</' + parser.tagName + '>'
      parser.state = S.TEXT
      return
    }
    parser.tagName = tagName
    var s = parser.tags.length
    while (s-- > t) {
      var tag = (parser.tag = parser.tags.pop())
      parser.tagName = parser.tag.name
      emitNode(parser, 'onclosetag', parser.tagName)

      var x = {}
      for (var i in tag.ns) {
        x[i] = tag.ns[i]
      }

      var parent = parser.tags[parser.tags.length - 1] || parser
      if (parser.opt.xmlns && tag.ns !== parent.ns) {
        // remove namespace bindings introduced by tag
        Object.keys(tag.ns).forEach(function (p) {
          var n = tag.ns[p]
          emitNode(parser, 'onclosenamespace', { prefix: p, uri: n })
        })
      }
    }
    if (t === 0) parser.closedRoot = true
    parser.tagName = parser.attribValue = parser.attribName = ''
    parser.attribList.length = 0
    parser.state = S.TEXT
  }

  function parseEntity(parser) {
    var entity = parser.entity
    var entityLC = entity.toLowerCase()
    var num
    var numStr = ''

    if (parser.ENTITIES[entity]) {
      return parser.ENTITIES[entity]
    }
    if (parser.ENTITIES[entityLC]) {
      return parser.ENTITIES[entityLC]
    }
    entity = entityLC
    if (entity.charAt(0) === '#') {
      if (entity.charAt(1) === 'x') {
        entity = entity.slice(2)
        num = parseInt(entity, 16)
        numStr = num.toString(16)
      } else {
        entity = entity.slice(1)
        num = parseInt(entity, 10)
        numStr = num.toString(10)
      }
    }
    entity = entity.replace(/^0+/, '')
    if (
      isNaN(num) ||
      numStr.toLowerCase() !== entity ||
      num < 0 ||
      num > 0x10ffff
    ) {
      strictFail(parser, 'Invalid character entity')
      return '&' + parser.entity + ';'
    }

    return String.fromCodePoint(num)
  }

  function beginWhiteSpace(parser, c) {
    if (c === '<') {
      parser.state = S.OPEN_WAKA
      parser.startTagPosition = parser.position
    } else if (!isWhitespace(c)) {
      // have to process this as a text node.
      // weird, but happens.
      strictFail(parser, 'Non-whitespace before first tag.')
      parser.textNode = c
      parser.state = S.TEXT
    }
  }

  function charAt(chunk, i) {
    var result = ''
    if (i < chunk.length) {
      result = chunk.charAt(i)
    }
    return result
  }

  function write(chunk) {
    var parser = this
    if (this.error) {
      throw this.error
    }
    if (parser.closed) {
      return error(
        parser,
        'Cannot write after close. Assign an onready handler.'
      )
    }
    if (chunk === null) {
      return end(parser)
    }
    if (typeof chunk === 'object') {
      chunk = chunk.toString()
    }
    var i = 0
    var c = ''
    while (true) {
      c = charAt(chunk, i++)
      parser.c = c

      if (!c) {
        break
      }

      if (parser.trackPosition) {
        parser.position++
        if (c === '\n') {
          parser.line++
          parser.column = 0
        } else {
          parser.column++
        }
      }

      switch (parser.state) {
        case S.BEGIN:
          parser.state = S.BEGIN_WHITESPACE
          if (c === '\uFEFF') {
            continue
          }
          beginWhiteSpace(parser, c)
          continue

        case S.BEGIN_WHITESPACE:
          beginWhiteSpace(parser, c)
          continue

        case S.TEXT:
          if (parser.sawRoot && !parser.closedRoot) {
            var starti = i - 1
            while (c && c !== '<' && c !== '&') {
              c = charAt(chunk, i++)
              if (c && parser.trackPosition) {
                parser.position++
                if (c === '\n') {
                  parser.line++
                  parser.column = 0
                } else {
                  parser.column++
                }
              }
            }
            parser.textNode += chunk.substring(starti, i - 1)
          }
          if (
            c === '<' &&
            !(parser.sawRoot && parser.closedRoot && !parser.strict)
          ) {
            parser.state = S.OPEN_WAKA
            parser.startTagPosition = parser.position
          } else {
            if (
              !isWhitespace(c) &&
              (!parser.sawRoot || parser.closedRoot)
            ) {
              strictFail(parser, 'Text data outside of root node.')
            }
            if (c === '&') {
              parser.state = S.TEXT_ENTITY
            } else {
              parser.textNode += c
            }
          }
          continue

        case S.SCRIPT:
          // only non-strict
          if (c === '<') {
            parser.state = S.SCRIPT_ENDING
          } else {
            parser.script += c
          }
          continue

        case S.SCRIPT_ENDING:
          if (c === '/') {
            parser.state = S.CLOSE_TAG
          } else {
            parser.script += '<' + c
            parser.state = S.SCRIPT
          }
          continue

        case S.OPEN_WAKA:
          // either a /, ?, !, or text is coming next.
          if (c === '!') {
            parser.state = S.SGML_DECL
            parser.sgmlDecl = ''
          } else if (isWhitespace(c)) {
            // wait for it...
          } else if (isMatch(nameStart, c)) {
            parser.state = S.OPEN_TAG
            parser.tagName = c
          } else if (c === '/') {
            parser.state = S.CLOSE_TAG
            parser.tagName = ''
          } else if (c === '?') {
            parser.state = S.PROC_INST
            parser.procInstName = parser.procInstBody = ''
          } else {
            strictFail(parser, 'Unencoded <')
            // if there was some whitespace, then add that in.
            if (parser.startTagPosition + 1 < parser.position) {
              var pad = parser.position - parser.startTagPosition
              c = new Array(pad).join(' ') + c
            }
            parser.textNode += '<' + c
            parser.state = S.TEXT
          }
          continue

        case S.SGML_DECL:
          if (parser.sgmlDecl + c === '--') {
            parser.state = S.COMMENT
            parser.comment = ''
            parser.sgmlDecl = ''
            continue
          }

          if (
            parser.doctype &&
            parser.doctype !== true &&
            parser.sgmlDecl
          ) {
            parser.state = S.DOCTYPE_DTD
            parser.doctype += '<!' + parser.sgmlDecl + c
            parser.sgmlDecl = ''
          } else if ((parser.sgmlDecl + c).toUpperCase() === CDATA) {
            emitNode(parser, 'onopencdata')
            parser.state = S.CDATA
            parser.sgmlDecl = ''
            parser.cdata = ''
          } else if ((parser.sgmlDecl + c).toUpperCase() === DOCTYPE) {
            parser.state = S.DOCTYPE
            if (parser.doctype || parser.sawRoot) {
              strictFail(
                parser,
                'Inappropriately located doctype declaration'
              )
            }
            parser.doctype = ''
            parser.sgmlDecl = ''
          } else if (c === '>') {
            emitNode(parser, 'onsgmldeclaration', parser.sgmlDecl)
            parser.sgmlDecl = ''
            parser.state = S.TEXT
          } else if (isQuote(c)) {
            parser.state = S.SGML_DECL_QUOTED
            parser.sgmlDecl += c
          } else {
            parser.sgmlDecl += c
          }
          continue

        case S.SGML_DECL_QUOTED:
          if (c === parser.q) {
            parser.state = S.SGML_DECL
            parser.q = ''
          }
          parser.sgmlDecl += c
          continue

        case S.DOCTYPE:
          if (c === '>') {
            parser.state = S.TEXT
            emitNode(parser, 'ondoctype', parser.doctype)
            parser.doctype = true // just remember that we saw it.
          } else {
            parser.doctype += c
            if (c === '[') {
              parser.state = S.DOCTYPE_DTD
            } else if (isQuote(c)) {
              parser.state = S.DOCTYPE_QUOTED
              parser.q = c
            }
          }
          continue

        case S.DOCTYPE_QUOTED:
          parser.doctype += c
          if (c === parser.q) {
            parser.q = ''
            parser.state = S.DOCTYPE
          }
          continue

        case S.DOCTYPE_DTD:
          if (c === ']') {
            parser.doctype += c
            parser.state = S.DOCTYPE
          } else if (c === '<') {
            parser.state = S.OPEN_WAKA
            parser.startTagPosition = parser.position
          } else if (isQuote(c)) {
            parser.doctype += c
            parser.state = S.DOCTYPE_DTD_QUOTED
            parser.q = c
          } else {
            parser.doctype += c
          }
          continue

        case S.DOCTYPE_DTD_QUOTED:
          parser.doctype += c
          if (c === parser.q) {
            parser.state = S.DOCTYPE_DTD
            parser.q = ''
          }
          continue

        case S.COMMENT:
          if (c === '-') {
            parser.state = S.COMMENT_ENDING
          } else {
            parser.comment += c
          }
          continue

        case S.COMMENT_ENDING:
          if (c === '-') {
            parser.state = S.COMMENT_ENDED
            parser.comment = textopts(parser.opt, parser.comment)
            if (parser.comment) {
              emitNode(parser, 'oncomment', parser.comment)
            }
            parser.comment = ''
          } else {
            parser.comment += '-' + c
            parser.state = S.COMMENT
          }
          continue

        case S.COMMENT_ENDED:
          if (c !== '>') {
            strictFail(parser, 'Malformed comment')
            // allow <!-- blah -- bloo --> in non-strict mode,
            // which is a comment of " blah -- bloo "
            parser.comment += '--' + c
            parser.state = S.COMMENT
          } else if (parser.doctype && parser.doctype !== true) {
            parser.state = S.DOCTYPE_DTD
          } else {
            parser.state = S.TEXT
          }
          continue

        case S.CDATA:
          var starti = i - 1
          while (c && c !== ']') {
            c = charAt(chunk, i++)
            if (c && parser.trackPosition) {
              parser.position++
              if (c === '\n') {
                parser.line++
                parser.column = 0
              } else {
                parser.column++
              }
            }
          }
          parser.cdata += chunk.substring(starti, i - 1)
          if (c === ']') {
            parser.state = S.CDATA_ENDING
          }
          continue

        case S.CDATA_ENDING:
          if (c === ']') {
            parser.state = S.CDATA_ENDING_2
          } else {
            parser.cdata += ']' + c
            parser.state = S.CDATA
          }
          continue

        case S.CDATA_ENDING_2:
          if (c === '>') {
            if (parser.cdata) {
              emitNode(parser, 'oncdata', parser.cdata)
            }
            emitNode(parser, 'onclosecdata')
            parser.cdata = ''
            parser.state = S.TEXT
          } else if (c === ']') {
            parser.cdata += ']'
          } else {
            parser.cdata += ']]' + c
            parser.state = S.CDATA
          }
          continue

        case S.PROC_INST:
          if (c === '?') {
            parser.state = S.PROC_INST_ENDING
          } else if (isWhitespace(c)) {
            parser.state = S.PROC_INST_BODY
          } else {
            parser.procInstName += c
          }
          continue

        case S.PROC_INST_BODY:
          if (!parser.procInstBody && isWhitespace(c)) {
            continue
          } else if (c === '?') {
            parser.state = S.PROC_INST_ENDING
          } else {
            parser.procInstBody += c
          }
          continue

        case S.PROC_INST_ENDING:
          if (c === '>') {
            const procInstEndData = {
              name: parser.procInstName,
              body: parser.procInstBody,
            }
            validateXmlDeclarationEncoding(parser, procInstEndData)
            emitNode(parser, 'onprocessinginstruction', procInstEndData)
            parser.procInstName = parser.procInstBody = ''
            parser.state = S.TEXT
          } else {
            parser.procInstBody += '?' + c
            parser.state = S.PROC_INST_BODY
          }
          continue

        case S.OPEN_TAG:
          if (isMatch(nameBody, c)) {
            parser.tagName += c
          } else {
            newTag(parser)
            if (c === '>') {
              openTag(parser)
            } else if (c === '/') {
              parser.state = S.OPEN_TAG_SLASH
            } else {
              if (!isWhitespace(c)) {
                strictFail(parser, 'Invalid character in tag name')
              }
              parser.state = S.ATTRIB
            }
          }
          continue

        case S.OPEN_TAG_SLASH:
          if (c === '>') {
            openTag(parser, true)
            closeTag(parser)
          } else {
            strictFail(
              parser,
              'Forward-slash in opening tag not followed by >'
            )
            parser.state = S.ATTRIB
          }
          continue

        case S.ATTRIB:
          // haven't read the attribute name yet.
          if (isWhitespace(c)) {
            continue
          } else if (c === '>') {
            openTag(parser)
          } else if (c === '/') {
            parser.state = S.OPEN_TAG_SLASH
          } else if (isMatch(nameStart, c)) {
            parser.attribName = c
            parser.attribValue = ''
            parser.state = S.ATTRIB_NAME
          } else {
            strictFail(parser, 'Invalid attribute name')
          }
          continue

        case S.ATTRIB_NAME:
          if (c === '=') {
            parser.state = S.ATTRIB_VALUE
          } else if (c === '>') {
            strictFail(parser, 'Attribute without value')
            parser.attribValue = parser.attribName
            attrib(parser)
            openTag(parser)
          } else if (isWhitespace(c)) {
            parser.state = S.ATTRIB_NAME_SAW_WHITE
          } else if (isMatch(nameBody, c)) {
            parser.attribName += c
          } else {
            strictFail(parser, 'Invalid attribute name')
          }
          continue

        case S.ATTRIB_NAME_SAW_WHITE:
          if (c === '=') {
            parser.state = S.ATTRIB_VALUE
          } else if (isWhitespace(c)) {
            continue
          } else {
            strictFail(parser, 'Attribute without value')
            parser.tag.attributes[parser.attribName] = ''
            parser.attribValue = ''
            emitNode(parser, 'onattribute', {
              name: parser.attribName,
              value: '',
            })
            parser.attribName = ''
            if (c === '>') {
              openTag(parser)
            } else if (isMatch(nameStart, c)) {
              parser.attribName = c
              parser.state = S.ATTRIB_NAME
            } else {
              strictFail(parser, 'Invalid attribute name')
              parser.state = S.ATTRIB
            }
          }
          continue

        case S.ATTRIB_VALUE:
          if (isWhitespace(c)) {
            continue
          } else if (isQuote(c)) {
            parser.q = c
            parser.state = S.ATTRIB_VALUE_QUOTED
          } else {
            if (!parser.opt.unquotedAttributeValues) {
              error(parser, 'Unquoted attribute value')
            }
            parser.state = S.ATTRIB_VALUE_UNQUOTED
            parser.attribValue = c
          }
          continue

        case S.ATTRIB_VALUE_QUOTED:
          if (c !== parser.q) {
            if (c === '&') {
              parser.state = S.ATTRIB_VALUE_ENTITY_Q
            } else {
              parser.attribValue += c
            }
            continue
          }
          attrib(parser)
          parser.q = ''
          parser.state = S.ATTRIB_VALUE_CLOSED
          continue

        case S.ATTRIB_VALUE_CLOSED:
          if (isWhitespace(c)) {
            parser.state = S.ATTRIB
          } else if (c === '>') {
            openTag(parser)
          } else if (c === '/') {
            parser.state = S.OPEN_TAG_SLASH
          } else if (isMatch(nameStart, c)) {
            strictFail(parser, 'No whitespace between attributes')
            parser.attribName = c
            parser.attribValue = ''
            parser.state = S.ATTRIB_NAME
          } else {
            strictFail(parser, 'Invalid attribute name')
          }
          continue

        case S.ATTRIB_VALUE_UNQUOTED:
          if (!isAttribEnd(c)) {
            if (c === '&') {
              parser.state = S.ATTRIB_VALUE_ENTITY_U
            } else {
              parser.attribValue += c
            }
            continue
          }
          attrib(parser)
          if (c === '>') {
            openTag(parser)
          } else {
            parser.state = S.ATTRIB
          }
          continue

        case S.CLOSE_TAG:
          if (!parser.tagName) {
            if (isWhitespace(c)) {
              continue
            } else if (notMatch(nameStart, c)) {
              if (parser.script) {
                parser.script += '</' + c
                parser.state = S.SCRIPT
              } else {
                strictFail(parser, 'Invalid tagname in closing tag.')
              }
            } else {
              parser.tagName = c
            }
          } else if (c === '>') {
            closeTag(parser)
          } else if (isMatch(nameBody, c)) {
            parser.tagName += c
          } else if (parser.script) {
            parser.script += '</' + parser.tagName + c
            parser.tagName = ''
            parser.state = S.SCRIPT
          } else {
            if (!isWhitespace(c)) {
              strictFail(parser, 'Invalid tagname in closing tag')
            }
            parser.state = S.CLOSE_TAG_SAW_WHITE
          }
          continue

        case S.CLOSE_TAG_SAW_WHITE:
          if (isWhitespace(c)) {
            continue
          }
          if (c === '>') {
            closeTag(parser)
          } else {
            strictFail(parser, 'Invalid characters in closing tag')
          }
          continue

        case S.TEXT_ENTITY:
        case S.ATTRIB_VALUE_ENTITY_Q:
        case S.ATTRIB_VALUE_ENTITY_U:
          var returnState
          var buffer
          switch (parser.state) {
            case S.TEXT_ENTITY:
              returnState = S.TEXT
              buffer = 'textNode'
              break

            case S.ATTRIB_VALUE_ENTITY_Q:
              returnState = S.ATTRIB_VALUE_QUOTED
              buffer = 'attribValue'
              break

            case S.ATTRIB_VALUE_ENTITY_U:
              returnState = S.ATTRIB_VALUE_UNQUOTED
              buffer = 'attribValue'
              break
          }

          if (c === ';') {
            var parsedEntity = parseEntity(parser)
            if (
              parser.opt.unparsedEntities &&
              !Object.values(sax.XML_ENTITIES).includes(parsedEntity)
            ) {
              if ((parser.entityCount += 1) > parser.opt.maxEntityCount) {
                error(
                  parser,
                  'Parsed entity count exceeds max entity count'
                )
              }

              if ((parser.entityDepth += 1) > parser.opt.maxEntityDepth) {
                error(
                  parser,
                  'Parsed entity depth exceeds max entity depth'
                )
              }

              parser.entity = ''
              parser.state = returnState
              parser.write(parsedEntity)
              parser.entityDepth -= 1
            } else {
              parser[buffer] += parsedEntity
              parser.entity = ''
              parser.state = returnState
            }
          } else if (
            isMatch(parser.entity.length ? entityBody : entityStart, c)
          ) {
            parser.entity += c
          } else {
            strictFail(parser, 'Invalid character in entity name')
            parser[buffer] += '&' + parser.entity + c
            parser.entity = ''
            parser.state = returnState
          }

          continue

        default: /* istanbul ignore next */ {
          throw new Error(parser, 'Unknown state: ' + parser.state)
        }
      }
    } // while

    if (parser.position >= parser.bufferCheckPosition) {
      checkBufferLength(parser)
    }
    return parser
  }

  /*! http://mths.be/fromcodepoint v0.1.0 by @mathias */
  /* istanbul ignore next */
  if (!String.fromCodePoint) {
    ;(function () {
      var stringFromCharCode = String.fromCharCode
      var floor = Math.floor
      var fromCodePoint = function () {
        var MAX_SIZE = 0x4000
        var codeUnits = []
        var highSurrogate
        var lowSurrogate
        var index = -1
        var length = arguments.length
        if (!length) {
          return ''
        }
        var result = ''
        while (++index < length) {
          var codePoint = Number(arguments[index])
          if (
            !isFinite(codePoint) || // `NaN`, `+Infinity`, or `-Infinity`
            codePoint < 0 || // not a valid Unicode code point
            codePoint > 0x10ffff || // not a valid Unicode code point
            floor(codePoint) !== codePoint // not an integer
          ) {
            throw RangeError('Invalid code point: ' + codePoint)
          }
          if (codePoint <= 0xffff) {
            // BMP code point
            codeUnits.push(codePoint)
          } else {
            // Astral code point; split in surrogate halves
            // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
            codePoint -= 0x10000
            highSurrogate = (codePoint >> 10) + 0xd800
            lowSurrogate = (codePoint % 0x400) + 0xdc00
            codeUnits.push(highSurrogate, lowSurrogate)
          }
          if (index + 1 === length || codeUnits.length > MAX_SIZE) {
            result += stringFromCharCode.apply(null, codeUnits)
            codeUnits.length = 0
          }
        }
        return result
      }
      /* istanbul ignore next */
      if (Object.defineProperty) {
        Object.defineProperty(String, 'fromCodePoint', {
          value: fromCodePoint,
          configurable: true,
          writable: true,
        })
      } else {
        String.fromCodePoint = fromCodePoint
      }
    })()
  }
})(typeof exports === 'undefined' ? (this.sax = {}) : exports)
{
  "name": "sax",
  "description": "An evented streaming XML parser in JavaScript",
  "author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)",
  "version": "1.6.0",
  "main": "lib/sax.js",
  "license": "BlueOak-1.0.0",
  "repository": {
    "type": "git",
    "url": "git+ssh://git@github.com/isaacs/sax-js.git"
  },
  "files": [
    "lib/sax.js",
    "LICENSE",
    "README.md"
  ],
  "devDependencies": {
    "prettier": "^3.6.2",
    "tap": "^21.1.3"
  },
  "tap": {
    "allow-incomplete-coverage": true
  },
  "engines": {
    "node": ">=11.0.0"
  }
}The ISC License

Copyright (c) Isaac Z. Schlueter and Contributors

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#!/usr/bin/env node
// Standalone semver comparison program.
// Exits successfully and prints matching version(s) if
// any supplied version is valid and passes all tests.

'use strict'

const argv = process.argv.slice(2)

let versions = []

const range = []

let inc = null

const version = require('../package.json').version

let loose = false

let includePrerelease = false

let coerce = false

let rtl = false

let identifier

let identifierBase

const semver = require('../')
const parseOptions = require('../internal/parse-options')

let reverse = false

let options = {}

const main = () => {
  if (!argv.length) {
    return help()
  }
  while (argv.length) {
    let a = argv.shift()
    const indexOfEqualSign = a.indexOf('=')
    if (indexOfEqualSign !== -1) {
      const value = a.slice(indexOfEqualSign + 1)
      a = a.slice(0, indexOfEqualSign)
      argv.unshift(value)
    }
    switch (a) {
      case '-rv': case '-rev': case '--rev': case '--reverse':
        reverse = true
        break
      case '-l': case '--loose':
        loose = true
        break
      case '-p': case '--include-prerelease':
        includePrerelease = true
        break
      case '-v': case '--version':
        versions.push(argv.shift())
        break
      case '-i': case '--inc': case '--increment':
        switch (argv[0]) {
          case 'major': case 'minor': case 'patch': case 'prerelease':
          case 'premajor': case 'preminor': case 'prepatch':
          case 'release':
            inc = argv.shift()
            break
          default:
            inc = 'patch'
            break
        }
        break
      case '--preid':
        identifier = argv.shift()
        break
      case '-r': case '--range':
        range.push(argv.shift())
        break
      case '-n':
        identifierBase = argv.shift()
        if (identifierBase === 'false') {
          identifierBase = false
        }
        break
      case '-c': case '--coerce':
        coerce = true
        break
      case '--rtl':
        rtl = true
        break
      case '--ltr':
        rtl = false
        break
      case '-h': case '--help': case '-?':
        return help()
      default:
        versions.push(a)
        break
    }
  }

  options = parseOptions({ loose, includePrerelease, rtl })

  versions = versions.map((v) => {
    return coerce ? (semver.coerce(v, options) || { version: v }).version : v
  }).filter((v) => {
    return semver.valid(v, options)
  })
  if (!versions.length) {
    return fail()
  }
  if (inc && (versions.length !== 1 || range.length)) {
    return failInc()
  }

  for (let i = 0, l = range.length; i < l; i++) {
    versions = versions.filter((v) => {
      return semver.satisfies(v, range[i], options)
    })
    if (!versions.length) {
      return fail()
    }
  }
  versions
    .sort((a, b) => semver[reverse ? 'rcompare' : 'compare'](a, b, options))
    .map(v => semver.clean(v, options))
    .map(v => inc ? semver.inc(v, inc, options, identifier, identifierBase) : v)
    .forEach(v => console.log(v))
}

const failInc = () => {
  console.error('--inc can only be used on a single version with no range')
  fail()
}

const fail = () => process.exit(1)

const help = () => console.log(
`SemVer ${version}

A JavaScript implementation of the https://semver.org/ specification
Copyright Isaac Z. Schlueter

Usage: semver [options] <version> [<version> [...]]
Prints valid versions sorted by SemVer precedence

Options:
-r --range <range>
        Print versions that match the specified range.

-i --increment [<level>]
        Increment a version by the specified level.  Level can
        be one of: major, minor, patch, premajor, preminor,
        prepatch, prerelease, or release.  Default level is 'patch'.
        Only one version may be specified.

--preid <identifier>
        Identifier to be used to prefix premajor, preminor,
        prepatch or prerelease version increments.

-l --loose
        Interpret versions and ranges loosely

-p --include-prerelease
        Always include prerelease versions in range matching

-c --coerce
        Coerce a string into SemVer if possible
        (does not imply --loose)

--rtl
        Coerce version strings right to left

--ltr
        Coerce version strings left to right (default)

-n <base>
        Base number to be used for the prerelease identifier.
        Can be either 0 or 1, or false to omit the number altogether.
        Defaults to 0.

Program exits successfully if any valid version satisfies
all supplied ranges, and prints all satisfying versions.

If no satisfying versions are found, then exits failure.

Versions are printed in ascending order, so supplying
multiple versions to the utility will just sort them.`)

main()
'use strict'

const ANY = Symbol('SemVer ANY')
// hoisted class for cyclic dependency
class Comparator {
  static get ANY () {
    return ANY
  }

  constructor (comp, options) {
    options = parseOptions(options)

    if (comp instanceof Comparator) {
      if (comp.loose === !!options.loose) {
        return comp
      } else {
        comp = comp.value
      }
    }

    comp = comp.trim().split(/\s+/).join(' ')
    debug('comparator', comp, options)
    this.options = options
    this.loose = !!options.loose
    this.parse(comp)

    if (this.semver === ANY) {
      this.value = ''
    } else {
      this.value = this.operator + this.semver.version
    }

    debug('comp', this)
  }

  parse (comp) {
    const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]
    const m = comp.match(r)

    if (!m) {
      throw new TypeError(`Invalid comparator: ${comp}`)
    }

    this.operator = m[1] !== undefined ? m[1] : ''
    if (this.operator === '=') {
      this.operator = ''
    }

    // if it literally is just '>' or '' then allow anything.
    if (!m[2]) {
      this.semver = ANY
    } else {
      this.semver = new SemVer(m[2], this.options.loose)
    }
  }

  toString () {
    return this.value
  }

  test (version) {
    debug('Comparator.test', version, this.options.loose)

    if (this.semver === ANY || version === ANY) {
      return true
    }

    if (typeof version === 'string') {
      try {
        version = new SemVer(version, this.options)
      } catch (er) {
        return false
      }
    }

    return cmp(version, this.operator, this.semver, this.options)
  }

  intersects (comp, options) {
    if (!(comp instanceof Comparator)) {
      throw new TypeError('a Comparator is required')
    }

    if (this.operator === '') {
      if (this.value === '') {
        return true
      }
      return new Range(comp.value, options).test(this.value)
    } else if (comp.operator === '') {
      if (comp.value === '') {
        return true
      }
      return new Range(this.value, options).test(comp.semver)
    }

    options = parseOptions(options)

    // Special cases where nothing can possibly be lower
    if (options.includePrerelease &&
      (this.value === '<0.0.0-0' || comp.value === '<0.0.0-0')) {
      return false
    }
    if (!options.includePrerelease &&
      (this.value.startsWith('<0.0.0') || comp.value.startsWith('<0.0.0'))) {
      return false
    }

    // Same direction increasing (> or >=)
    if (this.operator.startsWith('>') && comp.operator.startsWith('>')) {
      return true
    }
    // Same direction decreasing (< or <=)
    if (this.operator.startsWith('<') && comp.operator.startsWith('<')) {
      return true
    }
    // same SemVer and both sides are inclusive (<= or >=)
    if (
      (this.semver.version === comp.semver.version) &&
      this.operator.includes('=') && comp.operator.includes('=')) {
      return true
    }
    // opposite directions less than
    if (cmp(this.semver, '<', comp.semver, options) &&
      this.operator.startsWith('>') && comp.operator.startsWith('<')) {
      return true
    }
    // opposite directions greater than
    if (cmp(this.semver, '>', comp.semver, options) &&
      this.operator.startsWith('<') && comp.operator.startsWith('>')) {
      return true
    }
    return false
  }
}

module.exports = Comparator

const parseOptions = require('../internal/parse-options')
const { safeRe: re, t } = require('../internal/re')
const cmp = require('../functions/cmp')
const debug = require('../internal/debug')
const SemVer = require('./semver')
const Range = require('./range')
'use strict'

module.exports = {
  SemVer: require('./semver.js'),
  Range: require('./range.js'),
  Comparator: require('./comparator.js'),
}
'use strict'

const SPACE_CHARACTERS = /\s+/g

// hoisted class for cyclic dependency
class Range {
  constructor (range, options) {
    options = parseOptions(options)

    if (range instanceof Range) {
      if (
        range.loose === !!options.loose &&
        range.includePrerelease === !!options.includePrerelease
      ) {
        return range
      } else {
        return new Range(range.raw, options)
      }
    }

    if (range instanceof Comparator) {
      // just put it in the set and return
      this.raw = range.value
      this.set = [[range]]
      this.formatted = undefined
      return this
    }

    this.options = options
    this.loose = !!options.loose
    this.includePrerelease = !!options.includePrerelease

    // First reduce all whitespace as much as possible so we do not have to rely
    // on potentially slow regexes like \s*. This is then stored and used for
    // future error messages as well.
    this.raw = range.trim().replace(SPACE_CHARACTERS, ' ')

    // First, split on ||
    this.set = this.raw
      .split('||')
      // map the range to a 2d array of comparators
      .map(r => this.parseRange(r.trim()))
      // throw out any comparator lists that are empty
      // this generally means that it was not a valid range, which is allowed
      // in loose mode, but will still throw if the WHOLE range is invalid.
      .filter(c => c.length)

    if (!this.set.length) {
      throw new TypeError(`Invalid SemVer Range: ${this.raw}`)
    }

    // if we have any that are not the null set, throw out null sets.
    if (this.set.length > 1) {
      // keep the first one, in case they're all null sets
      const first = this.set[0]
      this.set = this.set.filter(c => !isNullSet(c[0]))
      if (this.set.length === 0) {
        this.set = [first]
      } else if (this.set.length > 1) {
        // if we have any that are *, then the range is just *
        for (const c of this.set) {
          if (c.length === 1 && isAny(c[0])) {
            this.set = [c]
            break
          }
        }
      }
    }

    this.formatted = undefined
  }

  get range () {
    if (this.formatted === undefined) {
      this.formatted = ''
      for (let i = 0; i < this.set.length; i++) {
        if (i > 0) {
          this.formatted += '||'
        }
        const comps = this.set[i]
        for (let k = 0; k < comps.length; k++) {
          if (k > 0) {
            this.formatted += ' '
          }
          this.formatted += comps[k].toString().trim()
        }
      }
    }
    return this.formatted
  }

  format () {
    return this.range
  }

  toString () {
    return this.range
  }

  parseRange (range) {
    // memoize range parsing for performance.
    // this is a very hot path, and fully deterministic.
    const memoOpts =
      (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) |
      (this.options.loose && FLAG_LOOSE)
    const memoKey = memoOpts + ':' + range
    const cached = cache.get(memoKey)
    if (cached) {
      return cached
    }

    const loose = this.options.loose
    // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
    const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE]
    range = range.replace(hr, hyphenReplace(this.options.includePrerelease))
    debug('hyphen replace', range)

    // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
    range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace)
    debug('comparator trim', range)

    // `~ 1.2.3` => `~1.2.3`
    range = range.replace(re[t.TILDETRIM], tildeTrimReplace)
    debug('tilde trim', range)

    // `^ 1.2.3` => `^1.2.3`
    range = range.replace(re[t.CARETTRIM], caretTrimReplace)
    debug('caret trim', range)

    // At this point, the range is completely trimmed and
    // ready to be split into comparators.

    let rangeList = range
      .split(' ')
      .map(comp => parseComparator(comp, this.options))
      .join(' ')
      .split(/\s+/)
      // >=0.0.0 is equivalent to *
      .map(comp => replaceGTE0(comp, this.options))

    if (loose) {
      // in loose mode, throw out any that are not valid comparators
      rangeList = rangeList.filter(comp => {
        debug('loose invalid filter', comp, this.options)
        return !!comp.match(re[t.COMPARATORLOOSE])
      })
    }
    debug('range list', rangeList)

    // if any comparators are the null set, then replace with JUST null set
    // if more than one comparator, remove any * comparators
    // also, don't include the same comparator more than once
    const rangeMap = new Map()
    const comparators = rangeList.map(comp => new Comparator(comp, this.options))
    for (const comp of comparators) {
      if (isNullSet(comp)) {
        return [comp]
      }
      rangeMap.set(comp.value, comp)
    }
    if (rangeMap.size > 1 && rangeMap.has('')) {
      rangeMap.delete('')
    }

    const result = [...rangeMap.values()]
    cache.set(memoKey, result)
    return result
  }

  intersects (range, options) {
    if (!(range instanceof Range)) {
      throw new TypeError('a Range is required')
    }

    return this.set.some((thisComparators) => {
      return (
        isSatisfiable(thisComparators, options) &&
        range.set.some((rangeComparators) => {
          return (
            isSatisfiable(rangeComparators, options) &&
            thisComparators.every((thisComparator) => {
              return rangeComparators.every((rangeComparator) => {
                return thisComparator.intersects(rangeComparator, options)
              })
            })
          )
        })
      )
    })
  }

  // if ANY of the sets match ALL of its comparators, then pass
  test (version) {
    if (!version) {
      return false
    }

    if (typeof version === 'string') {
      try {
        version = new SemVer(version, this.options)
      } catch (er) {
        return false
      }
    }

    for (let i = 0; i < this.set.length; i++) {
      if (testSet(this.set[i], version, this.options)) {
        return true
      }
    }
    return false
  }
}

module.exports = Range

const LRU = require('../internal/lrucache')
const cache = new LRU()

const parseOptions = require('../internal/parse-options')
const Comparator = require('./comparator')
const debug = require('../internal/debug')
const SemVer = require('./semver')
const {
  safeRe: re,
  t,
  comparatorTrimReplace,
  tildeTrimReplace,
  caretTrimReplace,
} = require('../internal/re')
const { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require('../internal/constants')

const isNullSet = c => c.value === '<0.0.0-0'
const isAny = c => c.value === ''

// take a set of comparators and determine whether there
// exists a version which can satisfy it
const isSatisfiable = (comparators, options) => {
  let result = true
  const remainingComparators = comparators.slice()
  let testComparator = remainingComparators.pop()

  while (result && remainingComparators.length) {
    result = remainingComparators.every((otherComparator) => {
      return testComparator.intersects(otherComparator, options)
    })

    testComparator = remainingComparators.pop()
  }

  return result
}

// comprised of xranges, tildes, stars, and gtlt's at this point.
// already replaced the hyphen ranges
// turn into a set of JUST comparators.
const parseComparator = (comp, options) => {
  comp = comp.replace(re[t.BUILD], '')
  debug('comp', comp, options)
  comp = replaceCarets(comp, options)
  debug('caret', comp)
  comp = replaceTildes(comp, options)
  debug('tildes', comp)
  comp = replaceXRanges(comp, options)
  debug('xrange', comp)
  comp = replaceStars(comp, options)
  debug('stars', comp)
  return comp
}

const isX = id => !id || id.toLowerCase() === 'x' || id === '*'

// ~, ~> --> * (any, kinda silly)
// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0-0
// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0-0
// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0-0
// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0-0
// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0-0
// ~0.0.1 --> >=0.0.1 <0.1.0-0
const replaceTildes = (comp, options) => {
  return comp
    .trim()
    .split(/\s+/)
    .map((c) => replaceTilde(c, options))
    .join(' ')
}

const replaceTilde = (comp, options) => {
  const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE]
  return comp.replace(r, (_, M, m, p, pr) => {
    debug('tilde', comp, _, M, m, p, pr)
    let ret

    if (isX(M)) {
      ret = ''
    } else if (isX(m)) {
      ret = `>=${M}.0.0 <${+M + 1}.0.0-0`
    } else if (isX(p)) {
      // ~1.2 == >=1.2.0 <1.3.0-0
      ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0`
    } else if (pr) {
      debug('replaceTilde pr', pr)
      ret = `>=${M}.${m}.${p}-${pr
      } <${M}.${+m + 1}.0-0`
    } else {
      // ~1.2.3 == >=1.2.3 <1.3.0-0
      ret = `>=${M}.${m}.${p
      } <${M}.${+m + 1}.0-0`
    }

    debug('tilde return', ret)
    return ret
  })
}

// ^ --> * (any, kinda silly)
// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0-0
// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0-0
// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0-0
// ^1.2.3 --> >=1.2.3 <2.0.0-0
// ^1.2.0 --> >=1.2.0 <2.0.0-0
// ^0.0.1 --> >=0.0.1 <0.0.2-0
// ^0.1.0 --> >=0.1.0 <0.2.0-0
const replaceCarets = (comp, options) => {
  return comp
    .trim()
    .split(/\s+/)
    .map((c) => replaceCaret(c, options))
    .join(' ')
}

const replaceCaret = (comp, options) => {
  debug('caret', comp, options)
  const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET]
  const z = options.includePrerelease ? '-0' : ''
  return comp.replace(r, (_, M, m, p, pr) => {
    debug('caret', comp, _, M, m, p, pr)
    let ret

    if (isX(M)) {
      ret = ''
    } else if (isX(m)) {
      ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`
    } else if (isX(p)) {
      if (M === '0') {
        ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`
      } else {
        ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`
      }
    } else if (pr) {
      debug('replaceCaret pr', pr)
      if (M === '0') {
        if (m === '0') {
          ret = `>=${M}.${m}.${p}-${pr
          } <${M}.${m}.${+p + 1}-0`
        } else {
          ret = `>=${M}.${m}.${p}-${pr
          } <${M}.${+m + 1}.0-0`
        }
      } else {
        ret = `>=${M}.${m}.${p}-${pr
        } <${+M + 1}.0.0-0`
      }
    } else {
      debug('no pr')
      if (M === '0') {
        if (m === '0') {
          ret = `>=${M}.${m}.${p
          }${z} <${M}.${m}.${+p + 1}-0`
        } else {
          ret = `>=${M}.${m}.${p
          }${z} <${M}.${+m + 1}.0-0`
        }
      } else {
        ret = `>=${M}.${m}.${p
        } <${+M + 1}.0.0-0`
      }
    }

    debug('caret return', ret)
    return ret
  })
}

const replaceXRanges = (comp, options) => {
  debug('replaceXRanges', comp, options)
  return comp
    .split(/\s+/)
    .map((c) => replaceXRange(c, options))
    .join(' ')
}

const replaceXRange = (comp, options) => {
  comp = comp.trim()
  const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE]
  return comp.replace(r, (ret, gtlt, M, m, p, pr) => {
    debug('xRange', comp, ret, gtlt, M, m, p, pr)
    const xM = isX(M)
    const xm = xM || isX(m)
    const xp = xm || isX(p)
    const anyX = xp

    if (gtlt === '=' && anyX) {
      gtlt = ''
    }

    // if we're including prereleases in the match, then we need
    // to fix this to -0, the lowest possible prerelease value
    pr = options.includePrerelease ? '-0' : ''

    if (xM) {
      if (gtlt === '>' || gtlt === '<') {
        // nothing is allowed
        ret = '<0.0.0-0'
      } else {
        // nothing is forbidden
        ret = '*'
      }
    } else if (gtlt && anyX) {
      // we know patch is an x, because we have any x at all.
      // replace X with 0
      if (xm) {
        m = 0
      }
      p = 0

      if (gtlt === '>') {
        // >1 => >=2.0.0
        // >1.2 => >=1.3.0
        gtlt = '>='
        if (xm) {
          M = +M + 1
          m = 0
          p = 0
        } else {
          m = +m + 1
          p = 0
        }
      } else if (gtlt === '<=') {
        // <=0.7.x is actually <0.8.0, since any 0.7.x should
        // pass.  Similarly, <=7.x is actually <8.0.0, etc.
        gtlt = '<'
        if (xm) {
          M = +M + 1
        } else {
          m = +m + 1
        }
      }

      if (gtlt === '<') {
        pr = '-0'
      }

      ret = `${gtlt + M}.${m}.${p}${pr}`
    } else if (xm) {
      ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`
    } else if (xp) {
      ret = `>=${M}.${m}.0${pr
      } <${M}.${+m + 1}.0-0`
    }

    debug('xRange return', ret)

    return ret
  })
}

// Because * is AND-ed with everything else in the comparator,
// and '' means "any version", just remove the *s entirely.
const replaceStars = (comp, options) => {
  debug('replaceStars', comp, options)
  // Looseness is ignored here.  star is always as loose as it gets!
  return comp
    .trim()
    .replace(re[t.STAR], '')
}

const replaceGTE0 = (comp, options) => {
  debug('replaceGTE0', comp, options)
  return comp
    .trim()
    .replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], '')
}

// This function is passed to string.replace(re[t.HYPHENRANGE])
// M, m, patch, prerelease, build
// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
// 1.2.3 - 3.4 => >=1.2.0 <3.5.0-0 Any 3.4.x will do
// 1.2 - 3.4 => >=1.2.0 <3.5.0-0
// TODO build?
const hyphenReplace = incPr => ($0,
  from, fM, fm, fp, fpr, fb,
  to, tM, tm, tp, tpr) => {
  if (isX(fM)) {
    from = ''
  } else if (isX(fm)) {
    from = `>=${fM}.0.0${incPr ? '-0' : ''}`
  } else if (isX(fp)) {
    from = `>=${fM}.${fm}.0${incPr ? '-0' : ''}`
  } else if (fpr) {
    from = `>=${from}`
  } else {
    from = `>=${from}${incPr ? '-0' : ''}`
  }

  if (isX(tM)) {
    to = ''
  } else if (isX(tm)) {
    to = `<${+tM + 1}.0.0-0`
  } else if (isX(tp)) {
    to = `<${tM}.${+tm + 1}.0-0`
  } else if (tpr) {
    to = `<=${tM}.${tm}.${tp}-${tpr}`
  } else if (incPr) {
    to = `<${tM}.${tm}.${+tp + 1}-0`
  } else {
    to = `<=${to}`
  }

  return `${from} ${to}`.trim()
}

const testSet = (set, version, options) => {
  for (let i = 0; i < set.length; i++) {
    if (!set[i].test(version)) {
      return false
    }
  }

  if (version.prerelease.length && !options.includePrerelease) {
    // Find the set of versions that are allowed to have prereleases
    // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0
    // That should allow `1.2.3-pr.2` to pass.
    // However, `1.2.4-alpha.notready` should NOT be allowed,
    // even though it's within the range set by the comparators.
    for (let i = 0; i < set.length; i++) {
      debug(set[i].semver)
      if (set[i].semver === Comparator.ANY) {
        continue
      }

      if (set[i].semver.prerelease.length > 0) {
        const allowed = set[i].semver
        if (allowed.major === version.major &&
            allowed.minor === version.minor &&
            allowed.patch === version.patch) {
          return true
        }
      }
    }

    // Version has a -pre, but it's not one of the ones we like.
    return false
  }

  return true
}
'use strict'

const debug = require('../internal/debug')
const { MAX_LENGTH, MAX_SAFE_INTEGER } = require('../internal/constants')
const { safeRe: re, t } = require('../internal/re')

const parseOptions = require('../internal/parse-options')
const { compareIdentifiers } = require('../internal/identifiers')
class SemVer {
  constructor (version, options) {
    options = parseOptions(options)

    if (version instanceof SemVer) {
      if (version.loose === !!options.loose &&
        version.includePrerelease === !!options.includePrerelease) {
        return version
      } else {
        version = version.version
      }
    } else if (typeof version !== 'string') {
      throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version}".`)
    }

    if (version.length > MAX_LENGTH) {
      throw new TypeError(
        `version is longer than ${MAX_LENGTH} characters`
      )
    }

    debug('SemVer', version, options)
    this.options = options
    this.loose = !!options.loose
    // this isn't actually relevant for versions, but keep it so that we
    // don't run into trouble passing this.options around.
    this.includePrerelease = !!options.includePrerelease

    const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL])

    if (!m) {
      throw new TypeError(`Invalid Version: ${version}`)
    }

    this.raw = version

    // these are actually numbers
    this.major = +m[1]
    this.minor = +m[2]
    this.patch = +m[3]

    if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
      throw new TypeError('Invalid major version')
    }

    if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
      throw new TypeError('Invalid minor version')
    }

    if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
      throw new TypeError('Invalid patch version')
    }

    // numberify any prerelease numeric ids
    if (!m[4]) {
      this.prerelease = []
    } else {
      this.prerelease = m[4].split('.').map((id) => {
        if (/^[0-9]+$/.test(id)) {
          const num = +id
          if (num >= 0 && num < MAX_SAFE_INTEGER) {
            return num
          }
        }
        return id
      })
    }

    this.build = m[5] ? m[5].split('.') : []
    this.format()
  }

  format () {
    this.version = `${this.major}.${this.minor}.${this.patch}`
    if (this.prerelease.length) {
      this.version += `-${this.prerelease.join('.')}`
    }
    return this.version
  }

  toString () {
    return this.version
  }

  compare (other) {
    debug('SemVer.compare', this.version, this.options, other)
    if (!(other instanceof SemVer)) {
      if (typeof other === 'string' && other === this.version) {
        return 0
      }
      other = new SemVer(other, this.options)
    }

    if (other.version === this.version) {
      return 0
    }

    return this.compareMain(other) || this.comparePre(other)
  }

  compareMain (other) {
    if (!(other instanceof SemVer)) {
      other = new SemVer(other, this.options)
    }

    if (this.major < other.major) {
      return -1
    }
    if (this.major > other.major) {
      return 1
    }
    if (this.minor < other.minor) {
      return -1
    }
    if (this.minor > other.minor) {
      return 1
    }
    if (this.patch < other.patch) {
      return -1
    }
    if (this.patch > other.patch) {
      return 1
    }
    return 0
  }

  comparePre (other) {
    if (!(other instanceof SemVer)) {
      other = new SemVer(other, this.options)
    }

    // NOT having a prerelease is > having one
    if (this.prerelease.length && !other.prerelease.length) {
      return -1
    } else if (!this.prerelease.length && other.prerelease.length) {
      return 1
    } else if (!this.prerelease.length && !other.prerelease.length) {
      return 0
    }

    let i = 0
    do {
      const a = this.prerelease[i]
      const b = other.prerelease[i]
      debug('prerelease compare', i, a, b)
      if (a === undefined && b === undefined) {
        return 0
      } else if (b === undefined) {
        return 1
      } else if (a === undefined) {
        return -1
      } else if (a === b) {
        continue
      } else {
        return compareIdentifiers(a, b)
      }
    } while (++i)
  }

  compareBuild (other) {
    if (!(other instanceof SemVer)) {
      other = new SemVer(other, this.options)
    }

    let i = 0
    do {
      const a = this.build[i]
      const b = other.build[i]
      debug('build compare', i, a, b)
      if (a === undefined && b === undefined) {
        return 0
      } else if (b === undefined) {
        return 1
      } else if (a === undefined) {
        return -1
      } else if (a === b) {
        continue
      } else {
        return compareIdentifiers(a, b)
      }
    } while (++i)
  }

  // preminor will bump the version up to the next minor release, and immediately
  // down to pre-release. premajor and prepatch work the same way.
  inc (release, identifier, identifierBase) {
    if (release.startsWith('pre')) {
      if (!identifier && identifierBase === false) {
        throw new Error('invalid increment argument: identifier is empty')
      }
      // Avoid an invalid semver results
      if (identifier) {
        const match = `-${identifier}`.match(this.options.loose ? re[t.PRERELEASELOOSE] : re[t.PRERELEASE])
        if (!match || match[1] !== identifier) {
          throw new Error(`invalid identifier: ${identifier}`)
        }
      }
    }

    switch (release) {
      case 'premajor':
        this.prerelease.length = 0
        this.patch = 0
        this.minor = 0
        this.major++
        this.inc('pre', identifier, identifierBase)
        break
      case 'preminor':
        this.prerelease.length = 0
        this.patch = 0
        this.minor++
        this.inc('pre', identifier, identifierBase)
        break
      case 'prepatch':
        // If this is already a prerelease, it will bump to the next version
        // drop any prereleases that might already exist, since they are not
        // relevant at this point.
        this.prerelease.length = 0
        this.inc('patch', identifier, identifierBase)
        this.inc('pre', identifier, identifierBase)
        break
      // If the input is a non-prerelease version, this acts the same as
      // prepatch.
      case 'prerelease':
        if (this.prerelease.length === 0) {
          this.inc('patch', identifier, identifierBase)
        }
        this.inc('pre', identifier, identifierBase)
        break
      case 'release':
        if (this.prerelease.length === 0) {
          throw new Error(`version ${this.raw} is not a prerelease`)
        }
        this.prerelease.length = 0
        break

      case 'major':
        // If this is a pre-major version, bump up to the same major version.
        // Otherwise increment major.
        // 1.0.0-5 bumps to 1.0.0
        // 1.1.0 bumps to 2.0.0
        if (
          this.minor !== 0 ||
          this.patch !== 0 ||
          this.prerelease.length === 0
        ) {
          this.major++
        }
        this.minor = 0
        this.patch = 0
        this.prerelease = []
        break
      case 'minor':
        // If this is a pre-minor version, bump up to the same minor version.
        // Otherwise increment minor.
        // 1.2.0-5 bumps to 1.2.0
        // 1.2.1 bumps to 1.3.0
        if (this.patch !== 0 || this.prerelease.length === 0) {
          this.minor++
        }
        this.patch = 0
        this.prerelease = []
        break
      case 'patch':
        // If this is not a pre-release version, it will increment the patch.
        // If it is a pre-release it will bump up to the same patch version.
        // 1.2.0-5 patches to 1.2.0
        // 1.2.0 patches to 1.2.1
        if (this.prerelease.length === 0) {
          this.patch++
        }
        this.prerelease = []
        break
      // This probably shouldn't be used publicly.
      // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.
      case 'pre': {
        const base = Number(identifierBase) ? 1 : 0

        if (this.prerelease.length === 0) {
          this.prerelease = [base]
        } else {
          let i = this.prerelease.length
          while (--i >= 0) {
            if (typeof this.prerelease[i] === 'number') {
              this.prerelease[i]++
              i = -2
            }
          }
          if (i === -1) {
            // didn't increment anything
            if (identifier === this.prerelease.join('.') && identifierBase === false) {
              throw new Error('invalid increment argument: identifier already exists')
            }
            this.prerelease.push(base)
          }
        }
        if (identifier) {
          // 1.2.0-beta.1 bumps to 1.2.0-beta.2,
          // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
          let prerelease = [identifier, base]
          if (identifierBase === false) {
            prerelease = [identifier]
          }
          if (compareIdentifiers(this.prerelease[0], identifier) === 0) {
            if (isNaN(this.prerelease[1])) {
              this.prerelease = prerelease
            }
          } else {
            this.prerelease = prerelease
          }
        }
        break
      }
      default:
        throw new Error(`invalid increment argument: ${release}`)
    }
    this.raw = this.format()
    if (this.build.length) {
      this.raw += `+${this.build.join('.')}`
    }
    return this
  }
}

module.exports = SemVer
'use strict'

const parse = require('./parse')
const clean = (version, options) => {
  const s = parse(version.trim().replace(/^[=v]+/, ''), options)
  return s ? s.version : null
}
module.exports = clean
'use strict'

const eq = require('./eq')
const neq = require('./neq')
const gt = require('./gt')
const gte = require('./gte')
const lt = require('./lt')
const lte = require('./lte')

const cmp = (a, op, b, loose) => {
  switch (op) {
    case '===':
      if (typeof a === 'object') {
        a = a.version
      }
      if (typeof b === 'object') {
        b = b.version
      }
      return a === b

    case '!==':
      if (typeof a === 'object') {
        a = a.version
      }
      if (typeof b === 'object') {
        b = b.version
      }
      return a !== b

    case '':
    case '=':
    case '==':
      return eq(a, b, loose)

    case '!=':
      return neq(a, b, loose)

    case '>':
      return gt(a, b, loose)

    case '>=':
      return gte(a, b, loose)

    case '<':
      return lt(a, b, loose)

    case '<=':
      return lte(a, b, loose)

    default:
      throw new TypeError(`Invalid operator: ${op}`)
  }
}
module.exports = cmp
'use strict'

const SemVer = require('../classes/semver')
const parse = require('./parse')
const { safeRe: re, t } = require('../internal/re')

const coerce = (version, options) => {
  if (version instanceof SemVer) {
    return version
  }

  if (typeof version === 'number') {
    version = String(version)
  }

  if (typeof version !== 'string') {
    return null
  }

  options = options || {}

  let match = null
  if (!options.rtl) {
    match = version.match(options.includePrerelease ? re[t.COERCEFULL] : re[t.COERCE])
  } else {
    // Find the right-most coercible string that does not share
    // a terminus with a more left-ward coercible string.
    // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4'
    // With includePrerelease option set, '1.2.3.4-rc' wants to coerce '2.3.4-rc', not '2.3.4'
    //
    // Walk through the string checking with a /g regexp
    // Manually set the index so as to pick up overlapping matches.
    // Stop when we get a match that ends at the string end, since no
    // coercible string can be more right-ward without the same terminus.
    const coerceRtlRegex = options.includePrerelease ? re[t.COERCERTLFULL] : re[t.COERCERTL]
    let next
    while ((next = coerceRtlRegex.exec(version)) &&
        (!match || match.index + match[0].length !== version.length)
    ) {
      if (!match ||
            next.index + next[0].length !== match.index + match[0].length) {
        match = next
      }
      coerceRtlRegex.lastIndex = next.index + next[1].length + next[2].length
    }
    // leave it in a clean state
    coerceRtlRegex.lastIndex = -1
  }

  if (match === null) {
    return null
  }

  const major = match[2]
  const minor = match[3] || '0'
  const patch = match[4] || '0'
  const prerelease = options.includePrerelease && match[5] ? `-${match[5]}` : ''
  const build = options.includePrerelease && match[6] ? `+${match[6]}` : ''

  return parse(`${major}.${minor}.${patch}${prerelease}${build}`, options)
}
module.exports = coerce
'use strict'

const SemVer = require('../classes/semver')
const compareBuild = (a, b, loose) => {
  const versionA = new SemVer(a, loose)
  const versionB = new SemVer(b, loose)
  return versionA.compare(versionB) || versionA.compareBuild(versionB)
}
module.exports = compareBuild
'use strict'

const compare = require('./compare')
const compareLoose = (a, b) => compare(a, b, true)
module.exports = compareLoose
'use strict'

const SemVer = require('../classes/semver')
const compare = (a, b, loose) =>
  new SemVer(a, loose).compare(new SemVer(b, loose))

module.exports = compare
'use strict'

const parse = require('./parse.js')

const diff = (version1, version2) => {
  const v1 = parse(version1, null, true)
  const v2 = parse(version2, null, true)
  const comparison = v1.compare(v2)

  if (comparison === 0) {
    return null
  }

  const v1Higher = comparison > 0
  const highVersion = v1Higher ? v1 : v2
  const lowVersion = v1Higher ? v2 : v1
  const highHasPre = !!highVersion.prerelease.length
  const lowHasPre = !!lowVersion.prerelease.length

  if (lowHasPre && !highHasPre) {
    // Going from prerelease -> no prerelease requires some special casing

    // If the low version has only a major, then it will always be a major
    // Some examples:
    // 1.0.0-1 -> 1.0.0
    // 1.0.0-1 -> 1.1.1
    // 1.0.0-1 -> 2.0.0
    if (!lowVersion.patch && !lowVersion.minor) {
      return 'major'
    }

    // If the main part has no difference
    if (lowVersion.compareMain(highVersion) === 0) {
      if (lowVersion.minor && !lowVersion.patch) {
        return 'minor'
      }
      return 'patch'
    }
  }

  // add the `pre` prefix if we are going to a prerelease version
  const prefix = highHasPre ? 'pre' : ''

  if (v1.major !== v2.major) {
    return prefix + 'major'
  }

  if (v1.minor !== v2.minor) {
    return prefix + 'minor'
  }

  if (v1.patch !== v2.patch) {
    return prefix + 'patch'
  }

  // high and low are prereleases
  return 'prerelease'
}

module.exports = diff
'use strict'

const compare = require('./compare')
const eq = (a, b, loose) => compare(a, b, loose) === 0
module.exports = eq
'use strict'

const compare = require('./compare')
const gt = (a, b, loose) => compare(a, b, loose) > 0
module.exports = gt
'use strict'

const compare = require('./compare')
const gte = (a, b, loose) => compare(a, b, loose) >= 0
module.exports = gte
'use strict'

const SemVer = require('../classes/semver')

const inc = (version, release, options, identifier, identifierBase) => {
  if (typeof (options) === 'string') {
    identifierBase = identifier
    identifier = options
    options = undefined
  }

  try {
    return new SemVer(
      version instanceof SemVer ? version.version : version,
      options
    ).inc(release, identifier, identifierBase).version
  } catch (er) {
    return null
  }
}
module.exports = inc
'use strict'

const compare = require('./compare')
const lt = (a, b, loose) => compare(a, b, loose) < 0
module.exports = lt
'use strict'

const compare = require('./compare')
const lte = (a, b, loose) => compare(a, b, loose) <= 0
module.exports = lte
'use strict'

const SemVer = require('../classes/semver')
const major = (a, loose) => new SemVer(a, loose).major
module.exports = major
'use strict'

const SemVer = require('../classes/semver')
const minor = (a, loose) => new SemVer(a, loose).minor
module.exports = minor
'use strict'

const compare = require('./compare')
const neq = (a, b, loose) => compare(a, b, loose) !== 0
module.exports = neq
'use strict'

const SemVer = require('../classes/semver')
const parse = (version, options, throwErrors = false) => {
  if (version instanceof SemVer) {
    return version
  }
  try {
    return new SemVer(version, options)
  } catch (er) {
    if (!throwErrors) {
      return null
    }
    throw er
  }
}

module.exports = parse
'use strict'

const SemVer = require('../classes/semver')
const patch = (a, loose) => new SemVer(a, loose).patch
module.exports = patch
'use strict'

const parse = require('./parse')
const prerelease = (version, options) => {
  const parsed = parse(version, options)
  return (parsed && parsed.prerelease.length) ? parsed.prerelease : null
}
module.exports = prerelease
'use strict'

const compare = require('./compare')
const rcompare = (a, b, loose) => compare(b, a, loose)
module.exports = rcompare
'use strict'

const compareBuild = require('./compare-build')
const rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose))
module.exports = rsort
'use strict'

const Range = require('../classes/range')
const satisfies = (version, range, options) => {
  try {
    range = new Range(range, options)
  } catch (er) {
    return false
  }
  return range.test(version)
}
module.exports = satisfies
'use strict'

const compareBuild = require('./compare-build')
const sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose))
module.exports = sort
'use strict'

const parse = require('./parse')
const valid = (version, options) => {
  const v = parse(version, options)
  return v ? v.version : null
}
module.exports = valid
'use strict'

// just pre-load all the stuff that index.js lazily exports
const internalRe = require('./internal/re')
const constants = require('./internal/constants')
const SemVer = require('./classes/semver')
const identifiers = require('./internal/identifiers')
const parse = require('./functions/parse')
const valid = require('./functions/valid')
const clean = require('./functions/clean')
const inc = require('./functions/inc')
const diff = require('./functions/diff')
const major = require('./functions/major')
const minor = require('./functions/minor')
const patch = require('./functions/patch')
const prerelease = require('./functions/prerelease')
const compare = require('./functions/compare')
const rcompare = require('./functions/rcompare')
const compareLoose = require('./functions/compare-loose')
const compareBuild = require('./functions/compare-build')
const sort = require('./functions/sort')
const rsort = require('./functions/rsort')
const gt = require('./functions/gt')
const lt = require('./functions/lt')
const eq = require('./functions/eq')
const neq = require('./functions/neq')
const gte = require('./functions/gte')
const lte = require('./functions/lte')
const cmp = require('./functions/cmp')
const coerce = require('./functions/coerce')
const Comparator = require('./classes/comparator')
const Range = require('./classes/range')
const satisfies = require('./functions/satisfies')
const toComparators = require('./ranges/to-comparators')
const maxSatisfying = require('./ranges/max-satisfying')
const minSatisfying = require('./ranges/min-satisfying')
const minVersion = require('./ranges/min-version')
const validRange = require('./ranges/valid')
const outside = require('./ranges/outside')
const gtr = require('./ranges/gtr')
const ltr = require('./ranges/ltr')
const intersects = require('./ranges/intersects')
const simplifyRange = require('./ranges/simplify')
const subset = require('./ranges/subset')
module.exports = {
  parse,
  valid,
  clean,
  inc,
  diff,
  major,
  minor,
  patch,
  prerelease,
  compare,
  rcompare,
  compareLoose,
  compareBuild,
  sort,
  rsort,
  gt,
  lt,
  eq,
  neq,
  gte,
  lte,
  cmp,
  coerce,
  Comparator,
  Range,
  satisfies,
  toComparators,
  maxSatisfying,
  minSatisfying,
  minVersion,
  validRange,
  outside,
  gtr,
  ltr,
  intersects,
  simplifyRange,
  subset,
  SemVer,
  re: internalRe.re,
  src: internalRe.src,
  tokens: internalRe.t,
  SEMVER_SPEC_VERSION: constants.SEMVER_SPEC_VERSION,
  RELEASE_TYPES: constants.RELEASE_TYPES,
  compareIdentifiers: identifiers.compareIdentifiers,
  rcompareIdentifiers: identifiers.rcompareIdentifiers,
}
'use strict'

// Note: this is the semver.org version of the spec that it implements
// Not necessarily the package version of this code.
const SEMVER_SPEC_VERSION = '2.0.0'

const MAX_LENGTH = 256
const MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
/* istanbul ignore next */ 9007199254740991

// Max safe segment length for coercion.
const MAX_SAFE_COMPONENT_LENGTH = 16

// Max safe length for a build identifier. The max length minus 6 characters for
// the shortest version with a build 0.0.0+BUILD.
const MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6

const RELEASE_TYPES = [
  'major',
  'premajor',
  'minor',
  'preminor',
  'patch',
  'prepatch',
  'prerelease',
]

module.exports = {
  MAX_LENGTH,
  MAX_SAFE_COMPONENT_LENGTH,
  MAX_SAFE_BUILD_LENGTH,
  MAX_SAFE_INTEGER,
  RELEASE_TYPES,
  SEMVER_SPEC_VERSION,
  FLAG_INCLUDE_PRERELEASE: 0b001,
  FLAG_LOOSE: 0b010,
}
'use strict'

const debug = (
  typeof process === 'object' &&
  process.env &&
  process.env.NODE_DEBUG &&
  /\bsemver\b/i.test(process.env.NODE_DEBUG)
) ? (...args) => console.error('SEMVER', ...args)
  : () => {}

module.exports = debug
'use strict'

const numeric = /^[0-9]+$/
const compareIdentifiers = (a, b) => {
  if (typeof a === 'number' && typeof b === 'number') {
    return a === b ? 0 : a < b ? -1 : 1
  }

  const anum = numeric.test(a)
  const bnum = numeric.test(b)

  if (anum && bnum) {
    a = +a
    b = +b
  }

  return a === b ? 0
    : (anum && !bnum) ? -1
    : (bnum && !anum) ? 1
    : a < b ? -1
    : 1
}

const rcompareIdentifiers = (a, b) => compareIdentifiers(b, a)

module.exports = {
  compareIdentifiers,
  rcompareIdentifiers,
}
'use strict'

class LRUCache {
  constructor () {
    this.max = 1000
    this.map = new Map()
  }

  get (key) {
    const value = this.map.get(key)
    if (value === undefined) {
      return undefined
    } else {
      // Remove the key from the map and add it to the end
      this.map.delete(key)
      this.map.set(key, value)
      return value
    }
  }

  delete (key) {
    return this.map.delete(key)
  }

  set (key, value) {
    const deleted = this.delete(key)

    if (!deleted && value !== undefined) {
      // If cache is full, delete the least recently used item
      if (this.map.size >= this.max) {
        const firstKey = this.map.keys().next().value
        this.delete(firstKey)
      }

      this.map.set(key, value)
    }

    return this
  }
}

module.exports = LRUCache
'use strict'

// parse out just the options we care about
const looseOption = Object.freeze({ loose: true })
const emptyOpts = Object.freeze({ })
const parseOptions = options => {
  if (!options) {
    return emptyOpts
  }

  if (typeof options !== 'object') {
    return looseOption
  }

  return options
}
module.exports = parseOptions
'use strict'

const {
  MAX_SAFE_COMPONENT_LENGTH,
  MAX_SAFE_BUILD_LENGTH,
  MAX_LENGTH,
} = require('./constants')
const debug = require('./debug')
exports = module.exports = {}

// The actual regexps go on exports.re
const re = exports.re = []
const safeRe = exports.safeRe = []
const src = exports.src = []
const safeSrc = exports.safeSrc = []
const t = exports.t = {}
let R = 0

const LETTERDASHNUMBER = '[a-zA-Z0-9-]'

// Replace some greedy regex tokens to prevent regex dos issues. These regex are
// used internally via the safeRe object since all inputs in this library get
// normalized first to trim and collapse all extra whitespace. The original
// regexes are exported for userland consumption and lower level usage. A
// future breaking change could export the safer regex only with a note that
// all input should have extra whitespace removed.
const safeRegexReplacements = [
  ['\\s', 1],
  ['\\d', MAX_LENGTH],
  [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH],
]

const makeSafeRegex = (value) => {
  for (const [token, max] of safeRegexReplacements) {
    value = value
      .split(`${token}*`).join(`${token}{0,${max}}`)
      .split(`${token}+`).join(`${token}{1,${max}}`)
  }
  return value
}

const createToken = (name, value, isGlobal) => {
  const safe = makeSafeRegex(value)
  const index = R++
  debug(name, index, value)
  t[name] = index
  src[index] = value
  safeSrc[index] = safe
  re[index] = new RegExp(value, isGlobal ? 'g' : undefined)
  safeRe[index] = new RegExp(safe, isGlobal ? 'g' : undefined)
}

// The following Regular Expressions can be used for tokenizing,
// validating, and parsing SemVer version strings.

// ## Numeric Identifier
// A single `0`, or a non-zero digit followed by zero or more digits.

createToken('NUMERICIDENTIFIER', '0|[1-9]\\d*')
createToken('NUMERICIDENTIFIERLOOSE', '\\d+')

// ## Non-numeric Identifier
// Zero or more digits, followed by a letter or hyphen, and then zero or
// more letters, digits, or hyphens.

createToken('NONNUMERICIDENTIFIER', `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`)

// ## Main Version
// Three dot-separated numeric identifiers.

createToken('MAINVERSION', `(${src[t.NUMERICIDENTIFIER]})\\.` +
                   `(${src[t.NUMERICIDENTIFIER]})\\.` +
                   `(${src[t.NUMERICIDENTIFIER]})`)

createToken('MAINVERSIONLOOSE', `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` +
                        `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` +
                        `(${src[t.NUMERICIDENTIFIERLOOSE]})`)

// ## Pre-release Version Identifier
// A numeric identifier, or a non-numeric identifier.
// Non-numeric identifiers include numeric identifiers but can be longer.
// Therefore non-numeric identifiers must go first.

createToken('PRERELEASEIDENTIFIER', `(?:${src[t.NONNUMERICIDENTIFIER]
}|${src[t.NUMERICIDENTIFIER]})`)

createToken('PRERELEASEIDENTIFIERLOOSE', `(?:${src[t.NONNUMERICIDENTIFIER]
}|${src[t.NUMERICIDENTIFIERLOOSE]})`)

// ## Pre-release Version
// Hyphen, followed by one or more dot-separated pre-release version
// identifiers.

createToken('PRERELEASE', `(?:-(${src[t.PRERELEASEIDENTIFIER]
}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`)

createToken('PRERELEASELOOSE', `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]
}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`)

// ## Build Metadata Identifier
// Any combination of digits, letters, or hyphens.

createToken('BUILDIDENTIFIER', `${LETTERDASHNUMBER}+`)

// ## Build Metadata
// Plus sign, followed by one or more period-separated build metadata
// identifiers.

createToken('BUILD', `(?:\\+(${src[t.BUILDIDENTIFIER]
}(?:\\.${src[t.BUILDIDENTIFIER]})*))`)

// ## Full Version String
// A main version, followed optionally by a pre-release version and
// build metadata.

// Note that the only major, minor, patch, and pre-release sections of
// the version string are capturing groups.  The build metadata is not a
// capturing group, because it should not ever be used in version
// comparison.

createToken('FULLPLAIN', `v?${src[t.MAINVERSION]
}${src[t.PRERELEASE]}?${
  src[t.BUILD]}?`)

createToken('FULL', `^${src[t.FULLPLAIN]}$`)

// like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
// common in the npm registry.
createToken('LOOSEPLAIN', `[v=\\s]*${src[t.MAINVERSIONLOOSE]
}${src[t.PRERELEASELOOSE]}?${
  src[t.BUILD]}?`)

createToken('LOOSE', `^${src[t.LOOSEPLAIN]}$`)

createToken('GTLT', '((?:<|>)?=?)')

// Something like "2.*" or "1.2.x".
// Note that "x.x" is a valid xRange identifer, meaning "any version"
// Only the first item is strictly required.
createToken('XRANGEIDENTIFIERLOOSE', `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`)
createToken('XRANGEIDENTIFIER', `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`)

createToken('XRANGEPLAIN', `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})` +
                   `(?:\\.(${src[t.XRANGEIDENTIFIER]})` +
                   `(?:\\.(${src[t.XRANGEIDENTIFIER]})` +
                   `(?:${src[t.PRERELEASE]})?${
                     src[t.BUILD]}?` +
                   `)?)?`)

createToken('XRANGEPLAINLOOSE', `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})` +
                        `(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` +
                        `(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` +
                        `(?:${src[t.PRERELEASELOOSE]})?${
                          src[t.BUILD]}?` +
                        `)?)?`)

createToken('XRANGE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`)
createToken('XRANGELOOSE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`)

// Coercion.
// Extract anything that could conceivably be a part of a valid semver
createToken('COERCEPLAIN', `${'(^|[^\\d])' +
              '(\\d{1,'}${MAX_SAFE_COMPONENT_LENGTH}})` +
              `(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` +
              `(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`)
createToken('COERCE', `${src[t.COERCEPLAIN]}(?:$|[^\\d])`)
createToken('COERCEFULL', src[t.COERCEPLAIN] +
              `(?:${src[t.PRERELEASE]})?` +
              `(?:${src[t.BUILD]})?` +
              `(?:$|[^\\d])`)
createToken('COERCERTL', src[t.COERCE], true)
createToken('COERCERTLFULL', src[t.COERCEFULL], true)

// Tilde ranges.
// Meaning is "reasonably at or greater than"
createToken('LONETILDE', '(?:~>?)')

createToken('TILDETRIM', `(\\s*)${src[t.LONETILDE]}\\s+`, true)
exports.tildeTrimReplace = '$1~'

createToken('TILDE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`)
createToken('TILDELOOSE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`)

// Caret ranges.
// Meaning is "at least and backwards compatible with"
createToken('LONECARET', '(?:\\^)')

createToken('CARETTRIM', `(\\s*)${src[t.LONECARET]}\\s+`, true)
exports.caretTrimReplace = '$1^'

createToken('CARET', `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`)
createToken('CARETLOOSE', `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`)

// A simple gt/lt/eq thing, or just "" to indicate "any version"
createToken('COMPARATORLOOSE', `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`)
createToken('COMPARATOR', `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`)

// An expression to strip any whitespace between the gtlt and the thing
// it modifies, so that `> 1.2.3` ==> `>1.2.3`
createToken('COMPARATORTRIM', `(\\s*)${src[t.GTLT]
}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true)
exports.comparatorTrimReplace = '$1$2$3'

// Something like `1.2.3 - 1.2.4`
// Note that these all use the loose form, because they'll be
// checked against either the strict or loose comparator form
// later.
createToken('HYPHENRANGE', `^\\s*(${src[t.XRANGEPLAIN]})` +
                   `\\s+-\\s+` +
                   `(${src[t.XRANGEPLAIN]})` +
                   `\\s*$`)

createToken('HYPHENRANGELOOSE', `^\\s*(${src[t.XRANGEPLAINLOOSE]})` +
                        `\\s+-\\s+` +
                        `(${src[t.XRANGEPLAINLOOSE]})` +
                        `\\s*$`)

// Star ranges basically just allow anything at all.
createToken('STAR', '(<|>)?=?\\s*\\*')
// >=0.0.0 is like a star
createToken('GTE0', '^\\s*>=\\s*0\\.0\\.0\\s*$')
createToken('GTE0PRE', '^\\s*>=\\s*0\\.0\\.0-0\\s*$')
{
  "name": "semver",
  "version": "7.7.4",
  "description": "The semantic version parser used by npm.",
  "main": "index.js",
  "devDependencies": {
    "@npmcli/eslint-config": "^6.0.0",
    "@npmcli/template-oss": "4.29.0",
    "benchmark": "^2.1.4",
    "tap": "^16.0.0"
  },
  "license": "ISC",
  "repository": {
    "type": "git",
    "url": "git+https://github.com/npm/node-semver.git"
  },
  "bin": {
    "semver": "bin/semver.js"
  },
  "files": [
    "bin/",
    "lib/",
    "classes/",
    "functions/",
    "internal/",
    "ranges/",
    "index.js",
    "preload.js",
    "range.bnf"
  ],
  "tap": {
    "timeout": 30,
    "coverage-map": "map.js",
    "nyc-arg": [
      "--exclude",
      "tap-snapshots/**"
    ]
  },
  "engines": {
    "node": ">=10"
  },
  "author": "GitHub Inc.",
  "templateOSS": {
    "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
    "version": "4.29.0",
    "engines": ">=10",
    "distPaths": [
      "classes/",
      "functions/",
      "internal/",
      "ranges/",
      "index.js",
      "preload.js",
      "range.bnf"
    ],
    "allowPaths": [
      "/classes/",
      "/functions/",
      "/internal/",
      "/ranges/",
      "/index.js",
      "/preload.js",
      "/range.bnf",
      "/benchmarks"
    ],
    "publish": "true"
  }
}'use strict'

// XXX remove in v8 or beyond
module.exports = require('./index.js')
range-set  ::= range ( logical-or range ) *
logical-or ::= ( ' ' ) * '||' ( ' ' ) *
range      ::= hyphen | simple ( ' ' simple ) * | ''
hyphen     ::= partial ' - ' partial
simple     ::= primitive | partial | tilde | caret
primitive  ::= ( '<' | '>' | '>=' | '<=' | '=' ) partial
partial    ::= xr ( '.' xr ( '.' xr qualifier ? )? )?
xr         ::= 'x' | 'X' | '*' | nr
nr         ::= '0' | [1-9] ( [0-9] ) *
tilde      ::= '~' partial
caret      ::= '^' partial
qualifier  ::= ( '-' pre )? ( '+' build )?
pre        ::= parts
build      ::= parts
parts      ::= part ( '.' part ) *
part       ::= nr | [-0-9A-Za-z]+
'use strict'

// Determine if version is greater than all the versions possible in the range.
const outside = require('./outside')
const gtr = (version, range, options) => outside(version, range, '>', options)
module.exports = gtr
'use strict'

const Range = require('../classes/range')
const intersects = (r1, r2, options) => {
  r1 = new Range(r1, options)
  r2 = new Range(r2, options)
  return r1.intersects(r2, options)
}
module.exports = intersects
'use strict'

const outside = require('./outside')
// Determine if version is less than all the versions possible in the range
const ltr = (version, range, options) => outside(version, range, '<', options)
module.exports = ltr
'use strict'

const SemVer = require('../classes/semver')
const Range = require('../classes/range')

const maxSatisfying = (versions, range, options) => {
  let max = null
  let maxSV = null
  let rangeObj = null
  try {
    rangeObj = new Range(range, options)
  } catch (er) {
    return null
  }
  versions.forEach((v) => {
    if (rangeObj.test(v)) {
      // satisfies(v, range, options)
      if (!max || maxSV.compare(v) === -1) {
        // compare(max, v, true)
        max = v
        maxSV = new SemVer(max, options)
      }
    }
  })
  return max
}
module.exports = maxSatisfying
'use strict'

const SemVer = require('../classes/semver')
const Range = require('../classes/range')
const minSatisfying = (versions, range, options) => {
  let min = null
  let minSV = null
  let rangeObj = null
  try {
    rangeObj = new Range(range, options)
  } catch (er) {
    return null
  }
  versions.forEach((v) => {
    if (rangeObj.test(v)) {
      // satisfies(v, range, options)
      if (!min || minSV.compare(v) === 1) {
        // compare(min, v, true)
        min = v
        minSV = new SemVer(min, options)
      }
    }
  })
  return min
}
module.exports = minSatisfying
'use strict'

const SemVer = require('../classes/semver')
const Range = require('../classes/range')
const gt = require('../functions/gt')

const minVersion = (range, loose) => {
  range = new Range(range, loose)

  let minver = new SemVer('0.0.0')
  if (range.test(minver)) {
    return minver
  }

  minver = new SemVer('0.0.0-0')
  if (range.test(minver)) {
    return minver
  }

  minver = null
  for (let i = 0; i < range.set.length; ++i) {
    const comparators = range.set[i]

    let setMin = null
    comparators.forEach((comparator) => {
      // Clone to avoid manipulating the comparator's semver object.
      const compver = new SemVer(comparator.semver.version)
      switch (comparator.operator) {
        case '>':
          if (compver.prerelease.length === 0) {
            compver.patch++
          } else {
            compver.prerelease.push(0)
          }
          compver.raw = compver.format()
          /* fallthrough */
        case '':
        case '>=':
          if (!setMin || gt(compver, setMin)) {
            setMin = compver
          }
          break
        case '<':
        case '<=':
          /* Ignore maximum versions */
          break
        /* istanbul ignore next */
        default:
          throw new Error(`Unexpected operation: ${comparator.operator}`)
      }
    })
    if (setMin && (!minver || gt(minver, setMin))) {
      minver = setMin
    }
  }

  if (minver && range.test(minver)) {
    return minver
  }

  return null
}
module.exports = minVersion
'use strict'

const SemVer = require('../classes/semver')
const Comparator = require('../classes/comparator')
const { ANY } = Comparator
const Range = require('../classes/range')
const satisfies = require('../functions/satisfies')
const gt = require('../functions/gt')
const lt = require('../functions/lt')
const lte = require('../functions/lte')
const gte = require('../functions/gte')

const outside = (version, range, hilo, options) => {
  version = new SemVer(version, options)
  range = new Range(range, options)

  let gtfn, ltefn, ltfn, comp, ecomp
  switch (hilo) {
    case '>':
      gtfn = gt
      ltefn = lte
      ltfn = lt
      comp = '>'
      ecomp = '>='
      break
    case '<':
      gtfn = lt
      ltefn = gte
      ltfn = gt
      comp = '<'
      ecomp = '<='
      break
    default:
      throw new TypeError('Must provide a hilo val of "<" or ">"')
  }

  // If it satisfies the range it is not outside
  if (satisfies(version, range, options)) {
    return false
  }

  // From now on, variable terms are as if we're in "gtr" mode.
  // but note that everything is flipped for the "ltr" function.

  for (let i = 0; i < range.set.length; ++i) {
    const comparators = range.set[i]

    let high = null
    let low = null

    comparators.forEach((comparator) => {
      if (comparator.semver === ANY) {
        comparator = new Comparator('>=0.0.0')
      }
      high = high || comparator
      low = low || comparator
      if (gtfn(comparator.semver, high.semver, options)) {
        high = comparator
      } else if (ltfn(comparator.semver, low.semver, options)) {
        low = comparator
      }
    })

    // If the edge version comparator has a operator then our version
    // isn't outside it
    if (high.operator === comp || high.operator === ecomp) {
      return false
    }

    // If the lowest version comparator has an operator and our version
    // is less than it then it isn't higher than the range
    if ((!low.operator || low.operator === comp) &&
        ltefn(version, low.semver)) {
      return false
    } else if (low.operator === ecomp && ltfn(version, low.semver)) {
      return false
    }
  }
  return true
}

module.exports = outside
'use strict'

// given a set of versions and a range, create a "simplified" range
// that includes the same versions that the original range does
// If the original range is shorter than the simplified one, return that.
const satisfies = require('../functions/satisfies.js')
const compare = require('../functions/compare.js')
module.exports = (versions, range, options) => {
  const set = []
  let first = null
  let prev = null
  const v = versions.sort((a, b) => compare(a, b, options))
  for (const version of v) {
    const included = satisfies(version, range, options)
    if (included) {
      prev = version
      if (!first) {
        first = version
      }
    } else {
      if (prev) {
        set.push([first, prev])
      }
      prev = null
      first = null
    }
  }
  if (first) {
    set.push([first, null])
  }

  const ranges = []
  for (const [min, max] of set) {
    if (min === max) {
      ranges.push(min)
    } else if (!max && min === v[0]) {
      ranges.push('*')
    } else if (!max) {
      ranges.push(`>=${min}`)
    } else if (min === v[0]) {
      ranges.push(`<=${max}`)
    } else {
      ranges.push(`${min} - ${max}`)
    }
  }
  const simplified = ranges.join(' || ')
  const original = typeof range.raw === 'string' ? range.raw : String(range)
  return simplified.length < original.length ? simplified : range
}
'use strict'

const Range = require('../classes/range.js')
const Comparator = require('../classes/comparator.js')
const { ANY } = Comparator
const satisfies = require('../functions/satisfies.js')
const compare = require('../functions/compare.js')

// Complex range `r1 || r2 || ...` is a subset of `R1 || R2 || ...` iff:
// - Every simple range `r1, r2, ...` is a null set, OR
// - Every simple range `r1, r2, ...` which is not a null set is a subset of
//   some `R1, R2, ...`
//
// Simple range `c1 c2 ...` is a subset of simple range `C1 C2 ...` iff:
// - If c is only the ANY comparator
//   - If C is only the ANY comparator, return true
//   - Else if in prerelease mode, return false
//   - else replace c with `[>=0.0.0]`
// - If C is only the ANY comparator
//   - if in prerelease mode, return true
//   - else replace C with `[>=0.0.0]`
// - Let EQ be the set of = comparators in c
// - If EQ is more than one, return true (null set)
// - Let GT be the highest > or >= comparator in c
// - Let LT be the lowest < or <= comparator in c
// - If GT and LT, and GT.semver > LT.semver, return true (null set)
// - If any C is a = range, and GT or LT are set, return false
// - If EQ
//   - If GT, and EQ does not satisfy GT, return true (null set)
//   - If LT, and EQ does not satisfy LT, return true (null set)
//   - If EQ satisfies every C, return true
//   - Else return false
// - If GT
//   - If GT.semver is lower than any > or >= comp in C, return false
//   - If GT is >=, and GT.semver does not satisfy every C, return false
//   - If GT.semver has a prerelease, and not in prerelease mode
//     - If no C has a prerelease and the GT.semver tuple, return false
// - If LT
//   - If LT.semver is greater than any < or <= comp in C, return false
//   - If LT is <=, and LT.semver does not satisfy every C, return false
//   - If LT.semver has a prerelease, and not in prerelease mode
//     - If no C has a prerelease and the LT.semver tuple, return false
// - Else return true

const subset = (sub, dom, options = {}) => {
  if (sub === dom) {
    return true
  }

  sub = new Range(sub, options)
  dom = new Range(dom, options)
  let sawNonNull = false

  OUTER: for (const simpleSub of sub.set) {
    for (const simpleDom of dom.set) {
      const isSub = simpleSubset(simpleSub, simpleDom, options)
      sawNonNull = sawNonNull || isSub !== null
      if (isSub) {
        continue OUTER
      }
    }
    // the null set is a subset of everything, but null simple ranges in
    // a complex range should be ignored.  so if we saw a non-null range,
    // then we know this isn't a subset, but if EVERY simple range was null,
    // then it is a subset.
    if (sawNonNull) {
      return false
    }
  }
  return true
}

const minimumVersionWithPreRelease = [new Comparator('>=0.0.0-0')]
const minimumVersion = [new Comparator('>=0.0.0')]

const simpleSubset = (sub, dom, options) => {
  if (sub === dom) {
    return true
  }

  if (sub.length === 1 && sub[0].semver === ANY) {
    if (dom.length === 1 && dom[0].semver === ANY) {
      return true
    } else if (options.includePrerelease) {
      sub = minimumVersionWithPreRelease
    } else {
      sub = minimumVersion
    }
  }

  if (dom.length === 1 && dom[0].semver === ANY) {
    if (options.includePrerelease) {
      return true
    } else {
      dom = minimumVersion
    }
  }

  const eqSet = new Set()
  let gt, lt
  for (const c of sub) {
    if (c.operator === '>' || c.operator === '>=') {
      gt = higherGT(gt, c, options)
    } else if (c.operator === '<' || c.operator === '<=') {
      lt = lowerLT(lt, c, options)
    } else {
      eqSet.add(c.semver)
    }
  }

  if (eqSet.size > 1) {
    return null
  }

  let gtltComp
  if (gt && lt) {
    gtltComp = compare(gt.semver, lt.semver, options)
    if (gtltComp > 0) {
      return null
    } else if (gtltComp === 0 && (gt.operator !== '>=' || lt.operator !== '<=')) {
      return null
    }
  }

  // will iterate one or zero times
  for (const eq of eqSet) {
    if (gt && !satisfies(eq, String(gt), options)) {
      return null
    }

    if (lt && !satisfies(eq, String(lt), options)) {
      return null
    }

    for (const c of dom) {
      if (!satisfies(eq, String(c), options)) {
        return false
      }
    }

    return true
  }

  let higher, lower
  let hasDomLT, hasDomGT
  // if the subset has a prerelease, we need a comparator in the superset
  // with the same tuple and a prerelease, or it's not a subset
  let needDomLTPre = lt &&
    !options.includePrerelease &&
    lt.semver.prerelease.length ? lt.semver : false
  let needDomGTPre = gt &&
    !options.includePrerelease &&
    gt.semver.prerelease.length ? gt.semver : false
  // exception: <1.2.3-0 is the same as <1.2.3
  if (needDomLTPre && needDomLTPre.prerelease.length === 1 &&
      lt.operator === '<' && needDomLTPre.prerelease[0] === 0) {
    needDomLTPre = false
  }

  for (const c of dom) {
    hasDomGT = hasDomGT || c.operator === '>' || c.operator === '>='
    hasDomLT = hasDomLT || c.operator === '<' || c.operator === '<='
    if (gt) {
      if (needDomGTPre) {
        if (c.semver.prerelease && c.semver.prerelease.length &&
            c.semver.major === needDomGTPre.major &&
            c.semver.minor === needDomGTPre.minor &&
            c.semver.patch === needDomGTPre.patch) {
          needDomGTPre = false
        }
      }
      if (c.operator === '>' || c.operator === '>=') {
        higher = higherGT(gt, c, options)
        if (higher === c && higher !== gt) {
          return false
        }
      } else if (gt.operator === '>=' && !satisfies(gt.semver, String(c), options)) {
        return false
      }
    }
    if (lt) {
      if (needDomLTPre) {
        if (c.semver.prerelease && c.semver.prerelease.length &&
            c.semver.major === needDomLTPre.major &&
            c.semver.minor === needDomLTPre.minor &&
            c.semver.patch === needDomLTPre.patch) {
          needDomLTPre = false
        }
      }
      if (c.operator === '<' || c.operator === '<=') {
        lower = lowerLT(lt, c, options)
        if (lower === c && lower !== lt) {
          return false
        }
      } else if (lt.operator === '<=' && !satisfies(lt.semver, String(c), options)) {
        return false
      }
    }
    if (!c.operator && (lt || gt) && gtltComp !== 0) {
      return false
    }
  }

  // if there was a < or >, and nothing in the dom, then must be false
  // UNLESS it was limited by another range in the other direction.
  // Eg, >1.0.0 <1.0.1 is still a subset of <2.0.0
  if (gt && hasDomLT && !lt && gtltComp !== 0) {
    return false
  }

  if (lt && hasDomGT && !gt && gtltComp !== 0) {
    return false
  }

  // we needed a prerelease range in a specific tuple, but didn't get one
  // then this isn't a subset.  eg >=1.2.3-pre is not a subset of >=1.0.0,
  // because it includes prereleases in the 1.2.3 tuple
  if (needDomGTPre || needDomLTPre) {
    return false
  }

  return true
}

// >=1.2.3 is lower than >1.2.3
const higherGT = (a, b, options) => {
  if (!a) {
    return b
  }
  const comp = compare(a.semver, b.semver, options)
  return comp > 0 ? a
    : comp < 0 ? b
    : b.operator === '>' && a.operator === '>=' ? b
    : a
}

// <=1.2.3 is higher than <1.2.3
const lowerLT = (a, b, options) => {
  if (!a) {
    return b
  }
  const comp = compare(a.semver, b.semver, options)
  return comp < 0 ? a
    : comp > 0 ? b
    : b.operator === '<' && a.operator === '<=' ? b
    : a
}

module.exports = subset
'use strict'

const Range = require('../classes/range')

// Mostly just for testing and legacy API reasons
const toComparators = (range, options) =>
  new Range(range, options).set
    .map(comp => comp.map(c => c.value).join(' ').trim().split(' '))

module.exports = toComparators
'use strict'

const Range = require('../classes/range')
const validRange = (range, options) => {
  try {
    // Return '*' instead of '' so that truthiness works.
    // This will throw if it's invalid anyway
    return new Range(range, options).range || '*'
  } catch (er) {
    return null
  }
}
module.exports = validRange
MIT License

Copyright (c) 2020 Zurab Benashvili (binier) <zura.bena@gmail.com>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.TypedEmitter = require("events").EventEmitter;
{
  "name": "tiny-typed-emitter",
  "version": "2.1.0",
  "description": "Fully type-checked EventEmitter",
  "main": "lib/index",
  "repository": "https://github.com/binier/tiny-typed-emitter.git",
  "author": "Zurab Benashvili <zura.benashvili@gmail.com>",
  "license": "MIT",
  "files": [
    "lib/*"
  ],
  "devDependencies": {
    "@types/node": "^13.13.4",
    "typescript": "^3.8.3"
  }
}(The MIT License)

Copyright (c) 2017, Ryan Zimmerman <opensrc@ryanzim.com>

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the 'Software'), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
'use strict'

exports.fromCallback = function (fn) {
  return Object.defineProperty(function (...args) {
    if (typeof args[args.length - 1] === 'function') fn.apply(this, args)
    else {
      return new Promise((resolve, reject) => {
        args.push((err, res) => (err != null) ? reject(err) : resolve(res))
        fn.apply(this, args)
      })
    }
  }, 'name', { value: fn.name })
}

exports.fromPromise = function (fn) {
  return Object.defineProperty(function (...args) {
    const cb = args[args.length - 1]
    if (typeof cb !== 'function') return fn.apply(this, args)
    else {
      args.pop()
      fn.apply(this, args).then(r => cb(null, r), cb)
    }
  }, 'name', { value: fn.name })
}
{
  "name": "universalify",
  "version": "2.0.1",
  "description": "Make a callback- or promise-based function support both promises and callbacks.",
  "homepage": "https://github.com/RyanZim/universalify#readme",
  "license": "MIT",
  "author": "Ryan Zimmerman <opensrc@ryanzim.com>",
  "files": [
    "index.js"
  ],
  "repository": {
    "type": "git",
    "url": "git+https://github.com/RyanZim/universalify.git"
  },
  "devDependencies": {
    "colortape": "^0.1.2",
    "coveralls": "^3.0.1",
    "nyc": "^15.0.0",
    "standard": "^14.3.1",
    "tape": "^5.0.1"
  },
  "engines": {
    "node": ">= 10.0.0"
  }
}# æŠ–éŸ³ä½œå“�é‡‡é›†å·¥å…·è°ƒç ”æ–¹æ¡ˆ

## ç›®æ ‡

æž„å»ºä¸€ä¸ªæ¡Œé�¢å·¥å…·ï¼Œæ”¯æŒ�ä»¥ä¸‹æµ�ç¨‹ï¼š

1. è‡ªåŠ¨æ‰“å¼€æµ�è§ˆå™¨å¹¶è¿›å…¥æŠ–éŸ³é¡µé�¢
2. ç”¨æˆ·æ‰‹åŠ¨å®Œæˆ�ç™»å½•
3. æ ¹æ�®è¾“å…¥å…³é”®è¯�æ‰§è¡Œæ�œç´¢
4. è‡ªåŠ¨åˆ‡å…¥ä½œå“�æµ�å¹¶æŒ�ç»­åˆ·è§†é¢‘
5. æŒ‰è¾“å…¥çš„è¯„è®ºæ•°é‡�æŠ“å�–æ¯�ä¸ªä½œå“�çš„è¯„è®ºæ•°æ�®
6. å�Œæ—¶æŠ“å�–ä½œå“�åŸºç¡€ä¿¡æ�¯
7. æœ€ç»ˆæ±‡æ€»å¹¶å¯¼å‡ºä¸º Markdown

## ç»“è®º

æŽ¨è��æŠ€æœ¯è·¯çº¿ï¼š

- æ¡Œé�¢å£³ï¼šElectron
- è‡ªåŠ¨åŒ–å†…æ ¸ï¼šPlaywright
- è¿�è¡Œä½�ç½®ï¼šåœ¨ Electron ä¸»è¿›ç¨‹ä¸­è°ƒç”¨ Playwright
- å±•ç¤ºå±‚ï¼šVue æ¸²æŸ“å±‚è´Ÿè´£å�‚æ•°è¾“å…¥ã€�è¿�è¡Œè¿›åº¦ã€�ç»“æžœé¢„è§ˆã€�å¯¼å‡ºå…¥å�£

ä¸�æŽ¨è��çš„è·¯çº¿ï¼š

- ä¸�å»ºè®®ä½¿ç”¨ `playwright._electron` ä½œä¸ºä¸»è¦�å®žçŽ°æ‰‹æ®µï¼Œå› ä¸ºå®ƒçš„ç”¨é€”æ˜¯è‡ªåŠ¨åŒ–æµ‹è¯• Electron åº”ç”¨æœ¬èº«ï¼Œä¸�æ˜¯é©±åŠ¨æˆ‘ä»¬è¦�é‡‡é›†çš„å¤–éƒ¨ç½‘ç«™
- ä¸�å»ºè®®ç›´æŽ¥å¤�ç”¨ç”¨æˆ·æ—¥å¸¸ Chrome é»˜è®¤é…�ç½®ç›®å½•ã€‚Playwright å®˜æ–¹æ˜Žç¡®æ��ç¤ºæœ€è¿‘çš„ Chrome ç­–ç•¥å�˜åŒ–ä¼šå¯¼è‡´é»˜è®¤ç”¨æˆ·ç›®å½•æ— æ³•ç¨³å®šç”¨äºŽè‡ªåŠ¨åŒ–

## ä¸ºä»€ä¹ˆ Playwright é€‚å�ˆ

Playwright é€‚å�ˆè¿™ä¸ªåœºæ™¯ï¼Œæ ¸å¿ƒåŽŸå› æœ‰å››ä¸ªï¼š

1. å�¯ä»¥ç¨³å®šæ‹‰èµ·å¸¦ç•Œé�¢çš„ Chromium/Chromeï¼Œä¾¿äºŽç”¨æˆ·æ‰«ç �æˆ–æ‰‹æœºç¡®è®¤ç™»å½•
2. æ”¯æŒ� `launchPersistentContext(userDataDir)`ï¼Œé€‚å�ˆæŒ�ä¹…åŒ–æŠ–éŸ³ç™»å½•æ€�
3. `locator`ã€�è‡ªåŠ¨ç­‰å¾…ã€�äº‹ä»¶ç›‘å�¬èƒ½åŠ›æ¯”è¾ƒå®Œæ•´ï¼Œé€‚å�ˆå¯¹åŠ¨æ€�é¡µé�¢å�šç¨³å®šæ“�ä½œ
4. è‡ªå¸¦ traceã€�codegenã€�download ç­‰è°ƒè¯•èƒ½åŠ›ï¼Œèƒ½å¤§å¹…é™�ä½Žé¡µé�¢é€‰æ‹©å™¨ç»´æŠ¤æˆ�æœ¬

## æŽ¨è��æ€»ä½“æž¶æž„

### 1. è¿›ç¨‹è�Œè´£

ä¸»è¿›ç¨‹ï¼š

- å�¯åŠ¨ Playwright æµ�è§ˆå™¨å®žä¾‹
- ç®¡ç�†é‡‡é›†ä»»åŠ¡ç”Ÿå‘½å‘¨æœŸ
- æ‰§è¡Œæ�œç´¢ã€�åˆ‡æ�¢è§†é¢‘ã€�å±•å¼€è¯„è®ºã€�æŠ“å�–æ•°æ�®
- å†™å…¥æœ¬åœ° Markdown å’ŒåŽŸå§‹ JSON

é¢„åŠ è½½å±‚ï¼š

- æš´éœ²å®‰å…¨çš„ IPC API
- è®©æ¸²æŸ“å±‚å�¯ä»¥è°ƒç”¨â€œå¼€å§‹ä»»åŠ¡ / å�œæ­¢ä»»åŠ¡ / æŸ¥çœ‹è¿›åº¦ / æ‰“å¼€å¯¼å‡ºç›®å½•â€�

æ¸²æŸ“å±‚ï¼š

- è¾“å…¥å…³é”®è¯�ã€�ç›®æ ‡è¯„è®ºæ•°ã€�æœ€å¤§é‡‡é›†ä½œå“�æ•°ã€�å¯¼å‡ºè·¯å¾„
- å±•ç¤ºç™»å½•çŠ¶æ€�ã€�å½“å‰�ä½œå“�ã€�å½“å‰�è¯„è®ºè¿›åº¦ã€�å¼‚å¸¸ä¿¡æ�¯
- å±•ç¤ºé‡‡é›†ç»“æžœé¢„è§ˆ

### 2. å»ºè®®ç›®å½•

```text
src/
  main/
    browser/
      playwright.ts
      douyin-session.ts
      douyin-search.ts
      douyin-feed.ts
      douyin-comments.ts
      douyin-extract.ts
      exporter.ts
      task-runner.ts
      types.ts
  preload/
    index.ts
  renderer/
    src/
      views/
      components/
      stores/
docs/
  douyin-playwright-research.md
data/
  profiles/
  exports/
  traces/
```

## Playwright å®žçŽ°è¦�ç‚¹

### 1. æµ�è§ˆå™¨å�¯åŠ¨æ–¹å¼�

ä¼˜å…ˆæ–¹æ¡ˆï¼š

- ä½¿ç”¨ `chromium.launchPersistentContext(userDataDir, options)`
- `headless: false`
- ä½¿ç”¨å�•ç‹¬çš„è‡ªåŠ¨åŒ–ç”¨æˆ·ç›®å½•ï¼Œå¦‚ `data/profiles/douyin`

æŽ¨è��åŽŸå› ï¼š

- ç™»å½•å�Ž Cookieã€�Local Storageã€�IndexedDB éƒ½èƒ½æŒ�ä¹…ä¿�å­˜
- ä¸‹æ¬¡å�¯åŠ¨æ— éœ€é‡�å¤�ç™»å½•ï¼Œé™¤é�žæŠ–éŸ³ä¸»åŠ¨è®©ç”¨æˆ·å¤±æ•ˆ

æµ�è§ˆå™¨é€‰æ‹©å»ºè®®ï¼š

- é»˜è®¤å…ˆç”¨ Playwright è‡ªå¸¦ Chromium
- å¦‚æžœæŠ–éŸ³è§†é¢‘æ’­æ”¾ã€�ç¼–ç �ã€�é¡µé�¢å…¼å®¹æ€§ä¸�ç�†æƒ³ï¼Œå†�å°�è¯• `channel: 'chrome'`
- å�³ä¾¿ä½¿ç”¨ Chromeï¼Œä¹Ÿè¦�ä½¿ç”¨ç‹¬ç«‹ `userDataDir`ï¼Œä¸�è¦�æŒ‡å�‘ç”¨æˆ·æ—¥å¸¸æµ�è§ˆå™¨ä¸»ç›®å½•

### 2. ç™»å½•æ€�å¤„ç�†

æŽ¨è��å�Œä¿�é™©ï¼š

1. ä¸»æ–¹æ¡ˆï¼šæŒ�ä¹…åŒ–æµ�è§ˆå™¨ profile
2. å¤‡æ–¹æ¡ˆï¼šé¢�å¤–æ��ä¾›ä¸€æ¬¡ `storageState` å¯¼å‡ºèƒ½åŠ›

è¿�è¡Œæµ�ç¨‹å»ºè®®ï¼š

1. å�¯åŠ¨æµ�è§ˆå™¨å¹¶æ‰“å¼€æŠ–éŸ³é¦–é¡µ
2. æ£€æµ‹æ˜¯å�¦å·²ç™»å½•
3. æœªç™»å½•åˆ™æš‚å�œåœ¨ç™»å½•é¡µï¼Œæ��ç¤ºç”¨æˆ·æ‰‹åŠ¨å®Œæˆ�æ‰«ç �æˆ–çŸ­ä¿¡éªŒè¯�
4. è½®è¯¢é¡µé�¢çŠ¶æ€�ï¼Œç™»å½•æˆ�åŠŸå�Žç»§ç»­æ‰§è¡Œæ�œç´¢ä»»åŠ¡

ç™»å½•æ£€æµ‹å»ºè®®ï¼š

- æ£€æµ‹å¤´åƒ�ã€�ä¸ªäººå…¥å�£ã€�å�‘å¸ƒå…¥å�£ç­‰ç™»å½•å�Žå…ƒç´ 
- å�Œæ—¶å‡†å¤‡å…œåº•åˆ¤æ–­ï¼Œé�¿å…�å�ªä¾�èµ–å�•ä¸ªæ–‡æœ¬èŠ‚ç‚¹

### 3. é€‰æ‹©å™¨ç­–ç•¥

æŠ–éŸ³é¡µé�¢ DOM å�˜åŒ–é¢‘ç¹�ï¼Œä¸�å»ºè®®ä¸€å¼€å§‹å°±ä¾�èµ–æ·±å±‚ CSS è·¯å¾„ã€‚

æŽ¨è��é¡ºåº�ï¼š

1. `getByRole`
2. `getByPlaceholder`
3. `getByText`
4. ç›¸å¯¹ç¨³å�¥çš„å±žæ€§é€‰æ‹©å™¨
5. æœ€å�Žæ‰�æ˜¯å±‚çº§å¾ˆæ·±çš„ CSS é€‰æ‹©å™¨

é’ˆå¯¹æŠ–éŸ³è¿™ç±»ç«™ç‚¹ï¼Œè¦�æŽ¥å�—ä¸€ä¸ªçŽ°å®žï¼š

- å¾ˆå¤šå…ƒç´ æ²¡æœ‰è§„èŒƒçš„å�¯è®¿é—®æ€§æ ‡è®°
- æœ€ç»ˆç»�å¸¸éœ€è¦�æ··å�ˆ `locator('css=...')`ã€�æ–‡æœ¬åŒ¹é…�ã€�çˆ¶å­�å…³ç³»è¿‡æ»¤å’Œ `evaluate`

å› æ­¤å»ºè®®ç¬¬ä¸€é˜¶æ®µå¿…é¡»ä½¿ç”¨ `codegen` å’Œæµ�è§ˆå™¨ DevTools å®žæµ‹å‡ºä¸€å¥—å½“å‰�ç‰ˆæœ¬é€‰æ‹©å™¨ï¼Œå†�æŠŠé€‰æ‹©å™¨ç»Ÿä¸€é›†ä¸­åˆ°å�•æ–‡ä»¶ç»´æŠ¤ã€‚

### 4. æ�œç´¢æµ�ç¨‹

å»ºè®®æµ�ç¨‹ï¼š

1. æ‰“å¼€ `https://www.douyin.com/`
2. ç­‰å¾…é¦–é¡µå�¯äº¤äº’
3. å®šä½�æ�œç´¢æ¡†å¹¶å¡«å…¥å…³é”®è¯�
4. æ��äº¤æ�œç´¢
5. åˆ‡æ�¢åˆ°â€œè§†é¢‘ / ä½œå“�â€�ç»“æžœæµ�
6. è¿›å…¥ç¬¬ä¸€ä¸ªä½œå“�è¯¦æƒ…æˆ–æ²‰æµ¸å¼�æ’­æ”¾é¡µ

è¿™é‡Œä¸�è¦�ç›´æŽ¥ä¾�èµ–é¡µé�¢è·³è½¬å®Œæˆ�æ—¶é—´ï¼Œè€Œè¦�ç­‰å¾…å…³é”®å…ƒç´ å‡ºçŽ°ï¼Œä¾‹å¦‚ï¼š

- æ�œç´¢è¾“å…¥æ¡†
- æ�œç´¢ç»“æžœå®¹å™¨
- è§†é¢‘å�¡ç‰‡åˆ—è¡¨
- æ’­æ”¾å™¨å®¹å™¨

### 5. è‡ªåŠ¨åˆ·è§†é¢‘

å»ºè®®æŠŠâ€œåˆ·è§†é¢‘â€�æŠ½è±¡æˆ�ä¸€ä¸ªå�—æŽ§å¾ªçŽ¯ï¼š

è¾“å…¥å�‚æ•°ï¼š

- `keyword`
- `targetCommentCountPerVideo`
- `maxVideos`
- `maxDurationMs`

å¾ªçŽ¯é€»è¾‘ï¼š

1. èŽ·å�–å½“å‰�ä½œå“�å”¯ä¸€æ ‡è¯†
2. å¦‚æžœä½œå“�å·²æŠ“å�–è¿‡ï¼Œåˆ™è·³è¿‡åˆ°ä¸‹ä¸€ä¸ª
3. é‡‡é›†ä½œå“�åŸºç¡€ä¿¡æ�¯
4. æ‰“å¼€è¯„è®ºåŒº
5. å¾ªçŽ¯æ»šåŠ¨è¯„è®ºåŒºç›´åˆ°è¾¾åˆ°ç›®æ ‡è¯„è®ºæ•°æˆ–æ— æ›´å¤šè¯„è®º
6. é‡‡é›†è¯„è®ºå¹¶åŽ»é‡�
7. å›žåˆ°ä¸»è§†å›¾æˆ–åˆ‡åˆ°ä¸‹ä¸€ä¸ªä½œå“�

åˆ‡æ�¢ä¸‹ä¸€ä¸ªä½œå“�çš„æ–¹æ³•å»ºè®®æŒ‰ç¨³å®šæ€§æŽ’åº�ï¼š

1. åœ¨æ²‰æµ¸å¼�æµ�ä¸­ä½¿ç”¨é”®ç›˜ `ArrowDown` / `PageDown`
2. ç‚¹å‡»â€œä¸‹ä¸€ä¸ªâ€�æŒ‰é’®
3. åœ¨åˆ—è¡¨é¡µé‡�æ–°ç‚¹å‡»ä¸‹ä¸€å¼ å�¡ç‰‡

### 6. è¯„è®ºæŠ“å�–

è¯„è®ºé‡‡é›†æ˜¯æ•´ä¸ªé¡¹ç›®æœ€å®¹æ˜“ä¸�ç¨³å®šçš„éƒ¨åˆ†ï¼Œå»ºè®®å�•ç‹¬è®¾è®¡ã€‚

æŽ¨è��æµ�ç¨‹ï¼š

1. æ‰“å¼€è¯„è®ºé�¢æ�¿
2. ç­‰å¾…è¯„è®ºåˆ—è¡¨é¦–å±�å‡ºçŽ°
3. è¯»å�–å½“å‰�å·²æ¸²æŸ“è¯„è®ºå�¡ç‰‡
4. æ��å�–è¯„è®ºå­—æ®µ
5. æ»šåŠ¨è¯„è®ºå®¹å™¨è€Œä¸�æ˜¯æ•´é¡µ
6. åˆ¤æ–­æ˜¯å�¦æ–°å¢žè¯„è®º
7. è¾¾åˆ°ç›®æ ‡æ•°é‡�æˆ–è¿žç»­å¤šæ¬¡æ— æ–°å¢žå�Žå�œæ­¢

æŽ¨è��è¯„è®ºå­—æ®µï¼š

- `commentId`
- `authorName`
- `authorId` æˆ–ä¸»é¡µé“¾æŽ¥
- `content`
- `publishTimeText`
- `likeCountText`
- `replyCountText`
- `isPinned`

å�¯é€‰æ‰©å±•ï¼š

- æ¥¼ä¸­æ¥¼å›žå¤�
- è¯„è®ºç”¨æˆ·ä¸»é¡µé“¾æŽ¥
- è¯„è®ºå›¾ç‰‡

### 7. ä½œå“�ä¿¡æ�¯æŠ“å�–

å»ºè®®æœ€å°‘æŠ“è¿™äº›å­—æ®µï¼š

- `awemeId` æˆ–ä½œå“�å”¯ä¸€ URL
- `keyword`
- `authorName`
- `authorProfileUrl`
- `title`
- `publishTimeText`
- `likeCountText`
- `collectCountText`
- `commentCountText`
- `shareCountText`
- `durationText`
- `videoUrl` æˆ–å½“å‰�é¡µé�¢ URL

è¡¥å……å»ºè®®ï¼š

- å�Œæ­¥è®°å½•æŠ“å�–æ—¶é—´
- è®°å½•æ�¥æº�å…³é”®è¯�
- ä¿�ç•™åŽŸå§‹æ–‡æœ¬ï¼Œä¸�åœ¨é‡‡é›†é˜¶æ®µå¼ºè¡ŒæŠŠâ€œ1.2ä¸‡â€�è½¬æ�¢æˆ�æ•°å­—

### 8. åŽ»é‡�ä¸Žæ–­ç‚¹ç»­è·‘

å»ºè®®å»ºç«‹ä¸¤ä¸ªå±‚é�¢çš„åŽ»é‡�ï¼š

ä½œå“�åŽ»é‡�ï¼š

- ä¸»é”®ä¼˜å…ˆä½¿ç”¨ `awemeId`
- å¦‚æžœæ‹¿ä¸�åˆ°ï¼Œå†�é€€åŒ–ä¸ºé¡µé�¢ URL

è¯„è®ºåŽ»é‡�ï¼š

- ä¸»é”®ä¼˜å…ˆä½¿ç”¨ `commentId`
- å¦‚æžœæ‹¿ä¸�åˆ°ï¼Œå†�ç”¨ `authorName + content + publishTimeText` å�šå¼±åŽ»é‡�

æ–­ç‚¹ç»­è·‘å»ºè®®ï¼š

- æ¯�å¤„ç�†å®Œä¸€ä¸ªä½œå“�å°±è�½ç›˜ä¸€æ¬¡ JSON
- Markdown åœ¨ä»»åŠ¡ç»“æ�Ÿæ—¶æ±‡æ€»ç”Ÿæˆ�
- ç¨‹åº�å¼‚å¸¸é‡�å�¯æ—¶å�¯ä»¥è¯»å�–ä¸Šæ¬¡ JSON ç»§ç»­

### 9. å¯¼å‡º Markdown

æŽ¨è��å�Œæ—¶å¯¼å‡ºä¸¤ä»½ï¼š

1. `result.json`
2. `result.md`

Markdown å»ºè®®æ ¼å¼�ï¼š

```md
# æŠ–éŸ³é‡‡é›†æŠ¥å‘Š

- å…³é”®è¯�ï¼šxxx
- æŠ“å�–æ—¶é—´ï¼š2026-07-11 12:00:00
- ä½œå“�æ•°ï¼š10

## ä½œå“� 1

- æ ‡é¢˜ï¼šxxx
- ä½œè€…ï¼šxxx
- é“¾æŽ¥ï¼šxxx
- ç‚¹èµžï¼šxxx
- è¯„è®ºï¼šxxx

### è¯„è®º

1. ç”¨æˆ·ï¼šA
   æ—¶é—´ï¼šxxx
   ç‚¹èµžï¼šxxx
   å†…å®¹ï¼šxxx

2. ç”¨æˆ·ï¼šB
   æ—¶é—´ï¼šxxx
   ç‚¹èµžï¼šxxx
   å†…å®¹ï¼šxxx
```

å¦‚æžœå�Žç»­è¦�å�šåˆ†æž�ï¼ŒJSON æ›´é€‚å�ˆç¨‹åº�å¤„ç�†ï¼›Markdown æ›´é€‚å�ˆç›´æŽ¥æŸ¥çœ‹å’Œåˆ†äº«ã€‚

## ç¨³å®šæ€§ä¸Žé£Žé™©

### 1. æŠ–éŸ³å��çˆ¬ä¸Žé£ŽæŽ§

è¿™æ˜¯æœ€å¤§çš„å®žé™…é£Žé™©ã€‚

è¡¨çŽ°å�¯èƒ½åŒ…æ‹¬ï¼š

- é¢‘ç¹�å¼¹ç™»å½•
- è¯„è®ºåˆ—è¡¨ä¸�å®Œæ•´
- é¡µé�¢è¦�æ±‚éªŒè¯�ç �
- é¡µé�¢ç»“æž„é¢‘ç¹�å�˜åŒ–
- æ’­æ”¾æˆ–æ»šåŠ¨è¡Œä¸ºè¢«æ‹¦æˆª

åº”å¯¹å»ºè®®ï¼š

- ä½¿ç”¨æœ‰ç•Œé�¢çš„çœŸå®žæµ�è§ˆå™¨ï¼Œä¸�è¦�æ— å¤´å�¯åŠ¨
- æŽ§åˆ¶æ“�ä½œèŠ‚å¥�ï¼ŒåŠ å…¥éš�æœºç­‰å¾…
- é�¿å…�æž�é«˜é¢‘çŽ‡é‡‡é›†
- æ��ä¾›â€œäººå·¥æŽ¥ç®¡â€�æŒ‰é’®ï¼Œå…�è®¸ç”¨æˆ·åœ¨å¼‚å¸¸æ—¶æ‰‹åŠ¨ä¿®å¤�é¡µé�¢çŠ¶æ€�å�Žç»§ç»­
- æŠŠå¼‚å¸¸çŽ°åœºä¿�å­˜ä¸º screenshot + trace

### 2. é¡µé�¢ç»“æž„é¢‘ç¹�å�˜åŒ–

å»ºè®®ï¼š

- æŠŠæ‰€æœ‰é€‰æ‹©å™¨é›†ä¸­ç®¡ç�†
- å¢žåŠ å…³é”®èŠ‚ç‚¹æŽ¢æµ‹é€»è¾‘ï¼Œä¸�è¦�æŠŠæµ�ç¨‹å†™æ­»
- ç•™ä¸€ä¸ªâ€œé‡‡é›†è°ƒè¯•æ¨¡å¼�â€�ï¼Œè¾“å‡ºå½“å‰�åŒ¹é…�åˆ°çš„å…ƒç´ æ•°é‡�å’Œå…³é”®æ–‡æœ¬

### 3. æ³•å¾‹ã€�å¹³å�°è§„åˆ™ä¸Žè´¦å�·å®‰å…¨

å®žçŽ°å‰�éœ€è¦�æ˜Žç¡®ï¼š

- æ˜¯å�¦ç¬¦å�ˆæŠ–éŸ³å¹³å�°çš„æœ�åŠ¡å��è®®å’Œ robots/è®¿é—®è§„åˆ™
- æ˜¯å�¦æ¶‰å�Šä¸ªäººä¿¡æ�¯æŠ“å�–ä¸Žå­˜å‚¨
- æ˜¯å�¦ä¼šå¯¹ç™»å½•è´¦å�·é€ æˆ�é£ŽæŽ§é£Žé™©

å¦‚æžœè¿™å·¥å…·ç”¨äºŽæ­£å¼�ä¸šåŠ¡ï¼Œå»ºè®®å…ˆè¡¥ä¸€è½®å�ˆè§„ç¡®è®¤ã€‚

## ä¸ºä»€ä¹ˆä¸�å»ºè®®ç›´æŽ¥æŠŠæŠ–éŸ³é¡µé�¢å¡žè¿› Electron çš„ BrowserWindow é‡Œé‡‡

è™½ç„¶æŠ€æœ¯ä¸Šå�¯ä»¥åœ¨ Electron é‡ŒåµŒç½‘é¡µï¼Œä½†ä¸�é€‚å�ˆä½œä¸ºä¸»è¦�æ–¹æ¡ˆï¼ŒåŽŸå› åŒ…æ‹¬ï¼š

- ç«™ç‚¹å…¼å®¹æ€§å’Œç™»å½•è¡Œä¸ºæ›´å¤�æ�‚
- è‡ªåŠ¨åŒ–è°ƒè¯•èƒ½åŠ›ä¸�å¦‚ Playwright ç‹¬ç«‹æµ�è§ˆå™¨æˆ�ç†Ÿ
- è¯„è®ºæ»šåŠ¨ã€�ç™»å½•æ€�æŒ�ä¹…åŒ–ã€�traceã€�codegen éƒ½ä¸�å¦‚ Playwright æ–¹æ¡ˆç›´æŽ¥

æ›´ç¨³çš„è®¾è®¡æ˜¯ï¼š

- Electron å�ªå�šæ¡Œé�¢å·¥å…·å’Œä»»åŠ¡æŽ§åˆ¶å�°
- Playwright è´Ÿè´£æµ�è§ˆå™¨è‡ªåŠ¨åŒ–

## MVP å»ºè®®

ç¬¬ä¸€é˜¶æ®µå…ˆå�šæœ€å°�å�¯ç”¨ç‰ˆæœ¬ï¼š

1. å�¯åŠ¨æµ�è§ˆå™¨å¹¶è¿›å…¥æŠ–éŸ³é¦–é¡µ
2. æ”¯æŒ�æ‰‹åŠ¨ç™»å½•å¹¶æŒ�ä¹…åŒ–ç™»å½•æ€�
3. è¾“å…¥å…³é”®è¯�å�Žæ‰“å¼€æ�œç´¢ç»“æžœ
4. èƒ½è¿›å…¥ä½œå“�æµ�
5. æ¯�ä¸ªä½œå“�æŠ“å�–åŸºç¡€ä¿¡æ�¯
6. æ¯�ä¸ªä½œå“�æŠ“å�–å‰� N æ�¡è¯„è®º
7. å¯¼å‡º JSON + Markdown

ç¬¬äºŒé˜¶æ®µå†�å�šå¢žå¼ºï¼š

1. æ–­ç‚¹ç»­è·‘
2. å¼‚å¸¸æ�¢å¤�
3. é€‰æ‹©å™¨é…�ç½®åŒ–
4. æ¥¼ä¸­æ¥¼å›žå¤�é‡‡é›†
5. å¯¼å‡º CSV / Excel
6. ä»»åŠ¡åŽ†å�²è®°å½•

## æŽ¨è��å®žçŽ°é¡ºåº�

1. æŽ¥å…¥ Playwright ä¾�èµ–å¹¶å°�è£…æµ�è§ˆå™¨å�¯åŠ¨å™¨
2. å®Œæˆ�â€œæ‰‹åŠ¨ç™»å½• + ç™»å½•æ€�æŒ�ä¹…åŒ–â€�
3. å®Œæˆ�å…³é”®è¯�æ�œç´¢
4. å®Œæˆ�å�•ä½œå“�ä¿¡æ�¯æŠ“å�–
5. å®Œæˆ�è¯„è®ºé�¢æ�¿æ»šåŠ¨ä¸Žè¯„è®ºæ��å�–
6. å®Œæˆ�å¤šä½œå“�å¾ªçŽ¯
7. å®Œæˆ�å¯¼å‡ºä¸Žå¤±è´¥æ�¢å¤�
8. æœ€å�Žå†�è¡¥ UI å’Œä»»åŠ¡ç®¡ç�†

## è°ƒè¯•å»ºè®®

å¼€å�‘æœŸå¼ºçƒˆå»ºè®®æ‰“å¼€è¿™äº›èƒ½åŠ›ï¼š

- `headless: false`
- `slowMo`
- é¡µé�¢æˆªå›¾
- Playwright trace
- ç»“æž„åŒ–æ—¥å¿—

è¿˜å»ºè®®å�•ç‹¬å‡†å¤‡ä¸€ä¸ªâ€œé€‰æ‹©å™¨éªŒè¯�è„šæœ¬â€�ï¼Œæ¯�æ¬¡æŠ–éŸ³é¡µé�¢æ”¹ç‰ˆæ—¶å…ˆéªŒè¯�ï¼š

- èƒ½å�¦æ‰¾åˆ°æ�œç´¢æ¡†
- èƒ½å�¦æ‰¾åˆ°ç»“æžœå�¡ç‰‡
- èƒ½å�¦æ‰“å¼€è¯„è®ºåŒº
- èƒ½å�¦æ­£ç¡®å®šä½�è¯„è®ºåˆ—è¡¨å®¹å™¨

## å¯¹å½“å‰�ä»“åº“çš„è�½åœ°å»ºè®®

å½“å‰�ä»“åº“æ˜¯ä¸€ä¸ªå¾ˆå¹²å‡€çš„ Electron + Vue æ¨¡æ�¿ï¼Œé€‚å�ˆç›´æŽ¥æ‰©å±•ã€‚

å»ºè®®ä¸‹ä¸€æ­¥æ”¹é€ å†…å®¹ï¼š

- `package.json` å¢žåŠ  `playwright`
- `src/main` æ–°å¢žé‡‡é›†ä»»åŠ¡æ¨¡å�—
- `src/preload/index.ts` æš´éœ² IPC API
- `src/renderer/src/App.vue` æ”¹æˆ�å�‚æ•°è¡¨å�• + ä»»åŠ¡çŠ¶æ€�é�¢æ�¿

## å…³é”®å®˜æ–¹å�‚è€ƒ

- Playwright BrowserType: https://playwright.dev/docs/api/class-browsertype
- Playwright Authentication: https://playwright.dev/docs/auth
- Playwright Locators: https://playwright.dev/docs/locators
- Playwright Auto-waiting: https://playwright.dev/docs/actionability
- Playwright Downloads: https://playwright.dev/docs/downloads
- Playwright Trace Viewer: https://playwright.dev/docs/trace-viewer
- Playwright Codegen: https://playwright.dev/docs/codegen
- Playwright Electron API: https://playwright.dev/docs/api/class-electron

## æœ€ç»ˆå»ºè®®

è¿™ä¸ªéœ€æ±‚å�¯ä»¥å�šï¼Œè€Œä¸” Electron + Playwright æ˜¯å�ˆç�†ç»„å�ˆã€‚

æœ€å…³é”®çš„è®¾è®¡å†³ç­–æœ‰ä¸‰ä¸ªï¼š

1. Playwright è·‘åœ¨ Electron ä¸»è¿›ç¨‹ï¼Œä¸�è¦�ç”¨å®ƒåŽ»â€œè‡ªåŠ¨åŒ– Electron è‡ªå·±â€�
2. ä½¿ç”¨ç‹¬ç«‹æŒ�ä¹…åŒ–æµ�è§ˆå™¨ profile ä¿�å­˜æŠ–éŸ³ç™»å½•æ€�
3. å…ˆå�š MVPï¼ŒæŠŠé€‰æ‹©å™¨ç¨³å®šæ€§å’Œè¯„è®ºæ»šåŠ¨é‡‡é›†è·‘é€šï¼Œå†�ç»§ç»­æ‰©å±•
"use strict";
const electron = require("electron");
const path = require("path");
const node_crypto = require("node:crypto");
const os = require("node:os");
const utils = require("@electron-toolkit/utils");
const electronUpdater = require("electron-updater");
const node_fs = require("node:fs");
const promises = require("node:fs/promises");
const path$1 = require("node:path");
const playwright = require("playwright");
const icon = path.join(__dirname, "../../resources/icon.png");
const PER_VIDEO_TIMEOUT_MS = 9e4;
const DEFAULT_STATE = {
  status: "idle",
  message: "å‡†å¤‡å°±ç»ª",
  isBrowserReady: false,
  currentVideoIndex: 0,
  totalVideos: 0,
  collectedVideos: 0,
  logs: []
};
class DouyinTaskRunner {
  constructor(options) {
    this.options = options;
  }
  options;
  context = null;
  page = null;
  state = { ...DEFAULT_STATE };
  stopRequested = false;
  currentRunDirectory = null;
  currentTaskPromise = null;
  currentJsonPath = null;
  currentMarkdownPath = null;
  getState() {
    return {
      ...this.state,
      logs: [...this.state.logs]
    };
  }
  async prepareSession() {
    if (!this.context) {
      await promises.mkdir(this.options.profileDir, { recursive: true });
      await promises.mkdir(this.options.traceRootDir, { recursive: true });
      this.updateState({
        status: "starting",
        message: "æ­£åœ¨å�¯åŠ¨ Playwright æµ�è§ˆå™¨..."
      });
      const launchOptions = this.resolveBrowserLaunchOptions();
      this.pushLog(`æµ�è§ˆå™¨å�¯åŠ¨ç­–ç•¥ï¼š${launchOptions.browserLabel}`);
      this.context = await playwright.chromium.launchPersistentContext(this.options.profileDir, {
        headless: false,
        viewport: { width: 1440, height: 900 },
        acceptDownloads: true,
        ...launchOptions.executablePath ? { executablePath: launchOptions.executablePath } : {}
      });
      this.page = this.context.pages()[0] ?? await this.context.newPage();
    }
    await this.ensurePage();
    await this.page.goto("https://www.douyin.com/", { waitUntil: "domcontentloaded" });
    this.pushLog("æµ�è§ˆå™¨å·²æ‰“å¼€ï¼ŒæŠ–éŸ³é¦–é¡µå·²åŠ è½½");
    this.updateState({
      status: "waiting_login",
      isBrowserReady: true,
      message: "è¯·åœ¨æµ�è§ˆå™¨ä¸­å®Œæˆ�æŠ–éŸ³ç™»å½•ï¼Œç™»å½•å�Žå›žåˆ°åº”ç”¨ç‚¹å‡»â€œå¼€å§‹é‡‡é›†â€�"
    });
    return this.getState();
  }
  resolveBrowserLaunchOptions() {
    const bundledExecutable = playwright.chromium.executablePath();
    if (bundledExecutable && node_fs.existsSync(bundledExecutable)) {
      return {
        browserLabel: `Playwright Chromium (${bundledExecutable})`,
        executablePath: bundledExecutable
      };
    }
    const candidates = this.getSystemBrowserCandidates();
    const matched = candidates.find((candidate) => node_fs.existsSync(candidate.path));
    if (matched) {
      return {
        browserLabel: `${matched.name} (${matched.path})`,
        executablePath: matched.path
      };
    }
    throw new Error(
      "æœªæ‰¾åˆ°å�¯ç”¨æµ�è§ˆå™¨ã€‚è¯·å…ˆå®‰è£… Chrome æˆ– Edgeï¼Œæˆ–åœ¨å½“å‰�æœºå™¨æ‰§è¡Œ Playwright æµ�è§ˆå™¨å®‰è£…ã€‚"
    );
  }
  getSystemBrowserCandidates() {
    if (process.platform === "win32") {
      return [
        {
          name: "Google Chrome",
          path: "C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe"
        },
        {
          name: "Google Chrome (x86)",
          path: "C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe"
        },
        {
          name: "Microsoft Edge",
          path: "C:\\Program Files\\Microsoft\\Edge\\Application\\msedge.exe"
        },
        {
          name: "Microsoft Edge (x86)",
          path: "C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe"
        }
      ];
    }
    if (process.platform === "darwin") {
      return [
        {
          name: "Google Chrome",
          path: "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"
        },
        {
          name: "Microsoft Edge",
          path: "/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge"
        }
      ];
    }
    return [
      {
        name: "Google Chrome",
        path: "/usr/bin/google-chrome"
      },
      {
        name: "Microsoft Edge",
        path: "/usr/bin/microsoft-edge"
      }
    ];
  }
  async startTask(input) {
    if (this.currentTaskPromise || this.state.status === "running" || this.state.status === "starting") {
      throw new Error("å½“å‰�å·²æœ‰ä»»åŠ¡æ­£åœ¨è¿�è¡Œ");
    }
    const normalizedInput = this.normalizeTaskInput(input);
    this.stopRequested = false;
    this.currentRunDirectory = this.createRunDirectory(normalizedInput);
    this.currentJsonPath = null;
    this.currentMarkdownPath = null;
    this.resetStateForNewRun(normalizedInput);
    await this.prepareSession();
    await this.ensurePage();
    const totalVideos = normalizedInput.mode === "link" ? this.parseVideoUrls(normalizedInput.videoUrlsText).length : normalizedInput.mode === "live" ? 1 : normalizedInput.maxVideos;
    const taskLabel = normalizedInput.mode === "link" ? `æ­£åœ¨å‡†å¤‡é‡‡é›† ${totalVideos} ä¸ªæŒ‡å®šä½œå“�é“¾æŽ¥` : normalizedInput.mode === "live" ? normalizedInput.liveMonitorEnabled ? `æ­£åœ¨æŒ�ç»­ç›‘æŽ§ç›´æ’­é—´è¯„è®ºï¼š${normalizedInput.liveRoomUrl}` : `æ­£åœ¨é‡‡é›†ç›´æ’­é—´è¯„è®ºï¼š${normalizedInput.liveRoomUrl}` : `æ­£åœ¨æ�œç´¢å…³é”®è¯�ï¼š${normalizedInput.keyword}`;
    this.updateState({
      status: "running",
      currentMode: normalizedInput.mode,
      currentKeyword: this.describeTaskInput(normalizedInput),
      currentVideoIndex: 0,
      totalVideos,
      collectedVideos: 0,
      exportSummary: void 0,
      lastError: void 0,
      message: taskLabel
    });
    this.currentTaskPromise = this.executeTask(normalizedInput).finally(() => {
      this.currentTaskPromise = null;
    });
    return this.getState();
  }
  normalizeTaskInput(input) {
    const mode = input.mode === "creator" ? "creator" : input.mode === "live" ? "live" : input.mode === "link" ? "link" : "keyword";
    const keyword = input.keyword.trim();
    const videoUrlsText = input.videoUrlsText?.trim() || "";
    const liveRoomUrl = this.extractFirstUrl(input.liveRoomUrl) || input.liveRoomUrl?.trim() || "";
    const creatorProfileUrl = this.extractFirstUrl(input.creatorProfileUrl) || input.creatorProfileUrl?.trim() || "";
    const liveMonitorEnabled = Boolean(input.liveMonitorEnabled);
    const liveMonitorIntervalSeconds = Math.max(1, input.liveMonitorIntervalSeconds || 5);
    const liveMonitorMinutes = typeof input.liveMonitorMinutes === "number" && Number.isFinite(input.liveMonitorMinutes) ? Math.max(1, input.liveMonitorMinutes) : void 0;
    const creatorMonitorIntervalMinutes = Math.max(1, input.creatorMonitorIntervalMinutes || 1);
    if (mode === "keyword" && !keyword) {
      throw new Error("å…³é”®è¯�ä¸�èƒ½ä¸ºç©º");
    }
    if (mode === "link") {
      const videoUrls = this.parseVideoUrls(videoUrlsText);
      if (!videoUrls.length) {
        throw new Error("è¯·è‡³å°‘è¾“å…¥ä¸€ä¸ªæœ‰æ•ˆçš„ä½œå“�é“¾æŽ¥");
      }
    }
    if (mode === "live") {
      const normalizedLiveRoomUrl = this.normalizeLiveRoomUrl(liveRoomUrl);
      if (!normalizedLiveRoomUrl) {
        throw new Error("è¯·è¾“å…¥æœ‰æ•ˆçš„æŠ–éŸ³ç›´æ’­é—´é“¾æŽ¥");
      }
      return {
        mode,
        keyword,
        videoUrlsText,
        liveRoomUrl: normalizedLiveRoomUrl,
        creatorProfileUrl,
        creatorMonitorIntervalMinutes,
        liveMonitorEnabled,
        liveMonitorIntervalSeconds,
        liveMonitorMinutes,
        commentLimit: Math.max(1, input.commentLimit || 20),
        maxVideos: 1,
        exportDir: input.exportDir?.trim()
      };
    }
    if (mode === "creator") {
      const normalizedCreatorProfileUrl = this.normalizeCreatorProfileUrl(creatorProfileUrl);
      if (!normalizedCreatorProfileUrl) {
        throw new Error("è¯·è¾“å…¥æœ‰æ•ˆçš„ä¸»æ’­ä¸»é¡µé“¾æŽ¥");
      }
      return {
        mode,
        keyword,
        videoUrlsText,
        liveRoomUrl,
        creatorProfileUrl: normalizedCreatorProfileUrl,
        creatorMonitorIntervalMinutes,
        liveMonitorEnabled: true,
        liveMonitorIntervalSeconds,
        liveMonitorMinutes,
        commentLimit: Math.max(1, input.commentLimit || 20),
        maxVideos: 1,
        exportDir: input.exportDir?.trim()
      };
    }
    return {
      mode,
      keyword,
      videoUrlsText,
      liveRoomUrl,
      creatorProfileUrl,
      creatorMonitorIntervalMinutes,
      liveMonitorEnabled,
      liveMonitorIntervalSeconds,
      liveMonitorMinutes,
      commentLimit: Math.max(1, input.commentLimit || 10),
      maxVideos: Math.max(1, input.maxVideos || 5),
      exportDir: input.exportDir?.trim()
    };
  }
  stopTask() {
    this.stopRequested = true;
    this.pushLog("å·²æ”¶åˆ°å�œæ­¢ä»»åŠ¡è¯·æ±‚");
    if (this.state.status !== "running") {
      this.updateState({
        status: "stopped",
        message: "å½“å‰�æ²¡æœ‰è¿�è¡Œä¸­çš„ä»»åŠ¡"
      });
    } else {
      this.updateState({
        message: "æ­£åœ¨å®‰å…¨å�œæ­¢ä»»åŠ¡å¹¶å¯¼å‡ºå·²é‡‡é›†å†…å®¹"
      });
    }
    return this.getState();
  }
  async executeTask(input) {
    try {
      const page = this.page;
      const tracePath = path$1.join(this.options.traceRootDir, `trace-${Date.now()}.zip`);
      await this.context.tracing.start({ screenshots: true, snapshots: true });
      if (input.mode === "creator") {
        const results2 = await this.executeCreatorLiveTask(page, input);
        const exportSummary2 = await this.exportResults(input, results2);
        await this.context.tracing.stop({ path: tracePath });
        this.updateState({
          status: this.stopRequested ? "stopped" : "completed",
          exportSummary: exportSummary2,
          message: this.stopRequested ? "ä¸»æ’­ä¸»é¡µç›‘æŽ§å·²å�œæ­¢ï¼Œå·²å¯¼å‡ºå½“å‰�ç»“æžœ" : `ä¸»æ’­ä¸»é¡µç›‘æŽ§å®Œæˆ�ï¼Œå…±å¯¼å‡º ${results2[0]?.comments.length || 0} æ�¡è¯„è®º`
        });
        this.pushLog(`ç»“æžœå·²å¯¼å‡ºåˆ° ${exportSummary2.exportDir}`);
        return;
      }
      if (input.mode === "live") {
        await this.prepareExportFiles(input);
        const results2 = await this.executeLiveTask(page, input);
        const exportSummary2 = await this.exportResults(input, results2);
        await this.context.tracing.stop({ path: tracePath });
        this.updateState({
          status: this.stopRequested ? "stopped" : "completed",
          exportSummary: exportSummary2,
          message: this.stopRequested ? "ç›´æ’­é—´è¯„è®ºç›‘æŽ§å·²å�œæ­¢ï¼Œå·²å¯¼å‡ºå½“å‰�ç»“æžœ" : `ç›´æ’­é—´è¯„è®ºé‡‡é›†å®Œæˆ�ï¼Œå…±å¯¼å‡º ${results2[0]?.comments.length || 0} æ�¡è¯„è®º`
        });
        this.pushLog(`ç»“æžœå·²å¯¼å‡ºåˆ° ${exportSummary2.exportDir}`);
        return;
      }
      const videoUrls = await this.resolveVideoUrls(page, input);
      if (!videoUrls.length) {
        throw new Error(
          input.mode === "link" ? "æœªè¯†åˆ«åˆ°å�¯é‡‡é›†çš„ä½œå“�é“¾æŽ¥ï¼Œè¯·æ£€æŸ¥è¾“å…¥å†…å®¹" : "æœªæ‰¾åˆ°ä½œå“�é“¾æŽ¥ï¼Œè¯·ç¡®è®¤å·²ç™»å½•ä¸”æ�œç´¢ç»“æžœé¡µæ­£å¸¸åŠ è½½"
        );
      }
      this.pushLog(`å·²å�‘çŽ° ${videoUrls.length} ä¸ªå€™é€‰ä½œå“�`);
      const results = [];
      await this.prepareExportFiles(input);
      for (const [index, videoUrl] of videoUrls.entries()) {
        if (this.stopRequested) break;
        this.updateState({
          currentVideoIndex: index + 1,
          totalVideos: videoUrls.length,
          message: `æ­£åœ¨é‡‡é›†ç¬¬ ${index + 1}/${videoUrls.length} ä¸ªä½œå“�`
        });
        this.pushLog(`å¼€å§‹é‡‡é›†ä½œå“�ï¼š${videoUrl}`);
        try {
          const result = await this.runWithTimeout(
            this.scrapeVideoDetail(page, videoUrl, input, index + 1),
            PER_VIDEO_TIMEOUT_MS,
            `ä½œå“� ${index + 1} é‡‡é›†è¶…æ—¶`
          );
          results.push(result);
          await this.persistResults(input, results);
          this.updateState({
            collectedVideos: results.length
          });
        } catch (error) {
          const message = error instanceof Error ? error.message : "æœªçŸ¥é”™è¯¯";
          this.pushLog(`è·³è¿‡ä½œå“� ${index + 1}ï¼š${message}`);
          this.updateState({
            lastError: `ä½œå“� ${index + 1} å¤±è´¥ï¼š${message}`
          });
        }
      }
      const exportSummary = await this.exportResults(input, results);
      await this.context.tracing.stop({ path: tracePath });
      if (this.stopRequested) {
        this.updateState({
          status: "stopped",
          exportSummary,
          message: "ä»»åŠ¡å·²å�œæ­¢ï¼Œå·²å¯¼å‡ºå½“å‰�ç»“æžœ"
        });
      } else {
        this.updateState({
          status: "completed",
          exportSummary,
          message: `é‡‡é›†å®Œæˆ�ï¼Œå…±å¯¼å‡º ${results.length} ä¸ªä½œå“�`
        });
      }
      this.pushLog(`ç»“æžœå·²å¯¼å‡ºåˆ° ${exportSummary.exportDir}`);
    } catch (error) {
      await this.safeStopTracing();
      const message = error instanceof Error ? error.message : "æœªçŸ¥é”™è¯¯";
      this.pushLog(`ä»»åŠ¡å¤±è´¥ï¼š${message}`);
      this.updateState({
        status: "error",
        lastError: message,
        message: "ä»»åŠ¡æ‰§è¡Œå¤±è´¥ï¼Œè¯·æ£€æŸ¥æ—¥å¿—å’Œæµ�è§ˆå™¨çŠ¶æ€�"
      });
    }
  }
  async ensurePage() {
    if (!this.context) {
      return;
    }
    if (!this.page || this.page.isClosed()) {
      this.page = this.context.pages()[0] ?? await this.context.newPage();
    }
  }
  async navigateToSearch(page, keyword) {
    const searchUrl = `https://www.douyin.com/search/${encodeURIComponent(keyword)}?type=video`;
    await page.goto(searchUrl, { waitUntil: "domcontentloaded" });
    await page.waitForTimeout(2500);
    this.pushLog(`å·²è¿›å…¥æ�œç´¢ç»“æžœé¡µï¼š${keyword}`);
  }
  async collectVideoUrls(page, input) {
    await this.navigateToSearch(page, input.keyword);
    return await this.collectVideoUrlsFromSearch(page, input.maxVideos);
  }
  extractFirstUrl(value) {
    if (!value) return null;
    const matched = value.match(/https?:\/\/[^\s]+/i);
    return matched?.[0] || null;
  }
  normalizeCreatorProfileUrl(value) {
    if (!value || !/^https?:\/\//i.test(value)) {
      return null;
    }
    try {
      const parsed = new URL(value);
      parsed.hash = "";
      const isDouyinHost = parsed.hostname === "www.douyin.com" || parsed.hostname === "douyin.com" || parsed.hostname.endsWith(".douyin.com") || parsed.hostname === "v.douyin.com";
      if (!isDouyinHost) {
        return null;
      }
      return parsed.toString();
    } catch {
      return null;
    }
  }
  async resolveDouyinUrl(page, rawUrl) {
    const extracted = this.extractFirstUrl(rawUrl) || rawUrl;
    if (!/^https?:\/\//i.test(extracted)) {
      throw new Error("æœªè¯†åˆ«åˆ°æœ‰æ•ˆé“¾æŽ¥");
    }
    const parsed = new URL(extracted);
    const isShortLink = parsed.hostname === "v.douyin.com";
    if (!isShortLink) {
      return extracted;
    }
    await page.goto(extracted, { waitUntil: "domcontentloaded" });
    await page.waitForTimeout(3e3);
    return page.url();
  }
  async executeCreatorLiveTask(page, input) {
    const profileUrl = await this.resolveDouyinUrl(page, input.creatorProfileUrl);
    this.pushLog(`å·²è§£æž�ä¸»æ’­ä¸»é¡µé“¾æŽ¥ï¼š${profileUrl}`);
    while (!this.stopRequested) {
      await page.goto(profileUrl, { waitUntil: "domcontentloaded" });
      await page.waitForTimeout(3e3);
      this.pushLog(`æ­£åœ¨æ£€æµ‹ä¸»æ’­ä¸»é¡µå¼€æ’­çŠ¶æ€�ï¼š${profileUrl}`);
      const liveEntry = await page.evaluate(() => {
        const normalizeText = (value) => value?.replace(/\s+/g, " ").trim() || "";
        const liveBadge = Array.from(document.querySelectorAll("span, div")).find(
          (node) => normalizeText(node.textContent).includes("ç›´æ’­ä¸­")
        );
        const liveAnchor = document.querySelector('a[href*="live.douyin.com"]') || liveBadge?.closest("a[href]");
        return {
          isLive: Boolean(liveBadge || liveAnchor),
          liveUrl: liveAnchor?.href || ""
        };
      });
      if (liveEntry.isLive) {
        this.pushLog("æ£€æµ‹åˆ°ä¸»æ’­å·²å¼€æ’­ï¼Œå‡†å¤‡è¿›å…¥ç›´æ’­é—´");
        const liveUrl = liveEntry.liveUrl || profileUrl;
        const resolvedLiveUrl = await this.resolveDouyinUrl(page, liveUrl);
        const liveInput = {
          ...input,
          mode: "live",
          liveRoomUrl: resolvedLiveUrl,
          liveMonitorEnabled: true
        };
        return await this.executeLiveTask(page, liveInput);
      }
      this.updateState({
        currentMode: "creator",
        currentKeyword: profileUrl,
        message: `ä¸»æ’­æš‚æœªå¼€æ’­ï¼Œ${input.creatorMonitorIntervalMinutes || 1} åˆ†é’Ÿå�Žç»§ç»­æ£€æµ‹`
      });
      await this.waitForStopAwareDelay((input.creatorMonitorIntervalMinutes || 1) * 6e4);
    }
    return [
      {
        url: profileUrl,
        title: "ä¸»æ’­ä¸»é¡µç›‘æŽ§ç»“æžœ",
        description: "ä¸»æ’­åœ¨æœ¬æ¬¡ç›‘æŽ§æœŸé—´æœªå¼€æ’­æˆ–ä»»åŠ¡å·²æ‰‹åŠ¨å�œæ­¢",
        comments: []
      }
    ];
  }
  async resolveVideoUrls(page, input) {
    if (input.mode === "link") {
      return this.parseVideoUrls(input.videoUrlsText);
    }
    return await this.collectVideoUrls(page, input);
  }
  normalizeLiveRoomUrl(value) {
    if (!value || !/^https?:\/\//i.test(value)) {
      return null;
    }
    try {
      const parsed = new URL(value);
      parsed.hash = "";
      if (parsed.hostname !== "live.douyin.com" && parsed.hostname !== "www.douyin.com" && parsed.hostname !== "douyin.com" && !parsed.hostname.endsWith(".douyin.com")) {
        return null;
      }
      return parsed.toString();
    } catch {
      return null;
    }
  }
  parseVideoUrls(videoUrlsText) {
    if (!videoUrlsText) {
      return [];
    }
    const candidates = videoUrlsText.split(/[\n\r,\s]+/).map((value) => value.trim()).filter(Boolean);
    const uniqueUrls = /* @__PURE__ */ new Set();
    for (const value of candidates) {
      const normalized = this.normalizeVideoUrl(value);
      if (normalized) {
        uniqueUrls.add(normalized);
      }
    }
    return [...uniqueUrls];
  }
  async executeLiveTask(page, input) {
    const liveRoomUrl = input.liveRoomUrl;
    const outputDir = this.resolveRunDirectory(input);
    await promises.mkdir(outputDir, { recursive: true });
    await page.goto(liveRoomUrl, { waitUntil: "domcontentloaded" });
    await page.waitForTimeout(4e3);
    this.pushLog(`å·²è¿›å…¥ç›´æ’­é—´ï¼š${page.url()}`);
    const collected = /* @__PURE__ */ new Map();
    const historyRounds = Math.max(18, Math.ceil(Math.max(input.commentLimit, 120) / 6));
    let stagnantRounds = 0;
    const monitorStartedAt = Date.now();
    const monitorDeadline = input.liveMonitorEnabled && input.liveMonitorMinutes ? monitorStartedAt + input.liveMonitorMinutes * 6e4 : null;
    const historyTargetCount = input.liveMonitorEnabled ? Math.max(120, input.commentLimit || 20) : input.commentLimit;
    for (let round = 0; round < historyRounds; round += 1) {
      if (this.stopRequested) {
        this.pushLog("æ”¶åˆ°å�œæ­¢è¯·æ±‚ï¼Œç»“æ�Ÿç›´æ’­é—´è¯„è®ºé‡‡é›†");
        break;
      }
      const beforeCount = collected.size;
      const snapshot = await this.scrapeLiveSnapshot(page, historyTargetCount);
      if (this.stopRequested) {
        this.pushLog("æ”¶åˆ°å�œæ­¢è¯·æ±‚ï¼Œç»ˆæ­¢æœ¬è½®ç›´æ’­è¯„è®ºé‡‡é›†");
        break;
      }
      for (const comment of snapshot.comments) {
        const key = `${comment.authorName}::${comment.content}::${comment.authorUniqueId || ""}`;
        if (!collected.has(key)) {
          collected.set(key, comment);
        }
      }
      this.updateState({
        currentVideoIndex: 1,
        totalVideos: 1,
        collectedVideos: collected.size,
        message: input.liveMonitorEnabled ? `æ­£åœ¨åŠ è½½ç›´æ’­é—´åŽ†å�²è¯„è®ºï¼Œå·²æ”¶é›† ${collected.size} æ�¡` : `æ­£åœ¨é‡‡é›†ç›´æ’­é—´å½“å‰�è¯„è®ºï¼Œå·²æ”¶é›† ${collected.size} æ�¡`
      });
      this.pushLog(
        input.liveMonitorEnabled ? `ç›´æ’­åŽ†å�²è½®æ¬¡ ${round + 1}/${historyRounds}ï¼šæœ¬è½®æ–°å¢ž ${collected.size - beforeCount} æ�¡ï¼Œç´¯è®¡ ${collected.size} æ�¡è¯„è®º` : `ç›´æ’­è¯„è®ºè½®æ¬¡ ${round + 1}/${historyRounds}ï¼šæœ¬è½®æ–°å¢ž ${collected.size - beforeCount} æ�¡ï¼Œç´¯è®¡ ${collected.size} æ�¡è¯„è®º`
      );
      await this.persistResults(input, [
        {
          url: page.url(),
          title: snapshot.title,
          authorName: snapshot.authorName,
          description: snapshot.description,
          rawTextPreview: snapshot.rawTextPreview,
          publishTimeText: input.liveMonitorEnabled ? "æŒ�ç»­ç›‘æŽ§è¿›è¡Œä¸­" : "åŽ†å�²è¯„è®ºå›žæº¯ä¸­",
          comments: input.liveMonitorEnabled ? [...collected.values()] : [...collected.values()].slice(0, input.commentLimit)
        }
      ]);
      if (!input.liveMonitorEnabled && collected.size >= input.commentLimit) {
        this.pushLog("ç›´æ’­é—´è¯„è®ºå·²è¾¾åˆ°ç›®æ ‡æ•°é‡�");
        break;
      }
      if (round < historyRounds - 1) {
        const scrollResult = await this.scrollLiveCommentHistory(page);
        this.pushLog(
          `ç›´æ’­è¯„è®ºåŒºåŽ†å�²ç¿»é¡µï¼šstrategy=${scrollResult.strategy} / scrollTop=${Math.round(scrollResult.scrollTop)} / hasMore=${scrollResult.hasMore ? "yes" : "no"}`
        );
        if (collected.size === beforeCount && !scrollResult.hasMore) {
          stagnantRounds += 1;
        } else if (collected.size === beforeCount) {
          stagnantRounds += 1;
        } else {
          stagnantRounds = 0;
        }
        if (stagnantRounds >= 4) {
          this.pushLog("è¿žç»­å¤šè½®æœªé‡‡åˆ°æ–°è¯„è®ºï¼Œæ��å‰�ç»“æ�Ÿç›´æ’­é—´åŽ†å�²è¯„è®ºæŠ“å�–");
          break;
        }
        await this.waitForStopAwareDelay(1500);
      }
    }
    if (input.liveMonitorEnabled && !this.stopRequested) {
      let monitorRound = 0;
      while (!this.stopRequested) {
        if (monitorDeadline && Date.now() >= monitorDeadline) {
          this.pushLog(`å·²è¾¾åˆ°è®¾å®šç›‘æŽ§æ—¶é•¿ ${input.liveMonitorMinutes} åˆ†é’Ÿï¼Œç»“æ�ŸæŒ�ç»­ç›‘æŽ§`);
          break;
        }
        await this.waitForStopAwareDelay((input.liveMonitorIntervalSeconds || 5) * 1e3);
        if (this.stopRequested) {
          this.pushLog("æ”¶åˆ°å�œæ­¢è¯·æ±‚ï¼Œç»“æ�ŸæŒ�ç»­ç›‘æŽ§");
          break;
        }
        const beforeCount = collected.size;
        const snapshot = await this.scrapeLiveSnapshot(page, Math.max(120, collected.size || 1));
        if (this.stopRequested) {
          this.pushLog("æ”¶åˆ°å�œæ­¢è¯·æ±‚ï¼Œç»ˆæ­¢å½“å‰�ç›‘æŽ§è½®æ¬¡");
          break;
        }
        for (const comment of snapshot.comments) {
          const key = `${comment.authorName}::${comment.content}::${comment.authorUniqueId || ""}`;
          if (!collected.has(key)) {
            collected.set(key, comment);
          }
        }
        monitorRound += 1;
        this.updateState({
          currentVideoIndex: 1,
          totalVideos: 1,
          collectedVideos: collected.size,
          message: `æ­£åœ¨æŒ�ç»­ç›‘æŽ§ç›´æ’­é—´è¯„è®ºï¼Œå·²æ”¶é›† ${collected.size} æ�¡`
        });
        this.pushLog(
          `ç›´æ’­ç›‘æŽ§è½®æ¬¡ ${monitorRound}ï¼šæœ¬è½®æ–°å¢ž ${collected.size - beforeCount} æ�¡ï¼Œç´¯è®¡ ${collected.size} æ�¡è¯„è®º`
        );
        await this.persistResults(input, [
          {
            url: page.url(),
            title: snapshot.title,
            authorName: snapshot.authorName,
            description: snapshot.description,
            rawTextPreview: snapshot.rawTextPreview,
            publishTimeText: "æŒ�ç»­ç›‘æŽ§è¿›è¡Œä¸­",
            comments: [...collected.values()]
          }
        ]);
      }
    }
    const finalSnapshot = await this.scrapeLiveSnapshot(
      page,
      input.liveMonitorEnabled ? Math.max(120, collected.size || 1) : Math.max(input.commentLimit, collected.size || 1)
    );
    return [
      {
        url: page.url(),
        title: finalSnapshot.title,
        authorName: finalSnapshot.authorName,
        publishTimeText: input.liveMonitorEnabled ? input.liveMonitorMinutes ? `æŒ�ç»­ç›‘æŽ§ ${input.liveMonitorMinutes} åˆ†é’Ÿï¼ˆè½®è¯¢é—´éš” ${input.liveMonitorIntervalSeconds || 5} ç§’ï¼‰` : `æŒ�ç»­ç›‘æŽ§ç›´åˆ°æ‰‹åŠ¨å�œæ­¢ï¼ˆè½®è¯¢é—´éš” ${input.liveMonitorIntervalSeconds || 5} ç§’ï¼‰` : "ç›´æ’­é—´å½“å‰�è¯„è®ºå¿«ç…§",
        description: finalSnapshot.description,
        rawTextPreview: finalSnapshot.rawTextPreview,
        comments: input.liveMonitorEnabled ? [...collected.values()] : [...collected.values()].slice(0, input.commentLimit)
      }
    ];
  }
  async scrapeLiveSnapshot(page, commentLimit) {
    return await page.evaluate(({ commentLimit: commentLimit2 }) => {
      const normalizeText = (value) => {
        const next = value?.replace(/\s+/g, " ").trim();
        return next || void 0;
      };
      const normalizeUrl = (value) => {
        if (!value) return void 0;
        try {
          return new URL(value, window.location.origin).toString();
        } catch {
          return void 0;
        }
      };
      const preferredContainer = document.querySelector('[class*="webcast-chatroom___list"]') || document.querySelector('[class*="chatroom___list"]') || document.body;
      const candidateNodes = Array.from(preferredContainer.querySelectorAll("div, p, li")).filter((node) => {
        const element = node;
        const rect = element.getBoundingClientRect();
        const text = normalizeText(element.innerText) || "";
        return rect.height > 10 && rect.width > 60 && text.length >= 4 && text.length <= 120;
      });
      const comments = [];
      const seen = /* @__PURE__ */ new Set();
      for (const node of candidateNodes) {
        const raw = normalizeText(node.innerText);
        if (!raw || seen.has(raw)) continue;
        if (/æ¬¢è¿Žæ�¥åˆ°ç›´æ’­é—´|ä¸»æ’­|ç‚¹èµž|é€�å‡ºäº†|ç¦�è¢‹|è´­ç‰©è½¦|ç‚¹å‡»å�‚ä¸Ž|å°�æ—¶æ¦œ|æœ¬åœº|è¿›å…¥ç›´æ’­é—´/.test(raw)) continue;
        let authorName;
        let content;
        const separator = raw.includes("ï¼š") ? "ï¼š" : raw.includes(":") ? ":" : null;
        if (separator) {
          const [left, ...rest] = raw.split(separator);
          const maybeAuthor = normalizeText(left);
          const maybeContent = normalizeText(rest.join(separator));
          if (maybeAuthor && maybeContent && maybeAuthor.length <= 30) {
            authorName = maybeAuthor;
            content = maybeContent;
          }
        }
        if (!authorName || !content) {
          const spans = Array.from(node.querySelectorAll("span, a")).map((item) => normalizeText(item.textContent)).filter(Boolean);
          if (spans.length >= 2) {
            authorName = spans[0];
            content = normalizeText(spans.slice(1).join(" "));
          }
        }
        if (!authorName || !content) continue;
        seen.add(raw);
        const authorAnchor = node.querySelector('a[href*="/user/"], a[href*="sec_uid="], a[href*="modal_id="]');
        const authorProfileUrl = normalizeUrl(authorAnchor?.href);
        const authorUniqueId = authorProfileUrl?.match(/\/user\/([^/?#]+)/i)?.[1] || authorProfileUrl?.match(/sec_uid=([^&]+)/i)?.[1];
        comments.push({
          commentId: `${authorName}-${content}`.slice(0, 100),
          authorName,
          authorUniqueId,
          authorProfileUrl,
          content,
          capturedAt: (/* @__PURE__ */ new Date()).toISOString()
        });
        if (comments.length >= commentLimit2) break;
      }
      return {
        title: normalizeText(document.title) || normalizeText(document.querySelector("h1, h2")?.textContent) || "ç›´æ’­é—´è¯„è®ºé‡‡é›†",
        authorName: normalizeText(
          document.querySelector('[data-e2e="live-room-anchor-name"], [class*="anchor"] a, [class*="anchor"] span')?.textContent
        ) || normalizeText(document.querySelector("h1, h2")?.textContent),
        description: normalizeText(document.querySelector('meta[name="description"]')?.getAttribute("content")),
        rawTextPreview: normalizeText(document.body.innerText)?.slice(0, 1600),
        comments
      };
    }, { commentLimit });
  }
  async scrollLiveCommentHistory(page) {
    const listLocator = page.locator(
      '[class*="webcast-chatroom___list"], .webcast-chatroom___list, [class*="chatroom___list"], .chatroom___list'
    ).first();
    const listCount = await listLocator.count().catch(() => 0);
    if (!listCount) {
      return {
        listFound: false,
        beforeScrollTop: 0,
        rollbackScrollTop: 0,
        scrollTop: 0,
        scrollHeight: 0,
        clientHeight: 0,
        hasMore: false,
        strategy: "chatroom-class-not-found"
      };
    }
    const box = await listLocator.boundingBox().catch(() => null);
    if (box) {
      const targetX = Math.round(box.x + box.width * 0.5);
      const targetY = Math.round(box.y + Math.min(box.height - 24, box.height * 0.45));
      await page.mouse.move(targetX, targetY);
      await page.mouse.click(targetX, targetY);
      await page.waitForTimeout(120);
    }
    const before = await listLocator.evaluate((node) => {
      const element = node;
      return {
        scrollTop: element.scrollTop,
        scrollHeight: element.scrollHeight,
        clientHeight: element.clientHeight
      };
    }).catch(() => ({ scrollTop: 0, scrollHeight: 0, clientHeight: 0 }));
    const rollbackDistance = Math.max(140, before.clientHeight * 0.22);
    const rollbackState = await listLocator.evaluate(
      (node, distance) => {
        const element = node;
        element.scrollTop = Math.min(
          Math.max(0, element.scrollHeight - element.clientHeight),
          Math.max(distance, element.scrollTop + distance)
        );
        element.dispatchEvent(new Event("scroll", { bubbles: true }));
        return {
          scrollTop: element.scrollTop,
          scrollHeight: element.scrollHeight,
          clientHeight: element.clientHeight
        };
      },
      rollbackDistance
    ).catch(() => before);
    await page.waitForTimeout(220);
    if (box) {
      await page.mouse.wheel(0, -720);
      await page.waitForTimeout(260);
      await page.mouse.wheel(0, -720);
      await page.waitForTimeout(260);
      await page.mouse.wheel(0, -720);
      await page.waitForTimeout(260);
    }
    const after = await listLocator.evaluate((node) => {
      const element = node;
      element.scrollTop = 0;
      element.dispatchEvent(new Event("scroll", { bubbles: true }));
      return {
        scrollTop: element.scrollTop,
        scrollHeight: element.scrollHeight,
        clientHeight: element.clientHeight
      };
    }).catch(() => before);
    if (after.scrollTop > 0) {
      await listLocator.evaluate((node) => {
        const element = node;
        element.scrollTop = 0;
        element.dispatchEvent(new Event("scroll", { bubbles: true }));
      }).catch(() => void 0);
      await page.waitForTimeout(320);
    }
    const finalState = await listLocator.evaluate((node) => {
      const element = node;
      return {
        scrollTop: element.scrollTop,
        scrollHeight: element.scrollHeight,
        clientHeight: element.clientHeight
      };
    }).catch(() => after);
    return {
      listFound: true,
      beforeScrollTop: before.scrollTop,
      rollbackScrollTop: rollbackState.scrollTop,
      scrollTop: finalState.scrollTop,
      scrollHeight: finalState.scrollHeight,
      clientHeight: finalState.clientHeight,
      hasMore: finalState.scrollHeight > finalState.clientHeight + 40,
      strategy: box ? "chatroom-class+wheel" : "chatroom-class-no-box"
    };
  }
  normalizeVideoUrl(value) {
    if (!/^https?:\/\//i.test(value)) {
      return null;
    }
    try {
      const parsed = new URL(value);
      parsed.hash = "";
      const isDouyinHost = parsed.hostname === "www.douyin.com" || parsed.hostname === "douyin.com" || parsed.hostname.endsWith(".douyin.com");
      const isShortHost = parsed.hostname === "v.douyin.com";
      if (!isDouyinHost && !isShortHost) {
        return null;
      }
      if (parsed.pathname.includes("/video/")) {
        parsed.search = "";
      }
      return parsed.toString();
    } catch {
      return null;
    }
  }
  async waitForStopAwareDelay(totalMs) {
    const stepMs = 250;
    let elapsed = 0;
    while (elapsed < totalMs) {
      if (this.stopRequested) {
        return;
      }
      const waitMs = Math.min(stepMs, totalMs - elapsed);
      await new Promise((resolve) => setTimeout(resolve, waitMs));
      elapsed += waitMs;
    }
  }
  async collectVideoUrlsFromSearch(page, maxVideos) {
    const uniqueUrls = /* @__PURE__ */ new Set();
    for (let attempt = 0; attempt < 6 && uniqueUrls.size < maxVideos; attempt += 1) {
      const urls = await page.evaluate(() => {
        return Array.from(document.querySelectorAll("a[href]")).map((element) => element.href).filter((href) => href.includes("/video/")).map((href) => href.split("?")[0]);
      });
      urls.forEach((url) => uniqueUrls.add(url));
      if (uniqueUrls.size >= maxVideos) {
        break;
      }
      await page.mouse.wheel(0, 1600);
      await page.waitForTimeout(1200);
    }
    return [...uniqueUrls].slice(0, maxVideos);
  }
  async scrapeVideoDetail(page, url, input, index) {
    const outputDir = this.resolveRunDirectory(input);
    await promises.mkdir(outputDir, { recursive: true });
    await page.goto(url, { waitUntil: "domcontentloaded" });
    await page.waitForTimeout(2500);
    const finalUrl = page.url().split("?")[0];
    await this.prepareComments(page, input.commentLimit, index);
    const detail = await page.evaluate(
      ({ commentLimit }) => {
        const text = (value) => {
          const normalized = value?.replace(/\s+/g, " ").trim();
          return normalized || void 0;
        };
        const normalizeUrl = (value) => {
          if (!value) return void 0;
          try {
            return new URL(value, window.location.origin).toString();
          } catch {
            return void 0;
          }
        };
        const getAttributeValue = (element, names) => {
          if (!element) return void 0;
          for (const name of names) {
            const value = text(element.getAttribute(name));
            if (value) return value;
          }
          return void 0;
        };
        const extractUserIdFromUrl = (value) => {
          if (!value) return void 0;
          const patterns = [
            /\/user\/([^/?#]+)/i,
            /modal_id=([^&]+)/i,
            /sec_uid=([^&]+)/i
          ];
          for (const pattern of patterns) {
            const matched = value.match(pattern);
            if (matched?.[1]) return matched[1];
          }
          return void 0;
        };
        const pickText = (selectors) => {
          for (const selector of selectors) {
            const element = document.querySelector(selector);
            const content = text(element?.textContent);
            if (content) return content;
          }
          return void 0;
        };
        const findCommentScopeRoot = () => {
          const sections = Array.from(document.querySelectorAll("div, section, main"));
          for (const node of sections) {
            const element = node;
            const raw = text(element.innerText) || "";
            const rect = element.getBoundingClientRect();
            const inMainColumn = rect.left < window.innerWidth * 0.78;
            if (!inMainColumn) continue;
            if (raw.includes("å…¨éƒ¨è¯„è®º") || raw.includes("ç•™ä¸‹ä½ çš„ç²¾å½©è¯„è®ºå�§")) {
              return element;
            }
          }
          return null;
        };
        const collectCommentRoots = () => {
          const scopeRoot = findCommentScopeRoot();
          if (!scopeRoot) return [];
          const authorAnchors = Array.from(
            scopeRoot.querySelectorAll(
              'a[href*="/user/"], a[href*="sec_uid="], a[href*="modal_id="]'
            )
          );
          const candidates = /* @__PURE__ */ new Set();
          for (const anchor of authorAnchors) {
            let current = anchor.parentElement;
            let depth = 0;
            while (current && depth < 8) {
              const raw = text(current.innerText);
              const lineCount = current.innerText.split("\n").map((line) => line.trim()).filter(Boolean).length;
              const hasMeta = /(\d+\s*åˆ†é’Ÿå‰�|\d+\s*å°�æ—¶å‰�|\d+\s*å¤©å‰�|\d{1,2}-\d{1,2}|å›žå¤�|åˆ†äº«)/.test(
                raw || ""
              );
              if (raw && raw.length >= 8 && lineCount >= 2 && hasMeta) {
                candidates.add(current);
                break;
              }
              current = current.parentElement;
              depth += 1;
            }
          }
          return Array.from(candidates);
        };
        const commentNodes = collectCommentRoots();
        const isMetaLine = (value) => {
          return /\d+\s*åˆ†é’Ÿå‰�/.test(value) || /\d+\s*å°�æ—¶å‰�/.test(value) || /\d+\s*å¤©å‰�/.test(value) || /\d{1,2}-\d{1,2}/.test(value) || /åˆ†äº«/.test(value) || /^å›žå¤�$/.test(value) || /^æŸ¥çœ‹å›žå¤�$/.test(value) || /^å…¨æ–‡$/.test(value) || /^æ›´å¤š$/.test(value) || /^IP/.test(value) || /Â·/.test(value);
        };
        const isReplyHintLine = (value) => /å±•å¼€\d+æ�¡å›žå¤�/.test(value);
        const isNoiseContent = (value) => {
          const normalized = value.trim();
          return !normalized || normalized.length < 2 || /^åŠ è½½ä¸­$/.test(normalized) || /^\d+$/.test(normalized) || /^(åˆ†äº«|å›žå¤�|æŸ¥çœ‹å›žå¤�|å±•å¼€\d+æ�¡å›žå¤�|å…¨æ–‡|æ›´å¤š)$/.test(normalized) || /^\d+\s*(åˆ†äº«|å›žå¤�)/.test(normalized);
        };
        const stripReplyNoise = (value) => {
          return value.replace(/\b\d+\s*å›žå¤�ä¸­\b/g, "").replace(/\bå›žå¤�ä¸­\b/g, "").replace(/å›žå¤�@[^ ]+/g, "").replace(/\s+/g, " ").trim();
        };
        const cleanContentLine = (value, authorName) => {
          let next = value.trim();
          if (!next) return "";
          if (authorName && next.startsWith(authorName)) {
            next = next.slice(authorName.length).trim();
          }
          next = stripReplyNoise(next);
          return next.replace(/\s+/g, " ").trim();
        };
        const parseCommentBlock = (rawLines, fallbackAuthorName) => {
          const lines = rawLines.map((line) => line.trim()).filter(Boolean);
          const replies = [];
          const contentLines = [];
          let publishTimeText;
          let likeCountText;
          let replyHintText;
          let index2 = 0;
          while (index2 < lines.length) {
            const line = lines[index2];
            if (line === fallbackAuthorName) {
              index2 += 1;
              continue;
            }
            if (isReplyHintLine(line)) {
              replyHintText = line;
              index2 += 1;
              continue;
            }
            if (isMetaLine(line)) {
              publishTimeText ||= line.match(/^([^ ]+)/)?.[1];
              likeCountText ||= line.match(/(?:^| )(\d+)(?: |$)/)?.[1];
              index2 += 1;
              continue;
            }
            const next = lines[index2 + 1];
            const next2 = lines[index2 + 2];
            if (next && next2 && !isMetaLine(next) && isMetaLine(next2)) {
              replies.push({
                authorName: line,
                content: cleanContentLine(next, line),
                publishTimeText: next2.match(/^([^ ]+)/)?.[1],
                likeCountText: next2.match(/(?:^| )(\d+)(?: |$)/)?.[1]
              });
              index2 += 3;
              continue;
            }
            contentLines.push(cleanContentLine(line, fallbackAuthorName));
            index2 += 1;
          }
          return {
            content: stripReplyNoise(contentLines.filter(Boolean).join(" ")),
            publishTimeText,
            likeCountText,
            replyHintText,
            replies
          };
        };
        const comments = [];
        const seen = /* @__PURE__ */ new Set();
        for (const node of commentNodes) {
          const element = node;
          const content = text(element.innerText);
          if (!content || content.length < 4) continue;
          if (content.includes("è¯„è®º") && content.length < 12) continue;
          if (seen.has(content)) continue;
          const authorAnchor = node.querySelector('a[href*="/user/"], a[href*="sec_uid="], a[href]');
          const authorProfileUrl = normalizeUrl(authorAnchor?.href);
          const authorUniqueId = extractUserIdFromUrl(authorProfileUrl) || getAttributeValue(node, [
            "data-user-id",
            "data-userid",
            "data-sec-user-id",
            "data-sec-uid",
            "data-author-id"
          ]) || getAttributeValue(authorAnchor, [
            "data-user-id",
            "data-userid",
            "data-sec-user-id",
            "data-sec-uid",
            "data-author-id"
          ]);
          const commentId = getAttributeValue(node, [
            "data-comment-id",
            "data-commentid",
            "data-id",
            "data-cid",
            "id"
          ]) || extractUserIdFromUrl(normalizeUrl(node.querySelector('a[href*="comment"]')?.href));
          const authorName = text(node.querySelector("a, span, strong")?.innerText) || "æœªçŸ¥ç”¨æˆ·";
          const parsed = parseCommentBlock(element.innerText.split("\n"), authorName);
          const normalizedContent = parsed.content || cleanContentLine(content, authorName);
          if (!normalizedContent || isNoiseContent(normalizedContent)) continue;
          seen.add(content);
          comments.push({
            commentId,
            authorName,
            authorUniqueId,
            authorProfileUrl,
            content: normalizedContent,
            publishTimeText: parsed.publishTimeText || text(
              node.querySelector(
                'time, [class*="time"], [data-e2e*="time"]'
              )?.innerText
            ),
            likeCountText: parsed.likeCountText || text(
              node.querySelector('[class*="like"], [data-e2e*="like"]')?.innerText
            ),
            replyHintText: parsed.replyHintText,
            replies: parsed.replies
          });
          if (comments.length >= commentLimit) {
            break;
          }
        }
        return {
          title: text(document.title) || "æœªè¯†åˆ«æ ‡é¢˜",
          description: text(
            document.querySelector('meta[name="description"]')?.getAttribute("content")
          ),
          authorName: pickText([
            '[data-e2e="video-author-name"]',
            '[class*="author"] a',
            '[class*="author"] span'
          ]),
          publishTimeText: pickText(["time", '[class*="time"]', '[data-e2e*="time"]']),
          likeCountText: pickText(['[class*="like"]', '[data-e2e*="like"]']),
          commentCountText: pickText(['[class*="comment-count"]', '[data-e2e*="comment"]']),
          shareCountText: pickText(['[class*="share"]', '[data-e2e*="share"]']),
          rawTextPreview: text(document.body.innerText)?.slice(0, 1e3),
          comments
        };
      },
      { commentLimit: input.commentLimit }
    );
    return {
      url: finalUrl,
      title: detail.title,
      authorName: detail.authorName,
      publishTimeText: detail.publishTimeText,
      likeCountText: detail.likeCountText,
      commentCountText: detail.commentCountText,
      shareCountText: detail.shareCountText,
      description: detail.description,
      rawTextPreview: detail.rawTextPreview,
      comments: detail.comments
    };
  }
  async prepareComments(page, commentLimit, videoIndex) {
    this.pushLog(`ä½œå“� ${videoIndex}ï¼šå¼€å§‹å‡†å¤‡è¯„è®ºåŒº`);
    const prepared = await this.ensureCommentSectionVisible(page, videoIndex);
    if (!prepared) {
      throw new Error(`ä½œå“� ${videoIndex}ï¼šæœªèƒ½å®šä½�åˆ°è¯„è®ºåŒº`);
    }
    await this.scrollIntoCommentList(page, videoIndex);
    await this.expandVisibleCommentContent(page);
    await this.scrollCommentArea(page, commentLimit, videoIndex);
    await this.expandVisibleCommentContent(page);
    const currentCount = await this.countLikelyComments(page);
    this.pushLog(`ä½œå“� ${videoIndex}ï¼šè¯„è®ºåŒºå‡†å¤‡å®Œæˆ�ï¼Œå½“å‰�è¯†åˆ«çº¦ ${currentCount} æ�¡å€™é€‰è¯„è®º`);
  }
  async ensureCommentSectionVisible(page, videoIndex) {
    this.pushLog(`ä½œå“� ${videoIndex}ï¼šå¼€å§‹æ•´é¡µå�‘ä¸‹æ»šåŠ¨æŸ¥æ‰¾è¯„è®ºåŒº`);
    return await this.scrollToCommentSection(page, videoIndex);
  }
  async expandVisibleCommentContent(page) {
    const texts = ["å±•å¼€", "å…¨æ–‡", "æ›´å¤š", "å›žå¤�", "æŸ¥çœ‹å›žå¤�"];
    for (const text of texts) {
      const nodes = page.getByText(new RegExp(text)).locator("visible=true");
      const count = await nodes.count().catch(() => 0);
      const limit = Math.min(count, 8);
      for (let index = 0; index < limit; index += 1) {
        try {
          await nodes.nth(index).click({ timeout: 1e3 });
          await page.waitForTimeout(this.randomDelay(250, 450));
        } catch {
        }
      }
    }
  }
  async scrollCommentArea(page, targetCount, videoIndex) {
    const maxRounds = Math.min(40, Math.max(8, Math.ceil(targetCount * 1.5)));
    let stagnantRounds = 0;
    let previousCount = 0;
    let previousScrollY = -1;
    for (let round = 0; round < maxRounds; round += 1) {
      if (this.stopRequested) {
        this.pushLog(`ä½œå“� ${videoIndex}ï¼šæ”¶åˆ°å�œæ­¢è¯·æ±‚ï¼Œç»“æ�Ÿè¯„è®ºæ»šåŠ¨`);
        return;
      }
      const currentCount = await this.countLikelyComments(page);
      const currentScrollY = await page.evaluate(() => window.scrollY);
      this.pushLog(
        `ä½œå“� ${videoIndex}ï¼šè¯„è®ºåŒºæ»šåŠ¨ç¬¬ ${round + 1} è½®å‰�ï¼Œå½“å‰�çº¦ ${currentCount} æ�¡å€™é€‰è¯„è®ºï¼ŒscrollY=${Math.round(currentScrollY)}`
      );
      if (currentCount >= targetCount) {
        this.pushLog(`ä½œå“� ${videoIndex}ï¼šè¯„è®ºåŒºå·²åŠ è½½çº¦ ${currentCount} æ�¡å€™é€‰è¯„è®ºï¼Œè¾¾åˆ°ç›®æ ‡`);
        break;
      }
      if (currentCount <= previousCount && Math.abs(currentScrollY - previousScrollY) < 40) {
        stagnantRounds += 1;
      } else {
        stagnantRounds = 0;
        previousCount = currentCount;
        previousScrollY = currentScrollY;
      }
      if (stagnantRounds >= 3) {
        this.pushLog(`ä½œå“� ${videoIndex}ï¼šè¯„è®ºåŒºå·²è¾¾åˆ°å½“å‰�æœ€å¤§å�¯é‡‡é›†å€¼ï¼Œå�œæ­¢ç»§ç»­æ»šåŠ¨å¹¶è¿›å…¥ä¸‹ä¸€ä¸ªä½œå“�`);
        break;
      }
      await page.evaluate(() => {
        const scrollElement = document.scrollingElement || document.documentElement;
        scrollElement.scrollBy({ top: 900, behavior: "instant" });
      });
      await page.waitForTimeout(this.randomDelay(900, 1400));
      await this.expandVisibleCommentContent(page);
      const afterCount = await this.countLikelyComments(page);
      const afterScrollY = await page.evaluate(() => window.scrollY);
      this.pushLog(
        `ä½œå“� ${videoIndex}ï¼šè¯„è®ºåŒºæ»šåŠ¨ç¬¬ ${round + 1} è½®å�Žï¼Œå½“å‰�çº¦ ${afterCount} æ�¡å€™é€‰è¯„è®ºï¼ŒscrollY=${Math.round(afterScrollY)}`
      );
    }
  }
  async countLikelyComments(page) {
    return await page.evaluate(() => {
      const text = (value) => value?.replace(/\s+/g, " ").trim() || "";
      const scopeRoot = Array.from(document.querySelectorAll("div, section, main")).find((node) => {
        const element = node;
        const raw = text(element.innerText);
        const rect = element.getBoundingClientRect();
        const inMainColumn = rect.left < window.innerWidth * 0.78;
        return inMainColumn && (raw.includes("å…¨éƒ¨è¯„è®º") || raw.includes("ç•™ä¸‹ä½ çš„ç²¾å½©è¯„è®ºå�§"));
      }) || null;
      if (!scopeRoot) {
        return 0;
      }
      const authors = Array.from(
        scopeRoot.querySelectorAll('a[href*="/user/"], a[href*="sec_uid="], a[href*="modal_id="]')
      );
      const roots = /* @__PURE__ */ new Set();
      for (const author of authors) {
        let current = author.parentElement;
        let depth = 0;
        while (current && depth < 8) {
          const raw = text(current.innerText);
          const hasTime = /(\d+\s*åˆ†é’Ÿå‰�|\d+\s*å°�æ—¶å‰�|\d+\s*å¤©å‰�|\d{1,2}-\d{1,2})/.test(raw);
          const hasReplyOrShare = /(å›žå¤�|åˆ†äº«|å±•å¼€\d+æ�¡å›žå¤�)/.test(raw);
          const lineCount = current.innerText.split("\n").map((line) => line.trim()).filter(Boolean).length;
          if (raw.length >= 8 && lineCount >= 2 && (hasTime || hasReplyOrShare)) {
            roots.add(current);
            break;
          }
          current = current.parentElement;
          depth += 1;
        }
      }
      return roots.size;
    });
  }
  async isCommentSectionVisible(page) {
    return await page.evaluate(() => {
      const text = (value) => value?.replace(/\s+/g, " ").trim() || "";
      const candidates = Array.from(document.querySelectorAll("div, section, main"));
      return candidates.some((node) => {
        const element = node;
        const raw = text(element.innerText);
        if (!raw || raw.length < 8) return false;
        const rect = element.getBoundingClientRect();
        const inMainColumn = rect.left < window.innerWidth * 0.78;
        const hasCommentSection = /å…¨éƒ¨è¯„è®º/.test(raw) || /ç•™ä¸‹ä½ çš„ç²¾å½©è¯„è®ºå�§/.test(raw);
        const hasMeta = /(\d+\s*åˆ†é’Ÿå‰�|\d+\s*å°�æ—¶å‰�|\d+\s*å¤©å‰�|\d{1,2}-\d{1,2}|å›žå¤�|åˆ†äº«)/.test(raw);
        const positionedLower = element.getBoundingClientRect().top < window.innerHeight;
        return inMainColumn && hasCommentSection && hasMeta && positionedLower;
      });
    });
  }
  async scrollIntoCommentList(page, videoIndex) {
    const maxRounds = 12;
    for (let round = 0; round < maxRounds; round += 1) {
      if (this.stopRequested) {
        this.pushLog(`ä½œå“� ${videoIndex}ï¼šæ”¶åˆ°å�œæ­¢è¯·æ±‚ï¼Œç»“æ�Ÿè¯„è®ºåˆ—è¡¨å®šä½�`);
        return;
      }
      const currentCount = await this.countLikelyComments(page);
      if (currentCount > 0) {
        this.pushLog(`ä½œå“� ${videoIndex}ï¼šå·²è¿›å…¥è¯„è®ºåˆ—è¡¨åŒºåŸŸï¼Œå½“å‰�çº¦ ${currentCount} æ�¡å€™é€‰è¯„è®º`);
        return;
      }
      this.pushLog(`ä½œå“� ${videoIndex}ï¼šå·²åˆ°è¯„è®ºåŒºé¡¶éƒ¨ï¼Œç»§ç»­ä¸‹æ»šè¿›å…¥è¯„è®ºåˆ—è¡¨ï¼Œç¬¬ ${round + 1} è½®`);
      await page.mouse.wheel(0, 700);
      await page.waitForTimeout(this.randomDelay(700, 1e3));
    }
    this.pushLog(`ä½œå“� ${videoIndex}ï¼šå·²å®šä½�è¯„è®ºåŒºé¡¶éƒ¨ï¼Œä½†ä»�æœªè¯†åˆ«åˆ°è¯„è®ºå�¡ç‰‡`);
  }
  async scrollToCommentSection(page, videoIndex) {
    const maxRounds = 20;
    for (let round = 0; round < maxRounds; round += 1) {
      if (this.stopRequested) {
        this.pushLog(`ä½œå“� ${videoIndex}ï¼šæ”¶åˆ°å�œæ­¢è¯·æ±‚ï¼Œç»“æ�Ÿè¯„è®ºåŒºæŸ¥æ‰¾`);
        return false;
      }
      const visible = await this.isCommentSectionVisible(page);
      if (visible) {
        this.pushLog(`ä½œå“� ${videoIndex}ï¼šå·²å®šä½�åˆ°è¯„è®ºåŒºï¼Œç¬¬ ${round + 1} æ¬¡æ£€æµ‹æˆ�åŠŸ`);
        return true;
      }
      this.pushLog(`ä½œå“� ${videoIndex}ï¼šç¬¬ ${round + 1} æ¬¡å�‘ä¸‹æ»šåŠ¨é¡µé�¢ä»¥æŸ¥æ‰¾è¯„è®ºåŒº`);
      await page.mouse.wheel(0, 900);
      await page.waitForTimeout(this.randomDelay(900, 1300));
    }
    this.pushLog(`ä½œå“� ${videoIndex}ï¼šæ»šåŠ¨é¡µé�¢å�Žä»�æœªæ‰¾åˆ°â€œå…¨éƒ¨è¯„è®ºâ€�åŒºåŸŸ`);
    return false;
  }
  async exportResults(input, results) {
    const runDirectory = this.resolveRunDirectory(input);
    await promises.mkdir(runDirectory, { recursive: true });
    await this.prepareExportFiles(input);
    await this.persistResults(input, results);
    return {
      exportDir: runDirectory,
      jsonPath: this.currentJsonPath,
      markdownPath: this.currentMarkdownPath
    };
  }
  async prepareExportFiles(input) {
    if (this.currentJsonPath && this.currentMarkdownPath) {
      return;
    }
    const runDirectory = this.resolveRunDirectory(input);
    await promises.mkdir(runDirectory, { recursive: true });
    const timestamp = (/* @__PURE__ */ new Date()).toISOString().replaceAll(":", "-");
    this.currentJsonPath = path$1.join(runDirectory, `douyin-result-${timestamp}.json`);
    this.currentMarkdownPath = path$1.join(runDirectory, `douyin-result-${timestamp}.md`);
    await this.persistResults(input, []);
  }
  async persistResults(input, results) {
    if (!this.currentJsonPath || !this.currentMarkdownPath) {
      return;
    }
    await promises.writeFile(
      this.currentJsonPath,
      JSON.stringify(
        {
          mode: input.mode,
          keyword: input.keyword,
          videoUrls: this.parseVideoUrls(input.videoUrlsText),
          liveRoomUrl: input.liveRoomUrl,
          creatorProfileUrl: input.creatorProfileUrl,
          creatorMonitorIntervalMinutes: input.creatorMonitorIntervalMinutes,
          liveMonitorEnabled: input.liveMonitorEnabled,
          liveMonitorIntervalSeconds: input.liveMonitorIntervalSeconds,
          liveMonitorMinutes: input.liveMonitorMinutes,
          commentLimit: input.commentLimit,
          maxVideos: input.maxVideos,
          exportedAt: (/* @__PURE__ */ new Date()).toISOString(),
          results
        },
        null,
        2
      ),
      "utf8"
    );
    const markdown = this.buildMarkdown(input, results);
    await promises.writeFile(this.currentMarkdownPath, markdown, "utf8");
  }
  buildMarkdown(input, results) {
    const lines = [
      "# æŠ–éŸ³é‡‡é›†æŠ¥å‘Š",
      "",
      `- é‡‡é›†æ¨¡å¼�ï¼š${input.mode === "link" ? "ä½œå“�é“¾æŽ¥é‡‡é›†" : input.mode === "live" ? "ç›´æ’­é—´è¯„è®ºé‡‡é›†" : "å…³é”®è¯�æ�œç´¢ä½œå“�"}`,
      `- å…³é”®è¯�ï¼š${input.keyword || "æ— "}`,
      ...input.mode === "link" ? [`- æŒ‡å®šé“¾æŽ¥æ•°ï¼š${this.parseVideoUrls(input.videoUrlsText).length}`] : input.mode === "live" ? [
        `- ç›´æ’­é—´é“¾æŽ¥ï¼š${input.liveRoomUrl || "æ— "}`,
        `- æŒ�ç»­ç›‘æŽ§ï¼š${input.liveMonitorEnabled ? input.liveMonitorMinutes ? `æ˜¯ï¼ˆ${input.liveMonitorMinutes} åˆ†é’Ÿï¼Œè½®è¯¢é—´éš” ${input.liveMonitorIntervalSeconds || 5} ç§’ï¼‰` : `æ˜¯ï¼ˆä¸�é™�æ—¶ï¼Œè½®è¯¢é—´éš” ${input.liveMonitorIntervalSeconds || 5} ç§’ï¼‰` : "å�¦"}`
      ] : [`- æœ€å¤šä½œå“�æ•°ï¼š${input.maxVideos}`],
      `- æ¯�ä¸ªä½œå“�è¯„è®ºç›®æ ‡ï¼š${input.commentLimit}`,
      `- å¯¼å‡ºæ—¶é—´ï¼š${(/* @__PURE__ */ new Date()).toLocaleString("zh-CN", { hour12: false })}`,
      `- ä½œå“�æ•°ï¼š${results.length}`,
      ""
    ];
    for (const [index, result] of results.entries()) {
      lines.push(`## ä½œå“� ${index + 1}`);
      lines.push("");
      lines.push(`- æ ‡é¢˜ï¼š${result.title}`);
      lines.push(`- é“¾æŽ¥ï¼š${result.url}`);
      lines.push(`- ä½œè€…ï¼š${result.authorName || "æœªè¯†åˆ«"}`);
      lines.push(`- å�‘å¸ƒæ—¶é—´ï¼š${result.publishTimeText || "æœªè¯†åˆ«"}`);
      lines.push(`- ç‚¹èµžï¼š${result.likeCountText || "æœªè¯†åˆ«"}`);
      lines.push(`- è¯„è®ºæ•°ï¼š${result.commentCountText || "æœªè¯†åˆ«"}`);
      lines.push(`- åˆ†äº«æ•°ï¼š${result.shareCountText || "æœªè¯†åˆ«"}`);
      lines.push("");
      lines.push("### è¯„è®º");
      lines.push("");
      if (!result.comments.length) {
        lines.push("æš‚æ— å�¯è¯†åˆ«è¯„è®º");
        lines.push("");
        continue;
      }
      for (const [commentIndex, comment] of result.comments.entries()) {
        lines.push(`${commentIndex + 1}. ç”¨æˆ·ï¼š${comment.authorName}`);
        if (comment.authorUniqueId) {
          lines.push(`   ç”¨æˆ·æ ‡è¯†ï¼š${comment.authorUniqueId}`);
        }
        if (comment.authorProfileUrl) {
          lines.push(`   ä¸»é¡µï¼š${comment.authorProfileUrl}`);
        }
        if (comment.commentId) {
          lines.push(`   è¯„è®ºIDï¼š${comment.commentId}`);
        }
        lines.push(`   å†…å®¹ï¼š${comment.content}`);
        if (comment.publishTimeText) {
          lines.push(`   æ—¶é—´ï¼š${comment.publishTimeText}`);
        }
        if (comment.likeCountText) {
          lines.push(`   ç‚¹èµžï¼š${comment.likeCountText}`);
        }
        if (comment.replyHintText) {
          lines.push(`   å›žå¤�æ��ç¤ºï¼š${comment.replyHintText}`);
        }
        if (comment.replies?.length) {
          lines.push("   å›žå¤�ï¼š");
          for (const [replyIndex, reply] of comment.replies.entries()) {
            lines.push(`   ${replyIndex + 1}. ${reply.authorName}ï¼š${reply.content}`);
            if (reply.authorUniqueId) {
              lines.push(`      ç”¨æˆ·æ ‡è¯†ï¼š${reply.authorUniqueId}`);
            }
            if (reply.authorProfileUrl) {
              lines.push(`      ä¸»é¡µï¼š${reply.authorProfileUrl}`);
            }
            if (reply.publishTimeText) {
              lines.push(`      æ—¶é—´ï¼š${reply.publishTimeText}`);
            }
            if (reply.likeCountText) {
              lines.push(`      ç‚¹èµžï¼š${reply.likeCountText}`);
            }
          }
        }
        lines.push("");
      }
    }
    return lines.join("\n");
  }
  resolveRunDirectory(input) {
    return this.currentRunDirectory || this.createRunDirectory(input);
  }
  randomDelay(min, max) {
    return Math.floor(Math.random() * (max - min + 1)) + min;
  }
  async runWithTimeout(promise, timeoutMs, timeoutMessage) {
    let timeoutId;
    try {
      return await Promise.race([
        promise,
        new Promise((_, reject) => {
          timeoutId = setTimeout(() => {
            reject(new Error(timeoutMessage));
          }, timeoutMs);
        })
      ]);
    } finally {
      if (timeoutId) {
        clearTimeout(timeoutId);
      }
    }
  }
  createRunDirectory(input) {
    const rootDir = input.exportDir || this.options.exportRootDir;
    const baseName = input.mode === "link" ? "douyin-link-task" : input.mode === "live" ? "douyin-live-task" : input.keyword.replace(/[^\p{L}\p{N}_-]+/gu, "-").slice(0, 40) || "douyin";
    const timestamp = (/* @__PURE__ */ new Date()).toISOString().replaceAll(":", "-").replaceAll(".", "-");
    return path$1.join(rootDir, baseName, timestamp);
  }
  resetStateForNewRun(input) {
    this.state = {
      ...DEFAULT_STATE,
      isBrowserReady: Boolean(this.context),
      currentMode: input.mode,
      currentKeyword: this.describeTaskInput(input),
      totalVideos: input.mode === "link" ? this.parseVideoUrls(input.videoUrlsText).length : input.mode === "live" ? 1 : input.maxVideos,
      logs: []
    };
  }
  describeTaskInput(input) {
    if (input.mode === "live") {
      return input.liveRoomUrl || "ç›´æ’­é—´é“¾æŽ¥";
    }
    if (input.mode === "creator") {
      return input.creatorProfileUrl || "ä¸»æ’­ä¸»é¡µé“¾æŽ¥";
    }
    if (input.mode === "link") {
      const urls = this.parseVideoUrls(input.videoUrlsText);
      if (urls.length === 1) {
        return urls[0];
      }
      return `${urls.length} ä¸ªä½œå“�é“¾æŽ¥`;
    }
    return input.keyword;
  }
  async safeStopTracing() {
    if (!this.context) return;
    try {
      await this.context.tracing.stop();
    } catch {
    }
  }
  pushLog(message) {
    const timestamp = (/* @__PURE__ */ new Date()).toLocaleTimeString("zh-CN", { hour12: false });
    const nextLogs = [`[${timestamp}] ${message}`, ...this.state.logs].slice(0, 120);
    this.state = {
      ...this.state,
      logs: nextLogs
    };
  }
  updateState(patch) {
    this.state = {
      ...this.state,
      ...patch
    };
  }
}
let mainWindow = null;
let douyinTaskRunner = null;
let versionStatus = {
  currentVersion: electron.app.getVersion(),
  hasUpdate: false,
  latestVersion: void 0,
  status: "idle",
  message: "å‡†å¤‡æ£€æŸ¥æ›´æ–°"
};
function createWindow() {
  mainWindow = new electron.BrowserWindow({
    width: 900,
    height: 760,
    minWidth: 880,
    minHeight: 720,
    show: false,
    autoHideMenuBar: true,
    ...process.platform === "linux" ? { icon } : {},
    webPreferences: {
      preload: path.join(__dirname, "../preload/index.js"),
      sandbox: false
    }
  });
  mainWindow.on("ready-to-show", () => {
    mainWindow?.show();
  });
  mainWindow.webContents.setWindowOpenHandler((details) => {
    electron.shell.openExternal(details.url);
    return { action: "deny" };
  });
  if (utils.is.dev && process.env["ELECTRON_RENDERER_URL"]) {
    mainWindow.loadURL(process.env["ELECTRON_RENDERER_URL"]);
  } else {
    mainWindow.loadFile(path.join(__dirname, "../renderer/index.html"));
  }
}
function registerDouyinIpcHandlers() {
  const userDataPath = electron.app.getPath("userData");
  douyinTaskRunner = new DouyinTaskRunner({
    profileDir: path.join(userDataPath, "playwright", "douyin-profile"),
    exportRootDir: path.join(userDataPath, "exports"),
    traceRootDir: path.join(userDataPath, "traces")
  });
  electron.ipcMain.handle("douyin:prepare-session", async () => {
    return await douyinTaskRunner.prepareSession();
  });
  electron.ipcMain.handle("douyin:start-task", async (_, input) => {
    return await douyinTaskRunner.startTask(input);
  });
  electron.ipcMain.handle("douyin:stop-task", () => {
    return douyinTaskRunner.stopTask();
  });
  electron.ipcMain.handle("douyin:get-state", () => {
    return douyinTaskRunner.getState();
  });
  electron.ipcMain.handle("douyin:open-export-dir", async (_, directoryPath) => {
    const fallbackPath = path.join(userDataPath, "exports");
    const targetPath = directoryPath?.trim() || fallbackPath;
    return await electron.shell.openPath(targetPath);
  });
  electron.ipcMain.handle("client:get-device-profile", () => {
    const rawDeviceId = `${electron.app.getName()}|${electron.app.getVersion()}|${os.hostname()}|${os.platform()}|${os.arch()}`;
    const deviceId = node_crypto.createHash("sha256").update(rawDeviceId).digest("hex").slice(0, 24);
    return {
      deviceId,
      deviceName: os.hostname(),
      platform: `${os.platform()} ${os.arch()}`,
      appVersion: electron.app.getVersion()
    };
  });
  electron.ipcMain.handle("client:get-version-status", () => {
    return versionStatus;
  });
  electron.ipcMain.handle("client:check-updates", async () => {
    try {
      versionStatus = {
        ...versionStatus,
        status: "checking",
        message: "æ­£åœ¨æ£€æŸ¥æ›´æ–°..."
      };
      electronUpdater.autoUpdater.autoDownload = false;
      const result = await electronUpdater.autoUpdater.checkForUpdates();
      const updateInfo = result?.updateInfo;
      const latestVersion = updateInfo?.version;
      const hasUpdate = Boolean(latestVersion && latestVersion !== electron.app.getVersion());
      versionStatus = {
        ...versionStatus,
        hasUpdate,
        latestVersion,
        status: hasUpdate ? "available" : "none",
        message: hasUpdate ? `å�‘çŽ°æ–°ç‰ˆæœ¬ ${latestVersion}` : "å½“å‰�å·²æ˜¯æœ€æ–°ç‰ˆæœ¬"
      };
    } catch (error) {
      const message = error instanceof Error ? error.message : "æ£€æŸ¥æ›´æ–°å¤±è´¥";
      versionStatus = {
        ...versionStatus,
        status: "error",
        message
      };
    }
    return versionStatus;
  });
  electron.ipcMain.handle("client:download-update", async () => {
    try {
      versionStatus = {
        ...versionStatus,
        status: "downloading",
        message: "æ­£åœ¨ä¸‹è½½æ›´æ–°..."
      };
      await electronUpdater.autoUpdater.downloadUpdate();
      versionStatus = {
        ...versionStatus,
        status: "downloaded",
        message: "æ›´æ–°å·²ä¸‹è½½å®Œæˆ�ï¼Œå‡†å¤‡å®‰è£…"
      };
    } catch (error) {
      const message = error instanceof Error ? error.message : "ä¸‹è½½æ›´æ–°å¤±è´¥";
      versionStatus = {
        ...versionStatus,
        status: "error",
        message
      };
    }
    return versionStatus;
  });
  electron.ipcMain.handle("client:quit-and-install-update", () => {
    electronUpdater.autoUpdater.quitAndInstall();
    return true;
  });
}
electron.app.whenReady().then(() => {
  utils.electronApp.setAppUserModelId("com.electron");
  electron.app.on("browser-window-created", (_, window2) => {
    utils.optimizer.watchWindowShortcuts(window2);
  });
  electron.ipcMain.on("ping", () => console.log("pong"));
  registerDouyinIpcHandlers();
  createWindow();
  electron.app.on("activate", function() {
    if (electron.BrowserWindow.getAllWindows().length === 0) createWindow();
  });
});
electron.app.on("window-all-closed", () => {
  if (process.platform !== "darwin") {
    electron.app.quit();
  }
});
"use strict";
const electron = require("electron");
const preload = require("@electron-toolkit/preload");
const api = {
  prepareDouyinSession: () => preload.electronAPI.ipcRenderer.invoke("douyin:prepare-session"),
  startDouyinTask: (input) => preload.electronAPI.ipcRenderer.invoke("douyin:start-task", input),
  stopDouyinTask: () => preload.electronAPI.ipcRenderer.invoke("douyin:stop-task"),
  getDouyinTaskState: () => preload.electronAPI.ipcRenderer.invoke("douyin:get-state"),
  openExportDirectory: (directoryPath) => preload.electronAPI.ipcRenderer.invoke("douyin:open-export-dir", directoryPath),
  getDeviceProfile: () => preload.electronAPI.ipcRenderer.invoke("client:get-device-profile"),
  getVersionStatus: () => preload.electronAPI.ipcRenderer.invoke("client:get-version-status"),
  checkUpdates: () => preload.electronAPI.ipcRenderer.invoke("client:check-updates"),
  downloadUpdate: () => preload.electronAPI.ipcRenderer.invoke("client:download-update"),
  quitAndInstallUpdate: () => preload.electronAPI.ipcRenderer.invoke("client:quit-and-install-update")
};
if (process.contextIsolated) {
  try {
    electron.contextBridge.exposeInMainWorld("electron", preload.electronAPI);
    electron.contextBridge.exposeInMainWorld("api", api);
  } catch (error) {
    console.error(error);
  }
} else {
  window.electron = preload.electronAPI;
  window.api = api;
}
// @__NO_SIDE_EFFECTS__
function makeMap(str) {
  const map = /* @__PURE__ */ Object.create(null);
  for (const key of str.split(",")) map[key] = 1;
  return (val) => val in map;
}
const EMPTY_OBJ = {};
const EMPTY_ARR = [];
const NOOP = () => {
};
const NO = () => false;
const isOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // uppercase letter
(key.charCodeAt(2) > 122 || key.charCodeAt(2) < 97);
const isModelListener = (key) => key.startsWith("onUpdate:");
const extend = Object.assign;
const remove = (arr, el) => {
  const i = arr.indexOf(el);
  if (i > -1) {
    arr.splice(i, 1);
  }
};
const hasOwnProperty$1 = Object.prototype.hasOwnProperty;
const hasOwn = (val, key) => hasOwnProperty$1.call(val, key);
const isArray = Array.isArray;
const isMap = (val) => toTypeString(val) === "[object Map]";
const isSet = (val) => toTypeString(val) === "[object Set]";
const isDate = (val) => toTypeString(val) === "[object Date]";
const isFunction = (val) => typeof val === "function";
const isString = (val) => typeof val === "string";
const isSymbol = (val) => typeof val === "symbol";
const isObject = (val) => val !== null && typeof val === "object";
const isPromise = (val) => {
  return (isObject(val) || isFunction(val)) && isFunction(val.then) && isFunction(val.catch);
};
const objectToString = Object.prototype.toString;
const toTypeString = (value) => objectToString.call(value);
const toRawType = (value) => {
  return toTypeString(value).slice(8, -1);
};
const isPlainObject = (val) => toTypeString(val) === "[object Object]";
const isIntegerKey = (key) => isString(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key;
const isReservedProp = /* @__PURE__ */ makeMap(
  // the leading comma is intentional so empty string "" is also included
  ",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"
);
const cacheStringFunction = (fn) => {
  const cache = /* @__PURE__ */ Object.create(null);
  return ((str) => {
    const hit = cache[str];
    return hit || (cache[str] = fn(str));
  });
};
const camelizeRE = /-\w/g;
const camelize = cacheStringFunction(
  (str) => {
    return str.replace(camelizeRE, (c) => c.slice(1).toUpperCase());
  }
);
const hyphenateRE = /\B([A-Z])/g;
const hyphenate = cacheStringFunction(
  (str) => str.replace(hyphenateRE, "-$1").toLowerCase()
);
const capitalize = cacheStringFunction((str) => {
  return str.charAt(0).toUpperCase() + str.slice(1);
});
const toHandlerKey = cacheStringFunction(
  (str) => {
    const s = str ? `on${capitalize(str)}` : ``;
    return s;
  }
);
const hasChanged = (value, oldValue) => !Object.is(value, oldValue);
const invokeArrayFns = (fns, ...arg) => {
  for (let i = 0; i < fns.length; i++) {
    fns[i](...arg);
  }
};
const def = (obj, key, value, writable = false) => {
  Object.defineProperty(obj, key, {
    configurable: true,
    enumerable: false,
    writable,
    value
  });
};
const looseToNumber = (val) => {
  const n = parseFloat(val);
  return isNaN(n) ? val : n;
};
let _globalThis;
const getGlobalThis = () => {
  return _globalThis || (_globalThis = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {});
};
function normalizeStyle(value) {
  if (isArray(value)) {
    const res = {};
    for (let i = 0; i < value.length; i++) {
      const item = value[i];
      const normalized = isString(item) ? parseStringStyle(item) : normalizeStyle(item);
      if (normalized) {
        for (const key in normalized) {
          res[key] = normalized[key];
        }
      }
    }
    return res;
  } else if (isString(value) || isObject(value)) {
    return value;
  }
}
const listDelimiterRE = /;(?![^(]*\))/g;
const propertyDelimiterRE = /:([^]+)/;
const styleCommentRE = /\/\*[^]*?\*\//g;
function parseStringStyle(cssText) {
  const ret = {};
  cssText.replace(styleCommentRE, "").split(listDelimiterRE).forEach((item) => {
    if (item) {
      const tmp = item.split(propertyDelimiterRE);
      tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim());
    }
  });
  return ret;
}
function normalizeClass(value) {
  let res = "";
  if (isString(value)) {
    res = value;
  } else if (isArray(value)) {
    for (let i = 0; i < value.length; i++) {
      const normalized = normalizeClass(value[i]);
      if (normalized) {
        res += normalized + " ";
      }
    }
  } else if (isObject(value)) {
    for (const name in value) {
      if (value[name]) {
        res += name + " ";
      }
    }
  }
  return res.trim();
}
const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;
const isSpecialBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs);
function includeBooleanAttr(value) {
  return !!value || value === "";
}
function looseCompareArrays(a, b) {
  if (a.length !== b.length) return false;
  let equal = true;
  for (let i = 0; equal && i < a.length; i++) {
    equal = looseEqual(a[i], b[i]);
  }
  return equal;
}
function looseEqual(a, b) {
  if (a === b) return true;
  let aValidType = isDate(a);
  let bValidType = isDate(b);
  if (aValidType || bValidType) {
    return aValidType && bValidType ? a.getTime() === b.getTime() : false;
  }
  aValidType = isSymbol(a);
  bValidType = isSymbol(b);
  if (aValidType || bValidType) {
    return a === b;
  }
  aValidType = isArray(a);
  bValidType = isArray(b);
  if (aValidType || bValidType) {
    return aValidType && bValidType ? looseCompareArrays(a, b) : false;
  }
  aValidType = isObject(a);
  bValidType = isObject(b);
  if (aValidType || bValidType) {
    if (!aValidType || !bValidType) {
      return false;
    }
    const aKeysCount = Object.keys(a).length;
    const bKeysCount = Object.keys(b).length;
    if (aKeysCount !== bKeysCount) {
      return false;
    }
    for (const key in a) {
      const aHasKey = a.hasOwnProperty(key);
      const bHasKey = b.hasOwnProperty(key);
      if (aHasKey && !bHasKey || !aHasKey && bHasKey || !looseEqual(a[key], b[key])) {
        return false;
      }
    }
  }
  return String(a) === String(b);
}
function looseIndexOf(arr, val) {
  return arr.findIndex((item) => looseEqual(item, val));
}
const isRef$1 = (val) => {
  return !!(val && val["__v_isRef"] === true);
};
const toDisplayString = (val) => {
  return isString(val) ? val : val == null ? "" : isArray(val) || isObject(val) && (val.toString === objectToString || !isFunction(val.toString)) ? isRef$1(val) ? toDisplayString(val.value) : JSON.stringify(val, replacer, 2) : String(val);
};
const replacer = (_key, val) => {
  if (isRef$1(val)) {
    return replacer(_key, val.value);
  } else if (isMap(val)) {
    return {
      [`Map(${val.size})`]: [...val.entries()].reduce(
        (entries, [key, val2], i) => {
          entries[stringifySymbol(key, i) + " =>"] = val2;
          return entries;
        },
        {}
      )
    };
  } else if (isSet(val)) {
    return {
      [`Set(${val.size})`]: [...val.values()].map((v) => stringifySymbol(v))
    };
  } else if (isSymbol(val)) {
    return stringifySymbol(val);
  } else if (isObject(val) && !isArray(val) && !isPlainObject(val)) {
    return String(val);
  }
  return val;
};
const stringifySymbol = (v, i = "") => {
  var _a;
  return (
    // Symbol.description in es2019+ so we need to cast here to pass
    // the lib: es2016 check
    isSymbol(v) ? `Symbol(${(_a = v.description) != null ? _a : i})` : v
  );
};
let activeEffectScope;
class EffectScope {
  // TODO isolatedDeclarations "__v_skip"
  constructor(detached = false) {
    this.detached = detached;
    this._active = true;
    this._on = 0;
    this.effects = [];
    this.cleanups = [];
    this._isPaused = false;
    this._warnOnRun = true;
    this.__v_skip = true;
    if (!detached && activeEffectScope) {
      if (activeEffectScope.active) {
        this.parent = activeEffectScope;
        this.index = (activeEffectScope.scopes || (activeEffectScope.scopes = [])).push(
          this
        ) - 1;
      } else {
        this._active = false;
        this._warnOnRun = false;
      }
    }
  }
  get active() {
    return this._active;
  }
  pause() {
    if (this._active) {
      this._isPaused = true;
      let i, l;
      if (this.scopes) {
        for (i = 0, l = this.scopes.length; i < l; i++) {
          this.scopes[i].pause();
        }
      }
      for (i = 0, l = this.effects.length; i < l; i++) {
        this.effects[i].pause();
      }
    }
  }
  /**
   * Resumes the effect scope, including all child scopes and effects.
   */
  resume() {
    if (this._active) {
      if (this._isPaused) {
        this._isPaused = false;
        let i, l;
        if (this.scopes) {
          for (i = 0, l = this.scopes.length; i < l; i++) {
            this.scopes[i].resume();
          }
        }
        for (i = 0, l = this.effects.length; i < l; i++) {
          this.effects[i].resume();
        }
      }
    }
  }
  run(fn) {
    if (this._active) {
      const currentEffectScope = activeEffectScope;
      try {
        activeEffectScope = this;
        return fn();
      } finally {
        activeEffectScope = currentEffectScope;
      }
    }
  }
  /**
   * This should only be called on non-detached scopes
   * @internal
   */
  on() {
    if (++this._on === 1) {
      this.prevScope = activeEffectScope;
      activeEffectScope = this;
    }
  }
  /**
   * This should only be called on non-detached scopes
   * @internal
   */
  off() {
    if (this._on > 0 && --this._on === 0) {
      if (activeEffectScope === this) {
        activeEffectScope = this.prevScope;
      } else {
        let current = activeEffectScope;
        while (current) {
          if (current.prevScope === this) {
            current.prevScope = this.prevScope;
            break;
          }
          current = current.prevScope;
        }
      }
      this.prevScope = void 0;
    }
  }
  stop(fromParent) {
    if (this._active) {
      this._active = false;
      let i, l;
      for (i = 0, l = this.effects.length; i < l; i++) {
        this.effects[i].stop();
      }
      this.effects.length = 0;
      for (i = 0, l = this.cleanups.length; i < l; i++) {
        this.cleanups[i]();
      }
      this.cleanups.length = 0;
      if (this.scopes) {
        for (i = 0, l = this.scopes.length; i < l; i++) {
          this.scopes[i].stop(true);
        }
        this.scopes.length = 0;
      }
      if (!this.detached && this.parent && !fromParent) {
        const last = this.parent.scopes.pop();
        if (last && last !== this) {
          this.parent.scopes[this.index] = last;
          last.index = this.index;
        }
      }
      this.parent = void 0;
    }
  }
}
function getCurrentScope() {
  return activeEffectScope;
}
let activeSub;
const pausedQueueEffects = /* @__PURE__ */ new WeakSet();
class ReactiveEffect {
  constructor(fn) {
    this.fn = fn;
    this.deps = void 0;
    this.depsTail = void 0;
    this.flags = 1 | 4;
    this.next = void 0;
    this.cleanup = void 0;
    this.scheduler = void 0;
    if (activeEffectScope) {
      if (activeEffectScope.active) {
        activeEffectScope.effects.push(this);
      } else {
        this.flags &= -2;
      }
    }
  }
  pause() {
    this.flags |= 64;
  }
  resume() {
    if (this.flags & 64) {
      this.flags &= -65;
      if (pausedQueueEffects.has(this)) {
        pausedQueueEffects.delete(this);
        this.trigger();
      }
    }
  }
  /**
   * @internal
   */
  notify() {
    if (this.flags & 2 && !(this.flags & 32)) {
      return;
    }
    if (!(this.flags & 8)) {
      batch(this);
    }
  }
  run() {
    if (!(this.flags & 1)) {
      return this.fn();
    }
    this.flags |= 2;
    cleanupEffect(this);
    prepareDeps(this);
    const prevEffect = activeSub;
    const prevShouldTrack = shouldTrack;
    activeSub = this;
    shouldTrack = true;
    try {
      return this.fn();
    } finally {
      cleanupDeps(this);
      activeSub = prevEffect;
      shouldTrack = prevShouldTrack;
      this.flags &= -3;
    }
  }
  stop() {
    if (this.flags & 1) {
      for (let link = this.deps; link; link = link.nextDep) {
        removeSub(link);
      }
      this.deps = this.depsTail = void 0;
      cleanupEffect(this);
      this.onStop && this.onStop();
      this.flags &= -2;
    }
  }
  trigger() {
    if (this.flags & 64) {
      pausedQueueEffects.add(this);
    } else if (this.scheduler) {
      this.scheduler();
    } else {
      this.runIfDirty();
    }
  }
  /**
   * @internal
   */
  runIfDirty() {
    if (isDirty(this)) {
      this.run();
    }
  }
  get dirty() {
    return isDirty(this);
  }
}
let batchDepth = 0;
let batchedSub;
let batchedComputed;
function batch(sub, isComputed = false) {
  sub.flags |= 8;
  if (isComputed) {
    sub.next = batchedComputed;
    batchedComputed = sub;
    return;
  }
  sub.next = batchedSub;
  batchedSub = sub;
}
function startBatch() {
  batchDepth++;
}
function endBatch() {
  if (--batchDepth > 0) {
    return;
  }
  if (batchedComputed) {
    let e = batchedComputed;
    batchedComputed = void 0;
    while (e) {
      const next = e.next;
      e.next = void 0;
      e.flags &= -9;
      e = next;
    }
  }
  let error;
  while (batchedSub) {
    let e = batchedSub;
    batchedSub = void 0;
    while (e) {
      const next = e.next;
      e.next = void 0;
      e.flags &= -9;
      if (e.flags & 1) {
        try {
          ;
          e.trigger();
        } catch (err) {
          if (!error) error = err;
        }
      }
      e = next;
    }
  }
  if (error) throw error;
}
function prepareDeps(sub) {
  for (let link = sub.deps; link; link = link.nextDep) {
    link.version = -1;
    link.prevActiveLink = link.dep.activeLink;
    link.dep.activeLink = link;
  }
}
function cleanupDeps(sub) {
  let head;
  let tail = sub.depsTail;
  let link = tail;
  while (link) {
    const prev = link.prevDep;
    if (link.version === -1) {
      if (link === tail) tail = prev;
      removeSub(link);
      removeDep(link);
    } else {
      head = link;
    }
    link.dep.activeLink = link.prevActiveLink;
    link.prevActiveLink = void 0;
    link = prev;
  }
  sub.deps = head;
  sub.depsTail = tail;
}
function isDirty(sub) {
  for (let link = sub.deps; link; link = link.nextDep) {
    if (link.dep.version !== link.version || link.dep.computed && (refreshComputed(link.dep.computed) || link.dep.version !== link.version)) {
      return true;
    }
  }
  if (sub._dirty) {
    return true;
  }
  return false;
}
function refreshComputed(computed2) {
  if (computed2.flags & 4 && !(computed2.flags & 16)) {
    return;
  }
  computed2.flags &= -17;
  if (computed2.globalVersion === globalVersion) {
    return;
  }
  computed2.globalVersion = globalVersion;
  if (!computed2.isSSR && computed2.flags & 128 && (!computed2.deps && !computed2._dirty || !isDirty(computed2))) {
    return;
  }
  computed2.flags |= 2;
  const dep = computed2.dep;
  const prevSub = activeSub;
  const prevShouldTrack = shouldTrack;
  activeSub = computed2;
  shouldTrack = true;
  try {
    prepareDeps(computed2);
    const value = computed2.fn(computed2._value);
    if (dep.version === 0 || hasChanged(value, computed2._value)) {
      computed2.flags |= 128;
      computed2._value = value;
      dep.version++;
    }
  } catch (err) {
    dep.version++;
    throw err;
  } finally {
    activeSub = prevSub;
    shouldTrack = prevShouldTrack;
    cleanupDeps(computed2);
    computed2.flags &= -3;
  }
}
function removeSub(link, soft = false) {
  const { dep, prevSub, nextSub } = link;
  if (prevSub) {
    prevSub.nextSub = nextSub;
    link.prevSub = void 0;
  }
  if (nextSub) {
    nextSub.prevSub = prevSub;
    link.nextSub = void 0;
  }
  if (dep.subs === link) {
    dep.subs = prevSub;
    if (!prevSub && dep.computed) {
      dep.computed.flags &= -5;
      for (let l = dep.computed.deps; l; l = l.nextDep) {
        removeSub(l, true);
      }
    }
  }
  if (!soft && !--dep.sc && dep.map) {
    dep.map.delete(dep.key);
  }
}
function removeDep(link) {
  const { prevDep, nextDep } = link;
  if (prevDep) {
    prevDep.nextDep = nextDep;
    link.prevDep = void 0;
  }
  if (nextDep) {
    nextDep.prevDep = prevDep;
    link.nextDep = void 0;
  }
}
let shouldTrack = true;
const trackStack = [];
function pauseTracking() {
  trackStack.push(shouldTrack);
  shouldTrack = false;
}
function resetTracking() {
  const last = trackStack.pop();
  shouldTrack = last === void 0 ? true : last;
}
function cleanupEffect(e) {
  const { cleanup } = e;
  e.cleanup = void 0;
  if (cleanup) {
    const prevSub = activeSub;
    activeSub = void 0;
    try {
      cleanup();
    } finally {
      activeSub = prevSub;
    }
  }
}
let globalVersion = 0;
class Link {
  constructor(sub, dep) {
    this.sub = sub;
    this.dep = dep;
    this.version = dep.version;
    this.nextDep = this.prevDep = this.nextSub = this.prevSub = this.prevActiveLink = void 0;
  }
}
class Dep {
  // TODO isolatedDeclarations "__v_skip"
  constructor(computed2) {
    this.computed = computed2;
    this.version = 0;
    this.activeLink = void 0;
    this.subs = void 0;
    this.map = void 0;
    this.key = void 0;
    this.sc = 0;
    this.__v_skip = true;
  }
  track(debugInfo) {
    if (!activeSub || !shouldTrack || activeSub === this.computed) {
      return;
    }
    let link = this.activeLink;
    if (link === void 0 || link.sub !== activeSub) {
      link = this.activeLink = new Link(activeSub, this);
      if (!activeSub.deps) {
        activeSub.deps = activeSub.depsTail = link;
      } else {
        link.prevDep = activeSub.depsTail;
        activeSub.depsTail.nextDep = link;
        activeSub.depsTail = link;
      }
      addSub(link);
    } else if (link.version === -1) {
      link.version = this.version;
      if (link.nextDep) {
        const next = link.nextDep;
        next.prevDep = link.prevDep;
        if (link.prevDep) {
          link.prevDep.nextDep = next;
        }
        link.prevDep = activeSub.depsTail;
        link.nextDep = void 0;
        activeSub.depsTail.nextDep = link;
        activeSub.depsTail = link;
        if (activeSub.deps === link) {
          activeSub.deps = next;
        }
      }
    }
    return link;
  }
  trigger(debugInfo) {
    this.version++;
    globalVersion++;
    this.notify(debugInfo);
  }
  notify(debugInfo) {
    startBatch();
    try {
      if (false) ;
      for (let link = this.subs; link; link = link.prevSub) {
        if (link.sub.notify()) {
          ;
          link.sub.dep.notify();
        }
      }
    } finally {
      endBatch();
    }
  }
}
function addSub(link) {
  link.dep.sc++;
  if (link.sub.flags & 4) {
    const computed2 = link.dep.computed;
    if (computed2 && !link.dep.subs) {
      computed2.flags |= 4 | 16;
      for (let l = computed2.deps; l; l = l.nextDep) {
        addSub(l);
      }
    }
    const currentTail = link.dep.subs;
    if (currentTail !== link) {
      link.prevSub = currentTail;
      if (currentTail) currentTail.nextSub = link;
    }
    link.dep.subs = link;
  }
}
const targetMap = /* @__PURE__ */ new WeakMap();
const ITERATE_KEY = /* @__PURE__ */ Symbol(
  ""
);
const MAP_KEY_ITERATE_KEY = /* @__PURE__ */ Symbol(
  ""
);
const ARRAY_ITERATE_KEY = /* @__PURE__ */ Symbol(
  ""
);
function track(target, type, key) {
  if (shouldTrack && activeSub) {
    let depsMap = targetMap.get(target);
    if (!depsMap) {
      targetMap.set(target, depsMap = /* @__PURE__ */ new Map());
    }
    let dep = depsMap.get(key);
    if (!dep) {
      depsMap.set(key, dep = new Dep());
      dep.map = depsMap;
      dep.key = key;
    }
    {
      dep.track();
    }
  }
}
function trigger(target, type, key, newValue, oldValue, oldTarget) {
  const depsMap = targetMap.get(target);
  if (!depsMap) {
    globalVersion++;
    return;
  }
  const run = (dep) => {
    if (dep) {
      {
        dep.trigger();
      }
    }
  };
  startBatch();
  if (type === "clear") {
    depsMap.forEach(run);
  } else {
    const targetIsArray = isArray(target);
    const isArrayIndex = targetIsArray && isIntegerKey(key);
    if (targetIsArray && key === "length") {
      const newLength = Number(newValue);
      depsMap.forEach((dep, key2) => {
        if (key2 === "length" || key2 === ARRAY_ITERATE_KEY || !isSymbol(key2) && key2 >= newLength) {
          run(dep);
        }
      });
    } else {
      if (key !== void 0 || depsMap.has(void 0)) {
        run(depsMap.get(key));
      }
      if (isArrayIndex) {
        run(depsMap.get(ARRAY_ITERATE_KEY));
      }
      switch (type) {
        case "add":
          if (!targetIsArray) {
            run(depsMap.get(ITERATE_KEY));
            if (isMap(target)) {
              run(depsMap.get(MAP_KEY_ITERATE_KEY));
            }
          } else if (isArrayIndex) {
            run(depsMap.get("length"));
          }
          break;
        case "delete":
          if (!targetIsArray) {
            run(depsMap.get(ITERATE_KEY));
            if (isMap(target)) {
              run(depsMap.get(MAP_KEY_ITERATE_KEY));
            }
          }
          break;
        case "set":
          if (isMap(target)) {
            run(depsMap.get(ITERATE_KEY));
          }
          break;
      }
    }
  }
  endBatch();
}
function reactiveReadArray(array) {
  const raw = /* @__PURE__ */ toRaw(array);
  if (raw === array) return raw;
  track(raw, "iterate", ARRAY_ITERATE_KEY);
  return /* @__PURE__ */ isShallow(array) ? raw : raw.map(toReactive);
}
function shallowReadArray(arr) {
  track(arr = /* @__PURE__ */ toRaw(arr), "iterate", ARRAY_ITERATE_KEY);
  return arr;
}
function toWrapped(target, item) {
  if (/* @__PURE__ */ isReadonly(target)) {
    return /* @__PURE__ */ isReactive(target) ? toReadonly(toReactive(item)) : toReadonly(item);
  }
  return toReactive(item);
}
const arrayInstrumentations = {
  __proto__: null,
  [Symbol.iterator]() {
    return iterator(this, Symbol.iterator, (item) => toWrapped(this, item));
  },
  concat(...args) {
    return reactiveReadArray(this).concat(
      ...args.map((x) => isArray(x) ? reactiveReadArray(x) : x)
    );
  },
  entries() {
    return iterator(this, "entries", (value) => {
      value[1] = toWrapped(this, value[1]);
      return value;
    });
  },
  every(fn, thisArg) {
    return apply(this, "every", fn, thisArg, void 0, arguments);
  },
  filter(fn, thisArg) {
    return apply(
      this,
      "filter",
      fn,
      thisArg,
      (v) => v.map((item) => toWrapped(this, item)),
      arguments
    );
  },
  find(fn, thisArg) {
    return apply(
      this,
      "find",
      fn,
      thisArg,
      (item) => toWrapped(this, item),
      arguments
    );
  },
  findIndex(fn, thisArg) {
    return apply(this, "findIndex", fn, thisArg, void 0, arguments);
  },
  findLast(fn, thisArg) {
    return apply(
      this,
      "findLast",
      fn,
      thisArg,
      (item) => toWrapped(this, item),
      arguments
    );
  },
  findLastIndex(fn, thisArg) {
    return apply(this, "findLastIndex", fn, thisArg, void 0, arguments);
  },
  // flat, flatMap could benefit from ARRAY_ITERATE but are not straight-forward to implement
  forEach(fn, thisArg) {
    return apply(this, "forEach", fn, thisArg, void 0, arguments);
  },
  includes(...args) {
    return searchProxy(this, "includes", args);
  },
  indexOf(...args) {
    return searchProxy(this, "indexOf", args);
  },
  join(separator) {
    return reactiveReadArray(this).join(separator);
  },
  // keys() iterator only reads `length`, no optimization required
  lastIndexOf(...args) {
    return searchProxy(this, "lastIndexOf", args);
  },
  map(fn, thisArg) {
    return apply(this, "map", fn, thisArg, void 0, arguments);
  },
  pop() {
    return noTracking(this, "pop");
  },
  push(...args) {
    return noTracking(this, "push", args);
  },
  reduce(fn, ...args) {
    return reduce(this, "reduce", fn, args);
  },
  reduceRight(fn, ...args) {
    return reduce(this, "reduceRight", fn, args);
  },
  shift() {
    return noTracking(this, "shift");
  },
  // slice could use ARRAY_ITERATE but also seems to beg for range tracking
  some(fn, thisArg) {
    return apply(this, "some", fn, thisArg, void 0, arguments);
  },
  splice(...args) {
    return noTracking(this, "splice", args);
  },
  toReversed() {
    return reactiveReadArray(this).toReversed();
  },
  toSorted(comparer) {
    return reactiveReadArray(this).toSorted(comparer);
  },
  toSpliced(...args) {
    return reactiveReadArray(this).toSpliced(...args);
  },
  unshift(...args) {
    return noTracking(this, "unshift", args);
  },
  values() {
    return iterator(this, "values", (item) => toWrapped(this, item));
  }
};
function iterator(self2, method, wrapValue) {
  const arr = shallowReadArray(self2);
  const iter = arr[method]();
  if (arr !== self2 && !/* @__PURE__ */ isShallow(self2)) {
    iter._next = iter.next;
    iter.next = () => {
      const result = iter._next();
      if (!result.done) {
        result.value = wrapValue(result.value);
      }
      return result;
    };
  }
  return iter;
}
const arrayProto = Array.prototype;
function apply(self2, method, fn, thisArg, wrappedRetFn, args) {
  const arr = shallowReadArray(self2);
  const needsWrap = arr !== self2 && !/* @__PURE__ */ isShallow(self2);
  const methodFn = arr[method];
  if (methodFn !== arrayProto[method]) {
    const result2 = methodFn.apply(self2, args);
    return needsWrap ? toReactive(result2) : result2;
  }
  let wrappedFn = fn;
  if (arr !== self2) {
    if (needsWrap) {
      wrappedFn = function(item, index) {
        return fn.call(this, toWrapped(self2, item), index, self2);
      };
    } else if (fn.length > 2) {
      wrappedFn = function(item, index) {
        return fn.call(this, item, index, self2);
      };
    }
  }
  const result = methodFn.call(arr, wrappedFn, thisArg);
  return needsWrap && wrappedRetFn ? wrappedRetFn(result) : result;
}
function reduce(self2, method, fn, args) {
  const arr = shallowReadArray(self2);
  const needsWrap = arr !== self2 && !/* @__PURE__ */ isShallow(self2);
  let wrappedFn = fn;
  let wrapInitialAccumulator = false;
  if (arr !== self2) {
    if (needsWrap) {
      wrapInitialAccumulator = args.length === 0;
      wrappedFn = function(acc, item, index) {
        if (wrapInitialAccumulator) {
          wrapInitialAccumulator = false;
          acc = toWrapped(self2, acc);
        }
        return fn.call(this, acc, toWrapped(self2, item), index, self2);
      };
    } else if (fn.length > 3) {
      wrappedFn = function(acc, item, index) {
        return fn.call(this, acc, item, index, self2);
      };
    }
  }
  const result = arr[method](wrappedFn, ...args);
  return wrapInitialAccumulator ? toWrapped(self2, result) : result;
}
function searchProxy(self2, method, args) {
  const arr = /* @__PURE__ */ toRaw(self2);
  track(arr, "iterate", ARRAY_ITERATE_KEY);
  const res = arr[method](...args);
  if ((res === -1 || res === false) && /* @__PURE__ */ isProxy(args[0])) {
    args[0] = /* @__PURE__ */ toRaw(args[0]);
    return arr[method](...args);
  }
  return res;
}
function noTracking(self2, method, args = []) {
  pauseTracking();
  startBatch();
  const res = (/* @__PURE__ */ toRaw(self2))[method].apply(self2, args);
  endBatch();
  resetTracking();
  return res;
}
const isNonTrackableKeys = /* @__PURE__ */ makeMap(`__proto__,__v_isRef,__isVue`);
const builtInSymbols = new Set(
  /* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol)
);
function hasOwnProperty(key) {
  if (!isSymbol(key)) key = String(key);
  const obj = /* @__PURE__ */ toRaw(this);
  track(obj, "has", key);
  return obj.hasOwnProperty(key);
}
class BaseReactiveHandler {
  constructor(_isReadonly = false, _isShallow = false) {
    this._isReadonly = _isReadonly;
    this._isShallow = _isShallow;
  }
  get(target, key, receiver) {
    if (key === "__v_skip") return target["__v_skip"];
    const isReadonly2 = this._isReadonly, isShallow2 = this._isShallow;
    if (key === "__v_isReactive") {
      return !isReadonly2;
    } else if (key === "__v_isReadonly") {
      return isReadonly2;
    } else if (key === "__v_isShallow") {
      return isShallow2;
    } else if (key === "__v_raw") {
      if (receiver === (isReadonly2 ? isShallow2 ? shallowReadonlyMap : readonlyMap : isShallow2 ? shallowReactiveMap : reactiveMap).get(target) || // receiver is not the reactive proxy, but has the same prototype
      // this means the receiver is a user proxy of the reactive proxy
      Object.getPrototypeOf(target) === Object.getPrototypeOf(receiver)) {
        return target;
      }
      return;
    }
    const targetIsArray = isArray(target);
    if (!isReadonly2) {
      let fn;
      if (targetIsArray && (fn = arrayInstrumentations[key])) {
        return fn;
      }
      if (key === "hasOwnProperty") {
        return hasOwnProperty;
      }
    }
    const res = Reflect.get(
      target,
      key,
      // if this is a proxy wrapping a ref, return methods using the raw ref
      // as receiver so that we don't have to call `toRaw` on the ref in all
      // its class methods
      /* @__PURE__ */ isRef(target) ? target : receiver
    );
    if (isSymbol(key) ? builtInSymbols.has(key) : isNonTrackableKeys(key)) {
      return res;
    }
    if (!isReadonly2) {
      track(target, "get", key);
    }
    if (isShallow2) {
      return res;
    }
    if (/* @__PURE__ */ isRef(res)) {
      const value = targetIsArray && isIntegerKey(key) ? res : res.value;
      return isReadonly2 && isObject(value) ? /* @__PURE__ */ readonly(value) : value;
    }
    if (isObject(res)) {
      return isReadonly2 ? /* @__PURE__ */ readonly(res) : /* @__PURE__ */ reactive(res);
    }
    return res;
  }
}
class MutableReactiveHandler extends BaseReactiveHandler {
  constructor(isShallow2 = false) {
    super(false, isShallow2);
  }
  set(target, key, value, receiver) {
    let oldValue = target[key];
    const isArrayWithIntegerKey = isArray(target) && isIntegerKey(key);
    if (!this._isShallow) {
      const isOldValueReadonly = /* @__PURE__ */ isReadonly(oldValue);
      if (!/* @__PURE__ */ isShallow(value) && !/* @__PURE__ */ isReadonly(value)) {
        oldValue = /* @__PURE__ */ toRaw(oldValue);
        value = /* @__PURE__ */ toRaw(value);
      }
      if (!isArrayWithIntegerKey && /* @__PURE__ */ isRef(oldValue) && !/* @__PURE__ */ isRef(value)) {
        if (isOldValueReadonly) {
          return true;
        } else {
          oldValue.value = value;
          return true;
        }
      }
    }
    const hadKey = isArrayWithIntegerKey ? Number(key) < target.length : hasOwn(target, key);
    const result = Reflect.set(
      target,
      key,
      value,
      /* @__PURE__ */ isRef(target) ? target : receiver
    );
    if (target === /* @__PURE__ */ toRaw(receiver) && result) {
      if (!hadKey) {
        trigger(target, "add", key, value);
      } else if (hasChanged(value, oldValue)) {
        trigger(target, "set", key, value);
      }
    }
    return result;
  }
  deleteProperty(target, key) {
    const hadKey = hasOwn(target, key);
    target[key];
    const result = Reflect.deleteProperty(target, key);
    if (result && hadKey) {
      trigger(target, "delete", key, void 0);
    }
    return result;
  }
  has(target, key) {
    const result = Reflect.has(target, key);
    if (!isSymbol(key) || !builtInSymbols.has(key)) {
      track(target, "has", key);
    }
    return result;
  }
  ownKeys(target) {
    track(
      target,
      "iterate",
      isArray(target) ? "length" : ITERATE_KEY
    );
    return Reflect.ownKeys(target);
  }
}
class ReadonlyReactiveHandler extends BaseReactiveHandler {
  constructor(isShallow2 = false) {
    super(true, isShallow2);
  }
  set(target, key) {
    return true;
  }
  deleteProperty(target, key) {
    return true;
  }
}
const mutableHandlers = /* @__PURE__ */ new MutableReactiveHandler();
const readonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler();
const shallowReactiveHandlers = /* @__PURE__ */ new MutableReactiveHandler(true);
const shallowReadonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler(true);
const toShallow = (value) => value;
const getProto = (v) => Reflect.getPrototypeOf(v);
function createIterableMethod(method, isReadonly2, isShallow2) {
  return function(...args) {
    const target = this["__v_raw"];
    const rawTarget = /* @__PURE__ */ toRaw(target);
    const targetIsMap = isMap(rawTarget);
    const isPair = method === "entries" || method === Symbol.iterator && targetIsMap;
    const isKeyOnly = method === "keys" && targetIsMap;
    const innerIterator = target[method](...args);
    const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive;
    !isReadonly2 && track(
      rawTarget,
      "iterate",
      isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY
    );
    return extend(
      // inheriting all iterator properties
      Object.create(innerIterator),
      {
        // iterator protocol
        next() {
          const { value, done } = innerIterator.next();
          return done ? { value, done } : {
            value: isPair ? [wrap(value[0]), wrap(value[1])] : wrap(value),
            done
          };
        }
      }
    );
  };
}
function createReadonlyMethod(type) {
  return function(...args) {
    return type === "delete" ? false : type === "clear" ? void 0 : this;
  };
}
function createInstrumentations(readonly2, shallow) {
  const instrumentations = {
    get(key) {
      const target = this["__v_raw"];
      const rawTarget = /* @__PURE__ */ toRaw(target);
      const rawKey = /* @__PURE__ */ toRaw(key);
      if (!readonly2) {
        if (hasChanged(key, rawKey)) {
          track(rawTarget, "get", key);
        }
        track(rawTarget, "get", rawKey);
      }
      const { has } = getProto(rawTarget);
      const wrap = shallow ? toShallow : readonly2 ? toReadonly : toReactive;
      if (has.call(rawTarget, key)) {
        return wrap(target.get(key));
      } else if (has.call(rawTarget, rawKey)) {
        return wrap(target.get(rawKey));
      } else if (target !== rawTarget) {
        target.get(key);
      }
    },
    get size() {
      const target = this["__v_raw"];
      !readonly2 && track(/* @__PURE__ */ toRaw(target), "iterate", ITERATE_KEY);
      return target.size;
    },
    has(key) {
      const target = this["__v_raw"];
      const rawTarget = /* @__PURE__ */ toRaw(target);
      const rawKey = /* @__PURE__ */ toRaw(key);
      if (!readonly2) {
        if (hasChanged(key, rawKey)) {
          track(rawTarget, "has", key);
        }
        track(rawTarget, "has", rawKey);
      }
      return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey);
    },
    forEach(callback, thisArg) {
      const observed = this;
      const target = observed["__v_raw"];
      const rawTarget = /* @__PURE__ */ toRaw(target);
      const wrap = shallow ? toShallow : readonly2 ? toReadonly : toReactive;
      !readonly2 && track(rawTarget, "iterate", ITERATE_KEY);
      return target.forEach((value, key) => {
        return callback.call(thisArg, wrap(value), wrap(key), observed);
      });
    }
  };
  extend(
    instrumentations,
    readonly2 ? {
      add: createReadonlyMethod("add"),
      set: createReadonlyMethod("set"),
      delete: createReadonlyMethod("delete"),
      clear: createReadonlyMethod("clear")
    } : {
      add(value) {
        const target = /* @__PURE__ */ toRaw(this);
        const proto = getProto(target);
        const rawValue = /* @__PURE__ */ toRaw(value);
        const valueToAdd = !shallow && !/* @__PURE__ */ isShallow(value) && !/* @__PURE__ */ isReadonly(value) ? rawValue : value;
        const hadKey = proto.has.call(target, valueToAdd) || hasChanged(value, valueToAdd) && proto.has.call(target, value) || hasChanged(rawValue, valueToAdd) && proto.has.call(target, rawValue);
        if (!hadKey) {
          target.add(valueToAdd);
          trigger(target, "add", valueToAdd, valueToAdd);
        }
        return this;
      },
      set(key, value) {
        if (!shallow && !/* @__PURE__ */ isShallow(value) && !/* @__PURE__ */ isReadonly(value)) {
          value = /* @__PURE__ */ toRaw(value);
        }
        const target = /* @__PURE__ */ toRaw(this);
        const { has, get } = getProto(target);
        let hadKey = has.call(target, key);
        if (!hadKey) {
          key = /* @__PURE__ */ toRaw(key);
          hadKey = has.call(target, key);
        }
        const oldValue = get.call(target, key);
        target.set(key, value);
        if (!hadKey) {
          trigger(target, "add", key, value);
        } else if (hasChanged(value, oldValue)) {
          trigger(target, "set", key, value);
        }
        return this;
      },
      delete(key) {
        const target = /* @__PURE__ */ toRaw(this);
        const { has, get } = getProto(target);
        let hadKey = has.call(target, key);
        if (!hadKey) {
          key = /* @__PURE__ */ toRaw(key);
          hadKey = has.call(target, key);
        }
        get ? get.call(target, key) : void 0;
        const result = target.delete(key);
        if (hadKey) {
          trigger(target, "delete", key, void 0);
        }
        return result;
      },
      clear() {
        const target = /* @__PURE__ */ toRaw(this);
        const hadItems = target.size !== 0;
        const result = target.clear();
        if (hadItems) {
          trigger(
            target,
            "clear",
            void 0,
            void 0
          );
        }
        return result;
      }
    }
  );
  const iteratorMethods = [
    "keys",
    "values",
    "entries",
    Symbol.iterator
  ];
  iteratorMethods.forEach((method) => {
    instrumentations[method] = createIterableMethod(method, readonly2, shallow);
  });
  return instrumentations;
}
function createInstrumentationGetter(isReadonly2, shallow) {
  const instrumentations = createInstrumentations(isReadonly2, shallow);
  return (target, key, receiver) => {
    if (key === "__v_isReactive") {
      return !isReadonly2;
    } else if (key === "__v_isReadonly") {
      return isReadonly2;
    } else if (key === "__v_raw") {
      return target;
    }
    return Reflect.get(
      hasOwn(instrumentations, key) && key in target ? instrumentations : target,
      key,
      receiver
    );
  };
}
const mutableCollectionHandlers = {
  get: /* @__PURE__ */ createInstrumentationGetter(false, false)
};
const shallowCollectionHandlers = {
  get: /* @__PURE__ */ createInstrumentationGetter(false, true)
};
const readonlyCollectionHandlers = {
  get: /* @__PURE__ */ createInstrumentationGetter(true, false)
};
const shallowReadonlyCollectionHandlers = {
  get: /* @__PURE__ */ createInstrumentationGetter(true, true)
};
const reactiveMap = /* @__PURE__ */ new WeakMap();
const shallowReactiveMap = /* @__PURE__ */ new WeakMap();
const readonlyMap = /* @__PURE__ */ new WeakMap();
const shallowReadonlyMap = /* @__PURE__ */ new WeakMap();
function targetTypeMap(rawType) {
  switch (rawType) {
    case "Object":
    case "Array":
      return 1;
    case "Map":
    case "Set":
    case "WeakMap":
    case "WeakSet":
      return 2;
    default:
      return 0;
  }
}
// @__NO_SIDE_EFFECTS__
function reactive(target) {
  if (/* @__PURE__ */ isReadonly(target)) {
    return target;
  }
  return createReactiveObject(
    target,
    false,
    mutableHandlers,
    mutableCollectionHandlers,
    reactiveMap
  );
}
// @__NO_SIDE_EFFECTS__
function shallowReactive(target) {
  return createReactiveObject(
    target,
    false,
    shallowReactiveHandlers,
    shallowCollectionHandlers,
    shallowReactiveMap
  );
}
// @__NO_SIDE_EFFECTS__
function readonly(target) {
  return createReactiveObject(
    target,
    true,
    readonlyHandlers,
    readonlyCollectionHandlers,
    readonlyMap
  );
}
// @__NO_SIDE_EFFECTS__
function shallowReadonly(target) {
  return createReactiveObject(
    target,
    true,
    shallowReadonlyHandlers,
    shallowReadonlyCollectionHandlers,
    shallowReadonlyMap
  );
}
function createReactiveObject(target, isReadonly2, baseHandlers, collectionHandlers, proxyMap) {
  if (!isObject(target)) {
    return target;
  }
  if (target["__v_raw"] && !(isReadonly2 && target["__v_isReactive"])) {
    return target;
  }
  if (target["__v_skip"] || !Object.isExtensible(target)) {
    return target;
  }
  const existingProxy = proxyMap.get(target);
  if (existingProxy) {
    return existingProxy;
  }
  const targetType = targetTypeMap(toRawType(target));
  if (targetType === 0) {
    return target;
  }
  const proxy = new Proxy(
    target,
    targetType === 2 ? collectionHandlers : baseHandlers
  );
  proxyMap.set(target, proxy);
  return proxy;
}
// @__NO_SIDE_EFFECTS__
function isReactive(value) {
  if (/* @__PURE__ */ isReadonly(value)) {
    return /* @__PURE__ */ isReactive(value["__v_raw"]);
  }
  return !!(value && value["__v_isReactive"]);
}
// @__NO_SIDE_EFFECTS__
function isReadonly(value) {
  return !!(value && value["__v_isReadonly"]);
}
// @__NO_SIDE_EFFECTS__
function isShallow(value) {
  return !!(value && value["__v_isShallow"]);
}
// @__NO_SIDE_EFFECTS__
function isProxy(value) {
  return value ? !!value["__v_raw"] : false;
}
// @__NO_SIDE_EFFECTS__
function toRaw(observed) {
  const raw = observed && observed["__v_raw"];
  return raw ? /* @__PURE__ */ toRaw(raw) : observed;
}
function markRaw(value) {
  if (!hasOwn(value, "__v_skip") && Object.isExtensible(value)) {
    def(value, "__v_skip", true);
  }
  return value;
}
const toReactive = (value) => isObject(value) ? /* @__PURE__ */ reactive(value) : value;
const toReadonly = (value) => isObject(value) ? /* @__PURE__ */ readonly(value) : value;
// @__NO_SIDE_EFFECTS__
function isRef(r) {
  return r ? r["__v_isRef"] === true : false;
}
// @__NO_SIDE_EFFECTS__
function ref(value) {
  return createRef(value, false);
}
function createRef(rawValue, shallow) {
  if (/* @__PURE__ */ isRef(rawValue)) {
    return rawValue;
  }
  return new RefImpl(rawValue, shallow);
}
class RefImpl {
  constructor(value, isShallow2) {
    this.dep = new Dep();
    this["__v_isRef"] = true;
    this["__v_isShallow"] = false;
    this._rawValue = isShallow2 ? value : /* @__PURE__ */ toRaw(value);
    this._value = isShallow2 ? value : toReactive(value);
    this["__v_isShallow"] = isShallow2;
  }
  get value() {
    {
      this.dep.track();
    }
    return this._value;
  }
  set value(newValue) {
    const oldValue = this._rawValue;
    const useDirectValue = this["__v_isShallow"] || /* @__PURE__ */ isShallow(newValue) || /* @__PURE__ */ isReadonly(newValue);
    newValue = useDirectValue ? newValue : /* @__PURE__ */ toRaw(newValue);
    if (hasChanged(newValue, oldValue)) {
      this._rawValue = newValue;
      this._value = useDirectValue ? newValue : toReactive(newValue);
      {
        this.dep.trigger();
      }
    }
  }
}
function unref(ref2) {
  return /* @__PURE__ */ isRef(ref2) ? ref2.value : ref2;
}
const shallowUnwrapHandlers = {
  get: (target, key, receiver) => key === "__v_raw" ? target : unref(Reflect.get(target, key, receiver)),
  set: (target, key, value, receiver) => {
    const oldValue = target[key];
    if (/* @__PURE__ */ isRef(oldValue) && !/* @__PURE__ */ isRef(value)) {
      oldValue.value = value;
      return true;
    } else {
      return Reflect.set(target, key, value, receiver);
    }
  }
};
function proxyRefs(objectWithRefs) {
  return /* @__PURE__ */ isReactive(objectWithRefs) ? objectWithRefs : new Proxy(objectWithRefs, shallowUnwrapHandlers);
}
class ComputedRefImpl {
  constructor(fn, setter, isSSR) {
    this.fn = fn;
    this.setter = setter;
    this._value = void 0;
    this.dep = new Dep(this);
    this.__v_isRef = true;
    this.deps = void 0;
    this.depsTail = void 0;
    this.flags = 16;
    this.globalVersion = globalVersion - 1;
    this.next = void 0;
    this.effect = this;
    this["__v_isReadonly"] = !setter;
    this.isSSR = isSSR;
  }
  /**
   * @internal
   */
  notify() {
    this.flags |= 16;
    if (!(this.flags & 8) && // avoid infinite self recursion
    activeSub !== this) {
      batch(this, true);
      return true;
    }
  }
  get value() {
    const link = this.dep.track();
    refreshComputed(this);
    if (link) {
      link.version = this.dep.version;
    }
    return this._value;
  }
  set value(newValue) {
    if (this.setter) {
      this.setter(newValue);
    }
  }
}
// @__NO_SIDE_EFFECTS__
function computed$1(getterOrOptions, debugOptions, isSSR = false) {
  let getter;
  let setter;
  if (isFunction(getterOrOptions)) {
    getter = getterOrOptions;
  } else {
    getter = getterOrOptions.get;
    setter = getterOrOptions.set;
  }
  const cRef = new ComputedRefImpl(getter, setter, isSSR);
  return cRef;
}
const INITIAL_WATCHER_VALUE = {};
const cleanupMap = /* @__PURE__ */ new WeakMap();
let activeWatcher = void 0;
function onWatcherCleanup(cleanupFn, failSilently = false, owner = activeWatcher) {
  if (owner) {
    let cleanups = cleanupMap.get(owner);
    if (!cleanups) cleanupMap.set(owner, cleanups = []);
    cleanups.push(cleanupFn);
  }
}
function watch$1(source, cb, options = EMPTY_OBJ) {
  const { immediate, deep, once, scheduler, augmentJob, call } = options;
  const reactiveGetter = (source2) => {
    if (deep) return source2;
    if (/* @__PURE__ */ isShallow(source2) || deep === false || deep === 0)
      return traverse(source2, 1);
    return traverse(source2);
  };
  let effect2;
  let getter;
  let cleanup;
  let boundCleanup;
  let forceTrigger = false;
  let isMultiSource = false;
  if (/* @__PURE__ */ isRef(source)) {
    getter = () => source.value;
    forceTrigger = /* @__PURE__ */ isShallow(source);
  } else if (/* @__PURE__ */ isReactive(source)) {
    getter = () => reactiveGetter(source);
    forceTrigger = true;
  } else if (isArray(source)) {
    isMultiSource = true;
    forceTrigger = source.some((s) => /* @__PURE__ */ isReactive(s) || /* @__PURE__ */ isShallow(s));
    getter = () => source.map((s) => {
      if (/* @__PURE__ */ isRef(s)) {
        return s.value;
      } else if (/* @__PURE__ */ isReactive(s)) {
        return reactiveGetter(s);
      } else if (isFunction(s)) {
        return call ? call(s, 2) : s();
      } else ;
    });
  } else if (isFunction(source)) {
    if (cb) {
      getter = call ? () => call(source, 2) : source;
    } else {
      getter = () => {
        if (cleanup) {
          pauseTracking();
          try {
            cleanup();
          } finally {
            resetTracking();
          }
        }
        const currentEffect = activeWatcher;
        activeWatcher = effect2;
        try {
          return call ? call(source, 3, [boundCleanup]) : source(boundCleanup);
        } finally {
          activeWatcher = currentEffect;
        }
      };
    }
  } else {
    getter = NOOP;
  }
  if (cb && deep) {
    const baseGetter = getter;
    const depth = deep === true ? Infinity : deep;
    getter = () => traverse(baseGetter(), depth);
  }
  const scope = getCurrentScope();
  const watchHandle = () => {
    effect2.stop();
    if (scope && scope.active) {
      remove(scope.effects, effect2);
    }
  };
  if (once && cb) {
    const _cb = cb;
    cb = (...args) => {
      const res = _cb(...args);
      watchHandle();
      return res;
    };
  }
  let oldValue = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE;
  const job = (immediateFirstRun) => {
    if (!(effect2.flags & 1) || !effect2.dirty && !immediateFirstRun) {
      return;
    }
    if (cb) {
      const newValue = effect2.run();
      if (immediateFirstRun || deep || forceTrigger || (isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue))) {
        if (cleanup) {
          cleanup();
        }
        const currentWatcher = activeWatcher;
        activeWatcher = effect2;
        try {
          const args = [
            newValue,
            // pass undefined as the old value when it's changed for the first time
            oldValue === INITIAL_WATCHER_VALUE ? void 0 : isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE ? [] : oldValue,
            boundCleanup
          ];
          oldValue = newValue;
          call ? call(cb, 3, args) : (
            // @ts-expect-error
            cb(...args)
          );
        } finally {
          activeWatcher = currentWatcher;
        }
      }
    } else {
      effect2.run();
    }
  };
  if (augmentJob) {
    augmentJob(job);
  }
  effect2 = new ReactiveEffect(getter);
  effect2.scheduler = scheduler ? () => scheduler(job, false) : job;
  boundCleanup = (fn) => onWatcherCleanup(fn, false, effect2);
  cleanup = effect2.onStop = () => {
    const cleanups = cleanupMap.get(effect2);
    if (cleanups) {
      if (call) {
        call(cleanups, 4);
      } else {
        for (const cleanup2 of cleanups) cleanup2();
      }
      cleanupMap.delete(effect2);
    }
  };
  if (cb) {
    if (immediate) {
      job(true);
    } else {
      oldValue = effect2.run();
    }
  } else if (scheduler) {
    scheduler(job.bind(null, true), true);
  } else {
    effect2.run();
  }
  watchHandle.pause = effect2.pause.bind(effect2);
  watchHandle.resume = effect2.resume.bind(effect2);
  watchHandle.stop = watchHandle;
  return watchHandle;
}
function traverse(value, depth = Infinity, seen) {
  if (depth <= 0 || !isObject(value) || value["__v_skip"]) {
    return value;
  }
  seen = seen || /* @__PURE__ */ new Map();
  if ((seen.get(value) || 0) >= depth) {
    return value;
  }
  seen.set(value, depth);
  depth--;
  if (/* @__PURE__ */ isRef(value)) {
    traverse(value.value, depth, seen);
  } else if (isArray(value)) {
    for (let i = 0; i < value.length; i++) {
      traverse(value[i], depth, seen);
    }
  } else if (isSet(value) || isMap(value)) {
    value.forEach((v) => {
      traverse(v, depth, seen);
    });
  } else if (isPlainObject(value)) {
    for (const key in value) {
      traverse(value[key], depth, seen);
    }
    for (const key of Object.getOwnPropertySymbols(value)) {
      if (Object.prototype.propertyIsEnumerable.call(value, key)) {
        traverse(value[key], depth, seen);
      }
    }
  }
  return value;
}
const stack = [];
let isWarning = false;
function warn$1(msg, ...args) {
  if (isWarning) return;
  isWarning = true;
  pauseTracking();
  const instance = stack.length ? stack[stack.length - 1].component : null;
  const appWarnHandler = instance && instance.appContext.config.warnHandler;
  const trace = getComponentTrace();
  if (appWarnHandler) {
    callWithErrorHandling(
      appWarnHandler,
      instance,
      11,
      [
        // eslint-disable-next-line no-restricted-syntax
        msg + args.map((a) => {
          var _a, _b;
          return (_b = (_a = a.toString) == null ? void 0 : _a.call(a)) != null ? _b : JSON.stringify(a);
        }).join(""),
        instance && instance.proxy,
        trace.map(
          ({ vnode }) => `at <${formatComponentName(instance, vnode.type)}>`
        ).join("\n"),
        trace
      ]
    );
  } else {
    const warnArgs = [`[Vue warn]: ${msg}`, ...args];
    if (trace.length && // avoid spamming console during tests
    true) {
      warnArgs.push(`
`, ...formatTrace(trace));
    }
    console.warn(...warnArgs);
  }
  resetTracking();
  isWarning = false;
}
function getComponentTrace() {
  let currentVNode = stack[stack.length - 1];
  if (!currentVNode) {
    return [];
  }
  const normalizedStack = [];
  while (currentVNode) {
    const last = normalizedStack[0];
    if (last && last.vnode === currentVNode) {
      last.recurseCount++;
    } else {
      normalizedStack.push({
        vnode: currentVNode,
        recurseCount: 0
      });
    }
    const parentInstance = currentVNode.component && currentVNode.component.parent;
    currentVNode = parentInstance && parentInstance.vnode;
  }
  return normalizedStack;
}
function formatTrace(trace) {
  const logs = [];
  trace.forEach((entry, i) => {
    logs.push(...i === 0 ? [] : [`
`], ...formatTraceEntry(entry));
  });
  return logs;
}
function formatTraceEntry({ vnode, recurseCount }) {
  const postfix = recurseCount > 0 ? `... (${recurseCount} recursive calls)` : ``;
  const isRoot = vnode.component ? vnode.component.parent == null : false;
  const open = ` at <${formatComponentName(
    vnode.component,
    vnode.type,
    isRoot
  )}`;
  const close = `>` + postfix;
  return vnode.props ? [open, ...formatProps(vnode.props), close] : [open + close];
}
function formatProps(props) {
  const res = [];
  const keys = Object.keys(props);
  keys.slice(0, 3).forEach((key) => {
    res.push(...formatProp(key, props[key]));
  });
  if (keys.length > 3) {
    res.push(` ...`);
  }
  return res;
}
function formatProp(key, value, raw) {
  if (isString(value)) {
    value = JSON.stringify(value);
    return raw ? value : [`${key}=${value}`];
  } else if (typeof value === "number" || typeof value === "boolean" || value == null) {
    return raw ? value : [`${key}=${value}`];
  } else if (/* @__PURE__ */ isRef(value)) {
    value = formatProp(key, /* @__PURE__ */ toRaw(value.value), true);
    return raw ? value : [`${key}=Ref<`, value, `>`];
  } else if (isFunction(value)) {
    return [`${key}=fn${value.name ? `<${value.name}>` : ``}`];
  } else {
    value = /* @__PURE__ */ toRaw(value);
    return raw ? value : [`${key}=`, value];
  }
}
function callWithErrorHandling(fn, instance, type, args) {
  try {
    return args ? fn(...args) : fn();
  } catch (err) {
    handleError(err, instance, type);
  }
}
function callWithAsyncErrorHandling(fn, instance, type, args) {
  if (isFunction(fn)) {
    const res = callWithErrorHandling(fn, instance, type, args);
    if (res && isPromise(res)) {
      res.catch((err) => {
        handleError(err, instance, type);
      });
    }
    return res;
  }
  if (isArray(fn)) {
    const values = [];
    for (let i = 0; i < fn.length; i++) {
      values.push(callWithAsyncErrorHandling(fn[i], instance, type, args));
    }
    return values;
  }
}
function handleError(err, instance, type, throwInDev = true) {
  const contextVNode = instance ? instance.vnode : null;
  const { errorHandler, throwUnhandledErrorInProduction } = instance && instance.appContext.config || EMPTY_OBJ;
  if (instance) {
    let cur = instance.parent;
    const exposedInstance = instance.proxy;
    const errorInfo = `https://vuejs.org/error-reference/#runtime-${type}`;
    while (cur) {
      const errorCapturedHooks = cur.ec;
      if (errorCapturedHooks) {
        for (let i = 0; i < errorCapturedHooks.length; i++) {
          if (errorCapturedHooks[i](err, exposedInstance, errorInfo) === false) {
            return;
          }
        }
      }
      cur = cur.parent;
    }
    if (errorHandler) {
      pauseTracking();
      callWithErrorHandling(errorHandler, null, 10, [
        err,
        exposedInstance,
        errorInfo
      ]);
      resetTracking();
      return;
    }
  }
  logError(err, type, contextVNode, throwInDev, throwUnhandledErrorInProduction);
}
function logError(err, type, contextVNode, throwInDev = true, throwInProd = false) {
  if (throwInProd) {
    throw err;
  } else {
    console.error(err);
  }
}
const queue = [];
let flushIndex = -1;
const pendingPostFlushCbs = [];
let activePostFlushCbs = null;
let postFlushIndex = 0;
const resolvedPromise = /* @__PURE__ */ Promise.resolve();
let currentFlushPromise = null;
function nextTick(fn) {
  const p2 = currentFlushPromise || resolvedPromise;
  return fn ? p2.then(this ? fn.bind(this) : fn) : p2;
}
function findInsertionIndex(id) {
  let start = flushIndex + 1;
  let end = queue.length;
  while (start < end) {
    const middle = start + end >>> 1;
    const middleJob = queue[middle];
    const middleJobId = getId(middleJob);
    if (middleJobId < id || middleJobId === id && middleJob.flags & 2) {
      start = middle + 1;
    } else {
      end = middle;
    }
  }
  return start;
}
function queueJob(job) {
  if (!(job.flags & 1)) {
    const jobId = getId(job);
    const lastJob = queue[queue.length - 1];
    if (!lastJob || // fast path when the job id is larger than the tail
    !(job.flags & 2) && jobId >= getId(lastJob)) {
      queue.push(job);
    } else {
      queue.splice(findInsertionIndex(jobId), 0, job);
    }
    job.flags |= 1;
    queueFlush();
  }
}
function queueFlush() {
  if (!currentFlushPromise) {
    currentFlushPromise = resolvedPromise.then(flushJobs);
  }
}
function queuePostFlushCb(cb) {
  if (!isArray(cb)) {
    if (activePostFlushCbs && cb.id === -1) {
      activePostFlushCbs.splice(postFlushIndex + 1, 0, cb);
    } else if (!(cb.flags & 1)) {
      pendingPostFlushCbs.push(cb);
      cb.flags |= 1;
    }
  } else {
    pendingPostFlushCbs.push(...cb);
  }
  queueFlush();
}
function flushPreFlushCbs(instance, seen, i = flushIndex + 1) {
  for (; i < queue.length; i++) {
    const cb = queue[i];
    if (cb && cb.flags & 2) {
      if (instance && cb.id !== instance.uid) {
        continue;
      }
      queue.splice(i, 1);
      i--;
      if (cb.flags & 4) {
        cb.flags &= -2;
      }
      cb();
      if (!(cb.flags & 4)) {
        cb.flags &= -2;
      }
    }
  }
}
function flushPostFlushCbs(seen) {
  if (pendingPostFlushCbs.length) {
    const deduped = [...new Set(pendingPostFlushCbs)].sort(
      (a, b) => getId(a) - getId(b)
    );
    pendingPostFlushCbs.length = 0;
    if (activePostFlushCbs) {
      activePostFlushCbs.push(...deduped);
      return;
    }
    activePostFlushCbs = deduped;
    for (postFlushIndex = 0; postFlushIndex < activePostFlushCbs.length; postFlushIndex++) {
      const cb = activePostFlushCbs[postFlushIndex];
      if (cb.flags & 4) {
        cb.flags &= -2;
      }
      if (!(cb.flags & 8)) cb();
      cb.flags &= -2;
    }
    activePostFlushCbs = null;
    postFlushIndex = 0;
  }
}
const getId = (job) => job.id == null ? job.flags & 2 ? -1 : Infinity : job.id;
function flushJobs(seen) {
  try {
    for (flushIndex = 0; flushIndex < queue.length; flushIndex++) {
      const job = queue[flushIndex];
      if (job && !(job.flags & 8)) {
        if (false) ;
        if (job.flags & 4) {
          job.flags &= ~1;
        }
        callWithErrorHandling(
          job,
          job.i,
          job.i ? 15 : 14
        );
        if (!(job.flags & 4)) {
          job.flags &= ~1;
        }
      }
    }
  } finally {
    for (; flushIndex < queue.length; flushIndex++) {
      const job = queue[flushIndex];
      if (job) {
        job.flags &= -2;
      }
    }
    flushIndex = -1;
    queue.length = 0;
    flushPostFlushCbs();
    currentFlushPromise = null;
    if (queue.length || pendingPostFlushCbs.length) {
      flushJobs();
    }
  }
}
let currentRenderingInstance = null;
let currentScopeId = null;
function setCurrentRenderingInstance(instance) {
  const prev = currentRenderingInstance;
  currentRenderingInstance = instance;
  currentScopeId = instance && instance.type.__scopeId || null;
  return prev;
}
function withCtx(fn, ctx = currentRenderingInstance, isNonScopedSlot) {
  if (!ctx) return fn;
  if (fn._n) {
    return fn;
  }
  const renderFnWithContext = (...args) => {
    if (renderFnWithContext._d) {
      setBlockTracking(-1);
    }
    const prevInstance = setCurrentRenderingInstance(ctx);
    let res;
    try {
      res = fn(...args);
    } finally {
      setCurrentRenderingInstance(prevInstance);
      if (renderFnWithContext._d) {
        setBlockTracking(1);
      }
    }
    return res;
  };
  renderFnWithContext._n = true;
  renderFnWithContext._c = true;
  renderFnWithContext._d = true;
  return renderFnWithContext;
}
function withDirectives(vnode, directives) {
  if (currentRenderingInstance === null) {
    return vnode;
  }
  const instance = getComponentPublicInstance(currentRenderingInstance);
  const bindings = vnode.dirs || (vnode.dirs = []);
  for (let i = 0; i < directives.length; i++) {
    let [dir, value, arg, modifiers = EMPTY_OBJ] = directives[i];
    if (dir) {
      if (isFunction(dir)) {
        dir = {
          mounted: dir,
          updated: dir
        };
      }
      if (dir.deep) {
        traverse(value);
      }
      bindings.push({
        dir,
        instance,
        value,
        oldValue: void 0,
        arg,
        modifiers
      });
    }
  }
  return vnode;
}
function invokeDirectiveHook(vnode, prevVNode, instance, name) {
  const bindings = vnode.dirs;
  const oldBindings = prevVNode && prevVNode.dirs;
  for (let i = 0; i < bindings.length; i++) {
    const binding = bindings[i];
    if (oldBindings) {
      binding.oldValue = oldBindings[i].value;
    }
    let hook = binding.dir[name];
    if (hook) {
      pauseTracking();
      callWithAsyncErrorHandling(hook, instance, 8, [
        vnode.el,
        binding,
        vnode,
        prevVNode
      ]);
      resetTracking();
    }
  }
}
function provide(key, value) {
  if (currentInstance) {
    let provides = currentInstance.provides;
    const parentProvides = currentInstance.parent && currentInstance.parent.provides;
    if (parentProvides === provides) {
      provides = currentInstance.provides = Object.create(parentProvides);
    }
    provides[key] = value;
  }
}
function inject(key, defaultValue, treatDefaultAsFactory = false) {
  const instance = getCurrentInstance();
  if (instance || currentApp) {
    let provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null || instance.ce ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : void 0;
    if (provides && key in provides) {
      return provides[key];
    } else if (arguments.length > 1) {
      return treatDefaultAsFactory && isFunction(defaultValue) ? defaultValue.call(instance && instance.proxy) : defaultValue;
    } else ;
  }
}
const ssrContextKey = /* @__PURE__ */ Symbol.for("v-scx");
const useSSRContext = () => {
  {
    const ctx = inject(ssrContextKey);
    return ctx;
  }
};
function watch(source, cb, options) {
  return doWatch(source, cb, options);
}
function doWatch(source, cb, options = EMPTY_OBJ) {
  const { immediate, deep, flush, once } = options;
  const baseWatchOptions = extend({}, options);
  const runsImmediately = cb && immediate || !cb && flush !== "post";
  let ssrCleanup;
  if (isInSSRComponentSetup) {
    if (flush === "sync") {
      const ctx = useSSRContext();
      ssrCleanup = ctx.__watcherHandles || (ctx.__watcherHandles = []);
    } else if (!runsImmediately) {
      const watchStopHandle = () => {
      };
      watchStopHandle.stop = NOOP;
      watchStopHandle.resume = NOOP;
      watchStopHandle.pause = NOOP;
      return watchStopHandle;
    }
  }
  const instance = currentInstance;
  baseWatchOptions.call = (fn, type, args) => callWithAsyncErrorHandling(fn, instance, type, args);
  let isPre = false;
  if (flush === "post") {
    baseWatchOptions.scheduler = (job) => {
      queuePostRenderEffect(job, instance && instance.suspense);
    };
  } else if (flush !== "sync") {
    isPre = true;
    baseWatchOptions.scheduler = (job, isFirstRun) => {
      if (isFirstRun) {
        job();
      } else {
        queueJob(job);
      }
    };
  }
  baseWatchOptions.augmentJob = (job) => {
    if (cb) {
      job.flags |= 4;
    }
    if (isPre) {
      job.flags |= 2;
      if (instance) {
        job.id = instance.uid;
        job.i = instance;
      }
    }
  };
  const watchHandle = watch$1(source, cb, baseWatchOptions);
  if (isInSSRComponentSetup) {
    if (ssrCleanup) {
      ssrCleanup.push(watchHandle);
    } else if (runsImmediately) {
      watchHandle();
    }
  }
  return watchHandle;
}
function instanceWatch(source, value, options) {
  const publicThis = this.proxy;
  const getter = isString(source) ? source.includes(".") ? createPathGetter(publicThis, source) : () => publicThis[source] : source.bind(publicThis, publicThis);
  let cb;
  if (isFunction(value)) {
    cb = value;
  } else {
    cb = value.handler;
    options = value;
  }
  const reset = setCurrentInstance(this);
  const res = doWatch(getter, cb.bind(publicThis), options);
  reset();
  return res;
}
function createPathGetter(ctx, path) {
  const segments = path.split(".");
  return () => {
    let cur = ctx;
    for (let i = 0; i < segments.length && cur; i++) {
      cur = cur[segments[i]];
    }
    return cur;
  };
}
const TeleportEndKey = /* @__PURE__ */ Symbol("_vte");
const isTeleport = (type) => type.__isTeleport;
const leaveCbKey = /* @__PURE__ */ Symbol("_leaveCb");
function setTransitionHooks(vnode, hooks) {
  if (vnode.shapeFlag & 6 && vnode.component) {
    vnode.transition = hooks;
    setTransitionHooks(vnode.component.subTree, hooks);
  } else if (vnode.shapeFlag & 128) {
    vnode.ssContent.transition = hooks.clone(vnode.ssContent);
    vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
  } else {
    vnode.transition = hooks;
  }
}
// @__NO_SIDE_EFFECTS__
function defineComponent(options, extraOptions) {
  return isFunction(options) ? (
    // #8236: extend call and options.name access are considered side-effects
    // by Rollup, so we have to wrap it in a pure-annotated IIFE.
    /* @__PURE__ */ (() => extend({ name: options.name }, extraOptions, { setup: options }))()
  ) : options;
}
function markAsyncBoundary(instance) {
  instance.ids = [instance.ids[0] + instance.ids[2]++ + "-", 0, 0];
}
function isTemplateRefKey(refs, key) {
  let desc;
  return !!((desc = Object.getOwnPropertyDescriptor(refs, key)) && !desc.configurable);
}
const pendingSetRefMap = /* @__PURE__ */ new WeakMap();
function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
  if (isArray(rawRef)) {
    rawRef.forEach(
      (r, i) => setRef(
        r,
        oldRawRef && (isArray(oldRawRef) ? oldRawRef[i] : oldRawRef),
        parentSuspense,
        vnode,
        isUnmount
      )
    );
    return;
  }
  if (isAsyncWrapper(vnode) && !isUnmount) {
    if (vnode.shapeFlag & 512 && vnode.type.__asyncResolved && vnode.component.subTree.component) {
      setRef(rawRef, oldRawRef, parentSuspense, vnode.component.subTree);
    }
    return;
  }
  const refValue = vnode.shapeFlag & 4 ? getComponentPublicInstance(vnode.component) : vnode.el;
  const value = isUnmount ? null : refValue;
  const { i: owner, r: ref3 } = rawRef;
  const oldRef = oldRawRef && oldRawRef.r;
  const refs = owner.refs === EMPTY_OBJ ? owner.refs = {} : owner.refs;
  const setupState = owner.setupState;
  const rawSetupState = /* @__PURE__ */ toRaw(setupState);
  const canSetSetupRef = setupState === EMPTY_OBJ ? NO : (key) => {
    if (isTemplateRefKey(refs, key)) {
      return false;
    }
    return hasOwn(rawSetupState, key);
  };
  const canSetRef = (ref22, key) => {
    if (key && isTemplateRefKey(refs, key)) {
      return false;
    }
    return true;
  };
  if (oldRef != null && oldRef !== ref3) {
    invalidatePendingSetRef(oldRawRef);
    if (isString(oldRef)) {
      refs[oldRef] = null;
      if (canSetSetupRef(oldRef)) {
        setupState[oldRef] = null;
      }
    } else if (/* @__PURE__ */ isRef(oldRef)) {
      const oldRawRefAtom = oldRawRef;
      if (canSetRef(oldRef, oldRawRefAtom.k)) {
        oldRef.value = null;
      }
      if (oldRawRefAtom.k) refs[oldRawRefAtom.k] = null;
    }
  }
  if (isFunction(ref3)) {
    pauseTracking();
    try {
      callWithErrorHandling(ref3, owner, 12, [value, refs]);
    } finally {
      resetTracking();
    }
  } else {
    const _isString = isString(ref3);
    const _isRef = /* @__PURE__ */ isRef(ref3);
    if (_isString || _isRef) {
      const doSet = () => {
        if (rawRef.f) {
          const existing = _isString ? canSetSetupRef(ref3) ? setupState[ref3] : refs[ref3] : canSetRef() || !rawRef.k ? ref3.value : refs[rawRef.k];
          if (isUnmount) {
            isArray(existing) && remove(existing, refValue);
          } else {
            if (!isArray(existing)) {
              if (_isString) {
                refs[ref3] = [refValue];
                if (canSetSetupRef(ref3)) {
                  setupState[ref3] = refs[ref3];
                }
              } else {
                const newVal = [refValue];
                if (canSetRef(ref3, rawRef.k)) {
                  ref3.value = newVal;
                }
                if (rawRef.k) refs[rawRef.k] = newVal;
              }
            } else if (!existing.includes(refValue)) {
              existing.push(refValue);
            }
          }
        } else if (_isString) {
          refs[ref3] = value;
          if (canSetSetupRef(ref3)) {
            setupState[ref3] = value;
          }
        } else if (_isRef) {
          if (canSetRef(ref3, rawRef.k)) {
            ref3.value = value;
          }
          if (rawRef.k) refs[rawRef.k] = value;
        } else ;
      };
      if (value) {
        const job = () => {
          doSet();
          pendingSetRefMap.delete(rawRef);
        };
        job.id = -1;
        pendingSetRefMap.set(rawRef, job);
        queuePostRenderEffect(job, parentSuspense);
      } else {
        invalidatePendingSetRef(rawRef);
        doSet();
      }
    }
  }
}
function invalidatePendingSetRef(rawRef) {
  const pendingSetRef = pendingSetRefMap.get(rawRef);
  if (pendingSetRef) {
    pendingSetRef.flags |= 8;
    pendingSetRefMap.delete(rawRef);
  }
}
getGlobalThis().requestIdleCallback || ((cb) => setTimeout(cb, 1));
getGlobalThis().cancelIdleCallback || ((id) => clearTimeout(id));
const isAsyncWrapper = (i) => !!i.type.__asyncLoader;
const isKeepAlive = (vnode) => vnode.type.__isKeepAlive;
function onActivated(hook, target) {
  registerKeepAliveHook(hook, "a", target);
}
function onDeactivated(hook, target) {
  registerKeepAliveHook(hook, "da", target);
}
function registerKeepAliveHook(hook, type, target = currentInstance) {
  const wrappedHook = hook.__wdc || (hook.__wdc = () => {
    let current = target;
    while (current) {
      if (current.isDeactivated) {
        return;
      }
      current = current.parent;
    }
    return hook();
  });
  injectHook(type, wrappedHook, target);
  if (target) {
    let current = target.parent;
    while (current && current.parent) {
      if (isKeepAlive(current.parent.vnode)) {
        injectToKeepAliveRoot(wrappedHook, type, target, current);
      }
      current = current.parent;
    }
  }
}
function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) {
  const injected = injectHook(
    type,
    hook,
    keepAliveRoot,
    true
    /* prepend */
  );
  onUnmounted(() => {
    remove(keepAliveRoot[type], injected);
  }, target);
}
function injectHook(type, hook, target = currentInstance, prepend = false) {
  if (target) {
    const hooks = target[type] || (target[type] = []);
    const wrappedHook = hook.__weh || (hook.__weh = (...args) => {
      pauseTracking();
      const reset = setCurrentInstance(target);
      const res = callWithAsyncErrorHandling(hook, target, type, args);
      reset();
      resetTracking();
      return res;
    });
    if (prepend) {
      hooks.unshift(wrappedHook);
    } else {
      hooks.push(wrappedHook);
    }
    return wrappedHook;
  }
}
const createHook = (lifecycle) => (hook, target = currentInstance) => {
  if (!isInSSRComponentSetup || lifecycle === "sp") {
    injectHook(lifecycle, (...args) => hook(...args), target);
  }
};
const onBeforeMount = createHook("bm");
const onMounted = createHook("m");
const onBeforeUpdate = createHook(
  "bu"
);
const onUpdated = createHook("u");
const onBeforeUnmount = createHook(
  "bum"
);
const onUnmounted = createHook("um");
const onServerPrefetch = createHook(
  "sp"
);
const onRenderTriggered = createHook("rtg");
const onRenderTracked = createHook("rtc");
function onErrorCaptured(hook, target = currentInstance) {
  injectHook("ec", hook, target);
}
const NULL_DYNAMIC_COMPONENT = /* @__PURE__ */ Symbol.for("v-ndc");
function renderList(source, renderItem, cache, index) {
  let ret;
  const cached = cache;
  const sourceIsArray = isArray(source);
  if (sourceIsArray || isString(source)) {
    const sourceIsReactiveArray = sourceIsArray && /* @__PURE__ */ isReactive(source);
    let needsWrap = false;
    let isReadonlySource = false;
    if (sourceIsReactiveArray) {
      needsWrap = !/* @__PURE__ */ isShallow(source);
      isReadonlySource = /* @__PURE__ */ isReadonly(source);
      source = shallowReadArray(source);
    }
    ret = new Array(source.length);
    for (let i = 0, l = source.length; i < l; i++) {
      ret[i] = renderItem(
        needsWrap ? isReadonlySource ? toReadonly(toReactive(source[i])) : toReactive(source[i]) : source[i],
        i,
        void 0,
        cached
      );
    }
  } else if (typeof source === "number") {
    {
      ret = new Array(source);
      for (let i = 0; i < source; i++) {
        ret[i] = renderItem(i + 1, i, void 0, cached);
      }
    }
  } else if (isObject(source)) {
    if (source[Symbol.iterator]) {
      ret = Array.from(
        source,
        (item, i) => renderItem(item, i, void 0, cached)
      );
    } else {
      const keys = Object.keys(source);
      ret = new Array(keys.length);
      for (let i = 0, l = keys.length; i < l; i++) {
        const key = keys[i];
        ret[i] = renderItem(source[key], key, i, cached);
      }
    }
  } else {
    ret = [];
  }
  return ret;
}
const getPublicInstance = (i) => {
  if (!i) return null;
  if (isStatefulComponent(i)) return getComponentPublicInstance(i);
  return getPublicInstance(i.parent);
};
const publicPropertiesMap = (
  // Move PURE marker to new line to workaround compiler discarding it
  // due to type annotation
  /* @__PURE__ */ extend(/* @__PURE__ */ Object.create(null), {
    $: (i) => i,
    $el: (i) => i.vnode.el,
    $data: (i) => i.data,
    $props: (i) => i.props,
    $attrs: (i) => i.attrs,
    $slots: (i) => i.slots,
    $refs: (i) => i.refs,
    $parent: (i) => getPublicInstance(i.parent),
    $root: (i) => getPublicInstance(i.root),
    $host: (i) => i.ce,
    $emit: (i) => i.emit,
    $options: (i) => resolveMergedOptions(i),
    $forceUpdate: (i) => i.f || (i.f = () => {
      queueJob(i.update);
    }),
    $nextTick: (i) => i.n || (i.n = nextTick.bind(i.proxy)),
    $watch: (i) => instanceWatch.bind(i)
  })
);
const hasSetupBinding = (state, key) => state !== EMPTY_OBJ && !state.__isScriptSetup && hasOwn(state, key);
const PublicInstanceProxyHandlers = {
  get({ _: instance }, key) {
    if (key === "__v_skip") {
      return true;
    }
    const { ctx, setupState, data, props, accessCache, type, appContext } = instance;
    if (key[0] !== "$") {
      const n = accessCache[key];
      if (n !== void 0) {
        switch (n) {
          case 1:
            return setupState[key];
          case 2:
            return data[key];
          case 4:
            return ctx[key];
          case 3:
            return props[key];
        }
      } else if (hasSetupBinding(setupState, key)) {
        accessCache[key] = 1;
        return setupState[key];
      } else if (data !== EMPTY_OBJ && hasOwn(data, key)) {
        accessCache[key] = 2;
        return data[key];
      } else if (hasOwn(props, key)) {
        accessCache[key] = 3;
        return props[key];
      } else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {
        accessCache[key] = 4;
        return ctx[key];
      } else if (shouldCacheAccess) {
        accessCache[key] = 0;
      }
    }
    const publicGetter = publicPropertiesMap[key];
    let cssModule, globalProperties;
    if (publicGetter) {
      if (key === "$attrs") {
        track(instance.attrs, "get", "");
      }
      return publicGetter(instance);
    } else if (
      // css module (injected by vue-loader)
      (cssModule = type.__cssModules) && (cssModule = cssModule[key])
    ) {
      return cssModule;
    } else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {
      accessCache[key] = 4;
      return ctx[key];
    } else if (
      // global properties
      globalProperties = appContext.config.globalProperties, hasOwn(globalProperties, key)
    ) {
      {
        return globalProperties[key];
      }
    } else ;
  },
  set({ _: instance }, key, value) {
    const { data, setupState, ctx } = instance;
    if (hasSetupBinding(setupState, key)) {
      setupState[key] = value;
      return true;
    } else if (data !== EMPTY_OBJ && hasOwn(data, key)) {
      data[key] = value;
      return true;
    } else if (hasOwn(instance.props, key)) {
      return false;
    }
    if (key[0] === "$" && key.slice(1) in instance) {
      return false;
    } else {
      {
        ctx[key] = value;
      }
    }
    return true;
  },
  has({
    _: { data, setupState, accessCache, ctx, appContext, props, type }
  }, key) {
    let cssModules;
    return !!(accessCache[key] || data !== EMPTY_OBJ && key[0] !== "$" && hasOwn(data, key) || hasSetupBinding(setupState, key) || hasOwn(props, key) || hasOwn(ctx, key) || hasOwn(publicPropertiesMap, key) || hasOwn(appContext.config.globalProperties, key) || (cssModules = type.__cssModules) && cssModules[key]);
  },
  defineProperty(target, key, descriptor) {
    if (descriptor.get != null) {
      target._.accessCache[key] = 0;
    } else if (hasOwn(descriptor, "value")) {
      this.set(target, key, descriptor.value, null);
    }
    return Reflect.defineProperty(target, key, descriptor);
  }
};
function normalizePropsOrEmits(props) {
  return isArray(props) ? props.reduce(
    (normalized, p2) => (normalized[p2] = null, normalized),
    {}
  ) : props;
}
let shouldCacheAccess = true;
function applyOptions(instance) {
  const options = resolveMergedOptions(instance);
  const publicThis = instance.proxy;
  const ctx = instance.ctx;
  shouldCacheAccess = false;
  if (options.beforeCreate) {
    callHook(options.beforeCreate, instance, "bc");
  }
  const {
    // state
    data: dataOptions,
    computed: computedOptions,
    methods,
    watch: watchOptions,
    provide: provideOptions,
    inject: injectOptions,
    // lifecycle
    created,
    beforeMount,
    mounted,
    beforeUpdate,
    updated,
    activated,
    deactivated,
    beforeDestroy,
    beforeUnmount,
    destroyed,
    unmounted,
    render,
    renderTracked,
    renderTriggered,
    errorCaptured,
    serverPrefetch,
    // public API
    expose,
    inheritAttrs,
    // assets
    components,
    directives,
    filters
  } = options;
  const checkDuplicateProperties = null;
  if (injectOptions) {
    resolveInjections(injectOptions, ctx, checkDuplicateProperties);
  }
  if (methods) {
    for (const key in methods) {
      const methodHandler = methods[key];
      if (isFunction(methodHandler)) {
        {
          ctx[key] = methodHandler.bind(publicThis);
        }
      }
    }
  }
  if (dataOptions) {
    const data = dataOptions.call(publicThis, publicThis);
    if (!isObject(data)) ;
    else {
      instance.data = /* @__PURE__ */ reactive(data);
    }
  }
  shouldCacheAccess = true;
  if (computedOptions) {
    for (const key in computedOptions) {
      const opt = computedOptions[key];
      const get = isFunction(opt) ? opt.bind(publicThis, publicThis) : isFunction(opt.get) ? opt.get.bind(publicThis, publicThis) : NOOP;
      const set = !isFunction(opt) && isFunction(opt.set) ? opt.set.bind(publicThis) : NOOP;
      const c = computed({
        get,
        set
      });
      Object.defineProperty(ctx, key, {
        enumerable: true,
        configurable: true,
        get: () => c.value,
        set: (v) => c.value = v
      });
    }
  }
  if (watchOptions) {
    for (const key in watchOptions) {
      createWatcher(watchOptions[key], ctx, publicThis, key);
    }
  }
  if (provideOptions) {
    const provides = isFunction(provideOptions) ? provideOptions.call(publicThis) : provideOptions;
    Reflect.ownKeys(provides).forEach((key) => {
      provide(key, provides[key]);
    });
  }
  if (created) {
    callHook(created, instance, "c");
  }
  function registerLifecycleHook(register, hook) {
    if (isArray(hook)) {
      hook.forEach((_hook) => register(_hook.bind(publicThis)));
    } else if (hook) {
      register(hook.bind(publicThis));
    }
  }
  registerLifecycleHook(onBeforeMount, beforeMount);
  registerLifecycleHook(onMounted, mounted);
  registerLifecycleHook(onBeforeUpdate, beforeUpdate);
  registerLifecycleHook(onUpdated, updated);
  registerLifecycleHook(onActivated, activated);
  registerLifecycleHook(onDeactivated, deactivated);
  registerLifecycleHook(onErrorCaptured, errorCaptured);
  registerLifecycleHook(onRenderTracked, renderTracked);
  registerLifecycleHook(onRenderTriggered, renderTriggered);
  registerLifecycleHook(onBeforeUnmount, beforeUnmount);
  registerLifecycleHook(onUnmounted, unmounted);
  registerLifecycleHook(onServerPrefetch, serverPrefetch);
  if (isArray(expose)) {
    if (expose.length) {
      const exposed = instance.exposed || (instance.exposed = {});
      expose.forEach((key) => {
        Object.defineProperty(exposed, key, {
          get: () => publicThis[key],
          set: (val) => publicThis[key] = val,
          enumerable: true
        });
      });
    } else if (!instance.exposed) {
      instance.exposed = {};
    }
  }
  if (render && instance.render === NOOP) {
    instance.render = render;
  }
  if (inheritAttrs != null) {
    instance.inheritAttrs = inheritAttrs;
  }
  if (components) instance.components = components;
  if (directives) instance.directives = directives;
  if (serverPrefetch) {
    markAsyncBoundary(instance);
  }
}
function resolveInjections(injectOptions, ctx, checkDuplicateProperties = NOOP) {
  if (isArray(injectOptions)) {
    injectOptions = normalizeInject(injectOptions);
  }
  for (const key in injectOptions) {
    const opt = injectOptions[key];
    let injected;
    if (isObject(opt)) {
      if ("default" in opt) {
        injected = inject(
          opt.from || key,
          opt.default,
          true
        );
      } else {
        injected = inject(opt.from || key);
      }
    } else {
      injected = inject(opt);
    }
    if (/* @__PURE__ */ isRef(injected)) {
      Object.defineProperty(ctx, key, {
        enumerable: true,
        configurable: true,
        get: () => injected.value,
        set: (v) => injected.value = v
      });
    } else {
      ctx[key] = injected;
    }
  }
}
function callHook(hook, instance, type) {
  callWithAsyncErrorHandling(
    isArray(hook) ? hook.map((h2) => h2.bind(instance.proxy)) : hook.bind(instance.proxy),
    instance,
    type
  );
}
function createWatcher(raw, ctx, publicThis, key) {
  let getter = key.includes(".") ? createPathGetter(publicThis, key) : () => publicThis[key];
  if (isString(raw)) {
    const handler = ctx[raw];
    if (isFunction(handler)) {
      {
        watch(getter, handler);
      }
    }
  } else if (isFunction(raw)) {
    {
      watch(getter, raw.bind(publicThis));
    }
  } else if (isObject(raw)) {
    if (isArray(raw)) {
      raw.forEach((r) => createWatcher(r, ctx, publicThis, key));
    } else {
      const handler = isFunction(raw.handler) ? raw.handler.bind(publicThis) : ctx[raw.handler];
      if (isFunction(handler)) {
        watch(getter, handler, raw);
      }
    }
  } else ;
}
function resolveMergedOptions(instance) {
  const base = instance.type;
  const { mixins, extends: extendsOptions } = base;
  const {
    mixins: globalMixins,
    optionsCache: cache,
    config: { optionMergeStrategies }
  } = instance.appContext;
  const cached = cache.get(base);
  let resolved;
  if (cached) {
    resolved = cached;
  } else if (!globalMixins.length && !mixins && !extendsOptions) {
    {
      resolved = base;
    }
  } else {
    resolved = {};
    if (globalMixins.length) {
      globalMixins.forEach(
        (m) => mergeOptions(resolved, m, optionMergeStrategies, true)
      );
    }
    mergeOptions(resolved, base, optionMergeStrategies);
  }
  if (isObject(base)) {
    cache.set(base, resolved);
  }
  return resolved;
}
function mergeOptions(to, from, strats, asMixin = false) {
  const { mixins, extends: extendsOptions } = from;
  if (extendsOptions) {
    mergeOptions(to, extendsOptions, strats, true);
  }
  if (mixins) {
    mixins.forEach(
      (m) => mergeOptions(to, m, strats, true)
    );
  }
  for (const key in from) {
    if (asMixin && key === "expose") ;
    else {
      const strat = internalOptionMergeStrats[key] || strats && strats[key];
      to[key] = strat ? strat(to[key], from[key]) : from[key];
    }
  }
  return to;
}
const internalOptionMergeStrats = {
  data: mergeDataFn,
  props: mergeEmitsOrPropsOptions,
  emits: mergeEmitsOrPropsOptions,
  // objects
  methods: mergeObjectOptions,
  computed: mergeObjectOptions,
  // lifecycle
  beforeCreate: mergeAsArray,
  created: mergeAsArray,
  beforeMount: mergeAsArray,
  mounted: mergeAsArray,
  beforeUpdate: mergeAsArray,
  updated: mergeAsArray,
  beforeDestroy: mergeAsArray,
  beforeUnmount: mergeAsArray,
  destroyed: mergeAsArray,
  unmounted: mergeAsArray,
  activated: mergeAsArray,
  deactivated: mergeAsArray,
  errorCaptured: mergeAsArray,
  serverPrefetch: mergeAsArray,
  // assets
  components: mergeObjectOptions,
  directives: mergeObjectOptions,
  // watch
  watch: mergeWatchOptions,
  // provide / inject
  provide: mergeDataFn,
  inject: mergeInject
};
function mergeDataFn(to, from) {
  if (!from) {
    return to;
  }
  if (!to) {
    return from;
  }
  return function mergedDataFn() {
    return extend(
      isFunction(to) ? to.call(this, this) : to,
      isFunction(from) ? from.call(this, this) : from
    );
  };
}
function mergeInject(to, from) {
  return mergeObjectOptions(normalizeInject(to), normalizeInject(from));
}
function normalizeInject(raw) {
  if (isArray(raw)) {
    const res = {};
    for (let i = 0; i < raw.length; i++) {
      res[raw[i]] = raw[i];
    }
    return res;
  }
  return raw;
}
function mergeAsArray(to, from) {
  return to ? [...new Set([].concat(to, from))] : from;
}
function mergeObjectOptions(to, from) {
  return to ? extend(/* @__PURE__ */ Object.create(null), to, from) : from;
}
function mergeEmitsOrPropsOptions(to, from) {
  if (to) {
    if (isArray(to) && isArray(from)) {
      return [.../* @__PURE__ */ new Set([...to, ...from])];
    }
    return extend(
      /* @__PURE__ */ Object.create(null),
      normalizePropsOrEmits(to),
      normalizePropsOrEmits(from != null ? from : {})
    );
  } else {
    return from;
  }
}
function mergeWatchOptions(to, from) {
  if (!to) return from;
  if (!from) return to;
  const merged = extend(/* @__PURE__ */ Object.create(null), to);
  for (const key in from) {
    merged[key] = mergeAsArray(to[key], from[key]);
  }
  return merged;
}
function createAppContext() {
  return {
    app: null,
    config: {
      isNativeTag: NO,
      performance: false,
      globalProperties: {},
      optionMergeStrategies: {},
      errorHandler: void 0,
      warnHandler: void 0,
      compilerOptions: {}
    },
    mixins: [],
    components: {},
    directives: {},
    provides: /* @__PURE__ */ Object.create(null),
    optionsCache: /* @__PURE__ */ new WeakMap(),
    propsCache: /* @__PURE__ */ new WeakMap(),
    emitsCache: /* @__PURE__ */ new WeakMap()
  };
}
let uid$1 = 0;
function createAppAPI(render, hydrate) {
  return function createApp2(rootComponent, rootProps = null) {
    if (!isFunction(rootComponent)) {
      rootComponent = extend({}, rootComponent);
    }
    if (rootProps != null && !isObject(rootProps)) {
      rootProps = null;
    }
    const context = createAppContext();
    const installedPlugins = /* @__PURE__ */ new WeakSet();
    const pluginCleanupFns = [];
    let isMounted = false;
    const app = context.app = {
      _uid: uid$1++,
      _component: rootComponent,
      _props: rootProps,
      _container: null,
      _context: context,
      _instance: null,
      version,
      get config() {
        return context.config;
      },
      set config(v) {
      },
      use(plugin, ...options) {
        if (installedPlugins.has(plugin)) ;
        else if (plugin && isFunction(plugin.install)) {
          installedPlugins.add(plugin);
          plugin.install(app, ...options);
        } else if (isFunction(plugin)) {
          installedPlugins.add(plugin);
          plugin(app, ...options);
        } else ;
        return app;
      },
      mixin(mixin) {
        {
          if (!context.mixins.includes(mixin)) {
            context.mixins.push(mixin);
          }
        }
        return app;
      },
      component(name, component) {
        if (!component) {
          return context.components[name];
        }
        context.components[name] = component;
        return app;
      },
      directive(name, directive) {
        if (!directive) {
          return context.directives[name];
        }
        context.directives[name] = directive;
        return app;
      },
      mount(rootContainer, isHydrate, namespace) {
        if (!isMounted) {
          const vnode = app._ceVNode || createVNode(rootComponent, rootProps);
          vnode.appContext = context;
          if (namespace === true) {
            namespace = "svg";
          } else if (namespace === false) {
            namespace = void 0;
          }
          {
            render(vnode, rootContainer, namespace);
          }
          isMounted = true;
          app._container = rootContainer;
          rootContainer.__vue_app__ = app;
          return getComponentPublicInstance(vnode.component);
        }
      },
      onUnmount(cleanupFn) {
        pluginCleanupFns.push(cleanupFn);
      },
      unmount() {
        if (isMounted) {
          callWithAsyncErrorHandling(
            pluginCleanupFns,
            app._instance,
            16
          );
          render(null, app._container);
          delete app._container.__vue_app__;
        }
      },
      provide(key, value) {
        context.provides[key] = value;
        return app;
      },
      runWithContext(fn) {
        const lastApp = currentApp;
        currentApp = app;
        try {
          return fn();
        } finally {
          currentApp = lastApp;
        }
      }
    };
    return app;
  };
}
let currentApp = null;
const getModelModifiers = (props, modelName) => {
  return modelName === "modelValue" || modelName === "model-value" ? props.modelModifiers : props[`${modelName}Modifiers`] || props[`${camelize(modelName)}Modifiers`] || props[`${hyphenate(modelName)}Modifiers`];
};
function emit(instance, event, ...rawArgs) {
  if (instance.isUnmounted) return;
  const props = instance.vnode.props || EMPTY_OBJ;
  let args = rawArgs;
  const isModelListener2 = event.startsWith("update:");
  const modifiers = isModelListener2 && getModelModifiers(props, event.slice(7));
  if (modifiers) {
    if (modifiers.trim) {
      args = rawArgs.map((a) => isString(a) ? a.trim() : a);
    }
    if (modifiers.number) {
      args = rawArgs.map(looseToNumber);
    }
  }
  let handlerName;
  let handler = props[handlerName = toHandlerKey(event)] || // also try camelCase event handler (#2249)
  props[handlerName = toHandlerKey(camelize(event))];
  if (!handler && isModelListener2) {
    handler = props[handlerName = toHandlerKey(hyphenate(event))];
  }
  if (handler) {
    callWithAsyncErrorHandling(
      handler,
      instance,
      6,
      args
    );
  }
  const onceHandler = props[handlerName + `Once`];
  if (onceHandler) {
    if (!instance.emitted) {
      instance.emitted = {};
    } else if (instance.emitted[handlerName]) {
      return;
    }
    instance.emitted[handlerName] = true;
    callWithAsyncErrorHandling(
      onceHandler,
      instance,
      6,
      args
    );
  }
}
const mixinEmitsCache = /* @__PURE__ */ new WeakMap();
function normalizeEmitsOptions(comp, appContext, asMixin = false) {
  const cache = asMixin ? mixinEmitsCache : appContext.emitsCache;
  const cached = cache.get(comp);
  if (cached !== void 0) {
    return cached;
  }
  const raw = comp.emits;
  let normalized = {};
  let hasExtends = false;
  if (!isFunction(comp)) {
    const extendEmits = (raw2) => {
      const normalizedFromExtend = normalizeEmitsOptions(raw2, appContext, true);
      if (normalizedFromExtend) {
        hasExtends = true;
        extend(normalized, normalizedFromExtend);
      }
    };
    if (!asMixin && appContext.mixins.length) {
      appContext.mixins.forEach(extendEmits);
    }
    if (comp.extends) {
      extendEmits(comp.extends);
    }
    if (comp.mixins) {
      comp.mixins.forEach(extendEmits);
    }
  }
  if (!raw && !hasExtends) {
    if (isObject(comp)) {
      cache.set(comp, null);
    }
    return null;
  }
  if (isArray(raw)) {
    raw.forEach((key) => normalized[key] = null);
  } else {
    extend(normalized, raw);
  }
  if (isObject(comp)) {
    cache.set(comp, normalized);
  }
  return normalized;
}
function isEmitListener(options, key) {
  if (!options || !isOn(key)) {
    return false;
  }
  key = key.slice(2);
  key = key === "Once" ? key : key.replace(/Once$/, "");
  return hasOwn(options, key[0].toLowerCase() + key.slice(1)) || hasOwn(options, hyphenate(key)) || hasOwn(options, key);
}
function markAttrsAccessed() {
}
function renderComponentRoot(instance) {
  const {
    type: Component,
    vnode,
    proxy,
    withProxy,
    propsOptions: [propsOptions],
    slots,
    attrs,
    emit: emit2,
    render,
    renderCache,
    props,
    data,
    setupState,
    ctx,
    inheritAttrs
  } = instance;
  const prev = setCurrentRenderingInstance(instance);
  let result;
  let fallthroughAttrs;
  try {
    if (vnode.shapeFlag & 4) {
      const proxyToUse = withProxy || proxy;
      const thisProxy = false ? new Proxy(proxyToUse, {
        get(target, key, receiver) {
          warn$1(
            `Property '${String(
              key
            )}' was accessed via 'this'. Avoid using 'this' in templates.`
          );
          return Reflect.get(target, key, receiver);
        }
      }) : proxyToUse;
      result = normalizeVNode(
        render.call(
          thisProxy,
          proxyToUse,
          renderCache,
          false ? /* @__PURE__ */ shallowReadonly(props) : props,
          setupState,
          data,
          ctx
        )
      );
      fallthroughAttrs = attrs;
    } else {
      const render2 = Component;
      if (false) ;
      result = normalizeVNode(
        render2.length > 1 ? render2(
          false ? /* @__PURE__ */ shallowReadonly(props) : props,
          false ? {
            get attrs() {
              markAttrsAccessed();
              return /* @__PURE__ */ shallowReadonly(attrs);
            },
            slots,
            emit: emit2
          } : { attrs, slots, emit: emit2 }
        ) : render2(
          false ? /* @__PURE__ */ shallowReadonly(props) : props,
          null
        )
      );
      fallthroughAttrs = Component.props ? attrs : getFunctionalFallthrough(attrs);
    }
  } catch (err) {
    blockStack.length = 0;
    handleError(err, instance, 1);
    result = createVNode(Comment);
  }
  let root = result;
  if (fallthroughAttrs && inheritAttrs !== false) {
    const keys = Object.keys(fallthroughAttrs);
    const { shapeFlag } = root;
    if (keys.length) {
      if (shapeFlag & (1 | 6)) {
        if (propsOptions && keys.some(isModelListener)) {
          fallthroughAttrs = filterModelListeners(
            fallthroughAttrs,
            propsOptions
          );
        }
        root = cloneVNode(root, fallthroughAttrs, false, true);
      }
    }
  }
  if (vnode.dirs) {
    root = cloneVNode(root, null, false, true);
    root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;
  }
  if (vnode.transition) {
    setTransitionHooks(root, vnode.transition);
  }
  {
    result = root;
  }
  setCurrentRenderingInstance(prev);
  return result;
}
const getFunctionalFallthrough = (attrs) => {
  let res;
  for (const key in attrs) {
    if (key === "class" || key === "style" || isOn(key)) {
      (res || (res = {}))[key] = attrs[key];
    }
  }
  return res;
};
const filterModelListeners = (attrs, props) => {
  const res = {};
  for (const key in attrs) {
    if (!isModelListener(key) || !(key.slice(9) in props)) {
      res[key] = attrs[key];
    }
  }
  return res;
};
function shouldUpdateComponent(prevVNode, nextVNode, optimized) {
  const { props: prevProps, children: prevChildren, component } = prevVNode;
  const { props: nextProps, children: nextChildren, patchFlag } = nextVNode;
  const emits = component.emitsOptions;
  if (nextVNode.dirs || nextVNode.transition) {
    return true;
  }
  if (optimized && patchFlag >= 0) {
    if (patchFlag & 1024) {
      return true;
    }
    if (patchFlag & 16) {
      if (!prevProps) {
        return !!nextProps;
      }
      return hasPropsChanged(prevProps, nextProps, emits);
    } else if (patchFlag & 8) {
      const dynamicProps = nextVNode.dynamicProps;
      for (let i = 0; i < dynamicProps.length; i++) {
        const key = dynamicProps[i];
        if (hasPropValueChanged(nextProps, prevProps, key) && !isEmitListener(emits, key)) {
          return true;
        }
      }
    }
  } else {
    if (prevChildren || nextChildren) {
      if (!nextChildren || !nextChildren.$stable) {
        return true;
      }
    }
    if (prevProps === nextProps) {
      return false;
    }
    if (!prevProps) {
      return !!nextProps;
    }
    if (!nextProps) {
      return true;
    }
    return hasPropsChanged(prevProps, nextProps, emits);
  }
  return false;
}
function hasPropsChanged(prevProps, nextProps, emitsOptions) {
  const nextKeys = Object.keys(nextProps);
  if (nextKeys.length !== Object.keys(prevProps).length) {
    return true;
  }
  for (let i = 0; i < nextKeys.length; i++) {
    const key = nextKeys[i];
    if (hasPropValueChanged(nextProps, prevProps, key) && !isEmitListener(emitsOptions, key)) {
      return true;
    }
  }
  return false;
}
function hasPropValueChanged(nextProps, prevProps, key) {
  const nextProp = nextProps[key];
  const prevProp = prevProps[key];
  if (key === "style" && isObject(nextProp) && isObject(prevProp)) {
    return !looseEqual(nextProp, prevProp);
  }
  return nextProp !== prevProp;
}
function updateHOCHostEl({ vnode, parent, suspense }, el) {
  while (parent) {
    const root = parent.subTree;
    if (root.suspense && root.suspense.activeBranch === vnode) {
      root.suspense.vnode.el = root.el = el;
      vnode = root;
    }
    if (root === vnode) {
      (vnode = parent.vnode).el = el;
      parent = parent.parent;
    } else {
      break;
    }
  }
  if (suspense && suspense.activeBranch === vnode) {
    suspense.vnode.el = el;
  }
}
const internalObjectProto = {};
const createInternalObject = () => Object.create(internalObjectProto);
const isInternalObject = (obj) => Object.getPrototypeOf(obj) === internalObjectProto;
function initProps(instance, rawProps, isStateful, isSSR = false) {
  const props = {};
  const attrs = createInternalObject();
  instance.propsDefaults = /* @__PURE__ */ Object.create(null);
  setFullProps(instance, rawProps, props, attrs);
  for (const key in instance.propsOptions[0]) {
    if (!(key in props)) {
      props[key] = void 0;
    }
  }
  if (isStateful) {
    instance.props = isSSR ? props : /* @__PURE__ */ shallowReactive(props);
  } else {
    if (!instance.type.props) {
      instance.props = attrs;
    } else {
      instance.props = props;
    }
  }
  instance.attrs = attrs;
}
function updateProps(instance, rawProps, rawPrevProps, optimized) {
  const {
    props,
    attrs,
    vnode: { patchFlag }
  } = instance;
  const rawCurrentProps = /* @__PURE__ */ toRaw(props);
  const [options] = instance.propsOptions;
  let hasAttrsChanged = false;
  if (
    // always force full diff in dev
    // - #1942 if hmr is enabled with sfc component
    // - vite#872 non-sfc component used by sfc component
    (optimized || patchFlag > 0) && !(patchFlag & 16)
  ) {
    if (patchFlag & 8) {
      const propsToUpdate = instance.vnode.dynamicProps;
      for (let i = 0; i < propsToUpdate.length; i++) {
        let key = propsToUpdate[i];
        if (isEmitListener(instance.emitsOptions, key)) {
          continue;
        }
        const value = rawProps[key];
        if (options) {
          if (hasOwn(attrs, key)) {
            if (value !== attrs[key]) {
              attrs[key] = value;
              hasAttrsChanged = true;
            }
          } else {
            const camelizedKey = camelize(key);
            props[camelizedKey] = resolvePropValue(
              options,
              rawCurrentProps,
              camelizedKey,
              value,
              instance,
              false
            );
          }
        } else {
          if (value !== attrs[key]) {
            attrs[key] = value;
            hasAttrsChanged = true;
          }
        }
      }
    }
  } else {
    if (setFullProps(instance, rawProps, props, attrs)) {
      hasAttrsChanged = true;
    }
    let kebabKey;
    for (const key in rawCurrentProps) {
      if (!rawProps || // for camelCase
      !hasOwn(rawProps, key) && // it's possible the original props was passed in as kebab-case
      // and converted to camelCase (#955)
      ((kebabKey = hyphenate(key)) === key || !hasOwn(rawProps, kebabKey))) {
        if (options) {
          if (rawPrevProps && // for camelCase
          (rawPrevProps[key] !== void 0 || // for kebab-case
          rawPrevProps[kebabKey] !== void 0)) {
            props[key] = resolvePropValue(
              options,
              rawCurrentProps,
              key,
              void 0,
              instance,
              true
            );
          }
        } else {
          delete props[key];
        }
      }
    }
    if (attrs !== rawCurrentProps) {
      for (const key in attrs) {
        if (!rawProps || !hasOwn(rawProps, key) && true) {
          delete attrs[key];
          hasAttrsChanged = true;
        }
      }
    }
  }
  if (hasAttrsChanged) {
    trigger(instance.attrs, "set", "");
  }
}
function setFullProps(instance, rawProps, props, attrs) {
  const [options, needCastKeys] = instance.propsOptions;
  let hasAttrsChanged = false;
  let rawCastValues;
  if (rawProps) {
    for (let key in rawProps) {
      if (isReservedProp(key)) {
        continue;
      }
      const value = rawProps[key];
      let camelKey;
      if (options && hasOwn(options, camelKey = camelize(key))) {
        if (!needCastKeys || !needCastKeys.includes(camelKey)) {
          props[camelKey] = value;
        } else {
          (rawCastValues || (rawCastValues = {}))[camelKey] = value;
        }
      } else if (!isEmitListener(instance.emitsOptions, key)) {
        if (!(key in attrs) || value !== attrs[key]) {
          attrs[key] = value;
          hasAttrsChanged = true;
        }
      }
    }
  }
  if (needCastKeys) {
    const rawCurrentProps = /* @__PURE__ */ toRaw(props);
    const castValues = rawCastValues || EMPTY_OBJ;
    for (let i = 0; i < needCastKeys.length; i++) {
      const key = needCastKeys[i];
      props[key] = resolvePropValue(
        options,
        rawCurrentProps,
        key,
        castValues[key],
        instance,
        !hasOwn(castValues, key)
      );
    }
  }
  return hasAttrsChanged;
}
function resolvePropValue(options, props, key, value, instance, isAbsent) {
  const opt = options[key];
  if (opt != null) {
    const hasDefault = hasOwn(opt, "default");
    if (hasDefault && value === void 0) {
      const defaultValue = opt.default;
      if (opt.type !== Function && !opt.skipFactory && isFunction(defaultValue)) {
        const { propsDefaults } = instance;
        if (key in propsDefaults) {
          value = propsDefaults[key];
        } else {
          const reset = setCurrentInstance(instance);
          value = propsDefaults[key] = defaultValue.call(
            null,
            props
          );
          reset();
        }
      } else {
        value = defaultValue;
      }
      if (instance.ce) {
        instance.ce._setProp(key, value);
      }
    }
    if (opt[
      0
      /* shouldCast */
    ]) {
      if (isAbsent && !hasDefault) {
        value = false;
      } else if (opt[
        1
        /* shouldCastTrue */
      ] && (value === "" || value === hyphenate(key))) {
        value = true;
      }
    }
  }
  return value;
}
const mixinPropsCache = /* @__PURE__ */ new WeakMap();
function normalizePropsOptions(comp, appContext, asMixin = false) {
  const cache = asMixin ? mixinPropsCache : appContext.propsCache;
  const cached = cache.get(comp);
  if (cached) {
    return cached;
  }
  const raw = comp.props;
  const normalized = {};
  const needCastKeys = [];
  let hasExtends = false;
  if (!isFunction(comp)) {
    const extendProps = (raw2) => {
      hasExtends = true;
      const [props, keys] = normalizePropsOptions(raw2, appContext, true);
      extend(normalized, props);
      if (keys) needCastKeys.push(...keys);
    };
    if (!asMixin && appContext.mixins.length) {
      appContext.mixins.forEach(extendProps);
    }
    if (comp.extends) {
      extendProps(comp.extends);
    }
    if (comp.mixins) {
      comp.mixins.forEach(extendProps);
    }
  }
  if (!raw && !hasExtends) {
    if (isObject(comp)) {
      cache.set(comp, EMPTY_ARR);
    }
    return EMPTY_ARR;
  }
  if (isArray(raw)) {
    for (let i = 0; i < raw.length; i++) {
      const normalizedKey = camelize(raw[i]);
      if (validatePropName(normalizedKey)) {
        normalized[normalizedKey] = EMPTY_OBJ;
      }
    }
  } else if (raw) {
    for (const key in raw) {
      const normalizedKey = camelize(key);
      if (validatePropName(normalizedKey)) {
        const opt = raw[key];
        const prop = normalized[normalizedKey] = isArray(opt) || isFunction(opt) ? { type: opt } : extend({}, opt);
        const propType = prop.type;
        let shouldCast = false;
        let shouldCastTrue = true;
        if (isArray(propType)) {
          for (let index = 0; index < propType.length; ++index) {
            const type = propType[index];
            const typeName = isFunction(type) && type.name;
            if (typeName === "Boolean") {
              shouldCast = true;
              break;
            } else if (typeName === "String") {
              shouldCastTrue = false;
            }
          }
        } else {
          shouldCast = isFunction(propType) && propType.name === "Boolean";
        }
        prop[
          0
          /* shouldCast */
        ] = shouldCast;
        prop[
          1
          /* shouldCastTrue */
        ] = shouldCastTrue;
        if (shouldCast || hasOwn(prop, "default")) {
          needCastKeys.push(normalizedKey);
        }
      }
    }
  }
  const res = [normalized, needCastKeys];
  if (isObject(comp)) {
    cache.set(comp, res);
  }
  return res;
}
function validatePropName(key) {
  if (key[0] !== "$" && !isReservedProp(key)) {
    return true;
  }
  return false;
}
const isInternalKey = (key) => key === "_" || key === "_ctx" || key === "$stable";
const normalizeSlotValue = (value) => isArray(value) ? value.map(normalizeVNode) : [normalizeVNode(value)];
const normalizeSlot = (key, rawSlot, ctx) => {
  if (rawSlot._n) {
    return rawSlot;
  }
  const normalized = withCtx((...args) => {
    if (false) ;
    return normalizeSlotValue(rawSlot(...args));
  }, ctx);
  normalized._c = false;
  return normalized;
};
const normalizeObjectSlots = (rawSlots, slots, instance) => {
  const ctx = rawSlots._ctx;
  for (const key in rawSlots) {
    if (isInternalKey(key)) continue;
    const value = rawSlots[key];
    if (isFunction(value)) {
      slots[key] = normalizeSlot(key, value, ctx);
    } else if (value != null) {
      const normalized = normalizeSlotValue(value);
      slots[key] = () => normalized;
    }
  }
};
const normalizeVNodeSlots = (instance, children) => {
  const normalized = normalizeSlotValue(children);
  instance.slots.default = () => normalized;
};
const assignSlots = (slots, children, optimized) => {
  for (const key in children) {
    if (optimized || !isInternalKey(key)) {
      slots[key] = children[key];
    }
  }
};
const initSlots = (instance, children, optimized) => {
  const slots = instance.slots = createInternalObject();
  if (instance.vnode.shapeFlag & 32) {
    const type = children._;
    if (type) {
      assignSlots(slots, children, optimized);
      if (optimized) {
        def(slots, "_", type, true);
      }
    } else {
      normalizeObjectSlots(children, slots);
    }
  } else if (children) {
    normalizeVNodeSlots(instance, children);
  }
};
const updateSlots = (instance, children, optimized) => {
  const { vnode, slots } = instance;
  let needDeletionCheck = true;
  let deletionComparisonTarget = EMPTY_OBJ;
  if (vnode.shapeFlag & 32) {
    const type = children._;
    if (type) {
      if (optimized && type === 1) {
        needDeletionCheck = false;
      } else {
        assignSlots(slots, children, optimized);
      }
    } else {
      needDeletionCheck = !children.$stable;
      normalizeObjectSlots(children, slots);
    }
    deletionComparisonTarget = children;
  } else if (children) {
    normalizeVNodeSlots(instance, children);
    deletionComparisonTarget = { default: 1 };
  }
  if (needDeletionCheck) {
    for (const key in slots) {
      if (!isInternalKey(key) && deletionComparisonTarget[key] == null) {
        delete slots[key];
      }
    }
  }
};
const queuePostRenderEffect = queueEffectWithSuspense;
function createRenderer(options) {
  return baseCreateRenderer(options);
}
function baseCreateRenderer(options, createHydrationFns) {
  const target = getGlobalThis();
  target.__VUE__ = true;
  const {
    insert: hostInsert,
    remove: hostRemove,
    patchProp: hostPatchProp,
    createElement: hostCreateElement,
    createText: hostCreateText,
    createComment: hostCreateComment,
    setText: hostSetText,
    setElementText: hostSetElementText,
    parentNode: hostParentNode,
    nextSibling: hostNextSibling,
    setScopeId: hostSetScopeId = NOOP,
    insertStaticContent: hostInsertStaticContent
  } = options;
  const patch = (n1, n2, container, anchor = null, parentComponent = null, parentSuspense = null, namespace = void 0, slotScopeIds = null, optimized = !!n2.dynamicChildren) => {
    if (n1 === n2) {
      return;
    }
    if (n1 && !isSameVNodeType(n1, n2)) {
      anchor = getNextHostNode(n1);
      unmount(n1, parentComponent, parentSuspense, true);
      n1 = null;
    }
    if (n2.patchFlag === -2) {
      optimized = false;
      n2.dynamicChildren = null;
    }
    const { type, ref: ref3, shapeFlag } = n2;
    switch (type) {
      case Text:
        processText(n1, n2, container, anchor);
        break;
      case Comment:
        processCommentNode(n1, n2, container, anchor);
        break;
      case Static:
        if (n1 == null) {
          mountStaticNode(n2, container, anchor, namespace);
        }
        break;
      case Fragment:
        processFragment(
          n1,
          n2,
          container,
          anchor,
          parentComponent,
          parentSuspense,
          namespace,
          slotScopeIds,
          optimized
        );
        break;
      default:
        if (shapeFlag & 1) {
          processElement(
            n1,
            n2,
            container,
            anchor,
            parentComponent,
            parentSuspense,
            namespace,
            slotScopeIds,
            optimized
          );
        } else if (shapeFlag & 6) {
          processComponent(
            n1,
            n2,
            container,
            anchor,
            parentComponent,
            parentSuspense,
            namespace,
            slotScopeIds,
            optimized
          );
        } else if (shapeFlag & 64) {
          type.process(
            n1,
            n2,
            container,
            anchor,
            parentComponent,
            parentSuspense,
            namespace,
            slotScopeIds,
            optimized,
            internals
          );
        } else if (shapeFlag & 128) {
          type.process(
            n1,
            n2,
            container,
            anchor,
            parentComponent,
            parentSuspense,
            namespace,
            slotScopeIds,
            optimized,
            internals
          );
        } else ;
    }
    if (ref3 != null && parentComponent) {
      setRef(ref3, n1 && n1.ref, parentSuspense, n2 || n1, !n2);
    } else if (ref3 == null && n1 && n1.ref != null) {
      setRef(n1.ref, null, parentSuspense, n1, true);
    }
  };
  const processText = (n1, n2, container, anchor) => {
    if (n1 == null) {
      hostInsert(
        n2.el = hostCreateText(n2.children),
        container,
        anchor
      );
    } else {
      const el = n2.el = n1.el;
      if (n2.children !== n1.children) {
        hostSetText(el, n2.children);
      }
    }
  };
  const processCommentNode = (n1, n2, container, anchor) => {
    if (n1 == null) {
      hostInsert(
        n2.el = hostCreateComment(n2.children || ""),
        container,
        anchor
      );
    } else {
      n2.el = n1.el;
    }
  };
  const mountStaticNode = (n2, container, anchor, namespace) => {
    [n2.el, n2.anchor] = hostInsertStaticContent(
      n2.children,
      container,
      anchor,
      namespace,
      n2.el,
      n2.anchor
    );
  };
  const moveStaticNode = ({ el, anchor }, container, nextSibling) => {
    let next;
    while (el && el !== anchor) {
      next = hostNextSibling(el);
      hostInsert(el, container, nextSibling);
      el = next;
    }
    hostInsert(anchor, container, nextSibling);
  };
  const removeStaticNode = ({ el, anchor }) => {
    let next;
    while (el && el !== anchor) {
      next = hostNextSibling(el);
      hostRemove(el);
      el = next;
    }
    hostRemove(anchor);
  };
  const processElement = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
    if (n2.type === "svg") {
      namespace = "svg";
    } else if (n2.type === "math") {
      namespace = "mathml";
    }
    if (n1 == null) {
      mountElement(
        n2,
        container,
        anchor,
        parentComponent,
        parentSuspense,
        namespace,
        slotScopeIds,
        optimized
      );
    } else {
      const customElement = n1.el && n1.el._isVueCE ? n1.el : null;
      try {
        if (customElement) {
          customElement._beginPatch();
        }
        patchElement(
          n1,
          n2,
          parentComponent,
          parentSuspense,
          namespace,
          slotScopeIds,
          optimized
        );
      } finally {
        if (customElement) {
          customElement._endPatch();
        }
      }
    }
  };
  const mountElement = (vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
    let el;
    let vnodeHook;
    const { props, shapeFlag, transition, dirs } = vnode;
    el = vnode.el = hostCreateElement(
      vnode.type,
      namespace,
      props && props.is,
      props
    );
    if (shapeFlag & 8) {
      hostSetElementText(el, vnode.children);
    } else if (shapeFlag & 16) {
      mountChildren(
        vnode.children,
        el,
        null,
        parentComponent,
        parentSuspense,
        resolveChildrenNamespace(vnode, namespace),
        slotScopeIds,
        optimized
      );
    }
    if (dirs) {
      invokeDirectiveHook(vnode, null, parentComponent, "created");
    }
    setScopeId(el, vnode, vnode.scopeId, slotScopeIds, parentComponent);
    if (props) {
      for (const key in props) {
        if (key !== "value" && !isReservedProp(key)) {
          hostPatchProp(el, key, null, props[key], namespace, parentComponent);
        }
      }
      if ("value" in props) {
        hostPatchProp(el, "value", null, props.value, namespace);
      }
      if (vnodeHook = props.onVnodeBeforeMount) {
        invokeVNodeHook(vnodeHook, parentComponent, vnode);
      }
    }
    if (dirs) {
      invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
    }
    const needCallTransitionHooks = needTransition(parentSuspense, transition);
    if (needCallTransitionHooks) {
      transition.beforeEnter(el);
    }
    hostInsert(el, container, anchor);
    if ((vnodeHook = props && props.onVnodeMounted) || needCallTransitionHooks || dirs) {
      queuePostRenderEffect(() => {
        try {
          vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
          needCallTransitionHooks && transition.enter(el);
          dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
        } finally {
        }
      }, parentSuspense);
    }
  };
  const setScopeId = (el, vnode, scopeId, slotScopeIds, parentComponent) => {
    if (scopeId) {
      hostSetScopeId(el, scopeId);
    }
    if (slotScopeIds) {
      for (let i = 0; i < slotScopeIds.length; i++) {
        hostSetScopeId(el, slotScopeIds[i]);
      }
    }
    if (parentComponent) {
      let subTree = parentComponent.subTree;
      if (vnode === subTree || isSuspense(subTree.type) && (subTree.ssContent === vnode || subTree.ssFallback === vnode)) {
        const parentVNode = parentComponent.vnode;
        setScopeId(
          el,
          parentVNode,
          parentVNode.scopeId,
          parentVNode.slotScopeIds,
          parentComponent.parent
        );
      }
    }
  };
  const mountChildren = (children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, start = 0) => {
    for (let i = start; i < children.length; i++) {
      const child = children[i] = optimized ? cloneIfMounted(children[i]) : normalizeVNode(children[i]);
      patch(
        null,
        child,
        container,
        anchor,
        parentComponent,
        parentSuspense,
        namespace,
        slotScopeIds,
        optimized
      );
    }
  };
  const patchElement = (n1, n2, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
    const el = n2.el = n1.el;
    let { patchFlag, dynamicChildren, dirs } = n2;
    patchFlag |= n1.patchFlag & 16;
    const oldProps = n1.props || EMPTY_OBJ;
    const newProps = n2.props || EMPTY_OBJ;
    let vnodeHook;
    parentComponent && toggleRecurse(parentComponent, false);
    if (vnodeHook = newProps.onVnodeBeforeUpdate) {
      invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
    }
    if (dirs) {
      invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate");
    }
    parentComponent && toggleRecurse(parentComponent, true);
    if (
      // #6385 the old vnode may be a user-wrapped non-isomorphic block
      // Force full diff when block metadata is unstable.
      dynamicChildren && (!n1.dynamicChildren || n1.dynamicChildren.length !== dynamicChildren.length)
    ) {
      patchFlag = 0;
      optimized = false;
      dynamicChildren = null;
    }
    if (oldProps.innerHTML && newProps.innerHTML == null || oldProps.textContent && newProps.textContent == null) {
      hostSetElementText(el, "");
    }
    if (dynamicChildren) {
      patchBlockChildren(
        n1.dynamicChildren,
        dynamicChildren,
        el,
        parentComponent,
        parentSuspense,
        resolveChildrenNamespace(n2, namespace),
        slotScopeIds
      );
    } else if (!optimized) {
      patchChildren(
        n1,
        n2,
        el,
        null,
        parentComponent,
        parentSuspense,
        resolveChildrenNamespace(n2, namespace),
        slotScopeIds,
        false
      );
    }
    if (patchFlag > 0) {
      if (patchFlag & 16) {
        patchProps(el, oldProps, newProps, parentComponent, namespace);
      } else {
        if (patchFlag & 2) {
          if (oldProps.class !== newProps.class) {
            hostPatchProp(el, "class", null, newProps.class, namespace);
          }
        }
        if (patchFlag & 4) {
          hostPatchProp(el, "style", oldProps.style, newProps.style, namespace);
        }
        if (patchFlag & 8) {
          const propsToUpdate = n2.dynamicProps;
          for (let i = 0; i < propsToUpdate.length; i++) {
            const key = propsToUpdate[i];
            const prev = oldProps[key];
            const next = newProps[key];
            if (next !== prev || key === "value") {
              hostPatchProp(el, key, prev, next, namespace, parentComponent);
            }
          }
        }
      }
      if (patchFlag & 1) {
        if (n1.children !== n2.children) {
          hostSetElementText(el, n2.children);
        }
      }
    } else if (!optimized && dynamicChildren == null) {
      patchProps(el, oldProps, newProps, parentComponent, namespace);
    }
    if ((vnodeHook = newProps.onVnodeUpdated) || dirs) {
      queuePostRenderEffect(() => {
        vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
        dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated");
      }, parentSuspense);
    }
  };
  const patchBlockChildren = (oldChildren, newChildren, fallbackContainer, parentComponent, parentSuspense, namespace, slotScopeIds) => {
    for (let i = 0; i < newChildren.length; i++) {
      const oldVNode = oldChildren[i];
      const newVNode = newChildren[i];
      const container = (
        // oldVNode may be an errored async setup() component inside Suspense
        // which will not have a mounted element
        oldVNode.el && // - In the case of a Fragment, we need to provide the actual parent
        // of the Fragment itself so it can move its children.
        (oldVNode.type === Fragment || // - In the case of different nodes, there is going to be a replacement
        // which also requires the correct parent container
        !isSameVNodeType(oldVNode, newVNode) || // - In the case of a component, it could contain anything.
        oldVNode.shapeFlag & (6 | 64 | 128)) ? hostParentNode(oldVNode.el) : (
          // In other cases, the parent container is not actually used so we
          // just pass the block element here to avoid a DOM parentNode call.
          fallbackContainer
        )
      );
      patch(
        oldVNode,
        newVNode,
        container,
        null,
        parentComponent,
        parentSuspense,
        namespace,
        slotScopeIds,
        true
      );
    }
  };
  const patchProps = (el, oldProps, newProps, parentComponent, namespace) => {
    if (oldProps !== newProps) {
      if (oldProps !== EMPTY_OBJ) {
        for (const key in oldProps) {
          if (!isReservedProp(key) && !(key in newProps)) {
            hostPatchProp(
              el,
              key,
              oldProps[key],
              null,
              namespace,
              parentComponent
            );
          }
        }
      }
      for (const key in newProps) {
        if (isReservedProp(key)) continue;
        const next = newProps[key];
        const prev = oldProps[key];
        if (next !== prev && key !== "value") {
          hostPatchProp(el, key, prev, next, namespace, parentComponent);
        }
      }
      if ("value" in newProps) {
        hostPatchProp(el, "value", oldProps.value, newProps.value, namespace);
      }
    }
  };
  const processFragment = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
    const fragmentStartAnchor = n2.el = n1 ? n1.el : hostCreateText("");
    const fragmentEndAnchor = n2.anchor = n1 ? n1.anchor : hostCreateText("");
    let { patchFlag, dynamicChildren, slotScopeIds: fragmentSlotScopeIds } = n2;
    if (fragmentSlotScopeIds) {
      slotScopeIds = slotScopeIds ? slotScopeIds.concat(fragmentSlotScopeIds) : fragmentSlotScopeIds;
    }
    if (n1 == null) {
      hostInsert(fragmentStartAnchor, container, anchor);
      hostInsert(fragmentEndAnchor, container, anchor);
      mountChildren(
        // #10007
        // such fragment like `<></>` will be compiled into
        // a fragment which doesn't have a children.
        // In this case fallback to an empty array
        n2.children || [],
        container,
        fragmentEndAnchor,
        parentComponent,
        parentSuspense,
        namespace,
        slotScopeIds,
        optimized
      );
    } else {
      if (patchFlag > 0 && patchFlag & 64 && dynamicChildren && // #2715 the previous fragment could've been a BAILed one as a result
      // of renderSlot() with no valid children
      n1.dynamicChildren && n1.dynamicChildren.length === dynamicChildren.length) {
        patchBlockChildren(
          n1.dynamicChildren,
          dynamicChildren,
          container,
          parentComponent,
          parentSuspense,
          namespace,
          slotScopeIds
        );
        if (
          // #2080 if the stable fragment has a key, it's a <template v-for> that may
          //  get moved around. Make sure all root level vnodes inherit el.
          // #2134 or if it's a component root, it may also get moved around
          // as the component is being moved.
          n2.key != null || parentComponent && n2 === parentComponent.subTree
        ) {
          traverseStaticChildren(
            n1,
            n2,
            true
            /* shallow */
          );
        }
      } else {
        patchChildren(
          n1,
          n2,
          container,
          fragmentEndAnchor,
          parentComponent,
          parentSuspense,
          namespace,
          slotScopeIds,
          optimized
        );
      }
    }
  };
  const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
    n2.slotScopeIds = slotScopeIds;
    if (n1 == null) {
      if (n2.shapeFlag & 512) {
        parentComponent.ctx.activate(
          n2,
          container,
          anchor,
          namespace,
          optimized
        );
      } else {
        mountComponent(
          n2,
          container,
          anchor,
          parentComponent,
          parentSuspense,
          namespace,
          optimized
        );
      }
    } else {
      updateComponent(n1, n2, optimized);
    }
  };
  const mountComponent = (initialVNode, container, anchor, parentComponent, parentSuspense, namespace, optimized) => {
    const instance = initialVNode.component = createComponentInstance(
      initialVNode,
      parentComponent,
      parentSuspense
    );
    if (isKeepAlive(initialVNode)) {
      instance.ctx.renderer = internals;
    }
    {
      setupComponent(instance, false, optimized);
    }
    if (instance.asyncDep) {
      parentSuspense && parentSuspense.registerDep(instance, setupRenderEffect, optimized);
      if (!initialVNode.el) {
        const placeholder = instance.subTree = createVNode(Comment);
        processCommentNode(null, placeholder, container, anchor);
        initialVNode.placeholder = placeholder.el;
      }
    } else {
      setupRenderEffect(
        instance,
        initialVNode,
        container,
        anchor,
        parentSuspense,
        namespace,
        optimized
      );
    }
  };
  const updateComponent = (n1, n2, optimized) => {
    const instance = n2.component = n1.component;
    if (shouldUpdateComponent(n1, n2, optimized)) {
      if (instance.asyncDep && !instance.asyncResolved) {
        updateComponentPreRender(instance, n2, optimized);
        return;
      } else {
        instance.next = n2;
        instance.update();
      }
    } else {
      n2.el = n1.el;
      instance.vnode = n2;
    }
  };
  const setupRenderEffect = (instance, initialVNode, container, anchor, parentSuspense, namespace, optimized) => {
    const componentUpdateFn = () => {
      if (!instance.isMounted) {
        let vnodeHook;
        const { el, props } = initialVNode;
        const { bm, m, parent, root, type } = instance;
        const isAsyncWrapperVNode = isAsyncWrapper(initialVNode);
        toggleRecurse(instance, false);
        if (bm) {
          invokeArrayFns(bm);
        }
        if (!isAsyncWrapperVNode && (vnodeHook = props && props.onVnodeBeforeMount)) {
          invokeVNodeHook(vnodeHook, parent, initialVNode);
        }
        toggleRecurse(instance, true);
        {
          if (root.ce && root.ce._hasShadowRoot()) {
            root.ce._injectChildStyle(
              type,
              instance.parent ? instance.parent.type : void 0
            );
          }
          const subTree = instance.subTree = renderComponentRoot(instance);
          patch(
            null,
            subTree,
            container,
            anchor,
            instance,
            parentSuspense,
            namespace
          );
          initialVNode.el = subTree.el;
        }
        if (m) {
          queuePostRenderEffect(m, parentSuspense);
        }
        if (!isAsyncWrapperVNode && (vnodeHook = props && props.onVnodeMounted)) {
          const scopedInitialVNode = initialVNode;
          queuePostRenderEffect(
            () => invokeVNodeHook(vnodeHook, parent, scopedInitialVNode),
            parentSuspense
          );
        }
        if (initialVNode.shapeFlag & 256 || parent && isAsyncWrapper(parent.vnode) && parent.vnode.shapeFlag & 256) {
          instance.a && queuePostRenderEffect(instance.a, parentSuspense);
        }
        instance.isMounted = true;
        initialVNode = container = anchor = null;
      } else {
        let { next, bu, u, parent, vnode } = instance;
        {
          const nonHydratedAsyncRoot = locateNonHydratedAsyncRoot(instance);
          if (nonHydratedAsyncRoot) {
            if (next) {
              next.el = vnode.el;
              updateComponentPreRender(instance, next, optimized);
            }
            nonHydratedAsyncRoot.asyncDep.then(() => {
              queuePostRenderEffect(() => {
                if (!instance.isUnmounted) update();
              }, parentSuspense);
            });
            return;
          }
        }
        let originNext = next;
        let vnodeHook;
        toggleRecurse(instance, false);
        if (next) {
          next.el = vnode.el;
          updateComponentPreRender(instance, next, optimized);
        } else {
          next = vnode;
        }
        if (bu) {
          invokeArrayFns(bu);
        }
        if (vnodeHook = next.props && next.props.onVnodeBeforeUpdate) {
          invokeVNodeHook(vnodeHook, parent, next, vnode);
        }
        toggleRecurse(instance, true);
        const nextTree = renderComponentRoot(instance);
        const prevTree = instance.subTree;
        instance.subTree = nextTree;
        patch(
          prevTree,
          nextTree,
          // parent may have changed if it's in a teleport
          hostParentNode(prevTree.el),
          // anchor may have changed if it's in a fragment
          getNextHostNode(prevTree),
          instance,
          parentSuspense,
          namespace
        );
        next.el = nextTree.el;
        if (originNext === null) {
          updateHOCHostEl(instance, nextTree.el);
        }
        if (u) {
          queuePostRenderEffect(u, parentSuspense);
        }
        if (vnodeHook = next.props && next.props.onVnodeUpdated) {
          queuePostRenderEffect(
            () => invokeVNodeHook(vnodeHook, parent, next, vnode),
            parentSuspense
          );
        }
      }
    };
    instance.scope.on();
    const effect2 = instance.effect = new ReactiveEffect(componentUpdateFn);
    instance.scope.off();
    const update = instance.update = effect2.run.bind(effect2);
    const job = instance.job = effect2.runIfDirty.bind(effect2);
    job.i = instance;
    job.id = instance.uid;
    effect2.scheduler = () => queueJob(job);
    toggleRecurse(instance, true);
    update();
  };
  const updateComponentPreRender = (instance, nextVNode, optimized) => {
    nextVNode.component = instance;
    const prevProps = instance.vnode.props;
    instance.vnode = nextVNode;
    instance.next = null;
    updateProps(instance, nextVNode.props, prevProps, optimized);
    updateSlots(instance, nextVNode.children, optimized);
    pauseTracking();
    flushPreFlushCbs(instance);
    resetTracking();
  };
  const patchChildren = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized = false) => {
    const c1 = n1 && n1.children;
    const prevShapeFlag = n1 ? n1.shapeFlag : 0;
    const c2 = n2.children;
    const { patchFlag, shapeFlag } = n2;
    if (patchFlag > 0) {
      if (patchFlag & 128) {
        patchKeyedChildren(
          c1,
          c2,
          container,
          anchor,
          parentComponent,
          parentSuspense,
          namespace,
          slotScopeIds,
          optimized
        );
        return;
      } else if (patchFlag & 256) {
        patchUnkeyedChildren(
          c1,
          c2,
          container,
          anchor,
          parentComponent,
          parentSuspense,
          namespace,
          slotScopeIds,
          optimized
        );
        return;
      }
    }
    if (shapeFlag & 8) {
      if (prevShapeFlag & 16) {
        unmountChildren(c1, parentComponent, parentSuspense);
      }
      if (c2 !== c1) {
        hostSetElementText(container, c2);
      }
    } else {
      if (prevShapeFlag & 16) {
        if (shapeFlag & 16) {
          patchKeyedChildren(
            c1,
            c2,
            container,
            anchor,
            parentComponent,
            parentSuspense,
            namespace,
            slotScopeIds,
            optimized
          );
        } else {
          unmountChildren(c1, parentComponent, parentSuspense, true);
        }
      } else {
        if (prevShapeFlag & 8) {
          hostSetElementText(container, "");
        }
        if (shapeFlag & 16) {
          mountChildren(
            c2,
            container,
            anchor,
            parentComponent,
            parentSuspense,
            namespace,
            slotScopeIds,
            optimized
          );
        }
      }
    }
  };
  const patchUnkeyedChildren = (c1, c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
    c1 = c1 || EMPTY_ARR;
    c2 = c2 || EMPTY_ARR;
    const oldLength = c1.length;
    const newLength = c2.length;
    const commonLength = Math.min(oldLength, newLength);
    let i;
    for (i = 0; i < commonLength; i++) {
      const nextChild = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]);
      patch(
        c1[i],
        nextChild,
        container,
        null,
        parentComponent,
        parentSuspense,
        namespace,
        slotScopeIds,
        optimized
      );
    }
    if (oldLength > newLength) {
      unmountChildren(
        c1,
        parentComponent,
        parentSuspense,
        true,
        false,
        commonLength
      );
    } else {
      mountChildren(
        c2,
        container,
        anchor,
        parentComponent,
        parentSuspense,
        namespace,
        slotScopeIds,
        optimized,
        commonLength
      );
    }
  };
  const patchKeyedChildren = (c1, c2, container, parentAnchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
    let i = 0;
    const l2 = c2.length;
    let e1 = c1.length - 1;
    let e2 = l2 - 1;
    while (i <= e1 && i <= e2) {
      const n1 = c1[i];
      const n2 = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]);
      if (isSameVNodeType(n1, n2)) {
        patch(
          n1,
          n2,
          container,
          null,
          parentComponent,
          parentSuspense,
          namespace,
          slotScopeIds,
          optimized
        );
      } else {
        break;
      }
      i++;
    }
    while (i <= e1 && i <= e2) {
      const n1 = c1[e1];
      const n2 = c2[e2] = optimized ? cloneIfMounted(c2[e2]) : normalizeVNode(c2[e2]);
      if (isSameVNodeType(n1, n2)) {
        patch(
          n1,
          n2,
          container,
          null,
          parentComponent,
          parentSuspense,
          namespace,
          slotScopeIds,
          optimized
        );
      } else {
        break;
      }
      e1--;
      e2--;
    }
    if (i > e1) {
      if (i <= e2) {
        const nextPos = e2 + 1;
        const anchor = nextPos < l2 ? c2[nextPos].el : parentAnchor;
        while (i <= e2) {
          patch(
            null,
            c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]),
            container,
            anchor,
            parentComponent,
            parentSuspense,
            namespace,
            slotScopeIds,
            optimized
          );
          i++;
        }
      }
    } else if (i > e2) {
      while (i <= e1) {
        unmount(c1[i], parentComponent, parentSuspense, true);
        i++;
      }
    } else {
      const s1 = i;
      const s2 = i;
      const keyToNewIndexMap = /* @__PURE__ */ new Map();
      for (i = s2; i <= e2; i++) {
        const nextChild = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]);
        if (nextChild.key != null) {
          keyToNewIndexMap.set(nextChild.key, i);
        }
      }
      let j;
      let patched = 0;
      const toBePatched = e2 - s2 + 1;
      let moved = false;
      let maxNewIndexSoFar = 0;
      const newIndexToOldIndexMap = new Array(toBePatched);
      for (i = 0; i < toBePatched; i++) newIndexToOldIndexMap[i] = 0;
      for (i = s1; i <= e1; i++) {
        const prevChild = c1[i];
        if (patched >= toBePatched) {
          unmount(prevChild, parentComponent, parentSuspense, true);
          continue;
        }
        let newIndex;
        if (prevChild.key != null) {
          newIndex = keyToNewIndexMap.get(prevChild.key);
        } else {
          for (j = s2; j <= e2; j++) {
            if (newIndexToOldIndexMap[j - s2] === 0 && isSameVNodeType(prevChild, c2[j])) {
              newIndex = j;
              break;
            }
          }
        }
        if (newIndex === void 0) {
          unmount(prevChild, parentComponent, parentSuspense, true);
        } else {
          newIndexToOldIndexMap[newIndex - s2] = i + 1;
          if (newIndex >= maxNewIndexSoFar) {
            maxNewIndexSoFar = newIndex;
          } else {
            moved = true;
          }
          patch(
            prevChild,
            c2[newIndex],
            container,
            null,
            parentComponent,
            parentSuspense,
            namespace,
            slotScopeIds,
            optimized
          );
          patched++;
        }
      }
      const increasingNewIndexSequence = moved ? getSequence(newIndexToOldIndexMap) : EMPTY_ARR;
      j = increasingNewIndexSequence.length - 1;
      for (i = toBePatched - 1; i >= 0; i--) {
        const nextIndex = s2 + i;
        const nextChild = c2[nextIndex];
        const anchorVNode = c2[nextIndex + 1];
        const anchor = nextIndex + 1 < l2 ? (
          // #13559, #14173 fallback to el placeholder for unresolved async component
          anchorVNode.el || resolveAsyncComponentPlaceholder(anchorVNode)
        ) : parentAnchor;
        if (newIndexToOldIndexMap[i] === 0) {
          patch(
            null,
            nextChild,
            container,
            anchor,
            parentComponent,
            parentSuspense,
            namespace,
            slotScopeIds,
            optimized
          );
        } else if (moved) {
          if (j < 0 || i !== increasingNewIndexSequence[j]) {
            move(nextChild, container, anchor, 2);
          } else {
            j--;
          }
        }
      }
    }
  };
  const move = (vnode, container, anchor, moveType, parentSuspense = null) => {
    const { el, type, transition, children, shapeFlag } = vnode;
    if (shapeFlag & 6) {
      move(vnode.component.subTree, container, anchor, moveType);
      return;
    }
    if (shapeFlag & 128) {
      vnode.suspense.move(container, anchor, moveType);
      return;
    }
    if (shapeFlag & 64) {
      type.move(vnode, container, anchor, internals);
      return;
    }
    if (type === Fragment) {
      hostInsert(el, container, anchor);
      for (let i = 0; i < children.length; i++) {
        move(children[i], container, anchor, moveType);
      }
      hostInsert(vnode.anchor, container, anchor);
      return;
    }
    if (type === Static) {
      moveStaticNode(vnode, container, anchor);
      return;
    }
    const needTransition2 = moveType !== 2 && shapeFlag & 1 && transition;
    if (needTransition2) {
      if (moveType === 0) {
        if (transition.persisted && !el[leaveCbKey]) {
          hostInsert(el, container, anchor);
        } else {
          transition.beforeEnter(el);
          hostInsert(el, container, anchor);
          queuePostRenderEffect(() => transition.enter(el), parentSuspense);
        }
      } else {
        const { leave, delayLeave, afterLeave } = transition;
        const remove22 = () => {
          if (vnode.ctx.isUnmounted) {
            hostRemove(el);
          } else {
            hostInsert(el, container, anchor);
          }
        };
        const performLeave = () => {
          const wasLeaving = el._isLeaving || !!el[leaveCbKey];
          if (el._isLeaving) {
            el[leaveCbKey](
              true
              /* cancelled */
            );
          }
          if (transition.persisted && !wasLeaving) {
            remove22();
          } else {
            leave(el, () => {
              remove22();
              afterLeave && afterLeave();
            });
          }
        };
        if (delayLeave) {
          delayLeave(el, remove22, performLeave);
        } else {
          performLeave();
        }
      }
    } else {
      hostInsert(el, container, anchor);
    }
  };
  const unmount = (vnode, parentComponent, parentSuspense, doRemove = false, optimized = false) => {
    const {
      type,
      props,
      ref: ref3,
      children,
      dynamicChildren,
      shapeFlag,
      patchFlag,
      dirs,
      cacheIndex,
      memo
    } = vnode;
    if (patchFlag === -2) {
      optimized = false;
    }
    if (ref3 != null) {
      pauseTracking();
      setRef(ref3, null, parentSuspense, vnode, true);
      resetTracking();
    }
    if (cacheIndex != null) {
      parentComponent.renderCache[cacheIndex] = void 0;
    }
    if (shapeFlag & 256) {
      parentComponent.ctx.deactivate(vnode);
      return;
    }
    const shouldInvokeDirs = shapeFlag & 1 && dirs;
    const shouldInvokeVnodeHook = !isAsyncWrapper(vnode);
    let vnodeHook;
    if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeBeforeUnmount)) {
      invokeVNodeHook(vnodeHook, parentComponent, vnode);
    }
    if (shapeFlag & 6) {
      unmountComponent(vnode.component, parentSuspense, doRemove);
    } else {
      if (shapeFlag & 128) {
        vnode.suspense.unmount(parentSuspense, doRemove);
        return;
      }
      if (shouldInvokeDirs) {
        invokeDirectiveHook(vnode, null, parentComponent, "beforeUnmount");
      }
      if (shapeFlag & 64) {
        vnode.type.remove(
          vnode,
          parentComponent,
          parentSuspense,
          internals,
          doRemove
        );
      } else if (dynamicChildren && // #5154
      // when v-once is used inside a block, setBlockTracking(-1) marks the
      // parent block with hasOnce: true
      // so that it doesn't take the fast path during unmount - otherwise
      // components nested in v-once are never unmounted.
      !dynamicChildren.hasOnce && // #1153: fast path should not be taken for non-stable (v-for) fragments
      (type !== Fragment || patchFlag > 0 && patchFlag & 64)) {
        unmountChildren(
          dynamicChildren,
          parentComponent,
          parentSuspense,
          false,
          true
        );
      } else if (type === Fragment && patchFlag & (128 | 256) || !optimized && shapeFlag & 16) {
        unmountChildren(children, parentComponent, parentSuspense);
      }
      if (doRemove) {
        remove2(vnode);
      }
    }
    const shouldInvalidateMemo = memo != null && cacheIndex == null;
    if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || shouldInvokeDirs || shouldInvalidateMemo) {
      queuePostRenderEffect(() => {
        vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
        shouldInvokeDirs && invokeDirectiveHook(vnode, null, parentComponent, "unmounted");
        if (shouldInvalidateMemo) {
          vnode.el = null;
        }
      }, parentSuspense);
    }
  };
  const remove2 = (vnode) => {
    const { type, el, anchor, transition } = vnode;
    if (type === Fragment) {
      {
        removeFragment(el, anchor);
      }
      return;
    }
    if (type === Static) {
      removeStaticNode(vnode);
      return;
    }
    const performRemove = () => {
      hostRemove(el);
      if (transition && !transition.persisted && transition.afterLeave) {
        transition.afterLeave();
      }
    };
    if (vnode.shapeFlag & 1 && transition && !transition.persisted) {
      const { leave, delayLeave } = transition;
      const performLeave = () => leave(el, performRemove);
      if (delayLeave) {
        delayLeave(vnode.el, performRemove, performLeave);
      } else {
        performLeave();
      }
    } else {
      performRemove();
    }
  };
  const removeFragment = (cur, end) => {
    let next;
    while (cur !== end) {
      next = hostNextSibling(cur);
      hostRemove(cur);
      cur = next;
    }
    hostRemove(end);
  };
  const unmountComponent = (instance, parentSuspense, doRemove) => {
    const { bum, scope, job, subTree, um, m, a } = instance;
    invalidateMount(m);
    invalidateMount(a);
    if (bum) {
      invokeArrayFns(bum);
    }
    scope.stop();
    if (job) {
      job.flags |= 8;
      unmount(subTree, instance, parentSuspense, doRemove);
    }
    if (um) {
      queuePostRenderEffect(um, parentSuspense);
    }
    queuePostRenderEffect(() => {
      instance.isUnmounted = true;
    }, parentSuspense);
  };
  const unmountChildren = (children, parentComponent, parentSuspense, doRemove = false, optimized = false, start = 0) => {
    for (let i = start; i < children.length; i++) {
      unmount(children[i], parentComponent, parentSuspense, doRemove, optimized);
    }
  };
  const getNextHostNode = (vnode) => {
    if (vnode.shapeFlag & 6) {
      return getNextHostNode(vnode.component.subTree);
    }
    if (vnode.shapeFlag & 128) {
      return vnode.suspense.next();
    }
    const el = hostNextSibling(vnode.anchor || vnode.el);
    const teleportEnd = el && el[TeleportEndKey];
    return teleportEnd ? hostNextSibling(teleportEnd) : el;
  };
  let isFlushing = false;
  const render = (vnode, container, namespace) => {
    let instance;
    if (vnode == null) {
      if (container._vnode) {
        unmount(container._vnode, null, null, true);
        instance = container._vnode.component;
      }
    } else {
      patch(
        container._vnode || null,
        vnode,
        container,
        null,
        null,
        null,
        namespace
      );
    }
    container._vnode = vnode;
    if (!isFlushing) {
      isFlushing = true;
      flushPreFlushCbs(instance);
      flushPostFlushCbs();
      isFlushing = false;
    }
  };
  const internals = {
    p: patch,
    um: unmount,
    m: move,
    r: remove2,
    mt: mountComponent,
    mc: mountChildren,
    pc: patchChildren,
    pbc: patchBlockChildren,
    n: getNextHostNode,
    o: options
  };
  let hydrate;
  return {
    render,
    hydrate,
    createApp: createAppAPI(render)
  };
}
function resolveChildrenNamespace({ type, props }, currentNamespace) {
  return currentNamespace === "svg" && type === "foreignObject" || currentNamespace === "mathml" && type === "annotation-xml" && props && props.encoding && props.encoding.includes("html") ? void 0 : currentNamespace;
}
function toggleRecurse({ effect: effect2, job }, allowed) {
  if (allowed) {
    effect2.flags |= 32;
    job.flags |= 4;
  } else {
    effect2.flags &= -33;
    job.flags &= -5;
  }
}
function needTransition(parentSuspense, transition) {
  return (!parentSuspense || parentSuspense && !parentSuspense.pendingBranch) && transition && !transition.persisted;
}
function traverseStaticChildren(n1, n2, shallow = false) {
  const ch1 = n1.children;
  const ch2 = n2.children;
  if (isArray(ch1) && isArray(ch2)) {
    for (let i = 0; i < ch1.length; i++) {
      const c1 = ch1[i];
      let c2 = ch2[i];
      if (c2.shapeFlag & 1 && !c2.dynamicChildren) {
        if (c2.patchFlag <= 0 || c2.patchFlag === 32) {
          c2 = ch2[i] = cloneIfMounted(ch2[i]);
          c2.el = c1.el;
        }
        if (!shallow && c2.patchFlag !== -2)
          traverseStaticChildren(c1, c2);
      }
      if (c2.type === Text) {
        if (c2.patchFlag === -1) {
          c2 = ch2[i] = cloneIfMounted(c2);
        }
        c2.el = c1.el;
      }
      if (c2.type === Comment && !c2.el) {
        c2.el = c1.el;
      }
    }
  }
}
function getSequence(arr) {
  const p2 = arr.slice();
  const result = [0];
  let i, j, u, v, c;
  const len = arr.length;
  for (i = 0; i < len; i++) {
    const arrI = arr[i];
    if (arrI !== 0) {
      j = result[result.length - 1];
      if (arr[j] < arrI) {
        p2[i] = j;
        result.push(i);
        continue;
      }
      u = 0;
      v = result.length - 1;
      while (u < v) {
        c = u + v >> 1;
        if (arr[result[c]] < arrI) {
          u = c + 1;
        } else {
          v = c;
        }
      }
      if (arrI < arr[result[u]]) {
        if (u > 0) {
          p2[i] = result[u - 1];
        }
        result[u] = i;
      }
    }
  }
  u = result.length;
  v = result[u - 1];
  while (u-- > 0) {
    result[u] = v;
    v = p2[v];
  }
  return result;
}
function locateNonHydratedAsyncRoot(instance) {
  const subComponent = instance.subTree.component;
  if (subComponent) {
    if (subComponent.asyncDep && !subComponent.asyncResolved) {
      return subComponent;
    } else {
      return locateNonHydratedAsyncRoot(subComponent);
    }
  }
}
function invalidateMount(hooks) {
  if (hooks) {
    for (let i = 0; i < hooks.length; i++)
      hooks[i].flags |= 8;
  }
}
function resolveAsyncComponentPlaceholder(anchorVnode) {
  if (anchorVnode.placeholder) {
    return anchorVnode.placeholder;
  }
  const instance = anchorVnode.component;
  if (instance) {
    return resolveAsyncComponentPlaceholder(instance.subTree);
  }
  return null;
}
const isSuspense = (type) => type.__isSuspense;
function queueEffectWithSuspense(fn, suspense) {
  if (suspense && suspense.pendingBranch) {
    if (isArray(fn)) {
      suspense.effects.push(...fn);
    } else {
      suspense.effects.push(fn);
    }
  } else {
    queuePostFlushCb(fn);
  }
}
const Fragment = /* @__PURE__ */ Symbol.for("v-fgt");
const Text = /* @__PURE__ */ Symbol.for("v-txt");
const Comment = /* @__PURE__ */ Symbol.for("v-cmt");
const Static = /* @__PURE__ */ Symbol.for("v-stc");
const blockStack = [];
let currentBlock = null;
function openBlock(disableTracking = false) {
  blockStack.push(currentBlock = disableTracking ? null : []);
}
function closeBlock() {
  blockStack.pop();
  currentBlock = blockStack[blockStack.length - 1] || null;
}
let isBlockTreeEnabled = 1;
function setBlockTracking(value, inVOnce = false) {
  isBlockTreeEnabled += value;
  if (value < 0 && currentBlock && inVOnce) {
    currentBlock.hasOnce = true;
  }
}
function setupBlock(vnode) {
  vnode.dynamicChildren = isBlockTreeEnabled > 0 ? currentBlock || EMPTY_ARR : null;
  closeBlock();
  if (isBlockTreeEnabled > 0 && currentBlock) {
    currentBlock.push(vnode);
  }
  return vnode;
}
function createElementBlock(type, props, children, patchFlag, dynamicProps, shapeFlag) {
  return setupBlock(
    createBaseVNode(
      type,
      props,
      children,
      patchFlag,
      dynamicProps,
      shapeFlag,
      true
    )
  );
}
function createBlock(type, props, children, patchFlag, dynamicProps) {
  return setupBlock(
    createVNode(
      type,
      props,
      children,
      patchFlag,
      dynamicProps,
      true
    )
  );
}
function isVNode(value) {
  return value ? value.__v_isVNode === true : false;
}
function isSameVNodeType(n1, n2) {
  return n1.type === n2.type && n1.key === n2.key;
}
const normalizeKey = ({ key }) => key != null ? key : null;
const normalizeRef = ({
  ref: ref3,
  ref_key,
  ref_for
}) => {
  if (typeof ref3 === "number") {
    ref3 = "" + ref3;
  }
  return ref3 != null ? isString(ref3) || /* @__PURE__ */ isRef(ref3) || isFunction(ref3) ? { i: currentRenderingInstance, r: ref3, k: ref_key, f: !!ref_for } : ref3 : null;
};
function createBaseVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, shapeFlag = type === Fragment ? 0 : 1, isBlockNode = false, needFullChildrenNormalization = false) {
  const vnode = {
    __v_isVNode: true,
    __v_skip: true,
    type,
    props,
    key: props && normalizeKey(props),
    ref: props && normalizeRef(props),
    scopeId: currentScopeId,
    slotScopeIds: null,
    children,
    component: null,
    suspense: null,
    ssContent: null,
    ssFallback: null,
    dirs: null,
    transition: null,
    el: null,
    anchor: null,
    target: null,
    targetStart: null,
    targetAnchor: null,
    staticCount: 0,
    shapeFlag,
    patchFlag,
    dynamicProps,
    dynamicChildren: null,
    appContext: null,
    ctx: currentRenderingInstance
  };
  if (needFullChildrenNormalization) {
    normalizeChildren(vnode, children);
    if (shapeFlag & 128) {
      type.normalize(vnode);
    }
  } else if (children) {
    vnode.shapeFlag |= isString(children) ? 8 : 16;
  }
  if (isBlockTreeEnabled > 0 && // avoid a block node from tracking itself
  !isBlockNode && // has current parent block
  currentBlock && // presence of a patch flag indicates this node needs patching on updates.
  // component nodes also should always be patched, because even if the
  // component doesn't need to update, it needs to persist the instance on to
  // the next vnode so that it can be properly unmounted later.
  (vnode.patchFlag > 0 || shapeFlag & 6) && // the EVENTS flag is only for hydration and if it is the only flag, the
  // vnode should not be considered dynamic due to handler caching.
  vnode.patchFlag !== 32) {
    currentBlock.push(vnode);
  }
  return vnode;
}
const createVNode = _createVNode;
function _createVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, isBlockNode = false) {
  if (!type || type === NULL_DYNAMIC_COMPONENT) {
    type = Comment;
  }
  if (isVNode(type)) {
    const cloned = cloneVNode(
      type,
      props,
      true
      /* mergeRef: true */
    );
    if (children) {
      normalizeChildren(cloned, children);
    }
    if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock) {
      if (cloned.shapeFlag & 6) {
        currentBlock[currentBlock.indexOf(type)] = cloned;
      } else {
        currentBlock.push(cloned);
      }
    }
    cloned.patchFlag = -2;
    return cloned;
  }
  if (isClassComponent(type)) {
    type = type.__vccOpts;
  }
  if (props) {
    props = guardReactiveProps(props);
    let { class: klass, style } = props;
    if (klass && !isString(klass)) {
      props.class = normalizeClass(klass);
    }
    if (isObject(style)) {
      if (/* @__PURE__ */ isProxy(style) && !isArray(style)) {
        style = extend({}, style);
      }
      props.style = normalizeStyle(style);
    }
  }
  const shapeFlag = isString(type) ? 1 : isSuspense(type) ? 128 : isTeleport(type) ? 64 : isObject(type) ? 4 : isFunction(type) ? 2 : 0;
  return createBaseVNode(
    type,
    props,
    children,
    patchFlag,
    dynamicProps,
    shapeFlag,
    isBlockNode,
    true
  );
}
function guardReactiveProps(props) {
  if (!props) return null;
  return /* @__PURE__ */ isProxy(props) || isInternalObject(props) ? extend({}, props) : props;
}
function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false) {
  const { props, ref: ref3, patchFlag, children, transition } = vnode;
  const mergedProps = extraProps ? mergeProps(props || {}, extraProps) : props;
  const cloned = {
    __v_isVNode: true,
    __v_skip: true,
    type: vnode.type,
    props: mergedProps,
    key: mergedProps && normalizeKey(mergedProps),
    ref: extraProps && extraProps.ref ? (
      // #2078 in the case of <component :is="vnode" ref="extra"/>
      // if the vnode itself already has a ref, cloneVNode will need to merge
      // the refs so the single vnode can be set on multiple refs
      mergeRef && ref3 ? isArray(ref3) ? ref3.concat(normalizeRef(extraProps)) : [ref3, normalizeRef(extraProps)] : normalizeRef(extraProps)
    ) : ref3,
    scopeId: vnode.scopeId,
    slotScopeIds: vnode.slotScopeIds,
    children,
    target: vnode.target,
    targetStart: vnode.targetStart,
    targetAnchor: vnode.targetAnchor,
    staticCount: vnode.staticCount,
    shapeFlag: vnode.shapeFlag,
    // if the vnode is cloned with extra props, we can no longer assume its
    // existing patch flag to be reliable and need to add the FULL_PROPS flag.
    // note: preserve flag for fragments since they use the flag for children
    // fast paths only.
    patchFlag: extraProps && vnode.type !== Fragment ? patchFlag === -1 ? 16 : patchFlag | 16 : patchFlag,
    dynamicProps: vnode.dynamicProps,
    dynamicChildren: vnode.dynamicChildren,
    appContext: vnode.appContext,
    dirs: vnode.dirs,
    transition,
    // These should technically only be non-null on mounted VNodes. However,
    // they *should* be copied for kept-alive vnodes. So we just always copy
    // them since them being non-null during a mount doesn't affect the logic as
    // they will simply be overwritten.
    component: vnode.component,
    suspense: vnode.suspense,
    ssContent: vnode.ssContent && cloneVNode(vnode.ssContent),
    ssFallback: vnode.ssFallback && cloneVNode(vnode.ssFallback),
    placeholder: vnode.placeholder,
    el: vnode.el,
    anchor: vnode.anchor,
    ctx: vnode.ctx,
    ce: vnode.ce
  };
  if (transition && cloneTransition) {
    setTransitionHooks(
      cloned,
      transition.clone(cloned)
    );
  }
  return cloned;
}
function createTextVNode(text = " ", flag = 0) {
  return createVNode(Text, null, text, flag);
}
function createCommentVNode(text = "", asBlock = false) {
  return asBlock ? (openBlock(), createBlock(Comment, null, text)) : createVNode(Comment, null, text);
}
function normalizeVNode(child) {
  if (child == null || typeof child === "boolean") {
    return createVNode(Comment);
  } else if (isArray(child)) {
    return createVNode(
      Fragment,
      null,
      // #3666, avoid reference pollution when reusing vnode
      child.slice()
    );
  } else if (isVNode(child)) {
    return cloneIfMounted(child);
  } else {
    return createVNode(Text, null, String(child));
  }
}
function cloneIfMounted(child) {
  return child.el === null && child.patchFlag !== -1 || child.memo ? child : cloneVNode(child);
}
function normalizeChildren(vnode, children) {
  let type = 0;
  const { shapeFlag } = vnode;
  if (children == null) {
    children = null;
  } else if (isArray(children)) {
    type = 16;
  } else if (typeof children === "object") {
    if (shapeFlag & (1 | 64)) {
      const slot = children.default;
      if (slot) {
        slot._c && (slot._d = false);
        normalizeChildren(vnode, slot());
        slot._c && (slot._d = true);
      }
      return;
    } else {
      type = 32;
      const slotFlag = children._;
      if (!slotFlag && !isInternalObject(children)) {
        children._ctx = currentRenderingInstance;
      } else if (slotFlag === 3 && currentRenderingInstance) {
        if (currentRenderingInstance.slots._ === 1) {
          children._ = 1;
        } else {
          children._ = 2;
          vnode.patchFlag |= 1024;
        }
      }
    }
  } else if (isFunction(children)) {
    if (shapeFlag & (1 | 64)) {
      normalizeChildren(vnode, { default: children });
      return;
    }
    children = { default: children, _ctx: currentRenderingInstance };
    type = 32;
  } else {
    children = String(children);
    if (shapeFlag & 64) {
      type = 16;
      children = [createTextVNode(children)];
    } else {
      type = 8;
    }
  }
  vnode.children = children;
  vnode.shapeFlag |= type;
}
function mergeProps(...args) {
  const ret = {};
  for (let i = 0; i < args.length; i++) {
    const toMerge = args[i];
    for (const key in toMerge) {
      if (key === "class") {
        if (ret.class !== toMerge.class) {
          ret.class = normalizeClass([ret.class, toMerge.class]);
        }
      } else if (key === "style") {
        ret.style = normalizeStyle([ret.style, toMerge.style]);
      } else if (isOn(key)) {
        const existing = ret[key];
        const incoming = toMerge[key];
        if (incoming && existing !== incoming && !(isArray(existing) && existing.includes(incoming))) {
          ret[key] = existing ? [].concat(existing, incoming) : incoming;
        } else if (incoming == null && existing == null && // mergeProps({ 'onUpdate:modelValue': undefined }) should not retain
        // the model listener.
        !isModelListener(key)) {
          ret[key] = incoming;
        }
      } else if (key !== "") {
        ret[key] = toMerge[key];
      }
    }
  }
  return ret;
}
function invokeVNodeHook(hook, instance, vnode, prevVNode = null) {
  callWithAsyncErrorHandling(hook, instance, 7, [
    vnode,
    prevVNode
  ]);
}
const emptyAppContext = createAppContext();
let uid = 0;
function createComponentInstance(vnode, parent, suspense) {
  const type = vnode.type;
  const appContext = (parent ? parent.appContext : vnode.appContext) || emptyAppContext;
  const instance = {
    uid: uid++,
    vnode,
    type,
    parent,
    appContext,
    root: null,
    // to be immediately set
    next: null,
    subTree: null,
    // will be set synchronously right after creation
    effect: null,
    update: null,
    // will be set synchronously right after creation
    job: null,
    scope: new EffectScope(
      true
      /* detached */
    ),
    render: null,
    proxy: null,
    exposed: null,
    exposeProxy: null,
    withProxy: null,
    provides: parent ? parent.provides : Object.create(appContext.provides),
    ids: parent ? parent.ids : ["", 0, 0],
    accessCache: null,
    renderCache: [],
    // local resolved assets
    components: null,
    directives: null,
    // resolved props and emits options
    propsOptions: normalizePropsOptions(type, appContext),
    emitsOptions: normalizeEmitsOptions(type, appContext),
    // emit
    emit: null,
    // to be set immediately
    emitted: null,
    // props default value
    propsDefaults: EMPTY_OBJ,
    // inheritAttrs
    inheritAttrs: type.inheritAttrs,
    // state
    ctx: EMPTY_OBJ,
    data: EMPTY_OBJ,
    props: EMPTY_OBJ,
    attrs: EMPTY_OBJ,
    slots: EMPTY_OBJ,
    refs: EMPTY_OBJ,
    setupState: EMPTY_OBJ,
    setupContext: null,
    // suspense related
    suspense,
    suspenseId: suspense ? suspense.pendingId : 0,
    asyncDep: null,
    asyncResolved: false,
    // lifecycle hooks
    // not using enums here because it results in computed properties
    isMounted: false,
    isUnmounted: false,
    isDeactivated: false,
    bc: null,
    c: null,
    bm: null,
    m: null,
    bu: null,
    u: null,
    um: null,
    bum: null,
    da: null,
    a: null,
    rtg: null,
    rtc: null,
    ec: null,
    sp: null
  };
  {
    instance.ctx = { _: instance };
  }
  instance.root = parent ? parent.root : instance;
  instance.emit = emit.bind(null, instance);
  if (vnode.ce) {
    vnode.ce(instance);
  }
  return instance;
}
let currentInstance = null;
const getCurrentInstance = () => currentInstance || currentRenderingInstance;
let internalSetCurrentInstance;
let setInSSRSetupState;
{
  const g = getGlobalThis();
  const registerGlobalSetter = (key, setter) => {
    let setters;
    if (!(setters = g[key])) setters = g[key] = [];
    setters.push(setter);
    return (v) => {
      if (setters.length > 1) setters.forEach((set) => set(v));
      else setters[0](v);
    };
  };
  internalSetCurrentInstance = registerGlobalSetter(
    `__VUE_INSTANCE_SETTERS__`,
    (v) => currentInstance = v
  );
  setInSSRSetupState = registerGlobalSetter(
    `__VUE_SSR_SETTERS__`,
    (v) => isInSSRComponentSetup = v
  );
}
const setCurrentInstance = (instance) => {
  const prev = currentInstance;
  internalSetCurrentInstance(instance);
  instance.scope.on();
  return () => {
    instance.scope.off();
    internalSetCurrentInstance(prev);
  };
};
const unsetCurrentInstance = () => {
  currentInstance && currentInstance.scope.off();
  internalSetCurrentInstance(null);
};
function isStatefulComponent(instance) {
  return instance.vnode.shapeFlag & 4;
}
let isInSSRComponentSetup = false;
function setupComponent(instance, isSSR = false, optimized = false) {
  isSSR && setInSSRSetupState(isSSR);
  const { props, children } = instance.vnode;
  const isStateful = isStatefulComponent(instance);
  initProps(instance, props, isStateful, isSSR);
  initSlots(instance, children, optimized || isSSR);
  const setupResult = isStateful ? setupStatefulComponent(instance, isSSR) : void 0;
  isSSR && setInSSRSetupState(false);
  return setupResult;
}
function setupStatefulComponent(instance, isSSR) {
  const Component = instance.type;
  instance.accessCache = /* @__PURE__ */ Object.create(null);
  instance.proxy = new Proxy(instance.ctx, PublicInstanceProxyHandlers);
  const { setup } = Component;
  if (setup) {
    pauseTracking();
    const setupContext = instance.setupContext = setup.length > 1 ? createSetupContext(instance) : null;
    const reset = setCurrentInstance(instance);
    const setupResult = callWithErrorHandling(
      setup,
      instance,
      0,
      [
        instance.props,
        setupContext
      ]
    );
    const isAsyncSetup = isPromise(setupResult);
    resetTracking();
    reset();
    if ((isAsyncSetup || instance.sp) && !isAsyncWrapper(instance)) {
      markAsyncBoundary(instance);
    }
    if (isAsyncSetup) {
      setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
      if (isSSR) {
        return setupResult.then((resolvedResult) => {
          handleSetupResult(instance, resolvedResult);
        }).catch((e) => {
          handleError(e, instance, 0);
        });
      } else {
        instance.asyncDep = setupResult;
      }
    } else {
      handleSetupResult(instance, setupResult);
    }
  } else {
    finishComponentSetup(instance);
  }
}
function handleSetupResult(instance, setupResult, isSSR) {
  if (isFunction(setupResult)) {
    if (instance.type.__ssrInlineRender) {
      instance.ssrRender = setupResult;
    } else {
      instance.render = setupResult;
    }
  } else if (isObject(setupResult)) {
    instance.setupState = proxyRefs(setupResult);
  } else ;
  finishComponentSetup(instance);
}
function finishComponentSetup(instance, isSSR, skipOptions) {
  const Component = instance.type;
  if (!instance.render) {
    instance.render = Component.render || NOOP;
  }
  {
    const reset = setCurrentInstance(instance);
    pauseTracking();
    try {
      applyOptions(instance);
    } finally {
      resetTracking();
      reset();
    }
  }
}
const attrsProxyHandlers = {
  get(target, key) {
    track(target, "get", "");
    return target[key];
  }
};
function createSetupContext(instance) {
  const expose = (exposed) => {
    instance.exposed = exposed || {};
  };
  {
    return {
      attrs: new Proxy(instance.attrs, attrsProxyHandlers),
      slots: instance.slots,
      emit: instance.emit,
      expose
    };
  }
}
function getComponentPublicInstance(instance) {
  if (instance.exposed) {
    return instance.exposeProxy || (instance.exposeProxy = new Proxy(proxyRefs(markRaw(instance.exposed)), {
      get(target, key) {
        if (key in target) {
          return target[key];
        } else if (key in publicPropertiesMap) {
          return publicPropertiesMap[key](instance);
        }
      },
      has(target, key) {
        return key in target || key in publicPropertiesMap;
      }
    }));
  } else {
    return instance.proxy;
  }
}
const classifyRE = /(?:^|[-_])\w/g;
const classify = (str) => str.replace(classifyRE, (c) => c.toUpperCase()).replace(/[-_]/g, "");
function getComponentName(Component, includeInferred = true) {
  return isFunction(Component) ? Component.displayName || Component.name : Component.name || includeInferred && Component.__name;
}
function formatComponentName(instance, Component, isRoot = false) {
  let name = getComponentName(Component);
  if (!name && Component.__file) {
    const match = Component.__file.match(/([^/\\]+)\.\w+$/);
    if (match) {
      name = match[1];
    }
  }
  if (!name && instance) {
    const inferFromRegistry = (registry) => {
      for (const key in registry) {
        if (registry[key] === Component) {
          return key;
        }
      }
    };
    name = inferFromRegistry(instance.components) || instance.parent && inferFromRegistry(
      instance.parent.type.components
    ) || inferFromRegistry(instance.appContext.components);
  }
  return name ? classify(name) : isRoot ? `App` : `Anonymous`;
}
function isClassComponent(value) {
  return isFunction(value) && "__vccOpts" in value;
}
const computed = (getterOrOptions, debugOptions) => {
  const c = /* @__PURE__ */ computed$1(getterOrOptions, debugOptions, isInSSRComponentSetup);
  return c;
};
const version = "3.5.39";
let policy = void 0;
const tt = typeof window !== "undefined" && window.trustedTypes;
if (tt) {
  try {
    policy = /* @__PURE__ */ tt.createPolicy("vue", {
      createHTML: (val) => val
    });
  } catch (e) {
  }
}
const unsafeToTrustedHTML = policy ? (val) => policy.createHTML(val) : (val) => val;
const svgNS = "http://www.w3.org/2000/svg";
const mathmlNS = "http://www.w3.org/1998/Math/MathML";
const doc = typeof document !== "undefined" ? document : null;
const templateContainer = doc && /* @__PURE__ */ doc.createElement("template");
const nodeOps = {
  insert: (child, parent, anchor) => {
    parent.insertBefore(child, anchor || null);
  },
  remove: (child) => {
    const parent = child.parentNode;
    if (parent) {
      parent.removeChild(child);
    }
  },
  createElement: (tag, namespace, is, props) => {
    const el = namespace === "svg" ? doc.createElementNS(svgNS, tag) : namespace === "mathml" ? doc.createElementNS(mathmlNS, tag) : is ? doc.createElement(tag, { is }) : doc.createElement(tag);
    if (tag === "select" && props && props.multiple != null) {
      el.setAttribute("multiple", props.multiple);
    }
    return el;
  },
  createText: (text) => doc.createTextNode(text),
  createComment: (text) => doc.createComment(text),
  setText: (node, text) => {
    node.nodeValue = text;
  },
  setElementText: (el, text) => {
    el.textContent = text;
  },
  parentNode: (node) => node.parentNode,
  nextSibling: (node) => node.nextSibling,
  querySelector: (selector) => doc.querySelector(selector),
  setScopeId(el, id) {
    el.setAttribute(id, "");
  },
  // __UNSAFE__
  // Reason: innerHTML.
  // Static content here can only come from compiled templates.
  // As long as the user only uses trusted templates, this is safe.
  insertStaticContent(content, parent, anchor, namespace, start, end) {
    const before = anchor ? anchor.previousSibling : parent.lastChild;
    if (start && (start === end || start.nextSibling)) {
      while (true) {
        parent.insertBefore(start.cloneNode(true), anchor);
        if (start === end || !(start = start.nextSibling)) break;
      }
    } else {
      templateContainer.innerHTML = unsafeToTrustedHTML(
        namespace === "svg" ? `<svg>${content}</svg>` : namespace === "mathml" ? `<math>${content}</math>` : content
      );
      const template = templateContainer.content;
      if (namespace === "svg" || namespace === "mathml") {
        const wrapper = template.firstChild;
        while (wrapper.firstChild) {
          template.appendChild(wrapper.firstChild);
        }
        template.removeChild(wrapper);
      }
      parent.insertBefore(template, anchor);
    }
    return [
      // first
      before ? before.nextSibling : parent.firstChild,
      // last
      anchor ? anchor.previousSibling : parent.lastChild
    ];
  }
};
const vtcKey = /* @__PURE__ */ Symbol("_vtc");
function patchClass(el, value, isSVG) {
  const transitionClasses = el[vtcKey];
  if (transitionClasses) {
    value = (value ? [value, ...transitionClasses] : [...transitionClasses]).join(" ");
  }
  if (value == null) {
    el.removeAttribute("class");
  } else if (isSVG) {
    el.setAttribute("class", value);
  } else {
    el.className = value;
  }
}
const vShowOriginalDisplay = /* @__PURE__ */ Symbol("_vod");
const vShowHidden = /* @__PURE__ */ Symbol("_vsh");
const CSS_VAR_TEXT = /* @__PURE__ */ Symbol("");
const displayRE = /(?:^|;)\s*display\s*:/;
function patchStyle(el, prev, next) {
  const style = el.style;
  const isCssString = isString(next);
  let hasControlledDisplay = false;
  if (next && !isCssString) {
    if (prev) {
      if (!isString(prev)) {
        for (const key in prev) {
          if (next[key] == null) {
            setStyle(style, key, "");
          }
        }
      } else {
        for (const prevStyle of prev.split(";")) {
          const key = prevStyle.slice(0, prevStyle.indexOf(":")).trim();
          if (next[key] == null) {
            setStyle(style, key, "");
          }
        }
      }
    }
    for (const key in next) {
      if (key === "display") {
        hasControlledDisplay = true;
      }
      const value = next[key];
      if (value != null) {
        if (!shouldPreserveTextareaResizeStyle(
          el,
          key,
          !isString(prev) && prev ? prev[key] : void 0,
          value
        )) {
          setStyle(style, key, value);
        }
      } else {
        setStyle(style, key, "");
      }
    }
  } else {
    if (isCssString) {
      if (prev !== next) {
        const cssVarText = style[CSS_VAR_TEXT];
        if (cssVarText) {
          next += ";" + cssVarText;
        }
        style.cssText = next;
        hasControlledDisplay = displayRE.test(next);
      }
    } else if (prev) {
      el.removeAttribute("style");
    }
  }
  if (vShowOriginalDisplay in el) {
    el[vShowOriginalDisplay] = hasControlledDisplay ? style.display : "";
    if (el[vShowHidden]) {
      style.display = "none";
    }
  }
}
const importantRE = /\s*!important$/;
function setStyle(style, name, val) {
  if (isArray(val)) {
    val.forEach((v) => setStyle(style, name, v));
  } else {
    if (val == null) val = "";
    if (name.startsWith("--")) {
      style.setProperty(name, val);
    } else {
      const prefixed = autoPrefix(style, name);
      if (importantRE.test(val)) {
        style.setProperty(
          hyphenate(prefixed),
          val.replace(importantRE, ""),
          "important"
        );
      } else {
        style[prefixed] = val;
      }
    }
  }
}
const prefixes = ["Webkit", "Moz", "ms"];
const prefixCache = {};
function autoPrefix(style, rawName) {
  const cached = prefixCache[rawName];
  if (cached) {
    return cached;
  }
  let name = camelize(rawName);
  if (name !== "filter" && name in style) {
    return prefixCache[rawName] = name;
  }
  name = capitalize(name);
  for (let i = 0; i < prefixes.length; i++) {
    const prefixed = prefixes[i] + name;
    if (prefixed in style) {
      return prefixCache[rawName] = prefixed;
    }
  }
  return rawName;
}
function shouldPreserveTextareaResizeStyle(el, key, prev, next) {
  return el.tagName === "TEXTAREA" && (key === "width" || key === "height") && isString(next) && prev === next;
}
const xlinkNS = "http://www.w3.org/1999/xlink";
function patchAttr(el, key, value, isSVG, instance, isBoolean = isSpecialBooleanAttr(key)) {
  if (isSVG && key.startsWith("xlink:")) {
    if (value == null) {
      el.removeAttributeNS(xlinkNS, key.slice(6, key.length));
    } else {
      el.setAttributeNS(xlinkNS, key, value);
    }
  } else {
    if (value == null || isBoolean && !includeBooleanAttr(value)) {
      el.removeAttribute(key);
    } else {
      el.setAttribute(
        key,
        isBoolean ? "" : isSymbol(value) ? String(value) : value
      );
    }
  }
}
function patchDOMProp(el, key, value, parentComponent, attrName) {
  if (key === "innerHTML" || key === "textContent") {
    if (value != null) {
      el[key] = key === "innerHTML" ? unsafeToTrustedHTML(value) : value;
    }
    return;
  }
  const tag = el.tagName;
  if (key === "value" && tag !== "PROGRESS" && // custom elements may use _value internally
  !tag.includes("-")) {
    const oldValue = tag === "OPTION" ? el.getAttribute("value") || "" : el.value;
    const newValue = value == null ? (
      // #11647: value should be set as empty string for null and undefined,
      // but <input type="checkbox"> should be set as 'on'.
      el.type === "checkbox" ? "on" : ""
    ) : String(value);
    if (oldValue !== newValue || !("_value" in el)) {
      el.value = newValue;
    }
    if (value == null) {
      el.removeAttribute(key);
    }
    el._value = value;
    return;
  }
  let needRemove = false;
  if (value === "" || value == null) {
    const type = typeof el[key];
    if (type === "boolean") {
      value = includeBooleanAttr(value);
    } else if (value == null && type === "string") {
      value = "";
      needRemove = true;
    } else if (type === "number") {
      value = 0;
      needRemove = true;
    }
  }
  try {
    el[key] = value;
  } catch (e) {
  }
  needRemove && el.removeAttribute(attrName || key);
}
function addEventListener(el, event, handler, options) {
  el.addEventListener(event, handler, options);
}
function removeEventListener(el, event, handler, options) {
  el.removeEventListener(event, handler, options);
}
const veiKey = /* @__PURE__ */ Symbol("_vei");
function patchEvent(el, rawName, prevValue, nextValue, instance = null) {
  const invokers = el[veiKey] || (el[veiKey] = {});
  const existingInvoker = invokers[rawName];
  if (nextValue && existingInvoker) {
    existingInvoker.value = nextValue;
  } else {
    const [name, options] = parseName(rawName);
    if (nextValue) {
      const invoker = invokers[rawName] = createInvoker(
        nextValue,
        instance
      );
      addEventListener(el, name, invoker, options);
    } else if (existingInvoker) {
      removeEventListener(el, name, existingInvoker, options);
      invokers[rawName] = void 0;
    }
  }
}
const optionsModifierRE = /(Once|Passive|Capture)$/;
const optionsModifierEventRE = /^on:?(?:Once|Passive|Capture)$/;
function parseName(name) {
  let options;
  let m;
  while ((m = name.match(optionsModifierRE)) && !optionsModifierEventRE.test(name)) {
    if (!options) options = {};
    name = name.slice(0, name.length - m[1].length);
    options[m[1].toLowerCase()] = true;
  }
  const event = name[2] === ":" ? name.slice(3) : hyphenate(name.slice(2));
  return [event, options];
}
let cachedNow = 0;
const p = /* @__PURE__ */ Promise.resolve();
const getNow = () => cachedNow || (p.then(() => cachedNow = 0), cachedNow = Date.now());
function createInvoker(initialValue, instance) {
  const invoker = (e) => {
    if (!e._vts) {
      e._vts = Date.now();
    } else if (e._vts <= invoker.attached) {
      return;
    }
    const value = invoker.value;
    if (isArray(value)) {
      const originalStop = e.stopImmediatePropagation;
      e.stopImmediatePropagation = () => {
        originalStop.call(e);
        e._stopped = true;
      };
      const handlers = value.slice();
      const args = [e];
      for (let i = 0; i < handlers.length; i++) {
        if (e._stopped) {
          break;
        }
        const handler = handlers[i];
        if (handler) {
          callWithAsyncErrorHandling(
            handler,
            instance,
            5,
            args
          );
        }
      }
    } else {
      callWithAsyncErrorHandling(
        value,
        instance,
        5,
        [e]
      );
    }
  };
  invoker.value = initialValue;
  invoker.attached = getNow();
  return invoker;
}
const isNativeOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // lowercase letter
key.charCodeAt(2) > 96 && key.charCodeAt(2) < 123;
const patchProp = (el, key, prevValue, nextValue, namespace, parentComponent) => {
  const isSVG = namespace === "svg";
  if (key === "class") {
    patchClass(el, nextValue, isSVG);
  } else if (key === "style") {
    patchStyle(el, prevValue, nextValue);
  } else if (isOn(key)) {
    if (!isModelListener(key)) {
      patchEvent(el, key, prevValue, nextValue, parentComponent);
    }
  } else if (key[0] === "." ? (key = key.slice(1), true) : key[0] === "^" ? (key = key.slice(1), false) : shouldSetAsProp(el, key, nextValue, isSVG)) {
    patchDOMProp(el, key, nextValue);
    if (!el.tagName.includes("-") && (key === "value" || key === "checked" || key === "selected")) {
      patchAttr(el, key, nextValue, isSVG, parentComponent, key !== "value");
    }
  } else if (
    // #11081 force set props for possible async custom element
    el._isVueCE && // #12408 check if it's declared prop or it's async custom element
    (shouldSetAsPropForVueCE(el, key) || // @ts-expect-error _def is private
    el._def.__asyncLoader && (/[A-Z]/.test(key) || !isString(nextValue)))
  ) {
    patchDOMProp(el, camelize(key), nextValue, parentComponent, key);
  } else {
    if (key === "true-value") {
      el._trueValue = nextValue;
    } else if (key === "false-value") {
      el._falseValue = nextValue;
    }
    patchAttr(el, key, nextValue, isSVG);
  }
};
function shouldSetAsProp(el, key, value, isSVG) {
  if (isSVG) {
    if (key === "innerHTML" || key === "textContent") {
      return true;
    }
    if (key in el && isNativeOn(key) && isFunction(value)) {
      return true;
    }
    return false;
  }
  if (key === "spellcheck" || key === "draggable" || key === "translate" || key === "autocorrect") {
    return false;
  }
  if (key === "sandbox" && el.tagName === "IFRAME") {
    return false;
  }
  if (key === "form") {
    return false;
  }
  if (key === "list" && el.tagName === "INPUT") {
    return false;
  }
  if (key === "type" && el.tagName === "TEXTAREA") {
    return false;
  }
  if (key === "width" || key === "height") {
    const tag = el.tagName;
    if (tag === "IMG" || tag === "VIDEO" || tag === "CANVAS" || tag === "SOURCE") {
      return false;
    }
  }
  if (isNativeOn(key) && isString(value)) {
    return false;
  }
  return key in el;
}
function shouldSetAsPropForVueCE(el, key) {
  const props = (
    // @ts-expect-error _def is private
    el._def.props
  );
  if (!props) {
    return false;
  }
  const camelKey = camelize(key);
  return Array.isArray(props) ? props.some((prop) => camelize(prop) === camelKey) : Object.keys(props).some((prop) => camelize(prop) === camelKey);
}
const getModelAssigner = (vnode) => {
  const fn = vnode.props["onUpdate:modelValue"] || false;
  return isArray(fn) ? (value) => invokeArrayFns(fn, value) : fn;
};
function onCompositionStart(e) {
  e.target.composing = true;
}
function onCompositionEnd(e) {
  const target = e.target;
  if (target.composing) {
    target.composing = false;
    target.dispatchEvent(new Event("input"));
  }
}
const assignKey = /* @__PURE__ */ Symbol("_assign");
function castValue(value, trim, number) {
  if (trim) value = value.trim();
  if (number) value = looseToNumber(value);
  return value;
}
const vModelText = {
  created(el, { modifiers: { lazy, trim, number } }, vnode) {
    el[assignKey] = getModelAssigner(vnode);
    const castToNumber = number || vnode.props && vnode.props.type === "number";
    addEventListener(el, lazy ? "change" : "input", (e) => {
      if (e.target.composing) return;
      el[assignKey](castValue(el.value, trim, castToNumber));
    });
    if (trim || castToNumber) {
      addEventListener(el, "change", () => {
        el.value = castValue(el.value, trim, castToNumber);
      });
    }
    if (!lazy) {
      addEventListener(el, "compositionstart", onCompositionStart);
      addEventListener(el, "compositionend", onCompositionEnd);
      addEventListener(el, "change", onCompositionEnd);
    }
  },
  // set value on mounted so it's after min/max for type="range"
  mounted(el, { value }) {
    el.value = value == null ? "" : value;
  },
  beforeUpdate(el, { value, oldValue, modifiers: { lazy, trim, number } }, vnode) {
    el[assignKey] = getModelAssigner(vnode);
    if (el.composing) return;
    const elValue = (number || el.type === "number") && !/^0\d/.test(el.value) ? looseToNumber(el.value) : el.value;
    const newValue = value == null ? "" : value;
    if (elValue === newValue) {
      return;
    }
    const rootNode = el.getRootNode();
    if ((rootNode instanceof Document || rootNode instanceof ShadowRoot) && rootNode.activeElement === el && el.type !== "range") {
      if (lazy && value === oldValue) {
        return;
      }
      if (trim && el.value.trim() === newValue) {
        return;
      }
    }
    el.value = newValue;
  }
};
const vModelCheckbox = {
  // #4096 array checkboxes need to be deep traversed
  deep: true,
  created(el, _, vnode) {
    el[assignKey] = getModelAssigner(vnode);
    addEventListener(el, "change", () => {
      const modelValue = el._modelValue;
      const elementValue = getValue(el);
      const checked = el.checked;
      const assign = el[assignKey];
      if (isArray(modelValue)) {
        const index = looseIndexOf(modelValue, elementValue);
        const found = index !== -1;
        if (checked && !found) {
          assign(modelValue.concat(elementValue));
        } else if (!checked && found) {
          const filtered = [...modelValue];
          filtered.splice(index, 1);
          assign(filtered);
        }
      } else if (isSet(modelValue)) {
        const cloned = new Set(modelValue);
        if (checked) {
          cloned.add(elementValue);
        } else {
          cloned.delete(elementValue);
        }
        assign(cloned);
      } else {
        assign(getCheckboxValue(el, checked));
      }
    });
  },
  // set initial checked on mount to wait for true-value/false-value
  mounted: setChecked,
  beforeUpdate(el, binding, vnode) {
    el[assignKey] = getModelAssigner(vnode);
    setChecked(el, binding, vnode);
  }
};
function setChecked(el, { value, oldValue }, vnode) {
  el._modelValue = value;
  let checked;
  if (isArray(value)) {
    checked = looseIndexOf(value, vnode.props.value) > -1;
  } else if (isSet(value)) {
    checked = value.has(vnode.props.value);
  } else {
    if (value === oldValue) return;
    checked = looseEqual(value, getCheckboxValue(el, true));
  }
  if (el.checked !== checked) {
    el.checked = checked;
  }
}
const vModelSelect = {
  // <select multiple> value need to be deep traversed
  deep: true,
  created(el, { value, modifiers: { number } }, vnode) {
    const isSetModel = isSet(value);
    addEventListener(el, "change", () => {
      const selectedVal = Array.prototype.filter.call(el.options, (o) => o.selected).map(
        (o) => number ? looseToNumber(getValue(o)) : getValue(o)
      );
      el[assignKey](
        el.multiple ? isSetModel ? new Set(selectedVal) : selectedVal : selectedVal[0]
      );
      el._assigning = true;
      nextTick(() => {
        el._assigning = false;
      });
    });
    el[assignKey] = getModelAssigner(vnode);
  },
  // set value in mounted & updated because <select> relies on its children
  // <option>s.
  mounted(el, { value }) {
    setSelected(el, value);
  },
  beforeUpdate(el, _binding, vnode) {
    el[assignKey] = getModelAssigner(vnode);
  },
  updated(el, { value }) {
    if (!el._assigning) {
      setSelected(el, value);
    }
  }
};
function setSelected(el, value) {
  const isMultiple = el.multiple;
  const isArrayValue = isArray(value);
  if (isMultiple && !isArrayValue && !isSet(value)) {
    return;
  }
  for (let i = 0, l = el.options.length; i < l; i++) {
    const option = el.options[i];
    const optionValue = getValue(option);
    if (isMultiple) {
      if (isArrayValue) {
        const optionType = typeof optionValue;
        if (optionType === "string" || optionType === "number") {
          option.selected = value.some((v) => String(v) === String(optionValue));
        } else {
          option.selected = looseIndexOf(value, optionValue) > -1;
        }
      } else {
        option.selected = value.has(optionValue);
      }
    } else if (looseEqual(getValue(option), value)) {
      if (el.selectedIndex !== i) el.selectedIndex = i;
      return;
    }
  }
  if (!isMultiple && el.selectedIndex !== -1) {
    el.selectedIndex = -1;
  }
}
function getValue(el) {
  return "_value" in el ? el._value : el.value;
}
function getCheckboxValue(el, checked) {
  const key = checked ? "_trueValue" : "_falseValue";
  return key in el ? el[key] : checked;
}
const rendererOptions = /* @__PURE__ */ extend({ patchProp }, nodeOps);
let renderer;
function ensureRenderer() {
  return renderer || (renderer = createRenderer(rendererOptions));
}
const createApp = ((...args) => {
  const app = ensureRenderer().createApp(...args);
  const { mount } = app;
  app.mount = (containerOrSelector) => {
    const container = normalizeContainer(containerOrSelector);
    if (!container) return;
    const component = app._component;
    if (!isFunction(component) && !component.render && !component.template) {
      component.template = container.innerHTML;
    }
    if (container.nodeType === 1) {
      container.textContent = "";
    }
    const proxy = mount(container, false, resolveRootNamespace(container));
    if (container instanceof Element) {
      container.removeAttribute("v-cloak");
      container.setAttribute("data-v-app", "");
    }
    return proxy;
  };
  return app;
});
function resolveRootNamespace(container) {
  if (container instanceof SVGElement) {
    return "svg";
  }
  if (typeof MathMLElement === "function" && container instanceof MathMLElement) {
    return "mathml";
  }
}
function normalizeContainer(container) {
  if (isString(container)) {
    const res = document.querySelector(container);
    return res;
  }
  return container;
}
const _hoisted_1 = {
  key: 0,
  class: "auth-layout"
};
const _hoisted_2 = { class: "card auth-card" };
const _hoisted_3 = { class: "field" };
const _hoisted_4 = ["disabled"];
const _hoisted_5 = {
  key: 0,
  class: "error"
};
const _hoisted_6 = { class: "hint" };
const _hoisted_7 = {
  key: 1,
  class: "auth-qr"
};
const _hoisted_8 = ["src"];
const _hoisted_9 = { class: "hero" };
const _hoisted_10 = { class: "hero-top" };
const _hoisted_11 = ["disabled"];
const _hoisted_12 = { class: "panel grid-two" };
const _hoisted_13 = { class: "card params-card" };
const _hoisted_14 = { class: "section-head" };
const _hoisted_15 = { class: "badge" };
const _hoisted_16 = { class: "field" };
const _hoisted_17 = {
  key: 0,
  class: "field"
};
const _hoisted_18 = {
  key: 1,
  class: "field"
};
const _hoisted_19 = { class: "field" };
const _hoisted_20 = { class: "field toggle-field" };
const _hoisted_21 = { class: "field" };
const _hoisted_22 = { class: "field" };
const _hoisted_23 = { class: "field-row" };
const _hoisted_24 = {
  key: 0,
  class: "field"
};
const _hoisted_25 = {
  key: 1,
  class: "field"
};
const _hoisted_26 = {
  key: 2,
  class: "field"
};
const _hoisted_27 = {
  key: 4,
  class: "field"
};
const _hoisted_28 = { class: "field" };
const _hoisted_29 = { class: "actions" };
const _hoisted_30 = ["disabled"];
const _hoisted_31 = ["disabled"];
const _hoisted_32 = ["disabled"];
const _hoisted_33 = ["disabled"];
const _hoisted_34 = {
  key: 5,
  class: "error"
};
const _hoisted_35 = { class: "hint" };
const _hoisted_36 = { class: "card log-card" };
const _hoisted_37 = { class: "section-head" };
const _hoisted_38 = { class: "badge soft" };
const _hoisted_39 = { class: "log-list" };
const _hoisted_40 = {
  key: 0,
  class: "empty"
};
const _hoisted_41 = { class: "panel card runtime-card" };
const _hoisted_42 = { class: "section-head" };
const _hoisted_43 = { class: "stats" };
const _hoisted_44 = {
  key: 0,
  class: "export-box"
};
const _hoisted_45 = { class: "license-banner" };
const _hoisted_46 = { class: "hero-copy compact" };
const _hoisted_47 = { class: "license-banner-side" };
const _hoisted_48 = { class: "mini-stat" };
const DEFAULT_BACKEND_BASE_URL = "http://test-datatoolbox-backend.randomness.website";
const _sfc_main = /* @__PURE__ */ defineComponent({
  __name: "App",
  setup(__props) {
    const STORAGE_KEYS = {
      licenseCode: "dtb_client_license_code",
      sessionToken: "dtb_client_session_token"
    };
    const BACKEND_BASE_URL = DEFAULT_BACKEND_BASE_URL;
    const form = /* @__PURE__ */ reactive({
      mode: "keyword",
      keyword: "",
      videoUrlsText: "",
      liveRoomUrl: "",
      creatorProfileUrl: "",
      creatorMonitorIntervalMinutes: 1,
      liveMonitorEnabled: false,
      liveMonitorIntervalSeconds: 5,
      liveMonitorMinutes: "",
      commentLimit: 10,
      maxVideos: 5,
      exportDir: ""
    });
    const licenseForm = /* @__PURE__ */ reactive({
      licenseCode: localStorage.getItem(STORAGE_KEYS.licenseCode) || ""
    });
    const state = /* @__PURE__ */ ref({
      status: "idle",
      message: "å‡†å¤‡å°±ç»ª",
      isBrowserReady: false,
      currentVideoIndex: 0,
      totalVideos: 0,
      collectedVideos: 0,
      logs: []
    });
    const entitlement = /* @__PURE__ */ ref(null);
    const deviceProfile = /* @__PURE__ */ ref(null);
    const clientSessionToken = /* @__PURE__ */ ref(localStorage.getItem(STORAGE_KEYS.sessionToken) || "");
    const authError = /* @__PURE__ */ ref("");
    const actionError = /* @__PURE__ */ ref("");
    const authLoading = /* @__PURE__ */ ref(false);
    const isSubmitting = /* @__PURE__ */ ref(false);
    const contactText = /* @__PURE__ */ ref("è�”ç³»å®¢æœ�èŽ·å�–æŽˆæ�ƒç � 18559023244");
    const qrCodeImageUrl = /* @__PURE__ */ ref("");
    const versionStatus = /* @__PURE__ */ ref({
      currentVersion: "0.0.0",
      hasUpdate: false,
      status: "idle",
      message: "å‡†å¤‡æ£€æŸ¥æ›´æ–°"
    });
    const isKeywordMode = computed(() => form.mode === "keyword");
    const isLiveMode = computed(() => form.mode === "live");
    const isCreatorMode = computed(() => form.mode === "creator");
    const currentInputLabel = computed(() => {
      if (state.value.currentMode === "creator") return "å½“å‰�ä¸»æ’­ä¸»é¡µ";
      if (state.value.currentMode === "live") return "å½“å‰�ç›´æ’­é—´";
      if (state.value.currentMode === "link") return "å½“å‰�é“¾æŽ¥ä»»åŠ¡";
      return "å½“å‰�å…³é”®è¯�";
    });
    const isEntitlementUsable = computed(() => {
      const status = entitlement.value?.subscription.status;
      return status === "active" || status === "trial";
    });
    const isLicensed = computed(() => Boolean(entitlement.value?.sessionToken) && isEntitlementUsable.value);
    const canStart = computed(() => {
      if (!isLicensed.value || isSubmitting.value) return false;
      if (isKeywordMode.value) return form.keyword.trim().length > 0;
      if (isLiveMode.value) return form.liveRoomUrl.trim().length > 0;
      if (isCreatorMode.value) return form.creatorProfileUrl.trim().length > 0;
      return form.videoUrlsText.trim().length > 0;
    });
    const exportDirToOpen = computed(
      () => state.value.exportSummary?.exportDir || form.exportDir.trim() || void 0
    );
    const subscriptionStatusText = computed(() => {
      const status = entitlement.value?.subscription.status;
      if (status === "active") return "æœ‰æ•ˆè®¢é˜…";
      if (status === "trial") return "è¯•ç”¨ä¸­";
      if (status === "paused") return "å·²æš‚å�œ";
      if (status === "expired") return "å·²è¿‡æœŸ";
      return "æœªæŽˆæ�ƒ";
    });
    const renewsAtText = computed(() => {
      if (!entitlement.value) return "æš‚æ— ";
      return new Date(entitlement.value.subscription.renewsAt).toLocaleString("zh-CN", { hour12: false });
    });
    const currentModeText = computed(() => {
      if (state.value.currentMode === "creator") return "ä¸»æ’­ä¸»é¡µç›‘æŽ§å¼€æ’­";
      if (state.value.currentMode === "live") return "ç›´æ’­é—´è¯„è®ºé‡‡é›†";
      if (state.value.currentMode === "link") return "ä½œå“�é“¾æŽ¥é‡‡é›†";
      return "å…³é”®è¯�æ�œç´¢ä½œå“�";
    });
    const stopButtonText = computed(() => state.value.status === "stopped" ? "ä»»åŠ¡å·²ç»ˆæ­¢" : "å�œæ­¢ä»»åŠ¡");
    const displayedLogs = computed(() => {
      return [...state.value.logs].sort((left, right) => {
        const leftTime = left.match(/\[(\d{2}:\d{2}:\d{2})\]/)?.[1] || "";
        const rightTime = right.match(/\[(\d{2}:\d{2}:\d{2})\]/)?.[1] || "";
        return rightTime.localeCompare(leftTime);
      });
    });
    let pollTimer;
    let entitlementTimer;
    let publicConfigTimer;
    async function refreshContactText() {
      await loadPublicConfig();
    }
    async function refreshVersionStatus() {
      versionStatus.value = await window.api.getVersionStatus();
    }
    async function requestBackend(path, options = {}) {
      const headers = new Headers(options.headers);
      headers.set("Content-Type", "application/json");
      if (clientSessionToken.value) {
        headers.set("Authorization", `Bearer ${clientSessionToken.value}`);
      }
      const response = await fetch(`${BACKEND_BASE_URL}${path}`, {
        ...options,
        headers
      });
      if (!response.ok) {
        const payload = await response.json().catch(() => null);
        throw new Error(payload?.message || `è¯·æ±‚å¤±è´¥ï¼š${response.status}`);
      }
      return await response.json();
    }
    async function loadPublicConfig() {
      try {
        const response = await requestBackend(
          `/client/public-config?ts=${Date.now()}`,
          {
            method: "GET",
            cache: "no-store"
          }
        );
        if (response.contactText?.trim()) {
          contactText.value = response.contactText.trim();
        }
        qrCodeImageUrl.value = response.qrCodeImageUrl?.trim() || "";
      } catch {
        if (!contactText.value.trim()) {
          contactText.value = "è�”ç³»å®¢æœ�èŽ·å�–æŽˆæ�ƒç � 18559023244";
        }
      }
    }
    async function refreshState() {
      if (!isLicensed.value) return;
      try {
        state.value = await window.api.getDouyinTaskState();
      } catch (error) {
        const message = error instanceof Error ? error.message : "çŠ¶æ€�æ‹‰å�–å¤±è´¥";
        actionError.value = message;
      }
    }
    async function lockClientAccess(reason) {
      if (state.value.status === "running") {
        try {
          await window.api.stopDouyinTask();
        } catch {
        }
      }
      entitlement.value = null;
      clientSessionToken.value = "";
      localStorage.removeItem(STORAGE_KEYS.sessionToken);
      authError.value = reason;
      actionError.value = "";
    }
    async function refreshEntitlement() {
      if (!clientSessionToken.value) return;
      try {
        const nextEntitlement = await requestBackend("/client/entitlement", {
          method: "GET"
        });
        if (nextEntitlement.subscription.status !== "active" && nextEntitlement.subscription.status !== "trial") {
          await lockClientAccess("è®¢é˜…å·²å¤±æ•ˆï¼Œå®¢æˆ·ç«¯å·²è‡ªåŠ¨é”�å®šï¼Œè¯·è�”ç³»ç®¡ç�†å‘˜ç»­è´¹æˆ–æ�¢å¤�");
          return;
        }
        entitlement.value = nextEntitlement;
      } catch (error) {
        const message = error instanceof Error ? error.message : "æŽˆæ�ƒæ ¡éªŒå¤±è´¥";
        await lockClientAccess(message);
      }
    }
    async function validateExistingSession() {
      if (!clientSessionToken.value) return;
      authLoading.value = true;
      authError.value = "";
      try {
        await refreshEntitlement();
      } catch (error) {
        authError.value = error instanceof Error ? error.message : "æŽˆæ�ƒæ ¡éªŒå¤±è´¥";
      } finally {
        authLoading.value = false;
      }
    }
    async function activateLicense() {
      if (!deviceProfile.value) return;
      authLoading.value = true;
      authError.value = "";
      try {
        const response = await requestBackend("/client/license/activate", {
          method: "POST",
          body: JSON.stringify({
            code: licenseForm.licenseCode,
            deviceId: deviceProfile.value.deviceId,
            deviceName: deviceProfile.value.deviceName
          })
        });
        entitlement.value = response;
        clientSessionToken.value = response.sessionToken;
        localStorage.setItem(STORAGE_KEYS.licenseCode, licenseForm.licenseCode.trim());
        localStorage.setItem(STORAGE_KEYS.sessionToken, response.sessionToken);
        await refreshState();
      } catch (error) {
        authError.value = error instanceof Error ? error.message : "æŽˆæ�ƒå¤±è´¥";
      } finally {
        authLoading.value = false;
      }
    }
    async function checkUpdates() {
      versionStatus.value = await window.api.checkUpdates();
    }
    async function handleVersionAction() {
      if (versionStatus.value.status === "downloaded") {
        await window.api.quitAndInstallUpdate();
        return;
      }
      if (versionStatus.value.status === "available") {
        versionStatus.value = await window.api.downloadUpdate();
        return;
      }
      await checkUpdates();
    }
    function logoutLicense() {
      entitlement.value = null;
      clientSessionToken.value = "";
      authError.value = "";
      actionError.value = "";
      localStorage.removeItem(STORAGE_KEYS.sessionToken);
      void refreshContactText();
    }
    async function withAction(action) {
      actionError.value = "";
      isSubmitting.value = true;
      try {
        await action();
      } catch (error) {
        actionError.value = error instanceof Error ? error.message : "æ“�ä½œå¤±è´¥";
      } finally {
        isSubmitting.value = false;
        await refreshState();
      }
    }
    async function prepareSession() {
      await withAction(async () => {
        state.value = await window.api.prepareDouyinSession();
      });
    }
    async function startTask() {
      await withAction(async () => {
        state.value = await window.api.startDouyinTask({
          mode: form.mode,
          keyword: form.keyword,
          videoUrlsText: form.videoUrlsText,
          liveRoomUrl: form.liveRoomUrl,
          creatorProfileUrl: form.creatorProfileUrl,
          creatorMonitorIntervalMinutes: form.creatorMonitorIntervalMinutes,
          liveMonitorEnabled: form.liveMonitorEnabled,
          liveMonitorIntervalSeconds: form.liveMonitorIntervalSeconds,
          liveMonitorMinutes: form.liveMonitorMinutes ? Number(form.liveMonitorMinutes) : void 0,
          commentLimit: form.commentLimit,
          maxVideos: form.maxVideos,
          exportDir: form.exportDir
        });
      });
    }
    async function stopTask() {
      await withAction(async () => {
        state.value = await window.api.stopDouyinTask();
      });
    }
    async function openExportDirectory() {
      await withAction(async () => {
        await window.api.openExportDirectory(exportDirToOpen.value);
      });
    }
    onMounted(async () => {
      deviceProfile.value = await window.api.getDeviceProfile();
      await refreshVersionStatus();
      await refreshContactText();
      await validateExistingSession();
      await refreshState();
      pollTimer = window.setInterval(() => {
        void refreshState();
      }, 1500);
      entitlementTimer = window.setInterval(() => {
        void refreshEntitlement();
      }, 3e4);
      publicConfigTimer = window.setInterval(() => {
        void refreshContactText();
      }, 15e3);
      window.addEventListener("focus", handleWindowFocus);
    });
    onBeforeUnmount(() => {
      if (pollTimer) {
        window.clearInterval(pollTimer);
      }
      if (entitlementTimer) {
        window.clearInterval(entitlementTimer);
      }
      if (publicConfigTimer) {
        window.clearInterval(publicConfigTimer);
      }
      window.removeEventListener("focus", handleWindowFocus);
    });
    function handleWindowFocus() {
      void refreshContactText();
    }
    watch(isLicensed, (licensed) => {
      if (!licensed) {
        void refreshContactText();
      }
    });
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("main", {
        class: normalizeClass(["shell", { "shell-auth": !isLicensed.value }])
      }, [
        !isLicensed.value ? (openBlock(), createElementBlock("section", _hoisted_1, [
          _cache[14] || (_cache[14] = createBaseVNode("div", { class: "hero hero-auth" }, [
            createBaseVNode("p", { class: "eyebrow" }, "DataToolBox"),
            createBaseVNode("h1", null, "å®‡å®™å·¥å…·åŒ…")
          ], -1)),
          createBaseVNode("section", _hoisted_2, [
            _cache[13] || (_cache[13] = createBaseVNode("div", { class: "section-head" }, [
              createBaseVNode("h2", null, "è¯·è¾“å…¥æŽˆæ�ƒç �")
            ], -1)),
            createBaseVNode("label", _hoisted_3, [
              withDirectives(createBaseVNode("input", {
                "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => licenseForm.licenseCode = $event),
                type: "text",
                placeholder: "ä¾‹å¦‚ï¼šDTB-GR-7Q2X-9LPA"
              }, null, 512), [
                [vModelText, licenseForm.licenseCode]
              ])
            ]),
            createBaseVNode("button", {
              class: "primary auth-button",
              disabled: authLoading.value,
              onClick: activateLicense
            }, toDisplayString(authLoading.value ? "æŽˆæ�ƒæ ¡éªŒä¸­..." : "ç™»å½•å¹¶æ¿€æ´»å½“å‰�è®¾å¤‡"), 9, _hoisted_4),
            authError.value ? (openBlock(), createElementBlock("p", _hoisted_5, toDisplayString(authError.value), 1)) : createCommentVNode("", true),
            createBaseVNode("p", _hoisted_6, toDisplayString(contactText.value), 1),
            qrCodeImageUrl.value ? (openBlock(), createElementBlock("div", _hoisted_7, [
              createBaseVNode("img", {
                src: qrCodeImageUrl.value,
                alt: "è�”ç³»å®¢æœ�äºŒç»´ç �"
              }, null, 8, _hoisted_8)
            ])) : createCommentVNode("", true)
          ])
        ])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
          createBaseVNode("section", _hoisted_9, [
            createBaseVNode("div", _hoisted_10, [
              _cache[15] || (_cache[15] = createBaseVNode("p", { class: "eyebrow" }, "Douyin Research Runner", -1)),
              createBaseVNode("button", {
                class: "ghost version-button",
                disabled: isSubmitting.value,
                onClick: handleVersionAction
              }, " ç‰ˆæœ¬ " + toDisplayString(versionStatus.value.currentVersion) + " Â· " + toDisplayString(versionStatus.value.message), 9, _hoisted_11)
            ]),
            _cache[16] || (_cache[16] = createBaseVNode("h1", null, "æŠ–éŸ³ä½œå“�é‡‡é›†æŽ§åˆ¶å�°", -1)),
            _cache[17] || (_cache[17] = createBaseVNode("p", { class: "hero-copy" }, " å·²é€šè¿‡è®¢é˜…æŽˆæ�ƒï¼Œå�¯ä»¥æŒ‰å…³é”®è¯�æ‰¹é‡�é‡‡é›†ä½œå“�ï¼Œæˆ–é€šè¿‡ä½œå“�é“¾æŽ¥å®šå�‘é‡‡é›†æŒ‡å®šä½œå“�å’Œè¯„è®ºï¼Œæœ€å�Žè‡ªåŠ¨å¯¼å‡º Markdown ä¸Ž JSONã€‚ ", -1))
          ]),
          createBaseVNode("section", _hoisted_12, [
            createBaseVNode("div", _hoisted_13, [
              createBaseVNode("div", _hoisted_14, [
                _cache[18] || (_cache[18] = createBaseVNode("h2", null, "ä»»åŠ¡å�‚æ•°", -1)),
                createBaseVNode("span", _hoisted_15, toDisplayString(state.value.status), 1)
              ]),
              createBaseVNode("label", _hoisted_16, [
                _cache[20] || (_cache[20] = createBaseVNode("span", null, "é‡‡é›†æ¨¡å¼�", -1)),
                withDirectives(createBaseVNode("select", {
                  "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => form.mode = $event)
                }, [..._cache[19] || (_cache[19] = [
                  createBaseVNode("option", { value: "keyword" }, "å…³é”®è¯�æ�œç´¢ä½œå“�", -1),
                  createBaseVNode("option", { value: "link" }, "ä½œå“�é“¾æŽ¥é‡‡é›†", -1),
                  createBaseVNode("option", { value: "live" }, "ç›´æ’­é—´è¯„è®ºé‡‡é›†", -1),
                  createBaseVNode("option", { value: "creator" }, "ä¸»æ’­ä¸»é¡µç›‘æŽ§å¼€æ’­", -1)
                ])], 512), [
                  [vModelSelect, form.mode]
                ])
              ]),
              isKeywordMode.value ? (openBlock(), createElementBlock("label", _hoisted_17, [
                _cache[21] || (_cache[21] = createBaseVNode("span", null, "å…³é”®è¯�", -1)),
                withDirectives(createBaseVNode("input", {
                  "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => form.keyword = $event),
                  type: "text",
                  placeholder: "ä¾‹å¦‚ï¼šç¾Žé£ŸæŽ¢åº—"
                }, null, 512), [
                  [vModelText, form.keyword]
                ])
              ])) : !isLiveMode.value && !isCreatorMode.value ? (openBlock(), createElementBlock("label", _hoisted_18, [
                _cache[22] || (_cache[22] = createBaseVNode("span", null, "ä½œå“�é“¾æŽ¥", -1)),
                withDirectives(createBaseVNode("textarea", {
                  "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => form.videoUrlsText = $event),
                  rows: "4",
                  placeholder: "ç²˜è´´ä¸€ä¸ªæˆ–å¤šä¸ªä½œå“�é“¾æŽ¥ï¼Œæ”¯æŒ�æ�¢è¡Œã€�ç©ºæ ¼æˆ–é€—å�·åˆ†éš”"
                }, null, 512), [
                  [vModelText, form.videoUrlsText]
                ])
              ])) : isLiveMode.value ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
                createBaseVNode("label", _hoisted_19, [
                  _cache[23] || (_cache[23] = createBaseVNode("span", null, "ç›´æ’­é—´é“¾æŽ¥", -1)),
                  withDirectives(createBaseVNode("input", {
                    "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => form.liveRoomUrl = $event),
                    type: "text",
                    placeholder: "ç²˜è´´æŠ–éŸ³ç›´æ’­é—´é“¾æŽ¥ï¼Œä¾‹å¦‚ï¼šhttps://live.douyin.com/..."
                  }, null, 512), [
                    [vModelText, form.liveRoomUrl]
                  ])
                ]),
                createBaseVNode("div", _hoisted_20, [
                  _cache[24] || (_cache[24] = createBaseVNode("div", null, "æŒ�ç»­ç›‘æŽ§ç›´æ’­é—´è¯„è®º", -1)),
                  withDirectives(createBaseVNode("input", {
                    class: "toggle-check",
                    "onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => form.liveMonitorEnabled = $event),
                    type: "checkbox"
                  }, null, 512), [
                    [vModelCheckbox, form.liveMonitorEnabled]
                  ])
                ])
              ], 64)) : (openBlock(), createElementBlock(Fragment, { key: 3 }, [
                createBaseVNode("label", _hoisted_21, [
                  _cache[25] || (_cache[25] = createBaseVNode("span", null, "ä¸»æ’­ä¸»é¡µé“¾æŽ¥", -1)),
                  withDirectives(createBaseVNode("input", {
                    "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => form.creatorProfileUrl = $event),
                    type: "text",
                    placeholder: "ç²˜è´´ä¸»æ’­ä¸»é¡µé“¾æŽ¥æˆ–æŠ–éŸ³åˆ†äº«å�£ä»¤"
                  }, null, 512), [
                    [vModelText, form.creatorProfileUrl]
                  ])
                ]),
                createBaseVNode("label", _hoisted_22, [
                  _cache[26] || (_cache[26] = createBaseVNode("span", null, "æ£€æµ‹å¼€æ’­é—´éš”ï¼ˆåˆ†é’Ÿï¼‰", -1)),
                  withDirectives(createBaseVNode("input", {
                    "onUpdate:modelValue": _cache[7] || (_cache[7] = ($event) => form.creatorMonitorIntervalMinutes = $event),
                    type: "number",
                    min: "1",
                    max: "60"
                  }, null, 512), [
                    [
                      vModelText,
                      form.creatorMonitorIntervalMinutes,
                      void 0,
                      { number: true }
                    ]
                  ])
                ])
              ], 64)),
              createBaseVNode("div", _hoisted_23, [
                !isLiveMode.value || !form.liveMonitorEnabled ? (openBlock(), createElementBlock("label", _hoisted_24, [
                  createBaseVNode("span", null, toDisplayString(isLiveMode.value ? "è¯„è®ºæ•°é‡�ç›®æ ‡" : "æ¯�ä¸ªä½œå“�è¯„è®ºæ•°"), 1),
                  withDirectives(createBaseVNode("input", {
                    "onUpdate:modelValue": _cache[8] || (_cache[8] = ($event) => form.commentLimit = $event),
                    type: "number",
                    min: "1",
                    max: "200"
                  }, null, 512), [
                    [
                      vModelText,
                      form.commentLimit,
                      void 0,
                      { number: true }
                    ]
                  ])
                ])) : createCommentVNode("", true),
                isKeywordMode.value ? (openBlock(), createElementBlock("label", _hoisted_25, [
                  _cache[27] || (_cache[27] = createBaseVNode("span", null, "æœ€å¤šä½œå“�æ•°", -1)),
                  withDirectives(createBaseVNode("input", {
                    "onUpdate:modelValue": _cache[9] || (_cache[9] = ($event) => form.maxVideos = $event),
                    type: "number",
                    min: "1",
                    max: "50"
                  }, null, 512), [
                    [
                      vModelText,
                      form.maxVideos,
                      void 0,
                      { number: true }
                    ]
                  ])
                ])) : isLiveMode.value && form.liveMonitorEnabled ? (openBlock(), createElementBlock("label", _hoisted_26, [
                  _cache[28] || (_cache[28] = createBaseVNode("span", null, "è½®è¯¢é—´éš”ï¼ˆç§’ï¼‰", -1)),
                  withDirectives(createBaseVNode("input", {
                    "onUpdate:modelValue": _cache[10] || (_cache[10] = ($event) => form.liveMonitorIntervalSeconds = $event),
                    type: "number",
                    min: "1",
                    max: "60"
                  }, null, 512), [
                    [
                      vModelText,
                      form.liveMonitorIntervalSeconds,
                      void 0,
                      { number: true }
                    ]
                  ])
                ])) : createCommentVNode("", true)
              ]),
              isLiveMode.value && form.liveMonitorEnabled ? (openBlock(), createElementBlock("label", _hoisted_27, [
                _cache[29] || (_cache[29] = createBaseVNode("span", null, "ç›‘æŽ§æ—¶é•¿ï¼ˆåˆ†é’Ÿï¼Œå�¯ç•™ç©ºï¼‰", -1)),
                withDirectives(createBaseVNode("input", {
                  "onUpdate:modelValue": _cache[11] || (_cache[11] = ($event) => form.liveMonitorMinutes = $event),
                  type: "number",
                  min: "1",
                  max: "1440",
                  placeholder: "ç•™ç©ºè¡¨ç¤ºä¸€ç›´ç›‘æŽ§ï¼Œç›´åˆ°ç›´æ’­é—´ç»“æ�Ÿæˆ–æ‰‹åŠ¨å�œæ­¢"
                }, null, 512), [
                  [vModelText, form.liveMonitorMinutes]
                ])
              ])) : createCommentVNode("", true),
              createBaseVNode("label", _hoisted_28, [
                _cache[30] || (_cache[30] = createBaseVNode("span", null, "å¯¼å‡ºç›®å½•", -1)),
                withDirectives(createBaseVNode("input", {
                  "onUpdate:modelValue": _cache[12] || (_cache[12] = ($event) => form.exportDir = $event),
                  type: "text",
                  placeholder: "ç•™ç©ºåˆ™ä½¿ç”¨åº”ç”¨é»˜è®¤å¯¼å‡ºç›®å½•"
                }, null, 512), [
                  [vModelText, form.exportDir]
                ])
              ]),
              createBaseVNode("div", _hoisted_29, [
                createBaseVNode("button", {
                  class: "primary",
                  disabled: isSubmitting.value,
                  onClick: prepareSession
                }, " æ‰“å¼€æŠ–éŸ³å¹¶å‡†å¤‡ç™»å½• ", 8, _hoisted_30),
                createBaseVNode("button", {
                  class: "primary accent",
                  disabled: !canStart.value,
                  onClick: startTask
                }, " å¼€å§‹é‡‡é›† ", 8, _hoisted_31),
                createBaseVNode("button", {
                  class: "ghost",
                  disabled: isSubmitting.value,
                  onClick: stopTask
                }, toDisplayString(stopButtonText.value), 9, _hoisted_32),
                createBaseVNode("button", {
                  class: "ghost",
                  disabled: isSubmitting.value,
                  onClick: openExportDirectory
                }, " æ‰“å¼€å¯¼å‡ºç›®å½• ", 8, _hoisted_33)
              ]),
              actionError.value ? (openBlock(), createElementBlock("p", _hoisted_34, toDisplayString(actionError.value), 1)) : createCommentVNode("", true),
              createBaseVNode("p", _hoisted_35, toDisplayString(isKeywordMode.value ? "å½“å‰�æ¨¡å¼�ä¼šåœ¨ç™»å½•å�ŽæŒ‰å…³é”®è¯�æ�œç´¢ä½œå“�ï¼Œå†�æ‰¹é‡�é‡‡é›†ä½œå“�ä¸Žè¯„è®ºã€‚" : isLiveMode.value ? "å½“å‰�æ¨¡å¼�ä¼šè¿›å…¥æŒ‡å®šç›´æ’­é—´ï¼ŒæŠ“å�–å½“å‰�è¯„è®ºï¼Œæˆ–æŒ‰å›ºå®šé—´éš”æŒ�ç»­ç›‘æŽ§å¹¶ç´¯è®¡æ”¶é›†æ–°è¯„è®ºï¼›ä¸�å¡«ç›‘æŽ§æ—¶é•¿æ—¶ä¼šä¸€ç›´ç›‘æŽ§ï¼Œç›´åˆ°ç›´æ’­é—´ç»“æ�Ÿæˆ–ä½ æ‰‹åŠ¨å�œæ­¢ã€‚" : isCreatorMode.value ? "å½“å‰�æ¨¡å¼�ä¼šè½®è¯¢ä¸»æ’­ä¸»é¡µï¼Œæ£€æµ‹åˆ°å¼€æ’­å�Žè‡ªåŠ¨è¿›å…¥ç›´æ’­é—´ï¼Œå¹¶ç»§ç»­é‡‡é›†åŽ†å�²è¯„è®ºå’Œæ–°å¢žè¯„è®ºã€‚" : "å½“å‰�æ¨¡å¼�ä¼šç›´æŽ¥è®¿é—®ä½ å¡«å†™çš„ä½œå“�é“¾æŽ¥ï¼Œé‡‡é›†æŒ‡å®šä½œå“�ä¸Žè¯„è®ºã€‚"), 1)
            ]),
            createBaseVNode("div", _hoisted_36, [
              createBaseVNode("div", _hoisted_37, [
                _cache[31] || (_cache[31] = createBaseVNode("h2", null, "è¿�è¡Œæ—¥å¿—", -1)),
                createBaseVNode("span", _hoisted_38, toDisplayString(state.value.logs.length) + " æ�¡", 1)
              ]),
              createBaseVNode("div", _hoisted_39, [
                (openBlock(true), createElementBlock(Fragment, null, renderList(displayedLogs.value, (line) => {
                  return openBlock(), createElementBlock("p", { key: line }, toDisplayString(line), 1);
                }), 128)),
                displayedLogs.value.length === 0 ? (openBlock(), createElementBlock("p", _hoisted_40, "æ—¥å¿—ä¼šåœ¨å�¯åŠ¨æµ�è§ˆå™¨æˆ–æ‰§è¡Œä»»åŠ¡å�Žå‡ºçŽ°ã€‚")) : createCommentVNode("", true)
              ])
            ])
          ]),
          createBaseVNode("section", _hoisted_41, [
            createBaseVNode("div", _hoisted_42, [
              _cache[32] || (_cache[32] = createBaseVNode("h2", null, "è¿�è¡ŒçŠ¶æ€�", -1)),
              createBaseVNode("span", {
                class: normalizeClass(["dot", `status-${state.value.status}`])
              }, null, 2)
            ]),
            createBaseVNode("dl", _hoisted_43, [
              createBaseVNode("div", null, [
                _cache[33] || (_cache[33] = createBaseVNode("dt", null, "å½“å‰�æ¶ˆæ�¯", -1)),
                createBaseVNode("dd", null, toDisplayString(state.value.message), 1)
              ]),
              createBaseVNode("div", null, [
                _cache[34] || (_cache[34] = createBaseVNode("dt", null, "å½“å‰�æ¨¡å¼�", -1)),
                createBaseVNode("dd", null, toDisplayString(currentModeText.value), 1)
              ]),
              createBaseVNode("div", null, [
                _cache[35] || (_cache[35] = createBaseVNode("dt", null, "æµ�è§ˆå™¨çŠ¶æ€�", -1)),
                createBaseVNode("dd", null, toDisplayString(state.value.isBrowserReady ? "å·²å‡†å¤‡" : "æœªå�¯åŠ¨"), 1)
              ]),
              createBaseVNode("div", null, [
                createBaseVNode("dt", null, toDisplayString(currentInputLabel.value), 1),
                createBaseVNode("dd", null, toDisplayString(state.value.currentKeyword || "æš‚æ— "), 1)
              ]),
              createBaseVNode("div", null, [
                _cache[36] || (_cache[36] = createBaseVNode("dt", null, "é‡‡é›†è¿›åº¦", -1)),
                createBaseVNode("dd", null, toDisplayString(state.value.currentVideoIndex) + "/" + toDisplayString(state.value.totalVideos), 1)
              ]),
              createBaseVNode("div", null, [
                _cache[37] || (_cache[37] = createBaseVNode("dt", null, "å·²å®Œæˆ�ä½œå“�", -1)),
                createBaseVNode("dd", null, toDisplayString(state.value.collectedVideos), 1)
              ]),
              createBaseVNode("div", null, [
                _cache[38] || (_cache[38] = createBaseVNode("dt", null, "æœ€è¿‘é”™è¯¯", -1)),
                createBaseVNode("dd", null, toDisplayString(state.value.lastError || "æ— "), 1)
              ])
            ]),
            state.value.exportSummary ? (openBlock(), createElementBlock("div", _hoisted_44, [
              _cache[39] || (_cache[39] = createBaseVNode("h3", null, "å¯¼å‡ºç»“æžœ", -1)),
              createBaseVNode("p", null, "ç›®å½•ï¼š" + toDisplayString(state.value.exportSummary.exportDir), 1),
              createBaseVNode("p", null, "Markdownï¼š" + toDisplayString(state.value.exportSummary.markdownPath), 1),
              createBaseVNode("p", null, "JSONï¼š" + toDisplayString(state.value.exportSummary.jsonPath), 1)
            ])) : createCommentVNode("", true)
          ]),
          createBaseVNode("section", _hoisted_45, [
            createBaseVNode("div", null, [
              _cache[40] || (_cache[40] = createBaseVNode("p", { class: "eyebrow" }, "Subscription Ready", -1)),
              createBaseVNode("p", _hoisted_46, " å½“å‰�å¥—é¤�ï¼š" + toDisplayString(entitlement.value?.plan.name) + " Â· " + toDisplayString(subscriptionStatusText.value) + " Â· åˆ°æœŸæ—¶é—´ " + toDisplayString(renewsAtText.value), 1)
            ]),
            createBaseVNode("div", _hoisted_47, [
              createBaseVNode("div", _hoisted_48, [
                _cache[41] || (_cache[41] = createBaseVNode("span", null, "æŽˆæ�ƒç �", -1)),
                createBaseVNode("strong", null, toDisplayString(entitlement.value?.license.code), 1)
              ]),
              createBaseVNode("button", {
                class: "ghost",
                onClick: logoutLicense
              }, "é€€å‡ºæŽˆæ�ƒ")
            ])
          ])
        ], 64))
      ], 2);
    };
  }
});
createApp(_sfc_main).mount("#app");
:root {
  --bg-strong: #10161f;
  --bg-soft: #182333;
  --panel: rgba(11, 19, 31, 0.78);
  --panel-strong: rgba(16, 27, 44, 0.96);
  --line: rgba(151, 180, 209, 0.18);
  --text-main: #f7efe3;
  --text-soft: #b9c9db;
  --text-faint: #86a1ba;
  --accent: #ff7a59;
  --accent-strong: #ff9b76;
  --accent-cool: #67d1c7;
  --danger: #ff6e72;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  font-weight: normal;
}

ul {
  list-style: none;
}

body {
  min-height: 100vh;
  color: var(--text-main);
  background:
    radial-gradient(circle at top left, rgba(255, 122, 89, 0.18), transparent 28%),
    radial-gradient(circle at top right, rgba(103, 209, 199, 0.16), transparent 26%),
    linear-gradient(160deg, var(--bg-strong), #0b1220 55%, #071019);
  line-height: 1.6;
  font-family:
    'Avenir Next',
    'SF Pro Display',
    'Segoe UI',
    'Helvetica Neue',
    sans-serif;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
}

#app {
  min-height: 100vh;
}

.shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 20px 0 16px;
}

.shell-auth {
  display: flex;
  align-items: center;
  min-height: 100vh;
}

.auth-layout {
  width: 100%;
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: 24px;
}

.hero {
  margin-bottom: 14px;
}

.hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.hero-auth {
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.eyebrow {
  color: var(--accent-cool);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 12px;
  margin-bottom: 8px;
}

.hero h1 {
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1.05;
  font-weight: 800;
  margin-bottom: 12px;
}

.hero-copy {
  max-width: 760px;
  color: var(--text-soft);
  font-size: 17px;
}

.panel {
  margin-bottom: 14px;
}

.grid-two {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 20px;
  align-items: start;
}

.card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(24, 35, 51, 0.92), var(--panel));
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.26);
  backdrop-filter: blur(18px);
}

.params-card {
  height: 650px;
  min-height: 650px;
  max-height: 650px;
}

.log-card {
  height: 650px;
  min-height: 650px;
  max-height: 650px;
}

.runtime-card {
  height: 500px;
  overflow: auto;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.section-head h2,
.export-box h3 {
  font-size: 20px;
  font-weight: 700;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 6px 12px;
  background: rgba(255, 122, 89, 0.14);
  border: 1px solid rgba(255, 122, 89, 0.22);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.badge.soft {
  background: rgba(103, 209, 199, 0.12);
  border-color: rgba(103, 209, 199, 0.18);
  color: var(--accent-cool);
}

.dot {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: var(--text-faint);
  box-shadow: 0 0 0 6px rgba(134, 161, 186, 0.08);
}

.status-idle,
.status-completed {
  background: var(--accent-cool);
}

.status-starting,
.status-waiting_login,
.status-running {
  background: var(--accent);
}

.status-error,
.status-stopped {
  background: var(--danger);
}

.field,
.field-row {
  margin-bottom: 16px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.field span {
  display: block;
  margin-bottom: 8px;
  color: var(--text-soft);
  font-weight: 600;
}

.toggle-field {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toggle-check{
  width: 50px!important;
  flex: none!important;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(5, 12, 22, 0.5);
  color: var(--text-main);
  padding: 14px 16px;
  font-size: 15px;
  outline: none;
  transition:
    border-color 180ms ease,
    transform 180ms ease,
    box-shadow 180ms ease;
}

.field textarea {
  resize: vertical;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: rgba(255, 155, 118, 0.8);
  box-shadow: 0 0 0 4px rgba(255, 122, 89, 0.12);
  transform: translateY(-1px);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}

button {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition:
    transform 180ms ease,
    opacity 180ms ease,
    box-shadow 180ms ease;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

button.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #1e130f;
  box-shadow: 0 18px 30px rgba(255, 122, 89, 0.22);
}

button.primary.accent {
  background: linear-gradient(135deg, #ffd56b, #ff9d5c);
}

button.ghost {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-main);
  border: 1px solid var(--line);
}

.version-button {
  white-space: nowrap;
  max-width: 420px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hint,
.error,
.empty,
.export-box p,
.log-list p,
.stats dt,
.stats dd {
  font-size: 14px;
}

.hint {
  margin-top: 18px;
  color: var(--text-faint);
}

.error {
  margin-top: 16px;
  color: var(--danger);
}

.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.stats div {
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(151, 180, 209, 0.1);
  background: rgba(255, 255, 255, 0.02);
}

.stats dt {
  color: var(--text-faint);
  margin-bottom: 6px;
}

.stats dd {
  color: var(--text-main);
  word-break: break-word;
}

.export-box {
  margin-top: 18px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(103, 209, 199, 0.14);
  background: rgba(103, 209, 199, 0.05);
}

.log-list {
  height: 100%;
  min-height: 0;
  max-height: 100%;
  overflow: auto;
  padding-right: 6px;
}

.log-list p {
  color: var(--text-soft);
  padding: 8px 0;
  border-bottom: 1px solid rgba(151, 180, 209, 0.08);
  word-break: break-word;
}

.log-list p:last-child {
  border-bottom: 0;
}

.empty {
  color: var(--text-faint);
}

.auth-card {
  align-self: center;
}

.auth-button {
  width: 100%;
  margin-top: 20px;
}

.device-box,
.license-banner,
.mini-stat {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 20px;
}

.mini-stat strong {
  display: block;
  margin-bottom: 8px;
}

.device-box p,
.hero-copy.compact {
  color: var(--text-soft);
}

.device-box {
  margin-bottom: 18px;
  padding: 16px;
}

.auth-qr {
  width: 200px;
  height: 200px;
  margin-top: 14px;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.auth-qr img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.license-banner {
  margin-bottom: 0;
  margin-top: 12px;
  padding: 22px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.license-banner h2 {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 8px;
}

.license-banner-side {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.mini-stat {
  padding: 14px 16px;
}

.mini-stat span {
  display: block;
  color: var(--text-faint);
  font-size: 13px;
  margin-bottom: 6px;
}

.hero-copy.compact {
  max-width: none;
  font-size: 15px;
}

@media (max-width: 980px) {
  .auth-layout {
    grid-template-columns: 1fr;
  }

  .license-banner,
  .license-banner-side {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 720px) {
  .shell {
    width: calc(100vw - 20px);
    padding-top: 28px;
  }

  .grid-two,
  .field-row,
  .stats {
    grid-template-columns: 1fr;
  }
}
<!doctype html>
<html>
  <head>
    <meta charset="UTF-8" />
    <title>Electron</title>
    <!-- https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP -->
    <meta
      http-equiv="Content-Security-Policy"
      content="default-src 'self'; connect-src 'self' http://test-datatoolbox-backend.randomness.website; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data:"
    />
    <script type="module" crossorigin src="./assets/index-CNO0bO7Y.js"></script>
    <link rel="stylesheet" crossorigin href="./assets/index-CifaCZZf.css">
  </head>

  <body>
    <div id="app"></div>
  </body>
</html>
{
  "name": "datatool",
  "version": "1.0.0",
  "description": "An Electron application with Vue and TypeScript",
  "main": "./out/main/index.js",
  "author": "example.com",
  "homepage": "https://electron-vite.org",
  "dependencies": {
    "@electron-toolkit/preload": "^3.0.2",
    "@electron-toolkit/utils": "^4.0.0",
    "electron-updater": "^6.3.9",
    "playwright": "^1.61.1"
  }
}#!/usr/bin/env bash
set -euo pipefail

PROJECT_DIR="$(cd "$(dirname "$0")/.." && pwd)"
REMOTE_DIR_DEFAULT="/home/ubuntu/datatoolbox-client"
REMOTE_DIR="${DEPLOY_REMOTE_DIR:-$REMOTE_DIR_DEFAULT}"
REMOTE_HOST_DEFAULT="ubuntu@43.155.239.210"
REMOTE_HOST="${DEPLOY_HOST:-$REMOTE_HOST_DEFAULT}"
REMOTE_PORT_DEFAULT="22"
REMOTE_PORT="${DEPLOY_PORT:-$REMOTE_PORT_DEFAULT}"
SSH_KEY_PATH_DEFAULT="$HOME/.ssh/ssh-key.pem"
SSH_KEY_PATH="${DEPLOY_SSH_KEY:-$SSH_KEY_PATH_DEFAULT}"
CLIENT_TARGET_DEFAULT="mac"
CLIENT_TARGET="${CLIENT_TARGET:-$CLIENT_TARGET_DEFAULT}"
SSH_OPTS=()
SCP_OPTS=()

if [[ -f "$SSH_KEY_PATH" ]]; then
  SSH_OPTS=(-i "$SSH_KEY_PATH" -p "$REMOTE_PORT")
  SCP_OPTS=(-i "$SSH_KEY_PATH" -P "$REMOTE_PORT")
  echo "==> ä½¿ç”¨ç§�é’¥: $SSH_KEY_PATH"
else
  SSH_OPTS=(-p "$REMOTE_PORT")
  SCP_OPTS=(-P "$REMOTE_PORT")
  echo "==> æœªæ‰¾åˆ°ç§�é’¥ï¼Œå›žé€€ä½¿ç”¨ç³»ç»Ÿ SSH å‡­æ�®"
fi

run_ssh() {
  ssh "${SSH_OPTS[@]}" "$REMOTE_HOST" "$@"
}

run_scp() {
  scp "${SCP_OPTS[@]}" -r "$@"
}

echo "==> è¿›å…¥å®¢æˆ·ç«¯é¡¹ç›®"
cd "$PROJECT_DIR"

case "$CLIENT_TARGET" in
  mac)
    BUILD_SCRIPT="build:mac"
    ;;
  win)
    BUILD_SCRIPT="build:win"
    ;;
  linux)
    BUILD_SCRIPT="build:linux"
    ;;
  *)
    echo "â�Œ ä¸�æ”¯æŒ�çš„ CLIENT_TARGET: $CLIENT_TARGETï¼Œå�¯é€‰å€¼: mac | win | linux"
    exit 1
    ;;
esac

echo "==> æž„å»ºå®¢æˆ·ç«¯å®‰è£…åŒ… ($CLIENT_TARGET)"
npm run "$BUILD_SCRIPT"

if [[ ! -d "$PROJECT_DIR/dist" ]]; then
  echo "â�Œ dist ç›®å½•ä¸�å­˜åœ¨"
  exit 1
fi

echo "==> å‡†å¤‡è¿œç«¯ç›®å½•"
run_ssh "mkdir -p '$REMOTE_DIR'"

echo "==> ä¸Šä¼ å®¢æˆ·ç«¯æž„å»ºäº§ç‰©"
run_scp "$PROJECT_DIR/dist" "$REMOTE_HOST:$REMOTE_DIR/"

echo "==> æ ¡éªŒè¿œç«¯å®¢æˆ·ç«¯ç›®å½•"
run_ssh "ls -lah '$REMOTE_DIR/dist' | head -n 20"

echo "==> å®¢æˆ·ç«¯éƒ¨ç½²å®Œæˆ�"
echo "REMOTE_HOST=$REMOTE_HOST"
echo "REMOTE_DIR=$REMOTE_DIR"
echo "CLIENT_TARGET=$CLIENT_TARGET"
